From 59c974567cfbd494240493f81909919356125c5e Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 20 Feb 2026 01:08:04 +0000 Subject: [PATCH 1/2] feat: add public libraries for CES v1beta PiperOrigin-RevId: 872569929 Source-Link: https://github.com/googleapis/googleapis/commit/3a4f0282940729dbd1fd4ad315585f55f944e8e3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/6e30b988cc81459cd7bc00320af6f2911b679cc9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNlcy8uT3dsQm90LnlhbWwiLCJoIjoiNmUzMGI5ODhjYzgxNDU5Y2Q3YmMwMDMyMGFmNmYyOTExYjY3OWNjOSJ9 --- owl-bot-staging/google-cloud-ces/.OwlBot.yaml | 19 + .../google-cloud-ces/.eslintignore | 7 + .../google-cloud-ces/.eslintrc.json | 3 + .../google-cloud-ces/.gitattributes | 4 + owl-bot-staging/google-cloud-ces/.gitignore | 14 + owl-bot-staging/google-cloud-ces/.jsdoc.js | 55 + owl-bot-staging/google-cloud-ces/.mocharc.js | 33 + owl-bot-staging/google-cloud-ces/.nycrc | 24 + .../google-cloud-ces/.prettierignore | 6 + .../google-cloud-ces/.prettierrc.js | 22 + .../google-cloud-ces/CODE_OF_CONDUCT.md | 94 + .../google-cloud-ces/CONTRIBUTING.md | 76 + owl-bot-staging/google-cloud-ces/LICENSE | 202 + owl-bot-staging/google-cloud-ces/README.md | 253 + .../protos/google/cloud/ces/v1/agent.proto | 236 + .../google/cloud/ces/v1/agent_service.proto | 1695 + .../google/cloud/ces/v1/agent_transfers.proto | 101 + .../protos/google/cloud/ces/v1/app.proto | 651 + .../google/cloud/ces/v1/app_version.proto | 91 + .../protos/google/cloud/ces/v1/auth.proto | 195 + .../google/cloud/ces/v1/bigquery_export.proto | 40 + .../google/cloud/ces/v1/changelog.proto | 82 + .../google/cloud/ces/v1/client_function.proto | 44 + .../protos/google/cloud/ces/v1/common.proto | 344 + .../google/cloud/ces/v1/connector_tool.proto | 111 + .../cloud/ces/v1/connector_toolset.proto | 50 + .../google/cloud/ces/v1/conversation.proto | 165 + .../google/cloud/ces/v1/data_store.proto | 98 + .../google/cloud/ces/v1/data_store_tool.proto | 302 + .../google/cloud/ces/v1/deployment.proto | 70 + .../protos/google/cloud/ces/v1/example.proto | 225 + .../protos/google/cloud/ces/v1/fakes.proto | 50 + .../cloud/ces/v1/file_search_tool.proto | 55 + .../cloud/ces/v1/google_search_tool.proto | 69 + .../google/cloud/ces/v1/guardrail.proto | 311 + .../protos/google/cloud/ces/v1/mcp_tool.proto | 69 + .../google/cloud/ces/v1/mcp_toolset.proto | 54 + .../google/cloud/ces/v1/omnichannel.proto | 135 + .../cloud/ces/v1/omnichannel_service.proto | 46 + .../google/cloud/ces/v1/open_api_tool.proto | 65 + .../cloud/ces/v1/open_api_toolset.proto | 56 + .../google/cloud/ces/v1/python_function.proto | 39 + .../protos/google/cloud/ces/v1/schema.proto | 140 + .../cloud/ces/v1/search_suggestions.proto | 45 + .../google/cloud/ces/v1/session_service.proto | 456 + .../google/cloud/ces/v1/system_tool.proto | 33 + .../protos/google/cloud/ces/v1/tool.proto | 124 + .../google/cloud/ces/v1/tool_service.proto | 189 + .../protos/google/cloud/ces/v1/toolset.proto | 90 + .../google/cloud/ces/v1/toolset_tool.proto | 39 + .../google/cloud/ces/v1/widget_service.proto | 79 + .../google/cloud/ces/v1/widget_tool.proto | 84 + .../google/cloud/ces/v1beta/agent.proto | 236 + .../cloud/ces/v1beta/agent_service.proto | 1756 + .../cloud/ces/v1beta/agent_transfers.proto | 101 + .../protos/google/cloud/ces/v1beta/app.proto | 775 + .../google/cloud/ces/v1beta/app_version.proto | 91 + .../protos/google/cloud/ces/v1beta/auth.proto | 195 + .../cloud/ces/v1beta/bigquery_export.proto | 40 + .../google/cloud/ces/v1beta/changelog.proto | 82 + .../cloud/ces/v1beta/client_function.proto | 44 + .../google/cloud/ces/v1beta/common.proto | 347 + .../cloud/ces/v1beta/connector_tool.proto | 111 + .../cloud/ces/v1beta/connector_toolset.proto | 50 + .../cloud/ces/v1beta/conversation.proto | 165 + .../google/cloud/ces/v1beta/data_store.proto | 98 + .../cloud/ces/v1beta/data_store_tool.proto | 302 + .../google/cloud/ces/v1beta/deployment.proto | 70 + .../google/cloud/ces/v1beta/evaluation.proto | 1706 + .../cloud/ces/v1beta/evaluation_service.proto | 1192 + .../google/cloud/ces/v1beta/example.proto | 229 + .../google/cloud/ces/v1beta/fakes.proto | 62 + .../cloud/ces/v1beta/file_search_tool.proto | 55 + .../google/cloud/ces/v1beta/golden_run.proto | 36 + .../cloud/ces/v1beta/google_search_tool.proto | 69 + .../google/cloud/ces/v1beta/guardrail.proto | 311 + .../google/cloud/ces/v1beta/mcp_tool.proto | 69 + .../google/cloud/ces/v1beta/mcp_toolset.proto | 54 + .../google/cloud/ces/v1beta/omnichannel.proto | 135 + .../ces/v1beta/omnichannel_service.proto | 46 + .../cloud/ces/v1beta/open_api_tool.proto | 65 + .../cloud/ces/v1beta/open_api_toolset.proto | 56 + .../cloud/ces/v1beta/python_function.proto | 39 + .../google/cloud/ces/v1beta/schema.proto | 140 + .../cloud/ces/v1beta/search_suggestions.proto | 45 + .../cloud/ces/v1beta/session_service.proto | 459 + .../google/cloud/ces/v1beta/system_tool.proto | 33 + .../protos/google/cloud/ces/v1beta/tool.proto | 124 + .../cloud/ces/v1beta/tool_service.proto | 195 + .../google/cloud/ces/v1beta/toolset.proto | 90 + .../cloud/ces/v1beta/toolset_tool.proto | 39 + .../cloud/ces/v1beta/widget_service.proto | 79 + .../google/cloud/ces/v1beta/widget_tool.proto | 90 + .../google-cloud-ces/protos/protos.d.ts | 72921 ++++++ .../google-cloud-ces/protos/protos.js | 185109 +++++++++++++++ .../google-cloud-ces/protos/protos.json | 22318 ++ ...gent_service.batch_delete_conversations.js | 69 + .../v1/agent_service.create_agent.js | 72 + .../generated/v1/agent_service.create_app.js | 73 + .../v1/agent_service.create_app_version.js | 72 + .../v1/agent_service.create_deployment.js | 74 + .../v1/agent_service.create_example.js | 72 + .../v1/agent_service.create_guardrail.js | 72 + .../generated/v1/agent_service.create_tool.js | 72 + .../v1/agent_service.create_toolset.js | 72 + .../v1/agent_service.delete_agent.js | 77 + .../generated/v1/agent_service.delete_app.js | 69 + .../v1/agent_service.delete_app_version.js | 68 + .../v1/agent_service.delete_conversation.js | 66 + .../v1/agent_service.delete_deployment.js | 69 + .../v1/agent_service.delete_example.js | 68 + .../v1/agent_service.delete_guardrail.js | 77 + .../generated/v1/agent_service.delete_tool.js | 77 + .../v1/agent_service.delete_toolset.js | 77 + .../generated/v1/agent_service.export_app.js | 74 + .../generated/v1/agent_service.get_agent.js | 61 + .../generated/v1/agent_service.get_app.js | 61 + .../v1/agent_service.get_app_version.js | 61 + .../v1/agent_service.get_changelog.js | 61 + .../v1/agent_service.get_conversation.js | 66 + .../v1/agent_service.get_deployment.js | 63 + .../generated/v1/agent_service.get_example.js | 61 + .../v1/agent_service.get_guardrail.js | 61 + .../generated/v1/agent_service.get_tool.js | 61 + .../generated/v1/agent_service.get_toolset.js | 61 + .../generated/v1/agent_service.import_app.js | 102 + .../generated/v1/agent_service.list_agents.js | 86 + .../v1/agent_service.list_app_versions.js | 86 + .../generated/v1/agent_service.list_apps.js | 85 + .../v1/agent_service.list_changelogs.js | 98 + .../v1/agent_service.list_conversations.js | 91 + .../v1/agent_service.list_deployments.js | 84 + .../v1/agent_service.list_examples.js | 86 + .../v1/agent_service.list_guardrails.js | 86 + .../generated/v1/agent_service.list_tools.js | 86 + .../v1/agent_service.list_toolsets.js | 86 + .../v1/agent_service.restore_app_version.js | 62 + .../v1/agent_service.update_agent.js | 66 + .../generated/v1/agent_service.update_app.js | 66 + .../v1/agent_service.update_deployment.js | 65 + .../v1/agent_service.update_example.js | 66 + .../v1/agent_service.update_guardrail.js | 66 + .../generated/v1/agent_service.update_tool.js | 66 + .../v1/agent_service.update_toolset.js | 66 + .../v1/session_service.bidi_run_session.js | 68 + .../v1/session_service.run_session.js | 66 + .../snippet_metadata_google.cloud.ces.v1.json | 2559 + .../generated/v1/tool_service.execute_tool.js | 78 + .../v1/tool_service.retrieve_tool_schema.js | 74 + .../v1/tool_service.retrieve_tools.js | 68 + .../v1/widget_service.generate_chat_token.js | 74 + ...gent_service.batch_delete_conversations.js | 69 + .../v1beta/agent_service.create_agent.js | 72 + .../v1beta/agent_service.create_app.js | 73 + .../agent_service.create_app_version.js | 72 + .../v1beta/agent_service.create_deployment.js | 74 + .../v1beta/agent_service.create_example.js | 72 + .../v1beta/agent_service.create_guardrail.js | 72 + .../v1beta/agent_service.create_tool.js | 72 + .../v1beta/agent_service.create_toolset.js | 72 + .../v1beta/agent_service.delete_agent.js | 77 + .../v1beta/agent_service.delete_app.js | 69 + .../agent_service.delete_app_version.js | 68 + .../agent_service.delete_conversation.js | 66 + .../v1beta/agent_service.delete_deployment.js | 69 + .../v1beta/agent_service.delete_example.js | 68 + .../v1beta/agent_service.delete_guardrail.js | 77 + .../v1beta/agent_service.delete_tool.js | 77 + .../v1beta/agent_service.delete_toolset.js | 77 + .../v1beta/agent_service.export_app.js | 74 + .../v1beta/agent_service.get_agent.js | 61 + .../generated/v1beta/agent_service.get_app.js | 61 + .../v1beta/agent_service.get_app_version.js | 61 + .../v1beta/agent_service.get_changelog.js | 61 + .../v1beta/agent_service.get_conversation.js | 66 + .../v1beta/agent_service.get_deployment.js | 63 + .../v1beta/agent_service.get_example.js | 61 + .../v1beta/agent_service.get_guardrail.js | 61 + .../v1beta/agent_service.get_tool.js | 61 + .../v1beta/agent_service.get_toolset.js | 61 + .../v1beta/agent_service.import_app.js | 102 + .../v1beta/agent_service.list_agents.js | 86 + .../v1beta/agent_service.list_app_versions.js | 86 + .../v1beta/agent_service.list_apps.js | 86 + .../v1beta/agent_service.list_changelogs.js | 98 + .../agent_service.list_conversations.js | 91 + .../v1beta/agent_service.list_deployments.js | 84 + .../v1beta/agent_service.list_examples.js | 86 + .../v1beta/agent_service.list_guardrails.js | 86 + .../v1beta/agent_service.list_tools.js | 87 + .../v1beta/agent_service.list_toolsets.js | 86 + .../agent_service.restore_app_version.js | 62 + .../v1beta/agent_service.update_agent.js | 66 + .../v1beta/agent_service.update_app.js | 66 + .../v1beta/agent_service.update_deployment.js | 65 + .../v1beta/agent_service.update_example.js | 66 + .../v1beta/agent_service.update_guardrail.js | 66 + .../v1beta/agent_service.update_tool.js | 66 + .../v1beta/agent_service.update_toolset.js | 66 + .../evaluation_service.create_evaluation.js | 74 + ...ation_service.create_evaluation_dataset.js | 74 + ...n_service.create_evaluation_expectation.js | 75 + ...service.create_scheduled_evaluation_run.js | 74 + .../evaluation_service.delete_evaluation.js | 77 + ...ation_service.delete_evaluation_dataset.js | 68 + ...n_service.delete_evaluation_expectation.js | 68 + ...uation_service.delete_evaluation_result.js | 61 + ...valuation_service.delete_evaluation_run.js | 62 + ...service.delete_scheduled_evaluation_run.js | 66 + .../evaluation_service.generate_evaluation.js | 69 + .../evaluation_service.get_evaluation.js | 61 + ...aluation_service.get_evaluation_dataset.js | 61 + ...tion_service.get_evaluation_expectation.js | 61 + ...valuation_service.get_evaluation_result.js | 61 + .../evaluation_service.get_evaluation_run.js | 61 + ...on_service.get_scheduled_evaluation_run.js | 61 + .../evaluation_service.import_evaluations.js | 82 + ...uation_service.list_evaluation_datasets.js | 89 + ...on_service.list_evaluation_expectations.js | 90 + ...luation_service.list_evaluation_results.js | 92 + ...evaluation_service.list_evaluation_runs.js | 89 + .../evaluation_service.list_evaluations.js | 101 + ..._service.list_scheduled_evaluation_runs.js | 94 + .../evaluation_service.run_evaluation.js | 122 + .../evaluation_service.test_persona_voice.js | 73 + .../evaluation_service.update_evaluation.js | 66 + ...ation_service.update_evaluation_dataset.js | 66 + ...n_service.update_evaluation_expectation.js | 66 + ...service.update_scheduled_evaluation_run.js | 66 + ...luation_service.upload_evaluation_audio.js | 69 + .../session_service.bidi_run_session.js | 68 + .../v1beta/session_service.run_session.js | 66 + ...ppet_metadata_google.cloud.ces.v1beta.json | 4055 + .../v1beta/tool_service.execute_tool.js | 82 + .../tool_service.retrieve_tool_schema.js | 74 + .../v1beta/tool_service.retrieve_tools.js | 68 + .../widget_service.generate_chat_token.js | 74 + owl-bot-staging/google-cloud-ces/src/index.ts | 34 + .../src/v1/agent_service_client.ts | 7641 + .../src/v1/agent_service_client_config.json | 266 + .../src/v1/agent_service_proto_list.json | 40 + .../src/v1/gapic_metadata.json | 640 + .../google-cloud-ces/src/v1/index.ts | 22 + .../src/v1/session_service_client.ts | 1383 + .../src/v1/session_service_client_config.json | 36 + .../src/v1/session_service_proto_list.json | 40 + .../src/v1/tool_service_client.ts | 1431 + .../src/v1/tool_service_client_config.json | 41 + .../src/v1/tool_service_proto_list.json | 40 + .../src/v1/widget_service_client.ts | 1291 + .../src/v1/widget_service_client_config.json | 30 + .../src/v1/widget_service_proto_list.json | 40 + .../src/v1beta/agent_service_client.ts | 8050 + .../v1beta/agent_service_client_config.json | 266 + .../src/v1beta/agent_service_proto_list.json | 43 + .../src/v1beta/evaluation_service_client.ts | 5887 + .../evaluation_service_client_config.json | 181 + .../v1beta/evaluation_service_proto_list.json | 43 + .../src/v1beta/gapic_metadata.json | 988 + .../google-cloud-ces/src/v1beta/index.ts | 23 + .../src/v1beta/session_service_client.ts | 1787 + .../v1beta/session_service_client_config.json | 36 + .../v1beta/session_service_proto_list.json | 43 + .../src/v1beta/tool_service_client.ts | 1836 + .../v1beta/tool_service_client_config.json | 41 + .../src/v1beta/tool_service_proto_list.json | 43 + .../src/v1beta/widget_service_client.ts | 1694 + .../v1beta/widget_service_client_config.json | 30 + .../src/v1beta/widget_service_proto_list.json | 43 + .../system-test/fixtures/sample/src/index.js | 30 + .../system-test/fixtures/sample/src/index.ts | 50 + .../google-cloud-ces/system-test/install.ts | 49 + .../test/gapic_agent_service_v1.ts | 8205 + .../test/gapic_agent_service_v1beta.ts | 8537 + .../test/gapic_evaluation_service_v1beta.ts | 6049 + .../test/gapic_session_service_v1.ts | 1222 + .../test/gapic_session_service_v1beta.ts | 1554 + .../test/gapic_tool_service_v1.ts | 1305 + .../test/gapic_tool_service_v1beta.ts | 1637 + .../test/gapic_widget_service_v1.ts | 1143 + .../test/gapic_widget_service_v1beta.ts | 1475 + .../google-cloud-ces/tsconfig.json | 22 + .../google-cloud-ces/webpack.config.js | 64 + 283 files changed, 379867 insertions(+) create mode 100644 owl-bot-staging/google-cloud-ces/.OwlBot.yaml create mode 100644 owl-bot-staging/google-cloud-ces/.eslintignore create mode 100644 owl-bot-staging/google-cloud-ces/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-ces/.gitattributes create mode 100644 owl-bot-staging/google-cloud-ces/.gitignore create mode 100644 owl-bot-staging/google-cloud-ces/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-ces/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-ces/.nycrc create mode 100644 owl-bot-staging/google-cloud-ces/.prettierignore create mode 100644 owl-bot-staging/google-cloud-ces/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-ces/CODE_OF_CONDUCT.md create mode 100644 owl-bot-staging/google-cloud-ces/CONTRIBUTING.md create mode 100644 owl-bot-staging/google-cloud-ces/LICENSE create mode 100644 owl-bot-staging/google-cloud-ces/README.md create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent_service.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent_transfers.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/app.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/app_version.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/auth.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/bigquery_export.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/changelog.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/client_function.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/common.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/connector_tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/connector_toolset.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/conversation.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/data_store.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/data_store_tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/deployment.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/example.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/fakes.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/file_search_tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/google_search_tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/guardrail.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/mcp_tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/mcp_toolset.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/omnichannel.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/omnichannel_service.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/open_api_tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/open_api_toolset.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/python_function.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/schema.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/search_suggestions.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/session_service.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/system_tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/tool_service.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/toolset.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/toolset_tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/widget_service.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/widget_tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/agent.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_service.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_transfers.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/app.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/app_version.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/auth.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/bigquery_export.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/changelog.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/client_function.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/common.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/connector_tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/connector_toolset.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/conversation.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/data_store.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/data_store_tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/deployment.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/evaluation.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/evaluation_service.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/example.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/fakes.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/file_search_tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/golden_run.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/google_search_tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/guardrail.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/mcp_tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/mcp_toolset.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/omnichannel.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/omnichannel_service.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/open_api_tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/open_api_toolset.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/python_function.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/schema.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/search_suggestions.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/session_service.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/system_tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/tool_service.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/toolset.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/toolset_tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/widget_service.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/widget_tool.proto create mode 100644 owl-bot-staging/google-cloud-ces/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-ces/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-ces/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.batch_delete_conversations.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_agent.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_app.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_app_version.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_deployment.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_example.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_guardrail.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_tool.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_toolset.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_agent.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_app.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_app_version.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_conversation.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_deployment.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_example.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_guardrail.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_tool.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_toolset.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.export_app.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_agent.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_app.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_app_version.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_changelog.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_conversation.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_deployment.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_example.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_guardrail.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_tool.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_toolset.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.import_app.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_agents.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_app_versions.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_apps.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_changelogs.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_conversations.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_deployments.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_examples.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_guardrails.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_tools.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_toolsets.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.restore_app_version.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_agent.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_app.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_deployment.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_example.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_guardrail.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_tool.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_toolset.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/session_service.bidi_run_session.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/session_service.run_session.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/snippet_metadata_google.cloud.ces.v1.json create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.execute_tool.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tool_schema.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tools.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/widget_service.generate_chat_token.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.batch_delete_conversations.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_agent.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_app.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_app_version.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_deployment.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_example.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_guardrail.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_tool.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_toolset.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_agent.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app_version.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_conversation.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_deployment.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_example.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_guardrail.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_tool.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_toolset.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.export_app.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_agent.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_app.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_app_version.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_changelog.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_conversation.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_deployment.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_example.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_guardrail.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_tool.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_toolset.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.import_app.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_agents.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_app_versions.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_apps.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_changelogs.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_conversations.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_deployments.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_examples.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_guardrails.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_tools.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_toolsets.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.restore_app_version.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_agent.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_app.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_deployment.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_example.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_guardrail.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_tool.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_toolset.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_dataset.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_expectation.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_scheduled_evaluation_run.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_dataset.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_expectation.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_result.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_run.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_scheduled_evaluation_run.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.generate_evaluation.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_dataset.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_expectation.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_result.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_run.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_scheduled_evaluation_run.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.import_evaluations.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_datasets.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_expectations.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_results.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_runs.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluations.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_scheduled_evaluation_runs.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.run_evaluation.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.test_persona_voice.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_dataset.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_expectation.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_scheduled_evaluation_run.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.upload_evaluation_audio.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/session_service.bidi_run_session.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/session_service.run_session.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/snippet_metadata_google.cloud.ces.v1beta.json create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/tool_service.execute_tool.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tool_schema.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tools.js create mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1beta/widget_service.generate_chat_token.js create mode 100644 owl-bot-staging/google-cloud-ces/src/index.ts create mode 100644 owl-bot-staging/google-cloud-ces/src/v1/agent_service_client.ts create mode 100644 owl-bot-staging/google-cloud-ces/src/v1/agent_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1/agent_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-ces/src/v1/session_service_client.ts create mode 100644 owl-bot-staging/google-cloud-ces/src/v1/session_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1/session_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1/tool_service_client.ts create mode 100644 owl-bot-staging/google-cloud-ces/src/v1/tool_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1/tool_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1/widget_service_client.ts create mode 100644 owl-bot-staging/google-cloud-ces/src/v1/widget_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1/widget_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1beta/agent_service_client.ts create mode 100644 owl-bot-staging/google-cloud-ces/src/v1beta/agent_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1beta/agent_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1beta/evaluation_service_client.ts create mode 100644 owl-bot-staging/google-cloud-ces/src/v1beta/evaluation_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1beta/evaluation_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1beta/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1beta/index.ts create mode 100644 owl-bot-staging/google-cloud-ces/src/v1beta/session_service_client.ts create mode 100644 owl-bot-staging/google-cloud-ces/src/v1beta/session_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1beta/session_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1beta/tool_service_client.ts create mode 100644 owl-bot-staging/google-cloud-ces/src/v1beta/tool_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1beta/tool_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1beta/widget_service_client.ts create mode 100644 owl-bot-staging/google-cloud-ces/src/v1beta/widget_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-ces/src/v1beta/widget_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-ces/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-ces/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-ces/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-ces/test/gapic_agent_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-ces/test/gapic_agent_service_v1beta.ts create mode 100644 owl-bot-staging/google-cloud-ces/test/gapic_evaluation_service_v1beta.ts create mode 100644 owl-bot-staging/google-cloud-ces/test/gapic_session_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-ces/test/gapic_session_service_v1beta.ts create mode 100644 owl-bot-staging/google-cloud-ces/test/gapic_tool_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-ces/test/gapic_tool_service_v1beta.ts create mode 100644 owl-bot-staging/google-cloud-ces/test/gapic_widget_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-ces/test/gapic_widget_service_v1beta.ts create mode 100644 owl-bot-staging/google-cloud-ces/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-ces/webpack.config.js diff --git a/owl-bot-staging/google-cloud-ces/.OwlBot.yaml b/owl-bot-staging/google-cloud-ces/.OwlBot.yaml new file mode 100644 index 00000000000..f556cf1b8e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/.OwlBot.yaml @@ -0,0 +1,19 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. + +deep-copy-regex: + - source: /google/cloud/ces/google-cloud-ces-nodejs + dest: /owl-bot-staging/google-cloud-ces + +api-name: ces \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/.eslintignore b/owl-bot-staging/google-cloud-ces/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-ces/.eslintrc.json b/owl-bot-staging/google-cloud-ces/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-ces/.gitattributes b/owl-bot-staging/google-cloud-ces/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/google-cloud-ces/.gitignore b/owl-bot-staging/google-cloud-ces/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/.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-ces/.jsdoc.js b/owl-bot-staging/google-cloud-ces/.jsdoc.js new file mode 100644 index 00000000000..d3f4c9562f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2026 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/ces', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-ces/.mocharc.js b/owl-bot-staging/google-cloud-ces/.mocharc.js new file mode 100644 index 00000000000..5eb34e86c87 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-ces/.nycrc b/owl-bot-staging/google-cloud-ces/.nycrc new file mode 100644 index 00000000000..81a95fc94b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/.prettierignore b/owl-bot-staging/google-cloud-ces/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/owl-bot-staging/google-cloud-ces/.prettierrc.js b/owl-bot-staging/google-cloud-ces/.prettierrc.js new file mode 100644 index 00000000000..7649ee3c254 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-ces/CODE_OF_CONDUCT.md b/owl-bot-staging/google-cloud-ces/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/CONTRIBUTING.md b/owl-bot-staging/google-cloud-ces/CONTRIBUTING.md new file mode 100644 index 00000000000..ab779cdc399 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Ces API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=ces.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/LICENSE b/owl-bot-staging/google-cloud-ces/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-ces/README.md b/owl-bot-staging/google-cloud-ces/README.md new file mode 100644 index 00000000000..42995b8cdeb --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/README.md @@ -0,0 +1,253 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +# [Gemini Enterprise for Customer Experience API: Nodejs Client][homepage] + +This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. + +[![npm version](https://img.shields.io/npm/v/@google-cloud/ces.svg)](https://www.npmjs.org/package/@google-cloud/ces) + +Gemini Enterprise for Customer Experience API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [Gemini Enterprise for Customer Experience API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/ces/latest) +* [Gemini Enterprise for Customer Experience API Documentation](https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Gemini Enterprise for Customer Experience API API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/ces +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | +| --------------------------- | --------------------------------- | +| batch delete conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.batch_delete_conversations.js) | +| create agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.create_agent.js) | +| create app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.create_app.js) | +| create app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.create_app_version.js) | +| create deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.create_deployment.js) | +| create example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.create_example.js) | +| create guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.create_guardrail.js) | +| create tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.create_tool.js) | +| create toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.create_toolset.js) | +| delete agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.delete_agent.js) | +| delete app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.delete_app.js) | +| delete app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.delete_app_version.js) | +| delete conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.delete_conversation.js) | +| delete deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.delete_deployment.js) | +| delete example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.delete_example.js) | +| delete guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.delete_guardrail.js) | +| delete tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.delete_tool.js) | +| delete toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.delete_toolset.js) | +| export app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.export_app.js) | +| get agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_agent.js) | +| get app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_app.js) | +| get app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_app_version.js) | +| get changelog | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_changelog.js) | +| get conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_conversation.js) | +| get deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_deployment.js) | +| get example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_example.js) | +| get guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_guardrail.js) | +| get tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_tool.js) | +| get toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_toolset.js) | +| import app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.import_app.js) | +| list agents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_agents.js) | +| list app versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_app_versions.js) | +| list apps | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_apps.js) | +| list changelogs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_changelogs.js) | +| list conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_conversations.js) | +| list deployments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_deployments.js) | +| list examples | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_examples.js) | +| list guardrails | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_guardrails.js) | +| list tools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_tools.js) | +| list toolsets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_toolsets.js) | +| restore app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.restore_app_version.js) | +| update agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.update_agent.js) | +| update app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.update_app.js) | +| update deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.update_deployment.js) | +| update example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.update_example.js) | +| update guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.update_guardrail.js) | +| update tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.update_tool.js) | +| update toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.update_toolset.js) | +| bidi run session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/session_service.bidi_run_session.js) | +| run session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/session_service.run_session.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/snippet_metadata_google.cloud.ces.v1.json) | +| execute tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/tool_service.execute_tool.js) | +| retrieve tool schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tool_schema.js) | +| retrieve tools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tools.js) | +| generate chat token | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/widget_service.generate_chat_token.js) | +| batch delete conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.batch_delete_conversations.js) | +| create agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_agent.js) | +| create app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_app.js) | +| create app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_app_version.js) | +| create deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_deployment.js) | +| create example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_example.js) | +| create guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_guardrail.js) | +| create tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_tool.js) | +| create toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_toolset.js) | +| delete agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_agent.js) | +| delete app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app.js) | +| delete app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app_version.js) | +| delete conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_conversation.js) | +| delete deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_deployment.js) | +| delete example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_example.js) | +| delete guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_guardrail.js) | +| delete tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_tool.js) | +| delete toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_toolset.js) | +| export app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.export_app.js) | +| get agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_agent.js) | +| get app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_app.js) | +| get app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_app_version.js) | +| get changelog | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_changelog.js) | +| get conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_conversation.js) | +| get deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_deployment.js) | +| get example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_example.js) | +| get guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_guardrail.js) | +| get tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_tool.js) | +| get toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_toolset.js) | +| import app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.import_app.js) | +| list agents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_agents.js) | +| list app versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_app_versions.js) | +| list apps | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_apps.js) | +| list changelogs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_changelogs.js) | +| list conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_conversations.js) | +| list deployments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_deployments.js) | +| list examples | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_examples.js) | +| list guardrails | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_guardrails.js) | +| list tools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_tools.js) | +| list toolsets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_toolsets.js) | +| restore app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.restore_app_version.js) | +| update agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_agent.js) | +| update app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_app.js) | +| update deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_deployment.js) | +| update example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_example.js) | +| update guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_guardrail.js) | +| update tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_tool.js) | +| update toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_toolset.js) | +| create evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation.js) | +| create evaluation dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_dataset.js) | +| create evaluation expectation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_expectation.js) | +| create scheduled evaluation run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_scheduled_evaluation_run.js) | +| delete evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation.js) | +| delete evaluation dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_dataset.js) | +| delete evaluation expectation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_expectation.js) | +| delete evaluation result | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_result.js) | +| delete evaluation run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_run.js) | +| delete scheduled evaluation run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_scheduled_evaluation_run.js) | +| generate evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.generate_evaluation.js) | +| get evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation.js) | +| get evaluation dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_dataset.js) | +| get evaluation expectation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_expectation.js) | +| get evaluation result | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_result.js) | +| get evaluation run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_run.js) | +| get scheduled evaluation run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_scheduled_evaluation_run.js) | +| import evaluations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.import_evaluations.js) | +| list evaluation datasets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_datasets.js) | +| list evaluation expectations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_expectations.js) | +| list evaluation results | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_results.js) | +| list evaluation runs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_runs.js) | +| list evaluations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluations.js) | +| list scheduled evaluation runs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_scheduled_evaluation_runs.js) | +| run evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.run_evaluation.js) | +| test persona voice | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.test_persona_voice.js) | +| update evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation.js) | +| update evaluation dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_dataset.js) | +| update evaluation expectation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_expectation.js) | +| update scheduled evaluation run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_scheduled_evaluation_run.js) | +| upload evaluation audio | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.upload_evaluation_audio.js) | +| bidi run session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/session_service.bidi_run_session.js) | +| run session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/session_service.run_session.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/snippet_metadata_google.cloud.ces.v1beta.json) | +| execute tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/tool_service.execute_tool.js) | +| retrieve tool schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tool_schema.js) | +| retrieve tools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tools.js) | +| generate chat token | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/widget_service.generate_chat_token.js) | + + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/ces@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/LICENSE) + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=ces.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent.proto new file mode 100644 index 00000000000..ffe04a307fc --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent.proto @@ -0,0 +1,236 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1/agent_transfers.proto"; +import "google/cloud/ces/v1/common.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "AgentProto"; +option java_package = "com.google.cloud.ces.v1"; +option (google.api.resource_definition) = { + type: "dialogflow.googleapis.com/DialogflowAgent" + pattern: "projects/{project}/locations/{location}/agents/{agent}" +}; + +// An agent acts as the fundamental building block that provides instructions to +// the Large Language Model (LLM) for executing specific tasks. +message Agent { + option (google.api.resource) = { + type: "ces.googleapis.com/Agent" + pattern: "projects/{project}/locations/{location}/apps/{app}/agents/{agent}" + plural: "agents" + singular: "agent" + }; + + // Default agent type. The agent uses instructions and callbacks specified in + // the agent to perform the task using a large language model. + message LlmAgent {} + + // The agent which will transfer execution to a remote + // [Dialogflow + // CX](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) agent. + // The Dialogflow agent will process subsequent user queries until the session + // ends or flow ends, and the control is transferred back to the parent CES + // agent. + message RemoteDialogflowAgent { + // Required. The + // [Dialogflow](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) + // agent resource name. + // Format: `projects/{project}/locations/{location}/agents/{agent}` + string agent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/DialogflowAgent" + } + ]; + + // Optional. The flow ID of the flow in the Dialogflow agent. + string flow_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The environment ID of the Dialogflow agent to be used for the + // agent execution. If not specified, the draft environment will be used. + string environment_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The mapping of the app variables names to the Dialogflow + // session parameters names to be sent to the Dialogflow agent as input. + map input_variable_mapping = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The mapping of the Dialogflow session parameters names to the + // app variables names to be sent back to the CES agent after the Dialogflow + // agent execution ends. + map output_variable_mapping = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether to respect the message-level interruption + // settings configured in the Dialogflow agent. + // + // * If false: all response messages from the Dialogflow agent follow the + // app-level barge-in settings. + // * If true: only response messages with + // [`allow_playback_interruption`](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#text) + // set to true will be interruptable, all other messages follow the + // app-level barge-in settings. + bool respect_response_interruption_settings = 6 + [(google.api.field_behavior) = OPTIONAL]; + } + + // A toolset with a selection of its tools. + message AgentToolset { + // Required. The resource name of the toolset. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + string toolset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Toolset" } + ]; + + // Optional. The tools IDs to filter the toolset. + repeated string tool_ids = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // The type of agent. + oneof agent_type { + // Optional. The default agent type. + LlmAgent llm_agent = 26 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The remote + // [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) + // agent to be used for the agent execution. If this field is set, all other + // agent level properties will be ignored. + // + // Note: If the Dialogflow agent is in a different project from the app, you + // should grant `roles/dialogflow.client` to the CES service agent + // `service-@gcp-sa-ces.iam.gserviceaccount.com`. + RemoteDialogflowAgent remote_dialogflow_agent = 27 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Identifier. The unique identifier of the agent. + // Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Display name of the agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Human-readable description of the agent. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configurations for the LLM model. + ModelSettings model_settings = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Instructions for the LLM model to guide the agent's behavior. + string instruction = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of available tools for the agent. + // Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` + repeated string tools = 7 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } + ]; + + // Optional. List of child agents in the agent tree. + // Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` + repeated string child_agents = 8 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + + // Optional. The callbacks to execute before the agent is called. + // The provided callbacks are executed sequentially in the exact order they + // are given in the list. If a callback returns an overridden response, + // execution stops and any remaining callbacks are skipped. + repeated Callback before_agent_callbacks = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The callbacks to execute after the agent is called. + // The provided callbacks are executed sequentially in the exact order they + // are given in the list. If a callback returns an overridden response, + // execution stops and any remaining callbacks are skipped. + repeated Callback after_agent_callbacks = 19 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The callbacks to execute before the model is called. If there are + // multiple calls to the model, the callback will be executed multiple times. + // The provided callbacks are executed sequentially in the exact order they + // are given in the list. If a callback returns an overridden response, + // execution stops and any remaining callbacks are skipped. + repeated Callback before_model_callbacks = 20 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The callbacks to execute after the model is called. If there are + // multiple calls to the model, the callback will be executed multiple times. + // The provided callbacks are executed sequentially in the exact order they + // are given in the list. If a callback returns an overridden response, + // execution stops and any remaining callbacks are skipped. + repeated Callback after_model_callbacks = 21 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The callbacks to execute before the tool is invoked. If there are + // multiple tool invocations, the callback will be executed multiple times. + // The provided callbacks are executed sequentially in the exact order they + // are given in the list. If a callback returns an overridden response, + // execution stops and any remaining callbacks are skipped. + repeated Callback before_tool_callbacks = 22 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The callbacks to execute after the tool is invoked. If there are + // multiple tool invocations, the callback will be executed multiple times. + // The provided callbacks are executed sequentially in the exact order they + // are given in the list. If a callback returns an overridden response, + // execution stops and any remaining callbacks are skipped. + repeated Callback after_tool_callbacks = 23 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when the agent was created. + google.protobuf.Timestamp create_time = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the agent was last updated. + google.protobuf.Timestamp update_time = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. List of guardrails for the agent. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}` + repeated string guardrails = 17 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Guardrail" } + ]; + + // Etag used to ensure the object hasn't changed during a read-modify-write + // operation. If the etag is empty, the update will overwrite any concurrent + // changes. + string etag = 24; + + // Optional. List of toolsets for the agent. + repeated AgentToolset toolsets = 28 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. If the agent is generated by the LLM assistant, this field + // contains a descriptive summary of the generation. + string generated_summary = 29 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Agent transfer rules. + // If multiple rules match, the first one in the list will be used. + repeated TransferRule transfer_rules = 30 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent_service.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent_service.proto new file mode 100644 index 00000000000..71912ad2380 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent_service.proto @@ -0,0 +1,1695 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1/agent.proto"; +import "google/cloud/ces/v1/app.proto"; +import "google/cloud/ces/v1/app_version.proto"; +import "google/cloud/ces/v1/changelog.proto"; +import "google/cloud/ces/v1/conversation.proto"; +import "google/cloud/ces/v1/deployment.proto"; +import "google/cloud/ces/v1/example.proto"; +import "google/cloud/ces/v1/guardrail.proto"; +import "google/cloud/ces/v1/tool.proto"; +import "google/cloud/ces/v1/toolset.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "AgentServiceProto"; +option java_package = "com.google.cloud.ces.v1"; +option (google.api.resource_definition) = { + type: "contactcenterinsights.googleapis.com/Dataset" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}" +}; + +// The service that manages agent-related resources in Gemini Enterprise for +// Customer Engagement (CES). +service AgentService { + option (google.api.default_host) = "ces.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/ces," + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists apps in the given project and location. + rpc ListApps(ListAppsRequest) returns (ListAppsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/apps" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified app. + rpc GetApp(GetAppRequest) returns (App) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apps/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new app in the given project and location. + rpc CreateApp(CreateAppRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/apps" + body: "app" + }; + option (google.api.method_signature) = "parent,app,app_id"; + option (google.api.method_signature) = "parent,app"; + option (google.longrunning.operation_info) = { + response_type: "App" + metadata_type: "OperationMetadata" + }; + } + + // Updates the specified app. + rpc UpdateApp(UpdateAppRequest) returns (App) { + option (google.api.http) = { + patch: "/v1/{app.name=projects/*/locations/*/apps/*}" + body: "app" + }; + option (google.api.method_signature) = "app,update_mask"; + } + + // Deletes the specified app. + rpc DeleteApp(DeleteAppRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apps/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Exports the specified app. + rpc ExportApp(ExportAppRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/apps/*}:exportApp" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "ExportAppResponse" + metadata_type: "OperationMetadata" + }; + } + + // Imports the specified app. + rpc ImportApp(ImportAppRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/apps:importApp" + body: "*" + }; + option (google.api.method_signature) = "parent,display_name,app_id"; + option (google.longrunning.operation_info) = { + response_type: "ImportAppResponse" + metadata_type: "OperationMetadata" + }; + } + + // Lists agents in the given app. + rpc ListAgents(ListAgentsRequest) returns (ListAgentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apps/*}/agents" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified agent. + rpc GetAgent(GetAgentRequest) returns (Agent) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apps/*/agents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new agent in the given app. + rpc CreateAgent(CreateAgentRequest) returns (Agent) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apps/*}/agents" + body: "agent" + }; + option (google.api.method_signature) = "parent,agent,agent_id"; + option (google.api.method_signature) = "parent,agent"; + } + + // Updates the specified agent. + rpc UpdateAgent(UpdateAgentRequest) returns (Agent) { + option (google.api.http) = { + patch: "/v1/{agent.name=projects/*/locations/*/apps/*/agents/*}" + body: "agent" + }; + option (google.api.method_signature) = "agent,update_mask"; + } + + // Deletes the specified agent. + rpc DeleteAgent(DeleteAgentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apps/*/agents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists examples in the given app. + rpc ListExamples(ListExamplesRequest) returns (ListExamplesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apps/*}/examples" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified example. + rpc GetExample(GetExampleRequest) returns (Example) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apps/*/examples/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new example in the given app. + rpc CreateExample(CreateExampleRequest) returns (Example) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apps/*}/examples" + body: "example" + }; + option (google.api.method_signature) = "parent,example,example_id"; + option (google.api.method_signature) = "parent,example"; + } + + // Updates the specified example. + rpc UpdateExample(UpdateExampleRequest) returns (Example) { + option (google.api.http) = { + patch: "/v1/{example.name=projects/*/locations/*/apps/*/examples/*}" + body: "example" + }; + option (google.api.method_signature) = "example,update_mask"; + } + + // Deletes the specified example. + rpc DeleteExample(DeleteExampleRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apps/*/examples/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists tools in the given app. + rpc ListTools(ListToolsRequest) returns (ListToolsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apps/*}/tools" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified tool. + rpc GetTool(GetToolRequest) returns (Tool) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apps/*/tools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists conversations in the given app. + rpc ListConversations(ListConversationsRequest) + returns (ListConversationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apps/*}/conversations" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified conversation. + rpc GetConversation(GetConversationRequest) returns (Conversation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apps/*/conversations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes the specified conversation. + rpc DeleteConversation(DeleteConversationRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apps/*/conversations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Batch deletes the specified conversations. + rpc BatchDeleteConversations(BatchDeleteConversationsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apps/*}/conversations:batchDelete" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "BatchDeleteConversationsResponse" + metadata_type: "OperationMetadata" + }; + } + + // Creates a new tool in the given app. + rpc CreateTool(CreateToolRequest) returns (Tool) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apps/*}/tools" + body: "tool" + }; + option (google.api.method_signature) = "parent,tool,tool_id"; + option (google.api.method_signature) = "parent,tool"; + } + + // Updates the specified tool. + rpc UpdateTool(UpdateToolRequest) returns (Tool) { + option (google.api.http) = { + patch: "/v1/{tool.name=projects/*/locations/*/apps/*/tools/*}" + body: "tool" + }; + option (google.api.method_signature) = "tool,update_mask"; + } + + // Deletes the specified tool. + rpc DeleteTool(DeleteToolRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apps/*/tools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists guardrails in the given app. + rpc ListGuardrails(ListGuardrailsRequest) returns (ListGuardrailsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apps/*}/guardrails" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified guardrail. + rpc GetGuardrail(GetGuardrailRequest) returns (Guardrail) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apps/*/guardrails/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new guardrail in the given app. + rpc CreateGuardrail(CreateGuardrailRequest) returns (Guardrail) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apps/*}/guardrails" + body: "guardrail" + }; + option (google.api.method_signature) = "parent,guardrail,guardrail_id"; + option (google.api.method_signature) = "parent,guardrail"; + } + + // Updates the specified guardrail. + rpc UpdateGuardrail(UpdateGuardrailRequest) returns (Guardrail) { + option (google.api.http) = { + patch: "/v1/{guardrail.name=projects/*/locations/*/apps/*/guardrails/*}" + body: "guardrail" + }; + option (google.api.method_signature) = "guardrail,update_mask"; + } + + // Deletes the specified guardrail. + rpc DeleteGuardrail(DeleteGuardrailRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apps/*/guardrails/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists deployments in the given app. + rpc ListDeployments(ListDeploymentsRequest) + returns (ListDeploymentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apps/*}/deployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified deployment. + rpc GetDeployment(GetDeploymentRequest) returns (Deployment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apps/*/deployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new deployment in the given app. + rpc CreateDeployment(CreateDeploymentRequest) returns (Deployment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apps/*}/deployments" + body: "deployment" + }; + option (google.api.method_signature) = "parent,deployment,deployment_id"; + option (google.api.method_signature) = "parent,deployment"; + } + + // Updates the specified deployment. + rpc UpdateDeployment(UpdateDeploymentRequest) returns (Deployment) { + option (google.api.http) = { + patch: "/v1/{deployment.name=projects/*/locations/*/apps/*/deployments/*}" + body: "deployment" + }; + option (google.api.method_signature) = "deployment,update_mask"; + } + + // Deletes the specified deployment. + rpc DeleteDeployment(DeleteDeploymentRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apps/*/deployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists toolsets in the given app. + rpc ListToolsets(ListToolsetsRequest) returns (ListToolsetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apps/*}/toolsets" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified toolset. + rpc GetToolset(GetToolsetRequest) returns (Toolset) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apps/*/toolsets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new toolset in the given app. + rpc CreateToolset(CreateToolsetRequest) returns (Toolset) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apps/*}/toolsets" + body: "toolset" + }; + option (google.api.method_signature) = "parent,toolset,toolset_id"; + option (google.api.method_signature) = "parent,toolset"; + } + + // Updates the specified toolset. + rpc UpdateToolset(UpdateToolsetRequest) returns (Toolset) { + option (google.api.http) = { + patch: "/v1/{toolset.name=projects/*/locations/*/apps/*/toolsets/*}" + body: "toolset" + }; + option (google.api.method_signature) = "toolset,update_mask"; + } + + // Deletes the specified toolset. + rpc DeleteToolset(DeleteToolsetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apps/*/toolsets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all app versions in the given app. + rpc ListAppVersions(ListAppVersionsRequest) + returns (ListAppVersionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apps/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified app version. + rpc GetAppVersion(GetAppVersionRequest) returns (AppVersion) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apps/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new app version in the given app. + rpc CreateAppVersion(CreateAppVersionRequest) returns (AppVersion) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apps/*}/versions" + body: "app_version" + }; + option (google.api.method_signature) = "parent,app_version,app_version_id"; + option (google.api.method_signature) = "parent,app_version"; + } + + // Deletes the specified app version. + rpc DeleteAppVersion(DeleteAppVersionRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apps/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Restores the specified app version. + // This will create a new app version from the current draft app and overwrite + // the current draft with the specified app version. + rpc RestoreAppVersion(RestoreAppVersionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/apps/*/versions/*}:restore" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "RestoreAppVersionResponse" + metadata_type: "OperationMetadata" + }; + } + + // Lists the changelogs of the specified app. + rpc ListChangelogs(ListChangelogsRequest) returns (ListChangelogsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apps/*}/changelogs" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the specified changelog. + rpc GetChangelog(GetChangelogRequest) returns (Changelog) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apps/*/changelogs/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for +// [AgentService.ListApps][google.cloud.ces.v1.AgentService.ListApps]. +message ListAppsRequest { + // Required. The resource name of the location to list apps from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "ces.googleapis.com/App" } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1.ListAppsResponse.next_page_token] + // value returned from a previous list + // [AgentService.ListApps][google.cloud.ces.v1.AgentService.ListApps] call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the apps. + // See https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time" is supported. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListApps][google.cloud.ces.v1.AgentService.ListApps]. +message ListAppsResponse { + // The list of apps. + repeated App apps = 1; + + // A token that can be sent as + // [ListAppsRequest.page_token][google.cloud.ces.v1.ListAppsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; + + // Unordered list. Locations that could not be reached. + repeated string unreachable = 3 + [(google.api.field_behavior) = UNORDERED_LIST]; +} + +// Request message for +// [AgentService.GetApp][google.cloud.ces.v1.AgentService.GetApp]. +message GetAppRequest { + // Required. The resource name of the app to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; +} + +// Request message for +// [AgentService.CreateApp][google.cloud.ces.v1.AgentService.CreateApp]. +message CreateAppRequest { + // Required. The resource name of the location to create an app in. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "ces.googleapis.com/App" } + ]; + + // Optional. The ID to use for the app, which will become the final component + // of the app's resource name. If not provided, a unique ID will be + // automatically assigned for the app. + string app_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The app to create. + App app = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [AgentService.UpdateApp][google.cloud.ces.v1.AgentService.UpdateApp]. +message UpdateAppRequest { + // Required. The app to update. + App app = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask is used to control which fields get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.DeleteApp][google.cloud.ces.v1.AgentService.DeleteApp]. +message DeleteAppRequest { + // Required. The resource name of the app to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; + + // Optional. The current etag of the app. If an etag is not provided, the + // deletion will overwrite any concurrent changes. If an etag is provided and + // does not match the current etag of the app, deletion will be blocked and an + // ABORTED error will be returned. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.ExportApp][google.cloud.ces.v1.AgentService.ExportApp]. +message ExportAppRequest { + // Export format for the app. + enum ExportFormat { + // The export format is unspecified. + EXPORT_FORMAT_UNSPECIFIED = 0; + + // The export format is JSON. + JSON = 1; + + // The export format is YAML. + YAML = 2; + } + + // Required. The resource name of the app to export. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; + + // Required. The format to export the app in. + ExportFormat export_format = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The [Google Cloud + // Storage](https://cloud.google.com/storage/docs/) URI to which to export the + // app. The format of this URI must be `gs:///`. The + // exported app archive will be written directly to the specified GCS object. + string gcs_uri = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ExportApp][google.cloud.ces.v1.AgentService.ExportApp]. +message ExportAppResponse { + // The exported app. + oneof app { + // App folder compressed as a zip file. + bytes app_content = 1; + + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // to which the app was exported. + string app_uri = 2; + } +} + +// Request message for +// [AgentService.ImportApp][google.cloud.ces.v1.AgentService.ImportApp]. +message ImportAppRequest { + // Configuration options for the app import process. + // These options control how the import behaves, particularly when + // conflicts arise with existing app data. + message ImportOptions { + // Defines the strategy for handling conflicts when an app with the same ID + // already exists, or when imported resources (like Agents, Tools, etc.) + // have the same display names as existing resources within that app. + enum ConflictResolutionStrategy { + // The conflict resolution strategy is unspecified. + CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED = 0; + + // Replace existing data with imported data. + // If an app with the same `app_id` already exists, its content will be + // updated based on the imported app. + // - Resources (App, Agents, Tools, Examples, Guardrails, Toolsets) in the + // imported app that have the same display name as existing resources + // will overwrite the existing ones. + // - Imported resources with new display names will be created. + // - Existing resources that do not have a matching display name in the + // imported app will remain untouched. + REPLACE = 1; + + // Overwrite existing data with imported data. + // If an app with the same `app_id` already exists, its content will be + // overwritten with the imported app. + // - Existing resources (Agents, Tools, Examples, Guardrails, Toolsets) in + // the app will be deleted. + // - Imported resources will be created as new resources. + OVERWRITE = 2; + } + + // Optional. The strategy to use when resolving conflicts during import. + ConflictResolutionStrategy conflict_resolution_strategy = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The app to import. + oneof app { + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // from which to import app. The format of this URI must be + // `gs:///`. + string gcs_uri = 4; + + // Raw bytes representing the compressed zip file with the app folder + // structure. + bytes app_content = 5; + } + + // Required. The parent resource name with the location of the app to import. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "ces.googleapis.com/App" } + ]; + + // Optional. The display name of the app to import. + // * If the app is created on import, and the display name is specified, + // the imported app will use this display name. If a conflict is detected + // with an existing app, a timestamp will be appended to the display name + // to make it unique. + // * If the app is a reimport, this field should not be set. Providing a + // display name during reimport will result in an INVALID_ARGUMENT error. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The ID to use for the imported app. + // * If not specified, a unique ID will be automatically assigned for + // the app. + // * Otherwise, the imported app will use this ID as the final component of + // its resource name. If an app with the same ID already exists at the + // specified location in the project, the content of the existing app will be + // replaced. + string app_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Options governing the import process for the app. + ImportOptions import_options = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Flag for overriding the app lock during import. + // If set to true, the import process will ignore the app lock. + bool ignore_app_lock = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ImportApp][google.cloud.ces.v1.AgentService.ImportApp]. +message ImportAppResponse { + // The resource name of the app that was imported. + string name = 1 + [(google.api.resource_reference) = { type: "ces.googleapis.com/App" }]; + + // Warning messages generated during the import process. + // If errors occur for specific resources, they will not be included in the + // imported app and the error will be mentioned here. + repeated string warnings = 2; +} + +// Request message for +// [AgentService.ListAgents][google.cloud.ces.v1.AgentService.ListAgents]. +message ListAgentsRequest { + // Required. The resource name of the app to list agents from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "ces.googleapis.com/Agent" } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1.ListAgentsResponse.next_page_token] + // value returned from a previous list + // [AgentService.ListAgents][google.cloud.ces.v1.AgentService.ListAgents] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the agents. + // See https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time" is supported. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListAgents][google.cloud.ces.v1.AgentService.ListAgents]. +message ListAgentsResponse { + // The list of agents. + repeated Agent agents = 1; + + // A token that can be sent as + // [ListAgentsRequest.page_token][google.cloud.ces.v1.ListAgentsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [AgentService.GetAgent][google.cloud.ces.v1.AgentService.GetAgent]. +message GetAgentRequest { + // Required. The resource name of the agent to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; +} + +// Request message for +// [AgentService.CreateAgent][google.cloud.ces.v1.AgentService.CreateAgent]. +message CreateAgentRequest { + // Required. The resource name of the app to create an agent in. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "ces.googleapis.com/Agent" } + ]; + + // Optional. The ID to use for the agent, which will become the final + // component of the agent's resource name. If not provided, a unique ID will + // be automatically assigned for the agent. + string agent_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The agent to create. + Agent agent = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [AgentService.UpdateAgent][google.cloud.ces.v1.AgentService.UpdateAgent]. +message UpdateAgentRequest { + // Required. The agent to update. + Agent agent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask is used to control which fields get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.DeleteAgent][google.cloud.ces.v1.AgentService.DeleteAgent]. +message DeleteAgentRequest { + // Required. The resource name of the agent to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + + // Optional. Indicates whether to forcefully delete the agent, even if it is + // still referenced by other app/agents/examples. + // + // * If `force = false`, the deletion fails if other agents/examples + // reference it. + // * If `force = true`, delete the agent and remove it from all referencing + // apps/agents/examples. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the agent. If an etag is not provided, the + // deletion will overwrite any concurrent changes. If an etag is provided and + // does not match the current etag of the agent, deletion will be blocked and + // an ABORTED error will be returned. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // 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. Human-readable status of the operation, if any. + string status_message = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation of the + // operation. Operations that have been cancelled successfully have + // [google.longrunning.Operation.error][google.longrunning.Operation.error] + // value with a [google.rpc.Status.code][google.rpc.Status.code] of `1`, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for +// [AgentService.ListExamples][google.cloud.ces.v1.AgentService.ListExamples]. +message ListExamplesRequest { + // Required. The resource name of the app to list examples from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Example" + } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1.ListExamplesResponse.next_page_token] + // value returned from a previous list + // [AgentService.ListExamples][google.cloud.ces.v1.AgentService.ListExamples] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the examples. + // See https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time" is supported. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListExamples][google.cloud.ces.v1.AgentService.ListExamples]. +message ListExamplesResponse { + // The list of examples. + repeated Example examples = 1; + + // A token that can be sent as + // [ListExamplesRequest.page_token][google.cloud.ces.v1.ListExamplesRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [AgentService.GetExample][google.cloud.ces.v1.AgentService.GetExample]. +message GetExampleRequest { + // Required. The resource name of the example to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Example" } + ]; +} + +// Request message for +// [AgentService.CreateExample][google.cloud.ces.v1.AgentService.CreateExample]. +message CreateExampleRequest { + // Required. The resource name of the app to create an example in. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Example" + } + ]; + + // Optional. The ID to use for the example, which will become the final + // component of the example's resource name. If not provided, a unique ID will + // be automatically assigned for the example. + string example_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The example to create. + Example example = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [AgentService.UpdateExample][google.cloud.ces.v1.AgentService.UpdateExample]. +message UpdateExampleRequest { + // Required. The example to update. + Example example = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask is used to control which fields get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.DeleteExample][google.cloud.ces.v1.AgentService.DeleteExample]. +message DeleteExampleRequest { + // Required. The resource name of the example to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Example" } + ]; + + // Optional. The current etag of the example. If an etag is not provided, the + // deletion will overwrite any concurrent changes. If an etag is provided and + // does not match the current etag of the example, deletion will be blocked + // and an ABORTED error will be returned. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.ListTools][google.cloud.ces.v1.AgentService.ListTools]. +message ListToolsRequest { + // Required. The resource name of the app to list tools from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "ces.googleapis.com/Tool" } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1.ListToolsResponse.next_page_token] + // value returned from a previous list + // [AgentService.ListTools][google.cloud.ces.v1.AgentService.ListTools] call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the tools. Use + // "include_system_tools=true" to include system tools in the response. See + // https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time" is supported. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListTools][google.cloud.ces.v1.AgentService.ListTools]. +message ListToolsResponse { + // The list of tools. + repeated Tool tools = 1; + + // A token that can be sent as + // [ListToolsRequest.page_token][google.cloud.ces.v1.ListToolsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [AgentService.GetTool][google.cloud.ces.v1.AgentService.GetTool]. +message GetToolRequest { + // Required. The resource name of the tool to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } + ]; +} + +// Request message for +// [AgentService.CreateTool][google.cloud.ces.v1.AgentService.CreateTool]. +message CreateToolRequest { + // Required. The resource name of the app to create a tool in. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "ces.googleapis.com/Tool" } + ]; + + // Optional. The ID to use for the tool, which will become the final component + // of the tool's resource name. If not provided, a unique ID will be + // automatically assigned for the tool. + string tool_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The tool to create. + Tool tool = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [AgentService.UpdateTool][google.cloud.ces.v1.AgentService.UpdateTool]. +message UpdateToolRequest { + // Required. The tool to update. + Tool tool = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask is used to control which fields get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.DeleteTool][google.cloud.ces.v1.AgentService.DeleteTool]. +message DeleteToolRequest { + // Required. The resource name of the tool to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } + ]; + + // Optional. Indicates whether to forcefully delete the tool, even if it is + // still referenced by agents/examples. + // + // * If `force = false`, the deletion will fail if any agents still + // reference the tool. + // * If `force = true`, all existing references from agents will be removed + // and the tool will be deleted. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the tool. If an etag is not provided, the + // deletion will overwrite any concurrent changes. If an etag is provided and + // does not match the current etag of the tool, deletion will be blocked and + // an ABORTED error will be returned. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.ListConversations][google.cloud.ces.v1.AgentService.ListConversations]. +message ListConversationsRequest { + // Required. The resource name of the app to list conversations from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Conversation" + } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1.ListConversationsResponse.next_page_token] + // value returned from a previous list + // [AgentService.ListConversations][google.cloud.ces.v1.AgentService.ListConversations] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the conversations. + // See https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicate the source of the conversation. If not set, Source.Live + // will be applied by default. Will be deprecated in favor of `sources` field. + Conversation.Source source = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicate the sources of the conversations. If not set, all + // available sources will be applied by default. + repeated Conversation.Source sources = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListConversations][google.cloud.ces.v1.AgentService.ListConversations]. +message ListConversationsResponse { + // The list of conversations. + repeated Conversation conversations = 1; + + // A token that can be sent as + // [ListConversationsRequest.page_token][google.cloud.ces.v1.ListConversationsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [AgentService.GetConversation][google.cloud.ces.v1.AgentService.GetConversation]. +message GetConversationRequest { + // Required. The resource name of the conversation to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ces.googleapis.com/Conversation" + } + ]; + + // Optional. Indicate the source of the conversation. If not set, all source + // will be searched. + Conversation.Source source = 2 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.DeleteConversation][google.cloud.ces.v1.AgentService.DeleteConversation]. +message DeleteConversationRequest { + // Required. The resource name of the conversation to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ces.googleapis.com/Conversation" + } + ]; + + // Optional. Indicate the source of the conversation. If not set, Source.Live + // will be applied by default. + Conversation.Source source = 2 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.BatchDeleteConversations][google.cloud.ces.v1.AgentService.BatchDeleteConversations]. +message BatchDeleteConversationsRequest { + // Required. The resource name of the app to delete conversations from. + // Format: + // `projects/{project}/locations/{location}/apps/{app}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Conversation" + } + ]; + + // Required. The resource names of the conversations to delete. + repeated string conversations = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ces.googleapis.com/Conversation" + } + ]; +} + +// Response message for +// [AgentService.BatchDeleteConversations][google.cloud.ces.v1.AgentService.BatchDeleteConversations]. +message BatchDeleteConversationsResponse { + // The list of conversations that were successfully deleted. + repeated string deleted_conversations = 1; + + // The list of conversations that failed to be deleted. + repeated string failed_conversations = 2; + + // Optional. A list of error messages associated with conversations that + // failed to be deleted. + repeated string error_messages = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.ListGuardrails][google.cloud.ces.v1.AgentService.ListGuardrails]. +message ListGuardrailsRequest { + // Required. The resource name of the app to list guardrails from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Guardrail" + } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1.ListGuardrailsResponse.next_page_token] + // value returned from a previous list + // [AgentService.ListGuardrails][google.cloud.ces.v1.AgentService.ListGuardrails] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the guardrails. + // See https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time" is supported. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListGuardrails][google.cloud.ces.v1.AgentService.ListGuardrails]. +message ListGuardrailsResponse { + // The list of guardrails. + repeated Guardrail guardrails = 1; + + // A token that can be sent as + // [ListGuardrailsRequest.page_token][google.cloud.ces.v1.ListGuardrailsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [AgentService.GetGuardrail][google.cloud.ces.v1.AgentService.GetGuardrail]. +message GetGuardrailRequest { + // Required. The resource name of the guardrail to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Guardrail" } + ]; +} + +// Request message for +// [AgentService.CreateGuardrail][google.cloud.ces.v1.AgentService.CreateGuardrail]. +message CreateGuardrailRequest { + // Required. The resource name of the app to create a guardrail in. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Guardrail" + } + ]; + + // Optional. The ID to use for the guardrail, which will become the final + // component of the guardrail's resource name. If not provided, a unique ID + // will be automatically assigned for the guardrail. + string guardrail_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The guardrail to create. + Guardrail guardrail = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [AgentService.UpdateGuardrail][google.cloud.ces.v1.AgentService.UpdateGuardrail]. +message UpdateGuardrailRequest { + // Required. The guardrail to update. + Guardrail guardrail = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask is used to control which fields get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.DeleteGuardrail][google.cloud.ces.v1.AgentService.DeleteGuardrail]. +message DeleteGuardrailRequest { + // Required. The resource name of the guardrail to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Guardrail" } + ]; + + // Optional. Indicates whether to forcefully delete the guardrail, even if it + // is still referenced by app/agents. + // + // * If `force = false`, the deletion fails if any apps/agents still + // reference the guardrail. + // * If `force = true`, all existing references from apps/agents will be + // removed and the guardrail will be deleted. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the guardrail. If an etag is not provided, + // the deletion will overwrite any concurrent changes. If an etag is provided + // and does not match the current etag of the guardrail, deletion will be + // blocked and an ABORTED error will be returned. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.ListDeployments][google.cloud.ces.v1.AgentService.ListDeployments]. +message ListDeploymentsRequest { + // Required. The parent app. + // Format: + // `projects/{project}/locations/{location}/apps/{app}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Deployment" + } + ]; + + // Optional. The maximum number of deployments to return. The service may + // return fewer than this value. If unspecified, at most 50 deployments will + // be returned. The maximum value is 1000; values above 1000 will be coerced + // to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListDeployments` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListDeployments` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time" is supported. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListDeployments][google.cloud.ces.v1.AgentService.ListDeployments]. +message ListDeploymentsResponse { + // The list of deployments. + repeated Deployment deployments = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [AgentService.GetDeployment][google.cloud.ces.v1.AgentService.GetDeployment]. +message GetDeploymentRequest { + // Required. The name of the deployment. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Deployment" } + ]; +} + +// Request message for +// [AgentService.CreateDeployment][google.cloud.ces.v1.AgentService.CreateDeployment]. +message CreateDeploymentRequest { + // Required. The parent app. + // Format: + // `projects/{project}/locations/{location}/apps/{app}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Deployment" + } + ]; + + // Optional. The ID to use for the deployment, which will become the final + // component of the deployment's resource name. If not provided, a unique ID + // will be automatically assigned for the deployment. + string deployment_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The deployment to create. + Deployment deployment = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [AgentService.UpdateDeployment][google.cloud.ces.v1.AgentService.UpdateDeployment]. +message UpdateDeploymentRequest { + // Required. The deployment to update. + Deployment deployment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.DeleteDeployment][google.cloud.ces.v1.AgentService.DeleteDeployment]. +message DeleteDeploymentRequest { + // Required. The name of the deployment to delete. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Deployment" } + ]; + + // Optional. The etag of the deployment. + // If an etag is provided and does not match the current etag of the + // deployment, deletion will be blocked and an ABORTED error will be returned. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.ListToolsets][google.cloud.ces.v1.AgentService.ListToolsets]. +message ListToolsetsRequest { + // Required. The resource name of the app to list toolsets from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Toolset" + } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1.ListToolsetsResponse.next_page_token] + // value returned from a previous list + // [AgentService.ListToolsets][google.cloud.ces.v1.AgentService.ListToolsets] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the toolsets. + // See https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time" is supported. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListToolsets][google.cloud.ces.v1.AgentService.ListToolsets]. +message ListToolsetsResponse { + // The list of toolsets. + repeated Toolset toolsets = 1; + + // A token that can be sent as + // [ListToolsetsRequest.page_token][google.cloud.ces.v1.ListToolsetsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [AgentService.GetToolset][google.cloud.ces.v1.AgentService.GetToolset]. +message GetToolsetRequest { + // Required. The resource name of the toolset to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Toolset" } + ]; +} + +// Request message for +// [AgentService.CreateToolset][google.cloud.ces.v1.AgentService.CreateToolset]. +message CreateToolsetRequest { + // Required. The resource name of the app to create a toolset in. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Toolset" + } + ]; + + // Optional. The ID to use for the toolset, which will become the final + // component of the toolset's resource name. If not provided, a unique ID will + // be automatically assigned for the toolset. + string toolset_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The toolset to create. + Toolset toolset = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [AgentService.UpdateToolset][google.cloud.ces.v1.AgentService.UpdateToolset]. +message UpdateToolsetRequest { + // Required. The toolset to update. + Toolset toolset = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask is used to control which fields get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.DeleteToolset][google.cloud.ces.v1.AgentService.DeleteToolset]. +message DeleteToolsetRequest { + // Required. The resource name of the toolset to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Toolset" } + ]; + + // Optional. Indicates whether to forcefully delete the toolset, even if it is + // still referenced by app/agents. + // + // * If `force = false`, the deletion fails if any agents still + // reference the toolset. + // * If `force = true`, all existing references from agents will be + // removed and the toolset will be deleted. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the toolset. If an etag is not provided, the + // deletion will overwrite any concurrent changes. If an etag is provided and + // does not match the current etag of the toolset, deletion will be blocked + // and an ABORTED error will be returned. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.ListAppVersions][google.cloud.ces.v1.AgentService.ListAppVersions]. +message ListAppVersionsRequest { + // Required. The resource name of the app to list app versions from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/AppVersion" + } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1.ListAppVersionsResponse.next_page_token] + // value returned from a previous list + // [AgentService.ListAppVersions][google.cloud.ces.v1.AgentService.ListAppVersions] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the app versions. + // See https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time" is supported. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListAppVersions][google.cloud.ces.v1.AgentService.ListAppVersions]. +message ListAppVersionsResponse { + // The list of app versions. + repeated AppVersion app_versions = 1; + + // A token that can be sent as + // [ListAppVersionsRequest.page_token][google.cloud.ces.v1.ListAppVersionsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [AgentService.GetAppVersion][google.cloud.ces.v1.AgentService.GetAppVersion]. +message GetAppVersionRequest { + // Required. The resource name of the app version to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/AppVersion" } + ]; +} + +// Request message for +// [AgentService.DeleteAppVersion][google.cloud.ces.v1.AgentService.DeleteAppVersion]. +message DeleteAppVersionRequest { + // Required. The resource name of the app version to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/AppVersion" } + ]; + + // Optional. The current etag of the app version. If an etag is not provided, + // the deletion will overwrite any concurrent changes. If an etag is provided + // and does not match the current etag of the app version, deletion will be + // blocked and an ABORTED error will be returned. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.CreateAppVersion][google.cloud.ces.v1.AgentService.CreateAppVersion] +message CreateAppVersionRequest { + // Required. The resource name of the app to create an app version in. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/AppVersion" + } + ]; + + // Optional. The ID to use for the app version, which will become the final + // component of the app version's resource name. If not provided, a unique ID + // will be automatically assigned for the app version. + string app_version_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The app version to create. + AppVersion app_version = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [AgentService.RestoreAppVersion][google.cloud.ces.v1.AgentService.RestoreAppVersion] +message RestoreAppVersionRequest { + // Required. The resource name of the app version to restore. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/AppVersion" } + ]; +} + +// Response message for +// [AgentService.RestoreAppVersion][google.cloud.ces.v1.AgentService.RestoreAppVersion] +message RestoreAppVersionResponse {} + +// Request message for +// [AgentService.ListChangelogs][google.cloud.ces.v1.AgentService.ListChangelogs]. +message ListChangelogsRequest { + // Required. The resource name of the app to list changelogs from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Changelog" + } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1.ListChangelogsResponse.next_page_token] + // value returned from a previous list + // [AgentService.ListChangelogs][google.cloud.ces.v1.AgentService.ListChangelogs] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the changelogs. + // See https://google.aip.dev/160 for more details. + // + // The filter string can be used to filter by `action`, `resource_type`, + // `resource_name`, `author`, and `create_time`. + // The `:` comparator can be used for case-insensitive partial matching on + // string fields, while `=` performs an exact case-sensitive match. + // + // Examples: + // * `action:update` (case-insensitive partial match) + // * `action="Create"` (case-sensitive exact match) + // * `resource_type:agent` + // * `resource_name:my-agent` + // * `author:me@example.com` + // * `create_time > "2025-01-01T00:00:00Z"` + // * `create_time <= "2025-01-01T00:00:00Z" AND resource_type:tool` + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time" is supported. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListChangelogs][google.cloud.ces.v1.AgentService.ListChangelogs]. +message ListChangelogsResponse { + // The list of changelogs. + repeated Changelog changelogs = 1; + + // A token that can be sent as + // [ListChangelogsRequest.page_token][google.cloud.ces.v1.ListChangelogsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [AgentService.GetChangelog][google.cloud.ces.v1.AgentService.GetChangelog]. +message GetChangelogRequest { + // Required. The resource name of the changelog to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Changelog" } + ]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent_transfers.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent_transfers.proto new file mode 100644 index 00000000000..790e59f8ce0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent_transfers.proto @@ -0,0 +1,101 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "AgentTransfersProto"; +option java_package = "com.google.cloud.ces.v1"; + +// Expression condition based on session state. +message ExpressionCondition { + // Required. The string representation of cloud.api.Expression condition. + string expression = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Python code block to evaluate the condition. +message PythonCodeCondition { + // Required. The python code to execute. + string python_code = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Rule for transferring to a specific agent. +message TransferRule { + // Deterministic transfer rule. When the condition evaluates to true, the + // transfer occurs. + message DeterministicTransfer { + // The condition to evaluate. + oneof condition_type { + // Optional. A rule that evaluates a session state condition. + // If the condition evaluates to true, the transfer occurs. + ExpressionCondition expression_condition = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A rule that uses Python code block to evaluate the + // conditions. If the condition evaluates to true, the transfer occurs. + PythonCodeCondition python_code_condition = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + } + + // A rule that prevents the planner from transferring to the target agent. + message DisablePlannerTransfer { + // Required. If the condition evaluates to true, planner will not be allowed + // to transfer to the target agent. + ExpressionCondition expression_condition = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // The direction of the transfer. + enum Direction { + // Unspecified direction. + DIRECTION_UNSPECIFIED = 0; + + // Transfer from the parent agent to the child agent. + PARENT_TO_CHILD = 1; + + // Transfer from the child agent to the parent agent. + CHILD_TO_PARENT = 2; + } + + // The rule type. + oneof rule_type { + // Optional. A rule that immediately transfers to the target agent when the + // condition is met. + DeterministicTransfer deterministic_transfer = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Rule that prevents the planner from transferring to the target + // agent. + DisablePlannerTransfer disable_planner_transfer = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The resource name of the child agent the rule applies to. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` + string child_agent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + + // Required. The direction of the transfer. + Direction direction = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/app.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/app.proto new file mode 100644 index 00000000000..c62fd0194a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/app.proto @@ -0,0 +1,651 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1/bigquery_export.proto"; +import "google/cloud/ces/v1/common.proto"; +import "google/cloud/ces/v1/schema.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "AppProto"; +option java_package = "com.google.cloud.ces.v1"; +option (google.api.resource_definition) = { + type: "dlp.googleapis.com/InspectTemplate" + pattern: "organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}" + pattern: "projects/{project}/locations/{location}/inspectTemplates/{inspect_template}" +}; +option (google.api.resource_definition) = { + type: "dlp.googleapis.com/DeidentifyTemplate" + pattern: "organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}" + pattern: "projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}" +}; +option (google.api.resource_definition) = { + type: "discoveryengine.googleapis.com/Engine" + pattern: "projects/{project}/locations/{location}/collections/{collection}/engines/{engine}" +}; + +// An app serves as a top-level container for a group of agents, including the +// root agent and its sub-agents, along with their associated configurations. +// These agents work together to achieve specific goals within the app's +// context. +message App { + option (google.api.resource) = { + type: "ces.googleapis.com/App" + pattern: "projects/{project}/locations/{location}/apps/{app}" + plural: "apps" + singular: "app" + }; + + // Defines the structure and metadata for a variable. + message VariableDeclaration { + // Required. The name of the variable. The name must start with a letter or + // underscore and contain only letters, numbers, or underscores. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The description of the variable. + string description = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The schema of the variable. + Schema schema = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // Defines the tool execution behavior if there are **multiple** tools being + // selected by the agent **at the same time**. + enum ToolExecutionMode { + // Unspecified tool execution mode. Default to PARALLEL. + TOOL_EXECUTION_MODE_UNSPECIFIED = 0; + + // If there are multiple tools being selected, they will be executed in + // parallel, with the same + // [ToolContext](https://google.github.io/adk-docs/context/#the-different-types-of-context). + PARALLEL = 1; + + // If there are multiple tools being selected, they will be executed + // sequentially. The next tool will only be executed after the previous tool + // completes and it can see updated + // [ToolContext](https://google.github.io/adk-docs/context/#the-different-types-of-context) + // from the previous tool. + SEQUENTIAL = 2; + } + + // Identifier. The unique identifier of the app. + // Format: `projects/{project}/locations/{location}/apps/{app}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Display name of the app. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Human-readable description of the app. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether the app is pinned in the app list. + bool pinned = 31 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The root agent is the entry point of the app. + // Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` + string root_agent = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + + // Optional. Language settings of the app. + LanguageSettings language_settings = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. TimeZone settings of the app. + TimeZoneSettings time_zone_settings = 27 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Audio processing configuration of the app. + AudioProcessingConfig audio_processing_config = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Logging settings of the app. + LoggingSettings logging_settings = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The default LLM model settings for the app. + // Individual resources (e.g. agents, guardrails) can override these + // configurations as needed. + ModelSettings model_settings = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The tool execution mode for the app. If not provided, will + // default to PARALLEL. + ToolExecutionMode tool_execution_mode = 32 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The evaluation thresholds for the app. + EvaluationMetricsThresholds evaluation_metrics_thresholds = 24 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The declarations of the variables. + repeated VariableDeclaration variable_declarations = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The declarations of predefined variables for the app. + repeated VariableDeclaration predefined_variable_declarations = 28 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Instructions for all the agents in the app. + // You can use this instruction to set up a stable identity or personality + // across all the agents. + string global_instruction = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of guardrails for the app. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}` + repeated string guardrails = 10 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Guardrail" } + ]; + + // Optional. The data store settings for the app. + DataStoreSettings data_store_settings = 15 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The default channel profile used by the app. + ChannelProfile default_channel_profile = 22 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Metadata about the app. This field can be used to store + // additional information relevant to the app's details or intended usages. + map metadata = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when the app was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the app was last updated. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Etag used to ensure the object hasn't changed during a + // read-modify-write operation. If the etag is empty, the update will + // overwrite any concurrent changes. + string etag = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of deployments in the app. + int32 deployment_count = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The default client certificate settings for the app. + ClientCertificateSettings client_certificate_settings = 25 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether the app is locked for changes. If the app is + // locked, modifications to the app resources will be rejected. + bool locked = 29 [(google.api.field_behavior) = OPTIONAL]; +} + +// TimeZone settings of the app. +message TimeZoneSettings { + // Optional. The time zone of the app from the [time zone + // database](https://www.iana.org/time-zones), e.g., America/Los_Angeles, + // Europe/Paris. + string time_zone = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Language settings of the app. +message LanguageSettings { + // Optional. The default language code of the app. + string default_language_code = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of languages codes supported by the app, in addition to the + // `default_language_code`. + repeated string supported_language_codes = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enables multilingual support. If true, agents in the app will use + // pre-built instructions to improve handling of multilingual input. + bool enable_multilingual_support = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The action to perform when an agent receives input in an + // unsupported language. + // + // This can be a predefined action or a custom tool call. + // Valid values are: + // - A tool's full resource name, which triggers a specific tool execution. + // - A predefined system action, such as "escalate" or "exit", which triggers + // an [EndSession][google.cloud.ces.v1.EndSession] signal with corresponding + // [metadata][google.cloud.ces.v1.EndSession.metadata] to terminate the + // conversation. + string fallback_action = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for how the input and output audio should be processed and +// delivered. +message AudioProcessingConfig { + // Optional. Configuration of how the agent response should be synthesized, + // mapping from the language code to + // [SynthesizeSpeechConfig][google.cloud.ces.v1.SynthesizeSpeechConfig]. + // + // If the configuration for the specified language code is not found, the + // configuration for the root language code will be used. For example, if the + // map contains "en-us" and "en", and the specified language code is "en-gb", + // then "en" configuration will be used. + // + // Note: Language code is case-insensitive. + map synthesize_speech_configs = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configures the agent behavior for the user barge-in activities. + BargeInConfig barge_in_config = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The duration of user inactivity (no speech or interaction) before + // the agent prompts the user for reengagement. If not set, the agent will not + // prompt the user for reengagement. + google.protobuf.Duration inactivity_timeout = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for the ambient sound to be played with the + // synthesized agent response, to enhance the naturalness of the conversation. + AmbientSoundConfig ambient_sound_config = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for the ambient sound to be played with the synthesized agent +// response, to enhance the naturalness of the conversation. +message AmbientSoundConfig { + // Prebuilt ambient noise. + enum PrebuiltAmbientNoise { + // Not specified. + PREBUILT_AMBIENT_NOISE_UNSPECIFIED = 0; + + // Ambient noise of a retail store. + RETAIL_STORE = 1; + + // Ambient noise of a convention hall. + CONVENTION_HALL = 2; + + // Ambient noise of a street. + OUTDOOR = 3; + } + + // Ambient noise to be played with the synthesized agent response, to + // enhance the naturalness of the conversation. + oneof source { + // Optional. Deprecated: `prebuilt_ambient_noise` is deprecated in favor of + // `prebuilt_ambient_sound`. + PrebuiltAmbientNoise prebuilt_ambient_noise = 1 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. Ambient noise as a mono-channel, 16kHz WAV file stored in + // [Cloud Storage](https://cloud.google.com/storage). + // + // Note: Please make sure the CES service agent + // `service-@gcp-sa-ces.iam.gserviceaccount.com` has + // `storage.objects.get` permission to the Cloud Storage object. + string gcs_uri = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Name of the prebuilt ambient sound. + // Valid values are: + // - "coffee_shop" + // - "keyboard" + // - "keypad" + // - "hum" + // - "office_1" + // - "office_2" + // - "office_3" + // - "room_1" + // - "room_2" + // - "room_3" + // - "room_4" + // - "room_5" + // - "air_conditioner" + string prebuilt_ambient_sound = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Volume gain (in dB) of the normal native volume supported by + // ambient noise, in the range [-96.0, 16.0]. If unset, or set to a value of + // 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + // will play at approximately half the amplitude of the normal native signal + // amplitude. A value of +6.0 (dB) will play at approximately twice the + // amplitude of the normal native signal amplitude. We strongly recommend not + // to exceed +10 (dB) as there's usually no effective increase in loudness for + // any value greater than that. + double volume_gain_db = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for how the user barge-in activities should be handled. +message BargeInConfig { + // Optional. Disables user barge-in while the agent is speaking. If true, user + // input during agent response playback will be ignored. + // + // Deprecated: `disable_barge_in` is deprecated in favor of + // [`disable_barge_in_control`][google.cloud.ces.v1.ChannelProfile.disable_barge_in_control] + // in ChannelProfile. + bool disable_barge_in = 1 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. If enabled, the agent will adapt its next response based on the + // assumption that the user hasn't heard the full preceding agent message. + // This should not be used in scenarios where agent responses are displayed + // visually. + bool barge_in_awareness = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for how the agent response should be synthesized. +message SynthesizeSpeechConfig { + // Optional. The name of the voice. If not set, the service will choose a + // voice based on the other parameters such as language_code. + // + // For the list of available voices, please refer to [Supported voices and + // languages](https://cloud.google.com/text-to-speech/docs/voices) from Cloud + // Text-to-Speech. + string voice = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The speaking rate/speed in the range [0.25, 2.0]. 1.0 is the + // normal native speed supported by the specific voice. 2.0 is twice as fast, + // and 0.5 is half as fast. Values outside of the range [0.25, 2.0] will + // return an error. + double speaking_rate = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings to describe the conversation data collection behaviors for LLM +// analysis metrics pipeline. +message MetricAnalysisSettings { + // Optional. Whether to collect conversation data for llm analysis metrics. If + // true, conversation data will not be collected for llm analysis metrics; + // otherwise, conversation data will be collected. + bool llm_metrics_opted_out = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings to describe the logging behaviors for the app. +message LoggingSettings { + // Optional. Configuration for how sensitive data should be redacted. + RedactionConfig redaction_config = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for how audio interactions should be recorded. + AudioRecordingConfig audio_recording_config = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Settings to describe the BigQuery export behaviors for the app. + // The conversation data will be exported to BigQuery tables if it is enabled. + BigQueryExportSettings bigquery_export_settings = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Settings to describe the Cloud Logging behaviors for the app. + CloudLoggingSettings cloud_logging_settings = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Settings to describe the conversation logging behaviors for the + // app. + ConversationLoggingSettings conversation_logging_settings = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for how audio interactions should be recorded for + // the evaluation. By default, audio recording is not enabled for evaluation + // sessions. + AudioRecordingConfig evaluation_audio_recording_config = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Settings to describe the conversation data collection behaviors + // for the LLM analysis pipeline for the app. + MetricAnalysisSettings metric_analysis_settings = 7 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Threshold settings for metrics in an Evaluation. +message EvaluationMetricsThresholds { + // Settings for golden evaluations. + message GoldenEvaluationMetricsThresholds { + // Turn level metrics thresholds. + message TurnLevelMetricsThresholds { + // Semantic similarity channel to use. + enum SemanticSimilarityChannel { + // Metric unspecified. Defaults to TEXT. + SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED = 0; + + // Use text semantic similarity. + TEXT = 1; + + // Use audio semantic similarity. + AUDIO = 2; + } + + // Optional. The success threshold for semantic similarity. Must be an + // integer between 0 and 4. Default is >= 3. + optional int32 semantic_similarity_success_threshold = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The success threshold for overall tool invocation + // correctness. Must be a float between 0 and 1. Default is 1.0. + optional float overall_tool_invocation_correctness_threshold = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The semantic similarity channel to use for evaluation. + SemanticSimilarityChannel semantic_similarity_channel = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Expectation level metrics thresholds. + message ExpectationLevelMetricsThresholds { + // Optional. The success threshold for individual tool invocation + // parameter correctness. Must be a float between 0 and 1. Default is 1.0. + optional float tool_invocation_parameter_correctness_threshold = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The turn level metrics thresholds. + TurnLevelMetricsThresholds turn_level_metrics_thresholds = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The expectation level metrics thresholds. + ExpectationLevelMetricsThresholds expectation_level_metrics_thresholds = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The tool matching settings. An + // extra tool call is a tool call that is present in the execution but does + // not match any tool call in the golden expectation. + ToolMatchingSettings tool_matching_settings = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Settings for matching tool calls. + message ToolMatchingSettings { + // Defines the behavior when an extra tool call is encountered. An extra + // tool call is a tool call that is present in the execution but does not + // match any tool call in the golden expectation. + enum ExtraToolCallBehavior { + // Unspecified behavior. Defaults to FAIL. + EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED = 0; + + // Fail the evaluation if an extra tool call is encountered. + FAIL = 1; + + // Allow the extra tool call. + ALLOW = 2; + } + + // Optional. Behavior for extra tool calls. + // Defaults to FAIL. + ExtraToolCallBehavior extra_tool_call_behavior = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The hallucination metric behavior. Regardless of the behavior, the metric + // will always be calculated. The difference is that when disabled, the + // metric is not used to calculate the overall evaluation score. + enum HallucinationMetricBehavior { + // Unspecified hallucination metric behavior. + HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED = 0; + + // Disable hallucination metric. + DISABLED = 1; + + // Enable hallucination metric. + ENABLED = 2; + } + + // Optional. The golden evaluation metrics thresholds. + GoldenEvaluationMetricsThresholds golden_evaluation_metrics_thresholds = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deprecated: Use `golden_hallucination_metric_behavior` instead. + // The hallucination metric behavior is currently used for golden evaluations. + HallucinationMetricBehavior hallucination_metric_behavior = 3 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. The hallucination metric behavior for golden evaluations. + HallucinationMetricBehavior golden_hallucination_metric_behavior = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The hallucination metric behavior for scenario evaluations. + HallucinationMetricBehavior scenario_hallucination_metric_behavior = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings for custom client certificates. +message ClientCertificateSettings { + // Required. The TLS certificate encoded in PEM format. This string must + // include the begin header and end footer lines. + string tls_certificate = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the SecretManager secret version resource storing the + // private key encoded in PEM format. + // Format: `projects/{project}/secrets/{secret}/versions/{version}` + string private_key = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Optional. The name of the SecretManager secret version resource storing the + // passphrase to decrypt the private key. Should be left unset if the private + // key is not encrypted. + // Format: `projects/{project}/secrets/{secret}/versions/{version}` + string passphrase = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings to describe the conversation logging behaviors for the app. +message ConversationLoggingSettings { + // Optional. Whether to disable conversation logging for the sessions. + bool disable_conversation_logging = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings to describe the Cloud Logging behaviors for the app. +message CloudLoggingSettings { + // Optional. Whether to enable Cloud Logging for the sessions. + bool enable_cloud_logging = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for how the audio interactions should be recorded. +message AudioRecordingConfig { + // Optional. The [Cloud Storage](https://cloud.google.com/storage) bucket to + // store the session audio recordings. The URI must start with "gs://". + // + // Please choose a bucket location that meets your data residency + // requirements. + // + // Note: If the Cloud Storage bucket is in a different project from the app, + // you should grant `storage.objects.create` permission to the CES service + // agent `service-@gcp-sa-ces.iam.gserviceaccount.com`. + string gcs_bucket = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud Storage path prefix for audio recordings. + // + // This prefix can include the following placeholders, which will be + // dynamically substituted at serving time: + // - $project: project ID + // - $location: app location + // - $app: app ID + // - $date: session date in YYYY-MM-DD format + // - $session: session ID + // + // If the path prefix is not specified, the default prefix + // `$project/$location/$app/$date/$session/` will be used. + string gcs_path_prefix = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration to instruct how sensitive data should be handled. +message RedactionConfig { + // Optional. If true, redaction will be applied in various logging scenarios, + // including conversation history, Cloud Logging and audio recording. + bool enable_redaction = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. [DLP](https://cloud.google.com/dlp/docs) inspect template name to + // configure detection of sensitive data types. + // + // Format: + // `projects/{project}/locations/{location}/inspectTemplates/{inspect_template}` + string inspect_template = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/InspectTemplate" + } + ]; + + // Optional. [DLP](https://cloud.google.com/dlp/docs) deidentify template name + // to instruct on how to de-identify content. + // + // Format: + // `projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}` + string deidentify_template = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/DeidentifyTemplate" + } + ]; +} + +// Data store related settings for the app. +message DataStoreSettings { + // An engine to which the data stores are connected. + // See Vertex AI Search: + // https://cloud.google.com/generative-ai-app-builder/docs/enterprise-search-introduction. + message Engine { + // The type of the engine. + // See the documentation available at + // https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SolutionType + // and + // https://cloud.google.com/generative-ai-app-builder/docs/create-datastore-ingest. + enum Type { + // Unspecified engine type. + TYPE_UNSPECIFIED = 0; + + // The SOLUTION_TYPE_SEARCH engine for the app. All connector data stores + // added to the app will be added to this engine. + ENGINE_TYPE_SEARCH = 1; + + // Chat engine type. + // The SOLUTION_TYPE_CHAT engine for the app. All connector data stores + // added to the app will be added to this engine. + ENGINE_TYPE_CHAT = 2; + } + + // Output only. The resource name of the engine. + // Format: + // `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Engine" + } + ]; + + // Output only. The type of the engine. + Type type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The engines for the app. + repeated Engine engines = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/app_version.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/app_version.proto new file mode 100644 index 00000000000..ff383d97347 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/app_version.proto @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1/agent.proto"; +import "google/cloud/ces/v1/app.proto"; +import "google/cloud/ces/v1/example.proto"; +import "google/cloud/ces/v1/guardrail.proto"; +import "google/cloud/ces/v1/tool.proto"; +import "google/cloud/ces/v1/toolset.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "AppVersionProto"; +option java_package = "com.google.cloud.ces.v1"; + +// A snapshot of the app. +message AppSnapshot { + // Optional. The basic settings for the app. + App app = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of agents in the app. + repeated Agent agents = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of tools in the app. + repeated Tool tools = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of examples in the app. + repeated Example examples = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of guardrails in the app. + repeated Guardrail guardrails = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of toolsets in the app. + repeated Toolset toolsets = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// In Customer Engagement Suite (CES), an app version is a snapshot of the app +// at a specific point in time. It is immutable and cannot be modified once +// created. +message AppVersion { + option (google.api.resource) = { + type: "ces.googleapis.com/AppVersion" + pattern: "projects/{project}/locations/{location}/apps/{app}/versions/{version}" + plural: "appVersions" + singular: "appVersion" + }; + + // Identifier. The unique identifier of the app version. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/versions/{version}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. The display name of the app version. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The description of the app version. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Email of the user who created the app version. + string creator = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the app version was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The snapshot of the app when the version is created. + AppSnapshot snapshot = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Etag used to ensure the object hasn't changed during a + // read-modify-write operation. If the etag is empty, the update will + // overwrite any concurrent changes. + string etag = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/auth.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/auth.proto new file mode 100644 index 00000000000..882c3689138 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/auth.proto @@ -0,0 +1,195 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "AuthProto"; +option java_package = "com.google.cloud.ces.v1"; +option (google.api.resource_definition) = { + type: "secretmanager.googleapis.com/SecretVersion" + pattern: "projects/{project}/secrets/{secret}/versions/{secret_version}" +}; + +// Configurations for authentication with API key. +message ApiKeyConfig { + // The location of the API key in the request. + enum RequestLocation { + // Unspecified. This value should not be used. + REQUEST_LOCATION_UNSPECIFIED = 0; + + // Represents the key in http header. + HEADER = 1; + + // Represents the key in query string. + QUERY_STRING = 2; + } + + // Required. The parameter name or the header name of the API key. + // E.g., If the API request is "https://example.com/act?X-Api-Key=", "X-Api-Key" would be the parameter name. + string key_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the SecretManager secret version resource storing the + // API key. Format: `projects/{project}/secrets/{secret}/versions/{version}` + // + // Note: You should grant `roles/secretmanager.secretAccessor` role to the CES + // service agent + // `service-@gcp-sa-ces.iam.gserviceaccount.com`. + string api_key_secret_version = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Required. Key location in the request. + RequestLocation request_location = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Configurations for authentication with OAuth. +message OAuthConfig { + // OAuth grant types. Only [client credential + // grant](https://oauth.net/2/grant-types/client-credentials) is supported. + enum OauthGrantType { + // Unspecified. Defaults to CLIENT_CREDENTIAL. + OAUTH_GRANT_TYPE_UNSPECIFIED = 0; + + // Represents the [client credential + // flow](https://oauth.net/2/grant-types/client-credentials). + CLIENT_CREDENTIAL = 1; + } + + // Required. OAuth grant types. + OauthGrantType oauth_grant_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The client ID from the OAuth provider. + string client_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the SecretManager secret version resource storing the + // client secret. + // Format: `projects/{project}/secrets/{secret}/versions/{version}` + // + // Note: You should grant `roles/secretmanager.secretAccessor` role to the CES + // service agent + // `service-@gcp-sa-ces.iam.gserviceaccount.com`. + string client_secret_version = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Required. The token endpoint in the OAuth provider to exchange for an + // access token. + string token_endpoint = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The OAuth scopes to grant. + repeated string scopes = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configurations for authentication with [ID +// token](https://cloud.google.com/docs/authentication/token-types#id) generated +// from service agent. +message ServiceAgentIdTokenAuthConfig {} + +// Configurations for authentication using a custom service account. +message ServiceAccountAuthConfig { + // Required. The email address of the service account used for authentication. + // CES uses this service account to exchange an access token and the access + // token is then sent in the `Authorization` header of the request. + // + // The service account must have the + // `roles/iam.serviceAccountTokenCreator` role granted to the + // CES service agent + // `service-@gcp-sa-ces.iam.gserviceaccount.com`. + string service_account = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The OAuth scopes to grant. If not specified, the default scope + // `https://www.googleapis.com/auth/cloud-platform` is used. + repeated string scopes = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configurations for authentication with a bearer token. +message BearerTokenConfig { + // Required. The bearer token. + // Must be in the format `$context.variables.`. + string token = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// End-user authentication configuration used for Connection calls. +// The field values must be the names of context variables in the format +// `$context.variables.`. +message EndUserAuthConfig { + // Oauth 2.0 Authorization Code authentication configuration. + message Oauth2AuthCodeConfig { + // Required. Oauth token parameter name to pass through. + // Must be in the format `$context.variables.`. + string oauth_token = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // JWT Profile Oauth 2.0 Authorization Grant authentication configuration. + message Oauth2JwtBearerConfig { + // Required. Issuer parameter name to pass through. + // Must be in the format `$context.variables.`. + string issuer = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Subject parameter name to pass through. + // Must be in the format `$context.variables.`. + string subject = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Client parameter name to pass through. + // Must be in the format `$context.variables.`. + string client_key = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // The auth configuration. + oneof auth_config { + // Oauth 2.0 Authorization Code authentication. + Oauth2AuthCodeConfig oauth2_auth_code_config = 2; + + // JWT Profile Oauth 2.0 Authorization Grant authentication. + Oauth2JwtBearerConfig oauth2_jwt_bearer_config = 3; + } +} + +// Authentication information required for API calls. +message ApiAuthentication { + // The auth configuration. + oneof auth_config { + // Optional. Config for API key auth. + ApiKeyConfig api_key_config = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Config for OAuth. + OAuthConfig oauth_config = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Config for ID token auth generated from CES service agent. + ServiceAgentIdTokenAuthConfig service_agent_id_token_auth_config = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Config for service account authentication. + ServiceAccountAuthConfig service_account_auth_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Config for bearer token auth. + BearerTokenConfig bearer_token_config = 5 + [(google.api.field_behavior) = OPTIONAL]; + } +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/bigquery_export.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/bigquery_export.proto new file mode 100644 index 00000000000..dd9e7cc1f71 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/bigquery_export.proto @@ -0,0 +1,40 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "BigQueryExportProto"; +option java_package = "com.google.cloud.ces.v1"; + +// Settings to describe the BigQuery export behaviors for the app. +message BigQueryExportSettings { + // Optional. Indicates whether the BigQuery export is enabled. + bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The project ID of the BigQuery dataset to export the data to. + // + // Note: If the BigQuery dataset is in a different project from the app, + // you should grant `roles/bigquery.admin` role to the CES service agent + // `service-@gcp-sa-ces.iam.gserviceaccount.com`. + string project = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The BigQuery dataset to export the data to. + string dataset = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/changelog.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/changelog.proto new file mode 100644 index 00000000000..5b20de06e94 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/changelog.proto @@ -0,0 +1,82 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ChangelogProto"; +option java_package = "com.google.cloud.ces.v1"; + +// Changelogs represent a change made to the app or to an resource within the +// app. +message Changelog { + option (google.api.resource) = { + type: "ces.googleapis.com/Changelog" + pattern: "projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}" + plural: "changelogs" + singular: "changelog" + }; + + // Identifier. The unique identifier of the changelog. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. Email address of the change author. + string author = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Display name of the change. It typically should be the display + // name of the resource that was changed. + string display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Description of the change. which typically captures the + // changed fields in the resource. + string description = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The resource that was changed. + string resource = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of the resource that was changed. + string resource_type = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The action that was performed on the resource. + string action = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The original resource before the change. + google.protobuf.Struct original_resource = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The new resource after the change. + google.protobuf.Struct new_resource = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The dependent resources that were changed. + repeated google.protobuf.Struct dependent_resources = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the change was made. + google.protobuf.Timestamp create_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The monotonically increasing sequence number of the changelog. + int64 sequence_number = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/client_function.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/client_function.proto new file mode 100644 index 00000000000..02b793a4ba8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/client_function.proto @@ -0,0 +1,44 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/ces/v1/schema.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ClientFunctionProto"; +option java_package = "com.google.cloud.ces.v1"; + +// Represents a client-side function that the agent can invoke. When the +// tool is chosen by the agent, control is handed off to the client. +// The client is responsible for executing the function and returning the result +// as a [ToolResponse][google.cloud.ces.v1.ToolResponse] to continue the +// interaction with the agent. +message ClientFunction { + // Required. The function name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The function description. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The schema of the function parameters. + Schema parameters = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The schema of the function response. + Schema response = 4 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/common.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/common.proto new file mode 100644 index 00000000000..c5e638848cd --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/common.proto @@ -0,0 +1,344 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.ces.v1"; +option (google.api.resource_definition) = { + type: "servicedirectory.googleapis.com/Service" + pattern: "projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}" +}; + +// The execution type of the tool or toolset. +enum ExecutionType { + // The execution type is unspecified. Defaults to `SYNCHRONOUS` if + // unspecified. + EXECUTION_TYPE_UNSPECIFIED = 0; + + // The tool is executed synchronously. The session is blocked + // until the tool returns. + SYNCHRONOUS = 1; + + // The tool is executed asynchronously. The session will + // continue while the tool is executing. + ASYNCHRONOUS = 2; +} + +// A callback defines the custom logic to be executed at various stages of +// agent interaction. +message Callback { + // The callback to execute. + oneof callback { + // Required. The python code to execute for the callback. + string python_code = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Optional. Human-readable description of the callback. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether the callback is disabled. Disabled callbacks are ignored + // by the agent. + bool disabled = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If enabled, the callback will also be executed on intermediate + // model outputs. This setting only affects after model callback. + // **ENABLE WITH CAUTION**. Typically after model callback only needs to be + // executed after receiving all model responses. Enabling proactive execution + // may have negative implication on the execution cost and latency, and + // should only be enabled in rare situations. + bool proactive_execution_enabled = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Model settings contains various configurations for the LLM model. +message ModelSettings { + // Optional. The LLM model that the agent should use. + // If not set, the agent will inherit the model from its parent agent. + string model = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, this temperature will be used for the LLM model. + // Temperature controls the randomness of the model's responses. Lower + // temperatures produce responses that are more predictable. Higher + // temperatures produce responses that are more creative. + optional double temperature = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Action that is taken when a certain precondition is met. +message TriggerAction { + // Represents a response from the agent. + message Response { + // Required. Text for the agent to respond with. + string text = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Whether the response is disabled. Disabled responses are not + // used by the agent. + bool disabled = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // The agent will immediately respond with a preconfigured response. + message RespondImmediately { + // Required. The canned responses for the agent to choose from. The response + // is chosen randomly. + repeated Response responses = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The agent will immediately respond with a generative answer. + message GenerativeAnswer { + // Required. The prompt to use for the generative answer. + string prompt = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The agent will transfer the conversation to a different agent. + message TransferAgent { + // Required. The name of the agent to transfer the conversation to. The + // agent must be in the same app as the current agent. Format: + // `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` + string agent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + } + + // The action to take. + oneof action { + // Optional. Immediately respond with a preconfigured response. + RespondImmediately respond_immediately = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Transfer the conversation to a different agent. + TransferAgent transfer_agent = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Respond with a generative answer. + GenerativeAnswer generative_answer = 3 + [(google.api.field_behavior) = OPTIONAL]; + } +} + +// The TLS configuration. +message TlsConfig { + // The CA certificate. + message CaCert { + // Required. The name of the allowed custom CA certificates. This + // can be used to disambiguate the custom CA certificates. + string display_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The allowed custom CA certificates (in DER format) for + // HTTPS verification. This overrides the default SSL trust store. If this + // is empty or unspecified, CES will use Google's default trust + // store to verify certificates. N.B. Make sure the HTTPS server + // certificates are signed with "subject alt name". For instance a + // certificate can be self-signed using the following command, + // openssl x509 -req -days 200 -in example.com.csr \ + // -signkey example.com.key \ + // -out example.com.crt \ + // -extfile <(printf "\nsubjectAltName='DNS:www.example.com'") + bytes cert = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Specifies a list of allowed custom CA certificates for HTTPS + // verification. + repeated CaCert ca_certs = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Configuration for tools using Service Directory. +message ServiceDirectoryConfig { + // Required. The name of [Service + // Directory](https://cloud.google.com/service-directory) service. + // Format: + // `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}`. + // Location of the service directory must be the same as the location of the + // app. + string service = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicedirectory.googleapis.com/Service" + } + ]; +} + +// A ChannelProfile configures the agent's behavior for a specific communication +// channel, such as web UI or telephony. +message ChannelProfile { + // Represents the persona property of a channel. + message PersonaProperty { + // The persona of the channel. + enum Persona { + // UNKNOWN persona. + UNKNOWN = 0; + + // The agent keeps the responses concise and to the point + CONCISE = 1; + + // The agent provides additional context, explanations, and details + CHATTY = 2; + } + + // Optional. The persona of the channel. + Persona persona = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Message for configuration for the web widget. + message WebWidgetConfig { + // Security settings for the web widget. + message SecuritySettings { + // Optional. Indicates whether public access to the web widget is enabled. + // If `true`, the web widget will be publicly accessible. + // If `false`, the web widget must be integrated with your own + // authentication and authorization system to return valid credentials for + // accessing the CES agent. + bool enable_public_access = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether origin check for the web widget is enabled. + // If `true`, the web widget will check the origin of the website that + // loads the web widget and only allow it to be loaded in the same origin + // or any of the allowed origins. + bool enable_origin_check = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The origins that are allowed to host the web widget. An + // origin is defined by RFC 6454. If empty, all origins are allowed. A + // maximum of 100 origins is allowed. Example: "https://example.com" + repeated string allowed_origins = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether reCAPTCHA verification for the web widget + // is enabled. + bool enable_recaptcha = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Modality of the web widget. + enum Modality { + // Unknown modality. + MODALITY_UNSPECIFIED = 0; + + // Widget supports both chat and voice input. + CHAT_AND_VOICE = 1; + + // Widget supports only voice input. + VOICE_ONLY = 2; + + // Widget supports only chat input. + CHAT_ONLY = 3; + } + + // Theme of the web widget. + enum Theme { + // Unknown theme. + THEME_UNSPECIFIED = 0; + + // Light theme. + LIGHT = 1; + + // Dark theme. + DARK = 2; + } + + // Optional. The modality of the web widget. + Modality modality = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The theme of the web widget. + Theme theme = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The title of the web widget. + string web_widget_title = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The security settings of the web widget. + SecuritySettings security_settings = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The type of the channel profile. + enum ChannelType { + // Unknown channel type. + UNKNOWN = 0; + + // Web UI channel. + WEB_UI = 2; + + // API channel. + API = 3; + + // Twilio channel. + TWILIO = 4; + + // Google Telephony Platform channel. + GOOGLE_TELEPHONY_PLATFORM = 5; + + // Contact Center as a Service (CCaaS) channel. + CONTACT_CENTER_AS_A_SERVICE = 6; + + // Five9 channel. + FIVE9 = 7; + } + + // Optional. The unique identifier of the channel profile. + string profile_id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The type of the channel profile. + ChannelType channel_type = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The persona property of the channel profile. + PersonaProperty persona_property = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to disable DTMF (dual-tone multi-frequency). + bool disable_dtmf = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to disable user barge-in control in the conversation. + // - **true**: User interruptions are disabled while the agent is speaking. + // - **false**: The agent retains automatic control over when the user can + // interrupt. + bool disable_barge_in_control = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration for the web widget. + WebWidgetConfig web_widget_config = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The noise suppression level of the channel profile. + // Available values are "low", "moderate", "high", "very_high". + string noise_suppression_level = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// A span is a unit of work or a single operation during the request processing. +message Span { + // Output only. The name of the span. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The start time of the span. + google.protobuf.Timestamp start_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The end time of the span. + google.protobuf.Timestamp end_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The duration of the span. + google.protobuf.Duration duration = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Key-value attributes associated with the span. + google.protobuf.Struct attributes = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The child spans that are nested under this span. + repeated Span child_spans = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/connector_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/connector_tool.proto new file mode 100644 index 00000000000..a0a98bfd7a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/connector_tool.proto @@ -0,0 +1,111 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/ces/v1/auth.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ConnectorToolProto"; +option java_package = "com.google.cloud.ces.v1"; + +// Configuration of an Action for the tool to use. +// Note: This can be either an Action or an Operation. See +// https://cloud.google.com/integration-connectors/docs/entities-operation-action +// for details. +message Action { + // Entity CRUD operation specification. + message EntityOperation { + // The operation to perform on the entity. + enum OperationType { + // Operation type unspecified. Invalid, ConnectorTool create/update + // will fail. + OPERATION_TYPE_UNSPECIFIED = 0; + + // List operation. + LIST = 1; + + // Get operation. + GET = 2; + + // Create operation. + CREATE = 3; + + // Update operation. + UPDATE = 4; + + // Delete operation. + DELETE = 5; + } + + // Required. ID of the entity. + string entity_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Operation to perform on the entity. + OperationType operation = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Specification for an action to configure for the tool to use. + oneof action_spec { + // ID of a Connection action for the tool to use. + string connection_action_id = 4; + + // Entity operation configuration for the tool to use. + EntityOperation entity_operation = 5; + } + + // Optional. Entity fields to use as inputs for the operation. + // If no fields are specified, all fields of the Entity will be used. + repeated string input_fields = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Entity fields to return from the operation. + // If no fields are specified, all fields of the Entity will be returned. + repeated string output_fields = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A ConnectorTool allows connections to different integrations. +// See: https://cloud.google.com/integration-connectors/docs/overview. +message ConnectorTool { + // Required. The full resource name of the referenced Integration Connectors + // Connection. + // Format: + // `projects/{project}/locations/{location}/connections/{connection}` + string connection = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Action for the tool to use. + Action action = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Configures how authentication is handled in Integration + // Connectors. By default, an admin authentication is passed in the + // Integration Connectors API requests. You can override it with a different + // end-user authentication config. + // **Note**: The Connection must have authentication override enabled in + // order to specify an EUC configuration here - otherwise, the ConnectorTool + // creation will fail. See + // https://cloud.google.com/application-integration/docs/configure-connectors-task#configure-authentication-override + // for details. + EndUserAuthConfig auth_config = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the tool that can be used by the Agent to decide + // whether to call this ConnectorTool. + string name = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The description of the tool that can be used by the Agent to + // decide whether to call this ConnectorTool. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/connector_toolset.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/connector_toolset.proto new file mode 100644 index 00000000000..e30b9e651de --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/connector_toolset.proto @@ -0,0 +1,50 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/ces/v1/auth.proto"; +import "google/cloud/ces/v1/connector_tool.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ConnectorToolsetProto"; +option java_package = "com.google.cloud.ces.v1"; + +// A toolset that generates tools from an Integration Connectors Connection. +message ConnectorToolset { + // Required. The full resource name of the referenced Integration Connectors + // Connection. + // Format: + // `projects/{project}/locations/{location}/connections/{connection}` + string connection = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Configures how authentication is handled in Integration + // Connectors. By default, an admin authentication is passed in the + // Integration Connectors API requests. You can override it with a different + // end-user authentication config. + // **Note**: The Connection must have authentication override enabled in + // order to specify an EUC configuration here - otherwise, the Toolset + // creation will fail. See: + // https://cloud.google.com/application-integration/docs/configure-connectors-task#configure-authentication-override + EndUserAuthConfig auth_config = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The list of connector actions/entity operations to generate tools + // for. + repeated Action connector_actions = 3 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/conversation.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/conversation.proto new file mode 100644 index 00000000000..6630ac30c73 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/conversation.proto @@ -0,0 +1,165 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1/common.proto"; +import "google/cloud/ces/v1/example.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ConversationProto"; +option java_package = "com.google.cloud.ces.v1"; + +// A conversation represents an interaction between an end user and the CES app. +message Conversation { + option (google.api.resource) = { + type: "ces.googleapis.com/Conversation" + pattern: "projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}" + plural: "conversations" + singular: "conversation" + }; + + // All information about a single turn in the conversation. + message Turn { + // Optional. List of messages in the conversation turn, including user + // input, agent responses and intermediate events during the processing. + repeated Message messages = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The root span of the action processing. + Span root_span = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // The channel type of the conversation. + enum ChannelType { + // Unspecified channel type. + CHANNEL_TYPE_UNSPECIFIED = 0; + + // The conversation only contains text messages between the end user and the + // agent. + TEXT = 1; + + // The conversation contains audio messages between the end user and the + // agent. + AUDIO = 2; + + // The conversation multi-modal messages (e.g. image) between the end user + // and the agent. + MULTIMODAL = 3; + } + + // The source of the conversation. + enum Source { + // Unspecified source. + SOURCE_UNSPECIFIED = 0; + + // The conversation is from the live end user. + LIVE = 1; + + // The conversation is from the simulator. + SIMULATOR = 2; + + // The conversation is from the evaluation. + EVAL = 3; + } + + // Type of the input message. + enum InputType { + // Unspecified input type. + INPUT_TYPE_UNSPECIFIED = 0; + + // The input message is text. + INPUT_TYPE_TEXT = 1; + + // The input message is audio. + INPUT_TYPE_AUDIO = 2; + + // The input message is image. + INPUT_TYPE_IMAGE = 3; + + // The input message is blob file. + INPUT_TYPE_BLOB = 4; + + // The input message is client function tool response. + INPUT_TYPE_TOOL_RESPONSE = 5; + + // The input message are variables. + INPUT_TYPE_VARIABLES = 6; + } + + // Identifier. The unique identifier of the conversation. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. Timestamp when the conversation was created. + google.protobuf.Timestamp start_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the conversation was completed. + google.protobuf.Timestamp end_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The turns in the conversation. + repeated Turn turns = 6 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The number of turns in the conversation. + int32 turn_count = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // DEPRECATED. Please use + // [input_types][google.cloud.ces.v1.Conversation.input_types] instead. + ChannelType channel_type = 8 [deprecated = true]; + + // Output only. Indicate the source of the conversation. + Source source = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The input types of the conversation. + repeated InputType input_types = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The agent that initially handles the conversation. If not + // specified, the conversation is handled by the root agent. Format: + // `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` + string entry_agent = 11 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + + // Output only. The deployment of the app used for processing the + // conversation. Format: + // `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` + string deployment = 12 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "ces.googleapis.com/Deployment" } + ]; + + // Output only. The version of the app used for processing the conversation. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/versions/{version}` + string app_version = 13 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "ces.googleapis.com/AppVersion" } + ]; + + // Output only. The language code of the conversation. + string language_code = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Deprecated. Use turns instead. + repeated Message messages = 2 [deprecated = true]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/data_store.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/data_store.proto new file mode 100644 index 00000000000..08772a55ba4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/data_store.proto @@ -0,0 +1,98 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "DataStoreProto"; +option java_package = "com.google.cloud.ces.v1"; + +// A DataStore resource in Vertex AI Search. +message DataStore { + // The connector config for the data store connection. + message ConnectorConfig { + // Resource name of the collection the data store belongs to. + string collection = 1; + + // Display name of the collection the data store belongs to. + string collection_display_name = 2; + + // The name of the data source. + // Example: `salesforce`, `jira`, `confluence`, `bigquery`. + string data_source = 3; + } + + // The type of the data store. + enum DataStoreType { + // Not specified. This value indicates that the data store type is not + // specified, so it will not be used during search. + DATA_STORE_TYPE_UNSPECIFIED = 0; + + // A data store that contains public web content. + PUBLIC_WEB = 1; + + // A data store that contains unstructured private data. + UNSTRUCTURED = 2; + + // A data store that contains structured data used as FAQ. + FAQ = 3; + + // A data store that is a connector to a first-party or a third-party + // service. + CONNECTOR = 4; + } + + // The document processing mode of the data store. + enum DocumentProcessingMode { + // Not specified. + DOCUMENT_PROCESSING_MODE_UNSPECIFIED = 0; + + // Documents are processed as documents. + DOCUMENTS = 1; + + // Documents are converted to chunks. + CHUNKS = 2; + } + + // Required. Full resource name of the DataStore. + // Format: + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The type of the data store. This field is readonly and + // populated by the server. + DataStoreType type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The document processing mode for the data store connection. + // Only set for PUBLIC_WEB and UNSTRUCTURED data stores. + DocumentProcessingMode document_processing_mode = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The display name of the data store. + string display_name = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the data store was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The connector config for the data store connection. + ConnectorConfig connector_config = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/data_store_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/data_store_tool.proto new file mode 100644 index 00000000000..23c9ca00ade --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/data_store_tool.proto @@ -0,0 +1,302 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/ces/v1/common.proto"; +import "google/cloud/ces/v1/data_store.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "DataStoreToolProto"; +option java_package = "com.google.cloud.ces.v1"; + +// Tool to retrieve from Vertex AI Search datastore or engine for grounding. +// Accepts either a datastore or an engine, but not both. +// See Vertex AI Search: +// https://cloud.google.com/generative-ai-app-builder/docs/enterprise-search-introduction. +message DataStoreTool { + // Rewriter configuration. + message RewriterConfig { + // Required. Configurations for the LLM model. + ModelSettings model_settings = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The prompt definition. If not set, default prompt will be used. + string prompt = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether the rewriter is disabled. + bool disabled = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Summarization configuration. + message SummarizationConfig { + // Optional. Configurations for the LLM model. + ModelSettings model_settings = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The prompt definition. If not set, default prompt will be used. + string prompt = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether summarization is disabled. + bool disabled = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Grounding configuration. + message GroundingConfig { + // Optional. The groundedness threshold of the answer based on the retrieved + // sources. The value has a configurable range of [1, 5]. The level is used + // to threshold the groundedness of the answer, meaning that all responses + // with a groundedness score below the threshold will fall back to returning + // relevant snippets only. + // + // For example, a level of 3 means that the groundedness score must be + // 3 or higher for the response to be returned. + float grounding_level = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether grounding is disabled. + bool disabled = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for searching within a specific DataStore. + message DataStoreSource { + // Optional. Filter specification for the DataStore. + // See: + // https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The data store. + DataStore data_store = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for searching within an Engine, potentially targeting + // specific DataStores. + message EngineSource { + // Required. Full resource name of the Engine. + // Format: + // `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` + string engine = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Use to target specific DataStores within the Engine. + // If empty, the search applies to all DataStores associated with the + // Engine. + repeated DataStoreSource data_store_sources = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter applied to the search across the Engine. Not relevant + // and not used if 'data_store_sources' is provided. See: + // https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata + string filter = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Boost specifications to boost certain documents. + // For more information, please refer to + // https://cloud.google.com/generative-ai-app-builder/docs/boosting. + message BoostSpecs { + // Required. The Data Store where the boosting configuration is applied. + // Full resource name of DataStore, such as + // projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}. + repeated string data_stores = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A list of boosting specifications. + repeated BoostSpec spec = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Boost specification to boost certain documents. + message BoostSpec { + // Boost specification for a condition. + message ConditionBoostSpec { + // Specification for custom ranking based on customer specified attribute + // value. It provides more controls for customized ranking than the simple + // (condition, boost) combination above. + message BoostControlSpec { + // The control points used to define the curve. The curve defined + // through these control points can only be monotonically increasing + // or decreasing(constant values are acceptable). + message ControlPoint { + // Optional. Can be one of: + // 1. The numerical field value. + // 2. The duration spec for freshness: + // The value must be formatted as an XSD `dayTimeDuration` value (a + // restricted subset of an ISO 8601 duration value). The pattern for + // this is: `[nD][T[nH][nM][nS]]`. + string attribute_value = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value between -1 to 1 by which to boost the score if + // the attribute_value evaluates to the value specified above. + float boost_amount = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // The attribute(or function) for which the custom ranking is to be + // applied. + enum AttributeType { + // Unspecified AttributeType. + ATTRIBUTE_TYPE_UNSPECIFIED = 0; + + // The value of the numerical field will be used to dynamically update + // the boost amount. In this case, the attribute_value (the x value) + // of the control point will be the actual value of the numerical + // field for which the boost_amount is specified. + NUMERICAL = 1; + + // For the freshness use case the attribute value will be the duration + // between the current time and the date in the datetime field + // specified. The value must be formatted as an XSD `dayTimeDuration` + // value (a restricted subset of an ISO 8601 duration value). The + // pattern for this is: `[nD][T[nH][nM][nS]]`. + // E.g. `5D`, `3DT12H30M`, `T24H`. + FRESHNESS = 2; + } + + // The interpolation type to be applied. Default will be linear + // (Piecewise Linear). + enum InterpolationType { + // Interpolation type is unspecified. In this case, it defaults to + // Linear. + INTERPOLATION_TYPE_UNSPECIFIED = 0; + + // Piecewise linear interpolation will be applied. + LINEAR = 1; + } + + // Optional. The name of the field whose value will be used to determine + // the boost amount. + string field_name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The attribute type to be used to determine the boost + // amount. The attribute value can be derived from the field value of + // the specified field_name. In the case of numerical it is + // straightforward i.e. attribute_value = numerical_field_value. In the + // case of freshness however, attribute_value = (time.now() - + // datetime_field_value). + AttributeType attribute_type = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The interpolation type to be applied to connect the control + // points listed below. + InterpolationType interpolation_type = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The control points used to define the curve. The monotonic + // function (defined through the interpolation_type above) passes + // through the control points listed here. + repeated ControlPoint control_points = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. An expression which specifies a boost condition. The syntax + // is the same as filter expression syntax. Currently, the only supported + // condition is a list of BCP-47 lang codes. Example: To boost suggestions + // in languages en or fr: (lang_code: ANY("en", "fr")) + string condition = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Strength of the boost, which should be in [-1, 1]. Negative + // boost means demotion. Default is 0.0. + // + // Setting to 1.0 gives the suggestions a big promotion. However, it does + // not necessarily mean that the top result will be a boosted suggestion. + // + // Setting to -1.0 gives the suggestions a big demotion. However, other + // suggestions that are relevant might still be shown. + // + // Setting to 0.0 means no boost applied. The boosting condition is + // ignored. + float boost = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Complex specification for custom ranking based on customer + // defined attribute value. + BoostControlSpec boost_control_spec = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. A list of boosting specifications. + repeated ConditionBoostSpec condition_boost_specs = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // If specified, will apply the given configuration for the specified + // modality. + message ModalityConfig { + // The modality type. + enum ModalityType { + // Unspecified modality type. + MODALITY_TYPE_UNSPECIFIED = 0; + + // Text modality. + TEXT = 1; + + // Audio modality. + AUDIO = 2; + } + + // Required. The modality type. + ModalityType modality_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The rewriter config. + RewriterConfig rewriter_config = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The summarization config. + SummarizationConfig summarization_config = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The grounding configuration. + GroundingConfig grounding_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Filter parameter behavior. + enum FilterParameterBehavior { + // Default filter behavior. + // Include filter parameter for connector datastores. + // For the rest of the datastore types, the filter input parameter is + // omitted. + FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED = 0; + + // Always include filter parameter for all datastore types. + ALWAYS_INCLUDE = 2; + + // The filter parameter is never included in the list of tool parameters, + // regardless of the datastore type. + NEVER_INCLUDE = 3; + } + + // Defines the search source, either a single DataStore or an Engine. + oneof search_source { + // Optional. Search within a single specific DataStore. + DataStoreSource data_store_source = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Search within an Engine (potentially across multiple + // DataStores). + EngineSource engine_source = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The data store tool name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The tool description. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Boost specification to boost certain documents. + repeated BoostSpecs boost_specs = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The modality configs for the data store. + repeated ModalityConfig modality_configs = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The filter parameter behavior. + FilterParameterBehavior filter_parameter_behavior = 10 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/deployment.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/deployment.proto new file mode 100644 index 00000000000..0edb8ebdb68 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/deployment.proto @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1/common.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ChannelProfileProto"; +option java_package = "com.google.cloud.ces.v1"; + +// A deployment represents an immutable, queryable version of the app. +// It is used to deploy an app version with a specific channel profile. +message Deployment { + option (google.api.resource) = { + type: "ces.googleapis.com/Deployment" + pattern: "projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}" + plural: "deployments" + singular: "deployment" + }; + + // Identifier. The resource name of the deployment. + // Format: + // projects/{project}/locations/{location}/apps/{app}/deployments/{deployment} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Display name of the deployment. + string display_name = 8 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource name of the app version to deploy. + // Format: + // projects/{project}/locations/{location}/apps/{app}/versions/{version} + string app_version = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/AppVersion" } + ]; + + // Required. The channel profile used in the deployment. + ChannelProfile channel_profile = 3 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Timestamp when this deployment was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this deployment was last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Etag used to ensure the object hasn't changed during a + // read-modify-write operation. If the etag is empty, the update will + // overwrite any concurrent changes. + string etag = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/example.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/example.proto new file mode 100644 index 00000000000..8f5097320f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/example.proto @@ -0,0 +1,225 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1/toolset_tool.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ExampleProto"; +option java_package = "com.google.cloud.ces.v1"; + +// An example represents a sample conversation between the user and the +// agent(s). +message Example { + option (google.api.resource) = { + type: "ces.googleapis.com/Example" + pattern: "projects/{project}/locations/{location}/apps/{app}/examples/{example}" + plural: "examples" + singular: "example" + }; + + // Identifier. The unique identifier of the example. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/examples/{example}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Display name of the example. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Human-readable description of the example. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The agent that initially handles the conversation. If not + // specified, the example represents a conversation that is handled by the + // root agent. Format: + // `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` + string entry_agent = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + + // Optional. The collection of messages that make up the conversation. + repeated Message messages = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when the example was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the example was last updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The example may become invalid if referencing resources are + // deleted. Invalid examples will not be used as few-shot examples. + bool invalid = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Etag used to ensure the object hasn't changed during a read-modify-write + // operation. If the etag is empty, the update will overwrite any concurrent + // changes. + string etag = 9; +} + +// A message within a conversation. +message Message { + // Optional. The role within the conversation, e.g., user, agent. + string role = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Content of the message as a series of chunks. + repeated Chunk chunks = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Timestamp when the message was sent or received. Should not be + // used if the message is part of an [example][google.cloud.ces.v1.Example]. + google.protobuf.Timestamp event_time = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A chunk of content within a message. +message Chunk { + // Chunk data. + oneof data { + // Optional. Text data. + string text = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Transcript associated with the audio. + string transcript = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Custom payload data. + google.protobuf.Struct payload = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Image data. + Image image = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Tool execution request. + ToolCall tool_call = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Tool execution response. + ToolResponse tool_response = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Agent transfer event. + AgentTransfer agent_transfer = 4 [(google.api.field_behavior) = OPTIONAL]; + + // A struct represents variables that were updated in the conversation, + // keyed by variable names. + google.protobuf.Struct updated_variables = 8; + + // A struct represents default variables at the start of the conversation, + // keyed by variable names. + google.protobuf.Struct default_variables = 10; + } +} + +// Represents a blob input or output in the conversation. +message Blob { + // Required. The IANA standard MIME type of the source data. + string mime_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Raw bytes of the blob. + bytes data = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents an image input or output in the conversation. +message Image { + // Required. The IANA standard MIME type of the source data. + // Supported image types includes: + // * image/png + // * image/jpeg + // * image/webp + string mime_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Raw bytes of the image. + bytes data = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the client or the agent to execute the specified tool. +message ToolCall { + // The identifier of the tool to execute. It could be either a persisted tool + // or a tool from a toolset. + oneof tool_identifier { + // Optional. The name of the tool to execute. + // Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` + string tool = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } + ]; + + // Optional. The toolset tool to execute. + ToolsetTool toolset_tool = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The unique identifier of the tool call. If populated, the client + // should return the execution result with the matching ID in + // [ToolResponse][google.cloud.ces.v1.ToolResponse.id]. + string id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Display name of the tool. + string display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The input parameters and values for the tool in JSON object + // format. + google.protobuf.Struct args = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The execution result of a specific tool from the client or the agent. +message ToolResponse { + // The identifier of the tool that got executed. It could be either a + // persisted tool or a tool from a toolset. + oneof tool_identifier { + // Optional. The name of the tool to execute. + // Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` + string tool = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } + ]; + + // Optional. The toolset tool that got executed. + ToolsetTool toolset_tool = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The matching ID of the [tool call][google.cloud.ces.v1.ToolCall] + // the response is for. + string id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Display name of the tool. + string display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The tool execution result in JSON object format. + // Use "output" key to specify tool response and "error" key to specify + // error details (if any). If "output" and "error" keys are not specified, + // then whole "response" is treated as tool execution result. + google.protobuf.Struct response = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents an event indicating the transfer of a conversation to a different +// agent. +message AgentTransfer { + // Required. The agent to which the conversation is being transferred. The + // agent will handle the conversation from this point forward. Format: + // `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` + string target_agent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + + // Output only. Display name of the agent. + string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/fakes.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/fakes.proto new file mode 100644 index 00000000000..da813b58452 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/fakes.proto @@ -0,0 +1,50 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "FakesProto"; +option java_package = "com.google.cloud.ces.v1"; + +// A code block to be executed instead of a real tool call. +message CodeBlock { + // Required. Python code which will be invoked in tool fake mode. + // Expected Python function signature - + // To catch all tool calls: + // def fake_tool_call(tool: Tool, input: dict[str, Any], + // callback_context: CallbackContext) -> Optional[dict[str, Any]]: + // To catch a specific tool call: + // def fake_{tool_id}(tool: Tool, input: dict[str, Any], + // callback_context: CallbackContext) -> Optional[dict[str, Any]]: + // If the function returns None, the real tool will be invoked instead. + string python_code = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Configuration for tool behavior in fake mode. +message ToolFakeConfig { + // The response is either static or it is provided by a python function. + oneof tool_response { + // Optional. Code block which will be executed instead of a real tool call. + CodeBlock code_block = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Whether the tool is using fake mode. + bool enable_fake_mode = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/file_search_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/file_search_tool.proto new file mode 100644 index 00000000000..5e7da9cc765 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/file_search_tool.proto @@ -0,0 +1,55 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.ces.v1; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "FileSearchToolProto"; +option java_package = "com.google.cloud.ces.v1"; + +// The file search tool allows the agent to search across the files uploaded by +// the app/agent developer. It has presets to give relatively good quality +// search over the uploaded files and summarization of the retrieved results. +message FileSearchTool { + // The type of the Vertex RAG corpus. + enum CorpusType { + // Unspecified corpus type. + CORPUS_TYPE_UNSPECIFIED = 0; + + // The corpus is created and owned by the user. + USER_OWNED = 1; + + // The corpus is created by the agent. + FULLY_MANAGED = 2; + } + + // Optional. The type of the corpus. Default is FULLY_MANAGED. + CorpusType corpus_type = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The tool name. + string name = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The tool description. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The corpus where files are stored. + // Format: + // projects/{project}/locations/{location}/ragCorpora/{rag_corpus} + string file_corpus = 6 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/google_search_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/google_search_tool.proto new file mode 100644 index 00000000000..fa3bceb359b --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/google_search_tool.proto @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "GoogleSearchToolProto"; +option java_package = "com.google.cloud.ces.v1"; + +// Represents a tool to perform Google web searches for grounding. +// See +// https://cloud.google.com/customer-engagement-ai/conversational-agents/ps/tool#google-search. +message GoogleSearchTool { + // Prompt settings used by the model when processing or summarizing the + // google search results. + message PromptConfig { + // Optional. Defines the prompt used for the system instructions when + // interacting with the agent in chat conversations. If not set, default + // prompt will be used. + string text_prompt = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines the prompt used for the system instructions when + // interacting with the agent in voice conversations. If not set, default + // prompt will be used. + string voice_prompt = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The name of the tool. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Description of the tool's purpose. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Content will be fetched directly from these URLs for context and + // grounding. Example: "https://example.com/path.html". A maximum of 20 URLs + // are allowed. + repeated string context_urls = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies domains to restrict search results to. + // Example: "example.com", "another.site". A maximum of 20 domains can be + // specified. + repeated string preferred_domains = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of domains to be excluded from the search results. + // Example: "example.com". + // A maximum of 2000 domains can be excluded. + repeated string exclude_domains = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Prompt instructions passed to planner on how the search results + // should be processed for text and voice. + PromptConfig prompt_config = 5 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/guardrail.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/guardrail.proto new file mode 100644 index 00000000000..b964860c5b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/guardrail.proto @@ -0,0 +1,311 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1/common.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "GuardrailProto"; +option java_package = "com.google.cloud.ces.v1"; + +// Guardrail contains a list of checks and balances to keep the agents safe and +// secure. +message Guardrail { + option (google.api.resource) = { + type: "ces.googleapis.com/Guardrail" + pattern: "projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}" + plural: "guardrails" + singular: "guardrail" + }; + + // Guardrail that bans certain content from being used in the conversation. + message ContentFilter { + // Match type for the content filter. + enum MatchType { + // Match type is not specified. + MATCH_TYPE_UNSPECIFIED = 0; + + // Content is matched for substrings character by character. + SIMPLE_STRING_MATCH = 1; + + // Content only matches if the pattern found in the text is + // surrounded by word delimiters. Banned phrases can also contain word + // delimiters. + WORD_BOUNDARY_STRING_MATCH = 2; + + // Content is matched using regular expression syntax. + REGEXP_MATCH = 3; + } + + // Optional. List of banned phrases. Applies to both user inputs and agent + // responses. + repeated string banned_contents = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of banned phrases. Applies only to user inputs. + repeated string banned_contents_in_user_input = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of banned phrases. Applies only to agent responses. + repeated string banned_contents_in_agent_response = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Match type for the content filter. + MatchType match_type = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If true, diacritics are ignored during matching. + bool disregard_diacritics = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Guardrail that blocks the conversation if the input is considered unsafe + // based on the LLM classification. + message LlmPromptSecurity { + // Configuration for default system security settings. + message DefaultSecuritySettings { + // Output only. The default prompt template used by the system. + // This field is for display purposes to show the user what prompt + // the system uses by default. It is OUTPUT_ONLY. + string default_prompt_template = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Defines the security configuration mode. + // The user must choose one of the following configurations. + oneof security_config { + // Optional. Use the system's predefined default security settings. + // To select this mode, include an empty 'default_settings' message + // in the request. The 'default_prompt_template' field within + // will be populated by the server in the response. + DefaultSecuritySettings default_settings = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Use a user-defined LlmPolicy to configure the security + // guardrail. + LlmPolicy custom_policy = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Determines the behavior when the guardrail encounters an LLM + // error. + // - If true: the guardrail is bypassed. + // - If false (default): the guardrail triggers/blocks. + // + // Note: If a custom policy is provided, this field is ignored in favor + // of the policy's 'fail_open' configuration. + bool fail_open = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Guardrail that blocks the conversation if the LLM response is considered + // violating the policy based on the LLM classification. + message LlmPolicy { + // Defines when to apply the policy check during the conversation. + enum PolicyScope { + // Policy scope is not specified. + POLICY_SCOPE_UNSPECIFIED = 0; + + // Policy check is triggered on user input. + USER_QUERY = 1; + + // Policy check is triggered on agent response. Applying this policy + // scope will introduce additional latency before the agent can respond. + AGENT_RESPONSE = 2; + + // Policy check is triggered on both user input and agent response. + // Applying this policy scope will introduce additional latency before + // the agent can respond. + USER_QUERY_AND_AGENT_RESPONSE = 3; + } + + // Optional. When checking this policy, consider the last 'n' messages in + // the conversation. When not set a default value of 10 will be used. + int32 max_conversation_messages = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Model settings. + ModelSettings model_settings = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Policy prompt. + string prompt = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Defines when to apply the policy check during the conversation. + // If set to `POLICY_SCOPE_UNSPECIFIED`, the policy will be applied to the + // user input. When applying the policy to the agent response, additional + // latency will be introduced before the agent can respond. + PolicyScope policy_scope = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If an error occurs during the policy check, fail open and do + // not trigger the guardrail. + bool fail_open = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. By default, the LLM policy check is bypassed for short + // utterances. Enabling this setting applies the policy check to all + // utterances, including those that would normally be skipped. + bool allow_short_utterance = 6 [(google.api.field_behavior) = OPTIONAL]; + } + + // Model safety settings overrides. When this is set, it will override the + // default settings and trigger the guardrail if the response is considered + // unsafe. + message ModelSafety { + // Safety setting. + message SafetySetting { + // Required. The harm category. + HarmCategory category = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The harm block threshold. + HarmBlockThreshold threshold = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Harm category. + enum HarmCategory { + // The harm category is unspecified. + HARM_CATEGORY_UNSPECIFIED = 0; + + // The harm category is hate speech. + HARM_CATEGORY_HATE_SPEECH = 1; + + // The harm category is dangerous content. + HARM_CATEGORY_DANGEROUS_CONTENT = 2; + + // The harm category is harassment. + HARM_CATEGORY_HARASSMENT = 3; + + // The harm category is sexually explicit content. + HARM_CATEGORY_SEXUALLY_EXPLICIT = 4; + } + + // Probability based thresholds levels for blocking. + enum HarmBlockThreshold { + // Unspecified harm block threshold. + HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0; + + // Block low threshold and above (i.e. block more). + BLOCK_LOW_AND_ABOVE = 1; + + // Block medium threshold and above. + BLOCK_MEDIUM_AND_ABOVE = 2; + + // Block only high threshold (i.e. block less). + BLOCK_ONLY_HIGH = 3; + + // Block none. + BLOCK_NONE = 4; + + // Turn off the safety filter. + OFF = 5; + } + + // Required. List of safety settings. + repeated SafetySetting safety_settings = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // Guardrail that blocks the conversation based on the code callbacks + // provided. + message CodeCallback { + // Optional. The callback to execute before the agent is called. + // Each callback function is expected to return a structure (e.g., a dict or + // object) containing at least: + // - 'decision': Either 'OK' or 'TRIGGER'. + // - 'reason': A string explaining the decision. + // A 'TRIGGER' decision may halt further processing. + Callback before_agent_callback = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The callback to execute after the agent is called. + // Each callback function is expected to return a structure (e.g., a dict or + // object) containing at least: + // - 'decision': Either 'OK' or 'TRIGGER'. + // - 'reason': A string explaining the decision. + // A 'TRIGGER' decision may halt further processing. + Callback after_agent_callback = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The callback to execute before the model is called. If there + // are multiple calls to the model, the callback will be executed multiple + // times. Each callback function is expected to return a structure (e.g., a + // dict or object) containing at least: + // - 'decision': Either 'OK' or 'TRIGGER'. + // - 'reason': A string explaining the decision. + // A 'TRIGGER' decision may halt further processing. + Callback before_model_callback = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The callback to execute after the model is called. If there are + // multiple calls to the model, the callback will be executed multiple + // times. Each callback function is expected to return a structure (e.g., a + // dict or object) containing at least: + // - 'decision': Either 'OK' or 'TRIGGER'. + // - 'reason': A string explaining the decision. + // A 'TRIGGER' decision may halt further processing. + Callback after_model_callback = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Guardrail type. + oneof guardrail_type { + // Optional. Guardrail that bans certain content from being used in the + // conversation. + ContentFilter content_filter = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Guardrail that blocks the conversation if the prompt is + // considered unsafe based on the LLM classification. + LlmPromptSecurity llm_prompt_security = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Guardrail that blocks the conversation if the LLM response is + // considered violating the policy based on the LLM classification. + LlmPolicy llm_policy = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Guardrail that blocks the conversation if the LLM response is + // considered unsafe based on the model safety settings. + ModelSafety model_safety = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Guardrail that potentially blocks the conversation based on the + // result of the callback execution. + CodeCallback code_callback = 14 [(google.api.field_behavior) = OPTIONAL]; + } + + // Identifier. The unique identifier of the guardrail. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Display name of the guardrail. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Description of the guardrail. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether the guardrail is enabled. + bool enabled = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Action to take when the guardrail is triggered. + TriggerAction action = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when the guardrail was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the guardrail was last updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Etag used to ensure the object hasn't changed during a read-modify-write + // operation. If the etag is empty, the update will overwrite any concurrent + // changes. + string etag = 11; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/mcp_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/mcp_tool.proto new file mode 100644 index 00000000000..fddc46e157e --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/mcp_tool.proto @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/ces/v1/auth.proto"; +import "google/cloud/ces/v1/common.proto"; +import "google/cloud/ces/v1/schema.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "McpToolProto"; +option java_package = "com.google.cloud.ces.v1"; + +// An MCP tool. +// See https://modelcontextprotocol.io/specification/2025-06-18/server/tools for +// more details. +message McpTool { + // Required. The name of the MCP tool. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the MCP tool. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The schema of the input arguments of the MCP tool. + Schema input_schema = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The schema of the output arguments of the MCP tool. + Schema output_schema = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The server address of the MCP server, e.g., + // "https://example.com/mcp/". If the server is built with the MCP SDK, the + // url should be suffixed with + // "/mcp/". Only Streamable HTTP transport based servers are supported. This + // is the same as the server_address in the McpToolset. See + // https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http + // for more details. + string server_address = 5 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Authentication information required to execute the tool against + // the MCP server. For bearer token authentication, the token applies only to + // tool execution, not to listing tools. This requires that tools can be + // listed without authentication. + ApiAuthentication api_authentication = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The TLS configuration. Includes the custom server certificates + // that the client should trust. + TlsConfig tls_config = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Service Directory configuration for VPC-SC, used to resolve + // service names within a perimeter. + ServiceDirectoryConfig service_directory_config = 8 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/mcp_toolset.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/mcp_toolset.proto new file mode 100644 index 00000000000..4f3e3ab8a52 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/mcp_toolset.proto @@ -0,0 +1,54 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/ces/v1/auth.proto"; +import "google/cloud/ces/v1/common.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "McpToolsetProto"; +option java_package = "com.google.cloud.ces.v1"; + +// A toolset that contains a list of tools that are offered by the MCP +// server. +message McpToolset { + // Required. The address of the MCP server, for example, + // "https://example.com/mcp/". If the server is built with the MCP SDK, the + // url should be suffixed with + // "/mcp/". Only Streamable HTTP transport based servers are supported. See + // https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http + // for more details. + string server_address = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Authentication information required to access tools and execute a + // tool against the MCP server. For bearer token authentication, the token + // applies only to tool execution, not to listing tools. This requires that + // tools can be listed without authentication. + ApiAuthentication api_authentication = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Service Directory configuration for VPC-SC, used to resolve + // service names within a perimeter. + ServiceDirectoryConfig service_directory_config = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The TLS configuration. Includes the custom server certificates + // that the client should trust. + TlsConfig tls_config = 4 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/omnichannel.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/omnichannel.proto new file mode 100644 index 00000000000..562638232c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/omnichannel.proto @@ -0,0 +1,135 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "OmnichannelProto"; +option java_package = "com.google.cloud.ces.v1"; + +// Represents an Omnichannel resource. +message Omnichannel { + option (google.api.resource) = { + type: "ces.googleapis.com/Omnichannel" + pattern: "projects/{project}/locations/{location}/omnichannels/{omnichannel}" + plural: "omnichannels" + singular: "omnichannel" + }; + + // Identifier. The unique identifier of the omnichannel resource. + // Format: + // `projects/{project}/locations/{location}/omnichannels/{omnichannel}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Display name of the omnichannel resource. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Human-readable description of the omnichannel resource. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when the omnichannel resource was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the omnichannel resource was last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Etag used to ensure the object hasn't changed during a + // read-modify-write operation. + string etag = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The integration config for the omnichannel resource. + OmnichannelIntegrationConfig integration_config = 7 + [(google.api.field_behavior) = OPTIONAL]; +} + +// OmnichannelIntegrationConfig contains all App integration configs. +message OmnichannelIntegrationConfig { + // ChannelConfig contains config for various of app integration. + message ChannelConfig { + // The config for the app. + oneof channel_config { + // WhatsApp config. + WhatsappConfig whatsapp_config = 1; + } + } + + // How Omnichannel should receive/reply events from WhatsApp. + message WhatsappConfig { + // The Phone Number ID associated with the WhatsApp Business Account. + string phone_number_id = 1; + + // The phone number used for sending/receiving messages. + string phone_number = 2; + + // The customer's WhatsApp Business Account (WABA) ID. + string whatsapp_business_account_id = 3; + + // The verify token configured in the Meta App Dashboard for webhook + // verification. + string webhook_verify_token = 4; + + // The access token for authenticating API calls to the WhatsApp Cloud API. + // https://developers.facebook.com/docs/whatsapp/business-management-api/get-started/#business-integration-system-user-access-tokens + string whatsapp_business_token = 5; + + // The Meta Business Portfolio (MBP) ID. + // https://www.facebook.com/business/help/1710077379203657 + string meta_business_portfolio_id = 6; + } + + // Configs of subscribers. + message SubscriberConfig { + // The config for the subscriber. + oneof subscriber_config { + // Ces app config. + CesAppConfig ces_app_config = 1; + } + } + + // Configs for CES app. + message CesAppConfig { + // The unique identifier of the CES app. + // Format: `projects/{project}/locations/{location}/apps/{app}` + string app = 1 + [(google.api.resource_reference) = { type: "ces.googleapis.com/App" }]; + } + + // Routing config specify how/who to route app events to a subscriber. + message RoutingConfig { + // The key of the subscriber. + string subscriber_key = 1; + } + + // Optional. Various of configuration for handling App events. + map channel_configs = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Various of subscribers configs. + map subscriber_configs = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The key of routing_configs is a key of `app_configs`, value is a + // `RoutingConfig`, which contains subscriber's key. + map routing_configs = 3 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/omnichannel_service.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/omnichannel_service.proto new file mode 100644 index 00000000000..eef8c314c25 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/omnichannel_service.proto @@ -0,0 +1,46 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "OmnichannelServiceProto"; +option java_package = "com.google.cloud.ces.v1"; + +// Represents the metadata of the long-running operation. +message OmnichannelOperationMetadata { + // 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. Human-readable status of the operation, if any. + string status_message = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation of the + // operation. + bool requested_cancellation = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/open_api_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/open_api_tool.proto new file mode 100644 index 00000000000..b5f1b232347 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/open_api_tool.proto @@ -0,0 +1,65 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/ces/v1/auth.proto"; +import "google/cloud/ces/v1/common.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "OpenApiToolProto"; +option java_package = "com.google.cloud.ces.v1"; + +// A remote API tool defined by an OpenAPI schema. +message OpenApiTool { + // Required. The OpenAPI schema in JSON or YAML format. + string open_api_schema = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The name of the tool. If not provided, the name of the tool will + // be derived from the OpenAPI schema, from `operation.operationId`. + string name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The description of the tool. If not provided, the description of + // the tool will be derived from the OpenAPI schema, from + // `operation.description` or `operation.summary`. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Authentication information required by the API. + ApiAuthentication api_authentication = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The TLS configuration. Includes the custom server certificates + // that the client will trust. + TlsConfig tls_config = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Service Directory configuration. + ServiceDirectoryConfig service_directory_config = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the agent will ignore unknown fields in the API + // response. + bool ignore_unknown_fields = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The server URL of the Open API schema. + // This field is only set in tools in the environment dependencies during the + // export process if the schema contains a server url. During the import + // process, if this url is present in the environment dependencies and the + // schema has the $env_var placeholder, it will replace the placeholder in the + // schema. + string url = 8 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/open_api_toolset.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/open_api_toolset.proto new file mode 100644 index 00000000000..ffb88c74ecd --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/open_api_toolset.proto @@ -0,0 +1,56 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/ces/v1/auth.proto"; +import "google/cloud/ces/v1/common.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "OpenApiToolsetProto"; +option java_package = "com.google.cloud.ces.v1"; + +// A toolset that contains a list of tools that are defined by an OpenAPI +// schema. +message OpenApiToolset { + // Required. The OpenAPI schema of the toolset. + string open_api_schema = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Authentication information required by the API. + ApiAuthentication api_authentication = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The TLS configuration. Includes the custom server certificates + TlsConfig tls_config = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Service Directory configuration. + ServiceDirectoryConfig service_directory_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the agent will ignore unknown fields in the API response + // for all operations defined in the OpenAPI schema. + bool ignore_unknown_fields = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The server URL of the Open API schema. + // This field is only set in toolsets in the environment dependencies during + // the export process if the schema contains a server url. During the import + // process, if this url is present in the environment dependencies and the + // schema has the $env_var placeholder, it will replace the placeholder in the + // schema. + string url = 6 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/python_function.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/python_function.proto new file mode 100644 index 00000000000..a0bf77d823a --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/python_function.proto @@ -0,0 +1,39 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "PythonFunctionProto"; +option java_package = "com.google.cloud.ces.v1"; + +// A Python function tool. +message PythonFunction { + // Optional. The name of the Python function to execute. Must match a Python + // function name defined in the python code. Case sensitive. If the name is + // not provided, the first function defined in the python code will be used. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Python code to execute for the tool. + string python_code = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The description of the Python function, parsed from the python + // code's docstring. + string description = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/schema.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/schema.proto new file mode 100644 index 00000000000..1beb9564308 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/schema.proto @@ -0,0 +1,140 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "SchemaProto"; +option java_package = "com.google.cloud.ces.v1"; + +// Represents a select subset of an OpenAPI 3.0 schema object. +message Schema { + // OpenAPI data types. + enum Type { + // Type unspecified. + TYPE_UNSPECIFIED = 0; + + // String type. + STRING = 1; + + // Integer type. + INTEGER = 2; + + // Number type. + NUMBER = 3; + + // Boolean type. + BOOLEAN = 4; + + // Object type. + OBJECT = 5; + + // Array type. + ARRAY = 6; + } + + // Required. The type of the data. + Type type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Properties of Type.OBJECT. + map properties = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Required properties of Type.OBJECT. + repeated string required = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The description of the data. + string description = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Schema of the elements of Type.ARRAY. + Schema items = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates if the value may be null. + bool nullable = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicate the items in the array must be unique. Only applies to + // TYPE.ARRAY. + bool unique_items = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Schemas of initial elements of Type.ARRAY. + repeated Schema prefix_items = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Can either be a boolean or an object, controls the presence of + // additional properties. + Schema additional_properties = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value should be validated against any (one or more) of the + // subschemas in the list. + repeated Schema any_of = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Possible values of the element of primitive type with enum + // format. Examples: + // 1. We can define direction as : + // {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} + // 2. We can define apartment number as : + // {type:INTEGER, format:enum, enum:["101", "201", "301"]} + repeated string enum = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Default value of the data. + google.protobuf.Value default = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Allows indirect references between schema nodes. The value should + // be a valid reference to a child of the root `defs`. + // + // For example, the following schema defines a reference to a schema node + // named "Pet": + // + // ``` + // type: object + // properties: + // pet: + // ref: #/defs/Pet + // defs: + // Pet: + // type: object + // properties: + // name: + // type: string + // ``` + // + // The value of the "pet" property is a reference to the schema node + // named "Pet". + // See details in + // https://json-schema.org/understanding-json-schema/structuring. + string ref = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A map of definitions for use by `ref`. Only allowed at the root + // of the schema. + map defs = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The title of the schema. + string title = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Minimum number of the elements for Type.ARRAY. + int64 min_items = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum number of the elements for Type.ARRAY. + int64 max_items = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Minimum value for Type.INTEGER and Type.NUMBER. + optional double minimum = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum value for Type.INTEGER and Type.NUMBER. + optional double maximum = 19 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/search_suggestions.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/search_suggestions.proto new file mode 100644 index 00000000000..06b0fde799d --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/search_suggestions.proto @@ -0,0 +1,45 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "SearchSuggestionsProto"; +option java_package = "com.google.cloud.ces.v1"; + +// Search suggestions from [Google Search +// Tool][google.cloud.ces.v1.GoogleSearchTool]. +message GoogleSearchSuggestions { + // Compliant HTML and CSS styling for search suggestions. + // The provided HTML and CSS automatically adapts to your device settings, + // displaying in either light or dark mode indicated by + // `@media(prefers-color-scheme)`. + repeated string htmls = 1; + + // List of queries used to perform the google search along with the search + // result URIs forming the search suggestions. + repeated WebSearchQuery web_search_queries = 2; +} + +// Represents a single web search query and its associated search uri. +message WebSearchQuery { + // The search query text. + string query = 1; + + // The URI to the Google Search results page for the query. + string uri = 2; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/session_service.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/session_service.proto new file mode 100644 index 00000000000..7804515b178 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/session_service.proto @@ -0,0 +1,456 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1/common.proto"; +import "google/cloud/ces/v1/example.proto"; +import "google/cloud/ces/v1/search_suggestions.proto"; +import "google/protobuf/struct.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "SessionServiceProto"; +option java_package = "com.google.cloud.ces.v1"; +option (google.api.resource_definition) = { + type: "ces.googleapis.com/Session" + pattern: "projects/{project}/locations/{location}/apps/{app}/sessions/{session}" +}; + +// Session service provides APIs for interacting with CES agents. +service SessionService { + option (google.api.default_host) = "ces.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/ces," + "https://www.googleapis.com/auth/cloud-platform"; + + // Initiates a single turn interaction with the CES agent within a + // session. + rpc RunSession(RunSessionRequest) returns (RunSessionResponse) { + option (google.api.http) = { + post: "/v1/{config.session=projects/*/locations/*/apps/*/sessions/*}:runSession" + body: "*" + }; + } + + // Establishes a bidirectional streaming connection with the CES agent. + // The agent processes continuous multimodal inputs (e.g., text, audio) and + // generates real-time multimodal output streams. + // + // --- Client Request Stream --- + // The client streams requests in the following order: + // + // 1. Initialization: + // The first message must contain + // [SessionConfig][google.cloud.ces.v1.BidiSessionClientMessage.config]. + // For audio sessions, this should also include + // [InputAudioConfig][google.cloud.ces.v1.SessionConfig.input_audio_config] + // and + // [OutputAudioConfig][google.cloud.ces.v1.SessionConfig.output_audio_config] + // to define audio processing and synthesis parameters. + // + // 2. Interaction: + // Subsequent messages stream + // [SessionInput][google.cloud.ces.v1.BidiSessionClientMessage.realtime_input] + // containing real-time user input data. + // + // 3. Termination: + // The client should half-close the stream when there is no more user + // input. It should also half-close upon receiving + // [EndSession][google.cloud.ces.v1.BidiSessionServerMessage.end_session] + // or [GoAway][google.cloud.ces.v1.BidiSessionServerMessage.go_away] from + // the agent. + // + // --- Server Response Stream --- + // For each interaction turn, the agent streams messages in the following + // sequence: + // + // 1. Speech Recognition (First N messages): + // Contains + // [RecognitionResult][google.cloud.ces.v1.BidiSessionServerMessage.recognition_result] + // representing the concatenated user speech segments captured so far. + // This is only populated for audio sessions. + // + // 2. Response (Next M messages): + // Contains + // [SessionOutput][google.cloud.ces.v1.BidiSessionServerMessage.session_output] + // delivering the agent's response in various modalities (e.g., text, + // audio). + // + // 3. Turn Completion (Final message of the turn): + // Contains + // [SessionOutput][google.cloud.ces.v1.BidiSessionServerMessage.session_output] + // with [turn_completed][google.cloud.ces.v1.SessionOutput.turn_completed] + // set to true. This signals the end of the current turn and includes + // [DiagnosticInfo][google.cloud.ces.v1.SessionOutput.diagnostic_info] + // with execution details. + // + // --- Audio Best Practices --- + // 1. Streaming: + // Stream [audio data][google.cloud.ces.v1.SessionInput.audio] + // **CONTINUOUSLY**, even during silence. Recommended chunk size: 40-120ms + // (balances latency vs. efficiency). + // + // 2. Playback & Interruption: + // Play [audio responses][google.cloud.ces.v1.SessionOutput.audio] upon + // receipt. Stop playback immediately if an + // [InterruptionSignal][google.cloud.ces.v1.BidiSessionServerMessage.interruption_signal] + // is received (e.g., user barge-in or new agent response). + rpc BidiRunSession(stream BidiSessionClientMessage) + returns (stream BidiSessionServerMessage) {} +} + +// AudioEncoding specifies the encoding format for audio data. +enum AudioEncoding { + // Unspecified audio encoding. + AUDIO_ENCODING_UNSPECIFIED = 0; + + // 16-bit linear PCM audio encoding. + LINEAR16 = 1; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + MULAW = 2; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law. + ALAW = 3; +} + +// InputAudioConfig configures how the CES agent should interpret the incoming +// audio data. +message InputAudioConfig { + // Required. The encoding of the input audio data. + AudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The sample rate (in Hertz) of the input audio data. + int32 sample_rate_hertz = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Whether to enable noise suppression on the input audio. + // Available values are "low", "moderate", "high", "very_high". + string noise_suppression_level = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// OutputAudioConfig configures how the CES agent should synthesize outgoing +// audio responses. +message OutputAudioConfig { + // Required. The encoding of the output audio data. + AudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The sample rate (in Hertz) of the output audio data. + int32 sample_rate_hertz = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The configuration for the session. +message SessionConfig { + // [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters) + // to send to the remote + // [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) + // agent when the session control is transferred to the remote agent. + message RemoteDialogflowQueryParameters { + // Optional. The HTTP headers to be sent as webhook_headers in + // [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters). + map webhook_headers = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The payload to be sent in + // [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters). + google.protobuf.Struct payload = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The end user metadata to be sent in + // [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters). + google.protobuf.Struct end_user_metadata = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The unique identifier of the session. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/sessions/{session}` + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Session" } + ]; + + // Optional. Configuration for processing the input audio. + InputAudioConfig input_audio_config = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for generating the output audio. + OutputAudioConfig output_audio_config = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The historical context of the session, including user inputs, + // agent responses, and other messages. Typically, CES agent would manage + // session automatically so client doesn't need to explicitly populate this + // field. However, client can optionally override the historical contexts to + // force the session start from certain state. + repeated Message historical_contexts = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The entry agent to handle the session. If not specified, the + // session will be handled by the [root + // agent][google.cloud.ces.v1.App.root_agent] of the app. Format: + // `projects/{project}/locations/{location}/agents/{agent}` + string entry_agent = 12 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + + // Optional. The deployment of the app to use for the session. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` + string deployment = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The time zone of the user. If provided, the agent will use the + // time zone for date and time related variables. Otherwise, the agent will + // use the time zone specified in the App.time_zone_settings. + // + // The format is the IANA Time Zone Database time zone, e.g. + // "America/Los_Angeles". + string time_zone = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. + // [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters) + // to send to the remote + // [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) + // agent when the session control is transferred to the remote agent. + RemoteDialogflowQueryParameters remote_dialogflow_query_parameters = 15 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the client to execute the tools and return the execution results +// before continuing the session. +message ToolCalls { + // Optional. The list of tool calls to execute. + repeated ToolCall tool_calls = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Execution results for the requested tool calls from the client. +message ToolResponses { + // Optional. The list of tool execution results. + repeated ToolResponse tool_responses = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Citations associated with the agent response. +message Citations { + // Piece of cited information. + message CitedChunk { + // URI used for citation. + string uri = 1; + + // Title of the cited document. + string title = 2; + + // Text used for citation. + string text = 3; + } + + // List of cited pieces of information. + repeated CitedChunk cited_chunks = 1; +} + +// Event input. +message Event { + // Required. The name of the event. + string event = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Input for the session. +message SessionInput { + // The type of the input. + oneof input_type { + // Optional. Text data from the end user. + string text = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. DTMF digits from the end user. + string dtmf = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Audio data from the end user. + bytes audio = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Execution results for the tool calls from the client. + ToolResponses tool_responses = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Image data from the end user. + Image image = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Blob data from the end user. + Blob blob = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Contextual variables for the session, keyed by name. Only + // variables declared in the app will be used by the CES agent. + // + // Unrecognized variables will still be sent to the [Dialogflow + // agent][Agent.RemoteDialogflowAgent] as additional session parameters. + google.protobuf.Struct variables = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Event input. + Event event = 9 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. A flag to indicate if the current message is a fragment of a + // larger input in the bidi streaming session. When `true`, the agent will + // defer processing until a subsequent message with `will_continue` set to + // `false` is received. + // + // Note: This flag has no effect on audio and DTMF inputs, which are always + // processed in real-time. + bool will_continue = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// Output for the session. +message SessionOutput { + // Contains execution details during the processing. + message DiagnosticInfo { + // List of the messages that happened during the processing. + repeated Message messages = 1; + + // A trace of the entire request processing, represented as a root span. + // This span can contain nested child spans for specific operations. + Span root_span = 3; + } + + // The type of the output. + oneof output_type { + // Output text from the CES agent. + string text = 1; + + // Output audio from the CES agent. + bytes audio = 2; + + // Request for the client to execute the tools. + ToolCalls tool_calls = 3; + + // Citations that provide the source information for the agent's generated + // text. + Citations citations = 8; + + // The suggestions returned from Google Search as a result of invoking the + // [GoogleSearchTool][google.cloud.ces.v1.GoogleSearchTool]. + GoogleSearchSuggestions google_search_suggestions = 10; + + // Indicates the session has ended. + EndSession end_session = 9; + + // Custom payload with structured output from the CES agent. + google.protobuf.Struct payload = 11; + } + + // Indicates the sequential order of conversation turn to which this output + // belongs to, starting from 1. + int32 turn_index = 6; + + // If true, the CES agent has detected the end of the current conversation + // turn and will provide no further output for this turn. + bool turn_completed = 4; + + // Optional. Diagnostic information contains execution details during the + // processing of the input. Only populated in the last SessionOutput (with + // `turn_completed=true`) for each turn. + DiagnosticInfo diagnostic_info = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Speech recognition result for the audio input. +message RecognitionResult { + // Optional. Concatenated user speech segments captured during the current + // turn. + string transcript = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Indicates the agent's audio response has been interrupted. The client should +// immediately stop any current audio playback (e.g., due to user barge-in or +// a new agent response being generated). +message InterruptionSignal { + // Whether the interruption is caused by a user barge-in event. + bool barge_in = 1; +} + +// Indicates the session has terminated, due to either successful completion +// (e.g. user says "Good bye!" ) or an agent escalation. +// +// The agent will not process any further inputs after session is terminated and +// the client should half-close and disconnect after receiving all remaining +// responses from the agent. +message EndSession { + // Optional. Provides additional information about the end session signal, + // such as the reason for ending the session. + google.protobuf.Struct metadata = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Indicates that the server will disconnect soon and the client should +// half-close and restart the connection. +message GoAway {} + +// Request message for +// [SessionService.RunSession][google.cloud.ces.v1.SessionService.RunSession]. +message RunSessionRequest { + // Required. The configuration for the session. + SessionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Inputs for the session. + repeated SessionInput inputs = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for +// [SessionService.RunSession][google.cloud.ces.v1.SessionService.RunSession]. +message RunSessionResponse { + // Outputs for the session. + repeated SessionOutput outputs = 1; +} + +// The top-level message sent by the client for the +// [SessionService.BidiRunSession][google.cloud.ces.v1.SessionService.BidiRunSession] +// method. +message BidiSessionClientMessage { + // The type of the message. + oneof message_type { + // Optional. The initial config message for the session. + SessionConfig config = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Realtime input for the session. + SessionInput realtime_input = 2 [(google.api.field_behavior) = OPTIONAL]; + } +} + +// The top-level message returned from +// [SessionService.BidiRunSession][google.cloud.ces.v1.SessionService.BidiRunSession] +// method. +message BidiSessionServerMessage { + // The type of the message. + oneof message_type { + // Optional. Processing result from the CES agent. + SessionOutput session_output = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Realtime speech recognition result for the audio input. + RecognitionResult recognition_result = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Interruption signal detected from the audio input. + InterruptionSignal interruption_signal = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates that the session has ended. + EndSession end_session = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates that the server will disconnect soon and the client + // should half-close and restart the connection. + GoAway go_away = 6 [(google.api.field_behavior) = OPTIONAL]; + } +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/system_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/system_tool.proto new file mode 100644 index 00000000000..a628f37785d --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/system_tool.proto @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.ces.v1; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "SystemToolProto"; +option java_package = "com.google.cloud.ces.v1"; + +// Pre-defined system tool. +message SystemTool { + // Required. The name of the system tool. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The description of the system tool. + string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/tool.proto new file mode 100644 index 00000000000..6b30a6d9263 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/tool.proto @@ -0,0 +1,124 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1/client_function.proto"; +import "google/cloud/ces/v1/common.proto"; +import "google/cloud/ces/v1/connector_tool.proto"; +import "google/cloud/ces/v1/data_store_tool.proto"; +import "google/cloud/ces/v1/fakes.proto"; +import "google/cloud/ces/v1/file_search_tool.proto"; +import "google/cloud/ces/v1/google_search_tool.proto"; +import "google/cloud/ces/v1/mcp_tool.proto"; +import "google/cloud/ces/v1/open_api_tool.proto"; +import "google/cloud/ces/v1/python_function.proto"; +import "google/cloud/ces/v1/system_tool.proto"; +import "google/cloud/ces/v1/widget_tool.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ToolProto"; +option java_package = "com.google.cloud.ces.v1"; + +// A tool represents an action that the CES agent can take to achieve certain +// goals. +message Tool { + option (google.api.resource) = { + type: "ces.googleapis.com/Tool" + pattern: "projects/{project}/locations/{location}/apps/{app}/tools/{tool}" + plural: "tools" + singular: "tool" + }; + + // The type of the tool. + oneof tool_type { + // Optional. The client function. + ClientFunction client_function = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The open API tool. + OpenApiTool open_api_tool = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The google search tool. + GoogleSearchTool google_search_tool = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Integration Connector tool. + ConnectorTool connector_tool = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The data store tool. + DataStoreTool data_store_tool = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The python function tool. + PythonFunction python_function = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The MCP tool. An MCP tool cannot be created or updated directly + // and is managed by the MCP toolset. + McpTool mcp_tool = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The file search tool. + FileSearchTool file_search_tool = 17 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The system tool. + SystemTool system_tool = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The widget tool. + WidgetTool widget_tool = 24 [(google.api.field_behavior) = OPTIONAL]; + } + + // Identifier. The unique identifier of the tool. + // Format: + // - `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` for + // ## standalone tools. + // + // `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}/tools/{tool}` + // for tools retrieved from a toolset. These tools are dynamic and + // output-only, they cannot be referenced directly where a tool is expected. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The display name of the tool, derived based on the tool's + // type. For example, display name of a [ClientFunction][Tool.ClientFunction] + // is derived from its `name` property. + string display_name = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The execution type of the tool. + ExecutionType execution_type = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when the tool was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the tool was last updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Etag used to ensure the object hasn't changed during a read-modify-write + // operation. If the etag is empty, the update will overwrite any concurrent + // changes. + string etag = 14; + + // Output only. If the tool is generated by the LLM assistant, this field + // contains a descriptive summary of the generation. + string generated_summary = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Configuration for tool behavior in fake mode. + ToolFakeConfig tool_fake_config = 20 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/tool_service.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/tool_service.proto new file mode 100644 index 00000000000..650c8f50cb4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/tool_service.proto @@ -0,0 +1,189 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1/schema.proto"; +import "google/cloud/ces/v1/tool.proto"; +import "google/cloud/ces/v1/toolset_tool.proto"; +import "google/protobuf/struct.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ToolServiceProto"; +option java_package = "com.google.cloud.ces.v1"; + +// Tool service provides APIs for interacting with CES tools. +service ToolService { + option (google.api.default_host) = "ces.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/ces," + "https://www.googleapis.com/auth/cloud-platform"; + + // Executes the given tool with the given arguments. + rpc ExecuteTool(ExecuteToolRequest) returns (ExecuteToolResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apps/*}:executeTool" + body: "*" + }; + } + + // Retrieve the schema of the given tool. The schema is computed on the fly + // for the given instance of the tool. + rpc RetrieveToolSchema(RetrieveToolSchemaRequest) + returns (RetrieveToolSchemaResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apps/*}:retrieveToolSchema" + body: "*" + }; + } + + // Retrieve the list of tools included in the specified toolset. + rpc RetrieveTools(RetrieveToolsRequest) returns (RetrieveToolsResponse) { + option (google.api.http) = { + post: "/v1/{toolset=projects/*/locations/*/apps/*/toolsets/*}:retrieveTools" + body: "*" + }; + } +} + +// Request message for +// [ToolService.ExecuteTool][google.cloud.ces.v1.ToolService.ExecuteTool]. +message ExecuteToolRequest { + // The identifier of the tool to execute. It could be either a persisted tool + // or a tool from a toolset. + oneof tool_identifier { + // Optional. The name of the tool to execute. + // Format: + // projects/{project}/locations/{location}/apps/{app}/tools/{tool} + string tool = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } + ]; + + // Optional. The toolset tool to execute. Only one tool should match the + // predicate from the toolset. Otherwise, an error will be returned. + ToolsetTool toolset_tool = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The resource name of the app which the tool/toolset belongs to. + // Format: `projects/{project}/locations/{location}/apps/{app}` + string parent = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; + + // Optional. The input parameters and values for the tool in JSON object + // format. + google.protobuf.Struct args = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [ToolService.ExecuteTool][google.cloud.ces.v1.ToolService.ExecuteTool]. +message ExecuteToolResponse { + // The identifier of the tool that got executed. + oneof tool_identifier { + // The name of the tool that got executed. + // Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` + string tool = 1 + [(google.api.resource_reference) = { type: "ces.googleapis.com/Tool" }]; + + // The toolset tool that got executed. + ToolsetTool toolset_tool = 3; + } + + // Required. The tool execution result in JSON object format. + // Use "output" key to specify tool response and "error" key to specify + // error details (if any). If "output" and "error" keys are not specified, + // then whole "response" is treated as tool execution result. + google.protobuf.Struct response = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [ToolService.RetrieveToolSchema][google.cloud.ces.v1.ToolService.RetrieveToolSchema]. +message RetrieveToolSchemaRequest { + // The identifier of the tool to retrieve the schema for. It could be either a + // persisted tool or a tool from a toolset. + oneof tool_identifier { + // Optional. The name of the tool to retrieve the schema for. + // Format: + // projects/{project}/locations/{location}/apps/{app}/tools/{tool} + string tool = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } + ]; + + // Optional. The toolset tool to retrieve the schema for. Only one tool + // should match the predicate from the toolset. Otherwise, an error will be + // returned. + ToolsetTool toolset_tool = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The resource name of the app which the tool/toolset belongs to. + // Format: `projects/{project}/locations/{location}/apps/{app}` + string parent = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; +} + +// Response message for +// [ToolService.RetrieveToolSchema][google.cloud.ces.v1.ToolService.RetrieveToolSchema]. +message RetrieveToolSchemaResponse { + // The identifier of the tool that the schema is for. + oneof tool_identifier { + // The name of the tool that the schema is for. + // Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` + string tool = 1 + [(google.api.resource_reference) = { type: "ces.googleapis.com/Tool" }]; + + // The toolset tool that the schema is for. + ToolsetTool toolset_tool = 2; + } + + // Required. The schema of the tool input parameters. + Schema input_schema = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The schema of the tool output parameters. + Schema output_schema = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [ToolService.RetrieveTools][google.cloud.ces.v1.ToolService.RetrieveTools]. +message RetrieveToolsRequest { + // Required. The name of the toolset to retrieve the tools for. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + string toolset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Toolset" } + ]; + + // Optional. The identifiers of the tools to retrieve from the toolset. + // If empty, all tools in the toolset will be returned. + repeated string tool_ids = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [ToolService.RetrieveTools][google.cloud.ces.v1.ToolService.RetrieveTools]. +message RetrieveToolsResponse { + // Required. The list of tools that are included in the specified toolset. + repeated Tool tools = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/toolset.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/toolset.proto new file mode 100644 index 00000000000..81ee47207cd --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/toolset.proto @@ -0,0 +1,90 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1/common.proto"; +import "google/cloud/ces/v1/connector_toolset.proto"; +import "google/cloud/ces/v1/fakes.proto"; +import "google/cloud/ces/v1/mcp_toolset.proto"; +import "google/cloud/ces/v1/open_api_toolset.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ToolsetProto"; +option java_package = "com.google.cloud.ces.v1"; + +// A toolset represents a group of dynamically managed tools that can be used +// by the agent. +message Toolset { + option (google.api.resource) = { + type: "ces.googleapis.com/Toolset" + pattern: "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}" + plural: "toolsets" + singular: "toolset" + }; + + // The type of the toolset. + oneof toolset_type { + // Optional. A toolset that contains a list of tools that are offered by the + // MCP server. + McpToolset mcp_toolset = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A toolset that contains a list of tools that are defined by an + // OpenAPI schema. + OpenApiToolset open_api_toolset = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A toolset that generates tools from an Integration Connectors + // Connection. + ConnectorToolset connector_toolset = 8 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Identifier. The unique identifier of the toolset. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. The display name of the toolset. Must be unique within the same + // app. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The description of the toolset. + string description = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when the toolset was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the toolset was last updated. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // ETag used to ensure the object hasn't changed during a read-modify-write + // operation. If the etag is empty, the update will overwrite any concurrent + // changes. + string etag = 5; + + // Optional. The execution type of the tools in the toolset. + ExecutionType execution_type = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for tools behavior in fake mode. + ToolFakeConfig tool_fake_config = 11 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/toolset_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/toolset_tool.proto new file mode 100644 index 00000000000..a2147435c9c --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/toolset_tool.proto @@ -0,0 +1,39 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ToolsetToolProto"; +option java_package = "com.google.cloud.ces.v1"; + +// A tool that is created from a toolset. +message ToolsetTool { + // Required. The resource name of the Toolset from which this tool is derived. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + string toolset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Toolset" } + ]; + + // Optional. The tool ID to filter the tools to retrieve the schema for. + string tool_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/widget_service.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/widget_service.proto new file mode 100644 index 00000000000..2aba8953115 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/widget_service.proto @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "WidgetServiceProto"; +option java_package = "com.google.cloud.ces.v1"; + +// Provides APIs for widgets to interact with CES APIs. +service WidgetService { + option (google.api.default_host) = "ces.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/ces," + "https://www.googleapis.com/auth/cloud-platform"; + + // Generates a session scoped token for chat widget to authenticate with + // Session APIs. + rpc GenerateChatToken(GenerateChatTokenRequest) + returns (GenerateChatTokenResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/apps/*/sessions/*}:generateChatToken" + body: "*" + }; + } +} + +// Request message for +// [WidgetService.GenerateChatToken][google.cloud.ces.v1.WidgetService.GenerateChatToken]. +message GenerateChatTokenRequest { + // Required. The session name to generate the chat token for. + // Format: + // projects/{project}/locations/{location}/apps/{app}/sessions/{session} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Session" } + ]; + + // Required. The deployment of the app to use for the session. + // Format: + // projects/{project}/locations/{location}/apps/{app}/deployments/{deployment} + string deployment = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Deployment" } + ]; + + // Optional. The reCAPTCHA token generated by the client-side chat widget. + string recaptcha_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [WidgetService.GenerateChatToken][google.cloud.ces.v1.WidgetService.GenerateChatToken]. +message GenerateChatTokenResponse { + // The session scoped token for chat widget to authenticate with Session APIs. + string chat_token = 1; + + // The time at which the chat token expires. + google.protobuf.Timestamp expire_time = 2; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/widget_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/widget_tool.proto new file mode 100644 index 00000000000..dff7057ab73 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/widget_tool.proto @@ -0,0 +1,84 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.ces.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/ces/v1/schema.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "WidgetToolProto"; +option java_package = "com.google.cloud.ces.v1"; + +// Represents a widget tool that the agent can invoke. When the tool is chosen +// by the agent, agent will return the widget to the client. The client is +// responsible for processing the widget and generating the next user query to +// continue the interaction with the agent. +message WidgetTool { + // All available widget types. + // New values may be added to this enum in the future. + enum WidgetType { + // Unspecified widget type. + WIDGET_TYPE_UNSPECIFIED = 0; + + // Custom widget type. + CUSTOM = 1; + + // Product carousel widget. + PRODUCT_CAROUSEL = 2; + + // Product details widget. + PRODUCT_DETAILS = 3; + + // Quick actions widget. + QUICK_ACTIONS = 4; + + // Product comparison widget. + PRODUCT_COMPARISON = 5; + + // Advanced product details widget. + ADVANCED_PRODUCT_DETAILS = 6; + + // Short form widget. + SHORT_FORM = 7; + + // Overall satisfaction widget. + OVERALL_SATISFACTION = 8; + + // Order summary widget. + ORDER_SUMMARY = 9; + + // Appointment details widget. + APPOINTMENT_DETAILS = 10; + } + + // The input of the widget tool. + oneof input { + // Optional. The input parameters of the widget tool. + Schema parameters = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The display name of the widget tool. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the widget tool. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The type of the widget tool. If not specified, the default type + // will be CUSTOMIZED. + WidgetType widget_type = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/agent.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/agent.proto new file mode 100644 index 00000000000..a404b2c1133 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/agent.proto @@ -0,0 +1,236 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1beta/agent_transfers.proto"; +import "google/cloud/ces/v1beta/common.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "AgentProto"; +option java_package = "com.google.cloud.ces.v1beta"; +option (google.api.resource_definition) = { + type: "dialogflow.googleapis.com/DialogflowAgent" + pattern: "projects/{project}/locations/{location}/agents/{agent}" +}; + +// An agent acts as the fundamental building block that provides instructions to +// the Large Language Model (LLM) for executing specific tasks. +message Agent { + option (google.api.resource) = { + type: "ces.googleapis.com/Agent" + pattern: "projects/{project}/locations/{location}/apps/{app}/agents/{agent}" + plural: "agents" + singular: "agent" + }; + + // Default agent type. The agent uses instructions and callbacks specified in + // the agent to perform the task using a large language model. + message LlmAgent {} + + // The agent which will transfer execution to a remote + // [Dialogflow + // CX](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) agent. + // The Dialogflow agent will process subsequent user queries until the session + // ends or flow ends, and the control is transferred back to the parent CES + // agent. + message RemoteDialogflowAgent { + // Required. The + // [Dialogflow](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) + // agent resource name. + // Format: `projects/{project}/locations/{location}/agents/{agent}` + string agent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/DialogflowAgent" + } + ]; + + // Optional. The flow ID of the flow in the Dialogflow agent. + string flow_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The environment ID of the Dialogflow agent to be used for the + // agent execution. If not specified, the draft environment will be used. + string environment_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The mapping of the app variables names to the Dialogflow + // session parameters names to be sent to the Dialogflow agent as input. + map input_variable_mapping = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The mapping of the Dialogflow session parameters names to the + // app variables names to be sent back to the CES agent after the Dialogflow + // agent execution ends. + map output_variable_mapping = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether to respect the message-level interruption + // settings configured in the Dialogflow agent. + // + // * If false: all response messages from the Dialogflow agent follow the + // app-level barge-in settings. + // * If true: only response messages with + // [`allow_playback_interruption`](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#text) + // set to true will be interruptable, all other messages follow the + // app-level barge-in settings. + bool respect_response_interruption_settings = 6 + [(google.api.field_behavior) = OPTIONAL]; + } + + // A toolset with a selection of its tools. + message AgentToolset { + // Required. The resource name of the toolset. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + string toolset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Toolset" } + ]; + + // Optional. The tools IDs to filter the toolset. + repeated string tool_ids = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // The type of agent. + oneof agent_type { + // Optional. The default agent type. + LlmAgent llm_agent = 26 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The remote + // [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) + // agent to be used for the agent execution. If this field is set, all other + // agent level properties will be ignored. + // + // Note: If the Dialogflow agent is in a different project from the app, you + // should grant `roles/dialogflow.client` to the CES service agent + // `service-@gcp-sa-ces.iam.gserviceaccount.com`. + RemoteDialogflowAgent remote_dialogflow_agent = 27 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Identifier. The unique identifier of the agent. + // Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Display name of the agent. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Human-readable description of the agent. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configurations for the LLM model. + ModelSettings model_settings = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Instructions for the LLM model to guide the agent's behavior. + string instruction = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of available tools for the agent. + // Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` + repeated string tools = 7 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } + ]; + + // Optional. List of child agents in the agent tree. + // Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` + repeated string child_agents = 8 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + + // Optional. The callbacks to execute before the agent is called. + // The provided callbacks are executed sequentially in the exact order they + // are given in the list. If a callback returns an overridden response, + // execution stops and any remaining callbacks are skipped. + repeated Callback before_agent_callbacks = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The callbacks to execute after the agent is called. + // The provided callbacks are executed sequentially in the exact order they + // are given in the list. If a callback returns an overridden response, + // execution stops and any remaining callbacks are skipped. + repeated Callback after_agent_callbacks = 19 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The callbacks to execute before the model is called. If there are + // multiple calls to the model, the callback will be executed multiple times. + // The provided callbacks are executed sequentially in the exact order they + // are given in the list. If a callback returns an overridden response, + // execution stops and any remaining callbacks are skipped. + repeated Callback before_model_callbacks = 20 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The callbacks to execute after the model is called. If there are + // multiple calls to the model, the callback will be executed multiple times. + // The provided callbacks are executed sequentially in the exact order they + // are given in the list. If a callback returns an overridden response, + // execution stops and any remaining callbacks are skipped. + repeated Callback after_model_callbacks = 21 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The callbacks to execute before the tool is invoked. If there are + // multiple tool invocations, the callback will be executed multiple times. + // The provided callbacks are executed sequentially in the exact order they + // are given in the list. If a callback returns an overridden response, + // execution stops and any remaining callbacks are skipped. + repeated Callback before_tool_callbacks = 22 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The callbacks to execute after the tool is invoked. If there are + // multiple tool invocations, the callback will be executed multiple times. + // The provided callbacks are executed sequentially in the exact order they + // are given in the list. If a callback returns an overridden response, + // execution stops and any remaining callbacks are skipped. + repeated Callback after_tool_callbacks = 23 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when the agent was created. + google.protobuf.Timestamp create_time = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the agent was last updated. + google.protobuf.Timestamp update_time = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. List of guardrails for the agent. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}` + repeated string guardrails = 17 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Guardrail" } + ]; + + // Etag used to ensure the object hasn't changed during a read-modify-write + // operation. If the etag is empty, the update will overwrite any concurrent + // changes. + string etag = 24; + + // Optional. List of toolsets for the agent. + repeated AgentToolset toolsets = 28 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. If the agent is generated by the LLM assistant, this field + // contains a descriptive summary of the generation. + string generated_summary = 29 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Agent transfer rules. + // If multiple rules match, the first one in the list will be used. + repeated TransferRule transfer_rules = 30 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_service.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_service.proto new file mode 100644 index 00000000000..5a5a2189cf2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_service.proto @@ -0,0 +1,1756 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.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/ces/v1beta/agent.proto"; +import "google/cloud/ces/v1beta/app.proto"; +import "google/cloud/ces/v1beta/app_version.proto"; +import "google/cloud/ces/v1beta/changelog.proto"; +import "google/cloud/ces/v1beta/conversation.proto"; +import "google/cloud/ces/v1beta/deployment.proto"; +import "google/cloud/ces/v1beta/evaluation.proto"; +import "google/cloud/ces/v1beta/example.proto"; +import "google/cloud/ces/v1beta/guardrail.proto"; +import "google/cloud/ces/v1beta/tool.proto"; +import "google/cloud/ces/v1beta/toolset.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "AgentServiceProto"; +option java_package = "com.google.cloud.ces.v1beta"; +option (google.api.resource_definition) = { + type: "contactcenterinsights.googleapis.com/Dataset" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}" +}; + +// The service that manages agent-related resources in Gemini Enterprise for +// Customer Engagement (CES). +service AgentService { + option (google.api.default_host) = "ces.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/ces," + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists apps in the given project and location. + rpc ListApps(ListAppsRequest) returns (ListAppsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*}/apps" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified app. + rpc GetApp(GetAppRequest) returns (App) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/apps/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new app in the given project and location. + rpc CreateApp(CreateAppRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*}/apps" + body: "app" + }; + option (google.api.method_signature) = "parent,app,app_id"; + option (google.api.method_signature) = "parent,app"; + option (google.longrunning.operation_info) = { + response_type: "App" + metadata_type: "OperationMetadata" + }; + } + + // Updates the specified app. + rpc UpdateApp(UpdateAppRequest) returns (App) { + option (google.api.http) = { + patch: "/v1beta/{app.name=projects/*/locations/*/apps/*}" + body: "app" + }; + option (google.api.method_signature) = "app,update_mask"; + } + + // Deletes the specified app. + rpc DeleteApp(DeleteAppRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/apps/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Exports the specified app. + rpc ExportApp(ExportAppRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/apps/*}:exportApp" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "ExportAppResponse" + metadata_type: "OperationMetadata" + }; + } + + // Imports the specified app. + rpc ImportApp(ImportAppRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*}/apps:importApp" + body: "*" + }; + option (google.api.method_signature) = "parent,display_name,app_id"; + option (google.longrunning.operation_info) = { + response_type: "ImportAppResponse" + metadata_type: "OperationMetadata" + }; + } + + // Lists agents in the given app. + rpc ListAgents(ListAgentsRequest) returns (ListAgentsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/apps/*}/agents" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified agent. + rpc GetAgent(GetAgentRequest) returns (Agent) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/apps/*/agents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new agent in the given app. + rpc CreateAgent(CreateAgentRequest) returns (Agent) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/apps/*}/agents" + body: "agent" + }; + option (google.api.method_signature) = "parent,agent,agent_id"; + option (google.api.method_signature) = "parent,agent"; + } + + // Updates the specified agent. + rpc UpdateAgent(UpdateAgentRequest) returns (Agent) { + option (google.api.http) = { + patch: "/v1beta/{agent.name=projects/*/locations/*/apps/*/agents/*}" + body: "agent" + }; + option (google.api.method_signature) = "agent,update_mask"; + } + + // Deletes the specified agent. + rpc DeleteAgent(DeleteAgentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/apps/*/agents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists examples in the given app. + rpc ListExamples(ListExamplesRequest) returns (ListExamplesResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/apps/*}/examples" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified example. + rpc GetExample(GetExampleRequest) returns (Example) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/apps/*/examples/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new example in the given app. + rpc CreateExample(CreateExampleRequest) returns (Example) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/apps/*}/examples" + body: "example" + }; + option (google.api.method_signature) = "parent,example,example_id"; + option (google.api.method_signature) = "parent,example"; + } + + // Updates the specified example. + rpc UpdateExample(UpdateExampleRequest) returns (Example) { + option (google.api.http) = { + patch: "/v1beta/{example.name=projects/*/locations/*/apps/*/examples/*}" + body: "example" + }; + option (google.api.method_signature) = "example,update_mask"; + } + + // Deletes the specified example. + rpc DeleteExample(DeleteExampleRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/apps/*/examples/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists tools in the given app. + rpc ListTools(ListToolsRequest) returns (ListToolsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/apps/*}/tools" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified tool. + rpc GetTool(GetToolRequest) returns (Tool) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/apps/*/tools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists conversations in the given app. + rpc ListConversations(ListConversationsRequest) + returns (ListConversationsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/apps/*}/conversations" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified conversation. + rpc GetConversation(GetConversationRequest) returns (Conversation) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/apps/*/conversations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes the specified conversation. + rpc DeleteConversation(DeleteConversationRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/apps/*/conversations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Batch deletes the specified conversations. + rpc BatchDeleteConversations(BatchDeleteConversationsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/apps/*}/conversations:batchDelete" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "BatchDeleteConversationsResponse" + metadata_type: "OperationMetadata" + }; + } + + // Creates a new tool in the given app. + rpc CreateTool(CreateToolRequest) returns (Tool) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/apps/*}/tools" + body: "tool" + }; + option (google.api.method_signature) = "parent,tool,tool_id"; + option (google.api.method_signature) = "parent,tool"; + } + + // Updates the specified tool. + rpc UpdateTool(UpdateToolRequest) returns (Tool) { + option (google.api.http) = { + patch: "/v1beta/{tool.name=projects/*/locations/*/apps/*/tools/*}" + body: "tool" + }; + option (google.api.method_signature) = "tool,update_mask"; + } + + // Deletes the specified tool. + rpc DeleteTool(DeleteToolRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/apps/*/tools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists guardrails in the given app. + rpc ListGuardrails(ListGuardrailsRequest) returns (ListGuardrailsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/apps/*}/guardrails" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified guardrail. + rpc GetGuardrail(GetGuardrailRequest) returns (Guardrail) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/apps/*/guardrails/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new guardrail in the given app. + rpc CreateGuardrail(CreateGuardrailRequest) returns (Guardrail) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/apps/*}/guardrails" + body: "guardrail" + }; + option (google.api.method_signature) = "parent,guardrail,guardrail_id"; + option (google.api.method_signature) = "parent,guardrail"; + } + + // Updates the specified guardrail. + rpc UpdateGuardrail(UpdateGuardrailRequest) returns (Guardrail) { + option (google.api.http) = { + patch: "/v1beta/{guardrail.name=projects/*/locations/*/apps/*/guardrails/*}" + body: "guardrail" + }; + option (google.api.method_signature) = "guardrail,update_mask"; + } + + // Deletes the specified guardrail. + rpc DeleteGuardrail(DeleteGuardrailRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/apps/*/guardrails/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists deployments in the given app. + rpc ListDeployments(ListDeploymentsRequest) + returns (ListDeploymentsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/apps/*}/deployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified deployment. + rpc GetDeployment(GetDeploymentRequest) returns (Deployment) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/apps/*/deployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new deployment in the given app. + rpc CreateDeployment(CreateDeploymentRequest) returns (Deployment) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/apps/*}/deployments" + body: "deployment" + }; + option (google.api.method_signature) = "parent,deployment,deployment_id"; + option (google.api.method_signature) = "parent,deployment"; + } + + // Updates the specified deployment. + rpc UpdateDeployment(UpdateDeploymentRequest) returns (Deployment) { + option (google.api.http) = { + patch: "/v1beta/{deployment.name=projects/*/locations/*/apps/*/deployments/*}" + body: "deployment" + }; + option (google.api.method_signature) = "deployment,update_mask"; + } + + // Deletes the specified deployment. + rpc DeleteDeployment(DeleteDeploymentRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/apps/*/deployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists toolsets in the given app. + rpc ListToolsets(ListToolsetsRequest) returns (ListToolsetsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/apps/*}/toolsets" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified toolset. + rpc GetToolset(GetToolsetRequest) returns (Toolset) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/apps/*/toolsets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new toolset in the given app. + rpc CreateToolset(CreateToolsetRequest) returns (Toolset) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/apps/*}/toolsets" + body: "toolset" + }; + option (google.api.method_signature) = "parent,toolset,toolset_id"; + option (google.api.method_signature) = "parent,toolset"; + } + + // Updates the specified toolset. + rpc UpdateToolset(UpdateToolsetRequest) returns (Toolset) { + option (google.api.http) = { + patch: "/v1beta/{toolset.name=projects/*/locations/*/apps/*/toolsets/*}" + body: "toolset" + }; + option (google.api.method_signature) = "toolset,update_mask"; + } + + // Deletes the specified toolset. + rpc DeleteToolset(DeleteToolsetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/apps/*/toolsets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all app versions in the given app. + rpc ListAppVersions(ListAppVersionsRequest) + returns (ListAppVersionsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/apps/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified app version. + rpc GetAppVersion(GetAppVersionRequest) returns (AppVersion) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new app version in the given app. + rpc CreateAppVersion(CreateAppVersionRequest) returns (AppVersion) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/apps/*}/versions" + body: "app_version" + }; + option (google.api.method_signature) = "parent,app_version,app_version_id"; + option (google.api.method_signature) = "parent,app_version"; + } + + // Deletes the specified app version. + rpc DeleteAppVersion(DeleteAppVersionRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Restores the specified app version. + // This will create a new app version from the current draft app and overwrite + // the current draft with the specified app version. + rpc RestoreAppVersion(RestoreAppVersionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}:restore" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "RestoreAppVersionResponse" + metadata_type: "OperationMetadata" + }; + } + + // Lists the changelogs of the specified app. + rpc ListChangelogs(ListChangelogsRequest) returns (ListChangelogsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/apps/*}/changelogs" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the specified changelog. + rpc GetChangelog(GetChangelogRequest) returns (Changelog) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/apps/*/changelogs/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for +// [AgentService.ListApps][google.cloud.ces.v1beta.AgentService.ListApps]. +message ListAppsRequest { + // Required. The resource name of the location to list apps from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "ces.googleapis.com/App" } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1beta.ListAppsResponse.next_page_token] + // value returned from a previous list + // [AgentService.ListApps][google.cloud.ces.v1beta.AgentService.ListApps] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the apps. + // See https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time" is supported. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListApps][google.cloud.ces.v1beta.AgentService.ListApps]. +message ListAppsResponse { + // The list of apps. + repeated App apps = 1; + + // A token that can be sent as + // [ListAppsRequest.page_token][google.cloud.ces.v1beta.ListAppsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; + + // Unordered list. Locations that could not be reached. + repeated string unreachable = 3 + [(google.api.field_behavior) = UNORDERED_LIST]; +} + +// Request message for +// [AgentService.GetApp][google.cloud.ces.v1beta.AgentService.GetApp]. +message GetAppRequest { + // Required. The resource name of the app to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; +} + +// Request message for +// [AgentService.CreateApp][google.cloud.ces.v1beta.AgentService.CreateApp]. +message CreateAppRequest { + // Required. The resource name of the location to create an app in. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "ces.googleapis.com/App" } + ]; + + // Optional. The ID to use for the app, which will become the final component + // of the app's resource name. If not provided, a unique ID will be + // automatically assigned for the app. + string app_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The app to create. + App app = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [AgentService.UpdateApp][google.cloud.ces.v1beta.AgentService.UpdateApp]. +message UpdateAppRequest { + // Required. The app to update. + App app = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask is used to control which fields get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.DeleteApp][google.cloud.ces.v1beta.AgentService.DeleteApp]. +message DeleteAppRequest { + // Required. The resource name of the app to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; + + // Optional. The current etag of the app. If an etag is not provided, the + // deletion will overwrite any concurrent changes. If an etag is provided and + // does not match the current etag of the app, deletion will be blocked and an + // ABORTED error will be returned. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.ExportApp][google.cloud.ces.v1beta.AgentService.ExportApp]. +message ExportAppRequest { + // Export format for the app. + enum ExportFormat { + // The export format is unspecified. + EXPORT_FORMAT_UNSPECIFIED = 0; + + // The export format is JSON. + JSON = 1; + + // The export format is YAML. + YAML = 2; + } + + // Required. The resource name of the app to export. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; + + // Required. The format to export the app in. + ExportFormat export_format = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The [Google Cloud + // Storage](https://cloud.google.com/storage/docs/) URI to which to export the + // app. The format of this URI must be `gs:///`. The + // exported app archive will be written directly to the specified GCS object. + string gcs_uri = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ExportApp][google.cloud.ces.v1beta.AgentService.ExportApp]. +message ExportAppResponse { + // The exported app. + oneof app { + // App folder compressed as a zip file. + bytes app_content = 1; + + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // to which the app was exported. + string app_uri = 2; + } +} + +// Request message for +// [AgentService.ImportApp][google.cloud.ces.v1beta.AgentService.ImportApp]. +message ImportAppRequest { + // Configuration options for the app import process. + // These options control how the import behaves, particularly when + // conflicts arise with existing app data. + message ImportOptions { + // Defines the strategy for handling conflicts when an app with the same ID + // already exists, or when imported resources (like Agents, Tools, etc.) + // have the same display names as existing resources within that app. + enum ConflictResolutionStrategy { + // The conflict resolution strategy is unspecified. + CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED = 0; + + // Replace existing data with imported data. + // If an app with the same `app_id` already exists, its content will be + // updated based on the imported app. + // - Resources (App, Agents, Tools, Examples, Guardrails, Toolsets) in the + // imported app that have the same display name as existing resources + // will overwrite the existing ones. + // - Imported resources with new display names will be created. + // - Existing resources that do not have a matching display name in the + // imported app will remain untouched. + REPLACE = 1; + + // Overwrite existing data with imported data. + // If an app with the same `app_id` already exists, its content will be + // overwritten with the imported app. + // - Existing resources (Agents, Tools, Examples, Guardrails, Toolsets) in + // the app will be deleted. + // - Imported resources will be created as new resources. + OVERWRITE = 2; + } + + // Optional. The strategy to use when resolving conflicts during import. + ConflictResolutionStrategy conflict_resolution_strategy = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The app to import. + oneof app { + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // from which to import app. The format of this URI must be + // `gs:///`. + string gcs_uri = 4; + + // Raw bytes representing the compressed zip file with the app folder + // structure. + bytes app_content = 5; + } + + // Required. The parent resource name with the location of the app to import. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "ces.googleapis.com/App" } + ]; + + // Optional. The display name of the app to import. + // * If the app is created on import, and the display name is specified, + // the imported app will use this display name. If a conflict is detected + // with an existing app, a timestamp will be appended to the display name + // to make it unique. + // * If the app is a reimport, this field should not be set. Providing a + // display name during reimport will result in an INVALID_ARGUMENT error. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The ID to use for the imported app. + // * If not specified, a unique ID will be automatically assigned for + // the app. + // * Otherwise, the imported app will use this ID as the final component of + // its resource name. If an app with the same ID already exists at the + // specified location in the project, the content of the existing app will be + // replaced. + string app_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Options governing the import process for the app. + ImportOptions import_options = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Flag for overriding the app lock during import. + // If set to true, the import process will ignore the app lock. + bool ignore_app_lock = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ImportApp][google.cloud.ces.v1beta.AgentService.ImportApp]. +message ImportAppResponse { + // The resource name of the app that was imported. + string name = 1 + [(google.api.resource_reference) = { type: "ces.googleapis.com/App" }]; + + // Warning messages generated during the import process. + // If errors occur for specific resources, they will not be included in the + // imported app and the error will be mentioned here. + repeated string warnings = 2; +} + +// Request message for +// [AgentService.ListAgents][google.cloud.ces.v1beta.AgentService.ListAgents]. +message ListAgentsRequest { + // Required. The resource name of the app to list agents from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "ces.googleapis.com/Agent" } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1beta.ListAgentsResponse.next_page_token] + // value returned from a previous list + // [AgentService.ListAgents][google.cloud.ces.v1beta.AgentService.ListAgents] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the agents. + // See https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time" is supported. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListAgents][google.cloud.ces.v1beta.AgentService.ListAgents]. +message ListAgentsResponse { + // The list of agents. + repeated Agent agents = 1; + + // A token that can be sent as + // [ListAgentsRequest.page_token][google.cloud.ces.v1beta.ListAgentsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [AgentService.GetAgent][google.cloud.ces.v1beta.AgentService.GetAgent]. +message GetAgentRequest { + // Required. The resource name of the agent to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; +} + +// Request message for +// [AgentService.CreateAgent][google.cloud.ces.v1beta.AgentService.CreateAgent]. +message CreateAgentRequest { + // Required. The resource name of the app to create an agent in. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "ces.googleapis.com/Agent" } + ]; + + // Optional. The ID to use for the agent, which will become the final + // component of the agent's resource name. If not provided, a unique ID will + // be automatically assigned for the agent. + string agent_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The agent to create. + Agent agent = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [AgentService.UpdateAgent][google.cloud.ces.v1beta.AgentService.UpdateAgent]. +message UpdateAgentRequest { + // Required. The agent to update. + Agent agent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask is used to control which fields get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.DeleteAgent][google.cloud.ces.v1beta.AgentService.DeleteAgent]. +message DeleteAgentRequest { + // Required. The resource name of the agent to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + + // Optional. Indicates whether to forcefully delete the agent, even if it is + // still referenced by other app/agents/examples. + // + // * If `force = false`, the deletion fails if other agents/examples + // reference it. + // * If `force = true`, delete the agent and remove it from all referencing + // apps/agents/examples. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the agent. If an etag is not provided, the + // deletion will overwrite any concurrent changes. If an etag is provided and + // does not match the current etag of the agent, deletion will be blocked and + // an ABORTED error will be returned. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // 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. Human-readable status of the operation, if any. + string status_message = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation of the + // operation. Operations that have been cancelled successfully have + // [google.longrunning.Operation.error][google.longrunning.Operation.error] + // value with a [google.rpc.Status.code][google.rpc.Status.code] of `1`, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for +// [AgentService.ListExamples][google.cloud.ces.v1beta.AgentService.ListExamples]. +message ListExamplesRequest { + // Required. The resource name of the app to list examples from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Example" + } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1beta.ListExamplesResponse.next_page_token] + // value returned from a previous list + // [AgentService.ListExamples][google.cloud.ces.v1beta.AgentService.ListExamples] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the examples. + // See https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time" is supported. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListExamples][google.cloud.ces.v1beta.AgentService.ListExamples]. +message ListExamplesResponse { + // The list of examples. + repeated Example examples = 1; + + // A token that can be sent as + // [ListExamplesRequest.page_token][google.cloud.ces.v1beta.ListExamplesRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [AgentService.GetExample][google.cloud.ces.v1beta.AgentService.GetExample]. +message GetExampleRequest { + // Required. The resource name of the example to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Example" } + ]; +} + +// Request message for +// [AgentService.CreateExample][google.cloud.ces.v1beta.AgentService.CreateExample]. +message CreateExampleRequest { + // Required. The resource name of the app to create an example in. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Example" + } + ]; + + // Optional. The ID to use for the example, which will become the final + // component of the example's resource name. If not provided, a unique ID will + // be automatically assigned for the example. + string example_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The example to create. + Example example = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [AgentService.UpdateExample][google.cloud.ces.v1beta.AgentService.UpdateExample]. +message UpdateExampleRequest { + // Required. The example to update. + Example example = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask is used to control which fields get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.DeleteExample][google.cloud.ces.v1beta.AgentService.DeleteExample]. +message DeleteExampleRequest { + // Required. The resource name of the example to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Example" } + ]; + + // Optional. The current etag of the example. If an etag is not provided, the + // deletion will overwrite any concurrent changes. If an etag is provided and + // does not match the current etag of the example, deletion will be blocked + // and an ABORTED error will be returned. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.ListTools][google.cloud.ces.v1beta.AgentService.ListTools]. +message ListToolsRequest { + // Required. The resource name of the app to list tools from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "ces.googleapis.com/Tool" } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1beta.ListToolsResponse.next_page_token] + // value returned from a previous list + // [AgentService.ListTools][google.cloud.ces.v1beta.AgentService.ListTools] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the tools. Use + // "include_system_tools=true" to include system tools in the response. See + // https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time" is supported. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListTools][google.cloud.ces.v1beta.AgentService.ListTools]. +message ListToolsResponse { + // The list of tools. + repeated Tool tools = 1; + + // A token that can be sent as + // [ListToolsRequest.page_token][google.cloud.ces.v1beta.ListToolsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [AgentService.GetTool][google.cloud.ces.v1beta.AgentService.GetTool]. +message GetToolRequest { + // Required. The resource name of the tool to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } + ]; +} + +// Request message for +// [AgentService.CreateTool][google.cloud.ces.v1beta.AgentService.CreateTool]. +message CreateToolRequest { + // Required. The resource name of the app to create a tool in. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "ces.googleapis.com/Tool" } + ]; + + // Optional. The ID to use for the tool, which will become the final component + // of the tool's resource name. If not provided, a unique ID will be + // automatically assigned for the tool. + string tool_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The tool to create. + Tool tool = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [AgentService.UpdateTool][google.cloud.ces.v1beta.AgentService.UpdateTool]. +message UpdateToolRequest { + // Required. The tool to update. + Tool tool = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask is used to control which fields get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.DeleteTool][google.cloud.ces.v1beta.AgentService.DeleteTool]. +message DeleteToolRequest { + // Required. The resource name of the tool to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } + ]; + + // Optional. Indicates whether to forcefully delete the tool, even if it is + // still referenced by agents/examples. + // + // * If `force = false`, the deletion will fail if any agents still + // reference the tool. + // * If `force = true`, all existing references from agents will be removed + // and the tool will be deleted. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the tool. If an etag is not provided, the + // deletion will overwrite any concurrent changes. If an etag is provided and + // does not match the current etag of the tool, deletion will be blocked and + // an ABORTED error will be returned. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.ListConversations][google.cloud.ces.v1beta.AgentService.ListConversations]. +message ListConversationsRequest { + // Required. The resource name of the app to list conversations from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Conversation" + } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1beta.ListConversationsResponse.next_page_token] + // value returned from a previous list + // [AgentService.ListConversations][google.cloud.ces.v1beta.AgentService.ListConversations] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the conversations. + // See https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicate the source of the conversation. If not set, Source.Live + // will be applied by default. Will be deprecated in favor of `sources` field. + Conversation.Source source = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicate the sources of the conversations. If not set, all + // available sources will be applied by default. + repeated Conversation.Source sources = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListConversations][google.cloud.ces.v1beta.AgentService.ListConversations]. +message ListConversationsResponse { + // The list of conversations. + repeated Conversation conversations = 1; + + // A token that can be sent as + // [ListConversationsRequest.page_token][google.cloud.ces.v1beta.ListConversationsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [AgentService.GetConversation][google.cloud.ces.v1beta.AgentService.GetConversation]. +message GetConversationRequest { + // Required. The resource name of the conversation to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ces.googleapis.com/Conversation" + } + ]; + + // Optional. Indicate the source of the conversation. If not set, all source + // will be searched. + Conversation.Source source = 2 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.DeleteConversation][google.cloud.ces.v1beta.AgentService.DeleteConversation]. +message DeleteConversationRequest { + // Required. The resource name of the conversation to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ces.googleapis.com/Conversation" + } + ]; + + // Optional. Indicate the source of the conversation. If not set, Source.Live + // will be applied by default. + Conversation.Source source = 2 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.BatchDeleteConversations][google.cloud.ces.v1beta.AgentService.BatchDeleteConversations]. +message BatchDeleteConversationsRequest { + // Required. The resource name of the app to delete conversations from. + // Format: + // `projects/{project}/locations/{location}/apps/{app}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Conversation" + } + ]; + + // Required. The resource names of the conversations to delete. + repeated string conversations = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ces.googleapis.com/Conversation" + } + ]; +} + +// Response message for +// [AgentService.BatchDeleteConversations][google.cloud.ces.v1beta.AgentService.BatchDeleteConversations]. +message BatchDeleteConversationsResponse { + // The list of conversations that were successfully deleted. + repeated string deleted_conversations = 1; + + // The list of conversations that failed to be deleted. + repeated string failed_conversations = 2; + + // Optional. A list of error messages associated with conversations that + // failed to be deleted. + repeated string error_messages = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.ListGuardrails][google.cloud.ces.v1beta.AgentService.ListGuardrails]. +message ListGuardrailsRequest { + // Required. The resource name of the app to list guardrails from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Guardrail" + } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1beta.ListGuardrailsResponse.next_page_token] + // value returned from a previous list + // [AgentService.ListGuardrails][google.cloud.ces.v1beta.AgentService.ListGuardrails] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the guardrails. + // See https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time" is supported. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListGuardrails][google.cloud.ces.v1beta.AgentService.ListGuardrails]. +message ListGuardrailsResponse { + // The list of guardrails. + repeated Guardrail guardrails = 1; + + // A token that can be sent as + // [ListGuardrailsRequest.page_token][google.cloud.ces.v1beta.ListGuardrailsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [AgentService.GetGuardrail][google.cloud.ces.v1beta.AgentService.GetGuardrail]. +message GetGuardrailRequest { + // Required. The resource name of the guardrail to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Guardrail" } + ]; +} + +// Request message for +// [AgentService.CreateGuardrail][google.cloud.ces.v1beta.AgentService.CreateGuardrail]. +message CreateGuardrailRequest { + // Required. The resource name of the app to create a guardrail in. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Guardrail" + } + ]; + + // Optional. The ID to use for the guardrail, which will become the final + // component of the guardrail's resource name. If not provided, a unique ID + // will be automatically assigned for the guardrail. + string guardrail_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The guardrail to create. + Guardrail guardrail = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [AgentService.UpdateGuardrail][google.cloud.ces.v1beta.AgentService.UpdateGuardrail]. +message UpdateGuardrailRequest { + // Required. The guardrail to update. + Guardrail guardrail = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask is used to control which fields get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.DeleteGuardrail][google.cloud.ces.v1beta.AgentService.DeleteGuardrail]. +message DeleteGuardrailRequest { + // Required. The resource name of the guardrail to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Guardrail" } + ]; + + // Optional. Indicates whether to forcefully delete the guardrail, even if it + // is still referenced by app/agents. + // + // * If `force = false`, the deletion fails if any apps/agents still + // reference the guardrail. + // * If `force = true`, all existing references from apps/agents will be + // removed and the guardrail will be deleted. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the guardrail. If an etag is not provided, + // the deletion will overwrite any concurrent changes. If an etag is provided + // and does not match the current etag of the guardrail, deletion will be + // blocked and an ABORTED error will be returned. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.ListDeployments][google.cloud.ces.v1beta.AgentService.ListDeployments]. +message ListDeploymentsRequest { + // Required. The parent app. + // Format: + // `projects/{project}/locations/{location}/apps/{app}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Deployment" + } + ]; + + // Optional. The maximum number of deployments to return. The service may + // return fewer than this value. If unspecified, at most 50 deployments will + // be returned. The maximum value is 1000; values above 1000 will be coerced + // to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListDeployments` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListDeployments` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time" is supported. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListDeployments][google.cloud.ces.v1beta.AgentService.ListDeployments]. +message ListDeploymentsResponse { + // The list of deployments. + repeated Deployment deployments = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [AgentService.GetDeployment][google.cloud.ces.v1beta.AgentService.GetDeployment]. +message GetDeploymentRequest { + // Required. The name of the deployment. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Deployment" } + ]; +} + +// Request message for +// [AgentService.CreateDeployment][google.cloud.ces.v1beta.AgentService.CreateDeployment]. +message CreateDeploymentRequest { + // Required. The parent app. + // Format: + // `projects/{project}/locations/{location}/apps/{app}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Deployment" + } + ]; + + // Optional. The ID to use for the deployment, which will become the final + // component of the deployment's resource name. If not provided, a unique ID + // will be automatically assigned for the deployment. + string deployment_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The deployment to create. + Deployment deployment = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [AgentService.UpdateDeployment][google.cloud.ces.v1beta.AgentService.UpdateDeployment]. +message UpdateDeploymentRequest { + // Required. The deployment to update. + Deployment deployment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.DeleteDeployment][google.cloud.ces.v1beta.AgentService.DeleteDeployment]. +message DeleteDeploymentRequest { + // Required. The name of the deployment to delete. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Deployment" } + ]; + + // Optional. The etag of the deployment. + // If an etag is provided and does not match the current etag of the + // deployment, deletion will be blocked and an ABORTED error will be returned. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.ListToolsets][google.cloud.ces.v1beta.AgentService.ListToolsets]. +message ListToolsetsRequest { + // Required. The resource name of the app to list toolsets from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Toolset" + } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1beta.ListToolsetsResponse.next_page_token] + // value returned from a previous list + // [AgentService.ListToolsets][google.cloud.ces.v1beta.AgentService.ListToolsets] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the toolsets. + // See https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time" is supported. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListToolsets][google.cloud.ces.v1beta.AgentService.ListToolsets]. +message ListToolsetsResponse { + // The list of toolsets. + repeated Toolset toolsets = 1; + + // A token that can be sent as + // [ListToolsetsRequest.page_token][google.cloud.ces.v1beta.ListToolsetsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [AgentService.GetToolset][google.cloud.ces.v1beta.AgentService.GetToolset]. +message GetToolsetRequest { + // Required. The resource name of the toolset to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Toolset" } + ]; +} + +// Request message for +// [AgentService.CreateToolset][google.cloud.ces.v1beta.AgentService.CreateToolset]. +message CreateToolsetRequest { + // Required. The resource name of the app to create a toolset in. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Toolset" + } + ]; + + // Optional. The ID to use for the toolset, which will become the final + // component of the toolset's resource name. If not provided, a unique ID will + // be automatically assigned for the toolset. + string toolset_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The toolset to create. + Toolset toolset = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [AgentService.UpdateToolset][google.cloud.ces.v1beta.AgentService.UpdateToolset]. +message UpdateToolsetRequest { + // Required. The toolset to update. + Toolset toolset = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask is used to control which fields get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.DeleteToolset][google.cloud.ces.v1beta.AgentService.DeleteToolset]. +message DeleteToolsetRequest { + // Required. The resource name of the toolset to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Toolset" } + ]; + + // Optional. Indicates whether to forcefully delete the toolset, even if it is + // still referenced by app/agents. + // + // * If `force = false`, the deletion fails if any agents still + // reference the toolset. + // * If `force = true`, all existing references from agents will be + // removed and the toolset will be deleted. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the toolset. If an etag is not provided, the + // deletion will overwrite any concurrent changes. If an etag is provided and + // does not match the current etag of the toolset, deletion will be blocked + // and an ABORTED error will be returned. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.ListAppVersions][google.cloud.ces.v1beta.AgentService.ListAppVersions]. +message ListAppVersionsRequest { + // Required. The resource name of the app to list app versions from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/AppVersion" + } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1beta.ListAppVersionsResponse.next_page_token] + // value returned from a previous list + // [AgentService.ListAppVersions][google.cloud.ces.v1beta.AgentService.ListAppVersions] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the app versions. + // See https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time" is supported. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListAppVersions][google.cloud.ces.v1beta.AgentService.ListAppVersions]. +message ListAppVersionsResponse { + // The list of app versions. + repeated AppVersion app_versions = 1; + + // A token that can be sent as + // [ListAppVersionsRequest.page_token][google.cloud.ces.v1beta.ListAppVersionsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [AgentService.GetAppVersion][google.cloud.ces.v1beta.AgentService.GetAppVersion]. +message GetAppVersionRequest { + // Required. The resource name of the app version to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/AppVersion" } + ]; +} + +// Request message for +// [AgentService.DeleteAppVersion][google.cloud.ces.v1beta.AgentService.DeleteAppVersion]. +message DeleteAppVersionRequest { + // Required. The resource name of the app version to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/AppVersion" } + ]; + + // Optional. The current etag of the app version. If an etag is not provided, + // the deletion will overwrite any concurrent changes. If an etag is provided + // and does not match the current etag of the app version, deletion will be + // blocked and an ABORTED error will be returned. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [AgentService.CreateAppVersion][google.cloud.ces.v1beta.AgentService.CreateAppVersion] +message CreateAppVersionRequest { + // Required. The resource name of the app to create an app version in. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/AppVersion" + } + ]; + + // Optional. The ID to use for the app version, which will become the final + // component of the app version's resource name. If not provided, a unique ID + // will be automatically assigned for the app version. + string app_version_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The app version to create. + AppVersion app_version = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [AgentService.RestoreAppVersion][google.cloud.ces.v1beta.AgentService.RestoreAppVersion] +message RestoreAppVersionRequest { + // Required. The resource name of the app version to restore. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/AppVersion" } + ]; +} + +// Response message for +// [AgentService.RestoreAppVersion][google.cloud.ces.v1beta.AgentService.RestoreAppVersion] +message RestoreAppVersionResponse {} + +// Response message for +// [AgentService.GenerateAppResource][google.cloud.ces.v1beta.AgentService.GenerateAppResource]. +message GenerateAppResourceResponse { + // The list of evaluations generated by the LLM assistant. + message Evaluations { + // The list of generated evaluations. + repeated Evaluation evaluations = 1; + } + + // The list of tools generated by the LLM assistant. + message Tools { + // The list of tools generated by the LLM assistant. + repeated Tool tools = 1; + } + + // The list of app resources generated by the LLM assistant. + message AppResources { + // The app snapshot generated by the LLM assistant. This snapshot contains + // the app, agents & tools generated by the LLM assistant. + AppSnapshot app_snapshot = 1; + + // The list of evaluations generated by the LLM assistant. + repeated Evaluation evaluations = 2; + } + + // This provides additional information about the generated result. + message GenerateResultInfo { + // An explanation of the changes in the generated resource. + string explanation = 1; + } + + // The generated resource. + oneof generated_resource { + // Agent generated by the LLM assistant. + Agent agent = 1; + + // Toolset generated by the LLM assistant. Supports Open API toolset schema + // generation. + Toolset toolset = 3; + + // App snapshot generated by the LLM assistant. This snapshot contains the + // app, agents & tools generated by the LLM assistant. + AppSnapshot app_snapshot = 4; + + // The list of tools generated by the LLM assistant. + Tools tools = 5; + + // Evaluations generated by the LLM assistant. + Evaluations evaluations = 6; + + // The app resources generated by the LLM assistant. + AppResources app_resources = 7; + } + + // Additional information about the generated result. + GenerateResultInfo generate_result_info = 2; +} + +// Request message for +// [AgentService.ListChangelogs][google.cloud.ces.v1beta.AgentService.ListChangelogs]. +message ListChangelogsRequest { + // Required. The resource name of the app to list changelogs from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Changelog" + } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1beta.ListChangelogsResponse.next_page_token] + // value returned from a previous list + // [AgentService.ListChangelogs][google.cloud.ces.v1beta.AgentService.ListChangelogs] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the changelogs. + // See https://google.aip.dev/160 for more details. + // + // The filter string can be used to filter by `action`, `resource_type`, + // `resource_name`, `author`, and `create_time`. + // The `:` comparator can be used for case-insensitive partial matching on + // string fields, while `=` performs an exact case-sensitive match. + // + // Examples: + // * `action:update` (case-insensitive partial match) + // * `action="Create"` (case-sensitive exact match) + // * `resource_type:agent` + // * `resource_name:my-agent` + // * `author:me@example.com` + // * `create_time > "2025-01-01T00:00:00Z"` + // * `create_time <= "2025-01-01T00:00:00Z" AND resource_type:tool` + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time" is supported. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [AgentService.ListChangelogs][google.cloud.ces.v1beta.AgentService.ListChangelogs]. +message ListChangelogsResponse { + // The list of changelogs. + repeated Changelog changelogs = 1; + + // A token that can be sent as + // [ListChangelogsRequest.page_token][google.cloud.ces.v1beta.ListChangelogsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [AgentService.GetChangelog][google.cloud.ces.v1beta.AgentService.GetChangelog]. +message GetChangelogRequest { + // Required. The resource name of the changelog to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Changelog" } + ]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_transfers.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_transfers.proto new file mode 100644 index 00000000000..125022fcb12 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_transfers.proto @@ -0,0 +1,101 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "AgentTransfersProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Expression condition based on session state. +message ExpressionCondition { + // Required. The string representation of cloud.api.Expression condition. + string expression = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Python code block to evaluate the condition. +message PythonCodeCondition { + // Required. The python code to execute. + string python_code = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Rule for transferring to a specific agent. +message TransferRule { + // Deterministic transfer rule. When the condition evaluates to true, the + // transfer occurs. + message DeterministicTransfer { + // The condition to evaluate. + oneof condition_type { + // Optional. A rule that evaluates a session state condition. + // If the condition evaluates to true, the transfer occurs. + ExpressionCondition expression_condition = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A rule that uses Python code block to evaluate the + // conditions. If the condition evaluates to true, the transfer occurs. + PythonCodeCondition python_code_condition = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + } + + // A rule that prevents the planner from transferring to the target agent. + message DisablePlannerTransfer { + // Required. If the condition evaluates to true, planner will not be allowed + // to transfer to the target agent. + ExpressionCondition expression_condition = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // The direction of the transfer. + enum Direction { + // Unspecified direction. + DIRECTION_UNSPECIFIED = 0; + + // Transfer from the parent agent to the child agent. + PARENT_TO_CHILD = 1; + + // Transfer from the child agent to the parent agent. + CHILD_TO_PARENT = 2; + } + + // The rule type. + oneof rule_type { + // Optional. A rule that immediately transfers to the target agent when the + // condition is met. + DeterministicTransfer deterministic_transfer = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Rule that prevents the planner from transferring to the target + // agent. + DisablePlannerTransfer disable_planner_transfer = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The resource name of the child agent the rule applies to. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` + string child_agent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + + // Required. The direction of the transfer. + Direction direction = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/app.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/app.proto new file mode 100644 index 00000000000..be77bebe5eb --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/app.proto @@ -0,0 +1,775 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1beta/bigquery_export.proto"; +import "google/cloud/ces/v1beta/common.proto"; +import "google/cloud/ces/v1beta/fakes.proto"; +import "google/cloud/ces/v1beta/golden_run.proto"; +import "google/cloud/ces/v1beta/schema.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "AppProto"; +option java_package = "com.google.cloud.ces.v1beta"; +option (google.api.resource_definition) = { + type: "dlp.googleapis.com/InspectTemplate" + pattern: "organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}" + pattern: "projects/{project}/locations/{location}/inspectTemplates/{inspect_template}" +}; +option (google.api.resource_definition) = { + type: "dlp.googleapis.com/DeidentifyTemplate" + pattern: "organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}" + pattern: "projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}" +}; +option (google.api.resource_definition) = { + type: "discoveryengine.googleapis.com/Engine" + pattern: "projects/{project}/locations/{location}/collections/{collection}/engines/{engine}" +}; + +// An app serves as a top-level container for a group of agents, including the +// root agent and its sub-agents, along with their associated configurations. +// These agents work together to achieve specific goals within the app's +// context. +message App { + option (google.api.resource) = { + type: "ces.googleapis.com/App" + pattern: "projects/{project}/locations/{location}/apps/{app}" + plural: "apps" + singular: "app" + }; + + // Defines the structure and metadata for a variable. + message VariableDeclaration { + // Required. The name of the variable. The name must start with a letter or + // underscore and contain only letters, numbers, or underscores. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The description of the variable. + string description = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The schema of the variable. + Schema schema = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // Defines the tool execution behavior if there are **multiple** tools being + // selected by the agent **at the same time**. + enum ToolExecutionMode { + // Unspecified tool execution mode. Default to PARALLEL. + TOOL_EXECUTION_MODE_UNSPECIFIED = 0; + + // If there are multiple tools being selected, they will be executed in + // parallel, with the same + // [ToolContext](https://google.github.io/adk-docs/context/#the-different-types-of-context). + PARALLEL = 1; + + // If there are multiple tools being selected, they will be executed + // sequentially. The next tool will only be executed after the previous tool + // completes and it can see updated + // [ToolContext](https://google.github.io/adk-docs/context/#the-different-types-of-context) + // from the previous tool. + SEQUENTIAL = 2; + } + + // Identifier. The unique identifier of the app. + // Format: `projects/{project}/locations/{location}/apps/{app}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Display name of the app. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Human-readable description of the app. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether the app is pinned in the app list. + bool pinned = 31 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The root agent is the entry point of the app. + // Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` + string root_agent = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + + // Optional. Language settings of the app. + LanguageSettings language_settings = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. TimeZone settings of the app. + TimeZoneSettings time_zone_settings = 27 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Audio processing configuration of the app. + AudioProcessingConfig audio_processing_config = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Logging settings of the app. + LoggingSettings logging_settings = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Error handling settings of the app. + ErrorHandlingSettings error_handling_settings = 34 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The default LLM model settings for the app. + // Individual resources (e.g. agents, guardrails) can override these + // configurations as needed. + ModelSettings model_settings = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The tool execution mode for the app. If not provided, will + // default to PARALLEL. + ToolExecutionMode tool_execution_mode = 32 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The evaluation thresholds for the app. + EvaluationMetricsThresholds evaluation_metrics_thresholds = 24 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The declarations of the variables. + repeated VariableDeclaration variable_declarations = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The declarations of predefined variables for the app. + repeated VariableDeclaration predefined_variable_declarations = 28 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Instructions for all the agents in the app. + // You can use this instruction to set up a stable identity or personality + // across all the agents. + string global_instruction = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of guardrails for the app. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}` + repeated string guardrails = 10 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Guardrail" } + ]; + + // Optional. The data store settings for the app. + DataStoreSettings data_store_settings = 15 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The default channel profile used by the app. + ChannelProfile default_channel_profile = 22 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Metadata about the app. This field can be used to store + // additional information relevant to the app's details or intended usages. + map metadata = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when the app was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the app was last updated. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Etag used to ensure the object hasn't changed during a + // read-modify-write operation. If the etag is empty, the update will + // overwrite any concurrent changes. + string etag = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of deployments in the app. + int32 deployment_count = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The default client certificate settings for the app. + ClientCertificateSettings client_certificate_settings = 25 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether the app is locked for changes. If the app is + // locked, modifications to the app resources will be rejected. + bool locked = 29 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The evaluation personas for the app. This field is used to define + // the personas that can be used for evaluation. Maximum of 30 personas can be + // defined. + repeated EvaluationPersona evaluation_personas = 30 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The evaluation settings for the app. + EvaluationSettings evaluation_settings = 33 + [(google.api.field_behavior) = OPTIONAL]; +} + +// TimeZone settings of the app. +message TimeZoneSettings { + // Optional. The time zone of the app from the [time zone + // database](https://www.iana.org/time-zones), e.g., America/Los_Angeles, + // Europe/Paris. + string time_zone = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Language settings of the app. +message LanguageSettings { + // Optional. The default language code of the app. + string default_language_code = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of languages codes supported by the app, in addition to the + // `default_language_code`. + repeated string supported_language_codes = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enables multilingual support. If true, agents in the app will use + // pre-built instructions to improve handling of multilingual input. + bool enable_multilingual_support = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The action to perform when an agent receives input in an + // unsupported language. + // + // This can be a predefined action or a custom tool call. + // Valid values are: + // - A tool's full resource name, which triggers a specific tool execution. + // - A predefined system action, such as "escalate" or "exit", which triggers + // an [EndSession][google.cloud.ces.v1beta.EndSession] signal with + // corresponding [metadata][google.cloud.ces.v1beta.EndSession.metadata] to + // terminate the conversation. + string fallback_action = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for how the input and output audio should be processed and +// delivered. +message AudioProcessingConfig { + // Optional. Configuration of how the agent response should be synthesized, + // mapping from the language code to + // [SynthesizeSpeechConfig][google.cloud.ces.v1beta.SynthesizeSpeechConfig]. + // + // If the configuration for the specified language code is not found, the + // configuration for the root language code will be used. For example, if the + // map contains "en-us" and "en", and the specified language code is "en-gb", + // then "en" configuration will be used. + // + // Note: Language code is case-insensitive. + map synthesize_speech_configs = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configures the agent behavior for the user barge-in activities. + BargeInConfig barge_in_config = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The duration of user inactivity (no speech or interaction) before + // the agent prompts the user for reengagement. If not set, the agent will not + // prompt the user for reengagement. + google.protobuf.Duration inactivity_timeout = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for the ambient sound to be played with the + // synthesized agent response, to enhance the naturalness of the conversation. + AmbientSoundConfig ambient_sound_config = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for the ambient sound to be played with the synthesized agent +// response, to enhance the naturalness of the conversation. +message AmbientSoundConfig { + // Prebuilt ambient noise. + enum PrebuiltAmbientNoise { + // Not specified. + PREBUILT_AMBIENT_NOISE_UNSPECIFIED = 0; + + // Ambient noise of a retail store. + RETAIL_STORE = 1; + + // Ambient noise of a convention hall. + CONVENTION_HALL = 2; + + // Ambient noise of a street. + OUTDOOR = 3; + } + + // Ambient noise to be played with the synthesized agent response, to + // enhance the naturalness of the conversation. + oneof source { + // Optional. Deprecated: `prebuilt_ambient_noise` is deprecated in favor of + // `prebuilt_ambient_sound`. + PrebuiltAmbientNoise prebuilt_ambient_noise = 1 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. Ambient noise as a mono-channel, 16kHz WAV file stored in + // [Cloud Storage](https://cloud.google.com/storage). + // + // Note: Please make sure the CES service agent + // `service-@gcp-sa-ces.iam.gserviceaccount.com` has + // `storage.objects.get` permission to the Cloud Storage object. + string gcs_uri = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Name of the prebuilt ambient sound. + // Valid values are: + // - "coffee_shop" + // - "keyboard" + // - "keypad" + // - "hum" + // - "office_1" + // - "office_2" + // - "office_3" + // - "room_1" + // - "room_2" + // - "room_3" + // - "room_4" + // - "room_5" + // - "air_conditioner" + string prebuilt_ambient_sound = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Volume gain (in dB) of the normal native volume supported by + // ambient noise, in the range [-96.0, 16.0]. If unset, or set to a value of + // 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + // will play at approximately half the amplitude of the normal native signal + // amplitude. A value of +6.0 (dB) will play at approximately twice the + // amplitude of the normal native signal amplitude. We strongly recommend not + // to exceed +10 (dB) as there's usually no effective increase in loudness for + // any value greater than that. + double volume_gain_db = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for how the user barge-in activities should be handled. +message BargeInConfig { + // Optional. Disables user barge-in while the agent is speaking. If true, user + // input during agent response playback will be ignored. + // + // Deprecated: `disable_barge_in` is deprecated in favor of + // [`disable_barge_in_control`][google.cloud.ces.v1beta.ChannelProfile.disable_barge_in_control] + // in ChannelProfile. + bool disable_barge_in = 1 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. If enabled, the agent will adapt its next response based on the + // assumption that the user hasn't heard the full preceding agent message. + // This should not be used in scenarios where agent responses are displayed + // visually. + bool barge_in_awareness = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for how the agent response should be synthesized. +message SynthesizeSpeechConfig { + // Optional. The name of the voice. If not set, the service will choose a + // voice based on the other parameters such as language_code. + // + // For the list of available voices, please refer to [Supported voices and + // languages](https://cloud.google.com/text-to-speech/docs/voices) from Cloud + // Text-to-Speech. + string voice = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The speaking rate/speed in the range [0.25, 2.0]. 1.0 is the + // normal native speed supported by the specific voice. 2.0 is twice as fast, + // and 0.5 is half as fast. Values outside of the range [0.25, 2.0] will + // return an error. + double speaking_rate = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings to describe the conversation data collection behaviors for LLM +// analysis metrics pipeline. +message MetricAnalysisSettings { + // Optional. Whether to collect conversation data for llm analysis metrics. If + // true, conversation data will not be collected for llm analysis metrics; + // otherwise, conversation data will be collected. + bool llm_metrics_opted_out = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings to describe the logging behaviors for the app. +message LoggingSettings { + // Optional. Configuration for how sensitive data should be redacted. + RedactionConfig redaction_config = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for how audio interactions should be recorded. + AudioRecordingConfig audio_recording_config = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Settings to describe the BigQuery export behaviors for the app. + // The conversation data will be exported to BigQuery tables if it is enabled. + BigQueryExportSettings bigquery_export_settings = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Settings to describe the Cloud Logging behaviors for the app. + CloudLoggingSettings cloud_logging_settings = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Settings to describe the conversation logging behaviors for the + // app. + ConversationLoggingSettings conversation_logging_settings = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for how audio interactions should be recorded for + // the evaluation. By default, audio recording is not enabled for evaluation + // sessions. + AudioRecordingConfig evaluation_audio_recording_config = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Settings to describe the conversation data collection behaviors + // for the LLM analysis pipeline for the app. + MetricAnalysisSettings metric_analysis_settings = 7 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings to describe how errors should be handled in the app. +message ErrorHandlingSettings { + // Defines the strategy for handling errors. + enum ErrorHandlingStrategy { + // Unspecified error handling strategy. Defaults to FALLBACK_RESPONSE. + ERROR_HANDLING_STRATEGY_UNSPECIFIED = 0; + + // No specific handling is enabled. + NONE = 1; + + // A fallback message will be returned to the user in case of + // LLM errors. + FALLBACK_RESPONSE = 2; + } + + // Optional. The strategy to use for error handling. + ErrorHandlingStrategy error_handling_strategy = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Threshold settings for metrics in an Evaluation. +message EvaluationMetricsThresholds { + // Settings for golden evaluations. + message GoldenEvaluationMetricsThresholds { + // Turn level metrics thresholds. + message TurnLevelMetricsThresholds { + // Semantic similarity channel to use. + enum SemanticSimilarityChannel { + // Metric unspecified. Defaults to TEXT. + SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED = 0; + + // Use text semantic similarity. + TEXT = 1; + + // Use audio semantic similarity. + AUDIO = 2; + } + + // Optional. The success threshold for semantic similarity. Must be an + // integer between 0 and 4. Default is >= 3. + optional int32 semantic_similarity_success_threshold = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The success threshold for overall tool invocation + // correctness. Must be a float between 0 and 1. Default is 1.0. + optional float overall_tool_invocation_correctness_threshold = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The semantic similarity channel to use for evaluation. + SemanticSimilarityChannel semantic_similarity_channel = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Expectation level metrics thresholds. + message ExpectationLevelMetricsThresholds { + // Optional. The success threshold for individual tool invocation + // parameter correctness. Must be a float between 0 and 1. Default is 1.0. + optional float tool_invocation_parameter_correctness_threshold = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The turn level metrics thresholds. + TurnLevelMetricsThresholds turn_level_metrics_thresholds = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The expectation level metrics thresholds. + ExpectationLevelMetricsThresholds expectation_level_metrics_thresholds = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The tool matching settings. An + // extra tool call is a tool call that is present in the execution but does + // not match any tool call in the golden expectation. + ToolMatchingSettings tool_matching_settings = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Settings for matching tool calls. + message ToolMatchingSettings { + // Defines the behavior when an extra tool call is encountered. An extra + // tool call is a tool call that is present in the execution but does not + // match any tool call in the golden expectation. + enum ExtraToolCallBehavior { + // Unspecified behavior. Defaults to FAIL. + EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED = 0; + + // Fail the evaluation if an extra tool call is encountered. + FAIL = 1; + + // Allow the extra tool call. + ALLOW = 2; + } + + // Optional. Behavior for extra tool calls. + // Defaults to FAIL. + ExtraToolCallBehavior extra_tool_call_behavior = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The hallucination metric behavior. Regardless of the behavior, the metric + // will always be calculated. The difference is that when disabled, the + // metric is not used to calculate the overall evaluation score. + enum HallucinationMetricBehavior { + // Unspecified hallucination metric behavior. + HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED = 0; + + // Disable hallucination metric. + DISABLED = 1; + + // Enable hallucination metric. + ENABLED = 2; + } + + // Optional. The golden evaluation metrics thresholds. + GoldenEvaluationMetricsThresholds golden_evaluation_metrics_thresholds = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deprecated: Use `golden_hallucination_metric_behavior` instead. + // The hallucination metric behavior is currently used for golden evaluations. + HallucinationMetricBehavior hallucination_metric_behavior = 3 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. The hallucination metric behavior for golden evaluations. + HallucinationMetricBehavior golden_hallucination_metric_behavior = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The hallucination metric behavior for scenario evaluations. + HallucinationMetricBehavior scenario_hallucination_metric_behavior = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings for evaluation. +message EvaluationSettings { + // Determines who starts the conversation in a scenario evaluation session. + enum ScenarioConversationInitiator { + // Unspecified. Defaults to USER. + SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED = 0; + + // The user starts the conversation. + USER = 1; + + // The agent starts the conversation. + AGENT = 2; + } + + // Optional. Who starts the conversation in a scenario evaluation. + ScenarioConversationInitiator scenario_conversation_initiator = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The default method used to run golden evaluations. This will be + // used if no golden_run_method is specified in the RunEvaluationRequest. + GoldenRunMethod golden_run_method = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configures the default tool call behaviour for golden + // evaluations. + EvaluationToolCallBehaviour golden_evaluation_tool_call_behaviour = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configures the default tool call behaviour for scenario + // evaluations. + EvaluationToolCallBehaviour scenario_evaluation_tool_call_behaviour = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings for custom client certificates. +message ClientCertificateSettings { + // Required. The TLS certificate encoded in PEM format. This string must + // include the begin header and end footer lines. + string tls_certificate = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the SecretManager secret version resource storing the + // private key encoded in PEM format. + // Format: `projects/{project}/secrets/{secret}/versions/{version}` + string private_key = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Optional. The name of the SecretManager secret version resource storing the + // passphrase to decrypt the private key. Should be left unset if the private + // key is not encrypted. + // Format: `projects/{project}/secrets/{secret}/versions/{version}` + string passphrase = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings to describe the conversation logging behaviors for the app. +message ConversationLoggingSettings { + // Optional. Whether to disable conversation logging for the sessions. + bool disable_conversation_logging = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings to describe the Cloud Logging behaviors for the app. +message CloudLoggingSettings { + // Optional. Whether to enable Cloud Logging for the sessions. + bool enable_cloud_logging = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for how the audio interactions should be recorded. +message AudioRecordingConfig { + // Optional. The [Cloud Storage](https://cloud.google.com/storage) bucket to + // store the session audio recordings. The URI must start with "gs://". + // + // Please choose a bucket location that meets your data residency + // requirements. + // + // Note: If the Cloud Storage bucket is in a different project from the app, + // you should grant `storage.objects.create` permission to the CES service + // agent `service-@gcp-sa-ces.iam.gserviceaccount.com`. + string gcs_bucket = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud Storage path prefix for audio recordings. + // + // This prefix can include the following placeholders, which will be + // dynamically substituted at serving time: + // - $project: project ID + // - $location: app location + // - $app: app ID + // - $date: session date in YYYY-MM-DD format + // - $session: session ID + // + // If the path prefix is not specified, the default prefix + // `$project/$location/$app/$date/$session/` will be used. + string gcs_path_prefix = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration to instruct how sensitive data should be handled. +message RedactionConfig { + // Optional. If true, redaction will be applied in various logging scenarios, + // including conversation history, Cloud Logging and audio recording. + bool enable_redaction = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. [DLP](https://cloud.google.com/dlp/docs) inspect template name to + // configure detection of sensitive data types. + // + // Format: + // `projects/{project}/locations/{location}/inspectTemplates/{inspect_template}` + string inspect_template = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/InspectTemplate" + } + ]; + + // Optional. [DLP](https://cloud.google.com/dlp/docs) deidentify template name + // to instruct on how to de-identify content. + // + // Format: + // `projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}` + string deidentify_template = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "dlp.googleapis.com/DeidentifyTemplate" + } + ]; +} + +// Data store related settings for the app. +message DataStoreSettings { + // An engine to which the data stores are connected. + // See Vertex AI Search: + // https://cloud.google.com/generative-ai-app-builder/docs/enterprise-search-introduction. + message Engine { + // The type of the engine. + // See the documentation available at + // https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SolutionType + // and + // https://cloud.google.com/generative-ai-app-builder/docs/create-datastore-ingest. + enum Type { + // Unspecified engine type. + TYPE_UNSPECIFIED = 0; + + // The SOLUTION_TYPE_SEARCH engine for the app. All connector data stores + // added to the app will be added to this engine. + ENGINE_TYPE_SEARCH = 1; + + // Chat engine type. + // The SOLUTION_TYPE_CHAT engine for the app. All connector data stores + // added to the app will be added to this engine. + ENGINE_TYPE_CHAT = 2; + } + + // Output only. The resource name of the engine. + // Format: + // `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Engine" + } + ]; + + // Output only. The type of the engine. + Type type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The engines for the app. + repeated Engine engines = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A persona represents an end user in an evaluation. +message EvaluationPersona { + // Configuration for Text-to-Speech generation. + message SpeechConfig { + // Simulated audio environment. + enum BackgroundEnvironment { + // Background environment unspecified. + BACKGROUND_ENVIRONMENT_UNSPECIFIED = 0; + + // Call center environment. + CALL_CENTER = 3; + + // Traffic noise environment. + TRAFFIC = 4; + + // Kids noise environment. + KIDS_NOISE = 5; + + // Cafe environment. + CAFE = 6; + } + + // Optional. The speaking rate. 1.0 is normal. + // Lower is slower (e.g., 0.8), higher is faster (e.g., 1.5). + // Useful for testing how the agent handles fast talkers. + double speaking_rate = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The simulated audio environment. + BackgroundEnvironment environment = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The specific voice identifier/accent to use. + // Example: "en-US-Wavenet-D" or "en-GB-Standard-A" + string voice_id = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The unique identifier of the persona. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluationPersonas/{evaluationPersona}` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the persona. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The display name of the persona. Unique within an app. + string display_name = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. An instruction for the agent on how to behave in the evaluation. + string personality = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Configuration for how the persona sounds (TTS settings). + SpeechConfig speech_config = 5 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/app_version.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/app_version.proto new file mode 100644 index 00000000000..df5f05a21a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/app_version.proto @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1beta/agent.proto"; +import "google/cloud/ces/v1beta/app.proto"; +import "google/cloud/ces/v1beta/example.proto"; +import "google/cloud/ces/v1beta/guardrail.proto"; +import "google/cloud/ces/v1beta/tool.proto"; +import "google/cloud/ces/v1beta/toolset.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "AppVersionProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// A snapshot of the app. +message AppSnapshot { + // Optional. The basic settings for the app. + App app = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of agents in the app. + repeated Agent agents = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of tools in the app. + repeated Tool tools = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of examples in the app. + repeated Example examples = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of guardrails in the app. + repeated Guardrail guardrails = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of toolsets in the app. + repeated Toolset toolsets = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// In Customer Engagement Suite (CES), an app version is a snapshot of the app +// at a specific point in time. It is immutable and cannot be modified once +// created. +message AppVersion { + option (google.api.resource) = { + type: "ces.googleapis.com/AppVersion" + pattern: "projects/{project}/locations/{location}/apps/{app}/versions/{version}" + plural: "appVersions" + singular: "appVersion" + }; + + // Identifier. The unique identifier of the app version. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/versions/{version}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. The display name of the app version. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The description of the app version. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Email of the user who created the app version. + string creator = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the app version was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The snapshot of the app when the version is created. + AppSnapshot snapshot = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Etag used to ensure the object hasn't changed during a + // read-modify-write operation. If the etag is empty, the update will + // overwrite any concurrent changes. + string etag = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/auth.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/auth.proto new file mode 100644 index 00000000000..ae9ace4bd67 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/auth.proto @@ -0,0 +1,195 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "AuthProto"; +option java_package = "com.google.cloud.ces.v1beta"; +option (google.api.resource_definition) = { + type: "secretmanager.googleapis.com/SecretVersion" + pattern: "projects/{project}/secrets/{secret}/versions/{secret_version}" +}; + +// Configurations for authentication with API key. +message ApiKeyConfig { + // The location of the API key in the request. + enum RequestLocation { + // Unspecified. This value should not be used. + REQUEST_LOCATION_UNSPECIFIED = 0; + + // Represents the key in http header. + HEADER = 1; + + // Represents the key in query string. + QUERY_STRING = 2; + } + + // Required. The parameter name or the header name of the API key. + // E.g., If the API request is "https://example.com/act?X-Api-Key=", "X-Api-Key" would be the parameter name. + string key_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the SecretManager secret version resource storing the + // API key. Format: `projects/{project}/secrets/{secret}/versions/{version}` + // + // Note: You should grant `roles/secretmanager.secretAccessor` role to the CES + // service agent + // `service-@gcp-sa-ces.iam.gserviceaccount.com`. + string api_key_secret_version = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Required. Key location in the request. + RequestLocation request_location = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Configurations for authentication with OAuth. +message OAuthConfig { + // OAuth grant types. Only [client credential + // grant](https://oauth.net/2/grant-types/client-credentials) is supported. + enum OauthGrantType { + // Unspecified. Defaults to CLIENT_CREDENTIAL. + OAUTH_GRANT_TYPE_UNSPECIFIED = 0; + + // Represents the [client credential + // flow](https://oauth.net/2/grant-types/client-credentials). + CLIENT_CREDENTIAL = 1; + } + + // Required. OAuth grant types. + OauthGrantType oauth_grant_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The client ID from the OAuth provider. + string client_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the SecretManager secret version resource storing the + // client secret. + // Format: `projects/{project}/secrets/{secret}/versions/{version}` + // + // Note: You should grant `roles/secretmanager.secretAccessor` role to the CES + // service agent + // `service-@gcp-sa-ces.iam.gserviceaccount.com`. + string client_secret_version = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Required. The token endpoint in the OAuth provider to exchange for an + // access token. + string token_endpoint = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The OAuth scopes to grant. + repeated string scopes = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configurations for authentication with [ID +// token](https://cloud.google.com/docs/authentication/token-types#id) generated +// from service agent. +message ServiceAgentIdTokenAuthConfig {} + +// Configurations for authentication using a custom service account. +message ServiceAccountAuthConfig { + // Required. The email address of the service account used for authentication. + // CES uses this service account to exchange an access token and the access + // token is then sent in the `Authorization` header of the request. + // + // The service account must have the + // `roles/iam.serviceAccountTokenCreator` role granted to the + // CES service agent + // `service-@gcp-sa-ces.iam.gserviceaccount.com`. + string service_account = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The OAuth scopes to grant. If not specified, the default scope + // `https://www.googleapis.com/auth/cloud-platform` is used. + repeated string scopes = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configurations for authentication with a bearer token. +message BearerTokenConfig { + // Required. The bearer token. + // Must be in the format `$context.variables.`. + string token = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// End-user authentication configuration used for Connection calls. +// The field values must be the names of context variables in the format +// `$context.variables.`. +message EndUserAuthConfig { + // Oauth 2.0 Authorization Code authentication configuration. + message Oauth2AuthCodeConfig { + // Required. Oauth token parameter name to pass through. + // Must be in the format `$context.variables.`. + string oauth_token = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // JWT Profile Oauth 2.0 Authorization Grant authentication configuration. + message Oauth2JwtBearerConfig { + // Required. Issuer parameter name to pass through. + // Must be in the format `$context.variables.`. + string issuer = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Subject parameter name to pass through. + // Must be in the format `$context.variables.`. + string subject = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Client parameter name to pass through. + // Must be in the format `$context.variables.`. + string client_key = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // The auth configuration. + oneof auth_config { + // Oauth 2.0 Authorization Code authentication. + Oauth2AuthCodeConfig oauth2_auth_code_config = 2; + + // JWT Profile Oauth 2.0 Authorization Grant authentication. + Oauth2JwtBearerConfig oauth2_jwt_bearer_config = 3; + } +} + +// Authentication information required for API calls. +message ApiAuthentication { + // The auth configuration. + oneof auth_config { + // Optional. Config for API key auth. + ApiKeyConfig api_key_config = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Config for OAuth. + OAuthConfig oauth_config = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Config for ID token auth generated from CES service agent. + ServiceAgentIdTokenAuthConfig service_agent_id_token_auth_config = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Config for service account authentication. + ServiceAccountAuthConfig service_account_auth_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Config for bearer token auth. + BearerTokenConfig bearer_token_config = 5 + [(google.api.field_behavior) = OPTIONAL]; + } +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/bigquery_export.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/bigquery_export.proto new file mode 100644 index 00000000000..62a99997f31 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/bigquery_export.proto @@ -0,0 +1,40 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "BigQueryExportProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Settings to describe the BigQuery export behaviors for the app. +message BigQueryExportSettings { + // Optional. Indicates whether the BigQuery export is enabled. + bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The project ID of the BigQuery dataset to export the data to. + // + // Note: If the BigQuery dataset is in a different project from the app, + // you should grant `roles/bigquery.admin` role to the CES service agent + // `service-@gcp-sa-ces.iam.gserviceaccount.com`. + string project = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The BigQuery dataset to export the data to. + string dataset = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/changelog.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/changelog.proto new file mode 100644 index 00000000000..4421113b2a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/changelog.proto @@ -0,0 +1,82 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ChangelogProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Changelogs represent a change made to the app or to an resource within the +// app. +message Changelog { + option (google.api.resource) = { + type: "ces.googleapis.com/Changelog" + pattern: "projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}" + plural: "changelogs" + singular: "changelog" + }; + + // Identifier. The unique identifier of the changelog. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. Email address of the change author. + string author = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Display name of the change. It typically should be the display + // name of the resource that was changed. + string display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Description of the change. which typically captures the + // changed fields in the resource. + string description = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The resource that was changed. + string resource = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of the resource that was changed. + string resource_type = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The action that was performed on the resource. + string action = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The original resource before the change. + google.protobuf.Struct original_resource = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The new resource after the change. + google.protobuf.Struct new_resource = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The dependent resources that were changed. + repeated google.protobuf.Struct dependent_resources = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the change was made. + google.protobuf.Timestamp create_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The monotonically increasing sequence number of the changelog. + int64 sequence_number = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/client_function.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/client_function.proto new file mode 100644 index 00000000000..189d158b85c --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/client_function.proto @@ -0,0 +1,44 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/cloud/ces/v1beta/schema.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ClientFunctionProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Represents a client-side function that the agent can invoke. When the +// tool is chosen by the agent, control is handed off to the client. +// The client is responsible for executing the function and returning the result +// as a [ToolResponse][google.cloud.ces.v1beta.ToolResponse] to continue the +// interaction with the agent. +message ClientFunction { + // Required. The function name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The function description. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The schema of the function parameters. + Schema parameters = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The schema of the function response. + Schema response = 4 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/common.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/common.proto new file mode 100644 index 00000000000..3ef65b3ca8d --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/common.proto @@ -0,0 +1,347 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.ces.v1beta"; +option (google.api.resource_definition) = { + type: "servicedirectory.googleapis.com/Service" + pattern: "projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}" +}; + +// The execution type of the tool or toolset. +enum ExecutionType { + // The execution type is unspecified. Defaults to `SYNCHRONOUS` if + // unspecified. + EXECUTION_TYPE_UNSPECIFIED = 0; + + // The tool is executed synchronously. The session is blocked + // until the tool returns. + SYNCHRONOUS = 1; + + // The tool is executed asynchronously. The session will + // continue while the tool is executing. + ASYNCHRONOUS = 2; +} + +// A callback defines the custom logic to be executed at various stages of +// agent interaction. +message Callback { + // The callback to execute. + oneof callback { + // Required. The python code to execute for the callback. + string python_code = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Optional. Human-readable description of the callback. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether the callback is disabled. Disabled callbacks are ignored + // by the agent. + bool disabled = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If enabled, the callback will also be executed on intermediate + // model outputs. This setting only affects after model callback. + // **ENABLE WITH CAUTION**. Typically after model callback only needs to be + // executed after receiving all model responses. Enabling proactive execution + // may have negative implication on the execution cost and latency, and + // should only be enabled in rare situations. + bool proactive_execution_enabled = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Model settings contains various configurations for the LLM model. +message ModelSettings { + // Optional. The LLM model that the agent should use. + // If not set, the agent will inherit the model from its parent agent. + string model = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, this temperature will be used for the LLM model. + // Temperature controls the randomness of the model's responses. Lower + // temperatures produce responses that are more predictable. Higher + // temperatures produce responses that are more creative. + optional double temperature = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Action that is taken when a certain precondition is met. +message TriggerAction { + // Represents a response from the agent. + message Response { + // Required. Text for the agent to respond with. + string text = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Whether the response is disabled. Disabled responses are not + // used by the agent. + bool disabled = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // The agent will immediately respond with a preconfigured response. + message RespondImmediately { + // Required. The canned responses for the agent to choose from. The response + // is chosen randomly. + repeated Response responses = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The agent will immediately respond with a generative answer. + message GenerativeAnswer { + // Required. The prompt to use for the generative answer. + string prompt = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The agent will transfer the conversation to a different agent. + message TransferAgent { + // Required. The name of the agent to transfer the conversation to. The + // agent must be in the same app as the current agent. Format: + // `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` + string agent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + } + + // The action to take. + oneof action { + // Optional. Immediately respond with a preconfigured response. + RespondImmediately respond_immediately = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Transfer the conversation to a different agent. + TransferAgent transfer_agent = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Respond with a generative answer. + GenerativeAnswer generative_answer = 3 + [(google.api.field_behavior) = OPTIONAL]; + } +} + +// The TLS configuration. +message TlsConfig { + // The CA certificate. + message CaCert { + // Required. The name of the allowed custom CA certificates. This + // can be used to disambiguate the custom CA certificates. + string display_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The allowed custom CA certificates (in DER format) for + // HTTPS verification. This overrides the default SSL trust store. If this + // is empty or unspecified, CES will use Google's default trust + // store to verify certificates. N.B. Make sure the HTTPS server + // certificates are signed with "subject alt name". For instance a + // certificate can be self-signed using the following command, + // openssl x509 -req -days 200 -in example.com.csr \ + // -signkey example.com.key \ + // -out example.com.crt \ + // -extfile <(printf "\nsubjectAltName='DNS:www.example.com'") + bytes cert = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Specifies a list of allowed custom CA certificates for HTTPS + // verification. + repeated CaCert ca_certs = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Configuration for tools using Service Directory. +message ServiceDirectoryConfig { + // Required. The name of [Service + // Directory](https://cloud.google.com/service-directory) service. + // Format: + // `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}`. + // Location of the service directory must be the same as the location of the + // app. + string service = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicedirectory.googleapis.com/Service" + } + ]; +} + +// A ChannelProfile configures the agent's behavior for a specific communication +// channel, such as web UI or telephony. +message ChannelProfile { + // Represents the persona property of a channel. + message PersonaProperty { + // The persona of the channel. + enum Persona { + // UNKNOWN persona. + UNKNOWN = 0; + + // The agent keeps the responses concise and to the point + CONCISE = 1; + + // The agent provides additional context, explanations, and details + CHATTY = 2; + } + + // Optional. The persona of the channel. + Persona persona = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Message for configuration for the web widget. + message WebWidgetConfig { + // Security settings for the web widget. + message SecuritySettings { + // Optional. Indicates whether public access to the web widget is enabled. + // If `true`, the web widget will be publicly accessible. + // If `false`, the web widget must be integrated with your own + // authentication and authorization system to return valid credentials for + // accessing the CES agent. + bool enable_public_access = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether origin check for the web widget is enabled. + // If `true`, the web widget will check the origin of the website that + // loads the web widget and only allow it to be loaded in the same origin + // or any of the allowed origins. + bool enable_origin_check = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The origins that are allowed to host the web widget. An + // origin is defined by RFC 6454. If empty, all origins are allowed. A + // maximum of 100 origins is allowed. Example: "https://example.com" + repeated string allowed_origins = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether reCAPTCHA verification for the web widget + // is enabled. + bool enable_recaptcha = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Modality of the web widget. + enum Modality { + // Unknown modality. + MODALITY_UNSPECIFIED = 0; + + // Widget supports both chat and voice input. + CHAT_AND_VOICE = 1; + + // Widget supports only voice input. + VOICE_ONLY = 2; + + // Widget supports only chat input. + CHAT_ONLY = 3; + } + + // Theme of the web widget. + enum Theme { + // Unknown theme. + THEME_UNSPECIFIED = 0; + + // Light theme. + LIGHT = 1; + + // Dark theme. + DARK = 2; + } + + // Optional. The modality of the web widget. + Modality modality = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The theme of the web widget. + Theme theme = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The title of the web widget. + string web_widget_title = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The security settings of the web widget. + SecuritySettings security_settings = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The type of the channel profile. + enum ChannelType { + // Unknown channel type. + UNKNOWN = 0; + + // Web UI channel. + WEB_UI = 2; + + // API channel. + API = 3; + + // Twilio channel. + TWILIO = 4; + + // Google Telephony Platform channel. + GOOGLE_TELEPHONY_PLATFORM = 5; + + // Contact Center as a Service (CCaaS) channel. + CONTACT_CENTER_AS_A_SERVICE = 6; + + // Five9 channel. + FIVE9 = 7; + + // Third party contact center integration channel. + CONTACT_CENTER_INTEGRATION = 8; + } + + // Optional. The unique identifier of the channel profile. + string profile_id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The type of the channel profile. + ChannelType channel_type = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The persona property of the channel profile. + PersonaProperty persona_property = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to disable DTMF (dual-tone multi-frequency). + bool disable_dtmf = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to disable user barge-in control in the conversation. + // - **true**: User interruptions are disabled while the agent is speaking. + // - **false**: The agent retains automatic control over when the user can + // interrupt. + bool disable_barge_in_control = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration for the web widget. + WebWidgetConfig web_widget_config = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The noise suppression level of the channel profile. + // Available values are "low", "moderate", "high", "very_high". + string noise_suppression_level = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// A span is a unit of work or a single operation during the request processing. +message Span { + // Output only. The name of the span. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The start time of the span. + google.protobuf.Timestamp start_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The end time of the span. + google.protobuf.Timestamp end_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The duration of the span. + google.protobuf.Duration duration = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Key-value attributes associated with the span. + google.protobuf.Struct attributes = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The child spans that are nested under this span. + repeated Span child_spans = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/connector_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/connector_tool.proto new file mode 100644 index 00000000000..31aab987117 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/connector_tool.proto @@ -0,0 +1,111 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/cloud/ces/v1beta/auth.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ConnectorToolProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Configuration of an Action for the tool to use. +// Note: This can be either an Action or an Operation. See +// https://cloud.google.com/integration-connectors/docs/entities-operation-action +// for details. +message Action { + // Entity CRUD operation specification. + message EntityOperation { + // The operation to perform on the entity. + enum OperationType { + // Operation type unspecified. Invalid, ConnectorTool create/update + // will fail. + OPERATION_TYPE_UNSPECIFIED = 0; + + // List operation. + LIST = 1; + + // Get operation. + GET = 2; + + // Create operation. + CREATE = 3; + + // Update operation. + UPDATE = 4; + + // Delete operation. + DELETE = 5; + } + + // Required. ID of the entity. + string entity_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Operation to perform on the entity. + OperationType operation = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Specification for an action to configure for the tool to use. + oneof action_spec { + // ID of a Connection action for the tool to use. + string connection_action_id = 4; + + // Entity operation configuration for the tool to use. + EntityOperation entity_operation = 5; + } + + // Optional. Entity fields to use as inputs for the operation. + // If no fields are specified, all fields of the Entity will be used. + repeated string input_fields = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Entity fields to return from the operation. + // If no fields are specified, all fields of the Entity will be returned. + repeated string output_fields = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A ConnectorTool allows connections to different integrations. +// See: https://cloud.google.com/integration-connectors/docs/overview. +message ConnectorTool { + // Required. The full resource name of the referenced Integration Connectors + // Connection. + // Format: + // `projects/{project}/locations/{location}/connections/{connection}` + string connection = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Action for the tool to use. + Action action = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Configures how authentication is handled in Integration + // Connectors. By default, an admin authentication is passed in the + // Integration Connectors API requests. You can override it with a different + // end-user authentication config. + // **Note**: The Connection must have authentication override enabled in + // order to specify an EUC configuration here - otherwise, the ConnectorTool + // creation will fail. See + // https://cloud.google.com/application-integration/docs/configure-connectors-task#configure-authentication-override + // for details. + EndUserAuthConfig auth_config = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the tool that can be used by the Agent to decide + // whether to call this ConnectorTool. + string name = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The description of the tool that can be used by the Agent to + // decide whether to call this ConnectorTool. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/connector_toolset.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/connector_toolset.proto new file mode 100644 index 00000000000..80ada4e536b --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/connector_toolset.proto @@ -0,0 +1,50 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/cloud/ces/v1beta/auth.proto"; +import "google/cloud/ces/v1beta/connector_tool.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ConnectorToolsetProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// A toolset that generates tools from an Integration Connectors Connection. +message ConnectorToolset { + // Required. The full resource name of the referenced Integration Connectors + // Connection. + // Format: + // `projects/{project}/locations/{location}/connections/{connection}` + string connection = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Configures how authentication is handled in Integration + // Connectors. By default, an admin authentication is passed in the + // Integration Connectors API requests. You can override it with a different + // end-user authentication config. + // **Note**: The Connection must have authentication override enabled in + // order to specify an EUC configuration here - otherwise, the Toolset + // creation will fail. See: + // https://cloud.google.com/application-integration/docs/configure-connectors-task#configure-authentication-override + EndUserAuthConfig auth_config = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The list of connector actions/entity operations to generate tools + // for. + repeated Action connector_actions = 3 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/conversation.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/conversation.proto new file mode 100644 index 00000000000..6b4b01e2d21 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/conversation.proto @@ -0,0 +1,165 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1beta/common.proto"; +import "google/cloud/ces/v1beta/example.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ConversationProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// A conversation represents an interaction between an end user and the CES app. +message Conversation { + option (google.api.resource) = { + type: "ces.googleapis.com/Conversation" + pattern: "projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}" + plural: "conversations" + singular: "conversation" + }; + + // All information about a single turn in the conversation. + message Turn { + // Optional. List of messages in the conversation turn, including user + // input, agent responses and intermediate events during the processing. + repeated Message messages = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The root span of the action processing. + Span root_span = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // The channel type of the conversation. + enum ChannelType { + // Unspecified channel type. + CHANNEL_TYPE_UNSPECIFIED = 0; + + // The conversation only contains text messages between the end user and the + // agent. + TEXT = 1; + + // The conversation contains audio messages between the end user and the + // agent. + AUDIO = 2; + + // The conversation multi-modal messages (e.g. image) between the end user + // and the agent. + MULTIMODAL = 3; + } + + // The source of the conversation. + enum Source { + // Unspecified source. + SOURCE_UNSPECIFIED = 0; + + // The conversation is from the live end user. + LIVE = 1; + + // The conversation is from the simulator. + SIMULATOR = 2; + + // The conversation is from the evaluation. + EVAL = 3; + } + + // Type of the input message. + enum InputType { + // Unspecified input type. + INPUT_TYPE_UNSPECIFIED = 0; + + // The input message is text. + INPUT_TYPE_TEXT = 1; + + // The input message is audio. + INPUT_TYPE_AUDIO = 2; + + // The input message is image. + INPUT_TYPE_IMAGE = 3; + + // The input message is blob file. + INPUT_TYPE_BLOB = 4; + + // The input message is client function tool response. + INPUT_TYPE_TOOL_RESPONSE = 5; + + // The input message are variables. + INPUT_TYPE_VARIABLES = 6; + } + + // Identifier. The unique identifier of the conversation. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. Timestamp when the conversation was created. + google.protobuf.Timestamp start_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the conversation was completed. + google.protobuf.Timestamp end_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The turns in the conversation. + repeated Turn turns = 6 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The number of turns in the conversation. + int32 turn_count = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // DEPRECATED. Please use + // [input_types][google.cloud.ces.v1beta.Conversation.input_types] instead. + ChannelType channel_type = 8 [deprecated = true]; + + // Output only. Indicate the source of the conversation. + Source source = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The input types of the conversation. + repeated InputType input_types = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The agent that initially handles the conversation. If not + // specified, the conversation is handled by the root agent. Format: + // `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` + string entry_agent = 11 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + + // Output only. The deployment of the app used for processing the + // conversation. Format: + // `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` + string deployment = 12 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "ces.googleapis.com/Deployment" } + ]; + + // Output only. The version of the app used for processing the conversation. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/versions/{version}` + string app_version = 13 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "ces.googleapis.com/AppVersion" } + ]; + + // Output only. The language code of the conversation. + string language_code = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Deprecated. Use turns instead. + repeated Message messages = 2 [deprecated = true]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/data_store.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/data_store.proto new file mode 100644 index 00000000000..5cf94a46458 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/data_store.proto @@ -0,0 +1,98 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "DataStoreProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// A DataStore resource in Vertex AI Search. +message DataStore { + // The connector config for the data store connection. + message ConnectorConfig { + // Resource name of the collection the data store belongs to. + string collection = 1; + + // Display name of the collection the data store belongs to. + string collection_display_name = 2; + + // The name of the data source. + // Example: `salesforce`, `jira`, `confluence`, `bigquery`. + string data_source = 3; + } + + // The type of the data store. + enum DataStoreType { + // Not specified. This value indicates that the data store type is not + // specified, so it will not be used during search. + DATA_STORE_TYPE_UNSPECIFIED = 0; + + // A data store that contains public web content. + PUBLIC_WEB = 1; + + // A data store that contains unstructured private data. + UNSTRUCTURED = 2; + + // A data store that contains structured data used as FAQ. + FAQ = 3; + + // A data store that is a connector to a first-party or a third-party + // service. + CONNECTOR = 4; + } + + // The document processing mode of the data store. + enum DocumentProcessingMode { + // Not specified. + DOCUMENT_PROCESSING_MODE_UNSPECIFIED = 0; + + // Documents are processed as documents. + DOCUMENTS = 1; + + // Documents are converted to chunks. + CHUNKS = 2; + } + + // Required. Full resource name of the DataStore. + // Format: + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The type of the data store. This field is readonly and + // populated by the server. + DataStoreType type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The document processing mode for the data store connection. + // Only set for PUBLIC_WEB and UNSTRUCTURED data stores. + DocumentProcessingMode document_processing_mode = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The display name of the data store. + string display_name = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the data store was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The connector config for the data store connection. + ConnectorConfig connector_config = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/data_store_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/data_store_tool.proto new file mode 100644 index 00000000000..09f9f4ceee0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/data_store_tool.proto @@ -0,0 +1,302 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/cloud/ces/v1beta/common.proto"; +import "google/cloud/ces/v1beta/data_store.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "DataStoreToolProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Tool to retrieve from Vertex AI Search datastore or engine for grounding. +// Accepts either a datastore or an engine, but not both. +// See Vertex AI Search: +// https://cloud.google.com/generative-ai-app-builder/docs/enterprise-search-introduction. +message DataStoreTool { + // Rewriter configuration. + message RewriterConfig { + // Required. Configurations for the LLM model. + ModelSettings model_settings = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The prompt definition. If not set, default prompt will be used. + string prompt = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether the rewriter is disabled. + bool disabled = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Summarization configuration. + message SummarizationConfig { + // Optional. Configurations for the LLM model. + ModelSettings model_settings = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The prompt definition. If not set, default prompt will be used. + string prompt = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether summarization is disabled. + bool disabled = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Grounding configuration. + message GroundingConfig { + // Optional. The groundedness threshold of the answer based on the retrieved + // sources. The value has a configurable range of [1, 5]. The level is used + // to threshold the groundedness of the answer, meaning that all responses + // with a groundedness score below the threshold will fall back to returning + // relevant snippets only. + // + // For example, a level of 3 means that the groundedness score must be + // 3 or higher for the response to be returned. + float grounding_level = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether grounding is disabled. + bool disabled = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for searching within a specific DataStore. + message DataStoreSource { + // Optional. Filter specification for the DataStore. + // See: + // https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The data store. + DataStore data_store = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for searching within an Engine, potentially targeting + // specific DataStores. + message EngineSource { + // Required. Full resource name of the Engine. + // Format: + // `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` + string engine = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Use to target specific DataStores within the Engine. + // If empty, the search applies to all DataStores associated with the + // Engine. + repeated DataStoreSource data_store_sources = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter applied to the search across the Engine. Not relevant + // and not used if 'data_store_sources' is provided. See: + // https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata + string filter = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Boost specifications to boost certain documents. + // For more information, please refer to + // https://cloud.google.com/generative-ai-app-builder/docs/boosting. + message BoostSpecs { + // Required. The Data Store where the boosting configuration is applied. + // Full resource name of DataStore, such as + // projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}. + repeated string data_stores = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A list of boosting specifications. + repeated BoostSpec spec = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Boost specification to boost certain documents. + message BoostSpec { + // Boost specification for a condition. + message ConditionBoostSpec { + // Specification for custom ranking based on customer specified attribute + // value. It provides more controls for customized ranking than the simple + // (condition, boost) combination above. + message BoostControlSpec { + // The control points used to define the curve. The curve defined + // through these control points can only be monotonically increasing + // or decreasing(constant values are acceptable). + message ControlPoint { + // Optional. Can be one of: + // 1. The numerical field value. + // 2. The duration spec for freshness: + // The value must be formatted as an XSD `dayTimeDuration` value (a + // restricted subset of an ISO 8601 duration value). The pattern for + // this is: `[nD][T[nH][nM][nS]]`. + string attribute_value = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value between -1 to 1 by which to boost the score if + // the attribute_value evaluates to the value specified above. + float boost_amount = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // The attribute(or function) for which the custom ranking is to be + // applied. + enum AttributeType { + // Unspecified AttributeType. + ATTRIBUTE_TYPE_UNSPECIFIED = 0; + + // The value of the numerical field will be used to dynamically update + // the boost amount. In this case, the attribute_value (the x value) + // of the control point will be the actual value of the numerical + // field for which the boost_amount is specified. + NUMERICAL = 1; + + // For the freshness use case the attribute value will be the duration + // between the current time and the date in the datetime field + // specified. The value must be formatted as an XSD `dayTimeDuration` + // value (a restricted subset of an ISO 8601 duration value). The + // pattern for this is: `[nD][T[nH][nM][nS]]`. + // E.g. `5D`, `3DT12H30M`, `T24H`. + FRESHNESS = 2; + } + + // The interpolation type to be applied. Default will be linear + // (Piecewise Linear). + enum InterpolationType { + // Interpolation type is unspecified. In this case, it defaults to + // Linear. + INTERPOLATION_TYPE_UNSPECIFIED = 0; + + // Piecewise linear interpolation will be applied. + LINEAR = 1; + } + + // Optional. The name of the field whose value will be used to determine + // the boost amount. + string field_name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The attribute type to be used to determine the boost + // amount. The attribute value can be derived from the field value of + // the specified field_name. In the case of numerical it is + // straightforward i.e. attribute_value = numerical_field_value. In the + // case of freshness however, attribute_value = (time.now() - + // datetime_field_value). + AttributeType attribute_type = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The interpolation type to be applied to connect the control + // points listed below. + InterpolationType interpolation_type = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The control points used to define the curve. The monotonic + // function (defined through the interpolation_type above) passes + // through the control points listed here. + repeated ControlPoint control_points = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. An expression which specifies a boost condition. The syntax + // is the same as filter expression syntax. Currently, the only supported + // condition is a list of BCP-47 lang codes. Example: To boost suggestions + // in languages en or fr: (lang_code: ANY("en", "fr")) + string condition = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Strength of the boost, which should be in [-1, 1]. Negative + // boost means demotion. Default is 0.0. + // + // Setting to 1.0 gives the suggestions a big promotion. However, it does + // not necessarily mean that the top result will be a boosted suggestion. + // + // Setting to -1.0 gives the suggestions a big demotion. However, other + // suggestions that are relevant might still be shown. + // + // Setting to 0.0 means no boost applied. The boosting condition is + // ignored. + float boost = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Complex specification for custom ranking based on customer + // defined attribute value. + BoostControlSpec boost_control_spec = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. A list of boosting specifications. + repeated ConditionBoostSpec condition_boost_specs = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // If specified, will apply the given configuration for the specified + // modality. + message ModalityConfig { + // The modality type. + enum ModalityType { + // Unspecified modality type. + MODALITY_TYPE_UNSPECIFIED = 0; + + // Text modality. + TEXT = 1; + + // Audio modality. + AUDIO = 2; + } + + // Required. The modality type. + ModalityType modality_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The rewriter config. + RewriterConfig rewriter_config = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The summarization config. + SummarizationConfig summarization_config = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The grounding configuration. + GroundingConfig grounding_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Filter parameter behavior. + enum FilterParameterBehavior { + // Default filter behavior. + // Include filter parameter for connector datastores. + // For the rest of the datastore types, the filter input parameter is + // omitted. + FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED = 0; + + // Always include filter parameter for all datastore types. + ALWAYS_INCLUDE = 2; + + // The filter parameter is never included in the list of tool parameters, + // regardless of the datastore type. + NEVER_INCLUDE = 3; + } + + // Defines the search source, either a single DataStore or an Engine. + oneof search_source { + // Optional. Search within a single specific DataStore. + DataStoreSource data_store_source = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Search within an Engine (potentially across multiple + // DataStores). + EngineSource engine_source = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The data store tool name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The tool description. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Boost specification to boost certain documents. + repeated BoostSpecs boost_specs = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The modality configs for the data store. + repeated ModalityConfig modality_configs = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The filter parameter behavior. + FilterParameterBehavior filter_parameter_behavior = 10 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/deployment.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/deployment.proto new file mode 100644 index 00000000000..988fefd735f --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/deployment.proto @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1beta/common.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ChannelProfileProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// A deployment represents an immutable, queryable version of the app. +// It is used to deploy an app version with a specific channel profile. +message Deployment { + option (google.api.resource) = { + type: "ces.googleapis.com/Deployment" + pattern: "projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}" + plural: "deployments" + singular: "deployment" + }; + + // Identifier. The resource name of the deployment. + // Format: + // projects/{project}/locations/{location}/apps/{app}/deployments/{deployment} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Display name of the deployment. + string display_name = 8 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource name of the app version to deploy. + // Format: + // projects/{project}/locations/{location}/apps/{app}/versions/{version} + string app_version = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/AppVersion" } + ]; + + // Required. The channel profile used in the deployment. + ChannelProfile channel_profile = 3 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Timestamp when this deployment was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this deployment was last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Etag used to ensure the object hasn't changed during a + // read-modify-write operation. If the etag is empty, the update will + // overwrite any concurrent changes. + string etag = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/evaluation.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/evaluation.proto new file mode 100644 index 00000000000..aacb4fd0931 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/evaluation.proto @@ -0,0 +1,1706 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1beta/app.proto"; +import "google/cloud/ces/v1beta/common.proto"; +import "google/cloud/ces/v1beta/example.proto"; +import "google/cloud/ces/v1beta/fakes.proto"; +import "google/cloud/ces/v1beta/golden_run.proto"; +import "google/cloud/ces/v1beta/session_service.proto"; +import "google/cloud/ces/v1beta/toolset_tool.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "EvaluationProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Aggregated metrics for an evaluation or evaluation dataset. +message AggregatedMetrics { + // Metrics for a single tool. + message ToolMetrics { + // Output only. The name of the tool. + string tool = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } + ]; + + // Output only. The number of times the tool passed. + int32 pass_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of times the tool failed. + int32 fail_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Metrics for turn latency. + message TurnLatencyMetrics { + // Output only. The average latency of the turns. + google.protobuf.Duration average_latency = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Metrics for tool call latency. + message ToolCallLatencyMetrics { + // Output only. The name of the tool. + string tool = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } + ]; + + // Output only. The average latency of the tool calls. + google.protobuf.Duration average_latency = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Metrics for semantic similarity results. + message SemanticSimilarityMetrics { + // Output only. The average semantic similarity score (0-4). + float score = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Metrics for hallucination results. + message HallucinationMetrics { + // Output only. The average hallucination score (0 to 1). + float score = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Metrics aggregated per app version. + message MetricsByAppVersion { + // Output only. The app version ID. + string app_version_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics for each tool within this app version. + repeated ToolMetrics tool_metrics = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics for semantic similarity within this app version. + repeated SemanticSimilarityMetrics semantic_similarity_metrics = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics for hallucination within this app version. + repeated HallucinationMetrics hallucination_metrics = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics for tool call latency within this app version. + repeated ToolCallLatencyMetrics tool_call_latency_metrics = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics for turn latency within this app version. + repeated TurnLatencyMetrics turn_latency_metrics = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of times the evaluation passed. + int32 pass_count = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of times the evaluation failed. + int32 fail_count = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics aggregated per turn within this app version. + repeated MetricsByTurn metrics_by_turn = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Metrics aggregated per turn. + message MetricsByTurn { + // Output only. The turn index (0-based). + int32 turn_index = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics for each tool within this turn. + repeated ToolMetrics tool_metrics = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics for semantic similarity within this turn. + repeated SemanticSimilarityMetrics semantic_similarity_metrics = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics for hallucination within this turn. + repeated HallucinationMetrics hallucination_metrics = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics for tool call latency within this turn. + repeated ToolCallLatencyMetrics tool_call_latency_metrics = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics for turn latency within this turn. + repeated TurnLatencyMetrics turn_latency_metrics = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Aggregated metrics, grouped by app version ID. + repeated MetricsByAppVersion metrics_by_app_version = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// An evaluation represents all of the information needed to simulate and +// evaluate an agent. +message Evaluation { + option (google.api.resource) = { + type: "ces.googleapis.com/Evaluation" + pattern: "projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}" + plural: "evaluations" + singular: "evaluation" + }; + + // Represents a single, checkable requirement. + message GoldenExpectation { + // The actual check to perform. + oneof condition { + // Optional. Check that a specific tool was called with the parameters. + ToolCall tool_call = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Check that a specific tool had the expected response. + ToolResponse tool_response = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Check that the agent responded with the correct response. The + // role "agent" is implied. + Message agent_response = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Check that the agent transferred the conversation to a + // different agent. + AgentTransfer agent_transfer = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Check that the agent updated the session variables to the + // expected values. Used to also capture agent variable updates for golden + // evals. + google.protobuf.Struct updated_variables = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The tool response to mock, with the parameters of interest + // specified. Any parameters not specified will be hallucinated by the + // LLM. + ToolResponse mock_tool_response = 7 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. A note for this requirement, useful in reporting when specific + // checks fail. E.g., "Check_Payment_Tool_Called". + string note = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // A step defines a singular action to happen during the evaluation. + message Step { + // The step to perform. + oneof step { + // Optional. User input for the conversation. + SessionInput user_input = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Transfer the conversation to a different agent. + AgentTransfer agent_transfer = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Executes an expectation on the current turn. + GoldenExpectation expectation = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + } + + // A golden turn defines a single turn in a golden conversation. + message GoldenTurn { + // Required. The steps required to replay a golden conversation. + repeated Step steps = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The root span of the golden turn for processing and maintaining + // audio information. + Span root_span = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // The steps required to replay a golden conversation. + message Golden { + // Required. The golden turns required to replay a golden conversation. + repeated GoldenTurn turns = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The evaluation expectations to evaluate the replayed + // conversation against. Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluationExpectations/{evaluationExpectation}` + repeated string evaluation_expectations = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationExpectation" + } + ]; + } + + // The expectation to evaluate the conversation produced by the simulation. + message ScenarioExpectation { + // The tool call and response pair to be evaluated. + message ToolExpectation { + // Required. The expected tool call, with the parameters of interest + // specified. Any parameters not specified will be hallucinated by the + // LLM. + ToolCall expected_tool_call = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The tool response to mock, with the parameters of interest + // specified. Any parameters not specified will be hallucinated by the + // LLM. + ToolResponse mock_tool_response = 2 + [(google.api.field_behavior) = REQUIRED]; + } + + // The expectation to evaluate the conversation produced by the simulation. + oneof expectation { + // Optional. The tool call and response pair to be evaluated. + ToolExpectation tool_expectation = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The agent response to be evaluated. + Message agent_response = 2 [(google.api.field_behavior) = OPTIONAL]; + } + } + + // The config for a scenario + message Scenario { + // Facts about the user as a key value pair. + message UserFact { + // Required. The name of the user fact. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The value of the user fact. + string value = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // The expected behavior of the user task. This is used to determine whether + // the scenario is successful. + enum TaskCompletionBehavior { + // Behavior unspecified. Will default to TASK_SATISFIED. + TASK_COMPLETION_BEHAVIOR_UNSPECIFIED = 0; + + // The user task should be completed successfully. + TASK_SATISFIED = 1; + + // The user task should be rejected. + TASK_REJECTED = 2; + } + + // The expected behavior of the user goal. This is used to determine whether + // the scenario is successful. + enum UserGoalBehavior { + // Behavior unspecified. Will default to USER_GOAL_SATISFIED. + USER_GOAL_BEHAVIOR_UNSPECIFIED = 0; + + // The user goal should be completed successfully. + USER_GOAL_SATISFIED = 1; + + // The user goal should be rejected. + USER_GOAL_REJECTED = 2; + + // Ignore the user goal status. + USER_GOAL_IGNORED = 3; + } + + // Required. The task to be targeted by the scenario. + string task = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The user facts to be used by the scenario. + repeated UserFact user_facts = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of turns to simulate. If not specified, the + // simulation will continue until the task is complete. + int32 max_turns = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The rubrics to score the scenario against. + repeated string rubrics = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ScenarioExpectations to evaluate the conversation produced + // by the user simulation. + repeated ScenarioExpectation scenario_expectations = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Variables / Session Parameters as context for the session, + // keyed by variable names. Members of this struct will override any default + // values set by the system. + // + // Note, these are different from user facts, which are facts known to the + // user. Variables are parameters known to the agent: i.e. MDN (phone + // number) passed by the telephony system. + google.protobuf.Struct variable_overrides = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deprecated. Use user_goal_behavior instead. + TaskCompletionBehavior task_completion_behavior = 7 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. The expected behavior of the user goal. + UserGoalBehavior user_goal_behavior = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The evaluation expectations to evaluate the conversation + // produced by the simulation against. Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluationExpectations/{evaluationExpectation}` + repeated string evaluation_expectations = 10 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationExpectation" + } + ]; + } + + // The inputs for the evaluation + oneof inputs { + // Optional. The golden steps to be evaluated. + Golden golden = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The config for a scenario. + Scenario scenario = 12 [(google.api.field_behavior) = OPTIONAL]; + } + + // Identifier. The unique identifier of this evaluation. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. User-defined display name of the evaluation. Unique within an + // App. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. User-defined description of the evaluation. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User defined tags to categorize the evaluation. + repeated string tags = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. List of evaluation datasets the evaluation belongs to. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluationDatasets/{evaluationDataset}` + repeated string evaluation_datasets = 5 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationDataset" + } + ]; + + // Output only. Timestamp when the evaluation was created. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user who created the evaluation. + string created_by = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the evaluation was last updated. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user who last updated the evaluation. + string last_updated_by = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The EvaluationRuns that this Evaluation is associated with. + repeated string evaluation_runs = 15 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationRun" + } + ]; + + // Output only. Etag used to ensure the object hasn't changed during a + // read-modify-write operation. If the etag is empty, the update will + // overwrite any concurrent changes. + string etag = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The aggregated metrics for this evaluation across all runs. + AggregatedMetrics aggregated_metrics = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The latest evaluation result for this evaluation. + EvaluationResult last_completed_result = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether the evaluation is invalid. This can happen if an + // evaluation is referencing a tool, toolset, or agent that has since been + // deleted. + bool invalid = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last 10 evaluation results for this evaluation. This is + // only populated if include_last_ten_results is set to true in the + // ListEvaluationsRequest or GetEvaluationRequest. + repeated EvaluationResult last_ten_results = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// An evaluation dataset represents a set of evaluations that are grouped +// together basaed on shared tags. +message EvaluationDataset { + option (google.api.resource) = { + type: "ces.googleapis.com/EvaluationDataset" + pattern: "projects/{project}/locations/{location}/apps/{app}/evaluationDatasets/{evaluation_dataset}" + plural: "evaluationDatasets" + singular: "evaluationDataset" + }; + + // Identifier. The unique identifier of this evaluation dataset. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluationDatasets/{evaluationDataset}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. User-defined display name of the evaluation dataset. Unique + // within an App. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Evaluations that are included in this dataset. + repeated string evaluations = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Evaluation" } + ]; + + // Output only. Timestamp when the evaluation dataset was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the evaluation dataset was last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Etag used to ensure the object hasn't changed during a + // read-modify-write operation. If the etag is empty, the update will + // overwrite any concurrent changes. + string etag = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user who created the evaluation dataset. + string created_by = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user who last updated the evaluation dataset. + string last_updated_by = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The aggregated metrics for this evaluation dataset across all + // runs. + AggregatedMetrics aggregated_metrics = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// An evaluation result represents the output of running an Evaluation. +message EvaluationResult { + option (google.api.resource) = { + type: "ces.googleapis.com/EvaluationResult" + pattern: "projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}/results/{evaluation_result}" + plural: "evaluationResults" + singular: "evaluationResult" + }; + + // Specifies the expectation and the result of that expectation. + message GoldenExpectationOutcome { + // The result of the tool invocation check. + message ToolInvocationResult { + // Output only. The tool invocation parameter correctness score. This + // indicates the percent of parameters from the expected tool call that + // were also present in the actual tool call. + optional float parameter_correctness_score = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The outcome of the tool invocation check. This is + // determined by comparing the parameter_correctness_score to the + // threshold. If the score is equal to or above the threshold, the outcome + // will be PASS. Otherwise, the outcome will be FAIL. + Outcome outcome = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A free text explanation for the tool invocation result. + string explanation = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The result of the expectation. + oneof result { + // Output only. The result of the tool call expectation. + ToolCall observed_tool_call = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The result of the tool response expectation. + ToolResponse observed_tool_response = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The result of the agent response expectation. + Message observed_agent_response = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The result of the agent transfer expectation. + AgentTransfer observed_agent_transfer = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The expectation that was evaluated. + Evaluation.GoldenExpectation expectation = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The outcome of the expectation. + Outcome outcome = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The result of the semantic similarity check. + SemanticSimilarityResult semantic_similarity_result = 7 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The result of the tool invocation check. + ToolInvocationResult tool_invocation_result = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The result of a single evaluation expectation. + message EvaluationExpectationResult { + // Output only. The evaluation expectation. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluationExpectations/{evaluation_expectation}` + string evaluation_expectation = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationExpectation" + } + ]; + + // Output only. The prompt that was used for the evaluation. + string prompt = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The outcome of the evaluation expectation. + Outcome outcome = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The explanation for the result. + string explanation = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The result of a golden evaluation. + message GoldenResult { + // The result of running a single turn of the golden conversation. + message TurnReplayResult { + // Output only. The conversation that was generated for this turn. + string conversation = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "ces.googleapis.com/Conversation" + } + ]; + + // Output only. The outcome of each expectation. + repeated GoldenExpectationOutcome expectation_outcome = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The result of the hallucination check. + HallucinationResult hallucination_result = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Deprecated. Use OverallToolInvocationResult instead. + float tool_invocation_score = 4 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The overall tool ordered invocation score for this turn. + // This indicates the overall percent of tools from the expected turn that + // were actually invoked in the expected order. + optional float tool_ordered_invocation_score = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Duration of the turn. + google.protobuf.Duration turn_latency = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The latency of each tool call in the turn. + repeated ToolCallLatency tool_call_latencies = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The result of the semantic similarity check. + SemanticSimilarityResult semantic_similarity_result = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The result of the overall tool invocation check. + OverallToolInvocationResult overall_tool_invocation_result = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Information about the error that occurred during this + // turn. + EvaluationErrorInfo error_info = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The latency of spans in the turn. + repeated SpanLatency span_latencies = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The result of running each turn of the golden conversation. + repeated TurnReplayResult turn_replay_results = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The results of the evaluation expectations. + repeated EvaluationExpectationResult evaluation_expectation_results = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The outcome of the evaluation against the rubric. + message ScenarioRubricOutcome { + // Output only. The rubric that was used to evaluate the conversation. + string rubric = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The score of the conversation against the rubric. + optional float score = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The rater's response to the rubric. + string score_explanation = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The outcome of a scenario expectation. + message ScenarioExpectationOutcome { + // The observed tool call and response. + message ObservedToolCall { + // Output only. The observed tool call. + ToolCall tool_call = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The observed tool response. + ToolResponse tool_response = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The result of the expectation. + oneof result { + // Output only. The observed tool call. + ObservedToolCall observed_tool_call = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The observed agent response. + Message observed_agent_response = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The expectation that was evaluated. + Evaluation.ScenarioExpectation expectation = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The outcome of the ScenarioExpectation. + Outcome outcome = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The outcome of a scenario evaluation. + message ScenarioResult { + // Output only. The conversation that was generated in the scenario. + string conversation = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "ces.googleapis.com/Conversation" + } + ]; + + // Output only. The task that was used when running the scenario for this + // result. + string task = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user facts that were used by the scenario for this + // result. + repeated Evaluation.Scenario.UserFact user_facts = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The outcome of each expectation. + repeated ScenarioExpectationOutcome expectation_outcomes = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The outcome of the rubric. + repeated ScenarioRubricOutcome rubric_outcomes = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The result of the hallucination check. + // There will be one hallucination result for each turn in the conversation. + repeated HallucinationResult hallucination_result = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The result of the task completion check. + TaskCompletionResult task_completion_result = 5 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The latency of each tool call execution in the conversation. + repeated ToolCallLatency tool_call_latencies = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The result of the user goal satisfaction check. + UserGoalSatisfactionResult user_goal_satisfaction_result = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether all expectations were satisfied for this turn. + optional bool all_expectations_satisfied = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether the task was completed for this turn. This is a + // composite of all expectations satisfied, no hallucinations, and user goal + // satisfaction. + optional bool task_completed = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The latency of spans in the conversation. + repeated SpanLatency span_latencies = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The results of the evaluation expectations. + repeated EvaluationExpectationResult evaluation_expectation_results = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The latency of a span execution. + message SpanLatency { + // The type of span. + // Additional values may be added in the future. + enum Type { + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // Tool call span. + TOOL = 1; + + // User callback span. + USER_CALLBACK = 2; + + // Guardrail span. + GUARDRAIL = 3; + + // LLM span. + LLM = 4; + } + + // The identifier of the specific item based on its type. + oneof identifier { + // Output only. The resource name of the guardrail or tool spans. + string resource = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The toolset tool identifier. + ToolsetTool toolset = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the LLM span. + string model = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the user callback span. + string callback = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The type of span. + Type type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The display name of the span. Applicable to tool and + // guardrail spans. + string display_name = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The start time of span. + google.protobuf.Timestamp start_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The end time of span. + google.protobuf.Timestamp end_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The latency of span. + google.protobuf.Duration execution_latency = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The latency of a tool call execution. + message ToolCallLatency { + // Output only. The name of the tool that got executed. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`. + string tool = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } + ]; + + // Output only. The display name of the tool. + string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The start time of the tool call execution. + google.protobuf.Timestamp start_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The end time of the tool call execution. + google.protobuf.Timestamp end_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The latency of the tool call execution. + google.protobuf.Duration execution_latency = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The result of the hallucination check for a single turn. + message HallucinationResult { + // Output only. The hallucination score. Can be -1, 0, 1. + optional int32 score = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The label associated with each score. + // Score 1: Justified + // Score 0: Not Justified + // Score -1: No Claim To Assess + string label = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The explanation for the hallucination score. + string explanation = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The result of a user goal satisfaction check for a conversation. + message UserGoalSatisfactionResult { + // Output only. The user task satisfaction score. Can be -1, 0, 1. + optional int32 score = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The label associated with each score. + // Score 1: User Task Satisfied + // Score 0: User Task Not Satisfied + // Score -1: User Task Unspecified + string label = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The explanation for the user task satisfaction score. + string explanation = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The result of the semantic similarity check. + message SemanticSimilarityResult { + // Output only. The semantic similarity score. Can be 0, 1, 2, 3, or 4. + optional int32 score = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The label associated with each score. + // Score 4: Fully Consistent + // Score 3: Mostly Consistent + // Score 2: Partially Consistent (Minor Omissions) + // Score 1: Largely Inconsistent (Major Omissions) + // Score 0: Completely Inconsistent / Contradictory + string label = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The explanation for the semantic similarity score. + string explanation = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The outcome of the semantic similarity check. This is + // determined by comparing the score to the + // semantic_similarity_success_threshold. If the score is equal to or above + // the threshold, the outcome will be PASS. Otherwise, the outcome will be + // FAIL. + Outcome outcome = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The result of the overall tool invocation check. + message OverallToolInvocationResult { + // The overall tool invocation score for this turn. This indicates the + // overall percent of tools from the expected turn that were actually + // invoked. + optional float tool_invocation_score = 1; + + // Output only. The outcome of the tool invocation check. This is determined + // by comparing the tool_invocation_score to the + // overall_tool_invocation_correctness_threshold. If the + // score is equal to or above the threshold, the outcome will be PASS. + // Otherwise, the outcome will be FAIL. + Outcome outcome = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The result of the task completion check for the conversation. + message TaskCompletionResult { + // Output only. The task completion score. Can be -1, 0, 1 + optional int32 score = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The label associated with each score. + // Score 1: Task Completed + // Score 0: Task Not Completed + // Score -1: User Goal Undefined + string label = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The explanation for the task completion score. + string explanation = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The outcome of the evaluation or expectation. + enum Outcome { + // Evaluation outcome is not specified. + OUTCOME_UNSPECIFIED = 0; + + // Evaluation/Expectation passed. In the case of an evaluation, this means + // that all expectations were met. + PASS = 1; + + // Evaluation/Expectation failed. In the case of an evaluation, this means + // that at least one expectation was not met. + FAIL = 2; + } + + // The state of the evaluation result execution. + enum ExecutionState { + // Evaluation result execution state is not specified. + EXECUTION_STATE_UNSPECIFIED = 0; + + // Evaluation result execution is running. + RUNNING = 1; + + // Evaluation result execution has completed. + COMPLETED = 2; + + // Evaluation result execution failed due to an internal error. + ERROR = 3; + } + + // The result of the evaluation. Only populated when the execution_state is + // COMPLETED. + oneof result { + // Output only. The outcome of a golden evaluation. + GoldenResult golden_result = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The outcome of a scenario evaluation. + ScenarioResult scenario_result = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Identifier. The unique identifier of the evaluation result. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}/results/{result}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Display name of the Evaluation Result. Unique within an + // Evaluation. By default, it has the following format: + // " result + // - ". + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Timestamp when the evaluation result was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The outcome of the evaluation. Only populated if + // execution_state is COMPLETE. + Outcome evaluation_status = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The evaluation run that produced this result. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluationRuns/{evaluationRun}` + string evaluation_run = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationRun" + } + ]; + + // Output only. The persona used to generate the conversation for the + // evaluation result. + EvaluationPersona persona = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Error information for the evaluation result. + EvaluationErrorInfo error_info = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Deprecated: Use `error_info` instead. Errors encountered + // during execution. + google.rpc.Status error = 14 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user who initiated the evaluation run that resulted in + // this result. + string initiated_by = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The app version used to generate the conversation that + // resulted in this result. Format: + // `projects/{project}/locations/{location}/apps/{app}/versions/{version}` + string app_version = 10 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "ces.googleapis.com/AppVersion" } + ]; + + // Output only. The display name of the `app_version` that the evaluation ran + // against. + string app_version_display_name = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The changelog of the app version that the evaluation ran + // against. This is populated if user runs evaluation on latest/draft. + string changelog = 21 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "ces.googleapis.com/Changelog" } + ]; + + // Output only. The create time of the changelog of the app version that the + // evaluation ran against. This is populated if user runs evaluation on + // latest/draft. + google.protobuf.Timestamp changelog_create_time = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of the evaluation result execution. + ExecutionState execution_state = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The evaluation thresholds for the result. + EvaluationMetricsThresholds evaluation_metrics_thresholds = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The configuration used in the evaluation run that resulted in + // this result. + EvaluationConfig config = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The method used to run the golden evaluation. + GoldenRunMethod golden_run_method = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// An evaluation run represents an all the evaluation results from an +// evaluation execution. +message EvaluationRun { + option (google.api.resource) = { + type: "ces.googleapis.com/EvaluationRun" + pattern: "projects/{project}/locations/{location}/apps/{app}/evaluationRuns/{evaluation_run}" + plural: "evaluationRuns" + singular: "evaluationRun" + }; + + // The progress of the evaluation run. + message Progress { + // Output only. Total number of evaluation results in this run. + int32 total_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of completed evaluation results with an outcome of + // FAIL. (EvaluationResult.execution_state is COMPLETED and + // EvaluationResult.evaluation_status is FAIL). + int32 failed_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of evaluation results that failed to execute. + // (EvaluationResult.execution_state is ERROR). + int32 error_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of evaluation results that finished successfully. + // (EvaluationResult.execution_state is COMPLETED). + int32 completed_count = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of completed evaluation results with an outcome of + // PASS. (EvaluationResult.execution_state is COMPLETED and + // EvaluationResult.evaluation_status is PASS). + int32 passed_count = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Contains the summary of passed and failed result counts for a specific + // evaluation in an evaluation run. + message EvaluationRunSummary { + // Output only. Number of passed results for the associated Evaluation in + // this run. + int32 passed_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of failed results for the associated Evaluation in + // this run. + int32 failed_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of error results for the associated Evaluation in + // this run. + int32 error_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The type of the evaluations in this run. + // Additional values may be added in the future. + enum EvaluationType { + // Evaluation type is not specified. + EVALUATION_TYPE_UNSPECIFIED = 0; + + // Golden evaluation. + GOLDEN = 1; + + // Scenario evaluation. + SCENARIO = 2; + + // Indicates the run includes a mix of golden and scenario evaluations. + MIXED = 3; + } + + // The state of the evaluation run. + enum EvaluationRunState { + // Evaluation run state is not specified. + EVALUATION_RUN_STATE_UNSPECIFIED = 0; + + // Evaluation run is running. + RUNNING = 1; + + // Evaluation run has completed. + COMPLETED = 2; + + // The evaluation run has an error. + ERROR = 3; + } + + // Identifier. The unique identifier of the evaluation run. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluationRuns/{evaluationRun}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. User-defined display name of the evaluation run. + // default: " run - ". + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The evaluation results that are part of this run. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}/results/{result}` + repeated string evaluation_results = 3 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationResult" + } + ]; + + // Output only. Timestamp when the evaluation run was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user who initiated the evaluation run. + string initiated_by = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The app version to evaluate. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/versions/{version}` + string app_version = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "ces.googleapis.com/AppVersion" } + ]; + + // Output only. The display name of the `app_version` that the evaluation ran + // against. + string app_version_display_name = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The changelog of the app version that the evaluation ran + // against. This is populated if user runs evaluation on latest/draft. + string changelog = 22 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "ces.googleapis.com/Changelog" } + ]; + + // Output only. The create time of the changelog of the app version that the + // evaluation ran against. This is populated if user runs evaluation on + // latest/draft. + google.protobuf.Timestamp changelog_create_time = 23 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The evaluations that are part of this run. The list may + // contain evaluations of either type. This field is mutually exclusive with + // `evaluation_dataset`. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}` + repeated string evaluations = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "ces.googleapis.com/Evaluation" } + ]; + + // Output only. The evaluation dataset that this run is associated with. This + // field is mutually exclusive with `evaluations`. Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluationDatasets/{evaluationDataset}` + string evaluation_dataset = 8 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationDataset" + } + ]; + + // Output only. The type of the evaluations in this run. + EvaluationType evaluation_type = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of the evaluation run. + EvaluationRunState state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The progress of the evaluation run. + Progress progress = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The configuration used in the run. + EvaluationConfig config = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Deprecated: Use error_info instead. Errors encountered during + // execution. + google.rpc.Status error = 14 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Error information for the evaluation run. + EvaluationErrorInfo error_info = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Map of evaluation name to EvaluationRunSummary. + map evaluation_run_summaries = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Latency report for the evaluation run. + LatencyReport latency_report = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of times the evaluations inside the run were run. + int32 run_count = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The configuration to use for the run per persona. + repeated PersonaRunConfig persona_run_configs = 18 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Configuration for running the optimization step after the + // evaluation run. If not set, the optimization step will not be run. + OptimizationConfig optimization_config = 19 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The scheduled evaluation run resource name that created this + // evaluation run. This field is only set if the evaluation run was created + // by a scheduled evaluation run. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/scheduledEvaluationRuns/{scheduled_evaluation_run}` + string scheduled_evaluation_run = 20 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "ces.googleapis.com/ScheduledEvaluationRun" + } + ]; + + // Output only. The method used to run the evaluation. + GoldenRunMethod golden_run_method = 21 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Latency report for the evaluation run. +message LatencyReport { + // Latency metrics for a component. + message LatencyMetrics { + // Output only. The 50th percentile latency. + google.protobuf.Duration p50_latency = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The 90th percentile latency. + google.protobuf.Duration p90_latency = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The 99th percentile latency. + google.protobuf.Duration p99_latency = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of times the resource was called. + int32 call_count = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Latency metrics for a single tool. + message ToolLatency { + // The identifier of the tool. + oneof tool_identifier { + // Output only. Format: + // `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`. + string tool = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } + ]; + + // Output only. The toolset tool identifier. + ToolsetTool toolset_tool = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The display name of the tool. + string tool_display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The latency metrics for the tool. + LatencyMetrics latency_metrics = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Latency metrics for a single callback. + message CallbackLatency { + // Output only. The stage of the callback. + string stage = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The latency metrics for the callback. + LatencyMetrics latency_metrics = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Latency metrics for a single guardrail. + message GuardrailLatency { + // Output only. The name of the guardrail. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}`. + string guardrail = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "ces.googleapis.com/Guardrail" } + ]; + + // Output only. The display name of the guardrail. + string guardrail_display_name = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The latency metrics for the guardrail. + LatencyMetrics latency_metrics = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Latency metrics for a single LLM call. + message LlmCallLatency { + // Output only. The name of the model. + string model = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The latency metrics for the LLM call. + LatencyMetrics latency_metrics = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Unordered list. Latency metrics for each tool. + repeated ToolLatency tool_latencies = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = UNORDERED_LIST + ]; + + // Output only. Unordered list. Latency metrics for each callback. + repeated CallbackLatency callback_latencies = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = UNORDERED_LIST + ]; + + // Output only. Unordered list. Latency metrics for each guardrail. + repeated GuardrailLatency guardrail_latencies = 3 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = UNORDERED_LIST + ]; + + // Output only. Unordered list. Latency metrics for each LLM call. + repeated LlmCallLatency llm_call_latencies = 4 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = UNORDERED_LIST + ]; + + // Output only. The total number of sessions considered in the latency report. + int32 session_count = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// An evaluation expectation represents a specific criteria to evaluate against. +message EvaluationExpectation { + option (google.api.resource) = { + type: "ces.googleapis.com/EvaluationExpectation" + pattern: "projects/{project}/locations/{location}/apps/{app}/evaluationExpectations/{evaluation_expectation}" + plural: "evaluationExpectations" + singular: "evaluationExpectation" + }; + + // Configuration for LLM-based evaluation criteria. + message LlmCriteria { + // Required. The prompt/instructions provided to the LLM judge. + string prompt = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The definition of the criteria used for evaluation. + oneof criteria { + // Optional. Evaluation criteria based on an LLM prompt. + LlmCriteria llm_criteria = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Identifier. The unique identifier of this evaluation expectation. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluationExpectations/{evaluation_expectation}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. User-defined display name. Must be unique within the app. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. User-defined tags for expectations. Can be used to filter + // expectations. + repeated string tags = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when the evaluation expectation was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the evaluation expectation was last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Etag used to ensure the object hasn't changed during a + // read-modify-write operation. If the etag is empty, the update will + // overwrite any concurrent changes. + string etag = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// EvaluationConfig configures settings for running the evaluation. +message EvaluationConfig { + // The channel to evaluate. + enum EvaluationChannel { + // Unspecified evaluation channel. + EVALUATION_CHANNEL_UNSPECIFIED = 0; + + // Text-only evaluation channel. + TEXT = 1; + + // Audio evaluation channel. + AUDIO = 2; + } + + // Optional. Configuration for processing the input audio. + InputAudioConfig input_audio_config = 1 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for generating the output audio. + OutputAudioConfig output_audio_config = 2 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. The channel to evaluate. + EvaluationChannel evaluation_channel = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether the evaluation should use real tool calls or + // fake tools. + EvaluationToolCallBehaviour tool_call_behaviour = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Information about an error encountered during an evaluation execution. +message EvaluationErrorInfo { + // The type of error + enum ErrorType { + // Unspecified error type. + ERROR_TYPE_UNSPECIFIED = 0; + + // Failure during runtime execution. + RUNTIME_FAILURE = 1; + + // Failure to retrieve conversation from CES Runtime. + CONVERSATION_RETRIEVAL_FAILURE = 2; + + // Failure to calculate a metric / outcome. + METRIC_CALCULATION_FAILURE = 3; + + // Failure to update the evaluation. + EVALUATION_UPDATE_FAILURE = 4; + + // Ran out of quota. + QUOTA_EXHAUSTED = 5; + + // Failure during user simulation. + USER_SIMULATION_FAILURE = 6; + } + + // Output only. The type of error. + ErrorType error_type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error message. + string error_message = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The session ID for the conversation that caused the error. + string session_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for +// [EvaluationService.RunEvaluation][google.cloud.ces.v1beta.EvaluationService.RunEvaluation]. +message RunEvaluationRequest { + // Required. The app to evaluate. + // Format: + // `projects/{project}/locations/{location}/apps/{app}` + string app = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; + + // Optional. List of evaluations to run. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}` + repeated string evaluations = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Evaluation" } + ]; + + // Optional. An evaluation dataset to run. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluationDatasets/{evaluationDataset}` + string evaluation_dataset = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationDataset" + } + ]; + + // Optional. The display name of the evaluation run. + string display_name = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The app version to evaluate. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/versions/{version}` + string app_version = 6 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/AppVersion" } + ]; + + // Optional. The configuration to use for the run. + EvaluationConfig config = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of times to run the evaluation. If not set, the + // default value is 1 per golden, and 5 per scenario. + optional int32 run_count = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration to use for the run per persona. + repeated PersonaRunConfig persona_run_configs = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for running the optimization step after the + // evaluation run. If not set, the optimization step will not be run. + OptimizationConfig optimization_config = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The resource name of the `ScheduledEvaluationRun` that is + // triggering this evaluation run. + // + // If this field is set, the `scheduled_evaluation_run` field on the created + // `EvaluationRun` resource will be populated from this value. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/scheduledEvaluationRuns/{scheduled_evaluation_run}` + string scheduled_evaluation_run = 12 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "ces.googleapis.com/ScheduledEvaluationRun" + } + ]; + + // Optional. The method to run the evaluation if it is a golden evaluation. If + // not set, default to STABLE. + GoldenRunMethod golden_run_method = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to generate a latency report for the evaluation run. + bool generate_latency_report = 14 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents a scheduled evaluation run configuration. +message ScheduledEvaluationRun { + option (google.api.resource) = { + type: "ces.googleapis.com/ScheduledEvaluationRun" + pattern: "projects/{project}/locations/{location}/apps/{app}/scheduledEvaluationRuns/{scheduled_evaluation_run}" + plural: "scheduledEvaluationRuns" + singular: "scheduledEvaluationRun" + }; + + // Eval scheduling configuration details + message SchedulingConfig { + // The frequencies evals can be run at + enum Frequency { + // The frequency is unspecified. + FREQUENCY_UNSPECIFIED = 0; + + // Indicates a one-time scheduled run that should not repeat + NONE = 1; + + // Run the evaluation daily. + DAILY = 2; + + // Run the evaluation weekly. + WEEKLY = 3; + + // Run the evaluation biweekly. + BIWEEKLY = 4; + } + + // Required. The frequency with which to run the eval + Frequency frequency = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Timestamp when the eval should start. + google.protobuf.Timestamp start_time = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The days of the week to run the eval. Applicable only for + // Weekly and Biweekly frequencies. 1 is Monday, 2 is Tuesday, ..., 7 is + // Sunday. + repeated int32 days_of_week = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Identifier. The unique identifier of the scheduled evaluation run config. + // Format: + // projects/{projectId}/locations/{locationId}/apps/{appId}/scheduledEvaluationRuns/{scheduledEvaluationRunId} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. User-defined display name of the scheduled evaluation run config. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The RunEvaluationRequest to schedule + RunEvaluationRequest request = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. User-defined description of the scheduled evaluation run. + string description = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Configuration for the timing and frequency with which to execute + // the evaluations. + SchedulingConfig scheduling_config = 5 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Whether this config is active + bool active = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The last successful EvaluationRun of this scheduled execution. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluationRuns/{evaluationRun}` + string last_completed_run = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationRun" + } + ]; + + // Output only. The total number of times this run has been executed + int32 total_executions = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The next time this is scheduled to execute + google.protobuf.Timestamp next_scheduled_execution_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the scheduled evaluation run was created. + google.protobuf.Timestamp create_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user who created the scheduled evaluation run. + string created_by = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the evaluation was last updated. + google.protobuf.Timestamp update_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user who last updated the evaluation. + string last_updated_by = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Etag used to ensure the object hasn't changed during a + // read-modify-write operation. If the etag is empty, the update will + // overwrite any concurrent changes. + string etag = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Configuration for running an evaluation for a specific persona. +message PersonaRunConfig { + // Optional. The persona to use for the evaluation. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluationPersonas/{evaluationPersona}` + string persona = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of tasks to run for the persona. + int32 task_count = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for running the optimization step after the evaluation run. +message OptimizationConfig { + // The status of the optimization run. + enum OptimizationStatus { + // Optimization status is not specified. + OPTIMIZATION_STATUS_UNSPECIFIED = 0; + + // Optimization is running. + RUNNING = 1; + + // Optimization has completed. + COMPLETED = 2; + + // Optimization failed due to an internal error. + ERROR = 3; + } + + // Optional. Whether to generate a loss report. + bool generate_loss_report = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The assistant session to use for the optimization based on + // this evaluation run. Format: + // `projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistantSession}` + string assistant_session = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The summary of the loss report. + string report_summary = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether to suggest a fix for the losses. + bool should_suggest_fix = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The status of the optimization run. + OptimizationStatus status = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error message if the optimization run failed. + string error_message = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The generated loss report. + google.protobuf.Struct loss_report = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/evaluation_service.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/evaluation_service.proto new file mode 100644 index 00000000000..972ba47201e --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/evaluation_service.proto @@ -0,0 +1,1192 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.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/ces/v1beta/conversation.proto"; +import "google/cloud/ces/v1beta/evaluation.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"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "EvaluationServiceProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// EvaluationService exposes methods to perform evaluation for the CES app. +service EvaluationService { + option (google.api.default_host) = "ces.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/ces," + "https://www.googleapis.com/auth/cloud-platform"; + + // Runs an evaluation of the app. + rpc RunEvaluation(RunEvaluationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{app=projects/*/locations/*/apps/*}:runEvaluation" + body: "*" + }; + option (google.api.method_signature) = "app"; + option (google.longrunning.operation_info) = { + response_type: "RunEvaluationResponse" + metadata_type: "RunEvaluationOperationMetadata" + }; + } + + // Uploads audio for use in Golden Evaluations. Stores the audio in the Cloud + // Storage bucket defined in + // 'App.logging_settings.evaluation_audio_recording_config.gcs_bucket' and + // returns a transcript. + rpc UploadEvaluationAudio(UploadEvaluationAudioRequest) + returns (UploadEvaluationAudioResponse) { + option (google.api.http) = { + post: "/v1beta/{app=projects/*/locations/*/apps/*}:uploadEvaluationAudio" + body: "*" + }; + option (google.api.method_signature) = "app,audio_content"; + } + + // Creates an evaluation. + rpc CreateEvaluation(CreateEvaluationRequest) returns (Evaluation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluations" + body: "evaluation" + }; + option (google.api.method_signature) = "parent,evaluation,evaluation_id"; + option (google.api.method_signature) = "parent,evaluation"; + } + + // Creates a golden evaluation from a conversation. + rpc GenerateEvaluation(GenerateEvaluationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{conversation=projects/*/locations/*/apps/*/conversations/*}:generateEvaluation" + body: "*" + }; + option (google.api.method_signature) = "conversation"; + option (google.longrunning.operation_info) = { + response_type: "Evaluation" + metadata_type: "GenerateEvaluationOperationMetadata" + }; + } + + // Imports evaluations into the app. + rpc ImportEvaluations(ImportEvaluationsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/apps/*}:importEvaluations" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "ImportEvaluationsResponse" + metadata_type: "ImportEvaluationsOperationMetadata" + }; + } + + // Creates an evaluation dataset. + rpc CreateEvaluationDataset(CreateEvaluationDatasetRequest) + returns (EvaluationDataset) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationDatasets" + body: "evaluation_dataset" + }; + option (google.api.method_signature) = + "parent,evaluation_dataset,evaluation_dataset_id"; + option (google.api.method_signature) = "parent,evaluation_dataset"; + } + + // Updates an evaluation. + rpc UpdateEvaluation(UpdateEvaluationRequest) returns (Evaluation) { + option (google.api.http) = { + patch: "/v1beta/{evaluation.name=projects/*/locations/*/apps/*/evaluations/*}" + body: "evaluation" + }; + option (google.api.method_signature) = "evaluation,update_mask"; + } + + // Updates an evaluation dataset. + rpc UpdateEvaluationDataset(UpdateEvaluationDatasetRequest) + returns (EvaluationDataset) { + option (google.api.http) = { + patch: "/v1beta/{evaluation_dataset.name=projects/*/locations/*/apps/*/evaluationDatasets/*}" + body: "evaluation_dataset" + }; + option (google.api.method_signature) = "evaluation_dataset,update_mask"; + } + + // Deletes an evaluation. + rpc DeleteEvaluation(DeleteEvaluationRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes an evaluation result. + rpc DeleteEvaluationResult(DeleteEvaluationResultRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*/results/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes an evaluation dataset. + rpc DeleteEvaluationDataset(DeleteEvaluationDatasetRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/apps/*/evaluationDatasets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes an evaluation run. + rpc DeleteEvaluationRun(DeleteEvaluationRunRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/apps/*/evaluationRuns/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteEvaluationRunOperationMetadata" + }; + } + + // Gets details of the specified evaluation. + rpc GetEvaluation(GetEvaluationRequest) returns (Evaluation) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets details of the specified evaluation result. + rpc GetEvaluationResult(GetEvaluationResultRequest) + returns (EvaluationResult) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*/results/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets details of the specified evaluation dataset. + rpc GetEvaluationDataset(GetEvaluationDatasetRequest) + returns (EvaluationDataset) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/apps/*/evaluationDatasets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets details of the specified evaluation run. + rpc GetEvaluationRun(GetEvaluationRunRequest) returns (EvaluationRun) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/apps/*/evaluationRuns/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all evaluations in the given app. + rpc ListEvaluations(ListEvaluationsRequest) + returns (ListEvaluationsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluations" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all evaluation results for a given evaluation. + rpc ListEvaluationResults(ListEvaluationResultsRequest) + returns (ListEvaluationResultsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/apps/*/evaluations/*}/results" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all evaluation datasets in the given app. + rpc ListEvaluationDatasets(ListEvaluationDatasetsRequest) + returns (ListEvaluationDatasetsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationDatasets" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all evaluation runs in the given app. + rpc ListEvaluationRuns(ListEvaluationRunsRequest) + returns (ListEvaluationRunsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationRuns" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all evaluation expectations in the given app. + rpc ListEvaluationExpectations(ListEvaluationExpectationsRequest) + returns (ListEvaluationExpectationsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationExpectations" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of the specified evaluation expectation. + rpc GetEvaluationExpectation(GetEvaluationExpectationRequest) + returns (EvaluationExpectation) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/apps/*/evaluationExpectations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an evaluation expectation. + rpc CreateEvaluationExpectation(CreateEvaluationExpectationRequest) + returns (EvaluationExpectation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationExpectations" + body: "evaluation_expectation" + }; + option (google.api.method_signature) = + "parent,evaluation_expectation,evaluation_expectation_id"; + option (google.api.method_signature) = "parent,evaluation_expectation"; + } + + // Updates an evaluation expectation. + rpc UpdateEvaluationExpectation(UpdateEvaluationExpectationRequest) + returns (EvaluationExpectation) { + option (google.api.http) = { + patch: "/v1beta/{evaluation_expectation.name=projects/*/locations/*/apps/*/evaluationExpectations/*}" + body: "evaluation_expectation" + }; + option (google.api.method_signature) = "evaluation_expectation,update_mask"; + } + + // Deletes an evaluation expectation. + rpc DeleteEvaluationExpectation(DeleteEvaluationExpectationRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/apps/*/evaluationExpectations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a scheduled evaluation run. + rpc CreateScheduledEvaluationRun(CreateScheduledEvaluationRunRequest) + returns (ScheduledEvaluationRun) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/apps/*}/scheduledEvaluationRuns" + body: "scheduled_evaluation_run" + }; + option (google.api.method_signature) = + "parent,scheduled_evaluation_run,scheduled_evaluation_run_id"; + option (google.api.method_signature) = "parent,scheduled_evaluation_run"; + } + + // Gets details of the specified scheduled evaluation run. + rpc GetScheduledEvaluationRun(GetScheduledEvaluationRunRequest) + returns (ScheduledEvaluationRun) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all scheduled evaluation runs in the given app. + rpc ListScheduledEvaluationRuns(ListScheduledEvaluationRunsRequest) + returns (ListScheduledEvaluationRunsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/apps/*}/scheduledEvaluationRuns" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a scheduled evaluation run. + rpc UpdateScheduledEvaluationRun(UpdateScheduledEvaluationRunRequest) + returns (ScheduledEvaluationRun) { + option (google.api.http) = { + patch: "/v1beta/{scheduled_evaluation_run.name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}" + body: "scheduled_evaluation_run" + }; + option (google.api.method_signature) = + "scheduled_evaluation_run,update_mask"; + } + + // Deletes a scheduled evaluation run. + rpc DeleteScheduledEvaluationRun(DeleteScheduledEvaluationRunRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Tests the voice of a persona. Also accepts a default persona. + rpc TestPersonaVoice(TestPersonaVoiceRequest) + returns (TestPersonaVoiceResponse) { + option (google.api.http) = { + post: "/v1beta/{app=projects/*/locations/*/apps/*}:testPersonaVoice" + body: "*" + }; + option (google.api.method_signature) = "app"; + } +} + +// Response message for +// [EvaluationService.RunEvaluation][google.cloud.ces.v1beta.EvaluationService.RunEvaluation]. +message RunEvaluationResponse { + // The name of the evaluation run that was created. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluationRuns/{evaluation_run}` + string evaluation_run = 1 [(google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationRun" + }]; +} + +// Operation metadata for +// [EvaluationService.RunEvaluation][google.cloud.ces.v1beta.EvaluationService.RunEvaluation] +message RunEvaluationOperationMetadata { + // Output only. The list of evaluations that were run. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}` + repeated string evaluations = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "ces.googleapis.com/Evaluation" } + ]; + + // Output only. The evaluation run that was created. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/evaluationRuns/{evaluation_run}` + string evaluation_run = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationRun" + } + ]; + + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation completed. + google.protobuf.Timestamp end_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The verb of the operation. + string verb = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation of the + // operation. Operations that have been cancelled successfully have + // [google.longrunning.Operation.error][google.longrunning.Operation.error] + // value with a [google.rpc.Status.code][google.rpc.Status.code] of `1`, + // corresponding to `Code.CANCELLED`. + bool cancel_requested = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Operation metadata for +// [EvaluationService.GenerateEvaluation][google.cloud.ces.v1beta.EvaluationService.GenerateEvaluation]. +message GenerateEvaluationOperationMetadata {} + +// Operation metadata for +// [EvaluationService.DeleteEvaluationRun][google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationRun]. +message DeleteEvaluationRunOperationMetadata {} + +// Request message for +// [EvaluationService.CreateEvaluation][google.cloud.ces.v1beta.EvaluationService.CreateEvaluation]. +message CreateEvaluationRequest { + // Required. The app to create the evaluation for. + // Format: + // `projects/{project}/locations/{location}/apps/{app}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; + + // Optional. The ID to use for the evaluation, which will become the final + // component of the evaluation's resource name. If not provided, a unique ID + // will be automatically assigned for the evaluation. + string evaluation_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The evaluation to create. + Evaluation evaluation = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [EvaluationService.GenerateEvaluation][google.cloud.ces.v1beta.EvaluationService.GenerateEvaluation]. +message GenerateEvaluationRequest { + // Required. The conversation to create the golden evaluation for. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}` + string conversation = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ces.googleapis.com/Conversation" + } + ]; + + // Optional. Indicate the source of the conversation. If not set, all sources + // will be searched. + Conversation.Source source = 2 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [EvaluationService.ImportEvaluations][google.cloud.ces.v1beta.EvaluationService.ImportEvaluations]. +message ImportEvaluationsRequest { + // A list of conversation resource names. + message ConversationList { + // Optional. Conversation resource names. + repeated string conversations = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration options for the evaluation import process. + // These options control how the import behaves, particularly when + // conflicts arise with existing evaluations data. + message ImportOptions { + // Defines the strategy for handling conflicts when an evaluation with the + // same evaluation ID already exists in the app. + enum ConflictResolutionStrategy { + // The conflict resolution strategy is unspecified. + CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED = 0; + + // Overwrite the existing evaluation with the new one. + OVERWRITE = 1; + + // Keep the existing evaluation and skip the new one. + SKIP = 2; + + // Keep the existing evaluation and duplicate the new one as a new + // evaluation. + DUPLICATE = 3; + } + + // Optional. The strategy to use when resolving conflicts during import. + ConflictResolutionStrategy conflict_resolution_strategy = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The source of the evaluations to import from. + oneof source { + // The conversations to import the evaluations from. + ConversationList conversation_list = 2; + + // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + // from which to import evaluations. The format of this URI must be + // `gs:///`. + string gcs_uri = 3; + + // Raw bytes representing the csv file with the evaluations structure. + bytes csv_content = 4; + } + + // Required. The app to import the evaluations into. + // Format: + // `projects/{project}/locations/{location}/apps/{app}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; + + // Optional. Options governing the import process for the evaluations. + ImportOptions import_options = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [EvaluationService.ImportEvaluations][google.cloud.ces.v1beta.EvaluationService.ImportEvaluations]. +message ImportEvaluationsResponse { + // The list of evaluations that were imported into the app. + repeated Evaluation evaluations = 1; + + // Optional. A list of error messages associated with evaluations that failed + // to be imported. + repeated string error_messages = 2 [(google.api.field_behavior) = OPTIONAL]; + + // The number of evaluations that were not imported due to errors. + int32 import_failure_count = 3; +} + +// Represents the metadata of the long-running operation for +// [EvaluationService.ImportEvaluations][google.cloud.ces.v1beta.EvaluationService.ImportEvaluations]. +message ImportEvaluationsOperationMetadata { + // 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. Human-readable status of the operation, if any. + string status_message = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for +// [EvaluationService.CreateEvaluationDataset][google.cloud.ces.v1beta.EvaluationService.CreateEvaluationDataset]. +message CreateEvaluationDatasetRequest { + // Required. The app to create the evaluation for. + // Format: + // `projects/{project}/locations/{location}/apps/{app}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; + + // Optional. The ID to use for the evaluation dataset, which will become the + // final component of the evaluation dataset's resource name. If not provided, + // a unique ID will be automatically assigned for the evaluation. + string evaluation_dataset_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The evaluation dataset to create. + EvaluationDataset evaluation_dataset = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [EvaluationService.UpdateEvaluation][google.cloud.ces.v1beta.EvaluationService.UpdateEvaluation]. +message UpdateEvaluationRequest { + // Required. The evaluation to update. + Evaluation evaluation = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask is used to control which fields get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [EvaluationService.UpdateEvaluationDataset][google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationDataset]. +message UpdateEvaluationDatasetRequest { + // Required. The evaluation dataset to update. + EvaluationDataset evaluation_dataset = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask is used to control which fields get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [EvaluationService.DeleteEvaluation][google.cloud.ces.v1beta.EvaluationService.DeleteEvaluation]. +message DeleteEvaluationRequest { + // Required. The resource name of the evaluation to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Evaluation" } + ]; + + // Optional. Indicates whether to forcefully delete the evaluation, even if it + // is still referenced by evaluation datasets. + // + // * If `force = false`, the deletion will fail if any datasets still + // reference the evaluation. + // * If `force = true`, all existing references from datasets will be removed + // and the evaluation will be deleted. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the evaluation. If an etag is not provided, + // the deletion will overwrite any concurrent changes. If an etag is provided + // and does not match the current etag of the evaluation, deletion will be + // blocked and an ABORTED error will be returned. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [EvaluationService.DeleteEvaluationResult][google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationResult]. +message DeleteEvaluationResultRequest { + // Required. The resource name of the evaluation result to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationResult" + } + ]; +} + +// Request message for +// [EvaluationService.DeleteEvaluationDataset][google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationDataset]. +message DeleteEvaluationDatasetRequest { + // Required. The resource name of the evaluation dataset to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationDataset" + } + ]; + + // Optional. The current etag of the evaluation dataset. If an etag is not + // provided, the deletion will overwrite any concurrent changes. If an etag is + // provided and does not match the current etag of the evaluation dataset, + // deletion will be blocked and an ABORTED error will be returned. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [EvaluationService.DeleteEvaluationRun][google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationRun]. +message DeleteEvaluationRunRequest { + // Required. The resource name of the evaluation run to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationRun" + } + ]; +} + +// Request message for +// [EvaluationService.GetEvaluation][google.cloud.ces.v1beta.EvaluationService.GetEvaluation]. +message GetEvaluationRequest { + // Required. The resource name of the evaluation to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Evaluation" } + ]; +} + +// Request message for +// [EvaluationService.GetEvaluationResult][google.cloud.ces.v1beta.EvaluationService.GetEvaluationResult]. +message GetEvaluationResultRequest { + // Required. The resource name of the evaluation result to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationResult" + } + ]; +} + +// Request message for +// [EvaluationService.GetEvaluationDataset][google.cloud.ces.v1beta.EvaluationService.GetEvaluationDataset]. +message GetEvaluationDatasetRequest { + // Required. The resource name of the evaluation dataset to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationDataset" + } + ]; +} + +// Request message for +// [EvaluationService.GetEvaluationRun][google.cloud.ces.v1beta.EvaluationService.GetEvaluationRun]. +message GetEvaluationRunRequest { + // Required. The resource name of the evaluation run to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationRun" + } + ]; +} + +// Request message for +// [EvaluationService.ListEvaluations][google.cloud.ces.v1beta.EvaluationService.ListEvaluations]. +message ListEvaluationsRequest { + // Required. The resource name of the app to list evaluations from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/Evaluation" + } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1beta.ListEvaluationsResponse.next_page_token] + // value returned from a previous list + // [EvaluationService.ListEvaluations][google.cloud.ces.v1beta.EvaluationService.ListEvaluations] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deprecated: Use evaluation_filter and evaluation_run_filter + // instead. + string filter = 4 [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied on the evaluation when listing the + // evaluations. See https://google.aip.dev/160 for more details. Supported + // fields: evaluation_datasets + string evaluation_filter = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter string for fields on the associated EvaluationRun + // resources. See https://google.aip.dev/160 for more details. Supported + // fields: create_time, initiated_by, app_version_display_name + string evaluation_run_filter = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time", and + // "update_time" are supported. Time fields are ordered in descending order, + // and the name field is ordered in ascending order. If not included, + // "update_time" will be the default. See https://google.aip.dev/132#ordering + // for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to include the last 10 evaluation results for each + // evaluation in the response. + bool last_ten_results = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [EvaluationService.ListEvaluationResults][google.cloud.ces.v1beta.EvaluationService.ListEvaluationResults]. +message ListEvaluationResultsRequest { + // Required. The resource name of the evaluation to list evaluation results + // from. To filter by evaluation run, use `-` as the evaluation ID and specify + // the evaluation run ID in the filter. For example: + // `projects/{project}/locations/{location}/apps/{app}/evaluations/-` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/EvaluationResult" + } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1beta.ListEvaluationResultsResponse.next_page_token] + // value returned from a previous list + // [EvaluationService.ListEvaluationResults][google.cloud.ces.v1beta.EvaluationService.ListEvaluationResults] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the evaluation results. + // See https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time", and + // "update_time" are supported. Time fields are ordered in descending order, + // and the name field is ordered in ascending order. If not included, + // "update_time" will be the default. See https://google.aip.dev/132#ordering + // for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [EvaluationService.ListEvaluationDatasets][google.cloud.ces.v1beta.EvaluationService.ListEvaluationDatasets]. +message ListEvaluationDatasetsRequest { + // Required. The resource name of the app to list evaluation datasets from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/EvaluationDataset" + } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.next_page_token] + // value returned from a previous list + // [EvaluationService.ListEvaluationDatasets][google.cloud.ces.v1beta.EvaluationService.ListEvaluationDatasets] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the evaluation datasets. + // See https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time", and + // "update_time" are supported. Time fields are ordered in descending order, + // and the name field is ordered in ascending order. If not included, + // "update_time" will be the default. See https://google.aip.dev/132#ordering + // for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [EvaluationService.ListEvaluationRuns][google.cloud.ces.v1beta.EvaluationService.ListEvaluationRuns]. +message ListEvaluationRunsRequest { + // Required. The resource name of the app to list evaluation runs from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/EvaluationRun" + } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1beta.ListEvaluationRunsResponse.next_page_token] + // value returned from a previous list + // [EvaluationService.ListEvaluationRuns][google.cloud.ces.v1beta.EvaluationService.ListEvaluationRuns] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the evaluation runs. + // See https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time", and + // "update_time" are supported. Time fields are ordered in descending order, + // and the name field is ordered in ascending order. If not included, + // "update_time" will be the default. See https://google.aip.dev/132#ordering + // for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [EvaluationService.ListEvaluations][google.cloud.ces.v1beta.EvaluationService.ListEvaluations]. +message ListEvaluationsResponse { + // The list of evaluations. + repeated Evaluation evaluations = 1; + + // A token that can be sent as + // [ListEvaluationsRequest.page_token][google.cloud.ces.v1beta.ListEvaluationsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Response message for +// [EvaluationService.ListEvaluationResults][google.cloud.ces.v1beta.EvaluationService.ListEvaluationResults]. +message ListEvaluationResultsResponse { + // The list of evaluation results. + repeated EvaluationResult evaluation_results = 1; + + // A token that can be sent as + // [ListEvaluationResultsRequest.page_token][google.cloud.ces.v1beta.ListEvaluationResultsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Response message for +// [EvaluationService.ListEvaluationDatasets][google.cloud.ces.v1beta.EvaluationService.ListEvaluationDatasets]. +message ListEvaluationDatasetsResponse { + // The list of evaluation datasets. + repeated EvaluationDataset evaluation_datasets = 1; + + // A token that can be sent as + // [ListEvaluationDatasetsRequest.page_token][google.cloud.ces.v1beta.ListEvaluationDatasetsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Response message for +// [EvaluationService.ListEvaluationRuns][google.cloud.ces.v1beta.EvaluationService.ListEvaluationRuns]. +message ListEvaluationRunsResponse { + // The list of evaluation runs. + repeated EvaluationRun evaluation_runs = 1; + + // A token that can be sent as + // [ListEvaluationRunsRequest.page_token][google.cloud.ces.v1beta.ListEvaluationRunsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [EvaluationService.CreateScheduledEvaluationRun][google.cloud.ces.v1beta.EvaluationService.CreateScheduledEvaluationRun]. +message CreateScheduledEvaluationRunRequest { + // Required. The app to create the scheduled evaluation run for. + // Format: + // `projects/{project}/locations/{location}/apps/{app}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; + + // Optional. The ID to use for the scheduled evaluation run, which will become + // the final component of the scheduled evaluation run's resource name. If not + // provided, a unique ID will be automatically assigned. + string scheduled_evaluation_run_id = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The scheduled evaluation run to create. + ScheduledEvaluationRun scheduled_evaluation_run = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [EvaluationService.GetScheduledEvaluationRun][google.cloud.ces.v1beta.EvaluationService.GetScheduledEvaluationRun]. +message GetScheduledEvaluationRunRequest { + // Required. The resource name of the scheduled evaluation run to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ces.googleapis.com/ScheduledEvaluationRun" + } + ]; +} + +// Request message for +// [EvaluationService.ListScheduledEvaluationRuns][google.cloud.ces.v1beta.EvaluationService.ListScheduledEvaluationRuns]. +message ListScheduledEvaluationRunsRequest { + // Required. The resource name of the app to list scheduled evaluation runs + // from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/ScheduledEvaluationRun" + } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.next_page_token] + // value returned from a previous list + // [EvaluationService.ListScheduledEvaluationRuns][google.cloud.ces.v1beta.EvaluationService.ListScheduledEvaluationRuns] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the scheduled evaluation runs. + // See https://google.aip.dev/160 for more details. + // Currently supports filtering by: + // * request.evaluations:evaluation_id + // * request.evaluation_dataset:evaluation_dataset_id + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Supported fields are: + // "name" (ascending), "create_time" (descending), "update_time" (descending), + // "next_scheduled_execution" (ascending), and + // "last_completed_run.create_time" (descending). + // If not included, "update_time" will be the default. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [EvaluationService.ListScheduledEvaluationRuns][google.cloud.ces.v1beta.EvaluationService.ListScheduledEvaluationRuns]. +message ListScheduledEvaluationRunsResponse { + // The list of scheduled evaluation runs. + repeated ScheduledEvaluationRun scheduled_evaluation_runs = 1; + + // A token that can be sent as + // [ListScheduledEvaluationRunsRequest.page_token][google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [EvaluationService.UpdateScheduledEvaluationRun][google.cloud.ces.v1beta.EvaluationService.UpdateScheduledEvaluationRun]. +message UpdateScheduledEvaluationRunRequest { + // Required. The scheduled evaluation run to update. + ScheduledEvaluationRun scheduled_evaluation_run = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask is used to control which fields get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [EvaluationService.DeleteScheduledEvaluationRun][google.cloud.ces.v1beta.EvaluationService.DeleteScheduledEvaluationRun]. +message DeleteScheduledEvaluationRunRequest { + // Required. The resource name of the scheduled evaluation run to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ces.googleapis.com/ScheduledEvaluationRun" + } + ]; + + // Optional. The etag of the ScheduledEvaluationRun. + // If provided, it must match the server's etag. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [EvaluationService.TestPersonaVoice][google.cloud.ces.v1beta.EvaluationService.TestPersonaVoice]. +message TestPersonaVoiceRequest { + // Required. the resource name of the app to test the persona voice for. + // Format: + // `projects/{project}/locations/{location}/apps/{app}` + string app = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; + + // Required. The persona ID to test the voice for. Also accepts "default". + string persona_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The text to test the voice for. + string text = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [EvaluationService.UploadEvaluationAudio][google.cloud.ces.v1beta.EvaluationService.UploadEvaluationAudio]. +message UploadEvaluationAudioRequest { + // Required. The resource name of the App for which to upload the evaluation + // audio. Format: `projects/{project}/locations/{location}/apps/{app}` + string app = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; + + // Required. The raw audio bytes. + // The format of the audio must be single-channel LINEAR16 with a sample + // rate of 16kHz (default InputAudioConfig). + bytes audio_content = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for +// [EvaluationService.UploadEvaluationAudio][google.cloud.ces.v1beta.EvaluationService.UploadEvaluationAudio]. +message UploadEvaluationAudioResponse { + // The Google Cloud Storage URI where the uploaded audio file is stored. + // Format: `gs:///` + string audio_gcs_uri = 1; + + // The transcribed text from the audio, generated by Cloud Speech-to-Text. + string audio_transcript = 2; + + // The duration of the audio. + google.protobuf.Duration audio_duration = 3; +} + +// Response message for +// [EvaluationService.TestPersonaVoice][google.cloud.ces.v1beta.EvaluationService.TestPersonaVoice]. +message TestPersonaVoiceResponse { + // The audio data bytes of the synthesized voice. + bytes audio = 1; +} + +// Request message for +// [EvaluationService.CreateEvaluationExpectation][google.cloud.ces.v1beta.EvaluationService.CreateEvaluationExpectation]. +message CreateEvaluationExpectationRequest { + // Required. The app to create the evaluation expectation for. + // Format: + // `projects/{project}/locations/{location}/apps/{app}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; + + // Optional. The ID to use for the evaluation expectation, which will become + // the final component of the evaluation expectation's resource name. If not + // provided, a unique ID will be automatically assigned for the evaluation + // expectation. + string evaluation_expectation_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The evaluation expectation to create. + EvaluationExpectation evaluation_expectation = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [EvaluationService.UpdateEvaluationExpectation][google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationExpectation]. +message UpdateEvaluationExpectationRequest { + // Required. The evaluation expectation to update. + EvaluationExpectation evaluation_expectation = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask is used to control which fields get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [EvaluationService.DeleteEvaluationExpectation][google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationExpectation]. +message DeleteEvaluationExpectationRequest { + // Required. The resource name of the evaluation expectation to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationExpectation" + } + ]; + + // Optional. The current etag of the evaluation expectation. If an etag is not + // provided, the deletion will overwrite any concurrent changes. If an etag is + // provided and does not match the current etag of the evaluation expectation, + // deletion will be blocked and an ABORTED error will be returned. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [EvaluationService.GetEvaluationExpectation][google.cloud.ces.v1beta.EvaluationService.GetEvaluationExpectation]. +message GetEvaluationExpectationRequest { + // Required. The resource name of the evaluation expectation to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationExpectation" + } + ]; +} + +// Request message for +// [EvaluationService.ListEvaluationExpectations][google.cloud.ces.v1beta.EvaluationService.ListEvaluationExpectations]. +message ListEvaluationExpectationsRequest { + // Required. The resource name of the app to list evaluation expectations + // from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "ces.googleapis.com/EvaluationExpectation" + } + ]; + + // 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. The + // [next_page_token][google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.next_page_token] + // value returned from a previous list + // [EvaluationService.ListEvaluationExpectations][google.cloud.ces.v1beta.EvaluationService.ListEvaluationExpectations] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied when listing the evaluation expectations. + // See https://google.aip.dev/160 for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. Only "name" and "create_time", and + // "update_time" are supported. Time fields are ordered in descending order, + // and the name field is ordered in ascending order. If not included, + // "update_time" will be the default. See https://google.aip.dev/132#ordering + // for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [EvaluationService.ListEvaluationExpectations][google.cloud.ces.v1beta.EvaluationService.ListEvaluationExpectations]. +message ListEvaluationExpectationsResponse { + // The list of evaluation expectations. + repeated EvaluationExpectation evaluation_expectations = 1; + + // A token that can be sent as + // [ListEvaluationExpectationsRequest.page_token][google.cloud.ces.v1beta.ListEvaluationExpectationsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/example.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/example.proto new file mode 100644 index 00000000000..5e95514346b --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/example.proto @@ -0,0 +1,229 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1beta/toolset_tool.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ExampleProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// An example represents a sample conversation between the user and the +// agent(s). +message Example { + option (google.api.resource) = { + type: "ces.googleapis.com/Example" + pattern: "projects/{project}/locations/{location}/apps/{app}/examples/{example}" + plural: "examples" + singular: "example" + }; + + // Identifier. The unique identifier of the example. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/examples/{example}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Display name of the example. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Human-readable description of the example. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The agent that initially handles the conversation. If not + // specified, the example represents a conversation that is handled by the + // root agent. Format: + // `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` + string entry_agent = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + + // Optional. The collection of messages that make up the conversation. + repeated Message messages = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when the example was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the example was last updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The example may become invalid if referencing resources are + // deleted. Invalid examples will not be used as few-shot examples. + bool invalid = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Etag used to ensure the object hasn't changed during a read-modify-write + // operation. If the etag is empty, the update will overwrite any concurrent + // changes. + string etag = 9; +} + +// A message within a conversation. +message Message { + // Optional. The role within the conversation, e.g., user, agent. + string role = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Content of the message as a series of chunks. + repeated Chunk chunks = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Timestamp when the message was sent or received. Should not be + // used if the message is part of an + // [example][google.cloud.ces.v1beta.Example]. + google.protobuf.Timestamp event_time = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A chunk of content within a message. +message Chunk { + // Chunk data. + oneof data { + // Optional. Text data. + string text = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Transcript associated with the audio. + string transcript = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Blob data. + Blob blob = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Custom payload data. + google.protobuf.Struct payload = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Image data. + Image image = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Tool execution request. + ToolCall tool_call = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Tool execution response. + ToolResponse tool_response = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Agent transfer event. + AgentTransfer agent_transfer = 4 [(google.api.field_behavior) = OPTIONAL]; + + // A struct represents variables that were updated in the conversation, + // keyed by variable names. + google.protobuf.Struct updated_variables = 8; + + // A struct represents default variables at the start of the conversation, + // keyed by variable names. + google.protobuf.Struct default_variables = 10; + } +} + +// Represents a blob input or output in the conversation. +message Blob { + // Required. The IANA standard MIME type of the source data. + string mime_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Raw bytes of the blob. + bytes data = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents an image input or output in the conversation. +message Image { + // Required. The IANA standard MIME type of the source data. + // Supported image types includes: + // * image/png + // * image/jpeg + // * image/webp + string mime_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Raw bytes of the image. + bytes data = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the client or the agent to execute the specified tool. +message ToolCall { + // The identifier of the tool to execute. It could be either a persisted tool + // or a tool from a toolset. + oneof tool_identifier { + // Optional. The name of the tool to execute. + // Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` + string tool = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } + ]; + + // Optional. The toolset tool to execute. + ToolsetTool toolset_tool = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The unique identifier of the tool call. If populated, the client + // should return the execution result with the matching ID in + // [ToolResponse][google.cloud.ces.v1beta.ToolResponse.id]. + string id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Display name of the tool. + string display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The input parameters and values for the tool in JSON object + // format. + google.protobuf.Struct args = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The execution result of a specific tool from the client or the agent. +message ToolResponse { + // The identifier of the tool that got executed. It could be either a + // persisted tool or a tool from a toolset. + oneof tool_identifier { + // Optional. The name of the tool to execute. + // Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` + string tool = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } + ]; + + // Optional. The toolset tool that got executed. + ToolsetTool toolset_tool = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The matching ID of the [tool + // call][google.cloud.ces.v1beta.ToolCall] the response is for. + string id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Display name of the tool. + string display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The tool execution result in JSON object format. + // Use "output" key to specify tool response and "error" key to specify + // error details (if any). If "output" and "error" keys are not specified, + // then whole "response" is treated as tool execution result. + google.protobuf.Struct response = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents an event indicating the transfer of a conversation to a different +// agent. +message AgentTransfer { + // Required. The agent to which the conversation is being transferred. The + // agent will handle the conversation from this point forward. Format: + // `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` + string target_agent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + + // Output only. Display name of the agent. + string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/fakes.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/fakes.proto new file mode 100644 index 00000000000..86615ffd7f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/fakes.proto @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.ces.v1beta; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "FakesProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Configures the tool call behaviour for evaluation runs. +enum EvaluationToolCallBehaviour { + // Unspecified tool call behavior. Will default to real tool calls. + EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED = 0; + + // Use real tool calls. + REAL = 1; + + // Use fake tool calls. + FAKE = 2; +} + +// A code block to be executed instead of a real tool call. +message CodeBlock { + // Required. Python code which will be invoked in tool fake mode. + // Expected Python function signature - + // To catch all tool calls: + // def fake_tool_call(tool: Tool, input: dict[str, Any], + // callback_context: CallbackContext) -> Optional[dict[str, Any]]: + // To catch a specific tool call: + // def fake_{tool_id}(tool: Tool, input: dict[str, Any], + // callback_context: CallbackContext) -> Optional[dict[str, Any]]: + // If the function returns None, the real tool will be invoked instead. + string python_code = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Configuration for tool behavior in fake mode. +message ToolFakeConfig { + // The response is either static or it is provided by a python function. + oneof tool_response { + // Optional. Code block which will be executed instead of a real tool call. + CodeBlock code_block = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Whether the tool is using fake mode. + bool enable_fake_mode = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/file_search_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/file_search_tool.proto new file mode 100644 index 00000000000..3d66c3ef6e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/file_search_tool.proto @@ -0,0 +1,55 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.ces.v1beta; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "FileSearchToolProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// The file search tool allows the agent to search across the files uploaded by +// the app/agent developer. It has presets to give relatively good quality +// search over the uploaded files and summarization of the retrieved results. +message FileSearchTool { + // The type of the Vertex RAG corpus. + enum CorpusType { + // Unspecified corpus type. + CORPUS_TYPE_UNSPECIFIED = 0; + + // The corpus is created and owned by the user. + USER_OWNED = 1; + + // The corpus is created by the agent. + FULLY_MANAGED = 2; + } + + // Optional. The type of the corpus. Default is FULLY_MANAGED. + CorpusType corpus_type = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The tool name. + string name = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The tool description. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The corpus where files are stored. + // Format: + // projects/{project}/locations/{location}/ragCorpora/{rag_corpus} + string file_corpus = 6 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/golden_run.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/golden_run.proto new file mode 100644 index 00000000000..1629629b535 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/golden_run.proto @@ -0,0 +1,36 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "GoldenRunProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// The method used to run the evaluation. +enum GoldenRunMethod { + // Run method is not specified. + GOLDEN_RUN_METHOD_UNSPECIFIED = 0; + + // Run the evaluation as stable replay, where each turn is a unique session + // with the previous expected turns injected as context. + STABLE = 1; + + // Run the evaluation as naive replay, where the run is a single + // session with no context injected. + NAIVE = 2; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/google_search_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/google_search_tool.proto new file mode 100644 index 00000000000..6bb3476e8dc --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/google_search_tool.proto @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "GoogleSearchToolProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Represents a tool to perform Google web searches for grounding. +// See +// https://cloud.google.com/customer-engagement-ai/conversational-agents/ps/tool#google-search. +message GoogleSearchTool { + // Prompt settings used by the model when processing or summarizing the + // google search results. + message PromptConfig { + // Optional. Defines the prompt used for the system instructions when + // interacting with the agent in chat conversations. If not set, default + // prompt will be used. + string text_prompt = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines the prompt used for the system instructions when + // interacting with the agent in voice conversations. If not set, default + // prompt will be used. + string voice_prompt = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The name of the tool. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Description of the tool's purpose. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Content will be fetched directly from these URLs for context and + // grounding. Example: "https://example.com/path.html". A maximum of 20 URLs + // are allowed. + repeated string context_urls = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies domains to restrict search results to. + // Example: "example.com", "another.site". A maximum of 20 domains can be + // specified. + repeated string preferred_domains = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of domains to be excluded from the search results. + // Example: "example.com". + // A maximum of 2000 domains can be excluded. + repeated string exclude_domains = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Prompt instructions passed to planner on how the search results + // should be processed for text and voice. + PromptConfig prompt_config = 5 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/guardrail.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/guardrail.proto new file mode 100644 index 00000000000..7006b1dc11c --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/guardrail.proto @@ -0,0 +1,311 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1beta/common.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "GuardrailProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Guardrail contains a list of checks and balances to keep the agents safe and +// secure. +message Guardrail { + option (google.api.resource) = { + type: "ces.googleapis.com/Guardrail" + pattern: "projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}" + plural: "guardrails" + singular: "guardrail" + }; + + // Guardrail that bans certain content from being used in the conversation. + message ContentFilter { + // Match type for the content filter. + enum MatchType { + // Match type is not specified. + MATCH_TYPE_UNSPECIFIED = 0; + + // Content is matched for substrings character by character. + SIMPLE_STRING_MATCH = 1; + + // Content only matches if the pattern found in the text is + // surrounded by word delimiters. Banned phrases can also contain word + // delimiters. + WORD_BOUNDARY_STRING_MATCH = 2; + + // Content is matched using regular expression syntax. + REGEXP_MATCH = 3; + } + + // Optional. List of banned phrases. Applies to both user inputs and agent + // responses. + repeated string banned_contents = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of banned phrases. Applies only to user inputs. + repeated string banned_contents_in_user_input = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of banned phrases. Applies only to agent responses. + repeated string banned_contents_in_agent_response = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Match type for the content filter. + MatchType match_type = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If true, diacritics are ignored during matching. + bool disregard_diacritics = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Guardrail that blocks the conversation if the input is considered unsafe + // based on the LLM classification. + message LlmPromptSecurity { + // Configuration for default system security settings. + message DefaultSecuritySettings { + // Output only. The default prompt template used by the system. + // This field is for display purposes to show the user what prompt + // the system uses by default. It is OUTPUT_ONLY. + string default_prompt_template = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Defines the security configuration mode. + // The user must choose one of the following configurations. + oneof security_config { + // Optional. Use the system's predefined default security settings. + // To select this mode, include an empty 'default_settings' message + // in the request. The 'default_prompt_template' field within + // will be populated by the server in the response. + DefaultSecuritySettings default_settings = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Use a user-defined LlmPolicy to configure the security + // guardrail. + LlmPolicy custom_policy = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Determines the behavior when the guardrail encounters an LLM + // error. + // - If true: the guardrail is bypassed. + // - If false (default): the guardrail triggers/blocks. + // + // Note: If a custom policy is provided, this field is ignored in favor + // of the policy's 'fail_open' configuration. + bool fail_open = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Guardrail that blocks the conversation if the LLM response is considered + // violating the policy based on the LLM classification. + message LlmPolicy { + // Defines when to apply the policy check during the conversation. + enum PolicyScope { + // Policy scope is not specified. + POLICY_SCOPE_UNSPECIFIED = 0; + + // Policy check is triggered on user input. + USER_QUERY = 1; + + // Policy check is triggered on agent response. Applying this policy + // scope will introduce additional latency before the agent can respond. + AGENT_RESPONSE = 2; + + // Policy check is triggered on both user input and agent response. + // Applying this policy scope will introduce additional latency before + // the agent can respond. + USER_QUERY_AND_AGENT_RESPONSE = 3; + } + + // Optional. When checking this policy, consider the last 'n' messages in + // the conversation. When not set a default value of 10 will be used. + int32 max_conversation_messages = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Model settings. + ModelSettings model_settings = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Policy prompt. + string prompt = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Defines when to apply the policy check during the conversation. + // If set to `POLICY_SCOPE_UNSPECIFIED`, the policy will be applied to the + // user input. When applying the policy to the agent response, additional + // latency will be introduced before the agent can respond. + PolicyScope policy_scope = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If an error occurs during the policy check, fail open and do + // not trigger the guardrail. + bool fail_open = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. By default, the LLM policy check is bypassed for short + // utterances. Enabling this setting applies the policy check to all + // utterances, including those that would normally be skipped. + bool allow_short_utterance = 6 [(google.api.field_behavior) = OPTIONAL]; + } + + // Model safety settings overrides. When this is set, it will override the + // default settings and trigger the guardrail if the response is considered + // unsafe. + message ModelSafety { + // Safety setting. + message SafetySetting { + // Required. The harm category. + HarmCategory category = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The harm block threshold. + HarmBlockThreshold threshold = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Harm category. + enum HarmCategory { + // The harm category is unspecified. + HARM_CATEGORY_UNSPECIFIED = 0; + + // The harm category is hate speech. + HARM_CATEGORY_HATE_SPEECH = 1; + + // The harm category is dangerous content. + HARM_CATEGORY_DANGEROUS_CONTENT = 2; + + // The harm category is harassment. + HARM_CATEGORY_HARASSMENT = 3; + + // The harm category is sexually explicit content. + HARM_CATEGORY_SEXUALLY_EXPLICIT = 4; + } + + // Probability based thresholds levels for blocking. + enum HarmBlockThreshold { + // Unspecified harm block threshold. + HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0; + + // Block low threshold and above (i.e. block more). + BLOCK_LOW_AND_ABOVE = 1; + + // Block medium threshold and above. + BLOCK_MEDIUM_AND_ABOVE = 2; + + // Block only high threshold (i.e. block less). + BLOCK_ONLY_HIGH = 3; + + // Block none. + BLOCK_NONE = 4; + + // Turn off the safety filter. + OFF = 5; + } + + // Required. List of safety settings. + repeated SafetySetting safety_settings = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // Guardrail that blocks the conversation based on the code callbacks + // provided. + message CodeCallback { + // Optional. The callback to execute before the agent is called. + // Each callback function is expected to return a structure (e.g., a dict or + // object) containing at least: + // - 'decision': Either 'OK' or 'TRIGGER'. + // - 'reason': A string explaining the decision. + // A 'TRIGGER' decision may halt further processing. + Callback before_agent_callback = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The callback to execute after the agent is called. + // Each callback function is expected to return a structure (e.g., a dict or + // object) containing at least: + // - 'decision': Either 'OK' or 'TRIGGER'. + // - 'reason': A string explaining the decision. + // A 'TRIGGER' decision may halt further processing. + Callback after_agent_callback = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The callback to execute before the model is called. If there + // are multiple calls to the model, the callback will be executed multiple + // times. Each callback function is expected to return a structure (e.g., a + // dict or object) containing at least: + // - 'decision': Either 'OK' or 'TRIGGER'. + // - 'reason': A string explaining the decision. + // A 'TRIGGER' decision may halt further processing. + Callback before_model_callback = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The callback to execute after the model is called. If there are + // multiple calls to the model, the callback will be executed multiple + // times. Each callback function is expected to return a structure (e.g., a + // dict or object) containing at least: + // - 'decision': Either 'OK' or 'TRIGGER'. + // - 'reason': A string explaining the decision. + // A 'TRIGGER' decision may halt further processing. + Callback after_model_callback = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Guardrail type. + oneof guardrail_type { + // Optional. Guardrail that bans certain content from being used in the + // conversation. + ContentFilter content_filter = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Guardrail that blocks the conversation if the prompt is + // considered unsafe based on the LLM classification. + LlmPromptSecurity llm_prompt_security = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Guardrail that blocks the conversation if the LLM response is + // considered violating the policy based on the LLM classification. + LlmPolicy llm_policy = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Guardrail that blocks the conversation if the LLM response is + // considered unsafe based on the model safety settings. + ModelSafety model_safety = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Guardrail that potentially blocks the conversation based on the + // result of the callback execution. + CodeCallback code_callback = 14 [(google.api.field_behavior) = OPTIONAL]; + } + + // Identifier. The unique identifier of the guardrail. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Display name of the guardrail. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Description of the guardrail. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether the guardrail is enabled. + bool enabled = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Action to take when the guardrail is triggered. + TriggerAction action = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when the guardrail was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the guardrail was last updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Etag used to ensure the object hasn't changed during a read-modify-write + // operation. If the etag is empty, the update will overwrite any concurrent + // changes. + string etag = 11; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/mcp_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/mcp_tool.proto new file mode 100644 index 00000000000..b966847f4e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/mcp_tool.proto @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/cloud/ces/v1beta/auth.proto"; +import "google/cloud/ces/v1beta/common.proto"; +import "google/cloud/ces/v1beta/schema.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "McpToolProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// An MCP tool. +// See https://modelcontextprotocol.io/specification/2025-06-18/server/tools for +// more details. +message McpTool { + // Required. The name of the MCP tool. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the MCP tool. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The schema of the input arguments of the MCP tool. + Schema input_schema = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The schema of the output arguments of the MCP tool. + Schema output_schema = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The server address of the MCP server, e.g., + // "https://example.com/mcp/". If the server is built with the MCP SDK, the + // url should be suffixed with + // "/mcp/". Only Streamable HTTP transport based servers are supported. This + // is the same as the server_address in the McpToolset. See + // https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http + // for more details. + string server_address = 5 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Authentication information required to execute the tool against + // the MCP server. For bearer token authentication, the token applies only to + // tool execution, not to listing tools. This requires that tools can be + // listed without authentication. + ApiAuthentication api_authentication = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The TLS configuration. Includes the custom server certificates + // that the client should trust. + TlsConfig tls_config = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Service Directory configuration for VPC-SC, used to resolve + // service names within a perimeter. + ServiceDirectoryConfig service_directory_config = 8 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/mcp_toolset.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/mcp_toolset.proto new file mode 100644 index 00000000000..165af9c4a80 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/mcp_toolset.proto @@ -0,0 +1,54 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/cloud/ces/v1beta/auth.proto"; +import "google/cloud/ces/v1beta/common.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "McpToolsetProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// A toolset that contains a list of tools that are offered by the MCP +// server. +message McpToolset { + // Required. The address of the MCP server, for example, + // "https://example.com/mcp/". If the server is built with the MCP SDK, the + // url should be suffixed with + // "/mcp/". Only Streamable HTTP transport based servers are supported. See + // https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http + // for more details. + string server_address = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Authentication information required to access tools and execute a + // tool against the MCP server. For bearer token authentication, the token + // applies only to tool execution, not to listing tools. This requires that + // tools can be listed without authentication. + ApiAuthentication api_authentication = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Service Directory configuration for VPC-SC, used to resolve + // service names within a perimeter. + ServiceDirectoryConfig service_directory_config = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The TLS configuration. Includes the custom server certificates + // that the client should trust. + TlsConfig tls_config = 4 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/omnichannel.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/omnichannel.proto new file mode 100644 index 00000000000..11ea523d6fd --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/omnichannel.proto @@ -0,0 +1,135 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "OmnichannelProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Represents an Omnichannel resource. +message Omnichannel { + option (google.api.resource) = { + type: "ces.googleapis.com/Omnichannel" + pattern: "projects/{project}/locations/{location}/omnichannels/{omnichannel}" + plural: "omnichannels" + singular: "omnichannel" + }; + + // Identifier. The unique identifier of the omnichannel resource. + // Format: + // `projects/{project}/locations/{location}/omnichannels/{omnichannel}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Display name of the omnichannel resource. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Human-readable description of the omnichannel resource. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when the omnichannel resource was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the omnichannel resource was last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Etag used to ensure the object hasn't changed during a + // read-modify-write operation. + string etag = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The integration config for the omnichannel resource. + OmnichannelIntegrationConfig integration_config = 7 + [(google.api.field_behavior) = OPTIONAL]; +} + +// OmnichannelIntegrationConfig contains all App integration configs. +message OmnichannelIntegrationConfig { + // ChannelConfig contains config for various of app integration. + message ChannelConfig { + // The config for the app. + oneof channel_config { + // WhatsApp config. + WhatsappConfig whatsapp_config = 1; + } + } + + // How Omnichannel should receive/reply events from WhatsApp. + message WhatsappConfig { + // The Phone Number ID associated with the WhatsApp Business Account. + string phone_number_id = 1; + + // The phone number used for sending/receiving messages. + string phone_number = 2; + + // The customer's WhatsApp Business Account (WABA) ID. + string whatsapp_business_account_id = 3; + + // The verify token configured in the Meta App Dashboard for webhook + // verification. + string webhook_verify_token = 4; + + // The access token for authenticating API calls to the WhatsApp Cloud API. + // https://developers.facebook.com/docs/whatsapp/business-management-api/get-started/#business-integration-system-user-access-tokens + string whatsapp_business_token = 5; + + // The Meta Business Portfolio (MBP) ID. + // https://www.facebook.com/business/help/1710077379203657 + string meta_business_portfolio_id = 6; + } + + // Configs of subscribers. + message SubscriberConfig { + // The config for the subscriber. + oneof subscriber_config { + // Ces app config. + CesAppConfig ces_app_config = 1; + } + } + + // Configs for CES app. + message CesAppConfig { + // The unique identifier of the CES app. + // Format: `projects/{project}/locations/{location}/apps/{app}` + string app = 1 + [(google.api.resource_reference) = { type: "ces.googleapis.com/App" }]; + } + + // Routing config specify how/who to route app events to a subscriber. + message RoutingConfig { + // The key of the subscriber. + string subscriber_key = 1; + } + + // Optional. Various of configuration for handling App events. + map channel_configs = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Various of subscribers configs. + map subscriber_configs = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The key of routing_configs is a key of `app_configs`, value is a + // `RoutingConfig`, which contains subscriber's key. + map routing_configs = 3 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/omnichannel_service.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/omnichannel_service.proto new file mode 100644 index 00000000000..cd14aacdb2a --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/omnichannel_service.proto @@ -0,0 +1,46 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "OmnichannelServiceProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Represents the metadata of the long-running operation. +message OmnichannelOperationMetadata { + // 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. Human-readable status of the operation, if any. + string status_message = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation of the + // operation. + bool requested_cancellation = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/open_api_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/open_api_tool.proto new file mode 100644 index 00000000000..6ca9dd43a0a --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/open_api_tool.proto @@ -0,0 +1,65 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/cloud/ces/v1beta/auth.proto"; +import "google/cloud/ces/v1beta/common.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "OpenApiToolProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// A remote API tool defined by an OpenAPI schema. +message OpenApiTool { + // Required. The OpenAPI schema in JSON or YAML format. + string open_api_schema = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The name of the tool. If not provided, the name of the tool will + // be derived from the OpenAPI schema, from `operation.operationId`. + string name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The description of the tool. If not provided, the description of + // the tool will be derived from the OpenAPI schema, from + // `operation.description` or `operation.summary`. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Authentication information required by the API. + ApiAuthentication api_authentication = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The TLS configuration. Includes the custom server certificates + // that the client will trust. + TlsConfig tls_config = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Service Directory configuration. + ServiceDirectoryConfig service_directory_config = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the agent will ignore unknown fields in the API + // response. + bool ignore_unknown_fields = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The server URL of the Open API schema. + // This field is only set in tools in the environment dependencies during the + // export process if the schema contains a server url. During the import + // process, if this url is present in the environment dependencies and the + // schema has the $env_var placeholder, it will replace the placeholder in the + // schema. + string url = 8 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/open_api_toolset.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/open_api_toolset.proto new file mode 100644 index 00000000000..5180371e16d --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/open_api_toolset.proto @@ -0,0 +1,56 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/cloud/ces/v1beta/auth.proto"; +import "google/cloud/ces/v1beta/common.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "OpenApiToolsetProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// A toolset that contains a list of tools that are defined by an OpenAPI +// schema. +message OpenApiToolset { + // Required. The OpenAPI schema of the toolset. + string open_api_schema = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Authentication information required by the API. + ApiAuthentication api_authentication = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The TLS configuration. Includes the custom server certificates + TlsConfig tls_config = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Service Directory configuration. + ServiceDirectoryConfig service_directory_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the agent will ignore unknown fields in the API response + // for all operations defined in the OpenAPI schema. + bool ignore_unknown_fields = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The server URL of the Open API schema. + // This field is only set in toolsets in the environment dependencies during + // the export process if the schema contains a server url. During the import + // process, if this url is present in the environment dependencies and the + // schema has the $env_var placeholder, it will replace the placeholder in the + // schema. + string url = 6 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/python_function.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/python_function.proto new file mode 100644 index 00000000000..16911f7d84f --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/python_function.proto @@ -0,0 +1,39 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "PythonFunctionProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// A Python function tool. +message PythonFunction { + // Optional. The name of the Python function to execute. Must match a Python + // function name defined in the python code. Case sensitive. If the name is + // not provided, the first function defined in the python code will be used. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Python code to execute for the tool. + string python_code = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The description of the Python function, parsed from the python + // code's docstring. + string description = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/schema.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/schema.proto new file mode 100644 index 00000000000..16fe8d02550 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/schema.proto @@ -0,0 +1,140 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "SchemaProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Represents a select subset of an OpenAPI 3.0 schema object. +message Schema { + // OpenAPI data types. + enum Type { + // Type unspecified. + TYPE_UNSPECIFIED = 0; + + // String type. + STRING = 1; + + // Integer type. + INTEGER = 2; + + // Number type. + NUMBER = 3; + + // Boolean type. + BOOLEAN = 4; + + // Object type. + OBJECT = 5; + + // Array type. + ARRAY = 6; + } + + // Required. The type of the data. + Type type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Properties of Type.OBJECT. + map properties = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Required properties of Type.OBJECT. + repeated string required = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The description of the data. + string description = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Schema of the elements of Type.ARRAY. + Schema items = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates if the value may be null. + bool nullable = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicate the items in the array must be unique. Only applies to + // TYPE.ARRAY. + bool unique_items = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Schemas of initial elements of Type.ARRAY. + repeated Schema prefix_items = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Can either be a boolean or an object, controls the presence of + // additional properties. + Schema additional_properties = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value should be validated against any (one or more) of the + // subschemas in the list. + repeated Schema any_of = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Possible values of the element of primitive type with enum + // format. Examples: + // 1. We can define direction as : + // {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} + // 2. We can define apartment number as : + // {type:INTEGER, format:enum, enum:["101", "201", "301"]} + repeated string enum = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Default value of the data. + google.protobuf.Value default = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Allows indirect references between schema nodes. The value should + // be a valid reference to a child of the root `defs`. + // + // For example, the following schema defines a reference to a schema node + // named "Pet": + // + // ``` + // type: object + // properties: + // pet: + // ref: #/defs/Pet + // defs: + // Pet: + // type: object + // properties: + // name: + // type: string + // ``` + // + // The value of the "pet" property is a reference to the schema node + // named "Pet". + // See details in + // https://json-schema.org/understanding-json-schema/structuring. + string ref = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A map of definitions for use by `ref`. Only allowed at the root + // of the schema. + map defs = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The title of the schema. + string title = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Minimum number of the elements for Type.ARRAY. + int64 min_items = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum number of the elements for Type.ARRAY. + int64 max_items = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Minimum value for Type.INTEGER and Type.NUMBER. + optional double minimum = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum value for Type.INTEGER and Type.NUMBER. + optional double maximum = 19 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/search_suggestions.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/search_suggestions.proto new file mode 100644 index 00000000000..6b7f6873f18 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/search_suggestions.proto @@ -0,0 +1,45 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "SearchSuggestionsProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Search suggestions from [Google Search +// Tool][google.cloud.ces.v1beta.GoogleSearchTool]. +message GoogleSearchSuggestions { + // Compliant HTML and CSS styling for search suggestions. + // The provided HTML and CSS automatically adapts to your device settings, + // displaying in either light or dark mode indicated by + // `@media(prefers-color-scheme)`. + repeated string htmls = 1; + + // List of queries used to perform the google search along with the search + // result URIs forming the search suggestions. + repeated WebSearchQuery web_search_queries = 2; +} + +// Represents a single web search query and its associated search uri. +message WebSearchQuery { + // The search query text. + string query = 1; + + // The URI to the Google Search results page for the query. + string uri = 2; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/session_service.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/session_service.proto new file mode 100644 index 00000000000..d6d235d4902 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/session_service.proto @@ -0,0 +1,459 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.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/ces/v1beta/common.proto"; +import "google/cloud/ces/v1beta/example.proto"; +import "google/cloud/ces/v1beta/search_suggestions.proto"; +import "google/protobuf/struct.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "SessionServiceProto"; +option java_package = "com.google.cloud.ces.v1beta"; +option (google.api.resource_definition) = { + type: "ces.googleapis.com/Session" + pattern: "projects/{project}/locations/{location}/apps/{app}/sessions/{session}" +}; + +// Session service provides APIs for interacting with CES agents. +service SessionService { + option (google.api.default_host) = "ces.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/ces," + "https://www.googleapis.com/auth/cloud-platform"; + + // Initiates a single turn interaction with the CES agent within a + // session. + rpc RunSession(RunSessionRequest) returns (RunSessionResponse) { + option (google.api.http) = { + post: "/v1beta/{config.session=projects/*/locations/*/apps/*/sessions/*}:runSession" + body: "*" + }; + } + + // Establishes a bidirectional streaming connection with the CES agent. + // The agent processes continuous multimodal inputs (e.g., text, audio) and + // generates real-time multimodal output streams. + // + // --- Client Request Stream --- + // The client streams requests in the following order: + // + // 1. Initialization: + // The first message must contain + // [SessionConfig][google.cloud.ces.v1beta.BidiSessionClientMessage.config]. + // For audio sessions, this should also include + // [InputAudioConfig][google.cloud.ces.v1beta.SessionConfig.input_audio_config] + // and + // [OutputAudioConfig][google.cloud.ces.v1beta.SessionConfig.output_audio_config] + // to define audio processing and synthesis parameters. + // + // 2. Interaction: + // Subsequent messages stream + // [SessionInput][google.cloud.ces.v1beta.BidiSessionClientMessage.realtime_input] + // containing real-time user input data. + // + // 3. Termination: + // The client should half-close the stream when there is no more user + // input. It should also half-close upon receiving + // [EndSession][google.cloud.ces.v1beta.BidiSessionServerMessage.end_session] + // or [GoAway][google.cloud.ces.v1beta.BidiSessionServerMessage.go_away] + // from the agent. + // + // --- Server Response Stream --- + // For each interaction turn, the agent streams messages in the following + // sequence: + // + // 1. Speech Recognition (First N messages): + // Contains + // [RecognitionResult][google.cloud.ces.v1beta.BidiSessionServerMessage.recognition_result] + // representing the concatenated user speech segments captured so far. + // This is only populated for audio sessions. + // + // 2. Response (Next M messages): + // Contains + // [SessionOutput][google.cloud.ces.v1beta.BidiSessionServerMessage.session_output] + // delivering the agent's response in various modalities (e.g., text, + // audio). + // + // 3. Turn Completion (Final message of the turn): + // Contains + // [SessionOutput][google.cloud.ces.v1beta.BidiSessionServerMessage.session_output] + // with + // [turn_completed][google.cloud.ces.v1beta.SessionOutput.turn_completed] + // set to true. This signals the end of the current turn and includes + // [DiagnosticInfo][google.cloud.ces.v1beta.SessionOutput.diagnostic_info] + // with execution details. + // + // --- Audio Best Practices --- + // 1. Streaming: + // Stream [audio data][google.cloud.ces.v1beta.SessionInput.audio] + // **CONTINUOUSLY**, even during silence. Recommended chunk size: 40-120ms + // (balances latency vs. efficiency). + // + // 2. Playback & Interruption: + // Play [audio responses][google.cloud.ces.v1beta.SessionOutput.audio] + // upon receipt. Stop playback immediately if an + // [InterruptionSignal][google.cloud.ces.v1beta.BidiSessionServerMessage.interruption_signal] + // is received (e.g., user barge-in or new agent response). + rpc BidiRunSession(stream BidiSessionClientMessage) + returns (stream BidiSessionServerMessage) {} +} + +// AudioEncoding specifies the encoding format for audio data. +enum AudioEncoding { + // Unspecified audio encoding. + AUDIO_ENCODING_UNSPECIFIED = 0; + + // 16-bit linear PCM audio encoding. + LINEAR16 = 1; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + MULAW = 2; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law. + ALAW = 3; +} + +// InputAudioConfig configures how the CES agent should interpret the incoming +// audio data. +message InputAudioConfig { + // Required. The encoding of the input audio data. + AudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The sample rate (in Hertz) of the input audio data. + int32 sample_rate_hertz = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Whether to enable noise suppression on the input audio. + // Available values are "low", "moderate", "high", "very_high". + string noise_suppression_level = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// OutputAudioConfig configures how the CES agent should synthesize outgoing +// audio responses. +message OutputAudioConfig { + // Required. The encoding of the output audio data. + AudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The sample rate (in Hertz) of the output audio data. + int32 sample_rate_hertz = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The configuration for the session. +message SessionConfig { + // [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters) + // to send to the remote + // [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) + // agent when the session control is transferred to the remote agent. + message RemoteDialogflowQueryParameters { + // Optional. The HTTP headers to be sent as webhook_headers in + // [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters). + map webhook_headers = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The payload to be sent in + // [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters). + google.protobuf.Struct payload = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The end user metadata to be sent in + // [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters). + google.protobuf.Struct end_user_metadata = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The unique identifier of the session. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/sessions/{session}` + string session = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Session" } + ]; + + // Optional. Configuration for processing the input audio. + InputAudioConfig input_audio_config = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for generating the output audio. + OutputAudioConfig output_audio_config = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The historical context of the session, including user inputs, + // agent responses, and other messages. Typically, CES agent would manage + // session automatically so client doesn't need to explicitly populate this + // field. However, client can optionally override the historical contexts to + // force the session start from certain state. + repeated Message historical_contexts = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The entry agent to handle the session. If not specified, the + // session will be handled by the [root + // agent][google.cloud.ces.v1beta.App.root_agent] of the app. Format: + // `projects/{project}/locations/{location}/agents/{agent}` + string entry_agent = 12 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + + // Optional. The deployment of the app to use for the session. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` + string deployment = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The time zone of the user. If provided, the agent will use the + // time zone for date and time related variables. Otherwise, the agent will + // use the time zone specified in the App.time_zone_settings. + // + // The format is the IANA Time Zone Database time zone, e.g. + // "America/Los_Angeles". + string time_zone = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. + // [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters) + // to send to the remote + // [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) + // agent when the session control is transferred to the remote agent. + RemoteDialogflowQueryParameters remote_dialogflow_query_parameters = 15 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the client to execute the tools and return the execution results +// before continuing the session. +message ToolCalls { + // Optional. The list of tool calls to execute. + repeated ToolCall tool_calls = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Execution results for the requested tool calls from the client. +message ToolResponses { + // Optional. The list of tool execution results. + repeated ToolResponse tool_responses = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Citations associated with the agent response. +message Citations { + // Piece of cited information. + message CitedChunk { + // URI used for citation. + string uri = 1; + + // Title of the cited document. + string title = 2; + + // Text used for citation. + string text = 3; + } + + // List of cited pieces of information. + repeated CitedChunk cited_chunks = 1; +} + +// Event input. +message Event { + // Required. The name of the event. + string event = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Input for the session. +message SessionInput { + // The type of the input. + oneof input_type { + // Optional. Text data from the end user. + string text = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. DTMF digits from the end user. + string dtmf = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Audio data from the end user. + bytes audio = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Execution results for the tool calls from the client. + ToolResponses tool_responses = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Image data from the end user. + Image image = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Blob data from the end user. + Blob blob = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Contextual variables for the session, keyed by name. Only + // variables declared in the app will be used by the CES agent. + // + // Unrecognized variables will still be sent to the [Dialogflow + // agent][Agent.RemoteDialogflowAgent] as additional session parameters. + google.protobuf.Struct variables = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Event input. + Event event = 9 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. A flag to indicate if the current message is a fragment of a + // larger input in the bidi streaming session. + // + // When set to `true`, the agent defers processing until it receives a + // subsequent message where `will_continue` is `false`, or until the system + // detects an endpoint in the audio input. + // + // NOTE: This field does not apply to audio and DTMF inputs, as they are + // always processed automatically based on the endpointing signal. + bool will_continue = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// Output for the session. +message SessionOutput { + // Contains execution details during the processing. + message DiagnosticInfo { + // List of the messages that happened during the processing. + repeated Message messages = 1; + + // A trace of the entire request processing, represented as a root span. + // This span can contain nested child spans for specific operations. + Span root_span = 3; + } + + // The type of the output. + oneof output_type { + // Output text from the CES agent. + string text = 1; + + // Output audio from the CES agent. + bytes audio = 2; + + // Request for the client to execute the tools. + ToolCalls tool_calls = 3; + + // Citations that provide the source information for the agent's generated + // text. + Citations citations = 8; + + // The suggestions returned from Google Search as a result of invoking the + // [GoogleSearchTool][google.cloud.ces.v1beta.GoogleSearchTool]. + GoogleSearchSuggestions google_search_suggestions = 10; + + // Indicates the session has ended. + EndSession end_session = 9; + + // Custom payload with structured output from the CES agent. + google.protobuf.Struct payload = 11; + } + + // Indicates the sequential order of conversation turn to which this output + // belongs to, starting from 1. + int32 turn_index = 6; + + // If true, the CES agent has detected the end of the current conversation + // turn and will provide no further output for this turn. + bool turn_completed = 4; + + // Optional. Diagnostic information contains execution details during the + // processing of the input. Only populated in the last SessionOutput (with + // `turn_completed=true`) for each turn. + DiagnosticInfo diagnostic_info = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Speech recognition result for the audio input. +message RecognitionResult { + // Optional. Concatenated user speech segments captured during the current + // turn. + string transcript = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Indicates the agent's audio response has been interrupted. The client should +// immediately stop any current audio playback (e.g., due to user barge-in or +// a new agent response being generated). +message InterruptionSignal { + // Whether the interruption is caused by a user barge-in event. + bool barge_in = 1; +} + +// Indicates the session has terminated, due to either successful completion +// (e.g. user says "Good bye!" ) or an agent escalation. +// +// The agent will not process any further inputs after session is terminated and +// the client should half-close and disconnect after receiving all remaining +// responses from the agent. +message EndSession { + // Optional. Provides additional information about the end session signal, + // such as the reason for ending the session. + google.protobuf.Struct metadata = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Indicates that the server will disconnect soon and the client should +// half-close and restart the connection. +message GoAway {} + +// Request message for +// [SessionService.RunSession][google.cloud.ces.v1beta.SessionService.RunSession]. +message RunSessionRequest { + // Required. The configuration for the session. + SessionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Inputs for the session. + repeated SessionInput inputs = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for +// [SessionService.RunSession][google.cloud.ces.v1beta.SessionService.RunSession]. +message RunSessionResponse { + // Outputs for the session. + repeated SessionOutput outputs = 1; +} + +// The top-level message sent by the client for the +// [SessionService.BidiRunSession][google.cloud.ces.v1beta.SessionService.BidiRunSession] +// method. +message BidiSessionClientMessage { + // The type of the message. + oneof message_type { + // Optional. The initial config message for the session. + SessionConfig config = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Realtime input for the session. + SessionInput realtime_input = 2 [(google.api.field_behavior) = OPTIONAL]; + } +} + +// The top-level message returned from +// [SessionService.BidiRunSession][google.cloud.ces.v1beta.SessionService.BidiRunSession] +// method. +message BidiSessionServerMessage { + // The type of the message. + oneof message_type { + // Optional. Processing result from the CES agent. + SessionOutput session_output = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Realtime speech recognition result for the audio input. + RecognitionResult recognition_result = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Interruption signal detected from the audio input. + InterruptionSignal interruption_signal = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates that the session has ended. + EndSession end_session = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates that the server will disconnect soon and the client + // should half-close and restart the connection. + GoAway go_away = 6 [(google.api.field_behavior) = OPTIONAL]; + } +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/system_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/system_tool.proto new file mode 100644 index 00000000000..c1db7d0bd6f --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/system_tool.proto @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.ces.v1beta; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "SystemToolProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Pre-defined system tool. +message SystemTool { + // Required. The name of the system tool. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The description of the system tool. + string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/tool.proto new file mode 100644 index 00000000000..6ec7fca7005 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/tool.proto @@ -0,0 +1,124 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1beta/client_function.proto"; +import "google/cloud/ces/v1beta/common.proto"; +import "google/cloud/ces/v1beta/connector_tool.proto"; +import "google/cloud/ces/v1beta/data_store_tool.proto"; +import "google/cloud/ces/v1beta/fakes.proto"; +import "google/cloud/ces/v1beta/file_search_tool.proto"; +import "google/cloud/ces/v1beta/google_search_tool.proto"; +import "google/cloud/ces/v1beta/mcp_tool.proto"; +import "google/cloud/ces/v1beta/open_api_tool.proto"; +import "google/cloud/ces/v1beta/python_function.proto"; +import "google/cloud/ces/v1beta/system_tool.proto"; +import "google/cloud/ces/v1beta/widget_tool.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ToolProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// A tool represents an action that the CES agent can take to achieve certain +// goals. +message Tool { + option (google.api.resource) = { + type: "ces.googleapis.com/Tool" + pattern: "projects/{project}/locations/{location}/apps/{app}/tools/{tool}" + plural: "tools" + singular: "tool" + }; + + // The type of the tool. + oneof tool_type { + // Optional. The client function. + ClientFunction client_function = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The open API tool. + OpenApiTool open_api_tool = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The google search tool. + GoogleSearchTool google_search_tool = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Integration Connector tool. + ConnectorTool connector_tool = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The data store tool. + DataStoreTool data_store_tool = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The python function tool. + PythonFunction python_function = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The MCP tool. An MCP tool cannot be created or updated directly + // and is managed by the MCP toolset. + McpTool mcp_tool = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The file search tool. + FileSearchTool file_search_tool = 17 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The system tool. + SystemTool system_tool = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The widget tool. + WidgetTool widget_tool = 24 [(google.api.field_behavior) = OPTIONAL]; + } + + // Identifier. The unique identifier of the tool. + // Format: + // - `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` for + // ## standalone tools. + // + // `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}/tools/{tool}` + // for tools retrieved from a toolset. These tools are dynamic and + // output-only, they cannot be referenced directly where a tool is expected. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The display name of the tool, derived based on the tool's + // type. For example, display name of a [ClientFunction][Tool.ClientFunction] + // is derived from its `name` property. + string display_name = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The execution type of the tool. + ExecutionType execution_type = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when the tool was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the tool was last updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Etag used to ensure the object hasn't changed during a read-modify-write + // operation. If the etag is empty, the update will overwrite any concurrent + // changes. + string etag = 14; + + // Output only. If the tool is generated by the LLM assistant, this field + // contains a descriptive summary of the generation. + string generated_summary = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Configuration for tool behavior in fake mode. + ToolFakeConfig tool_fake_config = 20 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/tool_service.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/tool_service.proto new file mode 100644 index 00000000000..8e1297a6519 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/tool_service.proto @@ -0,0 +1,195 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.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/ces/v1beta/schema.proto"; +import "google/cloud/ces/v1beta/tool.proto"; +import "google/cloud/ces/v1beta/toolset_tool.proto"; +import "google/protobuf/struct.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ToolServiceProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Tool service provides APIs for interacting with CES tools. +service ToolService { + option (google.api.default_host) = "ces.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/ces," + "https://www.googleapis.com/auth/cloud-platform"; + + // Executes the given tool with the given arguments. + rpc ExecuteTool(ExecuteToolRequest) returns (ExecuteToolResponse) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/apps/*}:executeTool" + body: "*" + }; + } + + // Retrieve the schema of the given tool. The schema is computed on the fly + // for the given instance of the tool. + rpc RetrieveToolSchema(RetrieveToolSchemaRequest) + returns (RetrieveToolSchemaResponse) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/apps/*}:retrieveToolSchema" + body: "*" + }; + } + + // Retrieve the list of tools included in the specified toolset. + rpc RetrieveTools(RetrieveToolsRequest) returns (RetrieveToolsResponse) { + option (google.api.http) = { + post: "/v1beta/{toolset=projects/*/locations/*/apps/*/toolsets/*}:retrieveTools" + body: "*" + }; + } +} + +// Request message for +// [ToolService.ExecuteTool][google.cloud.ces.v1beta.ToolService.ExecuteTool]. +message ExecuteToolRequest { + // The identifier of the tool to execute. It could be either a persisted tool + // or a tool from a toolset. + oneof tool_identifier { + // Optional. The name of the tool to execute. + // Format: + // projects/{project}/locations/{location}/apps/{app}/tools/{tool} + string tool = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } + ]; + + // Optional. The toolset tool to execute. Only one tool should match the + // predicate from the toolset. Otherwise, an error will be returned. + ToolsetTool toolset_tool = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The resource name of the app which the tool/toolset belongs to. + // Format: `projects/{project}/locations/{location}/apps/{app}` + string parent = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; + + // Optional. The input parameters and values for the tool in JSON object + // format. + google.protobuf.Struct args = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The variables that are available for the tool execution. + google.protobuf.Struct variables = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [ToolService.ExecuteTool][google.cloud.ces.v1beta.ToolService.ExecuteTool]. +message ExecuteToolResponse { + // The identifier of the tool that got executed. + oneof tool_identifier { + // The name of the tool that got executed. + // Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` + string tool = 1 + [(google.api.resource_reference) = { type: "ces.googleapis.com/Tool" }]; + + // The toolset tool that got executed. + ToolsetTool toolset_tool = 3; + } + + // The tool execution result in JSON object format. + // Use "output" key to specify tool response and "error" key to specify + // error details (if any). If "output" and "error" keys are not specified, + // then whole "response" is treated as tool execution result. + google.protobuf.Struct response = 2; + + // The variable values at the end of the tool execution. + google.protobuf.Struct variables = 4; +} + +// Request message for +// [ToolService.RetrieveToolSchema][google.cloud.ces.v1beta.ToolService.RetrieveToolSchema]. +message RetrieveToolSchemaRequest { + // The identifier of the tool to retrieve the schema for. It could be either a + // persisted tool or a tool from a toolset. + oneof tool_identifier { + // Optional. The name of the tool to retrieve the schema for. + // Format: + // projects/{project}/locations/{location}/apps/{app}/tools/{tool} + string tool = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } + ]; + + // Optional. The toolset tool to retrieve the schema for. Only one tool + // should match the predicate from the toolset. Otherwise, an error will be + // returned. + ToolsetTool toolset_tool = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The resource name of the app which the tool/toolset belongs to. + // Format: `projects/{project}/locations/{location}/apps/{app}` + string parent = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; +} + +// Response message for +// [ToolService.RetrieveToolSchema][google.cloud.ces.v1beta.ToolService.RetrieveToolSchema]. +message RetrieveToolSchemaResponse { + // The identifier of the tool that the schema is for. + oneof tool_identifier { + // The name of the tool that the schema is for. + // Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` + string tool = 1 + [(google.api.resource_reference) = { type: "ces.googleapis.com/Tool" }]; + + // The toolset tool that the schema is for. + ToolsetTool toolset_tool = 2; + } + + // The schema of the tool input parameters. + Schema input_schema = 3; + + // The schema of the tool output parameters. + Schema output_schema = 4; +} + +// Request message for +// [ToolService.RetrieveTools][google.cloud.ces.v1beta.ToolService.RetrieveTools]. +message RetrieveToolsRequest { + // Required. The name of the toolset to retrieve the tools for. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + string toolset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Toolset" } + ]; + + // Optional. The identifiers of the tools to retrieve from the toolset. + // If empty, all tools in the toolset will be returned. + repeated string tool_ids = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [ToolService.RetrieveTools][google.cloud.ces.v1beta.ToolService.RetrieveTools]. +message RetrieveToolsResponse { + // The list of tools that are included in the specified toolset. + repeated Tool tools = 1; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/toolset.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/toolset.proto new file mode 100644 index 00000000000..68456ef50b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/toolset.proto @@ -0,0 +1,90 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/ces/v1beta/common.proto"; +import "google/cloud/ces/v1beta/connector_toolset.proto"; +import "google/cloud/ces/v1beta/fakes.proto"; +import "google/cloud/ces/v1beta/mcp_toolset.proto"; +import "google/cloud/ces/v1beta/open_api_toolset.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ToolsetProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// A toolset represents a group of dynamically managed tools that can be used +// by the agent. +message Toolset { + option (google.api.resource) = { + type: "ces.googleapis.com/Toolset" + pattern: "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}" + plural: "toolsets" + singular: "toolset" + }; + + // The type of the toolset. + oneof toolset_type { + // Optional. A toolset that contains a list of tools that are offered by the + // MCP server. + McpToolset mcp_toolset = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A toolset that contains a list of tools that are defined by an + // OpenAPI schema. + OpenApiToolset open_api_toolset = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A toolset that generates tools from an Integration Connectors + // Connection. + ConnectorToolset connector_toolset = 8 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Identifier. The unique identifier of the toolset. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. The display name of the toolset. Must be unique within the same + // app. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The description of the toolset. + string description = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when the toolset was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the toolset was last updated. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // ETag used to ensure the object hasn't changed during a read-modify-write + // operation. If the etag is empty, the update will overwrite any concurrent + // changes. + string etag = 5; + + // Optional. The execution type of the tools in the toolset. + ExecutionType execution_type = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for tools behavior in fake mode. + ToolFakeConfig tool_fake_config = 11 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/toolset_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/toolset_tool.proto new file mode 100644 index 00000000000..9ffeec72197 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/toolset_tool.proto @@ -0,0 +1,39 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "ToolsetToolProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// A tool that is created from a toolset. +message ToolsetTool { + // Required. The resource name of the Toolset from which this tool is derived. + // Format: + // `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + string toolset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Toolset" } + ]; + + // Optional. The tool ID to filter the tools to retrieve the schema for. + string tool_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/widget_service.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/widget_service.proto new file mode 100644 index 00000000000..da9850d7b40 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/widget_service.proto @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.ces.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "WidgetServiceProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Provides APIs for widgets to interact with CES APIs. +service WidgetService { + option (google.api.default_host) = "ces.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/ces," + "https://www.googleapis.com/auth/cloud-platform"; + + // Generates a session scoped token for chat widget to authenticate with + // Session APIs. + rpc GenerateChatToken(GenerateChatTokenRequest) + returns (GenerateChatTokenResponse) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/apps/*/sessions/*}:generateChatToken" + body: "*" + }; + } +} + +// Request message for +// [WidgetService.GenerateChatToken][google.cloud.ces.v1beta.WidgetService.GenerateChatToken]. +message GenerateChatTokenRequest { + // Required. The session name to generate the chat token for. + // Format: + // projects/{project}/locations/{location}/apps/{app}/sessions/{session} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Session" } + ]; + + // Required. The deployment of the app to use for the session. + // Format: + // projects/{project}/locations/{location}/apps/{app}/deployments/{deployment} + string deployment = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/Deployment" } + ]; + + // Optional. The reCAPTCHA token generated by the client-side chat widget. + string recaptcha_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [WidgetService.GenerateChatToken][google.cloud.ces.v1beta.WidgetService.GenerateChatToken]. +message GenerateChatTokenResponse { + // The session scoped token for chat widget to authenticate with Session APIs. + string chat_token = 1; + + // The time at which the chat token expires. + google.protobuf.Timestamp expire_time = 2; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/widget_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/widget_tool.proto new file mode 100644 index 00000000000..6d6430443c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/widget_tool.proto @@ -0,0 +1,90 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.ces.v1beta; + +import "google/api/field_behavior.proto"; +import "google/cloud/ces/v1beta/schema.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "WidgetToolProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Represents a widget tool that the agent can invoke. When the tool is chosen +// by the agent, agent will return the widget to the client. The client is +// responsible for processing the widget and generating the next user query to +// continue the interaction with the agent. +message WidgetTool { + // All available widget types. + // New values may be added to this enum in the future. + enum WidgetType { + // Unspecified widget type. + WIDGET_TYPE_UNSPECIFIED = 0; + + // Custom widget type. + CUSTOM = 1; + + // Product carousel widget. + PRODUCT_CAROUSEL = 2; + + // Product details widget. + PRODUCT_DETAILS = 3; + + // Quick actions widget. + QUICK_ACTIONS = 4; + + // Product comparison widget. + PRODUCT_COMPARISON = 5; + + // Advanced product details widget. + ADVANCED_PRODUCT_DETAILS = 6; + + // Short form widget. + SHORT_FORM = 7; + + // Overall satisfaction widget. + OVERALL_SATISFACTION = 8; + + // Order summary widget. + ORDER_SUMMARY = 9; + + // Appointment details widget. + APPOINTMENT_DETAILS = 10; + + // Appointment scheduler widget. + APPOINTMENT_SCHEDULER = 11; + + // Contact form widget. + CONTACT_FORM = 12; + } + + // The input of the widget tool. + oneof input { + // Optional. The input parameters of the widget tool. + Schema parameters = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The display name of the widget tool. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the widget tool. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The type of the widget tool. If not specified, the default type + // will be CUSTOMIZED. + WidgetType widget_type = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-ces/protos/protos.d.ts b/owl-bot-staging/google-cloud-ces/protos/protos.d.ts new file mode 100644 index 00000000000..c43519c0865 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/protos.d.ts @@ -0,0 +1,72921 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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 ces. */ + namespace ces { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an Agent. */ + interface IAgent { + + /** Agent llmAgent */ + llmAgent?: (google.cloud.ces.v1.Agent.ILlmAgent|null); + + /** Agent remoteDialogflowAgent */ + remoteDialogflowAgent?: (google.cloud.ces.v1.Agent.IRemoteDialogflowAgent|null); + + /** Agent name */ + name?: (string|null); + + /** Agent displayName */ + displayName?: (string|null); + + /** Agent description */ + description?: (string|null); + + /** Agent modelSettings */ + modelSettings?: (google.cloud.ces.v1.IModelSettings|null); + + /** Agent instruction */ + instruction?: (string|null); + + /** Agent tools */ + tools?: (string[]|null); + + /** Agent childAgents */ + childAgents?: (string[]|null); + + /** Agent beforeAgentCallbacks */ + beforeAgentCallbacks?: (google.cloud.ces.v1.ICallback[]|null); + + /** Agent afterAgentCallbacks */ + afterAgentCallbacks?: (google.cloud.ces.v1.ICallback[]|null); + + /** Agent beforeModelCallbacks */ + beforeModelCallbacks?: (google.cloud.ces.v1.ICallback[]|null); + + /** Agent afterModelCallbacks */ + afterModelCallbacks?: (google.cloud.ces.v1.ICallback[]|null); + + /** Agent beforeToolCallbacks */ + beforeToolCallbacks?: (google.cloud.ces.v1.ICallback[]|null); + + /** Agent afterToolCallbacks */ + afterToolCallbacks?: (google.cloud.ces.v1.ICallback[]|null); + + /** Agent createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Agent updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Agent guardrails */ + guardrails?: (string[]|null); + + /** Agent etag */ + etag?: (string|null); + + /** Agent toolsets */ + toolsets?: (google.cloud.ces.v1.Agent.IAgentToolset[]|null); + + /** Agent generatedSummary */ + generatedSummary?: (string|null); + + /** Agent transferRules */ + transferRules?: (google.cloud.ces.v1.ITransferRule[]|null); + } + + /** Represents an Agent. */ + class Agent implements IAgent { + + /** + * Constructs a new Agent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IAgent); + + /** Agent llmAgent. */ + public llmAgent?: (google.cloud.ces.v1.Agent.ILlmAgent|null); + + /** Agent remoteDialogflowAgent. */ + public remoteDialogflowAgent?: (google.cloud.ces.v1.Agent.IRemoteDialogflowAgent|null); + + /** Agent name. */ + public name: string; + + /** Agent displayName. */ + public displayName: string; + + /** Agent description. */ + public description: string; + + /** Agent modelSettings. */ + public modelSettings?: (google.cloud.ces.v1.IModelSettings|null); + + /** Agent instruction. */ + public instruction: string; + + /** Agent tools. */ + public tools: string[]; + + /** Agent childAgents. */ + public childAgents: string[]; + + /** Agent beforeAgentCallbacks. */ + public beforeAgentCallbacks: google.cloud.ces.v1.ICallback[]; + + /** Agent afterAgentCallbacks. */ + public afterAgentCallbacks: google.cloud.ces.v1.ICallback[]; + + /** Agent beforeModelCallbacks. */ + public beforeModelCallbacks: google.cloud.ces.v1.ICallback[]; + + /** Agent afterModelCallbacks. */ + public afterModelCallbacks: google.cloud.ces.v1.ICallback[]; + + /** Agent beforeToolCallbacks. */ + public beforeToolCallbacks: google.cloud.ces.v1.ICallback[]; + + /** Agent afterToolCallbacks. */ + public afterToolCallbacks: google.cloud.ces.v1.ICallback[]; + + /** Agent createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Agent updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Agent guardrails. */ + public guardrails: string[]; + + /** Agent etag. */ + public etag: string; + + /** Agent toolsets. */ + public toolsets: google.cloud.ces.v1.Agent.IAgentToolset[]; + + /** Agent generatedSummary. */ + public generatedSummary: string; + + /** Agent transferRules. */ + public transferRules: google.cloud.ces.v1.ITransferRule[]; + + /** Agent agentType. */ + public agentType?: ("llmAgent"|"remoteDialogflowAgent"); + + /** + * Creates a new Agent instance using the specified properties. + * @param [properties] Properties to set + * @returns Agent instance + */ + public static create(properties?: google.cloud.ces.v1.IAgent): google.cloud.ces.v1.Agent; + + /** + * Encodes the specified Agent message. Does not implicitly {@link google.cloud.ces.v1.Agent.verify|verify} messages. + * @param message Agent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Agent message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Agent.verify|verify} messages. + * @param message Agent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Agent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Agent; + + /** + * Decodes an Agent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Agent; + + /** + * Verifies an Agent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Agent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Agent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Agent; + + /** + * Creates a plain object from an Agent message. Also converts values to other types if specified. + * @param message Agent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Agent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Agent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Agent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Agent { + + /** Properties of a LlmAgent. */ + interface ILlmAgent { + } + + /** Represents a LlmAgent. */ + class LlmAgent implements ILlmAgent { + + /** + * Constructs a new LlmAgent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.Agent.ILlmAgent); + + /** + * Creates a new LlmAgent instance using the specified properties. + * @param [properties] Properties to set + * @returns LlmAgent instance + */ + public static create(properties?: google.cloud.ces.v1.Agent.ILlmAgent): google.cloud.ces.v1.Agent.LlmAgent; + + /** + * Encodes the specified LlmAgent message. Does not implicitly {@link google.cloud.ces.v1.Agent.LlmAgent.verify|verify} messages. + * @param message LlmAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.Agent.ILlmAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LlmAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Agent.LlmAgent.verify|verify} messages. + * @param message LlmAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.Agent.ILlmAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LlmAgent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LlmAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Agent.LlmAgent; + + /** + * Decodes a LlmAgent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LlmAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Agent.LlmAgent; + + /** + * Verifies a LlmAgent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LlmAgent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LlmAgent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Agent.LlmAgent; + + /** + * Creates a plain object from a LlmAgent message. Also converts values to other types if specified. + * @param message LlmAgent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Agent.LlmAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LlmAgent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LlmAgent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RemoteDialogflowAgent. */ + interface IRemoteDialogflowAgent { + + /** RemoteDialogflowAgent agent */ + agent?: (string|null); + + /** RemoteDialogflowAgent flowId */ + flowId?: (string|null); + + /** RemoteDialogflowAgent environmentId */ + environmentId?: (string|null); + + /** RemoteDialogflowAgent inputVariableMapping */ + inputVariableMapping?: ({ [k: string]: string }|null); + + /** RemoteDialogflowAgent outputVariableMapping */ + outputVariableMapping?: ({ [k: string]: string }|null); + + /** RemoteDialogflowAgent respectResponseInterruptionSettings */ + respectResponseInterruptionSettings?: (boolean|null); + } + + /** Represents a RemoteDialogflowAgent. */ + class RemoteDialogflowAgent implements IRemoteDialogflowAgent { + + /** + * Constructs a new RemoteDialogflowAgent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.Agent.IRemoteDialogflowAgent); + + /** RemoteDialogflowAgent agent. */ + public agent: string; + + /** RemoteDialogflowAgent flowId. */ + public flowId: string; + + /** RemoteDialogflowAgent environmentId. */ + public environmentId: string; + + /** RemoteDialogflowAgent inputVariableMapping. */ + public inputVariableMapping: { [k: string]: string }; + + /** RemoteDialogflowAgent outputVariableMapping. */ + public outputVariableMapping: { [k: string]: string }; + + /** RemoteDialogflowAgent respectResponseInterruptionSettings. */ + public respectResponseInterruptionSettings: boolean; + + /** + * Creates a new RemoteDialogflowAgent instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoteDialogflowAgent instance + */ + public static create(properties?: google.cloud.ces.v1.Agent.IRemoteDialogflowAgent): google.cloud.ces.v1.Agent.RemoteDialogflowAgent; + + /** + * Encodes the specified RemoteDialogflowAgent message. Does not implicitly {@link google.cloud.ces.v1.Agent.RemoteDialogflowAgent.verify|verify} messages. + * @param message RemoteDialogflowAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.Agent.IRemoteDialogflowAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoteDialogflowAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Agent.RemoteDialogflowAgent.verify|verify} messages. + * @param message RemoteDialogflowAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.Agent.IRemoteDialogflowAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoteDialogflowAgent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoteDialogflowAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Agent.RemoteDialogflowAgent; + + /** + * Decodes a RemoteDialogflowAgent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoteDialogflowAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Agent.RemoteDialogflowAgent; + + /** + * Verifies a RemoteDialogflowAgent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoteDialogflowAgent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoteDialogflowAgent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Agent.RemoteDialogflowAgent; + + /** + * Creates a plain object from a RemoteDialogflowAgent message. Also converts values to other types if specified. + * @param message RemoteDialogflowAgent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Agent.RemoteDialogflowAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoteDialogflowAgent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoteDialogflowAgent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AgentToolset. */ + interface IAgentToolset { + + /** AgentToolset toolset */ + toolset?: (string|null); + + /** AgentToolset toolIds */ + toolIds?: (string[]|null); + } + + /** Represents an AgentToolset. */ + class AgentToolset implements IAgentToolset { + + /** + * Constructs a new AgentToolset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.Agent.IAgentToolset); + + /** AgentToolset toolset. */ + public toolset: string; + + /** AgentToolset toolIds. */ + public toolIds: string[]; + + /** + * Creates a new AgentToolset instance using the specified properties. + * @param [properties] Properties to set + * @returns AgentToolset instance + */ + public static create(properties?: google.cloud.ces.v1.Agent.IAgentToolset): google.cloud.ces.v1.Agent.AgentToolset; + + /** + * Encodes the specified AgentToolset message. Does not implicitly {@link google.cloud.ces.v1.Agent.AgentToolset.verify|verify} messages. + * @param message AgentToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.Agent.IAgentToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AgentToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Agent.AgentToolset.verify|verify} messages. + * @param message AgentToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.Agent.IAgentToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AgentToolset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AgentToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Agent.AgentToolset; + + /** + * Decodes an AgentToolset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AgentToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Agent.AgentToolset; + + /** + * Verifies an AgentToolset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AgentToolset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AgentToolset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Agent.AgentToolset; + + /** + * Creates a plain object from an AgentToolset message. Also converts values to other types if specified. + * @param message AgentToolset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Agent.AgentToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AgentToolset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AgentToolset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExpressionCondition. */ + interface IExpressionCondition { + + /** ExpressionCondition expression */ + expression?: (string|null); + } + + /** Represents an ExpressionCondition. */ + class ExpressionCondition implements IExpressionCondition { + + /** + * Constructs a new ExpressionCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IExpressionCondition); + + /** ExpressionCondition expression. */ + public expression: string; + + /** + * Creates a new ExpressionCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns ExpressionCondition instance + */ + public static create(properties?: google.cloud.ces.v1.IExpressionCondition): google.cloud.ces.v1.ExpressionCondition; + + /** + * Encodes the specified ExpressionCondition message. Does not implicitly {@link google.cloud.ces.v1.ExpressionCondition.verify|verify} messages. + * @param message ExpressionCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IExpressionCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExpressionCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExpressionCondition.verify|verify} messages. + * @param message ExpressionCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IExpressionCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExpressionCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExpressionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ExpressionCondition; + + /** + * Decodes an ExpressionCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExpressionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ExpressionCondition; + + /** + * Verifies an ExpressionCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExpressionCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExpressionCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ExpressionCondition; + + /** + * Creates a plain object from an ExpressionCondition message. Also converts values to other types if specified. + * @param message ExpressionCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ExpressionCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExpressionCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExpressionCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonCodeCondition. */ + interface IPythonCodeCondition { + + /** PythonCodeCondition pythonCode */ + pythonCode?: (string|null); + } + + /** Represents a PythonCodeCondition. */ + class PythonCodeCondition implements IPythonCodeCondition { + + /** + * Constructs a new PythonCodeCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IPythonCodeCondition); + + /** PythonCodeCondition pythonCode. */ + public pythonCode: string; + + /** + * Creates a new PythonCodeCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonCodeCondition instance + */ + public static create(properties?: google.cloud.ces.v1.IPythonCodeCondition): google.cloud.ces.v1.PythonCodeCondition; + + /** + * Encodes the specified PythonCodeCondition message. Does not implicitly {@link google.cloud.ces.v1.PythonCodeCondition.verify|verify} messages. + * @param message PythonCodeCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IPythonCodeCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonCodeCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1.PythonCodeCondition.verify|verify} messages. + * @param message PythonCodeCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IPythonCodeCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonCodeCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonCodeCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.PythonCodeCondition; + + /** + * Decodes a PythonCodeCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonCodeCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.PythonCodeCondition; + + /** + * Verifies a PythonCodeCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonCodeCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonCodeCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.PythonCodeCondition; + + /** + * Creates a plain object from a PythonCodeCondition message. Also converts values to other types if specified. + * @param message PythonCodeCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.PythonCodeCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonCodeCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonCodeCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferRule. */ + interface ITransferRule { + + /** TransferRule deterministicTransfer */ + deterministicTransfer?: (google.cloud.ces.v1.TransferRule.IDeterministicTransfer|null); + + /** TransferRule disablePlannerTransfer */ + disablePlannerTransfer?: (google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer|null); + + /** TransferRule childAgent */ + childAgent?: (string|null); + + /** TransferRule direction */ + direction?: (google.cloud.ces.v1.TransferRule.Direction|keyof typeof google.cloud.ces.v1.TransferRule.Direction|null); + } + + /** Represents a TransferRule. */ + class TransferRule implements ITransferRule { + + /** + * Constructs a new TransferRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ITransferRule); + + /** TransferRule deterministicTransfer. */ + public deterministicTransfer?: (google.cloud.ces.v1.TransferRule.IDeterministicTransfer|null); + + /** TransferRule disablePlannerTransfer. */ + public disablePlannerTransfer?: (google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer|null); + + /** TransferRule childAgent. */ + public childAgent: string; + + /** TransferRule direction. */ + public direction: (google.cloud.ces.v1.TransferRule.Direction|keyof typeof google.cloud.ces.v1.TransferRule.Direction); + + /** TransferRule ruleType. */ + public ruleType?: ("deterministicTransfer"|"disablePlannerTransfer"); + + /** + * Creates a new TransferRule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferRule instance + */ + public static create(properties?: google.cloud.ces.v1.ITransferRule): google.cloud.ces.v1.TransferRule; + + /** + * Encodes the specified TransferRule message. Does not implicitly {@link google.cloud.ces.v1.TransferRule.verify|verify} messages. + * @param message TransferRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ITransferRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferRule message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TransferRule.verify|verify} messages. + * @param message TransferRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ITransferRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TransferRule; + + /** + * Decodes a TransferRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TransferRule; + + /** + * Verifies a TransferRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TransferRule; + + /** + * Creates a plain object from a TransferRule message. Also converts values to other types if specified. + * @param message TransferRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.TransferRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransferRule { + + /** Properties of a DeterministicTransfer. */ + interface IDeterministicTransfer { + + /** DeterministicTransfer expressionCondition */ + expressionCondition?: (google.cloud.ces.v1.IExpressionCondition|null); + + /** DeterministicTransfer pythonCodeCondition */ + pythonCodeCondition?: (google.cloud.ces.v1.IPythonCodeCondition|null); + } + + /** Represents a DeterministicTransfer. */ + class DeterministicTransfer implements IDeterministicTransfer { + + /** + * Constructs a new DeterministicTransfer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.TransferRule.IDeterministicTransfer); + + /** DeterministicTransfer expressionCondition. */ + public expressionCondition?: (google.cloud.ces.v1.IExpressionCondition|null); + + /** DeterministicTransfer pythonCodeCondition. */ + public pythonCodeCondition?: (google.cloud.ces.v1.IPythonCodeCondition|null); + + /** DeterministicTransfer conditionType. */ + public conditionType?: ("expressionCondition"|"pythonCodeCondition"); + + /** + * Creates a new DeterministicTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns DeterministicTransfer instance + */ + public static create(properties?: google.cloud.ces.v1.TransferRule.IDeterministicTransfer): google.cloud.ces.v1.TransferRule.DeterministicTransfer; + + /** + * Encodes the specified DeterministicTransfer message. Does not implicitly {@link google.cloud.ces.v1.TransferRule.DeterministicTransfer.verify|verify} messages. + * @param message DeterministicTransfer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.TransferRule.IDeterministicTransfer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeterministicTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TransferRule.DeterministicTransfer.verify|verify} messages. + * @param message DeterministicTransfer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.TransferRule.IDeterministicTransfer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeterministicTransfer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeterministicTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TransferRule.DeterministicTransfer; + + /** + * Decodes a DeterministicTransfer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeterministicTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TransferRule.DeterministicTransfer; + + /** + * Verifies a DeterministicTransfer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeterministicTransfer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeterministicTransfer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TransferRule.DeterministicTransfer; + + /** + * Creates a plain object from a DeterministicTransfer message. Also converts values to other types if specified. + * @param message DeterministicTransfer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.TransferRule.DeterministicTransfer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeterministicTransfer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeterministicTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisablePlannerTransfer. */ + interface IDisablePlannerTransfer { + + /** DisablePlannerTransfer expressionCondition */ + expressionCondition?: (google.cloud.ces.v1.IExpressionCondition|null); + } + + /** Represents a DisablePlannerTransfer. */ + class DisablePlannerTransfer implements IDisablePlannerTransfer { + + /** + * Constructs a new DisablePlannerTransfer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer); + + /** DisablePlannerTransfer expressionCondition. */ + public expressionCondition?: (google.cloud.ces.v1.IExpressionCondition|null); + + /** + * Creates a new DisablePlannerTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns DisablePlannerTransfer instance + */ + public static create(properties?: google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer): google.cloud.ces.v1.TransferRule.DisablePlannerTransfer; + + /** + * Encodes the specified DisablePlannerTransfer message. Does not implicitly {@link google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.verify|verify} messages. + * @param message DisablePlannerTransfer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisablePlannerTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.verify|verify} messages. + * @param message DisablePlannerTransfer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisablePlannerTransfer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisablePlannerTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TransferRule.DisablePlannerTransfer; + + /** + * Decodes a DisablePlannerTransfer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisablePlannerTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TransferRule.DisablePlannerTransfer; + + /** + * Verifies a DisablePlannerTransfer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisablePlannerTransfer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisablePlannerTransfer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TransferRule.DisablePlannerTransfer; + + /** + * Creates a plain object from a DisablePlannerTransfer message. Also converts values to other types if specified. + * @param message DisablePlannerTransfer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.TransferRule.DisablePlannerTransfer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisablePlannerTransfer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisablePlannerTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Direction enum. */ + enum Direction { + DIRECTION_UNSPECIFIED = 0, + PARENT_TO_CHILD = 1, + CHILD_TO_PARENT = 2 + } + } + + /** ExecutionType enum. */ + enum ExecutionType { + EXECUTION_TYPE_UNSPECIFIED = 0, + SYNCHRONOUS = 1, + ASYNCHRONOUS = 2 + } + + /** Properties of a Callback. */ + interface ICallback { + + /** Callback pythonCode */ + pythonCode?: (string|null); + + /** Callback description */ + description?: (string|null); + + /** Callback disabled */ + disabled?: (boolean|null); + + /** Callback proactiveExecutionEnabled */ + proactiveExecutionEnabled?: (boolean|null); + } + + /** Represents a Callback. */ + class Callback implements ICallback { + + /** + * Constructs a new Callback. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ICallback); + + /** Callback pythonCode. */ + public pythonCode?: (string|null); + + /** Callback description. */ + public description: string; + + /** Callback disabled. */ + public disabled: boolean; + + /** Callback proactiveExecutionEnabled. */ + public proactiveExecutionEnabled: boolean; + + /** Callback callback. */ + public callback?: "pythonCode"; + + /** + * Creates a new Callback instance using the specified properties. + * @param [properties] Properties to set + * @returns Callback instance + */ + public static create(properties?: google.cloud.ces.v1.ICallback): google.cloud.ces.v1.Callback; + + /** + * Encodes the specified Callback message. Does not implicitly {@link google.cloud.ces.v1.Callback.verify|verify} messages. + * @param message Callback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ICallback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Callback message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Callback.verify|verify} messages. + * @param message Callback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ICallback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Callback message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Callback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Callback; + + /** + * Decodes a Callback message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Callback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Callback; + + /** + * Verifies a Callback message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Callback message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Callback + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Callback; + + /** + * Creates a plain object from a Callback message. Also converts values to other types if specified. + * @param message Callback + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Callback, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Callback to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Callback + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModelSettings. */ + interface IModelSettings { + + /** ModelSettings model */ + model?: (string|null); + + /** ModelSettings temperature */ + temperature?: (number|null); + } + + /** Represents a ModelSettings. */ + class ModelSettings implements IModelSettings { + + /** + * Constructs a new ModelSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IModelSettings); + + /** ModelSettings model. */ + public model: string; + + /** ModelSettings temperature. */ + public temperature?: (number|null); + + /** + * Creates a new ModelSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelSettings instance + */ + public static create(properties?: google.cloud.ces.v1.IModelSettings): google.cloud.ces.v1.ModelSettings; + + /** + * Encodes the specified ModelSettings message. Does not implicitly {@link google.cloud.ces.v1.ModelSettings.verify|verify} messages. + * @param message ModelSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IModelSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ModelSettings.verify|verify} messages. + * @param message ModelSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IModelSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ModelSettings; + + /** + * Decodes a ModelSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ModelSettings; + + /** + * Verifies a ModelSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ModelSettings; + + /** + * Creates a plain object from a ModelSettings message. Also converts values to other types if specified. + * @param message ModelSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ModelSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TriggerAction. */ + interface ITriggerAction { + + /** TriggerAction respondImmediately */ + respondImmediately?: (google.cloud.ces.v1.TriggerAction.IRespondImmediately|null); + + /** TriggerAction transferAgent */ + transferAgent?: (google.cloud.ces.v1.TriggerAction.ITransferAgent|null); + + /** TriggerAction generativeAnswer */ + generativeAnswer?: (google.cloud.ces.v1.TriggerAction.IGenerativeAnswer|null); + } + + /** Represents a TriggerAction. */ + class TriggerAction implements ITriggerAction { + + /** + * Constructs a new TriggerAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ITriggerAction); + + /** TriggerAction respondImmediately. */ + public respondImmediately?: (google.cloud.ces.v1.TriggerAction.IRespondImmediately|null); + + /** TriggerAction transferAgent. */ + public transferAgent?: (google.cloud.ces.v1.TriggerAction.ITransferAgent|null); + + /** TriggerAction generativeAnswer. */ + public generativeAnswer?: (google.cloud.ces.v1.TriggerAction.IGenerativeAnswer|null); + + /** TriggerAction action. */ + public action?: ("respondImmediately"|"transferAgent"|"generativeAnswer"); + + /** + * Creates a new TriggerAction instance using the specified properties. + * @param [properties] Properties to set + * @returns TriggerAction instance + */ + public static create(properties?: google.cloud.ces.v1.ITriggerAction): google.cloud.ces.v1.TriggerAction; + + /** + * Encodes the specified TriggerAction message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.verify|verify} messages. + * @param message TriggerAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ITriggerAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TriggerAction message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.verify|verify} messages. + * @param message TriggerAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ITriggerAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TriggerAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TriggerAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TriggerAction; + + /** + * Decodes a TriggerAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TriggerAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TriggerAction; + + /** + * Verifies a TriggerAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TriggerAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TriggerAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TriggerAction; + + /** + * Creates a plain object from a TriggerAction message. Also converts values to other types if specified. + * @param message TriggerAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.TriggerAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TriggerAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TriggerAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TriggerAction { + + /** Properties of a Response. */ + interface IResponse { + + /** Response text */ + text?: (string|null); + + /** Response disabled */ + disabled?: (boolean|null); + } + + /** Represents a Response. */ + class Response implements IResponse { + + /** + * Constructs a new Response. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.TriggerAction.IResponse); + + /** Response text. */ + public text: string; + + /** Response disabled. */ + public disabled: boolean; + + /** + * Creates a new Response instance using the specified properties. + * @param [properties] Properties to set + * @returns Response instance + */ + public static create(properties?: google.cloud.ces.v1.TriggerAction.IResponse): google.cloud.ces.v1.TriggerAction.Response; + + /** + * Encodes the specified Response message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.Response.verify|verify} messages. + * @param message Response message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.TriggerAction.IResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Response message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.Response.verify|verify} messages. + * @param message Response message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.TriggerAction.IResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Response message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Response + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TriggerAction.Response; + + /** + * Decodes a Response message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Response + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TriggerAction.Response; + + /** + * Verifies a Response message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Response message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Response + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TriggerAction.Response; + + /** + * Creates a plain object from a Response message. Also converts values to other types if specified. + * @param message Response + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.TriggerAction.Response, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Response to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Response + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RespondImmediately. */ + interface IRespondImmediately { + + /** RespondImmediately responses */ + responses?: (google.cloud.ces.v1.TriggerAction.IResponse[]|null); + } + + /** Represents a RespondImmediately. */ + class RespondImmediately implements IRespondImmediately { + + /** + * Constructs a new RespondImmediately. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.TriggerAction.IRespondImmediately); + + /** RespondImmediately responses. */ + public responses: google.cloud.ces.v1.TriggerAction.IResponse[]; + + /** + * Creates a new RespondImmediately instance using the specified properties. + * @param [properties] Properties to set + * @returns RespondImmediately instance + */ + public static create(properties?: google.cloud.ces.v1.TriggerAction.IRespondImmediately): google.cloud.ces.v1.TriggerAction.RespondImmediately; + + /** + * Encodes the specified RespondImmediately message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.RespondImmediately.verify|verify} messages. + * @param message RespondImmediately message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.TriggerAction.IRespondImmediately, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RespondImmediately message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.RespondImmediately.verify|verify} messages. + * @param message RespondImmediately message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.TriggerAction.IRespondImmediately, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RespondImmediately message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RespondImmediately + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TriggerAction.RespondImmediately; + + /** + * Decodes a RespondImmediately message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RespondImmediately + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TriggerAction.RespondImmediately; + + /** + * Verifies a RespondImmediately message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RespondImmediately message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RespondImmediately + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TriggerAction.RespondImmediately; + + /** + * Creates a plain object from a RespondImmediately message. Also converts values to other types if specified. + * @param message RespondImmediately + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.TriggerAction.RespondImmediately, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RespondImmediately to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RespondImmediately + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerativeAnswer. */ + interface IGenerativeAnswer { + + /** GenerativeAnswer prompt */ + prompt?: (string|null); + } + + /** Represents a GenerativeAnswer. */ + class GenerativeAnswer implements IGenerativeAnswer { + + /** + * Constructs a new GenerativeAnswer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.TriggerAction.IGenerativeAnswer); + + /** GenerativeAnswer prompt. */ + public prompt: string; + + /** + * Creates a new GenerativeAnswer instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerativeAnswer instance + */ + public static create(properties?: google.cloud.ces.v1.TriggerAction.IGenerativeAnswer): google.cloud.ces.v1.TriggerAction.GenerativeAnswer; + + /** + * Encodes the specified GenerativeAnswer message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.GenerativeAnswer.verify|verify} messages. + * @param message GenerativeAnswer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.TriggerAction.IGenerativeAnswer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerativeAnswer message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.GenerativeAnswer.verify|verify} messages. + * @param message GenerativeAnswer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.TriggerAction.IGenerativeAnswer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerativeAnswer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerativeAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TriggerAction.GenerativeAnswer; + + /** + * Decodes a GenerativeAnswer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerativeAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TriggerAction.GenerativeAnswer; + + /** + * Verifies a GenerativeAnswer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerativeAnswer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerativeAnswer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TriggerAction.GenerativeAnswer; + + /** + * Creates a plain object from a GenerativeAnswer message. Also converts values to other types if specified. + * @param message GenerativeAnswer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.TriggerAction.GenerativeAnswer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerativeAnswer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerativeAnswer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferAgent. */ + interface ITransferAgent { + + /** TransferAgent agent */ + agent?: (string|null); + } + + /** Represents a TransferAgent. */ + class TransferAgent implements ITransferAgent { + + /** + * Constructs a new TransferAgent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.TriggerAction.ITransferAgent); + + /** TransferAgent agent. */ + public agent: string; + + /** + * Creates a new TransferAgent instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferAgent instance + */ + public static create(properties?: google.cloud.ces.v1.TriggerAction.ITransferAgent): google.cloud.ces.v1.TriggerAction.TransferAgent; + + /** + * Encodes the specified TransferAgent message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.TransferAgent.verify|verify} messages. + * @param message TransferAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.TriggerAction.ITransferAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.TransferAgent.verify|verify} messages. + * @param message TransferAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.TriggerAction.ITransferAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferAgent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TriggerAction.TransferAgent; + + /** + * Decodes a TransferAgent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TriggerAction.TransferAgent; + + /** + * Verifies a TransferAgent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferAgent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferAgent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TriggerAction.TransferAgent; + + /** + * Creates a plain object from a TransferAgent message. Also converts values to other types if specified. + * @param message TransferAgent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.TriggerAction.TransferAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferAgent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferAgent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TlsConfig. */ + interface ITlsConfig { + + /** TlsConfig caCerts */ + caCerts?: (google.cloud.ces.v1.TlsConfig.ICaCert[]|null); + } + + /** Represents a TlsConfig. */ + class TlsConfig implements ITlsConfig { + + /** + * Constructs a new TlsConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ITlsConfig); + + /** TlsConfig caCerts. */ + public caCerts: google.cloud.ces.v1.TlsConfig.ICaCert[]; + + /** + * Creates a new TlsConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TlsConfig instance + */ + public static create(properties?: google.cloud.ces.v1.ITlsConfig): google.cloud.ces.v1.TlsConfig; + + /** + * Encodes the specified TlsConfig message. Does not implicitly {@link google.cloud.ces.v1.TlsConfig.verify|verify} messages. + * @param message TlsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ITlsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TlsConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TlsConfig.verify|verify} messages. + * @param message TlsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ITlsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TlsConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TlsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TlsConfig; + + /** + * Decodes a TlsConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TlsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TlsConfig; + + /** + * Verifies a TlsConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TlsConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TlsConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TlsConfig; + + /** + * Creates a plain object from a TlsConfig message. Also converts values to other types if specified. + * @param message TlsConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.TlsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TlsConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TlsConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TlsConfig { + + /** Properties of a CaCert. */ + interface ICaCert { + + /** CaCert displayName */ + displayName?: (string|null); + + /** CaCert cert */ + cert?: (Uint8Array|Buffer|string|null); + } + + /** Represents a CaCert. */ + class CaCert implements ICaCert { + + /** + * Constructs a new CaCert. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.TlsConfig.ICaCert); + + /** CaCert displayName. */ + public displayName: string; + + /** CaCert cert. */ + public cert: (Uint8Array|Buffer|string); + + /** + * Creates a new CaCert instance using the specified properties. + * @param [properties] Properties to set + * @returns CaCert instance + */ + public static create(properties?: google.cloud.ces.v1.TlsConfig.ICaCert): google.cloud.ces.v1.TlsConfig.CaCert; + + /** + * Encodes the specified CaCert message. Does not implicitly {@link google.cloud.ces.v1.TlsConfig.CaCert.verify|verify} messages. + * @param message CaCert message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.TlsConfig.ICaCert, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CaCert message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TlsConfig.CaCert.verify|verify} messages. + * @param message CaCert message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.TlsConfig.ICaCert, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CaCert message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CaCert + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TlsConfig.CaCert; + + /** + * Decodes a CaCert message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CaCert + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TlsConfig.CaCert; + + /** + * Verifies a CaCert message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CaCert message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CaCert + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TlsConfig.CaCert; + + /** + * Creates a plain object from a CaCert message. Also converts values to other types if specified. + * @param message CaCert + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.TlsConfig.CaCert, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CaCert to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CaCert + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ServiceDirectoryConfig. */ + interface IServiceDirectoryConfig { + + /** ServiceDirectoryConfig service */ + service?: (string|null); + } + + /** Represents a ServiceDirectoryConfig. */ + class ServiceDirectoryConfig implements IServiceDirectoryConfig { + + /** + * Constructs a new ServiceDirectoryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IServiceDirectoryConfig); + + /** ServiceDirectoryConfig service. */ + public service: string; + + /** + * Creates a new ServiceDirectoryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDirectoryConfig instance + */ + public static create(properties?: google.cloud.ces.v1.IServiceDirectoryConfig): google.cloud.ces.v1.ServiceDirectoryConfig; + + /** + * Encodes the specified ServiceDirectoryConfig message. Does not implicitly {@link google.cloud.ces.v1.ServiceDirectoryConfig.verify|verify} messages. + * @param message ServiceDirectoryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IServiceDirectoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDirectoryConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ServiceDirectoryConfig.verify|verify} messages. + * @param message ServiceDirectoryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IServiceDirectoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ServiceDirectoryConfig; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ServiceDirectoryConfig; + + /** + * Verifies a ServiceDirectoryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDirectoryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDirectoryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ServiceDirectoryConfig; + + /** + * Creates a plain object from a ServiceDirectoryConfig message. Also converts values to other types if specified. + * @param message ServiceDirectoryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ServiceDirectoryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDirectoryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDirectoryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChannelProfile. */ + interface IChannelProfile { + + /** ChannelProfile profileId */ + profileId?: (string|null); + + /** ChannelProfile channelType */ + channelType?: (google.cloud.ces.v1.ChannelProfile.ChannelType|keyof typeof google.cloud.ces.v1.ChannelProfile.ChannelType|null); + + /** ChannelProfile personaProperty */ + personaProperty?: (google.cloud.ces.v1.ChannelProfile.IPersonaProperty|null); + + /** ChannelProfile disableDtmf */ + disableDtmf?: (boolean|null); + + /** ChannelProfile disableBargeInControl */ + disableBargeInControl?: (boolean|null); + + /** ChannelProfile webWidgetConfig */ + webWidgetConfig?: (google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig|null); + + /** ChannelProfile noiseSuppressionLevel */ + noiseSuppressionLevel?: (string|null); + } + + /** Represents a ChannelProfile. */ + class ChannelProfile implements IChannelProfile { + + /** + * Constructs a new ChannelProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IChannelProfile); + + /** ChannelProfile profileId. */ + public profileId: string; + + /** ChannelProfile channelType. */ + public channelType: (google.cloud.ces.v1.ChannelProfile.ChannelType|keyof typeof google.cloud.ces.v1.ChannelProfile.ChannelType); + + /** ChannelProfile personaProperty. */ + public personaProperty?: (google.cloud.ces.v1.ChannelProfile.IPersonaProperty|null); + + /** ChannelProfile disableDtmf. */ + public disableDtmf: boolean; + + /** ChannelProfile disableBargeInControl. */ + public disableBargeInControl: boolean; + + /** ChannelProfile webWidgetConfig. */ + public webWidgetConfig?: (google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig|null); + + /** ChannelProfile noiseSuppressionLevel. */ + public noiseSuppressionLevel: string; + + /** + * Creates a new ChannelProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns ChannelProfile instance + */ + public static create(properties?: google.cloud.ces.v1.IChannelProfile): google.cloud.ces.v1.ChannelProfile; + + /** + * Encodes the specified ChannelProfile message. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.verify|verify} messages. + * @param message ChannelProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IChannelProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChannelProfile message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.verify|verify} messages. + * @param message ChannelProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IChannelProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChannelProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChannelProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ChannelProfile; + + /** + * Decodes a ChannelProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChannelProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ChannelProfile; + + /** + * Verifies a ChannelProfile message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChannelProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChannelProfile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ChannelProfile; + + /** + * Creates a plain object from a ChannelProfile message. Also converts values to other types if specified. + * @param message ChannelProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ChannelProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChannelProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChannelProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ChannelProfile { + + /** Properties of a PersonaProperty. */ + interface IPersonaProperty { + + /** PersonaProperty persona */ + persona?: (google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona|keyof typeof google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona|null); + } + + /** Represents a PersonaProperty. */ + class PersonaProperty implements IPersonaProperty { + + /** + * Constructs a new PersonaProperty. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ChannelProfile.IPersonaProperty); + + /** PersonaProperty persona. */ + public persona: (google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona|keyof typeof google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona); + + /** + * Creates a new PersonaProperty instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonaProperty instance + */ + public static create(properties?: google.cloud.ces.v1.ChannelProfile.IPersonaProperty): google.cloud.ces.v1.ChannelProfile.PersonaProperty; + + /** + * Encodes the specified PersonaProperty message. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.PersonaProperty.verify|verify} messages. + * @param message PersonaProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ChannelProfile.IPersonaProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersonaProperty message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.PersonaProperty.verify|verify} messages. + * @param message PersonaProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ChannelProfile.IPersonaProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersonaProperty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonaProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ChannelProfile.PersonaProperty; + + /** + * Decodes a PersonaProperty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonaProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ChannelProfile.PersonaProperty; + + /** + * Verifies a PersonaProperty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PersonaProperty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonaProperty + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ChannelProfile.PersonaProperty; + + /** + * Creates a plain object from a PersonaProperty message. Also converts values to other types if specified. + * @param message PersonaProperty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ChannelProfile.PersonaProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersonaProperty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PersonaProperty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PersonaProperty { + + /** Persona enum. */ + enum Persona { + UNKNOWN = 0, + CONCISE = 1, + CHATTY = 2 + } + } + + /** Properties of a WebWidgetConfig. */ + interface IWebWidgetConfig { + + /** WebWidgetConfig modality */ + modality?: (google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality|keyof typeof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality|null); + + /** WebWidgetConfig theme */ + theme?: (google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme|keyof typeof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme|null); + + /** WebWidgetConfig webWidgetTitle */ + webWidgetTitle?: (string|null); + + /** WebWidgetConfig securitySettings */ + securitySettings?: (google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings|null); + } + + /** Represents a WebWidgetConfig. */ + class WebWidgetConfig implements IWebWidgetConfig { + + /** + * Constructs a new WebWidgetConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig); + + /** WebWidgetConfig modality. */ + public modality: (google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality|keyof typeof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality); + + /** WebWidgetConfig theme. */ + public theme: (google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme|keyof typeof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme); + + /** WebWidgetConfig webWidgetTitle. */ + public webWidgetTitle: string; + + /** WebWidgetConfig securitySettings. */ + public securitySettings?: (google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings|null); + + /** + * Creates a new WebWidgetConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns WebWidgetConfig instance + */ + public static create(properties?: google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig): google.cloud.ces.v1.ChannelProfile.WebWidgetConfig; + + /** + * Encodes the specified WebWidgetConfig message. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.verify|verify} messages. + * @param message WebWidgetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebWidgetConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.verify|verify} messages. + * @param message WebWidgetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebWidgetConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebWidgetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ChannelProfile.WebWidgetConfig; + + /** + * Decodes a WebWidgetConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebWidgetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ChannelProfile.WebWidgetConfig; + + /** + * Verifies a WebWidgetConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebWidgetConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebWidgetConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ChannelProfile.WebWidgetConfig; + + /** + * Creates a plain object from a WebWidgetConfig message. Also converts values to other types if specified. + * @param message WebWidgetConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ChannelProfile.WebWidgetConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebWidgetConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebWidgetConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WebWidgetConfig { + + /** Properties of a SecuritySettings. */ + interface ISecuritySettings { + + /** SecuritySettings enablePublicAccess */ + enablePublicAccess?: (boolean|null); + + /** SecuritySettings enableOriginCheck */ + enableOriginCheck?: (boolean|null); + + /** SecuritySettings allowedOrigins */ + allowedOrigins?: (string[]|null); + + /** SecuritySettings enableRecaptcha */ + enableRecaptcha?: (boolean|null); + } + + /** Represents a SecuritySettings. */ + class SecuritySettings implements ISecuritySettings { + + /** + * Constructs a new SecuritySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings); + + /** SecuritySettings enablePublicAccess. */ + public enablePublicAccess: boolean; + + /** SecuritySettings enableOriginCheck. */ + public enableOriginCheck: boolean; + + /** SecuritySettings allowedOrigins. */ + public allowedOrigins: string[]; + + /** SecuritySettings enableRecaptcha. */ + public enableRecaptcha: boolean; + + /** + * Creates a new SecuritySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SecuritySettings instance + */ + public static create(properties?: google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings): google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings; + + /** + * Encodes the specified SecuritySettings message. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. + * @param message SecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. + * @param message SecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings; + + /** + * Verifies a SecuritySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecuritySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecuritySettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings; + + /** + * Creates a plain object from a SecuritySettings message. Also converts values to other types if specified. + * @param message SecuritySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecuritySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecuritySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Modality enum. */ + enum Modality { + MODALITY_UNSPECIFIED = 0, + CHAT_AND_VOICE = 1, + VOICE_ONLY = 2, + CHAT_ONLY = 3 + } + + /** Theme enum. */ + enum Theme { + THEME_UNSPECIFIED = 0, + LIGHT = 1, + DARK = 2 + } + } + + /** ChannelType enum. */ + enum ChannelType { + UNKNOWN = 0, + WEB_UI = 2, + API = 3, + TWILIO = 4, + GOOGLE_TELEPHONY_PLATFORM = 5, + CONTACT_CENTER_AS_A_SERVICE = 6, + FIVE9 = 7 + } + } + + /** Properties of a Span. */ + interface ISpan { + + /** Span name */ + name?: (string|null); + + /** Span startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Span endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Span duration */ + duration?: (google.protobuf.IDuration|null); + + /** Span attributes */ + attributes?: (google.protobuf.IStruct|null); + + /** Span childSpans */ + childSpans?: (google.cloud.ces.v1.ISpan[]|null); + } + + /** Represents a Span. */ + class Span implements ISpan { + + /** + * Constructs a new Span. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ISpan); + + /** Span name. */ + public name: string; + + /** Span startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Span endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Span duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** Span attributes. */ + public attributes?: (google.protobuf.IStruct|null); + + /** Span childSpans. */ + public childSpans: google.cloud.ces.v1.ISpan[]; + + /** + * Creates a new Span instance using the specified properties. + * @param [properties] Properties to set + * @returns Span instance + */ + public static create(properties?: google.cloud.ces.v1.ISpan): google.cloud.ces.v1.Span; + + /** + * Encodes the specified Span message. Does not implicitly {@link google.cloud.ces.v1.Span.verify|verify} messages. + * @param message Span message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ISpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Span message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Span.verify|verify} messages. + * @param message Span message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ISpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Span message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Span + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Span; + + /** + * Decodes a Span message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Span + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Span; + + /** + * Verifies a Span message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Span message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Span + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Span; + + /** + * Creates a plain object from a Span message. Also converts values to other types if specified. + * @param message Span + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Span, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Span to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Span + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an AgentService */ + class AgentService extends $protobuf.rpc.Service { + + /** + * Constructs a new AgentService 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 AgentService 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): AgentService; + + /** + * Calls ListApps. + * @param request ListAppsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAppsResponse + */ + public listApps(request: google.cloud.ces.v1.IListAppsRequest, callback: google.cloud.ces.v1.AgentService.ListAppsCallback): void; + + /** + * Calls ListApps. + * @param request ListAppsRequest message or plain object + * @returns Promise + */ + public listApps(request: google.cloud.ces.v1.IListAppsRequest): Promise; + + /** + * Calls GetApp. + * @param request GetAppRequest message or plain object + * @param callback Node-style callback called with the error, if any, and App + */ + public getApp(request: google.cloud.ces.v1.IGetAppRequest, callback: google.cloud.ces.v1.AgentService.GetAppCallback): void; + + /** + * Calls GetApp. + * @param request GetAppRequest message or plain object + * @returns Promise + */ + public getApp(request: google.cloud.ces.v1.IGetAppRequest): Promise; + + /** + * Calls CreateApp. + * @param request CreateAppRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createApp(request: google.cloud.ces.v1.ICreateAppRequest, callback: google.cloud.ces.v1.AgentService.CreateAppCallback): void; + + /** + * Calls CreateApp. + * @param request CreateAppRequest message or plain object + * @returns Promise + */ + public createApp(request: google.cloud.ces.v1.ICreateAppRequest): Promise; + + /** + * Calls UpdateApp. + * @param request UpdateAppRequest message or plain object + * @param callback Node-style callback called with the error, if any, and App + */ + public updateApp(request: google.cloud.ces.v1.IUpdateAppRequest, callback: google.cloud.ces.v1.AgentService.UpdateAppCallback): void; + + /** + * Calls UpdateApp. + * @param request UpdateAppRequest message or plain object + * @returns Promise + */ + public updateApp(request: google.cloud.ces.v1.IUpdateAppRequest): Promise; + + /** + * Calls DeleteApp. + * @param request DeleteAppRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteApp(request: google.cloud.ces.v1.IDeleteAppRequest, callback: google.cloud.ces.v1.AgentService.DeleteAppCallback): void; + + /** + * Calls DeleteApp. + * @param request DeleteAppRequest message or plain object + * @returns Promise + */ + public deleteApp(request: google.cloud.ces.v1.IDeleteAppRequest): Promise; + + /** + * Calls ExportApp. + * @param request ExportAppRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportApp(request: google.cloud.ces.v1.IExportAppRequest, callback: google.cloud.ces.v1.AgentService.ExportAppCallback): void; + + /** + * Calls ExportApp. + * @param request ExportAppRequest message or plain object + * @returns Promise + */ + public exportApp(request: google.cloud.ces.v1.IExportAppRequest): Promise; + + /** + * Calls ImportApp. + * @param request ImportAppRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importApp(request: google.cloud.ces.v1.IImportAppRequest, callback: google.cloud.ces.v1.AgentService.ImportAppCallback): void; + + /** + * Calls ImportApp. + * @param request ImportAppRequest message or plain object + * @returns Promise + */ + public importApp(request: google.cloud.ces.v1.IImportAppRequest): Promise; + + /** + * Calls ListAgents. + * @param request ListAgentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAgentsResponse + */ + public listAgents(request: google.cloud.ces.v1.IListAgentsRequest, callback: google.cloud.ces.v1.AgentService.ListAgentsCallback): void; + + /** + * Calls ListAgents. + * @param request ListAgentsRequest message or plain object + * @returns Promise + */ + public listAgents(request: google.cloud.ces.v1.IListAgentsRequest): Promise; + + /** + * Calls GetAgent. + * @param request GetAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Agent + */ + public getAgent(request: google.cloud.ces.v1.IGetAgentRequest, callback: google.cloud.ces.v1.AgentService.GetAgentCallback): void; + + /** + * Calls GetAgent. + * @param request GetAgentRequest message or plain object + * @returns Promise + */ + public getAgent(request: google.cloud.ces.v1.IGetAgentRequest): Promise; + + /** + * Calls CreateAgent. + * @param request CreateAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Agent + */ + public createAgent(request: google.cloud.ces.v1.ICreateAgentRequest, callback: google.cloud.ces.v1.AgentService.CreateAgentCallback): void; + + /** + * Calls CreateAgent. + * @param request CreateAgentRequest message or plain object + * @returns Promise + */ + public createAgent(request: google.cloud.ces.v1.ICreateAgentRequest): Promise; + + /** + * Calls UpdateAgent. + * @param request UpdateAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Agent + */ + public updateAgent(request: google.cloud.ces.v1.IUpdateAgentRequest, callback: google.cloud.ces.v1.AgentService.UpdateAgentCallback): void; + + /** + * Calls UpdateAgent. + * @param request UpdateAgentRequest message or plain object + * @returns Promise + */ + public updateAgent(request: google.cloud.ces.v1.IUpdateAgentRequest): Promise; + + /** + * Calls DeleteAgent. + * @param request DeleteAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAgent(request: google.cloud.ces.v1.IDeleteAgentRequest, callback: google.cloud.ces.v1.AgentService.DeleteAgentCallback): void; + + /** + * Calls DeleteAgent. + * @param request DeleteAgentRequest message or plain object + * @returns Promise + */ + public deleteAgent(request: google.cloud.ces.v1.IDeleteAgentRequest): Promise; + + /** + * Calls ListExamples. + * @param request ListExamplesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListExamplesResponse + */ + public listExamples(request: google.cloud.ces.v1.IListExamplesRequest, callback: google.cloud.ces.v1.AgentService.ListExamplesCallback): void; + + /** + * Calls ListExamples. + * @param request ListExamplesRequest message or plain object + * @returns Promise + */ + public listExamples(request: google.cloud.ces.v1.IListExamplesRequest): Promise; + + /** + * Calls GetExample. + * @param request GetExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Example + */ + public getExample(request: google.cloud.ces.v1.IGetExampleRequest, callback: google.cloud.ces.v1.AgentService.GetExampleCallback): void; + + /** + * Calls GetExample. + * @param request GetExampleRequest message or plain object + * @returns Promise + */ + public getExample(request: google.cloud.ces.v1.IGetExampleRequest): Promise; + + /** + * Calls CreateExample. + * @param request CreateExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Example + */ + public createExample(request: google.cloud.ces.v1.ICreateExampleRequest, callback: google.cloud.ces.v1.AgentService.CreateExampleCallback): void; + + /** + * Calls CreateExample. + * @param request CreateExampleRequest message or plain object + * @returns Promise + */ + public createExample(request: google.cloud.ces.v1.ICreateExampleRequest): Promise; + + /** + * Calls UpdateExample. + * @param request UpdateExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Example + */ + public updateExample(request: google.cloud.ces.v1.IUpdateExampleRequest, callback: google.cloud.ces.v1.AgentService.UpdateExampleCallback): void; + + /** + * Calls UpdateExample. + * @param request UpdateExampleRequest message or plain object + * @returns Promise + */ + public updateExample(request: google.cloud.ces.v1.IUpdateExampleRequest): Promise; + + /** + * Calls DeleteExample. + * @param request DeleteExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteExample(request: google.cloud.ces.v1.IDeleteExampleRequest, callback: google.cloud.ces.v1.AgentService.DeleteExampleCallback): void; + + /** + * Calls DeleteExample. + * @param request DeleteExampleRequest message or plain object + * @returns Promise + */ + public deleteExample(request: google.cloud.ces.v1.IDeleteExampleRequest): Promise; + + /** + * Calls ListTools. + * @param request ListToolsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListToolsResponse + */ + public listTools(request: google.cloud.ces.v1.IListToolsRequest, callback: google.cloud.ces.v1.AgentService.ListToolsCallback): void; + + /** + * Calls ListTools. + * @param request ListToolsRequest message or plain object + * @returns Promise + */ + public listTools(request: google.cloud.ces.v1.IListToolsRequest): Promise; + + /** + * Calls GetTool. + * @param request GetToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tool + */ + public getTool(request: google.cloud.ces.v1.IGetToolRequest, callback: google.cloud.ces.v1.AgentService.GetToolCallback): void; + + /** + * Calls GetTool. + * @param request GetToolRequest message or plain object + * @returns Promise + */ + public getTool(request: google.cloud.ces.v1.IGetToolRequest): Promise; + + /** + * Calls ListConversations. + * @param request ListConversationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListConversationsResponse + */ + public listConversations(request: google.cloud.ces.v1.IListConversationsRequest, callback: google.cloud.ces.v1.AgentService.ListConversationsCallback): void; + + /** + * Calls ListConversations. + * @param request ListConversationsRequest message or plain object + * @returns Promise + */ + public listConversations(request: google.cloud.ces.v1.IListConversationsRequest): Promise; + + /** + * Calls GetConversation. + * @param request GetConversationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Conversation + */ + public getConversation(request: google.cloud.ces.v1.IGetConversationRequest, callback: google.cloud.ces.v1.AgentService.GetConversationCallback): void; + + /** + * Calls GetConversation. + * @param request GetConversationRequest message or plain object + * @returns Promise + */ + public getConversation(request: google.cloud.ces.v1.IGetConversationRequest): Promise; + + /** + * Calls DeleteConversation. + * @param request DeleteConversationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteConversation(request: google.cloud.ces.v1.IDeleteConversationRequest, callback: google.cloud.ces.v1.AgentService.DeleteConversationCallback): void; + + /** + * Calls DeleteConversation. + * @param request DeleteConversationRequest message or plain object + * @returns Promise + */ + public deleteConversation(request: google.cloud.ces.v1.IDeleteConversationRequest): Promise; + + /** + * Calls BatchDeleteConversations. + * @param request BatchDeleteConversationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchDeleteConversations(request: google.cloud.ces.v1.IBatchDeleteConversationsRequest, callback: google.cloud.ces.v1.AgentService.BatchDeleteConversationsCallback): void; + + /** + * Calls BatchDeleteConversations. + * @param request BatchDeleteConversationsRequest message or plain object + * @returns Promise + */ + public batchDeleteConversations(request: google.cloud.ces.v1.IBatchDeleteConversationsRequest): Promise; + + /** + * Calls CreateTool. + * @param request CreateToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tool + */ + public createTool(request: google.cloud.ces.v1.ICreateToolRequest, callback: google.cloud.ces.v1.AgentService.CreateToolCallback): void; + + /** + * Calls CreateTool. + * @param request CreateToolRequest message or plain object + * @returns Promise + */ + public createTool(request: google.cloud.ces.v1.ICreateToolRequest): Promise; + + /** + * Calls UpdateTool. + * @param request UpdateToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tool + */ + public updateTool(request: google.cloud.ces.v1.IUpdateToolRequest, callback: google.cloud.ces.v1.AgentService.UpdateToolCallback): void; + + /** + * Calls UpdateTool. + * @param request UpdateToolRequest message or plain object + * @returns Promise + */ + public updateTool(request: google.cloud.ces.v1.IUpdateToolRequest): Promise; + + /** + * Calls DeleteTool. + * @param request DeleteToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTool(request: google.cloud.ces.v1.IDeleteToolRequest, callback: google.cloud.ces.v1.AgentService.DeleteToolCallback): void; + + /** + * Calls DeleteTool. + * @param request DeleteToolRequest message or plain object + * @returns Promise + */ + public deleteTool(request: google.cloud.ces.v1.IDeleteToolRequest): Promise; + + /** + * Calls ListGuardrails. + * @param request ListGuardrailsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGuardrailsResponse + */ + public listGuardrails(request: google.cloud.ces.v1.IListGuardrailsRequest, callback: google.cloud.ces.v1.AgentService.ListGuardrailsCallback): void; + + /** + * Calls ListGuardrails. + * @param request ListGuardrailsRequest message or plain object + * @returns Promise + */ + public listGuardrails(request: google.cloud.ces.v1.IListGuardrailsRequest): Promise; + + /** + * Calls GetGuardrail. + * @param request GetGuardrailRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Guardrail + */ + public getGuardrail(request: google.cloud.ces.v1.IGetGuardrailRequest, callback: google.cloud.ces.v1.AgentService.GetGuardrailCallback): void; + + /** + * Calls GetGuardrail. + * @param request GetGuardrailRequest message or plain object + * @returns Promise + */ + public getGuardrail(request: google.cloud.ces.v1.IGetGuardrailRequest): Promise; + + /** + * Calls CreateGuardrail. + * @param request CreateGuardrailRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Guardrail + */ + public createGuardrail(request: google.cloud.ces.v1.ICreateGuardrailRequest, callback: google.cloud.ces.v1.AgentService.CreateGuardrailCallback): void; + + /** + * Calls CreateGuardrail. + * @param request CreateGuardrailRequest message or plain object + * @returns Promise + */ + public createGuardrail(request: google.cloud.ces.v1.ICreateGuardrailRequest): Promise; + + /** + * Calls UpdateGuardrail. + * @param request UpdateGuardrailRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Guardrail + */ + public updateGuardrail(request: google.cloud.ces.v1.IUpdateGuardrailRequest, callback: google.cloud.ces.v1.AgentService.UpdateGuardrailCallback): void; + + /** + * Calls UpdateGuardrail. + * @param request UpdateGuardrailRequest message or plain object + * @returns Promise + */ + public updateGuardrail(request: google.cloud.ces.v1.IUpdateGuardrailRequest): Promise; + + /** + * Calls DeleteGuardrail. + * @param request DeleteGuardrailRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteGuardrail(request: google.cloud.ces.v1.IDeleteGuardrailRequest, callback: google.cloud.ces.v1.AgentService.DeleteGuardrailCallback): void; + + /** + * Calls DeleteGuardrail. + * @param request DeleteGuardrailRequest message or plain object + * @returns Promise + */ + public deleteGuardrail(request: google.cloud.ces.v1.IDeleteGuardrailRequest): Promise; + + /** + * Calls ListDeployments. + * @param request ListDeploymentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDeploymentsResponse + */ + public listDeployments(request: google.cloud.ces.v1.IListDeploymentsRequest, callback: google.cloud.ces.v1.AgentService.ListDeploymentsCallback): void; + + /** + * Calls ListDeployments. + * @param request ListDeploymentsRequest message or plain object + * @returns Promise + */ + public listDeployments(request: google.cloud.ces.v1.IListDeploymentsRequest): Promise; + + /** + * Calls GetDeployment. + * @param request GetDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Deployment + */ + public getDeployment(request: google.cloud.ces.v1.IGetDeploymentRequest, callback: google.cloud.ces.v1.AgentService.GetDeploymentCallback): void; + + /** + * Calls GetDeployment. + * @param request GetDeploymentRequest message or plain object + * @returns Promise + */ + public getDeployment(request: google.cloud.ces.v1.IGetDeploymentRequest): Promise; + + /** + * Calls CreateDeployment. + * @param request CreateDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Deployment + */ + public createDeployment(request: google.cloud.ces.v1.ICreateDeploymentRequest, callback: google.cloud.ces.v1.AgentService.CreateDeploymentCallback): void; + + /** + * Calls CreateDeployment. + * @param request CreateDeploymentRequest message or plain object + * @returns Promise + */ + public createDeployment(request: google.cloud.ces.v1.ICreateDeploymentRequest): Promise; + + /** + * Calls UpdateDeployment. + * @param request UpdateDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Deployment + */ + public updateDeployment(request: google.cloud.ces.v1.IUpdateDeploymentRequest, callback: google.cloud.ces.v1.AgentService.UpdateDeploymentCallback): void; + + /** + * Calls UpdateDeployment. + * @param request UpdateDeploymentRequest message or plain object + * @returns Promise + */ + public updateDeployment(request: google.cloud.ces.v1.IUpdateDeploymentRequest): Promise; + + /** + * Calls DeleteDeployment. + * @param request DeleteDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDeployment(request: google.cloud.ces.v1.IDeleteDeploymentRequest, callback: google.cloud.ces.v1.AgentService.DeleteDeploymentCallback): void; + + /** + * Calls DeleteDeployment. + * @param request DeleteDeploymentRequest message or plain object + * @returns Promise + */ + public deleteDeployment(request: google.cloud.ces.v1.IDeleteDeploymentRequest): Promise; + + /** + * Calls ListToolsets. + * @param request ListToolsetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListToolsetsResponse + */ + public listToolsets(request: google.cloud.ces.v1.IListToolsetsRequest, callback: google.cloud.ces.v1.AgentService.ListToolsetsCallback): void; + + /** + * Calls ListToolsets. + * @param request ListToolsetsRequest message or plain object + * @returns Promise + */ + public listToolsets(request: google.cloud.ces.v1.IListToolsetsRequest): Promise; + + /** + * Calls GetToolset. + * @param request GetToolsetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Toolset + */ + public getToolset(request: google.cloud.ces.v1.IGetToolsetRequest, callback: google.cloud.ces.v1.AgentService.GetToolsetCallback): void; + + /** + * Calls GetToolset. + * @param request GetToolsetRequest message or plain object + * @returns Promise + */ + public getToolset(request: google.cloud.ces.v1.IGetToolsetRequest): Promise; + + /** + * Calls CreateToolset. + * @param request CreateToolsetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Toolset + */ + public createToolset(request: google.cloud.ces.v1.ICreateToolsetRequest, callback: google.cloud.ces.v1.AgentService.CreateToolsetCallback): void; + + /** + * Calls CreateToolset. + * @param request CreateToolsetRequest message or plain object + * @returns Promise + */ + public createToolset(request: google.cloud.ces.v1.ICreateToolsetRequest): Promise; + + /** + * Calls UpdateToolset. + * @param request UpdateToolsetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Toolset + */ + public updateToolset(request: google.cloud.ces.v1.IUpdateToolsetRequest, callback: google.cloud.ces.v1.AgentService.UpdateToolsetCallback): void; + + /** + * Calls UpdateToolset. + * @param request UpdateToolsetRequest message or plain object + * @returns Promise + */ + public updateToolset(request: google.cloud.ces.v1.IUpdateToolsetRequest): Promise; + + /** + * Calls DeleteToolset. + * @param request DeleteToolsetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteToolset(request: google.cloud.ces.v1.IDeleteToolsetRequest, callback: google.cloud.ces.v1.AgentService.DeleteToolsetCallback): void; + + /** + * Calls DeleteToolset. + * @param request DeleteToolsetRequest message or plain object + * @returns Promise + */ + public deleteToolset(request: google.cloud.ces.v1.IDeleteToolsetRequest): Promise; + + /** + * Calls ListAppVersions. + * @param request ListAppVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAppVersionsResponse + */ + public listAppVersions(request: google.cloud.ces.v1.IListAppVersionsRequest, callback: google.cloud.ces.v1.AgentService.ListAppVersionsCallback): void; + + /** + * Calls ListAppVersions. + * @param request ListAppVersionsRequest message or plain object + * @returns Promise + */ + public listAppVersions(request: google.cloud.ces.v1.IListAppVersionsRequest): Promise; + + /** + * Calls GetAppVersion. + * @param request GetAppVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AppVersion + */ + public getAppVersion(request: google.cloud.ces.v1.IGetAppVersionRequest, callback: google.cloud.ces.v1.AgentService.GetAppVersionCallback): void; + + /** + * Calls GetAppVersion. + * @param request GetAppVersionRequest message or plain object + * @returns Promise + */ + public getAppVersion(request: google.cloud.ces.v1.IGetAppVersionRequest): Promise; + + /** + * Calls CreateAppVersion. + * @param request CreateAppVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AppVersion + */ + public createAppVersion(request: google.cloud.ces.v1.ICreateAppVersionRequest, callback: google.cloud.ces.v1.AgentService.CreateAppVersionCallback): void; + + /** + * Calls CreateAppVersion. + * @param request CreateAppVersionRequest message or plain object + * @returns Promise + */ + public createAppVersion(request: google.cloud.ces.v1.ICreateAppVersionRequest): Promise; + + /** + * Calls DeleteAppVersion. + * @param request DeleteAppVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAppVersion(request: google.cloud.ces.v1.IDeleteAppVersionRequest, callback: google.cloud.ces.v1.AgentService.DeleteAppVersionCallback): void; + + /** + * Calls DeleteAppVersion. + * @param request DeleteAppVersionRequest message or plain object + * @returns Promise + */ + public deleteAppVersion(request: google.cloud.ces.v1.IDeleteAppVersionRequest): Promise; + + /** + * Calls RestoreAppVersion. + * @param request RestoreAppVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreAppVersion(request: google.cloud.ces.v1.IRestoreAppVersionRequest, callback: google.cloud.ces.v1.AgentService.RestoreAppVersionCallback): void; + + /** + * Calls RestoreAppVersion. + * @param request RestoreAppVersionRequest message or plain object + * @returns Promise + */ + public restoreAppVersion(request: google.cloud.ces.v1.IRestoreAppVersionRequest): Promise; + + /** + * Calls ListChangelogs. + * @param request ListChangelogsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListChangelogsResponse + */ + public listChangelogs(request: google.cloud.ces.v1.IListChangelogsRequest, callback: google.cloud.ces.v1.AgentService.ListChangelogsCallback): void; + + /** + * Calls ListChangelogs. + * @param request ListChangelogsRequest message or plain object + * @returns Promise + */ + public listChangelogs(request: google.cloud.ces.v1.IListChangelogsRequest): Promise; + + /** + * Calls GetChangelog. + * @param request GetChangelogRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Changelog + */ + public getChangelog(request: google.cloud.ces.v1.IGetChangelogRequest, callback: google.cloud.ces.v1.AgentService.GetChangelogCallback): void; + + /** + * Calls GetChangelog. + * @param request GetChangelogRequest message or plain object + * @returns Promise + */ + public getChangelog(request: google.cloud.ces.v1.IGetChangelogRequest): Promise; + } + + namespace AgentService { + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listApps}. + * @param error Error, if any + * @param [response] ListAppsResponse + */ + type ListAppsCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListAppsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getApp}. + * @param error Error, if any + * @param [response] App + */ + type GetAppCallback = (error: (Error|null), response?: google.cloud.ces.v1.App) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|createApp}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|updateApp}. + * @param error Error, if any + * @param [response] App + */ + type UpdateAppCallback = (error: (Error|null), response?: google.cloud.ces.v1.App) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteApp}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|exportApp}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|importApp}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listAgents}. + * @param error Error, if any + * @param [response] ListAgentsResponse + */ + type ListAgentsCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListAgentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getAgent}. + * @param error Error, if any + * @param [response] Agent + */ + type GetAgentCallback = (error: (Error|null), response?: google.cloud.ces.v1.Agent) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|createAgent}. + * @param error Error, if any + * @param [response] Agent + */ + type CreateAgentCallback = (error: (Error|null), response?: google.cloud.ces.v1.Agent) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|updateAgent}. + * @param error Error, if any + * @param [response] Agent + */ + type UpdateAgentCallback = (error: (Error|null), response?: google.cloud.ces.v1.Agent) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteAgent}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAgentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listExamples}. + * @param error Error, if any + * @param [response] ListExamplesResponse + */ + type ListExamplesCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListExamplesResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getExample}. + * @param error Error, if any + * @param [response] Example + */ + type GetExampleCallback = (error: (Error|null), response?: google.cloud.ces.v1.Example) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|createExample}. + * @param error Error, if any + * @param [response] Example + */ + type CreateExampleCallback = (error: (Error|null), response?: google.cloud.ces.v1.Example) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|updateExample}. + * @param error Error, if any + * @param [response] Example + */ + type UpdateExampleCallback = (error: (Error|null), response?: google.cloud.ces.v1.Example) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteExample}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteExampleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listTools}. + * @param error Error, if any + * @param [response] ListToolsResponse + */ + type ListToolsCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListToolsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getTool}. + * @param error Error, if any + * @param [response] Tool + */ + type GetToolCallback = (error: (Error|null), response?: google.cloud.ces.v1.Tool) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listConversations}. + * @param error Error, if any + * @param [response] ListConversationsResponse + */ + type ListConversationsCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListConversationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getConversation}. + * @param error Error, if any + * @param [response] Conversation + */ + type GetConversationCallback = (error: (Error|null), response?: google.cloud.ces.v1.Conversation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteConversation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteConversationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|batchDeleteConversations}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchDeleteConversationsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|createTool}. + * @param error Error, if any + * @param [response] Tool + */ + type CreateToolCallback = (error: (Error|null), response?: google.cloud.ces.v1.Tool) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|updateTool}. + * @param error Error, if any + * @param [response] Tool + */ + type UpdateToolCallback = (error: (Error|null), response?: google.cloud.ces.v1.Tool) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteTool}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteToolCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listGuardrails}. + * @param error Error, if any + * @param [response] ListGuardrailsResponse + */ + type ListGuardrailsCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListGuardrailsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getGuardrail}. + * @param error Error, if any + * @param [response] Guardrail + */ + type GetGuardrailCallback = (error: (Error|null), response?: google.cloud.ces.v1.Guardrail) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|createGuardrail}. + * @param error Error, if any + * @param [response] Guardrail + */ + type CreateGuardrailCallback = (error: (Error|null), response?: google.cloud.ces.v1.Guardrail) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|updateGuardrail}. + * @param error Error, if any + * @param [response] Guardrail + */ + type UpdateGuardrailCallback = (error: (Error|null), response?: google.cloud.ces.v1.Guardrail) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteGuardrail}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteGuardrailCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listDeployments}. + * @param error Error, if any + * @param [response] ListDeploymentsResponse + */ + type ListDeploymentsCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListDeploymentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getDeployment}. + * @param error Error, if any + * @param [response] Deployment + */ + type GetDeploymentCallback = (error: (Error|null), response?: google.cloud.ces.v1.Deployment) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|createDeployment}. + * @param error Error, if any + * @param [response] Deployment + */ + type CreateDeploymentCallback = (error: (Error|null), response?: google.cloud.ces.v1.Deployment) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|updateDeployment}. + * @param error Error, if any + * @param [response] Deployment + */ + type UpdateDeploymentCallback = (error: (Error|null), response?: google.cloud.ces.v1.Deployment) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteDeployment}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDeploymentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listToolsets}. + * @param error Error, if any + * @param [response] ListToolsetsResponse + */ + type ListToolsetsCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListToolsetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getToolset}. + * @param error Error, if any + * @param [response] Toolset + */ + type GetToolsetCallback = (error: (Error|null), response?: google.cloud.ces.v1.Toolset) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|createToolset}. + * @param error Error, if any + * @param [response] Toolset + */ + type CreateToolsetCallback = (error: (Error|null), response?: google.cloud.ces.v1.Toolset) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|updateToolset}. + * @param error Error, if any + * @param [response] Toolset + */ + type UpdateToolsetCallback = (error: (Error|null), response?: google.cloud.ces.v1.Toolset) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteToolset}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteToolsetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listAppVersions}. + * @param error Error, if any + * @param [response] ListAppVersionsResponse + */ + type ListAppVersionsCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListAppVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getAppVersion}. + * @param error Error, if any + * @param [response] AppVersion + */ + type GetAppVersionCallback = (error: (Error|null), response?: google.cloud.ces.v1.AppVersion) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|createAppVersion}. + * @param error Error, if any + * @param [response] AppVersion + */ + type CreateAppVersionCallback = (error: (Error|null), response?: google.cloud.ces.v1.AppVersion) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteAppVersion}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAppVersionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|restoreAppVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreAppVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listChangelogs}. + * @param error Error, if any + * @param [response] ListChangelogsResponse + */ + type ListChangelogsCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListChangelogsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getChangelog}. + * @param error Error, if any + * @param [response] Changelog + */ + type GetChangelogCallback = (error: (Error|null), response?: google.cloud.ces.v1.Changelog) => void; + } + + /** Properties of a ListAppsRequest. */ + interface IListAppsRequest { + + /** ListAppsRequest parent */ + parent?: (string|null); + + /** ListAppsRequest pageSize */ + pageSize?: (number|null); + + /** ListAppsRequest pageToken */ + pageToken?: (string|null); + + /** ListAppsRequest filter */ + filter?: (string|null); + + /** ListAppsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListAppsRequest. */ + class ListAppsRequest implements IListAppsRequest { + + /** + * Constructs a new ListAppsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListAppsRequest); + + /** ListAppsRequest parent. */ + public parent: string; + + /** ListAppsRequest pageSize. */ + public pageSize: number; + + /** ListAppsRequest pageToken. */ + public pageToken: string; + + /** ListAppsRequest filter. */ + public filter: string; + + /** ListAppsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListAppsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAppsRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IListAppsRequest): google.cloud.ces.v1.ListAppsRequest; + + /** + * Encodes the specified ListAppsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListAppsRequest.verify|verify} messages. + * @param message ListAppsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListAppsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAppsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAppsRequest.verify|verify} messages. + * @param message ListAppsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListAppsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAppsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAppsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListAppsRequest; + + /** + * Decodes a ListAppsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAppsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListAppsRequest; + + /** + * Verifies a ListAppsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAppsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAppsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListAppsRequest; + + /** + * Creates a plain object from a ListAppsRequest message. Also converts values to other types if specified. + * @param message ListAppsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListAppsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAppsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAppsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAppsResponse. */ + interface IListAppsResponse { + + /** ListAppsResponse apps */ + apps?: (google.cloud.ces.v1.IApp[]|null); + + /** ListAppsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListAppsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListAppsResponse. */ + class ListAppsResponse implements IListAppsResponse { + + /** + * Constructs a new ListAppsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListAppsResponse); + + /** ListAppsResponse apps. */ + public apps: google.cloud.ces.v1.IApp[]; + + /** ListAppsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListAppsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListAppsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAppsResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IListAppsResponse): google.cloud.ces.v1.ListAppsResponse; + + /** + * Encodes the specified ListAppsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListAppsResponse.verify|verify} messages. + * @param message ListAppsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListAppsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAppsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAppsResponse.verify|verify} messages. + * @param message ListAppsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListAppsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAppsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAppsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListAppsResponse; + + /** + * Decodes a ListAppsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAppsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListAppsResponse; + + /** + * Verifies a ListAppsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAppsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAppsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListAppsResponse; + + /** + * Creates a plain object from a ListAppsResponse message. Also converts values to other types if specified. + * @param message ListAppsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListAppsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAppsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAppsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAppRequest. */ + interface IGetAppRequest { + + /** GetAppRequest name */ + name?: (string|null); + } + + /** Represents a GetAppRequest. */ + class GetAppRequest implements IGetAppRequest { + + /** + * Constructs a new GetAppRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IGetAppRequest); + + /** GetAppRequest name. */ + public name: string; + + /** + * Creates a new GetAppRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAppRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IGetAppRequest): google.cloud.ces.v1.GetAppRequest; + + /** + * Encodes the specified GetAppRequest message. Does not implicitly {@link google.cloud.ces.v1.GetAppRequest.verify|verify} messages. + * @param message GetAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IGetAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetAppRequest.verify|verify} messages. + * @param message GetAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IGetAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAppRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetAppRequest; + + /** + * Decodes a GetAppRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetAppRequest; + + /** + * Verifies a GetAppRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAppRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAppRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetAppRequest; + + /** + * Creates a plain object from a GetAppRequest message. Also converts values to other types if specified. + * @param message GetAppRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.GetAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAppRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAppRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAppRequest. */ + interface ICreateAppRequest { + + /** CreateAppRequest parent */ + parent?: (string|null); + + /** CreateAppRequest appId */ + appId?: (string|null); + + /** CreateAppRequest app */ + app?: (google.cloud.ces.v1.IApp|null); + } + + /** Represents a CreateAppRequest. */ + class CreateAppRequest implements ICreateAppRequest { + + /** + * Constructs a new CreateAppRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ICreateAppRequest); + + /** CreateAppRequest parent. */ + public parent: string; + + /** CreateAppRequest appId. */ + public appId: string; + + /** CreateAppRequest app. */ + public app?: (google.cloud.ces.v1.IApp|null); + + /** + * Creates a new CreateAppRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAppRequest instance + */ + public static create(properties?: google.cloud.ces.v1.ICreateAppRequest): google.cloud.ces.v1.CreateAppRequest; + + /** + * Encodes the specified CreateAppRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateAppRequest.verify|verify} messages. + * @param message CreateAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ICreateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateAppRequest.verify|verify} messages. + * @param message CreateAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ICreateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAppRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CreateAppRequest; + + /** + * Decodes a CreateAppRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CreateAppRequest; + + /** + * Verifies a CreateAppRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAppRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAppRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CreateAppRequest; + + /** + * Creates a plain object from a CreateAppRequest message. Also converts values to other types if specified. + * @param message CreateAppRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.CreateAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAppRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAppRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAppRequest. */ + interface IUpdateAppRequest { + + /** UpdateAppRequest app */ + app?: (google.cloud.ces.v1.IApp|null); + + /** UpdateAppRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAppRequest. */ + class UpdateAppRequest implements IUpdateAppRequest { + + /** + * Constructs a new UpdateAppRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IUpdateAppRequest); + + /** UpdateAppRequest app. */ + public app?: (google.cloud.ces.v1.IApp|null); + + /** UpdateAppRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAppRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAppRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IUpdateAppRequest): google.cloud.ces.v1.UpdateAppRequest; + + /** + * Encodes the specified UpdateAppRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateAppRequest.verify|verify} messages. + * @param message UpdateAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IUpdateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateAppRequest.verify|verify} messages. + * @param message UpdateAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IUpdateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAppRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.UpdateAppRequest; + + /** + * Decodes an UpdateAppRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.UpdateAppRequest; + + /** + * Verifies an UpdateAppRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAppRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAppRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.UpdateAppRequest; + + /** + * Creates a plain object from an UpdateAppRequest message. Also converts values to other types if specified. + * @param message UpdateAppRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.UpdateAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAppRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAppRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAppRequest. */ + interface IDeleteAppRequest { + + /** DeleteAppRequest name */ + name?: (string|null); + + /** DeleteAppRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteAppRequest. */ + class DeleteAppRequest implements IDeleteAppRequest { + + /** + * Constructs a new DeleteAppRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IDeleteAppRequest); + + /** DeleteAppRequest name. */ + public name: string; + + /** DeleteAppRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteAppRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAppRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IDeleteAppRequest): google.cloud.ces.v1.DeleteAppRequest; + + /** + * Encodes the specified DeleteAppRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteAppRequest.verify|verify} messages. + * @param message DeleteAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IDeleteAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteAppRequest.verify|verify} messages. + * @param message DeleteAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IDeleteAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAppRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DeleteAppRequest; + + /** + * Decodes a DeleteAppRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DeleteAppRequest; + + /** + * Verifies a DeleteAppRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAppRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAppRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DeleteAppRequest; + + /** + * Creates a plain object from a DeleteAppRequest message. Also converts values to other types if specified. + * @param message DeleteAppRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DeleteAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAppRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAppRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportAppRequest. */ + interface IExportAppRequest { + + /** ExportAppRequest name */ + name?: (string|null); + + /** ExportAppRequest exportFormat */ + exportFormat?: (google.cloud.ces.v1.ExportAppRequest.ExportFormat|keyof typeof google.cloud.ces.v1.ExportAppRequest.ExportFormat|null); + + /** ExportAppRequest gcsUri */ + gcsUri?: (string|null); + } + + /** Represents an ExportAppRequest. */ + class ExportAppRequest implements IExportAppRequest { + + /** + * Constructs a new ExportAppRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IExportAppRequest); + + /** ExportAppRequest name. */ + public name: string; + + /** ExportAppRequest exportFormat. */ + public exportFormat: (google.cloud.ces.v1.ExportAppRequest.ExportFormat|keyof typeof google.cloud.ces.v1.ExportAppRequest.ExportFormat); + + /** ExportAppRequest gcsUri. */ + public gcsUri: string; + + /** + * Creates a new ExportAppRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAppRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IExportAppRequest): google.cloud.ces.v1.ExportAppRequest; + + /** + * Encodes the specified ExportAppRequest message. Does not implicitly {@link google.cloud.ces.v1.ExportAppRequest.verify|verify} messages. + * @param message ExportAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IExportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExportAppRequest.verify|verify} messages. + * @param message ExportAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IExportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAppRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ExportAppRequest; + + /** + * Decodes an ExportAppRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ExportAppRequest; + + /** + * Verifies an ExportAppRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportAppRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAppRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ExportAppRequest; + + /** + * Creates a plain object from an ExportAppRequest message. Also converts values to other types if specified. + * @param message ExportAppRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ExportAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAppRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportAppRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportAppRequest { + + /** ExportFormat enum. */ + enum ExportFormat { + EXPORT_FORMAT_UNSPECIFIED = 0, + JSON = 1, + YAML = 2 + } + } + + /** Properties of an ExportAppResponse. */ + interface IExportAppResponse { + + /** ExportAppResponse appContent */ + appContent?: (Uint8Array|Buffer|string|null); + + /** ExportAppResponse appUri */ + appUri?: (string|null); + } + + /** Represents an ExportAppResponse. */ + class ExportAppResponse implements IExportAppResponse { + + /** + * Constructs a new ExportAppResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IExportAppResponse); + + /** ExportAppResponse appContent. */ + public appContent?: (Uint8Array|Buffer|string|null); + + /** ExportAppResponse appUri. */ + public appUri?: (string|null); + + /** ExportAppResponse app. */ + public app?: ("appContent"|"appUri"); + + /** + * Creates a new ExportAppResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAppResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IExportAppResponse): google.cloud.ces.v1.ExportAppResponse; + + /** + * Encodes the specified ExportAppResponse message. Does not implicitly {@link google.cloud.ces.v1.ExportAppResponse.verify|verify} messages. + * @param message ExportAppResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IExportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExportAppResponse.verify|verify} messages. + * @param message ExportAppResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IExportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAppResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ExportAppResponse; + + /** + * Decodes an ExportAppResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ExportAppResponse; + + /** + * Verifies an ExportAppResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportAppResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAppResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ExportAppResponse; + + /** + * Creates a plain object from an ExportAppResponse message. Also converts values to other types if specified. + * @param message ExportAppResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ExportAppResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAppResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportAppResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportAppRequest. */ + interface IImportAppRequest { + + /** ImportAppRequest gcsUri */ + gcsUri?: (string|null); + + /** ImportAppRequest appContent */ + appContent?: (Uint8Array|Buffer|string|null); + + /** ImportAppRequest parent */ + parent?: (string|null); + + /** ImportAppRequest displayName */ + displayName?: (string|null); + + /** ImportAppRequest appId */ + appId?: (string|null); + + /** ImportAppRequest importOptions */ + importOptions?: (google.cloud.ces.v1.ImportAppRequest.IImportOptions|null); + + /** ImportAppRequest ignoreAppLock */ + ignoreAppLock?: (boolean|null); + } + + /** Represents an ImportAppRequest. */ + class ImportAppRequest implements IImportAppRequest { + + /** + * Constructs a new ImportAppRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IImportAppRequest); + + /** ImportAppRequest gcsUri. */ + public gcsUri?: (string|null); + + /** ImportAppRequest appContent. */ + public appContent?: (Uint8Array|Buffer|string|null); + + /** ImportAppRequest parent. */ + public parent: string; + + /** ImportAppRequest displayName. */ + public displayName: string; + + /** ImportAppRequest appId. */ + public appId: string; + + /** ImportAppRequest importOptions. */ + public importOptions?: (google.cloud.ces.v1.ImportAppRequest.IImportOptions|null); + + /** ImportAppRequest ignoreAppLock. */ + public ignoreAppLock: boolean; + + /** ImportAppRequest app. */ + public app?: ("gcsUri"|"appContent"); + + /** + * Creates a new ImportAppRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportAppRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IImportAppRequest): google.cloud.ces.v1.ImportAppRequest; + + /** + * Encodes the specified ImportAppRequest message. Does not implicitly {@link google.cloud.ces.v1.ImportAppRequest.verify|verify} messages. + * @param message ImportAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IImportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ImportAppRequest.verify|verify} messages. + * @param message ImportAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IImportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportAppRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ImportAppRequest; + + /** + * Decodes an ImportAppRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ImportAppRequest; + + /** + * Verifies an ImportAppRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportAppRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportAppRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ImportAppRequest; + + /** + * Creates a plain object from an ImportAppRequest message. Also converts values to other types if specified. + * @param message ImportAppRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ImportAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportAppRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportAppRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportAppRequest { + + /** Properties of an ImportOptions. */ + interface IImportOptions { + + /** ImportOptions conflictResolutionStrategy */ + conflictResolutionStrategy?: (google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|keyof typeof google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|null); + } + + /** Represents an ImportOptions. */ + class ImportOptions implements IImportOptions { + + /** + * Constructs a new ImportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ImportAppRequest.IImportOptions); + + /** ImportOptions conflictResolutionStrategy. */ + public conflictResolutionStrategy: (google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|keyof typeof google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy); + + /** + * Creates a new ImportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportOptions instance + */ + public static create(properties?: google.cloud.ces.v1.ImportAppRequest.IImportOptions): google.cloud.ces.v1.ImportAppRequest.ImportOptions; + + /** + * Encodes the specified ImportOptions message. Does not implicitly {@link google.cloud.ces.v1.ImportAppRequest.ImportOptions.verify|verify} messages. + * @param message ImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ImportAppRequest.IImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportOptions message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ImportAppRequest.ImportOptions.verify|verify} messages. + * @param message ImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ImportAppRequest.IImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ImportAppRequest.ImportOptions; + + /** + * Decodes an ImportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ImportAppRequest.ImportOptions; + + /** + * Verifies an ImportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ImportAppRequest.ImportOptions; + + /** + * Creates a plain object from an ImportOptions message. Also converts values to other types if specified. + * @param message ImportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ImportAppRequest.ImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportOptions { + + /** ConflictResolutionStrategy enum. */ + enum ConflictResolutionStrategy { + CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED = 0, + REPLACE = 1, + OVERWRITE = 2 + } + } + } + + /** Properties of an ImportAppResponse. */ + interface IImportAppResponse { + + /** ImportAppResponse name */ + name?: (string|null); + + /** ImportAppResponse warnings */ + warnings?: (string[]|null); + } + + /** Represents an ImportAppResponse. */ + class ImportAppResponse implements IImportAppResponse { + + /** + * Constructs a new ImportAppResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IImportAppResponse); + + /** ImportAppResponse name. */ + public name: string; + + /** ImportAppResponse warnings. */ + public warnings: string[]; + + /** + * Creates a new ImportAppResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportAppResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IImportAppResponse): google.cloud.ces.v1.ImportAppResponse; + + /** + * Encodes the specified ImportAppResponse message. Does not implicitly {@link google.cloud.ces.v1.ImportAppResponse.verify|verify} messages. + * @param message ImportAppResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IImportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ImportAppResponse.verify|verify} messages. + * @param message ImportAppResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IImportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportAppResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ImportAppResponse; + + /** + * Decodes an ImportAppResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ImportAppResponse; + + /** + * Verifies an ImportAppResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportAppResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportAppResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ImportAppResponse; + + /** + * Creates a plain object from an ImportAppResponse message. Also converts values to other types if specified. + * @param message ImportAppResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ImportAppResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportAppResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportAppResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAgentsRequest. */ + interface IListAgentsRequest { + + /** ListAgentsRequest parent */ + parent?: (string|null); + + /** ListAgentsRequest pageSize */ + pageSize?: (number|null); + + /** ListAgentsRequest pageToken */ + pageToken?: (string|null); + + /** ListAgentsRequest filter */ + filter?: (string|null); + + /** ListAgentsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListAgentsRequest. */ + class ListAgentsRequest implements IListAgentsRequest { + + /** + * Constructs a new ListAgentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListAgentsRequest); + + /** ListAgentsRequest parent. */ + public parent: string; + + /** ListAgentsRequest pageSize. */ + public pageSize: number; + + /** ListAgentsRequest pageToken. */ + public pageToken: string; + + /** ListAgentsRequest filter. */ + public filter: string; + + /** ListAgentsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListAgentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAgentsRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IListAgentsRequest): google.cloud.ces.v1.ListAgentsRequest; + + /** + * Encodes the specified ListAgentsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListAgentsRequest.verify|verify} messages. + * @param message ListAgentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListAgentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAgentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAgentsRequest.verify|verify} messages. + * @param message ListAgentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListAgentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListAgentsRequest; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListAgentsRequest; + + /** + * Verifies a ListAgentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAgentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAgentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListAgentsRequest; + + /** + * Creates a plain object from a ListAgentsRequest message. Also converts values to other types if specified. + * @param message ListAgentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListAgentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAgentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAgentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAgentsResponse. */ + interface IListAgentsResponse { + + /** ListAgentsResponse agents */ + agents?: (google.cloud.ces.v1.IAgent[]|null); + + /** ListAgentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAgentsResponse. */ + class ListAgentsResponse implements IListAgentsResponse { + + /** + * Constructs a new ListAgentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListAgentsResponse); + + /** ListAgentsResponse agents. */ + public agents: google.cloud.ces.v1.IAgent[]; + + /** ListAgentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAgentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAgentsResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IListAgentsResponse): google.cloud.ces.v1.ListAgentsResponse; + + /** + * Encodes the specified ListAgentsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListAgentsResponse.verify|verify} messages. + * @param message ListAgentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListAgentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAgentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAgentsResponse.verify|verify} messages. + * @param message ListAgentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListAgentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListAgentsResponse; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListAgentsResponse; + + /** + * Verifies a ListAgentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAgentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAgentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListAgentsResponse; + + /** + * Creates a plain object from a ListAgentsResponse message. Also converts values to other types if specified. + * @param message ListAgentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListAgentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAgentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAgentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAgentRequest. */ + interface IGetAgentRequest { + + /** GetAgentRequest name */ + name?: (string|null); + } + + /** Represents a GetAgentRequest. */ + class GetAgentRequest implements IGetAgentRequest { + + /** + * Constructs a new GetAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IGetAgentRequest); + + /** GetAgentRequest name. */ + public name: string; + + /** + * Creates a new GetAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAgentRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IGetAgentRequest): google.cloud.ces.v1.GetAgentRequest; + + /** + * Encodes the specified GetAgentRequest message. Does not implicitly {@link google.cloud.ces.v1.GetAgentRequest.verify|verify} messages. + * @param message GetAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IGetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetAgentRequest.verify|verify} messages. + * @param message GetAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IGetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetAgentRequest; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetAgentRequest; + + /** + * Verifies a GetAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetAgentRequest; + + /** + * Creates a plain object from a GetAgentRequest message. Also converts values to other types if specified. + * @param message GetAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.GetAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAgentRequest. */ + interface ICreateAgentRequest { + + /** CreateAgentRequest parent */ + parent?: (string|null); + + /** CreateAgentRequest agentId */ + agentId?: (string|null); + + /** CreateAgentRequest agent */ + agent?: (google.cloud.ces.v1.IAgent|null); + } + + /** Represents a CreateAgentRequest. */ + class CreateAgentRequest implements ICreateAgentRequest { + + /** + * Constructs a new CreateAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ICreateAgentRequest); + + /** CreateAgentRequest parent. */ + public parent: string; + + /** CreateAgentRequest agentId. */ + public agentId: string; + + /** CreateAgentRequest agent. */ + public agent?: (google.cloud.ces.v1.IAgent|null); + + /** + * Creates a new CreateAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAgentRequest instance + */ + public static create(properties?: google.cloud.ces.v1.ICreateAgentRequest): google.cloud.ces.v1.CreateAgentRequest; + + /** + * Encodes the specified CreateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateAgentRequest.verify|verify} messages. + * @param message CreateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ICreateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateAgentRequest.verify|verify} messages. + * @param message CreateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ICreateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CreateAgentRequest; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CreateAgentRequest; + + /** + * Verifies a CreateAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CreateAgentRequest; + + /** + * Creates a plain object from a CreateAgentRequest message. Also converts values to other types if specified. + * @param message CreateAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.CreateAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAgentRequest. */ + interface IUpdateAgentRequest { + + /** UpdateAgentRequest agent */ + agent?: (google.cloud.ces.v1.IAgent|null); + + /** UpdateAgentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAgentRequest. */ + class UpdateAgentRequest implements IUpdateAgentRequest { + + /** + * Constructs a new UpdateAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IUpdateAgentRequest); + + /** UpdateAgentRequest agent. */ + public agent?: (google.cloud.ces.v1.IAgent|null); + + /** UpdateAgentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAgentRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IUpdateAgentRequest): google.cloud.ces.v1.UpdateAgentRequest; + + /** + * Encodes the specified UpdateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateAgentRequest.verify|verify} messages. + * @param message UpdateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IUpdateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateAgentRequest.verify|verify} messages. + * @param message UpdateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IUpdateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.UpdateAgentRequest; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.UpdateAgentRequest; + + /** + * Verifies an UpdateAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.UpdateAgentRequest; + + /** + * Creates a plain object from an UpdateAgentRequest message. Also converts values to other types if specified. + * @param message UpdateAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.UpdateAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAgentRequest. */ + interface IDeleteAgentRequest { + + /** DeleteAgentRequest name */ + name?: (string|null); + + /** DeleteAgentRequest force */ + force?: (boolean|null); + + /** DeleteAgentRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteAgentRequest. */ + class DeleteAgentRequest implements IDeleteAgentRequest { + + /** + * Constructs a new DeleteAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IDeleteAgentRequest); + + /** DeleteAgentRequest name. */ + public name: string; + + /** DeleteAgentRequest force. */ + public force: boolean; + + /** DeleteAgentRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAgentRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IDeleteAgentRequest): google.cloud.ces.v1.DeleteAgentRequest; + + /** + * Encodes the specified DeleteAgentRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteAgentRequest.verify|verify} messages. + * @param message DeleteAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IDeleteAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteAgentRequest.verify|verify} messages. + * @param message DeleteAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IDeleteAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DeleteAgentRequest; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DeleteAgentRequest; + + /** + * Verifies a DeleteAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DeleteAgentRequest; + + /** + * Creates a plain object from a DeleteAgentRequest message. Also converts values to other types if specified. + * @param message DeleteAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DeleteAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAgentRequest + * @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 createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.ces.v1.IOperationMetadata): google.cloud.ces.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.ces.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.ces.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.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.ces.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.ces.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.ces.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.ces.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.ces.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 ListExamplesRequest. */ + interface IListExamplesRequest { + + /** ListExamplesRequest parent */ + parent?: (string|null); + + /** ListExamplesRequest pageSize */ + pageSize?: (number|null); + + /** ListExamplesRequest pageToken */ + pageToken?: (string|null); + + /** ListExamplesRequest filter */ + filter?: (string|null); + + /** ListExamplesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListExamplesRequest. */ + class ListExamplesRequest implements IListExamplesRequest { + + /** + * Constructs a new ListExamplesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListExamplesRequest); + + /** ListExamplesRequest parent. */ + public parent: string; + + /** ListExamplesRequest pageSize. */ + public pageSize: number; + + /** ListExamplesRequest pageToken. */ + public pageToken: string; + + /** ListExamplesRequest filter. */ + public filter: string; + + /** ListExamplesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListExamplesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExamplesRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IListExamplesRequest): google.cloud.ces.v1.ListExamplesRequest; + + /** + * Encodes the specified ListExamplesRequest message. Does not implicitly {@link google.cloud.ces.v1.ListExamplesRequest.verify|verify} messages. + * @param message ListExamplesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListExamplesRequest.verify|verify} messages. + * @param message ListExamplesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListExamplesRequest; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListExamplesRequest; + + /** + * Verifies a ListExamplesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListExamplesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExamplesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListExamplesRequest; + + /** + * Creates a plain object from a ListExamplesRequest message. Also converts values to other types if specified. + * @param message ListExamplesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListExamplesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExamplesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExamplesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExamplesResponse. */ + interface IListExamplesResponse { + + /** ListExamplesResponse examples */ + examples?: (google.cloud.ces.v1.IExample[]|null); + + /** ListExamplesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListExamplesResponse. */ + class ListExamplesResponse implements IListExamplesResponse { + + /** + * Constructs a new ListExamplesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListExamplesResponse); + + /** ListExamplesResponse examples. */ + public examples: google.cloud.ces.v1.IExample[]; + + /** ListExamplesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListExamplesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExamplesResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IListExamplesResponse): google.cloud.ces.v1.ListExamplesResponse; + + /** + * Encodes the specified ListExamplesResponse message. Does not implicitly {@link google.cloud.ces.v1.ListExamplesResponse.verify|verify} messages. + * @param message ListExamplesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListExamplesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExamplesResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListExamplesResponse.verify|verify} messages. + * @param message ListExamplesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListExamplesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListExamplesResponse; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListExamplesResponse; + + /** + * Verifies a ListExamplesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListExamplesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExamplesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListExamplesResponse; + + /** + * Creates a plain object from a ListExamplesResponse message. Also converts values to other types if specified. + * @param message ListExamplesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListExamplesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExamplesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExamplesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetExampleRequest. */ + interface IGetExampleRequest { + + /** GetExampleRequest name */ + name?: (string|null); + } + + /** Represents a GetExampleRequest. */ + class GetExampleRequest implements IGetExampleRequest { + + /** + * Constructs a new GetExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IGetExampleRequest); + + /** GetExampleRequest name. */ + public name: string; + + /** + * Creates a new GetExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetExampleRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IGetExampleRequest): google.cloud.ces.v1.GetExampleRequest; + + /** + * Encodes the specified GetExampleRequest message. Does not implicitly {@link google.cloud.ces.v1.GetExampleRequest.verify|verify} messages. + * @param message GetExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IGetExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetExampleRequest.verify|verify} messages. + * @param message GetExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IGetExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetExampleRequest; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetExampleRequest; + + /** + * Verifies a GetExampleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetExampleRequest; + + /** + * Creates a plain object from a GetExampleRequest message. Also converts values to other types if specified. + * @param message GetExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.GetExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateExampleRequest. */ + interface ICreateExampleRequest { + + /** CreateExampleRequest parent */ + parent?: (string|null); + + /** CreateExampleRequest exampleId */ + exampleId?: (string|null); + + /** CreateExampleRequest example */ + example?: (google.cloud.ces.v1.IExample|null); + } + + /** Represents a CreateExampleRequest. */ + class CreateExampleRequest implements ICreateExampleRequest { + + /** + * Constructs a new CreateExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ICreateExampleRequest); + + /** CreateExampleRequest parent. */ + public parent: string; + + /** CreateExampleRequest exampleId. */ + public exampleId: string; + + /** CreateExampleRequest example. */ + public example?: (google.cloud.ces.v1.IExample|null); + + /** + * Creates a new CreateExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateExampleRequest instance + */ + public static create(properties?: google.cloud.ces.v1.ICreateExampleRequest): google.cloud.ces.v1.CreateExampleRequest; + + /** + * Encodes the specified CreateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateExampleRequest.verify|verify} messages. + * @param message CreateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ICreateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateExampleRequest.verify|verify} messages. + * @param message CreateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ICreateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CreateExampleRequest; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CreateExampleRequest; + + /** + * Verifies a CreateExampleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CreateExampleRequest; + + /** + * Creates a plain object from a CreateExampleRequest message. Also converts values to other types if specified. + * @param message CreateExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.CreateExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateExampleRequest. */ + interface IUpdateExampleRequest { + + /** UpdateExampleRequest example */ + example?: (google.cloud.ces.v1.IExample|null); + + /** UpdateExampleRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateExampleRequest. */ + class UpdateExampleRequest implements IUpdateExampleRequest { + + /** + * Constructs a new UpdateExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IUpdateExampleRequest); + + /** UpdateExampleRequest example. */ + public example?: (google.cloud.ces.v1.IExample|null); + + /** UpdateExampleRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateExampleRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IUpdateExampleRequest): google.cloud.ces.v1.UpdateExampleRequest; + + /** + * Encodes the specified UpdateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateExampleRequest.verify|verify} messages. + * @param message UpdateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IUpdateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateExampleRequest.verify|verify} messages. + * @param message UpdateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IUpdateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.UpdateExampleRequest; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.UpdateExampleRequest; + + /** + * Verifies an UpdateExampleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.UpdateExampleRequest; + + /** + * Creates a plain object from an UpdateExampleRequest message. Also converts values to other types if specified. + * @param message UpdateExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.UpdateExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteExampleRequest. */ + interface IDeleteExampleRequest { + + /** DeleteExampleRequest name */ + name?: (string|null); + + /** DeleteExampleRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteExampleRequest. */ + class DeleteExampleRequest implements IDeleteExampleRequest { + + /** + * Constructs a new DeleteExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IDeleteExampleRequest); + + /** DeleteExampleRequest name. */ + public name: string; + + /** DeleteExampleRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteExampleRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IDeleteExampleRequest): google.cloud.ces.v1.DeleteExampleRequest; + + /** + * Encodes the specified DeleteExampleRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteExampleRequest.verify|verify} messages. + * @param message DeleteExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IDeleteExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteExampleRequest.verify|verify} messages. + * @param message DeleteExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IDeleteExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DeleteExampleRequest; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DeleteExampleRequest; + + /** + * Verifies a DeleteExampleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DeleteExampleRequest; + + /** + * Creates a plain object from a DeleteExampleRequest message. Also converts values to other types if specified. + * @param message DeleteExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DeleteExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListToolsRequest. */ + interface IListToolsRequest { + + /** ListToolsRequest parent */ + parent?: (string|null); + + /** ListToolsRequest pageSize */ + pageSize?: (number|null); + + /** ListToolsRequest pageToken */ + pageToken?: (string|null); + + /** ListToolsRequest filter */ + filter?: (string|null); + + /** ListToolsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListToolsRequest. */ + class ListToolsRequest implements IListToolsRequest { + + /** + * Constructs a new ListToolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListToolsRequest); + + /** ListToolsRequest parent. */ + public parent: string; + + /** ListToolsRequest pageSize. */ + public pageSize: number; + + /** ListToolsRequest pageToken. */ + public pageToken: string; + + /** ListToolsRequest filter. */ + public filter: string; + + /** ListToolsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListToolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolsRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IListToolsRequest): google.cloud.ces.v1.ListToolsRequest; + + /** + * Encodes the specified ListToolsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListToolsRequest.verify|verify} messages. + * @param message ListToolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListToolsRequest.verify|verify} messages. + * @param message ListToolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListToolsRequest; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListToolsRequest; + + /** + * Verifies a ListToolsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListToolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListToolsRequest; + + /** + * Creates a plain object from a ListToolsRequest message. Also converts values to other types if specified. + * @param message ListToolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListToolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListToolsResponse. */ + interface IListToolsResponse { + + /** ListToolsResponse tools */ + tools?: (google.cloud.ces.v1.ITool[]|null); + + /** ListToolsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListToolsResponse. */ + class ListToolsResponse implements IListToolsResponse { + + /** + * Constructs a new ListToolsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListToolsResponse); + + /** ListToolsResponse tools. */ + public tools: google.cloud.ces.v1.ITool[]; + + /** ListToolsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListToolsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolsResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IListToolsResponse): google.cloud.ces.v1.ListToolsResponse; + + /** + * Encodes the specified ListToolsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListToolsResponse.verify|verify} messages. + * @param message ListToolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListToolsResponse.verify|verify} messages. + * @param message ListToolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListToolsResponse; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListToolsResponse; + + /** + * Verifies a ListToolsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListToolsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListToolsResponse; + + /** + * Creates a plain object from a ListToolsResponse message. Also converts values to other types if specified. + * @param message ListToolsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListToolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetToolRequest. */ + interface IGetToolRequest { + + /** GetToolRequest name */ + name?: (string|null); + } + + /** Represents a GetToolRequest. */ + class GetToolRequest implements IGetToolRequest { + + /** + * Constructs a new GetToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IGetToolRequest); + + /** GetToolRequest name. */ + public name: string; + + /** + * Creates a new GetToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetToolRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IGetToolRequest): google.cloud.ces.v1.GetToolRequest; + + /** + * Encodes the specified GetToolRequest message. Does not implicitly {@link google.cloud.ces.v1.GetToolRequest.verify|verify} messages. + * @param message GetToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IGetToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetToolRequest.verify|verify} messages. + * @param message GetToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IGetToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetToolRequest; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetToolRequest; + + /** + * Verifies a GetToolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetToolRequest; + + /** + * Creates a plain object from a GetToolRequest message. Also converts values to other types if specified. + * @param message GetToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.GetToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateToolRequest. */ + interface ICreateToolRequest { + + /** CreateToolRequest parent */ + parent?: (string|null); + + /** CreateToolRequest toolId */ + toolId?: (string|null); + + /** CreateToolRequest tool */ + tool?: (google.cloud.ces.v1.ITool|null); + } + + /** Represents a CreateToolRequest. */ + class CreateToolRequest implements ICreateToolRequest { + + /** + * Constructs a new CreateToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ICreateToolRequest); + + /** CreateToolRequest parent. */ + public parent: string; + + /** CreateToolRequest toolId. */ + public toolId: string; + + /** CreateToolRequest tool. */ + public tool?: (google.cloud.ces.v1.ITool|null); + + /** + * Creates a new CreateToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateToolRequest instance + */ + public static create(properties?: google.cloud.ces.v1.ICreateToolRequest): google.cloud.ces.v1.CreateToolRequest; + + /** + * Encodes the specified CreateToolRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateToolRequest.verify|verify} messages. + * @param message CreateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ICreateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateToolRequest.verify|verify} messages. + * @param message CreateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ICreateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CreateToolRequest; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CreateToolRequest; + + /** + * Verifies a CreateToolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CreateToolRequest; + + /** + * Creates a plain object from a CreateToolRequest message. Also converts values to other types if specified. + * @param message CreateToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.CreateToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateToolRequest. */ + interface IUpdateToolRequest { + + /** UpdateToolRequest tool */ + tool?: (google.cloud.ces.v1.ITool|null); + + /** UpdateToolRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateToolRequest. */ + class UpdateToolRequest implements IUpdateToolRequest { + + /** + * Constructs a new UpdateToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IUpdateToolRequest); + + /** UpdateToolRequest tool. */ + public tool?: (google.cloud.ces.v1.ITool|null); + + /** UpdateToolRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateToolRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IUpdateToolRequest): google.cloud.ces.v1.UpdateToolRequest; + + /** + * Encodes the specified UpdateToolRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateToolRequest.verify|verify} messages. + * @param message UpdateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IUpdateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateToolRequest.verify|verify} messages. + * @param message UpdateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IUpdateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.UpdateToolRequest; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.UpdateToolRequest; + + /** + * Verifies an UpdateToolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.UpdateToolRequest; + + /** + * Creates a plain object from an UpdateToolRequest message. Also converts values to other types if specified. + * @param message UpdateToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.UpdateToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteToolRequest. */ + interface IDeleteToolRequest { + + /** DeleteToolRequest name */ + name?: (string|null); + + /** DeleteToolRequest force */ + force?: (boolean|null); + + /** DeleteToolRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteToolRequest. */ + class DeleteToolRequest implements IDeleteToolRequest { + + /** + * Constructs a new DeleteToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IDeleteToolRequest); + + /** DeleteToolRequest name. */ + public name: string; + + /** DeleteToolRequest force. */ + public force: boolean; + + /** DeleteToolRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteToolRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IDeleteToolRequest): google.cloud.ces.v1.DeleteToolRequest; + + /** + * Encodes the specified DeleteToolRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteToolRequest.verify|verify} messages. + * @param message DeleteToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IDeleteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteToolRequest.verify|verify} messages. + * @param message DeleteToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IDeleteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DeleteToolRequest; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DeleteToolRequest; + + /** + * Verifies a DeleteToolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DeleteToolRequest; + + /** + * Creates a plain object from a DeleteToolRequest message. Also converts values to other types if specified. + * @param message DeleteToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DeleteToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConversationsRequest. */ + interface IListConversationsRequest { + + /** ListConversationsRequest parent */ + parent?: (string|null); + + /** ListConversationsRequest pageSize */ + pageSize?: (number|null); + + /** ListConversationsRequest pageToken */ + pageToken?: (string|null); + + /** ListConversationsRequest filter */ + filter?: (string|null); + + /** ListConversationsRequest source */ + source?: (google.cloud.ces.v1.Conversation.Source|keyof typeof google.cloud.ces.v1.Conversation.Source|null); + + /** ListConversationsRequest sources */ + sources?: (google.cloud.ces.v1.Conversation.Source[]|null); + } + + /** Represents a ListConversationsRequest. */ + class ListConversationsRequest implements IListConversationsRequest { + + /** + * Constructs a new ListConversationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListConversationsRequest); + + /** ListConversationsRequest parent. */ + public parent: string; + + /** ListConversationsRequest pageSize. */ + public pageSize: number; + + /** ListConversationsRequest pageToken. */ + public pageToken: string; + + /** ListConversationsRequest filter. */ + public filter: string; + + /** ListConversationsRequest source. */ + public source: (google.cloud.ces.v1.Conversation.Source|keyof typeof google.cloud.ces.v1.Conversation.Source); + + /** ListConversationsRequest sources. */ + public sources: google.cloud.ces.v1.Conversation.Source[]; + + /** + * Creates a new ListConversationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConversationsRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IListConversationsRequest): google.cloud.ces.v1.ListConversationsRequest; + + /** + * Encodes the specified ListConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListConversationsRequest.verify|verify} messages. + * @param message ListConversationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListConversationsRequest.verify|verify} messages. + * @param message ListConversationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListConversationsRequest; + + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListConversationsRequest; + + /** + * Verifies a ListConversationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListConversationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConversationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListConversationsRequest; + + /** + * Creates a plain object from a ListConversationsRequest message. Also converts values to other types if specified. + * @param message ListConversationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListConversationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConversationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConversationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConversationsResponse. */ + interface IListConversationsResponse { + + /** ListConversationsResponse conversations */ + conversations?: (google.cloud.ces.v1.IConversation[]|null); + + /** ListConversationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListConversationsResponse. */ + class ListConversationsResponse implements IListConversationsResponse { + + /** + * Constructs a new ListConversationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListConversationsResponse); + + /** ListConversationsResponse conversations. */ + public conversations: google.cloud.ces.v1.IConversation[]; + + /** ListConversationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListConversationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConversationsResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IListConversationsResponse): google.cloud.ces.v1.ListConversationsResponse; + + /** + * Encodes the specified ListConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListConversationsResponse.verify|verify} messages. + * @param message ListConversationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListConversationsResponse.verify|verify} messages. + * @param message ListConversationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListConversationsResponse; + + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListConversationsResponse; + + /** + * Verifies a ListConversationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConversationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListConversationsResponse; + + /** + * Creates a plain object from a ListConversationsResponse message. Also converts values to other types if specified. + * @param message ListConversationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListConversationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConversationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConversationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetConversationRequest. */ + interface IGetConversationRequest { + + /** GetConversationRequest name */ + name?: (string|null); + + /** GetConversationRequest source */ + source?: (google.cloud.ces.v1.Conversation.Source|keyof typeof google.cloud.ces.v1.Conversation.Source|null); + } + + /** Represents a GetConversationRequest. */ + class GetConversationRequest implements IGetConversationRequest { + + /** + * Constructs a new GetConversationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IGetConversationRequest); + + /** GetConversationRequest name. */ + public name: string; + + /** GetConversationRequest source. */ + public source: (google.cloud.ces.v1.Conversation.Source|keyof typeof google.cloud.ces.v1.Conversation.Source); + + /** + * Creates a new GetConversationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConversationRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IGetConversationRequest): google.cloud.ces.v1.GetConversationRequest; + + /** + * Encodes the specified GetConversationRequest message. Does not implicitly {@link google.cloud.ces.v1.GetConversationRequest.verify|verify} messages. + * @param message GetConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IGetConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetConversationRequest.verify|verify} messages. + * @param message GetConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IGetConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConversationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetConversationRequest; + + /** + * Decodes a GetConversationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetConversationRequest; + + /** + * Verifies a GetConversationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetConversationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConversationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetConversationRequest; + + /** + * Creates a plain object from a GetConversationRequest message. Also converts values to other types if specified. + * @param message GetConversationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.GetConversationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConversationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConversationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteConversationRequest. */ + interface IDeleteConversationRequest { + + /** DeleteConversationRequest name */ + name?: (string|null); + + /** DeleteConversationRequest source */ + source?: (google.cloud.ces.v1.Conversation.Source|keyof typeof google.cloud.ces.v1.Conversation.Source|null); + } + + /** Represents a DeleteConversationRequest. */ + class DeleteConversationRequest implements IDeleteConversationRequest { + + /** + * Constructs a new DeleteConversationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IDeleteConversationRequest); + + /** DeleteConversationRequest name. */ + public name: string; + + /** DeleteConversationRequest source. */ + public source: (google.cloud.ces.v1.Conversation.Source|keyof typeof google.cloud.ces.v1.Conversation.Source); + + /** + * Creates a new DeleteConversationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteConversationRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IDeleteConversationRequest): google.cloud.ces.v1.DeleteConversationRequest; + + /** + * Encodes the specified DeleteConversationRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteConversationRequest.verify|verify} messages. + * @param message DeleteConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IDeleteConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteConversationRequest.verify|verify} messages. + * @param message DeleteConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IDeleteConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteConversationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DeleteConversationRequest; + + /** + * Decodes a DeleteConversationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DeleteConversationRequest; + + /** + * Verifies a DeleteConversationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteConversationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteConversationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DeleteConversationRequest; + + /** + * Creates a plain object from a DeleteConversationRequest message. Also converts values to other types if specified. + * @param message DeleteConversationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DeleteConversationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteConversationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteConversationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteConversationsRequest. */ + interface IBatchDeleteConversationsRequest { + + /** BatchDeleteConversationsRequest parent */ + parent?: (string|null); + + /** BatchDeleteConversationsRequest conversations */ + conversations?: (string[]|null); + } + + /** Represents a BatchDeleteConversationsRequest. */ + class BatchDeleteConversationsRequest implements IBatchDeleteConversationsRequest { + + /** + * Constructs a new BatchDeleteConversationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IBatchDeleteConversationsRequest); + + /** BatchDeleteConversationsRequest parent. */ + public parent: string; + + /** BatchDeleteConversationsRequest conversations. */ + public conversations: string[]; + + /** + * Creates a new BatchDeleteConversationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteConversationsRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IBatchDeleteConversationsRequest): google.cloud.ces.v1.BatchDeleteConversationsRequest; + + /** + * Encodes the specified BatchDeleteConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1.BatchDeleteConversationsRequest.verify|verify} messages. + * @param message BatchDeleteConversationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IBatchDeleteConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BatchDeleteConversationsRequest.verify|verify} messages. + * @param message BatchDeleteConversationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IBatchDeleteConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.BatchDeleteConversationsRequest; + + /** + * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.BatchDeleteConversationsRequest; + + /** + * Verifies a BatchDeleteConversationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDeleteConversationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteConversationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.BatchDeleteConversationsRequest; + + /** + * Creates a plain object from a BatchDeleteConversationsRequest message. Also converts values to other types if specified. + * @param message BatchDeleteConversationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.BatchDeleteConversationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteConversationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteConversationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteConversationsResponse. */ + interface IBatchDeleteConversationsResponse { + + /** BatchDeleteConversationsResponse deletedConversations */ + deletedConversations?: (string[]|null); + + /** BatchDeleteConversationsResponse failedConversations */ + failedConversations?: (string[]|null); + + /** BatchDeleteConversationsResponse errorMessages */ + errorMessages?: (string[]|null); + } + + /** Represents a BatchDeleteConversationsResponse. */ + class BatchDeleteConversationsResponse implements IBatchDeleteConversationsResponse { + + /** + * Constructs a new BatchDeleteConversationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IBatchDeleteConversationsResponse); + + /** BatchDeleteConversationsResponse deletedConversations. */ + public deletedConversations: string[]; + + /** BatchDeleteConversationsResponse failedConversations. */ + public failedConversations: string[]; + + /** BatchDeleteConversationsResponse errorMessages. */ + public errorMessages: string[]; + + /** + * Creates a new BatchDeleteConversationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteConversationsResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IBatchDeleteConversationsResponse): google.cloud.ces.v1.BatchDeleteConversationsResponse; + + /** + * Encodes the specified BatchDeleteConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1.BatchDeleteConversationsResponse.verify|verify} messages. + * @param message BatchDeleteConversationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IBatchDeleteConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BatchDeleteConversationsResponse.verify|verify} messages. + * @param message BatchDeleteConversationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IBatchDeleteConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.BatchDeleteConversationsResponse; + + /** + * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.BatchDeleteConversationsResponse; + + /** + * Verifies a BatchDeleteConversationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDeleteConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteConversationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.BatchDeleteConversationsResponse; + + /** + * Creates a plain object from a BatchDeleteConversationsResponse message. Also converts values to other types if specified. + * @param message BatchDeleteConversationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.BatchDeleteConversationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteConversationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteConversationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGuardrailsRequest. */ + interface IListGuardrailsRequest { + + /** ListGuardrailsRequest parent */ + parent?: (string|null); + + /** ListGuardrailsRequest pageSize */ + pageSize?: (number|null); + + /** ListGuardrailsRequest pageToken */ + pageToken?: (string|null); + + /** ListGuardrailsRequest filter */ + filter?: (string|null); + + /** ListGuardrailsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListGuardrailsRequest. */ + class ListGuardrailsRequest implements IListGuardrailsRequest { + + /** + * Constructs a new ListGuardrailsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListGuardrailsRequest); + + /** ListGuardrailsRequest parent. */ + public parent: string; + + /** ListGuardrailsRequest pageSize. */ + public pageSize: number; + + /** ListGuardrailsRequest pageToken. */ + public pageToken: string; + + /** ListGuardrailsRequest filter. */ + public filter: string; + + /** ListGuardrailsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListGuardrailsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGuardrailsRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IListGuardrailsRequest): google.cloud.ces.v1.ListGuardrailsRequest; + + /** + * Encodes the specified ListGuardrailsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListGuardrailsRequest.verify|verify} messages. + * @param message ListGuardrailsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListGuardrailsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGuardrailsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListGuardrailsRequest.verify|verify} messages. + * @param message ListGuardrailsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListGuardrailsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGuardrailsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGuardrailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListGuardrailsRequest; + + /** + * Decodes a ListGuardrailsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGuardrailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListGuardrailsRequest; + + /** + * Verifies a ListGuardrailsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGuardrailsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGuardrailsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListGuardrailsRequest; + + /** + * Creates a plain object from a ListGuardrailsRequest message. Also converts values to other types if specified. + * @param message ListGuardrailsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListGuardrailsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGuardrailsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGuardrailsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGuardrailsResponse. */ + interface IListGuardrailsResponse { + + /** ListGuardrailsResponse guardrails */ + guardrails?: (google.cloud.ces.v1.IGuardrail[]|null); + + /** ListGuardrailsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListGuardrailsResponse. */ + class ListGuardrailsResponse implements IListGuardrailsResponse { + + /** + * Constructs a new ListGuardrailsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListGuardrailsResponse); + + /** ListGuardrailsResponse guardrails. */ + public guardrails: google.cloud.ces.v1.IGuardrail[]; + + /** ListGuardrailsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListGuardrailsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGuardrailsResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IListGuardrailsResponse): google.cloud.ces.v1.ListGuardrailsResponse; + + /** + * Encodes the specified ListGuardrailsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListGuardrailsResponse.verify|verify} messages. + * @param message ListGuardrailsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListGuardrailsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGuardrailsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListGuardrailsResponse.verify|verify} messages. + * @param message ListGuardrailsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListGuardrailsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGuardrailsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGuardrailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListGuardrailsResponse; + + /** + * Decodes a ListGuardrailsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGuardrailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListGuardrailsResponse; + + /** + * Verifies a ListGuardrailsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGuardrailsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGuardrailsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListGuardrailsResponse; + + /** + * Creates a plain object from a ListGuardrailsResponse message. Also converts values to other types if specified. + * @param message ListGuardrailsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListGuardrailsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGuardrailsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGuardrailsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGuardrailRequest. */ + interface IGetGuardrailRequest { + + /** GetGuardrailRequest name */ + name?: (string|null); + } + + /** Represents a GetGuardrailRequest. */ + class GetGuardrailRequest implements IGetGuardrailRequest { + + /** + * Constructs a new GetGuardrailRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IGetGuardrailRequest); + + /** GetGuardrailRequest name. */ + public name: string; + + /** + * Creates a new GetGuardrailRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGuardrailRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IGetGuardrailRequest): google.cloud.ces.v1.GetGuardrailRequest; + + /** + * Encodes the specified GetGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1.GetGuardrailRequest.verify|verify} messages. + * @param message GetGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IGetGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetGuardrailRequest.verify|verify} messages. + * @param message GetGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IGetGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGuardrailRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetGuardrailRequest; + + /** + * Decodes a GetGuardrailRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetGuardrailRequest; + + /** + * Verifies a GetGuardrailRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGuardrailRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetGuardrailRequest; + + /** + * Creates a plain object from a GetGuardrailRequest message. Also converts values to other types if specified. + * @param message GetGuardrailRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.GetGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGuardrailRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGuardrailRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateGuardrailRequest. */ + interface ICreateGuardrailRequest { + + /** CreateGuardrailRequest parent */ + parent?: (string|null); + + /** CreateGuardrailRequest guardrailId */ + guardrailId?: (string|null); + + /** CreateGuardrailRequest guardrail */ + guardrail?: (google.cloud.ces.v1.IGuardrail|null); + } + + /** Represents a CreateGuardrailRequest. */ + class CreateGuardrailRequest implements ICreateGuardrailRequest { + + /** + * Constructs a new CreateGuardrailRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ICreateGuardrailRequest); + + /** CreateGuardrailRequest parent. */ + public parent: string; + + /** CreateGuardrailRequest guardrailId. */ + public guardrailId: string; + + /** CreateGuardrailRequest guardrail. */ + public guardrail?: (google.cloud.ces.v1.IGuardrail|null); + + /** + * Creates a new CreateGuardrailRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGuardrailRequest instance + */ + public static create(properties?: google.cloud.ces.v1.ICreateGuardrailRequest): google.cloud.ces.v1.CreateGuardrailRequest; + + /** + * Encodes the specified CreateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateGuardrailRequest.verify|verify} messages. + * @param message CreateGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ICreateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateGuardrailRequest.verify|verify} messages. + * @param message CreateGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ICreateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGuardrailRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CreateGuardrailRequest; + + /** + * Decodes a CreateGuardrailRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CreateGuardrailRequest; + + /** + * Verifies a CreateGuardrailRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGuardrailRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CreateGuardrailRequest; + + /** + * Creates a plain object from a CreateGuardrailRequest message. Also converts values to other types if specified. + * @param message CreateGuardrailRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.CreateGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGuardrailRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGuardrailRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateGuardrailRequest. */ + interface IUpdateGuardrailRequest { + + /** UpdateGuardrailRequest guardrail */ + guardrail?: (google.cloud.ces.v1.IGuardrail|null); + + /** UpdateGuardrailRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateGuardrailRequest. */ + class UpdateGuardrailRequest implements IUpdateGuardrailRequest { + + /** + * Constructs a new UpdateGuardrailRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IUpdateGuardrailRequest); + + /** UpdateGuardrailRequest guardrail. */ + public guardrail?: (google.cloud.ces.v1.IGuardrail|null); + + /** UpdateGuardrailRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateGuardrailRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateGuardrailRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IUpdateGuardrailRequest): google.cloud.ces.v1.UpdateGuardrailRequest; + + /** + * Encodes the specified UpdateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateGuardrailRequest.verify|verify} messages. + * @param message UpdateGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IUpdateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateGuardrailRequest.verify|verify} messages. + * @param message UpdateGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IUpdateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateGuardrailRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.UpdateGuardrailRequest; + + /** + * Decodes an UpdateGuardrailRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.UpdateGuardrailRequest; + + /** + * Verifies an UpdateGuardrailRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateGuardrailRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.UpdateGuardrailRequest; + + /** + * Creates a plain object from an UpdateGuardrailRequest message. Also converts values to other types if specified. + * @param message UpdateGuardrailRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.UpdateGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateGuardrailRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateGuardrailRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteGuardrailRequest. */ + interface IDeleteGuardrailRequest { + + /** DeleteGuardrailRequest name */ + name?: (string|null); + + /** DeleteGuardrailRequest force */ + force?: (boolean|null); + + /** DeleteGuardrailRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteGuardrailRequest. */ + class DeleteGuardrailRequest implements IDeleteGuardrailRequest { + + /** + * Constructs a new DeleteGuardrailRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IDeleteGuardrailRequest); + + /** DeleteGuardrailRequest name. */ + public name: string; + + /** DeleteGuardrailRequest force. */ + public force: boolean; + + /** DeleteGuardrailRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteGuardrailRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGuardrailRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IDeleteGuardrailRequest): google.cloud.ces.v1.DeleteGuardrailRequest; + + /** + * Encodes the specified DeleteGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteGuardrailRequest.verify|verify} messages. + * @param message DeleteGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IDeleteGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteGuardrailRequest.verify|verify} messages. + * @param message DeleteGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IDeleteGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGuardrailRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DeleteGuardrailRequest; + + /** + * Decodes a DeleteGuardrailRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DeleteGuardrailRequest; + + /** + * Verifies a DeleteGuardrailRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGuardrailRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DeleteGuardrailRequest; + + /** + * Creates a plain object from a DeleteGuardrailRequest message. Also converts values to other types if specified. + * @param message DeleteGuardrailRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DeleteGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGuardrailRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGuardrailRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDeploymentsRequest. */ + interface IListDeploymentsRequest { + + /** ListDeploymentsRequest parent */ + parent?: (string|null); + + /** ListDeploymentsRequest pageSize */ + pageSize?: (number|null); + + /** ListDeploymentsRequest pageToken */ + pageToken?: (string|null); + + /** ListDeploymentsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListDeploymentsRequest. */ + class ListDeploymentsRequest implements IListDeploymentsRequest { + + /** + * Constructs a new ListDeploymentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListDeploymentsRequest); + + /** ListDeploymentsRequest parent. */ + public parent: string; + + /** ListDeploymentsRequest pageSize. */ + public pageSize: number; + + /** ListDeploymentsRequest pageToken. */ + public pageToken: string; + + /** ListDeploymentsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListDeploymentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeploymentsRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IListDeploymentsRequest): google.cloud.ces.v1.ListDeploymentsRequest; + + /** + * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListDeploymentsRequest.verify|verify} messages. + * @param message ListDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListDeploymentsRequest.verify|verify} messages. + * @param message ListDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListDeploymentsRequest; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListDeploymentsRequest; + + /** + * Verifies a ListDeploymentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeploymentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListDeploymentsRequest; + + /** + * Creates a plain object from a ListDeploymentsRequest message. Also converts values to other types if specified. + * @param message ListDeploymentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListDeploymentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeploymentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeploymentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDeploymentsResponse. */ + interface IListDeploymentsResponse { + + /** ListDeploymentsResponse deployments */ + deployments?: (google.cloud.ces.v1.IDeployment[]|null); + + /** ListDeploymentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDeploymentsResponse. */ + class ListDeploymentsResponse implements IListDeploymentsResponse { + + /** + * Constructs a new ListDeploymentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListDeploymentsResponse); + + /** ListDeploymentsResponse deployments. */ + public deployments: google.cloud.ces.v1.IDeployment[]; + + /** ListDeploymentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDeploymentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeploymentsResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IListDeploymentsResponse): google.cloud.ces.v1.ListDeploymentsResponse; + + /** + * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListDeploymentsResponse.verify|verify} messages. + * @param message ListDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListDeploymentsResponse.verify|verify} messages. + * @param message ListDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListDeploymentsResponse; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListDeploymentsResponse; + + /** + * Verifies a ListDeploymentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeploymentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListDeploymentsResponse; + + /** + * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. + * @param message ListDeploymentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListDeploymentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeploymentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeploymentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDeploymentRequest. */ + interface IGetDeploymentRequest { + + /** GetDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a GetDeploymentRequest. */ + class GetDeploymentRequest implements IGetDeploymentRequest { + + /** + * Constructs a new GetDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IGetDeploymentRequest); + + /** GetDeploymentRequest name. */ + public name: string; + + /** + * Creates a new GetDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDeploymentRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IGetDeploymentRequest): google.cloud.ces.v1.GetDeploymentRequest; + + /** + * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1.GetDeploymentRequest.verify|verify} messages. + * @param message GetDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetDeploymentRequest.verify|verify} messages. + * @param message GetDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetDeploymentRequest; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetDeploymentRequest; + + /** + * Verifies a GetDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetDeploymentRequest; + + /** + * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. + * @param message GetDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.GetDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDeploymentRequest. */ + interface ICreateDeploymentRequest { + + /** CreateDeploymentRequest parent */ + parent?: (string|null); + + /** CreateDeploymentRequest deploymentId */ + deploymentId?: (string|null); + + /** CreateDeploymentRequest deployment */ + deployment?: (google.cloud.ces.v1.IDeployment|null); + } + + /** Represents a CreateDeploymentRequest. */ + class CreateDeploymentRequest implements ICreateDeploymentRequest { + + /** + * Constructs a new CreateDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ICreateDeploymentRequest); + + /** CreateDeploymentRequest parent. */ + public parent: string; + + /** CreateDeploymentRequest deploymentId. */ + public deploymentId: string; + + /** CreateDeploymentRequest deployment. */ + public deployment?: (google.cloud.ces.v1.IDeployment|null); + + /** + * Creates a new CreateDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDeploymentRequest instance + */ + public static create(properties?: google.cloud.ces.v1.ICreateDeploymentRequest): google.cloud.ces.v1.CreateDeploymentRequest; + + /** + * Encodes the specified CreateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateDeploymentRequest.verify|verify} messages. + * @param message CreateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ICreateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateDeploymentRequest.verify|verify} messages. + * @param message CreateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ICreateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CreateDeploymentRequest; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CreateDeploymentRequest; + + /** + * Verifies a CreateDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CreateDeploymentRequest; + + /** + * Creates a plain object from a CreateDeploymentRequest message. Also converts values to other types if specified. + * @param message CreateDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.CreateDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDeploymentRequest. */ + interface IUpdateDeploymentRequest { + + /** UpdateDeploymentRequest deployment */ + deployment?: (google.cloud.ces.v1.IDeployment|null); + + /** UpdateDeploymentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDeploymentRequest. */ + class UpdateDeploymentRequest implements IUpdateDeploymentRequest { + + /** + * Constructs a new UpdateDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IUpdateDeploymentRequest); + + /** UpdateDeploymentRequest deployment. */ + public deployment?: (google.cloud.ces.v1.IDeployment|null); + + /** UpdateDeploymentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDeploymentRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IUpdateDeploymentRequest): google.cloud.ces.v1.UpdateDeploymentRequest; + + /** + * Encodes the specified UpdateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateDeploymentRequest.verify|verify} messages. + * @param message UpdateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IUpdateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateDeploymentRequest.verify|verify} messages. + * @param message UpdateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IUpdateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.UpdateDeploymentRequest; + + /** + * Decodes an UpdateDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.UpdateDeploymentRequest; + + /** + * Verifies an UpdateDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.UpdateDeploymentRequest; + + /** + * Creates a plain object from an UpdateDeploymentRequest message. Also converts values to other types if specified. + * @param message UpdateDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.UpdateDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDeploymentRequest. */ + interface IDeleteDeploymentRequest { + + /** DeleteDeploymentRequest name */ + name?: (string|null); + + /** DeleteDeploymentRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteDeploymentRequest. */ + class DeleteDeploymentRequest implements IDeleteDeploymentRequest { + + /** + * Constructs a new DeleteDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IDeleteDeploymentRequest); + + /** DeleteDeploymentRequest name. */ + public name: string; + + /** DeleteDeploymentRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDeploymentRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IDeleteDeploymentRequest): google.cloud.ces.v1.DeleteDeploymentRequest; + + /** + * Encodes the specified DeleteDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteDeploymentRequest.verify|verify} messages. + * @param message DeleteDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IDeleteDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteDeploymentRequest.verify|verify} messages. + * @param message DeleteDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IDeleteDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DeleteDeploymentRequest; + + /** + * Decodes a DeleteDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DeleteDeploymentRequest; + + /** + * Verifies a DeleteDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DeleteDeploymentRequest; + + /** + * Creates a plain object from a DeleteDeploymentRequest message. Also converts values to other types if specified. + * @param message DeleteDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DeleteDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListToolsetsRequest. */ + interface IListToolsetsRequest { + + /** ListToolsetsRequest parent */ + parent?: (string|null); + + /** ListToolsetsRequest pageSize */ + pageSize?: (number|null); + + /** ListToolsetsRequest pageToken */ + pageToken?: (string|null); + + /** ListToolsetsRequest filter */ + filter?: (string|null); + + /** ListToolsetsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListToolsetsRequest. */ + class ListToolsetsRequest implements IListToolsetsRequest { + + /** + * Constructs a new ListToolsetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListToolsetsRequest); + + /** ListToolsetsRequest parent. */ + public parent: string; + + /** ListToolsetsRequest pageSize. */ + public pageSize: number; + + /** ListToolsetsRequest pageToken. */ + public pageToken: string; + + /** ListToolsetsRequest filter. */ + public filter: string; + + /** ListToolsetsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListToolsetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolsetsRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IListToolsetsRequest): google.cloud.ces.v1.ListToolsetsRequest; + + /** + * Encodes the specified ListToolsetsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListToolsetsRequest.verify|verify} messages. + * @param message ListToolsetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListToolsetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolsetsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListToolsetsRequest.verify|verify} messages. + * @param message ListToolsetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListToolsetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolsetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolsetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListToolsetsRequest; + + /** + * Decodes a ListToolsetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolsetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListToolsetsRequest; + + /** + * Verifies a ListToolsetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListToolsetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolsetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListToolsetsRequest; + + /** + * Creates a plain object from a ListToolsetsRequest message. Also converts values to other types if specified. + * @param message ListToolsetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListToolsetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolsetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolsetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListToolsetsResponse. */ + interface IListToolsetsResponse { + + /** ListToolsetsResponse toolsets */ + toolsets?: (google.cloud.ces.v1.IToolset[]|null); + + /** ListToolsetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListToolsetsResponse. */ + class ListToolsetsResponse implements IListToolsetsResponse { + + /** + * Constructs a new ListToolsetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListToolsetsResponse); + + /** ListToolsetsResponse toolsets. */ + public toolsets: google.cloud.ces.v1.IToolset[]; + + /** ListToolsetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListToolsetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolsetsResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IListToolsetsResponse): google.cloud.ces.v1.ListToolsetsResponse; + + /** + * Encodes the specified ListToolsetsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListToolsetsResponse.verify|verify} messages. + * @param message ListToolsetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListToolsetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolsetsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListToolsetsResponse.verify|verify} messages. + * @param message ListToolsetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListToolsetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolsetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolsetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListToolsetsResponse; + + /** + * Decodes a ListToolsetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolsetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListToolsetsResponse; + + /** + * Verifies a ListToolsetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListToolsetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolsetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListToolsetsResponse; + + /** + * Creates a plain object from a ListToolsetsResponse message. Also converts values to other types if specified. + * @param message ListToolsetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListToolsetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolsetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolsetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetToolsetRequest. */ + interface IGetToolsetRequest { + + /** GetToolsetRequest name */ + name?: (string|null); + } + + /** Represents a GetToolsetRequest. */ + class GetToolsetRequest implements IGetToolsetRequest { + + /** + * Constructs a new GetToolsetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IGetToolsetRequest); + + /** GetToolsetRequest name. */ + public name: string; + + /** + * Creates a new GetToolsetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetToolsetRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IGetToolsetRequest): google.cloud.ces.v1.GetToolsetRequest; + + /** + * Encodes the specified GetToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1.GetToolsetRequest.verify|verify} messages. + * @param message GetToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IGetToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetToolsetRequest.verify|verify} messages. + * @param message GetToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IGetToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetToolsetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetToolsetRequest; + + /** + * Decodes a GetToolsetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetToolsetRequest; + + /** + * Verifies a GetToolsetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetToolsetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetToolsetRequest; + + /** + * Creates a plain object from a GetToolsetRequest message. Also converts values to other types if specified. + * @param message GetToolsetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.GetToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetToolsetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetToolsetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateToolsetRequest. */ + interface ICreateToolsetRequest { + + /** CreateToolsetRequest parent */ + parent?: (string|null); + + /** CreateToolsetRequest toolsetId */ + toolsetId?: (string|null); + + /** CreateToolsetRequest toolset */ + toolset?: (google.cloud.ces.v1.IToolset|null); + } + + /** Represents a CreateToolsetRequest. */ + class CreateToolsetRequest implements ICreateToolsetRequest { + + /** + * Constructs a new CreateToolsetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ICreateToolsetRequest); + + /** CreateToolsetRequest parent. */ + public parent: string; + + /** CreateToolsetRequest toolsetId. */ + public toolsetId: string; + + /** CreateToolsetRequest toolset. */ + public toolset?: (google.cloud.ces.v1.IToolset|null); + + /** + * Creates a new CreateToolsetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateToolsetRequest instance + */ + public static create(properties?: google.cloud.ces.v1.ICreateToolsetRequest): google.cloud.ces.v1.CreateToolsetRequest; + + /** + * Encodes the specified CreateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateToolsetRequest.verify|verify} messages. + * @param message CreateToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ICreateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateToolsetRequest.verify|verify} messages. + * @param message CreateToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ICreateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateToolsetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CreateToolsetRequest; + + /** + * Decodes a CreateToolsetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CreateToolsetRequest; + + /** + * Verifies a CreateToolsetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateToolsetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CreateToolsetRequest; + + /** + * Creates a plain object from a CreateToolsetRequest message. Also converts values to other types if specified. + * @param message CreateToolsetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.CreateToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateToolsetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateToolsetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateToolsetRequest. */ + interface IUpdateToolsetRequest { + + /** UpdateToolsetRequest toolset */ + toolset?: (google.cloud.ces.v1.IToolset|null); + + /** UpdateToolsetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateToolsetRequest. */ + class UpdateToolsetRequest implements IUpdateToolsetRequest { + + /** + * Constructs a new UpdateToolsetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IUpdateToolsetRequest); + + /** UpdateToolsetRequest toolset. */ + public toolset?: (google.cloud.ces.v1.IToolset|null); + + /** UpdateToolsetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateToolsetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateToolsetRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IUpdateToolsetRequest): google.cloud.ces.v1.UpdateToolsetRequest; + + /** + * Encodes the specified UpdateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateToolsetRequest.verify|verify} messages. + * @param message UpdateToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IUpdateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateToolsetRequest.verify|verify} messages. + * @param message UpdateToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IUpdateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateToolsetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.UpdateToolsetRequest; + + /** + * Decodes an UpdateToolsetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.UpdateToolsetRequest; + + /** + * Verifies an UpdateToolsetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateToolsetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.UpdateToolsetRequest; + + /** + * Creates a plain object from an UpdateToolsetRequest message. Also converts values to other types if specified. + * @param message UpdateToolsetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.UpdateToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateToolsetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateToolsetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteToolsetRequest. */ + interface IDeleteToolsetRequest { + + /** DeleteToolsetRequest name */ + name?: (string|null); + + /** DeleteToolsetRequest force */ + force?: (boolean|null); + + /** DeleteToolsetRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteToolsetRequest. */ + class DeleteToolsetRequest implements IDeleteToolsetRequest { + + /** + * Constructs a new DeleteToolsetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IDeleteToolsetRequest); + + /** DeleteToolsetRequest name. */ + public name: string; + + /** DeleteToolsetRequest force. */ + public force: boolean; + + /** DeleteToolsetRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteToolsetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteToolsetRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IDeleteToolsetRequest): google.cloud.ces.v1.DeleteToolsetRequest; + + /** + * Encodes the specified DeleteToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteToolsetRequest.verify|verify} messages. + * @param message DeleteToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IDeleteToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteToolsetRequest.verify|verify} messages. + * @param message DeleteToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IDeleteToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteToolsetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DeleteToolsetRequest; + + /** + * Decodes a DeleteToolsetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DeleteToolsetRequest; + + /** + * Verifies a DeleteToolsetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteToolsetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DeleteToolsetRequest; + + /** + * Creates a plain object from a DeleteToolsetRequest message. Also converts values to other types if specified. + * @param message DeleteToolsetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DeleteToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteToolsetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteToolsetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAppVersionsRequest. */ + interface IListAppVersionsRequest { + + /** ListAppVersionsRequest parent */ + parent?: (string|null); + + /** ListAppVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListAppVersionsRequest pageToken */ + pageToken?: (string|null); + + /** ListAppVersionsRequest filter */ + filter?: (string|null); + + /** ListAppVersionsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListAppVersionsRequest. */ + class ListAppVersionsRequest implements IListAppVersionsRequest { + + /** + * Constructs a new ListAppVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListAppVersionsRequest); + + /** ListAppVersionsRequest parent. */ + public parent: string; + + /** ListAppVersionsRequest pageSize. */ + public pageSize: number; + + /** ListAppVersionsRequest pageToken. */ + public pageToken: string; + + /** ListAppVersionsRequest filter. */ + public filter: string; + + /** ListAppVersionsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListAppVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAppVersionsRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IListAppVersionsRequest): google.cloud.ces.v1.ListAppVersionsRequest; + + /** + * Encodes the specified ListAppVersionsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListAppVersionsRequest.verify|verify} messages. + * @param message ListAppVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListAppVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAppVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAppVersionsRequest.verify|verify} messages. + * @param message ListAppVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListAppVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAppVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAppVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListAppVersionsRequest; + + /** + * Decodes a ListAppVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAppVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListAppVersionsRequest; + + /** + * Verifies a ListAppVersionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAppVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAppVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListAppVersionsRequest; + + /** + * Creates a plain object from a ListAppVersionsRequest message. Also converts values to other types if specified. + * @param message ListAppVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListAppVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAppVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAppVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAppVersionsResponse. */ + interface IListAppVersionsResponse { + + /** ListAppVersionsResponse appVersions */ + appVersions?: (google.cloud.ces.v1.IAppVersion[]|null); + + /** ListAppVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAppVersionsResponse. */ + class ListAppVersionsResponse implements IListAppVersionsResponse { + + /** + * Constructs a new ListAppVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListAppVersionsResponse); + + /** ListAppVersionsResponse appVersions. */ + public appVersions: google.cloud.ces.v1.IAppVersion[]; + + /** ListAppVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAppVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAppVersionsResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IListAppVersionsResponse): google.cloud.ces.v1.ListAppVersionsResponse; + + /** + * Encodes the specified ListAppVersionsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListAppVersionsResponse.verify|verify} messages. + * @param message ListAppVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListAppVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAppVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAppVersionsResponse.verify|verify} messages. + * @param message ListAppVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListAppVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAppVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAppVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListAppVersionsResponse; + + /** + * Decodes a ListAppVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAppVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListAppVersionsResponse; + + /** + * Verifies a ListAppVersionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAppVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAppVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListAppVersionsResponse; + + /** + * Creates a plain object from a ListAppVersionsResponse message. Also converts values to other types if specified. + * @param message ListAppVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListAppVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAppVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAppVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAppVersionRequest. */ + interface IGetAppVersionRequest { + + /** GetAppVersionRequest name */ + name?: (string|null); + } + + /** Represents a GetAppVersionRequest. */ + class GetAppVersionRequest implements IGetAppVersionRequest { + + /** + * Constructs a new GetAppVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IGetAppVersionRequest); + + /** GetAppVersionRequest name. */ + public name: string; + + /** + * Creates a new GetAppVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAppVersionRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IGetAppVersionRequest): google.cloud.ces.v1.GetAppVersionRequest; + + /** + * Encodes the specified GetAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1.GetAppVersionRequest.verify|verify} messages. + * @param message GetAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IGetAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetAppVersionRequest.verify|verify} messages. + * @param message GetAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IGetAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAppVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetAppVersionRequest; + + /** + * Decodes a GetAppVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetAppVersionRequest; + + /** + * Verifies a GetAppVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAppVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetAppVersionRequest; + + /** + * Creates a plain object from a GetAppVersionRequest message. Also converts values to other types if specified. + * @param message GetAppVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.GetAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAppVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAppVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAppVersionRequest. */ + interface IDeleteAppVersionRequest { + + /** DeleteAppVersionRequest name */ + name?: (string|null); + + /** DeleteAppVersionRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteAppVersionRequest. */ + class DeleteAppVersionRequest implements IDeleteAppVersionRequest { + + /** + * Constructs a new DeleteAppVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IDeleteAppVersionRequest); + + /** DeleteAppVersionRequest name. */ + public name: string; + + /** DeleteAppVersionRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteAppVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAppVersionRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IDeleteAppVersionRequest): google.cloud.ces.v1.DeleteAppVersionRequest; + + /** + * Encodes the specified DeleteAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteAppVersionRequest.verify|verify} messages. + * @param message DeleteAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IDeleteAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteAppVersionRequest.verify|verify} messages. + * @param message DeleteAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IDeleteAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAppVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DeleteAppVersionRequest; + + /** + * Decodes a DeleteAppVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DeleteAppVersionRequest; + + /** + * Verifies a DeleteAppVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAppVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DeleteAppVersionRequest; + + /** + * Creates a plain object from a DeleteAppVersionRequest message. Also converts values to other types if specified. + * @param message DeleteAppVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DeleteAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAppVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAppVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAppVersionRequest. */ + interface ICreateAppVersionRequest { + + /** CreateAppVersionRequest parent */ + parent?: (string|null); + + /** CreateAppVersionRequest appVersionId */ + appVersionId?: (string|null); + + /** CreateAppVersionRequest appVersion */ + appVersion?: (google.cloud.ces.v1.IAppVersion|null); + } + + /** Represents a CreateAppVersionRequest. */ + class CreateAppVersionRequest implements ICreateAppVersionRequest { + + /** + * Constructs a new CreateAppVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ICreateAppVersionRequest); + + /** CreateAppVersionRequest parent. */ + public parent: string; + + /** CreateAppVersionRequest appVersionId. */ + public appVersionId: string; + + /** CreateAppVersionRequest appVersion. */ + public appVersion?: (google.cloud.ces.v1.IAppVersion|null); + + /** + * Creates a new CreateAppVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAppVersionRequest instance + */ + public static create(properties?: google.cloud.ces.v1.ICreateAppVersionRequest): google.cloud.ces.v1.CreateAppVersionRequest; + + /** + * Encodes the specified CreateAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateAppVersionRequest.verify|verify} messages. + * @param message CreateAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ICreateAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateAppVersionRequest.verify|verify} messages. + * @param message CreateAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ICreateAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAppVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CreateAppVersionRequest; + + /** + * Decodes a CreateAppVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CreateAppVersionRequest; + + /** + * Verifies a CreateAppVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAppVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CreateAppVersionRequest; + + /** + * Creates a plain object from a CreateAppVersionRequest message. Also converts values to other types if specified. + * @param message CreateAppVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.CreateAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAppVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAppVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreAppVersionRequest. */ + interface IRestoreAppVersionRequest { + + /** RestoreAppVersionRequest name */ + name?: (string|null); + } + + /** Represents a RestoreAppVersionRequest. */ + class RestoreAppVersionRequest implements IRestoreAppVersionRequest { + + /** + * Constructs a new RestoreAppVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IRestoreAppVersionRequest); + + /** RestoreAppVersionRequest name. */ + public name: string; + + /** + * Creates a new RestoreAppVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreAppVersionRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IRestoreAppVersionRequest): google.cloud.ces.v1.RestoreAppVersionRequest; + + /** + * Encodes the specified RestoreAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1.RestoreAppVersionRequest.verify|verify} messages. + * @param message RestoreAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IRestoreAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RestoreAppVersionRequest.verify|verify} messages. + * @param message RestoreAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IRestoreAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreAppVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RestoreAppVersionRequest; + + /** + * Decodes a RestoreAppVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RestoreAppVersionRequest; + + /** + * Verifies a RestoreAppVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreAppVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RestoreAppVersionRequest; + + /** + * Creates a plain object from a RestoreAppVersionRequest message. Also converts values to other types if specified. + * @param message RestoreAppVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.RestoreAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreAppVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreAppVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreAppVersionResponse. */ + interface IRestoreAppVersionResponse { + } + + /** Represents a RestoreAppVersionResponse. */ + class RestoreAppVersionResponse implements IRestoreAppVersionResponse { + + /** + * Constructs a new RestoreAppVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IRestoreAppVersionResponse); + + /** + * Creates a new RestoreAppVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreAppVersionResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IRestoreAppVersionResponse): google.cloud.ces.v1.RestoreAppVersionResponse; + + /** + * Encodes the specified RestoreAppVersionResponse message. Does not implicitly {@link google.cloud.ces.v1.RestoreAppVersionResponse.verify|verify} messages. + * @param message RestoreAppVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IRestoreAppVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreAppVersionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RestoreAppVersionResponse.verify|verify} messages. + * @param message RestoreAppVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IRestoreAppVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreAppVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreAppVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RestoreAppVersionResponse; + + /** + * Decodes a RestoreAppVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreAppVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RestoreAppVersionResponse; + + /** + * Verifies a RestoreAppVersionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreAppVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreAppVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RestoreAppVersionResponse; + + /** + * Creates a plain object from a RestoreAppVersionResponse message. Also converts values to other types if specified. + * @param message RestoreAppVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.RestoreAppVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreAppVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreAppVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListChangelogsRequest. */ + interface IListChangelogsRequest { + + /** ListChangelogsRequest parent */ + parent?: (string|null); + + /** ListChangelogsRequest pageSize */ + pageSize?: (number|null); + + /** ListChangelogsRequest pageToken */ + pageToken?: (string|null); + + /** ListChangelogsRequest filter */ + filter?: (string|null); + + /** ListChangelogsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListChangelogsRequest. */ + class ListChangelogsRequest implements IListChangelogsRequest { + + /** + * Constructs a new ListChangelogsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListChangelogsRequest); + + /** ListChangelogsRequest parent. */ + public parent: string; + + /** ListChangelogsRequest pageSize. */ + public pageSize: number; + + /** ListChangelogsRequest pageToken. */ + public pageToken: string; + + /** ListChangelogsRequest filter. */ + public filter: string; + + /** ListChangelogsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListChangelogsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChangelogsRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IListChangelogsRequest): google.cloud.ces.v1.ListChangelogsRequest; + + /** + * Encodes the specified ListChangelogsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListChangelogsRequest.verify|verify} messages. + * @param message ListChangelogsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListChangelogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListChangelogsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListChangelogsRequest.verify|verify} messages. + * @param message ListChangelogsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListChangelogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChangelogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListChangelogsRequest; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChangelogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListChangelogsRequest; + + /** + * Verifies a ListChangelogsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListChangelogsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChangelogsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListChangelogsRequest; + + /** + * Creates a plain object from a ListChangelogsRequest message. Also converts values to other types if specified. + * @param message ListChangelogsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListChangelogsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListChangelogsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChangelogsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListChangelogsResponse. */ + interface IListChangelogsResponse { + + /** ListChangelogsResponse changelogs */ + changelogs?: (google.cloud.ces.v1.IChangelog[]|null); + + /** ListChangelogsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListChangelogsResponse. */ + class ListChangelogsResponse implements IListChangelogsResponse { + + /** + * Constructs a new ListChangelogsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IListChangelogsResponse); + + /** ListChangelogsResponse changelogs. */ + public changelogs: google.cloud.ces.v1.IChangelog[]; + + /** ListChangelogsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListChangelogsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChangelogsResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IListChangelogsResponse): google.cloud.ces.v1.ListChangelogsResponse; + + /** + * Encodes the specified ListChangelogsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListChangelogsResponse.verify|verify} messages. + * @param message ListChangelogsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IListChangelogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListChangelogsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListChangelogsResponse.verify|verify} messages. + * @param message ListChangelogsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IListChangelogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChangelogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListChangelogsResponse; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChangelogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListChangelogsResponse; + + /** + * Verifies a ListChangelogsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListChangelogsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChangelogsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListChangelogsResponse; + + /** + * Creates a plain object from a ListChangelogsResponse message. Also converts values to other types if specified. + * @param message ListChangelogsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ListChangelogsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListChangelogsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChangelogsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetChangelogRequest. */ + interface IGetChangelogRequest { + + /** GetChangelogRequest name */ + name?: (string|null); + } + + /** Represents a GetChangelogRequest. */ + class GetChangelogRequest implements IGetChangelogRequest { + + /** + * Constructs a new GetChangelogRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IGetChangelogRequest); + + /** GetChangelogRequest name. */ + public name: string; + + /** + * Creates a new GetChangelogRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetChangelogRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IGetChangelogRequest): google.cloud.ces.v1.GetChangelogRequest; + + /** + * Encodes the specified GetChangelogRequest message. Does not implicitly {@link google.cloud.ces.v1.GetChangelogRequest.verify|verify} messages. + * @param message GetChangelogRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IGetChangelogRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetChangelogRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetChangelogRequest.verify|verify} messages. + * @param message GetChangelogRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IGetChangelogRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetChangelogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetChangelogRequest; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetChangelogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetChangelogRequest; + + /** + * Verifies a GetChangelogRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetChangelogRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetChangelogRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetChangelogRequest; + + /** + * Creates a plain object from a GetChangelogRequest message. Also converts values to other types if specified. + * @param message GetChangelogRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.GetChangelogRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetChangelogRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetChangelogRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an App. */ + interface IApp { + + /** App name */ + name?: (string|null); + + /** App displayName */ + displayName?: (string|null); + + /** App description */ + description?: (string|null); + + /** App pinned */ + pinned?: (boolean|null); + + /** App rootAgent */ + rootAgent?: (string|null); + + /** App languageSettings */ + languageSettings?: (google.cloud.ces.v1.ILanguageSettings|null); + + /** App timeZoneSettings */ + timeZoneSettings?: (google.cloud.ces.v1.ITimeZoneSettings|null); + + /** App audioProcessingConfig */ + audioProcessingConfig?: (google.cloud.ces.v1.IAudioProcessingConfig|null); + + /** App loggingSettings */ + loggingSettings?: (google.cloud.ces.v1.ILoggingSettings|null); + + /** App modelSettings */ + modelSettings?: (google.cloud.ces.v1.IModelSettings|null); + + /** App toolExecutionMode */ + toolExecutionMode?: (google.cloud.ces.v1.App.ToolExecutionMode|keyof typeof google.cloud.ces.v1.App.ToolExecutionMode|null); + + /** App evaluationMetricsThresholds */ + evaluationMetricsThresholds?: (google.cloud.ces.v1.IEvaluationMetricsThresholds|null); + + /** App variableDeclarations */ + variableDeclarations?: (google.cloud.ces.v1.App.IVariableDeclaration[]|null); + + /** App predefinedVariableDeclarations */ + predefinedVariableDeclarations?: (google.cloud.ces.v1.App.IVariableDeclaration[]|null); + + /** App globalInstruction */ + globalInstruction?: (string|null); + + /** App guardrails */ + guardrails?: (string[]|null); + + /** App dataStoreSettings */ + dataStoreSettings?: (google.cloud.ces.v1.IDataStoreSettings|null); + + /** App defaultChannelProfile */ + defaultChannelProfile?: (google.cloud.ces.v1.IChannelProfile|null); + + /** App metadata */ + metadata?: ({ [k: string]: string }|null); + + /** App createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** App updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** App etag */ + etag?: (string|null); + + /** App deploymentCount */ + deploymentCount?: (number|null); + + /** App clientCertificateSettings */ + clientCertificateSettings?: (google.cloud.ces.v1.IClientCertificateSettings|null); + + /** App locked */ + locked?: (boolean|null); + } + + /** Represents an App. */ + class App implements IApp { + + /** + * Constructs a new App. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IApp); + + /** App name. */ + public name: string; + + /** App displayName. */ + public displayName: string; + + /** App description. */ + public description: string; + + /** App pinned. */ + public pinned: boolean; + + /** App rootAgent. */ + public rootAgent: string; + + /** App languageSettings. */ + public languageSettings?: (google.cloud.ces.v1.ILanguageSettings|null); + + /** App timeZoneSettings. */ + public timeZoneSettings?: (google.cloud.ces.v1.ITimeZoneSettings|null); + + /** App audioProcessingConfig. */ + public audioProcessingConfig?: (google.cloud.ces.v1.IAudioProcessingConfig|null); + + /** App loggingSettings. */ + public loggingSettings?: (google.cloud.ces.v1.ILoggingSettings|null); + + /** App modelSettings. */ + public modelSettings?: (google.cloud.ces.v1.IModelSettings|null); + + /** App toolExecutionMode. */ + public toolExecutionMode: (google.cloud.ces.v1.App.ToolExecutionMode|keyof typeof google.cloud.ces.v1.App.ToolExecutionMode); + + /** App evaluationMetricsThresholds. */ + public evaluationMetricsThresholds?: (google.cloud.ces.v1.IEvaluationMetricsThresholds|null); + + /** App variableDeclarations. */ + public variableDeclarations: google.cloud.ces.v1.App.IVariableDeclaration[]; + + /** App predefinedVariableDeclarations. */ + public predefinedVariableDeclarations: google.cloud.ces.v1.App.IVariableDeclaration[]; + + /** App globalInstruction. */ + public globalInstruction: string; + + /** App guardrails. */ + public guardrails: string[]; + + /** App dataStoreSettings. */ + public dataStoreSettings?: (google.cloud.ces.v1.IDataStoreSettings|null); + + /** App defaultChannelProfile. */ + public defaultChannelProfile?: (google.cloud.ces.v1.IChannelProfile|null); + + /** App metadata. */ + public metadata: { [k: string]: string }; + + /** App createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** App updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** App etag. */ + public etag: string; + + /** App deploymentCount. */ + public deploymentCount: number; + + /** App clientCertificateSettings. */ + public clientCertificateSettings?: (google.cloud.ces.v1.IClientCertificateSettings|null); + + /** App locked. */ + public locked: boolean; + + /** + * Creates a new App instance using the specified properties. + * @param [properties] Properties to set + * @returns App instance + */ + public static create(properties?: google.cloud.ces.v1.IApp): google.cloud.ces.v1.App; + + /** + * Encodes the specified App message. Does not implicitly {@link google.cloud.ces.v1.App.verify|verify} messages. + * @param message App message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IApp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified App message, length delimited. Does not implicitly {@link google.cloud.ces.v1.App.verify|verify} messages. + * @param message App message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IApp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an App message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns App + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.App; + + /** + * Decodes an App message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns App + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.App; + + /** + * Verifies an App message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an App message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns App + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.App; + + /** + * Creates a plain object from an App message. Also converts values to other types if specified. + * @param message App + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.App, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this App to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for App + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace App { + + /** Properties of a VariableDeclaration. */ + interface IVariableDeclaration { + + /** VariableDeclaration name */ + name?: (string|null); + + /** VariableDeclaration description */ + description?: (string|null); + + /** VariableDeclaration schema */ + schema?: (google.cloud.ces.v1.ISchema|null); + } + + /** Represents a VariableDeclaration. */ + class VariableDeclaration implements IVariableDeclaration { + + /** + * Constructs a new VariableDeclaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.App.IVariableDeclaration); + + /** VariableDeclaration name. */ + public name: string; + + /** VariableDeclaration description. */ + public description: string; + + /** VariableDeclaration schema. */ + public schema?: (google.cloud.ces.v1.ISchema|null); + + /** + * Creates a new VariableDeclaration instance using the specified properties. + * @param [properties] Properties to set + * @returns VariableDeclaration instance + */ + public static create(properties?: google.cloud.ces.v1.App.IVariableDeclaration): google.cloud.ces.v1.App.VariableDeclaration; + + /** + * Encodes the specified VariableDeclaration message. Does not implicitly {@link google.cloud.ces.v1.App.VariableDeclaration.verify|verify} messages. + * @param message VariableDeclaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.App.IVariableDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VariableDeclaration message, length delimited. Does not implicitly {@link google.cloud.ces.v1.App.VariableDeclaration.verify|verify} messages. + * @param message VariableDeclaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.App.IVariableDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VariableDeclaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VariableDeclaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.App.VariableDeclaration; + + /** + * Decodes a VariableDeclaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VariableDeclaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.App.VariableDeclaration; + + /** + * Verifies a VariableDeclaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VariableDeclaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VariableDeclaration + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.App.VariableDeclaration; + + /** + * Creates a plain object from a VariableDeclaration message. Also converts values to other types if specified. + * @param message VariableDeclaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.App.VariableDeclaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VariableDeclaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VariableDeclaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ToolExecutionMode enum. */ + enum ToolExecutionMode { + TOOL_EXECUTION_MODE_UNSPECIFIED = 0, + PARALLEL = 1, + SEQUENTIAL = 2 + } + } + + /** Properties of a TimeZoneSettings. */ + interface ITimeZoneSettings { + + /** TimeZoneSettings timeZone */ + timeZone?: (string|null); + } + + /** Represents a TimeZoneSettings. */ + class TimeZoneSettings implements ITimeZoneSettings { + + /** + * Constructs a new TimeZoneSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ITimeZoneSettings); + + /** TimeZoneSettings timeZone. */ + public timeZone: string; + + /** + * Creates a new TimeZoneSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeZoneSettings instance + */ + public static create(properties?: google.cloud.ces.v1.ITimeZoneSettings): google.cloud.ces.v1.TimeZoneSettings; + + /** + * Encodes the specified TimeZoneSettings message. Does not implicitly {@link google.cloud.ces.v1.TimeZoneSettings.verify|verify} messages. + * @param message TimeZoneSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ITimeZoneSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeZoneSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TimeZoneSettings.verify|verify} messages. + * @param message TimeZoneSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ITimeZoneSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeZoneSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeZoneSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TimeZoneSettings; + + /** + * Decodes a TimeZoneSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeZoneSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TimeZoneSettings; + + /** + * Verifies a TimeZoneSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeZoneSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeZoneSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TimeZoneSettings; + + /** + * Creates a plain object from a TimeZoneSettings message. Also converts values to other types if specified. + * @param message TimeZoneSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.TimeZoneSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeZoneSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeZoneSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LanguageSettings. */ + interface ILanguageSettings { + + /** LanguageSettings defaultLanguageCode */ + defaultLanguageCode?: (string|null); + + /** LanguageSettings supportedLanguageCodes */ + supportedLanguageCodes?: (string[]|null); + + /** LanguageSettings enableMultilingualSupport */ + enableMultilingualSupport?: (boolean|null); + + /** LanguageSettings fallbackAction */ + fallbackAction?: (string|null); + } + + /** Represents a LanguageSettings. */ + class LanguageSettings implements ILanguageSettings { + + /** + * Constructs a new LanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ILanguageSettings); + + /** LanguageSettings defaultLanguageCode. */ + public defaultLanguageCode: string; + + /** LanguageSettings supportedLanguageCodes. */ + public supportedLanguageCodes: string[]; + + /** LanguageSettings enableMultilingualSupport. */ + public enableMultilingualSupport: boolean; + + /** LanguageSettings fallbackAction. */ + public fallbackAction: string; + + /** + * Creates a new LanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns LanguageSettings instance + */ + public static create(properties?: google.cloud.ces.v1.ILanguageSettings): google.cloud.ces.v1.LanguageSettings; + + /** + * Encodes the specified LanguageSettings message. Does not implicitly {@link google.cloud.ces.v1.LanguageSettings.verify|verify} messages. + * @param message LanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ILanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LanguageSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.LanguageSettings.verify|verify} messages. + * @param message LanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ILanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.LanguageSettings; + + /** + * Decodes a LanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.LanguageSettings; + + /** + * Verifies a LanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.LanguageSettings; + + /** + * Creates a plain object from a LanguageSettings message. Also converts values to other types if specified. + * @param message LanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.LanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AudioProcessingConfig. */ + interface IAudioProcessingConfig { + + /** AudioProcessingConfig synthesizeSpeechConfigs */ + synthesizeSpeechConfigs?: ({ [k: string]: google.cloud.ces.v1.ISynthesizeSpeechConfig }|null); + + /** AudioProcessingConfig bargeInConfig */ + bargeInConfig?: (google.cloud.ces.v1.IBargeInConfig|null); + + /** AudioProcessingConfig inactivityTimeout */ + inactivityTimeout?: (google.protobuf.IDuration|null); + + /** AudioProcessingConfig ambientSoundConfig */ + ambientSoundConfig?: (google.cloud.ces.v1.IAmbientSoundConfig|null); + } + + /** Represents an AudioProcessingConfig. */ + class AudioProcessingConfig implements IAudioProcessingConfig { + + /** + * Constructs a new AudioProcessingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IAudioProcessingConfig); + + /** AudioProcessingConfig synthesizeSpeechConfigs. */ + public synthesizeSpeechConfigs: { [k: string]: google.cloud.ces.v1.ISynthesizeSpeechConfig }; + + /** AudioProcessingConfig bargeInConfig. */ + public bargeInConfig?: (google.cloud.ces.v1.IBargeInConfig|null); + + /** AudioProcessingConfig inactivityTimeout. */ + public inactivityTimeout?: (google.protobuf.IDuration|null); + + /** AudioProcessingConfig ambientSoundConfig. */ + public ambientSoundConfig?: (google.cloud.ces.v1.IAmbientSoundConfig|null); + + /** + * Creates a new AudioProcessingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AudioProcessingConfig instance + */ + public static create(properties?: google.cloud.ces.v1.IAudioProcessingConfig): google.cloud.ces.v1.AudioProcessingConfig; + + /** + * Encodes the specified AudioProcessingConfig message. Does not implicitly {@link google.cloud.ces.v1.AudioProcessingConfig.verify|verify} messages. + * @param message AudioProcessingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IAudioProcessingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AudioProcessingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AudioProcessingConfig.verify|verify} messages. + * @param message AudioProcessingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IAudioProcessingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AudioProcessingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AudioProcessingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.AudioProcessingConfig; + + /** + * Decodes an AudioProcessingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AudioProcessingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.AudioProcessingConfig; + + /** + * Verifies an AudioProcessingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AudioProcessingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AudioProcessingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.AudioProcessingConfig; + + /** + * Creates a plain object from an AudioProcessingConfig message. Also converts values to other types if specified. + * @param message AudioProcessingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.AudioProcessingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AudioProcessingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AudioProcessingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AmbientSoundConfig. */ + interface IAmbientSoundConfig { + + /** AmbientSoundConfig prebuiltAmbientNoise */ + prebuiltAmbientNoise?: (google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise|keyof typeof google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise|null); + + /** AmbientSoundConfig gcsUri */ + gcsUri?: (string|null); + + /** AmbientSoundConfig prebuiltAmbientSound */ + prebuiltAmbientSound?: (string|null); + + /** AmbientSoundConfig volumeGainDb */ + volumeGainDb?: (number|null); + } + + /** Represents an AmbientSoundConfig. */ + class AmbientSoundConfig implements IAmbientSoundConfig { + + /** + * Constructs a new AmbientSoundConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IAmbientSoundConfig); + + /** AmbientSoundConfig prebuiltAmbientNoise. */ + public prebuiltAmbientNoise?: (google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise|keyof typeof google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise|null); + + /** AmbientSoundConfig gcsUri. */ + public gcsUri?: (string|null); + + /** AmbientSoundConfig prebuiltAmbientSound. */ + public prebuiltAmbientSound?: (string|null); + + /** AmbientSoundConfig volumeGainDb. */ + public volumeGainDb: number; + + /** AmbientSoundConfig source. */ + public source?: ("prebuiltAmbientNoise"|"gcsUri"|"prebuiltAmbientSound"); + + /** + * Creates a new AmbientSoundConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AmbientSoundConfig instance + */ + public static create(properties?: google.cloud.ces.v1.IAmbientSoundConfig): google.cloud.ces.v1.AmbientSoundConfig; + + /** + * Encodes the specified AmbientSoundConfig message. Does not implicitly {@link google.cloud.ces.v1.AmbientSoundConfig.verify|verify} messages. + * @param message AmbientSoundConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IAmbientSoundConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AmbientSoundConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AmbientSoundConfig.verify|verify} messages. + * @param message AmbientSoundConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IAmbientSoundConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AmbientSoundConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AmbientSoundConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.AmbientSoundConfig; + + /** + * Decodes an AmbientSoundConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AmbientSoundConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.AmbientSoundConfig; + + /** + * Verifies an AmbientSoundConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AmbientSoundConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AmbientSoundConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.AmbientSoundConfig; + + /** + * Creates a plain object from an AmbientSoundConfig message. Also converts values to other types if specified. + * @param message AmbientSoundConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.AmbientSoundConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AmbientSoundConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AmbientSoundConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AmbientSoundConfig { + + /** PrebuiltAmbientNoise enum. */ + enum PrebuiltAmbientNoise { + PREBUILT_AMBIENT_NOISE_UNSPECIFIED = 0, + RETAIL_STORE = 1, + CONVENTION_HALL = 2, + OUTDOOR = 3 + } + } + + /** Properties of a BargeInConfig. */ + interface IBargeInConfig { + + /** BargeInConfig disableBargeIn */ + disableBargeIn?: (boolean|null); + + /** BargeInConfig bargeInAwareness */ + bargeInAwareness?: (boolean|null); + } + + /** Represents a BargeInConfig. */ + class BargeInConfig implements IBargeInConfig { + + /** + * Constructs a new BargeInConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IBargeInConfig); + + /** BargeInConfig disableBargeIn. */ + public disableBargeIn: boolean; + + /** BargeInConfig bargeInAwareness. */ + public bargeInAwareness: boolean; + + /** + * Creates a new BargeInConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BargeInConfig instance + */ + public static create(properties?: google.cloud.ces.v1.IBargeInConfig): google.cloud.ces.v1.BargeInConfig; + + /** + * Encodes the specified BargeInConfig message. Does not implicitly {@link google.cloud.ces.v1.BargeInConfig.verify|verify} messages. + * @param message BargeInConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IBargeInConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BargeInConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BargeInConfig.verify|verify} messages. + * @param message BargeInConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IBargeInConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BargeInConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.BargeInConfig; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BargeInConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.BargeInConfig; + + /** + * Verifies a BargeInConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BargeInConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BargeInConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.BargeInConfig; + + /** + * Creates a plain object from a BargeInConfig message. Also converts values to other types if specified. + * @param message BargeInConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.BargeInConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BargeInConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BargeInConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SynthesizeSpeechConfig. */ + interface ISynthesizeSpeechConfig { + + /** SynthesizeSpeechConfig voice */ + voice?: (string|null); + + /** SynthesizeSpeechConfig speakingRate */ + speakingRate?: (number|null); + } + + /** Represents a SynthesizeSpeechConfig. */ + class SynthesizeSpeechConfig implements ISynthesizeSpeechConfig { + + /** + * Constructs a new SynthesizeSpeechConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ISynthesizeSpeechConfig); + + /** SynthesizeSpeechConfig voice. */ + public voice: string; + + /** SynthesizeSpeechConfig speakingRate. */ + public speakingRate: number; + + /** + * Creates a new SynthesizeSpeechConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SynthesizeSpeechConfig instance + */ + public static create(properties?: google.cloud.ces.v1.ISynthesizeSpeechConfig): google.cloud.ces.v1.SynthesizeSpeechConfig; + + /** + * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.ces.v1.SynthesizeSpeechConfig.verify|verify} messages. + * @param message SynthesizeSpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SynthesizeSpeechConfig.verify|verify} messages. + * @param message SynthesizeSpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.SynthesizeSpeechConfig; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.SynthesizeSpeechConfig; + + /** + * Verifies a SynthesizeSpeechConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SynthesizeSpeechConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.SynthesizeSpeechConfig; + + /** + * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. + * @param message SynthesizeSpeechConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.SynthesizeSpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SynthesizeSpeechConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SynthesizeSpeechConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetricAnalysisSettings. */ + interface IMetricAnalysisSettings { + + /** MetricAnalysisSettings llmMetricsOptedOut */ + llmMetricsOptedOut?: (boolean|null); + } + + /** Represents a MetricAnalysisSettings. */ + class MetricAnalysisSettings implements IMetricAnalysisSettings { + + /** + * Constructs a new MetricAnalysisSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IMetricAnalysisSettings); + + /** MetricAnalysisSettings llmMetricsOptedOut. */ + public llmMetricsOptedOut: boolean; + + /** + * Creates a new MetricAnalysisSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricAnalysisSettings instance + */ + public static create(properties?: google.cloud.ces.v1.IMetricAnalysisSettings): google.cloud.ces.v1.MetricAnalysisSettings; + + /** + * Encodes the specified MetricAnalysisSettings message. Does not implicitly {@link google.cloud.ces.v1.MetricAnalysisSettings.verify|verify} messages. + * @param message MetricAnalysisSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IMetricAnalysisSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricAnalysisSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.MetricAnalysisSettings.verify|verify} messages. + * @param message MetricAnalysisSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IMetricAnalysisSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricAnalysisSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricAnalysisSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.MetricAnalysisSettings; + + /** + * Decodes a MetricAnalysisSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricAnalysisSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.MetricAnalysisSettings; + + /** + * Verifies a MetricAnalysisSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetricAnalysisSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricAnalysisSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.MetricAnalysisSettings; + + /** + * Creates a plain object from a MetricAnalysisSettings message. Also converts values to other types if specified. + * @param message MetricAnalysisSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.MetricAnalysisSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricAnalysisSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricAnalysisSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LoggingSettings. */ + interface ILoggingSettings { + + /** LoggingSettings redactionConfig */ + redactionConfig?: (google.cloud.ces.v1.IRedactionConfig|null); + + /** LoggingSettings audioRecordingConfig */ + audioRecordingConfig?: (google.cloud.ces.v1.IAudioRecordingConfig|null); + + /** LoggingSettings bigqueryExportSettings */ + bigqueryExportSettings?: (google.cloud.ces.v1.IBigQueryExportSettings|null); + + /** LoggingSettings cloudLoggingSettings */ + cloudLoggingSettings?: (google.cloud.ces.v1.ICloudLoggingSettings|null); + + /** LoggingSettings conversationLoggingSettings */ + conversationLoggingSettings?: (google.cloud.ces.v1.IConversationLoggingSettings|null); + + /** LoggingSettings evaluationAudioRecordingConfig */ + evaluationAudioRecordingConfig?: (google.cloud.ces.v1.IAudioRecordingConfig|null); + + /** LoggingSettings metricAnalysisSettings */ + metricAnalysisSettings?: (google.cloud.ces.v1.IMetricAnalysisSettings|null); + } + + /** Represents a LoggingSettings. */ + class LoggingSettings implements ILoggingSettings { + + /** + * Constructs a new LoggingSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ILoggingSettings); + + /** LoggingSettings redactionConfig. */ + public redactionConfig?: (google.cloud.ces.v1.IRedactionConfig|null); + + /** LoggingSettings audioRecordingConfig. */ + public audioRecordingConfig?: (google.cloud.ces.v1.IAudioRecordingConfig|null); + + /** LoggingSettings bigqueryExportSettings. */ + public bigqueryExportSettings?: (google.cloud.ces.v1.IBigQueryExportSettings|null); + + /** LoggingSettings cloudLoggingSettings. */ + public cloudLoggingSettings?: (google.cloud.ces.v1.ICloudLoggingSettings|null); + + /** LoggingSettings conversationLoggingSettings. */ + public conversationLoggingSettings?: (google.cloud.ces.v1.IConversationLoggingSettings|null); + + /** LoggingSettings evaluationAudioRecordingConfig. */ + public evaluationAudioRecordingConfig?: (google.cloud.ces.v1.IAudioRecordingConfig|null); + + /** LoggingSettings metricAnalysisSettings. */ + public metricAnalysisSettings?: (google.cloud.ces.v1.IMetricAnalysisSettings|null); + + /** + * Creates a new LoggingSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns LoggingSettings instance + */ + public static create(properties?: google.cloud.ces.v1.ILoggingSettings): google.cloud.ces.v1.LoggingSettings; + + /** + * Encodes the specified LoggingSettings message. Does not implicitly {@link google.cloud.ces.v1.LoggingSettings.verify|verify} messages. + * @param message LoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ILoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.LoggingSettings.verify|verify} messages. + * @param message LoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ILoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.LoggingSettings; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.LoggingSettings; + + /** + * Verifies a LoggingSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LoggingSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoggingSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.LoggingSettings; + + /** + * Creates a plain object from a LoggingSettings message. Also converts values to other types if specified. + * @param message LoggingSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.LoggingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoggingSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoggingSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluationMetricsThresholds. */ + interface IEvaluationMetricsThresholds { + + /** EvaluationMetricsThresholds goldenEvaluationMetricsThresholds */ + goldenEvaluationMetricsThresholds?: (google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null); + + /** EvaluationMetricsThresholds hallucinationMetricBehavior */ + hallucinationMetricBehavior?: (google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|null); + + /** EvaluationMetricsThresholds goldenHallucinationMetricBehavior */ + goldenHallucinationMetricBehavior?: (google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|null); + + /** EvaluationMetricsThresholds scenarioHallucinationMetricBehavior */ + scenarioHallucinationMetricBehavior?: (google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|null); + } + + /** Represents an EvaluationMetricsThresholds. */ + class EvaluationMetricsThresholds implements IEvaluationMetricsThresholds { + + /** + * Constructs a new EvaluationMetricsThresholds. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IEvaluationMetricsThresholds); + + /** EvaluationMetricsThresholds goldenEvaluationMetricsThresholds. */ + public goldenEvaluationMetricsThresholds?: (google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null); + + /** EvaluationMetricsThresholds hallucinationMetricBehavior. */ + public hallucinationMetricBehavior: (google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior); + + /** EvaluationMetricsThresholds goldenHallucinationMetricBehavior. */ + public goldenHallucinationMetricBehavior: (google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior); + + /** EvaluationMetricsThresholds scenarioHallucinationMetricBehavior. */ + public scenarioHallucinationMetricBehavior: (google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior); + + /** + * Creates a new EvaluationMetricsThresholds instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationMetricsThresholds instance + */ + public static create(properties?: google.cloud.ces.v1.IEvaluationMetricsThresholds): google.cloud.ces.v1.EvaluationMetricsThresholds; + + /** + * Encodes the specified EvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.verify|verify} messages. + * @param message EvaluationMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.verify|verify} messages. + * @param message EvaluationMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.EvaluationMetricsThresholds; + + /** + * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.EvaluationMetricsThresholds; + + /** + * Verifies an EvaluationMetricsThresholds message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationMetricsThresholds + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.EvaluationMetricsThresholds; + + /** + * Creates a plain object from an EvaluationMetricsThresholds message. Also converts values to other types if specified. + * @param message EvaluationMetricsThresholds + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.EvaluationMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationMetricsThresholds to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationMetricsThresholds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EvaluationMetricsThresholds { + + /** Properties of a GoldenEvaluationMetricsThresholds. */ + interface IGoldenEvaluationMetricsThresholds { + + /** GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds */ + turnLevelMetricsThresholds?: (google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null); + + /** GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds */ + expectationLevelMetricsThresholds?: (google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null); + + /** GoldenEvaluationMetricsThresholds toolMatchingSettings */ + toolMatchingSettings?: (google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings|null); + } + + /** Represents a GoldenEvaluationMetricsThresholds. */ + class GoldenEvaluationMetricsThresholds implements IGoldenEvaluationMetricsThresholds { + + /** + * Constructs a new GoldenEvaluationMetricsThresholds. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds); + + /** GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds. */ + public turnLevelMetricsThresholds?: (google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null); + + /** GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds. */ + public expectationLevelMetricsThresholds?: (google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null); + + /** GoldenEvaluationMetricsThresholds toolMatchingSettings. */ + public toolMatchingSettings?: (google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings|null); + + /** + * Creates a new GoldenEvaluationMetricsThresholds instance using the specified properties. + * @param [properties] Properties to set + * @returns GoldenEvaluationMetricsThresholds instance + */ + public static create(properties?: google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; + + /** + * Encodes the specified GoldenEvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. + * @param message GoldenEvaluationMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoldenEvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. + * @param message GoldenEvaluationMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoldenEvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; + + /** + * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoldenEvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; + + /** + * Verifies a GoldenEvaluationMetricsThresholds message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoldenEvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoldenEvaluationMetricsThresholds + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; + + /** + * Creates a plain object from a GoldenEvaluationMetricsThresholds message. Also converts values to other types if specified. + * @param message GoldenEvaluationMetricsThresholds + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoldenEvaluationMetricsThresholds to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoldenEvaluationMetricsThresholds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GoldenEvaluationMetricsThresholds { + + /** Properties of a TurnLevelMetricsThresholds. */ + interface ITurnLevelMetricsThresholds { + + /** TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold */ + semanticSimilaritySuccessThreshold?: (number|null); + + /** TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold */ + overallToolInvocationCorrectnessThreshold?: (number|null); + + /** TurnLevelMetricsThresholds semanticSimilarityChannel */ + semanticSimilarityChannel?: (google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|null); + } + + /** Represents a TurnLevelMetricsThresholds. */ + class TurnLevelMetricsThresholds implements ITurnLevelMetricsThresholds { + + /** + * Constructs a new TurnLevelMetricsThresholds. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds); + + /** TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold. */ + public semanticSimilaritySuccessThreshold?: (number|null); + + /** TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold. */ + public overallToolInvocationCorrectnessThreshold?: (number|null); + + /** TurnLevelMetricsThresholds semanticSimilarityChannel. */ + public semanticSimilarityChannel: (google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel); + + /** + * Creates a new TurnLevelMetricsThresholds instance using the specified properties. + * @param [properties] Properties to set + * @returns TurnLevelMetricsThresholds instance + */ + public static create(properties?: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; + + /** + * Encodes the specified TurnLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. + * @param message TurnLevelMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TurnLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. + * @param message TurnLevelMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TurnLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; + + /** + * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TurnLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; + + /** + * Verifies a TurnLevelMetricsThresholds message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TurnLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TurnLevelMetricsThresholds + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; + + /** + * Creates a plain object from a TurnLevelMetricsThresholds message. Also converts values to other types if specified. + * @param message TurnLevelMetricsThresholds + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TurnLevelMetricsThresholds to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TurnLevelMetricsThresholds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TurnLevelMetricsThresholds { + + /** SemanticSimilarityChannel enum. */ + enum SemanticSimilarityChannel { + SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED = 0, + TEXT = 1, + AUDIO = 2 + } + } + + /** Properties of an ExpectationLevelMetricsThresholds. */ + interface IExpectationLevelMetricsThresholds { + + /** ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold */ + toolInvocationParameterCorrectnessThreshold?: (number|null); + } + + /** Represents an ExpectationLevelMetricsThresholds. */ + class ExpectationLevelMetricsThresholds implements IExpectationLevelMetricsThresholds { + + /** + * Constructs a new ExpectationLevelMetricsThresholds. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds); + + /** ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold. */ + public toolInvocationParameterCorrectnessThreshold?: (number|null); + + /** + * Creates a new ExpectationLevelMetricsThresholds instance using the specified properties. + * @param [properties] Properties to set + * @returns ExpectationLevelMetricsThresholds instance + */ + public static create(properties?: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; + + /** + * Encodes the specified ExpectationLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. + * @param message ExpectationLevelMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExpectationLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. + * @param message ExpectationLevelMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExpectationLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; + + /** + * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExpectationLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; + + /** + * Verifies an ExpectationLevelMetricsThresholds message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExpectationLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExpectationLevelMetricsThresholds + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; + + /** + * Creates a plain object from an ExpectationLevelMetricsThresholds message. Also converts values to other types if specified. + * @param message ExpectationLevelMetricsThresholds + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExpectationLevelMetricsThresholds to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExpectationLevelMetricsThresholds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ToolMatchingSettings. */ + interface IToolMatchingSettings { + + /** ToolMatchingSettings extraToolCallBehavior */ + extraToolCallBehavior?: (google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|null); + } + + /** Represents a ToolMatchingSettings. */ + class ToolMatchingSettings implements IToolMatchingSettings { + + /** + * Constructs a new ToolMatchingSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings); + + /** ToolMatchingSettings extraToolCallBehavior. */ + public extraToolCallBehavior: (google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior); + + /** + * Creates a new ToolMatchingSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolMatchingSettings instance + */ + public static create(properties?: google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings): google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings; + + /** + * Encodes the specified ToolMatchingSettings message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. + * @param message ToolMatchingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolMatchingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. + * @param message ToolMatchingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolMatchingSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolMatchingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings; + + /** + * Decodes a ToolMatchingSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolMatchingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings; + + /** + * Verifies a ToolMatchingSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolMatchingSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolMatchingSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings; + + /** + * Creates a plain object from a ToolMatchingSettings message. Also converts values to other types if specified. + * @param message ToolMatchingSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolMatchingSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolMatchingSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ToolMatchingSettings { + + /** ExtraToolCallBehavior enum. */ + enum ExtraToolCallBehavior { + EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED = 0, + FAIL = 1, + ALLOW = 2 + } + } + + /** HallucinationMetricBehavior enum. */ + enum HallucinationMetricBehavior { + HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED = 0, + DISABLED = 1, + ENABLED = 2 + } + } + + /** Properties of a ClientCertificateSettings. */ + interface IClientCertificateSettings { + + /** ClientCertificateSettings tlsCertificate */ + tlsCertificate?: (string|null); + + /** ClientCertificateSettings privateKey */ + privateKey?: (string|null); + + /** ClientCertificateSettings passphrase */ + passphrase?: (string|null); + } + + /** Represents a ClientCertificateSettings. */ + class ClientCertificateSettings implements IClientCertificateSettings { + + /** + * Constructs a new ClientCertificateSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IClientCertificateSettings); + + /** ClientCertificateSettings tlsCertificate. */ + public tlsCertificate: string; + + /** ClientCertificateSettings privateKey. */ + public privateKey: string; + + /** ClientCertificateSettings passphrase. */ + public passphrase: string; + + /** + * Creates a new ClientCertificateSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientCertificateSettings instance + */ + public static create(properties?: google.cloud.ces.v1.IClientCertificateSettings): google.cloud.ces.v1.ClientCertificateSettings; + + /** + * Encodes the specified ClientCertificateSettings message. Does not implicitly {@link google.cloud.ces.v1.ClientCertificateSettings.verify|verify} messages. + * @param message ClientCertificateSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IClientCertificateSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientCertificateSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ClientCertificateSettings.verify|verify} messages. + * @param message ClientCertificateSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IClientCertificateSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientCertificateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ClientCertificateSettings; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientCertificateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ClientCertificateSettings; + + /** + * Verifies a ClientCertificateSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientCertificateSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientCertificateSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ClientCertificateSettings; + + /** + * Creates a plain object from a ClientCertificateSettings message. Also converts values to other types if specified. + * @param message ClientCertificateSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ClientCertificateSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientCertificateSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientCertificateSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConversationLoggingSettings. */ + interface IConversationLoggingSettings { + + /** ConversationLoggingSettings disableConversationLogging */ + disableConversationLogging?: (boolean|null); + } + + /** Represents a ConversationLoggingSettings. */ + class ConversationLoggingSettings implements IConversationLoggingSettings { + + /** + * Constructs a new ConversationLoggingSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IConversationLoggingSettings); + + /** ConversationLoggingSettings disableConversationLogging. */ + public disableConversationLogging: boolean; + + /** + * Creates a new ConversationLoggingSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversationLoggingSettings instance + */ + public static create(properties?: google.cloud.ces.v1.IConversationLoggingSettings): google.cloud.ces.v1.ConversationLoggingSettings; + + /** + * Encodes the specified ConversationLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1.ConversationLoggingSettings.verify|verify} messages. + * @param message ConversationLoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IConversationLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConversationLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ConversationLoggingSettings.verify|verify} messages. + * @param message ConversationLoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IConversationLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConversationLoggingSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversationLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ConversationLoggingSettings; + + /** + * Decodes a ConversationLoggingSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversationLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ConversationLoggingSettings; + + /** + * Verifies a ConversationLoggingSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConversationLoggingSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversationLoggingSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ConversationLoggingSettings; + + /** + * Creates a plain object from a ConversationLoggingSettings message. Also converts values to other types if specified. + * @param message ConversationLoggingSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ConversationLoggingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConversationLoggingSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConversationLoggingSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudLoggingSettings. */ + interface ICloudLoggingSettings { + + /** CloudLoggingSettings enableCloudLogging */ + enableCloudLogging?: (boolean|null); + } + + /** Represents a CloudLoggingSettings. */ + class CloudLoggingSettings implements ICloudLoggingSettings { + + /** + * Constructs a new CloudLoggingSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ICloudLoggingSettings); + + /** CloudLoggingSettings enableCloudLogging. */ + public enableCloudLogging: boolean; + + /** + * Creates a new CloudLoggingSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudLoggingSettings instance + */ + public static create(properties?: google.cloud.ces.v1.ICloudLoggingSettings): google.cloud.ces.v1.CloudLoggingSettings; + + /** + * Encodes the specified CloudLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1.CloudLoggingSettings.verify|verify} messages. + * @param message CloudLoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ICloudLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CloudLoggingSettings.verify|verify} messages. + * @param message CloudLoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ICloudLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudLoggingSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CloudLoggingSettings; + + /** + * Decodes a CloudLoggingSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CloudLoggingSettings; + + /** + * Verifies a CloudLoggingSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudLoggingSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudLoggingSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CloudLoggingSettings; + + /** + * Creates a plain object from a CloudLoggingSettings message. Also converts values to other types if specified. + * @param message CloudLoggingSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.CloudLoggingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudLoggingSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudLoggingSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AudioRecordingConfig. */ + interface IAudioRecordingConfig { + + /** AudioRecordingConfig gcsBucket */ + gcsBucket?: (string|null); + + /** AudioRecordingConfig gcsPathPrefix */ + gcsPathPrefix?: (string|null); + } + + /** Represents an AudioRecordingConfig. */ + class AudioRecordingConfig implements IAudioRecordingConfig { + + /** + * Constructs a new AudioRecordingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IAudioRecordingConfig); + + /** AudioRecordingConfig gcsBucket. */ + public gcsBucket: string; + + /** AudioRecordingConfig gcsPathPrefix. */ + public gcsPathPrefix: string; + + /** + * Creates a new AudioRecordingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AudioRecordingConfig instance + */ + public static create(properties?: google.cloud.ces.v1.IAudioRecordingConfig): google.cloud.ces.v1.AudioRecordingConfig; + + /** + * Encodes the specified AudioRecordingConfig message. Does not implicitly {@link google.cloud.ces.v1.AudioRecordingConfig.verify|verify} messages. + * @param message AudioRecordingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IAudioRecordingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AudioRecordingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AudioRecordingConfig.verify|verify} messages. + * @param message AudioRecordingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IAudioRecordingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AudioRecordingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AudioRecordingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.AudioRecordingConfig; + + /** + * Decodes an AudioRecordingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AudioRecordingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.AudioRecordingConfig; + + /** + * Verifies an AudioRecordingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AudioRecordingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AudioRecordingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.AudioRecordingConfig; + + /** + * Creates a plain object from an AudioRecordingConfig message. Also converts values to other types if specified. + * @param message AudioRecordingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.AudioRecordingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AudioRecordingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AudioRecordingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RedactionConfig. */ + interface IRedactionConfig { + + /** RedactionConfig enableRedaction */ + enableRedaction?: (boolean|null); + + /** RedactionConfig inspectTemplate */ + inspectTemplate?: (string|null); + + /** RedactionConfig deidentifyTemplate */ + deidentifyTemplate?: (string|null); + } + + /** Represents a RedactionConfig. */ + class RedactionConfig implements IRedactionConfig { + + /** + * Constructs a new RedactionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IRedactionConfig); + + /** RedactionConfig enableRedaction. */ + public enableRedaction: boolean; + + /** RedactionConfig inspectTemplate. */ + public inspectTemplate: string; + + /** RedactionConfig deidentifyTemplate. */ + public deidentifyTemplate: string; + + /** + * Creates a new RedactionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RedactionConfig instance + */ + public static create(properties?: google.cloud.ces.v1.IRedactionConfig): google.cloud.ces.v1.RedactionConfig; + + /** + * Encodes the specified RedactionConfig message. Does not implicitly {@link google.cloud.ces.v1.RedactionConfig.verify|verify} messages. + * @param message RedactionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IRedactionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RedactionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RedactionConfig.verify|verify} messages. + * @param message RedactionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IRedactionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RedactionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RedactionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RedactionConfig; + + /** + * Decodes a RedactionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RedactionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RedactionConfig; + + /** + * Verifies a RedactionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RedactionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RedactionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RedactionConfig; + + /** + * Creates a plain object from a RedactionConfig message. Also converts values to other types if specified. + * @param message RedactionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.RedactionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RedactionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RedactionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataStoreSettings. */ + interface IDataStoreSettings { + + /** DataStoreSettings engines */ + engines?: (google.cloud.ces.v1.DataStoreSettings.IEngine[]|null); + } + + /** Represents a DataStoreSettings. */ + class DataStoreSettings implements IDataStoreSettings { + + /** + * Constructs a new DataStoreSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IDataStoreSettings); + + /** DataStoreSettings engines. */ + public engines: google.cloud.ces.v1.DataStoreSettings.IEngine[]; + + /** + * Creates a new DataStoreSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStoreSettings instance + */ + public static create(properties?: google.cloud.ces.v1.IDataStoreSettings): google.cloud.ces.v1.DataStoreSettings; + + /** + * Encodes the specified DataStoreSettings message. Does not implicitly {@link google.cloud.ces.v1.DataStoreSettings.verify|verify} messages. + * @param message DataStoreSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IDataStoreSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStoreSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreSettings.verify|verify} messages. + * @param message DataStoreSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IDataStoreSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStoreSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStoreSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreSettings; + + /** + * Decodes a DataStoreSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStoreSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreSettings; + + /** + * Verifies a DataStoreSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataStoreSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStoreSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreSettings; + + /** + * Creates a plain object from a DataStoreSettings message. Also converts values to other types if specified. + * @param message DataStoreSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DataStoreSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStoreSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStoreSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataStoreSettings { + + /** Properties of an Engine. */ + interface IEngine { + + /** Engine name */ + name?: (string|null); + + /** Engine type */ + type?: (google.cloud.ces.v1.DataStoreSettings.Engine.Type|keyof typeof google.cloud.ces.v1.DataStoreSettings.Engine.Type|null); + } + + /** Represents an Engine. */ + class Engine implements IEngine { + + /** + * Constructs a new Engine. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.DataStoreSettings.IEngine); + + /** Engine name. */ + public name: string; + + /** Engine type. */ + public type: (google.cloud.ces.v1.DataStoreSettings.Engine.Type|keyof typeof google.cloud.ces.v1.DataStoreSettings.Engine.Type); + + /** + * Creates a new Engine instance using the specified properties. + * @param [properties] Properties to set + * @returns Engine instance + */ + public static create(properties?: google.cloud.ces.v1.DataStoreSettings.IEngine): google.cloud.ces.v1.DataStoreSettings.Engine; + + /** + * Encodes the specified Engine message. Does not implicitly {@link google.cloud.ces.v1.DataStoreSettings.Engine.verify|verify} messages. + * @param message Engine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.DataStoreSettings.IEngine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Engine message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreSettings.Engine.verify|verify} messages. + * @param message Engine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.DataStoreSettings.IEngine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Engine message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Engine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreSettings.Engine; + + /** + * Decodes an Engine message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Engine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreSettings.Engine; + + /** + * Verifies an Engine message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Engine message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Engine + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreSettings.Engine; + + /** + * Creates a plain object from an Engine message. Also converts values to other types if specified. + * @param message Engine + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DataStoreSettings.Engine, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Engine to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Engine + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Engine { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + ENGINE_TYPE_SEARCH = 1, + ENGINE_TYPE_CHAT = 2 + } + } + } + + /** Properties of a BigQueryExportSettings. */ + interface IBigQueryExportSettings { + + /** BigQueryExportSettings enabled */ + enabled?: (boolean|null); + + /** BigQueryExportSettings project */ + project?: (string|null); + + /** BigQueryExportSettings dataset */ + dataset?: (string|null); + } + + /** Represents a BigQueryExportSettings. */ + class BigQueryExportSettings implements IBigQueryExportSettings { + + /** + * Constructs a new BigQueryExportSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IBigQueryExportSettings); + + /** BigQueryExportSettings enabled. */ + public enabled: boolean; + + /** BigQueryExportSettings project. */ + public project: string; + + /** BigQueryExportSettings dataset. */ + public dataset: string; + + /** + * Creates a new BigQueryExportSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryExportSettings instance + */ + public static create(properties?: google.cloud.ces.v1.IBigQueryExportSettings): google.cloud.ces.v1.BigQueryExportSettings; + + /** + * Encodes the specified BigQueryExportSettings message. Does not implicitly {@link google.cloud.ces.v1.BigQueryExportSettings.verify|verify} messages. + * @param message BigQueryExportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IBigQueryExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryExportSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BigQueryExportSettings.verify|verify} messages. + * @param message BigQueryExportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IBigQueryExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryExportSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.BigQueryExportSettings; + + /** + * Decodes a BigQueryExportSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.BigQueryExportSettings; + + /** + * Verifies a BigQueryExportSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQueryExportSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryExportSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.BigQueryExportSettings; + + /** + * Creates a plain object from a BigQueryExportSettings message. Also converts values to other types if specified. + * @param message BigQueryExportSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.BigQueryExportSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryExportSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryExportSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Schema. */ + interface ISchema { + + /** Schema type */ + type?: (google.cloud.ces.v1.Schema.Type|keyof typeof google.cloud.ces.v1.Schema.Type|null); + + /** Schema properties */ + properties?: ({ [k: string]: google.cloud.ces.v1.ISchema }|null); + + /** Schema required */ + required?: (string[]|null); + + /** Schema description */ + description?: (string|null); + + /** Schema items */ + items?: (google.cloud.ces.v1.ISchema|null); + + /** Schema nullable */ + nullable?: (boolean|null); + + /** Schema uniqueItems */ + uniqueItems?: (boolean|null); + + /** Schema prefixItems */ + prefixItems?: (google.cloud.ces.v1.ISchema[]|null); + + /** Schema additionalProperties */ + additionalProperties?: (google.cloud.ces.v1.ISchema|null); + + /** Schema anyOf */ + anyOf?: (google.cloud.ces.v1.ISchema[]|null); + + /** Schema enum */ + "enum"?: (string[]|null); + + /** Schema default */ + "default"?: (google.protobuf.IValue|null); + + /** Schema ref */ + ref?: (string|null); + + /** Schema defs */ + defs?: ({ [k: string]: google.cloud.ces.v1.ISchema }|null); + + /** Schema title */ + title?: (string|null); + + /** Schema minItems */ + minItems?: (number|Long|string|null); + + /** Schema maxItems */ + maxItems?: (number|Long|string|null); + + /** Schema minimum */ + minimum?: (number|null); + + /** Schema maximum */ + maximum?: (number|null); + } + + /** Represents a Schema. */ + class Schema implements ISchema { + + /** + * Constructs a new Schema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ISchema); + + /** Schema type. */ + public type: (google.cloud.ces.v1.Schema.Type|keyof typeof google.cloud.ces.v1.Schema.Type); + + /** Schema properties. */ + public properties: { [k: string]: google.cloud.ces.v1.ISchema }; + + /** Schema required. */ + public required: string[]; + + /** Schema description. */ + public description: string; + + /** Schema items. */ + public items?: (google.cloud.ces.v1.ISchema|null); + + /** Schema nullable. */ + public nullable: boolean; + + /** Schema uniqueItems. */ + public uniqueItems: boolean; + + /** Schema prefixItems. */ + public prefixItems: google.cloud.ces.v1.ISchema[]; + + /** Schema additionalProperties. */ + public additionalProperties?: (google.cloud.ces.v1.ISchema|null); + + /** Schema anyOf. */ + public anyOf: google.cloud.ces.v1.ISchema[]; + + /** Schema enum. */ + public enum: string[]; + + /** Schema default. */ + public default?: (google.protobuf.IValue|null); + + /** Schema ref. */ + public ref: string; + + /** Schema defs. */ + public defs: { [k: string]: google.cloud.ces.v1.ISchema }; + + /** Schema title. */ + public title: string; + + /** Schema minItems. */ + public minItems: (number|Long|string); + + /** Schema maxItems. */ + public maxItems: (number|Long|string); + + /** Schema minimum. */ + public minimum?: (number|null); + + /** Schema maximum. */ + public maximum?: (number|null); + + /** + * Creates a new Schema instance using the specified properties. + * @param [properties] Properties to set + * @returns Schema instance + */ + public static create(properties?: google.cloud.ces.v1.ISchema): google.cloud.ces.v1.Schema; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.cloud.ces.v1.Schema.verify|verify} messages. + * @param message Schema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Schema.verify|verify} messages. + * @param message Schema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Schema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Schema; + + /** + * Decodes a Schema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Schema; + + /** + * Verifies a Schema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Schema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Schema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Schema; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @param message Schema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Schema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Schema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Schema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Schema { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + STRING = 1, + INTEGER = 2, + NUMBER = 3, + BOOLEAN = 4, + OBJECT = 5, + ARRAY = 6 + } + } + + /** Properties of an AppSnapshot. */ + interface IAppSnapshot { + + /** AppSnapshot app */ + app?: (google.cloud.ces.v1.IApp|null); + + /** AppSnapshot agents */ + agents?: (google.cloud.ces.v1.IAgent[]|null); + + /** AppSnapshot tools */ + tools?: (google.cloud.ces.v1.ITool[]|null); + + /** AppSnapshot examples */ + examples?: (google.cloud.ces.v1.IExample[]|null); + + /** AppSnapshot guardrails */ + guardrails?: (google.cloud.ces.v1.IGuardrail[]|null); + + /** AppSnapshot toolsets */ + toolsets?: (google.cloud.ces.v1.IToolset[]|null); + } + + /** Represents an AppSnapshot. */ + class AppSnapshot implements IAppSnapshot { + + /** + * Constructs a new AppSnapshot. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IAppSnapshot); + + /** AppSnapshot app. */ + public app?: (google.cloud.ces.v1.IApp|null); + + /** AppSnapshot agents. */ + public agents: google.cloud.ces.v1.IAgent[]; + + /** AppSnapshot tools. */ + public tools: google.cloud.ces.v1.ITool[]; + + /** AppSnapshot examples. */ + public examples: google.cloud.ces.v1.IExample[]; + + /** AppSnapshot guardrails. */ + public guardrails: google.cloud.ces.v1.IGuardrail[]; + + /** AppSnapshot toolsets. */ + public toolsets: google.cloud.ces.v1.IToolset[]; + + /** + * Creates a new AppSnapshot instance using the specified properties. + * @param [properties] Properties to set + * @returns AppSnapshot instance + */ + public static create(properties?: google.cloud.ces.v1.IAppSnapshot): google.cloud.ces.v1.AppSnapshot; + + /** + * Encodes the specified AppSnapshot message. Does not implicitly {@link google.cloud.ces.v1.AppSnapshot.verify|verify} messages. + * @param message AppSnapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IAppSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppSnapshot message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AppSnapshot.verify|verify} messages. + * @param message AppSnapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IAppSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppSnapshot message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.AppSnapshot; + + /** + * Decodes an AppSnapshot message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.AppSnapshot; + + /** + * Verifies an AppSnapshot message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AppSnapshot message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppSnapshot + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.AppSnapshot; + + /** + * Creates a plain object from an AppSnapshot message. Also converts values to other types if specified. + * @param message AppSnapshot + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.AppSnapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppSnapshot to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppSnapshot + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AppVersion. */ + interface IAppVersion { + + /** AppVersion name */ + name?: (string|null); + + /** AppVersion displayName */ + displayName?: (string|null); + + /** AppVersion description */ + description?: (string|null); + + /** AppVersion creator */ + creator?: (string|null); + + /** AppVersion createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** AppVersion snapshot */ + snapshot?: (google.cloud.ces.v1.IAppSnapshot|null); + + /** AppVersion etag */ + etag?: (string|null); + } + + /** Represents an AppVersion. */ + class AppVersion implements IAppVersion { + + /** + * Constructs a new AppVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IAppVersion); + + /** AppVersion name. */ + public name: string; + + /** AppVersion displayName. */ + public displayName: string; + + /** AppVersion description. */ + public description: string; + + /** AppVersion creator. */ + public creator: string; + + /** AppVersion createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** AppVersion snapshot. */ + public snapshot?: (google.cloud.ces.v1.IAppSnapshot|null); + + /** AppVersion etag. */ + public etag: string; + + /** + * Creates a new AppVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns AppVersion instance + */ + public static create(properties?: google.cloud.ces.v1.IAppVersion): google.cloud.ces.v1.AppVersion; + + /** + * Encodes the specified AppVersion message. Does not implicitly {@link google.cloud.ces.v1.AppVersion.verify|verify} messages. + * @param message AppVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppVersion message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AppVersion.verify|verify} messages. + * @param message AppVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.AppVersion; + + /** + * Decodes an AppVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.AppVersion; + + /** + * Verifies an AppVersion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AppVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.AppVersion; + + /** + * Creates a plain object from an AppVersion message. Also converts values to other types if specified. + * @param message AppVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.AppVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Example. */ + interface IExample { + + /** Example name */ + name?: (string|null); + + /** Example displayName */ + displayName?: (string|null); + + /** Example description */ + description?: (string|null); + + /** Example entryAgent */ + entryAgent?: (string|null); + + /** Example messages */ + messages?: (google.cloud.ces.v1.IMessage[]|null); + + /** Example createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Example updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Example invalid */ + invalid?: (boolean|null); + + /** Example etag */ + etag?: (string|null); + } + + /** Represents an Example. */ + class Example implements IExample { + + /** + * Constructs a new Example. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IExample); + + /** Example name. */ + public name: string; + + /** Example displayName. */ + public displayName: string; + + /** Example description. */ + public description: string; + + /** Example entryAgent. */ + public entryAgent: string; + + /** Example messages. */ + public messages: google.cloud.ces.v1.IMessage[]; + + /** Example createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Example updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Example invalid. */ + public invalid: boolean; + + /** Example etag. */ + public etag: string; + + /** + * Creates a new Example instance using the specified properties. + * @param [properties] Properties to set + * @returns Example instance + */ + public static create(properties?: google.cloud.ces.v1.IExample): google.cloud.ces.v1.Example; + + /** + * Encodes the specified Example message. Does not implicitly {@link google.cloud.ces.v1.Example.verify|verify} messages. + * @param message Example message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Example message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Example.verify|verify} messages. + * @param message Example message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Example message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Example; + + /** + * Decodes an Example message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Example; + + /** + * Verifies an Example message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Example message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Example + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Example; + + /** + * Creates a plain object from an Example message. Also converts values to other types if specified. + * @param message Example + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Example, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Example to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Example + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Message. */ + interface IMessage { + + /** Message role */ + role?: (string|null); + + /** Message chunks */ + chunks?: (google.cloud.ces.v1.IChunk[]|null); + + /** Message eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Message. */ + class Message implements IMessage { + + /** + * Constructs a new Message. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IMessage); + + /** Message role. */ + public role: string; + + /** Message chunks. */ + public chunks: google.cloud.ces.v1.IChunk[]; + + /** Message eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Message instance using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public static create(properties?: google.cloud.ces.v1.IMessage): google.cloud.ces.v1.Message; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.ces.v1.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Message message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Message; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Message; + + /** + * Verifies a Message message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Message + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Message; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @param message Message + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Message to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Message + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Chunk. */ + interface IChunk { + + /** Chunk text */ + text?: (string|null); + + /** Chunk transcript */ + transcript?: (string|null); + + /** Chunk payload */ + payload?: (google.protobuf.IStruct|null); + + /** Chunk image */ + image?: (google.cloud.ces.v1.IImage|null); + + /** Chunk toolCall */ + toolCall?: (google.cloud.ces.v1.IToolCall|null); + + /** Chunk toolResponse */ + toolResponse?: (google.cloud.ces.v1.IToolResponse|null); + + /** Chunk agentTransfer */ + agentTransfer?: (google.cloud.ces.v1.IAgentTransfer|null); + + /** Chunk updatedVariables */ + updatedVariables?: (google.protobuf.IStruct|null); + + /** Chunk defaultVariables */ + defaultVariables?: (google.protobuf.IStruct|null); + } + + /** Represents a Chunk. */ + class Chunk implements IChunk { + + /** + * Constructs a new Chunk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IChunk); + + /** Chunk text. */ + public text?: (string|null); + + /** Chunk transcript. */ + public transcript?: (string|null); + + /** Chunk payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** Chunk image. */ + public image?: (google.cloud.ces.v1.IImage|null); + + /** Chunk toolCall. */ + public toolCall?: (google.cloud.ces.v1.IToolCall|null); + + /** Chunk toolResponse. */ + public toolResponse?: (google.cloud.ces.v1.IToolResponse|null); + + /** Chunk agentTransfer. */ + public agentTransfer?: (google.cloud.ces.v1.IAgentTransfer|null); + + /** Chunk updatedVariables. */ + public updatedVariables?: (google.protobuf.IStruct|null); + + /** Chunk defaultVariables. */ + public defaultVariables?: (google.protobuf.IStruct|null); + + /** Chunk data. */ + public data?: ("text"|"transcript"|"payload"|"image"|"toolCall"|"toolResponse"|"agentTransfer"|"updatedVariables"|"defaultVariables"); + + /** + * Creates a new Chunk instance using the specified properties. + * @param [properties] Properties to set + * @returns Chunk instance + */ + public static create(properties?: google.cloud.ces.v1.IChunk): google.cloud.ces.v1.Chunk; + + /** + * Encodes the specified Chunk message. Does not implicitly {@link google.cloud.ces.v1.Chunk.verify|verify} messages. + * @param message Chunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Chunk.verify|verify} messages. + * @param message Chunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Chunk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Chunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Chunk; + + /** + * Decodes a Chunk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Chunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Chunk; + + /** + * Verifies a Chunk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Chunk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Chunk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Chunk; + + /** + * Creates a plain object from a Chunk message. Also converts values to other types if specified. + * @param message Chunk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Chunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Chunk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Chunk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Blob. */ + interface IBlob { + + /** Blob mimeType */ + mimeType?: (string|null); + + /** Blob data */ + data?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Blob. */ + class Blob implements IBlob { + + /** + * Constructs a new Blob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IBlob); + + /** Blob mimeType. */ + public mimeType: string; + + /** Blob data. */ + public data: (Uint8Array|Buffer|string); + + /** + * Creates a new Blob instance using the specified properties. + * @param [properties] Properties to set + * @returns Blob instance + */ + public static create(properties?: google.cloud.ces.v1.IBlob): google.cloud.ces.v1.Blob; + + /** + * Encodes the specified Blob message. Does not implicitly {@link google.cloud.ces.v1.Blob.verify|verify} messages. + * @param message Blob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IBlob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Blob.verify|verify} messages. + * @param message Blob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IBlob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Blob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Blob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Blob; + + /** + * Decodes a Blob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Blob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Blob; + + /** + * Verifies a Blob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Blob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Blob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Blob; + + /** + * Creates a plain object from a Blob message. Also converts values to other types if specified. + * @param message Blob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Blob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Blob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Blob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image mimeType */ + mimeType?: (string|null); + + /** Image data */ + data?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IImage); + + /** Image mimeType. */ + public mimeType: string; + + /** Image data. */ + public data: (Uint8Array|Buffer|string); + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.ces.v1.IImage): google.cloud.ces.v1.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.ces.v1.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Image message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Image; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Image; + + /** + * Verifies an Image message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Image + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Image; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @param message Image + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Image + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolCall. */ + interface IToolCall { + + /** ToolCall tool */ + tool?: (string|null); + + /** ToolCall toolsetTool */ + toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); + + /** ToolCall id */ + id?: (string|null); + + /** ToolCall displayName */ + displayName?: (string|null); + + /** ToolCall args */ + args?: (google.protobuf.IStruct|null); + } + + /** Represents a ToolCall. */ + class ToolCall implements IToolCall { + + /** + * Constructs a new ToolCall. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IToolCall); + + /** ToolCall tool. */ + public tool?: (string|null); + + /** ToolCall toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); + + /** ToolCall id. */ + public id: string; + + /** ToolCall displayName. */ + public displayName: string; + + /** ToolCall args. */ + public args?: (google.protobuf.IStruct|null); + + /** ToolCall toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new ToolCall instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolCall instance + */ + public static create(properties?: google.cloud.ces.v1.IToolCall): google.cloud.ces.v1.ToolCall; + + /** + * Encodes the specified ToolCall message. Does not implicitly {@link google.cloud.ces.v1.ToolCall.verify|verify} messages. + * @param message ToolCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IToolCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolCall message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolCall.verify|verify} messages. + * @param message ToolCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IToolCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolCall message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ToolCall; + + /** + * Decodes a ToolCall message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ToolCall; + + /** + * Verifies a ToolCall message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolCall message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolCall + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ToolCall; + + /** + * Creates a plain object from a ToolCall message. Also converts values to other types if specified. + * @param message ToolCall + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ToolCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolCall to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolCall + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolResponse. */ + interface IToolResponse { + + /** ToolResponse tool */ + tool?: (string|null); + + /** ToolResponse toolsetTool */ + toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); + + /** ToolResponse id */ + id?: (string|null); + + /** ToolResponse displayName */ + displayName?: (string|null); + + /** ToolResponse response */ + response?: (google.protobuf.IStruct|null); + } + + /** Represents a ToolResponse. */ + class ToolResponse implements IToolResponse { + + /** + * Constructs a new ToolResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IToolResponse); + + /** ToolResponse tool. */ + public tool?: (string|null); + + /** ToolResponse toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); + + /** ToolResponse id. */ + public id: string; + + /** ToolResponse displayName. */ + public displayName: string; + + /** ToolResponse response. */ + public response?: (google.protobuf.IStruct|null); + + /** ToolResponse toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new ToolResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IToolResponse): google.cloud.ces.v1.ToolResponse; + + /** + * Encodes the specified ToolResponse message. Does not implicitly {@link google.cloud.ces.v1.ToolResponse.verify|verify} messages. + * @param message ToolResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolResponse.verify|verify} messages. + * @param message ToolResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ToolResponse; + + /** + * Decodes a ToolResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ToolResponse; + + /** + * Verifies a ToolResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ToolResponse; + + /** + * Creates a plain object from a ToolResponse message. Also converts values to other types if specified. + * @param message ToolResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ToolResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AgentTransfer. */ + interface IAgentTransfer { + + /** AgentTransfer targetAgent */ + targetAgent?: (string|null); + + /** AgentTransfer displayName */ + displayName?: (string|null); + } + + /** Represents an AgentTransfer. */ + class AgentTransfer implements IAgentTransfer { + + /** + * Constructs a new AgentTransfer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IAgentTransfer); + + /** AgentTransfer targetAgent. */ + public targetAgent: string; + + /** AgentTransfer displayName. */ + public displayName: string; + + /** + * Creates a new AgentTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns AgentTransfer instance + */ + public static create(properties?: google.cloud.ces.v1.IAgentTransfer): google.cloud.ces.v1.AgentTransfer; + + /** + * Encodes the specified AgentTransfer message. Does not implicitly {@link google.cloud.ces.v1.AgentTransfer.verify|verify} messages. + * @param message AgentTransfer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IAgentTransfer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AgentTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AgentTransfer.verify|verify} messages. + * @param message AgentTransfer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IAgentTransfer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AgentTransfer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AgentTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.AgentTransfer; + + /** + * Decodes an AgentTransfer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AgentTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.AgentTransfer; + + /** + * Verifies an AgentTransfer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AgentTransfer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AgentTransfer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.AgentTransfer; + + /** + * Creates a plain object from an AgentTransfer message. Also converts values to other types if specified. + * @param message AgentTransfer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.AgentTransfer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AgentTransfer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AgentTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolsetTool. */ + interface IToolsetTool { + + /** ToolsetTool toolset */ + toolset?: (string|null); + + /** ToolsetTool toolId */ + toolId?: (string|null); + } + + /** Represents a ToolsetTool. */ + class ToolsetTool implements IToolsetTool { + + /** + * Constructs a new ToolsetTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IToolsetTool); + + /** ToolsetTool toolset. */ + public toolset: string; + + /** ToolsetTool toolId. */ + public toolId: string; + + /** + * Creates a new ToolsetTool instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolsetTool instance + */ + public static create(properties?: google.cloud.ces.v1.IToolsetTool): google.cloud.ces.v1.ToolsetTool; + + /** + * Encodes the specified ToolsetTool message. Does not implicitly {@link google.cloud.ces.v1.ToolsetTool.verify|verify} messages. + * @param message ToolsetTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IToolsetTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolsetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolsetTool.verify|verify} messages. + * @param message ToolsetTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IToolsetTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolsetTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolsetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ToolsetTool; + + /** + * Decodes a ToolsetTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolsetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ToolsetTool; + + /** + * Verifies a ToolsetTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolsetTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolsetTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ToolsetTool; + + /** + * Creates a plain object from a ToolsetTool message. Also converts values to other types if specified. + * @param message ToolsetTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ToolsetTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolsetTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolsetTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Guardrail. */ + interface IGuardrail { + + /** Guardrail contentFilter */ + contentFilter?: (google.cloud.ces.v1.Guardrail.IContentFilter|null); + + /** Guardrail llmPromptSecurity */ + llmPromptSecurity?: (google.cloud.ces.v1.Guardrail.ILlmPromptSecurity|null); + + /** Guardrail llmPolicy */ + llmPolicy?: (google.cloud.ces.v1.Guardrail.ILlmPolicy|null); + + /** Guardrail modelSafety */ + modelSafety?: (google.cloud.ces.v1.Guardrail.IModelSafety|null); + + /** Guardrail codeCallback */ + codeCallback?: (google.cloud.ces.v1.Guardrail.ICodeCallback|null); + + /** Guardrail name */ + name?: (string|null); + + /** Guardrail displayName */ + displayName?: (string|null); + + /** Guardrail description */ + description?: (string|null); + + /** Guardrail enabled */ + enabled?: (boolean|null); + + /** Guardrail action */ + action?: (google.cloud.ces.v1.ITriggerAction|null); + + /** Guardrail createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Guardrail updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Guardrail etag */ + etag?: (string|null); + } + + /** Represents a Guardrail. */ + class Guardrail implements IGuardrail { + + /** + * Constructs a new Guardrail. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IGuardrail); + + /** Guardrail contentFilter. */ + public contentFilter?: (google.cloud.ces.v1.Guardrail.IContentFilter|null); + + /** Guardrail llmPromptSecurity. */ + public llmPromptSecurity?: (google.cloud.ces.v1.Guardrail.ILlmPromptSecurity|null); + + /** Guardrail llmPolicy. */ + public llmPolicy?: (google.cloud.ces.v1.Guardrail.ILlmPolicy|null); + + /** Guardrail modelSafety. */ + public modelSafety?: (google.cloud.ces.v1.Guardrail.IModelSafety|null); + + /** Guardrail codeCallback. */ + public codeCallback?: (google.cloud.ces.v1.Guardrail.ICodeCallback|null); + + /** Guardrail name. */ + public name: string; + + /** Guardrail displayName. */ + public displayName: string; + + /** Guardrail description. */ + public description: string; + + /** Guardrail enabled. */ + public enabled: boolean; + + /** Guardrail action. */ + public action?: (google.cloud.ces.v1.ITriggerAction|null); + + /** Guardrail createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Guardrail updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Guardrail etag. */ + public etag: string; + + /** Guardrail guardrailType. */ + public guardrailType?: ("contentFilter"|"llmPromptSecurity"|"llmPolicy"|"modelSafety"|"codeCallback"); + + /** + * Creates a new Guardrail instance using the specified properties. + * @param [properties] Properties to set + * @returns Guardrail instance + */ + public static create(properties?: google.cloud.ces.v1.IGuardrail): google.cloud.ces.v1.Guardrail; + + /** + * Encodes the specified Guardrail message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.verify|verify} messages. + * @param message Guardrail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IGuardrail, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Guardrail message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.verify|verify} messages. + * @param message Guardrail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IGuardrail, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Guardrail message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Guardrail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Guardrail; + + /** + * Decodes a Guardrail message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Guardrail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Guardrail; + + /** + * Verifies a Guardrail message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Guardrail message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Guardrail + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Guardrail; + + /** + * Creates a plain object from a Guardrail message. Also converts values to other types if specified. + * @param message Guardrail + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Guardrail, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Guardrail to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Guardrail + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Guardrail { + + /** Properties of a ContentFilter. */ + interface IContentFilter { + + /** ContentFilter bannedContents */ + bannedContents?: (string[]|null); + + /** ContentFilter bannedContentsInUserInput */ + bannedContentsInUserInput?: (string[]|null); + + /** ContentFilter bannedContentsInAgentResponse */ + bannedContentsInAgentResponse?: (string[]|null); + + /** ContentFilter matchType */ + matchType?: (google.cloud.ces.v1.Guardrail.ContentFilter.MatchType|keyof typeof google.cloud.ces.v1.Guardrail.ContentFilter.MatchType|null); + + /** ContentFilter disregardDiacritics */ + disregardDiacritics?: (boolean|null); + } + + /** Represents a ContentFilter. */ + class ContentFilter implements IContentFilter { + + /** + * Constructs a new ContentFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.Guardrail.IContentFilter); + + /** ContentFilter bannedContents. */ + public bannedContents: string[]; + + /** ContentFilter bannedContentsInUserInput. */ + public bannedContentsInUserInput: string[]; + + /** ContentFilter bannedContentsInAgentResponse. */ + public bannedContentsInAgentResponse: string[]; + + /** ContentFilter matchType. */ + public matchType: (google.cloud.ces.v1.Guardrail.ContentFilter.MatchType|keyof typeof google.cloud.ces.v1.Guardrail.ContentFilter.MatchType); + + /** ContentFilter disregardDiacritics. */ + public disregardDiacritics: boolean; + + /** + * Creates a new ContentFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns ContentFilter instance + */ + public static create(properties?: google.cloud.ces.v1.Guardrail.IContentFilter): google.cloud.ces.v1.Guardrail.ContentFilter; + + /** + * Encodes the specified ContentFilter message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ContentFilter.verify|verify} messages. + * @param message ContentFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.Guardrail.IContentFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ContentFilter.verify|verify} messages. + * @param message ContentFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.Guardrail.IContentFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContentFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Guardrail.ContentFilter; + + /** + * Decodes a ContentFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Guardrail.ContentFilter; + + /** + * Verifies a ContentFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContentFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Guardrail.ContentFilter; + + /** + * Creates a plain object from a ContentFilter message. Also converts values to other types if specified. + * @param message ContentFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Guardrail.ContentFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContentFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContentFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ContentFilter { + + /** MatchType enum. */ + enum MatchType { + MATCH_TYPE_UNSPECIFIED = 0, + SIMPLE_STRING_MATCH = 1, + WORD_BOUNDARY_STRING_MATCH = 2, + REGEXP_MATCH = 3 + } + } + + /** Properties of a LlmPromptSecurity. */ + interface ILlmPromptSecurity { + + /** LlmPromptSecurity defaultSettings */ + defaultSettings?: (google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null); + + /** LlmPromptSecurity customPolicy */ + customPolicy?: (google.cloud.ces.v1.Guardrail.ILlmPolicy|null); + + /** LlmPromptSecurity failOpen */ + failOpen?: (boolean|null); + } + + /** Represents a LlmPromptSecurity. */ + class LlmPromptSecurity implements ILlmPromptSecurity { + + /** + * Constructs a new LlmPromptSecurity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.Guardrail.ILlmPromptSecurity); + + /** LlmPromptSecurity defaultSettings. */ + public defaultSettings?: (google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null); + + /** LlmPromptSecurity customPolicy. */ + public customPolicy?: (google.cloud.ces.v1.Guardrail.ILlmPolicy|null); + + /** LlmPromptSecurity failOpen. */ + public failOpen: boolean; + + /** LlmPromptSecurity securityConfig. */ + public securityConfig?: ("defaultSettings"|"customPolicy"); + + /** + * Creates a new LlmPromptSecurity instance using the specified properties. + * @param [properties] Properties to set + * @returns LlmPromptSecurity instance + */ + public static create(properties?: google.cloud.ces.v1.Guardrail.ILlmPromptSecurity): google.cloud.ces.v1.Guardrail.LlmPromptSecurity; + + /** + * Encodes the specified LlmPromptSecurity message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPromptSecurity.verify|verify} messages. + * @param message LlmPromptSecurity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.Guardrail.ILlmPromptSecurity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LlmPromptSecurity message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPromptSecurity.verify|verify} messages. + * @param message LlmPromptSecurity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.Guardrail.ILlmPromptSecurity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LlmPromptSecurity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LlmPromptSecurity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Guardrail.LlmPromptSecurity; + + /** + * Decodes a LlmPromptSecurity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LlmPromptSecurity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Guardrail.LlmPromptSecurity; + + /** + * Verifies a LlmPromptSecurity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LlmPromptSecurity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LlmPromptSecurity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Guardrail.LlmPromptSecurity; + + /** + * Creates a plain object from a LlmPromptSecurity message. Also converts values to other types if specified. + * @param message LlmPromptSecurity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Guardrail.LlmPromptSecurity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LlmPromptSecurity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LlmPromptSecurity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LlmPromptSecurity { + + /** Properties of a DefaultSecuritySettings. */ + interface IDefaultSecuritySettings { + + /** DefaultSecuritySettings defaultPromptTemplate */ + defaultPromptTemplate?: (string|null); + } + + /** Represents a DefaultSecuritySettings. */ + class DefaultSecuritySettings implements IDefaultSecuritySettings { + + /** + * Constructs a new DefaultSecuritySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings); + + /** DefaultSecuritySettings defaultPromptTemplate. */ + public defaultPromptTemplate: string; + + /** + * Creates a new DefaultSecuritySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DefaultSecuritySettings instance + */ + public static create(properties?: google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings): google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; + + /** + * Encodes the specified DefaultSecuritySettings message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. + * @param message DefaultSecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DefaultSecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. + * @param message DefaultSecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DefaultSecuritySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DefaultSecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; + + /** + * Decodes a DefaultSecuritySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DefaultSecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; + + /** + * Verifies a DefaultSecuritySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DefaultSecuritySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DefaultSecuritySettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; + + /** + * Creates a plain object from a DefaultSecuritySettings message. Also converts values to other types if specified. + * @param message DefaultSecuritySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DefaultSecuritySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DefaultSecuritySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a LlmPolicy. */ + interface ILlmPolicy { + + /** LlmPolicy maxConversationMessages */ + maxConversationMessages?: (number|null); + + /** LlmPolicy modelSettings */ + modelSettings?: (google.cloud.ces.v1.IModelSettings|null); + + /** LlmPolicy prompt */ + prompt?: (string|null); + + /** LlmPolicy policyScope */ + policyScope?: (google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope|keyof typeof google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope|null); + + /** LlmPolicy failOpen */ + failOpen?: (boolean|null); + + /** LlmPolicy allowShortUtterance */ + allowShortUtterance?: (boolean|null); + } + + /** Represents a LlmPolicy. */ + class LlmPolicy implements ILlmPolicy { + + /** + * Constructs a new LlmPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.Guardrail.ILlmPolicy); + + /** LlmPolicy maxConversationMessages. */ + public maxConversationMessages: number; + + /** LlmPolicy modelSettings. */ + public modelSettings?: (google.cloud.ces.v1.IModelSettings|null); + + /** LlmPolicy prompt. */ + public prompt: string; + + /** LlmPolicy policyScope. */ + public policyScope: (google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope|keyof typeof google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope); + + /** LlmPolicy failOpen. */ + public failOpen: boolean; + + /** LlmPolicy allowShortUtterance. */ + public allowShortUtterance: boolean; + + /** + * Creates a new LlmPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns LlmPolicy instance + */ + public static create(properties?: google.cloud.ces.v1.Guardrail.ILlmPolicy): google.cloud.ces.v1.Guardrail.LlmPolicy; + + /** + * Encodes the specified LlmPolicy message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPolicy.verify|verify} messages. + * @param message LlmPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.Guardrail.ILlmPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LlmPolicy message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPolicy.verify|verify} messages. + * @param message LlmPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.Guardrail.ILlmPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LlmPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LlmPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Guardrail.LlmPolicy; + + /** + * Decodes a LlmPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LlmPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Guardrail.LlmPolicy; + + /** + * Verifies a LlmPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LlmPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LlmPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Guardrail.LlmPolicy; + + /** + * Creates a plain object from a LlmPolicy message. Also converts values to other types if specified. + * @param message LlmPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Guardrail.LlmPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LlmPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LlmPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LlmPolicy { + + /** PolicyScope enum. */ + enum PolicyScope { + POLICY_SCOPE_UNSPECIFIED = 0, + USER_QUERY = 1, + AGENT_RESPONSE = 2, + USER_QUERY_AND_AGENT_RESPONSE = 3 + } + } + + /** Properties of a ModelSafety. */ + interface IModelSafety { + + /** ModelSafety safetySettings */ + safetySettings?: (google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting[]|null); + } + + /** Represents a ModelSafety. */ + class ModelSafety implements IModelSafety { + + /** + * Constructs a new ModelSafety. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.Guardrail.IModelSafety); + + /** ModelSafety safetySettings. */ + public safetySettings: google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting[]; + + /** + * Creates a new ModelSafety instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelSafety instance + */ + public static create(properties?: google.cloud.ces.v1.Guardrail.IModelSafety): google.cloud.ces.v1.Guardrail.ModelSafety; + + /** + * Encodes the specified ModelSafety message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ModelSafety.verify|verify} messages. + * @param message ModelSafety message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.Guardrail.IModelSafety, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelSafety message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ModelSafety.verify|verify} messages. + * @param message ModelSafety message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.Guardrail.IModelSafety, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelSafety message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelSafety + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Guardrail.ModelSafety; + + /** + * Decodes a ModelSafety message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelSafety + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Guardrail.ModelSafety; + + /** + * Verifies a ModelSafety message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelSafety message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelSafety + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Guardrail.ModelSafety; + + /** + * Creates a plain object from a ModelSafety message. Also converts values to other types if specified. + * @param message ModelSafety + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Guardrail.ModelSafety, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelSafety to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelSafety + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ModelSafety { + + /** Properties of a SafetySetting. */ + interface ISafetySetting { + + /** SafetySetting category */ + category?: (google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory|keyof typeof google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory|null); + + /** SafetySetting threshold */ + threshold?: (google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold|keyof typeof google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold|null); + } + + /** Represents a SafetySetting. */ + class SafetySetting implements ISafetySetting { + + /** + * Constructs a new SafetySetting. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting); + + /** SafetySetting category. */ + public category: (google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory|keyof typeof google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory); + + /** SafetySetting threshold. */ + public threshold: (google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold|keyof typeof google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold); + + /** + * Creates a new SafetySetting instance using the specified properties. + * @param [properties] Properties to set + * @returns SafetySetting instance + */ + public static create(properties?: google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting): google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting; + + /** + * Encodes the specified SafetySetting message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. + * @param message SafetySetting message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. + * @param message SafetySetting message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SafetySetting message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SafetySetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting; + + /** + * Decodes a SafetySetting message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SafetySetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting; + + /** + * Verifies a SafetySetting message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SafetySetting + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting; + + /** + * Creates a plain object from a SafetySetting message. Also converts values to other types if specified. + * @param message SafetySetting + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SafetySetting to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SafetySetting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** HarmCategory enum. */ + enum HarmCategory { + HARM_CATEGORY_UNSPECIFIED = 0, + HARM_CATEGORY_HATE_SPEECH = 1, + HARM_CATEGORY_DANGEROUS_CONTENT = 2, + HARM_CATEGORY_HARASSMENT = 3, + HARM_CATEGORY_SEXUALLY_EXPLICIT = 4 + } + + /** HarmBlockThreshold enum. */ + enum HarmBlockThreshold { + HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0, + BLOCK_LOW_AND_ABOVE = 1, + BLOCK_MEDIUM_AND_ABOVE = 2, + BLOCK_ONLY_HIGH = 3, + BLOCK_NONE = 4, + OFF = 5 + } + } + + /** Properties of a CodeCallback. */ + interface ICodeCallback { + + /** CodeCallback beforeAgentCallback */ + beforeAgentCallback?: (google.cloud.ces.v1.ICallback|null); + + /** CodeCallback afterAgentCallback */ + afterAgentCallback?: (google.cloud.ces.v1.ICallback|null); + + /** CodeCallback beforeModelCallback */ + beforeModelCallback?: (google.cloud.ces.v1.ICallback|null); + + /** CodeCallback afterModelCallback */ + afterModelCallback?: (google.cloud.ces.v1.ICallback|null); + } + + /** Represents a CodeCallback. */ + class CodeCallback implements ICodeCallback { + + /** + * Constructs a new CodeCallback. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.Guardrail.ICodeCallback); + + /** CodeCallback beforeAgentCallback. */ + public beforeAgentCallback?: (google.cloud.ces.v1.ICallback|null); + + /** CodeCallback afterAgentCallback. */ + public afterAgentCallback?: (google.cloud.ces.v1.ICallback|null); + + /** CodeCallback beforeModelCallback. */ + public beforeModelCallback?: (google.cloud.ces.v1.ICallback|null); + + /** CodeCallback afterModelCallback. */ + public afterModelCallback?: (google.cloud.ces.v1.ICallback|null); + + /** + * Creates a new CodeCallback instance using the specified properties. + * @param [properties] Properties to set + * @returns CodeCallback instance + */ + public static create(properties?: google.cloud.ces.v1.Guardrail.ICodeCallback): google.cloud.ces.v1.Guardrail.CodeCallback; + + /** + * Encodes the specified CodeCallback message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.CodeCallback.verify|verify} messages. + * @param message CodeCallback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.Guardrail.ICodeCallback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CodeCallback message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.CodeCallback.verify|verify} messages. + * @param message CodeCallback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.Guardrail.ICodeCallback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CodeCallback message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CodeCallback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Guardrail.CodeCallback; + + /** + * Decodes a CodeCallback message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CodeCallback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Guardrail.CodeCallback; + + /** + * Verifies a CodeCallback message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CodeCallback message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CodeCallback + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Guardrail.CodeCallback; + + /** + * Creates a plain object from a CodeCallback message. Also converts values to other types if specified. + * @param message CodeCallback + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Guardrail.CodeCallback, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CodeCallback to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CodeCallback + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Tool. */ + interface ITool { + + /** Tool clientFunction */ + clientFunction?: (google.cloud.ces.v1.IClientFunction|null); + + /** Tool openApiTool */ + openApiTool?: (google.cloud.ces.v1.IOpenApiTool|null); + + /** Tool googleSearchTool */ + googleSearchTool?: (google.cloud.ces.v1.IGoogleSearchTool|null); + + /** Tool connectorTool */ + connectorTool?: (google.cloud.ces.v1.IConnectorTool|null); + + /** Tool dataStoreTool */ + dataStoreTool?: (google.cloud.ces.v1.IDataStoreTool|null); + + /** Tool pythonFunction */ + pythonFunction?: (google.cloud.ces.v1.IPythonFunction|null); + + /** Tool mcpTool */ + mcpTool?: (google.cloud.ces.v1.IMcpTool|null); + + /** Tool fileSearchTool */ + fileSearchTool?: (google.cloud.ces.v1.IFileSearchTool|null); + + /** Tool systemTool */ + systemTool?: (google.cloud.ces.v1.ISystemTool|null); + + /** Tool widgetTool */ + widgetTool?: (google.cloud.ces.v1.IWidgetTool|null); + + /** Tool name */ + name?: (string|null); + + /** Tool displayName */ + displayName?: (string|null); + + /** Tool executionType */ + executionType?: (google.cloud.ces.v1.ExecutionType|keyof typeof google.cloud.ces.v1.ExecutionType|null); + + /** Tool createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Tool updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Tool etag */ + etag?: (string|null); + + /** Tool generatedSummary */ + generatedSummary?: (string|null); + + /** Tool toolFakeConfig */ + toolFakeConfig?: (google.cloud.ces.v1.IToolFakeConfig|null); + } + + /** Represents a Tool. */ + class Tool implements ITool { + + /** + * Constructs a new Tool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ITool); + + /** Tool clientFunction. */ + public clientFunction?: (google.cloud.ces.v1.IClientFunction|null); + + /** Tool openApiTool. */ + public openApiTool?: (google.cloud.ces.v1.IOpenApiTool|null); + + /** Tool googleSearchTool. */ + public googleSearchTool?: (google.cloud.ces.v1.IGoogleSearchTool|null); + + /** Tool connectorTool. */ + public connectorTool?: (google.cloud.ces.v1.IConnectorTool|null); + + /** Tool dataStoreTool. */ + public dataStoreTool?: (google.cloud.ces.v1.IDataStoreTool|null); + + /** Tool pythonFunction. */ + public pythonFunction?: (google.cloud.ces.v1.IPythonFunction|null); + + /** Tool mcpTool. */ + public mcpTool?: (google.cloud.ces.v1.IMcpTool|null); + + /** Tool fileSearchTool. */ + public fileSearchTool?: (google.cloud.ces.v1.IFileSearchTool|null); + + /** Tool systemTool. */ + public systemTool?: (google.cloud.ces.v1.ISystemTool|null); + + /** Tool widgetTool. */ + public widgetTool?: (google.cloud.ces.v1.IWidgetTool|null); + + /** Tool name. */ + public name: string; + + /** Tool displayName. */ + public displayName: string; + + /** Tool executionType. */ + public executionType: (google.cloud.ces.v1.ExecutionType|keyof typeof google.cloud.ces.v1.ExecutionType); + + /** Tool createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Tool updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Tool etag. */ + public etag: string; + + /** Tool generatedSummary. */ + public generatedSummary: string; + + /** Tool toolFakeConfig. */ + public toolFakeConfig?: (google.cloud.ces.v1.IToolFakeConfig|null); + + /** Tool toolType. */ + public toolType?: ("clientFunction"|"openApiTool"|"googleSearchTool"|"connectorTool"|"dataStoreTool"|"pythonFunction"|"mcpTool"|"fileSearchTool"|"systemTool"|"widgetTool"); + + /** + * Creates a new Tool instance using the specified properties. + * @param [properties] Properties to set + * @returns Tool instance + */ + public static create(properties?: google.cloud.ces.v1.ITool): google.cloud.ces.v1.Tool; + + /** + * Encodes the specified Tool message. Does not implicitly {@link google.cloud.ces.v1.Tool.verify|verify} messages. + * @param message Tool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ITool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Tool.verify|verify} messages. + * @param message Tool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ITool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Tool; + + /** + * Decodes a Tool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Tool; + + /** + * Verifies a Tool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Tool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Tool; + + /** + * Creates a plain object from a Tool message. Also converts values to other types if specified. + * @param message Tool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Tool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Tool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientFunction. */ + interface IClientFunction { + + /** ClientFunction name */ + name?: (string|null); + + /** ClientFunction description */ + description?: (string|null); + + /** ClientFunction parameters */ + parameters?: (google.cloud.ces.v1.ISchema|null); + + /** ClientFunction response */ + response?: (google.cloud.ces.v1.ISchema|null); + } + + /** Represents a ClientFunction. */ + class ClientFunction implements IClientFunction { + + /** + * Constructs a new ClientFunction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IClientFunction); + + /** ClientFunction name. */ + public name: string; + + /** ClientFunction description. */ + public description: string; + + /** ClientFunction parameters. */ + public parameters?: (google.cloud.ces.v1.ISchema|null); + + /** ClientFunction response. */ + public response?: (google.cloud.ces.v1.ISchema|null); + + /** + * Creates a new ClientFunction instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientFunction instance + */ + public static create(properties?: google.cloud.ces.v1.IClientFunction): google.cloud.ces.v1.ClientFunction; + + /** + * Encodes the specified ClientFunction message. Does not implicitly {@link google.cloud.ces.v1.ClientFunction.verify|verify} messages. + * @param message ClientFunction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IClientFunction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ClientFunction.verify|verify} messages. + * @param message ClientFunction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IClientFunction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientFunction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ClientFunction; + + /** + * Decodes a ClientFunction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ClientFunction; + + /** + * Verifies a ClientFunction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientFunction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientFunction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ClientFunction; + + /** + * Creates a plain object from a ClientFunction message. Also converts values to other types if specified. + * @param message ClientFunction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ClientFunction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientFunction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientFunction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Action. */ + interface IAction { + + /** Action connectionActionId */ + connectionActionId?: (string|null); + + /** Action entityOperation */ + entityOperation?: (google.cloud.ces.v1.Action.IEntityOperation|null); + + /** Action inputFields */ + inputFields?: (string[]|null); + + /** Action outputFields */ + outputFields?: (string[]|null); + } + + /** Represents an Action. */ + class Action implements IAction { + + /** + * Constructs a new Action. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IAction); + + /** Action connectionActionId. */ + public connectionActionId?: (string|null); + + /** Action entityOperation. */ + public entityOperation?: (google.cloud.ces.v1.Action.IEntityOperation|null); + + /** Action inputFields. */ + public inputFields: string[]; + + /** Action outputFields. */ + public outputFields: string[]; + + /** Action actionSpec. */ + public actionSpec?: ("connectionActionId"|"entityOperation"); + + /** + * Creates a new Action instance using the specified properties. + * @param [properties] Properties to set + * @returns Action instance + */ + public static create(properties?: google.cloud.ces.v1.IAction): google.cloud.ces.v1.Action; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.cloud.ces.v1.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Action message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Action; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Action; + + /** + * Verifies an Action message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Action message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Action + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Action; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @param message Action + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Action, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Action to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Action + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Action { + + /** Properties of an EntityOperation. */ + interface IEntityOperation { + + /** EntityOperation entityId */ + entityId?: (string|null); + + /** EntityOperation operation */ + operation?: (google.cloud.ces.v1.Action.EntityOperation.OperationType|keyof typeof google.cloud.ces.v1.Action.EntityOperation.OperationType|null); + } + + /** Represents an EntityOperation. */ + class EntityOperation implements IEntityOperation { + + /** + * Constructs a new EntityOperation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.Action.IEntityOperation); + + /** EntityOperation entityId. */ + public entityId: string; + + /** EntityOperation operation. */ + public operation: (google.cloud.ces.v1.Action.EntityOperation.OperationType|keyof typeof google.cloud.ces.v1.Action.EntityOperation.OperationType); + + /** + * Creates a new EntityOperation instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityOperation instance + */ + public static create(properties?: google.cloud.ces.v1.Action.IEntityOperation): google.cloud.ces.v1.Action.EntityOperation; + + /** + * Encodes the specified EntityOperation message. Does not implicitly {@link google.cloud.ces.v1.Action.EntityOperation.verify|verify} messages. + * @param message EntityOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.Action.IEntityOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityOperation message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Action.EntityOperation.verify|verify} messages. + * @param message EntityOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.Action.IEntityOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityOperation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Action.EntityOperation; + + /** + * Decodes an EntityOperation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Action.EntityOperation; + + /** + * Verifies an EntityOperation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EntityOperation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityOperation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Action.EntityOperation; + + /** + * Creates a plain object from an EntityOperation message. Also converts values to other types if specified. + * @param message EntityOperation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Action.EntityOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityOperation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EntityOperation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EntityOperation { + + /** OperationType enum. */ + enum OperationType { + OPERATION_TYPE_UNSPECIFIED = 0, + LIST = 1, + GET = 2, + CREATE = 3, + UPDATE = 4, + DELETE = 5 + } + } + } + + /** Properties of a ConnectorTool. */ + interface IConnectorTool { + + /** ConnectorTool connection */ + connection?: (string|null); + + /** ConnectorTool action */ + action?: (google.cloud.ces.v1.IAction|null); + + /** ConnectorTool authConfig */ + authConfig?: (google.cloud.ces.v1.IEndUserAuthConfig|null); + + /** ConnectorTool name */ + name?: (string|null); + + /** ConnectorTool description */ + description?: (string|null); + } + + /** Represents a ConnectorTool. */ + class ConnectorTool implements IConnectorTool { + + /** + * Constructs a new ConnectorTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IConnectorTool); + + /** ConnectorTool connection. */ + public connection: string; + + /** ConnectorTool action. */ + public action?: (google.cloud.ces.v1.IAction|null); + + /** ConnectorTool authConfig. */ + public authConfig?: (google.cloud.ces.v1.IEndUserAuthConfig|null); + + /** ConnectorTool name. */ + public name: string; + + /** ConnectorTool description. */ + public description: string; + + /** + * Creates a new ConnectorTool instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectorTool instance + */ + public static create(properties?: google.cloud.ces.v1.IConnectorTool): google.cloud.ces.v1.ConnectorTool; + + /** + * Encodes the specified ConnectorTool message. Does not implicitly {@link google.cloud.ces.v1.ConnectorTool.verify|verify} messages. + * @param message ConnectorTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IConnectorTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectorTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ConnectorTool.verify|verify} messages. + * @param message ConnectorTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IConnectorTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectorTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectorTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ConnectorTool; + + /** + * Decodes a ConnectorTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectorTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ConnectorTool; + + /** + * Verifies a ConnectorTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectorTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectorTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ConnectorTool; + + /** + * Creates a plain object from a ConnectorTool message. Also converts values to other types if specified. + * @param message ConnectorTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ConnectorTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectorTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectorTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApiKeyConfig. */ + interface IApiKeyConfig { + + /** ApiKeyConfig keyName */ + keyName?: (string|null); + + /** ApiKeyConfig apiKeySecretVersion */ + apiKeySecretVersion?: (string|null); + + /** ApiKeyConfig requestLocation */ + requestLocation?: (google.cloud.ces.v1.ApiKeyConfig.RequestLocation|keyof typeof google.cloud.ces.v1.ApiKeyConfig.RequestLocation|null); + } + + /** Represents an ApiKeyConfig. */ + class ApiKeyConfig implements IApiKeyConfig { + + /** + * Constructs a new ApiKeyConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IApiKeyConfig); + + /** ApiKeyConfig keyName. */ + public keyName: string; + + /** ApiKeyConfig apiKeySecretVersion. */ + public apiKeySecretVersion: string; + + /** ApiKeyConfig requestLocation. */ + public requestLocation: (google.cloud.ces.v1.ApiKeyConfig.RequestLocation|keyof typeof google.cloud.ces.v1.ApiKeyConfig.RequestLocation); + + /** + * Creates a new ApiKeyConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiKeyConfig instance + */ + public static create(properties?: google.cloud.ces.v1.IApiKeyConfig): google.cloud.ces.v1.ApiKeyConfig; + + /** + * Encodes the specified ApiKeyConfig message. Does not implicitly {@link google.cloud.ces.v1.ApiKeyConfig.verify|verify} messages. + * @param message ApiKeyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IApiKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiKeyConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ApiKeyConfig.verify|verify} messages. + * @param message ApiKeyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IApiKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ApiKeyConfig; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ApiKeyConfig; + + /** + * Verifies an ApiKeyConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApiKeyConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiKeyConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ApiKeyConfig; + + /** + * Creates a plain object from an ApiKeyConfig message. Also converts values to other types if specified. + * @param message ApiKeyConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ApiKeyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiKeyConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiKeyConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ApiKeyConfig { + + /** RequestLocation enum. */ + enum RequestLocation { + REQUEST_LOCATION_UNSPECIFIED = 0, + HEADER = 1, + QUERY_STRING = 2 + } + } + + /** Properties of a OAuthConfig. */ + interface IOAuthConfig { + + /** OAuthConfig oauthGrantType */ + oauthGrantType?: (google.cloud.ces.v1.OAuthConfig.OauthGrantType|keyof typeof google.cloud.ces.v1.OAuthConfig.OauthGrantType|null); + + /** OAuthConfig clientId */ + clientId?: (string|null); + + /** OAuthConfig clientSecretVersion */ + clientSecretVersion?: (string|null); + + /** OAuthConfig tokenEndpoint */ + tokenEndpoint?: (string|null); + + /** OAuthConfig scopes */ + scopes?: (string[]|null); + } + + /** Represents a OAuthConfig. */ + class OAuthConfig implements IOAuthConfig { + + /** + * Constructs a new OAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IOAuthConfig); + + /** OAuthConfig oauthGrantType. */ + public oauthGrantType: (google.cloud.ces.v1.OAuthConfig.OauthGrantType|keyof typeof google.cloud.ces.v1.OAuthConfig.OauthGrantType); + + /** OAuthConfig clientId. */ + public clientId: string; + + /** OAuthConfig clientSecretVersion. */ + public clientSecretVersion: string; + + /** OAuthConfig tokenEndpoint. */ + public tokenEndpoint: string; + + /** OAuthConfig scopes. */ + public scopes: string[]; + + /** + * Creates a new OAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OAuthConfig instance + */ + public static create(properties?: google.cloud.ces.v1.IOAuthConfig): google.cloud.ces.v1.OAuthConfig; + + /** + * Encodes the specified OAuthConfig message. Does not implicitly {@link google.cloud.ces.v1.OAuthConfig.verify|verify} messages. + * @param message OAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IOAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OAuthConfig.verify|verify} messages. + * @param message OAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IOAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OAuthConfig; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OAuthConfig; + + /** + * Verifies a OAuthConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OAuthConfig; + + /** + * Creates a plain object from a OAuthConfig message. Also converts values to other types if specified. + * @param message OAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.OAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OAuthConfig { + + /** OauthGrantType enum. */ + enum OauthGrantType { + OAUTH_GRANT_TYPE_UNSPECIFIED = 0, + CLIENT_CREDENTIAL = 1 + } + } + + /** Properties of a ServiceAgentIdTokenAuthConfig. */ + interface IServiceAgentIdTokenAuthConfig { + } + + /** Represents a ServiceAgentIdTokenAuthConfig. */ + class ServiceAgentIdTokenAuthConfig implements IServiceAgentIdTokenAuthConfig { + + /** + * Constructs a new ServiceAgentIdTokenAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig); + + /** + * Creates a new ServiceAgentIdTokenAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAgentIdTokenAuthConfig instance + */ + public static create(properties?: google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig): google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig; + + /** + * Encodes the specified ServiceAgentIdTokenAuthConfig message. Does not implicitly {@link google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig.verify|verify} messages. + * @param message ServiceAgentIdTokenAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAgentIdTokenAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig.verify|verify} messages. + * @param message ServiceAgentIdTokenAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAgentIdTokenAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig; + + /** + * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAgentIdTokenAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig; + + /** + * Verifies a ServiceAgentIdTokenAuthConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceAgentIdTokenAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAgentIdTokenAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig; + + /** + * Creates a plain object from a ServiceAgentIdTokenAuthConfig message. Also converts values to other types if specified. + * @param message ServiceAgentIdTokenAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAgentIdTokenAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAgentIdTokenAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceAccountAuthConfig. */ + interface IServiceAccountAuthConfig { + + /** ServiceAccountAuthConfig serviceAccount */ + serviceAccount?: (string|null); + + /** ServiceAccountAuthConfig scopes */ + scopes?: (string[]|null); + } + + /** Represents a ServiceAccountAuthConfig. */ + class ServiceAccountAuthConfig implements IServiceAccountAuthConfig { + + /** + * Constructs a new ServiceAccountAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IServiceAccountAuthConfig); + + /** ServiceAccountAuthConfig serviceAccount. */ + public serviceAccount: string; + + /** ServiceAccountAuthConfig scopes. */ + public scopes: string[]; + + /** + * Creates a new ServiceAccountAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAccountAuthConfig instance + */ + public static create(properties?: google.cloud.ces.v1.IServiceAccountAuthConfig): google.cloud.ces.v1.ServiceAccountAuthConfig; + + /** + * Encodes the specified ServiceAccountAuthConfig message. Does not implicitly {@link google.cloud.ces.v1.ServiceAccountAuthConfig.verify|verify} messages. + * @param message ServiceAccountAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IServiceAccountAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAccountAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ServiceAccountAuthConfig.verify|verify} messages. + * @param message ServiceAccountAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IServiceAccountAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ServiceAccountAuthConfig; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ServiceAccountAuthConfig; + + /** + * Verifies a ServiceAccountAuthConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceAccountAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAccountAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ServiceAccountAuthConfig; + + /** + * Creates a plain object from a ServiceAccountAuthConfig message. Also converts values to other types if specified. + * @param message ServiceAccountAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ServiceAccountAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAccountAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAccountAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BearerTokenConfig. */ + interface IBearerTokenConfig { + + /** BearerTokenConfig token */ + token?: (string|null); + } + + /** Represents a BearerTokenConfig. */ + class BearerTokenConfig implements IBearerTokenConfig { + + /** + * Constructs a new BearerTokenConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IBearerTokenConfig); + + /** BearerTokenConfig token. */ + public token: string; + + /** + * Creates a new BearerTokenConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BearerTokenConfig instance + */ + public static create(properties?: google.cloud.ces.v1.IBearerTokenConfig): google.cloud.ces.v1.BearerTokenConfig; + + /** + * Encodes the specified BearerTokenConfig message. Does not implicitly {@link google.cloud.ces.v1.BearerTokenConfig.verify|verify} messages. + * @param message BearerTokenConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IBearerTokenConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BearerTokenConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BearerTokenConfig.verify|verify} messages. + * @param message BearerTokenConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IBearerTokenConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BearerTokenConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.BearerTokenConfig; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BearerTokenConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.BearerTokenConfig; + + /** + * Verifies a BearerTokenConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BearerTokenConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BearerTokenConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.BearerTokenConfig; + + /** + * Creates a plain object from a BearerTokenConfig message. Also converts values to other types if specified. + * @param message BearerTokenConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.BearerTokenConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BearerTokenConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BearerTokenConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EndUserAuthConfig. */ + interface IEndUserAuthConfig { + + /** EndUserAuthConfig oauth2AuthCodeConfig */ + oauth2AuthCodeConfig?: (google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig|null); + + /** EndUserAuthConfig oauth2JwtBearerConfig */ + oauth2JwtBearerConfig?: (google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig|null); + } + + /** Represents an EndUserAuthConfig. */ + class EndUserAuthConfig implements IEndUserAuthConfig { + + /** + * Constructs a new EndUserAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IEndUserAuthConfig); + + /** EndUserAuthConfig oauth2AuthCodeConfig. */ + public oauth2AuthCodeConfig?: (google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig|null); + + /** EndUserAuthConfig oauth2JwtBearerConfig. */ + public oauth2JwtBearerConfig?: (google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig|null); + + /** EndUserAuthConfig authConfig. */ + public authConfig?: ("oauth2AuthCodeConfig"|"oauth2JwtBearerConfig"); + + /** + * Creates a new EndUserAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EndUserAuthConfig instance + */ + public static create(properties?: google.cloud.ces.v1.IEndUserAuthConfig): google.cloud.ces.v1.EndUserAuthConfig; + + /** + * Encodes the specified EndUserAuthConfig message. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.verify|verify} messages. + * @param message EndUserAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IEndUserAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndUserAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.verify|verify} messages. + * @param message EndUserAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IEndUserAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndUserAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndUserAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.EndUserAuthConfig; + + /** + * Decodes an EndUserAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndUserAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.EndUserAuthConfig; + + /** + * Verifies an EndUserAuthConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EndUserAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndUserAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.EndUserAuthConfig; + + /** + * Creates a plain object from an EndUserAuthConfig message. Also converts values to other types if specified. + * @param message EndUserAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.EndUserAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndUserAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndUserAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EndUserAuthConfig { + + /** Properties of an Oauth2AuthCodeConfig. */ + interface IOauth2AuthCodeConfig { + + /** Oauth2AuthCodeConfig oauthToken */ + oauthToken?: (string|null); + } + + /** Represents an Oauth2AuthCodeConfig. */ + class Oauth2AuthCodeConfig implements IOauth2AuthCodeConfig { + + /** + * Constructs a new Oauth2AuthCodeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig); + + /** Oauth2AuthCodeConfig oauthToken. */ + public oauthToken: string; + + /** + * Creates a new Oauth2AuthCodeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns Oauth2AuthCodeConfig instance + */ + public static create(properties?: google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig): google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig; + + /** + * Encodes the specified Oauth2AuthCodeConfig message. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. + * @param message Oauth2AuthCodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Oauth2AuthCodeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. + * @param message Oauth2AuthCodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Oauth2AuthCodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig; + + /** + * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Oauth2AuthCodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig; + + /** + * Verifies an Oauth2AuthCodeConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Oauth2AuthCodeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Oauth2AuthCodeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig; + + /** + * Creates a plain object from an Oauth2AuthCodeConfig message. Also converts values to other types if specified. + * @param message Oauth2AuthCodeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Oauth2AuthCodeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Oauth2AuthCodeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Oauth2JwtBearerConfig. */ + interface IOauth2JwtBearerConfig { + + /** Oauth2JwtBearerConfig issuer */ + issuer?: (string|null); + + /** Oauth2JwtBearerConfig subject */ + subject?: (string|null); + + /** Oauth2JwtBearerConfig clientKey */ + clientKey?: (string|null); + } + + /** Represents an Oauth2JwtBearerConfig. */ + class Oauth2JwtBearerConfig implements IOauth2JwtBearerConfig { + + /** + * Constructs a new Oauth2JwtBearerConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig); + + /** Oauth2JwtBearerConfig issuer. */ + public issuer: string; + + /** Oauth2JwtBearerConfig subject. */ + public subject: string; + + /** Oauth2JwtBearerConfig clientKey. */ + public clientKey: string; + + /** + * Creates a new Oauth2JwtBearerConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns Oauth2JwtBearerConfig instance + */ + public static create(properties?: google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig): google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig; + + /** + * Encodes the specified Oauth2JwtBearerConfig message. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. + * @param message Oauth2JwtBearerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Oauth2JwtBearerConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. + * @param message Oauth2JwtBearerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Oauth2JwtBearerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig; + + /** + * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Oauth2JwtBearerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig; + + /** + * Verifies an Oauth2JwtBearerConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Oauth2JwtBearerConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Oauth2JwtBearerConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig; + + /** + * Creates a plain object from an Oauth2JwtBearerConfig message. Also converts values to other types if specified. + * @param message Oauth2JwtBearerConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Oauth2JwtBearerConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Oauth2JwtBearerConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ApiAuthentication. */ + interface IApiAuthentication { + + /** ApiAuthentication apiKeyConfig */ + apiKeyConfig?: (google.cloud.ces.v1.IApiKeyConfig|null); + + /** ApiAuthentication oauthConfig */ + oauthConfig?: (google.cloud.ces.v1.IOAuthConfig|null); + + /** ApiAuthentication serviceAgentIdTokenAuthConfig */ + serviceAgentIdTokenAuthConfig?: (google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig|null); + + /** ApiAuthentication serviceAccountAuthConfig */ + serviceAccountAuthConfig?: (google.cloud.ces.v1.IServiceAccountAuthConfig|null); + + /** ApiAuthentication bearerTokenConfig */ + bearerTokenConfig?: (google.cloud.ces.v1.IBearerTokenConfig|null); + } + + /** Represents an ApiAuthentication. */ + class ApiAuthentication implements IApiAuthentication { + + /** + * Constructs a new ApiAuthentication. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IApiAuthentication); + + /** ApiAuthentication apiKeyConfig. */ + public apiKeyConfig?: (google.cloud.ces.v1.IApiKeyConfig|null); + + /** ApiAuthentication oauthConfig. */ + public oauthConfig?: (google.cloud.ces.v1.IOAuthConfig|null); + + /** ApiAuthentication serviceAgentIdTokenAuthConfig. */ + public serviceAgentIdTokenAuthConfig?: (google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig|null); + + /** ApiAuthentication serviceAccountAuthConfig. */ + public serviceAccountAuthConfig?: (google.cloud.ces.v1.IServiceAccountAuthConfig|null); + + /** ApiAuthentication bearerTokenConfig. */ + public bearerTokenConfig?: (google.cloud.ces.v1.IBearerTokenConfig|null); + + /** ApiAuthentication authConfig. */ + public authConfig?: ("apiKeyConfig"|"oauthConfig"|"serviceAgentIdTokenAuthConfig"|"serviceAccountAuthConfig"|"bearerTokenConfig"); + + /** + * Creates a new ApiAuthentication instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiAuthentication instance + */ + public static create(properties?: google.cloud.ces.v1.IApiAuthentication): google.cloud.ces.v1.ApiAuthentication; + + /** + * Encodes the specified ApiAuthentication message. Does not implicitly {@link google.cloud.ces.v1.ApiAuthentication.verify|verify} messages. + * @param message ApiAuthentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IApiAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiAuthentication message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ApiAuthentication.verify|verify} messages. + * @param message ApiAuthentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IApiAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiAuthentication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiAuthentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ApiAuthentication; + + /** + * Decodes an ApiAuthentication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiAuthentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ApiAuthentication; + + /** + * Verifies an ApiAuthentication message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApiAuthentication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiAuthentication + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ApiAuthentication; + + /** + * Creates a plain object from an ApiAuthentication message. Also converts values to other types if specified. + * @param message ApiAuthentication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ApiAuthentication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiAuthentication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiAuthentication + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataStoreTool. */ + interface IDataStoreTool { + + /** DataStoreTool dataStoreSource */ + dataStoreSource?: (google.cloud.ces.v1.DataStoreTool.IDataStoreSource|null); + + /** DataStoreTool engineSource */ + engineSource?: (google.cloud.ces.v1.DataStoreTool.IEngineSource|null); + + /** DataStoreTool name */ + name?: (string|null); + + /** DataStoreTool description */ + description?: (string|null); + + /** DataStoreTool boostSpecs */ + boostSpecs?: (google.cloud.ces.v1.DataStoreTool.IBoostSpecs[]|null); + + /** DataStoreTool modalityConfigs */ + modalityConfigs?: (google.cloud.ces.v1.DataStoreTool.IModalityConfig[]|null); + + /** DataStoreTool filterParameterBehavior */ + filterParameterBehavior?: (google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior|keyof typeof google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior|null); + } + + /** Represents a DataStoreTool. */ + class DataStoreTool implements IDataStoreTool { + + /** + * Constructs a new DataStoreTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IDataStoreTool); + + /** DataStoreTool dataStoreSource. */ + public dataStoreSource?: (google.cloud.ces.v1.DataStoreTool.IDataStoreSource|null); + + /** DataStoreTool engineSource. */ + public engineSource?: (google.cloud.ces.v1.DataStoreTool.IEngineSource|null); + + /** DataStoreTool name. */ + public name: string; + + /** DataStoreTool description. */ + public description: string; + + /** DataStoreTool boostSpecs. */ + public boostSpecs: google.cloud.ces.v1.DataStoreTool.IBoostSpecs[]; + + /** DataStoreTool modalityConfigs. */ + public modalityConfigs: google.cloud.ces.v1.DataStoreTool.IModalityConfig[]; + + /** DataStoreTool filterParameterBehavior. */ + public filterParameterBehavior: (google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior|keyof typeof google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior); + + /** DataStoreTool searchSource. */ + public searchSource?: ("dataStoreSource"|"engineSource"); + + /** + * Creates a new DataStoreTool instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStoreTool instance + */ + public static create(properties?: google.cloud.ces.v1.IDataStoreTool): google.cloud.ces.v1.DataStoreTool; + + /** + * Encodes the specified DataStoreTool message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.verify|verify} messages. + * @param message DataStoreTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IDataStoreTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStoreTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.verify|verify} messages. + * @param message DataStoreTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IDataStoreTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStoreTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStoreTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool; + + /** + * Verifies a DataStoreTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataStoreTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStoreTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool; + + /** + * Creates a plain object from a DataStoreTool message. Also converts values to other types if specified. + * @param message DataStoreTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DataStoreTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStoreTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStoreTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataStoreTool { + + /** Properties of a RewriterConfig. */ + interface IRewriterConfig { + + /** RewriterConfig modelSettings */ + modelSettings?: (google.cloud.ces.v1.IModelSettings|null); + + /** RewriterConfig prompt */ + prompt?: (string|null); + + /** RewriterConfig disabled */ + disabled?: (boolean|null); + } + + /** Represents a RewriterConfig. */ + class RewriterConfig implements IRewriterConfig { + + /** + * Constructs a new RewriterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.DataStoreTool.IRewriterConfig); + + /** RewriterConfig modelSettings. */ + public modelSettings?: (google.cloud.ces.v1.IModelSettings|null); + + /** RewriterConfig prompt. */ + public prompt: string; + + /** RewriterConfig disabled. */ + public disabled: boolean; + + /** + * Creates a new RewriterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RewriterConfig instance + */ + public static create(properties?: google.cloud.ces.v1.DataStoreTool.IRewriterConfig): google.cloud.ces.v1.DataStoreTool.RewriterConfig; + + /** + * Encodes the specified RewriterConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.RewriterConfig.verify|verify} messages. + * @param message RewriterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.DataStoreTool.IRewriterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RewriterConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.RewriterConfig.verify|verify} messages. + * @param message RewriterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.IRewriterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RewriterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RewriterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.RewriterConfig; + + /** + * Decodes a RewriterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RewriterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.RewriterConfig; + + /** + * Verifies a RewriterConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RewriterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RewriterConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.RewriterConfig; + + /** + * Creates a plain object from a RewriterConfig message. Also converts values to other types if specified. + * @param message RewriterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DataStoreTool.RewriterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RewriterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RewriterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SummarizationConfig. */ + interface ISummarizationConfig { + + /** SummarizationConfig modelSettings */ + modelSettings?: (google.cloud.ces.v1.IModelSettings|null); + + /** SummarizationConfig prompt */ + prompt?: (string|null); + + /** SummarizationConfig disabled */ + disabled?: (boolean|null); + } + + /** Represents a SummarizationConfig. */ + class SummarizationConfig implements ISummarizationConfig { + + /** + * Constructs a new SummarizationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.DataStoreTool.ISummarizationConfig); + + /** SummarizationConfig modelSettings. */ + public modelSettings?: (google.cloud.ces.v1.IModelSettings|null); + + /** SummarizationConfig prompt. */ + public prompt: string; + + /** SummarizationConfig disabled. */ + public disabled: boolean; + + /** + * Creates a new SummarizationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SummarizationConfig instance + */ + public static create(properties?: google.cloud.ces.v1.DataStoreTool.ISummarizationConfig): google.cloud.ces.v1.DataStoreTool.SummarizationConfig; + + /** + * Encodes the specified SummarizationConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.SummarizationConfig.verify|verify} messages. + * @param message SummarizationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.DataStoreTool.ISummarizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SummarizationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.SummarizationConfig.verify|verify} messages. + * @param message SummarizationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.ISummarizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SummarizationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SummarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.SummarizationConfig; + + /** + * Decodes a SummarizationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SummarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.SummarizationConfig; + + /** + * Verifies a SummarizationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SummarizationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SummarizationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.SummarizationConfig; + + /** + * Creates a plain object from a SummarizationConfig message. Also converts values to other types if specified. + * @param message SummarizationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DataStoreTool.SummarizationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SummarizationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SummarizationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroundingConfig. */ + interface IGroundingConfig { + + /** GroundingConfig groundingLevel */ + groundingLevel?: (number|null); + + /** GroundingConfig disabled */ + disabled?: (boolean|null); + } + + /** Represents a GroundingConfig. */ + class GroundingConfig implements IGroundingConfig { + + /** + * Constructs a new GroundingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.DataStoreTool.IGroundingConfig); + + /** GroundingConfig groundingLevel. */ + public groundingLevel: number; + + /** GroundingConfig disabled. */ + public disabled: boolean; + + /** + * Creates a new GroundingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GroundingConfig instance + */ + public static create(properties?: google.cloud.ces.v1.DataStoreTool.IGroundingConfig): google.cloud.ces.v1.DataStoreTool.GroundingConfig; + + /** + * Encodes the specified GroundingConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.GroundingConfig.verify|verify} messages. + * @param message GroundingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.DataStoreTool.IGroundingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroundingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.GroundingConfig.verify|verify} messages. + * @param message GroundingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.IGroundingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroundingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroundingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.GroundingConfig; + + /** + * Decodes a GroundingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroundingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.GroundingConfig; + + /** + * Verifies a GroundingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroundingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroundingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.GroundingConfig; + + /** + * Creates a plain object from a GroundingConfig message. Also converts values to other types if specified. + * @param message GroundingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DataStoreTool.GroundingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroundingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroundingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataStoreSource. */ + interface IDataStoreSource { + + /** DataStoreSource filter */ + filter?: (string|null); + + /** DataStoreSource dataStore */ + dataStore?: (google.cloud.ces.v1.IDataStore|null); + } + + /** Represents a DataStoreSource. */ + class DataStoreSource implements IDataStoreSource { + + /** + * Constructs a new DataStoreSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.DataStoreTool.IDataStoreSource); + + /** DataStoreSource filter. */ + public filter: string; + + /** DataStoreSource dataStore. */ + public dataStore?: (google.cloud.ces.v1.IDataStore|null); + + /** + * Creates a new DataStoreSource instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStoreSource instance + */ + public static create(properties?: google.cloud.ces.v1.DataStoreTool.IDataStoreSource): google.cloud.ces.v1.DataStoreTool.DataStoreSource; + + /** + * Encodes the specified DataStoreSource message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.DataStoreSource.verify|verify} messages. + * @param message DataStoreSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.DataStoreTool.IDataStoreSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStoreSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.DataStoreSource.verify|verify} messages. + * @param message DataStoreSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.IDataStoreSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStoreSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStoreSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.DataStoreSource; + + /** + * Decodes a DataStoreSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStoreSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.DataStoreSource; + + /** + * Verifies a DataStoreSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataStoreSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStoreSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.DataStoreSource; + + /** + * Creates a plain object from a DataStoreSource message. Also converts values to other types if specified. + * @param message DataStoreSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DataStoreTool.DataStoreSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStoreSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStoreSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EngineSource. */ + interface IEngineSource { + + /** EngineSource engine */ + engine?: (string|null); + + /** EngineSource dataStoreSources */ + dataStoreSources?: (google.cloud.ces.v1.DataStoreTool.IDataStoreSource[]|null); + + /** EngineSource filter */ + filter?: (string|null); + } + + /** Represents an EngineSource. */ + class EngineSource implements IEngineSource { + + /** + * Constructs a new EngineSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.DataStoreTool.IEngineSource); + + /** EngineSource engine. */ + public engine: string; + + /** EngineSource dataStoreSources. */ + public dataStoreSources: google.cloud.ces.v1.DataStoreTool.IDataStoreSource[]; + + /** EngineSource filter. */ + public filter: string; + + /** + * Creates a new EngineSource instance using the specified properties. + * @param [properties] Properties to set + * @returns EngineSource instance + */ + public static create(properties?: google.cloud.ces.v1.DataStoreTool.IEngineSource): google.cloud.ces.v1.DataStoreTool.EngineSource; + + /** + * Encodes the specified EngineSource message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.EngineSource.verify|verify} messages. + * @param message EngineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.DataStoreTool.IEngineSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EngineSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.EngineSource.verify|verify} messages. + * @param message EngineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.IEngineSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EngineSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EngineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.EngineSource; + + /** + * Decodes an EngineSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EngineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.EngineSource; + + /** + * Verifies an EngineSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EngineSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EngineSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.EngineSource; + + /** + * Creates a plain object from an EngineSource message. Also converts values to other types if specified. + * @param message EngineSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DataStoreTool.EngineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EngineSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EngineSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoostSpecs. */ + interface IBoostSpecs { + + /** BoostSpecs dataStores */ + dataStores?: (string[]|null); + + /** BoostSpecs spec */ + spec?: (google.cloud.ces.v1.DataStoreTool.IBoostSpec[]|null); + } + + /** Represents a BoostSpecs. */ + class BoostSpecs implements IBoostSpecs { + + /** + * Constructs a new BoostSpecs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.DataStoreTool.IBoostSpecs); + + /** BoostSpecs dataStores. */ + public dataStores: string[]; + + /** BoostSpecs spec. */ + public spec: google.cloud.ces.v1.DataStoreTool.IBoostSpec[]; + + /** + * Creates a new BoostSpecs instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostSpecs instance + */ + public static create(properties?: google.cloud.ces.v1.DataStoreTool.IBoostSpecs): google.cloud.ces.v1.DataStoreTool.BoostSpecs; + + /** + * Encodes the specified BoostSpecs message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpecs.verify|verify} messages. + * @param message BoostSpecs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.DataStoreTool.IBoostSpecs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostSpecs message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpecs.verify|verify} messages. + * @param message BoostSpecs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.IBoostSpecs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.BoostSpecs; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.BoostSpecs; + + /** + * Verifies a BoostSpecs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoostSpecs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostSpecs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.BoostSpecs; + + /** + * Creates a plain object from a BoostSpecs message. Also converts values to other types if specified. + * @param message BoostSpecs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DataStoreTool.BoostSpecs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostSpecs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostSpecs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoostSpec. */ + interface IBoostSpec { + + /** BoostSpec conditionBoostSpecs */ + conditionBoostSpecs?: (google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec[]|null); + } + + /** Represents a BoostSpec. */ + class BoostSpec implements IBoostSpec { + + /** + * Constructs a new BoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.DataStoreTool.IBoostSpec); + + /** BoostSpec conditionBoostSpecs. */ + public conditionBoostSpecs: google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec[]; + + /** + * Creates a new BoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostSpec instance + */ + public static create(properties?: google.cloud.ces.v1.DataStoreTool.IBoostSpec): google.cloud.ces.v1.DataStoreTool.BoostSpec; + + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.DataStoreTool.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.BoostSpec; + + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.BoostSpec; + + /** + * Verifies a BoostSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.BoostSpec; + + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @param message BoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DataStoreTool.BoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BoostSpec { + + /** Properties of a ConditionBoostSpec. */ + interface IConditionBoostSpec { + + /** ConditionBoostSpec condition */ + condition?: (string|null); + + /** ConditionBoostSpec boost */ + boost?: (number|null); + + /** ConditionBoostSpec boostControlSpec */ + boostControlSpec?: (google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null); + } + + /** Represents a ConditionBoostSpec. */ + class ConditionBoostSpec implements IConditionBoostSpec { + + /** + * Constructs a new ConditionBoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec); + + /** ConditionBoostSpec condition. */ + public condition: string; + + /** ConditionBoostSpec boost. */ + public boost: number; + + /** ConditionBoostSpec boostControlSpec. */ + public boostControlSpec?: (google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null); + + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionBoostSpec instance + */ + public static create(properties?: google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec; + + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec; + + /** + * Verifies a ConditionBoostSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionBoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec; + + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @param message ConditionBoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionBoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConditionBoostSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConditionBoostSpec { + + /** Properties of a BoostControlSpec. */ + interface IBoostControlSpec { + + /** BoostControlSpec fieldName */ + fieldName?: (string|null); + + /** BoostControlSpec attributeType */ + attributeType?: (google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|keyof typeof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|null); + + /** BoostControlSpec interpolationType */ + interpolationType?: (google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|keyof typeof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|null); + + /** BoostControlSpec controlPoints */ + controlPoints?: (google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint[]|null); + } + + /** Represents a BoostControlSpec. */ + class BoostControlSpec implements IBoostControlSpec { + + /** + * Constructs a new BoostControlSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec); + + /** BoostControlSpec fieldName. */ + public fieldName: string; + + /** BoostControlSpec attributeType. */ + public attributeType: (google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|keyof typeof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType); + + /** BoostControlSpec interpolationType. */ + public interpolationType: (google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|keyof typeof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType); + + /** BoostControlSpec controlPoints. */ + public controlPoints: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint[]; + + /** + * Creates a new BoostControlSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostControlSpec instance + */ + public static create(properties?: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Encodes the specified BoostControlSpec message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @param message BoostControlSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostControlSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @param message BoostControlSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Verifies a BoostControlSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoostControlSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostControlSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Creates a plain object from a BoostControlSpec message. Also converts values to other types if specified. + * @param message BoostControlSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostControlSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostControlSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BoostControlSpec { + + /** Properties of a ControlPoint. */ + interface IControlPoint { + + /** ControlPoint attributeValue */ + attributeValue?: (string|null); + + /** ControlPoint boostAmount */ + boostAmount?: (number|null); + } + + /** Represents a ControlPoint. */ + class ControlPoint implements IControlPoint { + + /** + * Constructs a new ControlPoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint); + + /** ControlPoint attributeValue. */ + public attributeValue: string; + + /** ControlPoint boostAmount. */ + public boostAmount: number; + + /** + * Creates a new ControlPoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ControlPoint instance + */ + public static create(properties?: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Encodes the specified ControlPoint message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @param message ControlPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ControlPoint message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @param message ControlPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ControlPoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Decodes a ControlPoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Verifies a ControlPoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ControlPoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ControlPoint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Creates a plain object from a ControlPoint message. Also converts values to other types if specified. + * @param message ControlPoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ControlPoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ControlPoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** AttributeType enum. */ + enum AttributeType { + ATTRIBUTE_TYPE_UNSPECIFIED = 0, + NUMERICAL = 1, + FRESHNESS = 2 + } + + /** InterpolationType enum. */ + enum InterpolationType { + INTERPOLATION_TYPE_UNSPECIFIED = 0, + LINEAR = 1 + } + } + } + } + + /** Properties of a ModalityConfig. */ + interface IModalityConfig { + + /** ModalityConfig modalityType */ + modalityType?: (google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType|keyof typeof google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType|null); + + /** ModalityConfig rewriterConfig */ + rewriterConfig?: (google.cloud.ces.v1.DataStoreTool.IRewriterConfig|null); + + /** ModalityConfig summarizationConfig */ + summarizationConfig?: (google.cloud.ces.v1.DataStoreTool.ISummarizationConfig|null); + + /** ModalityConfig groundingConfig */ + groundingConfig?: (google.cloud.ces.v1.DataStoreTool.IGroundingConfig|null); + } + + /** Represents a ModalityConfig. */ + class ModalityConfig implements IModalityConfig { + + /** + * Constructs a new ModalityConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.DataStoreTool.IModalityConfig); + + /** ModalityConfig modalityType. */ + public modalityType: (google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType|keyof typeof google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType); + + /** ModalityConfig rewriterConfig. */ + public rewriterConfig?: (google.cloud.ces.v1.DataStoreTool.IRewriterConfig|null); + + /** ModalityConfig summarizationConfig. */ + public summarizationConfig?: (google.cloud.ces.v1.DataStoreTool.ISummarizationConfig|null); + + /** ModalityConfig groundingConfig. */ + public groundingConfig?: (google.cloud.ces.v1.DataStoreTool.IGroundingConfig|null); + + /** + * Creates a new ModalityConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ModalityConfig instance + */ + public static create(properties?: google.cloud.ces.v1.DataStoreTool.IModalityConfig): google.cloud.ces.v1.DataStoreTool.ModalityConfig; + + /** + * Encodes the specified ModalityConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.ModalityConfig.verify|verify} messages. + * @param message ModalityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.DataStoreTool.IModalityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModalityConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.ModalityConfig.verify|verify} messages. + * @param message ModalityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.IModalityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModalityConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModalityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.ModalityConfig; + + /** + * Decodes a ModalityConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModalityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.ModalityConfig; + + /** + * Verifies a ModalityConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModalityConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModalityConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.ModalityConfig; + + /** + * Creates a plain object from a ModalityConfig message. Also converts values to other types if specified. + * @param message ModalityConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DataStoreTool.ModalityConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModalityConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModalityConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ModalityConfig { + + /** ModalityType enum. */ + enum ModalityType { + MODALITY_TYPE_UNSPECIFIED = 0, + TEXT = 1, + AUDIO = 2 + } + } + + /** FilterParameterBehavior enum. */ + enum FilterParameterBehavior { + FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED = 0, + ALWAYS_INCLUDE = 2, + NEVER_INCLUDE = 3 + } + } + + /** Properties of a DataStore. */ + interface IDataStore { + + /** DataStore name */ + name?: (string|null); + + /** DataStore type */ + type?: (google.cloud.ces.v1.DataStore.DataStoreType|keyof typeof google.cloud.ces.v1.DataStore.DataStoreType|null); + + /** DataStore documentProcessingMode */ + documentProcessingMode?: (google.cloud.ces.v1.DataStore.DocumentProcessingMode|keyof typeof google.cloud.ces.v1.DataStore.DocumentProcessingMode|null); + + /** DataStore displayName */ + displayName?: (string|null); + + /** DataStore createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DataStore connectorConfig */ + connectorConfig?: (google.cloud.ces.v1.DataStore.IConnectorConfig|null); + } + + /** Represents a DataStore. */ + class DataStore implements IDataStore { + + /** + * Constructs a new DataStore. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IDataStore); + + /** DataStore name. */ + public name: string; + + /** DataStore type. */ + public type: (google.cloud.ces.v1.DataStore.DataStoreType|keyof typeof google.cloud.ces.v1.DataStore.DataStoreType); + + /** DataStore documentProcessingMode. */ + public documentProcessingMode: (google.cloud.ces.v1.DataStore.DocumentProcessingMode|keyof typeof google.cloud.ces.v1.DataStore.DocumentProcessingMode); + + /** DataStore displayName. */ + public displayName: string; + + /** DataStore createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DataStore connectorConfig. */ + public connectorConfig?: (google.cloud.ces.v1.DataStore.IConnectorConfig|null); + + /** + * Creates a new DataStore instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStore instance + */ + public static create(properties?: google.cloud.ces.v1.IDataStore): google.cloud.ces.v1.DataStore; + + /** + * Encodes the specified DataStore message. Does not implicitly {@link google.cloud.ces.v1.DataStore.verify|verify} messages. + * @param message DataStore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IDataStore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStore message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStore.verify|verify} messages. + * @param message DataStore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IDataStore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStore message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStore; + + /** + * Decodes a DataStore message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStore; + + /** + * Verifies a DataStore message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataStore message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStore + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStore; + + /** + * Creates a plain object from a DataStore message. Also converts values to other types if specified. + * @param message DataStore + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DataStore, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStore to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStore + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataStore { + + /** Properties of a ConnectorConfig. */ + interface IConnectorConfig { + + /** ConnectorConfig collection */ + collection?: (string|null); + + /** ConnectorConfig collectionDisplayName */ + collectionDisplayName?: (string|null); + + /** ConnectorConfig dataSource */ + dataSource?: (string|null); + } + + /** Represents a ConnectorConfig. */ + class ConnectorConfig implements IConnectorConfig { + + /** + * Constructs a new ConnectorConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.DataStore.IConnectorConfig); + + /** ConnectorConfig collection. */ + public collection: string; + + /** ConnectorConfig collectionDisplayName. */ + public collectionDisplayName: string; + + /** ConnectorConfig dataSource. */ + public dataSource: string; + + /** + * Creates a new ConnectorConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectorConfig instance + */ + public static create(properties?: google.cloud.ces.v1.DataStore.IConnectorConfig): google.cloud.ces.v1.DataStore.ConnectorConfig; + + /** + * Encodes the specified ConnectorConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStore.ConnectorConfig.verify|verify} messages. + * @param message ConnectorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.DataStore.IConnectorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectorConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStore.ConnectorConfig.verify|verify} messages. + * @param message ConnectorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.DataStore.IConnectorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectorConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStore.ConnectorConfig; + + /** + * Decodes a ConnectorConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStore.ConnectorConfig; + + /** + * Verifies a ConnectorConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectorConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectorConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStore.ConnectorConfig; + + /** + * Creates a plain object from a ConnectorConfig message. Also converts values to other types if specified. + * @param message ConnectorConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.DataStore.ConnectorConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectorConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectorConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DataStoreType enum. */ + enum DataStoreType { + DATA_STORE_TYPE_UNSPECIFIED = 0, + PUBLIC_WEB = 1, + UNSTRUCTURED = 2, + FAQ = 3, + CONNECTOR = 4 + } + + /** DocumentProcessingMode enum. */ + enum DocumentProcessingMode { + DOCUMENT_PROCESSING_MODE_UNSPECIFIED = 0, + DOCUMENTS = 1, + CHUNKS = 2 + } + } + + /** Properties of a CodeBlock. */ + interface ICodeBlock { + + /** CodeBlock pythonCode */ + pythonCode?: (string|null); + } + + /** Represents a CodeBlock. */ + class CodeBlock implements ICodeBlock { + + /** + * Constructs a new CodeBlock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ICodeBlock); + + /** CodeBlock pythonCode. */ + public pythonCode: string; + + /** + * Creates a new CodeBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns CodeBlock instance + */ + public static create(properties?: google.cloud.ces.v1.ICodeBlock): google.cloud.ces.v1.CodeBlock; + + /** + * Encodes the specified CodeBlock message. Does not implicitly {@link google.cloud.ces.v1.CodeBlock.verify|verify} messages. + * @param message CodeBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ICodeBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CodeBlock message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CodeBlock.verify|verify} messages. + * @param message CodeBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ICodeBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CodeBlock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CodeBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CodeBlock; + + /** + * Decodes a CodeBlock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CodeBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CodeBlock; + + /** + * Verifies a CodeBlock message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CodeBlock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CodeBlock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CodeBlock; + + /** + * Creates a plain object from a CodeBlock message. Also converts values to other types if specified. + * @param message CodeBlock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.CodeBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CodeBlock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CodeBlock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolFakeConfig. */ + interface IToolFakeConfig { + + /** ToolFakeConfig codeBlock */ + codeBlock?: (google.cloud.ces.v1.ICodeBlock|null); + + /** ToolFakeConfig enableFakeMode */ + enableFakeMode?: (boolean|null); + } + + /** Represents a ToolFakeConfig. */ + class ToolFakeConfig implements IToolFakeConfig { + + /** + * Constructs a new ToolFakeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IToolFakeConfig); + + /** ToolFakeConfig codeBlock. */ + public codeBlock?: (google.cloud.ces.v1.ICodeBlock|null); + + /** ToolFakeConfig enableFakeMode. */ + public enableFakeMode: boolean; + + /** ToolFakeConfig toolResponse. */ + public toolResponse?: "codeBlock"; + + /** + * Creates a new ToolFakeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolFakeConfig instance + */ + public static create(properties?: google.cloud.ces.v1.IToolFakeConfig): google.cloud.ces.v1.ToolFakeConfig; + + /** + * Encodes the specified ToolFakeConfig message. Does not implicitly {@link google.cloud.ces.v1.ToolFakeConfig.verify|verify} messages. + * @param message ToolFakeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IToolFakeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolFakeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolFakeConfig.verify|verify} messages. + * @param message ToolFakeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IToolFakeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolFakeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolFakeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ToolFakeConfig; + + /** + * Decodes a ToolFakeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolFakeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ToolFakeConfig; + + /** + * Verifies a ToolFakeConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolFakeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolFakeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ToolFakeConfig; + + /** + * Creates a plain object from a ToolFakeConfig message. Also converts values to other types if specified. + * @param message ToolFakeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ToolFakeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolFakeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolFakeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileSearchTool. */ + interface IFileSearchTool { + + /** FileSearchTool corpusType */ + corpusType?: (google.cloud.ces.v1.FileSearchTool.CorpusType|keyof typeof google.cloud.ces.v1.FileSearchTool.CorpusType|null); + + /** FileSearchTool name */ + name?: (string|null); + + /** FileSearchTool description */ + description?: (string|null); + + /** FileSearchTool fileCorpus */ + fileCorpus?: (string|null); + } + + /** Represents a FileSearchTool. */ + class FileSearchTool implements IFileSearchTool { + + /** + * Constructs a new FileSearchTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IFileSearchTool); + + /** FileSearchTool corpusType. */ + public corpusType: (google.cloud.ces.v1.FileSearchTool.CorpusType|keyof typeof google.cloud.ces.v1.FileSearchTool.CorpusType); + + /** FileSearchTool name. */ + public name: string; + + /** FileSearchTool description. */ + public description: string; + + /** FileSearchTool fileCorpus. */ + public fileCorpus: string; + + /** + * Creates a new FileSearchTool instance using the specified properties. + * @param [properties] Properties to set + * @returns FileSearchTool instance + */ + public static create(properties?: google.cloud.ces.v1.IFileSearchTool): google.cloud.ces.v1.FileSearchTool; + + /** + * Encodes the specified FileSearchTool message. Does not implicitly {@link google.cloud.ces.v1.FileSearchTool.verify|verify} messages. + * @param message FileSearchTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IFileSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.FileSearchTool.verify|verify} messages. + * @param message FileSearchTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IFileSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileSearchTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.FileSearchTool; + + /** + * Decodes a FileSearchTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.FileSearchTool; + + /** + * Verifies a FileSearchTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileSearchTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileSearchTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.FileSearchTool; + + /** + * Creates a plain object from a FileSearchTool message. Also converts values to other types if specified. + * @param message FileSearchTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.FileSearchTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileSearchTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileSearchTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileSearchTool { + + /** CorpusType enum. */ + enum CorpusType { + CORPUS_TYPE_UNSPECIFIED = 0, + USER_OWNED = 1, + FULLY_MANAGED = 2 + } + } + + /** Properties of a GoogleSearchTool. */ + interface IGoogleSearchTool { + + /** GoogleSearchTool name */ + name?: (string|null); + + /** GoogleSearchTool description */ + description?: (string|null); + + /** GoogleSearchTool contextUrls */ + contextUrls?: (string[]|null); + + /** GoogleSearchTool preferredDomains */ + preferredDomains?: (string[]|null); + + /** GoogleSearchTool excludeDomains */ + excludeDomains?: (string[]|null); + + /** GoogleSearchTool promptConfig */ + promptConfig?: (google.cloud.ces.v1.GoogleSearchTool.IPromptConfig|null); + } + + /** Represents a GoogleSearchTool. */ + class GoogleSearchTool implements IGoogleSearchTool { + + /** + * Constructs a new GoogleSearchTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IGoogleSearchTool); + + /** GoogleSearchTool name. */ + public name: string; + + /** GoogleSearchTool description. */ + public description: string; + + /** GoogleSearchTool contextUrls. */ + public contextUrls: string[]; + + /** GoogleSearchTool preferredDomains. */ + public preferredDomains: string[]; + + /** GoogleSearchTool excludeDomains. */ + public excludeDomains: string[]; + + /** GoogleSearchTool promptConfig. */ + public promptConfig?: (google.cloud.ces.v1.GoogleSearchTool.IPromptConfig|null); + + /** + * Creates a new GoogleSearchTool instance using the specified properties. + * @param [properties] Properties to set + * @returns GoogleSearchTool instance + */ + public static create(properties?: google.cloud.ces.v1.IGoogleSearchTool): google.cloud.ces.v1.GoogleSearchTool; + + /** + * Encodes the specified GoogleSearchTool message. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchTool.verify|verify} messages. + * @param message GoogleSearchTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IGoogleSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoogleSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchTool.verify|verify} messages. + * @param message GoogleSearchTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IGoogleSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoogleSearchTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoogleSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GoogleSearchTool; + + /** + * Decodes a GoogleSearchTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoogleSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GoogleSearchTool; + + /** + * Verifies a GoogleSearchTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoogleSearchTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoogleSearchTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GoogleSearchTool; + + /** + * Creates a plain object from a GoogleSearchTool message. Also converts values to other types if specified. + * @param message GoogleSearchTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.GoogleSearchTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoogleSearchTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoogleSearchTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GoogleSearchTool { + + /** Properties of a PromptConfig. */ + interface IPromptConfig { + + /** PromptConfig textPrompt */ + textPrompt?: (string|null); + + /** PromptConfig voicePrompt */ + voicePrompt?: (string|null); + } + + /** Represents a PromptConfig. */ + class PromptConfig implements IPromptConfig { + + /** + * Constructs a new PromptConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.GoogleSearchTool.IPromptConfig); + + /** PromptConfig textPrompt. */ + public textPrompt: string; + + /** PromptConfig voicePrompt. */ + public voicePrompt: string; + + /** + * Creates a new PromptConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PromptConfig instance + */ + public static create(properties?: google.cloud.ces.v1.GoogleSearchTool.IPromptConfig): google.cloud.ces.v1.GoogleSearchTool.PromptConfig; + + /** + * Encodes the specified PromptConfig message. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchTool.PromptConfig.verify|verify} messages. + * @param message PromptConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.GoogleSearchTool.IPromptConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PromptConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchTool.PromptConfig.verify|verify} messages. + * @param message PromptConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.GoogleSearchTool.IPromptConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PromptConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PromptConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GoogleSearchTool.PromptConfig; + + /** + * Decodes a PromptConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PromptConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GoogleSearchTool.PromptConfig; + + /** + * Verifies a PromptConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PromptConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PromptConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GoogleSearchTool.PromptConfig; + + /** + * Creates a plain object from a PromptConfig message. Also converts values to other types if specified. + * @param message PromptConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.GoogleSearchTool.PromptConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PromptConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PromptConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a McpTool. */ + interface IMcpTool { + + /** McpTool name */ + name?: (string|null); + + /** McpTool description */ + description?: (string|null); + + /** McpTool inputSchema */ + inputSchema?: (google.cloud.ces.v1.ISchema|null); + + /** McpTool outputSchema */ + outputSchema?: (google.cloud.ces.v1.ISchema|null); + + /** McpTool serverAddress */ + serverAddress?: (string|null); + + /** McpTool apiAuthentication */ + apiAuthentication?: (google.cloud.ces.v1.IApiAuthentication|null); + + /** McpTool tlsConfig */ + tlsConfig?: (google.cloud.ces.v1.ITlsConfig|null); + + /** McpTool serviceDirectoryConfig */ + serviceDirectoryConfig?: (google.cloud.ces.v1.IServiceDirectoryConfig|null); + } + + /** Represents a McpTool. */ + class McpTool implements IMcpTool { + + /** + * Constructs a new McpTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IMcpTool); + + /** McpTool name. */ + public name: string; + + /** McpTool description. */ + public description: string; + + /** McpTool inputSchema. */ + public inputSchema?: (google.cloud.ces.v1.ISchema|null); + + /** McpTool outputSchema. */ + public outputSchema?: (google.cloud.ces.v1.ISchema|null); + + /** McpTool serverAddress. */ + public serverAddress: string; + + /** McpTool apiAuthentication. */ + public apiAuthentication?: (google.cloud.ces.v1.IApiAuthentication|null); + + /** McpTool tlsConfig. */ + public tlsConfig?: (google.cloud.ces.v1.ITlsConfig|null); + + /** McpTool serviceDirectoryConfig. */ + public serviceDirectoryConfig?: (google.cloud.ces.v1.IServiceDirectoryConfig|null); + + /** + * Creates a new McpTool instance using the specified properties. + * @param [properties] Properties to set + * @returns McpTool instance + */ + public static create(properties?: google.cloud.ces.v1.IMcpTool): google.cloud.ces.v1.McpTool; + + /** + * Encodes the specified McpTool message. Does not implicitly {@link google.cloud.ces.v1.McpTool.verify|verify} messages. + * @param message McpTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IMcpTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified McpTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.McpTool.verify|verify} messages. + * @param message McpTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IMcpTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a McpTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns McpTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.McpTool; + + /** + * Decodes a McpTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns McpTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.McpTool; + + /** + * Verifies a McpTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a McpTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns McpTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.McpTool; + + /** + * Creates a plain object from a McpTool message. Also converts values to other types if specified. + * @param message McpTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.McpTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this McpTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for McpTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OpenApiTool. */ + interface IOpenApiTool { + + /** OpenApiTool openApiSchema */ + openApiSchema?: (string|null); + + /** OpenApiTool name */ + name?: (string|null); + + /** OpenApiTool description */ + description?: (string|null); + + /** OpenApiTool apiAuthentication */ + apiAuthentication?: (google.cloud.ces.v1.IApiAuthentication|null); + + /** OpenApiTool tlsConfig */ + tlsConfig?: (google.cloud.ces.v1.ITlsConfig|null); + + /** OpenApiTool serviceDirectoryConfig */ + serviceDirectoryConfig?: (google.cloud.ces.v1.IServiceDirectoryConfig|null); + + /** OpenApiTool ignoreUnknownFields */ + ignoreUnknownFields?: (boolean|null); + + /** OpenApiTool url */ + url?: (string|null); + } + + /** Represents an OpenApiTool. */ + class OpenApiTool implements IOpenApiTool { + + /** + * Constructs a new OpenApiTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IOpenApiTool); + + /** OpenApiTool openApiSchema. */ + public openApiSchema: string; + + /** OpenApiTool name. */ + public name: string; + + /** OpenApiTool description. */ + public description: string; + + /** OpenApiTool apiAuthentication. */ + public apiAuthentication?: (google.cloud.ces.v1.IApiAuthentication|null); + + /** OpenApiTool tlsConfig. */ + public tlsConfig?: (google.cloud.ces.v1.ITlsConfig|null); + + /** OpenApiTool serviceDirectoryConfig. */ + public serviceDirectoryConfig?: (google.cloud.ces.v1.IServiceDirectoryConfig|null); + + /** OpenApiTool ignoreUnknownFields. */ + public ignoreUnknownFields: boolean; + + /** OpenApiTool url. */ + public url: string; + + /** + * Creates a new OpenApiTool instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenApiTool instance + */ + public static create(properties?: google.cloud.ces.v1.IOpenApiTool): google.cloud.ces.v1.OpenApiTool; + + /** + * Encodes the specified OpenApiTool message. Does not implicitly {@link google.cloud.ces.v1.OpenApiTool.verify|verify} messages. + * @param message OpenApiTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IOpenApiTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OpenApiTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OpenApiTool.verify|verify} messages. + * @param message OpenApiTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IOpenApiTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenApiTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OpenApiTool; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenApiTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OpenApiTool; + + /** + * Verifies an OpenApiTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OpenApiTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenApiTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OpenApiTool; + + /** + * Creates a plain object from an OpenApiTool message. Also converts values to other types if specified. + * @param message OpenApiTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.OpenApiTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OpenApiTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OpenApiTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonFunction. */ + interface IPythonFunction { + + /** PythonFunction name */ + name?: (string|null); + + /** PythonFunction pythonCode */ + pythonCode?: (string|null); + + /** PythonFunction description */ + description?: (string|null); + } + + /** Represents a PythonFunction. */ + class PythonFunction implements IPythonFunction { + + /** + * Constructs a new PythonFunction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IPythonFunction); + + /** PythonFunction name. */ + public name: string; + + /** PythonFunction pythonCode. */ + public pythonCode: string; + + /** PythonFunction description. */ + public description: string; + + /** + * Creates a new PythonFunction instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonFunction instance + */ + public static create(properties?: google.cloud.ces.v1.IPythonFunction): google.cloud.ces.v1.PythonFunction; + + /** + * Encodes the specified PythonFunction message. Does not implicitly {@link google.cloud.ces.v1.PythonFunction.verify|verify} messages. + * @param message PythonFunction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IPythonFunction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1.PythonFunction.verify|verify} messages. + * @param message PythonFunction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IPythonFunction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonFunction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.PythonFunction; + + /** + * Decodes a PythonFunction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.PythonFunction; + + /** + * Verifies a PythonFunction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonFunction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonFunction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.PythonFunction; + + /** + * Creates a plain object from a PythonFunction message. Also converts values to other types if specified. + * @param message PythonFunction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.PythonFunction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonFunction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonFunction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SystemTool. */ + interface ISystemTool { + + /** SystemTool name */ + name?: (string|null); + + /** SystemTool description */ + description?: (string|null); + } + + /** Represents a SystemTool. */ + class SystemTool implements ISystemTool { + + /** + * Constructs a new SystemTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ISystemTool); + + /** SystemTool name. */ + public name: string; + + /** SystemTool description. */ + public description: string; + + /** + * Creates a new SystemTool instance using the specified properties. + * @param [properties] Properties to set + * @returns SystemTool instance + */ + public static create(properties?: google.cloud.ces.v1.ISystemTool): google.cloud.ces.v1.SystemTool; + + /** + * Encodes the specified SystemTool message. Does not implicitly {@link google.cloud.ces.v1.SystemTool.verify|verify} messages. + * @param message SystemTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ISystemTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SystemTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SystemTool.verify|verify} messages. + * @param message SystemTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ISystemTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SystemTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SystemTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.SystemTool; + + /** + * Decodes a SystemTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SystemTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.SystemTool; + + /** + * Verifies a SystemTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SystemTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SystemTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.SystemTool; + + /** + * Creates a plain object from a SystemTool message. Also converts values to other types if specified. + * @param message SystemTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.SystemTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SystemTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SystemTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WidgetTool. */ + interface IWidgetTool { + + /** WidgetTool parameters */ + parameters?: (google.cloud.ces.v1.ISchema|null); + + /** WidgetTool name */ + name?: (string|null); + + /** WidgetTool description */ + description?: (string|null); + + /** WidgetTool widgetType */ + widgetType?: (google.cloud.ces.v1.WidgetTool.WidgetType|keyof typeof google.cloud.ces.v1.WidgetTool.WidgetType|null); + } + + /** Represents a WidgetTool. */ + class WidgetTool implements IWidgetTool { + + /** + * Constructs a new WidgetTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IWidgetTool); + + /** WidgetTool parameters. */ + public parameters?: (google.cloud.ces.v1.ISchema|null); + + /** WidgetTool name. */ + public name: string; + + /** WidgetTool description. */ + public description: string; + + /** WidgetTool widgetType. */ + public widgetType: (google.cloud.ces.v1.WidgetTool.WidgetType|keyof typeof google.cloud.ces.v1.WidgetTool.WidgetType); + + /** WidgetTool input. */ + public input?: "parameters"; + + /** + * Creates a new WidgetTool instance using the specified properties. + * @param [properties] Properties to set + * @returns WidgetTool instance + */ + public static create(properties?: google.cloud.ces.v1.IWidgetTool): google.cloud.ces.v1.WidgetTool; + + /** + * Encodes the specified WidgetTool message. Does not implicitly {@link google.cloud.ces.v1.WidgetTool.verify|verify} messages. + * @param message WidgetTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IWidgetTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WidgetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.WidgetTool.verify|verify} messages. + * @param message WidgetTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IWidgetTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WidgetTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WidgetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.WidgetTool; + + /** + * Decodes a WidgetTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WidgetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.WidgetTool; + + /** + * Verifies a WidgetTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WidgetTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WidgetTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.WidgetTool; + + /** + * Creates a plain object from a WidgetTool message. Also converts values to other types if specified. + * @param message WidgetTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.WidgetTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WidgetTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WidgetTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WidgetTool { + + /** WidgetType enum. */ + enum WidgetType { + WIDGET_TYPE_UNSPECIFIED = 0, + CUSTOM = 1, + PRODUCT_CAROUSEL = 2, + PRODUCT_DETAILS = 3, + QUICK_ACTIONS = 4, + PRODUCT_COMPARISON = 5, + ADVANCED_PRODUCT_DETAILS = 6, + SHORT_FORM = 7, + OVERALL_SATISFACTION = 8, + ORDER_SUMMARY = 9, + APPOINTMENT_DETAILS = 10 + } + } + + /** Properties of a Toolset. */ + interface IToolset { + + /** Toolset mcpToolset */ + mcpToolset?: (google.cloud.ces.v1.IMcpToolset|null); + + /** Toolset openApiToolset */ + openApiToolset?: (google.cloud.ces.v1.IOpenApiToolset|null); + + /** Toolset connectorToolset */ + connectorToolset?: (google.cloud.ces.v1.IConnectorToolset|null); + + /** Toolset name */ + name?: (string|null); + + /** Toolset displayName */ + displayName?: (string|null); + + /** Toolset description */ + description?: (string|null); + + /** Toolset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Toolset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Toolset etag */ + etag?: (string|null); + + /** Toolset executionType */ + executionType?: (google.cloud.ces.v1.ExecutionType|keyof typeof google.cloud.ces.v1.ExecutionType|null); + + /** Toolset toolFakeConfig */ + toolFakeConfig?: (google.cloud.ces.v1.IToolFakeConfig|null); + } + + /** Represents a Toolset. */ + class Toolset implements IToolset { + + /** + * Constructs a new Toolset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IToolset); + + /** Toolset mcpToolset. */ + public mcpToolset?: (google.cloud.ces.v1.IMcpToolset|null); + + /** Toolset openApiToolset. */ + public openApiToolset?: (google.cloud.ces.v1.IOpenApiToolset|null); + + /** Toolset connectorToolset. */ + public connectorToolset?: (google.cloud.ces.v1.IConnectorToolset|null); + + /** Toolset name. */ + public name: string; + + /** Toolset displayName. */ + public displayName: string; + + /** Toolset description. */ + public description: string; + + /** Toolset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Toolset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Toolset etag. */ + public etag: string; + + /** Toolset executionType. */ + public executionType: (google.cloud.ces.v1.ExecutionType|keyof typeof google.cloud.ces.v1.ExecutionType); + + /** Toolset toolFakeConfig. */ + public toolFakeConfig?: (google.cloud.ces.v1.IToolFakeConfig|null); + + /** Toolset toolsetType. */ + public toolsetType?: ("mcpToolset"|"openApiToolset"|"connectorToolset"); + + /** + * Creates a new Toolset instance using the specified properties. + * @param [properties] Properties to set + * @returns Toolset instance + */ + public static create(properties?: google.cloud.ces.v1.IToolset): google.cloud.ces.v1.Toolset; + + /** + * Encodes the specified Toolset message. Does not implicitly {@link google.cloud.ces.v1.Toolset.verify|verify} messages. + * @param message Toolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Toolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Toolset.verify|verify} messages. + * @param message Toolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Toolset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Toolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Toolset; + + /** + * Decodes a Toolset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Toolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Toolset; + + /** + * Verifies a Toolset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Toolset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Toolset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Toolset; + + /** + * Creates a plain object from a Toolset message. Also converts values to other types if specified. + * @param message Toolset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Toolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Toolset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Toolset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConnectorToolset. */ + interface IConnectorToolset { + + /** ConnectorToolset connection */ + connection?: (string|null); + + /** ConnectorToolset authConfig */ + authConfig?: (google.cloud.ces.v1.IEndUserAuthConfig|null); + + /** ConnectorToolset connectorActions */ + connectorActions?: (google.cloud.ces.v1.IAction[]|null); + } + + /** Represents a ConnectorToolset. */ + class ConnectorToolset implements IConnectorToolset { + + /** + * Constructs a new ConnectorToolset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IConnectorToolset); + + /** ConnectorToolset connection. */ + public connection: string; + + /** ConnectorToolset authConfig. */ + public authConfig?: (google.cloud.ces.v1.IEndUserAuthConfig|null); + + /** ConnectorToolset connectorActions. */ + public connectorActions: google.cloud.ces.v1.IAction[]; + + /** + * Creates a new ConnectorToolset instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectorToolset instance + */ + public static create(properties?: google.cloud.ces.v1.IConnectorToolset): google.cloud.ces.v1.ConnectorToolset; + + /** + * Encodes the specified ConnectorToolset message. Does not implicitly {@link google.cloud.ces.v1.ConnectorToolset.verify|verify} messages. + * @param message ConnectorToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IConnectorToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectorToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ConnectorToolset.verify|verify} messages. + * @param message ConnectorToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IConnectorToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectorToolset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectorToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ConnectorToolset; + + /** + * Decodes a ConnectorToolset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectorToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ConnectorToolset; + + /** + * Verifies a ConnectorToolset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectorToolset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectorToolset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ConnectorToolset; + + /** + * Creates a plain object from a ConnectorToolset message. Also converts values to other types if specified. + * @param message ConnectorToolset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ConnectorToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectorToolset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectorToolset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a McpToolset. */ + interface IMcpToolset { + + /** McpToolset serverAddress */ + serverAddress?: (string|null); + + /** McpToolset apiAuthentication */ + apiAuthentication?: (google.cloud.ces.v1.IApiAuthentication|null); + + /** McpToolset serviceDirectoryConfig */ + serviceDirectoryConfig?: (google.cloud.ces.v1.IServiceDirectoryConfig|null); + + /** McpToolset tlsConfig */ + tlsConfig?: (google.cloud.ces.v1.ITlsConfig|null); + } + + /** Represents a McpToolset. */ + class McpToolset implements IMcpToolset { + + /** + * Constructs a new McpToolset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IMcpToolset); + + /** McpToolset serverAddress. */ + public serverAddress: string; + + /** McpToolset apiAuthentication. */ + public apiAuthentication?: (google.cloud.ces.v1.IApiAuthentication|null); + + /** McpToolset serviceDirectoryConfig. */ + public serviceDirectoryConfig?: (google.cloud.ces.v1.IServiceDirectoryConfig|null); + + /** McpToolset tlsConfig. */ + public tlsConfig?: (google.cloud.ces.v1.ITlsConfig|null); + + /** + * Creates a new McpToolset instance using the specified properties. + * @param [properties] Properties to set + * @returns McpToolset instance + */ + public static create(properties?: google.cloud.ces.v1.IMcpToolset): google.cloud.ces.v1.McpToolset; + + /** + * Encodes the specified McpToolset message. Does not implicitly {@link google.cloud.ces.v1.McpToolset.verify|verify} messages. + * @param message McpToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IMcpToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified McpToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.McpToolset.verify|verify} messages. + * @param message McpToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IMcpToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a McpToolset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns McpToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.McpToolset; + + /** + * Decodes a McpToolset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns McpToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.McpToolset; + + /** + * Verifies a McpToolset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a McpToolset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns McpToolset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.McpToolset; + + /** + * Creates a plain object from a McpToolset message. Also converts values to other types if specified. + * @param message McpToolset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.McpToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this McpToolset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for McpToolset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OpenApiToolset. */ + interface IOpenApiToolset { + + /** OpenApiToolset openApiSchema */ + openApiSchema?: (string|null); + + /** OpenApiToolset apiAuthentication */ + apiAuthentication?: (google.cloud.ces.v1.IApiAuthentication|null); + + /** OpenApiToolset tlsConfig */ + tlsConfig?: (google.cloud.ces.v1.ITlsConfig|null); + + /** OpenApiToolset serviceDirectoryConfig */ + serviceDirectoryConfig?: (google.cloud.ces.v1.IServiceDirectoryConfig|null); + + /** OpenApiToolset ignoreUnknownFields */ + ignoreUnknownFields?: (boolean|null); + + /** OpenApiToolset url */ + url?: (string|null); + } + + /** Represents an OpenApiToolset. */ + class OpenApiToolset implements IOpenApiToolset { + + /** + * Constructs a new OpenApiToolset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IOpenApiToolset); + + /** OpenApiToolset openApiSchema. */ + public openApiSchema: string; + + /** OpenApiToolset apiAuthentication. */ + public apiAuthentication?: (google.cloud.ces.v1.IApiAuthentication|null); + + /** OpenApiToolset tlsConfig. */ + public tlsConfig?: (google.cloud.ces.v1.ITlsConfig|null); + + /** OpenApiToolset serviceDirectoryConfig. */ + public serviceDirectoryConfig?: (google.cloud.ces.v1.IServiceDirectoryConfig|null); + + /** OpenApiToolset ignoreUnknownFields. */ + public ignoreUnknownFields: boolean; + + /** OpenApiToolset url. */ + public url: string; + + /** + * Creates a new OpenApiToolset instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenApiToolset instance + */ + public static create(properties?: google.cloud.ces.v1.IOpenApiToolset): google.cloud.ces.v1.OpenApiToolset; + + /** + * Encodes the specified OpenApiToolset message. Does not implicitly {@link google.cloud.ces.v1.OpenApiToolset.verify|verify} messages. + * @param message OpenApiToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IOpenApiToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OpenApiToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OpenApiToolset.verify|verify} messages. + * @param message OpenApiToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IOpenApiToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OpenApiToolset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenApiToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OpenApiToolset; + + /** + * Decodes an OpenApiToolset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenApiToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OpenApiToolset; + + /** + * Verifies an OpenApiToolset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OpenApiToolset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenApiToolset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OpenApiToolset; + + /** + * Creates a plain object from an OpenApiToolset message. Also converts values to other types if specified. + * @param message OpenApiToolset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.OpenApiToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OpenApiToolset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OpenApiToolset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Changelog. */ + interface IChangelog { + + /** Changelog name */ + name?: (string|null); + + /** Changelog author */ + author?: (string|null); + + /** Changelog displayName */ + displayName?: (string|null); + + /** Changelog description */ + description?: (string|null); + + /** Changelog resource */ + resource?: (string|null); + + /** Changelog resourceType */ + resourceType?: (string|null); + + /** Changelog action */ + action?: (string|null); + + /** Changelog originalResource */ + originalResource?: (google.protobuf.IStruct|null); + + /** Changelog newResource */ + newResource?: (google.protobuf.IStruct|null); + + /** Changelog dependentResources */ + dependentResources?: (google.protobuf.IStruct[]|null); + + /** Changelog createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Changelog sequenceNumber */ + sequenceNumber?: (number|Long|string|null); + } + + /** Represents a Changelog. */ + class Changelog implements IChangelog { + + /** + * Constructs a new Changelog. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IChangelog); + + /** Changelog name. */ + public name: string; + + /** Changelog author. */ + public author: string; + + /** Changelog displayName. */ + public displayName: string; + + /** Changelog description. */ + public description: string; + + /** Changelog resource. */ + public resource: string; + + /** Changelog resourceType. */ + public resourceType: string; + + /** Changelog action. */ + public action: string; + + /** Changelog originalResource. */ + public originalResource?: (google.protobuf.IStruct|null); + + /** Changelog newResource. */ + public newResource?: (google.protobuf.IStruct|null); + + /** Changelog dependentResources. */ + public dependentResources: google.protobuf.IStruct[]; + + /** Changelog createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Changelog sequenceNumber. */ + public sequenceNumber: (number|Long|string); + + /** + * Creates a new Changelog instance using the specified properties. + * @param [properties] Properties to set + * @returns Changelog instance + */ + public static create(properties?: google.cloud.ces.v1.IChangelog): google.cloud.ces.v1.Changelog; + + /** + * Encodes the specified Changelog message. Does not implicitly {@link google.cloud.ces.v1.Changelog.verify|verify} messages. + * @param message Changelog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IChangelog, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Changelog message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Changelog.verify|verify} messages. + * @param message Changelog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IChangelog, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Changelog message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Changelog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Changelog; + + /** + * Decodes a Changelog message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Changelog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Changelog; + + /** + * Verifies a Changelog message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Changelog message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Changelog + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Changelog; + + /** + * Creates a plain object from a Changelog message. Also converts values to other types if specified. + * @param message Changelog + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Changelog, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Changelog to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Changelog + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Conversation. */ + interface IConversation { + + /** Conversation name */ + name?: (string|null); + + /** Conversation startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Conversation endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Conversation turns */ + turns?: (google.cloud.ces.v1.Conversation.ITurn[]|null); + + /** Conversation turnCount */ + turnCount?: (number|null); + + /** Conversation channelType */ + channelType?: (google.cloud.ces.v1.Conversation.ChannelType|keyof typeof google.cloud.ces.v1.Conversation.ChannelType|null); + + /** Conversation source */ + source?: (google.cloud.ces.v1.Conversation.Source|keyof typeof google.cloud.ces.v1.Conversation.Source|null); + + /** Conversation inputTypes */ + inputTypes?: (google.cloud.ces.v1.Conversation.InputType[]|null); + + /** Conversation entryAgent */ + entryAgent?: (string|null); + + /** Conversation deployment */ + deployment?: (string|null); + + /** Conversation appVersion */ + appVersion?: (string|null); + + /** Conversation languageCode */ + languageCode?: (string|null); + + /** Conversation messages */ + messages?: (google.cloud.ces.v1.IMessage[]|null); + } + + /** Represents a Conversation. */ + class Conversation implements IConversation { + + /** + * Constructs a new Conversation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IConversation); + + /** Conversation name. */ + public name: string; + + /** Conversation startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Conversation endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Conversation turns. */ + public turns: google.cloud.ces.v1.Conversation.ITurn[]; + + /** Conversation turnCount. */ + public turnCount: number; + + /** Conversation channelType. */ + public channelType: (google.cloud.ces.v1.Conversation.ChannelType|keyof typeof google.cloud.ces.v1.Conversation.ChannelType); + + /** Conversation source. */ + public source: (google.cloud.ces.v1.Conversation.Source|keyof typeof google.cloud.ces.v1.Conversation.Source); + + /** Conversation inputTypes. */ + public inputTypes: google.cloud.ces.v1.Conversation.InputType[]; + + /** Conversation entryAgent. */ + public entryAgent: string; + + /** Conversation deployment. */ + public deployment: string; + + /** Conversation appVersion. */ + public appVersion: string; + + /** Conversation languageCode. */ + public languageCode: string; + + /** Conversation messages. */ + public messages: google.cloud.ces.v1.IMessage[]; + + /** + * Creates a new Conversation instance using the specified properties. + * @param [properties] Properties to set + * @returns Conversation instance + */ + public static create(properties?: google.cloud.ces.v1.IConversation): google.cloud.ces.v1.Conversation; + + /** + * Encodes the specified Conversation message. Does not implicitly {@link google.cloud.ces.v1.Conversation.verify|verify} messages. + * @param message Conversation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Conversation message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Conversation.verify|verify} messages. + * @param message Conversation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Conversation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Conversation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Conversation; + + /** + * Decodes a Conversation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Conversation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Conversation; + + /** + * Verifies a Conversation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Conversation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Conversation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Conversation; + + /** + * Creates a plain object from a Conversation message. Also converts values to other types if specified. + * @param message Conversation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Conversation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Conversation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Conversation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Conversation { + + /** Properties of a Turn. */ + interface ITurn { + + /** Turn messages */ + messages?: (google.cloud.ces.v1.IMessage[]|null); + + /** Turn rootSpan */ + rootSpan?: (google.cloud.ces.v1.ISpan|null); + } + + /** Represents a Turn. */ + class Turn implements ITurn { + + /** + * Constructs a new Turn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.Conversation.ITurn); + + /** Turn messages. */ + public messages: google.cloud.ces.v1.IMessage[]; + + /** Turn rootSpan. */ + public rootSpan?: (google.cloud.ces.v1.ISpan|null); + + /** + * Creates a new Turn instance using the specified properties. + * @param [properties] Properties to set + * @returns Turn instance + */ + public static create(properties?: google.cloud.ces.v1.Conversation.ITurn): google.cloud.ces.v1.Conversation.Turn; + + /** + * Encodes the specified Turn message. Does not implicitly {@link google.cloud.ces.v1.Conversation.Turn.verify|verify} messages. + * @param message Turn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.Conversation.ITurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Turn message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Conversation.Turn.verify|verify} messages. + * @param message Turn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.Conversation.ITurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Turn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Conversation.Turn; + + /** + * Decodes a Turn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Conversation.Turn; + + /** + * Verifies a Turn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Turn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Turn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Conversation.Turn; + + /** + * Creates a plain object from a Turn message. Also converts values to other types if specified. + * @param message Turn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Conversation.Turn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Turn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Turn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ChannelType enum. */ + enum ChannelType { + CHANNEL_TYPE_UNSPECIFIED = 0, + TEXT = 1, + AUDIO = 2, + MULTIMODAL = 3 + } + + /** Source enum. */ + enum Source { + SOURCE_UNSPECIFIED = 0, + LIVE = 1, + SIMULATOR = 2, + EVAL = 3 + } + + /** InputType enum. */ + enum InputType { + INPUT_TYPE_UNSPECIFIED = 0, + INPUT_TYPE_TEXT = 1, + INPUT_TYPE_AUDIO = 2, + INPUT_TYPE_IMAGE = 3, + INPUT_TYPE_BLOB = 4, + INPUT_TYPE_TOOL_RESPONSE = 5, + INPUT_TYPE_VARIABLES = 6 + } + } + + /** Properties of a Deployment. */ + interface IDeployment { + + /** Deployment name */ + name?: (string|null); + + /** Deployment displayName */ + displayName?: (string|null); + + /** Deployment appVersion */ + appVersion?: (string|null); + + /** Deployment channelProfile */ + channelProfile?: (google.cloud.ces.v1.IChannelProfile|null); + + /** Deployment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Deployment updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Deployment etag */ + etag?: (string|null); + } + + /** Represents a Deployment. */ + class Deployment implements IDeployment { + + /** + * Constructs a new Deployment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IDeployment); + + /** Deployment name. */ + public name: string; + + /** Deployment displayName. */ + public displayName: string; + + /** Deployment appVersion. */ + public appVersion: string; + + /** Deployment channelProfile. */ + public channelProfile?: (google.cloud.ces.v1.IChannelProfile|null); + + /** Deployment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Deployment updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Deployment etag. */ + public etag: string; + + /** + * Creates a new Deployment instance using the specified properties. + * @param [properties] Properties to set + * @returns Deployment instance + */ + public static create(properties?: google.cloud.ces.v1.IDeployment): google.cloud.ces.v1.Deployment; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.ces.v1.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Deployment; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Deployment; + + /** + * Verifies a Deployment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Deployment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Deployment; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @param message Deployment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Deployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Deployment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Deployment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Omnichannel. */ + interface IOmnichannel { + + /** Omnichannel name */ + name?: (string|null); + + /** Omnichannel displayName */ + displayName?: (string|null); + + /** Omnichannel description */ + description?: (string|null); + + /** Omnichannel createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Omnichannel updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Omnichannel etag */ + etag?: (string|null); + + /** Omnichannel integrationConfig */ + integrationConfig?: (google.cloud.ces.v1.IOmnichannelIntegrationConfig|null); + } + + /** Represents an Omnichannel. */ + class Omnichannel implements IOmnichannel { + + /** + * Constructs a new Omnichannel. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IOmnichannel); + + /** Omnichannel name. */ + public name: string; + + /** Omnichannel displayName. */ + public displayName: string; + + /** Omnichannel description. */ + public description: string; + + /** Omnichannel createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Omnichannel updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Omnichannel etag. */ + public etag: string; + + /** Omnichannel integrationConfig. */ + public integrationConfig?: (google.cloud.ces.v1.IOmnichannelIntegrationConfig|null); + + /** + * Creates a new Omnichannel instance using the specified properties. + * @param [properties] Properties to set + * @returns Omnichannel instance + */ + public static create(properties?: google.cloud.ces.v1.IOmnichannel): google.cloud.ces.v1.Omnichannel; + + /** + * Encodes the specified Omnichannel message. Does not implicitly {@link google.cloud.ces.v1.Omnichannel.verify|verify} messages. + * @param message Omnichannel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IOmnichannel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Omnichannel message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Omnichannel.verify|verify} messages. + * @param message Omnichannel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IOmnichannel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Omnichannel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Omnichannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Omnichannel; + + /** + * Decodes an Omnichannel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Omnichannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Omnichannel; + + /** + * Verifies an Omnichannel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Omnichannel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Omnichannel + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Omnichannel; + + /** + * Creates a plain object from an Omnichannel message. Also converts values to other types if specified. + * @param message Omnichannel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Omnichannel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Omnichannel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Omnichannel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OmnichannelIntegrationConfig. */ + interface IOmnichannelIntegrationConfig { + + /** OmnichannelIntegrationConfig channelConfigs */ + channelConfigs?: ({ [k: string]: google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig }|null); + + /** OmnichannelIntegrationConfig subscriberConfigs */ + subscriberConfigs?: ({ [k: string]: google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig }|null); + + /** OmnichannelIntegrationConfig routingConfigs */ + routingConfigs?: ({ [k: string]: google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig }|null); + } + + /** Represents an OmnichannelIntegrationConfig. */ + class OmnichannelIntegrationConfig implements IOmnichannelIntegrationConfig { + + /** + * Constructs a new OmnichannelIntegrationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IOmnichannelIntegrationConfig); + + /** OmnichannelIntegrationConfig channelConfigs. */ + public channelConfigs: { [k: string]: google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig }; + + /** OmnichannelIntegrationConfig subscriberConfigs. */ + public subscriberConfigs: { [k: string]: google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig }; + + /** OmnichannelIntegrationConfig routingConfigs. */ + public routingConfigs: { [k: string]: google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig }; + + /** + * Creates a new OmnichannelIntegrationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OmnichannelIntegrationConfig instance + */ + public static create(properties?: google.cloud.ces.v1.IOmnichannelIntegrationConfig): google.cloud.ces.v1.OmnichannelIntegrationConfig; + + /** + * Encodes the specified OmnichannelIntegrationConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.verify|verify} messages. + * @param message OmnichannelIntegrationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IOmnichannelIntegrationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OmnichannelIntegrationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.verify|verify} messages. + * @param message OmnichannelIntegrationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IOmnichannelIntegrationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OmnichannelIntegrationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OmnichannelIntegrationConfig; + + /** + * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OmnichannelIntegrationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OmnichannelIntegrationConfig; + + /** + * Verifies an OmnichannelIntegrationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OmnichannelIntegrationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OmnichannelIntegrationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OmnichannelIntegrationConfig; + + /** + * Creates a plain object from an OmnichannelIntegrationConfig message. Also converts values to other types if specified. + * @param message OmnichannelIntegrationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.OmnichannelIntegrationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OmnichannelIntegrationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OmnichannelIntegrationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OmnichannelIntegrationConfig { + + /** Properties of a ChannelConfig. */ + interface IChannelConfig { + + /** ChannelConfig whatsappConfig */ + whatsappConfig?: (google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig|null); + } + + /** Represents a ChannelConfig. */ + class ChannelConfig implements IChannelConfig { + + /** + * Constructs a new ChannelConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig); + + /** ChannelConfig whatsappConfig. */ + public whatsappConfig?: (google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig|null); + + /** ChannelConfig channelConfig. */ + public channelConfig?: "whatsappConfig"; + + /** + * Creates a new ChannelConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ChannelConfig instance + */ + public static create(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig): google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig; + + /** + * Encodes the specified ChannelConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. + * @param message ChannelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChannelConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. + * @param message ChannelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChannelConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChannelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig; + + /** + * Decodes a ChannelConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChannelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig; + + /** + * Verifies a ChannelConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChannelConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChannelConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig; + + /** + * Creates a plain object from a ChannelConfig message. Also converts values to other types if specified. + * @param message ChannelConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChannelConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChannelConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WhatsappConfig. */ + interface IWhatsappConfig { + + /** WhatsappConfig phoneNumberId */ + phoneNumberId?: (string|null); + + /** WhatsappConfig phoneNumber */ + phoneNumber?: (string|null); + + /** WhatsappConfig whatsappBusinessAccountId */ + whatsappBusinessAccountId?: (string|null); + + /** WhatsappConfig webhookVerifyToken */ + webhookVerifyToken?: (string|null); + + /** WhatsappConfig whatsappBusinessToken */ + whatsappBusinessToken?: (string|null); + + /** WhatsappConfig metaBusinessPortfolioId */ + metaBusinessPortfolioId?: (string|null); + } + + /** Represents a WhatsappConfig. */ + class WhatsappConfig implements IWhatsappConfig { + + /** + * Constructs a new WhatsappConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig); + + /** WhatsappConfig phoneNumberId. */ + public phoneNumberId: string; + + /** WhatsappConfig phoneNumber. */ + public phoneNumber: string; + + /** WhatsappConfig whatsappBusinessAccountId. */ + public whatsappBusinessAccountId: string; + + /** WhatsappConfig webhookVerifyToken. */ + public webhookVerifyToken: string; + + /** WhatsappConfig whatsappBusinessToken. */ + public whatsappBusinessToken: string; + + /** WhatsappConfig metaBusinessPortfolioId. */ + public metaBusinessPortfolioId: string; + + /** + * Creates a new WhatsappConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns WhatsappConfig instance + */ + public static create(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig): google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig; + + /** + * Encodes the specified WhatsappConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. + * @param message WhatsappConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WhatsappConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. + * @param message WhatsappConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WhatsappConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WhatsappConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig; + + /** + * Decodes a WhatsappConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WhatsappConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig; + + /** + * Verifies a WhatsappConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WhatsappConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WhatsappConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig; + + /** + * Creates a plain object from a WhatsappConfig message. Also converts values to other types if specified. + * @param message WhatsappConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WhatsappConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WhatsappConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SubscriberConfig. */ + interface ISubscriberConfig { + + /** SubscriberConfig cesAppConfig */ + cesAppConfig?: (google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig|null); + } + + /** Represents a SubscriberConfig. */ + class SubscriberConfig implements ISubscriberConfig { + + /** + * Constructs a new SubscriberConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig); + + /** SubscriberConfig cesAppConfig. */ + public cesAppConfig?: (google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig|null); + + /** SubscriberConfig subscriberConfig. */ + public subscriberConfig?: "cesAppConfig"; + + /** + * Creates a new SubscriberConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SubscriberConfig instance + */ + public static create(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig): google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig; + + /** + * Encodes the specified SubscriberConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. + * @param message SubscriberConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubscriberConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. + * @param message SubscriberConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubscriberConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubscriberConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig; + + /** + * Decodes a SubscriberConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubscriberConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig; + + /** + * Verifies a SubscriberConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubscriberConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubscriberConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig; + + /** + * Creates a plain object from a SubscriberConfig message. Also converts values to other types if specified. + * @param message SubscriberConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubscriberConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubscriberConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CesAppConfig. */ + interface ICesAppConfig { + + /** CesAppConfig app */ + app?: (string|null); + } + + /** Represents a CesAppConfig. */ + class CesAppConfig implements ICesAppConfig { + + /** + * Constructs a new CesAppConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig); + + /** CesAppConfig app. */ + public app: string; + + /** + * Creates a new CesAppConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CesAppConfig instance + */ + public static create(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig): google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig; + + /** + * Encodes the specified CesAppConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. + * @param message CesAppConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CesAppConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. + * @param message CesAppConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CesAppConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CesAppConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig; + + /** + * Decodes a CesAppConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CesAppConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig; + + /** + * Verifies a CesAppConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CesAppConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CesAppConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig; + + /** + * Creates a plain object from a CesAppConfig message. Also converts values to other types if specified. + * @param message CesAppConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CesAppConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CesAppConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoutingConfig. */ + interface IRoutingConfig { + + /** RoutingConfig subscriberKey */ + subscriberKey?: (string|null); + } + + /** Represents a RoutingConfig. */ + class RoutingConfig implements IRoutingConfig { + + /** + * Constructs a new RoutingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig); + + /** RoutingConfig subscriberKey. */ + public subscriberKey: string; + + /** + * Creates a new RoutingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutingConfig instance + */ + public static create(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig): google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig; + + /** + * Encodes the specified RoutingConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. + * @param message RoutingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. + * @param message RoutingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig; + + /** + * Decodes a RoutingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig; + + /** + * Verifies a RoutingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig; + + /** + * Creates a plain object from a RoutingConfig message. Also converts values to other types if specified. + * @param message RoutingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OmnichannelOperationMetadata. */ + interface IOmnichannelOperationMetadata { + + /** OmnichannelOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OmnichannelOperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OmnichannelOperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OmnichannelOperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + } + + /** Represents an OmnichannelOperationMetadata. */ + class OmnichannelOperationMetadata implements IOmnichannelOperationMetadata { + + /** + * Constructs a new OmnichannelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IOmnichannelOperationMetadata); + + /** OmnichannelOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OmnichannelOperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OmnichannelOperationMetadata statusMessage. */ + public statusMessage: string; + + /** OmnichannelOperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** + * Creates a new OmnichannelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OmnichannelOperationMetadata instance + */ + public static create(properties?: google.cloud.ces.v1.IOmnichannelOperationMetadata): google.cloud.ces.v1.OmnichannelOperationMetadata; + + /** + * Encodes the specified OmnichannelOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelOperationMetadata.verify|verify} messages. + * @param message OmnichannelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IOmnichannelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OmnichannelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelOperationMetadata.verify|verify} messages. + * @param message OmnichannelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IOmnichannelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OmnichannelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OmnichannelOperationMetadata; + + /** + * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OmnichannelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OmnichannelOperationMetadata; + + /** + * Verifies an OmnichannelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OmnichannelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OmnichannelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OmnichannelOperationMetadata; + + /** + * Creates a plain object from an OmnichannelOperationMetadata message. Also converts values to other types if specified. + * @param message OmnichannelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.OmnichannelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OmnichannelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OmnichannelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoogleSearchSuggestions. */ + interface IGoogleSearchSuggestions { + + /** GoogleSearchSuggestions htmls */ + htmls?: (string[]|null); + + /** GoogleSearchSuggestions webSearchQueries */ + webSearchQueries?: (google.cloud.ces.v1.IWebSearchQuery[]|null); + } + + /** Represents a GoogleSearchSuggestions. */ + class GoogleSearchSuggestions implements IGoogleSearchSuggestions { + + /** + * Constructs a new GoogleSearchSuggestions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IGoogleSearchSuggestions); + + /** GoogleSearchSuggestions htmls. */ + public htmls: string[]; + + /** GoogleSearchSuggestions webSearchQueries. */ + public webSearchQueries: google.cloud.ces.v1.IWebSearchQuery[]; + + /** + * Creates a new GoogleSearchSuggestions instance using the specified properties. + * @param [properties] Properties to set + * @returns GoogleSearchSuggestions instance + */ + public static create(properties?: google.cloud.ces.v1.IGoogleSearchSuggestions): google.cloud.ces.v1.GoogleSearchSuggestions; + + /** + * Encodes the specified GoogleSearchSuggestions message. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchSuggestions.verify|verify} messages. + * @param message GoogleSearchSuggestions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IGoogleSearchSuggestions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoogleSearchSuggestions message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchSuggestions.verify|verify} messages. + * @param message GoogleSearchSuggestions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IGoogleSearchSuggestions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoogleSearchSuggestions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoogleSearchSuggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GoogleSearchSuggestions; + + /** + * Decodes a GoogleSearchSuggestions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoogleSearchSuggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GoogleSearchSuggestions; + + /** + * Verifies a GoogleSearchSuggestions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoogleSearchSuggestions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoogleSearchSuggestions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GoogleSearchSuggestions; + + /** + * Creates a plain object from a GoogleSearchSuggestions message. Also converts values to other types if specified. + * @param message GoogleSearchSuggestions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.GoogleSearchSuggestions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoogleSearchSuggestions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoogleSearchSuggestions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WebSearchQuery. */ + interface IWebSearchQuery { + + /** WebSearchQuery query */ + query?: (string|null); + + /** WebSearchQuery uri */ + uri?: (string|null); + } + + /** Represents a WebSearchQuery. */ + class WebSearchQuery implements IWebSearchQuery { + + /** + * Constructs a new WebSearchQuery. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IWebSearchQuery); + + /** WebSearchQuery query. */ + public query: string; + + /** WebSearchQuery uri. */ + public uri: string; + + /** + * Creates a new WebSearchQuery instance using the specified properties. + * @param [properties] Properties to set + * @returns WebSearchQuery instance + */ + public static create(properties?: google.cloud.ces.v1.IWebSearchQuery): google.cloud.ces.v1.WebSearchQuery; + + /** + * Encodes the specified WebSearchQuery message. Does not implicitly {@link google.cloud.ces.v1.WebSearchQuery.verify|verify} messages. + * @param message WebSearchQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IWebSearchQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebSearchQuery message, length delimited. Does not implicitly {@link google.cloud.ces.v1.WebSearchQuery.verify|verify} messages. + * @param message WebSearchQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IWebSearchQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebSearchQuery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebSearchQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.WebSearchQuery; + + /** + * Decodes a WebSearchQuery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebSearchQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.WebSearchQuery; + + /** + * Verifies a WebSearchQuery message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebSearchQuery message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebSearchQuery + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.WebSearchQuery; + + /** + * Creates a plain object from a WebSearchQuery message. Also converts values to other types if specified. + * @param message WebSearchQuery + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.WebSearchQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebSearchQuery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebSearchQuery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a SessionService */ + class SessionService extends $protobuf.rpc.Service { + + /** + * Constructs a new SessionService 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 SessionService 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): SessionService; + + /** + * Calls RunSession. + * @param request RunSessionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RunSessionResponse + */ + public runSession(request: google.cloud.ces.v1.IRunSessionRequest, callback: google.cloud.ces.v1.SessionService.RunSessionCallback): void; + + /** + * Calls RunSession. + * @param request RunSessionRequest message or plain object + * @returns Promise + */ + public runSession(request: google.cloud.ces.v1.IRunSessionRequest): Promise; + + /** + * Calls BidiRunSession. + * @param request BidiSessionClientMessage message or plain object + * @param callback Node-style callback called with the error, if any, and BidiSessionServerMessage + */ + public bidiRunSession(request: google.cloud.ces.v1.IBidiSessionClientMessage, callback: google.cloud.ces.v1.SessionService.BidiRunSessionCallback): void; + + /** + * Calls BidiRunSession. + * @param request BidiSessionClientMessage message or plain object + * @returns Promise + */ + public bidiRunSession(request: google.cloud.ces.v1.IBidiSessionClientMessage): Promise; + } + + namespace SessionService { + + /** + * Callback as used by {@link google.cloud.ces.v1.SessionService|runSession}. + * @param error Error, if any + * @param [response] RunSessionResponse + */ + type RunSessionCallback = (error: (Error|null), response?: google.cloud.ces.v1.RunSessionResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.SessionService|bidiRunSession}. + * @param error Error, if any + * @param [response] BidiSessionServerMessage + */ + type BidiRunSessionCallback = (error: (Error|null), response?: google.cloud.ces.v1.BidiSessionServerMessage) => void; + } + + /** AudioEncoding enum. */ + enum AudioEncoding { + AUDIO_ENCODING_UNSPECIFIED = 0, + LINEAR16 = 1, + MULAW = 2, + ALAW = 3 + } + + /** Properties of an InputAudioConfig. */ + interface IInputAudioConfig { + + /** InputAudioConfig audioEncoding */ + audioEncoding?: (google.cloud.ces.v1.AudioEncoding|keyof typeof google.cloud.ces.v1.AudioEncoding|null); + + /** InputAudioConfig sampleRateHertz */ + sampleRateHertz?: (number|null); + + /** InputAudioConfig noiseSuppressionLevel */ + noiseSuppressionLevel?: (string|null); + } + + /** Represents an InputAudioConfig. */ + class InputAudioConfig implements IInputAudioConfig { + + /** + * Constructs a new InputAudioConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IInputAudioConfig); + + /** InputAudioConfig audioEncoding. */ + public audioEncoding: (google.cloud.ces.v1.AudioEncoding|keyof typeof google.cloud.ces.v1.AudioEncoding); + + /** InputAudioConfig sampleRateHertz. */ + public sampleRateHertz: number; + + /** InputAudioConfig noiseSuppressionLevel. */ + public noiseSuppressionLevel: string; + + /** + * Creates a new InputAudioConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputAudioConfig instance + */ + public static create(properties?: google.cloud.ces.v1.IInputAudioConfig): google.cloud.ces.v1.InputAudioConfig; + + /** + * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1.InputAudioConfig.verify|verify} messages. + * @param message InputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.InputAudioConfig.verify|verify} messages. + * @param message InputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.InputAudioConfig; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.InputAudioConfig; + + /** + * Verifies an InputAudioConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputAudioConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.InputAudioConfig; + + /** + * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. + * @param message InputAudioConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.InputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputAudioConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputAudioConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutputAudioConfig. */ + interface IOutputAudioConfig { + + /** OutputAudioConfig audioEncoding */ + audioEncoding?: (google.cloud.ces.v1.AudioEncoding|keyof typeof google.cloud.ces.v1.AudioEncoding|null); + + /** OutputAudioConfig sampleRateHertz */ + sampleRateHertz?: (number|null); + } + + /** Represents an OutputAudioConfig. */ + class OutputAudioConfig implements IOutputAudioConfig { + + /** + * Constructs a new OutputAudioConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IOutputAudioConfig); + + /** OutputAudioConfig audioEncoding. */ + public audioEncoding: (google.cloud.ces.v1.AudioEncoding|keyof typeof google.cloud.ces.v1.AudioEncoding); + + /** OutputAudioConfig sampleRateHertz. */ + public sampleRateHertz: number; + + /** + * Creates a new OutputAudioConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputAudioConfig instance + */ + public static create(properties?: google.cloud.ces.v1.IOutputAudioConfig): google.cloud.ces.v1.OutputAudioConfig; + + /** + * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1.OutputAudioConfig.verify|verify} messages. + * @param message OutputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OutputAudioConfig.verify|verify} messages. + * @param message OutputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OutputAudioConfig; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OutputAudioConfig; + + /** + * Verifies an OutputAudioConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputAudioConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OutputAudioConfig; + + /** + * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. + * @param message OutputAudioConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.OutputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputAudioConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputAudioConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SessionConfig. */ + interface ISessionConfig { + + /** SessionConfig session */ + session?: (string|null); + + /** SessionConfig inputAudioConfig */ + inputAudioConfig?: (google.cloud.ces.v1.IInputAudioConfig|null); + + /** SessionConfig outputAudioConfig */ + outputAudioConfig?: (google.cloud.ces.v1.IOutputAudioConfig|null); + + /** SessionConfig historicalContexts */ + historicalContexts?: (google.cloud.ces.v1.IMessage[]|null); + + /** SessionConfig entryAgent */ + entryAgent?: (string|null); + + /** SessionConfig deployment */ + deployment?: (string|null); + + /** SessionConfig timeZone */ + timeZone?: (string|null); + + /** SessionConfig remoteDialogflowQueryParameters */ + remoteDialogflowQueryParameters?: (google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters|null); + } + + /** Represents a SessionConfig. */ + class SessionConfig implements ISessionConfig { + + /** + * Constructs a new SessionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ISessionConfig); + + /** SessionConfig session. */ + public session: string; + + /** SessionConfig inputAudioConfig. */ + public inputAudioConfig?: (google.cloud.ces.v1.IInputAudioConfig|null); + + /** SessionConfig outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.ces.v1.IOutputAudioConfig|null); + + /** SessionConfig historicalContexts. */ + public historicalContexts: google.cloud.ces.v1.IMessage[]; + + /** SessionConfig entryAgent. */ + public entryAgent: string; + + /** SessionConfig deployment. */ + public deployment: string; + + /** SessionConfig timeZone. */ + public timeZone: string; + + /** SessionConfig remoteDialogflowQueryParameters. */ + public remoteDialogflowQueryParameters?: (google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters|null); + + /** + * Creates a new SessionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionConfig instance + */ + public static create(properties?: google.cloud.ces.v1.ISessionConfig): google.cloud.ces.v1.SessionConfig; + + /** + * Encodes the specified SessionConfig message. Does not implicitly {@link google.cloud.ces.v1.SessionConfig.verify|verify} messages. + * @param message SessionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ISessionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionConfig.verify|verify} messages. + * @param message SessionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ISessionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.SessionConfig; + + /** + * Decodes a SessionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.SessionConfig; + + /** + * Verifies a SessionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SessionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.SessionConfig; + + /** + * Creates a plain object from a SessionConfig message. Also converts values to other types if specified. + * @param message SessionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.SessionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SessionConfig { + + /** Properties of a RemoteDialogflowQueryParameters. */ + interface IRemoteDialogflowQueryParameters { + + /** RemoteDialogflowQueryParameters webhookHeaders */ + webhookHeaders?: ({ [k: string]: string }|null); + + /** RemoteDialogflowQueryParameters payload */ + payload?: (google.protobuf.IStruct|null); + + /** RemoteDialogflowQueryParameters endUserMetadata */ + endUserMetadata?: (google.protobuf.IStruct|null); + } + + /** Represents a RemoteDialogflowQueryParameters. */ + class RemoteDialogflowQueryParameters implements IRemoteDialogflowQueryParameters { + + /** + * Constructs a new RemoteDialogflowQueryParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters); + + /** RemoteDialogflowQueryParameters webhookHeaders. */ + public webhookHeaders: { [k: string]: string }; + + /** RemoteDialogflowQueryParameters payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** RemoteDialogflowQueryParameters endUserMetadata. */ + public endUserMetadata?: (google.protobuf.IStruct|null); + + /** + * Creates a new RemoteDialogflowQueryParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoteDialogflowQueryParameters instance + */ + public static create(properties?: google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters): google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters; + + /** + * Encodes the specified RemoteDialogflowQueryParameters message. Does not implicitly {@link google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. + * @param message RemoteDialogflowQueryParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoteDialogflowQueryParameters message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. + * @param message RemoteDialogflowQueryParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoteDialogflowQueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters; + + /** + * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoteDialogflowQueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters; + + /** + * Verifies a RemoteDialogflowQueryParameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoteDialogflowQueryParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoteDialogflowQueryParameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters; + + /** + * Creates a plain object from a RemoteDialogflowQueryParameters message. Also converts values to other types if specified. + * @param message RemoteDialogflowQueryParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoteDialogflowQueryParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoteDialogflowQueryParameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ToolCalls. */ + interface IToolCalls { + + /** ToolCalls toolCalls */ + toolCalls?: (google.cloud.ces.v1.IToolCall[]|null); + } + + /** Represents a ToolCalls. */ + class ToolCalls implements IToolCalls { + + /** + * Constructs a new ToolCalls. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IToolCalls); + + /** ToolCalls toolCalls. */ + public toolCalls: google.cloud.ces.v1.IToolCall[]; + + /** + * Creates a new ToolCalls instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolCalls instance + */ + public static create(properties?: google.cloud.ces.v1.IToolCalls): google.cloud.ces.v1.ToolCalls; + + /** + * Encodes the specified ToolCalls message. Does not implicitly {@link google.cloud.ces.v1.ToolCalls.verify|verify} messages. + * @param message ToolCalls message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IToolCalls, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolCalls message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolCalls.verify|verify} messages. + * @param message ToolCalls message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IToolCalls, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolCalls message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolCalls + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ToolCalls; + + /** + * Decodes a ToolCalls message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolCalls + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ToolCalls; + + /** + * Verifies a ToolCalls message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolCalls message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolCalls + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ToolCalls; + + /** + * Creates a plain object from a ToolCalls message. Also converts values to other types if specified. + * @param message ToolCalls + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ToolCalls, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolCalls to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolCalls + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolResponses. */ + interface IToolResponses { + + /** ToolResponses toolResponses */ + toolResponses?: (google.cloud.ces.v1.IToolResponse[]|null); + } + + /** Represents a ToolResponses. */ + class ToolResponses implements IToolResponses { + + /** + * Constructs a new ToolResponses. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IToolResponses); + + /** ToolResponses toolResponses. */ + public toolResponses: google.cloud.ces.v1.IToolResponse[]; + + /** + * Creates a new ToolResponses instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolResponses instance + */ + public static create(properties?: google.cloud.ces.v1.IToolResponses): google.cloud.ces.v1.ToolResponses; + + /** + * Encodes the specified ToolResponses message. Does not implicitly {@link google.cloud.ces.v1.ToolResponses.verify|verify} messages. + * @param message ToolResponses message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IToolResponses, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolResponses message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolResponses.verify|verify} messages. + * @param message ToolResponses message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IToolResponses, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolResponses message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ToolResponses; + + /** + * Decodes a ToolResponses message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ToolResponses; + + /** + * Verifies a ToolResponses message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolResponses message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolResponses + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ToolResponses; + + /** + * Creates a plain object from a ToolResponses message. Also converts values to other types if specified. + * @param message ToolResponses + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ToolResponses, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolResponses to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolResponses + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Citations. */ + interface ICitations { + + /** Citations citedChunks */ + citedChunks?: (google.cloud.ces.v1.Citations.ICitedChunk[]|null); + } + + /** Represents a Citations. */ + class Citations implements ICitations { + + /** + * Constructs a new Citations. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ICitations); + + /** Citations citedChunks. */ + public citedChunks: google.cloud.ces.v1.Citations.ICitedChunk[]; + + /** + * Creates a new Citations instance using the specified properties. + * @param [properties] Properties to set + * @returns Citations instance + */ + public static create(properties?: google.cloud.ces.v1.ICitations): google.cloud.ces.v1.Citations; + + /** + * Encodes the specified Citations message. Does not implicitly {@link google.cloud.ces.v1.Citations.verify|verify} messages. + * @param message Citations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ICitations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Citations message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Citations.verify|verify} messages. + * @param message Citations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ICitations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Citations message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Citations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Citations; + + /** + * Decodes a Citations message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Citations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Citations; + + /** + * Verifies a Citations message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Citations message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Citations + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Citations; + + /** + * Creates a plain object from a Citations message. Also converts values to other types if specified. + * @param message Citations + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Citations, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Citations to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Citations + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Citations { + + /** Properties of a CitedChunk. */ + interface ICitedChunk { + + /** CitedChunk uri */ + uri?: (string|null); + + /** CitedChunk title */ + title?: (string|null); + + /** CitedChunk text */ + text?: (string|null); + } + + /** Represents a CitedChunk. */ + class CitedChunk implements ICitedChunk { + + /** + * Constructs a new CitedChunk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.Citations.ICitedChunk); + + /** CitedChunk uri. */ + public uri: string; + + /** CitedChunk title. */ + public title: string; + + /** CitedChunk text. */ + public text: string; + + /** + * Creates a new CitedChunk instance using the specified properties. + * @param [properties] Properties to set + * @returns CitedChunk instance + */ + public static create(properties?: google.cloud.ces.v1.Citations.ICitedChunk): google.cloud.ces.v1.Citations.CitedChunk; + + /** + * Encodes the specified CitedChunk message. Does not implicitly {@link google.cloud.ces.v1.Citations.CitedChunk.verify|verify} messages. + * @param message CitedChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.Citations.ICitedChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CitedChunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Citations.CitedChunk.verify|verify} messages. + * @param message CitedChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.Citations.ICitedChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CitedChunk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CitedChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Citations.CitedChunk; + + /** + * Decodes a CitedChunk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CitedChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Citations.CitedChunk; + + /** + * Verifies a CitedChunk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CitedChunk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CitedChunk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Citations.CitedChunk; + + /** + * Creates a plain object from a CitedChunk message. Also converts values to other types if specified. + * @param message CitedChunk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Citations.CitedChunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CitedChunk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CitedChunk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an Event. */ + interface IEvent { + + /** Event event */ + event?: (string|null); + } + + /** Represents an Event. */ + class Event implements IEvent { + + /** + * Constructs a new Event. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IEvent); + + /** Event event. */ + public event: string; + + /** + * Creates a new Event instance using the specified properties. + * @param [properties] Properties to set + * @returns Event instance + */ + public static create(properties?: google.cloud.ces.v1.IEvent): google.cloud.ces.v1.Event; + + /** + * Encodes the specified Event message. Does not implicitly {@link google.cloud.ces.v1.Event.verify|verify} messages. + * @param message Event message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Event.verify|verify} messages. + * @param message Event message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Event message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Event; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Event; + + /** + * Verifies an Event message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Event message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Event + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Event; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @param message Event + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.Event, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Event to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Event + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SessionInput. */ + interface ISessionInput { + + /** SessionInput text */ + text?: (string|null); + + /** SessionInput dtmf */ + dtmf?: (string|null); + + /** SessionInput audio */ + audio?: (Uint8Array|Buffer|string|null); + + /** SessionInput toolResponses */ + toolResponses?: (google.cloud.ces.v1.IToolResponses|null); + + /** SessionInput image */ + image?: (google.cloud.ces.v1.IImage|null); + + /** SessionInput blob */ + blob?: (google.cloud.ces.v1.IBlob|null); + + /** SessionInput variables */ + variables?: (google.protobuf.IStruct|null); + + /** SessionInput event */ + event?: (google.cloud.ces.v1.IEvent|null); + + /** SessionInput willContinue */ + willContinue?: (boolean|null); + } + + /** Represents a SessionInput. */ + class SessionInput implements ISessionInput { + + /** + * Constructs a new SessionInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ISessionInput); + + /** SessionInput text. */ + public text?: (string|null); + + /** SessionInput dtmf. */ + public dtmf?: (string|null); + + /** SessionInput audio. */ + public audio?: (Uint8Array|Buffer|string|null); + + /** SessionInput toolResponses. */ + public toolResponses?: (google.cloud.ces.v1.IToolResponses|null); + + /** SessionInput image. */ + public image?: (google.cloud.ces.v1.IImage|null); + + /** SessionInput blob. */ + public blob?: (google.cloud.ces.v1.IBlob|null); + + /** SessionInput variables. */ + public variables?: (google.protobuf.IStruct|null); + + /** SessionInput event. */ + public event?: (google.cloud.ces.v1.IEvent|null); + + /** SessionInput willContinue. */ + public willContinue: boolean; + + /** SessionInput inputType. */ + public inputType?: ("text"|"dtmf"|"audio"|"toolResponses"|"image"|"blob"|"variables"|"event"); + + /** + * Creates a new SessionInput instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionInput instance + */ + public static create(properties?: google.cloud.ces.v1.ISessionInput): google.cloud.ces.v1.SessionInput; + + /** + * Encodes the specified SessionInput message. Does not implicitly {@link google.cloud.ces.v1.SessionInput.verify|verify} messages. + * @param message SessionInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ISessionInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionInput message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionInput.verify|verify} messages. + * @param message SessionInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ISessionInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.SessionInput; + + /** + * Decodes a SessionInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.SessionInput; + + /** + * Verifies a SessionInput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SessionInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.SessionInput; + + /** + * Creates a plain object from a SessionInput message. Also converts values to other types if specified. + * @param message SessionInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.SessionInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SessionOutput. */ + interface ISessionOutput { + + /** SessionOutput text */ + text?: (string|null); + + /** SessionOutput audio */ + audio?: (Uint8Array|Buffer|string|null); + + /** SessionOutput toolCalls */ + toolCalls?: (google.cloud.ces.v1.IToolCalls|null); + + /** SessionOutput citations */ + citations?: (google.cloud.ces.v1.ICitations|null); + + /** SessionOutput googleSearchSuggestions */ + googleSearchSuggestions?: (google.cloud.ces.v1.IGoogleSearchSuggestions|null); + + /** SessionOutput endSession */ + endSession?: (google.cloud.ces.v1.IEndSession|null); + + /** SessionOutput payload */ + payload?: (google.protobuf.IStruct|null); + + /** SessionOutput turnIndex */ + turnIndex?: (number|null); + + /** SessionOutput turnCompleted */ + turnCompleted?: (boolean|null); + + /** SessionOutput diagnosticInfo */ + diagnosticInfo?: (google.cloud.ces.v1.SessionOutput.IDiagnosticInfo|null); + } + + /** Represents a SessionOutput. */ + class SessionOutput implements ISessionOutput { + + /** + * Constructs a new SessionOutput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.ISessionOutput); + + /** SessionOutput text. */ + public text?: (string|null); + + /** SessionOutput audio. */ + public audio?: (Uint8Array|Buffer|string|null); + + /** SessionOutput toolCalls. */ + public toolCalls?: (google.cloud.ces.v1.IToolCalls|null); + + /** SessionOutput citations. */ + public citations?: (google.cloud.ces.v1.ICitations|null); + + /** SessionOutput googleSearchSuggestions. */ + public googleSearchSuggestions?: (google.cloud.ces.v1.IGoogleSearchSuggestions|null); + + /** SessionOutput endSession. */ + public endSession?: (google.cloud.ces.v1.IEndSession|null); + + /** SessionOutput payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** SessionOutput turnIndex. */ + public turnIndex: number; + + /** SessionOutput turnCompleted. */ + public turnCompleted: boolean; + + /** SessionOutput diagnosticInfo. */ + public diagnosticInfo?: (google.cloud.ces.v1.SessionOutput.IDiagnosticInfo|null); + + /** SessionOutput outputType. */ + public outputType?: ("text"|"audio"|"toolCalls"|"citations"|"googleSearchSuggestions"|"endSession"|"payload"); + + /** + * Creates a new SessionOutput instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionOutput instance + */ + public static create(properties?: google.cloud.ces.v1.ISessionOutput): google.cloud.ces.v1.SessionOutput; + + /** + * Encodes the specified SessionOutput message. Does not implicitly {@link google.cloud.ces.v1.SessionOutput.verify|verify} messages. + * @param message SessionOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.ISessionOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionOutput message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionOutput.verify|verify} messages. + * @param message SessionOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.ISessionOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionOutput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.SessionOutput; + + /** + * Decodes a SessionOutput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.SessionOutput; + + /** + * Verifies a SessionOutput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SessionOutput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionOutput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.SessionOutput; + + /** + * Creates a plain object from a SessionOutput message. Also converts values to other types if specified. + * @param message SessionOutput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.SessionOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionOutput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionOutput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SessionOutput { + + /** Properties of a DiagnosticInfo. */ + interface IDiagnosticInfo { + + /** DiagnosticInfo messages */ + messages?: (google.cloud.ces.v1.IMessage[]|null); + + /** DiagnosticInfo rootSpan */ + rootSpan?: (google.cloud.ces.v1.ISpan|null); + } + + /** Represents a DiagnosticInfo. */ + class DiagnosticInfo implements IDiagnosticInfo { + + /** + * Constructs a new DiagnosticInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.SessionOutput.IDiagnosticInfo); + + /** DiagnosticInfo messages. */ + public messages: google.cloud.ces.v1.IMessage[]; + + /** DiagnosticInfo rootSpan. */ + public rootSpan?: (google.cloud.ces.v1.ISpan|null); + + /** + * Creates a new DiagnosticInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DiagnosticInfo instance + */ + public static create(properties?: google.cloud.ces.v1.SessionOutput.IDiagnosticInfo): google.cloud.ces.v1.SessionOutput.DiagnosticInfo; + + /** + * Encodes the specified DiagnosticInfo message. Does not implicitly {@link google.cloud.ces.v1.SessionOutput.DiagnosticInfo.verify|verify} messages. + * @param message DiagnosticInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.SessionOutput.IDiagnosticInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiagnosticInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionOutput.DiagnosticInfo.verify|verify} messages. + * @param message DiagnosticInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.SessionOutput.IDiagnosticInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiagnosticInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiagnosticInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.SessionOutput.DiagnosticInfo; + + /** + * Decodes a DiagnosticInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiagnosticInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.SessionOutput.DiagnosticInfo; + + /** + * Verifies a DiagnosticInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiagnosticInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiagnosticInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.SessionOutput.DiagnosticInfo; + + /** + * Creates a plain object from a DiagnosticInfo message. Also converts values to other types if specified. + * @param message DiagnosticInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.SessionOutput.DiagnosticInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiagnosticInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DiagnosticInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RecognitionResult. */ + interface IRecognitionResult { + + /** RecognitionResult transcript */ + transcript?: (string|null); + } + + /** Represents a RecognitionResult. */ + class RecognitionResult implements IRecognitionResult { + + /** + * Constructs a new RecognitionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IRecognitionResult); + + /** RecognitionResult transcript. */ + public transcript: string; + + /** + * Creates a new RecognitionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognitionResult instance + */ + public static create(properties?: google.cloud.ces.v1.IRecognitionResult): google.cloud.ces.v1.RecognitionResult; + + /** + * Encodes the specified RecognitionResult message. Does not implicitly {@link google.cloud.ces.v1.RecognitionResult.verify|verify} messages. + * @param message RecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognitionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RecognitionResult.verify|verify} messages. + * @param message RecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognitionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RecognitionResult; + + /** + * Decodes a RecognitionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RecognitionResult; + + /** + * Verifies a RecognitionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognitionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognitionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RecognitionResult; + + /** + * Creates a plain object from a RecognitionResult message. Also converts values to other types if specified. + * @param message RecognitionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.RecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognitionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognitionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InterruptionSignal. */ + interface IInterruptionSignal { + + /** InterruptionSignal bargeIn */ + bargeIn?: (boolean|null); + } + + /** Represents an InterruptionSignal. */ + class InterruptionSignal implements IInterruptionSignal { + + /** + * Constructs a new InterruptionSignal. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IInterruptionSignal); + + /** InterruptionSignal bargeIn. */ + public bargeIn: boolean; + + /** + * Creates a new InterruptionSignal instance using the specified properties. + * @param [properties] Properties to set + * @returns InterruptionSignal instance + */ + public static create(properties?: google.cloud.ces.v1.IInterruptionSignal): google.cloud.ces.v1.InterruptionSignal; + + /** + * Encodes the specified InterruptionSignal message. Does not implicitly {@link google.cloud.ces.v1.InterruptionSignal.verify|verify} messages. + * @param message InterruptionSignal message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IInterruptionSignal, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterruptionSignal message, length delimited. Does not implicitly {@link google.cloud.ces.v1.InterruptionSignal.verify|verify} messages. + * @param message InterruptionSignal message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IInterruptionSignal, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterruptionSignal message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterruptionSignal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.InterruptionSignal; + + /** + * Decodes an InterruptionSignal message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterruptionSignal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.InterruptionSignal; + + /** + * Verifies an InterruptionSignal message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterruptionSignal message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterruptionSignal + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.InterruptionSignal; + + /** + * Creates a plain object from an InterruptionSignal message. Also converts values to other types if specified. + * @param message InterruptionSignal + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.InterruptionSignal, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterruptionSignal to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InterruptionSignal + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EndSession. */ + interface IEndSession { + + /** EndSession metadata */ + metadata?: (google.protobuf.IStruct|null); + } + + /** Represents an EndSession. */ + class EndSession implements IEndSession { + + /** + * Constructs a new EndSession. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IEndSession); + + /** EndSession metadata. */ + public metadata?: (google.protobuf.IStruct|null); + + /** + * Creates a new EndSession instance using the specified properties. + * @param [properties] Properties to set + * @returns EndSession instance + */ + public static create(properties?: google.cloud.ces.v1.IEndSession): google.cloud.ces.v1.EndSession; + + /** + * Encodes the specified EndSession message. Does not implicitly {@link google.cloud.ces.v1.EndSession.verify|verify} messages. + * @param message EndSession message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IEndSession, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndSession message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EndSession.verify|verify} messages. + * @param message EndSession message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IEndSession, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndSession message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndSession + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.EndSession; + + /** + * Decodes an EndSession message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndSession + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.EndSession; + + /** + * Verifies an EndSession message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EndSession message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndSession + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.EndSession; + + /** + * Creates a plain object from an EndSession message. Also converts values to other types if specified. + * @param message EndSession + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.EndSession, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndSession to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndSession + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoAway. */ + interface IGoAway { + } + + /** Represents a GoAway. */ + class GoAway implements IGoAway { + + /** + * Constructs a new GoAway. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IGoAway); + + /** + * Creates a new GoAway instance using the specified properties. + * @param [properties] Properties to set + * @returns GoAway instance + */ + public static create(properties?: google.cloud.ces.v1.IGoAway): google.cloud.ces.v1.GoAway; + + /** + * Encodes the specified GoAway message. Does not implicitly {@link google.cloud.ces.v1.GoAway.verify|verify} messages. + * @param message GoAway message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IGoAway, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoAway message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GoAway.verify|verify} messages. + * @param message GoAway message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IGoAway, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoAway message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoAway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GoAway; + + /** + * Decodes a GoAway message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoAway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GoAway; + + /** + * Verifies a GoAway message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoAway message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoAway + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GoAway; + + /** + * Creates a plain object from a GoAway message. Also converts values to other types if specified. + * @param message GoAway + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.GoAway, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoAway to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoAway + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunSessionRequest. */ + interface IRunSessionRequest { + + /** RunSessionRequest config */ + config?: (google.cloud.ces.v1.ISessionConfig|null); + + /** RunSessionRequest inputs */ + inputs?: (google.cloud.ces.v1.ISessionInput[]|null); + } + + /** Represents a RunSessionRequest. */ + class RunSessionRequest implements IRunSessionRequest { + + /** + * Constructs a new RunSessionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IRunSessionRequest); + + /** RunSessionRequest config. */ + public config?: (google.cloud.ces.v1.ISessionConfig|null); + + /** RunSessionRequest inputs. */ + public inputs: google.cloud.ces.v1.ISessionInput[]; + + /** + * Creates a new RunSessionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunSessionRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IRunSessionRequest): google.cloud.ces.v1.RunSessionRequest; + + /** + * Encodes the specified RunSessionRequest message. Does not implicitly {@link google.cloud.ces.v1.RunSessionRequest.verify|verify} messages. + * @param message RunSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IRunSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunSessionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RunSessionRequest.verify|verify} messages. + * @param message RunSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IRunSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunSessionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RunSessionRequest; + + /** + * Decodes a RunSessionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RunSessionRequest; + + /** + * Verifies a RunSessionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunSessionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunSessionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RunSessionRequest; + + /** + * Creates a plain object from a RunSessionRequest message. Also converts values to other types if specified. + * @param message RunSessionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.RunSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunSessionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunSessionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunSessionResponse. */ + interface IRunSessionResponse { + + /** RunSessionResponse outputs */ + outputs?: (google.cloud.ces.v1.ISessionOutput[]|null); + } + + /** Represents a RunSessionResponse. */ + class RunSessionResponse implements IRunSessionResponse { + + /** + * Constructs a new RunSessionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IRunSessionResponse); + + /** RunSessionResponse outputs. */ + public outputs: google.cloud.ces.v1.ISessionOutput[]; + + /** + * Creates a new RunSessionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunSessionResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IRunSessionResponse): google.cloud.ces.v1.RunSessionResponse; + + /** + * Encodes the specified RunSessionResponse message. Does not implicitly {@link google.cloud.ces.v1.RunSessionResponse.verify|verify} messages. + * @param message RunSessionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IRunSessionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunSessionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RunSessionResponse.verify|verify} messages. + * @param message RunSessionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IRunSessionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunSessionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunSessionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RunSessionResponse; + + /** + * Decodes a RunSessionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunSessionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RunSessionResponse; + + /** + * Verifies a RunSessionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunSessionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunSessionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RunSessionResponse; + + /** + * Creates a plain object from a RunSessionResponse message. Also converts values to other types if specified. + * @param message RunSessionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.RunSessionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunSessionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunSessionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiSessionClientMessage. */ + interface IBidiSessionClientMessage { + + /** BidiSessionClientMessage config */ + config?: (google.cloud.ces.v1.ISessionConfig|null); + + /** BidiSessionClientMessage realtimeInput */ + realtimeInput?: (google.cloud.ces.v1.ISessionInput|null); + } + + /** Represents a BidiSessionClientMessage. */ + class BidiSessionClientMessage implements IBidiSessionClientMessage { + + /** + * Constructs a new BidiSessionClientMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IBidiSessionClientMessage); + + /** BidiSessionClientMessage config. */ + public config?: (google.cloud.ces.v1.ISessionConfig|null); + + /** BidiSessionClientMessage realtimeInput. */ + public realtimeInput?: (google.cloud.ces.v1.ISessionInput|null); + + /** BidiSessionClientMessage messageType. */ + public messageType?: ("config"|"realtimeInput"); + + /** + * Creates a new BidiSessionClientMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiSessionClientMessage instance + */ + public static create(properties?: google.cloud.ces.v1.IBidiSessionClientMessage): google.cloud.ces.v1.BidiSessionClientMessage; + + /** + * Encodes the specified BidiSessionClientMessage message. Does not implicitly {@link google.cloud.ces.v1.BidiSessionClientMessage.verify|verify} messages. + * @param message BidiSessionClientMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IBidiSessionClientMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiSessionClientMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BidiSessionClientMessage.verify|verify} messages. + * @param message BidiSessionClientMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IBidiSessionClientMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiSessionClientMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiSessionClientMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.BidiSessionClientMessage; + + /** + * Decodes a BidiSessionClientMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiSessionClientMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.BidiSessionClientMessage; + + /** + * Verifies a BidiSessionClientMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiSessionClientMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiSessionClientMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.BidiSessionClientMessage; + + /** + * Creates a plain object from a BidiSessionClientMessage message. Also converts values to other types if specified. + * @param message BidiSessionClientMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.BidiSessionClientMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiSessionClientMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiSessionClientMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiSessionServerMessage. */ + interface IBidiSessionServerMessage { + + /** BidiSessionServerMessage sessionOutput */ + sessionOutput?: (google.cloud.ces.v1.ISessionOutput|null); + + /** BidiSessionServerMessage recognitionResult */ + recognitionResult?: (google.cloud.ces.v1.IRecognitionResult|null); + + /** BidiSessionServerMessage interruptionSignal */ + interruptionSignal?: (google.cloud.ces.v1.IInterruptionSignal|null); + + /** BidiSessionServerMessage endSession */ + endSession?: (google.cloud.ces.v1.IEndSession|null); + + /** BidiSessionServerMessage goAway */ + goAway?: (google.cloud.ces.v1.IGoAway|null); + } + + /** Represents a BidiSessionServerMessage. */ + class BidiSessionServerMessage implements IBidiSessionServerMessage { + + /** + * Constructs a new BidiSessionServerMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IBidiSessionServerMessage); + + /** BidiSessionServerMessage sessionOutput. */ + public sessionOutput?: (google.cloud.ces.v1.ISessionOutput|null); + + /** BidiSessionServerMessage recognitionResult. */ + public recognitionResult?: (google.cloud.ces.v1.IRecognitionResult|null); + + /** BidiSessionServerMessage interruptionSignal. */ + public interruptionSignal?: (google.cloud.ces.v1.IInterruptionSignal|null); + + /** BidiSessionServerMessage endSession. */ + public endSession?: (google.cloud.ces.v1.IEndSession|null); + + /** BidiSessionServerMessage goAway. */ + public goAway?: (google.cloud.ces.v1.IGoAway|null); + + /** BidiSessionServerMessage messageType. */ + public messageType?: ("sessionOutput"|"recognitionResult"|"interruptionSignal"|"endSession"|"goAway"); + + /** + * Creates a new BidiSessionServerMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiSessionServerMessage instance + */ + public static create(properties?: google.cloud.ces.v1.IBidiSessionServerMessage): google.cloud.ces.v1.BidiSessionServerMessage; + + /** + * Encodes the specified BidiSessionServerMessage message. Does not implicitly {@link google.cloud.ces.v1.BidiSessionServerMessage.verify|verify} messages. + * @param message BidiSessionServerMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IBidiSessionServerMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiSessionServerMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BidiSessionServerMessage.verify|verify} messages. + * @param message BidiSessionServerMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IBidiSessionServerMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiSessionServerMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiSessionServerMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.BidiSessionServerMessage; + + /** + * Decodes a BidiSessionServerMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiSessionServerMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.BidiSessionServerMessage; + + /** + * Verifies a BidiSessionServerMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiSessionServerMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiSessionServerMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.BidiSessionServerMessage; + + /** + * Creates a plain object from a BidiSessionServerMessage message. Also converts values to other types if specified. + * @param message BidiSessionServerMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.BidiSessionServerMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiSessionServerMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiSessionServerMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a ToolService */ + class ToolService extends $protobuf.rpc.Service { + + /** + * Constructs a new ToolService 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 ToolService 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): ToolService; + + /** + * Calls ExecuteTool. + * @param request ExecuteToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExecuteToolResponse + */ + public executeTool(request: google.cloud.ces.v1.IExecuteToolRequest, callback: google.cloud.ces.v1.ToolService.ExecuteToolCallback): void; + + /** + * Calls ExecuteTool. + * @param request ExecuteToolRequest message or plain object + * @returns Promise + */ + public executeTool(request: google.cloud.ces.v1.IExecuteToolRequest): Promise; + + /** + * Calls RetrieveToolSchema. + * @param request RetrieveToolSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RetrieveToolSchemaResponse + */ + public retrieveToolSchema(request: google.cloud.ces.v1.IRetrieveToolSchemaRequest, callback: google.cloud.ces.v1.ToolService.RetrieveToolSchemaCallback): void; + + /** + * Calls RetrieveToolSchema. + * @param request RetrieveToolSchemaRequest message or plain object + * @returns Promise + */ + public retrieveToolSchema(request: google.cloud.ces.v1.IRetrieveToolSchemaRequest): Promise; + + /** + * Calls RetrieveTools. + * @param request RetrieveToolsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RetrieveToolsResponse + */ + public retrieveTools(request: google.cloud.ces.v1.IRetrieveToolsRequest, callback: google.cloud.ces.v1.ToolService.RetrieveToolsCallback): void; + + /** + * Calls RetrieveTools. + * @param request RetrieveToolsRequest message or plain object + * @returns Promise + */ + public retrieveTools(request: google.cloud.ces.v1.IRetrieveToolsRequest): Promise; + } + + namespace ToolService { + + /** + * Callback as used by {@link google.cloud.ces.v1.ToolService|executeTool}. + * @param error Error, if any + * @param [response] ExecuteToolResponse + */ + type ExecuteToolCallback = (error: (Error|null), response?: google.cloud.ces.v1.ExecuteToolResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.ToolService|retrieveToolSchema}. + * @param error Error, if any + * @param [response] RetrieveToolSchemaResponse + */ + type RetrieveToolSchemaCallback = (error: (Error|null), response?: google.cloud.ces.v1.RetrieveToolSchemaResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1.ToolService|retrieveTools}. + * @param error Error, if any + * @param [response] RetrieveToolsResponse + */ + type RetrieveToolsCallback = (error: (Error|null), response?: google.cloud.ces.v1.RetrieveToolsResponse) => void; + } + + /** Properties of an ExecuteToolRequest. */ + interface IExecuteToolRequest { + + /** ExecuteToolRequest tool */ + tool?: (string|null); + + /** ExecuteToolRequest toolsetTool */ + toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); + + /** ExecuteToolRequest parent */ + parent?: (string|null); + + /** ExecuteToolRequest args */ + args?: (google.protobuf.IStruct|null); + } + + /** Represents an ExecuteToolRequest. */ + class ExecuteToolRequest implements IExecuteToolRequest { + + /** + * Constructs a new ExecuteToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IExecuteToolRequest); + + /** ExecuteToolRequest tool. */ + public tool?: (string|null); + + /** ExecuteToolRequest toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); + + /** ExecuteToolRequest parent. */ + public parent: string; + + /** ExecuteToolRequest args. */ + public args?: (google.protobuf.IStruct|null); + + /** ExecuteToolRequest toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new ExecuteToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteToolRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IExecuteToolRequest): google.cloud.ces.v1.ExecuteToolRequest; + + /** + * Encodes the specified ExecuteToolRequest message. Does not implicitly {@link google.cloud.ces.v1.ExecuteToolRequest.verify|verify} messages. + * @param message ExecuteToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IExecuteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExecuteToolRequest.verify|verify} messages. + * @param message ExecuteToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IExecuteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ExecuteToolRequest; + + /** + * Decodes an ExecuteToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ExecuteToolRequest; + + /** + * Verifies an ExecuteToolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ExecuteToolRequest; + + /** + * Creates a plain object from an ExecuteToolRequest message. Also converts values to other types if specified. + * @param message ExecuteToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ExecuteToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecuteToolResponse. */ + interface IExecuteToolResponse { + + /** ExecuteToolResponse tool */ + tool?: (string|null); + + /** ExecuteToolResponse toolsetTool */ + toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); + + /** ExecuteToolResponse response */ + response?: (google.protobuf.IStruct|null); + } + + /** Represents an ExecuteToolResponse. */ + class ExecuteToolResponse implements IExecuteToolResponse { + + /** + * Constructs a new ExecuteToolResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IExecuteToolResponse); + + /** ExecuteToolResponse tool. */ + public tool?: (string|null); + + /** ExecuteToolResponse toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); + + /** ExecuteToolResponse response. */ + public response?: (google.protobuf.IStruct|null); + + /** ExecuteToolResponse toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new ExecuteToolResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteToolResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IExecuteToolResponse): google.cloud.ces.v1.ExecuteToolResponse; + + /** + * Encodes the specified ExecuteToolResponse message. Does not implicitly {@link google.cloud.ces.v1.ExecuteToolResponse.verify|verify} messages. + * @param message ExecuteToolResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IExecuteToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExecuteToolResponse.verify|verify} messages. + * @param message ExecuteToolResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IExecuteToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteToolResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ExecuteToolResponse; + + /** + * Decodes an ExecuteToolResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ExecuteToolResponse; + + /** + * Verifies an ExecuteToolResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteToolResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteToolResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ExecuteToolResponse; + + /** + * Creates a plain object from an ExecuteToolResponse message. Also converts values to other types if specified. + * @param message ExecuteToolResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.ExecuteToolResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteToolResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteToolResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetrieveToolSchemaRequest. */ + interface IRetrieveToolSchemaRequest { + + /** RetrieveToolSchemaRequest tool */ + tool?: (string|null); + + /** RetrieveToolSchemaRequest toolsetTool */ + toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); + + /** RetrieveToolSchemaRequest parent */ + parent?: (string|null); + } + + /** Represents a RetrieveToolSchemaRequest. */ + class RetrieveToolSchemaRequest implements IRetrieveToolSchemaRequest { + + /** + * Constructs a new RetrieveToolSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IRetrieveToolSchemaRequest); + + /** RetrieveToolSchemaRequest tool. */ + public tool?: (string|null); + + /** RetrieveToolSchemaRequest toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); + + /** RetrieveToolSchemaRequest parent. */ + public parent: string; + + /** RetrieveToolSchemaRequest toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new RetrieveToolSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrieveToolSchemaRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IRetrieveToolSchemaRequest): google.cloud.ces.v1.RetrieveToolSchemaRequest; + + /** + * Encodes the specified RetrieveToolSchemaRequest message. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolSchemaRequest.verify|verify} messages. + * @param message RetrieveToolSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IRetrieveToolSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrieveToolSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolSchemaRequest.verify|verify} messages. + * @param message RetrieveToolSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IRetrieveToolSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrieveToolSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RetrieveToolSchemaRequest; + + /** + * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrieveToolSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RetrieveToolSchemaRequest; + + /** + * Verifies a RetrieveToolSchemaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrieveToolSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrieveToolSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RetrieveToolSchemaRequest; + + /** + * Creates a plain object from a RetrieveToolSchemaRequest message. Also converts values to other types if specified. + * @param message RetrieveToolSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.RetrieveToolSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrieveToolSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrieveToolSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetrieveToolSchemaResponse. */ + interface IRetrieveToolSchemaResponse { + + /** RetrieveToolSchemaResponse tool */ + tool?: (string|null); + + /** RetrieveToolSchemaResponse toolsetTool */ + toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); + + /** RetrieveToolSchemaResponse inputSchema */ + inputSchema?: (google.cloud.ces.v1.ISchema|null); + + /** RetrieveToolSchemaResponse outputSchema */ + outputSchema?: (google.cloud.ces.v1.ISchema|null); + } + + /** Represents a RetrieveToolSchemaResponse. */ + class RetrieveToolSchemaResponse implements IRetrieveToolSchemaResponse { + + /** + * Constructs a new RetrieveToolSchemaResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IRetrieveToolSchemaResponse); + + /** RetrieveToolSchemaResponse tool. */ + public tool?: (string|null); + + /** RetrieveToolSchemaResponse toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); + + /** RetrieveToolSchemaResponse inputSchema. */ + public inputSchema?: (google.cloud.ces.v1.ISchema|null); + + /** RetrieveToolSchemaResponse outputSchema. */ + public outputSchema?: (google.cloud.ces.v1.ISchema|null); + + /** RetrieveToolSchemaResponse toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new RetrieveToolSchemaResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrieveToolSchemaResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IRetrieveToolSchemaResponse): google.cloud.ces.v1.RetrieveToolSchemaResponse; + + /** + * Encodes the specified RetrieveToolSchemaResponse message. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolSchemaResponse.verify|verify} messages. + * @param message RetrieveToolSchemaResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IRetrieveToolSchemaResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrieveToolSchemaResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolSchemaResponse.verify|verify} messages. + * @param message RetrieveToolSchemaResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IRetrieveToolSchemaResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrieveToolSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RetrieveToolSchemaResponse; + + /** + * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrieveToolSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RetrieveToolSchemaResponse; + + /** + * Verifies a RetrieveToolSchemaResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrieveToolSchemaResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrieveToolSchemaResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RetrieveToolSchemaResponse; + + /** + * Creates a plain object from a RetrieveToolSchemaResponse message. Also converts values to other types if specified. + * @param message RetrieveToolSchemaResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.RetrieveToolSchemaResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrieveToolSchemaResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrieveToolSchemaResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetrieveToolsRequest. */ + interface IRetrieveToolsRequest { + + /** RetrieveToolsRequest toolset */ + toolset?: (string|null); + + /** RetrieveToolsRequest toolIds */ + toolIds?: (string[]|null); + } + + /** Represents a RetrieveToolsRequest. */ + class RetrieveToolsRequest implements IRetrieveToolsRequest { + + /** + * Constructs a new RetrieveToolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IRetrieveToolsRequest); + + /** RetrieveToolsRequest toolset. */ + public toolset: string; + + /** RetrieveToolsRequest toolIds. */ + public toolIds: string[]; + + /** + * Creates a new RetrieveToolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrieveToolsRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IRetrieveToolsRequest): google.cloud.ces.v1.RetrieveToolsRequest; + + /** + * Encodes the specified RetrieveToolsRequest message. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolsRequest.verify|verify} messages. + * @param message RetrieveToolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IRetrieveToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrieveToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolsRequest.verify|verify} messages. + * @param message RetrieveToolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IRetrieveToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrieveToolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrieveToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RetrieveToolsRequest; + + /** + * Decodes a RetrieveToolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrieveToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RetrieveToolsRequest; + + /** + * Verifies a RetrieveToolsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrieveToolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrieveToolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RetrieveToolsRequest; + + /** + * Creates a plain object from a RetrieveToolsRequest message. Also converts values to other types if specified. + * @param message RetrieveToolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.RetrieveToolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrieveToolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrieveToolsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetrieveToolsResponse. */ + interface IRetrieveToolsResponse { + + /** RetrieveToolsResponse tools */ + tools?: (google.cloud.ces.v1.ITool[]|null); + } + + /** Represents a RetrieveToolsResponse. */ + class RetrieveToolsResponse implements IRetrieveToolsResponse { + + /** + * Constructs a new RetrieveToolsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IRetrieveToolsResponse); + + /** RetrieveToolsResponse tools. */ + public tools: google.cloud.ces.v1.ITool[]; + + /** + * Creates a new RetrieveToolsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrieveToolsResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IRetrieveToolsResponse): google.cloud.ces.v1.RetrieveToolsResponse; + + /** + * Encodes the specified RetrieveToolsResponse message. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolsResponse.verify|verify} messages. + * @param message RetrieveToolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IRetrieveToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrieveToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolsResponse.verify|verify} messages. + * @param message RetrieveToolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IRetrieveToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrieveToolsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrieveToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RetrieveToolsResponse; + + /** + * Decodes a RetrieveToolsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrieveToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RetrieveToolsResponse; + + /** + * Verifies a RetrieveToolsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrieveToolsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrieveToolsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RetrieveToolsResponse; + + /** + * Creates a plain object from a RetrieveToolsResponse message. Also converts values to other types if specified. + * @param message RetrieveToolsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.RetrieveToolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrieveToolsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrieveToolsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a WidgetService */ + class WidgetService extends $protobuf.rpc.Service { + + /** + * Constructs a new WidgetService 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 WidgetService 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): WidgetService; + + /** + * Calls GenerateChatToken. + * @param request GenerateChatTokenRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateChatTokenResponse + */ + public generateChatToken(request: google.cloud.ces.v1.IGenerateChatTokenRequest, callback: google.cloud.ces.v1.WidgetService.GenerateChatTokenCallback): void; + + /** + * Calls GenerateChatToken. + * @param request GenerateChatTokenRequest message or plain object + * @returns Promise + */ + public generateChatToken(request: google.cloud.ces.v1.IGenerateChatTokenRequest): Promise; + } + + namespace WidgetService { + + /** + * Callback as used by {@link google.cloud.ces.v1.WidgetService|generateChatToken}. + * @param error Error, if any + * @param [response] GenerateChatTokenResponse + */ + type GenerateChatTokenCallback = (error: (Error|null), response?: google.cloud.ces.v1.GenerateChatTokenResponse) => void; + } + + /** Properties of a GenerateChatTokenRequest. */ + interface IGenerateChatTokenRequest { + + /** GenerateChatTokenRequest name */ + name?: (string|null); + + /** GenerateChatTokenRequest deployment */ + deployment?: (string|null); + + /** GenerateChatTokenRequest recaptchaToken */ + recaptchaToken?: (string|null); + } + + /** Represents a GenerateChatTokenRequest. */ + class GenerateChatTokenRequest implements IGenerateChatTokenRequest { + + /** + * Constructs a new GenerateChatTokenRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IGenerateChatTokenRequest); + + /** GenerateChatTokenRequest name. */ + public name: string; + + /** GenerateChatTokenRequest deployment. */ + public deployment: string; + + /** GenerateChatTokenRequest recaptchaToken. */ + public recaptchaToken: string; + + /** + * Creates a new GenerateChatTokenRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateChatTokenRequest instance + */ + public static create(properties?: google.cloud.ces.v1.IGenerateChatTokenRequest): google.cloud.ces.v1.GenerateChatTokenRequest; + + /** + * Encodes the specified GenerateChatTokenRequest message. Does not implicitly {@link google.cloud.ces.v1.GenerateChatTokenRequest.verify|verify} messages. + * @param message GenerateChatTokenRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IGenerateChatTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateChatTokenRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GenerateChatTokenRequest.verify|verify} messages. + * @param message GenerateChatTokenRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IGenerateChatTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateChatTokenRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateChatTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GenerateChatTokenRequest; + + /** + * Decodes a GenerateChatTokenRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateChatTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GenerateChatTokenRequest; + + /** + * Verifies a GenerateChatTokenRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateChatTokenRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateChatTokenRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GenerateChatTokenRequest; + + /** + * Creates a plain object from a GenerateChatTokenRequest message. Also converts values to other types if specified. + * @param message GenerateChatTokenRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.GenerateChatTokenRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateChatTokenRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateChatTokenRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateChatTokenResponse. */ + interface IGenerateChatTokenResponse { + + /** GenerateChatTokenResponse chatToken */ + chatToken?: (string|null); + + /** GenerateChatTokenResponse expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a GenerateChatTokenResponse. */ + class GenerateChatTokenResponse implements IGenerateChatTokenResponse { + + /** + * Constructs a new GenerateChatTokenResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1.IGenerateChatTokenResponse); + + /** GenerateChatTokenResponse chatToken. */ + public chatToken: string; + + /** GenerateChatTokenResponse expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new GenerateChatTokenResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateChatTokenResponse instance + */ + public static create(properties?: google.cloud.ces.v1.IGenerateChatTokenResponse): google.cloud.ces.v1.GenerateChatTokenResponse; + + /** + * Encodes the specified GenerateChatTokenResponse message. Does not implicitly {@link google.cloud.ces.v1.GenerateChatTokenResponse.verify|verify} messages. + * @param message GenerateChatTokenResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1.IGenerateChatTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateChatTokenResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GenerateChatTokenResponse.verify|verify} messages. + * @param message GenerateChatTokenResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1.IGenerateChatTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateChatTokenResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateChatTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GenerateChatTokenResponse; + + /** + * Decodes a GenerateChatTokenResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateChatTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GenerateChatTokenResponse; + + /** + * Verifies a GenerateChatTokenResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateChatTokenResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateChatTokenResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GenerateChatTokenResponse; + + /** + * Creates a plain object from a GenerateChatTokenResponse message. Also converts values to other types if specified. + * @param message GenerateChatTokenResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1.GenerateChatTokenResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateChatTokenResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateChatTokenResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v1beta. */ + namespace v1beta { + + /** Properties of an Agent. */ + interface IAgent { + + /** Agent llmAgent */ + llmAgent?: (google.cloud.ces.v1beta.Agent.ILlmAgent|null); + + /** Agent remoteDialogflowAgent */ + remoteDialogflowAgent?: (google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent|null); + + /** Agent name */ + name?: (string|null); + + /** Agent displayName */ + displayName?: (string|null); + + /** Agent description */ + description?: (string|null); + + /** Agent modelSettings */ + modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** Agent instruction */ + instruction?: (string|null); + + /** Agent tools */ + tools?: (string[]|null); + + /** Agent childAgents */ + childAgents?: (string[]|null); + + /** Agent beforeAgentCallbacks */ + beforeAgentCallbacks?: (google.cloud.ces.v1beta.ICallback[]|null); + + /** Agent afterAgentCallbacks */ + afterAgentCallbacks?: (google.cloud.ces.v1beta.ICallback[]|null); + + /** Agent beforeModelCallbacks */ + beforeModelCallbacks?: (google.cloud.ces.v1beta.ICallback[]|null); + + /** Agent afterModelCallbacks */ + afterModelCallbacks?: (google.cloud.ces.v1beta.ICallback[]|null); + + /** Agent beforeToolCallbacks */ + beforeToolCallbacks?: (google.cloud.ces.v1beta.ICallback[]|null); + + /** Agent afterToolCallbacks */ + afterToolCallbacks?: (google.cloud.ces.v1beta.ICallback[]|null); + + /** Agent createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Agent updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Agent guardrails */ + guardrails?: (string[]|null); + + /** Agent etag */ + etag?: (string|null); + + /** Agent toolsets */ + toolsets?: (google.cloud.ces.v1beta.Agent.IAgentToolset[]|null); + + /** Agent generatedSummary */ + generatedSummary?: (string|null); + + /** Agent transferRules */ + transferRules?: (google.cloud.ces.v1beta.ITransferRule[]|null); + } + + /** Represents an Agent. */ + class Agent implements IAgent { + + /** + * Constructs a new Agent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IAgent); + + /** Agent llmAgent. */ + public llmAgent?: (google.cloud.ces.v1beta.Agent.ILlmAgent|null); + + /** Agent remoteDialogflowAgent. */ + public remoteDialogflowAgent?: (google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent|null); + + /** Agent name. */ + public name: string; + + /** Agent displayName. */ + public displayName: string; + + /** Agent description. */ + public description: string; + + /** Agent modelSettings. */ + public modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** Agent instruction. */ + public instruction: string; + + /** Agent tools. */ + public tools: string[]; + + /** Agent childAgents. */ + public childAgents: string[]; + + /** Agent beforeAgentCallbacks. */ + public beforeAgentCallbacks: google.cloud.ces.v1beta.ICallback[]; + + /** Agent afterAgentCallbacks. */ + public afterAgentCallbacks: google.cloud.ces.v1beta.ICallback[]; + + /** Agent beforeModelCallbacks. */ + public beforeModelCallbacks: google.cloud.ces.v1beta.ICallback[]; + + /** Agent afterModelCallbacks. */ + public afterModelCallbacks: google.cloud.ces.v1beta.ICallback[]; + + /** Agent beforeToolCallbacks. */ + public beforeToolCallbacks: google.cloud.ces.v1beta.ICallback[]; + + /** Agent afterToolCallbacks. */ + public afterToolCallbacks: google.cloud.ces.v1beta.ICallback[]; + + /** Agent createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Agent updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Agent guardrails. */ + public guardrails: string[]; + + /** Agent etag. */ + public etag: string; + + /** Agent toolsets. */ + public toolsets: google.cloud.ces.v1beta.Agent.IAgentToolset[]; + + /** Agent generatedSummary. */ + public generatedSummary: string; + + /** Agent transferRules. */ + public transferRules: google.cloud.ces.v1beta.ITransferRule[]; + + /** Agent agentType. */ + public agentType?: ("llmAgent"|"remoteDialogflowAgent"); + + /** + * Creates a new Agent instance using the specified properties. + * @param [properties] Properties to set + * @returns Agent instance + */ + public static create(properties?: google.cloud.ces.v1beta.IAgent): google.cloud.ces.v1beta.Agent; + + /** + * Encodes the specified Agent message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.verify|verify} messages. + * @param message Agent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Agent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.verify|verify} messages. + * @param message Agent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Agent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Agent; + + /** + * Decodes an Agent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Agent; + + /** + * Verifies an Agent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Agent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Agent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Agent; + + /** + * Creates a plain object from an Agent message. Also converts values to other types if specified. + * @param message Agent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Agent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Agent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Agent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Agent { + + /** Properties of a LlmAgent. */ + interface ILlmAgent { + } + + /** Represents a LlmAgent. */ + class LlmAgent implements ILlmAgent { + + /** + * Constructs a new LlmAgent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Agent.ILlmAgent); + + /** + * Creates a new LlmAgent instance using the specified properties. + * @param [properties] Properties to set + * @returns LlmAgent instance + */ + public static create(properties?: google.cloud.ces.v1beta.Agent.ILlmAgent): google.cloud.ces.v1beta.Agent.LlmAgent; + + /** + * Encodes the specified LlmAgent message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.LlmAgent.verify|verify} messages. + * @param message LlmAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Agent.ILlmAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LlmAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.LlmAgent.verify|verify} messages. + * @param message LlmAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Agent.ILlmAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LlmAgent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LlmAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Agent.LlmAgent; + + /** + * Decodes a LlmAgent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LlmAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Agent.LlmAgent; + + /** + * Verifies a LlmAgent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LlmAgent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LlmAgent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Agent.LlmAgent; + + /** + * Creates a plain object from a LlmAgent message. Also converts values to other types if specified. + * @param message LlmAgent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Agent.LlmAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LlmAgent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LlmAgent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RemoteDialogflowAgent. */ + interface IRemoteDialogflowAgent { + + /** RemoteDialogflowAgent agent */ + agent?: (string|null); + + /** RemoteDialogflowAgent flowId */ + flowId?: (string|null); + + /** RemoteDialogflowAgent environmentId */ + environmentId?: (string|null); + + /** RemoteDialogflowAgent inputVariableMapping */ + inputVariableMapping?: ({ [k: string]: string }|null); + + /** RemoteDialogflowAgent outputVariableMapping */ + outputVariableMapping?: ({ [k: string]: string }|null); + + /** RemoteDialogflowAgent respectResponseInterruptionSettings */ + respectResponseInterruptionSettings?: (boolean|null); + } + + /** Represents a RemoteDialogflowAgent. */ + class RemoteDialogflowAgent implements IRemoteDialogflowAgent { + + /** + * Constructs a new RemoteDialogflowAgent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent); + + /** RemoteDialogflowAgent agent. */ + public agent: string; + + /** RemoteDialogflowAgent flowId. */ + public flowId: string; + + /** RemoteDialogflowAgent environmentId. */ + public environmentId: string; + + /** RemoteDialogflowAgent inputVariableMapping. */ + public inputVariableMapping: { [k: string]: string }; + + /** RemoteDialogflowAgent outputVariableMapping. */ + public outputVariableMapping: { [k: string]: string }; + + /** RemoteDialogflowAgent respectResponseInterruptionSettings. */ + public respectResponseInterruptionSettings: boolean; + + /** + * Creates a new RemoteDialogflowAgent instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoteDialogflowAgent instance + */ + public static create(properties?: google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent): google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent; + + /** + * Encodes the specified RemoteDialogflowAgent message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.verify|verify} messages. + * @param message RemoteDialogflowAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoteDialogflowAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.verify|verify} messages. + * @param message RemoteDialogflowAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoteDialogflowAgent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoteDialogflowAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent; + + /** + * Decodes a RemoteDialogflowAgent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoteDialogflowAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent; + + /** + * Verifies a RemoteDialogflowAgent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoteDialogflowAgent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoteDialogflowAgent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent; + + /** + * Creates a plain object from a RemoteDialogflowAgent message. Also converts values to other types if specified. + * @param message RemoteDialogflowAgent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoteDialogflowAgent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoteDialogflowAgent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AgentToolset. */ + interface IAgentToolset { + + /** AgentToolset toolset */ + toolset?: (string|null); + + /** AgentToolset toolIds */ + toolIds?: (string[]|null); + } + + /** Represents an AgentToolset. */ + class AgentToolset implements IAgentToolset { + + /** + * Constructs a new AgentToolset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Agent.IAgentToolset); + + /** AgentToolset toolset. */ + public toolset: string; + + /** AgentToolset toolIds. */ + public toolIds: string[]; + + /** + * Creates a new AgentToolset instance using the specified properties. + * @param [properties] Properties to set + * @returns AgentToolset instance + */ + public static create(properties?: google.cloud.ces.v1beta.Agent.IAgentToolset): google.cloud.ces.v1beta.Agent.AgentToolset; + + /** + * Encodes the specified AgentToolset message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.AgentToolset.verify|verify} messages. + * @param message AgentToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Agent.IAgentToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AgentToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.AgentToolset.verify|verify} messages. + * @param message AgentToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Agent.IAgentToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AgentToolset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AgentToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Agent.AgentToolset; + + /** + * Decodes an AgentToolset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AgentToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Agent.AgentToolset; + + /** + * Verifies an AgentToolset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AgentToolset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AgentToolset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Agent.AgentToolset; + + /** + * Creates a plain object from an AgentToolset message. Also converts values to other types if specified. + * @param message AgentToolset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Agent.AgentToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AgentToolset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AgentToolset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExpressionCondition. */ + interface IExpressionCondition { + + /** ExpressionCondition expression */ + expression?: (string|null); + } + + /** Represents an ExpressionCondition. */ + class ExpressionCondition implements IExpressionCondition { + + /** + * Constructs a new ExpressionCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IExpressionCondition); + + /** ExpressionCondition expression. */ + public expression: string; + + /** + * Creates a new ExpressionCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns ExpressionCondition instance + */ + public static create(properties?: google.cloud.ces.v1beta.IExpressionCondition): google.cloud.ces.v1beta.ExpressionCondition; + + /** + * Encodes the specified ExpressionCondition message. Does not implicitly {@link google.cloud.ces.v1beta.ExpressionCondition.verify|verify} messages. + * @param message ExpressionCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IExpressionCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExpressionCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExpressionCondition.verify|verify} messages. + * @param message ExpressionCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IExpressionCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExpressionCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExpressionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ExpressionCondition; + + /** + * Decodes an ExpressionCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExpressionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ExpressionCondition; + + /** + * Verifies an ExpressionCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExpressionCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExpressionCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ExpressionCondition; + + /** + * Creates a plain object from an ExpressionCondition message. Also converts values to other types if specified. + * @param message ExpressionCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ExpressionCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExpressionCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExpressionCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonCodeCondition. */ + interface IPythonCodeCondition { + + /** PythonCodeCondition pythonCode */ + pythonCode?: (string|null); + } + + /** Represents a PythonCodeCondition. */ + class PythonCodeCondition implements IPythonCodeCondition { + + /** + * Constructs a new PythonCodeCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IPythonCodeCondition); + + /** PythonCodeCondition pythonCode. */ + public pythonCode: string; + + /** + * Creates a new PythonCodeCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonCodeCondition instance + */ + public static create(properties?: google.cloud.ces.v1beta.IPythonCodeCondition): google.cloud.ces.v1beta.PythonCodeCondition; + + /** + * Encodes the specified PythonCodeCondition message. Does not implicitly {@link google.cloud.ces.v1beta.PythonCodeCondition.verify|verify} messages. + * @param message PythonCodeCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IPythonCodeCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonCodeCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.PythonCodeCondition.verify|verify} messages. + * @param message PythonCodeCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IPythonCodeCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonCodeCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonCodeCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.PythonCodeCondition; + + /** + * Decodes a PythonCodeCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonCodeCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.PythonCodeCondition; + + /** + * Verifies a PythonCodeCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonCodeCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonCodeCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.PythonCodeCondition; + + /** + * Creates a plain object from a PythonCodeCondition message. Also converts values to other types if specified. + * @param message PythonCodeCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.PythonCodeCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonCodeCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonCodeCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferRule. */ + interface ITransferRule { + + /** TransferRule deterministicTransfer */ + deterministicTransfer?: (google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer|null); + + /** TransferRule disablePlannerTransfer */ + disablePlannerTransfer?: (google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer|null); + + /** TransferRule childAgent */ + childAgent?: (string|null); + + /** TransferRule direction */ + direction?: (google.cloud.ces.v1beta.TransferRule.Direction|keyof typeof google.cloud.ces.v1beta.TransferRule.Direction|null); + } + + /** Represents a TransferRule. */ + class TransferRule implements ITransferRule { + + /** + * Constructs a new TransferRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ITransferRule); + + /** TransferRule deterministicTransfer. */ + public deterministicTransfer?: (google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer|null); + + /** TransferRule disablePlannerTransfer. */ + public disablePlannerTransfer?: (google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer|null); + + /** TransferRule childAgent. */ + public childAgent: string; + + /** TransferRule direction. */ + public direction: (google.cloud.ces.v1beta.TransferRule.Direction|keyof typeof google.cloud.ces.v1beta.TransferRule.Direction); + + /** TransferRule ruleType. */ + public ruleType?: ("deterministicTransfer"|"disablePlannerTransfer"); + + /** + * Creates a new TransferRule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferRule instance + */ + public static create(properties?: google.cloud.ces.v1beta.ITransferRule): google.cloud.ces.v1beta.TransferRule; + + /** + * Encodes the specified TransferRule message. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.verify|verify} messages. + * @param message TransferRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ITransferRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferRule message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.verify|verify} messages. + * @param message TransferRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ITransferRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TransferRule; + + /** + * Decodes a TransferRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TransferRule; + + /** + * Verifies a TransferRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TransferRule; + + /** + * Creates a plain object from a TransferRule message. Also converts values to other types if specified. + * @param message TransferRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TransferRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransferRule { + + /** Properties of a DeterministicTransfer. */ + interface IDeterministicTransfer { + + /** DeterministicTransfer expressionCondition */ + expressionCondition?: (google.cloud.ces.v1beta.IExpressionCondition|null); + + /** DeterministicTransfer pythonCodeCondition */ + pythonCodeCondition?: (google.cloud.ces.v1beta.IPythonCodeCondition|null); + } + + /** Represents a DeterministicTransfer. */ + class DeterministicTransfer implements IDeterministicTransfer { + + /** + * Constructs a new DeterministicTransfer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer); + + /** DeterministicTransfer expressionCondition. */ + public expressionCondition?: (google.cloud.ces.v1beta.IExpressionCondition|null); + + /** DeterministicTransfer pythonCodeCondition. */ + public pythonCodeCondition?: (google.cloud.ces.v1beta.IPythonCodeCondition|null); + + /** DeterministicTransfer conditionType. */ + public conditionType?: ("expressionCondition"|"pythonCodeCondition"); + + /** + * Creates a new DeterministicTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns DeterministicTransfer instance + */ + public static create(properties?: google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer): google.cloud.ces.v1beta.TransferRule.DeterministicTransfer; + + /** + * Encodes the specified DeterministicTransfer message. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.verify|verify} messages. + * @param message DeterministicTransfer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeterministicTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.verify|verify} messages. + * @param message DeterministicTransfer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeterministicTransfer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeterministicTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TransferRule.DeterministicTransfer; + + /** + * Decodes a DeterministicTransfer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeterministicTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TransferRule.DeterministicTransfer; + + /** + * Verifies a DeterministicTransfer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeterministicTransfer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeterministicTransfer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TransferRule.DeterministicTransfer; + + /** + * Creates a plain object from a DeterministicTransfer message. Also converts values to other types if specified. + * @param message DeterministicTransfer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TransferRule.DeterministicTransfer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeterministicTransfer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeterministicTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisablePlannerTransfer. */ + interface IDisablePlannerTransfer { + + /** DisablePlannerTransfer expressionCondition */ + expressionCondition?: (google.cloud.ces.v1beta.IExpressionCondition|null); + } + + /** Represents a DisablePlannerTransfer. */ + class DisablePlannerTransfer implements IDisablePlannerTransfer { + + /** + * Constructs a new DisablePlannerTransfer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer); + + /** DisablePlannerTransfer expressionCondition. */ + public expressionCondition?: (google.cloud.ces.v1beta.IExpressionCondition|null); + + /** + * Creates a new DisablePlannerTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns DisablePlannerTransfer instance + */ + public static create(properties?: google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer): google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer; + + /** + * Encodes the specified DisablePlannerTransfer message. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.verify|verify} messages. + * @param message DisablePlannerTransfer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisablePlannerTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.verify|verify} messages. + * @param message DisablePlannerTransfer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisablePlannerTransfer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisablePlannerTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer; + + /** + * Decodes a DisablePlannerTransfer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisablePlannerTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer; + + /** + * Verifies a DisablePlannerTransfer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisablePlannerTransfer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisablePlannerTransfer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer; + + /** + * Creates a plain object from a DisablePlannerTransfer message. Also converts values to other types if specified. + * @param message DisablePlannerTransfer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisablePlannerTransfer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisablePlannerTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Direction enum. */ + enum Direction { + DIRECTION_UNSPECIFIED = 0, + PARENT_TO_CHILD = 1, + CHILD_TO_PARENT = 2 + } + } + + /** ExecutionType enum. */ + enum ExecutionType { + EXECUTION_TYPE_UNSPECIFIED = 0, + SYNCHRONOUS = 1, + ASYNCHRONOUS = 2 + } + + /** Properties of a Callback. */ + interface ICallback { + + /** Callback pythonCode */ + pythonCode?: (string|null); + + /** Callback description */ + description?: (string|null); + + /** Callback disabled */ + disabled?: (boolean|null); + + /** Callback proactiveExecutionEnabled */ + proactiveExecutionEnabled?: (boolean|null); + } + + /** Represents a Callback. */ + class Callback implements ICallback { + + /** + * Constructs a new Callback. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICallback); + + /** Callback pythonCode. */ + public pythonCode?: (string|null); + + /** Callback description. */ + public description: string; + + /** Callback disabled. */ + public disabled: boolean; + + /** Callback proactiveExecutionEnabled. */ + public proactiveExecutionEnabled: boolean; + + /** Callback callback. */ + public callback?: "pythonCode"; + + /** + * Creates a new Callback instance using the specified properties. + * @param [properties] Properties to set + * @returns Callback instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICallback): google.cloud.ces.v1beta.Callback; + + /** + * Encodes the specified Callback message. Does not implicitly {@link google.cloud.ces.v1beta.Callback.verify|verify} messages. + * @param message Callback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICallback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Callback message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Callback.verify|verify} messages. + * @param message Callback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICallback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Callback message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Callback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Callback; + + /** + * Decodes a Callback message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Callback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Callback; + + /** + * Verifies a Callback message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Callback message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Callback + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Callback; + + /** + * Creates a plain object from a Callback message. Also converts values to other types if specified. + * @param message Callback + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Callback, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Callback to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Callback + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModelSettings. */ + interface IModelSettings { + + /** ModelSettings model */ + model?: (string|null); + + /** ModelSettings temperature */ + temperature?: (number|null); + } + + /** Represents a ModelSettings. */ + class ModelSettings implements IModelSettings { + + /** + * Constructs a new ModelSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IModelSettings); + + /** ModelSettings model. */ + public model: string; + + /** ModelSettings temperature. */ + public temperature?: (number|null); + + /** + * Creates a new ModelSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.IModelSettings): google.cloud.ces.v1beta.ModelSettings; + + /** + * Encodes the specified ModelSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ModelSettings.verify|verify} messages. + * @param message ModelSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IModelSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ModelSettings.verify|verify} messages. + * @param message ModelSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IModelSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ModelSettings; + + /** + * Decodes a ModelSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ModelSettings; + + /** + * Verifies a ModelSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ModelSettings; + + /** + * Creates a plain object from a ModelSettings message. Also converts values to other types if specified. + * @param message ModelSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ModelSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TriggerAction. */ + interface ITriggerAction { + + /** TriggerAction respondImmediately */ + respondImmediately?: (google.cloud.ces.v1beta.TriggerAction.IRespondImmediately|null); + + /** TriggerAction transferAgent */ + transferAgent?: (google.cloud.ces.v1beta.TriggerAction.ITransferAgent|null); + + /** TriggerAction generativeAnswer */ + generativeAnswer?: (google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer|null); + } + + /** Represents a TriggerAction. */ + class TriggerAction implements ITriggerAction { + + /** + * Constructs a new TriggerAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ITriggerAction); + + /** TriggerAction respondImmediately. */ + public respondImmediately?: (google.cloud.ces.v1beta.TriggerAction.IRespondImmediately|null); + + /** TriggerAction transferAgent. */ + public transferAgent?: (google.cloud.ces.v1beta.TriggerAction.ITransferAgent|null); + + /** TriggerAction generativeAnswer. */ + public generativeAnswer?: (google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer|null); + + /** TriggerAction action. */ + public action?: ("respondImmediately"|"transferAgent"|"generativeAnswer"); + + /** + * Creates a new TriggerAction instance using the specified properties. + * @param [properties] Properties to set + * @returns TriggerAction instance + */ + public static create(properties?: google.cloud.ces.v1beta.ITriggerAction): google.cloud.ces.v1beta.TriggerAction; + + /** + * Encodes the specified TriggerAction message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.verify|verify} messages. + * @param message TriggerAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ITriggerAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TriggerAction message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.verify|verify} messages. + * @param message TriggerAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ITriggerAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TriggerAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TriggerAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TriggerAction; + + /** + * Decodes a TriggerAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TriggerAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TriggerAction; + + /** + * Verifies a TriggerAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TriggerAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TriggerAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TriggerAction; + + /** + * Creates a plain object from a TriggerAction message. Also converts values to other types if specified. + * @param message TriggerAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TriggerAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TriggerAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TriggerAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TriggerAction { + + /** Properties of a Response. */ + interface IResponse { + + /** Response text */ + text?: (string|null); + + /** Response disabled */ + disabled?: (boolean|null); + } + + /** Represents a Response. */ + class Response implements IResponse { + + /** + * Constructs a new Response. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.TriggerAction.IResponse); + + /** Response text. */ + public text: string; + + /** Response disabled. */ + public disabled: boolean; + + /** + * Creates a new Response instance using the specified properties. + * @param [properties] Properties to set + * @returns Response instance + */ + public static create(properties?: google.cloud.ces.v1beta.TriggerAction.IResponse): google.cloud.ces.v1beta.TriggerAction.Response; + + /** + * Encodes the specified Response message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.Response.verify|verify} messages. + * @param message Response message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.TriggerAction.IResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Response message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.Response.verify|verify} messages. + * @param message Response message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.TriggerAction.IResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Response message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Response + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TriggerAction.Response; + + /** + * Decodes a Response message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Response + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TriggerAction.Response; + + /** + * Verifies a Response message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Response message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Response + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TriggerAction.Response; + + /** + * Creates a plain object from a Response message. Also converts values to other types if specified. + * @param message Response + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TriggerAction.Response, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Response to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Response + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RespondImmediately. */ + interface IRespondImmediately { + + /** RespondImmediately responses */ + responses?: (google.cloud.ces.v1beta.TriggerAction.IResponse[]|null); + } + + /** Represents a RespondImmediately. */ + class RespondImmediately implements IRespondImmediately { + + /** + * Constructs a new RespondImmediately. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.TriggerAction.IRespondImmediately); + + /** RespondImmediately responses. */ + public responses: google.cloud.ces.v1beta.TriggerAction.IResponse[]; + + /** + * Creates a new RespondImmediately instance using the specified properties. + * @param [properties] Properties to set + * @returns RespondImmediately instance + */ + public static create(properties?: google.cloud.ces.v1beta.TriggerAction.IRespondImmediately): google.cloud.ces.v1beta.TriggerAction.RespondImmediately; + + /** + * Encodes the specified RespondImmediately message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.RespondImmediately.verify|verify} messages. + * @param message RespondImmediately message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.TriggerAction.IRespondImmediately, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RespondImmediately message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.RespondImmediately.verify|verify} messages. + * @param message RespondImmediately message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.TriggerAction.IRespondImmediately, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RespondImmediately message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RespondImmediately + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TriggerAction.RespondImmediately; + + /** + * Decodes a RespondImmediately message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RespondImmediately + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TriggerAction.RespondImmediately; + + /** + * Verifies a RespondImmediately message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RespondImmediately message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RespondImmediately + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TriggerAction.RespondImmediately; + + /** + * Creates a plain object from a RespondImmediately message. Also converts values to other types if specified. + * @param message RespondImmediately + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TriggerAction.RespondImmediately, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RespondImmediately to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RespondImmediately + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerativeAnswer. */ + interface IGenerativeAnswer { + + /** GenerativeAnswer prompt */ + prompt?: (string|null); + } + + /** Represents a GenerativeAnswer. */ + class GenerativeAnswer implements IGenerativeAnswer { + + /** + * Constructs a new GenerativeAnswer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer); + + /** GenerativeAnswer prompt. */ + public prompt: string; + + /** + * Creates a new GenerativeAnswer instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerativeAnswer instance + */ + public static create(properties?: google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer): google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer; + + /** + * Encodes the specified GenerativeAnswer message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.verify|verify} messages. + * @param message GenerativeAnswer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerativeAnswer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.verify|verify} messages. + * @param message GenerativeAnswer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerativeAnswer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerativeAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer; + + /** + * Decodes a GenerativeAnswer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerativeAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer; + + /** + * Verifies a GenerativeAnswer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerativeAnswer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerativeAnswer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer; + + /** + * Creates a plain object from a GenerativeAnswer message. Also converts values to other types if specified. + * @param message GenerativeAnswer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerativeAnswer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerativeAnswer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferAgent. */ + interface ITransferAgent { + + /** TransferAgent agent */ + agent?: (string|null); + } + + /** Represents a TransferAgent. */ + class TransferAgent implements ITransferAgent { + + /** + * Constructs a new TransferAgent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.TriggerAction.ITransferAgent); + + /** TransferAgent agent. */ + public agent: string; + + /** + * Creates a new TransferAgent instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferAgent instance + */ + public static create(properties?: google.cloud.ces.v1beta.TriggerAction.ITransferAgent): google.cloud.ces.v1beta.TriggerAction.TransferAgent; + + /** + * Encodes the specified TransferAgent message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.TransferAgent.verify|verify} messages. + * @param message TransferAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.TriggerAction.ITransferAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.TransferAgent.verify|verify} messages. + * @param message TransferAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.TriggerAction.ITransferAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferAgent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TriggerAction.TransferAgent; + + /** + * Decodes a TransferAgent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TriggerAction.TransferAgent; + + /** + * Verifies a TransferAgent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferAgent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferAgent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TriggerAction.TransferAgent; + + /** + * Creates a plain object from a TransferAgent message. Also converts values to other types if specified. + * @param message TransferAgent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TriggerAction.TransferAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferAgent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferAgent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TlsConfig. */ + interface ITlsConfig { + + /** TlsConfig caCerts */ + caCerts?: (google.cloud.ces.v1beta.TlsConfig.ICaCert[]|null); + } + + /** Represents a TlsConfig. */ + class TlsConfig implements ITlsConfig { + + /** + * Constructs a new TlsConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ITlsConfig); + + /** TlsConfig caCerts. */ + public caCerts: google.cloud.ces.v1beta.TlsConfig.ICaCert[]; + + /** + * Creates a new TlsConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TlsConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.ITlsConfig): google.cloud.ces.v1beta.TlsConfig; + + /** + * Encodes the specified TlsConfig message. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.verify|verify} messages. + * @param message TlsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ITlsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TlsConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.verify|verify} messages. + * @param message TlsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ITlsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TlsConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TlsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TlsConfig; + + /** + * Decodes a TlsConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TlsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TlsConfig; + + /** + * Verifies a TlsConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TlsConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TlsConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TlsConfig; + + /** + * Creates a plain object from a TlsConfig message. Also converts values to other types if specified. + * @param message TlsConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TlsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TlsConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TlsConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TlsConfig { + + /** Properties of a CaCert. */ + interface ICaCert { + + /** CaCert displayName */ + displayName?: (string|null); + + /** CaCert cert */ + cert?: (Uint8Array|Buffer|string|null); + } + + /** Represents a CaCert. */ + class CaCert implements ICaCert { + + /** + * Constructs a new CaCert. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.TlsConfig.ICaCert); + + /** CaCert displayName. */ + public displayName: string; + + /** CaCert cert. */ + public cert: (Uint8Array|Buffer|string); + + /** + * Creates a new CaCert instance using the specified properties. + * @param [properties] Properties to set + * @returns CaCert instance + */ + public static create(properties?: google.cloud.ces.v1beta.TlsConfig.ICaCert): google.cloud.ces.v1beta.TlsConfig.CaCert; + + /** + * Encodes the specified CaCert message. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.CaCert.verify|verify} messages. + * @param message CaCert message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.TlsConfig.ICaCert, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CaCert message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.CaCert.verify|verify} messages. + * @param message CaCert message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.TlsConfig.ICaCert, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CaCert message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CaCert + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TlsConfig.CaCert; + + /** + * Decodes a CaCert message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CaCert + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TlsConfig.CaCert; + + /** + * Verifies a CaCert message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CaCert message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CaCert + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TlsConfig.CaCert; + + /** + * Creates a plain object from a CaCert message. Also converts values to other types if specified. + * @param message CaCert + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TlsConfig.CaCert, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CaCert to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CaCert + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ServiceDirectoryConfig. */ + interface IServiceDirectoryConfig { + + /** ServiceDirectoryConfig service */ + service?: (string|null); + } + + /** Represents a ServiceDirectoryConfig. */ + class ServiceDirectoryConfig implements IServiceDirectoryConfig { + + /** + * Constructs a new ServiceDirectoryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IServiceDirectoryConfig); + + /** ServiceDirectoryConfig service. */ + public service: string; + + /** + * Creates a new ServiceDirectoryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDirectoryConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IServiceDirectoryConfig): google.cloud.ces.v1beta.ServiceDirectoryConfig; + + /** + * Encodes the specified ServiceDirectoryConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ServiceDirectoryConfig.verify|verify} messages. + * @param message ServiceDirectoryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IServiceDirectoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDirectoryConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ServiceDirectoryConfig.verify|verify} messages. + * @param message ServiceDirectoryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IServiceDirectoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ServiceDirectoryConfig; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ServiceDirectoryConfig; + + /** + * Verifies a ServiceDirectoryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDirectoryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDirectoryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ServiceDirectoryConfig; + + /** + * Creates a plain object from a ServiceDirectoryConfig message. Also converts values to other types if specified. + * @param message ServiceDirectoryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ServiceDirectoryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDirectoryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDirectoryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChannelProfile. */ + interface IChannelProfile { + + /** ChannelProfile profileId */ + profileId?: (string|null); + + /** ChannelProfile channelType */ + channelType?: (google.cloud.ces.v1beta.ChannelProfile.ChannelType|keyof typeof google.cloud.ces.v1beta.ChannelProfile.ChannelType|null); + + /** ChannelProfile personaProperty */ + personaProperty?: (google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty|null); + + /** ChannelProfile disableDtmf */ + disableDtmf?: (boolean|null); + + /** ChannelProfile disableBargeInControl */ + disableBargeInControl?: (boolean|null); + + /** ChannelProfile webWidgetConfig */ + webWidgetConfig?: (google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig|null); + + /** ChannelProfile noiseSuppressionLevel */ + noiseSuppressionLevel?: (string|null); + } + + /** Represents a ChannelProfile. */ + class ChannelProfile implements IChannelProfile { + + /** + * Constructs a new ChannelProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IChannelProfile); + + /** ChannelProfile profileId. */ + public profileId: string; + + /** ChannelProfile channelType. */ + public channelType: (google.cloud.ces.v1beta.ChannelProfile.ChannelType|keyof typeof google.cloud.ces.v1beta.ChannelProfile.ChannelType); + + /** ChannelProfile personaProperty. */ + public personaProperty?: (google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty|null); + + /** ChannelProfile disableDtmf. */ + public disableDtmf: boolean; + + /** ChannelProfile disableBargeInControl. */ + public disableBargeInControl: boolean; + + /** ChannelProfile webWidgetConfig. */ + public webWidgetConfig?: (google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig|null); + + /** ChannelProfile noiseSuppressionLevel. */ + public noiseSuppressionLevel: string; + + /** + * Creates a new ChannelProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns ChannelProfile instance + */ + public static create(properties?: google.cloud.ces.v1beta.IChannelProfile): google.cloud.ces.v1beta.ChannelProfile; + + /** + * Encodes the specified ChannelProfile message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.verify|verify} messages. + * @param message ChannelProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IChannelProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChannelProfile message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.verify|verify} messages. + * @param message ChannelProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IChannelProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChannelProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChannelProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ChannelProfile; + + /** + * Decodes a ChannelProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChannelProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ChannelProfile; + + /** + * Verifies a ChannelProfile message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChannelProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChannelProfile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ChannelProfile; + + /** + * Creates a plain object from a ChannelProfile message. Also converts values to other types if specified. + * @param message ChannelProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ChannelProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChannelProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChannelProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ChannelProfile { + + /** Properties of a PersonaProperty. */ + interface IPersonaProperty { + + /** PersonaProperty persona */ + persona?: (google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona|keyof typeof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona|null); + } + + /** Represents a PersonaProperty. */ + class PersonaProperty implements IPersonaProperty { + + /** + * Constructs a new PersonaProperty. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty); + + /** PersonaProperty persona. */ + public persona: (google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona|keyof typeof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona); + + /** + * Creates a new PersonaProperty instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonaProperty instance + */ + public static create(properties?: google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty): google.cloud.ces.v1beta.ChannelProfile.PersonaProperty; + + /** + * Encodes the specified PersonaProperty message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.verify|verify} messages. + * @param message PersonaProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersonaProperty message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.verify|verify} messages. + * @param message PersonaProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersonaProperty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonaProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ChannelProfile.PersonaProperty; + + /** + * Decodes a PersonaProperty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonaProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ChannelProfile.PersonaProperty; + + /** + * Verifies a PersonaProperty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PersonaProperty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonaProperty + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ChannelProfile.PersonaProperty; + + /** + * Creates a plain object from a PersonaProperty message. Also converts values to other types if specified. + * @param message PersonaProperty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ChannelProfile.PersonaProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersonaProperty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PersonaProperty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PersonaProperty { + + /** Persona enum. */ + enum Persona { + UNKNOWN = 0, + CONCISE = 1, + CHATTY = 2 + } + } + + /** Properties of a WebWidgetConfig. */ + interface IWebWidgetConfig { + + /** WebWidgetConfig modality */ + modality?: (google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality|keyof typeof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality|null); + + /** WebWidgetConfig theme */ + theme?: (google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme|keyof typeof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme|null); + + /** WebWidgetConfig webWidgetTitle */ + webWidgetTitle?: (string|null); + + /** WebWidgetConfig securitySettings */ + securitySettings?: (google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings|null); + } + + /** Represents a WebWidgetConfig. */ + class WebWidgetConfig implements IWebWidgetConfig { + + /** + * Constructs a new WebWidgetConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig); + + /** WebWidgetConfig modality. */ + public modality: (google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality|keyof typeof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality); + + /** WebWidgetConfig theme. */ + public theme: (google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme|keyof typeof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme); + + /** WebWidgetConfig webWidgetTitle. */ + public webWidgetTitle: string; + + /** WebWidgetConfig securitySettings. */ + public securitySettings?: (google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings|null); + + /** + * Creates a new WebWidgetConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns WebWidgetConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig; + + /** + * Encodes the specified WebWidgetConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.verify|verify} messages. + * @param message WebWidgetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebWidgetConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.verify|verify} messages. + * @param message WebWidgetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebWidgetConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebWidgetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig; + + /** + * Decodes a WebWidgetConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebWidgetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig; + + /** + * Verifies a WebWidgetConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebWidgetConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebWidgetConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig; + + /** + * Creates a plain object from a WebWidgetConfig message. Also converts values to other types if specified. + * @param message WebWidgetConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebWidgetConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebWidgetConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WebWidgetConfig { + + /** Properties of a SecuritySettings. */ + interface ISecuritySettings { + + /** SecuritySettings enablePublicAccess */ + enablePublicAccess?: (boolean|null); + + /** SecuritySettings enableOriginCheck */ + enableOriginCheck?: (boolean|null); + + /** SecuritySettings allowedOrigins */ + allowedOrigins?: (string[]|null); + + /** SecuritySettings enableRecaptcha */ + enableRecaptcha?: (boolean|null); + } + + /** Represents a SecuritySettings. */ + class SecuritySettings implements ISecuritySettings { + + /** + * Constructs a new SecuritySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings); + + /** SecuritySettings enablePublicAccess. */ + public enablePublicAccess: boolean; + + /** SecuritySettings enableOriginCheck. */ + public enableOriginCheck: boolean; + + /** SecuritySettings allowedOrigins. */ + public allowedOrigins: string[]; + + /** SecuritySettings enableRecaptcha. */ + public enableRecaptcha: boolean; + + /** + * Creates a new SecuritySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SecuritySettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings; + + /** + * Encodes the specified SecuritySettings message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. + * @param message SecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. + * @param message SecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings; + + /** + * Verifies a SecuritySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecuritySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecuritySettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings; + + /** + * Creates a plain object from a SecuritySettings message. Also converts values to other types if specified. + * @param message SecuritySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecuritySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecuritySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Modality enum. */ + enum Modality { + MODALITY_UNSPECIFIED = 0, + CHAT_AND_VOICE = 1, + VOICE_ONLY = 2, + CHAT_ONLY = 3 + } + + /** Theme enum. */ + enum Theme { + THEME_UNSPECIFIED = 0, + LIGHT = 1, + DARK = 2 + } + } + + /** ChannelType enum. */ + enum ChannelType { + UNKNOWN = 0, + WEB_UI = 2, + API = 3, + TWILIO = 4, + GOOGLE_TELEPHONY_PLATFORM = 5, + CONTACT_CENTER_AS_A_SERVICE = 6, + FIVE9 = 7, + CONTACT_CENTER_INTEGRATION = 8 + } + } + + /** Properties of a Span. */ + interface ISpan { + + /** Span name */ + name?: (string|null); + + /** Span startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Span endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Span duration */ + duration?: (google.protobuf.IDuration|null); + + /** Span attributes */ + attributes?: (google.protobuf.IStruct|null); + + /** Span childSpans */ + childSpans?: (google.cloud.ces.v1beta.ISpan[]|null); + } + + /** Represents a Span. */ + class Span implements ISpan { + + /** + * Constructs a new Span. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ISpan); + + /** Span name. */ + public name: string; + + /** Span startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Span endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Span duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** Span attributes. */ + public attributes?: (google.protobuf.IStruct|null); + + /** Span childSpans. */ + public childSpans: google.cloud.ces.v1beta.ISpan[]; + + /** + * Creates a new Span instance using the specified properties. + * @param [properties] Properties to set + * @returns Span instance + */ + public static create(properties?: google.cloud.ces.v1beta.ISpan): google.cloud.ces.v1beta.Span; + + /** + * Encodes the specified Span message. Does not implicitly {@link google.cloud.ces.v1beta.Span.verify|verify} messages. + * @param message Span message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ISpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Span message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Span.verify|verify} messages. + * @param message Span message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ISpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Span message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Span + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Span; + + /** + * Decodes a Span message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Span + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Span; + + /** + * Verifies a Span message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Span message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Span + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Span; + + /** + * Creates a plain object from a Span message. Also converts values to other types if specified. + * @param message Span + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Span, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Span to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Span + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an AgentService */ + class AgentService extends $protobuf.rpc.Service { + + /** + * Constructs a new AgentService 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 AgentService 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): AgentService; + + /** + * Calls ListApps. + * @param request ListAppsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAppsResponse + */ + public listApps(request: google.cloud.ces.v1beta.IListAppsRequest, callback: google.cloud.ces.v1beta.AgentService.ListAppsCallback): void; + + /** + * Calls ListApps. + * @param request ListAppsRequest message or plain object + * @returns Promise + */ + public listApps(request: google.cloud.ces.v1beta.IListAppsRequest): Promise; + + /** + * Calls GetApp. + * @param request GetAppRequest message or plain object + * @param callback Node-style callback called with the error, if any, and App + */ + public getApp(request: google.cloud.ces.v1beta.IGetAppRequest, callback: google.cloud.ces.v1beta.AgentService.GetAppCallback): void; + + /** + * Calls GetApp. + * @param request GetAppRequest message or plain object + * @returns Promise + */ + public getApp(request: google.cloud.ces.v1beta.IGetAppRequest): Promise; + + /** + * Calls CreateApp. + * @param request CreateAppRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createApp(request: google.cloud.ces.v1beta.ICreateAppRequest, callback: google.cloud.ces.v1beta.AgentService.CreateAppCallback): void; + + /** + * Calls CreateApp. + * @param request CreateAppRequest message or plain object + * @returns Promise + */ + public createApp(request: google.cloud.ces.v1beta.ICreateAppRequest): Promise; + + /** + * Calls UpdateApp. + * @param request UpdateAppRequest message or plain object + * @param callback Node-style callback called with the error, if any, and App + */ + public updateApp(request: google.cloud.ces.v1beta.IUpdateAppRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateAppCallback): void; + + /** + * Calls UpdateApp. + * @param request UpdateAppRequest message or plain object + * @returns Promise + */ + public updateApp(request: google.cloud.ces.v1beta.IUpdateAppRequest): Promise; + + /** + * Calls DeleteApp. + * @param request DeleteAppRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteApp(request: google.cloud.ces.v1beta.IDeleteAppRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteAppCallback): void; + + /** + * Calls DeleteApp. + * @param request DeleteAppRequest message or plain object + * @returns Promise + */ + public deleteApp(request: google.cloud.ces.v1beta.IDeleteAppRequest): Promise; + + /** + * Calls ExportApp. + * @param request ExportAppRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportApp(request: google.cloud.ces.v1beta.IExportAppRequest, callback: google.cloud.ces.v1beta.AgentService.ExportAppCallback): void; + + /** + * Calls ExportApp. + * @param request ExportAppRequest message or plain object + * @returns Promise + */ + public exportApp(request: google.cloud.ces.v1beta.IExportAppRequest): Promise; + + /** + * Calls ImportApp. + * @param request ImportAppRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importApp(request: google.cloud.ces.v1beta.IImportAppRequest, callback: google.cloud.ces.v1beta.AgentService.ImportAppCallback): void; + + /** + * Calls ImportApp. + * @param request ImportAppRequest message or plain object + * @returns Promise + */ + public importApp(request: google.cloud.ces.v1beta.IImportAppRequest): Promise; + + /** + * Calls ListAgents. + * @param request ListAgentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAgentsResponse + */ + public listAgents(request: google.cloud.ces.v1beta.IListAgentsRequest, callback: google.cloud.ces.v1beta.AgentService.ListAgentsCallback): void; + + /** + * Calls ListAgents. + * @param request ListAgentsRequest message or plain object + * @returns Promise + */ + public listAgents(request: google.cloud.ces.v1beta.IListAgentsRequest): Promise; + + /** + * Calls GetAgent. + * @param request GetAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Agent + */ + public getAgent(request: google.cloud.ces.v1beta.IGetAgentRequest, callback: google.cloud.ces.v1beta.AgentService.GetAgentCallback): void; + + /** + * Calls GetAgent. + * @param request GetAgentRequest message or plain object + * @returns Promise + */ + public getAgent(request: google.cloud.ces.v1beta.IGetAgentRequest): Promise; + + /** + * Calls CreateAgent. + * @param request CreateAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Agent + */ + public createAgent(request: google.cloud.ces.v1beta.ICreateAgentRequest, callback: google.cloud.ces.v1beta.AgentService.CreateAgentCallback): void; + + /** + * Calls CreateAgent. + * @param request CreateAgentRequest message or plain object + * @returns Promise + */ + public createAgent(request: google.cloud.ces.v1beta.ICreateAgentRequest): Promise; + + /** + * Calls UpdateAgent. + * @param request UpdateAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Agent + */ + public updateAgent(request: google.cloud.ces.v1beta.IUpdateAgentRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateAgentCallback): void; + + /** + * Calls UpdateAgent. + * @param request UpdateAgentRequest message or plain object + * @returns Promise + */ + public updateAgent(request: google.cloud.ces.v1beta.IUpdateAgentRequest): Promise; + + /** + * Calls DeleteAgent. + * @param request DeleteAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAgent(request: google.cloud.ces.v1beta.IDeleteAgentRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteAgentCallback): void; + + /** + * Calls DeleteAgent. + * @param request DeleteAgentRequest message or plain object + * @returns Promise + */ + public deleteAgent(request: google.cloud.ces.v1beta.IDeleteAgentRequest): Promise; + + /** + * Calls ListExamples. + * @param request ListExamplesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListExamplesResponse + */ + public listExamples(request: google.cloud.ces.v1beta.IListExamplesRequest, callback: google.cloud.ces.v1beta.AgentService.ListExamplesCallback): void; + + /** + * Calls ListExamples. + * @param request ListExamplesRequest message or plain object + * @returns Promise + */ + public listExamples(request: google.cloud.ces.v1beta.IListExamplesRequest): Promise; + + /** + * Calls GetExample. + * @param request GetExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Example + */ + public getExample(request: google.cloud.ces.v1beta.IGetExampleRequest, callback: google.cloud.ces.v1beta.AgentService.GetExampleCallback): void; + + /** + * Calls GetExample. + * @param request GetExampleRequest message or plain object + * @returns Promise + */ + public getExample(request: google.cloud.ces.v1beta.IGetExampleRequest): Promise; + + /** + * Calls CreateExample. + * @param request CreateExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Example + */ + public createExample(request: google.cloud.ces.v1beta.ICreateExampleRequest, callback: google.cloud.ces.v1beta.AgentService.CreateExampleCallback): void; + + /** + * Calls CreateExample. + * @param request CreateExampleRequest message or plain object + * @returns Promise + */ + public createExample(request: google.cloud.ces.v1beta.ICreateExampleRequest): Promise; + + /** + * Calls UpdateExample. + * @param request UpdateExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Example + */ + public updateExample(request: google.cloud.ces.v1beta.IUpdateExampleRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateExampleCallback): void; + + /** + * Calls UpdateExample. + * @param request UpdateExampleRequest message or plain object + * @returns Promise + */ + public updateExample(request: google.cloud.ces.v1beta.IUpdateExampleRequest): Promise; + + /** + * Calls DeleteExample. + * @param request DeleteExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteExample(request: google.cloud.ces.v1beta.IDeleteExampleRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteExampleCallback): void; + + /** + * Calls DeleteExample. + * @param request DeleteExampleRequest message or plain object + * @returns Promise + */ + public deleteExample(request: google.cloud.ces.v1beta.IDeleteExampleRequest): Promise; + + /** + * Calls ListTools. + * @param request ListToolsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListToolsResponse + */ + public listTools(request: google.cloud.ces.v1beta.IListToolsRequest, callback: google.cloud.ces.v1beta.AgentService.ListToolsCallback): void; + + /** + * Calls ListTools. + * @param request ListToolsRequest message or plain object + * @returns Promise + */ + public listTools(request: google.cloud.ces.v1beta.IListToolsRequest): Promise; + + /** + * Calls GetTool. + * @param request GetToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tool + */ + public getTool(request: google.cloud.ces.v1beta.IGetToolRequest, callback: google.cloud.ces.v1beta.AgentService.GetToolCallback): void; + + /** + * Calls GetTool. + * @param request GetToolRequest message or plain object + * @returns Promise + */ + public getTool(request: google.cloud.ces.v1beta.IGetToolRequest): Promise; + + /** + * Calls ListConversations. + * @param request ListConversationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListConversationsResponse + */ + public listConversations(request: google.cloud.ces.v1beta.IListConversationsRequest, callback: google.cloud.ces.v1beta.AgentService.ListConversationsCallback): void; + + /** + * Calls ListConversations. + * @param request ListConversationsRequest message or plain object + * @returns Promise + */ + public listConversations(request: google.cloud.ces.v1beta.IListConversationsRequest): Promise; + + /** + * Calls GetConversation. + * @param request GetConversationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Conversation + */ + public getConversation(request: google.cloud.ces.v1beta.IGetConversationRequest, callback: google.cloud.ces.v1beta.AgentService.GetConversationCallback): void; + + /** + * Calls GetConversation. + * @param request GetConversationRequest message or plain object + * @returns Promise + */ + public getConversation(request: google.cloud.ces.v1beta.IGetConversationRequest): Promise; + + /** + * Calls DeleteConversation. + * @param request DeleteConversationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteConversation(request: google.cloud.ces.v1beta.IDeleteConversationRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteConversationCallback): void; + + /** + * Calls DeleteConversation. + * @param request DeleteConversationRequest message or plain object + * @returns Promise + */ + public deleteConversation(request: google.cloud.ces.v1beta.IDeleteConversationRequest): Promise; + + /** + * Calls BatchDeleteConversations. + * @param request BatchDeleteConversationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchDeleteConversations(request: google.cloud.ces.v1beta.IBatchDeleteConversationsRequest, callback: google.cloud.ces.v1beta.AgentService.BatchDeleteConversationsCallback): void; + + /** + * Calls BatchDeleteConversations. + * @param request BatchDeleteConversationsRequest message or plain object + * @returns Promise + */ + public batchDeleteConversations(request: google.cloud.ces.v1beta.IBatchDeleteConversationsRequest): Promise; + + /** + * Calls CreateTool. + * @param request CreateToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tool + */ + public createTool(request: google.cloud.ces.v1beta.ICreateToolRequest, callback: google.cloud.ces.v1beta.AgentService.CreateToolCallback): void; + + /** + * Calls CreateTool. + * @param request CreateToolRequest message or plain object + * @returns Promise + */ + public createTool(request: google.cloud.ces.v1beta.ICreateToolRequest): Promise; + + /** + * Calls UpdateTool. + * @param request UpdateToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tool + */ + public updateTool(request: google.cloud.ces.v1beta.IUpdateToolRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateToolCallback): void; + + /** + * Calls UpdateTool. + * @param request UpdateToolRequest message or plain object + * @returns Promise + */ + public updateTool(request: google.cloud.ces.v1beta.IUpdateToolRequest): Promise; + + /** + * Calls DeleteTool. + * @param request DeleteToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTool(request: google.cloud.ces.v1beta.IDeleteToolRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteToolCallback): void; + + /** + * Calls DeleteTool. + * @param request DeleteToolRequest message or plain object + * @returns Promise + */ + public deleteTool(request: google.cloud.ces.v1beta.IDeleteToolRequest): Promise; + + /** + * Calls ListGuardrails. + * @param request ListGuardrailsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGuardrailsResponse + */ + public listGuardrails(request: google.cloud.ces.v1beta.IListGuardrailsRequest, callback: google.cloud.ces.v1beta.AgentService.ListGuardrailsCallback): void; + + /** + * Calls ListGuardrails. + * @param request ListGuardrailsRequest message or plain object + * @returns Promise + */ + public listGuardrails(request: google.cloud.ces.v1beta.IListGuardrailsRequest): Promise; + + /** + * Calls GetGuardrail. + * @param request GetGuardrailRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Guardrail + */ + public getGuardrail(request: google.cloud.ces.v1beta.IGetGuardrailRequest, callback: google.cloud.ces.v1beta.AgentService.GetGuardrailCallback): void; + + /** + * Calls GetGuardrail. + * @param request GetGuardrailRequest message or plain object + * @returns Promise + */ + public getGuardrail(request: google.cloud.ces.v1beta.IGetGuardrailRequest): Promise; + + /** + * Calls CreateGuardrail. + * @param request CreateGuardrailRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Guardrail + */ + public createGuardrail(request: google.cloud.ces.v1beta.ICreateGuardrailRequest, callback: google.cloud.ces.v1beta.AgentService.CreateGuardrailCallback): void; + + /** + * Calls CreateGuardrail. + * @param request CreateGuardrailRequest message or plain object + * @returns Promise + */ + public createGuardrail(request: google.cloud.ces.v1beta.ICreateGuardrailRequest): Promise; + + /** + * Calls UpdateGuardrail. + * @param request UpdateGuardrailRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Guardrail + */ + public updateGuardrail(request: google.cloud.ces.v1beta.IUpdateGuardrailRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateGuardrailCallback): void; + + /** + * Calls UpdateGuardrail. + * @param request UpdateGuardrailRequest message or plain object + * @returns Promise + */ + public updateGuardrail(request: google.cloud.ces.v1beta.IUpdateGuardrailRequest): Promise; + + /** + * Calls DeleteGuardrail. + * @param request DeleteGuardrailRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteGuardrail(request: google.cloud.ces.v1beta.IDeleteGuardrailRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteGuardrailCallback): void; + + /** + * Calls DeleteGuardrail. + * @param request DeleteGuardrailRequest message or plain object + * @returns Promise + */ + public deleteGuardrail(request: google.cloud.ces.v1beta.IDeleteGuardrailRequest): Promise; + + /** + * Calls ListDeployments. + * @param request ListDeploymentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDeploymentsResponse + */ + public listDeployments(request: google.cloud.ces.v1beta.IListDeploymentsRequest, callback: google.cloud.ces.v1beta.AgentService.ListDeploymentsCallback): void; + + /** + * Calls ListDeployments. + * @param request ListDeploymentsRequest message or plain object + * @returns Promise + */ + public listDeployments(request: google.cloud.ces.v1beta.IListDeploymentsRequest): Promise; + + /** + * Calls GetDeployment. + * @param request GetDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Deployment + */ + public getDeployment(request: google.cloud.ces.v1beta.IGetDeploymentRequest, callback: google.cloud.ces.v1beta.AgentService.GetDeploymentCallback): void; + + /** + * Calls GetDeployment. + * @param request GetDeploymentRequest message or plain object + * @returns Promise + */ + public getDeployment(request: google.cloud.ces.v1beta.IGetDeploymentRequest): Promise; + + /** + * Calls CreateDeployment. + * @param request CreateDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Deployment + */ + public createDeployment(request: google.cloud.ces.v1beta.ICreateDeploymentRequest, callback: google.cloud.ces.v1beta.AgentService.CreateDeploymentCallback): void; + + /** + * Calls CreateDeployment. + * @param request CreateDeploymentRequest message or plain object + * @returns Promise + */ + public createDeployment(request: google.cloud.ces.v1beta.ICreateDeploymentRequest): Promise; + + /** + * Calls UpdateDeployment. + * @param request UpdateDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Deployment + */ + public updateDeployment(request: google.cloud.ces.v1beta.IUpdateDeploymentRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateDeploymentCallback): void; + + /** + * Calls UpdateDeployment. + * @param request UpdateDeploymentRequest message or plain object + * @returns Promise + */ + public updateDeployment(request: google.cloud.ces.v1beta.IUpdateDeploymentRequest): Promise; + + /** + * Calls DeleteDeployment. + * @param request DeleteDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDeployment(request: google.cloud.ces.v1beta.IDeleteDeploymentRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteDeploymentCallback): void; + + /** + * Calls DeleteDeployment. + * @param request DeleteDeploymentRequest message or plain object + * @returns Promise + */ + public deleteDeployment(request: google.cloud.ces.v1beta.IDeleteDeploymentRequest): Promise; + + /** + * Calls ListToolsets. + * @param request ListToolsetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListToolsetsResponse + */ + public listToolsets(request: google.cloud.ces.v1beta.IListToolsetsRequest, callback: google.cloud.ces.v1beta.AgentService.ListToolsetsCallback): void; + + /** + * Calls ListToolsets. + * @param request ListToolsetsRequest message or plain object + * @returns Promise + */ + public listToolsets(request: google.cloud.ces.v1beta.IListToolsetsRequest): Promise; + + /** + * Calls GetToolset. + * @param request GetToolsetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Toolset + */ + public getToolset(request: google.cloud.ces.v1beta.IGetToolsetRequest, callback: google.cloud.ces.v1beta.AgentService.GetToolsetCallback): void; + + /** + * Calls GetToolset. + * @param request GetToolsetRequest message or plain object + * @returns Promise + */ + public getToolset(request: google.cloud.ces.v1beta.IGetToolsetRequest): Promise; + + /** + * Calls CreateToolset. + * @param request CreateToolsetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Toolset + */ + public createToolset(request: google.cloud.ces.v1beta.ICreateToolsetRequest, callback: google.cloud.ces.v1beta.AgentService.CreateToolsetCallback): void; + + /** + * Calls CreateToolset. + * @param request CreateToolsetRequest message or plain object + * @returns Promise + */ + public createToolset(request: google.cloud.ces.v1beta.ICreateToolsetRequest): Promise; + + /** + * Calls UpdateToolset. + * @param request UpdateToolsetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Toolset + */ + public updateToolset(request: google.cloud.ces.v1beta.IUpdateToolsetRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateToolsetCallback): void; + + /** + * Calls UpdateToolset. + * @param request UpdateToolsetRequest message or plain object + * @returns Promise + */ + public updateToolset(request: google.cloud.ces.v1beta.IUpdateToolsetRequest): Promise; + + /** + * Calls DeleteToolset. + * @param request DeleteToolsetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteToolset(request: google.cloud.ces.v1beta.IDeleteToolsetRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteToolsetCallback): void; + + /** + * Calls DeleteToolset. + * @param request DeleteToolsetRequest message or plain object + * @returns Promise + */ + public deleteToolset(request: google.cloud.ces.v1beta.IDeleteToolsetRequest): Promise; + + /** + * Calls ListAppVersions. + * @param request ListAppVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAppVersionsResponse + */ + public listAppVersions(request: google.cloud.ces.v1beta.IListAppVersionsRequest, callback: google.cloud.ces.v1beta.AgentService.ListAppVersionsCallback): void; + + /** + * Calls ListAppVersions. + * @param request ListAppVersionsRequest message or plain object + * @returns Promise + */ + public listAppVersions(request: google.cloud.ces.v1beta.IListAppVersionsRequest): Promise; + + /** + * Calls GetAppVersion. + * @param request GetAppVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AppVersion + */ + public getAppVersion(request: google.cloud.ces.v1beta.IGetAppVersionRequest, callback: google.cloud.ces.v1beta.AgentService.GetAppVersionCallback): void; + + /** + * Calls GetAppVersion. + * @param request GetAppVersionRequest message or plain object + * @returns Promise + */ + public getAppVersion(request: google.cloud.ces.v1beta.IGetAppVersionRequest): Promise; + + /** + * Calls CreateAppVersion. + * @param request CreateAppVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AppVersion + */ + public createAppVersion(request: google.cloud.ces.v1beta.ICreateAppVersionRequest, callback: google.cloud.ces.v1beta.AgentService.CreateAppVersionCallback): void; + + /** + * Calls CreateAppVersion. + * @param request CreateAppVersionRequest message or plain object + * @returns Promise + */ + public createAppVersion(request: google.cloud.ces.v1beta.ICreateAppVersionRequest): Promise; + + /** + * Calls DeleteAppVersion. + * @param request DeleteAppVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAppVersion(request: google.cloud.ces.v1beta.IDeleteAppVersionRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteAppVersionCallback): void; + + /** + * Calls DeleteAppVersion. + * @param request DeleteAppVersionRequest message or plain object + * @returns Promise + */ + public deleteAppVersion(request: google.cloud.ces.v1beta.IDeleteAppVersionRequest): Promise; + + /** + * Calls RestoreAppVersion. + * @param request RestoreAppVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreAppVersion(request: google.cloud.ces.v1beta.IRestoreAppVersionRequest, callback: google.cloud.ces.v1beta.AgentService.RestoreAppVersionCallback): void; + + /** + * Calls RestoreAppVersion. + * @param request RestoreAppVersionRequest message or plain object + * @returns Promise + */ + public restoreAppVersion(request: google.cloud.ces.v1beta.IRestoreAppVersionRequest): Promise; + + /** + * Calls ListChangelogs. + * @param request ListChangelogsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListChangelogsResponse + */ + public listChangelogs(request: google.cloud.ces.v1beta.IListChangelogsRequest, callback: google.cloud.ces.v1beta.AgentService.ListChangelogsCallback): void; + + /** + * Calls ListChangelogs. + * @param request ListChangelogsRequest message or plain object + * @returns Promise + */ + public listChangelogs(request: google.cloud.ces.v1beta.IListChangelogsRequest): Promise; + + /** + * Calls GetChangelog. + * @param request GetChangelogRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Changelog + */ + public getChangelog(request: google.cloud.ces.v1beta.IGetChangelogRequest, callback: google.cloud.ces.v1beta.AgentService.GetChangelogCallback): void; + + /** + * Calls GetChangelog. + * @param request GetChangelogRequest message or plain object + * @returns Promise + */ + public getChangelog(request: google.cloud.ces.v1beta.IGetChangelogRequest): Promise; + } + + namespace AgentService { + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listApps}. + * @param error Error, if any + * @param [response] ListAppsResponse + */ + type ListAppsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListAppsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getApp}. + * @param error Error, if any + * @param [response] App + */ + type GetAppCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.App) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createApp}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateApp}. + * @param error Error, if any + * @param [response] App + */ + type UpdateAppCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.App) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteApp}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|exportApp}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|importApp}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listAgents}. + * @param error Error, if any + * @param [response] ListAgentsResponse + */ + type ListAgentsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListAgentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getAgent}. + * @param error Error, if any + * @param [response] Agent + */ + type GetAgentCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Agent) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createAgent}. + * @param error Error, if any + * @param [response] Agent + */ + type CreateAgentCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Agent) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateAgent}. + * @param error Error, if any + * @param [response] Agent + */ + type UpdateAgentCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Agent) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteAgent}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAgentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listExamples}. + * @param error Error, if any + * @param [response] ListExamplesResponse + */ + type ListExamplesCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListExamplesResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getExample}. + * @param error Error, if any + * @param [response] Example + */ + type GetExampleCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Example) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createExample}. + * @param error Error, if any + * @param [response] Example + */ + type CreateExampleCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Example) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateExample}. + * @param error Error, if any + * @param [response] Example + */ + type UpdateExampleCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Example) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteExample}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteExampleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listTools}. + * @param error Error, if any + * @param [response] ListToolsResponse + */ + type ListToolsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListToolsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getTool}. + * @param error Error, if any + * @param [response] Tool + */ + type GetToolCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Tool) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listConversations}. + * @param error Error, if any + * @param [response] ListConversationsResponse + */ + type ListConversationsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListConversationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getConversation}. + * @param error Error, if any + * @param [response] Conversation + */ + type GetConversationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Conversation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteConversation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteConversationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|batchDeleteConversations}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchDeleteConversationsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createTool}. + * @param error Error, if any + * @param [response] Tool + */ + type CreateToolCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Tool) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateTool}. + * @param error Error, if any + * @param [response] Tool + */ + type UpdateToolCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Tool) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteTool}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteToolCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listGuardrails}. + * @param error Error, if any + * @param [response] ListGuardrailsResponse + */ + type ListGuardrailsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListGuardrailsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getGuardrail}. + * @param error Error, if any + * @param [response] Guardrail + */ + type GetGuardrailCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Guardrail) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createGuardrail}. + * @param error Error, if any + * @param [response] Guardrail + */ + type CreateGuardrailCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Guardrail) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateGuardrail}. + * @param error Error, if any + * @param [response] Guardrail + */ + type UpdateGuardrailCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Guardrail) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteGuardrail}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteGuardrailCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listDeployments}. + * @param error Error, if any + * @param [response] ListDeploymentsResponse + */ + type ListDeploymentsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListDeploymentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getDeployment}. + * @param error Error, if any + * @param [response] Deployment + */ + type GetDeploymentCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Deployment) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createDeployment}. + * @param error Error, if any + * @param [response] Deployment + */ + type CreateDeploymentCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Deployment) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateDeployment}. + * @param error Error, if any + * @param [response] Deployment + */ + type UpdateDeploymentCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Deployment) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteDeployment}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDeploymentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listToolsets}. + * @param error Error, if any + * @param [response] ListToolsetsResponse + */ + type ListToolsetsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListToolsetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getToolset}. + * @param error Error, if any + * @param [response] Toolset + */ + type GetToolsetCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Toolset) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createToolset}. + * @param error Error, if any + * @param [response] Toolset + */ + type CreateToolsetCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Toolset) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateToolset}. + * @param error Error, if any + * @param [response] Toolset + */ + type UpdateToolsetCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Toolset) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteToolset}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteToolsetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listAppVersions}. + * @param error Error, if any + * @param [response] ListAppVersionsResponse + */ + type ListAppVersionsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListAppVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getAppVersion}. + * @param error Error, if any + * @param [response] AppVersion + */ + type GetAppVersionCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.AppVersion) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createAppVersion}. + * @param error Error, if any + * @param [response] AppVersion + */ + type CreateAppVersionCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.AppVersion) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteAppVersion}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAppVersionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|restoreAppVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreAppVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listChangelogs}. + * @param error Error, if any + * @param [response] ListChangelogsResponse + */ + type ListChangelogsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListChangelogsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getChangelog}. + * @param error Error, if any + * @param [response] Changelog + */ + type GetChangelogCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Changelog) => void; + } + + /** Properties of a ListAppsRequest. */ + interface IListAppsRequest { + + /** ListAppsRequest parent */ + parent?: (string|null); + + /** ListAppsRequest pageSize */ + pageSize?: (number|null); + + /** ListAppsRequest pageToken */ + pageToken?: (string|null); + + /** ListAppsRequest filter */ + filter?: (string|null); + + /** ListAppsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListAppsRequest. */ + class ListAppsRequest implements IListAppsRequest { + + /** + * Constructs a new ListAppsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListAppsRequest); + + /** ListAppsRequest parent. */ + public parent: string; + + /** ListAppsRequest pageSize. */ + public pageSize: number; + + /** ListAppsRequest pageToken. */ + public pageToken: string; + + /** ListAppsRequest filter. */ + public filter: string; + + /** ListAppsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListAppsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAppsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListAppsRequest): google.cloud.ces.v1beta.ListAppsRequest; + + /** + * Encodes the specified ListAppsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsRequest.verify|verify} messages. + * @param message ListAppsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListAppsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAppsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsRequest.verify|verify} messages. + * @param message ListAppsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListAppsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAppsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAppsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListAppsRequest; + + /** + * Decodes a ListAppsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAppsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListAppsRequest; + + /** + * Verifies a ListAppsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAppsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAppsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListAppsRequest; + + /** + * Creates a plain object from a ListAppsRequest message. Also converts values to other types if specified. + * @param message ListAppsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListAppsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAppsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAppsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAppsResponse. */ + interface IListAppsResponse { + + /** ListAppsResponse apps */ + apps?: (google.cloud.ces.v1beta.IApp[]|null); + + /** ListAppsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListAppsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListAppsResponse. */ + class ListAppsResponse implements IListAppsResponse { + + /** + * Constructs a new ListAppsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListAppsResponse); + + /** ListAppsResponse apps. */ + public apps: google.cloud.ces.v1beta.IApp[]; + + /** ListAppsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListAppsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListAppsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAppsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListAppsResponse): google.cloud.ces.v1beta.ListAppsResponse; + + /** + * Encodes the specified ListAppsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsResponse.verify|verify} messages. + * @param message ListAppsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListAppsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAppsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsResponse.verify|verify} messages. + * @param message ListAppsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListAppsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAppsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAppsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListAppsResponse; + + /** + * Decodes a ListAppsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAppsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListAppsResponse; + + /** + * Verifies a ListAppsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAppsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAppsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListAppsResponse; + + /** + * Creates a plain object from a ListAppsResponse message. Also converts values to other types if specified. + * @param message ListAppsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListAppsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAppsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAppsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAppRequest. */ + interface IGetAppRequest { + + /** GetAppRequest name */ + name?: (string|null); + } + + /** Represents a GetAppRequest. */ + class GetAppRequest implements IGetAppRequest { + + /** + * Constructs a new GetAppRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetAppRequest); + + /** GetAppRequest name. */ + public name: string; + + /** + * Creates a new GetAppRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAppRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetAppRequest): google.cloud.ces.v1beta.GetAppRequest; + + /** + * Encodes the specified GetAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetAppRequest.verify|verify} messages. + * @param message GetAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetAppRequest.verify|verify} messages. + * @param message GetAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAppRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetAppRequest; + + /** + * Decodes a GetAppRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetAppRequest; + + /** + * Verifies a GetAppRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAppRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAppRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetAppRequest; + + /** + * Creates a plain object from a GetAppRequest message. Also converts values to other types if specified. + * @param message GetAppRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAppRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAppRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAppRequest. */ + interface ICreateAppRequest { + + /** CreateAppRequest parent */ + parent?: (string|null); + + /** CreateAppRequest appId */ + appId?: (string|null); + + /** CreateAppRequest app */ + app?: (google.cloud.ces.v1beta.IApp|null); + } + + /** Represents a CreateAppRequest. */ + class CreateAppRequest implements ICreateAppRequest { + + /** + * Constructs a new CreateAppRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateAppRequest); + + /** CreateAppRequest parent. */ + public parent: string; + + /** CreateAppRequest appId. */ + public appId: string; + + /** CreateAppRequest app. */ + public app?: (google.cloud.ces.v1beta.IApp|null); + + /** + * Creates a new CreateAppRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAppRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateAppRequest): google.cloud.ces.v1beta.CreateAppRequest; + + /** + * Encodes the specified CreateAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppRequest.verify|verify} messages. + * @param message CreateAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppRequest.verify|verify} messages. + * @param message CreateAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAppRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateAppRequest; + + /** + * Decodes a CreateAppRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateAppRequest; + + /** + * Verifies a CreateAppRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAppRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAppRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateAppRequest; + + /** + * Creates a plain object from a CreateAppRequest message. Also converts values to other types if specified. + * @param message CreateAppRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAppRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAppRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAppRequest. */ + interface IUpdateAppRequest { + + /** UpdateAppRequest app */ + app?: (google.cloud.ces.v1beta.IApp|null); + + /** UpdateAppRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAppRequest. */ + class UpdateAppRequest implements IUpdateAppRequest { + + /** + * Constructs a new UpdateAppRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateAppRequest); + + /** UpdateAppRequest app. */ + public app?: (google.cloud.ces.v1beta.IApp|null); + + /** UpdateAppRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAppRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAppRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateAppRequest): google.cloud.ces.v1beta.UpdateAppRequest; + + /** + * Encodes the specified UpdateAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAppRequest.verify|verify} messages. + * @param message UpdateAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAppRequest.verify|verify} messages. + * @param message UpdateAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAppRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateAppRequest; + + /** + * Decodes an UpdateAppRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateAppRequest; + + /** + * Verifies an UpdateAppRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAppRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAppRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateAppRequest; + + /** + * Creates a plain object from an UpdateAppRequest message. Also converts values to other types if specified. + * @param message UpdateAppRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAppRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAppRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAppRequest. */ + interface IDeleteAppRequest { + + /** DeleteAppRequest name */ + name?: (string|null); + + /** DeleteAppRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteAppRequest. */ + class DeleteAppRequest implements IDeleteAppRequest { + + /** + * Constructs a new DeleteAppRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteAppRequest); + + /** DeleteAppRequest name. */ + public name: string; + + /** DeleteAppRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteAppRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAppRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteAppRequest): google.cloud.ces.v1beta.DeleteAppRequest; + + /** + * Encodes the specified DeleteAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppRequest.verify|verify} messages. + * @param message DeleteAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppRequest.verify|verify} messages. + * @param message DeleteAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAppRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteAppRequest; + + /** + * Decodes a DeleteAppRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteAppRequest; + + /** + * Verifies a DeleteAppRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAppRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAppRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteAppRequest; + + /** + * Creates a plain object from a DeleteAppRequest message. Also converts values to other types if specified. + * @param message DeleteAppRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAppRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAppRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportAppRequest. */ + interface IExportAppRequest { + + /** ExportAppRequest name */ + name?: (string|null); + + /** ExportAppRequest exportFormat */ + exportFormat?: (google.cloud.ces.v1beta.ExportAppRequest.ExportFormat|keyof typeof google.cloud.ces.v1beta.ExportAppRequest.ExportFormat|null); + + /** ExportAppRequest gcsUri */ + gcsUri?: (string|null); + } + + /** Represents an ExportAppRequest. */ + class ExportAppRequest implements IExportAppRequest { + + /** + * Constructs a new ExportAppRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IExportAppRequest); + + /** ExportAppRequest name. */ + public name: string; + + /** ExportAppRequest exportFormat. */ + public exportFormat: (google.cloud.ces.v1beta.ExportAppRequest.ExportFormat|keyof typeof google.cloud.ces.v1beta.ExportAppRequest.ExportFormat); + + /** ExportAppRequest gcsUri. */ + public gcsUri: string; + + /** + * Creates a new ExportAppRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAppRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IExportAppRequest): google.cloud.ces.v1beta.ExportAppRequest; + + /** + * Encodes the specified ExportAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppRequest.verify|verify} messages. + * @param message ExportAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IExportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppRequest.verify|verify} messages. + * @param message ExportAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IExportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAppRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ExportAppRequest; + + /** + * Decodes an ExportAppRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ExportAppRequest; + + /** + * Verifies an ExportAppRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportAppRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAppRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ExportAppRequest; + + /** + * Creates a plain object from an ExportAppRequest message. Also converts values to other types if specified. + * @param message ExportAppRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ExportAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAppRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportAppRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportAppRequest { + + /** ExportFormat enum. */ + enum ExportFormat { + EXPORT_FORMAT_UNSPECIFIED = 0, + JSON = 1, + YAML = 2 + } + } + + /** Properties of an ExportAppResponse. */ + interface IExportAppResponse { + + /** ExportAppResponse appContent */ + appContent?: (Uint8Array|Buffer|string|null); + + /** ExportAppResponse appUri */ + appUri?: (string|null); + } + + /** Represents an ExportAppResponse. */ + class ExportAppResponse implements IExportAppResponse { + + /** + * Constructs a new ExportAppResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IExportAppResponse); + + /** ExportAppResponse appContent. */ + public appContent?: (Uint8Array|Buffer|string|null); + + /** ExportAppResponse appUri. */ + public appUri?: (string|null); + + /** ExportAppResponse app. */ + public app?: ("appContent"|"appUri"); + + /** + * Creates a new ExportAppResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAppResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IExportAppResponse): google.cloud.ces.v1beta.ExportAppResponse; + + /** + * Encodes the specified ExportAppResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppResponse.verify|verify} messages. + * @param message ExportAppResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IExportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppResponse.verify|verify} messages. + * @param message ExportAppResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IExportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAppResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ExportAppResponse; + + /** + * Decodes an ExportAppResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ExportAppResponse; + + /** + * Verifies an ExportAppResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportAppResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAppResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ExportAppResponse; + + /** + * Creates a plain object from an ExportAppResponse message. Also converts values to other types if specified. + * @param message ExportAppResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ExportAppResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAppResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportAppResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportAppRequest. */ + interface IImportAppRequest { + + /** ImportAppRequest gcsUri */ + gcsUri?: (string|null); + + /** ImportAppRequest appContent */ + appContent?: (Uint8Array|Buffer|string|null); + + /** ImportAppRequest parent */ + parent?: (string|null); + + /** ImportAppRequest displayName */ + displayName?: (string|null); + + /** ImportAppRequest appId */ + appId?: (string|null); + + /** ImportAppRequest importOptions */ + importOptions?: (google.cloud.ces.v1beta.ImportAppRequest.IImportOptions|null); + + /** ImportAppRequest ignoreAppLock */ + ignoreAppLock?: (boolean|null); + } + + /** Represents an ImportAppRequest. */ + class ImportAppRequest implements IImportAppRequest { + + /** + * Constructs a new ImportAppRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IImportAppRequest); + + /** ImportAppRequest gcsUri. */ + public gcsUri?: (string|null); + + /** ImportAppRequest appContent. */ + public appContent?: (Uint8Array|Buffer|string|null); + + /** ImportAppRequest parent. */ + public parent: string; + + /** ImportAppRequest displayName. */ + public displayName: string; + + /** ImportAppRequest appId. */ + public appId: string; + + /** ImportAppRequest importOptions. */ + public importOptions?: (google.cloud.ces.v1beta.ImportAppRequest.IImportOptions|null); + + /** ImportAppRequest ignoreAppLock. */ + public ignoreAppLock: boolean; + + /** ImportAppRequest app. */ + public app?: ("gcsUri"|"appContent"); + + /** + * Creates a new ImportAppRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportAppRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IImportAppRequest): google.cloud.ces.v1beta.ImportAppRequest; + + /** + * Encodes the specified ImportAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.verify|verify} messages. + * @param message ImportAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IImportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.verify|verify} messages. + * @param message ImportAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IImportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportAppRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportAppRequest; + + /** + * Decodes an ImportAppRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportAppRequest; + + /** + * Verifies an ImportAppRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportAppRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportAppRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportAppRequest; + + /** + * Creates a plain object from an ImportAppRequest message. Also converts values to other types if specified. + * @param message ImportAppRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ImportAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportAppRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportAppRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportAppRequest { + + /** Properties of an ImportOptions. */ + interface IImportOptions { + + /** ImportOptions conflictResolutionStrategy */ + conflictResolutionStrategy?: (google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|keyof typeof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|null); + } + + /** Represents an ImportOptions. */ + class ImportOptions implements IImportOptions { + + /** + * Constructs a new ImportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ImportAppRequest.IImportOptions); + + /** ImportOptions conflictResolutionStrategy. */ + public conflictResolutionStrategy: (google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|keyof typeof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy); + + /** + * Creates a new ImportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportOptions instance + */ + public static create(properties?: google.cloud.ces.v1beta.ImportAppRequest.IImportOptions): google.cloud.ces.v1beta.ImportAppRequest.ImportOptions; + + /** + * Encodes the specified ImportOptions message. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.verify|verify} messages. + * @param message ImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ImportAppRequest.IImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportOptions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.verify|verify} messages. + * @param message ImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ImportAppRequest.IImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportAppRequest.ImportOptions; + + /** + * Decodes an ImportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportAppRequest.ImportOptions; + + /** + * Verifies an ImportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportAppRequest.ImportOptions; + + /** + * Creates a plain object from an ImportOptions message. Also converts values to other types if specified. + * @param message ImportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ImportAppRequest.ImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportOptions { + + /** ConflictResolutionStrategy enum. */ + enum ConflictResolutionStrategy { + CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED = 0, + REPLACE = 1, + OVERWRITE = 2 + } + } + } + + /** Properties of an ImportAppResponse. */ + interface IImportAppResponse { + + /** ImportAppResponse name */ + name?: (string|null); + + /** ImportAppResponse warnings */ + warnings?: (string[]|null); + } + + /** Represents an ImportAppResponse. */ + class ImportAppResponse implements IImportAppResponse { + + /** + * Constructs a new ImportAppResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IImportAppResponse); + + /** ImportAppResponse name. */ + public name: string; + + /** ImportAppResponse warnings. */ + public warnings: string[]; + + /** + * Creates a new ImportAppResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportAppResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IImportAppResponse): google.cloud.ces.v1beta.ImportAppResponse; + + /** + * Encodes the specified ImportAppResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppResponse.verify|verify} messages. + * @param message ImportAppResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IImportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppResponse.verify|verify} messages. + * @param message ImportAppResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IImportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportAppResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportAppResponse; + + /** + * Decodes an ImportAppResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportAppResponse; + + /** + * Verifies an ImportAppResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportAppResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportAppResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportAppResponse; + + /** + * Creates a plain object from an ImportAppResponse message. Also converts values to other types if specified. + * @param message ImportAppResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ImportAppResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportAppResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportAppResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAgentsRequest. */ + interface IListAgentsRequest { + + /** ListAgentsRequest parent */ + parent?: (string|null); + + /** ListAgentsRequest pageSize */ + pageSize?: (number|null); + + /** ListAgentsRequest pageToken */ + pageToken?: (string|null); + + /** ListAgentsRequest filter */ + filter?: (string|null); + + /** ListAgentsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListAgentsRequest. */ + class ListAgentsRequest implements IListAgentsRequest { + + /** + * Constructs a new ListAgentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListAgentsRequest); + + /** ListAgentsRequest parent. */ + public parent: string; + + /** ListAgentsRequest pageSize. */ + public pageSize: number; + + /** ListAgentsRequest pageToken. */ + public pageToken: string; + + /** ListAgentsRequest filter. */ + public filter: string; + + /** ListAgentsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListAgentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAgentsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListAgentsRequest): google.cloud.ces.v1beta.ListAgentsRequest; + + /** + * Encodes the specified ListAgentsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsRequest.verify|verify} messages. + * @param message ListAgentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListAgentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAgentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsRequest.verify|verify} messages. + * @param message ListAgentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListAgentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListAgentsRequest; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListAgentsRequest; + + /** + * Verifies a ListAgentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAgentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAgentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListAgentsRequest; + + /** + * Creates a plain object from a ListAgentsRequest message. Also converts values to other types if specified. + * @param message ListAgentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListAgentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAgentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAgentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAgentsResponse. */ + interface IListAgentsResponse { + + /** ListAgentsResponse agents */ + agents?: (google.cloud.ces.v1beta.IAgent[]|null); + + /** ListAgentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAgentsResponse. */ + class ListAgentsResponse implements IListAgentsResponse { + + /** + * Constructs a new ListAgentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListAgentsResponse); + + /** ListAgentsResponse agents. */ + public agents: google.cloud.ces.v1beta.IAgent[]; + + /** ListAgentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAgentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAgentsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListAgentsResponse): google.cloud.ces.v1beta.ListAgentsResponse; + + /** + * Encodes the specified ListAgentsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsResponse.verify|verify} messages. + * @param message ListAgentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListAgentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAgentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsResponse.verify|verify} messages. + * @param message ListAgentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListAgentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListAgentsResponse; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListAgentsResponse; + + /** + * Verifies a ListAgentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAgentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAgentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListAgentsResponse; + + /** + * Creates a plain object from a ListAgentsResponse message. Also converts values to other types if specified. + * @param message ListAgentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListAgentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAgentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAgentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAgentRequest. */ + interface IGetAgentRequest { + + /** GetAgentRequest name */ + name?: (string|null); + } + + /** Represents a GetAgentRequest. */ + class GetAgentRequest implements IGetAgentRequest { + + /** + * Constructs a new GetAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetAgentRequest); + + /** GetAgentRequest name. */ + public name: string; + + /** + * Creates a new GetAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAgentRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetAgentRequest): google.cloud.ces.v1beta.GetAgentRequest; + + /** + * Encodes the specified GetAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetAgentRequest.verify|verify} messages. + * @param message GetAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetAgentRequest.verify|verify} messages. + * @param message GetAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetAgentRequest; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetAgentRequest; + + /** + * Verifies a GetAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetAgentRequest; + + /** + * Creates a plain object from a GetAgentRequest message. Also converts values to other types if specified. + * @param message GetAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAgentRequest. */ + interface ICreateAgentRequest { + + /** CreateAgentRequest parent */ + parent?: (string|null); + + /** CreateAgentRequest agentId */ + agentId?: (string|null); + + /** CreateAgentRequest agent */ + agent?: (google.cloud.ces.v1beta.IAgent|null); + } + + /** Represents a CreateAgentRequest. */ + class CreateAgentRequest implements ICreateAgentRequest { + + /** + * Constructs a new CreateAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateAgentRequest); + + /** CreateAgentRequest parent. */ + public parent: string; + + /** CreateAgentRequest agentId. */ + public agentId: string; + + /** CreateAgentRequest agent. */ + public agent?: (google.cloud.ces.v1beta.IAgent|null); + + /** + * Creates a new CreateAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAgentRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateAgentRequest): google.cloud.ces.v1beta.CreateAgentRequest; + + /** + * Encodes the specified CreateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateAgentRequest.verify|verify} messages. + * @param message CreateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateAgentRequest.verify|verify} messages. + * @param message CreateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateAgentRequest; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateAgentRequest; + + /** + * Verifies a CreateAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateAgentRequest; + + /** + * Creates a plain object from a CreateAgentRequest message. Also converts values to other types if specified. + * @param message CreateAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAgentRequest. */ + interface IUpdateAgentRequest { + + /** UpdateAgentRequest agent */ + agent?: (google.cloud.ces.v1beta.IAgent|null); + + /** UpdateAgentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAgentRequest. */ + class UpdateAgentRequest implements IUpdateAgentRequest { + + /** + * Constructs a new UpdateAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateAgentRequest); + + /** UpdateAgentRequest agent. */ + public agent?: (google.cloud.ces.v1beta.IAgent|null); + + /** UpdateAgentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAgentRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateAgentRequest): google.cloud.ces.v1beta.UpdateAgentRequest; + + /** + * Encodes the specified UpdateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAgentRequest.verify|verify} messages. + * @param message UpdateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAgentRequest.verify|verify} messages. + * @param message UpdateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateAgentRequest; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateAgentRequest; + + /** + * Verifies an UpdateAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateAgentRequest; + + /** + * Creates a plain object from an UpdateAgentRequest message. Also converts values to other types if specified. + * @param message UpdateAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAgentRequest. */ + interface IDeleteAgentRequest { + + /** DeleteAgentRequest name */ + name?: (string|null); + + /** DeleteAgentRequest force */ + force?: (boolean|null); + + /** DeleteAgentRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteAgentRequest. */ + class DeleteAgentRequest implements IDeleteAgentRequest { + + /** + * Constructs a new DeleteAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteAgentRequest); + + /** DeleteAgentRequest name. */ + public name: string; + + /** DeleteAgentRequest force. */ + public force: boolean; + + /** DeleteAgentRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAgentRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteAgentRequest): google.cloud.ces.v1beta.DeleteAgentRequest; + + /** + * Encodes the specified DeleteAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAgentRequest.verify|verify} messages. + * @param message DeleteAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAgentRequest.verify|verify} messages. + * @param message DeleteAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteAgentRequest; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteAgentRequest; + + /** + * Verifies a DeleteAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteAgentRequest; + + /** + * Creates a plain object from a DeleteAgentRequest message. Also converts values to other types if specified. + * @param message DeleteAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAgentRequest + * @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 createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.ces.v1beta.IOperationMetadata): google.cloud.ces.v1beta.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.ces.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.ces.v1beta.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.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.ces.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.ces.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.ces.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.ces.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.ces.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 ListExamplesRequest. */ + interface IListExamplesRequest { + + /** ListExamplesRequest parent */ + parent?: (string|null); + + /** ListExamplesRequest pageSize */ + pageSize?: (number|null); + + /** ListExamplesRequest pageToken */ + pageToken?: (string|null); + + /** ListExamplesRequest filter */ + filter?: (string|null); + + /** ListExamplesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListExamplesRequest. */ + class ListExamplesRequest implements IListExamplesRequest { + + /** + * Constructs a new ListExamplesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListExamplesRequest); + + /** ListExamplesRequest parent. */ + public parent: string; + + /** ListExamplesRequest pageSize. */ + public pageSize: number; + + /** ListExamplesRequest pageToken. */ + public pageToken: string; + + /** ListExamplesRequest filter. */ + public filter: string; + + /** ListExamplesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListExamplesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExamplesRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListExamplesRequest): google.cloud.ces.v1beta.ListExamplesRequest; + + /** + * Encodes the specified ListExamplesRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesRequest.verify|verify} messages. + * @param message ListExamplesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesRequest.verify|verify} messages. + * @param message ListExamplesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListExamplesRequest; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListExamplesRequest; + + /** + * Verifies a ListExamplesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListExamplesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExamplesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListExamplesRequest; + + /** + * Creates a plain object from a ListExamplesRequest message. Also converts values to other types if specified. + * @param message ListExamplesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListExamplesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExamplesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExamplesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExamplesResponse. */ + interface IListExamplesResponse { + + /** ListExamplesResponse examples */ + examples?: (google.cloud.ces.v1beta.IExample[]|null); + + /** ListExamplesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListExamplesResponse. */ + class ListExamplesResponse implements IListExamplesResponse { + + /** + * Constructs a new ListExamplesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListExamplesResponse); + + /** ListExamplesResponse examples. */ + public examples: google.cloud.ces.v1beta.IExample[]; + + /** ListExamplesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListExamplesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExamplesResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListExamplesResponse): google.cloud.ces.v1beta.ListExamplesResponse; + + /** + * Encodes the specified ListExamplesResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesResponse.verify|verify} messages. + * @param message ListExamplesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListExamplesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExamplesResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesResponse.verify|verify} messages. + * @param message ListExamplesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListExamplesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListExamplesResponse; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListExamplesResponse; + + /** + * Verifies a ListExamplesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListExamplesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExamplesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListExamplesResponse; + + /** + * Creates a plain object from a ListExamplesResponse message. Also converts values to other types if specified. + * @param message ListExamplesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListExamplesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExamplesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExamplesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetExampleRequest. */ + interface IGetExampleRequest { + + /** GetExampleRequest name */ + name?: (string|null); + } + + /** Represents a GetExampleRequest. */ + class GetExampleRequest implements IGetExampleRequest { + + /** + * Constructs a new GetExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetExampleRequest); + + /** GetExampleRequest name. */ + public name: string; + + /** + * Creates a new GetExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetExampleRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetExampleRequest): google.cloud.ces.v1beta.GetExampleRequest; + + /** + * Encodes the specified GetExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetExampleRequest.verify|verify} messages. + * @param message GetExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetExampleRequest.verify|verify} messages. + * @param message GetExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetExampleRequest; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetExampleRequest; + + /** + * Verifies a GetExampleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetExampleRequest; + + /** + * Creates a plain object from a GetExampleRequest message. Also converts values to other types if specified. + * @param message GetExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateExampleRequest. */ + interface ICreateExampleRequest { + + /** CreateExampleRequest parent */ + parent?: (string|null); + + /** CreateExampleRequest exampleId */ + exampleId?: (string|null); + + /** CreateExampleRequest example */ + example?: (google.cloud.ces.v1beta.IExample|null); + } + + /** Represents a CreateExampleRequest. */ + class CreateExampleRequest implements ICreateExampleRequest { + + /** + * Constructs a new CreateExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateExampleRequest); + + /** CreateExampleRequest parent. */ + public parent: string; + + /** CreateExampleRequest exampleId. */ + public exampleId: string; + + /** CreateExampleRequest example. */ + public example?: (google.cloud.ces.v1beta.IExample|null); + + /** + * Creates a new CreateExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateExampleRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateExampleRequest): google.cloud.ces.v1beta.CreateExampleRequest; + + /** + * Encodes the specified CreateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateExampleRequest.verify|verify} messages. + * @param message CreateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateExampleRequest.verify|verify} messages. + * @param message CreateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateExampleRequest; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateExampleRequest; + + /** + * Verifies a CreateExampleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateExampleRequest; + + /** + * Creates a plain object from a CreateExampleRequest message. Also converts values to other types if specified. + * @param message CreateExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateExampleRequest. */ + interface IUpdateExampleRequest { + + /** UpdateExampleRequest example */ + example?: (google.cloud.ces.v1beta.IExample|null); + + /** UpdateExampleRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateExampleRequest. */ + class UpdateExampleRequest implements IUpdateExampleRequest { + + /** + * Constructs a new UpdateExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateExampleRequest); + + /** UpdateExampleRequest example. */ + public example?: (google.cloud.ces.v1beta.IExample|null); + + /** UpdateExampleRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateExampleRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateExampleRequest): google.cloud.ces.v1beta.UpdateExampleRequest; + + /** + * Encodes the specified UpdateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateExampleRequest.verify|verify} messages. + * @param message UpdateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateExampleRequest.verify|verify} messages. + * @param message UpdateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateExampleRequest; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateExampleRequest; + + /** + * Verifies an UpdateExampleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateExampleRequest; + + /** + * Creates a plain object from an UpdateExampleRequest message. Also converts values to other types if specified. + * @param message UpdateExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteExampleRequest. */ + interface IDeleteExampleRequest { + + /** DeleteExampleRequest name */ + name?: (string|null); + + /** DeleteExampleRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteExampleRequest. */ + class DeleteExampleRequest implements IDeleteExampleRequest { + + /** + * Constructs a new DeleteExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteExampleRequest); + + /** DeleteExampleRequest name. */ + public name: string; + + /** DeleteExampleRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteExampleRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteExampleRequest): google.cloud.ces.v1beta.DeleteExampleRequest; + + /** + * Encodes the specified DeleteExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteExampleRequest.verify|verify} messages. + * @param message DeleteExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteExampleRequest.verify|verify} messages. + * @param message DeleteExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteExampleRequest; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteExampleRequest; + + /** + * Verifies a DeleteExampleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteExampleRequest; + + /** + * Creates a plain object from a DeleteExampleRequest message. Also converts values to other types if specified. + * @param message DeleteExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListToolsRequest. */ + interface IListToolsRequest { + + /** ListToolsRequest parent */ + parent?: (string|null); + + /** ListToolsRequest pageSize */ + pageSize?: (number|null); + + /** ListToolsRequest pageToken */ + pageToken?: (string|null); + + /** ListToolsRequest filter */ + filter?: (string|null); + + /** ListToolsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListToolsRequest. */ + class ListToolsRequest implements IListToolsRequest { + + /** + * Constructs a new ListToolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListToolsRequest); + + /** ListToolsRequest parent. */ + public parent: string; + + /** ListToolsRequest pageSize. */ + public pageSize: number; + + /** ListToolsRequest pageToken. */ + public pageToken: string; + + /** ListToolsRequest filter. */ + public filter: string; + + /** ListToolsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListToolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListToolsRequest): google.cloud.ces.v1beta.ListToolsRequest; + + /** + * Encodes the specified ListToolsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsRequest.verify|verify} messages. + * @param message ListToolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsRequest.verify|verify} messages. + * @param message ListToolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListToolsRequest; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListToolsRequest; + + /** + * Verifies a ListToolsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListToolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListToolsRequest; + + /** + * Creates a plain object from a ListToolsRequest message. Also converts values to other types if specified. + * @param message ListToolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListToolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListToolsResponse. */ + interface IListToolsResponse { + + /** ListToolsResponse tools */ + tools?: (google.cloud.ces.v1beta.ITool[]|null); + + /** ListToolsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListToolsResponse. */ + class ListToolsResponse implements IListToolsResponse { + + /** + * Constructs a new ListToolsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListToolsResponse); + + /** ListToolsResponse tools. */ + public tools: google.cloud.ces.v1beta.ITool[]; + + /** ListToolsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListToolsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListToolsResponse): google.cloud.ces.v1beta.ListToolsResponse; + + /** + * Encodes the specified ListToolsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsResponse.verify|verify} messages. + * @param message ListToolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsResponse.verify|verify} messages. + * @param message ListToolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListToolsResponse; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListToolsResponse; + + /** + * Verifies a ListToolsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListToolsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListToolsResponse; + + /** + * Creates a plain object from a ListToolsResponse message. Also converts values to other types if specified. + * @param message ListToolsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListToolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetToolRequest. */ + interface IGetToolRequest { + + /** GetToolRequest name */ + name?: (string|null); + } + + /** Represents a GetToolRequest. */ + class GetToolRequest implements IGetToolRequest { + + /** + * Constructs a new GetToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetToolRequest); + + /** GetToolRequest name. */ + public name: string; + + /** + * Creates a new GetToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetToolRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetToolRequest): google.cloud.ces.v1beta.GetToolRequest; + + /** + * Encodes the specified GetToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetToolRequest.verify|verify} messages. + * @param message GetToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetToolRequest.verify|verify} messages. + * @param message GetToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetToolRequest; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetToolRequest; + + /** + * Verifies a GetToolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetToolRequest; + + /** + * Creates a plain object from a GetToolRequest message. Also converts values to other types if specified. + * @param message GetToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateToolRequest. */ + interface ICreateToolRequest { + + /** CreateToolRequest parent */ + parent?: (string|null); + + /** CreateToolRequest toolId */ + toolId?: (string|null); + + /** CreateToolRequest tool */ + tool?: (google.cloud.ces.v1beta.ITool|null); + } + + /** Represents a CreateToolRequest. */ + class CreateToolRequest implements ICreateToolRequest { + + /** + * Constructs a new CreateToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateToolRequest); + + /** CreateToolRequest parent. */ + public parent: string; + + /** CreateToolRequest toolId. */ + public toolId: string; + + /** CreateToolRequest tool. */ + public tool?: (google.cloud.ces.v1beta.ITool|null); + + /** + * Creates a new CreateToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateToolRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateToolRequest): google.cloud.ces.v1beta.CreateToolRequest; + + /** + * Encodes the specified CreateToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolRequest.verify|verify} messages. + * @param message CreateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolRequest.verify|verify} messages. + * @param message CreateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateToolRequest; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateToolRequest; + + /** + * Verifies a CreateToolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateToolRequest; + + /** + * Creates a plain object from a CreateToolRequest message. Also converts values to other types if specified. + * @param message CreateToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateToolRequest. */ + interface IUpdateToolRequest { + + /** UpdateToolRequest tool */ + tool?: (google.cloud.ces.v1beta.ITool|null); + + /** UpdateToolRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateToolRequest. */ + class UpdateToolRequest implements IUpdateToolRequest { + + /** + * Constructs a new UpdateToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateToolRequest); + + /** UpdateToolRequest tool. */ + public tool?: (google.cloud.ces.v1beta.ITool|null); + + /** UpdateToolRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateToolRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateToolRequest): google.cloud.ces.v1beta.UpdateToolRequest; + + /** + * Encodes the specified UpdateToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolRequest.verify|verify} messages. + * @param message UpdateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolRequest.verify|verify} messages. + * @param message UpdateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateToolRequest; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateToolRequest; + + /** + * Verifies an UpdateToolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateToolRequest; + + /** + * Creates a plain object from an UpdateToolRequest message. Also converts values to other types if specified. + * @param message UpdateToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteToolRequest. */ + interface IDeleteToolRequest { + + /** DeleteToolRequest name */ + name?: (string|null); + + /** DeleteToolRequest force */ + force?: (boolean|null); + + /** DeleteToolRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteToolRequest. */ + class DeleteToolRequest implements IDeleteToolRequest { + + /** + * Constructs a new DeleteToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteToolRequest); + + /** DeleteToolRequest name. */ + public name: string; + + /** DeleteToolRequest force. */ + public force: boolean; + + /** DeleteToolRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteToolRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteToolRequest): google.cloud.ces.v1beta.DeleteToolRequest; + + /** + * Encodes the specified DeleteToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolRequest.verify|verify} messages. + * @param message DeleteToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolRequest.verify|verify} messages. + * @param message DeleteToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteToolRequest; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteToolRequest; + + /** + * Verifies a DeleteToolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteToolRequest; + + /** + * Creates a plain object from a DeleteToolRequest message. Also converts values to other types if specified. + * @param message DeleteToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConversationsRequest. */ + interface IListConversationsRequest { + + /** ListConversationsRequest parent */ + parent?: (string|null); + + /** ListConversationsRequest pageSize */ + pageSize?: (number|null); + + /** ListConversationsRequest pageToken */ + pageToken?: (string|null); + + /** ListConversationsRequest filter */ + filter?: (string|null); + + /** ListConversationsRequest source */ + source?: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source|null); + + /** ListConversationsRequest sources */ + sources?: (google.cloud.ces.v1beta.Conversation.Source[]|null); + } + + /** Represents a ListConversationsRequest. */ + class ListConversationsRequest implements IListConversationsRequest { + + /** + * Constructs a new ListConversationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListConversationsRequest); + + /** ListConversationsRequest parent. */ + public parent: string; + + /** ListConversationsRequest pageSize. */ + public pageSize: number; + + /** ListConversationsRequest pageToken. */ + public pageToken: string; + + /** ListConversationsRequest filter. */ + public filter: string; + + /** ListConversationsRequest source. */ + public source: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source); + + /** ListConversationsRequest sources. */ + public sources: google.cloud.ces.v1beta.Conversation.Source[]; + + /** + * Creates a new ListConversationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConversationsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListConversationsRequest): google.cloud.ces.v1beta.ListConversationsRequest; + + /** + * Encodes the specified ListConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsRequest.verify|verify} messages. + * @param message ListConversationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsRequest.verify|verify} messages. + * @param message ListConversationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListConversationsRequest; + + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListConversationsRequest; + + /** + * Verifies a ListConversationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListConversationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConversationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListConversationsRequest; + + /** + * Creates a plain object from a ListConversationsRequest message. Also converts values to other types if specified. + * @param message ListConversationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListConversationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConversationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConversationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConversationsResponse. */ + interface IListConversationsResponse { + + /** ListConversationsResponse conversations */ + conversations?: (google.cloud.ces.v1beta.IConversation[]|null); + + /** ListConversationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListConversationsResponse. */ + class ListConversationsResponse implements IListConversationsResponse { + + /** + * Constructs a new ListConversationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListConversationsResponse); + + /** ListConversationsResponse conversations. */ + public conversations: google.cloud.ces.v1beta.IConversation[]; + + /** ListConversationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListConversationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConversationsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListConversationsResponse): google.cloud.ces.v1beta.ListConversationsResponse; + + /** + * Encodes the specified ListConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsResponse.verify|verify} messages. + * @param message ListConversationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsResponse.verify|verify} messages. + * @param message ListConversationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListConversationsResponse; + + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListConversationsResponse; + + /** + * Verifies a ListConversationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConversationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListConversationsResponse; + + /** + * Creates a plain object from a ListConversationsResponse message. Also converts values to other types if specified. + * @param message ListConversationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListConversationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConversationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConversationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetConversationRequest. */ + interface IGetConversationRequest { + + /** GetConversationRequest name */ + name?: (string|null); + + /** GetConversationRequest source */ + source?: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source|null); + } + + /** Represents a GetConversationRequest. */ + class GetConversationRequest implements IGetConversationRequest { + + /** + * Constructs a new GetConversationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetConversationRequest); + + /** GetConversationRequest name. */ + public name: string; + + /** GetConversationRequest source. */ + public source: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source); + + /** + * Creates a new GetConversationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConversationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetConversationRequest): google.cloud.ces.v1beta.GetConversationRequest; + + /** + * Encodes the specified GetConversationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetConversationRequest.verify|verify} messages. + * @param message GetConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetConversationRequest.verify|verify} messages. + * @param message GetConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConversationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetConversationRequest; + + /** + * Decodes a GetConversationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetConversationRequest; + + /** + * Verifies a GetConversationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetConversationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConversationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetConversationRequest; + + /** + * Creates a plain object from a GetConversationRequest message. Also converts values to other types if specified. + * @param message GetConversationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetConversationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConversationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConversationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteConversationRequest. */ + interface IDeleteConversationRequest { + + /** DeleteConversationRequest name */ + name?: (string|null); + + /** DeleteConversationRequest source */ + source?: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source|null); + } + + /** Represents a DeleteConversationRequest. */ + class DeleteConversationRequest implements IDeleteConversationRequest { + + /** + * Constructs a new DeleteConversationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteConversationRequest); + + /** DeleteConversationRequest name. */ + public name: string; + + /** DeleteConversationRequest source. */ + public source: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source); + + /** + * Creates a new DeleteConversationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteConversationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteConversationRequest): google.cloud.ces.v1beta.DeleteConversationRequest; + + /** + * Encodes the specified DeleteConversationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteConversationRequest.verify|verify} messages. + * @param message DeleteConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteConversationRequest.verify|verify} messages. + * @param message DeleteConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteConversationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteConversationRequest; + + /** + * Decodes a DeleteConversationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteConversationRequest; + + /** + * Verifies a DeleteConversationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteConversationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteConversationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteConversationRequest; + + /** + * Creates a plain object from a DeleteConversationRequest message. Also converts values to other types if specified. + * @param message DeleteConversationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteConversationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteConversationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteConversationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteConversationsRequest. */ + interface IBatchDeleteConversationsRequest { + + /** BatchDeleteConversationsRequest parent */ + parent?: (string|null); + + /** BatchDeleteConversationsRequest conversations */ + conversations?: (string[]|null); + } + + /** Represents a BatchDeleteConversationsRequest. */ + class BatchDeleteConversationsRequest implements IBatchDeleteConversationsRequest { + + /** + * Constructs a new BatchDeleteConversationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IBatchDeleteConversationsRequest); + + /** BatchDeleteConversationsRequest parent. */ + public parent: string; + + /** BatchDeleteConversationsRequest conversations. */ + public conversations: string[]; + + /** + * Creates a new BatchDeleteConversationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteConversationsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IBatchDeleteConversationsRequest): google.cloud.ces.v1beta.BatchDeleteConversationsRequest; + + /** + * Encodes the specified BatchDeleteConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsRequest.verify|verify} messages. + * @param message BatchDeleteConversationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IBatchDeleteConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsRequest.verify|verify} messages. + * @param message BatchDeleteConversationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IBatchDeleteConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BatchDeleteConversationsRequest; + + /** + * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BatchDeleteConversationsRequest; + + /** + * Verifies a BatchDeleteConversationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDeleteConversationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteConversationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BatchDeleteConversationsRequest; + + /** + * Creates a plain object from a BatchDeleteConversationsRequest message. Also converts values to other types if specified. + * @param message BatchDeleteConversationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.BatchDeleteConversationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteConversationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteConversationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteConversationsResponse. */ + interface IBatchDeleteConversationsResponse { + + /** BatchDeleteConversationsResponse deletedConversations */ + deletedConversations?: (string[]|null); + + /** BatchDeleteConversationsResponse failedConversations */ + failedConversations?: (string[]|null); + + /** BatchDeleteConversationsResponse errorMessages */ + errorMessages?: (string[]|null); + } + + /** Represents a BatchDeleteConversationsResponse. */ + class BatchDeleteConversationsResponse implements IBatchDeleteConversationsResponse { + + /** + * Constructs a new BatchDeleteConversationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IBatchDeleteConversationsResponse); + + /** BatchDeleteConversationsResponse deletedConversations. */ + public deletedConversations: string[]; + + /** BatchDeleteConversationsResponse failedConversations. */ + public failedConversations: string[]; + + /** BatchDeleteConversationsResponse errorMessages. */ + public errorMessages: string[]; + + /** + * Creates a new BatchDeleteConversationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteConversationsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IBatchDeleteConversationsResponse): google.cloud.ces.v1beta.BatchDeleteConversationsResponse; + + /** + * Encodes the specified BatchDeleteConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsResponse.verify|verify} messages. + * @param message BatchDeleteConversationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IBatchDeleteConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsResponse.verify|verify} messages. + * @param message BatchDeleteConversationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IBatchDeleteConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BatchDeleteConversationsResponse; + + /** + * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BatchDeleteConversationsResponse; + + /** + * Verifies a BatchDeleteConversationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDeleteConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteConversationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BatchDeleteConversationsResponse; + + /** + * Creates a plain object from a BatchDeleteConversationsResponse message. Also converts values to other types if specified. + * @param message BatchDeleteConversationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.BatchDeleteConversationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteConversationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteConversationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGuardrailsRequest. */ + interface IListGuardrailsRequest { + + /** ListGuardrailsRequest parent */ + parent?: (string|null); + + /** ListGuardrailsRequest pageSize */ + pageSize?: (number|null); + + /** ListGuardrailsRequest pageToken */ + pageToken?: (string|null); + + /** ListGuardrailsRequest filter */ + filter?: (string|null); + + /** ListGuardrailsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListGuardrailsRequest. */ + class ListGuardrailsRequest implements IListGuardrailsRequest { + + /** + * Constructs a new ListGuardrailsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListGuardrailsRequest); + + /** ListGuardrailsRequest parent. */ + public parent: string; + + /** ListGuardrailsRequest pageSize. */ + public pageSize: number; + + /** ListGuardrailsRequest pageToken. */ + public pageToken: string; + + /** ListGuardrailsRequest filter. */ + public filter: string; + + /** ListGuardrailsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListGuardrailsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGuardrailsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListGuardrailsRequest): google.cloud.ces.v1beta.ListGuardrailsRequest; + + /** + * Encodes the specified ListGuardrailsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsRequest.verify|verify} messages. + * @param message ListGuardrailsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListGuardrailsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGuardrailsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsRequest.verify|verify} messages. + * @param message ListGuardrailsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListGuardrailsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGuardrailsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGuardrailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListGuardrailsRequest; + + /** + * Decodes a ListGuardrailsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGuardrailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListGuardrailsRequest; + + /** + * Verifies a ListGuardrailsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGuardrailsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGuardrailsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListGuardrailsRequest; + + /** + * Creates a plain object from a ListGuardrailsRequest message. Also converts values to other types if specified. + * @param message ListGuardrailsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListGuardrailsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGuardrailsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGuardrailsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGuardrailsResponse. */ + interface IListGuardrailsResponse { + + /** ListGuardrailsResponse guardrails */ + guardrails?: (google.cloud.ces.v1beta.IGuardrail[]|null); + + /** ListGuardrailsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListGuardrailsResponse. */ + class ListGuardrailsResponse implements IListGuardrailsResponse { + + /** + * Constructs a new ListGuardrailsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListGuardrailsResponse); + + /** ListGuardrailsResponse guardrails. */ + public guardrails: google.cloud.ces.v1beta.IGuardrail[]; + + /** ListGuardrailsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListGuardrailsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGuardrailsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListGuardrailsResponse): google.cloud.ces.v1beta.ListGuardrailsResponse; + + /** + * Encodes the specified ListGuardrailsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsResponse.verify|verify} messages. + * @param message ListGuardrailsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListGuardrailsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGuardrailsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsResponse.verify|verify} messages. + * @param message ListGuardrailsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListGuardrailsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGuardrailsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGuardrailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListGuardrailsResponse; + + /** + * Decodes a ListGuardrailsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGuardrailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListGuardrailsResponse; + + /** + * Verifies a ListGuardrailsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGuardrailsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGuardrailsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListGuardrailsResponse; + + /** + * Creates a plain object from a ListGuardrailsResponse message. Also converts values to other types if specified. + * @param message ListGuardrailsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListGuardrailsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGuardrailsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGuardrailsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGuardrailRequest. */ + interface IGetGuardrailRequest { + + /** GetGuardrailRequest name */ + name?: (string|null); + } + + /** Represents a GetGuardrailRequest. */ + class GetGuardrailRequest implements IGetGuardrailRequest { + + /** + * Constructs a new GetGuardrailRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetGuardrailRequest); + + /** GetGuardrailRequest name. */ + public name: string; + + /** + * Creates a new GetGuardrailRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGuardrailRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetGuardrailRequest): google.cloud.ces.v1beta.GetGuardrailRequest; + + /** + * Encodes the specified GetGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetGuardrailRequest.verify|verify} messages. + * @param message GetGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetGuardrailRequest.verify|verify} messages. + * @param message GetGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGuardrailRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetGuardrailRequest; + + /** + * Decodes a GetGuardrailRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetGuardrailRequest; + + /** + * Verifies a GetGuardrailRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGuardrailRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetGuardrailRequest; + + /** + * Creates a plain object from a GetGuardrailRequest message. Also converts values to other types if specified. + * @param message GetGuardrailRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGuardrailRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGuardrailRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateGuardrailRequest. */ + interface ICreateGuardrailRequest { + + /** CreateGuardrailRequest parent */ + parent?: (string|null); + + /** CreateGuardrailRequest guardrailId */ + guardrailId?: (string|null); + + /** CreateGuardrailRequest guardrail */ + guardrail?: (google.cloud.ces.v1beta.IGuardrail|null); + } + + /** Represents a CreateGuardrailRequest. */ + class CreateGuardrailRequest implements ICreateGuardrailRequest { + + /** + * Constructs a new CreateGuardrailRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateGuardrailRequest); + + /** CreateGuardrailRequest parent. */ + public parent: string; + + /** CreateGuardrailRequest guardrailId. */ + public guardrailId: string; + + /** CreateGuardrailRequest guardrail. */ + public guardrail?: (google.cloud.ces.v1beta.IGuardrail|null); + + /** + * Creates a new CreateGuardrailRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGuardrailRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateGuardrailRequest): google.cloud.ces.v1beta.CreateGuardrailRequest; + + /** + * Encodes the specified CreateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateGuardrailRequest.verify|verify} messages. + * @param message CreateGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateGuardrailRequest.verify|verify} messages. + * @param message CreateGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGuardrailRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateGuardrailRequest; + + /** + * Decodes a CreateGuardrailRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateGuardrailRequest; + + /** + * Verifies a CreateGuardrailRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGuardrailRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateGuardrailRequest; + + /** + * Creates a plain object from a CreateGuardrailRequest message. Also converts values to other types if specified. + * @param message CreateGuardrailRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGuardrailRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGuardrailRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateGuardrailRequest. */ + interface IUpdateGuardrailRequest { + + /** UpdateGuardrailRequest guardrail */ + guardrail?: (google.cloud.ces.v1beta.IGuardrail|null); + + /** UpdateGuardrailRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateGuardrailRequest. */ + class UpdateGuardrailRequest implements IUpdateGuardrailRequest { + + /** + * Constructs a new UpdateGuardrailRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateGuardrailRequest); + + /** UpdateGuardrailRequest guardrail. */ + public guardrail?: (google.cloud.ces.v1beta.IGuardrail|null); + + /** UpdateGuardrailRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateGuardrailRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateGuardrailRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateGuardrailRequest): google.cloud.ces.v1beta.UpdateGuardrailRequest; + + /** + * Encodes the specified UpdateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateGuardrailRequest.verify|verify} messages. + * @param message UpdateGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateGuardrailRequest.verify|verify} messages. + * @param message UpdateGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateGuardrailRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateGuardrailRequest; + + /** + * Decodes an UpdateGuardrailRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateGuardrailRequest; + + /** + * Verifies an UpdateGuardrailRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateGuardrailRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateGuardrailRequest; + + /** + * Creates a plain object from an UpdateGuardrailRequest message. Also converts values to other types if specified. + * @param message UpdateGuardrailRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateGuardrailRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateGuardrailRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteGuardrailRequest. */ + interface IDeleteGuardrailRequest { + + /** DeleteGuardrailRequest name */ + name?: (string|null); + + /** DeleteGuardrailRequest force */ + force?: (boolean|null); + + /** DeleteGuardrailRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteGuardrailRequest. */ + class DeleteGuardrailRequest implements IDeleteGuardrailRequest { + + /** + * Constructs a new DeleteGuardrailRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteGuardrailRequest); + + /** DeleteGuardrailRequest name. */ + public name: string; + + /** DeleteGuardrailRequest force. */ + public force: boolean; + + /** DeleteGuardrailRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteGuardrailRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGuardrailRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteGuardrailRequest): google.cloud.ces.v1beta.DeleteGuardrailRequest; + + /** + * Encodes the specified DeleteGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteGuardrailRequest.verify|verify} messages. + * @param message DeleteGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteGuardrailRequest.verify|verify} messages. + * @param message DeleteGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGuardrailRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteGuardrailRequest; + + /** + * Decodes a DeleteGuardrailRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteGuardrailRequest; + + /** + * Verifies a DeleteGuardrailRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGuardrailRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteGuardrailRequest; + + /** + * Creates a plain object from a DeleteGuardrailRequest message. Also converts values to other types if specified. + * @param message DeleteGuardrailRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGuardrailRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGuardrailRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDeploymentsRequest. */ + interface IListDeploymentsRequest { + + /** ListDeploymentsRequest parent */ + parent?: (string|null); + + /** ListDeploymentsRequest pageSize */ + pageSize?: (number|null); + + /** ListDeploymentsRequest pageToken */ + pageToken?: (string|null); + + /** ListDeploymentsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListDeploymentsRequest. */ + class ListDeploymentsRequest implements IListDeploymentsRequest { + + /** + * Constructs a new ListDeploymentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListDeploymentsRequest); + + /** ListDeploymentsRequest parent. */ + public parent: string; + + /** ListDeploymentsRequest pageSize. */ + public pageSize: number; + + /** ListDeploymentsRequest pageToken. */ + public pageToken: string; + + /** ListDeploymentsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListDeploymentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeploymentsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListDeploymentsRequest): google.cloud.ces.v1beta.ListDeploymentsRequest; + + /** + * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsRequest.verify|verify} messages. + * @param message ListDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsRequest.verify|verify} messages. + * @param message ListDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListDeploymentsRequest; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListDeploymentsRequest; + + /** + * Verifies a ListDeploymentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeploymentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListDeploymentsRequest; + + /** + * Creates a plain object from a ListDeploymentsRequest message. Also converts values to other types if specified. + * @param message ListDeploymentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListDeploymentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeploymentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeploymentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDeploymentsResponse. */ + interface IListDeploymentsResponse { + + /** ListDeploymentsResponse deployments */ + deployments?: (google.cloud.ces.v1beta.IDeployment[]|null); + + /** ListDeploymentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDeploymentsResponse. */ + class ListDeploymentsResponse implements IListDeploymentsResponse { + + /** + * Constructs a new ListDeploymentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListDeploymentsResponse); + + /** ListDeploymentsResponse deployments. */ + public deployments: google.cloud.ces.v1beta.IDeployment[]; + + /** ListDeploymentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDeploymentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeploymentsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListDeploymentsResponse): google.cloud.ces.v1beta.ListDeploymentsResponse; + + /** + * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsResponse.verify|verify} messages. + * @param message ListDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsResponse.verify|verify} messages. + * @param message ListDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListDeploymentsResponse; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListDeploymentsResponse; + + /** + * Verifies a ListDeploymentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeploymentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListDeploymentsResponse; + + /** + * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. + * @param message ListDeploymentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListDeploymentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeploymentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeploymentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDeploymentRequest. */ + interface IGetDeploymentRequest { + + /** GetDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a GetDeploymentRequest. */ + class GetDeploymentRequest implements IGetDeploymentRequest { + + /** + * Constructs a new GetDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetDeploymentRequest); + + /** GetDeploymentRequest name. */ + public name: string; + + /** + * Creates a new GetDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDeploymentRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetDeploymentRequest): google.cloud.ces.v1beta.GetDeploymentRequest; + + /** + * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetDeploymentRequest.verify|verify} messages. + * @param message GetDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetDeploymentRequest.verify|verify} messages. + * @param message GetDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetDeploymentRequest; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetDeploymentRequest; + + /** + * Verifies a GetDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetDeploymentRequest; + + /** + * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. + * @param message GetDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDeploymentRequest. */ + interface ICreateDeploymentRequest { + + /** CreateDeploymentRequest parent */ + parent?: (string|null); + + /** CreateDeploymentRequest deploymentId */ + deploymentId?: (string|null); + + /** CreateDeploymentRequest deployment */ + deployment?: (google.cloud.ces.v1beta.IDeployment|null); + } + + /** Represents a CreateDeploymentRequest. */ + class CreateDeploymentRequest implements ICreateDeploymentRequest { + + /** + * Constructs a new CreateDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateDeploymentRequest); + + /** CreateDeploymentRequest parent. */ + public parent: string; + + /** CreateDeploymentRequest deploymentId. */ + public deploymentId: string; + + /** CreateDeploymentRequest deployment. */ + public deployment?: (google.cloud.ces.v1beta.IDeployment|null); + + /** + * Creates a new CreateDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDeploymentRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateDeploymentRequest): google.cloud.ces.v1beta.CreateDeploymentRequest; + + /** + * Encodes the specified CreateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateDeploymentRequest.verify|verify} messages. + * @param message CreateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateDeploymentRequest.verify|verify} messages. + * @param message CreateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateDeploymentRequest; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateDeploymentRequest; + + /** + * Verifies a CreateDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateDeploymentRequest; + + /** + * Creates a plain object from a CreateDeploymentRequest message. Also converts values to other types if specified. + * @param message CreateDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDeploymentRequest. */ + interface IUpdateDeploymentRequest { + + /** UpdateDeploymentRequest deployment */ + deployment?: (google.cloud.ces.v1beta.IDeployment|null); + + /** UpdateDeploymentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDeploymentRequest. */ + class UpdateDeploymentRequest implements IUpdateDeploymentRequest { + + /** + * Constructs a new UpdateDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateDeploymentRequest); + + /** UpdateDeploymentRequest deployment. */ + public deployment?: (google.cloud.ces.v1beta.IDeployment|null); + + /** UpdateDeploymentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDeploymentRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateDeploymentRequest): google.cloud.ces.v1beta.UpdateDeploymentRequest; + + /** + * Encodes the specified UpdateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateDeploymentRequest.verify|verify} messages. + * @param message UpdateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateDeploymentRequest.verify|verify} messages. + * @param message UpdateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateDeploymentRequest; + + /** + * Decodes an UpdateDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateDeploymentRequest; + + /** + * Verifies an UpdateDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateDeploymentRequest; + + /** + * Creates a plain object from an UpdateDeploymentRequest message. Also converts values to other types if specified. + * @param message UpdateDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDeploymentRequest. */ + interface IDeleteDeploymentRequest { + + /** DeleteDeploymentRequest name */ + name?: (string|null); + + /** DeleteDeploymentRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteDeploymentRequest. */ + class DeleteDeploymentRequest implements IDeleteDeploymentRequest { + + /** + * Constructs a new DeleteDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteDeploymentRequest); + + /** DeleteDeploymentRequest name. */ + public name: string; + + /** DeleteDeploymentRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDeploymentRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteDeploymentRequest): google.cloud.ces.v1beta.DeleteDeploymentRequest; + + /** + * Encodes the specified DeleteDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteDeploymentRequest.verify|verify} messages. + * @param message DeleteDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteDeploymentRequest.verify|verify} messages. + * @param message DeleteDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteDeploymentRequest; + + /** + * Decodes a DeleteDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteDeploymentRequest; + + /** + * Verifies a DeleteDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteDeploymentRequest; + + /** + * Creates a plain object from a DeleteDeploymentRequest message. Also converts values to other types if specified. + * @param message DeleteDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListToolsetsRequest. */ + interface IListToolsetsRequest { + + /** ListToolsetsRequest parent */ + parent?: (string|null); + + /** ListToolsetsRequest pageSize */ + pageSize?: (number|null); + + /** ListToolsetsRequest pageToken */ + pageToken?: (string|null); + + /** ListToolsetsRequest filter */ + filter?: (string|null); + + /** ListToolsetsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListToolsetsRequest. */ + class ListToolsetsRequest implements IListToolsetsRequest { + + /** + * Constructs a new ListToolsetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListToolsetsRequest); + + /** ListToolsetsRequest parent. */ + public parent: string; + + /** ListToolsetsRequest pageSize. */ + public pageSize: number; + + /** ListToolsetsRequest pageToken. */ + public pageToken: string; + + /** ListToolsetsRequest filter. */ + public filter: string; + + /** ListToolsetsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListToolsetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolsetsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListToolsetsRequest): google.cloud.ces.v1beta.ListToolsetsRequest; + + /** + * Encodes the specified ListToolsetsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsRequest.verify|verify} messages. + * @param message ListToolsetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListToolsetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolsetsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsRequest.verify|verify} messages. + * @param message ListToolsetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListToolsetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolsetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolsetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListToolsetsRequest; + + /** + * Decodes a ListToolsetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolsetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListToolsetsRequest; + + /** + * Verifies a ListToolsetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListToolsetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolsetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListToolsetsRequest; + + /** + * Creates a plain object from a ListToolsetsRequest message. Also converts values to other types if specified. + * @param message ListToolsetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListToolsetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolsetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolsetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListToolsetsResponse. */ + interface IListToolsetsResponse { + + /** ListToolsetsResponse toolsets */ + toolsets?: (google.cloud.ces.v1beta.IToolset[]|null); + + /** ListToolsetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListToolsetsResponse. */ + class ListToolsetsResponse implements IListToolsetsResponse { + + /** + * Constructs a new ListToolsetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListToolsetsResponse); + + /** ListToolsetsResponse toolsets. */ + public toolsets: google.cloud.ces.v1beta.IToolset[]; + + /** ListToolsetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListToolsetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolsetsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListToolsetsResponse): google.cloud.ces.v1beta.ListToolsetsResponse; + + /** + * Encodes the specified ListToolsetsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsResponse.verify|verify} messages. + * @param message ListToolsetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListToolsetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolsetsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsResponse.verify|verify} messages. + * @param message ListToolsetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListToolsetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolsetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolsetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListToolsetsResponse; + + /** + * Decodes a ListToolsetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolsetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListToolsetsResponse; + + /** + * Verifies a ListToolsetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListToolsetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolsetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListToolsetsResponse; + + /** + * Creates a plain object from a ListToolsetsResponse message. Also converts values to other types if specified. + * @param message ListToolsetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListToolsetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolsetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolsetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetToolsetRequest. */ + interface IGetToolsetRequest { + + /** GetToolsetRequest name */ + name?: (string|null); + } + + /** Represents a GetToolsetRequest. */ + class GetToolsetRequest implements IGetToolsetRequest { + + /** + * Constructs a new GetToolsetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetToolsetRequest); + + /** GetToolsetRequest name. */ + public name: string; + + /** + * Creates a new GetToolsetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetToolsetRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetToolsetRequest): google.cloud.ces.v1beta.GetToolsetRequest; + + /** + * Encodes the specified GetToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetToolsetRequest.verify|verify} messages. + * @param message GetToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetToolsetRequest.verify|verify} messages. + * @param message GetToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetToolsetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetToolsetRequest; + + /** + * Decodes a GetToolsetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetToolsetRequest; + + /** + * Verifies a GetToolsetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetToolsetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetToolsetRequest; + + /** + * Creates a plain object from a GetToolsetRequest message. Also converts values to other types if specified. + * @param message GetToolsetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetToolsetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetToolsetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateToolsetRequest. */ + interface ICreateToolsetRequest { + + /** CreateToolsetRequest parent */ + parent?: (string|null); + + /** CreateToolsetRequest toolsetId */ + toolsetId?: (string|null); + + /** CreateToolsetRequest toolset */ + toolset?: (google.cloud.ces.v1beta.IToolset|null); + } + + /** Represents a CreateToolsetRequest. */ + class CreateToolsetRequest implements ICreateToolsetRequest { + + /** + * Constructs a new CreateToolsetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateToolsetRequest); + + /** CreateToolsetRequest parent. */ + public parent: string; + + /** CreateToolsetRequest toolsetId. */ + public toolsetId: string; + + /** CreateToolsetRequest toolset. */ + public toolset?: (google.cloud.ces.v1beta.IToolset|null); + + /** + * Creates a new CreateToolsetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateToolsetRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateToolsetRequest): google.cloud.ces.v1beta.CreateToolsetRequest; + + /** + * Encodes the specified CreateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolsetRequest.verify|verify} messages. + * @param message CreateToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolsetRequest.verify|verify} messages. + * @param message CreateToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateToolsetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateToolsetRequest; + + /** + * Decodes a CreateToolsetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateToolsetRequest; + + /** + * Verifies a CreateToolsetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateToolsetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateToolsetRequest; + + /** + * Creates a plain object from a CreateToolsetRequest message. Also converts values to other types if specified. + * @param message CreateToolsetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateToolsetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateToolsetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateToolsetRequest. */ + interface IUpdateToolsetRequest { + + /** UpdateToolsetRequest toolset */ + toolset?: (google.cloud.ces.v1beta.IToolset|null); + + /** UpdateToolsetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateToolsetRequest. */ + class UpdateToolsetRequest implements IUpdateToolsetRequest { + + /** + * Constructs a new UpdateToolsetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateToolsetRequest); + + /** UpdateToolsetRequest toolset. */ + public toolset?: (google.cloud.ces.v1beta.IToolset|null); + + /** UpdateToolsetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateToolsetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateToolsetRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateToolsetRequest): google.cloud.ces.v1beta.UpdateToolsetRequest; + + /** + * Encodes the specified UpdateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolsetRequest.verify|verify} messages. + * @param message UpdateToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolsetRequest.verify|verify} messages. + * @param message UpdateToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateToolsetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateToolsetRequest; + + /** + * Decodes an UpdateToolsetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateToolsetRequest; + + /** + * Verifies an UpdateToolsetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateToolsetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateToolsetRequest; + + /** + * Creates a plain object from an UpdateToolsetRequest message. Also converts values to other types if specified. + * @param message UpdateToolsetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateToolsetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateToolsetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteToolsetRequest. */ + interface IDeleteToolsetRequest { + + /** DeleteToolsetRequest name */ + name?: (string|null); + + /** DeleteToolsetRequest force */ + force?: (boolean|null); + + /** DeleteToolsetRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteToolsetRequest. */ + class DeleteToolsetRequest implements IDeleteToolsetRequest { + + /** + * Constructs a new DeleteToolsetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteToolsetRequest); + + /** DeleteToolsetRequest name. */ + public name: string; + + /** DeleteToolsetRequest force. */ + public force: boolean; + + /** DeleteToolsetRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteToolsetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteToolsetRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteToolsetRequest): google.cloud.ces.v1beta.DeleteToolsetRequest; + + /** + * Encodes the specified DeleteToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolsetRequest.verify|verify} messages. + * @param message DeleteToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolsetRequest.verify|verify} messages. + * @param message DeleteToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteToolsetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteToolsetRequest; + + /** + * Decodes a DeleteToolsetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteToolsetRequest; + + /** + * Verifies a DeleteToolsetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteToolsetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteToolsetRequest; + + /** + * Creates a plain object from a DeleteToolsetRequest message. Also converts values to other types if specified. + * @param message DeleteToolsetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteToolsetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteToolsetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAppVersionsRequest. */ + interface IListAppVersionsRequest { + + /** ListAppVersionsRequest parent */ + parent?: (string|null); + + /** ListAppVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListAppVersionsRequest pageToken */ + pageToken?: (string|null); + + /** ListAppVersionsRequest filter */ + filter?: (string|null); + + /** ListAppVersionsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListAppVersionsRequest. */ + class ListAppVersionsRequest implements IListAppVersionsRequest { + + /** + * Constructs a new ListAppVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListAppVersionsRequest); + + /** ListAppVersionsRequest parent. */ + public parent: string; + + /** ListAppVersionsRequest pageSize. */ + public pageSize: number; + + /** ListAppVersionsRequest pageToken. */ + public pageToken: string; + + /** ListAppVersionsRequest filter. */ + public filter: string; + + /** ListAppVersionsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListAppVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAppVersionsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListAppVersionsRequest): google.cloud.ces.v1beta.ListAppVersionsRequest; + + /** + * Encodes the specified ListAppVersionsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsRequest.verify|verify} messages. + * @param message ListAppVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListAppVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAppVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsRequest.verify|verify} messages. + * @param message ListAppVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListAppVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAppVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAppVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListAppVersionsRequest; + + /** + * Decodes a ListAppVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAppVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListAppVersionsRequest; + + /** + * Verifies a ListAppVersionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAppVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAppVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListAppVersionsRequest; + + /** + * Creates a plain object from a ListAppVersionsRequest message. Also converts values to other types if specified. + * @param message ListAppVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListAppVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAppVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAppVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAppVersionsResponse. */ + interface IListAppVersionsResponse { + + /** ListAppVersionsResponse appVersions */ + appVersions?: (google.cloud.ces.v1beta.IAppVersion[]|null); + + /** ListAppVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAppVersionsResponse. */ + class ListAppVersionsResponse implements IListAppVersionsResponse { + + /** + * Constructs a new ListAppVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListAppVersionsResponse); + + /** ListAppVersionsResponse appVersions. */ + public appVersions: google.cloud.ces.v1beta.IAppVersion[]; + + /** ListAppVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAppVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAppVersionsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListAppVersionsResponse): google.cloud.ces.v1beta.ListAppVersionsResponse; + + /** + * Encodes the specified ListAppVersionsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsResponse.verify|verify} messages. + * @param message ListAppVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListAppVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAppVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsResponse.verify|verify} messages. + * @param message ListAppVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListAppVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAppVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAppVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListAppVersionsResponse; + + /** + * Decodes a ListAppVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAppVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListAppVersionsResponse; + + /** + * Verifies a ListAppVersionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAppVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAppVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListAppVersionsResponse; + + /** + * Creates a plain object from a ListAppVersionsResponse message. Also converts values to other types if specified. + * @param message ListAppVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListAppVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAppVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAppVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAppVersionRequest. */ + interface IGetAppVersionRequest { + + /** GetAppVersionRequest name */ + name?: (string|null); + } + + /** Represents a GetAppVersionRequest. */ + class GetAppVersionRequest implements IGetAppVersionRequest { + + /** + * Constructs a new GetAppVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetAppVersionRequest); + + /** GetAppVersionRequest name. */ + public name: string; + + /** + * Creates a new GetAppVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAppVersionRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetAppVersionRequest): google.cloud.ces.v1beta.GetAppVersionRequest; + + /** + * Encodes the specified GetAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetAppVersionRequest.verify|verify} messages. + * @param message GetAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetAppVersionRequest.verify|verify} messages. + * @param message GetAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAppVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetAppVersionRequest; + + /** + * Decodes a GetAppVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetAppVersionRequest; + + /** + * Verifies a GetAppVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAppVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetAppVersionRequest; + + /** + * Creates a plain object from a GetAppVersionRequest message. Also converts values to other types if specified. + * @param message GetAppVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAppVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAppVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAppVersionRequest. */ + interface IDeleteAppVersionRequest { + + /** DeleteAppVersionRequest name */ + name?: (string|null); + + /** DeleteAppVersionRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteAppVersionRequest. */ + class DeleteAppVersionRequest implements IDeleteAppVersionRequest { + + /** + * Constructs a new DeleteAppVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteAppVersionRequest); + + /** DeleteAppVersionRequest name. */ + public name: string; + + /** DeleteAppVersionRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteAppVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAppVersionRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteAppVersionRequest): google.cloud.ces.v1beta.DeleteAppVersionRequest; + + /** + * Encodes the specified DeleteAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppVersionRequest.verify|verify} messages. + * @param message DeleteAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppVersionRequest.verify|verify} messages. + * @param message DeleteAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAppVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteAppVersionRequest; + + /** + * Decodes a DeleteAppVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteAppVersionRequest; + + /** + * Verifies a DeleteAppVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAppVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteAppVersionRequest; + + /** + * Creates a plain object from a DeleteAppVersionRequest message. Also converts values to other types if specified. + * @param message DeleteAppVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAppVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAppVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAppVersionRequest. */ + interface ICreateAppVersionRequest { + + /** CreateAppVersionRequest parent */ + parent?: (string|null); + + /** CreateAppVersionRequest appVersionId */ + appVersionId?: (string|null); + + /** CreateAppVersionRequest appVersion */ + appVersion?: (google.cloud.ces.v1beta.IAppVersion|null); + } + + /** Represents a CreateAppVersionRequest. */ + class CreateAppVersionRequest implements ICreateAppVersionRequest { + + /** + * Constructs a new CreateAppVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateAppVersionRequest); + + /** CreateAppVersionRequest parent. */ + public parent: string; + + /** CreateAppVersionRequest appVersionId. */ + public appVersionId: string; + + /** CreateAppVersionRequest appVersion. */ + public appVersion?: (google.cloud.ces.v1beta.IAppVersion|null); + + /** + * Creates a new CreateAppVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAppVersionRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateAppVersionRequest): google.cloud.ces.v1beta.CreateAppVersionRequest; + + /** + * Encodes the specified CreateAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppVersionRequest.verify|verify} messages. + * @param message CreateAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppVersionRequest.verify|verify} messages. + * @param message CreateAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAppVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateAppVersionRequest; + + /** + * Decodes a CreateAppVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateAppVersionRequest; + + /** + * Verifies a CreateAppVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAppVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateAppVersionRequest; + + /** + * Creates a plain object from a CreateAppVersionRequest message. Also converts values to other types if specified. + * @param message CreateAppVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAppVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAppVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreAppVersionRequest. */ + interface IRestoreAppVersionRequest { + + /** RestoreAppVersionRequest name */ + name?: (string|null); + } + + /** Represents a RestoreAppVersionRequest. */ + class RestoreAppVersionRequest implements IRestoreAppVersionRequest { + + /** + * Constructs a new RestoreAppVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRestoreAppVersionRequest); + + /** RestoreAppVersionRequest name. */ + public name: string; + + /** + * Creates a new RestoreAppVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreAppVersionRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRestoreAppVersionRequest): google.cloud.ces.v1beta.RestoreAppVersionRequest; + + /** + * Encodes the specified RestoreAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionRequest.verify|verify} messages. + * @param message RestoreAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRestoreAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionRequest.verify|verify} messages. + * @param message RestoreAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRestoreAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreAppVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RestoreAppVersionRequest; + + /** + * Decodes a RestoreAppVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RestoreAppVersionRequest; + + /** + * Verifies a RestoreAppVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreAppVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RestoreAppVersionRequest; + + /** + * Creates a plain object from a RestoreAppVersionRequest message. Also converts values to other types if specified. + * @param message RestoreAppVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RestoreAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreAppVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreAppVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreAppVersionResponse. */ + interface IRestoreAppVersionResponse { + } + + /** Represents a RestoreAppVersionResponse. */ + class RestoreAppVersionResponse implements IRestoreAppVersionResponse { + + /** + * Constructs a new RestoreAppVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRestoreAppVersionResponse); + + /** + * Creates a new RestoreAppVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreAppVersionResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRestoreAppVersionResponse): google.cloud.ces.v1beta.RestoreAppVersionResponse; + + /** + * Encodes the specified RestoreAppVersionResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionResponse.verify|verify} messages. + * @param message RestoreAppVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRestoreAppVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreAppVersionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionResponse.verify|verify} messages. + * @param message RestoreAppVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRestoreAppVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreAppVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreAppVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RestoreAppVersionResponse; + + /** + * Decodes a RestoreAppVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreAppVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RestoreAppVersionResponse; + + /** + * Verifies a RestoreAppVersionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreAppVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreAppVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RestoreAppVersionResponse; + + /** + * Creates a plain object from a RestoreAppVersionResponse message. Also converts values to other types if specified. + * @param message RestoreAppVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RestoreAppVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreAppVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreAppVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateAppResourceResponse. */ + interface IGenerateAppResourceResponse { + + /** GenerateAppResourceResponse agent */ + agent?: (google.cloud.ces.v1beta.IAgent|null); + + /** GenerateAppResourceResponse toolset */ + toolset?: (google.cloud.ces.v1beta.IToolset|null); + + /** GenerateAppResourceResponse appSnapshot */ + appSnapshot?: (google.cloud.ces.v1beta.IAppSnapshot|null); + + /** GenerateAppResourceResponse tools */ + tools?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools|null); + + /** GenerateAppResourceResponse evaluations */ + evaluations?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations|null); + + /** GenerateAppResourceResponse appResources */ + appResources?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources|null); + + /** GenerateAppResourceResponse generateResultInfo */ + generateResultInfo?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo|null); + } + + /** Represents a GenerateAppResourceResponse. */ + class GenerateAppResourceResponse implements IGenerateAppResourceResponse { + + /** + * Constructs a new GenerateAppResourceResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGenerateAppResourceResponse); + + /** GenerateAppResourceResponse agent. */ + public agent?: (google.cloud.ces.v1beta.IAgent|null); + + /** GenerateAppResourceResponse toolset. */ + public toolset?: (google.cloud.ces.v1beta.IToolset|null); + + /** GenerateAppResourceResponse appSnapshot. */ + public appSnapshot?: (google.cloud.ces.v1beta.IAppSnapshot|null); + + /** GenerateAppResourceResponse tools. */ + public tools?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools|null); + + /** GenerateAppResourceResponse evaluations. */ + public evaluations?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations|null); + + /** GenerateAppResourceResponse appResources. */ + public appResources?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources|null); + + /** GenerateAppResourceResponse generateResultInfo. */ + public generateResultInfo?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo|null); + + /** GenerateAppResourceResponse generatedResource. */ + public generatedResource?: ("agent"|"toolset"|"appSnapshot"|"tools"|"evaluations"|"appResources"); + + /** + * Creates a new GenerateAppResourceResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateAppResourceResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGenerateAppResourceResponse): google.cloud.ces.v1beta.GenerateAppResourceResponse; + + /** + * Encodes the specified GenerateAppResourceResponse message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.verify|verify} messages. + * @param message GenerateAppResourceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGenerateAppResourceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateAppResourceResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.verify|verify} messages. + * @param message GenerateAppResourceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGenerateAppResourceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateAppResourceResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateAppResourceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateAppResourceResponse; + + /** + * Decodes a GenerateAppResourceResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateAppResourceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateAppResourceResponse; + + /** + * Verifies a GenerateAppResourceResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateAppResourceResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateAppResourceResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceResponse; + + /** + * Creates a plain object from a GenerateAppResourceResponse message. Also converts values to other types if specified. + * @param message GenerateAppResourceResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateAppResourceResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateAppResourceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GenerateAppResourceResponse { + + /** Properties of an Evaluations. */ + interface IEvaluations { + + /** Evaluations evaluations */ + evaluations?: (google.cloud.ces.v1beta.IEvaluation[]|null); + } + + /** Represents an Evaluations. */ + class Evaluations implements IEvaluations { + + /** + * Constructs a new Evaluations. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations); + + /** Evaluations evaluations. */ + public evaluations: google.cloud.ces.v1beta.IEvaluation[]; + + /** + * Creates a new Evaluations instance using the specified properties. + * @param [properties] Properties to set + * @returns Evaluations instance + */ + public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations): google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations; + + /** + * Encodes the specified Evaluations message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.verify|verify} messages. + * @param message Evaluations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Evaluations message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.verify|verify} messages. + * @param message Evaluations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Evaluations message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Evaluations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations; + + /** + * Decodes an Evaluations message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Evaluations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations; + + /** + * Verifies an Evaluations message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Evaluations message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Evaluations + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations; + + /** + * Creates a plain object from an Evaluations message. Also converts values to other types if specified. + * @param message Evaluations + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Evaluations to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Evaluations + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Tools. */ + interface ITools { + + /** Tools tools */ + tools?: (google.cloud.ces.v1beta.ITool[]|null); + } + + /** Represents a Tools. */ + class Tools implements ITools { + + /** + * Constructs a new Tools. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools); + + /** Tools tools. */ + public tools: google.cloud.ces.v1beta.ITool[]; + + /** + * Creates a new Tools instance using the specified properties. + * @param [properties] Properties to set + * @returns Tools instance + */ + public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools): google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools; + + /** + * Encodes the specified Tools message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.verify|verify} messages. + * @param message Tools message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tools message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.verify|verify} messages. + * @param message Tools message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tools message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tools + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools; + + /** + * Decodes a Tools message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tools + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools; + + /** + * Verifies a Tools message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Tools message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tools + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools; + + /** + * Creates a plain object from a Tools message. Also converts values to other types if specified. + * @param message Tools + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tools to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Tools + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AppResources. */ + interface IAppResources { + + /** AppResources appSnapshot */ + appSnapshot?: (google.cloud.ces.v1beta.IAppSnapshot|null); + + /** AppResources evaluations */ + evaluations?: (google.cloud.ces.v1beta.IEvaluation[]|null); + } + + /** Represents an AppResources. */ + class AppResources implements IAppResources { + + /** + * Constructs a new AppResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources); + + /** AppResources appSnapshot. */ + public appSnapshot?: (google.cloud.ces.v1beta.IAppSnapshot|null); + + /** AppResources evaluations. */ + public evaluations: google.cloud.ces.v1beta.IEvaluation[]; + + /** + * Creates a new AppResources instance using the specified properties. + * @param [properties] Properties to set + * @returns AppResources instance + */ + public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources): google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources; + + /** + * Encodes the specified AppResources message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.verify|verify} messages. + * @param message AppResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppResources message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.verify|verify} messages. + * @param message AppResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources; + + /** + * Decodes an AppResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources; + + /** + * Verifies an AppResources message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AppResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources; + + /** + * Creates a plain object from an AppResources message. Also converts values to other types if specified. + * @param message AppResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppResources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateResultInfo. */ + interface IGenerateResultInfo { + + /** GenerateResultInfo explanation */ + explanation?: (string|null); + } + + /** Represents a GenerateResultInfo. */ + class GenerateResultInfo implements IGenerateResultInfo { + + /** + * Constructs a new GenerateResultInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo); + + /** GenerateResultInfo explanation. */ + public explanation: string; + + /** + * Creates a new GenerateResultInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateResultInfo instance + */ + public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo): google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo; + + /** + * Encodes the specified GenerateResultInfo message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.verify|verify} messages. + * @param message GenerateResultInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateResultInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.verify|verify} messages. + * @param message GenerateResultInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateResultInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateResultInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo; + + /** + * Decodes a GenerateResultInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateResultInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo; + + /** + * Verifies a GenerateResultInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateResultInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateResultInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo; + + /** + * Creates a plain object from a GenerateResultInfo message. Also converts values to other types if specified. + * @param message GenerateResultInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateResultInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateResultInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListChangelogsRequest. */ + interface IListChangelogsRequest { + + /** ListChangelogsRequest parent */ + parent?: (string|null); + + /** ListChangelogsRequest pageSize */ + pageSize?: (number|null); + + /** ListChangelogsRequest pageToken */ + pageToken?: (string|null); + + /** ListChangelogsRequest filter */ + filter?: (string|null); + + /** ListChangelogsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListChangelogsRequest. */ + class ListChangelogsRequest implements IListChangelogsRequest { + + /** + * Constructs a new ListChangelogsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListChangelogsRequest); + + /** ListChangelogsRequest parent. */ + public parent: string; + + /** ListChangelogsRequest pageSize. */ + public pageSize: number; + + /** ListChangelogsRequest pageToken. */ + public pageToken: string; + + /** ListChangelogsRequest filter. */ + public filter: string; + + /** ListChangelogsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListChangelogsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChangelogsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListChangelogsRequest): google.cloud.ces.v1beta.ListChangelogsRequest; + + /** + * Encodes the specified ListChangelogsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsRequest.verify|verify} messages. + * @param message ListChangelogsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListChangelogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListChangelogsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsRequest.verify|verify} messages. + * @param message ListChangelogsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListChangelogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChangelogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListChangelogsRequest; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChangelogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListChangelogsRequest; + + /** + * Verifies a ListChangelogsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListChangelogsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChangelogsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListChangelogsRequest; + + /** + * Creates a plain object from a ListChangelogsRequest message. Also converts values to other types if specified. + * @param message ListChangelogsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListChangelogsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListChangelogsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChangelogsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListChangelogsResponse. */ + interface IListChangelogsResponse { + + /** ListChangelogsResponse changelogs */ + changelogs?: (google.cloud.ces.v1beta.IChangelog[]|null); + + /** ListChangelogsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListChangelogsResponse. */ + class ListChangelogsResponse implements IListChangelogsResponse { + + /** + * Constructs a new ListChangelogsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListChangelogsResponse); + + /** ListChangelogsResponse changelogs. */ + public changelogs: google.cloud.ces.v1beta.IChangelog[]; + + /** ListChangelogsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListChangelogsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChangelogsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListChangelogsResponse): google.cloud.ces.v1beta.ListChangelogsResponse; + + /** + * Encodes the specified ListChangelogsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsResponse.verify|verify} messages. + * @param message ListChangelogsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListChangelogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListChangelogsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsResponse.verify|verify} messages. + * @param message ListChangelogsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListChangelogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChangelogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListChangelogsResponse; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChangelogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListChangelogsResponse; + + /** + * Verifies a ListChangelogsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListChangelogsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChangelogsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListChangelogsResponse; + + /** + * Creates a plain object from a ListChangelogsResponse message. Also converts values to other types if specified. + * @param message ListChangelogsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListChangelogsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListChangelogsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChangelogsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetChangelogRequest. */ + interface IGetChangelogRequest { + + /** GetChangelogRequest name */ + name?: (string|null); + } + + /** Represents a GetChangelogRequest. */ + class GetChangelogRequest implements IGetChangelogRequest { + + /** + * Constructs a new GetChangelogRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetChangelogRequest); + + /** GetChangelogRequest name. */ + public name: string; + + /** + * Creates a new GetChangelogRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetChangelogRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetChangelogRequest): google.cloud.ces.v1beta.GetChangelogRequest; + + /** + * Encodes the specified GetChangelogRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetChangelogRequest.verify|verify} messages. + * @param message GetChangelogRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetChangelogRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetChangelogRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetChangelogRequest.verify|verify} messages. + * @param message GetChangelogRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetChangelogRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetChangelogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetChangelogRequest; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetChangelogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetChangelogRequest; + + /** + * Verifies a GetChangelogRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetChangelogRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetChangelogRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetChangelogRequest; + + /** + * Creates a plain object from a GetChangelogRequest message. Also converts values to other types if specified. + * @param message GetChangelogRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetChangelogRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetChangelogRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetChangelogRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an App. */ + interface IApp { + + /** App name */ + name?: (string|null); + + /** App displayName */ + displayName?: (string|null); + + /** App description */ + description?: (string|null); + + /** App pinned */ + pinned?: (boolean|null); + + /** App rootAgent */ + rootAgent?: (string|null); + + /** App languageSettings */ + languageSettings?: (google.cloud.ces.v1beta.ILanguageSettings|null); + + /** App timeZoneSettings */ + timeZoneSettings?: (google.cloud.ces.v1beta.ITimeZoneSettings|null); + + /** App audioProcessingConfig */ + audioProcessingConfig?: (google.cloud.ces.v1beta.IAudioProcessingConfig|null); + + /** App loggingSettings */ + loggingSettings?: (google.cloud.ces.v1beta.ILoggingSettings|null); + + /** App errorHandlingSettings */ + errorHandlingSettings?: (google.cloud.ces.v1beta.IErrorHandlingSettings|null); + + /** App modelSettings */ + modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** App toolExecutionMode */ + toolExecutionMode?: (google.cloud.ces.v1beta.App.ToolExecutionMode|keyof typeof google.cloud.ces.v1beta.App.ToolExecutionMode|null); + + /** App evaluationMetricsThresholds */ + evaluationMetricsThresholds?: (google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null); + + /** App variableDeclarations */ + variableDeclarations?: (google.cloud.ces.v1beta.App.IVariableDeclaration[]|null); + + /** App predefinedVariableDeclarations */ + predefinedVariableDeclarations?: (google.cloud.ces.v1beta.App.IVariableDeclaration[]|null); + + /** App globalInstruction */ + globalInstruction?: (string|null); + + /** App guardrails */ + guardrails?: (string[]|null); + + /** App dataStoreSettings */ + dataStoreSettings?: (google.cloud.ces.v1beta.IDataStoreSettings|null); + + /** App defaultChannelProfile */ + defaultChannelProfile?: (google.cloud.ces.v1beta.IChannelProfile|null); + + /** App metadata */ + metadata?: ({ [k: string]: string }|null); + + /** App createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** App updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** App etag */ + etag?: (string|null); + + /** App deploymentCount */ + deploymentCount?: (number|null); + + /** App clientCertificateSettings */ + clientCertificateSettings?: (google.cloud.ces.v1beta.IClientCertificateSettings|null); + + /** App locked */ + locked?: (boolean|null); + + /** App evaluationPersonas */ + evaluationPersonas?: (google.cloud.ces.v1beta.IEvaluationPersona[]|null); + + /** App evaluationSettings */ + evaluationSettings?: (google.cloud.ces.v1beta.IEvaluationSettings|null); + } + + /** Represents an App. */ + class App implements IApp { + + /** + * Constructs a new App. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IApp); + + /** App name. */ + public name: string; + + /** App displayName. */ + public displayName: string; + + /** App description. */ + public description: string; + + /** App pinned. */ + public pinned: boolean; + + /** App rootAgent. */ + public rootAgent: string; + + /** App languageSettings. */ + public languageSettings?: (google.cloud.ces.v1beta.ILanguageSettings|null); + + /** App timeZoneSettings. */ + public timeZoneSettings?: (google.cloud.ces.v1beta.ITimeZoneSettings|null); + + /** App audioProcessingConfig. */ + public audioProcessingConfig?: (google.cloud.ces.v1beta.IAudioProcessingConfig|null); + + /** App loggingSettings. */ + public loggingSettings?: (google.cloud.ces.v1beta.ILoggingSettings|null); + + /** App errorHandlingSettings. */ + public errorHandlingSettings?: (google.cloud.ces.v1beta.IErrorHandlingSettings|null); + + /** App modelSettings. */ + public modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** App toolExecutionMode. */ + public toolExecutionMode: (google.cloud.ces.v1beta.App.ToolExecutionMode|keyof typeof google.cloud.ces.v1beta.App.ToolExecutionMode); + + /** App evaluationMetricsThresholds. */ + public evaluationMetricsThresholds?: (google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null); + + /** App variableDeclarations. */ + public variableDeclarations: google.cloud.ces.v1beta.App.IVariableDeclaration[]; + + /** App predefinedVariableDeclarations. */ + public predefinedVariableDeclarations: google.cloud.ces.v1beta.App.IVariableDeclaration[]; + + /** App globalInstruction. */ + public globalInstruction: string; + + /** App guardrails. */ + public guardrails: string[]; + + /** App dataStoreSettings. */ + public dataStoreSettings?: (google.cloud.ces.v1beta.IDataStoreSettings|null); + + /** App defaultChannelProfile. */ + public defaultChannelProfile?: (google.cloud.ces.v1beta.IChannelProfile|null); + + /** App metadata. */ + public metadata: { [k: string]: string }; + + /** App createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** App updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** App etag. */ + public etag: string; + + /** App deploymentCount. */ + public deploymentCount: number; + + /** App clientCertificateSettings. */ + public clientCertificateSettings?: (google.cloud.ces.v1beta.IClientCertificateSettings|null); + + /** App locked. */ + public locked: boolean; + + /** App evaluationPersonas. */ + public evaluationPersonas: google.cloud.ces.v1beta.IEvaluationPersona[]; + + /** App evaluationSettings. */ + public evaluationSettings?: (google.cloud.ces.v1beta.IEvaluationSettings|null); + + /** + * Creates a new App instance using the specified properties. + * @param [properties] Properties to set + * @returns App instance + */ + public static create(properties?: google.cloud.ces.v1beta.IApp): google.cloud.ces.v1beta.App; + + /** + * Encodes the specified App message. Does not implicitly {@link google.cloud.ces.v1beta.App.verify|verify} messages. + * @param message App message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IApp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified App message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.App.verify|verify} messages. + * @param message App message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IApp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an App message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns App + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.App; + + /** + * Decodes an App message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns App + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.App; + + /** + * Verifies an App message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an App message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns App + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.App; + + /** + * Creates a plain object from an App message. Also converts values to other types if specified. + * @param message App + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.App, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this App to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for App + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace App { + + /** Properties of a VariableDeclaration. */ + interface IVariableDeclaration { + + /** VariableDeclaration name */ + name?: (string|null); + + /** VariableDeclaration description */ + description?: (string|null); + + /** VariableDeclaration schema */ + schema?: (google.cloud.ces.v1beta.ISchema|null); + } + + /** Represents a VariableDeclaration. */ + class VariableDeclaration implements IVariableDeclaration { + + /** + * Constructs a new VariableDeclaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.App.IVariableDeclaration); + + /** VariableDeclaration name. */ + public name: string; + + /** VariableDeclaration description. */ + public description: string; + + /** VariableDeclaration schema. */ + public schema?: (google.cloud.ces.v1beta.ISchema|null); + + /** + * Creates a new VariableDeclaration instance using the specified properties. + * @param [properties] Properties to set + * @returns VariableDeclaration instance + */ + public static create(properties?: google.cloud.ces.v1beta.App.IVariableDeclaration): google.cloud.ces.v1beta.App.VariableDeclaration; + + /** + * Encodes the specified VariableDeclaration message. Does not implicitly {@link google.cloud.ces.v1beta.App.VariableDeclaration.verify|verify} messages. + * @param message VariableDeclaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.App.IVariableDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VariableDeclaration message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.App.VariableDeclaration.verify|verify} messages. + * @param message VariableDeclaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.App.IVariableDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VariableDeclaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VariableDeclaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.App.VariableDeclaration; + + /** + * Decodes a VariableDeclaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VariableDeclaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.App.VariableDeclaration; + + /** + * Verifies a VariableDeclaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VariableDeclaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VariableDeclaration + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.App.VariableDeclaration; + + /** + * Creates a plain object from a VariableDeclaration message. Also converts values to other types if specified. + * @param message VariableDeclaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.App.VariableDeclaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VariableDeclaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VariableDeclaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ToolExecutionMode enum. */ + enum ToolExecutionMode { + TOOL_EXECUTION_MODE_UNSPECIFIED = 0, + PARALLEL = 1, + SEQUENTIAL = 2 + } + } + + /** Properties of a TimeZoneSettings. */ + interface ITimeZoneSettings { + + /** TimeZoneSettings timeZone */ + timeZone?: (string|null); + } + + /** Represents a TimeZoneSettings. */ + class TimeZoneSettings implements ITimeZoneSettings { + + /** + * Constructs a new TimeZoneSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ITimeZoneSettings); + + /** TimeZoneSettings timeZone. */ + public timeZone: string; + + /** + * Creates a new TimeZoneSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeZoneSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.ITimeZoneSettings): google.cloud.ces.v1beta.TimeZoneSettings; + + /** + * Encodes the specified TimeZoneSettings message. Does not implicitly {@link google.cloud.ces.v1beta.TimeZoneSettings.verify|verify} messages. + * @param message TimeZoneSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ITimeZoneSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeZoneSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TimeZoneSettings.verify|verify} messages. + * @param message TimeZoneSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ITimeZoneSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeZoneSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeZoneSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TimeZoneSettings; + + /** + * Decodes a TimeZoneSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeZoneSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TimeZoneSettings; + + /** + * Verifies a TimeZoneSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeZoneSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeZoneSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TimeZoneSettings; + + /** + * Creates a plain object from a TimeZoneSettings message. Also converts values to other types if specified. + * @param message TimeZoneSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TimeZoneSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeZoneSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeZoneSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LanguageSettings. */ + interface ILanguageSettings { + + /** LanguageSettings defaultLanguageCode */ + defaultLanguageCode?: (string|null); + + /** LanguageSettings supportedLanguageCodes */ + supportedLanguageCodes?: (string[]|null); + + /** LanguageSettings enableMultilingualSupport */ + enableMultilingualSupport?: (boolean|null); + + /** LanguageSettings fallbackAction */ + fallbackAction?: (string|null); + } + + /** Represents a LanguageSettings. */ + class LanguageSettings implements ILanguageSettings { + + /** + * Constructs a new LanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ILanguageSettings); + + /** LanguageSettings defaultLanguageCode. */ + public defaultLanguageCode: string; + + /** LanguageSettings supportedLanguageCodes. */ + public supportedLanguageCodes: string[]; + + /** LanguageSettings enableMultilingualSupport. */ + public enableMultilingualSupport: boolean; + + /** LanguageSettings fallbackAction. */ + public fallbackAction: string; + + /** + * Creates a new LanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns LanguageSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.ILanguageSettings): google.cloud.ces.v1beta.LanguageSettings; + + /** + * Encodes the specified LanguageSettings message. Does not implicitly {@link google.cloud.ces.v1beta.LanguageSettings.verify|verify} messages. + * @param message LanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ILanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LanguageSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LanguageSettings.verify|verify} messages. + * @param message LanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ILanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LanguageSettings; + + /** + * Decodes a LanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LanguageSettings; + + /** + * Verifies a LanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LanguageSettings; + + /** + * Creates a plain object from a LanguageSettings message. Also converts values to other types if specified. + * @param message LanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.LanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AudioProcessingConfig. */ + interface IAudioProcessingConfig { + + /** AudioProcessingConfig synthesizeSpeechConfigs */ + synthesizeSpeechConfigs?: ({ [k: string]: google.cloud.ces.v1beta.ISynthesizeSpeechConfig }|null); + + /** AudioProcessingConfig bargeInConfig */ + bargeInConfig?: (google.cloud.ces.v1beta.IBargeInConfig|null); + + /** AudioProcessingConfig inactivityTimeout */ + inactivityTimeout?: (google.protobuf.IDuration|null); + + /** AudioProcessingConfig ambientSoundConfig */ + ambientSoundConfig?: (google.cloud.ces.v1beta.IAmbientSoundConfig|null); + } + + /** Represents an AudioProcessingConfig. */ + class AudioProcessingConfig implements IAudioProcessingConfig { + + /** + * Constructs a new AudioProcessingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IAudioProcessingConfig); + + /** AudioProcessingConfig synthesizeSpeechConfigs. */ + public synthesizeSpeechConfigs: { [k: string]: google.cloud.ces.v1beta.ISynthesizeSpeechConfig }; + + /** AudioProcessingConfig bargeInConfig. */ + public bargeInConfig?: (google.cloud.ces.v1beta.IBargeInConfig|null); + + /** AudioProcessingConfig inactivityTimeout. */ + public inactivityTimeout?: (google.protobuf.IDuration|null); + + /** AudioProcessingConfig ambientSoundConfig. */ + public ambientSoundConfig?: (google.cloud.ces.v1beta.IAmbientSoundConfig|null); + + /** + * Creates a new AudioProcessingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AudioProcessingConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IAudioProcessingConfig): google.cloud.ces.v1beta.AudioProcessingConfig; + + /** + * Encodes the specified AudioProcessingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.AudioProcessingConfig.verify|verify} messages. + * @param message AudioProcessingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IAudioProcessingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AudioProcessingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AudioProcessingConfig.verify|verify} messages. + * @param message AudioProcessingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IAudioProcessingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AudioProcessingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AudioProcessingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AudioProcessingConfig; + + /** + * Decodes an AudioProcessingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AudioProcessingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AudioProcessingConfig; + + /** + * Verifies an AudioProcessingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AudioProcessingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AudioProcessingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AudioProcessingConfig; + + /** + * Creates a plain object from an AudioProcessingConfig message. Also converts values to other types if specified. + * @param message AudioProcessingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AudioProcessingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AudioProcessingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AudioProcessingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AmbientSoundConfig. */ + interface IAmbientSoundConfig { + + /** AmbientSoundConfig prebuiltAmbientNoise */ + prebuiltAmbientNoise?: (google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise|keyof typeof google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise|null); + + /** AmbientSoundConfig gcsUri */ + gcsUri?: (string|null); + + /** AmbientSoundConfig prebuiltAmbientSound */ + prebuiltAmbientSound?: (string|null); + + /** AmbientSoundConfig volumeGainDb */ + volumeGainDb?: (number|null); + } + + /** Represents an AmbientSoundConfig. */ + class AmbientSoundConfig implements IAmbientSoundConfig { + + /** + * Constructs a new AmbientSoundConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IAmbientSoundConfig); + + /** AmbientSoundConfig prebuiltAmbientNoise. */ + public prebuiltAmbientNoise?: (google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise|keyof typeof google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise|null); + + /** AmbientSoundConfig gcsUri. */ + public gcsUri?: (string|null); + + /** AmbientSoundConfig prebuiltAmbientSound. */ + public prebuiltAmbientSound?: (string|null); + + /** AmbientSoundConfig volumeGainDb. */ + public volumeGainDb: number; + + /** AmbientSoundConfig source. */ + public source?: ("prebuiltAmbientNoise"|"gcsUri"|"prebuiltAmbientSound"); + + /** + * Creates a new AmbientSoundConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AmbientSoundConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IAmbientSoundConfig): google.cloud.ces.v1beta.AmbientSoundConfig; + + /** + * Encodes the specified AmbientSoundConfig message. Does not implicitly {@link google.cloud.ces.v1beta.AmbientSoundConfig.verify|verify} messages. + * @param message AmbientSoundConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IAmbientSoundConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AmbientSoundConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AmbientSoundConfig.verify|verify} messages. + * @param message AmbientSoundConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IAmbientSoundConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AmbientSoundConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AmbientSoundConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AmbientSoundConfig; + + /** + * Decodes an AmbientSoundConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AmbientSoundConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AmbientSoundConfig; + + /** + * Verifies an AmbientSoundConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AmbientSoundConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AmbientSoundConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AmbientSoundConfig; + + /** + * Creates a plain object from an AmbientSoundConfig message. Also converts values to other types if specified. + * @param message AmbientSoundConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AmbientSoundConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AmbientSoundConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AmbientSoundConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AmbientSoundConfig { + + /** PrebuiltAmbientNoise enum. */ + enum PrebuiltAmbientNoise { + PREBUILT_AMBIENT_NOISE_UNSPECIFIED = 0, + RETAIL_STORE = 1, + CONVENTION_HALL = 2, + OUTDOOR = 3 + } + } + + /** Properties of a BargeInConfig. */ + interface IBargeInConfig { + + /** BargeInConfig disableBargeIn */ + disableBargeIn?: (boolean|null); + + /** BargeInConfig bargeInAwareness */ + bargeInAwareness?: (boolean|null); + } + + /** Represents a BargeInConfig. */ + class BargeInConfig implements IBargeInConfig { + + /** + * Constructs a new BargeInConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IBargeInConfig); + + /** BargeInConfig disableBargeIn. */ + public disableBargeIn: boolean; + + /** BargeInConfig bargeInAwareness. */ + public bargeInAwareness: boolean; + + /** + * Creates a new BargeInConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BargeInConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IBargeInConfig): google.cloud.ces.v1beta.BargeInConfig; + + /** + * Encodes the specified BargeInConfig message. Does not implicitly {@link google.cloud.ces.v1beta.BargeInConfig.verify|verify} messages. + * @param message BargeInConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IBargeInConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BargeInConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BargeInConfig.verify|verify} messages. + * @param message BargeInConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IBargeInConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BargeInConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BargeInConfig; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BargeInConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BargeInConfig; + + /** + * Verifies a BargeInConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BargeInConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BargeInConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BargeInConfig; + + /** + * Creates a plain object from a BargeInConfig message. Also converts values to other types if specified. + * @param message BargeInConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.BargeInConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BargeInConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BargeInConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SynthesizeSpeechConfig. */ + interface ISynthesizeSpeechConfig { + + /** SynthesizeSpeechConfig voice */ + voice?: (string|null); + + /** SynthesizeSpeechConfig speakingRate */ + speakingRate?: (number|null); + } + + /** Represents a SynthesizeSpeechConfig. */ + class SynthesizeSpeechConfig implements ISynthesizeSpeechConfig { + + /** + * Constructs a new SynthesizeSpeechConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ISynthesizeSpeechConfig); + + /** SynthesizeSpeechConfig voice. */ + public voice: string; + + /** SynthesizeSpeechConfig speakingRate. */ + public speakingRate: number; + + /** + * Creates a new SynthesizeSpeechConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SynthesizeSpeechConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.ISynthesizeSpeechConfig): google.cloud.ces.v1beta.SynthesizeSpeechConfig; + + /** + * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.ces.v1beta.SynthesizeSpeechConfig.verify|verify} messages. + * @param message SynthesizeSpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SynthesizeSpeechConfig.verify|verify} messages. + * @param message SynthesizeSpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SynthesizeSpeechConfig; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SynthesizeSpeechConfig; + + /** + * Verifies a SynthesizeSpeechConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SynthesizeSpeechConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SynthesizeSpeechConfig; + + /** + * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. + * @param message SynthesizeSpeechConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.SynthesizeSpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SynthesizeSpeechConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SynthesizeSpeechConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetricAnalysisSettings. */ + interface IMetricAnalysisSettings { + + /** MetricAnalysisSettings llmMetricsOptedOut */ + llmMetricsOptedOut?: (boolean|null); + } + + /** Represents a MetricAnalysisSettings. */ + class MetricAnalysisSettings implements IMetricAnalysisSettings { + + /** + * Constructs a new MetricAnalysisSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IMetricAnalysisSettings); + + /** MetricAnalysisSettings llmMetricsOptedOut. */ + public llmMetricsOptedOut: boolean; + + /** + * Creates a new MetricAnalysisSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricAnalysisSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.IMetricAnalysisSettings): google.cloud.ces.v1beta.MetricAnalysisSettings; + + /** + * Encodes the specified MetricAnalysisSettings message. Does not implicitly {@link google.cloud.ces.v1beta.MetricAnalysisSettings.verify|verify} messages. + * @param message MetricAnalysisSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IMetricAnalysisSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricAnalysisSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.MetricAnalysisSettings.verify|verify} messages. + * @param message MetricAnalysisSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IMetricAnalysisSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricAnalysisSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricAnalysisSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.MetricAnalysisSettings; + + /** + * Decodes a MetricAnalysisSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricAnalysisSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.MetricAnalysisSettings; + + /** + * Verifies a MetricAnalysisSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetricAnalysisSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricAnalysisSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.MetricAnalysisSettings; + + /** + * Creates a plain object from a MetricAnalysisSettings message. Also converts values to other types if specified. + * @param message MetricAnalysisSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.MetricAnalysisSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricAnalysisSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricAnalysisSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LoggingSettings. */ + interface ILoggingSettings { + + /** LoggingSettings redactionConfig */ + redactionConfig?: (google.cloud.ces.v1beta.IRedactionConfig|null); + + /** LoggingSettings audioRecordingConfig */ + audioRecordingConfig?: (google.cloud.ces.v1beta.IAudioRecordingConfig|null); + + /** LoggingSettings bigqueryExportSettings */ + bigqueryExportSettings?: (google.cloud.ces.v1beta.IBigQueryExportSettings|null); + + /** LoggingSettings cloudLoggingSettings */ + cloudLoggingSettings?: (google.cloud.ces.v1beta.ICloudLoggingSettings|null); + + /** LoggingSettings conversationLoggingSettings */ + conversationLoggingSettings?: (google.cloud.ces.v1beta.IConversationLoggingSettings|null); + + /** LoggingSettings evaluationAudioRecordingConfig */ + evaluationAudioRecordingConfig?: (google.cloud.ces.v1beta.IAudioRecordingConfig|null); + + /** LoggingSettings metricAnalysisSettings */ + metricAnalysisSettings?: (google.cloud.ces.v1beta.IMetricAnalysisSettings|null); + } + + /** Represents a LoggingSettings. */ + class LoggingSettings implements ILoggingSettings { + + /** + * Constructs a new LoggingSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ILoggingSettings); + + /** LoggingSettings redactionConfig. */ + public redactionConfig?: (google.cloud.ces.v1beta.IRedactionConfig|null); + + /** LoggingSettings audioRecordingConfig. */ + public audioRecordingConfig?: (google.cloud.ces.v1beta.IAudioRecordingConfig|null); + + /** LoggingSettings bigqueryExportSettings. */ + public bigqueryExportSettings?: (google.cloud.ces.v1beta.IBigQueryExportSettings|null); + + /** LoggingSettings cloudLoggingSettings. */ + public cloudLoggingSettings?: (google.cloud.ces.v1beta.ICloudLoggingSettings|null); + + /** LoggingSettings conversationLoggingSettings. */ + public conversationLoggingSettings?: (google.cloud.ces.v1beta.IConversationLoggingSettings|null); + + /** LoggingSettings evaluationAudioRecordingConfig. */ + public evaluationAudioRecordingConfig?: (google.cloud.ces.v1beta.IAudioRecordingConfig|null); + + /** LoggingSettings metricAnalysisSettings. */ + public metricAnalysisSettings?: (google.cloud.ces.v1beta.IMetricAnalysisSettings|null); + + /** + * Creates a new LoggingSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns LoggingSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.ILoggingSettings): google.cloud.ces.v1beta.LoggingSettings; + + /** + * Encodes the specified LoggingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.LoggingSettings.verify|verify} messages. + * @param message LoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ILoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LoggingSettings.verify|verify} messages. + * @param message LoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ILoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LoggingSettings; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LoggingSettings; + + /** + * Verifies a LoggingSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LoggingSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoggingSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LoggingSettings; + + /** + * Creates a plain object from a LoggingSettings message. Also converts values to other types if specified. + * @param message LoggingSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.LoggingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoggingSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoggingSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ErrorHandlingSettings. */ + interface IErrorHandlingSettings { + + /** ErrorHandlingSettings errorHandlingStrategy */ + errorHandlingStrategy?: (google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy|keyof typeof google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy|null); + } + + /** Represents an ErrorHandlingSettings. */ + class ErrorHandlingSettings implements IErrorHandlingSettings { + + /** + * Constructs a new ErrorHandlingSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IErrorHandlingSettings); + + /** ErrorHandlingSettings errorHandlingStrategy. */ + public errorHandlingStrategy: (google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy|keyof typeof google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy); + + /** + * Creates a new ErrorHandlingSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ErrorHandlingSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.IErrorHandlingSettings): google.cloud.ces.v1beta.ErrorHandlingSettings; + + /** + * Encodes the specified ErrorHandlingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ErrorHandlingSettings.verify|verify} messages. + * @param message ErrorHandlingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IErrorHandlingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ErrorHandlingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ErrorHandlingSettings.verify|verify} messages. + * @param message ErrorHandlingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IErrorHandlingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ErrorHandlingSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ErrorHandlingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ErrorHandlingSettings; + + /** + * Decodes an ErrorHandlingSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ErrorHandlingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ErrorHandlingSettings; + + /** + * Verifies an ErrorHandlingSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ErrorHandlingSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ErrorHandlingSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ErrorHandlingSettings; + + /** + * Creates a plain object from an ErrorHandlingSettings message. Also converts values to other types if specified. + * @param message ErrorHandlingSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ErrorHandlingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ErrorHandlingSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ErrorHandlingSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ErrorHandlingSettings { + + /** ErrorHandlingStrategy enum. */ + enum ErrorHandlingStrategy { + ERROR_HANDLING_STRATEGY_UNSPECIFIED = 0, + NONE = 1, + FALLBACK_RESPONSE = 2 + } + } + + /** Properties of an EvaluationMetricsThresholds. */ + interface IEvaluationMetricsThresholds { + + /** EvaluationMetricsThresholds goldenEvaluationMetricsThresholds */ + goldenEvaluationMetricsThresholds?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null); + + /** EvaluationMetricsThresholds hallucinationMetricBehavior */ + hallucinationMetricBehavior?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|null); + + /** EvaluationMetricsThresholds goldenHallucinationMetricBehavior */ + goldenHallucinationMetricBehavior?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|null); + + /** EvaluationMetricsThresholds scenarioHallucinationMetricBehavior */ + scenarioHallucinationMetricBehavior?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|null); + } + + /** Represents an EvaluationMetricsThresholds. */ + class EvaluationMetricsThresholds implements IEvaluationMetricsThresholds { + + /** + * Constructs a new EvaluationMetricsThresholds. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluationMetricsThresholds); + + /** EvaluationMetricsThresholds goldenEvaluationMetricsThresholds. */ + public goldenEvaluationMetricsThresholds?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null); + + /** EvaluationMetricsThresholds hallucinationMetricBehavior. */ + public hallucinationMetricBehavior: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior); + + /** EvaluationMetricsThresholds goldenHallucinationMetricBehavior. */ + public goldenHallucinationMetricBehavior: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior); + + /** EvaluationMetricsThresholds scenarioHallucinationMetricBehavior. */ + public scenarioHallucinationMetricBehavior: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior); + + /** + * Creates a new EvaluationMetricsThresholds instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationMetricsThresholds instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluationMetricsThresholds): google.cloud.ces.v1beta.EvaluationMetricsThresholds; + + /** + * Encodes the specified EvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.verify|verify} messages. + * @param message EvaluationMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.verify|verify} messages. + * @param message EvaluationMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationMetricsThresholds; + + /** + * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationMetricsThresholds; + + /** + * Verifies an EvaluationMetricsThresholds message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationMetricsThresholds + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationMetricsThresholds; + + /** + * Creates a plain object from an EvaluationMetricsThresholds message. Also converts values to other types if specified. + * @param message EvaluationMetricsThresholds + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationMetricsThresholds to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationMetricsThresholds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EvaluationMetricsThresholds { + + /** Properties of a GoldenEvaluationMetricsThresholds. */ + interface IGoldenEvaluationMetricsThresholds { + + /** GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds */ + turnLevelMetricsThresholds?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null); + + /** GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds */ + expectationLevelMetricsThresholds?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null); + + /** GoldenEvaluationMetricsThresholds toolMatchingSettings */ + toolMatchingSettings?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings|null); + } + + /** Represents a GoldenEvaluationMetricsThresholds. */ + class GoldenEvaluationMetricsThresholds implements IGoldenEvaluationMetricsThresholds { + + /** + * Constructs a new GoldenEvaluationMetricsThresholds. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds); + + /** GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds. */ + public turnLevelMetricsThresholds?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null); + + /** GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds. */ + public expectationLevelMetricsThresholds?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null); + + /** GoldenEvaluationMetricsThresholds toolMatchingSettings. */ + public toolMatchingSettings?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings|null); + + /** + * Creates a new GoldenEvaluationMetricsThresholds instance using the specified properties. + * @param [properties] Properties to set + * @returns GoldenEvaluationMetricsThresholds instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; + + /** + * Encodes the specified GoldenEvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. + * @param message GoldenEvaluationMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoldenEvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. + * @param message GoldenEvaluationMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoldenEvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; + + /** + * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoldenEvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; + + /** + * Verifies a GoldenEvaluationMetricsThresholds message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoldenEvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoldenEvaluationMetricsThresholds + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; + + /** + * Creates a plain object from a GoldenEvaluationMetricsThresholds message. Also converts values to other types if specified. + * @param message GoldenEvaluationMetricsThresholds + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoldenEvaluationMetricsThresholds to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoldenEvaluationMetricsThresholds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GoldenEvaluationMetricsThresholds { + + /** Properties of a TurnLevelMetricsThresholds. */ + interface ITurnLevelMetricsThresholds { + + /** TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold */ + semanticSimilaritySuccessThreshold?: (number|null); + + /** TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold */ + overallToolInvocationCorrectnessThreshold?: (number|null); + + /** TurnLevelMetricsThresholds semanticSimilarityChannel */ + semanticSimilarityChannel?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|null); + } + + /** Represents a TurnLevelMetricsThresholds. */ + class TurnLevelMetricsThresholds implements ITurnLevelMetricsThresholds { + + /** + * Constructs a new TurnLevelMetricsThresholds. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds); + + /** TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold. */ + public semanticSimilaritySuccessThreshold?: (number|null); + + /** TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold. */ + public overallToolInvocationCorrectnessThreshold?: (number|null); + + /** TurnLevelMetricsThresholds semanticSimilarityChannel. */ + public semanticSimilarityChannel: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel); + + /** + * Creates a new TurnLevelMetricsThresholds instance using the specified properties. + * @param [properties] Properties to set + * @returns TurnLevelMetricsThresholds instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; + + /** + * Encodes the specified TurnLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. + * @param message TurnLevelMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TurnLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. + * @param message TurnLevelMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TurnLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; + + /** + * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TurnLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; + + /** + * Verifies a TurnLevelMetricsThresholds message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TurnLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TurnLevelMetricsThresholds + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; + + /** + * Creates a plain object from a TurnLevelMetricsThresholds message. Also converts values to other types if specified. + * @param message TurnLevelMetricsThresholds + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TurnLevelMetricsThresholds to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TurnLevelMetricsThresholds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TurnLevelMetricsThresholds { + + /** SemanticSimilarityChannel enum. */ + enum SemanticSimilarityChannel { + SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED = 0, + TEXT = 1, + AUDIO = 2 + } + } + + /** Properties of an ExpectationLevelMetricsThresholds. */ + interface IExpectationLevelMetricsThresholds { + + /** ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold */ + toolInvocationParameterCorrectnessThreshold?: (number|null); + } + + /** Represents an ExpectationLevelMetricsThresholds. */ + class ExpectationLevelMetricsThresholds implements IExpectationLevelMetricsThresholds { + + /** + * Constructs a new ExpectationLevelMetricsThresholds. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds); + + /** ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold. */ + public toolInvocationParameterCorrectnessThreshold?: (number|null); + + /** + * Creates a new ExpectationLevelMetricsThresholds instance using the specified properties. + * @param [properties] Properties to set + * @returns ExpectationLevelMetricsThresholds instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; + + /** + * Encodes the specified ExpectationLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. + * @param message ExpectationLevelMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExpectationLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. + * @param message ExpectationLevelMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExpectationLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; + + /** + * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExpectationLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; + + /** + * Verifies an ExpectationLevelMetricsThresholds message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExpectationLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExpectationLevelMetricsThresholds + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; + + /** + * Creates a plain object from an ExpectationLevelMetricsThresholds message. Also converts values to other types if specified. + * @param message ExpectationLevelMetricsThresholds + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExpectationLevelMetricsThresholds to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExpectationLevelMetricsThresholds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ToolMatchingSettings. */ + interface IToolMatchingSettings { + + /** ToolMatchingSettings extraToolCallBehavior */ + extraToolCallBehavior?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|null); + } + + /** Represents a ToolMatchingSettings. */ + class ToolMatchingSettings implements IToolMatchingSettings { + + /** + * Constructs a new ToolMatchingSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings); + + /** ToolMatchingSettings extraToolCallBehavior. */ + public extraToolCallBehavior: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior); + + /** + * Creates a new ToolMatchingSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolMatchingSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings): google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings; + + /** + * Encodes the specified ToolMatchingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. + * @param message ToolMatchingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolMatchingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. + * @param message ToolMatchingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolMatchingSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolMatchingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings; + + /** + * Decodes a ToolMatchingSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolMatchingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings; + + /** + * Verifies a ToolMatchingSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolMatchingSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolMatchingSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings; + + /** + * Creates a plain object from a ToolMatchingSettings message. Also converts values to other types if specified. + * @param message ToolMatchingSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolMatchingSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolMatchingSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ToolMatchingSettings { + + /** ExtraToolCallBehavior enum. */ + enum ExtraToolCallBehavior { + EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED = 0, + FAIL = 1, + ALLOW = 2 + } + } + + /** HallucinationMetricBehavior enum. */ + enum HallucinationMetricBehavior { + HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED = 0, + DISABLED = 1, + ENABLED = 2 + } + } + + /** Properties of an EvaluationSettings. */ + interface IEvaluationSettings { + + /** EvaluationSettings scenarioConversationInitiator */ + scenarioConversationInitiator?: (google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator|keyof typeof google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator|null); + + /** EvaluationSettings goldenRunMethod */ + goldenRunMethod?: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod|null); + + /** EvaluationSettings goldenEvaluationToolCallBehaviour */ + goldenEvaluationToolCallBehaviour?: (google.cloud.ces.v1beta.EvaluationToolCallBehaviour|keyof typeof google.cloud.ces.v1beta.EvaluationToolCallBehaviour|null); + + /** EvaluationSettings scenarioEvaluationToolCallBehaviour */ + scenarioEvaluationToolCallBehaviour?: (google.cloud.ces.v1beta.EvaluationToolCallBehaviour|keyof typeof google.cloud.ces.v1beta.EvaluationToolCallBehaviour|null); + } + + /** Represents an EvaluationSettings. */ + class EvaluationSettings implements IEvaluationSettings { + + /** + * Constructs a new EvaluationSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluationSettings); + + /** EvaluationSettings scenarioConversationInitiator. */ + public scenarioConversationInitiator: (google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator|keyof typeof google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator); + + /** EvaluationSettings goldenRunMethod. */ + public goldenRunMethod: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod); + + /** EvaluationSettings goldenEvaluationToolCallBehaviour. */ + public goldenEvaluationToolCallBehaviour: (google.cloud.ces.v1beta.EvaluationToolCallBehaviour|keyof typeof google.cloud.ces.v1beta.EvaluationToolCallBehaviour); + + /** EvaluationSettings scenarioEvaluationToolCallBehaviour. */ + public scenarioEvaluationToolCallBehaviour: (google.cloud.ces.v1beta.EvaluationToolCallBehaviour|keyof typeof google.cloud.ces.v1beta.EvaluationToolCallBehaviour); + + /** + * Creates a new EvaluationSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluationSettings): google.cloud.ces.v1beta.EvaluationSettings; + + /** + * Encodes the specified EvaluationSettings message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationSettings.verify|verify} messages. + * @param message EvaluationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationSettings.verify|verify} messages. + * @param message EvaluationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationSettings; + + /** + * Decodes an EvaluationSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationSettings; + + /** + * Verifies an EvaluationSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationSettings; + + /** + * Creates a plain object from an EvaluationSettings message. Also converts values to other types if specified. + * @param message EvaluationSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EvaluationSettings { + + /** ScenarioConversationInitiator enum. */ + enum ScenarioConversationInitiator { + SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED = 0, + USER = 1, + AGENT = 2 + } + } + + /** Properties of a ClientCertificateSettings. */ + interface IClientCertificateSettings { + + /** ClientCertificateSettings tlsCertificate */ + tlsCertificate?: (string|null); + + /** ClientCertificateSettings privateKey */ + privateKey?: (string|null); + + /** ClientCertificateSettings passphrase */ + passphrase?: (string|null); + } + + /** Represents a ClientCertificateSettings. */ + class ClientCertificateSettings implements IClientCertificateSettings { + + /** + * Constructs a new ClientCertificateSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IClientCertificateSettings); + + /** ClientCertificateSettings tlsCertificate. */ + public tlsCertificate: string; + + /** ClientCertificateSettings privateKey. */ + public privateKey: string; + + /** ClientCertificateSettings passphrase. */ + public passphrase: string; + + /** + * Creates a new ClientCertificateSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientCertificateSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.IClientCertificateSettings): google.cloud.ces.v1beta.ClientCertificateSettings; + + /** + * Encodes the specified ClientCertificateSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ClientCertificateSettings.verify|verify} messages. + * @param message ClientCertificateSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IClientCertificateSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientCertificateSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ClientCertificateSettings.verify|verify} messages. + * @param message ClientCertificateSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IClientCertificateSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientCertificateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ClientCertificateSettings; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientCertificateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ClientCertificateSettings; + + /** + * Verifies a ClientCertificateSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientCertificateSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientCertificateSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ClientCertificateSettings; + + /** + * Creates a plain object from a ClientCertificateSettings message. Also converts values to other types if specified. + * @param message ClientCertificateSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ClientCertificateSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientCertificateSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientCertificateSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConversationLoggingSettings. */ + interface IConversationLoggingSettings { + + /** ConversationLoggingSettings disableConversationLogging */ + disableConversationLogging?: (boolean|null); + } + + /** Represents a ConversationLoggingSettings. */ + class ConversationLoggingSettings implements IConversationLoggingSettings { + + /** + * Constructs a new ConversationLoggingSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IConversationLoggingSettings); + + /** ConversationLoggingSettings disableConversationLogging. */ + public disableConversationLogging: boolean; + + /** + * Creates a new ConversationLoggingSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversationLoggingSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.IConversationLoggingSettings): google.cloud.ces.v1beta.ConversationLoggingSettings; + + /** + * Encodes the specified ConversationLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ConversationLoggingSettings.verify|verify} messages. + * @param message ConversationLoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IConversationLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConversationLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ConversationLoggingSettings.verify|verify} messages. + * @param message ConversationLoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IConversationLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConversationLoggingSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversationLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ConversationLoggingSettings; + + /** + * Decodes a ConversationLoggingSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversationLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ConversationLoggingSettings; + + /** + * Verifies a ConversationLoggingSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConversationLoggingSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversationLoggingSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ConversationLoggingSettings; + + /** + * Creates a plain object from a ConversationLoggingSettings message. Also converts values to other types if specified. + * @param message ConversationLoggingSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ConversationLoggingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConversationLoggingSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConversationLoggingSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudLoggingSettings. */ + interface ICloudLoggingSettings { + + /** CloudLoggingSettings enableCloudLogging */ + enableCloudLogging?: (boolean|null); + } + + /** Represents a CloudLoggingSettings. */ + class CloudLoggingSettings implements ICloudLoggingSettings { + + /** + * Constructs a new CloudLoggingSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICloudLoggingSettings); + + /** CloudLoggingSettings enableCloudLogging. */ + public enableCloudLogging: boolean; + + /** + * Creates a new CloudLoggingSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudLoggingSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICloudLoggingSettings): google.cloud.ces.v1beta.CloudLoggingSettings; + + /** + * Encodes the specified CloudLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.CloudLoggingSettings.verify|verify} messages. + * @param message CloudLoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICloudLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CloudLoggingSettings.verify|verify} messages. + * @param message CloudLoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICloudLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudLoggingSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CloudLoggingSettings; + + /** + * Decodes a CloudLoggingSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CloudLoggingSettings; + + /** + * Verifies a CloudLoggingSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudLoggingSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudLoggingSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CloudLoggingSettings; + + /** + * Creates a plain object from a CloudLoggingSettings message. Also converts values to other types if specified. + * @param message CloudLoggingSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CloudLoggingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudLoggingSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudLoggingSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AudioRecordingConfig. */ + interface IAudioRecordingConfig { + + /** AudioRecordingConfig gcsBucket */ + gcsBucket?: (string|null); + + /** AudioRecordingConfig gcsPathPrefix */ + gcsPathPrefix?: (string|null); + } + + /** Represents an AudioRecordingConfig. */ + class AudioRecordingConfig implements IAudioRecordingConfig { + + /** + * Constructs a new AudioRecordingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IAudioRecordingConfig); + + /** AudioRecordingConfig gcsBucket. */ + public gcsBucket: string; + + /** AudioRecordingConfig gcsPathPrefix. */ + public gcsPathPrefix: string; + + /** + * Creates a new AudioRecordingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AudioRecordingConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IAudioRecordingConfig): google.cloud.ces.v1beta.AudioRecordingConfig; + + /** + * Encodes the specified AudioRecordingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.AudioRecordingConfig.verify|verify} messages. + * @param message AudioRecordingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IAudioRecordingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AudioRecordingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AudioRecordingConfig.verify|verify} messages. + * @param message AudioRecordingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IAudioRecordingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AudioRecordingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AudioRecordingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AudioRecordingConfig; + + /** + * Decodes an AudioRecordingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AudioRecordingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AudioRecordingConfig; + + /** + * Verifies an AudioRecordingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AudioRecordingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AudioRecordingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AudioRecordingConfig; + + /** + * Creates a plain object from an AudioRecordingConfig message. Also converts values to other types if specified. + * @param message AudioRecordingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AudioRecordingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AudioRecordingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AudioRecordingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RedactionConfig. */ + interface IRedactionConfig { + + /** RedactionConfig enableRedaction */ + enableRedaction?: (boolean|null); + + /** RedactionConfig inspectTemplate */ + inspectTemplate?: (string|null); + + /** RedactionConfig deidentifyTemplate */ + deidentifyTemplate?: (string|null); + } + + /** Represents a RedactionConfig. */ + class RedactionConfig implements IRedactionConfig { + + /** + * Constructs a new RedactionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRedactionConfig); + + /** RedactionConfig enableRedaction. */ + public enableRedaction: boolean; + + /** RedactionConfig inspectTemplate. */ + public inspectTemplate: string; + + /** RedactionConfig deidentifyTemplate. */ + public deidentifyTemplate: string; + + /** + * Creates a new RedactionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RedactionConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRedactionConfig): google.cloud.ces.v1beta.RedactionConfig; + + /** + * Encodes the specified RedactionConfig message. Does not implicitly {@link google.cloud.ces.v1beta.RedactionConfig.verify|verify} messages. + * @param message RedactionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRedactionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RedactionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RedactionConfig.verify|verify} messages. + * @param message RedactionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRedactionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RedactionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RedactionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RedactionConfig; + + /** + * Decodes a RedactionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RedactionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RedactionConfig; + + /** + * Verifies a RedactionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RedactionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RedactionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RedactionConfig; + + /** + * Creates a plain object from a RedactionConfig message. Also converts values to other types if specified. + * @param message RedactionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RedactionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RedactionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RedactionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataStoreSettings. */ + interface IDataStoreSettings { + + /** DataStoreSettings engines */ + engines?: (google.cloud.ces.v1beta.DataStoreSettings.IEngine[]|null); + } + + /** Represents a DataStoreSettings. */ + class DataStoreSettings implements IDataStoreSettings { + + /** + * Constructs a new DataStoreSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDataStoreSettings); + + /** DataStoreSettings engines. */ + public engines: google.cloud.ces.v1beta.DataStoreSettings.IEngine[]; + + /** + * Creates a new DataStoreSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStoreSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDataStoreSettings): google.cloud.ces.v1beta.DataStoreSettings; + + /** + * Encodes the specified DataStoreSettings message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.verify|verify} messages. + * @param message DataStoreSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDataStoreSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStoreSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.verify|verify} messages. + * @param message DataStoreSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDataStoreSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStoreSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStoreSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreSettings; + + /** + * Decodes a DataStoreSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStoreSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreSettings; + + /** + * Verifies a DataStoreSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataStoreSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStoreSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreSettings; + + /** + * Creates a plain object from a DataStoreSettings message. Also converts values to other types if specified. + * @param message DataStoreSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStoreSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStoreSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataStoreSettings { + + /** Properties of an Engine. */ + interface IEngine { + + /** Engine name */ + name?: (string|null); + + /** Engine type */ + type?: (google.cloud.ces.v1beta.DataStoreSettings.Engine.Type|keyof typeof google.cloud.ces.v1beta.DataStoreSettings.Engine.Type|null); + } + + /** Represents an Engine. */ + class Engine implements IEngine { + + /** + * Constructs a new Engine. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreSettings.IEngine); + + /** Engine name. */ + public name: string; + + /** Engine type. */ + public type: (google.cloud.ces.v1beta.DataStoreSettings.Engine.Type|keyof typeof google.cloud.ces.v1beta.DataStoreSettings.Engine.Type); + + /** + * Creates a new Engine instance using the specified properties. + * @param [properties] Properties to set + * @returns Engine instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreSettings.IEngine): google.cloud.ces.v1beta.DataStoreSettings.Engine; + + /** + * Encodes the specified Engine message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.Engine.verify|verify} messages. + * @param message Engine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreSettings.IEngine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Engine message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.Engine.verify|verify} messages. + * @param message Engine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreSettings.IEngine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Engine message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Engine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreSettings.Engine; + + /** + * Decodes an Engine message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Engine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreSettings.Engine; + + /** + * Verifies an Engine message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Engine message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Engine + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreSettings.Engine; + + /** + * Creates a plain object from an Engine message. Also converts values to other types if specified. + * @param message Engine + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreSettings.Engine, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Engine to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Engine + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Engine { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + ENGINE_TYPE_SEARCH = 1, + ENGINE_TYPE_CHAT = 2 + } + } + } + + /** Properties of an EvaluationPersona. */ + interface IEvaluationPersona { + + /** EvaluationPersona name */ + name?: (string|null); + + /** EvaluationPersona description */ + description?: (string|null); + + /** EvaluationPersona displayName */ + displayName?: (string|null); + + /** EvaluationPersona personality */ + personality?: (string|null); + + /** EvaluationPersona speechConfig */ + speechConfig?: (google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig|null); + } + + /** Represents an EvaluationPersona. */ + class EvaluationPersona implements IEvaluationPersona { + + /** + * Constructs a new EvaluationPersona. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluationPersona); + + /** EvaluationPersona name. */ + public name: string; + + /** EvaluationPersona description. */ + public description: string; + + /** EvaluationPersona displayName. */ + public displayName: string; + + /** EvaluationPersona personality. */ + public personality: string; + + /** EvaluationPersona speechConfig. */ + public speechConfig?: (google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig|null); + + /** + * Creates a new EvaluationPersona instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationPersona instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluationPersona): google.cloud.ces.v1beta.EvaluationPersona; + + /** + * Encodes the specified EvaluationPersona message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.verify|verify} messages. + * @param message EvaluationPersona message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluationPersona, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationPersona message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.verify|verify} messages. + * @param message EvaluationPersona message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationPersona, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationPersona message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationPersona + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationPersona; + + /** + * Decodes an EvaluationPersona message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationPersona + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationPersona; + + /** + * Verifies an EvaluationPersona message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationPersona message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationPersona + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationPersona; + + /** + * Creates a plain object from an EvaluationPersona message. Also converts values to other types if specified. + * @param message EvaluationPersona + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationPersona, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationPersona to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationPersona + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EvaluationPersona { + + /** Properties of a SpeechConfig. */ + interface ISpeechConfig { + + /** SpeechConfig speakingRate */ + speakingRate?: (number|null); + + /** SpeechConfig environment */ + environment?: (google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment|keyof typeof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment|null); + + /** SpeechConfig voiceId */ + voiceId?: (string|null); + } + + /** Represents a SpeechConfig. */ + class SpeechConfig implements ISpeechConfig { + + /** + * Constructs a new SpeechConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig); + + /** SpeechConfig speakingRate. */ + public speakingRate: number; + + /** SpeechConfig environment. */ + public environment: (google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment|keyof typeof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment); + + /** SpeechConfig voiceId. */ + public voiceId: string; + + /** + * Creates a new SpeechConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig): google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig; + + /** + * Encodes the specified SpeechConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.verify|verify} messages. + * @param message SpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.verify|verify} messages. + * @param message SpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig; + + /** + * Verifies a SpeechConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig; + + /** + * Creates a plain object from a SpeechConfig message. Also converts values to other types if specified. + * @param message SpeechConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SpeechConfig { + + /** BackgroundEnvironment enum. */ + enum BackgroundEnvironment { + BACKGROUND_ENVIRONMENT_UNSPECIFIED = 0, + CALL_CENTER = 3, + TRAFFIC = 4, + KIDS_NOISE = 5, + CAFE = 6 + } + } + } + + /** Properties of a BigQueryExportSettings. */ + interface IBigQueryExportSettings { + + /** BigQueryExportSettings enabled */ + enabled?: (boolean|null); + + /** BigQueryExportSettings project */ + project?: (string|null); + + /** BigQueryExportSettings dataset */ + dataset?: (string|null); + } + + /** Represents a BigQueryExportSettings. */ + class BigQueryExportSettings implements IBigQueryExportSettings { + + /** + * Constructs a new BigQueryExportSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IBigQueryExportSettings); + + /** BigQueryExportSettings enabled. */ + public enabled: boolean; + + /** BigQueryExportSettings project. */ + public project: string; + + /** BigQueryExportSettings dataset. */ + public dataset: string; + + /** + * Creates a new BigQueryExportSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryExportSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.IBigQueryExportSettings): google.cloud.ces.v1beta.BigQueryExportSettings; + + /** + * Encodes the specified BigQueryExportSettings message. Does not implicitly {@link google.cloud.ces.v1beta.BigQueryExportSettings.verify|verify} messages. + * @param message BigQueryExportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IBigQueryExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryExportSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BigQueryExportSettings.verify|verify} messages. + * @param message BigQueryExportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IBigQueryExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryExportSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BigQueryExportSettings; + + /** + * Decodes a BigQueryExportSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BigQueryExportSettings; + + /** + * Verifies a BigQueryExportSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQueryExportSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryExportSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BigQueryExportSettings; + + /** + * Creates a plain object from a BigQueryExportSettings message. Also converts values to other types if specified. + * @param message BigQueryExportSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.BigQueryExportSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryExportSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryExportSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** EvaluationToolCallBehaviour enum. */ + enum EvaluationToolCallBehaviour { + EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED = 0, + REAL = 1, + FAKE = 2 + } + + /** Properties of a CodeBlock. */ + interface ICodeBlock { + + /** CodeBlock pythonCode */ + pythonCode?: (string|null); + } + + /** Represents a CodeBlock. */ + class CodeBlock implements ICodeBlock { + + /** + * Constructs a new CodeBlock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICodeBlock); + + /** CodeBlock pythonCode. */ + public pythonCode: string; + + /** + * Creates a new CodeBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns CodeBlock instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICodeBlock): google.cloud.ces.v1beta.CodeBlock; + + /** + * Encodes the specified CodeBlock message. Does not implicitly {@link google.cloud.ces.v1beta.CodeBlock.verify|verify} messages. + * @param message CodeBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICodeBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CodeBlock message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CodeBlock.verify|verify} messages. + * @param message CodeBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICodeBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CodeBlock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CodeBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CodeBlock; + + /** + * Decodes a CodeBlock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CodeBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CodeBlock; + + /** + * Verifies a CodeBlock message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CodeBlock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CodeBlock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CodeBlock; + + /** + * Creates a plain object from a CodeBlock message. Also converts values to other types if specified. + * @param message CodeBlock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CodeBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CodeBlock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CodeBlock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolFakeConfig. */ + interface IToolFakeConfig { + + /** ToolFakeConfig codeBlock */ + codeBlock?: (google.cloud.ces.v1beta.ICodeBlock|null); + + /** ToolFakeConfig enableFakeMode */ + enableFakeMode?: (boolean|null); + } + + /** Represents a ToolFakeConfig. */ + class ToolFakeConfig implements IToolFakeConfig { + + /** + * Constructs a new ToolFakeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IToolFakeConfig); + + /** ToolFakeConfig codeBlock. */ + public codeBlock?: (google.cloud.ces.v1beta.ICodeBlock|null); + + /** ToolFakeConfig enableFakeMode. */ + public enableFakeMode: boolean; + + /** ToolFakeConfig toolResponse. */ + public toolResponse?: "codeBlock"; + + /** + * Creates a new ToolFakeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolFakeConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IToolFakeConfig): google.cloud.ces.v1beta.ToolFakeConfig; + + /** + * Encodes the specified ToolFakeConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ToolFakeConfig.verify|verify} messages. + * @param message ToolFakeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IToolFakeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolFakeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolFakeConfig.verify|verify} messages. + * @param message ToolFakeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IToolFakeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolFakeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolFakeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ToolFakeConfig; + + /** + * Decodes a ToolFakeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolFakeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ToolFakeConfig; + + /** + * Verifies a ToolFakeConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolFakeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolFakeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ToolFakeConfig; + + /** + * Creates a plain object from a ToolFakeConfig message. Also converts values to other types if specified. + * @param message ToolFakeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ToolFakeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolFakeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolFakeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** GoldenRunMethod enum. */ + enum GoldenRunMethod { + GOLDEN_RUN_METHOD_UNSPECIFIED = 0, + STABLE = 1, + NAIVE = 2 + } + + /** Properties of a Schema. */ + interface ISchema { + + /** Schema type */ + type?: (google.cloud.ces.v1beta.Schema.Type|keyof typeof google.cloud.ces.v1beta.Schema.Type|null); + + /** Schema properties */ + properties?: ({ [k: string]: google.cloud.ces.v1beta.ISchema }|null); + + /** Schema required */ + required?: (string[]|null); + + /** Schema description */ + description?: (string|null); + + /** Schema items */ + items?: (google.cloud.ces.v1beta.ISchema|null); + + /** Schema nullable */ + nullable?: (boolean|null); + + /** Schema uniqueItems */ + uniqueItems?: (boolean|null); + + /** Schema prefixItems */ + prefixItems?: (google.cloud.ces.v1beta.ISchema[]|null); + + /** Schema additionalProperties */ + additionalProperties?: (google.cloud.ces.v1beta.ISchema|null); + + /** Schema anyOf */ + anyOf?: (google.cloud.ces.v1beta.ISchema[]|null); + + /** Schema enum */ + "enum"?: (string[]|null); + + /** Schema default */ + "default"?: (google.protobuf.IValue|null); + + /** Schema ref */ + ref?: (string|null); + + /** Schema defs */ + defs?: ({ [k: string]: google.cloud.ces.v1beta.ISchema }|null); + + /** Schema title */ + title?: (string|null); + + /** Schema minItems */ + minItems?: (number|Long|string|null); + + /** Schema maxItems */ + maxItems?: (number|Long|string|null); + + /** Schema minimum */ + minimum?: (number|null); + + /** Schema maximum */ + maximum?: (number|null); + } + + /** Represents a Schema. */ + class Schema implements ISchema { + + /** + * Constructs a new Schema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ISchema); + + /** Schema type. */ + public type: (google.cloud.ces.v1beta.Schema.Type|keyof typeof google.cloud.ces.v1beta.Schema.Type); + + /** Schema properties. */ + public properties: { [k: string]: google.cloud.ces.v1beta.ISchema }; + + /** Schema required. */ + public required: string[]; + + /** Schema description. */ + public description: string; + + /** Schema items. */ + public items?: (google.cloud.ces.v1beta.ISchema|null); + + /** Schema nullable. */ + public nullable: boolean; + + /** Schema uniqueItems. */ + public uniqueItems: boolean; + + /** Schema prefixItems. */ + public prefixItems: google.cloud.ces.v1beta.ISchema[]; + + /** Schema additionalProperties. */ + public additionalProperties?: (google.cloud.ces.v1beta.ISchema|null); + + /** Schema anyOf. */ + public anyOf: google.cloud.ces.v1beta.ISchema[]; + + /** Schema enum. */ + public enum: string[]; + + /** Schema default. */ + public default?: (google.protobuf.IValue|null); + + /** Schema ref. */ + public ref: string; + + /** Schema defs. */ + public defs: { [k: string]: google.cloud.ces.v1beta.ISchema }; + + /** Schema title. */ + public title: string; + + /** Schema minItems. */ + public minItems: (number|Long|string); + + /** Schema maxItems. */ + public maxItems: (number|Long|string); + + /** Schema minimum. */ + public minimum?: (number|null); + + /** Schema maximum. */ + public maximum?: (number|null); + + /** + * Creates a new Schema instance using the specified properties. + * @param [properties] Properties to set + * @returns Schema instance + */ + public static create(properties?: google.cloud.ces.v1beta.ISchema): google.cloud.ces.v1beta.Schema; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.cloud.ces.v1beta.Schema.verify|verify} messages. + * @param message Schema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Schema.verify|verify} messages. + * @param message Schema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Schema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Schema; + + /** + * Decodes a Schema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Schema; + + /** + * Verifies a Schema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Schema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Schema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Schema; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @param message Schema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Schema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Schema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Schema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Schema { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + STRING = 1, + INTEGER = 2, + NUMBER = 3, + BOOLEAN = 4, + OBJECT = 5, + ARRAY = 6 + } + } + + /** Properties of an AppSnapshot. */ + interface IAppSnapshot { + + /** AppSnapshot app */ + app?: (google.cloud.ces.v1beta.IApp|null); + + /** AppSnapshot agents */ + agents?: (google.cloud.ces.v1beta.IAgent[]|null); + + /** AppSnapshot tools */ + tools?: (google.cloud.ces.v1beta.ITool[]|null); + + /** AppSnapshot examples */ + examples?: (google.cloud.ces.v1beta.IExample[]|null); + + /** AppSnapshot guardrails */ + guardrails?: (google.cloud.ces.v1beta.IGuardrail[]|null); + + /** AppSnapshot toolsets */ + toolsets?: (google.cloud.ces.v1beta.IToolset[]|null); + } + + /** Represents an AppSnapshot. */ + class AppSnapshot implements IAppSnapshot { + + /** + * Constructs a new AppSnapshot. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IAppSnapshot); + + /** AppSnapshot app. */ + public app?: (google.cloud.ces.v1beta.IApp|null); + + /** AppSnapshot agents. */ + public agents: google.cloud.ces.v1beta.IAgent[]; + + /** AppSnapshot tools. */ + public tools: google.cloud.ces.v1beta.ITool[]; + + /** AppSnapshot examples. */ + public examples: google.cloud.ces.v1beta.IExample[]; + + /** AppSnapshot guardrails. */ + public guardrails: google.cloud.ces.v1beta.IGuardrail[]; + + /** AppSnapshot toolsets. */ + public toolsets: google.cloud.ces.v1beta.IToolset[]; + + /** + * Creates a new AppSnapshot instance using the specified properties. + * @param [properties] Properties to set + * @returns AppSnapshot instance + */ + public static create(properties?: google.cloud.ces.v1beta.IAppSnapshot): google.cloud.ces.v1beta.AppSnapshot; + + /** + * Encodes the specified AppSnapshot message. Does not implicitly {@link google.cloud.ces.v1beta.AppSnapshot.verify|verify} messages. + * @param message AppSnapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IAppSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppSnapshot message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AppSnapshot.verify|verify} messages. + * @param message AppSnapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IAppSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppSnapshot message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AppSnapshot; + + /** + * Decodes an AppSnapshot message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AppSnapshot; + + /** + * Verifies an AppSnapshot message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AppSnapshot message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppSnapshot + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AppSnapshot; + + /** + * Creates a plain object from an AppSnapshot message. Also converts values to other types if specified. + * @param message AppSnapshot + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AppSnapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppSnapshot to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppSnapshot + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AppVersion. */ + interface IAppVersion { + + /** AppVersion name */ + name?: (string|null); + + /** AppVersion displayName */ + displayName?: (string|null); + + /** AppVersion description */ + description?: (string|null); + + /** AppVersion creator */ + creator?: (string|null); + + /** AppVersion createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** AppVersion snapshot */ + snapshot?: (google.cloud.ces.v1beta.IAppSnapshot|null); + + /** AppVersion etag */ + etag?: (string|null); + } + + /** Represents an AppVersion. */ + class AppVersion implements IAppVersion { + + /** + * Constructs a new AppVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IAppVersion); + + /** AppVersion name. */ + public name: string; + + /** AppVersion displayName. */ + public displayName: string; + + /** AppVersion description. */ + public description: string; + + /** AppVersion creator. */ + public creator: string; + + /** AppVersion createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** AppVersion snapshot. */ + public snapshot?: (google.cloud.ces.v1beta.IAppSnapshot|null); + + /** AppVersion etag. */ + public etag: string; + + /** + * Creates a new AppVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns AppVersion instance + */ + public static create(properties?: google.cloud.ces.v1beta.IAppVersion): google.cloud.ces.v1beta.AppVersion; + + /** + * Encodes the specified AppVersion message. Does not implicitly {@link google.cloud.ces.v1beta.AppVersion.verify|verify} messages. + * @param message AppVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppVersion message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AppVersion.verify|verify} messages. + * @param message AppVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AppVersion; + + /** + * Decodes an AppVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AppVersion; + + /** + * Verifies an AppVersion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AppVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AppVersion; + + /** + * Creates a plain object from an AppVersion message. Also converts values to other types if specified. + * @param message AppVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AppVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Example. */ + interface IExample { + + /** Example name */ + name?: (string|null); + + /** Example displayName */ + displayName?: (string|null); + + /** Example description */ + description?: (string|null); + + /** Example entryAgent */ + entryAgent?: (string|null); + + /** Example messages */ + messages?: (google.cloud.ces.v1beta.IMessage[]|null); + + /** Example createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Example updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Example invalid */ + invalid?: (boolean|null); + + /** Example etag */ + etag?: (string|null); + } + + /** Represents an Example. */ + class Example implements IExample { + + /** + * Constructs a new Example. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IExample); + + /** Example name. */ + public name: string; + + /** Example displayName. */ + public displayName: string; + + /** Example description. */ + public description: string; + + /** Example entryAgent. */ + public entryAgent: string; + + /** Example messages. */ + public messages: google.cloud.ces.v1beta.IMessage[]; + + /** Example createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Example updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Example invalid. */ + public invalid: boolean; + + /** Example etag. */ + public etag: string; + + /** + * Creates a new Example instance using the specified properties. + * @param [properties] Properties to set + * @returns Example instance + */ + public static create(properties?: google.cloud.ces.v1beta.IExample): google.cloud.ces.v1beta.Example; + + /** + * Encodes the specified Example message. Does not implicitly {@link google.cloud.ces.v1beta.Example.verify|verify} messages. + * @param message Example message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Example message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Example.verify|verify} messages. + * @param message Example message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Example message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Example; + + /** + * Decodes an Example message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Example; + + /** + * Verifies an Example message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Example message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Example + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Example; + + /** + * Creates a plain object from an Example message. Also converts values to other types if specified. + * @param message Example + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Example, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Example to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Example + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Message. */ + interface IMessage { + + /** Message role */ + role?: (string|null); + + /** Message chunks */ + chunks?: (google.cloud.ces.v1beta.IChunk[]|null); + + /** Message eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Message. */ + class Message implements IMessage { + + /** + * Constructs a new Message. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IMessage); + + /** Message role. */ + public role: string; + + /** Message chunks. */ + public chunks: google.cloud.ces.v1beta.IChunk[]; + + /** Message eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Message instance using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public static create(properties?: google.cloud.ces.v1beta.IMessage): google.cloud.ces.v1beta.Message; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.ces.v1beta.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Message message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Message; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Message; + + /** + * Verifies a Message message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Message + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Message; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @param message Message + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Message to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Message + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Chunk. */ + interface IChunk { + + /** Chunk text */ + text?: (string|null); + + /** Chunk transcript */ + transcript?: (string|null); + + /** Chunk blob */ + blob?: (google.cloud.ces.v1beta.IBlob|null); + + /** Chunk payload */ + payload?: (google.protobuf.IStruct|null); + + /** Chunk image */ + image?: (google.cloud.ces.v1beta.IImage|null); + + /** Chunk toolCall */ + toolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** Chunk toolResponse */ + toolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** Chunk agentTransfer */ + agentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); + + /** Chunk updatedVariables */ + updatedVariables?: (google.protobuf.IStruct|null); + + /** Chunk defaultVariables */ + defaultVariables?: (google.protobuf.IStruct|null); + } + + /** Represents a Chunk. */ + class Chunk implements IChunk { + + /** + * Constructs a new Chunk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IChunk); + + /** Chunk text. */ + public text?: (string|null); + + /** Chunk transcript. */ + public transcript?: (string|null); + + /** Chunk blob. */ + public blob?: (google.cloud.ces.v1beta.IBlob|null); + + /** Chunk payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** Chunk image. */ + public image?: (google.cloud.ces.v1beta.IImage|null); + + /** Chunk toolCall. */ + public toolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** Chunk toolResponse. */ + public toolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** Chunk agentTransfer. */ + public agentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); + + /** Chunk updatedVariables. */ + public updatedVariables?: (google.protobuf.IStruct|null); + + /** Chunk defaultVariables. */ + public defaultVariables?: (google.protobuf.IStruct|null); + + /** Chunk data. */ + public data?: ("text"|"transcript"|"blob"|"payload"|"image"|"toolCall"|"toolResponse"|"agentTransfer"|"updatedVariables"|"defaultVariables"); + + /** + * Creates a new Chunk instance using the specified properties. + * @param [properties] Properties to set + * @returns Chunk instance + */ + public static create(properties?: google.cloud.ces.v1beta.IChunk): google.cloud.ces.v1beta.Chunk; + + /** + * Encodes the specified Chunk message. Does not implicitly {@link google.cloud.ces.v1beta.Chunk.verify|verify} messages. + * @param message Chunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Chunk.verify|verify} messages. + * @param message Chunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Chunk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Chunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Chunk; + + /** + * Decodes a Chunk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Chunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Chunk; + + /** + * Verifies a Chunk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Chunk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Chunk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Chunk; + + /** + * Creates a plain object from a Chunk message. Also converts values to other types if specified. + * @param message Chunk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Chunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Chunk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Chunk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Blob. */ + interface IBlob { + + /** Blob mimeType */ + mimeType?: (string|null); + + /** Blob data */ + data?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Blob. */ + class Blob implements IBlob { + + /** + * Constructs a new Blob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IBlob); + + /** Blob mimeType. */ + public mimeType: string; + + /** Blob data. */ + public data: (Uint8Array|Buffer|string); + + /** + * Creates a new Blob instance using the specified properties. + * @param [properties] Properties to set + * @returns Blob instance + */ + public static create(properties?: google.cloud.ces.v1beta.IBlob): google.cloud.ces.v1beta.Blob; + + /** + * Encodes the specified Blob message. Does not implicitly {@link google.cloud.ces.v1beta.Blob.verify|verify} messages. + * @param message Blob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IBlob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Blob.verify|verify} messages. + * @param message Blob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IBlob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Blob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Blob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Blob; + + /** + * Decodes a Blob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Blob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Blob; + + /** + * Verifies a Blob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Blob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Blob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Blob; + + /** + * Creates a plain object from a Blob message. Also converts values to other types if specified. + * @param message Blob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Blob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Blob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Blob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image mimeType */ + mimeType?: (string|null); + + /** Image data */ + data?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IImage); + + /** Image mimeType. */ + public mimeType: string; + + /** Image data. */ + public data: (Uint8Array|Buffer|string); + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.ces.v1beta.IImage): google.cloud.ces.v1beta.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.ces.v1beta.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Image message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Image; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Image; + + /** + * Verifies an Image message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Image + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Image; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @param message Image + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Image + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolCall. */ + interface IToolCall { + + /** ToolCall tool */ + tool?: (string|null); + + /** ToolCall toolsetTool */ + toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ToolCall id */ + id?: (string|null); + + /** ToolCall displayName */ + displayName?: (string|null); + + /** ToolCall args */ + args?: (google.protobuf.IStruct|null); + } + + /** Represents a ToolCall. */ + class ToolCall implements IToolCall { + + /** + * Constructs a new ToolCall. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IToolCall); + + /** ToolCall tool. */ + public tool?: (string|null); + + /** ToolCall toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ToolCall id. */ + public id: string; + + /** ToolCall displayName. */ + public displayName: string; + + /** ToolCall args. */ + public args?: (google.protobuf.IStruct|null); + + /** ToolCall toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new ToolCall instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolCall instance + */ + public static create(properties?: google.cloud.ces.v1beta.IToolCall): google.cloud.ces.v1beta.ToolCall; + + /** + * Encodes the specified ToolCall message. Does not implicitly {@link google.cloud.ces.v1beta.ToolCall.verify|verify} messages. + * @param message ToolCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IToolCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolCall message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolCall.verify|verify} messages. + * @param message ToolCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IToolCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolCall message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ToolCall; + + /** + * Decodes a ToolCall message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ToolCall; + + /** + * Verifies a ToolCall message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolCall message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolCall + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ToolCall; + + /** + * Creates a plain object from a ToolCall message. Also converts values to other types if specified. + * @param message ToolCall + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ToolCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolCall to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolCall + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolResponse. */ + interface IToolResponse { + + /** ToolResponse tool */ + tool?: (string|null); + + /** ToolResponse toolsetTool */ + toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ToolResponse id */ + id?: (string|null); + + /** ToolResponse displayName */ + displayName?: (string|null); + + /** ToolResponse response */ + response?: (google.protobuf.IStruct|null); + } + + /** Represents a ToolResponse. */ + class ToolResponse implements IToolResponse { + + /** + * Constructs a new ToolResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IToolResponse); + + /** ToolResponse tool. */ + public tool?: (string|null); + + /** ToolResponse toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ToolResponse id. */ + public id: string; + + /** ToolResponse displayName. */ + public displayName: string; + + /** ToolResponse response. */ + public response?: (google.protobuf.IStruct|null); + + /** ToolResponse toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new ToolResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IToolResponse): google.cloud.ces.v1beta.ToolResponse; + + /** + * Encodes the specified ToolResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponse.verify|verify} messages. + * @param message ToolResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponse.verify|verify} messages. + * @param message ToolResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ToolResponse; + + /** + * Decodes a ToolResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ToolResponse; + + /** + * Verifies a ToolResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ToolResponse; + + /** + * Creates a plain object from a ToolResponse message. Also converts values to other types if specified. + * @param message ToolResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ToolResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AgentTransfer. */ + interface IAgentTransfer { + + /** AgentTransfer targetAgent */ + targetAgent?: (string|null); + + /** AgentTransfer displayName */ + displayName?: (string|null); + } + + /** Represents an AgentTransfer. */ + class AgentTransfer implements IAgentTransfer { + + /** + * Constructs a new AgentTransfer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IAgentTransfer); + + /** AgentTransfer targetAgent. */ + public targetAgent: string; + + /** AgentTransfer displayName. */ + public displayName: string; + + /** + * Creates a new AgentTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns AgentTransfer instance + */ + public static create(properties?: google.cloud.ces.v1beta.IAgentTransfer): google.cloud.ces.v1beta.AgentTransfer; + + /** + * Encodes the specified AgentTransfer message. Does not implicitly {@link google.cloud.ces.v1beta.AgentTransfer.verify|verify} messages. + * @param message AgentTransfer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IAgentTransfer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AgentTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AgentTransfer.verify|verify} messages. + * @param message AgentTransfer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IAgentTransfer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AgentTransfer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AgentTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AgentTransfer; + + /** + * Decodes an AgentTransfer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AgentTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AgentTransfer; + + /** + * Verifies an AgentTransfer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AgentTransfer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AgentTransfer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AgentTransfer; + + /** + * Creates a plain object from an AgentTransfer message. Also converts values to other types if specified. + * @param message AgentTransfer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AgentTransfer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AgentTransfer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AgentTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolsetTool. */ + interface IToolsetTool { + + /** ToolsetTool toolset */ + toolset?: (string|null); + + /** ToolsetTool toolId */ + toolId?: (string|null); + } + + /** Represents a ToolsetTool. */ + class ToolsetTool implements IToolsetTool { + + /** + * Constructs a new ToolsetTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IToolsetTool); + + /** ToolsetTool toolset. */ + public toolset: string; + + /** ToolsetTool toolId. */ + public toolId: string; + + /** + * Creates a new ToolsetTool instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolsetTool instance + */ + public static create(properties?: google.cloud.ces.v1beta.IToolsetTool): google.cloud.ces.v1beta.ToolsetTool; + + /** + * Encodes the specified ToolsetTool message. Does not implicitly {@link google.cloud.ces.v1beta.ToolsetTool.verify|verify} messages. + * @param message ToolsetTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IToolsetTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolsetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolsetTool.verify|verify} messages. + * @param message ToolsetTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IToolsetTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolsetTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolsetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ToolsetTool; + + /** + * Decodes a ToolsetTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolsetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ToolsetTool; + + /** + * Verifies a ToolsetTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolsetTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolsetTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ToolsetTool; + + /** + * Creates a plain object from a ToolsetTool message. Also converts values to other types if specified. + * @param message ToolsetTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ToolsetTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolsetTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolsetTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Guardrail. */ + interface IGuardrail { + + /** Guardrail contentFilter */ + contentFilter?: (google.cloud.ces.v1beta.Guardrail.IContentFilter|null); + + /** Guardrail llmPromptSecurity */ + llmPromptSecurity?: (google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity|null); + + /** Guardrail llmPolicy */ + llmPolicy?: (google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null); + + /** Guardrail modelSafety */ + modelSafety?: (google.cloud.ces.v1beta.Guardrail.IModelSafety|null); + + /** Guardrail codeCallback */ + codeCallback?: (google.cloud.ces.v1beta.Guardrail.ICodeCallback|null); + + /** Guardrail name */ + name?: (string|null); + + /** Guardrail displayName */ + displayName?: (string|null); + + /** Guardrail description */ + description?: (string|null); + + /** Guardrail enabled */ + enabled?: (boolean|null); + + /** Guardrail action */ + action?: (google.cloud.ces.v1beta.ITriggerAction|null); + + /** Guardrail createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Guardrail updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Guardrail etag */ + etag?: (string|null); + } + + /** Represents a Guardrail. */ + class Guardrail implements IGuardrail { + + /** + * Constructs a new Guardrail. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGuardrail); + + /** Guardrail contentFilter. */ + public contentFilter?: (google.cloud.ces.v1beta.Guardrail.IContentFilter|null); + + /** Guardrail llmPromptSecurity. */ + public llmPromptSecurity?: (google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity|null); + + /** Guardrail llmPolicy. */ + public llmPolicy?: (google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null); + + /** Guardrail modelSafety. */ + public modelSafety?: (google.cloud.ces.v1beta.Guardrail.IModelSafety|null); + + /** Guardrail codeCallback. */ + public codeCallback?: (google.cloud.ces.v1beta.Guardrail.ICodeCallback|null); + + /** Guardrail name. */ + public name: string; + + /** Guardrail displayName. */ + public displayName: string; + + /** Guardrail description. */ + public description: string; + + /** Guardrail enabled. */ + public enabled: boolean; + + /** Guardrail action. */ + public action?: (google.cloud.ces.v1beta.ITriggerAction|null); + + /** Guardrail createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Guardrail updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Guardrail etag. */ + public etag: string; + + /** Guardrail guardrailType. */ + public guardrailType?: ("contentFilter"|"llmPromptSecurity"|"llmPolicy"|"modelSafety"|"codeCallback"); + + /** + * Creates a new Guardrail instance using the specified properties. + * @param [properties] Properties to set + * @returns Guardrail instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGuardrail): google.cloud.ces.v1beta.Guardrail; + + /** + * Encodes the specified Guardrail message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.verify|verify} messages. + * @param message Guardrail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGuardrail, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Guardrail message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.verify|verify} messages. + * @param message Guardrail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGuardrail, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Guardrail message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Guardrail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail; + + /** + * Decodes a Guardrail message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Guardrail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail; + + /** + * Verifies a Guardrail message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Guardrail message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Guardrail + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail; + + /** + * Creates a plain object from a Guardrail message. Also converts values to other types if specified. + * @param message Guardrail + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Guardrail, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Guardrail to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Guardrail + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Guardrail { + + /** Properties of a ContentFilter. */ + interface IContentFilter { + + /** ContentFilter bannedContents */ + bannedContents?: (string[]|null); + + /** ContentFilter bannedContentsInUserInput */ + bannedContentsInUserInput?: (string[]|null); + + /** ContentFilter bannedContentsInAgentResponse */ + bannedContentsInAgentResponse?: (string[]|null); + + /** ContentFilter matchType */ + matchType?: (google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType|keyof typeof google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType|null); + + /** ContentFilter disregardDiacritics */ + disregardDiacritics?: (boolean|null); + } + + /** Represents a ContentFilter. */ + class ContentFilter implements IContentFilter { + + /** + * Constructs a new ContentFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Guardrail.IContentFilter); + + /** ContentFilter bannedContents. */ + public bannedContents: string[]; + + /** ContentFilter bannedContentsInUserInput. */ + public bannedContentsInUserInput: string[]; + + /** ContentFilter bannedContentsInAgentResponse. */ + public bannedContentsInAgentResponse: string[]; + + /** ContentFilter matchType. */ + public matchType: (google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType|keyof typeof google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType); + + /** ContentFilter disregardDiacritics. */ + public disregardDiacritics: boolean; + + /** + * Creates a new ContentFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns ContentFilter instance + */ + public static create(properties?: google.cloud.ces.v1beta.Guardrail.IContentFilter): google.cloud.ces.v1beta.Guardrail.ContentFilter; + + /** + * Encodes the specified ContentFilter message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ContentFilter.verify|verify} messages. + * @param message ContentFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Guardrail.IContentFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ContentFilter.verify|verify} messages. + * @param message ContentFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.IContentFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContentFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.ContentFilter; + + /** + * Decodes a ContentFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.ContentFilter; + + /** + * Verifies a ContentFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContentFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.ContentFilter; + + /** + * Creates a plain object from a ContentFilter message. Also converts values to other types if specified. + * @param message ContentFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Guardrail.ContentFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContentFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContentFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ContentFilter { + + /** MatchType enum. */ + enum MatchType { + MATCH_TYPE_UNSPECIFIED = 0, + SIMPLE_STRING_MATCH = 1, + WORD_BOUNDARY_STRING_MATCH = 2, + REGEXP_MATCH = 3 + } + } + + /** Properties of a LlmPromptSecurity. */ + interface ILlmPromptSecurity { + + /** LlmPromptSecurity defaultSettings */ + defaultSettings?: (google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null); + + /** LlmPromptSecurity customPolicy */ + customPolicy?: (google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null); + + /** LlmPromptSecurity failOpen */ + failOpen?: (boolean|null); + } + + /** Represents a LlmPromptSecurity. */ + class LlmPromptSecurity implements ILlmPromptSecurity { + + /** + * Constructs a new LlmPromptSecurity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity); + + /** LlmPromptSecurity defaultSettings. */ + public defaultSettings?: (google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null); + + /** LlmPromptSecurity customPolicy. */ + public customPolicy?: (google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null); + + /** LlmPromptSecurity failOpen. */ + public failOpen: boolean; + + /** LlmPromptSecurity securityConfig. */ + public securityConfig?: ("defaultSettings"|"customPolicy"); + + /** + * Creates a new LlmPromptSecurity instance using the specified properties. + * @param [properties] Properties to set + * @returns LlmPromptSecurity instance + */ + public static create(properties?: google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity; + + /** + * Encodes the specified LlmPromptSecurity message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.verify|verify} messages. + * @param message LlmPromptSecurity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LlmPromptSecurity message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.verify|verify} messages. + * @param message LlmPromptSecurity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LlmPromptSecurity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LlmPromptSecurity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity; + + /** + * Decodes a LlmPromptSecurity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LlmPromptSecurity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity; + + /** + * Verifies a LlmPromptSecurity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LlmPromptSecurity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LlmPromptSecurity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity; + + /** + * Creates a plain object from a LlmPromptSecurity message. Also converts values to other types if specified. + * @param message LlmPromptSecurity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LlmPromptSecurity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LlmPromptSecurity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LlmPromptSecurity { + + /** Properties of a DefaultSecuritySettings. */ + interface IDefaultSecuritySettings { + + /** DefaultSecuritySettings defaultPromptTemplate */ + defaultPromptTemplate?: (string|null); + } + + /** Represents a DefaultSecuritySettings. */ + class DefaultSecuritySettings implements IDefaultSecuritySettings { + + /** + * Constructs a new DefaultSecuritySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings); + + /** DefaultSecuritySettings defaultPromptTemplate. */ + public defaultPromptTemplate: string; + + /** + * Creates a new DefaultSecuritySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DefaultSecuritySettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; + + /** + * Encodes the specified DefaultSecuritySettings message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. + * @param message DefaultSecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DefaultSecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. + * @param message DefaultSecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DefaultSecuritySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DefaultSecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; + + /** + * Decodes a DefaultSecuritySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DefaultSecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; + + /** + * Verifies a DefaultSecuritySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DefaultSecuritySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DefaultSecuritySettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; + + /** + * Creates a plain object from a DefaultSecuritySettings message. Also converts values to other types if specified. + * @param message DefaultSecuritySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DefaultSecuritySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DefaultSecuritySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a LlmPolicy. */ + interface ILlmPolicy { + + /** LlmPolicy maxConversationMessages */ + maxConversationMessages?: (number|null); + + /** LlmPolicy modelSettings */ + modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** LlmPolicy prompt */ + prompt?: (string|null); + + /** LlmPolicy policyScope */ + policyScope?: (google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope|keyof typeof google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope|null); + + /** LlmPolicy failOpen */ + failOpen?: (boolean|null); + + /** LlmPolicy allowShortUtterance */ + allowShortUtterance?: (boolean|null); + } + + /** Represents a LlmPolicy. */ + class LlmPolicy implements ILlmPolicy { + + /** + * Constructs a new LlmPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Guardrail.ILlmPolicy); + + /** LlmPolicy maxConversationMessages. */ + public maxConversationMessages: number; + + /** LlmPolicy modelSettings. */ + public modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** LlmPolicy prompt. */ + public prompt: string; + + /** LlmPolicy policyScope. */ + public policyScope: (google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope|keyof typeof google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope); + + /** LlmPolicy failOpen. */ + public failOpen: boolean; + + /** LlmPolicy allowShortUtterance. */ + public allowShortUtterance: boolean; + + /** + * Creates a new LlmPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns LlmPolicy instance + */ + public static create(properties?: google.cloud.ces.v1beta.Guardrail.ILlmPolicy): google.cloud.ces.v1beta.Guardrail.LlmPolicy; + + /** + * Encodes the specified LlmPolicy message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPolicy.verify|verify} messages. + * @param message LlmPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Guardrail.ILlmPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LlmPolicy message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPolicy.verify|verify} messages. + * @param message LlmPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.ILlmPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LlmPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LlmPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.LlmPolicy; + + /** + * Decodes a LlmPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LlmPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.LlmPolicy; + + /** + * Verifies a LlmPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LlmPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LlmPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.LlmPolicy; + + /** + * Creates a plain object from a LlmPolicy message. Also converts values to other types if specified. + * @param message LlmPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Guardrail.LlmPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LlmPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LlmPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LlmPolicy { + + /** PolicyScope enum. */ + enum PolicyScope { + POLICY_SCOPE_UNSPECIFIED = 0, + USER_QUERY = 1, + AGENT_RESPONSE = 2, + USER_QUERY_AND_AGENT_RESPONSE = 3 + } + } + + /** Properties of a ModelSafety. */ + interface IModelSafety { + + /** ModelSafety safetySettings */ + safetySettings?: (google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting[]|null); + } + + /** Represents a ModelSafety. */ + class ModelSafety implements IModelSafety { + + /** + * Constructs a new ModelSafety. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Guardrail.IModelSafety); + + /** ModelSafety safetySettings. */ + public safetySettings: google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting[]; + + /** + * Creates a new ModelSafety instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelSafety instance + */ + public static create(properties?: google.cloud.ces.v1beta.Guardrail.IModelSafety): google.cloud.ces.v1beta.Guardrail.ModelSafety; + + /** + * Encodes the specified ModelSafety message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.verify|verify} messages. + * @param message ModelSafety message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Guardrail.IModelSafety, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelSafety message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.verify|verify} messages. + * @param message ModelSafety message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.IModelSafety, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelSafety message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelSafety + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.ModelSafety; + + /** + * Decodes a ModelSafety message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelSafety + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.ModelSafety; + + /** + * Verifies a ModelSafety message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelSafety message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelSafety + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.ModelSafety; + + /** + * Creates a plain object from a ModelSafety message. Also converts values to other types if specified. + * @param message ModelSafety + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Guardrail.ModelSafety, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelSafety to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelSafety + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ModelSafety { + + /** Properties of a SafetySetting. */ + interface ISafetySetting { + + /** SafetySetting category */ + category?: (google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory|keyof typeof google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory|null); + + /** SafetySetting threshold */ + threshold?: (google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold|keyof typeof google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold|null); + } + + /** Represents a SafetySetting. */ + class SafetySetting implements ISafetySetting { + + /** + * Constructs a new SafetySetting. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting); + + /** SafetySetting category. */ + public category: (google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory|keyof typeof google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory); + + /** SafetySetting threshold. */ + public threshold: (google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold|keyof typeof google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold); + + /** + * Creates a new SafetySetting instance using the specified properties. + * @param [properties] Properties to set + * @returns SafetySetting instance + */ + public static create(properties?: google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting): google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting; + + /** + * Encodes the specified SafetySetting message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. + * @param message SafetySetting message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. + * @param message SafetySetting message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SafetySetting message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SafetySetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting; + + /** + * Decodes a SafetySetting message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SafetySetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting; + + /** + * Verifies a SafetySetting message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SafetySetting + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting; + + /** + * Creates a plain object from a SafetySetting message. Also converts values to other types if specified. + * @param message SafetySetting + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SafetySetting to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SafetySetting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** HarmCategory enum. */ + enum HarmCategory { + HARM_CATEGORY_UNSPECIFIED = 0, + HARM_CATEGORY_HATE_SPEECH = 1, + HARM_CATEGORY_DANGEROUS_CONTENT = 2, + HARM_CATEGORY_HARASSMENT = 3, + HARM_CATEGORY_SEXUALLY_EXPLICIT = 4 + } + + /** HarmBlockThreshold enum. */ + enum HarmBlockThreshold { + HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0, + BLOCK_LOW_AND_ABOVE = 1, + BLOCK_MEDIUM_AND_ABOVE = 2, + BLOCK_ONLY_HIGH = 3, + BLOCK_NONE = 4, + OFF = 5 + } + } + + /** Properties of a CodeCallback. */ + interface ICodeCallback { + + /** CodeCallback beforeAgentCallback */ + beforeAgentCallback?: (google.cloud.ces.v1beta.ICallback|null); + + /** CodeCallback afterAgentCallback */ + afterAgentCallback?: (google.cloud.ces.v1beta.ICallback|null); + + /** CodeCallback beforeModelCallback */ + beforeModelCallback?: (google.cloud.ces.v1beta.ICallback|null); + + /** CodeCallback afterModelCallback */ + afterModelCallback?: (google.cloud.ces.v1beta.ICallback|null); + } + + /** Represents a CodeCallback. */ + class CodeCallback implements ICodeCallback { + + /** + * Constructs a new CodeCallback. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Guardrail.ICodeCallback); + + /** CodeCallback beforeAgentCallback. */ + public beforeAgentCallback?: (google.cloud.ces.v1beta.ICallback|null); + + /** CodeCallback afterAgentCallback. */ + public afterAgentCallback?: (google.cloud.ces.v1beta.ICallback|null); + + /** CodeCallback beforeModelCallback. */ + public beforeModelCallback?: (google.cloud.ces.v1beta.ICallback|null); + + /** CodeCallback afterModelCallback. */ + public afterModelCallback?: (google.cloud.ces.v1beta.ICallback|null); + + /** + * Creates a new CodeCallback instance using the specified properties. + * @param [properties] Properties to set + * @returns CodeCallback instance + */ + public static create(properties?: google.cloud.ces.v1beta.Guardrail.ICodeCallback): google.cloud.ces.v1beta.Guardrail.CodeCallback; + + /** + * Encodes the specified CodeCallback message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.CodeCallback.verify|verify} messages. + * @param message CodeCallback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Guardrail.ICodeCallback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CodeCallback message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.CodeCallback.verify|verify} messages. + * @param message CodeCallback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.ICodeCallback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CodeCallback message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CodeCallback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.CodeCallback; + + /** + * Decodes a CodeCallback message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CodeCallback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.CodeCallback; + + /** + * Verifies a CodeCallback message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CodeCallback message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CodeCallback + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.CodeCallback; + + /** + * Creates a plain object from a CodeCallback message. Also converts values to other types if specified. + * @param message CodeCallback + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Guardrail.CodeCallback, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CodeCallback to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CodeCallback + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Tool. */ + interface ITool { + + /** Tool clientFunction */ + clientFunction?: (google.cloud.ces.v1beta.IClientFunction|null); + + /** Tool openApiTool */ + openApiTool?: (google.cloud.ces.v1beta.IOpenApiTool|null); + + /** Tool googleSearchTool */ + googleSearchTool?: (google.cloud.ces.v1beta.IGoogleSearchTool|null); + + /** Tool connectorTool */ + connectorTool?: (google.cloud.ces.v1beta.IConnectorTool|null); + + /** Tool dataStoreTool */ + dataStoreTool?: (google.cloud.ces.v1beta.IDataStoreTool|null); + + /** Tool pythonFunction */ + pythonFunction?: (google.cloud.ces.v1beta.IPythonFunction|null); + + /** Tool mcpTool */ + mcpTool?: (google.cloud.ces.v1beta.IMcpTool|null); + + /** Tool fileSearchTool */ + fileSearchTool?: (google.cloud.ces.v1beta.IFileSearchTool|null); + + /** Tool systemTool */ + systemTool?: (google.cloud.ces.v1beta.ISystemTool|null); + + /** Tool widgetTool */ + widgetTool?: (google.cloud.ces.v1beta.IWidgetTool|null); + + /** Tool name */ + name?: (string|null); + + /** Tool displayName */ + displayName?: (string|null); + + /** Tool executionType */ + executionType?: (google.cloud.ces.v1beta.ExecutionType|keyof typeof google.cloud.ces.v1beta.ExecutionType|null); + + /** Tool createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Tool updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Tool etag */ + etag?: (string|null); + + /** Tool generatedSummary */ + generatedSummary?: (string|null); + + /** Tool toolFakeConfig */ + toolFakeConfig?: (google.cloud.ces.v1beta.IToolFakeConfig|null); + } + + /** Represents a Tool. */ + class Tool implements ITool { + + /** + * Constructs a new Tool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ITool); + + /** Tool clientFunction. */ + public clientFunction?: (google.cloud.ces.v1beta.IClientFunction|null); + + /** Tool openApiTool. */ + public openApiTool?: (google.cloud.ces.v1beta.IOpenApiTool|null); + + /** Tool googleSearchTool. */ + public googleSearchTool?: (google.cloud.ces.v1beta.IGoogleSearchTool|null); + + /** Tool connectorTool. */ + public connectorTool?: (google.cloud.ces.v1beta.IConnectorTool|null); + + /** Tool dataStoreTool. */ + public dataStoreTool?: (google.cloud.ces.v1beta.IDataStoreTool|null); + + /** Tool pythonFunction. */ + public pythonFunction?: (google.cloud.ces.v1beta.IPythonFunction|null); + + /** Tool mcpTool. */ + public mcpTool?: (google.cloud.ces.v1beta.IMcpTool|null); + + /** Tool fileSearchTool. */ + public fileSearchTool?: (google.cloud.ces.v1beta.IFileSearchTool|null); + + /** Tool systemTool. */ + public systemTool?: (google.cloud.ces.v1beta.ISystemTool|null); + + /** Tool widgetTool. */ + public widgetTool?: (google.cloud.ces.v1beta.IWidgetTool|null); + + /** Tool name. */ + public name: string; + + /** Tool displayName. */ + public displayName: string; + + /** Tool executionType. */ + public executionType: (google.cloud.ces.v1beta.ExecutionType|keyof typeof google.cloud.ces.v1beta.ExecutionType); + + /** Tool createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Tool updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Tool etag. */ + public etag: string; + + /** Tool generatedSummary. */ + public generatedSummary: string; + + /** Tool toolFakeConfig. */ + public toolFakeConfig?: (google.cloud.ces.v1beta.IToolFakeConfig|null); + + /** Tool toolType. */ + public toolType?: ("clientFunction"|"openApiTool"|"googleSearchTool"|"connectorTool"|"dataStoreTool"|"pythonFunction"|"mcpTool"|"fileSearchTool"|"systemTool"|"widgetTool"); + + /** + * Creates a new Tool instance using the specified properties. + * @param [properties] Properties to set + * @returns Tool instance + */ + public static create(properties?: google.cloud.ces.v1beta.ITool): google.cloud.ces.v1beta.Tool; + + /** + * Encodes the specified Tool message. Does not implicitly {@link google.cloud.ces.v1beta.Tool.verify|verify} messages. + * @param message Tool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ITool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Tool.verify|verify} messages. + * @param message Tool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ITool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Tool; + + /** + * Decodes a Tool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Tool; + + /** + * Verifies a Tool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Tool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Tool; + + /** + * Creates a plain object from a Tool message. Also converts values to other types if specified. + * @param message Tool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Tool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Tool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientFunction. */ + interface IClientFunction { + + /** ClientFunction name */ + name?: (string|null); + + /** ClientFunction description */ + description?: (string|null); + + /** ClientFunction parameters */ + parameters?: (google.cloud.ces.v1beta.ISchema|null); + + /** ClientFunction response */ + response?: (google.cloud.ces.v1beta.ISchema|null); + } + + /** Represents a ClientFunction. */ + class ClientFunction implements IClientFunction { + + /** + * Constructs a new ClientFunction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IClientFunction); + + /** ClientFunction name. */ + public name: string; + + /** ClientFunction description. */ + public description: string; + + /** ClientFunction parameters. */ + public parameters?: (google.cloud.ces.v1beta.ISchema|null); + + /** ClientFunction response. */ + public response?: (google.cloud.ces.v1beta.ISchema|null); + + /** + * Creates a new ClientFunction instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientFunction instance + */ + public static create(properties?: google.cloud.ces.v1beta.IClientFunction): google.cloud.ces.v1beta.ClientFunction; + + /** + * Encodes the specified ClientFunction message. Does not implicitly {@link google.cloud.ces.v1beta.ClientFunction.verify|verify} messages. + * @param message ClientFunction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IClientFunction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ClientFunction.verify|verify} messages. + * @param message ClientFunction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IClientFunction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientFunction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ClientFunction; + + /** + * Decodes a ClientFunction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ClientFunction; + + /** + * Verifies a ClientFunction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientFunction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientFunction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ClientFunction; + + /** + * Creates a plain object from a ClientFunction message. Also converts values to other types if specified. + * @param message ClientFunction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ClientFunction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientFunction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientFunction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Action. */ + interface IAction { + + /** Action connectionActionId */ + connectionActionId?: (string|null); + + /** Action entityOperation */ + entityOperation?: (google.cloud.ces.v1beta.Action.IEntityOperation|null); + + /** Action inputFields */ + inputFields?: (string[]|null); + + /** Action outputFields */ + outputFields?: (string[]|null); + } + + /** Represents an Action. */ + class Action implements IAction { + + /** + * Constructs a new Action. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IAction); + + /** Action connectionActionId. */ + public connectionActionId?: (string|null); + + /** Action entityOperation. */ + public entityOperation?: (google.cloud.ces.v1beta.Action.IEntityOperation|null); + + /** Action inputFields. */ + public inputFields: string[]; + + /** Action outputFields. */ + public outputFields: string[]; + + /** Action actionSpec. */ + public actionSpec?: ("connectionActionId"|"entityOperation"); + + /** + * Creates a new Action instance using the specified properties. + * @param [properties] Properties to set + * @returns Action instance + */ + public static create(properties?: google.cloud.ces.v1beta.IAction): google.cloud.ces.v1beta.Action; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.cloud.ces.v1beta.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Action message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Action; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Action; + + /** + * Verifies an Action message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Action message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Action + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Action; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @param message Action + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Action, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Action to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Action + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Action { + + /** Properties of an EntityOperation. */ + interface IEntityOperation { + + /** EntityOperation entityId */ + entityId?: (string|null); + + /** EntityOperation operation */ + operation?: (google.cloud.ces.v1beta.Action.EntityOperation.OperationType|keyof typeof google.cloud.ces.v1beta.Action.EntityOperation.OperationType|null); + } + + /** Represents an EntityOperation. */ + class EntityOperation implements IEntityOperation { + + /** + * Constructs a new EntityOperation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Action.IEntityOperation); + + /** EntityOperation entityId. */ + public entityId: string; + + /** EntityOperation operation. */ + public operation: (google.cloud.ces.v1beta.Action.EntityOperation.OperationType|keyof typeof google.cloud.ces.v1beta.Action.EntityOperation.OperationType); + + /** + * Creates a new EntityOperation instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityOperation instance + */ + public static create(properties?: google.cloud.ces.v1beta.Action.IEntityOperation): google.cloud.ces.v1beta.Action.EntityOperation; + + /** + * Encodes the specified EntityOperation message. Does not implicitly {@link google.cloud.ces.v1beta.Action.EntityOperation.verify|verify} messages. + * @param message EntityOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Action.IEntityOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityOperation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Action.EntityOperation.verify|verify} messages. + * @param message EntityOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Action.IEntityOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityOperation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Action.EntityOperation; + + /** + * Decodes an EntityOperation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Action.EntityOperation; + + /** + * Verifies an EntityOperation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EntityOperation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityOperation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Action.EntityOperation; + + /** + * Creates a plain object from an EntityOperation message. Also converts values to other types if specified. + * @param message EntityOperation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Action.EntityOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityOperation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EntityOperation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EntityOperation { + + /** OperationType enum. */ + enum OperationType { + OPERATION_TYPE_UNSPECIFIED = 0, + LIST = 1, + GET = 2, + CREATE = 3, + UPDATE = 4, + DELETE = 5 + } + } + } + + /** Properties of a ConnectorTool. */ + interface IConnectorTool { + + /** ConnectorTool connection */ + connection?: (string|null); + + /** ConnectorTool action */ + action?: (google.cloud.ces.v1beta.IAction|null); + + /** ConnectorTool authConfig */ + authConfig?: (google.cloud.ces.v1beta.IEndUserAuthConfig|null); + + /** ConnectorTool name */ + name?: (string|null); + + /** ConnectorTool description */ + description?: (string|null); + } + + /** Represents a ConnectorTool. */ + class ConnectorTool implements IConnectorTool { + + /** + * Constructs a new ConnectorTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IConnectorTool); + + /** ConnectorTool connection. */ + public connection: string; + + /** ConnectorTool action. */ + public action?: (google.cloud.ces.v1beta.IAction|null); + + /** ConnectorTool authConfig. */ + public authConfig?: (google.cloud.ces.v1beta.IEndUserAuthConfig|null); + + /** ConnectorTool name. */ + public name: string; + + /** ConnectorTool description. */ + public description: string; + + /** + * Creates a new ConnectorTool instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectorTool instance + */ + public static create(properties?: google.cloud.ces.v1beta.IConnectorTool): google.cloud.ces.v1beta.ConnectorTool; + + /** + * Encodes the specified ConnectorTool message. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorTool.verify|verify} messages. + * @param message ConnectorTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IConnectorTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectorTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorTool.verify|verify} messages. + * @param message ConnectorTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IConnectorTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectorTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectorTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ConnectorTool; + + /** + * Decodes a ConnectorTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectorTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ConnectorTool; + + /** + * Verifies a ConnectorTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectorTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectorTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ConnectorTool; + + /** + * Creates a plain object from a ConnectorTool message. Also converts values to other types if specified. + * @param message ConnectorTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ConnectorTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectorTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectorTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApiKeyConfig. */ + interface IApiKeyConfig { + + /** ApiKeyConfig keyName */ + keyName?: (string|null); + + /** ApiKeyConfig apiKeySecretVersion */ + apiKeySecretVersion?: (string|null); + + /** ApiKeyConfig requestLocation */ + requestLocation?: (google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation|keyof typeof google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation|null); + } + + /** Represents an ApiKeyConfig. */ + class ApiKeyConfig implements IApiKeyConfig { + + /** + * Constructs a new ApiKeyConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IApiKeyConfig); + + /** ApiKeyConfig keyName. */ + public keyName: string; + + /** ApiKeyConfig apiKeySecretVersion. */ + public apiKeySecretVersion: string; + + /** ApiKeyConfig requestLocation. */ + public requestLocation: (google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation|keyof typeof google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation); + + /** + * Creates a new ApiKeyConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiKeyConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IApiKeyConfig): google.cloud.ces.v1beta.ApiKeyConfig; + + /** + * Encodes the specified ApiKeyConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ApiKeyConfig.verify|verify} messages. + * @param message ApiKeyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IApiKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiKeyConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ApiKeyConfig.verify|verify} messages. + * @param message ApiKeyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IApiKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ApiKeyConfig; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ApiKeyConfig; + + /** + * Verifies an ApiKeyConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApiKeyConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiKeyConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ApiKeyConfig; + + /** + * Creates a plain object from an ApiKeyConfig message. Also converts values to other types if specified. + * @param message ApiKeyConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ApiKeyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiKeyConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiKeyConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ApiKeyConfig { + + /** RequestLocation enum. */ + enum RequestLocation { + REQUEST_LOCATION_UNSPECIFIED = 0, + HEADER = 1, + QUERY_STRING = 2 + } + } + + /** Properties of a OAuthConfig. */ + interface IOAuthConfig { + + /** OAuthConfig oauthGrantType */ + oauthGrantType?: (google.cloud.ces.v1beta.OAuthConfig.OauthGrantType|keyof typeof google.cloud.ces.v1beta.OAuthConfig.OauthGrantType|null); + + /** OAuthConfig clientId */ + clientId?: (string|null); + + /** OAuthConfig clientSecretVersion */ + clientSecretVersion?: (string|null); + + /** OAuthConfig tokenEndpoint */ + tokenEndpoint?: (string|null); + + /** OAuthConfig scopes */ + scopes?: (string[]|null); + } + + /** Represents a OAuthConfig. */ + class OAuthConfig implements IOAuthConfig { + + /** + * Constructs a new OAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IOAuthConfig); + + /** OAuthConfig oauthGrantType. */ + public oauthGrantType: (google.cloud.ces.v1beta.OAuthConfig.OauthGrantType|keyof typeof google.cloud.ces.v1beta.OAuthConfig.OauthGrantType); + + /** OAuthConfig clientId. */ + public clientId: string; + + /** OAuthConfig clientSecretVersion. */ + public clientSecretVersion: string; + + /** OAuthConfig tokenEndpoint. */ + public tokenEndpoint: string; + + /** OAuthConfig scopes. */ + public scopes: string[]; + + /** + * Creates a new OAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OAuthConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IOAuthConfig): google.cloud.ces.v1beta.OAuthConfig; + + /** + * Encodes the specified OAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OAuthConfig.verify|verify} messages. + * @param message OAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IOAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OAuthConfig.verify|verify} messages. + * @param message OAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IOAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OAuthConfig; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OAuthConfig; + + /** + * Verifies a OAuthConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OAuthConfig; + + /** + * Creates a plain object from a OAuthConfig message. Also converts values to other types if specified. + * @param message OAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OAuthConfig { + + /** OauthGrantType enum. */ + enum OauthGrantType { + OAUTH_GRANT_TYPE_UNSPECIFIED = 0, + CLIENT_CREDENTIAL = 1 + } + } + + /** Properties of a ServiceAgentIdTokenAuthConfig. */ + interface IServiceAgentIdTokenAuthConfig { + } + + /** Represents a ServiceAgentIdTokenAuthConfig. */ + class ServiceAgentIdTokenAuthConfig implements IServiceAgentIdTokenAuthConfig { + + /** + * Constructs a new ServiceAgentIdTokenAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig); + + /** + * Creates a new ServiceAgentIdTokenAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAgentIdTokenAuthConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig): google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig; + + /** + * Encodes the specified ServiceAgentIdTokenAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.verify|verify} messages. + * @param message ServiceAgentIdTokenAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAgentIdTokenAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.verify|verify} messages. + * @param message ServiceAgentIdTokenAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAgentIdTokenAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig; + + /** + * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAgentIdTokenAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig; + + /** + * Verifies a ServiceAgentIdTokenAuthConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceAgentIdTokenAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAgentIdTokenAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig; + + /** + * Creates a plain object from a ServiceAgentIdTokenAuthConfig message. Also converts values to other types if specified. + * @param message ServiceAgentIdTokenAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAgentIdTokenAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAgentIdTokenAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceAccountAuthConfig. */ + interface IServiceAccountAuthConfig { + + /** ServiceAccountAuthConfig serviceAccount */ + serviceAccount?: (string|null); + + /** ServiceAccountAuthConfig scopes */ + scopes?: (string[]|null); + } + + /** Represents a ServiceAccountAuthConfig. */ + class ServiceAccountAuthConfig implements IServiceAccountAuthConfig { + + /** + * Constructs a new ServiceAccountAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IServiceAccountAuthConfig); + + /** ServiceAccountAuthConfig serviceAccount. */ + public serviceAccount: string; + + /** ServiceAccountAuthConfig scopes. */ + public scopes: string[]; + + /** + * Creates a new ServiceAccountAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAccountAuthConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IServiceAccountAuthConfig): google.cloud.ces.v1beta.ServiceAccountAuthConfig; + + /** + * Encodes the specified ServiceAccountAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAccountAuthConfig.verify|verify} messages. + * @param message ServiceAccountAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IServiceAccountAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAccountAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAccountAuthConfig.verify|verify} messages. + * @param message ServiceAccountAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IServiceAccountAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ServiceAccountAuthConfig; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ServiceAccountAuthConfig; + + /** + * Verifies a ServiceAccountAuthConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceAccountAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAccountAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ServiceAccountAuthConfig; + + /** + * Creates a plain object from a ServiceAccountAuthConfig message. Also converts values to other types if specified. + * @param message ServiceAccountAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ServiceAccountAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAccountAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAccountAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BearerTokenConfig. */ + interface IBearerTokenConfig { + + /** BearerTokenConfig token */ + token?: (string|null); + } + + /** Represents a BearerTokenConfig. */ + class BearerTokenConfig implements IBearerTokenConfig { + + /** + * Constructs a new BearerTokenConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IBearerTokenConfig); + + /** BearerTokenConfig token. */ + public token: string; + + /** + * Creates a new BearerTokenConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BearerTokenConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IBearerTokenConfig): google.cloud.ces.v1beta.BearerTokenConfig; + + /** + * Encodes the specified BearerTokenConfig message. Does not implicitly {@link google.cloud.ces.v1beta.BearerTokenConfig.verify|verify} messages. + * @param message BearerTokenConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IBearerTokenConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BearerTokenConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BearerTokenConfig.verify|verify} messages. + * @param message BearerTokenConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IBearerTokenConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BearerTokenConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BearerTokenConfig; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BearerTokenConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BearerTokenConfig; + + /** + * Verifies a BearerTokenConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BearerTokenConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BearerTokenConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BearerTokenConfig; + + /** + * Creates a plain object from a BearerTokenConfig message. Also converts values to other types if specified. + * @param message BearerTokenConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.BearerTokenConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BearerTokenConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BearerTokenConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EndUserAuthConfig. */ + interface IEndUserAuthConfig { + + /** EndUserAuthConfig oauth2AuthCodeConfig */ + oauth2AuthCodeConfig?: (google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig|null); + + /** EndUserAuthConfig oauth2JwtBearerConfig */ + oauth2JwtBearerConfig?: (google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig|null); + } + + /** Represents an EndUserAuthConfig. */ + class EndUserAuthConfig implements IEndUserAuthConfig { + + /** + * Constructs a new EndUserAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEndUserAuthConfig); + + /** EndUserAuthConfig oauth2AuthCodeConfig. */ + public oauth2AuthCodeConfig?: (google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig|null); + + /** EndUserAuthConfig oauth2JwtBearerConfig. */ + public oauth2JwtBearerConfig?: (google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig|null); + + /** EndUserAuthConfig authConfig. */ + public authConfig?: ("oauth2AuthCodeConfig"|"oauth2JwtBearerConfig"); + + /** + * Creates a new EndUserAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EndUserAuthConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEndUserAuthConfig): google.cloud.ces.v1beta.EndUserAuthConfig; + + /** + * Encodes the specified EndUserAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.verify|verify} messages. + * @param message EndUserAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEndUserAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndUserAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.verify|verify} messages. + * @param message EndUserAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEndUserAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndUserAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndUserAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EndUserAuthConfig; + + /** + * Decodes an EndUserAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndUserAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EndUserAuthConfig; + + /** + * Verifies an EndUserAuthConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EndUserAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndUserAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EndUserAuthConfig; + + /** + * Creates a plain object from an EndUserAuthConfig message. Also converts values to other types if specified. + * @param message EndUserAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EndUserAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndUserAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndUserAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EndUserAuthConfig { + + /** Properties of an Oauth2AuthCodeConfig. */ + interface IOauth2AuthCodeConfig { + + /** Oauth2AuthCodeConfig oauthToken */ + oauthToken?: (string|null); + } + + /** Represents an Oauth2AuthCodeConfig. */ + class Oauth2AuthCodeConfig implements IOauth2AuthCodeConfig { + + /** + * Constructs a new Oauth2AuthCodeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig); + + /** Oauth2AuthCodeConfig oauthToken. */ + public oauthToken: string; + + /** + * Creates a new Oauth2AuthCodeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns Oauth2AuthCodeConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig; + + /** + * Encodes the specified Oauth2AuthCodeConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. + * @param message Oauth2AuthCodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Oauth2AuthCodeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. + * @param message Oauth2AuthCodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Oauth2AuthCodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig; + + /** + * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Oauth2AuthCodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig; + + /** + * Verifies an Oauth2AuthCodeConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Oauth2AuthCodeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Oauth2AuthCodeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig; + + /** + * Creates a plain object from an Oauth2AuthCodeConfig message. Also converts values to other types if specified. + * @param message Oauth2AuthCodeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Oauth2AuthCodeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Oauth2AuthCodeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Oauth2JwtBearerConfig. */ + interface IOauth2JwtBearerConfig { + + /** Oauth2JwtBearerConfig issuer */ + issuer?: (string|null); + + /** Oauth2JwtBearerConfig subject */ + subject?: (string|null); + + /** Oauth2JwtBearerConfig clientKey */ + clientKey?: (string|null); + } + + /** Represents an Oauth2JwtBearerConfig. */ + class Oauth2JwtBearerConfig implements IOauth2JwtBearerConfig { + + /** + * Constructs a new Oauth2JwtBearerConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig); + + /** Oauth2JwtBearerConfig issuer. */ + public issuer: string; + + /** Oauth2JwtBearerConfig subject. */ + public subject: string; + + /** Oauth2JwtBearerConfig clientKey. */ + public clientKey: string; + + /** + * Creates a new Oauth2JwtBearerConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns Oauth2JwtBearerConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig; + + /** + * Encodes the specified Oauth2JwtBearerConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. + * @param message Oauth2JwtBearerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Oauth2JwtBearerConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. + * @param message Oauth2JwtBearerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Oauth2JwtBearerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig; + + /** + * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Oauth2JwtBearerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig; + + /** + * Verifies an Oauth2JwtBearerConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Oauth2JwtBearerConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Oauth2JwtBearerConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig; + + /** + * Creates a plain object from an Oauth2JwtBearerConfig message. Also converts values to other types if specified. + * @param message Oauth2JwtBearerConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Oauth2JwtBearerConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Oauth2JwtBearerConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ApiAuthentication. */ + interface IApiAuthentication { + + /** ApiAuthentication apiKeyConfig */ + apiKeyConfig?: (google.cloud.ces.v1beta.IApiKeyConfig|null); + + /** ApiAuthentication oauthConfig */ + oauthConfig?: (google.cloud.ces.v1beta.IOAuthConfig|null); + + /** ApiAuthentication serviceAgentIdTokenAuthConfig */ + serviceAgentIdTokenAuthConfig?: (google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig|null); + + /** ApiAuthentication serviceAccountAuthConfig */ + serviceAccountAuthConfig?: (google.cloud.ces.v1beta.IServiceAccountAuthConfig|null); + + /** ApiAuthentication bearerTokenConfig */ + bearerTokenConfig?: (google.cloud.ces.v1beta.IBearerTokenConfig|null); + } + + /** Represents an ApiAuthentication. */ + class ApiAuthentication implements IApiAuthentication { + + /** + * Constructs a new ApiAuthentication. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IApiAuthentication); + + /** ApiAuthentication apiKeyConfig. */ + public apiKeyConfig?: (google.cloud.ces.v1beta.IApiKeyConfig|null); + + /** ApiAuthentication oauthConfig. */ + public oauthConfig?: (google.cloud.ces.v1beta.IOAuthConfig|null); + + /** ApiAuthentication serviceAgentIdTokenAuthConfig. */ + public serviceAgentIdTokenAuthConfig?: (google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig|null); + + /** ApiAuthentication serviceAccountAuthConfig. */ + public serviceAccountAuthConfig?: (google.cloud.ces.v1beta.IServiceAccountAuthConfig|null); + + /** ApiAuthentication bearerTokenConfig. */ + public bearerTokenConfig?: (google.cloud.ces.v1beta.IBearerTokenConfig|null); + + /** ApiAuthentication authConfig. */ + public authConfig?: ("apiKeyConfig"|"oauthConfig"|"serviceAgentIdTokenAuthConfig"|"serviceAccountAuthConfig"|"bearerTokenConfig"); + + /** + * Creates a new ApiAuthentication instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiAuthentication instance + */ + public static create(properties?: google.cloud.ces.v1beta.IApiAuthentication): google.cloud.ces.v1beta.ApiAuthentication; + + /** + * Encodes the specified ApiAuthentication message. Does not implicitly {@link google.cloud.ces.v1beta.ApiAuthentication.verify|verify} messages. + * @param message ApiAuthentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IApiAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiAuthentication message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ApiAuthentication.verify|verify} messages. + * @param message ApiAuthentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IApiAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiAuthentication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiAuthentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ApiAuthentication; + + /** + * Decodes an ApiAuthentication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiAuthentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ApiAuthentication; + + /** + * Verifies an ApiAuthentication message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApiAuthentication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiAuthentication + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ApiAuthentication; + + /** + * Creates a plain object from an ApiAuthentication message. Also converts values to other types if specified. + * @param message ApiAuthentication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ApiAuthentication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiAuthentication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiAuthentication + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataStoreTool. */ + interface IDataStoreTool { + + /** DataStoreTool dataStoreSource */ + dataStoreSource?: (google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource|null); + + /** DataStoreTool engineSource */ + engineSource?: (google.cloud.ces.v1beta.DataStoreTool.IEngineSource|null); + + /** DataStoreTool name */ + name?: (string|null); + + /** DataStoreTool description */ + description?: (string|null); + + /** DataStoreTool boostSpecs */ + boostSpecs?: (google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs[]|null); + + /** DataStoreTool modalityConfigs */ + modalityConfigs?: (google.cloud.ces.v1beta.DataStoreTool.IModalityConfig[]|null); + + /** DataStoreTool filterParameterBehavior */ + filterParameterBehavior?: (google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior|keyof typeof google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior|null); + } + + /** Represents a DataStoreTool. */ + class DataStoreTool implements IDataStoreTool { + + /** + * Constructs a new DataStoreTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDataStoreTool); + + /** DataStoreTool dataStoreSource. */ + public dataStoreSource?: (google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource|null); + + /** DataStoreTool engineSource. */ + public engineSource?: (google.cloud.ces.v1beta.DataStoreTool.IEngineSource|null); + + /** DataStoreTool name. */ + public name: string; + + /** DataStoreTool description. */ + public description: string; + + /** DataStoreTool boostSpecs. */ + public boostSpecs: google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs[]; + + /** DataStoreTool modalityConfigs. */ + public modalityConfigs: google.cloud.ces.v1beta.DataStoreTool.IModalityConfig[]; + + /** DataStoreTool filterParameterBehavior. */ + public filterParameterBehavior: (google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior|keyof typeof google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior); + + /** DataStoreTool searchSource. */ + public searchSource?: ("dataStoreSource"|"engineSource"); + + /** + * Creates a new DataStoreTool instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStoreTool instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDataStoreTool): google.cloud.ces.v1beta.DataStoreTool; + + /** + * Encodes the specified DataStoreTool message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.verify|verify} messages. + * @param message DataStoreTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDataStoreTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStoreTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.verify|verify} messages. + * @param message DataStoreTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDataStoreTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStoreTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStoreTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool; + + /** + * Verifies a DataStoreTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataStoreTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStoreTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool; + + /** + * Creates a plain object from a DataStoreTool message. Also converts values to other types if specified. + * @param message DataStoreTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStoreTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStoreTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataStoreTool { + + /** Properties of a RewriterConfig. */ + interface IRewriterConfig { + + /** RewriterConfig modelSettings */ + modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** RewriterConfig prompt */ + prompt?: (string|null); + + /** RewriterConfig disabled */ + disabled?: (boolean|null); + } + + /** Represents a RewriterConfig. */ + class RewriterConfig implements IRewriterConfig { + + /** + * Constructs a new RewriterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig); + + /** RewriterConfig modelSettings. */ + public modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** RewriterConfig prompt. */ + public prompt: string; + + /** RewriterConfig disabled. */ + public disabled: boolean; + + /** + * Creates a new RewriterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RewriterConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig): google.cloud.ces.v1beta.DataStoreTool.RewriterConfig; + + /** + * Encodes the specified RewriterConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.verify|verify} messages. + * @param message RewriterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RewriterConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.verify|verify} messages. + * @param message RewriterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RewriterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RewriterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.RewriterConfig; + + /** + * Decodes a RewriterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RewriterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.RewriterConfig; + + /** + * Verifies a RewriterConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RewriterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RewriterConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.RewriterConfig; + + /** + * Creates a plain object from a RewriterConfig message. Also converts values to other types if specified. + * @param message RewriterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.RewriterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RewriterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RewriterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SummarizationConfig. */ + interface ISummarizationConfig { + + /** SummarizationConfig modelSettings */ + modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** SummarizationConfig prompt */ + prompt?: (string|null); + + /** SummarizationConfig disabled */ + disabled?: (boolean|null); + } + + /** Represents a SummarizationConfig. */ + class SummarizationConfig implements ISummarizationConfig { + + /** + * Constructs a new SummarizationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig); + + /** SummarizationConfig modelSettings. */ + public modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** SummarizationConfig prompt. */ + public prompt: string; + + /** SummarizationConfig disabled. */ + public disabled: boolean; + + /** + * Creates a new SummarizationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SummarizationConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig): google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig; + + /** + * Encodes the specified SummarizationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.verify|verify} messages. + * @param message SummarizationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SummarizationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.verify|verify} messages. + * @param message SummarizationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SummarizationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SummarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig; + + /** + * Decodes a SummarizationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SummarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig; + + /** + * Verifies a SummarizationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SummarizationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SummarizationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig; + + /** + * Creates a plain object from a SummarizationConfig message. Also converts values to other types if specified. + * @param message SummarizationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SummarizationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SummarizationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroundingConfig. */ + interface IGroundingConfig { + + /** GroundingConfig groundingLevel */ + groundingLevel?: (number|null); + + /** GroundingConfig disabled */ + disabled?: (boolean|null); + } + + /** Represents a GroundingConfig. */ + class GroundingConfig implements IGroundingConfig { + + /** + * Constructs a new GroundingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig); + + /** GroundingConfig groundingLevel. */ + public groundingLevel: number; + + /** GroundingConfig disabled. */ + public disabled: boolean; + + /** + * Creates a new GroundingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GroundingConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig): google.cloud.ces.v1beta.DataStoreTool.GroundingConfig; + + /** + * Encodes the specified GroundingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.verify|verify} messages. + * @param message GroundingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroundingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.verify|verify} messages. + * @param message GroundingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroundingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroundingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.GroundingConfig; + + /** + * Decodes a GroundingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroundingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.GroundingConfig; + + /** + * Verifies a GroundingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroundingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroundingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.GroundingConfig; + + /** + * Creates a plain object from a GroundingConfig message. Also converts values to other types if specified. + * @param message GroundingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.GroundingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroundingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroundingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataStoreSource. */ + interface IDataStoreSource { + + /** DataStoreSource filter */ + filter?: (string|null); + + /** DataStoreSource dataStore */ + dataStore?: (google.cloud.ces.v1beta.IDataStore|null); + } + + /** Represents a DataStoreSource. */ + class DataStoreSource implements IDataStoreSource { + + /** + * Constructs a new DataStoreSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource); + + /** DataStoreSource filter. */ + public filter: string; + + /** DataStoreSource dataStore. */ + public dataStore?: (google.cloud.ces.v1beta.IDataStore|null); + + /** + * Creates a new DataStoreSource instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStoreSource instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource): google.cloud.ces.v1beta.DataStoreTool.DataStoreSource; + + /** + * Encodes the specified DataStoreSource message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.verify|verify} messages. + * @param message DataStoreSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStoreSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.verify|verify} messages. + * @param message DataStoreSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStoreSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStoreSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.DataStoreSource; + + /** + * Decodes a DataStoreSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStoreSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.DataStoreSource; + + /** + * Verifies a DataStoreSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataStoreSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStoreSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.DataStoreSource; + + /** + * Creates a plain object from a DataStoreSource message. Also converts values to other types if specified. + * @param message DataStoreSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.DataStoreSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStoreSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStoreSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EngineSource. */ + interface IEngineSource { + + /** EngineSource engine */ + engine?: (string|null); + + /** EngineSource dataStoreSources */ + dataStoreSources?: (google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource[]|null); + + /** EngineSource filter */ + filter?: (string|null); + } + + /** Represents an EngineSource. */ + class EngineSource implements IEngineSource { + + /** + * Constructs a new EngineSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IEngineSource); + + /** EngineSource engine. */ + public engine: string; + + /** EngineSource dataStoreSources. */ + public dataStoreSources: google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource[]; + + /** EngineSource filter. */ + public filter: string; + + /** + * Creates a new EngineSource instance using the specified properties. + * @param [properties] Properties to set + * @returns EngineSource instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IEngineSource): google.cloud.ces.v1beta.DataStoreTool.EngineSource; + + /** + * Encodes the specified EngineSource message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.EngineSource.verify|verify} messages. + * @param message EngineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IEngineSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EngineSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.EngineSource.verify|verify} messages. + * @param message EngineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IEngineSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EngineSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EngineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.EngineSource; + + /** + * Decodes an EngineSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EngineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.EngineSource; + + /** + * Verifies an EngineSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EngineSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EngineSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.EngineSource; + + /** + * Creates a plain object from an EngineSource message. Also converts values to other types if specified. + * @param message EngineSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.EngineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EngineSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EngineSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoostSpecs. */ + interface IBoostSpecs { + + /** BoostSpecs dataStores */ + dataStores?: (string[]|null); + + /** BoostSpecs spec */ + spec?: (google.cloud.ces.v1beta.DataStoreTool.IBoostSpec[]|null); + } + + /** Represents a BoostSpecs. */ + class BoostSpecs implements IBoostSpecs { + + /** + * Constructs a new BoostSpecs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs); + + /** BoostSpecs dataStores. */ + public dataStores: string[]; + + /** BoostSpecs spec. */ + public spec: google.cloud.ces.v1beta.DataStoreTool.IBoostSpec[]; + + /** + * Creates a new BoostSpecs instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostSpecs instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs): google.cloud.ces.v1beta.DataStoreTool.BoostSpecs; + + /** + * Encodes the specified BoostSpecs message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.verify|verify} messages. + * @param message BoostSpecs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostSpecs message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.verify|verify} messages. + * @param message BoostSpecs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.BoostSpecs; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.BoostSpecs; + + /** + * Verifies a BoostSpecs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoostSpecs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostSpecs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.BoostSpecs; + + /** + * Creates a plain object from a BoostSpecs message. Also converts values to other types if specified. + * @param message BoostSpecs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpecs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostSpecs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostSpecs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoostSpec. */ + interface IBoostSpec { + + /** BoostSpec conditionBoostSpecs */ + conditionBoostSpecs?: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec[]|null); + } + + /** Represents a BoostSpec. */ + class BoostSpec implements IBoostSpec { + + /** + * Constructs a new BoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IBoostSpec); + + /** BoostSpec conditionBoostSpecs. */ + public conditionBoostSpecs: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec[]; + + /** + * Creates a new BoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostSpec instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IBoostSpec): google.cloud.ces.v1beta.DataStoreTool.BoostSpec; + + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.BoostSpec; + + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.BoostSpec; + + /** + * Verifies a BoostSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.BoostSpec; + + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @param message BoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BoostSpec { + + /** Properties of a ConditionBoostSpec. */ + interface IConditionBoostSpec { + + /** ConditionBoostSpec condition */ + condition?: (string|null); + + /** ConditionBoostSpec boost */ + boost?: (number|null); + + /** ConditionBoostSpec boostControlSpec */ + boostControlSpec?: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null); + } + + /** Represents a ConditionBoostSpec. */ + class ConditionBoostSpec implements IConditionBoostSpec { + + /** + * Constructs a new ConditionBoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec); + + /** ConditionBoostSpec condition. */ + public condition: string; + + /** ConditionBoostSpec boost. */ + public boost: number; + + /** ConditionBoostSpec boostControlSpec. */ + public boostControlSpec?: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null); + + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionBoostSpec instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec; + + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec; + + /** + * Verifies a ConditionBoostSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionBoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec; + + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @param message ConditionBoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionBoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConditionBoostSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConditionBoostSpec { + + /** Properties of a BoostControlSpec. */ + interface IBoostControlSpec { + + /** BoostControlSpec fieldName */ + fieldName?: (string|null); + + /** BoostControlSpec attributeType */ + attributeType?: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|keyof typeof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|null); + + /** BoostControlSpec interpolationType */ + interpolationType?: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|keyof typeof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|null); + + /** BoostControlSpec controlPoints */ + controlPoints?: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint[]|null); + } + + /** Represents a BoostControlSpec. */ + class BoostControlSpec implements IBoostControlSpec { + + /** + * Constructs a new BoostControlSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec); + + /** BoostControlSpec fieldName. */ + public fieldName: string; + + /** BoostControlSpec attributeType. */ + public attributeType: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|keyof typeof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType); + + /** BoostControlSpec interpolationType. */ + public interpolationType: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|keyof typeof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType); + + /** BoostControlSpec controlPoints. */ + public controlPoints: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint[]; + + /** + * Creates a new BoostControlSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostControlSpec instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Encodes the specified BoostControlSpec message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @param message BoostControlSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostControlSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @param message BoostControlSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Verifies a BoostControlSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoostControlSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostControlSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Creates a plain object from a BoostControlSpec message. Also converts values to other types if specified. + * @param message BoostControlSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostControlSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostControlSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BoostControlSpec { + + /** Properties of a ControlPoint. */ + interface IControlPoint { + + /** ControlPoint attributeValue */ + attributeValue?: (string|null); + + /** ControlPoint boostAmount */ + boostAmount?: (number|null); + } + + /** Represents a ControlPoint. */ + class ControlPoint implements IControlPoint { + + /** + * Constructs a new ControlPoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint); + + /** ControlPoint attributeValue. */ + public attributeValue: string; + + /** ControlPoint boostAmount. */ + public boostAmount: number; + + /** + * Creates a new ControlPoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ControlPoint instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Encodes the specified ControlPoint message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @param message ControlPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ControlPoint message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @param message ControlPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ControlPoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Decodes a ControlPoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Verifies a ControlPoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ControlPoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ControlPoint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Creates a plain object from a ControlPoint message. Also converts values to other types if specified. + * @param message ControlPoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ControlPoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ControlPoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** AttributeType enum. */ + enum AttributeType { + ATTRIBUTE_TYPE_UNSPECIFIED = 0, + NUMERICAL = 1, + FRESHNESS = 2 + } + + /** InterpolationType enum. */ + enum InterpolationType { + INTERPOLATION_TYPE_UNSPECIFIED = 0, + LINEAR = 1 + } + } + } + } + + /** Properties of a ModalityConfig. */ + interface IModalityConfig { + + /** ModalityConfig modalityType */ + modalityType?: (google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType|keyof typeof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType|null); + + /** ModalityConfig rewriterConfig */ + rewriterConfig?: (google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig|null); + + /** ModalityConfig summarizationConfig */ + summarizationConfig?: (google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig|null); + + /** ModalityConfig groundingConfig */ + groundingConfig?: (google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig|null); + } + + /** Represents a ModalityConfig. */ + class ModalityConfig implements IModalityConfig { + + /** + * Constructs a new ModalityConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IModalityConfig); + + /** ModalityConfig modalityType. */ + public modalityType: (google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType|keyof typeof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType); + + /** ModalityConfig rewriterConfig. */ + public rewriterConfig?: (google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig|null); + + /** ModalityConfig summarizationConfig. */ + public summarizationConfig?: (google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig|null); + + /** ModalityConfig groundingConfig. */ + public groundingConfig?: (google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig|null); + + /** + * Creates a new ModalityConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ModalityConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IModalityConfig): google.cloud.ces.v1beta.DataStoreTool.ModalityConfig; + + /** + * Encodes the specified ModalityConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.verify|verify} messages. + * @param message ModalityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IModalityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModalityConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.verify|verify} messages. + * @param message ModalityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IModalityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModalityConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModalityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.ModalityConfig; + + /** + * Decodes a ModalityConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModalityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.ModalityConfig; + + /** + * Verifies a ModalityConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModalityConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModalityConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.ModalityConfig; + + /** + * Creates a plain object from a ModalityConfig message. Also converts values to other types if specified. + * @param message ModalityConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.ModalityConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModalityConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModalityConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ModalityConfig { + + /** ModalityType enum. */ + enum ModalityType { + MODALITY_TYPE_UNSPECIFIED = 0, + TEXT = 1, + AUDIO = 2 + } + } + + /** FilterParameterBehavior enum. */ + enum FilterParameterBehavior { + FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED = 0, + ALWAYS_INCLUDE = 2, + NEVER_INCLUDE = 3 + } + } + + /** Properties of a DataStore. */ + interface IDataStore { + + /** DataStore name */ + name?: (string|null); + + /** DataStore type */ + type?: (google.cloud.ces.v1beta.DataStore.DataStoreType|keyof typeof google.cloud.ces.v1beta.DataStore.DataStoreType|null); + + /** DataStore documentProcessingMode */ + documentProcessingMode?: (google.cloud.ces.v1beta.DataStore.DocumentProcessingMode|keyof typeof google.cloud.ces.v1beta.DataStore.DocumentProcessingMode|null); + + /** DataStore displayName */ + displayName?: (string|null); + + /** DataStore createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DataStore connectorConfig */ + connectorConfig?: (google.cloud.ces.v1beta.DataStore.IConnectorConfig|null); + } + + /** Represents a DataStore. */ + class DataStore implements IDataStore { + + /** + * Constructs a new DataStore. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDataStore); + + /** DataStore name. */ + public name: string; + + /** DataStore type. */ + public type: (google.cloud.ces.v1beta.DataStore.DataStoreType|keyof typeof google.cloud.ces.v1beta.DataStore.DataStoreType); + + /** DataStore documentProcessingMode. */ + public documentProcessingMode: (google.cloud.ces.v1beta.DataStore.DocumentProcessingMode|keyof typeof google.cloud.ces.v1beta.DataStore.DocumentProcessingMode); + + /** DataStore displayName. */ + public displayName: string; + + /** DataStore createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DataStore connectorConfig. */ + public connectorConfig?: (google.cloud.ces.v1beta.DataStore.IConnectorConfig|null); + + /** + * Creates a new DataStore instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStore instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDataStore): google.cloud.ces.v1beta.DataStore; + + /** + * Encodes the specified DataStore message. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.verify|verify} messages. + * @param message DataStore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDataStore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStore message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.verify|verify} messages. + * @param message DataStore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDataStore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStore message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStore; + + /** + * Decodes a DataStore message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStore; + + /** + * Verifies a DataStore message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataStore message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStore + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStore; + + /** + * Creates a plain object from a DataStore message. Also converts values to other types if specified. + * @param message DataStore + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStore, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStore to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStore + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataStore { + + /** Properties of a ConnectorConfig. */ + interface IConnectorConfig { + + /** ConnectorConfig collection */ + collection?: (string|null); + + /** ConnectorConfig collectionDisplayName */ + collectionDisplayName?: (string|null); + + /** ConnectorConfig dataSource */ + dataSource?: (string|null); + } + + /** Represents a ConnectorConfig. */ + class ConnectorConfig implements IConnectorConfig { + + /** + * Constructs a new ConnectorConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStore.IConnectorConfig); + + /** ConnectorConfig collection. */ + public collection: string; + + /** ConnectorConfig collectionDisplayName. */ + public collectionDisplayName: string; + + /** ConnectorConfig dataSource. */ + public dataSource: string; + + /** + * Creates a new ConnectorConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectorConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStore.IConnectorConfig): google.cloud.ces.v1beta.DataStore.ConnectorConfig; + + /** + * Encodes the specified ConnectorConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.ConnectorConfig.verify|verify} messages. + * @param message ConnectorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStore.IConnectorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectorConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.ConnectorConfig.verify|verify} messages. + * @param message ConnectorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStore.IConnectorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectorConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStore.ConnectorConfig; + + /** + * Decodes a ConnectorConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStore.ConnectorConfig; + + /** + * Verifies a ConnectorConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectorConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectorConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStore.ConnectorConfig; + + /** + * Creates a plain object from a ConnectorConfig message. Also converts values to other types if specified. + * @param message ConnectorConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStore.ConnectorConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectorConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectorConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DataStoreType enum. */ + enum DataStoreType { + DATA_STORE_TYPE_UNSPECIFIED = 0, + PUBLIC_WEB = 1, + UNSTRUCTURED = 2, + FAQ = 3, + CONNECTOR = 4 + } + + /** DocumentProcessingMode enum. */ + enum DocumentProcessingMode { + DOCUMENT_PROCESSING_MODE_UNSPECIFIED = 0, + DOCUMENTS = 1, + CHUNKS = 2 + } + } + + /** Properties of a FileSearchTool. */ + interface IFileSearchTool { + + /** FileSearchTool corpusType */ + corpusType?: (google.cloud.ces.v1beta.FileSearchTool.CorpusType|keyof typeof google.cloud.ces.v1beta.FileSearchTool.CorpusType|null); + + /** FileSearchTool name */ + name?: (string|null); + + /** FileSearchTool description */ + description?: (string|null); + + /** FileSearchTool fileCorpus */ + fileCorpus?: (string|null); + } + + /** Represents a FileSearchTool. */ + class FileSearchTool implements IFileSearchTool { + + /** + * Constructs a new FileSearchTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IFileSearchTool); + + /** FileSearchTool corpusType. */ + public corpusType: (google.cloud.ces.v1beta.FileSearchTool.CorpusType|keyof typeof google.cloud.ces.v1beta.FileSearchTool.CorpusType); + + /** FileSearchTool name. */ + public name: string; + + /** FileSearchTool description. */ + public description: string; + + /** FileSearchTool fileCorpus. */ + public fileCorpus: string; + + /** + * Creates a new FileSearchTool instance using the specified properties. + * @param [properties] Properties to set + * @returns FileSearchTool instance + */ + public static create(properties?: google.cloud.ces.v1beta.IFileSearchTool): google.cloud.ces.v1beta.FileSearchTool; + + /** + * Encodes the specified FileSearchTool message. Does not implicitly {@link google.cloud.ces.v1beta.FileSearchTool.verify|verify} messages. + * @param message FileSearchTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IFileSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.FileSearchTool.verify|verify} messages. + * @param message FileSearchTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IFileSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileSearchTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.FileSearchTool; + + /** + * Decodes a FileSearchTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.FileSearchTool; + + /** + * Verifies a FileSearchTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileSearchTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileSearchTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.FileSearchTool; + + /** + * Creates a plain object from a FileSearchTool message. Also converts values to other types if specified. + * @param message FileSearchTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.FileSearchTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileSearchTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileSearchTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileSearchTool { + + /** CorpusType enum. */ + enum CorpusType { + CORPUS_TYPE_UNSPECIFIED = 0, + USER_OWNED = 1, + FULLY_MANAGED = 2 + } + } + + /** Properties of a GoogleSearchTool. */ + interface IGoogleSearchTool { + + /** GoogleSearchTool name */ + name?: (string|null); + + /** GoogleSearchTool description */ + description?: (string|null); + + /** GoogleSearchTool contextUrls */ + contextUrls?: (string[]|null); + + /** GoogleSearchTool preferredDomains */ + preferredDomains?: (string[]|null); + + /** GoogleSearchTool excludeDomains */ + excludeDomains?: (string[]|null); + + /** GoogleSearchTool promptConfig */ + promptConfig?: (google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig|null); + } + + /** Represents a GoogleSearchTool. */ + class GoogleSearchTool implements IGoogleSearchTool { + + /** + * Constructs a new GoogleSearchTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGoogleSearchTool); + + /** GoogleSearchTool name. */ + public name: string; + + /** GoogleSearchTool description. */ + public description: string; + + /** GoogleSearchTool contextUrls. */ + public contextUrls: string[]; + + /** GoogleSearchTool preferredDomains. */ + public preferredDomains: string[]; + + /** GoogleSearchTool excludeDomains. */ + public excludeDomains: string[]; + + /** GoogleSearchTool promptConfig. */ + public promptConfig?: (google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig|null); + + /** + * Creates a new GoogleSearchTool instance using the specified properties. + * @param [properties] Properties to set + * @returns GoogleSearchTool instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGoogleSearchTool): google.cloud.ces.v1beta.GoogleSearchTool; + + /** + * Encodes the specified GoogleSearchTool message. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.verify|verify} messages. + * @param message GoogleSearchTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGoogleSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoogleSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.verify|verify} messages. + * @param message GoogleSearchTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGoogleSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoogleSearchTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoogleSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GoogleSearchTool; + + /** + * Decodes a GoogleSearchTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoogleSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GoogleSearchTool; + + /** + * Verifies a GoogleSearchTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoogleSearchTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoogleSearchTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GoogleSearchTool; + + /** + * Creates a plain object from a GoogleSearchTool message. Also converts values to other types if specified. + * @param message GoogleSearchTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GoogleSearchTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoogleSearchTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoogleSearchTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GoogleSearchTool { + + /** Properties of a PromptConfig. */ + interface IPromptConfig { + + /** PromptConfig textPrompt */ + textPrompt?: (string|null); + + /** PromptConfig voicePrompt */ + voicePrompt?: (string|null); + } + + /** Represents a PromptConfig. */ + class PromptConfig implements IPromptConfig { + + /** + * Constructs a new PromptConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig); + + /** PromptConfig textPrompt. */ + public textPrompt: string; + + /** PromptConfig voicePrompt. */ + public voicePrompt: string; + + /** + * Creates a new PromptConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PromptConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig): google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig; + + /** + * Encodes the specified PromptConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.verify|verify} messages. + * @param message PromptConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PromptConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.verify|verify} messages. + * @param message PromptConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PromptConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PromptConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig; + + /** + * Decodes a PromptConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PromptConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig; + + /** + * Verifies a PromptConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PromptConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PromptConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig; + + /** + * Creates a plain object from a PromptConfig message. Also converts values to other types if specified. + * @param message PromptConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PromptConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PromptConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a McpTool. */ + interface IMcpTool { + + /** McpTool name */ + name?: (string|null); + + /** McpTool description */ + description?: (string|null); + + /** McpTool inputSchema */ + inputSchema?: (google.cloud.ces.v1beta.ISchema|null); + + /** McpTool outputSchema */ + outputSchema?: (google.cloud.ces.v1beta.ISchema|null); + + /** McpTool serverAddress */ + serverAddress?: (string|null); + + /** McpTool apiAuthentication */ + apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); + + /** McpTool tlsConfig */ + tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); + + /** McpTool serviceDirectoryConfig */ + serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); + } + + /** Represents a McpTool. */ + class McpTool implements IMcpTool { + + /** + * Constructs a new McpTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IMcpTool); + + /** McpTool name. */ + public name: string; + + /** McpTool description. */ + public description: string; + + /** McpTool inputSchema. */ + public inputSchema?: (google.cloud.ces.v1beta.ISchema|null); + + /** McpTool outputSchema. */ + public outputSchema?: (google.cloud.ces.v1beta.ISchema|null); + + /** McpTool serverAddress. */ + public serverAddress: string; + + /** McpTool apiAuthentication. */ + public apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); + + /** McpTool tlsConfig. */ + public tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); + + /** McpTool serviceDirectoryConfig. */ + public serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); + + /** + * Creates a new McpTool instance using the specified properties. + * @param [properties] Properties to set + * @returns McpTool instance + */ + public static create(properties?: google.cloud.ces.v1beta.IMcpTool): google.cloud.ces.v1beta.McpTool; + + /** + * Encodes the specified McpTool message. Does not implicitly {@link google.cloud.ces.v1beta.McpTool.verify|verify} messages. + * @param message McpTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IMcpTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified McpTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.McpTool.verify|verify} messages. + * @param message McpTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IMcpTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a McpTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns McpTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.McpTool; + + /** + * Decodes a McpTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns McpTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.McpTool; + + /** + * Verifies a McpTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a McpTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns McpTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.McpTool; + + /** + * Creates a plain object from a McpTool message. Also converts values to other types if specified. + * @param message McpTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.McpTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this McpTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for McpTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OpenApiTool. */ + interface IOpenApiTool { + + /** OpenApiTool openApiSchema */ + openApiSchema?: (string|null); + + /** OpenApiTool name */ + name?: (string|null); + + /** OpenApiTool description */ + description?: (string|null); + + /** OpenApiTool apiAuthentication */ + apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); + + /** OpenApiTool tlsConfig */ + tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); + + /** OpenApiTool serviceDirectoryConfig */ + serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); + + /** OpenApiTool ignoreUnknownFields */ + ignoreUnknownFields?: (boolean|null); + + /** OpenApiTool url */ + url?: (string|null); + } + + /** Represents an OpenApiTool. */ + class OpenApiTool implements IOpenApiTool { + + /** + * Constructs a new OpenApiTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IOpenApiTool); + + /** OpenApiTool openApiSchema. */ + public openApiSchema: string; + + /** OpenApiTool name. */ + public name: string; + + /** OpenApiTool description. */ + public description: string; + + /** OpenApiTool apiAuthentication. */ + public apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); + + /** OpenApiTool tlsConfig. */ + public tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); + + /** OpenApiTool serviceDirectoryConfig. */ + public serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); + + /** OpenApiTool ignoreUnknownFields. */ + public ignoreUnknownFields: boolean; + + /** OpenApiTool url. */ + public url: string; + + /** + * Creates a new OpenApiTool instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenApiTool instance + */ + public static create(properties?: google.cloud.ces.v1beta.IOpenApiTool): google.cloud.ces.v1beta.OpenApiTool; + + /** + * Encodes the specified OpenApiTool message. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiTool.verify|verify} messages. + * @param message OpenApiTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IOpenApiTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OpenApiTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiTool.verify|verify} messages. + * @param message OpenApiTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IOpenApiTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenApiTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OpenApiTool; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenApiTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OpenApiTool; + + /** + * Verifies an OpenApiTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OpenApiTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenApiTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OpenApiTool; + + /** + * Creates a plain object from an OpenApiTool message. Also converts values to other types if specified. + * @param message OpenApiTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OpenApiTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OpenApiTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OpenApiTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonFunction. */ + interface IPythonFunction { + + /** PythonFunction name */ + name?: (string|null); + + /** PythonFunction pythonCode */ + pythonCode?: (string|null); + + /** PythonFunction description */ + description?: (string|null); + } + + /** Represents a PythonFunction. */ + class PythonFunction implements IPythonFunction { + + /** + * Constructs a new PythonFunction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IPythonFunction); + + /** PythonFunction name. */ + public name: string; + + /** PythonFunction pythonCode. */ + public pythonCode: string; + + /** PythonFunction description. */ + public description: string; + + /** + * Creates a new PythonFunction instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonFunction instance + */ + public static create(properties?: google.cloud.ces.v1beta.IPythonFunction): google.cloud.ces.v1beta.PythonFunction; + + /** + * Encodes the specified PythonFunction message. Does not implicitly {@link google.cloud.ces.v1beta.PythonFunction.verify|verify} messages. + * @param message PythonFunction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IPythonFunction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.PythonFunction.verify|verify} messages. + * @param message PythonFunction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IPythonFunction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonFunction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.PythonFunction; + + /** + * Decodes a PythonFunction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.PythonFunction; + + /** + * Verifies a PythonFunction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonFunction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonFunction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.PythonFunction; + + /** + * Creates a plain object from a PythonFunction message. Also converts values to other types if specified. + * @param message PythonFunction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.PythonFunction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonFunction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonFunction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SystemTool. */ + interface ISystemTool { + + /** SystemTool name */ + name?: (string|null); + + /** SystemTool description */ + description?: (string|null); + } + + /** Represents a SystemTool. */ + class SystemTool implements ISystemTool { + + /** + * Constructs a new SystemTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ISystemTool); + + /** SystemTool name. */ + public name: string; + + /** SystemTool description. */ + public description: string; + + /** + * Creates a new SystemTool instance using the specified properties. + * @param [properties] Properties to set + * @returns SystemTool instance + */ + public static create(properties?: google.cloud.ces.v1beta.ISystemTool): google.cloud.ces.v1beta.SystemTool; + + /** + * Encodes the specified SystemTool message. Does not implicitly {@link google.cloud.ces.v1beta.SystemTool.verify|verify} messages. + * @param message SystemTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ISystemTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SystemTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SystemTool.verify|verify} messages. + * @param message SystemTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ISystemTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SystemTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SystemTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SystemTool; + + /** + * Decodes a SystemTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SystemTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SystemTool; + + /** + * Verifies a SystemTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SystemTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SystemTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SystemTool; + + /** + * Creates a plain object from a SystemTool message. Also converts values to other types if specified. + * @param message SystemTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.SystemTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SystemTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SystemTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WidgetTool. */ + interface IWidgetTool { + + /** WidgetTool parameters */ + parameters?: (google.cloud.ces.v1beta.ISchema|null); + + /** WidgetTool name */ + name?: (string|null); + + /** WidgetTool description */ + description?: (string|null); + + /** WidgetTool widgetType */ + widgetType?: (google.cloud.ces.v1beta.WidgetTool.WidgetType|keyof typeof google.cloud.ces.v1beta.WidgetTool.WidgetType|null); + } + + /** Represents a WidgetTool. */ + class WidgetTool implements IWidgetTool { + + /** + * Constructs a new WidgetTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IWidgetTool); + + /** WidgetTool parameters. */ + public parameters?: (google.cloud.ces.v1beta.ISchema|null); + + /** WidgetTool name. */ + public name: string; + + /** WidgetTool description. */ + public description: string; + + /** WidgetTool widgetType. */ + public widgetType: (google.cloud.ces.v1beta.WidgetTool.WidgetType|keyof typeof google.cloud.ces.v1beta.WidgetTool.WidgetType); + + /** WidgetTool input. */ + public input?: "parameters"; + + /** + * Creates a new WidgetTool instance using the specified properties. + * @param [properties] Properties to set + * @returns WidgetTool instance + */ + public static create(properties?: google.cloud.ces.v1beta.IWidgetTool): google.cloud.ces.v1beta.WidgetTool; + + /** + * Encodes the specified WidgetTool message. Does not implicitly {@link google.cloud.ces.v1beta.WidgetTool.verify|verify} messages. + * @param message WidgetTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IWidgetTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WidgetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.WidgetTool.verify|verify} messages. + * @param message WidgetTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IWidgetTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WidgetTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WidgetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.WidgetTool; + + /** + * Decodes a WidgetTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WidgetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.WidgetTool; + + /** + * Verifies a WidgetTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WidgetTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WidgetTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.WidgetTool; + + /** + * Creates a plain object from a WidgetTool message. Also converts values to other types if specified. + * @param message WidgetTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.WidgetTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WidgetTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WidgetTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WidgetTool { + + /** WidgetType enum. */ + enum WidgetType { + WIDGET_TYPE_UNSPECIFIED = 0, + CUSTOM = 1, + PRODUCT_CAROUSEL = 2, + PRODUCT_DETAILS = 3, + QUICK_ACTIONS = 4, + PRODUCT_COMPARISON = 5, + ADVANCED_PRODUCT_DETAILS = 6, + SHORT_FORM = 7, + OVERALL_SATISFACTION = 8, + ORDER_SUMMARY = 9, + APPOINTMENT_DETAILS = 10, + APPOINTMENT_SCHEDULER = 11, + CONTACT_FORM = 12 + } + } + + /** Properties of a Toolset. */ + interface IToolset { + + /** Toolset mcpToolset */ + mcpToolset?: (google.cloud.ces.v1beta.IMcpToolset|null); + + /** Toolset openApiToolset */ + openApiToolset?: (google.cloud.ces.v1beta.IOpenApiToolset|null); + + /** Toolset connectorToolset */ + connectorToolset?: (google.cloud.ces.v1beta.IConnectorToolset|null); + + /** Toolset name */ + name?: (string|null); + + /** Toolset displayName */ + displayName?: (string|null); + + /** Toolset description */ + description?: (string|null); + + /** Toolset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Toolset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Toolset etag */ + etag?: (string|null); + + /** Toolset executionType */ + executionType?: (google.cloud.ces.v1beta.ExecutionType|keyof typeof google.cloud.ces.v1beta.ExecutionType|null); + + /** Toolset toolFakeConfig */ + toolFakeConfig?: (google.cloud.ces.v1beta.IToolFakeConfig|null); + } + + /** Represents a Toolset. */ + class Toolset implements IToolset { + + /** + * Constructs a new Toolset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IToolset); + + /** Toolset mcpToolset. */ + public mcpToolset?: (google.cloud.ces.v1beta.IMcpToolset|null); + + /** Toolset openApiToolset. */ + public openApiToolset?: (google.cloud.ces.v1beta.IOpenApiToolset|null); + + /** Toolset connectorToolset. */ + public connectorToolset?: (google.cloud.ces.v1beta.IConnectorToolset|null); + + /** Toolset name. */ + public name: string; + + /** Toolset displayName. */ + public displayName: string; + + /** Toolset description. */ + public description: string; + + /** Toolset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Toolset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Toolset etag. */ + public etag: string; + + /** Toolset executionType. */ + public executionType: (google.cloud.ces.v1beta.ExecutionType|keyof typeof google.cloud.ces.v1beta.ExecutionType); + + /** Toolset toolFakeConfig. */ + public toolFakeConfig?: (google.cloud.ces.v1beta.IToolFakeConfig|null); + + /** Toolset toolsetType. */ + public toolsetType?: ("mcpToolset"|"openApiToolset"|"connectorToolset"); + + /** + * Creates a new Toolset instance using the specified properties. + * @param [properties] Properties to set + * @returns Toolset instance + */ + public static create(properties?: google.cloud.ces.v1beta.IToolset): google.cloud.ces.v1beta.Toolset; + + /** + * Encodes the specified Toolset message. Does not implicitly {@link google.cloud.ces.v1beta.Toolset.verify|verify} messages. + * @param message Toolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Toolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Toolset.verify|verify} messages. + * @param message Toolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Toolset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Toolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Toolset; + + /** + * Decodes a Toolset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Toolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Toolset; + + /** + * Verifies a Toolset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Toolset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Toolset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Toolset; + + /** + * Creates a plain object from a Toolset message. Also converts values to other types if specified. + * @param message Toolset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Toolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Toolset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Toolset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConnectorToolset. */ + interface IConnectorToolset { + + /** ConnectorToolset connection */ + connection?: (string|null); + + /** ConnectorToolset authConfig */ + authConfig?: (google.cloud.ces.v1beta.IEndUserAuthConfig|null); + + /** ConnectorToolset connectorActions */ + connectorActions?: (google.cloud.ces.v1beta.IAction[]|null); + } + + /** Represents a ConnectorToolset. */ + class ConnectorToolset implements IConnectorToolset { + + /** + * Constructs a new ConnectorToolset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IConnectorToolset); + + /** ConnectorToolset connection. */ + public connection: string; + + /** ConnectorToolset authConfig. */ + public authConfig?: (google.cloud.ces.v1beta.IEndUserAuthConfig|null); + + /** ConnectorToolset connectorActions. */ + public connectorActions: google.cloud.ces.v1beta.IAction[]; + + /** + * Creates a new ConnectorToolset instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectorToolset instance + */ + public static create(properties?: google.cloud.ces.v1beta.IConnectorToolset): google.cloud.ces.v1beta.ConnectorToolset; + + /** + * Encodes the specified ConnectorToolset message. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorToolset.verify|verify} messages. + * @param message ConnectorToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IConnectorToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectorToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorToolset.verify|verify} messages. + * @param message ConnectorToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IConnectorToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectorToolset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectorToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ConnectorToolset; + + /** + * Decodes a ConnectorToolset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectorToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ConnectorToolset; + + /** + * Verifies a ConnectorToolset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectorToolset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectorToolset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ConnectorToolset; + + /** + * Creates a plain object from a ConnectorToolset message. Also converts values to other types if specified. + * @param message ConnectorToolset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ConnectorToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectorToolset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectorToolset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a McpToolset. */ + interface IMcpToolset { + + /** McpToolset serverAddress */ + serverAddress?: (string|null); + + /** McpToolset apiAuthentication */ + apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); + + /** McpToolset serviceDirectoryConfig */ + serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); + + /** McpToolset tlsConfig */ + tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); + } + + /** Represents a McpToolset. */ + class McpToolset implements IMcpToolset { + + /** + * Constructs a new McpToolset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IMcpToolset); + + /** McpToolset serverAddress. */ + public serverAddress: string; + + /** McpToolset apiAuthentication. */ + public apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); + + /** McpToolset serviceDirectoryConfig. */ + public serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); + + /** McpToolset tlsConfig. */ + public tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); + + /** + * Creates a new McpToolset instance using the specified properties. + * @param [properties] Properties to set + * @returns McpToolset instance + */ + public static create(properties?: google.cloud.ces.v1beta.IMcpToolset): google.cloud.ces.v1beta.McpToolset; + + /** + * Encodes the specified McpToolset message. Does not implicitly {@link google.cloud.ces.v1beta.McpToolset.verify|verify} messages. + * @param message McpToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IMcpToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified McpToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.McpToolset.verify|verify} messages. + * @param message McpToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IMcpToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a McpToolset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns McpToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.McpToolset; + + /** + * Decodes a McpToolset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns McpToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.McpToolset; + + /** + * Verifies a McpToolset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a McpToolset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns McpToolset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.McpToolset; + + /** + * Creates a plain object from a McpToolset message. Also converts values to other types if specified. + * @param message McpToolset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.McpToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this McpToolset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for McpToolset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OpenApiToolset. */ + interface IOpenApiToolset { + + /** OpenApiToolset openApiSchema */ + openApiSchema?: (string|null); + + /** OpenApiToolset apiAuthentication */ + apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); + + /** OpenApiToolset tlsConfig */ + tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); + + /** OpenApiToolset serviceDirectoryConfig */ + serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); + + /** OpenApiToolset ignoreUnknownFields */ + ignoreUnknownFields?: (boolean|null); + + /** OpenApiToolset url */ + url?: (string|null); + } + + /** Represents an OpenApiToolset. */ + class OpenApiToolset implements IOpenApiToolset { + + /** + * Constructs a new OpenApiToolset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IOpenApiToolset); + + /** OpenApiToolset openApiSchema. */ + public openApiSchema: string; + + /** OpenApiToolset apiAuthentication. */ + public apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); + + /** OpenApiToolset tlsConfig. */ + public tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); + + /** OpenApiToolset serviceDirectoryConfig. */ + public serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); + + /** OpenApiToolset ignoreUnknownFields. */ + public ignoreUnknownFields: boolean; + + /** OpenApiToolset url. */ + public url: string; + + /** + * Creates a new OpenApiToolset instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenApiToolset instance + */ + public static create(properties?: google.cloud.ces.v1beta.IOpenApiToolset): google.cloud.ces.v1beta.OpenApiToolset; + + /** + * Encodes the specified OpenApiToolset message. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiToolset.verify|verify} messages. + * @param message OpenApiToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IOpenApiToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OpenApiToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiToolset.verify|verify} messages. + * @param message OpenApiToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IOpenApiToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OpenApiToolset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenApiToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OpenApiToolset; + + /** + * Decodes an OpenApiToolset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenApiToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OpenApiToolset; + + /** + * Verifies an OpenApiToolset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OpenApiToolset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenApiToolset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OpenApiToolset; + + /** + * Creates a plain object from an OpenApiToolset message. Also converts values to other types if specified. + * @param message OpenApiToolset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OpenApiToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OpenApiToolset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OpenApiToolset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Changelog. */ + interface IChangelog { + + /** Changelog name */ + name?: (string|null); + + /** Changelog author */ + author?: (string|null); + + /** Changelog displayName */ + displayName?: (string|null); + + /** Changelog description */ + description?: (string|null); + + /** Changelog resource */ + resource?: (string|null); + + /** Changelog resourceType */ + resourceType?: (string|null); + + /** Changelog action */ + action?: (string|null); + + /** Changelog originalResource */ + originalResource?: (google.protobuf.IStruct|null); + + /** Changelog newResource */ + newResource?: (google.protobuf.IStruct|null); + + /** Changelog dependentResources */ + dependentResources?: (google.protobuf.IStruct[]|null); + + /** Changelog createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Changelog sequenceNumber */ + sequenceNumber?: (number|Long|string|null); + } + + /** Represents a Changelog. */ + class Changelog implements IChangelog { + + /** + * Constructs a new Changelog. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IChangelog); + + /** Changelog name. */ + public name: string; + + /** Changelog author. */ + public author: string; + + /** Changelog displayName. */ + public displayName: string; + + /** Changelog description. */ + public description: string; + + /** Changelog resource. */ + public resource: string; + + /** Changelog resourceType. */ + public resourceType: string; + + /** Changelog action. */ + public action: string; + + /** Changelog originalResource. */ + public originalResource?: (google.protobuf.IStruct|null); + + /** Changelog newResource. */ + public newResource?: (google.protobuf.IStruct|null); + + /** Changelog dependentResources. */ + public dependentResources: google.protobuf.IStruct[]; + + /** Changelog createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Changelog sequenceNumber. */ + public sequenceNumber: (number|Long|string); + + /** + * Creates a new Changelog instance using the specified properties. + * @param [properties] Properties to set + * @returns Changelog instance + */ + public static create(properties?: google.cloud.ces.v1beta.IChangelog): google.cloud.ces.v1beta.Changelog; + + /** + * Encodes the specified Changelog message. Does not implicitly {@link google.cloud.ces.v1beta.Changelog.verify|verify} messages. + * @param message Changelog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IChangelog, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Changelog message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Changelog.verify|verify} messages. + * @param message Changelog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IChangelog, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Changelog message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Changelog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Changelog; + + /** + * Decodes a Changelog message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Changelog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Changelog; + + /** + * Verifies a Changelog message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Changelog message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Changelog + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Changelog; + + /** + * Creates a plain object from a Changelog message. Also converts values to other types if specified. + * @param message Changelog + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Changelog, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Changelog to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Changelog + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Conversation. */ + interface IConversation { + + /** Conversation name */ + name?: (string|null); + + /** Conversation startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Conversation endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Conversation turns */ + turns?: (google.cloud.ces.v1beta.Conversation.ITurn[]|null); + + /** Conversation turnCount */ + turnCount?: (number|null); + + /** Conversation channelType */ + channelType?: (google.cloud.ces.v1beta.Conversation.ChannelType|keyof typeof google.cloud.ces.v1beta.Conversation.ChannelType|null); + + /** Conversation source */ + source?: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source|null); + + /** Conversation inputTypes */ + inputTypes?: (google.cloud.ces.v1beta.Conversation.InputType[]|null); + + /** Conversation entryAgent */ + entryAgent?: (string|null); + + /** Conversation deployment */ + deployment?: (string|null); + + /** Conversation appVersion */ + appVersion?: (string|null); + + /** Conversation languageCode */ + languageCode?: (string|null); + + /** Conversation messages */ + messages?: (google.cloud.ces.v1beta.IMessage[]|null); + } + + /** Represents a Conversation. */ + class Conversation implements IConversation { + + /** + * Constructs a new Conversation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IConversation); + + /** Conversation name. */ + public name: string; + + /** Conversation startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Conversation endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Conversation turns. */ + public turns: google.cloud.ces.v1beta.Conversation.ITurn[]; + + /** Conversation turnCount. */ + public turnCount: number; + + /** Conversation channelType. */ + public channelType: (google.cloud.ces.v1beta.Conversation.ChannelType|keyof typeof google.cloud.ces.v1beta.Conversation.ChannelType); + + /** Conversation source. */ + public source: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source); + + /** Conversation inputTypes. */ + public inputTypes: google.cloud.ces.v1beta.Conversation.InputType[]; + + /** Conversation entryAgent. */ + public entryAgent: string; + + /** Conversation deployment. */ + public deployment: string; + + /** Conversation appVersion. */ + public appVersion: string; + + /** Conversation languageCode. */ + public languageCode: string; + + /** Conversation messages. */ + public messages: google.cloud.ces.v1beta.IMessage[]; + + /** + * Creates a new Conversation instance using the specified properties. + * @param [properties] Properties to set + * @returns Conversation instance + */ + public static create(properties?: google.cloud.ces.v1beta.IConversation): google.cloud.ces.v1beta.Conversation; + + /** + * Encodes the specified Conversation message. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.verify|verify} messages. + * @param message Conversation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Conversation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.verify|verify} messages. + * @param message Conversation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Conversation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Conversation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Conversation; + + /** + * Decodes a Conversation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Conversation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Conversation; + + /** + * Verifies a Conversation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Conversation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Conversation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Conversation; + + /** + * Creates a plain object from a Conversation message. Also converts values to other types if specified. + * @param message Conversation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Conversation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Conversation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Conversation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Conversation { + + /** Properties of a Turn. */ + interface ITurn { + + /** Turn messages */ + messages?: (google.cloud.ces.v1beta.IMessage[]|null); + + /** Turn rootSpan */ + rootSpan?: (google.cloud.ces.v1beta.ISpan|null); + } + + /** Represents a Turn. */ + class Turn implements ITurn { + + /** + * Constructs a new Turn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Conversation.ITurn); + + /** Turn messages. */ + public messages: google.cloud.ces.v1beta.IMessage[]; + + /** Turn rootSpan. */ + public rootSpan?: (google.cloud.ces.v1beta.ISpan|null); + + /** + * Creates a new Turn instance using the specified properties. + * @param [properties] Properties to set + * @returns Turn instance + */ + public static create(properties?: google.cloud.ces.v1beta.Conversation.ITurn): google.cloud.ces.v1beta.Conversation.Turn; + + /** + * Encodes the specified Turn message. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.Turn.verify|verify} messages. + * @param message Turn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Conversation.ITurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Turn message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.Turn.verify|verify} messages. + * @param message Turn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Conversation.ITurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Turn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Conversation.Turn; + + /** + * Decodes a Turn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Conversation.Turn; + + /** + * Verifies a Turn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Turn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Turn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Conversation.Turn; + + /** + * Creates a plain object from a Turn message. Also converts values to other types if specified. + * @param message Turn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Conversation.Turn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Turn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Turn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ChannelType enum. */ + enum ChannelType { + CHANNEL_TYPE_UNSPECIFIED = 0, + TEXT = 1, + AUDIO = 2, + MULTIMODAL = 3 + } + + /** Source enum. */ + enum Source { + SOURCE_UNSPECIFIED = 0, + LIVE = 1, + SIMULATOR = 2, + EVAL = 3 + } + + /** InputType enum. */ + enum InputType { + INPUT_TYPE_UNSPECIFIED = 0, + INPUT_TYPE_TEXT = 1, + INPUT_TYPE_AUDIO = 2, + INPUT_TYPE_IMAGE = 3, + INPUT_TYPE_BLOB = 4, + INPUT_TYPE_TOOL_RESPONSE = 5, + INPUT_TYPE_VARIABLES = 6 + } + } + + /** Properties of a Deployment. */ + interface IDeployment { + + /** Deployment name */ + name?: (string|null); + + /** Deployment displayName */ + displayName?: (string|null); + + /** Deployment appVersion */ + appVersion?: (string|null); + + /** Deployment channelProfile */ + channelProfile?: (google.cloud.ces.v1beta.IChannelProfile|null); + + /** Deployment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Deployment updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Deployment etag */ + etag?: (string|null); + } + + /** Represents a Deployment. */ + class Deployment implements IDeployment { + + /** + * Constructs a new Deployment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeployment); + + /** Deployment name. */ + public name: string; + + /** Deployment displayName. */ + public displayName: string; + + /** Deployment appVersion. */ + public appVersion: string; + + /** Deployment channelProfile. */ + public channelProfile?: (google.cloud.ces.v1beta.IChannelProfile|null); + + /** Deployment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Deployment updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Deployment etag. */ + public etag: string; + + /** + * Creates a new Deployment instance using the specified properties. + * @param [properties] Properties to set + * @returns Deployment instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeployment): google.cloud.ces.v1beta.Deployment; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.ces.v1beta.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Deployment; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Deployment; + + /** + * Verifies a Deployment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Deployment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Deployment; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @param message Deployment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Deployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Deployment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Deployment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AggregatedMetrics. */ + interface IAggregatedMetrics { + + /** AggregatedMetrics metricsByAppVersion */ + metricsByAppVersion?: (google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion[]|null); + } + + /** Represents an AggregatedMetrics. */ + class AggregatedMetrics implements IAggregatedMetrics { + + /** + * Constructs a new AggregatedMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IAggregatedMetrics); + + /** AggregatedMetrics metricsByAppVersion. */ + public metricsByAppVersion: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion[]; + + /** + * Creates a new AggregatedMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedMetrics instance + */ + public static create(properties?: google.cloud.ces.v1beta.IAggregatedMetrics): google.cloud.ces.v1beta.AggregatedMetrics; + + /** + * Encodes the specified AggregatedMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.verify|verify} messages. + * @param message AggregatedMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IAggregatedMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.verify|verify} messages. + * @param message AggregatedMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IAggregatedMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics; + + /** + * Decodes an AggregatedMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics; + + /** + * Verifies an AggregatedMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics; + + /** + * Creates a plain object from an AggregatedMetrics message. Also converts values to other types if specified. + * @param message AggregatedMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AggregatedMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AggregatedMetrics { + + /** Properties of a ToolMetrics. */ + interface IToolMetrics { + + /** ToolMetrics tool */ + tool?: (string|null); + + /** ToolMetrics passCount */ + passCount?: (number|null); + + /** ToolMetrics failCount */ + failCount?: (number|null); + } + + /** Represents a ToolMetrics. */ + class ToolMetrics implements IToolMetrics { + + /** + * Constructs a new ToolMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics); + + /** ToolMetrics tool. */ + public tool: string; + + /** ToolMetrics passCount. */ + public passCount: number; + + /** ToolMetrics failCount. */ + public failCount: number; + + /** + * Creates a new ToolMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolMetrics instance + */ + public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics): google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics; + + /** + * Encodes the specified ToolMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.verify|verify} messages. + * @param message ToolMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.verify|verify} messages. + * @param message ToolMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics; + + /** + * Decodes a ToolMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics; + + /** + * Verifies a ToolMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics; + + /** + * Creates a plain object from a ToolMetrics message. Also converts values to other types if specified. + * @param message ToolMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TurnLatencyMetrics. */ + interface ITurnLatencyMetrics { + + /** TurnLatencyMetrics averageLatency */ + averageLatency?: (google.protobuf.IDuration|null); + } + + /** Represents a TurnLatencyMetrics. */ + class TurnLatencyMetrics implements ITurnLatencyMetrics { + + /** + * Constructs a new TurnLatencyMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics); + + /** TurnLatencyMetrics averageLatency. */ + public averageLatency?: (google.protobuf.IDuration|null); + + /** + * Creates a new TurnLatencyMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns TurnLatencyMetrics instance + */ + public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics): google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics; + + /** + * Encodes the specified TurnLatencyMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.verify|verify} messages. + * @param message TurnLatencyMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TurnLatencyMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.verify|verify} messages. + * @param message TurnLatencyMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TurnLatencyMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TurnLatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics; + + /** + * Decodes a TurnLatencyMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TurnLatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics; + + /** + * Verifies a TurnLatencyMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TurnLatencyMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TurnLatencyMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics; + + /** + * Creates a plain object from a TurnLatencyMetrics message. Also converts values to other types if specified. + * @param message TurnLatencyMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TurnLatencyMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TurnLatencyMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolCallLatencyMetrics. */ + interface IToolCallLatencyMetrics { + + /** ToolCallLatencyMetrics tool */ + tool?: (string|null); + + /** ToolCallLatencyMetrics averageLatency */ + averageLatency?: (google.protobuf.IDuration|null); + } + + /** Represents a ToolCallLatencyMetrics. */ + class ToolCallLatencyMetrics implements IToolCallLatencyMetrics { + + /** + * Constructs a new ToolCallLatencyMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics); + + /** ToolCallLatencyMetrics tool. */ + public tool: string; + + /** ToolCallLatencyMetrics averageLatency. */ + public averageLatency?: (google.protobuf.IDuration|null); + + /** + * Creates a new ToolCallLatencyMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolCallLatencyMetrics instance + */ + public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics): google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics; + + /** + * Encodes the specified ToolCallLatencyMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.verify|verify} messages. + * @param message ToolCallLatencyMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolCallLatencyMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.verify|verify} messages. + * @param message ToolCallLatencyMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolCallLatencyMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolCallLatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics; + + /** + * Decodes a ToolCallLatencyMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolCallLatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics; + + /** + * Verifies a ToolCallLatencyMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolCallLatencyMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolCallLatencyMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics; + + /** + * Creates a plain object from a ToolCallLatencyMetrics message. Also converts values to other types if specified. + * @param message ToolCallLatencyMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolCallLatencyMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolCallLatencyMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticSimilarityMetrics. */ + interface ISemanticSimilarityMetrics { + + /** SemanticSimilarityMetrics score */ + score?: (number|null); + } + + /** Represents a SemanticSimilarityMetrics. */ + class SemanticSimilarityMetrics implements ISemanticSimilarityMetrics { + + /** + * Constructs a new SemanticSimilarityMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics); + + /** SemanticSimilarityMetrics score. */ + public score: number; + + /** + * Creates a new SemanticSimilarityMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticSimilarityMetrics instance + */ + public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics): google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics; + + /** + * Encodes the specified SemanticSimilarityMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.verify|verify} messages. + * @param message SemanticSimilarityMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SemanticSimilarityMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.verify|verify} messages. + * @param message SemanticSimilarityMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticSimilarityMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SemanticSimilarityMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics; + + /** + * Decodes a SemanticSimilarityMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SemanticSimilarityMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics; + + /** + * Verifies a SemanticSimilarityMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SemanticSimilarityMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SemanticSimilarityMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics; + + /** + * Creates a plain object from a SemanticSimilarityMetrics message. Also converts values to other types if specified. + * @param message SemanticSimilarityMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SemanticSimilarityMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SemanticSimilarityMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HallucinationMetrics. */ + interface IHallucinationMetrics { + + /** HallucinationMetrics score */ + score?: (number|null); + } + + /** Represents a HallucinationMetrics. */ + class HallucinationMetrics implements IHallucinationMetrics { + + /** + * Constructs a new HallucinationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics); + + /** HallucinationMetrics score. */ + public score: number; + + /** + * Creates a new HallucinationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns HallucinationMetrics instance + */ + public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics): google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics; + + /** + * Encodes the specified HallucinationMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.verify|verify} messages. + * @param message HallucinationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HallucinationMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.verify|verify} messages. + * @param message HallucinationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HallucinationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HallucinationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics; + + /** + * Decodes a HallucinationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HallucinationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics; + + /** + * Verifies a HallucinationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HallucinationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HallucinationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics; + + /** + * Creates a plain object from a HallucinationMetrics message. Also converts values to other types if specified. + * @param message HallucinationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HallucinationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HallucinationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetricsByAppVersion. */ + interface IMetricsByAppVersion { + + /** MetricsByAppVersion appVersionId */ + appVersionId?: (string|null); + + /** MetricsByAppVersion toolMetrics */ + toolMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics[]|null); + + /** MetricsByAppVersion semanticSimilarityMetrics */ + semanticSimilarityMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics[]|null); + + /** MetricsByAppVersion hallucinationMetrics */ + hallucinationMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics[]|null); + + /** MetricsByAppVersion toolCallLatencyMetrics */ + toolCallLatencyMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics[]|null); + + /** MetricsByAppVersion turnLatencyMetrics */ + turnLatencyMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics[]|null); + + /** MetricsByAppVersion passCount */ + passCount?: (number|null); + + /** MetricsByAppVersion failCount */ + failCount?: (number|null); + + /** MetricsByAppVersion metricsByTurn */ + metricsByTurn?: (google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn[]|null); + } + + /** Represents a MetricsByAppVersion. */ + class MetricsByAppVersion implements IMetricsByAppVersion { + + /** + * Constructs a new MetricsByAppVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion); + + /** MetricsByAppVersion appVersionId. */ + public appVersionId: string; + + /** MetricsByAppVersion toolMetrics. */ + public toolMetrics: google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics[]; + + /** MetricsByAppVersion semanticSimilarityMetrics. */ + public semanticSimilarityMetrics: google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics[]; + + /** MetricsByAppVersion hallucinationMetrics. */ + public hallucinationMetrics: google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics[]; + + /** MetricsByAppVersion toolCallLatencyMetrics. */ + public toolCallLatencyMetrics: google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics[]; + + /** MetricsByAppVersion turnLatencyMetrics. */ + public turnLatencyMetrics: google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics[]; + + /** MetricsByAppVersion passCount. */ + public passCount: number; + + /** MetricsByAppVersion failCount. */ + public failCount: number; + + /** MetricsByAppVersion metricsByTurn. */ + public metricsByTurn: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn[]; + + /** + * Creates a new MetricsByAppVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricsByAppVersion instance + */ + public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion; + + /** + * Encodes the specified MetricsByAppVersion message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.verify|verify} messages. + * @param message MetricsByAppVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricsByAppVersion message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.verify|verify} messages. + * @param message MetricsByAppVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricsByAppVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricsByAppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion; + + /** + * Decodes a MetricsByAppVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricsByAppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion; + + /** + * Verifies a MetricsByAppVersion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetricsByAppVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricsByAppVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion; + + /** + * Creates a plain object from a MetricsByAppVersion message. Also converts values to other types if specified. + * @param message MetricsByAppVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricsByAppVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricsByAppVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetricsByTurn. */ + interface IMetricsByTurn { + + /** MetricsByTurn turnIndex */ + turnIndex?: (number|null); + + /** MetricsByTurn toolMetrics */ + toolMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics[]|null); + + /** MetricsByTurn semanticSimilarityMetrics */ + semanticSimilarityMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics[]|null); + + /** MetricsByTurn hallucinationMetrics */ + hallucinationMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics[]|null); + + /** MetricsByTurn toolCallLatencyMetrics */ + toolCallLatencyMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics[]|null); + + /** MetricsByTurn turnLatencyMetrics */ + turnLatencyMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics[]|null); + } + + /** Represents a MetricsByTurn. */ + class MetricsByTurn implements IMetricsByTurn { + + /** + * Constructs a new MetricsByTurn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn); + + /** MetricsByTurn turnIndex. */ + public turnIndex: number; + + /** MetricsByTurn toolMetrics. */ + public toolMetrics: google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics[]; + + /** MetricsByTurn semanticSimilarityMetrics. */ + public semanticSimilarityMetrics: google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics[]; + + /** MetricsByTurn hallucinationMetrics. */ + public hallucinationMetrics: google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics[]; + + /** MetricsByTurn toolCallLatencyMetrics. */ + public toolCallLatencyMetrics: google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics[]; + + /** MetricsByTurn turnLatencyMetrics. */ + public turnLatencyMetrics: google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics[]; + + /** + * Creates a new MetricsByTurn instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricsByTurn instance + */ + public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn; + + /** + * Encodes the specified MetricsByTurn message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.verify|verify} messages. + * @param message MetricsByTurn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricsByTurn message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.verify|verify} messages. + * @param message MetricsByTurn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricsByTurn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricsByTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn; + + /** + * Decodes a MetricsByTurn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricsByTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn; + + /** + * Verifies a MetricsByTurn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetricsByTurn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricsByTurn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn; + + /** + * Creates a plain object from a MetricsByTurn message. Also converts values to other types if specified. + * @param message MetricsByTurn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricsByTurn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricsByTurn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an Evaluation. */ + interface IEvaluation { + + /** Evaluation golden */ + golden?: (google.cloud.ces.v1beta.Evaluation.IGolden|null); + + /** Evaluation scenario */ + scenario?: (google.cloud.ces.v1beta.Evaluation.IScenario|null); + + /** Evaluation name */ + name?: (string|null); + + /** Evaluation displayName */ + displayName?: (string|null); + + /** Evaluation description */ + description?: (string|null); + + /** Evaluation tags */ + tags?: (string[]|null); + + /** Evaluation evaluationDatasets */ + evaluationDatasets?: (string[]|null); + + /** Evaluation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Evaluation createdBy */ + createdBy?: (string|null); + + /** Evaluation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Evaluation lastUpdatedBy */ + lastUpdatedBy?: (string|null); + + /** Evaluation evaluationRuns */ + evaluationRuns?: (string[]|null); + + /** Evaluation etag */ + etag?: (string|null); + + /** Evaluation aggregatedMetrics */ + aggregatedMetrics?: (google.cloud.ces.v1beta.IAggregatedMetrics|null); + + /** Evaluation lastCompletedResult */ + lastCompletedResult?: (google.cloud.ces.v1beta.IEvaluationResult|null); + + /** Evaluation invalid */ + invalid?: (boolean|null); + + /** Evaluation lastTenResults */ + lastTenResults?: (google.cloud.ces.v1beta.IEvaluationResult[]|null); + } + + /** Represents an Evaluation. */ + class Evaluation implements IEvaluation { + + /** + * Constructs a new Evaluation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluation); + + /** Evaluation golden. */ + public golden?: (google.cloud.ces.v1beta.Evaluation.IGolden|null); + + /** Evaluation scenario. */ + public scenario?: (google.cloud.ces.v1beta.Evaluation.IScenario|null); + + /** Evaluation name. */ + public name: string; + + /** Evaluation displayName. */ + public displayName: string; + + /** Evaluation description. */ + public description: string; + + /** Evaluation tags. */ + public tags: string[]; + + /** Evaluation evaluationDatasets. */ + public evaluationDatasets: string[]; + + /** Evaluation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Evaluation createdBy. */ + public createdBy: string; + + /** Evaluation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Evaluation lastUpdatedBy. */ + public lastUpdatedBy: string; + + /** Evaluation evaluationRuns. */ + public evaluationRuns: string[]; + + /** Evaluation etag. */ + public etag: string; + + /** Evaluation aggregatedMetrics. */ + public aggregatedMetrics?: (google.cloud.ces.v1beta.IAggregatedMetrics|null); + + /** Evaluation lastCompletedResult. */ + public lastCompletedResult?: (google.cloud.ces.v1beta.IEvaluationResult|null); + + /** Evaluation invalid. */ + public invalid: boolean; + + /** Evaluation lastTenResults. */ + public lastTenResults: google.cloud.ces.v1beta.IEvaluationResult[]; + + /** Evaluation inputs. */ + public inputs?: ("golden"|"scenario"); + + /** + * Creates a new Evaluation instance using the specified properties. + * @param [properties] Properties to set + * @returns Evaluation instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluation): google.cloud.ces.v1beta.Evaluation; + + /** + * Encodes the specified Evaluation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.verify|verify} messages. + * @param message Evaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Evaluation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.verify|verify} messages. + * @param message Evaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Evaluation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Evaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation; + + /** + * Decodes an Evaluation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Evaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation; + + /** + * Verifies an Evaluation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Evaluation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Evaluation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation; + + /** + * Creates a plain object from an Evaluation message. Also converts values to other types if specified. + * @param message Evaluation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Evaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Evaluation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Evaluation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Evaluation { + + /** Properties of a GoldenExpectation. */ + interface IGoldenExpectation { + + /** GoldenExpectation toolCall */ + toolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** GoldenExpectation toolResponse */ + toolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** GoldenExpectation agentResponse */ + agentResponse?: (google.cloud.ces.v1beta.IMessage|null); + + /** GoldenExpectation agentTransfer */ + agentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); + + /** GoldenExpectation updatedVariables */ + updatedVariables?: (google.protobuf.IStruct|null); + + /** GoldenExpectation mockToolResponse */ + mockToolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** GoldenExpectation note */ + note?: (string|null); + } + + /** Represents a GoldenExpectation. */ + class GoldenExpectation implements IGoldenExpectation { + + /** + * Constructs a new GoldenExpectation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Evaluation.IGoldenExpectation); + + /** GoldenExpectation toolCall. */ + public toolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** GoldenExpectation toolResponse. */ + public toolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** GoldenExpectation agentResponse. */ + public agentResponse?: (google.cloud.ces.v1beta.IMessage|null); + + /** GoldenExpectation agentTransfer. */ + public agentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); + + /** GoldenExpectation updatedVariables. */ + public updatedVariables?: (google.protobuf.IStruct|null); + + /** GoldenExpectation mockToolResponse. */ + public mockToolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** GoldenExpectation note. */ + public note: string; + + /** GoldenExpectation condition. */ + public condition?: ("toolCall"|"toolResponse"|"agentResponse"|"agentTransfer"|"updatedVariables"|"mockToolResponse"); + + /** + * Creates a new GoldenExpectation instance using the specified properties. + * @param [properties] Properties to set + * @returns GoldenExpectation instance + */ + public static create(properties?: google.cloud.ces.v1beta.Evaluation.IGoldenExpectation): google.cloud.ces.v1beta.Evaluation.GoldenExpectation; + + /** + * Encodes the specified GoldenExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenExpectation.verify|verify} messages. + * @param message GoldenExpectation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Evaluation.IGoldenExpectation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoldenExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenExpectation.verify|verify} messages. + * @param message GoldenExpectation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.IGoldenExpectation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoldenExpectation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoldenExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.GoldenExpectation; + + /** + * Decodes a GoldenExpectation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoldenExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.GoldenExpectation; + + /** + * Verifies a GoldenExpectation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoldenExpectation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoldenExpectation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.GoldenExpectation; + + /** + * Creates a plain object from a GoldenExpectation message. Also converts values to other types if specified. + * @param message GoldenExpectation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Evaluation.GoldenExpectation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoldenExpectation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoldenExpectation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Step. */ + interface IStep { + + /** Step userInput */ + userInput?: (google.cloud.ces.v1beta.ISessionInput|null); + + /** Step agentTransfer */ + agentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); + + /** Step expectation */ + expectation?: (google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null); + } + + /** Represents a Step. */ + class Step implements IStep { + + /** + * Constructs a new Step. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Evaluation.IStep); + + /** Step userInput. */ + public userInput?: (google.cloud.ces.v1beta.ISessionInput|null); + + /** Step agentTransfer. */ + public agentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); + + /** Step expectation. */ + public expectation?: (google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null); + + /** Step step. */ + public step?: ("userInput"|"agentTransfer"|"expectation"); + + /** + * Creates a new Step instance using the specified properties. + * @param [properties] Properties to set + * @returns Step instance + */ + public static create(properties?: google.cloud.ces.v1beta.Evaluation.IStep): google.cloud.ces.v1beta.Evaluation.Step; + + /** + * Encodes the specified Step message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Step.verify|verify} messages. + * @param message Step message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Evaluation.IStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Step message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Step.verify|verify} messages. + * @param message Step message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.IStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Step message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Step + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.Step; + + /** + * Decodes a Step message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Step + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.Step; + + /** + * Verifies a Step message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Step message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Step + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.Step; + + /** + * Creates a plain object from a Step message. Also converts values to other types if specified. + * @param message Step + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Evaluation.Step, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Step to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Step + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoldenTurn. */ + interface IGoldenTurn { + + /** GoldenTurn steps */ + steps?: (google.cloud.ces.v1beta.Evaluation.IStep[]|null); + + /** GoldenTurn rootSpan */ + rootSpan?: (google.cloud.ces.v1beta.ISpan|null); + } + + /** Represents a GoldenTurn. */ + class GoldenTurn implements IGoldenTurn { + + /** + * Constructs a new GoldenTurn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Evaluation.IGoldenTurn); + + /** GoldenTurn steps. */ + public steps: google.cloud.ces.v1beta.Evaluation.IStep[]; + + /** GoldenTurn rootSpan. */ + public rootSpan?: (google.cloud.ces.v1beta.ISpan|null); + + /** + * Creates a new GoldenTurn instance using the specified properties. + * @param [properties] Properties to set + * @returns GoldenTurn instance + */ + public static create(properties?: google.cloud.ces.v1beta.Evaluation.IGoldenTurn): google.cloud.ces.v1beta.Evaluation.GoldenTurn; + + /** + * Encodes the specified GoldenTurn message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenTurn.verify|verify} messages. + * @param message GoldenTurn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Evaluation.IGoldenTurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoldenTurn message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenTurn.verify|verify} messages. + * @param message GoldenTurn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.IGoldenTurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoldenTurn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoldenTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.GoldenTurn; + + /** + * Decodes a GoldenTurn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoldenTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.GoldenTurn; + + /** + * Verifies a GoldenTurn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoldenTurn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoldenTurn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.GoldenTurn; + + /** + * Creates a plain object from a GoldenTurn message. Also converts values to other types if specified. + * @param message GoldenTurn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Evaluation.GoldenTurn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoldenTurn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoldenTurn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Golden. */ + interface IGolden { + + /** Golden turns */ + turns?: (google.cloud.ces.v1beta.Evaluation.IGoldenTurn[]|null); + + /** Golden evaluationExpectations */ + evaluationExpectations?: (string[]|null); + } + + /** Represents a Golden. */ + class Golden implements IGolden { + + /** + * Constructs a new Golden. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Evaluation.IGolden); + + /** Golden turns. */ + public turns: google.cloud.ces.v1beta.Evaluation.IGoldenTurn[]; + + /** Golden evaluationExpectations. */ + public evaluationExpectations: string[]; + + /** + * Creates a new Golden instance using the specified properties. + * @param [properties] Properties to set + * @returns Golden instance + */ + public static create(properties?: google.cloud.ces.v1beta.Evaluation.IGolden): google.cloud.ces.v1beta.Evaluation.Golden; + + /** + * Encodes the specified Golden message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Golden.verify|verify} messages. + * @param message Golden message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Evaluation.IGolden, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Golden message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Golden.verify|verify} messages. + * @param message Golden message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.IGolden, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Golden message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Golden + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.Golden; + + /** + * Decodes a Golden message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Golden + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.Golden; + + /** + * Verifies a Golden message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Golden message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Golden + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.Golden; + + /** + * Creates a plain object from a Golden message. Also converts values to other types if specified. + * @param message Golden + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Evaluation.Golden, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Golden to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Golden + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScenarioExpectation. */ + interface IScenarioExpectation { + + /** ScenarioExpectation toolExpectation */ + toolExpectation?: (google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation|null); + + /** ScenarioExpectation agentResponse */ + agentResponse?: (google.cloud.ces.v1beta.IMessage|null); + } + + /** Represents a ScenarioExpectation. */ + class ScenarioExpectation implements IScenarioExpectation { + + /** + * Constructs a new ScenarioExpectation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Evaluation.IScenarioExpectation); + + /** ScenarioExpectation toolExpectation. */ + public toolExpectation?: (google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation|null); + + /** ScenarioExpectation agentResponse. */ + public agentResponse?: (google.cloud.ces.v1beta.IMessage|null); + + /** ScenarioExpectation expectation. */ + public expectation?: ("toolExpectation"|"agentResponse"); + + /** + * Creates a new ScenarioExpectation instance using the specified properties. + * @param [properties] Properties to set + * @returns ScenarioExpectation instance + */ + public static create(properties?: google.cloud.ces.v1beta.Evaluation.IScenarioExpectation): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation; + + /** + * Encodes the specified ScenarioExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.verify|verify} messages. + * @param message ScenarioExpectation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Evaluation.IScenarioExpectation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScenarioExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.verify|verify} messages. + * @param message ScenarioExpectation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.IScenarioExpectation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScenarioExpectation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScenarioExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation; + + /** + * Decodes a ScenarioExpectation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScenarioExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation; + + /** + * Verifies a ScenarioExpectation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScenarioExpectation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScenarioExpectation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation; + + /** + * Creates a plain object from a ScenarioExpectation message. Also converts values to other types if specified. + * @param message ScenarioExpectation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Evaluation.ScenarioExpectation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScenarioExpectation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScenarioExpectation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScenarioExpectation { + + /** Properties of a ToolExpectation. */ + interface IToolExpectation { + + /** ToolExpectation expectedToolCall */ + expectedToolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** ToolExpectation mockToolResponse */ + mockToolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + } + + /** Represents a ToolExpectation. */ + class ToolExpectation implements IToolExpectation { + + /** + * Constructs a new ToolExpectation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation); + + /** ToolExpectation expectedToolCall. */ + public expectedToolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** ToolExpectation mockToolResponse. */ + public mockToolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** + * Creates a new ToolExpectation instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolExpectation instance + */ + public static create(properties?: google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation; + + /** + * Encodes the specified ToolExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.verify|verify} messages. + * @param message ToolExpectation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.verify|verify} messages. + * @param message ToolExpectation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolExpectation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation; + + /** + * Decodes a ToolExpectation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation; + + /** + * Verifies a ToolExpectation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolExpectation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolExpectation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation; + + /** + * Creates a plain object from a ToolExpectation message. Also converts values to other types if specified. + * @param message ToolExpectation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolExpectation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolExpectation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Scenario. */ + interface IScenario { + + /** Scenario task */ + task?: (string|null); + + /** Scenario userFacts */ + userFacts?: (google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact[]|null); + + /** Scenario maxTurns */ + maxTurns?: (number|null); + + /** Scenario rubrics */ + rubrics?: (string[]|null); + + /** Scenario scenarioExpectations */ + scenarioExpectations?: (google.cloud.ces.v1beta.Evaluation.IScenarioExpectation[]|null); + + /** Scenario variableOverrides */ + variableOverrides?: (google.protobuf.IStruct|null); + + /** Scenario taskCompletionBehavior */ + taskCompletionBehavior?: (google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior|keyof typeof google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior|null); + + /** Scenario userGoalBehavior */ + userGoalBehavior?: (google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior|keyof typeof google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior|null); + + /** Scenario evaluationExpectations */ + evaluationExpectations?: (string[]|null); + } + + /** Represents a Scenario. */ + class Scenario implements IScenario { + + /** + * Constructs a new Scenario. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Evaluation.IScenario); + + /** Scenario task. */ + public task: string; + + /** Scenario userFacts. */ + public userFacts: google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact[]; + + /** Scenario maxTurns. */ + public maxTurns: number; + + /** Scenario rubrics. */ + public rubrics: string[]; + + /** Scenario scenarioExpectations. */ + public scenarioExpectations: google.cloud.ces.v1beta.Evaluation.IScenarioExpectation[]; + + /** Scenario variableOverrides. */ + public variableOverrides?: (google.protobuf.IStruct|null); + + /** Scenario taskCompletionBehavior. */ + public taskCompletionBehavior: (google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior|keyof typeof google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior); + + /** Scenario userGoalBehavior. */ + public userGoalBehavior: (google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior|keyof typeof google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior); + + /** Scenario evaluationExpectations. */ + public evaluationExpectations: string[]; + + /** + * Creates a new Scenario instance using the specified properties. + * @param [properties] Properties to set + * @returns Scenario instance + */ + public static create(properties?: google.cloud.ces.v1beta.Evaluation.IScenario): google.cloud.ces.v1beta.Evaluation.Scenario; + + /** + * Encodes the specified Scenario message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.verify|verify} messages. + * @param message Scenario message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Evaluation.IScenario, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Scenario message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.verify|verify} messages. + * @param message Scenario message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.IScenario, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Scenario message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Scenario + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.Scenario; + + /** + * Decodes a Scenario message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Scenario + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.Scenario; + + /** + * Verifies a Scenario message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Scenario message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Scenario + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.Scenario; + + /** + * Creates a plain object from a Scenario message. Also converts values to other types if specified. + * @param message Scenario + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Evaluation.Scenario, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Scenario to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Scenario + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Scenario { + + /** Properties of a UserFact. */ + interface IUserFact { + + /** UserFact name */ + name?: (string|null); + + /** UserFact value */ + value?: (string|null); + } + + /** Represents a UserFact. */ + class UserFact implements IUserFact { + + /** + * Constructs a new UserFact. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact); + + /** UserFact name. */ + public name: string; + + /** UserFact value. */ + public value: string; + + /** + * Creates a new UserFact instance using the specified properties. + * @param [properties] Properties to set + * @returns UserFact instance + */ + public static create(properties?: google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact): google.cloud.ces.v1beta.Evaluation.Scenario.UserFact; + + /** + * Encodes the specified UserFact message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.verify|verify} messages. + * @param message UserFact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserFact message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.verify|verify} messages. + * @param message UserFact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserFact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserFact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.Scenario.UserFact; + + /** + * Decodes a UserFact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserFact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.Scenario.UserFact; + + /** + * Verifies a UserFact message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserFact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserFact + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.Scenario.UserFact; + + /** + * Creates a plain object from a UserFact message. Also converts values to other types if specified. + * @param message UserFact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Evaluation.Scenario.UserFact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserFact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserFact + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** TaskCompletionBehavior enum. */ + enum TaskCompletionBehavior { + TASK_COMPLETION_BEHAVIOR_UNSPECIFIED = 0, + TASK_SATISFIED = 1, + TASK_REJECTED = 2 + } + + /** UserGoalBehavior enum. */ + enum UserGoalBehavior { + USER_GOAL_BEHAVIOR_UNSPECIFIED = 0, + USER_GOAL_SATISFIED = 1, + USER_GOAL_REJECTED = 2, + USER_GOAL_IGNORED = 3 + } + } + } + + /** Properties of an EvaluationDataset. */ + interface IEvaluationDataset { + + /** EvaluationDataset name */ + name?: (string|null); + + /** EvaluationDataset displayName */ + displayName?: (string|null); + + /** EvaluationDataset evaluations */ + evaluations?: (string[]|null); + + /** EvaluationDataset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationDataset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationDataset etag */ + etag?: (string|null); + + /** EvaluationDataset createdBy */ + createdBy?: (string|null); + + /** EvaluationDataset lastUpdatedBy */ + lastUpdatedBy?: (string|null); + + /** EvaluationDataset aggregatedMetrics */ + aggregatedMetrics?: (google.cloud.ces.v1beta.IAggregatedMetrics|null); + } + + /** Represents an EvaluationDataset. */ + class EvaluationDataset implements IEvaluationDataset { + + /** + * Constructs a new EvaluationDataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluationDataset); + + /** EvaluationDataset name. */ + public name: string; + + /** EvaluationDataset displayName. */ + public displayName: string; + + /** EvaluationDataset evaluations. */ + public evaluations: string[]; + + /** EvaluationDataset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationDataset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationDataset etag. */ + public etag: string; + + /** EvaluationDataset createdBy. */ + public createdBy: string; + + /** EvaluationDataset lastUpdatedBy. */ + public lastUpdatedBy: string; + + /** EvaluationDataset aggregatedMetrics. */ + public aggregatedMetrics?: (google.cloud.ces.v1beta.IAggregatedMetrics|null); + + /** + * Creates a new EvaluationDataset instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationDataset instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluationDataset): google.cloud.ces.v1beta.EvaluationDataset; + + /** + * Encodes the specified EvaluationDataset message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationDataset.verify|verify} messages. + * @param message EvaluationDataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluationDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationDataset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationDataset.verify|verify} messages. + * @param message EvaluationDataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationDataset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationDataset; + + /** + * Decodes an EvaluationDataset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationDataset; + + /** + * Verifies an EvaluationDataset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationDataset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationDataset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationDataset; + + /** + * Creates a plain object from an EvaluationDataset message. Also converts values to other types if specified. + * @param message EvaluationDataset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationDataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationDataset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationDataset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluationResult. */ + interface IEvaluationResult { + + /** EvaluationResult goldenResult */ + goldenResult?: (google.cloud.ces.v1beta.EvaluationResult.IGoldenResult|null); + + /** EvaluationResult scenarioResult */ + scenarioResult?: (google.cloud.ces.v1beta.EvaluationResult.IScenarioResult|null); + + /** EvaluationResult name */ + name?: (string|null); + + /** EvaluationResult displayName */ + displayName?: (string|null); + + /** EvaluationResult createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationResult evaluationStatus */ + evaluationStatus?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); + + /** EvaluationResult evaluationRun */ + evaluationRun?: (string|null); + + /** EvaluationResult persona */ + persona?: (google.cloud.ces.v1beta.IEvaluationPersona|null); + + /** EvaluationResult errorInfo */ + errorInfo?: (google.cloud.ces.v1beta.IEvaluationErrorInfo|null); + + /** EvaluationResult error */ + error?: (google.rpc.IStatus|null); + + /** EvaluationResult initiatedBy */ + initiatedBy?: (string|null); + + /** EvaluationResult appVersion */ + appVersion?: (string|null); + + /** EvaluationResult appVersionDisplayName */ + appVersionDisplayName?: (string|null); + + /** EvaluationResult changelog */ + changelog?: (string|null); + + /** EvaluationResult changelogCreateTime */ + changelogCreateTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationResult executionState */ + executionState?: (google.cloud.ces.v1beta.EvaluationResult.ExecutionState|keyof typeof google.cloud.ces.v1beta.EvaluationResult.ExecutionState|null); + + /** EvaluationResult evaluationMetricsThresholds */ + evaluationMetricsThresholds?: (google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null); + + /** EvaluationResult config */ + config?: (google.cloud.ces.v1beta.IEvaluationConfig|null); + + /** EvaluationResult goldenRunMethod */ + goldenRunMethod?: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod|null); + } + + /** Represents an EvaluationResult. */ + class EvaluationResult implements IEvaluationResult { + + /** + * Constructs a new EvaluationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluationResult); + + /** EvaluationResult goldenResult. */ + public goldenResult?: (google.cloud.ces.v1beta.EvaluationResult.IGoldenResult|null); + + /** EvaluationResult scenarioResult. */ + public scenarioResult?: (google.cloud.ces.v1beta.EvaluationResult.IScenarioResult|null); + + /** EvaluationResult name. */ + public name: string; + + /** EvaluationResult displayName. */ + public displayName: string; + + /** EvaluationResult createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationResult evaluationStatus. */ + public evaluationStatus: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); + + /** EvaluationResult evaluationRun. */ + public evaluationRun: string; + + /** EvaluationResult persona. */ + public persona?: (google.cloud.ces.v1beta.IEvaluationPersona|null); + + /** EvaluationResult errorInfo. */ + public errorInfo?: (google.cloud.ces.v1beta.IEvaluationErrorInfo|null); + + /** EvaluationResult error. */ + public error?: (google.rpc.IStatus|null); + + /** EvaluationResult initiatedBy. */ + public initiatedBy: string; + + /** EvaluationResult appVersion. */ + public appVersion: string; + + /** EvaluationResult appVersionDisplayName. */ + public appVersionDisplayName: string; + + /** EvaluationResult changelog. */ + public changelog: string; + + /** EvaluationResult changelogCreateTime. */ + public changelogCreateTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationResult executionState. */ + public executionState: (google.cloud.ces.v1beta.EvaluationResult.ExecutionState|keyof typeof google.cloud.ces.v1beta.EvaluationResult.ExecutionState); + + /** EvaluationResult evaluationMetricsThresholds. */ + public evaluationMetricsThresholds?: (google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null); + + /** EvaluationResult config. */ + public config?: (google.cloud.ces.v1beta.IEvaluationConfig|null); + + /** EvaluationResult goldenRunMethod. */ + public goldenRunMethod: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod); + + /** EvaluationResult result. */ + public result?: ("goldenResult"|"scenarioResult"); + + /** + * Creates a new EvaluationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluationResult): google.cloud.ces.v1beta.EvaluationResult; + + /** + * Encodes the specified EvaluationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.verify|verify} messages. + * @param message EvaluationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.verify|verify} messages. + * @param message EvaluationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult; + + /** + * Decodes an EvaluationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult; + + /** + * Verifies an EvaluationResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult; + + /** + * Creates a plain object from an EvaluationResult message. Also converts values to other types if specified. + * @param message EvaluationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EvaluationResult { + + /** Properties of a GoldenExpectationOutcome. */ + interface IGoldenExpectationOutcome { + + /** GoldenExpectationOutcome observedToolCall */ + observedToolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** GoldenExpectationOutcome observedToolResponse */ + observedToolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** GoldenExpectationOutcome observedAgentResponse */ + observedAgentResponse?: (google.cloud.ces.v1beta.IMessage|null); + + /** GoldenExpectationOutcome observedAgentTransfer */ + observedAgentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); + + /** GoldenExpectationOutcome expectation */ + expectation?: (google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null); + + /** GoldenExpectationOutcome outcome */ + outcome?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); + + /** GoldenExpectationOutcome semanticSimilarityResult */ + semanticSimilarityResult?: (google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null); + + /** GoldenExpectationOutcome toolInvocationResult */ + toolInvocationResult?: (google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult|null); + } + + /** Represents a GoldenExpectationOutcome. */ + class GoldenExpectationOutcome implements IGoldenExpectationOutcome { + + /** + * Constructs a new GoldenExpectationOutcome. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome); + + /** GoldenExpectationOutcome observedToolCall. */ + public observedToolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** GoldenExpectationOutcome observedToolResponse. */ + public observedToolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** GoldenExpectationOutcome observedAgentResponse. */ + public observedAgentResponse?: (google.cloud.ces.v1beta.IMessage|null); + + /** GoldenExpectationOutcome observedAgentTransfer. */ + public observedAgentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); + + /** GoldenExpectationOutcome expectation. */ + public expectation?: (google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null); + + /** GoldenExpectationOutcome outcome. */ + public outcome: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); + + /** GoldenExpectationOutcome semanticSimilarityResult. */ + public semanticSimilarityResult?: (google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null); + + /** GoldenExpectationOutcome toolInvocationResult. */ + public toolInvocationResult?: (google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult|null); + + /** GoldenExpectationOutcome result. */ + public result?: ("observedToolCall"|"observedToolResponse"|"observedAgentResponse"|"observedAgentTransfer"); + + /** + * Creates a new GoldenExpectationOutcome instance using the specified properties. + * @param [properties] Properties to set + * @returns GoldenExpectationOutcome instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome; + + /** + * Encodes the specified GoldenExpectationOutcome message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.verify|verify} messages. + * @param message GoldenExpectationOutcome message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoldenExpectationOutcome message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.verify|verify} messages. + * @param message GoldenExpectationOutcome message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoldenExpectationOutcome message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoldenExpectationOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome; + + /** + * Decodes a GoldenExpectationOutcome message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoldenExpectationOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome; + + /** + * Verifies a GoldenExpectationOutcome message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoldenExpectationOutcome message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoldenExpectationOutcome + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome; + + /** + * Creates a plain object from a GoldenExpectationOutcome message. Also converts values to other types if specified. + * @param message GoldenExpectationOutcome + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoldenExpectationOutcome to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoldenExpectationOutcome + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GoldenExpectationOutcome { + + /** Properties of a ToolInvocationResult. */ + interface IToolInvocationResult { + + /** ToolInvocationResult parameterCorrectnessScore */ + parameterCorrectnessScore?: (number|null); + + /** ToolInvocationResult outcome */ + outcome?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); + + /** ToolInvocationResult explanation */ + explanation?: (string|null); + } + + /** Represents a ToolInvocationResult. */ + class ToolInvocationResult implements IToolInvocationResult { + + /** + * Constructs a new ToolInvocationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult); + + /** ToolInvocationResult parameterCorrectnessScore. */ + public parameterCorrectnessScore?: (number|null); + + /** ToolInvocationResult outcome. */ + public outcome: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); + + /** ToolInvocationResult explanation. */ + public explanation: string; + + /** + * Creates a new ToolInvocationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolInvocationResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult; + + /** + * Encodes the specified ToolInvocationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.verify|verify} messages. + * @param message ToolInvocationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolInvocationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.verify|verify} messages. + * @param message ToolInvocationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolInvocationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolInvocationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult; + + /** + * Decodes a ToolInvocationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolInvocationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult; + + /** + * Verifies a ToolInvocationResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolInvocationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolInvocationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult; + + /** + * Creates a plain object from a ToolInvocationResult message. Also converts values to other types if specified. + * @param message ToolInvocationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolInvocationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolInvocationResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EvaluationExpectationResult. */ + interface IEvaluationExpectationResult { + + /** EvaluationExpectationResult evaluationExpectation */ + evaluationExpectation?: (string|null); + + /** EvaluationExpectationResult prompt */ + prompt?: (string|null); + + /** EvaluationExpectationResult outcome */ + outcome?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); + + /** EvaluationExpectationResult explanation */ + explanation?: (string|null); + } + + /** Represents an EvaluationExpectationResult. */ + class EvaluationExpectationResult implements IEvaluationExpectationResult { + + /** + * Constructs a new EvaluationExpectationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult); + + /** EvaluationExpectationResult evaluationExpectation. */ + public evaluationExpectation: string; + + /** EvaluationExpectationResult prompt. */ + public prompt: string; + + /** EvaluationExpectationResult outcome. */ + public outcome: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); + + /** EvaluationExpectationResult explanation. */ + public explanation: string; + + /** + * Creates a new EvaluationExpectationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationExpectationResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult): google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult; + + /** + * Encodes the specified EvaluationExpectationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.verify|verify} messages. + * @param message EvaluationExpectationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationExpectationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.verify|verify} messages. + * @param message EvaluationExpectationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationExpectationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationExpectationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult; + + /** + * Decodes an EvaluationExpectationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationExpectationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult; + + /** + * Verifies an EvaluationExpectationResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationExpectationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationExpectationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult; + + /** + * Creates a plain object from an EvaluationExpectationResult message. Also converts values to other types if specified. + * @param message EvaluationExpectationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationExpectationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationExpectationResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoldenResult. */ + interface IGoldenResult { + + /** GoldenResult turnReplayResults */ + turnReplayResults?: (google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult[]|null); + + /** GoldenResult evaluationExpectationResults */ + evaluationExpectationResults?: (google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult[]|null); + } + + /** Represents a GoldenResult. */ + class GoldenResult implements IGoldenResult { + + /** + * Constructs a new GoldenResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IGoldenResult); + + /** GoldenResult turnReplayResults. */ + public turnReplayResults: google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult[]; + + /** GoldenResult evaluationExpectationResults. */ + public evaluationExpectationResults: google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult[]; + + /** + * Creates a new GoldenResult instance using the specified properties. + * @param [properties] Properties to set + * @returns GoldenResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IGoldenResult): google.cloud.ces.v1beta.EvaluationResult.GoldenResult; + + /** + * Encodes the specified GoldenResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.verify|verify} messages. + * @param message GoldenResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IGoldenResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoldenResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.verify|verify} messages. + * @param message GoldenResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IGoldenResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoldenResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoldenResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.GoldenResult; + + /** + * Decodes a GoldenResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoldenResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.GoldenResult; + + /** + * Verifies a GoldenResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoldenResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoldenResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.GoldenResult; + + /** + * Creates a plain object from a GoldenResult message. Also converts values to other types if specified. + * @param message GoldenResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.GoldenResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoldenResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoldenResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GoldenResult { + + /** Properties of a TurnReplayResult. */ + interface ITurnReplayResult { + + /** TurnReplayResult conversation */ + conversation?: (string|null); + + /** TurnReplayResult expectationOutcome */ + expectationOutcome?: (google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome[]|null); + + /** TurnReplayResult hallucinationResult */ + hallucinationResult?: (google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult|null); + + /** TurnReplayResult toolInvocationScore */ + toolInvocationScore?: (number|null); + + /** TurnReplayResult toolOrderedInvocationScore */ + toolOrderedInvocationScore?: (number|null); + + /** TurnReplayResult turnLatency */ + turnLatency?: (google.protobuf.IDuration|null); + + /** TurnReplayResult toolCallLatencies */ + toolCallLatencies?: (google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency[]|null); + + /** TurnReplayResult semanticSimilarityResult */ + semanticSimilarityResult?: (google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null); + + /** TurnReplayResult overallToolInvocationResult */ + overallToolInvocationResult?: (google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult|null); + + /** TurnReplayResult errorInfo */ + errorInfo?: (google.cloud.ces.v1beta.IEvaluationErrorInfo|null); + + /** TurnReplayResult spanLatencies */ + spanLatencies?: (google.cloud.ces.v1beta.EvaluationResult.ISpanLatency[]|null); + } + + /** Represents a TurnReplayResult. */ + class TurnReplayResult implements ITurnReplayResult { + + /** + * Constructs a new TurnReplayResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult); + + /** TurnReplayResult conversation. */ + public conversation: string; + + /** TurnReplayResult expectationOutcome. */ + public expectationOutcome: google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome[]; + + /** TurnReplayResult hallucinationResult. */ + public hallucinationResult?: (google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult|null); + + /** TurnReplayResult toolInvocationScore. */ + public toolInvocationScore: number; + + /** TurnReplayResult toolOrderedInvocationScore. */ + public toolOrderedInvocationScore?: (number|null); + + /** TurnReplayResult turnLatency. */ + public turnLatency?: (google.protobuf.IDuration|null); + + /** TurnReplayResult toolCallLatencies. */ + public toolCallLatencies: google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency[]; + + /** TurnReplayResult semanticSimilarityResult. */ + public semanticSimilarityResult?: (google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null); + + /** TurnReplayResult overallToolInvocationResult. */ + public overallToolInvocationResult?: (google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult|null); + + /** TurnReplayResult errorInfo. */ + public errorInfo?: (google.cloud.ces.v1beta.IEvaluationErrorInfo|null); + + /** TurnReplayResult spanLatencies. */ + public spanLatencies: google.cloud.ces.v1beta.EvaluationResult.ISpanLatency[]; + + /** + * Creates a new TurnReplayResult instance using the specified properties. + * @param [properties] Properties to set + * @returns TurnReplayResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult): google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult; + + /** + * Encodes the specified TurnReplayResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.verify|verify} messages. + * @param message TurnReplayResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TurnReplayResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.verify|verify} messages. + * @param message TurnReplayResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TurnReplayResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TurnReplayResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult; + + /** + * Decodes a TurnReplayResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TurnReplayResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult; + + /** + * Verifies a TurnReplayResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TurnReplayResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TurnReplayResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult; + + /** + * Creates a plain object from a TurnReplayResult message. Also converts values to other types if specified. + * @param message TurnReplayResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TurnReplayResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TurnReplayResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ScenarioRubricOutcome. */ + interface IScenarioRubricOutcome { + + /** ScenarioRubricOutcome rubric */ + rubric?: (string|null); + + /** ScenarioRubricOutcome score */ + score?: (number|null); + + /** ScenarioRubricOutcome scoreExplanation */ + scoreExplanation?: (string|null); + } + + /** Represents a ScenarioRubricOutcome. */ + class ScenarioRubricOutcome implements IScenarioRubricOutcome { + + /** + * Constructs a new ScenarioRubricOutcome. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome); + + /** ScenarioRubricOutcome rubric. */ + public rubric: string; + + /** ScenarioRubricOutcome score. */ + public score?: (number|null); + + /** ScenarioRubricOutcome scoreExplanation. */ + public scoreExplanation: string; + + /** + * Creates a new ScenarioRubricOutcome instance using the specified properties. + * @param [properties] Properties to set + * @returns ScenarioRubricOutcome instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome): google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome; + + /** + * Encodes the specified ScenarioRubricOutcome message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.verify|verify} messages. + * @param message ScenarioRubricOutcome message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScenarioRubricOutcome message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.verify|verify} messages. + * @param message ScenarioRubricOutcome message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScenarioRubricOutcome message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScenarioRubricOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome; + + /** + * Decodes a ScenarioRubricOutcome message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScenarioRubricOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome; + + /** + * Verifies a ScenarioRubricOutcome message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScenarioRubricOutcome message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScenarioRubricOutcome + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome; + + /** + * Creates a plain object from a ScenarioRubricOutcome message. Also converts values to other types if specified. + * @param message ScenarioRubricOutcome + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScenarioRubricOutcome to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScenarioRubricOutcome + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScenarioExpectationOutcome. */ + interface IScenarioExpectationOutcome { + + /** ScenarioExpectationOutcome observedToolCall */ + observedToolCall?: (google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall|null); + + /** ScenarioExpectationOutcome observedAgentResponse */ + observedAgentResponse?: (google.cloud.ces.v1beta.IMessage|null); + + /** ScenarioExpectationOutcome expectation */ + expectation?: (google.cloud.ces.v1beta.Evaluation.IScenarioExpectation|null); + + /** ScenarioExpectationOutcome outcome */ + outcome?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); + } + + /** Represents a ScenarioExpectationOutcome. */ + class ScenarioExpectationOutcome implements IScenarioExpectationOutcome { + + /** + * Constructs a new ScenarioExpectationOutcome. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome); + + /** ScenarioExpectationOutcome observedToolCall. */ + public observedToolCall?: (google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall|null); + + /** ScenarioExpectationOutcome observedAgentResponse. */ + public observedAgentResponse?: (google.cloud.ces.v1beta.IMessage|null); + + /** ScenarioExpectationOutcome expectation. */ + public expectation?: (google.cloud.ces.v1beta.Evaluation.IScenarioExpectation|null); + + /** ScenarioExpectationOutcome outcome. */ + public outcome: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); + + /** ScenarioExpectationOutcome result. */ + public result?: ("observedToolCall"|"observedAgentResponse"); + + /** + * Creates a new ScenarioExpectationOutcome instance using the specified properties. + * @param [properties] Properties to set + * @returns ScenarioExpectationOutcome instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome; + + /** + * Encodes the specified ScenarioExpectationOutcome message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.verify|verify} messages. + * @param message ScenarioExpectationOutcome message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScenarioExpectationOutcome message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.verify|verify} messages. + * @param message ScenarioExpectationOutcome message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScenarioExpectationOutcome message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScenarioExpectationOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome; + + /** + * Decodes a ScenarioExpectationOutcome message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScenarioExpectationOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome; + + /** + * Verifies a ScenarioExpectationOutcome message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScenarioExpectationOutcome message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScenarioExpectationOutcome + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome; + + /** + * Creates a plain object from a ScenarioExpectationOutcome message. Also converts values to other types if specified. + * @param message ScenarioExpectationOutcome + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScenarioExpectationOutcome to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScenarioExpectationOutcome + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScenarioExpectationOutcome { + + /** Properties of an ObservedToolCall. */ + interface IObservedToolCall { + + /** ObservedToolCall toolCall */ + toolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** ObservedToolCall toolResponse */ + toolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + } + + /** Represents an ObservedToolCall. */ + class ObservedToolCall implements IObservedToolCall { + + /** + * Constructs a new ObservedToolCall. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall); + + /** ObservedToolCall toolCall. */ + public toolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** ObservedToolCall toolResponse. */ + public toolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** + * Creates a new ObservedToolCall instance using the specified properties. + * @param [properties] Properties to set + * @returns ObservedToolCall instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall; + + /** + * Encodes the specified ObservedToolCall message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.verify|verify} messages. + * @param message ObservedToolCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObservedToolCall message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.verify|verify} messages. + * @param message ObservedToolCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObservedToolCall message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObservedToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall; + + /** + * Decodes an ObservedToolCall message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObservedToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall; + + /** + * Verifies an ObservedToolCall message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ObservedToolCall message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObservedToolCall + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall; + + /** + * Creates a plain object from an ObservedToolCall message. Also converts values to other types if specified. + * @param message ObservedToolCall + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObservedToolCall to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObservedToolCall + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ScenarioResult. */ + interface IScenarioResult { + + /** ScenarioResult conversation */ + conversation?: (string|null); + + /** ScenarioResult task */ + task?: (string|null); + + /** ScenarioResult userFacts */ + userFacts?: (google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact[]|null); + + /** ScenarioResult expectationOutcomes */ + expectationOutcomes?: (google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome[]|null); + + /** ScenarioResult rubricOutcomes */ + rubricOutcomes?: (google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome[]|null); + + /** ScenarioResult hallucinationResult */ + hallucinationResult?: (google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult[]|null); + + /** ScenarioResult taskCompletionResult */ + taskCompletionResult?: (google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult|null); + + /** ScenarioResult toolCallLatencies */ + toolCallLatencies?: (google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency[]|null); + + /** ScenarioResult userGoalSatisfactionResult */ + userGoalSatisfactionResult?: (google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult|null); + + /** ScenarioResult allExpectationsSatisfied */ + allExpectationsSatisfied?: (boolean|null); + + /** ScenarioResult taskCompleted */ + taskCompleted?: (boolean|null); + + /** ScenarioResult spanLatencies */ + spanLatencies?: (google.cloud.ces.v1beta.EvaluationResult.ISpanLatency[]|null); + + /** ScenarioResult evaluationExpectationResults */ + evaluationExpectationResults?: (google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult[]|null); + } + + /** Represents a ScenarioResult. */ + class ScenarioResult implements IScenarioResult { + + /** + * Constructs a new ScenarioResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IScenarioResult); + + /** ScenarioResult conversation. */ + public conversation: string; + + /** ScenarioResult task. */ + public task: string; + + /** ScenarioResult userFacts. */ + public userFacts: google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact[]; + + /** ScenarioResult expectationOutcomes. */ + public expectationOutcomes: google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome[]; + + /** ScenarioResult rubricOutcomes. */ + public rubricOutcomes: google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome[]; + + /** ScenarioResult hallucinationResult. */ + public hallucinationResult: google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult[]; + + /** ScenarioResult taskCompletionResult. */ + public taskCompletionResult?: (google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult|null); + + /** ScenarioResult toolCallLatencies. */ + public toolCallLatencies: google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency[]; + + /** ScenarioResult userGoalSatisfactionResult. */ + public userGoalSatisfactionResult?: (google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult|null); + + /** ScenarioResult allExpectationsSatisfied. */ + public allExpectationsSatisfied?: (boolean|null); + + /** ScenarioResult taskCompleted. */ + public taskCompleted?: (boolean|null); + + /** ScenarioResult spanLatencies. */ + public spanLatencies: google.cloud.ces.v1beta.EvaluationResult.ISpanLatency[]; + + /** ScenarioResult evaluationExpectationResults. */ + public evaluationExpectationResults: google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult[]; + + /** + * Creates a new ScenarioResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ScenarioResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IScenarioResult): google.cloud.ces.v1beta.EvaluationResult.ScenarioResult; + + /** + * Encodes the specified ScenarioResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.verify|verify} messages. + * @param message ScenarioResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IScenarioResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScenarioResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.verify|verify} messages. + * @param message ScenarioResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IScenarioResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScenarioResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScenarioResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.ScenarioResult; + + /** + * Decodes a ScenarioResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScenarioResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.ScenarioResult; + + /** + * Verifies a ScenarioResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScenarioResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScenarioResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.ScenarioResult; + + /** + * Creates a plain object from a ScenarioResult message. Also converts values to other types if specified. + * @param message ScenarioResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.ScenarioResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScenarioResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScenarioResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpanLatency. */ + interface ISpanLatency { + + /** SpanLatency resource */ + resource?: (string|null); + + /** SpanLatency toolset */ + toolset?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** SpanLatency model */ + model?: (string|null); + + /** SpanLatency callback */ + callback?: (string|null); + + /** SpanLatency type */ + type?: (google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type|keyof typeof google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type|null); + + /** SpanLatency displayName */ + displayName?: (string|null); + + /** SpanLatency startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** SpanLatency endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** SpanLatency executionLatency */ + executionLatency?: (google.protobuf.IDuration|null); + } + + /** Represents a SpanLatency. */ + class SpanLatency implements ISpanLatency { + + /** + * Constructs a new SpanLatency. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.ISpanLatency); + + /** SpanLatency resource. */ + public resource?: (string|null); + + /** SpanLatency toolset. */ + public toolset?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** SpanLatency model. */ + public model?: (string|null); + + /** SpanLatency callback. */ + public callback?: (string|null); + + /** SpanLatency type. */ + public type: (google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type|keyof typeof google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type); + + /** SpanLatency displayName. */ + public displayName: string; + + /** SpanLatency startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** SpanLatency endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** SpanLatency executionLatency. */ + public executionLatency?: (google.protobuf.IDuration|null); + + /** SpanLatency identifier. */ + public identifier?: ("resource"|"toolset"|"model"|"callback"); + + /** + * Creates a new SpanLatency instance using the specified properties. + * @param [properties] Properties to set + * @returns SpanLatency instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.ISpanLatency): google.cloud.ces.v1beta.EvaluationResult.SpanLatency; + + /** + * Encodes the specified SpanLatency message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SpanLatency.verify|verify} messages. + * @param message SpanLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.ISpanLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpanLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SpanLatency.verify|verify} messages. + * @param message SpanLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.ISpanLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpanLatency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpanLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.SpanLatency; + + /** + * Decodes a SpanLatency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpanLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.SpanLatency; + + /** + * Verifies a SpanLatency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpanLatency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpanLatency + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.SpanLatency; + + /** + * Creates a plain object from a SpanLatency message. Also converts values to other types if specified. + * @param message SpanLatency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.SpanLatency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpanLatency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpanLatency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SpanLatency { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + TOOL = 1, + USER_CALLBACK = 2, + GUARDRAIL = 3, + LLM = 4 + } + } + + /** Properties of a ToolCallLatency. */ + interface IToolCallLatency { + + /** ToolCallLatency tool */ + tool?: (string|null); + + /** ToolCallLatency displayName */ + displayName?: (string|null); + + /** ToolCallLatency startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** ToolCallLatency endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** ToolCallLatency executionLatency */ + executionLatency?: (google.protobuf.IDuration|null); + } + + /** Represents a ToolCallLatency. */ + class ToolCallLatency implements IToolCallLatency { + + /** + * Constructs a new ToolCallLatency. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency); + + /** ToolCallLatency tool. */ + public tool: string; + + /** ToolCallLatency displayName. */ + public displayName: string; + + /** ToolCallLatency startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** ToolCallLatency endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** ToolCallLatency executionLatency. */ + public executionLatency?: (google.protobuf.IDuration|null); + + /** + * Creates a new ToolCallLatency instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolCallLatency instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency): google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency; + + /** + * Encodes the specified ToolCallLatency message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.verify|verify} messages. + * @param message ToolCallLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolCallLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.verify|verify} messages. + * @param message ToolCallLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolCallLatency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolCallLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency; + + /** + * Decodes a ToolCallLatency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolCallLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency; + + /** + * Verifies a ToolCallLatency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolCallLatency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolCallLatency + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency; + + /** + * Creates a plain object from a ToolCallLatency message. Also converts values to other types if specified. + * @param message ToolCallLatency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolCallLatency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolCallLatency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HallucinationResult. */ + interface IHallucinationResult { + + /** HallucinationResult score */ + score?: (number|null); + + /** HallucinationResult label */ + label?: (string|null); + + /** HallucinationResult explanation */ + explanation?: (string|null); + } + + /** Represents a HallucinationResult. */ + class HallucinationResult implements IHallucinationResult { + + /** + * Constructs a new HallucinationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult); + + /** HallucinationResult score. */ + public score?: (number|null); + + /** HallucinationResult label. */ + public label: string; + + /** HallucinationResult explanation. */ + public explanation: string; + + /** + * Creates a new HallucinationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns HallucinationResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult): google.cloud.ces.v1beta.EvaluationResult.HallucinationResult; + + /** + * Encodes the specified HallucinationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.verify|verify} messages. + * @param message HallucinationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HallucinationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.verify|verify} messages. + * @param message HallucinationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HallucinationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HallucinationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.HallucinationResult; + + /** + * Decodes a HallucinationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HallucinationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.HallucinationResult; + + /** + * Verifies a HallucinationResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HallucinationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HallucinationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.HallucinationResult; + + /** + * Creates a plain object from a HallucinationResult message. Also converts values to other types if specified. + * @param message HallucinationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.HallucinationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HallucinationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HallucinationResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserGoalSatisfactionResult. */ + interface IUserGoalSatisfactionResult { + + /** UserGoalSatisfactionResult score */ + score?: (number|null); + + /** UserGoalSatisfactionResult label */ + label?: (string|null); + + /** UserGoalSatisfactionResult explanation */ + explanation?: (string|null); + } + + /** Represents a UserGoalSatisfactionResult. */ + class UserGoalSatisfactionResult implements IUserGoalSatisfactionResult { + + /** + * Constructs a new UserGoalSatisfactionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult); + + /** UserGoalSatisfactionResult score. */ + public score?: (number|null); + + /** UserGoalSatisfactionResult label. */ + public label: string; + + /** UserGoalSatisfactionResult explanation. */ + public explanation: string; + + /** + * Creates a new UserGoalSatisfactionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns UserGoalSatisfactionResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult): google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult; + + /** + * Encodes the specified UserGoalSatisfactionResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.verify|verify} messages. + * @param message UserGoalSatisfactionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserGoalSatisfactionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.verify|verify} messages. + * @param message UserGoalSatisfactionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserGoalSatisfactionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserGoalSatisfactionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult; + + /** + * Decodes a UserGoalSatisfactionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserGoalSatisfactionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult; + + /** + * Verifies a UserGoalSatisfactionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserGoalSatisfactionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserGoalSatisfactionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult; + + /** + * Creates a plain object from a UserGoalSatisfactionResult message. Also converts values to other types if specified. + * @param message UserGoalSatisfactionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserGoalSatisfactionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserGoalSatisfactionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticSimilarityResult. */ + interface ISemanticSimilarityResult { + + /** SemanticSimilarityResult score */ + score?: (number|null); + + /** SemanticSimilarityResult label */ + label?: (string|null); + + /** SemanticSimilarityResult explanation */ + explanation?: (string|null); + + /** SemanticSimilarityResult outcome */ + outcome?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); + } + + /** Represents a SemanticSimilarityResult. */ + class SemanticSimilarityResult implements ISemanticSimilarityResult { + + /** + * Constructs a new SemanticSimilarityResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult); + + /** SemanticSimilarityResult score. */ + public score?: (number|null); + + /** SemanticSimilarityResult label. */ + public label: string; + + /** SemanticSimilarityResult explanation. */ + public explanation: string; + + /** SemanticSimilarityResult outcome. */ + public outcome: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); + + /** + * Creates a new SemanticSimilarityResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticSimilarityResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult): google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult; + + /** + * Encodes the specified SemanticSimilarityResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.verify|verify} messages. + * @param message SemanticSimilarityResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SemanticSimilarityResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.verify|verify} messages. + * @param message SemanticSimilarityResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticSimilarityResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SemanticSimilarityResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult; + + /** + * Decodes a SemanticSimilarityResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SemanticSimilarityResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult; + + /** + * Verifies a SemanticSimilarityResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SemanticSimilarityResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SemanticSimilarityResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult; + + /** + * Creates a plain object from a SemanticSimilarityResult message. Also converts values to other types if specified. + * @param message SemanticSimilarityResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SemanticSimilarityResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SemanticSimilarityResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OverallToolInvocationResult. */ + interface IOverallToolInvocationResult { + + /** OverallToolInvocationResult toolInvocationScore */ + toolInvocationScore?: (number|null); + + /** OverallToolInvocationResult outcome */ + outcome?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); + } + + /** Represents an OverallToolInvocationResult. */ + class OverallToolInvocationResult implements IOverallToolInvocationResult { + + /** + * Constructs a new OverallToolInvocationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult); + + /** OverallToolInvocationResult toolInvocationScore. */ + public toolInvocationScore?: (number|null); + + /** OverallToolInvocationResult outcome. */ + public outcome: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); + + /** + * Creates a new OverallToolInvocationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns OverallToolInvocationResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult): google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult; + + /** + * Encodes the specified OverallToolInvocationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.verify|verify} messages. + * @param message OverallToolInvocationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OverallToolInvocationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.verify|verify} messages. + * @param message OverallToolInvocationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OverallToolInvocationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OverallToolInvocationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult; + + /** + * Decodes an OverallToolInvocationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OverallToolInvocationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult; + + /** + * Verifies an OverallToolInvocationResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OverallToolInvocationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OverallToolInvocationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult; + + /** + * Creates a plain object from an OverallToolInvocationResult message. Also converts values to other types if specified. + * @param message OverallToolInvocationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OverallToolInvocationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OverallToolInvocationResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TaskCompletionResult. */ + interface ITaskCompletionResult { + + /** TaskCompletionResult score */ + score?: (number|null); + + /** TaskCompletionResult label */ + label?: (string|null); + + /** TaskCompletionResult explanation */ + explanation?: (string|null); + } + + /** Represents a TaskCompletionResult. */ + class TaskCompletionResult implements ITaskCompletionResult { + + /** + * Constructs a new TaskCompletionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult); + + /** TaskCompletionResult score. */ + public score?: (number|null); + + /** TaskCompletionResult label. */ + public label: string; + + /** TaskCompletionResult explanation. */ + public explanation: string; + + /** + * Creates a new TaskCompletionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskCompletionResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult): google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult; + + /** + * Encodes the specified TaskCompletionResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.verify|verify} messages. + * @param message TaskCompletionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskCompletionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.verify|verify} messages. + * @param message TaskCompletionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskCompletionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskCompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult; + + /** + * Decodes a TaskCompletionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskCompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult; + + /** + * Verifies a TaskCompletionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskCompletionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskCompletionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult; + + /** + * Creates a plain object from a TaskCompletionResult message. Also converts values to other types if specified. + * @param message TaskCompletionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskCompletionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskCompletionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Outcome enum. */ + enum Outcome { + OUTCOME_UNSPECIFIED = 0, + PASS = 1, + FAIL = 2 + } + + /** ExecutionState enum. */ + enum ExecutionState { + EXECUTION_STATE_UNSPECIFIED = 0, + RUNNING = 1, + COMPLETED = 2, + ERROR = 3 + } + } + + /** Properties of an EvaluationRun. */ + interface IEvaluationRun { + + /** EvaluationRun name */ + name?: (string|null); + + /** EvaluationRun displayName */ + displayName?: (string|null); + + /** EvaluationRun evaluationResults */ + evaluationResults?: (string[]|null); + + /** EvaluationRun createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationRun initiatedBy */ + initiatedBy?: (string|null); + + /** EvaluationRun appVersion */ + appVersion?: (string|null); + + /** EvaluationRun appVersionDisplayName */ + appVersionDisplayName?: (string|null); + + /** EvaluationRun changelog */ + changelog?: (string|null); + + /** EvaluationRun changelogCreateTime */ + changelogCreateTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationRun evaluations */ + evaluations?: (string[]|null); + + /** EvaluationRun evaluationDataset */ + evaluationDataset?: (string|null); + + /** EvaluationRun evaluationType */ + evaluationType?: (google.cloud.ces.v1beta.EvaluationRun.EvaluationType|keyof typeof google.cloud.ces.v1beta.EvaluationRun.EvaluationType|null); + + /** EvaluationRun state */ + state?: (google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState|keyof typeof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState|null); + + /** EvaluationRun progress */ + progress?: (google.cloud.ces.v1beta.EvaluationRun.IProgress|null); + + /** EvaluationRun config */ + config?: (google.cloud.ces.v1beta.IEvaluationConfig|null); + + /** EvaluationRun error */ + error?: (google.rpc.IStatus|null); + + /** EvaluationRun errorInfo */ + errorInfo?: (google.cloud.ces.v1beta.IEvaluationErrorInfo|null); + + /** EvaluationRun evaluationRunSummaries */ + evaluationRunSummaries?: ({ [k: string]: google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary }|null); + + /** EvaluationRun latencyReport */ + latencyReport?: (google.cloud.ces.v1beta.ILatencyReport|null); + + /** EvaluationRun runCount */ + runCount?: (number|null); + + /** EvaluationRun personaRunConfigs */ + personaRunConfigs?: (google.cloud.ces.v1beta.IPersonaRunConfig[]|null); + + /** EvaluationRun optimizationConfig */ + optimizationConfig?: (google.cloud.ces.v1beta.IOptimizationConfig|null); + + /** EvaluationRun scheduledEvaluationRun */ + scheduledEvaluationRun?: (string|null); + + /** EvaluationRun goldenRunMethod */ + goldenRunMethod?: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod|null); + } + + /** Represents an EvaluationRun. */ + class EvaluationRun implements IEvaluationRun { + + /** + * Constructs a new EvaluationRun. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluationRun); + + /** EvaluationRun name. */ + public name: string; + + /** EvaluationRun displayName. */ + public displayName: string; + + /** EvaluationRun evaluationResults. */ + public evaluationResults: string[]; + + /** EvaluationRun createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationRun initiatedBy. */ + public initiatedBy: string; + + /** EvaluationRun appVersion. */ + public appVersion: string; + + /** EvaluationRun appVersionDisplayName. */ + public appVersionDisplayName: string; + + /** EvaluationRun changelog. */ + public changelog: string; + + /** EvaluationRun changelogCreateTime. */ + public changelogCreateTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationRun evaluations. */ + public evaluations: string[]; + + /** EvaluationRun evaluationDataset. */ + public evaluationDataset: string; + + /** EvaluationRun evaluationType. */ + public evaluationType: (google.cloud.ces.v1beta.EvaluationRun.EvaluationType|keyof typeof google.cloud.ces.v1beta.EvaluationRun.EvaluationType); + + /** EvaluationRun state. */ + public state: (google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState|keyof typeof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState); + + /** EvaluationRun progress. */ + public progress?: (google.cloud.ces.v1beta.EvaluationRun.IProgress|null); + + /** EvaluationRun config. */ + public config?: (google.cloud.ces.v1beta.IEvaluationConfig|null); + + /** EvaluationRun error. */ + public error?: (google.rpc.IStatus|null); + + /** EvaluationRun errorInfo. */ + public errorInfo?: (google.cloud.ces.v1beta.IEvaluationErrorInfo|null); + + /** EvaluationRun evaluationRunSummaries. */ + public evaluationRunSummaries: { [k: string]: google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary }; + + /** EvaluationRun latencyReport. */ + public latencyReport?: (google.cloud.ces.v1beta.ILatencyReport|null); + + /** EvaluationRun runCount. */ + public runCount: number; + + /** EvaluationRun personaRunConfigs. */ + public personaRunConfigs: google.cloud.ces.v1beta.IPersonaRunConfig[]; + + /** EvaluationRun optimizationConfig. */ + public optimizationConfig?: (google.cloud.ces.v1beta.IOptimizationConfig|null); + + /** EvaluationRun scheduledEvaluationRun. */ + public scheduledEvaluationRun: string; + + /** EvaluationRun goldenRunMethod. */ + public goldenRunMethod: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod); + + /** + * Creates a new EvaluationRun instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationRun instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluationRun): google.cloud.ces.v1beta.EvaluationRun; + + /** + * Encodes the specified EvaluationRun message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.verify|verify} messages. + * @param message EvaluationRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluationRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationRun message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.verify|verify} messages. + * @param message EvaluationRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationRun message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationRun; + + /** + * Decodes an EvaluationRun message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationRun; + + /** + * Verifies an EvaluationRun message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationRun message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationRun + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationRun; + + /** + * Creates a plain object from an EvaluationRun message. Also converts values to other types if specified. + * @param message EvaluationRun + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationRun to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationRun + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EvaluationRun { + + /** Properties of a Progress. */ + interface IProgress { + + /** Progress totalCount */ + totalCount?: (number|null); + + /** Progress failedCount */ + failedCount?: (number|null); + + /** Progress errorCount */ + errorCount?: (number|null); + + /** Progress completedCount */ + completedCount?: (number|null); + + /** Progress passedCount */ + passedCount?: (number|null); + } + + /** Represents a Progress. */ + class Progress implements IProgress { + + /** + * Constructs a new Progress. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationRun.IProgress); + + /** Progress totalCount. */ + public totalCount: number; + + /** Progress failedCount. */ + public failedCount: number; + + /** Progress errorCount. */ + public errorCount: number; + + /** Progress completedCount. */ + public completedCount: number; + + /** Progress passedCount. */ + public passedCount: number; + + /** + * Creates a new Progress instance using the specified properties. + * @param [properties] Properties to set + * @returns Progress instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationRun.IProgress): google.cloud.ces.v1beta.EvaluationRun.Progress; + + /** + * Encodes the specified Progress message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.Progress.verify|verify} messages. + * @param message Progress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationRun.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.Progress.verify|verify} messages. + * @param message Progress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationRun.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Progress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationRun.Progress; + + /** + * Decodes a Progress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationRun.Progress; + + /** + * Verifies a Progress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Progress + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationRun.Progress; + + /** + * Creates a plain object from a Progress message. Also converts values to other types if specified. + * @param message Progress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationRun.Progress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Progress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Progress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluationRunSummary. */ + interface IEvaluationRunSummary { + + /** EvaluationRunSummary passedCount */ + passedCount?: (number|null); + + /** EvaluationRunSummary failedCount */ + failedCount?: (number|null); + + /** EvaluationRunSummary errorCount */ + errorCount?: (number|null); + } + + /** Represents an EvaluationRunSummary. */ + class EvaluationRunSummary implements IEvaluationRunSummary { + + /** + * Constructs a new EvaluationRunSummary. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary); + + /** EvaluationRunSummary passedCount. */ + public passedCount: number; + + /** EvaluationRunSummary failedCount. */ + public failedCount: number; + + /** EvaluationRunSummary errorCount. */ + public errorCount: number; + + /** + * Creates a new EvaluationRunSummary instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationRunSummary instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary): google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary; + + /** + * Encodes the specified EvaluationRunSummary message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.verify|verify} messages. + * @param message EvaluationRunSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationRunSummary message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.verify|verify} messages. + * @param message EvaluationRunSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationRunSummary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationRunSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary; + + /** + * Decodes an EvaluationRunSummary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationRunSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary; + + /** + * Verifies an EvaluationRunSummary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationRunSummary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationRunSummary + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary; + + /** + * Creates a plain object from an EvaluationRunSummary message. Also converts values to other types if specified. + * @param message EvaluationRunSummary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationRunSummary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationRunSummary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** EvaluationType enum. */ + enum EvaluationType { + EVALUATION_TYPE_UNSPECIFIED = 0, + GOLDEN = 1, + SCENARIO = 2, + MIXED = 3 + } + + /** EvaluationRunState enum. */ + enum EvaluationRunState { + EVALUATION_RUN_STATE_UNSPECIFIED = 0, + RUNNING = 1, + COMPLETED = 2, + ERROR = 3 + } + } + + /** Properties of a LatencyReport. */ + interface ILatencyReport { + + /** LatencyReport toolLatencies */ + toolLatencies?: (google.cloud.ces.v1beta.LatencyReport.IToolLatency[]|null); + + /** LatencyReport callbackLatencies */ + callbackLatencies?: (google.cloud.ces.v1beta.LatencyReport.ICallbackLatency[]|null); + + /** LatencyReport guardrailLatencies */ + guardrailLatencies?: (google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency[]|null); + + /** LatencyReport llmCallLatencies */ + llmCallLatencies?: (google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency[]|null); + + /** LatencyReport sessionCount */ + sessionCount?: (number|null); + } + + /** Represents a LatencyReport. */ + class LatencyReport implements ILatencyReport { + + /** + * Constructs a new LatencyReport. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ILatencyReport); + + /** LatencyReport toolLatencies. */ + public toolLatencies: google.cloud.ces.v1beta.LatencyReport.IToolLatency[]; + + /** LatencyReport callbackLatencies. */ + public callbackLatencies: google.cloud.ces.v1beta.LatencyReport.ICallbackLatency[]; + + /** LatencyReport guardrailLatencies. */ + public guardrailLatencies: google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency[]; + + /** LatencyReport llmCallLatencies. */ + public llmCallLatencies: google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency[]; + + /** LatencyReport sessionCount. */ + public sessionCount: number; + + /** + * Creates a new LatencyReport instance using the specified properties. + * @param [properties] Properties to set + * @returns LatencyReport instance + */ + public static create(properties?: google.cloud.ces.v1beta.ILatencyReport): google.cloud.ces.v1beta.LatencyReport; + + /** + * Encodes the specified LatencyReport message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.verify|verify} messages. + * @param message LatencyReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ILatencyReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LatencyReport message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.verify|verify} messages. + * @param message LatencyReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ILatencyReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LatencyReport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatencyReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LatencyReport; + + /** + * Decodes a LatencyReport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatencyReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LatencyReport; + + /** + * Verifies a LatencyReport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LatencyReport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatencyReport + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LatencyReport; + + /** + * Creates a plain object from a LatencyReport message. Also converts values to other types if specified. + * @param message LatencyReport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.LatencyReport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LatencyReport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LatencyReport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LatencyReport { + + /** Properties of a LatencyMetrics. */ + interface ILatencyMetrics { + + /** LatencyMetrics p50Latency */ + p50Latency?: (google.protobuf.IDuration|null); + + /** LatencyMetrics p90Latency */ + p90Latency?: (google.protobuf.IDuration|null); + + /** LatencyMetrics p99Latency */ + p99Latency?: (google.protobuf.IDuration|null); + + /** LatencyMetrics callCount */ + callCount?: (number|null); + } + + /** Represents a LatencyMetrics. */ + class LatencyMetrics implements ILatencyMetrics { + + /** + * Constructs a new LatencyMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics); + + /** LatencyMetrics p50Latency. */ + public p50Latency?: (google.protobuf.IDuration|null); + + /** LatencyMetrics p90Latency. */ + public p90Latency?: (google.protobuf.IDuration|null); + + /** LatencyMetrics p99Latency. */ + public p99Latency?: (google.protobuf.IDuration|null); + + /** LatencyMetrics callCount. */ + public callCount: number; + + /** + * Creates a new LatencyMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns LatencyMetrics instance + */ + public static create(properties?: google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics): google.cloud.ces.v1beta.LatencyReport.LatencyMetrics; + + /** + * Encodes the specified LatencyMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify|verify} messages. + * @param message LatencyMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LatencyMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify|verify} messages. + * @param message LatencyMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LatencyMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LatencyReport.LatencyMetrics; + + /** + * Decodes a LatencyMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LatencyReport.LatencyMetrics; + + /** + * Verifies a LatencyMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LatencyMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatencyMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LatencyReport.LatencyMetrics; + + /** + * Creates a plain object from a LatencyMetrics message. Also converts values to other types if specified. + * @param message LatencyMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.LatencyReport.LatencyMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LatencyMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LatencyMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolLatency. */ + interface IToolLatency { + + /** ToolLatency tool */ + tool?: (string|null); + + /** ToolLatency toolsetTool */ + toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ToolLatency toolDisplayName */ + toolDisplayName?: (string|null); + + /** ToolLatency latencyMetrics */ + latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); + } + + /** Represents a ToolLatency. */ + class ToolLatency implements IToolLatency { + + /** + * Constructs a new ToolLatency. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.LatencyReport.IToolLatency); + + /** ToolLatency tool. */ + public tool?: (string|null); + + /** ToolLatency toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ToolLatency toolDisplayName. */ + public toolDisplayName: string; + + /** ToolLatency latencyMetrics. */ + public latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); + + /** ToolLatency toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new ToolLatency instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolLatency instance + */ + public static create(properties?: google.cloud.ces.v1beta.LatencyReport.IToolLatency): google.cloud.ces.v1beta.LatencyReport.ToolLatency; + + /** + * Encodes the specified ToolLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.ToolLatency.verify|verify} messages. + * @param message ToolLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.LatencyReport.IToolLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.ToolLatency.verify|verify} messages. + * @param message ToolLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.LatencyReport.IToolLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolLatency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LatencyReport.ToolLatency; + + /** + * Decodes a ToolLatency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LatencyReport.ToolLatency; + + /** + * Verifies a ToolLatency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolLatency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolLatency + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LatencyReport.ToolLatency; + + /** + * Creates a plain object from a ToolLatency message. Also converts values to other types if specified. + * @param message ToolLatency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.LatencyReport.ToolLatency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolLatency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolLatency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CallbackLatency. */ + interface ICallbackLatency { + + /** CallbackLatency stage */ + stage?: (string|null); + + /** CallbackLatency latencyMetrics */ + latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); + } + + /** Represents a CallbackLatency. */ + class CallbackLatency implements ICallbackLatency { + + /** + * Constructs a new CallbackLatency. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.LatencyReport.ICallbackLatency); + + /** CallbackLatency stage. */ + public stage: string; + + /** CallbackLatency latencyMetrics. */ + public latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); + + /** + * Creates a new CallbackLatency instance using the specified properties. + * @param [properties] Properties to set + * @returns CallbackLatency instance + */ + public static create(properties?: google.cloud.ces.v1beta.LatencyReport.ICallbackLatency): google.cloud.ces.v1beta.LatencyReport.CallbackLatency; + + /** + * Encodes the specified CallbackLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.CallbackLatency.verify|verify} messages. + * @param message CallbackLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.LatencyReport.ICallbackLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CallbackLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.CallbackLatency.verify|verify} messages. + * @param message CallbackLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.LatencyReport.ICallbackLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CallbackLatency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CallbackLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LatencyReport.CallbackLatency; + + /** + * Decodes a CallbackLatency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CallbackLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LatencyReport.CallbackLatency; + + /** + * Verifies a CallbackLatency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CallbackLatency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CallbackLatency + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LatencyReport.CallbackLatency; + + /** + * Creates a plain object from a CallbackLatency message. Also converts values to other types if specified. + * @param message CallbackLatency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.LatencyReport.CallbackLatency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CallbackLatency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CallbackLatency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GuardrailLatency. */ + interface IGuardrailLatency { + + /** GuardrailLatency guardrail */ + guardrail?: (string|null); + + /** GuardrailLatency guardrailDisplayName */ + guardrailDisplayName?: (string|null); + + /** GuardrailLatency latencyMetrics */ + latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); + } + + /** Represents a GuardrailLatency. */ + class GuardrailLatency implements IGuardrailLatency { + + /** + * Constructs a new GuardrailLatency. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency); + + /** GuardrailLatency guardrail. */ + public guardrail: string; + + /** GuardrailLatency guardrailDisplayName. */ + public guardrailDisplayName: string; + + /** GuardrailLatency latencyMetrics. */ + public latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); + + /** + * Creates a new GuardrailLatency instance using the specified properties. + * @param [properties] Properties to set + * @returns GuardrailLatency instance + */ + public static create(properties?: google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency): google.cloud.ces.v1beta.LatencyReport.GuardrailLatency; + + /** + * Encodes the specified GuardrailLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.verify|verify} messages. + * @param message GuardrailLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GuardrailLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.verify|verify} messages. + * @param message GuardrailLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GuardrailLatency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GuardrailLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LatencyReport.GuardrailLatency; + + /** + * Decodes a GuardrailLatency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GuardrailLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LatencyReport.GuardrailLatency; + + /** + * Verifies a GuardrailLatency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GuardrailLatency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GuardrailLatency + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LatencyReport.GuardrailLatency; + + /** + * Creates a plain object from a GuardrailLatency message. Also converts values to other types if specified. + * @param message GuardrailLatency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.LatencyReport.GuardrailLatency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GuardrailLatency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GuardrailLatency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LlmCallLatency. */ + interface ILlmCallLatency { + + /** LlmCallLatency model */ + model?: (string|null); + + /** LlmCallLatency latencyMetrics */ + latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); + } + + /** Represents a LlmCallLatency. */ + class LlmCallLatency implements ILlmCallLatency { + + /** + * Constructs a new LlmCallLatency. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency); + + /** LlmCallLatency model. */ + public model: string; + + /** LlmCallLatency latencyMetrics. */ + public latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); + + /** + * Creates a new LlmCallLatency instance using the specified properties. + * @param [properties] Properties to set + * @returns LlmCallLatency instance + */ + public static create(properties?: google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency): google.cloud.ces.v1beta.LatencyReport.LlmCallLatency; + + /** + * Encodes the specified LlmCallLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.verify|verify} messages. + * @param message LlmCallLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LlmCallLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.verify|verify} messages. + * @param message LlmCallLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LlmCallLatency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LlmCallLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LatencyReport.LlmCallLatency; + + /** + * Decodes a LlmCallLatency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LlmCallLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LatencyReport.LlmCallLatency; + + /** + * Verifies a LlmCallLatency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LlmCallLatency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LlmCallLatency + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LatencyReport.LlmCallLatency; + + /** + * Creates a plain object from a LlmCallLatency message. Also converts values to other types if specified. + * @param message LlmCallLatency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.LatencyReport.LlmCallLatency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LlmCallLatency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LlmCallLatency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EvaluationExpectation. */ + interface IEvaluationExpectation { + + /** EvaluationExpectation llmCriteria */ + llmCriteria?: (google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria|null); + + /** EvaluationExpectation name */ + name?: (string|null); + + /** EvaluationExpectation displayName */ + displayName?: (string|null); + + /** EvaluationExpectation tags */ + tags?: (string[]|null); + + /** EvaluationExpectation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationExpectation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationExpectation etag */ + etag?: (string|null); + } + + /** Represents an EvaluationExpectation. */ + class EvaluationExpectation implements IEvaluationExpectation { + + /** + * Constructs a new EvaluationExpectation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluationExpectation); + + /** EvaluationExpectation llmCriteria. */ + public llmCriteria?: (google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria|null); + + /** EvaluationExpectation name. */ + public name: string; + + /** EvaluationExpectation displayName. */ + public displayName: string; + + /** EvaluationExpectation tags. */ + public tags: string[]; + + /** EvaluationExpectation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationExpectation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationExpectation etag. */ + public etag: string; + + /** EvaluationExpectation criteria. */ + public criteria?: "llmCriteria"; + + /** + * Creates a new EvaluationExpectation instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationExpectation instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluationExpectation): google.cloud.ces.v1beta.EvaluationExpectation; + + /** + * Encodes the specified EvaluationExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.verify|verify} messages. + * @param message EvaluationExpectation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluationExpectation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.verify|verify} messages. + * @param message EvaluationExpectation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationExpectation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationExpectation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationExpectation; + + /** + * Decodes an EvaluationExpectation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationExpectation; + + /** + * Verifies an EvaluationExpectation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationExpectation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationExpectation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationExpectation; + + /** + * Creates a plain object from an EvaluationExpectation message. Also converts values to other types if specified. + * @param message EvaluationExpectation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationExpectation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationExpectation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationExpectation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EvaluationExpectation { + + /** Properties of a LlmCriteria. */ + interface ILlmCriteria { + + /** LlmCriteria prompt */ + prompt?: (string|null); + } + + /** Represents a LlmCriteria. */ + class LlmCriteria implements ILlmCriteria { + + /** + * Constructs a new LlmCriteria. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria); + + /** LlmCriteria prompt. */ + public prompt: string; + + /** + * Creates a new LlmCriteria instance using the specified properties. + * @param [properties] Properties to set + * @returns LlmCriteria instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria): google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria; + + /** + * Encodes the specified LlmCriteria message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.verify|verify} messages. + * @param message LlmCriteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LlmCriteria message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.verify|verify} messages. + * @param message LlmCriteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LlmCriteria message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LlmCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria; + + /** + * Decodes a LlmCriteria message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LlmCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria; + + /** + * Verifies a LlmCriteria message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LlmCriteria message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LlmCriteria + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria; + + /** + * Creates a plain object from a LlmCriteria message. Also converts values to other types if specified. + * @param message LlmCriteria + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LlmCriteria to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LlmCriteria + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EvaluationConfig. */ + interface IEvaluationConfig { + + /** EvaluationConfig inputAudioConfig */ + inputAudioConfig?: (google.cloud.ces.v1beta.IInputAudioConfig|null); + + /** EvaluationConfig outputAudioConfig */ + outputAudioConfig?: (google.cloud.ces.v1beta.IOutputAudioConfig|null); + + /** EvaluationConfig evaluationChannel */ + evaluationChannel?: (google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel|keyof typeof google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel|null); + + /** EvaluationConfig toolCallBehaviour */ + toolCallBehaviour?: (google.cloud.ces.v1beta.EvaluationToolCallBehaviour|keyof typeof google.cloud.ces.v1beta.EvaluationToolCallBehaviour|null); + } + + /** Represents an EvaluationConfig. */ + class EvaluationConfig implements IEvaluationConfig { + + /** + * Constructs a new EvaluationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluationConfig); + + /** EvaluationConfig inputAudioConfig. */ + public inputAudioConfig?: (google.cloud.ces.v1beta.IInputAudioConfig|null); + + /** EvaluationConfig outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.ces.v1beta.IOutputAudioConfig|null); + + /** EvaluationConfig evaluationChannel. */ + public evaluationChannel: (google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel|keyof typeof google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel); + + /** EvaluationConfig toolCallBehaviour. */ + public toolCallBehaviour: (google.cloud.ces.v1beta.EvaluationToolCallBehaviour|keyof typeof google.cloud.ces.v1beta.EvaluationToolCallBehaviour); + + /** + * Creates a new EvaluationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluationConfig): google.cloud.ces.v1beta.EvaluationConfig; + + /** + * Encodes the specified EvaluationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationConfig.verify|verify} messages. + * @param message EvaluationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationConfig.verify|verify} messages. + * @param message EvaluationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationConfig; + + /** + * Decodes an EvaluationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationConfig; + + /** + * Verifies an EvaluationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationConfig; + + /** + * Creates a plain object from an EvaluationConfig message. Also converts values to other types if specified. + * @param message EvaluationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EvaluationConfig { + + /** EvaluationChannel enum. */ + enum EvaluationChannel { + EVALUATION_CHANNEL_UNSPECIFIED = 0, + TEXT = 1, + AUDIO = 2 + } + } + + /** Properties of an EvaluationErrorInfo. */ + interface IEvaluationErrorInfo { + + /** EvaluationErrorInfo errorType */ + errorType?: (google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType|keyof typeof google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType|null); + + /** EvaluationErrorInfo errorMessage */ + errorMessage?: (string|null); + + /** EvaluationErrorInfo sessionId */ + sessionId?: (string|null); + } + + /** Represents an EvaluationErrorInfo. */ + class EvaluationErrorInfo implements IEvaluationErrorInfo { + + /** + * Constructs a new EvaluationErrorInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluationErrorInfo); + + /** EvaluationErrorInfo errorType. */ + public errorType: (google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType|keyof typeof google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType); + + /** EvaluationErrorInfo errorMessage. */ + public errorMessage: string; + + /** EvaluationErrorInfo sessionId. */ + public sessionId: string; + + /** + * Creates a new EvaluationErrorInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationErrorInfo instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluationErrorInfo): google.cloud.ces.v1beta.EvaluationErrorInfo; + + /** + * Encodes the specified EvaluationErrorInfo message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationErrorInfo.verify|verify} messages. + * @param message EvaluationErrorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluationErrorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationErrorInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationErrorInfo.verify|verify} messages. + * @param message EvaluationErrorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationErrorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationErrorInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationErrorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationErrorInfo; + + /** + * Decodes an EvaluationErrorInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationErrorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationErrorInfo; + + /** + * Verifies an EvaluationErrorInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationErrorInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationErrorInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationErrorInfo; + + /** + * Creates a plain object from an EvaluationErrorInfo message. Also converts values to other types if specified. + * @param message EvaluationErrorInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationErrorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationErrorInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationErrorInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EvaluationErrorInfo { + + /** ErrorType enum. */ + enum ErrorType { + ERROR_TYPE_UNSPECIFIED = 0, + RUNTIME_FAILURE = 1, + CONVERSATION_RETRIEVAL_FAILURE = 2, + METRIC_CALCULATION_FAILURE = 3, + EVALUATION_UPDATE_FAILURE = 4, + QUOTA_EXHAUSTED = 5, + USER_SIMULATION_FAILURE = 6 + } + } + + /** Properties of a RunEvaluationRequest. */ + interface IRunEvaluationRequest { + + /** RunEvaluationRequest app */ + app?: (string|null); + + /** RunEvaluationRequest evaluations */ + evaluations?: (string[]|null); + + /** RunEvaluationRequest evaluationDataset */ + evaluationDataset?: (string|null); + + /** RunEvaluationRequest displayName */ + displayName?: (string|null); + + /** RunEvaluationRequest appVersion */ + appVersion?: (string|null); + + /** RunEvaluationRequest config */ + config?: (google.cloud.ces.v1beta.IEvaluationConfig|null); + + /** RunEvaluationRequest runCount */ + runCount?: (number|null); + + /** RunEvaluationRequest personaRunConfigs */ + personaRunConfigs?: (google.cloud.ces.v1beta.IPersonaRunConfig[]|null); + + /** RunEvaluationRequest optimizationConfig */ + optimizationConfig?: (google.cloud.ces.v1beta.IOptimizationConfig|null); + + /** RunEvaluationRequest scheduledEvaluationRun */ + scheduledEvaluationRun?: (string|null); + + /** RunEvaluationRequest goldenRunMethod */ + goldenRunMethod?: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod|null); + + /** RunEvaluationRequest generateLatencyReport */ + generateLatencyReport?: (boolean|null); + } + + /** Represents a RunEvaluationRequest. */ + class RunEvaluationRequest implements IRunEvaluationRequest { + + /** + * Constructs a new RunEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRunEvaluationRequest); + + /** RunEvaluationRequest app. */ + public app: string; + + /** RunEvaluationRequest evaluations. */ + public evaluations: string[]; + + /** RunEvaluationRequest evaluationDataset. */ + public evaluationDataset: string; + + /** RunEvaluationRequest displayName. */ + public displayName: string; + + /** RunEvaluationRequest appVersion. */ + public appVersion: string; + + /** RunEvaluationRequest config. */ + public config?: (google.cloud.ces.v1beta.IEvaluationConfig|null); + + /** RunEvaluationRequest runCount. */ + public runCount?: (number|null); + + /** RunEvaluationRequest personaRunConfigs. */ + public personaRunConfigs: google.cloud.ces.v1beta.IPersonaRunConfig[]; + + /** RunEvaluationRequest optimizationConfig. */ + public optimizationConfig?: (google.cloud.ces.v1beta.IOptimizationConfig|null); + + /** RunEvaluationRequest scheduledEvaluationRun. */ + public scheduledEvaluationRun: string; + + /** RunEvaluationRequest goldenRunMethod. */ + public goldenRunMethod: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod); + + /** RunEvaluationRequest generateLatencyReport. */ + public generateLatencyReport: boolean; + + /** + * Creates a new RunEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunEvaluationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRunEvaluationRequest): google.cloud.ces.v1beta.RunEvaluationRequest; + + /** + * Encodes the specified RunEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationRequest.verify|verify} messages. + * @param message RunEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRunEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationRequest.verify|verify} messages. + * @param message RunEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRunEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RunEvaluationRequest; + + /** + * Decodes a RunEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RunEvaluationRequest; + + /** + * Verifies a RunEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RunEvaluationRequest; + + /** + * Creates a plain object from a RunEvaluationRequest message. Also converts values to other types if specified. + * @param message RunEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RunEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduledEvaluationRun. */ + interface IScheduledEvaluationRun { + + /** ScheduledEvaluationRun name */ + name?: (string|null); + + /** ScheduledEvaluationRun displayName */ + displayName?: (string|null); + + /** ScheduledEvaluationRun request */ + request?: (google.cloud.ces.v1beta.IRunEvaluationRequest|null); + + /** ScheduledEvaluationRun description */ + description?: (string|null); + + /** ScheduledEvaluationRun schedulingConfig */ + schedulingConfig?: (google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig|null); + + /** ScheduledEvaluationRun active */ + active?: (boolean|null); + + /** ScheduledEvaluationRun lastCompletedRun */ + lastCompletedRun?: (string|null); + + /** ScheduledEvaluationRun totalExecutions */ + totalExecutions?: (number|null); + + /** ScheduledEvaluationRun nextScheduledExecutionTime */ + nextScheduledExecutionTime?: (google.protobuf.ITimestamp|null); + + /** ScheduledEvaluationRun createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ScheduledEvaluationRun createdBy */ + createdBy?: (string|null); + + /** ScheduledEvaluationRun updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ScheduledEvaluationRun lastUpdatedBy */ + lastUpdatedBy?: (string|null); + + /** ScheduledEvaluationRun etag */ + etag?: (string|null); + } + + /** Represents a ScheduledEvaluationRun. */ + class ScheduledEvaluationRun implements IScheduledEvaluationRun { + + /** + * Constructs a new ScheduledEvaluationRun. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IScheduledEvaluationRun); + + /** ScheduledEvaluationRun name. */ + public name: string; + + /** ScheduledEvaluationRun displayName. */ + public displayName: string; + + /** ScheduledEvaluationRun request. */ + public request?: (google.cloud.ces.v1beta.IRunEvaluationRequest|null); + + /** ScheduledEvaluationRun description. */ + public description: string; + + /** ScheduledEvaluationRun schedulingConfig. */ + public schedulingConfig?: (google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig|null); + + /** ScheduledEvaluationRun active. */ + public active: boolean; + + /** ScheduledEvaluationRun lastCompletedRun. */ + public lastCompletedRun: string; + + /** ScheduledEvaluationRun totalExecutions. */ + public totalExecutions: number; + + /** ScheduledEvaluationRun nextScheduledExecutionTime. */ + public nextScheduledExecutionTime?: (google.protobuf.ITimestamp|null); + + /** ScheduledEvaluationRun createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ScheduledEvaluationRun createdBy. */ + public createdBy: string; + + /** ScheduledEvaluationRun updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ScheduledEvaluationRun lastUpdatedBy. */ + public lastUpdatedBy: string; + + /** ScheduledEvaluationRun etag. */ + public etag: string; + + /** + * Creates a new ScheduledEvaluationRun instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduledEvaluationRun instance + */ + public static create(properties?: google.cloud.ces.v1beta.IScheduledEvaluationRun): google.cloud.ces.v1beta.ScheduledEvaluationRun; + + /** + * Encodes the specified ScheduledEvaluationRun message. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.verify|verify} messages. + * @param message ScheduledEvaluationRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IScheduledEvaluationRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScheduledEvaluationRun message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.verify|verify} messages. + * @param message ScheduledEvaluationRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IScheduledEvaluationRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduledEvaluationRun message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScheduledEvaluationRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ScheduledEvaluationRun; + + /** + * Decodes a ScheduledEvaluationRun message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScheduledEvaluationRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ScheduledEvaluationRun; + + /** + * Verifies a ScheduledEvaluationRun message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScheduledEvaluationRun message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScheduledEvaluationRun + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ScheduledEvaluationRun; + + /** + * Creates a plain object from a ScheduledEvaluationRun message. Also converts values to other types if specified. + * @param message ScheduledEvaluationRun + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ScheduledEvaluationRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScheduledEvaluationRun to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScheduledEvaluationRun + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScheduledEvaluationRun { + + /** Properties of a SchedulingConfig. */ + interface ISchedulingConfig { + + /** SchedulingConfig frequency */ + frequency?: (google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency|keyof typeof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency|null); + + /** SchedulingConfig startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** SchedulingConfig daysOfWeek */ + daysOfWeek?: (number[]|null); + } + + /** Represents a SchedulingConfig. */ + class SchedulingConfig implements ISchedulingConfig { + + /** + * Constructs a new SchedulingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig); + + /** SchedulingConfig frequency. */ + public frequency: (google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency|keyof typeof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency); + + /** SchedulingConfig startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** SchedulingConfig daysOfWeek. */ + public daysOfWeek: number[]; + + /** + * Creates a new SchedulingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SchedulingConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig): google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig; + + /** + * Encodes the specified SchedulingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.verify|verify} messages. + * @param message SchedulingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchedulingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.verify|verify} messages. + * @param message SchedulingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchedulingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchedulingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig; + + /** + * Decodes a SchedulingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchedulingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig; + + /** + * Verifies a SchedulingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SchedulingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchedulingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig; + + /** + * Creates a plain object from a SchedulingConfig message. Also converts values to other types if specified. + * @param message SchedulingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchedulingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SchedulingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SchedulingConfig { + + /** Frequency enum. */ + enum Frequency { + FREQUENCY_UNSPECIFIED = 0, + NONE = 1, + DAILY = 2, + WEEKLY = 3, + BIWEEKLY = 4 + } + } + } + + /** Properties of a PersonaRunConfig. */ + interface IPersonaRunConfig { + + /** PersonaRunConfig persona */ + persona?: (string|null); + + /** PersonaRunConfig taskCount */ + taskCount?: (number|null); + } + + /** Represents a PersonaRunConfig. */ + class PersonaRunConfig implements IPersonaRunConfig { + + /** + * Constructs a new PersonaRunConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IPersonaRunConfig); + + /** PersonaRunConfig persona. */ + public persona: string; + + /** PersonaRunConfig taskCount. */ + public taskCount: number; + + /** + * Creates a new PersonaRunConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonaRunConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IPersonaRunConfig): google.cloud.ces.v1beta.PersonaRunConfig; + + /** + * Encodes the specified PersonaRunConfig message. Does not implicitly {@link google.cloud.ces.v1beta.PersonaRunConfig.verify|verify} messages. + * @param message PersonaRunConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IPersonaRunConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersonaRunConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.PersonaRunConfig.verify|verify} messages. + * @param message PersonaRunConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IPersonaRunConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersonaRunConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonaRunConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.PersonaRunConfig; + + /** + * Decodes a PersonaRunConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonaRunConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.PersonaRunConfig; + + /** + * Verifies a PersonaRunConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PersonaRunConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonaRunConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.PersonaRunConfig; + + /** + * Creates a plain object from a PersonaRunConfig message. Also converts values to other types if specified. + * @param message PersonaRunConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.PersonaRunConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersonaRunConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PersonaRunConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OptimizationConfig. */ + interface IOptimizationConfig { + + /** OptimizationConfig generateLossReport */ + generateLossReport?: (boolean|null); + + /** OptimizationConfig assistantSession */ + assistantSession?: (string|null); + + /** OptimizationConfig reportSummary */ + reportSummary?: (string|null); + + /** OptimizationConfig shouldSuggestFix */ + shouldSuggestFix?: (boolean|null); + + /** OptimizationConfig status */ + status?: (google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus|keyof typeof google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus|null); + + /** OptimizationConfig errorMessage */ + errorMessage?: (string|null); + + /** OptimizationConfig lossReport */ + lossReport?: (google.protobuf.IStruct|null); + } + + /** Represents an OptimizationConfig. */ + class OptimizationConfig implements IOptimizationConfig { + + /** + * Constructs a new OptimizationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IOptimizationConfig); + + /** OptimizationConfig generateLossReport. */ + public generateLossReport: boolean; + + /** OptimizationConfig assistantSession. */ + public assistantSession: string; + + /** OptimizationConfig reportSummary. */ + public reportSummary: string; + + /** OptimizationConfig shouldSuggestFix. */ + public shouldSuggestFix: boolean; + + /** OptimizationConfig status. */ + public status: (google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus|keyof typeof google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus); + + /** OptimizationConfig errorMessage. */ + public errorMessage: string; + + /** OptimizationConfig lossReport. */ + public lossReport?: (google.protobuf.IStruct|null); + + /** + * Creates a new OptimizationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OptimizationConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IOptimizationConfig): google.cloud.ces.v1beta.OptimizationConfig; + + /** + * Encodes the specified OptimizationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OptimizationConfig.verify|verify} messages. + * @param message OptimizationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IOptimizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OptimizationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OptimizationConfig.verify|verify} messages. + * @param message OptimizationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IOptimizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OptimizationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OptimizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OptimizationConfig; + + /** + * Decodes an OptimizationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OptimizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OptimizationConfig; + + /** + * Verifies an OptimizationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OptimizationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OptimizationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OptimizationConfig; + + /** + * Creates a plain object from an OptimizationConfig message. Also converts values to other types if specified. + * @param message OptimizationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OptimizationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OptimizationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OptimizationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OptimizationConfig { + + /** OptimizationStatus enum. */ + enum OptimizationStatus { + OPTIMIZATION_STATUS_UNSPECIFIED = 0, + RUNNING = 1, + COMPLETED = 2, + ERROR = 3 + } + } + + /** Represents a SessionService */ + class SessionService extends $protobuf.rpc.Service { + + /** + * Constructs a new SessionService 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 SessionService 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): SessionService; + + /** + * Calls RunSession. + * @param request RunSessionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RunSessionResponse + */ + public runSession(request: google.cloud.ces.v1beta.IRunSessionRequest, callback: google.cloud.ces.v1beta.SessionService.RunSessionCallback): void; + + /** + * Calls RunSession. + * @param request RunSessionRequest message or plain object + * @returns Promise + */ + public runSession(request: google.cloud.ces.v1beta.IRunSessionRequest): Promise; + + /** + * Calls BidiRunSession. + * @param request BidiSessionClientMessage message or plain object + * @param callback Node-style callback called with the error, if any, and BidiSessionServerMessage + */ + public bidiRunSession(request: google.cloud.ces.v1beta.IBidiSessionClientMessage, callback: google.cloud.ces.v1beta.SessionService.BidiRunSessionCallback): void; + + /** + * Calls BidiRunSession. + * @param request BidiSessionClientMessage message or plain object + * @returns Promise + */ + public bidiRunSession(request: google.cloud.ces.v1beta.IBidiSessionClientMessage): Promise; + } + + namespace SessionService { + + /** + * Callback as used by {@link google.cloud.ces.v1beta.SessionService|runSession}. + * @param error Error, if any + * @param [response] RunSessionResponse + */ + type RunSessionCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.RunSessionResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.SessionService|bidiRunSession}. + * @param error Error, if any + * @param [response] BidiSessionServerMessage + */ + type BidiRunSessionCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.BidiSessionServerMessage) => void; + } + + /** AudioEncoding enum. */ + enum AudioEncoding { + AUDIO_ENCODING_UNSPECIFIED = 0, + LINEAR16 = 1, + MULAW = 2, + ALAW = 3 + } + + /** Properties of an InputAudioConfig. */ + interface IInputAudioConfig { + + /** InputAudioConfig audioEncoding */ + audioEncoding?: (google.cloud.ces.v1beta.AudioEncoding|keyof typeof google.cloud.ces.v1beta.AudioEncoding|null); + + /** InputAudioConfig sampleRateHertz */ + sampleRateHertz?: (number|null); + + /** InputAudioConfig noiseSuppressionLevel */ + noiseSuppressionLevel?: (string|null); + } + + /** Represents an InputAudioConfig. */ + class InputAudioConfig implements IInputAudioConfig { + + /** + * Constructs a new InputAudioConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IInputAudioConfig); + + /** InputAudioConfig audioEncoding. */ + public audioEncoding: (google.cloud.ces.v1beta.AudioEncoding|keyof typeof google.cloud.ces.v1beta.AudioEncoding); + + /** InputAudioConfig sampleRateHertz. */ + public sampleRateHertz: number; + + /** InputAudioConfig noiseSuppressionLevel. */ + public noiseSuppressionLevel: string; + + /** + * Creates a new InputAudioConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputAudioConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IInputAudioConfig): google.cloud.ces.v1beta.InputAudioConfig; + + /** + * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1beta.InputAudioConfig.verify|verify} messages. + * @param message InputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.InputAudioConfig.verify|verify} messages. + * @param message InputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.InputAudioConfig; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.InputAudioConfig; + + /** + * Verifies an InputAudioConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputAudioConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.InputAudioConfig; + + /** + * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. + * @param message InputAudioConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.InputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputAudioConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputAudioConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutputAudioConfig. */ + interface IOutputAudioConfig { + + /** OutputAudioConfig audioEncoding */ + audioEncoding?: (google.cloud.ces.v1beta.AudioEncoding|keyof typeof google.cloud.ces.v1beta.AudioEncoding|null); + + /** OutputAudioConfig sampleRateHertz */ + sampleRateHertz?: (number|null); + } + + /** Represents an OutputAudioConfig. */ + class OutputAudioConfig implements IOutputAudioConfig { + + /** + * Constructs a new OutputAudioConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IOutputAudioConfig); + + /** OutputAudioConfig audioEncoding. */ + public audioEncoding: (google.cloud.ces.v1beta.AudioEncoding|keyof typeof google.cloud.ces.v1beta.AudioEncoding); + + /** OutputAudioConfig sampleRateHertz. */ + public sampleRateHertz: number; + + /** + * Creates a new OutputAudioConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputAudioConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IOutputAudioConfig): google.cloud.ces.v1beta.OutputAudioConfig; + + /** + * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OutputAudioConfig.verify|verify} messages. + * @param message OutputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OutputAudioConfig.verify|verify} messages. + * @param message OutputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OutputAudioConfig; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OutputAudioConfig; + + /** + * Verifies an OutputAudioConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputAudioConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OutputAudioConfig; + + /** + * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. + * @param message OutputAudioConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OutputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputAudioConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputAudioConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SessionConfig. */ + interface ISessionConfig { + + /** SessionConfig session */ + session?: (string|null); + + /** SessionConfig inputAudioConfig */ + inputAudioConfig?: (google.cloud.ces.v1beta.IInputAudioConfig|null); + + /** SessionConfig outputAudioConfig */ + outputAudioConfig?: (google.cloud.ces.v1beta.IOutputAudioConfig|null); + + /** SessionConfig historicalContexts */ + historicalContexts?: (google.cloud.ces.v1beta.IMessage[]|null); + + /** SessionConfig entryAgent */ + entryAgent?: (string|null); + + /** SessionConfig deployment */ + deployment?: (string|null); + + /** SessionConfig timeZone */ + timeZone?: (string|null); + + /** SessionConfig remoteDialogflowQueryParameters */ + remoteDialogflowQueryParameters?: (google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters|null); + } + + /** Represents a SessionConfig. */ + class SessionConfig implements ISessionConfig { + + /** + * Constructs a new SessionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ISessionConfig); + + /** SessionConfig session. */ + public session: string; + + /** SessionConfig inputAudioConfig. */ + public inputAudioConfig?: (google.cloud.ces.v1beta.IInputAudioConfig|null); + + /** SessionConfig outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.ces.v1beta.IOutputAudioConfig|null); + + /** SessionConfig historicalContexts. */ + public historicalContexts: google.cloud.ces.v1beta.IMessage[]; + + /** SessionConfig entryAgent. */ + public entryAgent: string; + + /** SessionConfig deployment. */ + public deployment: string; + + /** SessionConfig timeZone. */ + public timeZone: string; + + /** SessionConfig remoteDialogflowQueryParameters. */ + public remoteDialogflowQueryParameters?: (google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters|null); + + /** + * Creates a new SessionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.ISessionConfig): google.cloud.ces.v1beta.SessionConfig; + + /** + * Encodes the specified SessionConfig message. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.verify|verify} messages. + * @param message SessionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ISessionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.verify|verify} messages. + * @param message SessionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ISessionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SessionConfig; + + /** + * Decodes a SessionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SessionConfig; + + /** + * Verifies a SessionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SessionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SessionConfig; + + /** + * Creates a plain object from a SessionConfig message. Also converts values to other types if specified. + * @param message SessionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.SessionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SessionConfig { + + /** Properties of a RemoteDialogflowQueryParameters. */ + interface IRemoteDialogflowQueryParameters { + + /** RemoteDialogflowQueryParameters webhookHeaders */ + webhookHeaders?: ({ [k: string]: string }|null); + + /** RemoteDialogflowQueryParameters payload */ + payload?: (google.protobuf.IStruct|null); + + /** RemoteDialogflowQueryParameters endUserMetadata */ + endUserMetadata?: (google.protobuf.IStruct|null); + } + + /** Represents a RemoteDialogflowQueryParameters. */ + class RemoteDialogflowQueryParameters implements IRemoteDialogflowQueryParameters { + + /** + * Constructs a new RemoteDialogflowQueryParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters); + + /** RemoteDialogflowQueryParameters webhookHeaders. */ + public webhookHeaders: { [k: string]: string }; + + /** RemoteDialogflowQueryParameters payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** RemoteDialogflowQueryParameters endUserMetadata. */ + public endUserMetadata?: (google.protobuf.IStruct|null); + + /** + * Creates a new RemoteDialogflowQueryParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoteDialogflowQueryParameters instance + */ + public static create(properties?: google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters): google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters; + + /** + * Encodes the specified RemoteDialogflowQueryParameters message. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. + * @param message RemoteDialogflowQueryParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoteDialogflowQueryParameters message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. + * @param message RemoteDialogflowQueryParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoteDialogflowQueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters; + + /** + * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoteDialogflowQueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters; + + /** + * Verifies a RemoteDialogflowQueryParameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoteDialogflowQueryParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoteDialogflowQueryParameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters; + + /** + * Creates a plain object from a RemoteDialogflowQueryParameters message. Also converts values to other types if specified. + * @param message RemoteDialogflowQueryParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoteDialogflowQueryParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoteDialogflowQueryParameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ToolCalls. */ + interface IToolCalls { + + /** ToolCalls toolCalls */ + toolCalls?: (google.cloud.ces.v1beta.IToolCall[]|null); + } + + /** Represents a ToolCalls. */ + class ToolCalls implements IToolCalls { + + /** + * Constructs a new ToolCalls. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IToolCalls); + + /** ToolCalls toolCalls. */ + public toolCalls: google.cloud.ces.v1beta.IToolCall[]; + + /** + * Creates a new ToolCalls instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolCalls instance + */ + public static create(properties?: google.cloud.ces.v1beta.IToolCalls): google.cloud.ces.v1beta.ToolCalls; + + /** + * Encodes the specified ToolCalls message. Does not implicitly {@link google.cloud.ces.v1beta.ToolCalls.verify|verify} messages. + * @param message ToolCalls message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IToolCalls, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolCalls message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolCalls.verify|verify} messages. + * @param message ToolCalls message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IToolCalls, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolCalls message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolCalls + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ToolCalls; + + /** + * Decodes a ToolCalls message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolCalls + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ToolCalls; + + /** + * Verifies a ToolCalls message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolCalls message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolCalls + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ToolCalls; + + /** + * Creates a plain object from a ToolCalls message. Also converts values to other types if specified. + * @param message ToolCalls + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ToolCalls, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolCalls to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolCalls + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolResponses. */ + interface IToolResponses { + + /** ToolResponses toolResponses */ + toolResponses?: (google.cloud.ces.v1beta.IToolResponse[]|null); + } + + /** Represents a ToolResponses. */ + class ToolResponses implements IToolResponses { + + /** + * Constructs a new ToolResponses. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IToolResponses); + + /** ToolResponses toolResponses. */ + public toolResponses: google.cloud.ces.v1beta.IToolResponse[]; + + /** + * Creates a new ToolResponses instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolResponses instance + */ + public static create(properties?: google.cloud.ces.v1beta.IToolResponses): google.cloud.ces.v1beta.ToolResponses; + + /** + * Encodes the specified ToolResponses message. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponses.verify|verify} messages. + * @param message ToolResponses message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IToolResponses, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolResponses message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponses.verify|verify} messages. + * @param message ToolResponses message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IToolResponses, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolResponses message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ToolResponses; + + /** + * Decodes a ToolResponses message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ToolResponses; + + /** + * Verifies a ToolResponses message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolResponses message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolResponses + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ToolResponses; + + /** + * Creates a plain object from a ToolResponses message. Also converts values to other types if specified. + * @param message ToolResponses + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ToolResponses, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolResponses to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolResponses + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Citations. */ + interface ICitations { + + /** Citations citedChunks */ + citedChunks?: (google.cloud.ces.v1beta.Citations.ICitedChunk[]|null); + } + + /** Represents a Citations. */ + class Citations implements ICitations { + + /** + * Constructs a new Citations. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICitations); + + /** Citations citedChunks. */ + public citedChunks: google.cloud.ces.v1beta.Citations.ICitedChunk[]; + + /** + * Creates a new Citations instance using the specified properties. + * @param [properties] Properties to set + * @returns Citations instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICitations): google.cloud.ces.v1beta.Citations; + + /** + * Encodes the specified Citations message. Does not implicitly {@link google.cloud.ces.v1beta.Citations.verify|verify} messages. + * @param message Citations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICitations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Citations message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Citations.verify|verify} messages. + * @param message Citations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICitations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Citations message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Citations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Citations; + + /** + * Decodes a Citations message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Citations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Citations; + + /** + * Verifies a Citations message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Citations message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Citations + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Citations; + + /** + * Creates a plain object from a Citations message. Also converts values to other types if specified. + * @param message Citations + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Citations, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Citations to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Citations + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Citations { + + /** Properties of a CitedChunk. */ + interface ICitedChunk { + + /** CitedChunk uri */ + uri?: (string|null); + + /** CitedChunk title */ + title?: (string|null); + + /** CitedChunk text */ + text?: (string|null); + } + + /** Represents a CitedChunk. */ + class CitedChunk implements ICitedChunk { + + /** + * Constructs a new CitedChunk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Citations.ICitedChunk); + + /** CitedChunk uri. */ + public uri: string; + + /** CitedChunk title. */ + public title: string; + + /** CitedChunk text. */ + public text: string; + + /** + * Creates a new CitedChunk instance using the specified properties. + * @param [properties] Properties to set + * @returns CitedChunk instance + */ + public static create(properties?: google.cloud.ces.v1beta.Citations.ICitedChunk): google.cloud.ces.v1beta.Citations.CitedChunk; + + /** + * Encodes the specified CitedChunk message. Does not implicitly {@link google.cloud.ces.v1beta.Citations.CitedChunk.verify|verify} messages. + * @param message CitedChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Citations.ICitedChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CitedChunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Citations.CitedChunk.verify|verify} messages. + * @param message CitedChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Citations.ICitedChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CitedChunk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CitedChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Citations.CitedChunk; + + /** + * Decodes a CitedChunk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CitedChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Citations.CitedChunk; + + /** + * Verifies a CitedChunk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CitedChunk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CitedChunk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Citations.CitedChunk; + + /** + * Creates a plain object from a CitedChunk message. Also converts values to other types if specified. + * @param message CitedChunk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Citations.CitedChunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CitedChunk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CitedChunk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an Event. */ + interface IEvent { + + /** Event event */ + event?: (string|null); + } + + /** Represents an Event. */ + class Event implements IEvent { + + /** + * Constructs a new Event. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvent); + + /** Event event. */ + public event: string; + + /** + * Creates a new Event instance using the specified properties. + * @param [properties] Properties to set + * @returns Event instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvent): google.cloud.ces.v1beta.Event; + + /** + * Encodes the specified Event message. Does not implicitly {@link google.cloud.ces.v1beta.Event.verify|verify} messages. + * @param message Event message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Event.verify|verify} messages. + * @param message Event message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Event message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Event; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Event; + + /** + * Verifies an Event message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Event message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Event + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Event; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @param message Event + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Event, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Event to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Event + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SessionInput. */ + interface ISessionInput { + + /** SessionInput text */ + text?: (string|null); + + /** SessionInput dtmf */ + dtmf?: (string|null); + + /** SessionInput audio */ + audio?: (Uint8Array|Buffer|string|null); + + /** SessionInput toolResponses */ + toolResponses?: (google.cloud.ces.v1beta.IToolResponses|null); + + /** SessionInput image */ + image?: (google.cloud.ces.v1beta.IImage|null); + + /** SessionInput blob */ + blob?: (google.cloud.ces.v1beta.IBlob|null); + + /** SessionInput variables */ + variables?: (google.protobuf.IStruct|null); + + /** SessionInput event */ + event?: (google.cloud.ces.v1beta.IEvent|null); + + /** SessionInput willContinue */ + willContinue?: (boolean|null); + } + + /** Represents a SessionInput. */ + class SessionInput implements ISessionInput { + + /** + * Constructs a new SessionInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ISessionInput); + + /** SessionInput text. */ + public text?: (string|null); + + /** SessionInput dtmf. */ + public dtmf?: (string|null); + + /** SessionInput audio. */ + public audio?: (Uint8Array|Buffer|string|null); + + /** SessionInput toolResponses. */ + public toolResponses?: (google.cloud.ces.v1beta.IToolResponses|null); + + /** SessionInput image. */ + public image?: (google.cloud.ces.v1beta.IImage|null); + + /** SessionInput blob. */ + public blob?: (google.cloud.ces.v1beta.IBlob|null); + + /** SessionInput variables. */ + public variables?: (google.protobuf.IStruct|null); + + /** SessionInput event. */ + public event?: (google.cloud.ces.v1beta.IEvent|null); + + /** SessionInput willContinue. */ + public willContinue: boolean; + + /** SessionInput inputType. */ + public inputType?: ("text"|"dtmf"|"audio"|"toolResponses"|"image"|"blob"|"variables"|"event"); + + /** + * Creates a new SessionInput instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionInput instance + */ + public static create(properties?: google.cloud.ces.v1beta.ISessionInput): google.cloud.ces.v1beta.SessionInput; + + /** + * Encodes the specified SessionInput message. Does not implicitly {@link google.cloud.ces.v1beta.SessionInput.verify|verify} messages. + * @param message SessionInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ISessionInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionInput message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionInput.verify|verify} messages. + * @param message SessionInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ISessionInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SessionInput; + + /** + * Decodes a SessionInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SessionInput; + + /** + * Verifies a SessionInput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SessionInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SessionInput; + + /** + * Creates a plain object from a SessionInput message. Also converts values to other types if specified. + * @param message SessionInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.SessionInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SessionOutput. */ + interface ISessionOutput { + + /** SessionOutput text */ + text?: (string|null); + + /** SessionOutput audio */ + audio?: (Uint8Array|Buffer|string|null); + + /** SessionOutput toolCalls */ + toolCalls?: (google.cloud.ces.v1beta.IToolCalls|null); + + /** SessionOutput citations */ + citations?: (google.cloud.ces.v1beta.ICitations|null); + + /** SessionOutput googleSearchSuggestions */ + googleSearchSuggestions?: (google.cloud.ces.v1beta.IGoogleSearchSuggestions|null); + + /** SessionOutput endSession */ + endSession?: (google.cloud.ces.v1beta.IEndSession|null); + + /** SessionOutput payload */ + payload?: (google.protobuf.IStruct|null); + + /** SessionOutput turnIndex */ + turnIndex?: (number|null); + + /** SessionOutput turnCompleted */ + turnCompleted?: (boolean|null); + + /** SessionOutput diagnosticInfo */ + diagnosticInfo?: (google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo|null); + } + + /** Represents a SessionOutput. */ + class SessionOutput implements ISessionOutput { + + /** + * Constructs a new SessionOutput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ISessionOutput); + + /** SessionOutput text. */ + public text?: (string|null); + + /** SessionOutput audio. */ + public audio?: (Uint8Array|Buffer|string|null); + + /** SessionOutput toolCalls. */ + public toolCalls?: (google.cloud.ces.v1beta.IToolCalls|null); + + /** SessionOutput citations. */ + public citations?: (google.cloud.ces.v1beta.ICitations|null); + + /** SessionOutput googleSearchSuggestions. */ + public googleSearchSuggestions?: (google.cloud.ces.v1beta.IGoogleSearchSuggestions|null); + + /** SessionOutput endSession. */ + public endSession?: (google.cloud.ces.v1beta.IEndSession|null); + + /** SessionOutput payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** SessionOutput turnIndex. */ + public turnIndex: number; + + /** SessionOutput turnCompleted. */ + public turnCompleted: boolean; + + /** SessionOutput diagnosticInfo. */ + public diagnosticInfo?: (google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo|null); + + /** SessionOutput outputType. */ + public outputType?: ("text"|"audio"|"toolCalls"|"citations"|"googleSearchSuggestions"|"endSession"|"payload"); + + /** + * Creates a new SessionOutput instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionOutput instance + */ + public static create(properties?: google.cloud.ces.v1beta.ISessionOutput): google.cloud.ces.v1beta.SessionOutput; + + /** + * Encodes the specified SessionOutput message. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.verify|verify} messages. + * @param message SessionOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ISessionOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionOutput message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.verify|verify} messages. + * @param message SessionOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ISessionOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionOutput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SessionOutput; + + /** + * Decodes a SessionOutput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SessionOutput; + + /** + * Verifies a SessionOutput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SessionOutput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionOutput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SessionOutput; + + /** + * Creates a plain object from a SessionOutput message. Also converts values to other types if specified. + * @param message SessionOutput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.SessionOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionOutput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionOutput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SessionOutput { + + /** Properties of a DiagnosticInfo. */ + interface IDiagnosticInfo { + + /** DiagnosticInfo messages */ + messages?: (google.cloud.ces.v1beta.IMessage[]|null); + + /** DiagnosticInfo rootSpan */ + rootSpan?: (google.cloud.ces.v1beta.ISpan|null); + } + + /** Represents a DiagnosticInfo. */ + class DiagnosticInfo implements IDiagnosticInfo { + + /** + * Constructs a new DiagnosticInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo); + + /** DiagnosticInfo messages. */ + public messages: google.cloud.ces.v1beta.IMessage[]; + + /** DiagnosticInfo rootSpan. */ + public rootSpan?: (google.cloud.ces.v1beta.ISpan|null); + + /** + * Creates a new DiagnosticInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DiagnosticInfo instance + */ + public static create(properties?: google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo): google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo; + + /** + * Encodes the specified DiagnosticInfo message. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.verify|verify} messages. + * @param message DiagnosticInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiagnosticInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.verify|verify} messages. + * @param message DiagnosticInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiagnosticInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiagnosticInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo; + + /** + * Decodes a DiagnosticInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiagnosticInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo; + + /** + * Verifies a DiagnosticInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiagnosticInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiagnosticInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo; + + /** + * Creates a plain object from a DiagnosticInfo message. Also converts values to other types if specified. + * @param message DiagnosticInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiagnosticInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DiagnosticInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RecognitionResult. */ + interface IRecognitionResult { + + /** RecognitionResult transcript */ + transcript?: (string|null); + } + + /** Represents a RecognitionResult. */ + class RecognitionResult implements IRecognitionResult { + + /** + * Constructs a new RecognitionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRecognitionResult); + + /** RecognitionResult transcript. */ + public transcript: string; + + /** + * Creates a new RecognitionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognitionResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRecognitionResult): google.cloud.ces.v1beta.RecognitionResult; + + /** + * Encodes the specified RecognitionResult message. Does not implicitly {@link google.cloud.ces.v1beta.RecognitionResult.verify|verify} messages. + * @param message RecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognitionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RecognitionResult.verify|verify} messages. + * @param message RecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognitionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RecognitionResult; + + /** + * Decodes a RecognitionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RecognitionResult; + + /** + * Verifies a RecognitionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognitionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognitionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RecognitionResult; + + /** + * Creates a plain object from a RecognitionResult message. Also converts values to other types if specified. + * @param message RecognitionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognitionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognitionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InterruptionSignal. */ + interface IInterruptionSignal { + + /** InterruptionSignal bargeIn */ + bargeIn?: (boolean|null); + } + + /** Represents an InterruptionSignal. */ + class InterruptionSignal implements IInterruptionSignal { + + /** + * Constructs a new InterruptionSignal. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IInterruptionSignal); + + /** InterruptionSignal bargeIn. */ + public bargeIn: boolean; + + /** + * Creates a new InterruptionSignal instance using the specified properties. + * @param [properties] Properties to set + * @returns InterruptionSignal instance + */ + public static create(properties?: google.cloud.ces.v1beta.IInterruptionSignal): google.cloud.ces.v1beta.InterruptionSignal; + + /** + * Encodes the specified InterruptionSignal message. Does not implicitly {@link google.cloud.ces.v1beta.InterruptionSignal.verify|verify} messages. + * @param message InterruptionSignal message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IInterruptionSignal, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterruptionSignal message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.InterruptionSignal.verify|verify} messages. + * @param message InterruptionSignal message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IInterruptionSignal, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterruptionSignal message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterruptionSignal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.InterruptionSignal; + + /** + * Decodes an InterruptionSignal message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterruptionSignal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.InterruptionSignal; + + /** + * Verifies an InterruptionSignal message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterruptionSignal message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterruptionSignal + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.InterruptionSignal; + + /** + * Creates a plain object from an InterruptionSignal message. Also converts values to other types if specified. + * @param message InterruptionSignal + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.InterruptionSignal, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterruptionSignal to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InterruptionSignal + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EndSession. */ + interface IEndSession { + + /** EndSession metadata */ + metadata?: (google.protobuf.IStruct|null); + } + + /** Represents an EndSession. */ + class EndSession implements IEndSession { + + /** + * Constructs a new EndSession. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEndSession); + + /** EndSession metadata. */ + public metadata?: (google.protobuf.IStruct|null); + + /** + * Creates a new EndSession instance using the specified properties. + * @param [properties] Properties to set + * @returns EndSession instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEndSession): google.cloud.ces.v1beta.EndSession; + + /** + * Encodes the specified EndSession message. Does not implicitly {@link google.cloud.ces.v1beta.EndSession.verify|verify} messages. + * @param message EndSession message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEndSession, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndSession message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndSession.verify|verify} messages. + * @param message EndSession message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEndSession, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndSession message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndSession + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EndSession; + + /** + * Decodes an EndSession message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndSession + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EndSession; + + /** + * Verifies an EndSession message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EndSession message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndSession + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EndSession; + + /** + * Creates a plain object from an EndSession message. Also converts values to other types if specified. + * @param message EndSession + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EndSession, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndSession to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndSession + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoAway. */ + interface IGoAway { + } + + /** Represents a GoAway. */ + class GoAway implements IGoAway { + + /** + * Constructs a new GoAway. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGoAway); + + /** + * Creates a new GoAway instance using the specified properties. + * @param [properties] Properties to set + * @returns GoAway instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGoAway): google.cloud.ces.v1beta.GoAway; + + /** + * Encodes the specified GoAway message. Does not implicitly {@link google.cloud.ces.v1beta.GoAway.verify|verify} messages. + * @param message GoAway message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGoAway, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoAway message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoAway.verify|verify} messages. + * @param message GoAway message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGoAway, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoAway message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoAway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GoAway; + + /** + * Decodes a GoAway message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoAway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GoAway; + + /** + * Verifies a GoAway message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoAway message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoAway + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GoAway; + + /** + * Creates a plain object from a GoAway message. Also converts values to other types if specified. + * @param message GoAway + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GoAway, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoAway to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoAway + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunSessionRequest. */ + interface IRunSessionRequest { + + /** RunSessionRequest config */ + config?: (google.cloud.ces.v1beta.ISessionConfig|null); + + /** RunSessionRequest inputs */ + inputs?: (google.cloud.ces.v1beta.ISessionInput[]|null); + } + + /** Represents a RunSessionRequest. */ + class RunSessionRequest implements IRunSessionRequest { + + /** + * Constructs a new RunSessionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRunSessionRequest); + + /** RunSessionRequest config. */ + public config?: (google.cloud.ces.v1beta.ISessionConfig|null); + + /** RunSessionRequest inputs. */ + public inputs: google.cloud.ces.v1beta.ISessionInput[]; + + /** + * Creates a new RunSessionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunSessionRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRunSessionRequest): google.cloud.ces.v1beta.RunSessionRequest; + + /** + * Encodes the specified RunSessionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionRequest.verify|verify} messages. + * @param message RunSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRunSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunSessionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionRequest.verify|verify} messages. + * @param message RunSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRunSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunSessionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RunSessionRequest; + + /** + * Decodes a RunSessionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RunSessionRequest; + + /** + * Verifies a RunSessionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunSessionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunSessionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RunSessionRequest; + + /** + * Creates a plain object from a RunSessionRequest message. Also converts values to other types if specified. + * @param message RunSessionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RunSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunSessionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunSessionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunSessionResponse. */ + interface IRunSessionResponse { + + /** RunSessionResponse outputs */ + outputs?: (google.cloud.ces.v1beta.ISessionOutput[]|null); + } + + /** Represents a RunSessionResponse. */ + class RunSessionResponse implements IRunSessionResponse { + + /** + * Constructs a new RunSessionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRunSessionResponse); + + /** RunSessionResponse outputs. */ + public outputs: google.cloud.ces.v1beta.ISessionOutput[]; + + /** + * Creates a new RunSessionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunSessionResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRunSessionResponse): google.cloud.ces.v1beta.RunSessionResponse; + + /** + * Encodes the specified RunSessionResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionResponse.verify|verify} messages. + * @param message RunSessionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRunSessionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunSessionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionResponse.verify|verify} messages. + * @param message RunSessionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRunSessionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunSessionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunSessionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RunSessionResponse; + + /** + * Decodes a RunSessionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunSessionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RunSessionResponse; + + /** + * Verifies a RunSessionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunSessionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunSessionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RunSessionResponse; + + /** + * Creates a plain object from a RunSessionResponse message. Also converts values to other types if specified. + * @param message RunSessionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RunSessionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunSessionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunSessionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiSessionClientMessage. */ + interface IBidiSessionClientMessage { + + /** BidiSessionClientMessage config */ + config?: (google.cloud.ces.v1beta.ISessionConfig|null); + + /** BidiSessionClientMessage realtimeInput */ + realtimeInput?: (google.cloud.ces.v1beta.ISessionInput|null); + } + + /** Represents a BidiSessionClientMessage. */ + class BidiSessionClientMessage implements IBidiSessionClientMessage { + + /** + * Constructs a new BidiSessionClientMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IBidiSessionClientMessage); + + /** BidiSessionClientMessage config. */ + public config?: (google.cloud.ces.v1beta.ISessionConfig|null); + + /** BidiSessionClientMessage realtimeInput. */ + public realtimeInput?: (google.cloud.ces.v1beta.ISessionInput|null); + + /** BidiSessionClientMessage messageType. */ + public messageType?: ("config"|"realtimeInput"); + + /** + * Creates a new BidiSessionClientMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiSessionClientMessage instance + */ + public static create(properties?: google.cloud.ces.v1beta.IBidiSessionClientMessage): google.cloud.ces.v1beta.BidiSessionClientMessage; + + /** + * Encodes the specified BidiSessionClientMessage message. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionClientMessage.verify|verify} messages. + * @param message BidiSessionClientMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IBidiSessionClientMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiSessionClientMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionClientMessage.verify|verify} messages. + * @param message BidiSessionClientMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IBidiSessionClientMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiSessionClientMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiSessionClientMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BidiSessionClientMessage; + + /** + * Decodes a BidiSessionClientMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiSessionClientMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BidiSessionClientMessage; + + /** + * Verifies a BidiSessionClientMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiSessionClientMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiSessionClientMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BidiSessionClientMessage; + + /** + * Creates a plain object from a BidiSessionClientMessage message. Also converts values to other types if specified. + * @param message BidiSessionClientMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.BidiSessionClientMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiSessionClientMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiSessionClientMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiSessionServerMessage. */ + interface IBidiSessionServerMessage { + + /** BidiSessionServerMessage sessionOutput */ + sessionOutput?: (google.cloud.ces.v1beta.ISessionOutput|null); + + /** BidiSessionServerMessage recognitionResult */ + recognitionResult?: (google.cloud.ces.v1beta.IRecognitionResult|null); + + /** BidiSessionServerMessage interruptionSignal */ + interruptionSignal?: (google.cloud.ces.v1beta.IInterruptionSignal|null); + + /** BidiSessionServerMessage endSession */ + endSession?: (google.cloud.ces.v1beta.IEndSession|null); + + /** BidiSessionServerMessage goAway */ + goAway?: (google.cloud.ces.v1beta.IGoAway|null); + } + + /** Represents a BidiSessionServerMessage. */ + class BidiSessionServerMessage implements IBidiSessionServerMessage { + + /** + * Constructs a new BidiSessionServerMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IBidiSessionServerMessage); + + /** BidiSessionServerMessage sessionOutput. */ + public sessionOutput?: (google.cloud.ces.v1beta.ISessionOutput|null); + + /** BidiSessionServerMessage recognitionResult. */ + public recognitionResult?: (google.cloud.ces.v1beta.IRecognitionResult|null); + + /** BidiSessionServerMessage interruptionSignal. */ + public interruptionSignal?: (google.cloud.ces.v1beta.IInterruptionSignal|null); + + /** BidiSessionServerMessage endSession. */ + public endSession?: (google.cloud.ces.v1beta.IEndSession|null); + + /** BidiSessionServerMessage goAway. */ + public goAway?: (google.cloud.ces.v1beta.IGoAway|null); + + /** BidiSessionServerMessage messageType. */ + public messageType?: ("sessionOutput"|"recognitionResult"|"interruptionSignal"|"endSession"|"goAway"); + + /** + * Creates a new BidiSessionServerMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiSessionServerMessage instance + */ + public static create(properties?: google.cloud.ces.v1beta.IBidiSessionServerMessage): google.cloud.ces.v1beta.BidiSessionServerMessage; + + /** + * Encodes the specified BidiSessionServerMessage message. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionServerMessage.verify|verify} messages. + * @param message BidiSessionServerMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IBidiSessionServerMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiSessionServerMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionServerMessage.verify|verify} messages. + * @param message BidiSessionServerMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IBidiSessionServerMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiSessionServerMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiSessionServerMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BidiSessionServerMessage; + + /** + * Decodes a BidiSessionServerMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiSessionServerMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BidiSessionServerMessage; + + /** + * Verifies a BidiSessionServerMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiSessionServerMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiSessionServerMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BidiSessionServerMessage; + + /** + * Creates a plain object from a BidiSessionServerMessage message. Also converts values to other types if specified. + * @param message BidiSessionServerMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.BidiSessionServerMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiSessionServerMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiSessionServerMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoogleSearchSuggestions. */ + interface IGoogleSearchSuggestions { + + /** GoogleSearchSuggestions htmls */ + htmls?: (string[]|null); + + /** GoogleSearchSuggestions webSearchQueries */ + webSearchQueries?: (google.cloud.ces.v1beta.IWebSearchQuery[]|null); + } + + /** Represents a GoogleSearchSuggestions. */ + class GoogleSearchSuggestions implements IGoogleSearchSuggestions { + + /** + * Constructs a new GoogleSearchSuggestions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGoogleSearchSuggestions); + + /** GoogleSearchSuggestions htmls. */ + public htmls: string[]; + + /** GoogleSearchSuggestions webSearchQueries. */ + public webSearchQueries: google.cloud.ces.v1beta.IWebSearchQuery[]; + + /** + * Creates a new GoogleSearchSuggestions instance using the specified properties. + * @param [properties] Properties to set + * @returns GoogleSearchSuggestions instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGoogleSearchSuggestions): google.cloud.ces.v1beta.GoogleSearchSuggestions; + + /** + * Encodes the specified GoogleSearchSuggestions message. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchSuggestions.verify|verify} messages. + * @param message GoogleSearchSuggestions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGoogleSearchSuggestions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoogleSearchSuggestions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchSuggestions.verify|verify} messages. + * @param message GoogleSearchSuggestions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGoogleSearchSuggestions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoogleSearchSuggestions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoogleSearchSuggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GoogleSearchSuggestions; + + /** + * Decodes a GoogleSearchSuggestions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoogleSearchSuggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GoogleSearchSuggestions; + + /** + * Verifies a GoogleSearchSuggestions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoogleSearchSuggestions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoogleSearchSuggestions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GoogleSearchSuggestions; + + /** + * Creates a plain object from a GoogleSearchSuggestions message. Also converts values to other types if specified. + * @param message GoogleSearchSuggestions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GoogleSearchSuggestions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoogleSearchSuggestions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoogleSearchSuggestions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WebSearchQuery. */ + interface IWebSearchQuery { + + /** WebSearchQuery query */ + query?: (string|null); + + /** WebSearchQuery uri */ + uri?: (string|null); + } + + /** Represents a WebSearchQuery. */ + class WebSearchQuery implements IWebSearchQuery { + + /** + * Constructs a new WebSearchQuery. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IWebSearchQuery); + + /** WebSearchQuery query. */ + public query: string; + + /** WebSearchQuery uri. */ + public uri: string; + + /** + * Creates a new WebSearchQuery instance using the specified properties. + * @param [properties] Properties to set + * @returns WebSearchQuery instance + */ + public static create(properties?: google.cloud.ces.v1beta.IWebSearchQuery): google.cloud.ces.v1beta.WebSearchQuery; + + /** + * Encodes the specified WebSearchQuery message. Does not implicitly {@link google.cloud.ces.v1beta.WebSearchQuery.verify|verify} messages. + * @param message WebSearchQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IWebSearchQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebSearchQuery message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.WebSearchQuery.verify|verify} messages. + * @param message WebSearchQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IWebSearchQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebSearchQuery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebSearchQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.WebSearchQuery; + + /** + * Decodes a WebSearchQuery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebSearchQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.WebSearchQuery; + + /** + * Verifies a WebSearchQuery message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebSearchQuery message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebSearchQuery + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.WebSearchQuery; + + /** + * Creates a plain object from a WebSearchQuery message. Also converts values to other types if specified. + * @param message WebSearchQuery + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.WebSearchQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebSearchQuery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebSearchQuery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an EvaluationService */ + class EvaluationService extends $protobuf.rpc.Service { + + /** + * Constructs a new EvaluationService 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 EvaluationService 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): EvaluationService; + + /** + * Calls RunEvaluation. + * @param request RunEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runEvaluation(request: google.cloud.ces.v1beta.IRunEvaluationRequest, callback: google.cloud.ces.v1beta.EvaluationService.RunEvaluationCallback): void; + + /** + * Calls RunEvaluation. + * @param request RunEvaluationRequest message or plain object + * @returns Promise + */ + public runEvaluation(request: google.cloud.ces.v1beta.IRunEvaluationRequest): Promise; + + /** + * Calls UploadEvaluationAudio. + * @param request UploadEvaluationAudioRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UploadEvaluationAudioResponse + */ + public uploadEvaluationAudio(request: google.cloud.ces.v1beta.IUploadEvaluationAudioRequest, callback: google.cloud.ces.v1beta.EvaluationService.UploadEvaluationAudioCallback): void; + + /** + * Calls UploadEvaluationAudio. + * @param request UploadEvaluationAudioRequest message or plain object + * @returns Promise + */ + public uploadEvaluationAudio(request: google.cloud.ces.v1beta.IUploadEvaluationAudioRequest): Promise; + + /** + * Calls CreateEvaluation. + * @param request CreateEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Evaluation + */ + public createEvaluation(request: google.cloud.ces.v1beta.ICreateEvaluationRequest, callback: google.cloud.ces.v1beta.EvaluationService.CreateEvaluationCallback): void; + + /** + * Calls CreateEvaluation. + * @param request CreateEvaluationRequest message or plain object + * @returns Promise + */ + public createEvaluation(request: google.cloud.ces.v1beta.ICreateEvaluationRequest): Promise; + + /** + * Calls GenerateEvaluation. + * @param request GenerateEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public generateEvaluation(request: google.cloud.ces.v1beta.IGenerateEvaluationRequest, callback: google.cloud.ces.v1beta.EvaluationService.GenerateEvaluationCallback): void; + + /** + * Calls GenerateEvaluation. + * @param request GenerateEvaluationRequest message or plain object + * @returns Promise + */ + public generateEvaluation(request: google.cloud.ces.v1beta.IGenerateEvaluationRequest): Promise; + + /** + * Calls ImportEvaluations. + * @param request ImportEvaluationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importEvaluations(request: google.cloud.ces.v1beta.IImportEvaluationsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ImportEvaluationsCallback): void; + + /** + * Calls ImportEvaluations. + * @param request ImportEvaluationsRequest message or plain object + * @returns Promise + */ + public importEvaluations(request: google.cloud.ces.v1beta.IImportEvaluationsRequest): Promise; + + /** + * Calls CreateEvaluationDataset. + * @param request CreateEvaluationDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationDataset + */ + public createEvaluationDataset(request: google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest, callback: google.cloud.ces.v1beta.EvaluationService.CreateEvaluationDatasetCallback): void; + + /** + * Calls CreateEvaluationDataset. + * @param request CreateEvaluationDatasetRequest message or plain object + * @returns Promise + */ + public createEvaluationDataset(request: google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest): Promise; + + /** + * Calls UpdateEvaluation. + * @param request UpdateEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Evaluation + */ + public updateEvaluation(request: google.cloud.ces.v1beta.IUpdateEvaluationRequest, callback: google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationCallback): void; + + /** + * Calls UpdateEvaluation. + * @param request UpdateEvaluationRequest message or plain object + * @returns Promise + */ + public updateEvaluation(request: google.cloud.ces.v1beta.IUpdateEvaluationRequest): Promise; + + /** + * Calls UpdateEvaluationDataset. + * @param request UpdateEvaluationDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationDataset + */ + public updateEvaluationDataset(request: google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest, callback: google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationDatasetCallback): void; + + /** + * Calls UpdateEvaluationDataset. + * @param request UpdateEvaluationDatasetRequest message or plain object + * @returns Promise + */ + public updateEvaluationDataset(request: google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest): Promise; + + /** + * Calls DeleteEvaluation. + * @param request DeleteEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteEvaluation(request: google.cloud.ces.v1beta.IDeleteEvaluationRequest, callback: google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationCallback): void; + + /** + * Calls DeleteEvaluation. + * @param request DeleteEvaluationRequest message or plain object + * @returns Promise + */ + public deleteEvaluation(request: google.cloud.ces.v1beta.IDeleteEvaluationRequest): Promise; + + /** + * Calls DeleteEvaluationResult. + * @param request DeleteEvaluationResultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteEvaluationResult(request: google.cloud.ces.v1beta.IDeleteEvaluationResultRequest, callback: google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationResultCallback): void; + + /** + * Calls DeleteEvaluationResult. + * @param request DeleteEvaluationResultRequest message or plain object + * @returns Promise + */ + public deleteEvaluationResult(request: google.cloud.ces.v1beta.IDeleteEvaluationResultRequest): Promise; + + /** + * Calls DeleteEvaluationDataset. + * @param request DeleteEvaluationDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteEvaluationDataset(request: google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest, callback: google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationDatasetCallback): void; + + /** + * Calls DeleteEvaluationDataset. + * @param request DeleteEvaluationDatasetRequest message or plain object + * @returns Promise + */ + public deleteEvaluationDataset(request: google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest): Promise; + + /** + * Calls DeleteEvaluationRun. + * @param request DeleteEvaluationRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteEvaluationRun(request: google.cloud.ces.v1beta.IDeleteEvaluationRunRequest, callback: google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationRunCallback): void; + + /** + * Calls DeleteEvaluationRun. + * @param request DeleteEvaluationRunRequest message or plain object + * @returns Promise + */ + public deleteEvaluationRun(request: google.cloud.ces.v1beta.IDeleteEvaluationRunRequest): Promise; + + /** + * Calls GetEvaluation. + * @param request GetEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Evaluation + */ + public getEvaluation(request: google.cloud.ces.v1beta.IGetEvaluationRequest, callback: google.cloud.ces.v1beta.EvaluationService.GetEvaluationCallback): void; + + /** + * Calls GetEvaluation. + * @param request GetEvaluationRequest message or plain object + * @returns Promise + */ + public getEvaluation(request: google.cloud.ces.v1beta.IGetEvaluationRequest): Promise; + + /** + * Calls GetEvaluationResult. + * @param request GetEvaluationResultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationResult + */ + public getEvaluationResult(request: google.cloud.ces.v1beta.IGetEvaluationResultRequest, callback: google.cloud.ces.v1beta.EvaluationService.GetEvaluationResultCallback): void; + + /** + * Calls GetEvaluationResult. + * @param request GetEvaluationResultRequest message or plain object + * @returns Promise + */ + public getEvaluationResult(request: google.cloud.ces.v1beta.IGetEvaluationResultRequest): Promise; + + /** + * Calls GetEvaluationDataset. + * @param request GetEvaluationDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationDataset + */ + public getEvaluationDataset(request: google.cloud.ces.v1beta.IGetEvaluationDatasetRequest, callback: google.cloud.ces.v1beta.EvaluationService.GetEvaluationDatasetCallback): void; + + /** + * Calls GetEvaluationDataset. + * @param request GetEvaluationDatasetRequest message or plain object + * @returns Promise + */ + public getEvaluationDataset(request: google.cloud.ces.v1beta.IGetEvaluationDatasetRequest): Promise; + + /** + * Calls GetEvaluationRun. + * @param request GetEvaluationRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationRun + */ + public getEvaluationRun(request: google.cloud.ces.v1beta.IGetEvaluationRunRequest, callback: google.cloud.ces.v1beta.EvaluationService.GetEvaluationRunCallback): void; + + /** + * Calls GetEvaluationRun. + * @param request GetEvaluationRunRequest message or plain object + * @returns Promise + */ + public getEvaluationRun(request: google.cloud.ces.v1beta.IGetEvaluationRunRequest): Promise; + + /** + * Calls ListEvaluations. + * @param request ListEvaluationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEvaluationsResponse + */ + public listEvaluations(request: google.cloud.ces.v1beta.IListEvaluationsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ListEvaluationsCallback): void; + + /** + * Calls ListEvaluations. + * @param request ListEvaluationsRequest message or plain object + * @returns Promise + */ + public listEvaluations(request: google.cloud.ces.v1beta.IListEvaluationsRequest): Promise; + + /** + * Calls ListEvaluationResults. + * @param request ListEvaluationResultsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEvaluationResultsResponse + */ + public listEvaluationResults(request: google.cloud.ces.v1beta.IListEvaluationResultsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ListEvaluationResultsCallback): void; + + /** + * Calls ListEvaluationResults. + * @param request ListEvaluationResultsRequest message or plain object + * @returns Promise + */ + public listEvaluationResults(request: google.cloud.ces.v1beta.IListEvaluationResultsRequest): Promise; + + /** + * Calls ListEvaluationDatasets. + * @param request ListEvaluationDatasetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEvaluationDatasetsResponse + */ + public listEvaluationDatasets(request: google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ListEvaluationDatasetsCallback): void; + + /** + * Calls ListEvaluationDatasets. + * @param request ListEvaluationDatasetsRequest message or plain object + * @returns Promise + */ + public listEvaluationDatasets(request: google.cloud.ces.v1beta.IListEvaluationDatasetsRequest): Promise; + + /** + * Calls ListEvaluationRuns. + * @param request ListEvaluationRunsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEvaluationRunsResponse + */ + public listEvaluationRuns(request: google.cloud.ces.v1beta.IListEvaluationRunsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ListEvaluationRunsCallback): void; + + /** + * Calls ListEvaluationRuns. + * @param request ListEvaluationRunsRequest message or plain object + * @returns Promise + */ + public listEvaluationRuns(request: google.cloud.ces.v1beta.IListEvaluationRunsRequest): Promise; + + /** + * Calls ListEvaluationExpectations. + * @param request ListEvaluationExpectationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEvaluationExpectationsResponse + */ + public listEvaluationExpectations(request: google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ListEvaluationExpectationsCallback): void; + + /** + * Calls ListEvaluationExpectations. + * @param request ListEvaluationExpectationsRequest message or plain object + * @returns Promise + */ + public listEvaluationExpectations(request: google.cloud.ces.v1beta.IListEvaluationExpectationsRequest): Promise; + + /** + * Calls GetEvaluationExpectation. + * @param request GetEvaluationExpectationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationExpectation + */ + public getEvaluationExpectation(request: google.cloud.ces.v1beta.IGetEvaluationExpectationRequest, callback: google.cloud.ces.v1beta.EvaluationService.GetEvaluationExpectationCallback): void; + + /** + * Calls GetEvaluationExpectation. + * @param request GetEvaluationExpectationRequest message or plain object + * @returns Promise + */ + public getEvaluationExpectation(request: google.cloud.ces.v1beta.IGetEvaluationExpectationRequest): Promise; + + /** + * Calls CreateEvaluationExpectation. + * @param request CreateEvaluationExpectationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationExpectation + */ + public createEvaluationExpectation(request: google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest, callback: google.cloud.ces.v1beta.EvaluationService.CreateEvaluationExpectationCallback): void; + + /** + * Calls CreateEvaluationExpectation. + * @param request CreateEvaluationExpectationRequest message or plain object + * @returns Promise + */ + public createEvaluationExpectation(request: google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest): Promise; + + /** + * Calls UpdateEvaluationExpectation. + * @param request UpdateEvaluationExpectationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationExpectation + */ + public updateEvaluationExpectation(request: google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest, callback: google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationExpectationCallback): void; + + /** + * Calls UpdateEvaluationExpectation. + * @param request UpdateEvaluationExpectationRequest message or plain object + * @returns Promise + */ + public updateEvaluationExpectation(request: google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest): Promise; + + /** + * Calls DeleteEvaluationExpectation. + * @param request DeleteEvaluationExpectationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteEvaluationExpectation(request: google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest, callback: google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationExpectationCallback): void; + + /** + * Calls DeleteEvaluationExpectation. + * @param request DeleteEvaluationExpectationRequest message or plain object + * @returns Promise + */ + public deleteEvaluationExpectation(request: google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest): Promise; + + /** + * Calls CreateScheduledEvaluationRun. + * @param request CreateScheduledEvaluationRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScheduledEvaluationRun + */ + public createScheduledEvaluationRun(request: google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest, callback: google.cloud.ces.v1beta.EvaluationService.CreateScheduledEvaluationRunCallback): void; + + /** + * Calls CreateScheduledEvaluationRun. + * @param request CreateScheduledEvaluationRunRequest message or plain object + * @returns Promise + */ + public createScheduledEvaluationRun(request: google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest): Promise; + + /** + * Calls GetScheduledEvaluationRun. + * @param request GetScheduledEvaluationRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScheduledEvaluationRun + */ + public getScheduledEvaluationRun(request: google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest, callback: google.cloud.ces.v1beta.EvaluationService.GetScheduledEvaluationRunCallback): void; + + /** + * Calls GetScheduledEvaluationRun. + * @param request GetScheduledEvaluationRunRequest message or plain object + * @returns Promise + */ + public getScheduledEvaluationRun(request: google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest): Promise; + + /** + * Calls ListScheduledEvaluationRuns. + * @param request ListScheduledEvaluationRunsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListScheduledEvaluationRunsResponse + */ + public listScheduledEvaluationRuns(request: google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ListScheduledEvaluationRunsCallback): void; + + /** + * Calls ListScheduledEvaluationRuns. + * @param request ListScheduledEvaluationRunsRequest message or plain object + * @returns Promise + */ + public listScheduledEvaluationRuns(request: google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest): Promise; + + /** + * Calls UpdateScheduledEvaluationRun. + * @param request UpdateScheduledEvaluationRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScheduledEvaluationRun + */ + public updateScheduledEvaluationRun(request: google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest, callback: google.cloud.ces.v1beta.EvaluationService.UpdateScheduledEvaluationRunCallback): void; + + /** + * Calls UpdateScheduledEvaluationRun. + * @param request UpdateScheduledEvaluationRunRequest message or plain object + * @returns Promise + */ + public updateScheduledEvaluationRun(request: google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest): Promise; + + /** + * Calls DeleteScheduledEvaluationRun. + * @param request DeleteScheduledEvaluationRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteScheduledEvaluationRun(request: google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest, callback: google.cloud.ces.v1beta.EvaluationService.DeleteScheduledEvaluationRunCallback): void; + + /** + * Calls DeleteScheduledEvaluationRun. + * @param request DeleteScheduledEvaluationRunRequest message or plain object + * @returns Promise + */ + public deleteScheduledEvaluationRun(request: google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest): Promise; + + /** + * Calls TestPersonaVoice. + * @param request TestPersonaVoiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPersonaVoiceResponse + */ + public testPersonaVoice(request: google.cloud.ces.v1beta.ITestPersonaVoiceRequest, callback: google.cloud.ces.v1beta.EvaluationService.TestPersonaVoiceCallback): void; + + /** + * Calls TestPersonaVoice. + * @param request TestPersonaVoiceRequest message or plain object + * @returns Promise + */ + public testPersonaVoice(request: google.cloud.ces.v1beta.ITestPersonaVoiceRequest): Promise; + } + + namespace EvaluationService { + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|runEvaluation}. + * @param error Error, if any + * @param [response] Operation + */ + type RunEvaluationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|uploadEvaluationAudio}. + * @param error Error, if any + * @param [response] UploadEvaluationAudioResponse + */ + type UploadEvaluationAudioCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.UploadEvaluationAudioResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createEvaluation}. + * @param error Error, if any + * @param [response] Evaluation + */ + type CreateEvaluationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Evaluation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|generateEvaluation}. + * @param error Error, if any + * @param [response] Operation + */ + type GenerateEvaluationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|importEvaluations}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportEvaluationsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createEvaluationDataset}. + * @param error Error, if any + * @param [response] EvaluationDataset + */ + type CreateEvaluationDatasetCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationDataset) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateEvaluation}. + * @param error Error, if any + * @param [response] Evaluation + */ + type UpdateEvaluationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Evaluation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateEvaluationDataset}. + * @param error Error, if any + * @param [response] EvaluationDataset + */ + type UpdateEvaluationDatasetCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationDataset) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteEvaluationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationResult}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteEvaluationResultCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationDataset}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteEvaluationDatasetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationRun}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteEvaluationRunCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluation}. + * @param error Error, if any + * @param [response] Evaluation + */ + type GetEvaluationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Evaluation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationResult}. + * @param error Error, if any + * @param [response] EvaluationResult + */ + type GetEvaluationResultCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationResult) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationDataset}. + * @param error Error, if any + * @param [response] EvaluationDataset + */ + type GetEvaluationDatasetCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationDataset) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationRun}. + * @param error Error, if any + * @param [response] EvaluationRun + */ + type GetEvaluationRunCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationRun) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluations}. + * @param error Error, if any + * @param [response] ListEvaluationsResponse + */ + type ListEvaluationsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListEvaluationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationResults}. + * @param error Error, if any + * @param [response] ListEvaluationResultsResponse + */ + type ListEvaluationResultsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListEvaluationResultsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationDatasets}. + * @param error Error, if any + * @param [response] ListEvaluationDatasetsResponse + */ + type ListEvaluationDatasetsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListEvaluationDatasetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationRuns}. + * @param error Error, if any + * @param [response] ListEvaluationRunsResponse + */ + type ListEvaluationRunsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListEvaluationRunsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationExpectations}. + * @param error Error, if any + * @param [response] ListEvaluationExpectationsResponse + */ + type ListEvaluationExpectationsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListEvaluationExpectationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationExpectation}. + * @param error Error, if any + * @param [response] EvaluationExpectation + */ + type GetEvaluationExpectationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationExpectation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createEvaluationExpectation}. + * @param error Error, if any + * @param [response] EvaluationExpectation + */ + type CreateEvaluationExpectationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationExpectation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateEvaluationExpectation}. + * @param error Error, if any + * @param [response] EvaluationExpectation + */ + type UpdateEvaluationExpectationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationExpectation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationExpectation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteEvaluationExpectationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createScheduledEvaluationRun}. + * @param error Error, if any + * @param [response] ScheduledEvaluationRun + */ + type CreateScheduledEvaluationRunCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ScheduledEvaluationRun) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getScheduledEvaluationRun}. + * @param error Error, if any + * @param [response] ScheduledEvaluationRun + */ + type GetScheduledEvaluationRunCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ScheduledEvaluationRun) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listScheduledEvaluationRuns}. + * @param error Error, if any + * @param [response] ListScheduledEvaluationRunsResponse + */ + type ListScheduledEvaluationRunsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateScheduledEvaluationRun}. + * @param error Error, if any + * @param [response] ScheduledEvaluationRun + */ + type UpdateScheduledEvaluationRunCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ScheduledEvaluationRun) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteScheduledEvaluationRun}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteScheduledEvaluationRunCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|testPersonaVoice}. + * @param error Error, if any + * @param [response] TestPersonaVoiceResponse + */ + type TestPersonaVoiceCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.TestPersonaVoiceResponse) => void; + } + + /** Properties of a RunEvaluationResponse. */ + interface IRunEvaluationResponse { + + /** RunEvaluationResponse evaluationRun */ + evaluationRun?: (string|null); + } + + /** Represents a RunEvaluationResponse. */ + class RunEvaluationResponse implements IRunEvaluationResponse { + + /** + * Constructs a new RunEvaluationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRunEvaluationResponse); + + /** RunEvaluationResponse evaluationRun. */ + public evaluationRun: string; + + /** + * Creates a new RunEvaluationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunEvaluationResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRunEvaluationResponse): google.cloud.ces.v1beta.RunEvaluationResponse; + + /** + * Encodes the specified RunEvaluationResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationResponse.verify|verify} messages. + * @param message RunEvaluationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRunEvaluationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunEvaluationResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationResponse.verify|verify} messages. + * @param message RunEvaluationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRunEvaluationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunEvaluationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunEvaluationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RunEvaluationResponse; + + /** + * Decodes a RunEvaluationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunEvaluationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RunEvaluationResponse; + + /** + * Verifies a RunEvaluationResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunEvaluationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunEvaluationResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RunEvaluationResponse; + + /** + * Creates a plain object from a RunEvaluationResponse message. Also converts values to other types if specified. + * @param message RunEvaluationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RunEvaluationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunEvaluationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunEvaluationResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunEvaluationOperationMetadata. */ + interface IRunEvaluationOperationMetadata { + + /** RunEvaluationOperationMetadata evaluations */ + evaluations?: (string[]|null); + + /** RunEvaluationOperationMetadata evaluationRun */ + evaluationRun?: (string|null); + + /** RunEvaluationOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** RunEvaluationOperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** RunEvaluationOperationMetadata verb */ + verb?: (string|null); + + /** RunEvaluationOperationMetadata cancelRequested */ + cancelRequested?: (boolean|null); + } + + /** Represents a RunEvaluationOperationMetadata. */ + class RunEvaluationOperationMetadata implements IRunEvaluationOperationMetadata { + + /** + * Constructs a new RunEvaluationOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRunEvaluationOperationMetadata); + + /** RunEvaluationOperationMetadata evaluations. */ + public evaluations: string[]; + + /** RunEvaluationOperationMetadata evaluationRun. */ + public evaluationRun: string; + + /** RunEvaluationOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** RunEvaluationOperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** RunEvaluationOperationMetadata verb. */ + public verb: string; + + /** RunEvaluationOperationMetadata cancelRequested. */ + public cancelRequested: boolean; + + /** + * Creates a new RunEvaluationOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RunEvaluationOperationMetadata instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRunEvaluationOperationMetadata): google.cloud.ces.v1beta.RunEvaluationOperationMetadata; + + /** + * Encodes the specified RunEvaluationOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationOperationMetadata.verify|verify} messages. + * @param message RunEvaluationOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRunEvaluationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunEvaluationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationOperationMetadata.verify|verify} messages. + * @param message RunEvaluationOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRunEvaluationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunEvaluationOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunEvaluationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RunEvaluationOperationMetadata; + + /** + * Decodes a RunEvaluationOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunEvaluationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RunEvaluationOperationMetadata; + + /** + * Verifies a RunEvaluationOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunEvaluationOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunEvaluationOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RunEvaluationOperationMetadata; + + /** + * Creates a plain object from a RunEvaluationOperationMetadata message. Also converts values to other types if specified. + * @param message RunEvaluationOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RunEvaluationOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunEvaluationOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunEvaluationOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateEvaluationOperationMetadata. */ + interface IGenerateEvaluationOperationMetadata { + } + + /** Represents a GenerateEvaluationOperationMetadata. */ + class GenerateEvaluationOperationMetadata implements IGenerateEvaluationOperationMetadata { + + /** + * Constructs a new GenerateEvaluationOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata); + + /** + * Creates a new GenerateEvaluationOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateEvaluationOperationMetadata instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata): google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata; + + /** + * Encodes the specified GenerateEvaluationOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata.verify|verify} messages. + * @param message GenerateEvaluationOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateEvaluationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata.verify|verify} messages. + * @param message GenerateEvaluationOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateEvaluationOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateEvaluationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata; + + /** + * Decodes a GenerateEvaluationOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateEvaluationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata; + + /** + * Verifies a GenerateEvaluationOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateEvaluationOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateEvaluationOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata; + + /** + * Creates a plain object from a GenerateEvaluationOperationMetadata message. Also converts values to other types if specified. + * @param message GenerateEvaluationOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateEvaluationOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateEvaluationOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEvaluationRunOperationMetadata. */ + interface IDeleteEvaluationRunOperationMetadata { + } + + /** Represents a DeleteEvaluationRunOperationMetadata. */ + class DeleteEvaluationRunOperationMetadata implements IDeleteEvaluationRunOperationMetadata { + + /** + * Constructs a new DeleteEvaluationRunOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata); + + /** + * Creates a new DeleteEvaluationRunOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEvaluationRunOperationMetadata instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata): google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata; + + /** + * Encodes the specified DeleteEvaluationRunOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata.verify|verify} messages. + * @param message DeleteEvaluationRunOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEvaluationRunOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata.verify|verify} messages. + * @param message DeleteEvaluationRunOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEvaluationRunOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEvaluationRunOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata; + + /** + * Decodes a DeleteEvaluationRunOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEvaluationRunOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata; + + /** + * Verifies a DeleteEvaluationRunOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEvaluationRunOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEvaluationRunOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata; + + /** + * Creates a plain object from a DeleteEvaluationRunOperationMetadata message. Also converts values to other types if specified. + * @param message DeleteEvaluationRunOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEvaluationRunOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEvaluationRunOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateEvaluationRequest. */ + interface ICreateEvaluationRequest { + + /** CreateEvaluationRequest parent */ + parent?: (string|null); + + /** CreateEvaluationRequest evaluationId */ + evaluationId?: (string|null); + + /** CreateEvaluationRequest evaluation */ + evaluation?: (google.cloud.ces.v1beta.IEvaluation|null); + } + + /** Represents a CreateEvaluationRequest. */ + class CreateEvaluationRequest implements ICreateEvaluationRequest { + + /** + * Constructs a new CreateEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateEvaluationRequest); + + /** CreateEvaluationRequest parent. */ + public parent: string; + + /** CreateEvaluationRequest evaluationId. */ + public evaluationId: string; + + /** CreateEvaluationRequest evaluation. */ + public evaluation?: (google.cloud.ces.v1beta.IEvaluation|null); + + /** + * Creates a new CreateEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEvaluationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateEvaluationRequest): google.cloud.ces.v1beta.CreateEvaluationRequest; + + /** + * Encodes the specified CreateEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationRequest.verify|verify} messages. + * @param message CreateEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationRequest.verify|verify} messages. + * @param message CreateEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateEvaluationRequest; + + /** + * Decodes a CreateEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateEvaluationRequest; + + /** + * Verifies a CreateEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateEvaluationRequest; + + /** + * Creates a plain object from a CreateEvaluationRequest message. Also converts values to other types if specified. + * @param message CreateEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateEvaluationRequest. */ + interface IGenerateEvaluationRequest { + + /** GenerateEvaluationRequest conversation */ + conversation?: (string|null); + + /** GenerateEvaluationRequest source */ + source?: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source|null); + } + + /** Represents a GenerateEvaluationRequest. */ + class GenerateEvaluationRequest implements IGenerateEvaluationRequest { + + /** + * Constructs a new GenerateEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGenerateEvaluationRequest); + + /** GenerateEvaluationRequest conversation. */ + public conversation: string; + + /** GenerateEvaluationRequest source. */ + public source: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source); + + /** + * Creates a new GenerateEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateEvaluationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGenerateEvaluationRequest): google.cloud.ces.v1beta.GenerateEvaluationRequest; + + /** + * Encodes the specified GenerateEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationRequest.verify|verify} messages. + * @param message GenerateEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGenerateEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationRequest.verify|verify} messages. + * @param message GenerateEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGenerateEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateEvaluationRequest; + + /** + * Decodes a GenerateEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateEvaluationRequest; + + /** + * Verifies a GenerateEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateEvaluationRequest; + + /** + * Creates a plain object from a GenerateEvaluationRequest message. Also converts values to other types if specified. + * @param message GenerateEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportEvaluationsRequest. */ + interface IImportEvaluationsRequest { + + /** ImportEvaluationsRequest conversationList */ + conversationList?: (google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList|null); + + /** ImportEvaluationsRequest gcsUri */ + gcsUri?: (string|null); + + /** ImportEvaluationsRequest csvContent */ + csvContent?: (Uint8Array|Buffer|string|null); + + /** ImportEvaluationsRequest parent */ + parent?: (string|null); + + /** ImportEvaluationsRequest importOptions */ + importOptions?: (google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions|null); + } + + /** Represents an ImportEvaluationsRequest. */ + class ImportEvaluationsRequest implements IImportEvaluationsRequest { + + /** + * Constructs a new ImportEvaluationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IImportEvaluationsRequest); + + /** ImportEvaluationsRequest conversationList. */ + public conversationList?: (google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList|null); + + /** ImportEvaluationsRequest gcsUri. */ + public gcsUri?: (string|null); + + /** ImportEvaluationsRequest csvContent. */ + public csvContent?: (Uint8Array|Buffer|string|null); + + /** ImportEvaluationsRequest parent. */ + public parent: string; + + /** ImportEvaluationsRequest importOptions. */ + public importOptions?: (google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions|null); + + /** ImportEvaluationsRequest source. */ + public source?: ("conversationList"|"gcsUri"|"csvContent"); + + /** + * Creates a new ImportEvaluationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportEvaluationsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IImportEvaluationsRequest): google.cloud.ces.v1beta.ImportEvaluationsRequest; + + /** + * Encodes the specified ImportEvaluationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.verify|verify} messages. + * @param message ImportEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IImportEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.verify|verify} messages. + * @param message ImportEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IImportEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportEvaluationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportEvaluationsRequest; + + /** + * Decodes an ImportEvaluationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportEvaluationsRequest; + + /** + * Verifies an ImportEvaluationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportEvaluationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportEvaluationsRequest; + + /** + * Creates a plain object from an ImportEvaluationsRequest message. Also converts values to other types if specified. + * @param message ImportEvaluationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ImportEvaluationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportEvaluationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportEvaluationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportEvaluationsRequest { + + /** Properties of a ConversationList. */ + interface IConversationList { + + /** ConversationList conversations */ + conversations?: (string[]|null); + } + + /** Represents a ConversationList. */ + class ConversationList implements IConversationList { + + /** + * Constructs a new ConversationList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList); + + /** ConversationList conversations. */ + public conversations: string[]; + + /** + * Creates a new ConversationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversationList instance + */ + public static create(properties?: google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList): google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList; + + /** + * Encodes the specified ConversationList message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.verify|verify} messages. + * @param message ConversationList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConversationList message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.verify|verify} messages. + * @param message ConversationList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConversationList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList; + + /** + * Decodes a ConversationList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList; + + /** + * Verifies a ConversationList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConversationList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversationList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList; + + /** + * Creates a plain object from a ConversationList message. Also converts values to other types if specified. + * @param message ConversationList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConversationList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConversationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportOptions. */ + interface IImportOptions { + + /** ImportOptions conflictResolutionStrategy */ + conflictResolutionStrategy?: (google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy|keyof typeof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy|null); + } + + /** Represents an ImportOptions. */ + class ImportOptions implements IImportOptions { + + /** + * Constructs a new ImportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions); + + /** ImportOptions conflictResolutionStrategy. */ + public conflictResolutionStrategy: (google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy|keyof typeof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy); + + /** + * Creates a new ImportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportOptions instance + */ + public static create(properties?: google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions): google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions; + + /** + * Encodes the specified ImportOptions message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.verify|verify} messages. + * @param message ImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportOptions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.verify|verify} messages. + * @param message ImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions; + + /** + * Decodes an ImportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions; + + /** + * Verifies an ImportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions; + + /** + * Creates a plain object from an ImportOptions message. Also converts values to other types if specified. + * @param message ImportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportOptions { + + /** ConflictResolutionStrategy enum. */ + enum ConflictResolutionStrategy { + CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED = 0, + OVERWRITE = 1, + SKIP = 2, + DUPLICATE = 3 + } + } + } + + /** Properties of an ImportEvaluationsResponse. */ + interface IImportEvaluationsResponse { + + /** ImportEvaluationsResponse evaluations */ + evaluations?: (google.cloud.ces.v1beta.IEvaluation[]|null); + + /** ImportEvaluationsResponse errorMessages */ + errorMessages?: (string[]|null); + + /** ImportEvaluationsResponse importFailureCount */ + importFailureCount?: (number|null); + } + + /** Represents an ImportEvaluationsResponse. */ + class ImportEvaluationsResponse implements IImportEvaluationsResponse { + + /** + * Constructs a new ImportEvaluationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IImportEvaluationsResponse); + + /** ImportEvaluationsResponse evaluations. */ + public evaluations: google.cloud.ces.v1beta.IEvaluation[]; + + /** ImportEvaluationsResponse errorMessages. */ + public errorMessages: string[]; + + /** ImportEvaluationsResponse importFailureCount. */ + public importFailureCount: number; + + /** + * Creates a new ImportEvaluationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportEvaluationsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IImportEvaluationsResponse): google.cloud.ces.v1beta.ImportEvaluationsResponse; + + /** + * Encodes the specified ImportEvaluationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsResponse.verify|verify} messages. + * @param message ImportEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IImportEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsResponse.verify|verify} messages. + * @param message ImportEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IImportEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportEvaluationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportEvaluationsResponse; + + /** + * Decodes an ImportEvaluationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportEvaluationsResponse; + + /** + * Verifies an ImportEvaluationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportEvaluationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportEvaluationsResponse; + + /** + * Creates a plain object from an ImportEvaluationsResponse message. Also converts values to other types if specified. + * @param message ImportEvaluationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ImportEvaluationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportEvaluationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportEvaluationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportEvaluationsOperationMetadata. */ + interface IImportEvaluationsOperationMetadata { + + /** ImportEvaluationsOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ImportEvaluationsOperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** ImportEvaluationsOperationMetadata statusMessage */ + statusMessage?: (string|null); + } + + /** Represents an ImportEvaluationsOperationMetadata. */ + class ImportEvaluationsOperationMetadata implements IImportEvaluationsOperationMetadata { + + /** + * Constructs a new ImportEvaluationsOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata); + + /** ImportEvaluationsOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ImportEvaluationsOperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** ImportEvaluationsOperationMetadata statusMessage. */ + public statusMessage: string; + + /** + * Creates a new ImportEvaluationsOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportEvaluationsOperationMetadata instance + */ + public static create(properties?: google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata): google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata; + + /** + * Encodes the specified ImportEvaluationsOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata.verify|verify} messages. + * @param message ImportEvaluationsOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportEvaluationsOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata.verify|verify} messages. + * @param message ImportEvaluationsOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportEvaluationsOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportEvaluationsOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata; + + /** + * Decodes an ImportEvaluationsOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportEvaluationsOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata; + + /** + * Verifies an ImportEvaluationsOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportEvaluationsOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportEvaluationsOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata; + + /** + * Creates a plain object from an ImportEvaluationsOperationMetadata message. Also converts values to other types if specified. + * @param message ImportEvaluationsOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportEvaluationsOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportEvaluationsOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateEvaluationDatasetRequest. */ + interface ICreateEvaluationDatasetRequest { + + /** CreateEvaluationDatasetRequest parent */ + parent?: (string|null); + + /** CreateEvaluationDatasetRequest evaluationDatasetId */ + evaluationDatasetId?: (string|null); + + /** CreateEvaluationDatasetRequest evaluationDataset */ + evaluationDataset?: (google.cloud.ces.v1beta.IEvaluationDataset|null); + } + + /** Represents a CreateEvaluationDatasetRequest. */ + class CreateEvaluationDatasetRequest implements ICreateEvaluationDatasetRequest { + + /** + * Constructs a new CreateEvaluationDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest); + + /** CreateEvaluationDatasetRequest parent. */ + public parent: string; + + /** CreateEvaluationDatasetRequest evaluationDatasetId. */ + public evaluationDatasetId: string; + + /** CreateEvaluationDatasetRequest evaluationDataset. */ + public evaluationDataset?: (google.cloud.ces.v1beta.IEvaluationDataset|null); + + /** + * Creates a new CreateEvaluationDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEvaluationDatasetRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest): google.cloud.ces.v1beta.CreateEvaluationDatasetRequest; + + /** + * Encodes the specified CreateEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationDatasetRequest.verify|verify} messages. + * @param message CreateEvaluationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationDatasetRequest.verify|verify} messages. + * @param message CreateEvaluationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEvaluationDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateEvaluationDatasetRequest; + + /** + * Decodes a CreateEvaluationDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateEvaluationDatasetRequest; + + /** + * Verifies a CreateEvaluationDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEvaluationDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateEvaluationDatasetRequest; + + /** + * Creates a plain object from a CreateEvaluationDatasetRequest message. Also converts values to other types if specified. + * @param message CreateEvaluationDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateEvaluationDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEvaluationDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEvaluationDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEvaluationRequest. */ + interface IUpdateEvaluationRequest { + + /** UpdateEvaluationRequest evaluation */ + evaluation?: (google.cloud.ces.v1beta.IEvaluation|null); + + /** UpdateEvaluationRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateEvaluationRequest. */ + class UpdateEvaluationRequest implements IUpdateEvaluationRequest { + + /** + * Constructs a new UpdateEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateEvaluationRequest); + + /** UpdateEvaluationRequest evaluation. */ + public evaluation?: (google.cloud.ces.v1beta.IEvaluation|null); + + /** UpdateEvaluationRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEvaluationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateEvaluationRequest): google.cloud.ces.v1beta.UpdateEvaluationRequest; + + /** + * Encodes the specified UpdateEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationRequest.verify|verify} messages. + * @param message UpdateEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationRequest.verify|verify} messages. + * @param message UpdateEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateEvaluationRequest; + + /** + * Decodes an UpdateEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateEvaluationRequest; + + /** + * Verifies an UpdateEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateEvaluationRequest; + + /** + * Creates a plain object from an UpdateEvaluationRequest message. Also converts values to other types if specified. + * @param message UpdateEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEvaluationDatasetRequest. */ + interface IUpdateEvaluationDatasetRequest { + + /** UpdateEvaluationDatasetRequest evaluationDataset */ + evaluationDataset?: (google.cloud.ces.v1beta.IEvaluationDataset|null); + + /** UpdateEvaluationDatasetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateEvaluationDatasetRequest. */ + class UpdateEvaluationDatasetRequest implements IUpdateEvaluationDatasetRequest { + + /** + * Constructs a new UpdateEvaluationDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest); + + /** UpdateEvaluationDatasetRequest evaluationDataset. */ + public evaluationDataset?: (google.cloud.ces.v1beta.IEvaluationDataset|null); + + /** UpdateEvaluationDatasetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateEvaluationDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEvaluationDatasetRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest): google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest; + + /** + * Encodes the specified UpdateEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest.verify|verify} messages. + * @param message UpdateEvaluationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest.verify|verify} messages. + * @param message UpdateEvaluationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEvaluationDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest; + + /** + * Decodes an UpdateEvaluationDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest; + + /** + * Verifies an UpdateEvaluationDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEvaluationDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest; + + /** + * Creates a plain object from an UpdateEvaluationDatasetRequest message. Also converts values to other types if specified. + * @param message UpdateEvaluationDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEvaluationDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEvaluationDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEvaluationRequest. */ + interface IDeleteEvaluationRequest { + + /** DeleteEvaluationRequest name */ + name?: (string|null); + + /** DeleteEvaluationRequest force */ + force?: (boolean|null); + + /** DeleteEvaluationRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteEvaluationRequest. */ + class DeleteEvaluationRequest implements IDeleteEvaluationRequest { + + /** + * Constructs a new DeleteEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteEvaluationRequest); + + /** DeleteEvaluationRequest name. */ + public name: string; + + /** DeleteEvaluationRequest force. */ + public force: boolean; + + /** DeleteEvaluationRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEvaluationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteEvaluationRequest): google.cloud.ces.v1beta.DeleteEvaluationRequest; + + /** + * Encodes the specified DeleteEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRequest.verify|verify} messages. + * @param message DeleteEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRequest.verify|verify} messages. + * @param message DeleteEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteEvaluationRequest; + + /** + * Decodes a DeleteEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteEvaluationRequest; + + /** + * Verifies a DeleteEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteEvaluationRequest; + + /** + * Creates a plain object from a DeleteEvaluationRequest message. Also converts values to other types if specified. + * @param message DeleteEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEvaluationResultRequest. */ + interface IDeleteEvaluationResultRequest { + + /** DeleteEvaluationResultRequest name */ + name?: (string|null); + } + + /** Represents a DeleteEvaluationResultRequest. */ + class DeleteEvaluationResultRequest implements IDeleteEvaluationResultRequest { + + /** + * Constructs a new DeleteEvaluationResultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteEvaluationResultRequest); + + /** DeleteEvaluationResultRequest name. */ + public name: string; + + /** + * Creates a new DeleteEvaluationResultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEvaluationResultRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteEvaluationResultRequest): google.cloud.ces.v1beta.DeleteEvaluationResultRequest; + + /** + * Encodes the specified DeleteEvaluationResultRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationResultRequest.verify|verify} messages. + * @param message DeleteEvaluationResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteEvaluationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEvaluationResultRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationResultRequest.verify|verify} messages. + * @param message DeleteEvaluationResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteEvaluationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEvaluationResultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEvaluationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteEvaluationResultRequest; + + /** + * Decodes a DeleteEvaluationResultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEvaluationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteEvaluationResultRequest; + + /** + * Verifies a DeleteEvaluationResultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEvaluationResultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEvaluationResultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteEvaluationResultRequest; + + /** + * Creates a plain object from a DeleteEvaluationResultRequest message. Also converts values to other types if specified. + * @param message DeleteEvaluationResultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteEvaluationResultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEvaluationResultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEvaluationResultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEvaluationDatasetRequest. */ + interface IDeleteEvaluationDatasetRequest { + + /** DeleteEvaluationDatasetRequest name */ + name?: (string|null); + + /** DeleteEvaluationDatasetRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteEvaluationDatasetRequest. */ + class DeleteEvaluationDatasetRequest implements IDeleteEvaluationDatasetRequest { + + /** + * Constructs a new DeleteEvaluationDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest); + + /** DeleteEvaluationDatasetRequest name. */ + public name: string; + + /** DeleteEvaluationDatasetRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteEvaluationDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEvaluationDatasetRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest): google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest; + + /** + * Encodes the specified DeleteEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest.verify|verify} messages. + * @param message DeleteEvaluationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest.verify|verify} messages. + * @param message DeleteEvaluationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEvaluationDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest; + + /** + * Decodes a DeleteEvaluationDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest; + + /** + * Verifies a DeleteEvaluationDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEvaluationDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest; + + /** + * Creates a plain object from a DeleteEvaluationDatasetRequest message. Also converts values to other types if specified. + * @param message DeleteEvaluationDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEvaluationDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEvaluationDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEvaluationRunRequest. */ + interface IDeleteEvaluationRunRequest { + + /** DeleteEvaluationRunRequest name */ + name?: (string|null); + } + + /** Represents a DeleteEvaluationRunRequest. */ + class DeleteEvaluationRunRequest implements IDeleteEvaluationRunRequest { + + /** + * Constructs a new DeleteEvaluationRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteEvaluationRunRequest); + + /** DeleteEvaluationRunRequest name. */ + public name: string; + + /** + * Creates a new DeleteEvaluationRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEvaluationRunRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteEvaluationRunRequest): google.cloud.ces.v1beta.DeleteEvaluationRunRequest; + + /** + * Encodes the specified DeleteEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunRequest.verify|verify} messages. + * @param message DeleteEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunRequest.verify|verify} messages. + * @param message DeleteEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEvaluationRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteEvaluationRunRequest; + + /** + * Decodes a DeleteEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteEvaluationRunRequest; + + /** + * Verifies a DeleteEvaluationRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEvaluationRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteEvaluationRunRequest; + + /** + * Creates a plain object from a DeleteEvaluationRunRequest message. Also converts values to other types if specified. + * @param message DeleteEvaluationRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteEvaluationRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEvaluationRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEvaluationRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEvaluationRequest. */ + interface IGetEvaluationRequest { + + /** GetEvaluationRequest name */ + name?: (string|null); + } + + /** Represents a GetEvaluationRequest. */ + class GetEvaluationRequest implements IGetEvaluationRequest { + + /** + * Constructs a new GetEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetEvaluationRequest); + + /** GetEvaluationRequest name. */ + public name: string; + + /** + * Creates a new GetEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEvaluationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetEvaluationRequest): google.cloud.ces.v1beta.GetEvaluationRequest; + + /** + * Encodes the specified GetEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRequest.verify|verify} messages. + * @param message GetEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRequest.verify|verify} messages. + * @param message GetEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetEvaluationRequest; + + /** + * Decodes a GetEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetEvaluationRequest; + + /** + * Verifies a GetEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetEvaluationRequest; + + /** + * Creates a plain object from a GetEvaluationRequest message. Also converts values to other types if specified. + * @param message GetEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEvaluationResultRequest. */ + interface IGetEvaluationResultRequest { + + /** GetEvaluationResultRequest name */ + name?: (string|null); + } + + /** Represents a GetEvaluationResultRequest. */ + class GetEvaluationResultRequest implements IGetEvaluationResultRequest { + + /** + * Constructs a new GetEvaluationResultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetEvaluationResultRequest); + + /** GetEvaluationResultRequest name. */ + public name: string; + + /** + * Creates a new GetEvaluationResultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEvaluationResultRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetEvaluationResultRequest): google.cloud.ces.v1beta.GetEvaluationResultRequest; + + /** + * Encodes the specified GetEvaluationResultRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationResultRequest.verify|verify} messages. + * @param message GetEvaluationResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetEvaluationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEvaluationResultRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationResultRequest.verify|verify} messages. + * @param message GetEvaluationResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetEvaluationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEvaluationResultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEvaluationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetEvaluationResultRequest; + + /** + * Decodes a GetEvaluationResultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEvaluationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetEvaluationResultRequest; + + /** + * Verifies a GetEvaluationResultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEvaluationResultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEvaluationResultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetEvaluationResultRequest; + + /** + * Creates a plain object from a GetEvaluationResultRequest message. Also converts values to other types if specified. + * @param message GetEvaluationResultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetEvaluationResultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEvaluationResultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEvaluationResultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEvaluationDatasetRequest. */ + interface IGetEvaluationDatasetRequest { + + /** GetEvaluationDatasetRequest name */ + name?: (string|null); + } + + /** Represents a GetEvaluationDatasetRequest. */ + class GetEvaluationDatasetRequest implements IGetEvaluationDatasetRequest { + + /** + * Constructs a new GetEvaluationDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetEvaluationDatasetRequest); + + /** GetEvaluationDatasetRequest name. */ + public name: string; + + /** + * Creates a new GetEvaluationDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEvaluationDatasetRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetEvaluationDatasetRequest): google.cloud.ces.v1beta.GetEvaluationDatasetRequest; + + /** + * Encodes the specified GetEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationDatasetRequest.verify|verify} messages. + * @param message GetEvaluationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationDatasetRequest.verify|verify} messages. + * @param message GetEvaluationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEvaluationDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetEvaluationDatasetRequest; + + /** + * Decodes a GetEvaluationDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetEvaluationDatasetRequest; + + /** + * Verifies a GetEvaluationDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEvaluationDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetEvaluationDatasetRequest; + + /** + * Creates a plain object from a GetEvaluationDatasetRequest message. Also converts values to other types if specified. + * @param message GetEvaluationDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetEvaluationDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEvaluationDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEvaluationDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEvaluationRunRequest. */ + interface IGetEvaluationRunRequest { + + /** GetEvaluationRunRequest name */ + name?: (string|null); + } + + /** Represents a GetEvaluationRunRequest. */ + class GetEvaluationRunRequest implements IGetEvaluationRunRequest { + + /** + * Constructs a new GetEvaluationRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetEvaluationRunRequest); + + /** GetEvaluationRunRequest name. */ + public name: string; + + /** + * Creates a new GetEvaluationRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEvaluationRunRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetEvaluationRunRequest): google.cloud.ces.v1beta.GetEvaluationRunRequest; + + /** + * Encodes the specified GetEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRunRequest.verify|verify} messages. + * @param message GetEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRunRequest.verify|verify} messages. + * @param message GetEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEvaluationRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetEvaluationRunRequest; + + /** + * Decodes a GetEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetEvaluationRunRequest; + + /** + * Verifies a GetEvaluationRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEvaluationRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetEvaluationRunRequest; + + /** + * Creates a plain object from a GetEvaluationRunRequest message. Also converts values to other types if specified. + * @param message GetEvaluationRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetEvaluationRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEvaluationRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEvaluationRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationsRequest. */ + interface IListEvaluationsRequest { + + /** ListEvaluationsRequest parent */ + parent?: (string|null); + + /** ListEvaluationsRequest pageSize */ + pageSize?: (number|null); + + /** ListEvaluationsRequest pageToken */ + pageToken?: (string|null); + + /** ListEvaluationsRequest filter */ + filter?: (string|null); + + /** ListEvaluationsRequest evaluationFilter */ + evaluationFilter?: (string|null); + + /** ListEvaluationsRequest evaluationRunFilter */ + evaluationRunFilter?: (string|null); + + /** ListEvaluationsRequest orderBy */ + orderBy?: (string|null); + + /** ListEvaluationsRequest lastTenResults */ + lastTenResults?: (boolean|null); + } + + /** Represents a ListEvaluationsRequest. */ + class ListEvaluationsRequest implements IListEvaluationsRequest { + + /** + * Constructs a new ListEvaluationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationsRequest); + + /** ListEvaluationsRequest parent. */ + public parent: string; + + /** ListEvaluationsRequest pageSize. */ + public pageSize: number; + + /** ListEvaluationsRequest pageToken. */ + public pageToken: string; + + /** ListEvaluationsRequest filter. */ + public filter: string; + + /** ListEvaluationsRequest evaluationFilter. */ + public evaluationFilter: string; + + /** ListEvaluationsRequest evaluationRunFilter. */ + public evaluationRunFilter: string; + + /** ListEvaluationsRequest orderBy. */ + public orderBy: string; + + /** ListEvaluationsRequest lastTenResults. */ + public lastTenResults: boolean; + + /** + * Creates a new ListEvaluationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationsRequest): google.cloud.ces.v1beta.ListEvaluationsRequest; + + /** + * Encodes the specified ListEvaluationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsRequest.verify|verify} messages. + * @param message ListEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsRequest.verify|verify} messages. + * @param message ListEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationsRequest; + + /** + * Decodes a ListEvaluationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationsRequest; + + /** + * Verifies a ListEvaluationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationsRequest; + + /** + * Creates a plain object from a ListEvaluationsRequest message. Also converts values to other types if specified. + * @param message ListEvaluationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationResultsRequest. */ + interface IListEvaluationResultsRequest { + + /** ListEvaluationResultsRequest parent */ + parent?: (string|null); + + /** ListEvaluationResultsRequest pageSize */ + pageSize?: (number|null); + + /** ListEvaluationResultsRequest pageToken */ + pageToken?: (string|null); + + /** ListEvaluationResultsRequest filter */ + filter?: (string|null); + + /** ListEvaluationResultsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListEvaluationResultsRequest. */ + class ListEvaluationResultsRequest implements IListEvaluationResultsRequest { + + /** + * Constructs a new ListEvaluationResultsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationResultsRequest); + + /** ListEvaluationResultsRequest parent. */ + public parent: string; + + /** ListEvaluationResultsRequest pageSize. */ + public pageSize: number; + + /** ListEvaluationResultsRequest pageToken. */ + public pageToken: string; + + /** ListEvaluationResultsRequest filter. */ + public filter: string; + + /** ListEvaluationResultsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListEvaluationResultsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationResultsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationResultsRequest): google.cloud.ces.v1beta.ListEvaluationResultsRequest; + + /** + * Encodes the specified ListEvaluationResultsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsRequest.verify|verify} messages. + * @param message ListEvaluationResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationResultsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsRequest.verify|verify} messages. + * @param message ListEvaluationResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationResultsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationResultsRequest; + + /** + * Decodes a ListEvaluationResultsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationResultsRequest; + + /** + * Verifies a ListEvaluationResultsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationResultsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationResultsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationResultsRequest; + + /** + * Creates a plain object from a ListEvaluationResultsRequest message. Also converts values to other types if specified. + * @param message ListEvaluationResultsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationResultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationResultsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationResultsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationDatasetsRequest. */ + interface IListEvaluationDatasetsRequest { + + /** ListEvaluationDatasetsRequest parent */ + parent?: (string|null); + + /** ListEvaluationDatasetsRequest pageSize */ + pageSize?: (number|null); + + /** ListEvaluationDatasetsRequest pageToken */ + pageToken?: (string|null); + + /** ListEvaluationDatasetsRequest filter */ + filter?: (string|null); + + /** ListEvaluationDatasetsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListEvaluationDatasetsRequest. */ + class ListEvaluationDatasetsRequest implements IListEvaluationDatasetsRequest { + + /** + * Constructs a new ListEvaluationDatasetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationDatasetsRequest); + + /** ListEvaluationDatasetsRequest parent. */ + public parent: string; + + /** ListEvaluationDatasetsRequest pageSize. */ + public pageSize: number; + + /** ListEvaluationDatasetsRequest pageToken. */ + public pageToken: string; + + /** ListEvaluationDatasetsRequest filter. */ + public filter: string; + + /** ListEvaluationDatasetsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListEvaluationDatasetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationDatasetsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationDatasetsRequest): google.cloud.ces.v1beta.ListEvaluationDatasetsRequest; + + /** + * Encodes the specified ListEvaluationDatasetsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsRequest.verify|verify} messages. + * @param message ListEvaluationDatasetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsRequest.verify|verify} messages. + * @param message ListEvaluationDatasetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationDatasetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationDatasetsRequest; + + /** + * Decodes a ListEvaluationDatasetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationDatasetsRequest; + + /** + * Verifies a ListEvaluationDatasetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationDatasetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationDatasetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationDatasetsRequest; + + /** + * Creates a plain object from a ListEvaluationDatasetsRequest message. Also converts values to other types if specified. + * @param message ListEvaluationDatasetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationDatasetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationDatasetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationDatasetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationRunsRequest. */ + interface IListEvaluationRunsRequest { + + /** ListEvaluationRunsRequest parent */ + parent?: (string|null); + + /** ListEvaluationRunsRequest pageSize */ + pageSize?: (number|null); + + /** ListEvaluationRunsRequest pageToken */ + pageToken?: (string|null); + + /** ListEvaluationRunsRequest filter */ + filter?: (string|null); + + /** ListEvaluationRunsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListEvaluationRunsRequest. */ + class ListEvaluationRunsRequest implements IListEvaluationRunsRequest { + + /** + * Constructs a new ListEvaluationRunsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationRunsRequest); + + /** ListEvaluationRunsRequest parent. */ + public parent: string; + + /** ListEvaluationRunsRequest pageSize. */ + public pageSize: number; + + /** ListEvaluationRunsRequest pageToken. */ + public pageToken: string; + + /** ListEvaluationRunsRequest filter. */ + public filter: string; + + /** ListEvaluationRunsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListEvaluationRunsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationRunsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationRunsRequest): google.cloud.ces.v1beta.ListEvaluationRunsRequest; + + /** + * Encodes the specified ListEvaluationRunsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsRequest.verify|verify} messages. + * @param message ListEvaluationRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationRunsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsRequest.verify|verify} messages. + * @param message ListEvaluationRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationRunsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationRunsRequest; + + /** + * Decodes a ListEvaluationRunsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationRunsRequest; + + /** + * Verifies a ListEvaluationRunsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationRunsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationRunsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationRunsRequest; + + /** + * Creates a plain object from a ListEvaluationRunsRequest message. Also converts values to other types if specified. + * @param message ListEvaluationRunsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationRunsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationRunsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationsResponse. */ + interface IListEvaluationsResponse { + + /** ListEvaluationsResponse evaluations */ + evaluations?: (google.cloud.ces.v1beta.IEvaluation[]|null); + + /** ListEvaluationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEvaluationsResponse. */ + class ListEvaluationsResponse implements IListEvaluationsResponse { + + /** + * Constructs a new ListEvaluationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationsResponse); + + /** ListEvaluationsResponse evaluations. */ + public evaluations: google.cloud.ces.v1beta.IEvaluation[]; + + /** ListEvaluationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEvaluationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationsResponse): google.cloud.ces.v1beta.ListEvaluationsResponse; + + /** + * Encodes the specified ListEvaluationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsResponse.verify|verify} messages. + * @param message ListEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsResponse.verify|verify} messages. + * @param message ListEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationsResponse; + + /** + * Decodes a ListEvaluationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationsResponse; + + /** + * Verifies a ListEvaluationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationsResponse; + + /** + * Creates a plain object from a ListEvaluationsResponse message. Also converts values to other types if specified. + * @param message ListEvaluationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationResultsResponse. */ + interface IListEvaluationResultsResponse { + + /** ListEvaluationResultsResponse evaluationResults */ + evaluationResults?: (google.cloud.ces.v1beta.IEvaluationResult[]|null); + + /** ListEvaluationResultsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEvaluationResultsResponse. */ + class ListEvaluationResultsResponse implements IListEvaluationResultsResponse { + + /** + * Constructs a new ListEvaluationResultsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationResultsResponse); + + /** ListEvaluationResultsResponse evaluationResults. */ + public evaluationResults: google.cloud.ces.v1beta.IEvaluationResult[]; + + /** ListEvaluationResultsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEvaluationResultsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationResultsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationResultsResponse): google.cloud.ces.v1beta.ListEvaluationResultsResponse; + + /** + * Encodes the specified ListEvaluationResultsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsResponse.verify|verify} messages. + * @param message ListEvaluationResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationResultsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsResponse.verify|verify} messages. + * @param message ListEvaluationResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationResultsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationResultsResponse; + + /** + * Decodes a ListEvaluationResultsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationResultsResponse; + + /** + * Verifies a ListEvaluationResultsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationResultsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationResultsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationResultsResponse; + + /** + * Creates a plain object from a ListEvaluationResultsResponse message. Also converts values to other types if specified. + * @param message ListEvaluationResultsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationResultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationResultsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationResultsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationDatasetsResponse. */ + interface IListEvaluationDatasetsResponse { + + /** ListEvaluationDatasetsResponse evaluationDatasets */ + evaluationDatasets?: (google.cloud.ces.v1beta.IEvaluationDataset[]|null); + + /** ListEvaluationDatasetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEvaluationDatasetsResponse. */ + class ListEvaluationDatasetsResponse implements IListEvaluationDatasetsResponse { + + /** + * Constructs a new ListEvaluationDatasetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationDatasetsResponse); + + /** ListEvaluationDatasetsResponse evaluationDatasets. */ + public evaluationDatasets: google.cloud.ces.v1beta.IEvaluationDataset[]; + + /** ListEvaluationDatasetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEvaluationDatasetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationDatasetsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationDatasetsResponse): google.cloud.ces.v1beta.ListEvaluationDatasetsResponse; + + /** + * Encodes the specified ListEvaluationDatasetsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.verify|verify} messages. + * @param message ListEvaluationDatasetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.verify|verify} messages. + * @param message ListEvaluationDatasetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationDatasetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationDatasetsResponse; + + /** + * Decodes a ListEvaluationDatasetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationDatasetsResponse; + + /** + * Verifies a ListEvaluationDatasetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationDatasetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationDatasetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationDatasetsResponse; + + /** + * Creates a plain object from a ListEvaluationDatasetsResponse message. Also converts values to other types if specified. + * @param message ListEvaluationDatasetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationDatasetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationDatasetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationDatasetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationRunsResponse. */ + interface IListEvaluationRunsResponse { + + /** ListEvaluationRunsResponse evaluationRuns */ + evaluationRuns?: (google.cloud.ces.v1beta.IEvaluationRun[]|null); + + /** ListEvaluationRunsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEvaluationRunsResponse. */ + class ListEvaluationRunsResponse implements IListEvaluationRunsResponse { + + /** + * Constructs a new ListEvaluationRunsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationRunsResponse); + + /** ListEvaluationRunsResponse evaluationRuns. */ + public evaluationRuns: google.cloud.ces.v1beta.IEvaluationRun[]; + + /** ListEvaluationRunsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEvaluationRunsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationRunsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationRunsResponse): google.cloud.ces.v1beta.ListEvaluationRunsResponse; + + /** + * Encodes the specified ListEvaluationRunsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsResponse.verify|verify} messages. + * @param message ListEvaluationRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationRunsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsResponse.verify|verify} messages. + * @param message ListEvaluationRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationRunsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationRunsResponse; + + /** + * Decodes a ListEvaluationRunsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationRunsResponse; + + /** + * Verifies a ListEvaluationRunsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationRunsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationRunsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationRunsResponse; + + /** + * Creates a plain object from a ListEvaluationRunsResponse message. Also converts values to other types if specified. + * @param message ListEvaluationRunsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationRunsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationRunsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateScheduledEvaluationRunRequest. */ + interface ICreateScheduledEvaluationRunRequest { + + /** CreateScheduledEvaluationRunRequest parent */ + parent?: (string|null); + + /** CreateScheduledEvaluationRunRequest scheduledEvaluationRunId */ + scheduledEvaluationRunId?: (string|null); + + /** CreateScheduledEvaluationRunRequest scheduledEvaluationRun */ + scheduledEvaluationRun?: (google.cloud.ces.v1beta.IScheduledEvaluationRun|null); + } + + /** Represents a CreateScheduledEvaluationRunRequest. */ + class CreateScheduledEvaluationRunRequest implements ICreateScheduledEvaluationRunRequest { + + /** + * Constructs a new CreateScheduledEvaluationRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest); + + /** CreateScheduledEvaluationRunRequest parent. */ + public parent: string; + + /** CreateScheduledEvaluationRunRequest scheduledEvaluationRunId. */ + public scheduledEvaluationRunId: string; + + /** CreateScheduledEvaluationRunRequest scheduledEvaluationRun. */ + public scheduledEvaluationRun?: (google.cloud.ces.v1beta.IScheduledEvaluationRun|null); + + /** + * Creates a new CreateScheduledEvaluationRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateScheduledEvaluationRunRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest): google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest; + + /** + * Encodes the specified CreateScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest.verify|verify} messages. + * @param message CreateScheduledEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest.verify|verify} messages. + * @param message CreateScheduledEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateScheduledEvaluationRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest; + + /** + * Decodes a CreateScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest; + + /** + * Verifies a CreateScheduledEvaluationRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateScheduledEvaluationRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest; + + /** + * Creates a plain object from a CreateScheduledEvaluationRunRequest message. Also converts values to other types if specified. + * @param message CreateScheduledEvaluationRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateScheduledEvaluationRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateScheduledEvaluationRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetScheduledEvaluationRunRequest. */ + interface IGetScheduledEvaluationRunRequest { + + /** GetScheduledEvaluationRunRequest name */ + name?: (string|null); + } + + /** Represents a GetScheduledEvaluationRunRequest. */ + class GetScheduledEvaluationRunRequest implements IGetScheduledEvaluationRunRequest { + + /** + * Constructs a new GetScheduledEvaluationRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest); + + /** GetScheduledEvaluationRunRequest name. */ + public name: string; + + /** + * Creates a new GetScheduledEvaluationRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetScheduledEvaluationRunRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest): google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest; + + /** + * Encodes the specified GetScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest.verify|verify} messages. + * @param message GetScheduledEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest.verify|verify} messages. + * @param message GetScheduledEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetScheduledEvaluationRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest; + + /** + * Decodes a GetScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest; + + /** + * Verifies a GetScheduledEvaluationRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetScheduledEvaluationRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest; + + /** + * Creates a plain object from a GetScheduledEvaluationRunRequest message. Also converts values to other types if specified. + * @param message GetScheduledEvaluationRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetScheduledEvaluationRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetScheduledEvaluationRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListScheduledEvaluationRunsRequest. */ + interface IListScheduledEvaluationRunsRequest { + + /** ListScheduledEvaluationRunsRequest parent */ + parent?: (string|null); + + /** ListScheduledEvaluationRunsRequest pageSize */ + pageSize?: (number|null); + + /** ListScheduledEvaluationRunsRequest pageToken */ + pageToken?: (string|null); + + /** ListScheduledEvaluationRunsRequest filter */ + filter?: (string|null); + + /** ListScheduledEvaluationRunsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListScheduledEvaluationRunsRequest. */ + class ListScheduledEvaluationRunsRequest implements IListScheduledEvaluationRunsRequest { + + /** + * Constructs a new ListScheduledEvaluationRunsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest); + + /** ListScheduledEvaluationRunsRequest parent. */ + public parent: string; + + /** ListScheduledEvaluationRunsRequest pageSize. */ + public pageSize: number; + + /** ListScheduledEvaluationRunsRequest pageToken. */ + public pageToken: string; + + /** ListScheduledEvaluationRunsRequest filter. */ + public filter: string; + + /** ListScheduledEvaluationRunsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListScheduledEvaluationRunsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListScheduledEvaluationRunsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest): google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest; + + /** + * Encodes the specified ListScheduledEvaluationRunsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest.verify|verify} messages. + * @param message ListScheduledEvaluationRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListScheduledEvaluationRunsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest.verify|verify} messages. + * @param message ListScheduledEvaluationRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListScheduledEvaluationRunsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListScheduledEvaluationRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest; + + /** + * Decodes a ListScheduledEvaluationRunsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListScheduledEvaluationRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest; + + /** + * Verifies a ListScheduledEvaluationRunsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListScheduledEvaluationRunsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListScheduledEvaluationRunsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest; + + /** + * Creates a plain object from a ListScheduledEvaluationRunsRequest message. Also converts values to other types if specified. + * @param message ListScheduledEvaluationRunsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListScheduledEvaluationRunsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListScheduledEvaluationRunsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListScheduledEvaluationRunsResponse. */ + interface IListScheduledEvaluationRunsResponse { + + /** ListScheduledEvaluationRunsResponse scheduledEvaluationRuns */ + scheduledEvaluationRuns?: (google.cloud.ces.v1beta.IScheduledEvaluationRun[]|null); + + /** ListScheduledEvaluationRunsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListScheduledEvaluationRunsResponse. */ + class ListScheduledEvaluationRunsResponse implements IListScheduledEvaluationRunsResponse { + + /** + * Constructs a new ListScheduledEvaluationRunsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse); + + /** ListScheduledEvaluationRunsResponse scheduledEvaluationRuns. */ + public scheduledEvaluationRuns: google.cloud.ces.v1beta.IScheduledEvaluationRun[]; + + /** ListScheduledEvaluationRunsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListScheduledEvaluationRunsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListScheduledEvaluationRunsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse): google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse; + + /** + * Encodes the specified ListScheduledEvaluationRunsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.verify|verify} messages. + * @param message ListScheduledEvaluationRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListScheduledEvaluationRunsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.verify|verify} messages. + * @param message ListScheduledEvaluationRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListScheduledEvaluationRunsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListScheduledEvaluationRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse; + + /** + * Decodes a ListScheduledEvaluationRunsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListScheduledEvaluationRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse; + + /** + * Verifies a ListScheduledEvaluationRunsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListScheduledEvaluationRunsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListScheduledEvaluationRunsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse; + + /** + * Creates a plain object from a ListScheduledEvaluationRunsResponse message. Also converts values to other types if specified. + * @param message ListScheduledEvaluationRunsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListScheduledEvaluationRunsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListScheduledEvaluationRunsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateScheduledEvaluationRunRequest. */ + interface IUpdateScheduledEvaluationRunRequest { + + /** UpdateScheduledEvaluationRunRequest scheduledEvaluationRun */ + scheduledEvaluationRun?: (google.cloud.ces.v1beta.IScheduledEvaluationRun|null); + + /** UpdateScheduledEvaluationRunRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateScheduledEvaluationRunRequest. */ + class UpdateScheduledEvaluationRunRequest implements IUpdateScheduledEvaluationRunRequest { + + /** + * Constructs a new UpdateScheduledEvaluationRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest); + + /** UpdateScheduledEvaluationRunRequest scheduledEvaluationRun. */ + public scheduledEvaluationRun?: (google.cloud.ces.v1beta.IScheduledEvaluationRun|null); + + /** UpdateScheduledEvaluationRunRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateScheduledEvaluationRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateScheduledEvaluationRunRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest): google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest; + + /** + * Encodes the specified UpdateScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest.verify|verify} messages. + * @param message UpdateScheduledEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest.verify|verify} messages. + * @param message UpdateScheduledEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateScheduledEvaluationRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest; + + /** + * Decodes an UpdateScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest; + + /** + * Verifies an UpdateScheduledEvaluationRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateScheduledEvaluationRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest; + + /** + * Creates a plain object from an UpdateScheduledEvaluationRunRequest message. Also converts values to other types if specified. + * @param message UpdateScheduledEvaluationRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateScheduledEvaluationRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateScheduledEvaluationRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteScheduledEvaluationRunRequest. */ + interface IDeleteScheduledEvaluationRunRequest { + + /** DeleteScheduledEvaluationRunRequest name */ + name?: (string|null); + + /** DeleteScheduledEvaluationRunRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteScheduledEvaluationRunRequest. */ + class DeleteScheduledEvaluationRunRequest implements IDeleteScheduledEvaluationRunRequest { + + /** + * Constructs a new DeleteScheduledEvaluationRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest); + + /** DeleteScheduledEvaluationRunRequest name. */ + public name: string; + + /** DeleteScheduledEvaluationRunRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteScheduledEvaluationRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteScheduledEvaluationRunRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest): google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest; + + /** + * Encodes the specified DeleteScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest.verify|verify} messages. + * @param message DeleteScheduledEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest.verify|verify} messages. + * @param message DeleteScheduledEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteScheduledEvaluationRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest; + + /** + * Decodes a DeleteScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest; + + /** + * Verifies a DeleteScheduledEvaluationRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteScheduledEvaluationRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest; + + /** + * Creates a plain object from a DeleteScheduledEvaluationRunRequest message. Also converts values to other types if specified. + * @param message DeleteScheduledEvaluationRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteScheduledEvaluationRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteScheduledEvaluationRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestPersonaVoiceRequest. */ + interface ITestPersonaVoiceRequest { + + /** TestPersonaVoiceRequest app */ + app?: (string|null); + + /** TestPersonaVoiceRequest personaId */ + personaId?: (string|null); + + /** TestPersonaVoiceRequest text */ + text?: (string|null); + } + + /** Represents a TestPersonaVoiceRequest. */ + class TestPersonaVoiceRequest implements ITestPersonaVoiceRequest { + + /** + * Constructs a new TestPersonaVoiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ITestPersonaVoiceRequest); + + /** TestPersonaVoiceRequest app. */ + public app: string; + + /** TestPersonaVoiceRequest personaId. */ + public personaId: string; + + /** TestPersonaVoiceRequest text. */ + public text: string; + + /** + * Creates a new TestPersonaVoiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestPersonaVoiceRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ITestPersonaVoiceRequest): google.cloud.ces.v1beta.TestPersonaVoiceRequest; + + /** + * Encodes the specified TestPersonaVoiceRequest message. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceRequest.verify|verify} messages. + * @param message TestPersonaVoiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ITestPersonaVoiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestPersonaVoiceRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceRequest.verify|verify} messages. + * @param message TestPersonaVoiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ITestPersonaVoiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestPersonaVoiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestPersonaVoiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TestPersonaVoiceRequest; + + /** + * Decodes a TestPersonaVoiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestPersonaVoiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TestPersonaVoiceRequest; + + /** + * Verifies a TestPersonaVoiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestPersonaVoiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestPersonaVoiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TestPersonaVoiceRequest; + + /** + * Creates a plain object from a TestPersonaVoiceRequest message. Also converts values to other types if specified. + * @param message TestPersonaVoiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TestPersonaVoiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestPersonaVoiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestPersonaVoiceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UploadEvaluationAudioRequest. */ + interface IUploadEvaluationAudioRequest { + + /** UploadEvaluationAudioRequest app */ + app?: (string|null); + + /** UploadEvaluationAudioRequest audioContent */ + audioContent?: (Uint8Array|Buffer|string|null); + } + + /** Represents an UploadEvaluationAudioRequest. */ + class UploadEvaluationAudioRequest implements IUploadEvaluationAudioRequest { + + /** + * Constructs a new UploadEvaluationAudioRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUploadEvaluationAudioRequest); + + /** UploadEvaluationAudioRequest app. */ + public app: string; + + /** UploadEvaluationAudioRequest audioContent. */ + public audioContent: (Uint8Array|Buffer|string); + + /** + * Creates a new UploadEvaluationAudioRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UploadEvaluationAudioRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUploadEvaluationAudioRequest): google.cloud.ces.v1beta.UploadEvaluationAudioRequest; + + /** + * Encodes the specified UploadEvaluationAudioRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioRequest.verify|verify} messages. + * @param message UploadEvaluationAudioRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUploadEvaluationAudioRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UploadEvaluationAudioRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioRequest.verify|verify} messages. + * @param message UploadEvaluationAudioRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUploadEvaluationAudioRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UploadEvaluationAudioRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UploadEvaluationAudioRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UploadEvaluationAudioRequest; + + /** + * Decodes an UploadEvaluationAudioRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UploadEvaluationAudioRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UploadEvaluationAudioRequest; + + /** + * Verifies an UploadEvaluationAudioRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UploadEvaluationAudioRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UploadEvaluationAudioRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UploadEvaluationAudioRequest; + + /** + * Creates a plain object from an UploadEvaluationAudioRequest message. Also converts values to other types if specified. + * @param message UploadEvaluationAudioRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UploadEvaluationAudioRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UploadEvaluationAudioRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UploadEvaluationAudioRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UploadEvaluationAudioResponse. */ + interface IUploadEvaluationAudioResponse { + + /** UploadEvaluationAudioResponse audioGcsUri */ + audioGcsUri?: (string|null); + + /** UploadEvaluationAudioResponse audioTranscript */ + audioTranscript?: (string|null); + + /** UploadEvaluationAudioResponse audioDuration */ + audioDuration?: (google.protobuf.IDuration|null); + } + + /** Represents an UploadEvaluationAudioResponse. */ + class UploadEvaluationAudioResponse implements IUploadEvaluationAudioResponse { + + /** + * Constructs a new UploadEvaluationAudioResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUploadEvaluationAudioResponse); + + /** UploadEvaluationAudioResponse audioGcsUri. */ + public audioGcsUri: string; + + /** UploadEvaluationAudioResponse audioTranscript. */ + public audioTranscript: string; + + /** UploadEvaluationAudioResponse audioDuration. */ + public audioDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new UploadEvaluationAudioResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UploadEvaluationAudioResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUploadEvaluationAudioResponse): google.cloud.ces.v1beta.UploadEvaluationAudioResponse; + + /** + * Encodes the specified UploadEvaluationAudioResponse message. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioResponse.verify|verify} messages. + * @param message UploadEvaluationAudioResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUploadEvaluationAudioResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UploadEvaluationAudioResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioResponse.verify|verify} messages. + * @param message UploadEvaluationAudioResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUploadEvaluationAudioResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UploadEvaluationAudioResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UploadEvaluationAudioResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UploadEvaluationAudioResponse; + + /** + * Decodes an UploadEvaluationAudioResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UploadEvaluationAudioResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UploadEvaluationAudioResponse; + + /** + * Verifies an UploadEvaluationAudioResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UploadEvaluationAudioResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UploadEvaluationAudioResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UploadEvaluationAudioResponse; + + /** + * Creates a plain object from an UploadEvaluationAudioResponse message. Also converts values to other types if specified. + * @param message UploadEvaluationAudioResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UploadEvaluationAudioResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UploadEvaluationAudioResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UploadEvaluationAudioResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestPersonaVoiceResponse. */ + interface ITestPersonaVoiceResponse { + + /** TestPersonaVoiceResponse audio */ + audio?: (Uint8Array|Buffer|string|null); + } + + /** Represents a TestPersonaVoiceResponse. */ + class TestPersonaVoiceResponse implements ITestPersonaVoiceResponse { + + /** + * Constructs a new TestPersonaVoiceResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ITestPersonaVoiceResponse); + + /** TestPersonaVoiceResponse audio. */ + public audio: (Uint8Array|Buffer|string); + + /** + * Creates a new TestPersonaVoiceResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TestPersonaVoiceResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.ITestPersonaVoiceResponse): google.cloud.ces.v1beta.TestPersonaVoiceResponse; + + /** + * Encodes the specified TestPersonaVoiceResponse message. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceResponse.verify|verify} messages. + * @param message TestPersonaVoiceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ITestPersonaVoiceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestPersonaVoiceResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceResponse.verify|verify} messages. + * @param message TestPersonaVoiceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ITestPersonaVoiceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestPersonaVoiceResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestPersonaVoiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TestPersonaVoiceResponse; + + /** + * Decodes a TestPersonaVoiceResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestPersonaVoiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TestPersonaVoiceResponse; + + /** + * Verifies a TestPersonaVoiceResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestPersonaVoiceResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestPersonaVoiceResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TestPersonaVoiceResponse; + + /** + * Creates a plain object from a TestPersonaVoiceResponse message. Also converts values to other types if specified. + * @param message TestPersonaVoiceResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TestPersonaVoiceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestPersonaVoiceResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestPersonaVoiceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateEvaluationExpectationRequest. */ + interface ICreateEvaluationExpectationRequest { + + /** CreateEvaluationExpectationRequest parent */ + parent?: (string|null); + + /** CreateEvaluationExpectationRequest evaluationExpectationId */ + evaluationExpectationId?: (string|null); + + /** CreateEvaluationExpectationRequest evaluationExpectation */ + evaluationExpectation?: (google.cloud.ces.v1beta.IEvaluationExpectation|null); + } + + /** Represents a CreateEvaluationExpectationRequest. */ + class CreateEvaluationExpectationRequest implements ICreateEvaluationExpectationRequest { + + /** + * Constructs a new CreateEvaluationExpectationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest); + + /** CreateEvaluationExpectationRequest parent. */ + public parent: string; + + /** CreateEvaluationExpectationRequest evaluationExpectationId. */ + public evaluationExpectationId: string; + + /** CreateEvaluationExpectationRequest evaluationExpectation. */ + public evaluationExpectation?: (google.cloud.ces.v1beta.IEvaluationExpectation|null); + + /** + * Creates a new CreateEvaluationExpectationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEvaluationExpectationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest): google.cloud.ces.v1beta.CreateEvaluationExpectationRequest; + + /** + * Encodes the specified CreateEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationExpectationRequest.verify|verify} messages. + * @param message CreateEvaluationExpectationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationExpectationRequest.verify|verify} messages. + * @param message CreateEvaluationExpectationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEvaluationExpectationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateEvaluationExpectationRequest; + + /** + * Decodes a CreateEvaluationExpectationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateEvaluationExpectationRequest; + + /** + * Verifies a CreateEvaluationExpectationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEvaluationExpectationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateEvaluationExpectationRequest; + + /** + * Creates a plain object from a CreateEvaluationExpectationRequest message. Also converts values to other types if specified. + * @param message CreateEvaluationExpectationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateEvaluationExpectationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEvaluationExpectationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEvaluationExpectationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEvaluationExpectationRequest. */ + interface IUpdateEvaluationExpectationRequest { + + /** UpdateEvaluationExpectationRequest evaluationExpectation */ + evaluationExpectation?: (google.cloud.ces.v1beta.IEvaluationExpectation|null); + + /** UpdateEvaluationExpectationRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateEvaluationExpectationRequest. */ + class UpdateEvaluationExpectationRequest implements IUpdateEvaluationExpectationRequest { + + /** + * Constructs a new UpdateEvaluationExpectationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest); + + /** UpdateEvaluationExpectationRequest evaluationExpectation. */ + public evaluationExpectation?: (google.cloud.ces.v1beta.IEvaluationExpectation|null); + + /** UpdateEvaluationExpectationRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateEvaluationExpectationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEvaluationExpectationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest): google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest; + + /** + * Encodes the specified UpdateEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest.verify|verify} messages. + * @param message UpdateEvaluationExpectationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest.verify|verify} messages. + * @param message UpdateEvaluationExpectationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEvaluationExpectationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest; + + /** + * Decodes an UpdateEvaluationExpectationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest; + + /** + * Verifies an UpdateEvaluationExpectationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEvaluationExpectationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest; + + /** + * Creates a plain object from an UpdateEvaluationExpectationRequest message. Also converts values to other types if specified. + * @param message UpdateEvaluationExpectationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEvaluationExpectationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEvaluationExpectationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEvaluationExpectationRequest. */ + interface IDeleteEvaluationExpectationRequest { + + /** DeleteEvaluationExpectationRequest name */ + name?: (string|null); + + /** DeleteEvaluationExpectationRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteEvaluationExpectationRequest. */ + class DeleteEvaluationExpectationRequest implements IDeleteEvaluationExpectationRequest { + + /** + * Constructs a new DeleteEvaluationExpectationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest); + + /** DeleteEvaluationExpectationRequest name. */ + public name: string; + + /** DeleteEvaluationExpectationRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteEvaluationExpectationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEvaluationExpectationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest): google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest; + + /** + * Encodes the specified DeleteEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest.verify|verify} messages. + * @param message DeleteEvaluationExpectationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest.verify|verify} messages. + * @param message DeleteEvaluationExpectationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEvaluationExpectationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest; + + /** + * Decodes a DeleteEvaluationExpectationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest; + + /** + * Verifies a DeleteEvaluationExpectationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEvaluationExpectationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest; + + /** + * Creates a plain object from a DeleteEvaluationExpectationRequest message. Also converts values to other types if specified. + * @param message DeleteEvaluationExpectationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEvaluationExpectationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEvaluationExpectationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEvaluationExpectationRequest. */ + interface IGetEvaluationExpectationRequest { + + /** GetEvaluationExpectationRequest name */ + name?: (string|null); + } + + /** Represents a GetEvaluationExpectationRequest. */ + class GetEvaluationExpectationRequest implements IGetEvaluationExpectationRequest { + + /** + * Constructs a new GetEvaluationExpectationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetEvaluationExpectationRequest); + + /** GetEvaluationExpectationRequest name. */ + public name: string; + + /** + * Creates a new GetEvaluationExpectationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEvaluationExpectationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetEvaluationExpectationRequest): google.cloud.ces.v1beta.GetEvaluationExpectationRequest; + + /** + * Encodes the specified GetEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationExpectationRequest.verify|verify} messages. + * @param message GetEvaluationExpectationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationExpectationRequest.verify|verify} messages. + * @param message GetEvaluationExpectationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEvaluationExpectationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetEvaluationExpectationRequest; + + /** + * Decodes a GetEvaluationExpectationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetEvaluationExpectationRequest; + + /** + * Verifies a GetEvaluationExpectationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEvaluationExpectationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetEvaluationExpectationRequest; + + /** + * Creates a plain object from a GetEvaluationExpectationRequest message. Also converts values to other types if specified. + * @param message GetEvaluationExpectationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetEvaluationExpectationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEvaluationExpectationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEvaluationExpectationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationExpectationsRequest. */ + interface IListEvaluationExpectationsRequest { + + /** ListEvaluationExpectationsRequest parent */ + parent?: (string|null); + + /** ListEvaluationExpectationsRequest pageSize */ + pageSize?: (number|null); + + /** ListEvaluationExpectationsRequest pageToken */ + pageToken?: (string|null); + + /** ListEvaluationExpectationsRequest filter */ + filter?: (string|null); + + /** ListEvaluationExpectationsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListEvaluationExpectationsRequest. */ + class ListEvaluationExpectationsRequest implements IListEvaluationExpectationsRequest { + + /** + * Constructs a new ListEvaluationExpectationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationExpectationsRequest); + + /** ListEvaluationExpectationsRequest parent. */ + public parent: string; + + /** ListEvaluationExpectationsRequest pageSize. */ + public pageSize: number; + + /** ListEvaluationExpectationsRequest pageToken. */ + public pageToken: string; + + /** ListEvaluationExpectationsRequest filter. */ + public filter: string; + + /** ListEvaluationExpectationsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListEvaluationExpectationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationExpectationsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationExpectationsRequest): google.cloud.ces.v1beta.ListEvaluationExpectationsRequest; + + /** + * Encodes the specified ListEvaluationExpectationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsRequest.verify|verify} messages. + * @param message ListEvaluationExpectationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationExpectationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsRequest.verify|verify} messages. + * @param message ListEvaluationExpectationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationExpectationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationExpectationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationExpectationsRequest; + + /** + * Decodes a ListEvaluationExpectationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationExpectationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationExpectationsRequest; + + /** + * Verifies a ListEvaluationExpectationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationExpectationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationExpectationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationExpectationsRequest; + + /** + * Creates a plain object from a ListEvaluationExpectationsRequest message. Also converts values to other types if specified. + * @param message ListEvaluationExpectationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationExpectationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationExpectationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationExpectationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationExpectationsResponse. */ + interface IListEvaluationExpectationsResponse { + + /** ListEvaluationExpectationsResponse evaluationExpectations */ + evaluationExpectations?: (google.cloud.ces.v1beta.IEvaluationExpectation[]|null); + + /** ListEvaluationExpectationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEvaluationExpectationsResponse. */ + class ListEvaluationExpectationsResponse implements IListEvaluationExpectationsResponse { + + /** + * Constructs a new ListEvaluationExpectationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationExpectationsResponse); + + /** ListEvaluationExpectationsResponse evaluationExpectations. */ + public evaluationExpectations: google.cloud.ces.v1beta.IEvaluationExpectation[]; + + /** ListEvaluationExpectationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEvaluationExpectationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationExpectationsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationExpectationsResponse): google.cloud.ces.v1beta.ListEvaluationExpectationsResponse; + + /** + * Encodes the specified ListEvaluationExpectationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.verify|verify} messages. + * @param message ListEvaluationExpectationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationExpectationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationExpectationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.verify|verify} messages. + * @param message ListEvaluationExpectationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationExpectationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationExpectationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationExpectationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationExpectationsResponse; + + /** + * Decodes a ListEvaluationExpectationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationExpectationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationExpectationsResponse; + + /** + * Verifies a ListEvaluationExpectationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationExpectationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationExpectationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationExpectationsResponse; + + /** + * Creates a plain object from a ListEvaluationExpectationsResponse message. Also converts values to other types if specified. + * @param message ListEvaluationExpectationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationExpectationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationExpectationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationExpectationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Omnichannel. */ + interface IOmnichannel { + + /** Omnichannel name */ + name?: (string|null); + + /** Omnichannel displayName */ + displayName?: (string|null); + + /** Omnichannel description */ + description?: (string|null); + + /** Omnichannel createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Omnichannel updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Omnichannel etag */ + etag?: (string|null); + + /** Omnichannel integrationConfig */ + integrationConfig?: (google.cloud.ces.v1beta.IOmnichannelIntegrationConfig|null); + } + + /** Represents an Omnichannel. */ + class Omnichannel implements IOmnichannel { + + /** + * Constructs a new Omnichannel. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IOmnichannel); + + /** Omnichannel name. */ + public name: string; + + /** Omnichannel displayName. */ + public displayName: string; + + /** Omnichannel description. */ + public description: string; + + /** Omnichannel createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Omnichannel updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Omnichannel etag. */ + public etag: string; + + /** Omnichannel integrationConfig. */ + public integrationConfig?: (google.cloud.ces.v1beta.IOmnichannelIntegrationConfig|null); + + /** + * Creates a new Omnichannel instance using the specified properties. + * @param [properties] Properties to set + * @returns Omnichannel instance + */ + public static create(properties?: google.cloud.ces.v1beta.IOmnichannel): google.cloud.ces.v1beta.Omnichannel; + + /** + * Encodes the specified Omnichannel message. Does not implicitly {@link google.cloud.ces.v1beta.Omnichannel.verify|verify} messages. + * @param message Omnichannel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IOmnichannel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Omnichannel message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Omnichannel.verify|verify} messages. + * @param message Omnichannel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IOmnichannel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Omnichannel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Omnichannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Omnichannel; + + /** + * Decodes an Omnichannel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Omnichannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Omnichannel; + + /** + * Verifies an Omnichannel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Omnichannel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Omnichannel + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Omnichannel; + + /** + * Creates a plain object from an Omnichannel message. Also converts values to other types if specified. + * @param message Omnichannel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Omnichannel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Omnichannel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Omnichannel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OmnichannelIntegrationConfig. */ + interface IOmnichannelIntegrationConfig { + + /** OmnichannelIntegrationConfig channelConfigs */ + channelConfigs?: ({ [k: string]: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig }|null); + + /** OmnichannelIntegrationConfig subscriberConfigs */ + subscriberConfigs?: ({ [k: string]: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig }|null); + + /** OmnichannelIntegrationConfig routingConfigs */ + routingConfigs?: ({ [k: string]: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig }|null); + } + + /** Represents an OmnichannelIntegrationConfig. */ + class OmnichannelIntegrationConfig implements IOmnichannelIntegrationConfig { + + /** + * Constructs a new OmnichannelIntegrationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IOmnichannelIntegrationConfig); + + /** OmnichannelIntegrationConfig channelConfigs. */ + public channelConfigs: { [k: string]: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig }; + + /** OmnichannelIntegrationConfig subscriberConfigs. */ + public subscriberConfigs: { [k: string]: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig }; + + /** OmnichannelIntegrationConfig routingConfigs. */ + public routingConfigs: { [k: string]: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig }; + + /** + * Creates a new OmnichannelIntegrationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OmnichannelIntegrationConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IOmnichannelIntegrationConfig): google.cloud.ces.v1beta.OmnichannelIntegrationConfig; + + /** + * Encodes the specified OmnichannelIntegrationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.verify|verify} messages. + * @param message OmnichannelIntegrationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IOmnichannelIntegrationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OmnichannelIntegrationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.verify|verify} messages. + * @param message OmnichannelIntegrationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IOmnichannelIntegrationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OmnichannelIntegrationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelIntegrationConfig; + + /** + * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OmnichannelIntegrationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelIntegrationConfig; + + /** + * Verifies an OmnichannelIntegrationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OmnichannelIntegrationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OmnichannelIntegrationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelIntegrationConfig; + + /** + * Creates a plain object from an OmnichannelIntegrationConfig message. Also converts values to other types if specified. + * @param message OmnichannelIntegrationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OmnichannelIntegrationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OmnichannelIntegrationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OmnichannelIntegrationConfig { + + /** Properties of a ChannelConfig. */ + interface IChannelConfig { + + /** ChannelConfig whatsappConfig */ + whatsappConfig?: (google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig|null); + } + + /** Represents a ChannelConfig. */ + class ChannelConfig implements IChannelConfig { + + /** + * Constructs a new ChannelConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig); + + /** ChannelConfig whatsappConfig. */ + public whatsappConfig?: (google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig|null); + + /** ChannelConfig channelConfig. */ + public channelConfig?: "whatsappConfig"; + + /** + * Creates a new ChannelConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ChannelConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig; + + /** + * Encodes the specified ChannelConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. + * @param message ChannelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChannelConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. + * @param message ChannelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChannelConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChannelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig; + + /** + * Decodes a ChannelConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChannelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig; + + /** + * Verifies a ChannelConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChannelConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChannelConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig; + + /** + * Creates a plain object from a ChannelConfig message. Also converts values to other types if specified. + * @param message ChannelConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChannelConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChannelConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WhatsappConfig. */ + interface IWhatsappConfig { + + /** WhatsappConfig phoneNumberId */ + phoneNumberId?: (string|null); + + /** WhatsappConfig phoneNumber */ + phoneNumber?: (string|null); + + /** WhatsappConfig whatsappBusinessAccountId */ + whatsappBusinessAccountId?: (string|null); + + /** WhatsappConfig webhookVerifyToken */ + webhookVerifyToken?: (string|null); + + /** WhatsappConfig whatsappBusinessToken */ + whatsappBusinessToken?: (string|null); + + /** WhatsappConfig metaBusinessPortfolioId */ + metaBusinessPortfolioId?: (string|null); + } + + /** Represents a WhatsappConfig. */ + class WhatsappConfig implements IWhatsappConfig { + + /** + * Constructs a new WhatsappConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig); + + /** WhatsappConfig phoneNumberId. */ + public phoneNumberId: string; + + /** WhatsappConfig phoneNumber. */ + public phoneNumber: string; + + /** WhatsappConfig whatsappBusinessAccountId. */ + public whatsappBusinessAccountId: string; + + /** WhatsappConfig webhookVerifyToken. */ + public webhookVerifyToken: string; + + /** WhatsappConfig whatsappBusinessToken. */ + public whatsappBusinessToken: string; + + /** WhatsappConfig metaBusinessPortfolioId. */ + public metaBusinessPortfolioId: string; + + /** + * Creates a new WhatsappConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns WhatsappConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig; + + /** + * Encodes the specified WhatsappConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. + * @param message WhatsappConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WhatsappConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. + * @param message WhatsappConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WhatsappConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WhatsappConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig; + + /** + * Decodes a WhatsappConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WhatsappConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig; + + /** + * Verifies a WhatsappConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WhatsappConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WhatsappConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig; + + /** + * Creates a plain object from a WhatsappConfig message. Also converts values to other types if specified. + * @param message WhatsappConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WhatsappConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WhatsappConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SubscriberConfig. */ + interface ISubscriberConfig { + + /** SubscriberConfig cesAppConfig */ + cesAppConfig?: (google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig|null); + } + + /** Represents a SubscriberConfig. */ + class SubscriberConfig implements ISubscriberConfig { + + /** + * Constructs a new SubscriberConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig); + + /** SubscriberConfig cesAppConfig. */ + public cesAppConfig?: (google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig|null); + + /** SubscriberConfig subscriberConfig. */ + public subscriberConfig?: "cesAppConfig"; + + /** + * Creates a new SubscriberConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SubscriberConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig; + + /** + * Encodes the specified SubscriberConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. + * @param message SubscriberConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubscriberConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. + * @param message SubscriberConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubscriberConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubscriberConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig; + + /** + * Decodes a SubscriberConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubscriberConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig; + + /** + * Verifies a SubscriberConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubscriberConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubscriberConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig; + + /** + * Creates a plain object from a SubscriberConfig message. Also converts values to other types if specified. + * @param message SubscriberConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubscriberConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubscriberConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CesAppConfig. */ + interface ICesAppConfig { + + /** CesAppConfig app */ + app?: (string|null); + } + + /** Represents a CesAppConfig. */ + class CesAppConfig implements ICesAppConfig { + + /** + * Constructs a new CesAppConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig); + + /** CesAppConfig app. */ + public app: string; + + /** + * Creates a new CesAppConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CesAppConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig; + + /** + * Encodes the specified CesAppConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. + * @param message CesAppConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CesAppConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. + * @param message CesAppConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CesAppConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CesAppConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig; + + /** + * Decodes a CesAppConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CesAppConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig; + + /** + * Verifies a CesAppConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CesAppConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CesAppConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig; + + /** + * Creates a plain object from a CesAppConfig message. Also converts values to other types if specified. + * @param message CesAppConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CesAppConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CesAppConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoutingConfig. */ + interface IRoutingConfig { + + /** RoutingConfig subscriberKey */ + subscriberKey?: (string|null); + } + + /** Represents a RoutingConfig. */ + class RoutingConfig implements IRoutingConfig { + + /** + * Constructs a new RoutingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig); + + /** RoutingConfig subscriberKey. */ + public subscriberKey: string; + + /** + * Creates a new RoutingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutingConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig; + + /** + * Encodes the specified RoutingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. + * @param message RoutingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. + * @param message RoutingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig; + + /** + * Decodes a RoutingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig; + + /** + * Verifies a RoutingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig; + + /** + * Creates a plain object from a RoutingConfig message. Also converts values to other types if specified. + * @param message RoutingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OmnichannelOperationMetadata. */ + interface IOmnichannelOperationMetadata { + + /** OmnichannelOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OmnichannelOperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OmnichannelOperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OmnichannelOperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + } + + /** Represents an OmnichannelOperationMetadata. */ + class OmnichannelOperationMetadata implements IOmnichannelOperationMetadata { + + /** + * Constructs a new OmnichannelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IOmnichannelOperationMetadata); + + /** OmnichannelOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OmnichannelOperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OmnichannelOperationMetadata statusMessage. */ + public statusMessage: string; + + /** OmnichannelOperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** + * Creates a new OmnichannelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OmnichannelOperationMetadata instance + */ + public static create(properties?: google.cloud.ces.v1beta.IOmnichannelOperationMetadata): google.cloud.ces.v1beta.OmnichannelOperationMetadata; + + /** + * Encodes the specified OmnichannelOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelOperationMetadata.verify|verify} messages. + * @param message OmnichannelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IOmnichannelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OmnichannelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelOperationMetadata.verify|verify} messages. + * @param message OmnichannelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IOmnichannelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OmnichannelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelOperationMetadata; + + /** + * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OmnichannelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelOperationMetadata; + + /** + * Verifies an OmnichannelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OmnichannelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OmnichannelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelOperationMetadata; + + /** + * Creates a plain object from an OmnichannelOperationMetadata message. Also converts values to other types if specified. + * @param message OmnichannelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OmnichannelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OmnichannelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OmnichannelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a ToolService */ + class ToolService extends $protobuf.rpc.Service { + + /** + * Constructs a new ToolService 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 ToolService 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): ToolService; + + /** + * Calls ExecuteTool. + * @param request ExecuteToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExecuteToolResponse + */ + public executeTool(request: google.cloud.ces.v1beta.IExecuteToolRequest, callback: google.cloud.ces.v1beta.ToolService.ExecuteToolCallback): void; + + /** + * Calls ExecuteTool. + * @param request ExecuteToolRequest message or plain object + * @returns Promise + */ + public executeTool(request: google.cloud.ces.v1beta.IExecuteToolRequest): Promise; + + /** + * Calls RetrieveToolSchema. + * @param request RetrieveToolSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RetrieveToolSchemaResponse + */ + public retrieveToolSchema(request: google.cloud.ces.v1beta.IRetrieveToolSchemaRequest, callback: google.cloud.ces.v1beta.ToolService.RetrieveToolSchemaCallback): void; + + /** + * Calls RetrieveToolSchema. + * @param request RetrieveToolSchemaRequest message or plain object + * @returns Promise + */ + public retrieveToolSchema(request: google.cloud.ces.v1beta.IRetrieveToolSchemaRequest): Promise; + + /** + * Calls RetrieveTools. + * @param request RetrieveToolsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RetrieveToolsResponse + */ + public retrieveTools(request: google.cloud.ces.v1beta.IRetrieveToolsRequest, callback: google.cloud.ces.v1beta.ToolService.RetrieveToolsCallback): void; + + /** + * Calls RetrieveTools. + * @param request RetrieveToolsRequest message or plain object + * @returns Promise + */ + public retrieveTools(request: google.cloud.ces.v1beta.IRetrieveToolsRequest): Promise; + } + + namespace ToolService { + + /** + * Callback as used by {@link google.cloud.ces.v1beta.ToolService|executeTool}. + * @param error Error, if any + * @param [response] ExecuteToolResponse + */ + type ExecuteToolCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ExecuteToolResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.ToolService|retrieveToolSchema}. + * @param error Error, if any + * @param [response] RetrieveToolSchemaResponse + */ + type RetrieveToolSchemaCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.RetrieveToolSchemaResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.ToolService|retrieveTools}. + * @param error Error, if any + * @param [response] RetrieveToolsResponse + */ + type RetrieveToolsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.RetrieveToolsResponse) => void; + } + + /** Properties of an ExecuteToolRequest. */ + interface IExecuteToolRequest { + + /** ExecuteToolRequest tool */ + tool?: (string|null); + + /** ExecuteToolRequest toolsetTool */ + toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ExecuteToolRequest parent */ + parent?: (string|null); + + /** ExecuteToolRequest args */ + args?: (google.protobuf.IStruct|null); + + /** ExecuteToolRequest variables */ + variables?: (google.protobuf.IStruct|null); + } + + /** Represents an ExecuteToolRequest. */ + class ExecuteToolRequest implements IExecuteToolRequest { + + /** + * Constructs a new ExecuteToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IExecuteToolRequest); + + /** ExecuteToolRequest tool. */ + public tool?: (string|null); + + /** ExecuteToolRequest toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ExecuteToolRequest parent. */ + public parent: string; + + /** ExecuteToolRequest args. */ + public args?: (google.protobuf.IStruct|null); + + /** ExecuteToolRequest variables. */ + public variables?: (google.protobuf.IStruct|null); + + /** ExecuteToolRequest toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new ExecuteToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteToolRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IExecuteToolRequest): google.cloud.ces.v1beta.ExecuteToolRequest; + + /** + * Encodes the specified ExecuteToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolRequest.verify|verify} messages. + * @param message ExecuteToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IExecuteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolRequest.verify|verify} messages. + * @param message ExecuteToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IExecuteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ExecuteToolRequest; + + /** + * Decodes an ExecuteToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ExecuteToolRequest; + + /** + * Verifies an ExecuteToolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ExecuteToolRequest; + + /** + * Creates a plain object from an ExecuteToolRequest message. Also converts values to other types if specified. + * @param message ExecuteToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ExecuteToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecuteToolResponse. */ + interface IExecuteToolResponse { + + /** ExecuteToolResponse tool */ + tool?: (string|null); + + /** ExecuteToolResponse toolsetTool */ + toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ExecuteToolResponse response */ + response?: (google.protobuf.IStruct|null); + + /** ExecuteToolResponse variables */ + variables?: (google.protobuf.IStruct|null); + } + + /** Represents an ExecuteToolResponse. */ + class ExecuteToolResponse implements IExecuteToolResponse { + + /** + * Constructs a new ExecuteToolResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IExecuteToolResponse); + + /** ExecuteToolResponse tool. */ + public tool?: (string|null); + + /** ExecuteToolResponse toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ExecuteToolResponse response. */ + public response?: (google.protobuf.IStruct|null); + + /** ExecuteToolResponse variables. */ + public variables?: (google.protobuf.IStruct|null); + + /** ExecuteToolResponse toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new ExecuteToolResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteToolResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IExecuteToolResponse): google.cloud.ces.v1beta.ExecuteToolResponse; + + /** + * Encodes the specified ExecuteToolResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolResponse.verify|verify} messages. + * @param message ExecuteToolResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IExecuteToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolResponse.verify|verify} messages. + * @param message ExecuteToolResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IExecuteToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteToolResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ExecuteToolResponse; + + /** + * Decodes an ExecuteToolResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ExecuteToolResponse; + + /** + * Verifies an ExecuteToolResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteToolResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteToolResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ExecuteToolResponse; + + /** + * Creates a plain object from an ExecuteToolResponse message. Also converts values to other types if specified. + * @param message ExecuteToolResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ExecuteToolResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteToolResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteToolResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetrieveToolSchemaRequest. */ + interface IRetrieveToolSchemaRequest { + + /** RetrieveToolSchemaRequest tool */ + tool?: (string|null); + + /** RetrieveToolSchemaRequest toolsetTool */ + toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** RetrieveToolSchemaRequest parent */ + parent?: (string|null); + } + + /** Represents a RetrieveToolSchemaRequest. */ + class RetrieveToolSchemaRequest implements IRetrieveToolSchemaRequest { + + /** + * Constructs a new RetrieveToolSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRetrieveToolSchemaRequest); + + /** RetrieveToolSchemaRequest tool. */ + public tool?: (string|null); + + /** RetrieveToolSchemaRequest toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** RetrieveToolSchemaRequest parent. */ + public parent: string; + + /** RetrieveToolSchemaRequest toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new RetrieveToolSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrieveToolSchemaRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRetrieveToolSchemaRequest): google.cloud.ces.v1beta.RetrieveToolSchemaRequest; + + /** + * Encodes the specified RetrieveToolSchemaRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaRequest.verify|verify} messages. + * @param message RetrieveToolSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRetrieveToolSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrieveToolSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaRequest.verify|verify} messages. + * @param message RetrieveToolSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRetrieveToolSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrieveToolSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RetrieveToolSchemaRequest; + + /** + * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrieveToolSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RetrieveToolSchemaRequest; + + /** + * Verifies a RetrieveToolSchemaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrieveToolSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrieveToolSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RetrieveToolSchemaRequest; + + /** + * Creates a plain object from a RetrieveToolSchemaRequest message. Also converts values to other types if specified. + * @param message RetrieveToolSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RetrieveToolSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrieveToolSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrieveToolSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetrieveToolSchemaResponse. */ + interface IRetrieveToolSchemaResponse { + + /** RetrieveToolSchemaResponse tool */ + tool?: (string|null); + + /** RetrieveToolSchemaResponse toolsetTool */ + toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** RetrieveToolSchemaResponse inputSchema */ + inputSchema?: (google.cloud.ces.v1beta.ISchema|null); + + /** RetrieveToolSchemaResponse outputSchema */ + outputSchema?: (google.cloud.ces.v1beta.ISchema|null); + } + + /** Represents a RetrieveToolSchemaResponse. */ + class RetrieveToolSchemaResponse implements IRetrieveToolSchemaResponse { + + /** + * Constructs a new RetrieveToolSchemaResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRetrieveToolSchemaResponse); + + /** RetrieveToolSchemaResponse tool. */ + public tool?: (string|null); + + /** RetrieveToolSchemaResponse toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** RetrieveToolSchemaResponse inputSchema. */ + public inputSchema?: (google.cloud.ces.v1beta.ISchema|null); + + /** RetrieveToolSchemaResponse outputSchema. */ + public outputSchema?: (google.cloud.ces.v1beta.ISchema|null); + + /** RetrieveToolSchemaResponse toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new RetrieveToolSchemaResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrieveToolSchemaResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRetrieveToolSchemaResponse): google.cloud.ces.v1beta.RetrieveToolSchemaResponse; + + /** + * Encodes the specified RetrieveToolSchemaResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaResponse.verify|verify} messages. + * @param message RetrieveToolSchemaResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRetrieveToolSchemaResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrieveToolSchemaResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaResponse.verify|verify} messages. + * @param message RetrieveToolSchemaResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRetrieveToolSchemaResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrieveToolSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RetrieveToolSchemaResponse; + + /** + * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrieveToolSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RetrieveToolSchemaResponse; + + /** + * Verifies a RetrieveToolSchemaResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrieveToolSchemaResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrieveToolSchemaResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RetrieveToolSchemaResponse; + + /** + * Creates a plain object from a RetrieveToolSchemaResponse message. Also converts values to other types if specified. + * @param message RetrieveToolSchemaResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RetrieveToolSchemaResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrieveToolSchemaResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrieveToolSchemaResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetrieveToolsRequest. */ + interface IRetrieveToolsRequest { + + /** RetrieveToolsRequest toolset */ + toolset?: (string|null); + + /** RetrieveToolsRequest toolIds */ + toolIds?: (string[]|null); + } + + /** Represents a RetrieveToolsRequest. */ + class RetrieveToolsRequest implements IRetrieveToolsRequest { + + /** + * Constructs a new RetrieveToolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRetrieveToolsRequest); + + /** RetrieveToolsRequest toolset. */ + public toolset: string; + + /** RetrieveToolsRequest toolIds. */ + public toolIds: string[]; + + /** + * Creates a new RetrieveToolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrieveToolsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRetrieveToolsRequest): google.cloud.ces.v1beta.RetrieveToolsRequest; + + /** + * Encodes the specified RetrieveToolsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsRequest.verify|verify} messages. + * @param message RetrieveToolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRetrieveToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrieveToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsRequest.verify|verify} messages. + * @param message RetrieveToolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRetrieveToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrieveToolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrieveToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RetrieveToolsRequest; + + /** + * Decodes a RetrieveToolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrieveToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RetrieveToolsRequest; + + /** + * Verifies a RetrieveToolsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrieveToolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrieveToolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RetrieveToolsRequest; + + /** + * Creates a plain object from a RetrieveToolsRequest message. Also converts values to other types if specified. + * @param message RetrieveToolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RetrieveToolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrieveToolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrieveToolsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetrieveToolsResponse. */ + interface IRetrieveToolsResponse { + + /** RetrieveToolsResponse tools */ + tools?: (google.cloud.ces.v1beta.ITool[]|null); + } + + /** Represents a RetrieveToolsResponse. */ + class RetrieveToolsResponse implements IRetrieveToolsResponse { + + /** + * Constructs a new RetrieveToolsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRetrieveToolsResponse); + + /** RetrieveToolsResponse tools. */ + public tools: google.cloud.ces.v1beta.ITool[]; + + /** + * Creates a new RetrieveToolsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrieveToolsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRetrieveToolsResponse): google.cloud.ces.v1beta.RetrieveToolsResponse; + + /** + * Encodes the specified RetrieveToolsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsResponse.verify|verify} messages. + * @param message RetrieveToolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRetrieveToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrieveToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsResponse.verify|verify} messages. + * @param message RetrieveToolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRetrieveToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrieveToolsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrieveToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RetrieveToolsResponse; + + /** + * Decodes a RetrieveToolsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrieveToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RetrieveToolsResponse; + + /** + * Verifies a RetrieveToolsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrieveToolsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrieveToolsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RetrieveToolsResponse; + + /** + * Creates a plain object from a RetrieveToolsResponse message. Also converts values to other types if specified. + * @param message RetrieveToolsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RetrieveToolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrieveToolsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrieveToolsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a WidgetService */ + class WidgetService extends $protobuf.rpc.Service { + + /** + * Constructs a new WidgetService 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 WidgetService 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): WidgetService; + + /** + * Calls GenerateChatToken. + * @param request GenerateChatTokenRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateChatTokenResponse + */ + public generateChatToken(request: google.cloud.ces.v1beta.IGenerateChatTokenRequest, callback: google.cloud.ces.v1beta.WidgetService.GenerateChatTokenCallback): void; + + /** + * Calls GenerateChatToken. + * @param request GenerateChatTokenRequest message or plain object + * @returns Promise + */ + public generateChatToken(request: google.cloud.ces.v1beta.IGenerateChatTokenRequest): Promise; + } + + namespace WidgetService { + + /** + * Callback as used by {@link google.cloud.ces.v1beta.WidgetService|generateChatToken}. + * @param error Error, if any + * @param [response] GenerateChatTokenResponse + */ + type GenerateChatTokenCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.GenerateChatTokenResponse) => void; + } + + /** Properties of a GenerateChatTokenRequest. */ + interface IGenerateChatTokenRequest { + + /** GenerateChatTokenRequest name */ + name?: (string|null); + + /** GenerateChatTokenRequest deployment */ + deployment?: (string|null); + + /** GenerateChatTokenRequest recaptchaToken */ + recaptchaToken?: (string|null); + } + + /** Represents a GenerateChatTokenRequest. */ + class GenerateChatTokenRequest implements IGenerateChatTokenRequest { + + /** + * Constructs a new GenerateChatTokenRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGenerateChatTokenRequest); + + /** GenerateChatTokenRequest name. */ + public name: string; + + /** GenerateChatTokenRequest deployment. */ + public deployment: string; + + /** GenerateChatTokenRequest recaptchaToken. */ + public recaptchaToken: string; + + /** + * Creates a new GenerateChatTokenRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateChatTokenRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGenerateChatTokenRequest): google.cloud.ces.v1beta.GenerateChatTokenRequest; + + /** + * Encodes the specified GenerateChatTokenRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenRequest.verify|verify} messages. + * @param message GenerateChatTokenRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGenerateChatTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateChatTokenRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenRequest.verify|verify} messages. + * @param message GenerateChatTokenRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGenerateChatTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateChatTokenRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateChatTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateChatTokenRequest; + + /** + * Decodes a GenerateChatTokenRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateChatTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateChatTokenRequest; + + /** + * Verifies a GenerateChatTokenRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateChatTokenRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateChatTokenRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateChatTokenRequest; + + /** + * Creates a plain object from a GenerateChatTokenRequest message. Also converts values to other types if specified. + * @param message GenerateChatTokenRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateChatTokenRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateChatTokenRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateChatTokenRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateChatTokenResponse. */ + interface IGenerateChatTokenResponse { + + /** GenerateChatTokenResponse chatToken */ + chatToken?: (string|null); + + /** GenerateChatTokenResponse expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a GenerateChatTokenResponse. */ + class GenerateChatTokenResponse implements IGenerateChatTokenResponse { + + /** + * Constructs a new GenerateChatTokenResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGenerateChatTokenResponse); + + /** GenerateChatTokenResponse chatToken. */ + public chatToken: string; + + /** GenerateChatTokenResponse expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new GenerateChatTokenResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateChatTokenResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGenerateChatTokenResponse): google.cloud.ces.v1beta.GenerateChatTokenResponse; + + /** + * Encodes the specified GenerateChatTokenResponse message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenResponse.verify|verify} messages. + * @param message GenerateChatTokenResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGenerateChatTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateChatTokenResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenResponse.verify|verify} messages. + * @param message GenerateChatTokenResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGenerateChatTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateChatTokenResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateChatTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateChatTokenResponse; + + /** + * Decodes a GenerateChatTokenResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateChatTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateChatTokenResponse; + + /** + * Verifies a GenerateChatTokenResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateChatTokenResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateChatTokenResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateChatTokenResponse; + + /** + * Creates a plain object from a GenerateChatTokenResponse message. Also converts values to other types if specified. + * @param message GenerateChatTokenResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateChatTokenResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateChatTokenResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateChatTokenResponse + * @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 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.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|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @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 an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace 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-ces/protos/protos.js b/owl-bot-staging/google-cloud-ces/protos/protos.js new file mode 100644 index 00000000000..76b1c3b6925 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/protos.js @@ -0,0 +1,185109 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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_ces_protos || ($protobuf.roots._google_cloud_ces_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.ces = (function() { + + /** + * Namespace ces. + * @memberof google.cloud + * @namespace + */ + var ces = {}; + + ces.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.ces + * @namespace + */ + var v1 = {}; + + v1.Agent = (function() { + + /** + * Properties of an Agent. + * @memberof google.cloud.ces.v1 + * @interface IAgent + * @property {google.cloud.ces.v1.Agent.ILlmAgent|null} [llmAgent] Agent llmAgent + * @property {google.cloud.ces.v1.Agent.IRemoteDialogflowAgent|null} [remoteDialogflowAgent] Agent remoteDialogflowAgent + * @property {string|null} [name] Agent name + * @property {string|null} [displayName] Agent displayName + * @property {string|null} [description] Agent description + * @property {google.cloud.ces.v1.IModelSettings|null} [modelSettings] Agent modelSettings + * @property {string|null} [instruction] Agent instruction + * @property {Array.|null} [tools] Agent tools + * @property {Array.|null} [childAgents] Agent childAgents + * @property {Array.|null} [beforeAgentCallbacks] Agent beforeAgentCallbacks + * @property {Array.|null} [afterAgentCallbacks] Agent afterAgentCallbacks + * @property {Array.|null} [beforeModelCallbacks] Agent beforeModelCallbacks + * @property {Array.|null} [afterModelCallbacks] Agent afterModelCallbacks + * @property {Array.|null} [beforeToolCallbacks] Agent beforeToolCallbacks + * @property {Array.|null} [afterToolCallbacks] Agent afterToolCallbacks + * @property {google.protobuf.ITimestamp|null} [createTime] Agent createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Agent updateTime + * @property {Array.|null} [guardrails] Agent guardrails + * @property {string|null} [etag] Agent etag + * @property {Array.|null} [toolsets] Agent toolsets + * @property {string|null} [generatedSummary] Agent generatedSummary + * @property {Array.|null} [transferRules] Agent transferRules + */ + + /** + * Constructs a new Agent. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an Agent. + * @implements IAgent + * @constructor + * @param {google.cloud.ces.v1.IAgent=} [properties] Properties to set + */ + function Agent(properties) { + this.tools = []; + this.childAgents = []; + this.beforeAgentCallbacks = []; + this.afterAgentCallbacks = []; + this.beforeModelCallbacks = []; + this.afterModelCallbacks = []; + this.beforeToolCallbacks = []; + this.afterToolCallbacks = []; + this.guardrails = []; + this.toolsets = []; + this.transferRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Agent llmAgent. + * @member {google.cloud.ces.v1.Agent.ILlmAgent|null|undefined} llmAgent + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.llmAgent = null; + + /** + * Agent remoteDialogflowAgent. + * @member {google.cloud.ces.v1.Agent.IRemoteDialogflowAgent|null|undefined} remoteDialogflowAgent + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.remoteDialogflowAgent = null; + + /** + * Agent name. + * @member {string} name + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.name = ""; + + /** + * Agent displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.displayName = ""; + + /** + * Agent description. + * @member {string} description + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.description = ""; + + /** + * Agent modelSettings. + * @member {google.cloud.ces.v1.IModelSettings|null|undefined} modelSettings + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.modelSettings = null; + + /** + * Agent instruction. + * @member {string} instruction + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.instruction = ""; + + /** + * Agent tools. + * @member {Array.} tools + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.tools = $util.emptyArray; + + /** + * Agent childAgents. + * @member {Array.} childAgents + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.childAgents = $util.emptyArray; + + /** + * Agent beforeAgentCallbacks. + * @member {Array.} beforeAgentCallbacks + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.beforeAgentCallbacks = $util.emptyArray; + + /** + * Agent afterAgentCallbacks. + * @member {Array.} afterAgentCallbacks + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.afterAgentCallbacks = $util.emptyArray; + + /** + * Agent beforeModelCallbacks. + * @member {Array.} beforeModelCallbacks + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.beforeModelCallbacks = $util.emptyArray; + + /** + * Agent afterModelCallbacks. + * @member {Array.} afterModelCallbacks + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.afterModelCallbacks = $util.emptyArray; + + /** + * Agent beforeToolCallbacks. + * @member {Array.} beforeToolCallbacks + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.beforeToolCallbacks = $util.emptyArray; + + /** + * Agent afterToolCallbacks. + * @member {Array.} afterToolCallbacks + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.afterToolCallbacks = $util.emptyArray; + + /** + * Agent createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.createTime = null; + + /** + * Agent updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.updateTime = null; + + /** + * Agent guardrails. + * @member {Array.} guardrails + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.guardrails = $util.emptyArray; + + /** + * Agent etag. + * @member {string} etag + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.etag = ""; + + /** + * Agent toolsets. + * @member {Array.} toolsets + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.toolsets = $util.emptyArray; + + /** + * Agent generatedSummary. + * @member {string} generatedSummary + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.generatedSummary = ""; + + /** + * Agent transferRules. + * @member {Array.} transferRules + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Agent.prototype.transferRules = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Agent agentType. + * @member {"llmAgent"|"remoteDialogflowAgent"|undefined} agentType + * @memberof google.cloud.ces.v1.Agent + * @instance + */ + Object.defineProperty(Agent.prototype, "agentType", { + get: $util.oneOfGetter($oneOfFields = ["llmAgent", "remoteDialogflowAgent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Agent instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Agent + * @static + * @param {google.cloud.ces.v1.IAgent=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Agent} Agent instance + */ + Agent.create = function create(properties) { + return new Agent(properties); + }; + + /** + * Encodes the specified Agent message. Does not implicitly {@link google.cloud.ces.v1.Agent.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Agent + * @static + * @param {google.cloud.ces.v1.IAgent} message Agent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Agent.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) + $root.google.cloud.ces.v1.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.instruction != null && Object.hasOwnProperty.call(message, "instruction")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.instruction); + if (message.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.tools[i]); + if (message.childAgents != null && message.childAgents.length) + for (var i = 0; i < message.childAgents.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.childAgents[i]); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.guardrails != null && message.guardrails.length) + for (var i = 0; i < message.guardrails.length; ++i) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.guardrails[i]); + if (message.beforeAgentCallbacks != null && message.beforeAgentCallbacks.length) + for (var i = 0; i < message.beforeAgentCallbacks.length; ++i) + $root.google.cloud.ces.v1.Callback.encode(message.beforeAgentCallbacks[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.afterAgentCallbacks != null && message.afterAgentCallbacks.length) + for (var i = 0; i < message.afterAgentCallbacks.length; ++i) + $root.google.cloud.ces.v1.Callback.encode(message.afterAgentCallbacks[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.beforeModelCallbacks != null && message.beforeModelCallbacks.length) + for (var i = 0; i < message.beforeModelCallbacks.length; ++i) + $root.google.cloud.ces.v1.Callback.encode(message.beforeModelCallbacks[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.afterModelCallbacks != null && message.afterModelCallbacks.length) + for (var i = 0; i < message.afterModelCallbacks.length; ++i) + $root.google.cloud.ces.v1.Callback.encode(message.afterModelCallbacks[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.beforeToolCallbacks != null && message.beforeToolCallbacks.length) + for (var i = 0; i < message.beforeToolCallbacks.length; ++i) + $root.google.cloud.ces.v1.Callback.encode(message.beforeToolCallbacks[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.afterToolCallbacks != null && message.afterToolCallbacks.length) + for (var i = 0; i < message.afterToolCallbacks.length; ++i) + $root.google.cloud.ces.v1.Callback.encode(message.afterToolCallbacks[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 24, wireType 2 =*/194).string(message.etag); + if (message.llmAgent != null && Object.hasOwnProperty.call(message, "llmAgent")) + $root.google.cloud.ces.v1.Agent.LlmAgent.encode(message.llmAgent, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.remoteDialogflowAgent != null && Object.hasOwnProperty.call(message, "remoteDialogflowAgent")) + $root.google.cloud.ces.v1.Agent.RemoteDialogflowAgent.encode(message.remoteDialogflowAgent, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.toolsets != null && message.toolsets.length) + for (var i = 0; i < message.toolsets.length; ++i) + $root.google.cloud.ces.v1.Agent.AgentToolset.encode(message.toolsets[i], writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.generatedSummary != null && Object.hasOwnProperty.call(message, "generatedSummary")) + writer.uint32(/* id 29, wireType 2 =*/234).string(message.generatedSummary); + if (message.transferRules != null && message.transferRules.length) + for (var i = 0; i < message.transferRules.length; ++i) + $root.google.cloud.ces.v1.TransferRule.encode(message.transferRules[i], writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Agent message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Agent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Agent + * @static + * @param {google.cloud.ces.v1.IAgent} message Agent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Agent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Agent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Agent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Agent} Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Agent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Agent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 26: { + message.llmAgent = $root.google.cloud.ces.v1.Agent.LlmAgent.decode(reader, reader.uint32()); + break; + } + case 27: { + message.remoteDialogflowAgent = $root.google.cloud.ces.v1.Agent.RemoteDialogflowAgent.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.decode(reader, reader.uint32()); + break; + } + case 6: { + message.instruction = reader.string(); + break; + } + case 7: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push(reader.string()); + break; + } + case 8: { + if (!(message.childAgents && message.childAgents.length)) + message.childAgents = []; + message.childAgents.push(reader.string()); + break; + } + case 18: { + if (!(message.beforeAgentCallbacks && message.beforeAgentCallbacks.length)) + message.beforeAgentCallbacks = []; + message.beforeAgentCallbacks.push($root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32())); + break; + } + case 19: { + if (!(message.afterAgentCallbacks && message.afterAgentCallbacks.length)) + message.afterAgentCallbacks = []; + message.afterAgentCallbacks.push($root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32())); + break; + } + case 20: { + if (!(message.beforeModelCallbacks && message.beforeModelCallbacks.length)) + message.beforeModelCallbacks = []; + message.beforeModelCallbacks.push($root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32())); + break; + } + case 21: { + if (!(message.afterModelCallbacks && message.afterModelCallbacks.length)) + message.afterModelCallbacks = []; + message.afterModelCallbacks.push($root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32())); + break; + } + case 22: { + if (!(message.beforeToolCallbacks && message.beforeToolCallbacks.length)) + message.beforeToolCallbacks = []; + message.beforeToolCallbacks.push($root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32())); + break; + } + case 23: { + if (!(message.afterToolCallbacks && message.afterToolCallbacks.length)) + message.afterToolCallbacks = []; + message.afterToolCallbacks.push($root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32())); + break; + } + case 15: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 16: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 17: { + if (!(message.guardrails && message.guardrails.length)) + message.guardrails = []; + message.guardrails.push(reader.string()); + break; + } + case 24: { + message.etag = reader.string(); + break; + } + case 28: { + if (!(message.toolsets && message.toolsets.length)) + message.toolsets = []; + message.toolsets.push($root.google.cloud.ces.v1.Agent.AgentToolset.decode(reader, reader.uint32())); + break; + } + case 29: { + message.generatedSummary = reader.string(); + break; + } + case 30: { + if (!(message.transferRules && message.transferRules.length)) + message.transferRules = []; + message.transferRules.push($root.google.cloud.ces.v1.TransferRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Agent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Agent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Agent} Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Agent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Agent message. + * @function verify + * @memberof google.cloud.ces.v1.Agent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Agent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.llmAgent != null && message.hasOwnProperty("llmAgent")) { + properties.agentType = 1; + { + var error = $root.google.cloud.ces.v1.Agent.LlmAgent.verify(message.llmAgent); + if (error) + return "llmAgent." + error; + } + } + if (message.remoteDialogflowAgent != null && message.hasOwnProperty("remoteDialogflowAgent")) { + if (properties.agentType === 1) + return "agentType: multiple values"; + properties.agentType = 1; + { + var error = $root.google.cloud.ces.v1.Agent.RemoteDialogflowAgent.verify(message.remoteDialogflowAgent); + if (error) + return "remoteDialogflowAgent." + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { + var error = $root.google.cloud.ces.v1.ModelSettings.verify(message.modelSettings); + if (error) + return "modelSettings." + error; + } + if (message.instruction != null && message.hasOwnProperty("instruction")) + if (!$util.isString(message.instruction)) + return "instruction: string expected"; + if (message.tools != null && message.hasOwnProperty("tools")) { + if (!Array.isArray(message.tools)) + return "tools: array expected"; + for (var i = 0; i < message.tools.length; ++i) + if (!$util.isString(message.tools[i])) + return "tools: string[] expected"; + } + if (message.childAgents != null && message.hasOwnProperty("childAgents")) { + if (!Array.isArray(message.childAgents)) + return "childAgents: array expected"; + for (var i = 0; i < message.childAgents.length; ++i) + if (!$util.isString(message.childAgents[i])) + return "childAgents: string[] expected"; + } + if (message.beforeAgentCallbacks != null && message.hasOwnProperty("beforeAgentCallbacks")) { + if (!Array.isArray(message.beforeAgentCallbacks)) + return "beforeAgentCallbacks: array expected"; + for (var i = 0; i < message.beforeAgentCallbacks.length; ++i) { + var error = $root.google.cloud.ces.v1.Callback.verify(message.beforeAgentCallbacks[i]); + if (error) + return "beforeAgentCallbacks." + error; + } + } + if (message.afterAgentCallbacks != null && message.hasOwnProperty("afterAgentCallbacks")) { + if (!Array.isArray(message.afterAgentCallbacks)) + return "afterAgentCallbacks: array expected"; + for (var i = 0; i < message.afterAgentCallbacks.length; ++i) { + var error = $root.google.cloud.ces.v1.Callback.verify(message.afterAgentCallbacks[i]); + if (error) + return "afterAgentCallbacks." + error; + } + } + if (message.beforeModelCallbacks != null && message.hasOwnProperty("beforeModelCallbacks")) { + if (!Array.isArray(message.beforeModelCallbacks)) + return "beforeModelCallbacks: array expected"; + for (var i = 0; i < message.beforeModelCallbacks.length; ++i) { + var error = $root.google.cloud.ces.v1.Callback.verify(message.beforeModelCallbacks[i]); + if (error) + return "beforeModelCallbacks." + error; + } + } + if (message.afterModelCallbacks != null && message.hasOwnProperty("afterModelCallbacks")) { + if (!Array.isArray(message.afterModelCallbacks)) + return "afterModelCallbacks: array expected"; + for (var i = 0; i < message.afterModelCallbacks.length; ++i) { + var error = $root.google.cloud.ces.v1.Callback.verify(message.afterModelCallbacks[i]); + if (error) + return "afterModelCallbacks." + error; + } + } + if (message.beforeToolCallbacks != null && message.hasOwnProperty("beforeToolCallbacks")) { + if (!Array.isArray(message.beforeToolCallbacks)) + return "beforeToolCallbacks: array expected"; + for (var i = 0; i < message.beforeToolCallbacks.length; ++i) { + var error = $root.google.cloud.ces.v1.Callback.verify(message.beforeToolCallbacks[i]); + if (error) + return "beforeToolCallbacks." + error; + } + } + if (message.afterToolCallbacks != null && message.hasOwnProperty("afterToolCallbacks")) { + if (!Array.isArray(message.afterToolCallbacks)) + return "afterToolCallbacks: array expected"; + for (var i = 0; i < message.afterToolCallbacks.length; ++i) { + var error = $root.google.cloud.ces.v1.Callback.verify(message.afterToolCallbacks[i]); + if (error) + return "afterToolCallbacks." + error; + } + } + 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.guardrails != null && message.hasOwnProperty("guardrails")) { + if (!Array.isArray(message.guardrails)) + return "guardrails: array expected"; + for (var i = 0; i < message.guardrails.length; ++i) + if (!$util.isString(message.guardrails[i])) + return "guardrails: string[] expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.toolsets != null && message.hasOwnProperty("toolsets")) { + if (!Array.isArray(message.toolsets)) + return "toolsets: array expected"; + for (var i = 0; i < message.toolsets.length; ++i) { + var error = $root.google.cloud.ces.v1.Agent.AgentToolset.verify(message.toolsets[i]); + if (error) + return "toolsets." + error; + } + } + if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) + if (!$util.isString(message.generatedSummary)) + return "generatedSummary: string expected"; + if (message.transferRules != null && message.hasOwnProperty("transferRules")) { + if (!Array.isArray(message.transferRules)) + return "transferRules: array expected"; + for (var i = 0; i < message.transferRules.length; ++i) { + var error = $root.google.cloud.ces.v1.TransferRule.verify(message.transferRules[i]); + if (error) + return "transferRules." + error; + } + } + return null; + }; + + /** + * Creates an Agent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Agent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Agent} Agent + */ + Agent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Agent) + return object; + var message = new $root.google.cloud.ces.v1.Agent(); + if (object.llmAgent != null) { + if (typeof object.llmAgent !== "object") + throw TypeError(".google.cloud.ces.v1.Agent.llmAgent: object expected"); + message.llmAgent = $root.google.cloud.ces.v1.Agent.LlmAgent.fromObject(object.llmAgent); + } + if (object.remoteDialogflowAgent != null) { + if (typeof object.remoteDialogflowAgent !== "object") + throw TypeError(".google.cloud.ces.v1.Agent.remoteDialogflowAgent: object expected"); + message.remoteDialogflowAgent = $root.google.cloud.ces.v1.Agent.RemoteDialogflowAgent.fromObject(object.remoteDialogflowAgent); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.modelSettings != null) { + if (typeof object.modelSettings !== "object") + throw TypeError(".google.cloud.ces.v1.Agent.modelSettings: object expected"); + message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.fromObject(object.modelSettings); + } + if (object.instruction != null) + message.instruction = String(object.instruction); + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.cloud.ces.v1.Agent.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) + message.tools[i] = String(object.tools[i]); + } + if (object.childAgents) { + if (!Array.isArray(object.childAgents)) + throw TypeError(".google.cloud.ces.v1.Agent.childAgents: array expected"); + message.childAgents = []; + for (var i = 0; i < object.childAgents.length; ++i) + message.childAgents[i] = String(object.childAgents[i]); + } + if (object.beforeAgentCallbacks) { + if (!Array.isArray(object.beforeAgentCallbacks)) + throw TypeError(".google.cloud.ces.v1.Agent.beforeAgentCallbacks: array expected"); + message.beforeAgentCallbacks = []; + for (var i = 0; i < object.beforeAgentCallbacks.length; ++i) { + if (typeof object.beforeAgentCallbacks[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Agent.beforeAgentCallbacks: object expected"); + message.beforeAgentCallbacks[i] = $root.google.cloud.ces.v1.Callback.fromObject(object.beforeAgentCallbacks[i]); + } + } + if (object.afterAgentCallbacks) { + if (!Array.isArray(object.afterAgentCallbacks)) + throw TypeError(".google.cloud.ces.v1.Agent.afterAgentCallbacks: array expected"); + message.afterAgentCallbacks = []; + for (var i = 0; i < object.afterAgentCallbacks.length; ++i) { + if (typeof object.afterAgentCallbacks[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Agent.afterAgentCallbacks: object expected"); + message.afterAgentCallbacks[i] = $root.google.cloud.ces.v1.Callback.fromObject(object.afterAgentCallbacks[i]); + } + } + if (object.beforeModelCallbacks) { + if (!Array.isArray(object.beforeModelCallbacks)) + throw TypeError(".google.cloud.ces.v1.Agent.beforeModelCallbacks: array expected"); + message.beforeModelCallbacks = []; + for (var i = 0; i < object.beforeModelCallbacks.length; ++i) { + if (typeof object.beforeModelCallbacks[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Agent.beforeModelCallbacks: object expected"); + message.beforeModelCallbacks[i] = $root.google.cloud.ces.v1.Callback.fromObject(object.beforeModelCallbacks[i]); + } + } + if (object.afterModelCallbacks) { + if (!Array.isArray(object.afterModelCallbacks)) + throw TypeError(".google.cloud.ces.v1.Agent.afterModelCallbacks: array expected"); + message.afterModelCallbacks = []; + for (var i = 0; i < object.afterModelCallbacks.length; ++i) { + if (typeof object.afterModelCallbacks[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Agent.afterModelCallbacks: object expected"); + message.afterModelCallbacks[i] = $root.google.cloud.ces.v1.Callback.fromObject(object.afterModelCallbacks[i]); + } + } + if (object.beforeToolCallbacks) { + if (!Array.isArray(object.beforeToolCallbacks)) + throw TypeError(".google.cloud.ces.v1.Agent.beforeToolCallbacks: array expected"); + message.beforeToolCallbacks = []; + for (var i = 0; i < object.beforeToolCallbacks.length; ++i) { + if (typeof object.beforeToolCallbacks[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Agent.beforeToolCallbacks: object expected"); + message.beforeToolCallbacks[i] = $root.google.cloud.ces.v1.Callback.fromObject(object.beforeToolCallbacks[i]); + } + } + if (object.afterToolCallbacks) { + if (!Array.isArray(object.afterToolCallbacks)) + throw TypeError(".google.cloud.ces.v1.Agent.afterToolCallbacks: array expected"); + message.afterToolCallbacks = []; + for (var i = 0; i < object.afterToolCallbacks.length; ++i) { + if (typeof object.afterToolCallbacks[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Agent.afterToolCallbacks: object expected"); + message.afterToolCallbacks[i] = $root.google.cloud.ces.v1.Callback.fromObject(object.afterToolCallbacks[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1.Agent.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.ces.v1.Agent.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.guardrails) { + if (!Array.isArray(object.guardrails)) + throw TypeError(".google.cloud.ces.v1.Agent.guardrails: array expected"); + message.guardrails = []; + for (var i = 0; i < object.guardrails.length; ++i) + message.guardrails[i] = String(object.guardrails[i]); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.toolsets) { + if (!Array.isArray(object.toolsets)) + throw TypeError(".google.cloud.ces.v1.Agent.toolsets: array expected"); + message.toolsets = []; + for (var i = 0; i < object.toolsets.length; ++i) { + if (typeof object.toolsets[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Agent.toolsets: object expected"); + message.toolsets[i] = $root.google.cloud.ces.v1.Agent.AgentToolset.fromObject(object.toolsets[i]); + } + } + if (object.generatedSummary != null) + message.generatedSummary = String(object.generatedSummary); + if (object.transferRules) { + if (!Array.isArray(object.transferRules)) + throw TypeError(".google.cloud.ces.v1.Agent.transferRules: array expected"); + message.transferRules = []; + for (var i = 0; i < object.transferRules.length; ++i) { + if (typeof object.transferRules[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Agent.transferRules: object expected"); + message.transferRules[i] = $root.google.cloud.ces.v1.TransferRule.fromObject(object.transferRules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Agent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Agent + * @static + * @param {google.cloud.ces.v1.Agent} message Agent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Agent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tools = []; + object.childAgents = []; + object.guardrails = []; + object.beforeAgentCallbacks = []; + object.afterAgentCallbacks = []; + object.beforeModelCallbacks = []; + object.afterModelCallbacks = []; + object.beforeToolCallbacks = []; + object.afterToolCallbacks = []; + object.toolsets = []; + object.transferRules = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.modelSettings = null; + object.instruction = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.generatedSummary = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) + object.modelSettings = $root.google.cloud.ces.v1.ModelSettings.toObject(message.modelSettings, options); + if (message.instruction != null && message.hasOwnProperty("instruction")) + object.instruction = message.instruction; + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = message.tools[j]; + } + if (message.childAgents && message.childAgents.length) { + object.childAgents = []; + for (var j = 0; j < message.childAgents.length; ++j) + object.childAgents[j] = message.childAgents[j]; + } + 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.guardrails && message.guardrails.length) { + object.guardrails = []; + for (var j = 0; j < message.guardrails.length; ++j) + object.guardrails[j] = message.guardrails[j]; + } + if (message.beforeAgentCallbacks && message.beforeAgentCallbacks.length) { + object.beforeAgentCallbacks = []; + for (var j = 0; j < message.beforeAgentCallbacks.length; ++j) + object.beforeAgentCallbacks[j] = $root.google.cloud.ces.v1.Callback.toObject(message.beforeAgentCallbacks[j], options); + } + if (message.afterAgentCallbacks && message.afterAgentCallbacks.length) { + object.afterAgentCallbacks = []; + for (var j = 0; j < message.afterAgentCallbacks.length; ++j) + object.afterAgentCallbacks[j] = $root.google.cloud.ces.v1.Callback.toObject(message.afterAgentCallbacks[j], options); + } + if (message.beforeModelCallbacks && message.beforeModelCallbacks.length) { + object.beforeModelCallbacks = []; + for (var j = 0; j < message.beforeModelCallbacks.length; ++j) + object.beforeModelCallbacks[j] = $root.google.cloud.ces.v1.Callback.toObject(message.beforeModelCallbacks[j], options); + } + if (message.afterModelCallbacks && message.afterModelCallbacks.length) { + object.afterModelCallbacks = []; + for (var j = 0; j < message.afterModelCallbacks.length; ++j) + object.afterModelCallbacks[j] = $root.google.cloud.ces.v1.Callback.toObject(message.afterModelCallbacks[j], options); + } + if (message.beforeToolCallbacks && message.beforeToolCallbacks.length) { + object.beforeToolCallbacks = []; + for (var j = 0; j < message.beforeToolCallbacks.length; ++j) + object.beforeToolCallbacks[j] = $root.google.cloud.ces.v1.Callback.toObject(message.beforeToolCallbacks[j], options); + } + if (message.afterToolCallbacks && message.afterToolCallbacks.length) { + object.afterToolCallbacks = []; + for (var j = 0; j < message.afterToolCallbacks.length; ++j) + object.afterToolCallbacks[j] = $root.google.cloud.ces.v1.Callback.toObject(message.afterToolCallbacks[j], options); + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.llmAgent != null && message.hasOwnProperty("llmAgent")) { + object.llmAgent = $root.google.cloud.ces.v1.Agent.LlmAgent.toObject(message.llmAgent, options); + if (options.oneofs) + object.agentType = "llmAgent"; + } + if (message.remoteDialogflowAgent != null && message.hasOwnProperty("remoteDialogflowAgent")) { + object.remoteDialogflowAgent = $root.google.cloud.ces.v1.Agent.RemoteDialogflowAgent.toObject(message.remoteDialogflowAgent, options); + if (options.oneofs) + object.agentType = "remoteDialogflowAgent"; + } + if (message.toolsets && message.toolsets.length) { + object.toolsets = []; + for (var j = 0; j < message.toolsets.length; ++j) + object.toolsets[j] = $root.google.cloud.ces.v1.Agent.AgentToolset.toObject(message.toolsets[j], options); + } + if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) + object.generatedSummary = message.generatedSummary; + if (message.transferRules && message.transferRules.length) { + object.transferRules = []; + for (var j = 0; j < message.transferRules.length; ++j) + object.transferRules[j] = $root.google.cloud.ces.v1.TransferRule.toObject(message.transferRules[j], options); + } + return object; + }; + + /** + * Converts this Agent to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Agent + * @instance + * @returns {Object.} JSON object + */ + Agent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Agent + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Agent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Agent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Agent"; + }; + + Agent.LlmAgent = (function() { + + /** + * Properties of a LlmAgent. + * @memberof google.cloud.ces.v1.Agent + * @interface ILlmAgent + */ + + /** + * Constructs a new LlmAgent. + * @memberof google.cloud.ces.v1.Agent + * @classdesc Represents a LlmAgent. + * @implements ILlmAgent + * @constructor + * @param {google.cloud.ces.v1.Agent.ILlmAgent=} [properties] Properties to set + */ + function LlmAgent(properties) { + if (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 LlmAgent instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Agent.LlmAgent + * @static + * @param {google.cloud.ces.v1.Agent.ILlmAgent=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Agent.LlmAgent} LlmAgent instance + */ + LlmAgent.create = function create(properties) { + return new LlmAgent(properties); + }; + + /** + * Encodes the specified LlmAgent message. Does not implicitly {@link google.cloud.ces.v1.Agent.LlmAgent.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Agent.LlmAgent + * @static + * @param {google.cloud.ces.v1.Agent.ILlmAgent} message LlmAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmAgent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified LlmAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Agent.LlmAgent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Agent.LlmAgent + * @static + * @param {google.cloud.ces.v1.Agent.ILlmAgent} message LlmAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmAgent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LlmAgent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Agent.LlmAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Agent.LlmAgent} LlmAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmAgent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Agent.LlmAgent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LlmAgent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Agent.LlmAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Agent.LlmAgent} LlmAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmAgent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LlmAgent message. + * @function verify + * @memberof google.cloud.ces.v1.Agent.LlmAgent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LlmAgent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a LlmAgent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Agent.LlmAgent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Agent.LlmAgent} LlmAgent + */ + LlmAgent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Agent.LlmAgent) + return object; + return new $root.google.cloud.ces.v1.Agent.LlmAgent(); + }; + + /** + * Creates a plain object from a LlmAgent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Agent.LlmAgent + * @static + * @param {google.cloud.ces.v1.Agent.LlmAgent} message LlmAgent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LlmAgent.toObject = function toObject() { + return {}; + }; + + /** + * Converts this LlmAgent to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Agent.LlmAgent + * @instance + * @returns {Object.} JSON object + */ + LlmAgent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LlmAgent + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Agent.LlmAgent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LlmAgent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Agent.LlmAgent"; + }; + + return LlmAgent; + })(); + + Agent.RemoteDialogflowAgent = (function() { + + /** + * Properties of a RemoteDialogflowAgent. + * @memberof google.cloud.ces.v1.Agent + * @interface IRemoteDialogflowAgent + * @property {string|null} [agent] RemoteDialogflowAgent agent + * @property {string|null} [flowId] RemoteDialogflowAgent flowId + * @property {string|null} [environmentId] RemoteDialogflowAgent environmentId + * @property {Object.|null} [inputVariableMapping] RemoteDialogflowAgent inputVariableMapping + * @property {Object.|null} [outputVariableMapping] RemoteDialogflowAgent outputVariableMapping + * @property {boolean|null} [respectResponseInterruptionSettings] RemoteDialogflowAgent respectResponseInterruptionSettings + */ + + /** + * Constructs a new RemoteDialogflowAgent. + * @memberof google.cloud.ces.v1.Agent + * @classdesc Represents a RemoteDialogflowAgent. + * @implements IRemoteDialogflowAgent + * @constructor + * @param {google.cloud.ces.v1.Agent.IRemoteDialogflowAgent=} [properties] Properties to set + */ + function RemoteDialogflowAgent(properties) { + this.inputVariableMapping = {}; + this.outputVariableMapping = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoteDialogflowAgent agent. + * @member {string} agent + * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent + * @instance + */ + RemoteDialogflowAgent.prototype.agent = ""; + + /** + * RemoteDialogflowAgent flowId. + * @member {string} flowId + * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent + * @instance + */ + RemoteDialogflowAgent.prototype.flowId = ""; + + /** + * RemoteDialogflowAgent environmentId. + * @member {string} environmentId + * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent + * @instance + */ + RemoteDialogflowAgent.prototype.environmentId = ""; + + /** + * RemoteDialogflowAgent inputVariableMapping. + * @member {Object.} inputVariableMapping + * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent + * @instance + */ + RemoteDialogflowAgent.prototype.inputVariableMapping = $util.emptyObject; + + /** + * RemoteDialogflowAgent outputVariableMapping. + * @member {Object.} outputVariableMapping + * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent + * @instance + */ + RemoteDialogflowAgent.prototype.outputVariableMapping = $util.emptyObject; + + /** + * RemoteDialogflowAgent respectResponseInterruptionSettings. + * @member {boolean} respectResponseInterruptionSettings + * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent + * @instance + */ + RemoteDialogflowAgent.prototype.respectResponseInterruptionSettings = false; + + /** + * Creates a new RemoteDialogflowAgent instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent + * @static + * @param {google.cloud.ces.v1.Agent.IRemoteDialogflowAgent=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent instance + */ + RemoteDialogflowAgent.create = function create(properties) { + return new RemoteDialogflowAgent(properties); + }; + + /** + * Encodes the specified RemoteDialogflowAgent message. Does not implicitly {@link google.cloud.ces.v1.Agent.RemoteDialogflowAgent.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent + * @static + * @param {google.cloud.ces.v1.Agent.IRemoteDialogflowAgent} message RemoteDialogflowAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoteDialogflowAgent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.agent); + if (message.flowId != null && Object.hasOwnProperty.call(message, "flowId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flowId); + if (message.environmentId != null && Object.hasOwnProperty.call(message, "environmentId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.environmentId); + if (message.inputVariableMapping != null && Object.hasOwnProperty.call(message, "inputVariableMapping")) + for (var keys = Object.keys(message.inputVariableMapping), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.inputVariableMapping[keys[i]]).ldelim(); + if (message.outputVariableMapping != null && Object.hasOwnProperty.call(message, "outputVariableMapping")) + for (var keys = Object.keys(message.outputVariableMapping), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.outputVariableMapping[keys[i]]).ldelim(); + if (message.respectResponseInterruptionSettings != null && Object.hasOwnProperty.call(message, "respectResponseInterruptionSettings")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.respectResponseInterruptionSettings); + return writer; + }; + + /** + * Encodes the specified RemoteDialogflowAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Agent.RemoteDialogflowAgent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent + * @static + * @param {google.cloud.ces.v1.Agent.IRemoteDialogflowAgent} message RemoteDialogflowAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoteDialogflowAgent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoteDialogflowAgent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoteDialogflowAgent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Agent.RemoteDialogflowAgent(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.agent = reader.string(); + break; + } + case 2: { + message.flowId = reader.string(); + break; + } + case 3: { + message.environmentId = reader.string(); + break; + } + case 4: { + if (message.inputVariableMapping === $util.emptyObject) + message.inputVariableMapping = {}; + 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.inputVariableMapping[key] = value; + break; + } + case 5: { + if (message.outputVariableMapping === $util.emptyObject) + message.outputVariableMapping = {}; + 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.outputVariableMapping[key] = value; + break; + } + case 6: { + message.respectResponseInterruptionSettings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoteDialogflowAgent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoteDialogflowAgent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoteDialogflowAgent message. + * @function verify + * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoteDialogflowAgent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agent != null && message.hasOwnProperty("agent")) + if (!$util.isString(message.agent)) + return "agent: string expected"; + if (message.flowId != null && message.hasOwnProperty("flowId")) + if (!$util.isString(message.flowId)) + return "flowId: string expected"; + if (message.environmentId != null && message.hasOwnProperty("environmentId")) + if (!$util.isString(message.environmentId)) + return "environmentId: string expected"; + if (message.inputVariableMapping != null && message.hasOwnProperty("inputVariableMapping")) { + if (!$util.isObject(message.inputVariableMapping)) + return "inputVariableMapping: object expected"; + var key = Object.keys(message.inputVariableMapping); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.inputVariableMapping[key[i]])) + return "inputVariableMapping: string{k:string} expected"; + } + if (message.outputVariableMapping != null && message.hasOwnProperty("outputVariableMapping")) { + if (!$util.isObject(message.outputVariableMapping)) + return "outputVariableMapping: object expected"; + var key = Object.keys(message.outputVariableMapping); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.outputVariableMapping[key[i]])) + return "outputVariableMapping: string{k:string} expected"; + } + if (message.respectResponseInterruptionSettings != null && message.hasOwnProperty("respectResponseInterruptionSettings")) + if (typeof message.respectResponseInterruptionSettings !== "boolean") + return "respectResponseInterruptionSettings: boolean expected"; + return null; + }; + + /** + * Creates a RemoteDialogflowAgent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent + */ + RemoteDialogflowAgent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Agent.RemoteDialogflowAgent) + return object; + var message = new $root.google.cloud.ces.v1.Agent.RemoteDialogflowAgent(); + if (object.agent != null) + message.agent = String(object.agent); + if (object.flowId != null) + message.flowId = String(object.flowId); + if (object.environmentId != null) + message.environmentId = String(object.environmentId); + if (object.inputVariableMapping) { + if (typeof object.inputVariableMapping !== "object") + throw TypeError(".google.cloud.ces.v1.Agent.RemoteDialogflowAgent.inputVariableMapping: object expected"); + message.inputVariableMapping = {}; + for (var keys = Object.keys(object.inputVariableMapping), i = 0; i < keys.length; ++i) + message.inputVariableMapping[keys[i]] = String(object.inputVariableMapping[keys[i]]); + } + if (object.outputVariableMapping) { + if (typeof object.outputVariableMapping !== "object") + throw TypeError(".google.cloud.ces.v1.Agent.RemoteDialogflowAgent.outputVariableMapping: object expected"); + message.outputVariableMapping = {}; + for (var keys = Object.keys(object.outputVariableMapping), i = 0; i < keys.length; ++i) + message.outputVariableMapping[keys[i]] = String(object.outputVariableMapping[keys[i]]); + } + if (object.respectResponseInterruptionSettings != null) + message.respectResponseInterruptionSettings = Boolean(object.respectResponseInterruptionSettings); + return message; + }; + + /** + * Creates a plain object from a RemoteDialogflowAgent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent + * @static + * @param {google.cloud.ces.v1.Agent.RemoteDialogflowAgent} message RemoteDialogflowAgent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoteDialogflowAgent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.inputVariableMapping = {}; + object.outputVariableMapping = {}; + } + if (options.defaults) { + object.agent = ""; + object.flowId = ""; + object.environmentId = ""; + object.respectResponseInterruptionSettings = false; + } + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = message.agent; + if (message.flowId != null && message.hasOwnProperty("flowId")) + object.flowId = message.flowId; + if (message.environmentId != null && message.hasOwnProperty("environmentId")) + object.environmentId = message.environmentId; + var keys2; + if (message.inputVariableMapping && (keys2 = Object.keys(message.inputVariableMapping)).length) { + object.inputVariableMapping = {}; + for (var j = 0; j < keys2.length; ++j) + object.inputVariableMapping[keys2[j]] = message.inputVariableMapping[keys2[j]]; + } + if (message.outputVariableMapping && (keys2 = Object.keys(message.outputVariableMapping)).length) { + object.outputVariableMapping = {}; + for (var j = 0; j < keys2.length; ++j) + object.outputVariableMapping[keys2[j]] = message.outputVariableMapping[keys2[j]]; + } + if (message.respectResponseInterruptionSettings != null && message.hasOwnProperty("respectResponseInterruptionSettings")) + object.respectResponseInterruptionSettings = message.respectResponseInterruptionSettings; + return object; + }; + + /** + * Converts this RemoteDialogflowAgent to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent + * @instance + * @returns {Object.} JSON object + */ + RemoteDialogflowAgent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemoteDialogflowAgent + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoteDialogflowAgent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Agent.RemoteDialogflowAgent"; + }; + + return RemoteDialogflowAgent; + })(); + + Agent.AgentToolset = (function() { + + /** + * Properties of an AgentToolset. + * @memberof google.cloud.ces.v1.Agent + * @interface IAgentToolset + * @property {string|null} [toolset] AgentToolset toolset + * @property {Array.|null} [toolIds] AgentToolset toolIds + */ + + /** + * Constructs a new AgentToolset. + * @memberof google.cloud.ces.v1.Agent + * @classdesc Represents an AgentToolset. + * @implements IAgentToolset + * @constructor + * @param {google.cloud.ces.v1.Agent.IAgentToolset=} [properties] Properties to set + */ + function AgentToolset(properties) { + this.toolIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AgentToolset toolset. + * @member {string} toolset + * @memberof google.cloud.ces.v1.Agent.AgentToolset + * @instance + */ + AgentToolset.prototype.toolset = ""; + + /** + * AgentToolset toolIds. + * @member {Array.} toolIds + * @memberof google.cloud.ces.v1.Agent.AgentToolset + * @instance + */ + AgentToolset.prototype.toolIds = $util.emptyArray; + + /** + * Creates a new AgentToolset instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Agent.AgentToolset + * @static + * @param {google.cloud.ces.v1.Agent.IAgentToolset=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Agent.AgentToolset} AgentToolset instance + */ + AgentToolset.create = function create(properties) { + return new AgentToolset(properties); + }; + + /** + * Encodes the specified AgentToolset message. Does not implicitly {@link google.cloud.ces.v1.Agent.AgentToolset.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Agent.AgentToolset + * @static + * @param {google.cloud.ces.v1.Agent.IAgentToolset} message AgentToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentToolset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.toolset); + if (message.toolIds != null && message.toolIds.length) + for (var i = 0; i < message.toolIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.toolIds[i]); + return writer; + }; + + /** + * Encodes the specified AgentToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Agent.AgentToolset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Agent.AgentToolset + * @static + * @param {google.cloud.ces.v1.Agent.IAgentToolset} message AgentToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentToolset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AgentToolset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Agent.AgentToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Agent.AgentToolset} AgentToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentToolset.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Agent.AgentToolset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolset = reader.string(); + break; + } + case 4: { + if (!(message.toolIds && message.toolIds.length)) + message.toolIds = []; + message.toolIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AgentToolset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Agent.AgentToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Agent.AgentToolset} AgentToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentToolset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AgentToolset message. + * @function verify + * @memberof google.cloud.ces.v1.Agent.AgentToolset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AgentToolset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolset != null && message.hasOwnProperty("toolset")) + if (!$util.isString(message.toolset)) + return "toolset: string expected"; + if (message.toolIds != null && message.hasOwnProperty("toolIds")) { + if (!Array.isArray(message.toolIds)) + return "toolIds: array expected"; + for (var i = 0; i < message.toolIds.length; ++i) + if (!$util.isString(message.toolIds[i])) + return "toolIds: string[] expected"; + } + return null; + }; + + /** + * Creates an AgentToolset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Agent.AgentToolset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Agent.AgentToolset} AgentToolset + */ + AgentToolset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Agent.AgentToolset) + return object; + var message = new $root.google.cloud.ces.v1.Agent.AgentToolset(); + if (object.toolset != null) + message.toolset = String(object.toolset); + if (object.toolIds) { + if (!Array.isArray(object.toolIds)) + throw TypeError(".google.cloud.ces.v1.Agent.AgentToolset.toolIds: array expected"); + message.toolIds = []; + for (var i = 0; i < object.toolIds.length; ++i) + message.toolIds[i] = String(object.toolIds[i]); + } + return message; + }; + + /** + * Creates a plain object from an AgentToolset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Agent.AgentToolset + * @static + * @param {google.cloud.ces.v1.Agent.AgentToolset} message AgentToolset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AgentToolset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.toolIds = []; + if (options.defaults) + object.toolset = ""; + if (message.toolset != null && message.hasOwnProperty("toolset")) + object.toolset = message.toolset; + if (message.toolIds && message.toolIds.length) { + object.toolIds = []; + for (var j = 0; j < message.toolIds.length; ++j) + object.toolIds[j] = message.toolIds[j]; + } + return object; + }; + + /** + * Converts this AgentToolset to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Agent.AgentToolset + * @instance + * @returns {Object.} JSON object + */ + AgentToolset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AgentToolset + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Agent.AgentToolset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AgentToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Agent.AgentToolset"; + }; + + return AgentToolset; + })(); + + return Agent; + })(); + + v1.ExpressionCondition = (function() { + + /** + * Properties of an ExpressionCondition. + * @memberof google.cloud.ces.v1 + * @interface IExpressionCondition + * @property {string|null} [expression] ExpressionCondition expression + */ + + /** + * Constructs a new ExpressionCondition. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an ExpressionCondition. + * @implements IExpressionCondition + * @constructor + * @param {google.cloud.ces.v1.IExpressionCondition=} [properties] Properties to set + */ + function ExpressionCondition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExpressionCondition expression. + * @member {string} expression + * @memberof google.cloud.ces.v1.ExpressionCondition + * @instance + */ + ExpressionCondition.prototype.expression = ""; + + /** + * Creates a new ExpressionCondition instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ExpressionCondition + * @static + * @param {google.cloud.ces.v1.IExpressionCondition=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ExpressionCondition} ExpressionCondition instance + */ + ExpressionCondition.create = function create(properties) { + return new ExpressionCondition(properties); + }; + + /** + * Encodes the specified ExpressionCondition message. Does not implicitly {@link google.cloud.ces.v1.ExpressionCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ExpressionCondition + * @static + * @param {google.cloud.ces.v1.IExpressionCondition} message ExpressionCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpressionCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + return writer; + }; + + /** + * Encodes the specified ExpressionCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExpressionCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ExpressionCondition + * @static + * @param {google.cloud.ces.v1.IExpressionCondition} message ExpressionCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpressionCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExpressionCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ExpressionCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ExpressionCondition} ExpressionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpressionCondition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ExpressionCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExpressionCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ExpressionCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ExpressionCondition} ExpressionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpressionCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExpressionCondition message. + * @function verify + * @memberof google.cloud.ces.v1.ExpressionCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExpressionCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + return null; + }; + + /** + * Creates an ExpressionCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ExpressionCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ExpressionCondition} ExpressionCondition + */ + ExpressionCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ExpressionCondition) + return object; + var message = new $root.google.cloud.ces.v1.ExpressionCondition(); + if (object.expression != null) + message.expression = String(object.expression); + return message; + }; + + /** + * Creates a plain object from an ExpressionCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ExpressionCondition + * @static + * @param {google.cloud.ces.v1.ExpressionCondition} message ExpressionCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExpressionCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.expression = ""; + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + return object; + }; + + /** + * Converts this ExpressionCondition to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ExpressionCondition + * @instance + * @returns {Object.} JSON object + */ + ExpressionCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExpressionCondition + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ExpressionCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExpressionCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ExpressionCondition"; + }; + + return ExpressionCondition; + })(); + + v1.PythonCodeCondition = (function() { + + /** + * Properties of a PythonCodeCondition. + * @memberof google.cloud.ces.v1 + * @interface IPythonCodeCondition + * @property {string|null} [pythonCode] PythonCodeCondition pythonCode + */ + + /** + * Constructs a new PythonCodeCondition. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a PythonCodeCondition. + * @implements IPythonCodeCondition + * @constructor + * @param {google.cloud.ces.v1.IPythonCodeCondition=} [properties] Properties to set + */ + function PythonCodeCondition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonCodeCondition pythonCode. + * @member {string} pythonCode + * @memberof google.cloud.ces.v1.PythonCodeCondition + * @instance + */ + PythonCodeCondition.prototype.pythonCode = ""; + + /** + * Creates a new PythonCodeCondition instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.PythonCodeCondition + * @static + * @param {google.cloud.ces.v1.IPythonCodeCondition=} [properties] Properties to set + * @returns {google.cloud.ces.v1.PythonCodeCondition} PythonCodeCondition instance + */ + PythonCodeCondition.create = function create(properties) { + return new PythonCodeCondition(properties); + }; + + /** + * Encodes the specified PythonCodeCondition message. Does not implicitly {@link google.cloud.ces.v1.PythonCodeCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.PythonCodeCondition + * @static + * @param {google.cloud.ces.v1.IPythonCodeCondition} message PythonCodeCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonCodeCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pythonCode); + return writer; + }; + + /** + * Encodes the specified PythonCodeCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1.PythonCodeCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.PythonCodeCondition + * @static + * @param {google.cloud.ces.v1.IPythonCodeCondition} message PythonCodeCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonCodeCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonCodeCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.PythonCodeCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.PythonCodeCondition} PythonCodeCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonCodeCondition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.PythonCodeCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pythonCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonCodeCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.PythonCodeCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.PythonCodeCondition} PythonCodeCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonCodeCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonCodeCondition message. + * @function verify + * @memberof google.cloud.ces.v1.PythonCodeCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonCodeCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) + if (!$util.isString(message.pythonCode)) + return "pythonCode: string expected"; + return null; + }; + + /** + * Creates a PythonCodeCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.PythonCodeCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.PythonCodeCondition} PythonCodeCondition + */ + PythonCodeCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.PythonCodeCondition) + return object; + var message = new $root.google.cloud.ces.v1.PythonCodeCondition(); + if (object.pythonCode != null) + message.pythonCode = String(object.pythonCode); + return message; + }; + + /** + * Creates a plain object from a PythonCodeCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.PythonCodeCondition + * @static + * @param {google.cloud.ces.v1.PythonCodeCondition} message PythonCodeCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonCodeCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.pythonCode = ""; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) + object.pythonCode = message.pythonCode; + return object; + }; + + /** + * Converts this PythonCodeCondition to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.PythonCodeCondition + * @instance + * @returns {Object.} JSON object + */ + PythonCodeCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonCodeCondition + * @function getTypeUrl + * @memberof google.cloud.ces.v1.PythonCodeCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonCodeCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.PythonCodeCondition"; + }; + + return PythonCodeCondition; + })(); + + v1.TransferRule = (function() { + + /** + * Properties of a TransferRule. + * @memberof google.cloud.ces.v1 + * @interface ITransferRule + * @property {google.cloud.ces.v1.TransferRule.IDeterministicTransfer|null} [deterministicTransfer] TransferRule deterministicTransfer + * @property {google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer|null} [disablePlannerTransfer] TransferRule disablePlannerTransfer + * @property {string|null} [childAgent] TransferRule childAgent + * @property {google.cloud.ces.v1.TransferRule.Direction|null} [direction] TransferRule direction + */ + + /** + * Constructs a new TransferRule. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a TransferRule. + * @implements ITransferRule + * @constructor + * @param {google.cloud.ces.v1.ITransferRule=} [properties] Properties to set + */ + function TransferRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferRule deterministicTransfer. + * @member {google.cloud.ces.v1.TransferRule.IDeterministicTransfer|null|undefined} deterministicTransfer + * @memberof google.cloud.ces.v1.TransferRule + * @instance + */ + TransferRule.prototype.deterministicTransfer = null; + + /** + * TransferRule disablePlannerTransfer. + * @member {google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer|null|undefined} disablePlannerTransfer + * @memberof google.cloud.ces.v1.TransferRule + * @instance + */ + TransferRule.prototype.disablePlannerTransfer = null; + + /** + * TransferRule childAgent. + * @member {string} childAgent + * @memberof google.cloud.ces.v1.TransferRule + * @instance + */ + TransferRule.prototype.childAgent = ""; + + /** + * TransferRule direction. + * @member {google.cloud.ces.v1.TransferRule.Direction} direction + * @memberof google.cloud.ces.v1.TransferRule + * @instance + */ + TransferRule.prototype.direction = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransferRule ruleType. + * @member {"deterministicTransfer"|"disablePlannerTransfer"|undefined} ruleType + * @memberof google.cloud.ces.v1.TransferRule + * @instance + */ + Object.defineProperty(TransferRule.prototype, "ruleType", { + get: $util.oneOfGetter($oneOfFields = ["deterministicTransfer", "disablePlannerTransfer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransferRule instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.TransferRule + * @static + * @param {google.cloud.ces.v1.ITransferRule=} [properties] Properties to set + * @returns {google.cloud.ces.v1.TransferRule} TransferRule instance + */ + TransferRule.create = function create(properties) { + return new TransferRule(properties); + }; + + /** + * Encodes the specified TransferRule message. Does not implicitly {@link google.cloud.ces.v1.TransferRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.TransferRule + * @static + * @param {google.cloud.ces.v1.ITransferRule} message TransferRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.childAgent != null && Object.hasOwnProperty.call(message, "childAgent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.childAgent); + if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.direction); + if (message.deterministicTransfer != null && Object.hasOwnProperty.call(message, "deterministicTransfer")) + $root.google.cloud.ces.v1.TransferRule.DeterministicTransfer.encode(message.deterministicTransfer, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.disablePlannerTransfer != null && Object.hasOwnProperty.call(message, "disablePlannerTransfer")) + $root.google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.encode(message.disablePlannerTransfer, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransferRule message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TransferRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.TransferRule + * @static + * @param {google.cloud.ces.v1.ITransferRule} message TransferRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.TransferRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.TransferRule} TransferRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TransferRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.deterministicTransfer = $root.google.cloud.ces.v1.TransferRule.DeterministicTransfer.decode(reader, reader.uint32()); + break; + } + case 4: { + message.disablePlannerTransfer = $root.google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.decode(reader, reader.uint32()); + break; + } + case 1: { + message.childAgent = reader.string(); + break; + } + case 2: { + message.direction = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.TransferRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.TransferRule} TransferRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferRule message. + * @function verify + * @memberof google.cloud.ces.v1.TransferRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.deterministicTransfer != null && message.hasOwnProperty("deterministicTransfer")) { + properties.ruleType = 1; + { + var error = $root.google.cloud.ces.v1.TransferRule.DeterministicTransfer.verify(message.deterministicTransfer); + if (error) + return "deterministicTransfer." + error; + } + } + if (message.disablePlannerTransfer != null && message.hasOwnProperty("disablePlannerTransfer")) { + if (properties.ruleType === 1) + return "ruleType: multiple values"; + properties.ruleType = 1; + { + var error = $root.google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.verify(message.disablePlannerTransfer); + if (error) + return "disablePlannerTransfer." + error; + } + } + if (message.childAgent != null && message.hasOwnProperty("childAgent")) + if (!$util.isString(message.childAgent)) + return "childAgent: string expected"; + if (message.direction != null && message.hasOwnProperty("direction")) + switch (message.direction) { + default: + return "direction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TransferRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.TransferRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.TransferRule} TransferRule + */ + TransferRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.TransferRule) + return object; + var message = new $root.google.cloud.ces.v1.TransferRule(); + if (object.deterministicTransfer != null) { + if (typeof object.deterministicTransfer !== "object") + throw TypeError(".google.cloud.ces.v1.TransferRule.deterministicTransfer: object expected"); + message.deterministicTransfer = $root.google.cloud.ces.v1.TransferRule.DeterministicTransfer.fromObject(object.deterministicTransfer); + } + if (object.disablePlannerTransfer != null) { + if (typeof object.disablePlannerTransfer !== "object") + throw TypeError(".google.cloud.ces.v1.TransferRule.disablePlannerTransfer: object expected"); + message.disablePlannerTransfer = $root.google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.fromObject(object.disablePlannerTransfer); + } + if (object.childAgent != null) + message.childAgent = String(object.childAgent); + switch (object.direction) { + default: + if (typeof object.direction === "number") { + message.direction = object.direction; + break; + } + break; + case "DIRECTION_UNSPECIFIED": + case 0: + message.direction = 0; + break; + case "PARENT_TO_CHILD": + case 1: + message.direction = 1; + break; + case "CHILD_TO_PARENT": + case 2: + message.direction = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TransferRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.TransferRule + * @static + * @param {google.cloud.ces.v1.TransferRule} message TransferRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.childAgent = ""; + object.direction = options.enums === String ? "DIRECTION_UNSPECIFIED" : 0; + } + if (message.childAgent != null && message.hasOwnProperty("childAgent")) + object.childAgent = message.childAgent; + if (message.direction != null && message.hasOwnProperty("direction")) + object.direction = options.enums === String ? $root.google.cloud.ces.v1.TransferRule.Direction[message.direction] === undefined ? message.direction : $root.google.cloud.ces.v1.TransferRule.Direction[message.direction] : message.direction; + if (message.deterministicTransfer != null && message.hasOwnProperty("deterministicTransfer")) { + object.deterministicTransfer = $root.google.cloud.ces.v1.TransferRule.DeterministicTransfer.toObject(message.deterministicTransfer, options); + if (options.oneofs) + object.ruleType = "deterministicTransfer"; + } + if (message.disablePlannerTransfer != null && message.hasOwnProperty("disablePlannerTransfer")) { + object.disablePlannerTransfer = $root.google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.toObject(message.disablePlannerTransfer, options); + if (options.oneofs) + object.ruleType = "disablePlannerTransfer"; + } + return object; + }; + + /** + * Converts this TransferRule to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.TransferRule + * @instance + * @returns {Object.} JSON object + */ + TransferRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferRule + * @function getTypeUrl + * @memberof google.cloud.ces.v1.TransferRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.TransferRule"; + }; + + TransferRule.DeterministicTransfer = (function() { + + /** + * Properties of a DeterministicTransfer. + * @memberof google.cloud.ces.v1.TransferRule + * @interface IDeterministicTransfer + * @property {google.cloud.ces.v1.IExpressionCondition|null} [expressionCondition] DeterministicTransfer expressionCondition + * @property {google.cloud.ces.v1.IPythonCodeCondition|null} [pythonCodeCondition] DeterministicTransfer pythonCodeCondition + */ + + /** + * Constructs a new DeterministicTransfer. + * @memberof google.cloud.ces.v1.TransferRule + * @classdesc Represents a DeterministicTransfer. + * @implements IDeterministicTransfer + * @constructor + * @param {google.cloud.ces.v1.TransferRule.IDeterministicTransfer=} [properties] Properties to set + */ + function DeterministicTransfer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeterministicTransfer expressionCondition. + * @member {google.cloud.ces.v1.IExpressionCondition|null|undefined} expressionCondition + * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer + * @instance + */ + DeterministicTransfer.prototype.expressionCondition = null; + + /** + * DeterministicTransfer pythonCodeCondition. + * @member {google.cloud.ces.v1.IPythonCodeCondition|null|undefined} pythonCodeCondition + * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer + * @instance + */ + DeterministicTransfer.prototype.pythonCodeCondition = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeterministicTransfer conditionType. + * @member {"expressionCondition"|"pythonCodeCondition"|undefined} conditionType + * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer + * @instance + */ + Object.defineProperty(DeterministicTransfer.prototype, "conditionType", { + get: $util.oneOfGetter($oneOfFields = ["expressionCondition", "pythonCodeCondition"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeterministicTransfer instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer + * @static + * @param {google.cloud.ces.v1.TransferRule.IDeterministicTransfer=} [properties] Properties to set + * @returns {google.cloud.ces.v1.TransferRule.DeterministicTransfer} DeterministicTransfer instance + */ + DeterministicTransfer.create = function create(properties) { + return new DeterministicTransfer(properties); + }; + + /** + * Encodes the specified DeterministicTransfer message. Does not implicitly {@link google.cloud.ces.v1.TransferRule.DeterministicTransfer.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer + * @static + * @param {google.cloud.ces.v1.TransferRule.IDeterministicTransfer} message DeterministicTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeterministicTransfer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expressionCondition != null && Object.hasOwnProperty.call(message, "expressionCondition")) + $root.google.cloud.ces.v1.ExpressionCondition.encode(message.expressionCondition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pythonCodeCondition != null && Object.hasOwnProperty.call(message, "pythonCodeCondition")) + $root.google.cloud.ces.v1.PythonCodeCondition.encode(message.pythonCodeCondition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeterministicTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TransferRule.DeterministicTransfer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer + * @static + * @param {google.cloud.ces.v1.TransferRule.IDeterministicTransfer} message DeterministicTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeterministicTransfer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeterministicTransfer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.TransferRule.DeterministicTransfer} DeterministicTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeterministicTransfer.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TransferRule.DeterministicTransfer(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expressionCondition = $root.google.cloud.ces.v1.ExpressionCondition.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pythonCodeCondition = $root.google.cloud.ces.v1.PythonCodeCondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeterministicTransfer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.TransferRule.DeterministicTransfer} DeterministicTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeterministicTransfer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeterministicTransfer message. + * @function verify + * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeterministicTransfer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) { + properties.conditionType = 1; + { + var error = $root.google.cloud.ces.v1.ExpressionCondition.verify(message.expressionCondition); + if (error) + return "expressionCondition." + error; + } + } + if (message.pythonCodeCondition != null && message.hasOwnProperty("pythonCodeCondition")) { + if (properties.conditionType === 1) + return "conditionType: multiple values"; + properties.conditionType = 1; + { + var error = $root.google.cloud.ces.v1.PythonCodeCondition.verify(message.pythonCodeCondition); + if (error) + return "pythonCodeCondition." + error; + } + } + return null; + }; + + /** + * Creates a DeterministicTransfer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.TransferRule.DeterministicTransfer} DeterministicTransfer + */ + DeterministicTransfer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.TransferRule.DeterministicTransfer) + return object; + var message = new $root.google.cloud.ces.v1.TransferRule.DeterministicTransfer(); + if (object.expressionCondition != null) { + if (typeof object.expressionCondition !== "object") + throw TypeError(".google.cloud.ces.v1.TransferRule.DeterministicTransfer.expressionCondition: object expected"); + message.expressionCondition = $root.google.cloud.ces.v1.ExpressionCondition.fromObject(object.expressionCondition); + } + if (object.pythonCodeCondition != null) { + if (typeof object.pythonCodeCondition !== "object") + throw TypeError(".google.cloud.ces.v1.TransferRule.DeterministicTransfer.pythonCodeCondition: object expected"); + message.pythonCodeCondition = $root.google.cloud.ces.v1.PythonCodeCondition.fromObject(object.pythonCodeCondition); + } + return message; + }; + + /** + * Creates a plain object from a DeterministicTransfer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer + * @static + * @param {google.cloud.ces.v1.TransferRule.DeterministicTransfer} message DeterministicTransfer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeterministicTransfer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) { + object.expressionCondition = $root.google.cloud.ces.v1.ExpressionCondition.toObject(message.expressionCondition, options); + if (options.oneofs) + object.conditionType = "expressionCondition"; + } + if (message.pythonCodeCondition != null && message.hasOwnProperty("pythonCodeCondition")) { + object.pythonCodeCondition = $root.google.cloud.ces.v1.PythonCodeCondition.toObject(message.pythonCodeCondition, options); + if (options.oneofs) + object.conditionType = "pythonCodeCondition"; + } + return object; + }; + + /** + * Converts this DeterministicTransfer to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer + * @instance + * @returns {Object.} JSON object + */ + DeterministicTransfer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeterministicTransfer + * @function getTypeUrl + * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeterministicTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.TransferRule.DeterministicTransfer"; + }; + + return DeterministicTransfer; + })(); + + TransferRule.DisablePlannerTransfer = (function() { + + /** + * Properties of a DisablePlannerTransfer. + * @memberof google.cloud.ces.v1.TransferRule + * @interface IDisablePlannerTransfer + * @property {google.cloud.ces.v1.IExpressionCondition|null} [expressionCondition] DisablePlannerTransfer expressionCondition + */ + + /** + * Constructs a new DisablePlannerTransfer. + * @memberof google.cloud.ces.v1.TransferRule + * @classdesc Represents a DisablePlannerTransfer. + * @implements IDisablePlannerTransfer + * @constructor + * @param {google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer=} [properties] Properties to set + */ + function DisablePlannerTransfer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisablePlannerTransfer expressionCondition. + * @member {google.cloud.ces.v1.IExpressionCondition|null|undefined} expressionCondition + * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer + * @instance + */ + DisablePlannerTransfer.prototype.expressionCondition = null; + + /** + * Creates a new DisablePlannerTransfer instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer + * @static + * @param {google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer=} [properties] Properties to set + * @returns {google.cloud.ces.v1.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer instance + */ + DisablePlannerTransfer.create = function create(properties) { + return new DisablePlannerTransfer(properties); + }; + + /** + * Encodes the specified DisablePlannerTransfer message. Does not implicitly {@link google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer + * @static + * @param {google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer} message DisablePlannerTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisablePlannerTransfer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expressionCondition != null && Object.hasOwnProperty.call(message, "expressionCondition")) + $root.google.cloud.ces.v1.ExpressionCondition.encode(message.expressionCondition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DisablePlannerTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer + * @static + * @param {google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer} message DisablePlannerTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisablePlannerTransfer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisablePlannerTransfer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisablePlannerTransfer.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TransferRule.DisablePlannerTransfer(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expressionCondition = $root.google.cloud.ces.v1.ExpressionCondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisablePlannerTransfer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisablePlannerTransfer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisablePlannerTransfer message. + * @function verify + * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisablePlannerTransfer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) { + var error = $root.google.cloud.ces.v1.ExpressionCondition.verify(message.expressionCondition); + if (error) + return "expressionCondition." + error; + } + return null; + }; + + /** + * Creates a DisablePlannerTransfer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer + */ + DisablePlannerTransfer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.TransferRule.DisablePlannerTransfer) + return object; + var message = new $root.google.cloud.ces.v1.TransferRule.DisablePlannerTransfer(); + if (object.expressionCondition != null) { + if (typeof object.expressionCondition !== "object") + throw TypeError(".google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.expressionCondition: object expected"); + message.expressionCondition = $root.google.cloud.ces.v1.ExpressionCondition.fromObject(object.expressionCondition); + } + return message; + }; + + /** + * Creates a plain object from a DisablePlannerTransfer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer + * @static + * @param {google.cloud.ces.v1.TransferRule.DisablePlannerTransfer} message DisablePlannerTransfer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisablePlannerTransfer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.expressionCondition = null; + if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) + object.expressionCondition = $root.google.cloud.ces.v1.ExpressionCondition.toObject(message.expressionCondition, options); + return object; + }; + + /** + * Converts this DisablePlannerTransfer to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer + * @instance + * @returns {Object.} JSON object + */ + DisablePlannerTransfer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisablePlannerTransfer + * @function getTypeUrl + * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisablePlannerTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.TransferRule.DisablePlannerTransfer"; + }; + + return DisablePlannerTransfer; + })(); + + /** + * Direction enum. + * @name google.cloud.ces.v1.TransferRule.Direction + * @enum {number} + * @property {number} DIRECTION_UNSPECIFIED=0 DIRECTION_UNSPECIFIED value + * @property {number} PARENT_TO_CHILD=1 PARENT_TO_CHILD value + * @property {number} CHILD_TO_PARENT=2 CHILD_TO_PARENT value + */ + TransferRule.Direction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "PARENT_TO_CHILD"] = 1; + values[valuesById[2] = "CHILD_TO_PARENT"] = 2; + return values; + })(); + + return TransferRule; + })(); + + /** + * ExecutionType enum. + * @name google.cloud.ces.v1.ExecutionType + * @enum {number} + * @property {number} EXECUTION_TYPE_UNSPECIFIED=0 EXECUTION_TYPE_UNSPECIFIED value + * @property {number} SYNCHRONOUS=1 SYNCHRONOUS value + * @property {number} ASYNCHRONOUS=2 ASYNCHRONOUS value + */ + v1.ExecutionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXECUTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SYNCHRONOUS"] = 1; + values[valuesById[2] = "ASYNCHRONOUS"] = 2; + return values; + })(); + + v1.Callback = (function() { + + /** + * Properties of a Callback. + * @memberof google.cloud.ces.v1 + * @interface ICallback + * @property {string|null} [pythonCode] Callback pythonCode + * @property {string|null} [description] Callback description + * @property {boolean|null} [disabled] Callback disabled + * @property {boolean|null} [proactiveExecutionEnabled] Callback proactiveExecutionEnabled + */ + + /** + * Constructs a new Callback. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a Callback. + * @implements ICallback + * @constructor + * @param {google.cloud.ces.v1.ICallback=} [properties] Properties to set + */ + function Callback(properties) { + if (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 pythonCode. + * @member {string|null|undefined} pythonCode + * @memberof google.cloud.ces.v1.Callback + * @instance + */ + Callback.prototype.pythonCode = null; + + /** + * Callback description. + * @member {string} description + * @memberof google.cloud.ces.v1.Callback + * @instance + */ + Callback.prototype.description = ""; + + /** + * Callback disabled. + * @member {boolean} disabled + * @memberof google.cloud.ces.v1.Callback + * @instance + */ + Callback.prototype.disabled = false; + + /** + * Callback proactiveExecutionEnabled. + * @member {boolean} proactiveExecutionEnabled + * @memberof google.cloud.ces.v1.Callback + * @instance + */ + Callback.prototype.proactiveExecutionEnabled = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Callback callback. + * @member {"pythonCode"|undefined} callback + * @memberof google.cloud.ces.v1.Callback + * @instance + */ + Object.defineProperty(Callback.prototype, "callback", { + get: $util.oneOfGetter($oneOfFields = ["pythonCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Callback instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Callback + * @static + * @param {google.cloud.ces.v1.ICallback=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Callback} Callback instance + */ + Callback.create = function create(properties) { + return new Callback(properties); + }; + + /** + * Encodes the specified Callback message. Does not implicitly {@link google.cloud.ces.v1.Callback.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Callback + * @static + * @param {google.cloud.ces.v1.ICallback} message Callback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Callback.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pythonCode); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.disabled); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.proactiveExecutionEnabled != null && Object.hasOwnProperty.call(message, "proactiveExecutionEnabled")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.proactiveExecutionEnabled); + return writer; + }; + + /** + * Encodes the specified Callback message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Callback.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Callback + * @static + * @param {google.cloud.ces.v1.ICallback} message Callback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Callback.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Callback message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Callback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Callback} Callback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Callback.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Callback(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pythonCode = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 2: { + message.disabled = reader.bool(); + break; + } + case 4: { + message.proactiveExecutionEnabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Callback message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Callback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Callback} Callback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Callback.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Callback message. + * @function verify + * @memberof google.cloud.ces.v1.Callback + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Callback.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) { + properties.callback = 1; + if (!$util.isString(message.pythonCode)) + return "pythonCode: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + if (message.proactiveExecutionEnabled != null && message.hasOwnProperty("proactiveExecutionEnabled")) + if (typeof message.proactiveExecutionEnabled !== "boolean") + return "proactiveExecutionEnabled: boolean expected"; + return null; + }; + + /** + * Creates a Callback message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Callback + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Callback} Callback + */ + Callback.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Callback) + return object; + var message = new $root.google.cloud.ces.v1.Callback(); + if (object.pythonCode != null) + message.pythonCode = String(object.pythonCode); + if (object.description != null) + message.description = String(object.description); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + if (object.proactiveExecutionEnabled != null) + message.proactiveExecutionEnabled = Boolean(object.proactiveExecutionEnabled); + return message; + }; + + /** + * Creates a plain object from a Callback message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Callback + * @static + * @param {google.cloud.ces.v1.Callback} message Callback + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Callback.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disabled = false; + object.description = ""; + object.proactiveExecutionEnabled = false; + } + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) { + object.pythonCode = message.pythonCode; + if (options.oneofs) + object.callback = "pythonCode"; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.proactiveExecutionEnabled != null && message.hasOwnProperty("proactiveExecutionEnabled")) + object.proactiveExecutionEnabled = message.proactiveExecutionEnabled; + return object; + }; + + /** + * Converts this Callback to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Callback + * @instance + * @returns {Object.} JSON object + */ + Callback.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Callback + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Callback + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Callback.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Callback"; + }; + + return Callback; + })(); + + v1.ModelSettings = (function() { + + /** + * Properties of a ModelSettings. + * @memberof google.cloud.ces.v1 + * @interface IModelSettings + * @property {string|null} [model] ModelSettings model + * @property {number|null} [temperature] ModelSettings temperature + */ + + /** + * Constructs a new ModelSettings. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ModelSettings. + * @implements IModelSettings + * @constructor + * @param {google.cloud.ces.v1.IModelSettings=} [properties] Properties to set + */ + function ModelSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelSettings model. + * @member {string} model + * @memberof google.cloud.ces.v1.ModelSettings + * @instance + */ + ModelSettings.prototype.model = ""; + + /** + * ModelSettings temperature. + * @member {number|null|undefined} temperature + * @memberof google.cloud.ces.v1.ModelSettings + * @instance + */ + ModelSettings.prototype.temperature = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ModelSettings.prototype, "_temperature", { + get: $util.oneOfGetter($oneOfFields = ["temperature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModelSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ModelSettings + * @static + * @param {google.cloud.ces.v1.IModelSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ModelSettings} ModelSettings instance + */ + ModelSettings.create = function create(properties) { + return new ModelSettings(properties); + }; + + /** + * Encodes the specified ModelSettings message. Does not implicitly {@link google.cloud.ces.v1.ModelSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ModelSettings + * @static + * @param {google.cloud.ces.v1.IModelSettings} message ModelSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.temperature); + return writer; + }; + + /** + * Encodes the specified ModelSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ModelSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ModelSettings + * @static + * @param {google.cloud.ces.v1.IModelSettings} message ModelSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ModelSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ModelSettings} ModelSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ModelSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.temperature = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ModelSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ModelSettings} ModelSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelSettings message. + * @function verify + * @memberof google.cloud.ces.v1.ModelSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.temperature != null && message.hasOwnProperty("temperature")) { + properties._temperature = 1; + if (typeof message.temperature !== "number") + return "temperature: number expected"; + } + return null; + }; + + /** + * Creates a ModelSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ModelSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ModelSettings} ModelSettings + */ + ModelSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ModelSettings) + return object; + var message = new $root.google.cloud.ces.v1.ModelSettings(); + if (object.model != null) + message.model = String(object.model); + if (object.temperature != null) + message.temperature = Number(object.temperature); + return message; + }; + + /** + * Creates a plain object from a ModelSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ModelSettings + * @static + * @param {google.cloud.ces.v1.ModelSettings} message ModelSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.temperature != null && message.hasOwnProperty("temperature")) { + object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; + if (options.oneofs) + object._temperature = "temperature"; + } + return object; + }; + + /** + * Converts this ModelSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ModelSettings + * @instance + * @returns {Object.} JSON object + */ + ModelSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ModelSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ModelSettings"; + }; + + return ModelSettings; + })(); + + v1.TriggerAction = (function() { + + /** + * Properties of a TriggerAction. + * @memberof google.cloud.ces.v1 + * @interface ITriggerAction + * @property {google.cloud.ces.v1.TriggerAction.IRespondImmediately|null} [respondImmediately] TriggerAction respondImmediately + * @property {google.cloud.ces.v1.TriggerAction.ITransferAgent|null} [transferAgent] TriggerAction transferAgent + * @property {google.cloud.ces.v1.TriggerAction.IGenerativeAnswer|null} [generativeAnswer] TriggerAction generativeAnswer + */ + + /** + * Constructs a new TriggerAction. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a TriggerAction. + * @implements ITriggerAction + * @constructor + * @param {google.cloud.ces.v1.ITriggerAction=} [properties] Properties to set + */ + function TriggerAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TriggerAction respondImmediately. + * @member {google.cloud.ces.v1.TriggerAction.IRespondImmediately|null|undefined} respondImmediately + * @memberof google.cloud.ces.v1.TriggerAction + * @instance + */ + TriggerAction.prototype.respondImmediately = null; + + /** + * TriggerAction transferAgent. + * @member {google.cloud.ces.v1.TriggerAction.ITransferAgent|null|undefined} transferAgent + * @memberof google.cloud.ces.v1.TriggerAction + * @instance + */ + TriggerAction.prototype.transferAgent = null; + + /** + * TriggerAction generativeAnswer. + * @member {google.cloud.ces.v1.TriggerAction.IGenerativeAnswer|null|undefined} generativeAnswer + * @memberof google.cloud.ces.v1.TriggerAction + * @instance + */ + TriggerAction.prototype.generativeAnswer = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TriggerAction action. + * @member {"respondImmediately"|"transferAgent"|"generativeAnswer"|undefined} action + * @memberof google.cloud.ces.v1.TriggerAction + * @instance + */ + Object.defineProperty(TriggerAction.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["respondImmediately", "transferAgent", "generativeAnswer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TriggerAction instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.TriggerAction + * @static + * @param {google.cloud.ces.v1.ITriggerAction=} [properties] Properties to set + * @returns {google.cloud.ces.v1.TriggerAction} TriggerAction instance + */ + TriggerAction.create = function create(properties) { + return new TriggerAction(properties); + }; + + /** + * Encodes the specified TriggerAction message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.TriggerAction + * @static + * @param {google.cloud.ces.v1.ITriggerAction} message TriggerAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TriggerAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.respondImmediately != null && Object.hasOwnProperty.call(message, "respondImmediately")) + $root.google.cloud.ces.v1.TriggerAction.RespondImmediately.encode(message.respondImmediately, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.transferAgent != null && Object.hasOwnProperty.call(message, "transferAgent")) + $root.google.cloud.ces.v1.TriggerAction.TransferAgent.encode(message.transferAgent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.generativeAnswer != null && Object.hasOwnProperty.call(message, "generativeAnswer")) + $root.google.cloud.ces.v1.TriggerAction.GenerativeAnswer.encode(message.generativeAnswer, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TriggerAction message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.TriggerAction + * @static + * @param {google.cloud.ces.v1.ITriggerAction} message TriggerAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TriggerAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TriggerAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.TriggerAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.TriggerAction} TriggerAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TriggerAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TriggerAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.respondImmediately = $root.google.cloud.ces.v1.TriggerAction.RespondImmediately.decode(reader, reader.uint32()); + break; + } + case 2: { + message.transferAgent = $root.google.cloud.ces.v1.TriggerAction.TransferAgent.decode(reader, reader.uint32()); + break; + } + case 3: { + message.generativeAnswer = $root.google.cloud.ces.v1.TriggerAction.GenerativeAnswer.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TriggerAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.TriggerAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.TriggerAction} TriggerAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TriggerAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TriggerAction message. + * @function verify + * @memberof google.cloud.ces.v1.TriggerAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TriggerAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.respondImmediately != null && message.hasOwnProperty("respondImmediately")) { + properties.action = 1; + { + var error = $root.google.cloud.ces.v1.TriggerAction.RespondImmediately.verify(message.respondImmediately); + if (error) + return "respondImmediately." + error; + } + } + if (message.transferAgent != null && message.hasOwnProperty("transferAgent")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.ces.v1.TriggerAction.TransferAgent.verify(message.transferAgent); + if (error) + return "transferAgent." + error; + } + } + if (message.generativeAnswer != null && message.hasOwnProperty("generativeAnswer")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.ces.v1.TriggerAction.GenerativeAnswer.verify(message.generativeAnswer); + if (error) + return "generativeAnswer." + error; + } + } + return null; + }; + + /** + * Creates a TriggerAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.TriggerAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.TriggerAction} TriggerAction + */ + TriggerAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.TriggerAction) + return object; + var message = new $root.google.cloud.ces.v1.TriggerAction(); + if (object.respondImmediately != null) { + if (typeof object.respondImmediately !== "object") + throw TypeError(".google.cloud.ces.v1.TriggerAction.respondImmediately: object expected"); + message.respondImmediately = $root.google.cloud.ces.v1.TriggerAction.RespondImmediately.fromObject(object.respondImmediately); + } + if (object.transferAgent != null) { + if (typeof object.transferAgent !== "object") + throw TypeError(".google.cloud.ces.v1.TriggerAction.transferAgent: object expected"); + message.transferAgent = $root.google.cloud.ces.v1.TriggerAction.TransferAgent.fromObject(object.transferAgent); + } + if (object.generativeAnswer != null) { + if (typeof object.generativeAnswer !== "object") + throw TypeError(".google.cloud.ces.v1.TriggerAction.generativeAnswer: object expected"); + message.generativeAnswer = $root.google.cloud.ces.v1.TriggerAction.GenerativeAnswer.fromObject(object.generativeAnswer); + } + return message; + }; + + /** + * Creates a plain object from a TriggerAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.TriggerAction + * @static + * @param {google.cloud.ces.v1.TriggerAction} message TriggerAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TriggerAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.respondImmediately != null && message.hasOwnProperty("respondImmediately")) { + object.respondImmediately = $root.google.cloud.ces.v1.TriggerAction.RespondImmediately.toObject(message.respondImmediately, options); + if (options.oneofs) + object.action = "respondImmediately"; + } + if (message.transferAgent != null && message.hasOwnProperty("transferAgent")) { + object.transferAgent = $root.google.cloud.ces.v1.TriggerAction.TransferAgent.toObject(message.transferAgent, options); + if (options.oneofs) + object.action = "transferAgent"; + } + if (message.generativeAnswer != null && message.hasOwnProperty("generativeAnswer")) { + object.generativeAnswer = $root.google.cloud.ces.v1.TriggerAction.GenerativeAnswer.toObject(message.generativeAnswer, options); + if (options.oneofs) + object.action = "generativeAnswer"; + } + return object; + }; + + /** + * Converts this TriggerAction to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.TriggerAction + * @instance + * @returns {Object.} JSON object + */ + TriggerAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TriggerAction + * @function getTypeUrl + * @memberof google.cloud.ces.v1.TriggerAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TriggerAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.TriggerAction"; + }; + + TriggerAction.Response = (function() { + + /** + * Properties of a Response. + * @memberof google.cloud.ces.v1.TriggerAction + * @interface IResponse + * @property {string|null} [text] Response text + * @property {boolean|null} [disabled] Response disabled + */ + + /** + * Constructs a new Response. + * @memberof google.cloud.ces.v1.TriggerAction + * @classdesc Represents a Response. + * @implements IResponse + * @constructor + * @param {google.cloud.ces.v1.TriggerAction.IResponse=} [properties] Properties to set + */ + function Response(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Response text. + * @member {string} text + * @memberof google.cloud.ces.v1.TriggerAction.Response + * @instance + */ + Response.prototype.text = ""; + + /** + * Response disabled. + * @member {boolean} disabled + * @memberof google.cloud.ces.v1.TriggerAction.Response + * @instance + */ + Response.prototype.disabled = false; + + /** + * Creates a new Response instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.TriggerAction.Response + * @static + * @param {google.cloud.ces.v1.TriggerAction.IResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.TriggerAction.Response} Response instance + */ + Response.create = function create(properties) { + return new Response(properties); + }; + + /** + * Encodes the specified Response message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.Response.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.TriggerAction.Response + * @static + * @param {google.cloud.ces.v1.TriggerAction.IResponse} message Response message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Response.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.disabled); + return writer; + }; + + /** + * Encodes the specified Response message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.Response.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.TriggerAction.Response + * @static + * @param {google.cloud.ces.v1.TriggerAction.IResponse} message Response message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Response.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Response message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.TriggerAction.Response + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.TriggerAction.Response} Response + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Response.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TriggerAction.Response(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.disabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Response message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.TriggerAction.Response + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.TriggerAction.Response} Response + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Response.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Response message. + * @function verify + * @memberof google.cloud.ces.v1.TriggerAction.Response + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Response.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + return null; + }; + + /** + * Creates a Response message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.TriggerAction.Response + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.TriggerAction.Response} Response + */ + Response.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.TriggerAction.Response) + return object; + var message = new $root.google.cloud.ces.v1.TriggerAction.Response(); + if (object.text != null) + message.text = String(object.text); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + return message; + }; + + /** + * Creates a plain object from a Response message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.TriggerAction.Response + * @static + * @param {google.cloud.ces.v1.TriggerAction.Response} message Response + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Response.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.disabled = false; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + return object; + }; + + /** + * Converts this Response to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.TriggerAction.Response + * @instance + * @returns {Object.} JSON object + */ + Response.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Response + * @function getTypeUrl + * @memberof google.cloud.ces.v1.TriggerAction.Response + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Response.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.TriggerAction.Response"; + }; + + return Response; + })(); + + TriggerAction.RespondImmediately = (function() { + + /** + * Properties of a RespondImmediately. + * @memberof google.cloud.ces.v1.TriggerAction + * @interface IRespondImmediately + * @property {Array.|null} [responses] RespondImmediately responses + */ + + /** + * Constructs a new RespondImmediately. + * @memberof google.cloud.ces.v1.TriggerAction + * @classdesc Represents a RespondImmediately. + * @implements IRespondImmediately + * @constructor + * @param {google.cloud.ces.v1.TriggerAction.IRespondImmediately=} [properties] Properties to set + */ + function RespondImmediately(properties) { + this.responses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RespondImmediately responses. + * @member {Array.} responses + * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately + * @instance + */ + RespondImmediately.prototype.responses = $util.emptyArray; + + /** + * Creates a new RespondImmediately instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately + * @static + * @param {google.cloud.ces.v1.TriggerAction.IRespondImmediately=} [properties] Properties to set + * @returns {google.cloud.ces.v1.TriggerAction.RespondImmediately} RespondImmediately instance + */ + RespondImmediately.create = function create(properties) { + return new RespondImmediately(properties); + }; + + /** + * Encodes the specified RespondImmediately message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.RespondImmediately.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately + * @static + * @param {google.cloud.ces.v1.TriggerAction.IRespondImmediately} message RespondImmediately message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RespondImmediately.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responses != null && message.responses.length) + for (var i = 0; i < message.responses.length; ++i) + $root.google.cloud.ces.v1.TriggerAction.Response.encode(message.responses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RespondImmediately message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.RespondImmediately.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately + * @static + * @param {google.cloud.ces.v1.TriggerAction.IRespondImmediately} message RespondImmediately message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RespondImmediately.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RespondImmediately message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.TriggerAction.RespondImmediately} RespondImmediately + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RespondImmediately.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TriggerAction.RespondImmediately(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.responses && message.responses.length)) + message.responses = []; + message.responses.push($root.google.cloud.ces.v1.TriggerAction.Response.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RespondImmediately message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.TriggerAction.RespondImmediately} RespondImmediately + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RespondImmediately.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RespondImmediately message. + * @function verify + * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RespondImmediately.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responses != null && message.hasOwnProperty("responses")) { + if (!Array.isArray(message.responses)) + return "responses: array expected"; + for (var i = 0; i < message.responses.length; ++i) { + var error = $root.google.cloud.ces.v1.TriggerAction.Response.verify(message.responses[i]); + if (error) + return "responses." + error; + } + } + return null; + }; + + /** + * Creates a RespondImmediately message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.TriggerAction.RespondImmediately} RespondImmediately + */ + RespondImmediately.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.TriggerAction.RespondImmediately) + return object; + var message = new $root.google.cloud.ces.v1.TriggerAction.RespondImmediately(); + if (object.responses) { + if (!Array.isArray(object.responses)) + throw TypeError(".google.cloud.ces.v1.TriggerAction.RespondImmediately.responses: array expected"); + message.responses = []; + for (var i = 0; i < object.responses.length; ++i) { + if (typeof object.responses[i] !== "object") + throw TypeError(".google.cloud.ces.v1.TriggerAction.RespondImmediately.responses: object expected"); + message.responses[i] = $root.google.cloud.ces.v1.TriggerAction.Response.fromObject(object.responses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RespondImmediately message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately + * @static + * @param {google.cloud.ces.v1.TriggerAction.RespondImmediately} message RespondImmediately + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RespondImmediately.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responses = []; + if (message.responses && message.responses.length) { + object.responses = []; + for (var j = 0; j < message.responses.length; ++j) + object.responses[j] = $root.google.cloud.ces.v1.TriggerAction.Response.toObject(message.responses[j], options); + } + return object; + }; + + /** + * Converts this RespondImmediately to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately + * @instance + * @returns {Object.} JSON object + */ + RespondImmediately.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RespondImmediately + * @function getTypeUrl + * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RespondImmediately.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.TriggerAction.RespondImmediately"; + }; + + return RespondImmediately; + })(); + + TriggerAction.GenerativeAnswer = (function() { + + /** + * Properties of a GenerativeAnswer. + * @memberof google.cloud.ces.v1.TriggerAction + * @interface IGenerativeAnswer + * @property {string|null} [prompt] GenerativeAnswer prompt + */ + + /** + * Constructs a new GenerativeAnswer. + * @memberof google.cloud.ces.v1.TriggerAction + * @classdesc Represents a GenerativeAnswer. + * @implements IGenerativeAnswer + * @constructor + * @param {google.cloud.ces.v1.TriggerAction.IGenerativeAnswer=} [properties] Properties to set + */ + function GenerativeAnswer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerativeAnswer prompt. + * @member {string} prompt + * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer + * @instance + */ + GenerativeAnswer.prototype.prompt = ""; + + /** + * Creates a new GenerativeAnswer instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer + * @static + * @param {google.cloud.ces.v1.TriggerAction.IGenerativeAnswer=} [properties] Properties to set + * @returns {google.cloud.ces.v1.TriggerAction.GenerativeAnswer} GenerativeAnswer instance + */ + GenerativeAnswer.create = function create(properties) { + return new GenerativeAnswer(properties); + }; + + /** + * Encodes the specified GenerativeAnswer message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.GenerativeAnswer.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer + * @static + * @param {google.cloud.ces.v1.TriggerAction.IGenerativeAnswer} message GenerativeAnswer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerativeAnswer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.prompt); + return writer; + }; + + /** + * Encodes the specified GenerativeAnswer message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.GenerativeAnswer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer + * @static + * @param {google.cloud.ces.v1.TriggerAction.IGenerativeAnswer} message GenerativeAnswer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerativeAnswer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerativeAnswer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.TriggerAction.GenerativeAnswer} GenerativeAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerativeAnswer.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TriggerAction.GenerativeAnswer(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.prompt = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerativeAnswer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.TriggerAction.GenerativeAnswer} GenerativeAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerativeAnswer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerativeAnswer message. + * @function verify + * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerativeAnswer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.prompt != null && message.hasOwnProperty("prompt")) + if (!$util.isString(message.prompt)) + return "prompt: string expected"; + return null; + }; + + /** + * Creates a GenerativeAnswer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.TriggerAction.GenerativeAnswer} GenerativeAnswer + */ + GenerativeAnswer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.TriggerAction.GenerativeAnswer) + return object; + var message = new $root.google.cloud.ces.v1.TriggerAction.GenerativeAnswer(); + if (object.prompt != null) + message.prompt = String(object.prompt); + return message; + }; + + /** + * Creates a plain object from a GenerativeAnswer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer + * @static + * @param {google.cloud.ces.v1.TriggerAction.GenerativeAnswer} message GenerativeAnswer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerativeAnswer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.prompt = ""; + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = message.prompt; + return object; + }; + + /** + * Converts this GenerativeAnswer to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer + * @instance + * @returns {Object.} JSON object + */ + GenerativeAnswer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerativeAnswer + * @function getTypeUrl + * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerativeAnswer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.TriggerAction.GenerativeAnswer"; + }; + + return GenerativeAnswer; + })(); + + TriggerAction.TransferAgent = (function() { + + /** + * Properties of a TransferAgent. + * @memberof google.cloud.ces.v1.TriggerAction + * @interface ITransferAgent + * @property {string|null} [agent] TransferAgent agent + */ + + /** + * Constructs a new TransferAgent. + * @memberof google.cloud.ces.v1.TriggerAction + * @classdesc Represents a TransferAgent. + * @implements ITransferAgent + * @constructor + * @param {google.cloud.ces.v1.TriggerAction.ITransferAgent=} [properties] Properties to set + */ + function TransferAgent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferAgent agent. + * @member {string} agent + * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent + * @instance + */ + TransferAgent.prototype.agent = ""; + + /** + * Creates a new TransferAgent instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent + * @static + * @param {google.cloud.ces.v1.TriggerAction.ITransferAgent=} [properties] Properties to set + * @returns {google.cloud.ces.v1.TriggerAction.TransferAgent} TransferAgent instance + */ + TransferAgent.create = function create(properties) { + return new TransferAgent(properties); + }; + + /** + * Encodes the specified TransferAgent message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.TransferAgent.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent + * @static + * @param {google.cloud.ces.v1.TriggerAction.ITransferAgent} message TransferAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferAgent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.agent); + return writer; + }; + + /** + * Encodes the specified TransferAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.TransferAgent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent + * @static + * @param {google.cloud.ces.v1.TriggerAction.ITransferAgent} message TransferAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferAgent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferAgent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.TriggerAction.TransferAgent} TransferAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferAgent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TriggerAction.TransferAgent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.agent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferAgent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.TriggerAction.TransferAgent} TransferAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferAgent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferAgent message. + * @function verify + * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferAgent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agent != null && message.hasOwnProperty("agent")) + if (!$util.isString(message.agent)) + return "agent: string expected"; + return null; + }; + + /** + * Creates a TransferAgent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.TriggerAction.TransferAgent} TransferAgent + */ + TransferAgent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.TriggerAction.TransferAgent) + return object; + var message = new $root.google.cloud.ces.v1.TriggerAction.TransferAgent(); + if (object.agent != null) + message.agent = String(object.agent); + return message; + }; + + /** + * Creates a plain object from a TransferAgent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent + * @static + * @param {google.cloud.ces.v1.TriggerAction.TransferAgent} message TransferAgent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferAgent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.agent = ""; + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = message.agent; + return object; + }; + + /** + * Converts this TransferAgent to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent + * @instance + * @returns {Object.} JSON object + */ + TransferAgent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferAgent + * @function getTypeUrl + * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferAgent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.TriggerAction.TransferAgent"; + }; + + return TransferAgent; + })(); + + return TriggerAction; + })(); + + v1.TlsConfig = (function() { + + /** + * Properties of a TlsConfig. + * @memberof google.cloud.ces.v1 + * @interface ITlsConfig + * @property {Array.|null} [caCerts] TlsConfig caCerts + */ + + /** + * Constructs a new TlsConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a TlsConfig. + * @implements ITlsConfig + * @constructor + * @param {google.cloud.ces.v1.ITlsConfig=} [properties] Properties to set + */ + function TlsConfig(properties) { + this.caCerts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TlsConfig caCerts. + * @member {Array.} caCerts + * @memberof google.cloud.ces.v1.TlsConfig + * @instance + */ + TlsConfig.prototype.caCerts = $util.emptyArray; + + /** + * Creates a new TlsConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.TlsConfig + * @static + * @param {google.cloud.ces.v1.ITlsConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.TlsConfig} TlsConfig instance + */ + TlsConfig.create = function create(properties) { + return new TlsConfig(properties); + }; + + /** + * Encodes the specified TlsConfig message. Does not implicitly {@link google.cloud.ces.v1.TlsConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.TlsConfig + * @static + * @param {google.cloud.ces.v1.ITlsConfig} message TlsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TlsConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caCerts != null && message.caCerts.length) + for (var i = 0; i < message.caCerts.length; ++i) + $root.google.cloud.ces.v1.TlsConfig.CaCert.encode(message.caCerts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TlsConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TlsConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.TlsConfig + * @static + * @param {google.cloud.ces.v1.ITlsConfig} message TlsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TlsConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TlsConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.TlsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.TlsConfig} TlsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TlsConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TlsConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.caCerts && message.caCerts.length)) + message.caCerts = []; + message.caCerts.push($root.google.cloud.ces.v1.TlsConfig.CaCert.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TlsConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.TlsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.TlsConfig} TlsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TlsConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TlsConfig message. + * @function verify + * @memberof google.cloud.ces.v1.TlsConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TlsConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.caCerts != null && message.hasOwnProperty("caCerts")) { + if (!Array.isArray(message.caCerts)) + return "caCerts: array expected"; + for (var i = 0; i < message.caCerts.length; ++i) { + var error = $root.google.cloud.ces.v1.TlsConfig.CaCert.verify(message.caCerts[i]); + if (error) + return "caCerts." + error; + } + } + return null; + }; + + /** + * Creates a TlsConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.TlsConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.TlsConfig} TlsConfig + */ + TlsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.TlsConfig) + return object; + var message = new $root.google.cloud.ces.v1.TlsConfig(); + if (object.caCerts) { + if (!Array.isArray(object.caCerts)) + throw TypeError(".google.cloud.ces.v1.TlsConfig.caCerts: array expected"); + message.caCerts = []; + for (var i = 0; i < object.caCerts.length; ++i) { + if (typeof object.caCerts[i] !== "object") + throw TypeError(".google.cloud.ces.v1.TlsConfig.caCerts: object expected"); + message.caCerts[i] = $root.google.cloud.ces.v1.TlsConfig.CaCert.fromObject(object.caCerts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TlsConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.TlsConfig + * @static + * @param {google.cloud.ces.v1.TlsConfig} message TlsConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TlsConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.caCerts = []; + if (message.caCerts && message.caCerts.length) { + object.caCerts = []; + for (var j = 0; j < message.caCerts.length; ++j) + object.caCerts[j] = $root.google.cloud.ces.v1.TlsConfig.CaCert.toObject(message.caCerts[j], options); + } + return object; + }; + + /** + * Converts this TlsConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.TlsConfig + * @instance + * @returns {Object.} JSON object + */ + TlsConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TlsConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.TlsConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TlsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.TlsConfig"; + }; + + TlsConfig.CaCert = (function() { + + /** + * Properties of a CaCert. + * @memberof google.cloud.ces.v1.TlsConfig + * @interface ICaCert + * @property {string|null} [displayName] CaCert displayName + * @property {Uint8Array|null} [cert] CaCert cert + */ + + /** + * Constructs a new CaCert. + * @memberof google.cloud.ces.v1.TlsConfig + * @classdesc Represents a CaCert. + * @implements ICaCert + * @constructor + * @param {google.cloud.ces.v1.TlsConfig.ICaCert=} [properties] Properties to set + */ + function CaCert(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CaCert displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1.TlsConfig.CaCert + * @instance + */ + CaCert.prototype.displayName = ""; + + /** + * CaCert cert. + * @member {Uint8Array} cert + * @memberof google.cloud.ces.v1.TlsConfig.CaCert + * @instance + */ + CaCert.prototype.cert = $util.newBuffer([]); + + /** + * Creates a new CaCert instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.TlsConfig.CaCert + * @static + * @param {google.cloud.ces.v1.TlsConfig.ICaCert=} [properties] Properties to set + * @returns {google.cloud.ces.v1.TlsConfig.CaCert} CaCert instance + */ + CaCert.create = function create(properties) { + return new CaCert(properties); + }; + + /** + * Encodes the specified CaCert message. Does not implicitly {@link google.cloud.ces.v1.TlsConfig.CaCert.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.TlsConfig.CaCert + * @static + * @param {google.cloud.ces.v1.TlsConfig.ICaCert} message CaCert message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaCert.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.cert != null && Object.hasOwnProperty.call(message, "cert")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.cert); + return writer; + }; + + /** + * Encodes the specified CaCert message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TlsConfig.CaCert.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.TlsConfig.CaCert + * @static + * @param {google.cloud.ces.v1.TlsConfig.ICaCert} message CaCert message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaCert.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CaCert message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.TlsConfig.CaCert + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.TlsConfig.CaCert} CaCert + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaCert.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TlsConfig.CaCert(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.cert = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CaCert message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.TlsConfig.CaCert + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.TlsConfig.CaCert} CaCert + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaCert.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CaCert message. + * @function verify + * @memberof google.cloud.ces.v1.TlsConfig.CaCert + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CaCert.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.cert != null && message.hasOwnProperty("cert")) + if (!(message.cert && typeof message.cert.length === "number" || $util.isString(message.cert))) + return "cert: buffer expected"; + return null; + }; + + /** + * Creates a CaCert message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.TlsConfig.CaCert + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.TlsConfig.CaCert} CaCert + */ + CaCert.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.TlsConfig.CaCert) + return object; + var message = new $root.google.cloud.ces.v1.TlsConfig.CaCert(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.cert != null) + if (typeof object.cert === "string") + $util.base64.decode(object.cert, message.cert = $util.newBuffer($util.base64.length(object.cert)), 0); + else if (object.cert.length >= 0) + message.cert = object.cert; + return message; + }; + + /** + * Creates a plain object from a CaCert message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.TlsConfig.CaCert + * @static + * @param {google.cloud.ces.v1.TlsConfig.CaCert} message CaCert + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CaCert.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + if (options.bytes === String) + object.cert = ""; + else { + object.cert = []; + if (options.bytes !== Array) + object.cert = $util.newBuffer(object.cert); + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.cert != null && message.hasOwnProperty("cert")) + object.cert = options.bytes === String ? $util.base64.encode(message.cert, 0, message.cert.length) : options.bytes === Array ? Array.prototype.slice.call(message.cert) : message.cert; + return object; + }; + + /** + * Converts this CaCert to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.TlsConfig.CaCert + * @instance + * @returns {Object.} JSON object + */ + CaCert.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CaCert + * @function getTypeUrl + * @memberof google.cloud.ces.v1.TlsConfig.CaCert + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CaCert.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.TlsConfig.CaCert"; + }; + + return CaCert; + })(); + + return TlsConfig; + })(); + + v1.ServiceDirectoryConfig = (function() { + + /** + * Properties of a ServiceDirectoryConfig. + * @memberof google.cloud.ces.v1 + * @interface IServiceDirectoryConfig + * @property {string|null} [service] ServiceDirectoryConfig service + */ + + /** + * Constructs a new ServiceDirectoryConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ServiceDirectoryConfig. + * @implements IServiceDirectoryConfig + * @constructor + * @param {google.cloud.ces.v1.IServiceDirectoryConfig=} [properties] Properties to set + */ + function ServiceDirectoryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDirectoryConfig service. + * @member {string} service + * @memberof google.cloud.ces.v1.ServiceDirectoryConfig + * @instance + */ + ServiceDirectoryConfig.prototype.service = ""; + + /** + * Creates a new ServiceDirectoryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ServiceDirectoryConfig + * @static + * @param {google.cloud.ces.v1.IServiceDirectoryConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ServiceDirectoryConfig} ServiceDirectoryConfig instance + */ + ServiceDirectoryConfig.create = function create(properties) { + return new ServiceDirectoryConfig(properties); + }; + + /** + * Encodes the specified ServiceDirectoryConfig message. Does not implicitly {@link google.cloud.ces.v1.ServiceDirectoryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ServiceDirectoryConfig + * @static + * @param {google.cloud.ces.v1.IServiceDirectoryConfig} message ServiceDirectoryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDirectoryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + return writer; + }; + + /** + * Encodes the specified ServiceDirectoryConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ServiceDirectoryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ServiceDirectoryConfig + * @static + * @param {google.cloud.ces.v1.IServiceDirectoryConfig} message ServiceDirectoryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDirectoryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ServiceDirectoryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ServiceDirectoryConfig} ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDirectoryConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ServiceDirectoryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ServiceDirectoryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ServiceDirectoryConfig} ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDirectoryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDirectoryConfig message. + * @function verify + * @memberof google.cloud.ces.v1.ServiceDirectoryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDirectoryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + return null; + }; + + /** + * Creates a ServiceDirectoryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ServiceDirectoryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ServiceDirectoryConfig} ServiceDirectoryConfig + */ + ServiceDirectoryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ServiceDirectoryConfig) + return object; + var message = new $root.google.cloud.ces.v1.ServiceDirectoryConfig(); + if (object.service != null) + message.service = String(object.service); + return message; + }; + + /** + * Creates a plain object from a ServiceDirectoryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ServiceDirectoryConfig + * @static + * @param {google.cloud.ces.v1.ServiceDirectoryConfig} message ServiceDirectoryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDirectoryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + return object; + }; + + /** + * Converts this ServiceDirectoryConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ServiceDirectoryConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceDirectoryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDirectoryConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ServiceDirectoryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDirectoryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ServiceDirectoryConfig"; + }; + + return ServiceDirectoryConfig; + })(); + + v1.ChannelProfile = (function() { + + /** + * Properties of a ChannelProfile. + * @memberof google.cloud.ces.v1 + * @interface IChannelProfile + * @property {string|null} [profileId] ChannelProfile profileId + * @property {google.cloud.ces.v1.ChannelProfile.ChannelType|null} [channelType] ChannelProfile channelType + * @property {google.cloud.ces.v1.ChannelProfile.IPersonaProperty|null} [personaProperty] ChannelProfile personaProperty + * @property {boolean|null} [disableDtmf] ChannelProfile disableDtmf + * @property {boolean|null} [disableBargeInControl] ChannelProfile disableBargeInControl + * @property {google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig|null} [webWidgetConfig] ChannelProfile webWidgetConfig + * @property {string|null} [noiseSuppressionLevel] ChannelProfile noiseSuppressionLevel + */ + + /** + * Constructs a new ChannelProfile. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ChannelProfile. + * @implements IChannelProfile + * @constructor + * @param {google.cloud.ces.v1.IChannelProfile=} [properties] Properties to set + */ + function ChannelProfile(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChannelProfile profileId. + * @member {string} profileId + * @memberof google.cloud.ces.v1.ChannelProfile + * @instance + */ + ChannelProfile.prototype.profileId = ""; + + /** + * ChannelProfile channelType. + * @member {google.cloud.ces.v1.ChannelProfile.ChannelType} channelType + * @memberof google.cloud.ces.v1.ChannelProfile + * @instance + */ + ChannelProfile.prototype.channelType = 0; + + /** + * ChannelProfile personaProperty. + * @member {google.cloud.ces.v1.ChannelProfile.IPersonaProperty|null|undefined} personaProperty + * @memberof google.cloud.ces.v1.ChannelProfile + * @instance + */ + ChannelProfile.prototype.personaProperty = null; + + /** + * ChannelProfile disableDtmf. + * @member {boolean} disableDtmf + * @memberof google.cloud.ces.v1.ChannelProfile + * @instance + */ + ChannelProfile.prototype.disableDtmf = false; + + /** + * ChannelProfile disableBargeInControl. + * @member {boolean} disableBargeInControl + * @memberof google.cloud.ces.v1.ChannelProfile + * @instance + */ + ChannelProfile.prototype.disableBargeInControl = false; + + /** + * ChannelProfile webWidgetConfig. + * @member {google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig|null|undefined} webWidgetConfig + * @memberof google.cloud.ces.v1.ChannelProfile + * @instance + */ + ChannelProfile.prototype.webWidgetConfig = null; + + /** + * ChannelProfile noiseSuppressionLevel. + * @member {string} noiseSuppressionLevel + * @memberof google.cloud.ces.v1.ChannelProfile + * @instance + */ + ChannelProfile.prototype.noiseSuppressionLevel = ""; + + /** + * Creates a new ChannelProfile instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ChannelProfile + * @static + * @param {google.cloud.ces.v1.IChannelProfile=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ChannelProfile} ChannelProfile instance + */ + ChannelProfile.create = function create(properties) { + return new ChannelProfile(properties); + }; + + /** + * Encodes the specified ChannelProfile message. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ChannelProfile + * @static + * @param {google.cloud.ces.v1.IChannelProfile} message ChannelProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.profileId != null && Object.hasOwnProperty.call(message, "profileId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.profileId); + if (message.personaProperty != null && Object.hasOwnProperty.call(message, "personaProperty")) + $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty.encode(message.personaProperty, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.channelType != null && Object.hasOwnProperty.call(message, "channelType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.channelType); + if (message.disableDtmf != null && Object.hasOwnProperty.call(message, "disableDtmf")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.disableDtmf); + if (message.disableBargeInControl != null && Object.hasOwnProperty.call(message, "disableBargeInControl")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disableBargeInControl); + if (message.webWidgetConfig != null && Object.hasOwnProperty.call(message, "webWidgetConfig")) + $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.encode(message.webWidgetConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.noiseSuppressionLevel != null && Object.hasOwnProperty.call(message, "noiseSuppressionLevel")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.noiseSuppressionLevel); + return writer; + }; + + /** + * Encodes the specified ChannelProfile message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ChannelProfile + * @static + * @param {google.cloud.ces.v1.IChannelProfile} message ChannelProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChannelProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ChannelProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ChannelProfile} ChannelProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelProfile.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ChannelProfile(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.profileId = reader.string(); + break; + } + case 3: { + message.channelType = reader.int32(); + break; + } + case 2: { + message.personaProperty = $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty.decode(reader, reader.uint32()); + break; + } + case 4: { + message.disableDtmf = reader.bool(); + break; + } + case 5: { + message.disableBargeInControl = reader.bool(); + break; + } + case 7: { + message.webWidgetConfig = $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.noiseSuppressionLevel = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChannelProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ChannelProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ChannelProfile} ChannelProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChannelProfile message. + * @function verify + * @memberof google.cloud.ces.v1.ChannelProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChannelProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.profileId != null && message.hasOwnProperty("profileId")) + if (!$util.isString(message.profileId)) + return "profileId: string expected"; + if (message.channelType != null && message.hasOwnProperty("channelType")) + switch (message.channelType) { + default: + return "channelType: enum value expected"; + case 0: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.personaProperty != null && message.hasOwnProperty("personaProperty")) { + var error = $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty.verify(message.personaProperty); + if (error) + return "personaProperty." + error; + } + if (message.disableDtmf != null && message.hasOwnProperty("disableDtmf")) + if (typeof message.disableDtmf !== "boolean") + return "disableDtmf: boolean expected"; + if (message.disableBargeInControl != null && message.hasOwnProperty("disableBargeInControl")) + if (typeof message.disableBargeInControl !== "boolean") + return "disableBargeInControl: boolean expected"; + if (message.webWidgetConfig != null && message.hasOwnProperty("webWidgetConfig")) { + var error = $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.verify(message.webWidgetConfig); + if (error) + return "webWidgetConfig." + error; + } + if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) + if (!$util.isString(message.noiseSuppressionLevel)) + return "noiseSuppressionLevel: string expected"; + return null; + }; + + /** + * Creates a ChannelProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ChannelProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ChannelProfile} ChannelProfile + */ + ChannelProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ChannelProfile) + return object; + var message = new $root.google.cloud.ces.v1.ChannelProfile(); + if (object.profileId != null) + message.profileId = String(object.profileId); + switch (object.channelType) { + default: + if (typeof object.channelType === "number") { + message.channelType = object.channelType; + break; + } + break; + case "UNKNOWN": + case 0: + message.channelType = 0; + break; + case "WEB_UI": + case 2: + message.channelType = 2; + break; + case "API": + case 3: + message.channelType = 3; + break; + case "TWILIO": + case 4: + message.channelType = 4; + break; + case "GOOGLE_TELEPHONY_PLATFORM": + case 5: + message.channelType = 5; + break; + case "CONTACT_CENTER_AS_A_SERVICE": + case 6: + message.channelType = 6; + break; + case "FIVE9": + case 7: + message.channelType = 7; + break; + } + if (object.personaProperty != null) { + if (typeof object.personaProperty !== "object") + throw TypeError(".google.cloud.ces.v1.ChannelProfile.personaProperty: object expected"); + message.personaProperty = $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty.fromObject(object.personaProperty); + } + if (object.disableDtmf != null) + message.disableDtmf = Boolean(object.disableDtmf); + if (object.disableBargeInControl != null) + message.disableBargeInControl = Boolean(object.disableBargeInControl); + if (object.webWidgetConfig != null) { + if (typeof object.webWidgetConfig !== "object") + throw TypeError(".google.cloud.ces.v1.ChannelProfile.webWidgetConfig: object expected"); + message.webWidgetConfig = $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.fromObject(object.webWidgetConfig); + } + if (object.noiseSuppressionLevel != null) + message.noiseSuppressionLevel = String(object.noiseSuppressionLevel); + return message; + }; + + /** + * Creates a plain object from a ChannelProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ChannelProfile + * @static + * @param {google.cloud.ces.v1.ChannelProfile} message ChannelProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChannelProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.profileId = ""; + object.personaProperty = null; + object.channelType = options.enums === String ? "UNKNOWN" : 0; + object.disableDtmf = false; + object.disableBargeInControl = false; + object.webWidgetConfig = null; + object.noiseSuppressionLevel = ""; + } + if (message.profileId != null && message.hasOwnProperty("profileId")) + object.profileId = message.profileId; + if (message.personaProperty != null && message.hasOwnProperty("personaProperty")) + object.personaProperty = $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty.toObject(message.personaProperty, options); + if (message.channelType != null && message.hasOwnProperty("channelType")) + object.channelType = options.enums === String ? $root.google.cloud.ces.v1.ChannelProfile.ChannelType[message.channelType] === undefined ? message.channelType : $root.google.cloud.ces.v1.ChannelProfile.ChannelType[message.channelType] : message.channelType; + if (message.disableDtmf != null && message.hasOwnProperty("disableDtmf")) + object.disableDtmf = message.disableDtmf; + if (message.disableBargeInControl != null && message.hasOwnProperty("disableBargeInControl")) + object.disableBargeInControl = message.disableBargeInControl; + if (message.webWidgetConfig != null && message.hasOwnProperty("webWidgetConfig")) + object.webWidgetConfig = $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.toObject(message.webWidgetConfig, options); + if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) + object.noiseSuppressionLevel = message.noiseSuppressionLevel; + return object; + }; + + /** + * Converts this ChannelProfile to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ChannelProfile + * @instance + * @returns {Object.} JSON object + */ + ChannelProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChannelProfile + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ChannelProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChannelProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ChannelProfile"; + }; + + ChannelProfile.PersonaProperty = (function() { + + /** + * Properties of a PersonaProperty. + * @memberof google.cloud.ces.v1.ChannelProfile + * @interface IPersonaProperty + * @property {google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona|null} [persona] PersonaProperty persona + */ + + /** + * Constructs a new PersonaProperty. + * @memberof google.cloud.ces.v1.ChannelProfile + * @classdesc Represents a PersonaProperty. + * @implements IPersonaProperty + * @constructor + * @param {google.cloud.ces.v1.ChannelProfile.IPersonaProperty=} [properties] Properties to set + */ + function PersonaProperty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonaProperty persona. + * @member {google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona} persona + * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty + * @instance + */ + PersonaProperty.prototype.persona = 0; + + /** + * Creates a new PersonaProperty instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty + * @static + * @param {google.cloud.ces.v1.ChannelProfile.IPersonaProperty=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ChannelProfile.PersonaProperty} PersonaProperty instance + */ + PersonaProperty.create = function create(properties) { + return new PersonaProperty(properties); + }; + + /** + * Encodes the specified PersonaProperty message. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.PersonaProperty.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty + * @static + * @param {google.cloud.ces.v1.ChannelProfile.IPersonaProperty} message PersonaProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonaProperty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.persona != null && Object.hasOwnProperty.call(message, "persona")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.persona); + return writer; + }; + + /** + * Encodes the specified PersonaProperty message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.PersonaProperty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty + * @static + * @param {google.cloud.ces.v1.ChannelProfile.IPersonaProperty} message PersonaProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonaProperty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonaProperty message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ChannelProfile.PersonaProperty} PersonaProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonaProperty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.persona = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PersonaProperty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ChannelProfile.PersonaProperty} PersonaProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonaProperty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonaProperty message. + * @function verify + * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonaProperty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.persona != null && message.hasOwnProperty("persona")) + switch (message.persona) { + default: + return "persona: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a PersonaProperty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ChannelProfile.PersonaProperty} PersonaProperty + */ + PersonaProperty.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty) + return object; + var message = new $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty(); + switch (object.persona) { + default: + if (typeof object.persona === "number") { + message.persona = object.persona; + break; + } + break; + case "UNKNOWN": + case 0: + message.persona = 0; + break; + case "CONCISE": + case 1: + message.persona = 1; + break; + case "CHATTY": + case 2: + message.persona = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a PersonaProperty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty + * @static + * @param {google.cloud.ces.v1.ChannelProfile.PersonaProperty} message PersonaProperty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonaProperty.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.persona = options.enums === String ? "UNKNOWN" : 0; + if (message.persona != null && message.hasOwnProperty("persona")) + object.persona = options.enums === String ? $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona[message.persona] === undefined ? message.persona : $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona[message.persona] : message.persona; + return object; + }; + + /** + * Converts this PersonaProperty to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty + * @instance + * @returns {Object.} JSON object + */ + PersonaProperty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PersonaProperty + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PersonaProperty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ChannelProfile.PersonaProperty"; + }; + + /** + * Persona enum. + * @name google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} CONCISE=1 CONCISE value + * @property {number} CHATTY=2 CHATTY value + */ + PersonaProperty.Persona = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "CONCISE"] = 1; + values[valuesById[2] = "CHATTY"] = 2; + return values; + })(); + + return PersonaProperty; + })(); + + ChannelProfile.WebWidgetConfig = (function() { + + /** + * Properties of a WebWidgetConfig. + * @memberof google.cloud.ces.v1.ChannelProfile + * @interface IWebWidgetConfig + * @property {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality|null} [modality] WebWidgetConfig modality + * @property {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme|null} [theme] WebWidgetConfig theme + * @property {string|null} [webWidgetTitle] WebWidgetConfig webWidgetTitle + * @property {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings|null} [securitySettings] WebWidgetConfig securitySettings + */ + + /** + * Constructs a new WebWidgetConfig. + * @memberof google.cloud.ces.v1.ChannelProfile + * @classdesc Represents a WebWidgetConfig. + * @implements IWebWidgetConfig + * @constructor + * @param {google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig=} [properties] Properties to set + */ + function WebWidgetConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebWidgetConfig modality. + * @member {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality} modality + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig + * @instance + */ + WebWidgetConfig.prototype.modality = 0; + + /** + * WebWidgetConfig theme. + * @member {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme} theme + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig + * @instance + */ + WebWidgetConfig.prototype.theme = 0; + + /** + * WebWidgetConfig webWidgetTitle. + * @member {string} webWidgetTitle + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig + * @instance + */ + WebWidgetConfig.prototype.webWidgetTitle = ""; + + /** + * WebWidgetConfig securitySettings. + * @member {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings|null|undefined} securitySettings + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig + * @instance + */ + WebWidgetConfig.prototype.securitySettings = null; + + /** + * Creates a new WebWidgetConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig + * @static + * @param {google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig} WebWidgetConfig instance + */ + WebWidgetConfig.create = function create(properties) { + return new WebWidgetConfig(properties); + }; + + /** + * Encodes the specified WebWidgetConfig message. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig + * @static + * @param {google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig} message WebWidgetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebWidgetConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modality != null && Object.hasOwnProperty.call(message, "modality")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modality); + if (message.theme != null && Object.hasOwnProperty.call(message, "theme")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.theme); + if (message.webWidgetTitle != null && Object.hasOwnProperty.call(message, "webWidgetTitle")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.webWidgetTitle); + if (message.securitySettings != null && Object.hasOwnProperty.call(message, "securitySettings")) + $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.encode(message.securitySettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebWidgetConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig + * @static + * @param {google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig} message WebWidgetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebWidgetConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebWidgetConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig} WebWidgetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebWidgetConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.modality = reader.int32(); + break; + } + case 2: { + message.theme = reader.int32(); + break; + } + case 3: { + message.webWidgetTitle = reader.string(); + break; + } + case 4: { + message.securitySettings = $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebWidgetConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig} WebWidgetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebWidgetConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebWidgetConfig message. + * @function verify + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebWidgetConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modality != null && message.hasOwnProperty("modality")) + switch (message.modality) { + default: + return "modality: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.theme != null && message.hasOwnProperty("theme")) + switch (message.theme) { + default: + return "theme: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.webWidgetTitle != null && message.hasOwnProperty("webWidgetTitle")) + if (!$util.isString(message.webWidgetTitle)) + return "webWidgetTitle: string expected"; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) { + var error = $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.verify(message.securitySettings); + if (error) + return "securitySettings." + error; + } + return null; + }; + + /** + * Creates a WebWidgetConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig} WebWidgetConfig + */ + WebWidgetConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig) + return object; + var message = new $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig(); + switch (object.modality) { + default: + if (typeof object.modality === "number") { + message.modality = object.modality; + break; + } + break; + case "MODALITY_UNSPECIFIED": + case 0: + message.modality = 0; + break; + case "CHAT_AND_VOICE": + case 1: + message.modality = 1; + break; + case "VOICE_ONLY": + case 2: + message.modality = 2; + break; + case "CHAT_ONLY": + case 3: + message.modality = 3; + break; + } + switch (object.theme) { + default: + if (typeof object.theme === "number") { + message.theme = object.theme; + break; + } + break; + case "THEME_UNSPECIFIED": + case 0: + message.theme = 0; + break; + case "LIGHT": + case 1: + message.theme = 1; + break; + case "DARK": + case 2: + message.theme = 2; + break; + } + if (object.webWidgetTitle != null) + message.webWidgetTitle = String(object.webWidgetTitle); + if (object.securitySettings != null) { + if (typeof object.securitySettings !== "object") + throw TypeError(".google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.securitySettings: object expected"); + message.securitySettings = $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.fromObject(object.securitySettings); + } + return message; + }; + + /** + * Creates a plain object from a WebWidgetConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig + * @static + * @param {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig} message WebWidgetConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebWidgetConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modality = options.enums === String ? "MODALITY_UNSPECIFIED" : 0; + object.theme = options.enums === String ? "THEME_UNSPECIFIED" : 0; + object.webWidgetTitle = ""; + object.securitySettings = null; + } + if (message.modality != null && message.hasOwnProperty("modality")) + object.modality = options.enums === String ? $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality[message.modality] === undefined ? message.modality : $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality[message.modality] : message.modality; + if (message.theme != null && message.hasOwnProperty("theme")) + object.theme = options.enums === String ? $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme[message.theme] === undefined ? message.theme : $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme[message.theme] : message.theme; + if (message.webWidgetTitle != null && message.hasOwnProperty("webWidgetTitle")) + object.webWidgetTitle = message.webWidgetTitle; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) + object.securitySettings = $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.toObject(message.securitySettings, options); + return object; + }; + + /** + * Converts this WebWidgetConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig + * @instance + * @returns {Object.} JSON object + */ + WebWidgetConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebWidgetConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebWidgetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ChannelProfile.WebWidgetConfig"; + }; + + WebWidgetConfig.SecuritySettings = (function() { + + /** + * Properties of a SecuritySettings. + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig + * @interface ISecuritySettings + * @property {boolean|null} [enablePublicAccess] SecuritySettings enablePublicAccess + * @property {boolean|null} [enableOriginCheck] SecuritySettings enableOriginCheck + * @property {Array.|null} [allowedOrigins] SecuritySettings allowedOrigins + * @property {boolean|null} [enableRecaptcha] SecuritySettings enableRecaptcha + */ + + /** + * Constructs a new SecuritySettings. + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig + * @classdesc Represents a SecuritySettings. + * @implements ISecuritySettings + * @constructor + * @param {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings=} [properties] Properties to set + */ + function SecuritySettings(properties) { + this.allowedOrigins = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecuritySettings enablePublicAccess. + * @member {boolean} enablePublicAccess + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings + * @instance + */ + SecuritySettings.prototype.enablePublicAccess = false; + + /** + * SecuritySettings enableOriginCheck. + * @member {boolean} enableOriginCheck + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings + * @instance + */ + SecuritySettings.prototype.enableOriginCheck = false; + + /** + * SecuritySettings allowedOrigins. + * @member {Array.} allowedOrigins + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings + * @instance + */ + SecuritySettings.prototype.allowedOrigins = $util.emptyArray; + + /** + * SecuritySettings enableRecaptcha. + * @member {boolean} enableRecaptcha + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings + * @instance + */ + SecuritySettings.prototype.enableRecaptcha = false; + + /** + * Creates a new SecuritySettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings instance + */ + SecuritySettings.create = function create(properties) { + return new SecuritySettings(properties); + }; + + /** + * Encodes the specified SecuritySettings message. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings} message SecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecuritySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enablePublicAccess != null && Object.hasOwnProperty.call(message, "enablePublicAccess")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePublicAccess); + if (message.allowedOrigins != null && message.allowedOrigins.length) + for (var i = 0; i < message.allowedOrigins.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedOrigins[i]); + if (message.enableRecaptcha != null && Object.hasOwnProperty.call(message, "enableRecaptcha")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableRecaptcha); + if (message.enableOriginCheck != null && Object.hasOwnProperty.call(message, "enableOriginCheck")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableOriginCheck); + return writer; + }; + + /** + * Encodes the specified SecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings} message SecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecuritySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecuritySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enablePublicAccess = reader.bool(); + break; + } + case 4: { + message.enableOriginCheck = reader.bool(); + break; + } + case 2: { + if (!(message.allowedOrigins && message.allowedOrigins.length)) + message.allowedOrigins = []; + message.allowedOrigins.push(reader.string()); + break; + } + case 3: { + message.enableRecaptcha = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecuritySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecuritySettings message. + * @function verify + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecuritySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enablePublicAccess != null && message.hasOwnProperty("enablePublicAccess")) + if (typeof message.enablePublicAccess !== "boolean") + return "enablePublicAccess: boolean expected"; + if (message.enableOriginCheck != null && message.hasOwnProperty("enableOriginCheck")) + if (typeof message.enableOriginCheck !== "boolean") + return "enableOriginCheck: boolean expected"; + if (message.allowedOrigins != null && message.hasOwnProperty("allowedOrigins")) { + if (!Array.isArray(message.allowedOrigins)) + return "allowedOrigins: array expected"; + for (var i = 0; i < message.allowedOrigins.length; ++i) + if (!$util.isString(message.allowedOrigins[i])) + return "allowedOrigins: string[] expected"; + } + if (message.enableRecaptcha != null && message.hasOwnProperty("enableRecaptcha")) + if (typeof message.enableRecaptcha !== "boolean") + return "enableRecaptcha: boolean expected"; + return null; + }; + + /** + * Creates a SecuritySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings + */ + SecuritySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings) + return object; + var message = new $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings(); + if (object.enablePublicAccess != null) + message.enablePublicAccess = Boolean(object.enablePublicAccess); + if (object.enableOriginCheck != null) + message.enableOriginCheck = Boolean(object.enableOriginCheck); + if (object.allowedOrigins) { + if (!Array.isArray(object.allowedOrigins)) + throw TypeError(".google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.allowedOrigins: array expected"); + message.allowedOrigins = []; + for (var i = 0; i < object.allowedOrigins.length; ++i) + message.allowedOrigins[i] = String(object.allowedOrigins[i]); + } + if (object.enableRecaptcha != null) + message.enableRecaptcha = Boolean(object.enableRecaptcha); + return message; + }; + + /** + * Creates a plain object from a SecuritySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings} message SecuritySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecuritySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedOrigins = []; + if (options.defaults) { + object.enablePublicAccess = false; + object.enableRecaptcha = false; + object.enableOriginCheck = false; + } + if (message.enablePublicAccess != null && message.hasOwnProperty("enablePublicAccess")) + object.enablePublicAccess = message.enablePublicAccess; + if (message.allowedOrigins && message.allowedOrigins.length) { + object.allowedOrigins = []; + for (var j = 0; j < message.allowedOrigins.length; ++j) + object.allowedOrigins[j] = message.allowedOrigins[j]; + } + if (message.enableRecaptcha != null && message.hasOwnProperty("enableRecaptcha")) + object.enableRecaptcha = message.enableRecaptcha; + if (message.enableOriginCheck != null && message.hasOwnProperty("enableOriginCheck")) + object.enableOriginCheck = message.enableOriginCheck; + return object; + }; + + /** + * Converts this SecuritySettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings + * @instance + * @returns {Object.} JSON object + */ + SecuritySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecuritySettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecuritySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings"; + }; + + return SecuritySettings; + })(); + + /** + * Modality enum. + * @name google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality + * @enum {number} + * @property {number} MODALITY_UNSPECIFIED=0 MODALITY_UNSPECIFIED value + * @property {number} CHAT_AND_VOICE=1 CHAT_AND_VOICE value + * @property {number} VOICE_ONLY=2 VOICE_ONLY value + * @property {number} CHAT_ONLY=3 CHAT_ONLY value + */ + WebWidgetConfig.Modality = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODALITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "CHAT_AND_VOICE"] = 1; + values[valuesById[2] = "VOICE_ONLY"] = 2; + values[valuesById[3] = "CHAT_ONLY"] = 3; + return values; + })(); + + /** + * Theme enum. + * @name google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme + * @enum {number} + * @property {number} THEME_UNSPECIFIED=0 THEME_UNSPECIFIED value + * @property {number} LIGHT=1 LIGHT value + * @property {number} DARK=2 DARK value + */ + WebWidgetConfig.Theme = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "THEME_UNSPECIFIED"] = 0; + values[valuesById[1] = "LIGHT"] = 1; + values[valuesById[2] = "DARK"] = 2; + return values; + })(); + + return WebWidgetConfig; + })(); + + /** + * ChannelType enum. + * @name google.cloud.ces.v1.ChannelProfile.ChannelType + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} WEB_UI=2 WEB_UI value + * @property {number} API=3 API value + * @property {number} TWILIO=4 TWILIO value + * @property {number} GOOGLE_TELEPHONY_PLATFORM=5 GOOGLE_TELEPHONY_PLATFORM value + * @property {number} CONTACT_CENTER_AS_A_SERVICE=6 CONTACT_CENTER_AS_A_SERVICE value + * @property {number} FIVE9=7 FIVE9 value + */ + ChannelProfile.ChannelType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[2] = "WEB_UI"] = 2; + values[valuesById[3] = "API"] = 3; + values[valuesById[4] = "TWILIO"] = 4; + values[valuesById[5] = "GOOGLE_TELEPHONY_PLATFORM"] = 5; + values[valuesById[6] = "CONTACT_CENTER_AS_A_SERVICE"] = 6; + values[valuesById[7] = "FIVE9"] = 7; + return values; + })(); + + return ChannelProfile; + })(); + + v1.Span = (function() { + + /** + * Properties of a Span. + * @memberof google.cloud.ces.v1 + * @interface ISpan + * @property {string|null} [name] Span name + * @property {google.protobuf.ITimestamp|null} [startTime] Span startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Span endTime + * @property {google.protobuf.IDuration|null} [duration] Span duration + * @property {google.protobuf.IStruct|null} [attributes] Span attributes + * @property {Array.|null} [childSpans] Span childSpans + */ + + /** + * Constructs a new Span. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a Span. + * @implements ISpan + * @constructor + * @param {google.cloud.ces.v1.ISpan=} [properties] Properties to set + */ + function Span(properties) { + this.childSpans = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Span name. + * @member {string} name + * @memberof google.cloud.ces.v1.Span + * @instance + */ + Span.prototype.name = ""; + + /** + * Span startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.ces.v1.Span + * @instance + */ + Span.prototype.startTime = null; + + /** + * Span endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1.Span + * @instance + */ + Span.prototype.endTime = null; + + /** + * Span duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.ces.v1.Span + * @instance + */ + Span.prototype.duration = null; + + /** + * Span attributes. + * @member {google.protobuf.IStruct|null|undefined} attributes + * @memberof google.cloud.ces.v1.Span + * @instance + */ + Span.prototype.attributes = null; + + /** + * Span childSpans. + * @member {Array.} childSpans + * @memberof google.cloud.ces.v1.Span + * @instance + */ + Span.prototype.childSpans = $util.emptyArray; + + /** + * Creates a new Span instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Span + * @static + * @param {google.cloud.ces.v1.ISpan=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Span} Span instance + */ + Span.create = function create(properties) { + return new Span(properties); + }; + + /** + * Encodes the specified Span message. Does not implicitly {@link google.cloud.ces.v1.Span.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Span + * @static + * @param {google.cloud.ces.v1.ISpan} message Span message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Span.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + $root.google.protobuf.Struct.encode(message.attributes, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.childSpans != null && message.childSpans.length) + for (var i = 0; i < message.childSpans.length; ++i) + $root.google.cloud.ces.v1.Span.encode(message.childSpans[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Span message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Span.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Span + * @static + * @param {google.cloud.ces.v1.ISpan} message Span message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Span.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Span message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Span + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Span} Span + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Span.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Span(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.attributes = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.childSpans && message.childSpans.length)) + message.childSpans = []; + message.childSpans.push($root.google.cloud.ces.v1.Span.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Span message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Span + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Span} Span + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Span.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Span message. + * @function verify + * @memberof google.cloud.ces.v1.Span + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Span.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string 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.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + var error = $root.google.protobuf.Struct.verify(message.attributes); + if (error) + return "attributes." + error; + } + if (message.childSpans != null && message.hasOwnProperty("childSpans")) { + if (!Array.isArray(message.childSpans)) + return "childSpans: array expected"; + for (var i = 0; i < message.childSpans.length; ++i) { + var error = $root.google.cloud.ces.v1.Span.verify(message.childSpans[i]); + if (error) + return "childSpans." + error; + } + } + return null; + }; + + /** + * Creates a Span message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Span + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Span} Span + */ + Span.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Span) + return object; + var message = new $root.google.cloud.ces.v1.Span(); + if (object.name != null) + message.name = String(object.name); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.ces.v1.Span.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.ces.v1.Span.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.ces.v1.Span.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.attributes != null) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.ces.v1.Span.attributes: object expected"); + message.attributes = $root.google.protobuf.Struct.fromObject(object.attributes); + } + if (object.childSpans) { + if (!Array.isArray(object.childSpans)) + throw TypeError(".google.cloud.ces.v1.Span.childSpans: array expected"); + message.childSpans = []; + for (var i = 0; i < object.childSpans.length; ++i) { + if (typeof object.childSpans[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Span.childSpans: object expected"); + message.childSpans[i] = $root.google.cloud.ces.v1.Span.fromObject(object.childSpans[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Span message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Span + * @static + * @param {google.cloud.ces.v1.Span} message Span + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Span.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.childSpans = []; + if (options.defaults) { + object.name = ""; + object.startTime = null; + object.endTime = null; + object.attributes = null; + object.duration = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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.attributes != null && message.hasOwnProperty("attributes")) + object.attributes = $root.google.protobuf.Struct.toObject(message.attributes, options); + if (message.childSpans && message.childSpans.length) { + object.childSpans = []; + for (var j = 0; j < message.childSpans.length; ++j) + object.childSpans[j] = $root.google.cloud.ces.v1.Span.toObject(message.childSpans[j], options); + } + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this Span to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Span + * @instance + * @returns {Object.} JSON object + */ + Span.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Span + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Span + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Span.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Span"; + }; + + return Span; + })(); + + v1.AgentService = (function() { + + /** + * Constructs a new AgentService service. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an AgentService + * @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 AgentService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AgentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AgentService; + + /** + * Creates new AgentService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.ces.v1.AgentService + * @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 {AgentService} RPC service. Useful where requests and/or responses are streamed. + */ + AgentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listApps}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef ListAppsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.ListAppsResponse} [response] ListAppsResponse + */ + + /** + * Calls ListApps. + * @function listApps + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListAppsRequest} request ListAppsRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.ListAppsCallback} callback Node-style callback called with the error, if any, and ListAppsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listApps = function listApps(request, callback) { + return this.rpcCall(listApps, $root.google.cloud.ces.v1.ListAppsRequest, $root.google.cloud.ces.v1.ListAppsResponse, request, callback); + }, "name", { value: "ListApps" }); + + /** + * Calls ListApps. + * @function listApps + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListAppsRequest} request ListAppsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getApp}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef GetAppCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.App} [response] App + */ + + /** + * Calls GetApp. + * @function getApp + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetAppRequest} request GetAppRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.GetAppCallback} callback Node-style callback called with the error, if any, and App + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getApp = function getApp(request, callback) { + return this.rpcCall(getApp, $root.google.cloud.ces.v1.GetAppRequest, $root.google.cloud.ces.v1.App, request, callback); + }, "name", { value: "GetApp" }); + + /** + * Calls GetApp. + * @function getApp + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetAppRequest} request GetAppRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|createApp}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef CreateAppCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateApp. + * @function createApp + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.ICreateAppRequest} request CreateAppRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.CreateAppCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createApp = function createApp(request, callback) { + return this.rpcCall(createApp, $root.google.cloud.ces.v1.CreateAppRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateApp" }); + + /** + * Calls CreateApp. + * @function createApp + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.ICreateAppRequest} request CreateAppRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|updateApp}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef UpdateAppCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.App} [response] App + */ + + /** + * Calls UpdateApp. + * @function updateApp + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IUpdateAppRequest} request UpdateAppRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.UpdateAppCallback} callback Node-style callback called with the error, if any, and App + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateApp = function updateApp(request, callback) { + return this.rpcCall(updateApp, $root.google.cloud.ces.v1.UpdateAppRequest, $root.google.cloud.ces.v1.App, request, callback); + }, "name", { value: "UpdateApp" }); + + /** + * Calls UpdateApp. + * @function updateApp + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IUpdateAppRequest} request UpdateAppRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteApp}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef DeleteAppCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteApp. + * @function deleteApp + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IDeleteAppRequest} request DeleteAppRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.DeleteAppCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteApp = function deleteApp(request, callback) { + return this.rpcCall(deleteApp, $root.google.cloud.ces.v1.DeleteAppRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteApp" }); + + /** + * Calls DeleteApp. + * @function deleteApp + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IDeleteAppRequest} request DeleteAppRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|exportApp}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef ExportAppCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportApp. + * @function exportApp + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IExportAppRequest} request ExportAppRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.ExportAppCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.exportApp = function exportApp(request, callback) { + return this.rpcCall(exportApp, $root.google.cloud.ces.v1.ExportAppRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportApp" }); + + /** + * Calls ExportApp. + * @function exportApp + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IExportAppRequest} request ExportAppRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|importApp}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef ImportAppCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportApp. + * @function importApp + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IImportAppRequest} request ImportAppRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.ImportAppCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.importApp = function importApp(request, callback) { + return this.rpcCall(importApp, $root.google.cloud.ces.v1.ImportAppRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportApp" }); + + /** + * Calls ImportApp. + * @function importApp + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IImportAppRequest} request ImportAppRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listAgents}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef ListAgentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.ListAgentsResponse} [response] ListAgentsResponse + */ + + /** + * Calls ListAgents. + * @function listAgents + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListAgentsRequest} request ListAgentsRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.ListAgentsCallback} callback Node-style callback called with the error, if any, and ListAgentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listAgents = function listAgents(request, callback) { + return this.rpcCall(listAgents, $root.google.cloud.ces.v1.ListAgentsRequest, $root.google.cloud.ces.v1.ListAgentsResponse, request, callback); + }, "name", { value: "ListAgents" }); + + /** + * Calls ListAgents. + * @function listAgents + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListAgentsRequest} request ListAgentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getAgent}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef GetAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Agent} [response] Agent + */ + + /** + * Calls GetAgent. + * @function getAgent + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetAgentRequest} request GetAgentRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.GetAgentCallback} callback Node-style callback called with the error, if any, and Agent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getAgent = function getAgent(request, callback) { + return this.rpcCall(getAgent, $root.google.cloud.ces.v1.GetAgentRequest, $root.google.cloud.ces.v1.Agent, request, callback); + }, "name", { value: "GetAgent" }); + + /** + * Calls GetAgent. + * @function getAgent + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetAgentRequest} request GetAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|createAgent}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef CreateAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Agent} [response] Agent + */ + + /** + * Calls CreateAgent. + * @function createAgent + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.ICreateAgentRequest} request CreateAgentRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.CreateAgentCallback} callback Node-style callback called with the error, if any, and Agent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createAgent = function createAgent(request, callback) { + return this.rpcCall(createAgent, $root.google.cloud.ces.v1.CreateAgentRequest, $root.google.cloud.ces.v1.Agent, request, callback); + }, "name", { value: "CreateAgent" }); + + /** + * Calls CreateAgent. + * @function createAgent + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.ICreateAgentRequest} request CreateAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|updateAgent}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef UpdateAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Agent} [response] Agent + */ + + /** + * Calls UpdateAgent. + * @function updateAgent + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IUpdateAgentRequest} request UpdateAgentRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.UpdateAgentCallback} callback Node-style callback called with the error, if any, and Agent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateAgent = function updateAgent(request, callback) { + return this.rpcCall(updateAgent, $root.google.cloud.ces.v1.UpdateAgentRequest, $root.google.cloud.ces.v1.Agent, request, callback); + }, "name", { value: "UpdateAgent" }); + + /** + * Calls UpdateAgent. + * @function updateAgent + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IUpdateAgentRequest} request UpdateAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteAgent}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef DeleteAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAgent. + * @function deleteAgent + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IDeleteAgentRequest} request DeleteAgentRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.DeleteAgentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteAgent = function deleteAgent(request, callback) { + return this.rpcCall(deleteAgent, $root.google.cloud.ces.v1.DeleteAgentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAgent" }); + + /** + * Calls DeleteAgent. + * @function deleteAgent + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IDeleteAgentRequest} request DeleteAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listExamples}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef ListExamplesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.ListExamplesResponse} [response] ListExamplesResponse + */ + + /** + * Calls ListExamples. + * @function listExamples + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListExamplesRequest} request ListExamplesRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.ListExamplesCallback} callback Node-style callback called with the error, if any, and ListExamplesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listExamples = function listExamples(request, callback) { + return this.rpcCall(listExamples, $root.google.cloud.ces.v1.ListExamplesRequest, $root.google.cloud.ces.v1.ListExamplesResponse, request, callback); + }, "name", { value: "ListExamples" }); + + /** + * Calls ListExamples. + * @function listExamples + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListExamplesRequest} request ListExamplesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getExample}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef GetExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Example} [response] Example + */ + + /** + * Calls GetExample. + * @function getExample + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetExampleRequest} request GetExampleRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.GetExampleCallback} callback Node-style callback called with the error, if any, and Example + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getExample = function getExample(request, callback) { + return this.rpcCall(getExample, $root.google.cloud.ces.v1.GetExampleRequest, $root.google.cloud.ces.v1.Example, request, callback); + }, "name", { value: "GetExample" }); + + /** + * Calls GetExample. + * @function getExample + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetExampleRequest} request GetExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|createExample}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef CreateExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Example} [response] Example + */ + + /** + * Calls CreateExample. + * @function createExample + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.ICreateExampleRequest} request CreateExampleRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.CreateExampleCallback} callback Node-style callback called with the error, if any, and Example + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createExample = function createExample(request, callback) { + return this.rpcCall(createExample, $root.google.cloud.ces.v1.CreateExampleRequest, $root.google.cloud.ces.v1.Example, request, callback); + }, "name", { value: "CreateExample" }); + + /** + * Calls CreateExample. + * @function createExample + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.ICreateExampleRequest} request CreateExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|updateExample}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef UpdateExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Example} [response] Example + */ + + /** + * Calls UpdateExample. + * @function updateExample + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IUpdateExampleRequest} request UpdateExampleRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.UpdateExampleCallback} callback Node-style callback called with the error, if any, and Example + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateExample = function updateExample(request, callback) { + return this.rpcCall(updateExample, $root.google.cloud.ces.v1.UpdateExampleRequest, $root.google.cloud.ces.v1.Example, request, callback); + }, "name", { value: "UpdateExample" }); + + /** + * Calls UpdateExample. + * @function updateExample + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IUpdateExampleRequest} request UpdateExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteExample}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef DeleteExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteExample. + * @function deleteExample + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IDeleteExampleRequest} request DeleteExampleRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.DeleteExampleCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteExample = function deleteExample(request, callback) { + return this.rpcCall(deleteExample, $root.google.cloud.ces.v1.DeleteExampleRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteExample" }); + + /** + * Calls DeleteExample. + * @function deleteExample + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IDeleteExampleRequest} request DeleteExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listTools}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef ListToolsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.ListToolsResponse} [response] ListToolsResponse + */ + + /** + * Calls ListTools. + * @function listTools + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListToolsRequest} request ListToolsRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.ListToolsCallback} callback Node-style callback called with the error, if any, and ListToolsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listTools = function listTools(request, callback) { + return this.rpcCall(listTools, $root.google.cloud.ces.v1.ListToolsRequest, $root.google.cloud.ces.v1.ListToolsResponse, request, callback); + }, "name", { value: "ListTools" }); + + /** + * Calls ListTools. + * @function listTools + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListToolsRequest} request ListToolsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getTool}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef GetToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Tool} [response] Tool + */ + + /** + * Calls GetTool. + * @function getTool + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetToolRequest} request GetToolRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.GetToolCallback} callback Node-style callback called with the error, if any, and Tool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getTool = function getTool(request, callback) { + return this.rpcCall(getTool, $root.google.cloud.ces.v1.GetToolRequest, $root.google.cloud.ces.v1.Tool, request, callback); + }, "name", { value: "GetTool" }); + + /** + * Calls GetTool. + * @function getTool + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetToolRequest} request GetToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listConversations}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef ListConversationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.ListConversationsResponse} [response] ListConversationsResponse + */ + + /** + * Calls ListConversations. + * @function listConversations + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListConversationsRequest} request ListConversationsRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.ListConversationsCallback} callback Node-style callback called with the error, if any, and ListConversationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listConversations = function listConversations(request, callback) { + return this.rpcCall(listConversations, $root.google.cloud.ces.v1.ListConversationsRequest, $root.google.cloud.ces.v1.ListConversationsResponse, request, callback); + }, "name", { value: "ListConversations" }); + + /** + * Calls ListConversations. + * @function listConversations + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListConversationsRequest} request ListConversationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getConversation}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef GetConversationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Conversation} [response] Conversation + */ + + /** + * Calls GetConversation. + * @function getConversation + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetConversationRequest} request GetConversationRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.GetConversationCallback} callback Node-style callback called with the error, if any, and Conversation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getConversation = function getConversation(request, callback) { + return this.rpcCall(getConversation, $root.google.cloud.ces.v1.GetConversationRequest, $root.google.cloud.ces.v1.Conversation, request, callback); + }, "name", { value: "GetConversation" }); + + /** + * Calls GetConversation. + * @function getConversation + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetConversationRequest} request GetConversationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteConversation}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef DeleteConversationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteConversation. + * @function deleteConversation + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IDeleteConversationRequest} request DeleteConversationRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.DeleteConversationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteConversation = function deleteConversation(request, callback) { + return this.rpcCall(deleteConversation, $root.google.cloud.ces.v1.DeleteConversationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteConversation" }); + + /** + * Calls DeleteConversation. + * @function deleteConversation + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IDeleteConversationRequest} request DeleteConversationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|batchDeleteConversations}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef BatchDeleteConversationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchDeleteConversations. + * @function batchDeleteConversations + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IBatchDeleteConversationsRequest} request BatchDeleteConversationsRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.BatchDeleteConversationsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.batchDeleteConversations = function batchDeleteConversations(request, callback) { + return this.rpcCall(batchDeleteConversations, $root.google.cloud.ces.v1.BatchDeleteConversationsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchDeleteConversations" }); + + /** + * Calls BatchDeleteConversations. + * @function batchDeleteConversations + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IBatchDeleteConversationsRequest} request BatchDeleteConversationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|createTool}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef CreateToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Tool} [response] Tool + */ + + /** + * Calls CreateTool. + * @function createTool + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.ICreateToolRequest} request CreateToolRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.CreateToolCallback} callback Node-style callback called with the error, if any, and Tool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createTool = function createTool(request, callback) { + return this.rpcCall(createTool, $root.google.cloud.ces.v1.CreateToolRequest, $root.google.cloud.ces.v1.Tool, request, callback); + }, "name", { value: "CreateTool" }); + + /** + * Calls CreateTool. + * @function createTool + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.ICreateToolRequest} request CreateToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|updateTool}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef UpdateToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Tool} [response] Tool + */ + + /** + * Calls UpdateTool. + * @function updateTool + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IUpdateToolRequest} request UpdateToolRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.UpdateToolCallback} callback Node-style callback called with the error, if any, and Tool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateTool = function updateTool(request, callback) { + return this.rpcCall(updateTool, $root.google.cloud.ces.v1.UpdateToolRequest, $root.google.cloud.ces.v1.Tool, request, callback); + }, "name", { value: "UpdateTool" }); + + /** + * Calls UpdateTool. + * @function updateTool + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IUpdateToolRequest} request UpdateToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteTool}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef DeleteToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTool. + * @function deleteTool + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IDeleteToolRequest} request DeleteToolRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.DeleteToolCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteTool = function deleteTool(request, callback) { + return this.rpcCall(deleteTool, $root.google.cloud.ces.v1.DeleteToolRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTool" }); + + /** + * Calls DeleteTool. + * @function deleteTool + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IDeleteToolRequest} request DeleteToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listGuardrails}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef ListGuardrailsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.ListGuardrailsResponse} [response] ListGuardrailsResponse + */ + + /** + * Calls ListGuardrails. + * @function listGuardrails + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListGuardrailsRequest} request ListGuardrailsRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.ListGuardrailsCallback} callback Node-style callback called with the error, if any, and ListGuardrailsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listGuardrails = function listGuardrails(request, callback) { + return this.rpcCall(listGuardrails, $root.google.cloud.ces.v1.ListGuardrailsRequest, $root.google.cloud.ces.v1.ListGuardrailsResponse, request, callback); + }, "name", { value: "ListGuardrails" }); + + /** + * Calls ListGuardrails. + * @function listGuardrails + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListGuardrailsRequest} request ListGuardrailsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getGuardrail}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef GetGuardrailCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Guardrail} [response] Guardrail + */ + + /** + * Calls GetGuardrail. + * @function getGuardrail + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetGuardrailRequest} request GetGuardrailRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.GetGuardrailCallback} callback Node-style callback called with the error, if any, and Guardrail + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getGuardrail = function getGuardrail(request, callback) { + return this.rpcCall(getGuardrail, $root.google.cloud.ces.v1.GetGuardrailRequest, $root.google.cloud.ces.v1.Guardrail, request, callback); + }, "name", { value: "GetGuardrail" }); + + /** + * Calls GetGuardrail. + * @function getGuardrail + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetGuardrailRequest} request GetGuardrailRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|createGuardrail}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef CreateGuardrailCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Guardrail} [response] Guardrail + */ + + /** + * Calls CreateGuardrail. + * @function createGuardrail + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.ICreateGuardrailRequest} request CreateGuardrailRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.CreateGuardrailCallback} callback Node-style callback called with the error, if any, and Guardrail + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createGuardrail = function createGuardrail(request, callback) { + return this.rpcCall(createGuardrail, $root.google.cloud.ces.v1.CreateGuardrailRequest, $root.google.cloud.ces.v1.Guardrail, request, callback); + }, "name", { value: "CreateGuardrail" }); + + /** + * Calls CreateGuardrail. + * @function createGuardrail + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.ICreateGuardrailRequest} request CreateGuardrailRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|updateGuardrail}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef UpdateGuardrailCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Guardrail} [response] Guardrail + */ + + /** + * Calls UpdateGuardrail. + * @function updateGuardrail + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IUpdateGuardrailRequest} request UpdateGuardrailRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.UpdateGuardrailCallback} callback Node-style callback called with the error, if any, and Guardrail + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateGuardrail = function updateGuardrail(request, callback) { + return this.rpcCall(updateGuardrail, $root.google.cloud.ces.v1.UpdateGuardrailRequest, $root.google.cloud.ces.v1.Guardrail, request, callback); + }, "name", { value: "UpdateGuardrail" }); + + /** + * Calls UpdateGuardrail. + * @function updateGuardrail + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IUpdateGuardrailRequest} request UpdateGuardrailRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteGuardrail}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef DeleteGuardrailCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteGuardrail. + * @function deleteGuardrail + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IDeleteGuardrailRequest} request DeleteGuardrailRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.DeleteGuardrailCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteGuardrail = function deleteGuardrail(request, callback) { + return this.rpcCall(deleteGuardrail, $root.google.cloud.ces.v1.DeleteGuardrailRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteGuardrail" }); + + /** + * Calls DeleteGuardrail. + * @function deleteGuardrail + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IDeleteGuardrailRequest} request DeleteGuardrailRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listDeployments}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef ListDeploymentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.ListDeploymentsResponse} [response] ListDeploymentsResponse + */ + + /** + * Calls ListDeployments. + * @function listDeployments + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.ListDeploymentsCallback} callback Node-style callback called with the error, if any, and ListDeploymentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listDeployments = function listDeployments(request, callback) { + return this.rpcCall(listDeployments, $root.google.cloud.ces.v1.ListDeploymentsRequest, $root.google.cloud.ces.v1.ListDeploymentsResponse, request, callback); + }, "name", { value: "ListDeployments" }); + + /** + * Calls ListDeployments. + * @function listDeployments + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getDeployment}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef GetDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Deployment} [response] Deployment + */ + + /** + * Calls GetDeployment. + * @function getDeployment + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetDeploymentRequest} request GetDeploymentRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.GetDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getDeployment = function getDeployment(request, callback) { + return this.rpcCall(getDeployment, $root.google.cloud.ces.v1.GetDeploymentRequest, $root.google.cloud.ces.v1.Deployment, request, callback); + }, "name", { value: "GetDeployment" }); + + /** + * Calls GetDeployment. + * @function getDeployment + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetDeploymentRequest} request GetDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|createDeployment}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef CreateDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Deployment} [response] Deployment + */ + + /** + * Calls CreateDeployment. + * @function createDeployment + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.ICreateDeploymentRequest} request CreateDeploymentRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.CreateDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createDeployment = function createDeployment(request, callback) { + return this.rpcCall(createDeployment, $root.google.cloud.ces.v1.CreateDeploymentRequest, $root.google.cloud.ces.v1.Deployment, request, callback); + }, "name", { value: "CreateDeployment" }); + + /** + * Calls CreateDeployment. + * @function createDeployment + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.ICreateDeploymentRequest} request CreateDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|updateDeployment}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef UpdateDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Deployment} [response] Deployment + */ + + /** + * Calls UpdateDeployment. + * @function updateDeployment + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IUpdateDeploymentRequest} request UpdateDeploymentRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.UpdateDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateDeployment = function updateDeployment(request, callback) { + return this.rpcCall(updateDeployment, $root.google.cloud.ces.v1.UpdateDeploymentRequest, $root.google.cloud.ces.v1.Deployment, request, callback); + }, "name", { value: "UpdateDeployment" }); + + /** + * Calls UpdateDeployment. + * @function updateDeployment + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IUpdateDeploymentRequest} request UpdateDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteDeployment}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef DeleteDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDeployment. + * @function deleteDeployment + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IDeleteDeploymentRequest} request DeleteDeploymentRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.DeleteDeploymentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteDeployment = function deleteDeployment(request, callback) { + return this.rpcCall(deleteDeployment, $root.google.cloud.ces.v1.DeleteDeploymentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDeployment" }); + + /** + * Calls DeleteDeployment. + * @function deleteDeployment + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IDeleteDeploymentRequest} request DeleteDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listToolsets}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef ListToolsetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.ListToolsetsResponse} [response] ListToolsetsResponse + */ + + /** + * Calls ListToolsets. + * @function listToolsets + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListToolsetsRequest} request ListToolsetsRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.ListToolsetsCallback} callback Node-style callback called with the error, if any, and ListToolsetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listToolsets = function listToolsets(request, callback) { + return this.rpcCall(listToolsets, $root.google.cloud.ces.v1.ListToolsetsRequest, $root.google.cloud.ces.v1.ListToolsetsResponse, request, callback); + }, "name", { value: "ListToolsets" }); + + /** + * Calls ListToolsets. + * @function listToolsets + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListToolsetsRequest} request ListToolsetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getToolset}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef GetToolsetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Toolset} [response] Toolset + */ + + /** + * Calls GetToolset. + * @function getToolset + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetToolsetRequest} request GetToolsetRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.GetToolsetCallback} callback Node-style callback called with the error, if any, and Toolset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getToolset = function getToolset(request, callback) { + return this.rpcCall(getToolset, $root.google.cloud.ces.v1.GetToolsetRequest, $root.google.cloud.ces.v1.Toolset, request, callback); + }, "name", { value: "GetToolset" }); + + /** + * Calls GetToolset. + * @function getToolset + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetToolsetRequest} request GetToolsetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|createToolset}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef CreateToolsetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Toolset} [response] Toolset + */ + + /** + * Calls CreateToolset. + * @function createToolset + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.ICreateToolsetRequest} request CreateToolsetRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.CreateToolsetCallback} callback Node-style callback called with the error, if any, and Toolset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createToolset = function createToolset(request, callback) { + return this.rpcCall(createToolset, $root.google.cloud.ces.v1.CreateToolsetRequest, $root.google.cloud.ces.v1.Toolset, request, callback); + }, "name", { value: "CreateToolset" }); + + /** + * Calls CreateToolset. + * @function createToolset + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.ICreateToolsetRequest} request CreateToolsetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|updateToolset}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef UpdateToolsetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Toolset} [response] Toolset + */ + + /** + * Calls UpdateToolset. + * @function updateToolset + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IUpdateToolsetRequest} request UpdateToolsetRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.UpdateToolsetCallback} callback Node-style callback called with the error, if any, and Toolset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateToolset = function updateToolset(request, callback) { + return this.rpcCall(updateToolset, $root.google.cloud.ces.v1.UpdateToolsetRequest, $root.google.cloud.ces.v1.Toolset, request, callback); + }, "name", { value: "UpdateToolset" }); + + /** + * Calls UpdateToolset. + * @function updateToolset + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IUpdateToolsetRequest} request UpdateToolsetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteToolset}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef DeleteToolsetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteToolset. + * @function deleteToolset + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IDeleteToolsetRequest} request DeleteToolsetRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.DeleteToolsetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteToolset = function deleteToolset(request, callback) { + return this.rpcCall(deleteToolset, $root.google.cloud.ces.v1.DeleteToolsetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteToolset" }); + + /** + * Calls DeleteToolset. + * @function deleteToolset + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IDeleteToolsetRequest} request DeleteToolsetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listAppVersions}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef ListAppVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.ListAppVersionsResponse} [response] ListAppVersionsResponse + */ + + /** + * Calls ListAppVersions. + * @function listAppVersions + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListAppVersionsRequest} request ListAppVersionsRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.ListAppVersionsCallback} callback Node-style callback called with the error, if any, and ListAppVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listAppVersions = function listAppVersions(request, callback) { + return this.rpcCall(listAppVersions, $root.google.cloud.ces.v1.ListAppVersionsRequest, $root.google.cloud.ces.v1.ListAppVersionsResponse, request, callback); + }, "name", { value: "ListAppVersions" }); + + /** + * Calls ListAppVersions. + * @function listAppVersions + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListAppVersionsRequest} request ListAppVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getAppVersion}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef GetAppVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.AppVersion} [response] AppVersion + */ + + /** + * Calls GetAppVersion. + * @function getAppVersion + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetAppVersionRequest} request GetAppVersionRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.GetAppVersionCallback} callback Node-style callback called with the error, if any, and AppVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getAppVersion = function getAppVersion(request, callback) { + return this.rpcCall(getAppVersion, $root.google.cloud.ces.v1.GetAppVersionRequest, $root.google.cloud.ces.v1.AppVersion, request, callback); + }, "name", { value: "GetAppVersion" }); + + /** + * Calls GetAppVersion. + * @function getAppVersion + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetAppVersionRequest} request GetAppVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|createAppVersion}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef CreateAppVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.AppVersion} [response] AppVersion + */ + + /** + * Calls CreateAppVersion. + * @function createAppVersion + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.ICreateAppVersionRequest} request CreateAppVersionRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.CreateAppVersionCallback} callback Node-style callback called with the error, if any, and AppVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createAppVersion = function createAppVersion(request, callback) { + return this.rpcCall(createAppVersion, $root.google.cloud.ces.v1.CreateAppVersionRequest, $root.google.cloud.ces.v1.AppVersion, request, callback); + }, "name", { value: "CreateAppVersion" }); + + /** + * Calls CreateAppVersion. + * @function createAppVersion + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.ICreateAppVersionRequest} request CreateAppVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteAppVersion}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef DeleteAppVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAppVersion. + * @function deleteAppVersion + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IDeleteAppVersionRequest} request DeleteAppVersionRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.DeleteAppVersionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteAppVersion = function deleteAppVersion(request, callback) { + return this.rpcCall(deleteAppVersion, $root.google.cloud.ces.v1.DeleteAppVersionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAppVersion" }); + + /** + * Calls DeleteAppVersion. + * @function deleteAppVersion + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IDeleteAppVersionRequest} request DeleteAppVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|restoreAppVersion}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef RestoreAppVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreAppVersion. + * @function restoreAppVersion + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IRestoreAppVersionRequest} request RestoreAppVersionRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.RestoreAppVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.restoreAppVersion = function restoreAppVersion(request, callback) { + return this.rpcCall(restoreAppVersion, $root.google.cloud.ces.v1.RestoreAppVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreAppVersion" }); + + /** + * Calls RestoreAppVersion. + * @function restoreAppVersion + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IRestoreAppVersionRequest} request RestoreAppVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|listChangelogs}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef ListChangelogsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.ListChangelogsResponse} [response] ListChangelogsResponse + */ + + /** + * Calls ListChangelogs. + * @function listChangelogs + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListChangelogsRequest} request ListChangelogsRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.ListChangelogsCallback} callback Node-style callback called with the error, if any, and ListChangelogsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listChangelogs = function listChangelogs(request, callback) { + return this.rpcCall(listChangelogs, $root.google.cloud.ces.v1.ListChangelogsRequest, $root.google.cloud.ces.v1.ListChangelogsResponse, request, callback); + }, "name", { value: "ListChangelogs" }); + + /** + * Calls ListChangelogs. + * @function listChangelogs + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IListChangelogsRequest} request ListChangelogsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.AgentService|getChangelog}. + * @memberof google.cloud.ces.v1.AgentService + * @typedef GetChangelogCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.Changelog} [response] Changelog + */ + + /** + * Calls GetChangelog. + * @function getChangelog + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetChangelogRequest} request GetChangelogRequest message or plain object + * @param {google.cloud.ces.v1.AgentService.GetChangelogCallback} callback Node-style callback called with the error, if any, and Changelog + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getChangelog = function getChangelog(request, callback) { + return this.rpcCall(getChangelog, $root.google.cloud.ces.v1.GetChangelogRequest, $root.google.cloud.ces.v1.Changelog, request, callback); + }, "name", { value: "GetChangelog" }); + + /** + * Calls GetChangelog. + * @function getChangelog + * @memberof google.cloud.ces.v1.AgentService + * @instance + * @param {google.cloud.ces.v1.IGetChangelogRequest} request GetChangelogRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AgentService; + })(); + + v1.ListAppsRequest = (function() { + + /** + * Properties of a ListAppsRequest. + * @memberof google.cloud.ces.v1 + * @interface IListAppsRequest + * @property {string|null} [parent] ListAppsRequest parent + * @property {number|null} [pageSize] ListAppsRequest pageSize + * @property {string|null} [pageToken] ListAppsRequest pageToken + * @property {string|null} [filter] ListAppsRequest filter + * @property {string|null} [orderBy] ListAppsRequest orderBy + */ + + /** + * Constructs a new ListAppsRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListAppsRequest. + * @implements IListAppsRequest + * @constructor + * @param {google.cloud.ces.v1.IListAppsRequest=} [properties] Properties to set + */ + function ListAppsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAppsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.ListAppsRequest + * @instance + */ + ListAppsRequest.prototype.parent = ""; + + /** + * ListAppsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1.ListAppsRequest + * @instance + */ + ListAppsRequest.prototype.pageSize = 0; + + /** + * ListAppsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1.ListAppsRequest + * @instance + */ + ListAppsRequest.prototype.pageToken = ""; + + /** + * ListAppsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1.ListAppsRequest + * @instance + */ + ListAppsRequest.prototype.filter = ""; + + /** + * ListAppsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1.ListAppsRequest + * @instance + */ + ListAppsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListAppsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListAppsRequest + * @static + * @param {google.cloud.ces.v1.IListAppsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListAppsRequest} ListAppsRequest instance + */ + ListAppsRequest.create = function create(properties) { + return new ListAppsRequest(properties); + }; + + /** + * Encodes the specified ListAppsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListAppsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListAppsRequest + * @static + * @param {google.cloud.ces.v1.IListAppsRequest} message ListAppsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppsRequest.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 ListAppsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAppsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListAppsRequest + * @static + * @param {google.cloud.ces.v1.IListAppsRequest} message ListAppsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAppsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListAppsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListAppsRequest} ListAppsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListAppsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAppsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListAppsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListAppsRequest} ListAppsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAppsRequest message. + * @function verify + * @memberof google.cloud.ces.v1.ListAppsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAppsRequest.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 ListAppsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListAppsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListAppsRequest} ListAppsRequest + */ + ListAppsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListAppsRequest) + return object; + var message = new $root.google.cloud.ces.v1.ListAppsRequest(); + 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 ListAppsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListAppsRequest + * @static + * @param {google.cloud.ces.v1.ListAppsRequest} message ListAppsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAppsRequest.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 ListAppsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListAppsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAppsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAppsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListAppsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAppsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListAppsRequest"; + }; + + return ListAppsRequest; + })(); + + v1.ListAppsResponse = (function() { + + /** + * Properties of a ListAppsResponse. + * @memberof google.cloud.ces.v1 + * @interface IListAppsResponse + * @property {Array.|null} [apps] ListAppsResponse apps + * @property {string|null} [nextPageToken] ListAppsResponse nextPageToken + * @property {Array.|null} [unreachable] ListAppsResponse unreachable + */ + + /** + * Constructs a new ListAppsResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListAppsResponse. + * @implements IListAppsResponse + * @constructor + * @param {google.cloud.ces.v1.IListAppsResponse=} [properties] Properties to set + */ + function ListAppsResponse(properties) { + this.apps = []; + 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]]; + } + + /** + * ListAppsResponse apps. + * @member {Array.} apps + * @memberof google.cloud.ces.v1.ListAppsResponse + * @instance + */ + ListAppsResponse.prototype.apps = $util.emptyArray; + + /** + * ListAppsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1.ListAppsResponse + * @instance + */ + ListAppsResponse.prototype.nextPageToken = ""; + + /** + * ListAppsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.ces.v1.ListAppsResponse + * @instance + */ + ListAppsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListAppsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListAppsResponse + * @static + * @param {google.cloud.ces.v1.IListAppsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListAppsResponse} ListAppsResponse instance + */ + ListAppsResponse.create = function create(properties) { + return new ListAppsResponse(properties); + }; + + /** + * Encodes the specified ListAppsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListAppsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListAppsResponse + * @static + * @param {google.cloud.ces.v1.IListAppsResponse} message ListAppsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apps != null && message.apps.length) + for (var i = 0; i < message.apps.length; ++i) + $root.google.cloud.ces.v1.App.encode(message.apps[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 ListAppsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAppsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListAppsResponse + * @static + * @param {google.cloud.ces.v1.IListAppsResponse} message ListAppsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAppsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListAppsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListAppsResponse} ListAppsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListAppsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.apps && message.apps.length)) + message.apps = []; + message.apps.push($root.google.cloud.ces.v1.App.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 ListAppsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListAppsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListAppsResponse} ListAppsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAppsResponse message. + * @function verify + * @memberof google.cloud.ces.v1.ListAppsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAppsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apps != null && message.hasOwnProperty("apps")) { + if (!Array.isArray(message.apps)) + return "apps: array expected"; + for (var i = 0; i < message.apps.length; ++i) { + var error = $root.google.cloud.ces.v1.App.verify(message.apps[i]); + if (error) + return "apps." + 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 ListAppsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListAppsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListAppsResponse} ListAppsResponse + */ + ListAppsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListAppsResponse) + return object; + var message = new $root.google.cloud.ces.v1.ListAppsResponse(); + if (object.apps) { + if (!Array.isArray(object.apps)) + throw TypeError(".google.cloud.ces.v1.ListAppsResponse.apps: array expected"); + message.apps = []; + for (var i = 0; i < object.apps.length; ++i) { + if (typeof object.apps[i] !== "object") + throw TypeError(".google.cloud.ces.v1.ListAppsResponse.apps: object expected"); + message.apps[i] = $root.google.cloud.ces.v1.App.fromObject(object.apps[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.ces.v1.ListAppsResponse.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 ListAppsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListAppsResponse + * @static + * @param {google.cloud.ces.v1.ListAppsResponse} message ListAppsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAppsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.apps = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.apps && message.apps.length) { + object.apps = []; + for (var j = 0; j < message.apps.length; ++j) + object.apps[j] = $root.google.cloud.ces.v1.App.toObject(message.apps[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 ListAppsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListAppsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAppsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAppsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListAppsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAppsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListAppsResponse"; + }; + + return ListAppsResponse; + })(); + + v1.GetAppRequest = (function() { + + /** + * Properties of a GetAppRequest. + * @memberof google.cloud.ces.v1 + * @interface IGetAppRequest + * @property {string|null} [name] GetAppRequest name + */ + + /** + * Constructs a new GetAppRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a GetAppRequest. + * @implements IGetAppRequest + * @constructor + * @param {google.cloud.ces.v1.IGetAppRequest=} [properties] Properties to set + */ + function GetAppRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAppRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.GetAppRequest + * @instance + */ + GetAppRequest.prototype.name = ""; + + /** + * Creates a new GetAppRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.GetAppRequest + * @static + * @param {google.cloud.ces.v1.IGetAppRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.GetAppRequest} GetAppRequest instance + */ + GetAppRequest.create = function create(properties) { + return new GetAppRequest(properties); + }; + + /** + * Encodes the specified GetAppRequest message. Does not implicitly {@link google.cloud.ces.v1.GetAppRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.GetAppRequest + * @static + * @param {google.cloud.ces.v1.IGetAppRequest} message GetAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAppRequest.encode = function encode(message, writer) { + 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 GetAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetAppRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.GetAppRequest + * @static + * @param {google.cloud.ces.v1.IGetAppRequest} message GetAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAppRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAppRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.GetAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.GetAppRequest} GetAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAppRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetAppRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAppRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.GetAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.GetAppRequest} GetAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAppRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAppRequest message. + * @function verify + * @memberof google.cloud.ces.v1.GetAppRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAppRequest.verify = function verify(message) { + if (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 GetAppRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.GetAppRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.GetAppRequest} GetAppRequest + */ + GetAppRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.GetAppRequest) + return object; + var message = new $root.google.cloud.ces.v1.GetAppRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAppRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.GetAppRequest + * @static + * @param {google.cloud.ces.v1.GetAppRequest} message GetAppRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAppRequest.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 GetAppRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.GetAppRequest + * @instance + * @returns {Object.} JSON object + */ + GetAppRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAppRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.GetAppRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.GetAppRequest"; + }; + + return GetAppRequest; + })(); + + v1.CreateAppRequest = (function() { + + /** + * Properties of a CreateAppRequest. + * @memberof google.cloud.ces.v1 + * @interface ICreateAppRequest + * @property {string|null} [parent] CreateAppRequest parent + * @property {string|null} [appId] CreateAppRequest appId + * @property {google.cloud.ces.v1.IApp|null} [app] CreateAppRequest app + */ + + /** + * Constructs a new CreateAppRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a CreateAppRequest. + * @implements ICreateAppRequest + * @constructor + * @param {google.cloud.ces.v1.ICreateAppRequest=} [properties] Properties to set + */ + function CreateAppRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAppRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.CreateAppRequest + * @instance + */ + CreateAppRequest.prototype.parent = ""; + + /** + * CreateAppRequest appId. + * @member {string} appId + * @memberof google.cloud.ces.v1.CreateAppRequest + * @instance + */ + CreateAppRequest.prototype.appId = ""; + + /** + * CreateAppRequest app. + * @member {google.cloud.ces.v1.IApp|null|undefined} app + * @memberof google.cloud.ces.v1.CreateAppRequest + * @instance + */ + CreateAppRequest.prototype.app = null; + + /** + * Creates a new CreateAppRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.CreateAppRequest + * @static + * @param {google.cloud.ces.v1.ICreateAppRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.CreateAppRequest} CreateAppRequest instance + */ + CreateAppRequest.create = function create(properties) { + return new CreateAppRequest(properties); + }; + + /** + * Encodes the specified CreateAppRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateAppRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.CreateAppRequest + * @static + * @param {google.cloud.ces.v1.ICreateAppRequest} message CreateAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAppRequest.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.appId != null && Object.hasOwnProperty.call(message, "appId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appId); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + $root.google.cloud.ces.v1.App.encode(message.app, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateAppRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.CreateAppRequest + * @static + * @param {google.cloud.ces.v1.ICreateAppRequest} message CreateAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAppRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAppRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.CreateAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.CreateAppRequest} CreateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAppRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CreateAppRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.appId = reader.string(); + break; + } + case 3: { + message.app = $root.google.cloud.ces.v1.App.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAppRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.CreateAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.CreateAppRequest} CreateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAppRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAppRequest message. + * @function verify + * @memberof google.cloud.ces.v1.CreateAppRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAppRequest.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.appId != null && message.hasOwnProperty("appId")) + if (!$util.isString(message.appId)) + return "appId: string expected"; + if (message.app != null && message.hasOwnProperty("app")) { + var error = $root.google.cloud.ces.v1.App.verify(message.app); + if (error) + return "app." + error; + } + return null; + }; + + /** + * Creates a CreateAppRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.CreateAppRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.CreateAppRequest} CreateAppRequest + */ + CreateAppRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.CreateAppRequest) + return object; + var message = new $root.google.cloud.ces.v1.CreateAppRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.appId != null) + message.appId = String(object.appId); + if (object.app != null) { + if (typeof object.app !== "object") + throw TypeError(".google.cloud.ces.v1.CreateAppRequest.app: object expected"); + message.app = $root.google.cloud.ces.v1.App.fromObject(object.app); + } + return message; + }; + + /** + * Creates a plain object from a CreateAppRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.CreateAppRequest + * @static + * @param {google.cloud.ces.v1.CreateAppRequest} message CreateAppRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAppRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.appId = ""; + object.app = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.appId != null && message.hasOwnProperty("appId")) + object.appId = message.appId; + if (message.app != null && message.hasOwnProperty("app")) + object.app = $root.google.cloud.ces.v1.App.toObject(message.app, options); + return object; + }; + + /** + * Converts this CreateAppRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.CreateAppRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAppRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAppRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.CreateAppRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.CreateAppRequest"; + }; + + return CreateAppRequest; + })(); + + v1.UpdateAppRequest = (function() { + + /** + * Properties of an UpdateAppRequest. + * @memberof google.cloud.ces.v1 + * @interface IUpdateAppRequest + * @property {google.cloud.ces.v1.IApp|null} [app] UpdateAppRequest app + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAppRequest updateMask + */ + + /** + * Constructs a new UpdateAppRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an UpdateAppRequest. + * @implements IUpdateAppRequest + * @constructor + * @param {google.cloud.ces.v1.IUpdateAppRequest=} [properties] Properties to set + */ + function UpdateAppRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAppRequest app. + * @member {google.cloud.ces.v1.IApp|null|undefined} app + * @memberof google.cloud.ces.v1.UpdateAppRequest + * @instance + */ + UpdateAppRequest.prototype.app = null; + + /** + * UpdateAppRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1.UpdateAppRequest + * @instance + */ + UpdateAppRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAppRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.UpdateAppRequest + * @static + * @param {google.cloud.ces.v1.IUpdateAppRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.UpdateAppRequest} UpdateAppRequest instance + */ + UpdateAppRequest.create = function create(properties) { + return new UpdateAppRequest(properties); + }; + + /** + * Encodes the specified UpdateAppRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateAppRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.UpdateAppRequest + * @static + * @param {google.cloud.ces.v1.IUpdateAppRequest} message UpdateAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAppRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + $root.google.cloud.ces.v1.App.encode(message.app, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateAppRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.UpdateAppRequest + * @static + * @param {google.cloud.ces.v1.IUpdateAppRequest} message UpdateAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAppRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAppRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.UpdateAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.UpdateAppRequest} UpdateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAppRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.UpdateAppRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.app = $root.google.cloud.ces.v1.App.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAppRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.UpdateAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.UpdateAppRequest} UpdateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAppRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAppRequest message. + * @function verify + * @memberof google.cloud.ces.v1.UpdateAppRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAppRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.app != null && message.hasOwnProperty("app")) { + var error = $root.google.cloud.ces.v1.App.verify(message.app); + if (error) + return "app." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateAppRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.UpdateAppRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.UpdateAppRequest} UpdateAppRequest + */ + UpdateAppRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.UpdateAppRequest) + return object; + var message = new $root.google.cloud.ces.v1.UpdateAppRequest(); + if (object.app != null) { + if (typeof object.app !== "object") + throw TypeError(".google.cloud.ces.v1.UpdateAppRequest.app: object expected"); + message.app = $root.google.cloud.ces.v1.App.fromObject(object.app); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1.UpdateAppRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAppRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.UpdateAppRequest + * @static + * @param {google.cloud.ces.v1.UpdateAppRequest} message UpdateAppRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAppRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.app = null; + object.updateMask = null; + } + if (message.app != null && message.hasOwnProperty("app")) + object.app = $root.google.cloud.ces.v1.App.toObject(message.app, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAppRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.UpdateAppRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAppRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAppRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.UpdateAppRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.UpdateAppRequest"; + }; + + return UpdateAppRequest; + })(); + + v1.DeleteAppRequest = (function() { + + /** + * Properties of a DeleteAppRequest. + * @memberof google.cloud.ces.v1 + * @interface IDeleteAppRequest + * @property {string|null} [name] DeleteAppRequest name + * @property {string|null} [etag] DeleteAppRequest etag + */ + + /** + * Constructs a new DeleteAppRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a DeleteAppRequest. + * @implements IDeleteAppRequest + * @constructor + * @param {google.cloud.ces.v1.IDeleteAppRequest=} [properties] Properties to set + */ + function DeleteAppRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAppRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.DeleteAppRequest + * @instance + */ + DeleteAppRequest.prototype.name = ""; + + /** + * DeleteAppRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1.DeleteAppRequest + * @instance + */ + DeleteAppRequest.prototype.etag = ""; + + /** + * Creates a new DeleteAppRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DeleteAppRequest + * @static + * @param {google.cloud.ces.v1.IDeleteAppRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DeleteAppRequest} DeleteAppRequest instance + */ + DeleteAppRequest.create = function create(properties) { + return new DeleteAppRequest(properties); + }; + + /** + * Encodes the specified DeleteAppRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteAppRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DeleteAppRequest + * @static + * @param {google.cloud.ces.v1.IDeleteAppRequest} message DeleteAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAppRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteAppRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DeleteAppRequest + * @static + * @param {google.cloud.ces.v1.IDeleteAppRequest} message DeleteAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAppRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAppRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DeleteAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DeleteAppRequest} DeleteAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAppRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DeleteAppRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAppRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DeleteAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DeleteAppRequest} DeleteAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAppRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAppRequest message. + * @function verify + * @memberof google.cloud.ces.v1.DeleteAppRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAppRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteAppRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DeleteAppRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DeleteAppRequest} DeleteAppRequest + */ + DeleteAppRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DeleteAppRequest) + return object; + var message = new $root.google.cloud.ces.v1.DeleteAppRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteAppRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DeleteAppRequest + * @static + * @param {google.cloud.ces.v1.DeleteAppRequest} message DeleteAppRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAppRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteAppRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DeleteAppRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAppRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAppRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DeleteAppRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DeleteAppRequest"; + }; + + return DeleteAppRequest; + })(); + + v1.ExportAppRequest = (function() { + + /** + * Properties of an ExportAppRequest. + * @memberof google.cloud.ces.v1 + * @interface IExportAppRequest + * @property {string|null} [name] ExportAppRequest name + * @property {google.cloud.ces.v1.ExportAppRequest.ExportFormat|null} [exportFormat] ExportAppRequest exportFormat + * @property {string|null} [gcsUri] ExportAppRequest gcsUri + */ + + /** + * Constructs a new ExportAppRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an ExportAppRequest. + * @implements IExportAppRequest + * @constructor + * @param {google.cloud.ces.v1.IExportAppRequest=} [properties] Properties to set + */ + function ExportAppRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportAppRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.ExportAppRequest + * @instance + */ + ExportAppRequest.prototype.name = ""; + + /** + * ExportAppRequest exportFormat. + * @member {google.cloud.ces.v1.ExportAppRequest.ExportFormat} exportFormat + * @memberof google.cloud.ces.v1.ExportAppRequest + * @instance + */ + ExportAppRequest.prototype.exportFormat = 0; + + /** + * ExportAppRequest gcsUri. + * @member {string} gcsUri + * @memberof google.cloud.ces.v1.ExportAppRequest + * @instance + */ + ExportAppRequest.prototype.gcsUri = ""; + + /** + * Creates a new ExportAppRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ExportAppRequest + * @static + * @param {google.cloud.ces.v1.IExportAppRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ExportAppRequest} ExportAppRequest instance + */ + ExportAppRequest.create = function create(properties) { + return new ExportAppRequest(properties); + }; + + /** + * Encodes the specified ExportAppRequest message. Does not implicitly {@link google.cloud.ces.v1.ExportAppRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ExportAppRequest + * @static + * @param {google.cloud.ces.v1.IExportAppRequest} message ExportAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAppRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.exportFormat != null && Object.hasOwnProperty.call(message, "exportFormat")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.exportFormat); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsUri); + return writer; + }; + + /** + * Encodes the specified ExportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExportAppRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ExportAppRequest + * @static + * @param {google.cloud.ces.v1.IExportAppRequest} message ExportAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAppRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAppRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ExportAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ExportAppRequest} ExportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAppRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ExportAppRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.exportFormat = reader.int32(); + break; + } + case 3: { + message.gcsUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAppRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ExportAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ExportAppRequest} ExportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAppRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAppRequest message. + * @function verify + * @memberof google.cloud.ces.v1.ExportAppRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAppRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.exportFormat != null && message.hasOwnProperty("exportFormat")) + switch (message.exportFormat) { + default: + return "exportFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + return null; + }; + + /** + * Creates an ExportAppRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ExportAppRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ExportAppRequest} ExportAppRequest + */ + ExportAppRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ExportAppRequest) + return object; + var message = new $root.google.cloud.ces.v1.ExportAppRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.exportFormat) { + default: + if (typeof object.exportFormat === "number") { + message.exportFormat = object.exportFormat; + break; + } + break; + case "EXPORT_FORMAT_UNSPECIFIED": + case 0: + message.exportFormat = 0; + break; + case "JSON": + case 1: + message.exportFormat = 1; + break; + case "YAML": + case 2: + message.exportFormat = 2; + break; + } + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + return message; + }; + + /** + * Creates a plain object from an ExportAppRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ExportAppRequest + * @static + * @param {google.cloud.ces.v1.ExportAppRequest} message ExportAppRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAppRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.exportFormat = options.enums === String ? "EXPORT_FORMAT_UNSPECIFIED" : 0; + object.gcsUri = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.exportFormat != null && message.hasOwnProperty("exportFormat")) + object.exportFormat = options.enums === String ? $root.google.cloud.ces.v1.ExportAppRequest.ExportFormat[message.exportFormat] === undefined ? message.exportFormat : $root.google.cloud.ces.v1.ExportAppRequest.ExportFormat[message.exportFormat] : message.exportFormat; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + object.gcsUri = message.gcsUri; + return object; + }; + + /** + * Converts this ExportAppRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ExportAppRequest + * @instance + * @returns {Object.} JSON object + */ + ExportAppRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportAppRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ExportAppRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ExportAppRequest"; + }; + + /** + * ExportFormat enum. + * @name google.cloud.ces.v1.ExportAppRequest.ExportFormat + * @enum {number} + * @property {number} EXPORT_FORMAT_UNSPECIFIED=0 EXPORT_FORMAT_UNSPECIFIED value + * @property {number} JSON=1 JSON value + * @property {number} YAML=2 YAML value + */ + ExportAppRequest.ExportFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXPORT_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "JSON"] = 1; + values[valuesById[2] = "YAML"] = 2; + return values; + })(); + + return ExportAppRequest; + })(); + + v1.ExportAppResponse = (function() { + + /** + * Properties of an ExportAppResponse. + * @memberof google.cloud.ces.v1 + * @interface IExportAppResponse + * @property {Uint8Array|null} [appContent] ExportAppResponse appContent + * @property {string|null} [appUri] ExportAppResponse appUri + */ + + /** + * Constructs a new ExportAppResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an ExportAppResponse. + * @implements IExportAppResponse + * @constructor + * @param {google.cloud.ces.v1.IExportAppResponse=} [properties] Properties to set + */ + function ExportAppResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportAppResponse appContent. + * @member {Uint8Array|null|undefined} appContent + * @memberof google.cloud.ces.v1.ExportAppResponse + * @instance + */ + ExportAppResponse.prototype.appContent = null; + + /** + * ExportAppResponse appUri. + * @member {string|null|undefined} appUri + * @memberof google.cloud.ces.v1.ExportAppResponse + * @instance + */ + ExportAppResponse.prototype.appUri = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportAppResponse app. + * @member {"appContent"|"appUri"|undefined} app + * @memberof google.cloud.ces.v1.ExportAppResponse + * @instance + */ + Object.defineProperty(ExportAppResponse.prototype, "app", { + get: $util.oneOfGetter($oneOfFields = ["appContent", "appUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportAppResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ExportAppResponse + * @static + * @param {google.cloud.ces.v1.IExportAppResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ExportAppResponse} ExportAppResponse instance + */ + ExportAppResponse.create = function create(properties) { + return new ExportAppResponse(properties); + }; + + /** + * Encodes the specified ExportAppResponse message. Does not implicitly {@link google.cloud.ces.v1.ExportAppResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ExportAppResponse + * @static + * @param {google.cloud.ces.v1.IExportAppResponse} message ExportAppResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAppResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appContent != null && Object.hasOwnProperty.call(message, "appContent")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.appContent); + if (message.appUri != null && Object.hasOwnProperty.call(message, "appUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appUri); + return writer; + }; + + /** + * Encodes the specified ExportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExportAppResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ExportAppResponse + * @static + * @param {google.cloud.ces.v1.IExportAppResponse} message ExportAppResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAppResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAppResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ExportAppResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ExportAppResponse} ExportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAppResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ExportAppResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.appContent = reader.bytes(); + break; + } + case 2: { + message.appUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAppResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ExportAppResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ExportAppResponse} ExportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAppResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAppResponse message. + * @function verify + * @memberof google.cloud.ces.v1.ExportAppResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAppResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.appContent != null && message.hasOwnProperty("appContent")) { + properties.app = 1; + if (!(message.appContent && typeof message.appContent.length === "number" || $util.isString(message.appContent))) + return "appContent: buffer expected"; + } + if (message.appUri != null && message.hasOwnProperty("appUri")) { + if (properties.app === 1) + return "app: multiple values"; + properties.app = 1; + if (!$util.isString(message.appUri)) + return "appUri: string expected"; + } + return null; + }; + + /** + * Creates an ExportAppResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ExportAppResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ExportAppResponse} ExportAppResponse + */ + ExportAppResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ExportAppResponse) + return object; + var message = new $root.google.cloud.ces.v1.ExportAppResponse(); + if (object.appContent != null) + if (typeof object.appContent === "string") + $util.base64.decode(object.appContent, message.appContent = $util.newBuffer($util.base64.length(object.appContent)), 0); + else if (object.appContent.length >= 0) + message.appContent = object.appContent; + if (object.appUri != null) + message.appUri = String(object.appUri); + return message; + }; + + /** + * Creates a plain object from an ExportAppResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ExportAppResponse + * @static + * @param {google.cloud.ces.v1.ExportAppResponse} message ExportAppResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAppResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.appContent != null && message.hasOwnProperty("appContent")) { + object.appContent = options.bytes === String ? $util.base64.encode(message.appContent, 0, message.appContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.appContent) : message.appContent; + if (options.oneofs) + object.app = "appContent"; + } + if (message.appUri != null && message.hasOwnProperty("appUri")) { + object.appUri = message.appUri; + if (options.oneofs) + object.app = "appUri"; + } + return object; + }; + + /** + * Converts this ExportAppResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ExportAppResponse + * @instance + * @returns {Object.} JSON object + */ + ExportAppResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportAppResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ExportAppResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportAppResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ExportAppResponse"; + }; + + return ExportAppResponse; + })(); + + v1.ImportAppRequest = (function() { + + /** + * Properties of an ImportAppRequest. + * @memberof google.cloud.ces.v1 + * @interface IImportAppRequest + * @property {string|null} [gcsUri] ImportAppRequest gcsUri + * @property {Uint8Array|null} [appContent] ImportAppRequest appContent + * @property {string|null} [parent] ImportAppRequest parent + * @property {string|null} [displayName] ImportAppRequest displayName + * @property {string|null} [appId] ImportAppRequest appId + * @property {google.cloud.ces.v1.ImportAppRequest.IImportOptions|null} [importOptions] ImportAppRequest importOptions + * @property {boolean|null} [ignoreAppLock] ImportAppRequest ignoreAppLock + */ + + /** + * Constructs a new ImportAppRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an ImportAppRequest. + * @implements IImportAppRequest + * @constructor + * @param {google.cloud.ces.v1.IImportAppRequest=} [properties] Properties to set + */ + function ImportAppRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportAppRequest gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.ces.v1.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.gcsUri = null; + + /** + * ImportAppRequest appContent. + * @member {Uint8Array|null|undefined} appContent + * @memberof google.cloud.ces.v1.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.appContent = null; + + /** + * ImportAppRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.parent = ""; + + /** + * ImportAppRequest displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.displayName = ""; + + /** + * ImportAppRequest appId. + * @member {string} appId + * @memberof google.cloud.ces.v1.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.appId = ""; + + /** + * ImportAppRequest importOptions. + * @member {google.cloud.ces.v1.ImportAppRequest.IImportOptions|null|undefined} importOptions + * @memberof google.cloud.ces.v1.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.importOptions = null; + + /** + * ImportAppRequest ignoreAppLock. + * @member {boolean} ignoreAppLock + * @memberof google.cloud.ces.v1.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.ignoreAppLock = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportAppRequest app. + * @member {"gcsUri"|"appContent"|undefined} app + * @memberof google.cloud.ces.v1.ImportAppRequest + * @instance + */ + Object.defineProperty(ImportAppRequest.prototype, "app", { + get: $util.oneOfGetter($oneOfFields = ["gcsUri", "appContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportAppRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ImportAppRequest + * @static + * @param {google.cloud.ces.v1.IImportAppRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ImportAppRequest} ImportAppRequest instance + */ + ImportAppRequest.create = function create(properties) { + return new ImportAppRequest(properties); + }; + + /** + * Encodes the specified ImportAppRequest message. Does not implicitly {@link google.cloud.ces.v1.ImportAppRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ImportAppRequest + * @static + * @param {google.cloud.ces.v1.IImportAppRequest} message ImportAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportAppRequest.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.appId != null && Object.hasOwnProperty.call(message, "appId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.appId); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.gcsUri); + if (message.appContent != null && Object.hasOwnProperty.call(message, "appContent")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.appContent); + if (message.importOptions != null && Object.hasOwnProperty.call(message, "importOptions")) + $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions.encode(message.importOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.ignoreAppLock != null && Object.hasOwnProperty.call(message, "ignoreAppLock")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.ignoreAppLock); + return writer; + }; + + /** + * Encodes the specified ImportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ImportAppRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ImportAppRequest + * @static + * @param {google.cloud.ces.v1.IImportAppRequest} message ImportAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportAppRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportAppRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ImportAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ImportAppRequest} ImportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportAppRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ImportAppRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.gcsUri = reader.string(); + break; + } + case 5: { + message.appContent = reader.bytes(); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.appId = reader.string(); + break; + } + case 6: { + message.importOptions = $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions.decode(reader, reader.uint32()); + break; + } + case 7: { + message.ignoreAppLock = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportAppRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ImportAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ImportAppRequest} ImportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportAppRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportAppRequest message. + * @function verify + * @memberof google.cloud.ces.v1.ImportAppRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportAppRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + properties.app = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + if (message.appContent != null && message.hasOwnProperty("appContent")) { + if (properties.app === 1) + return "app: multiple values"; + properties.app = 1; + if (!(message.appContent && typeof message.appContent.length === "number" || $util.isString(message.appContent))) + return "appContent: buffer expected"; + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.appId != null && message.hasOwnProperty("appId")) + if (!$util.isString(message.appId)) + return "appId: string expected"; + if (message.importOptions != null && message.hasOwnProperty("importOptions")) { + var error = $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions.verify(message.importOptions); + if (error) + return "importOptions." + error; + } + if (message.ignoreAppLock != null && message.hasOwnProperty("ignoreAppLock")) + if (typeof message.ignoreAppLock !== "boolean") + return "ignoreAppLock: boolean expected"; + return null; + }; + + /** + * Creates an ImportAppRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ImportAppRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ImportAppRequest} ImportAppRequest + */ + ImportAppRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ImportAppRequest) + return object; + var message = new $root.google.cloud.ces.v1.ImportAppRequest(); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.appContent != null) + if (typeof object.appContent === "string") + $util.base64.decode(object.appContent, message.appContent = $util.newBuffer($util.base64.length(object.appContent)), 0); + else if (object.appContent.length >= 0) + message.appContent = object.appContent; + if (object.parent != null) + message.parent = String(object.parent); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.appId != null) + message.appId = String(object.appId); + if (object.importOptions != null) { + if (typeof object.importOptions !== "object") + throw TypeError(".google.cloud.ces.v1.ImportAppRequest.importOptions: object expected"); + message.importOptions = $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions.fromObject(object.importOptions); + } + if (object.ignoreAppLock != null) + message.ignoreAppLock = Boolean(object.ignoreAppLock); + return message; + }; + + /** + * Creates a plain object from an ImportAppRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ImportAppRequest + * @static + * @param {google.cloud.ces.v1.ImportAppRequest} message ImportAppRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportAppRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.displayName = ""; + object.appId = ""; + object.importOptions = null; + object.ignoreAppLock = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.appId != null && message.hasOwnProperty("appId")) + object.appId = message.appId; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.app = "gcsUri"; + } + if (message.appContent != null && message.hasOwnProperty("appContent")) { + object.appContent = options.bytes === String ? $util.base64.encode(message.appContent, 0, message.appContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.appContent) : message.appContent; + if (options.oneofs) + object.app = "appContent"; + } + if (message.importOptions != null && message.hasOwnProperty("importOptions")) + object.importOptions = $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions.toObject(message.importOptions, options); + if (message.ignoreAppLock != null && message.hasOwnProperty("ignoreAppLock")) + object.ignoreAppLock = message.ignoreAppLock; + return object; + }; + + /** + * Converts this ImportAppRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ImportAppRequest + * @instance + * @returns {Object.} JSON object + */ + ImportAppRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportAppRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ImportAppRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ImportAppRequest"; + }; + + ImportAppRequest.ImportOptions = (function() { + + /** + * Properties of an ImportOptions. + * @memberof google.cloud.ces.v1.ImportAppRequest + * @interface IImportOptions + * @property {google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|null} [conflictResolutionStrategy] ImportOptions conflictResolutionStrategy + */ + + /** + * Constructs a new ImportOptions. + * @memberof google.cloud.ces.v1.ImportAppRequest + * @classdesc Represents an ImportOptions. + * @implements IImportOptions + * @constructor + * @param {google.cloud.ces.v1.ImportAppRequest.IImportOptions=} [properties] Properties to set + */ + function ImportOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportOptions conflictResolutionStrategy. + * @member {google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy} conflictResolutionStrategy + * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions + * @instance + */ + ImportOptions.prototype.conflictResolutionStrategy = 0; + + /** + * Creates a new ImportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1.ImportAppRequest.IImportOptions=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ImportAppRequest.ImportOptions} ImportOptions instance + */ + ImportOptions.create = function create(properties) { + return new ImportOptions(properties); + }; + + /** + * Encodes the specified ImportOptions message. Does not implicitly {@link google.cloud.ces.v1.ImportAppRequest.ImportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1.ImportAppRequest.IImportOptions} message ImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conflictResolutionStrategy != null && Object.hasOwnProperty.call(message, "conflictResolutionStrategy")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.conflictResolutionStrategy); + return writer; + }; + + /** + * Encodes the specified ImportOptions message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ImportAppRequest.ImportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1.ImportAppRequest.IImportOptions} message ImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ImportAppRequest.ImportOptions} ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.conflictResolutionStrategy = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ImportAppRequest.ImportOptions} ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportOptions message. + * @function verify + * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conflictResolutionStrategy != null && message.hasOwnProperty("conflictResolutionStrategy")) + switch (message.conflictResolutionStrategy) { + default: + return "conflictResolutionStrategy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ImportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ImportAppRequest.ImportOptions} ImportOptions + */ + ImportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions) + return object; + var message = new $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions(); + switch (object.conflictResolutionStrategy) { + default: + if (typeof object.conflictResolutionStrategy === "number") { + message.conflictResolutionStrategy = object.conflictResolutionStrategy; + break; + } + break; + case "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED": + case 0: + message.conflictResolutionStrategy = 0; + break; + case "REPLACE": + case 1: + message.conflictResolutionStrategy = 1; + break; + case "OVERWRITE": + case 2: + message.conflictResolutionStrategy = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ImportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1.ImportAppRequest.ImportOptions} message ImportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.conflictResolutionStrategy = options.enums === String ? "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED" : 0; + if (message.conflictResolutionStrategy != null && message.hasOwnProperty("conflictResolutionStrategy")) + object.conflictResolutionStrategy = options.enums === String ? $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy[message.conflictResolutionStrategy] === undefined ? message.conflictResolutionStrategy : $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy[message.conflictResolutionStrategy] : message.conflictResolutionStrategy; + return object; + }; + + /** + * Converts this ImportOptions to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions + * @instance + * @returns {Object.} JSON object + */ + ImportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportOptions + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ImportAppRequest.ImportOptions"; + }; + + /** + * ConflictResolutionStrategy enum. + * @name google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy + * @enum {number} + * @property {number} CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED=0 CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED value + * @property {number} REPLACE=1 REPLACE value + * @property {number} OVERWRITE=2 OVERWRITE value + */ + ImportOptions.ConflictResolutionStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "REPLACE"] = 1; + values[valuesById[2] = "OVERWRITE"] = 2; + return values; + })(); + + return ImportOptions; + })(); + + return ImportAppRequest; + })(); + + v1.ImportAppResponse = (function() { + + /** + * Properties of an ImportAppResponse. + * @memberof google.cloud.ces.v1 + * @interface IImportAppResponse + * @property {string|null} [name] ImportAppResponse name + * @property {Array.|null} [warnings] ImportAppResponse warnings + */ + + /** + * Constructs a new ImportAppResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an ImportAppResponse. + * @implements IImportAppResponse + * @constructor + * @param {google.cloud.ces.v1.IImportAppResponse=} [properties] Properties to set + */ + function ImportAppResponse(properties) { + this.warnings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportAppResponse name. + * @member {string} name + * @memberof google.cloud.ces.v1.ImportAppResponse + * @instance + */ + ImportAppResponse.prototype.name = ""; + + /** + * ImportAppResponse warnings. + * @member {Array.} warnings + * @memberof google.cloud.ces.v1.ImportAppResponse + * @instance + */ + ImportAppResponse.prototype.warnings = $util.emptyArray; + + /** + * Creates a new ImportAppResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ImportAppResponse + * @static + * @param {google.cloud.ces.v1.IImportAppResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ImportAppResponse} ImportAppResponse instance + */ + ImportAppResponse.create = function create(properties) { + return new ImportAppResponse(properties); + }; + + /** + * Encodes the specified ImportAppResponse message. Does not implicitly {@link google.cloud.ces.v1.ImportAppResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ImportAppResponse + * @static + * @param {google.cloud.ces.v1.IImportAppResponse} message ImportAppResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportAppResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.warnings != null && message.warnings.length) + for (var i = 0; i < message.warnings.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.warnings[i]); + return writer; + }; + + /** + * Encodes the specified ImportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ImportAppResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ImportAppResponse + * @static + * @param {google.cloud.ces.v1.IImportAppResponse} message ImportAppResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportAppResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportAppResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ImportAppResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ImportAppResponse} ImportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportAppResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ImportAppResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportAppResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ImportAppResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ImportAppResponse} ImportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportAppResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportAppResponse message. + * @function verify + * @memberof google.cloud.ces.v1.ImportAppResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportAppResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.warnings != null && message.hasOwnProperty("warnings")) { + if (!Array.isArray(message.warnings)) + return "warnings: array expected"; + for (var i = 0; i < message.warnings.length; ++i) + if (!$util.isString(message.warnings[i])) + return "warnings: string[] expected"; + } + return null; + }; + + /** + * Creates an ImportAppResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ImportAppResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ImportAppResponse} ImportAppResponse + */ + ImportAppResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ImportAppResponse) + return object; + var message = new $root.google.cloud.ces.v1.ImportAppResponse(); + if (object.name != null) + message.name = String(object.name); + if (object.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.cloud.ces.v1.ImportAppResponse.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) + message.warnings[i] = String(object.warnings[i]); + } + return message; + }; + + /** + * Creates a plain object from an ImportAppResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ImportAppResponse + * @static + * @param {google.cloud.ces.v1.ImportAppResponse} message ImportAppResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportAppResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.warnings = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = message.warnings[j]; + } + return object; + }; + + /** + * Converts this ImportAppResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ImportAppResponse + * @instance + * @returns {Object.} JSON object + */ + ImportAppResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportAppResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ImportAppResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportAppResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ImportAppResponse"; + }; + + return ImportAppResponse; + })(); + + v1.ListAgentsRequest = (function() { + + /** + * Properties of a ListAgentsRequest. + * @memberof google.cloud.ces.v1 + * @interface IListAgentsRequest + * @property {string|null} [parent] ListAgentsRequest parent + * @property {number|null} [pageSize] ListAgentsRequest pageSize + * @property {string|null} [pageToken] ListAgentsRequest pageToken + * @property {string|null} [filter] ListAgentsRequest filter + * @property {string|null} [orderBy] ListAgentsRequest orderBy + */ + + /** + * Constructs a new ListAgentsRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListAgentsRequest. + * @implements IListAgentsRequest + * @constructor + * @param {google.cloud.ces.v1.IListAgentsRequest=} [properties] Properties to set + */ + function ListAgentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAgentsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.parent = ""; + + /** + * ListAgentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.pageSize = 0; + + /** + * ListAgentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.pageToken = ""; + + /** + * ListAgentsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.filter = ""; + + /** + * ListAgentsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListAgentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListAgentsRequest + * @static + * @param {google.cloud.ces.v1.IListAgentsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListAgentsRequest} ListAgentsRequest instance + */ + ListAgentsRequest.create = function create(properties) { + return new ListAgentsRequest(properties); + }; + + /** + * Encodes the specified ListAgentsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListAgentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListAgentsRequest + * @static + * @param {google.cloud.ces.v1.IListAgentsRequest} message ListAgentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsRequest.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 ListAgentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAgentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListAgentsRequest + * @static + * @param {google.cloud.ces.v1.IListAgentsRequest} message ListAgentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListAgentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListAgentsRequest} ListAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListAgentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListAgentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListAgentsRequest} ListAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAgentsRequest message. + * @function verify + * @memberof google.cloud.ces.v1.ListAgentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAgentsRequest.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 ListAgentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListAgentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListAgentsRequest} ListAgentsRequest + */ + ListAgentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListAgentsRequest) + return object; + var message = new $root.google.cloud.ces.v1.ListAgentsRequest(); + 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 ListAgentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListAgentsRequest + * @static + * @param {google.cloud.ces.v1.ListAgentsRequest} message ListAgentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAgentsRequest.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 ListAgentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListAgentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAgentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAgentsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListAgentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAgentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListAgentsRequest"; + }; + + return ListAgentsRequest; + })(); + + v1.ListAgentsResponse = (function() { + + /** + * Properties of a ListAgentsResponse. + * @memberof google.cloud.ces.v1 + * @interface IListAgentsResponse + * @property {Array.|null} [agents] ListAgentsResponse agents + * @property {string|null} [nextPageToken] ListAgentsResponse nextPageToken + */ + + /** + * Constructs a new ListAgentsResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListAgentsResponse. + * @implements IListAgentsResponse + * @constructor + * @param {google.cloud.ces.v1.IListAgentsResponse=} [properties] Properties to set + */ + function ListAgentsResponse(properties) { + this.agents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAgentsResponse agents. + * @member {Array.} agents + * @memberof google.cloud.ces.v1.ListAgentsResponse + * @instance + */ + ListAgentsResponse.prototype.agents = $util.emptyArray; + + /** + * ListAgentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1.ListAgentsResponse + * @instance + */ + ListAgentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAgentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListAgentsResponse + * @static + * @param {google.cloud.ces.v1.IListAgentsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListAgentsResponse} ListAgentsResponse instance + */ + ListAgentsResponse.create = function create(properties) { + return new ListAgentsResponse(properties); + }; + + /** + * Encodes the specified ListAgentsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListAgentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListAgentsResponse + * @static + * @param {google.cloud.ces.v1.IListAgentsResponse} message ListAgentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agents != null && message.agents.length) + for (var i = 0; i < message.agents.length; ++i) + $root.google.cloud.ces.v1.Agent.encode(message.agents[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 ListAgentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAgentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListAgentsResponse + * @static + * @param {google.cloud.ces.v1.IListAgentsResponse} message ListAgentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListAgentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListAgentsResponse} ListAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListAgentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.agents && message.agents.length)) + message.agents = []; + message.agents.push($root.google.cloud.ces.v1.Agent.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListAgentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListAgentsResponse} ListAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAgentsResponse message. + * @function verify + * @memberof google.cloud.ces.v1.ListAgentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAgentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agents != null && message.hasOwnProperty("agents")) { + if (!Array.isArray(message.agents)) + return "agents: array expected"; + for (var i = 0; i < message.agents.length; ++i) { + var error = $root.google.cloud.ces.v1.Agent.verify(message.agents[i]); + if (error) + return "agents." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAgentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListAgentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListAgentsResponse} ListAgentsResponse + */ + ListAgentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListAgentsResponse) + return object; + var message = new $root.google.cloud.ces.v1.ListAgentsResponse(); + if (object.agents) { + if (!Array.isArray(object.agents)) + throw TypeError(".google.cloud.ces.v1.ListAgentsResponse.agents: array expected"); + message.agents = []; + for (var i = 0; i < object.agents.length; ++i) { + if (typeof object.agents[i] !== "object") + throw TypeError(".google.cloud.ces.v1.ListAgentsResponse.agents: object expected"); + message.agents[i] = $root.google.cloud.ces.v1.Agent.fromObject(object.agents[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAgentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListAgentsResponse + * @static + * @param {google.cloud.ces.v1.ListAgentsResponse} message ListAgentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAgentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.agents = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.agents && message.agents.length) { + object.agents = []; + for (var j = 0; j < message.agents.length; ++j) + object.agents[j] = $root.google.cloud.ces.v1.Agent.toObject(message.agents[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAgentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListAgentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAgentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAgentsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListAgentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAgentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListAgentsResponse"; + }; + + return ListAgentsResponse; + })(); + + v1.GetAgentRequest = (function() { + + /** + * Properties of a GetAgentRequest. + * @memberof google.cloud.ces.v1 + * @interface IGetAgentRequest + * @property {string|null} [name] GetAgentRequest name + */ + + /** + * Constructs a new GetAgentRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a GetAgentRequest. + * @implements IGetAgentRequest + * @constructor + * @param {google.cloud.ces.v1.IGetAgentRequest=} [properties] Properties to set + */ + function GetAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAgentRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.GetAgentRequest + * @instance + */ + GetAgentRequest.prototype.name = ""; + + /** + * Creates a new GetAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.GetAgentRequest + * @static + * @param {google.cloud.ces.v1.IGetAgentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.GetAgentRequest} GetAgentRequest instance + */ + GetAgentRequest.create = function create(properties) { + return new GetAgentRequest(properties); + }; + + /** + * Encodes the specified GetAgentRequest message. Does not implicitly {@link google.cloud.ces.v1.GetAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.GetAgentRequest + * @static + * @param {google.cloud.ces.v1.IGetAgentRequest} message GetAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAgentRequest.encode = function encode(message, writer) { + 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 GetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.GetAgentRequest + * @static + * @param {google.cloud.ces.v1.IGetAgentRequest} message GetAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.GetAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.GetAgentRequest} GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAgentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.GetAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.GetAgentRequest} GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAgentRequest message. + * @function verify + * @memberof google.cloud.ces.v1.GetAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAgentRequest.verify = function verify(message) { + if (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 GetAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.GetAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.GetAgentRequest} GetAgentRequest + */ + GetAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.GetAgentRequest) + return object; + var message = new $root.google.cloud.ces.v1.GetAgentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.GetAgentRequest + * @static + * @param {google.cloud.ces.v1.GetAgentRequest} message GetAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAgentRequest.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 GetAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.GetAgentRequest + * @instance + * @returns {Object.} JSON object + */ + GetAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAgentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.GetAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.GetAgentRequest"; + }; + + return GetAgentRequest; + })(); + + v1.CreateAgentRequest = (function() { + + /** + * Properties of a CreateAgentRequest. + * @memberof google.cloud.ces.v1 + * @interface ICreateAgentRequest + * @property {string|null} [parent] CreateAgentRequest parent + * @property {string|null} [agentId] CreateAgentRequest agentId + * @property {google.cloud.ces.v1.IAgent|null} [agent] CreateAgentRequest agent + */ + + /** + * Constructs a new CreateAgentRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a CreateAgentRequest. + * @implements ICreateAgentRequest + * @constructor + * @param {google.cloud.ces.v1.ICreateAgentRequest=} [properties] Properties to set + */ + function CreateAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAgentRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.CreateAgentRequest + * @instance + */ + CreateAgentRequest.prototype.parent = ""; + + /** + * CreateAgentRequest agentId. + * @member {string} agentId + * @memberof google.cloud.ces.v1.CreateAgentRequest + * @instance + */ + CreateAgentRequest.prototype.agentId = ""; + + /** + * CreateAgentRequest agent. + * @member {google.cloud.ces.v1.IAgent|null|undefined} agent + * @memberof google.cloud.ces.v1.CreateAgentRequest + * @instance + */ + CreateAgentRequest.prototype.agent = null; + + /** + * Creates a new CreateAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.CreateAgentRequest + * @static + * @param {google.cloud.ces.v1.ICreateAgentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.CreateAgentRequest} CreateAgentRequest instance + */ + CreateAgentRequest.create = function create(properties) { + return new CreateAgentRequest(properties); + }; + + /** + * Encodes the specified CreateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.CreateAgentRequest + * @static + * @param {google.cloud.ces.v1.ICreateAgentRequest} message CreateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAgentRequest.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.agentId != null && Object.hasOwnProperty.call(message, "agentId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.agentId); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + $root.google.cloud.ces.v1.Agent.encode(message.agent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.CreateAgentRequest + * @static + * @param {google.cloud.ces.v1.ICreateAgentRequest} message CreateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.CreateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.CreateAgentRequest} CreateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAgentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CreateAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.agentId = reader.string(); + break; + } + case 3: { + message.agent = $root.google.cloud.ces.v1.Agent.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.CreateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.CreateAgentRequest} CreateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAgentRequest message. + * @function verify + * @memberof google.cloud.ces.v1.CreateAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAgentRequest.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.agentId != null && message.hasOwnProperty("agentId")) + if (!$util.isString(message.agentId)) + return "agentId: string expected"; + if (message.agent != null && message.hasOwnProperty("agent")) { + var error = $root.google.cloud.ces.v1.Agent.verify(message.agent); + if (error) + return "agent." + error; + } + return null; + }; + + /** + * Creates a CreateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.CreateAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.CreateAgentRequest} CreateAgentRequest + */ + CreateAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.CreateAgentRequest) + return object; + var message = new $root.google.cloud.ces.v1.CreateAgentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.agentId != null) + message.agentId = String(object.agentId); + if (object.agent != null) { + if (typeof object.agent !== "object") + throw TypeError(".google.cloud.ces.v1.CreateAgentRequest.agent: object expected"); + message.agent = $root.google.cloud.ces.v1.Agent.fromObject(object.agent); + } + return message; + }; + + /** + * Creates a plain object from a CreateAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.CreateAgentRequest + * @static + * @param {google.cloud.ces.v1.CreateAgentRequest} message CreateAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.agentId = ""; + object.agent = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.agentId != null && message.hasOwnProperty("agentId")) + object.agentId = message.agentId; + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = $root.google.cloud.ces.v1.Agent.toObject(message.agent, options); + return object; + }; + + /** + * Converts this CreateAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.CreateAgentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAgentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.CreateAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.CreateAgentRequest"; + }; + + return CreateAgentRequest; + })(); + + v1.UpdateAgentRequest = (function() { + + /** + * Properties of an UpdateAgentRequest. + * @memberof google.cloud.ces.v1 + * @interface IUpdateAgentRequest + * @property {google.cloud.ces.v1.IAgent|null} [agent] UpdateAgentRequest agent + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAgentRequest updateMask + */ + + /** + * Constructs a new UpdateAgentRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an UpdateAgentRequest. + * @implements IUpdateAgentRequest + * @constructor + * @param {google.cloud.ces.v1.IUpdateAgentRequest=} [properties] Properties to set + */ + function UpdateAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAgentRequest agent. + * @member {google.cloud.ces.v1.IAgent|null|undefined} agent + * @memberof google.cloud.ces.v1.UpdateAgentRequest + * @instance + */ + UpdateAgentRequest.prototype.agent = null; + + /** + * UpdateAgentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1.UpdateAgentRequest + * @instance + */ + UpdateAgentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.UpdateAgentRequest + * @static + * @param {google.cloud.ces.v1.IUpdateAgentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.UpdateAgentRequest} UpdateAgentRequest instance + */ + UpdateAgentRequest.create = function create(properties) { + return new UpdateAgentRequest(properties); + }; + + /** + * Encodes the specified UpdateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.UpdateAgentRequest + * @static + * @param {google.cloud.ces.v1.IUpdateAgentRequest} message UpdateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAgentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + $root.google.cloud.ces.v1.Agent.encode(message.agent, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.UpdateAgentRequest + * @static + * @param {google.cloud.ces.v1.IUpdateAgentRequest} message UpdateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.UpdateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.UpdateAgentRequest} UpdateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAgentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.UpdateAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.agent = $root.google.cloud.ces.v1.Agent.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.UpdateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.UpdateAgentRequest} UpdateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAgentRequest message. + * @function verify + * @memberof google.cloud.ces.v1.UpdateAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAgentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agent != null && message.hasOwnProperty("agent")) { + var error = $root.google.cloud.ces.v1.Agent.verify(message.agent); + if (error) + return "agent." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.UpdateAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.UpdateAgentRequest} UpdateAgentRequest + */ + UpdateAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.UpdateAgentRequest) + return object; + var message = new $root.google.cloud.ces.v1.UpdateAgentRequest(); + if (object.agent != null) { + if (typeof object.agent !== "object") + throw TypeError(".google.cloud.ces.v1.UpdateAgentRequest.agent: object expected"); + message.agent = $root.google.cloud.ces.v1.Agent.fromObject(object.agent); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1.UpdateAgentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.UpdateAgentRequest + * @static + * @param {google.cloud.ces.v1.UpdateAgentRequest} message UpdateAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.agent = null; + object.updateMask = null; + } + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = $root.google.cloud.ces.v1.Agent.toObject(message.agent, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.UpdateAgentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAgentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.UpdateAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.UpdateAgentRequest"; + }; + + return UpdateAgentRequest; + })(); + + v1.DeleteAgentRequest = (function() { + + /** + * Properties of a DeleteAgentRequest. + * @memberof google.cloud.ces.v1 + * @interface IDeleteAgentRequest + * @property {string|null} [name] DeleteAgentRequest name + * @property {boolean|null} [force] DeleteAgentRequest force + * @property {string|null} [etag] DeleteAgentRequest etag + */ + + /** + * Constructs a new DeleteAgentRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a DeleteAgentRequest. + * @implements IDeleteAgentRequest + * @constructor + * @param {google.cloud.ces.v1.IDeleteAgentRequest=} [properties] Properties to set + */ + function DeleteAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAgentRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.DeleteAgentRequest + * @instance + */ + DeleteAgentRequest.prototype.name = ""; + + /** + * DeleteAgentRequest force. + * @member {boolean} force + * @memberof google.cloud.ces.v1.DeleteAgentRequest + * @instance + */ + DeleteAgentRequest.prototype.force = false; + + /** + * DeleteAgentRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1.DeleteAgentRequest + * @instance + */ + DeleteAgentRequest.prototype.etag = ""; + + /** + * Creates a new DeleteAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DeleteAgentRequest + * @static + * @param {google.cloud.ces.v1.IDeleteAgentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DeleteAgentRequest} DeleteAgentRequest instance + */ + DeleteAgentRequest.create = function create(properties) { + return new DeleteAgentRequest(properties); + }; + + /** + * Encodes the specified DeleteAgentRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DeleteAgentRequest + * @static + * @param {google.cloud.ces.v1.IDeleteAgentRequest} message DeleteAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAgentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DeleteAgentRequest + * @static + * @param {google.cloud.ces.v1.IDeleteAgentRequest} message DeleteAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DeleteAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DeleteAgentRequest} DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAgentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DeleteAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DeleteAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DeleteAgentRequest} DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAgentRequest message. + * @function verify + * @memberof google.cloud.ces.v1.DeleteAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAgentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DeleteAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DeleteAgentRequest} DeleteAgentRequest + */ + DeleteAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DeleteAgentRequest) + return object; + var message = new $root.google.cloud.ces.v1.DeleteAgentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DeleteAgentRequest + * @static + * @param {google.cloud.ces.v1.DeleteAgentRequest} message DeleteAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DeleteAgentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAgentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DeleteAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DeleteAgentRequest"; + }; + + return DeleteAgentRequest; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.ces.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.ces.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 createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.ces.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.ces.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.OperationMetadata + * @static + * @param {google.cloud.ces.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.ces.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.ces.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.OperationMetadata + * @static + * @param {google.cloud.ces.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.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.requestedCancellation); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.OperationMetadata + * @static + * @param {google.cloud.ces.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.ces.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.ces.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + 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.statusMessage = reader.string(); + break; + } + case 4: { + message.requestedCancellation = reader.bool(); + 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.ces.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.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.ces.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"; + 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.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"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.ces.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.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.ces.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.OperationMetadata + * @static + * @param {google.cloud.ces.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.statusMessage = ""; + object.requestedCancellation = false; + } + 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.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.ces.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.ces.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.ces.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.ListExamplesRequest = (function() { + + /** + * Properties of a ListExamplesRequest. + * @memberof google.cloud.ces.v1 + * @interface IListExamplesRequest + * @property {string|null} [parent] ListExamplesRequest parent + * @property {number|null} [pageSize] ListExamplesRequest pageSize + * @property {string|null} [pageToken] ListExamplesRequest pageToken + * @property {string|null} [filter] ListExamplesRequest filter + * @property {string|null} [orderBy] ListExamplesRequest orderBy + */ + + /** + * Constructs a new ListExamplesRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListExamplesRequest. + * @implements IListExamplesRequest + * @constructor + * @param {google.cloud.ces.v1.IListExamplesRequest=} [properties] Properties to set + */ + function ListExamplesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExamplesRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.parent = ""; + + /** + * ListExamplesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.pageSize = 0; + + /** + * ListExamplesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.pageToken = ""; + + /** + * ListExamplesRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.filter = ""; + + /** + * ListExamplesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListExamplesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListExamplesRequest + * @static + * @param {google.cloud.ces.v1.IListExamplesRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListExamplesRequest} ListExamplesRequest instance + */ + ListExamplesRequest.create = function create(properties) { + return new ListExamplesRequest(properties); + }; + + /** + * Encodes the specified ListExamplesRequest message. Does not implicitly {@link google.cloud.ces.v1.ListExamplesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListExamplesRequest + * @static + * @param {google.cloud.ces.v1.IListExamplesRequest} message ListExamplesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesRequest.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 ListExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListExamplesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListExamplesRequest + * @static + * @param {google.cloud.ces.v1.IListExamplesRequest} message ListExamplesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListExamplesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListExamplesRequest} ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListExamplesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListExamplesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListExamplesRequest} ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExamplesRequest message. + * @function verify + * @memberof google.cloud.ces.v1.ListExamplesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExamplesRequest.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 ListExamplesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListExamplesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListExamplesRequest} ListExamplesRequest + */ + ListExamplesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListExamplesRequest) + return object; + var message = new $root.google.cloud.ces.v1.ListExamplesRequest(); + 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 ListExamplesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListExamplesRequest + * @static + * @param {google.cloud.ces.v1.ListExamplesRequest} message ListExamplesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExamplesRequest.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 ListExamplesRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListExamplesRequest + * @instance + * @returns {Object.} JSON object + */ + ListExamplesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExamplesRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListExamplesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExamplesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListExamplesRequest"; + }; + + return ListExamplesRequest; + })(); + + v1.ListExamplesResponse = (function() { + + /** + * Properties of a ListExamplesResponse. + * @memberof google.cloud.ces.v1 + * @interface IListExamplesResponse + * @property {Array.|null} [examples] ListExamplesResponse examples + * @property {string|null} [nextPageToken] ListExamplesResponse nextPageToken + */ + + /** + * Constructs a new ListExamplesResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListExamplesResponse. + * @implements IListExamplesResponse + * @constructor + * @param {google.cloud.ces.v1.IListExamplesResponse=} [properties] Properties to set + */ + function ListExamplesResponse(properties) { + this.examples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExamplesResponse examples. + * @member {Array.} examples + * @memberof google.cloud.ces.v1.ListExamplesResponse + * @instance + */ + ListExamplesResponse.prototype.examples = $util.emptyArray; + + /** + * ListExamplesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1.ListExamplesResponse + * @instance + */ + ListExamplesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListExamplesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListExamplesResponse + * @static + * @param {google.cloud.ces.v1.IListExamplesResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListExamplesResponse} ListExamplesResponse instance + */ + ListExamplesResponse.create = function create(properties) { + return new ListExamplesResponse(properties); + }; + + /** + * Encodes the specified ListExamplesResponse message. Does not implicitly {@link google.cloud.ces.v1.ListExamplesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListExamplesResponse + * @static + * @param {google.cloud.ces.v1.IListExamplesResponse} message ListExamplesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.examples != null && message.examples.length) + for (var i = 0; i < message.examples.length; ++i) + $root.google.cloud.ces.v1.Example.encode(message.examples[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 ListExamplesResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListExamplesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListExamplesResponse + * @static + * @param {google.cloud.ces.v1.IListExamplesResponse} message ListExamplesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListExamplesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListExamplesResponse} ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListExamplesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.examples && message.examples.length)) + message.examples = []; + message.examples.push($root.google.cloud.ces.v1.Example.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListExamplesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListExamplesResponse} ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExamplesResponse message. + * @function verify + * @memberof google.cloud.ces.v1.ListExamplesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExamplesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.examples != null && message.hasOwnProperty("examples")) { + if (!Array.isArray(message.examples)) + return "examples: array expected"; + for (var i = 0; i < message.examples.length; ++i) { + var error = $root.google.cloud.ces.v1.Example.verify(message.examples[i]); + if (error) + return "examples." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListExamplesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListExamplesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListExamplesResponse} ListExamplesResponse + */ + ListExamplesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListExamplesResponse) + return object; + var message = new $root.google.cloud.ces.v1.ListExamplesResponse(); + if (object.examples) { + if (!Array.isArray(object.examples)) + throw TypeError(".google.cloud.ces.v1.ListExamplesResponse.examples: array expected"); + message.examples = []; + for (var i = 0; i < object.examples.length; ++i) { + if (typeof object.examples[i] !== "object") + throw TypeError(".google.cloud.ces.v1.ListExamplesResponse.examples: object expected"); + message.examples[i] = $root.google.cloud.ces.v1.Example.fromObject(object.examples[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListExamplesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListExamplesResponse + * @static + * @param {google.cloud.ces.v1.ListExamplesResponse} message ListExamplesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExamplesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.examples = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.examples && message.examples.length) { + object.examples = []; + for (var j = 0; j < message.examples.length; ++j) + object.examples[j] = $root.google.cloud.ces.v1.Example.toObject(message.examples[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListExamplesResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListExamplesResponse + * @instance + * @returns {Object.} JSON object + */ + ListExamplesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExamplesResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListExamplesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExamplesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListExamplesResponse"; + }; + + return ListExamplesResponse; + })(); + + v1.GetExampleRequest = (function() { + + /** + * Properties of a GetExampleRequest. + * @memberof google.cloud.ces.v1 + * @interface IGetExampleRequest + * @property {string|null} [name] GetExampleRequest name + */ + + /** + * Constructs a new GetExampleRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a GetExampleRequest. + * @implements IGetExampleRequest + * @constructor + * @param {google.cloud.ces.v1.IGetExampleRequest=} [properties] Properties to set + */ + function GetExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetExampleRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.GetExampleRequest + * @instance + */ + GetExampleRequest.prototype.name = ""; + + /** + * Creates a new GetExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.GetExampleRequest + * @static + * @param {google.cloud.ces.v1.IGetExampleRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.GetExampleRequest} GetExampleRequest instance + */ + GetExampleRequest.create = function create(properties) { + return new GetExampleRequest(properties); + }; + + /** + * Encodes the specified GetExampleRequest message. Does not implicitly {@link google.cloud.ces.v1.GetExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.GetExampleRequest + * @static + * @param {google.cloud.ces.v1.IGetExampleRequest} message GetExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExampleRequest.encode = function encode(message, writer) { + 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 GetExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.GetExampleRequest + * @static + * @param {google.cloud.ces.v1.IGetExampleRequest} message GetExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.GetExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.GetExampleRequest} GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExampleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.GetExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.GetExampleRequest} GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetExampleRequest message. + * @function verify + * @memberof google.cloud.ces.v1.GetExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetExampleRequest.verify = function verify(message) { + if (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 GetExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.GetExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.GetExampleRequest} GetExampleRequest + */ + GetExampleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.GetExampleRequest) + return object; + var message = new $root.google.cloud.ces.v1.GetExampleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.GetExampleRequest + * @static + * @param {google.cloud.ces.v1.GetExampleRequest} message GetExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetExampleRequest.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 GetExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.GetExampleRequest + * @instance + * @returns {Object.} JSON object + */ + GetExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetExampleRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.GetExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.GetExampleRequest"; + }; + + return GetExampleRequest; + })(); + + v1.CreateExampleRequest = (function() { + + /** + * Properties of a CreateExampleRequest. + * @memberof google.cloud.ces.v1 + * @interface ICreateExampleRequest + * @property {string|null} [parent] CreateExampleRequest parent + * @property {string|null} [exampleId] CreateExampleRequest exampleId + * @property {google.cloud.ces.v1.IExample|null} [example] CreateExampleRequest example + */ + + /** + * Constructs a new CreateExampleRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a CreateExampleRequest. + * @implements ICreateExampleRequest + * @constructor + * @param {google.cloud.ces.v1.ICreateExampleRequest=} [properties] Properties to set + */ + function CreateExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateExampleRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.CreateExampleRequest + * @instance + */ + CreateExampleRequest.prototype.parent = ""; + + /** + * CreateExampleRequest exampleId. + * @member {string} exampleId + * @memberof google.cloud.ces.v1.CreateExampleRequest + * @instance + */ + CreateExampleRequest.prototype.exampleId = ""; + + /** + * CreateExampleRequest example. + * @member {google.cloud.ces.v1.IExample|null|undefined} example + * @memberof google.cloud.ces.v1.CreateExampleRequest + * @instance + */ + CreateExampleRequest.prototype.example = null; + + /** + * Creates a new CreateExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.CreateExampleRequest + * @static + * @param {google.cloud.ces.v1.ICreateExampleRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.CreateExampleRequest} CreateExampleRequest instance + */ + CreateExampleRequest.create = function create(properties) { + return new CreateExampleRequest(properties); + }; + + /** + * Encodes the specified CreateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.CreateExampleRequest + * @static + * @param {google.cloud.ces.v1.ICreateExampleRequest} message CreateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExampleRequest.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.exampleId != null && Object.hasOwnProperty.call(message, "exampleId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exampleId); + if (message.example != null && Object.hasOwnProperty.call(message, "example")) + $root.google.cloud.ces.v1.Example.encode(message.example, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.CreateExampleRequest + * @static + * @param {google.cloud.ces.v1.ICreateExampleRequest} message CreateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.CreateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.CreateExampleRequest} CreateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExampleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CreateExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.exampleId = reader.string(); + break; + } + case 3: { + message.example = $root.google.cloud.ces.v1.Example.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.CreateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.CreateExampleRequest} CreateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateExampleRequest message. + * @function verify + * @memberof google.cloud.ces.v1.CreateExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateExampleRequest.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.exampleId != null && message.hasOwnProperty("exampleId")) + if (!$util.isString(message.exampleId)) + return "exampleId: string expected"; + if (message.example != null && message.hasOwnProperty("example")) { + var error = $root.google.cloud.ces.v1.Example.verify(message.example); + if (error) + return "example." + error; + } + return null; + }; + + /** + * Creates a CreateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.CreateExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.CreateExampleRequest} CreateExampleRequest + */ + CreateExampleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.CreateExampleRequest) + return object; + var message = new $root.google.cloud.ces.v1.CreateExampleRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.exampleId != null) + message.exampleId = String(object.exampleId); + if (object.example != null) { + if (typeof object.example !== "object") + throw TypeError(".google.cloud.ces.v1.CreateExampleRequest.example: object expected"); + message.example = $root.google.cloud.ces.v1.Example.fromObject(object.example); + } + return message; + }; + + /** + * Creates a plain object from a CreateExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.CreateExampleRequest + * @static + * @param {google.cloud.ces.v1.CreateExampleRequest} message CreateExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateExampleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.exampleId = ""; + object.example = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.exampleId != null && message.hasOwnProperty("exampleId")) + object.exampleId = message.exampleId; + if (message.example != null && message.hasOwnProperty("example")) + object.example = $root.google.cloud.ces.v1.Example.toObject(message.example, options); + return object; + }; + + /** + * Converts this CreateExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.CreateExampleRequest + * @instance + * @returns {Object.} JSON object + */ + CreateExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateExampleRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.CreateExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.CreateExampleRequest"; + }; + + return CreateExampleRequest; + })(); + + v1.UpdateExampleRequest = (function() { + + /** + * Properties of an UpdateExampleRequest. + * @memberof google.cloud.ces.v1 + * @interface IUpdateExampleRequest + * @property {google.cloud.ces.v1.IExample|null} [example] UpdateExampleRequest example + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateExampleRequest updateMask + */ + + /** + * Constructs a new UpdateExampleRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an UpdateExampleRequest. + * @implements IUpdateExampleRequest + * @constructor + * @param {google.cloud.ces.v1.IUpdateExampleRequest=} [properties] Properties to set + */ + function UpdateExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateExampleRequest example. + * @member {google.cloud.ces.v1.IExample|null|undefined} example + * @memberof google.cloud.ces.v1.UpdateExampleRequest + * @instance + */ + UpdateExampleRequest.prototype.example = null; + + /** + * UpdateExampleRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1.UpdateExampleRequest + * @instance + */ + UpdateExampleRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.UpdateExampleRequest + * @static + * @param {google.cloud.ces.v1.IUpdateExampleRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.UpdateExampleRequest} UpdateExampleRequest instance + */ + UpdateExampleRequest.create = function create(properties) { + return new UpdateExampleRequest(properties); + }; + + /** + * Encodes the specified UpdateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.UpdateExampleRequest + * @static + * @param {google.cloud.ces.v1.IUpdateExampleRequest} message UpdateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExampleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.example != null && Object.hasOwnProperty.call(message, "example")) + $root.google.cloud.ces.v1.Example.encode(message.example, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.UpdateExampleRequest + * @static + * @param {google.cloud.ces.v1.IUpdateExampleRequest} message UpdateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.UpdateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.UpdateExampleRequest} UpdateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExampleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.UpdateExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.example = $root.google.cloud.ces.v1.Example.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.UpdateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.UpdateExampleRequest} UpdateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateExampleRequest message. + * @function verify + * @memberof google.cloud.ces.v1.UpdateExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateExampleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.example != null && message.hasOwnProperty("example")) { + var error = $root.google.cloud.ces.v1.Example.verify(message.example); + if (error) + return "example." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.UpdateExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.UpdateExampleRequest} UpdateExampleRequest + */ + UpdateExampleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.UpdateExampleRequest) + return object; + var message = new $root.google.cloud.ces.v1.UpdateExampleRequest(); + if (object.example != null) { + if (typeof object.example !== "object") + throw TypeError(".google.cloud.ces.v1.UpdateExampleRequest.example: object expected"); + message.example = $root.google.cloud.ces.v1.Example.fromObject(object.example); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1.UpdateExampleRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.UpdateExampleRequest + * @static + * @param {google.cloud.ces.v1.UpdateExampleRequest} message UpdateExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateExampleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.example = null; + object.updateMask = null; + } + if (message.example != null && message.hasOwnProperty("example")) + object.example = $root.google.cloud.ces.v1.Example.toObject(message.example, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.UpdateExampleRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateExampleRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.UpdateExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.UpdateExampleRequest"; + }; + + return UpdateExampleRequest; + })(); + + v1.DeleteExampleRequest = (function() { + + /** + * Properties of a DeleteExampleRequest. + * @memberof google.cloud.ces.v1 + * @interface IDeleteExampleRequest + * @property {string|null} [name] DeleteExampleRequest name + * @property {string|null} [etag] DeleteExampleRequest etag + */ + + /** + * Constructs a new DeleteExampleRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a DeleteExampleRequest. + * @implements IDeleteExampleRequest + * @constructor + * @param {google.cloud.ces.v1.IDeleteExampleRequest=} [properties] Properties to set + */ + function DeleteExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteExampleRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.DeleteExampleRequest + * @instance + */ + DeleteExampleRequest.prototype.name = ""; + + /** + * DeleteExampleRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1.DeleteExampleRequest + * @instance + */ + DeleteExampleRequest.prototype.etag = ""; + + /** + * Creates a new DeleteExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DeleteExampleRequest + * @static + * @param {google.cloud.ces.v1.IDeleteExampleRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DeleteExampleRequest} DeleteExampleRequest instance + */ + DeleteExampleRequest.create = function create(properties) { + return new DeleteExampleRequest(properties); + }; + + /** + * Encodes the specified DeleteExampleRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DeleteExampleRequest + * @static + * @param {google.cloud.ces.v1.IDeleteExampleRequest} message DeleteExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExampleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DeleteExampleRequest + * @static + * @param {google.cloud.ces.v1.IDeleteExampleRequest} message DeleteExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DeleteExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DeleteExampleRequest} DeleteExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExampleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DeleteExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DeleteExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DeleteExampleRequest} DeleteExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteExampleRequest message. + * @function verify + * @memberof google.cloud.ces.v1.DeleteExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteExampleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DeleteExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DeleteExampleRequest} DeleteExampleRequest + */ + DeleteExampleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DeleteExampleRequest) + return object; + var message = new $root.google.cloud.ces.v1.DeleteExampleRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DeleteExampleRequest + * @static + * @param {google.cloud.ces.v1.DeleteExampleRequest} message DeleteExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteExampleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DeleteExampleRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteExampleRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DeleteExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DeleteExampleRequest"; + }; + + return DeleteExampleRequest; + })(); + + v1.ListToolsRequest = (function() { + + /** + * Properties of a ListToolsRequest. + * @memberof google.cloud.ces.v1 + * @interface IListToolsRequest + * @property {string|null} [parent] ListToolsRequest parent + * @property {number|null} [pageSize] ListToolsRequest pageSize + * @property {string|null} [pageToken] ListToolsRequest pageToken + * @property {string|null} [filter] ListToolsRequest filter + * @property {string|null} [orderBy] ListToolsRequest orderBy + */ + + /** + * Constructs a new ListToolsRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListToolsRequest. + * @implements IListToolsRequest + * @constructor + * @param {google.cloud.ces.v1.IListToolsRequest=} [properties] Properties to set + */ + function ListToolsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.parent = ""; + + /** + * ListToolsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.pageSize = 0; + + /** + * ListToolsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.pageToken = ""; + + /** + * ListToolsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.filter = ""; + + /** + * ListToolsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListToolsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListToolsRequest + * @static + * @param {google.cloud.ces.v1.IListToolsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListToolsRequest} ListToolsRequest instance + */ + ListToolsRequest.create = function create(properties) { + return new ListToolsRequest(properties); + }; + + /** + * Encodes the specified ListToolsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListToolsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListToolsRequest + * @static + * @param {google.cloud.ces.v1.IListToolsRequest} message ListToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsRequest.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 ListToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListToolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListToolsRequest + * @static + * @param {google.cloud.ces.v1.IListToolsRequest} message ListToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListToolsRequest} ListToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListToolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListToolsRequest} ListToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolsRequest message. + * @function verify + * @memberof google.cloud.ces.v1.ListToolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolsRequest.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 ListToolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListToolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListToolsRequest} ListToolsRequest + */ + ListToolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListToolsRequest) + return object; + var message = new $root.google.cloud.ces.v1.ListToolsRequest(); + 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 ListToolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListToolsRequest + * @static + * @param {google.cloud.ces.v1.ListToolsRequest} message ListToolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolsRequest.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 ListToolsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListToolsRequest + * @instance + * @returns {Object.} JSON object + */ + ListToolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListToolsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListToolsRequest"; + }; + + return ListToolsRequest; + })(); + + v1.ListToolsResponse = (function() { + + /** + * Properties of a ListToolsResponse. + * @memberof google.cloud.ces.v1 + * @interface IListToolsResponse + * @property {Array.|null} [tools] ListToolsResponse tools + * @property {string|null} [nextPageToken] ListToolsResponse nextPageToken + */ + + /** + * Constructs a new ListToolsResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListToolsResponse. + * @implements IListToolsResponse + * @constructor + * @param {google.cloud.ces.v1.IListToolsResponse=} [properties] Properties to set + */ + function ListToolsResponse(properties) { + this.tools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolsResponse tools. + * @member {Array.} tools + * @memberof google.cloud.ces.v1.ListToolsResponse + * @instance + */ + ListToolsResponse.prototype.tools = $util.emptyArray; + + /** + * ListToolsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1.ListToolsResponse + * @instance + */ + ListToolsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListToolsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListToolsResponse + * @static + * @param {google.cloud.ces.v1.IListToolsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListToolsResponse} ListToolsResponse instance + */ + ListToolsResponse.create = function create(properties) { + return new ListToolsResponse(properties); + }; + + /** + * Encodes the specified ListToolsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListToolsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListToolsResponse + * @static + * @param {google.cloud.ces.v1.IListToolsResponse} message ListToolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + $root.google.cloud.ces.v1.Tool.encode(message.tools[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 ListToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListToolsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListToolsResponse + * @static + * @param {google.cloud.ces.v1.IListToolsResponse} message ListToolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListToolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListToolsResponse} ListToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListToolsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push($root.google.cloud.ces.v1.Tool.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListToolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListToolsResponse} ListToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolsResponse message. + * @function verify + * @memberof google.cloud.ces.v1.ListToolsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tools != null && message.hasOwnProperty("tools")) { + if (!Array.isArray(message.tools)) + return "tools: array expected"; + for (var i = 0; i < message.tools.length; ++i) { + var error = $root.google.cloud.ces.v1.Tool.verify(message.tools[i]); + if (error) + return "tools." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListToolsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListToolsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListToolsResponse} ListToolsResponse + */ + ListToolsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListToolsResponse) + return object; + var message = new $root.google.cloud.ces.v1.ListToolsResponse(); + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.cloud.ces.v1.ListToolsResponse.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) { + if (typeof object.tools[i] !== "object") + throw TypeError(".google.cloud.ces.v1.ListToolsResponse.tools: object expected"); + message.tools[i] = $root.google.cloud.ces.v1.Tool.fromObject(object.tools[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListToolsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListToolsResponse + * @static + * @param {google.cloud.ces.v1.ListToolsResponse} message ListToolsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tools = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = $root.google.cloud.ces.v1.Tool.toObject(message.tools[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListToolsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListToolsResponse + * @instance + * @returns {Object.} JSON object + */ + ListToolsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListToolsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListToolsResponse"; + }; + + return ListToolsResponse; + })(); + + v1.GetToolRequest = (function() { + + /** + * Properties of a GetToolRequest. + * @memberof google.cloud.ces.v1 + * @interface IGetToolRequest + * @property {string|null} [name] GetToolRequest name + */ + + /** + * Constructs a new GetToolRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a GetToolRequest. + * @implements IGetToolRequest + * @constructor + * @param {google.cloud.ces.v1.IGetToolRequest=} [properties] Properties to set + */ + function GetToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetToolRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.GetToolRequest + * @instance + */ + GetToolRequest.prototype.name = ""; + + /** + * Creates a new GetToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.GetToolRequest + * @static + * @param {google.cloud.ces.v1.IGetToolRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.GetToolRequest} GetToolRequest instance + */ + GetToolRequest.create = function create(properties) { + return new GetToolRequest(properties); + }; + + /** + * Encodes the specified GetToolRequest message. Does not implicitly {@link google.cloud.ces.v1.GetToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.GetToolRequest + * @static + * @param {google.cloud.ces.v1.IGetToolRequest} message GetToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolRequest.encode = function encode(message, writer) { + 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 GetToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.GetToolRequest + * @static + * @param {google.cloud.ces.v1.IGetToolRequest} message GetToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.GetToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.GetToolRequest} GetToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.GetToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.GetToolRequest} GetToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetToolRequest message. + * @function verify + * @memberof google.cloud.ces.v1.GetToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetToolRequest.verify = function verify(message) { + if (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 GetToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.GetToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.GetToolRequest} GetToolRequest + */ + GetToolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.GetToolRequest) + return object; + var message = new $root.google.cloud.ces.v1.GetToolRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.GetToolRequest + * @static + * @param {google.cloud.ces.v1.GetToolRequest} message GetToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetToolRequest.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 GetToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.GetToolRequest + * @instance + * @returns {Object.} JSON object + */ + GetToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetToolRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.GetToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.GetToolRequest"; + }; + + return GetToolRequest; + })(); + + v1.CreateToolRequest = (function() { + + /** + * Properties of a CreateToolRequest. + * @memberof google.cloud.ces.v1 + * @interface ICreateToolRequest + * @property {string|null} [parent] CreateToolRequest parent + * @property {string|null} [toolId] CreateToolRequest toolId + * @property {google.cloud.ces.v1.ITool|null} [tool] CreateToolRequest tool + */ + + /** + * Constructs a new CreateToolRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a CreateToolRequest. + * @implements ICreateToolRequest + * @constructor + * @param {google.cloud.ces.v1.ICreateToolRequest=} [properties] Properties to set + */ + function CreateToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateToolRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.CreateToolRequest + * @instance + */ + CreateToolRequest.prototype.parent = ""; + + /** + * CreateToolRequest toolId. + * @member {string} toolId + * @memberof google.cloud.ces.v1.CreateToolRequest + * @instance + */ + CreateToolRequest.prototype.toolId = ""; + + /** + * CreateToolRequest tool. + * @member {google.cloud.ces.v1.ITool|null|undefined} tool + * @memberof google.cloud.ces.v1.CreateToolRequest + * @instance + */ + CreateToolRequest.prototype.tool = null; + + /** + * Creates a new CreateToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.CreateToolRequest + * @static + * @param {google.cloud.ces.v1.ICreateToolRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.CreateToolRequest} CreateToolRequest instance + */ + CreateToolRequest.create = function create(properties) { + return new CreateToolRequest(properties); + }; + + /** + * Encodes the specified CreateToolRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.CreateToolRequest + * @static + * @param {google.cloud.ces.v1.ICreateToolRequest} message CreateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolRequest.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.toolId != null && Object.hasOwnProperty.call(message, "toolId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.toolId); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + $root.google.cloud.ces.v1.Tool.encode(message.tool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.CreateToolRequest + * @static + * @param {google.cloud.ces.v1.ICreateToolRequest} message CreateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.CreateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.CreateToolRequest} CreateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CreateToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.toolId = reader.string(); + break; + } + case 3: { + message.tool = $root.google.cloud.ces.v1.Tool.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.CreateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.CreateToolRequest} CreateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateToolRequest message. + * @function verify + * @memberof google.cloud.ces.v1.CreateToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateToolRequest.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.toolId != null && message.hasOwnProperty("toolId")) + if (!$util.isString(message.toolId)) + return "toolId: string expected"; + if (message.tool != null && message.hasOwnProperty("tool")) { + var error = $root.google.cloud.ces.v1.Tool.verify(message.tool); + if (error) + return "tool." + error; + } + return null; + }; + + /** + * Creates a CreateToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.CreateToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.CreateToolRequest} CreateToolRequest + */ + CreateToolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.CreateToolRequest) + return object; + var message = new $root.google.cloud.ces.v1.CreateToolRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.toolId != null) + message.toolId = String(object.toolId); + if (object.tool != null) { + if (typeof object.tool !== "object") + throw TypeError(".google.cloud.ces.v1.CreateToolRequest.tool: object expected"); + message.tool = $root.google.cloud.ces.v1.Tool.fromObject(object.tool); + } + return message; + }; + + /** + * Creates a plain object from a CreateToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.CreateToolRequest + * @static + * @param {google.cloud.ces.v1.CreateToolRequest} message CreateToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateToolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.toolId = ""; + object.tool = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.toolId != null && message.hasOwnProperty("toolId")) + object.toolId = message.toolId; + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = $root.google.cloud.ces.v1.Tool.toObject(message.tool, options); + return object; + }; + + /** + * Converts this CreateToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.CreateToolRequest + * @instance + * @returns {Object.} JSON object + */ + CreateToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateToolRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.CreateToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.CreateToolRequest"; + }; + + return CreateToolRequest; + })(); + + v1.UpdateToolRequest = (function() { + + /** + * Properties of an UpdateToolRequest. + * @memberof google.cloud.ces.v1 + * @interface IUpdateToolRequest + * @property {google.cloud.ces.v1.ITool|null} [tool] UpdateToolRequest tool + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateToolRequest updateMask + */ + + /** + * Constructs a new UpdateToolRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an UpdateToolRequest. + * @implements IUpdateToolRequest + * @constructor + * @param {google.cloud.ces.v1.IUpdateToolRequest=} [properties] Properties to set + */ + function UpdateToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateToolRequest tool. + * @member {google.cloud.ces.v1.ITool|null|undefined} tool + * @memberof google.cloud.ces.v1.UpdateToolRequest + * @instance + */ + UpdateToolRequest.prototype.tool = null; + + /** + * UpdateToolRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1.UpdateToolRequest + * @instance + */ + UpdateToolRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.UpdateToolRequest + * @static + * @param {google.cloud.ces.v1.IUpdateToolRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.UpdateToolRequest} UpdateToolRequest instance + */ + UpdateToolRequest.create = function create(properties) { + return new UpdateToolRequest(properties); + }; + + /** + * Encodes the specified UpdateToolRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.UpdateToolRequest + * @static + * @param {google.cloud.ces.v1.IUpdateToolRequest} message UpdateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateToolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + $root.google.cloud.ces.v1.Tool.encode(message.tool, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.UpdateToolRequest + * @static + * @param {google.cloud.ces.v1.IUpdateToolRequest} message UpdateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.UpdateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.UpdateToolRequest} UpdateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateToolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.UpdateToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = $root.google.cloud.ces.v1.Tool.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.UpdateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.UpdateToolRequest} UpdateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateToolRequest message. + * @function verify + * @memberof google.cloud.ces.v1.UpdateToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateToolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tool != null && message.hasOwnProperty("tool")) { + var error = $root.google.cloud.ces.v1.Tool.verify(message.tool); + if (error) + return "tool." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.UpdateToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.UpdateToolRequest} UpdateToolRequest + */ + UpdateToolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.UpdateToolRequest) + return object; + var message = new $root.google.cloud.ces.v1.UpdateToolRequest(); + if (object.tool != null) { + if (typeof object.tool !== "object") + throw TypeError(".google.cloud.ces.v1.UpdateToolRequest.tool: object expected"); + message.tool = $root.google.cloud.ces.v1.Tool.fromObject(object.tool); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1.UpdateToolRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.UpdateToolRequest + * @static + * @param {google.cloud.ces.v1.UpdateToolRequest} message UpdateToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateToolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = null; + object.updateMask = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = $root.google.cloud.ces.v1.Tool.toObject(message.tool, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.UpdateToolRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateToolRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.UpdateToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.UpdateToolRequest"; + }; + + return UpdateToolRequest; + })(); + + v1.DeleteToolRequest = (function() { + + /** + * Properties of a DeleteToolRequest. + * @memberof google.cloud.ces.v1 + * @interface IDeleteToolRequest + * @property {string|null} [name] DeleteToolRequest name + * @property {boolean|null} [force] DeleteToolRequest force + * @property {string|null} [etag] DeleteToolRequest etag + */ + + /** + * Constructs a new DeleteToolRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a DeleteToolRequest. + * @implements IDeleteToolRequest + * @constructor + * @param {google.cloud.ces.v1.IDeleteToolRequest=} [properties] Properties to set + */ + function DeleteToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteToolRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.DeleteToolRequest + * @instance + */ + DeleteToolRequest.prototype.name = ""; + + /** + * DeleteToolRequest force. + * @member {boolean} force + * @memberof google.cloud.ces.v1.DeleteToolRequest + * @instance + */ + DeleteToolRequest.prototype.force = false; + + /** + * DeleteToolRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1.DeleteToolRequest + * @instance + */ + DeleteToolRequest.prototype.etag = ""; + + /** + * Creates a new DeleteToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DeleteToolRequest + * @static + * @param {google.cloud.ces.v1.IDeleteToolRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DeleteToolRequest} DeleteToolRequest instance + */ + DeleteToolRequest.create = function create(properties) { + return new DeleteToolRequest(properties); + }; + + /** + * Encodes the specified DeleteToolRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DeleteToolRequest + * @static + * @param {google.cloud.ces.v1.IDeleteToolRequest} message DeleteToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DeleteToolRequest + * @static + * @param {google.cloud.ces.v1.IDeleteToolRequest} message DeleteToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DeleteToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DeleteToolRequest} DeleteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DeleteToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DeleteToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DeleteToolRequest} DeleteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteToolRequest message. + * @function verify + * @memberof google.cloud.ces.v1.DeleteToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteToolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DeleteToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DeleteToolRequest} DeleteToolRequest + */ + DeleteToolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DeleteToolRequest) + return object; + var message = new $root.google.cloud.ces.v1.DeleteToolRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DeleteToolRequest + * @static + * @param {google.cloud.ces.v1.DeleteToolRequest} message DeleteToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteToolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DeleteToolRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteToolRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DeleteToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DeleteToolRequest"; + }; + + return DeleteToolRequest; + })(); + + v1.ListConversationsRequest = (function() { + + /** + * Properties of a ListConversationsRequest. + * @memberof google.cloud.ces.v1 + * @interface IListConversationsRequest + * @property {string|null} [parent] ListConversationsRequest parent + * @property {number|null} [pageSize] ListConversationsRequest pageSize + * @property {string|null} [pageToken] ListConversationsRequest pageToken + * @property {string|null} [filter] ListConversationsRequest filter + * @property {google.cloud.ces.v1.Conversation.Source|null} [source] ListConversationsRequest source + * @property {Array.|null} [sources] ListConversationsRequest sources + */ + + /** + * Constructs a new ListConversationsRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListConversationsRequest. + * @implements IListConversationsRequest + * @constructor + * @param {google.cloud.ces.v1.IListConversationsRequest=} [properties] Properties to set + */ + function ListConversationsRequest(properties) { + this.sources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConversationsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.parent = ""; + + /** + * ListConversationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.pageSize = 0; + + /** + * ListConversationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.pageToken = ""; + + /** + * ListConversationsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.filter = ""; + + /** + * ListConversationsRequest source. + * @member {google.cloud.ces.v1.Conversation.Source} source + * @memberof google.cloud.ces.v1.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.source = 0; + + /** + * ListConversationsRequest sources. + * @member {Array.} sources + * @memberof google.cloud.ces.v1.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.sources = $util.emptyArray; + + /** + * Creates a new ListConversationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListConversationsRequest + * @static + * @param {google.cloud.ces.v1.IListConversationsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListConversationsRequest} ListConversationsRequest instance + */ + ListConversationsRequest.create = function create(properties) { + return new ListConversationsRequest(properties); + }; + + /** + * Encodes the specified ListConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListConversationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListConversationsRequest + * @static + * @param {google.cloud.ces.v1.IListConversationsRequest} message ListConversationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsRequest.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.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.source); + if (message.sources != null && message.sources.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.sources.length; ++i) + writer.int32(message.sources[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ListConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListConversationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListConversationsRequest + * @static + * @param {google.cloud.ces.v1.IListConversationsRequest} message ListConversationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListConversationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListConversationsRequest} ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListConversationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.source = reader.int32(); + break; + } + case 6: { + if (!(message.sources && message.sources.length)) + message.sources = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.sources.push(reader.int32()); + } else + message.sources.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListConversationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListConversationsRequest} ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConversationsRequest message. + * @function verify + * @memberof google.cloud.ces.v1.ListConversationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConversationsRequest.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.source != null && message.hasOwnProperty("source")) + switch (message.source) { + default: + return "source: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) + switch (message.sources[i]) { + default: + return "sources: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return null; + }; + + /** + * Creates a ListConversationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListConversationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListConversationsRequest} ListConversationsRequest + */ + ListConversationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListConversationsRequest) + return object; + var message = new $root.google.cloud.ces.v1.ListConversationsRequest(); + 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); + switch (object.source) { + default: + if (typeof object.source === "number") { + message.source = object.source; + break; + } + break; + case "SOURCE_UNSPECIFIED": + case 0: + message.source = 0; + break; + case "LIVE": + case 1: + message.source = 1; + break; + case "SIMULATOR": + case 2: + message.source = 2; + break; + case "EVAL": + case 3: + message.source = 3; + break; + } + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.ces.v1.ListConversationsRequest.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) + switch (object.sources[i]) { + default: + if (typeof object.sources[i] === "number") { + message.sources[i] = object.sources[i]; + break; + } + case "SOURCE_UNSPECIFIED": + case 0: + message.sources[i] = 0; + break; + case "LIVE": + case 1: + message.sources[i] = 1; + break; + case "SIMULATOR": + case 2: + message.sources[i] = 2; + break; + case "EVAL": + case 3: + message.sources[i] = 3; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ListConversationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListConversationsRequest + * @static + * @param {google.cloud.ces.v1.ListConversationsRequest} message ListConversationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConversationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sources = []; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.source != null && message.hasOwnProperty("source")) + object.source = options.enums === String ? $root.google.cloud.ces.v1.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1.Conversation.Source[message.source] : message.source; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = options.enums === String ? $root.google.cloud.ces.v1.Conversation.Source[message.sources[j]] === undefined ? message.sources[j] : $root.google.cloud.ces.v1.Conversation.Source[message.sources[j]] : message.sources[j]; + } + return object; + }; + + /** + * Converts this ListConversationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListConversationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListConversationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConversationsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListConversationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConversationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListConversationsRequest"; + }; + + return ListConversationsRequest; + })(); + + v1.ListConversationsResponse = (function() { + + /** + * Properties of a ListConversationsResponse. + * @memberof google.cloud.ces.v1 + * @interface IListConversationsResponse + * @property {Array.|null} [conversations] ListConversationsResponse conversations + * @property {string|null} [nextPageToken] ListConversationsResponse nextPageToken + */ + + /** + * Constructs a new ListConversationsResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListConversationsResponse. + * @implements IListConversationsResponse + * @constructor + * @param {google.cloud.ces.v1.IListConversationsResponse=} [properties] Properties to set + */ + function ListConversationsResponse(properties) { + this.conversations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConversationsResponse conversations. + * @member {Array.} conversations + * @memberof google.cloud.ces.v1.ListConversationsResponse + * @instance + */ + ListConversationsResponse.prototype.conversations = $util.emptyArray; + + /** + * ListConversationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1.ListConversationsResponse + * @instance + */ + ListConversationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListConversationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListConversationsResponse + * @static + * @param {google.cloud.ces.v1.IListConversationsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListConversationsResponse} ListConversationsResponse instance + */ + ListConversationsResponse.create = function create(properties) { + return new ListConversationsResponse(properties); + }; + + /** + * Encodes the specified ListConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListConversationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListConversationsResponse + * @static + * @param {google.cloud.ces.v1.IListConversationsResponse} message ListConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversations != null && message.conversations.length) + for (var i = 0; i < message.conversations.length; ++i) + $root.google.cloud.ces.v1.Conversation.encode(message.conversations[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 ListConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListConversationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListConversationsResponse + * @static + * @param {google.cloud.ces.v1.IListConversationsResponse} message ListConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListConversationsResponse} ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListConversationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.conversations && message.conversations.length)) + message.conversations = []; + message.conversations.push($root.google.cloud.ces.v1.Conversation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListConversationsResponse} ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConversationsResponse message. + * @function verify + * @memberof google.cloud.ces.v1.ListConversationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConversationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conversations != null && message.hasOwnProperty("conversations")) { + if (!Array.isArray(message.conversations)) + return "conversations: array expected"; + for (var i = 0; i < message.conversations.length; ++i) { + var error = $root.google.cloud.ces.v1.Conversation.verify(message.conversations[i]); + if (error) + return "conversations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListConversationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListConversationsResponse} ListConversationsResponse + */ + ListConversationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListConversationsResponse) + return object; + var message = new $root.google.cloud.ces.v1.ListConversationsResponse(); + if (object.conversations) { + if (!Array.isArray(object.conversations)) + throw TypeError(".google.cloud.ces.v1.ListConversationsResponse.conversations: array expected"); + message.conversations = []; + for (var i = 0; i < object.conversations.length; ++i) { + if (typeof object.conversations[i] !== "object") + throw TypeError(".google.cloud.ces.v1.ListConversationsResponse.conversations: object expected"); + message.conversations[i] = $root.google.cloud.ces.v1.Conversation.fromObject(object.conversations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListConversationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListConversationsResponse + * @static + * @param {google.cloud.ces.v1.ListConversationsResponse} message ListConversationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConversationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conversations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.conversations && message.conversations.length) { + object.conversations = []; + for (var j = 0; j < message.conversations.length; ++j) + object.conversations[j] = $root.google.cloud.ces.v1.Conversation.toObject(message.conversations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListConversationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListConversationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListConversationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConversationsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListConversationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConversationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListConversationsResponse"; + }; + + return ListConversationsResponse; + })(); + + v1.GetConversationRequest = (function() { + + /** + * Properties of a GetConversationRequest. + * @memberof google.cloud.ces.v1 + * @interface IGetConversationRequest + * @property {string|null} [name] GetConversationRequest name + * @property {google.cloud.ces.v1.Conversation.Source|null} [source] GetConversationRequest source + */ + + /** + * Constructs a new GetConversationRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a GetConversationRequest. + * @implements IGetConversationRequest + * @constructor + * @param {google.cloud.ces.v1.IGetConversationRequest=} [properties] Properties to set + */ + function GetConversationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConversationRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.GetConversationRequest + * @instance + */ + GetConversationRequest.prototype.name = ""; + + /** + * GetConversationRequest source. + * @member {google.cloud.ces.v1.Conversation.Source} source + * @memberof google.cloud.ces.v1.GetConversationRequest + * @instance + */ + GetConversationRequest.prototype.source = 0; + + /** + * Creates a new GetConversationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.GetConversationRequest + * @static + * @param {google.cloud.ces.v1.IGetConversationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.GetConversationRequest} GetConversationRequest instance + */ + GetConversationRequest.create = function create(properties) { + return new GetConversationRequest(properties); + }; + + /** + * Encodes the specified GetConversationRequest message. Does not implicitly {@link google.cloud.ces.v1.GetConversationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.GetConversationRequest + * @static + * @param {google.cloud.ces.v1.IGetConversationRequest} message GetConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConversationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.source); + return writer; + }; + + /** + * Encodes the specified GetConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetConversationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.GetConversationRequest + * @static + * @param {google.cloud.ces.v1.IGetConversationRequest} message GetConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConversationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConversationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.GetConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.GetConversationRequest} GetConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConversationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetConversationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.source = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConversationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.GetConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.GetConversationRequest} GetConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConversationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConversationRequest message. + * @function verify + * @memberof google.cloud.ces.v1.GetConversationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConversationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + switch (message.source) { + default: + return "source: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a GetConversationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.GetConversationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.GetConversationRequest} GetConversationRequest + */ + GetConversationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.GetConversationRequest) + return object; + var message = new $root.google.cloud.ces.v1.GetConversationRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.source) { + default: + if (typeof object.source === "number") { + message.source = object.source; + break; + } + break; + case "SOURCE_UNSPECIFIED": + case 0: + message.source = 0; + break; + case "LIVE": + case 1: + message.source = 1; + break; + case "SIMULATOR": + case 2: + message.source = 2; + break; + case "EVAL": + case 3: + message.source = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetConversationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.GetConversationRequest + * @static + * @param {google.cloud.ces.v1.GetConversationRequest} message GetConversationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConversationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.source != null && message.hasOwnProperty("source")) + object.source = options.enums === String ? $root.google.cloud.ces.v1.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1.Conversation.Source[message.source] : message.source; + return object; + }; + + /** + * Converts this GetConversationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.GetConversationRequest + * @instance + * @returns {Object.} JSON object + */ + GetConversationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConversationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.GetConversationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConversationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.GetConversationRequest"; + }; + + return GetConversationRequest; + })(); + + v1.DeleteConversationRequest = (function() { + + /** + * Properties of a DeleteConversationRequest. + * @memberof google.cloud.ces.v1 + * @interface IDeleteConversationRequest + * @property {string|null} [name] DeleteConversationRequest name + * @property {google.cloud.ces.v1.Conversation.Source|null} [source] DeleteConversationRequest source + */ + + /** + * Constructs a new DeleteConversationRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a DeleteConversationRequest. + * @implements IDeleteConversationRequest + * @constructor + * @param {google.cloud.ces.v1.IDeleteConversationRequest=} [properties] Properties to set + */ + function DeleteConversationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteConversationRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.DeleteConversationRequest + * @instance + */ + DeleteConversationRequest.prototype.name = ""; + + /** + * DeleteConversationRequest source. + * @member {google.cloud.ces.v1.Conversation.Source} source + * @memberof google.cloud.ces.v1.DeleteConversationRequest + * @instance + */ + DeleteConversationRequest.prototype.source = 0; + + /** + * Creates a new DeleteConversationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DeleteConversationRequest + * @static + * @param {google.cloud.ces.v1.IDeleteConversationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DeleteConversationRequest} DeleteConversationRequest instance + */ + DeleteConversationRequest.create = function create(properties) { + return new DeleteConversationRequest(properties); + }; + + /** + * Encodes the specified DeleteConversationRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteConversationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DeleteConversationRequest + * @static + * @param {google.cloud.ces.v1.IDeleteConversationRequest} message DeleteConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteConversationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.source); + return writer; + }; + + /** + * Encodes the specified DeleteConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteConversationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DeleteConversationRequest + * @static + * @param {google.cloud.ces.v1.IDeleteConversationRequest} message DeleteConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteConversationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteConversationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DeleteConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DeleteConversationRequest} DeleteConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteConversationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DeleteConversationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.source = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteConversationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DeleteConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DeleteConversationRequest} DeleteConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteConversationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteConversationRequest message. + * @function verify + * @memberof google.cloud.ces.v1.DeleteConversationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteConversationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + switch (message.source) { + default: + return "source: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a DeleteConversationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DeleteConversationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DeleteConversationRequest} DeleteConversationRequest + */ + DeleteConversationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DeleteConversationRequest) + return object; + var message = new $root.google.cloud.ces.v1.DeleteConversationRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.source) { + default: + if (typeof object.source === "number") { + message.source = object.source; + break; + } + break; + case "SOURCE_UNSPECIFIED": + case 0: + message.source = 0; + break; + case "LIVE": + case 1: + message.source = 1; + break; + case "SIMULATOR": + case 2: + message.source = 2; + break; + case "EVAL": + case 3: + message.source = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a DeleteConversationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DeleteConversationRequest + * @static + * @param {google.cloud.ces.v1.DeleteConversationRequest} message DeleteConversationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteConversationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.source != null && message.hasOwnProperty("source")) + object.source = options.enums === String ? $root.google.cloud.ces.v1.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1.Conversation.Source[message.source] : message.source; + return object; + }; + + /** + * Converts this DeleteConversationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DeleteConversationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteConversationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteConversationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DeleteConversationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteConversationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DeleteConversationRequest"; + }; + + return DeleteConversationRequest; + })(); + + v1.BatchDeleteConversationsRequest = (function() { + + /** + * Properties of a BatchDeleteConversationsRequest. + * @memberof google.cloud.ces.v1 + * @interface IBatchDeleteConversationsRequest + * @property {string|null} [parent] BatchDeleteConversationsRequest parent + * @property {Array.|null} [conversations] BatchDeleteConversationsRequest conversations + */ + + /** + * Constructs a new BatchDeleteConversationsRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a BatchDeleteConversationsRequest. + * @implements IBatchDeleteConversationsRequest + * @constructor + * @param {google.cloud.ces.v1.IBatchDeleteConversationsRequest=} [properties] Properties to set + */ + function BatchDeleteConversationsRequest(properties) { + this.conversations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteConversationsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest + * @instance + */ + BatchDeleteConversationsRequest.prototype.parent = ""; + + /** + * BatchDeleteConversationsRequest conversations. + * @member {Array.} conversations + * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest + * @instance + */ + BatchDeleteConversationsRequest.prototype.conversations = $util.emptyArray; + + /** + * Creates a new BatchDeleteConversationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest + * @static + * @param {google.cloud.ces.v1.IBatchDeleteConversationsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest instance + */ + BatchDeleteConversationsRequest.create = function create(properties) { + return new BatchDeleteConversationsRequest(properties); + }; + + /** + * Encodes the specified BatchDeleteConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1.BatchDeleteConversationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest + * @static + * @param {google.cloud.ces.v1.IBatchDeleteConversationsRequest} message BatchDeleteConversationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteConversationsRequest.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.conversations != null && message.conversations.length) + for (var i = 0; i < message.conversations.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.conversations[i]); + return writer; + }; + + /** + * Encodes the specified BatchDeleteConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BatchDeleteConversationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest + * @static + * @param {google.cloud.ces.v1.IBatchDeleteConversationsRequest} message BatchDeleteConversationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteConversationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteConversationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.BatchDeleteConversationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.conversations && message.conversations.length)) + message.conversations = []; + message.conversations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteConversationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteConversationsRequest message. + * @function verify + * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteConversationsRequest.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.conversations != null && message.hasOwnProperty("conversations")) { + if (!Array.isArray(message.conversations)) + return "conversations: array expected"; + for (var i = 0; i < message.conversations.length; ++i) + if (!$util.isString(message.conversations[i])) + return "conversations: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchDeleteConversationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest + */ + BatchDeleteConversationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.BatchDeleteConversationsRequest) + return object; + var message = new $root.google.cloud.ces.v1.BatchDeleteConversationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.conversations) { + if (!Array.isArray(object.conversations)) + throw TypeError(".google.cloud.ces.v1.BatchDeleteConversationsRequest.conversations: array expected"); + message.conversations = []; + for (var i = 0; i < object.conversations.length; ++i) + message.conversations[i] = String(object.conversations[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchDeleteConversationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest + * @static + * @param {google.cloud.ces.v1.BatchDeleteConversationsRequest} message BatchDeleteConversationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteConversationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conversations = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.conversations && message.conversations.length) { + object.conversations = []; + for (var j = 0; j < message.conversations.length; ++j) + object.conversations[j] = message.conversations[j]; + } + return object; + }; + + /** + * Converts this BatchDeleteConversationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteConversationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteConversationsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteConversationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.BatchDeleteConversationsRequest"; + }; + + return BatchDeleteConversationsRequest; + })(); + + v1.BatchDeleteConversationsResponse = (function() { + + /** + * Properties of a BatchDeleteConversationsResponse. + * @memberof google.cloud.ces.v1 + * @interface IBatchDeleteConversationsResponse + * @property {Array.|null} [deletedConversations] BatchDeleteConversationsResponse deletedConversations + * @property {Array.|null} [failedConversations] BatchDeleteConversationsResponse failedConversations + * @property {Array.|null} [errorMessages] BatchDeleteConversationsResponse errorMessages + */ + + /** + * Constructs a new BatchDeleteConversationsResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a BatchDeleteConversationsResponse. + * @implements IBatchDeleteConversationsResponse + * @constructor + * @param {google.cloud.ces.v1.IBatchDeleteConversationsResponse=} [properties] Properties to set + */ + function BatchDeleteConversationsResponse(properties) { + this.deletedConversations = []; + this.failedConversations = []; + this.errorMessages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteConversationsResponse deletedConversations. + * @member {Array.} deletedConversations + * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse + * @instance + */ + BatchDeleteConversationsResponse.prototype.deletedConversations = $util.emptyArray; + + /** + * BatchDeleteConversationsResponse failedConversations. + * @member {Array.} failedConversations + * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse + * @instance + */ + BatchDeleteConversationsResponse.prototype.failedConversations = $util.emptyArray; + + /** + * BatchDeleteConversationsResponse errorMessages. + * @member {Array.} errorMessages + * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse + * @instance + */ + BatchDeleteConversationsResponse.prototype.errorMessages = $util.emptyArray; + + /** + * Creates a new BatchDeleteConversationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse + * @static + * @param {google.cloud.ces.v1.IBatchDeleteConversationsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse instance + */ + BatchDeleteConversationsResponse.create = function create(properties) { + return new BatchDeleteConversationsResponse(properties); + }; + + /** + * Encodes the specified BatchDeleteConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1.BatchDeleteConversationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse + * @static + * @param {google.cloud.ces.v1.IBatchDeleteConversationsResponse} message BatchDeleteConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteConversationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deletedConversations != null && message.deletedConversations.length) + for (var i = 0; i < message.deletedConversations.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.deletedConversations[i]); + if (message.failedConversations != null && message.failedConversations.length) + for (var i = 0; i < message.failedConversations.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.failedConversations[i]); + if (message.errorMessages != null && message.errorMessages.length) + for (var i = 0; i < message.errorMessages.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorMessages[i]); + return writer; + }; + + /** + * Encodes the specified BatchDeleteConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BatchDeleteConversationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse + * @static + * @param {google.cloud.ces.v1.IBatchDeleteConversationsResponse} message BatchDeleteConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteConversationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteConversationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.BatchDeleteConversationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.deletedConversations && message.deletedConversations.length)) + message.deletedConversations = []; + message.deletedConversations.push(reader.string()); + break; + } + case 2: { + if (!(message.failedConversations && message.failedConversations.length)) + message.failedConversations = []; + message.failedConversations.push(reader.string()); + break; + } + case 3: { + if (!(message.errorMessages && message.errorMessages.length)) + message.errorMessages = []; + message.errorMessages.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteConversationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteConversationsResponse message. + * @function verify + * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteConversationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deletedConversations != null && message.hasOwnProperty("deletedConversations")) { + if (!Array.isArray(message.deletedConversations)) + return "deletedConversations: array expected"; + for (var i = 0; i < message.deletedConversations.length; ++i) + if (!$util.isString(message.deletedConversations[i])) + return "deletedConversations: string[] expected"; + } + if (message.failedConversations != null && message.hasOwnProperty("failedConversations")) { + if (!Array.isArray(message.failedConversations)) + return "failedConversations: array expected"; + for (var i = 0; i < message.failedConversations.length; ++i) + if (!$util.isString(message.failedConversations[i])) + return "failedConversations: string[] expected"; + } + if (message.errorMessages != null && message.hasOwnProperty("errorMessages")) { + if (!Array.isArray(message.errorMessages)) + return "errorMessages: array expected"; + for (var i = 0; i < message.errorMessages.length; ++i) + if (!$util.isString(message.errorMessages[i])) + return "errorMessages: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchDeleteConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse + */ + BatchDeleteConversationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.BatchDeleteConversationsResponse) + return object; + var message = new $root.google.cloud.ces.v1.BatchDeleteConversationsResponse(); + if (object.deletedConversations) { + if (!Array.isArray(object.deletedConversations)) + throw TypeError(".google.cloud.ces.v1.BatchDeleteConversationsResponse.deletedConversations: array expected"); + message.deletedConversations = []; + for (var i = 0; i < object.deletedConversations.length; ++i) + message.deletedConversations[i] = String(object.deletedConversations[i]); + } + if (object.failedConversations) { + if (!Array.isArray(object.failedConversations)) + throw TypeError(".google.cloud.ces.v1.BatchDeleteConversationsResponse.failedConversations: array expected"); + message.failedConversations = []; + for (var i = 0; i < object.failedConversations.length; ++i) + message.failedConversations[i] = String(object.failedConversations[i]); + } + if (object.errorMessages) { + if (!Array.isArray(object.errorMessages)) + throw TypeError(".google.cloud.ces.v1.BatchDeleteConversationsResponse.errorMessages: array expected"); + message.errorMessages = []; + for (var i = 0; i < object.errorMessages.length; ++i) + message.errorMessages[i] = String(object.errorMessages[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchDeleteConversationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse + * @static + * @param {google.cloud.ces.v1.BatchDeleteConversationsResponse} message BatchDeleteConversationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteConversationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.deletedConversations = []; + object.failedConversations = []; + object.errorMessages = []; + } + if (message.deletedConversations && message.deletedConversations.length) { + object.deletedConversations = []; + for (var j = 0; j < message.deletedConversations.length; ++j) + object.deletedConversations[j] = message.deletedConversations[j]; + } + if (message.failedConversations && message.failedConversations.length) { + object.failedConversations = []; + for (var j = 0; j < message.failedConversations.length; ++j) + object.failedConversations[j] = message.failedConversations[j]; + } + if (message.errorMessages && message.errorMessages.length) { + object.errorMessages = []; + for (var j = 0; j < message.errorMessages.length; ++j) + object.errorMessages[j] = message.errorMessages[j]; + } + return object; + }; + + /** + * Converts this BatchDeleteConversationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteConversationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteConversationsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteConversationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.BatchDeleteConversationsResponse"; + }; + + return BatchDeleteConversationsResponse; + })(); + + v1.ListGuardrailsRequest = (function() { + + /** + * Properties of a ListGuardrailsRequest. + * @memberof google.cloud.ces.v1 + * @interface IListGuardrailsRequest + * @property {string|null} [parent] ListGuardrailsRequest parent + * @property {number|null} [pageSize] ListGuardrailsRequest pageSize + * @property {string|null} [pageToken] ListGuardrailsRequest pageToken + * @property {string|null} [filter] ListGuardrailsRequest filter + * @property {string|null} [orderBy] ListGuardrailsRequest orderBy + */ + + /** + * Constructs a new ListGuardrailsRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListGuardrailsRequest. + * @implements IListGuardrailsRequest + * @constructor + * @param {google.cloud.ces.v1.IListGuardrailsRequest=} [properties] Properties to set + */ + function ListGuardrailsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGuardrailsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.ListGuardrailsRequest + * @instance + */ + ListGuardrailsRequest.prototype.parent = ""; + + /** + * ListGuardrailsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1.ListGuardrailsRequest + * @instance + */ + ListGuardrailsRequest.prototype.pageSize = 0; + + /** + * ListGuardrailsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1.ListGuardrailsRequest + * @instance + */ + ListGuardrailsRequest.prototype.pageToken = ""; + + /** + * ListGuardrailsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1.ListGuardrailsRequest + * @instance + */ + ListGuardrailsRequest.prototype.filter = ""; + + /** + * ListGuardrailsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1.ListGuardrailsRequest + * @instance + */ + ListGuardrailsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListGuardrailsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListGuardrailsRequest + * @static + * @param {google.cloud.ces.v1.IListGuardrailsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListGuardrailsRequest} ListGuardrailsRequest instance + */ + ListGuardrailsRequest.create = function create(properties) { + return new ListGuardrailsRequest(properties); + }; + + /** + * Encodes the specified ListGuardrailsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListGuardrailsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListGuardrailsRequest + * @static + * @param {google.cloud.ces.v1.IListGuardrailsRequest} message ListGuardrailsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGuardrailsRequest.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 ListGuardrailsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListGuardrailsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListGuardrailsRequest + * @static + * @param {google.cloud.ces.v1.IListGuardrailsRequest} message ListGuardrailsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGuardrailsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGuardrailsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListGuardrailsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListGuardrailsRequest} ListGuardrailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGuardrailsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListGuardrailsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGuardrailsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListGuardrailsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListGuardrailsRequest} ListGuardrailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGuardrailsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGuardrailsRequest message. + * @function verify + * @memberof google.cloud.ces.v1.ListGuardrailsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGuardrailsRequest.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 ListGuardrailsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListGuardrailsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListGuardrailsRequest} ListGuardrailsRequest + */ + ListGuardrailsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListGuardrailsRequest) + return object; + var message = new $root.google.cloud.ces.v1.ListGuardrailsRequest(); + 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 ListGuardrailsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListGuardrailsRequest + * @static + * @param {google.cloud.ces.v1.ListGuardrailsRequest} message ListGuardrailsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGuardrailsRequest.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 ListGuardrailsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListGuardrailsRequest + * @instance + * @returns {Object.} JSON object + */ + ListGuardrailsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGuardrailsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListGuardrailsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGuardrailsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListGuardrailsRequest"; + }; + + return ListGuardrailsRequest; + })(); + + v1.ListGuardrailsResponse = (function() { + + /** + * Properties of a ListGuardrailsResponse. + * @memberof google.cloud.ces.v1 + * @interface IListGuardrailsResponse + * @property {Array.|null} [guardrails] ListGuardrailsResponse guardrails + * @property {string|null} [nextPageToken] ListGuardrailsResponse nextPageToken + */ + + /** + * Constructs a new ListGuardrailsResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListGuardrailsResponse. + * @implements IListGuardrailsResponse + * @constructor + * @param {google.cloud.ces.v1.IListGuardrailsResponse=} [properties] Properties to set + */ + function ListGuardrailsResponse(properties) { + this.guardrails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGuardrailsResponse guardrails. + * @member {Array.} guardrails + * @memberof google.cloud.ces.v1.ListGuardrailsResponse + * @instance + */ + ListGuardrailsResponse.prototype.guardrails = $util.emptyArray; + + /** + * ListGuardrailsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1.ListGuardrailsResponse + * @instance + */ + ListGuardrailsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListGuardrailsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListGuardrailsResponse + * @static + * @param {google.cloud.ces.v1.IListGuardrailsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListGuardrailsResponse} ListGuardrailsResponse instance + */ + ListGuardrailsResponse.create = function create(properties) { + return new ListGuardrailsResponse(properties); + }; + + /** + * Encodes the specified ListGuardrailsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListGuardrailsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListGuardrailsResponse + * @static + * @param {google.cloud.ces.v1.IListGuardrailsResponse} message ListGuardrailsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGuardrailsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.guardrails != null && message.guardrails.length) + for (var i = 0; i < message.guardrails.length; ++i) + $root.google.cloud.ces.v1.Guardrail.encode(message.guardrails[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 ListGuardrailsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListGuardrailsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListGuardrailsResponse + * @static + * @param {google.cloud.ces.v1.IListGuardrailsResponse} message ListGuardrailsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGuardrailsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGuardrailsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListGuardrailsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListGuardrailsResponse} ListGuardrailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGuardrailsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListGuardrailsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.guardrails && message.guardrails.length)) + message.guardrails = []; + message.guardrails.push($root.google.cloud.ces.v1.Guardrail.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGuardrailsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListGuardrailsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListGuardrailsResponse} ListGuardrailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGuardrailsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGuardrailsResponse message. + * @function verify + * @memberof google.cloud.ces.v1.ListGuardrailsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGuardrailsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.guardrails != null && message.hasOwnProperty("guardrails")) { + if (!Array.isArray(message.guardrails)) + return "guardrails: array expected"; + for (var i = 0; i < message.guardrails.length; ++i) { + var error = $root.google.cloud.ces.v1.Guardrail.verify(message.guardrails[i]); + if (error) + return "guardrails." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListGuardrailsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListGuardrailsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListGuardrailsResponse} ListGuardrailsResponse + */ + ListGuardrailsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListGuardrailsResponse) + return object; + var message = new $root.google.cloud.ces.v1.ListGuardrailsResponse(); + if (object.guardrails) { + if (!Array.isArray(object.guardrails)) + throw TypeError(".google.cloud.ces.v1.ListGuardrailsResponse.guardrails: array expected"); + message.guardrails = []; + for (var i = 0; i < object.guardrails.length; ++i) { + if (typeof object.guardrails[i] !== "object") + throw TypeError(".google.cloud.ces.v1.ListGuardrailsResponse.guardrails: object expected"); + message.guardrails[i] = $root.google.cloud.ces.v1.Guardrail.fromObject(object.guardrails[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListGuardrailsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListGuardrailsResponse + * @static + * @param {google.cloud.ces.v1.ListGuardrailsResponse} message ListGuardrailsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGuardrailsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.guardrails = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.guardrails && message.guardrails.length) { + object.guardrails = []; + for (var j = 0; j < message.guardrails.length; ++j) + object.guardrails[j] = $root.google.cloud.ces.v1.Guardrail.toObject(message.guardrails[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListGuardrailsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListGuardrailsResponse + * @instance + * @returns {Object.} JSON object + */ + ListGuardrailsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGuardrailsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListGuardrailsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGuardrailsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListGuardrailsResponse"; + }; + + return ListGuardrailsResponse; + })(); + + v1.GetGuardrailRequest = (function() { + + /** + * Properties of a GetGuardrailRequest. + * @memberof google.cloud.ces.v1 + * @interface IGetGuardrailRequest + * @property {string|null} [name] GetGuardrailRequest name + */ + + /** + * Constructs a new GetGuardrailRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a GetGuardrailRequest. + * @implements IGetGuardrailRequest + * @constructor + * @param {google.cloud.ces.v1.IGetGuardrailRequest=} [properties] Properties to set + */ + function GetGuardrailRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGuardrailRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.GetGuardrailRequest + * @instance + */ + GetGuardrailRequest.prototype.name = ""; + + /** + * Creates a new GetGuardrailRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.GetGuardrailRequest + * @static + * @param {google.cloud.ces.v1.IGetGuardrailRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.GetGuardrailRequest} GetGuardrailRequest instance + */ + GetGuardrailRequest.create = function create(properties) { + return new GetGuardrailRequest(properties); + }; + + /** + * Encodes the specified GetGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1.GetGuardrailRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.GetGuardrailRequest + * @static + * @param {google.cloud.ces.v1.IGetGuardrailRequest} message GetGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGuardrailRequest.encode = function encode(message, writer) { + 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 GetGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetGuardrailRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.GetGuardrailRequest + * @static + * @param {google.cloud.ces.v1.IGetGuardrailRequest} message GetGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGuardrailRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.GetGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.GetGuardrailRequest} GetGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGuardrailRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetGuardrailRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGuardrailRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.GetGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.GetGuardrailRequest} GetGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGuardrailRequest message. + * @function verify + * @memberof google.cloud.ces.v1.GetGuardrailRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGuardrailRequest.verify = function verify(message) { + if (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 GetGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.GetGuardrailRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.GetGuardrailRequest} GetGuardrailRequest + */ + GetGuardrailRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.GetGuardrailRequest) + return object; + var message = new $root.google.cloud.ces.v1.GetGuardrailRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGuardrailRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.GetGuardrailRequest + * @static + * @param {google.cloud.ces.v1.GetGuardrailRequest} message GetGuardrailRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGuardrailRequest.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 GetGuardrailRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.GetGuardrailRequest + * @instance + * @returns {Object.} JSON object + */ + GetGuardrailRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGuardrailRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.GetGuardrailRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.GetGuardrailRequest"; + }; + + return GetGuardrailRequest; + })(); + + v1.CreateGuardrailRequest = (function() { + + /** + * Properties of a CreateGuardrailRequest. + * @memberof google.cloud.ces.v1 + * @interface ICreateGuardrailRequest + * @property {string|null} [parent] CreateGuardrailRequest parent + * @property {string|null} [guardrailId] CreateGuardrailRequest guardrailId + * @property {google.cloud.ces.v1.IGuardrail|null} [guardrail] CreateGuardrailRequest guardrail + */ + + /** + * Constructs a new CreateGuardrailRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a CreateGuardrailRequest. + * @implements ICreateGuardrailRequest + * @constructor + * @param {google.cloud.ces.v1.ICreateGuardrailRequest=} [properties] Properties to set + */ + function CreateGuardrailRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGuardrailRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.CreateGuardrailRequest + * @instance + */ + CreateGuardrailRequest.prototype.parent = ""; + + /** + * CreateGuardrailRequest guardrailId. + * @member {string} guardrailId + * @memberof google.cloud.ces.v1.CreateGuardrailRequest + * @instance + */ + CreateGuardrailRequest.prototype.guardrailId = ""; + + /** + * CreateGuardrailRequest guardrail. + * @member {google.cloud.ces.v1.IGuardrail|null|undefined} guardrail + * @memberof google.cloud.ces.v1.CreateGuardrailRequest + * @instance + */ + CreateGuardrailRequest.prototype.guardrail = null; + + /** + * Creates a new CreateGuardrailRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.CreateGuardrailRequest + * @static + * @param {google.cloud.ces.v1.ICreateGuardrailRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.CreateGuardrailRequest} CreateGuardrailRequest instance + */ + CreateGuardrailRequest.create = function create(properties) { + return new CreateGuardrailRequest(properties); + }; + + /** + * Encodes the specified CreateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateGuardrailRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.CreateGuardrailRequest + * @static + * @param {google.cloud.ces.v1.ICreateGuardrailRequest} message CreateGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGuardrailRequest.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.guardrailId != null && Object.hasOwnProperty.call(message, "guardrailId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.guardrailId); + if (message.guardrail != null && Object.hasOwnProperty.call(message, "guardrail")) + $root.google.cloud.ces.v1.Guardrail.encode(message.guardrail, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateGuardrailRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.CreateGuardrailRequest + * @static + * @param {google.cloud.ces.v1.ICreateGuardrailRequest} message CreateGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGuardrailRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.CreateGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.CreateGuardrailRequest} CreateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGuardrailRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CreateGuardrailRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.guardrailId = reader.string(); + break; + } + case 3: { + message.guardrail = $root.google.cloud.ces.v1.Guardrail.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGuardrailRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.CreateGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.CreateGuardrailRequest} CreateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGuardrailRequest message. + * @function verify + * @memberof google.cloud.ces.v1.CreateGuardrailRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGuardrailRequest.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.guardrailId != null && message.hasOwnProperty("guardrailId")) + if (!$util.isString(message.guardrailId)) + return "guardrailId: string expected"; + if (message.guardrail != null && message.hasOwnProperty("guardrail")) { + var error = $root.google.cloud.ces.v1.Guardrail.verify(message.guardrail); + if (error) + return "guardrail." + error; + } + return null; + }; + + /** + * Creates a CreateGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.CreateGuardrailRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.CreateGuardrailRequest} CreateGuardrailRequest + */ + CreateGuardrailRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.CreateGuardrailRequest) + return object; + var message = new $root.google.cloud.ces.v1.CreateGuardrailRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.guardrailId != null) + message.guardrailId = String(object.guardrailId); + if (object.guardrail != null) { + if (typeof object.guardrail !== "object") + throw TypeError(".google.cloud.ces.v1.CreateGuardrailRequest.guardrail: object expected"); + message.guardrail = $root.google.cloud.ces.v1.Guardrail.fromObject(object.guardrail); + } + return message; + }; + + /** + * Creates a plain object from a CreateGuardrailRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.CreateGuardrailRequest + * @static + * @param {google.cloud.ces.v1.CreateGuardrailRequest} message CreateGuardrailRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGuardrailRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.guardrailId = ""; + object.guardrail = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.guardrailId != null && message.hasOwnProperty("guardrailId")) + object.guardrailId = message.guardrailId; + if (message.guardrail != null && message.hasOwnProperty("guardrail")) + object.guardrail = $root.google.cloud.ces.v1.Guardrail.toObject(message.guardrail, options); + return object; + }; + + /** + * Converts this CreateGuardrailRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.CreateGuardrailRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGuardrailRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateGuardrailRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.CreateGuardrailRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.CreateGuardrailRequest"; + }; + + return CreateGuardrailRequest; + })(); + + v1.UpdateGuardrailRequest = (function() { + + /** + * Properties of an UpdateGuardrailRequest. + * @memberof google.cloud.ces.v1 + * @interface IUpdateGuardrailRequest + * @property {google.cloud.ces.v1.IGuardrail|null} [guardrail] UpdateGuardrailRequest guardrail + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGuardrailRequest updateMask + */ + + /** + * Constructs a new UpdateGuardrailRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an UpdateGuardrailRequest. + * @implements IUpdateGuardrailRequest + * @constructor + * @param {google.cloud.ces.v1.IUpdateGuardrailRequest=} [properties] Properties to set + */ + function UpdateGuardrailRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateGuardrailRequest guardrail. + * @member {google.cloud.ces.v1.IGuardrail|null|undefined} guardrail + * @memberof google.cloud.ces.v1.UpdateGuardrailRequest + * @instance + */ + UpdateGuardrailRequest.prototype.guardrail = null; + + /** + * UpdateGuardrailRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1.UpdateGuardrailRequest + * @instance + */ + UpdateGuardrailRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateGuardrailRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.UpdateGuardrailRequest + * @static + * @param {google.cloud.ces.v1.IUpdateGuardrailRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.UpdateGuardrailRequest} UpdateGuardrailRequest instance + */ + UpdateGuardrailRequest.create = function create(properties) { + return new UpdateGuardrailRequest(properties); + }; + + /** + * Encodes the specified UpdateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateGuardrailRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.UpdateGuardrailRequest + * @static + * @param {google.cloud.ces.v1.IUpdateGuardrailRequest} message UpdateGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGuardrailRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.guardrail != null && Object.hasOwnProperty.call(message, "guardrail")) + $root.google.cloud.ces.v1.Guardrail.encode(message.guardrail, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateGuardrailRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.UpdateGuardrailRequest + * @static + * @param {google.cloud.ces.v1.IUpdateGuardrailRequest} message UpdateGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGuardrailRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.UpdateGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.UpdateGuardrailRequest} UpdateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGuardrailRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.UpdateGuardrailRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.guardrail = $root.google.cloud.ces.v1.Guardrail.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateGuardrailRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.UpdateGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.UpdateGuardrailRequest} UpdateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGuardrailRequest message. + * @function verify + * @memberof google.cloud.ces.v1.UpdateGuardrailRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGuardrailRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.guardrail != null && message.hasOwnProperty("guardrail")) { + var error = $root.google.cloud.ces.v1.Guardrail.verify(message.guardrail); + if (error) + return "guardrail." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.UpdateGuardrailRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.UpdateGuardrailRequest} UpdateGuardrailRequest + */ + UpdateGuardrailRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.UpdateGuardrailRequest) + return object; + var message = new $root.google.cloud.ces.v1.UpdateGuardrailRequest(); + if (object.guardrail != null) { + if (typeof object.guardrail !== "object") + throw TypeError(".google.cloud.ces.v1.UpdateGuardrailRequest.guardrail: object expected"); + message.guardrail = $root.google.cloud.ces.v1.Guardrail.fromObject(object.guardrail); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1.UpdateGuardrailRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateGuardrailRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.UpdateGuardrailRequest + * @static + * @param {google.cloud.ces.v1.UpdateGuardrailRequest} message UpdateGuardrailRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGuardrailRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.guardrail = null; + object.updateMask = null; + } + if (message.guardrail != null && message.hasOwnProperty("guardrail")) + object.guardrail = $root.google.cloud.ces.v1.Guardrail.toObject(message.guardrail, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateGuardrailRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.UpdateGuardrailRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateGuardrailRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateGuardrailRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.UpdateGuardrailRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.UpdateGuardrailRequest"; + }; + + return UpdateGuardrailRequest; + })(); + + v1.DeleteGuardrailRequest = (function() { + + /** + * Properties of a DeleteGuardrailRequest. + * @memberof google.cloud.ces.v1 + * @interface IDeleteGuardrailRequest + * @property {string|null} [name] DeleteGuardrailRequest name + * @property {boolean|null} [force] DeleteGuardrailRequest force + * @property {string|null} [etag] DeleteGuardrailRequest etag + */ + + /** + * Constructs a new DeleteGuardrailRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a DeleteGuardrailRequest. + * @implements IDeleteGuardrailRequest + * @constructor + * @param {google.cloud.ces.v1.IDeleteGuardrailRequest=} [properties] Properties to set + */ + function DeleteGuardrailRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGuardrailRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.DeleteGuardrailRequest + * @instance + */ + DeleteGuardrailRequest.prototype.name = ""; + + /** + * DeleteGuardrailRequest force. + * @member {boolean} force + * @memberof google.cloud.ces.v1.DeleteGuardrailRequest + * @instance + */ + DeleteGuardrailRequest.prototype.force = false; + + /** + * DeleteGuardrailRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1.DeleteGuardrailRequest + * @instance + */ + DeleteGuardrailRequest.prototype.etag = ""; + + /** + * Creates a new DeleteGuardrailRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DeleteGuardrailRequest + * @static + * @param {google.cloud.ces.v1.IDeleteGuardrailRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DeleteGuardrailRequest} DeleteGuardrailRequest instance + */ + DeleteGuardrailRequest.create = function create(properties) { + return new DeleteGuardrailRequest(properties); + }; + + /** + * Encodes the specified DeleteGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteGuardrailRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DeleteGuardrailRequest + * @static + * @param {google.cloud.ces.v1.IDeleteGuardrailRequest} message DeleteGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGuardrailRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteGuardrailRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DeleteGuardrailRequest + * @static + * @param {google.cloud.ces.v1.IDeleteGuardrailRequest} message DeleteGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGuardrailRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DeleteGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DeleteGuardrailRequest} DeleteGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGuardrailRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DeleteGuardrailRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGuardrailRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DeleteGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DeleteGuardrailRequest} DeleteGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGuardrailRequest message. + * @function verify + * @memberof google.cloud.ces.v1.DeleteGuardrailRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGuardrailRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DeleteGuardrailRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DeleteGuardrailRequest} DeleteGuardrailRequest + */ + DeleteGuardrailRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DeleteGuardrailRequest) + return object; + var message = new $root.google.cloud.ces.v1.DeleteGuardrailRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteGuardrailRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DeleteGuardrailRequest + * @static + * @param {google.cloud.ces.v1.DeleteGuardrailRequest} message DeleteGuardrailRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGuardrailRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteGuardrailRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DeleteGuardrailRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGuardrailRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteGuardrailRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DeleteGuardrailRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DeleteGuardrailRequest"; + }; + + return DeleteGuardrailRequest; + })(); + + v1.ListDeploymentsRequest = (function() { + + /** + * Properties of a ListDeploymentsRequest. + * @memberof google.cloud.ces.v1 + * @interface IListDeploymentsRequest + * @property {string|null} [parent] ListDeploymentsRequest parent + * @property {number|null} [pageSize] ListDeploymentsRequest pageSize + * @property {string|null} [pageToken] ListDeploymentsRequest pageToken + * @property {string|null} [orderBy] ListDeploymentsRequest orderBy + */ + + /** + * Constructs a new ListDeploymentsRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListDeploymentsRequest. + * @implements IListDeploymentsRequest + * @constructor + * @param {google.cloud.ces.v1.IListDeploymentsRequest=} [properties] Properties to set + */ + function ListDeploymentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDeploymentsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.parent = ""; + + /** + * ListDeploymentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.pageSize = 0; + + /** + * ListDeploymentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.pageToken = ""; + + /** + * ListDeploymentsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListDeploymentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListDeploymentsRequest + * @static + * @param {google.cloud.ces.v1.IListDeploymentsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListDeploymentsRequest} ListDeploymentsRequest instance + */ + ListDeploymentsRequest.create = function create(properties) { + return new ListDeploymentsRequest(properties); + }; + + /** + * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListDeploymentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListDeploymentsRequest + * @static + * @param {google.cloud.ces.v1.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsRequest.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListDeploymentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListDeploymentsRequest + * @static + * @param {google.cloud.ces.v1.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListDeploymentsRequest} ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListDeploymentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListDeploymentsRequest} ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeploymentsRequest message. + * @function verify + * @memberof google.cloud.ces.v1.ListDeploymentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeploymentsRequest.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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListDeploymentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListDeploymentsRequest} ListDeploymentsRequest + */ + ListDeploymentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListDeploymentsRequest) + return object; + var message = new $root.google.cloud.ces.v1.ListDeploymentsRequest(); + 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.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListDeploymentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListDeploymentsRequest + * @static + * @param {google.cloud.ces.v1.ListDeploymentsRequest} message ListDeploymentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeploymentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + 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.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListDeploymentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListDeploymentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDeploymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeploymentsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListDeploymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeploymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListDeploymentsRequest"; + }; + + return ListDeploymentsRequest; + })(); + + v1.ListDeploymentsResponse = (function() { + + /** + * Properties of a ListDeploymentsResponse. + * @memberof google.cloud.ces.v1 + * @interface IListDeploymentsResponse + * @property {Array.|null} [deployments] ListDeploymentsResponse deployments + * @property {string|null} [nextPageToken] ListDeploymentsResponse nextPageToken + */ + + /** + * Constructs a new ListDeploymentsResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListDeploymentsResponse. + * @implements IListDeploymentsResponse + * @constructor + * @param {google.cloud.ces.v1.IListDeploymentsResponse=} [properties] Properties to set + */ + function ListDeploymentsResponse(properties) { + this.deployments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDeploymentsResponse deployments. + * @member {Array.} deployments + * @memberof google.cloud.ces.v1.ListDeploymentsResponse + * @instance + */ + ListDeploymentsResponse.prototype.deployments = $util.emptyArray; + + /** + * ListDeploymentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1.ListDeploymentsResponse + * @instance + */ + ListDeploymentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDeploymentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListDeploymentsResponse + * @static + * @param {google.cloud.ces.v1.IListDeploymentsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListDeploymentsResponse} ListDeploymentsResponse instance + */ + ListDeploymentsResponse.create = function create(properties) { + return new ListDeploymentsResponse(properties); + }; + + /** + * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListDeploymentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListDeploymentsResponse + * @static + * @param {google.cloud.ces.v1.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployments != null && message.deployments.length) + for (var i = 0; i < message.deployments.length; ++i) + $root.google.cloud.ces.v1.Deployment.encode(message.deployments[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 ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListDeploymentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListDeploymentsResponse + * @static + * @param {google.cloud.ces.v1.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListDeploymentsResponse} ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListDeploymentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.deployments && message.deployments.length)) + message.deployments = []; + message.deployments.push($root.google.cloud.ces.v1.Deployment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListDeploymentsResponse} ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeploymentsResponse message. + * @function verify + * @memberof google.cloud.ces.v1.ListDeploymentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeploymentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deployments != null && message.hasOwnProperty("deployments")) { + if (!Array.isArray(message.deployments)) + return "deployments: array expected"; + for (var i = 0; i < message.deployments.length; ++i) { + var error = $root.google.cloud.ces.v1.Deployment.verify(message.deployments[i]); + if (error) + return "deployments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListDeploymentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListDeploymentsResponse} ListDeploymentsResponse + */ + ListDeploymentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListDeploymentsResponse) + return object; + var message = new $root.google.cloud.ces.v1.ListDeploymentsResponse(); + if (object.deployments) { + if (!Array.isArray(object.deployments)) + throw TypeError(".google.cloud.ces.v1.ListDeploymentsResponse.deployments: array expected"); + message.deployments = []; + for (var i = 0; i < object.deployments.length; ++i) { + if (typeof object.deployments[i] !== "object") + throw TypeError(".google.cloud.ces.v1.ListDeploymentsResponse.deployments: object expected"); + message.deployments[i] = $root.google.cloud.ces.v1.Deployment.fromObject(object.deployments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListDeploymentsResponse + * @static + * @param {google.cloud.ces.v1.ListDeploymentsResponse} message ListDeploymentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeploymentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.deployments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.deployments && message.deployments.length) { + object.deployments = []; + for (var j = 0; j < message.deployments.length; ++j) + object.deployments[j] = $root.google.cloud.ces.v1.Deployment.toObject(message.deployments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDeploymentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListDeploymentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDeploymentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeploymentsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListDeploymentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeploymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListDeploymentsResponse"; + }; + + return ListDeploymentsResponse; + })(); + + v1.GetDeploymentRequest = (function() { + + /** + * Properties of a GetDeploymentRequest. + * @memberof google.cloud.ces.v1 + * @interface IGetDeploymentRequest + * @property {string|null} [name] GetDeploymentRequest name + */ + + /** + * Constructs a new GetDeploymentRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a GetDeploymentRequest. + * @implements IGetDeploymentRequest + * @constructor + * @param {google.cloud.ces.v1.IGetDeploymentRequest=} [properties] Properties to set + */ + function GetDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.GetDeploymentRequest + * @instance + */ + GetDeploymentRequest.prototype.name = ""; + + /** + * Creates a new GetDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.GetDeploymentRequest + * @static + * @param {google.cloud.ces.v1.IGetDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.GetDeploymentRequest} GetDeploymentRequest instance + */ + GetDeploymentRequest.create = function create(properties) { + return new GetDeploymentRequest(properties); + }; + + /** + * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1.GetDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.GetDeploymentRequest + * @static + * @param {google.cloud.ces.v1.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeploymentRequest.encode = function encode(message, writer) { + 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 GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.GetDeploymentRequest + * @static + * @param {google.cloud.ces.v1.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.GetDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.GetDeploymentRequest} GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.GetDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.GetDeploymentRequest} GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDeploymentRequest message. + * @function verify + * @memberof google.cloud.ces.v1.GetDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDeploymentRequest.verify = function verify(message) { + if (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 GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.GetDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.GetDeploymentRequest} GetDeploymentRequest + */ + GetDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.GetDeploymentRequest) + return object; + var message = new $root.google.cloud.ces.v1.GetDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.GetDeploymentRequest + * @static + * @param {google.cloud.ces.v1.GetDeploymentRequest} message GetDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDeploymentRequest.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 GetDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.GetDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + GetDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.GetDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.GetDeploymentRequest"; + }; + + return GetDeploymentRequest; + })(); + + v1.CreateDeploymentRequest = (function() { + + /** + * Properties of a CreateDeploymentRequest. + * @memberof google.cloud.ces.v1 + * @interface ICreateDeploymentRequest + * @property {string|null} [parent] CreateDeploymentRequest parent + * @property {string|null} [deploymentId] CreateDeploymentRequest deploymentId + * @property {google.cloud.ces.v1.IDeployment|null} [deployment] CreateDeploymentRequest deployment + */ + + /** + * Constructs a new CreateDeploymentRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a CreateDeploymentRequest. + * @implements ICreateDeploymentRequest + * @constructor + * @param {google.cloud.ces.v1.ICreateDeploymentRequest=} [properties] Properties to set + */ + function CreateDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDeploymentRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.CreateDeploymentRequest + * @instance + */ + CreateDeploymentRequest.prototype.parent = ""; + + /** + * CreateDeploymentRequest deploymentId. + * @member {string} deploymentId + * @memberof google.cloud.ces.v1.CreateDeploymentRequest + * @instance + */ + CreateDeploymentRequest.prototype.deploymentId = ""; + + /** + * CreateDeploymentRequest deployment. + * @member {google.cloud.ces.v1.IDeployment|null|undefined} deployment + * @memberof google.cloud.ces.v1.CreateDeploymentRequest + * @instance + */ + CreateDeploymentRequest.prototype.deployment = null; + + /** + * Creates a new CreateDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.CreateDeploymentRequest + * @static + * @param {google.cloud.ces.v1.ICreateDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.CreateDeploymentRequest} CreateDeploymentRequest instance + */ + CreateDeploymentRequest.create = function create(properties) { + return new CreateDeploymentRequest(properties); + }; + + /** + * Encodes the specified CreateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.CreateDeploymentRequest + * @static + * @param {google.cloud.ces.v1.ICreateDeploymentRequest} message CreateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDeploymentRequest.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.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + $root.google.cloud.ces.v1.Deployment.encode(message.deployment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deploymentId != null && Object.hasOwnProperty.call(message, "deploymentId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deploymentId); + return writer; + }; + + /** + * Encodes the specified CreateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.CreateDeploymentRequest + * @static + * @param {google.cloud.ces.v1.ICreateDeploymentRequest} message CreateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.CreateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.CreateDeploymentRequest} CreateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CreateDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.deploymentId = reader.string(); + break; + } + case 2: { + message.deployment = $root.google.cloud.ces.v1.Deployment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.CreateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.CreateDeploymentRequest} CreateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDeploymentRequest message. + * @function verify + * @memberof google.cloud.ces.v1.CreateDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDeploymentRequest.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.deploymentId != null && message.hasOwnProperty("deploymentId")) + if (!$util.isString(message.deploymentId)) + return "deploymentId: string expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) { + var error = $root.google.cloud.ces.v1.Deployment.verify(message.deployment); + if (error) + return "deployment." + error; + } + return null; + }; + + /** + * Creates a CreateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.CreateDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.CreateDeploymentRequest} CreateDeploymentRequest + */ + CreateDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.CreateDeploymentRequest) + return object; + var message = new $root.google.cloud.ces.v1.CreateDeploymentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.deploymentId != null) + message.deploymentId = String(object.deploymentId); + if (object.deployment != null) { + if (typeof object.deployment !== "object") + throw TypeError(".google.cloud.ces.v1.CreateDeploymentRequest.deployment: object expected"); + message.deployment = $root.google.cloud.ces.v1.Deployment.fromObject(object.deployment); + } + return message; + }; + + /** + * Creates a plain object from a CreateDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.CreateDeploymentRequest + * @static + * @param {google.cloud.ces.v1.CreateDeploymentRequest} message CreateDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.deployment = null; + object.deploymentId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = $root.google.cloud.ces.v1.Deployment.toObject(message.deployment, options); + if (message.deploymentId != null && message.hasOwnProperty("deploymentId")) + object.deploymentId = message.deploymentId; + return object; + }; + + /** + * Converts this CreateDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.CreateDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.CreateDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.CreateDeploymentRequest"; + }; + + return CreateDeploymentRequest; + })(); + + v1.UpdateDeploymentRequest = (function() { + + /** + * Properties of an UpdateDeploymentRequest. + * @memberof google.cloud.ces.v1 + * @interface IUpdateDeploymentRequest + * @property {google.cloud.ces.v1.IDeployment|null} [deployment] UpdateDeploymentRequest deployment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDeploymentRequest updateMask + */ + + /** + * Constructs a new UpdateDeploymentRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an UpdateDeploymentRequest. + * @implements IUpdateDeploymentRequest + * @constructor + * @param {google.cloud.ces.v1.IUpdateDeploymentRequest=} [properties] Properties to set + */ + function UpdateDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDeploymentRequest deployment. + * @member {google.cloud.ces.v1.IDeployment|null|undefined} deployment + * @memberof google.cloud.ces.v1.UpdateDeploymentRequest + * @instance + */ + UpdateDeploymentRequest.prototype.deployment = null; + + /** + * UpdateDeploymentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1.UpdateDeploymentRequest + * @instance + */ + UpdateDeploymentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.UpdateDeploymentRequest + * @static + * @param {google.cloud.ces.v1.IUpdateDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.UpdateDeploymentRequest} UpdateDeploymentRequest instance + */ + UpdateDeploymentRequest.create = function create(properties) { + return new UpdateDeploymentRequest(properties); + }; + + /** + * Encodes the specified UpdateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.UpdateDeploymentRequest + * @static + * @param {google.cloud.ces.v1.IUpdateDeploymentRequest} message UpdateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + $root.google.cloud.ces.v1.Deployment.encode(message.deployment, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.UpdateDeploymentRequest + * @static + * @param {google.cloud.ces.v1.IUpdateDeploymentRequest} message UpdateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.UpdateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.UpdateDeploymentRequest} UpdateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.UpdateDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deployment = $root.google.cloud.ces.v1.Deployment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.UpdateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.UpdateDeploymentRequest} UpdateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDeploymentRequest message. + * @function verify + * @memberof google.cloud.ces.v1.UpdateDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) { + var error = $root.google.cloud.ces.v1.Deployment.verify(message.deployment); + if (error) + return "deployment." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.UpdateDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.UpdateDeploymentRequest} UpdateDeploymentRequest + */ + UpdateDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.UpdateDeploymentRequest) + return object; + var message = new $root.google.cloud.ces.v1.UpdateDeploymentRequest(); + if (object.deployment != null) { + if (typeof object.deployment !== "object") + throw TypeError(".google.cloud.ces.v1.UpdateDeploymentRequest.deployment: object expected"); + message.deployment = $root.google.cloud.ces.v1.Deployment.fromObject(object.deployment); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1.UpdateDeploymentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.UpdateDeploymentRequest + * @static + * @param {google.cloud.ces.v1.UpdateDeploymentRequest} message UpdateDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deployment = null; + object.updateMask = null; + } + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = $root.google.cloud.ces.v1.Deployment.toObject(message.deployment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.UpdateDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.UpdateDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.UpdateDeploymentRequest"; + }; + + return UpdateDeploymentRequest; + })(); + + v1.DeleteDeploymentRequest = (function() { + + /** + * Properties of a DeleteDeploymentRequest. + * @memberof google.cloud.ces.v1 + * @interface IDeleteDeploymentRequest + * @property {string|null} [name] DeleteDeploymentRequest name + * @property {string|null} [etag] DeleteDeploymentRequest etag + */ + + /** + * Constructs a new DeleteDeploymentRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a DeleteDeploymentRequest. + * @implements IDeleteDeploymentRequest + * @constructor + * @param {google.cloud.ces.v1.IDeleteDeploymentRequest=} [properties] Properties to set + */ + function DeleteDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.DeleteDeploymentRequest + * @instance + */ + DeleteDeploymentRequest.prototype.name = ""; + + /** + * DeleteDeploymentRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1.DeleteDeploymentRequest + * @instance + */ + DeleteDeploymentRequest.prototype.etag = ""; + + /** + * Creates a new DeleteDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DeleteDeploymentRequest + * @static + * @param {google.cloud.ces.v1.IDeleteDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DeleteDeploymentRequest} DeleteDeploymentRequest instance + */ + DeleteDeploymentRequest.create = function create(properties) { + return new DeleteDeploymentRequest(properties); + }; + + /** + * Encodes the specified DeleteDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DeleteDeploymentRequest + * @static + * @param {google.cloud.ces.v1.IDeleteDeploymentRequest} message DeleteDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DeleteDeploymentRequest + * @static + * @param {google.cloud.ces.v1.IDeleteDeploymentRequest} message DeleteDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DeleteDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DeleteDeploymentRequest} DeleteDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DeleteDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DeleteDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DeleteDeploymentRequest} DeleteDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDeploymentRequest message. + * @function verify + * @memberof google.cloud.ces.v1.DeleteDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DeleteDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DeleteDeploymentRequest} DeleteDeploymentRequest + */ + DeleteDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DeleteDeploymentRequest) + return object; + var message = new $root.google.cloud.ces.v1.DeleteDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DeleteDeploymentRequest + * @static + * @param {google.cloud.ces.v1.DeleteDeploymentRequest} message DeleteDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DeleteDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DeleteDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DeleteDeploymentRequest"; + }; + + return DeleteDeploymentRequest; + })(); + + v1.ListToolsetsRequest = (function() { + + /** + * Properties of a ListToolsetsRequest. + * @memberof google.cloud.ces.v1 + * @interface IListToolsetsRequest + * @property {string|null} [parent] ListToolsetsRequest parent + * @property {number|null} [pageSize] ListToolsetsRequest pageSize + * @property {string|null} [pageToken] ListToolsetsRequest pageToken + * @property {string|null} [filter] ListToolsetsRequest filter + * @property {string|null} [orderBy] ListToolsetsRequest orderBy + */ + + /** + * Constructs a new ListToolsetsRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListToolsetsRequest. + * @implements IListToolsetsRequest + * @constructor + * @param {google.cloud.ces.v1.IListToolsetsRequest=} [properties] Properties to set + */ + function ListToolsetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolsetsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.ListToolsetsRequest + * @instance + */ + ListToolsetsRequest.prototype.parent = ""; + + /** + * ListToolsetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1.ListToolsetsRequest + * @instance + */ + ListToolsetsRequest.prototype.pageSize = 0; + + /** + * ListToolsetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1.ListToolsetsRequest + * @instance + */ + ListToolsetsRequest.prototype.pageToken = ""; + + /** + * ListToolsetsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1.ListToolsetsRequest + * @instance + */ + ListToolsetsRequest.prototype.filter = ""; + + /** + * ListToolsetsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1.ListToolsetsRequest + * @instance + */ + ListToolsetsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListToolsetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListToolsetsRequest + * @static + * @param {google.cloud.ces.v1.IListToolsetsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListToolsetsRequest} ListToolsetsRequest instance + */ + ListToolsetsRequest.create = function create(properties) { + return new ListToolsetsRequest(properties); + }; + + /** + * Encodes the specified ListToolsetsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListToolsetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListToolsetsRequest + * @static + * @param {google.cloud.ces.v1.IListToolsetsRequest} message ListToolsetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsetsRequest.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 ListToolsetsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListToolsetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListToolsetsRequest + * @static + * @param {google.cloud.ces.v1.IListToolsetsRequest} message ListToolsetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolsetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListToolsetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListToolsetsRequest} ListToolsetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsetsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListToolsetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolsetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListToolsetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListToolsetsRequest} ListToolsetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolsetsRequest message. + * @function verify + * @memberof google.cloud.ces.v1.ListToolsetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolsetsRequest.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 ListToolsetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListToolsetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListToolsetsRequest} ListToolsetsRequest + */ + ListToolsetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListToolsetsRequest) + return object; + var message = new $root.google.cloud.ces.v1.ListToolsetsRequest(); + 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 ListToolsetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListToolsetsRequest + * @static + * @param {google.cloud.ces.v1.ListToolsetsRequest} message ListToolsetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolsetsRequest.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 ListToolsetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListToolsetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListToolsetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolsetsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListToolsetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolsetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListToolsetsRequest"; + }; + + return ListToolsetsRequest; + })(); + + v1.ListToolsetsResponse = (function() { + + /** + * Properties of a ListToolsetsResponse. + * @memberof google.cloud.ces.v1 + * @interface IListToolsetsResponse + * @property {Array.|null} [toolsets] ListToolsetsResponse toolsets + * @property {string|null} [nextPageToken] ListToolsetsResponse nextPageToken + */ + + /** + * Constructs a new ListToolsetsResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListToolsetsResponse. + * @implements IListToolsetsResponse + * @constructor + * @param {google.cloud.ces.v1.IListToolsetsResponse=} [properties] Properties to set + */ + function ListToolsetsResponse(properties) { + this.toolsets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolsetsResponse toolsets. + * @member {Array.} toolsets + * @memberof google.cloud.ces.v1.ListToolsetsResponse + * @instance + */ + ListToolsetsResponse.prototype.toolsets = $util.emptyArray; + + /** + * ListToolsetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1.ListToolsetsResponse + * @instance + */ + ListToolsetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListToolsetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListToolsetsResponse + * @static + * @param {google.cloud.ces.v1.IListToolsetsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListToolsetsResponse} ListToolsetsResponse instance + */ + ListToolsetsResponse.create = function create(properties) { + return new ListToolsetsResponse(properties); + }; + + /** + * Encodes the specified ListToolsetsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListToolsetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListToolsetsResponse + * @static + * @param {google.cloud.ces.v1.IListToolsetsResponse} message ListToolsetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolsets != null && message.toolsets.length) + for (var i = 0; i < message.toolsets.length; ++i) + $root.google.cloud.ces.v1.Toolset.encode(message.toolsets[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 ListToolsetsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListToolsetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListToolsetsResponse + * @static + * @param {google.cloud.ces.v1.IListToolsetsResponse} message ListToolsetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolsetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListToolsetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListToolsetsResponse} ListToolsetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsetsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListToolsetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.toolsets && message.toolsets.length)) + message.toolsets = []; + message.toolsets.push($root.google.cloud.ces.v1.Toolset.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolsetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListToolsetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListToolsetsResponse} ListToolsetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolsetsResponse message. + * @function verify + * @memberof google.cloud.ces.v1.ListToolsetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolsetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolsets != null && message.hasOwnProperty("toolsets")) { + if (!Array.isArray(message.toolsets)) + return "toolsets: array expected"; + for (var i = 0; i < message.toolsets.length; ++i) { + var error = $root.google.cloud.ces.v1.Toolset.verify(message.toolsets[i]); + if (error) + return "toolsets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListToolsetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListToolsetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListToolsetsResponse} ListToolsetsResponse + */ + ListToolsetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListToolsetsResponse) + return object; + var message = new $root.google.cloud.ces.v1.ListToolsetsResponse(); + if (object.toolsets) { + if (!Array.isArray(object.toolsets)) + throw TypeError(".google.cloud.ces.v1.ListToolsetsResponse.toolsets: array expected"); + message.toolsets = []; + for (var i = 0; i < object.toolsets.length; ++i) { + if (typeof object.toolsets[i] !== "object") + throw TypeError(".google.cloud.ces.v1.ListToolsetsResponse.toolsets: object expected"); + message.toolsets[i] = $root.google.cloud.ces.v1.Toolset.fromObject(object.toolsets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListToolsetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListToolsetsResponse + * @static + * @param {google.cloud.ces.v1.ListToolsetsResponse} message ListToolsetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolsetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.toolsets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.toolsets && message.toolsets.length) { + object.toolsets = []; + for (var j = 0; j < message.toolsets.length; ++j) + object.toolsets[j] = $root.google.cloud.ces.v1.Toolset.toObject(message.toolsets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListToolsetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListToolsetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListToolsetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolsetsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListToolsetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolsetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListToolsetsResponse"; + }; + + return ListToolsetsResponse; + })(); + + v1.GetToolsetRequest = (function() { + + /** + * Properties of a GetToolsetRequest. + * @memberof google.cloud.ces.v1 + * @interface IGetToolsetRequest + * @property {string|null} [name] GetToolsetRequest name + */ + + /** + * Constructs a new GetToolsetRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a GetToolsetRequest. + * @implements IGetToolsetRequest + * @constructor + * @param {google.cloud.ces.v1.IGetToolsetRequest=} [properties] Properties to set + */ + function GetToolsetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetToolsetRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.GetToolsetRequest + * @instance + */ + GetToolsetRequest.prototype.name = ""; + + /** + * Creates a new GetToolsetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.GetToolsetRequest + * @static + * @param {google.cloud.ces.v1.IGetToolsetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.GetToolsetRequest} GetToolsetRequest instance + */ + GetToolsetRequest.create = function create(properties) { + return new GetToolsetRequest(properties); + }; + + /** + * Encodes the specified GetToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1.GetToolsetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.GetToolsetRequest + * @static + * @param {google.cloud.ces.v1.IGetToolsetRequest} message GetToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolsetRequest.encode = function encode(message, writer) { + 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 GetToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetToolsetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.GetToolsetRequest + * @static + * @param {google.cloud.ces.v1.IGetToolsetRequest} message GetToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetToolsetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.GetToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.GetToolsetRequest} GetToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolsetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetToolsetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetToolsetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.GetToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.GetToolsetRequest} GetToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolsetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetToolsetRequest message. + * @function verify + * @memberof google.cloud.ces.v1.GetToolsetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetToolsetRequest.verify = function verify(message) { + if (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 GetToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.GetToolsetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.GetToolsetRequest} GetToolsetRequest + */ + GetToolsetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.GetToolsetRequest) + return object; + var message = new $root.google.cloud.ces.v1.GetToolsetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetToolsetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.GetToolsetRequest + * @static + * @param {google.cloud.ces.v1.GetToolsetRequest} message GetToolsetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetToolsetRequest.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 GetToolsetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.GetToolsetRequest + * @instance + * @returns {Object.} JSON object + */ + GetToolsetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetToolsetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.GetToolsetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.GetToolsetRequest"; + }; + + return GetToolsetRequest; + })(); + + v1.CreateToolsetRequest = (function() { + + /** + * Properties of a CreateToolsetRequest. + * @memberof google.cloud.ces.v1 + * @interface ICreateToolsetRequest + * @property {string|null} [parent] CreateToolsetRequest parent + * @property {string|null} [toolsetId] CreateToolsetRequest toolsetId + * @property {google.cloud.ces.v1.IToolset|null} [toolset] CreateToolsetRequest toolset + */ + + /** + * Constructs a new CreateToolsetRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a CreateToolsetRequest. + * @implements ICreateToolsetRequest + * @constructor + * @param {google.cloud.ces.v1.ICreateToolsetRequest=} [properties] Properties to set + */ + function CreateToolsetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateToolsetRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.CreateToolsetRequest + * @instance + */ + CreateToolsetRequest.prototype.parent = ""; + + /** + * CreateToolsetRequest toolsetId. + * @member {string} toolsetId + * @memberof google.cloud.ces.v1.CreateToolsetRequest + * @instance + */ + CreateToolsetRequest.prototype.toolsetId = ""; + + /** + * CreateToolsetRequest toolset. + * @member {google.cloud.ces.v1.IToolset|null|undefined} toolset + * @memberof google.cloud.ces.v1.CreateToolsetRequest + * @instance + */ + CreateToolsetRequest.prototype.toolset = null; + + /** + * Creates a new CreateToolsetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.CreateToolsetRequest + * @static + * @param {google.cloud.ces.v1.ICreateToolsetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.CreateToolsetRequest} CreateToolsetRequest instance + */ + CreateToolsetRequest.create = function create(properties) { + return new CreateToolsetRequest(properties); + }; + + /** + * Encodes the specified CreateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateToolsetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.CreateToolsetRequest + * @static + * @param {google.cloud.ces.v1.ICreateToolsetRequest} message CreateToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolsetRequest.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.toolsetId != null && Object.hasOwnProperty.call(message, "toolsetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.toolsetId); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + $root.google.cloud.ces.v1.Toolset.encode(message.toolset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateToolsetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.CreateToolsetRequest + * @static + * @param {google.cloud.ces.v1.ICreateToolsetRequest} message CreateToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateToolsetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.CreateToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.CreateToolsetRequest} CreateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolsetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CreateToolsetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.toolsetId = reader.string(); + break; + } + case 3: { + message.toolset = $root.google.cloud.ces.v1.Toolset.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateToolsetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.CreateToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.CreateToolsetRequest} CreateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolsetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateToolsetRequest message. + * @function verify + * @memberof google.cloud.ces.v1.CreateToolsetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateToolsetRequest.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.toolsetId != null && message.hasOwnProperty("toolsetId")) + if (!$util.isString(message.toolsetId)) + return "toolsetId: string expected"; + if (message.toolset != null && message.hasOwnProperty("toolset")) { + var error = $root.google.cloud.ces.v1.Toolset.verify(message.toolset); + if (error) + return "toolset." + error; + } + return null; + }; + + /** + * Creates a CreateToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.CreateToolsetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.CreateToolsetRequest} CreateToolsetRequest + */ + CreateToolsetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.CreateToolsetRequest) + return object; + var message = new $root.google.cloud.ces.v1.CreateToolsetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.toolsetId != null) + message.toolsetId = String(object.toolsetId); + if (object.toolset != null) { + if (typeof object.toolset !== "object") + throw TypeError(".google.cloud.ces.v1.CreateToolsetRequest.toolset: object expected"); + message.toolset = $root.google.cloud.ces.v1.Toolset.fromObject(object.toolset); + } + return message; + }; + + /** + * Creates a plain object from a CreateToolsetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.CreateToolsetRequest + * @static + * @param {google.cloud.ces.v1.CreateToolsetRequest} message CreateToolsetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateToolsetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.toolsetId = ""; + object.toolset = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.toolsetId != null && message.hasOwnProperty("toolsetId")) + object.toolsetId = message.toolsetId; + if (message.toolset != null && message.hasOwnProperty("toolset")) + object.toolset = $root.google.cloud.ces.v1.Toolset.toObject(message.toolset, options); + return object; + }; + + /** + * Converts this CreateToolsetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.CreateToolsetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateToolsetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateToolsetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.CreateToolsetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.CreateToolsetRequest"; + }; + + return CreateToolsetRequest; + })(); + + v1.UpdateToolsetRequest = (function() { + + /** + * Properties of an UpdateToolsetRequest. + * @memberof google.cloud.ces.v1 + * @interface IUpdateToolsetRequest + * @property {google.cloud.ces.v1.IToolset|null} [toolset] UpdateToolsetRequest toolset + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateToolsetRequest updateMask + */ + + /** + * Constructs a new UpdateToolsetRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an UpdateToolsetRequest. + * @implements IUpdateToolsetRequest + * @constructor + * @param {google.cloud.ces.v1.IUpdateToolsetRequest=} [properties] Properties to set + */ + function UpdateToolsetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateToolsetRequest toolset. + * @member {google.cloud.ces.v1.IToolset|null|undefined} toolset + * @memberof google.cloud.ces.v1.UpdateToolsetRequest + * @instance + */ + UpdateToolsetRequest.prototype.toolset = null; + + /** + * UpdateToolsetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1.UpdateToolsetRequest + * @instance + */ + UpdateToolsetRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateToolsetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.UpdateToolsetRequest + * @static + * @param {google.cloud.ces.v1.IUpdateToolsetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.UpdateToolsetRequest} UpdateToolsetRequest instance + */ + UpdateToolsetRequest.create = function create(properties) { + return new UpdateToolsetRequest(properties); + }; + + /** + * Encodes the specified UpdateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateToolsetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.UpdateToolsetRequest + * @static + * @param {google.cloud.ces.v1.IUpdateToolsetRequest} message UpdateToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateToolsetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + $root.google.cloud.ces.v1.Toolset.encode(message.toolset, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateToolsetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.UpdateToolsetRequest + * @static + * @param {google.cloud.ces.v1.IUpdateToolsetRequest} message UpdateToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateToolsetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.UpdateToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.UpdateToolsetRequest} UpdateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateToolsetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.UpdateToolsetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolset = $root.google.cloud.ces.v1.Toolset.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateToolsetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.UpdateToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.UpdateToolsetRequest} UpdateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateToolsetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateToolsetRequest message. + * @function verify + * @memberof google.cloud.ces.v1.UpdateToolsetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateToolsetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolset != null && message.hasOwnProperty("toolset")) { + var error = $root.google.cloud.ces.v1.Toolset.verify(message.toolset); + if (error) + return "toolset." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.UpdateToolsetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.UpdateToolsetRequest} UpdateToolsetRequest + */ + UpdateToolsetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.UpdateToolsetRequest) + return object; + var message = new $root.google.cloud.ces.v1.UpdateToolsetRequest(); + if (object.toolset != null) { + if (typeof object.toolset !== "object") + throw TypeError(".google.cloud.ces.v1.UpdateToolsetRequest.toolset: object expected"); + message.toolset = $root.google.cloud.ces.v1.Toolset.fromObject(object.toolset); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1.UpdateToolsetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateToolsetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.UpdateToolsetRequest + * @static + * @param {google.cloud.ces.v1.UpdateToolsetRequest} message UpdateToolsetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateToolsetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.toolset = null; + object.updateMask = null; + } + if (message.toolset != null && message.hasOwnProperty("toolset")) + object.toolset = $root.google.cloud.ces.v1.Toolset.toObject(message.toolset, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateToolsetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.UpdateToolsetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateToolsetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateToolsetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.UpdateToolsetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.UpdateToolsetRequest"; + }; + + return UpdateToolsetRequest; + })(); + + v1.DeleteToolsetRequest = (function() { + + /** + * Properties of a DeleteToolsetRequest. + * @memberof google.cloud.ces.v1 + * @interface IDeleteToolsetRequest + * @property {string|null} [name] DeleteToolsetRequest name + * @property {boolean|null} [force] DeleteToolsetRequest force + * @property {string|null} [etag] DeleteToolsetRequest etag + */ + + /** + * Constructs a new DeleteToolsetRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a DeleteToolsetRequest. + * @implements IDeleteToolsetRequest + * @constructor + * @param {google.cloud.ces.v1.IDeleteToolsetRequest=} [properties] Properties to set + */ + function DeleteToolsetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteToolsetRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.DeleteToolsetRequest + * @instance + */ + DeleteToolsetRequest.prototype.name = ""; + + /** + * DeleteToolsetRequest force. + * @member {boolean} force + * @memberof google.cloud.ces.v1.DeleteToolsetRequest + * @instance + */ + DeleteToolsetRequest.prototype.force = false; + + /** + * DeleteToolsetRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1.DeleteToolsetRequest + * @instance + */ + DeleteToolsetRequest.prototype.etag = ""; + + /** + * Creates a new DeleteToolsetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DeleteToolsetRequest + * @static + * @param {google.cloud.ces.v1.IDeleteToolsetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DeleteToolsetRequest} DeleteToolsetRequest instance + */ + DeleteToolsetRequest.create = function create(properties) { + return new DeleteToolsetRequest(properties); + }; + + /** + * Encodes the specified DeleteToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteToolsetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DeleteToolsetRequest + * @static + * @param {google.cloud.ces.v1.IDeleteToolsetRequest} message DeleteToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolsetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteToolsetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DeleteToolsetRequest + * @static + * @param {google.cloud.ces.v1.IDeleteToolsetRequest} message DeleteToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteToolsetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DeleteToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DeleteToolsetRequest} DeleteToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolsetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DeleteToolsetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteToolsetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DeleteToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DeleteToolsetRequest} DeleteToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolsetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteToolsetRequest message. + * @function verify + * @memberof google.cloud.ces.v1.DeleteToolsetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteToolsetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DeleteToolsetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DeleteToolsetRequest} DeleteToolsetRequest + */ + DeleteToolsetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DeleteToolsetRequest) + return object; + var message = new $root.google.cloud.ces.v1.DeleteToolsetRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteToolsetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DeleteToolsetRequest + * @static + * @param {google.cloud.ces.v1.DeleteToolsetRequest} message DeleteToolsetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteToolsetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteToolsetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DeleteToolsetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteToolsetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteToolsetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DeleteToolsetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DeleteToolsetRequest"; + }; + + return DeleteToolsetRequest; + })(); + + v1.ListAppVersionsRequest = (function() { + + /** + * Properties of a ListAppVersionsRequest. + * @memberof google.cloud.ces.v1 + * @interface IListAppVersionsRequest + * @property {string|null} [parent] ListAppVersionsRequest parent + * @property {number|null} [pageSize] ListAppVersionsRequest pageSize + * @property {string|null} [pageToken] ListAppVersionsRequest pageToken + * @property {string|null} [filter] ListAppVersionsRequest filter + * @property {string|null} [orderBy] ListAppVersionsRequest orderBy + */ + + /** + * Constructs a new ListAppVersionsRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListAppVersionsRequest. + * @implements IListAppVersionsRequest + * @constructor + * @param {google.cloud.ces.v1.IListAppVersionsRequest=} [properties] Properties to set + */ + function ListAppVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAppVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.ListAppVersionsRequest + * @instance + */ + ListAppVersionsRequest.prototype.parent = ""; + + /** + * ListAppVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1.ListAppVersionsRequest + * @instance + */ + ListAppVersionsRequest.prototype.pageSize = 0; + + /** + * ListAppVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1.ListAppVersionsRequest + * @instance + */ + ListAppVersionsRequest.prototype.pageToken = ""; + + /** + * ListAppVersionsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1.ListAppVersionsRequest + * @instance + */ + ListAppVersionsRequest.prototype.filter = ""; + + /** + * ListAppVersionsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1.ListAppVersionsRequest + * @instance + */ + ListAppVersionsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListAppVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListAppVersionsRequest + * @static + * @param {google.cloud.ces.v1.IListAppVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListAppVersionsRequest} ListAppVersionsRequest instance + */ + ListAppVersionsRequest.create = function create(properties) { + return new ListAppVersionsRequest(properties); + }; + + /** + * Encodes the specified ListAppVersionsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListAppVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListAppVersionsRequest + * @static + * @param {google.cloud.ces.v1.IListAppVersionsRequest} message ListAppVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppVersionsRequest.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 ListAppVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAppVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListAppVersionsRequest + * @static + * @param {google.cloud.ces.v1.IListAppVersionsRequest} message ListAppVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAppVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListAppVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListAppVersionsRequest} ListAppVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppVersionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListAppVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAppVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListAppVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListAppVersionsRequest} ListAppVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAppVersionsRequest message. + * @function verify + * @memberof google.cloud.ces.v1.ListAppVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAppVersionsRequest.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 ListAppVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListAppVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListAppVersionsRequest} ListAppVersionsRequest + */ + ListAppVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListAppVersionsRequest) + return object; + var message = new $root.google.cloud.ces.v1.ListAppVersionsRequest(); + 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 ListAppVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListAppVersionsRequest + * @static + * @param {google.cloud.ces.v1.ListAppVersionsRequest} message ListAppVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAppVersionsRequest.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 ListAppVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListAppVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAppVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAppVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListAppVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAppVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListAppVersionsRequest"; + }; + + return ListAppVersionsRequest; + })(); + + v1.ListAppVersionsResponse = (function() { + + /** + * Properties of a ListAppVersionsResponse. + * @memberof google.cloud.ces.v1 + * @interface IListAppVersionsResponse + * @property {Array.|null} [appVersions] ListAppVersionsResponse appVersions + * @property {string|null} [nextPageToken] ListAppVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListAppVersionsResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListAppVersionsResponse. + * @implements IListAppVersionsResponse + * @constructor + * @param {google.cloud.ces.v1.IListAppVersionsResponse=} [properties] Properties to set + */ + function ListAppVersionsResponse(properties) { + this.appVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAppVersionsResponse appVersions. + * @member {Array.} appVersions + * @memberof google.cloud.ces.v1.ListAppVersionsResponse + * @instance + */ + ListAppVersionsResponse.prototype.appVersions = $util.emptyArray; + + /** + * ListAppVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1.ListAppVersionsResponse + * @instance + */ + ListAppVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAppVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListAppVersionsResponse + * @static + * @param {google.cloud.ces.v1.IListAppVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListAppVersionsResponse} ListAppVersionsResponse instance + */ + ListAppVersionsResponse.create = function create(properties) { + return new ListAppVersionsResponse(properties); + }; + + /** + * Encodes the specified ListAppVersionsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListAppVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListAppVersionsResponse + * @static + * @param {google.cloud.ces.v1.IListAppVersionsResponse} message ListAppVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appVersions != null && message.appVersions.length) + for (var i = 0; i < message.appVersions.length; ++i) + $root.google.cloud.ces.v1.AppVersion.encode(message.appVersions[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 ListAppVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAppVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListAppVersionsResponse + * @static + * @param {google.cloud.ces.v1.IListAppVersionsResponse} message ListAppVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAppVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListAppVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListAppVersionsResponse} ListAppVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppVersionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListAppVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.appVersions && message.appVersions.length)) + message.appVersions = []; + message.appVersions.push($root.google.cloud.ces.v1.AppVersion.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAppVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListAppVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListAppVersionsResponse} ListAppVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAppVersionsResponse message. + * @function verify + * @memberof google.cloud.ces.v1.ListAppVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAppVersionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.appVersions != null && message.hasOwnProperty("appVersions")) { + if (!Array.isArray(message.appVersions)) + return "appVersions: array expected"; + for (var i = 0; i < message.appVersions.length; ++i) { + var error = $root.google.cloud.ces.v1.AppVersion.verify(message.appVersions[i]); + if (error) + return "appVersions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAppVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListAppVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListAppVersionsResponse} ListAppVersionsResponse + */ + ListAppVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListAppVersionsResponse) + return object; + var message = new $root.google.cloud.ces.v1.ListAppVersionsResponse(); + if (object.appVersions) { + if (!Array.isArray(object.appVersions)) + throw TypeError(".google.cloud.ces.v1.ListAppVersionsResponse.appVersions: array expected"); + message.appVersions = []; + for (var i = 0; i < object.appVersions.length; ++i) { + if (typeof object.appVersions[i] !== "object") + throw TypeError(".google.cloud.ces.v1.ListAppVersionsResponse.appVersions: object expected"); + message.appVersions[i] = $root.google.cloud.ces.v1.AppVersion.fromObject(object.appVersions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAppVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListAppVersionsResponse + * @static + * @param {google.cloud.ces.v1.ListAppVersionsResponse} message ListAppVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAppVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.appVersions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.appVersions && message.appVersions.length) { + object.appVersions = []; + for (var j = 0; j < message.appVersions.length; ++j) + object.appVersions[j] = $root.google.cloud.ces.v1.AppVersion.toObject(message.appVersions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAppVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListAppVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAppVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAppVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListAppVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAppVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListAppVersionsResponse"; + }; + + return ListAppVersionsResponse; + })(); + + v1.GetAppVersionRequest = (function() { + + /** + * Properties of a GetAppVersionRequest. + * @memberof google.cloud.ces.v1 + * @interface IGetAppVersionRequest + * @property {string|null} [name] GetAppVersionRequest name + */ + + /** + * Constructs a new GetAppVersionRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a GetAppVersionRequest. + * @implements IGetAppVersionRequest + * @constructor + * @param {google.cloud.ces.v1.IGetAppVersionRequest=} [properties] Properties to set + */ + function GetAppVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAppVersionRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.GetAppVersionRequest + * @instance + */ + GetAppVersionRequest.prototype.name = ""; + + /** + * Creates a new GetAppVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.GetAppVersionRequest + * @static + * @param {google.cloud.ces.v1.IGetAppVersionRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.GetAppVersionRequest} GetAppVersionRequest instance + */ + GetAppVersionRequest.create = function create(properties) { + return new GetAppVersionRequest(properties); + }; + + /** + * Encodes the specified GetAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1.GetAppVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.GetAppVersionRequest + * @static + * @param {google.cloud.ces.v1.IGetAppVersionRequest} message GetAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAppVersionRequest.encode = function encode(message, writer) { + 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 GetAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetAppVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.GetAppVersionRequest + * @static + * @param {google.cloud.ces.v1.IGetAppVersionRequest} message GetAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAppVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.GetAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.GetAppVersionRequest} GetAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAppVersionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetAppVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAppVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.GetAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.GetAppVersionRequest} GetAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAppVersionRequest message. + * @function verify + * @memberof google.cloud.ces.v1.GetAppVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAppVersionRequest.verify = function verify(message) { + if (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 GetAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.GetAppVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.GetAppVersionRequest} GetAppVersionRequest + */ + GetAppVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.GetAppVersionRequest) + return object; + var message = new $root.google.cloud.ces.v1.GetAppVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAppVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.GetAppVersionRequest + * @static + * @param {google.cloud.ces.v1.GetAppVersionRequest} message GetAppVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAppVersionRequest.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 GetAppVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.GetAppVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetAppVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAppVersionRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.GetAppVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.GetAppVersionRequest"; + }; + + return GetAppVersionRequest; + })(); + + v1.DeleteAppVersionRequest = (function() { + + /** + * Properties of a DeleteAppVersionRequest. + * @memberof google.cloud.ces.v1 + * @interface IDeleteAppVersionRequest + * @property {string|null} [name] DeleteAppVersionRequest name + * @property {string|null} [etag] DeleteAppVersionRequest etag + */ + + /** + * Constructs a new DeleteAppVersionRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a DeleteAppVersionRequest. + * @implements IDeleteAppVersionRequest + * @constructor + * @param {google.cloud.ces.v1.IDeleteAppVersionRequest=} [properties] Properties to set + */ + function DeleteAppVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAppVersionRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.DeleteAppVersionRequest + * @instance + */ + DeleteAppVersionRequest.prototype.name = ""; + + /** + * DeleteAppVersionRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1.DeleteAppVersionRequest + * @instance + */ + DeleteAppVersionRequest.prototype.etag = ""; + + /** + * Creates a new DeleteAppVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DeleteAppVersionRequest + * @static + * @param {google.cloud.ces.v1.IDeleteAppVersionRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DeleteAppVersionRequest} DeleteAppVersionRequest instance + */ + DeleteAppVersionRequest.create = function create(properties) { + return new DeleteAppVersionRequest(properties); + }; + + /** + * Encodes the specified DeleteAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteAppVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DeleteAppVersionRequest + * @static + * @param {google.cloud.ces.v1.IDeleteAppVersionRequest} message DeleteAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAppVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteAppVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DeleteAppVersionRequest + * @static + * @param {google.cloud.ces.v1.IDeleteAppVersionRequest} message DeleteAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAppVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DeleteAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DeleteAppVersionRequest} DeleteAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAppVersionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DeleteAppVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAppVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DeleteAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DeleteAppVersionRequest} DeleteAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAppVersionRequest message. + * @function verify + * @memberof google.cloud.ces.v1.DeleteAppVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAppVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DeleteAppVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DeleteAppVersionRequest} DeleteAppVersionRequest + */ + DeleteAppVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DeleteAppVersionRequest) + return object; + var message = new $root.google.cloud.ces.v1.DeleteAppVersionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteAppVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DeleteAppVersionRequest + * @static + * @param {google.cloud.ces.v1.DeleteAppVersionRequest} message DeleteAppVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAppVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteAppVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DeleteAppVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAppVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAppVersionRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DeleteAppVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DeleteAppVersionRequest"; + }; + + return DeleteAppVersionRequest; + })(); + + v1.CreateAppVersionRequest = (function() { + + /** + * Properties of a CreateAppVersionRequest. + * @memberof google.cloud.ces.v1 + * @interface ICreateAppVersionRequest + * @property {string|null} [parent] CreateAppVersionRequest parent + * @property {string|null} [appVersionId] CreateAppVersionRequest appVersionId + * @property {google.cloud.ces.v1.IAppVersion|null} [appVersion] CreateAppVersionRequest appVersion + */ + + /** + * Constructs a new CreateAppVersionRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a CreateAppVersionRequest. + * @implements ICreateAppVersionRequest + * @constructor + * @param {google.cloud.ces.v1.ICreateAppVersionRequest=} [properties] Properties to set + */ + function CreateAppVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAppVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.CreateAppVersionRequest + * @instance + */ + CreateAppVersionRequest.prototype.parent = ""; + + /** + * CreateAppVersionRequest appVersionId. + * @member {string} appVersionId + * @memberof google.cloud.ces.v1.CreateAppVersionRequest + * @instance + */ + CreateAppVersionRequest.prototype.appVersionId = ""; + + /** + * CreateAppVersionRequest appVersion. + * @member {google.cloud.ces.v1.IAppVersion|null|undefined} appVersion + * @memberof google.cloud.ces.v1.CreateAppVersionRequest + * @instance + */ + CreateAppVersionRequest.prototype.appVersion = null; + + /** + * Creates a new CreateAppVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.CreateAppVersionRequest + * @static + * @param {google.cloud.ces.v1.ICreateAppVersionRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.CreateAppVersionRequest} CreateAppVersionRequest instance + */ + CreateAppVersionRequest.create = function create(properties) { + return new CreateAppVersionRequest(properties); + }; + + /** + * Encodes the specified CreateAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateAppVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.CreateAppVersionRequest + * @static + * @param {google.cloud.ces.v1.ICreateAppVersionRequest} message CreateAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAppVersionRequest.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.appVersionId != null && Object.hasOwnProperty.call(message, "appVersionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appVersionId); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + $root.google.cloud.ces.v1.AppVersion.encode(message.appVersion, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateAppVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.CreateAppVersionRequest + * @static + * @param {google.cloud.ces.v1.ICreateAppVersionRequest} message CreateAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAppVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.CreateAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.CreateAppVersionRequest} CreateAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAppVersionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CreateAppVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.appVersionId = reader.string(); + break; + } + case 3: { + message.appVersion = $root.google.cloud.ces.v1.AppVersion.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAppVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.CreateAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.CreateAppVersionRequest} CreateAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAppVersionRequest message. + * @function verify + * @memberof google.cloud.ces.v1.CreateAppVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAppVersionRequest.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.appVersionId != null && message.hasOwnProperty("appVersionId")) + if (!$util.isString(message.appVersionId)) + return "appVersionId: string expected"; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) { + var error = $root.google.cloud.ces.v1.AppVersion.verify(message.appVersion); + if (error) + return "appVersion." + error; + } + return null; + }; + + /** + * Creates a CreateAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.CreateAppVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.CreateAppVersionRequest} CreateAppVersionRequest + */ + CreateAppVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.CreateAppVersionRequest) + return object; + var message = new $root.google.cloud.ces.v1.CreateAppVersionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.appVersionId != null) + message.appVersionId = String(object.appVersionId); + if (object.appVersion != null) { + if (typeof object.appVersion !== "object") + throw TypeError(".google.cloud.ces.v1.CreateAppVersionRequest.appVersion: object expected"); + message.appVersion = $root.google.cloud.ces.v1.AppVersion.fromObject(object.appVersion); + } + return message; + }; + + /** + * Creates a plain object from a CreateAppVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.CreateAppVersionRequest + * @static + * @param {google.cloud.ces.v1.CreateAppVersionRequest} message CreateAppVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAppVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.appVersionId = ""; + object.appVersion = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.appVersionId != null && message.hasOwnProperty("appVersionId")) + object.appVersionId = message.appVersionId; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + object.appVersion = $root.google.cloud.ces.v1.AppVersion.toObject(message.appVersion, options); + return object; + }; + + /** + * Converts this CreateAppVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.CreateAppVersionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAppVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAppVersionRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.CreateAppVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.CreateAppVersionRequest"; + }; + + return CreateAppVersionRequest; + })(); + + v1.RestoreAppVersionRequest = (function() { + + /** + * Properties of a RestoreAppVersionRequest. + * @memberof google.cloud.ces.v1 + * @interface IRestoreAppVersionRequest + * @property {string|null} [name] RestoreAppVersionRequest name + */ + + /** + * Constructs a new RestoreAppVersionRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a RestoreAppVersionRequest. + * @implements IRestoreAppVersionRequest + * @constructor + * @param {google.cloud.ces.v1.IRestoreAppVersionRequest=} [properties] Properties to set + */ + function RestoreAppVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreAppVersionRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.RestoreAppVersionRequest + * @instance + */ + RestoreAppVersionRequest.prototype.name = ""; + + /** + * Creates a new RestoreAppVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.RestoreAppVersionRequest + * @static + * @param {google.cloud.ces.v1.IRestoreAppVersionRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.RestoreAppVersionRequest} RestoreAppVersionRequest instance + */ + RestoreAppVersionRequest.create = function create(properties) { + return new RestoreAppVersionRequest(properties); + }; + + /** + * Encodes the specified RestoreAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1.RestoreAppVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.RestoreAppVersionRequest + * @static + * @param {google.cloud.ces.v1.IRestoreAppVersionRequest} message RestoreAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreAppVersionRequest.encode = function encode(message, writer) { + 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 RestoreAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RestoreAppVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.RestoreAppVersionRequest + * @static + * @param {google.cloud.ces.v1.IRestoreAppVersionRequest} message RestoreAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreAppVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.RestoreAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.RestoreAppVersionRequest} RestoreAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreAppVersionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RestoreAppVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreAppVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.RestoreAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.RestoreAppVersionRequest} RestoreAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreAppVersionRequest message. + * @function verify + * @memberof google.cloud.ces.v1.RestoreAppVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreAppVersionRequest.verify = function verify(message) { + if (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 RestoreAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.RestoreAppVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.RestoreAppVersionRequest} RestoreAppVersionRequest + */ + RestoreAppVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.RestoreAppVersionRequest) + return object; + var message = new $root.google.cloud.ces.v1.RestoreAppVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RestoreAppVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.RestoreAppVersionRequest + * @static + * @param {google.cloud.ces.v1.RestoreAppVersionRequest} message RestoreAppVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreAppVersionRequest.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 RestoreAppVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.RestoreAppVersionRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreAppVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreAppVersionRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.RestoreAppVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.RestoreAppVersionRequest"; + }; + + return RestoreAppVersionRequest; + })(); + + v1.RestoreAppVersionResponse = (function() { + + /** + * Properties of a RestoreAppVersionResponse. + * @memberof google.cloud.ces.v1 + * @interface IRestoreAppVersionResponse + */ + + /** + * Constructs a new RestoreAppVersionResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a RestoreAppVersionResponse. + * @implements IRestoreAppVersionResponse + * @constructor + * @param {google.cloud.ces.v1.IRestoreAppVersionResponse=} [properties] Properties to set + */ + function RestoreAppVersionResponse(properties) { + if (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 RestoreAppVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.RestoreAppVersionResponse + * @static + * @param {google.cloud.ces.v1.IRestoreAppVersionResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.RestoreAppVersionResponse} RestoreAppVersionResponse instance + */ + RestoreAppVersionResponse.create = function create(properties) { + return new RestoreAppVersionResponse(properties); + }; + + /** + * Encodes the specified RestoreAppVersionResponse message. Does not implicitly {@link google.cloud.ces.v1.RestoreAppVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.RestoreAppVersionResponse + * @static + * @param {google.cloud.ces.v1.IRestoreAppVersionResponse} message RestoreAppVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreAppVersionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RestoreAppVersionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RestoreAppVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.RestoreAppVersionResponse + * @static + * @param {google.cloud.ces.v1.IRestoreAppVersionResponse} message RestoreAppVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreAppVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreAppVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.RestoreAppVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.RestoreAppVersionResponse} RestoreAppVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreAppVersionResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RestoreAppVersionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreAppVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.RestoreAppVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.RestoreAppVersionResponse} RestoreAppVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreAppVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreAppVersionResponse message. + * @function verify + * @memberof google.cloud.ces.v1.RestoreAppVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreAppVersionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RestoreAppVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.RestoreAppVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.RestoreAppVersionResponse} RestoreAppVersionResponse + */ + RestoreAppVersionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.RestoreAppVersionResponse) + return object; + return new $root.google.cloud.ces.v1.RestoreAppVersionResponse(); + }; + + /** + * Creates a plain object from a RestoreAppVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.RestoreAppVersionResponse + * @static + * @param {google.cloud.ces.v1.RestoreAppVersionResponse} message RestoreAppVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreAppVersionResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RestoreAppVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.RestoreAppVersionResponse + * @instance + * @returns {Object.} JSON object + */ + RestoreAppVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreAppVersionResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.RestoreAppVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreAppVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.RestoreAppVersionResponse"; + }; + + return RestoreAppVersionResponse; + })(); + + v1.ListChangelogsRequest = (function() { + + /** + * Properties of a ListChangelogsRequest. + * @memberof google.cloud.ces.v1 + * @interface IListChangelogsRequest + * @property {string|null} [parent] ListChangelogsRequest parent + * @property {number|null} [pageSize] ListChangelogsRequest pageSize + * @property {string|null} [pageToken] ListChangelogsRequest pageToken + * @property {string|null} [filter] ListChangelogsRequest filter + * @property {string|null} [orderBy] ListChangelogsRequest orderBy + */ + + /** + * Constructs a new ListChangelogsRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListChangelogsRequest. + * @implements IListChangelogsRequest + * @constructor + * @param {google.cloud.ces.v1.IListChangelogsRequest=} [properties] Properties to set + */ + function ListChangelogsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChangelogsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.parent = ""; + + /** + * ListChangelogsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.pageSize = 0; + + /** + * ListChangelogsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.pageToken = ""; + + /** + * ListChangelogsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.filter = ""; + + /** + * ListChangelogsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListChangelogsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListChangelogsRequest + * @static + * @param {google.cloud.ces.v1.IListChangelogsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListChangelogsRequest} ListChangelogsRequest instance + */ + ListChangelogsRequest.create = function create(properties) { + return new ListChangelogsRequest(properties); + }; + + /** + * Encodes the specified ListChangelogsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListChangelogsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListChangelogsRequest + * @static + * @param {google.cloud.ces.v1.IListChangelogsRequest} message ListChangelogsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsRequest.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 ListChangelogsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListChangelogsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListChangelogsRequest + * @static + * @param {google.cloud.ces.v1.IListChangelogsRequest} message ListChangelogsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListChangelogsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListChangelogsRequest} ListChangelogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListChangelogsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListChangelogsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListChangelogsRequest} ListChangelogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChangelogsRequest message. + * @function verify + * @memberof google.cloud.ces.v1.ListChangelogsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChangelogsRequest.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 ListChangelogsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListChangelogsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListChangelogsRequest} ListChangelogsRequest + */ + ListChangelogsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListChangelogsRequest) + return object; + var message = new $root.google.cloud.ces.v1.ListChangelogsRequest(); + 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 ListChangelogsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListChangelogsRequest + * @static + * @param {google.cloud.ces.v1.ListChangelogsRequest} message ListChangelogsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChangelogsRequest.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 ListChangelogsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListChangelogsRequest + * @instance + * @returns {Object.} JSON object + */ + ListChangelogsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChangelogsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListChangelogsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChangelogsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListChangelogsRequest"; + }; + + return ListChangelogsRequest; + })(); + + v1.ListChangelogsResponse = (function() { + + /** + * Properties of a ListChangelogsResponse. + * @memberof google.cloud.ces.v1 + * @interface IListChangelogsResponse + * @property {Array.|null} [changelogs] ListChangelogsResponse changelogs + * @property {string|null} [nextPageToken] ListChangelogsResponse nextPageToken + */ + + /** + * Constructs a new ListChangelogsResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ListChangelogsResponse. + * @implements IListChangelogsResponse + * @constructor + * @param {google.cloud.ces.v1.IListChangelogsResponse=} [properties] Properties to set + */ + function ListChangelogsResponse(properties) { + this.changelogs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChangelogsResponse changelogs. + * @member {Array.} changelogs + * @memberof google.cloud.ces.v1.ListChangelogsResponse + * @instance + */ + ListChangelogsResponse.prototype.changelogs = $util.emptyArray; + + /** + * ListChangelogsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1.ListChangelogsResponse + * @instance + */ + ListChangelogsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListChangelogsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ListChangelogsResponse + * @static + * @param {google.cloud.ces.v1.IListChangelogsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ListChangelogsResponse} ListChangelogsResponse instance + */ + ListChangelogsResponse.create = function create(properties) { + return new ListChangelogsResponse(properties); + }; + + /** + * Encodes the specified ListChangelogsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListChangelogsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ListChangelogsResponse + * @static + * @param {google.cloud.ces.v1.IListChangelogsResponse} message ListChangelogsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.changelogs != null && message.changelogs.length) + for (var i = 0; i < message.changelogs.length; ++i) + $root.google.cloud.ces.v1.Changelog.encode(message.changelogs[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 ListChangelogsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListChangelogsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ListChangelogsResponse + * @static + * @param {google.cloud.ces.v1.IListChangelogsResponse} message ListChangelogsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ListChangelogsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ListChangelogsResponse} ListChangelogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListChangelogsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.changelogs && message.changelogs.length)) + message.changelogs = []; + message.changelogs.push($root.google.cloud.ces.v1.Changelog.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ListChangelogsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ListChangelogsResponse} ListChangelogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChangelogsResponse message. + * @function verify + * @memberof google.cloud.ces.v1.ListChangelogsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChangelogsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.changelogs != null && message.hasOwnProperty("changelogs")) { + if (!Array.isArray(message.changelogs)) + return "changelogs: array expected"; + for (var i = 0; i < message.changelogs.length; ++i) { + var error = $root.google.cloud.ces.v1.Changelog.verify(message.changelogs[i]); + if (error) + return "changelogs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListChangelogsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ListChangelogsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ListChangelogsResponse} ListChangelogsResponse + */ + ListChangelogsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ListChangelogsResponse) + return object; + var message = new $root.google.cloud.ces.v1.ListChangelogsResponse(); + if (object.changelogs) { + if (!Array.isArray(object.changelogs)) + throw TypeError(".google.cloud.ces.v1.ListChangelogsResponse.changelogs: array expected"); + message.changelogs = []; + for (var i = 0; i < object.changelogs.length; ++i) { + if (typeof object.changelogs[i] !== "object") + throw TypeError(".google.cloud.ces.v1.ListChangelogsResponse.changelogs: object expected"); + message.changelogs[i] = $root.google.cloud.ces.v1.Changelog.fromObject(object.changelogs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListChangelogsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ListChangelogsResponse + * @static + * @param {google.cloud.ces.v1.ListChangelogsResponse} message ListChangelogsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChangelogsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.changelogs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.changelogs && message.changelogs.length) { + object.changelogs = []; + for (var j = 0; j < message.changelogs.length; ++j) + object.changelogs[j] = $root.google.cloud.ces.v1.Changelog.toObject(message.changelogs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListChangelogsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ListChangelogsResponse + * @instance + * @returns {Object.} JSON object + */ + ListChangelogsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChangelogsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ListChangelogsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChangelogsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ListChangelogsResponse"; + }; + + return ListChangelogsResponse; + })(); + + v1.GetChangelogRequest = (function() { + + /** + * Properties of a GetChangelogRequest. + * @memberof google.cloud.ces.v1 + * @interface IGetChangelogRequest + * @property {string|null} [name] GetChangelogRequest name + */ + + /** + * Constructs a new GetChangelogRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a GetChangelogRequest. + * @implements IGetChangelogRequest + * @constructor + * @param {google.cloud.ces.v1.IGetChangelogRequest=} [properties] Properties to set + */ + function GetChangelogRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetChangelogRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.GetChangelogRequest + * @instance + */ + GetChangelogRequest.prototype.name = ""; + + /** + * Creates a new GetChangelogRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.GetChangelogRequest + * @static + * @param {google.cloud.ces.v1.IGetChangelogRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.GetChangelogRequest} GetChangelogRequest instance + */ + GetChangelogRequest.create = function create(properties) { + return new GetChangelogRequest(properties); + }; + + /** + * Encodes the specified GetChangelogRequest message. Does not implicitly {@link google.cloud.ces.v1.GetChangelogRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.GetChangelogRequest + * @static + * @param {google.cloud.ces.v1.IGetChangelogRequest} message GetChangelogRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetChangelogRequest.encode = function encode(message, writer) { + 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 GetChangelogRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetChangelogRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.GetChangelogRequest + * @static + * @param {google.cloud.ces.v1.IGetChangelogRequest} message GetChangelogRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetChangelogRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.GetChangelogRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.GetChangelogRequest} GetChangelogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetChangelogRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetChangelogRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.GetChangelogRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.GetChangelogRequest} GetChangelogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetChangelogRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetChangelogRequest message. + * @function verify + * @memberof google.cloud.ces.v1.GetChangelogRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetChangelogRequest.verify = function verify(message) { + if (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 GetChangelogRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.GetChangelogRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.GetChangelogRequest} GetChangelogRequest + */ + GetChangelogRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.GetChangelogRequest) + return object; + var message = new $root.google.cloud.ces.v1.GetChangelogRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetChangelogRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.GetChangelogRequest + * @static + * @param {google.cloud.ces.v1.GetChangelogRequest} message GetChangelogRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetChangelogRequest.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 GetChangelogRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.GetChangelogRequest + * @instance + * @returns {Object.} JSON object + */ + GetChangelogRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetChangelogRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.GetChangelogRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetChangelogRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.GetChangelogRequest"; + }; + + return GetChangelogRequest; + })(); + + v1.App = (function() { + + /** + * Properties of an App. + * @memberof google.cloud.ces.v1 + * @interface IApp + * @property {string|null} [name] App name + * @property {string|null} [displayName] App displayName + * @property {string|null} [description] App description + * @property {boolean|null} [pinned] App pinned + * @property {string|null} [rootAgent] App rootAgent + * @property {google.cloud.ces.v1.ILanguageSettings|null} [languageSettings] App languageSettings + * @property {google.cloud.ces.v1.ITimeZoneSettings|null} [timeZoneSettings] App timeZoneSettings + * @property {google.cloud.ces.v1.IAudioProcessingConfig|null} [audioProcessingConfig] App audioProcessingConfig + * @property {google.cloud.ces.v1.ILoggingSettings|null} [loggingSettings] App loggingSettings + * @property {google.cloud.ces.v1.IModelSettings|null} [modelSettings] App modelSettings + * @property {google.cloud.ces.v1.App.ToolExecutionMode|null} [toolExecutionMode] App toolExecutionMode + * @property {google.cloud.ces.v1.IEvaluationMetricsThresholds|null} [evaluationMetricsThresholds] App evaluationMetricsThresholds + * @property {Array.|null} [variableDeclarations] App variableDeclarations + * @property {Array.|null} [predefinedVariableDeclarations] App predefinedVariableDeclarations + * @property {string|null} [globalInstruction] App globalInstruction + * @property {Array.|null} [guardrails] App guardrails + * @property {google.cloud.ces.v1.IDataStoreSettings|null} [dataStoreSettings] App dataStoreSettings + * @property {google.cloud.ces.v1.IChannelProfile|null} [defaultChannelProfile] App defaultChannelProfile + * @property {Object.|null} [metadata] App metadata + * @property {google.protobuf.ITimestamp|null} [createTime] App createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] App updateTime + * @property {string|null} [etag] App etag + * @property {number|null} [deploymentCount] App deploymentCount + * @property {google.cloud.ces.v1.IClientCertificateSettings|null} [clientCertificateSettings] App clientCertificateSettings + * @property {boolean|null} [locked] App locked + */ + + /** + * Constructs a new App. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an App. + * @implements IApp + * @constructor + * @param {google.cloud.ces.v1.IApp=} [properties] Properties to set + */ + function App(properties) { + this.variableDeclarations = []; + this.predefinedVariableDeclarations = []; + this.guardrails = []; + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * App name. + * @member {string} name + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.name = ""; + + /** + * App displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.displayName = ""; + + /** + * App description. + * @member {string} description + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.description = ""; + + /** + * App pinned. + * @member {boolean} pinned + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.pinned = false; + + /** + * App rootAgent. + * @member {string} rootAgent + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.rootAgent = ""; + + /** + * App languageSettings. + * @member {google.cloud.ces.v1.ILanguageSettings|null|undefined} languageSettings + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.languageSettings = null; + + /** + * App timeZoneSettings. + * @member {google.cloud.ces.v1.ITimeZoneSettings|null|undefined} timeZoneSettings + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.timeZoneSettings = null; + + /** + * App audioProcessingConfig. + * @member {google.cloud.ces.v1.IAudioProcessingConfig|null|undefined} audioProcessingConfig + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.audioProcessingConfig = null; + + /** + * App loggingSettings. + * @member {google.cloud.ces.v1.ILoggingSettings|null|undefined} loggingSettings + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.loggingSettings = null; + + /** + * App modelSettings. + * @member {google.cloud.ces.v1.IModelSettings|null|undefined} modelSettings + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.modelSettings = null; + + /** + * App toolExecutionMode. + * @member {google.cloud.ces.v1.App.ToolExecutionMode} toolExecutionMode + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.toolExecutionMode = 0; + + /** + * App evaluationMetricsThresholds. + * @member {google.cloud.ces.v1.IEvaluationMetricsThresholds|null|undefined} evaluationMetricsThresholds + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.evaluationMetricsThresholds = null; + + /** + * App variableDeclarations. + * @member {Array.} variableDeclarations + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.variableDeclarations = $util.emptyArray; + + /** + * App predefinedVariableDeclarations. + * @member {Array.} predefinedVariableDeclarations + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.predefinedVariableDeclarations = $util.emptyArray; + + /** + * App globalInstruction. + * @member {string} globalInstruction + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.globalInstruction = ""; + + /** + * App guardrails. + * @member {Array.} guardrails + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.guardrails = $util.emptyArray; + + /** + * App dataStoreSettings. + * @member {google.cloud.ces.v1.IDataStoreSettings|null|undefined} dataStoreSettings + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.dataStoreSettings = null; + + /** + * App defaultChannelProfile. + * @member {google.cloud.ces.v1.IChannelProfile|null|undefined} defaultChannelProfile + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.defaultChannelProfile = null; + + /** + * App metadata. + * @member {Object.} metadata + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.metadata = $util.emptyObject; + + /** + * App createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.createTime = null; + + /** + * App updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.updateTime = null; + + /** + * App etag. + * @member {string} etag + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.etag = ""; + + /** + * App deploymentCount. + * @member {number} deploymentCount + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.deploymentCount = 0; + + /** + * App clientCertificateSettings. + * @member {google.cloud.ces.v1.IClientCertificateSettings|null|undefined} clientCertificateSettings + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.clientCertificateSettings = null; + + /** + * App locked. + * @member {boolean} locked + * @memberof google.cloud.ces.v1.App + * @instance + */ + App.prototype.locked = false; + + /** + * Creates a new App instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.App + * @static + * @param {google.cloud.ces.v1.IApp=} [properties] Properties to set + * @returns {google.cloud.ces.v1.App} App instance + */ + App.create = function create(properties) { + return new App(properties); + }; + + /** + * Encodes the specified App message. Does not implicitly {@link google.cloud.ces.v1.App.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.App + * @static + * @param {google.cloud.ces.v1.IApp} message App message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + App.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.rootAgent != null && Object.hasOwnProperty.call(message, "rootAgent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.rootAgent); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.audioProcessingConfig != null && Object.hasOwnProperty.call(message, "audioProcessingConfig")) + $root.google.cloud.ces.v1.AudioProcessingConfig.encode(message.audioProcessingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.loggingSettings != null && Object.hasOwnProperty.call(message, "loggingSettings")) + $root.google.cloud.ces.v1.LoggingSettings.encode(message.loggingSettings, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.guardrails != null && message.guardrails.length) + for (var i = 0; i < message.guardrails.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.guardrails[i]); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.etag); + if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) + $root.google.cloud.ces.v1.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.variableDeclarations != null && message.variableDeclarations.length) + for (var i = 0; i < message.variableDeclarations.length; ++i) + $root.google.cloud.ces.v1.App.VariableDeclaration.encode(message.variableDeclarations[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.dataStoreSettings != null && Object.hasOwnProperty.call(message, "dataStoreSettings")) + $root.google.cloud.ces.v1.DataStoreSettings.encode(message.dataStoreSettings, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.globalInstruction != null && Object.hasOwnProperty.call(message, "globalInstruction")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.globalInstruction); + if (message.languageSettings != null && Object.hasOwnProperty.call(message, "languageSettings")) + $root.google.cloud.ces.v1.LanguageSettings.encode(message.languageSettings, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.defaultChannelProfile != null && Object.hasOwnProperty.call(message, "defaultChannelProfile")) + $root.google.cloud.ces.v1.ChannelProfile.encode(message.defaultChannelProfile, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.deploymentCount != null && Object.hasOwnProperty.call(message, "deploymentCount")) + writer.uint32(/* id 23, wireType 0 =*/184).int32(message.deploymentCount); + if (message.evaluationMetricsThresholds != null && Object.hasOwnProperty.call(message, "evaluationMetricsThresholds")) + $root.google.cloud.ces.v1.EvaluationMetricsThresholds.encode(message.evaluationMetricsThresholds, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.clientCertificateSettings != null && Object.hasOwnProperty.call(message, "clientCertificateSettings")) + $root.google.cloud.ces.v1.ClientCertificateSettings.encode(message.clientCertificateSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.timeZoneSettings != null && Object.hasOwnProperty.call(message, "timeZoneSettings")) + $root.google.cloud.ces.v1.TimeZoneSettings.encode(message.timeZoneSettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.predefinedVariableDeclarations != null && message.predefinedVariableDeclarations.length) + for (var i = 0; i < message.predefinedVariableDeclarations.length; ++i) + $root.google.cloud.ces.v1.App.VariableDeclaration.encode(message.predefinedVariableDeclarations[i], writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) + writer.uint32(/* id 29, wireType 0 =*/232).bool(message.locked); + if (message.pinned != null && Object.hasOwnProperty.call(message, "pinned")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.pinned); + if (message.toolExecutionMode != null && Object.hasOwnProperty.call(message, "toolExecutionMode")) + writer.uint32(/* id 32, wireType 0 =*/256).int32(message.toolExecutionMode); + return writer; + }; + + /** + * Encodes the specified App message, length delimited. Does not implicitly {@link google.cloud.ces.v1.App.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.App + * @static + * @param {google.cloud.ces.v1.IApp} message App message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + App.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an App message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.App + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.App} App + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + App.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.App(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 31: { + message.pinned = reader.bool(); + break; + } + case 4: { + message.rootAgent = reader.string(); + break; + } + case 18: { + message.languageSettings = $root.google.cloud.ces.v1.LanguageSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.timeZoneSettings = $root.google.cloud.ces.v1.TimeZoneSettings.decode(reader, reader.uint32()); + break; + } + case 7: { + message.audioProcessingConfig = $root.google.cloud.ces.v1.AudioProcessingConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.loggingSettings = $root.google.cloud.ces.v1.LoggingSettings.decode(reader, reader.uint32()); + break; + } + case 13: { + message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.decode(reader, reader.uint32()); + break; + } + case 32: { + message.toolExecutionMode = reader.int32(); + break; + } + case 24: { + message.evaluationMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.decode(reader, reader.uint32()); + break; + } + case 14: { + if (!(message.variableDeclarations && message.variableDeclarations.length)) + message.variableDeclarations = []; + message.variableDeclarations.push($root.google.cloud.ces.v1.App.VariableDeclaration.decode(reader, reader.uint32())); + break; + } + case 28: { + if (!(message.predefinedVariableDeclarations && message.predefinedVariableDeclarations.length)) + message.predefinedVariableDeclarations = []; + message.predefinedVariableDeclarations.push($root.google.cloud.ces.v1.App.VariableDeclaration.decode(reader, reader.uint32())); + break; + } + case 17: { + message.globalInstruction = reader.string(); + break; + } + case 10: { + if (!(message.guardrails && message.guardrails.length)) + message.guardrails = []; + message.guardrails.push(reader.string()); + break; + } + case 15: { + message.dataStoreSettings = $root.google.cloud.ces.v1.DataStoreSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.defaultChannelProfile = $root.google.cloud.ces.v1.ChannelProfile.decode(reader, reader.uint32()); + break; + } + case 11: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + 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.metadata[key] = value; + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.etag = reader.string(); + break; + } + case 23: { + message.deploymentCount = reader.int32(); + break; + } + case 25: { + message.clientCertificateSettings = $root.google.cloud.ces.v1.ClientCertificateSettings.decode(reader, reader.uint32()); + break; + } + case 29: { + message.locked = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an App message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.App + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.App} App + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + App.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an App message. + * @function verify + * @memberof google.cloud.ces.v1.App + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + App.verify = function verify(message) { + if (typeof message !== "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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.pinned != null && message.hasOwnProperty("pinned")) + if (typeof message.pinned !== "boolean") + return "pinned: boolean expected"; + if (message.rootAgent != null && message.hasOwnProperty("rootAgent")) + if (!$util.isString(message.rootAgent)) + return "rootAgent: string expected"; + if (message.languageSettings != null && message.hasOwnProperty("languageSettings")) { + var error = $root.google.cloud.ces.v1.LanguageSettings.verify(message.languageSettings); + if (error) + return "languageSettings." + error; + } + if (message.timeZoneSettings != null && message.hasOwnProperty("timeZoneSettings")) { + var error = $root.google.cloud.ces.v1.TimeZoneSettings.verify(message.timeZoneSettings); + if (error) + return "timeZoneSettings." + error; + } + if (message.audioProcessingConfig != null && message.hasOwnProperty("audioProcessingConfig")) { + var error = $root.google.cloud.ces.v1.AudioProcessingConfig.verify(message.audioProcessingConfig); + if (error) + return "audioProcessingConfig." + error; + } + if (message.loggingSettings != null && message.hasOwnProperty("loggingSettings")) { + var error = $root.google.cloud.ces.v1.LoggingSettings.verify(message.loggingSettings); + if (error) + return "loggingSettings." + error; + } + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { + var error = $root.google.cloud.ces.v1.ModelSettings.verify(message.modelSettings); + if (error) + return "modelSettings." + error; + } + if (message.toolExecutionMode != null && message.hasOwnProperty("toolExecutionMode")) + switch (message.toolExecutionMode) { + default: + return "toolExecutionMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.evaluationMetricsThresholds != null && message.hasOwnProperty("evaluationMetricsThresholds")) { + var error = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.verify(message.evaluationMetricsThresholds); + if (error) + return "evaluationMetricsThresholds." + error; + } + if (message.variableDeclarations != null && message.hasOwnProperty("variableDeclarations")) { + if (!Array.isArray(message.variableDeclarations)) + return "variableDeclarations: array expected"; + for (var i = 0; i < message.variableDeclarations.length; ++i) { + var error = $root.google.cloud.ces.v1.App.VariableDeclaration.verify(message.variableDeclarations[i]); + if (error) + return "variableDeclarations." + error; + } + } + if (message.predefinedVariableDeclarations != null && message.hasOwnProperty("predefinedVariableDeclarations")) { + if (!Array.isArray(message.predefinedVariableDeclarations)) + return "predefinedVariableDeclarations: array expected"; + for (var i = 0; i < message.predefinedVariableDeclarations.length; ++i) { + var error = $root.google.cloud.ces.v1.App.VariableDeclaration.verify(message.predefinedVariableDeclarations[i]); + if (error) + return "predefinedVariableDeclarations." + error; + } + } + if (message.globalInstruction != null && message.hasOwnProperty("globalInstruction")) + if (!$util.isString(message.globalInstruction)) + return "globalInstruction: string expected"; + if (message.guardrails != null && message.hasOwnProperty("guardrails")) { + if (!Array.isArray(message.guardrails)) + return "guardrails: array expected"; + for (var i = 0; i < message.guardrails.length; ++i) + if (!$util.isString(message.guardrails[i])) + return "guardrails: string[] expected"; + } + if (message.dataStoreSettings != null && message.hasOwnProperty("dataStoreSettings")) { + var error = $root.google.cloud.ces.v1.DataStoreSettings.verify(message.dataStoreSettings); + if (error) + return "dataStoreSettings." + error; + } + if (message.defaultChannelProfile != null && message.hasOwnProperty("defaultChannelProfile")) { + var error = $root.google.cloud.ces.v1.ChannelProfile.verify(message.defaultChannelProfile); + if (error) + return "defaultChannelProfile." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k: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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.deploymentCount != null && message.hasOwnProperty("deploymentCount")) + if (!$util.isInteger(message.deploymentCount)) + return "deploymentCount: integer expected"; + if (message.clientCertificateSettings != null && message.hasOwnProperty("clientCertificateSettings")) { + var error = $root.google.cloud.ces.v1.ClientCertificateSettings.verify(message.clientCertificateSettings); + if (error) + return "clientCertificateSettings." + error; + } + if (message.locked != null && message.hasOwnProperty("locked")) + if (typeof message.locked !== "boolean") + return "locked: boolean expected"; + return null; + }; + + /** + * Creates an App message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.App + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.App} App + */ + App.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.App) + return object; + var message = new $root.google.cloud.ces.v1.App(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.pinned != null) + message.pinned = Boolean(object.pinned); + if (object.rootAgent != null) + message.rootAgent = String(object.rootAgent); + if (object.languageSettings != null) { + if (typeof object.languageSettings !== "object") + throw TypeError(".google.cloud.ces.v1.App.languageSettings: object expected"); + message.languageSettings = $root.google.cloud.ces.v1.LanguageSettings.fromObject(object.languageSettings); + } + if (object.timeZoneSettings != null) { + if (typeof object.timeZoneSettings !== "object") + throw TypeError(".google.cloud.ces.v1.App.timeZoneSettings: object expected"); + message.timeZoneSettings = $root.google.cloud.ces.v1.TimeZoneSettings.fromObject(object.timeZoneSettings); + } + if (object.audioProcessingConfig != null) { + if (typeof object.audioProcessingConfig !== "object") + throw TypeError(".google.cloud.ces.v1.App.audioProcessingConfig: object expected"); + message.audioProcessingConfig = $root.google.cloud.ces.v1.AudioProcessingConfig.fromObject(object.audioProcessingConfig); + } + if (object.loggingSettings != null) { + if (typeof object.loggingSettings !== "object") + throw TypeError(".google.cloud.ces.v1.App.loggingSettings: object expected"); + message.loggingSettings = $root.google.cloud.ces.v1.LoggingSettings.fromObject(object.loggingSettings); + } + if (object.modelSettings != null) { + if (typeof object.modelSettings !== "object") + throw TypeError(".google.cloud.ces.v1.App.modelSettings: object expected"); + message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.fromObject(object.modelSettings); + } + switch (object.toolExecutionMode) { + default: + if (typeof object.toolExecutionMode === "number") { + message.toolExecutionMode = object.toolExecutionMode; + break; + } + break; + case "TOOL_EXECUTION_MODE_UNSPECIFIED": + case 0: + message.toolExecutionMode = 0; + break; + case "PARALLEL": + case 1: + message.toolExecutionMode = 1; + break; + case "SEQUENTIAL": + case 2: + message.toolExecutionMode = 2; + break; + } + if (object.evaluationMetricsThresholds != null) { + if (typeof object.evaluationMetricsThresholds !== "object") + throw TypeError(".google.cloud.ces.v1.App.evaluationMetricsThresholds: object expected"); + message.evaluationMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.fromObject(object.evaluationMetricsThresholds); + } + if (object.variableDeclarations) { + if (!Array.isArray(object.variableDeclarations)) + throw TypeError(".google.cloud.ces.v1.App.variableDeclarations: array expected"); + message.variableDeclarations = []; + for (var i = 0; i < object.variableDeclarations.length; ++i) { + if (typeof object.variableDeclarations[i] !== "object") + throw TypeError(".google.cloud.ces.v1.App.variableDeclarations: object expected"); + message.variableDeclarations[i] = $root.google.cloud.ces.v1.App.VariableDeclaration.fromObject(object.variableDeclarations[i]); + } + } + if (object.predefinedVariableDeclarations) { + if (!Array.isArray(object.predefinedVariableDeclarations)) + throw TypeError(".google.cloud.ces.v1.App.predefinedVariableDeclarations: array expected"); + message.predefinedVariableDeclarations = []; + for (var i = 0; i < object.predefinedVariableDeclarations.length; ++i) { + if (typeof object.predefinedVariableDeclarations[i] !== "object") + throw TypeError(".google.cloud.ces.v1.App.predefinedVariableDeclarations: object expected"); + message.predefinedVariableDeclarations[i] = $root.google.cloud.ces.v1.App.VariableDeclaration.fromObject(object.predefinedVariableDeclarations[i]); + } + } + if (object.globalInstruction != null) + message.globalInstruction = String(object.globalInstruction); + if (object.guardrails) { + if (!Array.isArray(object.guardrails)) + throw TypeError(".google.cloud.ces.v1.App.guardrails: array expected"); + message.guardrails = []; + for (var i = 0; i < object.guardrails.length; ++i) + message.guardrails[i] = String(object.guardrails[i]); + } + if (object.dataStoreSettings != null) { + if (typeof object.dataStoreSettings !== "object") + throw TypeError(".google.cloud.ces.v1.App.dataStoreSettings: object expected"); + message.dataStoreSettings = $root.google.cloud.ces.v1.DataStoreSettings.fromObject(object.dataStoreSettings); + } + if (object.defaultChannelProfile != null) { + if (typeof object.defaultChannelProfile !== "object") + throw TypeError(".google.cloud.ces.v1.App.defaultChannelProfile: object expected"); + message.defaultChannelProfile = $root.google.cloud.ces.v1.ChannelProfile.fromObject(object.defaultChannelProfile); + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.ces.v1.App.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1.App.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.ces.v1.App.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.deploymentCount != null) + message.deploymentCount = object.deploymentCount | 0; + if (object.clientCertificateSettings != null) { + if (typeof object.clientCertificateSettings !== "object") + throw TypeError(".google.cloud.ces.v1.App.clientCertificateSettings: object expected"); + message.clientCertificateSettings = $root.google.cloud.ces.v1.ClientCertificateSettings.fromObject(object.clientCertificateSettings); + } + if (object.locked != null) + message.locked = Boolean(object.locked); + return message; + }; + + /** + * Creates a plain object from an App message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.App + * @static + * @param {google.cloud.ces.v1.App} message App + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + App.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.guardrails = []; + object.variableDeclarations = []; + object.predefinedVariableDeclarations = []; + } + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.rootAgent = ""; + object.createTime = null; + object.updateTime = null; + object.audioProcessingConfig = null; + object.loggingSettings = null; + object.etag = ""; + object.modelSettings = null; + object.dataStoreSettings = null; + object.globalInstruction = ""; + object.languageSettings = null; + object.defaultChannelProfile = null; + object.deploymentCount = 0; + object.evaluationMetricsThresholds = null; + object.clientCertificateSettings = null; + object.timeZoneSettings = null; + object.locked = false; + object.pinned = false; + object.toolExecutionMode = options.enums === String ? "TOOL_EXECUTION_MODE_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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.rootAgent != null && message.hasOwnProperty("rootAgent")) + object.rootAgent = message.rootAgent; + 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.audioProcessingConfig != null && message.hasOwnProperty("audioProcessingConfig")) + object.audioProcessingConfig = $root.google.cloud.ces.v1.AudioProcessingConfig.toObject(message.audioProcessingConfig, options); + if (message.loggingSettings != null && message.hasOwnProperty("loggingSettings")) + object.loggingSettings = $root.google.cloud.ces.v1.LoggingSettings.toObject(message.loggingSettings, options); + if (message.guardrails && message.guardrails.length) { + object.guardrails = []; + for (var j = 0; j < message.guardrails.length; ++j) + object.guardrails[j] = message.guardrails[j]; + } + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) + object.modelSettings = $root.google.cloud.ces.v1.ModelSettings.toObject(message.modelSettings, options); + if (message.variableDeclarations && message.variableDeclarations.length) { + object.variableDeclarations = []; + for (var j = 0; j < message.variableDeclarations.length; ++j) + object.variableDeclarations[j] = $root.google.cloud.ces.v1.App.VariableDeclaration.toObject(message.variableDeclarations[j], options); + } + if (message.dataStoreSettings != null && message.hasOwnProperty("dataStoreSettings")) + object.dataStoreSettings = $root.google.cloud.ces.v1.DataStoreSettings.toObject(message.dataStoreSettings, options); + if (message.globalInstruction != null && message.hasOwnProperty("globalInstruction")) + object.globalInstruction = message.globalInstruction; + if (message.languageSettings != null && message.hasOwnProperty("languageSettings")) + object.languageSettings = $root.google.cloud.ces.v1.LanguageSettings.toObject(message.languageSettings, options); + if (message.defaultChannelProfile != null && message.hasOwnProperty("defaultChannelProfile")) + object.defaultChannelProfile = $root.google.cloud.ces.v1.ChannelProfile.toObject(message.defaultChannelProfile, options); + if (message.deploymentCount != null && message.hasOwnProperty("deploymentCount")) + object.deploymentCount = message.deploymentCount; + if (message.evaluationMetricsThresholds != null && message.hasOwnProperty("evaluationMetricsThresholds")) + object.evaluationMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.toObject(message.evaluationMetricsThresholds, options); + if (message.clientCertificateSettings != null && message.hasOwnProperty("clientCertificateSettings")) + object.clientCertificateSettings = $root.google.cloud.ces.v1.ClientCertificateSettings.toObject(message.clientCertificateSettings, options); + if (message.timeZoneSettings != null && message.hasOwnProperty("timeZoneSettings")) + object.timeZoneSettings = $root.google.cloud.ces.v1.TimeZoneSettings.toObject(message.timeZoneSettings, options); + if (message.predefinedVariableDeclarations && message.predefinedVariableDeclarations.length) { + object.predefinedVariableDeclarations = []; + for (var j = 0; j < message.predefinedVariableDeclarations.length; ++j) + object.predefinedVariableDeclarations[j] = $root.google.cloud.ces.v1.App.VariableDeclaration.toObject(message.predefinedVariableDeclarations[j], options); + } + if (message.locked != null && message.hasOwnProperty("locked")) + object.locked = message.locked; + if (message.pinned != null && message.hasOwnProperty("pinned")) + object.pinned = message.pinned; + if (message.toolExecutionMode != null && message.hasOwnProperty("toolExecutionMode")) + object.toolExecutionMode = options.enums === String ? $root.google.cloud.ces.v1.App.ToolExecutionMode[message.toolExecutionMode] === undefined ? message.toolExecutionMode : $root.google.cloud.ces.v1.App.ToolExecutionMode[message.toolExecutionMode] : message.toolExecutionMode; + return object; + }; + + /** + * Converts this App to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.App + * @instance + * @returns {Object.} JSON object + */ + App.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for App + * @function getTypeUrl + * @memberof google.cloud.ces.v1.App + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + App.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.App"; + }; + + App.VariableDeclaration = (function() { + + /** + * Properties of a VariableDeclaration. + * @memberof google.cloud.ces.v1.App + * @interface IVariableDeclaration + * @property {string|null} [name] VariableDeclaration name + * @property {string|null} [description] VariableDeclaration description + * @property {google.cloud.ces.v1.ISchema|null} [schema] VariableDeclaration schema + */ + + /** + * Constructs a new VariableDeclaration. + * @memberof google.cloud.ces.v1.App + * @classdesc Represents a VariableDeclaration. + * @implements IVariableDeclaration + * @constructor + * @param {google.cloud.ces.v1.App.IVariableDeclaration=} [properties] Properties to set + */ + function VariableDeclaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VariableDeclaration name. + * @member {string} name + * @memberof google.cloud.ces.v1.App.VariableDeclaration + * @instance + */ + VariableDeclaration.prototype.name = ""; + + /** + * VariableDeclaration description. + * @member {string} description + * @memberof google.cloud.ces.v1.App.VariableDeclaration + * @instance + */ + VariableDeclaration.prototype.description = ""; + + /** + * VariableDeclaration schema. + * @member {google.cloud.ces.v1.ISchema|null|undefined} schema + * @memberof google.cloud.ces.v1.App.VariableDeclaration + * @instance + */ + VariableDeclaration.prototype.schema = null; + + /** + * Creates a new VariableDeclaration instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.App.VariableDeclaration + * @static + * @param {google.cloud.ces.v1.App.IVariableDeclaration=} [properties] Properties to set + * @returns {google.cloud.ces.v1.App.VariableDeclaration} VariableDeclaration instance + */ + VariableDeclaration.create = function create(properties) { + return new VariableDeclaration(properties); + }; + + /** + * Encodes the specified VariableDeclaration message. Does not implicitly {@link google.cloud.ces.v1.App.VariableDeclaration.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.App.VariableDeclaration + * @static + * @param {google.cloud.ces.v1.App.IVariableDeclaration} message VariableDeclaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VariableDeclaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.cloud.ces.v1.Schema.encode(message.schema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VariableDeclaration message, length delimited. Does not implicitly {@link google.cloud.ces.v1.App.VariableDeclaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.App.VariableDeclaration + * @static + * @param {google.cloud.ces.v1.App.IVariableDeclaration} message VariableDeclaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VariableDeclaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VariableDeclaration message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.App.VariableDeclaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.App.VariableDeclaration} VariableDeclaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VariableDeclaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.App.VariableDeclaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.schema = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VariableDeclaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.App.VariableDeclaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.App.VariableDeclaration} VariableDeclaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VariableDeclaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VariableDeclaration message. + * @function verify + * @memberof google.cloud.ces.v1.App.VariableDeclaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VariableDeclaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.schema != null && message.hasOwnProperty("schema")) { + var error = $root.google.cloud.ces.v1.Schema.verify(message.schema); + if (error) + return "schema." + error; + } + return null; + }; + + /** + * Creates a VariableDeclaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.App.VariableDeclaration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.App.VariableDeclaration} VariableDeclaration + */ + VariableDeclaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.App.VariableDeclaration) + return object; + var message = new $root.google.cloud.ces.v1.App.VariableDeclaration(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.cloud.ces.v1.App.VariableDeclaration.schema: object expected"); + message.schema = $root.google.cloud.ces.v1.Schema.fromObject(object.schema); + } + return message; + }; + + /** + * Creates a plain object from a VariableDeclaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.App.VariableDeclaration + * @static + * @param {google.cloud.ces.v1.App.VariableDeclaration} message VariableDeclaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VariableDeclaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.schema = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = $root.google.cloud.ces.v1.Schema.toObject(message.schema, options); + return object; + }; + + /** + * Converts this VariableDeclaration to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.App.VariableDeclaration + * @instance + * @returns {Object.} JSON object + */ + VariableDeclaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VariableDeclaration + * @function getTypeUrl + * @memberof google.cloud.ces.v1.App.VariableDeclaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VariableDeclaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.App.VariableDeclaration"; + }; + + return VariableDeclaration; + })(); + + /** + * ToolExecutionMode enum. + * @name google.cloud.ces.v1.App.ToolExecutionMode + * @enum {number} + * @property {number} TOOL_EXECUTION_MODE_UNSPECIFIED=0 TOOL_EXECUTION_MODE_UNSPECIFIED value + * @property {number} PARALLEL=1 PARALLEL value + * @property {number} SEQUENTIAL=2 SEQUENTIAL value + */ + App.ToolExecutionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TOOL_EXECUTION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PARALLEL"] = 1; + values[valuesById[2] = "SEQUENTIAL"] = 2; + return values; + })(); + + return App; + })(); + + v1.TimeZoneSettings = (function() { + + /** + * Properties of a TimeZoneSettings. + * @memberof google.cloud.ces.v1 + * @interface ITimeZoneSettings + * @property {string|null} [timeZone] TimeZoneSettings timeZone + */ + + /** + * Constructs a new TimeZoneSettings. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a TimeZoneSettings. + * @implements ITimeZoneSettings + * @constructor + * @param {google.cloud.ces.v1.ITimeZoneSettings=} [properties] Properties to set + */ + function TimeZoneSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeZoneSettings timeZone. + * @member {string} timeZone + * @memberof google.cloud.ces.v1.TimeZoneSettings + * @instance + */ + TimeZoneSettings.prototype.timeZone = ""; + + /** + * Creates a new TimeZoneSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.TimeZoneSettings + * @static + * @param {google.cloud.ces.v1.ITimeZoneSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1.TimeZoneSettings} TimeZoneSettings instance + */ + TimeZoneSettings.create = function create(properties) { + return new TimeZoneSettings(properties); + }; + + /** + * Encodes the specified TimeZoneSettings message. Does not implicitly {@link google.cloud.ces.v1.TimeZoneSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.TimeZoneSettings + * @static + * @param {google.cloud.ces.v1.ITimeZoneSettings} message TimeZoneSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeZoneSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.timeZone); + return writer; + }; + + /** + * Encodes the specified TimeZoneSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TimeZoneSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.TimeZoneSettings + * @static + * @param {google.cloud.ces.v1.ITimeZoneSettings} message TimeZoneSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeZoneSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeZoneSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.TimeZoneSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.TimeZoneSettings} TimeZoneSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeZoneSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TimeZoneSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.timeZone = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeZoneSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.TimeZoneSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.TimeZoneSettings} TimeZoneSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeZoneSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeZoneSettings message. + * @function verify + * @memberof google.cloud.ces.v1.TimeZoneSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeZoneSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + return null; + }; + + /** + * Creates a TimeZoneSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.TimeZoneSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.TimeZoneSettings} TimeZoneSettings + */ + TimeZoneSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.TimeZoneSettings) + return object; + var message = new $root.google.cloud.ces.v1.TimeZoneSettings(); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + return message; + }; + + /** + * Creates a plain object from a TimeZoneSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.TimeZoneSettings + * @static + * @param {google.cloud.ces.v1.TimeZoneSettings} message TimeZoneSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeZoneSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.timeZone = ""; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + return object; + }; + + /** + * Converts this TimeZoneSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.TimeZoneSettings + * @instance + * @returns {Object.} JSON object + */ + TimeZoneSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeZoneSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1.TimeZoneSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeZoneSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.TimeZoneSettings"; + }; + + return TimeZoneSettings; + })(); + + v1.LanguageSettings = (function() { + + /** + * Properties of a LanguageSettings. + * @memberof google.cloud.ces.v1 + * @interface ILanguageSettings + * @property {string|null} [defaultLanguageCode] LanguageSettings defaultLanguageCode + * @property {Array.|null} [supportedLanguageCodes] LanguageSettings supportedLanguageCodes + * @property {boolean|null} [enableMultilingualSupport] LanguageSettings enableMultilingualSupport + * @property {string|null} [fallbackAction] LanguageSettings fallbackAction + */ + + /** + * Constructs a new LanguageSettings. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a LanguageSettings. + * @implements ILanguageSettings + * @constructor + * @param {google.cloud.ces.v1.ILanguageSettings=} [properties] Properties to set + */ + function LanguageSettings(properties) { + this.supportedLanguageCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LanguageSettings defaultLanguageCode. + * @member {string} defaultLanguageCode + * @memberof google.cloud.ces.v1.LanguageSettings + * @instance + */ + LanguageSettings.prototype.defaultLanguageCode = ""; + + /** + * LanguageSettings supportedLanguageCodes. + * @member {Array.} supportedLanguageCodes + * @memberof google.cloud.ces.v1.LanguageSettings + * @instance + */ + LanguageSettings.prototype.supportedLanguageCodes = $util.emptyArray; + + /** + * LanguageSettings enableMultilingualSupport. + * @member {boolean} enableMultilingualSupport + * @memberof google.cloud.ces.v1.LanguageSettings + * @instance + */ + LanguageSettings.prototype.enableMultilingualSupport = false; + + /** + * LanguageSettings fallbackAction. + * @member {string} fallbackAction + * @memberof google.cloud.ces.v1.LanguageSettings + * @instance + */ + LanguageSettings.prototype.fallbackAction = ""; + + /** + * Creates a new LanguageSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.LanguageSettings + * @static + * @param {google.cloud.ces.v1.ILanguageSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1.LanguageSettings} LanguageSettings instance + */ + LanguageSettings.create = function create(properties) { + return new LanguageSettings(properties); + }; + + /** + * Encodes the specified LanguageSettings message. Does not implicitly {@link google.cloud.ces.v1.LanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.LanguageSettings + * @static + * @param {google.cloud.ces.v1.ILanguageSettings} message LanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaultLanguageCode != null && Object.hasOwnProperty.call(message, "defaultLanguageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.defaultLanguageCode); + if (message.supportedLanguageCodes != null && message.supportedLanguageCodes.length) + for (var i = 0; i < message.supportedLanguageCodes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.supportedLanguageCodes[i]); + if (message.enableMultilingualSupport != null && Object.hasOwnProperty.call(message, "enableMultilingualSupport")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableMultilingualSupport); + if (message.fallbackAction != null && Object.hasOwnProperty.call(message, "fallbackAction")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.fallbackAction); + return writer; + }; + + /** + * Encodes the specified LanguageSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.LanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.LanguageSettings + * @static + * @param {google.cloud.ces.v1.ILanguageSettings} message LanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.LanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.LanguageSettings} LanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.LanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.defaultLanguageCode = reader.string(); + break; + } + case 2: { + if (!(message.supportedLanguageCodes && message.supportedLanguageCodes.length)) + message.supportedLanguageCodes = []; + message.supportedLanguageCodes.push(reader.string()); + break; + } + case 3: { + message.enableMultilingualSupport = reader.bool(); + break; + } + case 4: { + message.fallbackAction = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.LanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.LanguageSettings} LanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LanguageSettings message. + * @function verify + * @memberof google.cloud.ces.v1.LanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaultLanguageCode != null && message.hasOwnProperty("defaultLanguageCode")) + if (!$util.isString(message.defaultLanguageCode)) + return "defaultLanguageCode: string expected"; + if (message.supportedLanguageCodes != null && message.hasOwnProperty("supportedLanguageCodes")) { + if (!Array.isArray(message.supportedLanguageCodes)) + return "supportedLanguageCodes: array expected"; + for (var i = 0; i < message.supportedLanguageCodes.length; ++i) + if (!$util.isString(message.supportedLanguageCodes[i])) + return "supportedLanguageCodes: string[] expected"; + } + if (message.enableMultilingualSupport != null && message.hasOwnProperty("enableMultilingualSupport")) + if (typeof message.enableMultilingualSupport !== "boolean") + return "enableMultilingualSupport: boolean expected"; + if (message.fallbackAction != null && message.hasOwnProperty("fallbackAction")) + if (!$util.isString(message.fallbackAction)) + return "fallbackAction: string expected"; + return null; + }; + + /** + * Creates a LanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.LanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.LanguageSettings} LanguageSettings + */ + LanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.LanguageSettings) + return object; + var message = new $root.google.cloud.ces.v1.LanguageSettings(); + if (object.defaultLanguageCode != null) + message.defaultLanguageCode = String(object.defaultLanguageCode); + if (object.supportedLanguageCodes) { + if (!Array.isArray(object.supportedLanguageCodes)) + throw TypeError(".google.cloud.ces.v1.LanguageSettings.supportedLanguageCodes: array expected"); + message.supportedLanguageCodes = []; + for (var i = 0; i < object.supportedLanguageCodes.length; ++i) + message.supportedLanguageCodes[i] = String(object.supportedLanguageCodes[i]); + } + if (object.enableMultilingualSupport != null) + message.enableMultilingualSupport = Boolean(object.enableMultilingualSupport); + if (object.fallbackAction != null) + message.fallbackAction = String(object.fallbackAction); + return message; + }; + + /** + * Creates a plain object from a LanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.LanguageSettings + * @static + * @param {google.cloud.ces.v1.LanguageSettings} message LanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedLanguageCodes = []; + if (options.defaults) { + object.defaultLanguageCode = ""; + object.enableMultilingualSupport = false; + object.fallbackAction = ""; + } + if (message.defaultLanguageCode != null && message.hasOwnProperty("defaultLanguageCode")) + object.defaultLanguageCode = message.defaultLanguageCode; + if (message.supportedLanguageCodes && message.supportedLanguageCodes.length) { + object.supportedLanguageCodes = []; + for (var j = 0; j < message.supportedLanguageCodes.length; ++j) + object.supportedLanguageCodes[j] = message.supportedLanguageCodes[j]; + } + if (message.enableMultilingualSupport != null && message.hasOwnProperty("enableMultilingualSupport")) + object.enableMultilingualSupport = message.enableMultilingualSupport; + if (message.fallbackAction != null && message.hasOwnProperty("fallbackAction")) + object.fallbackAction = message.fallbackAction; + return object; + }; + + /** + * Converts this LanguageSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.LanguageSettings + * @instance + * @returns {Object.} JSON object + */ + LanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LanguageSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1.LanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.LanguageSettings"; + }; + + return LanguageSettings; + })(); + + v1.AudioProcessingConfig = (function() { + + /** + * Properties of an AudioProcessingConfig. + * @memberof google.cloud.ces.v1 + * @interface IAudioProcessingConfig + * @property {Object.|null} [synthesizeSpeechConfigs] AudioProcessingConfig synthesizeSpeechConfigs + * @property {google.cloud.ces.v1.IBargeInConfig|null} [bargeInConfig] AudioProcessingConfig bargeInConfig + * @property {google.protobuf.IDuration|null} [inactivityTimeout] AudioProcessingConfig inactivityTimeout + * @property {google.cloud.ces.v1.IAmbientSoundConfig|null} [ambientSoundConfig] AudioProcessingConfig ambientSoundConfig + */ + + /** + * Constructs a new AudioProcessingConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an AudioProcessingConfig. + * @implements IAudioProcessingConfig + * @constructor + * @param {google.cloud.ces.v1.IAudioProcessingConfig=} [properties] Properties to set + */ + function AudioProcessingConfig(properties) { + this.synthesizeSpeechConfigs = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AudioProcessingConfig synthesizeSpeechConfigs. + * @member {Object.} synthesizeSpeechConfigs + * @memberof google.cloud.ces.v1.AudioProcessingConfig + * @instance + */ + AudioProcessingConfig.prototype.synthesizeSpeechConfigs = $util.emptyObject; + + /** + * AudioProcessingConfig bargeInConfig. + * @member {google.cloud.ces.v1.IBargeInConfig|null|undefined} bargeInConfig + * @memberof google.cloud.ces.v1.AudioProcessingConfig + * @instance + */ + AudioProcessingConfig.prototype.bargeInConfig = null; + + /** + * AudioProcessingConfig inactivityTimeout. + * @member {google.protobuf.IDuration|null|undefined} inactivityTimeout + * @memberof google.cloud.ces.v1.AudioProcessingConfig + * @instance + */ + AudioProcessingConfig.prototype.inactivityTimeout = null; + + /** + * AudioProcessingConfig ambientSoundConfig. + * @member {google.cloud.ces.v1.IAmbientSoundConfig|null|undefined} ambientSoundConfig + * @memberof google.cloud.ces.v1.AudioProcessingConfig + * @instance + */ + AudioProcessingConfig.prototype.ambientSoundConfig = null; + + /** + * Creates a new AudioProcessingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.AudioProcessingConfig + * @static + * @param {google.cloud.ces.v1.IAudioProcessingConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.AudioProcessingConfig} AudioProcessingConfig instance + */ + AudioProcessingConfig.create = function create(properties) { + return new AudioProcessingConfig(properties); + }; + + /** + * Encodes the specified AudioProcessingConfig message. Does not implicitly {@link google.cloud.ces.v1.AudioProcessingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.AudioProcessingConfig + * @static + * @param {google.cloud.ces.v1.IAudioProcessingConfig} message AudioProcessingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioProcessingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.synthesizeSpeechConfigs != null && Object.hasOwnProperty.call(message, "synthesizeSpeechConfigs")) + for (var keys = Object.keys(message.synthesizeSpeechConfigs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.ces.v1.SynthesizeSpeechConfig.encode(message.synthesizeSpeechConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.bargeInConfig != null && Object.hasOwnProperty.call(message, "bargeInConfig")) + $root.google.cloud.ces.v1.BargeInConfig.encode(message.bargeInConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.inactivityTimeout != null && Object.hasOwnProperty.call(message, "inactivityTimeout")) + $root.google.protobuf.Duration.encode(message.inactivityTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ambientSoundConfig != null && Object.hasOwnProperty.call(message, "ambientSoundConfig")) + $root.google.cloud.ces.v1.AmbientSoundConfig.encode(message.ambientSoundConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AudioProcessingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AudioProcessingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.AudioProcessingConfig + * @static + * @param {google.cloud.ces.v1.IAudioProcessingConfig} message AudioProcessingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioProcessingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AudioProcessingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.AudioProcessingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.AudioProcessingConfig} AudioProcessingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioProcessingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.AudioProcessingConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.synthesizeSpeechConfigs === $util.emptyObject) + message.synthesizeSpeechConfigs = {}; + 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.ces.v1.SynthesizeSpeechConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.synthesizeSpeechConfigs[key] = value; + break; + } + case 3: { + message.bargeInConfig = $root.google.cloud.ces.v1.BargeInConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.inactivityTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.ambientSoundConfig = $root.google.cloud.ces.v1.AmbientSoundConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AudioProcessingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.AudioProcessingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.AudioProcessingConfig} AudioProcessingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioProcessingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AudioProcessingConfig message. + * @function verify + * @memberof google.cloud.ces.v1.AudioProcessingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AudioProcessingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.synthesizeSpeechConfigs != null && message.hasOwnProperty("synthesizeSpeechConfigs")) { + if (!$util.isObject(message.synthesizeSpeechConfigs)) + return "synthesizeSpeechConfigs: object expected"; + var key = Object.keys(message.synthesizeSpeechConfigs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1.SynthesizeSpeechConfig.verify(message.synthesizeSpeechConfigs[key[i]]); + if (error) + return "synthesizeSpeechConfigs." + error; + } + } + if (message.bargeInConfig != null && message.hasOwnProperty("bargeInConfig")) { + var error = $root.google.cloud.ces.v1.BargeInConfig.verify(message.bargeInConfig); + if (error) + return "bargeInConfig." + error; + } + if (message.inactivityTimeout != null && message.hasOwnProperty("inactivityTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.inactivityTimeout); + if (error) + return "inactivityTimeout." + error; + } + if (message.ambientSoundConfig != null && message.hasOwnProperty("ambientSoundConfig")) { + var error = $root.google.cloud.ces.v1.AmbientSoundConfig.verify(message.ambientSoundConfig); + if (error) + return "ambientSoundConfig." + error; + } + return null; + }; + + /** + * Creates an AudioProcessingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.AudioProcessingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.AudioProcessingConfig} AudioProcessingConfig + */ + AudioProcessingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.AudioProcessingConfig) + return object; + var message = new $root.google.cloud.ces.v1.AudioProcessingConfig(); + if (object.synthesizeSpeechConfigs) { + if (typeof object.synthesizeSpeechConfigs !== "object") + throw TypeError(".google.cloud.ces.v1.AudioProcessingConfig.synthesizeSpeechConfigs: object expected"); + message.synthesizeSpeechConfigs = {}; + for (var keys = Object.keys(object.synthesizeSpeechConfigs), i = 0; i < keys.length; ++i) { + if (typeof object.synthesizeSpeechConfigs[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1.AudioProcessingConfig.synthesizeSpeechConfigs: object expected"); + message.synthesizeSpeechConfigs[keys[i]] = $root.google.cloud.ces.v1.SynthesizeSpeechConfig.fromObject(object.synthesizeSpeechConfigs[keys[i]]); + } + } + if (object.bargeInConfig != null) { + if (typeof object.bargeInConfig !== "object") + throw TypeError(".google.cloud.ces.v1.AudioProcessingConfig.bargeInConfig: object expected"); + message.bargeInConfig = $root.google.cloud.ces.v1.BargeInConfig.fromObject(object.bargeInConfig); + } + if (object.inactivityTimeout != null) { + if (typeof object.inactivityTimeout !== "object") + throw TypeError(".google.cloud.ces.v1.AudioProcessingConfig.inactivityTimeout: object expected"); + message.inactivityTimeout = $root.google.protobuf.Duration.fromObject(object.inactivityTimeout); + } + if (object.ambientSoundConfig != null) { + if (typeof object.ambientSoundConfig !== "object") + throw TypeError(".google.cloud.ces.v1.AudioProcessingConfig.ambientSoundConfig: object expected"); + message.ambientSoundConfig = $root.google.cloud.ces.v1.AmbientSoundConfig.fromObject(object.ambientSoundConfig); + } + return message; + }; + + /** + * Creates a plain object from an AudioProcessingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.AudioProcessingConfig + * @static + * @param {google.cloud.ces.v1.AudioProcessingConfig} message AudioProcessingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AudioProcessingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.synthesizeSpeechConfigs = {}; + if (options.defaults) { + object.bargeInConfig = null; + object.inactivityTimeout = null; + object.ambientSoundConfig = null; + } + var keys2; + if (message.synthesizeSpeechConfigs && (keys2 = Object.keys(message.synthesizeSpeechConfigs)).length) { + object.synthesizeSpeechConfigs = {}; + for (var j = 0; j < keys2.length; ++j) + object.synthesizeSpeechConfigs[keys2[j]] = $root.google.cloud.ces.v1.SynthesizeSpeechConfig.toObject(message.synthesizeSpeechConfigs[keys2[j]], options); + } + if (message.bargeInConfig != null && message.hasOwnProperty("bargeInConfig")) + object.bargeInConfig = $root.google.cloud.ces.v1.BargeInConfig.toObject(message.bargeInConfig, options); + if (message.inactivityTimeout != null && message.hasOwnProperty("inactivityTimeout")) + object.inactivityTimeout = $root.google.protobuf.Duration.toObject(message.inactivityTimeout, options); + if (message.ambientSoundConfig != null && message.hasOwnProperty("ambientSoundConfig")) + object.ambientSoundConfig = $root.google.cloud.ces.v1.AmbientSoundConfig.toObject(message.ambientSoundConfig, options); + return object; + }; + + /** + * Converts this AudioProcessingConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.AudioProcessingConfig + * @instance + * @returns {Object.} JSON object + */ + AudioProcessingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AudioProcessingConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.AudioProcessingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AudioProcessingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.AudioProcessingConfig"; + }; + + return AudioProcessingConfig; + })(); + + v1.AmbientSoundConfig = (function() { + + /** + * Properties of an AmbientSoundConfig. + * @memberof google.cloud.ces.v1 + * @interface IAmbientSoundConfig + * @property {google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise|null} [prebuiltAmbientNoise] AmbientSoundConfig prebuiltAmbientNoise + * @property {string|null} [gcsUri] AmbientSoundConfig gcsUri + * @property {string|null} [prebuiltAmbientSound] AmbientSoundConfig prebuiltAmbientSound + * @property {number|null} [volumeGainDb] AmbientSoundConfig volumeGainDb + */ + + /** + * Constructs a new AmbientSoundConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an AmbientSoundConfig. + * @implements IAmbientSoundConfig + * @constructor + * @param {google.cloud.ces.v1.IAmbientSoundConfig=} [properties] Properties to set + */ + function AmbientSoundConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AmbientSoundConfig prebuiltAmbientNoise. + * @member {google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise|null|undefined} prebuiltAmbientNoise + * @memberof google.cloud.ces.v1.AmbientSoundConfig + * @instance + */ + AmbientSoundConfig.prototype.prebuiltAmbientNoise = null; + + /** + * AmbientSoundConfig gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.ces.v1.AmbientSoundConfig + * @instance + */ + AmbientSoundConfig.prototype.gcsUri = null; + + /** + * AmbientSoundConfig prebuiltAmbientSound. + * @member {string|null|undefined} prebuiltAmbientSound + * @memberof google.cloud.ces.v1.AmbientSoundConfig + * @instance + */ + AmbientSoundConfig.prototype.prebuiltAmbientSound = null; + + /** + * AmbientSoundConfig volumeGainDb. + * @member {number} volumeGainDb + * @memberof google.cloud.ces.v1.AmbientSoundConfig + * @instance + */ + AmbientSoundConfig.prototype.volumeGainDb = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AmbientSoundConfig source. + * @member {"prebuiltAmbientNoise"|"gcsUri"|"prebuiltAmbientSound"|undefined} source + * @memberof google.cloud.ces.v1.AmbientSoundConfig + * @instance + */ + Object.defineProperty(AmbientSoundConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["prebuiltAmbientNoise", "gcsUri", "prebuiltAmbientSound"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AmbientSoundConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.AmbientSoundConfig + * @static + * @param {google.cloud.ces.v1.IAmbientSoundConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.AmbientSoundConfig} AmbientSoundConfig instance + */ + AmbientSoundConfig.create = function create(properties) { + return new AmbientSoundConfig(properties); + }; + + /** + * Encodes the specified AmbientSoundConfig message. Does not implicitly {@link google.cloud.ces.v1.AmbientSoundConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.AmbientSoundConfig + * @static + * @param {google.cloud.ces.v1.IAmbientSoundConfig} message AmbientSoundConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AmbientSoundConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prebuiltAmbientNoise != null && Object.hasOwnProperty.call(message, "prebuiltAmbientNoise")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.prebuiltAmbientNoise); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsUri); + if (message.volumeGainDb != null && Object.hasOwnProperty.call(message, "volumeGainDb")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.volumeGainDb); + if (message.prebuiltAmbientSound != null && Object.hasOwnProperty.call(message, "prebuiltAmbientSound")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.prebuiltAmbientSound); + return writer; + }; + + /** + * Encodes the specified AmbientSoundConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AmbientSoundConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.AmbientSoundConfig + * @static + * @param {google.cloud.ces.v1.IAmbientSoundConfig} message AmbientSoundConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AmbientSoundConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AmbientSoundConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.AmbientSoundConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.AmbientSoundConfig} AmbientSoundConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AmbientSoundConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.AmbientSoundConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.prebuiltAmbientNoise = reader.int32(); + break; + } + case 2: { + message.gcsUri = reader.string(); + break; + } + case 4: { + message.prebuiltAmbientSound = reader.string(); + break; + } + case 3: { + message.volumeGainDb = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AmbientSoundConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.AmbientSoundConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.AmbientSoundConfig} AmbientSoundConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AmbientSoundConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AmbientSoundConfig message. + * @function verify + * @memberof google.cloud.ces.v1.AmbientSoundConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AmbientSoundConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.prebuiltAmbientNoise != null && message.hasOwnProperty("prebuiltAmbientNoise")) { + properties.source = 1; + switch (message.prebuiltAmbientNoise) { + default: + return "prebuiltAmbientNoise: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + if (message.prebuiltAmbientSound != null && message.hasOwnProperty("prebuiltAmbientSound")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.prebuiltAmbientSound)) + return "prebuiltAmbientSound: string expected"; + } + if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) + if (typeof message.volumeGainDb !== "number") + return "volumeGainDb: number expected"; + return null; + }; + + /** + * Creates an AmbientSoundConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.AmbientSoundConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.AmbientSoundConfig} AmbientSoundConfig + */ + AmbientSoundConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.AmbientSoundConfig) + return object; + var message = new $root.google.cloud.ces.v1.AmbientSoundConfig(); + switch (object.prebuiltAmbientNoise) { + default: + if (typeof object.prebuiltAmbientNoise === "number") { + message.prebuiltAmbientNoise = object.prebuiltAmbientNoise; + break; + } + break; + case "PREBUILT_AMBIENT_NOISE_UNSPECIFIED": + case 0: + message.prebuiltAmbientNoise = 0; + break; + case "RETAIL_STORE": + case 1: + message.prebuiltAmbientNoise = 1; + break; + case "CONVENTION_HALL": + case 2: + message.prebuiltAmbientNoise = 2; + break; + case "OUTDOOR": + case 3: + message.prebuiltAmbientNoise = 3; + break; + } + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.prebuiltAmbientSound != null) + message.prebuiltAmbientSound = String(object.prebuiltAmbientSound); + if (object.volumeGainDb != null) + message.volumeGainDb = Number(object.volumeGainDb); + return message; + }; + + /** + * Creates a plain object from an AmbientSoundConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.AmbientSoundConfig + * @static + * @param {google.cloud.ces.v1.AmbientSoundConfig} message AmbientSoundConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AmbientSoundConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.volumeGainDb = 0; + if (message.prebuiltAmbientNoise != null && message.hasOwnProperty("prebuiltAmbientNoise")) { + object.prebuiltAmbientNoise = options.enums === String ? $root.google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise[message.prebuiltAmbientNoise] === undefined ? message.prebuiltAmbientNoise : $root.google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise[message.prebuiltAmbientNoise] : message.prebuiltAmbientNoise; + if (options.oneofs) + object.source = "prebuiltAmbientNoise"; + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.source = "gcsUri"; + } + if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) + object.volumeGainDb = options.json && !isFinite(message.volumeGainDb) ? String(message.volumeGainDb) : message.volumeGainDb; + if (message.prebuiltAmbientSound != null && message.hasOwnProperty("prebuiltAmbientSound")) { + object.prebuiltAmbientSound = message.prebuiltAmbientSound; + if (options.oneofs) + object.source = "prebuiltAmbientSound"; + } + return object; + }; + + /** + * Converts this AmbientSoundConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.AmbientSoundConfig + * @instance + * @returns {Object.} JSON object + */ + AmbientSoundConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AmbientSoundConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.AmbientSoundConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AmbientSoundConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.AmbientSoundConfig"; + }; + + /** + * PrebuiltAmbientNoise enum. + * @name google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise + * @enum {number} + * @property {number} PREBUILT_AMBIENT_NOISE_UNSPECIFIED=0 PREBUILT_AMBIENT_NOISE_UNSPECIFIED value + * @property {number} RETAIL_STORE=1 RETAIL_STORE value + * @property {number} CONVENTION_HALL=2 CONVENTION_HALL value + * @property {number} OUTDOOR=3 OUTDOOR value + */ + AmbientSoundConfig.PrebuiltAmbientNoise = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PREBUILT_AMBIENT_NOISE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RETAIL_STORE"] = 1; + values[valuesById[2] = "CONVENTION_HALL"] = 2; + values[valuesById[3] = "OUTDOOR"] = 3; + return values; + })(); + + return AmbientSoundConfig; + })(); + + v1.BargeInConfig = (function() { + + /** + * Properties of a BargeInConfig. + * @memberof google.cloud.ces.v1 + * @interface IBargeInConfig + * @property {boolean|null} [disableBargeIn] BargeInConfig disableBargeIn + * @property {boolean|null} [bargeInAwareness] BargeInConfig bargeInAwareness + */ + + /** + * Constructs a new BargeInConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a BargeInConfig. + * @implements IBargeInConfig + * @constructor + * @param {google.cloud.ces.v1.IBargeInConfig=} [properties] Properties to set + */ + function BargeInConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BargeInConfig disableBargeIn. + * @member {boolean} disableBargeIn + * @memberof google.cloud.ces.v1.BargeInConfig + * @instance + */ + BargeInConfig.prototype.disableBargeIn = false; + + /** + * BargeInConfig bargeInAwareness. + * @member {boolean} bargeInAwareness + * @memberof google.cloud.ces.v1.BargeInConfig + * @instance + */ + BargeInConfig.prototype.bargeInAwareness = false; + + /** + * Creates a new BargeInConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.BargeInConfig + * @static + * @param {google.cloud.ces.v1.IBargeInConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.BargeInConfig} BargeInConfig instance + */ + BargeInConfig.create = function create(properties) { + return new BargeInConfig(properties); + }; + + /** + * Encodes the specified BargeInConfig message. Does not implicitly {@link google.cloud.ces.v1.BargeInConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.BargeInConfig + * @static + * @param {google.cloud.ces.v1.IBargeInConfig} message BargeInConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BargeInConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disableBargeIn != null && Object.hasOwnProperty.call(message, "disableBargeIn")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.disableBargeIn); + if (message.bargeInAwareness != null && Object.hasOwnProperty.call(message, "bargeInAwareness")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.bargeInAwareness); + return writer; + }; + + /** + * Encodes the specified BargeInConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BargeInConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.BargeInConfig + * @static + * @param {google.cloud.ces.v1.IBargeInConfig} message BargeInConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BargeInConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.BargeInConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.BargeInConfig} BargeInConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BargeInConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.BargeInConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.disableBargeIn = reader.bool(); + break; + } + case 2: { + message.bargeInAwareness = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.BargeInConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.BargeInConfig} BargeInConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BargeInConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BargeInConfig message. + * @function verify + * @memberof google.cloud.ces.v1.BargeInConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BargeInConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disableBargeIn != null && message.hasOwnProperty("disableBargeIn")) + if (typeof message.disableBargeIn !== "boolean") + return "disableBargeIn: boolean expected"; + if (message.bargeInAwareness != null && message.hasOwnProperty("bargeInAwareness")) + if (typeof message.bargeInAwareness !== "boolean") + return "bargeInAwareness: boolean expected"; + return null; + }; + + /** + * Creates a BargeInConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.BargeInConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.BargeInConfig} BargeInConfig + */ + BargeInConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.BargeInConfig) + return object; + var message = new $root.google.cloud.ces.v1.BargeInConfig(); + if (object.disableBargeIn != null) + message.disableBargeIn = Boolean(object.disableBargeIn); + if (object.bargeInAwareness != null) + message.bargeInAwareness = Boolean(object.bargeInAwareness); + return message; + }; + + /** + * Creates a plain object from a BargeInConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.BargeInConfig + * @static + * @param {google.cloud.ces.v1.BargeInConfig} message BargeInConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BargeInConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disableBargeIn = false; + object.bargeInAwareness = false; + } + if (message.disableBargeIn != null && message.hasOwnProperty("disableBargeIn")) + object.disableBargeIn = message.disableBargeIn; + if (message.bargeInAwareness != null && message.hasOwnProperty("bargeInAwareness")) + object.bargeInAwareness = message.bargeInAwareness; + return object; + }; + + /** + * Converts this BargeInConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.BargeInConfig + * @instance + * @returns {Object.} JSON object + */ + BargeInConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BargeInConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.BargeInConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BargeInConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.BargeInConfig"; + }; + + return BargeInConfig; + })(); + + v1.SynthesizeSpeechConfig = (function() { + + /** + * Properties of a SynthesizeSpeechConfig. + * @memberof google.cloud.ces.v1 + * @interface ISynthesizeSpeechConfig + * @property {string|null} [voice] SynthesizeSpeechConfig voice + * @property {number|null} [speakingRate] SynthesizeSpeechConfig speakingRate + */ + + /** + * Constructs a new SynthesizeSpeechConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a SynthesizeSpeechConfig. + * @implements ISynthesizeSpeechConfig + * @constructor + * @param {google.cloud.ces.v1.ISynthesizeSpeechConfig=} [properties] Properties to set + */ + function SynthesizeSpeechConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SynthesizeSpeechConfig voice. + * @member {string} voice + * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.voice = ""; + + /** + * SynthesizeSpeechConfig speakingRate. + * @member {number} speakingRate + * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.speakingRate = 0; + + /** + * Creates a new SynthesizeSpeechConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig + * @static + * @param {google.cloud.ces.v1.ISynthesizeSpeechConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.SynthesizeSpeechConfig} SynthesizeSpeechConfig instance + */ + SynthesizeSpeechConfig.create = function create(properties) { + return new SynthesizeSpeechConfig(properties); + }; + + /** + * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.ces.v1.SynthesizeSpeechConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig + * @static + * @param {google.cloud.ces.v1.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SynthesizeSpeechConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voice != null && Object.hasOwnProperty.call(message, "voice")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.voice); + if (message.speakingRate != null && Object.hasOwnProperty.call(message, "speakingRate")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.speakingRate); + return writer; + }; + + /** + * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SynthesizeSpeechConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig + * @static + * @param {google.cloud.ces.v1.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SynthesizeSpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SynthesizeSpeechConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.SynthesizeSpeechConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.voice = reader.string(); + break; + } + case 2: { + message.speakingRate = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SynthesizeSpeechConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SynthesizeSpeechConfig message. + * @function verify + * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SynthesizeSpeechConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.voice != null && message.hasOwnProperty("voice")) + if (!$util.isString(message.voice)) + return "voice: string expected"; + if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) + if (typeof message.speakingRate !== "number") + return "speakingRate: number expected"; + return null; + }; + + /** + * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.SynthesizeSpeechConfig} SynthesizeSpeechConfig + */ + SynthesizeSpeechConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.SynthesizeSpeechConfig) + return object; + var message = new $root.google.cloud.ces.v1.SynthesizeSpeechConfig(); + if (object.voice != null) + message.voice = String(object.voice); + if (object.speakingRate != null) + message.speakingRate = Number(object.speakingRate); + return message; + }; + + /** + * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig + * @static + * @param {google.cloud.ces.v1.SynthesizeSpeechConfig} message SynthesizeSpeechConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SynthesizeSpeechConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.voice = ""; + object.speakingRate = 0; + } + if (message.voice != null && message.hasOwnProperty("voice")) + object.voice = message.voice; + if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) + object.speakingRate = options.json && !isFinite(message.speakingRate) ? String(message.speakingRate) : message.speakingRate; + return object; + }; + + /** + * Converts this SynthesizeSpeechConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig + * @instance + * @returns {Object.} JSON object + */ + SynthesizeSpeechConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SynthesizeSpeechConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SynthesizeSpeechConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.SynthesizeSpeechConfig"; + }; + + return SynthesizeSpeechConfig; + })(); + + v1.MetricAnalysisSettings = (function() { + + /** + * Properties of a MetricAnalysisSettings. + * @memberof google.cloud.ces.v1 + * @interface IMetricAnalysisSettings + * @property {boolean|null} [llmMetricsOptedOut] MetricAnalysisSettings llmMetricsOptedOut + */ + + /** + * Constructs a new MetricAnalysisSettings. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a MetricAnalysisSettings. + * @implements IMetricAnalysisSettings + * @constructor + * @param {google.cloud.ces.v1.IMetricAnalysisSettings=} [properties] Properties to set + */ + function MetricAnalysisSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricAnalysisSettings llmMetricsOptedOut. + * @member {boolean} llmMetricsOptedOut + * @memberof google.cloud.ces.v1.MetricAnalysisSettings + * @instance + */ + MetricAnalysisSettings.prototype.llmMetricsOptedOut = false; + + /** + * Creates a new MetricAnalysisSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.MetricAnalysisSettings + * @static + * @param {google.cloud.ces.v1.IMetricAnalysisSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1.MetricAnalysisSettings} MetricAnalysisSettings instance + */ + MetricAnalysisSettings.create = function create(properties) { + return new MetricAnalysisSettings(properties); + }; + + /** + * Encodes the specified MetricAnalysisSettings message. Does not implicitly {@link google.cloud.ces.v1.MetricAnalysisSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.MetricAnalysisSettings + * @static + * @param {google.cloud.ces.v1.IMetricAnalysisSettings} message MetricAnalysisSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricAnalysisSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.llmMetricsOptedOut != null && Object.hasOwnProperty.call(message, "llmMetricsOptedOut")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.llmMetricsOptedOut); + return writer; + }; + + /** + * Encodes the specified MetricAnalysisSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.MetricAnalysisSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.MetricAnalysisSettings + * @static + * @param {google.cloud.ces.v1.IMetricAnalysisSettings} message MetricAnalysisSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricAnalysisSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricAnalysisSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.MetricAnalysisSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.MetricAnalysisSettings} MetricAnalysisSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricAnalysisSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.MetricAnalysisSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.llmMetricsOptedOut = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricAnalysisSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.MetricAnalysisSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.MetricAnalysisSettings} MetricAnalysisSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricAnalysisSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricAnalysisSettings message. + * @function verify + * @memberof google.cloud.ces.v1.MetricAnalysisSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricAnalysisSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.llmMetricsOptedOut != null && message.hasOwnProperty("llmMetricsOptedOut")) + if (typeof message.llmMetricsOptedOut !== "boolean") + return "llmMetricsOptedOut: boolean expected"; + return null; + }; + + /** + * Creates a MetricAnalysisSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.MetricAnalysisSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.MetricAnalysisSettings} MetricAnalysisSettings + */ + MetricAnalysisSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.MetricAnalysisSettings) + return object; + var message = new $root.google.cloud.ces.v1.MetricAnalysisSettings(); + if (object.llmMetricsOptedOut != null) + message.llmMetricsOptedOut = Boolean(object.llmMetricsOptedOut); + return message; + }; + + /** + * Creates a plain object from a MetricAnalysisSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.MetricAnalysisSettings + * @static + * @param {google.cloud.ces.v1.MetricAnalysisSettings} message MetricAnalysisSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricAnalysisSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.llmMetricsOptedOut = false; + if (message.llmMetricsOptedOut != null && message.hasOwnProperty("llmMetricsOptedOut")) + object.llmMetricsOptedOut = message.llmMetricsOptedOut; + return object; + }; + + /** + * Converts this MetricAnalysisSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.MetricAnalysisSettings + * @instance + * @returns {Object.} JSON object + */ + MetricAnalysisSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricAnalysisSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1.MetricAnalysisSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricAnalysisSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.MetricAnalysisSettings"; + }; + + return MetricAnalysisSettings; + })(); + + v1.LoggingSettings = (function() { + + /** + * Properties of a LoggingSettings. + * @memberof google.cloud.ces.v1 + * @interface ILoggingSettings + * @property {google.cloud.ces.v1.IRedactionConfig|null} [redactionConfig] LoggingSettings redactionConfig + * @property {google.cloud.ces.v1.IAudioRecordingConfig|null} [audioRecordingConfig] LoggingSettings audioRecordingConfig + * @property {google.cloud.ces.v1.IBigQueryExportSettings|null} [bigqueryExportSettings] LoggingSettings bigqueryExportSettings + * @property {google.cloud.ces.v1.ICloudLoggingSettings|null} [cloudLoggingSettings] LoggingSettings cloudLoggingSettings + * @property {google.cloud.ces.v1.IConversationLoggingSettings|null} [conversationLoggingSettings] LoggingSettings conversationLoggingSettings + * @property {google.cloud.ces.v1.IAudioRecordingConfig|null} [evaluationAudioRecordingConfig] LoggingSettings evaluationAudioRecordingConfig + * @property {google.cloud.ces.v1.IMetricAnalysisSettings|null} [metricAnalysisSettings] LoggingSettings metricAnalysisSettings + */ + + /** + * Constructs a new LoggingSettings. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a LoggingSettings. + * @implements ILoggingSettings + * @constructor + * @param {google.cloud.ces.v1.ILoggingSettings=} [properties] Properties to set + */ + function LoggingSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LoggingSettings redactionConfig. + * @member {google.cloud.ces.v1.IRedactionConfig|null|undefined} redactionConfig + * @memberof google.cloud.ces.v1.LoggingSettings + * @instance + */ + LoggingSettings.prototype.redactionConfig = null; + + /** + * LoggingSettings audioRecordingConfig. + * @member {google.cloud.ces.v1.IAudioRecordingConfig|null|undefined} audioRecordingConfig + * @memberof google.cloud.ces.v1.LoggingSettings + * @instance + */ + LoggingSettings.prototype.audioRecordingConfig = null; + + /** + * LoggingSettings bigqueryExportSettings. + * @member {google.cloud.ces.v1.IBigQueryExportSettings|null|undefined} bigqueryExportSettings + * @memberof google.cloud.ces.v1.LoggingSettings + * @instance + */ + LoggingSettings.prototype.bigqueryExportSettings = null; + + /** + * LoggingSettings cloudLoggingSettings. + * @member {google.cloud.ces.v1.ICloudLoggingSettings|null|undefined} cloudLoggingSettings + * @memberof google.cloud.ces.v1.LoggingSettings + * @instance + */ + LoggingSettings.prototype.cloudLoggingSettings = null; + + /** + * LoggingSettings conversationLoggingSettings. + * @member {google.cloud.ces.v1.IConversationLoggingSettings|null|undefined} conversationLoggingSettings + * @memberof google.cloud.ces.v1.LoggingSettings + * @instance + */ + LoggingSettings.prototype.conversationLoggingSettings = null; + + /** + * LoggingSettings evaluationAudioRecordingConfig. + * @member {google.cloud.ces.v1.IAudioRecordingConfig|null|undefined} evaluationAudioRecordingConfig + * @memberof google.cloud.ces.v1.LoggingSettings + * @instance + */ + LoggingSettings.prototype.evaluationAudioRecordingConfig = null; + + /** + * LoggingSettings metricAnalysisSettings. + * @member {google.cloud.ces.v1.IMetricAnalysisSettings|null|undefined} metricAnalysisSettings + * @memberof google.cloud.ces.v1.LoggingSettings + * @instance + */ + LoggingSettings.prototype.metricAnalysisSettings = null; + + /** + * Creates a new LoggingSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.LoggingSettings + * @static + * @param {google.cloud.ces.v1.ILoggingSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1.LoggingSettings} LoggingSettings instance + */ + LoggingSettings.create = function create(properties) { + return new LoggingSettings(properties); + }; + + /** + * Encodes the specified LoggingSettings message. Does not implicitly {@link google.cloud.ces.v1.LoggingSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.LoggingSettings + * @static + * @param {google.cloud.ces.v1.ILoggingSettings} message LoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.redactionConfig != null && Object.hasOwnProperty.call(message, "redactionConfig")) + $root.google.cloud.ces.v1.RedactionConfig.encode(message.redactionConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audioRecordingConfig != null && Object.hasOwnProperty.call(message, "audioRecordingConfig")) + $root.google.cloud.ces.v1.AudioRecordingConfig.encode(message.audioRecordingConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bigqueryExportSettings != null && Object.hasOwnProperty.call(message, "bigqueryExportSettings")) + $root.google.cloud.ces.v1.BigQueryExportSettings.encode(message.bigqueryExportSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cloudLoggingSettings != null && Object.hasOwnProperty.call(message, "cloudLoggingSettings")) + $root.google.cloud.ces.v1.CloudLoggingSettings.encode(message.cloudLoggingSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.conversationLoggingSettings != null && Object.hasOwnProperty.call(message, "conversationLoggingSettings")) + $root.google.cloud.ces.v1.ConversationLoggingSettings.encode(message.conversationLoggingSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.evaluationAudioRecordingConfig != null && Object.hasOwnProperty.call(message, "evaluationAudioRecordingConfig")) + $root.google.cloud.ces.v1.AudioRecordingConfig.encode(message.evaluationAudioRecordingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.metricAnalysisSettings != null && Object.hasOwnProperty.call(message, "metricAnalysisSettings")) + $root.google.cloud.ces.v1.MetricAnalysisSettings.encode(message.metricAnalysisSettings, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.LoggingSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.LoggingSettings + * @static + * @param {google.cloud.ces.v1.ILoggingSettings} message LoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.LoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.LoggingSettings} LoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.LoggingSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.redactionConfig = $root.google.cloud.ces.v1.RedactionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.audioRecordingConfig = $root.google.cloud.ces.v1.AudioRecordingConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.bigqueryExportSettings = $root.google.cloud.ces.v1.BigQueryExportSettings.decode(reader, reader.uint32()); + break; + } + case 4: { + message.cloudLoggingSettings = $root.google.cloud.ces.v1.CloudLoggingSettings.decode(reader, reader.uint32()); + break; + } + case 5: { + message.conversationLoggingSettings = $root.google.cloud.ces.v1.ConversationLoggingSettings.decode(reader, reader.uint32()); + break; + } + case 6: { + message.evaluationAudioRecordingConfig = $root.google.cloud.ces.v1.AudioRecordingConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.metricAnalysisSettings = $root.google.cloud.ces.v1.MetricAnalysisSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.LoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.LoggingSettings} LoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoggingSettings message. + * @function verify + * @memberof google.cloud.ces.v1.LoggingSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoggingSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.redactionConfig != null && message.hasOwnProperty("redactionConfig")) { + var error = $root.google.cloud.ces.v1.RedactionConfig.verify(message.redactionConfig); + if (error) + return "redactionConfig." + error; + } + if (message.audioRecordingConfig != null && message.hasOwnProperty("audioRecordingConfig")) { + var error = $root.google.cloud.ces.v1.AudioRecordingConfig.verify(message.audioRecordingConfig); + if (error) + return "audioRecordingConfig." + error; + } + if (message.bigqueryExportSettings != null && message.hasOwnProperty("bigqueryExportSettings")) { + var error = $root.google.cloud.ces.v1.BigQueryExportSettings.verify(message.bigqueryExportSettings); + if (error) + return "bigqueryExportSettings." + error; + } + if (message.cloudLoggingSettings != null && message.hasOwnProperty("cloudLoggingSettings")) { + var error = $root.google.cloud.ces.v1.CloudLoggingSettings.verify(message.cloudLoggingSettings); + if (error) + return "cloudLoggingSettings." + error; + } + if (message.conversationLoggingSettings != null && message.hasOwnProperty("conversationLoggingSettings")) { + var error = $root.google.cloud.ces.v1.ConversationLoggingSettings.verify(message.conversationLoggingSettings); + if (error) + return "conversationLoggingSettings." + error; + } + if (message.evaluationAudioRecordingConfig != null && message.hasOwnProperty("evaluationAudioRecordingConfig")) { + var error = $root.google.cloud.ces.v1.AudioRecordingConfig.verify(message.evaluationAudioRecordingConfig); + if (error) + return "evaluationAudioRecordingConfig." + error; + } + if (message.metricAnalysisSettings != null && message.hasOwnProperty("metricAnalysisSettings")) { + var error = $root.google.cloud.ces.v1.MetricAnalysisSettings.verify(message.metricAnalysisSettings); + if (error) + return "metricAnalysisSettings." + error; + } + return null; + }; + + /** + * Creates a LoggingSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.LoggingSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.LoggingSettings} LoggingSettings + */ + LoggingSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.LoggingSettings) + return object; + var message = new $root.google.cloud.ces.v1.LoggingSettings(); + if (object.redactionConfig != null) { + if (typeof object.redactionConfig !== "object") + throw TypeError(".google.cloud.ces.v1.LoggingSettings.redactionConfig: object expected"); + message.redactionConfig = $root.google.cloud.ces.v1.RedactionConfig.fromObject(object.redactionConfig); + } + if (object.audioRecordingConfig != null) { + if (typeof object.audioRecordingConfig !== "object") + throw TypeError(".google.cloud.ces.v1.LoggingSettings.audioRecordingConfig: object expected"); + message.audioRecordingConfig = $root.google.cloud.ces.v1.AudioRecordingConfig.fromObject(object.audioRecordingConfig); + } + if (object.bigqueryExportSettings != null) { + if (typeof object.bigqueryExportSettings !== "object") + throw TypeError(".google.cloud.ces.v1.LoggingSettings.bigqueryExportSettings: object expected"); + message.bigqueryExportSettings = $root.google.cloud.ces.v1.BigQueryExportSettings.fromObject(object.bigqueryExportSettings); + } + if (object.cloudLoggingSettings != null) { + if (typeof object.cloudLoggingSettings !== "object") + throw TypeError(".google.cloud.ces.v1.LoggingSettings.cloudLoggingSettings: object expected"); + message.cloudLoggingSettings = $root.google.cloud.ces.v1.CloudLoggingSettings.fromObject(object.cloudLoggingSettings); + } + if (object.conversationLoggingSettings != null) { + if (typeof object.conversationLoggingSettings !== "object") + throw TypeError(".google.cloud.ces.v1.LoggingSettings.conversationLoggingSettings: object expected"); + message.conversationLoggingSettings = $root.google.cloud.ces.v1.ConversationLoggingSettings.fromObject(object.conversationLoggingSettings); + } + if (object.evaluationAudioRecordingConfig != null) { + if (typeof object.evaluationAudioRecordingConfig !== "object") + throw TypeError(".google.cloud.ces.v1.LoggingSettings.evaluationAudioRecordingConfig: object expected"); + message.evaluationAudioRecordingConfig = $root.google.cloud.ces.v1.AudioRecordingConfig.fromObject(object.evaluationAudioRecordingConfig); + } + if (object.metricAnalysisSettings != null) { + if (typeof object.metricAnalysisSettings !== "object") + throw TypeError(".google.cloud.ces.v1.LoggingSettings.metricAnalysisSettings: object expected"); + message.metricAnalysisSettings = $root.google.cloud.ces.v1.MetricAnalysisSettings.fromObject(object.metricAnalysisSettings); + } + return message; + }; + + /** + * Creates a plain object from a LoggingSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.LoggingSettings + * @static + * @param {google.cloud.ces.v1.LoggingSettings} message LoggingSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoggingSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.redactionConfig = null; + object.audioRecordingConfig = null; + object.bigqueryExportSettings = null; + object.cloudLoggingSettings = null; + object.conversationLoggingSettings = null; + object.evaluationAudioRecordingConfig = null; + object.metricAnalysisSettings = null; + } + if (message.redactionConfig != null && message.hasOwnProperty("redactionConfig")) + object.redactionConfig = $root.google.cloud.ces.v1.RedactionConfig.toObject(message.redactionConfig, options); + if (message.audioRecordingConfig != null && message.hasOwnProperty("audioRecordingConfig")) + object.audioRecordingConfig = $root.google.cloud.ces.v1.AudioRecordingConfig.toObject(message.audioRecordingConfig, options); + if (message.bigqueryExportSettings != null && message.hasOwnProperty("bigqueryExportSettings")) + object.bigqueryExportSettings = $root.google.cloud.ces.v1.BigQueryExportSettings.toObject(message.bigqueryExportSettings, options); + if (message.cloudLoggingSettings != null && message.hasOwnProperty("cloudLoggingSettings")) + object.cloudLoggingSettings = $root.google.cloud.ces.v1.CloudLoggingSettings.toObject(message.cloudLoggingSettings, options); + if (message.conversationLoggingSettings != null && message.hasOwnProperty("conversationLoggingSettings")) + object.conversationLoggingSettings = $root.google.cloud.ces.v1.ConversationLoggingSettings.toObject(message.conversationLoggingSettings, options); + if (message.evaluationAudioRecordingConfig != null && message.hasOwnProperty("evaluationAudioRecordingConfig")) + object.evaluationAudioRecordingConfig = $root.google.cloud.ces.v1.AudioRecordingConfig.toObject(message.evaluationAudioRecordingConfig, options); + if (message.metricAnalysisSettings != null && message.hasOwnProperty("metricAnalysisSettings")) + object.metricAnalysisSettings = $root.google.cloud.ces.v1.MetricAnalysisSettings.toObject(message.metricAnalysisSettings, options); + return object; + }; + + /** + * Converts this LoggingSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.LoggingSettings + * @instance + * @returns {Object.} JSON object + */ + LoggingSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoggingSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1.LoggingSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoggingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.LoggingSettings"; + }; + + return LoggingSettings; + })(); + + v1.EvaluationMetricsThresholds = (function() { + + /** + * Properties of an EvaluationMetricsThresholds. + * @memberof google.cloud.ces.v1 + * @interface IEvaluationMetricsThresholds + * @property {google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null} [goldenEvaluationMetricsThresholds] EvaluationMetricsThresholds goldenEvaluationMetricsThresholds + * @property {google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|null} [hallucinationMetricBehavior] EvaluationMetricsThresholds hallucinationMetricBehavior + * @property {google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|null} [goldenHallucinationMetricBehavior] EvaluationMetricsThresholds goldenHallucinationMetricBehavior + * @property {google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|null} [scenarioHallucinationMetricBehavior] EvaluationMetricsThresholds scenarioHallucinationMetricBehavior + */ + + /** + * Constructs a new EvaluationMetricsThresholds. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an EvaluationMetricsThresholds. + * @implements IEvaluationMetricsThresholds + * @constructor + * @param {google.cloud.ces.v1.IEvaluationMetricsThresholds=} [properties] Properties to set + */ + function EvaluationMetricsThresholds(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationMetricsThresholds goldenEvaluationMetricsThresholds. + * @member {google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null|undefined} goldenEvaluationMetricsThresholds + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds + * @instance + */ + EvaluationMetricsThresholds.prototype.goldenEvaluationMetricsThresholds = null; + + /** + * EvaluationMetricsThresholds hallucinationMetricBehavior. + * @member {google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior} hallucinationMetricBehavior + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds + * @instance + */ + EvaluationMetricsThresholds.prototype.hallucinationMetricBehavior = 0; + + /** + * EvaluationMetricsThresholds goldenHallucinationMetricBehavior. + * @member {google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior} goldenHallucinationMetricBehavior + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds + * @instance + */ + EvaluationMetricsThresholds.prototype.goldenHallucinationMetricBehavior = 0; + + /** + * EvaluationMetricsThresholds scenarioHallucinationMetricBehavior. + * @member {google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior} scenarioHallucinationMetricBehavior + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds + * @instance + */ + EvaluationMetricsThresholds.prototype.scenarioHallucinationMetricBehavior = 0; + + /** + * Creates a new EvaluationMetricsThresholds instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1.IEvaluationMetricsThresholds=} [properties] Properties to set + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds} EvaluationMetricsThresholds instance + */ + EvaluationMetricsThresholds.create = function create(properties) { + return new EvaluationMetricsThresholds(properties); + }; + + /** + * Encodes the specified EvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1.IEvaluationMetricsThresholds} message EvaluationMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationMetricsThresholds.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.goldenEvaluationMetricsThresholds != null && Object.hasOwnProperty.call(message, "goldenEvaluationMetricsThresholds")) + $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.encode(message.goldenEvaluationMetricsThresholds, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.hallucinationMetricBehavior != null && Object.hasOwnProperty.call(message, "hallucinationMetricBehavior")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.hallucinationMetricBehavior); + if (message.scenarioHallucinationMetricBehavior != null && Object.hasOwnProperty.call(message, "scenarioHallucinationMetricBehavior")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.scenarioHallucinationMetricBehavior); + if (message.goldenHallucinationMetricBehavior != null && Object.hasOwnProperty.call(message, "goldenHallucinationMetricBehavior")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.goldenHallucinationMetricBehavior); + return writer; + }; + + /** + * Encodes the specified EvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1.IEvaluationMetricsThresholds} message EvaluationMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds} EvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationMetricsThresholds.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.goldenEvaluationMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.decode(reader, reader.uint32()); + break; + } + case 3: { + message.hallucinationMetricBehavior = reader.int32(); + break; + } + case 5: { + message.goldenHallucinationMetricBehavior = reader.int32(); + break; + } + case 4: { + message.scenarioHallucinationMetricBehavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds} EvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationMetricsThresholds message. + * @function verify + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationMetricsThresholds.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.goldenEvaluationMetricsThresholds != null && message.hasOwnProperty("goldenEvaluationMetricsThresholds")) { + var error = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify(message.goldenEvaluationMetricsThresholds); + if (error) + return "goldenEvaluationMetricsThresholds." + error; + } + if (message.hallucinationMetricBehavior != null && message.hasOwnProperty("hallucinationMetricBehavior")) + switch (message.hallucinationMetricBehavior) { + default: + return "hallucinationMetricBehavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.goldenHallucinationMetricBehavior != null && message.hasOwnProperty("goldenHallucinationMetricBehavior")) + switch (message.goldenHallucinationMetricBehavior) { + default: + return "goldenHallucinationMetricBehavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.scenarioHallucinationMetricBehavior != null && message.hasOwnProperty("scenarioHallucinationMetricBehavior")) + switch (message.scenarioHallucinationMetricBehavior) { + default: + return "scenarioHallucinationMetricBehavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an EvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds} EvaluationMetricsThresholds + */ + EvaluationMetricsThresholds.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.EvaluationMetricsThresholds) + return object; + var message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds(); + if (object.goldenEvaluationMetricsThresholds != null) { + if (typeof object.goldenEvaluationMetricsThresholds !== "object") + throw TypeError(".google.cloud.ces.v1.EvaluationMetricsThresholds.goldenEvaluationMetricsThresholds: object expected"); + message.goldenEvaluationMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.fromObject(object.goldenEvaluationMetricsThresholds); + } + switch (object.hallucinationMetricBehavior) { + default: + if (typeof object.hallucinationMetricBehavior === "number") { + message.hallucinationMetricBehavior = object.hallucinationMetricBehavior; + break; + } + break; + case "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": + case 0: + message.hallucinationMetricBehavior = 0; + break; + case "DISABLED": + case 1: + message.hallucinationMetricBehavior = 1; + break; + case "ENABLED": + case 2: + message.hallucinationMetricBehavior = 2; + break; + } + switch (object.goldenHallucinationMetricBehavior) { + default: + if (typeof object.goldenHallucinationMetricBehavior === "number") { + message.goldenHallucinationMetricBehavior = object.goldenHallucinationMetricBehavior; + break; + } + break; + case "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": + case 0: + message.goldenHallucinationMetricBehavior = 0; + break; + case "DISABLED": + case 1: + message.goldenHallucinationMetricBehavior = 1; + break; + case "ENABLED": + case 2: + message.goldenHallucinationMetricBehavior = 2; + break; + } + switch (object.scenarioHallucinationMetricBehavior) { + default: + if (typeof object.scenarioHallucinationMetricBehavior === "number") { + message.scenarioHallucinationMetricBehavior = object.scenarioHallucinationMetricBehavior; + break; + } + break; + case "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": + case 0: + message.scenarioHallucinationMetricBehavior = 0; + break; + case "DISABLED": + case 1: + message.scenarioHallucinationMetricBehavior = 1; + break; + case "ENABLED": + case 2: + message.scenarioHallucinationMetricBehavior = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an EvaluationMetricsThresholds message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds} message EvaluationMetricsThresholds + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationMetricsThresholds.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.goldenEvaluationMetricsThresholds = null; + object.hallucinationMetricBehavior = options.enums === String ? "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" : 0; + object.scenarioHallucinationMetricBehavior = options.enums === String ? "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" : 0; + object.goldenHallucinationMetricBehavior = options.enums === String ? "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" : 0; + } + if (message.goldenEvaluationMetricsThresholds != null && message.hasOwnProperty("goldenEvaluationMetricsThresholds")) + object.goldenEvaluationMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.toObject(message.goldenEvaluationMetricsThresholds, options); + if (message.hallucinationMetricBehavior != null && message.hasOwnProperty("hallucinationMetricBehavior")) + object.hallucinationMetricBehavior = options.enums === String ? $root.google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.hallucinationMetricBehavior] === undefined ? message.hallucinationMetricBehavior : $root.google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.hallucinationMetricBehavior] : message.hallucinationMetricBehavior; + if (message.scenarioHallucinationMetricBehavior != null && message.hasOwnProperty("scenarioHallucinationMetricBehavior")) + object.scenarioHallucinationMetricBehavior = options.enums === String ? $root.google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.scenarioHallucinationMetricBehavior] === undefined ? message.scenarioHallucinationMetricBehavior : $root.google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.scenarioHallucinationMetricBehavior] : message.scenarioHallucinationMetricBehavior; + if (message.goldenHallucinationMetricBehavior != null && message.hasOwnProperty("goldenHallucinationMetricBehavior")) + object.goldenHallucinationMetricBehavior = options.enums === String ? $root.google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.goldenHallucinationMetricBehavior] === undefined ? message.goldenHallucinationMetricBehavior : $root.google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.goldenHallucinationMetricBehavior] : message.goldenHallucinationMetricBehavior; + return object; + }; + + /** + * Converts this EvaluationMetricsThresholds to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds + * @instance + * @returns {Object.} JSON object + */ + EvaluationMetricsThresholds.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationMetricsThresholds + * @function getTypeUrl + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.EvaluationMetricsThresholds"; + }; + + EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds = (function() { + + /** + * Properties of a GoldenEvaluationMetricsThresholds. + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds + * @interface IGoldenEvaluationMetricsThresholds + * @property {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null} [turnLevelMetricsThresholds] GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds + * @property {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null} [expectationLevelMetricsThresholds] GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds + * @property {google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings|null} [toolMatchingSettings] GoldenEvaluationMetricsThresholds toolMatchingSettings + */ + + /** + * Constructs a new GoldenEvaluationMetricsThresholds. + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds + * @classdesc Represents a GoldenEvaluationMetricsThresholds. + * @implements IGoldenEvaluationMetricsThresholds + * @constructor + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds=} [properties] Properties to set + */ + function GoldenEvaluationMetricsThresholds(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds. + * @member {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null|undefined} turnLevelMetricsThresholds + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @instance + */ + GoldenEvaluationMetricsThresholds.prototype.turnLevelMetricsThresholds = null; + + /** + * GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds. + * @member {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null|undefined} expectationLevelMetricsThresholds + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @instance + */ + GoldenEvaluationMetricsThresholds.prototype.expectationLevelMetricsThresholds = null; + + /** + * GoldenEvaluationMetricsThresholds toolMatchingSettings. + * @member {google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings|null|undefined} toolMatchingSettings + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @instance + */ + GoldenEvaluationMetricsThresholds.prototype.toolMatchingSettings = null; + + /** + * Creates a new GoldenEvaluationMetricsThresholds instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds=} [properties] Properties to set + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds instance + */ + GoldenEvaluationMetricsThresholds.create = function create(properties) { + return new GoldenEvaluationMetricsThresholds(properties); + }; + + /** + * Encodes the specified GoldenEvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds} message GoldenEvaluationMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenEvaluationMetricsThresholds.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.turnLevelMetricsThresholds != null && Object.hasOwnProperty.call(message, "turnLevelMetricsThresholds")) + $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.encode(message.turnLevelMetricsThresholds, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.expectationLevelMetricsThresholds != null && Object.hasOwnProperty.call(message, "expectationLevelMetricsThresholds")) + $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.encode(message.expectationLevelMetricsThresholds, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolMatchingSettings != null && Object.hasOwnProperty.call(message, "toolMatchingSettings")) + $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.encode(message.toolMatchingSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoldenEvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds} message GoldenEvaluationMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenEvaluationMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenEvaluationMetricsThresholds.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.turnLevelMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.decode(reader, reader.uint32()); + break; + } + case 2: { + message.expectationLevelMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.decode(reader, reader.uint32()); + break; + } + case 3: { + message.toolMatchingSettings = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenEvaluationMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoldenEvaluationMetricsThresholds message. + * @function verify + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoldenEvaluationMetricsThresholds.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.turnLevelMetricsThresholds != null && message.hasOwnProperty("turnLevelMetricsThresholds")) { + var error = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify(message.turnLevelMetricsThresholds); + if (error) + return "turnLevelMetricsThresholds." + error; + } + if (message.expectationLevelMetricsThresholds != null && message.hasOwnProperty("expectationLevelMetricsThresholds")) { + var error = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify(message.expectationLevelMetricsThresholds); + if (error) + return "expectationLevelMetricsThresholds." + error; + } + if (message.toolMatchingSettings != null && message.hasOwnProperty("toolMatchingSettings")) { + var error = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.verify(message.toolMatchingSettings); + if (error) + return "toolMatchingSettings." + error; + } + return null; + }; + + /** + * Creates a GoldenEvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds + */ + GoldenEvaluationMetricsThresholds.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds) + return object; + var message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds(); + if (object.turnLevelMetricsThresholds != null) { + if (typeof object.turnLevelMetricsThresholds !== "object") + throw TypeError(".google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.turnLevelMetricsThresholds: object expected"); + message.turnLevelMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.fromObject(object.turnLevelMetricsThresholds); + } + if (object.expectationLevelMetricsThresholds != null) { + if (typeof object.expectationLevelMetricsThresholds !== "object") + throw TypeError(".google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.expectationLevelMetricsThresholds: object expected"); + message.expectationLevelMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.fromObject(object.expectationLevelMetricsThresholds); + } + if (object.toolMatchingSettings != null) { + if (typeof object.toolMatchingSettings !== "object") + throw TypeError(".google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.toolMatchingSettings: object expected"); + message.toolMatchingSettings = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.fromObject(object.toolMatchingSettings); + } + return message; + }; + + /** + * Creates a plain object from a GoldenEvaluationMetricsThresholds message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} message GoldenEvaluationMetricsThresholds + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoldenEvaluationMetricsThresholds.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.turnLevelMetricsThresholds = null; + object.expectationLevelMetricsThresholds = null; + object.toolMatchingSettings = null; + } + if (message.turnLevelMetricsThresholds != null && message.hasOwnProperty("turnLevelMetricsThresholds")) + object.turnLevelMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.toObject(message.turnLevelMetricsThresholds, options); + if (message.expectationLevelMetricsThresholds != null && message.hasOwnProperty("expectationLevelMetricsThresholds")) + object.expectationLevelMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.toObject(message.expectationLevelMetricsThresholds, options); + if (message.toolMatchingSettings != null && message.hasOwnProperty("toolMatchingSettings")) + object.toolMatchingSettings = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.toObject(message.toolMatchingSettings, options); + return object; + }; + + /** + * Converts this GoldenEvaluationMetricsThresholds to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @instance + * @returns {Object.} JSON object + */ + GoldenEvaluationMetricsThresholds.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoldenEvaluationMetricsThresholds + * @function getTypeUrl + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoldenEvaluationMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds"; + }; + + GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds = (function() { + + /** + * Properties of a TurnLevelMetricsThresholds. + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @interface ITurnLevelMetricsThresholds + * @property {number|null} [semanticSimilaritySuccessThreshold] TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold + * @property {number|null} [overallToolInvocationCorrectnessThreshold] TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold + * @property {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|null} [semanticSimilarityChannel] TurnLevelMetricsThresholds semanticSimilarityChannel + */ + + /** + * Constructs a new TurnLevelMetricsThresholds. + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @classdesc Represents a TurnLevelMetricsThresholds. + * @implements ITurnLevelMetricsThresholds + * @constructor + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds=} [properties] Properties to set + */ + function TurnLevelMetricsThresholds(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold. + * @member {number|null|undefined} semanticSimilaritySuccessThreshold + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @instance + */ + TurnLevelMetricsThresholds.prototype.semanticSimilaritySuccessThreshold = null; + + /** + * TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold. + * @member {number|null|undefined} overallToolInvocationCorrectnessThreshold + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @instance + */ + TurnLevelMetricsThresholds.prototype.overallToolInvocationCorrectnessThreshold = null; + + /** + * TurnLevelMetricsThresholds semanticSimilarityChannel. + * @member {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel} semanticSimilarityChannel + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @instance + */ + TurnLevelMetricsThresholds.prototype.semanticSimilarityChannel = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TurnLevelMetricsThresholds.prototype, "_semanticSimilaritySuccessThreshold", { + get: $util.oneOfGetter($oneOfFields = ["semanticSimilaritySuccessThreshold"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TurnLevelMetricsThresholds.prototype, "_overallToolInvocationCorrectnessThreshold", { + get: $util.oneOfGetter($oneOfFields = ["overallToolInvocationCorrectnessThreshold"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TurnLevelMetricsThresholds instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds=} [properties] Properties to set + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds instance + */ + TurnLevelMetricsThresholds.create = function create(properties) { + return new TurnLevelMetricsThresholds(properties); + }; + + /** + * Encodes the specified TurnLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds} message TurnLevelMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TurnLevelMetricsThresholds.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.semanticSimilaritySuccessThreshold != null && Object.hasOwnProperty.call(message, "semanticSimilaritySuccessThreshold")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.semanticSimilaritySuccessThreshold); + if (message.overallToolInvocationCorrectnessThreshold != null && Object.hasOwnProperty.call(message, "overallToolInvocationCorrectnessThreshold")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.overallToolInvocationCorrectnessThreshold); + if (message.semanticSimilarityChannel != null && Object.hasOwnProperty.call(message, "semanticSimilarityChannel")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.semanticSimilarityChannel); + return writer; + }; + + /** + * Encodes the specified TurnLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds} message TurnLevelMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TurnLevelMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TurnLevelMetricsThresholds.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.semanticSimilaritySuccessThreshold = reader.int32(); + break; + } + case 2: { + message.overallToolInvocationCorrectnessThreshold = reader.float(); + break; + } + case 3: { + message.semanticSimilarityChannel = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TurnLevelMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TurnLevelMetricsThresholds message. + * @function verify + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TurnLevelMetricsThresholds.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.semanticSimilaritySuccessThreshold != null && message.hasOwnProperty("semanticSimilaritySuccessThreshold")) { + properties._semanticSimilaritySuccessThreshold = 1; + if (!$util.isInteger(message.semanticSimilaritySuccessThreshold)) + return "semanticSimilaritySuccessThreshold: integer expected"; + } + if (message.overallToolInvocationCorrectnessThreshold != null && message.hasOwnProperty("overallToolInvocationCorrectnessThreshold")) { + properties._overallToolInvocationCorrectnessThreshold = 1; + if (typeof message.overallToolInvocationCorrectnessThreshold !== "number") + return "overallToolInvocationCorrectnessThreshold: number expected"; + } + if (message.semanticSimilarityChannel != null && message.hasOwnProperty("semanticSimilarityChannel")) + switch (message.semanticSimilarityChannel) { + default: + return "semanticSimilarityChannel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TurnLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds + */ + TurnLevelMetricsThresholds.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds) + return object; + var message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds(); + if (object.semanticSimilaritySuccessThreshold != null) + message.semanticSimilaritySuccessThreshold = object.semanticSimilaritySuccessThreshold | 0; + if (object.overallToolInvocationCorrectnessThreshold != null) + message.overallToolInvocationCorrectnessThreshold = Number(object.overallToolInvocationCorrectnessThreshold); + switch (object.semanticSimilarityChannel) { + default: + if (typeof object.semanticSimilarityChannel === "number") { + message.semanticSimilarityChannel = object.semanticSimilarityChannel; + break; + } + break; + case "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED": + case 0: + message.semanticSimilarityChannel = 0; + break; + case "TEXT": + case 1: + message.semanticSimilarityChannel = 1; + break; + case "AUDIO": + case 2: + message.semanticSimilarityChannel = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TurnLevelMetricsThresholds message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} message TurnLevelMetricsThresholds + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TurnLevelMetricsThresholds.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.semanticSimilarityChannel = options.enums === String ? "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED" : 0; + if (message.semanticSimilaritySuccessThreshold != null && message.hasOwnProperty("semanticSimilaritySuccessThreshold")) { + object.semanticSimilaritySuccessThreshold = message.semanticSimilaritySuccessThreshold; + if (options.oneofs) + object._semanticSimilaritySuccessThreshold = "semanticSimilaritySuccessThreshold"; + } + if (message.overallToolInvocationCorrectnessThreshold != null && message.hasOwnProperty("overallToolInvocationCorrectnessThreshold")) { + object.overallToolInvocationCorrectnessThreshold = options.json && !isFinite(message.overallToolInvocationCorrectnessThreshold) ? String(message.overallToolInvocationCorrectnessThreshold) : message.overallToolInvocationCorrectnessThreshold; + if (options.oneofs) + object._overallToolInvocationCorrectnessThreshold = "overallToolInvocationCorrectnessThreshold"; + } + if (message.semanticSimilarityChannel != null && message.hasOwnProperty("semanticSimilarityChannel")) + object.semanticSimilarityChannel = options.enums === String ? $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel[message.semanticSimilarityChannel] === undefined ? message.semanticSimilarityChannel : $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel[message.semanticSimilarityChannel] : message.semanticSimilarityChannel; + return object; + }; + + /** + * Converts this TurnLevelMetricsThresholds to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @instance + * @returns {Object.} JSON object + */ + TurnLevelMetricsThresholds.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TurnLevelMetricsThresholds + * @function getTypeUrl + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TurnLevelMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds"; + }; + + /** + * SemanticSimilarityChannel enum. + * @name google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel + * @enum {number} + * @property {number} SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED=0 SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED value + * @property {number} TEXT=1 TEXT value + * @property {number} AUDIO=2 AUDIO value + */ + TurnLevelMetricsThresholds.SemanticSimilarityChannel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "AUDIO"] = 2; + return values; + })(); + + return TurnLevelMetricsThresholds; + })(); + + GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds = (function() { + + /** + * Properties of an ExpectationLevelMetricsThresholds. + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @interface IExpectationLevelMetricsThresholds + * @property {number|null} [toolInvocationParameterCorrectnessThreshold] ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold + */ + + /** + * Constructs a new ExpectationLevelMetricsThresholds. + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @classdesc Represents an ExpectationLevelMetricsThresholds. + * @implements IExpectationLevelMetricsThresholds + * @constructor + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds=} [properties] Properties to set + */ + function ExpectationLevelMetricsThresholds(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold. + * @member {number|null|undefined} toolInvocationParameterCorrectnessThreshold + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @instance + */ + ExpectationLevelMetricsThresholds.prototype.toolInvocationParameterCorrectnessThreshold = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExpectationLevelMetricsThresholds.prototype, "_toolInvocationParameterCorrectnessThreshold", { + get: $util.oneOfGetter($oneOfFields = ["toolInvocationParameterCorrectnessThreshold"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExpectationLevelMetricsThresholds instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds=} [properties] Properties to set + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds instance + */ + ExpectationLevelMetricsThresholds.create = function create(properties) { + return new ExpectationLevelMetricsThresholds(properties); + }; + + /** + * Encodes the specified ExpectationLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds} message ExpectationLevelMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpectationLevelMetricsThresholds.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolInvocationParameterCorrectnessThreshold != null && Object.hasOwnProperty.call(message, "toolInvocationParameterCorrectnessThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.toolInvocationParameterCorrectnessThreshold); + return writer; + }; + + /** + * Encodes the specified ExpectationLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds} message ExpectationLevelMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpectationLevelMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpectationLevelMetricsThresholds.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolInvocationParameterCorrectnessThreshold = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpectationLevelMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExpectationLevelMetricsThresholds message. + * @function verify + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExpectationLevelMetricsThresholds.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.toolInvocationParameterCorrectnessThreshold != null && message.hasOwnProperty("toolInvocationParameterCorrectnessThreshold")) { + properties._toolInvocationParameterCorrectnessThreshold = 1; + if (typeof message.toolInvocationParameterCorrectnessThreshold !== "number") + return "toolInvocationParameterCorrectnessThreshold: number expected"; + } + return null; + }; + + /** + * Creates an ExpectationLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds + */ + ExpectationLevelMetricsThresholds.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds) + return object; + var message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds(); + if (object.toolInvocationParameterCorrectnessThreshold != null) + message.toolInvocationParameterCorrectnessThreshold = Number(object.toolInvocationParameterCorrectnessThreshold); + return message; + }; + + /** + * Creates a plain object from an ExpectationLevelMetricsThresholds message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} message ExpectationLevelMetricsThresholds + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExpectationLevelMetricsThresholds.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.toolInvocationParameterCorrectnessThreshold != null && message.hasOwnProperty("toolInvocationParameterCorrectnessThreshold")) { + object.toolInvocationParameterCorrectnessThreshold = options.json && !isFinite(message.toolInvocationParameterCorrectnessThreshold) ? String(message.toolInvocationParameterCorrectnessThreshold) : message.toolInvocationParameterCorrectnessThreshold; + if (options.oneofs) + object._toolInvocationParameterCorrectnessThreshold = "toolInvocationParameterCorrectnessThreshold"; + } + return object; + }; + + /** + * Converts this ExpectationLevelMetricsThresholds to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @instance + * @returns {Object.} JSON object + */ + ExpectationLevelMetricsThresholds.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExpectationLevelMetricsThresholds + * @function getTypeUrl + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExpectationLevelMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds"; + }; + + return ExpectationLevelMetricsThresholds; + })(); + + return GoldenEvaluationMetricsThresholds; + })(); + + EvaluationMetricsThresholds.ToolMatchingSettings = (function() { + + /** + * Properties of a ToolMatchingSettings. + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds + * @interface IToolMatchingSettings + * @property {google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|null} [extraToolCallBehavior] ToolMatchingSettings extraToolCallBehavior + */ + + /** + * Constructs a new ToolMatchingSettings. + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds + * @classdesc Represents a ToolMatchingSettings. + * @implements IToolMatchingSettings + * @constructor + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings=} [properties] Properties to set + */ + function ToolMatchingSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolMatchingSettings extraToolCallBehavior. + * @member {google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior} extraToolCallBehavior + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings + * @instance + */ + ToolMatchingSettings.prototype.extraToolCallBehavior = 0; + + /** + * Creates a new ToolMatchingSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings instance + */ + ToolMatchingSettings.create = function create(properties) { + return new ToolMatchingSettings(properties); + }; + + /** + * Encodes the specified ToolMatchingSettings message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings} message ToolMatchingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolMatchingSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.extraToolCallBehavior != null && Object.hasOwnProperty.call(message, "extraToolCallBehavior")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.extraToolCallBehavior); + return writer; + }; + + /** + * Encodes the specified ToolMatchingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings} message ToolMatchingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolMatchingSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolMatchingSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolMatchingSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.extraToolCallBehavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolMatchingSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolMatchingSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolMatchingSettings message. + * @function verify + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolMatchingSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.extraToolCallBehavior != null && message.hasOwnProperty("extraToolCallBehavior")) + switch (message.extraToolCallBehavior) { + default: + return "extraToolCallBehavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ToolMatchingSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings + */ + ToolMatchingSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings) + return object; + var message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings(); + switch (object.extraToolCallBehavior) { + default: + if (typeof object.extraToolCallBehavior === "number") { + message.extraToolCallBehavior = object.extraToolCallBehavior; + break; + } + break; + case "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED": + case 0: + message.extraToolCallBehavior = 0; + break; + case "FAIL": + case 1: + message.extraToolCallBehavior = 1; + break; + case "ALLOW": + case 2: + message.extraToolCallBehavior = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ToolMatchingSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings} message ToolMatchingSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolMatchingSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.extraToolCallBehavior = options.enums === String ? "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED" : 0; + if (message.extraToolCallBehavior != null && message.hasOwnProperty("extraToolCallBehavior")) + object.extraToolCallBehavior = options.enums === String ? $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior[message.extraToolCallBehavior] === undefined ? message.extraToolCallBehavior : $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior[message.extraToolCallBehavior] : message.extraToolCallBehavior; + return object; + }; + + /** + * Converts this ToolMatchingSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings + * @instance + * @returns {Object.} JSON object + */ + ToolMatchingSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolMatchingSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolMatchingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings"; + }; + + /** + * ExtraToolCallBehavior enum. + * @name google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior + * @enum {number} + * @property {number} EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED=0 EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED value + * @property {number} FAIL=1 FAIL value + * @property {number} ALLOW=2 ALLOW value + */ + ToolMatchingSettings.ExtraToolCallBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "FAIL"] = 1; + values[valuesById[2] = "ALLOW"] = 2; + return values; + })(); + + return ToolMatchingSettings; + })(); + + /** + * HallucinationMetricBehavior enum. + * @name google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior + * @enum {number} + * @property {number} HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED=0 HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} ENABLED=2 ENABLED value + */ + EvaluationMetricsThresholds.HallucinationMetricBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[2] = "ENABLED"] = 2; + return values; + })(); + + return EvaluationMetricsThresholds; + })(); + + v1.ClientCertificateSettings = (function() { + + /** + * Properties of a ClientCertificateSettings. + * @memberof google.cloud.ces.v1 + * @interface IClientCertificateSettings + * @property {string|null} [tlsCertificate] ClientCertificateSettings tlsCertificate + * @property {string|null} [privateKey] ClientCertificateSettings privateKey + * @property {string|null} [passphrase] ClientCertificateSettings passphrase + */ + + /** + * Constructs a new ClientCertificateSettings. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ClientCertificateSettings. + * @implements IClientCertificateSettings + * @constructor + * @param {google.cloud.ces.v1.IClientCertificateSettings=} [properties] Properties to set + */ + function ClientCertificateSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientCertificateSettings tlsCertificate. + * @member {string} tlsCertificate + * @memberof google.cloud.ces.v1.ClientCertificateSettings + * @instance + */ + ClientCertificateSettings.prototype.tlsCertificate = ""; + + /** + * ClientCertificateSettings privateKey. + * @member {string} privateKey + * @memberof google.cloud.ces.v1.ClientCertificateSettings + * @instance + */ + ClientCertificateSettings.prototype.privateKey = ""; + + /** + * ClientCertificateSettings passphrase. + * @member {string} passphrase + * @memberof google.cloud.ces.v1.ClientCertificateSettings + * @instance + */ + ClientCertificateSettings.prototype.passphrase = ""; + + /** + * Creates a new ClientCertificateSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ClientCertificateSettings + * @static + * @param {google.cloud.ces.v1.IClientCertificateSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ClientCertificateSettings} ClientCertificateSettings instance + */ + ClientCertificateSettings.create = function create(properties) { + return new ClientCertificateSettings(properties); + }; + + /** + * Encodes the specified ClientCertificateSettings message. Does not implicitly {@link google.cloud.ces.v1.ClientCertificateSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ClientCertificateSettings + * @static + * @param {google.cloud.ces.v1.IClientCertificateSettings} message ClientCertificateSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientCertificateSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tlsCertificate != null && Object.hasOwnProperty.call(message, "tlsCertificate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tlsCertificate); + if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.privateKey); + if (message.passphrase != null && Object.hasOwnProperty.call(message, "passphrase")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.passphrase); + return writer; + }; + + /** + * Encodes the specified ClientCertificateSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ClientCertificateSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ClientCertificateSettings + * @static + * @param {google.cloud.ces.v1.IClientCertificateSettings} message ClientCertificateSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientCertificateSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ClientCertificateSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ClientCertificateSettings} ClientCertificateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientCertificateSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ClientCertificateSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tlsCertificate = reader.string(); + break; + } + case 2: { + message.privateKey = reader.string(); + break; + } + case 3: { + message.passphrase = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ClientCertificateSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ClientCertificateSettings} ClientCertificateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientCertificateSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientCertificateSettings message. + * @function verify + * @memberof google.cloud.ces.v1.ClientCertificateSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientCertificateSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tlsCertificate != null && message.hasOwnProperty("tlsCertificate")) + if (!$util.isString(message.tlsCertificate)) + return "tlsCertificate: string expected"; + if (message.privateKey != null && message.hasOwnProperty("privateKey")) + if (!$util.isString(message.privateKey)) + return "privateKey: string expected"; + if (message.passphrase != null && message.hasOwnProperty("passphrase")) + if (!$util.isString(message.passphrase)) + return "passphrase: string expected"; + return null; + }; + + /** + * Creates a ClientCertificateSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ClientCertificateSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ClientCertificateSettings} ClientCertificateSettings + */ + ClientCertificateSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ClientCertificateSettings) + return object; + var message = new $root.google.cloud.ces.v1.ClientCertificateSettings(); + if (object.tlsCertificate != null) + message.tlsCertificate = String(object.tlsCertificate); + if (object.privateKey != null) + message.privateKey = String(object.privateKey); + if (object.passphrase != null) + message.passphrase = String(object.passphrase); + return message; + }; + + /** + * Creates a plain object from a ClientCertificateSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ClientCertificateSettings + * @static + * @param {google.cloud.ces.v1.ClientCertificateSettings} message ClientCertificateSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientCertificateSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tlsCertificate = ""; + object.privateKey = ""; + object.passphrase = ""; + } + if (message.tlsCertificate != null && message.hasOwnProperty("tlsCertificate")) + object.tlsCertificate = message.tlsCertificate; + if (message.privateKey != null && message.hasOwnProperty("privateKey")) + object.privateKey = message.privateKey; + if (message.passphrase != null && message.hasOwnProperty("passphrase")) + object.passphrase = message.passphrase; + return object; + }; + + /** + * Converts this ClientCertificateSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ClientCertificateSettings + * @instance + * @returns {Object.} JSON object + */ + ClientCertificateSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientCertificateSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ClientCertificateSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientCertificateSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ClientCertificateSettings"; + }; + + return ClientCertificateSettings; + })(); + + v1.ConversationLoggingSettings = (function() { + + /** + * Properties of a ConversationLoggingSettings. + * @memberof google.cloud.ces.v1 + * @interface IConversationLoggingSettings + * @property {boolean|null} [disableConversationLogging] ConversationLoggingSettings disableConversationLogging + */ + + /** + * Constructs a new ConversationLoggingSettings. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ConversationLoggingSettings. + * @implements IConversationLoggingSettings + * @constructor + * @param {google.cloud.ces.v1.IConversationLoggingSettings=} [properties] Properties to set + */ + function ConversationLoggingSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConversationLoggingSettings disableConversationLogging. + * @member {boolean} disableConversationLogging + * @memberof google.cloud.ces.v1.ConversationLoggingSettings + * @instance + */ + ConversationLoggingSettings.prototype.disableConversationLogging = false; + + /** + * Creates a new ConversationLoggingSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ConversationLoggingSettings + * @static + * @param {google.cloud.ces.v1.IConversationLoggingSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ConversationLoggingSettings} ConversationLoggingSettings instance + */ + ConversationLoggingSettings.create = function create(properties) { + return new ConversationLoggingSettings(properties); + }; + + /** + * Encodes the specified ConversationLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1.ConversationLoggingSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ConversationLoggingSettings + * @static + * @param {google.cloud.ces.v1.IConversationLoggingSettings} message ConversationLoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationLoggingSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disableConversationLogging != null && Object.hasOwnProperty.call(message, "disableConversationLogging")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.disableConversationLogging); + return writer; + }; + + /** + * Encodes the specified ConversationLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ConversationLoggingSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ConversationLoggingSettings + * @static + * @param {google.cloud.ces.v1.IConversationLoggingSettings} message ConversationLoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationLoggingSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConversationLoggingSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ConversationLoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ConversationLoggingSettings} ConversationLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationLoggingSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ConversationLoggingSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.disableConversationLogging = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConversationLoggingSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ConversationLoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ConversationLoggingSettings} ConversationLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationLoggingSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConversationLoggingSettings message. + * @function verify + * @memberof google.cloud.ces.v1.ConversationLoggingSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConversationLoggingSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disableConversationLogging != null && message.hasOwnProperty("disableConversationLogging")) + if (typeof message.disableConversationLogging !== "boolean") + return "disableConversationLogging: boolean expected"; + return null; + }; + + /** + * Creates a ConversationLoggingSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ConversationLoggingSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ConversationLoggingSettings} ConversationLoggingSettings + */ + ConversationLoggingSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ConversationLoggingSettings) + return object; + var message = new $root.google.cloud.ces.v1.ConversationLoggingSettings(); + if (object.disableConversationLogging != null) + message.disableConversationLogging = Boolean(object.disableConversationLogging); + return message; + }; + + /** + * Creates a plain object from a ConversationLoggingSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ConversationLoggingSettings + * @static + * @param {google.cloud.ces.v1.ConversationLoggingSettings} message ConversationLoggingSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConversationLoggingSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.disableConversationLogging = false; + if (message.disableConversationLogging != null && message.hasOwnProperty("disableConversationLogging")) + object.disableConversationLogging = message.disableConversationLogging; + return object; + }; + + /** + * Converts this ConversationLoggingSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ConversationLoggingSettings + * @instance + * @returns {Object.} JSON object + */ + ConversationLoggingSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConversationLoggingSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ConversationLoggingSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConversationLoggingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ConversationLoggingSettings"; + }; + + return ConversationLoggingSettings; + })(); + + v1.CloudLoggingSettings = (function() { + + /** + * Properties of a CloudLoggingSettings. + * @memberof google.cloud.ces.v1 + * @interface ICloudLoggingSettings + * @property {boolean|null} [enableCloudLogging] CloudLoggingSettings enableCloudLogging + */ + + /** + * Constructs a new CloudLoggingSettings. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a CloudLoggingSettings. + * @implements ICloudLoggingSettings + * @constructor + * @param {google.cloud.ces.v1.ICloudLoggingSettings=} [properties] Properties to set + */ + function CloudLoggingSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudLoggingSettings enableCloudLogging. + * @member {boolean} enableCloudLogging + * @memberof google.cloud.ces.v1.CloudLoggingSettings + * @instance + */ + CloudLoggingSettings.prototype.enableCloudLogging = false; + + /** + * Creates a new CloudLoggingSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.CloudLoggingSettings + * @static + * @param {google.cloud.ces.v1.ICloudLoggingSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1.CloudLoggingSettings} CloudLoggingSettings instance + */ + CloudLoggingSettings.create = function create(properties) { + return new CloudLoggingSettings(properties); + }; + + /** + * Encodes the specified CloudLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1.CloudLoggingSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.CloudLoggingSettings + * @static + * @param {google.cloud.ces.v1.ICloudLoggingSettings} message CloudLoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudLoggingSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableCloudLogging != null && Object.hasOwnProperty.call(message, "enableCloudLogging")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableCloudLogging); + return writer; + }; + + /** + * Encodes the specified CloudLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CloudLoggingSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.CloudLoggingSettings + * @static + * @param {google.cloud.ces.v1.ICloudLoggingSettings} message CloudLoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudLoggingSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudLoggingSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.CloudLoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.CloudLoggingSettings} CloudLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudLoggingSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CloudLoggingSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableCloudLogging = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudLoggingSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.CloudLoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.CloudLoggingSettings} CloudLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudLoggingSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudLoggingSettings message. + * @function verify + * @memberof google.cloud.ces.v1.CloudLoggingSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudLoggingSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableCloudLogging != null && message.hasOwnProperty("enableCloudLogging")) + if (typeof message.enableCloudLogging !== "boolean") + return "enableCloudLogging: boolean expected"; + return null; + }; + + /** + * Creates a CloudLoggingSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.CloudLoggingSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.CloudLoggingSettings} CloudLoggingSettings + */ + CloudLoggingSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.CloudLoggingSettings) + return object; + var message = new $root.google.cloud.ces.v1.CloudLoggingSettings(); + if (object.enableCloudLogging != null) + message.enableCloudLogging = Boolean(object.enableCloudLogging); + return message; + }; + + /** + * Creates a plain object from a CloudLoggingSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.CloudLoggingSettings + * @static + * @param {google.cloud.ces.v1.CloudLoggingSettings} message CloudLoggingSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudLoggingSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableCloudLogging = false; + if (message.enableCloudLogging != null && message.hasOwnProperty("enableCloudLogging")) + object.enableCloudLogging = message.enableCloudLogging; + return object; + }; + + /** + * Converts this CloudLoggingSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.CloudLoggingSettings + * @instance + * @returns {Object.} JSON object + */ + CloudLoggingSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudLoggingSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1.CloudLoggingSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudLoggingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.CloudLoggingSettings"; + }; + + return CloudLoggingSettings; + })(); + + v1.AudioRecordingConfig = (function() { + + /** + * Properties of an AudioRecordingConfig. + * @memberof google.cloud.ces.v1 + * @interface IAudioRecordingConfig + * @property {string|null} [gcsBucket] AudioRecordingConfig gcsBucket + * @property {string|null} [gcsPathPrefix] AudioRecordingConfig gcsPathPrefix + */ + + /** + * Constructs a new AudioRecordingConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an AudioRecordingConfig. + * @implements IAudioRecordingConfig + * @constructor + * @param {google.cloud.ces.v1.IAudioRecordingConfig=} [properties] Properties to set + */ + function AudioRecordingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AudioRecordingConfig gcsBucket. + * @member {string} gcsBucket + * @memberof google.cloud.ces.v1.AudioRecordingConfig + * @instance + */ + AudioRecordingConfig.prototype.gcsBucket = ""; + + /** + * AudioRecordingConfig gcsPathPrefix. + * @member {string} gcsPathPrefix + * @memberof google.cloud.ces.v1.AudioRecordingConfig + * @instance + */ + AudioRecordingConfig.prototype.gcsPathPrefix = ""; + + /** + * Creates a new AudioRecordingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.AudioRecordingConfig + * @static + * @param {google.cloud.ces.v1.IAudioRecordingConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.AudioRecordingConfig} AudioRecordingConfig instance + */ + AudioRecordingConfig.create = function create(properties) { + return new AudioRecordingConfig(properties); + }; + + /** + * Encodes the specified AudioRecordingConfig message. Does not implicitly {@link google.cloud.ces.v1.AudioRecordingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.AudioRecordingConfig + * @static + * @param {google.cloud.ces.v1.IAudioRecordingConfig} message AudioRecordingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioRecordingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsBucket != null && Object.hasOwnProperty.call(message, "gcsBucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsBucket); + if (message.gcsPathPrefix != null && Object.hasOwnProperty.call(message, "gcsPathPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsPathPrefix); + return writer; + }; + + /** + * Encodes the specified AudioRecordingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AudioRecordingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.AudioRecordingConfig + * @static + * @param {google.cloud.ces.v1.IAudioRecordingConfig} message AudioRecordingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioRecordingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AudioRecordingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.AudioRecordingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.AudioRecordingConfig} AudioRecordingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioRecordingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.AudioRecordingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsBucket = reader.string(); + break; + } + case 2: { + message.gcsPathPrefix = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AudioRecordingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.AudioRecordingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.AudioRecordingConfig} AudioRecordingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioRecordingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AudioRecordingConfig message. + * @function verify + * @memberof google.cloud.ces.v1.AudioRecordingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AudioRecordingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + if (!$util.isString(message.gcsBucket)) + return "gcsBucket: string expected"; + if (message.gcsPathPrefix != null && message.hasOwnProperty("gcsPathPrefix")) + if (!$util.isString(message.gcsPathPrefix)) + return "gcsPathPrefix: string expected"; + return null; + }; + + /** + * Creates an AudioRecordingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.AudioRecordingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.AudioRecordingConfig} AudioRecordingConfig + */ + AudioRecordingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.AudioRecordingConfig) + return object; + var message = new $root.google.cloud.ces.v1.AudioRecordingConfig(); + if (object.gcsBucket != null) + message.gcsBucket = String(object.gcsBucket); + if (object.gcsPathPrefix != null) + message.gcsPathPrefix = String(object.gcsPathPrefix); + return message; + }; + + /** + * Creates a plain object from an AudioRecordingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.AudioRecordingConfig + * @static + * @param {google.cloud.ces.v1.AudioRecordingConfig} message AudioRecordingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AudioRecordingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsBucket = ""; + object.gcsPathPrefix = ""; + } + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + object.gcsBucket = message.gcsBucket; + if (message.gcsPathPrefix != null && message.hasOwnProperty("gcsPathPrefix")) + object.gcsPathPrefix = message.gcsPathPrefix; + return object; + }; + + /** + * Converts this AudioRecordingConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.AudioRecordingConfig + * @instance + * @returns {Object.} JSON object + */ + AudioRecordingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AudioRecordingConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.AudioRecordingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AudioRecordingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.AudioRecordingConfig"; + }; + + return AudioRecordingConfig; + })(); + + v1.RedactionConfig = (function() { + + /** + * Properties of a RedactionConfig. + * @memberof google.cloud.ces.v1 + * @interface IRedactionConfig + * @property {boolean|null} [enableRedaction] RedactionConfig enableRedaction + * @property {string|null} [inspectTemplate] RedactionConfig inspectTemplate + * @property {string|null} [deidentifyTemplate] RedactionConfig deidentifyTemplate + */ + + /** + * Constructs a new RedactionConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a RedactionConfig. + * @implements IRedactionConfig + * @constructor + * @param {google.cloud.ces.v1.IRedactionConfig=} [properties] Properties to set + */ + function RedactionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RedactionConfig enableRedaction. + * @member {boolean} enableRedaction + * @memberof google.cloud.ces.v1.RedactionConfig + * @instance + */ + RedactionConfig.prototype.enableRedaction = false; + + /** + * RedactionConfig inspectTemplate. + * @member {string} inspectTemplate + * @memberof google.cloud.ces.v1.RedactionConfig + * @instance + */ + RedactionConfig.prototype.inspectTemplate = ""; + + /** + * RedactionConfig deidentifyTemplate. + * @member {string} deidentifyTemplate + * @memberof google.cloud.ces.v1.RedactionConfig + * @instance + */ + RedactionConfig.prototype.deidentifyTemplate = ""; + + /** + * Creates a new RedactionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.RedactionConfig + * @static + * @param {google.cloud.ces.v1.IRedactionConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.RedactionConfig} RedactionConfig instance + */ + RedactionConfig.create = function create(properties) { + return new RedactionConfig(properties); + }; + + /** + * Encodes the specified RedactionConfig message. Does not implicitly {@link google.cloud.ces.v1.RedactionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.RedactionConfig + * @static + * @param {google.cloud.ces.v1.IRedactionConfig} message RedactionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedactionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableRedaction != null && Object.hasOwnProperty.call(message, "enableRedaction")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableRedaction); + if (message.inspectTemplate != null && Object.hasOwnProperty.call(message, "inspectTemplate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inspectTemplate); + if (message.deidentifyTemplate != null && Object.hasOwnProperty.call(message, "deidentifyTemplate")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deidentifyTemplate); + return writer; + }; + + /** + * Encodes the specified RedactionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RedactionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.RedactionConfig + * @static + * @param {google.cloud.ces.v1.IRedactionConfig} message RedactionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedactionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RedactionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.RedactionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.RedactionConfig} RedactionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedactionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RedactionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableRedaction = reader.bool(); + break; + } + case 2: { + message.inspectTemplate = reader.string(); + break; + } + case 3: { + message.deidentifyTemplate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RedactionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.RedactionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.RedactionConfig} RedactionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedactionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RedactionConfig message. + * @function verify + * @memberof google.cloud.ces.v1.RedactionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedactionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableRedaction != null && message.hasOwnProperty("enableRedaction")) + if (typeof message.enableRedaction !== "boolean") + return "enableRedaction: boolean expected"; + if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) + if (!$util.isString(message.inspectTemplate)) + return "inspectTemplate: string expected"; + if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) + if (!$util.isString(message.deidentifyTemplate)) + return "deidentifyTemplate: string expected"; + return null; + }; + + /** + * Creates a RedactionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.RedactionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.RedactionConfig} RedactionConfig + */ + RedactionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.RedactionConfig) + return object; + var message = new $root.google.cloud.ces.v1.RedactionConfig(); + if (object.enableRedaction != null) + message.enableRedaction = Boolean(object.enableRedaction); + if (object.inspectTemplate != null) + message.inspectTemplate = String(object.inspectTemplate); + if (object.deidentifyTemplate != null) + message.deidentifyTemplate = String(object.deidentifyTemplate); + return message; + }; + + /** + * Creates a plain object from a RedactionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.RedactionConfig + * @static + * @param {google.cloud.ces.v1.RedactionConfig} message RedactionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedactionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableRedaction = false; + object.inspectTemplate = ""; + object.deidentifyTemplate = ""; + } + if (message.enableRedaction != null && message.hasOwnProperty("enableRedaction")) + object.enableRedaction = message.enableRedaction; + if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) + object.inspectTemplate = message.inspectTemplate; + if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) + object.deidentifyTemplate = message.deidentifyTemplate; + return object; + }; + + /** + * Converts this RedactionConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.RedactionConfig + * @instance + * @returns {Object.} JSON object + */ + RedactionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RedactionConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.RedactionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RedactionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.RedactionConfig"; + }; + + return RedactionConfig; + })(); + + v1.DataStoreSettings = (function() { + + /** + * Properties of a DataStoreSettings. + * @memberof google.cloud.ces.v1 + * @interface IDataStoreSettings + * @property {Array.|null} [engines] DataStoreSettings engines + */ + + /** + * Constructs a new DataStoreSettings. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a DataStoreSettings. + * @implements IDataStoreSettings + * @constructor + * @param {google.cloud.ces.v1.IDataStoreSettings=} [properties] Properties to set + */ + function DataStoreSettings(properties) { + this.engines = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStoreSettings engines. + * @member {Array.} engines + * @memberof google.cloud.ces.v1.DataStoreSettings + * @instance + */ + DataStoreSettings.prototype.engines = $util.emptyArray; + + /** + * Creates a new DataStoreSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DataStoreSettings + * @static + * @param {google.cloud.ces.v1.IDataStoreSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DataStoreSettings} DataStoreSettings instance + */ + DataStoreSettings.create = function create(properties) { + return new DataStoreSettings(properties); + }; + + /** + * Encodes the specified DataStoreSettings message. Does not implicitly {@link google.cloud.ces.v1.DataStoreSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DataStoreSettings + * @static + * @param {google.cloud.ces.v1.IDataStoreSettings} message DataStoreSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.engines != null && message.engines.length) + for (var i = 0; i < message.engines.length; ++i) + $root.google.cloud.ces.v1.DataStoreSettings.Engine.encode(message.engines[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataStoreSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DataStoreSettings + * @static + * @param {google.cloud.ces.v1.IDataStoreSettings} message DataStoreSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStoreSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DataStoreSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DataStoreSettings} DataStoreSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + if (!(message.engines && message.engines.length)) + message.engines = []; + message.engines.push($root.google.cloud.ces.v1.DataStoreSettings.Engine.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataStoreSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DataStoreSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DataStoreSettings} DataStoreSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStoreSettings message. + * @function verify + * @memberof google.cloud.ces.v1.DataStoreSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStoreSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.engines != null && message.hasOwnProperty("engines")) { + if (!Array.isArray(message.engines)) + return "engines: array expected"; + for (var i = 0; i < message.engines.length; ++i) { + var error = $root.google.cloud.ces.v1.DataStoreSettings.Engine.verify(message.engines[i]); + if (error) + return "engines." + error; + } + } + return null; + }; + + /** + * Creates a DataStoreSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DataStoreSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DataStoreSettings} DataStoreSettings + */ + DataStoreSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DataStoreSettings) + return object; + var message = new $root.google.cloud.ces.v1.DataStoreSettings(); + if (object.engines) { + if (!Array.isArray(object.engines)) + throw TypeError(".google.cloud.ces.v1.DataStoreSettings.engines: array expected"); + message.engines = []; + for (var i = 0; i < object.engines.length; ++i) { + if (typeof object.engines[i] !== "object") + throw TypeError(".google.cloud.ces.v1.DataStoreSettings.engines: object expected"); + message.engines[i] = $root.google.cloud.ces.v1.DataStoreSettings.Engine.fromObject(object.engines[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DataStoreSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DataStoreSettings + * @static + * @param {google.cloud.ces.v1.DataStoreSettings} message DataStoreSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStoreSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.engines = []; + if (message.engines && message.engines.length) { + object.engines = []; + for (var j = 0; j < message.engines.length; ++j) + object.engines[j] = $root.google.cloud.ces.v1.DataStoreSettings.Engine.toObject(message.engines[j], options); + } + return object; + }; + + /** + * Converts this DataStoreSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DataStoreSettings + * @instance + * @returns {Object.} JSON object + */ + DataStoreSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStoreSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DataStoreSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStoreSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreSettings"; + }; + + DataStoreSettings.Engine = (function() { + + /** + * Properties of an Engine. + * @memberof google.cloud.ces.v1.DataStoreSettings + * @interface IEngine + * @property {string|null} [name] Engine name + * @property {google.cloud.ces.v1.DataStoreSettings.Engine.Type|null} [type] Engine type + */ + + /** + * Constructs a new Engine. + * @memberof google.cloud.ces.v1.DataStoreSettings + * @classdesc Represents an Engine. + * @implements IEngine + * @constructor + * @param {google.cloud.ces.v1.DataStoreSettings.IEngine=} [properties] Properties to set + */ + function Engine(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Engine name. + * @member {string} name + * @memberof google.cloud.ces.v1.DataStoreSettings.Engine + * @instance + */ + Engine.prototype.name = ""; + + /** + * Engine type. + * @member {google.cloud.ces.v1.DataStoreSettings.Engine.Type} type + * @memberof google.cloud.ces.v1.DataStoreSettings.Engine + * @instance + */ + Engine.prototype.type = 0; + + /** + * Creates a new Engine instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DataStoreSettings.Engine + * @static + * @param {google.cloud.ces.v1.DataStoreSettings.IEngine=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DataStoreSettings.Engine} Engine instance + */ + Engine.create = function create(properties) { + return new Engine(properties); + }; + + /** + * Encodes the specified Engine message. Does not implicitly {@link google.cloud.ces.v1.DataStoreSettings.Engine.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DataStoreSettings.Engine + * @static + * @param {google.cloud.ces.v1.DataStoreSettings.IEngine} message Engine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Engine.encode = function encode(message, writer) { + if (!writer) + 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 0 =*/16).int32(message.type); + return writer; + }; + + /** + * Encodes the specified Engine message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreSettings.Engine.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DataStoreSettings.Engine + * @static + * @param {google.cloud.ces.v1.DataStoreSettings.IEngine} message Engine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Engine.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Engine message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DataStoreSettings.Engine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DataStoreSettings.Engine} Engine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Engine.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreSettings.Engine(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Engine message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DataStoreSettings.Engine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DataStoreSettings.Engine} Engine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Engine.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Engine message. + * @function verify + * @memberof google.cloud.ces.v1.DataStoreSettings.Engine + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Engine.verify = function verify(message) { + if (typeof message !== "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")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Engine message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DataStoreSettings.Engine + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DataStoreSettings.Engine} Engine + */ + Engine.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DataStoreSettings.Engine) + return object; + var message = new $root.google.cloud.ces.v1.DataStoreSettings.Engine(); + if (object.name != null) + message.name = String(object.name); + 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 "ENGINE_TYPE_SEARCH": + case 1: + message.type = 1; + break; + case "ENGINE_TYPE_CHAT": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Engine message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DataStoreSettings.Engine + * @static + * @param {google.cloud.ces.v1.DataStoreSettings.Engine} message Engine + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Engine.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.ces.v1.DataStoreSettings.Engine.Type[message.type] === undefined ? message.type : $root.google.cloud.ces.v1.DataStoreSettings.Engine.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this Engine to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DataStoreSettings.Engine + * @instance + * @returns {Object.} JSON object + */ + Engine.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Engine + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DataStoreSettings.Engine + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Engine.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreSettings.Engine"; + }; + + /** + * Type enum. + * @name google.cloud.ces.v1.DataStoreSettings.Engine.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ENGINE_TYPE_SEARCH=1 ENGINE_TYPE_SEARCH value + * @property {number} ENGINE_TYPE_CHAT=2 ENGINE_TYPE_CHAT value + */ + Engine.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENGINE_TYPE_SEARCH"] = 1; + values[valuesById[2] = "ENGINE_TYPE_CHAT"] = 2; + return values; + })(); + + return Engine; + })(); + + return DataStoreSettings; + })(); + + v1.BigQueryExportSettings = (function() { + + /** + * Properties of a BigQueryExportSettings. + * @memberof google.cloud.ces.v1 + * @interface IBigQueryExportSettings + * @property {boolean|null} [enabled] BigQueryExportSettings enabled + * @property {string|null} [project] BigQueryExportSettings project + * @property {string|null} [dataset] BigQueryExportSettings dataset + */ + + /** + * Constructs a new BigQueryExportSettings. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a BigQueryExportSettings. + * @implements IBigQueryExportSettings + * @constructor + * @param {google.cloud.ces.v1.IBigQueryExportSettings=} [properties] Properties to set + */ + function BigQueryExportSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQueryExportSettings enabled. + * @member {boolean} enabled + * @memberof google.cloud.ces.v1.BigQueryExportSettings + * @instance + */ + BigQueryExportSettings.prototype.enabled = false; + + /** + * BigQueryExportSettings project. + * @member {string} project + * @memberof google.cloud.ces.v1.BigQueryExportSettings + * @instance + */ + BigQueryExportSettings.prototype.project = ""; + + /** + * BigQueryExportSettings dataset. + * @member {string} dataset + * @memberof google.cloud.ces.v1.BigQueryExportSettings + * @instance + */ + BigQueryExportSettings.prototype.dataset = ""; + + /** + * Creates a new BigQueryExportSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.BigQueryExportSettings + * @static + * @param {google.cloud.ces.v1.IBigQueryExportSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1.BigQueryExportSettings} BigQueryExportSettings instance + */ + BigQueryExportSettings.create = function create(properties) { + return new BigQueryExportSettings(properties); + }; + + /** + * Encodes the specified BigQueryExportSettings message. Does not implicitly {@link google.cloud.ces.v1.BigQueryExportSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.BigQueryExportSettings + * @static + * @param {google.cloud.ces.v1.IBigQueryExportSettings} message BigQueryExportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryExportSettings.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.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dataset); + return writer; + }; + + /** + * Encodes the specified BigQueryExportSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BigQueryExportSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.BigQueryExportSettings + * @static + * @param {google.cloud.ces.v1.IBigQueryExportSettings} message BigQueryExportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryExportSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryExportSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.BigQueryExportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.BigQueryExportSettings} BigQueryExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryExportSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.BigQueryExportSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + message.project = reader.string(); + break; + } + case 3: { + message.dataset = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryExportSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.BigQueryExportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.BigQueryExportSettings} BigQueryExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryExportSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryExportSettings message. + * @function verify + * @memberof google.cloud.ces.v1.BigQueryExportSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryExportSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + return null; + }; + + /** + * Creates a BigQueryExportSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.BigQueryExportSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.BigQueryExportSettings} BigQueryExportSettings + */ + BigQueryExportSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.BigQueryExportSettings) + return object; + var message = new $root.google.cloud.ces.v1.BigQueryExportSettings(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.project != null) + message.project = String(object.project); + if (object.dataset != null) + message.dataset = String(object.dataset); + return message; + }; + + /** + * Creates a plain object from a BigQueryExportSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.BigQueryExportSettings + * @static + * @param {google.cloud.ces.v1.BigQueryExportSettings} message BigQueryExportSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryExportSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enabled = false; + object.project = ""; + object.dataset = ""; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + return object; + }; + + /** + * Converts this BigQueryExportSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.BigQueryExportSettings + * @instance + * @returns {Object.} JSON object + */ + BigQueryExportSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryExportSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1.BigQueryExportSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryExportSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.BigQueryExportSettings"; + }; + + return BigQueryExportSettings; + })(); + + v1.Schema = (function() { + + /** + * Properties of a Schema. + * @memberof google.cloud.ces.v1 + * @interface ISchema + * @property {google.cloud.ces.v1.Schema.Type|null} [type] Schema type + * @property {Object.|null} [properties] Schema properties + * @property {Array.|null} [required] Schema required + * @property {string|null} [description] Schema description + * @property {google.cloud.ces.v1.ISchema|null} [items] Schema items + * @property {boolean|null} [nullable] Schema nullable + * @property {boolean|null} [uniqueItems] Schema uniqueItems + * @property {Array.|null} [prefixItems] Schema prefixItems + * @property {google.cloud.ces.v1.ISchema|null} [additionalProperties] Schema additionalProperties + * @property {Array.|null} [anyOf] Schema anyOf + * @property {Array.|null} ["enum"] Schema enum + * @property {google.protobuf.IValue|null} ["default"] Schema default + * @property {string|null} [ref] Schema ref + * @property {Object.|null} [defs] Schema defs + * @property {string|null} [title] Schema title + * @property {number|Long|null} [minItems] Schema minItems + * @property {number|Long|null} [maxItems] Schema maxItems + * @property {number|null} [minimum] Schema minimum + * @property {number|null} [maximum] Schema maximum + */ + + /** + * Constructs a new Schema. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a Schema. + * @implements ISchema + * @constructor + * @param {google.cloud.ces.v1.ISchema=} [properties] Properties to set + */ + function Schema(properties) { + this.properties = {}; + this.required = []; + this.prefixItems = []; + this.anyOf = []; + this["enum"] = []; + this.defs = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Schema type. + * @member {google.cloud.ces.v1.Schema.Type} type + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype.type = 0; + + /** + * Schema properties. + * @member {Object.} properties + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype.properties = $util.emptyObject; + + /** + * Schema required. + * @member {Array.} required + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype.required = $util.emptyArray; + + /** + * Schema description. + * @member {string} description + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype.description = ""; + + /** + * Schema items. + * @member {google.cloud.ces.v1.ISchema|null|undefined} items + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype.items = null; + + /** + * Schema nullable. + * @member {boolean} nullable + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype.nullable = false; + + /** + * Schema uniqueItems. + * @member {boolean} uniqueItems + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype.uniqueItems = false; + + /** + * Schema prefixItems. + * @member {Array.} prefixItems + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype.prefixItems = $util.emptyArray; + + /** + * Schema additionalProperties. + * @member {google.cloud.ces.v1.ISchema|null|undefined} additionalProperties + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype.additionalProperties = null; + + /** + * Schema anyOf. + * @member {Array.} anyOf + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype.anyOf = $util.emptyArray; + + /** + * Schema enum. + * @member {Array.} enum + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype["enum"] = $util.emptyArray; + + /** + * Schema default. + * @member {google.protobuf.IValue|null|undefined} default + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype["default"] = null; + + /** + * Schema ref. + * @member {string} ref + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype.ref = ""; + + /** + * Schema defs. + * @member {Object.} defs + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype.defs = $util.emptyObject; + + /** + * Schema title. + * @member {string} title + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype.title = ""; + + /** + * Schema minItems. + * @member {number|Long} minItems + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype.minItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Schema maxItems. + * @member {number|Long} maxItems + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype.maxItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Schema minimum. + * @member {number|null|undefined} minimum + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype.minimum = null; + + /** + * Schema maximum. + * @member {number|null|undefined} maximum + * @memberof google.cloud.ces.v1.Schema + * @instance + */ + Schema.prototype.maximum = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Schema.prototype, "_minimum", { + get: $util.oneOfGetter($oneOfFields = ["minimum"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Schema.prototype, "_maximum", { + get: $util.oneOfGetter($oneOfFields = ["maximum"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Schema instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Schema + * @static + * @param {google.cloud.ces.v1.ISchema=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Schema} Schema instance + */ + Schema.create = function create(properties) { + return new Schema(properties); + }; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.cloud.ces.v1.Schema.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Schema + * @static + * @param {google.cloud.ces.v1.ISchema} message Schema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), 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.ces.v1.Schema.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.required != null && message.required.length) + for (var i = 0; i < message.required.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.required[i]); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + $root.google.cloud.ces.v1.Schema.encode(message.items, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.nullable != null && Object.hasOwnProperty.call(message, "nullable")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.nullable); + if (message.uniqueItems != null && Object.hasOwnProperty.call(message, "uniqueItems")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.uniqueItems); + if (message.prefixItems != null && message.prefixItems.length) + for (var i = 0; i < message.prefixItems.length; ++i) + $root.google.cloud.ces.v1.Schema.encode(message.prefixItems[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalProperties != null && Object.hasOwnProperty.call(message, "additionalProperties")) + $root.google.cloud.ces.v1.Schema.encode(message.additionalProperties, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.anyOf != null && message.anyOf.length) + for (var i = 0; i < message.anyOf.length; ++i) + $root.google.cloud.ces.v1.Schema.encode(message.anyOf[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message["enum"] != null && message["enum"].length) + for (var i = 0; i < message["enum"].length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message["enum"][i]); + if (message["default"] != null && Object.hasOwnProperty.call(message, "default")) + $root.google.protobuf.Value.encode(message["default"], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.ref != null && Object.hasOwnProperty.call(message, "ref")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.ref); + if (message.defs != null && Object.hasOwnProperty.call(message, "defs")) + for (var keys = Object.keys(message.defs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.ces.v1.Schema.encode(message.defs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.title); + if (message.minItems != null && Object.hasOwnProperty.call(message, "minItems")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.minItems); + if (message.maxItems != null && Object.hasOwnProperty.call(message, "maxItems")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.maxItems); + if (message.minimum != null && Object.hasOwnProperty.call(message, "minimum")) + writer.uint32(/* id 18, wireType 1 =*/145).double(message.minimum); + if (message.maximum != null && Object.hasOwnProperty.call(message, "maximum")) + writer.uint32(/* id 19, wireType 1 =*/153).double(message.maximum); + return writer; + }; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Schema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Schema + * @static + * @param {google.cloud.ces.v1.ISchema} message Schema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Schema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Schema} Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schema.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Schema(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.ces.v1.Schema.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.properties[key] = value; + break; + } + case 3: { + if (!(message.required && message.required.length)) + message.required = []; + message.required.push(reader.string()); + break; + } + case 4: { + message.description = reader.string(); + break; + } + case 5: { + message.items = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); + break; + } + case 6: { + message.nullable = reader.bool(); + break; + } + case 7: { + message.uniqueItems = reader.bool(); + break; + } + case 8: { + if (!(message.prefixItems && message.prefixItems.length)) + message.prefixItems = []; + message.prefixItems.push($root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32())); + break; + } + case 9: { + message.additionalProperties = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.anyOf && message.anyOf.length)) + message.anyOf = []; + message.anyOf.push($root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32())); + break; + } + case 11: { + if (!(message["enum"] && message["enum"].length)) + message["enum"] = []; + message["enum"].push(reader.string()); + break; + } + case 12: { + message["default"] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 13: { + message.ref = reader.string(); + break; + } + case 14: { + if (message.defs === $util.emptyObject) + message.defs = {}; + 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.ces.v1.Schema.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.defs[key] = value; + break; + } + case 15: { + message.title = reader.string(); + break; + } + case 16: { + message.minItems = reader.int64(); + break; + } + case 17: { + message.maxItems = reader.int64(); + break; + } + case 18: { + message.minimum = reader.double(); + break; + } + case 19: { + message.maximum = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Schema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Schema} Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Schema message. + * @function verify + * @memberof google.cloud.ces.v1.Schema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Schema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1.Schema.verify(message.properties[key[i]]); + if (error) + return "properties." + error; + } + } + if (message.required != null && message.hasOwnProperty("required")) { + if (!Array.isArray(message.required)) + return "required: array expected"; + for (var i = 0; i < message.required.length; ++i) + if (!$util.isString(message.required[i])) + return "required: string[] expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.items != null && message.hasOwnProperty("items")) { + var error = $root.google.cloud.ces.v1.Schema.verify(message.items); + if (error) + return "items." + error; + } + if (message.nullable != null && message.hasOwnProperty("nullable")) + if (typeof message.nullable !== "boolean") + return "nullable: boolean expected"; + if (message.uniqueItems != null && message.hasOwnProperty("uniqueItems")) + if (typeof message.uniqueItems !== "boolean") + return "uniqueItems: boolean expected"; + if (message.prefixItems != null && message.hasOwnProperty("prefixItems")) { + if (!Array.isArray(message.prefixItems)) + return "prefixItems: array expected"; + for (var i = 0; i < message.prefixItems.length; ++i) { + var error = $root.google.cloud.ces.v1.Schema.verify(message.prefixItems[i]); + if (error) + return "prefixItems." + error; + } + } + if (message.additionalProperties != null && message.hasOwnProperty("additionalProperties")) { + var error = $root.google.cloud.ces.v1.Schema.verify(message.additionalProperties); + if (error) + return "additionalProperties." + error; + } + if (message.anyOf != null && message.hasOwnProperty("anyOf")) { + if (!Array.isArray(message.anyOf)) + return "anyOf: array expected"; + for (var i = 0; i < message.anyOf.length; ++i) { + var error = $root.google.cloud.ces.v1.Schema.verify(message.anyOf[i]); + if (error) + return "anyOf." + error; + } + } + if (message["enum"] != null && message.hasOwnProperty("enum")) { + if (!Array.isArray(message["enum"])) + return "enum: array expected"; + for (var i = 0; i < message["enum"].length; ++i) + if (!$util.isString(message["enum"][i])) + return "enum: string[] expected"; + } + if (message["default"] != null && message.hasOwnProperty("default")) { + var error = $root.google.protobuf.Value.verify(message["default"]); + if (error) + return "default." + error; + } + if (message.ref != null && message.hasOwnProperty("ref")) + if (!$util.isString(message.ref)) + return "ref: string expected"; + if (message.defs != null && message.hasOwnProperty("defs")) { + if (!$util.isObject(message.defs)) + return "defs: object expected"; + var key = Object.keys(message.defs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1.Schema.verify(message.defs[key[i]]); + if (error) + return "defs." + error; + } + } + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.minItems != null && message.hasOwnProperty("minItems")) + if (!$util.isInteger(message.minItems) && !(message.minItems && $util.isInteger(message.minItems.low) && $util.isInteger(message.minItems.high))) + return "minItems: integer|Long expected"; + if (message.maxItems != null && message.hasOwnProperty("maxItems")) + if (!$util.isInteger(message.maxItems) && !(message.maxItems && $util.isInteger(message.maxItems.low) && $util.isInteger(message.maxItems.high))) + return "maxItems: integer|Long expected"; + if (message.minimum != null && message.hasOwnProperty("minimum")) { + properties._minimum = 1; + if (typeof message.minimum !== "number") + return "minimum: number expected"; + } + if (message.maximum != null && message.hasOwnProperty("maximum")) { + properties._maximum = 1; + if (typeof message.maximum !== "number") + return "maximum: number expected"; + } + return null; + }; + + /** + * Creates a Schema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Schema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Schema} Schema + */ + Schema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Schema) + return object; + var message = new $root.google.cloud.ces.v1.Schema(); + 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 "STRING": + case 1: + message.type = 1; + break; + case "INTEGER": + case 2: + message.type = 2; + break; + case "NUMBER": + case 3: + message.type = 3; + break; + case "BOOLEAN": + case 4: + message.type = 4; + break; + case "OBJECT": + case 5: + message.type = 5; + break; + case "ARRAY": + case 6: + message.type = 6; + break; + } + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.ces.v1.Schema.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1.Schema.properties: object expected"); + message.properties[keys[i]] = $root.google.cloud.ces.v1.Schema.fromObject(object.properties[keys[i]]); + } + } + if (object.required) { + if (!Array.isArray(object.required)) + throw TypeError(".google.cloud.ces.v1.Schema.required: array expected"); + message.required = []; + for (var i = 0; i < object.required.length; ++i) + message.required[i] = String(object.required[i]); + } + if (object.description != null) + message.description = String(object.description); + if (object.items != null) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.ces.v1.Schema.items: object expected"); + message.items = $root.google.cloud.ces.v1.Schema.fromObject(object.items); + } + if (object.nullable != null) + message.nullable = Boolean(object.nullable); + if (object.uniqueItems != null) + message.uniqueItems = Boolean(object.uniqueItems); + if (object.prefixItems) { + if (!Array.isArray(object.prefixItems)) + throw TypeError(".google.cloud.ces.v1.Schema.prefixItems: array expected"); + message.prefixItems = []; + for (var i = 0; i < object.prefixItems.length; ++i) { + if (typeof object.prefixItems[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Schema.prefixItems: object expected"); + message.prefixItems[i] = $root.google.cloud.ces.v1.Schema.fromObject(object.prefixItems[i]); + } + } + if (object.additionalProperties != null) { + if (typeof object.additionalProperties !== "object") + throw TypeError(".google.cloud.ces.v1.Schema.additionalProperties: object expected"); + message.additionalProperties = $root.google.cloud.ces.v1.Schema.fromObject(object.additionalProperties); + } + if (object.anyOf) { + if (!Array.isArray(object.anyOf)) + throw TypeError(".google.cloud.ces.v1.Schema.anyOf: array expected"); + message.anyOf = []; + for (var i = 0; i < object.anyOf.length; ++i) { + if (typeof object.anyOf[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Schema.anyOf: object expected"); + message.anyOf[i] = $root.google.cloud.ces.v1.Schema.fromObject(object.anyOf[i]); + } + } + if (object["enum"]) { + if (!Array.isArray(object["enum"])) + throw TypeError(".google.cloud.ces.v1.Schema.enum: array expected"); + message["enum"] = []; + for (var i = 0; i < object["enum"].length; ++i) + message["enum"][i] = String(object["enum"][i]); + } + if (object["default"] != null) { + if (typeof object["default"] !== "object") + throw TypeError(".google.cloud.ces.v1.Schema.default: object expected"); + message["default"] = $root.google.protobuf.Value.fromObject(object["default"]); + } + if (object.ref != null) + message.ref = String(object.ref); + if (object.defs) { + if (typeof object.defs !== "object") + throw TypeError(".google.cloud.ces.v1.Schema.defs: object expected"); + message.defs = {}; + for (var keys = Object.keys(object.defs), i = 0; i < keys.length; ++i) { + if (typeof object.defs[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1.Schema.defs: object expected"); + message.defs[keys[i]] = $root.google.cloud.ces.v1.Schema.fromObject(object.defs[keys[i]]); + } + } + if (object.title != null) + message.title = String(object.title); + if (object.minItems != null) + if ($util.Long) + (message.minItems = $util.Long.fromValue(object.minItems)).unsigned = false; + else if (typeof object.minItems === "string") + message.minItems = parseInt(object.minItems, 10); + else if (typeof object.minItems === "number") + message.minItems = object.minItems; + else if (typeof object.minItems === "object") + message.minItems = new $util.LongBits(object.minItems.low >>> 0, object.minItems.high >>> 0).toNumber(); + if (object.maxItems != null) + if ($util.Long) + (message.maxItems = $util.Long.fromValue(object.maxItems)).unsigned = false; + else if (typeof object.maxItems === "string") + message.maxItems = parseInt(object.maxItems, 10); + else if (typeof object.maxItems === "number") + message.maxItems = object.maxItems; + else if (typeof object.maxItems === "object") + message.maxItems = new $util.LongBits(object.maxItems.low >>> 0, object.maxItems.high >>> 0).toNumber(); + if (object.minimum != null) + message.minimum = Number(object.minimum); + if (object.maximum != null) + message.maximum = Number(object.maximum); + return message; + }; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Schema + * @static + * @param {google.cloud.ces.v1.Schema} message Schema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Schema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.required = []; + object.prefixItems = []; + object.anyOf = []; + object["enum"] = []; + } + if (options.objects || options.defaults) { + object.properties = {}; + object.defs = {}; + } + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.description = ""; + object.items = null; + object.nullable = false; + object.uniqueItems = false; + object.additionalProperties = null; + object["default"] = null; + object.ref = ""; + object.title = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.minItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.minItems = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxItems = options.longs === String ? "0" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.ces.v1.Schema.Type[message.type] === undefined ? message.type : $root.google.cloud.ces.v1.Schema.Type[message.type] : message.type; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.cloud.ces.v1.Schema.toObject(message.properties[keys2[j]], options); + } + if (message.required && message.required.length) { + object.required = []; + for (var j = 0; j < message.required.length; ++j) + object.required[j] = message.required[j]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.items != null && message.hasOwnProperty("items")) + object.items = $root.google.cloud.ces.v1.Schema.toObject(message.items, options); + if (message.nullable != null && message.hasOwnProperty("nullable")) + object.nullable = message.nullable; + if (message.uniqueItems != null && message.hasOwnProperty("uniqueItems")) + object.uniqueItems = message.uniqueItems; + if (message.prefixItems && message.prefixItems.length) { + object.prefixItems = []; + for (var j = 0; j < message.prefixItems.length; ++j) + object.prefixItems[j] = $root.google.cloud.ces.v1.Schema.toObject(message.prefixItems[j], options); + } + if (message.additionalProperties != null && message.hasOwnProperty("additionalProperties")) + object.additionalProperties = $root.google.cloud.ces.v1.Schema.toObject(message.additionalProperties, options); + if (message.anyOf && message.anyOf.length) { + object.anyOf = []; + for (var j = 0; j < message.anyOf.length; ++j) + object.anyOf[j] = $root.google.cloud.ces.v1.Schema.toObject(message.anyOf[j], options); + } + if (message["enum"] && message["enum"].length) { + object["enum"] = []; + for (var j = 0; j < message["enum"].length; ++j) + object["enum"][j] = message["enum"][j]; + } + if (message["default"] != null && message.hasOwnProperty("default")) + object["default"] = $root.google.protobuf.Value.toObject(message["default"], options); + if (message.ref != null && message.hasOwnProperty("ref")) + object.ref = message.ref; + if (message.defs && (keys2 = Object.keys(message.defs)).length) { + object.defs = {}; + for (var j = 0; j < keys2.length; ++j) + object.defs[keys2[j]] = $root.google.cloud.ces.v1.Schema.toObject(message.defs[keys2[j]], options); + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.minItems != null && message.hasOwnProperty("minItems")) + if (typeof message.minItems === "number") + object.minItems = options.longs === String ? String(message.minItems) : message.minItems; + else + object.minItems = options.longs === String ? $util.Long.prototype.toString.call(message.minItems) : options.longs === Number ? new $util.LongBits(message.minItems.low >>> 0, message.minItems.high >>> 0).toNumber() : message.minItems; + if (message.maxItems != null && message.hasOwnProperty("maxItems")) + if (typeof message.maxItems === "number") + object.maxItems = options.longs === String ? String(message.maxItems) : message.maxItems; + else + object.maxItems = options.longs === String ? $util.Long.prototype.toString.call(message.maxItems) : options.longs === Number ? new $util.LongBits(message.maxItems.low >>> 0, message.maxItems.high >>> 0).toNumber() : message.maxItems; + if (message.minimum != null && message.hasOwnProperty("minimum")) { + object.minimum = options.json && !isFinite(message.minimum) ? String(message.minimum) : message.minimum; + if (options.oneofs) + object._minimum = "minimum"; + } + if (message.maximum != null && message.hasOwnProperty("maximum")) { + object.maximum = options.json && !isFinite(message.maximum) ? String(message.maximum) : message.maximum; + if (options.oneofs) + object._maximum = "maximum"; + } + return object; + }; + + /** + * Converts this Schema to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Schema + * @instance + * @returns {Object.} JSON object + */ + Schema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Schema + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Schema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Schema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Schema"; + }; + + /** + * Type enum. + * @name google.cloud.ces.v1.Schema.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} INTEGER=2 INTEGER value + * @property {number} NUMBER=3 NUMBER value + * @property {number} BOOLEAN=4 BOOLEAN value + * @property {number} OBJECT=5 OBJECT value + * @property {number} ARRAY=6 ARRAY value + */ + Schema.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "INTEGER"] = 2; + values[valuesById[3] = "NUMBER"] = 3; + values[valuesById[4] = "BOOLEAN"] = 4; + values[valuesById[5] = "OBJECT"] = 5; + values[valuesById[6] = "ARRAY"] = 6; + return values; + })(); + + return Schema; + })(); + + v1.AppSnapshot = (function() { + + /** + * Properties of an AppSnapshot. + * @memberof google.cloud.ces.v1 + * @interface IAppSnapshot + * @property {google.cloud.ces.v1.IApp|null} [app] AppSnapshot app + * @property {Array.|null} [agents] AppSnapshot agents + * @property {Array.|null} [tools] AppSnapshot tools + * @property {Array.|null} [examples] AppSnapshot examples + * @property {Array.|null} [guardrails] AppSnapshot guardrails + * @property {Array.|null} [toolsets] AppSnapshot toolsets + */ + + /** + * Constructs a new AppSnapshot. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an AppSnapshot. + * @implements IAppSnapshot + * @constructor + * @param {google.cloud.ces.v1.IAppSnapshot=} [properties] Properties to set + */ + function AppSnapshot(properties) { + this.agents = []; + this.tools = []; + this.examples = []; + this.guardrails = []; + this.toolsets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppSnapshot app. + * @member {google.cloud.ces.v1.IApp|null|undefined} app + * @memberof google.cloud.ces.v1.AppSnapshot + * @instance + */ + AppSnapshot.prototype.app = null; + + /** + * AppSnapshot agents. + * @member {Array.} agents + * @memberof google.cloud.ces.v1.AppSnapshot + * @instance + */ + AppSnapshot.prototype.agents = $util.emptyArray; + + /** + * AppSnapshot tools. + * @member {Array.} tools + * @memberof google.cloud.ces.v1.AppSnapshot + * @instance + */ + AppSnapshot.prototype.tools = $util.emptyArray; + + /** + * AppSnapshot examples. + * @member {Array.} examples + * @memberof google.cloud.ces.v1.AppSnapshot + * @instance + */ + AppSnapshot.prototype.examples = $util.emptyArray; + + /** + * AppSnapshot guardrails. + * @member {Array.} guardrails + * @memberof google.cloud.ces.v1.AppSnapshot + * @instance + */ + AppSnapshot.prototype.guardrails = $util.emptyArray; + + /** + * AppSnapshot toolsets. + * @member {Array.} toolsets + * @memberof google.cloud.ces.v1.AppSnapshot + * @instance + */ + AppSnapshot.prototype.toolsets = $util.emptyArray; + + /** + * Creates a new AppSnapshot instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.AppSnapshot + * @static + * @param {google.cloud.ces.v1.IAppSnapshot=} [properties] Properties to set + * @returns {google.cloud.ces.v1.AppSnapshot} AppSnapshot instance + */ + AppSnapshot.create = function create(properties) { + return new AppSnapshot(properties); + }; + + /** + * Encodes the specified AppSnapshot message. Does not implicitly {@link google.cloud.ces.v1.AppSnapshot.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.AppSnapshot + * @static + * @param {google.cloud.ces.v1.IAppSnapshot} message AppSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppSnapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + $root.google.cloud.ces.v1.App.encode(message.app, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.agents != null && message.agents.length) + for (var i = 0; i < message.agents.length; ++i) + $root.google.cloud.ces.v1.Agent.encode(message.agents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + $root.google.cloud.ces.v1.Tool.encode(message.tools[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.examples != null && message.examples.length) + for (var i = 0; i < message.examples.length; ++i) + $root.google.cloud.ces.v1.Example.encode(message.examples[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.guardrails != null && message.guardrails.length) + for (var i = 0; i < message.guardrails.length; ++i) + $root.google.cloud.ces.v1.Guardrail.encode(message.guardrails[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.toolsets != null && message.toolsets.length) + for (var i = 0; i < message.toolsets.length; ++i) + $root.google.cloud.ces.v1.Toolset.encode(message.toolsets[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AppSnapshot message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AppSnapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.AppSnapshot + * @static + * @param {google.cloud.ces.v1.IAppSnapshot} message AppSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppSnapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppSnapshot message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.AppSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.AppSnapshot} AppSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppSnapshot.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.AppSnapshot(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.app = $root.google.cloud.ces.v1.App.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.agents && message.agents.length)) + message.agents = []; + message.agents.push($root.google.cloud.ces.v1.Agent.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push($root.google.cloud.ces.v1.Tool.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.examples && message.examples.length)) + message.examples = []; + message.examples.push($root.google.cloud.ces.v1.Example.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.guardrails && message.guardrails.length)) + message.guardrails = []; + message.guardrails.push($root.google.cloud.ces.v1.Guardrail.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.toolsets && message.toolsets.length)) + message.toolsets = []; + message.toolsets.push($root.google.cloud.ces.v1.Toolset.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AppSnapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.AppSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.AppSnapshot} AppSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppSnapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppSnapshot message. + * @function verify + * @memberof google.cloud.ces.v1.AppSnapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppSnapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.app != null && message.hasOwnProperty("app")) { + var error = $root.google.cloud.ces.v1.App.verify(message.app); + if (error) + return "app." + error; + } + if (message.agents != null && message.hasOwnProperty("agents")) { + if (!Array.isArray(message.agents)) + return "agents: array expected"; + for (var i = 0; i < message.agents.length; ++i) { + var error = $root.google.cloud.ces.v1.Agent.verify(message.agents[i]); + if (error) + return "agents." + error; + } + } + if (message.tools != null && message.hasOwnProperty("tools")) { + if (!Array.isArray(message.tools)) + return "tools: array expected"; + for (var i = 0; i < message.tools.length; ++i) { + var error = $root.google.cloud.ces.v1.Tool.verify(message.tools[i]); + if (error) + return "tools." + error; + } + } + if (message.examples != null && message.hasOwnProperty("examples")) { + if (!Array.isArray(message.examples)) + return "examples: array expected"; + for (var i = 0; i < message.examples.length; ++i) { + var error = $root.google.cloud.ces.v1.Example.verify(message.examples[i]); + if (error) + return "examples." + error; + } + } + if (message.guardrails != null && message.hasOwnProperty("guardrails")) { + if (!Array.isArray(message.guardrails)) + return "guardrails: array expected"; + for (var i = 0; i < message.guardrails.length; ++i) { + var error = $root.google.cloud.ces.v1.Guardrail.verify(message.guardrails[i]); + if (error) + return "guardrails." + error; + } + } + if (message.toolsets != null && message.hasOwnProperty("toolsets")) { + if (!Array.isArray(message.toolsets)) + return "toolsets: array expected"; + for (var i = 0; i < message.toolsets.length; ++i) { + var error = $root.google.cloud.ces.v1.Toolset.verify(message.toolsets[i]); + if (error) + return "toolsets." + error; + } + } + return null; + }; + + /** + * Creates an AppSnapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.AppSnapshot + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.AppSnapshot} AppSnapshot + */ + AppSnapshot.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.AppSnapshot) + return object; + var message = new $root.google.cloud.ces.v1.AppSnapshot(); + if (object.app != null) { + if (typeof object.app !== "object") + throw TypeError(".google.cloud.ces.v1.AppSnapshot.app: object expected"); + message.app = $root.google.cloud.ces.v1.App.fromObject(object.app); + } + if (object.agents) { + if (!Array.isArray(object.agents)) + throw TypeError(".google.cloud.ces.v1.AppSnapshot.agents: array expected"); + message.agents = []; + for (var i = 0; i < object.agents.length; ++i) { + if (typeof object.agents[i] !== "object") + throw TypeError(".google.cloud.ces.v1.AppSnapshot.agents: object expected"); + message.agents[i] = $root.google.cloud.ces.v1.Agent.fromObject(object.agents[i]); + } + } + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.cloud.ces.v1.AppSnapshot.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) { + if (typeof object.tools[i] !== "object") + throw TypeError(".google.cloud.ces.v1.AppSnapshot.tools: object expected"); + message.tools[i] = $root.google.cloud.ces.v1.Tool.fromObject(object.tools[i]); + } + } + if (object.examples) { + if (!Array.isArray(object.examples)) + throw TypeError(".google.cloud.ces.v1.AppSnapshot.examples: array expected"); + message.examples = []; + for (var i = 0; i < object.examples.length; ++i) { + if (typeof object.examples[i] !== "object") + throw TypeError(".google.cloud.ces.v1.AppSnapshot.examples: object expected"); + message.examples[i] = $root.google.cloud.ces.v1.Example.fromObject(object.examples[i]); + } + } + if (object.guardrails) { + if (!Array.isArray(object.guardrails)) + throw TypeError(".google.cloud.ces.v1.AppSnapshot.guardrails: array expected"); + message.guardrails = []; + for (var i = 0; i < object.guardrails.length; ++i) { + if (typeof object.guardrails[i] !== "object") + throw TypeError(".google.cloud.ces.v1.AppSnapshot.guardrails: object expected"); + message.guardrails[i] = $root.google.cloud.ces.v1.Guardrail.fromObject(object.guardrails[i]); + } + } + if (object.toolsets) { + if (!Array.isArray(object.toolsets)) + throw TypeError(".google.cloud.ces.v1.AppSnapshot.toolsets: array expected"); + message.toolsets = []; + for (var i = 0; i < object.toolsets.length; ++i) { + if (typeof object.toolsets[i] !== "object") + throw TypeError(".google.cloud.ces.v1.AppSnapshot.toolsets: object expected"); + message.toolsets[i] = $root.google.cloud.ces.v1.Toolset.fromObject(object.toolsets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AppSnapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.AppSnapshot + * @static + * @param {google.cloud.ces.v1.AppSnapshot} message AppSnapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppSnapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.agents = []; + object.tools = []; + object.examples = []; + object.guardrails = []; + object.toolsets = []; + } + if (options.defaults) + object.app = null; + if (message.app != null && message.hasOwnProperty("app")) + object.app = $root.google.cloud.ces.v1.App.toObject(message.app, options); + if (message.agents && message.agents.length) { + object.agents = []; + for (var j = 0; j < message.agents.length; ++j) + object.agents[j] = $root.google.cloud.ces.v1.Agent.toObject(message.agents[j], options); + } + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = $root.google.cloud.ces.v1.Tool.toObject(message.tools[j], options); + } + if (message.examples && message.examples.length) { + object.examples = []; + for (var j = 0; j < message.examples.length; ++j) + object.examples[j] = $root.google.cloud.ces.v1.Example.toObject(message.examples[j], options); + } + if (message.guardrails && message.guardrails.length) { + object.guardrails = []; + for (var j = 0; j < message.guardrails.length; ++j) + object.guardrails[j] = $root.google.cloud.ces.v1.Guardrail.toObject(message.guardrails[j], options); + } + if (message.toolsets && message.toolsets.length) { + object.toolsets = []; + for (var j = 0; j < message.toolsets.length; ++j) + object.toolsets[j] = $root.google.cloud.ces.v1.Toolset.toObject(message.toolsets[j], options); + } + return object; + }; + + /** + * Converts this AppSnapshot to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.AppSnapshot + * @instance + * @returns {Object.} JSON object + */ + AppSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AppSnapshot + * @function getTypeUrl + * @memberof google.cloud.ces.v1.AppSnapshot + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.AppSnapshot"; + }; + + return AppSnapshot; + })(); + + v1.AppVersion = (function() { + + /** + * Properties of an AppVersion. + * @memberof google.cloud.ces.v1 + * @interface IAppVersion + * @property {string|null} [name] AppVersion name + * @property {string|null} [displayName] AppVersion displayName + * @property {string|null} [description] AppVersion description + * @property {string|null} [creator] AppVersion creator + * @property {google.protobuf.ITimestamp|null} [createTime] AppVersion createTime + * @property {google.cloud.ces.v1.IAppSnapshot|null} [snapshot] AppVersion snapshot + * @property {string|null} [etag] AppVersion etag + */ + + /** + * Constructs a new AppVersion. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an AppVersion. + * @implements IAppVersion + * @constructor + * @param {google.cloud.ces.v1.IAppVersion=} [properties] Properties to set + */ + function AppVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppVersion name. + * @member {string} name + * @memberof google.cloud.ces.v1.AppVersion + * @instance + */ + AppVersion.prototype.name = ""; + + /** + * AppVersion displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1.AppVersion + * @instance + */ + AppVersion.prototype.displayName = ""; + + /** + * AppVersion description. + * @member {string} description + * @memberof google.cloud.ces.v1.AppVersion + * @instance + */ + AppVersion.prototype.description = ""; + + /** + * AppVersion creator. + * @member {string} creator + * @memberof google.cloud.ces.v1.AppVersion + * @instance + */ + AppVersion.prototype.creator = ""; + + /** + * AppVersion createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1.AppVersion + * @instance + */ + AppVersion.prototype.createTime = null; + + /** + * AppVersion snapshot. + * @member {google.cloud.ces.v1.IAppSnapshot|null|undefined} snapshot + * @memberof google.cloud.ces.v1.AppVersion + * @instance + */ + AppVersion.prototype.snapshot = null; + + /** + * AppVersion etag. + * @member {string} etag + * @memberof google.cloud.ces.v1.AppVersion + * @instance + */ + AppVersion.prototype.etag = ""; + + /** + * Creates a new AppVersion instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.AppVersion + * @static + * @param {google.cloud.ces.v1.IAppVersion=} [properties] Properties to set + * @returns {google.cloud.ces.v1.AppVersion} AppVersion instance + */ + AppVersion.create = function create(properties) { + return new AppVersion(properties); + }; + + /** + * Encodes the specified AppVersion message. Does not implicitly {@link google.cloud.ces.v1.AppVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.AppVersion + * @static + * @param {google.cloud.ces.v1.IAppVersion} message AppVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppVersion.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.creator); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + $root.google.cloud.ces.v1.AppSnapshot.encode(message.snapshot, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AppVersion message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AppVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.AppVersion + * @static + * @param {google.cloud.ces.v1.IAppVersion} message AppVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.AppVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.AppVersion} AppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppVersion.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.AppVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.creator = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.snapshot = $root.google.cloud.ces.v1.AppSnapshot.decode(reader, reader.uint32()); + break; + } + case 7: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AppVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.AppVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.AppVersion} AppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppVersion message. + * @function verify + * @memberof google.cloud.ces.v1.AppVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppVersion.verify = function verify(message) { + if (typeof message !== "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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: 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.snapshot != null && message.hasOwnProperty("snapshot")) { + var error = $root.google.cloud.ces.v1.AppSnapshot.verify(message.snapshot); + if (error) + return "snapshot." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an AppVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.AppVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.AppVersion} AppVersion + */ + AppVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.AppVersion) + return object; + var message = new $root.google.cloud.ces.v1.AppVersion(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.creator != null) + message.creator = String(object.creator); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1.AppVersion.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.snapshot != null) { + if (typeof object.snapshot !== "object") + throw TypeError(".google.cloud.ces.v1.AppVersion.snapshot: object expected"); + message.snapshot = $root.google.cloud.ces.v1.AppSnapshot.fromObject(object.snapshot); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an AppVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.AppVersion + * @static + * @param {google.cloud.ces.v1.AppVersion} message AppVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.creator = ""; + object.createTime = null; + object.etag = ""; + object.snapshot = 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = $root.google.cloud.ces.v1.AppSnapshot.toObject(message.snapshot, options); + return object; + }; + + /** + * Converts this AppVersion to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.AppVersion + * @instance + * @returns {Object.} JSON object + */ + AppVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AppVersion + * @function getTypeUrl + * @memberof google.cloud.ces.v1.AppVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.AppVersion"; + }; + + return AppVersion; + })(); + + v1.Example = (function() { + + /** + * Properties of an Example. + * @memberof google.cloud.ces.v1 + * @interface IExample + * @property {string|null} [name] Example name + * @property {string|null} [displayName] Example displayName + * @property {string|null} [description] Example description + * @property {string|null} [entryAgent] Example entryAgent + * @property {Array.|null} [messages] Example messages + * @property {google.protobuf.ITimestamp|null} [createTime] Example createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Example updateTime + * @property {boolean|null} [invalid] Example invalid + * @property {string|null} [etag] Example etag + */ + + /** + * Constructs a new Example. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an Example. + * @implements IExample + * @constructor + * @param {google.cloud.ces.v1.IExample=} [properties] Properties to set + */ + function Example(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Example name. + * @member {string} name + * @memberof google.cloud.ces.v1.Example + * @instance + */ + Example.prototype.name = ""; + + /** + * Example displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1.Example + * @instance + */ + Example.prototype.displayName = ""; + + /** + * Example description. + * @member {string} description + * @memberof google.cloud.ces.v1.Example + * @instance + */ + Example.prototype.description = ""; + + /** + * Example entryAgent. + * @member {string} entryAgent + * @memberof google.cloud.ces.v1.Example + * @instance + */ + Example.prototype.entryAgent = ""; + + /** + * Example messages. + * @member {Array.} messages + * @memberof google.cloud.ces.v1.Example + * @instance + */ + Example.prototype.messages = $util.emptyArray; + + /** + * Example createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1.Example + * @instance + */ + Example.prototype.createTime = null; + + /** + * Example updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1.Example + * @instance + */ + Example.prototype.updateTime = null; + + /** + * Example invalid. + * @member {boolean} invalid + * @memberof google.cloud.ces.v1.Example + * @instance + */ + Example.prototype.invalid = false; + + /** + * Example etag. + * @member {string} etag + * @memberof google.cloud.ces.v1.Example + * @instance + */ + Example.prototype.etag = ""; + + /** + * Creates a new Example instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Example + * @static + * @param {google.cloud.ces.v1.IExample=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Example} Example instance + */ + Example.create = function create(properties) { + return new Example(properties); + }; + + /** + * Encodes the specified Example message. Does not implicitly {@link google.cloud.ces.v1.Example.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Example + * @static + * @param {google.cloud.ces.v1.IExample} message Example message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Example.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.entryAgent != null && Object.hasOwnProperty.call(message, "entryAgent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.entryAgent); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.ces.v1.Message.encode(message.messages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.invalid != null && Object.hasOwnProperty.call(message, "invalid")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.invalid); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + return writer; + }; + + /** + * Encodes the specified Example message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Example.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Example + * @static + * @param {google.cloud.ces.v1.IExample} message Example message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Example.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Example message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Example + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Example} Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Example.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Example(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.entryAgent = reader.string(); + break; + } + case 5: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.ces.v1.Message.decode(reader, reader.uint32())); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.invalid = reader.bool(); + break; + } + case 9: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Example message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Example + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Example} Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Example.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Example message. + * @function verify + * @memberof google.cloud.ces.v1.Example + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Example.verify = function verify(message) { + if (typeof message !== "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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) + if (!$util.isString(message.entryAgent)) + return "entryAgent: string expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.ces.v1.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + 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.invalid != null && message.hasOwnProperty("invalid")) + if (typeof message.invalid !== "boolean") + return "invalid: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an Example message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Example + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Example} Example + */ + Example.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Example) + return object; + var message = new $root.google.cloud.ces.v1.Example(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.entryAgent != null) + message.entryAgent = String(object.entryAgent); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.ces.v1.Example.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Example.messages: object expected"); + message.messages[i] = $root.google.cloud.ces.v1.Message.fromObject(object.messages[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1.Example.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.ces.v1.Example.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.invalid != null) + message.invalid = Boolean(object.invalid); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an Example message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Example + * @static + * @param {google.cloud.ces.v1.Example} message Example + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Example.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.entryAgent = ""; + object.createTime = null; + object.updateTime = null; + object.invalid = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) + object.entryAgent = message.entryAgent; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.ces.v1.Message.toObject(message.messages[j], options); + } + 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.invalid != null && message.hasOwnProperty("invalid")) + object.invalid = message.invalid; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this Example to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Example + * @instance + * @returns {Object.} JSON object + */ + Example.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Example + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Example + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Example.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Example"; + }; + + return Example; + })(); + + v1.Message = (function() { + + /** + * Properties of a Message. + * @memberof google.cloud.ces.v1 + * @interface IMessage + * @property {string|null} [role] Message role + * @property {Array.|null} [chunks] Message chunks + * @property {google.protobuf.ITimestamp|null} [eventTime] Message eventTime + */ + + /** + * Constructs a new Message. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a Message. + * @implements IMessage + * @constructor + * @param {google.cloud.ces.v1.IMessage=} [properties] Properties to set + */ + function Message(properties) { + this.chunks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Message role. + * @member {string} role + * @memberof google.cloud.ces.v1.Message + * @instance + */ + Message.prototype.role = ""; + + /** + * Message chunks. + * @member {Array.} chunks + * @memberof google.cloud.ces.v1.Message + * @instance + */ + Message.prototype.chunks = $util.emptyArray; + + /** + * Message eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.ces.v1.Message + * @instance + */ + Message.prototype.eventTime = null; + + /** + * Creates a new Message instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Message + * @static + * @param {google.cloud.ces.v1.IMessage=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Message} Message instance + */ + Message.create = function create(properties) { + return new Message(properties); + }; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.ces.v1.Message.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Message + * @static + * @param {google.cloud.ces.v1.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.chunks != null && message.chunks.length) + for (var i = 0; i < message.chunks.length; ++i) + $root.google.cloud.ces.v1.Chunk.encode(message.chunks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Message.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Message + * @static + * @param {google.cloud.ces.v1.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Message message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Message(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.chunks && message.chunks.length)) + message.chunks = []; + message.chunks.push($root.google.cloud.ces.v1.Chunk.decode(reader, reader.uint32())); + break; + } + case 4: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Message message. + * @function verify + * @memberof google.cloud.ces.v1.Message + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Message.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.chunks != null && message.hasOwnProperty("chunks")) { + if (!Array.isArray(message.chunks)) + return "chunks: array expected"; + for (var i = 0; i < message.chunks.length; ++i) { + var error = $root.google.cloud.ces.v1.Chunk.verify(message.chunks[i]); + if (error) + return "chunks." + error; + } + } + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + return null; + }; + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Message + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Message} Message + */ + Message.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Message) + return object; + var message = new $root.google.cloud.ces.v1.Message(); + if (object.role != null) + message.role = String(object.role); + if (object.chunks) { + if (!Array.isArray(object.chunks)) + throw TypeError(".google.cloud.ces.v1.Message.chunks: array expected"); + message.chunks = []; + for (var i = 0; i < object.chunks.length; ++i) { + if (typeof object.chunks[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Message.chunks: object expected"); + message.chunks[i] = $root.google.cloud.ces.v1.Chunk.fromObject(object.chunks[i]); + } + } + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.ces.v1.Message.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + return message; + }; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Message + * @static + * @param {google.cloud.ces.v1.Message} message Message + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Message.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.chunks = []; + if (options.defaults) { + object.role = ""; + object.eventTime = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.chunks && message.chunks.length) { + object.chunks = []; + for (var j = 0; j < message.chunks.length; ++j) + object.chunks[j] = $root.google.cloud.ces.v1.Chunk.toObject(message.chunks[j], options); + } + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + return object; + }; + + /** + * Converts this Message to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Message + * @instance + * @returns {Object.} JSON object + */ + Message.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Message + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Message + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Message"; + }; + + return Message; + })(); + + v1.Chunk = (function() { + + /** + * Properties of a Chunk. + * @memberof google.cloud.ces.v1 + * @interface IChunk + * @property {string|null} [text] Chunk text + * @property {string|null} [transcript] Chunk transcript + * @property {google.protobuf.IStruct|null} [payload] Chunk payload + * @property {google.cloud.ces.v1.IImage|null} [image] Chunk image + * @property {google.cloud.ces.v1.IToolCall|null} [toolCall] Chunk toolCall + * @property {google.cloud.ces.v1.IToolResponse|null} [toolResponse] Chunk toolResponse + * @property {google.cloud.ces.v1.IAgentTransfer|null} [agentTransfer] Chunk agentTransfer + * @property {google.protobuf.IStruct|null} [updatedVariables] Chunk updatedVariables + * @property {google.protobuf.IStruct|null} [defaultVariables] Chunk defaultVariables + */ + + /** + * Constructs a new Chunk. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a Chunk. + * @implements IChunk + * @constructor + * @param {google.cloud.ces.v1.IChunk=} [properties] Properties to set + */ + function Chunk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Chunk text. + * @member {string|null|undefined} text + * @memberof google.cloud.ces.v1.Chunk + * @instance + */ + Chunk.prototype.text = null; + + /** + * Chunk transcript. + * @member {string|null|undefined} transcript + * @memberof google.cloud.ces.v1.Chunk + * @instance + */ + Chunk.prototype.transcript = null; + + /** + * Chunk payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.ces.v1.Chunk + * @instance + */ + Chunk.prototype.payload = null; + + /** + * Chunk image. + * @member {google.cloud.ces.v1.IImage|null|undefined} image + * @memberof google.cloud.ces.v1.Chunk + * @instance + */ + Chunk.prototype.image = null; + + /** + * Chunk toolCall. + * @member {google.cloud.ces.v1.IToolCall|null|undefined} toolCall + * @memberof google.cloud.ces.v1.Chunk + * @instance + */ + Chunk.prototype.toolCall = null; + + /** + * Chunk toolResponse. + * @member {google.cloud.ces.v1.IToolResponse|null|undefined} toolResponse + * @memberof google.cloud.ces.v1.Chunk + * @instance + */ + Chunk.prototype.toolResponse = null; + + /** + * Chunk agentTransfer. + * @member {google.cloud.ces.v1.IAgentTransfer|null|undefined} agentTransfer + * @memberof google.cloud.ces.v1.Chunk + * @instance + */ + Chunk.prototype.agentTransfer = null; + + /** + * Chunk updatedVariables. + * @member {google.protobuf.IStruct|null|undefined} updatedVariables + * @memberof google.cloud.ces.v1.Chunk + * @instance + */ + Chunk.prototype.updatedVariables = null; + + /** + * Chunk defaultVariables. + * @member {google.protobuf.IStruct|null|undefined} defaultVariables + * @memberof google.cloud.ces.v1.Chunk + * @instance + */ + Chunk.prototype.defaultVariables = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Chunk data. + * @member {"text"|"transcript"|"payload"|"image"|"toolCall"|"toolResponse"|"agentTransfer"|"updatedVariables"|"defaultVariables"|undefined} data + * @memberof google.cloud.ces.v1.Chunk + * @instance + */ + Object.defineProperty(Chunk.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["text", "transcript", "payload", "image", "toolCall", "toolResponse", "agentTransfer", "updatedVariables", "defaultVariables"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Chunk instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Chunk + * @static + * @param {google.cloud.ces.v1.IChunk=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Chunk} Chunk instance + */ + Chunk.create = function create(properties) { + return new Chunk(properties); + }; + + /** + * Encodes the specified Chunk message. Does not implicitly {@link google.cloud.ces.v1.Chunk.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Chunk + * @static + * @param {google.cloud.ces.v1.IChunk} message Chunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.toolCall != null && Object.hasOwnProperty.call(message, "toolCall")) + $root.google.cloud.ces.v1.ToolCall.encode(message.toolCall, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolResponse != null && Object.hasOwnProperty.call(message, "toolResponse")) + $root.google.cloud.ces.v1.ToolResponse.encode(message.toolResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.agentTransfer != null && Object.hasOwnProperty.call(message, "agentTransfer")) + $root.google.cloud.ces.v1.AgentTransfer.encode(message.agentTransfer, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.ces.v1.Image.encode(message.image, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updatedVariables != null && Object.hasOwnProperty.call(message, "updatedVariables")) + $root.google.protobuf.Struct.encode(message.updatedVariables, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.transcript); + if (message.defaultVariables != null && Object.hasOwnProperty.call(message, "defaultVariables")) + $root.google.protobuf.Struct.encode(message.defaultVariables, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Chunk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Chunk + * @static + * @param {google.cloud.ces.v1.IChunk} message Chunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Chunk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Chunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Chunk} Chunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chunk.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Chunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 9: { + message.transcript = reader.string(); + break; + } + case 11: { + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 5: { + message.image = $root.google.cloud.ces.v1.Image.decode(reader, reader.uint32()); + break; + } + case 2: { + message.toolCall = $root.google.cloud.ces.v1.ToolCall.decode(reader, reader.uint32()); + break; + } + case 3: { + message.toolResponse = $root.google.cloud.ces.v1.ToolResponse.decode(reader, reader.uint32()); + break; + } + case 4: { + message.agentTransfer = $root.google.cloud.ces.v1.AgentTransfer.decode(reader, reader.uint32()); + break; + } + case 8: { + message.updatedVariables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 10: { + message.defaultVariables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Chunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Chunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Chunk} Chunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Chunk message. + * @function verify + * @memberof google.cloud.ces.v1.Chunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Chunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.data = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.protobuf.Struct.verify(message.payload); + if (error) + return "payload." + error; + } + } + if (message.image != null && message.hasOwnProperty("image")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.ces.v1.Image.verify(message.image); + if (error) + return "image." + error; + } + } + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.ces.v1.ToolCall.verify(message.toolCall); + if (error) + return "toolCall." + error; + } + } + if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.ces.v1.ToolResponse.verify(message.toolResponse); + if (error) + return "toolResponse." + error; + } + } + if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.ces.v1.AgentTransfer.verify(message.agentTransfer); + if (error) + return "agentTransfer." + error; + } + } + if (message.updatedVariables != null && message.hasOwnProperty("updatedVariables")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.protobuf.Struct.verify(message.updatedVariables); + if (error) + return "updatedVariables." + error; + } + } + if (message.defaultVariables != null && message.hasOwnProperty("defaultVariables")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.protobuf.Struct.verify(message.defaultVariables); + if (error) + return "defaultVariables." + error; + } + } + return null; + }; + + /** + * Creates a Chunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Chunk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Chunk} Chunk + */ + Chunk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Chunk) + return object; + var message = new $root.google.cloud.ces.v1.Chunk(); + if (object.text != null) + message.text = String(object.text); + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.ces.v1.Chunk.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload); + } + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.ces.v1.Chunk.image: object expected"); + message.image = $root.google.cloud.ces.v1.Image.fromObject(object.image); + } + if (object.toolCall != null) { + if (typeof object.toolCall !== "object") + throw TypeError(".google.cloud.ces.v1.Chunk.toolCall: object expected"); + message.toolCall = $root.google.cloud.ces.v1.ToolCall.fromObject(object.toolCall); + } + if (object.toolResponse != null) { + if (typeof object.toolResponse !== "object") + throw TypeError(".google.cloud.ces.v1.Chunk.toolResponse: object expected"); + message.toolResponse = $root.google.cloud.ces.v1.ToolResponse.fromObject(object.toolResponse); + } + if (object.agentTransfer != null) { + if (typeof object.agentTransfer !== "object") + throw TypeError(".google.cloud.ces.v1.Chunk.agentTransfer: object expected"); + message.agentTransfer = $root.google.cloud.ces.v1.AgentTransfer.fromObject(object.agentTransfer); + } + if (object.updatedVariables != null) { + if (typeof object.updatedVariables !== "object") + throw TypeError(".google.cloud.ces.v1.Chunk.updatedVariables: object expected"); + message.updatedVariables = $root.google.protobuf.Struct.fromObject(object.updatedVariables); + } + if (object.defaultVariables != null) { + if (typeof object.defaultVariables !== "object") + throw TypeError(".google.cloud.ces.v1.Chunk.defaultVariables: object expected"); + message.defaultVariables = $root.google.protobuf.Struct.fromObject(object.defaultVariables); + } + return message; + }; + + /** + * Creates a plain object from a Chunk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Chunk + * @static + * @param {google.cloud.ces.v1.Chunk} message Chunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Chunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.data = "text"; + } + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + object.toolCall = $root.google.cloud.ces.v1.ToolCall.toObject(message.toolCall, options); + if (options.oneofs) + object.data = "toolCall"; + } + if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { + object.toolResponse = $root.google.cloud.ces.v1.ToolResponse.toObject(message.toolResponse, options); + if (options.oneofs) + object.data = "toolResponse"; + } + if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { + object.agentTransfer = $root.google.cloud.ces.v1.AgentTransfer.toObject(message.agentTransfer, options); + if (options.oneofs) + object.data = "agentTransfer"; + } + if (message.image != null && message.hasOwnProperty("image")) { + object.image = $root.google.cloud.ces.v1.Image.toObject(message.image, options); + if (options.oneofs) + object.data = "image"; + } + if (message.updatedVariables != null && message.hasOwnProperty("updatedVariables")) { + object.updatedVariables = $root.google.protobuf.Struct.toObject(message.updatedVariables, options); + if (options.oneofs) + object.data = "updatedVariables"; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) { + object.transcript = message.transcript; + if (options.oneofs) + object.data = "transcript"; + } + if (message.defaultVariables != null && message.hasOwnProperty("defaultVariables")) { + object.defaultVariables = $root.google.protobuf.Struct.toObject(message.defaultVariables, options); + if (options.oneofs) + object.data = "defaultVariables"; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (options.oneofs) + object.data = "payload"; + } + return object; + }; + + /** + * Converts this Chunk to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Chunk + * @instance + * @returns {Object.} JSON object + */ + Chunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Chunk + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Chunk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Chunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Chunk"; + }; + + return Chunk; + })(); + + v1.Blob = (function() { + + /** + * Properties of a Blob. + * @memberof google.cloud.ces.v1 + * @interface IBlob + * @property {string|null} [mimeType] Blob mimeType + * @property {Uint8Array|null} [data] Blob data + */ + + /** + * Constructs a new Blob. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a Blob. + * @implements IBlob + * @constructor + * @param {google.cloud.ces.v1.IBlob=} [properties] Properties to set + */ + function Blob(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Blob mimeType. + * @member {string} mimeType + * @memberof google.cloud.ces.v1.Blob + * @instance + */ + Blob.prototype.mimeType = ""; + + /** + * Blob data. + * @member {Uint8Array} data + * @memberof google.cloud.ces.v1.Blob + * @instance + */ + Blob.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Blob instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Blob + * @static + * @param {google.cloud.ces.v1.IBlob=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Blob} Blob instance + */ + Blob.create = function create(properties) { + return new Blob(properties); + }; + + /** + * Encodes the specified Blob message. Does not implicitly {@link google.cloud.ces.v1.Blob.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Blob + * @static + * @param {google.cloud.ces.v1.IBlob} message Blob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Blob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Blob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Blob + * @static + * @param {google.cloud.ces.v1.IBlob} message Blob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Blob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Blob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Blob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Blob} Blob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Blob.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Blob(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mimeType = reader.string(); + break; + } + case 2: { + message.data = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Blob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Blob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Blob} Blob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Blob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Blob message. + * @function verify + * @memberof google.cloud.ces.v1.Blob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Blob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates a Blob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Blob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Blob} Blob + */ + Blob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Blob) + return object; + var message = new $root.google.cloud.ces.v1.Blob(); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from a Blob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Blob + * @static + * @param {google.cloud.ces.v1.Blob} message Blob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Blob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mimeType = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this Blob to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Blob + * @instance + * @returns {Object.} JSON object + */ + Blob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Blob + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Blob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Blob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Blob"; + }; + + return Blob; + })(); + + v1.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.cloud.ces.v1 + * @interface IImage + * @property {string|null} [mimeType] Image mimeType + * @property {Uint8Array|null} [data] Image data + */ + + /** + * Constructs a new Image. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.ces.v1.IImage=} [properties] Properties to set + */ + function Image(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Image mimeType. + * @member {string} mimeType + * @memberof google.cloud.ces.v1.Image + * @instance + */ + Image.prototype.mimeType = ""; + + /** + * Image data. + * @member {Uint8Array} data + * @memberof google.cloud.ces.v1.Image + * @instance + */ + Image.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Image + * @static + * @param {google.cloud.ces.v1.IImage=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.ces.v1.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Image + * @static + * @param {google.cloud.ces.v1.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Image + * @static + * @param {google.cloud.ces.v1.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Image message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mimeType = reader.string(); + break; + } + case 2: { + message.data = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Image message. + * @function verify + * @memberof google.cloud.ces.v1.Image + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Image.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Image) + return object; + var message = new $root.google.cloud.ces.v1.Image(); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Image + * @static + * @param {google.cloud.ces.v1.Image} message Image + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Image.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mimeType = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Image + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Image + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Image.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Image"; + }; + + return Image; + })(); + + v1.ToolCall = (function() { + + /** + * Properties of a ToolCall. + * @memberof google.cloud.ces.v1 + * @interface IToolCall + * @property {string|null} [tool] ToolCall tool + * @property {google.cloud.ces.v1.IToolsetTool|null} [toolsetTool] ToolCall toolsetTool + * @property {string|null} [id] ToolCall id + * @property {string|null} [displayName] ToolCall displayName + * @property {google.protobuf.IStruct|null} [args] ToolCall args + */ + + /** + * Constructs a new ToolCall. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ToolCall. + * @implements IToolCall + * @constructor + * @param {google.cloud.ces.v1.IToolCall=} [properties] Properties to set + */ + function ToolCall(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolCall tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1.ToolCall + * @instance + */ + ToolCall.prototype.tool = null; + + /** + * ToolCall toolsetTool. + * @member {google.cloud.ces.v1.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1.ToolCall + * @instance + */ + ToolCall.prototype.toolsetTool = null; + + /** + * ToolCall id. + * @member {string} id + * @memberof google.cloud.ces.v1.ToolCall + * @instance + */ + ToolCall.prototype.id = ""; + + /** + * ToolCall displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1.ToolCall + * @instance + */ + ToolCall.prototype.displayName = ""; + + /** + * ToolCall args. + * @member {google.protobuf.IStruct|null|undefined} args + * @memberof google.cloud.ces.v1.ToolCall + * @instance + */ + ToolCall.prototype.args = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ToolCall toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1.ToolCall + * @instance + */ + Object.defineProperty(ToolCall.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ToolCall instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ToolCall + * @static + * @param {google.cloud.ces.v1.IToolCall=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ToolCall} ToolCall instance + */ + ToolCall.create = function create(properties) { + return new ToolCall(properties); + }; + + /** + * Encodes the specified ToolCall message. Does not implicitly {@link google.cloud.ces.v1.ToolCall.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ToolCall + * @static + * @param {google.cloud.ces.v1.IToolCall} message ToolCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCall.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tool); + if (message.args != null && Object.hasOwnProperty.call(message, "args")) + $root.google.protobuf.Struct.encode(message.args, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolCall message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolCall.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ToolCall + * @static + * @param {google.cloud.ces.v1.IToolCall} message ToolCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCall.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolCall message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ToolCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ToolCall} ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCall.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ToolCall(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.tool = reader.string(); + break; + } + case 5: { + message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 1: { + message.id = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 3: { + message.args = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolCall message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ToolCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ToolCall} ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCall.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolCall message. + * @function verify + * @memberof google.cloud.ces.v1.ToolCall + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolCall.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.args != null && message.hasOwnProperty("args")) { + var error = $root.google.protobuf.Struct.verify(message.args); + if (error) + return "args." + error; + } + return null; + }; + + /** + * Creates a ToolCall message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ToolCall + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ToolCall} ToolCall + */ + ToolCall.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ToolCall) + return object; + var message = new $root.google.cloud.ces.v1.ToolCall(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1.ToolCall.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.args != null) { + if (typeof object.args !== "object") + throw TypeError(".google.cloud.ces.v1.ToolCall.args: object expected"); + message.args = $root.google.protobuf.Struct.fromObject(object.args); + } + return message; + }; + + /** + * Creates a plain object from a ToolCall message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ToolCall + * @static + * @param {google.cloud.ces.v1.ToolCall} message ToolCall + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolCall.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.args = null; + object.displayName = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.args != null && message.hasOwnProperty("args")) + object.args = $root.google.protobuf.Struct.toObject(message.args, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + return object; + }; + + /** + * Converts this ToolCall to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ToolCall + * @instance + * @returns {Object.} JSON object + */ + ToolCall.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolCall + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ToolCall + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ToolCall"; + }; + + return ToolCall; + })(); + + v1.ToolResponse = (function() { + + /** + * Properties of a ToolResponse. + * @memberof google.cloud.ces.v1 + * @interface IToolResponse + * @property {string|null} [tool] ToolResponse tool + * @property {google.cloud.ces.v1.IToolsetTool|null} [toolsetTool] ToolResponse toolsetTool + * @property {string|null} [id] ToolResponse id + * @property {string|null} [displayName] ToolResponse displayName + * @property {google.protobuf.IStruct|null} [response] ToolResponse response + */ + + /** + * Constructs a new ToolResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ToolResponse. + * @implements IToolResponse + * @constructor + * @param {google.cloud.ces.v1.IToolResponse=} [properties] Properties to set + */ + function ToolResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolResponse tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1.ToolResponse + * @instance + */ + ToolResponse.prototype.tool = null; + + /** + * ToolResponse toolsetTool. + * @member {google.cloud.ces.v1.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1.ToolResponse + * @instance + */ + ToolResponse.prototype.toolsetTool = null; + + /** + * ToolResponse id. + * @member {string} id + * @memberof google.cloud.ces.v1.ToolResponse + * @instance + */ + ToolResponse.prototype.id = ""; + + /** + * ToolResponse displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1.ToolResponse + * @instance + */ + ToolResponse.prototype.displayName = ""; + + /** + * ToolResponse response. + * @member {google.protobuf.IStruct|null|undefined} response + * @memberof google.cloud.ces.v1.ToolResponse + * @instance + */ + ToolResponse.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ToolResponse toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1.ToolResponse + * @instance + */ + Object.defineProperty(ToolResponse.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ToolResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ToolResponse + * @static + * @param {google.cloud.ces.v1.IToolResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ToolResponse} ToolResponse instance + */ + ToolResponse.create = function create(properties) { + return new ToolResponse(properties); + }; + + /** + * Encodes the specified ToolResponse message. Does not implicitly {@link google.cloud.ces.v1.ToolResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ToolResponse + * @static + * @param {google.cloud.ces.v1.IToolResponse} message ToolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tool); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Struct.encode(message.response, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ToolResponse + * @static + * @param {google.cloud.ces.v1.IToolResponse} message ToolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ToolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ToolResponse} ToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ToolResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.tool = reader.string(); + break; + } + case 5: { + message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 1: { + message.id = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 3: { + message.response = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ToolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ToolResponse} ToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolResponse message. + * @function verify + * @memberof google.cloud.ces.v1.ToolResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.response != null && message.hasOwnProperty("response")) { + var error = $root.google.protobuf.Struct.verify(message.response); + if (error) + return "response." + error; + } + return null; + }; + + /** + * Creates a ToolResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ToolResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ToolResponse} ToolResponse + */ + ToolResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ToolResponse) + return object; + var message = new $root.google.cloud.ces.v1.ToolResponse(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1.ToolResponse.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.cloud.ces.v1.ToolResponse.response: object expected"); + message.response = $root.google.protobuf.Struct.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from a ToolResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ToolResponse + * @static + * @param {google.cloud.ces.v1.ToolResponse} message ToolResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.response = null; + object.displayName = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.response != null && message.hasOwnProperty("response")) + object.response = $root.google.protobuf.Struct.toObject(message.response, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + return object; + }; + + /** + * Converts this ToolResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ToolResponse + * @instance + * @returns {Object.} JSON object + */ + ToolResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ToolResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ToolResponse"; + }; + + return ToolResponse; + })(); + + v1.AgentTransfer = (function() { + + /** + * Properties of an AgentTransfer. + * @memberof google.cloud.ces.v1 + * @interface IAgentTransfer + * @property {string|null} [targetAgent] AgentTransfer targetAgent + * @property {string|null} [displayName] AgentTransfer displayName + */ + + /** + * Constructs a new AgentTransfer. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an AgentTransfer. + * @implements IAgentTransfer + * @constructor + * @param {google.cloud.ces.v1.IAgentTransfer=} [properties] Properties to set + */ + function AgentTransfer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AgentTransfer targetAgent. + * @member {string} targetAgent + * @memberof google.cloud.ces.v1.AgentTransfer + * @instance + */ + AgentTransfer.prototype.targetAgent = ""; + + /** + * AgentTransfer displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1.AgentTransfer + * @instance + */ + AgentTransfer.prototype.displayName = ""; + + /** + * Creates a new AgentTransfer instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.AgentTransfer + * @static + * @param {google.cloud.ces.v1.IAgentTransfer=} [properties] Properties to set + * @returns {google.cloud.ces.v1.AgentTransfer} AgentTransfer instance + */ + AgentTransfer.create = function create(properties) { + return new AgentTransfer(properties); + }; + + /** + * Encodes the specified AgentTransfer message. Does not implicitly {@link google.cloud.ces.v1.AgentTransfer.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.AgentTransfer + * @static + * @param {google.cloud.ces.v1.IAgentTransfer} message AgentTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentTransfer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetAgent != null && Object.hasOwnProperty.call(message, "targetAgent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetAgent); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified AgentTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AgentTransfer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.AgentTransfer + * @static + * @param {google.cloud.ces.v1.IAgentTransfer} message AgentTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentTransfer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AgentTransfer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.AgentTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.AgentTransfer} AgentTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentTransfer.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.AgentTransfer(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.targetAgent = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AgentTransfer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.AgentTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.AgentTransfer} AgentTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentTransfer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AgentTransfer message. + * @function verify + * @memberof google.cloud.ces.v1.AgentTransfer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AgentTransfer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetAgent != null && message.hasOwnProperty("targetAgent")) + if (!$util.isString(message.targetAgent)) + return "targetAgent: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates an AgentTransfer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.AgentTransfer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.AgentTransfer} AgentTransfer + */ + AgentTransfer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.AgentTransfer) + return object; + var message = new $root.google.cloud.ces.v1.AgentTransfer(); + if (object.targetAgent != null) + message.targetAgent = String(object.targetAgent); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an AgentTransfer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.AgentTransfer + * @static + * @param {google.cloud.ces.v1.AgentTransfer} message AgentTransfer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AgentTransfer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetAgent = ""; + object.displayName = ""; + } + if (message.targetAgent != null && message.hasOwnProperty("targetAgent")) + object.targetAgent = message.targetAgent; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this AgentTransfer to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.AgentTransfer + * @instance + * @returns {Object.} JSON object + */ + AgentTransfer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AgentTransfer + * @function getTypeUrl + * @memberof google.cloud.ces.v1.AgentTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AgentTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.AgentTransfer"; + }; + + return AgentTransfer; + })(); + + v1.ToolsetTool = (function() { + + /** + * Properties of a ToolsetTool. + * @memberof google.cloud.ces.v1 + * @interface IToolsetTool + * @property {string|null} [toolset] ToolsetTool toolset + * @property {string|null} [toolId] ToolsetTool toolId + */ + + /** + * Constructs a new ToolsetTool. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ToolsetTool. + * @implements IToolsetTool + * @constructor + * @param {google.cloud.ces.v1.IToolsetTool=} [properties] Properties to set + */ + function ToolsetTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolsetTool toolset. + * @member {string} toolset + * @memberof google.cloud.ces.v1.ToolsetTool + * @instance + */ + ToolsetTool.prototype.toolset = ""; + + /** + * ToolsetTool toolId. + * @member {string} toolId + * @memberof google.cloud.ces.v1.ToolsetTool + * @instance + */ + ToolsetTool.prototype.toolId = ""; + + /** + * Creates a new ToolsetTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ToolsetTool + * @static + * @param {google.cloud.ces.v1.IToolsetTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ToolsetTool} ToolsetTool instance + */ + ToolsetTool.create = function create(properties) { + return new ToolsetTool(properties); + }; + + /** + * Encodes the specified ToolsetTool message. Does not implicitly {@link google.cloud.ces.v1.ToolsetTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ToolsetTool + * @static + * @param {google.cloud.ces.v1.IToolsetTool} message ToolsetTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolsetTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.toolset); + if (message.toolId != null && Object.hasOwnProperty.call(message, "toolId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.toolId); + return writer; + }; + + /** + * Encodes the specified ToolsetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolsetTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ToolsetTool + * @static + * @param {google.cloud.ces.v1.IToolsetTool} message ToolsetTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolsetTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolsetTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ToolsetTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ToolsetTool} ToolsetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolsetTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ToolsetTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolset = reader.string(); + break; + } + case 3: { + message.toolId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolsetTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ToolsetTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ToolsetTool} ToolsetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolsetTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolsetTool message. + * @function verify + * @memberof google.cloud.ces.v1.ToolsetTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolsetTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolset != null && message.hasOwnProperty("toolset")) + if (!$util.isString(message.toolset)) + return "toolset: string expected"; + if (message.toolId != null && message.hasOwnProperty("toolId")) + if (!$util.isString(message.toolId)) + return "toolId: string expected"; + return null; + }; + + /** + * Creates a ToolsetTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ToolsetTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ToolsetTool} ToolsetTool + */ + ToolsetTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ToolsetTool) + return object; + var message = new $root.google.cloud.ces.v1.ToolsetTool(); + if (object.toolset != null) + message.toolset = String(object.toolset); + if (object.toolId != null) + message.toolId = String(object.toolId); + return message; + }; + + /** + * Creates a plain object from a ToolsetTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ToolsetTool + * @static + * @param {google.cloud.ces.v1.ToolsetTool} message ToolsetTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolsetTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.toolset = ""; + object.toolId = ""; + } + if (message.toolset != null && message.hasOwnProperty("toolset")) + object.toolset = message.toolset; + if (message.toolId != null && message.hasOwnProperty("toolId")) + object.toolId = message.toolId; + return object; + }; + + /** + * Converts this ToolsetTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ToolsetTool + * @instance + * @returns {Object.} JSON object + */ + ToolsetTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolsetTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ToolsetTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolsetTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ToolsetTool"; + }; + + return ToolsetTool; + })(); + + v1.Guardrail = (function() { + + /** + * Properties of a Guardrail. + * @memberof google.cloud.ces.v1 + * @interface IGuardrail + * @property {google.cloud.ces.v1.Guardrail.IContentFilter|null} [contentFilter] Guardrail contentFilter + * @property {google.cloud.ces.v1.Guardrail.ILlmPromptSecurity|null} [llmPromptSecurity] Guardrail llmPromptSecurity + * @property {google.cloud.ces.v1.Guardrail.ILlmPolicy|null} [llmPolicy] Guardrail llmPolicy + * @property {google.cloud.ces.v1.Guardrail.IModelSafety|null} [modelSafety] Guardrail modelSafety + * @property {google.cloud.ces.v1.Guardrail.ICodeCallback|null} [codeCallback] Guardrail codeCallback + * @property {string|null} [name] Guardrail name + * @property {string|null} [displayName] Guardrail displayName + * @property {string|null} [description] Guardrail description + * @property {boolean|null} [enabled] Guardrail enabled + * @property {google.cloud.ces.v1.ITriggerAction|null} [action] Guardrail action + * @property {google.protobuf.ITimestamp|null} [createTime] Guardrail createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Guardrail updateTime + * @property {string|null} [etag] Guardrail etag + */ + + /** + * Constructs a new Guardrail. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a Guardrail. + * @implements IGuardrail + * @constructor + * @param {google.cloud.ces.v1.IGuardrail=} [properties] Properties to set + */ + function Guardrail(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Guardrail contentFilter. + * @member {google.cloud.ces.v1.Guardrail.IContentFilter|null|undefined} contentFilter + * @memberof google.cloud.ces.v1.Guardrail + * @instance + */ + Guardrail.prototype.contentFilter = null; + + /** + * Guardrail llmPromptSecurity. + * @member {google.cloud.ces.v1.Guardrail.ILlmPromptSecurity|null|undefined} llmPromptSecurity + * @memberof google.cloud.ces.v1.Guardrail + * @instance + */ + Guardrail.prototype.llmPromptSecurity = null; + + /** + * Guardrail llmPolicy. + * @member {google.cloud.ces.v1.Guardrail.ILlmPolicy|null|undefined} llmPolicy + * @memberof google.cloud.ces.v1.Guardrail + * @instance + */ + Guardrail.prototype.llmPolicy = null; + + /** + * Guardrail modelSafety. + * @member {google.cloud.ces.v1.Guardrail.IModelSafety|null|undefined} modelSafety + * @memberof google.cloud.ces.v1.Guardrail + * @instance + */ + Guardrail.prototype.modelSafety = null; + + /** + * Guardrail codeCallback. + * @member {google.cloud.ces.v1.Guardrail.ICodeCallback|null|undefined} codeCallback + * @memberof google.cloud.ces.v1.Guardrail + * @instance + */ + Guardrail.prototype.codeCallback = null; + + /** + * Guardrail name. + * @member {string} name + * @memberof google.cloud.ces.v1.Guardrail + * @instance + */ + Guardrail.prototype.name = ""; + + /** + * Guardrail displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1.Guardrail + * @instance + */ + Guardrail.prototype.displayName = ""; + + /** + * Guardrail description. + * @member {string} description + * @memberof google.cloud.ces.v1.Guardrail + * @instance + */ + Guardrail.prototype.description = ""; + + /** + * Guardrail enabled. + * @member {boolean} enabled + * @memberof google.cloud.ces.v1.Guardrail + * @instance + */ + Guardrail.prototype.enabled = false; + + /** + * Guardrail action. + * @member {google.cloud.ces.v1.ITriggerAction|null|undefined} action + * @memberof google.cloud.ces.v1.Guardrail + * @instance + */ + Guardrail.prototype.action = null; + + /** + * Guardrail createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1.Guardrail + * @instance + */ + Guardrail.prototype.createTime = null; + + /** + * Guardrail updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1.Guardrail + * @instance + */ + Guardrail.prototype.updateTime = null; + + /** + * Guardrail etag. + * @member {string} etag + * @memberof google.cloud.ces.v1.Guardrail + * @instance + */ + Guardrail.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Guardrail guardrailType. + * @member {"contentFilter"|"llmPromptSecurity"|"llmPolicy"|"modelSafety"|"codeCallback"|undefined} guardrailType + * @memberof google.cloud.ces.v1.Guardrail + * @instance + */ + Object.defineProperty(Guardrail.prototype, "guardrailType", { + get: $util.oneOfGetter($oneOfFields = ["contentFilter", "llmPromptSecurity", "llmPolicy", "modelSafety", "codeCallback"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Guardrail instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Guardrail + * @static + * @param {google.cloud.ces.v1.IGuardrail=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Guardrail} Guardrail instance + */ + Guardrail.create = function create(properties) { + return new Guardrail(properties); + }; + + /** + * Encodes the specified Guardrail message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Guardrail + * @static + * @param {google.cloud.ces.v1.IGuardrail} message Guardrail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Guardrail.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enabled); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + $root.google.cloud.ces.v1.TriggerAction.encode(message.action, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.contentFilter != null && Object.hasOwnProperty.call(message, "contentFilter")) + $root.google.cloud.ces.v1.Guardrail.ContentFilter.encode(message.contentFilter, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.llmPromptSecurity != null && Object.hasOwnProperty.call(message, "llmPromptSecurity")) + $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.encode(message.llmPromptSecurity, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.llmPolicy != null && Object.hasOwnProperty.call(message, "llmPolicy")) + $root.google.cloud.ces.v1.Guardrail.LlmPolicy.encode(message.llmPolicy, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + if (message.modelSafety != null && Object.hasOwnProperty.call(message, "modelSafety")) + $root.google.cloud.ces.v1.Guardrail.ModelSafety.encode(message.modelSafety, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.codeCallback != null && Object.hasOwnProperty.call(message, "codeCallback")) + $root.google.cloud.ces.v1.Guardrail.CodeCallback.encode(message.codeCallback, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Guardrail message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Guardrail + * @static + * @param {google.cloud.ces.v1.IGuardrail} message Guardrail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Guardrail.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Guardrail message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Guardrail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Guardrail} Guardrail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Guardrail.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Guardrail(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 8: { + message.contentFilter = $root.google.cloud.ces.v1.Guardrail.ContentFilter.decode(reader, reader.uint32()); + break; + } + case 9: { + message.llmPromptSecurity = $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.decode(reader, reader.uint32()); + break; + } + case 10: { + message.llmPolicy = $root.google.cloud.ces.v1.Guardrail.LlmPolicy.decode(reader, reader.uint32()); + break; + } + case 13: { + message.modelSafety = $root.google.cloud.ces.v1.Guardrail.ModelSafety.decode(reader, reader.uint32()); + break; + } + case 14: { + message.codeCallback = $root.google.cloud.ces.v1.Guardrail.CodeCallback.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.enabled = reader.bool(); + break; + } + case 5: { + message.action = $root.google.cloud.ces.v1.TriggerAction.decode(reader, reader.uint32()); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Guardrail message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Guardrail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Guardrail} Guardrail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Guardrail.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Guardrail message. + * @function verify + * @memberof google.cloud.ces.v1.Guardrail + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Guardrail.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.contentFilter != null && message.hasOwnProperty("contentFilter")) { + properties.guardrailType = 1; + { + var error = $root.google.cloud.ces.v1.Guardrail.ContentFilter.verify(message.contentFilter); + if (error) + return "contentFilter." + error; + } + } + if (message.llmPromptSecurity != null && message.hasOwnProperty("llmPromptSecurity")) { + if (properties.guardrailType === 1) + return "guardrailType: multiple values"; + properties.guardrailType = 1; + { + var error = $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.verify(message.llmPromptSecurity); + if (error) + return "llmPromptSecurity." + error; + } + } + if (message.llmPolicy != null && message.hasOwnProperty("llmPolicy")) { + if (properties.guardrailType === 1) + return "guardrailType: multiple values"; + properties.guardrailType = 1; + { + var error = $root.google.cloud.ces.v1.Guardrail.LlmPolicy.verify(message.llmPolicy); + if (error) + return "llmPolicy." + error; + } + } + if (message.modelSafety != null && message.hasOwnProperty("modelSafety")) { + if (properties.guardrailType === 1) + return "guardrailType: multiple values"; + properties.guardrailType = 1; + { + var error = $root.google.cloud.ces.v1.Guardrail.ModelSafety.verify(message.modelSafety); + if (error) + return "modelSafety." + error; + } + } + if (message.codeCallback != null && message.hasOwnProperty("codeCallback")) { + if (properties.guardrailType === 1) + return "guardrailType: multiple values"; + properties.guardrailType = 1; + { + var error = $root.google.cloud.ces.v1.Guardrail.CodeCallback.verify(message.codeCallback); + if (error) + return "codeCallback." + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.action != null && message.hasOwnProperty("action")) { + var error = $root.google.cloud.ces.v1.TriggerAction.verify(message.action); + if (error) + return "action." + error; + } + 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a Guardrail message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Guardrail + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Guardrail} Guardrail + */ + Guardrail.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Guardrail) + return object; + var message = new $root.google.cloud.ces.v1.Guardrail(); + if (object.contentFilter != null) { + if (typeof object.contentFilter !== "object") + throw TypeError(".google.cloud.ces.v1.Guardrail.contentFilter: object expected"); + message.contentFilter = $root.google.cloud.ces.v1.Guardrail.ContentFilter.fromObject(object.contentFilter); + } + if (object.llmPromptSecurity != null) { + if (typeof object.llmPromptSecurity !== "object") + throw TypeError(".google.cloud.ces.v1.Guardrail.llmPromptSecurity: object expected"); + message.llmPromptSecurity = $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.fromObject(object.llmPromptSecurity); + } + if (object.llmPolicy != null) { + if (typeof object.llmPolicy !== "object") + throw TypeError(".google.cloud.ces.v1.Guardrail.llmPolicy: object expected"); + message.llmPolicy = $root.google.cloud.ces.v1.Guardrail.LlmPolicy.fromObject(object.llmPolicy); + } + if (object.modelSafety != null) { + if (typeof object.modelSafety !== "object") + throw TypeError(".google.cloud.ces.v1.Guardrail.modelSafety: object expected"); + message.modelSafety = $root.google.cloud.ces.v1.Guardrail.ModelSafety.fromObject(object.modelSafety); + } + if (object.codeCallback != null) { + if (typeof object.codeCallback !== "object") + throw TypeError(".google.cloud.ces.v1.Guardrail.codeCallback: object expected"); + message.codeCallback = $root.google.cloud.ces.v1.Guardrail.CodeCallback.fromObject(object.codeCallback); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.action != null) { + if (typeof object.action !== "object") + throw TypeError(".google.cloud.ces.v1.Guardrail.action: object expected"); + message.action = $root.google.cloud.ces.v1.TriggerAction.fromObject(object.action); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1.Guardrail.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.ces.v1.Guardrail.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a Guardrail message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Guardrail + * @static + * @param {google.cloud.ces.v1.Guardrail} message Guardrail + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Guardrail.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.enabled = false; + object.action = null; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.action != null && message.hasOwnProperty("action")) + object.action = $root.google.cloud.ces.v1.TriggerAction.toObject(message.action, options); + 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.contentFilter != null && message.hasOwnProperty("contentFilter")) { + object.contentFilter = $root.google.cloud.ces.v1.Guardrail.ContentFilter.toObject(message.contentFilter, options); + if (options.oneofs) + object.guardrailType = "contentFilter"; + } + if (message.llmPromptSecurity != null && message.hasOwnProperty("llmPromptSecurity")) { + object.llmPromptSecurity = $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.toObject(message.llmPromptSecurity, options); + if (options.oneofs) + object.guardrailType = "llmPromptSecurity"; + } + if (message.llmPolicy != null && message.hasOwnProperty("llmPolicy")) { + object.llmPolicy = $root.google.cloud.ces.v1.Guardrail.LlmPolicy.toObject(message.llmPolicy, options); + if (options.oneofs) + object.guardrailType = "llmPolicy"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.modelSafety != null && message.hasOwnProperty("modelSafety")) { + object.modelSafety = $root.google.cloud.ces.v1.Guardrail.ModelSafety.toObject(message.modelSafety, options); + if (options.oneofs) + object.guardrailType = "modelSafety"; + } + if (message.codeCallback != null && message.hasOwnProperty("codeCallback")) { + object.codeCallback = $root.google.cloud.ces.v1.Guardrail.CodeCallback.toObject(message.codeCallback, options); + if (options.oneofs) + object.guardrailType = "codeCallback"; + } + return object; + }; + + /** + * Converts this Guardrail to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Guardrail + * @instance + * @returns {Object.} JSON object + */ + Guardrail.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Guardrail + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Guardrail + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Guardrail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Guardrail"; + }; + + Guardrail.ContentFilter = (function() { + + /** + * Properties of a ContentFilter. + * @memberof google.cloud.ces.v1.Guardrail + * @interface IContentFilter + * @property {Array.|null} [bannedContents] ContentFilter bannedContents + * @property {Array.|null} [bannedContentsInUserInput] ContentFilter bannedContentsInUserInput + * @property {Array.|null} [bannedContentsInAgentResponse] ContentFilter bannedContentsInAgentResponse + * @property {google.cloud.ces.v1.Guardrail.ContentFilter.MatchType|null} [matchType] ContentFilter matchType + * @property {boolean|null} [disregardDiacritics] ContentFilter disregardDiacritics + */ + + /** + * Constructs a new ContentFilter. + * @memberof google.cloud.ces.v1.Guardrail + * @classdesc Represents a ContentFilter. + * @implements IContentFilter + * @constructor + * @param {google.cloud.ces.v1.Guardrail.IContentFilter=} [properties] Properties to set + */ + function ContentFilter(properties) { + this.bannedContents = []; + this.bannedContentsInUserInput = []; + this.bannedContentsInAgentResponse = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContentFilter bannedContents. + * @member {Array.} bannedContents + * @memberof google.cloud.ces.v1.Guardrail.ContentFilter + * @instance + */ + ContentFilter.prototype.bannedContents = $util.emptyArray; + + /** + * ContentFilter bannedContentsInUserInput. + * @member {Array.} bannedContentsInUserInput + * @memberof google.cloud.ces.v1.Guardrail.ContentFilter + * @instance + */ + ContentFilter.prototype.bannedContentsInUserInput = $util.emptyArray; + + /** + * ContentFilter bannedContentsInAgentResponse. + * @member {Array.} bannedContentsInAgentResponse + * @memberof google.cloud.ces.v1.Guardrail.ContentFilter + * @instance + */ + ContentFilter.prototype.bannedContentsInAgentResponse = $util.emptyArray; + + /** + * ContentFilter matchType. + * @member {google.cloud.ces.v1.Guardrail.ContentFilter.MatchType} matchType + * @memberof google.cloud.ces.v1.Guardrail.ContentFilter + * @instance + */ + ContentFilter.prototype.matchType = 0; + + /** + * ContentFilter disregardDiacritics. + * @member {boolean} disregardDiacritics + * @memberof google.cloud.ces.v1.Guardrail.ContentFilter + * @instance + */ + ContentFilter.prototype.disregardDiacritics = false; + + /** + * Creates a new ContentFilter instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Guardrail.ContentFilter + * @static + * @param {google.cloud.ces.v1.Guardrail.IContentFilter=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Guardrail.ContentFilter} ContentFilter instance + */ + ContentFilter.create = function create(properties) { + return new ContentFilter(properties); + }; + + /** + * Encodes the specified ContentFilter message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ContentFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Guardrail.ContentFilter + * @static + * @param {google.cloud.ces.v1.Guardrail.IContentFilter} message ContentFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bannedContents != null && message.bannedContents.length) + for (var i = 0; i < message.bannedContents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bannedContents[i]); + if (message.bannedContentsInUserInput != null && message.bannedContentsInUserInput.length) + for (var i = 0; i < message.bannedContentsInUserInput.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bannedContentsInUserInput[i]); + if (message.bannedContentsInAgentResponse != null && message.bannedContentsInAgentResponse.length) + for (var i = 0; i < message.bannedContentsInAgentResponse.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.bannedContentsInAgentResponse[i]); + if (message.matchType != null && Object.hasOwnProperty.call(message, "matchType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.matchType); + if (message.disregardDiacritics != null && Object.hasOwnProperty.call(message, "disregardDiacritics")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disregardDiacritics); + return writer; + }; + + /** + * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ContentFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Guardrail.ContentFilter + * @static + * @param {google.cloud.ces.v1.Guardrail.IContentFilter} message ContentFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContentFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Guardrail.ContentFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Guardrail.ContentFilter} ContentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentFilter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Guardrail.ContentFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.bannedContents && message.bannedContents.length)) + message.bannedContents = []; + message.bannedContents.push(reader.string()); + break; + } + case 2: { + if (!(message.bannedContentsInUserInput && message.bannedContentsInUserInput.length)) + message.bannedContentsInUserInput = []; + message.bannedContentsInUserInput.push(reader.string()); + break; + } + case 3: { + if (!(message.bannedContentsInAgentResponse && message.bannedContentsInAgentResponse.length)) + message.bannedContentsInAgentResponse = []; + message.bannedContentsInAgentResponse.push(reader.string()); + break; + } + case 4: { + message.matchType = reader.int32(); + break; + } + case 5: { + message.disregardDiacritics = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContentFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Guardrail.ContentFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Guardrail.ContentFilter} ContentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContentFilter message. + * @function verify + * @memberof google.cloud.ces.v1.Guardrail.ContentFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContentFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bannedContents != null && message.hasOwnProperty("bannedContents")) { + if (!Array.isArray(message.bannedContents)) + return "bannedContents: array expected"; + for (var i = 0; i < message.bannedContents.length; ++i) + if (!$util.isString(message.bannedContents[i])) + return "bannedContents: string[] expected"; + } + if (message.bannedContentsInUserInput != null && message.hasOwnProperty("bannedContentsInUserInput")) { + if (!Array.isArray(message.bannedContentsInUserInput)) + return "bannedContentsInUserInput: array expected"; + for (var i = 0; i < message.bannedContentsInUserInput.length; ++i) + if (!$util.isString(message.bannedContentsInUserInput[i])) + return "bannedContentsInUserInput: string[] expected"; + } + if (message.bannedContentsInAgentResponse != null && message.hasOwnProperty("bannedContentsInAgentResponse")) { + if (!Array.isArray(message.bannedContentsInAgentResponse)) + return "bannedContentsInAgentResponse: array expected"; + for (var i = 0; i < message.bannedContentsInAgentResponse.length; ++i) + if (!$util.isString(message.bannedContentsInAgentResponse[i])) + return "bannedContentsInAgentResponse: string[] expected"; + } + if (message.matchType != null && message.hasOwnProperty("matchType")) + switch (message.matchType) { + default: + return "matchType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.disregardDiacritics != null && message.hasOwnProperty("disregardDiacritics")) + if (typeof message.disregardDiacritics !== "boolean") + return "disregardDiacritics: boolean expected"; + return null; + }; + + /** + * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Guardrail.ContentFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Guardrail.ContentFilter} ContentFilter + */ + ContentFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Guardrail.ContentFilter) + return object; + var message = new $root.google.cloud.ces.v1.Guardrail.ContentFilter(); + if (object.bannedContents) { + if (!Array.isArray(object.bannedContents)) + throw TypeError(".google.cloud.ces.v1.Guardrail.ContentFilter.bannedContents: array expected"); + message.bannedContents = []; + for (var i = 0; i < object.bannedContents.length; ++i) + message.bannedContents[i] = String(object.bannedContents[i]); + } + if (object.bannedContentsInUserInput) { + if (!Array.isArray(object.bannedContentsInUserInput)) + throw TypeError(".google.cloud.ces.v1.Guardrail.ContentFilter.bannedContentsInUserInput: array expected"); + message.bannedContentsInUserInput = []; + for (var i = 0; i < object.bannedContentsInUserInput.length; ++i) + message.bannedContentsInUserInput[i] = String(object.bannedContentsInUserInput[i]); + } + if (object.bannedContentsInAgentResponse) { + if (!Array.isArray(object.bannedContentsInAgentResponse)) + throw TypeError(".google.cloud.ces.v1.Guardrail.ContentFilter.bannedContentsInAgentResponse: array expected"); + message.bannedContentsInAgentResponse = []; + for (var i = 0; i < object.bannedContentsInAgentResponse.length; ++i) + message.bannedContentsInAgentResponse[i] = String(object.bannedContentsInAgentResponse[i]); + } + switch (object.matchType) { + default: + if (typeof object.matchType === "number") { + message.matchType = object.matchType; + break; + } + break; + case "MATCH_TYPE_UNSPECIFIED": + case 0: + message.matchType = 0; + break; + case "SIMPLE_STRING_MATCH": + case 1: + message.matchType = 1; + break; + case "WORD_BOUNDARY_STRING_MATCH": + case 2: + message.matchType = 2; + break; + case "REGEXP_MATCH": + case 3: + message.matchType = 3; + break; + } + if (object.disregardDiacritics != null) + message.disregardDiacritics = Boolean(object.disregardDiacritics); + return message; + }; + + /** + * Creates a plain object from a ContentFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Guardrail.ContentFilter + * @static + * @param {google.cloud.ces.v1.Guardrail.ContentFilter} message ContentFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContentFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bannedContents = []; + object.bannedContentsInUserInput = []; + object.bannedContentsInAgentResponse = []; + } + if (options.defaults) { + object.matchType = options.enums === String ? "MATCH_TYPE_UNSPECIFIED" : 0; + object.disregardDiacritics = false; + } + if (message.bannedContents && message.bannedContents.length) { + object.bannedContents = []; + for (var j = 0; j < message.bannedContents.length; ++j) + object.bannedContents[j] = message.bannedContents[j]; + } + if (message.bannedContentsInUserInput && message.bannedContentsInUserInput.length) { + object.bannedContentsInUserInput = []; + for (var j = 0; j < message.bannedContentsInUserInput.length; ++j) + object.bannedContentsInUserInput[j] = message.bannedContentsInUserInput[j]; + } + if (message.bannedContentsInAgentResponse && message.bannedContentsInAgentResponse.length) { + object.bannedContentsInAgentResponse = []; + for (var j = 0; j < message.bannedContentsInAgentResponse.length; ++j) + object.bannedContentsInAgentResponse[j] = message.bannedContentsInAgentResponse[j]; + } + if (message.matchType != null && message.hasOwnProperty("matchType")) + object.matchType = options.enums === String ? $root.google.cloud.ces.v1.Guardrail.ContentFilter.MatchType[message.matchType] === undefined ? message.matchType : $root.google.cloud.ces.v1.Guardrail.ContentFilter.MatchType[message.matchType] : message.matchType; + if (message.disregardDiacritics != null && message.hasOwnProperty("disregardDiacritics")) + object.disregardDiacritics = message.disregardDiacritics; + return object; + }; + + /** + * Converts this ContentFilter to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Guardrail.ContentFilter + * @instance + * @returns {Object.} JSON object + */ + ContentFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContentFilter + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Guardrail.ContentFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContentFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Guardrail.ContentFilter"; + }; + + /** + * MatchType enum. + * @name google.cloud.ces.v1.Guardrail.ContentFilter.MatchType + * @enum {number} + * @property {number} MATCH_TYPE_UNSPECIFIED=0 MATCH_TYPE_UNSPECIFIED value + * @property {number} SIMPLE_STRING_MATCH=1 SIMPLE_STRING_MATCH value + * @property {number} WORD_BOUNDARY_STRING_MATCH=2 WORD_BOUNDARY_STRING_MATCH value + * @property {number} REGEXP_MATCH=3 REGEXP_MATCH value + */ + ContentFilter.MatchType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MATCH_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SIMPLE_STRING_MATCH"] = 1; + values[valuesById[2] = "WORD_BOUNDARY_STRING_MATCH"] = 2; + values[valuesById[3] = "REGEXP_MATCH"] = 3; + return values; + })(); + + return ContentFilter; + })(); + + Guardrail.LlmPromptSecurity = (function() { + + /** + * Properties of a LlmPromptSecurity. + * @memberof google.cloud.ces.v1.Guardrail + * @interface ILlmPromptSecurity + * @property {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null} [defaultSettings] LlmPromptSecurity defaultSettings + * @property {google.cloud.ces.v1.Guardrail.ILlmPolicy|null} [customPolicy] LlmPromptSecurity customPolicy + * @property {boolean|null} [failOpen] LlmPromptSecurity failOpen + */ + + /** + * Constructs a new LlmPromptSecurity. + * @memberof google.cloud.ces.v1.Guardrail + * @classdesc Represents a LlmPromptSecurity. + * @implements ILlmPromptSecurity + * @constructor + * @param {google.cloud.ces.v1.Guardrail.ILlmPromptSecurity=} [properties] Properties to set + */ + function LlmPromptSecurity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LlmPromptSecurity defaultSettings. + * @member {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null|undefined} defaultSettings + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity + * @instance + */ + LlmPromptSecurity.prototype.defaultSettings = null; + + /** + * LlmPromptSecurity customPolicy. + * @member {google.cloud.ces.v1.Guardrail.ILlmPolicy|null|undefined} customPolicy + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity + * @instance + */ + LlmPromptSecurity.prototype.customPolicy = null; + + /** + * LlmPromptSecurity failOpen. + * @member {boolean} failOpen + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity + * @instance + */ + LlmPromptSecurity.prototype.failOpen = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LlmPromptSecurity securityConfig. + * @member {"defaultSettings"|"customPolicy"|undefined} securityConfig + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity + * @instance + */ + Object.defineProperty(LlmPromptSecurity.prototype, "securityConfig", { + get: $util.oneOfGetter($oneOfFields = ["defaultSettings", "customPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LlmPromptSecurity instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity + * @static + * @param {google.cloud.ces.v1.Guardrail.ILlmPromptSecurity=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Guardrail.LlmPromptSecurity} LlmPromptSecurity instance + */ + LlmPromptSecurity.create = function create(properties) { + return new LlmPromptSecurity(properties); + }; + + /** + * Encodes the specified LlmPromptSecurity message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPromptSecurity.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity + * @static + * @param {google.cloud.ces.v1.Guardrail.ILlmPromptSecurity} message LlmPromptSecurity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmPromptSecurity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaultSettings != null && Object.hasOwnProperty.call(message, "defaultSettings")) + $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.encode(message.defaultSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.customPolicy != null && Object.hasOwnProperty.call(message, "customPolicy")) + $root.google.cloud.ces.v1.Guardrail.LlmPolicy.encode(message.customPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.failOpen != null && Object.hasOwnProperty.call(message, "failOpen")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.failOpen); + return writer; + }; + + /** + * Encodes the specified LlmPromptSecurity message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPromptSecurity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity + * @static + * @param {google.cloud.ces.v1.Guardrail.ILlmPromptSecurity} message LlmPromptSecurity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmPromptSecurity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LlmPromptSecurity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Guardrail.LlmPromptSecurity} LlmPromptSecurity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmPromptSecurity.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.defaultSettings = $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.customPolicy = $root.google.cloud.ces.v1.Guardrail.LlmPolicy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.failOpen = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LlmPromptSecurity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Guardrail.LlmPromptSecurity} LlmPromptSecurity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmPromptSecurity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LlmPromptSecurity message. + * @function verify + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LlmPromptSecurity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.defaultSettings != null && message.hasOwnProperty("defaultSettings")) { + properties.securityConfig = 1; + { + var error = $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify(message.defaultSettings); + if (error) + return "defaultSettings." + error; + } + } + if (message.customPolicy != null && message.hasOwnProperty("customPolicy")) { + if (properties.securityConfig === 1) + return "securityConfig: multiple values"; + properties.securityConfig = 1; + { + var error = $root.google.cloud.ces.v1.Guardrail.LlmPolicy.verify(message.customPolicy); + if (error) + return "customPolicy." + error; + } + } + if (message.failOpen != null && message.hasOwnProperty("failOpen")) + if (typeof message.failOpen !== "boolean") + return "failOpen: boolean expected"; + return null; + }; + + /** + * Creates a LlmPromptSecurity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Guardrail.LlmPromptSecurity} LlmPromptSecurity + */ + LlmPromptSecurity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity) + return object; + var message = new $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity(); + if (object.defaultSettings != null) { + if (typeof object.defaultSettings !== "object") + throw TypeError(".google.cloud.ces.v1.Guardrail.LlmPromptSecurity.defaultSettings: object expected"); + message.defaultSettings = $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.fromObject(object.defaultSettings); + } + if (object.customPolicy != null) { + if (typeof object.customPolicy !== "object") + throw TypeError(".google.cloud.ces.v1.Guardrail.LlmPromptSecurity.customPolicy: object expected"); + message.customPolicy = $root.google.cloud.ces.v1.Guardrail.LlmPolicy.fromObject(object.customPolicy); + } + if (object.failOpen != null) + message.failOpen = Boolean(object.failOpen); + return message; + }; + + /** + * Creates a plain object from a LlmPromptSecurity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity + * @static + * @param {google.cloud.ces.v1.Guardrail.LlmPromptSecurity} message LlmPromptSecurity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LlmPromptSecurity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.failOpen = false; + if (message.defaultSettings != null && message.hasOwnProperty("defaultSettings")) { + object.defaultSettings = $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.toObject(message.defaultSettings, options); + if (options.oneofs) + object.securityConfig = "defaultSettings"; + } + if (message.customPolicy != null && message.hasOwnProperty("customPolicy")) { + object.customPolicy = $root.google.cloud.ces.v1.Guardrail.LlmPolicy.toObject(message.customPolicy, options); + if (options.oneofs) + object.securityConfig = "customPolicy"; + } + if (message.failOpen != null && message.hasOwnProperty("failOpen")) + object.failOpen = message.failOpen; + return object; + }; + + /** + * Converts this LlmPromptSecurity to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity + * @instance + * @returns {Object.} JSON object + */ + LlmPromptSecurity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LlmPromptSecurity + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LlmPromptSecurity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Guardrail.LlmPromptSecurity"; + }; + + LlmPromptSecurity.DefaultSecuritySettings = (function() { + + /** + * Properties of a DefaultSecuritySettings. + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity + * @interface IDefaultSecuritySettings + * @property {string|null} [defaultPromptTemplate] DefaultSecuritySettings defaultPromptTemplate + */ + + /** + * Constructs a new DefaultSecuritySettings. + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity + * @classdesc Represents a DefaultSecuritySettings. + * @implements IDefaultSecuritySettings + * @constructor + * @param {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings=} [properties] Properties to set + */ + function DefaultSecuritySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DefaultSecuritySettings defaultPromptTemplate. + * @member {string} defaultPromptTemplate + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @instance + */ + DefaultSecuritySettings.prototype.defaultPromptTemplate = ""; + + /** + * Creates a new DefaultSecuritySettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings instance + */ + DefaultSecuritySettings.create = function create(properties) { + return new DefaultSecuritySettings(properties); + }; + + /** + * Encodes the specified DefaultSecuritySettings message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings} message DefaultSecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultSecuritySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaultPromptTemplate != null && Object.hasOwnProperty.call(message, "defaultPromptTemplate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.defaultPromptTemplate); + return writer; + }; + + /** + * Encodes the specified DefaultSecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings} message DefaultSecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultSecuritySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DefaultSecuritySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultSecuritySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.defaultPromptTemplate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DefaultSecuritySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultSecuritySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DefaultSecuritySettings message. + * @function verify + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DefaultSecuritySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaultPromptTemplate != null && message.hasOwnProperty("defaultPromptTemplate")) + if (!$util.isString(message.defaultPromptTemplate)) + return "defaultPromptTemplate: string expected"; + return null; + }; + + /** + * Creates a DefaultSecuritySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings + */ + DefaultSecuritySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings) + return object; + var message = new $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings(); + if (object.defaultPromptTemplate != null) + message.defaultPromptTemplate = String(object.defaultPromptTemplate); + return message; + }; + + /** + * Creates a plain object from a DefaultSecuritySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} message DefaultSecuritySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DefaultSecuritySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.defaultPromptTemplate = ""; + if (message.defaultPromptTemplate != null && message.hasOwnProperty("defaultPromptTemplate")) + object.defaultPromptTemplate = message.defaultPromptTemplate; + return object; + }; + + /** + * Converts this DefaultSecuritySettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @instance + * @returns {Object.} JSON object + */ + DefaultSecuritySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DefaultSecuritySettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DefaultSecuritySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings"; + }; + + return DefaultSecuritySettings; + })(); + + return LlmPromptSecurity; + })(); + + Guardrail.LlmPolicy = (function() { + + /** + * Properties of a LlmPolicy. + * @memberof google.cloud.ces.v1.Guardrail + * @interface ILlmPolicy + * @property {number|null} [maxConversationMessages] LlmPolicy maxConversationMessages + * @property {google.cloud.ces.v1.IModelSettings|null} [modelSettings] LlmPolicy modelSettings + * @property {string|null} [prompt] LlmPolicy prompt + * @property {google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope|null} [policyScope] LlmPolicy policyScope + * @property {boolean|null} [failOpen] LlmPolicy failOpen + * @property {boolean|null} [allowShortUtterance] LlmPolicy allowShortUtterance + */ + + /** + * Constructs a new LlmPolicy. + * @memberof google.cloud.ces.v1.Guardrail + * @classdesc Represents a LlmPolicy. + * @implements ILlmPolicy + * @constructor + * @param {google.cloud.ces.v1.Guardrail.ILlmPolicy=} [properties] Properties to set + */ + function LlmPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LlmPolicy maxConversationMessages. + * @member {number} maxConversationMessages + * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy + * @instance + */ + LlmPolicy.prototype.maxConversationMessages = 0; + + /** + * LlmPolicy modelSettings. + * @member {google.cloud.ces.v1.IModelSettings|null|undefined} modelSettings + * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy + * @instance + */ + LlmPolicy.prototype.modelSettings = null; + + /** + * LlmPolicy prompt. + * @member {string} prompt + * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy + * @instance + */ + LlmPolicy.prototype.prompt = ""; + + /** + * LlmPolicy policyScope. + * @member {google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope} policyScope + * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy + * @instance + */ + LlmPolicy.prototype.policyScope = 0; + + /** + * LlmPolicy failOpen. + * @member {boolean} failOpen + * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy + * @instance + */ + LlmPolicy.prototype.failOpen = false; + + /** + * LlmPolicy allowShortUtterance. + * @member {boolean} allowShortUtterance + * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy + * @instance + */ + LlmPolicy.prototype.allowShortUtterance = false; + + /** + * Creates a new LlmPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy + * @static + * @param {google.cloud.ces.v1.Guardrail.ILlmPolicy=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Guardrail.LlmPolicy} LlmPolicy instance + */ + LlmPolicy.create = function create(properties) { + return new LlmPolicy(properties); + }; + + /** + * Encodes the specified LlmPolicy message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy + * @static + * @param {google.cloud.ces.v1.Guardrail.ILlmPolicy} message LlmPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxConversationMessages != null && Object.hasOwnProperty.call(message, "maxConversationMessages")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxConversationMessages); + if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) + $root.google.cloud.ces.v1.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.prompt); + if (message.policyScope != null && Object.hasOwnProperty.call(message, "policyScope")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.policyScope); + if (message.failOpen != null && Object.hasOwnProperty.call(message, "failOpen")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.failOpen); + if (message.allowShortUtterance != null && Object.hasOwnProperty.call(message, "allowShortUtterance")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowShortUtterance); + return writer; + }; + + /** + * Encodes the specified LlmPolicy message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy + * @static + * @param {google.cloud.ces.v1.Guardrail.ILlmPolicy} message LlmPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LlmPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Guardrail.LlmPolicy} LlmPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Guardrail.LlmPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.maxConversationMessages = reader.int32(); + break; + } + case 2: { + message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.decode(reader, reader.uint32()); + break; + } + case 3: { + message.prompt = reader.string(); + break; + } + case 4: { + message.policyScope = reader.int32(); + break; + } + case 5: { + message.failOpen = reader.bool(); + break; + } + case 6: { + message.allowShortUtterance = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LlmPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Guardrail.LlmPolicy} LlmPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LlmPolicy message. + * @function verify + * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LlmPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxConversationMessages != null && message.hasOwnProperty("maxConversationMessages")) + if (!$util.isInteger(message.maxConversationMessages)) + return "maxConversationMessages: integer expected"; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { + var error = $root.google.cloud.ces.v1.ModelSettings.verify(message.modelSettings); + if (error) + return "modelSettings." + error; + } + if (message.prompt != null && message.hasOwnProperty("prompt")) + if (!$util.isString(message.prompt)) + return "prompt: string expected"; + if (message.policyScope != null && message.hasOwnProperty("policyScope")) + switch (message.policyScope) { + default: + return "policyScope: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.failOpen != null && message.hasOwnProperty("failOpen")) + if (typeof message.failOpen !== "boolean") + return "failOpen: boolean expected"; + if (message.allowShortUtterance != null && message.hasOwnProperty("allowShortUtterance")) + if (typeof message.allowShortUtterance !== "boolean") + return "allowShortUtterance: boolean expected"; + return null; + }; + + /** + * Creates a LlmPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Guardrail.LlmPolicy} LlmPolicy + */ + LlmPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Guardrail.LlmPolicy) + return object; + var message = new $root.google.cloud.ces.v1.Guardrail.LlmPolicy(); + if (object.maxConversationMessages != null) + message.maxConversationMessages = object.maxConversationMessages | 0; + if (object.modelSettings != null) { + if (typeof object.modelSettings !== "object") + throw TypeError(".google.cloud.ces.v1.Guardrail.LlmPolicy.modelSettings: object expected"); + message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.fromObject(object.modelSettings); + } + if (object.prompt != null) + message.prompt = String(object.prompt); + switch (object.policyScope) { + default: + if (typeof object.policyScope === "number") { + message.policyScope = object.policyScope; + break; + } + break; + case "POLICY_SCOPE_UNSPECIFIED": + case 0: + message.policyScope = 0; + break; + case "USER_QUERY": + case 1: + message.policyScope = 1; + break; + case "AGENT_RESPONSE": + case 2: + message.policyScope = 2; + break; + case "USER_QUERY_AND_AGENT_RESPONSE": + case 3: + message.policyScope = 3; + break; + } + if (object.failOpen != null) + message.failOpen = Boolean(object.failOpen); + if (object.allowShortUtterance != null) + message.allowShortUtterance = Boolean(object.allowShortUtterance); + return message; + }; + + /** + * Creates a plain object from a LlmPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy + * @static + * @param {google.cloud.ces.v1.Guardrail.LlmPolicy} message LlmPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LlmPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxConversationMessages = 0; + object.modelSettings = null; + object.prompt = ""; + object.policyScope = options.enums === String ? "POLICY_SCOPE_UNSPECIFIED" : 0; + object.failOpen = false; + object.allowShortUtterance = false; + } + if (message.maxConversationMessages != null && message.hasOwnProperty("maxConversationMessages")) + object.maxConversationMessages = message.maxConversationMessages; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) + object.modelSettings = $root.google.cloud.ces.v1.ModelSettings.toObject(message.modelSettings, options); + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = message.prompt; + if (message.policyScope != null && message.hasOwnProperty("policyScope")) + object.policyScope = options.enums === String ? $root.google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope[message.policyScope] === undefined ? message.policyScope : $root.google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope[message.policyScope] : message.policyScope; + if (message.failOpen != null && message.hasOwnProperty("failOpen")) + object.failOpen = message.failOpen; + if (message.allowShortUtterance != null && message.hasOwnProperty("allowShortUtterance")) + object.allowShortUtterance = message.allowShortUtterance; + return object; + }; + + /** + * Converts this LlmPolicy to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy + * @instance + * @returns {Object.} JSON object + */ + LlmPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LlmPolicy + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LlmPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Guardrail.LlmPolicy"; + }; + + /** + * PolicyScope enum. + * @name google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope + * @enum {number} + * @property {number} POLICY_SCOPE_UNSPECIFIED=0 POLICY_SCOPE_UNSPECIFIED value + * @property {number} USER_QUERY=1 USER_QUERY value + * @property {number} AGENT_RESPONSE=2 AGENT_RESPONSE value + * @property {number} USER_QUERY_AND_AGENT_RESPONSE=3 USER_QUERY_AND_AGENT_RESPONSE value + */ + LlmPolicy.PolicyScope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "POLICY_SCOPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER_QUERY"] = 1; + values[valuesById[2] = "AGENT_RESPONSE"] = 2; + values[valuesById[3] = "USER_QUERY_AND_AGENT_RESPONSE"] = 3; + return values; + })(); + + return LlmPolicy; + })(); + + Guardrail.ModelSafety = (function() { + + /** + * Properties of a ModelSafety. + * @memberof google.cloud.ces.v1.Guardrail + * @interface IModelSafety + * @property {Array.|null} [safetySettings] ModelSafety safetySettings + */ + + /** + * Constructs a new ModelSafety. + * @memberof google.cloud.ces.v1.Guardrail + * @classdesc Represents a ModelSafety. + * @implements IModelSafety + * @constructor + * @param {google.cloud.ces.v1.Guardrail.IModelSafety=} [properties] Properties to set + */ + function ModelSafety(properties) { + this.safetySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelSafety safetySettings. + * @member {Array.} safetySettings + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety + * @instance + */ + ModelSafety.prototype.safetySettings = $util.emptyArray; + + /** + * Creates a new ModelSafety instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety + * @static + * @param {google.cloud.ces.v1.Guardrail.IModelSafety=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Guardrail.ModelSafety} ModelSafety instance + */ + ModelSafety.create = function create(properties) { + return new ModelSafety(properties); + }; + + /** + * Encodes the specified ModelSafety message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ModelSafety.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety + * @static + * @param {google.cloud.ces.v1.Guardrail.IModelSafety} message ModelSafety message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelSafety.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.safetySettings != null && message.safetySettings.length) + for (var i = 0; i < message.safetySettings.length; ++i) + $root.google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModelSafety message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ModelSafety.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety + * @static + * @param {google.cloud.ces.v1.Guardrail.IModelSafety} message ModelSafety message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelSafety.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelSafety message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Guardrail.ModelSafety} ModelSafety + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelSafety.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Guardrail.ModelSafety(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.safetySettings && message.safetySettings.length)) + message.safetySettings = []; + message.safetySettings.push($root.google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelSafety message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Guardrail.ModelSafety} ModelSafety + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelSafety.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelSafety message. + * @function verify + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelSafety.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.safetySettings != null && message.hasOwnProperty("safetySettings")) { + if (!Array.isArray(message.safetySettings)) + return "safetySettings: array expected"; + for (var i = 0; i < message.safetySettings.length; ++i) { + var error = $root.google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting.verify(message.safetySettings[i]); + if (error) + return "safetySettings." + error; + } + } + return null; + }; + + /** + * Creates a ModelSafety message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Guardrail.ModelSafety} ModelSafety + */ + ModelSafety.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Guardrail.ModelSafety) + return object; + var message = new $root.google.cloud.ces.v1.Guardrail.ModelSafety(); + if (object.safetySettings) { + if (!Array.isArray(object.safetySettings)) + throw TypeError(".google.cloud.ces.v1.Guardrail.ModelSafety.safetySettings: array expected"); + message.safetySettings = []; + for (var i = 0; i < object.safetySettings.length; ++i) { + if (typeof object.safetySettings[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Guardrail.ModelSafety.safetySettings: object expected"); + message.safetySettings[i] = $root.google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting.fromObject(object.safetySettings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ModelSafety message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety + * @static + * @param {google.cloud.ces.v1.Guardrail.ModelSafety} message ModelSafety + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelSafety.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.safetySettings = []; + if (message.safetySettings && message.safetySettings.length) { + object.safetySettings = []; + for (var j = 0; j < message.safetySettings.length; ++j) + object.safetySettings[j] = $root.google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting.toObject(message.safetySettings[j], options); + } + return object; + }; + + /** + * Converts this ModelSafety to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety + * @instance + * @returns {Object.} JSON object + */ + ModelSafety.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelSafety + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelSafety.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Guardrail.ModelSafety"; + }; + + ModelSafety.SafetySetting = (function() { + + /** + * Properties of a SafetySetting. + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety + * @interface ISafetySetting + * @property {google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory|null} [category] SafetySetting category + * @property {google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold|null} [threshold] SafetySetting threshold + */ + + /** + * Constructs a new SafetySetting. + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety + * @classdesc Represents a SafetySetting. + * @implements ISafetySetting + * @constructor + * @param {google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting=} [properties] Properties to set + */ + function SafetySetting(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SafetySetting category. + * @member {google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory} category + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting + * @instance + */ + SafetySetting.prototype.category = 0; + + /** + * SafetySetting threshold. + * @member {google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold} threshold + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting + * @instance + */ + SafetySetting.prototype.threshold = 0; + + /** + * Creates a new SafetySetting instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting + * @static + * @param {google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting} SafetySetting instance + */ + SafetySetting.create = function create(properties) { + return new SafetySetting(properties); + }; + + /** + * Encodes the specified SafetySetting message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting + * @static + * @param {google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting} message SafetySetting message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetySetting.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.category); + if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.threshold); + return writer; + }; + + /** + * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting + * @static + * @param {google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting} message SafetySetting message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetySetting.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SafetySetting message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting} SafetySetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetySetting.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.category = reader.int32(); + break; + } + case 2: { + message.threshold = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SafetySetting message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting} SafetySetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetySetting.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SafetySetting message. + * @function verify + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SafetySetting.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.category != null && message.hasOwnProperty("category")) + switch (message.category) { + default: + return "category: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.threshold != null && message.hasOwnProperty("threshold")) + switch (message.threshold) { + default: + return "threshold: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting} SafetySetting + */ + SafetySetting.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting) + return object; + var message = new $root.google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting(); + switch (object.category) { + default: + if (typeof object.category === "number") { + message.category = object.category; + break; + } + break; + case "HARM_CATEGORY_UNSPECIFIED": + case 0: + message.category = 0; + break; + case "HARM_CATEGORY_HATE_SPEECH": + case 1: + message.category = 1; + break; + case "HARM_CATEGORY_DANGEROUS_CONTENT": + case 2: + message.category = 2; + break; + case "HARM_CATEGORY_HARASSMENT": + case 3: + message.category = 3; + break; + case "HARM_CATEGORY_SEXUALLY_EXPLICIT": + case 4: + message.category = 4; + break; + } + switch (object.threshold) { + default: + if (typeof object.threshold === "number") { + message.threshold = object.threshold; + break; + } + break; + case "HARM_BLOCK_THRESHOLD_UNSPECIFIED": + case 0: + message.threshold = 0; + break; + case "BLOCK_LOW_AND_ABOVE": + case 1: + message.threshold = 1; + break; + case "BLOCK_MEDIUM_AND_ABOVE": + case 2: + message.threshold = 2; + break; + case "BLOCK_ONLY_HIGH": + case 3: + message.threshold = 3; + break; + case "BLOCK_NONE": + case 4: + message.threshold = 4; + break; + case "OFF": + case 5: + message.threshold = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a SafetySetting message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting + * @static + * @param {google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting} message SafetySetting + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SafetySetting.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0; + object.threshold = options.enums === String ? "HARM_BLOCK_THRESHOLD_UNSPECIFIED" : 0; + } + if (message.category != null && message.hasOwnProperty("category")) + object.category = options.enums === String ? $root.google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory[message.category] === undefined ? message.category : $root.google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory[message.category] : message.category; + if (message.threshold != null && message.hasOwnProperty("threshold")) + object.threshold = options.enums === String ? $root.google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold[message.threshold] === undefined ? message.threshold : $root.google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold[message.threshold] : message.threshold; + return object; + }; + + /** + * Converts this SafetySetting to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting + * @instance + * @returns {Object.} JSON object + */ + SafetySetting.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SafetySetting + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SafetySetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting"; + }; + + return SafetySetting; + })(); + + /** + * HarmCategory enum. + * @name google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory + * @enum {number} + * @property {number} HARM_CATEGORY_UNSPECIFIED=0 HARM_CATEGORY_UNSPECIFIED value + * @property {number} HARM_CATEGORY_HATE_SPEECH=1 HARM_CATEGORY_HATE_SPEECH value + * @property {number} HARM_CATEGORY_DANGEROUS_CONTENT=2 HARM_CATEGORY_DANGEROUS_CONTENT value + * @property {number} HARM_CATEGORY_HARASSMENT=3 HARM_CATEGORY_HARASSMENT value + * @property {number} HARM_CATEGORY_SEXUALLY_EXPLICIT=4 HARM_CATEGORY_SEXUALLY_EXPLICIT value + */ + ModelSafety.HarmCategory = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HARM_CATEGORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "HARM_CATEGORY_HATE_SPEECH"] = 1; + values[valuesById[2] = "HARM_CATEGORY_DANGEROUS_CONTENT"] = 2; + values[valuesById[3] = "HARM_CATEGORY_HARASSMENT"] = 3; + values[valuesById[4] = "HARM_CATEGORY_SEXUALLY_EXPLICIT"] = 4; + return values; + })(); + + /** + * HarmBlockThreshold enum. + * @name google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold + * @enum {number} + * @property {number} HARM_BLOCK_THRESHOLD_UNSPECIFIED=0 HARM_BLOCK_THRESHOLD_UNSPECIFIED value + * @property {number} BLOCK_LOW_AND_ABOVE=1 BLOCK_LOW_AND_ABOVE value + * @property {number} BLOCK_MEDIUM_AND_ABOVE=2 BLOCK_MEDIUM_AND_ABOVE value + * @property {number} BLOCK_ONLY_HIGH=3 BLOCK_ONLY_HIGH value + * @property {number} BLOCK_NONE=4 BLOCK_NONE value + * @property {number} OFF=5 OFF value + */ + ModelSafety.HarmBlockThreshold = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOCK_LOW_AND_ABOVE"] = 1; + values[valuesById[2] = "BLOCK_MEDIUM_AND_ABOVE"] = 2; + values[valuesById[3] = "BLOCK_ONLY_HIGH"] = 3; + values[valuesById[4] = "BLOCK_NONE"] = 4; + values[valuesById[5] = "OFF"] = 5; + return values; + })(); + + return ModelSafety; + })(); + + Guardrail.CodeCallback = (function() { + + /** + * Properties of a CodeCallback. + * @memberof google.cloud.ces.v1.Guardrail + * @interface ICodeCallback + * @property {google.cloud.ces.v1.ICallback|null} [beforeAgentCallback] CodeCallback beforeAgentCallback + * @property {google.cloud.ces.v1.ICallback|null} [afterAgentCallback] CodeCallback afterAgentCallback + * @property {google.cloud.ces.v1.ICallback|null} [beforeModelCallback] CodeCallback beforeModelCallback + * @property {google.cloud.ces.v1.ICallback|null} [afterModelCallback] CodeCallback afterModelCallback + */ + + /** + * Constructs a new CodeCallback. + * @memberof google.cloud.ces.v1.Guardrail + * @classdesc Represents a CodeCallback. + * @implements ICodeCallback + * @constructor + * @param {google.cloud.ces.v1.Guardrail.ICodeCallback=} [properties] Properties to set + */ + function CodeCallback(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CodeCallback beforeAgentCallback. + * @member {google.cloud.ces.v1.ICallback|null|undefined} beforeAgentCallback + * @memberof google.cloud.ces.v1.Guardrail.CodeCallback + * @instance + */ + CodeCallback.prototype.beforeAgentCallback = null; + + /** + * CodeCallback afterAgentCallback. + * @member {google.cloud.ces.v1.ICallback|null|undefined} afterAgentCallback + * @memberof google.cloud.ces.v1.Guardrail.CodeCallback + * @instance + */ + CodeCallback.prototype.afterAgentCallback = null; + + /** + * CodeCallback beforeModelCallback. + * @member {google.cloud.ces.v1.ICallback|null|undefined} beforeModelCallback + * @memberof google.cloud.ces.v1.Guardrail.CodeCallback + * @instance + */ + CodeCallback.prototype.beforeModelCallback = null; + + /** + * CodeCallback afterModelCallback. + * @member {google.cloud.ces.v1.ICallback|null|undefined} afterModelCallback + * @memberof google.cloud.ces.v1.Guardrail.CodeCallback + * @instance + */ + CodeCallback.prototype.afterModelCallback = null; + + /** + * Creates a new CodeCallback instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Guardrail.CodeCallback + * @static + * @param {google.cloud.ces.v1.Guardrail.ICodeCallback=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Guardrail.CodeCallback} CodeCallback instance + */ + CodeCallback.create = function create(properties) { + return new CodeCallback(properties); + }; + + /** + * Encodes the specified CodeCallback message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.CodeCallback.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Guardrail.CodeCallback + * @static + * @param {google.cloud.ces.v1.Guardrail.ICodeCallback} message CodeCallback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeCallback.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.beforeAgentCallback != null && Object.hasOwnProperty.call(message, "beforeAgentCallback")) + $root.google.cloud.ces.v1.Callback.encode(message.beforeAgentCallback, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.afterAgentCallback != null && Object.hasOwnProperty.call(message, "afterAgentCallback")) + $root.google.cloud.ces.v1.Callback.encode(message.afterAgentCallback, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.beforeModelCallback != null && Object.hasOwnProperty.call(message, "beforeModelCallback")) + $root.google.cloud.ces.v1.Callback.encode(message.beforeModelCallback, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.afterModelCallback != null && Object.hasOwnProperty.call(message, "afterModelCallback")) + $root.google.cloud.ces.v1.Callback.encode(message.afterModelCallback, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CodeCallback message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.CodeCallback.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Guardrail.CodeCallback + * @static + * @param {google.cloud.ces.v1.Guardrail.ICodeCallback} message CodeCallback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeCallback.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CodeCallback message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Guardrail.CodeCallback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Guardrail.CodeCallback} CodeCallback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeCallback.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Guardrail.CodeCallback(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.beforeAgentCallback = $root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32()); + break; + } + case 2: { + message.afterAgentCallback = $root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32()); + break; + } + case 3: { + message.beforeModelCallback = $root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32()); + break; + } + case 4: { + message.afterModelCallback = $root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CodeCallback message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Guardrail.CodeCallback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Guardrail.CodeCallback} CodeCallback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeCallback.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CodeCallback message. + * @function verify + * @memberof google.cloud.ces.v1.Guardrail.CodeCallback + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CodeCallback.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.beforeAgentCallback != null && message.hasOwnProperty("beforeAgentCallback")) { + var error = $root.google.cloud.ces.v1.Callback.verify(message.beforeAgentCallback); + if (error) + return "beforeAgentCallback." + error; + } + if (message.afterAgentCallback != null && message.hasOwnProperty("afterAgentCallback")) { + var error = $root.google.cloud.ces.v1.Callback.verify(message.afterAgentCallback); + if (error) + return "afterAgentCallback." + error; + } + if (message.beforeModelCallback != null && message.hasOwnProperty("beforeModelCallback")) { + var error = $root.google.cloud.ces.v1.Callback.verify(message.beforeModelCallback); + if (error) + return "beforeModelCallback." + error; + } + if (message.afterModelCallback != null && message.hasOwnProperty("afterModelCallback")) { + var error = $root.google.cloud.ces.v1.Callback.verify(message.afterModelCallback); + if (error) + return "afterModelCallback." + error; + } + return null; + }; + + /** + * Creates a CodeCallback message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Guardrail.CodeCallback + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Guardrail.CodeCallback} CodeCallback + */ + CodeCallback.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Guardrail.CodeCallback) + return object; + var message = new $root.google.cloud.ces.v1.Guardrail.CodeCallback(); + if (object.beforeAgentCallback != null) { + if (typeof object.beforeAgentCallback !== "object") + throw TypeError(".google.cloud.ces.v1.Guardrail.CodeCallback.beforeAgentCallback: object expected"); + message.beforeAgentCallback = $root.google.cloud.ces.v1.Callback.fromObject(object.beforeAgentCallback); + } + if (object.afterAgentCallback != null) { + if (typeof object.afterAgentCallback !== "object") + throw TypeError(".google.cloud.ces.v1.Guardrail.CodeCallback.afterAgentCallback: object expected"); + message.afterAgentCallback = $root.google.cloud.ces.v1.Callback.fromObject(object.afterAgentCallback); + } + if (object.beforeModelCallback != null) { + if (typeof object.beforeModelCallback !== "object") + throw TypeError(".google.cloud.ces.v1.Guardrail.CodeCallback.beforeModelCallback: object expected"); + message.beforeModelCallback = $root.google.cloud.ces.v1.Callback.fromObject(object.beforeModelCallback); + } + if (object.afterModelCallback != null) { + if (typeof object.afterModelCallback !== "object") + throw TypeError(".google.cloud.ces.v1.Guardrail.CodeCallback.afterModelCallback: object expected"); + message.afterModelCallback = $root.google.cloud.ces.v1.Callback.fromObject(object.afterModelCallback); + } + return message; + }; + + /** + * Creates a plain object from a CodeCallback message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Guardrail.CodeCallback + * @static + * @param {google.cloud.ces.v1.Guardrail.CodeCallback} message CodeCallback + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CodeCallback.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.beforeAgentCallback = null; + object.afterAgentCallback = null; + object.beforeModelCallback = null; + object.afterModelCallback = null; + } + if (message.beforeAgentCallback != null && message.hasOwnProperty("beforeAgentCallback")) + object.beforeAgentCallback = $root.google.cloud.ces.v1.Callback.toObject(message.beforeAgentCallback, options); + if (message.afterAgentCallback != null && message.hasOwnProperty("afterAgentCallback")) + object.afterAgentCallback = $root.google.cloud.ces.v1.Callback.toObject(message.afterAgentCallback, options); + if (message.beforeModelCallback != null && message.hasOwnProperty("beforeModelCallback")) + object.beforeModelCallback = $root.google.cloud.ces.v1.Callback.toObject(message.beforeModelCallback, options); + if (message.afterModelCallback != null && message.hasOwnProperty("afterModelCallback")) + object.afterModelCallback = $root.google.cloud.ces.v1.Callback.toObject(message.afterModelCallback, options); + return object; + }; + + /** + * Converts this CodeCallback to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Guardrail.CodeCallback + * @instance + * @returns {Object.} JSON object + */ + CodeCallback.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CodeCallback + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Guardrail.CodeCallback + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CodeCallback.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Guardrail.CodeCallback"; + }; + + return CodeCallback; + })(); + + return Guardrail; + })(); + + v1.Tool = (function() { + + /** + * Properties of a Tool. + * @memberof google.cloud.ces.v1 + * @interface ITool + * @property {google.cloud.ces.v1.IClientFunction|null} [clientFunction] Tool clientFunction + * @property {google.cloud.ces.v1.IOpenApiTool|null} [openApiTool] Tool openApiTool + * @property {google.cloud.ces.v1.IGoogleSearchTool|null} [googleSearchTool] Tool googleSearchTool + * @property {google.cloud.ces.v1.IConnectorTool|null} [connectorTool] Tool connectorTool + * @property {google.cloud.ces.v1.IDataStoreTool|null} [dataStoreTool] Tool dataStoreTool + * @property {google.cloud.ces.v1.IPythonFunction|null} [pythonFunction] Tool pythonFunction + * @property {google.cloud.ces.v1.IMcpTool|null} [mcpTool] Tool mcpTool + * @property {google.cloud.ces.v1.IFileSearchTool|null} [fileSearchTool] Tool fileSearchTool + * @property {google.cloud.ces.v1.ISystemTool|null} [systemTool] Tool systemTool + * @property {google.cloud.ces.v1.IWidgetTool|null} [widgetTool] Tool widgetTool + * @property {string|null} [name] Tool name + * @property {string|null} [displayName] Tool displayName + * @property {google.cloud.ces.v1.ExecutionType|null} [executionType] Tool executionType + * @property {google.protobuf.ITimestamp|null} [createTime] Tool createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Tool updateTime + * @property {string|null} [etag] Tool etag + * @property {string|null} [generatedSummary] Tool generatedSummary + * @property {google.cloud.ces.v1.IToolFakeConfig|null} [toolFakeConfig] Tool toolFakeConfig + */ + + /** + * Constructs a new Tool. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a Tool. + * @implements ITool + * @constructor + * @param {google.cloud.ces.v1.ITool=} [properties] Properties to set + */ + function Tool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tool clientFunction. + * @member {google.cloud.ces.v1.IClientFunction|null|undefined} clientFunction + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Tool.prototype.clientFunction = null; + + /** + * Tool openApiTool. + * @member {google.cloud.ces.v1.IOpenApiTool|null|undefined} openApiTool + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Tool.prototype.openApiTool = null; + + /** + * Tool googleSearchTool. + * @member {google.cloud.ces.v1.IGoogleSearchTool|null|undefined} googleSearchTool + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Tool.prototype.googleSearchTool = null; + + /** + * Tool connectorTool. + * @member {google.cloud.ces.v1.IConnectorTool|null|undefined} connectorTool + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Tool.prototype.connectorTool = null; + + /** + * Tool dataStoreTool. + * @member {google.cloud.ces.v1.IDataStoreTool|null|undefined} dataStoreTool + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Tool.prototype.dataStoreTool = null; + + /** + * Tool pythonFunction. + * @member {google.cloud.ces.v1.IPythonFunction|null|undefined} pythonFunction + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Tool.prototype.pythonFunction = null; + + /** + * Tool mcpTool. + * @member {google.cloud.ces.v1.IMcpTool|null|undefined} mcpTool + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Tool.prototype.mcpTool = null; + + /** + * Tool fileSearchTool. + * @member {google.cloud.ces.v1.IFileSearchTool|null|undefined} fileSearchTool + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Tool.prototype.fileSearchTool = null; + + /** + * Tool systemTool. + * @member {google.cloud.ces.v1.ISystemTool|null|undefined} systemTool + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Tool.prototype.systemTool = null; + + /** + * Tool widgetTool. + * @member {google.cloud.ces.v1.IWidgetTool|null|undefined} widgetTool + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Tool.prototype.widgetTool = null; + + /** + * Tool name. + * @member {string} name + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Tool.prototype.name = ""; + + /** + * Tool displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Tool.prototype.displayName = ""; + + /** + * Tool executionType. + * @member {google.cloud.ces.v1.ExecutionType} executionType + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Tool.prototype.executionType = 0; + + /** + * Tool createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Tool.prototype.createTime = null; + + /** + * Tool updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Tool.prototype.updateTime = null; + + /** + * Tool etag. + * @member {string} etag + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Tool.prototype.etag = ""; + + /** + * Tool generatedSummary. + * @member {string} generatedSummary + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Tool.prototype.generatedSummary = ""; + + /** + * Tool toolFakeConfig. + * @member {google.cloud.ces.v1.IToolFakeConfig|null|undefined} toolFakeConfig + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Tool.prototype.toolFakeConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Tool toolType. + * @member {"clientFunction"|"openApiTool"|"googleSearchTool"|"connectorTool"|"dataStoreTool"|"pythonFunction"|"mcpTool"|"fileSearchTool"|"systemTool"|"widgetTool"|undefined} toolType + * @memberof google.cloud.ces.v1.Tool + * @instance + */ + Object.defineProperty(Tool.prototype, "toolType", { + get: $util.oneOfGetter($oneOfFields = ["clientFunction", "openApiTool", "googleSearchTool", "connectorTool", "dataStoreTool", "pythonFunction", "mcpTool", "fileSearchTool", "systemTool", "widgetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Tool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Tool + * @static + * @param {google.cloud.ces.v1.ITool=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Tool} Tool instance + */ + Tool.create = function create(properties) { + return new Tool(properties); + }; + + /** + * Encodes the specified Tool message. Does not implicitly {@link google.cloud.ces.v1.Tool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Tool + * @static + * @param {google.cloud.ces.v1.ITool} message Tool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.clientFunction != null && Object.hasOwnProperty.call(message, "clientFunction")) + $root.google.cloud.ces.v1.ClientFunction.encode(message.clientFunction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.openApiTool != null && Object.hasOwnProperty.call(message, "openApiTool")) + $root.google.cloud.ces.v1.OpenApiTool.encode(message.openApiTool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.googleSearchTool != null && Object.hasOwnProperty.call(message, "googleSearchTool")) + $root.google.cloud.ces.v1.GoogleSearchTool.encode(message.googleSearchTool, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.connectorTool != null && Object.hasOwnProperty.call(message, "connectorTool")) + $root.google.cloud.ces.v1.ConnectorTool.encode(message.connectorTool, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.dataStoreTool != null && Object.hasOwnProperty.call(message, "dataStoreTool")) + $root.google.cloud.ces.v1.DataStoreTool.encode(message.dataStoreTool, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.pythonFunction != null && Object.hasOwnProperty.call(message, "pythonFunction")) + $root.google.cloud.ces.v1.PythonFunction.encode(message.pythonFunction, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.executionType != null && Object.hasOwnProperty.call(message, "executionType")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.executionType); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.displayName); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); + if (message.generatedSummary != null && Object.hasOwnProperty.call(message, "generatedSummary")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.generatedSummary); + if (message.mcpTool != null && Object.hasOwnProperty.call(message, "mcpTool")) + $root.google.cloud.ces.v1.McpTool.encode(message.mcpTool, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.fileSearchTool != null && Object.hasOwnProperty.call(message, "fileSearchTool")) + $root.google.cloud.ces.v1.FileSearchTool.encode(message.fileSearchTool, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.systemTool != null && Object.hasOwnProperty.call(message, "systemTool")) + $root.google.cloud.ces.v1.SystemTool.encode(message.systemTool, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.toolFakeConfig != null && Object.hasOwnProperty.call(message, "toolFakeConfig")) + $root.google.cloud.ces.v1.ToolFakeConfig.encode(message.toolFakeConfig, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.widgetTool != null && Object.hasOwnProperty.call(message, "widgetTool")) + $root.google.cloud.ces.v1.WidgetTool.encode(message.widgetTool, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Tool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Tool + * @static + * @param {google.cloud.ces.v1.ITool} message Tool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Tool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Tool} Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Tool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.clientFunction = $root.google.cloud.ces.v1.ClientFunction.decode(reader, reader.uint32()); + break; + } + case 3: { + message.openApiTool = $root.google.cloud.ces.v1.OpenApiTool.decode(reader, reader.uint32()); + break; + } + case 5: { + message.googleSearchTool = $root.google.cloud.ces.v1.GoogleSearchTool.decode(reader, reader.uint32()); + break; + } + case 8: { + message.connectorTool = $root.google.cloud.ces.v1.ConnectorTool.decode(reader, reader.uint32()); + break; + } + case 10: { + message.dataStoreTool = $root.google.cloud.ces.v1.DataStoreTool.decode(reader, reader.uint32()); + break; + } + case 11: { + message.pythonFunction = $root.google.cloud.ces.v1.PythonFunction.decode(reader, reader.uint32()); + break; + } + case 16: { + message.mcpTool = $root.google.cloud.ces.v1.McpTool.decode(reader, reader.uint32()); + break; + } + case 17: { + message.fileSearchTool = $root.google.cloud.ces.v1.FileSearchTool.decode(reader, reader.uint32()); + break; + } + case 18: { + message.systemTool = $root.google.cloud.ces.v1.SystemTool.decode(reader, reader.uint32()); + break; + } + case 24: { + message.widgetTool = $root.google.cloud.ces.v1.WidgetTool.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 13: { + message.displayName = reader.string(); + break; + } + case 12: { + message.executionType = reader.int32(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.etag = reader.string(); + break; + } + case 15: { + message.generatedSummary = reader.string(); + break; + } + case 20: { + message.toolFakeConfig = $root.google.cloud.ces.v1.ToolFakeConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Tool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Tool} Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tool message. + * @function verify + * @memberof google.cloud.ces.v1.Tool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.clientFunction != null && message.hasOwnProperty("clientFunction")) { + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1.ClientFunction.verify(message.clientFunction); + if (error) + return "clientFunction." + error; + } + } + if (message.openApiTool != null && message.hasOwnProperty("openApiTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1.OpenApiTool.verify(message.openApiTool); + if (error) + return "openApiTool." + error; + } + } + if (message.googleSearchTool != null && message.hasOwnProperty("googleSearchTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1.GoogleSearchTool.verify(message.googleSearchTool); + if (error) + return "googleSearchTool." + error; + } + } + if (message.connectorTool != null && message.hasOwnProperty("connectorTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1.ConnectorTool.verify(message.connectorTool); + if (error) + return "connectorTool." + error; + } + } + if (message.dataStoreTool != null && message.hasOwnProperty("dataStoreTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1.DataStoreTool.verify(message.dataStoreTool); + if (error) + return "dataStoreTool." + error; + } + } + if (message.pythonFunction != null && message.hasOwnProperty("pythonFunction")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1.PythonFunction.verify(message.pythonFunction); + if (error) + return "pythonFunction." + error; + } + } + if (message.mcpTool != null && message.hasOwnProperty("mcpTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1.McpTool.verify(message.mcpTool); + if (error) + return "mcpTool." + error; + } + } + if (message.fileSearchTool != null && message.hasOwnProperty("fileSearchTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1.FileSearchTool.verify(message.fileSearchTool); + if (error) + return "fileSearchTool." + error; + } + } + if (message.systemTool != null && message.hasOwnProperty("systemTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1.SystemTool.verify(message.systemTool); + if (error) + return "systemTool." + error; + } + } + if (message.widgetTool != null && message.hasOwnProperty("widgetTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1.WidgetTool.verify(message.widgetTool); + if (error) + return "widgetTool." + 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.executionType != null && message.hasOwnProperty("executionType")) + switch (message.executionType) { + default: + return "executionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) + if (!$util.isString(message.generatedSummary)) + return "generatedSummary: string expected"; + if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) { + var error = $root.google.cloud.ces.v1.ToolFakeConfig.verify(message.toolFakeConfig); + if (error) + return "toolFakeConfig." + error; + } + return null; + }; + + /** + * Creates a Tool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Tool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Tool} Tool + */ + Tool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Tool) + return object; + var message = new $root.google.cloud.ces.v1.Tool(); + if (object.clientFunction != null) { + if (typeof object.clientFunction !== "object") + throw TypeError(".google.cloud.ces.v1.Tool.clientFunction: object expected"); + message.clientFunction = $root.google.cloud.ces.v1.ClientFunction.fromObject(object.clientFunction); + } + if (object.openApiTool != null) { + if (typeof object.openApiTool !== "object") + throw TypeError(".google.cloud.ces.v1.Tool.openApiTool: object expected"); + message.openApiTool = $root.google.cloud.ces.v1.OpenApiTool.fromObject(object.openApiTool); + } + if (object.googleSearchTool != null) { + if (typeof object.googleSearchTool !== "object") + throw TypeError(".google.cloud.ces.v1.Tool.googleSearchTool: object expected"); + message.googleSearchTool = $root.google.cloud.ces.v1.GoogleSearchTool.fromObject(object.googleSearchTool); + } + if (object.connectorTool != null) { + if (typeof object.connectorTool !== "object") + throw TypeError(".google.cloud.ces.v1.Tool.connectorTool: object expected"); + message.connectorTool = $root.google.cloud.ces.v1.ConnectorTool.fromObject(object.connectorTool); + } + if (object.dataStoreTool != null) { + if (typeof object.dataStoreTool !== "object") + throw TypeError(".google.cloud.ces.v1.Tool.dataStoreTool: object expected"); + message.dataStoreTool = $root.google.cloud.ces.v1.DataStoreTool.fromObject(object.dataStoreTool); + } + if (object.pythonFunction != null) { + if (typeof object.pythonFunction !== "object") + throw TypeError(".google.cloud.ces.v1.Tool.pythonFunction: object expected"); + message.pythonFunction = $root.google.cloud.ces.v1.PythonFunction.fromObject(object.pythonFunction); + } + if (object.mcpTool != null) { + if (typeof object.mcpTool !== "object") + throw TypeError(".google.cloud.ces.v1.Tool.mcpTool: object expected"); + message.mcpTool = $root.google.cloud.ces.v1.McpTool.fromObject(object.mcpTool); + } + if (object.fileSearchTool != null) { + if (typeof object.fileSearchTool !== "object") + throw TypeError(".google.cloud.ces.v1.Tool.fileSearchTool: object expected"); + message.fileSearchTool = $root.google.cloud.ces.v1.FileSearchTool.fromObject(object.fileSearchTool); + } + if (object.systemTool != null) { + if (typeof object.systemTool !== "object") + throw TypeError(".google.cloud.ces.v1.Tool.systemTool: object expected"); + message.systemTool = $root.google.cloud.ces.v1.SystemTool.fromObject(object.systemTool); + } + if (object.widgetTool != null) { + if (typeof object.widgetTool !== "object") + throw TypeError(".google.cloud.ces.v1.Tool.widgetTool: object expected"); + message.widgetTool = $root.google.cloud.ces.v1.WidgetTool.fromObject(object.widgetTool); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.executionType) { + default: + if (typeof object.executionType === "number") { + message.executionType = object.executionType; + break; + } + break; + case "EXECUTION_TYPE_UNSPECIFIED": + case 0: + message.executionType = 0; + break; + case "SYNCHRONOUS": + case 1: + message.executionType = 1; + break; + case "ASYNCHRONOUS": + case 2: + message.executionType = 2; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1.Tool.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.ces.v1.Tool.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.generatedSummary != null) + message.generatedSummary = String(object.generatedSummary); + if (object.toolFakeConfig != null) { + if (typeof object.toolFakeConfig !== "object") + throw TypeError(".google.cloud.ces.v1.Tool.toolFakeConfig: object expected"); + message.toolFakeConfig = $root.google.cloud.ces.v1.ToolFakeConfig.fromObject(object.toolFakeConfig); + } + return message; + }; + + /** + * Creates a plain object from a Tool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Tool + * @static + * @param {google.cloud.ces.v1.Tool} message Tool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.executionType = options.enums === String ? "EXECUTION_TYPE_UNSPECIFIED" : 0; + object.displayName = ""; + object.etag = ""; + object.generatedSummary = ""; + object.toolFakeConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.clientFunction != null && message.hasOwnProperty("clientFunction")) { + object.clientFunction = $root.google.cloud.ces.v1.ClientFunction.toObject(message.clientFunction, options); + if (options.oneofs) + object.toolType = "clientFunction"; + } + if (message.openApiTool != null && message.hasOwnProperty("openApiTool")) { + object.openApiTool = $root.google.cloud.ces.v1.OpenApiTool.toObject(message.openApiTool, options); + if (options.oneofs) + object.toolType = "openApiTool"; + } + if (message.googleSearchTool != null && message.hasOwnProperty("googleSearchTool")) { + object.googleSearchTool = $root.google.cloud.ces.v1.GoogleSearchTool.toObject(message.googleSearchTool, options); + if (options.oneofs) + object.toolType = "googleSearchTool"; + } + 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.connectorTool != null && message.hasOwnProperty("connectorTool")) { + object.connectorTool = $root.google.cloud.ces.v1.ConnectorTool.toObject(message.connectorTool, options); + if (options.oneofs) + object.toolType = "connectorTool"; + } + if (message.dataStoreTool != null && message.hasOwnProperty("dataStoreTool")) { + object.dataStoreTool = $root.google.cloud.ces.v1.DataStoreTool.toObject(message.dataStoreTool, options); + if (options.oneofs) + object.toolType = "dataStoreTool"; + } + if (message.pythonFunction != null && message.hasOwnProperty("pythonFunction")) { + object.pythonFunction = $root.google.cloud.ces.v1.PythonFunction.toObject(message.pythonFunction, options); + if (options.oneofs) + object.toolType = "pythonFunction"; + } + if (message.executionType != null && message.hasOwnProperty("executionType")) + object.executionType = options.enums === String ? $root.google.cloud.ces.v1.ExecutionType[message.executionType] === undefined ? message.executionType : $root.google.cloud.ces.v1.ExecutionType[message.executionType] : message.executionType; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) + object.generatedSummary = message.generatedSummary; + if (message.mcpTool != null && message.hasOwnProperty("mcpTool")) { + object.mcpTool = $root.google.cloud.ces.v1.McpTool.toObject(message.mcpTool, options); + if (options.oneofs) + object.toolType = "mcpTool"; + } + if (message.fileSearchTool != null && message.hasOwnProperty("fileSearchTool")) { + object.fileSearchTool = $root.google.cloud.ces.v1.FileSearchTool.toObject(message.fileSearchTool, options); + if (options.oneofs) + object.toolType = "fileSearchTool"; + } + if (message.systemTool != null && message.hasOwnProperty("systemTool")) { + object.systemTool = $root.google.cloud.ces.v1.SystemTool.toObject(message.systemTool, options); + if (options.oneofs) + object.toolType = "systemTool"; + } + if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) + object.toolFakeConfig = $root.google.cloud.ces.v1.ToolFakeConfig.toObject(message.toolFakeConfig, options); + if (message.widgetTool != null && message.hasOwnProperty("widgetTool")) { + object.widgetTool = $root.google.cloud.ces.v1.WidgetTool.toObject(message.widgetTool, options); + if (options.oneofs) + object.toolType = "widgetTool"; + } + return object; + }; + + /** + * Converts this Tool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Tool + * @instance + * @returns {Object.} JSON object + */ + Tool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Tool + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Tool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Tool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Tool"; + }; + + return Tool; + })(); + + v1.ClientFunction = (function() { + + /** + * Properties of a ClientFunction. + * @memberof google.cloud.ces.v1 + * @interface IClientFunction + * @property {string|null} [name] ClientFunction name + * @property {string|null} [description] ClientFunction description + * @property {google.cloud.ces.v1.ISchema|null} [parameters] ClientFunction parameters + * @property {google.cloud.ces.v1.ISchema|null} [response] ClientFunction response + */ + + /** + * Constructs a new ClientFunction. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ClientFunction. + * @implements IClientFunction + * @constructor + * @param {google.cloud.ces.v1.IClientFunction=} [properties] Properties to set + */ + function ClientFunction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientFunction name. + * @member {string} name + * @memberof google.cloud.ces.v1.ClientFunction + * @instance + */ + ClientFunction.prototype.name = ""; + + /** + * ClientFunction description. + * @member {string} description + * @memberof google.cloud.ces.v1.ClientFunction + * @instance + */ + ClientFunction.prototype.description = ""; + + /** + * ClientFunction parameters. + * @member {google.cloud.ces.v1.ISchema|null|undefined} parameters + * @memberof google.cloud.ces.v1.ClientFunction + * @instance + */ + ClientFunction.prototype.parameters = null; + + /** + * ClientFunction response. + * @member {google.cloud.ces.v1.ISchema|null|undefined} response + * @memberof google.cloud.ces.v1.ClientFunction + * @instance + */ + ClientFunction.prototype.response = null; + + /** + * Creates a new ClientFunction instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ClientFunction + * @static + * @param {google.cloud.ces.v1.IClientFunction=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ClientFunction} ClientFunction instance + */ + ClientFunction.create = function create(properties) { + return new ClientFunction(properties); + }; + + /** + * Encodes the specified ClientFunction message. Does not implicitly {@link google.cloud.ces.v1.ClientFunction.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ClientFunction + * @static + * @param {google.cloud.ces.v1.IClientFunction} message ClientFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientFunction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.ces.v1.Schema.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.cloud.ces.v1.Schema.encode(message.response, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ClientFunction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ClientFunction + * @static + * @param {google.cloud.ces.v1.IClientFunction} message ClientFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientFunction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientFunction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ClientFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ClientFunction} ClientFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientFunction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ClientFunction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.parameters = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); + break; + } + case 4: { + message.response = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientFunction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ClientFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ClientFunction} ClientFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientFunction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientFunction message. + * @function verify + * @memberof google.cloud.ces.v1.ClientFunction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientFunction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.ces.v1.Schema.verify(message.parameters); + if (error) + return "parameters." + error; + } + if (message.response != null && message.hasOwnProperty("response")) { + var error = $root.google.cloud.ces.v1.Schema.verify(message.response); + if (error) + return "response." + error; + } + return null; + }; + + /** + * Creates a ClientFunction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ClientFunction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ClientFunction} ClientFunction + */ + ClientFunction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ClientFunction) + return object; + var message = new $root.google.cloud.ces.v1.ClientFunction(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.ces.v1.ClientFunction.parameters: object expected"); + message.parameters = $root.google.cloud.ces.v1.Schema.fromObject(object.parameters); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.cloud.ces.v1.ClientFunction.response: object expected"); + message.response = $root.google.cloud.ces.v1.Schema.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from a ClientFunction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ClientFunction + * @static + * @param {google.cloud.ces.v1.ClientFunction} message ClientFunction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientFunction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.parameters = null; + object.response = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.ces.v1.Schema.toObject(message.parameters, options); + if (message.response != null && message.hasOwnProperty("response")) + object.response = $root.google.cloud.ces.v1.Schema.toObject(message.response, options); + return object; + }; + + /** + * Converts this ClientFunction to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ClientFunction + * @instance + * @returns {Object.} JSON object + */ + ClientFunction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientFunction + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ClientFunction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientFunction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ClientFunction"; + }; + + return ClientFunction; + })(); + + v1.Action = (function() { + + /** + * Properties of an Action. + * @memberof google.cloud.ces.v1 + * @interface IAction + * @property {string|null} [connectionActionId] Action connectionActionId + * @property {google.cloud.ces.v1.Action.IEntityOperation|null} [entityOperation] Action entityOperation + * @property {Array.|null} [inputFields] Action inputFields + * @property {Array.|null} [outputFields] Action outputFields + */ + + /** + * Constructs a new Action. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an Action. + * @implements IAction + * @constructor + * @param {google.cloud.ces.v1.IAction=} [properties] Properties to set + */ + function Action(properties) { + this.inputFields = []; + this.outputFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Action connectionActionId. + * @member {string|null|undefined} connectionActionId + * @memberof google.cloud.ces.v1.Action + * @instance + */ + Action.prototype.connectionActionId = null; + + /** + * Action entityOperation. + * @member {google.cloud.ces.v1.Action.IEntityOperation|null|undefined} entityOperation + * @memberof google.cloud.ces.v1.Action + * @instance + */ + Action.prototype.entityOperation = null; + + /** + * Action inputFields. + * @member {Array.} inputFields + * @memberof google.cloud.ces.v1.Action + * @instance + */ + Action.prototype.inputFields = $util.emptyArray; + + /** + * Action outputFields. + * @member {Array.} outputFields + * @memberof google.cloud.ces.v1.Action + * @instance + */ + Action.prototype.outputFields = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Action actionSpec. + * @member {"connectionActionId"|"entityOperation"|undefined} actionSpec + * @memberof google.cloud.ces.v1.Action + * @instance + */ + Object.defineProperty(Action.prototype, "actionSpec", { + get: $util.oneOfGetter($oneOfFields = ["connectionActionId", "entityOperation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Action instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Action + * @static + * @param {google.cloud.ces.v1.IAction=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Action} Action instance + */ + Action.create = function create(properties) { + return new Action(properties); + }; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.cloud.ces.v1.Action.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Action + * @static + * @param {google.cloud.ces.v1.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputFields != null && message.inputFields.length) + for (var i = 0; i < message.inputFields.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputFields[i]); + if (message.outputFields != null && message.outputFields.length) + for (var i = 0; i < message.outputFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputFields[i]); + if (message.connectionActionId != null && Object.hasOwnProperty.call(message, "connectionActionId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.connectionActionId); + if (message.entityOperation != null && Object.hasOwnProperty.call(message, "entityOperation")) + $root.google.cloud.ces.v1.Action.EntityOperation.encode(message.entityOperation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Action.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Action + * @static + * @param {google.cloud.ces.v1.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Action message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Action(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.connectionActionId = reader.string(); + break; + } + case 5: { + message.entityOperation = $root.google.cloud.ces.v1.Action.EntityOperation.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.inputFields && message.inputFields.length)) + message.inputFields = []; + message.inputFields.push(reader.string()); + break; + } + case 3: { + if (!(message.outputFields && message.outputFields.length)) + message.outputFields = []; + message.outputFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Action message. + * @function verify + * @memberof google.cloud.ces.v1.Action + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Action.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.connectionActionId != null && message.hasOwnProperty("connectionActionId")) { + properties.actionSpec = 1; + if (!$util.isString(message.connectionActionId)) + return "connectionActionId: string expected"; + } + if (message.entityOperation != null && message.hasOwnProperty("entityOperation")) { + if (properties.actionSpec === 1) + return "actionSpec: multiple values"; + properties.actionSpec = 1; + { + var error = $root.google.cloud.ces.v1.Action.EntityOperation.verify(message.entityOperation); + if (error) + return "entityOperation." + error; + } + } + if (message.inputFields != null && message.hasOwnProperty("inputFields")) { + if (!Array.isArray(message.inputFields)) + return "inputFields: array expected"; + for (var i = 0; i < message.inputFields.length; ++i) + if (!$util.isString(message.inputFields[i])) + return "inputFields: string[] expected"; + } + if (message.outputFields != null && message.hasOwnProperty("outputFields")) { + if (!Array.isArray(message.outputFields)) + return "outputFields: array expected"; + for (var i = 0; i < message.outputFields.length; ++i) + if (!$util.isString(message.outputFields[i])) + return "outputFields: string[] expected"; + } + return null; + }; + + /** + * Creates an Action message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Action + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Action} Action + */ + Action.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Action) + return object; + var message = new $root.google.cloud.ces.v1.Action(); + if (object.connectionActionId != null) + message.connectionActionId = String(object.connectionActionId); + if (object.entityOperation != null) { + if (typeof object.entityOperation !== "object") + throw TypeError(".google.cloud.ces.v1.Action.entityOperation: object expected"); + message.entityOperation = $root.google.cloud.ces.v1.Action.EntityOperation.fromObject(object.entityOperation); + } + if (object.inputFields) { + if (!Array.isArray(object.inputFields)) + throw TypeError(".google.cloud.ces.v1.Action.inputFields: array expected"); + message.inputFields = []; + for (var i = 0; i < object.inputFields.length; ++i) + message.inputFields[i] = String(object.inputFields[i]); + } + if (object.outputFields) { + if (!Array.isArray(object.outputFields)) + throw TypeError(".google.cloud.ces.v1.Action.outputFields: array expected"); + message.outputFields = []; + for (var i = 0; i < object.outputFields.length; ++i) + message.outputFields[i] = String(object.outputFields[i]); + } + return message; + }; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Action + * @static + * @param {google.cloud.ces.v1.Action} message Action + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Action.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputFields = []; + object.outputFields = []; + } + if (message.inputFields && message.inputFields.length) { + object.inputFields = []; + for (var j = 0; j < message.inputFields.length; ++j) + object.inputFields[j] = message.inputFields[j]; + } + if (message.outputFields && message.outputFields.length) { + object.outputFields = []; + for (var j = 0; j < message.outputFields.length; ++j) + object.outputFields[j] = message.outputFields[j]; + } + if (message.connectionActionId != null && message.hasOwnProperty("connectionActionId")) { + object.connectionActionId = message.connectionActionId; + if (options.oneofs) + object.actionSpec = "connectionActionId"; + } + if (message.entityOperation != null && message.hasOwnProperty("entityOperation")) { + object.entityOperation = $root.google.cloud.ces.v1.Action.EntityOperation.toObject(message.entityOperation, options); + if (options.oneofs) + object.actionSpec = "entityOperation"; + } + return object; + }; + + /** + * Converts this Action to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Action + * @instance + * @returns {Object.} JSON object + */ + Action.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Action + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Action + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Action.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Action"; + }; + + Action.EntityOperation = (function() { + + /** + * Properties of an EntityOperation. + * @memberof google.cloud.ces.v1.Action + * @interface IEntityOperation + * @property {string|null} [entityId] EntityOperation entityId + * @property {google.cloud.ces.v1.Action.EntityOperation.OperationType|null} [operation] EntityOperation operation + */ + + /** + * Constructs a new EntityOperation. + * @memberof google.cloud.ces.v1.Action + * @classdesc Represents an EntityOperation. + * @implements IEntityOperation + * @constructor + * @param {google.cloud.ces.v1.Action.IEntityOperation=} [properties] Properties to set + */ + function EntityOperation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EntityOperation entityId. + * @member {string} entityId + * @memberof google.cloud.ces.v1.Action.EntityOperation + * @instance + */ + EntityOperation.prototype.entityId = ""; + + /** + * EntityOperation operation. + * @member {google.cloud.ces.v1.Action.EntityOperation.OperationType} operation + * @memberof google.cloud.ces.v1.Action.EntityOperation + * @instance + */ + EntityOperation.prototype.operation = 0; + + /** + * Creates a new EntityOperation instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Action.EntityOperation + * @static + * @param {google.cloud.ces.v1.Action.IEntityOperation=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Action.EntityOperation} EntityOperation instance + */ + EntityOperation.create = function create(properties) { + return new EntityOperation(properties); + }; + + /** + * Encodes the specified EntityOperation message. Does not implicitly {@link google.cloud.ces.v1.Action.EntityOperation.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Action.EntityOperation + * @static + * @param {google.cloud.ces.v1.Action.IEntityOperation} message EntityOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityOperation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityId); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.operation); + return writer; + }; + + /** + * Encodes the specified EntityOperation message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Action.EntityOperation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Action.EntityOperation + * @static + * @param {google.cloud.ces.v1.Action.IEntityOperation} message EntityOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityOperation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityOperation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Action.EntityOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Action.EntityOperation} EntityOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityOperation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Action.EntityOperation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.entityId = reader.string(); + break; + } + case 2: { + message.operation = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityOperation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Action.EntityOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Action.EntityOperation} EntityOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityOperation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityOperation message. + * @function verify + * @memberof google.cloud.ces.v1.Action.EntityOperation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityOperation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityId != null && message.hasOwnProperty("entityId")) + if (!$util.isString(message.entityId)) + return "entityId: string expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + switch (message.operation) { + default: + return "operation: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates an EntityOperation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Action.EntityOperation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Action.EntityOperation} EntityOperation + */ + EntityOperation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Action.EntityOperation) + return object; + var message = new $root.google.cloud.ces.v1.Action.EntityOperation(); + if (object.entityId != null) + message.entityId = String(object.entityId); + switch (object.operation) { + default: + if (typeof object.operation === "number") { + message.operation = object.operation; + break; + } + break; + case "OPERATION_TYPE_UNSPECIFIED": + case 0: + message.operation = 0; + break; + case "LIST": + case 1: + message.operation = 1; + break; + case "GET": + case 2: + message.operation = 2; + break; + case "CREATE": + case 3: + message.operation = 3; + break; + case "UPDATE": + case 4: + message.operation = 4; + break; + case "DELETE": + case 5: + message.operation = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from an EntityOperation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Action.EntityOperation + * @static + * @param {google.cloud.ces.v1.Action.EntityOperation} message EntityOperation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityOperation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityId = ""; + object.operation = options.enums === String ? "OPERATION_TYPE_UNSPECIFIED" : 0; + } + if (message.entityId != null && message.hasOwnProperty("entityId")) + object.entityId = message.entityId; + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = options.enums === String ? $root.google.cloud.ces.v1.Action.EntityOperation.OperationType[message.operation] === undefined ? message.operation : $root.google.cloud.ces.v1.Action.EntityOperation.OperationType[message.operation] : message.operation; + return object; + }; + + /** + * Converts this EntityOperation to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Action.EntityOperation + * @instance + * @returns {Object.} JSON object + */ + EntityOperation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntityOperation + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Action.EntityOperation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntityOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Action.EntityOperation"; + }; + + /** + * OperationType enum. + * @name google.cloud.ces.v1.Action.EntityOperation.OperationType + * @enum {number} + * @property {number} OPERATION_TYPE_UNSPECIFIED=0 OPERATION_TYPE_UNSPECIFIED value + * @property {number} LIST=1 LIST value + * @property {number} GET=2 GET value + * @property {number} CREATE=3 CREATE value + * @property {number} UPDATE=4 UPDATE value + * @property {number} DELETE=5 DELETE value + */ + EntityOperation.OperationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LIST"] = 1; + values[valuesById[2] = "GET"] = 2; + values[valuesById[3] = "CREATE"] = 3; + values[valuesById[4] = "UPDATE"] = 4; + values[valuesById[5] = "DELETE"] = 5; + return values; + })(); + + return EntityOperation; + })(); + + return Action; + })(); + + v1.ConnectorTool = (function() { + + /** + * Properties of a ConnectorTool. + * @memberof google.cloud.ces.v1 + * @interface IConnectorTool + * @property {string|null} [connection] ConnectorTool connection + * @property {google.cloud.ces.v1.IAction|null} [action] ConnectorTool action + * @property {google.cloud.ces.v1.IEndUserAuthConfig|null} [authConfig] ConnectorTool authConfig + * @property {string|null} [name] ConnectorTool name + * @property {string|null} [description] ConnectorTool description + */ + + /** + * Constructs a new ConnectorTool. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ConnectorTool. + * @implements IConnectorTool + * @constructor + * @param {google.cloud.ces.v1.IConnectorTool=} [properties] Properties to set + */ + function ConnectorTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectorTool connection. + * @member {string} connection + * @memberof google.cloud.ces.v1.ConnectorTool + * @instance + */ + ConnectorTool.prototype.connection = ""; + + /** + * ConnectorTool action. + * @member {google.cloud.ces.v1.IAction|null|undefined} action + * @memberof google.cloud.ces.v1.ConnectorTool + * @instance + */ + ConnectorTool.prototype.action = null; + + /** + * ConnectorTool authConfig. + * @member {google.cloud.ces.v1.IEndUserAuthConfig|null|undefined} authConfig + * @memberof google.cloud.ces.v1.ConnectorTool + * @instance + */ + ConnectorTool.prototype.authConfig = null; + + /** + * ConnectorTool name. + * @member {string} name + * @memberof google.cloud.ces.v1.ConnectorTool + * @instance + */ + ConnectorTool.prototype.name = ""; + + /** + * ConnectorTool description. + * @member {string} description + * @memberof google.cloud.ces.v1.ConnectorTool + * @instance + */ + ConnectorTool.prototype.description = ""; + + /** + * Creates a new ConnectorTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ConnectorTool + * @static + * @param {google.cloud.ces.v1.IConnectorTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ConnectorTool} ConnectorTool instance + */ + ConnectorTool.create = function create(properties) { + return new ConnectorTool(properties); + }; + + /** + * Encodes the specified ConnectorTool message. Does not implicitly {@link google.cloud.ces.v1.ConnectorTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ConnectorTool + * @static + * @param {google.cloud.ces.v1.IConnectorTool} message ConnectorTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + $root.google.cloud.ces.v1.Action.encode(message.action, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.authConfig != null && Object.hasOwnProperty.call(message, "authConfig")) + $root.google.cloud.ces.v1.EndUserAuthConfig.encode(message.authConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + return writer; + }; + + /** + * Encodes the specified ConnectorTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ConnectorTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ConnectorTool + * @static + * @param {google.cloud.ces.v1.IConnectorTool} message ConnectorTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectorTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ConnectorTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ConnectorTool} ConnectorTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ConnectorTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.connection = reader.string(); + break; + } + case 2: { + message.action = $root.google.cloud.ces.v1.Action.decode(reader, reader.uint32()); + break; + } + case 3: { + message.authConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.name = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectorTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ConnectorTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ConnectorTool} ConnectorTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectorTool message. + * @function verify + * @memberof google.cloud.ces.v1.ConnectorTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectorTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connection != null && message.hasOwnProperty("connection")) + if (!$util.isString(message.connection)) + return "connection: string expected"; + if (message.action != null && message.hasOwnProperty("action")) { + var error = $root.google.cloud.ces.v1.Action.verify(message.action); + if (error) + return "action." + error; + } + if (message.authConfig != null && message.hasOwnProperty("authConfig")) { + var error = $root.google.cloud.ces.v1.EndUserAuthConfig.verify(message.authConfig); + if (error) + return "authConfig." + error; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a ConnectorTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ConnectorTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ConnectorTool} ConnectorTool + */ + ConnectorTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ConnectorTool) + return object; + var message = new $root.google.cloud.ces.v1.ConnectorTool(); + if (object.connection != null) + message.connection = String(object.connection); + if (object.action != null) { + if (typeof object.action !== "object") + throw TypeError(".google.cloud.ces.v1.ConnectorTool.action: object expected"); + message.action = $root.google.cloud.ces.v1.Action.fromObject(object.action); + } + if (object.authConfig != null) { + if (typeof object.authConfig !== "object") + throw TypeError(".google.cloud.ces.v1.ConnectorTool.authConfig: object expected"); + message.authConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.fromObject(object.authConfig); + } + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a ConnectorTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ConnectorTool + * @static + * @param {google.cloud.ces.v1.ConnectorTool} message ConnectorTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectorTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.connection = ""; + object.action = null; + object.authConfig = null; + object.name = ""; + object.description = ""; + } + if (message.connection != null && message.hasOwnProperty("connection")) + object.connection = message.connection; + if (message.action != null && message.hasOwnProperty("action")) + object.action = $root.google.cloud.ces.v1.Action.toObject(message.action, options); + if (message.authConfig != null && message.hasOwnProperty("authConfig")) + object.authConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.toObject(message.authConfig, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this ConnectorTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ConnectorTool + * @instance + * @returns {Object.} JSON object + */ + ConnectorTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectorTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ConnectorTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectorTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ConnectorTool"; + }; + + return ConnectorTool; + })(); + + v1.ApiKeyConfig = (function() { + + /** + * Properties of an ApiKeyConfig. + * @memberof google.cloud.ces.v1 + * @interface IApiKeyConfig + * @property {string|null} [keyName] ApiKeyConfig keyName + * @property {string|null} [apiKeySecretVersion] ApiKeyConfig apiKeySecretVersion + * @property {google.cloud.ces.v1.ApiKeyConfig.RequestLocation|null} [requestLocation] ApiKeyConfig requestLocation + */ + + /** + * Constructs a new ApiKeyConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an ApiKeyConfig. + * @implements IApiKeyConfig + * @constructor + * @param {google.cloud.ces.v1.IApiKeyConfig=} [properties] Properties to set + */ + function ApiKeyConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiKeyConfig keyName. + * @member {string} keyName + * @memberof google.cloud.ces.v1.ApiKeyConfig + * @instance + */ + ApiKeyConfig.prototype.keyName = ""; + + /** + * ApiKeyConfig apiKeySecretVersion. + * @member {string} apiKeySecretVersion + * @memberof google.cloud.ces.v1.ApiKeyConfig + * @instance + */ + ApiKeyConfig.prototype.apiKeySecretVersion = ""; + + /** + * ApiKeyConfig requestLocation. + * @member {google.cloud.ces.v1.ApiKeyConfig.RequestLocation} requestLocation + * @memberof google.cloud.ces.v1.ApiKeyConfig + * @instance + */ + ApiKeyConfig.prototype.requestLocation = 0; + + /** + * Creates a new ApiKeyConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ApiKeyConfig + * @static + * @param {google.cloud.ces.v1.IApiKeyConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ApiKeyConfig} ApiKeyConfig instance + */ + ApiKeyConfig.create = function create(properties) { + return new ApiKeyConfig(properties); + }; + + /** + * Encodes the specified ApiKeyConfig message. Does not implicitly {@link google.cloud.ces.v1.ApiKeyConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ApiKeyConfig + * @static + * @param {google.cloud.ces.v1.IApiKeyConfig} message ApiKeyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiKeyConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyName != null && Object.hasOwnProperty.call(message, "keyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyName); + if (message.apiKeySecretVersion != null && Object.hasOwnProperty.call(message, "apiKeySecretVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.apiKeySecretVersion); + if (message.requestLocation != null && Object.hasOwnProperty.call(message, "requestLocation")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.requestLocation); + return writer; + }; + + /** + * Encodes the specified ApiKeyConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ApiKeyConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ApiKeyConfig + * @static + * @param {google.cloud.ces.v1.IApiKeyConfig} message ApiKeyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiKeyConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ApiKeyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ApiKeyConfig} ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiKeyConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ApiKeyConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.keyName = reader.string(); + break; + } + case 2: { + message.apiKeySecretVersion = reader.string(); + break; + } + case 3: { + message.requestLocation = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ApiKeyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ApiKeyConfig} ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiKeyConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiKeyConfig message. + * @function verify + * @memberof google.cloud.ces.v1.ApiKeyConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiKeyConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyName != null && message.hasOwnProperty("keyName")) + if (!$util.isString(message.keyName)) + return "keyName: string expected"; + if (message.apiKeySecretVersion != null && message.hasOwnProperty("apiKeySecretVersion")) + if (!$util.isString(message.apiKeySecretVersion)) + return "apiKeySecretVersion: string expected"; + if (message.requestLocation != null && message.hasOwnProperty("requestLocation")) + switch (message.requestLocation) { + default: + return "requestLocation: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ApiKeyConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ApiKeyConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ApiKeyConfig} ApiKeyConfig + */ + ApiKeyConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ApiKeyConfig) + return object; + var message = new $root.google.cloud.ces.v1.ApiKeyConfig(); + if (object.keyName != null) + message.keyName = String(object.keyName); + if (object.apiKeySecretVersion != null) + message.apiKeySecretVersion = String(object.apiKeySecretVersion); + switch (object.requestLocation) { + default: + if (typeof object.requestLocation === "number") { + message.requestLocation = object.requestLocation; + break; + } + break; + case "REQUEST_LOCATION_UNSPECIFIED": + case 0: + message.requestLocation = 0; + break; + case "HEADER": + case 1: + message.requestLocation = 1; + break; + case "QUERY_STRING": + case 2: + message.requestLocation = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ApiKeyConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ApiKeyConfig + * @static + * @param {google.cloud.ces.v1.ApiKeyConfig} message ApiKeyConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiKeyConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.keyName = ""; + object.apiKeySecretVersion = ""; + object.requestLocation = options.enums === String ? "REQUEST_LOCATION_UNSPECIFIED" : 0; + } + if (message.keyName != null && message.hasOwnProperty("keyName")) + object.keyName = message.keyName; + if (message.apiKeySecretVersion != null && message.hasOwnProperty("apiKeySecretVersion")) + object.apiKeySecretVersion = message.apiKeySecretVersion; + if (message.requestLocation != null && message.hasOwnProperty("requestLocation")) + object.requestLocation = options.enums === String ? $root.google.cloud.ces.v1.ApiKeyConfig.RequestLocation[message.requestLocation] === undefined ? message.requestLocation : $root.google.cloud.ces.v1.ApiKeyConfig.RequestLocation[message.requestLocation] : message.requestLocation; + return object; + }; + + /** + * Converts this ApiKeyConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ApiKeyConfig + * @instance + * @returns {Object.} JSON object + */ + ApiKeyConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiKeyConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ApiKeyConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiKeyConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ApiKeyConfig"; + }; + + /** + * RequestLocation enum. + * @name google.cloud.ces.v1.ApiKeyConfig.RequestLocation + * @enum {number} + * @property {number} REQUEST_LOCATION_UNSPECIFIED=0 REQUEST_LOCATION_UNSPECIFIED value + * @property {number} HEADER=1 HEADER value + * @property {number} QUERY_STRING=2 QUERY_STRING value + */ + ApiKeyConfig.RequestLocation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REQUEST_LOCATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "HEADER"] = 1; + values[valuesById[2] = "QUERY_STRING"] = 2; + return values; + })(); + + return ApiKeyConfig; + })(); + + v1.OAuthConfig = (function() { + + /** + * Properties of a OAuthConfig. + * @memberof google.cloud.ces.v1 + * @interface IOAuthConfig + * @property {google.cloud.ces.v1.OAuthConfig.OauthGrantType|null} [oauthGrantType] OAuthConfig oauthGrantType + * @property {string|null} [clientId] OAuthConfig clientId + * @property {string|null} [clientSecretVersion] OAuthConfig clientSecretVersion + * @property {string|null} [tokenEndpoint] OAuthConfig tokenEndpoint + * @property {Array.|null} [scopes] OAuthConfig scopes + */ + + /** + * Constructs a new OAuthConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a OAuthConfig. + * @implements IOAuthConfig + * @constructor + * @param {google.cloud.ces.v1.IOAuthConfig=} [properties] Properties to set + */ + function OAuthConfig(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OAuthConfig oauthGrantType. + * @member {google.cloud.ces.v1.OAuthConfig.OauthGrantType} oauthGrantType + * @memberof google.cloud.ces.v1.OAuthConfig + * @instance + */ + OAuthConfig.prototype.oauthGrantType = 0; + + /** + * OAuthConfig clientId. + * @member {string} clientId + * @memberof google.cloud.ces.v1.OAuthConfig + * @instance + */ + OAuthConfig.prototype.clientId = ""; + + /** + * OAuthConfig clientSecretVersion. + * @member {string} clientSecretVersion + * @memberof google.cloud.ces.v1.OAuthConfig + * @instance + */ + OAuthConfig.prototype.clientSecretVersion = ""; + + /** + * OAuthConfig tokenEndpoint. + * @member {string} tokenEndpoint + * @memberof google.cloud.ces.v1.OAuthConfig + * @instance + */ + OAuthConfig.prototype.tokenEndpoint = ""; + + /** + * OAuthConfig scopes. + * @member {Array.} scopes + * @memberof google.cloud.ces.v1.OAuthConfig + * @instance + */ + OAuthConfig.prototype.scopes = $util.emptyArray; + + /** + * Creates a new OAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.OAuthConfig + * @static + * @param {google.cloud.ces.v1.IOAuthConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.OAuthConfig} OAuthConfig instance + */ + OAuthConfig.create = function create(properties) { + return new OAuthConfig(properties); + }; + + /** + * Encodes the specified OAuthConfig message. Does not implicitly {@link google.cloud.ces.v1.OAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.OAuthConfig + * @static + * @param {google.cloud.ces.v1.IOAuthConfig} message OAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.oauthGrantType != null && Object.hasOwnProperty.call(message, "oauthGrantType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.oauthGrantType); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientId); + if (message.clientSecretVersion != null && Object.hasOwnProperty.call(message, "clientSecretVersion")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientSecretVersion); + if (message.tokenEndpoint != null && Object.hasOwnProperty.call(message, "tokenEndpoint")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tokenEndpoint); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified OAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.OAuthConfig + * @static + * @param {google.cloud.ces.v1.IOAuthConfig} message OAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.OAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.OAuthConfig} OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OAuthConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.oauthGrantType = reader.int32(); + break; + } + case 2: { + message.clientId = reader.string(); + break; + } + case 3: { + message.clientSecretVersion = reader.string(); + break; + } + case 4: { + message.tokenEndpoint = reader.string(); + break; + } + case 5: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.OAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.OAuthConfig} OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OAuthConfig message. + * @function verify + * @memberof google.cloud.ces.v1.OAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OAuthConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.oauthGrantType != null && message.hasOwnProperty("oauthGrantType")) + switch (message.oauthGrantType) { + default: + return "oauthGrantType: enum value expected"; + case 0: + case 1: + break; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientSecretVersion != null && message.hasOwnProperty("clientSecretVersion")) + if (!$util.isString(message.clientSecretVersion)) + return "clientSecretVersion: string expected"; + if (message.tokenEndpoint != null && message.hasOwnProperty("tokenEndpoint")) + if (!$util.isString(message.tokenEndpoint)) + return "tokenEndpoint: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + return null; + }; + + /** + * Creates a OAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.OAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.OAuthConfig} OAuthConfig + */ + OAuthConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.OAuthConfig) + return object; + var message = new $root.google.cloud.ces.v1.OAuthConfig(); + switch (object.oauthGrantType) { + default: + if (typeof object.oauthGrantType === "number") { + message.oauthGrantType = object.oauthGrantType; + break; + } + break; + case "OAUTH_GRANT_TYPE_UNSPECIFIED": + case 0: + message.oauthGrantType = 0; + break; + case "CLIENT_CREDENTIAL": + case 1: + message.oauthGrantType = 1; + break; + } + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientSecretVersion != null) + message.clientSecretVersion = String(object.clientSecretVersion); + if (object.tokenEndpoint != null) + message.tokenEndpoint = String(object.tokenEndpoint); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.ces.v1.OAuthConfig.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from a OAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.OAuthConfig + * @static + * @param {google.cloud.ces.v1.OAuthConfig} message OAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) { + object.oauthGrantType = options.enums === String ? "OAUTH_GRANT_TYPE_UNSPECIFIED" : 0; + object.clientId = ""; + object.clientSecretVersion = ""; + object.tokenEndpoint = ""; + } + if (message.oauthGrantType != null && message.hasOwnProperty("oauthGrantType")) + object.oauthGrantType = options.enums === String ? $root.google.cloud.ces.v1.OAuthConfig.OauthGrantType[message.oauthGrantType] === undefined ? message.oauthGrantType : $root.google.cloud.ces.v1.OAuthConfig.OauthGrantType[message.oauthGrantType] : message.oauthGrantType; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientSecretVersion != null && message.hasOwnProperty("clientSecretVersion")) + object.clientSecretVersion = message.clientSecretVersion; + if (message.tokenEndpoint != null && message.hasOwnProperty("tokenEndpoint")) + object.tokenEndpoint = message.tokenEndpoint; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this OAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.OAuthConfig + * @instance + * @returns {Object.} JSON object + */ + OAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OAuthConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.OAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.OAuthConfig"; + }; + + /** + * OauthGrantType enum. + * @name google.cloud.ces.v1.OAuthConfig.OauthGrantType + * @enum {number} + * @property {number} OAUTH_GRANT_TYPE_UNSPECIFIED=0 OAUTH_GRANT_TYPE_UNSPECIFIED value + * @property {number} CLIENT_CREDENTIAL=1 CLIENT_CREDENTIAL value + */ + OAuthConfig.OauthGrantType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OAUTH_GRANT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLIENT_CREDENTIAL"] = 1; + return values; + })(); + + return OAuthConfig; + })(); + + v1.ServiceAgentIdTokenAuthConfig = (function() { + + /** + * Properties of a ServiceAgentIdTokenAuthConfig. + * @memberof google.cloud.ces.v1 + * @interface IServiceAgentIdTokenAuthConfig + */ + + /** + * Constructs a new ServiceAgentIdTokenAuthConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ServiceAgentIdTokenAuthConfig. + * @implements IServiceAgentIdTokenAuthConfig + * @constructor + * @param {google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig=} [properties] Properties to set + */ + function ServiceAgentIdTokenAuthConfig(properties) { + if (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 ServiceAgentIdTokenAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig + * @static + * @param {google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig instance + */ + ServiceAgentIdTokenAuthConfig.create = function create(properties) { + return new ServiceAgentIdTokenAuthConfig(properties); + }; + + /** + * Encodes the specified ServiceAgentIdTokenAuthConfig message. Does not implicitly {@link google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig + * @static + * @param {google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig} message ServiceAgentIdTokenAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAgentIdTokenAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ServiceAgentIdTokenAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig + * @static + * @param {google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig} message ServiceAgentIdTokenAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAgentIdTokenAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAgentIdTokenAuthConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAgentIdTokenAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAgentIdTokenAuthConfig message. + * @function verify + * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAgentIdTokenAuthConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ServiceAgentIdTokenAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig + */ + ServiceAgentIdTokenAuthConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig) + return object; + return new $root.google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig(); + }; + + /** + * Creates a plain object from a ServiceAgentIdTokenAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig + * @static + * @param {google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig} message ServiceAgentIdTokenAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAgentIdTokenAuthConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ServiceAgentIdTokenAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceAgentIdTokenAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAgentIdTokenAuthConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAgentIdTokenAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig"; + }; + + return ServiceAgentIdTokenAuthConfig; + })(); + + v1.ServiceAccountAuthConfig = (function() { + + /** + * Properties of a ServiceAccountAuthConfig. + * @memberof google.cloud.ces.v1 + * @interface IServiceAccountAuthConfig + * @property {string|null} [serviceAccount] ServiceAccountAuthConfig serviceAccount + * @property {Array.|null} [scopes] ServiceAccountAuthConfig scopes + */ + + /** + * Constructs a new ServiceAccountAuthConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ServiceAccountAuthConfig. + * @implements IServiceAccountAuthConfig + * @constructor + * @param {google.cloud.ces.v1.IServiceAccountAuthConfig=} [properties] Properties to set + */ + function ServiceAccountAuthConfig(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceAccountAuthConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig + * @instance + */ + ServiceAccountAuthConfig.prototype.serviceAccount = ""; + + /** + * ServiceAccountAuthConfig scopes. + * @member {Array.} scopes + * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig + * @instance + */ + ServiceAccountAuthConfig.prototype.scopes = $util.emptyArray; + + /** + * Creates a new ServiceAccountAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig + * @static + * @param {google.cloud.ces.v1.IServiceAccountAuthConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ServiceAccountAuthConfig} ServiceAccountAuthConfig instance + */ + ServiceAccountAuthConfig.create = function create(properties) { + return new ServiceAccountAuthConfig(properties); + }; + + /** + * Encodes the specified ServiceAccountAuthConfig message. Does not implicitly {@link google.cloud.ces.v1.ServiceAccountAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig + * @static + * @param {google.cloud.ces.v1.IServiceAccountAuthConfig} message ServiceAccountAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccount); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified ServiceAccountAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ServiceAccountAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig + * @static + * @param {google.cloud.ces.v1.IServiceAccountAuthConfig} message ServiceAccountAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ServiceAccountAuthConfig} ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountAuthConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ServiceAccountAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.serviceAccount = reader.string(); + break; + } + case 2: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ServiceAccountAuthConfig} ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAccountAuthConfig message. + * @function verify + * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAccountAuthConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + return null; + }; + + /** + * Creates a ServiceAccountAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ServiceAccountAuthConfig} ServiceAccountAuthConfig + */ + ServiceAccountAuthConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ServiceAccountAuthConfig) + return object; + var message = new $root.google.cloud.ces.v1.ServiceAccountAuthConfig(); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.ces.v1.ServiceAccountAuthConfig.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from a ServiceAccountAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig + * @static + * @param {google.cloud.ces.v1.ServiceAccountAuthConfig} message ServiceAccountAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAccountAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) + object.serviceAccount = ""; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this ServiceAccountAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceAccountAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAccountAuthConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAccountAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ServiceAccountAuthConfig"; + }; + + return ServiceAccountAuthConfig; + })(); + + v1.BearerTokenConfig = (function() { + + /** + * Properties of a BearerTokenConfig. + * @memberof google.cloud.ces.v1 + * @interface IBearerTokenConfig + * @property {string|null} [token] BearerTokenConfig token + */ + + /** + * Constructs a new BearerTokenConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a BearerTokenConfig. + * @implements IBearerTokenConfig + * @constructor + * @param {google.cloud.ces.v1.IBearerTokenConfig=} [properties] Properties to set + */ + function BearerTokenConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BearerTokenConfig token. + * @member {string} token + * @memberof google.cloud.ces.v1.BearerTokenConfig + * @instance + */ + BearerTokenConfig.prototype.token = ""; + + /** + * Creates a new BearerTokenConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.BearerTokenConfig + * @static + * @param {google.cloud.ces.v1.IBearerTokenConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.BearerTokenConfig} BearerTokenConfig instance + */ + BearerTokenConfig.create = function create(properties) { + return new BearerTokenConfig(properties); + }; + + /** + * Encodes the specified BearerTokenConfig message. Does not implicitly {@link google.cloud.ces.v1.BearerTokenConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.BearerTokenConfig + * @static + * @param {google.cloud.ces.v1.IBearerTokenConfig} message BearerTokenConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BearerTokenConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); + return writer; + }; + + /** + * Encodes the specified BearerTokenConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BearerTokenConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.BearerTokenConfig + * @static + * @param {google.cloud.ces.v1.IBearerTokenConfig} message BearerTokenConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BearerTokenConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.BearerTokenConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.BearerTokenConfig} BearerTokenConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BearerTokenConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.BearerTokenConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.token = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.BearerTokenConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.BearerTokenConfig} BearerTokenConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BearerTokenConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BearerTokenConfig message. + * @function verify + * @memberof google.cloud.ces.v1.BearerTokenConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BearerTokenConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.token != null && message.hasOwnProperty("token")) + if (!$util.isString(message.token)) + return "token: string expected"; + return null; + }; + + /** + * Creates a BearerTokenConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.BearerTokenConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.BearerTokenConfig} BearerTokenConfig + */ + BearerTokenConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.BearerTokenConfig) + return object; + var message = new $root.google.cloud.ces.v1.BearerTokenConfig(); + if (object.token != null) + message.token = String(object.token); + return message; + }; + + /** + * Creates a plain object from a BearerTokenConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.BearerTokenConfig + * @static + * @param {google.cloud.ces.v1.BearerTokenConfig} message BearerTokenConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BearerTokenConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.token = ""; + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + return object; + }; + + /** + * Converts this BearerTokenConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.BearerTokenConfig + * @instance + * @returns {Object.} JSON object + */ + BearerTokenConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BearerTokenConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.BearerTokenConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BearerTokenConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.BearerTokenConfig"; + }; + + return BearerTokenConfig; + })(); + + v1.EndUserAuthConfig = (function() { + + /** + * Properties of an EndUserAuthConfig. + * @memberof google.cloud.ces.v1 + * @interface IEndUserAuthConfig + * @property {google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig|null} [oauth2AuthCodeConfig] EndUserAuthConfig oauth2AuthCodeConfig + * @property {google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig|null} [oauth2JwtBearerConfig] EndUserAuthConfig oauth2JwtBearerConfig + */ + + /** + * Constructs a new EndUserAuthConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an EndUserAuthConfig. + * @implements IEndUserAuthConfig + * @constructor + * @param {google.cloud.ces.v1.IEndUserAuthConfig=} [properties] Properties to set + */ + function EndUserAuthConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndUserAuthConfig oauth2AuthCodeConfig. + * @member {google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig|null|undefined} oauth2AuthCodeConfig + * @memberof google.cloud.ces.v1.EndUserAuthConfig + * @instance + */ + EndUserAuthConfig.prototype.oauth2AuthCodeConfig = null; + + /** + * EndUserAuthConfig oauth2JwtBearerConfig. + * @member {google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig|null|undefined} oauth2JwtBearerConfig + * @memberof google.cloud.ces.v1.EndUserAuthConfig + * @instance + */ + EndUserAuthConfig.prototype.oauth2JwtBearerConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EndUserAuthConfig authConfig. + * @member {"oauth2AuthCodeConfig"|"oauth2JwtBearerConfig"|undefined} authConfig + * @memberof google.cloud.ces.v1.EndUserAuthConfig + * @instance + */ + Object.defineProperty(EndUserAuthConfig.prototype, "authConfig", { + get: $util.oneOfGetter($oneOfFields = ["oauth2AuthCodeConfig", "oauth2JwtBearerConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EndUserAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.EndUserAuthConfig + * @static + * @param {google.cloud.ces.v1.IEndUserAuthConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.EndUserAuthConfig} EndUserAuthConfig instance + */ + EndUserAuthConfig.create = function create(properties) { + return new EndUserAuthConfig(properties); + }; + + /** + * Encodes the specified EndUserAuthConfig message. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.EndUserAuthConfig + * @static + * @param {google.cloud.ces.v1.IEndUserAuthConfig} message EndUserAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndUserAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.oauth2AuthCodeConfig != null && Object.hasOwnProperty.call(message, "oauth2AuthCodeConfig")) + $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig.encode(message.oauth2AuthCodeConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.oauth2JwtBearerConfig != null && Object.hasOwnProperty.call(message, "oauth2JwtBearerConfig")) + $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig.encode(message.oauth2JwtBearerConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EndUserAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.EndUserAuthConfig + * @static + * @param {google.cloud.ces.v1.IEndUserAuthConfig} message EndUserAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndUserAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndUserAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.EndUserAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.EndUserAuthConfig} EndUserAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndUserAuthConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.EndUserAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.oauth2AuthCodeConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.oauth2JwtBearerConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndUserAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.EndUserAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.EndUserAuthConfig} EndUserAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndUserAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndUserAuthConfig message. + * @function verify + * @memberof google.cloud.ces.v1.EndUserAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndUserAuthConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.oauth2AuthCodeConfig != null && message.hasOwnProperty("oauth2AuthCodeConfig")) { + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig.verify(message.oauth2AuthCodeConfig); + if (error) + return "oauth2AuthCodeConfig." + error; + } + } + if (message.oauth2JwtBearerConfig != null && message.hasOwnProperty("oauth2JwtBearerConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig.verify(message.oauth2JwtBearerConfig); + if (error) + return "oauth2JwtBearerConfig." + error; + } + } + return null; + }; + + /** + * Creates an EndUserAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.EndUserAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.EndUserAuthConfig} EndUserAuthConfig + */ + EndUserAuthConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.EndUserAuthConfig) + return object; + var message = new $root.google.cloud.ces.v1.EndUserAuthConfig(); + if (object.oauth2AuthCodeConfig != null) { + if (typeof object.oauth2AuthCodeConfig !== "object") + throw TypeError(".google.cloud.ces.v1.EndUserAuthConfig.oauth2AuthCodeConfig: object expected"); + message.oauth2AuthCodeConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig.fromObject(object.oauth2AuthCodeConfig); + } + if (object.oauth2JwtBearerConfig != null) { + if (typeof object.oauth2JwtBearerConfig !== "object") + throw TypeError(".google.cloud.ces.v1.EndUserAuthConfig.oauth2JwtBearerConfig: object expected"); + message.oauth2JwtBearerConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig.fromObject(object.oauth2JwtBearerConfig); + } + return message; + }; + + /** + * Creates a plain object from an EndUserAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.EndUserAuthConfig + * @static + * @param {google.cloud.ces.v1.EndUserAuthConfig} message EndUserAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndUserAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.oauth2AuthCodeConfig != null && message.hasOwnProperty("oauth2AuthCodeConfig")) { + object.oauth2AuthCodeConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig.toObject(message.oauth2AuthCodeConfig, options); + if (options.oneofs) + object.authConfig = "oauth2AuthCodeConfig"; + } + if (message.oauth2JwtBearerConfig != null && message.hasOwnProperty("oauth2JwtBearerConfig")) { + object.oauth2JwtBearerConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig.toObject(message.oauth2JwtBearerConfig, options); + if (options.oneofs) + object.authConfig = "oauth2JwtBearerConfig"; + } + return object; + }; + + /** + * Converts this EndUserAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.EndUserAuthConfig + * @instance + * @returns {Object.} JSON object + */ + EndUserAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndUserAuthConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.EndUserAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndUserAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.EndUserAuthConfig"; + }; + + EndUserAuthConfig.Oauth2AuthCodeConfig = (function() { + + /** + * Properties of an Oauth2AuthCodeConfig. + * @memberof google.cloud.ces.v1.EndUserAuthConfig + * @interface IOauth2AuthCodeConfig + * @property {string|null} [oauthToken] Oauth2AuthCodeConfig oauthToken + */ + + /** + * Constructs a new Oauth2AuthCodeConfig. + * @memberof google.cloud.ces.v1.EndUserAuthConfig + * @classdesc Represents an Oauth2AuthCodeConfig. + * @implements IOauth2AuthCodeConfig + * @constructor + * @param {google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig=} [properties] Properties to set + */ + function Oauth2AuthCodeConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Oauth2AuthCodeConfig oauthToken. + * @member {string} oauthToken + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig + * @instance + */ + Oauth2AuthCodeConfig.prototype.oauthToken = ""; + + /** + * Creates a new Oauth2AuthCodeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig instance + */ + Oauth2AuthCodeConfig.create = function create(properties) { + return new Oauth2AuthCodeConfig(properties); + }; + + /** + * Encodes the specified Oauth2AuthCodeConfig message. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig} message Oauth2AuthCodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2AuthCodeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.oauthToken != null && Object.hasOwnProperty.call(message, "oauthToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.oauthToken); + return writer; + }; + + /** + * Encodes the specified Oauth2AuthCodeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig} message Oauth2AuthCodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2AuthCodeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2AuthCodeConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.oauthToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2AuthCodeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Oauth2AuthCodeConfig message. + * @function verify + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Oauth2AuthCodeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.oauthToken != null && message.hasOwnProperty("oauthToken")) + if (!$util.isString(message.oauthToken)) + return "oauthToken: string expected"; + return null; + }; + + /** + * Creates an Oauth2AuthCodeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig + */ + Oauth2AuthCodeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig) + return object; + var message = new $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig(); + if (object.oauthToken != null) + message.oauthToken = String(object.oauthToken); + return message; + }; + + /** + * Creates a plain object from an Oauth2AuthCodeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig} message Oauth2AuthCodeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Oauth2AuthCodeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.oauthToken = ""; + if (message.oauthToken != null && message.hasOwnProperty("oauthToken")) + object.oauthToken = message.oauthToken; + return object; + }; + + /** + * Converts this Oauth2AuthCodeConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig + * @instance + * @returns {Object.} JSON object + */ + Oauth2AuthCodeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Oauth2AuthCodeConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Oauth2AuthCodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig"; + }; + + return Oauth2AuthCodeConfig; + })(); + + EndUserAuthConfig.Oauth2JwtBearerConfig = (function() { + + /** + * Properties of an Oauth2JwtBearerConfig. + * @memberof google.cloud.ces.v1.EndUserAuthConfig + * @interface IOauth2JwtBearerConfig + * @property {string|null} [issuer] Oauth2JwtBearerConfig issuer + * @property {string|null} [subject] Oauth2JwtBearerConfig subject + * @property {string|null} [clientKey] Oauth2JwtBearerConfig clientKey + */ + + /** + * Constructs a new Oauth2JwtBearerConfig. + * @memberof google.cloud.ces.v1.EndUserAuthConfig + * @classdesc Represents an Oauth2JwtBearerConfig. + * @implements IOauth2JwtBearerConfig + * @constructor + * @param {google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig=} [properties] Properties to set + */ + function Oauth2JwtBearerConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Oauth2JwtBearerConfig issuer. + * @member {string} issuer + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig + * @instance + */ + Oauth2JwtBearerConfig.prototype.issuer = ""; + + /** + * Oauth2JwtBearerConfig subject. + * @member {string} subject + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig + * @instance + */ + Oauth2JwtBearerConfig.prototype.subject = ""; + + /** + * Oauth2JwtBearerConfig clientKey. + * @member {string} clientKey + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig + * @instance + */ + Oauth2JwtBearerConfig.prototype.clientKey = ""; + + /** + * Creates a new Oauth2JwtBearerConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig instance + */ + Oauth2JwtBearerConfig.create = function create(properties) { + return new Oauth2JwtBearerConfig(properties); + }; + + /** + * Encodes the specified Oauth2JwtBearerConfig message. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig} message Oauth2JwtBearerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2JwtBearerConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.issuer != null && Object.hasOwnProperty.call(message, "issuer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.issuer); + if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subject); + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientKey); + return writer; + }; + + /** + * Encodes the specified Oauth2JwtBearerConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig} message Oauth2JwtBearerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2JwtBearerConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2JwtBearerConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.issuer = reader.string(); + break; + } + case 2: { + message.subject = reader.string(); + break; + } + case 3: { + message.clientKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2JwtBearerConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Oauth2JwtBearerConfig message. + * @function verify + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Oauth2JwtBearerConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.issuer != null && message.hasOwnProperty("issuer")) + if (!$util.isString(message.issuer)) + return "issuer: string expected"; + if (message.subject != null && message.hasOwnProperty("subject")) + if (!$util.isString(message.subject)) + return "subject: string expected"; + if (message.clientKey != null && message.hasOwnProperty("clientKey")) + if (!$util.isString(message.clientKey)) + return "clientKey: string expected"; + return null; + }; + + /** + * Creates an Oauth2JwtBearerConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig + */ + Oauth2JwtBearerConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig) + return object; + var message = new $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig(); + if (object.issuer != null) + message.issuer = String(object.issuer); + if (object.subject != null) + message.subject = String(object.subject); + if (object.clientKey != null) + message.clientKey = String(object.clientKey); + return message; + }; + + /** + * Creates a plain object from an Oauth2JwtBearerConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig} message Oauth2JwtBearerConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Oauth2JwtBearerConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.issuer = ""; + object.subject = ""; + object.clientKey = ""; + } + if (message.issuer != null && message.hasOwnProperty("issuer")) + object.issuer = message.issuer; + if (message.subject != null && message.hasOwnProperty("subject")) + object.subject = message.subject; + if (message.clientKey != null && message.hasOwnProperty("clientKey")) + object.clientKey = message.clientKey; + return object; + }; + + /** + * Converts this Oauth2JwtBearerConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig + * @instance + * @returns {Object.} JSON object + */ + Oauth2JwtBearerConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Oauth2JwtBearerConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Oauth2JwtBearerConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig"; + }; + + return Oauth2JwtBearerConfig; + })(); + + return EndUserAuthConfig; + })(); + + v1.ApiAuthentication = (function() { + + /** + * Properties of an ApiAuthentication. + * @memberof google.cloud.ces.v1 + * @interface IApiAuthentication + * @property {google.cloud.ces.v1.IApiKeyConfig|null} [apiKeyConfig] ApiAuthentication apiKeyConfig + * @property {google.cloud.ces.v1.IOAuthConfig|null} [oauthConfig] ApiAuthentication oauthConfig + * @property {google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig|null} [serviceAgentIdTokenAuthConfig] ApiAuthentication serviceAgentIdTokenAuthConfig + * @property {google.cloud.ces.v1.IServiceAccountAuthConfig|null} [serviceAccountAuthConfig] ApiAuthentication serviceAccountAuthConfig + * @property {google.cloud.ces.v1.IBearerTokenConfig|null} [bearerTokenConfig] ApiAuthentication bearerTokenConfig + */ + + /** + * Constructs a new ApiAuthentication. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an ApiAuthentication. + * @implements IApiAuthentication + * @constructor + * @param {google.cloud.ces.v1.IApiAuthentication=} [properties] Properties to set + */ + function ApiAuthentication(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiAuthentication apiKeyConfig. + * @member {google.cloud.ces.v1.IApiKeyConfig|null|undefined} apiKeyConfig + * @memberof google.cloud.ces.v1.ApiAuthentication + * @instance + */ + ApiAuthentication.prototype.apiKeyConfig = null; + + /** + * ApiAuthentication oauthConfig. + * @member {google.cloud.ces.v1.IOAuthConfig|null|undefined} oauthConfig + * @memberof google.cloud.ces.v1.ApiAuthentication + * @instance + */ + ApiAuthentication.prototype.oauthConfig = null; + + /** + * ApiAuthentication serviceAgentIdTokenAuthConfig. + * @member {google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig|null|undefined} serviceAgentIdTokenAuthConfig + * @memberof google.cloud.ces.v1.ApiAuthentication + * @instance + */ + ApiAuthentication.prototype.serviceAgentIdTokenAuthConfig = null; + + /** + * ApiAuthentication serviceAccountAuthConfig. + * @member {google.cloud.ces.v1.IServiceAccountAuthConfig|null|undefined} serviceAccountAuthConfig + * @memberof google.cloud.ces.v1.ApiAuthentication + * @instance + */ + ApiAuthentication.prototype.serviceAccountAuthConfig = null; + + /** + * ApiAuthentication bearerTokenConfig. + * @member {google.cloud.ces.v1.IBearerTokenConfig|null|undefined} bearerTokenConfig + * @memberof google.cloud.ces.v1.ApiAuthentication + * @instance + */ + ApiAuthentication.prototype.bearerTokenConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ApiAuthentication authConfig. + * @member {"apiKeyConfig"|"oauthConfig"|"serviceAgentIdTokenAuthConfig"|"serviceAccountAuthConfig"|"bearerTokenConfig"|undefined} authConfig + * @memberof google.cloud.ces.v1.ApiAuthentication + * @instance + */ + Object.defineProperty(ApiAuthentication.prototype, "authConfig", { + get: $util.oneOfGetter($oneOfFields = ["apiKeyConfig", "oauthConfig", "serviceAgentIdTokenAuthConfig", "serviceAccountAuthConfig", "bearerTokenConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ApiAuthentication instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ApiAuthentication + * @static + * @param {google.cloud.ces.v1.IApiAuthentication=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ApiAuthentication} ApiAuthentication instance + */ + ApiAuthentication.create = function create(properties) { + return new ApiAuthentication(properties); + }; + + /** + * Encodes the specified ApiAuthentication message. Does not implicitly {@link google.cloud.ces.v1.ApiAuthentication.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ApiAuthentication + * @static + * @param {google.cloud.ces.v1.IApiAuthentication} message ApiAuthentication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiAuthentication.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiKeyConfig != null && Object.hasOwnProperty.call(message, "apiKeyConfig")) + $root.google.cloud.ces.v1.ApiKeyConfig.encode(message.apiKeyConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.oauthConfig != null && Object.hasOwnProperty.call(message, "oauthConfig")) + $root.google.cloud.ces.v1.OAuthConfig.encode(message.oauthConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.serviceAgentIdTokenAuthConfig != null && Object.hasOwnProperty.call(message, "serviceAgentIdTokenAuthConfig")) + $root.google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig.encode(message.serviceAgentIdTokenAuthConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.serviceAccountAuthConfig != null && Object.hasOwnProperty.call(message, "serviceAccountAuthConfig")) + $root.google.cloud.ces.v1.ServiceAccountAuthConfig.encode(message.serviceAccountAuthConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.bearerTokenConfig != null && Object.hasOwnProperty.call(message, "bearerTokenConfig")) + $root.google.cloud.ces.v1.BearerTokenConfig.encode(message.bearerTokenConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApiAuthentication message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ApiAuthentication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ApiAuthentication + * @static + * @param {google.cloud.ces.v1.IApiAuthentication} message ApiAuthentication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiAuthentication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiAuthentication message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ApiAuthentication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ApiAuthentication} ApiAuthentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiAuthentication.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ApiAuthentication(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.apiKeyConfig = $root.google.cloud.ces.v1.ApiKeyConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.oauthConfig = $root.google.cloud.ces.v1.OAuthConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.serviceAgentIdTokenAuthConfig = $root.google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.serviceAccountAuthConfig = $root.google.cloud.ces.v1.ServiceAccountAuthConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.bearerTokenConfig = $root.google.cloud.ces.v1.BearerTokenConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiAuthentication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ApiAuthentication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ApiAuthentication} ApiAuthentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiAuthentication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiAuthentication message. + * @function verify + * @memberof google.cloud.ces.v1.ApiAuthentication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiAuthentication.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) { + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1.ApiKeyConfig.verify(message.apiKeyConfig); + if (error) + return "apiKeyConfig." + error; + } + } + if (message.oauthConfig != null && message.hasOwnProperty("oauthConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1.OAuthConfig.verify(message.oauthConfig); + if (error) + return "oauthConfig." + error; + } + } + if (message.serviceAgentIdTokenAuthConfig != null && message.hasOwnProperty("serviceAgentIdTokenAuthConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig.verify(message.serviceAgentIdTokenAuthConfig); + if (error) + return "serviceAgentIdTokenAuthConfig." + error; + } + } + if (message.serviceAccountAuthConfig != null && message.hasOwnProperty("serviceAccountAuthConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1.ServiceAccountAuthConfig.verify(message.serviceAccountAuthConfig); + if (error) + return "serviceAccountAuthConfig." + error; + } + } + if (message.bearerTokenConfig != null && message.hasOwnProperty("bearerTokenConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1.BearerTokenConfig.verify(message.bearerTokenConfig); + if (error) + return "bearerTokenConfig." + error; + } + } + return null; + }; + + /** + * Creates an ApiAuthentication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ApiAuthentication + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ApiAuthentication} ApiAuthentication + */ + ApiAuthentication.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ApiAuthentication) + return object; + var message = new $root.google.cloud.ces.v1.ApiAuthentication(); + if (object.apiKeyConfig != null) { + if (typeof object.apiKeyConfig !== "object") + throw TypeError(".google.cloud.ces.v1.ApiAuthentication.apiKeyConfig: object expected"); + message.apiKeyConfig = $root.google.cloud.ces.v1.ApiKeyConfig.fromObject(object.apiKeyConfig); + } + if (object.oauthConfig != null) { + if (typeof object.oauthConfig !== "object") + throw TypeError(".google.cloud.ces.v1.ApiAuthentication.oauthConfig: object expected"); + message.oauthConfig = $root.google.cloud.ces.v1.OAuthConfig.fromObject(object.oauthConfig); + } + if (object.serviceAgentIdTokenAuthConfig != null) { + if (typeof object.serviceAgentIdTokenAuthConfig !== "object") + throw TypeError(".google.cloud.ces.v1.ApiAuthentication.serviceAgentIdTokenAuthConfig: object expected"); + message.serviceAgentIdTokenAuthConfig = $root.google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig.fromObject(object.serviceAgentIdTokenAuthConfig); + } + if (object.serviceAccountAuthConfig != null) { + if (typeof object.serviceAccountAuthConfig !== "object") + throw TypeError(".google.cloud.ces.v1.ApiAuthentication.serviceAccountAuthConfig: object expected"); + message.serviceAccountAuthConfig = $root.google.cloud.ces.v1.ServiceAccountAuthConfig.fromObject(object.serviceAccountAuthConfig); + } + if (object.bearerTokenConfig != null) { + if (typeof object.bearerTokenConfig !== "object") + throw TypeError(".google.cloud.ces.v1.ApiAuthentication.bearerTokenConfig: object expected"); + message.bearerTokenConfig = $root.google.cloud.ces.v1.BearerTokenConfig.fromObject(object.bearerTokenConfig); + } + return message; + }; + + /** + * Creates a plain object from an ApiAuthentication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ApiAuthentication + * @static + * @param {google.cloud.ces.v1.ApiAuthentication} message ApiAuthentication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiAuthentication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) { + object.apiKeyConfig = $root.google.cloud.ces.v1.ApiKeyConfig.toObject(message.apiKeyConfig, options); + if (options.oneofs) + object.authConfig = "apiKeyConfig"; + } + if (message.oauthConfig != null && message.hasOwnProperty("oauthConfig")) { + object.oauthConfig = $root.google.cloud.ces.v1.OAuthConfig.toObject(message.oauthConfig, options); + if (options.oneofs) + object.authConfig = "oauthConfig"; + } + if (message.serviceAgentIdTokenAuthConfig != null && message.hasOwnProperty("serviceAgentIdTokenAuthConfig")) { + object.serviceAgentIdTokenAuthConfig = $root.google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig.toObject(message.serviceAgentIdTokenAuthConfig, options); + if (options.oneofs) + object.authConfig = "serviceAgentIdTokenAuthConfig"; + } + if (message.serviceAccountAuthConfig != null && message.hasOwnProperty("serviceAccountAuthConfig")) { + object.serviceAccountAuthConfig = $root.google.cloud.ces.v1.ServiceAccountAuthConfig.toObject(message.serviceAccountAuthConfig, options); + if (options.oneofs) + object.authConfig = "serviceAccountAuthConfig"; + } + if (message.bearerTokenConfig != null && message.hasOwnProperty("bearerTokenConfig")) { + object.bearerTokenConfig = $root.google.cloud.ces.v1.BearerTokenConfig.toObject(message.bearerTokenConfig, options); + if (options.oneofs) + object.authConfig = "bearerTokenConfig"; + } + return object; + }; + + /** + * Converts this ApiAuthentication to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ApiAuthentication + * @instance + * @returns {Object.} JSON object + */ + ApiAuthentication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiAuthentication + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ApiAuthentication + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiAuthentication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ApiAuthentication"; + }; + + return ApiAuthentication; + })(); + + v1.DataStoreTool = (function() { + + /** + * Properties of a DataStoreTool. + * @memberof google.cloud.ces.v1 + * @interface IDataStoreTool + * @property {google.cloud.ces.v1.DataStoreTool.IDataStoreSource|null} [dataStoreSource] DataStoreTool dataStoreSource + * @property {google.cloud.ces.v1.DataStoreTool.IEngineSource|null} [engineSource] DataStoreTool engineSource + * @property {string|null} [name] DataStoreTool name + * @property {string|null} [description] DataStoreTool description + * @property {Array.|null} [boostSpecs] DataStoreTool boostSpecs + * @property {Array.|null} [modalityConfigs] DataStoreTool modalityConfigs + * @property {google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior|null} [filterParameterBehavior] DataStoreTool filterParameterBehavior + */ + + /** + * Constructs a new DataStoreTool. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a DataStoreTool. + * @implements IDataStoreTool + * @constructor + * @param {google.cloud.ces.v1.IDataStoreTool=} [properties] Properties to set + */ + function DataStoreTool(properties) { + this.boostSpecs = []; + this.modalityConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStoreTool dataStoreSource. + * @member {google.cloud.ces.v1.DataStoreTool.IDataStoreSource|null|undefined} dataStoreSource + * @memberof google.cloud.ces.v1.DataStoreTool + * @instance + */ + DataStoreTool.prototype.dataStoreSource = null; + + /** + * DataStoreTool engineSource. + * @member {google.cloud.ces.v1.DataStoreTool.IEngineSource|null|undefined} engineSource + * @memberof google.cloud.ces.v1.DataStoreTool + * @instance + */ + DataStoreTool.prototype.engineSource = null; + + /** + * DataStoreTool name. + * @member {string} name + * @memberof google.cloud.ces.v1.DataStoreTool + * @instance + */ + DataStoreTool.prototype.name = ""; + + /** + * DataStoreTool description. + * @member {string} description + * @memberof google.cloud.ces.v1.DataStoreTool + * @instance + */ + DataStoreTool.prototype.description = ""; + + /** + * DataStoreTool boostSpecs. + * @member {Array.} boostSpecs + * @memberof google.cloud.ces.v1.DataStoreTool + * @instance + */ + DataStoreTool.prototype.boostSpecs = $util.emptyArray; + + /** + * DataStoreTool modalityConfigs. + * @member {Array.} modalityConfigs + * @memberof google.cloud.ces.v1.DataStoreTool + * @instance + */ + DataStoreTool.prototype.modalityConfigs = $util.emptyArray; + + /** + * DataStoreTool filterParameterBehavior. + * @member {google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior} filterParameterBehavior + * @memberof google.cloud.ces.v1.DataStoreTool + * @instance + */ + DataStoreTool.prototype.filterParameterBehavior = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DataStoreTool searchSource. + * @member {"dataStoreSource"|"engineSource"|undefined} searchSource + * @memberof google.cloud.ces.v1.DataStoreTool + * @instance + */ + Object.defineProperty(DataStoreTool.prototype, "searchSource", { + get: $util.oneOfGetter($oneOfFields = ["dataStoreSource", "engineSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataStoreTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DataStoreTool + * @static + * @param {google.cloud.ces.v1.IDataStoreTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DataStoreTool} DataStoreTool instance + */ + DataStoreTool.create = function create(properties) { + return new DataStoreTool(properties); + }; + + /** + * Encodes the specified DataStoreTool message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DataStoreTool + * @static + * @param {google.cloud.ces.v1.IDataStoreTool} message DataStoreTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.dataStoreSource != null && Object.hasOwnProperty.call(message, "dataStoreSource")) + $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.encode(message.dataStoreSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.engineSource != null && Object.hasOwnProperty.call(message, "engineSource")) + $root.google.cloud.ces.v1.DataStoreTool.EngineSource.encode(message.engineSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.boostSpecs != null && message.boostSpecs.length) + for (var i = 0; i < message.boostSpecs.length; ++i) + $root.google.cloud.ces.v1.DataStoreTool.BoostSpecs.encode(message.boostSpecs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.modalityConfigs != null && message.modalityConfigs.length) + for (var i = 0; i < message.modalityConfigs.length; ++i) + $root.google.cloud.ces.v1.DataStoreTool.ModalityConfig.encode(message.modalityConfigs[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.filterParameterBehavior != null && Object.hasOwnProperty.call(message, "filterParameterBehavior")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.filterParameterBehavior); + return writer; + }; + + /** + * Encodes the specified DataStoreTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool + * @static + * @param {google.cloud.ces.v1.IDataStoreTool} message DataStoreTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DataStoreTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DataStoreTool} DataStoreTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.dataStoreSource = $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.engineSource = $root.google.cloud.ces.v1.DataStoreTool.EngineSource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 8: { + if (!(message.boostSpecs && message.boostSpecs.length)) + message.boostSpecs = []; + message.boostSpecs.push($root.google.cloud.ces.v1.DataStoreTool.BoostSpecs.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.modalityConfigs && message.modalityConfigs.length)) + message.modalityConfigs = []; + message.modalityConfigs.push($root.google.cloud.ces.v1.DataStoreTool.ModalityConfig.decode(reader, reader.uint32())); + break; + } + case 10: { + message.filterParameterBehavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DataStoreTool} DataStoreTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStoreTool message. + * @function verify + * @memberof google.cloud.ces.v1.DataStoreTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStoreTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataStoreSource != null && message.hasOwnProperty("dataStoreSource")) { + properties.searchSource = 1; + { + var error = $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.verify(message.dataStoreSource); + if (error) + return "dataStoreSource." + error; + } + } + if (message.engineSource != null && message.hasOwnProperty("engineSource")) { + if (properties.searchSource === 1) + return "searchSource: multiple values"; + properties.searchSource = 1; + { + var error = $root.google.cloud.ces.v1.DataStoreTool.EngineSource.verify(message.engineSource); + if (error) + return "engineSource." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.boostSpecs != null && message.hasOwnProperty("boostSpecs")) { + if (!Array.isArray(message.boostSpecs)) + return "boostSpecs: array expected"; + for (var i = 0; i < message.boostSpecs.length; ++i) { + var error = $root.google.cloud.ces.v1.DataStoreTool.BoostSpecs.verify(message.boostSpecs[i]); + if (error) + return "boostSpecs." + error; + } + } + if (message.modalityConfigs != null && message.hasOwnProperty("modalityConfigs")) { + if (!Array.isArray(message.modalityConfigs)) + return "modalityConfigs: array expected"; + for (var i = 0; i < message.modalityConfigs.length; ++i) { + var error = $root.google.cloud.ces.v1.DataStoreTool.ModalityConfig.verify(message.modalityConfigs[i]); + if (error) + return "modalityConfigs." + error; + } + } + if (message.filterParameterBehavior != null && message.hasOwnProperty("filterParameterBehavior")) + switch (message.filterParameterBehavior) { + default: + return "filterParameterBehavior: enum value expected"; + case 0: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a DataStoreTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DataStoreTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DataStoreTool} DataStoreTool + */ + DataStoreTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DataStoreTool) + return object; + var message = new $root.google.cloud.ces.v1.DataStoreTool(); + if (object.dataStoreSource != null) { + if (typeof object.dataStoreSource !== "object") + throw TypeError(".google.cloud.ces.v1.DataStoreTool.dataStoreSource: object expected"); + message.dataStoreSource = $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.fromObject(object.dataStoreSource); + } + if (object.engineSource != null) { + if (typeof object.engineSource !== "object") + throw TypeError(".google.cloud.ces.v1.DataStoreTool.engineSource: object expected"); + message.engineSource = $root.google.cloud.ces.v1.DataStoreTool.EngineSource.fromObject(object.engineSource); + } + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.boostSpecs) { + if (!Array.isArray(object.boostSpecs)) + throw TypeError(".google.cloud.ces.v1.DataStoreTool.boostSpecs: array expected"); + message.boostSpecs = []; + for (var i = 0; i < object.boostSpecs.length; ++i) { + if (typeof object.boostSpecs[i] !== "object") + throw TypeError(".google.cloud.ces.v1.DataStoreTool.boostSpecs: object expected"); + message.boostSpecs[i] = $root.google.cloud.ces.v1.DataStoreTool.BoostSpecs.fromObject(object.boostSpecs[i]); + } + } + if (object.modalityConfigs) { + if (!Array.isArray(object.modalityConfigs)) + throw TypeError(".google.cloud.ces.v1.DataStoreTool.modalityConfigs: array expected"); + message.modalityConfigs = []; + for (var i = 0; i < object.modalityConfigs.length; ++i) { + if (typeof object.modalityConfigs[i] !== "object") + throw TypeError(".google.cloud.ces.v1.DataStoreTool.modalityConfigs: object expected"); + message.modalityConfigs[i] = $root.google.cloud.ces.v1.DataStoreTool.ModalityConfig.fromObject(object.modalityConfigs[i]); + } + } + switch (object.filterParameterBehavior) { + default: + if (typeof object.filterParameterBehavior === "number") { + message.filterParameterBehavior = object.filterParameterBehavior; + break; + } + break; + case "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED": + case 0: + message.filterParameterBehavior = 0; + break; + case "ALWAYS_INCLUDE": + case 2: + message.filterParameterBehavior = 2; + break; + case "NEVER_INCLUDE": + case 3: + message.filterParameterBehavior = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a DataStoreTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DataStoreTool + * @static + * @param {google.cloud.ces.v1.DataStoreTool} message DataStoreTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStoreTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.boostSpecs = []; + object.modalityConfigs = []; + } + if (options.defaults) { + object.name = ""; + object.description = ""; + object.filterParameterBehavior = options.enums === String ? "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.dataStoreSource != null && message.hasOwnProperty("dataStoreSource")) { + object.dataStoreSource = $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.toObject(message.dataStoreSource, options); + if (options.oneofs) + object.searchSource = "dataStoreSource"; + } + if (message.engineSource != null && message.hasOwnProperty("engineSource")) { + object.engineSource = $root.google.cloud.ces.v1.DataStoreTool.EngineSource.toObject(message.engineSource, options); + if (options.oneofs) + object.searchSource = "engineSource"; + } + if (message.boostSpecs && message.boostSpecs.length) { + object.boostSpecs = []; + for (var j = 0; j < message.boostSpecs.length; ++j) + object.boostSpecs[j] = $root.google.cloud.ces.v1.DataStoreTool.BoostSpecs.toObject(message.boostSpecs[j], options); + } + if (message.modalityConfigs && message.modalityConfigs.length) { + object.modalityConfigs = []; + for (var j = 0; j < message.modalityConfigs.length; ++j) + object.modalityConfigs[j] = $root.google.cloud.ces.v1.DataStoreTool.ModalityConfig.toObject(message.modalityConfigs[j], options); + } + if (message.filterParameterBehavior != null && message.hasOwnProperty("filterParameterBehavior")) + object.filterParameterBehavior = options.enums === String ? $root.google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior[message.filterParameterBehavior] === undefined ? message.filterParameterBehavior : $root.google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior[message.filterParameterBehavior] : message.filterParameterBehavior; + return object; + }; + + /** + * Converts this DataStoreTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DataStoreTool + * @instance + * @returns {Object.} JSON object + */ + DataStoreTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStoreTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DataStoreTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStoreTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool"; + }; + + DataStoreTool.RewriterConfig = (function() { + + /** + * Properties of a RewriterConfig. + * @memberof google.cloud.ces.v1.DataStoreTool + * @interface IRewriterConfig + * @property {google.cloud.ces.v1.IModelSettings|null} [modelSettings] RewriterConfig modelSettings + * @property {string|null} [prompt] RewriterConfig prompt + * @property {boolean|null} [disabled] RewriterConfig disabled + */ + + /** + * Constructs a new RewriterConfig. + * @memberof google.cloud.ces.v1.DataStoreTool + * @classdesc Represents a RewriterConfig. + * @implements IRewriterConfig + * @constructor + * @param {google.cloud.ces.v1.DataStoreTool.IRewriterConfig=} [properties] Properties to set + */ + function RewriterConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RewriterConfig modelSettings. + * @member {google.cloud.ces.v1.IModelSettings|null|undefined} modelSettings + * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig + * @instance + */ + RewriterConfig.prototype.modelSettings = null; + + /** + * RewriterConfig prompt. + * @member {string} prompt + * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig + * @instance + */ + RewriterConfig.prototype.prompt = ""; + + /** + * RewriterConfig disabled. + * @member {boolean} disabled + * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig + * @instance + */ + RewriterConfig.prototype.disabled = false; + + /** + * Creates a new RewriterConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IRewriterConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DataStoreTool.RewriterConfig} RewriterConfig instance + */ + RewriterConfig.create = function create(properties) { + return new RewriterConfig(properties); + }; + + /** + * Encodes the specified RewriterConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.RewriterConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IRewriterConfig} message RewriterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RewriterConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) + $root.google.cloud.ces.v1.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.prompt); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.disabled); + return writer; + }; + + /** + * Encodes the specified RewriterConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.RewriterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IRewriterConfig} message RewriterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RewriterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RewriterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DataStoreTool.RewriterConfig} RewriterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RewriterConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.RewriterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.prompt = reader.string(); + break; + } + case 3: { + message.disabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RewriterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DataStoreTool.RewriterConfig} RewriterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RewriterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RewriterConfig message. + * @function verify + * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RewriterConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { + var error = $root.google.cloud.ces.v1.ModelSettings.verify(message.modelSettings); + if (error) + return "modelSettings." + error; + } + if (message.prompt != null && message.hasOwnProperty("prompt")) + if (!$util.isString(message.prompt)) + return "prompt: string expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + return null; + }; + + /** + * Creates a RewriterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DataStoreTool.RewriterConfig} RewriterConfig + */ + RewriterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.RewriterConfig) + return object; + var message = new $root.google.cloud.ces.v1.DataStoreTool.RewriterConfig(); + if (object.modelSettings != null) { + if (typeof object.modelSettings !== "object") + throw TypeError(".google.cloud.ces.v1.DataStoreTool.RewriterConfig.modelSettings: object expected"); + message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.fromObject(object.modelSettings); + } + if (object.prompt != null) + message.prompt = String(object.prompt); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + return message; + }; + + /** + * Creates a plain object from a RewriterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig + * @static + * @param {google.cloud.ces.v1.DataStoreTool.RewriterConfig} message RewriterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RewriterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modelSettings = null; + object.prompt = ""; + object.disabled = false; + } + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) + object.modelSettings = $root.google.cloud.ces.v1.ModelSettings.toObject(message.modelSettings, options); + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = message.prompt; + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + return object; + }; + + /** + * Converts this RewriterConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig + * @instance + * @returns {Object.} JSON object + */ + RewriterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RewriterConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RewriterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.RewriterConfig"; + }; + + return RewriterConfig; + })(); + + DataStoreTool.SummarizationConfig = (function() { + + /** + * Properties of a SummarizationConfig. + * @memberof google.cloud.ces.v1.DataStoreTool + * @interface ISummarizationConfig + * @property {google.cloud.ces.v1.IModelSettings|null} [modelSettings] SummarizationConfig modelSettings + * @property {string|null} [prompt] SummarizationConfig prompt + * @property {boolean|null} [disabled] SummarizationConfig disabled + */ + + /** + * Constructs a new SummarizationConfig. + * @memberof google.cloud.ces.v1.DataStoreTool + * @classdesc Represents a SummarizationConfig. + * @implements ISummarizationConfig + * @constructor + * @param {google.cloud.ces.v1.DataStoreTool.ISummarizationConfig=} [properties] Properties to set + */ + function SummarizationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SummarizationConfig modelSettings. + * @member {google.cloud.ces.v1.IModelSettings|null|undefined} modelSettings + * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig + * @instance + */ + SummarizationConfig.prototype.modelSettings = null; + + /** + * SummarizationConfig prompt. + * @member {string} prompt + * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig + * @instance + */ + SummarizationConfig.prototype.prompt = ""; + + /** + * SummarizationConfig disabled. + * @member {boolean} disabled + * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig + * @instance + */ + SummarizationConfig.prototype.disabled = false; + + /** + * Creates a new SummarizationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig + * @static + * @param {google.cloud.ces.v1.DataStoreTool.ISummarizationConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DataStoreTool.SummarizationConfig} SummarizationConfig instance + */ + SummarizationConfig.create = function create(properties) { + return new SummarizationConfig(properties); + }; + + /** + * Encodes the specified SummarizationConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.SummarizationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig + * @static + * @param {google.cloud.ces.v1.DataStoreTool.ISummarizationConfig} message SummarizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SummarizationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) + $root.google.cloud.ces.v1.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.prompt); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.disabled); + return writer; + }; + + /** + * Encodes the specified SummarizationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.SummarizationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig + * @static + * @param {google.cloud.ces.v1.DataStoreTool.ISummarizationConfig} message SummarizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SummarizationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SummarizationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DataStoreTool.SummarizationConfig} SummarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SummarizationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.SummarizationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.prompt = reader.string(); + break; + } + case 3: { + message.disabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SummarizationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DataStoreTool.SummarizationConfig} SummarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SummarizationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SummarizationConfig message. + * @function verify + * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SummarizationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { + var error = $root.google.cloud.ces.v1.ModelSettings.verify(message.modelSettings); + if (error) + return "modelSettings." + error; + } + if (message.prompt != null && message.hasOwnProperty("prompt")) + if (!$util.isString(message.prompt)) + return "prompt: string expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + return null; + }; + + /** + * Creates a SummarizationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DataStoreTool.SummarizationConfig} SummarizationConfig + */ + SummarizationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.SummarizationConfig) + return object; + var message = new $root.google.cloud.ces.v1.DataStoreTool.SummarizationConfig(); + if (object.modelSettings != null) { + if (typeof object.modelSettings !== "object") + throw TypeError(".google.cloud.ces.v1.DataStoreTool.SummarizationConfig.modelSettings: object expected"); + message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.fromObject(object.modelSettings); + } + if (object.prompt != null) + message.prompt = String(object.prompt); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + return message; + }; + + /** + * Creates a plain object from a SummarizationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig + * @static + * @param {google.cloud.ces.v1.DataStoreTool.SummarizationConfig} message SummarizationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SummarizationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modelSettings = null; + object.prompt = ""; + object.disabled = false; + } + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) + object.modelSettings = $root.google.cloud.ces.v1.ModelSettings.toObject(message.modelSettings, options); + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = message.prompt; + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + return object; + }; + + /** + * Converts this SummarizationConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig + * @instance + * @returns {Object.} JSON object + */ + SummarizationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SummarizationConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SummarizationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.SummarizationConfig"; + }; + + return SummarizationConfig; + })(); + + DataStoreTool.GroundingConfig = (function() { + + /** + * Properties of a GroundingConfig. + * @memberof google.cloud.ces.v1.DataStoreTool + * @interface IGroundingConfig + * @property {number|null} [groundingLevel] GroundingConfig groundingLevel + * @property {boolean|null} [disabled] GroundingConfig disabled + */ + + /** + * Constructs a new GroundingConfig. + * @memberof google.cloud.ces.v1.DataStoreTool + * @classdesc Represents a GroundingConfig. + * @implements IGroundingConfig + * @constructor + * @param {google.cloud.ces.v1.DataStoreTool.IGroundingConfig=} [properties] Properties to set + */ + function GroundingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroundingConfig groundingLevel. + * @member {number} groundingLevel + * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig + * @instance + */ + GroundingConfig.prototype.groundingLevel = 0; + + /** + * GroundingConfig disabled. + * @member {boolean} disabled + * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig + * @instance + */ + GroundingConfig.prototype.disabled = false; + + /** + * Creates a new GroundingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IGroundingConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DataStoreTool.GroundingConfig} GroundingConfig instance + */ + GroundingConfig.create = function create(properties) { + return new GroundingConfig(properties); + }; + + /** + * Encodes the specified GroundingConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.GroundingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IGroundingConfig} message GroundingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groundingLevel != null && Object.hasOwnProperty.call(message, "groundingLevel")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.groundingLevel); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.disabled); + return writer; + }; + + /** + * Encodes the specified GroundingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.GroundingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IGroundingConfig} message GroundingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroundingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DataStoreTool.GroundingConfig} GroundingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.GroundingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.groundingLevel = reader.float(); + break; + } + case 2: { + message.disabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroundingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DataStoreTool.GroundingConfig} GroundingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroundingConfig message. + * @function verify + * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroundingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groundingLevel != null && message.hasOwnProperty("groundingLevel")) + if (typeof message.groundingLevel !== "number") + return "groundingLevel: number expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + return null; + }; + + /** + * Creates a GroundingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DataStoreTool.GroundingConfig} GroundingConfig + */ + GroundingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.GroundingConfig) + return object; + var message = new $root.google.cloud.ces.v1.DataStoreTool.GroundingConfig(); + if (object.groundingLevel != null) + message.groundingLevel = Number(object.groundingLevel); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + return message; + }; + + /** + * Creates a plain object from a GroundingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig + * @static + * @param {google.cloud.ces.v1.DataStoreTool.GroundingConfig} message GroundingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroundingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.groundingLevel = 0; + object.disabled = false; + } + if (message.groundingLevel != null && message.hasOwnProperty("groundingLevel")) + object.groundingLevel = options.json && !isFinite(message.groundingLevel) ? String(message.groundingLevel) : message.groundingLevel; + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + return object; + }; + + /** + * Converts this GroundingConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig + * @instance + * @returns {Object.} JSON object + */ + GroundingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroundingConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroundingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.GroundingConfig"; + }; + + return GroundingConfig; + })(); + + DataStoreTool.DataStoreSource = (function() { + + /** + * Properties of a DataStoreSource. + * @memberof google.cloud.ces.v1.DataStoreTool + * @interface IDataStoreSource + * @property {string|null} [filter] DataStoreSource filter + * @property {google.cloud.ces.v1.IDataStore|null} [dataStore] DataStoreSource dataStore + */ + + /** + * Constructs a new DataStoreSource. + * @memberof google.cloud.ces.v1.DataStoreTool + * @classdesc Represents a DataStoreSource. + * @implements IDataStoreSource + * @constructor + * @param {google.cloud.ces.v1.DataStoreTool.IDataStoreSource=} [properties] Properties to set + */ + function DataStoreSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStoreSource filter. + * @member {string} filter + * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource + * @instance + */ + DataStoreSource.prototype.filter = ""; + + /** + * DataStoreSource dataStore. + * @member {google.cloud.ces.v1.IDataStore|null|undefined} dataStore + * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource + * @instance + */ + DataStoreSource.prototype.dataStore = null; + + /** + * Creates a new DataStoreSource instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IDataStoreSource=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DataStoreTool.DataStoreSource} DataStoreSource instance + */ + DataStoreSource.create = function create(properties) { + return new DataStoreSource(properties); + }; + + /** + * Encodes the specified DataStoreSource message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.DataStoreSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IDataStoreSource} message DataStoreSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.dataStore != null && Object.hasOwnProperty.call(message, "dataStore")) + $root.google.cloud.ces.v1.DataStore.encode(message.dataStore, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataStoreSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.DataStoreSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IDataStoreSource} message DataStoreSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStoreSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DataStoreTool.DataStoreSource} DataStoreSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.filter = reader.string(); + break; + } + case 4: { + message.dataStore = $root.google.cloud.ces.v1.DataStore.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataStoreSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DataStoreTool.DataStoreSource} DataStoreSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStoreSource message. + * @function verify + * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStoreSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.dataStore != null && message.hasOwnProperty("dataStore")) { + var error = $root.google.cloud.ces.v1.DataStore.verify(message.dataStore); + if (error) + return "dataStore." + error; + } + return null; + }; + + /** + * Creates a DataStoreSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DataStoreTool.DataStoreSource} DataStoreSource + */ + DataStoreSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource) + return object; + var message = new $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.dataStore != null) { + if (typeof object.dataStore !== "object") + throw TypeError(".google.cloud.ces.v1.DataStoreTool.DataStoreSource.dataStore: object expected"); + message.dataStore = $root.google.cloud.ces.v1.DataStore.fromObject(object.dataStore); + } + return message; + }; + + /** + * Creates a plain object from a DataStoreSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource + * @static + * @param {google.cloud.ces.v1.DataStoreTool.DataStoreSource} message DataStoreSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStoreSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.dataStore = null; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.dataStore != null && message.hasOwnProperty("dataStore")) + object.dataStore = $root.google.cloud.ces.v1.DataStore.toObject(message.dataStore, options); + return object; + }; + + /** + * Converts this DataStoreSource to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource + * @instance + * @returns {Object.} JSON object + */ + DataStoreSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStoreSource + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStoreSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.DataStoreSource"; + }; + + return DataStoreSource; + })(); + + DataStoreTool.EngineSource = (function() { + + /** + * Properties of an EngineSource. + * @memberof google.cloud.ces.v1.DataStoreTool + * @interface IEngineSource + * @property {string|null} [engine] EngineSource engine + * @property {Array.|null} [dataStoreSources] EngineSource dataStoreSources + * @property {string|null} [filter] EngineSource filter + */ + + /** + * Constructs a new EngineSource. + * @memberof google.cloud.ces.v1.DataStoreTool + * @classdesc Represents an EngineSource. + * @implements IEngineSource + * @constructor + * @param {google.cloud.ces.v1.DataStoreTool.IEngineSource=} [properties] Properties to set + */ + function EngineSource(properties) { + this.dataStoreSources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EngineSource engine. + * @member {string} engine + * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource + * @instance + */ + EngineSource.prototype.engine = ""; + + /** + * EngineSource dataStoreSources. + * @member {Array.} dataStoreSources + * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource + * @instance + */ + EngineSource.prototype.dataStoreSources = $util.emptyArray; + + /** + * EngineSource filter. + * @member {string} filter + * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource + * @instance + */ + EngineSource.prototype.filter = ""; + + /** + * Creates a new EngineSource instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IEngineSource=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DataStoreTool.EngineSource} EngineSource instance + */ + EngineSource.create = function create(properties) { + return new EngineSource(properties); + }; + + /** + * Encodes the specified EngineSource message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.EngineSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IEngineSource} message EngineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EngineSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.engine != null && Object.hasOwnProperty.call(message, "engine")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.engine); + if (message.dataStoreSources != null && message.dataStoreSources.length) + for (var i = 0; i < message.dataStoreSources.length; ++i) + $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.encode(message.dataStoreSources[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + return writer; + }; + + /** + * Encodes the specified EngineSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.EngineSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IEngineSource} message EngineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EngineSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EngineSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DataStoreTool.EngineSource} EngineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EngineSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.EngineSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.engine = reader.string(); + break; + } + case 2: { + if (!(message.dataStoreSources && message.dataStoreSources.length)) + message.dataStoreSources = []; + message.dataStoreSources.push($root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.decode(reader, reader.uint32())); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EngineSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DataStoreTool.EngineSource} EngineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EngineSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EngineSource message. + * @function verify + * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EngineSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.engine != null && message.hasOwnProperty("engine")) + if (!$util.isString(message.engine)) + return "engine: string expected"; + if (message.dataStoreSources != null && message.hasOwnProperty("dataStoreSources")) { + if (!Array.isArray(message.dataStoreSources)) + return "dataStoreSources: array expected"; + for (var i = 0; i < message.dataStoreSources.length; ++i) { + var error = $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.verify(message.dataStoreSources[i]); + if (error) + return "dataStoreSources." + error; + } + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates an EngineSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DataStoreTool.EngineSource} EngineSource + */ + EngineSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.EngineSource) + return object; + var message = new $root.google.cloud.ces.v1.DataStoreTool.EngineSource(); + if (object.engine != null) + message.engine = String(object.engine); + if (object.dataStoreSources) { + if (!Array.isArray(object.dataStoreSources)) + throw TypeError(".google.cloud.ces.v1.DataStoreTool.EngineSource.dataStoreSources: array expected"); + message.dataStoreSources = []; + for (var i = 0; i < object.dataStoreSources.length; ++i) { + if (typeof object.dataStoreSources[i] !== "object") + throw TypeError(".google.cloud.ces.v1.DataStoreTool.EngineSource.dataStoreSources: object expected"); + message.dataStoreSources[i] = $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.fromObject(object.dataStoreSources[i]); + } + } + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from an EngineSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource + * @static + * @param {google.cloud.ces.v1.DataStoreTool.EngineSource} message EngineSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EngineSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataStoreSources = []; + if (options.defaults) { + object.engine = ""; + object.filter = ""; + } + if (message.engine != null && message.hasOwnProperty("engine")) + object.engine = message.engine; + if (message.dataStoreSources && message.dataStoreSources.length) { + object.dataStoreSources = []; + for (var j = 0; j < message.dataStoreSources.length; ++j) + object.dataStoreSources[j] = $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.toObject(message.dataStoreSources[j], options); + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this EngineSource to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource + * @instance + * @returns {Object.} JSON object + */ + EngineSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EngineSource + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EngineSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.EngineSource"; + }; + + return EngineSource; + })(); + + DataStoreTool.BoostSpecs = (function() { + + /** + * Properties of a BoostSpecs. + * @memberof google.cloud.ces.v1.DataStoreTool + * @interface IBoostSpecs + * @property {Array.|null} [dataStores] BoostSpecs dataStores + * @property {Array.|null} [spec] BoostSpecs spec + */ + + /** + * Constructs a new BoostSpecs. + * @memberof google.cloud.ces.v1.DataStoreTool + * @classdesc Represents a BoostSpecs. + * @implements IBoostSpecs + * @constructor + * @param {google.cloud.ces.v1.DataStoreTool.IBoostSpecs=} [properties] Properties to set + */ + function BoostSpecs(properties) { + this.dataStores = []; + this.spec = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostSpecs dataStores. + * @member {Array.} dataStores + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs + * @instance + */ + BoostSpecs.prototype.dataStores = $util.emptyArray; + + /** + * BoostSpecs spec. + * @member {Array.} spec + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs + * @instance + */ + BoostSpecs.prototype.spec = $util.emptyArray; + + /** + * Creates a new BoostSpecs instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IBoostSpecs=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpecs} BoostSpecs instance + */ + BoostSpecs.create = function create(properties) { + return new BoostSpecs(properties); + }; + + /** + * Encodes the specified BoostSpecs message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpecs.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IBoostSpecs} message BoostSpecs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpecs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataStores != null && message.dataStores.length) + for (var i = 0; i < message.dataStores.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataStores[i]); + if (message.spec != null && message.spec.length) + for (var i = 0; i < message.spec.length; ++i) + $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.encode(message.spec[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoostSpecs message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpecs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IBoostSpecs} message BoostSpecs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpecs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpecs} BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpecs.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpecs(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataStores && message.dataStores.length)) + message.dataStores = []; + message.dataStores.push(reader.string()); + break; + } + case 2: { + if (!(message.spec && message.spec.length)) + message.spec = []; + message.spec.push($root.google.cloud.ces.v1.DataStoreTool.BoostSpec.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpecs} BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpecs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostSpecs message. + * @function verify + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostSpecs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataStores != null && message.hasOwnProperty("dataStores")) { + if (!Array.isArray(message.dataStores)) + return "dataStores: array expected"; + for (var i = 0; i < message.dataStores.length; ++i) + if (!$util.isString(message.dataStores[i])) + return "dataStores: string[] expected"; + } + if (message.spec != null && message.hasOwnProperty("spec")) { + if (!Array.isArray(message.spec)) + return "spec: array expected"; + for (var i = 0; i < message.spec.length; ++i) { + var error = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.verify(message.spec[i]); + if (error) + return "spec." + error; + } + } + return null; + }; + + /** + * Creates a BoostSpecs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpecs} BoostSpecs + */ + BoostSpecs.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.BoostSpecs) + return object; + var message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpecs(); + if (object.dataStores) { + if (!Array.isArray(object.dataStores)) + throw TypeError(".google.cloud.ces.v1.DataStoreTool.BoostSpecs.dataStores: array expected"); + message.dataStores = []; + for (var i = 0; i < object.dataStores.length; ++i) + message.dataStores[i] = String(object.dataStores[i]); + } + if (object.spec) { + if (!Array.isArray(object.spec)) + throw TypeError(".google.cloud.ces.v1.DataStoreTool.BoostSpecs.spec: array expected"); + message.spec = []; + for (var i = 0; i < object.spec.length; ++i) { + if (typeof object.spec[i] !== "object") + throw TypeError(".google.cloud.ces.v1.DataStoreTool.BoostSpecs.spec: object expected"); + message.spec[i] = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.fromObject(object.spec[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoostSpecs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs + * @static + * @param {google.cloud.ces.v1.DataStoreTool.BoostSpecs} message BoostSpecs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostSpecs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dataStores = []; + object.spec = []; + } + if (message.dataStores && message.dataStores.length) { + object.dataStores = []; + for (var j = 0; j < message.dataStores.length; ++j) + object.dataStores[j] = message.dataStores[j]; + } + if (message.spec && message.spec.length) { + object.spec = []; + for (var j = 0; j < message.spec.length; ++j) + object.spec[j] = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.toObject(message.spec[j], options); + } + return object; + }; + + /** + * Converts this BoostSpecs to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs + * @instance + * @returns {Object.} JSON object + */ + BoostSpecs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostSpecs + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostSpecs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.BoostSpecs"; + }; + + return BoostSpecs; + })(); + + DataStoreTool.BoostSpec = (function() { + + /** + * Properties of a BoostSpec. + * @memberof google.cloud.ces.v1.DataStoreTool + * @interface IBoostSpec + * @property {Array.|null} [conditionBoostSpecs] BoostSpec conditionBoostSpecs + */ + + /** + * Constructs a new BoostSpec. + * @memberof google.cloud.ces.v1.DataStoreTool + * @classdesc Represents a BoostSpec. + * @implements IBoostSpec + * @constructor + * @param {google.cloud.ces.v1.DataStoreTool.IBoostSpec=} [properties] Properties to set + */ + function BoostSpec(properties) { + this.conditionBoostSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostSpec conditionBoostSpecs. + * @member {Array.} conditionBoostSpecs + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec + * @instance + */ + BoostSpec.prototype.conditionBoostSpecs = $util.emptyArray; + + /** + * Creates a new BoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IBoostSpec=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec} BoostSpec instance + */ + BoostSpec.create = function create(properties) { + return new BoostSpec(properties); + }; + + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IBoostSpec} message BoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditionBoostSpecs != null && message.conditionBoostSpecs.length) + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) + $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.encode(message.conditionBoostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IBoostSpec} message BoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec} BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.conditionBoostSpecs && message.conditionBoostSpecs.length)) + message.conditionBoostSpecs = []; + message.conditionBoostSpecs.push($root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec} BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostSpec message. + * @function verify + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conditionBoostSpecs != null && message.hasOwnProperty("conditionBoostSpecs")) { + if (!Array.isArray(message.conditionBoostSpecs)) + return "conditionBoostSpecs: array expected"; + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) { + var error = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.verify(message.conditionBoostSpecs[i]); + if (error) + return "conditionBoostSpecs." + error; + } + } + return null; + }; + + /** + * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec} BoostSpec + */ + BoostSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.BoostSpec) + return object; + var message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpec(); + if (object.conditionBoostSpecs) { + if (!Array.isArray(object.conditionBoostSpecs)) + throw TypeError(".google.cloud.ces.v1.DataStoreTool.BoostSpec.conditionBoostSpecs: array expected"); + message.conditionBoostSpecs = []; + for (var i = 0; i < object.conditionBoostSpecs.length; ++i) { + if (typeof object.conditionBoostSpecs[i] !== "object") + throw TypeError(".google.cloud.ces.v1.DataStoreTool.BoostSpec.conditionBoostSpecs: object expected"); + message.conditionBoostSpecs[i] = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.fromObject(object.conditionBoostSpecs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec + * @static + * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec} message BoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conditionBoostSpecs = []; + if (message.conditionBoostSpecs && message.conditionBoostSpecs.length) { + object.conditionBoostSpecs = []; + for (var j = 0; j < message.conditionBoostSpecs.length; ++j) + object.conditionBoostSpecs[j] = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.toObject(message.conditionBoostSpecs[j], options); + } + return object; + }; + + /** + * Converts this BoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec + * @instance + * @returns {Object.} JSON object + */ + BoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostSpec + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.BoostSpec"; + }; + + BoostSpec.ConditionBoostSpec = (function() { + + /** + * Properties of a ConditionBoostSpec. + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec + * @interface IConditionBoostSpec + * @property {string|null} [condition] ConditionBoostSpec condition + * @property {number|null} [boost] ConditionBoostSpec boost + * @property {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null} [boostControlSpec] ConditionBoostSpec boostControlSpec + */ + + /** + * Constructs a new ConditionBoostSpec. + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec + * @classdesc Represents a ConditionBoostSpec. + * @implements IConditionBoostSpec + * @constructor + * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + */ + function ConditionBoostSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConditionBoostSpec condition. + * @member {string} condition + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.condition = ""; + + /** + * ConditionBoostSpec boost. + * @member {number} boost + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.boost = 0; + + /** + * ConditionBoostSpec boostControlSpec. + * @member {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null|undefined} boostControlSpec + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.boostControlSpec = null; + + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec instance + */ + ConditionBoostSpec.create = function create(properties) { + return new ConditionBoostSpec(properties); + }; + + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); + if (message.boostControlSpec != null && Object.hasOwnProperty.call(message, "boostControlSpec")) + $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.encode(message.boostControlSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.condition = reader.string(); + break; + } + case 2: { + message.boost = reader.float(); + break; + } + case 4: { + message.boostControlSpec = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionBoostSpec message. + * @function verify + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionBoostSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + if (message.boostControlSpec != null && message.hasOwnProperty("boostControlSpec")) { + var error = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify(message.boostControlSpec); + if (error) + return "boostControlSpec." + error; + } + return null; + }; + + /** + * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + */ + ConditionBoostSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec) + return object; + var message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec(); + if (object.condition != null) + message.condition = String(object.condition); + if (object.boost != null) + message.boost = Number(object.boost); + if (object.boostControlSpec != null) { + if (typeof object.boostControlSpec !== "object") + throw TypeError(".google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.boostControlSpec: object expected"); + message.boostControlSpec = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.fromObject(object.boostControlSpec); + } + return message; + }; + + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec} message ConditionBoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionBoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.condition = ""; + object.boost = 0; + object.boostControlSpec = null; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + if (message.boostControlSpec != null && message.hasOwnProperty("boostControlSpec")) + object.boostControlSpec = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.toObject(message.boostControlSpec, options); + return object; + }; + + /** + * Converts this ConditionBoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec + * @instance + * @returns {Object.} JSON object + */ + ConditionBoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConditionBoostSpec + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConditionBoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec"; + }; + + ConditionBoostSpec.BoostControlSpec = (function() { + + /** + * Properties of a BoostControlSpec. + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec + * @interface IBoostControlSpec + * @property {string|null} [fieldName] BoostControlSpec fieldName + * @property {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|null} [attributeType] BoostControlSpec attributeType + * @property {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|null} [interpolationType] BoostControlSpec interpolationType + * @property {Array.|null} [controlPoints] BoostControlSpec controlPoints + */ + + /** + * Constructs a new BoostControlSpec. + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec + * @classdesc Represents a BoostControlSpec. + * @implements IBoostControlSpec + * @constructor + * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec=} [properties] Properties to set + */ + function BoostControlSpec(properties) { + this.controlPoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostControlSpec fieldName. + * @member {string} fieldName + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.fieldName = ""; + + /** + * BoostControlSpec attributeType. + * @member {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType} attributeType + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.attributeType = 0; + + /** + * BoostControlSpec interpolationType. + * @member {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType} interpolationType + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.interpolationType = 0; + + /** + * BoostControlSpec controlPoints. + * @member {Array.} controlPoints + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.controlPoints = $util.emptyArray; + + /** + * Creates a new BoostControlSpec instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec instance + */ + BoostControlSpec.create = function create(properties) { + return new BoostControlSpec(properties); + }; + + /** + * Encodes the specified BoostControlSpec message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec} message BoostControlSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostControlSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldName); + if (message.attributeType != null && Object.hasOwnProperty.call(message, "attributeType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.attributeType); + if (message.interpolationType != null && Object.hasOwnProperty.call(message, "interpolationType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.interpolationType); + if (message.controlPoints != null && message.controlPoints.length) + for (var i = 0; i < message.controlPoints.length; ++i) + $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.encode(message.controlPoints[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoostControlSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec} message BoostControlSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostControlSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostControlSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldName = reader.string(); + break; + } + case 2: { + message.attributeType = reader.int32(); + break; + } + case 3: { + message.interpolationType = reader.int32(); + break; + } + case 4: { + if (!(message.controlPoints && message.controlPoints.length)) + message.controlPoints = []; + message.controlPoints.push($root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostControlSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostControlSpec message. + * @function verify + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostControlSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + if (message.attributeType != null && message.hasOwnProperty("attributeType")) + switch (message.attributeType) { + default: + return "attributeType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.interpolationType != null && message.hasOwnProperty("interpolationType")) + switch (message.interpolationType) { + default: + return "interpolationType: enum value expected"; + case 0: + case 1: + break; + } + if (message.controlPoints != null && message.hasOwnProperty("controlPoints")) { + if (!Array.isArray(message.controlPoints)) + return "controlPoints: array expected"; + for (var i = 0; i < message.controlPoints.length; ++i) { + var error = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify(message.controlPoints[i]); + if (error) + return "controlPoints." + error; + } + } + return null; + }; + + /** + * Creates a BoostControlSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + */ + BoostControlSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec) + return object; + var message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec(); + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + switch (object.attributeType) { + default: + if (typeof object.attributeType === "number") { + message.attributeType = object.attributeType; + break; + } + break; + case "ATTRIBUTE_TYPE_UNSPECIFIED": + case 0: + message.attributeType = 0; + break; + case "NUMERICAL": + case 1: + message.attributeType = 1; + break; + case "FRESHNESS": + case 2: + message.attributeType = 2; + break; + } + switch (object.interpolationType) { + default: + if (typeof object.interpolationType === "number") { + message.interpolationType = object.interpolationType; + break; + } + break; + case "INTERPOLATION_TYPE_UNSPECIFIED": + case 0: + message.interpolationType = 0; + break; + case "LINEAR": + case 1: + message.interpolationType = 1; + break; + } + if (object.controlPoints) { + if (!Array.isArray(object.controlPoints)) + throw TypeError(".google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.controlPoints: array expected"); + message.controlPoints = []; + for (var i = 0; i < object.controlPoints.length; ++i) { + if (typeof object.controlPoints[i] !== "object") + throw TypeError(".google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.controlPoints: object expected"); + message.controlPoints[i] = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.fromObject(object.controlPoints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoostControlSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} message BoostControlSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostControlSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.controlPoints = []; + if (options.defaults) { + object.fieldName = ""; + object.attributeType = options.enums === String ? "ATTRIBUTE_TYPE_UNSPECIFIED" : 0; + object.interpolationType = options.enums === String ? "INTERPOLATION_TYPE_UNSPECIFIED" : 0; + } + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + object.fieldName = message.fieldName; + if (message.attributeType != null && message.hasOwnProperty("attributeType")) + object.attributeType = options.enums === String ? $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType[message.attributeType] === undefined ? message.attributeType : $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType[message.attributeType] : message.attributeType; + if (message.interpolationType != null && message.hasOwnProperty("interpolationType")) + object.interpolationType = options.enums === String ? $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType[message.interpolationType] === undefined ? message.interpolationType : $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType[message.interpolationType] : message.interpolationType; + if (message.controlPoints && message.controlPoints.length) { + object.controlPoints = []; + for (var j = 0; j < message.controlPoints.length; ++j) + object.controlPoints[j] = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.toObject(message.controlPoints[j], options); + } + return object; + }; + + /** + * Converts this BoostControlSpec to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + * @returns {Object.} JSON object + */ + BoostControlSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostControlSpec + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostControlSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec"; + }; + + BoostControlSpec.ControlPoint = (function() { + + /** + * Properties of a ControlPoint. + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @interface IControlPoint + * @property {string|null} [attributeValue] ControlPoint attributeValue + * @property {number|null} [boostAmount] ControlPoint boostAmount + */ + + /** + * Constructs a new ControlPoint. + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @classdesc Represents a ControlPoint. + * @implements IControlPoint + * @constructor + * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint=} [properties] Properties to set + */ + function ControlPoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ControlPoint attributeValue. + * @member {string} attributeValue + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @instance + */ + ControlPoint.prototype.attributeValue = ""; + + /** + * ControlPoint boostAmount. + * @member {number} boostAmount + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @instance + */ + ControlPoint.prototype.boostAmount = 0; + + /** + * Creates a new ControlPoint instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint instance + */ + ControlPoint.create = function create(properties) { + return new ControlPoint(properties); + }; + + /** + * Encodes the specified ControlPoint message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint} message ControlPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ControlPoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributeValue != null && Object.hasOwnProperty.call(message, "attributeValue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributeValue); + if (message.boostAmount != null && Object.hasOwnProperty.call(message, "boostAmount")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boostAmount); + return writer; + }; + + /** + * Encodes the specified ControlPoint message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint} message ControlPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ControlPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ControlPoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ControlPoint.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.attributeValue = reader.string(); + break; + } + case 2: { + message.boostAmount = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ControlPoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ControlPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ControlPoint message. + * @function verify + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ControlPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributeValue != null && message.hasOwnProperty("attributeValue")) + if (!$util.isString(message.attributeValue)) + return "attributeValue: string expected"; + if (message.boostAmount != null && message.hasOwnProperty("boostAmount")) + if (typeof message.boostAmount !== "number") + return "boostAmount: number expected"; + return null; + }; + + /** + * Creates a ControlPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + */ + ControlPoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint) + return object; + var message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint(); + if (object.attributeValue != null) + message.attributeValue = String(object.attributeValue); + if (object.boostAmount != null) + message.boostAmount = Number(object.boostAmount); + return message; + }; + + /** + * Creates a plain object from a ControlPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} message ControlPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ControlPoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attributeValue = ""; + object.boostAmount = 0; + } + if (message.attributeValue != null && message.hasOwnProperty("attributeValue")) + object.attributeValue = message.attributeValue; + if (message.boostAmount != null && message.hasOwnProperty("boostAmount")) + object.boostAmount = options.json && !isFinite(message.boostAmount) ? String(message.boostAmount) : message.boostAmount; + return object; + }; + + /** + * Converts this ControlPoint to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @instance + * @returns {Object.} JSON object + */ + ControlPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ControlPoint + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ControlPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint"; + }; + + return ControlPoint; + })(); + + /** + * AttributeType enum. + * @name google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType + * @enum {number} + * @property {number} ATTRIBUTE_TYPE_UNSPECIFIED=0 ATTRIBUTE_TYPE_UNSPECIFIED value + * @property {number} NUMERICAL=1 NUMERICAL value + * @property {number} FRESHNESS=2 FRESHNESS value + */ + BoostControlSpec.AttributeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ATTRIBUTE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NUMERICAL"] = 1; + values[valuesById[2] = "FRESHNESS"] = 2; + return values; + })(); + + /** + * InterpolationType enum. + * @name google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType + * @enum {number} + * @property {number} INTERPOLATION_TYPE_UNSPECIFIED=0 INTERPOLATION_TYPE_UNSPECIFIED value + * @property {number} LINEAR=1 LINEAR value + */ + BoostControlSpec.InterpolationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTERPOLATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINEAR"] = 1; + return values; + })(); + + return BoostControlSpec; + })(); + + return ConditionBoostSpec; + })(); + + return BoostSpec; + })(); + + DataStoreTool.ModalityConfig = (function() { + + /** + * Properties of a ModalityConfig. + * @memberof google.cloud.ces.v1.DataStoreTool + * @interface IModalityConfig + * @property {google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType|null} [modalityType] ModalityConfig modalityType + * @property {google.cloud.ces.v1.DataStoreTool.IRewriterConfig|null} [rewriterConfig] ModalityConfig rewriterConfig + * @property {google.cloud.ces.v1.DataStoreTool.ISummarizationConfig|null} [summarizationConfig] ModalityConfig summarizationConfig + * @property {google.cloud.ces.v1.DataStoreTool.IGroundingConfig|null} [groundingConfig] ModalityConfig groundingConfig + */ + + /** + * Constructs a new ModalityConfig. + * @memberof google.cloud.ces.v1.DataStoreTool + * @classdesc Represents a ModalityConfig. + * @implements IModalityConfig + * @constructor + * @param {google.cloud.ces.v1.DataStoreTool.IModalityConfig=} [properties] Properties to set + */ + function ModalityConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModalityConfig modalityType. + * @member {google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType} modalityType + * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig + * @instance + */ + ModalityConfig.prototype.modalityType = 0; + + /** + * ModalityConfig rewriterConfig. + * @member {google.cloud.ces.v1.DataStoreTool.IRewriterConfig|null|undefined} rewriterConfig + * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig + * @instance + */ + ModalityConfig.prototype.rewriterConfig = null; + + /** + * ModalityConfig summarizationConfig. + * @member {google.cloud.ces.v1.DataStoreTool.ISummarizationConfig|null|undefined} summarizationConfig + * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig + * @instance + */ + ModalityConfig.prototype.summarizationConfig = null; + + /** + * ModalityConfig groundingConfig. + * @member {google.cloud.ces.v1.DataStoreTool.IGroundingConfig|null|undefined} groundingConfig + * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig + * @instance + */ + ModalityConfig.prototype.groundingConfig = null; + + /** + * Creates a new ModalityConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IModalityConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DataStoreTool.ModalityConfig} ModalityConfig instance + */ + ModalityConfig.create = function create(properties) { + return new ModalityConfig(properties); + }; + + /** + * Encodes the specified ModalityConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.ModalityConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IModalityConfig} message ModalityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModalityConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modalityType != null && Object.hasOwnProperty.call(message, "modalityType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modalityType); + if (message.rewriterConfig != null && Object.hasOwnProperty.call(message, "rewriterConfig")) + $root.google.cloud.ces.v1.DataStoreTool.RewriterConfig.encode(message.rewriterConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.summarizationConfig != null && Object.hasOwnProperty.call(message, "summarizationConfig")) + $root.google.cloud.ces.v1.DataStoreTool.SummarizationConfig.encode(message.summarizationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.groundingConfig != null && Object.hasOwnProperty.call(message, "groundingConfig")) + $root.google.cloud.ces.v1.DataStoreTool.GroundingConfig.encode(message.groundingConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModalityConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.ModalityConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig + * @static + * @param {google.cloud.ces.v1.DataStoreTool.IModalityConfig} message ModalityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModalityConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModalityConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DataStoreTool.ModalityConfig} ModalityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModalityConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.ModalityConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.modalityType = reader.int32(); + break; + } + case 2: { + message.rewriterConfig = $root.google.cloud.ces.v1.DataStoreTool.RewriterConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.summarizationConfig = $root.google.cloud.ces.v1.DataStoreTool.SummarizationConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.groundingConfig = $root.google.cloud.ces.v1.DataStoreTool.GroundingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModalityConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DataStoreTool.ModalityConfig} ModalityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModalityConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModalityConfig message. + * @function verify + * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModalityConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modalityType != null && message.hasOwnProperty("modalityType")) + switch (message.modalityType) { + default: + return "modalityType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.rewriterConfig != null && message.hasOwnProperty("rewriterConfig")) { + var error = $root.google.cloud.ces.v1.DataStoreTool.RewriterConfig.verify(message.rewriterConfig); + if (error) + return "rewriterConfig." + error; + } + if (message.summarizationConfig != null && message.hasOwnProperty("summarizationConfig")) { + var error = $root.google.cloud.ces.v1.DataStoreTool.SummarizationConfig.verify(message.summarizationConfig); + if (error) + return "summarizationConfig." + error; + } + if (message.groundingConfig != null && message.hasOwnProperty("groundingConfig")) { + var error = $root.google.cloud.ces.v1.DataStoreTool.GroundingConfig.verify(message.groundingConfig); + if (error) + return "groundingConfig." + error; + } + return null; + }; + + /** + * Creates a ModalityConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DataStoreTool.ModalityConfig} ModalityConfig + */ + ModalityConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.ModalityConfig) + return object; + var message = new $root.google.cloud.ces.v1.DataStoreTool.ModalityConfig(); + switch (object.modalityType) { + default: + if (typeof object.modalityType === "number") { + message.modalityType = object.modalityType; + break; + } + break; + case "MODALITY_TYPE_UNSPECIFIED": + case 0: + message.modalityType = 0; + break; + case "TEXT": + case 1: + message.modalityType = 1; + break; + case "AUDIO": + case 2: + message.modalityType = 2; + break; + } + if (object.rewriterConfig != null) { + if (typeof object.rewriterConfig !== "object") + throw TypeError(".google.cloud.ces.v1.DataStoreTool.ModalityConfig.rewriterConfig: object expected"); + message.rewriterConfig = $root.google.cloud.ces.v1.DataStoreTool.RewriterConfig.fromObject(object.rewriterConfig); + } + if (object.summarizationConfig != null) { + if (typeof object.summarizationConfig !== "object") + throw TypeError(".google.cloud.ces.v1.DataStoreTool.ModalityConfig.summarizationConfig: object expected"); + message.summarizationConfig = $root.google.cloud.ces.v1.DataStoreTool.SummarizationConfig.fromObject(object.summarizationConfig); + } + if (object.groundingConfig != null) { + if (typeof object.groundingConfig !== "object") + throw TypeError(".google.cloud.ces.v1.DataStoreTool.ModalityConfig.groundingConfig: object expected"); + message.groundingConfig = $root.google.cloud.ces.v1.DataStoreTool.GroundingConfig.fromObject(object.groundingConfig); + } + return message; + }; + + /** + * Creates a plain object from a ModalityConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig + * @static + * @param {google.cloud.ces.v1.DataStoreTool.ModalityConfig} message ModalityConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModalityConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modalityType = options.enums === String ? "MODALITY_TYPE_UNSPECIFIED" : 0; + object.rewriterConfig = null; + object.summarizationConfig = null; + object.groundingConfig = null; + } + if (message.modalityType != null && message.hasOwnProperty("modalityType")) + object.modalityType = options.enums === String ? $root.google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType[message.modalityType] === undefined ? message.modalityType : $root.google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType[message.modalityType] : message.modalityType; + if (message.rewriterConfig != null && message.hasOwnProperty("rewriterConfig")) + object.rewriterConfig = $root.google.cloud.ces.v1.DataStoreTool.RewriterConfig.toObject(message.rewriterConfig, options); + if (message.summarizationConfig != null && message.hasOwnProperty("summarizationConfig")) + object.summarizationConfig = $root.google.cloud.ces.v1.DataStoreTool.SummarizationConfig.toObject(message.summarizationConfig, options); + if (message.groundingConfig != null && message.hasOwnProperty("groundingConfig")) + object.groundingConfig = $root.google.cloud.ces.v1.DataStoreTool.GroundingConfig.toObject(message.groundingConfig, options); + return object; + }; + + /** + * Converts this ModalityConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig + * @instance + * @returns {Object.} JSON object + */ + ModalityConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModalityConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModalityConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.ModalityConfig"; + }; + + /** + * ModalityType enum. + * @name google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType + * @enum {number} + * @property {number} MODALITY_TYPE_UNSPECIFIED=0 MODALITY_TYPE_UNSPECIFIED value + * @property {number} TEXT=1 TEXT value + * @property {number} AUDIO=2 AUDIO value + */ + ModalityConfig.ModalityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODALITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "AUDIO"] = 2; + return values; + })(); + + return ModalityConfig; + })(); + + /** + * FilterParameterBehavior enum. + * @name google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior + * @enum {number} + * @property {number} FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED=0 FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED value + * @property {number} ALWAYS_INCLUDE=2 ALWAYS_INCLUDE value + * @property {number} NEVER_INCLUDE=3 NEVER_INCLUDE value + */ + DataStoreTool.FilterParameterBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[2] = "ALWAYS_INCLUDE"] = 2; + values[valuesById[3] = "NEVER_INCLUDE"] = 3; + return values; + })(); + + return DataStoreTool; + })(); + + v1.DataStore = (function() { + + /** + * Properties of a DataStore. + * @memberof google.cloud.ces.v1 + * @interface IDataStore + * @property {string|null} [name] DataStore name + * @property {google.cloud.ces.v1.DataStore.DataStoreType|null} [type] DataStore type + * @property {google.cloud.ces.v1.DataStore.DocumentProcessingMode|null} [documentProcessingMode] DataStore documentProcessingMode + * @property {string|null} [displayName] DataStore displayName + * @property {google.protobuf.ITimestamp|null} [createTime] DataStore createTime + * @property {google.cloud.ces.v1.DataStore.IConnectorConfig|null} [connectorConfig] DataStore connectorConfig + */ + + /** + * Constructs a new DataStore. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a DataStore. + * @implements IDataStore + * @constructor + * @param {google.cloud.ces.v1.IDataStore=} [properties] Properties to set + */ + function DataStore(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStore name. + * @member {string} name + * @memberof google.cloud.ces.v1.DataStore + * @instance + */ + DataStore.prototype.name = ""; + + /** + * DataStore type. + * @member {google.cloud.ces.v1.DataStore.DataStoreType} type + * @memberof google.cloud.ces.v1.DataStore + * @instance + */ + DataStore.prototype.type = 0; + + /** + * DataStore documentProcessingMode. + * @member {google.cloud.ces.v1.DataStore.DocumentProcessingMode} documentProcessingMode + * @memberof google.cloud.ces.v1.DataStore + * @instance + */ + DataStore.prototype.documentProcessingMode = 0; + + /** + * DataStore displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1.DataStore + * @instance + */ + DataStore.prototype.displayName = ""; + + /** + * DataStore createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1.DataStore + * @instance + */ + DataStore.prototype.createTime = null; + + /** + * DataStore connectorConfig. + * @member {google.cloud.ces.v1.DataStore.IConnectorConfig|null|undefined} connectorConfig + * @memberof google.cloud.ces.v1.DataStore + * @instance + */ + DataStore.prototype.connectorConfig = null; + + /** + * Creates a new DataStore instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DataStore + * @static + * @param {google.cloud.ces.v1.IDataStore=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DataStore} DataStore instance + */ + DataStore.create = function create(properties) { + return new DataStore(properties); + }; + + /** + * Encodes the specified DataStore message. Does not implicitly {@link google.cloud.ces.v1.DataStore.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DataStore + * @static + * @param {google.cloud.ces.v1.IDataStore} message DataStore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStore.encode = function encode(message, writer) { + if (!writer) + 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 0 =*/16).int32(message.type); + if (message.documentProcessingMode != null && Object.hasOwnProperty.call(message, "documentProcessingMode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.documentProcessingMode); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.connectorConfig != null && Object.hasOwnProperty.call(message, "connectorConfig")) + $root.google.cloud.ces.v1.DataStore.ConnectorConfig.encode(message.connectorConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataStore message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStore.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DataStore + * @static + * @param {google.cloud.ces.v1.IDataStore} message DataStore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStore.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStore message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DataStore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DataStore} DataStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStore.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStore(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 4: { + message.documentProcessingMode = reader.int32(); + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.connectorConfig = $root.google.cloud.ces.v1.DataStore.ConnectorConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataStore message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DataStore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DataStore} DataStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStore.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStore message. + * @function verify + * @memberof google.cloud.ces.v1.DataStore + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStore.verify = function verify(message) { + if (typeof message !== "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")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.documentProcessingMode != null && message.hasOwnProperty("documentProcessingMode")) + switch (message.documentProcessingMode) { + default: + return "documentProcessingMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: 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.connectorConfig != null && message.hasOwnProperty("connectorConfig")) { + var error = $root.google.cloud.ces.v1.DataStore.ConnectorConfig.verify(message.connectorConfig); + if (error) + return "connectorConfig." + error; + } + return null; + }; + + /** + * Creates a DataStore message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DataStore + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DataStore} DataStore + */ + DataStore.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DataStore) + return object; + var message = new $root.google.cloud.ces.v1.DataStore(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "DATA_STORE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PUBLIC_WEB": + case 1: + message.type = 1; + break; + case "UNSTRUCTURED": + case 2: + message.type = 2; + break; + case "FAQ": + case 3: + message.type = 3; + break; + case "CONNECTOR": + case 4: + message.type = 4; + break; + } + switch (object.documentProcessingMode) { + default: + if (typeof object.documentProcessingMode === "number") { + message.documentProcessingMode = object.documentProcessingMode; + break; + } + break; + case "DOCUMENT_PROCESSING_MODE_UNSPECIFIED": + case 0: + message.documentProcessingMode = 0; + break; + case "DOCUMENTS": + case 1: + message.documentProcessingMode = 1; + break; + case "CHUNKS": + case 2: + message.documentProcessingMode = 2; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1.DataStore.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.connectorConfig != null) { + if (typeof object.connectorConfig !== "object") + throw TypeError(".google.cloud.ces.v1.DataStore.connectorConfig: object expected"); + message.connectorConfig = $root.google.cloud.ces.v1.DataStore.ConnectorConfig.fromObject(object.connectorConfig); + } + return message; + }; + + /** + * Creates a plain object from a DataStore message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DataStore + * @static + * @param {google.cloud.ces.v1.DataStore} message DataStore + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStore.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "DATA_STORE_TYPE_UNSPECIFIED" : 0; + object.documentProcessingMode = options.enums === String ? "DOCUMENT_PROCESSING_MODE_UNSPECIFIED" : 0; + object.displayName = ""; + object.createTime = null; + object.connectorConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.ces.v1.DataStore.DataStoreType[message.type] === undefined ? message.type : $root.google.cloud.ces.v1.DataStore.DataStoreType[message.type] : message.type; + if (message.documentProcessingMode != null && message.hasOwnProperty("documentProcessingMode")) + object.documentProcessingMode = options.enums === String ? $root.google.cloud.ces.v1.DataStore.DocumentProcessingMode[message.documentProcessingMode] === undefined ? message.documentProcessingMode : $root.google.cloud.ces.v1.DataStore.DocumentProcessingMode[message.documentProcessingMode] : message.documentProcessingMode; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.connectorConfig != null && message.hasOwnProperty("connectorConfig")) + object.connectorConfig = $root.google.cloud.ces.v1.DataStore.ConnectorConfig.toObject(message.connectorConfig, options); + return object; + }; + + /** + * Converts this DataStore to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DataStore + * @instance + * @returns {Object.} JSON object + */ + DataStore.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStore + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DataStore + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStore.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DataStore"; + }; + + DataStore.ConnectorConfig = (function() { + + /** + * Properties of a ConnectorConfig. + * @memberof google.cloud.ces.v1.DataStore + * @interface IConnectorConfig + * @property {string|null} [collection] ConnectorConfig collection + * @property {string|null} [collectionDisplayName] ConnectorConfig collectionDisplayName + * @property {string|null} [dataSource] ConnectorConfig dataSource + */ + + /** + * Constructs a new ConnectorConfig. + * @memberof google.cloud.ces.v1.DataStore + * @classdesc Represents a ConnectorConfig. + * @implements IConnectorConfig + * @constructor + * @param {google.cloud.ces.v1.DataStore.IConnectorConfig=} [properties] Properties to set + */ + function ConnectorConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectorConfig collection. + * @member {string} collection + * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig + * @instance + */ + ConnectorConfig.prototype.collection = ""; + + /** + * ConnectorConfig collectionDisplayName. + * @member {string} collectionDisplayName + * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig + * @instance + */ + ConnectorConfig.prototype.collectionDisplayName = ""; + + /** + * ConnectorConfig dataSource. + * @member {string} dataSource + * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig + * @instance + */ + ConnectorConfig.prototype.dataSource = ""; + + /** + * Creates a new ConnectorConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig + * @static + * @param {google.cloud.ces.v1.DataStore.IConnectorConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.DataStore.ConnectorConfig} ConnectorConfig instance + */ + ConnectorConfig.create = function create(properties) { + return new ConnectorConfig(properties); + }; + + /** + * Encodes the specified ConnectorConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStore.ConnectorConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig + * @static + * @param {google.cloud.ces.v1.DataStore.IConnectorConfig} message ConnectorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.collection != null && Object.hasOwnProperty.call(message, "collection")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.collection); + if (message.collectionDisplayName != null && Object.hasOwnProperty.call(message, "collectionDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.collectionDisplayName); + if (message.dataSource != null && Object.hasOwnProperty.call(message, "dataSource")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dataSource); + return writer; + }; + + /** + * Encodes the specified ConnectorConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStore.ConnectorConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig + * @static + * @param {google.cloud.ces.v1.DataStore.IConnectorConfig} message ConnectorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectorConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.DataStore.ConnectorConfig} ConnectorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStore.ConnectorConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.collection = reader.string(); + break; + } + case 2: { + message.collectionDisplayName = reader.string(); + break; + } + case 3: { + message.dataSource = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectorConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.DataStore.ConnectorConfig} ConnectorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectorConfig message. + * @function verify + * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectorConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.collection != null && message.hasOwnProperty("collection")) + if (!$util.isString(message.collection)) + return "collection: string expected"; + if (message.collectionDisplayName != null && message.hasOwnProperty("collectionDisplayName")) + if (!$util.isString(message.collectionDisplayName)) + return "collectionDisplayName: string expected"; + if (message.dataSource != null && message.hasOwnProperty("dataSource")) + if (!$util.isString(message.dataSource)) + return "dataSource: string expected"; + return null; + }; + + /** + * Creates a ConnectorConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.DataStore.ConnectorConfig} ConnectorConfig + */ + ConnectorConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.DataStore.ConnectorConfig) + return object; + var message = new $root.google.cloud.ces.v1.DataStore.ConnectorConfig(); + if (object.collection != null) + message.collection = String(object.collection); + if (object.collectionDisplayName != null) + message.collectionDisplayName = String(object.collectionDisplayName); + if (object.dataSource != null) + message.dataSource = String(object.dataSource); + return message; + }; + + /** + * Creates a plain object from a ConnectorConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig + * @static + * @param {google.cloud.ces.v1.DataStore.ConnectorConfig} message ConnectorConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectorConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.collection = ""; + object.collectionDisplayName = ""; + object.dataSource = ""; + } + if (message.collection != null && message.hasOwnProperty("collection")) + object.collection = message.collection; + if (message.collectionDisplayName != null && message.hasOwnProperty("collectionDisplayName")) + object.collectionDisplayName = message.collectionDisplayName; + if (message.dataSource != null && message.hasOwnProperty("dataSource")) + object.dataSource = message.dataSource; + return object; + }; + + /** + * Converts this ConnectorConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig + * @instance + * @returns {Object.} JSON object + */ + ConnectorConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectorConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectorConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.DataStore.ConnectorConfig"; + }; + + return ConnectorConfig; + })(); + + /** + * DataStoreType enum. + * @name google.cloud.ces.v1.DataStore.DataStoreType + * @enum {number} + * @property {number} DATA_STORE_TYPE_UNSPECIFIED=0 DATA_STORE_TYPE_UNSPECIFIED value + * @property {number} PUBLIC_WEB=1 PUBLIC_WEB value + * @property {number} UNSTRUCTURED=2 UNSTRUCTURED value + * @property {number} FAQ=3 FAQ value + * @property {number} CONNECTOR=4 CONNECTOR value + */ + DataStore.DataStoreType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_STORE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PUBLIC_WEB"] = 1; + values[valuesById[2] = "UNSTRUCTURED"] = 2; + values[valuesById[3] = "FAQ"] = 3; + values[valuesById[4] = "CONNECTOR"] = 4; + return values; + })(); + + /** + * DocumentProcessingMode enum. + * @name google.cloud.ces.v1.DataStore.DocumentProcessingMode + * @enum {number} + * @property {number} DOCUMENT_PROCESSING_MODE_UNSPECIFIED=0 DOCUMENT_PROCESSING_MODE_UNSPECIFIED value + * @property {number} DOCUMENTS=1 DOCUMENTS value + * @property {number} CHUNKS=2 CHUNKS value + */ + DataStore.DocumentProcessingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENT_PROCESSING_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DOCUMENTS"] = 1; + values[valuesById[2] = "CHUNKS"] = 2; + return values; + })(); + + return DataStore; + })(); + + v1.CodeBlock = (function() { + + /** + * Properties of a CodeBlock. + * @memberof google.cloud.ces.v1 + * @interface ICodeBlock + * @property {string|null} [pythonCode] CodeBlock pythonCode + */ + + /** + * Constructs a new CodeBlock. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a CodeBlock. + * @implements ICodeBlock + * @constructor + * @param {google.cloud.ces.v1.ICodeBlock=} [properties] Properties to set + */ + function CodeBlock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CodeBlock pythonCode. + * @member {string} pythonCode + * @memberof google.cloud.ces.v1.CodeBlock + * @instance + */ + CodeBlock.prototype.pythonCode = ""; + + /** + * Creates a new CodeBlock instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.CodeBlock + * @static + * @param {google.cloud.ces.v1.ICodeBlock=} [properties] Properties to set + * @returns {google.cloud.ces.v1.CodeBlock} CodeBlock instance + */ + CodeBlock.create = function create(properties) { + return new CodeBlock(properties); + }; + + /** + * Encodes the specified CodeBlock message. Does not implicitly {@link google.cloud.ces.v1.CodeBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.CodeBlock + * @static + * @param {google.cloud.ces.v1.ICodeBlock} message CodeBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pythonCode); + return writer; + }; + + /** + * Encodes the specified CodeBlock message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CodeBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.CodeBlock + * @static + * @param {google.cloud.ces.v1.ICodeBlock} message CodeBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CodeBlock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.CodeBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.CodeBlock} CodeBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeBlock.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CodeBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pythonCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CodeBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.CodeBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.CodeBlock} CodeBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CodeBlock message. + * @function verify + * @memberof google.cloud.ces.v1.CodeBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CodeBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) + if (!$util.isString(message.pythonCode)) + return "pythonCode: string expected"; + return null; + }; + + /** + * Creates a CodeBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.CodeBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.CodeBlock} CodeBlock + */ + CodeBlock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.CodeBlock) + return object; + var message = new $root.google.cloud.ces.v1.CodeBlock(); + if (object.pythonCode != null) + message.pythonCode = String(object.pythonCode); + return message; + }; + + /** + * Creates a plain object from a CodeBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.CodeBlock + * @static + * @param {google.cloud.ces.v1.CodeBlock} message CodeBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CodeBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.pythonCode = ""; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) + object.pythonCode = message.pythonCode; + return object; + }; + + /** + * Converts this CodeBlock to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.CodeBlock + * @instance + * @returns {Object.} JSON object + */ + CodeBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CodeBlock + * @function getTypeUrl + * @memberof google.cloud.ces.v1.CodeBlock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CodeBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.CodeBlock"; + }; + + return CodeBlock; + })(); + + v1.ToolFakeConfig = (function() { + + /** + * Properties of a ToolFakeConfig. + * @memberof google.cloud.ces.v1 + * @interface IToolFakeConfig + * @property {google.cloud.ces.v1.ICodeBlock|null} [codeBlock] ToolFakeConfig codeBlock + * @property {boolean|null} [enableFakeMode] ToolFakeConfig enableFakeMode + */ + + /** + * Constructs a new ToolFakeConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ToolFakeConfig. + * @implements IToolFakeConfig + * @constructor + * @param {google.cloud.ces.v1.IToolFakeConfig=} [properties] Properties to set + */ + function ToolFakeConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolFakeConfig codeBlock. + * @member {google.cloud.ces.v1.ICodeBlock|null|undefined} codeBlock + * @memberof google.cloud.ces.v1.ToolFakeConfig + * @instance + */ + ToolFakeConfig.prototype.codeBlock = null; + + /** + * ToolFakeConfig enableFakeMode. + * @member {boolean} enableFakeMode + * @memberof google.cloud.ces.v1.ToolFakeConfig + * @instance + */ + ToolFakeConfig.prototype.enableFakeMode = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ToolFakeConfig toolResponse. + * @member {"codeBlock"|undefined} toolResponse + * @memberof google.cloud.ces.v1.ToolFakeConfig + * @instance + */ + Object.defineProperty(ToolFakeConfig.prototype, "toolResponse", { + get: $util.oneOfGetter($oneOfFields = ["codeBlock"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ToolFakeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ToolFakeConfig + * @static + * @param {google.cloud.ces.v1.IToolFakeConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ToolFakeConfig} ToolFakeConfig instance + */ + ToolFakeConfig.create = function create(properties) { + return new ToolFakeConfig(properties); + }; + + /** + * Encodes the specified ToolFakeConfig message. Does not implicitly {@link google.cloud.ces.v1.ToolFakeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ToolFakeConfig + * @static + * @param {google.cloud.ces.v1.IToolFakeConfig} message ToolFakeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolFakeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.codeBlock != null && Object.hasOwnProperty.call(message, "codeBlock")) + $root.google.cloud.ces.v1.CodeBlock.encode(message.codeBlock, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.enableFakeMode != null && Object.hasOwnProperty.call(message, "enableFakeMode")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableFakeMode); + return writer; + }; + + /** + * Encodes the specified ToolFakeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolFakeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ToolFakeConfig + * @static + * @param {google.cloud.ces.v1.IToolFakeConfig} message ToolFakeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolFakeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolFakeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ToolFakeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ToolFakeConfig} ToolFakeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolFakeConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ToolFakeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.codeBlock = $root.google.cloud.ces.v1.CodeBlock.decode(reader, reader.uint32()); + break; + } + case 2: { + message.enableFakeMode = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolFakeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ToolFakeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ToolFakeConfig} ToolFakeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolFakeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolFakeConfig message. + * @function verify + * @memberof google.cloud.ces.v1.ToolFakeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolFakeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.codeBlock != null && message.hasOwnProperty("codeBlock")) { + properties.toolResponse = 1; + { + var error = $root.google.cloud.ces.v1.CodeBlock.verify(message.codeBlock); + if (error) + return "codeBlock." + error; + } + } + if (message.enableFakeMode != null && message.hasOwnProperty("enableFakeMode")) + if (typeof message.enableFakeMode !== "boolean") + return "enableFakeMode: boolean expected"; + return null; + }; + + /** + * Creates a ToolFakeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ToolFakeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ToolFakeConfig} ToolFakeConfig + */ + ToolFakeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ToolFakeConfig) + return object; + var message = new $root.google.cloud.ces.v1.ToolFakeConfig(); + if (object.codeBlock != null) { + if (typeof object.codeBlock !== "object") + throw TypeError(".google.cloud.ces.v1.ToolFakeConfig.codeBlock: object expected"); + message.codeBlock = $root.google.cloud.ces.v1.CodeBlock.fromObject(object.codeBlock); + } + if (object.enableFakeMode != null) + message.enableFakeMode = Boolean(object.enableFakeMode); + return message; + }; + + /** + * Creates a plain object from a ToolFakeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ToolFakeConfig + * @static + * @param {google.cloud.ces.v1.ToolFakeConfig} message ToolFakeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolFakeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableFakeMode = false; + if (message.codeBlock != null && message.hasOwnProperty("codeBlock")) { + object.codeBlock = $root.google.cloud.ces.v1.CodeBlock.toObject(message.codeBlock, options); + if (options.oneofs) + object.toolResponse = "codeBlock"; + } + if (message.enableFakeMode != null && message.hasOwnProperty("enableFakeMode")) + object.enableFakeMode = message.enableFakeMode; + return object; + }; + + /** + * Converts this ToolFakeConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ToolFakeConfig + * @instance + * @returns {Object.} JSON object + */ + ToolFakeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolFakeConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ToolFakeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolFakeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ToolFakeConfig"; + }; + + return ToolFakeConfig; + })(); + + v1.FileSearchTool = (function() { + + /** + * Properties of a FileSearchTool. + * @memberof google.cloud.ces.v1 + * @interface IFileSearchTool + * @property {google.cloud.ces.v1.FileSearchTool.CorpusType|null} [corpusType] FileSearchTool corpusType + * @property {string|null} [name] FileSearchTool name + * @property {string|null} [description] FileSearchTool description + * @property {string|null} [fileCorpus] FileSearchTool fileCorpus + */ + + /** + * Constructs a new FileSearchTool. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a FileSearchTool. + * @implements IFileSearchTool + * @constructor + * @param {google.cloud.ces.v1.IFileSearchTool=} [properties] Properties to set + */ + function FileSearchTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileSearchTool corpusType. + * @member {google.cloud.ces.v1.FileSearchTool.CorpusType} corpusType + * @memberof google.cloud.ces.v1.FileSearchTool + * @instance + */ + FileSearchTool.prototype.corpusType = 0; + + /** + * FileSearchTool name. + * @member {string} name + * @memberof google.cloud.ces.v1.FileSearchTool + * @instance + */ + FileSearchTool.prototype.name = ""; + + /** + * FileSearchTool description. + * @member {string} description + * @memberof google.cloud.ces.v1.FileSearchTool + * @instance + */ + FileSearchTool.prototype.description = ""; + + /** + * FileSearchTool fileCorpus. + * @member {string} fileCorpus + * @memberof google.cloud.ces.v1.FileSearchTool + * @instance + */ + FileSearchTool.prototype.fileCorpus = ""; + + /** + * Creates a new FileSearchTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.FileSearchTool + * @static + * @param {google.cloud.ces.v1.IFileSearchTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1.FileSearchTool} FileSearchTool instance + */ + FileSearchTool.create = function create(properties) { + return new FileSearchTool(properties); + }; + + /** + * Encodes the specified FileSearchTool message. Does not implicitly {@link google.cloud.ces.v1.FileSearchTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.FileSearchTool + * @static + * @param {google.cloud.ces.v1.IFileSearchTool} message FileSearchTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileSearchTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.corpusType != null && Object.hasOwnProperty.call(message, "corpusType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.corpusType); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.fileCorpus != null && Object.hasOwnProperty.call(message, "fileCorpus")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.fileCorpus); + return writer; + }; + + /** + * Encodes the specified FileSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.FileSearchTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.FileSearchTool + * @static + * @param {google.cloud.ces.v1.IFileSearchTool} message FileSearchTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileSearchTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileSearchTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.FileSearchTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.FileSearchTool} FileSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileSearchTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.FileSearchTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.corpusType = reader.int32(); + break; + } + case 4: { + message.name = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.fileCorpus = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileSearchTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.FileSearchTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.FileSearchTool} FileSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileSearchTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileSearchTool message. + * @function verify + * @memberof google.cloud.ces.v1.FileSearchTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileSearchTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.corpusType != null && message.hasOwnProperty("corpusType")) + switch (message.corpusType) { + default: + return "corpusType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.fileCorpus != null && message.hasOwnProperty("fileCorpus")) + if (!$util.isString(message.fileCorpus)) + return "fileCorpus: string expected"; + return null; + }; + + /** + * Creates a FileSearchTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.FileSearchTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.FileSearchTool} FileSearchTool + */ + FileSearchTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.FileSearchTool) + return object; + var message = new $root.google.cloud.ces.v1.FileSearchTool(); + switch (object.corpusType) { + default: + if (typeof object.corpusType === "number") { + message.corpusType = object.corpusType; + break; + } + break; + case "CORPUS_TYPE_UNSPECIFIED": + case 0: + message.corpusType = 0; + break; + case "USER_OWNED": + case 1: + message.corpusType = 1; + break; + case "FULLY_MANAGED": + case 2: + message.corpusType = 2; + break; + } + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.fileCorpus != null) + message.fileCorpus = String(object.fileCorpus); + return message; + }; + + /** + * Creates a plain object from a FileSearchTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.FileSearchTool + * @static + * @param {google.cloud.ces.v1.FileSearchTool} message FileSearchTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileSearchTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.corpusType = options.enums === String ? "CORPUS_TYPE_UNSPECIFIED" : 0; + object.name = ""; + object.description = ""; + object.fileCorpus = ""; + } + if (message.corpusType != null && message.hasOwnProperty("corpusType")) + object.corpusType = options.enums === String ? $root.google.cloud.ces.v1.FileSearchTool.CorpusType[message.corpusType] === undefined ? message.corpusType : $root.google.cloud.ces.v1.FileSearchTool.CorpusType[message.corpusType] : message.corpusType; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.fileCorpus != null && message.hasOwnProperty("fileCorpus")) + object.fileCorpus = message.fileCorpus; + return object; + }; + + /** + * Converts this FileSearchTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.FileSearchTool + * @instance + * @returns {Object.} JSON object + */ + FileSearchTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileSearchTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1.FileSearchTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileSearchTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.FileSearchTool"; + }; + + /** + * CorpusType enum. + * @name google.cloud.ces.v1.FileSearchTool.CorpusType + * @enum {number} + * @property {number} CORPUS_TYPE_UNSPECIFIED=0 CORPUS_TYPE_UNSPECIFIED value + * @property {number} USER_OWNED=1 USER_OWNED value + * @property {number} FULLY_MANAGED=2 FULLY_MANAGED value + */ + FileSearchTool.CorpusType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CORPUS_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER_OWNED"] = 1; + values[valuesById[2] = "FULLY_MANAGED"] = 2; + return values; + })(); + + return FileSearchTool; + })(); + + v1.GoogleSearchTool = (function() { + + /** + * Properties of a GoogleSearchTool. + * @memberof google.cloud.ces.v1 + * @interface IGoogleSearchTool + * @property {string|null} [name] GoogleSearchTool name + * @property {string|null} [description] GoogleSearchTool description + * @property {Array.|null} [contextUrls] GoogleSearchTool contextUrls + * @property {Array.|null} [preferredDomains] GoogleSearchTool preferredDomains + * @property {Array.|null} [excludeDomains] GoogleSearchTool excludeDomains + * @property {google.cloud.ces.v1.GoogleSearchTool.IPromptConfig|null} [promptConfig] GoogleSearchTool promptConfig + */ + + /** + * Constructs a new GoogleSearchTool. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a GoogleSearchTool. + * @implements IGoogleSearchTool + * @constructor + * @param {google.cloud.ces.v1.IGoogleSearchTool=} [properties] Properties to set + */ + function GoogleSearchTool(properties) { + this.contextUrls = []; + this.preferredDomains = []; + this.excludeDomains = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoogleSearchTool name. + * @member {string} name + * @memberof google.cloud.ces.v1.GoogleSearchTool + * @instance + */ + GoogleSearchTool.prototype.name = ""; + + /** + * GoogleSearchTool description. + * @member {string} description + * @memberof google.cloud.ces.v1.GoogleSearchTool + * @instance + */ + GoogleSearchTool.prototype.description = ""; + + /** + * GoogleSearchTool contextUrls. + * @member {Array.} contextUrls + * @memberof google.cloud.ces.v1.GoogleSearchTool + * @instance + */ + GoogleSearchTool.prototype.contextUrls = $util.emptyArray; + + /** + * GoogleSearchTool preferredDomains. + * @member {Array.} preferredDomains + * @memberof google.cloud.ces.v1.GoogleSearchTool + * @instance + */ + GoogleSearchTool.prototype.preferredDomains = $util.emptyArray; + + /** + * GoogleSearchTool excludeDomains. + * @member {Array.} excludeDomains + * @memberof google.cloud.ces.v1.GoogleSearchTool + * @instance + */ + GoogleSearchTool.prototype.excludeDomains = $util.emptyArray; + + /** + * GoogleSearchTool promptConfig. + * @member {google.cloud.ces.v1.GoogleSearchTool.IPromptConfig|null|undefined} promptConfig + * @memberof google.cloud.ces.v1.GoogleSearchTool + * @instance + */ + GoogleSearchTool.prototype.promptConfig = null; + + /** + * Creates a new GoogleSearchTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.GoogleSearchTool + * @static + * @param {google.cloud.ces.v1.IGoogleSearchTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1.GoogleSearchTool} GoogleSearchTool instance + */ + GoogleSearchTool.create = function create(properties) { + return new GoogleSearchTool(properties); + }; + + /** + * Encodes the specified GoogleSearchTool message. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.GoogleSearchTool + * @static + * @param {google.cloud.ces.v1.IGoogleSearchTool} message GoogleSearchTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearchTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.contextUrls != null && message.contextUrls.length) + for (var i = 0; i < message.contextUrls.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.contextUrls[i]); + if (message.excludeDomains != null && message.excludeDomains.length) + for (var i = 0; i < message.excludeDomains.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.excludeDomains[i]); + if (message.promptConfig != null && Object.hasOwnProperty.call(message, "promptConfig")) + $root.google.cloud.ces.v1.GoogleSearchTool.PromptConfig.encode(message.promptConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.preferredDomains != null && message.preferredDomains.length) + for (var i = 0; i < message.preferredDomains.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.preferredDomains[i]); + return writer; + }; + + /** + * Encodes the specified GoogleSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.GoogleSearchTool + * @static + * @param {google.cloud.ces.v1.IGoogleSearchTool} message GoogleSearchTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearchTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoogleSearchTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.GoogleSearchTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.GoogleSearchTool} GoogleSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearchTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GoogleSearchTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + if (!(message.contextUrls && message.contextUrls.length)) + message.contextUrls = []; + message.contextUrls.push(reader.string()); + break; + } + case 6: { + if (!(message.preferredDomains && message.preferredDomains.length)) + message.preferredDomains = []; + message.preferredDomains.push(reader.string()); + break; + } + case 4: { + if (!(message.excludeDomains && message.excludeDomains.length)) + message.excludeDomains = []; + message.excludeDomains.push(reader.string()); + break; + } + case 5: { + message.promptConfig = $root.google.cloud.ces.v1.GoogleSearchTool.PromptConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoogleSearchTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.GoogleSearchTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.GoogleSearchTool} GoogleSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearchTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoogleSearchTool message. + * @function verify + * @memberof google.cloud.ces.v1.GoogleSearchTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoogleSearchTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.contextUrls != null && message.hasOwnProperty("contextUrls")) { + if (!Array.isArray(message.contextUrls)) + return "contextUrls: array expected"; + for (var i = 0; i < message.contextUrls.length; ++i) + if (!$util.isString(message.contextUrls[i])) + return "contextUrls: string[] expected"; + } + if (message.preferredDomains != null && message.hasOwnProperty("preferredDomains")) { + if (!Array.isArray(message.preferredDomains)) + return "preferredDomains: array expected"; + for (var i = 0; i < message.preferredDomains.length; ++i) + if (!$util.isString(message.preferredDomains[i])) + return "preferredDomains: string[] expected"; + } + if (message.excludeDomains != null && message.hasOwnProperty("excludeDomains")) { + if (!Array.isArray(message.excludeDomains)) + return "excludeDomains: array expected"; + for (var i = 0; i < message.excludeDomains.length; ++i) + if (!$util.isString(message.excludeDomains[i])) + return "excludeDomains: string[] expected"; + } + if (message.promptConfig != null && message.hasOwnProperty("promptConfig")) { + var error = $root.google.cloud.ces.v1.GoogleSearchTool.PromptConfig.verify(message.promptConfig); + if (error) + return "promptConfig." + error; + } + return null; + }; + + /** + * Creates a GoogleSearchTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.GoogleSearchTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.GoogleSearchTool} GoogleSearchTool + */ + GoogleSearchTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.GoogleSearchTool) + return object; + var message = new $root.google.cloud.ces.v1.GoogleSearchTool(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.contextUrls) { + if (!Array.isArray(object.contextUrls)) + throw TypeError(".google.cloud.ces.v1.GoogleSearchTool.contextUrls: array expected"); + message.contextUrls = []; + for (var i = 0; i < object.contextUrls.length; ++i) + message.contextUrls[i] = String(object.contextUrls[i]); + } + if (object.preferredDomains) { + if (!Array.isArray(object.preferredDomains)) + throw TypeError(".google.cloud.ces.v1.GoogleSearchTool.preferredDomains: array expected"); + message.preferredDomains = []; + for (var i = 0; i < object.preferredDomains.length; ++i) + message.preferredDomains[i] = String(object.preferredDomains[i]); + } + if (object.excludeDomains) { + if (!Array.isArray(object.excludeDomains)) + throw TypeError(".google.cloud.ces.v1.GoogleSearchTool.excludeDomains: array expected"); + message.excludeDomains = []; + for (var i = 0; i < object.excludeDomains.length; ++i) + message.excludeDomains[i] = String(object.excludeDomains[i]); + } + if (object.promptConfig != null) { + if (typeof object.promptConfig !== "object") + throw TypeError(".google.cloud.ces.v1.GoogleSearchTool.promptConfig: object expected"); + message.promptConfig = $root.google.cloud.ces.v1.GoogleSearchTool.PromptConfig.fromObject(object.promptConfig); + } + return message; + }; + + /** + * Creates a plain object from a GoogleSearchTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.GoogleSearchTool + * @static + * @param {google.cloud.ces.v1.GoogleSearchTool} message GoogleSearchTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoogleSearchTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.contextUrls = []; + object.excludeDomains = []; + object.preferredDomains = []; + } + if (options.defaults) { + object.name = ""; + object.description = ""; + object.promptConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.contextUrls && message.contextUrls.length) { + object.contextUrls = []; + for (var j = 0; j < message.contextUrls.length; ++j) + object.contextUrls[j] = message.contextUrls[j]; + } + if (message.excludeDomains && message.excludeDomains.length) { + object.excludeDomains = []; + for (var j = 0; j < message.excludeDomains.length; ++j) + object.excludeDomains[j] = message.excludeDomains[j]; + } + if (message.promptConfig != null && message.hasOwnProperty("promptConfig")) + object.promptConfig = $root.google.cloud.ces.v1.GoogleSearchTool.PromptConfig.toObject(message.promptConfig, options); + if (message.preferredDomains && message.preferredDomains.length) { + object.preferredDomains = []; + for (var j = 0; j < message.preferredDomains.length; ++j) + object.preferredDomains[j] = message.preferredDomains[j]; + } + return object; + }; + + /** + * Converts this GoogleSearchTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.GoogleSearchTool + * @instance + * @returns {Object.} JSON object + */ + GoogleSearchTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoogleSearchTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1.GoogleSearchTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoogleSearchTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.GoogleSearchTool"; + }; + + GoogleSearchTool.PromptConfig = (function() { + + /** + * Properties of a PromptConfig. + * @memberof google.cloud.ces.v1.GoogleSearchTool + * @interface IPromptConfig + * @property {string|null} [textPrompt] PromptConfig textPrompt + * @property {string|null} [voicePrompt] PromptConfig voicePrompt + */ + + /** + * Constructs a new PromptConfig. + * @memberof google.cloud.ces.v1.GoogleSearchTool + * @classdesc Represents a PromptConfig. + * @implements IPromptConfig + * @constructor + * @param {google.cloud.ces.v1.GoogleSearchTool.IPromptConfig=} [properties] Properties to set + */ + function PromptConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PromptConfig textPrompt. + * @member {string} textPrompt + * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig + * @instance + */ + PromptConfig.prototype.textPrompt = ""; + + /** + * PromptConfig voicePrompt. + * @member {string} voicePrompt + * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig + * @instance + */ + PromptConfig.prototype.voicePrompt = ""; + + /** + * Creates a new PromptConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig + * @static + * @param {google.cloud.ces.v1.GoogleSearchTool.IPromptConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.GoogleSearchTool.PromptConfig} PromptConfig instance + */ + PromptConfig.create = function create(properties) { + return new PromptConfig(properties); + }; + + /** + * Encodes the specified PromptConfig message. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchTool.PromptConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig + * @static + * @param {google.cloud.ces.v1.GoogleSearchTool.IPromptConfig} message PromptConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromptConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textPrompt != null && Object.hasOwnProperty.call(message, "textPrompt")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.textPrompt); + if (message.voicePrompt != null && Object.hasOwnProperty.call(message, "voicePrompt")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.voicePrompt); + return writer; + }; + + /** + * Encodes the specified PromptConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchTool.PromptConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig + * @static + * @param {google.cloud.ces.v1.GoogleSearchTool.IPromptConfig} message PromptConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromptConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PromptConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.GoogleSearchTool.PromptConfig} PromptConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromptConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GoogleSearchTool.PromptConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.textPrompt = reader.string(); + break; + } + case 2: { + message.voicePrompt = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PromptConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.GoogleSearchTool.PromptConfig} PromptConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromptConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PromptConfig message. + * @function verify + * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PromptConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.textPrompt != null && message.hasOwnProperty("textPrompt")) + if (!$util.isString(message.textPrompt)) + return "textPrompt: string expected"; + if (message.voicePrompt != null && message.hasOwnProperty("voicePrompt")) + if (!$util.isString(message.voicePrompt)) + return "voicePrompt: string expected"; + return null; + }; + + /** + * Creates a PromptConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.GoogleSearchTool.PromptConfig} PromptConfig + */ + PromptConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.GoogleSearchTool.PromptConfig) + return object; + var message = new $root.google.cloud.ces.v1.GoogleSearchTool.PromptConfig(); + if (object.textPrompt != null) + message.textPrompt = String(object.textPrompt); + if (object.voicePrompt != null) + message.voicePrompt = String(object.voicePrompt); + return message; + }; + + /** + * Creates a plain object from a PromptConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig + * @static + * @param {google.cloud.ces.v1.GoogleSearchTool.PromptConfig} message PromptConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PromptConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.textPrompt = ""; + object.voicePrompt = ""; + } + if (message.textPrompt != null && message.hasOwnProperty("textPrompt")) + object.textPrompt = message.textPrompt; + if (message.voicePrompt != null && message.hasOwnProperty("voicePrompt")) + object.voicePrompt = message.voicePrompt; + return object; + }; + + /** + * Converts this PromptConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig + * @instance + * @returns {Object.} JSON object + */ + PromptConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PromptConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PromptConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.GoogleSearchTool.PromptConfig"; + }; + + return PromptConfig; + })(); + + return GoogleSearchTool; + })(); + + v1.McpTool = (function() { + + /** + * Properties of a McpTool. + * @memberof google.cloud.ces.v1 + * @interface IMcpTool + * @property {string|null} [name] McpTool name + * @property {string|null} [description] McpTool description + * @property {google.cloud.ces.v1.ISchema|null} [inputSchema] McpTool inputSchema + * @property {google.cloud.ces.v1.ISchema|null} [outputSchema] McpTool outputSchema + * @property {string|null} [serverAddress] McpTool serverAddress + * @property {google.cloud.ces.v1.IApiAuthentication|null} [apiAuthentication] McpTool apiAuthentication + * @property {google.cloud.ces.v1.ITlsConfig|null} [tlsConfig] McpTool tlsConfig + * @property {google.cloud.ces.v1.IServiceDirectoryConfig|null} [serviceDirectoryConfig] McpTool serviceDirectoryConfig + */ + + /** + * Constructs a new McpTool. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a McpTool. + * @implements IMcpTool + * @constructor + * @param {google.cloud.ces.v1.IMcpTool=} [properties] Properties to set + */ + function McpTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * McpTool name. + * @member {string} name + * @memberof google.cloud.ces.v1.McpTool + * @instance + */ + McpTool.prototype.name = ""; + + /** + * McpTool description. + * @member {string} description + * @memberof google.cloud.ces.v1.McpTool + * @instance + */ + McpTool.prototype.description = ""; + + /** + * McpTool inputSchema. + * @member {google.cloud.ces.v1.ISchema|null|undefined} inputSchema + * @memberof google.cloud.ces.v1.McpTool + * @instance + */ + McpTool.prototype.inputSchema = null; + + /** + * McpTool outputSchema. + * @member {google.cloud.ces.v1.ISchema|null|undefined} outputSchema + * @memberof google.cloud.ces.v1.McpTool + * @instance + */ + McpTool.prototype.outputSchema = null; + + /** + * McpTool serverAddress. + * @member {string} serverAddress + * @memberof google.cloud.ces.v1.McpTool + * @instance + */ + McpTool.prototype.serverAddress = ""; + + /** + * McpTool apiAuthentication. + * @member {google.cloud.ces.v1.IApiAuthentication|null|undefined} apiAuthentication + * @memberof google.cloud.ces.v1.McpTool + * @instance + */ + McpTool.prototype.apiAuthentication = null; + + /** + * McpTool tlsConfig. + * @member {google.cloud.ces.v1.ITlsConfig|null|undefined} tlsConfig + * @memberof google.cloud.ces.v1.McpTool + * @instance + */ + McpTool.prototype.tlsConfig = null; + + /** + * McpTool serviceDirectoryConfig. + * @member {google.cloud.ces.v1.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig + * @memberof google.cloud.ces.v1.McpTool + * @instance + */ + McpTool.prototype.serviceDirectoryConfig = null; + + /** + * Creates a new McpTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.McpTool + * @static + * @param {google.cloud.ces.v1.IMcpTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1.McpTool} McpTool instance + */ + McpTool.create = function create(properties) { + return new McpTool(properties); + }; + + /** + * Encodes the specified McpTool message. Does not implicitly {@link google.cloud.ces.v1.McpTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.McpTool + * @static + * @param {google.cloud.ces.v1.IMcpTool} message McpTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + McpTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.inputSchema != null && Object.hasOwnProperty.call(message, "inputSchema")) + $root.google.cloud.ces.v1.Schema.encode(message.inputSchema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputSchema != null && Object.hasOwnProperty.call(message, "outputSchema")) + $root.google.cloud.ces.v1.Schema.encode(message.outputSchema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.serverAddress != null && Object.hasOwnProperty.call(message, "serverAddress")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.serverAddress); + if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) + $root.google.cloud.ces.v1.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) + $root.google.cloud.ces.v1.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) + $root.google.cloud.ces.v1.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified McpTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.McpTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.McpTool + * @static + * @param {google.cloud.ces.v1.IMcpTool} message McpTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + McpTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a McpTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.McpTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.McpTool} McpTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + McpTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.McpTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.inputSchema = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputSchema = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); + break; + } + case 5: { + message.serverAddress = reader.string(); + break; + } + case 6: { + message.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.decode(reader, reader.uint32()); + break; + } + case 7: { + message.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a McpTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.McpTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.McpTool} McpTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + McpTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a McpTool message. + * @function verify + * @memberof google.cloud.ces.v1.McpTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + McpTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) { + var error = $root.google.cloud.ces.v1.Schema.verify(message.inputSchema); + if (error) + return "inputSchema." + error; + } + if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) { + var error = $root.google.cloud.ces.v1.Schema.verify(message.outputSchema); + if (error) + return "outputSchema." + error; + } + if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) + if (!$util.isString(message.serverAddress)) + return "serverAddress: string expected"; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { + var error = $root.google.cloud.ces.v1.ApiAuthentication.verify(message.apiAuthentication); + if (error) + return "apiAuthentication." + error; + } + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { + var error = $root.google.cloud.ces.v1.TlsConfig.verify(message.tlsConfig); + if (error) + return "tlsConfig." + error; + } + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { + var error = $root.google.cloud.ces.v1.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); + if (error) + return "serviceDirectoryConfig." + error; + } + return null; + }; + + /** + * Creates a McpTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.McpTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.McpTool} McpTool + */ + McpTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.McpTool) + return object; + var message = new $root.google.cloud.ces.v1.McpTool(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.inputSchema != null) { + if (typeof object.inputSchema !== "object") + throw TypeError(".google.cloud.ces.v1.McpTool.inputSchema: object expected"); + message.inputSchema = $root.google.cloud.ces.v1.Schema.fromObject(object.inputSchema); + } + if (object.outputSchema != null) { + if (typeof object.outputSchema !== "object") + throw TypeError(".google.cloud.ces.v1.McpTool.outputSchema: object expected"); + message.outputSchema = $root.google.cloud.ces.v1.Schema.fromObject(object.outputSchema); + } + if (object.serverAddress != null) + message.serverAddress = String(object.serverAddress); + if (object.apiAuthentication != null) { + if (typeof object.apiAuthentication !== "object") + throw TypeError(".google.cloud.ces.v1.McpTool.apiAuthentication: object expected"); + message.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.fromObject(object.apiAuthentication); + } + if (object.tlsConfig != null) { + if (typeof object.tlsConfig !== "object") + throw TypeError(".google.cloud.ces.v1.McpTool.tlsConfig: object expected"); + message.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.fromObject(object.tlsConfig); + } + if (object.serviceDirectoryConfig != null) { + if (typeof object.serviceDirectoryConfig !== "object") + throw TypeError(".google.cloud.ces.v1.McpTool.serviceDirectoryConfig: object expected"); + message.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); + } + return message; + }; + + /** + * Creates a plain object from a McpTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.McpTool + * @static + * @param {google.cloud.ces.v1.McpTool} message McpTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + McpTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.inputSchema = null; + object.outputSchema = null; + object.serverAddress = ""; + object.apiAuthentication = null; + object.tlsConfig = null; + object.serviceDirectoryConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) + object.inputSchema = $root.google.cloud.ces.v1.Schema.toObject(message.inputSchema, options); + if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) + object.outputSchema = $root.google.cloud.ces.v1.Schema.toObject(message.outputSchema, options); + if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) + object.serverAddress = message.serverAddress; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) + object.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.toObject(message.apiAuthentication, options); + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) + object.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.toObject(message.tlsConfig, options); + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) + object.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); + return object; + }; + + /** + * Converts this McpTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.McpTool + * @instance + * @returns {Object.} JSON object + */ + McpTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for McpTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1.McpTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + McpTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.McpTool"; + }; + + return McpTool; + })(); + + v1.OpenApiTool = (function() { + + /** + * Properties of an OpenApiTool. + * @memberof google.cloud.ces.v1 + * @interface IOpenApiTool + * @property {string|null} [openApiSchema] OpenApiTool openApiSchema + * @property {string|null} [name] OpenApiTool name + * @property {string|null} [description] OpenApiTool description + * @property {google.cloud.ces.v1.IApiAuthentication|null} [apiAuthentication] OpenApiTool apiAuthentication + * @property {google.cloud.ces.v1.ITlsConfig|null} [tlsConfig] OpenApiTool tlsConfig + * @property {google.cloud.ces.v1.IServiceDirectoryConfig|null} [serviceDirectoryConfig] OpenApiTool serviceDirectoryConfig + * @property {boolean|null} [ignoreUnknownFields] OpenApiTool ignoreUnknownFields + * @property {string|null} [url] OpenApiTool url + */ + + /** + * Constructs a new OpenApiTool. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an OpenApiTool. + * @implements IOpenApiTool + * @constructor + * @param {google.cloud.ces.v1.IOpenApiTool=} [properties] Properties to set + */ + function OpenApiTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpenApiTool openApiSchema. + * @member {string} openApiSchema + * @memberof google.cloud.ces.v1.OpenApiTool + * @instance + */ + OpenApiTool.prototype.openApiSchema = ""; + + /** + * OpenApiTool name. + * @member {string} name + * @memberof google.cloud.ces.v1.OpenApiTool + * @instance + */ + OpenApiTool.prototype.name = ""; + + /** + * OpenApiTool description. + * @member {string} description + * @memberof google.cloud.ces.v1.OpenApiTool + * @instance + */ + OpenApiTool.prototype.description = ""; + + /** + * OpenApiTool apiAuthentication. + * @member {google.cloud.ces.v1.IApiAuthentication|null|undefined} apiAuthentication + * @memberof google.cloud.ces.v1.OpenApiTool + * @instance + */ + OpenApiTool.prototype.apiAuthentication = null; + + /** + * OpenApiTool tlsConfig. + * @member {google.cloud.ces.v1.ITlsConfig|null|undefined} tlsConfig + * @memberof google.cloud.ces.v1.OpenApiTool + * @instance + */ + OpenApiTool.prototype.tlsConfig = null; + + /** + * OpenApiTool serviceDirectoryConfig. + * @member {google.cloud.ces.v1.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig + * @memberof google.cloud.ces.v1.OpenApiTool + * @instance + */ + OpenApiTool.prototype.serviceDirectoryConfig = null; + + /** + * OpenApiTool ignoreUnknownFields. + * @member {boolean} ignoreUnknownFields + * @memberof google.cloud.ces.v1.OpenApiTool + * @instance + */ + OpenApiTool.prototype.ignoreUnknownFields = false; + + /** + * OpenApiTool url. + * @member {string} url + * @memberof google.cloud.ces.v1.OpenApiTool + * @instance + */ + OpenApiTool.prototype.url = ""; + + /** + * Creates a new OpenApiTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.OpenApiTool + * @static + * @param {google.cloud.ces.v1.IOpenApiTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1.OpenApiTool} OpenApiTool instance + */ + OpenApiTool.create = function create(properties) { + return new OpenApiTool(properties); + }; + + /** + * Encodes the specified OpenApiTool message. Does not implicitly {@link google.cloud.ces.v1.OpenApiTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.OpenApiTool + * @static + * @param {google.cloud.ces.v1.IOpenApiTool} message OpenApiTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.openApiSchema != null && Object.hasOwnProperty.call(message, "openApiSchema")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.openApiSchema); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) + $root.google.cloud.ces.v1.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) + $root.google.cloud.ces.v1.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) + $root.google.cloud.ces.v1.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.ignoreUnknownFields != null && Object.hasOwnProperty.call(message, "ignoreUnknownFields")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.ignoreUnknownFields); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.url); + return writer; + }; + + /** + * Encodes the specified OpenApiTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OpenApiTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.OpenApiTool + * @static + * @param {google.cloud.ces.v1.IOpenApiTool} message OpenApiTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.OpenApiTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.OpenApiTool} OpenApiTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OpenApiTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.openApiSchema = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.decode(reader, reader.uint32()); + break; + } + case 5: { + message.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.ignoreUnknownFields = reader.bool(); + break; + } + case 8: { + message.url = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.OpenApiTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.OpenApiTool} OpenApiTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpenApiTool message. + * @function verify + * @memberof google.cloud.ces.v1.OpenApiTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenApiTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) + if (!$util.isString(message.openApiSchema)) + return "openApiSchema: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { + var error = $root.google.cloud.ces.v1.ApiAuthentication.verify(message.apiAuthentication); + if (error) + return "apiAuthentication." + error; + } + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { + var error = $root.google.cloud.ces.v1.TlsConfig.verify(message.tlsConfig); + if (error) + return "tlsConfig." + error; + } + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { + var error = $root.google.cloud.ces.v1.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); + if (error) + return "serviceDirectoryConfig." + error; + } + if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) + if (typeof message.ignoreUnknownFields !== "boolean") + return "ignoreUnknownFields: boolean expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + return null; + }; + + /** + * Creates an OpenApiTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.OpenApiTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.OpenApiTool} OpenApiTool + */ + OpenApiTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.OpenApiTool) + return object; + var message = new $root.google.cloud.ces.v1.OpenApiTool(); + if (object.openApiSchema != null) + message.openApiSchema = String(object.openApiSchema); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.apiAuthentication != null) { + if (typeof object.apiAuthentication !== "object") + throw TypeError(".google.cloud.ces.v1.OpenApiTool.apiAuthentication: object expected"); + message.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.fromObject(object.apiAuthentication); + } + if (object.tlsConfig != null) { + if (typeof object.tlsConfig !== "object") + throw TypeError(".google.cloud.ces.v1.OpenApiTool.tlsConfig: object expected"); + message.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.fromObject(object.tlsConfig); + } + if (object.serviceDirectoryConfig != null) { + if (typeof object.serviceDirectoryConfig !== "object") + throw TypeError(".google.cloud.ces.v1.OpenApiTool.serviceDirectoryConfig: object expected"); + message.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); + } + if (object.ignoreUnknownFields != null) + message.ignoreUnknownFields = Boolean(object.ignoreUnknownFields); + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from an OpenApiTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.OpenApiTool + * @static + * @param {google.cloud.ces.v1.OpenApiTool} message OpenApiTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenApiTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.openApiSchema = ""; + object.name = ""; + object.description = ""; + object.apiAuthentication = null; + object.tlsConfig = null; + object.serviceDirectoryConfig = null; + object.ignoreUnknownFields = false; + object.url = ""; + } + if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) + object.openApiSchema = message.openApiSchema; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) + object.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.toObject(message.apiAuthentication, options); + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) + object.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.toObject(message.tlsConfig, options); + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) + object.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); + if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) + object.ignoreUnknownFields = message.ignoreUnknownFields; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + return object; + }; + + /** + * Converts this OpenApiTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.OpenApiTool + * @instance + * @returns {Object.} JSON object + */ + OpenApiTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OpenApiTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1.OpenApiTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpenApiTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.OpenApiTool"; + }; + + return OpenApiTool; + })(); + + v1.PythonFunction = (function() { + + /** + * Properties of a PythonFunction. + * @memberof google.cloud.ces.v1 + * @interface IPythonFunction + * @property {string|null} [name] PythonFunction name + * @property {string|null} [pythonCode] PythonFunction pythonCode + * @property {string|null} [description] PythonFunction description + */ + + /** + * Constructs a new PythonFunction. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a PythonFunction. + * @implements IPythonFunction + * @constructor + * @param {google.cloud.ces.v1.IPythonFunction=} [properties] Properties to set + */ + function PythonFunction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonFunction name. + * @member {string} name + * @memberof google.cloud.ces.v1.PythonFunction + * @instance + */ + PythonFunction.prototype.name = ""; + + /** + * PythonFunction pythonCode. + * @member {string} pythonCode + * @memberof google.cloud.ces.v1.PythonFunction + * @instance + */ + PythonFunction.prototype.pythonCode = ""; + + /** + * PythonFunction description. + * @member {string} description + * @memberof google.cloud.ces.v1.PythonFunction + * @instance + */ + PythonFunction.prototype.description = ""; + + /** + * Creates a new PythonFunction instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.PythonFunction + * @static + * @param {google.cloud.ces.v1.IPythonFunction=} [properties] Properties to set + * @returns {google.cloud.ces.v1.PythonFunction} PythonFunction instance + */ + PythonFunction.create = function create(properties) { + return new PythonFunction(properties); + }; + + /** + * Encodes the specified PythonFunction message. Does not implicitly {@link google.cloud.ces.v1.PythonFunction.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.PythonFunction + * @static + * @param {google.cloud.ces.v1.IPythonFunction} message PythonFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonFunction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pythonCode); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + return writer; + }; + + /** + * Encodes the specified PythonFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1.PythonFunction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.PythonFunction + * @static + * @param {google.cloud.ces.v1.IPythonFunction} message PythonFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonFunction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonFunction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.PythonFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.PythonFunction} PythonFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonFunction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.PythonFunction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.pythonCode = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonFunction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.PythonFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.PythonFunction} PythonFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonFunction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonFunction message. + * @function verify + * @memberof google.cloud.ces.v1.PythonFunction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonFunction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) + if (!$util.isString(message.pythonCode)) + return "pythonCode: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a PythonFunction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.PythonFunction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.PythonFunction} PythonFunction + */ + PythonFunction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.PythonFunction) + return object; + var message = new $root.google.cloud.ces.v1.PythonFunction(); + if (object.name != null) + message.name = String(object.name); + if (object.pythonCode != null) + message.pythonCode = String(object.pythonCode); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a PythonFunction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.PythonFunction + * @static + * @param {google.cloud.ces.v1.PythonFunction} message PythonFunction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonFunction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pythonCode = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) + object.pythonCode = message.pythonCode; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this PythonFunction to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.PythonFunction + * @instance + * @returns {Object.} JSON object + */ + PythonFunction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonFunction + * @function getTypeUrl + * @memberof google.cloud.ces.v1.PythonFunction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonFunction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.PythonFunction"; + }; + + return PythonFunction; + })(); + + v1.SystemTool = (function() { + + /** + * Properties of a SystemTool. + * @memberof google.cloud.ces.v1 + * @interface ISystemTool + * @property {string|null} [name] SystemTool name + * @property {string|null} [description] SystemTool description + */ + + /** + * Constructs a new SystemTool. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a SystemTool. + * @implements ISystemTool + * @constructor + * @param {google.cloud.ces.v1.ISystemTool=} [properties] Properties to set + */ + function SystemTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SystemTool name. + * @member {string} name + * @memberof google.cloud.ces.v1.SystemTool + * @instance + */ + SystemTool.prototype.name = ""; + + /** + * SystemTool description. + * @member {string} description + * @memberof google.cloud.ces.v1.SystemTool + * @instance + */ + SystemTool.prototype.description = ""; + + /** + * Creates a new SystemTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.SystemTool + * @static + * @param {google.cloud.ces.v1.ISystemTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1.SystemTool} SystemTool instance + */ + SystemTool.create = function create(properties) { + return new SystemTool(properties); + }; + + /** + * Encodes the specified SystemTool message. Does not implicitly {@link google.cloud.ces.v1.SystemTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.SystemTool + * @static + * @param {google.cloud.ces.v1.ISystemTool} message SystemTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; + + /** + * Encodes the specified SystemTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SystemTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.SystemTool + * @static + * @param {google.cloud.ces.v1.ISystemTool} message SystemTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SystemTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.SystemTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.SystemTool} SystemTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.SystemTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SystemTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.SystemTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.SystemTool} SystemTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SystemTool message. + * @function verify + * @memberof google.cloud.ces.v1.SystemTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SystemTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a SystemTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.SystemTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.SystemTool} SystemTool + */ + SystemTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.SystemTool) + return object; + var message = new $root.google.cloud.ces.v1.SystemTool(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a SystemTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.SystemTool + * @static + * @param {google.cloud.ces.v1.SystemTool} message SystemTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SystemTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this SystemTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.SystemTool + * @instance + * @returns {Object.} JSON object + */ + SystemTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SystemTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1.SystemTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SystemTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.SystemTool"; + }; + + return SystemTool; + })(); + + v1.WidgetTool = (function() { + + /** + * Properties of a WidgetTool. + * @memberof google.cloud.ces.v1 + * @interface IWidgetTool + * @property {google.cloud.ces.v1.ISchema|null} [parameters] WidgetTool parameters + * @property {string|null} [name] WidgetTool name + * @property {string|null} [description] WidgetTool description + * @property {google.cloud.ces.v1.WidgetTool.WidgetType|null} [widgetType] WidgetTool widgetType + */ + + /** + * Constructs a new WidgetTool. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a WidgetTool. + * @implements IWidgetTool + * @constructor + * @param {google.cloud.ces.v1.IWidgetTool=} [properties] Properties to set + */ + function WidgetTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WidgetTool parameters. + * @member {google.cloud.ces.v1.ISchema|null|undefined} parameters + * @memberof google.cloud.ces.v1.WidgetTool + * @instance + */ + WidgetTool.prototype.parameters = null; + + /** + * WidgetTool name. + * @member {string} name + * @memberof google.cloud.ces.v1.WidgetTool + * @instance + */ + WidgetTool.prototype.name = ""; + + /** + * WidgetTool description. + * @member {string} description + * @memberof google.cloud.ces.v1.WidgetTool + * @instance + */ + WidgetTool.prototype.description = ""; + + /** + * WidgetTool widgetType. + * @member {google.cloud.ces.v1.WidgetTool.WidgetType} widgetType + * @memberof google.cloud.ces.v1.WidgetTool + * @instance + */ + WidgetTool.prototype.widgetType = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WidgetTool input. + * @member {"parameters"|undefined} input + * @memberof google.cloud.ces.v1.WidgetTool + * @instance + */ + Object.defineProperty(WidgetTool.prototype, "input", { + get: $util.oneOfGetter($oneOfFields = ["parameters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WidgetTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.WidgetTool + * @static + * @param {google.cloud.ces.v1.IWidgetTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1.WidgetTool} WidgetTool instance + */ + WidgetTool.create = function create(properties) { + return new WidgetTool(properties); + }; + + /** + * Encodes the specified WidgetTool message. Does not implicitly {@link google.cloud.ces.v1.WidgetTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.WidgetTool + * @static + * @param {google.cloud.ces.v1.IWidgetTool} message WidgetTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WidgetTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.widgetType != null && Object.hasOwnProperty.call(message, "widgetType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.widgetType); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.ces.v1.Schema.encode(message.parameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WidgetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.WidgetTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.WidgetTool + * @static + * @param {google.cloud.ces.v1.IWidgetTool} message WidgetTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WidgetTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WidgetTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.WidgetTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.WidgetTool} WidgetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WidgetTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.WidgetTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.parameters = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.widgetType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WidgetTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.WidgetTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.WidgetTool} WidgetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WidgetTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WidgetTool message. + * @function verify + * @memberof google.cloud.ces.v1.WidgetTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WidgetTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + properties.input = 1; + { + var error = $root.google.cloud.ces.v1.Schema.verify(message.parameters); + if (error) + return "parameters." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.widgetType != null && message.hasOwnProperty("widgetType")) + switch (message.widgetType) { + default: + return "widgetType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + return null; + }; + + /** + * Creates a WidgetTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.WidgetTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.WidgetTool} WidgetTool + */ + WidgetTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.WidgetTool) + return object; + var message = new $root.google.cloud.ces.v1.WidgetTool(); + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.ces.v1.WidgetTool.parameters: object expected"); + message.parameters = $root.google.cloud.ces.v1.Schema.fromObject(object.parameters); + } + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + switch (object.widgetType) { + default: + if (typeof object.widgetType === "number") { + message.widgetType = object.widgetType; + break; + } + break; + case "WIDGET_TYPE_UNSPECIFIED": + case 0: + message.widgetType = 0; + break; + case "CUSTOM": + case 1: + message.widgetType = 1; + break; + case "PRODUCT_CAROUSEL": + case 2: + message.widgetType = 2; + break; + case "PRODUCT_DETAILS": + case 3: + message.widgetType = 3; + break; + case "QUICK_ACTIONS": + case 4: + message.widgetType = 4; + break; + case "PRODUCT_COMPARISON": + case 5: + message.widgetType = 5; + break; + case "ADVANCED_PRODUCT_DETAILS": + case 6: + message.widgetType = 6; + break; + case "SHORT_FORM": + case 7: + message.widgetType = 7; + break; + case "OVERALL_SATISFACTION": + case 8: + message.widgetType = 8; + break; + case "ORDER_SUMMARY": + case 9: + message.widgetType = 9; + break; + case "APPOINTMENT_DETAILS": + case 10: + message.widgetType = 10; + break; + } + return message; + }; + + /** + * Creates a plain object from a WidgetTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.WidgetTool + * @static + * @param {google.cloud.ces.v1.WidgetTool} message WidgetTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WidgetTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.widgetType = options.enums === String ? "WIDGET_TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.widgetType != null && message.hasOwnProperty("widgetType")) + object.widgetType = options.enums === String ? $root.google.cloud.ces.v1.WidgetTool.WidgetType[message.widgetType] === undefined ? message.widgetType : $root.google.cloud.ces.v1.WidgetTool.WidgetType[message.widgetType] : message.widgetType; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + object.parameters = $root.google.cloud.ces.v1.Schema.toObject(message.parameters, options); + if (options.oneofs) + object.input = "parameters"; + } + return object; + }; + + /** + * Converts this WidgetTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.WidgetTool + * @instance + * @returns {Object.} JSON object + */ + WidgetTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WidgetTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1.WidgetTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WidgetTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.WidgetTool"; + }; + + /** + * WidgetType enum. + * @name google.cloud.ces.v1.WidgetTool.WidgetType + * @enum {number} + * @property {number} WIDGET_TYPE_UNSPECIFIED=0 WIDGET_TYPE_UNSPECIFIED value + * @property {number} CUSTOM=1 CUSTOM value + * @property {number} PRODUCT_CAROUSEL=2 PRODUCT_CAROUSEL value + * @property {number} PRODUCT_DETAILS=3 PRODUCT_DETAILS value + * @property {number} QUICK_ACTIONS=4 QUICK_ACTIONS value + * @property {number} PRODUCT_COMPARISON=5 PRODUCT_COMPARISON value + * @property {number} ADVANCED_PRODUCT_DETAILS=6 ADVANCED_PRODUCT_DETAILS value + * @property {number} SHORT_FORM=7 SHORT_FORM value + * @property {number} OVERALL_SATISFACTION=8 OVERALL_SATISFACTION value + * @property {number} ORDER_SUMMARY=9 ORDER_SUMMARY value + * @property {number} APPOINTMENT_DETAILS=10 APPOINTMENT_DETAILS value + */ + WidgetTool.WidgetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WIDGET_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CUSTOM"] = 1; + values[valuesById[2] = "PRODUCT_CAROUSEL"] = 2; + values[valuesById[3] = "PRODUCT_DETAILS"] = 3; + values[valuesById[4] = "QUICK_ACTIONS"] = 4; + values[valuesById[5] = "PRODUCT_COMPARISON"] = 5; + values[valuesById[6] = "ADVANCED_PRODUCT_DETAILS"] = 6; + values[valuesById[7] = "SHORT_FORM"] = 7; + values[valuesById[8] = "OVERALL_SATISFACTION"] = 8; + values[valuesById[9] = "ORDER_SUMMARY"] = 9; + values[valuesById[10] = "APPOINTMENT_DETAILS"] = 10; + return values; + })(); + + return WidgetTool; + })(); + + v1.Toolset = (function() { + + /** + * Properties of a Toolset. + * @memberof google.cloud.ces.v1 + * @interface IToolset + * @property {google.cloud.ces.v1.IMcpToolset|null} [mcpToolset] Toolset mcpToolset + * @property {google.cloud.ces.v1.IOpenApiToolset|null} [openApiToolset] Toolset openApiToolset + * @property {google.cloud.ces.v1.IConnectorToolset|null} [connectorToolset] Toolset connectorToolset + * @property {string|null} [name] Toolset name + * @property {string|null} [displayName] Toolset displayName + * @property {string|null} [description] Toolset description + * @property {google.protobuf.ITimestamp|null} [createTime] Toolset createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Toolset updateTime + * @property {string|null} [etag] Toolset etag + * @property {google.cloud.ces.v1.ExecutionType|null} [executionType] Toolset executionType + * @property {google.cloud.ces.v1.IToolFakeConfig|null} [toolFakeConfig] Toolset toolFakeConfig + */ + + /** + * Constructs a new Toolset. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a Toolset. + * @implements IToolset + * @constructor + * @param {google.cloud.ces.v1.IToolset=} [properties] Properties to set + */ + function Toolset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Toolset mcpToolset. + * @member {google.cloud.ces.v1.IMcpToolset|null|undefined} mcpToolset + * @memberof google.cloud.ces.v1.Toolset + * @instance + */ + Toolset.prototype.mcpToolset = null; + + /** + * Toolset openApiToolset. + * @member {google.cloud.ces.v1.IOpenApiToolset|null|undefined} openApiToolset + * @memberof google.cloud.ces.v1.Toolset + * @instance + */ + Toolset.prototype.openApiToolset = null; + + /** + * Toolset connectorToolset. + * @member {google.cloud.ces.v1.IConnectorToolset|null|undefined} connectorToolset + * @memberof google.cloud.ces.v1.Toolset + * @instance + */ + Toolset.prototype.connectorToolset = null; + + /** + * Toolset name. + * @member {string} name + * @memberof google.cloud.ces.v1.Toolset + * @instance + */ + Toolset.prototype.name = ""; + + /** + * Toolset displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1.Toolset + * @instance + */ + Toolset.prototype.displayName = ""; + + /** + * Toolset description. + * @member {string} description + * @memberof google.cloud.ces.v1.Toolset + * @instance + */ + Toolset.prototype.description = ""; + + /** + * Toolset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1.Toolset + * @instance + */ + Toolset.prototype.createTime = null; + + /** + * Toolset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1.Toolset + * @instance + */ + Toolset.prototype.updateTime = null; + + /** + * Toolset etag. + * @member {string} etag + * @memberof google.cloud.ces.v1.Toolset + * @instance + */ + Toolset.prototype.etag = ""; + + /** + * Toolset executionType. + * @member {google.cloud.ces.v1.ExecutionType} executionType + * @memberof google.cloud.ces.v1.Toolset + * @instance + */ + Toolset.prototype.executionType = 0; + + /** + * Toolset toolFakeConfig. + * @member {google.cloud.ces.v1.IToolFakeConfig|null|undefined} toolFakeConfig + * @memberof google.cloud.ces.v1.Toolset + * @instance + */ + Toolset.prototype.toolFakeConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Toolset toolsetType. + * @member {"mcpToolset"|"openApiToolset"|"connectorToolset"|undefined} toolsetType + * @memberof google.cloud.ces.v1.Toolset + * @instance + */ + Object.defineProperty(Toolset.prototype, "toolsetType", { + get: $util.oneOfGetter($oneOfFields = ["mcpToolset", "openApiToolset", "connectorToolset"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Toolset instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Toolset + * @static + * @param {google.cloud.ces.v1.IToolset=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Toolset} Toolset instance + */ + Toolset.create = function create(properties) { + return new Toolset(properties); + }; + + /** + * Encodes the specified Toolset message. Does not implicitly {@link google.cloud.ces.v1.Toolset.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Toolset + * @static + * @param {google.cloud.ces.v1.IToolset} message Toolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Toolset.encode = function encode(message, writer) { + if (!writer) + 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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); + if (message.mcpToolset != null && Object.hasOwnProperty.call(message, "mcpToolset")) + $root.google.cloud.ces.v1.McpToolset.encode(message.mcpToolset, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.openApiToolset != null && Object.hasOwnProperty.call(message, "openApiToolset")) + $root.google.cloud.ces.v1.OpenApiToolset.encode(message.openApiToolset, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.connectorToolset != null && Object.hasOwnProperty.call(message, "connectorToolset")) + $root.google.cloud.ces.v1.ConnectorToolset.encode(message.connectorToolset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.executionType != null && Object.hasOwnProperty.call(message, "executionType")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.executionType); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.description); + if (message.toolFakeConfig != null && Object.hasOwnProperty.call(message, "toolFakeConfig")) + $root.google.cloud.ces.v1.ToolFakeConfig.encode(message.toolFakeConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Toolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Toolset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Toolset + * @static + * @param {google.cloud.ces.v1.IToolset} message Toolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Toolset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Toolset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Toolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Toolset} Toolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Toolset.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Toolset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 6: { + message.mcpToolset = $root.google.cloud.ces.v1.McpToolset.decode(reader, reader.uint32()); + break; + } + case 7: { + message.openApiToolset = $root.google.cloud.ces.v1.OpenApiToolset.decode(reader, reader.uint32()); + break; + } + case 8: { + message.connectorToolset = $root.google.cloud.ces.v1.ConnectorToolset.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 10: { + message.description = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.etag = reader.string(); + break; + } + case 9: { + message.executionType = reader.int32(); + break; + } + case 11: { + message.toolFakeConfig = $root.google.cloud.ces.v1.ToolFakeConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Toolset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Toolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Toolset} Toolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Toolset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Toolset message. + * @function verify + * @memberof google.cloud.ces.v1.Toolset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Toolset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.mcpToolset != null && message.hasOwnProperty("mcpToolset")) { + properties.toolsetType = 1; + { + var error = $root.google.cloud.ces.v1.McpToolset.verify(message.mcpToolset); + if (error) + return "mcpToolset." + error; + } + } + if (message.openApiToolset != null && message.hasOwnProperty("openApiToolset")) { + if (properties.toolsetType === 1) + return "toolsetType: multiple values"; + properties.toolsetType = 1; + { + var error = $root.google.cloud.ces.v1.OpenApiToolset.verify(message.openApiToolset); + if (error) + return "openApiToolset." + error; + } + } + if (message.connectorToolset != null && message.hasOwnProperty("connectorToolset")) { + if (properties.toolsetType === 1) + return "toolsetType: multiple values"; + properties.toolsetType = 1; + { + var error = $root.google.cloud.ces.v1.ConnectorToolset.verify(message.connectorToolset); + if (error) + return "connectorToolset." + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.executionType != null && message.hasOwnProperty("executionType")) + switch (message.executionType) { + default: + return "executionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) { + var error = $root.google.cloud.ces.v1.ToolFakeConfig.verify(message.toolFakeConfig); + if (error) + return "toolFakeConfig." + error; + } + return null; + }; + + /** + * Creates a Toolset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Toolset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Toolset} Toolset + */ + Toolset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Toolset) + return object; + var message = new $root.google.cloud.ces.v1.Toolset(); + if (object.mcpToolset != null) { + if (typeof object.mcpToolset !== "object") + throw TypeError(".google.cloud.ces.v1.Toolset.mcpToolset: object expected"); + message.mcpToolset = $root.google.cloud.ces.v1.McpToolset.fromObject(object.mcpToolset); + } + if (object.openApiToolset != null) { + if (typeof object.openApiToolset !== "object") + throw TypeError(".google.cloud.ces.v1.Toolset.openApiToolset: object expected"); + message.openApiToolset = $root.google.cloud.ces.v1.OpenApiToolset.fromObject(object.openApiToolset); + } + if (object.connectorToolset != null) { + if (typeof object.connectorToolset !== "object") + throw TypeError(".google.cloud.ces.v1.Toolset.connectorToolset: object expected"); + message.connectorToolset = $root.google.cloud.ces.v1.ConnectorToolset.fromObject(object.connectorToolset); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1.Toolset.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.ces.v1.Toolset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + switch (object.executionType) { + default: + if (typeof object.executionType === "number") { + message.executionType = object.executionType; + break; + } + break; + case "EXECUTION_TYPE_UNSPECIFIED": + case 0: + message.executionType = 0; + break; + case "SYNCHRONOUS": + case 1: + message.executionType = 1; + break; + case "ASYNCHRONOUS": + case 2: + message.executionType = 2; + break; + } + if (object.toolFakeConfig != null) { + if (typeof object.toolFakeConfig !== "object") + throw TypeError(".google.cloud.ces.v1.Toolset.toolFakeConfig: object expected"); + message.toolFakeConfig = $root.google.cloud.ces.v1.ToolFakeConfig.fromObject(object.toolFakeConfig); + } + return message; + }; + + /** + * Creates a plain object from a Toolset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Toolset + * @static + * @param {google.cloud.ces.v1.Toolset} message Toolset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Toolset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.executionType = options.enums === String ? "EXECUTION_TYPE_UNSPECIFIED" : 0; + object.description = ""; + object.toolFakeConfig = 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.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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.mcpToolset != null && message.hasOwnProperty("mcpToolset")) { + object.mcpToolset = $root.google.cloud.ces.v1.McpToolset.toObject(message.mcpToolset, options); + if (options.oneofs) + object.toolsetType = "mcpToolset"; + } + if (message.openApiToolset != null && message.hasOwnProperty("openApiToolset")) { + object.openApiToolset = $root.google.cloud.ces.v1.OpenApiToolset.toObject(message.openApiToolset, options); + if (options.oneofs) + object.toolsetType = "openApiToolset"; + } + if (message.connectorToolset != null && message.hasOwnProperty("connectorToolset")) { + object.connectorToolset = $root.google.cloud.ces.v1.ConnectorToolset.toObject(message.connectorToolset, options); + if (options.oneofs) + object.toolsetType = "connectorToolset"; + } + if (message.executionType != null && message.hasOwnProperty("executionType")) + object.executionType = options.enums === String ? $root.google.cloud.ces.v1.ExecutionType[message.executionType] === undefined ? message.executionType : $root.google.cloud.ces.v1.ExecutionType[message.executionType] : message.executionType; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) + object.toolFakeConfig = $root.google.cloud.ces.v1.ToolFakeConfig.toObject(message.toolFakeConfig, options); + return object; + }; + + /** + * Converts this Toolset to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Toolset + * @instance + * @returns {Object.} JSON object + */ + Toolset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Toolset + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Toolset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Toolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Toolset"; + }; + + return Toolset; + })(); + + v1.ConnectorToolset = (function() { + + /** + * Properties of a ConnectorToolset. + * @memberof google.cloud.ces.v1 + * @interface IConnectorToolset + * @property {string|null} [connection] ConnectorToolset connection + * @property {google.cloud.ces.v1.IEndUserAuthConfig|null} [authConfig] ConnectorToolset authConfig + * @property {Array.|null} [connectorActions] ConnectorToolset connectorActions + */ + + /** + * Constructs a new ConnectorToolset. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ConnectorToolset. + * @implements IConnectorToolset + * @constructor + * @param {google.cloud.ces.v1.IConnectorToolset=} [properties] Properties to set + */ + function ConnectorToolset(properties) { + this.connectorActions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectorToolset connection. + * @member {string} connection + * @memberof google.cloud.ces.v1.ConnectorToolset + * @instance + */ + ConnectorToolset.prototype.connection = ""; + + /** + * ConnectorToolset authConfig. + * @member {google.cloud.ces.v1.IEndUserAuthConfig|null|undefined} authConfig + * @memberof google.cloud.ces.v1.ConnectorToolset + * @instance + */ + ConnectorToolset.prototype.authConfig = null; + + /** + * ConnectorToolset connectorActions. + * @member {Array.} connectorActions + * @memberof google.cloud.ces.v1.ConnectorToolset + * @instance + */ + ConnectorToolset.prototype.connectorActions = $util.emptyArray; + + /** + * Creates a new ConnectorToolset instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ConnectorToolset + * @static + * @param {google.cloud.ces.v1.IConnectorToolset=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ConnectorToolset} ConnectorToolset instance + */ + ConnectorToolset.create = function create(properties) { + return new ConnectorToolset(properties); + }; + + /** + * Encodes the specified ConnectorToolset message. Does not implicitly {@link google.cloud.ces.v1.ConnectorToolset.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ConnectorToolset + * @static + * @param {google.cloud.ces.v1.IConnectorToolset} message ConnectorToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorToolset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection); + if (message.authConfig != null && Object.hasOwnProperty.call(message, "authConfig")) + $root.google.cloud.ces.v1.EndUserAuthConfig.encode(message.authConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.connectorActions != null && message.connectorActions.length) + for (var i = 0; i < message.connectorActions.length; ++i) + $root.google.cloud.ces.v1.Action.encode(message.connectorActions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConnectorToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ConnectorToolset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ConnectorToolset + * @static + * @param {google.cloud.ces.v1.IConnectorToolset} message ConnectorToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorToolset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectorToolset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ConnectorToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ConnectorToolset} ConnectorToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorToolset.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ConnectorToolset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.connection = reader.string(); + break; + } + case 2: { + message.authConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.connectorActions && message.connectorActions.length)) + message.connectorActions = []; + message.connectorActions.push($root.google.cloud.ces.v1.Action.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectorToolset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ConnectorToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ConnectorToolset} ConnectorToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorToolset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectorToolset message. + * @function verify + * @memberof google.cloud.ces.v1.ConnectorToolset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectorToolset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connection != null && message.hasOwnProperty("connection")) + if (!$util.isString(message.connection)) + return "connection: string expected"; + if (message.authConfig != null && message.hasOwnProperty("authConfig")) { + var error = $root.google.cloud.ces.v1.EndUserAuthConfig.verify(message.authConfig); + if (error) + return "authConfig." + error; + } + if (message.connectorActions != null && message.hasOwnProperty("connectorActions")) { + if (!Array.isArray(message.connectorActions)) + return "connectorActions: array expected"; + for (var i = 0; i < message.connectorActions.length; ++i) { + var error = $root.google.cloud.ces.v1.Action.verify(message.connectorActions[i]); + if (error) + return "connectorActions." + error; + } + } + return null; + }; + + /** + * Creates a ConnectorToolset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ConnectorToolset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ConnectorToolset} ConnectorToolset + */ + ConnectorToolset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ConnectorToolset) + return object; + var message = new $root.google.cloud.ces.v1.ConnectorToolset(); + if (object.connection != null) + message.connection = String(object.connection); + if (object.authConfig != null) { + if (typeof object.authConfig !== "object") + throw TypeError(".google.cloud.ces.v1.ConnectorToolset.authConfig: object expected"); + message.authConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.fromObject(object.authConfig); + } + if (object.connectorActions) { + if (!Array.isArray(object.connectorActions)) + throw TypeError(".google.cloud.ces.v1.ConnectorToolset.connectorActions: array expected"); + message.connectorActions = []; + for (var i = 0; i < object.connectorActions.length; ++i) { + if (typeof object.connectorActions[i] !== "object") + throw TypeError(".google.cloud.ces.v1.ConnectorToolset.connectorActions: object expected"); + message.connectorActions[i] = $root.google.cloud.ces.v1.Action.fromObject(object.connectorActions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ConnectorToolset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ConnectorToolset + * @static + * @param {google.cloud.ces.v1.ConnectorToolset} message ConnectorToolset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectorToolset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.connectorActions = []; + if (options.defaults) { + object.connection = ""; + object.authConfig = null; + } + if (message.connection != null && message.hasOwnProperty("connection")) + object.connection = message.connection; + if (message.authConfig != null && message.hasOwnProperty("authConfig")) + object.authConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.toObject(message.authConfig, options); + if (message.connectorActions && message.connectorActions.length) { + object.connectorActions = []; + for (var j = 0; j < message.connectorActions.length; ++j) + object.connectorActions[j] = $root.google.cloud.ces.v1.Action.toObject(message.connectorActions[j], options); + } + return object; + }; + + /** + * Converts this ConnectorToolset to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ConnectorToolset + * @instance + * @returns {Object.} JSON object + */ + ConnectorToolset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectorToolset + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ConnectorToolset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectorToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ConnectorToolset"; + }; + + return ConnectorToolset; + })(); + + v1.McpToolset = (function() { + + /** + * Properties of a McpToolset. + * @memberof google.cloud.ces.v1 + * @interface IMcpToolset + * @property {string|null} [serverAddress] McpToolset serverAddress + * @property {google.cloud.ces.v1.IApiAuthentication|null} [apiAuthentication] McpToolset apiAuthentication + * @property {google.cloud.ces.v1.IServiceDirectoryConfig|null} [serviceDirectoryConfig] McpToolset serviceDirectoryConfig + * @property {google.cloud.ces.v1.ITlsConfig|null} [tlsConfig] McpToolset tlsConfig + */ + + /** + * Constructs a new McpToolset. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a McpToolset. + * @implements IMcpToolset + * @constructor + * @param {google.cloud.ces.v1.IMcpToolset=} [properties] Properties to set + */ + function McpToolset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * McpToolset serverAddress. + * @member {string} serverAddress + * @memberof google.cloud.ces.v1.McpToolset + * @instance + */ + McpToolset.prototype.serverAddress = ""; + + /** + * McpToolset apiAuthentication. + * @member {google.cloud.ces.v1.IApiAuthentication|null|undefined} apiAuthentication + * @memberof google.cloud.ces.v1.McpToolset + * @instance + */ + McpToolset.prototype.apiAuthentication = null; + + /** + * McpToolset serviceDirectoryConfig. + * @member {google.cloud.ces.v1.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig + * @memberof google.cloud.ces.v1.McpToolset + * @instance + */ + McpToolset.prototype.serviceDirectoryConfig = null; + + /** + * McpToolset tlsConfig. + * @member {google.cloud.ces.v1.ITlsConfig|null|undefined} tlsConfig + * @memberof google.cloud.ces.v1.McpToolset + * @instance + */ + McpToolset.prototype.tlsConfig = null; + + /** + * Creates a new McpToolset instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.McpToolset + * @static + * @param {google.cloud.ces.v1.IMcpToolset=} [properties] Properties to set + * @returns {google.cloud.ces.v1.McpToolset} McpToolset instance + */ + McpToolset.create = function create(properties) { + return new McpToolset(properties); + }; + + /** + * Encodes the specified McpToolset message. Does not implicitly {@link google.cloud.ces.v1.McpToolset.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.McpToolset + * @static + * @param {google.cloud.ces.v1.IMcpToolset} message McpToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + McpToolset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serverAddress != null && Object.hasOwnProperty.call(message, "serverAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serverAddress); + if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) + $root.google.cloud.ces.v1.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) + $root.google.cloud.ces.v1.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) + $root.google.cloud.ces.v1.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified McpToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.McpToolset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.McpToolset + * @static + * @param {google.cloud.ces.v1.IMcpToolset} message McpToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + McpToolset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a McpToolset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.McpToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.McpToolset} McpToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + McpToolset.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.McpToolset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.serverAddress = reader.string(); + break; + } + case 2: { + message.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.decode(reader, reader.uint32()); + break; + } + case 3: { + message.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a McpToolset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.McpToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.McpToolset} McpToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + McpToolset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a McpToolset message. + * @function verify + * @memberof google.cloud.ces.v1.McpToolset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + McpToolset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) + if (!$util.isString(message.serverAddress)) + return "serverAddress: string expected"; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { + var error = $root.google.cloud.ces.v1.ApiAuthentication.verify(message.apiAuthentication); + if (error) + return "apiAuthentication." + error; + } + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { + var error = $root.google.cloud.ces.v1.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); + if (error) + return "serviceDirectoryConfig." + error; + } + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { + var error = $root.google.cloud.ces.v1.TlsConfig.verify(message.tlsConfig); + if (error) + return "tlsConfig." + error; + } + return null; + }; + + /** + * Creates a McpToolset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.McpToolset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.McpToolset} McpToolset + */ + McpToolset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.McpToolset) + return object; + var message = new $root.google.cloud.ces.v1.McpToolset(); + if (object.serverAddress != null) + message.serverAddress = String(object.serverAddress); + if (object.apiAuthentication != null) { + if (typeof object.apiAuthentication !== "object") + throw TypeError(".google.cloud.ces.v1.McpToolset.apiAuthentication: object expected"); + message.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.fromObject(object.apiAuthentication); + } + if (object.serviceDirectoryConfig != null) { + if (typeof object.serviceDirectoryConfig !== "object") + throw TypeError(".google.cloud.ces.v1.McpToolset.serviceDirectoryConfig: object expected"); + message.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); + } + if (object.tlsConfig != null) { + if (typeof object.tlsConfig !== "object") + throw TypeError(".google.cloud.ces.v1.McpToolset.tlsConfig: object expected"); + message.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.fromObject(object.tlsConfig); + } + return message; + }; + + /** + * Creates a plain object from a McpToolset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.McpToolset + * @static + * @param {google.cloud.ces.v1.McpToolset} message McpToolset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + McpToolset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serverAddress = ""; + object.apiAuthentication = null; + object.serviceDirectoryConfig = null; + object.tlsConfig = null; + } + if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) + object.serverAddress = message.serverAddress; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) + object.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.toObject(message.apiAuthentication, options); + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) + object.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) + object.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.toObject(message.tlsConfig, options); + return object; + }; + + /** + * Converts this McpToolset to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.McpToolset + * @instance + * @returns {Object.} JSON object + */ + McpToolset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for McpToolset + * @function getTypeUrl + * @memberof google.cloud.ces.v1.McpToolset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + McpToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.McpToolset"; + }; + + return McpToolset; + })(); + + v1.OpenApiToolset = (function() { + + /** + * Properties of an OpenApiToolset. + * @memberof google.cloud.ces.v1 + * @interface IOpenApiToolset + * @property {string|null} [openApiSchema] OpenApiToolset openApiSchema + * @property {google.cloud.ces.v1.IApiAuthentication|null} [apiAuthentication] OpenApiToolset apiAuthentication + * @property {google.cloud.ces.v1.ITlsConfig|null} [tlsConfig] OpenApiToolset tlsConfig + * @property {google.cloud.ces.v1.IServiceDirectoryConfig|null} [serviceDirectoryConfig] OpenApiToolset serviceDirectoryConfig + * @property {boolean|null} [ignoreUnknownFields] OpenApiToolset ignoreUnknownFields + * @property {string|null} [url] OpenApiToolset url + */ + + /** + * Constructs a new OpenApiToolset. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an OpenApiToolset. + * @implements IOpenApiToolset + * @constructor + * @param {google.cloud.ces.v1.IOpenApiToolset=} [properties] Properties to set + */ + function OpenApiToolset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpenApiToolset openApiSchema. + * @member {string} openApiSchema + * @memberof google.cloud.ces.v1.OpenApiToolset + * @instance + */ + OpenApiToolset.prototype.openApiSchema = ""; + + /** + * OpenApiToolset apiAuthentication. + * @member {google.cloud.ces.v1.IApiAuthentication|null|undefined} apiAuthentication + * @memberof google.cloud.ces.v1.OpenApiToolset + * @instance + */ + OpenApiToolset.prototype.apiAuthentication = null; + + /** + * OpenApiToolset tlsConfig. + * @member {google.cloud.ces.v1.ITlsConfig|null|undefined} tlsConfig + * @memberof google.cloud.ces.v1.OpenApiToolset + * @instance + */ + OpenApiToolset.prototype.tlsConfig = null; + + /** + * OpenApiToolset serviceDirectoryConfig. + * @member {google.cloud.ces.v1.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig + * @memberof google.cloud.ces.v1.OpenApiToolset + * @instance + */ + OpenApiToolset.prototype.serviceDirectoryConfig = null; + + /** + * OpenApiToolset ignoreUnknownFields. + * @member {boolean} ignoreUnknownFields + * @memberof google.cloud.ces.v1.OpenApiToolset + * @instance + */ + OpenApiToolset.prototype.ignoreUnknownFields = false; + + /** + * OpenApiToolset url. + * @member {string} url + * @memberof google.cloud.ces.v1.OpenApiToolset + * @instance + */ + OpenApiToolset.prototype.url = ""; + + /** + * Creates a new OpenApiToolset instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.OpenApiToolset + * @static + * @param {google.cloud.ces.v1.IOpenApiToolset=} [properties] Properties to set + * @returns {google.cloud.ces.v1.OpenApiToolset} OpenApiToolset instance + */ + OpenApiToolset.create = function create(properties) { + return new OpenApiToolset(properties); + }; + + /** + * Encodes the specified OpenApiToolset message. Does not implicitly {@link google.cloud.ces.v1.OpenApiToolset.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.OpenApiToolset + * @static + * @param {google.cloud.ces.v1.IOpenApiToolset} message OpenApiToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiToolset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.openApiSchema != null && Object.hasOwnProperty.call(message, "openApiSchema")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.openApiSchema); + if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) + $root.google.cloud.ces.v1.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) + $root.google.cloud.ces.v1.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) + $root.google.cloud.ces.v1.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ignoreUnknownFields != null && Object.hasOwnProperty.call(message, "ignoreUnknownFields")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.ignoreUnknownFields); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.url); + return writer; + }; + + /** + * Encodes the specified OpenApiToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OpenApiToolset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.OpenApiToolset + * @static + * @param {google.cloud.ces.v1.IOpenApiToolset} message OpenApiToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiToolset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenApiToolset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.OpenApiToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.OpenApiToolset} OpenApiToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiToolset.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OpenApiToolset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.openApiSchema = reader.string(); + break; + } + case 2: { + message.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.decode(reader, reader.uint32()); + break; + } + case 3: { + message.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.ignoreUnknownFields = reader.bool(); + break; + } + case 6: { + message.url = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OpenApiToolset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.OpenApiToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.OpenApiToolset} OpenApiToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiToolset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpenApiToolset message. + * @function verify + * @memberof google.cloud.ces.v1.OpenApiToolset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenApiToolset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) + if (!$util.isString(message.openApiSchema)) + return "openApiSchema: string expected"; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { + var error = $root.google.cloud.ces.v1.ApiAuthentication.verify(message.apiAuthentication); + if (error) + return "apiAuthentication." + error; + } + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { + var error = $root.google.cloud.ces.v1.TlsConfig.verify(message.tlsConfig); + if (error) + return "tlsConfig." + error; + } + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { + var error = $root.google.cloud.ces.v1.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); + if (error) + return "serviceDirectoryConfig." + error; + } + if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) + if (typeof message.ignoreUnknownFields !== "boolean") + return "ignoreUnknownFields: boolean expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + return null; + }; + + /** + * Creates an OpenApiToolset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.OpenApiToolset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.OpenApiToolset} OpenApiToolset + */ + OpenApiToolset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.OpenApiToolset) + return object; + var message = new $root.google.cloud.ces.v1.OpenApiToolset(); + if (object.openApiSchema != null) + message.openApiSchema = String(object.openApiSchema); + if (object.apiAuthentication != null) { + if (typeof object.apiAuthentication !== "object") + throw TypeError(".google.cloud.ces.v1.OpenApiToolset.apiAuthentication: object expected"); + message.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.fromObject(object.apiAuthentication); + } + if (object.tlsConfig != null) { + if (typeof object.tlsConfig !== "object") + throw TypeError(".google.cloud.ces.v1.OpenApiToolset.tlsConfig: object expected"); + message.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.fromObject(object.tlsConfig); + } + if (object.serviceDirectoryConfig != null) { + if (typeof object.serviceDirectoryConfig !== "object") + throw TypeError(".google.cloud.ces.v1.OpenApiToolset.serviceDirectoryConfig: object expected"); + message.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); + } + if (object.ignoreUnknownFields != null) + message.ignoreUnknownFields = Boolean(object.ignoreUnknownFields); + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from an OpenApiToolset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.OpenApiToolset + * @static + * @param {google.cloud.ces.v1.OpenApiToolset} message OpenApiToolset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenApiToolset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.openApiSchema = ""; + object.apiAuthentication = null; + object.tlsConfig = null; + object.serviceDirectoryConfig = null; + object.ignoreUnknownFields = false; + object.url = ""; + } + if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) + object.openApiSchema = message.openApiSchema; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) + object.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.toObject(message.apiAuthentication, options); + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) + object.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.toObject(message.tlsConfig, options); + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) + object.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); + if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) + object.ignoreUnknownFields = message.ignoreUnknownFields; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + return object; + }; + + /** + * Converts this OpenApiToolset to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.OpenApiToolset + * @instance + * @returns {Object.} JSON object + */ + OpenApiToolset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OpenApiToolset + * @function getTypeUrl + * @memberof google.cloud.ces.v1.OpenApiToolset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpenApiToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.OpenApiToolset"; + }; + + return OpenApiToolset; + })(); + + v1.Changelog = (function() { + + /** + * Properties of a Changelog. + * @memberof google.cloud.ces.v1 + * @interface IChangelog + * @property {string|null} [name] Changelog name + * @property {string|null} [author] Changelog author + * @property {string|null} [displayName] Changelog displayName + * @property {string|null} [description] Changelog description + * @property {string|null} [resource] Changelog resource + * @property {string|null} [resourceType] Changelog resourceType + * @property {string|null} [action] Changelog action + * @property {google.protobuf.IStruct|null} [originalResource] Changelog originalResource + * @property {google.protobuf.IStruct|null} [newResource] Changelog newResource + * @property {Array.|null} [dependentResources] Changelog dependentResources + * @property {google.protobuf.ITimestamp|null} [createTime] Changelog createTime + * @property {number|Long|null} [sequenceNumber] Changelog sequenceNumber + */ + + /** + * Constructs a new Changelog. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a Changelog. + * @implements IChangelog + * @constructor + * @param {google.cloud.ces.v1.IChangelog=} [properties] Properties to set + */ + function Changelog(properties) { + this.dependentResources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Changelog name. + * @member {string} name + * @memberof google.cloud.ces.v1.Changelog + * @instance + */ + Changelog.prototype.name = ""; + + /** + * Changelog author. + * @member {string} author + * @memberof google.cloud.ces.v1.Changelog + * @instance + */ + Changelog.prototype.author = ""; + + /** + * Changelog displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1.Changelog + * @instance + */ + Changelog.prototype.displayName = ""; + + /** + * Changelog description. + * @member {string} description + * @memberof google.cloud.ces.v1.Changelog + * @instance + */ + Changelog.prototype.description = ""; + + /** + * Changelog resource. + * @member {string} resource + * @memberof google.cloud.ces.v1.Changelog + * @instance + */ + Changelog.prototype.resource = ""; + + /** + * Changelog resourceType. + * @member {string} resourceType + * @memberof google.cloud.ces.v1.Changelog + * @instance + */ + Changelog.prototype.resourceType = ""; + + /** + * Changelog action. + * @member {string} action + * @memberof google.cloud.ces.v1.Changelog + * @instance + */ + Changelog.prototype.action = ""; + + /** + * Changelog originalResource. + * @member {google.protobuf.IStruct|null|undefined} originalResource + * @memberof google.cloud.ces.v1.Changelog + * @instance + */ + Changelog.prototype.originalResource = null; + + /** + * Changelog newResource. + * @member {google.protobuf.IStruct|null|undefined} newResource + * @memberof google.cloud.ces.v1.Changelog + * @instance + */ + Changelog.prototype.newResource = null; + + /** + * Changelog dependentResources. + * @member {Array.} dependentResources + * @memberof google.cloud.ces.v1.Changelog + * @instance + */ + Changelog.prototype.dependentResources = $util.emptyArray; + + /** + * Changelog createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1.Changelog + * @instance + */ + Changelog.prototype.createTime = null; + + /** + * Changelog sequenceNumber. + * @member {number|Long} sequenceNumber + * @memberof google.cloud.ces.v1.Changelog + * @instance + */ + Changelog.prototype.sequenceNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Changelog instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Changelog + * @static + * @param {google.cloud.ces.v1.IChangelog=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Changelog} Changelog instance + */ + Changelog.create = function create(properties) { + return new Changelog(properties); + }; + + /** + * Encodes the specified Changelog message. Does not implicitly {@link google.cloud.ces.v1.Changelog.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Changelog + * @static + * @param {google.cloud.ces.v1.IChangelog} message Changelog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Changelog.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.author != null && Object.hasOwnProperty.call(message, "author")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.author); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resource); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceType); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.action); + if (message.originalResource != null && Object.hasOwnProperty.call(message, "originalResource")) + $root.google.protobuf.Struct.encode(message.originalResource, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.newResource != null && Object.hasOwnProperty.call(message, "newResource")) + $root.google.protobuf.Struct.encode(message.newResource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.dependentResources != null && message.dependentResources.length) + for (var i = 0; i < message.dependentResources.length; ++i) + $root.google.protobuf.Struct.encode(message.dependentResources[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.description); + if (message.sequenceNumber != null && Object.hasOwnProperty.call(message, "sequenceNumber")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.sequenceNumber); + return writer; + }; + + /** + * Encodes the specified Changelog message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Changelog.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Changelog + * @static + * @param {google.cloud.ces.v1.IChangelog} message Changelog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Changelog.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Changelog message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Changelog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Changelog} Changelog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Changelog.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Changelog(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.author = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 11: { + message.description = reader.string(); + break; + } + case 4: { + message.resource = reader.string(); + break; + } + case 5: { + message.resourceType = reader.string(); + break; + } + case 6: { + message.action = reader.string(); + break; + } + case 7: { + message.originalResource = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 8: { + message.newResource = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.dependentResources && message.dependentResources.length)) + message.dependentResources = []; + message.dependentResources.push($root.google.protobuf.Struct.decode(reader, reader.uint32())); + break; + } + case 10: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.sequenceNumber = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Changelog message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Changelog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Changelog} Changelog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Changelog.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Changelog message. + * @function verify + * @memberof google.cloud.ces.v1.Changelog + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Changelog.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.author != null && message.hasOwnProperty("author")) + if (!$util.isString(message.author)) + return "author: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.originalResource != null && message.hasOwnProperty("originalResource")) { + var error = $root.google.protobuf.Struct.verify(message.originalResource); + if (error) + return "originalResource." + error; + } + if (message.newResource != null && message.hasOwnProperty("newResource")) { + var error = $root.google.protobuf.Struct.verify(message.newResource); + if (error) + return "newResource." + error; + } + if (message.dependentResources != null && message.hasOwnProperty("dependentResources")) { + if (!Array.isArray(message.dependentResources)) + return "dependentResources: array expected"; + for (var i = 0; i < message.dependentResources.length; ++i) { + var error = $root.google.protobuf.Struct.verify(message.dependentResources[i]); + if (error) + return "dependentResources." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) + if (!$util.isInteger(message.sequenceNumber) && !(message.sequenceNumber && $util.isInteger(message.sequenceNumber.low) && $util.isInteger(message.sequenceNumber.high))) + return "sequenceNumber: integer|Long expected"; + return null; + }; + + /** + * Creates a Changelog message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Changelog + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Changelog} Changelog + */ + Changelog.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Changelog) + return object; + var message = new $root.google.cloud.ces.v1.Changelog(); + if (object.name != null) + message.name = String(object.name); + if (object.author != null) + message.author = String(object.author); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.resource != null) + message.resource = String(object.resource); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.action != null) + message.action = String(object.action); + if (object.originalResource != null) { + if (typeof object.originalResource !== "object") + throw TypeError(".google.cloud.ces.v1.Changelog.originalResource: object expected"); + message.originalResource = $root.google.protobuf.Struct.fromObject(object.originalResource); + } + if (object.newResource != null) { + if (typeof object.newResource !== "object") + throw TypeError(".google.cloud.ces.v1.Changelog.newResource: object expected"); + message.newResource = $root.google.protobuf.Struct.fromObject(object.newResource); + } + if (object.dependentResources) { + if (!Array.isArray(object.dependentResources)) + throw TypeError(".google.cloud.ces.v1.Changelog.dependentResources: array expected"); + message.dependentResources = []; + for (var i = 0; i < object.dependentResources.length; ++i) { + if (typeof object.dependentResources[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Changelog.dependentResources: object expected"); + message.dependentResources[i] = $root.google.protobuf.Struct.fromObject(object.dependentResources[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1.Changelog.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.sequenceNumber != null) + if ($util.Long) + (message.sequenceNumber = $util.Long.fromValue(object.sequenceNumber)).unsigned = false; + else if (typeof object.sequenceNumber === "string") + message.sequenceNumber = parseInt(object.sequenceNumber, 10); + else if (typeof object.sequenceNumber === "number") + message.sequenceNumber = object.sequenceNumber; + else if (typeof object.sequenceNumber === "object") + message.sequenceNumber = new $util.LongBits(object.sequenceNumber.low >>> 0, object.sequenceNumber.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Changelog message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Changelog + * @static + * @param {google.cloud.ces.v1.Changelog} message Changelog + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Changelog.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dependentResources = []; + if (options.defaults) { + object.name = ""; + object.author = ""; + object.displayName = ""; + object.resource = ""; + object.resourceType = ""; + object.action = ""; + object.originalResource = null; + object.newResource = null; + object.createTime = null; + object.description = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sequenceNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequenceNumber = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.author != null && message.hasOwnProperty("author")) + object.author = message.author; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.originalResource != null && message.hasOwnProperty("originalResource")) + object.originalResource = $root.google.protobuf.Struct.toObject(message.originalResource, options); + if (message.newResource != null && message.hasOwnProperty("newResource")) + object.newResource = $root.google.protobuf.Struct.toObject(message.newResource, options); + if (message.dependentResources && message.dependentResources.length) { + object.dependentResources = []; + for (var j = 0; j < message.dependentResources.length; ++j) + object.dependentResources[j] = $root.google.protobuf.Struct.toObject(message.dependentResources[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) + if (typeof message.sequenceNumber === "number") + object.sequenceNumber = options.longs === String ? String(message.sequenceNumber) : message.sequenceNumber; + else + object.sequenceNumber = options.longs === String ? $util.Long.prototype.toString.call(message.sequenceNumber) : options.longs === Number ? new $util.LongBits(message.sequenceNumber.low >>> 0, message.sequenceNumber.high >>> 0).toNumber() : message.sequenceNumber; + return object; + }; + + /** + * Converts this Changelog to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Changelog + * @instance + * @returns {Object.} JSON object + */ + Changelog.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Changelog + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Changelog + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Changelog.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Changelog"; + }; + + return Changelog; + })(); + + v1.Conversation = (function() { + + /** + * Properties of a Conversation. + * @memberof google.cloud.ces.v1 + * @interface IConversation + * @property {string|null} [name] Conversation name + * @property {google.protobuf.ITimestamp|null} [startTime] Conversation startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Conversation endTime + * @property {Array.|null} [turns] Conversation turns + * @property {number|null} [turnCount] Conversation turnCount + * @property {google.cloud.ces.v1.Conversation.ChannelType|null} [channelType] Conversation channelType + * @property {google.cloud.ces.v1.Conversation.Source|null} [source] Conversation source + * @property {Array.|null} [inputTypes] Conversation inputTypes + * @property {string|null} [entryAgent] Conversation entryAgent + * @property {string|null} [deployment] Conversation deployment + * @property {string|null} [appVersion] Conversation appVersion + * @property {string|null} [languageCode] Conversation languageCode + * @property {Array.|null} [messages] Conversation messages + */ + + /** + * Constructs a new Conversation. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a Conversation. + * @implements IConversation + * @constructor + * @param {google.cloud.ces.v1.IConversation=} [properties] Properties to set + */ + function Conversation(properties) { + this.turns = []; + this.inputTypes = []; + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Conversation name. + * @member {string} name + * @memberof google.cloud.ces.v1.Conversation + * @instance + */ + Conversation.prototype.name = ""; + + /** + * Conversation startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.ces.v1.Conversation + * @instance + */ + Conversation.prototype.startTime = null; + + /** + * Conversation endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1.Conversation + * @instance + */ + Conversation.prototype.endTime = null; + + /** + * Conversation turns. + * @member {Array.} turns + * @memberof google.cloud.ces.v1.Conversation + * @instance + */ + Conversation.prototype.turns = $util.emptyArray; + + /** + * Conversation turnCount. + * @member {number} turnCount + * @memberof google.cloud.ces.v1.Conversation + * @instance + */ + Conversation.prototype.turnCount = 0; + + /** + * Conversation channelType. + * @member {google.cloud.ces.v1.Conversation.ChannelType} channelType + * @memberof google.cloud.ces.v1.Conversation + * @instance + */ + Conversation.prototype.channelType = 0; + + /** + * Conversation source. + * @member {google.cloud.ces.v1.Conversation.Source} source + * @memberof google.cloud.ces.v1.Conversation + * @instance + */ + Conversation.prototype.source = 0; + + /** + * Conversation inputTypes. + * @member {Array.} inputTypes + * @memberof google.cloud.ces.v1.Conversation + * @instance + */ + Conversation.prototype.inputTypes = $util.emptyArray; + + /** + * Conversation entryAgent. + * @member {string} entryAgent + * @memberof google.cloud.ces.v1.Conversation + * @instance + */ + Conversation.prototype.entryAgent = ""; + + /** + * Conversation deployment. + * @member {string} deployment + * @memberof google.cloud.ces.v1.Conversation + * @instance + */ + Conversation.prototype.deployment = ""; + + /** + * Conversation appVersion. + * @member {string} appVersion + * @memberof google.cloud.ces.v1.Conversation + * @instance + */ + Conversation.prototype.appVersion = ""; + + /** + * Conversation languageCode. + * @member {string} languageCode + * @memberof google.cloud.ces.v1.Conversation + * @instance + */ + Conversation.prototype.languageCode = ""; + + /** + * Conversation messages. + * @member {Array.} messages + * @memberof google.cloud.ces.v1.Conversation + * @instance + */ + Conversation.prototype.messages = $util.emptyArray; + + /** + * Creates a new Conversation instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Conversation + * @static + * @param {google.cloud.ces.v1.IConversation=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Conversation} Conversation instance + */ + Conversation.create = function create(properties) { + return new Conversation(properties); + }; + + /** + * Encodes the specified Conversation message. Does not implicitly {@link google.cloud.ces.v1.Conversation.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Conversation + * @static + * @param {google.cloud.ces.v1.IConversation} message Conversation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Conversation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.ces.v1.Message.encode(message.messages[i], 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 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.turns != null && message.turns.length) + for (var i = 0; i < message.turns.length; ++i) + $root.google.cloud.ces.v1.Conversation.Turn.encode(message.turns[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.turnCount != null && Object.hasOwnProperty.call(message, "turnCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.turnCount); + if (message.channelType != null && Object.hasOwnProperty.call(message, "channelType")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.channelType); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.source); + if (message.inputTypes != null && message.inputTypes.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.inputTypes.length; ++i) + writer.int32(message.inputTypes[i]); + writer.ldelim(); + } + if (message.entryAgent != null && Object.hasOwnProperty.call(message, "entryAgent")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.entryAgent); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.deployment); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.appVersion); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified Conversation message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Conversation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Conversation + * @static + * @param {google.cloud.ces.v1.IConversation} message Conversation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Conversation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Conversation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Conversation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Conversation} Conversation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Conversation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Conversation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.turns && message.turns.length)) + message.turns = []; + message.turns.push($root.google.cloud.ces.v1.Conversation.Turn.decode(reader, reader.uint32())); + break; + } + case 7: { + message.turnCount = reader.int32(); + break; + } + case 8: { + message.channelType = reader.int32(); + break; + } + case 9: { + message.source = reader.int32(); + break; + } + case 10: { + if (!(message.inputTypes && message.inputTypes.length)) + message.inputTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.inputTypes.push(reader.int32()); + } else + message.inputTypes.push(reader.int32()); + break; + } + case 11: { + message.entryAgent = reader.string(); + break; + } + case 12: { + message.deployment = reader.string(); + break; + } + case 13: { + message.appVersion = reader.string(); + break; + } + case 14: { + message.languageCode = reader.string(); + break; + } + case 2: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.ces.v1.Message.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Conversation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Conversation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Conversation} Conversation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Conversation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Conversation message. + * @function verify + * @memberof google.cloud.ces.v1.Conversation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Conversation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string 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.turns != null && message.hasOwnProperty("turns")) { + if (!Array.isArray(message.turns)) + return "turns: array expected"; + for (var i = 0; i < message.turns.length; ++i) { + var error = $root.google.cloud.ces.v1.Conversation.Turn.verify(message.turns[i]); + if (error) + return "turns." + error; + } + } + if (message.turnCount != null && message.hasOwnProperty("turnCount")) + if (!$util.isInteger(message.turnCount)) + return "turnCount: integer expected"; + if (message.channelType != null && message.hasOwnProperty("channelType")) + switch (message.channelType) { + default: + return "channelType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.source != null && message.hasOwnProperty("source")) + switch (message.source) { + default: + return "source: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.inputTypes != null && message.hasOwnProperty("inputTypes")) { + if (!Array.isArray(message.inputTypes)) + return "inputTypes: array expected"; + for (var i = 0; i < message.inputTypes.length; ++i) + switch (message.inputTypes[i]) { + default: + return "inputTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + } + if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) + if (!$util.isString(message.entryAgent)) + return "entryAgent: string expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) + if (!$util.isString(message.deployment)) + return "deployment: string expected"; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (!$util.isString(message.appVersion)) + return "appVersion: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.ces.v1.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + return null; + }; + + /** + * Creates a Conversation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Conversation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Conversation} Conversation + */ + Conversation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Conversation) + return object; + var message = new $root.google.cloud.ces.v1.Conversation(); + if (object.name != null) + message.name = String(object.name); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.ces.v1.Conversation.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.ces.v1.Conversation.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.turns) { + if (!Array.isArray(object.turns)) + throw TypeError(".google.cloud.ces.v1.Conversation.turns: array expected"); + message.turns = []; + for (var i = 0; i < object.turns.length; ++i) { + if (typeof object.turns[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Conversation.turns: object expected"); + message.turns[i] = $root.google.cloud.ces.v1.Conversation.Turn.fromObject(object.turns[i]); + } + } + if (object.turnCount != null) + message.turnCount = object.turnCount | 0; + switch (object.channelType) { + default: + if (typeof object.channelType === "number") { + message.channelType = object.channelType; + break; + } + break; + case "CHANNEL_TYPE_UNSPECIFIED": + case 0: + message.channelType = 0; + break; + case "TEXT": + case 1: + message.channelType = 1; + break; + case "AUDIO": + case 2: + message.channelType = 2; + break; + case "MULTIMODAL": + case 3: + message.channelType = 3; + break; + } + switch (object.source) { + default: + if (typeof object.source === "number") { + message.source = object.source; + break; + } + break; + case "SOURCE_UNSPECIFIED": + case 0: + message.source = 0; + break; + case "LIVE": + case 1: + message.source = 1; + break; + case "SIMULATOR": + case 2: + message.source = 2; + break; + case "EVAL": + case 3: + message.source = 3; + break; + } + if (object.inputTypes) { + if (!Array.isArray(object.inputTypes)) + throw TypeError(".google.cloud.ces.v1.Conversation.inputTypes: array expected"); + message.inputTypes = []; + for (var i = 0; i < object.inputTypes.length; ++i) + switch (object.inputTypes[i]) { + default: + if (typeof object.inputTypes[i] === "number") { + message.inputTypes[i] = object.inputTypes[i]; + break; + } + case "INPUT_TYPE_UNSPECIFIED": + case 0: + message.inputTypes[i] = 0; + break; + case "INPUT_TYPE_TEXT": + case 1: + message.inputTypes[i] = 1; + break; + case "INPUT_TYPE_AUDIO": + case 2: + message.inputTypes[i] = 2; + break; + case "INPUT_TYPE_IMAGE": + case 3: + message.inputTypes[i] = 3; + break; + case "INPUT_TYPE_BLOB": + case 4: + message.inputTypes[i] = 4; + break; + case "INPUT_TYPE_TOOL_RESPONSE": + case 5: + message.inputTypes[i] = 5; + break; + case "INPUT_TYPE_VARIABLES": + case 6: + message.inputTypes[i] = 6; + break; + } + } + if (object.entryAgent != null) + message.entryAgent = String(object.entryAgent); + if (object.deployment != null) + message.deployment = String(object.deployment); + if (object.appVersion != null) + message.appVersion = String(object.appVersion); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.ces.v1.Conversation.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Conversation.messages: object expected"); + message.messages[i] = $root.google.cloud.ces.v1.Message.fromObject(object.messages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Conversation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Conversation + * @static + * @param {google.cloud.ces.v1.Conversation} message Conversation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Conversation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.messages = []; + object.turns = []; + object.inputTypes = []; + } + if (options.defaults) { + object.name = ""; + object.startTime = null; + object.endTime = null; + object.turnCount = 0; + object.channelType = options.enums === String ? "CHANNEL_TYPE_UNSPECIFIED" : 0; + object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; + object.entryAgent = ""; + object.deployment = ""; + object.appVersion = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.ces.v1.Message.toObject(message.messages[j], options); + } + 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.turns && message.turns.length) { + object.turns = []; + for (var j = 0; j < message.turns.length; ++j) + object.turns[j] = $root.google.cloud.ces.v1.Conversation.Turn.toObject(message.turns[j], options); + } + if (message.turnCount != null && message.hasOwnProperty("turnCount")) + object.turnCount = message.turnCount; + if (message.channelType != null && message.hasOwnProperty("channelType")) + object.channelType = options.enums === String ? $root.google.cloud.ces.v1.Conversation.ChannelType[message.channelType] === undefined ? message.channelType : $root.google.cloud.ces.v1.Conversation.ChannelType[message.channelType] : message.channelType; + if (message.source != null && message.hasOwnProperty("source")) + object.source = options.enums === String ? $root.google.cloud.ces.v1.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1.Conversation.Source[message.source] : message.source; + if (message.inputTypes && message.inputTypes.length) { + object.inputTypes = []; + for (var j = 0; j < message.inputTypes.length; ++j) + object.inputTypes[j] = options.enums === String ? $root.google.cloud.ces.v1.Conversation.InputType[message.inputTypes[j]] === undefined ? message.inputTypes[j] : $root.google.cloud.ces.v1.Conversation.InputType[message.inputTypes[j]] : message.inputTypes[j]; + } + if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) + object.entryAgent = message.entryAgent; + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = message.deployment; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + object.appVersion = message.appVersion; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this Conversation to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Conversation + * @instance + * @returns {Object.} JSON object + */ + Conversation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Conversation + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Conversation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Conversation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Conversation"; + }; + + Conversation.Turn = (function() { + + /** + * Properties of a Turn. + * @memberof google.cloud.ces.v1.Conversation + * @interface ITurn + * @property {Array.|null} [messages] Turn messages + * @property {google.cloud.ces.v1.ISpan|null} [rootSpan] Turn rootSpan + */ + + /** + * Constructs a new Turn. + * @memberof google.cloud.ces.v1.Conversation + * @classdesc Represents a Turn. + * @implements ITurn + * @constructor + * @param {google.cloud.ces.v1.Conversation.ITurn=} [properties] Properties to set + */ + function Turn(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Turn messages. + * @member {Array.} messages + * @memberof google.cloud.ces.v1.Conversation.Turn + * @instance + */ + Turn.prototype.messages = $util.emptyArray; + + /** + * Turn rootSpan. + * @member {google.cloud.ces.v1.ISpan|null|undefined} rootSpan + * @memberof google.cloud.ces.v1.Conversation.Turn + * @instance + */ + Turn.prototype.rootSpan = null; + + /** + * Creates a new Turn instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Conversation.Turn + * @static + * @param {google.cloud.ces.v1.Conversation.ITurn=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Conversation.Turn} Turn instance + */ + Turn.create = function create(properties) { + return new Turn(properties); + }; + + /** + * Encodes the specified Turn message. Does not implicitly {@link google.cloud.ces.v1.Conversation.Turn.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Conversation.Turn + * @static + * @param {google.cloud.ces.v1.Conversation.ITurn} message Turn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Turn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.ces.v1.Message.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rootSpan != null && Object.hasOwnProperty.call(message, "rootSpan")) + $root.google.cloud.ces.v1.Span.encode(message.rootSpan, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Turn message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Conversation.Turn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Conversation.Turn + * @static + * @param {google.cloud.ces.v1.Conversation.ITurn} message Turn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Turn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Turn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Conversation.Turn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Conversation.Turn} Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Turn.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Conversation.Turn(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.ces.v1.Message.decode(reader, reader.uint32())); + break; + } + case 2: { + message.rootSpan = $root.google.cloud.ces.v1.Span.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Turn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Conversation.Turn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Conversation.Turn} Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Turn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Turn message. + * @function verify + * @memberof google.cloud.ces.v1.Conversation.Turn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Turn.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.ces.v1.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) { + var error = $root.google.cloud.ces.v1.Span.verify(message.rootSpan); + if (error) + return "rootSpan." + error; + } + return null; + }; + + /** + * Creates a Turn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Conversation.Turn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Conversation.Turn} Turn + */ + Turn.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Conversation.Turn) + return object; + var message = new $root.google.cloud.ces.v1.Conversation.Turn(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.ces.v1.Conversation.Turn.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Conversation.Turn.messages: object expected"); + message.messages[i] = $root.google.cloud.ces.v1.Message.fromObject(object.messages[i]); + } + } + if (object.rootSpan != null) { + if (typeof object.rootSpan !== "object") + throw TypeError(".google.cloud.ces.v1.Conversation.Turn.rootSpan: object expected"); + message.rootSpan = $root.google.cloud.ces.v1.Span.fromObject(object.rootSpan); + } + return message; + }; + + /** + * Creates a plain object from a Turn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Conversation.Turn + * @static + * @param {google.cloud.ces.v1.Conversation.Turn} message Turn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Turn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) + object.rootSpan = null; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.ces.v1.Message.toObject(message.messages[j], options); + } + if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) + object.rootSpan = $root.google.cloud.ces.v1.Span.toObject(message.rootSpan, options); + return object; + }; + + /** + * Converts this Turn to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Conversation.Turn + * @instance + * @returns {Object.} JSON object + */ + Turn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Turn + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Conversation.Turn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Turn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Conversation.Turn"; + }; + + return Turn; + })(); + + /** + * ChannelType enum. + * @name google.cloud.ces.v1.Conversation.ChannelType + * @enum {number} + * @property {number} CHANNEL_TYPE_UNSPECIFIED=0 CHANNEL_TYPE_UNSPECIFIED value + * @property {number} TEXT=1 TEXT value + * @property {number} AUDIO=2 AUDIO value + * @property {number} MULTIMODAL=3 MULTIMODAL value + */ + Conversation.ChannelType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CHANNEL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "AUDIO"] = 2; + values[valuesById[3] = "MULTIMODAL"] = 3; + return values; + })(); + + /** + * Source enum. + * @name google.cloud.ces.v1.Conversation.Source + * @enum {number} + * @property {number} SOURCE_UNSPECIFIED=0 SOURCE_UNSPECIFIED value + * @property {number} LIVE=1 LIVE value + * @property {number} SIMULATOR=2 SIMULATOR value + * @property {number} EVAL=3 EVAL value + */ + Conversation.Source = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SOURCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LIVE"] = 1; + values[valuesById[2] = "SIMULATOR"] = 2; + values[valuesById[3] = "EVAL"] = 3; + return values; + })(); + + /** + * InputType enum. + * @name google.cloud.ces.v1.Conversation.InputType + * @enum {number} + * @property {number} INPUT_TYPE_UNSPECIFIED=0 INPUT_TYPE_UNSPECIFIED value + * @property {number} INPUT_TYPE_TEXT=1 INPUT_TYPE_TEXT value + * @property {number} INPUT_TYPE_AUDIO=2 INPUT_TYPE_AUDIO value + * @property {number} INPUT_TYPE_IMAGE=3 INPUT_TYPE_IMAGE value + * @property {number} INPUT_TYPE_BLOB=4 INPUT_TYPE_BLOB value + * @property {number} INPUT_TYPE_TOOL_RESPONSE=5 INPUT_TYPE_TOOL_RESPONSE value + * @property {number} INPUT_TYPE_VARIABLES=6 INPUT_TYPE_VARIABLES value + */ + Conversation.InputType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INPUT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INPUT_TYPE_TEXT"] = 1; + values[valuesById[2] = "INPUT_TYPE_AUDIO"] = 2; + values[valuesById[3] = "INPUT_TYPE_IMAGE"] = 3; + values[valuesById[4] = "INPUT_TYPE_BLOB"] = 4; + values[valuesById[5] = "INPUT_TYPE_TOOL_RESPONSE"] = 5; + values[valuesById[6] = "INPUT_TYPE_VARIABLES"] = 6; + return values; + })(); + + return Conversation; + })(); + + v1.Deployment = (function() { + + /** + * Properties of a Deployment. + * @memberof google.cloud.ces.v1 + * @interface IDeployment + * @property {string|null} [name] Deployment name + * @property {string|null} [displayName] Deployment displayName + * @property {string|null} [appVersion] Deployment appVersion + * @property {google.cloud.ces.v1.IChannelProfile|null} [channelProfile] Deployment channelProfile + * @property {google.protobuf.ITimestamp|null} [createTime] Deployment createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Deployment updateTime + * @property {string|null} [etag] Deployment etag + */ + + /** + * Constructs a new Deployment. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a Deployment. + * @implements IDeployment + * @constructor + * @param {google.cloud.ces.v1.IDeployment=} [properties] Properties to set + */ + function Deployment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Deployment name. + * @member {string} name + * @memberof google.cloud.ces.v1.Deployment + * @instance + */ + Deployment.prototype.name = ""; + + /** + * Deployment displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1.Deployment + * @instance + */ + Deployment.prototype.displayName = ""; + + /** + * Deployment appVersion. + * @member {string} appVersion + * @memberof google.cloud.ces.v1.Deployment + * @instance + */ + Deployment.prototype.appVersion = ""; + + /** + * Deployment channelProfile. + * @member {google.cloud.ces.v1.IChannelProfile|null|undefined} channelProfile + * @memberof google.cloud.ces.v1.Deployment + * @instance + */ + Deployment.prototype.channelProfile = null; + + /** + * Deployment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1.Deployment + * @instance + */ + Deployment.prototype.createTime = null; + + /** + * Deployment updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1.Deployment + * @instance + */ + Deployment.prototype.updateTime = null; + + /** + * Deployment etag. + * @member {string} etag + * @memberof google.cloud.ces.v1.Deployment + * @instance + */ + Deployment.prototype.etag = ""; + + /** + * Creates a new Deployment instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Deployment + * @static + * @param {google.cloud.ces.v1.IDeployment=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Deployment} Deployment instance + */ + Deployment.create = function create(properties) { + return new Deployment(properties); + }; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.ces.v1.Deployment.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Deployment + * @static + * @param {google.cloud.ces.v1.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appVersion); + if (message.channelProfile != null && Object.hasOwnProperty.call(message, "channelProfile")) + $root.google.cloud.ces.v1.ChannelProfile.encode(message.channelProfile, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + 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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Deployment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Deployment + * @static + * @param {google.cloud.ces.v1.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Deployment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 8: { + message.displayName = reader.string(); + break; + } + case 2: { + message.appVersion = reader.string(); + break; + } + case 3: { + message.channelProfile = $root.google.cloud.ces.v1.ChannelProfile.decode(reader, reader.uint32()); + 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 7: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Deployment message. + * @function verify + * @memberof google.cloud.ces.v1.Deployment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Deployment.verify = function verify(message) { + if (typeof message !== "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.appVersion != null && message.hasOwnProperty("appVersion")) + if (!$util.isString(message.appVersion)) + return "appVersion: string expected"; + if (message.channelProfile != null && message.hasOwnProperty("channelProfile")) { + var error = $root.google.cloud.ces.v1.ChannelProfile.verify(message.channelProfile); + if (error) + return "channelProfile." + error; + } + 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Deployment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Deployment} Deployment + */ + Deployment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Deployment) + return object; + var message = new $root.google.cloud.ces.v1.Deployment(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.appVersion != null) + message.appVersion = String(object.appVersion); + if (object.channelProfile != null) { + if (typeof object.channelProfile !== "object") + throw TypeError(".google.cloud.ces.v1.Deployment.channelProfile: object expected"); + message.channelProfile = $root.google.cloud.ces.v1.ChannelProfile.fromObject(object.channelProfile); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1.Deployment.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.ces.v1.Deployment.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Deployment + * @static + * @param {google.cloud.ces.v1.Deployment} message Deployment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Deployment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.appVersion = ""; + object.channelProfile = null; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + object.appVersion = message.appVersion; + if (message.channelProfile != null && message.hasOwnProperty("channelProfile")) + object.channelProfile = $root.google.cloud.ces.v1.ChannelProfile.toObject(message.channelProfile, options); + 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this Deployment to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Deployment + * @instance + * @returns {Object.} JSON object + */ + Deployment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Deployment + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Deployment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Deployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Deployment"; + }; + + return Deployment; + })(); + + v1.Omnichannel = (function() { + + /** + * Properties of an Omnichannel. + * @memberof google.cloud.ces.v1 + * @interface IOmnichannel + * @property {string|null} [name] Omnichannel name + * @property {string|null} [displayName] Omnichannel displayName + * @property {string|null} [description] Omnichannel description + * @property {google.protobuf.ITimestamp|null} [createTime] Omnichannel createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Omnichannel updateTime + * @property {string|null} [etag] Omnichannel etag + * @property {google.cloud.ces.v1.IOmnichannelIntegrationConfig|null} [integrationConfig] Omnichannel integrationConfig + */ + + /** + * Constructs a new Omnichannel. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an Omnichannel. + * @implements IOmnichannel + * @constructor + * @param {google.cloud.ces.v1.IOmnichannel=} [properties] Properties to set + */ + function Omnichannel(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Omnichannel name. + * @member {string} name + * @memberof google.cloud.ces.v1.Omnichannel + * @instance + */ + Omnichannel.prototype.name = ""; + + /** + * Omnichannel displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1.Omnichannel + * @instance + */ + Omnichannel.prototype.displayName = ""; + + /** + * Omnichannel description. + * @member {string} description + * @memberof google.cloud.ces.v1.Omnichannel + * @instance + */ + Omnichannel.prototype.description = ""; + + /** + * Omnichannel createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1.Omnichannel + * @instance + */ + Omnichannel.prototype.createTime = null; + + /** + * Omnichannel updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1.Omnichannel + * @instance + */ + Omnichannel.prototype.updateTime = null; + + /** + * Omnichannel etag. + * @member {string} etag + * @memberof google.cloud.ces.v1.Omnichannel + * @instance + */ + Omnichannel.prototype.etag = ""; + + /** + * Omnichannel integrationConfig. + * @member {google.cloud.ces.v1.IOmnichannelIntegrationConfig|null|undefined} integrationConfig + * @memberof google.cloud.ces.v1.Omnichannel + * @instance + */ + Omnichannel.prototype.integrationConfig = null; + + /** + * Creates a new Omnichannel instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Omnichannel + * @static + * @param {google.cloud.ces.v1.IOmnichannel=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Omnichannel} Omnichannel instance + */ + Omnichannel.create = function create(properties) { + return new Omnichannel(properties); + }; + + /** + * Encodes the specified Omnichannel message. Does not implicitly {@link google.cloud.ces.v1.Omnichannel.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Omnichannel + * @static + * @param {google.cloud.ces.v1.IOmnichannel} message Omnichannel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Omnichannel.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + 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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + if (message.integrationConfig != null && Object.hasOwnProperty.call(message, "integrationConfig")) + $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.encode(message.integrationConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Omnichannel message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Omnichannel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Omnichannel + * @static + * @param {google.cloud.ces.v1.IOmnichannel} message Omnichannel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Omnichannel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Omnichannel message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Omnichannel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Omnichannel} Omnichannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Omnichannel.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Omnichannel(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = 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.etag = reader.string(); + break; + } + case 7: { + message.integrationConfig = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Omnichannel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Omnichannel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Omnichannel} Omnichannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Omnichannel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Omnichannel message. + * @function verify + * @memberof google.cloud.ces.v1.Omnichannel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Omnichannel.verify = function verify(message) { + if (typeof message !== "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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.integrationConfig != null && message.hasOwnProperty("integrationConfig")) { + var error = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.verify(message.integrationConfig); + if (error) + return "integrationConfig." + error; + } + return null; + }; + + /** + * Creates an Omnichannel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Omnichannel + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Omnichannel} Omnichannel + */ + Omnichannel.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Omnichannel) + return object; + var message = new $root.google.cloud.ces.v1.Omnichannel(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1.Omnichannel.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.ces.v1.Omnichannel.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.integrationConfig != null) { + if (typeof object.integrationConfig !== "object") + throw TypeError(".google.cloud.ces.v1.Omnichannel.integrationConfig: object expected"); + message.integrationConfig = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.fromObject(object.integrationConfig); + } + return message; + }; + + /** + * Creates a plain object from an Omnichannel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Omnichannel + * @static + * @param {google.cloud.ces.v1.Omnichannel} message Omnichannel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Omnichannel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.integrationConfig = 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.integrationConfig != null && message.hasOwnProperty("integrationConfig")) + object.integrationConfig = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.toObject(message.integrationConfig, options); + return object; + }; + + /** + * Converts this Omnichannel to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Omnichannel + * @instance + * @returns {Object.} JSON object + */ + Omnichannel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Omnichannel + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Omnichannel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Omnichannel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Omnichannel"; + }; + + return Omnichannel; + })(); + + v1.OmnichannelIntegrationConfig = (function() { + + /** + * Properties of an OmnichannelIntegrationConfig. + * @memberof google.cloud.ces.v1 + * @interface IOmnichannelIntegrationConfig + * @property {Object.|null} [channelConfigs] OmnichannelIntegrationConfig channelConfigs + * @property {Object.|null} [subscriberConfigs] OmnichannelIntegrationConfig subscriberConfigs + * @property {Object.|null} [routingConfigs] OmnichannelIntegrationConfig routingConfigs + */ + + /** + * Constructs a new OmnichannelIntegrationConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an OmnichannelIntegrationConfig. + * @implements IOmnichannelIntegrationConfig + * @constructor + * @param {google.cloud.ces.v1.IOmnichannelIntegrationConfig=} [properties] Properties to set + */ + function OmnichannelIntegrationConfig(properties) { + this.channelConfigs = {}; + this.subscriberConfigs = {}; + this.routingConfigs = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OmnichannelIntegrationConfig channelConfigs. + * @member {Object.} channelConfigs + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @instance + */ + OmnichannelIntegrationConfig.prototype.channelConfigs = $util.emptyObject; + + /** + * OmnichannelIntegrationConfig subscriberConfigs. + * @member {Object.} subscriberConfigs + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @instance + */ + OmnichannelIntegrationConfig.prototype.subscriberConfigs = $util.emptyObject; + + /** + * OmnichannelIntegrationConfig routingConfigs. + * @member {Object.} routingConfigs + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @instance + */ + OmnichannelIntegrationConfig.prototype.routingConfigs = $util.emptyObject; + + /** + * Creates a new OmnichannelIntegrationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @static + * @param {google.cloud.ces.v1.IOmnichannelIntegrationConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig instance + */ + OmnichannelIntegrationConfig.create = function create(properties) { + return new OmnichannelIntegrationConfig(properties); + }; + + /** + * Encodes the specified OmnichannelIntegrationConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @static + * @param {google.cloud.ces.v1.IOmnichannelIntegrationConfig} message OmnichannelIntegrationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OmnichannelIntegrationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channelConfigs != null && Object.hasOwnProperty.call(message, "channelConfigs")) + for (var keys = Object.keys(message.channelConfigs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.encode(message.channelConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.subscriberConfigs != null && Object.hasOwnProperty.call(message, "subscriberConfigs")) + for (var keys = Object.keys(message.subscriberConfigs), 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.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.encode(message.subscriberConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.routingConfigs != null && Object.hasOwnProperty.call(message, "routingConfigs")) + for (var keys = Object.keys(message.routingConfigs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig.encode(message.routingConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified OmnichannelIntegrationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @static + * @param {google.cloud.ces.v1.IOmnichannelIntegrationConfig} message OmnichannelIntegrationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OmnichannelIntegrationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OmnichannelIntegrationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.channelConfigs === $util.emptyObject) + message.channelConfigs = {}; + 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.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.channelConfigs[key] = value; + break; + } + case 2: { + if (message.subscriberConfigs === $util.emptyObject) + message.subscriberConfigs = {}; + 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.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.subscriberConfigs[key] = value; + break; + } + case 3: { + if (message.routingConfigs === $util.emptyObject) + message.routingConfigs = {}; + 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.ces.v1.OmnichannelIntegrationConfig.RoutingConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.routingConfigs[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OmnichannelIntegrationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OmnichannelIntegrationConfig message. + * @function verify + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OmnichannelIntegrationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channelConfigs != null && message.hasOwnProperty("channelConfigs")) { + if (!$util.isObject(message.channelConfigs)) + return "channelConfigs: object expected"; + var key = Object.keys(message.channelConfigs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.verify(message.channelConfigs[key[i]]); + if (error) + return "channelConfigs." + error; + } + } + if (message.subscriberConfigs != null && message.hasOwnProperty("subscriberConfigs")) { + if (!$util.isObject(message.subscriberConfigs)) + return "subscriberConfigs: object expected"; + var key = Object.keys(message.subscriberConfigs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.verify(message.subscriberConfigs[key[i]]); + if (error) + return "subscriberConfigs." + error; + } + } + if (message.routingConfigs != null && message.hasOwnProperty("routingConfigs")) { + if (!$util.isObject(message.routingConfigs)) + return "routingConfigs: object expected"; + var key = Object.keys(message.routingConfigs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig.verify(message.routingConfigs[key[i]]); + if (error) + return "routingConfigs." + error; + } + } + return null; + }; + + /** + * Creates an OmnichannelIntegrationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig + */ + OmnichannelIntegrationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.OmnichannelIntegrationConfig) + return object; + var message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig(); + if (object.channelConfigs) { + if (typeof object.channelConfigs !== "object") + throw TypeError(".google.cloud.ces.v1.OmnichannelIntegrationConfig.channelConfigs: object expected"); + message.channelConfigs = {}; + for (var keys = Object.keys(object.channelConfigs), i = 0; i < keys.length; ++i) { + if (typeof object.channelConfigs[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1.OmnichannelIntegrationConfig.channelConfigs: object expected"); + message.channelConfigs[keys[i]] = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.fromObject(object.channelConfigs[keys[i]]); + } + } + if (object.subscriberConfigs) { + if (typeof object.subscriberConfigs !== "object") + throw TypeError(".google.cloud.ces.v1.OmnichannelIntegrationConfig.subscriberConfigs: object expected"); + message.subscriberConfigs = {}; + for (var keys = Object.keys(object.subscriberConfigs), i = 0; i < keys.length; ++i) { + if (typeof object.subscriberConfigs[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1.OmnichannelIntegrationConfig.subscriberConfigs: object expected"); + message.subscriberConfigs[keys[i]] = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.fromObject(object.subscriberConfigs[keys[i]]); + } + } + if (object.routingConfigs) { + if (typeof object.routingConfigs !== "object") + throw TypeError(".google.cloud.ces.v1.OmnichannelIntegrationConfig.routingConfigs: object expected"); + message.routingConfigs = {}; + for (var keys = Object.keys(object.routingConfigs), i = 0; i < keys.length; ++i) { + if (typeof object.routingConfigs[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1.OmnichannelIntegrationConfig.routingConfigs: object expected"); + message.routingConfigs[keys[i]] = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig.fromObject(object.routingConfigs[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an OmnichannelIntegrationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig} message OmnichannelIntegrationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OmnichannelIntegrationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.channelConfigs = {}; + object.subscriberConfigs = {}; + object.routingConfigs = {}; + } + var keys2; + if (message.channelConfigs && (keys2 = Object.keys(message.channelConfigs)).length) { + object.channelConfigs = {}; + for (var j = 0; j < keys2.length; ++j) + object.channelConfigs[keys2[j]] = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.toObject(message.channelConfigs[keys2[j]], options); + } + if (message.subscriberConfigs && (keys2 = Object.keys(message.subscriberConfigs)).length) { + object.subscriberConfigs = {}; + for (var j = 0; j < keys2.length; ++j) + object.subscriberConfigs[keys2[j]] = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.toObject(message.subscriberConfigs[keys2[j]], options); + } + if (message.routingConfigs && (keys2 = Object.keys(message.routingConfigs)).length) { + object.routingConfigs = {}; + for (var j = 0; j < keys2.length; ++j) + object.routingConfigs[keys2[j]] = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig.toObject(message.routingConfigs[keys2[j]], options); + } + return object; + }; + + /** + * Converts this OmnichannelIntegrationConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @instance + * @returns {Object.} JSON object + */ + OmnichannelIntegrationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OmnichannelIntegrationConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OmnichannelIntegrationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.OmnichannelIntegrationConfig"; + }; + + OmnichannelIntegrationConfig.ChannelConfig = (function() { + + /** + * Properties of a ChannelConfig. + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @interface IChannelConfig + * @property {google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig|null} [whatsappConfig] ChannelConfig whatsappConfig + */ + + /** + * Constructs a new ChannelConfig. + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @classdesc Represents a ChannelConfig. + * @implements IChannelConfig + * @constructor + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig=} [properties] Properties to set + */ + function ChannelConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChannelConfig whatsappConfig. + * @member {google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig|null|undefined} whatsappConfig + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig + * @instance + */ + ChannelConfig.prototype.whatsappConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ChannelConfig channelConfig. + * @member {"whatsappConfig"|undefined} channelConfig + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig + * @instance + */ + Object.defineProperty(ChannelConfig.prototype, "channelConfig", { + get: $util.oneOfGetter($oneOfFields = ["whatsappConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ChannelConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig instance + */ + ChannelConfig.create = function create(properties) { + return new ChannelConfig(properties); + }; + + /** + * Encodes the specified ChannelConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig} message ChannelConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.whatsappConfig != null && Object.hasOwnProperty.call(message, "whatsappConfig")) + $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig.encode(message.whatsappConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ChannelConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig} message ChannelConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChannelConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.whatsappConfig = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChannelConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChannelConfig message. + * @function verify + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChannelConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.whatsappConfig != null && message.hasOwnProperty("whatsappConfig")) { + properties.channelConfig = 1; + { + var error = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig.verify(message.whatsappConfig); + if (error) + return "whatsappConfig." + error; + } + } + return null; + }; + + /** + * Creates a ChannelConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig + */ + ChannelConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig) + return object; + var message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig(); + if (object.whatsappConfig != null) { + if (typeof object.whatsappConfig !== "object") + throw TypeError(".google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.whatsappConfig: object expected"); + message.whatsappConfig = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig.fromObject(object.whatsappConfig); + } + return message; + }; + + /** + * Creates a plain object from a ChannelConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig} message ChannelConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChannelConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.whatsappConfig != null && message.hasOwnProperty("whatsappConfig")) { + object.whatsappConfig = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig.toObject(message.whatsappConfig, options); + if (options.oneofs) + object.channelConfig = "whatsappConfig"; + } + return object; + }; + + /** + * Converts this ChannelConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig + * @instance + * @returns {Object.} JSON object + */ + ChannelConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChannelConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChannelConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig"; + }; + + return ChannelConfig; + })(); + + OmnichannelIntegrationConfig.WhatsappConfig = (function() { + + /** + * Properties of a WhatsappConfig. + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @interface IWhatsappConfig + * @property {string|null} [phoneNumberId] WhatsappConfig phoneNumberId + * @property {string|null} [phoneNumber] WhatsappConfig phoneNumber + * @property {string|null} [whatsappBusinessAccountId] WhatsappConfig whatsappBusinessAccountId + * @property {string|null} [webhookVerifyToken] WhatsappConfig webhookVerifyToken + * @property {string|null} [whatsappBusinessToken] WhatsappConfig whatsappBusinessToken + * @property {string|null} [metaBusinessPortfolioId] WhatsappConfig metaBusinessPortfolioId + */ + + /** + * Constructs a new WhatsappConfig. + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @classdesc Represents a WhatsappConfig. + * @implements IWhatsappConfig + * @constructor + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig=} [properties] Properties to set + */ + function WhatsappConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WhatsappConfig phoneNumberId. + * @member {string} phoneNumberId + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + */ + WhatsappConfig.prototype.phoneNumberId = ""; + + /** + * WhatsappConfig phoneNumber. + * @member {string} phoneNumber + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + */ + WhatsappConfig.prototype.phoneNumber = ""; + + /** + * WhatsappConfig whatsappBusinessAccountId. + * @member {string} whatsappBusinessAccountId + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + */ + WhatsappConfig.prototype.whatsappBusinessAccountId = ""; + + /** + * WhatsappConfig webhookVerifyToken. + * @member {string} webhookVerifyToken + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + */ + WhatsappConfig.prototype.webhookVerifyToken = ""; + + /** + * WhatsappConfig whatsappBusinessToken. + * @member {string} whatsappBusinessToken + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + */ + WhatsappConfig.prototype.whatsappBusinessToken = ""; + + /** + * WhatsappConfig metaBusinessPortfolioId. + * @member {string} metaBusinessPortfolioId + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + */ + WhatsappConfig.prototype.metaBusinessPortfolioId = ""; + + /** + * Creates a new WhatsappConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig instance + */ + WhatsappConfig.create = function create(properties) { + return new WhatsappConfig(properties); + }; + + /** + * Encodes the specified WhatsappConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig} message WhatsappConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WhatsappConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phoneNumberId != null && Object.hasOwnProperty.call(message, "phoneNumberId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.phoneNumberId); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.phoneNumber); + if (message.whatsappBusinessAccountId != null && Object.hasOwnProperty.call(message, "whatsappBusinessAccountId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.whatsappBusinessAccountId); + if (message.webhookVerifyToken != null && Object.hasOwnProperty.call(message, "webhookVerifyToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.webhookVerifyToken); + if (message.whatsappBusinessToken != null && Object.hasOwnProperty.call(message, "whatsappBusinessToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.whatsappBusinessToken); + if (message.metaBusinessPortfolioId != null && Object.hasOwnProperty.call(message, "metaBusinessPortfolioId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.metaBusinessPortfolioId); + return writer; + }; + + /** + * Encodes the specified WhatsappConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig} message WhatsappConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WhatsappConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WhatsappConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WhatsappConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.phoneNumberId = reader.string(); + break; + } + case 2: { + message.phoneNumber = reader.string(); + break; + } + case 3: { + message.whatsappBusinessAccountId = reader.string(); + break; + } + case 4: { + message.webhookVerifyToken = reader.string(); + break; + } + case 5: { + message.whatsappBusinessToken = reader.string(); + break; + } + case 6: { + message.metaBusinessPortfolioId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WhatsappConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WhatsappConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WhatsappConfig message. + * @function verify + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WhatsappConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phoneNumberId != null && message.hasOwnProperty("phoneNumberId")) + if (!$util.isString(message.phoneNumberId)) + return "phoneNumberId: string expected"; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + if (!$util.isString(message.phoneNumber)) + return "phoneNumber: string expected"; + if (message.whatsappBusinessAccountId != null && message.hasOwnProperty("whatsappBusinessAccountId")) + if (!$util.isString(message.whatsappBusinessAccountId)) + return "whatsappBusinessAccountId: string expected"; + if (message.webhookVerifyToken != null && message.hasOwnProperty("webhookVerifyToken")) + if (!$util.isString(message.webhookVerifyToken)) + return "webhookVerifyToken: string expected"; + if (message.whatsappBusinessToken != null && message.hasOwnProperty("whatsappBusinessToken")) + if (!$util.isString(message.whatsappBusinessToken)) + return "whatsappBusinessToken: string expected"; + if (message.metaBusinessPortfolioId != null && message.hasOwnProperty("metaBusinessPortfolioId")) + if (!$util.isString(message.metaBusinessPortfolioId)) + return "metaBusinessPortfolioId: string expected"; + return null; + }; + + /** + * Creates a WhatsappConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig + */ + WhatsappConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig) + return object; + var message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig(); + if (object.phoneNumberId != null) + message.phoneNumberId = String(object.phoneNumberId); + if (object.phoneNumber != null) + message.phoneNumber = String(object.phoneNumber); + if (object.whatsappBusinessAccountId != null) + message.whatsappBusinessAccountId = String(object.whatsappBusinessAccountId); + if (object.webhookVerifyToken != null) + message.webhookVerifyToken = String(object.webhookVerifyToken); + if (object.whatsappBusinessToken != null) + message.whatsappBusinessToken = String(object.whatsappBusinessToken); + if (object.metaBusinessPortfolioId != null) + message.metaBusinessPortfolioId = String(object.metaBusinessPortfolioId); + return message; + }; + + /** + * Creates a plain object from a WhatsappConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig} message WhatsappConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WhatsappConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.phoneNumberId = ""; + object.phoneNumber = ""; + object.whatsappBusinessAccountId = ""; + object.webhookVerifyToken = ""; + object.whatsappBusinessToken = ""; + object.metaBusinessPortfolioId = ""; + } + if (message.phoneNumberId != null && message.hasOwnProperty("phoneNumberId")) + object.phoneNumberId = message.phoneNumberId; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + object.phoneNumber = message.phoneNumber; + if (message.whatsappBusinessAccountId != null && message.hasOwnProperty("whatsappBusinessAccountId")) + object.whatsappBusinessAccountId = message.whatsappBusinessAccountId; + if (message.webhookVerifyToken != null && message.hasOwnProperty("webhookVerifyToken")) + object.webhookVerifyToken = message.webhookVerifyToken; + if (message.whatsappBusinessToken != null && message.hasOwnProperty("whatsappBusinessToken")) + object.whatsappBusinessToken = message.whatsappBusinessToken; + if (message.metaBusinessPortfolioId != null && message.hasOwnProperty("metaBusinessPortfolioId")) + object.metaBusinessPortfolioId = message.metaBusinessPortfolioId; + return object; + }; + + /** + * Converts this WhatsappConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + * @returns {Object.} JSON object + */ + WhatsappConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WhatsappConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WhatsappConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig"; + }; + + return WhatsappConfig; + })(); + + OmnichannelIntegrationConfig.SubscriberConfig = (function() { + + /** + * Properties of a SubscriberConfig. + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @interface ISubscriberConfig + * @property {google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig|null} [cesAppConfig] SubscriberConfig cesAppConfig + */ + + /** + * Constructs a new SubscriberConfig. + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @classdesc Represents a SubscriberConfig. + * @implements ISubscriberConfig + * @constructor + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig=} [properties] Properties to set + */ + function SubscriberConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubscriberConfig cesAppConfig. + * @member {google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig|null|undefined} cesAppConfig + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig + * @instance + */ + SubscriberConfig.prototype.cesAppConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubscriberConfig subscriberConfig. + * @member {"cesAppConfig"|undefined} subscriberConfig + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig + * @instance + */ + Object.defineProperty(SubscriberConfig.prototype, "subscriberConfig", { + get: $util.oneOfGetter($oneOfFields = ["cesAppConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubscriberConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig instance + */ + SubscriberConfig.create = function create(properties) { + return new SubscriberConfig(properties); + }; + + /** + * Encodes the specified SubscriberConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig} message SubscriberConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscriberConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cesAppConfig != null && Object.hasOwnProperty.call(message, "cesAppConfig")) + $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig.encode(message.cesAppConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubscriberConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig} message SubscriberConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscriberConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscriberConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscriberConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cesAppConfig = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubscriberConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscriberConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscriberConfig message. + * @function verify + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscriberConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cesAppConfig != null && message.hasOwnProperty("cesAppConfig")) { + properties.subscriberConfig = 1; + { + var error = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig.verify(message.cesAppConfig); + if (error) + return "cesAppConfig." + error; + } + } + return null; + }; + + /** + * Creates a SubscriberConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig + */ + SubscriberConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig) + return object; + var message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig(); + if (object.cesAppConfig != null) { + if (typeof object.cesAppConfig !== "object") + throw TypeError(".google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.cesAppConfig: object expected"); + message.cesAppConfig = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig.fromObject(object.cesAppConfig); + } + return message; + }; + + /** + * Creates a plain object from a SubscriberConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig} message SubscriberConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscriberConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.cesAppConfig != null && message.hasOwnProperty("cesAppConfig")) { + object.cesAppConfig = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig.toObject(message.cesAppConfig, options); + if (options.oneofs) + object.subscriberConfig = "cesAppConfig"; + } + return object; + }; + + /** + * Converts this SubscriberConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig + * @instance + * @returns {Object.} JSON object + */ + SubscriberConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubscriberConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubscriberConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig"; + }; + + return SubscriberConfig; + })(); + + OmnichannelIntegrationConfig.CesAppConfig = (function() { + + /** + * Properties of a CesAppConfig. + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @interface ICesAppConfig + * @property {string|null} [app] CesAppConfig app + */ + + /** + * Constructs a new CesAppConfig. + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @classdesc Represents a CesAppConfig. + * @implements ICesAppConfig + * @constructor + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig=} [properties] Properties to set + */ + function CesAppConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CesAppConfig app. + * @member {string} app + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig + * @instance + */ + CesAppConfig.prototype.app = ""; + + /** + * Creates a new CesAppConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig instance + */ + CesAppConfig.create = function create(properties) { + return new CesAppConfig(properties); + }; + + /** + * Encodes the specified CesAppConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig} message CesAppConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CesAppConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.app); + return writer; + }; + + /** + * Encodes the specified CesAppConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig} message CesAppConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CesAppConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CesAppConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CesAppConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.app = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CesAppConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CesAppConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CesAppConfig message. + * @function verify + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CesAppConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.app != null && message.hasOwnProperty("app")) + if (!$util.isString(message.app)) + return "app: string expected"; + return null; + }; + + /** + * Creates a CesAppConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig + */ + CesAppConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig) + return object; + var message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig(); + if (object.app != null) + message.app = String(object.app); + return message; + }; + + /** + * Creates a plain object from a CesAppConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig} message CesAppConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CesAppConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.app = ""; + if (message.app != null && message.hasOwnProperty("app")) + object.app = message.app; + return object; + }; + + /** + * Converts this CesAppConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig + * @instance + * @returns {Object.} JSON object + */ + CesAppConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CesAppConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CesAppConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig"; + }; + + return CesAppConfig; + })(); + + OmnichannelIntegrationConfig.RoutingConfig = (function() { + + /** + * Properties of a RoutingConfig. + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @interface IRoutingConfig + * @property {string|null} [subscriberKey] RoutingConfig subscriberKey + */ + + /** + * Constructs a new RoutingConfig. + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig + * @classdesc Represents a RoutingConfig. + * @implements IRoutingConfig + * @constructor + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig=} [properties] Properties to set + */ + function RoutingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutingConfig subscriberKey. + * @member {string} subscriberKey + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig + * @instance + */ + RoutingConfig.prototype.subscriberKey = ""; + + /** + * Creates a new RoutingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig instance + */ + RoutingConfig.create = function create(properties) { + return new RoutingConfig(properties); + }; + + /** + * Encodes the specified RoutingConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig} message RoutingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscriberKey != null && Object.hasOwnProperty.call(message, "subscriberKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscriberKey); + return writer; + }; + + /** + * Encodes the specified RoutingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig} message RoutingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subscriberKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutingConfig message. + * @function verify + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscriberKey != null && message.hasOwnProperty("subscriberKey")) + if (!$util.isString(message.subscriberKey)) + return "subscriberKey: string expected"; + return null; + }; + + /** + * Creates a RoutingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig + */ + RoutingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig) + return object; + var message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig(); + if (object.subscriberKey != null) + message.subscriberKey = String(object.subscriberKey); + return message; + }; + + /** + * Creates a plain object from a RoutingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig} message RoutingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.subscriberKey = ""; + if (message.subscriberKey != null && message.hasOwnProperty("subscriberKey")) + object.subscriberKey = message.subscriberKey; + return object; + }; + + /** + * Converts this RoutingConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig + * @instance + * @returns {Object.} JSON object + */ + RoutingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutingConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig"; + }; + + return RoutingConfig; + })(); + + return OmnichannelIntegrationConfig; + })(); + + v1.OmnichannelOperationMetadata = (function() { + + /** + * Properties of an OmnichannelOperationMetadata. + * @memberof google.cloud.ces.v1 + * @interface IOmnichannelOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OmnichannelOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OmnichannelOperationMetadata endTime + * @property {string|null} [statusMessage] OmnichannelOperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OmnichannelOperationMetadata requestedCancellation + */ + + /** + * Constructs a new OmnichannelOperationMetadata. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an OmnichannelOperationMetadata. + * @implements IOmnichannelOperationMetadata + * @constructor + * @param {google.cloud.ces.v1.IOmnichannelOperationMetadata=} [properties] Properties to set + */ + function OmnichannelOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OmnichannelOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata + * @instance + */ + OmnichannelOperationMetadata.prototype.createTime = null; + + /** + * OmnichannelOperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata + * @instance + */ + OmnichannelOperationMetadata.prototype.endTime = null; + + /** + * OmnichannelOperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata + * @instance + */ + OmnichannelOperationMetadata.prototype.statusMessage = ""; + + /** + * OmnichannelOperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata + * @instance + */ + OmnichannelOperationMetadata.prototype.requestedCancellation = false; + + /** + * Creates a new OmnichannelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata + * @static + * @param {google.cloud.ces.v1.IOmnichannelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.ces.v1.OmnichannelOperationMetadata} OmnichannelOperationMetadata instance + */ + OmnichannelOperationMetadata.create = function create(properties) { + return new OmnichannelOperationMetadata(properties); + }; + + /** + * Encodes the specified OmnichannelOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata + * @static + * @param {google.cloud.ces.v1.IOmnichannelOperationMetadata} message OmnichannelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OmnichannelOperationMetadata.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.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.requestedCancellation); + return writer; + }; + + /** + * Encodes the specified OmnichannelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata + * @static + * @param {google.cloud.ces.v1.IOmnichannelOperationMetadata} message OmnichannelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OmnichannelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.OmnichannelOperationMetadata} OmnichannelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OmnichannelOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OmnichannelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + 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.statusMessage = reader.string(); + break; + } + case 4: { + message.requestedCancellation = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.OmnichannelOperationMetadata} OmnichannelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OmnichannelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OmnichannelOperationMetadata message. + * @function verify + * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OmnichannelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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.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"; + return null; + }; + + /** + * Creates an OmnichannelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.OmnichannelOperationMetadata} OmnichannelOperationMetadata + */ + OmnichannelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.OmnichannelOperationMetadata) + return object; + var message = new $root.google.cloud.ces.v1.OmnichannelOperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1.OmnichannelOperationMetadata.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.ces.v1.OmnichannelOperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + return message; + }; + + /** + * Creates a plain object from an OmnichannelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata + * @static + * @param {google.cloud.ces.v1.OmnichannelOperationMetadata} message OmnichannelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OmnichannelOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.statusMessage = ""; + object.requestedCancellation = false; + } + 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.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + return object; + }; + + /** + * Converts this OmnichannelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OmnichannelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OmnichannelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OmnichannelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.OmnichannelOperationMetadata"; + }; + + return OmnichannelOperationMetadata; + })(); + + v1.GoogleSearchSuggestions = (function() { + + /** + * Properties of a GoogleSearchSuggestions. + * @memberof google.cloud.ces.v1 + * @interface IGoogleSearchSuggestions + * @property {Array.|null} [htmls] GoogleSearchSuggestions htmls + * @property {Array.|null} [webSearchQueries] GoogleSearchSuggestions webSearchQueries + */ + + /** + * Constructs a new GoogleSearchSuggestions. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a GoogleSearchSuggestions. + * @implements IGoogleSearchSuggestions + * @constructor + * @param {google.cloud.ces.v1.IGoogleSearchSuggestions=} [properties] Properties to set + */ + function GoogleSearchSuggestions(properties) { + this.htmls = []; + this.webSearchQueries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoogleSearchSuggestions htmls. + * @member {Array.} htmls + * @memberof google.cloud.ces.v1.GoogleSearchSuggestions + * @instance + */ + GoogleSearchSuggestions.prototype.htmls = $util.emptyArray; + + /** + * GoogleSearchSuggestions webSearchQueries. + * @member {Array.} webSearchQueries + * @memberof google.cloud.ces.v1.GoogleSearchSuggestions + * @instance + */ + GoogleSearchSuggestions.prototype.webSearchQueries = $util.emptyArray; + + /** + * Creates a new GoogleSearchSuggestions instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.GoogleSearchSuggestions + * @static + * @param {google.cloud.ces.v1.IGoogleSearchSuggestions=} [properties] Properties to set + * @returns {google.cloud.ces.v1.GoogleSearchSuggestions} GoogleSearchSuggestions instance + */ + GoogleSearchSuggestions.create = function create(properties) { + return new GoogleSearchSuggestions(properties); + }; + + /** + * Encodes the specified GoogleSearchSuggestions message. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchSuggestions.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.GoogleSearchSuggestions + * @static + * @param {google.cloud.ces.v1.IGoogleSearchSuggestions} message GoogleSearchSuggestions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearchSuggestions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.htmls != null && message.htmls.length) + for (var i = 0; i < message.htmls.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.htmls[i]); + if (message.webSearchQueries != null && message.webSearchQueries.length) + for (var i = 0; i < message.webSearchQueries.length; ++i) + $root.google.cloud.ces.v1.WebSearchQuery.encode(message.webSearchQueries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoogleSearchSuggestions message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchSuggestions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.GoogleSearchSuggestions + * @static + * @param {google.cloud.ces.v1.IGoogleSearchSuggestions} message GoogleSearchSuggestions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearchSuggestions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoogleSearchSuggestions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.GoogleSearchSuggestions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.GoogleSearchSuggestions} GoogleSearchSuggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearchSuggestions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GoogleSearchSuggestions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.htmls && message.htmls.length)) + message.htmls = []; + message.htmls.push(reader.string()); + break; + } + case 2: { + if (!(message.webSearchQueries && message.webSearchQueries.length)) + message.webSearchQueries = []; + message.webSearchQueries.push($root.google.cloud.ces.v1.WebSearchQuery.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoogleSearchSuggestions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.GoogleSearchSuggestions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.GoogleSearchSuggestions} GoogleSearchSuggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearchSuggestions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoogleSearchSuggestions message. + * @function verify + * @memberof google.cloud.ces.v1.GoogleSearchSuggestions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoogleSearchSuggestions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.htmls != null && message.hasOwnProperty("htmls")) { + if (!Array.isArray(message.htmls)) + return "htmls: array expected"; + for (var i = 0; i < message.htmls.length; ++i) + if (!$util.isString(message.htmls[i])) + return "htmls: string[] expected"; + } + if (message.webSearchQueries != null && message.hasOwnProperty("webSearchQueries")) { + if (!Array.isArray(message.webSearchQueries)) + return "webSearchQueries: array expected"; + for (var i = 0; i < message.webSearchQueries.length; ++i) { + var error = $root.google.cloud.ces.v1.WebSearchQuery.verify(message.webSearchQueries[i]); + if (error) + return "webSearchQueries." + error; + } + } + return null; + }; + + /** + * Creates a GoogleSearchSuggestions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.GoogleSearchSuggestions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.GoogleSearchSuggestions} GoogleSearchSuggestions + */ + GoogleSearchSuggestions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.GoogleSearchSuggestions) + return object; + var message = new $root.google.cloud.ces.v1.GoogleSearchSuggestions(); + if (object.htmls) { + if (!Array.isArray(object.htmls)) + throw TypeError(".google.cloud.ces.v1.GoogleSearchSuggestions.htmls: array expected"); + message.htmls = []; + for (var i = 0; i < object.htmls.length; ++i) + message.htmls[i] = String(object.htmls[i]); + } + if (object.webSearchQueries) { + if (!Array.isArray(object.webSearchQueries)) + throw TypeError(".google.cloud.ces.v1.GoogleSearchSuggestions.webSearchQueries: array expected"); + message.webSearchQueries = []; + for (var i = 0; i < object.webSearchQueries.length; ++i) { + if (typeof object.webSearchQueries[i] !== "object") + throw TypeError(".google.cloud.ces.v1.GoogleSearchSuggestions.webSearchQueries: object expected"); + message.webSearchQueries[i] = $root.google.cloud.ces.v1.WebSearchQuery.fromObject(object.webSearchQueries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GoogleSearchSuggestions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.GoogleSearchSuggestions + * @static + * @param {google.cloud.ces.v1.GoogleSearchSuggestions} message GoogleSearchSuggestions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoogleSearchSuggestions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.htmls = []; + object.webSearchQueries = []; + } + if (message.htmls && message.htmls.length) { + object.htmls = []; + for (var j = 0; j < message.htmls.length; ++j) + object.htmls[j] = message.htmls[j]; + } + if (message.webSearchQueries && message.webSearchQueries.length) { + object.webSearchQueries = []; + for (var j = 0; j < message.webSearchQueries.length; ++j) + object.webSearchQueries[j] = $root.google.cloud.ces.v1.WebSearchQuery.toObject(message.webSearchQueries[j], options); + } + return object; + }; + + /** + * Converts this GoogleSearchSuggestions to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.GoogleSearchSuggestions + * @instance + * @returns {Object.} JSON object + */ + GoogleSearchSuggestions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoogleSearchSuggestions + * @function getTypeUrl + * @memberof google.cloud.ces.v1.GoogleSearchSuggestions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoogleSearchSuggestions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.GoogleSearchSuggestions"; + }; + + return GoogleSearchSuggestions; + })(); + + v1.WebSearchQuery = (function() { + + /** + * Properties of a WebSearchQuery. + * @memberof google.cloud.ces.v1 + * @interface IWebSearchQuery + * @property {string|null} [query] WebSearchQuery query + * @property {string|null} [uri] WebSearchQuery uri + */ + + /** + * Constructs a new WebSearchQuery. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a WebSearchQuery. + * @implements IWebSearchQuery + * @constructor + * @param {google.cloud.ces.v1.IWebSearchQuery=} [properties] Properties to set + */ + function WebSearchQuery(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebSearchQuery query. + * @member {string} query + * @memberof google.cloud.ces.v1.WebSearchQuery + * @instance + */ + WebSearchQuery.prototype.query = ""; + + /** + * WebSearchQuery uri. + * @member {string} uri + * @memberof google.cloud.ces.v1.WebSearchQuery + * @instance + */ + WebSearchQuery.prototype.uri = ""; + + /** + * Creates a new WebSearchQuery instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.WebSearchQuery + * @static + * @param {google.cloud.ces.v1.IWebSearchQuery=} [properties] Properties to set + * @returns {google.cloud.ces.v1.WebSearchQuery} WebSearchQuery instance + */ + WebSearchQuery.create = function create(properties) { + return new WebSearchQuery(properties); + }; + + /** + * Encodes the specified WebSearchQuery message. Does not implicitly {@link google.cloud.ces.v1.WebSearchQuery.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.WebSearchQuery + * @static + * @param {google.cloud.ces.v1.IWebSearchQuery} message WebSearchQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebSearchQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + return writer; + }; + + /** + * Encodes the specified WebSearchQuery message, length delimited. Does not implicitly {@link google.cloud.ces.v1.WebSearchQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.WebSearchQuery + * @static + * @param {google.cloud.ces.v1.IWebSearchQuery} message WebSearchQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebSearchQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebSearchQuery message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.WebSearchQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.WebSearchQuery} WebSearchQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebSearchQuery.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.WebSearchQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.query = reader.string(); + break; + } + case 2: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebSearchQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.WebSearchQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.WebSearchQuery} WebSearchQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebSearchQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebSearchQuery message. + * @function verify + * @memberof google.cloud.ces.v1.WebSearchQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebSearchQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a WebSearchQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.WebSearchQuery + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.WebSearchQuery} WebSearchQuery + */ + WebSearchQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.WebSearchQuery) + return object; + var message = new $root.google.cloud.ces.v1.WebSearchQuery(); + if (object.query != null) + message.query = String(object.query); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a WebSearchQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.WebSearchQuery + * @static + * @param {google.cloud.ces.v1.WebSearchQuery} message WebSearchQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebSearchQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.query = ""; + object.uri = ""; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this WebSearchQuery to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.WebSearchQuery + * @instance + * @returns {Object.} JSON object + */ + WebSearchQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebSearchQuery + * @function getTypeUrl + * @memberof google.cloud.ces.v1.WebSearchQuery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebSearchQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.WebSearchQuery"; + }; + + return WebSearchQuery; + })(); + + v1.SessionService = (function() { + + /** + * Constructs a new SessionService service. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a SessionService + * @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 SessionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SessionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SessionService; + + /** + * Creates new SessionService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.ces.v1.SessionService + * @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 {SessionService} RPC service. Useful where requests and/or responses are streamed. + */ + SessionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.ces.v1.SessionService|runSession}. + * @memberof google.cloud.ces.v1.SessionService + * @typedef RunSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.RunSessionResponse} [response] RunSessionResponse + */ + + /** + * Calls RunSession. + * @function runSession + * @memberof google.cloud.ces.v1.SessionService + * @instance + * @param {google.cloud.ces.v1.IRunSessionRequest} request RunSessionRequest message or plain object + * @param {google.cloud.ces.v1.SessionService.RunSessionCallback} callback Node-style callback called with the error, if any, and RunSessionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionService.prototype.runSession = function runSession(request, callback) { + return this.rpcCall(runSession, $root.google.cloud.ces.v1.RunSessionRequest, $root.google.cloud.ces.v1.RunSessionResponse, request, callback); + }, "name", { value: "RunSession" }); + + /** + * Calls RunSession. + * @function runSession + * @memberof google.cloud.ces.v1.SessionService + * @instance + * @param {google.cloud.ces.v1.IRunSessionRequest} request RunSessionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.SessionService|bidiRunSession}. + * @memberof google.cloud.ces.v1.SessionService + * @typedef BidiRunSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.BidiSessionServerMessage} [response] BidiSessionServerMessage + */ + + /** + * Calls BidiRunSession. + * @function bidiRunSession + * @memberof google.cloud.ces.v1.SessionService + * @instance + * @param {google.cloud.ces.v1.IBidiSessionClientMessage} request BidiSessionClientMessage message or plain object + * @param {google.cloud.ces.v1.SessionService.BidiRunSessionCallback} callback Node-style callback called with the error, if any, and BidiSessionServerMessage + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionService.prototype.bidiRunSession = function bidiRunSession(request, callback) { + return this.rpcCall(bidiRunSession, $root.google.cloud.ces.v1.BidiSessionClientMessage, $root.google.cloud.ces.v1.BidiSessionServerMessage, request, callback); + }, "name", { value: "BidiRunSession" }); + + /** + * Calls BidiRunSession. + * @function bidiRunSession + * @memberof google.cloud.ces.v1.SessionService + * @instance + * @param {google.cloud.ces.v1.IBidiSessionClientMessage} request BidiSessionClientMessage message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SessionService; + })(); + + /** + * AudioEncoding enum. + * @name google.cloud.ces.v1.AudioEncoding + * @enum {number} + * @property {number} AUDIO_ENCODING_UNSPECIFIED=0 AUDIO_ENCODING_UNSPECIFIED value + * @property {number} LINEAR16=1 LINEAR16 value + * @property {number} MULAW=2 MULAW value + * @property {number} ALAW=3 ALAW value + */ + v1.AudioEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUDIO_ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINEAR16"] = 1; + values[valuesById[2] = "MULAW"] = 2; + values[valuesById[3] = "ALAW"] = 3; + return values; + })(); + + v1.InputAudioConfig = (function() { + + /** + * Properties of an InputAudioConfig. + * @memberof google.cloud.ces.v1 + * @interface IInputAudioConfig + * @property {google.cloud.ces.v1.AudioEncoding|null} [audioEncoding] InputAudioConfig audioEncoding + * @property {number|null} [sampleRateHertz] InputAudioConfig sampleRateHertz + * @property {string|null} [noiseSuppressionLevel] InputAudioConfig noiseSuppressionLevel + */ + + /** + * Constructs a new InputAudioConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an InputAudioConfig. + * @implements IInputAudioConfig + * @constructor + * @param {google.cloud.ces.v1.IInputAudioConfig=} [properties] Properties to set + */ + function InputAudioConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputAudioConfig audioEncoding. + * @member {google.cloud.ces.v1.AudioEncoding} audioEncoding + * @memberof google.cloud.ces.v1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.audioEncoding = 0; + + /** + * InputAudioConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.ces.v1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.sampleRateHertz = 0; + + /** + * InputAudioConfig noiseSuppressionLevel. + * @member {string} noiseSuppressionLevel + * @memberof google.cloud.ces.v1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.noiseSuppressionLevel = ""; + + /** + * Creates a new InputAudioConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.InputAudioConfig + * @static + * @param {google.cloud.ces.v1.IInputAudioConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.InputAudioConfig} InputAudioConfig instance + */ + InputAudioConfig.create = function create(properties) { + return new InputAudioConfig(properties); + }; + + /** + * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1.InputAudioConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.InputAudioConfig + * @static + * @param {google.cloud.ces.v1.IInputAudioConfig} message InputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputAudioConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); + if (message.noiseSuppressionLevel != null && Object.hasOwnProperty.call(message, "noiseSuppressionLevel")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.noiseSuppressionLevel); + return writer; + }; + + /** + * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.InputAudioConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.InputAudioConfig + * @static + * @param {google.cloud.ces.v1.IInputAudioConfig} message InputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.InputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.InputAudioConfig} InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputAudioConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.InputAudioConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audioEncoding = reader.int32(); + break; + } + case 2: { + message.sampleRateHertz = reader.int32(); + break; + } + case 6: { + message.noiseSuppressionLevel = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.InputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.InputAudioConfig} InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputAudioConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputAudioConfig message. + * @function verify + * @memberof google.cloud.ces.v1.InputAudioConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputAudioConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + switch (message.audioEncoding) { + default: + return "audioEncoding: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) + if (!$util.isString(message.noiseSuppressionLevel)) + return "noiseSuppressionLevel: string expected"; + return null; + }; + + /** + * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.InputAudioConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.InputAudioConfig} InputAudioConfig + */ + InputAudioConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.InputAudioConfig) + return object; + var message = new $root.google.cloud.ces.v1.InputAudioConfig(); + switch (object.audioEncoding) { + default: + if (typeof object.audioEncoding === "number") { + message.audioEncoding = object.audioEncoding; + break; + } + break; + case "AUDIO_ENCODING_UNSPECIFIED": + case 0: + message.audioEncoding = 0; + break; + case "LINEAR16": + case 1: + message.audioEncoding = 1; + break; + case "MULAW": + case 2: + message.audioEncoding = 2; + break; + case "ALAW": + case 3: + message.audioEncoding = 3; + break; + } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + if (object.noiseSuppressionLevel != null) + message.noiseSuppressionLevel = String(object.noiseSuppressionLevel); + return message; + }; + + /** + * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.InputAudioConfig + * @static + * @param {google.cloud.ces.v1.InputAudioConfig} message InputAudioConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputAudioConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.audioEncoding = options.enums === String ? "AUDIO_ENCODING_UNSPECIFIED" : 0; + object.sampleRateHertz = 0; + object.noiseSuppressionLevel = ""; + } + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + object.audioEncoding = options.enums === String ? $root.google.cloud.ces.v1.AudioEncoding[message.audioEncoding] === undefined ? message.audioEncoding : $root.google.cloud.ces.v1.AudioEncoding[message.audioEncoding] : message.audioEncoding; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) + object.noiseSuppressionLevel = message.noiseSuppressionLevel; + return object; + }; + + /** + * Converts this InputAudioConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.InputAudioConfig + * @instance + * @returns {Object.} JSON object + */ + InputAudioConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputAudioConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.InputAudioConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputAudioConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.InputAudioConfig"; + }; + + return InputAudioConfig; + })(); + + v1.OutputAudioConfig = (function() { + + /** + * Properties of an OutputAudioConfig. + * @memberof google.cloud.ces.v1 + * @interface IOutputAudioConfig + * @property {google.cloud.ces.v1.AudioEncoding|null} [audioEncoding] OutputAudioConfig audioEncoding + * @property {number|null} [sampleRateHertz] OutputAudioConfig sampleRateHertz + */ + + /** + * Constructs a new OutputAudioConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an OutputAudioConfig. + * @implements IOutputAudioConfig + * @constructor + * @param {google.cloud.ces.v1.IOutputAudioConfig=} [properties] Properties to set + */ + function OutputAudioConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputAudioConfig audioEncoding. + * @member {google.cloud.ces.v1.AudioEncoding} audioEncoding + * @memberof google.cloud.ces.v1.OutputAudioConfig + * @instance + */ + OutputAudioConfig.prototype.audioEncoding = 0; + + /** + * OutputAudioConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.ces.v1.OutputAudioConfig + * @instance + */ + OutputAudioConfig.prototype.sampleRateHertz = 0; + + /** + * Creates a new OutputAudioConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.OutputAudioConfig + * @static + * @param {google.cloud.ces.v1.IOutputAudioConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.OutputAudioConfig} OutputAudioConfig instance + */ + OutputAudioConfig.create = function create(properties) { + return new OutputAudioConfig(properties); + }; + + /** + * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1.OutputAudioConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.OutputAudioConfig + * @static + * @param {google.cloud.ces.v1.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudioConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); + return writer; + }; + + /** + * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OutputAudioConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.OutputAudioConfig + * @static + * @param {google.cloud.ces.v1.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.OutputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.OutputAudioConfig} OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudioConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OutputAudioConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audioEncoding = reader.int32(); + break; + } + case 2: { + message.sampleRateHertz = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.OutputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.OutputAudioConfig} OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudioConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputAudioConfig message. + * @function verify + * @memberof google.cloud.ces.v1.OutputAudioConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputAudioConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + switch (message.audioEncoding) { + default: + return "audioEncoding: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + return null; + }; + + /** + * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.OutputAudioConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.OutputAudioConfig} OutputAudioConfig + */ + OutputAudioConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.OutputAudioConfig) + return object; + var message = new $root.google.cloud.ces.v1.OutputAudioConfig(); + switch (object.audioEncoding) { + default: + if (typeof object.audioEncoding === "number") { + message.audioEncoding = object.audioEncoding; + break; + } + break; + case "AUDIO_ENCODING_UNSPECIFIED": + case 0: + message.audioEncoding = 0; + break; + case "LINEAR16": + case 1: + message.audioEncoding = 1; + break; + case "MULAW": + case 2: + message.audioEncoding = 2; + break; + case "ALAW": + case 3: + message.audioEncoding = 3; + break; + } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + return message; + }; + + /** + * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.OutputAudioConfig + * @static + * @param {google.cloud.ces.v1.OutputAudioConfig} message OutputAudioConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputAudioConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.audioEncoding = options.enums === String ? "AUDIO_ENCODING_UNSPECIFIED" : 0; + object.sampleRateHertz = 0; + } + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + object.audioEncoding = options.enums === String ? $root.google.cloud.ces.v1.AudioEncoding[message.audioEncoding] === undefined ? message.audioEncoding : $root.google.cloud.ces.v1.AudioEncoding[message.audioEncoding] : message.audioEncoding; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + return object; + }; + + /** + * Converts this OutputAudioConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.OutputAudioConfig + * @instance + * @returns {Object.} JSON object + */ + OutputAudioConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputAudioConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.OutputAudioConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputAudioConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.OutputAudioConfig"; + }; + + return OutputAudioConfig; + })(); + + v1.SessionConfig = (function() { + + /** + * Properties of a SessionConfig. + * @memberof google.cloud.ces.v1 + * @interface ISessionConfig + * @property {string|null} [session] SessionConfig session + * @property {google.cloud.ces.v1.IInputAudioConfig|null} [inputAudioConfig] SessionConfig inputAudioConfig + * @property {google.cloud.ces.v1.IOutputAudioConfig|null} [outputAudioConfig] SessionConfig outputAudioConfig + * @property {Array.|null} [historicalContexts] SessionConfig historicalContexts + * @property {string|null} [entryAgent] SessionConfig entryAgent + * @property {string|null} [deployment] SessionConfig deployment + * @property {string|null} [timeZone] SessionConfig timeZone + * @property {google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters|null} [remoteDialogflowQueryParameters] SessionConfig remoteDialogflowQueryParameters + */ + + /** + * Constructs a new SessionConfig. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a SessionConfig. + * @implements ISessionConfig + * @constructor + * @param {google.cloud.ces.v1.ISessionConfig=} [properties] Properties to set + */ + function SessionConfig(properties) { + this.historicalContexts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionConfig session. + * @member {string} session + * @memberof google.cloud.ces.v1.SessionConfig + * @instance + */ + SessionConfig.prototype.session = ""; + + /** + * SessionConfig inputAudioConfig. + * @member {google.cloud.ces.v1.IInputAudioConfig|null|undefined} inputAudioConfig + * @memberof google.cloud.ces.v1.SessionConfig + * @instance + */ + SessionConfig.prototype.inputAudioConfig = null; + + /** + * SessionConfig outputAudioConfig. + * @member {google.cloud.ces.v1.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.ces.v1.SessionConfig + * @instance + */ + SessionConfig.prototype.outputAudioConfig = null; + + /** + * SessionConfig historicalContexts. + * @member {Array.} historicalContexts + * @memberof google.cloud.ces.v1.SessionConfig + * @instance + */ + SessionConfig.prototype.historicalContexts = $util.emptyArray; + + /** + * SessionConfig entryAgent. + * @member {string} entryAgent + * @memberof google.cloud.ces.v1.SessionConfig + * @instance + */ + SessionConfig.prototype.entryAgent = ""; + + /** + * SessionConfig deployment. + * @member {string} deployment + * @memberof google.cloud.ces.v1.SessionConfig + * @instance + */ + SessionConfig.prototype.deployment = ""; + + /** + * SessionConfig timeZone. + * @member {string} timeZone + * @memberof google.cloud.ces.v1.SessionConfig + * @instance + */ + SessionConfig.prototype.timeZone = ""; + + /** + * SessionConfig remoteDialogflowQueryParameters. + * @member {google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters|null|undefined} remoteDialogflowQueryParameters + * @memberof google.cloud.ces.v1.SessionConfig + * @instance + */ + SessionConfig.prototype.remoteDialogflowQueryParameters = null; + + /** + * Creates a new SessionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.SessionConfig + * @static + * @param {google.cloud.ces.v1.ISessionConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1.SessionConfig} SessionConfig instance + */ + SessionConfig.create = function create(properties) { + return new SessionConfig(properties); + }; + + /** + * Encodes the specified SessionConfig message. Does not implicitly {@link google.cloud.ces.v1.SessionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.SessionConfig + * @static + * @param {google.cloud.ces.v1.ISessionConfig} message SessionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.inputAudioConfig != null && Object.hasOwnProperty.call(message, "inputAudioConfig")) + $root.google.cloud.ces.v1.InputAudioConfig.encode(message.inputAudioConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.ces.v1.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.historicalContexts != null && message.historicalContexts.length) + for (var i = 0; i < message.historicalContexts.length; ++i) + $root.google.cloud.ces.v1.Message.encode(message.historicalContexts[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.deployment); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.timeZone); + if (message.entryAgent != null && Object.hasOwnProperty.call(message, "entryAgent")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.entryAgent); + if (message.remoteDialogflowQueryParameters != null && Object.hasOwnProperty.call(message, "remoteDialogflowQueryParameters")) + $root.google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.encode(message.remoteDialogflowQueryParameters, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SessionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.SessionConfig + * @static + * @param {google.cloud.ces.v1.ISessionConfig} message SessionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.SessionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.SessionConfig} SessionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.SessionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.inputAudioConfig = $root.google.cloud.ces.v1.InputAudioConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.outputAudioConfig = $root.google.cloud.ces.v1.OutputAudioConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.historicalContexts && message.historicalContexts.length)) + message.historicalContexts = []; + message.historicalContexts.push($root.google.cloud.ces.v1.Message.decode(reader, reader.uint32())); + break; + } + case 12: { + message.entryAgent = reader.string(); + break; + } + case 8: { + message.deployment = reader.string(); + break; + } + case 11: { + message.timeZone = reader.string(); + break; + } + case 15: { + message.remoteDialogflowQueryParameters = $root.google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.SessionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.SessionConfig} SessionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionConfig message. + * @function verify + * @memberof google.cloud.ces.v1.SessionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.inputAudioConfig != null && message.hasOwnProperty("inputAudioConfig")) { + var error = $root.google.cloud.ces.v1.InputAudioConfig.verify(message.inputAudioConfig); + if (error) + return "inputAudioConfig." + error; + } + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.ces.v1.OutputAudioConfig.verify(message.outputAudioConfig); + if (error) + return "outputAudioConfig." + error; + } + if (message.historicalContexts != null && message.hasOwnProperty("historicalContexts")) { + if (!Array.isArray(message.historicalContexts)) + return "historicalContexts: array expected"; + for (var i = 0; i < message.historicalContexts.length; ++i) { + var error = $root.google.cloud.ces.v1.Message.verify(message.historicalContexts[i]); + if (error) + return "historicalContexts." + error; + } + } + if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) + if (!$util.isString(message.entryAgent)) + return "entryAgent: string expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) + if (!$util.isString(message.deployment)) + return "deployment: string expected"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.remoteDialogflowQueryParameters != null && message.hasOwnProperty("remoteDialogflowQueryParameters")) { + var error = $root.google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.verify(message.remoteDialogflowQueryParameters); + if (error) + return "remoteDialogflowQueryParameters." + error; + } + return null; + }; + + /** + * Creates a SessionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.SessionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.SessionConfig} SessionConfig + */ + SessionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.SessionConfig) + return object; + var message = new $root.google.cloud.ces.v1.SessionConfig(); + if (object.session != null) + message.session = String(object.session); + if (object.inputAudioConfig != null) { + if (typeof object.inputAudioConfig !== "object") + throw TypeError(".google.cloud.ces.v1.SessionConfig.inputAudioConfig: object expected"); + message.inputAudioConfig = $root.google.cloud.ces.v1.InputAudioConfig.fromObject(object.inputAudioConfig); + } + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.ces.v1.SessionConfig.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.ces.v1.OutputAudioConfig.fromObject(object.outputAudioConfig); + } + if (object.historicalContexts) { + if (!Array.isArray(object.historicalContexts)) + throw TypeError(".google.cloud.ces.v1.SessionConfig.historicalContexts: array expected"); + message.historicalContexts = []; + for (var i = 0; i < object.historicalContexts.length; ++i) { + if (typeof object.historicalContexts[i] !== "object") + throw TypeError(".google.cloud.ces.v1.SessionConfig.historicalContexts: object expected"); + message.historicalContexts[i] = $root.google.cloud.ces.v1.Message.fromObject(object.historicalContexts[i]); + } + } + if (object.entryAgent != null) + message.entryAgent = String(object.entryAgent); + if (object.deployment != null) + message.deployment = String(object.deployment); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.remoteDialogflowQueryParameters != null) { + if (typeof object.remoteDialogflowQueryParameters !== "object") + throw TypeError(".google.cloud.ces.v1.SessionConfig.remoteDialogflowQueryParameters: object expected"); + message.remoteDialogflowQueryParameters = $root.google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.fromObject(object.remoteDialogflowQueryParameters); + } + return message; + }; + + /** + * Creates a plain object from a SessionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.SessionConfig + * @static + * @param {google.cloud.ces.v1.SessionConfig} message SessionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.historicalContexts = []; + if (options.defaults) { + object.session = ""; + object.inputAudioConfig = null; + object.outputAudioConfig = null; + object.deployment = ""; + object.timeZone = ""; + object.entryAgent = ""; + object.remoteDialogflowQueryParameters = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.inputAudioConfig != null && message.hasOwnProperty("inputAudioConfig")) + object.inputAudioConfig = $root.google.cloud.ces.v1.InputAudioConfig.toObject(message.inputAudioConfig, options); + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.ces.v1.OutputAudioConfig.toObject(message.outputAudioConfig, options); + if (message.historicalContexts && message.historicalContexts.length) { + object.historicalContexts = []; + for (var j = 0; j < message.historicalContexts.length; ++j) + object.historicalContexts[j] = $root.google.cloud.ces.v1.Message.toObject(message.historicalContexts[j], options); + } + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = message.deployment; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) + object.entryAgent = message.entryAgent; + if (message.remoteDialogflowQueryParameters != null && message.hasOwnProperty("remoteDialogflowQueryParameters")) + object.remoteDialogflowQueryParameters = $root.google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.toObject(message.remoteDialogflowQueryParameters, options); + return object; + }; + + /** + * Converts this SessionConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.SessionConfig + * @instance + * @returns {Object.} JSON object + */ + SessionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1.SessionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.SessionConfig"; + }; + + SessionConfig.RemoteDialogflowQueryParameters = (function() { + + /** + * Properties of a RemoteDialogflowQueryParameters. + * @memberof google.cloud.ces.v1.SessionConfig + * @interface IRemoteDialogflowQueryParameters + * @property {Object.|null} [webhookHeaders] RemoteDialogflowQueryParameters webhookHeaders + * @property {google.protobuf.IStruct|null} [payload] RemoteDialogflowQueryParameters payload + * @property {google.protobuf.IStruct|null} [endUserMetadata] RemoteDialogflowQueryParameters endUserMetadata + */ + + /** + * Constructs a new RemoteDialogflowQueryParameters. + * @memberof google.cloud.ces.v1.SessionConfig + * @classdesc Represents a RemoteDialogflowQueryParameters. + * @implements IRemoteDialogflowQueryParameters + * @constructor + * @param {google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters=} [properties] Properties to set + */ + function RemoteDialogflowQueryParameters(properties) { + this.webhookHeaders = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoteDialogflowQueryParameters webhookHeaders. + * @member {Object.} webhookHeaders + * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters + * @instance + */ + RemoteDialogflowQueryParameters.prototype.webhookHeaders = $util.emptyObject; + + /** + * RemoteDialogflowQueryParameters payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters + * @instance + */ + RemoteDialogflowQueryParameters.prototype.payload = null; + + /** + * RemoteDialogflowQueryParameters endUserMetadata. + * @member {google.protobuf.IStruct|null|undefined} endUserMetadata + * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters + * @instance + */ + RemoteDialogflowQueryParameters.prototype.endUserMetadata = null; + + /** + * Creates a new RemoteDialogflowQueryParameters instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters=} [properties] Properties to set + * @returns {google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters instance + */ + RemoteDialogflowQueryParameters.create = function create(properties) { + return new RemoteDialogflowQueryParameters(properties); + }; + + /** + * Encodes the specified RemoteDialogflowQueryParameters message. Does not implicitly {@link google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters} message RemoteDialogflowQueryParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoteDialogflowQueryParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.webhookHeaders != null && Object.hasOwnProperty.call(message, "webhookHeaders")) + for (var keys = Object.keys(message.webhookHeaders), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.webhookHeaders[keys[i]]).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endUserMetadata != null && Object.hasOwnProperty.call(message, "endUserMetadata")) + $root.google.protobuf.Struct.encode(message.endUserMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RemoteDialogflowQueryParameters message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters} message RemoteDialogflowQueryParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoteDialogflowQueryParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoteDialogflowQueryParameters.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.webhookHeaders === $util.emptyObject) + message.webhookHeaders = {}; + 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.webhookHeaders[key] = value; + break; + } + case 2: { + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endUserMetadata = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoteDialogflowQueryParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoteDialogflowQueryParameters message. + * @function verify + * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoteDialogflowQueryParameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.webhookHeaders != null && message.hasOwnProperty("webhookHeaders")) { + if (!$util.isObject(message.webhookHeaders)) + return "webhookHeaders: object expected"; + var key = Object.keys(message.webhookHeaders); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.webhookHeaders[key[i]])) + return "webhookHeaders: string{k:string} expected"; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.protobuf.Struct.verify(message.payload); + if (error) + return "payload." + error; + } + if (message.endUserMetadata != null && message.hasOwnProperty("endUserMetadata")) { + var error = $root.google.protobuf.Struct.verify(message.endUserMetadata); + if (error) + return "endUserMetadata." + error; + } + return null; + }; + + /** + * Creates a RemoteDialogflowQueryParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters + */ + RemoteDialogflowQueryParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters) + return object; + var message = new $root.google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters(); + if (object.webhookHeaders) { + if (typeof object.webhookHeaders !== "object") + throw TypeError(".google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.webhookHeaders: object expected"); + message.webhookHeaders = {}; + for (var keys = Object.keys(object.webhookHeaders), i = 0; i < keys.length; ++i) + message.webhookHeaders[keys[i]] = String(object.webhookHeaders[keys[i]]); + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload); + } + if (object.endUserMetadata != null) { + if (typeof object.endUserMetadata !== "object") + throw TypeError(".google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.endUserMetadata: object expected"); + message.endUserMetadata = $root.google.protobuf.Struct.fromObject(object.endUserMetadata); + } + return message; + }; + + /** + * Creates a plain object from a RemoteDialogflowQueryParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters} message RemoteDialogflowQueryParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoteDialogflowQueryParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.webhookHeaders = {}; + if (options.defaults) { + object.payload = null; + object.endUserMetadata = null; + } + var keys2; + if (message.webhookHeaders && (keys2 = Object.keys(message.webhookHeaders)).length) { + object.webhookHeaders = {}; + for (var j = 0; j < keys2.length; ++j) + object.webhookHeaders[keys2[j]] = message.webhookHeaders[keys2[j]]; + } + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (message.endUserMetadata != null && message.hasOwnProperty("endUserMetadata")) + object.endUserMetadata = $root.google.protobuf.Struct.toObject(message.endUserMetadata, options); + return object; + }; + + /** + * Converts this RemoteDialogflowQueryParameters to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters + * @instance + * @returns {Object.} JSON object + */ + RemoteDialogflowQueryParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemoteDialogflowQueryParameters + * @function getTypeUrl + * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoteDialogflowQueryParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters"; + }; + + return RemoteDialogflowQueryParameters; + })(); + + return SessionConfig; + })(); + + v1.ToolCalls = (function() { + + /** + * Properties of a ToolCalls. + * @memberof google.cloud.ces.v1 + * @interface IToolCalls + * @property {Array.|null} [toolCalls] ToolCalls toolCalls + */ + + /** + * Constructs a new ToolCalls. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ToolCalls. + * @implements IToolCalls + * @constructor + * @param {google.cloud.ces.v1.IToolCalls=} [properties] Properties to set + */ + function ToolCalls(properties) { + this.toolCalls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolCalls toolCalls. + * @member {Array.} toolCalls + * @memberof google.cloud.ces.v1.ToolCalls + * @instance + */ + ToolCalls.prototype.toolCalls = $util.emptyArray; + + /** + * Creates a new ToolCalls instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ToolCalls + * @static + * @param {google.cloud.ces.v1.IToolCalls=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ToolCalls} ToolCalls instance + */ + ToolCalls.create = function create(properties) { + return new ToolCalls(properties); + }; + + /** + * Encodes the specified ToolCalls message. Does not implicitly {@link google.cloud.ces.v1.ToolCalls.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ToolCalls + * @static + * @param {google.cloud.ces.v1.IToolCalls} message ToolCalls message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCalls.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolCalls != null && message.toolCalls.length) + for (var i = 0; i < message.toolCalls.length; ++i) + $root.google.cloud.ces.v1.ToolCall.encode(message.toolCalls[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolCalls message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolCalls.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ToolCalls + * @static + * @param {google.cloud.ces.v1.IToolCalls} message ToolCalls message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCalls.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolCalls message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ToolCalls + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ToolCalls} ToolCalls + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCalls.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ToolCalls(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.toolCalls && message.toolCalls.length)) + message.toolCalls = []; + message.toolCalls.push($root.google.cloud.ces.v1.ToolCall.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolCalls message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ToolCalls + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ToolCalls} ToolCalls + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCalls.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolCalls message. + * @function verify + * @memberof google.cloud.ces.v1.ToolCalls + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolCalls.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolCalls != null && message.hasOwnProperty("toolCalls")) { + if (!Array.isArray(message.toolCalls)) + return "toolCalls: array expected"; + for (var i = 0; i < message.toolCalls.length; ++i) { + var error = $root.google.cloud.ces.v1.ToolCall.verify(message.toolCalls[i]); + if (error) + return "toolCalls." + error; + } + } + return null; + }; + + /** + * Creates a ToolCalls message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ToolCalls + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ToolCalls} ToolCalls + */ + ToolCalls.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ToolCalls) + return object; + var message = new $root.google.cloud.ces.v1.ToolCalls(); + if (object.toolCalls) { + if (!Array.isArray(object.toolCalls)) + throw TypeError(".google.cloud.ces.v1.ToolCalls.toolCalls: array expected"); + message.toolCalls = []; + for (var i = 0; i < object.toolCalls.length; ++i) { + if (typeof object.toolCalls[i] !== "object") + throw TypeError(".google.cloud.ces.v1.ToolCalls.toolCalls: object expected"); + message.toolCalls[i] = $root.google.cloud.ces.v1.ToolCall.fromObject(object.toolCalls[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ToolCalls message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ToolCalls + * @static + * @param {google.cloud.ces.v1.ToolCalls} message ToolCalls + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolCalls.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.toolCalls = []; + if (message.toolCalls && message.toolCalls.length) { + object.toolCalls = []; + for (var j = 0; j < message.toolCalls.length; ++j) + object.toolCalls[j] = $root.google.cloud.ces.v1.ToolCall.toObject(message.toolCalls[j], options); + } + return object; + }; + + /** + * Converts this ToolCalls to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ToolCalls + * @instance + * @returns {Object.} JSON object + */ + ToolCalls.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolCalls + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ToolCalls + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolCalls.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ToolCalls"; + }; + + return ToolCalls; + })(); + + v1.ToolResponses = (function() { + + /** + * Properties of a ToolResponses. + * @memberof google.cloud.ces.v1 + * @interface IToolResponses + * @property {Array.|null} [toolResponses] ToolResponses toolResponses + */ + + /** + * Constructs a new ToolResponses. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ToolResponses. + * @implements IToolResponses + * @constructor + * @param {google.cloud.ces.v1.IToolResponses=} [properties] Properties to set + */ + function ToolResponses(properties) { + this.toolResponses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolResponses toolResponses. + * @member {Array.} toolResponses + * @memberof google.cloud.ces.v1.ToolResponses + * @instance + */ + ToolResponses.prototype.toolResponses = $util.emptyArray; + + /** + * Creates a new ToolResponses instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ToolResponses + * @static + * @param {google.cloud.ces.v1.IToolResponses=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ToolResponses} ToolResponses instance + */ + ToolResponses.create = function create(properties) { + return new ToolResponses(properties); + }; + + /** + * Encodes the specified ToolResponses message. Does not implicitly {@link google.cloud.ces.v1.ToolResponses.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ToolResponses + * @static + * @param {google.cloud.ces.v1.IToolResponses} message ToolResponses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolResponses.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolResponses != null && message.toolResponses.length) + for (var i = 0; i < message.toolResponses.length; ++i) + $root.google.cloud.ces.v1.ToolResponse.encode(message.toolResponses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolResponses message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolResponses.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ToolResponses + * @static + * @param {google.cloud.ces.v1.IToolResponses} message ToolResponses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolResponses.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolResponses message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ToolResponses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ToolResponses} ToolResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolResponses.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ToolResponses(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.toolResponses && message.toolResponses.length)) + message.toolResponses = []; + message.toolResponses.push($root.google.cloud.ces.v1.ToolResponse.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolResponses message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ToolResponses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ToolResponses} ToolResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolResponses.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolResponses message. + * @function verify + * @memberof google.cloud.ces.v1.ToolResponses + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolResponses.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolResponses != null && message.hasOwnProperty("toolResponses")) { + if (!Array.isArray(message.toolResponses)) + return "toolResponses: array expected"; + for (var i = 0; i < message.toolResponses.length; ++i) { + var error = $root.google.cloud.ces.v1.ToolResponse.verify(message.toolResponses[i]); + if (error) + return "toolResponses." + error; + } + } + return null; + }; + + /** + * Creates a ToolResponses message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ToolResponses + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ToolResponses} ToolResponses + */ + ToolResponses.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ToolResponses) + return object; + var message = new $root.google.cloud.ces.v1.ToolResponses(); + if (object.toolResponses) { + if (!Array.isArray(object.toolResponses)) + throw TypeError(".google.cloud.ces.v1.ToolResponses.toolResponses: array expected"); + message.toolResponses = []; + for (var i = 0; i < object.toolResponses.length; ++i) { + if (typeof object.toolResponses[i] !== "object") + throw TypeError(".google.cloud.ces.v1.ToolResponses.toolResponses: object expected"); + message.toolResponses[i] = $root.google.cloud.ces.v1.ToolResponse.fromObject(object.toolResponses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ToolResponses message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ToolResponses + * @static + * @param {google.cloud.ces.v1.ToolResponses} message ToolResponses + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolResponses.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.toolResponses = []; + if (message.toolResponses && message.toolResponses.length) { + object.toolResponses = []; + for (var j = 0; j < message.toolResponses.length; ++j) + object.toolResponses[j] = $root.google.cloud.ces.v1.ToolResponse.toObject(message.toolResponses[j], options); + } + return object; + }; + + /** + * Converts this ToolResponses to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ToolResponses + * @instance + * @returns {Object.} JSON object + */ + ToolResponses.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolResponses + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ToolResponses + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolResponses.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ToolResponses"; + }; + + return ToolResponses; + })(); + + v1.Citations = (function() { + + /** + * Properties of a Citations. + * @memberof google.cloud.ces.v1 + * @interface ICitations + * @property {Array.|null} [citedChunks] Citations citedChunks + */ + + /** + * Constructs a new Citations. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a Citations. + * @implements ICitations + * @constructor + * @param {google.cloud.ces.v1.ICitations=} [properties] Properties to set + */ + function Citations(properties) { + this.citedChunks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Citations citedChunks. + * @member {Array.} citedChunks + * @memberof google.cloud.ces.v1.Citations + * @instance + */ + Citations.prototype.citedChunks = $util.emptyArray; + + /** + * Creates a new Citations instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Citations + * @static + * @param {google.cloud.ces.v1.ICitations=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Citations} Citations instance + */ + Citations.create = function create(properties) { + return new Citations(properties); + }; + + /** + * Encodes the specified Citations message. Does not implicitly {@link google.cloud.ces.v1.Citations.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Citations + * @static + * @param {google.cloud.ces.v1.ICitations} message Citations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Citations.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.citedChunks != null && message.citedChunks.length) + for (var i = 0; i < message.citedChunks.length; ++i) + $root.google.cloud.ces.v1.Citations.CitedChunk.encode(message.citedChunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Citations message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Citations.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Citations + * @static + * @param {google.cloud.ces.v1.ICitations} message Citations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Citations.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Citations message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Citations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Citations} Citations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Citations.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Citations(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.citedChunks && message.citedChunks.length)) + message.citedChunks = []; + message.citedChunks.push($root.google.cloud.ces.v1.Citations.CitedChunk.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Citations message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Citations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Citations} Citations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Citations.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Citations message. + * @function verify + * @memberof google.cloud.ces.v1.Citations + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Citations.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.citedChunks != null && message.hasOwnProperty("citedChunks")) { + if (!Array.isArray(message.citedChunks)) + return "citedChunks: array expected"; + for (var i = 0; i < message.citedChunks.length; ++i) { + var error = $root.google.cloud.ces.v1.Citations.CitedChunk.verify(message.citedChunks[i]); + if (error) + return "citedChunks." + error; + } + } + return null; + }; + + /** + * Creates a Citations message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Citations + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Citations} Citations + */ + Citations.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Citations) + return object; + var message = new $root.google.cloud.ces.v1.Citations(); + if (object.citedChunks) { + if (!Array.isArray(object.citedChunks)) + throw TypeError(".google.cloud.ces.v1.Citations.citedChunks: array expected"); + message.citedChunks = []; + for (var i = 0; i < object.citedChunks.length; ++i) { + if (typeof object.citedChunks[i] !== "object") + throw TypeError(".google.cloud.ces.v1.Citations.citedChunks: object expected"); + message.citedChunks[i] = $root.google.cloud.ces.v1.Citations.CitedChunk.fromObject(object.citedChunks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Citations message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Citations + * @static + * @param {google.cloud.ces.v1.Citations} message Citations + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Citations.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.citedChunks = []; + if (message.citedChunks && message.citedChunks.length) { + object.citedChunks = []; + for (var j = 0; j < message.citedChunks.length; ++j) + object.citedChunks[j] = $root.google.cloud.ces.v1.Citations.CitedChunk.toObject(message.citedChunks[j], options); + } + return object; + }; + + /** + * Converts this Citations to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Citations + * @instance + * @returns {Object.} JSON object + */ + Citations.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Citations + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Citations + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Citations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Citations"; + }; + + Citations.CitedChunk = (function() { + + /** + * Properties of a CitedChunk. + * @memberof google.cloud.ces.v1.Citations + * @interface ICitedChunk + * @property {string|null} [uri] CitedChunk uri + * @property {string|null} [title] CitedChunk title + * @property {string|null} [text] CitedChunk text + */ + + /** + * Constructs a new CitedChunk. + * @memberof google.cloud.ces.v1.Citations + * @classdesc Represents a CitedChunk. + * @implements ICitedChunk + * @constructor + * @param {google.cloud.ces.v1.Citations.ICitedChunk=} [properties] Properties to set + */ + function CitedChunk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CitedChunk uri. + * @member {string} uri + * @memberof google.cloud.ces.v1.Citations.CitedChunk + * @instance + */ + CitedChunk.prototype.uri = ""; + + /** + * CitedChunk title. + * @member {string} title + * @memberof google.cloud.ces.v1.Citations.CitedChunk + * @instance + */ + CitedChunk.prototype.title = ""; + + /** + * CitedChunk text. + * @member {string} text + * @memberof google.cloud.ces.v1.Citations.CitedChunk + * @instance + */ + CitedChunk.prototype.text = ""; + + /** + * Creates a new CitedChunk instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Citations.CitedChunk + * @static + * @param {google.cloud.ces.v1.Citations.ICitedChunk=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Citations.CitedChunk} CitedChunk instance + */ + CitedChunk.create = function create(properties) { + return new CitedChunk(properties); + }; + + /** + * Encodes the specified CitedChunk message. Does not implicitly {@link google.cloud.ces.v1.Citations.CitedChunk.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Citations.CitedChunk + * @static + * @param {google.cloud.ces.v1.Citations.ICitedChunk} message CitedChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CitedChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.text); + return writer; + }; + + /** + * Encodes the specified CitedChunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Citations.CitedChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Citations.CitedChunk + * @static + * @param {google.cloud.ces.v1.Citations.ICitedChunk} message CitedChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CitedChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CitedChunk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Citations.CitedChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Citations.CitedChunk} CitedChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CitedChunk.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Citations.CitedChunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CitedChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Citations.CitedChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Citations.CitedChunk} CitedChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CitedChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CitedChunk message. + * @function verify + * @memberof google.cloud.ces.v1.Citations.CitedChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CitedChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a CitedChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Citations.CitedChunk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Citations.CitedChunk} CitedChunk + */ + CitedChunk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Citations.CitedChunk) + return object; + var message = new $root.google.cloud.ces.v1.Citations.CitedChunk(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.title != null) + message.title = String(object.title); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a CitedChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Citations.CitedChunk + * @static + * @param {google.cloud.ces.v1.Citations.CitedChunk} message CitedChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CitedChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.uri = ""; + object.title = ""; + object.text = ""; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this CitedChunk to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Citations.CitedChunk + * @instance + * @returns {Object.} JSON object + */ + CitedChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CitedChunk + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Citations.CitedChunk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CitedChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Citations.CitedChunk"; + }; + + return CitedChunk; + })(); + + return Citations; + })(); + + v1.Event = (function() { + + /** + * Properties of an Event. + * @memberof google.cloud.ces.v1 + * @interface IEvent + * @property {string|null} [event] Event event + */ + + /** + * Constructs a new Event. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an Event. + * @implements IEvent + * @constructor + * @param {google.cloud.ces.v1.IEvent=} [properties] Properties to set + */ + function Event(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Event event. + * @member {string} event + * @memberof google.cloud.ces.v1.Event + * @instance + */ + Event.prototype.event = ""; + + /** + * Creates a new Event instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.Event + * @static + * @param {google.cloud.ces.v1.IEvent=} [properties] Properties to set + * @returns {google.cloud.ces.v1.Event} Event instance + */ + Event.create = function create(properties) { + return new Event(properties); + }; + + /** + * Encodes the specified Event message. Does not implicitly {@link google.cloud.ces.v1.Event.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.Event + * @static + * @param {google.cloud.ces.v1.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.event); + return writer; + }; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Event.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.Event + * @static + * @param {google.cloud.ces.v1.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Event message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Event(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.event = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Event message. + * @function verify + * @memberof google.cloud.ces.v1.Event + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Event.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.event != null && message.hasOwnProperty("event")) + if (!$util.isString(message.event)) + return "event: string expected"; + return null; + }; + + /** + * Creates an Event message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.Event + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.Event} Event + */ + Event.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.Event) + return object; + var message = new $root.google.cloud.ces.v1.Event(); + if (object.event != null) + message.event = String(object.event); + return message; + }; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.Event + * @static + * @param {google.cloud.ces.v1.Event} message Event + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Event.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.event = ""; + if (message.event != null && message.hasOwnProperty("event")) + object.event = message.event; + return object; + }; + + /** + * Converts this Event to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.Event + * @instance + * @returns {Object.} JSON object + */ + Event.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Event + * @function getTypeUrl + * @memberof google.cloud.ces.v1.Event + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Event.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.Event"; + }; + + return Event; + })(); + + v1.SessionInput = (function() { + + /** + * Properties of a SessionInput. + * @memberof google.cloud.ces.v1 + * @interface ISessionInput + * @property {string|null} [text] SessionInput text + * @property {string|null} [dtmf] SessionInput dtmf + * @property {Uint8Array|null} [audio] SessionInput audio + * @property {google.cloud.ces.v1.IToolResponses|null} [toolResponses] SessionInput toolResponses + * @property {google.cloud.ces.v1.IImage|null} [image] SessionInput image + * @property {google.cloud.ces.v1.IBlob|null} [blob] SessionInput blob + * @property {google.protobuf.IStruct|null} [variables] SessionInput variables + * @property {google.cloud.ces.v1.IEvent|null} [event] SessionInput event + * @property {boolean|null} [willContinue] SessionInput willContinue + */ + + /** + * Constructs a new SessionInput. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a SessionInput. + * @implements ISessionInput + * @constructor + * @param {google.cloud.ces.v1.ISessionInput=} [properties] Properties to set + */ + function SessionInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionInput text. + * @member {string|null|undefined} text + * @memberof google.cloud.ces.v1.SessionInput + * @instance + */ + SessionInput.prototype.text = null; + + /** + * SessionInput dtmf. + * @member {string|null|undefined} dtmf + * @memberof google.cloud.ces.v1.SessionInput + * @instance + */ + SessionInput.prototype.dtmf = null; + + /** + * SessionInput audio. + * @member {Uint8Array|null|undefined} audio + * @memberof google.cloud.ces.v1.SessionInput + * @instance + */ + SessionInput.prototype.audio = null; + + /** + * SessionInput toolResponses. + * @member {google.cloud.ces.v1.IToolResponses|null|undefined} toolResponses + * @memberof google.cloud.ces.v1.SessionInput + * @instance + */ + SessionInput.prototype.toolResponses = null; + + /** + * SessionInput image. + * @member {google.cloud.ces.v1.IImage|null|undefined} image + * @memberof google.cloud.ces.v1.SessionInput + * @instance + */ + SessionInput.prototype.image = null; + + /** + * SessionInput blob. + * @member {google.cloud.ces.v1.IBlob|null|undefined} blob + * @memberof google.cloud.ces.v1.SessionInput + * @instance + */ + SessionInput.prototype.blob = null; + + /** + * SessionInput variables. + * @member {google.protobuf.IStruct|null|undefined} variables + * @memberof google.cloud.ces.v1.SessionInput + * @instance + */ + SessionInput.prototype.variables = null; + + /** + * SessionInput event. + * @member {google.cloud.ces.v1.IEvent|null|undefined} event + * @memberof google.cloud.ces.v1.SessionInput + * @instance + */ + SessionInput.prototype.event = null; + + /** + * SessionInput willContinue. + * @member {boolean} willContinue + * @memberof google.cloud.ces.v1.SessionInput + * @instance + */ + SessionInput.prototype.willContinue = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SessionInput inputType. + * @member {"text"|"dtmf"|"audio"|"toolResponses"|"image"|"blob"|"variables"|"event"|undefined} inputType + * @memberof google.cloud.ces.v1.SessionInput + * @instance + */ + Object.defineProperty(SessionInput.prototype, "inputType", { + get: $util.oneOfGetter($oneOfFields = ["text", "dtmf", "audio", "toolResponses", "image", "blob", "variables", "event"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SessionInput instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.SessionInput + * @static + * @param {google.cloud.ces.v1.ISessionInput=} [properties] Properties to set + * @returns {google.cloud.ces.v1.SessionInput} SessionInput instance + */ + SessionInput.create = function create(properties) { + return new SessionInput(properties); + }; + + /** + * Encodes the specified SessionInput message. Does not implicitly {@link google.cloud.ces.v1.SessionInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.SessionInput + * @static + * @param {google.cloud.ces.v1.ISessionInput} message SessionInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audio); + if (message.toolResponses != null && Object.hasOwnProperty.call(message, "toolResponses")) + $root.google.cloud.ces.v1.ToolResponses.encode(message.toolResponses, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.ces.v1.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) + $root.google.protobuf.Struct.encode(message.variables, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.dtmf != null && Object.hasOwnProperty.call(message, "dtmf")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.dtmf); + if (message.blob != null && Object.hasOwnProperty.call(message, "blob")) + $root.google.cloud.ces.v1.Blob.encode(message.blob, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.willContinue != null && Object.hasOwnProperty.call(message, "willContinue")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.willContinue); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + $root.google.cloud.ces.v1.Event.encode(message.event, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SessionInput message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.SessionInput + * @static + * @param {google.cloud.ces.v1.ISessionInput} message SessionInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.SessionInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.SessionInput} SessionInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionInput.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.SessionInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 6: { + message.dtmf = reader.string(); + break; + } + case 2: { + message.audio = reader.bytes(); + break; + } + case 3: { + message.toolResponses = $root.google.cloud.ces.v1.ToolResponses.decode(reader, reader.uint32()); + break; + } + case 4: { + message.image = $root.google.cloud.ces.v1.Image.decode(reader, reader.uint32()); + break; + } + case 7: { + message.blob = $root.google.cloud.ces.v1.Blob.decode(reader, reader.uint32()); + break; + } + case 5: { + message.variables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 9: { + message.event = $root.google.cloud.ces.v1.Event.decode(reader, reader.uint32()); + break; + } + case 8: { + message.willContinue = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.SessionInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.SessionInput} SessionInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionInput message. + * @function verify + * @memberof google.cloud.ces.v1.SessionInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionInput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.inputType = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.dtmf != null && message.hasOwnProperty("dtmf")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + if (!$util.isString(message.dtmf)) + return "dtmf: string expected"; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; + } + if (message.toolResponses != null && message.hasOwnProperty("toolResponses")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + { + var error = $root.google.cloud.ces.v1.ToolResponses.verify(message.toolResponses); + if (error) + return "toolResponses." + error; + } + } + if (message.image != null && message.hasOwnProperty("image")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + { + var error = $root.google.cloud.ces.v1.Image.verify(message.image); + if (error) + return "image." + error; + } + } + if (message.blob != null && message.hasOwnProperty("blob")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + { + var error = $root.google.cloud.ces.v1.Blob.verify(message.blob); + if (error) + return "blob." + error; + } + } + if (message.variables != null && message.hasOwnProperty("variables")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + { + var error = $root.google.protobuf.Struct.verify(message.variables); + if (error) + return "variables." + error; + } + } + if (message.event != null && message.hasOwnProperty("event")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + { + var error = $root.google.cloud.ces.v1.Event.verify(message.event); + if (error) + return "event." + error; + } + } + if (message.willContinue != null && message.hasOwnProperty("willContinue")) + if (typeof message.willContinue !== "boolean") + return "willContinue: boolean expected"; + return null; + }; + + /** + * Creates a SessionInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.SessionInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.SessionInput} SessionInput + */ + SessionInput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.SessionInput) + return object; + var message = new $root.google.cloud.ces.v1.SessionInput(); + if (object.text != null) + message.text = String(object.text); + if (object.dtmf != null) + message.dtmf = String(object.dtmf); + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length >= 0) + message.audio = object.audio; + if (object.toolResponses != null) { + if (typeof object.toolResponses !== "object") + throw TypeError(".google.cloud.ces.v1.SessionInput.toolResponses: object expected"); + message.toolResponses = $root.google.cloud.ces.v1.ToolResponses.fromObject(object.toolResponses); + } + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.ces.v1.SessionInput.image: object expected"); + message.image = $root.google.cloud.ces.v1.Image.fromObject(object.image); + } + if (object.blob != null) { + if (typeof object.blob !== "object") + throw TypeError(".google.cloud.ces.v1.SessionInput.blob: object expected"); + message.blob = $root.google.cloud.ces.v1.Blob.fromObject(object.blob); + } + if (object.variables != null) { + if (typeof object.variables !== "object") + throw TypeError(".google.cloud.ces.v1.SessionInput.variables: object expected"); + message.variables = $root.google.protobuf.Struct.fromObject(object.variables); + } + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".google.cloud.ces.v1.SessionInput.event: object expected"); + message.event = $root.google.cloud.ces.v1.Event.fromObject(object.event); + } + if (object.willContinue != null) + message.willContinue = Boolean(object.willContinue); + return message; + }; + + /** + * Creates a plain object from a SessionInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.SessionInput + * @static + * @param {google.cloud.ces.v1.SessionInput} message SessionInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.willContinue = false; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.inputType = "text"; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; + if (options.oneofs) + object.inputType = "audio"; + } + if (message.toolResponses != null && message.hasOwnProperty("toolResponses")) { + object.toolResponses = $root.google.cloud.ces.v1.ToolResponses.toObject(message.toolResponses, options); + if (options.oneofs) + object.inputType = "toolResponses"; + } + if (message.image != null && message.hasOwnProperty("image")) { + object.image = $root.google.cloud.ces.v1.Image.toObject(message.image, options); + if (options.oneofs) + object.inputType = "image"; + } + if (message.variables != null && message.hasOwnProperty("variables")) { + object.variables = $root.google.protobuf.Struct.toObject(message.variables, options); + if (options.oneofs) + object.inputType = "variables"; + } + if (message.dtmf != null && message.hasOwnProperty("dtmf")) { + object.dtmf = message.dtmf; + if (options.oneofs) + object.inputType = "dtmf"; + } + if (message.blob != null && message.hasOwnProperty("blob")) { + object.blob = $root.google.cloud.ces.v1.Blob.toObject(message.blob, options); + if (options.oneofs) + object.inputType = "blob"; + } + if (message.willContinue != null && message.hasOwnProperty("willContinue")) + object.willContinue = message.willContinue; + if (message.event != null && message.hasOwnProperty("event")) { + object.event = $root.google.cloud.ces.v1.Event.toObject(message.event, options); + if (options.oneofs) + object.inputType = "event"; + } + return object; + }; + + /** + * Converts this SessionInput to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.SessionInput + * @instance + * @returns {Object.} JSON object + */ + SessionInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionInput + * @function getTypeUrl + * @memberof google.cloud.ces.v1.SessionInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.SessionInput"; + }; + + return SessionInput; + })(); + + v1.SessionOutput = (function() { + + /** + * Properties of a SessionOutput. + * @memberof google.cloud.ces.v1 + * @interface ISessionOutput + * @property {string|null} [text] SessionOutput text + * @property {Uint8Array|null} [audio] SessionOutput audio + * @property {google.cloud.ces.v1.IToolCalls|null} [toolCalls] SessionOutput toolCalls + * @property {google.cloud.ces.v1.ICitations|null} [citations] SessionOutput citations + * @property {google.cloud.ces.v1.IGoogleSearchSuggestions|null} [googleSearchSuggestions] SessionOutput googleSearchSuggestions + * @property {google.cloud.ces.v1.IEndSession|null} [endSession] SessionOutput endSession + * @property {google.protobuf.IStruct|null} [payload] SessionOutput payload + * @property {number|null} [turnIndex] SessionOutput turnIndex + * @property {boolean|null} [turnCompleted] SessionOutput turnCompleted + * @property {google.cloud.ces.v1.SessionOutput.IDiagnosticInfo|null} [diagnosticInfo] SessionOutput diagnosticInfo + */ + + /** + * Constructs a new SessionOutput. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a SessionOutput. + * @implements ISessionOutput + * @constructor + * @param {google.cloud.ces.v1.ISessionOutput=} [properties] Properties to set + */ + function SessionOutput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionOutput text. + * @member {string|null|undefined} text + * @memberof google.cloud.ces.v1.SessionOutput + * @instance + */ + SessionOutput.prototype.text = null; + + /** + * SessionOutput audio. + * @member {Uint8Array|null|undefined} audio + * @memberof google.cloud.ces.v1.SessionOutput + * @instance + */ + SessionOutput.prototype.audio = null; + + /** + * SessionOutput toolCalls. + * @member {google.cloud.ces.v1.IToolCalls|null|undefined} toolCalls + * @memberof google.cloud.ces.v1.SessionOutput + * @instance + */ + SessionOutput.prototype.toolCalls = null; + + /** + * SessionOutput citations. + * @member {google.cloud.ces.v1.ICitations|null|undefined} citations + * @memberof google.cloud.ces.v1.SessionOutput + * @instance + */ + SessionOutput.prototype.citations = null; + + /** + * SessionOutput googleSearchSuggestions. + * @member {google.cloud.ces.v1.IGoogleSearchSuggestions|null|undefined} googleSearchSuggestions + * @memberof google.cloud.ces.v1.SessionOutput + * @instance + */ + SessionOutput.prototype.googleSearchSuggestions = null; + + /** + * SessionOutput endSession. + * @member {google.cloud.ces.v1.IEndSession|null|undefined} endSession + * @memberof google.cloud.ces.v1.SessionOutput + * @instance + */ + SessionOutput.prototype.endSession = null; + + /** + * SessionOutput payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.ces.v1.SessionOutput + * @instance + */ + SessionOutput.prototype.payload = null; + + /** + * SessionOutput turnIndex. + * @member {number} turnIndex + * @memberof google.cloud.ces.v1.SessionOutput + * @instance + */ + SessionOutput.prototype.turnIndex = 0; + + /** + * SessionOutput turnCompleted. + * @member {boolean} turnCompleted + * @memberof google.cloud.ces.v1.SessionOutput + * @instance + */ + SessionOutput.prototype.turnCompleted = false; + + /** + * SessionOutput diagnosticInfo. + * @member {google.cloud.ces.v1.SessionOutput.IDiagnosticInfo|null|undefined} diagnosticInfo + * @memberof google.cloud.ces.v1.SessionOutput + * @instance + */ + SessionOutput.prototype.diagnosticInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SessionOutput outputType. + * @member {"text"|"audio"|"toolCalls"|"citations"|"googleSearchSuggestions"|"endSession"|"payload"|undefined} outputType + * @memberof google.cloud.ces.v1.SessionOutput + * @instance + */ + Object.defineProperty(SessionOutput.prototype, "outputType", { + get: $util.oneOfGetter($oneOfFields = ["text", "audio", "toolCalls", "citations", "googleSearchSuggestions", "endSession", "payload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SessionOutput instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.SessionOutput + * @static + * @param {google.cloud.ces.v1.ISessionOutput=} [properties] Properties to set + * @returns {google.cloud.ces.v1.SessionOutput} SessionOutput instance + */ + SessionOutput.create = function create(properties) { + return new SessionOutput(properties); + }; + + /** + * Encodes the specified SessionOutput message. Does not implicitly {@link google.cloud.ces.v1.SessionOutput.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.SessionOutput + * @static + * @param {google.cloud.ces.v1.ISessionOutput} message SessionOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionOutput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audio); + if (message.toolCalls != null && Object.hasOwnProperty.call(message, "toolCalls")) + $root.google.cloud.ces.v1.ToolCalls.encode(message.toolCalls, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.turnCompleted != null && Object.hasOwnProperty.call(message, "turnCompleted")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.turnCompleted); + if (message.turnIndex != null && Object.hasOwnProperty.call(message, "turnIndex")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.turnIndex); + if (message.diagnosticInfo != null && Object.hasOwnProperty.call(message, "diagnosticInfo")) + $root.google.cloud.ces.v1.SessionOutput.DiagnosticInfo.encode(message.diagnosticInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.citations != null && Object.hasOwnProperty.call(message, "citations")) + $root.google.cloud.ces.v1.Citations.encode(message.citations, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.endSession != null && Object.hasOwnProperty.call(message, "endSession")) + $root.google.cloud.ces.v1.EndSession.encode(message.endSession, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.googleSearchSuggestions != null && Object.hasOwnProperty.call(message, "googleSearchSuggestions")) + $root.google.cloud.ces.v1.GoogleSearchSuggestions.encode(message.googleSearchSuggestions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SessionOutput message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.SessionOutput + * @static + * @param {google.cloud.ces.v1.ISessionOutput} message SessionOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionOutput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionOutput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.SessionOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.SessionOutput} SessionOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionOutput.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.SessionOutput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.audio = reader.bytes(); + break; + } + case 3: { + message.toolCalls = $root.google.cloud.ces.v1.ToolCalls.decode(reader, reader.uint32()); + break; + } + case 8: { + message.citations = $root.google.cloud.ces.v1.Citations.decode(reader, reader.uint32()); + break; + } + case 10: { + message.googleSearchSuggestions = $root.google.cloud.ces.v1.GoogleSearchSuggestions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.endSession = $root.google.cloud.ces.v1.EndSession.decode(reader, reader.uint32()); + break; + } + case 11: { + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.turnIndex = reader.int32(); + break; + } + case 4: { + message.turnCompleted = reader.bool(); + break; + } + case 7: { + message.diagnosticInfo = $root.google.cloud.ces.v1.SessionOutput.DiagnosticInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionOutput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.SessionOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.SessionOutput} SessionOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionOutput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionOutput message. + * @function verify + * @memberof google.cloud.ces.v1.SessionOutput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionOutput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.outputType = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + if (properties.outputType === 1) + return "outputType: multiple values"; + properties.outputType = 1; + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; + } + if (message.toolCalls != null && message.hasOwnProperty("toolCalls")) { + if (properties.outputType === 1) + return "outputType: multiple values"; + properties.outputType = 1; + { + var error = $root.google.cloud.ces.v1.ToolCalls.verify(message.toolCalls); + if (error) + return "toolCalls." + error; + } + } + if (message.citations != null && message.hasOwnProperty("citations")) { + if (properties.outputType === 1) + return "outputType: multiple values"; + properties.outputType = 1; + { + var error = $root.google.cloud.ces.v1.Citations.verify(message.citations); + if (error) + return "citations." + error; + } + } + if (message.googleSearchSuggestions != null && message.hasOwnProperty("googleSearchSuggestions")) { + if (properties.outputType === 1) + return "outputType: multiple values"; + properties.outputType = 1; + { + var error = $root.google.cloud.ces.v1.GoogleSearchSuggestions.verify(message.googleSearchSuggestions); + if (error) + return "googleSearchSuggestions." + error; + } + } + if (message.endSession != null && message.hasOwnProperty("endSession")) { + if (properties.outputType === 1) + return "outputType: multiple values"; + properties.outputType = 1; + { + var error = $root.google.cloud.ces.v1.EndSession.verify(message.endSession); + if (error) + return "endSession." + error; + } + } + if (message.payload != null && message.hasOwnProperty("payload")) { + if (properties.outputType === 1) + return "outputType: multiple values"; + properties.outputType = 1; + { + var error = $root.google.protobuf.Struct.verify(message.payload); + if (error) + return "payload." + error; + } + } + if (message.turnIndex != null && message.hasOwnProperty("turnIndex")) + if (!$util.isInteger(message.turnIndex)) + return "turnIndex: integer expected"; + if (message.turnCompleted != null && message.hasOwnProperty("turnCompleted")) + if (typeof message.turnCompleted !== "boolean") + return "turnCompleted: boolean expected"; + if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) { + var error = $root.google.cloud.ces.v1.SessionOutput.DiagnosticInfo.verify(message.diagnosticInfo); + if (error) + return "diagnosticInfo." + error; + } + return null; + }; + + /** + * Creates a SessionOutput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.SessionOutput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.SessionOutput} SessionOutput + */ + SessionOutput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.SessionOutput) + return object; + var message = new $root.google.cloud.ces.v1.SessionOutput(); + if (object.text != null) + message.text = String(object.text); + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length >= 0) + message.audio = object.audio; + if (object.toolCalls != null) { + if (typeof object.toolCalls !== "object") + throw TypeError(".google.cloud.ces.v1.SessionOutput.toolCalls: object expected"); + message.toolCalls = $root.google.cloud.ces.v1.ToolCalls.fromObject(object.toolCalls); + } + if (object.citations != null) { + if (typeof object.citations !== "object") + throw TypeError(".google.cloud.ces.v1.SessionOutput.citations: object expected"); + message.citations = $root.google.cloud.ces.v1.Citations.fromObject(object.citations); + } + if (object.googleSearchSuggestions != null) { + if (typeof object.googleSearchSuggestions !== "object") + throw TypeError(".google.cloud.ces.v1.SessionOutput.googleSearchSuggestions: object expected"); + message.googleSearchSuggestions = $root.google.cloud.ces.v1.GoogleSearchSuggestions.fromObject(object.googleSearchSuggestions); + } + if (object.endSession != null) { + if (typeof object.endSession !== "object") + throw TypeError(".google.cloud.ces.v1.SessionOutput.endSession: object expected"); + message.endSession = $root.google.cloud.ces.v1.EndSession.fromObject(object.endSession); + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.ces.v1.SessionOutput.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload); + } + if (object.turnIndex != null) + message.turnIndex = object.turnIndex | 0; + if (object.turnCompleted != null) + message.turnCompleted = Boolean(object.turnCompleted); + if (object.diagnosticInfo != null) { + if (typeof object.diagnosticInfo !== "object") + throw TypeError(".google.cloud.ces.v1.SessionOutput.diagnosticInfo: object expected"); + message.diagnosticInfo = $root.google.cloud.ces.v1.SessionOutput.DiagnosticInfo.fromObject(object.diagnosticInfo); + } + return message; + }; + + /** + * Creates a plain object from a SessionOutput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.SessionOutput + * @static + * @param {google.cloud.ces.v1.SessionOutput} message SessionOutput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionOutput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.turnCompleted = false; + object.turnIndex = 0; + object.diagnosticInfo = null; + } + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.outputType = "text"; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; + if (options.oneofs) + object.outputType = "audio"; + } + if (message.toolCalls != null && message.hasOwnProperty("toolCalls")) { + object.toolCalls = $root.google.cloud.ces.v1.ToolCalls.toObject(message.toolCalls, options); + if (options.oneofs) + object.outputType = "toolCalls"; + } + if (message.turnCompleted != null && message.hasOwnProperty("turnCompleted")) + object.turnCompleted = message.turnCompleted; + if (message.turnIndex != null && message.hasOwnProperty("turnIndex")) + object.turnIndex = message.turnIndex; + if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) + object.diagnosticInfo = $root.google.cloud.ces.v1.SessionOutput.DiagnosticInfo.toObject(message.diagnosticInfo, options); + if (message.citations != null && message.hasOwnProperty("citations")) { + object.citations = $root.google.cloud.ces.v1.Citations.toObject(message.citations, options); + if (options.oneofs) + object.outputType = "citations"; + } + if (message.endSession != null && message.hasOwnProperty("endSession")) { + object.endSession = $root.google.cloud.ces.v1.EndSession.toObject(message.endSession, options); + if (options.oneofs) + object.outputType = "endSession"; + } + if (message.googleSearchSuggestions != null && message.hasOwnProperty("googleSearchSuggestions")) { + object.googleSearchSuggestions = $root.google.cloud.ces.v1.GoogleSearchSuggestions.toObject(message.googleSearchSuggestions, options); + if (options.oneofs) + object.outputType = "googleSearchSuggestions"; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (options.oneofs) + object.outputType = "payload"; + } + return object; + }; + + /** + * Converts this SessionOutput to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.SessionOutput + * @instance + * @returns {Object.} JSON object + */ + SessionOutput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionOutput + * @function getTypeUrl + * @memberof google.cloud.ces.v1.SessionOutput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.SessionOutput"; + }; + + SessionOutput.DiagnosticInfo = (function() { + + /** + * Properties of a DiagnosticInfo. + * @memberof google.cloud.ces.v1.SessionOutput + * @interface IDiagnosticInfo + * @property {Array.|null} [messages] DiagnosticInfo messages + * @property {google.cloud.ces.v1.ISpan|null} [rootSpan] DiagnosticInfo rootSpan + */ + + /** + * Constructs a new DiagnosticInfo. + * @memberof google.cloud.ces.v1.SessionOutput + * @classdesc Represents a DiagnosticInfo. + * @implements IDiagnosticInfo + * @constructor + * @param {google.cloud.ces.v1.SessionOutput.IDiagnosticInfo=} [properties] Properties to set + */ + function DiagnosticInfo(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiagnosticInfo messages. + * @member {Array.} messages + * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo + * @instance + */ + DiagnosticInfo.prototype.messages = $util.emptyArray; + + /** + * DiagnosticInfo rootSpan. + * @member {google.cloud.ces.v1.ISpan|null|undefined} rootSpan + * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo + * @instance + */ + DiagnosticInfo.prototype.rootSpan = null; + + /** + * Creates a new DiagnosticInfo instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo + * @static + * @param {google.cloud.ces.v1.SessionOutput.IDiagnosticInfo=} [properties] Properties to set + * @returns {google.cloud.ces.v1.SessionOutput.DiagnosticInfo} DiagnosticInfo instance + */ + DiagnosticInfo.create = function create(properties) { + return new DiagnosticInfo(properties); + }; + + /** + * Encodes the specified DiagnosticInfo message. Does not implicitly {@link google.cloud.ces.v1.SessionOutput.DiagnosticInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo + * @static + * @param {google.cloud.ces.v1.SessionOutput.IDiagnosticInfo} message DiagnosticInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiagnosticInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.ces.v1.Message.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rootSpan != null && Object.hasOwnProperty.call(message, "rootSpan")) + $root.google.cloud.ces.v1.Span.encode(message.rootSpan, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DiagnosticInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionOutput.DiagnosticInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo + * @static + * @param {google.cloud.ces.v1.SessionOutput.IDiagnosticInfo} message DiagnosticInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiagnosticInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiagnosticInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.SessionOutput.DiagnosticInfo} DiagnosticInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiagnosticInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.SessionOutput.DiagnosticInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.ces.v1.Message.decode(reader, reader.uint32())); + break; + } + case 3: { + message.rootSpan = $root.google.cloud.ces.v1.Span.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiagnosticInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.SessionOutput.DiagnosticInfo} DiagnosticInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiagnosticInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiagnosticInfo message. + * @function verify + * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiagnosticInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.ces.v1.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) { + var error = $root.google.cloud.ces.v1.Span.verify(message.rootSpan); + if (error) + return "rootSpan." + error; + } + return null; + }; + + /** + * Creates a DiagnosticInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.SessionOutput.DiagnosticInfo} DiagnosticInfo + */ + DiagnosticInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.SessionOutput.DiagnosticInfo) + return object; + var message = new $root.google.cloud.ces.v1.SessionOutput.DiagnosticInfo(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.ces.v1.SessionOutput.DiagnosticInfo.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.ces.v1.SessionOutput.DiagnosticInfo.messages: object expected"); + message.messages[i] = $root.google.cloud.ces.v1.Message.fromObject(object.messages[i]); + } + } + if (object.rootSpan != null) { + if (typeof object.rootSpan !== "object") + throw TypeError(".google.cloud.ces.v1.SessionOutput.DiagnosticInfo.rootSpan: object expected"); + message.rootSpan = $root.google.cloud.ces.v1.Span.fromObject(object.rootSpan); + } + return message; + }; + + /** + * Creates a plain object from a DiagnosticInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo + * @static + * @param {google.cloud.ces.v1.SessionOutput.DiagnosticInfo} message DiagnosticInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiagnosticInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) + object.rootSpan = null; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.ces.v1.Message.toObject(message.messages[j], options); + } + if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) + object.rootSpan = $root.google.cloud.ces.v1.Span.toObject(message.rootSpan, options); + return object; + }; + + /** + * Converts this DiagnosticInfo to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo + * @instance + * @returns {Object.} JSON object + */ + DiagnosticInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DiagnosticInfo + * @function getTypeUrl + * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DiagnosticInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.SessionOutput.DiagnosticInfo"; + }; + + return DiagnosticInfo; + })(); + + return SessionOutput; + })(); + + v1.RecognitionResult = (function() { + + /** + * Properties of a RecognitionResult. + * @memberof google.cloud.ces.v1 + * @interface IRecognitionResult + * @property {string|null} [transcript] RecognitionResult transcript + */ + + /** + * Constructs a new RecognitionResult. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a RecognitionResult. + * @implements IRecognitionResult + * @constructor + * @param {google.cloud.ces.v1.IRecognitionResult=} [properties] Properties to set + */ + function RecognitionResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognitionResult transcript. + * @member {string} transcript + * @memberof google.cloud.ces.v1.RecognitionResult + * @instance + */ + RecognitionResult.prototype.transcript = ""; + + /** + * Creates a new RecognitionResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.RecognitionResult + * @static + * @param {google.cloud.ces.v1.IRecognitionResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1.RecognitionResult} RecognitionResult instance + */ + RecognitionResult.create = function create(properties) { + return new RecognitionResult(properties); + }; + + /** + * Encodes the specified RecognitionResult message. Does not implicitly {@link google.cloud.ces.v1.RecognitionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.RecognitionResult + * @static + * @param {google.cloud.ces.v1.IRecognitionResult} message RecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.transcript); + return writer; + }; + + /** + * Encodes the specified RecognitionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RecognitionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.RecognitionResult + * @static + * @param {google.cloud.ces.v1.IRecognitionResult} message RecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognitionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.RecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.RecognitionResult} RecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RecognitionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.transcript = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognitionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.RecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.RecognitionResult} RecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognitionResult message. + * @function verify + * @memberof google.cloud.ces.v1.RecognitionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognitionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transcript != null && message.hasOwnProperty("transcript")) + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + return null; + }; + + /** + * Creates a RecognitionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.RecognitionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.RecognitionResult} RecognitionResult + */ + RecognitionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.RecognitionResult) + return object; + var message = new $root.google.cloud.ces.v1.RecognitionResult(); + if (object.transcript != null) + message.transcript = String(object.transcript); + return message; + }; + + /** + * Creates a plain object from a RecognitionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.RecognitionResult + * @static + * @param {google.cloud.ces.v1.RecognitionResult} message RecognitionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognitionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.transcript = ""; + if (message.transcript != null && message.hasOwnProperty("transcript")) + object.transcript = message.transcript; + return object; + }; + + /** + * Converts this RecognitionResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.RecognitionResult + * @instance + * @returns {Object.} JSON object + */ + RecognitionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognitionResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1.RecognitionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognitionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.RecognitionResult"; + }; + + return RecognitionResult; + })(); + + v1.InterruptionSignal = (function() { + + /** + * Properties of an InterruptionSignal. + * @memberof google.cloud.ces.v1 + * @interface IInterruptionSignal + * @property {boolean|null} [bargeIn] InterruptionSignal bargeIn + */ + + /** + * Constructs a new InterruptionSignal. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an InterruptionSignal. + * @implements IInterruptionSignal + * @constructor + * @param {google.cloud.ces.v1.IInterruptionSignal=} [properties] Properties to set + */ + function InterruptionSignal(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterruptionSignal bargeIn. + * @member {boolean} bargeIn + * @memberof google.cloud.ces.v1.InterruptionSignal + * @instance + */ + InterruptionSignal.prototype.bargeIn = false; + + /** + * Creates a new InterruptionSignal instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.InterruptionSignal + * @static + * @param {google.cloud.ces.v1.IInterruptionSignal=} [properties] Properties to set + * @returns {google.cloud.ces.v1.InterruptionSignal} InterruptionSignal instance + */ + InterruptionSignal.create = function create(properties) { + return new InterruptionSignal(properties); + }; + + /** + * Encodes the specified InterruptionSignal message. Does not implicitly {@link google.cloud.ces.v1.InterruptionSignal.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.InterruptionSignal + * @static + * @param {google.cloud.ces.v1.IInterruptionSignal} message InterruptionSignal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterruptionSignal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bargeIn != null && Object.hasOwnProperty.call(message, "bargeIn")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.bargeIn); + return writer; + }; + + /** + * Encodes the specified InterruptionSignal message, length delimited. Does not implicitly {@link google.cloud.ces.v1.InterruptionSignal.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.InterruptionSignal + * @static + * @param {google.cloud.ces.v1.IInterruptionSignal} message InterruptionSignal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterruptionSignal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterruptionSignal message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.InterruptionSignal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.InterruptionSignal} InterruptionSignal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterruptionSignal.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.InterruptionSignal(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bargeIn = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterruptionSignal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.InterruptionSignal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.InterruptionSignal} InterruptionSignal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterruptionSignal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterruptionSignal message. + * @function verify + * @memberof google.cloud.ces.v1.InterruptionSignal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterruptionSignal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bargeIn != null && message.hasOwnProperty("bargeIn")) + if (typeof message.bargeIn !== "boolean") + return "bargeIn: boolean expected"; + return null; + }; + + /** + * Creates an InterruptionSignal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.InterruptionSignal + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.InterruptionSignal} InterruptionSignal + */ + InterruptionSignal.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.InterruptionSignal) + return object; + var message = new $root.google.cloud.ces.v1.InterruptionSignal(); + if (object.bargeIn != null) + message.bargeIn = Boolean(object.bargeIn); + return message; + }; + + /** + * Creates a plain object from an InterruptionSignal message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.InterruptionSignal + * @static + * @param {google.cloud.ces.v1.InterruptionSignal} message InterruptionSignal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterruptionSignal.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.bargeIn = false; + if (message.bargeIn != null && message.hasOwnProperty("bargeIn")) + object.bargeIn = message.bargeIn; + return object; + }; + + /** + * Converts this InterruptionSignal to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.InterruptionSignal + * @instance + * @returns {Object.} JSON object + */ + InterruptionSignal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InterruptionSignal + * @function getTypeUrl + * @memberof google.cloud.ces.v1.InterruptionSignal + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InterruptionSignal.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.InterruptionSignal"; + }; + + return InterruptionSignal; + })(); + + v1.EndSession = (function() { + + /** + * Properties of an EndSession. + * @memberof google.cloud.ces.v1 + * @interface IEndSession + * @property {google.protobuf.IStruct|null} [metadata] EndSession metadata + */ + + /** + * Constructs a new EndSession. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an EndSession. + * @implements IEndSession + * @constructor + * @param {google.cloud.ces.v1.IEndSession=} [properties] Properties to set + */ + function EndSession(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndSession metadata. + * @member {google.protobuf.IStruct|null|undefined} metadata + * @memberof google.cloud.ces.v1.EndSession + * @instance + */ + EndSession.prototype.metadata = null; + + /** + * Creates a new EndSession instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.EndSession + * @static + * @param {google.cloud.ces.v1.IEndSession=} [properties] Properties to set + * @returns {google.cloud.ces.v1.EndSession} EndSession instance + */ + EndSession.create = function create(properties) { + return new EndSession(properties); + }; + + /** + * Encodes the specified EndSession message. Does not implicitly {@link google.cloud.ces.v1.EndSession.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.EndSession + * @static + * @param {google.cloud.ces.v1.IEndSession} message EndSession message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndSession.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EndSession message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EndSession.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.EndSession + * @static + * @param {google.cloud.ces.v1.IEndSession} message EndSession message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndSession.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndSession message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.EndSession + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.EndSession} EndSession + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndSession.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.EndSession(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndSession message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.EndSession + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.EndSession} EndSession + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndSession.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndSession message. + * @function verify + * @memberof google.cloud.ces.v1.EndSession + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndSession.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Struct.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates an EndSession message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.EndSession + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.EndSession} EndSession + */ + EndSession.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.EndSession) + return object; + var message = new $root.google.cloud.ces.v1.EndSession(); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.ces.v1.EndSession.metadata: object expected"); + message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from an EndSession message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.EndSession + * @static + * @param {google.cloud.ces.v1.EndSession} message EndSession + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndSession.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this EndSession to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.EndSession + * @instance + * @returns {Object.} JSON object + */ + EndSession.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndSession + * @function getTypeUrl + * @memberof google.cloud.ces.v1.EndSession + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndSession.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.EndSession"; + }; + + return EndSession; + })(); + + v1.GoAway = (function() { + + /** + * Properties of a GoAway. + * @memberof google.cloud.ces.v1 + * @interface IGoAway + */ + + /** + * Constructs a new GoAway. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a GoAway. + * @implements IGoAway + * @constructor + * @param {google.cloud.ces.v1.IGoAway=} [properties] Properties to set + */ + function GoAway(properties) { + if (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 GoAway instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.GoAway + * @static + * @param {google.cloud.ces.v1.IGoAway=} [properties] Properties to set + * @returns {google.cloud.ces.v1.GoAway} GoAway instance + */ + GoAway.create = function create(properties) { + return new GoAway(properties); + }; + + /** + * Encodes the specified GoAway message. Does not implicitly {@link google.cloud.ces.v1.GoAway.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.GoAway + * @static + * @param {google.cloud.ces.v1.IGoAway} message GoAway message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoAway.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GoAway message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GoAway.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.GoAway + * @static + * @param {google.cloud.ces.v1.IGoAway} message GoAway message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoAway.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoAway message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.GoAway + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.GoAway} GoAway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoAway.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GoAway(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoAway message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.GoAway + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.GoAway} GoAway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoAway.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoAway message. + * @function verify + * @memberof google.cloud.ces.v1.GoAway + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoAway.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GoAway message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.GoAway + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.GoAway} GoAway + */ + GoAway.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.GoAway) + return object; + return new $root.google.cloud.ces.v1.GoAway(); + }; + + /** + * Creates a plain object from a GoAway message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.GoAway + * @static + * @param {google.cloud.ces.v1.GoAway} message GoAway + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoAway.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GoAway to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.GoAway + * @instance + * @returns {Object.} JSON object + */ + GoAway.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoAway + * @function getTypeUrl + * @memberof google.cloud.ces.v1.GoAway + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoAway.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.GoAway"; + }; + + return GoAway; + })(); + + v1.RunSessionRequest = (function() { + + /** + * Properties of a RunSessionRequest. + * @memberof google.cloud.ces.v1 + * @interface IRunSessionRequest + * @property {google.cloud.ces.v1.ISessionConfig|null} [config] RunSessionRequest config + * @property {Array.|null} [inputs] RunSessionRequest inputs + */ + + /** + * Constructs a new RunSessionRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a RunSessionRequest. + * @implements IRunSessionRequest + * @constructor + * @param {google.cloud.ces.v1.IRunSessionRequest=} [properties] Properties to set + */ + function RunSessionRequest(properties) { + this.inputs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunSessionRequest config. + * @member {google.cloud.ces.v1.ISessionConfig|null|undefined} config + * @memberof google.cloud.ces.v1.RunSessionRequest + * @instance + */ + RunSessionRequest.prototype.config = null; + + /** + * RunSessionRequest inputs. + * @member {Array.} inputs + * @memberof google.cloud.ces.v1.RunSessionRequest + * @instance + */ + RunSessionRequest.prototype.inputs = $util.emptyArray; + + /** + * Creates a new RunSessionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.RunSessionRequest + * @static + * @param {google.cloud.ces.v1.IRunSessionRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.RunSessionRequest} RunSessionRequest instance + */ + RunSessionRequest.create = function create(properties) { + return new RunSessionRequest(properties); + }; + + /** + * Encodes the specified RunSessionRequest message. Does not implicitly {@link google.cloud.ces.v1.RunSessionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.RunSessionRequest + * @static + * @param {google.cloud.ces.v1.IRunSessionRequest} message RunSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunSessionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.ces.v1.SessionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.inputs != null && message.inputs.length) + for (var i = 0; i < message.inputs.length; ++i) + $root.google.cloud.ces.v1.SessionInput.encode(message.inputs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunSessionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RunSessionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.RunSessionRequest + * @static + * @param {google.cloud.ces.v1.IRunSessionRequest} message RunSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunSessionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.RunSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.RunSessionRequest} RunSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunSessionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RunSessionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.ces.v1.SessionConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.inputs && message.inputs.length)) + message.inputs = []; + message.inputs.push($root.google.cloud.ces.v1.SessionInput.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunSessionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.RunSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.RunSessionRequest} RunSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunSessionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunSessionRequest message. + * @function verify + * @memberof google.cloud.ces.v1.RunSessionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunSessionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.ces.v1.SessionConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.inputs != null && message.hasOwnProperty("inputs")) { + if (!Array.isArray(message.inputs)) + return "inputs: array expected"; + for (var i = 0; i < message.inputs.length; ++i) { + var error = $root.google.cloud.ces.v1.SessionInput.verify(message.inputs[i]); + if (error) + return "inputs." + error; + } + } + return null; + }; + + /** + * Creates a RunSessionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.RunSessionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.RunSessionRequest} RunSessionRequest + */ + RunSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.RunSessionRequest) + return object; + var message = new $root.google.cloud.ces.v1.RunSessionRequest(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.ces.v1.RunSessionRequest.config: object expected"); + message.config = $root.google.cloud.ces.v1.SessionConfig.fromObject(object.config); + } + if (object.inputs) { + if (!Array.isArray(object.inputs)) + throw TypeError(".google.cloud.ces.v1.RunSessionRequest.inputs: array expected"); + message.inputs = []; + for (var i = 0; i < object.inputs.length; ++i) { + if (typeof object.inputs[i] !== "object") + throw TypeError(".google.cloud.ces.v1.RunSessionRequest.inputs: object expected"); + message.inputs[i] = $root.google.cloud.ces.v1.SessionInput.fromObject(object.inputs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RunSessionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.RunSessionRequest + * @static + * @param {google.cloud.ces.v1.RunSessionRequest} message RunSessionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunSessionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inputs = []; + if (options.defaults) + object.config = null; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.ces.v1.SessionConfig.toObject(message.config, options); + if (message.inputs && message.inputs.length) { + object.inputs = []; + for (var j = 0; j < message.inputs.length; ++j) + object.inputs[j] = $root.google.cloud.ces.v1.SessionInput.toObject(message.inputs[j], options); + } + return object; + }; + + /** + * Converts this RunSessionRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.RunSessionRequest + * @instance + * @returns {Object.} JSON object + */ + RunSessionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunSessionRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.RunSessionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.RunSessionRequest"; + }; + + return RunSessionRequest; + })(); + + v1.RunSessionResponse = (function() { + + /** + * Properties of a RunSessionResponse. + * @memberof google.cloud.ces.v1 + * @interface IRunSessionResponse + * @property {Array.|null} [outputs] RunSessionResponse outputs + */ + + /** + * Constructs a new RunSessionResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a RunSessionResponse. + * @implements IRunSessionResponse + * @constructor + * @param {google.cloud.ces.v1.IRunSessionResponse=} [properties] Properties to set + */ + function RunSessionResponse(properties) { + this.outputs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunSessionResponse outputs. + * @member {Array.} outputs + * @memberof google.cloud.ces.v1.RunSessionResponse + * @instance + */ + RunSessionResponse.prototype.outputs = $util.emptyArray; + + /** + * Creates a new RunSessionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.RunSessionResponse + * @static + * @param {google.cloud.ces.v1.IRunSessionResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.RunSessionResponse} RunSessionResponse instance + */ + RunSessionResponse.create = function create(properties) { + return new RunSessionResponse(properties); + }; + + /** + * Encodes the specified RunSessionResponse message. Does not implicitly {@link google.cloud.ces.v1.RunSessionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.RunSessionResponse + * @static + * @param {google.cloud.ces.v1.IRunSessionResponse} message RunSessionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunSessionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputs != null && message.outputs.length) + for (var i = 0; i < message.outputs.length; ++i) + $root.google.cloud.ces.v1.SessionOutput.encode(message.outputs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunSessionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RunSessionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.RunSessionResponse + * @static + * @param {google.cloud.ces.v1.IRunSessionResponse} message RunSessionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunSessionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunSessionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.RunSessionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.RunSessionResponse} RunSessionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunSessionResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RunSessionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.outputs && message.outputs.length)) + message.outputs = []; + message.outputs.push($root.google.cloud.ces.v1.SessionOutput.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunSessionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.RunSessionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.RunSessionResponse} RunSessionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunSessionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunSessionResponse message. + * @function verify + * @memberof google.cloud.ces.v1.RunSessionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunSessionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputs != null && message.hasOwnProperty("outputs")) { + if (!Array.isArray(message.outputs)) + return "outputs: array expected"; + for (var i = 0; i < message.outputs.length; ++i) { + var error = $root.google.cloud.ces.v1.SessionOutput.verify(message.outputs[i]); + if (error) + return "outputs." + error; + } + } + return null; + }; + + /** + * Creates a RunSessionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.RunSessionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.RunSessionResponse} RunSessionResponse + */ + RunSessionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.RunSessionResponse) + return object; + var message = new $root.google.cloud.ces.v1.RunSessionResponse(); + if (object.outputs) { + if (!Array.isArray(object.outputs)) + throw TypeError(".google.cloud.ces.v1.RunSessionResponse.outputs: array expected"); + message.outputs = []; + for (var i = 0; i < object.outputs.length; ++i) { + if (typeof object.outputs[i] !== "object") + throw TypeError(".google.cloud.ces.v1.RunSessionResponse.outputs: object expected"); + message.outputs[i] = $root.google.cloud.ces.v1.SessionOutput.fromObject(object.outputs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RunSessionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.RunSessionResponse + * @static + * @param {google.cloud.ces.v1.RunSessionResponse} message RunSessionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunSessionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.outputs = []; + if (message.outputs && message.outputs.length) { + object.outputs = []; + for (var j = 0; j < message.outputs.length; ++j) + object.outputs[j] = $root.google.cloud.ces.v1.SessionOutput.toObject(message.outputs[j], options); + } + return object; + }; + + /** + * Converts this RunSessionResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.RunSessionResponse + * @instance + * @returns {Object.} JSON object + */ + RunSessionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunSessionResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.RunSessionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunSessionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.RunSessionResponse"; + }; + + return RunSessionResponse; + })(); + + v1.BidiSessionClientMessage = (function() { + + /** + * Properties of a BidiSessionClientMessage. + * @memberof google.cloud.ces.v1 + * @interface IBidiSessionClientMessage + * @property {google.cloud.ces.v1.ISessionConfig|null} [config] BidiSessionClientMessage config + * @property {google.cloud.ces.v1.ISessionInput|null} [realtimeInput] BidiSessionClientMessage realtimeInput + */ + + /** + * Constructs a new BidiSessionClientMessage. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a BidiSessionClientMessage. + * @implements IBidiSessionClientMessage + * @constructor + * @param {google.cloud.ces.v1.IBidiSessionClientMessage=} [properties] Properties to set + */ + function BidiSessionClientMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiSessionClientMessage config. + * @member {google.cloud.ces.v1.ISessionConfig|null|undefined} config + * @memberof google.cloud.ces.v1.BidiSessionClientMessage + * @instance + */ + BidiSessionClientMessage.prototype.config = null; + + /** + * BidiSessionClientMessage realtimeInput. + * @member {google.cloud.ces.v1.ISessionInput|null|undefined} realtimeInput + * @memberof google.cloud.ces.v1.BidiSessionClientMessage + * @instance + */ + BidiSessionClientMessage.prototype.realtimeInput = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BidiSessionClientMessage messageType. + * @member {"config"|"realtimeInput"|undefined} messageType + * @memberof google.cloud.ces.v1.BidiSessionClientMessage + * @instance + */ + Object.defineProperty(BidiSessionClientMessage.prototype, "messageType", { + get: $util.oneOfGetter($oneOfFields = ["config", "realtimeInput"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BidiSessionClientMessage instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.BidiSessionClientMessage + * @static + * @param {google.cloud.ces.v1.IBidiSessionClientMessage=} [properties] Properties to set + * @returns {google.cloud.ces.v1.BidiSessionClientMessage} BidiSessionClientMessage instance + */ + BidiSessionClientMessage.create = function create(properties) { + return new BidiSessionClientMessage(properties); + }; + + /** + * Encodes the specified BidiSessionClientMessage message. Does not implicitly {@link google.cloud.ces.v1.BidiSessionClientMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.BidiSessionClientMessage + * @static + * @param {google.cloud.ces.v1.IBidiSessionClientMessage} message BidiSessionClientMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiSessionClientMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.ces.v1.SessionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.realtimeInput != null && Object.hasOwnProperty.call(message, "realtimeInput")) + $root.google.cloud.ces.v1.SessionInput.encode(message.realtimeInput, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BidiSessionClientMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BidiSessionClientMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.BidiSessionClientMessage + * @static + * @param {google.cloud.ces.v1.IBidiSessionClientMessage} message BidiSessionClientMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiSessionClientMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiSessionClientMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.BidiSessionClientMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.BidiSessionClientMessage} BidiSessionClientMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiSessionClientMessage.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.BidiSessionClientMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.ces.v1.SessionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.realtimeInput = $root.google.cloud.ces.v1.SessionInput.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiSessionClientMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.BidiSessionClientMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.BidiSessionClientMessage} BidiSessionClientMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiSessionClientMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiSessionClientMessage message. + * @function verify + * @memberof google.cloud.ces.v1.BidiSessionClientMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiSessionClientMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.config != null && message.hasOwnProperty("config")) { + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1.SessionConfig.verify(message.config); + if (error) + return "config." + error; + } + } + if (message.realtimeInput != null && message.hasOwnProperty("realtimeInput")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1.SessionInput.verify(message.realtimeInput); + if (error) + return "realtimeInput." + error; + } + } + return null; + }; + + /** + * Creates a BidiSessionClientMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.BidiSessionClientMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.BidiSessionClientMessage} BidiSessionClientMessage + */ + BidiSessionClientMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.BidiSessionClientMessage) + return object; + var message = new $root.google.cloud.ces.v1.BidiSessionClientMessage(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.ces.v1.BidiSessionClientMessage.config: object expected"); + message.config = $root.google.cloud.ces.v1.SessionConfig.fromObject(object.config); + } + if (object.realtimeInput != null) { + if (typeof object.realtimeInput !== "object") + throw TypeError(".google.cloud.ces.v1.BidiSessionClientMessage.realtimeInput: object expected"); + message.realtimeInput = $root.google.cloud.ces.v1.SessionInput.fromObject(object.realtimeInput); + } + return message; + }; + + /** + * Creates a plain object from a BidiSessionClientMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.BidiSessionClientMessage + * @static + * @param {google.cloud.ces.v1.BidiSessionClientMessage} message BidiSessionClientMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiSessionClientMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.config != null && message.hasOwnProperty("config")) { + object.config = $root.google.cloud.ces.v1.SessionConfig.toObject(message.config, options); + if (options.oneofs) + object.messageType = "config"; + } + if (message.realtimeInput != null && message.hasOwnProperty("realtimeInput")) { + object.realtimeInput = $root.google.cloud.ces.v1.SessionInput.toObject(message.realtimeInput, options); + if (options.oneofs) + object.messageType = "realtimeInput"; + } + return object; + }; + + /** + * Converts this BidiSessionClientMessage to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.BidiSessionClientMessage + * @instance + * @returns {Object.} JSON object + */ + BidiSessionClientMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiSessionClientMessage + * @function getTypeUrl + * @memberof google.cloud.ces.v1.BidiSessionClientMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiSessionClientMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.BidiSessionClientMessage"; + }; + + return BidiSessionClientMessage; + })(); + + v1.BidiSessionServerMessage = (function() { + + /** + * Properties of a BidiSessionServerMessage. + * @memberof google.cloud.ces.v1 + * @interface IBidiSessionServerMessage + * @property {google.cloud.ces.v1.ISessionOutput|null} [sessionOutput] BidiSessionServerMessage sessionOutput + * @property {google.cloud.ces.v1.IRecognitionResult|null} [recognitionResult] BidiSessionServerMessage recognitionResult + * @property {google.cloud.ces.v1.IInterruptionSignal|null} [interruptionSignal] BidiSessionServerMessage interruptionSignal + * @property {google.cloud.ces.v1.IEndSession|null} [endSession] BidiSessionServerMessage endSession + * @property {google.cloud.ces.v1.IGoAway|null} [goAway] BidiSessionServerMessage goAway + */ + + /** + * Constructs a new BidiSessionServerMessage. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a BidiSessionServerMessage. + * @implements IBidiSessionServerMessage + * @constructor + * @param {google.cloud.ces.v1.IBidiSessionServerMessage=} [properties] Properties to set + */ + function BidiSessionServerMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiSessionServerMessage sessionOutput. + * @member {google.cloud.ces.v1.ISessionOutput|null|undefined} sessionOutput + * @memberof google.cloud.ces.v1.BidiSessionServerMessage + * @instance + */ + BidiSessionServerMessage.prototype.sessionOutput = null; + + /** + * BidiSessionServerMessage recognitionResult. + * @member {google.cloud.ces.v1.IRecognitionResult|null|undefined} recognitionResult + * @memberof google.cloud.ces.v1.BidiSessionServerMessage + * @instance + */ + BidiSessionServerMessage.prototype.recognitionResult = null; + + /** + * BidiSessionServerMessage interruptionSignal. + * @member {google.cloud.ces.v1.IInterruptionSignal|null|undefined} interruptionSignal + * @memberof google.cloud.ces.v1.BidiSessionServerMessage + * @instance + */ + BidiSessionServerMessage.prototype.interruptionSignal = null; + + /** + * BidiSessionServerMessage endSession. + * @member {google.cloud.ces.v1.IEndSession|null|undefined} endSession + * @memberof google.cloud.ces.v1.BidiSessionServerMessage + * @instance + */ + BidiSessionServerMessage.prototype.endSession = null; + + /** + * BidiSessionServerMessage goAway. + * @member {google.cloud.ces.v1.IGoAway|null|undefined} goAway + * @memberof google.cloud.ces.v1.BidiSessionServerMessage + * @instance + */ + BidiSessionServerMessage.prototype.goAway = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BidiSessionServerMessage messageType. + * @member {"sessionOutput"|"recognitionResult"|"interruptionSignal"|"endSession"|"goAway"|undefined} messageType + * @memberof google.cloud.ces.v1.BidiSessionServerMessage + * @instance + */ + Object.defineProperty(BidiSessionServerMessage.prototype, "messageType", { + get: $util.oneOfGetter($oneOfFields = ["sessionOutput", "recognitionResult", "interruptionSignal", "endSession", "goAway"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BidiSessionServerMessage instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.BidiSessionServerMessage + * @static + * @param {google.cloud.ces.v1.IBidiSessionServerMessage=} [properties] Properties to set + * @returns {google.cloud.ces.v1.BidiSessionServerMessage} BidiSessionServerMessage instance + */ + BidiSessionServerMessage.create = function create(properties) { + return new BidiSessionServerMessage(properties); + }; + + /** + * Encodes the specified BidiSessionServerMessage message. Does not implicitly {@link google.cloud.ces.v1.BidiSessionServerMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.BidiSessionServerMessage + * @static + * @param {google.cloud.ces.v1.IBidiSessionServerMessage} message BidiSessionServerMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiSessionServerMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessionOutput != null && Object.hasOwnProperty.call(message, "sessionOutput")) + $root.google.cloud.ces.v1.SessionOutput.encode(message.sessionOutput, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.recognitionResult != null && Object.hasOwnProperty.call(message, "recognitionResult")) + $root.google.cloud.ces.v1.RecognitionResult.encode(message.recognitionResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.interruptionSignal != null && Object.hasOwnProperty.call(message, "interruptionSignal")) + $root.google.cloud.ces.v1.InterruptionSignal.encode(message.interruptionSignal, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endSession != null && Object.hasOwnProperty.call(message, "endSession")) + $root.google.cloud.ces.v1.EndSession.encode(message.endSession, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.goAway != null && Object.hasOwnProperty.call(message, "goAway")) + $root.google.cloud.ces.v1.GoAway.encode(message.goAway, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BidiSessionServerMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BidiSessionServerMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.BidiSessionServerMessage + * @static + * @param {google.cloud.ces.v1.IBidiSessionServerMessage} message BidiSessionServerMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiSessionServerMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiSessionServerMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.BidiSessionServerMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.BidiSessionServerMessage} BidiSessionServerMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiSessionServerMessage.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.BidiSessionServerMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sessionOutput = $root.google.cloud.ces.v1.SessionOutput.decode(reader, reader.uint32()); + break; + } + case 2: { + message.recognitionResult = $root.google.cloud.ces.v1.RecognitionResult.decode(reader, reader.uint32()); + break; + } + case 3: { + message.interruptionSignal = $root.google.cloud.ces.v1.InterruptionSignal.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endSession = $root.google.cloud.ces.v1.EndSession.decode(reader, reader.uint32()); + break; + } + case 6: { + message.goAway = $root.google.cloud.ces.v1.GoAway.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiSessionServerMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.BidiSessionServerMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.BidiSessionServerMessage} BidiSessionServerMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiSessionServerMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiSessionServerMessage message. + * @function verify + * @memberof google.cloud.ces.v1.BidiSessionServerMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiSessionServerMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sessionOutput != null && message.hasOwnProperty("sessionOutput")) { + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1.SessionOutput.verify(message.sessionOutput); + if (error) + return "sessionOutput." + error; + } + } + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1.RecognitionResult.verify(message.recognitionResult); + if (error) + return "recognitionResult." + error; + } + } + if (message.interruptionSignal != null && message.hasOwnProperty("interruptionSignal")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1.InterruptionSignal.verify(message.interruptionSignal); + if (error) + return "interruptionSignal." + error; + } + } + if (message.endSession != null && message.hasOwnProperty("endSession")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1.EndSession.verify(message.endSession); + if (error) + return "endSession." + error; + } + } + if (message.goAway != null && message.hasOwnProperty("goAway")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1.GoAway.verify(message.goAway); + if (error) + return "goAway." + error; + } + } + return null; + }; + + /** + * Creates a BidiSessionServerMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.BidiSessionServerMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.BidiSessionServerMessage} BidiSessionServerMessage + */ + BidiSessionServerMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.BidiSessionServerMessage) + return object; + var message = new $root.google.cloud.ces.v1.BidiSessionServerMessage(); + if (object.sessionOutput != null) { + if (typeof object.sessionOutput !== "object") + throw TypeError(".google.cloud.ces.v1.BidiSessionServerMessage.sessionOutput: object expected"); + message.sessionOutput = $root.google.cloud.ces.v1.SessionOutput.fromObject(object.sessionOutput); + } + if (object.recognitionResult != null) { + if (typeof object.recognitionResult !== "object") + throw TypeError(".google.cloud.ces.v1.BidiSessionServerMessage.recognitionResult: object expected"); + message.recognitionResult = $root.google.cloud.ces.v1.RecognitionResult.fromObject(object.recognitionResult); + } + if (object.interruptionSignal != null) { + if (typeof object.interruptionSignal !== "object") + throw TypeError(".google.cloud.ces.v1.BidiSessionServerMessage.interruptionSignal: object expected"); + message.interruptionSignal = $root.google.cloud.ces.v1.InterruptionSignal.fromObject(object.interruptionSignal); + } + if (object.endSession != null) { + if (typeof object.endSession !== "object") + throw TypeError(".google.cloud.ces.v1.BidiSessionServerMessage.endSession: object expected"); + message.endSession = $root.google.cloud.ces.v1.EndSession.fromObject(object.endSession); + } + if (object.goAway != null) { + if (typeof object.goAway !== "object") + throw TypeError(".google.cloud.ces.v1.BidiSessionServerMessage.goAway: object expected"); + message.goAway = $root.google.cloud.ces.v1.GoAway.fromObject(object.goAway); + } + return message; + }; + + /** + * Creates a plain object from a BidiSessionServerMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.BidiSessionServerMessage + * @static + * @param {google.cloud.ces.v1.BidiSessionServerMessage} message BidiSessionServerMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiSessionServerMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.sessionOutput != null && message.hasOwnProperty("sessionOutput")) { + object.sessionOutput = $root.google.cloud.ces.v1.SessionOutput.toObject(message.sessionOutput, options); + if (options.oneofs) + object.messageType = "sessionOutput"; + } + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { + object.recognitionResult = $root.google.cloud.ces.v1.RecognitionResult.toObject(message.recognitionResult, options); + if (options.oneofs) + object.messageType = "recognitionResult"; + } + if (message.interruptionSignal != null && message.hasOwnProperty("interruptionSignal")) { + object.interruptionSignal = $root.google.cloud.ces.v1.InterruptionSignal.toObject(message.interruptionSignal, options); + if (options.oneofs) + object.messageType = "interruptionSignal"; + } + if (message.endSession != null && message.hasOwnProperty("endSession")) { + object.endSession = $root.google.cloud.ces.v1.EndSession.toObject(message.endSession, options); + if (options.oneofs) + object.messageType = "endSession"; + } + if (message.goAway != null && message.hasOwnProperty("goAway")) { + object.goAway = $root.google.cloud.ces.v1.GoAway.toObject(message.goAway, options); + if (options.oneofs) + object.messageType = "goAway"; + } + return object; + }; + + /** + * Converts this BidiSessionServerMessage to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.BidiSessionServerMessage + * @instance + * @returns {Object.} JSON object + */ + BidiSessionServerMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiSessionServerMessage + * @function getTypeUrl + * @memberof google.cloud.ces.v1.BidiSessionServerMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiSessionServerMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.BidiSessionServerMessage"; + }; + + return BidiSessionServerMessage; + })(); + + v1.ToolService = (function() { + + /** + * Constructs a new ToolService service. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a ToolService + * @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 ToolService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ToolService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ToolService; + + /** + * Creates new ToolService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.ces.v1.ToolService + * @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 {ToolService} RPC service. Useful where requests and/or responses are streamed. + */ + ToolService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.ces.v1.ToolService|executeTool}. + * @memberof google.cloud.ces.v1.ToolService + * @typedef ExecuteToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.ExecuteToolResponse} [response] ExecuteToolResponse + */ + + /** + * Calls ExecuteTool. + * @function executeTool + * @memberof google.cloud.ces.v1.ToolService + * @instance + * @param {google.cloud.ces.v1.IExecuteToolRequest} request ExecuteToolRequest message or plain object + * @param {google.cloud.ces.v1.ToolService.ExecuteToolCallback} callback Node-style callback called with the error, if any, and ExecuteToolResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ToolService.prototype.executeTool = function executeTool(request, callback) { + return this.rpcCall(executeTool, $root.google.cloud.ces.v1.ExecuteToolRequest, $root.google.cloud.ces.v1.ExecuteToolResponse, request, callback); + }, "name", { value: "ExecuteTool" }); + + /** + * Calls ExecuteTool. + * @function executeTool + * @memberof google.cloud.ces.v1.ToolService + * @instance + * @param {google.cloud.ces.v1.IExecuteToolRequest} request ExecuteToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.ToolService|retrieveToolSchema}. + * @memberof google.cloud.ces.v1.ToolService + * @typedef RetrieveToolSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.RetrieveToolSchemaResponse} [response] RetrieveToolSchemaResponse + */ + + /** + * Calls RetrieveToolSchema. + * @function retrieveToolSchema + * @memberof google.cloud.ces.v1.ToolService + * @instance + * @param {google.cloud.ces.v1.IRetrieveToolSchemaRequest} request RetrieveToolSchemaRequest message or plain object + * @param {google.cloud.ces.v1.ToolService.RetrieveToolSchemaCallback} callback Node-style callback called with the error, if any, and RetrieveToolSchemaResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ToolService.prototype.retrieveToolSchema = function retrieveToolSchema(request, callback) { + return this.rpcCall(retrieveToolSchema, $root.google.cloud.ces.v1.RetrieveToolSchemaRequest, $root.google.cloud.ces.v1.RetrieveToolSchemaResponse, request, callback); + }, "name", { value: "RetrieveToolSchema" }); + + /** + * Calls RetrieveToolSchema. + * @function retrieveToolSchema + * @memberof google.cloud.ces.v1.ToolService + * @instance + * @param {google.cloud.ces.v1.IRetrieveToolSchemaRequest} request RetrieveToolSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1.ToolService|retrieveTools}. + * @memberof google.cloud.ces.v1.ToolService + * @typedef RetrieveToolsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.RetrieveToolsResponse} [response] RetrieveToolsResponse + */ + + /** + * Calls RetrieveTools. + * @function retrieveTools + * @memberof google.cloud.ces.v1.ToolService + * @instance + * @param {google.cloud.ces.v1.IRetrieveToolsRequest} request RetrieveToolsRequest message or plain object + * @param {google.cloud.ces.v1.ToolService.RetrieveToolsCallback} callback Node-style callback called with the error, if any, and RetrieveToolsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ToolService.prototype.retrieveTools = function retrieveTools(request, callback) { + return this.rpcCall(retrieveTools, $root.google.cloud.ces.v1.RetrieveToolsRequest, $root.google.cloud.ces.v1.RetrieveToolsResponse, request, callback); + }, "name", { value: "RetrieveTools" }); + + /** + * Calls RetrieveTools. + * @function retrieveTools + * @memberof google.cloud.ces.v1.ToolService + * @instance + * @param {google.cloud.ces.v1.IRetrieveToolsRequest} request RetrieveToolsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ToolService; + })(); + + v1.ExecuteToolRequest = (function() { + + /** + * Properties of an ExecuteToolRequest. + * @memberof google.cloud.ces.v1 + * @interface IExecuteToolRequest + * @property {string|null} [tool] ExecuteToolRequest tool + * @property {google.cloud.ces.v1.IToolsetTool|null} [toolsetTool] ExecuteToolRequest toolsetTool + * @property {string|null} [parent] ExecuteToolRequest parent + * @property {google.protobuf.IStruct|null} [args] ExecuteToolRequest args + */ + + /** + * Constructs a new ExecuteToolRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an ExecuteToolRequest. + * @implements IExecuteToolRequest + * @constructor + * @param {google.cloud.ces.v1.IExecuteToolRequest=} [properties] Properties to set + */ + function ExecuteToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteToolRequest tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1.ExecuteToolRequest + * @instance + */ + ExecuteToolRequest.prototype.tool = null; + + /** + * ExecuteToolRequest toolsetTool. + * @member {google.cloud.ces.v1.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1.ExecuteToolRequest + * @instance + */ + ExecuteToolRequest.prototype.toolsetTool = null; + + /** + * ExecuteToolRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.ExecuteToolRequest + * @instance + */ + ExecuteToolRequest.prototype.parent = ""; + + /** + * ExecuteToolRequest args. + * @member {google.protobuf.IStruct|null|undefined} args + * @memberof google.cloud.ces.v1.ExecuteToolRequest + * @instance + */ + ExecuteToolRequest.prototype.args = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExecuteToolRequest toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1.ExecuteToolRequest + * @instance + */ + Object.defineProperty(ExecuteToolRequest.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecuteToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ExecuteToolRequest + * @static + * @param {google.cloud.ces.v1.IExecuteToolRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ExecuteToolRequest} ExecuteToolRequest instance + */ + ExecuteToolRequest.create = function create(properties) { + return new ExecuteToolRequest(properties); + }; + + /** + * Encodes the specified ExecuteToolRequest message. Does not implicitly {@link google.cloud.ces.v1.ExecuteToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ExecuteToolRequest + * @static + * @param {google.cloud.ces.v1.IExecuteToolRequest} message ExecuteToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteToolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.args != null && Object.hasOwnProperty.call(message, "args")) + $root.google.protobuf.Struct.encode(message.args, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + return writer; + }; + + /** + * Encodes the specified ExecuteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExecuteToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ExecuteToolRequest + * @static + * @param {google.cloud.ces.v1.IExecuteToolRequest} message ExecuteToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ExecuteToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ExecuteToolRequest} ExecuteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteToolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ExecuteToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 3: { + message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 4: { + message.parent = reader.string(); + break; + } + case 2: { + message.args = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ExecuteToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ExecuteToolRequest} ExecuteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteToolRequest message. + * @function verify + * @memberof google.cloud.ces.v1.ExecuteToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteToolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.args != null && message.hasOwnProperty("args")) { + var error = $root.google.protobuf.Struct.verify(message.args); + if (error) + return "args." + error; + } + return null; + }; + + /** + * Creates an ExecuteToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ExecuteToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ExecuteToolRequest} ExecuteToolRequest + */ + ExecuteToolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ExecuteToolRequest) + return object; + var message = new $root.google.cloud.ces.v1.ExecuteToolRequest(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1.ExecuteToolRequest.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.args != null) { + if (typeof object.args !== "object") + throw TypeError(".google.cloud.ces.v1.ExecuteToolRequest.args: object expected"); + message.args = $root.google.protobuf.Struct.fromObject(object.args); + } + return message; + }; + + /** + * Creates a plain object from an ExecuteToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ExecuteToolRequest + * @static + * @param {google.cloud.ces.v1.ExecuteToolRequest} message ExecuteToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteToolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.args = null; + object.parent = ""; + } + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.args != null && message.hasOwnProperty("args")) + object.args = $root.google.protobuf.Struct.toObject(message.args, options); + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this ExecuteToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ExecuteToolRequest + * @instance + * @returns {Object.} JSON object + */ + ExecuteToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteToolRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ExecuteToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ExecuteToolRequest"; + }; + + return ExecuteToolRequest; + })(); + + v1.ExecuteToolResponse = (function() { + + /** + * Properties of an ExecuteToolResponse. + * @memberof google.cloud.ces.v1 + * @interface IExecuteToolResponse + * @property {string|null} [tool] ExecuteToolResponse tool + * @property {google.cloud.ces.v1.IToolsetTool|null} [toolsetTool] ExecuteToolResponse toolsetTool + * @property {google.protobuf.IStruct|null} [response] ExecuteToolResponse response + */ + + /** + * Constructs a new ExecuteToolResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents an ExecuteToolResponse. + * @implements IExecuteToolResponse + * @constructor + * @param {google.cloud.ces.v1.IExecuteToolResponse=} [properties] Properties to set + */ + function ExecuteToolResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteToolResponse tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1.ExecuteToolResponse + * @instance + */ + ExecuteToolResponse.prototype.tool = null; + + /** + * ExecuteToolResponse toolsetTool. + * @member {google.cloud.ces.v1.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1.ExecuteToolResponse + * @instance + */ + ExecuteToolResponse.prototype.toolsetTool = null; + + /** + * ExecuteToolResponse response. + * @member {google.protobuf.IStruct|null|undefined} response + * @memberof google.cloud.ces.v1.ExecuteToolResponse + * @instance + */ + ExecuteToolResponse.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExecuteToolResponse toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1.ExecuteToolResponse + * @instance + */ + Object.defineProperty(ExecuteToolResponse.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecuteToolResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.ExecuteToolResponse + * @static + * @param {google.cloud.ces.v1.IExecuteToolResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.ExecuteToolResponse} ExecuteToolResponse instance + */ + ExecuteToolResponse.create = function create(properties) { + return new ExecuteToolResponse(properties); + }; + + /** + * Encodes the specified ExecuteToolResponse message. Does not implicitly {@link google.cloud.ces.v1.ExecuteToolResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.ExecuteToolResponse + * @static + * @param {google.cloud.ces.v1.IExecuteToolResponse} message ExecuteToolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteToolResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Struct.encode(message.response, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExecuteToolResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.ExecuteToolResponse + * @static + * @param {google.cloud.ces.v1.IExecuteToolResponse} message ExecuteToolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteToolResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteToolResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.ExecuteToolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.ExecuteToolResponse} ExecuteToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteToolResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ExecuteToolResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 3: { + message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 2: { + message.response = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteToolResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.ExecuteToolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.ExecuteToolResponse} ExecuteToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteToolResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteToolResponse message. + * @function verify + * @memberof google.cloud.ces.v1.ExecuteToolResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteToolResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + var error = $root.google.protobuf.Struct.verify(message.response); + if (error) + return "response." + error; + } + return null; + }; + + /** + * Creates an ExecuteToolResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.ExecuteToolResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.ExecuteToolResponse} ExecuteToolResponse + */ + ExecuteToolResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.ExecuteToolResponse) + return object; + var message = new $root.google.cloud.ces.v1.ExecuteToolResponse(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1.ExecuteToolResponse.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.cloud.ces.v1.ExecuteToolResponse.response: object expected"); + message.response = $root.google.protobuf.Struct.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an ExecuteToolResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.ExecuteToolResponse + * @static + * @param {google.cloud.ces.v1.ExecuteToolResponse} message ExecuteToolResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteToolResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.response = null; + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.response != null && message.hasOwnProperty("response")) + object.response = $root.google.protobuf.Struct.toObject(message.response, options); + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + return object; + }; + + /** + * Converts this ExecuteToolResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.ExecuteToolResponse + * @instance + * @returns {Object.} JSON object + */ + ExecuteToolResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteToolResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.ExecuteToolResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteToolResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.ExecuteToolResponse"; + }; + + return ExecuteToolResponse; + })(); + + v1.RetrieveToolSchemaRequest = (function() { + + /** + * Properties of a RetrieveToolSchemaRequest. + * @memberof google.cloud.ces.v1 + * @interface IRetrieveToolSchemaRequest + * @property {string|null} [tool] RetrieveToolSchemaRequest tool + * @property {google.cloud.ces.v1.IToolsetTool|null} [toolsetTool] RetrieveToolSchemaRequest toolsetTool + * @property {string|null} [parent] RetrieveToolSchemaRequest parent + */ + + /** + * Constructs a new RetrieveToolSchemaRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a RetrieveToolSchemaRequest. + * @implements IRetrieveToolSchemaRequest + * @constructor + * @param {google.cloud.ces.v1.IRetrieveToolSchemaRequest=} [properties] Properties to set + */ + function RetrieveToolSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrieveToolSchemaRequest tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest + * @instance + */ + RetrieveToolSchemaRequest.prototype.tool = null; + + /** + * RetrieveToolSchemaRequest toolsetTool. + * @member {google.cloud.ces.v1.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest + * @instance + */ + RetrieveToolSchemaRequest.prototype.toolsetTool = null; + + /** + * RetrieveToolSchemaRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest + * @instance + */ + RetrieveToolSchemaRequest.prototype.parent = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RetrieveToolSchemaRequest toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest + * @instance + */ + Object.defineProperty(RetrieveToolSchemaRequest.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RetrieveToolSchemaRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest + * @static + * @param {google.cloud.ces.v1.IRetrieveToolSchemaRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest instance + */ + RetrieveToolSchemaRequest.create = function create(properties) { + return new RetrieveToolSchemaRequest(properties); + }; + + /** + * Encodes the specified RetrieveToolSchemaRequest message. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest + * @static + * @param {google.cloud.ces.v1.IRetrieveToolSchemaRequest} message RetrieveToolSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolSchemaRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); + return writer; + }; + + /** + * Encodes the specified RetrieveToolSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest + * @static + * @param {google.cloud.ces.v1.IRetrieveToolSchemaRequest} message RetrieveToolSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolSchemaRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RetrieveToolSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 3: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrieveToolSchemaRequest message. + * @function verify + * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrieveToolSchemaRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a RetrieveToolSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest + */ + RetrieveToolSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.RetrieveToolSchemaRequest) + return object; + var message = new $root.google.cloud.ces.v1.RetrieveToolSchemaRequest(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1.RetrieveToolSchemaRequest.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a RetrieveToolSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest + * @static + * @param {google.cloud.ces.v1.RetrieveToolSchemaRequest} message RetrieveToolSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrieveToolSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this RetrieveToolSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + RetrieveToolSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrieveToolSchemaRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrieveToolSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.RetrieveToolSchemaRequest"; + }; + + return RetrieveToolSchemaRequest; + })(); + + v1.RetrieveToolSchemaResponse = (function() { + + /** + * Properties of a RetrieveToolSchemaResponse. + * @memberof google.cloud.ces.v1 + * @interface IRetrieveToolSchemaResponse + * @property {string|null} [tool] RetrieveToolSchemaResponse tool + * @property {google.cloud.ces.v1.IToolsetTool|null} [toolsetTool] RetrieveToolSchemaResponse toolsetTool + * @property {google.cloud.ces.v1.ISchema|null} [inputSchema] RetrieveToolSchemaResponse inputSchema + * @property {google.cloud.ces.v1.ISchema|null} [outputSchema] RetrieveToolSchemaResponse outputSchema + */ + + /** + * Constructs a new RetrieveToolSchemaResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a RetrieveToolSchemaResponse. + * @implements IRetrieveToolSchemaResponse + * @constructor + * @param {google.cloud.ces.v1.IRetrieveToolSchemaResponse=} [properties] Properties to set + */ + function RetrieveToolSchemaResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrieveToolSchemaResponse tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse + * @instance + */ + RetrieveToolSchemaResponse.prototype.tool = null; + + /** + * RetrieveToolSchemaResponse toolsetTool. + * @member {google.cloud.ces.v1.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse + * @instance + */ + RetrieveToolSchemaResponse.prototype.toolsetTool = null; + + /** + * RetrieveToolSchemaResponse inputSchema. + * @member {google.cloud.ces.v1.ISchema|null|undefined} inputSchema + * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse + * @instance + */ + RetrieveToolSchemaResponse.prototype.inputSchema = null; + + /** + * RetrieveToolSchemaResponse outputSchema. + * @member {google.cloud.ces.v1.ISchema|null|undefined} outputSchema + * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse + * @instance + */ + RetrieveToolSchemaResponse.prototype.outputSchema = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RetrieveToolSchemaResponse toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse + * @instance + */ + Object.defineProperty(RetrieveToolSchemaResponse.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RetrieveToolSchemaResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse + * @static + * @param {google.cloud.ces.v1.IRetrieveToolSchemaResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse instance + */ + RetrieveToolSchemaResponse.create = function create(properties) { + return new RetrieveToolSchemaResponse(properties); + }; + + /** + * Encodes the specified RetrieveToolSchemaResponse message. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolSchemaResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse + * @static + * @param {google.cloud.ces.v1.IRetrieveToolSchemaResponse} message RetrieveToolSchemaResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolSchemaResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inputSchema != null && Object.hasOwnProperty.call(message, "inputSchema")) + $root.google.cloud.ces.v1.Schema.encode(message.inputSchema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputSchema != null && Object.hasOwnProperty.call(message, "outputSchema")) + $root.google.cloud.ces.v1.Schema.encode(message.outputSchema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RetrieveToolSchemaResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolSchemaResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse + * @static + * @param {google.cloud.ces.v1.IRetrieveToolSchemaResponse} message RetrieveToolSchemaResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolSchemaResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolSchemaResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RetrieveToolSchemaResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 3: { + message.inputSchema = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputSchema = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolSchemaResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrieveToolSchemaResponse message. + * @function verify + * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrieveToolSchemaResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) { + var error = $root.google.cloud.ces.v1.Schema.verify(message.inputSchema); + if (error) + return "inputSchema." + error; + } + if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) { + var error = $root.google.cloud.ces.v1.Schema.verify(message.outputSchema); + if (error) + return "outputSchema." + error; + } + return null; + }; + + /** + * Creates a RetrieveToolSchemaResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse + */ + RetrieveToolSchemaResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.RetrieveToolSchemaResponse) + return object; + var message = new $root.google.cloud.ces.v1.RetrieveToolSchemaResponse(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1.RetrieveToolSchemaResponse.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.inputSchema != null) { + if (typeof object.inputSchema !== "object") + throw TypeError(".google.cloud.ces.v1.RetrieveToolSchemaResponse.inputSchema: object expected"); + message.inputSchema = $root.google.cloud.ces.v1.Schema.fromObject(object.inputSchema); + } + if (object.outputSchema != null) { + if (typeof object.outputSchema !== "object") + throw TypeError(".google.cloud.ces.v1.RetrieveToolSchemaResponse.outputSchema: object expected"); + message.outputSchema = $root.google.cloud.ces.v1.Schema.fromObject(object.outputSchema); + } + return message; + }; + + /** + * Creates a plain object from a RetrieveToolSchemaResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse + * @static + * @param {google.cloud.ces.v1.RetrieveToolSchemaResponse} message RetrieveToolSchemaResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrieveToolSchemaResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputSchema = null; + object.outputSchema = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) + object.inputSchema = $root.google.cloud.ces.v1.Schema.toObject(message.inputSchema, options); + if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) + object.outputSchema = $root.google.cloud.ces.v1.Schema.toObject(message.outputSchema, options); + return object; + }; + + /** + * Converts this RetrieveToolSchemaResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse + * @instance + * @returns {Object.} JSON object + */ + RetrieveToolSchemaResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrieveToolSchemaResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrieveToolSchemaResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.RetrieveToolSchemaResponse"; + }; + + return RetrieveToolSchemaResponse; + })(); + + v1.RetrieveToolsRequest = (function() { + + /** + * Properties of a RetrieveToolsRequest. + * @memberof google.cloud.ces.v1 + * @interface IRetrieveToolsRequest + * @property {string|null} [toolset] RetrieveToolsRequest toolset + * @property {Array.|null} [toolIds] RetrieveToolsRequest toolIds + */ + + /** + * Constructs a new RetrieveToolsRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a RetrieveToolsRequest. + * @implements IRetrieveToolsRequest + * @constructor + * @param {google.cloud.ces.v1.IRetrieveToolsRequest=} [properties] Properties to set + */ + function RetrieveToolsRequest(properties) { + this.toolIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrieveToolsRequest toolset. + * @member {string} toolset + * @memberof google.cloud.ces.v1.RetrieveToolsRequest + * @instance + */ + RetrieveToolsRequest.prototype.toolset = ""; + + /** + * RetrieveToolsRequest toolIds. + * @member {Array.} toolIds + * @memberof google.cloud.ces.v1.RetrieveToolsRequest + * @instance + */ + RetrieveToolsRequest.prototype.toolIds = $util.emptyArray; + + /** + * Creates a new RetrieveToolsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.RetrieveToolsRequest + * @static + * @param {google.cloud.ces.v1.IRetrieveToolsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.RetrieveToolsRequest} RetrieveToolsRequest instance + */ + RetrieveToolsRequest.create = function create(properties) { + return new RetrieveToolsRequest(properties); + }; + + /** + * Encodes the specified RetrieveToolsRequest message. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.RetrieveToolsRequest + * @static + * @param {google.cloud.ces.v1.IRetrieveToolsRequest} message RetrieveToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.toolset); + if (message.toolIds != null && message.toolIds.length) + for (var i = 0; i < message.toolIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.toolIds[i]); + return writer; + }; + + /** + * Encodes the specified RetrieveToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.RetrieveToolsRequest + * @static + * @param {google.cloud.ces.v1.IRetrieveToolsRequest} message RetrieveToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrieveToolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.RetrieveToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.RetrieveToolsRequest} RetrieveToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RetrieveToolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolset = reader.string(); + break; + } + case 3: { + if (!(message.toolIds && message.toolIds.length)) + message.toolIds = []; + message.toolIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrieveToolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.RetrieveToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.RetrieveToolsRequest} RetrieveToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrieveToolsRequest message. + * @function verify + * @memberof google.cloud.ces.v1.RetrieveToolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrieveToolsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolset != null && message.hasOwnProperty("toolset")) + if (!$util.isString(message.toolset)) + return "toolset: string expected"; + if (message.toolIds != null && message.hasOwnProperty("toolIds")) { + if (!Array.isArray(message.toolIds)) + return "toolIds: array expected"; + for (var i = 0; i < message.toolIds.length; ++i) + if (!$util.isString(message.toolIds[i])) + return "toolIds: string[] expected"; + } + return null; + }; + + /** + * Creates a RetrieveToolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.RetrieveToolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.RetrieveToolsRequest} RetrieveToolsRequest + */ + RetrieveToolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.RetrieveToolsRequest) + return object; + var message = new $root.google.cloud.ces.v1.RetrieveToolsRequest(); + if (object.toolset != null) + message.toolset = String(object.toolset); + if (object.toolIds) { + if (!Array.isArray(object.toolIds)) + throw TypeError(".google.cloud.ces.v1.RetrieveToolsRequest.toolIds: array expected"); + message.toolIds = []; + for (var i = 0; i < object.toolIds.length; ++i) + message.toolIds[i] = String(object.toolIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a RetrieveToolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.RetrieveToolsRequest + * @static + * @param {google.cloud.ces.v1.RetrieveToolsRequest} message RetrieveToolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrieveToolsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.toolIds = []; + if (options.defaults) + object.toolset = ""; + if (message.toolset != null && message.hasOwnProperty("toolset")) + object.toolset = message.toolset; + if (message.toolIds && message.toolIds.length) { + object.toolIds = []; + for (var j = 0; j < message.toolIds.length; ++j) + object.toolIds[j] = message.toolIds[j]; + } + return object; + }; + + /** + * Converts this RetrieveToolsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.RetrieveToolsRequest + * @instance + * @returns {Object.} JSON object + */ + RetrieveToolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrieveToolsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.RetrieveToolsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrieveToolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.RetrieveToolsRequest"; + }; + + return RetrieveToolsRequest; + })(); + + v1.RetrieveToolsResponse = (function() { + + /** + * Properties of a RetrieveToolsResponse. + * @memberof google.cloud.ces.v1 + * @interface IRetrieveToolsResponse + * @property {Array.|null} [tools] RetrieveToolsResponse tools + */ + + /** + * Constructs a new RetrieveToolsResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a RetrieveToolsResponse. + * @implements IRetrieveToolsResponse + * @constructor + * @param {google.cloud.ces.v1.IRetrieveToolsResponse=} [properties] Properties to set + */ + function RetrieveToolsResponse(properties) { + this.tools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrieveToolsResponse tools. + * @member {Array.} tools + * @memberof google.cloud.ces.v1.RetrieveToolsResponse + * @instance + */ + RetrieveToolsResponse.prototype.tools = $util.emptyArray; + + /** + * Creates a new RetrieveToolsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.RetrieveToolsResponse + * @static + * @param {google.cloud.ces.v1.IRetrieveToolsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.RetrieveToolsResponse} RetrieveToolsResponse instance + */ + RetrieveToolsResponse.create = function create(properties) { + return new RetrieveToolsResponse(properties); + }; + + /** + * Encodes the specified RetrieveToolsResponse message. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.RetrieveToolsResponse + * @static + * @param {google.cloud.ces.v1.IRetrieveToolsResponse} message RetrieveToolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + $root.google.cloud.ces.v1.Tool.encode(message.tools[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RetrieveToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.RetrieveToolsResponse + * @static + * @param {google.cloud.ces.v1.IRetrieveToolsResponse} message RetrieveToolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrieveToolsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.RetrieveToolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.RetrieveToolsResponse} RetrieveToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RetrieveToolsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push($root.google.cloud.ces.v1.Tool.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrieveToolsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.RetrieveToolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.RetrieveToolsResponse} RetrieveToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrieveToolsResponse message. + * @function verify + * @memberof google.cloud.ces.v1.RetrieveToolsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrieveToolsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tools != null && message.hasOwnProperty("tools")) { + if (!Array.isArray(message.tools)) + return "tools: array expected"; + for (var i = 0; i < message.tools.length; ++i) { + var error = $root.google.cloud.ces.v1.Tool.verify(message.tools[i]); + if (error) + return "tools." + error; + } + } + return null; + }; + + /** + * Creates a RetrieveToolsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.RetrieveToolsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.RetrieveToolsResponse} RetrieveToolsResponse + */ + RetrieveToolsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.RetrieveToolsResponse) + return object; + var message = new $root.google.cloud.ces.v1.RetrieveToolsResponse(); + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.cloud.ces.v1.RetrieveToolsResponse.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) { + if (typeof object.tools[i] !== "object") + throw TypeError(".google.cloud.ces.v1.RetrieveToolsResponse.tools: object expected"); + message.tools[i] = $root.google.cloud.ces.v1.Tool.fromObject(object.tools[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RetrieveToolsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.RetrieveToolsResponse + * @static + * @param {google.cloud.ces.v1.RetrieveToolsResponse} message RetrieveToolsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrieveToolsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tools = []; + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = $root.google.cloud.ces.v1.Tool.toObject(message.tools[j], options); + } + return object; + }; + + /** + * Converts this RetrieveToolsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.RetrieveToolsResponse + * @instance + * @returns {Object.} JSON object + */ + RetrieveToolsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrieveToolsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.RetrieveToolsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrieveToolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.RetrieveToolsResponse"; + }; + + return RetrieveToolsResponse; + })(); + + v1.WidgetService = (function() { + + /** + * Constructs a new WidgetService service. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a WidgetService + * @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 WidgetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (WidgetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WidgetService; + + /** + * Creates new WidgetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.ces.v1.WidgetService + * @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 {WidgetService} RPC service. Useful where requests and/or responses are streamed. + */ + WidgetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.ces.v1.WidgetService|generateChatToken}. + * @memberof google.cloud.ces.v1.WidgetService + * @typedef GenerateChatTokenCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1.GenerateChatTokenResponse} [response] GenerateChatTokenResponse + */ + + /** + * Calls GenerateChatToken. + * @function generateChatToken + * @memberof google.cloud.ces.v1.WidgetService + * @instance + * @param {google.cloud.ces.v1.IGenerateChatTokenRequest} request GenerateChatTokenRequest message or plain object + * @param {google.cloud.ces.v1.WidgetService.GenerateChatTokenCallback} callback Node-style callback called with the error, if any, and GenerateChatTokenResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WidgetService.prototype.generateChatToken = function generateChatToken(request, callback) { + return this.rpcCall(generateChatToken, $root.google.cloud.ces.v1.GenerateChatTokenRequest, $root.google.cloud.ces.v1.GenerateChatTokenResponse, request, callback); + }, "name", { value: "GenerateChatToken" }); + + /** + * Calls GenerateChatToken. + * @function generateChatToken + * @memberof google.cloud.ces.v1.WidgetService + * @instance + * @param {google.cloud.ces.v1.IGenerateChatTokenRequest} request GenerateChatTokenRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return WidgetService; + })(); + + v1.GenerateChatTokenRequest = (function() { + + /** + * Properties of a GenerateChatTokenRequest. + * @memberof google.cloud.ces.v1 + * @interface IGenerateChatTokenRequest + * @property {string|null} [name] GenerateChatTokenRequest name + * @property {string|null} [deployment] GenerateChatTokenRequest deployment + * @property {string|null} [recaptchaToken] GenerateChatTokenRequest recaptchaToken + */ + + /** + * Constructs a new GenerateChatTokenRequest. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a GenerateChatTokenRequest. + * @implements IGenerateChatTokenRequest + * @constructor + * @param {google.cloud.ces.v1.IGenerateChatTokenRequest=} [properties] Properties to set + */ + function GenerateChatTokenRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateChatTokenRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1.GenerateChatTokenRequest + * @instance + */ + GenerateChatTokenRequest.prototype.name = ""; + + /** + * GenerateChatTokenRequest deployment. + * @member {string} deployment + * @memberof google.cloud.ces.v1.GenerateChatTokenRequest + * @instance + */ + GenerateChatTokenRequest.prototype.deployment = ""; + + /** + * GenerateChatTokenRequest recaptchaToken. + * @member {string} recaptchaToken + * @memberof google.cloud.ces.v1.GenerateChatTokenRequest + * @instance + */ + GenerateChatTokenRequest.prototype.recaptchaToken = ""; + + /** + * Creates a new GenerateChatTokenRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.GenerateChatTokenRequest + * @static + * @param {google.cloud.ces.v1.IGenerateChatTokenRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1.GenerateChatTokenRequest} GenerateChatTokenRequest instance + */ + GenerateChatTokenRequest.create = function create(properties) { + return new GenerateChatTokenRequest(properties); + }; + + /** + * Encodes the specified GenerateChatTokenRequest message. Does not implicitly {@link google.cloud.ces.v1.GenerateChatTokenRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.GenerateChatTokenRequest + * @static + * @param {google.cloud.ces.v1.IGenerateChatTokenRequest} message GenerateChatTokenRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateChatTokenRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deployment); + if (message.recaptchaToken != null && Object.hasOwnProperty.call(message, "recaptchaToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.recaptchaToken); + return writer; + }; + + /** + * Encodes the specified GenerateChatTokenRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GenerateChatTokenRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.GenerateChatTokenRequest + * @static + * @param {google.cloud.ces.v1.IGenerateChatTokenRequest} message GenerateChatTokenRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateChatTokenRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateChatTokenRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.GenerateChatTokenRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.GenerateChatTokenRequest} GenerateChatTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateChatTokenRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GenerateChatTokenRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.deployment = reader.string(); + break; + } + case 3: { + message.recaptchaToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateChatTokenRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.GenerateChatTokenRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.GenerateChatTokenRequest} GenerateChatTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateChatTokenRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateChatTokenRequest message. + * @function verify + * @memberof google.cloud.ces.v1.GenerateChatTokenRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateChatTokenRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) + if (!$util.isString(message.deployment)) + return "deployment: string expected"; + if (message.recaptchaToken != null && message.hasOwnProperty("recaptchaToken")) + if (!$util.isString(message.recaptchaToken)) + return "recaptchaToken: string expected"; + return null; + }; + + /** + * Creates a GenerateChatTokenRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.GenerateChatTokenRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.GenerateChatTokenRequest} GenerateChatTokenRequest + */ + GenerateChatTokenRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.GenerateChatTokenRequest) + return object; + var message = new $root.google.cloud.ces.v1.GenerateChatTokenRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.deployment != null) + message.deployment = String(object.deployment); + if (object.recaptchaToken != null) + message.recaptchaToken = String(object.recaptchaToken); + return message; + }; + + /** + * Creates a plain object from a GenerateChatTokenRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.GenerateChatTokenRequest + * @static + * @param {google.cloud.ces.v1.GenerateChatTokenRequest} message GenerateChatTokenRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateChatTokenRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.deployment = ""; + object.recaptchaToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = message.deployment; + if (message.recaptchaToken != null && message.hasOwnProperty("recaptchaToken")) + object.recaptchaToken = message.recaptchaToken; + return object; + }; + + /** + * Converts this GenerateChatTokenRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.GenerateChatTokenRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateChatTokenRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateChatTokenRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1.GenerateChatTokenRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateChatTokenRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.GenerateChatTokenRequest"; + }; + + return GenerateChatTokenRequest; + })(); + + v1.GenerateChatTokenResponse = (function() { + + /** + * Properties of a GenerateChatTokenResponse. + * @memberof google.cloud.ces.v1 + * @interface IGenerateChatTokenResponse + * @property {string|null} [chatToken] GenerateChatTokenResponse chatToken + * @property {google.protobuf.ITimestamp|null} [expireTime] GenerateChatTokenResponse expireTime + */ + + /** + * Constructs a new GenerateChatTokenResponse. + * @memberof google.cloud.ces.v1 + * @classdesc Represents a GenerateChatTokenResponse. + * @implements IGenerateChatTokenResponse + * @constructor + * @param {google.cloud.ces.v1.IGenerateChatTokenResponse=} [properties] Properties to set + */ + function GenerateChatTokenResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateChatTokenResponse chatToken. + * @member {string} chatToken + * @memberof google.cloud.ces.v1.GenerateChatTokenResponse + * @instance + */ + GenerateChatTokenResponse.prototype.chatToken = ""; + + /** + * GenerateChatTokenResponse expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.ces.v1.GenerateChatTokenResponse + * @instance + */ + GenerateChatTokenResponse.prototype.expireTime = null; + + /** + * Creates a new GenerateChatTokenResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1.GenerateChatTokenResponse + * @static + * @param {google.cloud.ces.v1.IGenerateChatTokenResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1.GenerateChatTokenResponse} GenerateChatTokenResponse instance + */ + GenerateChatTokenResponse.create = function create(properties) { + return new GenerateChatTokenResponse(properties); + }; + + /** + * Encodes the specified GenerateChatTokenResponse message. Does not implicitly {@link google.cloud.ces.v1.GenerateChatTokenResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1.GenerateChatTokenResponse + * @static + * @param {google.cloud.ces.v1.IGenerateChatTokenResponse} message GenerateChatTokenResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateChatTokenResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chatToken != null && Object.hasOwnProperty.call(message, "chatToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.chatToken); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateChatTokenResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GenerateChatTokenResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1.GenerateChatTokenResponse + * @static + * @param {google.cloud.ces.v1.IGenerateChatTokenResponse} message GenerateChatTokenResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateChatTokenResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateChatTokenResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1.GenerateChatTokenResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1.GenerateChatTokenResponse} GenerateChatTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateChatTokenResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GenerateChatTokenResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.chatToken = reader.string(); + break; + } + case 2: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateChatTokenResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1.GenerateChatTokenResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1.GenerateChatTokenResponse} GenerateChatTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateChatTokenResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateChatTokenResponse message. + * @function verify + * @memberof google.cloud.ces.v1.GenerateChatTokenResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateChatTokenResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chatToken != null && message.hasOwnProperty("chatToken")) + if (!$util.isString(message.chatToken)) + return "chatToken: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + return null; + }; + + /** + * Creates a GenerateChatTokenResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1.GenerateChatTokenResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1.GenerateChatTokenResponse} GenerateChatTokenResponse + */ + GenerateChatTokenResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1.GenerateChatTokenResponse) + return object; + var message = new $root.google.cloud.ces.v1.GenerateChatTokenResponse(); + if (object.chatToken != null) + message.chatToken = String(object.chatToken); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.ces.v1.GenerateChatTokenResponse.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + return message; + }; + + /** + * Creates a plain object from a GenerateChatTokenResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1.GenerateChatTokenResponse + * @static + * @param {google.cloud.ces.v1.GenerateChatTokenResponse} message GenerateChatTokenResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateChatTokenResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chatToken = ""; + object.expireTime = null; + } + if (message.chatToken != null && message.hasOwnProperty("chatToken")) + object.chatToken = message.chatToken; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + return object; + }; + + /** + * Converts this GenerateChatTokenResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1.GenerateChatTokenResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateChatTokenResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateChatTokenResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1.GenerateChatTokenResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateChatTokenResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1.GenerateChatTokenResponse"; + }; + + return GenerateChatTokenResponse; + })(); + + return v1; + })(); + + ces.v1beta = (function() { + + /** + * Namespace v1beta. + * @memberof google.cloud.ces + * @namespace + */ + var v1beta = {}; + + v1beta.Agent = (function() { + + /** + * Properties of an Agent. + * @memberof google.cloud.ces.v1beta + * @interface IAgent + * @property {google.cloud.ces.v1beta.Agent.ILlmAgent|null} [llmAgent] Agent llmAgent + * @property {google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent|null} [remoteDialogflowAgent] Agent remoteDialogflowAgent + * @property {string|null} [name] Agent name + * @property {string|null} [displayName] Agent displayName + * @property {string|null} [description] Agent description + * @property {google.cloud.ces.v1beta.IModelSettings|null} [modelSettings] Agent modelSettings + * @property {string|null} [instruction] Agent instruction + * @property {Array.|null} [tools] Agent tools + * @property {Array.|null} [childAgents] Agent childAgents + * @property {Array.|null} [beforeAgentCallbacks] Agent beforeAgentCallbacks + * @property {Array.|null} [afterAgentCallbacks] Agent afterAgentCallbacks + * @property {Array.|null} [beforeModelCallbacks] Agent beforeModelCallbacks + * @property {Array.|null} [afterModelCallbacks] Agent afterModelCallbacks + * @property {Array.|null} [beforeToolCallbacks] Agent beforeToolCallbacks + * @property {Array.|null} [afterToolCallbacks] Agent afterToolCallbacks + * @property {google.protobuf.ITimestamp|null} [createTime] Agent createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Agent updateTime + * @property {Array.|null} [guardrails] Agent guardrails + * @property {string|null} [etag] Agent etag + * @property {Array.|null} [toolsets] Agent toolsets + * @property {string|null} [generatedSummary] Agent generatedSummary + * @property {Array.|null} [transferRules] Agent transferRules + */ + + /** + * Constructs a new Agent. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an Agent. + * @implements IAgent + * @constructor + * @param {google.cloud.ces.v1beta.IAgent=} [properties] Properties to set + */ + function Agent(properties) { + this.tools = []; + this.childAgents = []; + this.beforeAgentCallbacks = []; + this.afterAgentCallbacks = []; + this.beforeModelCallbacks = []; + this.afterModelCallbacks = []; + this.beforeToolCallbacks = []; + this.afterToolCallbacks = []; + this.guardrails = []; + this.toolsets = []; + this.transferRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Agent llmAgent. + * @member {google.cloud.ces.v1beta.Agent.ILlmAgent|null|undefined} llmAgent + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.llmAgent = null; + + /** + * Agent remoteDialogflowAgent. + * @member {google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent|null|undefined} remoteDialogflowAgent + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.remoteDialogflowAgent = null; + + /** + * Agent name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.name = ""; + + /** + * Agent displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.displayName = ""; + + /** + * Agent description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.description = ""; + + /** + * Agent modelSettings. + * @member {google.cloud.ces.v1beta.IModelSettings|null|undefined} modelSettings + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.modelSettings = null; + + /** + * Agent instruction. + * @member {string} instruction + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.instruction = ""; + + /** + * Agent tools. + * @member {Array.} tools + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.tools = $util.emptyArray; + + /** + * Agent childAgents. + * @member {Array.} childAgents + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.childAgents = $util.emptyArray; + + /** + * Agent beforeAgentCallbacks. + * @member {Array.} beforeAgentCallbacks + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.beforeAgentCallbacks = $util.emptyArray; + + /** + * Agent afterAgentCallbacks. + * @member {Array.} afterAgentCallbacks + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.afterAgentCallbacks = $util.emptyArray; + + /** + * Agent beforeModelCallbacks. + * @member {Array.} beforeModelCallbacks + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.beforeModelCallbacks = $util.emptyArray; + + /** + * Agent afterModelCallbacks. + * @member {Array.} afterModelCallbacks + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.afterModelCallbacks = $util.emptyArray; + + /** + * Agent beforeToolCallbacks. + * @member {Array.} beforeToolCallbacks + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.beforeToolCallbacks = $util.emptyArray; + + /** + * Agent afterToolCallbacks. + * @member {Array.} afterToolCallbacks + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.afterToolCallbacks = $util.emptyArray; + + /** + * Agent createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.createTime = null; + + /** + * Agent updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.updateTime = null; + + /** + * Agent guardrails. + * @member {Array.} guardrails + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.guardrails = $util.emptyArray; + + /** + * Agent etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.etag = ""; + + /** + * Agent toolsets. + * @member {Array.} toolsets + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.toolsets = $util.emptyArray; + + /** + * Agent generatedSummary. + * @member {string} generatedSummary + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.generatedSummary = ""; + + /** + * Agent transferRules. + * @member {Array.} transferRules + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.transferRules = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Agent agentType. + * @member {"llmAgent"|"remoteDialogflowAgent"|undefined} agentType + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Object.defineProperty(Agent.prototype, "agentType", { + get: $util.oneOfGetter($oneOfFields = ["llmAgent", "remoteDialogflowAgent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Agent instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Agent + * @static + * @param {google.cloud.ces.v1beta.IAgent=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Agent} Agent instance + */ + Agent.create = function create(properties) { + return new Agent(properties); + }; + + /** + * Encodes the specified Agent message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Agent + * @static + * @param {google.cloud.ces.v1beta.IAgent} message Agent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Agent.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) + $root.google.cloud.ces.v1beta.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.instruction != null && Object.hasOwnProperty.call(message, "instruction")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.instruction); + if (message.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.tools[i]); + if (message.childAgents != null && message.childAgents.length) + for (var i = 0; i < message.childAgents.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.childAgents[i]); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.guardrails != null && message.guardrails.length) + for (var i = 0; i < message.guardrails.length; ++i) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.guardrails[i]); + if (message.beforeAgentCallbacks != null && message.beforeAgentCallbacks.length) + for (var i = 0; i < message.beforeAgentCallbacks.length; ++i) + $root.google.cloud.ces.v1beta.Callback.encode(message.beforeAgentCallbacks[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.afterAgentCallbacks != null && message.afterAgentCallbacks.length) + for (var i = 0; i < message.afterAgentCallbacks.length; ++i) + $root.google.cloud.ces.v1beta.Callback.encode(message.afterAgentCallbacks[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.beforeModelCallbacks != null && message.beforeModelCallbacks.length) + for (var i = 0; i < message.beforeModelCallbacks.length; ++i) + $root.google.cloud.ces.v1beta.Callback.encode(message.beforeModelCallbacks[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.afterModelCallbacks != null && message.afterModelCallbacks.length) + for (var i = 0; i < message.afterModelCallbacks.length; ++i) + $root.google.cloud.ces.v1beta.Callback.encode(message.afterModelCallbacks[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.beforeToolCallbacks != null && message.beforeToolCallbacks.length) + for (var i = 0; i < message.beforeToolCallbacks.length; ++i) + $root.google.cloud.ces.v1beta.Callback.encode(message.beforeToolCallbacks[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.afterToolCallbacks != null && message.afterToolCallbacks.length) + for (var i = 0; i < message.afterToolCallbacks.length; ++i) + $root.google.cloud.ces.v1beta.Callback.encode(message.afterToolCallbacks[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 24, wireType 2 =*/194).string(message.etag); + if (message.llmAgent != null && Object.hasOwnProperty.call(message, "llmAgent")) + $root.google.cloud.ces.v1beta.Agent.LlmAgent.encode(message.llmAgent, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.remoteDialogflowAgent != null && Object.hasOwnProperty.call(message, "remoteDialogflowAgent")) + $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.encode(message.remoteDialogflowAgent, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.toolsets != null && message.toolsets.length) + for (var i = 0; i < message.toolsets.length; ++i) + $root.google.cloud.ces.v1beta.Agent.AgentToolset.encode(message.toolsets[i], writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.generatedSummary != null && Object.hasOwnProperty.call(message, "generatedSummary")) + writer.uint32(/* id 29, wireType 2 =*/234).string(message.generatedSummary); + if (message.transferRules != null && message.transferRules.length) + for (var i = 0; i < message.transferRules.length; ++i) + $root.google.cloud.ces.v1beta.TransferRule.encode(message.transferRules[i], writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Agent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Agent + * @static + * @param {google.cloud.ces.v1beta.IAgent} message Agent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Agent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Agent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Agent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Agent} Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Agent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Agent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 26: { + message.llmAgent = $root.google.cloud.ces.v1beta.Agent.LlmAgent.decode(reader, reader.uint32()); + break; + } + case 27: { + message.remoteDialogflowAgent = $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.decode(reader, reader.uint32()); + break; + } + case 6: { + message.instruction = reader.string(); + break; + } + case 7: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push(reader.string()); + break; + } + case 8: { + if (!(message.childAgents && message.childAgents.length)) + message.childAgents = []; + message.childAgents.push(reader.string()); + break; + } + case 18: { + if (!(message.beforeAgentCallbacks && message.beforeAgentCallbacks.length)) + message.beforeAgentCallbacks = []; + message.beforeAgentCallbacks.push($root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32())); + break; + } + case 19: { + if (!(message.afterAgentCallbacks && message.afterAgentCallbacks.length)) + message.afterAgentCallbacks = []; + message.afterAgentCallbacks.push($root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32())); + break; + } + case 20: { + if (!(message.beforeModelCallbacks && message.beforeModelCallbacks.length)) + message.beforeModelCallbacks = []; + message.beforeModelCallbacks.push($root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32())); + break; + } + case 21: { + if (!(message.afterModelCallbacks && message.afterModelCallbacks.length)) + message.afterModelCallbacks = []; + message.afterModelCallbacks.push($root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32())); + break; + } + case 22: { + if (!(message.beforeToolCallbacks && message.beforeToolCallbacks.length)) + message.beforeToolCallbacks = []; + message.beforeToolCallbacks.push($root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32())); + break; + } + case 23: { + if (!(message.afterToolCallbacks && message.afterToolCallbacks.length)) + message.afterToolCallbacks = []; + message.afterToolCallbacks.push($root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32())); + break; + } + case 15: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 16: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 17: { + if (!(message.guardrails && message.guardrails.length)) + message.guardrails = []; + message.guardrails.push(reader.string()); + break; + } + case 24: { + message.etag = reader.string(); + break; + } + case 28: { + if (!(message.toolsets && message.toolsets.length)) + message.toolsets = []; + message.toolsets.push($root.google.cloud.ces.v1beta.Agent.AgentToolset.decode(reader, reader.uint32())); + break; + } + case 29: { + message.generatedSummary = reader.string(); + break; + } + case 30: { + if (!(message.transferRules && message.transferRules.length)) + message.transferRules = []; + message.transferRules.push($root.google.cloud.ces.v1beta.TransferRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Agent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Agent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Agent} Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Agent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Agent message. + * @function verify + * @memberof google.cloud.ces.v1beta.Agent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Agent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.llmAgent != null && message.hasOwnProperty("llmAgent")) { + properties.agentType = 1; + { + var error = $root.google.cloud.ces.v1beta.Agent.LlmAgent.verify(message.llmAgent); + if (error) + return "llmAgent." + error; + } + } + if (message.remoteDialogflowAgent != null && message.hasOwnProperty("remoteDialogflowAgent")) { + if (properties.agentType === 1) + return "agentType: multiple values"; + properties.agentType = 1; + { + var error = $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.verify(message.remoteDialogflowAgent); + if (error) + return "remoteDialogflowAgent." + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { + var error = $root.google.cloud.ces.v1beta.ModelSettings.verify(message.modelSettings); + if (error) + return "modelSettings." + error; + } + if (message.instruction != null && message.hasOwnProperty("instruction")) + if (!$util.isString(message.instruction)) + return "instruction: string expected"; + if (message.tools != null && message.hasOwnProperty("tools")) { + if (!Array.isArray(message.tools)) + return "tools: array expected"; + for (var i = 0; i < message.tools.length; ++i) + if (!$util.isString(message.tools[i])) + return "tools: string[] expected"; + } + if (message.childAgents != null && message.hasOwnProperty("childAgents")) { + if (!Array.isArray(message.childAgents)) + return "childAgents: array expected"; + for (var i = 0; i < message.childAgents.length; ++i) + if (!$util.isString(message.childAgents[i])) + return "childAgents: string[] expected"; + } + if (message.beforeAgentCallbacks != null && message.hasOwnProperty("beforeAgentCallbacks")) { + if (!Array.isArray(message.beforeAgentCallbacks)) + return "beforeAgentCallbacks: array expected"; + for (var i = 0; i < message.beforeAgentCallbacks.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.beforeAgentCallbacks[i]); + if (error) + return "beforeAgentCallbacks." + error; + } + } + if (message.afterAgentCallbacks != null && message.hasOwnProperty("afterAgentCallbacks")) { + if (!Array.isArray(message.afterAgentCallbacks)) + return "afterAgentCallbacks: array expected"; + for (var i = 0; i < message.afterAgentCallbacks.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.afterAgentCallbacks[i]); + if (error) + return "afterAgentCallbacks." + error; + } + } + if (message.beforeModelCallbacks != null && message.hasOwnProperty("beforeModelCallbacks")) { + if (!Array.isArray(message.beforeModelCallbacks)) + return "beforeModelCallbacks: array expected"; + for (var i = 0; i < message.beforeModelCallbacks.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.beforeModelCallbacks[i]); + if (error) + return "beforeModelCallbacks." + error; + } + } + if (message.afterModelCallbacks != null && message.hasOwnProperty("afterModelCallbacks")) { + if (!Array.isArray(message.afterModelCallbacks)) + return "afterModelCallbacks: array expected"; + for (var i = 0; i < message.afterModelCallbacks.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.afterModelCallbacks[i]); + if (error) + return "afterModelCallbacks." + error; + } + } + if (message.beforeToolCallbacks != null && message.hasOwnProperty("beforeToolCallbacks")) { + if (!Array.isArray(message.beforeToolCallbacks)) + return "beforeToolCallbacks: array expected"; + for (var i = 0; i < message.beforeToolCallbacks.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.beforeToolCallbacks[i]); + if (error) + return "beforeToolCallbacks." + error; + } + } + if (message.afterToolCallbacks != null && message.hasOwnProperty("afterToolCallbacks")) { + if (!Array.isArray(message.afterToolCallbacks)) + return "afterToolCallbacks: array expected"; + for (var i = 0; i < message.afterToolCallbacks.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.afterToolCallbacks[i]); + if (error) + return "afterToolCallbacks." + error; + } + } + 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.guardrails != null && message.hasOwnProperty("guardrails")) { + if (!Array.isArray(message.guardrails)) + return "guardrails: array expected"; + for (var i = 0; i < message.guardrails.length; ++i) + if (!$util.isString(message.guardrails[i])) + return "guardrails: string[] expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.toolsets != null && message.hasOwnProperty("toolsets")) { + if (!Array.isArray(message.toolsets)) + return "toolsets: array expected"; + for (var i = 0; i < message.toolsets.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Agent.AgentToolset.verify(message.toolsets[i]); + if (error) + return "toolsets." + error; + } + } + if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) + if (!$util.isString(message.generatedSummary)) + return "generatedSummary: string expected"; + if (message.transferRules != null && message.hasOwnProperty("transferRules")) { + if (!Array.isArray(message.transferRules)) + return "transferRules: array expected"; + for (var i = 0; i < message.transferRules.length; ++i) { + var error = $root.google.cloud.ces.v1beta.TransferRule.verify(message.transferRules[i]); + if (error) + return "transferRules." + error; + } + } + return null; + }; + + /** + * Creates an Agent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Agent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Agent} Agent + */ + Agent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Agent) + return object; + var message = new $root.google.cloud.ces.v1beta.Agent(); + if (object.llmAgent != null) { + if (typeof object.llmAgent !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.llmAgent: object expected"); + message.llmAgent = $root.google.cloud.ces.v1beta.Agent.LlmAgent.fromObject(object.llmAgent); + } + if (object.remoteDialogflowAgent != null) { + if (typeof object.remoteDialogflowAgent !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.remoteDialogflowAgent: object expected"); + message.remoteDialogflowAgent = $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.fromObject(object.remoteDialogflowAgent); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.modelSettings != null) { + if (typeof object.modelSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.modelSettings: object expected"); + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.fromObject(object.modelSettings); + } + if (object.instruction != null) + message.instruction = String(object.instruction); + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.cloud.ces.v1beta.Agent.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) + message.tools[i] = String(object.tools[i]); + } + if (object.childAgents) { + if (!Array.isArray(object.childAgents)) + throw TypeError(".google.cloud.ces.v1beta.Agent.childAgents: array expected"); + message.childAgents = []; + for (var i = 0; i < object.childAgents.length; ++i) + message.childAgents[i] = String(object.childAgents[i]); + } + if (object.beforeAgentCallbacks) { + if (!Array.isArray(object.beforeAgentCallbacks)) + throw TypeError(".google.cloud.ces.v1beta.Agent.beforeAgentCallbacks: array expected"); + message.beforeAgentCallbacks = []; + for (var i = 0; i < object.beforeAgentCallbacks.length; ++i) { + if (typeof object.beforeAgentCallbacks[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.beforeAgentCallbacks: object expected"); + message.beforeAgentCallbacks[i] = $root.google.cloud.ces.v1beta.Callback.fromObject(object.beforeAgentCallbacks[i]); + } + } + if (object.afterAgentCallbacks) { + if (!Array.isArray(object.afterAgentCallbacks)) + throw TypeError(".google.cloud.ces.v1beta.Agent.afterAgentCallbacks: array expected"); + message.afterAgentCallbacks = []; + for (var i = 0; i < object.afterAgentCallbacks.length; ++i) { + if (typeof object.afterAgentCallbacks[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.afterAgentCallbacks: object expected"); + message.afterAgentCallbacks[i] = $root.google.cloud.ces.v1beta.Callback.fromObject(object.afterAgentCallbacks[i]); + } + } + if (object.beforeModelCallbacks) { + if (!Array.isArray(object.beforeModelCallbacks)) + throw TypeError(".google.cloud.ces.v1beta.Agent.beforeModelCallbacks: array expected"); + message.beforeModelCallbacks = []; + for (var i = 0; i < object.beforeModelCallbacks.length; ++i) { + if (typeof object.beforeModelCallbacks[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.beforeModelCallbacks: object expected"); + message.beforeModelCallbacks[i] = $root.google.cloud.ces.v1beta.Callback.fromObject(object.beforeModelCallbacks[i]); + } + } + if (object.afterModelCallbacks) { + if (!Array.isArray(object.afterModelCallbacks)) + throw TypeError(".google.cloud.ces.v1beta.Agent.afterModelCallbacks: array expected"); + message.afterModelCallbacks = []; + for (var i = 0; i < object.afterModelCallbacks.length; ++i) { + if (typeof object.afterModelCallbacks[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.afterModelCallbacks: object expected"); + message.afterModelCallbacks[i] = $root.google.cloud.ces.v1beta.Callback.fromObject(object.afterModelCallbacks[i]); + } + } + if (object.beforeToolCallbacks) { + if (!Array.isArray(object.beforeToolCallbacks)) + throw TypeError(".google.cloud.ces.v1beta.Agent.beforeToolCallbacks: array expected"); + message.beforeToolCallbacks = []; + for (var i = 0; i < object.beforeToolCallbacks.length; ++i) { + if (typeof object.beforeToolCallbacks[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.beforeToolCallbacks: object expected"); + message.beforeToolCallbacks[i] = $root.google.cloud.ces.v1beta.Callback.fromObject(object.beforeToolCallbacks[i]); + } + } + if (object.afterToolCallbacks) { + if (!Array.isArray(object.afterToolCallbacks)) + throw TypeError(".google.cloud.ces.v1beta.Agent.afterToolCallbacks: array expected"); + message.afterToolCallbacks = []; + for (var i = 0; i < object.afterToolCallbacks.length; ++i) { + if (typeof object.afterToolCallbacks[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.afterToolCallbacks: object expected"); + message.afterToolCallbacks[i] = $root.google.cloud.ces.v1beta.Callback.fromObject(object.afterToolCallbacks[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.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.ces.v1beta.Agent.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.guardrails) { + if (!Array.isArray(object.guardrails)) + throw TypeError(".google.cloud.ces.v1beta.Agent.guardrails: array expected"); + message.guardrails = []; + for (var i = 0; i < object.guardrails.length; ++i) + message.guardrails[i] = String(object.guardrails[i]); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.toolsets) { + if (!Array.isArray(object.toolsets)) + throw TypeError(".google.cloud.ces.v1beta.Agent.toolsets: array expected"); + message.toolsets = []; + for (var i = 0; i < object.toolsets.length; ++i) { + if (typeof object.toolsets[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.toolsets: object expected"); + message.toolsets[i] = $root.google.cloud.ces.v1beta.Agent.AgentToolset.fromObject(object.toolsets[i]); + } + } + if (object.generatedSummary != null) + message.generatedSummary = String(object.generatedSummary); + if (object.transferRules) { + if (!Array.isArray(object.transferRules)) + throw TypeError(".google.cloud.ces.v1beta.Agent.transferRules: array expected"); + message.transferRules = []; + for (var i = 0; i < object.transferRules.length; ++i) { + if (typeof object.transferRules[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.transferRules: object expected"); + message.transferRules[i] = $root.google.cloud.ces.v1beta.TransferRule.fromObject(object.transferRules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Agent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Agent + * @static + * @param {google.cloud.ces.v1beta.Agent} message Agent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Agent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tools = []; + object.childAgents = []; + object.guardrails = []; + object.beforeAgentCallbacks = []; + object.afterAgentCallbacks = []; + object.beforeModelCallbacks = []; + object.afterModelCallbacks = []; + object.beforeToolCallbacks = []; + object.afterToolCallbacks = []; + object.toolsets = []; + object.transferRules = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.modelSettings = null; + object.instruction = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.generatedSummary = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) + object.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.toObject(message.modelSettings, options); + if (message.instruction != null && message.hasOwnProperty("instruction")) + object.instruction = message.instruction; + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = message.tools[j]; + } + if (message.childAgents && message.childAgents.length) { + object.childAgents = []; + for (var j = 0; j < message.childAgents.length; ++j) + object.childAgents[j] = message.childAgents[j]; + } + 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.guardrails && message.guardrails.length) { + object.guardrails = []; + for (var j = 0; j < message.guardrails.length; ++j) + object.guardrails[j] = message.guardrails[j]; + } + if (message.beforeAgentCallbacks && message.beforeAgentCallbacks.length) { + object.beforeAgentCallbacks = []; + for (var j = 0; j < message.beforeAgentCallbacks.length; ++j) + object.beforeAgentCallbacks[j] = $root.google.cloud.ces.v1beta.Callback.toObject(message.beforeAgentCallbacks[j], options); + } + if (message.afterAgentCallbacks && message.afterAgentCallbacks.length) { + object.afterAgentCallbacks = []; + for (var j = 0; j < message.afterAgentCallbacks.length; ++j) + object.afterAgentCallbacks[j] = $root.google.cloud.ces.v1beta.Callback.toObject(message.afterAgentCallbacks[j], options); + } + if (message.beforeModelCallbacks && message.beforeModelCallbacks.length) { + object.beforeModelCallbacks = []; + for (var j = 0; j < message.beforeModelCallbacks.length; ++j) + object.beforeModelCallbacks[j] = $root.google.cloud.ces.v1beta.Callback.toObject(message.beforeModelCallbacks[j], options); + } + if (message.afterModelCallbacks && message.afterModelCallbacks.length) { + object.afterModelCallbacks = []; + for (var j = 0; j < message.afterModelCallbacks.length; ++j) + object.afterModelCallbacks[j] = $root.google.cloud.ces.v1beta.Callback.toObject(message.afterModelCallbacks[j], options); + } + if (message.beforeToolCallbacks && message.beforeToolCallbacks.length) { + object.beforeToolCallbacks = []; + for (var j = 0; j < message.beforeToolCallbacks.length; ++j) + object.beforeToolCallbacks[j] = $root.google.cloud.ces.v1beta.Callback.toObject(message.beforeToolCallbacks[j], options); + } + if (message.afterToolCallbacks && message.afterToolCallbacks.length) { + object.afterToolCallbacks = []; + for (var j = 0; j < message.afterToolCallbacks.length; ++j) + object.afterToolCallbacks[j] = $root.google.cloud.ces.v1beta.Callback.toObject(message.afterToolCallbacks[j], options); + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.llmAgent != null && message.hasOwnProperty("llmAgent")) { + object.llmAgent = $root.google.cloud.ces.v1beta.Agent.LlmAgent.toObject(message.llmAgent, options); + if (options.oneofs) + object.agentType = "llmAgent"; + } + if (message.remoteDialogflowAgent != null && message.hasOwnProperty("remoteDialogflowAgent")) { + object.remoteDialogflowAgent = $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.toObject(message.remoteDialogflowAgent, options); + if (options.oneofs) + object.agentType = "remoteDialogflowAgent"; + } + if (message.toolsets && message.toolsets.length) { + object.toolsets = []; + for (var j = 0; j < message.toolsets.length; ++j) + object.toolsets[j] = $root.google.cloud.ces.v1beta.Agent.AgentToolset.toObject(message.toolsets[j], options); + } + if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) + object.generatedSummary = message.generatedSummary; + if (message.transferRules && message.transferRules.length) { + object.transferRules = []; + for (var j = 0; j < message.transferRules.length; ++j) + object.transferRules[j] = $root.google.cloud.ces.v1beta.TransferRule.toObject(message.transferRules[j], options); + } + return object; + }; + + /** + * Converts this Agent to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Agent + * @instance + * @returns {Object.} JSON object + */ + Agent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Agent + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Agent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Agent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Agent"; + }; + + Agent.LlmAgent = (function() { + + /** + * Properties of a LlmAgent. + * @memberof google.cloud.ces.v1beta.Agent + * @interface ILlmAgent + */ + + /** + * Constructs a new LlmAgent. + * @memberof google.cloud.ces.v1beta.Agent + * @classdesc Represents a LlmAgent. + * @implements ILlmAgent + * @constructor + * @param {google.cloud.ces.v1beta.Agent.ILlmAgent=} [properties] Properties to set + */ + function LlmAgent(properties) { + if (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 LlmAgent instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @static + * @param {google.cloud.ces.v1beta.Agent.ILlmAgent=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Agent.LlmAgent} LlmAgent instance + */ + LlmAgent.create = function create(properties) { + return new LlmAgent(properties); + }; + + /** + * Encodes the specified LlmAgent message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.LlmAgent.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @static + * @param {google.cloud.ces.v1beta.Agent.ILlmAgent} message LlmAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmAgent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified LlmAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.LlmAgent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @static + * @param {google.cloud.ces.v1beta.Agent.ILlmAgent} message LlmAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmAgent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LlmAgent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Agent.LlmAgent} LlmAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmAgent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Agent.LlmAgent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LlmAgent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Agent.LlmAgent} LlmAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmAgent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LlmAgent message. + * @function verify + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LlmAgent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a LlmAgent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Agent.LlmAgent} LlmAgent + */ + LlmAgent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Agent.LlmAgent) + return object; + return new $root.google.cloud.ces.v1beta.Agent.LlmAgent(); + }; + + /** + * Creates a plain object from a LlmAgent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @static + * @param {google.cloud.ces.v1beta.Agent.LlmAgent} message LlmAgent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LlmAgent.toObject = function toObject() { + return {}; + }; + + /** + * Converts this LlmAgent to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @instance + * @returns {Object.} JSON object + */ + LlmAgent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LlmAgent + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LlmAgent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Agent.LlmAgent"; + }; + + return LlmAgent; + })(); + + Agent.RemoteDialogflowAgent = (function() { + + /** + * Properties of a RemoteDialogflowAgent. + * @memberof google.cloud.ces.v1beta.Agent + * @interface IRemoteDialogflowAgent + * @property {string|null} [agent] RemoteDialogflowAgent agent + * @property {string|null} [flowId] RemoteDialogflowAgent flowId + * @property {string|null} [environmentId] RemoteDialogflowAgent environmentId + * @property {Object.|null} [inputVariableMapping] RemoteDialogflowAgent inputVariableMapping + * @property {Object.|null} [outputVariableMapping] RemoteDialogflowAgent outputVariableMapping + * @property {boolean|null} [respectResponseInterruptionSettings] RemoteDialogflowAgent respectResponseInterruptionSettings + */ + + /** + * Constructs a new RemoteDialogflowAgent. + * @memberof google.cloud.ces.v1beta.Agent + * @classdesc Represents a RemoteDialogflowAgent. + * @implements IRemoteDialogflowAgent + * @constructor + * @param {google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent=} [properties] Properties to set + */ + function RemoteDialogflowAgent(properties) { + this.inputVariableMapping = {}; + this.outputVariableMapping = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoteDialogflowAgent agent. + * @member {string} agent + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @instance + */ + RemoteDialogflowAgent.prototype.agent = ""; + + /** + * RemoteDialogflowAgent flowId. + * @member {string} flowId + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @instance + */ + RemoteDialogflowAgent.prototype.flowId = ""; + + /** + * RemoteDialogflowAgent environmentId. + * @member {string} environmentId + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @instance + */ + RemoteDialogflowAgent.prototype.environmentId = ""; + + /** + * RemoteDialogflowAgent inputVariableMapping. + * @member {Object.} inputVariableMapping + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @instance + */ + RemoteDialogflowAgent.prototype.inputVariableMapping = $util.emptyObject; + + /** + * RemoteDialogflowAgent outputVariableMapping. + * @member {Object.} outputVariableMapping + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @instance + */ + RemoteDialogflowAgent.prototype.outputVariableMapping = $util.emptyObject; + + /** + * RemoteDialogflowAgent respectResponseInterruptionSettings. + * @member {boolean} respectResponseInterruptionSettings + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @instance + */ + RemoteDialogflowAgent.prototype.respectResponseInterruptionSettings = false; + + /** + * Creates a new RemoteDialogflowAgent instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @static + * @param {google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent instance + */ + RemoteDialogflowAgent.create = function create(properties) { + return new RemoteDialogflowAgent(properties); + }; + + /** + * Encodes the specified RemoteDialogflowAgent message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @static + * @param {google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent} message RemoteDialogflowAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoteDialogflowAgent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.agent); + if (message.flowId != null && Object.hasOwnProperty.call(message, "flowId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flowId); + if (message.environmentId != null && Object.hasOwnProperty.call(message, "environmentId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.environmentId); + if (message.inputVariableMapping != null && Object.hasOwnProperty.call(message, "inputVariableMapping")) + for (var keys = Object.keys(message.inputVariableMapping), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.inputVariableMapping[keys[i]]).ldelim(); + if (message.outputVariableMapping != null && Object.hasOwnProperty.call(message, "outputVariableMapping")) + for (var keys = Object.keys(message.outputVariableMapping), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.outputVariableMapping[keys[i]]).ldelim(); + if (message.respectResponseInterruptionSettings != null && Object.hasOwnProperty.call(message, "respectResponseInterruptionSettings")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.respectResponseInterruptionSettings); + return writer; + }; + + /** + * Encodes the specified RemoteDialogflowAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @static + * @param {google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent} message RemoteDialogflowAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoteDialogflowAgent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoteDialogflowAgent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoteDialogflowAgent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.agent = reader.string(); + break; + } + case 2: { + message.flowId = reader.string(); + break; + } + case 3: { + message.environmentId = reader.string(); + break; + } + case 4: { + if (message.inputVariableMapping === $util.emptyObject) + message.inputVariableMapping = {}; + 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.inputVariableMapping[key] = value; + break; + } + case 5: { + if (message.outputVariableMapping === $util.emptyObject) + message.outputVariableMapping = {}; + 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.outputVariableMapping[key] = value; + break; + } + case 6: { + message.respectResponseInterruptionSettings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoteDialogflowAgent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoteDialogflowAgent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoteDialogflowAgent message. + * @function verify + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoteDialogflowAgent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agent != null && message.hasOwnProperty("agent")) + if (!$util.isString(message.agent)) + return "agent: string expected"; + if (message.flowId != null && message.hasOwnProperty("flowId")) + if (!$util.isString(message.flowId)) + return "flowId: string expected"; + if (message.environmentId != null && message.hasOwnProperty("environmentId")) + if (!$util.isString(message.environmentId)) + return "environmentId: string expected"; + if (message.inputVariableMapping != null && message.hasOwnProperty("inputVariableMapping")) { + if (!$util.isObject(message.inputVariableMapping)) + return "inputVariableMapping: object expected"; + var key = Object.keys(message.inputVariableMapping); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.inputVariableMapping[key[i]])) + return "inputVariableMapping: string{k:string} expected"; + } + if (message.outputVariableMapping != null && message.hasOwnProperty("outputVariableMapping")) { + if (!$util.isObject(message.outputVariableMapping)) + return "outputVariableMapping: object expected"; + var key = Object.keys(message.outputVariableMapping); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.outputVariableMapping[key[i]])) + return "outputVariableMapping: string{k:string} expected"; + } + if (message.respectResponseInterruptionSettings != null && message.hasOwnProperty("respectResponseInterruptionSettings")) + if (typeof message.respectResponseInterruptionSettings !== "boolean") + return "respectResponseInterruptionSettings: boolean expected"; + return null; + }; + + /** + * Creates a RemoteDialogflowAgent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent + */ + RemoteDialogflowAgent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent) + return object; + var message = new $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent(); + if (object.agent != null) + message.agent = String(object.agent); + if (object.flowId != null) + message.flowId = String(object.flowId); + if (object.environmentId != null) + message.environmentId = String(object.environmentId); + if (object.inputVariableMapping) { + if (typeof object.inputVariableMapping !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.inputVariableMapping: object expected"); + message.inputVariableMapping = {}; + for (var keys = Object.keys(object.inputVariableMapping), i = 0; i < keys.length; ++i) + message.inputVariableMapping[keys[i]] = String(object.inputVariableMapping[keys[i]]); + } + if (object.outputVariableMapping) { + if (typeof object.outputVariableMapping !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.outputVariableMapping: object expected"); + message.outputVariableMapping = {}; + for (var keys = Object.keys(object.outputVariableMapping), i = 0; i < keys.length; ++i) + message.outputVariableMapping[keys[i]] = String(object.outputVariableMapping[keys[i]]); + } + if (object.respectResponseInterruptionSettings != null) + message.respectResponseInterruptionSettings = Boolean(object.respectResponseInterruptionSettings); + return message; + }; + + /** + * Creates a plain object from a RemoteDialogflowAgent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @static + * @param {google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent} message RemoteDialogflowAgent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoteDialogflowAgent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.inputVariableMapping = {}; + object.outputVariableMapping = {}; + } + if (options.defaults) { + object.agent = ""; + object.flowId = ""; + object.environmentId = ""; + object.respectResponseInterruptionSettings = false; + } + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = message.agent; + if (message.flowId != null && message.hasOwnProperty("flowId")) + object.flowId = message.flowId; + if (message.environmentId != null && message.hasOwnProperty("environmentId")) + object.environmentId = message.environmentId; + var keys2; + if (message.inputVariableMapping && (keys2 = Object.keys(message.inputVariableMapping)).length) { + object.inputVariableMapping = {}; + for (var j = 0; j < keys2.length; ++j) + object.inputVariableMapping[keys2[j]] = message.inputVariableMapping[keys2[j]]; + } + if (message.outputVariableMapping && (keys2 = Object.keys(message.outputVariableMapping)).length) { + object.outputVariableMapping = {}; + for (var j = 0; j < keys2.length; ++j) + object.outputVariableMapping[keys2[j]] = message.outputVariableMapping[keys2[j]]; + } + if (message.respectResponseInterruptionSettings != null && message.hasOwnProperty("respectResponseInterruptionSettings")) + object.respectResponseInterruptionSettings = message.respectResponseInterruptionSettings; + return object; + }; + + /** + * Converts this RemoteDialogflowAgent to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @instance + * @returns {Object.} JSON object + */ + RemoteDialogflowAgent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemoteDialogflowAgent + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoteDialogflowAgent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent"; + }; + + return RemoteDialogflowAgent; + })(); + + Agent.AgentToolset = (function() { + + /** + * Properties of an AgentToolset. + * @memberof google.cloud.ces.v1beta.Agent + * @interface IAgentToolset + * @property {string|null} [toolset] AgentToolset toolset + * @property {Array.|null} [toolIds] AgentToolset toolIds + */ + + /** + * Constructs a new AgentToolset. + * @memberof google.cloud.ces.v1beta.Agent + * @classdesc Represents an AgentToolset. + * @implements IAgentToolset + * @constructor + * @param {google.cloud.ces.v1beta.Agent.IAgentToolset=} [properties] Properties to set + */ + function AgentToolset(properties) { + this.toolIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AgentToolset toolset. + * @member {string} toolset + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @instance + */ + AgentToolset.prototype.toolset = ""; + + /** + * AgentToolset toolIds. + * @member {Array.} toolIds + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @instance + */ + AgentToolset.prototype.toolIds = $util.emptyArray; + + /** + * Creates a new AgentToolset instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @static + * @param {google.cloud.ces.v1beta.Agent.IAgentToolset=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Agent.AgentToolset} AgentToolset instance + */ + AgentToolset.create = function create(properties) { + return new AgentToolset(properties); + }; + + /** + * Encodes the specified AgentToolset message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.AgentToolset.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @static + * @param {google.cloud.ces.v1beta.Agent.IAgentToolset} message AgentToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentToolset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.toolset); + if (message.toolIds != null && message.toolIds.length) + for (var i = 0; i < message.toolIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.toolIds[i]); + return writer; + }; + + /** + * Encodes the specified AgentToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.AgentToolset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @static + * @param {google.cloud.ces.v1beta.Agent.IAgentToolset} message AgentToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentToolset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AgentToolset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Agent.AgentToolset} AgentToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentToolset.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Agent.AgentToolset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolset = reader.string(); + break; + } + case 4: { + if (!(message.toolIds && message.toolIds.length)) + message.toolIds = []; + message.toolIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AgentToolset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Agent.AgentToolset} AgentToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentToolset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AgentToolset message. + * @function verify + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AgentToolset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolset != null && message.hasOwnProperty("toolset")) + if (!$util.isString(message.toolset)) + return "toolset: string expected"; + if (message.toolIds != null && message.hasOwnProperty("toolIds")) { + if (!Array.isArray(message.toolIds)) + return "toolIds: array expected"; + for (var i = 0; i < message.toolIds.length; ++i) + if (!$util.isString(message.toolIds[i])) + return "toolIds: string[] expected"; + } + return null; + }; + + /** + * Creates an AgentToolset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Agent.AgentToolset} AgentToolset + */ + AgentToolset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Agent.AgentToolset) + return object; + var message = new $root.google.cloud.ces.v1beta.Agent.AgentToolset(); + if (object.toolset != null) + message.toolset = String(object.toolset); + if (object.toolIds) { + if (!Array.isArray(object.toolIds)) + throw TypeError(".google.cloud.ces.v1beta.Agent.AgentToolset.toolIds: array expected"); + message.toolIds = []; + for (var i = 0; i < object.toolIds.length; ++i) + message.toolIds[i] = String(object.toolIds[i]); + } + return message; + }; + + /** + * Creates a plain object from an AgentToolset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @static + * @param {google.cloud.ces.v1beta.Agent.AgentToolset} message AgentToolset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AgentToolset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.toolIds = []; + if (options.defaults) + object.toolset = ""; + if (message.toolset != null && message.hasOwnProperty("toolset")) + object.toolset = message.toolset; + if (message.toolIds && message.toolIds.length) { + object.toolIds = []; + for (var j = 0; j < message.toolIds.length; ++j) + object.toolIds[j] = message.toolIds[j]; + } + return object; + }; + + /** + * Converts this AgentToolset to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @instance + * @returns {Object.} JSON object + */ + AgentToolset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AgentToolset + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AgentToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Agent.AgentToolset"; + }; + + return AgentToolset; + })(); + + return Agent; + })(); + + v1beta.ExpressionCondition = (function() { + + /** + * Properties of an ExpressionCondition. + * @memberof google.cloud.ces.v1beta + * @interface IExpressionCondition + * @property {string|null} [expression] ExpressionCondition expression + */ + + /** + * Constructs a new ExpressionCondition. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ExpressionCondition. + * @implements IExpressionCondition + * @constructor + * @param {google.cloud.ces.v1beta.IExpressionCondition=} [properties] Properties to set + */ + function ExpressionCondition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExpressionCondition expression. + * @member {string} expression + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @instance + */ + ExpressionCondition.prototype.expression = ""; + + /** + * Creates a new ExpressionCondition instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @static + * @param {google.cloud.ces.v1beta.IExpressionCondition=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ExpressionCondition} ExpressionCondition instance + */ + ExpressionCondition.create = function create(properties) { + return new ExpressionCondition(properties); + }; + + /** + * Encodes the specified ExpressionCondition message. Does not implicitly {@link google.cloud.ces.v1beta.ExpressionCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @static + * @param {google.cloud.ces.v1beta.IExpressionCondition} message ExpressionCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpressionCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + return writer; + }; + + /** + * Encodes the specified ExpressionCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExpressionCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @static + * @param {google.cloud.ces.v1beta.IExpressionCondition} message ExpressionCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpressionCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExpressionCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ExpressionCondition} ExpressionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpressionCondition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ExpressionCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExpressionCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ExpressionCondition} ExpressionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpressionCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExpressionCondition message. + * @function verify + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExpressionCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + return null; + }; + + /** + * Creates an ExpressionCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ExpressionCondition} ExpressionCondition + */ + ExpressionCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ExpressionCondition) + return object; + var message = new $root.google.cloud.ces.v1beta.ExpressionCondition(); + if (object.expression != null) + message.expression = String(object.expression); + return message; + }; + + /** + * Creates a plain object from an ExpressionCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @static + * @param {google.cloud.ces.v1beta.ExpressionCondition} message ExpressionCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExpressionCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.expression = ""; + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + return object; + }; + + /** + * Converts this ExpressionCondition to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @instance + * @returns {Object.} JSON object + */ + ExpressionCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExpressionCondition + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExpressionCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ExpressionCondition"; + }; + + return ExpressionCondition; + })(); + + v1beta.PythonCodeCondition = (function() { + + /** + * Properties of a PythonCodeCondition. + * @memberof google.cloud.ces.v1beta + * @interface IPythonCodeCondition + * @property {string|null} [pythonCode] PythonCodeCondition pythonCode + */ + + /** + * Constructs a new PythonCodeCondition. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a PythonCodeCondition. + * @implements IPythonCodeCondition + * @constructor + * @param {google.cloud.ces.v1beta.IPythonCodeCondition=} [properties] Properties to set + */ + function PythonCodeCondition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonCodeCondition pythonCode. + * @member {string} pythonCode + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @instance + */ + PythonCodeCondition.prototype.pythonCode = ""; + + /** + * Creates a new PythonCodeCondition instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @static + * @param {google.cloud.ces.v1beta.IPythonCodeCondition=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.PythonCodeCondition} PythonCodeCondition instance + */ + PythonCodeCondition.create = function create(properties) { + return new PythonCodeCondition(properties); + }; + + /** + * Encodes the specified PythonCodeCondition message. Does not implicitly {@link google.cloud.ces.v1beta.PythonCodeCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @static + * @param {google.cloud.ces.v1beta.IPythonCodeCondition} message PythonCodeCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonCodeCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pythonCode); + return writer; + }; + + /** + * Encodes the specified PythonCodeCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.PythonCodeCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @static + * @param {google.cloud.ces.v1beta.IPythonCodeCondition} message PythonCodeCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonCodeCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonCodeCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.PythonCodeCondition} PythonCodeCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonCodeCondition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.PythonCodeCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pythonCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonCodeCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.PythonCodeCondition} PythonCodeCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonCodeCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonCodeCondition message. + * @function verify + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonCodeCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) + if (!$util.isString(message.pythonCode)) + return "pythonCode: string expected"; + return null; + }; + + /** + * Creates a PythonCodeCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.PythonCodeCondition} PythonCodeCondition + */ + PythonCodeCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.PythonCodeCondition) + return object; + var message = new $root.google.cloud.ces.v1beta.PythonCodeCondition(); + if (object.pythonCode != null) + message.pythonCode = String(object.pythonCode); + return message; + }; + + /** + * Creates a plain object from a PythonCodeCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @static + * @param {google.cloud.ces.v1beta.PythonCodeCondition} message PythonCodeCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonCodeCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.pythonCode = ""; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) + object.pythonCode = message.pythonCode; + return object; + }; + + /** + * Converts this PythonCodeCondition to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @instance + * @returns {Object.} JSON object + */ + PythonCodeCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonCodeCondition + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonCodeCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.PythonCodeCondition"; + }; + + return PythonCodeCondition; + })(); + + v1beta.TransferRule = (function() { + + /** + * Properties of a TransferRule. + * @memberof google.cloud.ces.v1beta + * @interface ITransferRule + * @property {google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer|null} [deterministicTransfer] TransferRule deterministicTransfer + * @property {google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer|null} [disablePlannerTransfer] TransferRule disablePlannerTransfer + * @property {string|null} [childAgent] TransferRule childAgent + * @property {google.cloud.ces.v1beta.TransferRule.Direction|null} [direction] TransferRule direction + */ + + /** + * Constructs a new TransferRule. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a TransferRule. + * @implements ITransferRule + * @constructor + * @param {google.cloud.ces.v1beta.ITransferRule=} [properties] Properties to set + */ + function TransferRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferRule deterministicTransfer. + * @member {google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer|null|undefined} deterministicTransfer + * @memberof google.cloud.ces.v1beta.TransferRule + * @instance + */ + TransferRule.prototype.deterministicTransfer = null; + + /** + * TransferRule disablePlannerTransfer. + * @member {google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer|null|undefined} disablePlannerTransfer + * @memberof google.cloud.ces.v1beta.TransferRule + * @instance + */ + TransferRule.prototype.disablePlannerTransfer = null; + + /** + * TransferRule childAgent. + * @member {string} childAgent + * @memberof google.cloud.ces.v1beta.TransferRule + * @instance + */ + TransferRule.prototype.childAgent = ""; + + /** + * TransferRule direction. + * @member {google.cloud.ces.v1beta.TransferRule.Direction} direction + * @memberof google.cloud.ces.v1beta.TransferRule + * @instance + */ + TransferRule.prototype.direction = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransferRule ruleType. + * @member {"deterministicTransfer"|"disablePlannerTransfer"|undefined} ruleType + * @memberof google.cloud.ces.v1beta.TransferRule + * @instance + */ + Object.defineProperty(TransferRule.prototype, "ruleType", { + get: $util.oneOfGetter($oneOfFields = ["deterministicTransfer", "disablePlannerTransfer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransferRule instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TransferRule + * @static + * @param {google.cloud.ces.v1beta.ITransferRule=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TransferRule} TransferRule instance + */ + TransferRule.create = function create(properties) { + return new TransferRule(properties); + }; + + /** + * Encodes the specified TransferRule message. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TransferRule + * @static + * @param {google.cloud.ces.v1beta.ITransferRule} message TransferRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.childAgent != null && Object.hasOwnProperty.call(message, "childAgent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.childAgent); + if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.direction); + if (message.deterministicTransfer != null && Object.hasOwnProperty.call(message, "deterministicTransfer")) + $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.encode(message.deterministicTransfer, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.disablePlannerTransfer != null && Object.hasOwnProperty.call(message, "disablePlannerTransfer")) + $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.encode(message.disablePlannerTransfer, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransferRule message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TransferRule + * @static + * @param {google.cloud.ces.v1beta.ITransferRule} message TransferRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TransferRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TransferRule} TransferRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TransferRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.deterministicTransfer = $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.decode(reader, reader.uint32()); + break; + } + case 4: { + message.disablePlannerTransfer = $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.decode(reader, reader.uint32()); + break; + } + case 1: { + message.childAgent = reader.string(); + break; + } + case 2: { + message.direction = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TransferRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TransferRule} TransferRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferRule message. + * @function verify + * @memberof google.cloud.ces.v1beta.TransferRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.deterministicTransfer != null && message.hasOwnProperty("deterministicTransfer")) { + properties.ruleType = 1; + { + var error = $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.verify(message.deterministicTransfer); + if (error) + return "deterministicTransfer." + error; + } + } + if (message.disablePlannerTransfer != null && message.hasOwnProperty("disablePlannerTransfer")) { + if (properties.ruleType === 1) + return "ruleType: multiple values"; + properties.ruleType = 1; + { + var error = $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.verify(message.disablePlannerTransfer); + if (error) + return "disablePlannerTransfer." + error; + } + } + if (message.childAgent != null && message.hasOwnProperty("childAgent")) + if (!$util.isString(message.childAgent)) + return "childAgent: string expected"; + if (message.direction != null && message.hasOwnProperty("direction")) + switch (message.direction) { + default: + return "direction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TransferRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TransferRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TransferRule} TransferRule + */ + TransferRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TransferRule) + return object; + var message = new $root.google.cloud.ces.v1beta.TransferRule(); + if (object.deterministicTransfer != null) { + if (typeof object.deterministicTransfer !== "object") + throw TypeError(".google.cloud.ces.v1beta.TransferRule.deterministicTransfer: object expected"); + message.deterministicTransfer = $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.fromObject(object.deterministicTransfer); + } + if (object.disablePlannerTransfer != null) { + if (typeof object.disablePlannerTransfer !== "object") + throw TypeError(".google.cloud.ces.v1beta.TransferRule.disablePlannerTransfer: object expected"); + message.disablePlannerTransfer = $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.fromObject(object.disablePlannerTransfer); + } + if (object.childAgent != null) + message.childAgent = String(object.childAgent); + switch (object.direction) { + default: + if (typeof object.direction === "number") { + message.direction = object.direction; + break; + } + break; + case "DIRECTION_UNSPECIFIED": + case 0: + message.direction = 0; + break; + case "PARENT_TO_CHILD": + case 1: + message.direction = 1; + break; + case "CHILD_TO_PARENT": + case 2: + message.direction = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TransferRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TransferRule + * @static + * @param {google.cloud.ces.v1beta.TransferRule} message TransferRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.childAgent = ""; + object.direction = options.enums === String ? "DIRECTION_UNSPECIFIED" : 0; + } + if (message.childAgent != null && message.hasOwnProperty("childAgent")) + object.childAgent = message.childAgent; + if (message.direction != null && message.hasOwnProperty("direction")) + object.direction = options.enums === String ? $root.google.cloud.ces.v1beta.TransferRule.Direction[message.direction] === undefined ? message.direction : $root.google.cloud.ces.v1beta.TransferRule.Direction[message.direction] : message.direction; + if (message.deterministicTransfer != null && message.hasOwnProperty("deterministicTransfer")) { + object.deterministicTransfer = $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.toObject(message.deterministicTransfer, options); + if (options.oneofs) + object.ruleType = "deterministicTransfer"; + } + if (message.disablePlannerTransfer != null && message.hasOwnProperty("disablePlannerTransfer")) { + object.disablePlannerTransfer = $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.toObject(message.disablePlannerTransfer, options); + if (options.oneofs) + object.ruleType = "disablePlannerTransfer"; + } + return object; + }; + + /** + * Converts this TransferRule to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TransferRule + * @instance + * @returns {Object.} JSON object + */ + TransferRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferRule + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TransferRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TransferRule"; + }; + + TransferRule.DeterministicTransfer = (function() { + + /** + * Properties of a DeterministicTransfer. + * @memberof google.cloud.ces.v1beta.TransferRule + * @interface IDeterministicTransfer + * @property {google.cloud.ces.v1beta.IExpressionCondition|null} [expressionCondition] DeterministicTransfer expressionCondition + * @property {google.cloud.ces.v1beta.IPythonCodeCondition|null} [pythonCodeCondition] DeterministicTransfer pythonCodeCondition + */ + + /** + * Constructs a new DeterministicTransfer. + * @memberof google.cloud.ces.v1beta.TransferRule + * @classdesc Represents a DeterministicTransfer. + * @implements IDeterministicTransfer + * @constructor + * @param {google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer=} [properties] Properties to set + */ + function DeterministicTransfer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeterministicTransfer expressionCondition. + * @member {google.cloud.ces.v1beta.IExpressionCondition|null|undefined} expressionCondition + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @instance + */ + DeterministicTransfer.prototype.expressionCondition = null; + + /** + * DeterministicTransfer pythonCodeCondition. + * @member {google.cloud.ces.v1beta.IPythonCodeCondition|null|undefined} pythonCodeCondition + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @instance + */ + DeterministicTransfer.prototype.pythonCodeCondition = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeterministicTransfer conditionType. + * @member {"expressionCondition"|"pythonCodeCondition"|undefined} conditionType + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @instance + */ + Object.defineProperty(DeterministicTransfer.prototype, "conditionType", { + get: $util.oneOfGetter($oneOfFields = ["expressionCondition", "pythonCodeCondition"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeterministicTransfer instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @static + * @param {google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TransferRule.DeterministicTransfer} DeterministicTransfer instance + */ + DeterministicTransfer.create = function create(properties) { + return new DeterministicTransfer(properties); + }; + + /** + * Encodes the specified DeterministicTransfer message. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @static + * @param {google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer} message DeterministicTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeterministicTransfer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expressionCondition != null && Object.hasOwnProperty.call(message, "expressionCondition")) + $root.google.cloud.ces.v1beta.ExpressionCondition.encode(message.expressionCondition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pythonCodeCondition != null && Object.hasOwnProperty.call(message, "pythonCodeCondition")) + $root.google.cloud.ces.v1beta.PythonCodeCondition.encode(message.pythonCodeCondition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeterministicTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @static + * @param {google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer} message DeterministicTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeterministicTransfer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeterministicTransfer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TransferRule.DeterministicTransfer} DeterministicTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeterministicTransfer.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expressionCondition = $root.google.cloud.ces.v1beta.ExpressionCondition.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pythonCodeCondition = $root.google.cloud.ces.v1beta.PythonCodeCondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeterministicTransfer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TransferRule.DeterministicTransfer} DeterministicTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeterministicTransfer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeterministicTransfer message. + * @function verify + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeterministicTransfer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) { + properties.conditionType = 1; + { + var error = $root.google.cloud.ces.v1beta.ExpressionCondition.verify(message.expressionCondition); + if (error) + return "expressionCondition." + error; + } + } + if (message.pythonCodeCondition != null && message.hasOwnProperty("pythonCodeCondition")) { + if (properties.conditionType === 1) + return "conditionType: multiple values"; + properties.conditionType = 1; + { + var error = $root.google.cloud.ces.v1beta.PythonCodeCondition.verify(message.pythonCodeCondition); + if (error) + return "pythonCodeCondition." + error; + } + } + return null; + }; + + /** + * Creates a DeterministicTransfer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TransferRule.DeterministicTransfer} DeterministicTransfer + */ + DeterministicTransfer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer) + return object; + var message = new $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer(); + if (object.expressionCondition != null) { + if (typeof object.expressionCondition !== "object") + throw TypeError(".google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.expressionCondition: object expected"); + message.expressionCondition = $root.google.cloud.ces.v1beta.ExpressionCondition.fromObject(object.expressionCondition); + } + if (object.pythonCodeCondition != null) { + if (typeof object.pythonCodeCondition !== "object") + throw TypeError(".google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.pythonCodeCondition: object expected"); + message.pythonCodeCondition = $root.google.cloud.ces.v1beta.PythonCodeCondition.fromObject(object.pythonCodeCondition); + } + return message; + }; + + /** + * Creates a plain object from a DeterministicTransfer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @static + * @param {google.cloud.ces.v1beta.TransferRule.DeterministicTransfer} message DeterministicTransfer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeterministicTransfer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) { + object.expressionCondition = $root.google.cloud.ces.v1beta.ExpressionCondition.toObject(message.expressionCondition, options); + if (options.oneofs) + object.conditionType = "expressionCondition"; + } + if (message.pythonCodeCondition != null && message.hasOwnProperty("pythonCodeCondition")) { + object.pythonCodeCondition = $root.google.cloud.ces.v1beta.PythonCodeCondition.toObject(message.pythonCodeCondition, options); + if (options.oneofs) + object.conditionType = "pythonCodeCondition"; + } + return object; + }; + + /** + * Converts this DeterministicTransfer to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @instance + * @returns {Object.} JSON object + */ + DeterministicTransfer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeterministicTransfer + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeterministicTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TransferRule.DeterministicTransfer"; + }; + + return DeterministicTransfer; + })(); + + TransferRule.DisablePlannerTransfer = (function() { + + /** + * Properties of a DisablePlannerTransfer. + * @memberof google.cloud.ces.v1beta.TransferRule + * @interface IDisablePlannerTransfer + * @property {google.cloud.ces.v1beta.IExpressionCondition|null} [expressionCondition] DisablePlannerTransfer expressionCondition + */ + + /** + * Constructs a new DisablePlannerTransfer. + * @memberof google.cloud.ces.v1beta.TransferRule + * @classdesc Represents a DisablePlannerTransfer. + * @implements IDisablePlannerTransfer + * @constructor + * @param {google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer=} [properties] Properties to set + */ + function DisablePlannerTransfer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisablePlannerTransfer expressionCondition. + * @member {google.cloud.ces.v1beta.IExpressionCondition|null|undefined} expressionCondition + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @instance + */ + DisablePlannerTransfer.prototype.expressionCondition = null; + + /** + * Creates a new DisablePlannerTransfer instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @static + * @param {google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer instance + */ + DisablePlannerTransfer.create = function create(properties) { + return new DisablePlannerTransfer(properties); + }; + + /** + * Encodes the specified DisablePlannerTransfer message. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @static + * @param {google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer} message DisablePlannerTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisablePlannerTransfer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expressionCondition != null && Object.hasOwnProperty.call(message, "expressionCondition")) + $root.google.cloud.ces.v1beta.ExpressionCondition.encode(message.expressionCondition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DisablePlannerTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @static + * @param {google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer} message DisablePlannerTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisablePlannerTransfer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisablePlannerTransfer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisablePlannerTransfer.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expressionCondition = $root.google.cloud.ces.v1beta.ExpressionCondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisablePlannerTransfer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisablePlannerTransfer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisablePlannerTransfer message. + * @function verify + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisablePlannerTransfer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) { + var error = $root.google.cloud.ces.v1beta.ExpressionCondition.verify(message.expressionCondition); + if (error) + return "expressionCondition." + error; + } + return null; + }; + + /** + * Creates a DisablePlannerTransfer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer + */ + DisablePlannerTransfer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer) + return object; + var message = new $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer(); + if (object.expressionCondition != null) { + if (typeof object.expressionCondition !== "object") + throw TypeError(".google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.expressionCondition: object expected"); + message.expressionCondition = $root.google.cloud.ces.v1beta.ExpressionCondition.fromObject(object.expressionCondition); + } + return message; + }; + + /** + * Creates a plain object from a DisablePlannerTransfer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @static + * @param {google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer} message DisablePlannerTransfer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisablePlannerTransfer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.expressionCondition = null; + if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) + object.expressionCondition = $root.google.cloud.ces.v1beta.ExpressionCondition.toObject(message.expressionCondition, options); + return object; + }; + + /** + * Converts this DisablePlannerTransfer to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @instance + * @returns {Object.} JSON object + */ + DisablePlannerTransfer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisablePlannerTransfer + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisablePlannerTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer"; + }; + + return DisablePlannerTransfer; + })(); + + /** + * Direction enum. + * @name google.cloud.ces.v1beta.TransferRule.Direction + * @enum {number} + * @property {number} DIRECTION_UNSPECIFIED=0 DIRECTION_UNSPECIFIED value + * @property {number} PARENT_TO_CHILD=1 PARENT_TO_CHILD value + * @property {number} CHILD_TO_PARENT=2 CHILD_TO_PARENT value + */ + TransferRule.Direction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "PARENT_TO_CHILD"] = 1; + values[valuesById[2] = "CHILD_TO_PARENT"] = 2; + return values; + })(); + + return TransferRule; + })(); + + /** + * ExecutionType enum. + * @name google.cloud.ces.v1beta.ExecutionType + * @enum {number} + * @property {number} EXECUTION_TYPE_UNSPECIFIED=0 EXECUTION_TYPE_UNSPECIFIED value + * @property {number} SYNCHRONOUS=1 SYNCHRONOUS value + * @property {number} ASYNCHRONOUS=2 ASYNCHRONOUS value + */ + v1beta.ExecutionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXECUTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SYNCHRONOUS"] = 1; + values[valuesById[2] = "ASYNCHRONOUS"] = 2; + return values; + })(); + + v1beta.Callback = (function() { + + /** + * Properties of a Callback. + * @memberof google.cloud.ces.v1beta + * @interface ICallback + * @property {string|null} [pythonCode] Callback pythonCode + * @property {string|null} [description] Callback description + * @property {boolean|null} [disabled] Callback disabled + * @property {boolean|null} [proactiveExecutionEnabled] Callback proactiveExecutionEnabled + */ + + /** + * Constructs a new Callback. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Callback. + * @implements ICallback + * @constructor + * @param {google.cloud.ces.v1beta.ICallback=} [properties] Properties to set + */ + function Callback(properties) { + if (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 pythonCode. + * @member {string|null|undefined} pythonCode + * @memberof google.cloud.ces.v1beta.Callback + * @instance + */ + Callback.prototype.pythonCode = null; + + /** + * Callback description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.Callback + * @instance + */ + Callback.prototype.description = ""; + + /** + * Callback disabled. + * @member {boolean} disabled + * @memberof google.cloud.ces.v1beta.Callback + * @instance + */ + Callback.prototype.disabled = false; + + /** + * Callback proactiveExecutionEnabled. + * @member {boolean} proactiveExecutionEnabled + * @memberof google.cloud.ces.v1beta.Callback + * @instance + */ + Callback.prototype.proactiveExecutionEnabled = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Callback callback. + * @member {"pythonCode"|undefined} callback + * @memberof google.cloud.ces.v1beta.Callback + * @instance + */ + Object.defineProperty(Callback.prototype, "callback", { + get: $util.oneOfGetter($oneOfFields = ["pythonCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Callback instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Callback + * @static + * @param {google.cloud.ces.v1beta.ICallback=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Callback} Callback instance + */ + Callback.create = function create(properties) { + return new Callback(properties); + }; + + /** + * Encodes the specified Callback message. Does not implicitly {@link google.cloud.ces.v1beta.Callback.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Callback + * @static + * @param {google.cloud.ces.v1beta.ICallback} message Callback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Callback.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pythonCode); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.disabled); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.proactiveExecutionEnabled != null && Object.hasOwnProperty.call(message, "proactiveExecutionEnabled")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.proactiveExecutionEnabled); + return writer; + }; + + /** + * Encodes the specified Callback message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Callback.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Callback + * @static + * @param {google.cloud.ces.v1beta.ICallback} message Callback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Callback.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Callback message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Callback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Callback} Callback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Callback.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Callback(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pythonCode = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 2: { + message.disabled = reader.bool(); + break; + } + case 4: { + message.proactiveExecutionEnabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Callback message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Callback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Callback} Callback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Callback.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Callback message. + * @function verify + * @memberof google.cloud.ces.v1beta.Callback + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Callback.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) { + properties.callback = 1; + if (!$util.isString(message.pythonCode)) + return "pythonCode: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + if (message.proactiveExecutionEnabled != null && message.hasOwnProperty("proactiveExecutionEnabled")) + if (typeof message.proactiveExecutionEnabled !== "boolean") + return "proactiveExecutionEnabled: boolean expected"; + return null; + }; + + /** + * Creates a Callback message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Callback + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Callback} Callback + */ + Callback.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Callback) + return object; + var message = new $root.google.cloud.ces.v1beta.Callback(); + if (object.pythonCode != null) + message.pythonCode = String(object.pythonCode); + if (object.description != null) + message.description = String(object.description); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + if (object.proactiveExecutionEnabled != null) + message.proactiveExecutionEnabled = Boolean(object.proactiveExecutionEnabled); + return message; + }; + + /** + * Creates a plain object from a Callback message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Callback + * @static + * @param {google.cloud.ces.v1beta.Callback} message Callback + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Callback.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disabled = false; + object.description = ""; + object.proactiveExecutionEnabled = false; + } + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) { + object.pythonCode = message.pythonCode; + if (options.oneofs) + object.callback = "pythonCode"; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.proactiveExecutionEnabled != null && message.hasOwnProperty("proactiveExecutionEnabled")) + object.proactiveExecutionEnabled = message.proactiveExecutionEnabled; + return object; + }; + + /** + * Converts this Callback to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Callback + * @instance + * @returns {Object.} JSON object + */ + Callback.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Callback + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Callback + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Callback.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Callback"; + }; + + return Callback; + })(); + + v1beta.ModelSettings = (function() { + + /** + * Properties of a ModelSettings. + * @memberof google.cloud.ces.v1beta + * @interface IModelSettings + * @property {string|null} [model] ModelSettings model + * @property {number|null} [temperature] ModelSettings temperature + */ + + /** + * Constructs a new ModelSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ModelSettings. + * @implements IModelSettings + * @constructor + * @param {google.cloud.ces.v1beta.IModelSettings=} [properties] Properties to set + */ + function ModelSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelSettings model. + * @member {string} model + * @memberof google.cloud.ces.v1beta.ModelSettings + * @instance + */ + ModelSettings.prototype.model = ""; + + /** + * ModelSettings temperature. + * @member {number|null|undefined} temperature + * @memberof google.cloud.ces.v1beta.ModelSettings + * @instance + */ + ModelSettings.prototype.temperature = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ModelSettings.prototype, "_temperature", { + get: $util.oneOfGetter($oneOfFields = ["temperature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModelSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ModelSettings + * @static + * @param {google.cloud.ces.v1beta.IModelSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ModelSettings} ModelSettings instance + */ + ModelSettings.create = function create(properties) { + return new ModelSettings(properties); + }; + + /** + * Encodes the specified ModelSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ModelSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ModelSettings + * @static + * @param {google.cloud.ces.v1beta.IModelSettings} message ModelSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.temperature); + return writer; + }; + + /** + * Encodes the specified ModelSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ModelSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ModelSettings + * @static + * @param {google.cloud.ces.v1beta.IModelSettings} message ModelSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ModelSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ModelSettings} ModelSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ModelSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.temperature = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ModelSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ModelSettings} ModelSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.ModelSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.temperature != null && message.hasOwnProperty("temperature")) { + properties._temperature = 1; + if (typeof message.temperature !== "number") + return "temperature: number expected"; + } + return null; + }; + + /** + * Creates a ModelSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ModelSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ModelSettings} ModelSettings + */ + ModelSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ModelSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.ModelSettings(); + if (object.model != null) + message.model = String(object.model); + if (object.temperature != null) + message.temperature = Number(object.temperature); + return message; + }; + + /** + * Creates a plain object from a ModelSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ModelSettings + * @static + * @param {google.cloud.ces.v1beta.ModelSettings} message ModelSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.temperature != null && message.hasOwnProperty("temperature")) { + object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; + if (options.oneofs) + object._temperature = "temperature"; + } + return object; + }; + + /** + * Converts this ModelSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ModelSettings + * @instance + * @returns {Object.} JSON object + */ + ModelSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ModelSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ModelSettings"; + }; + + return ModelSettings; + })(); + + v1beta.TriggerAction = (function() { + + /** + * Properties of a TriggerAction. + * @memberof google.cloud.ces.v1beta + * @interface ITriggerAction + * @property {google.cloud.ces.v1beta.TriggerAction.IRespondImmediately|null} [respondImmediately] TriggerAction respondImmediately + * @property {google.cloud.ces.v1beta.TriggerAction.ITransferAgent|null} [transferAgent] TriggerAction transferAgent + * @property {google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer|null} [generativeAnswer] TriggerAction generativeAnswer + */ + + /** + * Constructs a new TriggerAction. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a TriggerAction. + * @implements ITriggerAction + * @constructor + * @param {google.cloud.ces.v1beta.ITriggerAction=} [properties] Properties to set + */ + function TriggerAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TriggerAction respondImmediately. + * @member {google.cloud.ces.v1beta.TriggerAction.IRespondImmediately|null|undefined} respondImmediately + * @memberof google.cloud.ces.v1beta.TriggerAction + * @instance + */ + TriggerAction.prototype.respondImmediately = null; + + /** + * TriggerAction transferAgent. + * @member {google.cloud.ces.v1beta.TriggerAction.ITransferAgent|null|undefined} transferAgent + * @memberof google.cloud.ces.v1beta.TriggerAction + * @instance + */ + TriggerAction.prototype.transferAgent = null; + + /** + * TriggerAction generativeAnswer. + * @member {google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer|null|undefined} generativeAnswer + * @memberof google.cloud.ces.v1beta.TriggerAction + * @instance + */ + TriggerAction.prototype.generativeAnswer = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TriggerAction action. + * @member {"respondImmediately"|"transferAgent"|"generativeAnswer"|undefined} action + * @memberof google.cloud.ces.v1beta.TriggerAction + * @instance + */ + Object.defineProperty(TriggerAction.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["respondImmediately", "transferAgent", "generativeAnswer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TriggerAction instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TriggerAction + * @static + * @param {google.cloud.ces.v1beta.ITriggerAction=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TriggerAction} TriggerAction instance + */ + TriggerAction.create = function create(properties) { + return new TriggerAction(properties); + }; + + /** + * Encodes the specified TriggerAction message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TriggerAction + * @static + * @param {google.cloud.ces.v1beta.ITriggerAction} message TriggerAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TriggerAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.respondImmediately != null && Object.hasOwnProperty.call(message, "respondImmediately")) + $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately.encode(message.respondImmediately, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.transferAgent != null && Object.hasOwnProperty.call(message, "transferAgent")) + $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent.encode(message.transferAgent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.generativeAnswer != null && Object.hasOwnProperty.call(message, "generativeAnswer")) + $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.encode(message.generativeAnswer, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TriggerAction message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction + * @static + * @param {google.cloud.ces.v1beta.ITriggerAction} message TriggerAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TriggerAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TriggerAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TriggerAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TriggerAction} TriggerAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TriggerAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TriggerAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.respondImmediately = $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately.decode(reader, reader.uint32()); + break; + } + case 2: { + message.transferAgent = $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent.decode(reader, reader.uint32()); + break; + } + case 3: { + message.generativeAnswer = $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TriggerAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TriggerAction} TriggerAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TriggerAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TriggerAction message. + * @function verify + * @memberof google.cloud.ces.v1beta.TriggerAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TriggerAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.respondImmediately != null && message.hasOwnProperty("respondImmediately")) { + properties.action = 1; + { + var error = $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately.verify(message.respondImmediately); + if (error) + return "respondImmediately." + error; + } + } + if (message.transferAgent != null && message.hasOwnProperty("transferAgent")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent.verify(message.transferAgent); + if (error) + return "transferAgent." + error; + } + } + if (message.generativeAnswer != null && message.hasOwnProperty("generativeAnswer")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.verify(message.generativeAnswer); + if (error) + return "generativeAnswer." + error; + } + } + return null; + }; + + /** + * Creates a TriggerAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TriggerAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TriggerAction} TriggerAction + */ + TriggerAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TriggerAction) + return object; + var message = new $root.google.cloud.ces.v1beta.TriggerAction(); + if (object.respondImmediately != null) { + if (typeof object.respondImmediately !== "object") + throw TypeError(".google.cloud.ces.v1beta.TriggerAction.respondImmediately: object expected"); + message.respondImmediately = $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately.fromObject(object.respondImmediately); + } + if (object.transferAgent != null) { + if (typeof object.transferAgent !== "object") + throw TypeError(".google.cloud.ces.v1beta.TriggerAction.transferAgent: object expected"); + message.transferAgent = $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent.fromObject(object.transferAgent); + } + if (object.generativeAnswer != null) { + if (typeof object.generativeAnswer !== "object") + throw TypeError(".google.cloud.ces.v1beta.TriggerAction.generativeAnswer: object expected"); + message.generativeAnswer = $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.fromObject(object.generativeAnswer); + } + return message; + }; + + /** + * Creates a plain object from a TriggerAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TriggerAction + * @static + * @param {google.cloud.ces.v1beta.TriggerAction} message TriggerAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TriggerAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.respondImmediately != null && message.hasOwnProperty("respondImmediately")) { + object.respondImmediately = $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately.toObject(message.respondImmediately, options); + if (options.oneofs) + object.action = "respondImmediately"; + } + if (message.transferAgent != null && message.hasOwnProperty("transferAgent")) { + object.transferAgent = $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent.toObject(message.transferAgent, options); + if (options.oneofs) + object.action = "transferAgent"; + } + if (message.generativeAnswer != null && message.hasOwnProperty("generativeAnswer")) { + object.generativeAnswer = $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.toObject(message.generativeAnswer, options); + if (options.oneofs) + object.action = "generativeAnswer"; + } + return object; + }; + + /** + * Converts this TriggerAction to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TriggerAction + * @instance + * @returns {Object.} JSON object + */ + TriggerAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TriggerAction + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TriggerAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TriggerAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TriggerAction"; + }; + + TriggerAction.Response = (function() { + + /** + * Properties of a Response. + * @memberof google.cloud.ces.v1beta.TriggerAction + * @interface IResponse + * @property {string|null} [text] Response text + * @property {boolean|null} [disabled] Response disabled + */ + + /** + * Constructs a new Response. + * @memberof google.cloud.ces.v1beta.TriggerAction + * @classdesc Represents a Response. + * @implements IResponse + * @constructor + * @param {google.cloud.ces.v1beta.TriggerAction.IResponse=} [properties] Properties to set + */ + function Response(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Response text. + * @member {string} text + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @instance + */ + Response.prototype.text = ""; + + /** + * Response disabled. + * @member {boolean} disabled + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @instance + */ + Response.prototype.disabled = false; + + /** + * Creates a new Response instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.IResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TriggerAction.Response} Response instance + */ + Response.create = function create(properties) { + return new Response(properties); + }; + + /** + * Encodes the specified Response message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.Response.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.IResponse} message Response message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Response.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.disabled); + return writer; + }; + + /** + * Encodes the specified Response message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.Response.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.IResponse} message Response message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Response.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Response message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TriggerAction.Response} Response + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Response.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TriggerAction.Response(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.disabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Response message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TriggerAction.Response} Response + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Response.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Response message. + * @function verify + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Response.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + return null; + }; + + /** + * Creates a Response message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TriggerAction.Response} Response + */ + Response.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TriggerAction.Response) + return object; + var message = new $root.google.cloud.ces.v1beta.TriggerAction.Response(); + if (object.text != null) + message.text = String(object.text); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + return message; + }; + + /** + * Creates a plain object from a Response message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.Response} message Response + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Response.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.disabled = false; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + return object; + }; + + /** + * Converts this Response to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @instance + * @returns {Object.} JSON object + */ + Response.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Response + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Response.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TriggerAction.Response"; + }; + + return Response; + })(); + + TriggerAction.RespondImmediately = (function() { + + /** + * Properties of a RespondImmediately. + * @memberof google.cloud.ces.v1beta.TriggerAction + * @interface IRespondImmediately + * @property {Array.|null} [responses] RespondImmediately responses + */ + + /** + * Constructs a new RespondImmediately. + * @memberof google.cloud.ces.v1beta.TriggerAction + * @classdesc Represents a RespondImmediately. + * @implements IRespondImmediately + * @constructor + * @param {google.cloud.ces.v1beta.TriggerAction.IRespondImmediately=} [properties] Properties to set + */ + function RespondImmediately(properties) { + this.responses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RespondImmediately responses. + * @member {Array.} responses + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @instance + */ + RespondImmediately.prototype.responses = $util.emptyArray; + + /** + * Creates a new RespondImmediately instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.IRespondImmediately=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TriggerAction.RespondImmediately} RespondImmediately instance + */ + RespondImmediately.create = function create(properties) { + return new RespondImmediately(properties); + }; + + /** + * Encodes the specified RespondImmediately message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.RespondImmediately.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.IRespondImmediately} message RespondImmediately message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RespondImmediately.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responses != null && message.responses.length) + for (var i = 0; i < message.responses.length; ++i) + $root.google.cloud.ces.v1beta.TriggerAction.Response.encode(message.responses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RespondImmediately message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.RespondImmediately.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.IRespondImmediately} message RespondImmediately message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RespondImmediately.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RespondImmediately message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TriggerAction.RespondImmediately} RespondImmediately + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RespondImmediately.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.responses && message.responses.length)) + message.responses = []; + message.responses.push($root.google.cloud.ces.v1beta.TriggerAction.Response.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RespondImmediately message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TriggerAction.RespondImmediately} RespondImmediately + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RespondImmediately.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RespondImmediately message. + * @function verify + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RespondImmediately.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responses != null && message.hasOwnProperty("responses")) { + if (!Array.isArray(message.responses)) + return "responses: array expected"; + for (var i = 0; i < message.responses.length; ++i) { + var error = $root.google.cloud.ces.v1beta.TriggerAction.Response.verify(message.responses[i]); + if (error) + return "responses." + error; + } + } + return null; + }; + + /** + * Creates a RespondImmediately message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TriggerAction.RespondImmediately} RespondImmediately + */ + RespondImmediately.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately) + return object; + var message = new $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately(); + if (object.responses) { + if (!Array.isArray(object.responses)) + throw TypeError(".google.cloud.ces.v1beta.TriggerAction.RespondImmediately.responses: array expected"); + message.responses = []; + for (var i = 0; i < object.responses.length; ++i) { + if (typeof object.responses[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.TriggerAction.RespondImmediately.responses: object expected"); + message.responses[i] = $root.google.cloud.ces.v1beta.TriggerAction.Response.fromObject(object.responses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RespondImmediately message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.RespondImmediately} message RespondImmediately + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RespondImmediately.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responses = []; + if (message.responses && message.responses.length) { + object.responses = []; + for (var j = 0; j < message.responses.length; ++j) + object.responses[j] = $root.google.cloud.ces.v1beta.TriggerAction.Response.toObject(message.responses[j], options); + } + return object; + }; + + /** + * Converts this RespondImmediately to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @instance + * @returns {Object.} JSON object + */ + RespondImmediately.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RespondImmediately + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RespondImmediately.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TriggerAction.RespondImmediately"; + }; + + return RespondImmediately; + })(); + + TriggerAction.GenerativeAnswer = (function() { + + /** + * Properties of a GenerativeAnswer. + * @memberof google.cloud.ces.v1beta.TriggerAction + * @interface IGenerativeAnswer + * @property {string|null} [prompt] GenerativeAnswer prompt + */ + + /** + * Constructs a new GenerativeAnswer. + * @memberof google.cloud.ces.v1beta.TriggerAction + * @classdesc Represents a GenerativeAnswer. + * @implements IGenerativeAnswer + * @constructor + * @param {google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer=} [properties] Properties to set + */ + function GenerativeAnswer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerativeAnswer prompt. + * @member {string} prompt + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @instance + */ + GenerativeAnswer.prototype.prompt = ""; + + /** + * Creates a new GenerativeAnswer instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer} GenerativeAnswer instance + */ + GenerativeAnswer.create = function create(properties) { + return new GenerativeAnswer(properties); + }; + + /** + * Encodes the specified GenerativeAnswer message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer} message GenerativeAnswer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerativeAnswer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.prompt); + return writer; + }; + + /** + * Encodes the specified GenerativeAnswer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer} message GenerativeAnswer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerativeAnswer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerativeAnswer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer} GenerativeAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerativeAnswer.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.prompt = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerativeAnswer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer} GenerativeAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerativeAnswer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerativeAnswer message. + * @function verify + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerativeAnswer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.prompt != null && message.hasOwnProperty("prompt")) + if (!$util.isString(message.prompt)) + return "prompt: string expected"; + return null; + }; + + /** + * Creates a GenerativeAnswer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer} GenerativeAnswer + */ + GenerativeAnswer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer) + return object; + var message = new $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer(); + if (object.prompt != null) + message.prompt = String(object.prompt); + return message; + }; + + /** + * Creates a plain object from a GenerativeAnswer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer} message GenerativeAnswer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerativeAnswer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.prompt = ""; + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = message.prompt; + return object; + }; + + /** + * Converts this GenerativeAnswer to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @instance + * @returns {Object.} JSON object + */ + GenerativeAnswer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerativeAnswer + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerativeAnswer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer"; + }; + + return GenerativeAnswer; + })(); + + TriggerAction.TransferAgent = (function() { + + /** + * Properties of a TransferAgent. + * @memberof google.cloud.ces.v1beta.TriggerAction + * @interface ITransferAgent + * @property {string|null} [agent] TransferAgent agent + */ + + /** + * Constructs a new TransferAgent. + * @memberof google.cloud.ces.v1beta.TriggerAction + * @classdesc Represents a TransferAgent. + * @implements ITransferAgent + * @constructor + * @param {google.cloud.ces.v1beta.TriggerAction.ITransferAgent=} [properties] Properties to set + */ + function TransferAgent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferAgent agent. + * @member {string} agent + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @instance + */ + TransferAgent.prototype.agent = ""; + + /** + * Creates a new TransferAgent instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.ITransferAgent=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TriggerAction.TransferAgent} TransferAgent instance + */ + TransferAgent.create = function create(properties) { + return new TransferAgent(properties); + }; + + /** + * Encodes the specified TransferAgent message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.TransferAgent.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.ITransferAgent} message TransferAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferAgent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.agent); + return writer; + }; + + /** + * Encodes the specified TransferAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.TransferAgent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.ITransferAgent} message TransferAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferAgent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferAgent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TriggerAction.TransferAgent} TransferAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferAgent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.agent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferAgent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TriggerAction.TransferAgent} TransferAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferAgent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferAgent message. + * @function verify + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferAgent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agent != null && message.hasOwnProperty("agent")) + if (!$util.isString(message.agent)) + return "agent: string expected"; + return null; + }; + + /** + * Creates a TransferAgent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TriggerAction.TransferAgent} TransferAgent + */ + TransferAgent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent) + return object; + var message = new $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent(); + if (object.agent != null) + message.agent = String(object.agent); + return message; + }; + + /** + * Creates a plain object from a TransferAgent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.TransferAgent} message TransferAgent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferAgent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.agent = ""; + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = message.agent; + return object; + }; + + /** + * Converts this TransferAgent to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @instance + * @returns {Object.} JSON object + */ + TransferAgent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferAgent + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferAgent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TriggerAction.TransferAgent"; + }; + + return TransferAgent; + })(); + + return TriggerAction; + })(); + + v1beta.TlsConfig = (function() { + + /** + * Properties of a TlsConfig. + * @memberof google.cloud.ces.v1beta + * @interface ITlsConfig + * @property {Array.|null} [caCerts] TlsConfig caCerts + */ + + /** + * Constructs a new TlsConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a TlsConfig. + * @implements ITlsConfig + * @constructor + * @param {google.cloud.ces.v1beta.ITlsConfig=} [properties] Properties to set + */ + function TlsConfig(properties) { + this.caCerts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TlsConfig caCerts. + * @member {Array.} caCerts + * @memberof google.cloud.ces.v1beta.TlsConfig + * @instance + */ + TlsConfig.prototype.caCerts = $util.emptyArray; + + /** + * Creates a new TlsConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TlsConfig + * @static + * @param {google.cloud.ces.v1beta.ITlsConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TlsConfig} TlsConfig instance + */ + TlsConfig.create = function create(properties) { + return new TlsConfig(properties); + }; + + /** + * Encodes the specified TlsConfig message. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TlsConfig + * @static + * @param {google.cloud.ces.v1beta.ITlsConfig} message TlsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TlsConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caCerts != null && message.caCerts.length) + for (var i = 0; i < message.caCerts.length; ++i) + $root.google.cloud.ces.v1beta.TlsConfig.CaCert.encode(message.caCerts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TlsConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TlsConfig + * @static + * @param {google.cloud.ces.v1beta.ITlsConfig} message TlsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TlsConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TlsConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TlsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TlsConfig} TlsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TlsConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TlsConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.caCerts && message.caCerts.length)) + message.caCerts = []; + message.caCerts.push($root.google.cloud.ces.v1beta.TlsConfig.CaCert.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TlsConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TlsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TlsConfig} TlsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TlsConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TlsConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.TlsConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TlsConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.caCerts != null && message.hasOwnProperty("caCerts")) { + if (!Array.isArray(message.caCerts)) + return "caCerts: array expected"; + for (var i = 0; i < message.caCerts.length; ++i) { + var error = $root.google.cloud.ces.v1beta.TlsConfig.CaCert.verify(message.caCerts[i]); + if (error) + return "caCerts." + error; + } + } + return null; + }; + + /** + * Creates a TlsConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TlsConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TlsConfig} TlsConfig + */ + TlsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TlsConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.TlsConfig(); + if (object.caCerts) { + if (!Array.isArray(object.caCerts)) + throw TypeError(".google.cloud.ces.v1beta.TlsConfig.caCerts: array expected"); + message.caCerts = []; + for (var i = 0; i < object.caCerts.length; ++i) { + if (typeof object.caCerts[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.TlsConfig.caCerts: object expected"); + message.caCerts[i] = $root.google.cloud.ces.v1beta.TlsConfig.CaCert.fromObject(object.caCerts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TlsConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TlsConfig + * @static + * @param {google.cloud.ces.v1beta.TlsConfig} message TlsConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TlsConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.caCerts = []; + if (message.caCerts && message.caCerts.length) { + object.caCerts = []; + for (var j = 0; j < message.caCerts.length; ++j) + object.caCerts[j] = $root.google.cloud.ces.v1beta.TlsConfig.CaCert.toObject(message.caCerts[j], options); + } + return object; + }; + + /** + * Converts this TlsConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TlsConfig + * @instance + * @returns {Object.} JSON object + */ + TlsConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TlsConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TlsConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TlsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TlsConfig"; + }; + + TlsConfig.CaCert = (function() { + + /** + * Properties of a CaCert. + * @memberof google.cloud.ces.v1beta.TlsConfig + * @interface ICaCert + * @property {string|null} [displayName] CaCert displayName + * @property {Uint8Array|null} [cert] CaCert cert + */ + + /** + * Constructs a new CaCert. + * @memberof google.cloud.ces.v1beta.TlsConfig + * @classdesc Represents a CaCert. + * @implements ICaCert + * @constructor + * @param {google.cloud.ces.v1beta.TlsConfig.ICaCert=} [properties] Properties to set + */ + function CaCert(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CaCert displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @instance + */ + CaCert.prototype.displayName = ""; + + /** + * CaCert cert. + * @member {Uint8Array} cert + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @instance + */ + CaCert.prototype.cert = $util.newBuffer([]); + + /** + * Creates a new CaCert instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @static + * @param {google.cloud.ces.v1beta.TlsConfig.ICaCert=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TlsConfig.CaCert} CaCert instance + */ + CaCert.create = function create(properties) { + return new CaCert(properties); + }; + + /** + * Encodes the specified CaCert message. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.CaCert.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @static + * @param {google.cloud.ces.v1beta.TlsConfig.ICaCert} message CaCert message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaCert.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.cert != null && Object.hasOwnProperty.call(message, "cert")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.cert); + return writer; + }; + + /** + * Encodes the specified CaCert message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.CaCert.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @static + * @param {google.cloud.ces.v1beta.TlsConfig.ICaCert} message CaCert message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaCert.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CaCert message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TlsConfig.CaCert} CaCert + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaCert.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TlsConfig.CaCert(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.cert = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CaCert message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TlsConfig.CaCert} CaCert + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaCert.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CaCert message. + * @function verify + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CaCert.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.cert != null && message.hasOwnProperty("cert")) + if (!(message.cert && typeof message.cert.length === "number" || $util.isString(message.cert))) + return "cert: buffer expected"; + return null; + }; + + /** + * Creates a CaCert message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TlsConfig.CaCert} CaCert + */ + CaCert.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TlsConfig.CaCert) + return object; + var message = new $root.google.cloud.ces.v1beta.TlsConfig.CaCert(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.cert != null) + if (typeof object.cert === "string") + $util.base64.decode(object.cert, message.cert = $util.newBuffer($util.base64.length(object.cert)), 0); + else if (object.cert.length >= 0) + message.cert = object.cert; + return message; + }; + + /** + * Creates a plain object from a CaCert message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @static + * @param {google.cloud.ces.v1beta.TlsConfig.CaCert} message CaCert + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CaCert.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + if (options.bytes === String) + object.cert = ""; + else { + object.cert = []; + if (options.bytes !== Array) + object.cert = $util.newBuffer(object.cert); + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.cert != null && message.hasOwnProperty("cert")) + object.cert = options.bytes === String ? $util.base64.encode(message.cert, 0, message.cert.length) : options.bytes === Array ? Array.prototype.slice.call(message.cert) : message.cert; + return object; + }; + + /** + * Converts this CaCert to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @instance + * @returns {Object.} JSON object + */ + CaCert.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CaCert + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CaCert.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TlsConfig.CaCert"; + }; + + return CaCert; + })(); + + return TlsConfig; + })(); + + v1beta.ServiceDirectoryConfig = (function() { + + /** + * Properties of a ServiceDirectoryConfig. + * @memberof google.cloud.ces.v1beta + * @interface IServiceDirectoryConfig + * @property {string|null} [service] ServiceDirectoryConfig service + */ + + /** + * Constructs a new ServiceDirectoryConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ServiceDirectoryConfig. + * @implements IServiceDirectoryConfig + * @constructor + * @param {google.cloud.ces.v1beta.IServiceDirectoryConfig=} [properties] Properties to set + */ + function ServiceDirectoryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDirectoryConfig service. + * @member {string} service + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @instance + */ + ServiceDirectoryConfig.prototype.service = ""; + + /** + * Creates a new ServiceDirectoryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @static + * @param {google.cloud.ces.v1beta.IServiceDirectoryConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ServiceDirectoryConfig} ServiceDirectoryConfig instance + */ + ServiceDirectoryConfig.create = function create(properties) { + return new ServiceDirectoryConfig(properties); + }; + + /** + * Encodes the specified ServiceDirectoryConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ServiceDirectoryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @static + * @param {google.cloud.ces.v1beta.IServiceDirectoryConfig} message ServiceDirectoryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDirectoryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + return writer; + }; + + /** + * Encodes the specified ServiceDirectoryConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ServiceDirectoryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @static + * @param {google.cloud.ces.v1beta.IServiceDirectoryConfig} message ServiceDirectoryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDirectoryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ServiceDirectoryConfig} ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDirectoryConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ServiceDirectoryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ServiceDirectoryConfig} ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDirectoryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDirectoryConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDirectoryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + return null; + }; + + /** + * Creates a ServiceDirectoryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ServiceDirectoryConfig} ServiceDirectoryConfig + */ + ServiceDirectoryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ServiceDirectoryConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.ServiceDirectoryConfig(); + if (object.service != null) + message.service = String(object.service); + return message; + }; + + /** + * Creates a plain object from a ServiceDirectoryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @static + * @param {google.cloud.ces.v1beta.ServiceDirectoryConfig} message ServiceDirectoryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDirectoryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + return object; + }; + + /** + * Converts this ServiceDirectoryConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceDirectoryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDirectoryConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDirectoryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ServiceDirectoryConfig"; + }; + + return ServiceDirectoryConfig; + })(); + + v1beta.ChannelProfile = (function() { + + /** + * Properties of a ChannelProfile. + * @memberof google.cloud.ces.v1beta + * @interface IChannelProfile + * @property {string|null} [profileId] ChannelProfile profileId + * @property {google.cloud.ces.v1beta.ChannelProfile.ChannelType|null} [channelType] ChannelProfile channelType + * @property {google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty|null} [personaProperty] ChannelProfile personaProperty + * @property {boolean|null} [disableDtmf] ChannelProfile disableDtmf + * @property {boolean|null} [disableBargeInControl] ChannelProfile disableBargeInControl + * @property {google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig|null} [webWidgetConfig] ChannelProfile webWidgetConfig + * @property {string|null} [noiseSuppressionLevel] ChannelProfile noiseSuppressionLevel + */ + + /** + * Constructs a new ChannelProfile. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ChannelProfile. + * @implements IChannelProfile + * @constructor + * @param {google.cloud.ces.v1beta.IChannelProfile=} [properties] Properties to set + */ + function ChannelProfile(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChannelProfile profileId. + * @member {string} profileId + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @instance + */ + ChannelProfile.prototype.profileId = ""; + + /** + * ChannelProfile channelType. + * @member {google.cloud.ces.v1beta.ChannelProfile.ChannelType} channelType + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @instance + */ + ChannelProfile.prototype.channelType = 0; + + /** + * ChannelProfile personaProperty. + * @member {google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty|null|undefined} personaProperty + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @instance + */ + ChannelProfile.prototype.personaProperty = null; + + /** + * ChannelProfile disableDtmf. + * @member {boolean} disableDtmf + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @instance + */ + ChannelProfile.prototype.disableDtmf = false; + + /** + * ChannelProfile disableBargeInControl. + * @member {boolean} disableBargeInControl + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @instance + */ + ChannelProfile.prototype.disableBargeInControl = false; + + /** + * ChannelProfile webWidgetConfig. + * @member {google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig|null|undefined} webWidgetConfig + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @instance + */ + ChannelProfile.prototype.webWidgetConfig = null; + + /** + * ChannelProfile noiseSuppressionLevel. + * @member {string} noiseSuppressionLevel + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @instance + */ + ChannelProfile.prototype.noiseSuppressionLevel = ""; + + /** + * Creates a new ChannelProfile instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @static + * @param {google.cloud.ces.v1beta.IChannelProfile=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ChannelProfile} ChannelProfile instance + */ + ChannelProfile.create = function create(properties) { + return new ChannelProfile(properties); + }; + + /** + * Encodes the specified ChannelProfile message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @static + * @param {google.cloud.ces.v1beta.IChannelProfile} message ChannelProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.profileId != null && Object.hasOwnProperty.call(message, "profileId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.profileId); + if (message.personaProperty != null && Object.hasOwnProperty.call(message, "personaProperty")) + $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.encode(message.personaProperty, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.channelType != null && Object.hasOwnProperty.call(message, "channelType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.channelType); + if (message.disableDtmf != null && Object.hasOwnProperty.call(message, "disableDtmf")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.disableDtmf); + if (message.disableBargeInControl != null && Object.hasOwnProperty.call(message, "disableBargeInControl")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disableBargeInControl); + if (message.webWidgetConfig != null && Object.hasOwnProperty.call(message, "webWidgetConfig")) + $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.encode(message.webWidgetConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.noiseSuppressionLevel != null && Object.hasOwnProperty.call(message, "noiseSuppressionLevel")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.noiseSuppressionLevel); + return writer; + }; + + /** + * Encodes the specified ChannelProfile message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @static + * @param {google.cloud.ces.v1beta.IChannelProfile} message ChannelProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChannelProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ChannelProfile} ChannelProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelProfile.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ChannelProfile(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.profileId = reader.string(); + break; + } + case 3: { + message.channelType = reader.int32(); + break; + } + case 2: { + message.personaProperty = $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.decode(reader, reader.uint32()); + break; + } + case 4: { + message.disableDtmf = reader.bool(); + break; + } + case 5: { + message.disableBargeInControl = reader.bool(); + break; + } + case 7: { + message.webWidgetConfig = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.noiseSuppressionLevel = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChannelProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ChannelProfile} ChannelProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChannelProfile message. + * @function verify + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChannelProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.profileId != null && message.hasOwnProperty("profileId")) + if (!$util.isString(message.profileId)) + return "profileId: string expected"; + if (message.channelType != null && message.hasOwnProperty("channelType")) + switch (message.channelType) { + default: + return "channelType: enum value expected"; + case 0: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.personaProperty != null && message.hasOwnProperty("personaProperty")) { + var error = $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.verify(message.personaProperty); + if (error) + return "personaProperty." + error; + } + if (message.disableDtmf != null && message.hasOwnProperty("disableDtmf")) + if (typeof message.disableDtmf !== "boolean") + return "disableDtmf: boolean expected"; + if (message.disableBargeInControl != null && message.hasOwnProperty("disableBargeInControl")) + if (typeof message.disableBargeInControl !== "boolean") + return "disableBargeInControl: boolean expected"; + if (message.webWidgetConfig != null && message.hasOwnProperty("webWidgetConfig")) { + var error = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.verify(message.webWidgetConfig); + if (error) + return "webWidgetConfig." + error; + } + if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) + if (!$util.isString(message.noiseSuppressionLevel)) + return "noiseSuppressionLevel: string expected"; + return null; + }; + + /** + * Creates a ChannelProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ChannelProfile} ChannelProfile + */ + ChannelProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ChannelProfile) + return object; + var message = new $root.google.cloud.ces.v1beta.ChannelProfile(); + if (object.profileId != null) + message.profileId = String(object.profileId); + switch (object.channelType) { + default: + if (typeof object.channelType === "number") { + message.channelType = object.channelType; + break; + } + break; + case "UNKNOWN": + case 0: + message.channelType = 0; + break; + case "WEB_UI": + case 2: + message.channelType = 2; + break; + case "API": + case 3: + message.channelType = 3; + break; + case "TWILIO": + case 4: + message.channelType = 4; + break; + case "GOOGLE_TELEPHONY_PLATFORM": + case 5: + message.channelType = 5; + break; + case "CONTACT_CENTER_AS_A_SERVICE": + case 6: + message.channelType = 6; + break; + case "FIVE9": + case 7: + message.channelType = 7; + break; + case "CONTACT_CENTER_INTEGRATION": + case 8: + message.channelType = 8; + break; + } + if (object.personaProperty != null) { + if (typeof object.personaProperty !== "object") + throw TypeError(".google.cloud.ces.v1beta.ChannelProfile.personaProperty: object expected"); + message.personaProperty = $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.fromObject(object.personaProperty); + } + if (object.disableDtmf != null) + message.disableDtmf = Boolean(object.disableDtmf); + if (object.disableBargeInControl != null) + message.disableBargeInControl = Boolean(object.disableBargeInControl); + if (object.webWidgetConfig != null) { + if (typeof object.webWidgetConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.ChannelProfile.webWidgetConfig: object expected"); + message.webWidgetConfig = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.fromObject(object.webWidgetConfig); + } + if (object.noiseSuppressionLevel != null) + message.noiseSuppressionLevel = String(object.noiseSuppressionLevel); + return message; + }; + + /** + * Creates a plain object from a ChannelProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile} message ChannelProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChannelProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.profileId = ""; + object.personaProperty = null; + object.channelType = options.enums === String ? "UNKNOWN" : 0; + object.disableDtmf = false; + object.disableBargeInControl = false; + object.webWidgetConfig = null; + object.noiseSuppressionLevel = ""; + } + if (message.profileId != null && message.hasOwnProperty("profileId")) + object.profileId = message.profileId; + if (message.personaProperty != null && message.hasOwnProperty("personaProperty")) + object.personaProperty = $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.toObject(message.personaProperty, options); + if (message.channelType != null && message.hasOwnProperty("channelType")) + object.channelType = options.enums === String ? $root.google.cloud.ces.v1beta.ChannelProfile.ChannelType[message.channelType] === undefined ? message.channelType : $root.google.cloud.ces.v1beta.ChannelProfile.ChannelType[message.channelType] : message.channelType; + if (message.disableDtmf != null && message.hasOwnProperty("disableDtmf")) + object.disableDtmf = message.disableDtmf; + if (message.disableBargeInControl != null && message.hasOwnProperty("disableBargeInControl")) + object.disableBargeInControl = message.disableBargeInControl; + if (message.webWidgetConfig != null && message.hasOwnProperty("webWidgetConfig")) + object.webWidgetConfig = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.toObject(message.webWidgetConfig, options); + if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) + object.noiseSuppressionLevel = message.noiseSuppressionLevel; + return object; + }; + + /** + * Converts this ChannelProfile to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @instance + * @returns {Object.} JSON object + */ + ChannelProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChannelProfile + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChannelProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ChannelProfile"; + }; + + ChannelProfile.PersonaProperty = (function() { + + /** + * Properties of a PersonaProperty. + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @interface IPersonaProperty + * @property {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona|null} [persona] PersonaProperty persona + */ + + /** + * Constructs a new PersonaProperty. + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @classdesc Represents a PersonaProperty. + * @implements IPersonaProperty + * @constructor + * @param {google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty=} [properties] Properties to set + */ + function PersonaProperty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonaProperty persona. + * @member {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona} persona + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @instance + */ + PersonaProperty.prototype.persona = 0; + + /** + * Creates a new PersonaProperty instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty} PersonaProperty instance + */ + PersonaProperty.create = function create(properties) { + return new PersonaProperty(properties); + }; + + /** + * Encodes the specified PersonaProperty message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty} message PersonaProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonaProperty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.persona != null && Object.hasOwnProperty.call(message, "persona")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.persona); + return writer; + }; + + /** + * Encodes the specified PersonaProperty message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty} message PersonaProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonaProperty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonaProperty message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty} PersonaProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonaProperty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.persona = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PersonaProperty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty} PersonaProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonaProperty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonaProperty message. + * @function verify + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonaProperty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.persona != null && message.hasOwnProperty("persona")) + switch (message.persona) { + default: + return "persona: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a PersonaProperty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty} PersonaProperty + */ + PersonaProperty.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty) + return object; + var message = new $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty(); + switch (object.persona) { + default: + if (typeof object.persona === "number") { + message.persona = object.persona; + break; + } + break; + case "UNKNOWN": + case 0: + message.persona = 0; + break; + case "CONCISE": + case 1: + message.persona = 1; + break; + case "CHATTY": + case 2: + message.persona = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a PersonaProperty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty} message PersonaProperty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonaProperty.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.persona = options.enums === String ? "UNKNOWN" : 0; + if (message.persona != null && message.hasOwnProperty("persona")) + object.persona = options.enums === String ? $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona[message.persona] === undefined ? message.persona : $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona[message.persona] : message.persona; + return object; + }; + + /** + * Converts this PersonaProperty to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @instance + * @returns {Object.} JSON object + */ + PersonaProperty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PersonaProperty + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PersonaProperty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ChannelProfile.PersonaProperty"; + }; + + /** + * Persona enum. + * @name google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} CONCISE=1 CONCISE value + * @property {number} CHATTY=2 CHATTY value + */ + PersonaProperty.Persona = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "CONCISE"] = 1; + values[valuesById[2] = "CHATTY"] = 2; + return values; + })(); + + return PersonaProperty; + })(); + + ChannelProfile.WebWidgetConfig = (function() { + + /** + * Properties of a WebWidgetConfig. + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @interface IWebWidgetConfig + * @property {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality|null} [modality] WebWidgetConfig modality + * @property {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme|null} [theme] WebWidgetConfig theme + * @property {string|null} [webWidgetTitle] WebWidgetConfig webWidgetTitle + * @property {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings|null} [securitySettings] WebWidgetConfig securitySettings + */ + + /** + * Constructs a new WebWidgetConfig. + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @classdesc Represents a WebWidgetConfig. + * @implements IWebWidgetConfig + * @constructor + * @param {google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig=} [properties] Properties to set + */ + function WebWidgetConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebWidgetConfig modality. + * @member {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality} modality + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @instance + */ + WebWidgetConfig.prototype.modality = 0; + + /** + * WebWidgetConfig theme. + * @member {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme} theme + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @instance + */ + WebWidgetConfig.prototype.theme = 0; + + /** + * WebWidgetConfig webWidgetTitle. + * @member {string} webWidgetTitle + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @instance + */ + WebWidgetConfig.prototype.webWidgetTitle = ""; + + /** + * WebWidgetConfig securitySettings. + * @member {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings|null|undefined} securitySettings + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @instance + */ + WebWidgetConfig.prototype.securitySettings = null; + + /** + * Creates a new WebWidgetConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig} WebWidgetConfig instance + */ + WebWidgetConfig.create = function create(properties) { + return new WebWidgetConfig(properties); + }; + + /** + * Encodes the specified WebWidgetConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig} message WebWidgetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebWidgetConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modality != null && Object.hasOwnProperty.call(message, "modality")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modality); + if (message.theme != null && Object.hasOwnProperty.call(message, "theme")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.theme); + if (message.webWidgetTitle != null && Object.hasOwnProperty.call(message, "webWidgetTitle")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.webWidgetTitle); + if (message.securitySettings != null && Object.hasOwnProperty.call(message, "securitySettings")) + $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.encode(message.securitySettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebWidgetConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig} message WebWidgetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebWidgetConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebWidgetConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig} WebWidgetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebWidgetConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.modality = reader.int32(); + break; + } + case 2: { + message.theme = reader.int32(); + break; + } + case 3: { + message.webWidgetTitle = reader.string(); + break; + } + case 4: { + message.securitySettings = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebWidgetConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig} WebWidgetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebWidgetConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebWidgetConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebWidgetConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modality != null && message.hasOwnProperty("modality")) + switch (message.modality) { + default: + return "modality: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.theme != null && message.hasOwnProperty("theme")) + switch (message.theme) { + default: + return "theme: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.webWidgetTitle != null && message.hasOwnProperty("webWidgetTitle")) + if (!$util.isString(message.webWidgetTitle)) + return "webWidgetTitle: string expected"; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) { + var error = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.verify(message.securitySettings); + if (error) + return "securitySettings." + error; + } + return null; + }; + + /** + * Creates a WebWidgetConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig} WebWidgetConfig + */ + WebWidgetConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig(); + switch (object.modality) { + default: + if (typeof object.modality === "number") { + message.modality = object.modality; + break; + } + break; + case "MODALITY_UNSPECIFIED": + case 0: + message.modality = 0; + break; + case "CHAT_AND_VOICE": + case 1: + message.modality = 1; + break; + case "VOICE_ONLY": + case 2: + message.modality = 2; + break; + case "CHAT_ONLY": + case 3: + message.modality = 3; + break; + } + switch (object.theme) { + default: + if (typeof object.theme === "number") { + message.theme = object.theme; + break; + } + break; + case "THEME_UNSPECIFIED": + case 0: + message.theme = 0; + break; + case "LIGHT": + case 1: + message.theme = 1; + break; + case "DARK": + case 2: + message.theme = 2; + break; + } + if (object.webWidgetTitle != null) + message.webWidgetTitle = String(object.webWidgetTitle); + if (object.securitySettings != null) { + if (typeof object.securitySettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.securitySettings: object expected"); + message.securitySettings = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.fromObject(object.securitySettings); + } + return message; + }; + + /** + * Creates a plain object from a WebWidgetConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig} message WebWidgetConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebWidgetConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modality = options.enums === String ? "MODALITY_UNSPECIFIED" : 0; + object.theme = options.enums === String ? "THEME_UNSPECIFIED" : 0; + object.webWidgetTitle = ""; + object.securitySettings = null; + } + if (message.modality != null && message.hasOwnProperty("modality")) + object.modality = options.enums === String ? $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality[message.modality] === undefined ? message.modality : $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality[message.modality] : message.modality; + if (message.theme != null && message.hasOwnProperty("theme")) + object.theme = options.enums === String ? $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme[message.theme] === undefined ? message.theme : $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme[message.theme] : message.theme; + if (message.webWidgetTitle != null && message.hasOwnProperty("webWidgetTitle")) + object.webWidgetTitle = message.webWidgetTitle; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) + object.securitySettings = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.toObject(message.securitySettings, options); + return object; + }; + + /** + * Converts this WebWidgetConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @instance + * @returns {Object.} JSON object + */ + WebWidgetConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebWidgetConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebWidgetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig"; + }; + + WebWidgetConfig.SecuritySettings = (function() { + + /** + * Properties of a SecuritySettings. + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @interface ISecuritySettings + * @property {boolean|null} [enablePublicAccess] SecuritySettings enablePublicAccess + * @property {boolean|null} [enableOriginCheck] SecuritySettings enableOriginCheck + * @property {Array.|null} [allowedOrigins] SecuritySettings allowedOrigins + * @property {boolean|null} [enableRecaptcha] SecuritySettings enableRecaptcha + */ + + /** + * Constructs a new SecuritySettings. + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @classdesc Represents a SecuritySettings. + * @implements ISecuritySettings + * @constructor + * @param {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings=} [properties] Properties to set + */ + function SecuritySettings(properties) { + this.allowedOrigins = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecuritySettings enablePublicAccess. + * @member {boolean} enablePublicAccess + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @instance + */ + SecuritySettings.prototype.enablePublicAccess = false; + + /** + * SecuritySettings enableOriginCheck. + * @member {boolean} enableOriginCheck + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @instance + */ + SecuritySettings.prototype.enableOriginCheck = false; + + /** + * SecuritySettings allowedOrigins. + * @member {Array.} allowedOrigins + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @instance + */ + SecuritySettings.prototype.allowedOrigins = $util.emptyArray; + + /** + * SecuritySettings enableRecaptcha. + * @member {boolean} enableRecaptcha + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @instance + */ + SecuritySettings.prototype.enableRecaptcha = false; + + /** + * Creates a new SecuritySettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings instance + */ + SecuritySettings.create = function create(properties) { + return new SecuritySettings(properties); + }; + + /** + * Encodes the specified SecuritySettings message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings} message SecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecuritySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enablePublicAccess != null && Object.hasOwnProperty.call(message, "enablePublicAccess")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePublicAccess); + if (message.allowedOrigins != null && message.allowedOrigins.length) + for (var i = 0; i < message.allowedOrigins.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedOrigins[i]); + if (message.enableRecaptcha != null && Object.hasOwnProperty.call(message, "enableRecaptcha")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableRecaptcha); + if (message.enableOriginCheck != null && Object.hasOwnProperty.call(message, "enableOriginCheck")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableOriginCheck); + return writer; + }; + + /** + * Encodes the specified SecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings} message SecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecuritySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecuritySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enablePublicAccess = reader.bool(); + break; + } + case 4: { + message.enableOriginCheck = reader.bool(); + break; + } + case 2: { + if (!(message.allowedOrigins && message.allowedOrigins.length)) + message.allowedOrigins = []; + message.allowedOrigins.push(reader.string()); + break; + } + case 3: { + message.enableRecaptcha = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecuritySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecuritySettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecuritySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enablePublicAccess != null && message.hasOwnProperty("enablePublicAccess")) + if (typeof message.enablePublicAccess !== "boolean") + return "enablePublicAccess: boolean expected"; + if (message.enableOriginCheck != null && message.hasOwnProperty("enableOriginCheck")) + if (typeof message.enableOriginCheck !== "boolean") + return "enableOriginCheck: boolean expected"; + if (message.allowedOrigins != null && message.hasOwnProperty("allowedOrigins")) { + if (!Array.isArray(message.allowedOrigins)) + return "allowedOrigins: array expected"; + for (var i = 0; i < message.allowedOrigins.length; ++i) + if (!$util.isString(message.allowedOrigins[i])) + return "allowedOrigins: string[] expected"; + } + if (message.enableRecaptcha != null && message.hasOwnProperty("enableRecaptcha")) + if (typeof message.enableRecaptcha !== "boolean") + return "enableRecaptcha: boolean expected"; + return null; + }; + + /** + * Creates a SecuritySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings + */ + SecuritySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings) + return object; + var message = new $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings(); + if (object.enablePublicAccess != null) + message.enablePublicAccess = Boolean(object.enablePublicAccess); + if (object.enableOriginCheck != null) + message.enableOriginCheck = Boolean(object.enableOriginCheck); + if (object.allowedOrigins) { + if (!Array.isArray(object.allowedOrigins)) + throw TypeError(".google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.allowedOrigins: array expected"); + message.allowedOrigins = []; + for (var i = 0; i < object.allowedOrigins.length; ++i) + message.allowedOrigins[i] = String(object.allowedOrigins[i]); + } + if (object.enableRecaptcha != null) + message.enableRecaptcha = Boolean(object.enableRecaptcha); + return message; + }; + + /** + * Creates a plain object from a SecuritySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings} message SecuritySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecuritySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedOrigins = []; + if (options.defaults) { + object.enablePublicAccess = false; + object.enableRecaptcha = false; + object.enableOriginCheck = false; + } + if (message.enablePublicAccess != null && message.hasOwnProperty("enablePublicAccess")) + object.enablePublicAccess = message.enablePublicAccess; + if (message.allowedOrigins && message.allowedOrigins.length) { + object.allowedOrigins = []; + for (var j = 0; j < message.allowedOrigins.length; ++j) + object.allowedOrigins[j] = message.allowedOrigins[j]; + } + if (message.enableRecaptcha != null && message.hasOwnProperty("enableRecaptcha")) + object.enableRecaptcha = message.enableRecaptcha; + if (message.enableOriginCheck != null && message.hasOwnProperty("enableOriginCheck")) + object.enableOriginCheck = message.enableOriginCheck; + return object; + }; + + /** + * Converts this SecuritySettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @instance + * @returns {Object.} JSON object + */ + SecuritySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecuritySettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecuritySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings"; + }; + + return SecuritySettings; + })(); + + /** + * Modality enum. + * @name google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality + * @enum {number} + * @property {number} MODALITY_UNSPECIFIED=0 MODALITY_UNSPECIFIED value + * @property {number} CHAT_AND_VOICE=1 CHAT_AND_VOICE value + * @property {number} VOICE_ONLY=2 VOICE_ONLY value + * @property {number} CHAT_ONLY=3 CHAT_ONLY value + */ + WebWidgetConfig.Modality = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODALITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "CHAT_AND_VOICE"] = 1; + values[valuesById[2] = "VOICE_ONLY"] = 2; + values[valuesById[3] = "CHAT_ONLY"] = 3; + return values; + })(); + + /** + * Theme enum. + * @name google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme + * @enum {number} + * @property {number} THEME_UNSPECIFIED=0 THEME_UNSPECIFIED value + * @property {number} LIGHT=1 LIGHT value + * @property {number} DARK=2 DARK value + */ + WebWidgetConfig.Theme = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "THEME_UNSPECIFIED"] = 0; + values[valuesById[1] = "LIGHT"] = 1; + values[valuesById[2] = "DARK"] = 2; + return values; + })(); + + return WebWidgetConfig; + })(); + + /** + * ChannelType enum. + * @name google.cloud.ces.v1beta.ChannelProfile.ChannelType + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} WEB_UI=2 WEB_UI value + * @property {number} API=3 API value + * @property {number} TWILIO=4 TWILIO value + * @property {number} GOOGLE_TELEPHONY_PLATFORM=5 GOOGLE_TELEPHONY_PLATFORM value + * @property {number} CONTACT_CENTER_AS_A_SERVICE=6 CONTACT_CENTER_AS_A_SERVICE value + * @property {number} FIVE9=7 FIVE9 value + * @property {number} CONTACT_CENTER_INTEGRATION=8 CONTACT_CENTER_INTEGRATION value + */ + ChannelProfile.ChannelType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[2] = "WEB_UI"] = 2; + values[valuesById[3] = "API"] = 3; + values[valuesById[4] = "TWILIO"] = 4; + values[valuesById[5] = "GOOGLE_TELEPHONY_PLATFORM"] = 5; + values[valuesById[6] = "CONTACT_CENTER_AS_A_SERVICE"] = 6; + values[valuesById[7] = "FIVE9"] = 7; + values[valuesById[8] = "CONTACT_CENTER_INTEGRATION"] = 8; + return values; + })(); + + return ChannelProfile; + })(); + + v1beta.Span = (function() { + + /** + * Properties of a Span. + * @memberof google.cloud.ces.v1beta + * @interface ISpan + * @property {string|null} [name] Span name + * @property {google.protobuf.ITimestamp|null} [startTime] Span startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Span endTime + * @property {google.protobuf.IDuration|null} [duration] Span duration + * @property {google.protobuf.IStruct|null} [attributes] Span attributes + * @property {Array.|null} [childSpans] Span childSpans + */ + + /** + * Constructs a new Span. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Span. + * @implements ISpan + * @constructor + * @param {google.cloud.ces.v1beta.ISpan=} [properties] Properties to set + */ + function Span(properties) { + this.childSpans = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Span name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Span + * @instance + */ + Span.prototype.name = ""; + + /** + * Span startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.ces.v1beta.Span + * @instance + */ + Span.prototype.startTime = null; + + /** + * Span endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1beta.Span + * @instance + */ + Span.prototype.endTime = null; + + /** + * Span duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.ces.v1beta.Span + * @instance + */ + Span.prototype.duration = null; + + /** + * Span attributes. + * @member {google.protobuf.IStruct|null|undefined} attributes + * @memberof google.cloud.ces.v1beta.Span + * @instance + */ + Span.prototype.attributes = null; + + /** + * Span childSpans. + * @member {Array.} childSpans + * @memberof google.cloud.ces.v1beta.Span + * @instance + */ + Span.prototype.childSpans = $util.emptyArray; + + /** + * Creates a new Span instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Span + * @static + * @param {google.cloud.ces.v1beta.ISpan=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Span} Span instance + */ + Span.create = function create(properties) { + return new Span(properties); + }; + + /** + * Encodes the specified Span message. Does not implicitly {@link google.cloud.ces.v1beta.Span.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Span + * @static + * @param {google.cloud.ces.v1beta.ISpan} message Span message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Span.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + $root.google.protobuf.Struct.encode(message.attributes, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.childSpans != null && message.childSpans.length) + for (var i = 0; i < message.childSpans.length; ++i) + $root.google.cloud.ces.v1beta.Span.encode(message.childSpans[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Span message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Span.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Span + * @static + * @param {google.cloud.ces.v1beta.ISpan} message Span message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Span.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Span message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Span + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Span} Span + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Span.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Span(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.attributes = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.childSpans && message.childSpans.length)) + message.childSpans = []; + message.childSpans.push($root.google.cloud.ces.v1beta.Span.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Span message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Span + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Span} Span + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Span.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Span message. + * @function verify + * @memberof google.cloud.ces.v1beta.Span + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Span.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string 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.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + var error = $root.google.protobuf.Struct.verify(message.attributes); + if (error) + return "attributes." + error; + } + if (message.childSpans != null && message.hasOwnProperty("childSpans")) { + if (!Array.isArray(message.childSpans)) + return "childSpans: array expected"; + for (var i = 0; i < message.childSpans.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Span.verify(message.childSpans[i]); + if (error) + return "childSpans." + error; + } + } + return null; + }; + + /** + * Creates a Span message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Span + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Span} Span + */ + Span.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Span) + return object; + var message = new $root.google.cloud.ces.v1beta.Span(); + if (object.name != null) + message.name = String(object.name); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Span.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.ces.v1beta.Span.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.ces.v1beta.Span.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.attributes != null) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.ces.v1beta.Span.attributes: object expected"); + message.attributes = $root.google.protobuf.Struct.fromObject(object.attributes); + } + if (object.childSpans) { + if (!Array.isArray(object.childSpans)) + throw TypeError(".google.cloud.ces.v1beta.Span.childSpans: array expected"); + message.childSpans = []; + for (var i = 0; i < object.childSpans.length; ++i) { + if (typeof object.childSpans[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Span.childSpans: object expected"); + message.childSpans[i] = $root.google.cloud.ces.v1beta.Span.fromObject(object.childSpans[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Span message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Span + * @static + * @param {google.cloud.ces.v1beta.Span} message Span + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Span.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.childSpans = []; + if (options.defaults) { + object.name = ""; + object.startTime = null; + object.endTime = null; + object.attributes = null; + object.duration = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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.attributes != null && message.hasOwnProperty("attributes")) + object.attributes = $root.google.protobuf.Struct.toObject(message.attributes, options); + if (message.childSpans && message.childSpans.length) { + object.childSpans = []; + for (var j = 0; j < message.childSpans.length; ++j) + object.childSpans[j] = $root.google.cloud.ces.v1beta.Span.toObject(message.childSpans[j], options); + } + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this Span to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Span + * @instance + * @returns {Object.} JSON object + */ + Span.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Span + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Span + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Span.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Span"; + }; + + return Span; + })(); + + v1beta.AgentService = (function() { + + /** + * Constructs a new AgentService service. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an AgentService + * @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 AgentService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AgentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AgentService; + + /** + * Creates new AgentService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.ces.v1beta.AgentService + * @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 {AgentService} RPC service. Useful where requests and/or responses are streamed. + */ + AgentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listApps}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListAppsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListAppsResponse} [response] ListAppsResponse + */ + + /** + * Calls ListApps. + * @function listApps + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListAppsRequest} request ListAppsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListAppsCallback} callback Node-style callback called with the error, if any, and ListAppsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listApps = function listApps(request, callback) { + return this.rpcCall(listApps, $root.google.cloud.ces.v1beta.ListAppsRequest, $root.google.cloud.ces.v1beta.ListAppsResponse, request, callback); + }, "name", { value: "ListApps" }); + + /** + * Calls ListApps. + * @function listApps + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListAppsRequest} request ListAppsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getApp}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetAppCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.App} [response] App + */ + + /** + * Calls GetApp. + * @function getApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetAppRequest} request GetAppRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetAppCallback} callback Node-style callback called with the error, if any, and App + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getApp = function getApp(request, callback) { + return this.rpcCall(getApp, $root.google.cloud.ces.v1beta.GetAppRequest, $root.google.cloud.ces.v1beta.App, request, callback); + }, "name", { value: "GetApp" }); + + /** + * Calls GetApp. + * @function getApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetAppRequest} request GetAppRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createApp}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef CreateAppCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateApp. + * @function createApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateAppRequest} request CreateAppRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.CreateAppCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createApp = function createApp(request, callback) { + return this.rpcCall(createApp, $root.google.cloud.ces.v1beta.CreateAppRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateApp" }); + + /** + * Calls CreateApp. + * @function createApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateAppRequest} request CreateAppRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateApp}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef UpdateAppCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.App} [response] App + */ + + /** + * Calls UpdateApp. + * @function updateApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateAppRequest} request UpdateAppRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.UpdateAppCallback} callback Node-style callback called with the error, if any, and App + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateApp = function updateApp(request, callback) { + return this.rpcCall(updateApp, $root.google.cloud.ces.v1beta.UpdateAppRequest, $root.google.cloud.ces.v1beta.App, request, callback); + }, "name", { value: "UpdateApp" }); + + /** + * Calls UpdateApp. + * @function updateApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateAppRequest} request UpdateAppRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteApp}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef DeleteAppCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteApp. + * @function deleteApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteAppRequest} request DeleteAppRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.DeleteAppCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteApp = function deleteApp(request, callback) { + return this.rpcCall(deleteApp, $root.google.cloud.ces.v1beta.DeleteAppRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteApp" }); + + /** + * Calls DeleteApp. + * @function deleteApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteAppRequest} request DeleteAppRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|exportApp}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ExportAppCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportApp. + * @function exportApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IExportAppRequest} request ExportAppRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ExportAppCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.exportApp = function exportApp(request, callback) { + return this.rpcCall(exportApp, $root.google.cloud.ces.v1beta.ExportAppRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportApp" }); + + /** + * Calls ExportApp. + * @function exportApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IExportAppRequest} request ExportAppRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|importApp}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ImportAppCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportApp. + * @function importApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IImportAppRequest} request ImportAppRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ImportAppCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.importApp = function importApp(request, callback) { + return this.rpcCall(importApp, $root.google.cloud.ces.v1beta.ImportAppRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportApp" }); + + /** + * Calls ImportApp. + * @function importApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IImportAppRequest} request ImportAppRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listAgents}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListAgentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListAgentsResponse} [response] ListAgentsResponse + */ + + /** + * Calls ListAgents. + * @function listAgents + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListAgentsRequest} request ListAgentsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListAgentsCallback} callback Node-style callback called with the error, if any, and ListAgentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listAgents = function listAgents(request, callback) { + return this.rpcCall(listAgents, $root.google.cloud.ces.v1beta.ListAgentsRequest, $root.google.cloud.ces.v1beta.ListAgentsResponse, request, callback); + }, "name", { value: "ListAgents" }); + + /** + * Calls ListAgents. + * @function listAgents + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListAgentsRequest} request ListAgentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getAgent}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Agent} [response] Agent + */ + + /** + * Calls GetAgent. + * @function getAgent + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetAgentRequest} request GetAgentRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetAgentCallback} callback Node-style callback called with the error, if any, and Agent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getAgent = function getAgent(request, callback) { + return this.rpcCall(getAgent, $root.google.cloud.ces.v1beta.GetAgentRequest, $root.google.cloud.ces.v1beta.Agent, request, callback); + }, "name", { value: "GetAgent" }); + + /** + * Calls GetAgent. + * @function getAgent + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetAgentRequest} request GetAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createAgent}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef CreateAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Agent} [response] Agent + */ + + /** + * Calls CreateAgent. + * @function createAgent + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateAgentRequest} request CreateAgentRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.CreateAgentCallback} callback Node-style callback called with the error, if any, and Agent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createAgent = function createAgent(request, callback) { + return this.rpcCall(createAgent, $root.google.cloud.ces.v1beta.CreateAgentRequest, $root.google.cloud.ces.v1beta.Agent, request, callback); + }, "name", { value: "CreateAgent" }); + + /** + * Calls CreateAgent. + * @function createAgent + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateAgentRequest} request CreateAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateAgent}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef UpdateAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Agent} [response] Agent + */ + + /** + * Calls UpdateAgent. + * @function updateAgent + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateAgentRequest} request UpdateAgentRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.UpdateAgentCallback} callback Node-style callback called with the error, if any, and Agent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateAgent = function updateAgent(request, callback) { + return this.rpcCall(updateAgent, $root.google.cloud.ces.v1beta.UpdateAgentRequest, $root.google.cloud.ces.v1beta.Agent, request, callback); + }, "name", { value: "UpdateAgent" }); + + /** + * Calls UpdateAgent. + * @function updateAgent + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateAgentRequest} request UpdateAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteAgent}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef DeleteAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAgent. + * @function deleteAgent + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteAgentRequest} request DeleteAgentRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.DeleteAgentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteAgent = function deleteAgent(request, callback) { + return this.rpcCall(deleteAgent, $root.google.cloud.ces.v1beta.DeleteAgentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAgent" }); + + /** + * Calls DeleteAgent. + * @function deleteAgent + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteAgentRequest} request DeleteAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listExamples}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListExamplesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListExamplesResponse} [response] ListExamplesResponse + */ + + /** + * Calls ListExamples. + * @function listExamples + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListExamplesRequest} request ListExamplesRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListExamplesCallback} callback Node-style callback called with the error, if any, and ListExamplesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listExamples = function listExamples(request, callback) { + return this.rpcCall(listExamples, $root.google.cloud.ces.v1beta.ListExamplesRequest, $root.google.cloud.ces.v1beta.ListExamplesResponse, request, callback); + }, "name", { value: "ListExamples" }); + + /** + * Calls ListExamples. + * @function listExamples + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListExamplesRequest} request ListExamplesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getExample}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Example} [response] Example + */ + + /** + * Calls GetExample. + * @function getExample + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetExampleRequest} request GetExampleRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetExampleCallback} callback Node-style callback called with the error, if any, and Example + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getExample = function getExample(request, callback) { + return this.rpcCall(getExample, $root.google.cloud.ces.v1beta.GetExampleRequest, $root.google.cloud.ces.v1beta.Example, request, callback); + }, "name", { value: "GetExample" }); + + /** + * Calls GetExample. + * @function getExample + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetExampleRequest} request GetExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createExample}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef CreateExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Example} [response] Example + */ + + /** + * Calls CreateExample. + * @function createExample + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateExampleRequest} request CreateExampleRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.CreateExampleCallback} callback Node-style callback called with the error, if any, and Example + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createExample = function createExample(request, callback) { + return this.rpcCall(createExample, $root.google.cloud.ces.v1beta.CreateExampleRequest, $root.google.cloud.ces.v1beta.Example, request, callback); + }, "name", { value: "CreateExample" }); + + /** + * Calls CreateExample. + * @function createExample + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateExampleRequest} request CreateExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateExample}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef UpdateExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Example} [response] Example + */ + + /** + * Calls UpdateExample. + * @function updateExample + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateExampleRequest} request UpdateExampleRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.UpdateExampleCallback} callback Node-style callback called with the error, if any, and Example + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateExample = function updateExample(request, callback) { + return this.rpcCall(updateExample, $root.google.cloud.ces.v1beta.UpdateExampleRequest, $root.google.cloud.ces.v1beta.Example, request, callback); + }, "name", { value: "UpdateExample" }); + + /** + * Calls UpdateExample. + * @function updateExample + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateExampleRequest} request UpdateExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteExample}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef DeleteExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteExample. + * @function deleteExample + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteExampleRequest} request DeleteExampleRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.DeleteExampleCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteExample = function deleteExample(request, callback) { + return this.rpcCall(deleteExample, $root.google.cloud.ces.v1beta.DeleteExampleRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteExample" }); + + /** + * Calls DeleteExample. + * @function deleteExample + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteExampleRequest} request DeleteExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listTools}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListToolsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListToolsResponse} [response] ListToolsResponse + */ + + /** + * Calls ListTools. + * @function listTools + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListToolsRequest} request ListToolsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListToolsCallback} callback Node-style callback called with the error, if any, and ListToolsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listTools = function listTools(request, callback) { + return this.rpcCall(listTools, $root.google.cloud.ces.v1beta.ListToolsRequest, $root.google.cloud.ces.v1beta.ListToolsResponse, request, callback); + }, "name", { value: "ListTools" }); + + /** + * Calls ListTools. + * @function listTools + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListToolsRequest} request ListToolsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getTool}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Tool} [response] Tool + */ + + /** + * Calls GetTool. + * @function getTool + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetToolRequest} request GetToolRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetToolCallback} callback Node-style callback called with the error, if any, and Tool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getTool = function getTool(request, callback) { + return this.rpcCall(getTool, $root.google.cloud.ces.v1beta.GetToolRequest, $root.google.cloud.ces.v1beta.Tool, request, callback); + }, "name", { value: "GetTool" }); + + /** + * Calls GetTool. + * @function getTool + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetToolRequest} request GetToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listConversations}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListConversationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListConversationsResponse} [response] ListConversationsResponse + */ + + /** + * Calls ListConversations. + * @function listConversations + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListConversationsRequest} request ListConversationsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListConversationsCallback} callback Node-style callback called with the error, if any, and ListConversationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listConversations = function listConversations(request, callback) { + return this.rpcCall(listConversations, $root.google.cloud.ces.v1beta.ListConversationsRequest, $root.google.cloud.ces.v1beta.ListConversationsResponse, request, callback); + }, "name", { value: "ListConversations" }); + + /** + * Calls ListConversations. + * @function listConversations + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListConversationsRequest} request ListConversationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getConversation}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetConversationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Conversation} [response] Conversation + */ + + /** + * Calls GetConversation. + * @function getConversation + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetConversationRequest} request GetConversationRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetConversationCallback} callback Node-style callback called with the error, if any, and Conversation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getConversation = function getConversation(request, callback) { + return this.rpcCall(getConversation, $root.google.cloud.ces.v1beta.GetConversationRequest, $root.google.cloud.ces.v1beta.Conversation, request, callback); + }, "name", { value: "GetConversation" }); + + /** + * Calls GetConversation. + * @function getConversation + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetConversationRequest} request GetConversationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteConversation}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef DeleteConversationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteConversation. + * @function deleteConversation + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteConversationRequest} request DeleteConversationRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.DeleteConversationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteConversation = function deleteConversation(request, callback) { + return this.rpcCall(deleteConversation, $root.google.cloud.ces.v1beta.DeleteConversationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteConversation" }); + + /** + * Calls DeleteConversation. + * @function deleteConversation + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteConversationRequest} request DeleteConversationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|batchDeleteConversations}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef BatchDeleteConversationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchDeleteConversations. + * @function batchDeleteConversations + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsRequest} request BatchDeleteConversationsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.BatchDeleteConversationsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.batchDeleteConversations = function batchDeleteConversations(request, callback) { + return this.rpcCall(batchDeleteConversations, $root.google.cloud.ces.v1beta.BatchDeleteConversationsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchDeleteConversations" }); + + /** + * Calls BatchDeleteConversations. + * @function batchDeleteConversations + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsRequest} request BatchDeleteConversationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createTool}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef CreateToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Tool} [response] Tool + */ + + /** + * Calls CreateTool. + * @function createTool + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateToolRequest} request CreateToolRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.CreateToolCallback} callback Node-style callback called with the error, if any, and Tool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createTool = function createTool(request, callback) { + return this.rpcCall(createTool, $root.google.cloud.ces.v1beta.CreateToolRequest, $root.google.cloud.ces.v1beta.Tool, request, callback); + }, "name", { value: "CreateTool" }); + + /** + * Calls CreateTool. + * @function createTool + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateToolRequest} request CreateToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateTool}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef UpdateToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Tool} [response] Tool + */ + + /** + * Calls UpdateTool. + * @function updateTool + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateToolRequest} request UpdateToolRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.UpdateToolCallback} callback Node-style callback called with the error, if any, and Tool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateTool = function updateTool(request, callback) { + return this.rpcCall(updateTool, $root.google.cloud.ces.v1beta.UpdateToolRequest, $root.google.cloud.ces.v1beta.Tool, request, callback); + }, "name", { value: "UpdateTool" }); + + /** + * Calls UpdateTool. + * @function updateTool + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateToolRequest} request UpdateToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteTool}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef DeleteToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTool. + * @function deleteTool + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteToolRequest} request DeleteToolRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.DeleteToolCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteTool = function deleteTool(request, callback) { + return this.rpcCall(deleteTool, $root.google.cloud.ces.v1beta.DeleteToolRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTool" }); + + /** + * Calls DeleteTool. + * @function deleteTool + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteToolRequest} request DeleteToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listGuardrails}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListGuardrailsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListGuardrailsResponse} [response] ListGuardrailsResponse + */ + + /** + * Calls ListGuardrails. + * @function listGuardrails + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListGuardrailsRequest} request ListGuardrailsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListGuardrailsCallback} callback Node-style callback called with the error, if any, and ListGuardrailsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listGuardrails = function listGuardrails(request, callback) { + return this.rpcCall(listGuardrails, $root.google.cloud.ces.v1beta.ListGuardrailsRequest, $root.google.cloud.ces.v1beta.ListGuardrailsResponse, request, callback); + }, "name", { value: "ListGuardrails" }); + + /** + * Calls ListGuardrails. + * @function listGuardrails + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListGuardrailsRequest} request ListGuardrailsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getGuardrail}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetGuardrailCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Guardrail} [response] Guardrail + */ + + /** + * Calls GetGuardrail. + * @function getGuardrail + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetGuardrailRequest} request GetGuardrailRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetGuardrailCallback} callback Node-style callback called with the error, if any, and Guardrail + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getGuardrail = function getGuardrail(request, callback) { + return this.rpcCall(getGuardrail, $root.google.cloud.ces.v1beta.GetGuardrailRequest, $root.google.cloud.ces.v1beta.Guardrail, request, callback); + }, "name", { value: "GetGuardrail" }); + + /** + * Calls GetGuardrail. + * @function getGuardrail + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetGuardrailRequest} request GetGuardrailRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createGuardrail}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef CreateGuardrailCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Guardrail} [response] Guardrail + */ + + /** + * Calls CreateGuardrail. + * @function createGuardrail + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateGuardrailRequest} request CreateGuardrailRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.CreateGuardrailCallback} callback Node-style callback called with the error, if any, and Guardrail + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createGuardrail = function createGuardrail(request, callback) { + return this.rpcCall(createGuardrail, $root.google.cloud.ces.v1beta.CreateGuardrailRequest, $root.google.cloud.ces.v1beta.Guardrail, request, callback); + }, "name", { value: "CreateGuardrail" }); + + /** + * Calls CreateGuardrail. + * @function createGuardrail + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateGuardrailRequest} request CreateGuardrailRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateGuardrail}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef UpdateGuardrailCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Guardrail} [response] Guardrail + */ + + /** + * Calls UpdateGuardrail. + * @function updateGuardrail + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateGuardrailRequest} request UpdateGuardrailRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.UpdateGuardrailCallback} callback Node-style callback called with the error, if any, and Guardrail + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateGuardrail = function updateGuardrail(request, callback) { + return this.rpcCall(updateGuardrail, $root.google.cloud.ces.v1beta.UpdateGuardrailRequest, $root.google.cloud.ces.v1beta.Guardrail, request, callback); + }, "name", { value: "UpdateGuardrail" }); + + /** + * Calls UpdateGuardrail. + * @function updateGuardrail + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateGuardrailRequest} request UpdateGuardrailRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteGuardrail}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef DeleteGuardrailCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteGuardrail. + * @function deleteGuardrail + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteGuardrailRequest} request DeleteGuardrailRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.DeleteGuardrailCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteGuardrail = function deleteGuardrail(request, callback) { + return this.rpcCall(deleteGuardrail, $root.google.cloud.ces.v1beta.DeleteGuardrailRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteGuardrail" }); + + /** + * Calls DeleteGuardrail. + * @function deleteGuardrail + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteGuardrailRequest} request DeleteGuardrailRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listDeployments}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListDeploymentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListDeploymentsResponse} [response] ListDeploymentsResponse + */ + + /** + * Calls ListDeployments. + * @function listDeployments + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListDeploymentsCallback} callback Node-style callback called with the error, if any, and ListDeploymentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listDeployments = function listDeployments(request, callback) { + return this.rpcCall(listDeployments, $root.google.cloud.ces.v1beta.ListDeploymentsRequest, $root.google.cloud.ces.v1beta.ListDeploymentsResponse, request, callback); + }, "name", { value: "ListDeployments" }); + + /** + * Calls ListDeployments. + * @function listDeployments + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getDeployment}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Deployment} [response] Deployment + */ + + /** + * Calls GetDeployment. + * @function getDeployment + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetDeploymentRequest} request GetDeploymentRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getDeployment = function getDeployment(request, callback) { + return this.rpcCall(getDeployment, $root.google.cloud.ces.v1beta.GetDeploymentRequest, $root.google.cloud.ces.v1beta.Deployment, request, callback); + }, "name", { value: "GetDeployment" }); + + /** + * Calls GetDeployment. + * @function getDeployment + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetDeploymentRequest} request GetDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createDeployment}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef CreateDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Deployment} [response] Deployment + */ + + /** + * Calls CreateDeployment. + * @function createDeployment + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateDeploymentRequest} request CreateDeploymentRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.CreateDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createDeployment = function createDeployment(request, callback) { + return this.rpcCall(createDeployment, $root.google.cloud.ces.v1beta.CreateDeploymentRequest, $root.google.cloud.ces.v1beta.Deployment, request, callback); + }, "name", { value: "CreateDeployment" }); + + /** + * Calls CreateDeployment. + * @function createDeployment + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateDeploymentRequest} request CreateDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateDeployment}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef UpdateDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Deployment} [response] Deployment + */ + + /** + * Calls UpdateDeployment. + * @function updateDeployment + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateDeploymentRequest} request UpdateDeploymentRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.UpdateDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateDeployment = function updateDeployment(request, callback) { + return this.rpcCall(updateDeployment, $root.google.cloud.ces.v1beta.UpdateDeploymentRequest, $root.google.cloud.ces.v1beta.Deployment, request, callback); + }, "name", { value: "UpdateDeployment" }); + + /** + * Calls UpdateDeployment. + * @function updateDeployment + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateDeploymentRequest} request UpdateDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteDeployment}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef DeleteDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDeployment. + * @function deleteDeployment + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteDeploymentRequest} request DeleteDeploymentRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.DeleteDeploymentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteDeployment = function deleteDeployment(request, callback) { + return this.rpcCall(deleteDeployment, $root.google.cloud.ces.v1beta.DeleteDeploymentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDeployment" }); + + /** + * Calls DeleteDeployment. + * @function deleteDeployment + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteDeploymentRequest} request DeleteDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listToolsets}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListToolsetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListToolsetsResponse} [response] ListToolsetsResponse + */ + + /** + * Calls ListToolsets. + * @function listToolsets + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListToolsetsRequest} request ListToolsetsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListToolsetsCallback} callback Node-style callback called with the error, if any, and ListToolsetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listToolsets = function listToolsets(request, callback) { + return this.rpcCall(listToolsets, $root.google.cloud.ces.v1beta.ListToolsetsRequest, $root.google.cloud.ces.v1beta.ListToolsetsResponse, request, callback); + }, "name", { value: "ListToolsets" }); + + /** + * Calls ListToolsets. + * @function listToolsets + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListToolsetsRequest} request ListToolsetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getToolset}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetToolsetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Toolset} [response] Toolset + */ + + /** + * Calls GetToolset. + * @function getToolset + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetToolsetRequest} request GetToolsetRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetToolsetCallback} callback Node-style callback called with the error, if any, and Toolset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getToolset = function getToolset(request, callback) { + return this.rpcCall(getToolset, $root.google.cloud.ces.v1beta.GetToolsetRequest, $root.google.cloud.ces.v1beta.Toolset, request, callback); + }, "name", { value: "GetToolset" }); + + /** + * Calls GetToolset. + * @function getToolset + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetToolsetRequest} request GetToolsetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createToolset}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef CreateToolsetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Toolset} [response] Toolset + */ + + /** + * Calls CreateToolset. + * @function createToolset + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateToolsetRequest} request CreateToolsetRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.CreateToolsetCallback} callback Node-style callback called with the error, if any, and Toolset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createToolset = function createToolset(request, callback) { + return this.rpcCall(createToolset, $root.google.cloud.ces.v1beta.CreateToolsetRequest, $root.google.cloud.ces.v1beta.Toolset, request, callback); + }, "name", { value: "CreateToolset" }); + + /** + * Calls CreateToolset. + * @function createToolset + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateToolsetRequest} request CreateToolsetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateToolset}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef UpdateToolsetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Toolset} [response] Toolset + */ + + /** + * Calls UpdateToolset. + * @function updateToolset + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateToolsetRequest} request UpdateToolsetRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.UpdateToolsetCallback} callback Node-style callback called with the error, if any, and Toolset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateToolset = function updateToolset(request, callback) { + return this.rpcCall(updateToolset, $root.google.cloud.ces.v1beta.UpdateToolsetRequest, $root.google.cloud.ces.v1beta.Toolset, request, callback); + }, "name", { value: "UpdateToolset" }); + + /** + * Calls UpdateToolset. + * @function updateToolset + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateToolsetRequest} request UpdateToolsetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteToolset}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef DeleteToolsetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteToolset. + * @function deleteToolset + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteToolsetRequest} request DeleteToolsetRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.DeleteToolsetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteToolset = function deleteToolset(request, callback) { + return this.rpcCall(deleteToolset, $root.google.cloud.ces.v1beta.DeleteToolsetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteToolset" }); + + /** + * Calls DeleteToolset. + * @function deleteToolset + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteToolsetRequest} request DeleteToolsetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listAppVersions}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListAppVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListAppVersionsResponse} [response] ListAppVersionsResponse + */ + + /** + * Calls ListAppVersions. + * @function listAppVersions + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListAppVersionsRequest} request ListAppVersionsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListAppVersionsCallback} callback Node-style callback called with the error, if any, and ListAppVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listAppVersions = function listAppVersions(request, callback) { + return this.rpcCall(listAppVersions, $root.google.cloud.ces.v1beta.ListAppVersionsRequest, $root.google.cloud.ces.v1beta.ListAppVersionsResponse, request, callback); + }, "name", { value: "ListAppVersions" }); + + /** + * Calls ListAppVersions. + * @function listAppVersions + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListAppVersionsRequest} request ListAppVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getAppVersion}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetAppVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.AppVersion} [response] AppVersion + */ + + /** + * Calls GetAppVersion. + * @function getAppVersion + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetAppVersionRequest} request GetAppVersionRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetAppVersionCallback} callback Node-style callback called with the error, if any, and AppVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getAppVersion = function getAppVersion(request, callback) { + return this.rpcCall(getAppVersion, $root.google.cloud.ces.v1beta.GetAppVersionRequest, $root.google.cloud.ces.v1beta.AppVersion, request, callback); + }, "name", { value: "GetAppVersion" }); + + /** + * Calls GetAppVersion. + * @function getAppVersion + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetAppVersionRequest} request GetAppVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createAppVersion}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef CreateAppVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.AppVersion} [response] AppVersion + */ + + /** + * Calls CreateAppVersion. + * @function createAppVersion + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateAppVersionRequest} request CreateAppVersionRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.CreateAppVersionCallback} callback Node-style callback called with the error, if any, and AppVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createAppVersion = function createAppVersion(request, callback) { + return this.rpcCall(createAppVersion, $root.google.cloud.ces.v1beta.CreateAppVersionRequest, $root.google.cloud.ces.v1beta.AppVersion, request, callback); + }, "name", { value: "CreateAppVersion" }); + + /** + * Calls CreateAppVersion. + * @function createAppVersion + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateAppVersionRequest} request CreateAppVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteAppVersion}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef DeleteAppVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAppVersion. + * @function deleteAppVersion + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteAppVersionRequest} request DeleteAppVersionRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.DeleteAppVersionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteAppVersion = function deleteAppVersion(request, callback) { + return this.rpcCall(deleteAppVersion, $root.google.cloud.ces.v1beta.DeleteAppVersionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAppVersion" }); + + /** + * Calls DeleteAppVersion. + * @function deleteAppVersion + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteAppVersionRequest} request DeleteAppVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|restoreAppVersion}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef RestoreAppVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreAppVersion. + * @function restoreAppVersion + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IRestoreAppVersionRequest} request RestoreAppVersionRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.RestoreAppVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.restoreAppVersion = function restoreAppVersion(request, callback) { + return this.rpcCall(restoreAppVersion, $root.google.cloud.ces.v1beta.RestoreAppVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreAppVersion" }); + + /** + * Calls RestoreAppVersion. + * @function restoreAppVersion + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IRestoreAppVersionRequest} request RestoreAppVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listChangelogs}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListChangelogsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListChangelogsResponse} [response] ListChangelogsResponse + */ + + /** + * Calls ListChangelogs. + * @function listChangelogs + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListChangelogsRequest} request ListChangelogsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListChangelogsCallback} callback Node-style callback called with the error, if any, and ListChangelogsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listChangelogs = function listChangelogs(request, callback) { + return this.rpcCall(listChangelogs, $root.google.cloud.ces.v1beta.ListChangelogsRequest, $root.google.cloud.ces.v1beta.ListChangelogsResponse, request, callback); + }, "name", { value: "ListChangelogs" }); + + /** + * Calls ListChangelogs. + * @function listChangelogs + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListChangelogsRequest} request ListChangelogsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getChangelog}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetChangelogCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Changelog} [response] Changelog + */ + + /** + * Calls GetChangelog. + * @function getChangelog + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetChangelogRequest} request GetChangelogRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetChangelogCallback} callback Node-style callback called with the error, if any, and Changelog + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getChangelog = function getChangelog(request, callback) { + return this.rpcCall(getChangelog, $root.google.cloud.ces.v1beta.GetChangelogRequest, $root.google.cloud.ces.v1beta.Changelog, request, callback); + }, "name", { value: "GetChangelog" }); + + /** + * Calls GetChangelog. + * @function getChangelog + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetChangelogRequest} request GetChangelogRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AgentService; + })(); + + v1beta.ListAppsRequest = (function() { + + /** + * Properties of a ListAppsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListAppsRequest + * @property {string|null} [parent] ListAppsRequest parent + * @property {number|null} [pageSize] ListAppsRequest pageSize + * @property {string|null} [pageToken] ListAppsRequest pageToken + * @property {string|null} [filter] ListAppsRequest filter + * @property {string|null} [orderBy] ListAppsRequest orderBy + */ + + /** + * Constructs a new ListAppsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListAppsRequest. + * @implements IListAppsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListAppsRequest=} [properties] Properties to set + */ + function ListAppsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAppsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @instance + */ + ListAppsRequest.prototype.parent = ""; + + /** + * ListAppsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @instance + */ + ListAppsRequest.prototype.pageSize = 0; + + /** + * ListAppsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @instance + */ + ListAppsRequest.prototype.pageToken = ""; + + /** + * ListAppsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @instance + */ + ListAppsRequest.prototype.filter = ""; + + /** + * ListAppsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @instance + */ + ListAppsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListAppsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @static + * @param {google.cloud.ces.v1beta.IListAppsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListAppsRequest} ListAppsRequest instance + */ + ListAppsRequest.create = function create(properties) { + return new ListAppsRequest(properties); + }; + + /** + * Encodes the specified ListAppsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @static + * @param {google.cloud.ces.v1beta.IListAppsRequest} message ListAppsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppsRequest.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 ListAppsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @static + * @param {google.cloud.ces.v1beta.IListAppsRequest} message ListAppsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAppsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListAppsRequest} ListAppsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListAppsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAppsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListAppsRequest} ListAppsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAppsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAppsRequest.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 ListAppsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListAppsRequest} ListAppsRequest + */ + ListAppsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListAppsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListAppsRequest(); + 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 ListAppsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @static + * @param {google.cloud.ces.v1beta.ListAppsRequest} message ListAppsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAppsRequest.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 ListAppsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAppsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAppsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAppsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListAppsRequest"; + }; + + return ListAppsRequest; + })(); + + v1beta.ListAppsResponse = (function() { + + /** + * Properties of a ListAppsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListAppsResponse + * @property {Array.|null} [apps] ListAppsResponse apps + * @property {string|null} [nextPageToken] ListAppsResponse nextPageToken + * @property {Array.|null} [unreachable] ListAppsResponse unreachable + */ + + /** + * Constructs a new ListAppsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListAppsResponse. + * @implements IListAppsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListAppsResponse=} [properties] Properties to set + */ + function ListAppsResponse(properties) { + this.apps = []; + 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]]; + } + + /** + * ListAppsResponse apps. + * @member {Array.} apps + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @instance + */ + ListAppsResponse.prototype.apps = $util.emptyArray; + + /** + * ListAppsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @instance + */ + ListAppsResponse.prototype.nextPageToken = ""; + + /** + * ListAppsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @instance + */ + ListAppsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListAppsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @static + * @param {google.cloud.ces.v1beta.IListAppsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListAppsResponse} ListAppsResponse instance + */ + ListAppsResponse.create = function create(properties) { + return new ListAppsResponse(properties); + }; + + /** + * Encodes the specified ListAppsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @static + * @param {google.cloud.ces.v1beta.IListAppsResponse} message ListAppsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apps != null && message.apps.length) + for (var i = 0; i < message.apps.length; ++i) + $root.google.cloud.ces.v1beta.App.encode(message.apps[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 ListAppsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @static + * @param {google.cloud.ces.v1beta.IListAppsResponse} message ListAppsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAppsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListAppsResponse} ListAppsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListAppsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.apps && message.apps.length)) + message.apps = []; + message.apps.push($root.google.cloud.ces.v1beta.App.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 ListAppsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListAppsResponse} ListAppsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAppsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAppsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apps != null && message.hasOwnProperty("apps")) { + if (!Array.isArray(message.apps)) + return "apps: array expected"; + for (var i = 0; i < message.apps.length; ++i) { + var error = $root.google.cloud.ces.v1beta.App.verify(message.apps[i]); + if (error) + return "apps." + 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 ListAppsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListAppsResponse} ListAppsResponse + */ + ListAppsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListAppsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListAppsResponse(); + if (object.apps) { + if (!Array.isArray(object.apps)) + throw TypeError(".google.cloud.ces.v1beta.ListAppsResponse.apps: array expected"); + message.apps = []; + for (var i = 0; i < object.apps.length; ++i) { + if (typeof object.apps[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListAppsResponse.apps: object expected"); + message.apps[i] = $root.google.cloud.ces.v1beta.App.fromObject(object.apps[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.ces.v1beta.ListAppsResponse.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 ListAppsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @static + * @param {google.cloud.ces.v1beta.ListAppsResponse} message ListAppsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAppsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.apps = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.apps && message.apps.length) { + object.apps = []; + for (var j = 0; j < message.apps.length; ++j) + object.apps[j] = $root.google.cloud.ces.v1beta.App.toObject(message.apps[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 ListAppsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAppsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAppsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAppsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListAppsResponse"; + }; + + return ListAppsResponse; + })(); + + v1beta.GetAppRequest = (function() { + + /** + * Properties of a GetAppRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetAppRequest + * @property {string|null} [name] GetAppRequest name + */ + + /** + * Constructs a new GetAppRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetAppRequest. + * @implements IGetAppRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetAppRequest=} [properties] Properties to set + */ + function GetAppRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAppRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @instance + */ + GetAppRequest.prototype.name = ""; + + /** + * Creates a new GetAppRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @static + * @param {google.cloud.ces.v1beta.IGetAppRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetAppRequest} GetAppRequest instance + */ + GetAppRequest.create = function create(properties) { + return new GetAppRequest(properties); + }; + + /** + * Encodes the specified GetAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetAppRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @static + * @param {google.cloud.ces.v1beta.IGetAppRequest} message GetAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAppRequest.encode = function encode(message, writer) { + 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 GetAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetAppRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @static + * @param {google.cloud.ces.v1beta.IGetAppRequest} message GetAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAppRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAppRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetAppRequest} GetAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAppRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetAppRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAppRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetAppRequest} GetAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAppRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAppRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAppRequest.verify = function verify(message) { + if (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 GetAppRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetAppRequest} GetAppRequest + */ + GetAppRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetAppRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetAppRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAppRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @static + * @param {google.cloud.ces.v1beta.GetAppRequest} message GetAppRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAppRequest.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 GetAppRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @instance + * @returns {Object.} JSON object + */ + GetAppRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAppRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetAppRequest"; + }; + + return GetAppRequest; + })(); + + v1beta.CreateAppRequest = (function() { + + /** + * Properties of a CreateAppRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateAppRequest + * @property {string|null} [parent] CreateAppRequest parent + * @property {string|null} [appId] CreateAppRequest appId + * @property {google.cloud.ces.v1beta.IApp|null} [app] CreateAppRequest app + */ + + /** + * Constructs a new CreateAppRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateAppRequest. + * @implements ICreateAppRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateAppRequest=} [properties] Properties to set + */ + function CreateAppRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAppRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @instance + */ + CreateAppRequest.prototype.parent = ""; + + /** + * CreateAppRequest appId. + * @member {string} appId + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @instance + */ + CreateAppRequest.prototype.appId = ""; + + /** + * CreateAppRequest app. + * @member {google.cloud.ces.v1beta.IApp|null|undefined} app + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @instance + */ + CreateAppRequest.prototype.app = null; + + /** + * Creates a new CreateAppRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateAppRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateAppRequest} CreateAppRequest instance + */ + CreateAppRequest.create = function create(properties) { + return new CreateAppRequest(properties); + }; + + /** + * Encodes the specified CreateAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateAppRequest} message CreateAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAppRequest.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.appId != null && Object.hasOwnProperty.call(message, "appId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appId); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + $root.google.cloud.ces.v1beta.App.encode(message.app, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateAppRequest} message CreateAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAppRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAppRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateAppRequest} CreateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAppRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateAppRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.appId = reader.string(); + break; + } + case 3: { + message.app = $root.google.cloud.ces.v1beta.App.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAppRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateAppRequest} CreateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAppRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAppRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAppRequest.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.appId != null && message.hasOwnProperty("appId")) + if (!$util.isString(message.appId)) + return "appId: string expected"; + if (message.app != null && message.hasOwnProperty("app")) { + var error = $root.google.cloud.ces.v1beta.App.verify(message.app); + if (error) + return "app." + error; + } + return null; + }; + + /** + * Creates a CreateAppRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateAppRequest} CreateAppRequest + */ + CreateAppRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateAppRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateAppRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.appId != null) + message.appId = String(object.appId); + if (object.app != null) { + if (typeof object.app !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateAppRequest.app: object expected"); + message.app = $root.google.cloud.ces.v1beta.App.fromObject(object.app); + } + return message; + }; + + /** + * Creates a plain object from a CreateAppRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @static + * @param {google.cloud.ces.v1beta.CreateAppRequest} message CreateAppRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAppRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.appId = ""; + object.app = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.appId != null && message.hasOwnProperty("appId")) + object.appId = message.appId; + if (message.app != null && message.hasOwnProperty("app")) + object.app = $root.google.cloud.ces.v1beta.App.toObject(message.app, options); + return object; + }; + + /** + * Converts this CreateAppRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAppRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAppRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateAppRequest"; + }; + + return CreateAppRequest; + })(); + + v1beta.UpdateAppRequest = (function() { + + /** + * Properties of an UpdateAppRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateAppRequest + * @property {google.cloud.ces.v1beta.IApp|null} [app] UpdateAppRequest app + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAppRequest updateMask + */ + + /** + * Constructs a new UpdateAppRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateAppRequest. + * @implements IUpdateAppRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateAppRequest=} [properties] Properties to set + */ + function UpdateAppRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAppRequest app. + * @member {google.cloud.ces.v1beta.IApp|null|undefined} app + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @instance + */ + UpdateAppRequest.prototype.app = null; + + /** + * UpdateAppRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @instance + */ + UpdateAppRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAppRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateAppRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateAppRequest} UpdateAppRequest instance + */ + UpdateAppRequest.create = function create(properties) { + return new UpdateAppRequest(properties); + }; + + /** + * Encodes the specified UpdateAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAppRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateAppRequest} message UpdateAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAppRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + $root.google.cloud.ces.v1beta.App.encode(message.app, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAppRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateAppRequest} message UpdateAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAppRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAppRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateAppRequest} UpdateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAppRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateAppRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.app = $root.google.cloud.ces.v1beta.App.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAppRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateAppRequest} UpdateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAppRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAppRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAppRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.app != null && message.hasOwnProperty("app")) { + var error = $root.google.cloud.ces.v1beta.App.verify(message.app); + if (error) + return "app." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateAppRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateAppRequest} UpdateAppRequest + */ + UpdateAppRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateAppRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateAppRequest(); + if (object.app != null) { + if (typeof object.app !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateAppRequest.app: object expected"); + message.app = $root.google.cloud.ces.v1beta.App.fromObject(object.app); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateAppRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAppRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateAppRequest} message UpdateAppRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAppRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.app = null; + object.updateMask = null; + } + if (message.app != null && message.hasOwnProperty("app")) + object.app = $root.google.cloud.ces.v1beta.App.toObject(message.app, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAppRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAppRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAppRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateAppRequest"; + }; + + return UpdateAppRequest; + })(); + + v1beta.DeleteAppRequest = (function() { + + /** + * Properties of a DeleteAppRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteAppRequest + * @property {string|null} [name] DeleteAppRequest name + * @property {string|null} [etag] DeleteAppRequest etag + */ + + /** + * Constructs a new DeleteAppRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteAppRequest. + * @implements IDeleteAppRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteAppRequest=} [properties] Properties to set + */ + function DeleteAppRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAppRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @instance + */ + DeleteAppRequest.prototype.name = ""; + + /** + * DeleteAppRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @instance + */ + DeleteAppRequest.prototype.etag = ""; + + /** + * Creates a new DeleteAppRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteAppRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteAppRequest} DeleteAppRequest instance + */ + DeleteAppRequest.create = function create(properties) { + return new DeleteAppRequest(properties); + }; + + /** + * Encodes the specified DeleteAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteAppRequest} message DeleteAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAppRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteAppRequest} message DeleteAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAppRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAppRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteAppRequest} DeleteAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAppRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteAppRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAppRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteAppRequest} DeleteAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAppRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAppRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAppRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteAppRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteAppRequest} DeleteAppRequest + */ + DeleteAppRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteAppRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteAppRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteAppRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteAppRequest} message DeleteAppRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAppRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteAppRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAppRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAppRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteAppRequest"; + }; + + return DeleteAppRequest; + })(); + + v1beta.ExportAppRequest = (function() { + + /** + * Properties of an ExportAppRequest. + * @memberof google.cloud.ces.v1beta + * @interface IExportAppRequest + * @property {string|null} [name] ExportAppRequest name + * @property {google.cloud.ces.v1beta.ExportAppRequest.ExportFormat|null} [exportFormat] ExportAppRequest exportFormat + * @property {string|null} [gcsUri] ExportAppRequest gcsUri + */ + + /** + * Constructs a new ExportAppRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ExportAppRequest. + * @implements IExportAppRequest + * @constructor + * @param {google.cloud.ces.v1beta.IExportAppRequest=} [properties] Properties to set + */ + function ExportAppRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportAppRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @instance + */ + ExportAppRequest.prototype.name = ""; + + /** + * ExportAppRequest exportFormat. + * @member {google.cloud.ces.v1beta.ExportAppRequest.ExportFormat} exportFormat + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @instance + */ + ExportAppRequest.prototype.exportFormat = 0; + + /** + * ExportAppRequest gcsUri. + * @member {string} gcsUri + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @instance + */ + ExportAppRequest.prototype.gcsUri = ""; + + /** + * Creates a new ExportAppRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @static + * @param {google.cloud.ces.v1beta.IExportAppRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ExportAppRequest} ExportAppRequest instance + */ + ExportAppRequest.create = function create(properties) { + return new ExportAppRequest(properties); + }; + + /** + * Encodes the specified ExportAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @static + * @param {google.cloud.ces.v1beta.IExportAppRequest} message ExportAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAppRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.exportFormat != null && Object.hasOwnProperty.call(message, "exportFormat")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.exportFormat); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsUri); + return writer; + }; + + /** + * Encodes the specified ExportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @static + * @param {google.cloud.ces.v1beta.IExportAppRequest} message ExportAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAppRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAppRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ExportAppRequest} ExportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAppRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ExportAppRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.exportFormat = reader.int32(); + break; + } + case 3: { + message.gcsUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAppRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ExportAppRequest} ExportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAppRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAppRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAppRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.exportFormat != null && message.hasOwnProperty("exportFormat")) + switch (message.exportFormat) { + default: + return "exportFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + return null; + }; + + /** + * Creates an ExportAppRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ExportAppRequest} ExportAppRequest + */ + ExportAppRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ExportAppRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ExportAppRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.exportFormat) { + default: + if (typeof object.exportFormat === "number") { + message.exportFormat = object.exportFormat; + break; + } + break; + case "EXPORT_FORMAT_UNSPECIFIED": + case 0: + message.exportFormat = 0; + break; + case "JSON": + case 1: + message.exportFormat = 1; + break; + case "YAML": + case 2: + message.exportFormat = 2; + break; + } + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + return message; + }; + + /** + * Creates a plain object from an ExportAppRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @static + * @param {google.cloud.ces.v1beta.ExportAppRequest} message ExportAppRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAppRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.exportFormat = options.enums === String ? "EXPORT_FORMAT_UNSPECIFIED" : 0; + object.gcsUri = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.exportFormat != null && message.hasOwnProperty("exportFormat")) + object.exportFormat = options.enums === String ? $root.google.cloud.ces.v1beta.ExportAppRequest.ExportFormat[message.exportFormat] === undefined ? message.exportFormat : $root.google.cloud.ces.v1beta.ExportAppRequest.ExportFormat[message.exportFormat] : message.exportFormat; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + object.gcsUri = message.gcsUri; + return object; + }; + + /** + * Converts this ExportAppRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @instance + * @returns {Object.} JSON object + */ + ExportAppRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportAppRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ExportAppRequest"; + }; + + /** + * ExportFormat enum. + * @name google.cloud.ces.v1beta.ExportAppRequest.ExportFormat + * @enum {number} + * @property {number} EXPORT_FORMAT_UNSPECIFIED=0 EXPORT_FORMAT_UNSPECIFIED value + * @property {number} JSON=1 JSON value + * @property {number} YAML=2 YAML value + */ + ExportAppRequest.ExportFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXPORT_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "JSON"] = 1; + values[valuesById[2] = "YAML"] = 2; + return values; + })(); + + return ExportAppRequest; + })(); + + v1beta.ExportAppResponse = (function() { + + /** + * Properties of an ExportAppResponse. + * @memberof google.cloud.ces.v1beta + * @interface IExportAppResponse + * @property {Uint8Array|null} [appContent] ExportAppResponse appContent + * @property {string|null} [appUri] ExportAppResponse appUri + */ + + /** + * Constructs a new ExportAppResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ExportAppResponse. + * @implements IExportAppResponse + * @constructor + * @param {google.cloud.ces.v1beta.IExportAppResponse=} [properties] Properties to set + */ + function ExportAppResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportAppResponse appContent. + * @member {Uint8Array|null|undefined} appContent + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @instance + */ + ExportAppResponse.prototype.appContent = null; + + /** + * ExportAppResponse appUri. + * @member {string|null|undefined} appUri + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @instance + */ + ExportAppResponse.prototype.appUri = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportAppResponse app. + * @member {"appContent"|"appUri"|undefined} app + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @instance + */ + Object.defineProperty(ExportAppResponse.prototype, "app", { + get: $util.oneOfGetter($oneOfFields = ["appContent", "appUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportAppResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @static + * @param {google.cloud.ces.v1beta.IExportAppResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ExportAppResponse} ExportAppResponse instance + */ + ExportAppResponse.create = function create(properties) { + return new ExportAppResponse(properties); + }; + + /** + * Encodes the specified ExportAppResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @static + * @param {google.cloud.ces.v1beta.IExportAppResponse} message ExportAppResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAppResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appContent != null && Object.hasOwnProperty.call(message, "appContent")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.appContent); + if (message.appUri != null && Object.hasOwnProperty.call(message, "appUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appUri); + return writer; + }; + + /** + * Encodes the specified ExportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @static + * @param {google.cloud.ces.v1beta.IExportAppResponse} message ExportAppResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAppResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAppResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ExportAppResponse} ExportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAppResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ExportAppResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.appContent = reader.bytes(); + break; + } + case 2: { + message.appUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAppResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ExportAppResponse} ExportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAppResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAppResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAppResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.appContent != null && message.hasOwnProperty("appContent")) { + properties.app = 1; + if (!(message.appContent && typeof message.appContent.length === "number" || $util.isString(message.appContent))) + return "appContent: buffer expected"; + } + if (message.appUri != null && message.hasOwnProperty("appUri")) { + if (properties.app === 1) + return "app: multiple values"; + properties.app = 1; + if (!$util.isString(message.appUri)) + return "appUri: string expected"; + } + return null; + }; + + /** + * Creates an ExportAppResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ExportAppResponse} ExportAppResponse + */ + ExportAppResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ExportAppResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ExportAppResponse(); + if (object.appContent != null) + if (typeof object.appContent === "string") + $util.base64.decode(object.appContent, message.appContent = $util.newBuffer($util.base64.length(object.appContent)), 0); + else if (object.appContent.length >= 0) + message.appContent = object.appContent; + if (object.appUri != null) + message.appUri = String(object.appUri); + return message; + }; + + /** + * Creates a plain object from an ExportAppResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @static + * @param {google.cloud.ces.v1beta.ExportAppResponse} message ExportAppResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAppResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.appContent != null && message.hasOwnProperty("appContent")) { + object.appContent = options.bytes === String ? $util.base64.encode(message.appContent, 0, message.appContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.appContent) : message.appContent; + if (options.oneofs) + object.app = "appContent"; + } + if (message.appUri != null && message.hasOwnProperty("appUri")) { + object.appUri = message.appUri; + if (options.oneofs) + object.app = "appUri"; + } + return object; + }; + + /** + * Converts this ExportAppResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @instance + * @returns {Object.} JSON object + */ + ExportAppResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportAppResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportAppResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ExportAppResponse"; + }; + + return ExportAppResponse; + })(); + + v1beta.ImportAppRequest = (function() { + + /** + * Properties of an ImportAppRequest. + * @memberof google.cloud.ces.v1beta + * @interface IImportAppRequest + * @property {string|null} [gcsUri] ImportAppRequest gcsUri + * @property {Uint8Array|null} [appContent] ImportAppRequest appContent + * @property {string|null} [parent] ImportAppRequest parent + * @property {string|null} [displayName] ImportAppRequest displayName + * @property {string|null} [appId] ImportAppRequest appId + * @property {google.cloud.ces.v1beta.ImportAppRequest.IImportOptions|null} [importOptions] ImportAppRequest importOptions + * @property {boolean|null} [ignoreAppLock] ImportAppRequest ignoreAppLock + */ + + /** + * Constructs a new ImportAppRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ImportAppRequest. + * @implements IImportAppRequest + * @constructor + * @param {google.cloud.ces.v1beta.IImportAppRequest=} [properties] Properties to set + */ + function ImportAppRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportAppRequest gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.gcsUri = null; + + /** + * ImportAppRequest appContent. + * @member {Uint8Array|null|undefined} appContent + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.appContent = null; + + /** + * ImportAppRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.parent = ""; + + /** + * ImportAppRequest displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.displayName = ""; + + /** + * ImportAppRequest appId. + * @member {string} appId + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.appId = ""; + + /** + * ImportAppRequest importOptions. + * @member {google.cloud.ces.v1beta.ImportAppRequest.IImportOptions|null|undefined} importOptions + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.importOptions = null; + + /** + * ImportAppRequest ignoreAppLock. + * @member {boolean} ignoreAppLock + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.ignoreAppLock = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportAppRequest app. + * @member {"gcsUri"|"appContent"|undefined} app + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @instance + */ + Object.defineProperty(ImportAppRequest.prototype, "app", { + get: $util.oneOfGetter($oneOfFields = ["gcsUri", "appContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportAppRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @static + * @param {google.cloud.ces.v1beta.IImportAppRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ImportAppRequest} ImportAppRequest instance + */ + ImportAppRequest.create = function create(properties) { + return new ImportAppRequest(properties); + }; + + /** + * Encodes the specified ImportAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @static + * @param {google.cloud.ces.v1beta.IImportAppRequest} message ImportAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportAppRequest.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.appId != null && Object.hasOwnProperty.call(message, "appId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.appId); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.gcsUri); + if (message.appContent != null && Object.hasOwnProperty.call(message, "appContent")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.appContent); + if (message.importOptions != null && Object.hasOwnProperty.call(message, "importOptions")) + $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.encode(message.importOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.ignoreAppLock != null && Object.hasOwnProperty.call(message, "ignoreAppLock")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.ignoreAppLock); + return writer; + }; + + /** + * Encodes the specified ImportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @static + * @param {google.cloud.ces.v1beta.IImportAppRequest} message ImportAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportAppRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportAppRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ImportAppRequest} ImportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportAppRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportAppRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.gcsUri = reader.string(); + break; + } + case 5: { + message.appContent = reader.bytes(); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.appId = reader.string(); + break; + } + case 6: { + message.importOptions = $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.decode(reader, reader.uint32()); + break; + } + case 7: { + message.ignoreAppLock = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportAppRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ImportAppRequest} ImportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportAppRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportAppRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportAppRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + properties.app = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + if (message.appContent != null && message.hasOwnProperty("appContent")) { + if (properties.app === 1) + return "app: multiple values"; + properties.app = 1; + if (!(message.appContent && typeof message.appContent.length === "number" || $util.isString(message.appContent))) + return "appContent: buffer expected"; + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.appId != null && message.hasOwnProperty("appId")) + if (!$util.isString(message.appId)) + return "appId: string expected"; + if (message.importOptions != null && message.hasOwnProperty("importOptions")) { + var error = $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.verify(message.importOptions); + if (error) + return "importOptions." + error; + } + if (message.ignoreAppLock != null && message.hasOwnProperty("ignoreAppLock")) + if (typeof message.ignoreAppLock !== "boolean") + return "ignoreAppLock: boolean expected"; + return null; + }; + + /** + * Creates an ImportAppRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ImportAppRequest} ImportAppRequest + */ + ImportAppRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ImportAppRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ImportAppRequest(); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.appContent != null) + if (typeof object.appContent === "string") + $util.base64.decode(object.appContent, message.appContent = $util.newBuffer($util.base64.length(object.appContent)), 0); + else if (object.appContent.length >= 0) + message.appContent = object.appContent; + if (object.parent != null) + message.parent = String(object.parent); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.appId != null) + message.appId = String(object.appId); + if (object.importOptions != null) { + if (typeof object.importOptions !== "object") + throw TypeError(".google.cloud.ces.v1beta.ImportAppRequest.importOptions: object expected"); + message.importOptions = $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.fromObject(object.importOptions); + } + if (object.ignoreAppLock != null) + message.ignoreAppLock = Boolean(object.ignoreAppLock); + return message; + }; + + /** + * Creates a plain object from an ImportAppRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @static + * @param {google.cloud.ces.v1beta.ImportAppRequest} message ImportAppRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportAppRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.displayName = ""; + object.appId = ""; + object.importOptions = null; + object.ignoreAppLock = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.appId != null && message.hasOwnProperty("appId")) + object.appId = message.appId; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.app = "gcsUri"; + } + if (message.appContent != null && message.hasOwnProperty("appContent")) { + object.appContent = options.bytes === String ? $util.base64.encode(message.appContent, 0, message.appContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.appContent) : message.appContent; + if (options.oneofs) + object.app = "appContent"; + } + if (message.importOptions != null && message.hasOwnProperty("importOptions")) + object.importOptions = $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.toObject(message.importOptions, options); + if (message.ignoreAppLock != null && message.hasOwnProperty("ignoreAppLock")) + object.ignoreAppLock = message.ignoreAppLock; + return object; + }; + + /** + * Converts this ImportAppRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @instance + * @returns {Object.} JSON object + */ + ImportAppRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportAppRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportAppRequest"; + }; + + ImportAppRequest.ImportOptions = (function() { + + /** + * Properties of an ImportOptions. + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @interface IImportOptions + * @property {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|null} [conflictResolutionStrategy] ImportOptions conflictResolutionStrategy + */ + + /** + * Constructs a new ImportOptions. + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @classdesc Represents an ImportOptions. + * @implements IImportOptions + * @constructor + * @param {google.cloud.ces.v1beta.ImportAppRequest.IImportOptions=} [properties] Properties to set + */ + function ImportOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportOptions conflictResolutionStrategy. + * @member {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy} conflictResolutionStrategy + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @instance + */ + ImportOptions.prototype.conflictResolutionStrategy = 0; + + /** + * Creates a new ImportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1beta.ImportAppRequest.IImportOptions=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions} ImportOptions instance + */ + ImportOptions.create = function create(properties) { + return new ImportOptions(properties); + }; + + /** + * Encodes the specified ImportOptions message. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1beta.ImportAppRequest.IImportOptions} message ImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conflictResolutionStrategy != null && Object.hasOwnProperty.call(message, "conflictResolutionStrategy")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.conflictResolutionStrategy); + return writer; + }; + + /** + * Encodes the specified ImportOptions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1beta.ImportAppRequest.IImportOptions} message ImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions} ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.conflictResolutionStrategy = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions} ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportOptions message. + * @function verify + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conflictResolutionStrategy != null && message.hasOwnProperty("conflictResolutionStrategy")) + switch (message.conflictResolutionStrategy) { + default: + return "conflictResolutionStrategy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ImportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions} ImportOptions + */ + ImportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions) + return object; + var message = new $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions(); + switch (object.conflictResolutionStrategy) { + default: + if (typeof object.conflictResolutionStrategy === "number") { + message.conflictResolutionStrategy = object.conflictResolutionStrategy; + break; + } + break; + case "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED": + case 0: + message.conflictResolutionStrategy = 0; + break; + case "REPLACE": + case 1: + message.conflictResolutionStrategy = 1; + break; + case "OVERWRITE": + case 2: + message.conflictResolutionStrategy = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ImportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions} message ImportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.conflictResolutionStrategy = options.enums === String ? "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED" : 0; + if (message.conflictResolutionStrategy != null && message.hasOwnProperty("conflictResolutionStrategy")) + object.conflictResolutionStrategy = options.enums === String ? $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy[message.conflictResolutionStrategy] === undefined ? message.conflictResolutionStrategy : $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy[message.conflictResolutionStrategy] : message.conflictResolutionStrategy; + return object; + }; + + /** + * Converts this ImportOptions to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @instance + * @returns {Object.} JSON object + */ + ImportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportOptions + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportAppRequest.ImportOptions"; + }; + + /** + * ConflictResolutionStrategy enum. + * @name google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy + * @enum {number} + * @property {number} CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED=0 CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED value + * @property {number} REPLACE=1 REPLACE value + * @property {number} OVERWRITE=2 OVERWRITE value + */ + ImportOptions.ConflictResolutionStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "REPLACE"] = 1; + values[valuesById[2] = "OVERWRITE"] = 2; + return values; + })(); + + return ImportOptions; + })(); + + return ImportAppRequest; + })(); + + v1beta.ImportAppResponse = (function() { + + /** + * Properties of an ImportAppResponse. + * @memberof google.cloud.ces.v1beta + * @interface IImportAppResponse + * @property {string|null} [name] ImportAppResponse name + * @property {Array.|null} [warnings] ImportAppResponse warnings + */ + + /** + * Constructs a new ImportAppResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ImportAppResponse. + * @implements IImportAppResponse + * @constructor + * @param {google.cloud.ces.v1beta.IImportAppResponse=} [properties] Properties to set + */ + function ImportAppResponse(properties) { + this.warnings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportAppResponse name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @instance + */ + ImportAppResponse.prototype.name = ""; + + /** + * ImportAppResponse warnings. + * @member {Array.} warnings + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @instance + */ + ImportAppResponse.prototype.warnings = $util.emptyArray; + + /** + * Creates a new ImportAppResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @static + * @param {google.cloud.ces.v1beta.IImportAppResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ImportAppResponse} ImportAppResponse instance + */ + ImportAppResponse.create = function create(properties) { + return new ImportAppResponse(properties); + }; + + /** + * Encodes the specified ImportAppResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @static + * @param {google.cloud.ces.v1beta.IImportAppResponse} message ImportAppResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportAppResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.warnings != null && message.warnings.length) + for (var i = 0; i < message.warnings.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.warnings[i]); + return writer; + }; + + /** + * Encodes the specified ImportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @static + * @param {google.cloud.ces.v1beta.IImportAppResponse} message ImportAppResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportAppResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportAppResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ImportAppResponse} ImportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportAppResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportAppResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportAppResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ImportAppResponse} ImportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportAppResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportAppResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportAppResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.warnings != null && message.hasOwnProperty("warnings")) { + if (!Array.isArray(message.warnings)) + return "warnings: array expected"; + for (var i = 0; i < message.warnings.length; ++i) + if (!$util.isString(message.warnings[i])) + return "warnings: string[] expected"; + } + return null; + }; + + /** + * Creates an ImportAppResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ImportAppResponse} ImportAppResponse + */ + ImportAppResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ImportAppResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ImportAppResponse(); + if (object.name != null) + message.name = String(object.name); + if (object.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.cloud.ces.v1beta.ImportAppResponse.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) + message.warnings[i] = String(object.warnings[i]); + } + return message; + }; + + /** + * Creates a plain object from an ImportAppResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @static + * @param {google.cloud.ces.v1beta.ImportAppResponse} message ImportAppResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportAppResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.warnings = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = message.warnings[j]; + } + return object; + }; + + /** + * Converts this ImportAppResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @instance + * @returns {Object.} JSON object + */ + ImportAppResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportAppResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportAppResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportAppResponse"; + }; + + return ImportAppResponse; + })(); + + v1beta.ListAgentsRequest = (function() { + + /** + * Properties of a ListAgentsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListAgentsRequest + * @property {string|null} [parent] ListAgentsRequest parent + * @property {number|null} [pageSize] ListAgentsRequest pageSize + * @property {string|null} [pageToken] ListAgentsRequest pageToken + * @property {string|null} [filter] ListAgentsRequest filter + * @property {string|null} [orderBy] ListAgentsRequest orderBy + */ + + /** + * Constructs a new ListAgentsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListAgentsRequest. + * @implements IListAgentsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListAgentsRequest=} [properties] Properties to set + */ + function ListAgentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAgentsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.parent = ""; + + /** + * ListAgentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.pageSize = 0; + + /** + * ListAgentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.pageToken = ""; + + /** + * ListAgentsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.filter = ""; + + /** + * ListAgentsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListAgentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @static + * @param {google.cloud.ces.v1beta.IListAgentsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListAgentsRequest} ListAgentsRequest instance + */ + ListAgentsRequest.create = function create(properties) { + return new ListAgentsRequest(properties); + }; + + /** + * Encodes the specified ListAgentsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @static + * @param {google.cloud.ces.v1beta.IListAgentsRequest} message ListAgentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsRequest.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 ListAgentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @static + * @param {google.cloud.ces.v1beta.IListAgentsRequest} message ListAgentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListAgentsRequest} ListAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListAgentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListAgentsRequest} ListAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAgentsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAgentsRequest.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 ListAgentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListAgentsRequest} ListAgentsRequest + */ + ListAgentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListAgentsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListAgentsRequest(); + 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 ListAgentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @static + * @param {google.cloud.ces.v1beta.ListAgentsRequest} message ListAgentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAgentsRequest.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 ListAgentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAgentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAgentsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAgentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListAgentsRequest"; + }; + + return ListAgentsRequest; + })(); + + v1beta.ListAgentsResponse = (function() { + + /** + * Properties of a ListAgentsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListAgentsResponse + * @property {Array.|null} [agents] ListAgentsResponse agents + * @property {string|null} [nextPageToken] ListAgentsResponse nextPageToken + */ + + /** + * Constructs a new ListAgentsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListAgentsResponse. + * @implements IListAgentsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListAgentsResponse=} [properties] Properties to set + */ + function ListAgentsResponse(properties) { + this.agents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAgentsResponse agents. + * @member {Array.} agents + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @instance + */ + ListAgentsResponse.prototype.agents = $util.emptyArray; + + /** + * ListAgentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @instance + */ + ListAgentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAgentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @static + * @param {google.cloud.ces.v1beta.IListAgentsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListAgentsResponse} ListAgentsResponse instance + */ + ListAgentsResponse.create = function create(properties) { + return new ListAgentsResponse(properties); + }; + + /** + * Encodes the specified ListAgentsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @static + * @param {google.cloud.ces.v1beta.IListAgentsResponse} message ListAgentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agents != null && message.agents.length) + for (var i = 0; i < message.agents.length; ++i) + $root.google.cloud.ces.v1beta.Agent.encode(message.agents[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 ListAgentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @static + * @param {google.cloud.ces.v1beta.IListAgentsResponse} message ListAgentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListAgentsResponse} ListAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListAgentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.agents && message.agents.length)) + message.agents = []; + message.agents.push($root.google.cloud.ces.v1beta.Agent.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListAgentsResponse} ListAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAgentsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAgentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agents != null && message.hasOwnProperty("agents")) { + if (!Array.isArray(message.agents)) + return "agents: array expected"; + for (var i = 0; i < message.agents.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Agent.verify(message.agents[i]); + if (error) + return "agents." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAgentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListAgentsResponse} ListAgentsResponse + */ + ListAgentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListAgentsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListAgentsResponse(); + if (object.agents) { + if (!Array.isArray(object.agents)) + throw TypeError(".google.cloud.ces.v1beta.ListAgentsResponse.agents: array expected"); + message.agents = []; + for (var i = 0; i < object.agents.length; ++i) { + if (typeof object.agents[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListAgentsResponse.agents: object expected"); + message.agents[i] = $root.google.cloud.ces.v1beta.Agent.fromObject(object.agents[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAgentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @static + * @param {google.cloud.ces.v1beta.ListAgentsResponse} message ListAgentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAgentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.agents = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.agents && message.agents.length) { + object.agents = []; + for (var j = 0; j < message.agents.length; ++j) + object.agents[j] = $root.google.cloud.ces.v1beta.Agent.toObject(message.agents[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAgentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAgentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAgentsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAgentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListAgentsResponse"; + }; + + return ListAgentsResponse; + })(); + + v1beta.GetAgentRequest = (function() { + + /** + * Properties of a GetAgentRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetAgentRequest + * @property {string|null} [name] GetAgentRequest name + */ + + /** + * Constructs a new GetAgentRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetAgentRequest. + * @implements IGetAgentRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetAgentRequest=} [properties] Properties to set + */ + function GetAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAgentRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @instance + */ + GetAgentRequest.prototype.name = ""; + + /** + * Creates a new GetAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @static + * @param {google.cloud.ces.v1beta.IGetAgentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetAgentRequest} GetAgentRequest instance + */ + GetAgentRequest.create = function create(properties) { + return new GetAgentRequest(properties); + }; + + /** + * Encodes the specified GetAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @static + * @param {google.cloud.ces.v1beta.IGetAgentRequest} message GetAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAgentRequest.encode = function encode(message, writer) { + 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 GetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @static + * @param {google.cloud.ces.v1beta.IGetAgentRequest} message GetAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetAgentRequest} GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAgentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetAgentRequest} GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAgentRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAgentRequest.verify = function verify(message) { + if (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 GetAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetAgentRequest} GetAgentRequest + */ + GetAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetAgentRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetAgentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @static + * @param {google.cloud.ces.v1beta.GetAgentRequest} message GetAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAgentRequest.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 GetAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @instance + * @returns {Object.} JSON object + */ + GetAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAgentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetAgentRequest"; + }; + + return GetAgentRequest; + })(); + + v1beta.CreateAgentRequest = (function() { + + /** + * Properties of a CreateAgentRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateAgentRequest + * @property {string|null} [parent] CreateAgentRequest parent + * @property {string|null} [agentId] CreateAgentRequest agentId + * @property {google.cloud.ces.v1beta.IAgent|null} [agent] CreateAgentRequest agent + */ + + /** + * Constructs a new CreateAgentRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateAgentRequest. + * @implements ICreateAgentRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateAgentRequest=} [properties] Properties to set + */ + function CreateAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAgentRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @instance + */ + CreateAgentRequest.prototype.parent = ""; + + /** + * CreateAgentRequest agentId. + * @member {string} agentId + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @instance + */ + CreateAgentRequest.prototype.agentId = ""; + + /** + * CreateAgentRequest agent. + * @member {google.cloud.ces.v1beta.IAgent|null|undefined} agent + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @instance + */ + CreateAgentRequest.prototype.agent = null; + + /** + * Creates a new CreateAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateAgentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateAgentRequest} CreateAgentRequest instance + */ + CreateAgentRequest.create = function create(properties) { + return new CreateAgentRequest(properties); + }; + + /** + * Encodes the specified CreateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateAgentRequest} message CreateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAgentRequest.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.agentId != null && Object.hasOwnProperty.call(message, "agentId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.agentId); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + $root.google.cloud.ces.v1beta.Agent.encode(message.agent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateAgentRequest} message CreateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateAgentRequest} CreateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAgentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.agentId = reader.string(); + break; + } + case 3: { + message.agent = $root.google.cloud.ces.v1beta.Agent.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateAgentRequest} CreateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAgentRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAgentRequest.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.agentId != null && message.hasOwnProperty("agentId")) + if (!$util.isString(message.agentId)) + return "agentId: string expected"; + if (message.agent != null && message.hasOwnProperty("agent")) { + var error = $root.google.cloud.ces.v1beta.Agent.verify(message.agent); + if (error) + return "agent." + error; + } + return null; + }; + + /** + * Creates a CreateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateAgentRequest} CreateAgentRequest + */ + CreateAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateAgentRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateAgentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.agentId != null) + message.agentId = String(object.agentId); + if (object.agent != null) { + if (typeof object.agent !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateAgentRequest.agent: object expected"); + message.agent = $root.google.cloud.ces.v1beta.Agent.fromObject(object.agent); + } + return message; + }; + + /** + * Creates a plain object from a CreateAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @static + * @param {google.cloud.ces.v1beta.CreateAgentRequest} message CreateAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.agentId = ""; + object.agent = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.agentId != null && message.hasOwnProperty("agentId")) + object.agentId = message.agentId; + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = $root.google.cloud.ces.v1beta.Agent.toObject(message.agent, options); + return object; + }; + + /** + * Converts this CreateAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAgentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateAgentRequest"; + }; + + return CreateAgentRequest; + })(); + + v1beta.UpdateAgentRequest = (function() { + + /** + * Properties of an UpdateAgentRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateAgentRequest + * @property {google.cloud.ces.v1beta.IAgent|null} [agent] UpdateAgentRequest agent + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAgentRequest updateMask + */ + + /** + * Constructs a new UpdateAgentRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateAgentRequest. + * @implements IUpdateAgentRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateAgentRequest=} [properties] Properties to set + */ + function UpdateAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAgentRequest agent. + * @member {google.cloud.ces.v1beta.IAgent|null|undefined} agent + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @instance + */ + UpdateAgentRequest.prototype.agent = null; + + /** + * UpdateAgentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @instance + */ + UpdateAgentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateAgentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateAgentRequest} UpdateAgentRequest instance + */ + UpdateAgentRequest.create = function create(properties) { + return new UpdateAgentRequest(properties); + }; + + /** + * Encodes the specified UpdateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateAgentRequest} message UpdateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAgentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + $root.google.cloud.ces.v1beta.Agent.encode(message.agent, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateAgentRequest} message UpdateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateAgentRequest} UpdateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAgentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.agent = $root.google.cloud.ces.v1beta.Agent.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateAgentRequest} UpdateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAgentRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAgentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agent != null && message.hasOwnProperty("agent")) { + var error = $root.google.cloud.ces.v1beta.Agent.verify(message.agent); + if (error) + return "agent." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateAgentRequest} UpdateAgentRequest + */ + UpdateAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateAgentRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateAgentRequest(); + if (object.agent != null) { + if (typeof object.agent !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateAgentRequest.agent: object expected"); + message.agent = $root.google.cloud.ces.v1beta.Agent.fromObject(object.agent); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateAgentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateAgentRequest} message UpdateAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.agent = null; + object.updateMask = null; + } + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = $root.google.cloud.ces.v1beta.Agent.toObject(message.agent, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAgentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateAgentRequest"; + }; + + return UpdateAgentRequest; + })(); + + v1beta.DeleteAgentRequest = (function() { + + /** + * Properties of a DeleteAgentRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteAgentRequest + * @property {string|null} [name] DeleteAgentRequest name + * @property {boolean|null} [force] DeleteAgentRequest force + * @property {string|null} [etag] DeleteAgentRequest etag + */ + + /** + * Constructs a new DeleteAgentRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteAgentRequest. + * @implements IDeleteAgentRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteAgentRequest=} [properties] Properties to set + */ + function DeleteAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAgentRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @instance + */ + DeleteAgentRequest.prototype.name = ""; + + /** + * DeleteAgentRequest force. + * @member {boolean} force + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @instance + */ + DeleteAgentRequest.prototype.force = false; + + /** + * DeleteAgentRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @instance + */ + DeleteAgentRequest.prototype.etag = ""; + + /** + * Creates a new DeleteAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteAgentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteAgentRequest} DeleteAgentRequest instance + */ + DeleteAgentRequest.create = function create(properties) { + return new DeleteAgentRequest(properties); + }; + + /** + * Encodes the specified DeleteAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteAgentRequest} message DeleteAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAgentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteAgentRequest} message DeleteAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteAgentRequest} DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAgentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteAgentRequest} DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAgentRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAgentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteAgentRequest} DeleteAgentRequest + */ + DeleteAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteAgentRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteAgentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteAgentRequest} message DeleteAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAgentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteAgentRequest"; + }; + + return DeleteAgentRequest; + })(); + + v1beta.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.ces.v1beta + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.ces.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 createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.ces.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.ces.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OperationMetadata + * @static + * @param {google.cloud.ces.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.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.requestedCancellation); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OperationMetadata + * @static + * @param {google.cloud.ces.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.ces.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.ces.v1beta.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + 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.statusMessage = reader.string(); + break; + } + case 4: { + message.requestedCancellation = reader.bool(); + 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.ces.v1beta.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.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.ces.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"; + 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.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"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OperationMetadata) + return object; + var message = new $root.google.cloud.ces.v1beta.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.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.ces.v1beta.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OperationMetadata + * @static + * @param {google.cloud.ces.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.statusMessage = ""; + object.requestedCancellation = false; + } + 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.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.ces.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.ces.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.ces.v1beta.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1beta.ListExamplesRequest = (function() { + + /** + * Properties of a ListExamplesRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListExamplesRequest + * @property {string|null} [parent] ListExamplesRequest parent + * @property {number|null} [pageSize] ListExamplesRequest pageSize + * @property {string|null} [pageToken] ListExamplesRequest pageToken + * @property {string|null} [filter] ListExamplesRequest filter + * @property {string|null} [orderBy] ListExamplesRequest orderBy + */ + + /** + * Constructs a new ListExamplesRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListExamplesRequest. + * @implements IListExamplesRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListExamplesRequest=} [properties] Properties to set + */ + function ListExamplesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExamplesRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.parent = ""; + + /** + * ListExamplesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.pageSize = 0; + + /** + * ListExamplesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.pageToken = ""; + + /** + * ListExamplesRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.filter = ""; + + /** + * ListExamplesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListExamplesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @static + * @param {google.cloud.ces.v1beta.IListExamplesRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListExamplesRequest} ListExamplesRequest instance + */ + ListExamplesRequest.create = function create(properties) { + return new ListExamplesRequest(properties); + }; + + /** + * Encodes the specified ListExamplesRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @static + * @param {google.cloud.ces.v1beta.IListExamplesRequest} message ListExamplesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesRequest.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 ListExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @static + * @param {google.cloud.ces.v1beta.IListExamplesRequest} message ListExamplesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListExamplesRequest} ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListExamplesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListExamplesRequest} ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExamplesRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExamplesRequest.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 ListExamplesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListExamplesRequest} ListExamplesRequest + */ + ListExamplesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListExamplesRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListExamplesRequest(); + 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 ListExamplesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @static + * @param {google.cloud.ces.v1beta.ListExamplesRequest} message ListExamplesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExamplesRequest.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 ListExamplesRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @instance + * @returns {Object.} JSON object + */ + ListExamplesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExamplesRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExamplesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListExamplesRequest"; + }; + + return ListExamplesRequest; + })(); + + v1beta.ListExamplesResponse = (function() { + + /** + * Properties of a ListExamplesResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListExamplesResponse + * @property {Array.|null} [examples] ListExamplesResponse examples + * @property {string|null} [nextPageToken] ListExamplesResponse nextPageToken + */ + + /** + * Constructs a new ListExamplesResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListExamplesResponse. + * @implements IListExamplesResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListExamplesResponse=} [properties] Properties to set + */ + function ListExamplesResponse(properties) { + this.examples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExamplesResponse examples. + * @member {Array.} examples + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @instance + */ + ListExamplesResponse.prototype.examples = $util.emptyArray; + + /** + * ListExamplesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @instance + */ + ListExamplesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListExamplesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @static + * @param {google.cloud.ces.v1beta.IListExamplesResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListExamplesResponse} ListExamplesResponse instance + */ + ListExamplesResponse.create = function create(properties) { + return new ListExamplesResponse(properties); + }; + + /** + * Encodes the specified ListExamplesResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @static + * @param {google.cloud.ces.v1beta.IListExamplesResponse} message ListExamplesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.examples != null && message.examples.length) + for (var i = 0; i < message.examples.length; ++i) + $root.google.cloud.ces.v1beta.Example.encode(message.examples[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 ListExamplesResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @static + * @param {google.cloud.ces.v1beta.IListExamplesResponse} message ListExamplesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListExamplesResponse} ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListExamplesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.examples && message.examples.length)) + message.examples = []; + message.examples.push($root.google.cloud.ces.v1beta.Example.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListExamplesResponse} ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExamplesResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExamplesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.examples != null && message.hasOwnProperty("examples")) { + if (!Array.isArray(message.examples)) + return "examples: array expected"; + for (var i = 0; i < message.examples.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Example.verify(message.examples[i]); + if (error) + return "examples." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListExamplesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListExamplesResponse} ListExamplesResponse + */ + ListExamplesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListExamplesResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListExamplesResponse(); + if (object.examples) { + if (!Array.isArray(object.examples)) + throw TypeError(".google.cloud.ces.v1beta.ListExamplesResponse.examples: array expected"); + message.examples = []; + for (var i = 0; i < object.examples.length; ++i) { + if (typeof object.examples[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListExamplesResponse.examples: object expected"); + message.examples[i] = $root.google.cloud.ces.v1beta.Example.fromObject(object.examples[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListExamplesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @static + * @param {google.cloud.ces.v1beta.ListExamplesResponse} message ListExamplesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExamplesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.examples = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.examples && message.examples.length) { + object.examples = []; + for (var j = 0; j < message.examples.length; ++j) + object.examples[j] = $root.google.cloud.ces.v1beta.Example.toObject(message.examples[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListExamplesResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @instance + * @returns {Object.} JSON object + */ + ListExamplesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExamplesResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExamplesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListExamplesResponse"; + }; + + return ListExamplesResponse; + })(); + + v1beta.GetExampleRequest = (function() { + + /** + * Properties of a GetExampleRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetExampleRequest + * @property {string|null} [name] GetExampleRequest name + */ + + /** + * Constructs a new GetExampleRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetExampleRequest. + * @implements IGetExampleRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetExampleRequest=} [properties] Properties to set + */ + function GetExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetExampleRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @instance + */ + GetExampleRequest.prototype.name = ""; + + /** + * Creates a new GetExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @static + * @param {google.cloud.ces.v1beta.IGetExampleRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetExampleRequest} GetExampleRequest instance + */ + GetExampleRequest.create = function create(properties) { + return new GetExampleRequest(properties); + }; + + /** + * Encodes the specified GetExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @static + * @param {google.cloud.ces.v1beta.IGetExampleRequest} message GetExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExampleRequest.encode = function encode(message, writer) { + 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 GetExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @static + * @param {google.cloud.ces.v1beta.IGetExampleRequest} message GetExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetExampleRequest} GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExampleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetExampleRequest} GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetExampleRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetExampleRequest.verify = function verify(message) { + if (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 GetExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetExampleRequest} GetExampleRequest + */ + GetExampleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetExampleRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetExampleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @static + * @param {google.cloud.ces.v1beta.GetExampleRequest} message GetExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetExampleRequest.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 GetExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @instance + * @returns {Object.} JSON object + */ + GetExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetExampleRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetExampleRequest"; + }; + + return GetExampleRequest; + })(); + + v1beta.CreateExampleRequest = (function() { + + /** + * Properties of a CreateExampleRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateExampleRequest + * @property {string|null} [parent] CreateExampleRequest parent + * @property {string|null} [exampleId] CreateExampleRequest exampleId + * @property {google.cloud.ces.v1beta.IExample|null} [example] CreateExampleRequest example + */ + + /** + * Constructs a new CreateExampleRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateExampleRequest. + * @implements ICreateExampleRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateExampleRequest=} [properties] Properties to set + */ + function CreateExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateExampleRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @instance + */ + CreateExampleRequest.prototype.parent = ""; + + /** + * CreateExampleRequest exampleId. + * @member {string} exampleId + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @instance + */ + CreateExampleRequest.prototype.exampleId = ""; + + /** + * CreateExampleRequest example. + * @member {google.cloud.ces.v1beta.IExample|null|undefined} example + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @instance + */ + CreateExampleRequest.prototype.example = null; + + /** + * Creates a new CreateExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateExampleRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateExampleRequest} CreateExampleRequest instance + */ + CreateExampleRequest.create = function create(properties) { + return new CreateExampleRequest(properties); + }; + + /** + * Encodes the specified CreateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateExampleRequest} message CreateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExampleRequest.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.exampleId != null && Object.hasOwnProperty.call(message, "exampleId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exampleId); + if (message.example != null && Object.hasOwnProperty.call(message, "example")) + $root.google.cloud.ces.v1beta.Example.encode(message.example, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateExampleRequest} message CreateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateExampleRequest} CreateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExampleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.exampleId = reader.string(); + break; + } + case 3: { + message.example = $root.google.cloud.ces.v1beta.Example.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateExampleRequest} CreateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateExampleRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateExampleRequest.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.exampleId != null && message.hasOwnProperty("exampleId")) + if (!$util.isString(message.exampleId)) + return "exampleId: string expected"; + if (message.example != null && message.hasOwnProperty("example")) { + var error = $root.google.cloud.ces.v1beta.Example.verify(message.example); + if (error) + return "example." + error; + } + return null; + }; + + /** + * Creates a CreateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateExampleRequest} CreateExampleRequest + */ + CreateExampleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateExampleRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateExampleRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.exampleId != null) + message.exampleId = String(object.exampleId); + if (object.example != null) { + if (typeof object.example !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateExampleRequest.example: object expected"); + message.example = $root.google.cloud.ces.v1beta.Example.fromObject(object.example); + } + return message; + }; + + /** + * Creates a plain object from a CreateExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @static + * @param {google.cloud.ces.v1beta.CreateExampleRequest} message CreateExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateExampleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.exampleId = ""; + object.example = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.exampleId != null && message.hasOwnProperty("exampleId")) + object.exampleId = message.exampleId; + if (message.example != null && message.hasOwnProperty("example")) + object.example = $root.google.cloud.ces.v1beta.Example.toObject(message.example, options); + return object; + }; + + /** + * Converts this CreateExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @instance + * @returns {Object.} JSON object + */ + CreateExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateExampleRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateExampleRequest"; + }; + + return CreateExampleRequest; + })(); + + v1beta.UpdateExampleRequest = (function() { + + /** + * Properties of an UpdateExampleRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateExampleRequest + * @property {google.cloud.ces.v1beta.IExample|null} [example] UpdateExampleRequest example + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateExampleRequest updateMask + */ + + /** + * Constructs a new UpdateExampleRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateExampleRequest. + * @implements IUpdateExampleRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateExampleRequest=} [properties] Properties to set + */ + function UpdateExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateExampleRequest example. + * @member {google.cloud.ces.v1beta.IExample|null|undefined} example + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @instance + */ + UpdateExampleRequest.prototype.example = null; + + /** + * UpdateExampleRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @instance + */ + UpdateExampleRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateExampleRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateExampleRequest} UpdateExampleRequest instance + */ + UpdateExampleRequest.create = function create(properties) { + return new UpdateExampleRequest(properties); + }; + + /** + * Encodes the specified UpdateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateExampleRequest} message UpdateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExampleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.example != null && Object.hasOwnProperty.call(message, "example")) + $root.google.cloud.ces.v1beta.Example.encode(message.example, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateExampleRequest} message UpdateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateExampleRequest} UpdateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExampleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.example = $root.google.cloud.ces.v1beta.Example.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateExampleRequest} UpdateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateExampleRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateExampleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.example != null && message.hasOwnProperty("example")) { + var error = $root.google.cloud.ces.v1beta.Example.verify(message.example); + if (error) + return "example." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateExampleRequest} UpdateExampleRequest + */ + UpdateExampleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateExampleRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateExampleRequest(); + if (object.example != null) { + if (typeof object.example !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateExampleRequest.example: object expected"); + message.example = $root.google.cloud.ces.v1beta.Example.fromObject(object.example); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateExampleRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateExampleRequest} message UpdateExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateExampleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.example = null; + object.updateMask = null; + } + if (message.example != null && message.hasOwnProperty("example")) + object.example = $root.google.cloud.ces.v1beta.Example.toObject(message.example, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateExampleRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateExampleRequest"; + }; + + return UpdateExampleRequest; + })(); + + v1beta.DeleteExampleRequest = (function() { + + /** + * Properties of a DeleteExampleRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteExampleRequest + * @property {string|null} [name] DeleteExampleRequest name + * @property {string|null} [etag] DeleteExampleRequest etag + */ + + /** + * Constructs a new DeleteExampleRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteExampleRequest. + * @implements IDeleteExampleRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteExampleRequest=} [properties] Properties to set + */ + function DeleteExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteExampleRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @instance + */ + DeleteExampleRequest.prototype.name = ""; + + /** + * DeleteExampleRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @instance + */ + DeleteExampleRequest.prototype.etag = ""; + + /** + * Creates a new DeleteExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteExampleRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteExampleRequest} DeleteExampleRequest instance + */ + DeleteExampleRequest.create = function create(properties) { + return new DeleteExampleRequest(properties); + }; + + /** + * Encodes the specified DeleteExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteExampleRequest} message DeleteExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExampleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteExampleRequest} message DeleteExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteExampleRequest} DeleteExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExampleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteExampleRequest} DeleteExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteExampleRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteExampleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteExampleRequest} DeleteExampleRequest + */ + DeleteExampleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteExampleRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteExampleRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteExampleRequest} message DeleteExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteExampleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteExampleRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteExampleRequest"; + }; + + return DeleteExampleRequest; + })(); + + v1beta.ListToolsRequest = (function() { + + /** + * Properties of a ListToolsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListToolsRequest + * @property {string|null} [parent] ListToolsRequest parent + * @property {number|null} [pageSize] ListToolsRequest pageSize + * @property {string|null} [pageToken] ListToolsRequest pageToken + * @property {string|null} [filter] ListToolsRequest filter + * @property {string|null} [orderBy] ListToolsRequest orderBy + */ + + /** + * Constructs a new ListToolsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListToolsRequest. + * @implements IListToolsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListToolsRequest=} [properties] Properties to set + */ + function ListToolsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.parent = ""; + + /** + * ListToolsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.pageSize = 0; + + /** + * ListToolsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.pageToken = ""; + + /** + * ListToolsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.filter = ""; + + /** + * ListToolsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListToolsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @static + * @param {google.cloud.ces.v1beta.IListToolsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListToolsRequest} ListToolsRequest instance + */ + ListToolsRequest.create = function create(properties) { + return new ListToolsRequest(properties); + }; + + /** + * Encodes the specified ListToolsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @static + * @param {google.cloud.ces.v1beta.IListToolsRequest} message ListToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsRequest.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 ListToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @static + * @param {google.cloud.ces.v1beta.IListToolsRequest} message ListToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListToolsRequest} ListToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListToolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListToolsRequest} ListToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolsRequest.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 ListToolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListToolsRequest} ListToolsRequest + */ + ListToolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListToolsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListToolsRequest(); + 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 ListToolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @static + * @param {google.cloud.ces.v1beta.ListToolsRequest} message ListToolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolsRequest.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 ListToolsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @instance + * @returns {Object.} JSON object + */ + ListToolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListToolsRequest"; + }; + + return ListToolsRequest; + })(); + + v1beta.ListToolsResponse = (function() { + + /** + * Properties of a ListToolsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListToolsResponse + * @property {Array.|null} [tools] ListToolsResponse tools + * @property {string|null} [nextPageToken] ListToolsResponse nextPageToken + */ + + /** + * Constructs a new ListToolsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListToolsResponse. + * @implements IListToolsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListToolsResponse=} [properties] Properties to set + */ + function ListToolsResponse(properties) { + this.tools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolsResponse tools. + * @member {Array.} tools + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @instance + */ + ListToolsResponse.prototype.tools = $util.emptyArray; + + /** + * ListToolsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @instance + */ + ListToolsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListToolsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @static + * @param {google.cloud.ces.v1beta.IListToolsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListToolsResponse} ListToolsResponse instance + */ + ListToolsResponse.create = function create(properties) { + return new ListToolsResponse(properties); + }; + + /** + * Encodes the specified ListToolsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @static + * @param {google.cloud.ces.v1beta.IListToolsResponse} message ListToolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + $root.google.cloud.ces.v1beta.Tool.encode(message.tools[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 ListToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @static + * @param {google.cloud.ces.v1beta.IListToolsResponse} message ListToolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListToolsResponse} ListToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListToolsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push($root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListToolsResponse} ListToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tools != null && message.hasOwnProperty("tools")) { + if (!Array.isArray(message.tools)) + return "tools: array expected"; + for (var i = 0; i < message.tools.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tools[i]); + if (error) + return "tools." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListToolsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListToolsResponse} ListToolsResponse + */ + ListToolsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListToolsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListToolsResponse(); + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.cloud.ces.v1beta.ListToolsResponse.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) { + if (typeof object.tools[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListToolsResponse.tools: object expected"); + message.tools[i] = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tools[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListToolsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @static + * @param {google.cloud.ces.v1beta.ListToolsResponse} message ListToolsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tools = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = $root.google.cloud.ces.v1beta.Tool.toObject(message.tools[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListToolsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @instance + * @returns {Object.} JSON object + */ + ListToolsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListToolsResponse"; + }; + + return ListToolsResponse; + })(); + + v1beta.GetToolRequest = (function() { + + /** + * Properties of a GetToolRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetToolRequest + * @property {string|null} [name] GetToolRequest name + */ + + /** + * Constructs a new GetToolRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetToolRequest. + * @implements IGetToolRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetToolRequest=} [properties] Properties to set + */ + function GetToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetToolRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @instance + */ + GetToolRequest.prototype.name = ""; + + /** + * Creates a new GetToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @static + * @param {google.cloud.ces.v1beta.IGetToolRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetToolRequest} GetToolRequest instance + */ + GetToolRequest.create = function create(properties) { + return new GetToolRequest(properties); + }; + + /** + * Encodes the specified GetToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @static + * @param {google.cloud.ces.v1beta.IGetToolRequest} message GetToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolRequest.encode = function encode(message, writer) { + 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 GetToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @static + * @param {google.cloud.ces.v1beta.IGetToolRequest} message GetToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetToolRequest} GetToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetToolRequest} GetToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetToolRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetToolRequest.verify = function verify(message) { + if (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 GetToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetToolRequest} GetToolRequest + */ + GetToolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetToolRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetToolRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @static + * @param {google.cloud.ces.v1beta.GetToolRequest} message GetToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetToolRequest.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 GetToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @instance + * @returns {Object.} JSON object + */ + GetToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetToolRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetToolRequest"; + }; + + return GetToolRequest; + })(); + + v1beta.CreateToolRequest = (function() { + + /** + * Properties of a CreateToolRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateToolRequest + * @property {string|null} [parent] CreateToolRequest parent + * @property {string|null} [toolId] CreateToolRequest toolId + * @property {google.cloud.ces.v1beta.ITool|null} [tool] CreateToolRequest tool + */ + + /** + * Constructs a new CreateToolRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateToolRequest. + * @implements ICreateToolRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateToolRequest=} [properties] Properties to set + */ + function CreateToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateToolRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @instance + */ + CreateToolRequest.prototype.parent = ""; + + /** + * CreateToolRequest toolId. + * @member {string} toolId + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @instance + */ + CreateToolRequest.prototype.toolId = ""; + + /** + * CreateToolRequest tool. + * @member {google.cloud.ces.v1beta.ITool|null|undefined} tool + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @instance + */ + CreateToolRequest.prototype.tool = null; + + /** + * Creates a new CreateToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateToolRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateToolRequest} CreateToolRequest instance + */ + CreateToolRequest.create = function create(properties) { + return new CreateToolRequest(properties); + }; + + /** + * Encodes the specified CreateToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateToolRequest} message CreateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolRequest.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.toolId != null && Object.hasOwnProperty.call(message, "toolId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.toolId); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + $root.google.cloud.ces.v1beta.Tool.encode(message.tool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateToolRequest} message CreateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateToolRequest} CreateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.toolId = reader.string(); + break; + } + case 3: { + message.tool = $root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateToolRequest} CreateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateToolRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateToolRequest.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.toolId != null && message.hasOwnProperty("toolId")) + if (!$util.isString(message.toolId)) + return "toolId: string expected"; + if (message.tool != null && message.hasOwnProperty("tool")) { + var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tool); + if (error) + return "tool." + error; + } + return null; + }; + + /** + * Creates a CreateToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateToolRequest} CreateToolRequest + */ + CreateToolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateToolRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateToolRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.toolId != null) + message.toolId = String(object.toolId); + if (object.tool != null) { + if (typeof object.tool !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateToolRequest.tool: object expected"); + message.tool = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tool); + } + return message; + }; + + /** + * Creates a plain object from a CreateToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @static + * @param {google.cloud.ces.v1beta.CreateToolRequest} message CreateToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateToolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.toolId = ""; + object.tool = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.toolId != null && message.hasOwnProperty("toolId")) + object.toolId = message.toolId; + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = $root.google.cloud.ces.v1beta.Tool.toObject(message.tool, options); + return object; + }; + + /** + * Converts this CreateToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @instance + * @returns {Object.} JSON object + */ + CreateToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateToolRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateToolRequest"; + }; + + return CreateToolRequest; + })(); + + v1beta.UpdateToolRequest = (function() { + + /** + * Properties of an UpdateToolRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateToolRequest + * @property {google.cloud.ces.v1beta.ITool|null} [tool] UpdateToolRequest tool + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateToolRequest updateMask + */ + + /** + * Constructs a new UpdateToolRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateToolRequest. + * @implements IUpdateToolRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateToolRequest=} [properties] Properties to set + */ + function UpdateToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateToolRequest tool. + * @member {google.cloud.ces.v1beta.ITool|null|undefined} tool + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @instance + */ + UpdateToolRequest.prototype.tool = null; + + /** + * UpdateToolRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @instance + */ + UpdateToolRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateToolRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateToolRequest} UpdateToolRequest instance + */ + UpdateToolRequest.create = function create(properties) { + return new UpdateToolRequest(properties); + }; + + /** + * Encodes the specified UpdateToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateToolRequest} message UpdateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateToolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + $root.google.cloud.ces.v1beta.Tool.encode(message.tool, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateToolRequest} message UpdateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateToolRequest} UpdateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateToolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = $root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateToolRequest} UpdateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateToolRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateToolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tool != null && message.hasOwnProperty("tool")) { + var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tool); + if (error) + return "tool." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateToolRequest} UpdateToolRequest + */ + UpdateToolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateToolRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateToolRequest(); + if (object.tool != null) { + if (typeof object.tool !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateToolRequest.tool: object expected"); + message.tool = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tool); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateToolRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateToolRequest} message UpdateToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateToolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = null; + object.updateMask = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = $root.google.cloud.ces.v1beta.Tool.toObject(message.tool, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateToolRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateToolRequest"; + }; + + return UpdateToolRequest; + })(); + + v1beta.DeleteToolRequest = (function() { + + /** + * Properties of a DeleteToolRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteToolRequest + * @property {string|null} [name] DeleteToolRequest name + * @property {boolean|null} [force] DeleteToolRequest force + * @property {string|null} [etag] DeleteToolRequest etag + */ + + /** + * Constructs a new DeleteToolRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteToolRequest. + * @implements IDeleteToolRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteToolRequest=} [properties] Properties to set + */ + function DeleteToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteToolRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @instance + */ + DeleteToolRequest.prototype.name = ""; + + /** + * DeleteToolRequest force. + * @member {boolean} force + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @instance + */ + DeleteToolRequest.prototype.force = false; + + /** + * DeleteToolRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @instance + */ + DeleteToolRequest.prototype.etag = ""; + + /** + * Creates a new DeleteToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteToolRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteToolRequest} DeleteToolRequest instance + */ + DeleteToolRequest.create = function create(properties) { + return new DeleteToolRequest(properties); + }; + + /** + * Encodes the specified DeleteToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteToolRequest} message DeleteToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteToolRequest} message DeleteToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteToolRequest} DeleteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteToolRequest} DeleteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteToolRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteToolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteToolRequest} DeleteToolRequest + */ + DeleteToolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteToolRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteToolRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteToolRequest} message DeleteToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteToolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteToolRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteToolRequest"; + }; + + return DeleteToolRequest; + })(); + + v1beta.ListConversationsRequest = (function() { + + /** + * Properties of a ListConversationsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListConversationsRequest + * @property {string|null} [parent] ListConversationsRequest parent + * @property {number|null} [pageSize] ListConversationsRequest pageSize + * @property {string|null} [pageToken] ListConversationsRequest pageToken + * @property {string|null} [filter] ListConversationsRequest filter + * @property {google.cloud.ces.v1beta.Conversation.Source|null} [source] ListConversationsRequest source + * @property {Array.|null} [sources] ListConversationsRequest sources + */ + + /** + * Constructs a new ListConversationsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListConversationsRequest. + * @implements IListConversationsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListConversationsRequest=} [properties] Properties to set + */ + function ListConversationsRequest(properties) { + this.sources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConversationsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.parent = ""; + + /** + * ListConversationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.pageSize = 0; + + /** + * ListConversationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.pageToken = ""; + + /** + * ListConversationsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.filter = ""; + + /** + * ListConversationsRequest source. + * @member {google.cloud.ces.v1beta.Conversation.Source} source + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.source = 0; + + /** + * ListConversationsRequest sources. + * @member {Array.} sources + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.sources = $util.emptyArray; + + /** + * Creates a new ListConversationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @static + * @param {google.cloud.ces.v1beta.IListConversationsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListConversationsRequest} ListConversationsRequest instance + */ + ListConversationsRequest.create = function create(properties) { + return new ListConversationsRequest(properties); + }; + + /** + * Encodes the specified ListConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @static + * @param {google.cloud.ces.v1beta.IListConversationsRequest} message ListConversationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsRequest.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.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.source); + if (message.sources != null && message.sources.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.sources.length; ++i) + writer.int32(message.sources[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ListConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @static + * @param {google.cloud.ces.v1beta.IListConversationsRequest} message ListConversationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListConversationsRequest} ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListConversationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.source = reader.int32(); + break; + } + case 6: { + if (!(message.sources && message.sources.length)) + message.sources = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.sources.push(reader.int32()); + } else + message.sources.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListConversationsRequest} ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConversationsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConversationsRequest.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.source != null && message.hasOwnProperty("source")) + switch (message.source) { + default: + return "source: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) + switch (message.sources[i]) { + default: + return "sources: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return null; + }; + + /** + * Creates a ListConversationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListConversationsRequest} ListConversationsRequest + */ + ListConversationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListConversationsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListConversationsRequest(); + 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); + switch (object.source) { + default: + if (typeof object.source === "number") { + message.source = object.source; + break; + } + break; + case "SOURCE_UNSPECIFIED": + case 0: + message.source = 0; + break; + case "LIVE": + case 1: + message.source = 1; + break; + case "SIMULATOR": + case 2: + message.source = 2; + break; + case "EVAL": + case 3: + message.source = 3; + break; + } + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.ces.v1beta.ListConversationsRequest.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) + switch (object.sources[i]) { + default: + if (typeof object.sources[i] === "number") { + message.sources[i] = object.sources[i]; + break; + } + case "SOURCE_UNSPECIFIED": + case 0: + message.sources[i] = 0; + break; + case "LIVE": + case 1: + message.sources[i] = 1; + break; + case "SIMULATOR": + case 2: + message.sources[i] = 2; + break; + case "EVAL": + case 3: + message.sources[i] = 3; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ListConversationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @static + * @param {google.cloud.ces.v1beta.ListConversationsRequest} message ListConversationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConversationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sources = []; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.source != null && message.hasOwnProperty("source")) + object.source = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1beta.Conversation.Source[message.source] : message.source; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.Source[message.sources[j]] === undefined ? message.sources[j] : $root.google.cloud.ces.v1beta.Conversation.Source[message.sources[j]] : message.sources[j]; + } + return object; + }; + + /** + * Converts this ListConversationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListConversationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConversationsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConversationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListConversationsRequest"; + }; + + return ListConversationsRequest; + })(); + + v1beta.ListConversationsResponse = (function() { + + /** + * Properties of a ListConversationsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListConversationsResponse + * @property {Array.|null} [conversations] ListConversationsResponse conversations + * @property {string|null} [nextPageToken] ListConversationsResponse nextPageToken + */ + + /** + * Constructs a new ListConversationsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListConversationsResponse. + * @implements IListConversationsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListConversationsResponse=} [properties] Properties to set + */ + function ListConversationsResponse(properties) { + this.conversations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConversationsResponse conversations. + * @member {Array.} conversations + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @instance + */ + ListConversationsResponse.prototype.conversations = $util.emptyArray; + + /** + * ListConversationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @instance + */ + ListConversationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListConversationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @static + * @param {google.cloud.ces.v1beta.IListConversationsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListConversationsResponse} ListConversationsResponse instance + */ + ListConversationsResponse.create = function create(properties) { + return new ListConversationsResponse(properties); + }; + + /** + * Encodes the specified ListConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @static + * @param {google.cloud.ces.v1beta.IListConversationsResponse} message ListConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversations != null && message.conversations.length) + for (var i = 0; i < message.conversations.length; ++i) + $root.google.cloud.ces.v1beta.Conversation.encode(message.conversations[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 ListConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @static + * @param {google.cloud.ces.v1beta.IListConversationsResponse} message ListConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListConversationsResponse} ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListConversationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.conversations && message.conversations.length)) + message.conversations = []; + message.conversations.push($root.google.cloud.ces.v1beta.Conversation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListConversationsResponse} ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConversationsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConversationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conversations != null && message.hasOwnProperty("conversations")) { + if (!Array.isArray(message.conversations)) + return "conversations: array expected"; + for (var i = 0; i < message.conversations.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Conversation.verify(message.conversations[i]); + if (error) + return "conversations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListConversationsResponse} ListConversationsResponse + */ + ListConversationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListConversationsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListConversationsResponse(); + if (object.conversations) { + if (!Array.isArray(object.conversations)) + throw TypeError(".google.cloud.ces.v1beta.ListConversationsResponse.conversations: array expected"); + message.conversations = []; + for (var i = 0; i < object.conversations.length; ++i) { + if (typeof object.conversations[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListConversationsResponse.conversations: object expected"); + message.conversations[i] = $root.google.cloud.ces.v1beta.Conversation.fromObject(object.conversations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListConversationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @static + * @param {google.cloud.ces.v1beta.ListConversationsResponse} message ListConversationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConversationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conversations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.conversations && message.conversations.length) { + object.conversations = []; + for (var j = 0; j < message.conversations.length; ++j) + object.conversations[j] = $root.google.cloud.ces.v1beta.Conversation.toObject(message.conversations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListConversationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListConversationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConversationsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConversationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListConversationsResponse"; + }; + + return ListConversationsResponse; + })(); + + v1beta.GetConversationRequest = (function() { + + /** + * Properties of a GetConversationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetConversationRequest + * @property {string|null} [name] GetConversationRequest name + * @property {google.cloud.ces.v1beta.Conversation.Source|null} [source] GetConversationRequest source + */ + + /** + * Constructs a new GetConversationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetConversationRequest. + * @implements IGetConversationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetConversationRequest=} [properties] Properties to set + */ + function GetConversationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConversationRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @instance + */ + GetConversationRequest.prototype.name = ""; + + /** + * GetConversationRequest source. + * @member {google.cloud.ces.v1beta.Conversation.Source} source + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @instance + */ + GetConversationRequest.prototype.source = 0; + + /** + * Creates a new GetConversationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @static + * @param {google.cloud.ces.v1beta.IGetConversationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetConversationRequest} GetConversationRequest instance + */ + GetConversationRequest.create = function create(properties) { + return new GetConversationRequest(properties); + }; + + /** + * Encodes the specified GetConversationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetConversationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @static + * @param {google.cloud.ces.v1beta.IGetConversationRequest} message GetConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConversationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.source); + return writer; + }; + + /** + * Encodes the specified GetConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetConversationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @static + * @param {google.cloud.ces.v1beta.IGetConversationRequest} message GetConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConversationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConversationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetConversationRequest} GetConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConversationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetConversationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.source = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConversationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetConversationRequest} GetConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConversationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConversationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConversationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + switch (message.source) { + default: + return "source: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a GetConversationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetConversationRequest} GetConversationRequest + */ + GetConversationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetConversationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetConversationRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.source) { + default: + if (typeof object.source === "number") { + message.source = object.source; + break; + } + break; + case "SOURCE_UNSPECIFIED": + case 0: + message.source = 0; + break; + case "LIVE": + case 1: + message.source = 1; + break; + case "SIMULATOR": + case 2: + message.source = 2; + break; + case "EVAL": + case 3: + message.source = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetConversationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @static + * @param {google.cloud.ces.v1beta.GetConversationRequest} message GetConversationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConversationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.source != null && message.hasOwnProperty("source")) + object.source = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1beta.Conversation.Source[message.source] : message.source; + return object; + }; + + /** + * Converts this GetConversationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @instance + * @returns {Object.} JSON object + */ + GetConversationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConversationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConversationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetConversationRequest"; + }; + + return GetConversationRequest; + })(); + + v1beta.DeleteConversationRequest = (function() { + + /** + * Properties of a DeleteConversationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteConversationRequest + * @property {string|null} [name] DeleteConversationRequest name + * @property {google.cloud.ces.v1beta.Conversation.Source|null} [source] DeleteConversationRequest source + */ + + /** + * Constructs a new DeleteConversationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteConversationRequest. + * @implements IDeleteConversationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteConversationRequest=} [properties] Properties to set + */ + function DeleteConversationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteConversationRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @instance + */ + DeleteConversationRequest.prototype.name = ""; + + /** + * DeleteConversationRequest source. + * @member {google.cloud.ces.v1beta.Conversation.Source} source + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @instance + */ + DeleteConversationRequest.prototype.source = 0; + + /** + * Creates a new DeleteConversationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteConversationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteConversationRequest} DeleteConversationRequest instance + */ + DeleteConversationRequest.create = function create(properties) { + return new DeleteConversationRequest(properties); + }; + + /** + * Encodes the specified DeleteConversationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteConversationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteConversationRequest} message DeleteConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteConversationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.source); + return writer; + }; + + /** + * Encodes the specified DeleteConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteConversationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteConversationRequest} message DeleteConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteConversationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteConversationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteConversationRequest} DeleteConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteConversationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteConversationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.source = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteConversationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteConversationRequest} DeleteConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteConversationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteConversationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteConversationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + switch (message.source) { + default: + return "source: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a DeleteConversationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteConversationRequest} DeleteConversationRequest + */ + DeleteConversationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteConversationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteConversationRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.source) { + default: + if (typeof object.source === "number") { + message.source = object.source; + break; + } + break; + case "SOURCE_UNSPECIFIED": + case 0: + message.source = 0; + break; + case "LIVE": + case 1: + message.source = 1; + break; + case "SIMULATOR": + case 2: + message.source = 2; + break; + case "EVAL": + case 3: + message.source = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a DeleteConversationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteConversationRequest} message DeleteConversationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteConversationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.source != null && message.hasOwnProperty("source")) + object.source = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1beta.Conversation.Source[message.source] : message.source; + return object; + }; + + /** + * Converts this DeleteConversationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteConversationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteConversationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteConversationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteConversationRequest"; + }; + + return DeleteConversationRequest; + })(); + + v1beta.BatchDeleteConversationsRequest = (function() { + + /** + * Properties of a BatchDeleteConversationsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IBatchDeleteConversationsRequest + * @property {string|null} [parent] BatchDeleteConversationsRequest parent + * @property {Array.|null} [conversations] BatchDeleteConversationsRequest conversations + */ + + /** + * Constructs a new BatchDeleteConversationsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a BatchDeleteConversationsRequest. + * @implements IBatchDeleteConversationsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsRequest=} [properties] Properties to set + */ + function BatchDeleteConversationsRequest(properties) { + this.conversations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteConversationsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @instance + */ + BatchDeleteConversationsRequest.prototype.parent = ""; + + /** + * BatchDeleteConversationsRequest conversations. + * @member {Array.} conversations + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @instance + */ + BatchDeleteConversationsRequest.prototype.conversations = $util.emptyArray; + + /** + * Creates a new BatchDeleteConversationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @static + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest instance + */ + BatchDeleteConversationsRequest.create = function create(properties) { + return new BatchDeleteConversationsRequest(properties); + }; + + /** + * Encodes the specified BatchDeleteConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @static + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsRequest} message BatchDeleteConversationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteConversationsRequest.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.conversations != null && message.conversations.length) + for (var i = 0; i < message.conversations.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.conversations[i]); + return writer; + }; + + /** + * Encodes the specified BatchDeleteConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @static + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsRequest} message BatchDeleteConversationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteConversationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteConversationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BatchDeleteConversationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.conversations && message.conversations.length)) + message.conversations = []; + message.conversations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteConversationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteConversationsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteConversationsRequest.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.conversations != null && message.hasOwnProperty("conversations")) { + if (!Array.isArray(message.conversations)) + return "conversations: array expected"; + for (var i = 0; i < message.conversations.length; ++i) + if (!$util.isString(message.conversations[i])) + return "conversations: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchDeleteConversationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest + */ + BatchDeleteConversationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.BatchDeleteConversationsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.BatchDeleteConversationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.conversations) { + if (!Array.isArray(object.conversations)) + throw TypeError(".google.cloud.ces.v1beta.BatchDeleteConversationsRequest.conversations: array expected"); + message.conversations = []; + for (var i = 0; i < object.conversations.length; ++i) + message.conversations[i] = String(object.conversations[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchDeleteConversationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @static + * @param {google.cloud.ces.v1beta.BatchDeleteConversationsRequest} message BatchDeleteConversationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteConversationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conversations = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.conversations && message.conversations.length) { + object.conversations = []; + for (var j = 0; j < message.conversations.length; ++j) + object.conversations[j] = message.conversations[j]; + } + return object; + }; + + /** + * Converts this BatchDeleteConversationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteConversationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteConversationsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteConversationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.BatchDeleteConversationsRequest"; + }; + + return BatchDeleteConversationsRequest; + })(); + + v1beta.BatchDeleteConversationsResponse = (function() { + + /** + * Properties of a BatchDeleteConversationsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IBatchDeleteConversationsResponse + * @property {Array.|null} [deletedConversations] BatchDeleteConversationsResponse deletedConversations + * @property {Array.|null} [failedConversations] BatchDeleteConversationsResponse failedConversations + * @property {Array.|null} [errorMessages] BatchDeleteConversationsResponse errorMessages + */ + + /** + * Constructs a new BatchDeleteConversationsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a BatchDeleteConversationsResponse. + * @implements IBatchDeleteConversationsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsResponse=} [properties] Properties to set + */ + function BatchDeleteConversationsResponse(properties) { + this.deletedConversations = []; + this.failedConversations = []; + this.errorMessages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteConversationsResponse deletedConversations. + * @member {Array.} deletedConversations + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @instance + */ + BatchDeleteConversationsResponse.prototype.deletedConversations = $util.emptyArray; + + /** + * BatchDeleteConversationsResponse failedConversations. + * @member {Array.} failedConversations + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @instance + */ + BatchDeleteConversationsResponse.prototype.failedConversations = $util.emptyArray; + + /** + * BatchDeleteConversationsResponse errorMessages. + * @member {Array.} errorMessages + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @instance + */ + BatchDeleteConversationsResponse.prototype.errorMessages = $util.emptyArray; + + /** + * Creates a new BatchDeleteConversationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @static + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse instance + */ + BatchDeleteConversationsResponse.create = function create(properties) { + return new BatchDeleteConversationsResponse(properties); + }; + + /** + * Encodes the specified BatchDeleteConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @static + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsResponse} message BatchDeleteConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteConversationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deletedConversations != null && message.deletedConversations.length) + for (var i = 0; i < message.deletedConversations.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.deletedConversations[i]); + if (message.failedConversations != null && message.failedConversations.length) + for (var i = 0; i < message.failedConversations.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.failedConversations[i]); + if (message.errorMessages != null && message.errorMessages.length) + for (var i = 0; i < message.errorMessages.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorMessages[i]); + return writer; + }; + + /** + * Encodes the specified BatchDeleteConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @static + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsResponse} message BatchDeleteConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteConversationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteConversationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BatchDeleteConversationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.deletedConversations && message.deletedConversations.length)) + message.deletedConversations = []; + message.deletedConversations.push(reader.string()); + break; + } + case 2: { + if (!(message.failedConversations && message.failedConversations.length)) + message.failedConversations = []; + message.failedConversations.push(reader.string()); + break; + } + case 3: { + if (!(message.errorMessages && message.errorMessages.length)) + message.errorMessages = []; + message.errorMessages.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteConversationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteConversationsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteConversationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deletedConversations != null && message.hasOwnProperty("deletedConversations")) { + if (!Array.isArray(message.deletedConversations)) + return "deletedConversations: array expected"; + for (var i = 0; i < message.deletedConversations.length; ++i) + if (!$util.isString(message.deletedConversations[i])) + return "deletedConversations: string[] expected"; + } + if (message.failedConversations != null && message.hasOwnProperty("failedConversations")) { + if (!Array.isArray(message.failedConversations)) + return "failedConversations: array expected"; + for (var i = 0; i < message.failedConversations.length; ++i) + if (!$util.isString(message.failedConversations[i])) + return "failedConversations: string[] expected"; + } + if (message.errorMessages != null && message.hasOwnProperty("errorMessages")) { + if (!Array.isArray(message.errorMessages)) + return "errorMessages: array expected"; + for (var i = 0; i < message.errorMessages.length; ++i) + if (!$util.isString(message.errorMessages[i])) + return "errorMessages: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchDeleteConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse + */ + BatchDeleteConversationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.BatchDeleteConversationsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.BatchDeleteConversationsResponse(); + if (object.deletedConversations) { + if (!Array.isArray(object.deletedConversations)) + throw TypeError(".google.cloud.ces.v1beta.BatchDeleteConversationsResponse.deletedConversations: array expected"); + message.deletedConversations = []; + for (var i = 0; i < object.deletedConversations.length; ++i) + message.deletedConversations[i] = String(object.deletedConversations[i]); + } + if (object.failedConversations) { + if (!Array.isArray(object.failedConversations)) + throw TypeError(".google.cloud.ces.v1beta.BatchDeleteConversationsResponse.failedConversations: array expected"); + message.failedConversations = []; + for (var i = 0; i < object.failedConversations.length; ++i) + message.failedConversations[i] = String(object.failedConversations[i]); + } + if (object.errorMessages) { + if (!Array.isArray(object.errorMessages)) + throw TypeError(".google.cloud.ces.v1beta.BatchDeleteConversationsResponse.errorMessages: array expected"); + message.errorMessages = []; + for (var i = 0; i < object.errorMessages.length; ++i) + message.errorMessages[i] = String(object.errorMessages[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchDeleteConversationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @static + * @param {google.cloud.ces.v1beta.BatchDeleteConversationsResponse} message BatchDeleteConversationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteConversationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.deletedConversations = []; + object.failedConversations = []; + object.errorMessages = []; + } + if (message.deletedConversations && message.deletedConversations.length) { + object.deletedConversations = []; + for (var j = 0; j < message.deletedConversations.length; ++j) + object.deletedConversations[j] = message.deletedConversations[j]; + } + if (message.failedConversations && message.failedConversations.length) { + object.failedConversations = []; + for (var j = 0; j < message.failedConversations.length; ++j) + object.failedConversations[j] = message.failedConversations[j]; + } + if (message.errorMessages && message.errorMessages.length) { + object.errorMessages = []; + for (var j = 0; j < message.errorMessages.length; ++j) + object.errorMessages[j] = message.errorMessages[j]; + } + return object; + }; + + /** + * Converts this BatchDeleteConversationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteConversationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteConversationsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteConversationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.BatchDeleteConversationsResponse"; + }; + + return BatchDeleteConversationsResponse; + })(); + + v1beta.ListGuardrailsRequest = (function() { + + /** + * Properties of a ListGuardrailsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListGuardrailsRequest + * @property {string|null} [parent] ListGuardrailsRequest parent + * @property {number|null} [pageSize] ListGuardrailsRequest pageSize + * @property {string|null} [pageToken] ListGuardrailsRequest pageToken + * @property {string|null} [filter] ListGuardrailsRequest filter + * @property {string|null} [orderBy] ListGuardrailsRequest orderBy + */ + + /** + * Constructs a new ListGuardrailsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListGuardrailsRequest. + * @implements IListGuardrailsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListGuardrailsRequest=} [properties] Properties to set + */ + function ListGuardrailsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGuardrailsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @instance + */ + ListGuardrailsRequest.prototype.parent = ""; + + /** + * ListGuardrailsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @instance + */ + ListGuardrailsRequest.prototype.pageSize = 0; + + /** + * ListGuardrailsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @instance + */ + ListGuardrailsRequest.prototype.pageToken = ""; + + /** + * ListGuardrailsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @instance + */ + ListGuardrailsRequest.prototype.filter = ""; + + /** + * ListGuardrailsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @instance + */ + ListGuardrailsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListGuardrailsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @static + * @param {google.cloud.ces.v1beta.IListGuardrailsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListGuardrailsRequest} ListGuardrailsRequest instance + */ + ListGuardrailsRequest.create = function create(properties) { + return new ListGuardrailsRequest(properties); + }; + + /** + * Encodes the specified ListGuardrailsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @static + * @param {google.cloud.ces.v1beta.IListGuardrailsRequest} message ListGuardrailsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGuardrailsRequest.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 ListGuardrailsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @static + * @param {google.cloud.ces.v1beta.IListGuardrailsRequest} message ListGuardrailsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGuardrailsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGuardrailsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListGuardrailsRequest} ListGuardrailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGuardrailsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListGuardrailsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGuardrailsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListGuardrailsRequest} ListGuardrailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGuardrailsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGuardrailsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGuardrailsRequest.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 ListGuardrailsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListGuardrailsRequest} ListGuardrailsRequest + */ + ListGuardrailsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListGuardrailsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListGuardrailsRequest(); + 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 ListGuardrailsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @static + * @param {google.cloud.ces.v1beta.ListGuardrailsRequest} message ListGuardrailsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGuardrailsRequest.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 ListGuardrailsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @instance + * @returns {Object.} JSON object + */ + ListGuardrailsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGuardrailsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGuardrailsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListGuardrailsRequest"; + }; + + return ListGuardrailsRequest; + })(); + + v1beta.ListGuardrailsResponse = (function() { + + /** + * Properties of a ListGuardrailsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListGuardrailsResponse + * @property {Array.|null} [guardrails] ListGuardrailsResponse guardrails + * @property {string|null} [nextPageToken] ListGuardrailsResponse nextPageToken + */ + + /** + * Constructs a new ListGuardrailsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListGuardrailsResponse. + * @implements IListGuardrailsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListGuardrailsResponse=} [properties] Properties to set + */ + function ListGuardrailsResponse(properties) { + this.guardrails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGuardrailsResponse guardrails. + * @member {Array.} guardrails + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @instance + */ + ListGuardrailsResponse.prototype.guardrails = $util.emptyArray; + + /** + * ListGuardrailsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @instance + */ + ListGuardrailsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListGuardrailsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @static + * @param {google.cloud.ces.v1beta.IListGuardrailsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListGuardrailsResponse} ListGuardrailsResponse instance + */ + ListGuardrailsResponse.create = function create(properties) { + return new ListGuardrailsResponse(properties); + }; + + /** + * Encodes the specified ListGuardrailsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @static + * @param {google.cloud.ces.v1beta.IListGuardrailsResponse} message ListGuardrailsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGuardrailsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.guardrails != null && message.guardrails.length) + for (var i = 0; i < message.guardrails.length; ++i) + $root.google.cloud.ces.v1beta.Guardrail.encode(message.guardrails[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 ListGuardrailsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @static + * @param {google.cloud.ces.v1beta.IListGuardrailsResponse} message ListGuardrailsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGuardrailsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGuardrailsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListGuardrailsResponse} ListGuardrailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGuardrailsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListGuardrailsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.guardrails && message.guardrails.length)) + message.guardrails = []; + message.guardrails.push($root.google.cloud.ces.v1beta.Guardrail.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGuardrailsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListGuardrailsResponse} ListGuardrailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGuardrailsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGuardrailsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGuardrailsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.guardrails != null && message.hasOwnProperty("guardrails")) { + if (!Array.isArray(message.guardrails)) + return "guardrails: array expected"; + for (var i = 0; i < message.guardrails.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Guardrail.verify(message.guardrails[i]); + if (error) + return "guardrails." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListGuardrailsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListGuardrailsResponse} ListGuardrailsResponse + */ + ListGuardrailsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListGuardrailsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListGuardrailsResponse(); + if (object.guardrails) { + if (!Array.isArray(object.guardrails)) + throw TypeError(".google.cloud.ces.v1beta.ListGuardrailsResponse.guardrails: array expected"); + message.guardrails = []; + for (var i = 0; i < object.guardrails.length; ++i) { + if (typeof object.guardrails[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListGuardrailsResponse.guardrails: object expected"); + message.guardrails[i] = $root.google.cloud.ces.v1beta.Guardrail.fromObject(object.guardrails[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListGuardrailsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @static + * @param {google.cloud.ces.v1beta.ListGuardrailsResponse} message ListGuardrailsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGuardrailsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.guardrails = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.guardrails && message.guardrails.length) { + object.guardrails = []; + for (var j = 0; j < message.guardrails.length; ++j) + object.guardrails[j] = $root.google.cloud.ces.v1beta.Guardrail.toObject(message.guardrails[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListGuardrailsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @instance + * @returns {Object.} JSON object + */ + ListGuardrailsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGuardrailsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGuardrailsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListGuardrailsResponse"; + }; + + return ListGuardrailsResponse; + })(); + + v1beta.GetGuardrailRequest = (function() { + + /** + * Properties of a GetGuardrailRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetGuardrailRequest + * @property {string|null} [name] GetGuardrailRequest name + */ + + /** + * Constructs a new GetGuardrailRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetGuardrailRequest. + * @implements IGetGuardrailRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetGuardrailRequest=} [properties] Properties to set + */ + function GetGuardrailRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGuardrailRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @instance + */ + GetGuardrailRequest.prototype.name = ""; + + /** + * Creates a new GetGuardrailRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.IGetGuardrailRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetGuardrailRequest} GetGuardrailRequest instance + */ + GetGuardrailRequest.create = function create(properties) { + return new GetGuardrailRequest(properties); + }; + + /** + * Encodes the specified GetGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetGuardrailRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.IGetGuardrailRequest} message GetGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGuardrailRequest.encode = function encode(message, writer) { + 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 GetGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetGuardrailRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.IGetGuardrailRequest} message GetGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGuardrailRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetGuardrailRequest} GetGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGuardrailRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetGuardrailRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGuardrailRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetGuardrailRequest} GetGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGuardrailRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGuardrailRequest.verify = function verify(message) { + if (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 GetGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetGuardrailRequest} GetGuardrailRequest + */ + GetGuardrailRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetGuardrailRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetGuardrailRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGuardrailRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.GetGuardrailRequest} message GetGuardrailRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGuardrailRequest.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 GetGuardrailRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @instance + * @returns {Object.} JSON object + */ + GetGuardrailRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGuardrailRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetGuardrailRequest"; + }; + + return GetGuardrailRequest; + })(); + + v1beta.CreateGuardrailRequest = (function() { + + /** + * Properties of a CreateGuardrailRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateGuardrailRequest + * @property {string|null} [parent] CreateGuardrailRequest parent + * @property {string|null} [guardrailId] CreateGuardrailRequest guardrailId + * @property {google.cloud.ces.v1beta.IGuardrail|null} [guardrail] CreateGuardrailRequest guardrail + */ + + /** + * Constructs a new CreateGuardrailRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateGuardrailRequest. + * @implements ICreateGuardrailRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateGuardrailRequest=} [properties] Properties to set + */ + function CreateGuardrailRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGuardrailRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @instance + */ + CreateGuardrailRequest.prototype.parent = ""; + + /** + * CreateGuardrailRequest guardrailId. + * @member {string} guardrailId + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @instance + */ + CreateGuardrailRequest.prototype.guardrailId = ""; + + /** + * CreateGuardrailRequest guardrail. + * @member {google.cloud.ces.v1beta.IGuardrail|null|undefined} guardrail + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @instance + */ + CreateGuardrailRequest.prototype.guardrail = null; + + /** + * Creates a new CreateGuardrailRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateGuardrailRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateGuardrailRequest} CreateGuardrailRequest instance + */ + CreateGuardrailRequest.create = function create(properties) { + return new CreateGuardrailRequest(properties); + }; + + /** + * Encodes the specified CreateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateGuardrailRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateGuardrailRequest} message CreateGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGuardrailRequest.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.guardrailId != null && Object.hasOwnProperty.call(message, "guardrailId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.guardrailId); + if (message.guardrail != null && Object.hasOwnProperty.call(message, "guardrail")) + $root.google.cloud.ces.v1beta.Guardrail.encode(message.guardrail, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateGuardrailRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateGuardrailRequest} message CreateGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGuardrailRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateGuardrailRequest} CreateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGuardrailRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateGuardrailRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.guardrailId = reader.string(); + break; + } + case 3: { + message.guardrail = $root.google.cloud.ces.v1beta.Guardrail.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGuardrailRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateGuardrailRequest} CreateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGuardrailRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGuardrailRequest.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.guardrailId != null && message.hasOwnProperty("guardrailId")) + if (!$util.isString(message.guardrailId)) + return "guardrailId: string expected"; + if (message.guardrail != null && message.hasOwnProperty("guardrail")) { + var error = $root.google.cloud.ces.v1beta.Guardrail.verify(message.guardrail); + if (error) + return "guardrail." + error; + } + return null; + }; + + /** + * Creates a CreateGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateGuardrailRequest} CreateGuardrailRequest + */ + CreateGuardrailRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateGuardrailRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateGuardrailRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.guardrailId != null) + message.guardrailId = String(object.guardrailId); + if (object.guardrail != null) { + if (typeof object.guardrail !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateGuardrailRequest.guardrail: object expected"); + message.guardrail = $root.google.cloud.ces.v1beta.Guardrail.fromObject(object.guardrail); + } + return message; + }; + + /** + * Creates a plain object from a CreateGuardrailRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.CreateGuardrailRequest} message CreateGuardrailRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGuardrailRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.guardrailId = ""; + object.guardrail = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.guardrailId != null && message.hasOwnProperty("guardrailId")) + object.guardrailId = message.guardrailId; + if (message.guardrail != null && message.hasOwnProperty("guardrail")) + object.guardrail = $root.google.cloud.ces.v1beta.Guardrail.toObject(message.guardrail, options); + return object; + }; + + /** + * Converts this CreateGuardrailRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGuardrailRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateGuardrailRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateGuardrailRequest"; + }; + + return CreateGuardrailRequest; + })(); + + v1beta.UpdateGuardrailRequest = (function() { + + /** + * Properties of an UpdateGuardrailRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateGuardrailRequest + * @property {google.cloud.ces.v1beta.IGuardrail|null} [guardrail] UpdateGuardrailRequest guardrail + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGuardrailRequest updateMask + */ + + /** + * Constructs a new UpdateGuardrailRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateGuardrailRequest. + * @implements IUpdateGuardrailRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateGuardrailRequest=} [properties] Properties to set + */ + function UpdateGuardrailRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateGuardrailRequest guardrail. + * @member {google.cloud.ces.v1beta.IGuardrail|null|undefined} guardrail + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @instance + */ + UpdateGuardrailRequest.prototype.guardrail = null; + + /** + * UpdateGuardrailRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @instance + */ + UpdateGuardrailRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateGuardrailRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateGuardrailRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateGuardrailRequest} UpdateGuardrailRequest instance + */ + UpdateGuardrailRequest.create = function create(properties) { + return new UpdateGuardrailRequest(properties); + }; + + /** + * Encodes the specified UpdateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateGuardrailRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateGuardrailRequest} message UpdateGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGuardrailRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.guardrail != null && Object.hasOwnProperty.call(message, "guardrail")) + $root.google.cloud.ces.v1beta.Guardrail.encode(message.guardrail, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateGuardrailRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateGuardrailRequest} message UpdateGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGuardrailRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateGuardrailRequest} UpdateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGuardrailRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateGuardrailRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.guardrail = $root.google.cloud.ces.v1beta.Guardrail.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateGuardrailRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateGuardrailRequest} UpdateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGuardrailRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGuardrailRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.guardrail != null && message.hasOwnProperty("guardrail")) { + var error = $root.google.cloud.ces.v1beta.Guardrail.verify(message.guardrail); + if (error) + return "guardrail." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateGuardrailRequest} UpdateGuardrailRequest + */ + UpdateGuardrailRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateGuardrailRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateGuardrailRequest(); + if (object.guardrail != null) { + if (typeof object.guardrail !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateGuardrailRequest.guardrail: object expected"); + message.guardrail = $root.google.cloud.ces.v1beta.Guardrail.fromObject(object.guardrail); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateGuardrailRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateGuardrailRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateGuardrailRequest} message UpdateGuardrailRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGuardrailRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.guardrail = null; + object.updateMask = null; + } + if (message.guardrail != null && message.hasOwnProperty("guardrail")) + object.guardrail = $root.google.cloud.ces.v1beta.Guardrail.toObject(message.guardrail, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateGuardrailRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateGuardrailRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateGuardrailRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateGuardrailRequest"; + }; + + return UpdateGuardrailRequest; + })(); + + v1beta.DeleteGuardrailRequest = (function() { + + /** + * Properties of a DeleteGuardrailRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteGuardrailRequest + * @property {string|null} [name] DeleteGuardrailRequest name + * @property {boolean|null} [force] DeleteGuardrailRequest force + * @property {string|null} [etag] DeleteGuardrailRequest etag + */ + + /** + * Constructs a new DeleteGuardrailRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteGuardrailRequest. + * @implements IDeleteGuardrailRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteGuardrailRequest=} [properties] Properties to set + */ + function DeleteGuardrailRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGuardrailRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @instance + */ + DeleteGuardrailRequest.prototype.name = ""; + + /** + * DeleteGuardrailRequest force. + * @member {boolean} force + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @instance + */ + DeleteGuardrailRequest.prototype.force = false; + + /** + * DeleteGuardrailRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @instance + */ + DeleteGuardrailRequest.prototype.etag = ""; + + /** + * Creates a new DeleteGuardrailRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteGuardrailRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteGuardrailRequest} DeleteGuardrailRequest instance + */ + DeleteGuardrailRequest.create = function create(properties) { + return new DeleteGuardrailRequest(properties); + }; + + /** + * Encodes the specified DeleteGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteGuardrailRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteGuardrailRequest} message DeleteGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGuardrailRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteGuardrailRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteGuardrailRequest} message DeleteGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGuardrailRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteGuardrailRequest} DeleteGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGuardrailRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteGuardrailRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGuardrailRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteGuardrailRequest} DeleteGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGuardrailRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGuardrailRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteGuardrailRequest} DeleteGuardrailRequest + */ + DeleteGuardrailRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteGuardrailRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteGuardrailRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteGuardrailRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteGuardrailRequest} message DeleteGuardrailRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGuardrailRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteGuardrailRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGuardrailRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteGuardrailRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteGuardrailRequest"; + }; + + return DeleteGuardrailRequest; + })(); + + v1beta.ListDeploymentsRequest = (function() { + + /** + * Properties of a ListDeploymentsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListDeploymentsRequest + * @property {string|null} [parent] ListDeploymentsRequest parent + * @property {number|null} [pageSize] ListDeploymentsRequest pageSize + * @property {string|null} [pageToken] ListDeploymentsRequest pageToken + * @property {string|null} [orderBy] ListDeploymentsRequest orderBy + */ + + /** + * Constructs a new ListDeploymentsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListDeploymentsRequest. + * @implements IListDeploymentsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListDeploymentsRequest=} [properties] Properties to set + */ + function ListDeploymentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDeploymentsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.parent = ""; + + /** + * ListDeploymentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.pageSize = 0; + + /** + * ListDeploymentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.pageToken = ""; + + /** + * ListDeploymentsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListDeploymentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @static + * @param {google.cloud.ces.v1beta.IListDeploymentsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListDeploymentsRequest} ListDeploymentsRequest instance + */ + ListDeploymentsRequest.create = function create(properties) { + return new ListDeploymentsRequest(properties); + }; + + /** + * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @static + * @param {google.cloud.ces.v1beta.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsRequest.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @static + * @param {google.cloud.ces.v1beta.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListDeploymentsRequest} ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListDeploymentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListDeploymentsRequest} ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeploymentsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeploymentsRequest.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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListDeploymentsRequest} ListDeploymentsRequest + */ + ListDeploymentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListDeploymentsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListDeploymentsRequest(); + 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.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListDeploymentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @static + * @param {google.cloud.ces.v1beta.ListDeploymentsRequest} message ListDeploymentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeploymentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + 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.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListDeploymentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDeploymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeploymentsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeploymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListDeploymentsRequest"; + }; + + return ListDeploymentsRequest; + })(); + + v1beta.ListDeploymentsResponse = (function() { + + /** + * Properties of a ListDeploymentsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListDeploymentsResponse + * @property {Array.|null} [deployments] ListDeploymentsResponse deployments + * @property {string|null} [nextPageToken] ListDeploymentsResponse nextPageToken + */ + + /** + * Constructs a new ListDeploymentsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListDeploymentsResponse. + * @implements IListDeploymentsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListDeploymentsResponse=} [properties] Properties to set + */ + function ListDeploymentsResponse(properties) { + this.deployments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDeploymentsResponse deployments. + * @member {Array.} deployments + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @instance + */ + ListDeploymentsResponse.prototype.deployments = $util.emptyArray; + + /** + * ListDeploymentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @instance + */ + ListDeploymentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDeploymentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @static + * @param {google.cloud.ces.v1beta.IListDeploymentsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListDeploymentsResponse} ListDeploymentsResponse instance + */ + ListDeploymentsResponse.create = function create(properties) { + return new ListDeploymentsResponse(properties); + }; + + /** + * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @static + * @param {google.cloud.ces.v1beta.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployments != null && message.deployments.length) + for (var i = 0; i < message.deployments.length; ++i) + $root.google.cloud.ces.v1beta.Deployment.encode(message.deployments[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 ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @static + * @param {google.cloud.ces.v1beta.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListDeploymentsResponse} ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListDeploymentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.deployments && message.deployments.length)) + message.deployments = []; + message.deployments.push($root.google.cloud.ces.v1beta.Deployment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListDeploymentsResponse} ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeploymentsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeploymentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deployments != null && message.hasOwnProperty("deployments")) { + if (!Array.isArray(message.deployments)) + return "deployments: array expected"; + for (var i = 0; i < message.deployments.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Deployment.verify(message.deployments[i]); + if (error) + return "deployments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListDeploymentsResponse} ListDeploymentsResponse + */ + ListDeploymentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListDeploymentsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListDeploymentsResponse(); + if (object.deployments) { + if (!Array.isArray(object.deployments)) + throw TypeError(".google.cloud.ces.v1beta.ListDeploymentsResponse.deployments: array expected"); + message.deployments = []; + for (var i = 0; i < object.deployments.length; ++i) { + if (typeof object.deployments[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListDeploymentsResponse.deployments: object expected"); + message.deployments[i] = $root.google.cloud.ces.v1beta.Deployment.fromObject(object.deployments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @static + * @param {google.cloud.ces.v1beta.ListDeploymentsResponse} message ListDeploymentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeploymentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.deployments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.deployments && message.deployments.length) { + object.deployments = []; + for (var j = 0; j < message.deployments.length; ++j) + object.deployments[j] = $root.google.cloud.ces.v1beta.Deployment.toObject(message.deployments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDeploymentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDeploymentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeploymentsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeploymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListDeploymentsResponse"; + }; + + return ListDeploymentsResponse; + })(); + + v1beta.GetDeploymentRequest = (function() { + + /** + * Properties of a GetDeploymentRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetDeploymentRequest + * @property {string|null} [name] GetDeploymentRequest name + */ + + /** + * Constructs a new GetDeploymentRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetDeploymentRequest. + * @implements IGetDeploymentRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetDeploymentRequest=} [properties] Properties to set + */ + function GetDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @instance + */ + GetDeploymentRequest.prototype.name = ""; + + /** + * Creates a new GetDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.IGetDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetDeploymentRequest} GetDeploymentRequest instance + */ + GetDeploymentRequest.create = function create(properties) { + return new GetDeploymentRequest(properties); + }; + + /** + * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeploymentRequest.encode = function encode(message, writer) { + 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 GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetDeploymentRequest} GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetDeploymentRequest} GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDeploymentRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDeploymentRequest.verify = function verify(message) { + if (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 GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetDeploymentRequest} GetDeploymentRequest + */ + GetDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetDeploymentRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.GetDeploymentRequest} message GetDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDeploymentRequest.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 GetDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + GetDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetDeploymentRequest"; + }; + + return GetDeploymentRequest; + })(); + + v1beta.CreateDeploymentRequest = (function() { + + /** + * Properties of a CreateDeploymentRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateDeploymentRequest + * @property {string|null} [parent] CreateDeploymentRequest parent + * @property {string|null} [deploymentId] CreateDeploymentRequest deploymentId + * @property {google.cloud.ces.v1beta.IDeployment|null} [deployment] CreateDeploymentRequest deployment + */ + + /** + * Constructs a new CreateDeploymentRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateDeploymentRequest. + * @implements ICreateDeploymentRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateDeploymentRequest=} [properties] Properties to set + */ + function CreateDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDeploymentRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @instance + */ + CreateDeploymentRequest.prototype.parent = ""; + + /** + * CreateDeploymentRequest deploymentId. + * @member {string} deploymentId + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @instance + */ + CreateDeploymentRequest.prototype.deploymentId = ""; + + /** + * CreateDeploymentRequest deployment. + * @member {google.cloud.ces.v1beta.IDeployment|null|undefined} deployment + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @instance + */ + CreateDeploymentRequest.prototype.deployment = null; + + /** + * Creates a new CreateDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateDeploymentRequest} CreateDeploymentRequest instance + */ + CreateDeploymentRequest.create = function create(properties) { + return new CreateDeploymentRequest(properties); + }; + + /** + * Encodes the specified CreateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateDeploymentRequest} message CreateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDeploymentRequest.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.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + $root.google.cloud.ces.v1beta.Deployment.encode(message.deployment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deploymentId != null && Object.hasOwnProperty.call(message, "deploymentId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deploymentId); + return writer; + }; + + /** + * Encodes the specified CreateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateDeploymentRequest} message CreateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateDeploymentRequest} CreateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.deploymentId = reader.string(); + break; + } + case 2: { + message.deployment = $root.google.cloud.ces.v1beta.Deployment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateDeploymentRequest} CreateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDeploymentRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDeploymentRequest.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.deploymentId != null && message.hasOwnProperty("deploymentId")) + if (!$util.isString(message.deploymentId)) + return "deploymentId: string expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) { + var error = $root.google.cloud.ces.v1beta.Deployment.verify(message.deployment); + if (error) + return "deployment." + error; + } + return null; + }; + + /** + * Creates a CreateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateDeploymentRequest} CreateDeploymentRequest + */ + CreateDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateDeploymentRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateDeploymentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.deploymentId != null) + message.deploymentId = String(object.deploymentId); + if (object.deployment != null) { + if (typeof object.deployment !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateDeploymentRequest.deployment: object expected"); + message.deployment = $root.google.cloud.ces.v1beta.Deployment.fromObject(object.deployment); + } + return message; + }; + + /** + * Creates a plain object from a CreateDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.CreateDeploymentRequest} message CreateDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.deployment = null; + object.deploymentId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = $root.google.cloud.ces.v1beta.Deployment.toObject(message.deployment, options); + if (message.deploymentId != null && message.hasOwnProperty("deploymentId")) + object.deploymentId = message.deploymentId; + return object; + }; + + /** + * Converts this CreateDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateDeploymentRequest"; + }; + + return CreateDeploymentRequest; + })(); + + v1beta.UpdateDeploymentRequest = (function() { + + /** + * Properties of an UpdateDeploymentRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateDeploymentRequest + * @property {google.cloud.ces.v1beta.IDeployment|null} [deployment] UpdateDeploymentRequest deployment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDeploymentRequest updateMask + */ + + /** + * Constructs a new UpdateDeploymentRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateDeploymentRequest. + * @implements IUpdateDeploymentRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateDeploymentRequest=} [properties] Properties to set + */ + function UpdateDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDeploymentRequest deployment. + * @member {google.cloud.ces.v1beta.IDeployment|null|undefined} deployment + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @instance + */ + UpdateDeploymentRequest.prototype.deployment = null; + + /** + * UpdateDeploymentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @instance + */ + UpdateDeploymentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateDeploymentRequest} UpdateDeploymentRequest instance + */ + UpdateDeploymentRequest.create = function create(properties) { + return new UpdateDeploymentRequest(properties); + }; + + /** + * Encodes the specified UpdateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateDeploymentRequest} message UpdateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + $root.google.cloud.ces.v1beta.Deployment.encode(message.deployment, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateDeploymentRequest} message UpdateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateDeploymentRequest} UpdateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deployment = $root.google.cloud.ces.v1beta.Deployment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateDeploymentRequest} UpdateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDeploymentRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) { + var error = $root.google.cloud.ces.v1beta.Deployment.verify(message.deployment); + if (error) + return "deployment." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateDeploymentRequest} UpdateDeploymentRequest + */ + UpdateDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateDeploymentRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateDeploymentRequest(); + if (object.deployment != null) { + if (typeof object.deployment !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateDeploymentRequest.deployment: object expected"); + message.deployment = $root.google.cloud.ces.v1beta.Deployment.fromObject(object.deployment); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateDeploymentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateDeploymentRequest} message UpdateDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deployment = null; + object.updateMask = null; + } + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = $root.google.cloud.ces.v1beta.Deployment.toObject(message.deployment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateDeploymentRequest"; + }; + + return UpdateDeploymentRequest; + })(); + + v1beta.DeleteDeploymentRequest = (function() { + + /** + * Properties of a DeleteDeploymentRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteDeploymentRequest + * @property {string|null} [name] DeleteDeploymentRequest name + * @property {string|null} [etag] DeleteDeploymentRequest etag + */ + + /** + * Constructs a new DeleteDeploymentRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteDeploymentRequest. + * @implements IDeleteDeploymentRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteDeploymentRequest=} [properties] Properties to set + */ + function DeleteDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @instance + */ + DeleteDeploymentRequest.prototype.name = ""; + + /** + * DeleteDeploymentRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @instance + */ + DeleteDeploymentRequest.prototype.etag = ""; + + /** + * Creates a new DeleteDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteDeploymentRequest} DeleteDeploymentRequest instance + */ + DeleteDeploymentRequest.create = function create(properties) { + return new DeleteDeploymentRequest(properties); + }; + + /** + * Encodes the specified DeleteDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteDeploymentRequest} message DeleteDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteDeploymentRequest} message DeleteDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteDeploymentRequest} DeleteDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteDeploymentRequest} DeleteDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDeploymentRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteDeploymentRequest} DeleteDeploymentRequest + */ + DeleteDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteDeploymentRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteDeploymentRequest} message DeleteDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteDeploymentRequest"; + }; + + return DeleteDeploymentRequest; + })(); + + v1beta.ListToolsetsRequest = (function() { + + /** + * Properties of a ListToolsetsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListToolsetsRequest + * @property {string|null} [parent] ListToolsetsRequest parent + * @property {number|null} [pageSize] ListToolsetsRequest pageSize + * @property {string|null} [pageToken] ListToolsetsRequest pageToken + * @property {string|null} [filter] ListToolsetsRequest filter + * @property {string|null} [orderBy] ListToolsetsRequest orderBy + */ + + /** + * Constructs a new ListToolsetsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListToolsetsRequest. + * @implements IListToolsetsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListToolsetsRequest=} [properties] Properties to set + */ + function ListToolsetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolsetsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @instance + */ + ListToolsetsRequest.prototype.parent = ""; + + /** + * ListToolsetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @instance + */ + ListToolsetsRequest.prototype.pageSize = 0; + + /** + * ListToolsetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @instance + */ + ListToolsetsRequest.prototype.pageToken = ""; + + /** + * ListToolsetsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @instance + */ + ListToolsetsRequest.prototype.filter = ""; + + /** + * ListToolsetsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @instance + */ + ListToolsetsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListToolsetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @static + * @param {google.cloud.ces.v1beta.IListToolsetsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListToolsetsRequest} ListToolsetsRequest instance + */ + ListToolsetsRequest.create = function create(properties) { + return new ListToolsetsRequest(properties); + }; + + /** + * Encodes the specified ListToolsetsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @static + * @param {google.cloud.ces.v1beta.IListToolsetsRequest} message ListToolsetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsetsRequest.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 ListToolsetsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @static + * @param {google.cloud.ces.v1beta.IListToolsetsRequest} message ListToolsetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolsetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListToolsetsRequest} ListToolsetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsetsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListToolsetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolsetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListToolsetsRequest} ListToolsetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolsetsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolsetsRequest.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 ListToolsetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListToolsetsRequest} ListToolsetsRequest + */ + ListToolsetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListToolsetsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListToolsetsRequest(); + 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 ListToolsetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @static + * @param {google.cloud.ces.v1beta.ListToolsetsRequest} message ListToolsetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolsetsRequest.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 ListToolsetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListToolsetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolsetsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolsetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListToolsetsRequest"; + }; + + return ListToolsetsRequest; + })(); + + v1beta.ListToolsetsResponse = (function() { + + /** + * Properties of a ListToolsetsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListToolsetsResponse + * @property {Array.|null} [toolsets] ListToolsetsResponse toolsets + * @property {string|null} [nextPageToken] ListToolsetsResponse nextPageToken + */ + + /** + * Constructs a new ListToolsetsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListToolsetsResponse. + * @implements IListToolsetsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListToolsetsResponse=} [properties] Properties to set + */ + function ListToolsetsResponse(properties) { + this.toolsets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolsetsResponse toolsets. + * @member {Array.} toolsets + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @instance + */ + ListToolsetsResponse.prototype.toolsets = $util.emptyArray; + + /** + * ListToolsetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @instance + */ + ListToolsetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListToolsetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @static + * @param {google.cloud.ces.v1beta.IListToolsetsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListToolsetsResponse} ListToolsetsResponse instance + */ + ListToolsetsResponse.create = function create(properties) { + return new ListToolsetsResponse(properties); + }; + + /** + * Encodes the specified ListToolsetsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @static + * @param {google.cloud.ces.v1beta.IListToolsetsResponse} message ListToolsetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolsets != null && message.toolsets.length) + for (var i = 0; i < message.toolsets.length; ++i) + $root.google.cloud.ces.v1beta.Toolset.encode(message.toolsets[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 ListToolsetsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @static + * @param {google.cloud.ces.v1beta.IListToolsetsResponse} message ListToolsetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolsetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListToolsetsResponse} ListToolsetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsetsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListToolsetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.toolsets && message.toolsets.length)) + message.toolsets = []; + message.toolsets.push($root.google.cloud.ces.v1beta.Toolset.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolsetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListToolsetsResponse} ListToolsetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolsetsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolsetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolsets != null && message.hasOwnProperty("toolsets")) { + if (!Array.isArray(message.toolsets)) + return "toolsets: array expected"; + for (var i = 0; i < message.toolsets.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Toolset.verify(message.toolsets[i]); + if (error) + return "toolsets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListToolsetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListToolsetsResponse} ListToolsetsResponse + */ + ListToolsetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListToolsetsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListToolsetsResponse(); + if (object.toolsets) { + if (!Array.isArray(object.toolsets)) + throw TypeError(".google.cloud.ces.v1beta.ListToolsetsResponse.toolsets: array expected"); + message.toolsets = []; + for (var i = 0; i < object.toolsets.length; ++i) { + if (typeof object.toolsets[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListToolsetsResponse.toolsets: object expected"); + message.toolsets[i] = $root.google.cloud.ces.v1beta.Toolset.fromObject(object.toolsets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListToolsetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @static + * @param {google.cloud.ces.v1beta.ListToolsetsResponse} message ListToolsetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolsetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.toolsets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.toolsets && message.toolsets.length) { + object.toolsets = []; + for (var j = 0; j < message.toolsets.length; ++j) + object.toolsets[j] = $root.google.cloud.ces.v1beta.Toolset.toObject(message.toolsets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListToolsetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListToolsetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolsetsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolsetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListToolsetsResponse"; + }; + + return ListToolsetsResponse; + })(); + + v1beta.GetToolsetRequest = (function() { + + /** + * Properties of a GetToolsetRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetToolsetRequest + * @property {string|null} [name] GetToolsetRequest name + */ + + /** + * Constructs a new GetToolsetRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetToolsetRequest. + * @implements IGetToolsetRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetToolsetRequest=} [properties] Properties to set + */ + function GetToolsetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetToolsetRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @instance + */ + GetToolsetRequest.prototype.name = ""; + + /** + * Creates a new GetToolsetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.IGetToolsetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetToolsetRequest} GetToolsetRequest instance + */ + GetToolsetRequest.create = function create(properties) { + return new GetToolsetRequest(properties); + }; + + /** + * Encodes the specified GetToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetToolsetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.IGetToolsetRequest} message GetToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolsetRequest.encode = function encode(message, writer) { + 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 GetToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetToolsetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.IGetToolsetRequest} message GetToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetToolsetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetToolsetRequest} GetToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolsetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetToolsetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetToolsetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetToolsetRequest} GetToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolsetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetToolsetRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetToolsetRequest.verify = function verify(message) { + if (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 GetToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetToolsetRequest} GetToolsetRequest + */ + GetToolsetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetToolsetRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetToolsetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetToolsetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.GetToolsetRequest} message GetToolsetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetToolsetRequest.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 GetToolsetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @instance + * @returns {Object.} JSON object + */ + GetToolsetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetToolsetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetToolsetRequest"; + }; + + return GetToolsetRequest; + })(); + + v1beta.CreateToolsetRequest = (function() { + + /** + * Properties of a CreateToolsetRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateToolsetRequest + * @property {string|null} [parent] CreateToolsetRequest parent + * @property {string|null} [toolsetId] CreateToolsetRequest toolsetId + * @property {google.cloud.ces.v1beta.IToolset|null} [toolset] CreateToolsetRequest toolset + */ + + /** + * Constructs a new CreateToolsetRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateToolsetRequest. + * @implements ICreateToolsetRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateToolsetRequest=} [properties] Properties to set + */ + function CreateToolsetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateToolsetRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @instance + */ + CreateToolsetRequest.prototype.parent = ""; + + /** + * CreateToolsetRequest toolsetId. + * @member {string} toolsetId + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @instance + */ + CreateToolsetRequest.prototype.toolsetId = ""; + + /** + * CreateToolsetRequest toolset. + * @member {google.cloud.ces.v1beta.IToolset|null|undefined} toolset + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @instance + */ + CreateToolsetRequest.prototype.toolset = null; + + /** + * Creates a new CreateToolsetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateToolsetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateToolsetRequest} CreateToolsetRequest instance + */ + CreateToolsetRequest.create = function create(properties) { + return new CreateToolsetRequest(properties); + }; + + /** + * Encodes the specified CreateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolsetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateToolsetRequest} message CreateToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolsetRequest.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.toolsetId != null && Object.hasOwnProperty.call(message, "toolsetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.toolsetId); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + $root.google.cloud.ces.v1beta.Toolset.encode(message.toolset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolsetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateToolsetRequest} message CreateToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateToolsetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateToolsetRequest} CreateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolsetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateToolsetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.toolsetId = reader.string(); + break; + } + case 3: { + message.toolset = $root.google.cloud.ces.v1beta.Toolset.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateToolsetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateToolsetRequest} CreateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolsetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateToolsetRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateToolsetRequest.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.toolsetId != null && message.hasOwnProperty("toolsetId")) + if (!$util.isString(message.toolsetId)) + return "toolsetId: string expected"; + if (message.toolset != null && message.hasOwnProperty("toolset")) { + var error = $root.google.cloud.ces.v1beta.Toolset.verify(message.toolset); + if (error) + return "toolset." + error; + } + return null; + }; + + /** + * Creates a CreateToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateToolsetRequest} CreateToolsetRequest + */ + CreateToolsetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateToolsetRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateToolsetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.toolsetId != null) + message.toolsetId = String(object.toolsetId); + if (object.toolset != null) { + if (typeof object.toolset !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateToolsetRequest.toolset: object expected"); + message.toolset = $root.google.cloud.ces.v1beta.Toolset.fromObject(object.toolset); + } + return message; + }; + + /** + * Creates a plain object from a CreateToolsetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.CreateToolsetRequest} message CreateToolsetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateToolsetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.toolsetId = ""; + object.toolset = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.toolsetId != null && message.hasOwnProperty("toolsetId")) + object.toolsetId = message.toolsetId; + if (message.toolset != null && message.hasOwnProperty("toolset")) + object.toolset = $root.google.cloud.ces.v1beta.Toolset.toObject(message.toolset, options); + return object; + }; + + /** + * Converts this CreateToolsetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateToolsetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateToolsetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateToolsetRequest"; + }; + + return CreateToolsetRequest; + })(); + + v1beta.UpdateToolsetRequest = (function() { + + /** + * Properties of an UpdateToolsetRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateToolsetRequest + * @property {google.cloud.ces.v1beta.IToolset|null} [toolset] UpdateToolsetRequest toolset + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateToolsetRequest updateMask + */ + + /** + * Constructs a new UpdateToolsetRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateToolsetRequest. + * @implements IUpdateToolsetRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateToolsetRequest=} [properties] Properties to set + */ + function UpdateToolsetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateToolsetRequest toolset. + * @member {google.cloud.ces.v1beta.IToolset|null|undefined} toolset + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @instance + */ + UpdateToolsetRequest.prototype.toolset = null; + + /** + * UpdateToolsetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @instance + */ + UpdateToolsetRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateToolsetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateToolsetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateToolsetRequest} UpdateToolsetRequest instance + */ + UpdateToolsetRequest.create = function create(properties) { + return new UpdateToolsetRequest(properties); + }; + + /** + * Encodes the specified UpdateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolsetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateToolsetRequest} message UpdateToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateToolsetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + $root.google.cloud.ces.v1beta.Toolset.encode(message.toolset, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolsetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateToolsetRequest} message UpdateToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateToolsetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateToolsetRequest} UpdateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateToolsetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateToolsetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolset = $root.google.cloud.ces.v1beta.Toolset.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateToolsetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateToolsetRequest} UpdateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateToolsetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateToolsetRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateToolsetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolset != null && message.hasOwnProperty("toolset")) { + var error = $root.google.cloud.ces.v1beta.Toolset.verify(message.toolset); + if (error) + return "toolset." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateToolsetRequest} UpdateToolsetRequest + */ + UpdateToolsetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateToolsetRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateToolsetRequest(); + if (object.toolset != null) { + if (typeof object.toolset !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateToolsetRequest.toolset: object expected"); + message.toolset = $root.google.cloud.ces.v1beta.Toolset.fromObject(object.toolset); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateToolsetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateToolsetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateToolsetRequest} message UpdateToolsetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateToolsetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.toolset = null; + object.updateMask = null; + } + if (message.toolset != null && message.hasOwnProperty("toolset")) + object.toolset = $root.google.cloud.ces.v1beta.Toolset.toObject(message.toolset, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateToolsetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateToolsetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateToolsetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateToolsetRequest"; + }; + + return UpdateToolsetRequest; + })(); + + v1beta.DeleteToolsetRequest = (function() { + + /** + * Properties of a DeleteToolsetRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteToolsetRequest + * @property {string|null} [name] DeleteToolsetRequest name + * @property {boolean|null} [force] DeleteToolsetRequest force + * @property {string|null} [etag] DeleteToolsetRequest etag + */ + + /** + * Constructs a new DeleteToolsetRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteToolsetRequest. + * @implements IDeleteToolsetRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteToolsetRequest=} [properties] Properties to set + */ + function DeleteToolsetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteToolsetRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @instance + */ + DeleteToolsetRequest.prototype.name = ""; + + /** + * DeleteToolsetRequest force. + * @member {boolean} force + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @instance + */ + DeleteToolsetRequest.prototype.force = false; + + /** + * DeleteToolsetRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @instance + */ + DeleteToolsetRequest.prototype.etag = ""; + + /** + * Creates a new DeleteToolsetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteToolsetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteToolsetRequest} DeleteToolsetRequest instance + */ + DeleteToolsetRequest.create = function create(properties) { + return new DeleteToolsetRequest(properties); + }; + + /** + * Encodes the specified DeleteToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolsetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteToolsetRequest} message DeleteToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolsetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolsetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteToolsetRequest} message DeleteToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteToolsetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteToolsetRequest} DeleteToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolsetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteToolsetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteToolsetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteToolsetRequest} DeleteToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolsetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteToolsetRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteToolsetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteToolsetRequest} DeleteToolsetRequest + */ + DeleteToolsetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteToolsetRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteToolsetRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteToolsetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteToolsetRequest} message DeleteToolsetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteToolsetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteToolsetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteToolsetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteToolsetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteToolsetRequest"; + }; + + return DeleteToolsetRequest; + })(); + + v1beta.ListAppVersionsRequest = (function() { + + /** + * Properties of a ListAppVersionsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListAppVersionsRequest + * @property {string|null} [parent] ListAppVersionsRequest parent + * @property {number|null} [pageSize] ListAppVersionsRequest pageSize + * @property {string|null} [pageToken] ListAppVersionsRequest pageToken + * @property {string|null} [filter] ListAppVersionsRequest filter + * @property {string|null} [orderBy] ListAppVersionsRequest orderBy + */ + + /** + * Constructs a new ListAppVersionsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListAppVersionsRequest. + * @implements IListAppVersionsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListAppVersionsRequest=} [properties] Properties to set + */ + function ListAppVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAppVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @instance + */ + ListAppVersionsRequest.prototype.parent = ""; + + /** + * ListAppVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @instance + */ + ListAppVersionsRequest.prototype.pageSize = 0; + + /** + * ListAppVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @instance + */ + ListAppVersionsRequest.prototype.pageToken = ""; + + /** + * ListAppVersionsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @instance + */ + ListAppVersionsRequest.prototype.filter = ""; + + /** + * ListAppVersionsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @instance + */ + ListAppVersionsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListAppVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @static + * @param {google.cloud.ces.v1beta.IListAppVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListAppVersionsRequest} ListAppVersionsRequest instance + */ + ListAppVersionsRequest.create = function create(properties) { + return new ListAppVersionsRequest(properties); + }; + + /** + * Encodes the specified ListAppVersionsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @static + * @param {google.cloud.ces.v1beta.IListAppVersionsRequest} message ListAppVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppVersionsRequest.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 ListAppVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @static + * @param {google.cloud.ces.v1beta.IListAppVersionsRequest} message ListAppVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAppVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListAppVersionsRequest} ListAppVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppVersionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListAppVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAppVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListAppVersionsRequest} ListAppVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAppVersionsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAppVersionsRequest.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 ListAppVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListAppVersionsRequest} ListAppVersionsRequest + */ + ListAppVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListAppVersionsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListAppVersionsRequest(); + 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 ListAppVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @static + * @param {google.cloud.ces.v1beta.ListAppVersionsRequest} message ListAppVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAppVersionsRequest.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 ListAppVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAppVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAppVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAppVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListAppVersionsRequest"; + }; + + return ListAppVersionsRequest; + })(); + + v1beta.ListAppVersionsResponse = (function() { + + /** + * Properties of a ListAppVersionsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListAppVersionsResponse + * @property {Array.|null} [appVersions] ListAppVersionsResponse appVersions + * @property {string|null} [nextPageToken] ListAppVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListAppVersionsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListAppVersionsResponse. + * @implements IListAppVersionsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListAppVersionsResponse=} [properties] Properties to set + */ + function ListAppVersionsResponse(properties) { + this.appVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAppVersionsResponse appVersions. + * @member {Array.} appVersions + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @instance + */ + ListAppVersionsResponse.prototype.appVersions = $util.emptyArray; + + /** + * ListAppVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @instance + */ + ListAppVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAppVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @static + * @param {google.cloud.ces.v1beta.IListAppVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListAppVersionsResponse} ListAppVersionsResponse instance + */ + ListAppVersionsResponse.create = function create(properties) { + return new ListAppVersionsResponse(properties); + }; + + /** + * Encodes the specified ListAppVersionsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @static + * @param {google.cloud.ces.v1beta.IListAppVersionsResponse} message ListAppVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appVersions != null && message.appVersions.length) + for (var i = 0; i < message.appVersions.length; ++i) + $root.google.cloud.ces.v1beta.AppVersion.encode(message.appVersions[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 ListAppVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @static + * @param {google.cloud.ces.v1beta.IListAppVersionsResponse} message ListAppVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAppVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListAppVersionsResponse} ListAppVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppVersionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListAppVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.appVersions && message.appVersions.length)) + message.appVersions = []; + message.appVersions.push($root.google.cloud.ces.v1beta.AppVersion.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAppVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListAppVersionsResponse} ListAppVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAppVersionsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAppVersionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.appVersions != null && message.hasOwnProperty("appVersions")) { + if (!Array.isArray(message.appVersions)) + return "appVersions: array expected"; + for (var i = 0; i < message.appVersions.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AppVersion.verify(message.appVersions[i]); + if (error) + return "appVersions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAppVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListAppVersionsResponse} ListAppVersionsResponse + */ + ListAppVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListAppVersionsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListAppVersionsResponse(); + if (object.appVersions) { + if (!Array.isArray(object.appVersions)) + throw TypeError(".google.cloud.ces.v1beta.ListAppVersionsResponse.appVersions: array expected"); + message.appVersions = []; + for (var i = 0; i < object.appVersions.length; ++i) { + if (typeof object.appVersions[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListAppVersionsResponse.appVersions: object expected"); + message.appVersions[i] = $root.google.cloud.ces.v1beta.AppVersion.fromObject(object.appVersions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAppVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @static + * @param {google.cloud.ces.v1beta.ListAppVersionsResponse} message ListAppVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAppVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.appVersions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.appVersions && message.appVersions.length) { + object.appVersions = []; + for (var j = 0; j < message.appVersions.length; ++j) + object.appVersions[j] = $root.google.cloud.ces.v1beta.AppVersion.toObject(message.appVersions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAppVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAppVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAppVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAppVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListAppVersionsResponse"; + }; + + return ListAppVersionsResponse; + })(); + + v1beta.GetAppVersionRequest = (function() { + + /** + * Properties of a GetAppVersionRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetAppVersionRequest + * @property {string|null} [name] GetAppVersionRequest name + */ + + /** + * Constructs a new GetAppVersionRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetAppVersionRequest. + * @implements IGetAppVersionRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetAppVersionRequest=} [properties] Properties to set + */ + function GetAppVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAppVersionRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @instance + */ + GetAppVersionRequest.prototype.name = ""; + + /** + * Creates a new GetAppVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.IGetAppVersionRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetAppVersionRequest} GetAppVersionRequest instance + */ + GetAppVersionRequest.create = function create(properties) { + return new GetAppVersionRequest(properties); + }; + + /** + * Encodes the specified GetAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetAppVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.IGetAppVersionRequest} message GetAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAppVersionRequest.encode = function encode(message, writer) { + 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 GetAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetAppVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.IGetAppVersionRequest} message GetAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAppVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetAppVersionRequest} GetAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAppVersionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetAppVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAppVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetAppVersionRequest} GetAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAppVersionRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAppVersionRequest.verify = function verify(message) { + if (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 GetAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetAppVersionRequest} GetAppVersionRequest + */ + GetAppVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetAppVersionRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetAppVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAppVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.GetAppVersionRequest} message GetAppVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAppVersionRequest.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 GetAppVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetAppVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAppVersionRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetAppVersionRequest"; + }; + + return GetAppVersionRequest; + })(); + + v1beta.DeleteAppVersionRequest = (function() { + + /** + * Properties of a DeleteAppVersionRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteAppVersionRequest + * @property {string|null} [name] DeleteAppVersionRequest name + * @property {string|null} [etag] DeleteAppVersionRequest etag + */ + + /** + * Constructs a new DeleteAppVersionRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteAppVersionRequest. + * @implements IDeleteAppVersionRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteAppVersionRequest=} [properties] Properties to set + */ + function DeleteAppVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAppVersionRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @instance + */ + DeleteAppVersionRequest.prototype.name = ""; + + /** + * DeleteAppVersionRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @instance + */ + DeleteAppVersionRequest.prototype.etag = ""; + + /** + * Creates a new DeleteAppVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteAppVersionRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteAppVersionRequest} DeleteAppVersionRequest instance + */ + DeleteAppVersionRequest.create = function create(properties) { + return new DeleteAppVersionRequest(properties); + }; + + /** + * Encodes the specified DeleteAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteAppVersionRequest} message DeleteAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAppVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteAppVersionRequest} message DeleteAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAppVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteAppVersionRequest} DeleteAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAppVersionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteAppVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAppVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteAppVersionRequest} DeleteAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAppVersionRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAppVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteAppVersionRequest} DeleteAppVersionRequest + */ + DeleteAppVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteAppVersionRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteAppVersionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteAppVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteAppVersionRequest} message DeleteAppVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAppVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteAppVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAppVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAppVersionRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteAppVersionRequest"; + }; + + return DeleteAppVersionRequest; + })(); + + v1beta.CreateAppVersionRequest = (function() { + + /** + * Properties of a CreateAppVersionRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateAppVersionRequest + * @property {string|null} [parent] CreateAppVersionRequest parent + * @property {string|null} [appVersionId] CreateAppVersionRequest appVersionId + * @property {google.cloud.ces.v1beta.IAppVersion|null} [appVersion] CreateAppVersionRequest appVersion + */ + + /** + * Constructs a new CreateAppVersionRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateAppVersionRequest. + * @implements ICreateAppVersionRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateAppVersionRequest=} [properties] Properties to set + */ + function CreateAppVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAppVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @instance + */ + CreateAppVersionRequest.prototype.parent = ""; + + /** + * CreateAppVersionRequest appVersionId. + * @member {string} appVersionId + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @instance + */ + CreateAppVersionRequest.prototype.appVersionId = ""; + + /** + * CreateAppVersionRequest appVersion. + * @member {google.cloud.ces.v1beta.IAppVersion|null|undefined} appVersion + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @instance + */ + CreateAppVersionRequest.prototype.appVersion = null; + + /** + * Creates a new CreateAppVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateAppVersionRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateAppVersionRequest} CreateAppVersionRequest instance + */ + CreateAppVersionRequest.create = function create(properties) { + return new CreateAppVersionRequest(properties); + }; + + /** + * Encodes the specified CreateAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateAppVersionRequest} message CreateAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAppVersionRequest.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.appVersionId != null && Object.hasOwnProperty.call(message, "appVersionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appVersionId); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + $root.google.cloud.ces.v1beta.AppVersion.encode(message.appVersion, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateAppVersionRequest} message CreateAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAppVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateAppVersionRequest} CreateAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAppVersionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateAppVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.appVersionId = reader.string(); + break; + } + case 3: { + message.appVersion = $root.google.cloud.ces.v1beta.AppVersion.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAppVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateAppVersionRequest} CreateAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAppVersionRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAppVersionRequest.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.appVersionId != null && message.hasOwnProperty("appVersionId")) + if (!$util.isString(message.appVersionId)) + return "appVersionId: string expected"; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) { + var error = $root.google.cloud.ces.v1beta.AppVersion.verify(message.appVersion); + if (error) + return "appVersion." + error; + } + return null; + }; + + /** + * Creates a CreateAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateAppVersionRequest} CreateAppVersionRequest + */ + CreateAppVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateAppVersionRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateAppVersionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.appVersionId != null) + message.appVersionId = String(object.appVersionId); + if (object.appVersion != null) { + if (typeof object.appVersion !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateAppVersionRequest.appVersion: object expected"); + message.appVersion = $root.google.cloud.ces.v1beta.AppVersion.fromObject(object.appVersion); + } + return message; + }; + + /** + * Creates a plain object from a CreateAppVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.CreateAppVersionRequest} message CreateAppVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAppVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.appVersionId = ""; + object.appVersion = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.appVersionId != null && message.hasOwnProperty("appVersionId")) + object.appVersionId = message.appVersionId; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + object.appVersion = $root.google.cloud.ces.v1beta.AppVersion.toObject(message.appVersion, options); + return object; + }; + + /** + * Converts this CreateAppVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAppVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAppVersionRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateAppVersionRequest"; + }; + + return CreateAppVersionRequest; + })(); + + v1beta.RestoreAppVersionRequest = (function() { + + /** + * Properties of a RestoreAppVersionRequest. + * @memberof google.cloud.ces.v1beta + * @interface IRestoreAppVersionRequest + * @property {string|null} [name] RestoreAppVersionRequest name + */ + + /** + * Constructs a new RestoreAppVersionRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RestoreAppVersionRequest. + * @implements IRestoreAppVersionRequest + * @constructor + * @param {google.cloud.ces.v1beta.IRestoreAppVersionRequest=} [properties] Properties to set + */ + function RestoreAppVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreAppVersionRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @instance + */ + RestoreAppVersionRequest.prototype.name = ""; + + /** + * Creates a new RestoreAppVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.IRestoreAppVersionRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RestoreAppVersionRequest} RestoreAppVersionRequest instance + */ + RestoreAppVersionRequest.create = function create(properties) { + return new RestoreAppVersionRequest(properties); + }; + + /** + * Encodes the specified RestoreAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.IRestoreAppVersionRequest} message RestoreAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreAppVersionRequest.encode = function encode(message, writer) { + 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 RestoreAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.IRestoreAppVersionRequest} message RestoreAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreAppVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RestoreAppVersionRequest} RestoreAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreAppVersionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RestoreAppVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreAppVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RestoreAppVersionRequest} RestoreAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreAppVersionRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreAppVersionRequest.verify = function verify(message) { + if (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 RestoreAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RestoreAppVersionRequest} RestoreAppVersionRequest + */ + RestoreAppVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RestoreAppVersionRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.RestoreAppVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RestoreAppVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.RestoreAppVersionRequest} message RestoreAppVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreAppVersionRequest.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 RestoreAppVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreAppVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreAppVersionRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RestoreAppVersionRequest"; + }; + + return RestoreAppVersionRequest; + })(); + + v1beta.RestoreAppVersionResponse = (function() { + + /** + * Properties of a RestoreAppVersionResponse. + * @memberof google.cloud.ces.v1beta + * @interface IRestoreAppVersionResponse + */ + + /** + * Constructs a new RestoreAppVersionResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RestoreAppVersionResponse. + * @implements IRestoreAppVersionResponse + * @constructor + * @param {google.cloud.ces.v1beta.IRestoreAppVersionResponse=} [properties] Properties to set + */ + function RestoreAppVersionResponse(properties) { + if (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 RestoreAppVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @static + * @param {google.cloud.ces.v1beta.IRestoreAppVersionResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RestoreAppVersionResponse} RestoreAppVersionResponse instance + */ + RestoreAppVersionResponse.create = function create(properties) { + return new RestoreAppVersionResponse(properties); + }; + + /** + * Encodes the specified RestoreAppVersionResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @static + * @param {google.cloud.ces.v1beta.IRestoreAppVersionResponse} message RestoreAppVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreAppVersionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RestoreAppVersionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @static + * @param {google.cloud.ces.v1beta.IRestoreAppVersionResponse} message RestoreAppVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreAppVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreAppVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RestoreAppVersionResponse} RestoreAppVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreAppVersionResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RestoreAppVersionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreAppVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RestoreAppVersionResponse} RestoreAppVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreAppVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreAppVersionResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreAppVersionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RestoreAppVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RestoreAppVersionResponse} RestoreAppVersionResponse + */ + RestoreAppVersionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RestoreAppVersionResponse) + return object; + return new $root.google.cloud.ces.v1beta.RestoreAppVersionResponse(); + }; + + /** + * Creates a plain object from a RestoreAppVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @static + * @param {google.cloud.ces.v1beta.RestoreAppVersionResponse} message RestoreAppVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreAppVersionResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RestoreAppVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @instance + * @returns {Object.} JSON object + */ + RestoreAppVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreAppVersionResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreAppVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RestoreAppVersionResponse"; + }; + + return RestoreAppVersionResponse; + })(); + + v1beta.GenerateAppResourceResponse = (function() { + + /** + * Properties of a GenerateAppResourceResponse. + * @memberof google.cloud.ces.v1beta + * @interface IGenerateAppResourceResponse + * @property {google.cloud.ces.v1beta.IAgent|null} [agent] GenerateAppResourceResponse agent + * @property {google.cloud.ces.v1beta.IToolset|null} [toolset] GenerateAppResourceResponse toolset + * @property {google.cloud.ces.v1beta.IAppSnapshot|null} [appSnapshot] GenerateAppResourceResponse appSnapshot + * @property {google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools|null} [tools] GenerateAppResourceResponse tools + * @property {google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations|null} [evaluations] GenerateAppResourceResponse evaluations + * @property {google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources|null} [appResources] GenerateAppResourceResponse appResources + * @property {google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo|null} [generateResultInfo] GenerateAppResourceResponse generateResultInfo + */ + + /** + * Constructs a new GenerateAppResourceResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GenerateAppResourceResponse. + * @implements IGenerateAppResourceResponse + * @constructor + * @param {google.cloud.ces.v1beta.IGenerateAppResourceResponse=} [properties] Properties to set + */ + function GenerateAppResourceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateAppResourceResponse agent. + * @member {google.cloud.ces.v1beta.IAgent|null|undefined} agent + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @instance + */ + GenerateAppResourceResponse.prototype.agent = null; + + /** + * GenerateAppResourceResponse toolset. + * @member {google.cloud.ces.v1beta.IToolset|null|undefined} toolset + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @instance + */ + GenerateAppResourceResponse.prototype.toolset = null; + + /** + * GenerateAppResourceResponse appSnapshot. + * @member {google.cloud.ces.v1beta.IAppSnapshot|null|undefined} appSnapshot + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @instance + */ + GenerateAppResourceResponse.prototype.appSnapshot = null; + + /** + * GenerateAppResourceResponse tools. + * @member {google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools|null|undefined} tools + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @instance + */ + GenerateAppResourceResponse.prototype.tools = null; + + /** + * GenerateAppResourceResponse evaluations. + * @member {google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations|null|undefined} evaluations + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @instance + */ + GenerateAppResourceResponse.prototype.evaluations = null; + + /** + * GenerateAppResourceResponse appResources. + * @member {google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources|null|undefined} appResources + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @instance + */ + GenerateAppResourceResponse.prototype.appResources = null; + + /** + * GenerateAppResourceResponse generateResultInfo. + * @member {google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo|null|undefined} generateResultInfo + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @instance + */ + GenerateAppResourceResponse.prototype.generateResultInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GenerateAppResourceResponse generatedResource. + * @member {"agent"|"toolset"|"appSnapshot"|"tools"|"evaluations"|"appResources"|undefined} generatedResource + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @instance + */ + Object.defineProperty(GenerateAppResourceResponse.prototype, "generatedResource", { + get: $util.oneOfGetter($oneOfFields = ["agent", "toolset", "appSnapshot", "tools", "evaluations", "appResources"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenerateAppResourceResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @static + * @param {google.cloud.ces.v1beta.IGenerateAppResourceResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse} GenerateAppResourceResponse instance + */ + GenerateAppResourceResponse.create = function create(properties) { + return new GenerateAppResourceResponse(properties); + }; + + /** + * Encodes the specified GenerateAppResourceResponse message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @static + * @param {google.cloud.ces.v1beta.IGenerateAppResourceResponse} message GenerateAppResourceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAppResourceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + $root.google.cloud.ces.v1beta.Agent.encode(message.agent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.generateResultInfo != null && Object.hasOwnProperty.call(message, "generateResultInfo")) + $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.encode(message.generateResultInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + $root.google.cloud.ces.v1beta.Toolset.encode(message.toolset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.appSnapshot != null && Object.hasOwnProperty.call(message, "appSnapshot")) + $root.google.cloud.ces.v1beta.AppSnapshot.encode(message.appSnapshot, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.tools != null && Object.hasOwnProperty.call(message, "tools")) + $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.encode(message.tools, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.evaluations != null && Object.hasOwnProperty.call(message, "evaluations")) + $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.encode(message.evaluations, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.appResources != null && Object.hasOwnProperty.call(message, "appResources")) + $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.encode(message.appResources, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateAppResourceResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @static + * @param {google.cloud.ces.v1beta.IGenerateAppResourceResponse} message GenerateAppResourceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAppResourceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateAppResourceResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse} GenerateAppResourceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAppResourceResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.agent = $root.google.cloud.ces.v1beta.Agent.decode(reader, reader.uint32()); + break; + } + case 3: { + message.toolset = $root.google.cloud.ces.v1beta.Toolset.decode(reader, reader.uint32()); + break; + } + case 4: { + message.appSnapshot = $root.google.cloud.ces.v1beta.AppSnapshot.decode(reader, reader.uint32()); + break; + } + case 5: { + message.tools = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.decode(reader, reader.uint32()); + break; + } + case 6: { + message.evaluations = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.decode(reader, reader.uint32()); + break; + } + case 7: { + message.appResources = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.decode(reader, reader.uint32()); + break; + } + case 2: { + message.generateResultInfo = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateAppResourceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse} GenerateAppResourceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAppResourceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateAppResourceResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateAppResourceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.agent != null && message.hasOwnProperty("agent")) { + properties.generatedResource = 1; + { + var error = $root.google.cloud.ces.v1beta.Agent.verify(message.agent); + if (error) + return "agent." + error; + } + } + if (message.toolset != null && message.hasOwnProperty("toolset")) { + if (properties.generatedResource === 1) + return "generatedResource: multiple values"; + properties.generatedResource = 1; + { + var error = $root.google.cloud.ces.v1beta.Toolset.verify(message.toolset); + if (error) + return "toolset." + error; + } + } + if (message.appSnapshot != null && message.hasOwnProperty("appSnapshot")) { + if (properties.generatedResource === 1) + return "generatedResource: multiple values"; + properties.generatedResource = 1; + { + var error = $root.google.cloud.ces.v1beta.AppSnapshot.verify(message.appSnapshot); + if (error) + return "appSnapshot." + error; + } + } + if (message.tools != null && message.hasOwnProperty("tools")) { + if (properties.generatedResource === 1) + return "generatedResource: multiple values"; + properties.generatedResource = 1; + { + var error = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.verify(message.tools); + if (error) + return "tools." + error; + } + } + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (properties.generatedResource === 1) + return "generatedResource: multiple values"; + properties.generatedResource = 1; + { + var error = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.verify(message.evaluations); + if (error) + return "evaluations." + error; + } + } + if (message.appResources != null && message.hasOwnProperty("appResources")) { + if (properties.generatedResource === 1) + return "generatedResource: multiple values"; + properties.generatedResource = 1; + { + var error = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.verify(message.appResources); + if (error) + return "appResources." + error; + } + } + if (message.generateResultInfo != null && message.hasOwnProperty("generateResultInfo")) { + var error = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.verify(message.generateResultInfo); + if (error) + return "generateResultInfo." + error; + } + return null; + }; + + /** + * Creates a GenerateAppResourceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse} GenerateAppResourceResponse + */ + GenerateAppResourceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse(); + if (object.agent != null) { + if (typeof object.agent !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.agent: object expected"); + message.agent = $root.google.cloud.ces.v1beta.Agent.fromObject(object.agent); + } + if (object.toolset != null) { + if (typeof object.toolset !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.toolset: object expected"); + message.toolset = $root.google.cloud.ces.v1beta.Toolset.fromObject(object.toolset); + } + if (object.appSnapshot != null) { + if (typeof object.appSnapshot !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.appSnapshot: object expected"); + message.appSnapshot = $root.google.cloud.ces.v1beta.AppSnapshot.fromObject(object.appSnapshot); + } + if (object.tools != null) { + if (typeof object.tools !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.tools: object expected"); + message.tools = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.fromObject(object.tools); + } + if (object.evaluations != null) { + if (typeof object.evaluations !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.evaluations: object expected"); + message.evaluations = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.fromObject(object.evaluations); + } + if (object.appResources != null) { + if (typeof object.appResources !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.appResources: object expected"); + message.appResources = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.fromObject(object.appResources); + } + if (object.generateResultInfo != null) { + if (typeof object.generateResultInfo !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.generateResultInfo: object expected"); + message.generateResultInfo = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.fromObject(object.generateResultInfo); + } + return message; + }; + + /** + * Creates a plain object from a GenerateAppResourceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse} message GenerateAppResourceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateAppResourceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.generateResultInfo = null; + if (message.agent != null && message.hasOwnProperty("agent")) { + object.agent = $root.google.cloud.ces.v1beta.Agent.toObject(message.agent, options); + if (options.oneofs) + object.generatedResource = "agent"; + } + if (message.generateResultInfo != null && message.hasOwnProperty("generateResultInfo")) + object.generateResultInfo = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.toObject(message.generateResultInfo, options); + if (message.toolset != null && message.hasOwnProperty("toolset")) { + object.toolset = $root.google.cloud.ces.v1beta.Toolset.toObject(message.toolset, options); + if (options.oneofs) + object.generatedResource = "toolset"; + } + if (message.appSnapshot != null && message.hasOwnProperty("appSnapshot")) { + object.appSnapshot = $root.google.cloud.ces.v1beta.AppSnapshot.toObject(message.appSnapshot, options); + if (options.oneofs) + object.generatedResource = "appSnapshot"; + } + if (message.tools != null && message.hasOwnProperty("tools")) { + object.tools = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.toObject(message.tools, options); + if (options.oneofs) + object.generatedResource = "tools"; + } + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + object.evaluations = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.toObject(message.evaluations, options); + if (options.oneofs) + object.generatedResource = "evaluations"; + } + if (message.appResources != null && message.hasOwnProperty("appResources")) { + object.appResources = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.toObject(message.appResources, options); + if (options.oneofs) + object.generatedResource = "appResources"; + } + return object; + }; + + /** + * Converts this GenerateAppResourceResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateAppResourceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateAppResourceResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateAppResourceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceResponse"; + }; + + GenerateAppResourceResponse.Evaluations = (function() { + + /** + * Properties of an Evaluations. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @interface IEvaluations + * @property {Array.|null} [evaluations] Evaluations evaluations + */ + + /** + * Constructs a new Evaluations. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @classdesc Represents an Evaluations. + * @implements IEvaluations + * @constructor + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations=} [properties] Properties to set + */ + function Evaluations(properties) { + this.evaluations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Evaluations evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @instance + */ + Evaluations.prototype.evaluations = $util.emptyArray; + + /** + * Creates a new Evaluations instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations} Evaluations instance + */ + Evaluations.create = function create(properties) { + return new Evaluations(properties); + }; + + /** + * Encodes the specified Evaluations message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations} message Evaluations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evaluations.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + $root.google.cloud.ces.v1beta.Evaluation.encode(message.evaluations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Evaluations message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations} message Evaluations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evaluations.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Evaluations message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations} Evaluations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evaluations.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push($root.google.cloud.ces.v1beta.Evaluation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Evaluations message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations} Evaluations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evaluations.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Evaluations message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Evaluations.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Evaluation.verify(message.evaluations[i]); + if (error) + return "evaluations." + error; + } + } + return null; + }; + + /** + * Creates an Evaluations message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations} Evaluations + */ + Evaluations.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations(); + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) { + if (typeof object.evaluations[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.evaluations: object expected"); + message.evaluations[i] = $root.google.cloud.ces.v1beta.Evaluation.fromObject(object.evaluations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Evaluations message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations} message Evaluations + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Evaluations.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluations = []; + if (message.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = $root.google.cloud.ces.v1beta.Evaluation.toObject(message.evaluations[j], options); + } + return object; + }; + + /** + * Converts this Evaluations to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @instance + * @returns {Object.} JSON object + */ + Evaluations.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Evaluations + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Evaluations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations"; + }; + + return Evaluations; + })(); + + GenerateAppResourceResponse.Tools = (function() { + + /** + * Properties of a Tools. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @interface ITools + * @property {Array.|null} [tools] Tools tools + */ + + /** + * Constructs a new Tools. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @classdesc Represents a Tools. + * @implements ITools + * @constructor + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools=} [properties] Properties to set + */ + function Tools(properties) { + this.tools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tools tools. + * @member {Array.} tools + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @instance + */ + Tools.prototype.tools = $util.emptyArray; + + /** + * Creates a new Tools instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools} Tools instance + */ + Tools.create = function create(properties) { + return new Tools(properties); + }; + + /** + * Encodes the specified Tools message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools} message Tools message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tools.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + $root.google.cloud.ces.v1beta.Tool.encode(message.tools[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Tools message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools} message Tools message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tools.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tools message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools} Tools + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tools.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push($root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tools message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools} Tools + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tools.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tools message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tools.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tools != null && message.hasOwnProperty("tools")) { + if (!Array.isArray(message.tools)) + return "tools: array expected"; + for (var i = 0; i < message.tools.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tools[i]); + if (error) + return "tools." + error; + } + } + return null; + }; + + /** + * Creates a Tools message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools} Tools + */ + Tools.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools(); + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) { + if (typeof object.tools[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.tools: object expected"); + message.tools[i] = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tools[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Tools message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools} message Tools + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tools.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tools = []; + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = $root.google.cloud.ces.v1beta.Tool.toObject(message.tools[j], options); + } + return object; + }; + + /** + * Converts this Tools to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @instance + * @returns {Object.} JSON object + */ + Tools.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Tools + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Tools.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools"; + }; + + return Tools; + })(); + + GenerateAppResourceResponse.AppResources = (function() { + + /** + * Properties of an AppResources. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @interface IAppResources + * @property {google.cloud.ces.v1beta.IAppSnapshot|null} [appSnapshot] AppResources appSnapshot + * @property {Array.|null} [evaluations] AppResources evaluations + */ + + /** + * Constructs a new AppResources. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @classdesc Represents an AppResources. + * @implements IAppResources + * @constructor + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources=} [properties] Properties to set + */ + function AppResources(properties) { + this.evaluations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppResources appSnapshot. + * @member {google.cloud.ces.v1beta.IAppSnapshot|null|undefined} appSnapshot + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @instance + */ + AppResources.prototype.appSnapshot = null; + + /** + * AppResources evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @instance + */ + AppResources.prototype.evaluations = $util.emptyArray; + + /** + * Creates a new AppResources instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources} AppResources instance + */ + AppResources.create = function create(properties) { + return new AppResources(properties); + }; + + /** + * Encodes the specified AppResources message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources} message AppResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appSnapshot != null && Object.hasOwnProperty.call(message, "appSnapshot")) + $root.google.cloud.ces.v1beta.AppSnapshot.encode(message.appSnapshot, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + $root.google.cloud.ces.v1beta.Evaluation.encode(message.evaluations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AppResources message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources} message AppResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppResources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources} AppResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppResources.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.appSnapshot = $root.google.cloud.ces.v1beta.AppSnapshot.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push($root.google.cloud.ces.v1beta.Evaluation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AppResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources} AppResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppResources message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppResources.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.appSnapshot != null && message.hasOwnProperty("appSnapshot")) { + var error = $root.google.cloud.ces.v1beta.AppSnapshot.verify(message.appSnapshot); + if (error) + return "appSnapshot." + error; + } + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Evaluation.verify(message.evaluations[i]); + if (error) + return "evaluations." + error; + } + } + return null; + }; + + /** + * Creates an AppResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources} AppResources + */ + AppResources.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources(); + if (object.appSnapshot != null) { + if (typeof object.appSnapshot !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.appSnapshot: object expected"); + message.appSnapshot = $root.google.cloud.ces.v1beta.AppSnapshot.fromObject(object.appSnapshot); + } + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) { + if (typeof object.evaluations[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.evaluations: object expected"); + message.evaluations[i] = $root.google.cloud.ces.v1beta.Evaluation.fromObject(object.evaluations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AppResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources} message AppResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppResources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluations = []; + if (options.defaults) + object.appSnapshot = null; + if (message.appSnapshot != null && message.hasOwnProperty("appSnapshot")) + object.appSnapshot = $root.google.cloud.ces.v1beta.AppSnapshot.toObject(message.appSnapshot, options); + if (message.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = $root.google.cloud.ces.v1beta.Evaluation.toObject(message.evaluations[j], options); + } + return object; + }; + + /** + * Converts this AppResources to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @instance + * @returns {Object.} JSON object + */ + AppResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AppResources + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources"; + }; + + return AppResources; + })(); + + GenerateAppResourceResponse.GenerateResultInfo = (function() { + + /** + * Properties of a GenerateResultInfo. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @interface IGenerateResultInfo + * @property {string|null} [explanation] GenerateResultInfo explanation + */ + + /** + * Constructs a new GenerateResultInfo. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @classdesc Represents a GenerateResultInfo. + * @implements IGenerateResultInfo + * @constructor + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo=} [properties] Properties to set + */ + function GenerateResultInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateResultInfo explanation. + * @member {string} explanation + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @instance + */ + GenerateResultInfo.prototype.explanation = ""; + + /** + * Creates a new GenerateResultInfo instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo} GenerateResultInfo instance + */ + GenerateResultInfo.create = function create(properties) { + return new GenerateResultInfo(properties); + }; + + /** + * Encodes the specified GenerateResultInfo message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo} message GenerateResultInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateResultInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.explanation); + return writer; + }; + + /** + * Encodes the specified GenerateResultInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo} message GenerateResultInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateResultInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateResultInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo} GenerateResultInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateResultInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.explanation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateResultInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo} GenerateResultInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateResultInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateResultInfo message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateResultInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.explanation != null && message.hasOwnProperty("explanation")) + if (!$util.isString(message.explanation)) + return "explanation: string expected"; + return null; + }; + + /** + * Creates a GenerateResultInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo} GenerateResultInfo + */ + GenerateResultInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo(); + if (object.explanation != null) + message.explanation = String(object.explanation); + return message; + }; + + /** + * Creates a plain object from a GenerateResultInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo} message GenerateResultInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateResultInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.explanation = ""; + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = message.explanation; + return object; + }; + + /** + * Converts this GenerateResultInfo to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @instance + * @returns {Object.} JSON object + */ + GenerateResultInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateResultInfo + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateResultInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo"; + }; + + return GenerateResultInfo; + })(); + + return GenerateAppResourceResponse; + })(); + + v1beta.ListChangelogsRequest = (function() { + + /** + * Properties of a ListChangelogsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListChangelogsRequest + * @property {string|null} [parent] ListChangelogsRequest parent + * @property {number|null} [pageSize] ListChangelogsRequest pageSize + * @property {string|null} [pageToken] ListChangelogsRequest pageToken + * @property {string|null} [filter] ListChangelogsRequest filter + * @property {string|null} [orderBy] ListChangelogsRequest orderBy + */ + + /** + * Constructs a new ListChangelogsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListChangelogsRequest. + * @implements IListChangelogsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListChangelogsRequest=} [properties] Properties to set + */ + function ListChangelogsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChangelogsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.parent = ""; + + /** + * ListChangelogsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.pageSize = 0; + + /** + * ListChangelogsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.pageToken = ""; + + /** + * ListChangelogsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.filter = ""; + + /** + * ListChangelogsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListChangelogsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @static + * @param {google.cloud.ces.v1beta.IListChangelogsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListChangelogsRequest} ListChangelogsRequest instance + */ + ListChangelogsRequest.create = function create(properties) { + return new ListChangelogsRequest(properties); + }; + + /** + * Encodes the specified ListChangelogsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @static + * @param {google.cloud.ces.v1beta.IListChangelogsRequest} message ListChangelogsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsRequest.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 ListChangelogsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @static + * @param {google.cloud.ces.v1beta.IListChangelogsRequest} message ListChangelogsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListChangelogsRequest} ListChangelogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListChangelogsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListChangelogsRequest} ListChangelogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChangelogsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChangelogsRequest.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 ListChangelogsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListChangelogsRequest} ListChangelogsRequest + */ + ListChangelogsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListChangelogsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListChangelogsRequest(); + 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 ListChangelogsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @static + * @param {google.cloud.ces.v1beta.ListChangelogsRequest} message ListChangelogsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChangelogsRequest.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 ListChangelogsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @instance + * @returns {Object.} JSON object + */ + ListChangelogsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChangelogsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChangelogsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListChangelogsRequest"; + }; + + return ListChangelogsRequest; + })(); + + v1beta.ListChangelogsResponse = (function() { + + /** + * Properties of a ListChangelogsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListChangelogsResponse + * @property {Array.|null} [changelogs] ListChangelogsResponse changelogs + * @property {string|null} [nextPageToken] ListChangelogsResponse nextPageToken + */ + + /** + * Constructs a new ListChangelogsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListChangelogsResponse. + * @implements IListChangelogsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListChangelogsResponse=} [properties] Properties to set + */ + function ListChangelogsResponse(properties) { + this.changelogs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChangelogsResponse changelogs. + * @member {Array.} changelogs + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @instance + */ + ListChangelogsResponse.prototype.changelogs = $util.emptyArray; + + /** + * ListChangelogsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @instance + */ + ListChangelogsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListChangelogsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @static + * @param {google.cloud.ces.v1beta.IListChangelogsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListChangelogsResponse} ListChangelogsResponse instance + */ + ListChangelogsResponse.create = function create(properties) { + return new ListChangelogsResponse(properties); + }; + + /** + * Encodes the specified ListChangelogsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @static + * @param {google.cloud.ces.v1beta.IListChangelogsResponse} message ListChangelogsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.changelogs != null && message.changelogs.length) + for (var i = 0; i < message.changelogs.length; ++i) + $root.google.cloud.ces.v1beta.Changelog.encode(message.changelogs[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 ListChangelogsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @static + * @param {google.cloud.ces.v1beta.IListChangelogsResponse} message ListChangelogsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListChangelogsResponse} ListChangelogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListChangelogsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.changelogs && message.changelogs.length)) + message.changelogs = []; + message.changelogs.push($root.google.cloud.ces.v1beta.Changelog.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListChangelogsResponse} ListChangelogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChangelogsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChangelogsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.changelogs != null && message.hasOwnProperty("changelogs")) { + if (!Array.isArray(message.changelogs)) + return "changelogs: array expected"; + for (var i = 0; i < message.changelogs.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Changelog.verify(message.changelogs[i]); + if (error) + return "changelogs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListChangelogsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListChangelogsResponse} ListChangelogsResponse + */ + ListChangelogsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListChangelogsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListChangelogsResponse(); + if (object.changelogs) { + if (!Array.isArray(object.changelogs)) + throw TypeError(".google.cloud.ces.v1beta.ListChangelogsResponse.changelogs: array expected"); + message.changelogs = []; + for (var i = 0; i < object.changelogs.length; ++i) { + if (typeof object.changelogs[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListChangelogsResponse.changelogs: object expected"); + message.changelogs[i] = $root.google.cloud.ces.v1beta.Changelog.fromObject(object.changelogs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListChangelogsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @static + * @param {google.cloud.ces.v1beta.ListChangelogsResponse} message ListChangelogsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChangelogsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.changelogs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.changelogs && message.changelogs.length) { + object.changelogs = []; + for (var j = 0; j < message.changelogs.length; ++j) + object.changelogs[j] = $root.google.cloud.ces.v1beta.Changelog.toObject(message.changelogs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListChangelogsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @instance + * @returns {Object.} JSON object + */ + ListChangelogsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChangelogsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChangelogsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListChangelogsResponse"; + }; + + return ListChangelogsResponse; + })(); + + v1beta.GetChangelogRequest = (function() { + + /** + * Properties of a GetChangelogRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetChangelogRequest + * @property {string|null} [name] GetChangelogRequest name + */ + + /** + * Constructs a new GetChangelogRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetChangelogRequest. + * @implements IGetChangelogRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetChangelogRequest=} [properties] Properties to set + */ + function GetChangelogRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetChangelogRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @instance + */ + GetChangelogRequest.prototype.name = ""; + + /** + * Creates a new GetChangelogRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @static + * @param {google.cloud.ces.v1beta.IGetChangelogRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetChangelogRequest} GetChangelogRequest instance + */ + GetChangelogRequest.create = function create(properties) { + return new GetChangelogRequest(properties); + }; + + /** + * Encodes the specified GetChangelogRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetChangelogRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @static + * @param {google.cloud.ces.v1beta.IGetChangelogRequest} message GetChangelogRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetChangelogRequest.encode = function encode(message, writer) { + 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 GetChangelogRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetChangelogRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @static + * @param {google.cloud.ces.v1beta.IGetChangelogRequest} message GetChangelogRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetChangelogRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetChangelogRequest} GetChangelogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetChangelogRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetChangelogRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetChangelogRequest} GetChangelogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetChangelogRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetChangelogRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetChangelogRequest.verify = function verify(message) { + if (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 GetChangelogRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetChangelogRequest} GetChangelogRequest + */ + GetChangelogRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetChangelogRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetChangelogRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetChangelogRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @static + * @param {google.cloud.ces.v1beta.GetChangelogRequest} message GetChangelogRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetChangelogRequest.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 GetChangelogRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @instance + * @returns {Object.} JSON object + */ + GetChangelogRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetChangelogRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetChangelogRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetChangelogRequest"; + }; + + return GetChangelogRequest; + })(); + + v1beta.App = (function() { + + /** + * Properties of an App. + * @memberof google.cloud.ces.v1beta + * @interface IApp + * @property {string|null} [name] App name + * @property {string|null} [displayName] App displayName + * @property {string|null} [description] App description + * @property {boolean|null} [pinned] App pinned + * @property {string|null} [rootAgent] App rootAgent + * @property {google.cloud.ces.v1beta.ILanguageSettings|null} [languageSettings] App languageSettings + * @property {google.cloud.ces.v1beta.ITimeZoneSettings|null} [timeZoneSettings] App timeZoneSettings + * @property {google.cloud.ces.v1beta.IAudioProcessingConfig|null} [audioProcessingConfig] App audioProcessingConfig + * @property {google.cloud.ces.v1beta.ILoggingSettings|null} [loggingSettings] App loggingSettings + * @property {google.cloud.ces.v1beta.IErrorHandlingSettings|null} [errorHandlingSettings] App errorHandlingSettings + * @property {google.cloud.ces.v1beta.IModelSettings|null} [modelSettings] App modelSettings + * @property {google.cloud.ces.v1beta.App.ToolExecutionMode|null} [toolExecutionMode] App toolExecutionMode + * @property {google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null} [evaluationMetricsThresholds] App evaluationMetricsThresholds + * @property {Array.|null} [variableDeclarations] App variableDeclarations + * @property {Array.|null} [predefinedVariableDeclarations] App predefinedVariableDeclarations + * @property {string|null} [globalInstruction] App globalInstruction + * @property {Array.|null} [guardrails] App guardrails + * @property {google.cloud.ces.v1beta.IDataStoreSettings|null} [dataStoreSettings] App dataStoreSettings + * @property {google.cloud.ces.v1beta.IChannelProfile|null} [defaultChannelProfile] App defaultChannelProfile + * @property {Object.|null} [metadata] App metadata + * @property {google.protobuf.ITimestamp|null} [createTime] App createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] App updateTime + * @property {string|null} [etag] App etag + * @property {number|null} [deploymentCount] App deploymentCount + * @property {google.cloud.ces.v1beta.IClientCertificateSettings|null} [clientCertificateSettings] App clientCertificateSettings + * @property {boolean|null} [locked] App locked + * @property {Array.|null} [evaluationPersonas] App evaluationPersonas + * @property {google.cloud.ces.v1beta.IEvaluationSettings|null} [evaluationSettings] App evaluationSettings + */ + + /** + * Constructs a new App. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an App. + * @implements IApp + * @constructor + * @param {google.cloud.ces.v1beta.IApp=} [properties] Properties to set + */ + function App(properties) { + this.variableDeclarations = []; + this.predefinedVariableDeclarations = []; + this.guardrails = []; + this.metadata = {}; + this.evaluationPersonas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * App name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.name = ""; + + /** + * App displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.displayName = ""; + + /** + * App description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.description = ""; + + /** + * App pinned. + * @member {boolean} pinned + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.pinned = false; + + /** + * App rootAgent. + * @member {string} rootAgent + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.rootAgent = ""; + + /** + * App languageSettings. + * @member {google.cloud.ces.v1beta.ILanguageSettings|null|undefined} languageSettings + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.languageSettings = null; + + /** + * App timeZoneSettings. + * @member {google.cloud.ces.v1beta.ITimeZoneSettings|null|undefined} timeZoneSettings + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.timeZoneSettings = null; + + /** + * App audioProcessingConfig. + * @member {google.cloud.ces.v1beta.IAudioProcessingConfig|null|undefined} audioProcessingConfig + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.audioProcessingConfig = null; + + /** + * App loggingSettings. + * @member {google.cloud.ces.v1beta.ILoggingSettings|null|undefined} loggingSettings + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.loggingSettings = null; + + /** + * App errorHandlingSettings. + * @member {google.cloud.ces.v1beta.IErrorHandlingSettings|null|undefined} errorHandlingSettings + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.errorHandlingSettings = null; + + /** + * App modelSettings. + * @member {google.cloud.ces.v1beta.IModelSettings|null|undefined} modelSettings + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.modelSettings = null; + + /** + * App toolExecutionMode. + * @member {google.cloud.ces.v1beta.App.ToolExecutionMode} toolExecutionMode + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.toolExecutionMode = 0; + + /** + * App evaluationMetricsThresholds. + * @member {google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null|undefined} evaluationMetricsThresholds + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.evaluationMetricsThresholds = null; + + /** + * App variableDeclarations. + * @member {Array.} variableDeclarations + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.variableDeclarations = $util.emptyArray; + + /** + * App predefinedVariableDeclarations. + * @member {Array.} predefinedVariableDeclarations + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.predefinedVariableDeclarations = $util.emptyArray; + + /** + * App globalInstruction. + * @member {string} globalInstruction + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.globalInstruction = ""; + + /** + * App guardrails. + * @member {Array.} guardrails + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.guardrails = $util.emptyArray; + + /** + * App dataStoreSettings. + * @member {google.cloud.ces.v1beta.IDataStoreSettings|null|undefined} dataStoreSettings + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.dataStoreSettings = null; + + /** + * App defaultChannelProfile. + * @member {google.cloud.ces.v1beta.IChannelProfile|null|undefined} defaultChannelProfile + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.defaultChannelProfile = null; + + /** + * App metadata. + * @member {Object.} metadata + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.metadata = $util.emptyObject; + + /** + * App createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.createTime = null; + + /** + * App updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.updateTime = null; + + /** + * App etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.etag = ""; + + /** + * App deploymentCount. + * @member {number} deploymentCount + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.deploymentCount = 0; + + /** + * App clientCertificateSettings. + * @member {google.cloud.ces.v1beta.IClientCertificateSettings|null|undefined} clientCertificateSettings + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.clientCertificateSettings = null; + + /** + * App locked. + * @member {boolean} locked + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.locked = false; + + /** + * App evaluationPersonas. + * @member {Array.} evaluationPersonas + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.evaluationPersonas = $util.emptyArray; + + /** + * App evaluationSettings. + * @member {google.cloud.ces.v1beta.IEvaluationSettings|null|undefined} evaluationSettings + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.evaluationSettings = null; + + /** + * Creates a new App instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.App + * @static + * @param {google.cloud.ces.v1beta.IApp=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.App} App instance + */ + App.create = function create(properties) { + return new App(properties); + }; + + /** + * Encodes the specified App message. Does not implicitly {@link google.cloud.ces.v1beta.App.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.App + * @static + * @param {google.cloud.ces.v1beta.IApp} message App message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + App.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.rootAgent != null && Object.hasOwnProperty.call(message, "rootAgent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.rootAgent); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.audioProcessingConfig != null && Object.hasOwnProperty.call(message, "audioProcessingConfig")) + $root.google.cloud.ces.v1beta.AudioProcessingConfig.encode(message.audioProcessingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.loggingSettings != null && Object.hasOwnProperty.call(message, "loggingSettings")) + $root.google.cloud.ces.v1beta.LoggingSettings.encode(message.loggingSettings, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.guardrails != null && message.guardrails.length) + for (var i = 0; i < message.guardrails.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.guardrails[i]); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.etag); + if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) + $root.google.cloud.ces.v1beta.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.variableDeclarations != null && message.variableDeclarations.length) + for (var i = 0; i < message.variableDeclarations.length; ++i) + $root.google.cloud.ces.v1beta.App.VariableDeclaration.encode(message.variableDeclarations[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.dataStoreSettings != null && Object.hasOwnProperty.call(message, "dataStoreSettings")) + $root.google.cloud.ces.v1beta.DataStoreSettings.encode(message.dataStoreSettings, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.globalInstruction != null && Object.hasOwnProperty.call(message, "globalInstruction")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.globalInstruction); + if (message.languageSettings != null && Object.hasOwnProperty.call(message, "languageSettings")) + $root.google.cloud.ces.v1beta.LanguageSettings.encode(message.languageSettings, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.defaultChannelProfile != null && Object.hasOwnProperty.call(message, "defaultChannelProfile")) + $root.google.cloud.ces.v1beta.ChannelProfile.encode(message.defaultChannelProfile, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.deploymentCount != null && Object.hasOwnProperty.call(message, "deploymentCount")) + writer.uint32(/* id 23, wireType 0 =*/184).int32(message.deploymentCount); + if (message.evaluationMetricsThresholds != null && Object.hasOwnProperty.call(message, "evaluationMetricsThresholds")) + $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.encode(message.evaluationMetricsThresholds, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.clientCertificateSettings != null && Object.hasOwnProperty.call(message, "clientCertificateSettings")) + $root.google.cloud.ces.v1beta.ClientCertificateSettings.encode(message.clientCertificateSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.timeZoneSettings != null && Object.hasOwnProperty.call(message, "timeZoneSettings")) + $root.google.cloud.ces.v1beta.TimeZoneSettings.encode(message.timeZoneSettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.predefinedVariableDeclarations != null && message.predefinedVariableDeclarations.length) + for (var i = 0; i < message.predefinedVariableDeclarations.length; ++i) + $root.google.cloud.ces.v1beta.App.VariableDeclaration.encode(message.predefinedVariableDeclarations[i], writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) + writer.uint32(/* id 29, wireType 0 =*/232).bool(message.locked); + if (message.evaluationPersonas != null && message.evaluationPersonas.length) + for (var i = 0; i < message.evaluationPersonas.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationPersona.encode(message.evaluationPersonas[i], writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.pinned != null && Object.hasOwnProperty.call(message, "pinned")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.pinned); + if (message.toolExecutionMode != null && Object.hasOwnProperty.call(message, "toolExecutionMode")) + writer.uint32(/* id 32, wireType 0 =*/256).int32(message.toolExecutionMode); + if (message.evaluationSettings != null && Object.hasOwnProperty.call(message, "evaluationSettings")) + $root.google.cloud.ces.v1beta.EvaluationSettings.encode(message.evaluationSettings, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.errorHandlingSettings != null && Object.hasOwnProperty.call(message, "errorHandlingSettings")) + $root.google.cloud.ces.v1beta.ErrorHandlingSettings.encode(message.errorHandlingSettings, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified App message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.App.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.App + * @static + * @param {google.cloud.ces.v1beta.IApp} message App message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + App.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an App message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.App + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.App} App + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + App.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.App(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 31: { + message.pinned = reader.bool(); + break; + } + case 4: { + message.rootAgent = reader.string(); + break; + } + case 18: { + message.languageSettings = $root.google.cloud.ces.v1beta.LanguageSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.timeZoneSettings = $root.google.cloud.ces.v1beta.TimeZoneSettings.decode(reader, reader.uint32()); + break; + } + case 7: { + message.audioProcessingConfig = $root.google.cloud.ces.v1beta.AudioProcessingConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.loggingSettings = $root.google.cloud.ces.v1beta.LoggingSettings.decode(reader, reader.uint32()); + break; + } + case 34: { + message.errorHandlingSettings = $root.google.cloud.ces.v1beta.ErrorHandlingSettings.decode(reader, reader.uint32()); + break; + } + case 13: { + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.decode(reader, reader.uint32()); + break; + } + case 32: { + message.toolExecutionMode = reader.int32(); + break; + } + case 24: { + message.evaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.decode(reader, reader.uint32()); + break; + } + case 14: { + if (!(message.variableDeclarations && message.variableDeclarations.length)) + message.variableDeclarations = []; + message.variableDeclarations.push($root.google.cloud.ces.v1beta.App.VariableDeclaration.decode(reader, reader.uint32())); + break; + } + case 28: { + if (!(message.predefinedVariableDeclarations && message.predefinedVariableDeclarations.length)) + message.predefinedVariableDeclarations = []; + message.predefinedVariableDeclarations.push($root.google.cloud.ces.v1beta.App.VariableDeclaration.decode(reader, reader.uint32())); + break; + } + case 17: { + message.globalInstruction = reader.string(); + break; + } + case 10: { + if (!(message.guardrails && message.guardrails.length)) + message.guardrails = []; + message.guardrails.push(reader.string()); + break; + } + case 15: { + message.dataStoreSettings = $root.google.cloud.ces.v1beta.DataStoreSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.defaultChannelProfile = $root.google.cloud.ces.v1beta.ChannelProfile.decode(reader, reader.uint32()); + break; + } + case 11: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + 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.metadata[key] = value; + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.etag = reader.string(); + break; + } + case 23: { + message.deploymentCount = reader.int32(); + break; + } + case 25: { + message.clientCertificateSettings = $root.google.cloud.ces.v1beta.ClientCertificateSettings.decode(reader, reader.uint32()); + break; + } + case 29: { + message.locked = reader.bool(); + break; + } + case 30: { + if (!(message.evaluationPersonas && message.evaluationPersonas.length)) + message.evaluationPersonas = []; + message.evaluationPersonas.push($root.google.cloud.ces.v1beta.EvaluationPersona.decode(reader, reader.uint32())); + break; + } + case 33: { + message.evaluationSettings = $root.google.cloud.ces.v1beta.EvaluationSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an App message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.App + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.App} App + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + App.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an App message. + * @function verify + * @memberof google.cloud.ces.v1beta.App + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + App.verify = function verify(message) { + if (typeof message !== "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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.pinned != null && message.hasOwnProperty("pinned")) + if (typeof message.pinned !== "boolean") + return "pinned: boolean expected"; + if (message.rootAgent != null && message.hasOwnProperty("rootAgent")) + if (!$util.isString(message.rootAgent)) + return "rootAgent: string expected"; + if (message.languageSettings != null && message.hasOwnProperty("languageSettings")) { + var error = $root.google.cloud.ces.v1beta.LanguageSettings.verify(message.languageSettings); + if (error) + return "languageSettings." + error; + } + if (message.timeZoneSettings != null && message.hasOwnProperty("timeZoneSettings")) { + var error = $root.google.cloud.ces.v1beta.TimeZoneSettings.verify(message.timeZoneSettings); + if (error) + return "timeZoneSettings." + error; + } + if (message.audioProcessingConfig != null && message.hasOwnProperty("audioProcessingConfig")) { + var error = $root.google.cloud.ces.v1beta.AudioProcessingConfig.verify(message.audioProcessingConfig); + if (error) + return "audioProcessingConfig." + error; + } + if (message.loggingSettings != null && message.hasOwnProperty("loggingSettings")) { + var error = $root.google.cloud.ces.v1beta.LoggingSettings.verify(message.loggingSettings); + if (error) + return "loggingSettings." + error; + } + if (message.errorHandlingSettings != null && message.hasOwnProperty("errorHandlingSettings")) { + var error = $root.google.cloud.ces.v1beta.ErrorHandlingSettings.verify(message.errorHandlingSettings); + if (error) + return "errorHandlingSettings." + error; + } + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { + var error = $root.google.cloud.ces.v1beta.ModelSettings.verify(message.modelSettings); + if (error) + return "modelSettings." + error; + } + if (message.toolExecutionMode != null && message.hasOwnProperty("toolExecutionMode")) + switch (message.toolExecutionMode) { + default: + return "toolExecutionMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.evaluationMetricsThresholds != null && message.hasOwnProperty("evaluationMetricsThresholds")) { + var error = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.verify(message.evaluationMetricsThresholds); + if (error) + return "evaluationMetricsThresholds." + error; + } + if (message.variableDeclarations != null && message.hasOwnProperty("variableDeclarations")) { + if (!Array.isArray(message.variableDeclarations)) + return "variableDeclarations: array expected"; + for (var i = 0; i < message.variableDeclarations.length; ++i) { + var error = $root.google.cloud.ces.v1beta.App.VariableDeclaration.verify(message.variableDeclarations[i]); + if (error) + return "variableDeclarations." + error; + } + } + if (message.predefinedVariableDeclarations != null && message.hasOwnProperty("predefinedVariableDeclarations")) { + if (!Array.isArray(message.predefinedVariableDeclarations)) + return "predefinedVariableDeclarations: array expected"; + for (var i = 0; i < message.predefinedVariableDeclarations.length; ++i) { + var error = $root.google.cloud.ces.v1beta.App.VariableDeclaration.verify(message.predefinedVariableDeclarations[i]); + if (error) + return "predefinedVariableDeclarations." + error; + } + } + if (message.globalInstruction != null && message.hasOwnProperty("globalInstruction")) + if (!$util.isString(message.globalInstruction)) + return "globalInstruction: string expected"; + if (message.guardrails != null && message.hasOwnProperty("guardrails")) { + if (!Array.isArray(message.guardrails)) + return "guardrails: array expected"; + for (var i = 0; i < message.guardrails.length; ++i) + if (!$util.isString(message.guardrails[i])) + return "guardrails: string[] expected"; + } + if (message.dataStoreSettings != null && message.hasOwnProperty("dataStoreSettings")) { + var error = $root.google.cloud.ces.v1beta.DataStoreSettings.verify(message.dataStoreSettings); + if (error) + return "dataStoreSettings." + error; + } + if (message.defaultChannelProfile != null && message.hasOwnProperty("defaultChannelProfile")) { + var error = $root.google.cloud.ces.v1beta.ChannelProfile.verify(message.defaultChannelProfile); + if (error) + return "defaultChannelProfile." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k: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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.deploymentCount != null && message.hasOwnProperty("deploymentCount")) + if (!$util.isInteger(message.deploymentCount)) + return "deploymentCount: integer expected"; + if (message.clientCertificateSettings != null && message.hasOwnProperty("clientCertificateSettings")) { + var error = $root.google.cloud.ces.v1beta.ClientCertificateSettings.verify(message.clientCertificateSettings); + if (error) + return "clientCertificateSettings." + error; + } + if (message.locked != null && message.hasOwnProperty("locked")) + if (typeof message.locked !== "boolean") + return "locked: boolean expected"; + if (message.evaluationPersonas != null && message.hasOwnProperty("evaluationPersonas")) { + if (!Array.isArray(message.evaluationPersonas)) + return "evaluationPersonas: array expected"; + for (var i = 0; i < message.evaluationPersonas.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationPersona.verify(message.evaluationPersonas[i]); + if (error) + return "evaluationPersonas." + error; + } + } + if (message.evaluationSettings != null && message.hasOwnProperty("evaluationSettings")) { + var error = $root.google.cloud.ces.v1beta.EvaluationSettings.verify(message.evaluationSettings); + if (error) + return "evaluationSettings." + error; + } + return null; + }; + + /** + * Creates an App message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.App + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.App} App + */ + App.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.App) + return object; + var message = new $root.google.cloud.ces.v1beta.App(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.pinned != null) + message.pinned = Boolean(object.pinned); + if (object.rootAgent != null) + message.rootAgent = String(object.rootAgent); + if (object.languageSettings != null) { + if (typeof object.languageSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.languageSettings: object expected"); + message.languageSettings = $root.google.cloud.ces.v1beta.LanguageSettings.fromObject(object.languageSettings); + } + if (object.timeZoneSettings != null) { + if (typeof object.timeZoneSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.timeZoneSettings: object expected"); + message.timeZoneSettings = $root.google.cloud.ces.v1beta.TimeZoneSettings.fromObject(object.timeZoneSettings); + } + if (object.audioProcessingConfig != null) { + if (typeof object.audioProcessingConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.audioProcessingConfig: object expected"); + message.audioProcessingConfig = $root.google.cloud.ces.v1beta.AudioProcessingConfig.fromObject(object.audioProcessingConfig); + } + if (object.loggingSettings != null) { + if (typeof object.loggingSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.loggingSettings: object expected"); + message.loggingSettings = $root.google.cloud.ces.v1beta.LoggingSettings.fromObject(object.loggingSettings); + } + if (object.errorHandlingSettings != null) { + if (typeof object.errorHandlingSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.errorHandlingSettings: object expected"); + message.errorHandlingSettings = $root.google.cloud.ces.v1beta.ErrorHandlingSettings.fromObject(object.errorHandlingSettings); + } + if (object.modelSettings != null) { + if (typeof object.modelSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.modelSettings: object expected"); + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.fromObject(object.modelSettings); + } + switch (object.toolExecutionMode) { + default: + if (typeof object.toolExecutionMode === "number") { + message.toolExecutionMode = object.toolExecutionMode; + break; + } + break; + case "TOOL_EXECUTION_MODE_UNSPECIFIED": + case 0: + message.toolExecutionMode = 0; + break; + case "PARALLEL": + case 1: + message.toolExecutionMode = 1; + break; + case "SEQUENTIAL": + case 2: + message.toolExecutionMode = 2; + break; + } + if (object.evaluationMetricsThresholds != null) { + if (typeof object.evaluationMetricsThresholds !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.evaluationMetricsThresholds: object expected"); + message.evaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.fromObject(object.evaluationMetricsThresholds); + } + if (object.variableDeclarations) { + if (!Array.isArray(object.variableDeclarations)) + throw TypeError(".google.cloud.ces.v1beta.App.variableDeclarations: array expected"); + message.variableDeclarations = []; + for (var i = 0; i < object.variableDeclarations.length; ++i) { + if (typeof object.variableDeclarations[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.variableDeclarations: object expected"); + message.variableDeclarations[i] = $root.google.cloud.ces.v1beta.App.VariableDeclaration.fromObject(object.variableDeclarations[i]); + } + } + if (object.predefinedVariableDeclarations) { + if (!Array.isArray(object.predefinedVariableDeclarations)) + throw TypeError(".google.cloud.ces.v1beta.App.predefinedVariableDeclarations: array expected"); + message.predefinedVariableDeclarations = []; + for (var i = 0; i < object.predefinedVariableDeclarations.length; ++i) { + if (typeof object.predefinedVariableDeclarations[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.predefinedVariableDeclarations: object expected"); + message.predefinedVariableDeclarations[i] = $root.google.cloud.ces.v1beta.App.VariableDeclaration.fromObject(object.predefinedVariableDeclarations[i]); + } + } + if (object.globalInstruction != null) + message.globalInstruction = String(object.globalInstruction); + if (object.guardrails) { + if (!Array.isArray(object.guardrails)) + throw TypeError(".google.cloud.ces.v1beta.App.guardrails: array expected"); + message.guardrails = []; + for (var i = 0; i < object.guardrails.length; ++i) + message.guardrails[i] = String(object.guardrails[i]); + } + if (object.dataStoreSettings != null) { + if (typeof object.dataStoreSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.dataStoreSettings: object expected"); + message.dataStoreSettings = $root.google.cloud.ces.v1beta.DataStoreSettings.fromObject(object.dataStoreSettings); + } + if (object.defaultChannelProfile != null) { + if (typeof object.defaultChannelProfile !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.defaultChannelProfile: object expected"); + message.defaultChannelProfile = $root.google.cloud.ces.v1beta.ChannelProfile.fromObject(object.defaultChannelProfile); + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.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.ces.v1beta.App.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.deploymentCount != null) + message.deploymentCount = object.deploymentCount | 0; + if (object.clientCertificateSettings != null) { + if (typeof object.clientCertificateSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.clientCertificateSettings: object expected"); + message.clientCertificateSettings = $root.google.cloud.ces.v1beta.ClientCertificateSettings.fromObject(object.clientCertificateSettings); + } + if (object.locked != null) + message.locked = Boolean(object.locked); + if (object.evaluationPersonas) { + if (!Array.isArray(object.evaluationPersonas)) + throw TypeError(".google.cloud.ces.v1beta.App.evaluationPersonas: array expected"); + message.evaluationPersonas = []; + for (var i = 0; i < object.evaluationPersonas.length; ++i) { + if (typeof object.evaluationPersonas[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.evaluationPersonas: object expected"); + message.evaluationPersonas[i] = $root.google.cloud.ces.v1beta.EvaluationPersona.fromObject(object.evaluationPersonas[i]); + } + } + if (object.evaluationSettings != null) { + if (typeof object.evaluationSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.evaluationSettings: object expected"); + message.evaluationSettings = $root.google.cloud.ces.v1beta.EvaluationSettings.fromObject(object.evaluationSettings); + } + return message; + }; + + /** + * Creates a plain object from an App message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.App + * @static + * @param {google.cloud.ces.v1beta.App} message App + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + App.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.guardrails = []; + object.variableDeclarations = []; + object.predefinedVariableDeclarations = []; + object.evaluationPersonas = []; + } + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.rootAgent = ""; + object.createTime = null; + object.updateTime = null; + object.audioProcessingConfig = null; + object.loggingSettings = null; + object.etag = ""; + object.modelSettings = null; + object.dataStoreSettings = null; + object.globalInstruction = ""; + object.languageSettings = null; + object.defaultChannelProfile = null; + object.deploymentCount = 0; + object.evaluationMetricsThresholds = null; + object.clientCertificateSettings = null; + object.timeZoneSettings = null; + object.locked = false; + object.pinned = false; + object.toolExecutionMode = options.enums === String ? "TOOL_EXECUTION_MODE_UNSPECIFIED" : 0; + object.evaluationSettings = null; + object.errorHandlingSettings = 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.rootAgent != null && message.hasOwnProperty("rootAgent")) + object.rootAgent = message.rootAgent; + 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.audioProcessingConfig != null && message.hasOwnProperty("audioProcessingConfig")) + object.audioProcessingConfig = $root.google.cloud.ces.v1beta.AudioProcessingConfig.toObject(message.audioProcessingConfig, options); + if (message.loggingSettings != null && message.hasOwnProperty("loggingSettings")) + object.loggingSettings = $root.google.cloud.ces.v1beta.LoggingSettings.toObject(message.loggingSettings, options); + if (message.guardrails && message.guardrails.length) { + object.guardrails = []; + for (var j = 0; j < message.guardrails.length; ++j) + object.guardrails[j] = message.guardrails[j]; + } + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) + object.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.toObject(message.modelSettings, options); + if (message.variableDeclarations && message.variableDeclarations.length) { + object.variableDeclarations = []; + for (var j = 0; j < message.variableDeclarations.length; ++j) + object.variableDeclarations[j] = $root.google.cloud.ces.v1beta.App.VariableDeclaration.toObject(message.variableDeclarations[j], options); + } + if (message.dataStoreSettings != null && message.hasOwnProperty("dataStoreSettings")) + object.dataStoreSettings = $root.google.cloud.ces.v1beta.DataStoreSettings.toObject(message.dataStoreSettings, options); + if (message.globalInstruction != null && message.hasOwnProperty("globalInstruction")) + object.globalInstruction = message.globalInstruction; + if (message.languageSettings != null && message.hasOwnProperty("languageSettings")) + object.languageSettings = $root.google.cloud.ces.v1beta.LanguageSettings.toObject(message.languageSettings, options); + if (message.defaultChannelProfile != null && message.hasOwnProperty("defaultChannelProfile")) + object.defaultChannelProfile = $root.google.cloud.ces.v1beta.ChannelProfile.toObject(message.defaultChannelProfile, options); + if (message.deploymentCount != null && message.hasOwnProperty("deploymentCount")) + object.deploymentCount = message.deploymentCount; + if (message.evaluationMetricsThresholds != null && message.hasOwnProperty("evaluationMetricsThresholds")) + object.evaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.toObject(message.evaluationMetricsThresholds, options); + if (message.clientCertificateSettings != null && message.hasOwnProperty("clientCertificateSettings")) + object.clientCertificateSettings = $root.google.cloud.ces.v1beta.ClientCertificateSettings.toObject(message.clientCertificateSettings, options); + if (message.timeZoneSettings != null && message.hasOwnProperty("timeZoneSettings")) + object.timeZoneSettings = $root.google.cloud.ces.v1beta.TimeZoneSettings.toObject(message.timeZoneSettings, options); + if (message.predefinedVariableDeclarations && message.predefinedVariableDeclarations.length) { + object.predefinedVariableDeclarations = []; + for (var j = 0; j < message.predefinedVariableDeclarations.length; ++j) + object.predefinedVariableDeclarations[j] = $root.google.cloud.ces.v1beta.App.VariableDeclaration.toObject(message.predefinedVariableDeclarations[j], options); + } + if (message.locked != null && message.hasOwnProperty("locked")) + object.locked = message.locked; + if (message.evaluationPersonas && message.evaluationPersonas.length) { + object.evaluationPersonas = []; + for (var j = 0; j < message.evaluationPersonas.length; ++j) + object.evaluationPersonas[j] = $root.google.cloud.ces.v1beta.EvaluationPersona.toObject(message.evaluationPersonas[j], options); + } + if (message.pinned != null && message.hasOwnProperty("pinned")) + object.pinned = message.pinned; + if (message.toolExecutionMode != null && message.hasOwnProperty("toolExecutionMode")) + object.toolExecutionMode = options.enums === String ? $root.google.cloud.ces.v1beta.App.ToolExecutionMode[message.toolExecutionMode] === undefined ? message.toolExecutionMode : $root.google.cloud.ces.v1beta.App.ToolExecutionMode[message.toolExecutionMode] : message.toolExecutionMode; + if (message.evaluationSettings != null && message.hasOwnProperty("evaluationSettings")) + object.evaluationSettings = $root.google.cloud.ces.v1beta.EvaluationSettings.toObject(message.evaluationSettings, options); + if (message.errorHandlingSettings != null && message.hasOwnProperty("errorHandlingSettings")) + object.errorHandlingSettings = $root.google.cloud.ces.v1beta.ErrorHandlingSettings.toObject(message.errorHandlingSettings, options); + return object; + }; + + /** + * Converts this App to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.App + * @instance + * @returns {Object.} JSON object + */ + App.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for App + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.App + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + App.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.App"; + }; + + App.VariableDeclaration = (function() { + + /** + * Properties of a VariableDeclaration. + * @memberof google.cloud.ces.v1beta.App + * @interface IVariableDeclaration + * @property {string|null} [name] VariableDeclaration name + * @property {string|null} [description] VariableDeclaration description + * @property {google.cloud.ces.v1beta.ISchema|null} [schema] VariableDeclaration schema + */ + + /** + * Constructs a new VariableDeclaration. + * @memberof google.cloud.ces.v1beta.App + * @classdesc Represents a VariableDeclaration. + * @implements IVariableDeclaration + * @constructor + * @param {google.cloud.ces.v1beta.App.IVariableDeclaration=} [properties] Properties to set + */ + function VariableDeclaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VariableDeclaration name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @instance + */ + VariableDeclaration.prototype.name = ""; + + /** + * VariableDeclaration description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @instance + */ + VariableDeclaration.prototype.description = ""; + + /** + * VariableDeclaration schema. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} schema + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @instance + */ + VariableDeclaration.prototype.schema = null; + + /** + * Creates a new VariableDeclaration instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @static + * @param {google.cloud.ces.v1beta.App.IVariableDeclaration=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.App.VariableDeclaration} VariableDeclaration instance + */ + VariableDeclaration.create = function create(properties) { + return new VariableDeclaration(properties); + }; + + /** + * Encodes the specified VariableDeclaration message. Does not implicitly {@link google.cloud.ces.v1beta.App.VariableDeclaration.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @static + * @param {google.cloud.ces.v1beta.App.IVariableDeclaration} message VariableDeclaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VariableDeclaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.cloud.ces.v1beta.Schema.encode(message.schema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VariableDeclaration message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.App.VariableDeclaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @static + * @param {google.cloud.ces.v1beta.App.IVariableDeclaration} message VariableDeclaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VariableDeclaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VariableDeclaration message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.App.VariableDeclaration} VariableDeclaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VariableDeclaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.App.VariableDeclaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.schema = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VariableDeclaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.App.VariableDeclaration} VariableDeclaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VariableDeclaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VariableDeclaration message. + * @function verify + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VariableDeclaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.schema != null && message.hasOwnProperty("schema")) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.schema); + if (error) + return "schema." + error; + } + return null; + }; + + /** + * Creates a VariableDeclaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.App.VariableDeclaration} VariableDeclaration + */ + VariableDeclaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.App.VariableDeclaration) + return object; + var message = new $root.google.cloud.ces.v1beta.App.VariableDeclaration(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.VariableDeclaration.schema: object expected"); + message.schema = $root.google.cloud.ces.v1beta.Schema.fromObject(object.schema); + } + return message; + }; + + /** + * Creates a plain object from a VariableDeclaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @static + * @param {google.cloud.ces.v1beta.App.VariableDeclaration} message VariableDeclaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VariableDeclaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.schema = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = $root.google.cloud.ces.v1beta.Schema.toObject(message.schema, options); + return object; + }; + + /** + * Converts this VariableDeclaration to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @instance + * @returns {Object.} JSON object + */ + VariableDeclaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VariableDeclaration + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VariableDeclaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.App.VariableDeclaration"; + }; + + return VariableDeclaration; + })(); + + /** + * ToolExecutionMode enum. + * @name google.cloud.ces.v1beta.App.ToolExecutionMode + * @enum {number} + * @property {number} TOOL_EXECUTION_MODE_UNSPECIFIED=0 TOOL_EXECUTION_MODE_UNSPECIFIED value + * @property {number} PARALLEL=1 PARALLEL value + * @property {number} SEQUENTIAL=2 SEQUENTIAL value + */ + App.ToolExecutionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TOOL_EXECUTION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PARALLEL"] = 1; + values[valuesById[2] = "SEQUENTIAL"] = 2; + return values; + })(); + + return App; + })(); + + v1beta.TimeZoneSettings = (function() { + + /** + * Properties of a TimeZoneSettings. + * @memberof google.cloud.ces.v1beta + * @interface ITimeZoneSettings + * @property {string|null} [timeZone] TimeZoneSettings timeZone + */ + + /** + * Constructs a new TimeZoneSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a TimeZoneSettings. + * @implements ITimeZoneSettings + * @constructor + * @param {google.cloud.ces.v1beta.ITimeZoneSettings=} [properties] Properties to set + */ + function TimeZoneSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeZoneSettings timeZone. + * @member {string} timeZone + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @instance + */ + TimeZoneSettings.prototype.timeZone = ""; + + /** + * Creates a new TimeZoneSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @static + * @param {google.cloud.ces.v1beta.ITimeZoneSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TimeZoneSettings} TimeZoneSettings instance + */ + TimeZoneSettings.create = function create(properties) { + return new TimeZoneSettings(properties); + }; + + /** + * Encodes the specified TimeZoneSettings message. Does not implicitly {@link google.cloud.ces.v1beta.TimeZoneSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @static + * @param {google.cloud.ces.v1beta.ITimeZoneSettings} message TimeZoneSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeZoneSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.timeZone); + return writer; + }; + + /** + * Encodes the specified TimeZoneSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TimeZoneSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @static + * @param {google.cloud.ces.v1beta.ITimeZoneSettings} message TimeZoneSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeZoneSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeZoneSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TimeZoneSettings} TimeZoneSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeZoneSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TimeZoneSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.timeZone = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeZoneSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TimeZoneSettings} TimeZoneSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeZoneSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeZoneSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeZoneSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + return null; + }; + + /** + * Creates a TimeZoneSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TimeZoneSettings} TimeZoneSettings + */ + TimeZoneSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TimeZoneSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.TimeZoneSettings(); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + return message; + }; + + /** + * Creates a plain object from a TimeZoneSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @static + * @param {google.cloud.ces.v1beta.TimeZoneSettings} message TimeZoneSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeZoneSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.timeZone = ""; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + return object; + }; + + /** + * Converts this TimeZoneSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @instance + * @returns {Object.} JSON object + */ + TimeZoneSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeZoneSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeZoneSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TimeZoneSettings"; + }; + + return TimeZoneSettings; + })(); + + v1beta.LanguageSettings = (function() { + + /** + * Properties of a LanguageSettings. + * @memberof google.cloud.ces.v1beta + * @interface ILanguageSettings + * @property {string|null} [defaultLanguageCode] LanguageSettings defaultLanguageCode + * @property {Array.|null} [supportedLanguageCodes] LanguageSettings supportedLanguageCodes + * @property {boolean|null} [enableMultilingualSupport] LanguageSettings enableMultilingualSupport + * @property {string|null} [fallbackAction] LanguageSettings fallbackAction + */ + + /** + * Constructs a new LanguageSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a LanguageSettings. + * @implements ILanguageSettings + * @constructor + * @param {google.cloud.ces.v1beta.ILanguageSettings=} [properties] Properties to set + */ + function LanguageSettings(properties) { + this.supportedLanguageCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LanguageSettings defaultLanguageCode. + * @member {string} defaultLanguageCode + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @instance + */ + LanguageSettings.prototype.defaultLanguageCode = ""; + + /** + * LanguageSettings supportedLanguageCodes. + * @member {Array.} supportedLanguageCodes + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @instance + */ + LanguageSettings.prototype.supportedLanguageCodes = $util.emptyArray; + + /** + * LanguageSettings enableMultilingualSupport. + * @member {boolean} enableMultilingualSupport + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @instance + */ + LanguageSettings.prototype.enableMultilingualSupport = false; + + /** + * LanguageSettings fallbackAction. + * @member {string} fallbackAction + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @instance + */ + LanguageSettings.prototype.fallbackAction = ""; + + /** + * Creates a new LanguageSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @static + * @param {google.cloud.ces.v1beta.ILanguageSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.LanguageSettings} LanguageSettings instance + */ + LanguageSettings.create = function create(properties) { + return new LanguageSettings(properties); + }; + + /** + * Encodes the specified LanguageSettings message. Does not implicitly {@link google.cloud.ces.v1beta.LanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @static + * @param {google.cloud.ces.v1beta.ILanguageSettings} message LanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaultLanguageCode != null && Object.hasOwnProperty.call(message, "defaultLanguageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.defaultLanguageCode); + if (message.supportedLanguageCodes != null && message.supportedLanguageCodes.length) + for (var i = 0; i < message.supportedLanguageCodes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.supportedLanguageCodes[i]); + if (message.enableMultilingualSupport != null && Object.hasOwnProperty.call(message, "enableMultilingualSupport")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableMultilingualSupport); + if (message.fallbackAction != null && Object.hasOwnProperty.call(message, "fallbackAction")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.fallbackAction); + return writer; + }; + + /** + * Encodes the specified LanguageSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @static + * @param {google.cloud.ces.v1beta.ILanguageSettings} message LanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.LanguageSettings} LanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.defaultLanguageCode = reader.string(); + break; + } + case 2: { + if (!(message.supportedLanguageCodes && message.supportedLanguageCodes.length)) + message.supportedLanguageCodes = []; + message.supportedLanguageCodes.push(reader.string()); + break; + } + case 3: { + message.enableMultilingualSupport = reader.bool(); + break; + } + case 4: { + message.fallbackAction = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.LanguageSettings} LanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LanguageSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaultLanguageCode != null && message.hasOwnProperty("defaultLanguageCode")) + if (!$util.isString(message.defaultLanguageCode)) + return "defaultLanguageCode: string expected"; + if (message.supportedLanguageCodes != null && message.hasOwnProperty("supportedLanguageCodes")) { + if (!Array.isArray(message.supportedLanguageCodes)) + return "supportedLanguageCodes: array expected"; + for (var i = 0; i < message.supportedLanguageCodes.length; ++i) + if (!$util.isString(message.supportedLanguageCodes[i])) + return "supportedLanguageCodes: string[] expected"; + } + if (message.enableMultilingualSupport != null && message.hasOwnProperty("enableMultilingualSupport")) + if (typeof message.enableMultilingualSupport !== "boolean") + return "enableMultilingualSupport: boolean expected"; + if (message.fallbackAction != null && message.hasOwnProperty("fallbackAction")) + if (!$util.isString(message.fallbackAction)) + return "fallbackAction: string expected"; + return null; + }; + + /** + * Creates a LanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.LanguageSettings} LanguageSettings + */ + LanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.LanguageSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.LanguageSettings(); + if (object.defaultLanguageCode != null) + message.defaultLanguageCode = String(object.defaultLanguageCode); + if (object.supportedLanguageCodes) { + if (!Array.isArray(object.supportedLanguageCodes)) + throw TypeError(".google.cloud.ces.v1beta.LanguageSettings.supportedLanguageCodes: array expected"); + message.supportedLanguageCodes = []; + for (var i = 0; i < object.supportedLanguageCodes.length; ++i) + message.supportedLanguageCodes[i] = String(object.supportedLanguageCodes[i]); + } + if (object.enableMultilingualSupport != null) + message.enableMultilingualSupport = Boolean(object.enableMultilingualSupport); + if (object.fallbackAction != null) + message.fallbackAction = String(object.fallbackAction); + return message; + }; + + /** + * Creates a plain object from a LanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @static + * @param {google.cloud.ces.v1beta.LanguageSettings} message LanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedLanguageCodes = []; + if (options.defaults) { + object.defaultLanguageCode = ""; + object.enableMultilingualSupport = false; + object.fallbackAction = ""; + } + if (message.defaultLanguageCode != null && message.hasOwnProperty("defaultLanguageCode")) + object.defaultLanguageCode = message.defaultLanguageCode; + if (message.supportedLanguageCodes && message.supportedLanguageCodes.length) { + object.supportedLanguageCodes = []; + for (var j = 0; j < message.supportedLanguageCodes.length; ++j) + object.supportedLanguageCodes[j] = message.supportedLanguageCodes[j]; + } + if (message.enableMultilingualSupport != null && message.hasOwnProperty("enableMultilingualSupport")) + object.enableMultilingualSupport = message.enableMultilingualSupport; + if (message.fallbackAction != null && message.hasOwnProperty("fallbackAction")) + object.fallbackAction = message.fallbackAction; + return object; + }; + + /** + * Converts this LanguageSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @instance + * @returns {Object.} JSON object + */ + LanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LanguageSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.LanguageSettings"; + }; + + return LanguageSettings; + })(); + + v1beta.AudioProcessingConfig = (function() { + + /** + * Properties of an AudioProcessingConfig. + * @memberof google.cloud.ces.v1beta + * @interface IAudioProcessingConfig + * @property {Object.|null} [synthesizeSpeechConfigs] AudioProcessingConfig synthesizeSpeechConfigs + * @property {google.cloud.ces.v1beta.IBargeInConfig|null} [bargeInConfig] AudioProcessingConfig bargeInConfig + * @property {google.protobuf.IDuration|null} [inactivityTimeout] AudioProcessingConfig inactivityTimeout + * @property {google.cloud.ces.v1beta.IAmbientSoundConfig|null} [ambientSoundConfig] AudioProcessingConfig ambientSoundConfig + */ + + /** + * Constructs a new AudioProcessingConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an AudioProcessingConfig. + * @implements IAudioProcessingConfig + * @constructor + * @param {google.cloud.ces.v1beta.IAudioProcessingConfig=} [properties] Properties to set + */ + function AudioProcessingConfig(properties) { + this.synthesizeSpeechConfigs = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AudioProcessingConfig synthesizeSpeechConfigs. + * @member {Object.} synthesizeSpeechConfigs + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @instance + */ + AudioProcessingConfig.prototype.synthesizeSpeechConfigs = $util.emptyObject; + + /** + * AudioProcessingConfig bargeInConfig. + * @member {google.cloud.ces.v1beta.IBargeInConfig|null|undefined} bargeInConfig + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @instance + */ + AudioProcessingConfig.prototype.bargeInConfig = null; + + /** + * AudioProcessingConfig inactivityTimeout. + * @member {google.protobuf.IDuration|null|undefined} inactivityTimeout + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @instance + */ + AudioProcessingConfig.prototype.inactivityTimeout = null; + + /** + * AudioProcessingConfig ambientSoundConfig. + * @member {google.cloud.ces.v1beta.IAmbientSoundConfig|null|undefined} ambientSoundConfig + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @instance + */ + AudioProcessingConfig.prototype.ambientSoundConfig = null; + + /** + * Creates a new AudioProcessingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @static + * @param {google.cloud.ces.v1beta.IAudioProcessingConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AudioProcessingConfig} AudioProcessingConfig instance + */ + AudioProcessingConfig.create = function create(properties) { + return new AudioProcessingConfig(properties); + }; + + /** + * Encodes the specified AudioProcessingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.AudioProcessingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @static + * @param {google.cloud.ces.v1beta.IAudioProcessingConfig} message AudioProcessingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioProcessingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.synthesizeSpeechConfigs != null && Object.hasOwnProperty.call(message, "synthesizeSpeechConfigs")) + for (var keys = Object.keys(message.synthesizeSpeechConfigs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig.encode(message.synthesizeSpeechConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.bargeInConfig != null && Object.hasOwnProperty.call(message, "bargeInConfig")) + $root.google.cloud.ces.v1beta.BargeInConfig.encode(message.bargeInConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.inactivityTimeout != null && Object.hasOwnProperty.call(message, "inactivityTimeout")) + $root.google.protobuf.Duration.encode(message.inactivityTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ambientSoundConfig != null && Object.hasOwnProperty.call(message, "ambientSoundConfig")) + $root.google.cloud.ces.v1beta.AmbientSoundConfig.encode(message.ambientSoundConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AudioProcessingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AudioProcessingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @static + * @param {google.cloud.ces.v1beta.IAudioProcessingConfig} message AudioProcessingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioProcessingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AudioProcessingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AudioProcessingConfig} AudioProcessingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioProcessingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AudioProcessingConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.synthesizeSpeechConfigs === $util.emptyObject) + message.synthesizeSpeechConfigs = {}; + 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.ces.v1beta.SynthesizeSpeechConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.synthesizeSpeechConfigs[key] = value; + break; + } + case 3: { + message.bargeInConfig = $root.google.cloud.ces.v1beta.BargeInConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.inactivityTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.ambientSoundConfig = $root.google.cloud.ces.v1beta.AmbientSoundConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AudioProcessingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AudioProcessingConfig} AudioProcessingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioProcessingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AudioProcessingConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AudioProcessingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.synthesizeSpeechConfigs != null && message.hasOwnProperty("synthesizeSpeechConfigs")) { + if (!$util.isObject(message.synthesizeSpeechConfigs)) + return "synthesizeSpeechConfigs: object expected"; + var key = Object.keys(message.synthesizeSpeechConfigs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig.verify(message.synthesizeSpeechConfigs[key[i]]); + if (error) + return "synthesizeSpeechConfigs." + error; + } + } + if (message.bargeInConfig != null && message.hasOwnProperty("bargeInConfig")) { + var error = $root.google.cloud.ces.v1beta.BargeInConfig.verify(message.bargeInConfig); + if (error) + return "bargeInConfig." + error; + } + if (message.inactivityTimeout != null && message.hasOwnProperty("inactivityTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.inactivityTimeout); + if (error) + return "inactivityTimeout." + error; + } + if (message.ambientSoundConfig != null && message.hasOwnProperty("ambientSoundConfig")) { + var error = $root.google.cloud.ces.v1beta.AmbientSoundConfig.verify(message.ambientSoundConfig); + if (error) + return "ambientSoundConfig." + error; + } + return null; + }; + + /** + * Creates an AudioProcessingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AudioProcessingConfig} AudioProcessingConfig + */ + AudioProcessingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AudioProcessingConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.AudioProcessingConfig(); + if (object.synthesizeSpeechConfigs) { + if (typeof object.synthesizeSpeechConfigs !== "object") + throw TypeError(".google.cloud.ces.v1beta.AudioProcessingConfig.synthesizeSpeechConfigs: object expected"); + message.synthesizeSpeechConfigs = {}; + for (var keys = Object.keys(object.synthesizeSpeechConfigs), i = 0; i < keys.length; ++i) { + if (typeof object.synthesizeSpeechConfigs[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AudioProcessingConfig.synthesizeSpeechConfigs: object expected"); + message.synthesizeSpeechConfigs[keys[i]] = $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig.fromObject(object.synthesizeSpeechConfigs[keys[i]]); + } + } + if (object.bargeInConfig != null) { + if (typeof object.bargeInConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.AudioProcessingConfig.bargeInConfig: object expected"); + message.bargeInConfig = $root.google.cloud.ces.v1beta.BargeInConfig.fromObject(object.bargeInConfig); + } + if (object.inactivityTimeout != null) { + if (typeof object.inactivityTimeout !== "object") + throw TypeError(".google.cloud.ces.v1beta.AudioProcessingConfig.inactivityTimeout: object expected"); + message.inactivityTimeout = $root.google.protobuf.Duration.fromObject(object.inactivityTimeout); + } + if (object.ambientSoundConfig != null) { + if (typeof object.ambientSoundConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.AudioProcessingConfig.ambientSoundConfig: object expected"); + message.ambientSoundConfig = $root.google.cloud.ces.v1beta.AmbientSoundConfig.fromObject(object.ambientSoundConfig); + } + return message; + }; + + /** + * Creates a plain object from an AudioProcessingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @static + * @param {google.cloud.ces.v1beta.AudioProcessingConfig} message AudioProcessingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AudioProcessingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.synthesizeSpeechConfigs = {}; + if (options.defaults) { + object.bargeInConfig = null; + object.inactivityTimeout = null; + object.ambientSoundConfig = null; + } + var keys2; + if (message.synthesizeSpeechConfigs && (keys2 = Object.keys(message.synthesizeSpeechConfigs)).length) { + object.synthesizeSpeechConfigs = {}; + for (var j = 0; j < keys2.length; ++j) + object.synthesizeSpeechConfigs[keys2[j]] = $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig.toObject(message.synthesizeSpeechConfigs[keys2[j]], options); + } + if (message.bargeInConfig != null && message.hasOwnProperty("bargeInConfig")) + object.bargeInConfig = $root.google.cloud.ces.v1beta.BargeInConfig.toObject(message.bargeInConfig, options); + if (message.inactivityTimeout != null && message.hasOwnProperty("inactivityTimeout")) + object.inactivityTimeout = $root.google.protobuf.Duration.toObject(message.inactivityTimeout, options); + if (message.ambientSoundConfig != null && message.hasOwnProperty("ambientSoundConfig")) + object.ambientSoundConfig = $root.google.cloud.ces.v1beta.AmbientSoundConfig.toObject(message.ambientSoundConfig, options); + return object; + }; + + /** + * Converts this AudioProcessingConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @instance + * @returns {Object.} JSON object + */ + AudioProcessingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AudioProcessingConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AudioProcessingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AudioProcessingConfig"; + }; + + return AudioProcessingConfig; + })(); + + v1beta.AmbientSoundConfig = (function() { + + /** + * Properties of an AmbientSoundConfig. + * @memberof google.cloud.ces.v1beta + * @interface IAmbientSoundConfig + * @property {google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise|null} [prebuiltAmbientNoise] AmbientSoundConfig prebuiltAmbientNoise + * @property {string|null} [gcsUri] AmbientSoundConfig gcsUri + * @property {string|null} [prebuiltAmbientSound] AmbientSoundConfig prebuiltAmbientSound + * @property {number|null} [volumeGainDb] AmbientSoundConfig volumeGainDb + */ + + /** + * Constructs a new AmbientSoundConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an AmbientSoundConfig. + * @implements IAmbientSoundConfig + * @constructor + * @param {google.cloud.ces.v1beta.IAmbientSoundConfig=} [properties] Properties to set + */ + function AmbientSoundConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AmbientSoundConfig prebuiltAmbientNoise. + * @member {google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise|null|undefined} prebuiltAmbientNoise + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @instance + */ + AmbientSoundConfig.prototype.prebuiltAmbientNoise = null; + + /** + * AmbientSoundConfig gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @instance + */ + AmbientSoundConfig.prototype.gcsUri = null; + + /** + * AmbientSoundConfig prebuiltAmbientSound. + * @member {string|null|undefined} prebuiltAmbientSound + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @instance + */ + AmbientSoundConfig.prototype.prebuiltAmbientSound = null; + + /** + * AmbientSoundConfig volumeGainDb. + * @member {number} volumeGainDb + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @instance + */ + AmbientSoundConfig.prototype.volumeGainDb = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AmbientSoundConfig source. + * @member {"prebuiltAmbientNoise"|"gcsUri"|"prebuiltAmbientSound"|undefined} source + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @instance + */ + Object.defineProperty(AmbientSoundConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["prebuiltAmbientNoise", "gcsUri", "prebuiltAmbientSound"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AmbientSoundConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @static + * @param {google.cloud.ces.v1beta.IAmbientSoundConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AmbientSoundConfig} AmbientSoundConfig instance + */ + AmbientSoundConfig.create = function create(properties) { + return new AmbientSoundConfig(properties); + }; + + /** + * Encodes the specified AmbientSoundConfig message. Does not implicitly {@link google.cloud.ces.v1beta.AmbientSoundConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @static + * @param {google.cloud.ces.v1beta.IAmbientSoundConfig} message AmbientSoundConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AmbientSoundConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prebuiltAmbientNoise != null && Object.hasOwnProperty.call(message, "prebuiltAmbientNoise")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.prebuiltAmbientNoise); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsUri); + if (message.volumeGainDb != null && Object.hasOwnProperty.call(message, "volumeGainDb")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.volumeGainDb); + if (message.prebuiltAmbientSound != null && Object.hasOwnProperty.call(message, "prebuiltAmbientSound")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.prebuiltAmbientSound); + return writer; + }; + + /** + * Encodes the specified AmbientSoundConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AmbientSoundConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @static + * @param {google.cloud.ces.v1beta.IAmbientSoundConfig} message AmbientSoundConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AmbientSoundConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AmbientSoundConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AmbientSoundConfig} AmbientSoundConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AmbientSoundConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AmbientSoundConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.prebuiltAmbientNoise = reader.int32(); + break; + } + case 2: { + message.gcsUri = reader.string(); + break; + } + case 4: { + message.prebuiltAmbientSound = reader.string(); + break; + } + case 3: { + message.volumeGainDb = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AmbientSoundConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AmbientSoundConfig} AmbientSoundConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AmbientSoundConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AmbientSoundConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AmbientSoundConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.prebuiltAmbientNoise != null && message.hasOwnProperty("prebuiltAmbientNoise")) { + properties.source = 1; + switch (message.prebuiltAmbientNoise) { + default: + return "prebuiltAmbientNoise: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + if (message.prebuiltAmbientSound != null && message.hasOwnProperty("prebuiltAmbientSound")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.prebuiltAmbientSound)) + return "prebuiltAmbientSound: string expected"; + } + if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) + if (typeof message.volumeGainDb !== "number") + return "volumeGainDb: number expected"; + return null; + }; + + /** + * Creates an AmbientSoundConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AmbientSoundConfig} AmbientSoundConfig + */ + AmbientSoundConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AmbientSoundConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.AmbientSoundConfig(); + switch (object.prebuiltAmbientNoise) { + default: + if (typeof object.prebuiltAmbientNoise === "number") { + message.prebuiltAmbientNoise = object.prebuiltAmbientNoise; + break; + } + break; + case "PREBUILT_AMBIENT_NOISE_UNSPECIFIED": + case 0: + message.prebuiltAmbientNoise = 0; + break; + case "RETAIL_STORE": + case 1: + message.prebuiltAmbientNoise = 1; + break; + case "CONVENTION_HALL": + case 2: + message.prebuiltAmbientNoise = 2; + break; + case "OUTDOOR": + case 3: + message.prebuiltAmbientNoise = 3; + break; + } + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.prebuiltAmbientSound != null) + message.prebuiltAmbientSound = String(object.prebuiltAmbientSound); + if (object.volumeGainDb != null) + message.volumeGainDb = Number(object.volumeGainDb); + return message; + }; + + /** + * Creates a plain object from an AmbientSoundConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @static + * @param {google.cloud.ces.v1beta.AmbientSoundConfig} message AmbientSoundConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AmbientSoundConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.volumeGainDb = 0; + if (message.prebuiltAmbientNoise != null && message.hasOwnProperty("prebuiltAmbientNoise")) { + object.prebuiltAmbientNoise = options.enums === String ? $root.google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise[message.prebuiltAmbientNoise] === undefined ? message.prebuiltAmbientNoise : $root.google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise[message.prebuiltAmbientNoise] : message.prebuiltAmbientNoise; + if (options.oneofs) + object.source = "prebuiltAmbientNoise"; + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.source = "gcsUri"; + } + if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) + object.volumeGainDb = options.json && !isFinite(message.volumeGainDb) ? String(message.volumeGainDb) : message.volumeGainDb; + if (message.prebuiltAmbientSound != null && message.hasOwnProperty("prebuiltAmbientSound")) { + object.prebuiltAmbientSound = message.prebuiltAmbientSound; + if (options.oneofs) + object.source = "prebuiltAmbientSound"; + } + return object; + }; + + /** + * Converts this AmbientSoundConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @instance + * @returns {Object.} JSON object + */ + AmbientSoundConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AmbientSoundConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AmbientSoundConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AmbientSoundConfig"; + }; + + /** + * PrebuiltAmbientNoise enum. + * @name google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise + * @enum {number} + * @property {number} PREBUILT_AMBIENT_NOISE_UNSPECIFIED=0 PREBUILT_AMBIENT_NOISE_UNSPECIFIED value + * @property {number} RETAIL_STORE=1 RETAIL_STORE value + * @property {number} CONVENTION_HALL=2 CONVENTION_HALL value + * @property {number} OUTDOOR=3 OUTDOOR value + */ + AmbientSoundConfig.PrebuiltAmbientNoise = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PREBUILT_AMBIENT_NOISE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RETAIL_STORE"] = 1; + values[valuesById[2] = "CONVENTION_HALL"] = 2; + values[valuesById[3] = "OUTDOOR"] = 3; + return values; + })(); + + return AmbientSoundConfig; + })(); + + v1beta.BargeInConfig = (function() { + + /** + * Properties of a BargeInConfig. + * @memberof google.cloud.ces.v1beta + * @interface IBargeInConfig + * @property {boolean|null} [disableBargeIn] BargeInConfig disableBargeIn + * @property {boolean|null} [bargeInAwareness] BargeInConfig bargeInAwareness + */ + + /** + * Constructs a new BargeInConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a BargeInConfig. + * @implements IBargeInConfig + * @constructor + * @param {google.cloud.ces.v1beta.IBargeInConfig=} [properties] Properties to set + */ + function BargeInConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BargeInConfig disableBargeIn. + * @member {boolean} disableBargeIn + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @instance + */ + BargeInConfig.prototype.disableBargeIn = false; + + /** + * BargeInConfig bargeInAwareness. + * @member {boolean} bargeInAwareness + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @instance + */ + BargeInConfig.prototype.bargeInAwareness = false; + + /** + * Creates a new BargeInConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @static + * @param {google.cloud.ces.v1beta.IBargeInConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.BargeInConfig} BargeInConfig instance + */ + BargeInConfig.create = function create(properties) { + return new BargeInConfig(properties); + }; + + /** + * Encodes the specified BargeInConfig message. Does not implicitly {@link google.cloud.ces.v1beta.BargeInConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @static + * @param {google.cloud.ces.v1beta.IBargeInConfig} message BargeInConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BargeInConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disableBargeIn != null && Object.hasOwnProperty.call(message, "disableBargeIn")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.disableBargeIn); + if (message.bargeInAwareness != null && Object.hasOwnProperty.call(message, "bargeInAwareness")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.bargeInAwareness); + return writer; + }; + + /** + * Encodes the specified BargeInConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BargeInConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @static + * @param {google.cloud.ces.v1beta.IBargeInConfig} message BargeInConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BargeInConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.BargeInConfig} BargeInConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BargeInConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BargeInConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.disableBargeIn = reader.bool(); + break; + } + case 2: { + message.bargeInAwareness = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.BargeInConfig} BargeInConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BargeInConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BargeInConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BargeInConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disableBargeIn != null && message.hasOwnProperty("disableBargeIn")) + if (typeof message.disableBargeIn !== "boolean") + return "disableBargeIn: boolean expected"; + if (message.bargeInAwareness != null && message.hasOwnProperty("bargeInAwareness")) + if (typeof message.bargeInAwareness !== "boolean") + return "bargeInAwareness: boolean expected"; + return null; + }; + + /** + * Creates a BargeInConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.BargeInConfig} BargeInConfig + */ + BargeInConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.BargeInConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.BargeInConfig(); + if (object.disableBargeIn != null) + message.disableBargeIn = Boolean(object.disableBargeIn); + if (object.bargeInAwareness != null) + message.bargeInAwareness = Boolean(object.bargeInAwareness); + return message; + }; + + /** + * Creates a plain object from a BargeInConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @static + * @param {google.cloud.ces.v1beta.BargeInConfig} message BargeInConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BargeInConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disableBargeIn = false; + object.bargeInAwareness = false; + } + if (message.disableBargeIn != null && message.hasOwnProperty("disableBargeIn")) + object.disableBargeIn = message.disableBargeIn; + if (message.bargeInAwareness != null && message.hasOwnProperty("bargeInAwareness")) + object.bargeInAwareness = message.bargeInAwareness; + return object; + }; + + /** + * Converts this BargeInConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @instance + * @returns {Object.} JSON object + */ + BargeInConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BargeInConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BargeInConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.BargeInConfig"; + }; + + return BargeInConfig; + })(); + + v1beta.SynthesizeSpeechConfig = (function() { + + /** + * Properties of a SynthesizeSpeechConfig. + * @memberof google.cloud.ces.v1beta + * @interface ISynthesizeSpeechConfig + * @property {string|null} [voice] SynthesizeSpeechConfig voice + * @property {number|null} [speakingRate] SynthesizeSpeechConfig speakingRate + */ + + /** + * Constructs a new SynthesizeSpeechConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a SynthesizeSpeechConfig. + * @implements ISynthesizeSpeechConfig + * @constructor + * @param {google.cloud.ces.v1beta.ISynthesizeSpeechConfig=} [properties] Properties to set + */ + function SynthesizeSpeechConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SynthesizeSpeechConfig voice. + * @member {string} voice + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.voice = ""; + + /** + * SynthesizeSpeechConfig speakingRate. + * @member {number} speakingRate + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.speakingRate = 0; + + /** + * Creates a new SynthesizeSpeechConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @static + * @param {google.cloud.ces.v1beta.ISynthesizeSpeechConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.SynthesizeSpeechConfig} SynthesizeSpeechConfig instance + */ + SynthesizeSpeechConfig.create = function create(properties) { + return new SynthesizeSpeechConfig(properties); + }; + + /** + * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.ces.v1beta.SynthesizeSpeechConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @static + * @param {google.cloud.ces.v1beta.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SynthesizeSpeechConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voice != null && Object.hasOwnProperty.call(message, "voice")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.voice); + if (message.speakingRate != null && Object.hasOwnProperty.call(message, "speakingRate")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.speakingRate); + return writer; + }; + + /** + * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SynthesizeSpeechConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @static + * @param {google.cloud.ces.v1beta.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SynthesizeSpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SynthesizeSpeechConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.voice = reader.string(); + break; + } + case 2: { + message.speakingRate = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SynthesizeSpeechConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SynthesizeSpeechConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SynthesizeSpeechConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.voice != null && message.hasOwnProperty("voice")) + if (!$util.isString(message.voice)) + return "voice: string expected"; + if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) + if (typeof message.speakingRate !== "number") + return "speakingRate: number expected"; + return null; + }; + + /** + * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.SynthesizeSpeechConfig} SynthesizeSpeechConfig + */ + SynthesizeSpeechConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig(); + if (object.voice != null) + message.voice = String(object.voice); + if (object.speakingRate != null) + message.speakingRate = Number(object.speakingRate); + return message; + }; + + /** + * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @static + * @param {google.cloud.ces.v1beta.SynthesizeSpeechConfig} message SynthesizeSpeechConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SynthesizeSpeechConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.voice = ""; + object.speakingRate = 0; + } + if (message.voice != null && message.hasOwnProperty("voice")) + object.voice = message.voice; + if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) + object.speakingRate = options.json && !isFinite(message.speakingRate) ? String(message.speakingRate) : message.speakingRate; + return object; + }; + + /** + * Converts this SynthesizeSpeechConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @instance + * @returns {Object.} JSON object + */ + SynthesizeSpeechConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SynthesizeSpeechConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SynthesizeSpeechConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.SynthesizeSpeechConfig"; + }; + + return SynthesizeSpeechConfig; + })(); + + v1beta.MetricAnalysisSettings = (function() { + + /** + * Properties of a MetricAnalysisSettings. + * @memberof google.cloud.ces.v1beta + * @interface IMetricAnalysisSettings + * @property {boolean|null} [llmMetricsOptedOut] MetricAnalysisSettings llmMetricsOptedOut + */ + + /** + * Constructs a new MetricAnalysisSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a MetricAnalysisSettings. + * @implements IMetricAnalysisSettings + * @constructor + * @param {google.cloud.ces.v1beta.IMetricAnalysisSettings=} [properties] Properties to set + */ + function MetricAnalysisSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricAnalysisSettings llmMetricsOptedOut. + * @member {boolean} llmMetricsOptedOut + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @instance + */ + MetricAnalysisSettings.prototype.llmMetricsOptedOut = false; + + /** + * Creates a new MetricAnalysisSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @static + * @param {google.cloud.ces.v1beta.IMetricAnalysisSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.MetricAnalysisSettings} MetricAnalysisSettings instance + */ + MetricAnalysisSettings.create = function create(properties) { + return new MetricAnalysisSettings(properties); + }; + + /** + * Encodes the specified MetricAnalysisSettings message. Does not implicitly {@link google.cloud.ces.v1beta.MetricAnalysisSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @static + * @param {google.cloud.ces.v1beta.IMetricAnalysisSettings} message MetricAnalysisSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricAnalysisSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.llmMetricsOptedOut != null && Object.hasOwnProperty.call(message, "llmMetricsOptedOut")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.llmMetricsOptedOut); + return writer; + }; + + /** + * Encodes the specified MetricAnalysisSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.MetricAnalysisSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @static + * @param {google.cloud.ces.v1beta.IMetricAnalysisSettings} message MetricAnalysisSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricAnalysisSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricAnalysisSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.MetricAnalysisSettings} MetricAnalysisSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricAnalysisSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.MetricAnalysisSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.llmMetricsOptedOut = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricAnalysisSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.MetricAnalysisSettings} MetricAnalysisSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricAnalysisSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricAnalysisSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricAnalysisSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.llmMetricsOptedOut != null && message.hasOwnProperty("llmMetricsOptedOut")) + if (typeof message.llmMetricsOptedOut !== "boolean") + return "llmMetricsOptedOut: boolean expected"; + return null; + }; + + /** + * Creates a MetricAnalysisSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.MetricAnalysisSettings} MetricAnalysisSettings + */ + MetricAnalysisSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.MetricAnalysisSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.MetricAnalysisSettings(); + if (object.llmMetricsOptedOut != null) + message.llmMetricsOptedOut = Boolean(object.llmMetricsOptedOut); + return message; + }; + + /** + * Creates a plain object from a MetricAnalysisSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @static + * @param {google.cloud.ces.v1beta.MetricAnalysisSettings} message MetricAnalysisSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricAnalysisSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.llmMetricsOptedOut = false; + if (message.llmMetricsOptedOut != null && message.hasOwnProperty("llmMetricsOptedOut")) + object.llmMetricsOptedOut = message.llmMetricsOptedOut; + return object; + }; + + /** + * Converts this MetricAnalysisSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @instance + * @returns {Object.} JSON object + */ + MetricAnalysisSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricAnalysisSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricAnalysisSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.MetricAnalysisSettings"; + }; + + return MetricAnalysisSettings; + })(); + + v1beta.LoggingSettings = (function() { + + /** + * Properties of a LoggingSettings. + * @memberof google.cloud.ces.v1beta + * @interface ILoggingSettings + * @property {google.cloud.ces.v1beta.IRedactionConfig|null} [redactionConfig] LoggingSettings redactionConfig + * @property {google.cloud.ces.v1beta.IAudioRecordingConfig|null} [audioRecordingConfig] LoggingSettings audioRecordingConfig + * @property {google.cloud.ces.v1beta.IBigQueryExportSettings|null} [bigqueryExportSettings] LoggingSettings bigqueryExportSettings + * @property {google.cloud.ces.v1beta.ICloudLoggingSettings|null} [cloudLoggingSettings] LoggingSettings cloudLoggingSettings + * @property {google.cloud.ces.v1beta.IConversationLoggingSettings|null} [conversationLoggingSettings] LoggingSettings conversationLoggingSettings + * @property {google.cloud.ces.v1beta.IAudioRecordingConfig|null} [evaluationAudioRecordingConfig] LoggingSettings evaluationAudioRecordingConfig + * @property {google.cloud.ces.v1beta.IMetricAnalysisSettings|null} [metricAnalysisSettings] LoggingSettings metricAnalysisSettings + */ + + /** + * Constructs a new LoggingSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a LoggingSettings. + * @implements ILoggingSettings + * @constructor + * @param {google.cloud.ces.v1beta.ILoggingSettings=} [properties] Properties to set + */ + function LoggingSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LoggingSettings redactionConfig. + * @member {google.cloud.ces.v1beta.IRedactionConfig|null|undefined} redactionConfig + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @instance + */ + LoggingSettings.prototype.redactionConfig = null; + + /** + * LoggingSettings audioRecordingConfig. + * @member {google.cloud.ces.v1beta.IAudioRecordingConfig|null|undefined} audioRecordingConfig + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @instance + */ + LoggingSettings.prototype.audioRecordingConfig = null; + + /** + * LoggingSettings bigqueryExportSettings. + * @member {google.cloud.ces.v1beta.IBigQueryExportSettings|null|undefined} bigqueryExportSettings + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @instance + */ + LoggingSettings.prototype.bigqueryExportSettings = null; + + /** + * LoggingSettings cloudLoggingSettings. + * @member {google.cloud.ces.v1beta.ICloudLoggingSettings|null|undefined} cloudLoggingSettings + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @instance + */ + LoggingSettings.prototype.cloudLoggingSettings = null; + + /** + * LoggingSettings conversationLoggingSettings. + * @member {google.cloud.ces.v1beta.IConversationLoggingSettings|null|undefined} conversationLoggingSettings + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @instance + */ + LoggingSettings.prototype.conversationLoggingSettings = null; + + /** + * LoggingSettings evaluationAudioRecordingConfig. + * @member {google.cloud.ces.v1beta.IAudioRecordingConfig|null|undefined} evaluationAudioRecordingConfig + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @instance + */ + LoggingSettings.prototype.evaluationAudioRecordingConfig = null; + + /** + * LoggingSettings metricAnalysisSettings. + * @member {google.cloud.ces.v1beta.IMetricAnalysisSettings|null|undefined} metricAnalysisSettings + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @instance + */ + LoggingSettings.prototype.metricAnalysisSettings = null; + + /** + * Creates a new LoggingSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @static + * @param {google.cloud.ces.v1beta.ILoggingSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.LoggingSettings} LoggingSettings instance + */ + LoggingSettings.create = function create(properties) { + return new LoggingSettings(properties); + }; + + /** + * Encodes the specified LoggingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.LoggingSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @static + * @param {google.cloud.ces.v1beta.ILoggingSettings} message LoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.redactionConfig != null && Object.hasOwnProperty.call(message, "redactionConfig")) + $root.google.cloud.ces.v1beta.RedactionConfig.encode(message.redactionConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audioRecordingConfig != null && Object.hasOwnProperty.call(message, "audioRecordingConfig")) + $root.google.cloud.ces.v1beta.AudioRecordingConfig.encode(message.audioRecordingConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bigqueryExportSettings != null && Object.hasOwnProperty.call(message, "bigqueryExportSettings")) + $root.google.cloud.ces.v1beta.BigQueryExportSettings.encode(message.bigqueryExportSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cloudLoggingSettings != null && Object.hasOwnProperty.call(message, "cloudLoggingSettings")) + $root.google.cloud.ces.v1beta.CloudLoggingSettings.encode(message.cloudLoggingSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.conversationLoggingSettings != null && Object.hasOwnProperty.call(message, "conversationLoggingSettings")) + $root.google.cloud.ces.v1beta.ConversationLoggingSettings.encode(message.conversationLoggingSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.evaluationAudioRecordingConfig != null && Object.hasOwnProperty.call(message, "evaluationAudioRecordingConfig")) + $root.google.cloud.ces.v1beta.AudioRecordingConfig.encode(message.evaluationAudioRecordingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.metricAnalysisSettings != null && Object.hasOwnProperty.call(message, "metricAnalysisSettings")) + $root.google.cloud.ces.v1beta.MetricAnalysisSettings.encode(message.metricAnalysisSettings, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LoggingSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @static + * @param {google.cloud.ces.v1beta.ILoggingSettings} message LoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.LoggingSettings} LoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LoggingSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.redactionConfig = $root.google.cloud.ces.v1beta.RedactionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.audioRecordingConfig = $root.google.cloud.ces.v1beta.AudioRecordingConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.bigqueryExportSettings = $root.google.cloud.ces.v1beta.BigQueryExportSettings.decode(reader, reader.uint32()); + break; + } + case 4: { + message.cloudLoggingSettings = $root.google.cloud.ces.v1beta.CloudLoggingSettings.decode(reader, reader.uint32()); + break; + } + case 5: { + message.conversationLoggingSettings = $root.google.cloud.ces.v1beta.ConversationLoggingSettings.decode(reader, reader.uint32()); + break; + } + case 6: { + message.evaluationAudioRecordingConfig = $root.google.cloud.ces.v1beta.AudioRecordingConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.metricAnalysisSettings = $root.google.cloud.ces.v1beta.MetricAnalysisSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.LoggingSettings} LoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoggingSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoggingSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.redactionConfig != null && message.hasOwnProperty("redactionConfig")) { + var error = $root.google.cloud.ces.v1beta.RedactionConfig.verify(message.redactionConfig); + if (error) + return "redactionConfig." + error; + } + if (message.audioRecordingConfig != null && message.hasOwnProperty("audioRecordingConfig")) { + var error = $root.google.cloud.ces.v1beta.AudioRecordingConfig.verify(message.audioRecordingConfig); + if (error) + return "audioRecordingConfig." + error; + } + if (message.bigqueryExportSettings != null && message.hasOwnProperty("bigqueryExportSettings")) { + var error = $root.google.cloud.ces.v1beta.BigQueryExportSettings.verify(message.bigqueryExportSettings); + if (error) + return "bigqueryExportSettings." + error; + } + if (message.cloudLoggingSettings != null && message.hasOwnProperty("cloudLoggingSettings")) { + var error = $root.google.cloud.ces.v1beta.CloudLoggingSettings.verify(message.cloudLoggingSettings); + if (error) + return "cloudLoggingSettings." + error; + } + if (message.conversationLoggingSettings != null && message.hasOwnProperty("conversationLoggingSettings")) { + var error = $root.google.cloud.ces.v1beta.ConversationLoggingSettings.verify(message.conversationLoggingSettings); + if (error) + return "conversationLoggingSettings." + error; + } + if (message.evaluationAudioRecordingConfig != null && message.hasOwnProperty("evaluationAudioRecordingConfig")) { + var error = $root.google.cloud.ces.v1beta.AudioRecordingConfig.verify(message.evaluationAudioRecordingConfig); + if (error) + return "evaluationAudioRecordingConfig." + error; + } + if (message.metricAnalysisSettings != null && message.hasOwnProperty("metricAnalysisSettings")) { + var error = $root.google.cloud.ces.v1beta.MetricAnalysisSettings.verify(message.metricAnalysisSettings); + if (error) + return "metricAnalysisSettings." + error; + } + return null; + }; + + /** + * Creates a LoggingSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.LoggingSettings} LoggingSettings + */ + LoggingSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.LoggingSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.LoggingSettings(); + if (object.redactionConfig != null) { + if (typeof object.redactionConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.redactionConfig: object expected"); + message.redactionConfig = $root.google.cloud.ces.v1beta.RedactionConfig.fromObject(object.redactionConfig); + } + if (object.audioRecordingConfig != null) { + if (typeof object.audioRecordingConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.audioRecordingConfig: object expected"); + message.audioRecordingConfig = $root.google.cloud.ces.v1beta.AudioRecordingConfig.fromObject(object.audioRecordingConfig); + } + if (object.bigqueryExportSettings != null) { + if (typeof object.bigqueryExportSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.bigqueryExportSettings: object expected"); + message.bigqueryExportSettings = $root.google.cloud.ces.v1beta.BigQueryExportSettings.fromObject(object.bigqueryExportSettings); + } + if (object.cloudLoggingSettings != null) { + if (typeof object.cloudLoggingSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.cloudLoggingSettings: object expected"); + message.cloudLoggingSettings = $root.google.cloud.ces.v1beta.CloudLoggingSettings.fromObject(object.cloudLoggingSettings); + } + if (object.conversationLoggingSettings != null) { + if (typeof object.conversationLoggingSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.conversationLoggingSettings: object expected"); + message.conversationLoggingSettings = $root.google.cloud.ces.v1beta.ConversationLoggingSettings.fromObject(object.conversationLoggingSettings); + } + if (object.evaluationAudioRecordingConfig != null) { + if (typeof object.evaluationAudioRecordingConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.evaluationAudioRecordingConfig: object expected"); + message.evaluationAudioRecordingConfig = $root.google.cloud.ces.v1beta.AudioRecordingConfig.fromObject(object.evaluationAudioRecordingConfig); + } + if (object.metricAnalysisSettings != null) { + if (typeof object.metricAnalysisSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.metricAnalysisSettings: object expected"); + message.metricAnalysisSettings = $root.google.cloud.ces.v1beta.MetricAnalysisSettings.fromObject(object.metricAnalysisSettings); + } + return message; + }; + + /** + * Creates a plain object from a LoggingSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @static + * @param {google.cloud.ces.v1beta.LoggingSettings} message LoggingSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoggingSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.redactionConfig = null; + object.audioRecordingConfig = null; + object.bigqueryExportSettings = null; + object.cloudLoggingSettings = null; + object.conversationLoggingSettings = null; + object.evaluationAudioRecordingConfig = null; + object.metricAnalysisSettings = null; + } + if (message.redactionConfig != null && message.hasOwnProperty("redactionConfig")) + object.redactionConfig = $root.google.cloud.ces.v1beta.RedactionConfig.toObject(message.redactionConfig, options); + if (message.audioRecordingConfig != null && message.hasOwnProperty("audioRecordingConfig")) + object.audioRecordingConfig = $root.google.cloud.ces.v1beta.AudioRecordingConfig.toObject(message.audioRecordingConfig, options); + if (message.bigqueryExportSettings != null && message.hasOwnProperty("bigqueryExportSettings")) + object.bigqueryExportSettings = $root.google.cloud.ces.v1beta.BigQueryExportSettings.toObject(message.bigqueryExportSettings, options); + if (message.cloudLoggingSettings != null && message.hasOwnProperty("cloudLoggingSettings")) + object.cloudLoggingSettings = $root.google.cloud.ces.v1beta.CloudLoggingSettings.toObject(message.cloudLoggingSettings, options); + if (message.conversationLoggingSettings != null && message.hasOwnProperty("conversationLoggingSettings")) + object.conversationLoggingSettings = $root.google.cloud.ces.v1beta.ConversationLoggingSettings.toObject(message.conversationLoggingSettings, options); + if (message.evaluationAudioRecordingConfig != null && message.hasOwnProperty("evaluationAudioRecordingConfig")) + object.evaluationAudioRecordingConfig = $root.google.cloud.ces.v1beta.AudioRecordingConfig.toObject(message.evaluationAudioRecordingConfig, options); + if (message.metricAnalysisSettings != null && message.hasOwnProperty("metricAnalysisSettings")) + object.metricAnalysisSettings = $root.google.cloud.ces.v1beta.MetricAnalysisSettings.toObject(message.metricAnalysisSettings, options); + return object; + }; + + /** + * Converts this LoggingSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @instance + * @returns {Object.} JSON object + */ + LoggingSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoggingSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoggingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.LoggingSettings"; + }; + + return LoggingSettings; + })(); + + v1beta.ErrorHandlingSettings = (function() { + + /** + * Properties of an ErrorHandlingSettings. + * @memberof google.cloud.ces.v1beta + * @interface IErrorHandlingSettings + * @property {google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy|null} [errorHandlingStrategy] ErrorHandlingSettings errorHandlingStrategy + */ + + /** + * Constructs a new ErrorHandlingSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ErrorHandlingSettings. + * @implements IErrorHandlingSettings + * @constructor + * @param {google.cloud.ces.v1beta.IErrorHandlingSettings=} [properties] Properties to set + */ + function ErrorHandlingSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ErrorHandlingSettings errorHandlingStrategy. + * @member {google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy} errorHandlingStrategy + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @instance + */ + ErrorHandlingSettings.prototype.errorHandlingStrategy = 0; + + /** + * Creates a new ErrorHandlingSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @static + * @param {google.cloud.ces.v1beta.IErrorHandlingSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ErrorHandlingSettings} ErrorHandlingSettings instance + */ + ErrorHandlingSettings.create = function create(properties) { + return new ErrorHandlingSettings(properties); + }; + + /** + * Encodes the specified ErrorHandlingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ErrorHandlingSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @static + * @param {google.cloud.ces.v1beta.IErrorHandlingSettings} message ErrorHandlingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorHandlingSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorHandlingStrategy != null && Object.hasOwnProperty.call(message, "errorHandlingStrategy")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.errorHandlingStrategy); + return writer; + }; + + /** + * Encodes the specified ErrorHandlingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ErrorHandlingSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @static + * @param {google.cloud.ces.v1beta.IErrorHandlingSettings} message ErrorHandlingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorHandlingSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ErrorHandlingSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ErrorHandlingSettings} ErrorHandlingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorHandlingSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ErrorHandlingSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.errorHandlingStrategy = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ErrorHandlingSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ErrorHandlingSettings} ErrorHandlingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorHandlingSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ErrorHandlingSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ErrorHandlingSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorHandlingStrategy != null && message.hasOwnProperty("errorHandlingStrategy")) + switch (message.errorHandlingStrategy) { + default: + return "errorHandlingStrategy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ErrorHandlingSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ErrorHandlingSettings} ErrorHandlingSettings + */ + ErrorHandlingSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ErrorHandlingSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.ErrorHandlingSettings(); + switch (object.errorHandlingStrategy) { + default: + if (typeof object.errorHandlingStrategy === "number") { + message.errorHandlingStrategy = object.errorHandlingStrategy; + break; + } + break; + case "ERROR_HANDLING_STRATEGY_UNSPECIFIED": + case 0: + message.errorHandlingStrategy = 0; + break; + case "NONE": + case 1: + message.errorHandlingStrategy = 1; + break; + case "FALLBACK_RESPONSE": + case 2: + message.errorHandlingStrategy = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ErrorHandlingSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @static + * @param {google.cloud.ces.v1beta.ErrorHandlingSettings} message ErrorHandlingSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ErrorHandlingSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.errorHandlingStrategy = options.enums === String ? "ERROR_HANDLING_STRATEGY_UNSPECIFIED" : 0; + if (message.errorHandlingStrategy != null && message.hasOwnProperty("errorHandlingStrategy")) + object.errorHandlingStrategy = options.enums === String ? $root.google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy[message.errorHandlingStrategy] === undefined ? message.errorHandlingStrategy : $root.google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy[message.errorHandlingStrategy] : message.errorHandlingStrategy; + return object; + }; + + /** + * Converts this ErrorHandlingSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @instance + * @returns {Object.} JSON object + */ + ErrorHandlingSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ErrorHandlingSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ErrorHandlingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ErrorHandlingSettings"; + }; + + /** + * ErrorHandlingStrategy enum. + * @name google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy + * @enum {number} + * @property {number} ERROR_HANDLING_STRATEGY_UNSPECIFIED=0 ERROR_HANDLING_STRATEGY_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} FALLBACK_RESPONSE=2 FALLBACK_RESPONSE value + */ + ErrorHandlingSettings.ErrorHandlingStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ERROR_HANDLING_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "FALLBACK_RESPONSE"] = 2; + return values; + })(); + + return ErrorHandlingSettings; + })(); + + v1beta.EvaluationMetricsThresholds = (function() { + + /** + * Properties of an EvaluationMetricsThresholds. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluationMetricsThresholds + * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null} [goldenEvaluationMetricsThresholds] EvaluationMetricsThresholds goldenEvaluationMetricsThresholds + * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|null} [hallucinationMetricBehavior] EvaluationMetricsThresholds hallucinationMetricBehavior + * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|null} [goldenHallucinationMetricBehavior] EvaluationMetricsThresholds goldenHallucinationMetricBehavior + * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|null} [scenarioHallucinationMetricBehavior] EvaluationMetricsThresholds scenarioHallucinationMetricBehavior + */ + + /** + * Constructs a new EvaluationMetricsThresholds. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationMetricsThresholds. + * @implements IEvaluationMetricsThresholds + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluationMetricsThresholds=} [properties] Properties to set + */ + function EvaluationMetricsThresholds(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationMetricsThresholds goldenEvaluationMetricsThresholds. + * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null|undefined} goldenEvaluationMetricsThresholds + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @instance + */ + EvaluationMetricsThresholds.prototype.goldenEvaluationMetricsThresholds = null; + + /** + * EvaluationMetricsThresholds hallucinationMetricBehavior. + * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior} hallucinationMetricBehavior + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @instance + */ + EvaluationMetricsThresholds.prototype.hallucinationMetricBehavior = 0; + + /** + * EvaluationMetricsThresholds goldenHallucinationMetricBehavior. + * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior} goldenHallucinationMetricBehavior + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @instance + */ + EvaluationMetricsThresholds.prototype.goldenHallucinationMetricBehavior = 0; + + /** + * EvaluationMetricsThresholds scenarioHallucinationMetricBehavior. + * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior} scenarioHallucinationMetricBehavior + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @instance + */ + EvaluationMetricsThresholds.prototype.scenarioHallucinationMetricBehavior = 0; + + /** + * Creates a new EvaluationMetricsThresholds instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.IEvaluationMetricsThresholds=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds} EvaluationMetricsThresholds instance + */ + EvaluationMetricsThresholds.create = function create(properties) { + return new EvaluationMetricsThresholds(properties); + }; + + /** + * Encodes the specified EvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.IEvaluationMetricsThresholds} message EvaluationMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationMetricsThresholds.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.goldenEvaluationMetricsThresholds != null && Object.hasOwnProperty.call(message, "goldenEvaluationMetricsThresholds")) + $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.encode(message.goldenEvaluationMetricsThresholds, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.hallucinationMetricBehavior != null && Object.hasOwnProperty.call(message, "hallucinationMetricBehavior")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.hallucinationMetricBehavior); + if (message.scenarioHallucinationMetricBehavior != null && Object.hasOwnProperty.call(message, "scenarioHallucinationMetricBehavior")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.scenarioHallucinationMetricBehavior); + if (message.goldenHallucinationMetricBehavior != null && Object.hasOwnProperty.call(message, "goldenHallucinationMetricBehavior")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.goldenHallucinationMetricBehavior); + return writer; + }; + + /** + * Encodes the specified EvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.IEvaluationMetricsThresholds} message EvaluationMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds} EvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationMetricsThresholds.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.goldenEvaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.decode(reader, reader.uint32()); + break; + } + case 3: { + message.hallucinationMetricBehavior = reader.int32(); + break; + } + case 5: { + message.goldenHallucinationMetricBehavior = reader.int32(); + break; + } + case 4: { + message.scenarioHallucinationMetricBehavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds} EvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationMetricsThresholds message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationMetricsThresholds.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.goldenEvaluationMetricsThresholds != null && message.hasOwnProperty("goldenEvaluationMetricsThresholds")) { + var error = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify(message.goldenEvaluationMetricsThresholds); + if (error) + return "goldenEvaluationMetricsThresholds." + error; + } + if (message.hallucinationMetricBehavior != null && message.hasOwnProperty("hallucinationMetricBehavior")) + switch (message.hallucinationMetricBehavior) { + default: + return "hallucinationMetricBehavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.goldenHallucinationMetricBehavior != null && message.hasOwnProperty("goldenHallucinationMetricBehavior")) + switch (message.goldenHallucinationMetricBehavior) { + default: + return "goldenHallucinationMetricBehavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.scenarioHallucinationMetricBehavior != null && message.hasOwnProperty("scenarioHallucinationMetricBehavior")) + switch (message.scenarioHallucinationMetricBehavior) { + default: + return "scenarioHallucinationMetricBehavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an EvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds} EvaluationMetricsThresholds + */ + EvaluationMetricsThresholds.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds(); + if (object.goldenEvaluationMetricsThresholds != null) { + if (typeof object.goldenEvaluationMetricsThresholds !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationMetricsThresholds.goldenEvaluationMetricsThresholds: object expected"); + message.goldenEvaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.fromObject(object.goldenEvaluationMetricsThresholds); + } + switch (object.hallucinationMetricBehavior) { + default: + if (typeof object.hallucinationMetricBehavior === "number") { + message.hallucinationMetricBehavior = object.hallucinationMetricBehavior; + break; + } + break; + case "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": + case 0: + message.hallucinationMetricBehavior = 0; + break; + case "DISABLED": + case 1: + message.hallucinationMetricBehavior = 1; + break; + case "ENABLED": + case 2: + message.hallucinationMetricBehavior = 2; + break; + } + switch (object.goldenHallucinationMetricBehavior) { + default: + if (typeof object.goldenHallucinationMetricBehavior === "number") { + message.goldenHallucinationMetricBehavior = object.goldenHallucinationMetricBehavior; + break; + } + break; + case "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": + case 0: + message.goldenHallucinationMetricBehavior = 0; + break; + case "DISABLED": + case 1: + message.goldenHallucinationMetricBehavior = 1; + break; + case "ENABLED": + case 2: + message.goldenHallucinationMetricBehavior = 2; + break; + } + switch (object.scenarioHallucinationMetricBehavior) { + default: + if (typeof object.scenarioHallucinationMetricBehavior === "number") { + message.scenarioHallucinationMetricBehavior = object.scenarioHallucinationMetricBehavior; + break; + } + break; + case "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": + case 0: + message.scenarioHallucinationMetricBehavior = 0; + break; + case "DISABLED": + case 1: + message.scenarioHallucinationMetricBehavior = 1; + break; + case "ENABLED": + case 2: + message.scenarioHallucinationMetricBehavior = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an EvaluationMetricsThresholds message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds} message EvaluationMetricsThresholds + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationMetricsThresholds.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.goldenEvaluationMetricsThresholds = null; + object.hallucinationMetricBehavior = options.enums === String ? "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" : 0; + object.scenarioHallucinationMetricBehavior = options.enums === String ? "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" : 0; + object.goldenHallucinationMetricBehavior = options.enums === String ? "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" : 0; + } + if (message.goldenEvaluationMetricsThresholds != null && message.hasOwnProperty("goldenEvaluationMetricsThresholds")) + object.goldenEvaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.toObject(message.goldenEvaluationMetricsThresholds, options); + if (message.hallucinationMetricBehavior != null && message.hasOwnProperty("hallucinationMetricBehavior")) + object.hallucinationMetricBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.hallucinationMetricBehavior] === undefined ? message.hallucinationMetricBehavior : $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.hallucinationMetricBehavior] : message.hallucinationMetricBehavior; + if (message.scenarioHallucinationMetricBehavior != null && message.hasOwnProperty("scenarioHallucinationMetricBehavior")) + object.scenarioHallucinationMetricBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.scenarioHallucinationMetricBehavior] === undefined ? message.scenarioHallucinationMetricBehavior : $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.scenarioHallucinationMetricBehavior] : message.scenarioHallucinationMetricBehavior; + if (message.goldenHallucinationMetricBehavior != null && message.hasOwnProperty("goldenHallucinationMetricBehavior")) + object.goldenHallucinationMetricBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.goldenHallucinationMetricBehavior] === undefined ? message.goldenHallucinationMetricBehavior : $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.goldenHallucinationMetricBehavior] : message.goldenHallucinationMetricBehavior; + return object; + }; + + /** + * Converts this EvaluationMetricsThresholds to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @instance + * @returns {Object.} JSON object + */ + EvaluationMetricsThresholds.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationMetricsThresholds + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationMetricsThresholds"; + }; + + EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds = (function() { + + /** + * Properties of a GoldenEvaluationMetricsThresholds. + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @interface IGoldenEvaluationMetricsThresholds + * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null} [turnLevelMetricsThresholds] GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds + * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null} [expectationLevelMetricsThresholds] GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds + * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings|null} [toolMatchingSettings] GoldenEvaluationMetricsThresholds toolMatchingSettings + */ + + /** + * Constructs a new GoldenEvaluationMetricsThresholds. + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @classdesc Represents a GoldenEvaluationMetricsThresholds. + * @implements IGoldenEvaluationMetricsThresholds + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds=} [properties] Properties to set + */ + function GoldenEvaluationMetricsThresholds(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds. + * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null|undefined} turnLevelMetricsThresholds + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @instance + */ + GoldenEvaluationMetricsThresholds.prototype.turnLevelMetricsThresholds = null; + + /** + * GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds. + * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null|undefined} expectationLevelMetricsThresholds + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @instance + */ + GoldenEvaluationMetricsThresholds.prototype.expectationLevelMetricsThresholds = null; + + /** + * GoldenEvaluationMetricsThresholds toolMatchingSettings. + * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings|null|undefined} toolMatchingSettings + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @instance + */ + GoldenEvaluationMetricsThresholds.prototype.toolMatchingSettings = null; + + /** + * Creates a new GoldenEvaluationMetricsThresholds instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds instance + */ + GoldenEvaluationMetricsThresholds.create = function create(properties) { + return new GoldenEvaluationMetricsThresholds(properties); + }; + + /** + * Encodes the specified GoldenEvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds} message GoldenEvaluationMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenEvaluationMetricsThresholds.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.turnLevelMetricsThresholds != null && Object.hasOwnProperty.call(message, "turnLevelMetricsThresholds")) + $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.encode(message.turnLevelMetricsThresholds, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.expectationLevelMetricsThresholds != null && Object.hasOwnProperty.call(message, "expectationLevelMetricsThresholds")) + $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.encode(message.expectationLevelMetricsThresholds, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolMatchingSettings != null && Object.hasOwnProperty.call(message, "toolMatchingSettings")) + $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.encode(message.toolMatchingSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoldenEvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds} message GoldenEvaluationMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenEvaluationMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenEvaluationMetricsThresholds.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.turnLevelMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.decode(reader, reader.uint32()); + break; + } + case 2: { + message.expectationLevelMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.decode(reader, reader.uint32()); + break; + } + case 3: { + message.toolMatchingSettings = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenEvaluationMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoldenEvaluationMetricsThresholds message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoldenEvaluationMetricsThresholds.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.turnLevelMetricsThresholds != null && message.hasOwnProperty("turnLevelMetricsThresholds")) { + var error = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify(message.turnLevelMetricsThresholds); + if (error) + return "turnLevelMetricsThresholds." + error; + } + if (message.expectationLevelMetricsThresholds != null && message.hasOwnProperty("expectationLevelMetricsThresholds")) { + var error = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify(message.expectationLevelMetricsThresholds); + if (error) + return "expectationLevelMetricsThresholds." + error; + } + if (message.toolMatchingSettings != null && message.hasOwnProperty("toolMatchingSettings")) { + var error = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.verify(message.toolMatchingSettings); + if (error) + return "toolMatchingSettings." + error; + } + return null; + }; + + /** + * Creates a GoldenEvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds + */ + GoldenEvaluationMetricsThresholds.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds(); + if (object.turnLevelMetricsThresholds != null) { + if (typeof object.turnLevelMetricsThresholds !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.turnLevelMetricsThresholds: object expected"); + message.turnLevelMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.fromObject(object.turnLevelMetricsThresholds); + } + if (object.expectationLevelMetricsThresholds != null) { + if (typeof object.expectationLevelMetricsThresholds !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.expectationLevelMetricsThresholds: object expected"); + message.expectationLevelMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.fromObject(object.expectationLevelMetricsThresholds); + } + if (object.toolMatchingSettings != null) { + if (typeof object.toolMatchingSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.toolMatchingSettings: object expected"); + message.toolMatchingSettings = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.fromObject(object.toolMatchingSettings); + } + return message; + }; + + /** + * Creates a plain object from a GoldenEvaluationMetricsThresholds message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} message GoldenEvaluationMetricsThresholds + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoldenEvaluationMetricsThresholds.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.turnLevelMetricsThresholds = null; + object.expectationLevelMetricsThresholds = null; + object.toolMatchingSettings = null; + } + if (message.turnLevelMetricsThresholds != null && message.hasOwnProperty("turnLevelMetricsThresholds")) + object.turnLevelMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.toObject(message.turnLevelMetricsThresholds, options); + if (message.expectationLevelMetricsThresholds != null && message.hasOwnProperty("expectationLevelMetricsThresholds")) + object.expectationLevelMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.toObject(message.expectationLevelMetricsThresholds, options); + if (message.toolMatchingSettings != null && message.hasOwnProperty("toolMatchingSettings")) + object.toolMatchingSettings = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.toObject(message.toolMatchingSettings, options); + return object; + }; + + /** + * Converts this GoldenEvaluationMetricsThresholds to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @instance + * @returns {Object.} JSON object + */ + GoldenEvaluationMetricsThresholds.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoldenEvaluationMetricsThresholds + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoldenEvaluationMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds"; + }; + + GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds = (function() { + + /** + * Properties of a TurnLevelMetricsThresholds. + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @interface ITurnLevelMetricsThresholds + * @property {number|null} [semanticSimilaritySuccessThreshold] TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold + * @property {number|null} [overallToolInvocationCorrectnessThreshold] TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold + * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|null} [semanticSimilarityChannel] TurnLevelMetricsThresholds semanticSimilarityChannel + */ + + /** + * Constructs a new TurnLevelMetricsThresholds. + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @classdesc Represents a TurnLevelMetricsThresholds. + * @implements ITurnLevelMetricsThresholds + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds=} [properties] Properties to set + */ + function TurnLevelMetricsThresholds(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold. + * @member {number|null|undefined} semanticSimilaritySuccessThreshold + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @instance + */ + TurnLevelMetricsThresholds.prototype.semanticSimilaritySuccessThreshold = null; + + /** + * TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold. + * @member {number|null|undefined} overallToolInvocationCorrectnessThreshold + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @instance + */ + TurnLevelMetricsThresholds.prototype.overallToolInvocationCorrectnessThreshold = null; + + /** + * TurnLevelMetricsThresholds semanticSimilarityChannel. + * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel} semanticSimilarityChannel + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @instance + */ + TurnLevelMetricsThresholds.prototype.semanticSimilarityChannel = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TurnLevelMetricsThresholds.prototype, "_semanticSimilaritySuccessThreshold", { + get: $util.oneOfGetter($oneOfFields = ["semanticSimilaritySuccessThreshold"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TurnLevelMetricsThresholds.prototype, "_overallToolInvocationCorrectnessThreshold", { + get: $util.oneOfGetter($oneOfFields = ["overallToolInvocationCorrectnessThreshold"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TurnLevelMetricsThresholds instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds instance + */ + TurnLevelMetricsThresholds.create = function create(properties) { + return new TurnLevelMetricsThresholds(properties); + }; + + /** + * Encodes the specified TurnLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds} message TurnLevelMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TurnLevelMetricsThresholds.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.semanticSimilaritySuccessThreshold != null && Object.hasOwnProperty.call(message, "semanticSimilaritySuccessThreshold")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.semanticSimilaritySuccessThreshold); + if (message.overallToolInvocationCorrectnessThreshold != null && Object.hasOwnProperty.call(message, "overallToolInvocationCorrectnessThreshold")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.overallToolInvocationCorrectnessThreshold); + if (message.semanticSimilarityChannel != null && Object.hasOwnProperty.call(message, "semanticSimilarityChannel")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.semanticSimilarityChannel); + return writer; + }; + + /** + * Encodes the specified TurnLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds} message TurnLevelMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TurnLevelMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TurnLevelMetricsThresholds.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.semanticSimilaritySuccessThreshold = reader.int32(); + break; + } + case 2: { + message.overallToolInvocationCorrectnessThreshold = reader.float(); + break; + } + case 3: { + message.semanticSimilarityChannel = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TurnLevelMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TurnLevelMetricsThresholds message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TurnLevelMetricsThresholds.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.semanticSimilaritySuccessThreshold != null && message.hasOwnProperty("semanticSimilaritySuccessThreshold")) { + properties._semanticSimilaritySuccessThreshold = 1; + if (!$util.isInteger(message.semanticSimilaritySuccessThreshold)) + return "semanticSimilaritySuccessThreshold: integer expected"; + } + if (message.overallToolInvocationCorrectnessThreshold != null && message.hasOwnProperty("overallToolInvocationCorrectnessThreshold")) { + properties._overallToolInvocationCorrectnessThreshold = 1; + if (typeof message.overallToolInvocationCorrectnessThreshold !== "number") + return "overallToolInvocationCorrectnessThreshold: number expected"; + } + if (message.semanticSimilarityChannel != null && message.hasOwnProperty("semanticSimilarityChannel")) + switch (message.semanticSimilarityChannel) { + default: + return "semanticSimilarityChannel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TurnLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds + */ + TurnLevelMetricsThresholds.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds(); + if (object.semanticSimilaritySuccessThreshold != null) + message.semanticSimilaritySuccessThreshold = object.semanticSimilaritySuccessThreshold | 0; + if (object.overallToolInvocationCorrectnessThreshold != null) + message.overallToolInvocationCorrectnessThreshold = Number(object.overallToolInvocationCorrectnessThreshold); + switch (object.semanticSimilarityChannel) { + default: + if (typeof object.semanticSimilarityChannel === "number") { + message.semanticSimilarityChannel = object.semanticSimilarityChannel; + break; + } + break; + case "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED": + case 0: + message.semanticSimilarityChannel = 0; + break; + case "TEXT": + case 1: + message.semanticSimilarityChannel = 1; + break; + case "AUDIO": + case 2: + message.semanticSimilarityChannel = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TurnLevelMetricsThresholds message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} message TurnLevelMetricsThresholds + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TurnLevelMetricsThresholds.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.semanticSimilarityChannel = options.enums === String ? "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED" : 0; + if (message.semanticSimilaritySuccessThreshold != null && message.hasOwnProperty("semanticSimilaritySuccessThreshold")) { + object.semanticSimilaritySuccessThreshold = message.semanticSimilaritySuccessThreshold; + if (options.oneofs) + object._semanticSimilaritySuccessThreshold = "semanticSimilaritySuccessThreshold"; + } + if (message.overallToolInvocationCorrectnessThreshold != null && message.hasOwnProperty("overallToolInvocationCorrectnessThreshold")) { + object.overallToolInvocationCorrectnessThreshold = options.json && !isFinite(message.overallToolInvocationCorrectnessThreshold) ? String(message.overallToolInvocationCorrectnessThreshold) : message.overallToolInvocationCorrectnessThreshold; + if (options.oneofs) + object._overallToolInvocationCorrectnessThreshold = "overallToolInvocationCorrectnessThreshold"; + } + if (message.semanticSimilarityChannel != null && message.hasOwnProperty("semanticSimilarityChannel")) + object.semanticSimilarityChannel = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel[message.semanticSimilarityChannel] === undefined ? message.semanticSimilarityChannel : $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel[message.semanticSimilarityChannel] : message.semanticSimilarityChannel; + return object; + }; + + /** + * Converts this TurnLevelMetricsThresholds to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @instance + * @returns {Object.} JSON object + */ + TurnLevelMetricsThresholds.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TurnLevelMetricsThresholds + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TurnLevelMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds"; + }; + + /** + * SemanticSimilarityChannel enum. + * @name google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel + * @enum {number} + * @property {number} SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED=0 SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED value + * @property {number} TEXT=1 TEXT value + * @property {number} AUDIO=2 AUDIO value + */ + TurnLevelMetricsThresholds.SemanticSimilarityChannel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "AUDIO"] = 2; + return values; + })(); + + return TurnLevelMetricsThresholds; + })(); + + GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds = (function() { + + /** + * Properties of an ExpectationLevelMetricsThresholds. + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @interface IExpectationLevelMetricsThresholds + * @property {number|null} [toolInvocationParameterCorrectnessThreshold] ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold + */ + + /** + * Constructs a new ExpectationLevelMetricsThresholds. + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @classdesc Represents an ExpectationLevelMetricsThresholds. + * @implements IExpectationLevelMetricsThresholds + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds=} [properties] Properties to set + */ + function ExpectationLevelMetricsThresholds(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold. + * @member {number|null|undefined} toolInvocationParameterCorrectnessThreshold + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @instance + */ + ExpectationLevelMetricsThresholds.prototype.toolInvocationParameterCorrectnessThreshold = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExpectationLevelMetricsThresholds.prototype, "_toolInvocationParameterCorrectnessThreshold", { + get: $util.oneOfGetter($oneOfFields = ["toolInvocationParameterCorrectnessThreshold"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExpectationLevelMetricsThresholds instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds instance + */ + ExpectationLevelMetricsThresholds.create = function create(properties) { + return new ExpectationLevelMetricsThresholds(properties); + }; + + /** + * Encodes the specified ExpectationLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds} message ExpectationLevelMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpectationLevelMetricsThresholds.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolInvocationParameterCorrectnessThreshold != null && Object.hasOwnProperty.call(message, "toolInvocationParameterCorrectnessThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.toolInvocationParameterCorrectnessThreshold); + return writer; + }; + + /** + * Encodes the specified ExpectationLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds} message ExpectationLevelMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpectationLevelMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpectationLevelMetricsThresholds.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolInvocationParameterCorrectnessThreshold = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpectationLevelMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExpectationLevelMetricsThresholds message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExpectationLevelMetricsThresholds.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.toolInvocationParameterCorrectnessThreshold != null && message.hasOwnProperty("toolInvocationParameterCorrectnessThreshold")) { + properties._toolInvocationParameterCorrectnessThreshold = 1; + if (typeof message.toolInvocationParameterCorrectnessThreshold !== "number") + return "toolInvocationParameterCorrectnessThreshold: number expected"; + } + return null; + }; + + /** + * Creates an ExpectationLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds + */ + ExpectationLevelMetricsThresholds.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds(); + if (object.toolInvocationParameterCorrectnessThreshold != null) + message.toolInvocationParameterCorrectnessThreshold = Number(object.toolInvocationParameterCorrectnessThreshold); + return message; + }; + + /** + * Creates a plain object from an ExpectationLevelMetricsThresholds message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} message ExpectationLevelMetricsThresholds + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExpectationLevelMetricsThresholds.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.toolInvocationParameterCorrectnessThreshold != null && message.hasOwnProperty("toolInvocationParameterCorrectnessThreshold")) { + object.toolInvocationParameterCorrectnessThreshold = options.json && !isFinite(message.toolInvocationParameterCorrectnessThreshold) ? String(message.toolInvocationParameterCorrectnessThreshold) : message.toolInvocationParameterCorrectnessThreshold; + if (options.oneofs) + object._toolInvocationParameterCorrectnessThreshold = "toolInvocationParameterCorrectnessThreshold"; + } + return object; + }; + + /** + * Converts this ExpectationLevelMetricsThresholds to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @instance + * @returns {Object.} JSON object + */ + ExpectationLevelMetricsThresholds.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExpectationLevelMetricsThresholds + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExpectationLevelMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds"; + }; + + return ExpectationLevelMetricsThresholds; + })(); + + return GoldenEvaluationMetricsThresholds; + })(); + + EvaluationMetricsThresholds.ToolMatchingSettings = (function() { + + /** + * Properties of a ToolMatchingSettings. + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @interface IToolMatchingSettings + * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|null} [extraToolCallBehavior] ToolMatchingSettings extraToolCallBehavior + */ + + /** + * Constructs a new ToolMatchingSettings. + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @classdesc Represents a ToolMatchingSettings. + * @implements IToolMatchingSettings + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings=} [properties] Properties to set + */ + function ToolMatchingSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolMatchingSettings extraToolCallBehavior. + * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior} extraToolCallBehavior + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @instance + */ + ToolMatchingSettings.prototype.extraToolCallBehavior = 0; + + /** + * Creates a new ToolMatchingSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings instance + */ + ToolMatchingSettings.create = function create(properties) { + return new ToolMatchingSettings(properties); + }; + + /** + * Encodes the specified ToolMatchingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings} message ToolMatchingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolMatchingSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.extraToolCallBehavior != null && Object.hasOwnProperty.call(message, "extraToolCallBehavior")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.extraToolCallBehavior); + return writer; + }; + + /** + * Encodes the specified ToolMatchingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings} message ToolMatchingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolMatchingSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolMatchingSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolMatchingSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.extraToolCallBehavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolMatchingSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolMatchingSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolMatchingSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolMatchingSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.extraToolCallBehavior != null && message.hasOwnProperty("extraToolCallBehavior")) + switch (message.extraToolCallBehavior) { + default: + return "extraToolCallBehavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ToolMatchingSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings + */ + ToolMatchingSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings(); + switch (object.extraToolCallBehavior) { + default: + if (typeof object.extraToolCallBehavior === "number") { + message.extraToolCallBehavior = object.extraToolCallBehavior; + break; + } + break; + case "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED": + case 0: + message.extraToolCallBehavior = 0; + break; + case "FAIL": + case 1: + message.extraToolCallBehavior = 1; + break; + case "ALLOW": + case 2: + message.extraToolCallBehavior = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ToolMatchingSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings} message ToolMatchingSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolMatchingSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.extraToolCallBehavior = options.enums === String ? "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED" : 0; + if (message.extraToolCallBehavior != null && message.hasOwnProperty("extraToolCallBehavior")) + object.extraToolCallBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior[message.extraToolCallBehavior] === undefined ? message.extraToolCallBehavior : $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior[message.extraToolCallBehavior] : message.extraToolCallBehavior; + return object; + }; + + /** + * Converts this ToolMatchingSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @instance + * @returns {Object.} JSON object + */ + ToolMatchingSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolMatchingSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolMatchingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings"; + }; + + /** + * ExtraToolCallBehavior enum. + * @name google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior + * @enum {number} + * @property {number} EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED=0 EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED value + * @property {number} FAIL=1 FAIL value + * @property {number} ALLOW=2 ALLOW value + */ + ToolMatchingSettings.ExtraToolCallBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "FAIL"] = 1; + values[valuesById[2] = "ALLOW"] = 2; + return values; + })(); + + return ToolMatchingSettings; + })(); + + /** + * HallucinationMetricBehavior enum. + * @name google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior + * @enum {number} + * @property {number} HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED=0 HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} ENABLED=2 ENABLED value + */ + EvaluationMetricsThresholds.HallucinationMetricBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[2] = "ENABLED"] = 2; + return values; + })(); + + return EvaluationMetricsThresholds; + })(); + + v1beta.EvaluationSettings = (function() { + + /** + * Properties of an EvaluationSettings. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluationSettings + * @property {google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator|null} [scenarioConversationInitiator] EvaluationSettings scenarioConversationInitiator + * @property {google.cloud.ces.v1beta.GoldenRunMethod|null} [goldenRunMethod] EvaluationSettings goldenRunMethod + * @property {google.cloud.ces.v1beta.EvaluationToolCallBehaviour|null} [goldenEvaluationToolCallBehaviour] EvaluationSettings goldenEvaluationToolCallBehaviour + * @property {google.cloud.ces.v1beta.EvaluationToolCallBehaviour|null} [scenarioEvaluationToolCallBehaviour] EvaluationSettings scenarioEvaluationToolCallBehaviour + */ + + /** + * Constructs a new EvaluationSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationSettings. + * @implements IEvaluationSettings + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluationSettings=} [properties] Properties to set + */ + function EvaluationSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationSettings scenarioConversationInitiator. + * @member {google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator} scenarioConversationInitiator + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @instance + */ + EvaluationSettings.prototype.scenarioConversationInitiator = 0; + + /** + * EvaluationSettings goldenRunMethod. + * @member {google.cloud.ces.v1beta.GoldenRunMethod} goldenRunMethod + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @instance + */ + EvaluationSettings.prototype.goldenRunMethod = 0; + + /** + * EvaluationSettings goldenEvaluationToolCallBehaviour. + * @member {google.cloud.ces.v1beta.EvaluationToolCallBehaviour} goldenEvaluationToolCallBehaviour + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @instance + */ + EvaluationSettings.prototype.goldenEvaluationToolCallBehaviour = 0; + + /** + * EvaluationSettings scenarioEvaluationToolCallBehaviour. + * @member {google.cloud.ces.v1beta.EvaluationToolCallBehaviour} scenarioEvaluationToolCallBehaviour + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @instance + */ + EvaluationSettings.prototype.scenarioEvaluationToolCallBehaviour = 0; + + /** + * Creates a new EvaluationSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @static + * @param {google.cloud.ces.v1beta.IEvaluationSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationSettings} EvaluationSettings instance + */ + EvaluationSettings.create = function create(properties) { + return new EvaluationSettings(properties); + }; + + /** + * Encodes the specified EvaluationSettings message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @static + * @param {google.cloud.ces.v1beta.IEvaluationSettings} message EvaluationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scenarioConversationInitiator != null && Object.hasOwnProperty.call(message, "scenarioConversationInitiator")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.scenarioConversationInitiator); + if (message.goldenEvaluationToolCallBehaviour != null && Object.hasOwnProperty.call(message, "goldenEvaluationToolCallBehaviour")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.goldenEvaluationToolCallBehaviour); + if (message.scenarioEvaluationToolCallBehaviour != null && Object.hasOwnProperty.call(message, "scenarioEvaluationToolCallBehaviour")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.scenarioEvaluationToolCallBehaviour); + if (message.goldenRunMethod != null && Object.hasOwnProperty.call(message, "goldenRunMethod")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.goldenRunMethod); + return writer; + }; + + /** + * Encodes the specified EvaluationSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @static + * @param {google.cloud.ces.v1beta.IEvaluationSettings} message EvaluationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationSettings} EvaluationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.scenarioConversationInitiator = reader.int32(); + break; + } + case 4: { + message.goldenRunMethod = reader.int32(); + break; + } + case 2: { + message.goldenEvaluationToolCallBehaviour = reader.int32(); + break; + } + case 3: { + message.scenarioEvaluationToolCallBehaviour = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationSettings} EvaluationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scenarioConversationInitiator != null && message.hasOwnProperty("scenarioConversationInitiator")) + switch (message.scenarioConversationInitiator) { + default: + return "scenarioConversationInitiator: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) + switch (message.goldenRunMethod) { + default: + return "goldenRunMethod: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.goldenEvaluationToolCallBehaviour != null && message.hasOwnProperty("goldenEvaluationToolCallBehaviour")) + switch (message.goldenEvaluationToolCallBehaviour) { + default: + return "goldenEvaluationToolCallBehaviour: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.scenarioEvaluationToolCallBehaviour != null && message.hasOwnProperty("scenarioEvaluationToolCallBehaviour")) + switch (message.scenarioEvaluationToolCallBehaviour) { + default: + return "scenarioEvaluationToolCallBehaviour: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an EvaluationSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationSettings} EvaluationSettings + */ + EvaluationSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationSettings(); + switch (object.scenarioConversationInitiator) { + default: + if (typeof object.scenarioConversationInitiator === "number") { + message.scenarioConversationInitiator = object.scenarioConversationInitiator; + break; + } + break; + case "SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED": + case 0: + message.scenarioConversationInitiator = 0; + break; + case "USER": + case 1: + message.scenarioConversationInitiator = 1; + break; + case "AGENT": + case 2: + message.scenarioConversationInitiator = 2; + break; + } + switch (object.goldenRunMethod) { + default: + if (typeof object.goldenRunMethod === "number") { + message.goldenRunMethod = object.goldenRunMethod; + break; + } + break; + case "GOLDEN_RUN_METHOD_UNSPECIFIED": + case 0: + message.goldenRunMethod = 0; + break; + case "STABLE": + case 1: + message.goldenRunMethod = 1; + break; + case "NAIVE": + case 2: + message.goldenRunMethod = 2; + break; + } + switch (object.goldenEvaluationToolCallBehaviour) { + default: + if (typeof object.goldenEvaluationToolCallBehaviour === "number") { + message.goldenEvaluationToolCallBehaviour = object.goldenEvaluationToolCallBehaviour; + break; + } + break; + case "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED": + case 0: + message.goldenEvaluationToolCallBehaviour = 0; + break; + case "REAL": + case 1: + message.goldenEvaluationToolCallBehaviour = 1; + break; + case "FAKE": + case 2: + message.goldenEvaluationToolCallBehaviour = 2; + break; + } + switch (object.scenarioEvaluationToolCallBehaviour) { + default: + if (typeof object.scenarioEvaluationToolCallBehaviour === "number") { + message.scenarioEvaluationToolCallBehaviour = object.scenarioEvaluationToolCallBehaviour; + break; + } + break; + case "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED": + case 0: + message.scenarioEvaluationToolCallBehaviour = 0; + break; + case "REAL": + case 1: + message.scenarioEvaluationToolCallBehaviour = 1; + break; + case "FAKE": + case 2: + message.scenarioEvaluationToolCallBehaviour = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an EvaluationSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @static + * @param {google.cloud.ces.v1beta.EvaluationSettings} message EvaluationSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scenarioConversationInitiator = options.enums === String ? "SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED" : 0; + object.goldenEvaluationToolCallBehaviour = options.enums === String ? "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED" : 0; + object.scenarioEvaluationToolCallBehaviour = options.enums === String ? "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED" : 0; + object.goldenRunMethod = options.enums === String ? "GOLDEN_RUN_METHOD_UNSPECIFIED" : 0; + } + if (message.scenarioConversationInitiator != null && message.hasOwnProperty("scenarioConversationInitiator")) + object.scenarioConversationInitiator = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator[message.scenarioConversationInitiator] === undefined ? message.scenarioConversationInitiator : $root.google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator[message.scenarioConversationInitiator] : message.scenarioConversationInitiator; + if (message.goldenEvaluationToolCallBehaviour != null && message.hasOwnProperty("goldenEvaluationToolCallBehaviour")) + object.goldenEvaluationToolCallBehaviour = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationToolCallBehaviour[message.goldenEvaluationToolCallBehaviour] === undefined ? message.goldenEvaluationToolCallBehaviour : $root.google.cloud.ces.v1beta.EvaluationToolCallBehaviour[message.goldenEvaluationToolCallBehaviour] : message.goldenEvaluationToolCallBehaviour; + if (message.scenarioEvaluationToolCallBehaviour != null && message.hasOwnProperty("scenarioEvaluationToolCallBehaviour")) + object.scenarioEvaluationToolCallBehaviour = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationToolCallBehaviour[message.scenarioEvaluationToolCallBehaviour] === undefined ? message.scenarioEvaluationToolCallBehaviour : $root.google.cloud.ces.v1beta.EvaluationToolCallBehaviour[message.scenarioEvaluationToolCallBehaviour] : message.scenarioEvaluationToolCallBehaviour; + if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) + object.goldenRunMethod = options.enums === String ? $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] === undefined ? message.goldenRunMethod : $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] : message.goldenRunMethod; + return object; + }; + + /** + * Converts this EvaluationSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @instance + * @returns {Object.} JSON object + */ + EvaluationSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationSettings"; + }; + + /** + * ScenarioConversationInitiator enum. + * @name google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator + * @enum {number} + * @property {number} SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED=0 SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED value + * @property {number} USER=1 USER value + * @property {number} AGENT=2 AGENT value + */ + EvaluationSettings.ScenarioConversationInitiator = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER"] = 1; + values[valuesById[2] = "AGENT"] = 2; + return values; + })(); + + return EvaluationSettings; + })(); + + v1beta.ClientCertificateSettings = (function() { + + /** + * Properties of a ClientCertificateSettings. + * @memberof google.cloud.ces.v1beta + * @interface IClientCertificateSettings + * @property {string|null} [tlsCertificate] ClientCertificateSettings tlsCertificate + * @property {string|null} [privateKey] ClientCertificateSettings privateKey + * @property {string|null} [passphrase] ClientCertificateSettings passphrase + */ + + /** + * Constructs a new ClientCertificateSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ClientCertificateSettings. + * @implements IClientCertificateSettings + * @constructor + * @param {google.cloud.ces.v1beta.IClientCertificateSettings=} [properties] Properties to set + */ + function ClientCertificateSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientCertificateSettings tlsCertificate. + * @member {string} tlsCertificate + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @instance + */ + ClientCertificateSettings.prototype.tlsCertificate = ""; + + /** + * ClientCertificateSettings privateKey. + * @member {string} privateKey + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @instance + */ + ClientCertificateSettings.prototype.privateKey = ""; + + /** + * ClientCertificateSettings passphrase. + * @member {string} passphrase + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @instance + */ + ClientCertificateSettings.prototype.passphrase = ""; + + /** + * Creates a new ClientCertificateSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @static + * @param {google.cloud.ces.v1beta.IClientCertificateSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ClientCertificateSettings} ClientCertificateSettings instance + */ + ClientCertificateSettings.create = function create(properties) { + return new ClientCertificateSettings(properties); + }; + + /** + * Encodes the specified ClientCertificateSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ClientCertificateSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @static + * @param {google.cloud.ces.v1beta.IClientCertificateSettings} message ClientCertificateSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientCertificateSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tlsCertificate != null && Object.hasOwnProperty.call(message, "tlsCertificate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tlsCertificate); + if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.privateKey); + if (message.passphrase != null && Object.hasOwnProperty.call(message, "passphrase")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.passphrase); + return writer; + }; + + /** + * Encodes the specified ClientCertificateSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ClientCertificateSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @static + * @param {google.cloud.ces.v1beta.IClientCertificateSettings} message ClientCertificateSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientCertificateSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ClientCertificateSettings} ClientCertificateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientCertificateSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ClientCertificateSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tlsCertificate = reader.string(); + break; + } + case 2: { + message.privateKey = reader.string(); + break; + } + case 3: { + message.passphrase = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ClientCertificateSettings} ClientCertificateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientCertificateSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientCertificateSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientCertificateSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tlsCertificate != null && message.hasOwnProperty("tlsCertificate")) + if (!$util.isString(message.tlsCertificate)) + return "tlsCertificate: string expected"; + if (message.privateKey != null && message.hasOwnProperty("privateKey")) + if (!$util.isString(message.privateKey)) + return "privateKey: string expected"; + if (message.passphrase != null && message.hasOwnProperty("passphrase")) + if (!$util.isString(message.passphrase)) + return "passphrase: string expected"; + return null; + }; + + /** + * Creates a ClientCertificateSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ClientCertificateSettings} ClientCertificateSettings + */ + ClientCertificateSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ClientCertificateSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.ClientCertificateSettings(); + if (object.tlsCertificate != null) + message.tlsCertificate = String(object.tlsCertificate); + if (object.privateKey != null) + message.privateKey = String(object.privateKey); + if (object.passphrase != null) + message.passphrase = String(object.passphrase); + return message; + }; + + /** + * Creates a plain object from a ClientCertificateSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @static + * @param {google.cloud.ces.v1beta.ClientCertificateSettings} message ClientCertificateSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientCertificateSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tlsCertificate = ""; + object.privateKey = ""; + object.passphrase = ""; + } + if (message.tlsCertificate != null && message.hasOwnProperty("tlsCertificate")) + object.tlsCertificate = message.tlsCertificate; + if (message.privateKey != null && message.hasOwnProperty("privateKey")) + object.privateKey = message.privateKey; + if (message.passphrase != null && message.hasOwnProperty("passphrase")) + object.passphrase = message.passphrase; + return object; + }; + + /** + * Converts this ClientCertificateSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @instance + * @returns {Object.} JSON object + */ + ClientCertificateSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientCertificateSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientCertificateSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ClientCertificateSettings"; + }; + + return ClientCertificateSettings; + })(); + + v1beta.ConversationLoggingSettings = (function() { + + /** + * Properties of a ConversationLoggingSettings. + * @memberof google.cloud.ces.v1beta + * @interface IConversationLoggingSettings + * @property {boolean|null} [disableConversationLogging] ConversationLoggingSettings disableConversationLogging + */ + + /** + * Constructs a new ConversationLoggingSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ConversationLoggingSettings. + * @implements IConversationLoggingSettings + * @constructor + * @param {google.cloud.ces.v1beta.IConversationLoggingSettings=} [properties] Properties to set + */ + function ConversationLoggingSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConversationLoggingSettings disableConversationLogging. + * @member {boolean} disableConversationLogging + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @instance + */ + ConversationLoggingSettings.prototype.disableConversationLogging = false; + + /** + * Creates a new ConversationLoggingSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @static + * @param {google.cloud.ces.v1beta.IConversationLoggingSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ConversationLoggingSettings} ConversationLoggingSettings instance + */ + ConversationLoggingSettings.create = function create(properties) { + return new ConversationLoggingSettings(properties); + }; + + /** + * Encodes the specified ConversationLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ConversationLoggingSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @static + * @param {google.cloud.ces.v1beta.IConversationLoggingSettings} message ConversationLoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationLoggingSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disableConversationLogging != null && Object.hasOwnProperty.call(message, "disableConversationLogging")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.disableConversationLogging); + return writer; + }; + + /** + * Encodes the specified ConversationLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ConversationLoggingSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @static + * @param {google.cloud.ces.v1beta.IConversationLoggingSettings} message ConversationLoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationLoggingSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConversationLoggingSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ConversationLoggingSettings} ConversationLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationLoggingSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ConversationLoggingSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.disableConversationLogging = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConversationLoggingSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ConversationLoggingSettings} ConversationLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationLoggingSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConversationLoggingSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConversationLoggingSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disableConversationLogging != null && message.hasOwnProperty("disableConversationLogging")) + if (typeof message.disableConversationLogging !== "boolean") + return "disableConversationLogging: boolean expected"; + return null; + }; + + /** + * Creates a ConversationLoggingSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ConversationLoggingSettings} ConversationLoggingSettings + */ + ConversationLoggingSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ConversationLoggingSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.ConversationLoggingSettings(); + if (object.disableConversationLogging != null) + message.disableConversationLogging = Boolean(object.disableConversationLogging); + return message; + }; + + /** + * Creates a plain object from a ConversationLoggingSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @static + * @param {google.cloud.ces.v1beta.ConversationLoggingSettings} message ConversationLoggingSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConversationLoggingSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.disableConversationLogging = false; + if (message.disableConversationLogging != null && message.hasOwnProperty("disableConversationLogging")) + object.disableConversationLogging = message.disableConversationLogging; + return object; + }; + + /** + * Converts this ConversationLoggingSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @instance + * @returns {Object.} JSON object + */ + ConversationLoggingSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConversationLoggingSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConversationLoggingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ConversationLoggingSettings"; + }; + + return ConversationLoggingSettings; + })(); + + v1beta.CloudLoggingSettings = (function() { + + /** + * Properties of a CloudLoggingSettings. + * @memberof google.cloud.ces.v1beta + * @interface ICloudLoggingSettings + * @property {boolean|null} [enableCloudLogging] CloudLoggingSettings enableCloudLogging + */ + + /** + * Constructs a new CloudLoggingSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CloudLoggingSettings. + * @implements ICloudLoggingSettings + * @constructor + * @param {google.cloud.ces.v1beta.ICloudLoggingSettings=} [properties] Properties to set + */ + function CloudLoggingSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudLoggingSettings enableCloudLogging. + * @member {boolean} enableCloudLogging + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @instance + */ + CloudLoggingSettings.prototype.enableCloudLogging = false; + + /** + * Creates a new CloudLoggingSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @static + * @param {google.cloud.ces.v1beta.ICloudLoggingSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CloudLoggingSettings} CloudLoggingSettings instance + */ + CloudLoggingSettings.create = function create(properties) { + return new CloudLoggingSettings(properties); + }; + + /** + * Encodes the specified CloudLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.CloudLoggingSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @static + * @param {google.cloud.ces.v1beta.ICloudLoggingSettings} message CloudLoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudLoggingSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableCloudLogging != null && Object.hasOwnProperty.call(message, "enableCloudLogging")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableCloudLogging); + return writer; + }; + + /** + * Encodes the specified CloudLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CloudLoggingSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @static + * @param {google.cloud.ces.v1beta.ICloudLoggingSettings} message CloudLoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudLoggingSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudLoggingSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CloudLoggingSettings} CloudLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudLoggingSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CloudLoggingSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableCloudLogging = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudLoggingSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CloudLoggingSettings} CloudLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudLoggingSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudLoggingSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudLoggingSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableCloudLogging != null && message.hasOwnProperty("enableCloudLogging")) + if (typeof message.enableCloudLogging !== "boolean") + return "enableCloudLogging: boolean expected"; + return null; + }; + + /** + * Creates a CloudLoggingSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CloudLoggingSettings} CloudLoggingSettings + */ + CloudLoggingSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CloudLoggingSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.CloudLoggingSettings(); + if (object.enableCloudLogging != null) + message.enableCloudLogging = Boolean(object.enableCloudLogging); + return message; + }; + + /** + * Creates a plain object from a CloudLoggingSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @static + * @param {google.cloud.ces.v1beta.CloudLoggingSettings} message CloudLoggingSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudLoggingSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableCloudLogging = false; + if (message.enableCloudLogging != null && message.hasOwnProperty("enableCloudLogging")) + object.enableCloudLogging = message.enableCloudLogging; + return object; + }; + + /** + * Converts this CloudLoggingSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @instance + * @returns {Object.} JSON object + */ + CloudLoggingSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudLoggingSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudLoggingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CloudLoggingSettings"; + }; + + return CloudLoggingSettings; + })(); + + v1beta.AudioRecordingConfig = (function() { + + /** + * Properties of an AudioRecordingConfig. + * @memberof google.cloud.ces.v1beta + * @interface IAudioRecordingConfig + * @property {string|null} [gcsBucket] AudioRecordingConfig gcsBucket + * @property {string|null} [gcsPathPrefix] AudioRecordingConfig gcsPathPrefix + */ + + /** + * Constructs a new AudioRecordingConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an AudioRecordingConfig. + * @implements IAudioRecordingConfig + * @constructor + * @param {google.cloud.ces.v1beta.IAudioRecordingConfig=} [properties] Properties to set + */ + function AudioRecordingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AudioRecordingConfig gcsBucket. + * @member {string} gcsBucket + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @instance + */ + AudioRecordingConfig.prototype.gcsBucket = ""; + + /** + * AudioRecordingConfig gcsPathPrefix. + * @member {string} gcsPathPrefix + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @instance + */ + AudioRecordingConfig.prototype.gcsPathPrefix = ""; + + /** + * Creates a new AudioRecordingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @static + * @param {google.cloud.ces.v1beta.IAudioRecordingConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AudioRecordingConfig} AudioRecordingConfig instance + */ + AudioRecordingConfig.create = function create(properties) { + return new AudioRecordingConfig(properties); + }; + + /** + * Encodes the specified AudioRecordingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.AudioRecordingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @static + * @param {google.cloud.ces.v1beta.IAudioRecordingConfig} message AudioRecordingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioRecordingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsBucket != null && Object.hasOwnProperty.call(message, "gcsBucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsBucket); + if (message.gcsPathPrefix != null && Object.hasOwnProperty.call(message, "gcsPathPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsPathPrefix); + return writer; + }; + + /** + * Encodes the specified AudioRecordingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AudioRecordingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @static + * @param {google.cloud.ces.v1beta.IAudioRecordingConfig} message AudioRecordingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioRecordingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AudioRecordingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AudioRecordingConfig} AudioRecordingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioRecordingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AudioRecordingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsBucket = reader.string(); + break; + } + case 2: { + message.gcsPathPrefix = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AudioRecordingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AudioRecordingConfig} AudioRecordingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioRecordingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AudioRecordingConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AudioRecordingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + if (!$util.isString(message.gcsBucket)) + return "gcsBucket: string expected"; + if (message.gcsPathPrefix != null && message.hasOwnProperty("gcsPathPrefix")) + if (!$util.isString(message.gcsPathPrefix)) + return "gcsPathPrefix: string expected"; + return null; + }; + + /** + * Creates an AudioRecordingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AudioRecordingConfig} AudioRecordingConfig + */ + AudioRecordingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AudioRecordingConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.AudioRecordingConfig(); + if (object.gcsBucket != null) + message.gcsBucket = String(object.gcsBucket); + if (object.gcsPathPrefix != null) + message.gcsPathPrefix = String(object.gcsPathPrefix); + return message; + }; + + /** + * Creates a plain object from an AudioRecordingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @static + * @param {google.cloud.ces.v1beta.AudioRecordingConfig} message AudioRecordingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AudioRecordingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsBucket = ""; + object.gcsPathPrefix = ""; + } + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + object.gcsBucket = message.gcsBucket; + if (message.gcsPathPrefix != null && message.hasOwnProperty("gcsPathPrefix")) + object.gcsPathPrefix = message.gcsPathPrefix; + return object; + }; + + /** + * Converts this AudioRecordingConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @instance + * @returns {Object.} JSON object + */ + AudioRecordingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AudioRecordingConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AudioRecordingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AudioRecordingConfig"; + }; + + return AudioRecordingConfig; + })(); + + v1beta.RedactionConfig = (function() { + + /** + * Properties of a RedactionConfig. + * @memberof google.cloud.ces.v1beta + * @interface IRedactionConfig + * @property {boolean|null} [enableRedaction] RedactionConfig enableRedaction + * @property {string|null} [inspectTemplate] RedactionConfig inspectTemplate + * @property {string|null} [deidentifyTemplate] RedactionConfig deidentifyTemplate + */ + + /** + * Constructs a new RedactionConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RedactionConfig. + * @implements IRedactionConfig + * @constructor + * @param {google.cloud.ces.v1beta.IRedactionConfig=} [properties] Properties to set + */ + function RedactionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RedactionConfig enableRedaction. + * @member {boolean} enableRedaction + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @instance + */ + RedactionConfig.prototype.enableRedaction = false; + + /** + * RedactionConfig inspectTemplate. + * @member {string} inspectTemplate + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @instance + */ + RedactionConfig.prototype.inspectTemplate = ""; + + /** + * RedactionConfig deidentifyTemplate. + * @member {string} deidentifyTemplate + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @instance + */ + RedactionConfig.prototype.deidentifyTemplate = ""; + + /** + * Creates a new RedactionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @static + * @param {google.cloud.ces.v1beta.IRedactionConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RedactionConfig} RedactionConfig instance + */ + RedactionConfig.create = function create(properties) { + return new RedactionConfig(properties); + }; + + /** + * Encodes the specified RedactionConfig message. Does not implicitly {@link google.cloud.ces.v1beta.RedactionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @static + * @param {google.cloud.ces.v1beta.IRedactionConfig} message RedactionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedactionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableRedaction != null && Object.hasOwnProperty.call(message, "enableRedaction")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableRedaction); + if (message.inspectTemplate != null && Object.hasOwnProperty.call(message, "inspectTemplate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inspectTemplate); + if (message.deidentifyTemplate != null && Object.hasOwnProperty.call(message, "deidentifyTemplate")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deidentifyTemplate); + return writer; + }; + + /** + * Encodes the specified RedactionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RedactionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @static + * @param {google.cloud.ces.v1beta.IRedactionConfig} message RedactionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedactionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RedactionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RedactionConfig} RedactionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedactionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RedactionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableRedaction = reader.bool(); + break; + } + case 2: { + message.inspectTemplate = reader.string(); + break; + } + case 3: { + message.deidentifyTemplate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RedactionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RedactionConfig} RedactionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedactionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RedactionConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedactionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableRedaction != null && message.hasOwnProperty("enableRedaction")) + if (typeof message.enableRedaction !== "boolean") + return "enableRedaction: boolean expected"; + if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) + if (!$util.isString(message.inspectTemplate)) + return "inspectTemplate: string expected"; + if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) + if (!$util.isString(message.deidentifyTemplate)) + return "deidentifyTemplate: string expected"; + return null; + }; + + /** + * Creates a RedactionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RedactionConfig} RedactionConfig + */ + RedactionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RedactionConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.RedactionConfig(); + if (object.enableRedaction != null) + message.enableRedaction = Boolean(object.enableRedaction); + if (object.inspectTemplate != null) + message.inspectTemplate = String(object.inspectTemplate); + if (object.deidentifyTemplate != null) + message.deidentifyTemplate = String(object.deidentifyTemplate); + return message; + }; + + /** + * Creates a plain object from a RedactionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @static + * @param {google.cloud.ces.v1beta.RedactionConfig} message RedactionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedactionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableRedaction = false; + object.inspectTemplate = ""; + object.deidentifyTemplate = ""; + } + if (message.enableRedaction != null && message.hasOwnProperty("enableRedaction")) + object.enableRedaction = message.enableRedaction; + if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) + object.inspectTemplate = message.inspectTemplate; + if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) + object.deidentifyTemplate = message.deidentifyTemplate; + return object; + }; + + /** + * Converts this RedactionConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @instance + * @returns {Object.} JSON object + */ + RedactionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RedactionConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RedactionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RedactionConfig"; + }; + + return RedactionConfig; + })(); + + v1beta.DataStoreSettings = (function() { + + /** + * Properties of a DataStoreSettings. + * @memberof google.cloud.ces.v1beta + * @interface IDataStoreSettings + * @property {Array.|null} [engines] DataStoreSettings engines + */ + + /** + * Constructs a new DataStoreSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DataStoreSettings. + * @implements IDataStoreSettings + * @constructor + * @param {google.cloud.ces.v1beta.IDataStoreSettings=} [properties] Properties to set + */ + function DataStoreSettings(properties) { + this.engines = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStoreSettings engines. + * @member {Array.} engines + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @instance + */ + DataStoreSettings.prototype.engines = $util.emptyArray; + + /** + * Creates a new DataStoreSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @static + * @param {google.cloud.ces.v1beta.IDataStoreSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreSettings} DataStoreSettings instance + */ + DataStoreSettings.create = function create(properties) { + return new DataStoreSettings(properties); + }; + + /** + * Encodes the specified DataStoreSettings message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @static + * @param {google.cloud.ces.v1beta.IDataStoreSettings} message DataStoreSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.engines != null && message.engines.length) + for (var i = 0; i < message.engines.length; ++i) + $root.google.cloud.ces.v1beta.DataStoreSettings.Engine.encode(message.engines[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataStoreSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @static + * @param {google.cloud.ces.v1beta.IDataStoreSettings} message DataStoreSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStoreSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreSettings} DataStoreSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + if (!(message.engines && message.engines.length)) + message.engines = []; + message.engines.push($root.google.cloud.ces.v1beta.DataStoreSettings.Engine.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataStoreSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreSettings} DataStoreSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStoreSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStoreSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.engines != null && message.hasOwnProperty("engines")) { + if (!Array.isArray(message.engines)) + return "engines: array expected"; + for (var i = 0; i < message.engines.length; ++i) { + var error = $root.google.cloud.ces.v1beta.DataStoreSettings.Engine.verify(message.engines[i]); + if (error) + return "engines." + error; + } + } + return null; + }; + + /** + * Creates a DataStoreSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreSettings} DataStoreSettings + */ + DataStoreSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreSettings(); + if (object.engines) { + if (!Array.isArray(object.engines)) + throw TypeError(".google.cloud.ces.v1beta.DataStoreSettings.engines: array expected"); + message.engines = []; + for (var i = 0; i < object.engines.length; ++i) { + if (typeof object.engines[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreSettings.engines: object expected"); + message.engines[i] = $root.google.cloud.ces.v1beta.DataStoreSettings.Engine.fromObject(object.engines[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DataStoreSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @static + * @param {google.cloud.ces.v1beta.DataStoreSettings} message DataStoreSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStoreSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.engines = []; + if (message.engines && message.engines.length) { + object.engines = []; + for (var j = 0; j < message.engines.length; ++j) + object.engines[j] = $root.google.cloud.ces.v1beta.DataStoreSettings.Engine.toObject(message.engines[j], options); + } + return object; + }; + + /** + * Converts this DataStoreSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @instance + * @returns {Object.} JSON object + */ + DataStoreSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStoreSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStoreSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreSettings"; + }; + + DataStoreSettings.Engine = (function() { + + /** + * Properties of an Engine. + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @interface IEngine + * @property {string|null} [name] Engine name + * @property {google.cloud.ces.v1beta.DataStoreSettings.Engine.Type|null} [type] Engine type + */ + + /** + * Constructs a new Engine. + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @classdesc Represents an Engine. + * @implements IEngine + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreSettings.IEngine=} [properties] Properties to set + */ + function Engine(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Engine name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @instance + */ + Engine.prototype.name = ""; + + /** + * Engine type. + * @member {google.cloud.ces.v1beta.DataStoreSettings.Engine.Type} type + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @instance + */ + Engine.prototype.type = 0; + + /** + * Creates a new Engine instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @static + * @param {google.cloud.ces.v1beta.DataStoreSettings.IEngine=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreSettings.Engine} Engine instance + */ + Engine.create = function create(properties) { + return new Engine(properties); + }; + + /** + * Encodes the specified Engine message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.Engine.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @static + * @param {google.cloud.ces.v1beta.DataStoreSettings.IEngine} message Engine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Engine.encode = function encode(message, writer) { + if (!writer) + 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 0 =*/16).int32(message.type); + return writer; + }; + + /** + * Encodes the specified Engine message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.Engine.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @static + * @param {google.cloud.ces.v1beta.DataStoreSettings.IEngine} message Engine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Engine.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Engine message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreSettings.Engine} Engine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Engine.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreSettings.Engine(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Engine message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreSettings.Engine} Engine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Engine.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Engine message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Engine.verify = function verify(message) { + if (typeof message !== "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")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Engine message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreSettings.Engine} Engine + */ + Engine.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreSettings.Engine) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreSettings.Engine(); + if (object.name != null) + message.name = String(object.name); + 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 "ENGINE_TYPE_SEARCH": + case 1: + message.type = 1; + break; + case "ENGINE_TYPE_CHAT": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Engine message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @static + * @param {google.cloud.ces.v1beta.DataStoreSettings.Engine} message Engine + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Engine.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.ces.v1beta.DataStoreSettings.Engine.Type[message.type] === undefined ? message.type : $root.google.cloud.ces.v1beta.DataStoreSettings.Engine.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this Engine to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @instance + * @returns {Object.} JSON object + */ + Engine.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Engine + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Engine.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreSettings.Engine"; + }; + + /** + * Type enum. + * @name google.cloud.ces.v1beta.DataStoreSettings.Engine.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ENGINE_TYPE_SEARCH=1 ENGINE_TYPE_SEARCH value + * @property {number} ENGINE_TYPE_CHAT=2 ENGINE_TYPE_CHAT value + */ + Engine.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENGINE_TYPE_SEARCH"] = 1; + values[valuesById[2] = "ENGINE_TYPE_CHAT"] = 2; + return values; + })(); + + return Engine; + })(); + + return DataStoreSettings; + })(); + + v1beta.EvaluationPersona = (function() { + + /** + * Properties of an EvaluationPersona. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluationPersona + * @property {string|null} [name] EvaluationPersona name + * @property {string|null} [description] EvaluationPersona description + * @property {string|null} [displayName] EvaluationPersona displayName + * @property {string|null} [personality] EvaluationPersona personality + * @property {google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig|null} [speechConfig] EvaluationPersona speechConfig + */ + + /** + * Constructs a new EvaluationPersona. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationPersona. + * @implements IEvaluationPersona + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluationPersona=} [properties] Properties to set + */ + function EvaluationPersona(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationPersona name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @instance + */ + EvaluationPersona.prototype.name = ""; + + /** + * EvaluationPersona description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @instance + */ + EvaluationPersona.prototype.description = ""; + + /** + * EvaluationPersona displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @instance + */ + EvaluationPersona.prototype.displayName = ""; + + /** + * EvaluationPersona personality. + * @member {string} personality + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @instance + */ + EvaluationPersona.prototype.personality = ""; + + /** + * EvaluationPersona speechConfig. + * @member {google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig|null|undefined} speechConfig + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @instance + */ + EvaluationPersona.prototype.speechConfig = null; + + /** + * Creates a new EvaluationPersona instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @static + * @param {google.cloud.ces.v1beta.IEvaluationPersona=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationPersona} EvaluationPersona instance + */ + EvaluationPersona.create = function create(properties) { + return new EvaluationPersona(properties); + }; + + /** + * Encodes the specified EvaluationPersona message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @static + * @param {google.cloud.ces.v1beta.IEvaluationPersona} message EvaluationPersona message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationPersona.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.personality != null && Object.hasOwnProperty.call(message, "personality")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.personality); + if (message.speechConfig != null && Object.hasOwnProperty.call(message, "speechConfig")) + $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.encode(message.speechConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluationPersona message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @static + * @param {google.cloud.ces.v1beta.IEvaluationPersona} message EvaluationPersona message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationPersona.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationPersona message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationPersona} EvaluationPersona + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationPersona.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationPersona(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.personality = reader.string(); + break; + } + case 5: { + message.speechConfig = $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationPersona message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationPersona} EvaluationPersona + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationPersona.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationPersona message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationPersona.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.personality != null && message.hasOwnProperty("personality")) + if (!$util.isString(message.personality)) + return "personality: string expected"; + if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) { + var error = $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.verify(message.speechConfig); + if (error) + return "speechConfig." + error; + } + return null; + }; + + /** + * Creates an EvaluationPersona message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationPersona} EvaluationPersona + */ + EvaluationPersona.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationPersona) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationPersona(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.personality != null) + message.personality = String(object.personality); + if (object.speechConfig != null) { + if (typeof object.speechConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationPersona.speechConfig: object expected"); + message.speechConfig = $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.fromObject(object.speechConfig); + } + return message; + }; + + /** + * Creates a plain object from an EvaluationPersona message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @static + * @param {google.cloud.ces.v1beta.EvaluationPersona} message EvaluationPersona + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationPersona.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.displayName = ""; + object.personality = ""; + object.speechConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.personality != null && message.hasOwnProperty("personality")) + object.personality = message.personality; + if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) + object.speechConfig = $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.toObject(message.speechConfig, options); + return object; + }; + + /** + * Converts this EvaluationPersona to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @instance + * @returns {Object.} JSON object + */ + EvaluationPersona.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationPersona + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationPersona.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationPersona"; + }; + + EvaluationPersona.SpeechConfig = (function() { + + /** + * Properties of a SpeechConfig. + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @interface ISpeechConfig + * @property {number|null} [speakingRate] SpeechConfig speakingRate + * @property {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment|null} [environment] SpeechConfig environment + * @property {string|null} [voiceId] SpeechConfig voiceId + */ + + /** + * Constructs a new SpeechConfig. + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @classdesc Represents a SpeechConfig. + * @implements ISpeechConfig + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig=} [properties] Properties to set + */ + function SpeechConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechConfig speakingRate. + * @member {number} speakingRate + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @instance + */ + SpeechConfig.prototype.speakingRate = 0; + + /** + * SpeechConfig environment. + * @member {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment} environment + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @instance + */ + SpeechConfig.prototype.environment = 0; + + /** + * SpeechConfig voiceId. + * @member {string} voiceId + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @instance + */ + SpeechConfig.prototype.voiceId = ""; + + /** + * Creates a new SpeechConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @static + * @param {google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig} SpeechConfig instance + */ + SpeechConfig.create = function create(properties) { + return new SpeechConfig(properties); + }; + + /** + * Encodes the specified SpeechConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @static + * @param {google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig} message SpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speakingRate != null && Object.hasOwnProperty.call(message, "speakingRate")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.speakingRate); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.environment); + if (message.voiceId != null && Object.hasOwnProperty.call(message, "voiceId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.voiceId); + return writer; + }; + + /** + * Encodes the specified SpeechConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @static + * @param {google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig} message SpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig} SpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.speakingRate = reader.double(); + break; + } + case 2: { + message.environment = reader.int32(); + break; + } + case 3: { + message.voiceId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig} SpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) + if (typeof message.speakingRate !== "number") + return "speakingRate: number expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + switch (message.environment) { + default: + return "environment: enum value expected"; + case 0: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.voiceId != null && message.hasOwnProperty("voiceId")) + if (!$util.isString(message.voiceId)) + return "voiceId: string expected"; + return null; + }; + + /** + * Creates a SpeechConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig} SpeechConfig + */ + SpeechConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig(); + if (object.speakingRate != null) + message.speakingRate = Number(object.speakingRate); + switch (object.environment) { + default: + if (typeof object.environment === "number") { + message.environment = object.environment; + break; + } + break; + case "BACKGROUND_ENVIRONMENT_UNSPECIFIED": + case 0: + message.environment = 0; + break; + case "CALL_CENTER": + case 3: + message.environment = 3; + break; + case "TRAFFIC": + case 4: + message.environment = 4; + break; + case "KIDS_NOISE": + case 5: + message.environment = 5; + break; + case "CAFE": + case 6: + message.environment = 6; + break; + } + if (object.voiceId != null) + message.voiceId = String(object.voiceId); + return message; + }; + + /** + * Creates a plain object from a SpeechConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @static + * @param {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig} message SpeechConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.speakingRate = 0; + object.environment = options.enums === String ? "BACKGROUND_ENVIRONMENT_UNSPECIFIED" : 0; + object.voiceId = ""; + } + if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) + object.speakingRate = options.json && !isFinite(message.speakingRate) ? String(message.speakingRate) : message.speakingRate; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment[message.environment] === undefined ? message.environment : $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment[message.environment] : message.environment; + if (message.voiceId != null && message.hasOwnProperty("voiceId")) + object.voiceId = message.voiceId; + return object; + }; + + /** + * Converts this SpeechConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @instance + * @returns {Object.} JSON object + */ + SpeechConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig"; + }; + + /** + * BackgroundEnvironment enum. + * @name google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment + * @enum {number} + * @property {number} BACKGROUND_ENVIRONMENT_UNSPECIFIED=0 BACKGROUND_ENVIRONMENT_UNSPECIFIED value + * @property {number} CALL_CENTER=3 CALL_CENTER value + * @property {number} TRAFFIC=4 TRAFFIC value + * @property {number} KIDS_NOISE=5 KIDS_NOISE value + * @property {number} CAFE=6 CAFE value + */ + SpeechConfig.BackgroundEnvironment = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BACKGROUND_ENVIRONMENT_UNSPECIFIED"] = 0; + values[valuesById[3] = "CALL_CENTER"] = 3; + values[valuesById[4] = "TRAFFIC"] = 4; + values[valuesById[5] = "KIDS_NOISE"] = 5; + values[valuesById[6] = "CAFE"] = 6; + return values; + })(); + + return SpeechConfig; + })(); + + return EvaluationPersona; + })(); + + v1beta.BigQueryExportSettings = (function() { + + /** + * Properties of a BigQueryExportSettings. + * @memberof google.cloud.ces.v1beta + * @interface IBigQueryExportSettings + * @property {boolean|null} [enabled] BigQueryExportSettings enabled + * @property {string|null} [project] BigQueryExportSettings project + * @property {string|null} [dataset] BigQueryExportSettings dataset + */ + + /** + * Constructs a new BigQueryExportSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a BigQueryExportSettings. + * @implements IBigQueryExportSettings + * @constructor + * @param {google.cloud.ces.v1beta.IBigQueryExportSettings=} [properties] Properties to set + */ + function BigQueryExportSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQueryExportSettings enabled. + * @member {boolean} enabled + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @instance + */ + BigQueryExportSettings.prototype.enabled = false; + + /** + * BigQueryExportSettings project. + * @member {string} project + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @instance + */ + BigQueryExportSettings.prototype.project = ""; + + /** + * BigQueryExportSettings dataset. + * @member {string} dataset + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @instance + */ + BigQueryExportSettings.prototype.dataset = ""; + + /** + * Creates a new BigQueryExportSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @static + * @param {google.cloud.ces.v1beta.IBigQueryExportSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.BigQueryExportSettings} BigQueryExportSettings instance + */ + BigQueryExportSettings.create = function create(properties) { + return new BigQueryExportSettings(properties); + }; + + /** + * Encodes the specified BigQueryExportSettings message. Does not implicitly {@link google.cloud.ces.v1beta.BigQueryExportSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @static + * @param {google.cloud.ces.v1beta.IBigQueryExportSettings} message BigQueryExportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryExportSettings.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.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dataset); + return writer; + }; + + /** + * Encodes the specified BigQueryExportSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BigQueryExportSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @static + * @param {google.cloud.ces.v1beta.IBigQueryExportSettings} message BigQueryExportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryExportSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryExportSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.BigQueryExportSettings} BigQueryExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryExportSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BigQueryExportSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + message.project = reader.string(); + break; + } + case 3: { + message.dataset = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryExportSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.BigQueryExportSettings} BigQueryExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryExportSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryExportSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryExportSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + return null; + }; + + /** + * Creates a BigQueryExportSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.BigQueryExportSettings} BigQueryExportSettings + */ + BigQueryExportSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.BigQueryExportSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.BigQueryExportSettings(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.project != null) + message.project = String(object.project); + if (object.dataset != null) + message.dataset = String(object.dataset); + return message; + }; + + /** + * Creates a plain object from a BigQueryExportSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @static + * @param {google.cloud.ces.v1beta.BigQueryExportSettings} message BigQueryExportSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryExportSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enabled = false; + object.project = ""; + object.dataset = ""; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + return object; + }; + + /** + * Converts this BigQueryExportSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @instance + * @returns {Object.} JSON object + */ + BigQueryExportSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryExportSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryExportSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.BigQueryExportSettings"; + }; + + return BigQueryExportSettings; + })(); + + /** + * EvaluationToolCallBehaviour enum. + * @name google.cloud.ces.v1beta.EvaluationToolCallBehaviour + * @enum {number} + * @property {number} EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED=0 EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED value + * @property {number} REAL=1 REAL value + * @property {number} FAKE=2 FAKE value + */ + v1beta.EvaluationToolCallBehaviour = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED"] = 0; + values[valuesById[1] = "REAL"] = 1; + values[valuesById[2] = "FAKE"] = 2; + return values; + })(); + + v1beta.CodeBlock = (function() { + + /** + * Properties of a CodeBlock. + * @memberof google.cloud.ces.v1beta + * @interface ICodeBlock + * @property {string|null} [pythonCode] CodeBlock pythonCode + */ + + /** + * Constructs a new CodeBlock. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CodeBlock. + * @implements ICodeBlock + * @constructor + * @param {google.cloud.ces.v1beta.ICodeBlock=} [properties] Properties to set + */ + function CodeBlock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CodeBlock pythonCode. + * @member {string} pythonCode + * @memberof google.cloud.ces.v1beta.CodeBlock + * @instance + */ + CodeBlock.prototype.pythonCode = ""; + + /** + * Creates a new CodeBlock instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CodeBlock + * @static + * @param {google.cloud.ces.v1beta.ICodeBlock=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CodeBlock} CodeBlock instance + */ + CodeBlock.create = function create(properties) { + return new CodeBlock(properties); + }; + + /** + * Encodes the specified CodeBlock message. Does not implicitly {@link google.cloud.ces.v1beta.CodeBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CodeBlock + * @static + * @param {google.cloud.ces.v1beta.ICodeBlock} message CodeBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pythonCode); + return writer; + }; + + /** + * Encodes the specified CodeBlock message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CodeBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CodeBlock + * @static + * @param {google.cloud.ces.v1beta.ICodeBlock} message CodeBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CodeBlock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CodeBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CodeBlock} CodeBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeBlock.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CodeBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pythonCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CodeBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CodeBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CodeBlock} CodeBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CodeBlock message. + * @function verify + * @memberof google.cloud.ces.v1beta.CodeBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CodeBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) + if (!$util.isString(message.pythonCode)) + return "pythonCode: string expected"; + return null; + }; + + /** + * Creates a CodeBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CodeBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CodeBlock} CodeBlock + */ + CodeBlock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CodeBlock) + return object; + var message = new $root.google.cloud.ces.v1beta.CodeBlock(); + if (object.pythonCode != null) + message.pythonCode = String(object.pythonCode); + return message; + }; + + /** + * Creates a plain object from a CodeBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CodeBlock + * @static + * @param {google.cloud.ces.v1beta.CodeBlock} message CodeBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CodeBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.pythonCode = ""; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) + object.pythonCode = message.pythonCode; + return object; + }; + + /** + * Converts this CodeBlock to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CodeBlock + * @instance + * @returns {Object.} JSON object + */ + CodeBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CodeBlock + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CodeBlock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CodeBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CodeBlock"; + }; + + return CodeBlock; + })(); + + v1beta.ToolFakeConfig = (function() { + + /** + * Properties of a ToolFakeConfig. + * @memberof google.cloud.ces.v1beta + * @interface IToolFakeConfig + * @property {google.cloud.ces.v1beta.ICodeBlock|null} [codeBlock] ToolFakeConfig codeBlock + * @property {boolean|null} [enableFakeMode] ToolFakeConfig enableFakeMode + */ + + /** + * Constructs a new ToolFakeConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ToolFakeConfig. + * @implements IToolFakeConfig + * @constructor + * @param {google.cloud.ces.v1beta.IToolFakeConfig=} [properties] Properties to set + */ + function ToolFakeConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolFakeConfig codeBlock. + * @member {google.cloud.ces.v1beta.ICodeBlock|null|undefined} codeBlock + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @instance + */ + ToolFakeConfig.prototype.codeBlock = null; + + /** + * ToolFakeConfig enableFakeMode. + * @member {boolean} enableFakeMode + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @instance + */ + ToolFakeConfig.prototype.enableFakeMode = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ToolFakeConfig toolResponse. + * @member {"codeBlock"|undefined} toolResponse + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @instance + */ + Object.defineProperty(ToolFakeConfig.prototype, "toolResponse", { + get: $util.oneOfGetter($oneOfFields = ["codeBlock"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ToolFakeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @static + * @param {google.cloud.ces.v1beta.IToolFakeConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ToolFakeConfig} ToolFakeConfig instance + */ + ToolFakeConfig.create = function create(properties) { + return new ToolFakeConfig(properties); + }; + + /** + * Encodes the specified ToolFakeConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ToolFakeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @static + * @param {google.cloud.ces.v1beta.IToolFakeConfig} message ToolFakeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolFakeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.codeBlock != null && Object.hasOwnProperty.call(message, "codeBlock")) + $root.google.cloud.ces.v1beta.CodeBlock.encode(message.codeBlock, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.enableFakeMode != null && Object.hasOwnProperty.call(message, "enableFakeMode")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableFakeMode); + return writer; + }; + + /** + * Encodes the specified ToolFakeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolFakeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @static + * @param {google.cloud.ces.v1beta.IToolFakeConfig} message ToolFakeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolFakeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolFakeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ToolFakeConfig} ToolFakeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolFakeConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ToolFakeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.codeBlock = $root.google.cloud.ces.v1beta.CodeBlock.decode(reader, reader.uint32()); + break; + } + case 2: { + message.enableFakeMode = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolFakeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ToolFakeConfig} ToolFakeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolFakeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolFakeConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolFakeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.codeBlock != null && message.hasOwnProperty("codeBlock")) { + properties.toolResponse = 1; + { + var error = $root.google.cloud.ces.v1beta.CodeBlock.verify(message.codeBlock); + if (error) + return "codeBlock." + error; + } + } + if (message.enableFakeMode != null && message.hasOwnProperty("enableFakeMode")) + if (typeof message.enableFakeMode !== "boolean") + return "enableFakeMode: boolean expected"; + return null; + }; + + /** + * Creates a ToolFakeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ToolFakeConfig} ToolFakeConfig + */ + ToolFakeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ToolFakeConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.ToolFakeConfig(); + if (object.codeBlock != null) { + if (typeof object.codeBlock !== "object") + throw TypeError(".google.cloud.ces.v1beta.ToolFakeConfig.codeBlock: object expected"); + message.codeBlock = $root.google.cloud.ces.v1beta.CodeBlock.fromObject(object.codeBlock); + } + if (object.enableFakeMode != null) + message.enableFakeMode = Boolean(object.enableFakeMode); + return message; + }; + + /** + * Creates a plain object from a ToolFakeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @static + * @param {google.cloud.ces.v1beta.ToolFakeConfig} message ToolFakeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolFakeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableFakeMode = false; + if (message.codeBlock != null && message.hasOwnProperty("codeBlock")) { + object.codeBlock = $root.google.cloud.ces.v1beta.CodeBlock.toObject(message.codeBlock, options); + if (options.oneofs) + object.toolResponse = "codeBlock"; + } + if (message.enableFakeMode != null && message.hasOwnProperty("enableFakeMode")) + object.enableFakeMode = message.enableFakeMode; + return object; + }; + + /** + * Converts this ToolFakeConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @instance + * @returns {Object.} JSON object + */ + ToolFakeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolFakeConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolFakeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ToolFakeConfig"; + }; + + return ToolFakeConfig; + })(); + + /** + * GoldenRunMethod enum. + * @name google.cloud.ces.v1beta.GoldenRunMethod + * @enum {number} + * @property {number} GOLDEN_RUN_METHOD_UNSPECIFIED=0 GOLDEN_RUN_METHOD_UNSPECIFIED value + * @property {number} STABLE=1 STABLE value + * @property {number} NAIVE=2 NAIVE value + */ + v1beta.GoldenRunMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GOLDEN_RUN_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "STABLE"] = 1; + values[valuesById[2] = "NAIVE"] = 2; + return values; + })(); + + v1beta.Schema = (function() { + + /** + * Properties of a Schema. + * @memberof google.cloud.ces.v1beta + * @interface ISchema + * @property {google.cloud.ces.v1beta.Schema.Type|null} [type] Schema type + * @property {Object.|null} [properties] Schema properties + * @property {Array.|null} [required] Schema required + * @property {string|null} [description] Schema description + * @property {google.cloud.ces.v1beta.ISchema|null} [items] Schema items + * @property {boolean|null} [nullable] Schema nullable + * @property {boolean|null} [uniqueItems] Schema uniqueItems + * @property {Array.|null} [prefixItems] Schema prefixItems + * @property {google.cloud.ces.v1beta.ISchema|null} [additionalProperties] Schema additionalProperties + * @property {Array.|null} [anyOf] Schema anyOf + * @property {Array.|null} ["enum"] Schema enum + * @property {google.protobuf.IValue|null} ["default"] Schema default + * @property {string|null} [ref] Schema ref + * @property {Object.|null} [defs] Schema defs + * @property {string|null} [title] Schema title + * @property {number|Long|null} [minItems] Schema minItems + * @property {number|Long|null} [maxItems] Schema maxItems + * @property {number|null} [minimum] Schema minimum + * @property {number|null} [maximum] Schema maximum + */ + + /** + * Constructs a new Schema. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Schema. + * @implements ISchema + * @constructor + * @param {google.cloud.ces.v1beta.ISchema=} [properties] Properties to set + */ + function Schema(properties) { + this.properties = {}; + this.required = []; + this.prefixItems = []; + this.anyOf = []; + this["enum"] = []; + this.defs = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Schema type. + * @member {google.cloud.ces.v1beta.Schema.Type} type + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.type = 0; + + /** + * Schema properties. + * @member {Object.} properties + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.properties = $util.emptyObject; + + /** + * Schema required. + * @member {Array.} required + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.required = $util.emptyArray; + + /** + * Schema description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.description = ""; + + /** + * Schema items. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} items + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.items = null; + + /** + * Schema nullable. + * @member {boolean} nullable + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.nullable = false; + + /** + * Schema uniqueItems. + * @member {boolean} uniqueItems + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.uniqueItems = false; + + /** + * Schema prefixItems. + * @member {Array.} prefixItems + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.prefixItems = $util.emptyArray; + + /** + * Schema additionalProperties. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} additionalProperties + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.additionalProperties = null; + + /** + * Schema anyOf. + * @member {Array.} anyOf + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.anyOf = $util.emptyArray; + + /** + * Schema enum. + * @member {Array.} enum + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype["enum"] = $util.emptyArray; + + /** + * Schema default. + * @member {google.protobuf.IValue|null|undefined} default + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype["default"] = null; + + /** + * Schema ref. + * @member {string} ref + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.ref = ""; + + /** + * Schema defs. + * @member {Object.} defs + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.defs = $util.emptyObject; + + /** + * Schema title. + * @member {string} title + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.title = ""; + + /** + * Schema minItems. + * @member {number|Long} minItems + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.minItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Schema maxItems. + * @member {number|Long} maxItems + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.maxItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Schema minimum. + * @member {number|null|undefined} minimum + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.minimum = null; + + /** + * Schema maximum. + * @member {number|null|undefined} maximum + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.maximum = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Schema.prototype, "_minimum", { + get: $util.oneOfGetter($oneOfFields = ["minimum"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Schema.prototype, "_maximum", { + get: $util.oneOfGetter($oneOfFields = ["maximum"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Schema instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Schema + * @static + * @param {google.cloud.ces.v1beta.ISchema=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Schema} Schema instance + */ + Schema.create = function create(properties) { + return new Schema(properties); + }; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.cloud.ces.v1beta.Schema.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Schema + * @static + * @param {google.cloud.ces.v1beta.ISchema} message Schema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), 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.ces.v1beta.Schema.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.required != null && message.required.length) + for (var i = 0; i < message.required.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.required[i]); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + $root.google.cloud.ces.v1beta.Schema.encode(message.items, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.nullable != null && Object.hasOwnProperty.call(message, "nullable")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.nullable); + if (message.uniqueItems != null && Object.hasOwnProperty.call(message, "uniqueItems")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.uniqueItems); + if (message.prefixItems != null && message.prefixItems.length) + for (var i = 0; i < message.prefixItems.length; ++i) + $root.google.cloud.ces.v1beta.Schema.encode(message.prefixItems[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalProperties != null && Object.hasOwnProperty.call(message, "additionalProperties")) + $root.google.cloud.ces.v1beta.Schema.encode(message.additionalProperties, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.anyOf != null && message.anyOf.length) + for (var i = 0; i < message.anyOf.length; ++i) + $root.google.cloud.ces.v1beta.Schema.encode(message.anyOf[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message["enum"] != null && message["enum"].length) + for (var i = 0; i < message["enum"].length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message["enum"][i]); + if (message["default"] != null && Object.hasOwnProperty.call(message, "default")) + $root.google.protobuf.Value.encode(message["default"], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.ref != null && Object.hasOwnProperty.call(message, "ref")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.ref); + if (message.defs != null && Object.hasOwnProperty.call(message, "defs")) + for (var keys = Object.keys(message.defs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.ces.v1beta.Schema.encode(message.defs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.title); + if (message.minItems != null && Object.hasOwnProperty.call(message, "minItems")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.minItems); + if (message.maxItems != null && Object.hasOwnProperty.call(message, "maxItems")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.maxItems); + if (message.minimum != null && Object.hasOwnProperty.call(message, "minimum")) + writer.uint32(/* id 18, wireType 1 =*/145).double(message.minimum); + if (message.maximum != null && Object.hasOwnProperty.call(message, "maximum")) + writer.uint32(/* id 19, wireType 1 =*/153).double(message.maximum); + return writer; + }; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Schema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Schema + * @static + * @param {google.cloud.ces.v1beta.ISchema} message Schema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Schema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Schema} Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schema.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Schema(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.properties[key] = value; + break; + } + case 3: { + if (!(message.required && message.required.length)) + message.required = []; + message.required.push(reader.string()); + break; + } + case 4: { + message.description = reader.string(); + break; + } + case 5: { + message.items = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + case 6: { + message.nullable = reader.bool(); + break; + } + case 7: { + message.uniqueItems = reader.bool(); + break; + } + case 8: { + if (!(message.prefixItems && message.prefixItems.length)) + message.prefixItems = []; + message.prefixItems.push($root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32())); + break; + } + case 9: { + message.additionalProperties = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.anyOf && message.anyOf.length)) + message.anyOf = []; + message.anyOf.push($root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32())); + break; + } + case 11: { + if (!(message["enum"] && message["enum"].length)) + message["enum"] = []; + message["enum"].push(reader.string()); + break; + } + case 12: { + message["default"] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 13: { + message.ref = reader.string(); + break; + } + case 14: { + if (message.defs === $util.emptyObject) + message.defs = {}; + 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.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.defs[key] = value; + break; + } + case 15: { + message.title = reader.string(); + break; + } + case 16: { + message.minItems = reader.int64(); + break; + } + case 17: { + message.maxItems = reader.int64(); + break; + } + case 18: { + message.minimum = reader.double(); + break; + } + case 19: { + message.maximum = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Schema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Schema} Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Schema message. + * @function verify + * @memberof google.cloud.ces.v1beta.Schema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Schema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.properties[key[i]]); + if (error) + return "properties." + error; + } + } + if (message.required != null && message.hasOwnProperty("required")) { + if (!Array.isArray(message.required)) + return "required: array expected"; + for (var i = 0; i < message.required.length; ++i) + if (!$util.isString(message.required[i])) + return "required: string[] expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.items != null && message.hasOwnProperty("items")) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.items); + if (error) + return "items." + error; + } + if (message.nullable != null && message.hasOwnProperty("nullable")) + if (typeof message.nullable !== "boolean") + return "nullable: boolean expected"; + if (message.uniqueItems != null && message.hasOwnProperty("uniqueItems")) + if (typeof message.uniqueItems !== "boolean") + return "uniqueItems: boolean expected"; + if (message.prefixItems != null && message.hasOwnProperty("prefixItems")) { + if (!Array.isArray(message.prefixItems)) + return "prefixItems: array expected"; + for (var i = 0; i < message.prefixItems.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.prefixItems[i]); + if (error) + return "prefixItems." + error; + } + } + if (message.additionalProperties != null && message.hasOwnProperty("additionalProperties")) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.additionalProperties); + if (error) + return "additionalProperties." + error; + } + if (message.anyOf != null && message.hasOwnProperty("anyOf")) { + if (!Array.isArray(message.anyOf)) + return "anyOf: array expected"; + for (var i = 0; i < message.anyOf.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.anyOf[i]); + if (error) + return "anyOf." + error; + } + } + if (message["enum"] != null && message.hasOwnProperty("enum")) { + if (!Array.isArray(message["enum"])) + return "enum: array expected"; + for (var i = 0; i < message["enum"].length; ++i) + if (!$util.isString(message["enum"][i])) + return "enum: string[] expected"; + } + if (message["default"] != null && message.hasOwnProperty("default")) { + var error = $root.google.protobuf.Value.verify(message["default"]); + if (error) + return "default." + error; + } + if (message.ref != null && message.hasOwnProperty("ref")) + if (!$util.isString(message.ref)) + return "ref: string expected"; + if (message.defs != null && message.hasOwnProperty("defs")) { + if (!$util.isObject(message.defs)) + return "defs: object expected"; + var key = Object.keys(message.defs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.defs[key[i]]); + if (error) + return "defs." + error; + } + } + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.minItems != null && message.hasOwnProperty("minItems")) + if (!$util.isInteger(message.minItems) && !(message.minItems && $util.isInteger(message.minItems.low) && $util.isInteger(message.minItems.high))) + return "minItems: integer|Long expected"; + if (message.maxItems != null && message.hasOwnProperty("maxItems")) + if (!$util.isInteger(message.maxItems) && !(message.maxItems && $util.isInteger(message.maxItems.low) && $util.isInteger(message.maxItems.high))) + return "maxItems: integer|Long expected"; + if (message.minimum != null && message.hasOwnProperty("minimum")) { + properties._minimum = 1; + if (typeof message.minimum !== "number") + return "minimum: number expected"; + } + if (message.maximum != null && message.hasOwnProperty("maximum")) { + properties._maximum = 1; + if (typeof message.maximum !== "number") + return "maximum: number expected"; + } + return null; + }; + + /** + * Creates a Schema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Schema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Schema} Schema + */ + Schema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Schema) + return object; + var message = new $root.google.cloud.ces.v1beta.Schema(); + 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 "STRING": + case 1: + message.type = 1; + break; + case "INTEGER": + case 2: + message.type = 2; + break; + case "NUMBER": + case 3: + message.type = 3; + break; + case "BOOLEAN": + case 4: + message.type = 4; + break; + case "OBJECT": + case 5: + message.type = 5; + break; + case "ARRAY": + case 6: + message.type = 6; + break; + } + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.ces.v1beta.Schema.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Schema.properties: object expected"); + message.properties[keys[i]] = $root.google.cloud.ces.v1beta.Schema.fromObject(object.properties[keys[i]]); + } + } + if (object.required) { + if (!Array.isArray(object.required)) + throw TypeError(".google.cloud.ces.v1beta.Schema.required: array expected"); + message.required = []; + for (var i = 0; i < object.required.length; ++i) + message.required[i] = String(object.required[i]); + } + if (object.description != null) + message.description = String(object.description); + if (object.items != null) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.ces.v1beta.Schema.items: object expected"); + message.items = $root.google.cloud.ces.v1beta.Schema.fromObject(object.items); + } + if (object.nullable != null) + message.nullable = Boolean(object.nullable); + if (object.uniqueItems != null) + message.uniqueItems = Boolean(object.uniqueItems); + if (object.prefixItems) { + if (!Array.isArray(object.prefixItems)) + throw TypeError(".google.cloud.ces.v1beta.Schema.prefixItems: array expected"); + message.prefixItems = []; + for (var i = 0; i < object.prefixItems.length; ++i) { + if (typeof object.prefixItems[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Schema.prefixItems: object expected"); + message.prefixItems[i] = $root.google.cloud.ces.v1beta.Schema.fromObject(object.prefixItems[i]); + } + } + if (object.additionalProperties != null) { + if (typeof object.additionalProperties !== "object") + throw TypeError(".google.cloud.ces.v1beta.Schema.additionalProperties: object expected"); + message.additionalProperties = $root.google.cloud.ces.v1beta.Schema.fromObject(object.additionalProperties); + } + if (object.anyOf) { + if (!Array.isArray(object.anyOf)) + throw TypeError(".google.cloud.ces.v1beta.Schema.anyOf: array expected"); + message.anyOf = []; + for (var i = 0; i < object.anyOf.length; ++i) { + if (typeof object.anyOf[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Schema.anyOf: object expected"); + message.anyOf[i] = $root.google.cloud.ces.v1beta.Schema.fromObject(object.anyOf[i]); + } + } + if (object["enum"]) { + if (!Array.isArray(object["enum"])) + throw TypeError(".google.cloud.ces.v1beta.Schema.enum: array expected"); + message["enum"] = []; + for (var i = 0; i < object["enum"].length; ++i) + message["enum"][i] = String(object["enum"][i]); + } + if (object["default"] != null) { + if (typeof object["default"] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Schema.default: object expected"); + message["default"] = $root.google.protobuf.Value.fromObject(object["default"]); + } + if (object.ref != null) + message.ref = String(object.ref); + if (object.defs) { + if (typeof object.defs !== "object") + throw TypeError(".google.cloud.ces.v1beta.Schema.defs: object expected"); + message.defs = {}; + for (var keys = Object.keys(object.defs), i = 0; i < keys.length; ++i) { + if (typeof object.defs[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Schema.defs: object expected"); + message.defs[keys[i]] = $root.google.cloud.ces.v1beta.Schema.fromObject(object.defs[keys[i]]); + } + } + if (object.title != null) + message.title = String(object.title); + if (object.minItems != null) + if ($util.Long) + (message.minItems = $util.Long.fromValue(object.minItems)).unsigned = false; + else if (typeof object.minItems === "string") + message.minItems = parseInt(object.minItems, 10); + else if (typeof object.minItems === "number") + message.minItems = object.minItems; + else if (typeof object.minItems === "object") + message.minItems = new $util.LongBits(object.minItems.low >>> 0, object.minItems.high >>> 0).toNumber(); + if (object.maxItems != null) + if ($util.Long) + (message.maxItems = $util.Long.fromValue(object.maxItems)).unsigned = false; + else if (typeof object.maxItems === "string") + message.maxItems = parseInt(object.maxItems, 10); + else if (typeof object.maxItems === "number") + message.maxItems = object.maxItems; + else if (typeof object.maxItems === "object") + message.maxItems = new $util.LongBits(object.maxItems.low >>> 0, object.maxItems.high >>> 0).toNumber(); + if (object.minimum != null) + message.minimum = Number(object.minimum); + if (object.maximum != null) + message.maximum = Number(object.maximum); + return message; + }; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Schema + * @static + * @param {google.cloud.ces.v1beta.Schema} message Schema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Schema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.required = []; + object.prefixItems = []; + object.anyOf = []; + object["enum"] = []; + } + if (options.objects || options.defaults) { + object.properties = {}; + object.defs = {}; + } + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.description = ""; + object.items = null; + object.nullable = false; + object.uniqueItems = false; + object.additionalProperties = null; + object["default"] = null; + object.ref = ""; + object.title = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.minItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.minItems = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxItems = options.longs === String ? "0" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.ces.v1beta.Schema.Type[message.type] === undefined ? message.type : $root.google.cloud.ces.v1beta.Schema.Type[message.type] : message.type; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.cloud.ces.v1beta.Schema.toObject(message.properties[keys2[j]], options); + } + if (message.required && message.required.length) { + object.required = []; + for (var j = 0; j < message.required.length; ++j) + object.required[j] = message.required[j]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.items != null && message.hasOwnProperty("items")) + object.items = $root.google.cloud.ces.v1beta.Schema.toObject(message.items, options); + if (message.nullable != null && message.hasOwnProperty("nullable")) + object.nullable = message.nullable; + if (message.uniqueItems != null && message.hasOwnProperty("uniqueItems")) + object.uniqueItems = message.uniqueItems; + if (message.prefixItems && message.prefixItems.length) { + object.prefixItems = []; + for (var j = 0; j < message.prefixItems.length; ++j) + object.prefixItems[j] = $root.google.cloud.ces.v1beta.Schema.toObject(message.prefixItems[j], options); + } + if (message.additionalProperties != null && message.hasOwnProperty("additionalProperties")) + object.additionalProperties = $root.google.cloud.ces.v1beta.Schema.toObject(message.additionalProperties, options); + if (message.anyOf && message.anyOf.length) { + object.anyOf = []; + for (var j = 0; j < message.anyOf.length; ++j) + object.anyOf[j] = $root.google.cloud.ces.v1beta.Schema.toObject(message.anyOf[j], options); + } + if (message["enum"] && message["enum"].length) { + object["enum"] = []; + for (var j = 0; j < message["enum"].length; ++j) + object["enum"][j] = message["enum"][j]; + } + if (message["default"] != null && message.hasOwnProperty("default")) + object["default"] = $root.google.protobuf.Value.toObject(message["default"], options); + if (message.ref != null && message.hasOwnProperty("ref")) + object.ref = message.ref; + if (message.defs && (keys2 = Object.keys(message.defs)).length) { + object.defs = {}; + for (var j = 0; j < keys2.length; ++j) + object.defs[keys2[j]] = $root.google.cloud.ces.v1beta.Schema.toObject(message.defs[keys2[j]], options); + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.minItems != null && message.hasOwnProperty("minItems")) + if (typeof message.minItems === "number") + object.minItems = options.longs === String ? String(message.minItems) : message.minItems; + else + object.minItems = options.longs === String ? $util.Long.prototype.toString.call(message.minItems) : options.longs === Number ? new $util.LongBits(message.minItems.low >>> 0, message.minItems.high >>> 0).toNumber() : message.minItems; + if (message.maxItems != null && message.hasOwnProperty("maxItems")) + if (typeof message.maxItems === "number") + object.maxItems = options.longs === String ? String(message.maxItems) : message.maxItems; + else + object.maxItems = options.longs === String ? $util.Long.prototype.toString.call(message.maxItems) : options.longs === Number ? new $util.LongBits(message.maxItems.low >>> 0, message.maxItems.high >>> 0).toNumber() : message.maxItems; + if (message.minimum != null && message.hasOwnProperty("minimum")) { + object.minimum = options.json && !isFinite(message.minimum) ? String(message.minimum) : message.minimum; + if (options.oneofs) + object._minimum = "minimum"; + } + if (message.maximum != null && message.hasOwnProperty("maximum")) { + object.maximum = options.json && !isFinite(message.maximum) ? String(message.maximum) : message.maximum; + if (options.oneofs) + object._maximum = "maximum"; + } + return object; + }; + + /** + * Converts this Schema to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Schema + * @instance + * @returns {Object.} JSON object + */ + Schema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Schema + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Schema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Schema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Schema"; + }; + + /** + * Type enum. + * @name google.cloud.ces.v1beta.Schema.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} INTEGER=2 INTEGER value + * @property {number} NUMBER=3 NUMBER value + * @property {number} BOOLEAN=4 BOOLEAN value + * @property {number} OBJECT=5 OBJECT value + * @property {number} ARRAY=6 ARRAY value + */ + Schema.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "INTEGER"] = 2; + values[valuesById[3] = "NUMBER"] = 3; + values[valuesById[4] = "BOOLEAN"] = 4; + values[valuesById[5] = "OBJECT"] = 5; + values[valuesById[6] = "ARRAY"] = 6; + return values; + })(); + + return Schema; + })(); + + v1beta.AppSnapshot = (function() { + + /** + * Properties of an AppSnapshot. + * @memberof google.cloud.ces.v1beta + * @interface IAppSnapshot + * @property {google.cloud.ces.v1beta.IApp|null} [app] AppSnapshot app + * @property {Array.|null} [agents] AppSnapshot agents + * @property {Array.|null} [tools] AppSnapshot tools + * @property {Array.|null} [examples] AppSnapshot examples + * @property {Array.|null} [guardrails] AppSnapshot guardrails + * @property {Array.|null} [toolsets] AppSnapshot toolsets + */ + + /** + * Constructs a new AppSnapshot. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an AppSnapshot. + * @implements IAppSnapshot + * @constructor + * @param {google.cloud.ces.v1beta.IAppSnapshot=} [properties] Properties to set + */ + function AppSnapshot(properties) { + this.agents = []; + this.tools = []; + this.examples = []; + this.guardrails = []; + this.toolsets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppSnapshot app. + * @member {google.cloud.ces.v1beta.IApp|null|undefined} app + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @instance + */ + AppSnapshot.prototype.app = null; + + /** + * AppSnapshot agents. + * @member {Array.} agents + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @instance + */ + AppSnapshot.prototype.agents = $util.emptyArray; + + /** + * AppSnapshot tools. + * @member {Array.} tools + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @instance + */ + AppSnapshot.prototype.tools = $util.emptyArray; + + /** + * AppSnapshot examples. + * @member {Array.} examples + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @instance + */ + AppSnapshot.prototype.examples = $util.emptyArray; + + /** + * AppSnapshot guardrails. + * @member {Array.} guardrails + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @instance + */ + AppSnapshot.prototype.guardrails = $util.emptyArray; + + /** + * AppSnapshot toolsets. + * @member {Array.} toolsets + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @instance + */ + AppSnapshot.prototype.toolsets = $util.emptyArray; + + /** + * Creates a new AppSnapshot instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @static + * @param {google.cloud.ces.v1beta.IAppSnapshot=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AppSnapshot} AppSnapshot instance + */ + AppSnapshot.create = function create(properties) { + return new AppSnapshot(properties); + }; + + /** + * Encodes the specified AppSnapshot message. Does not implicitly {@link google.cloud.ces.v1beta.AppSnapshot.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @static + * @param {google.cloud.ces.v1beta.IAppSnapshot} message AppSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppSnapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + $root.google.cloud.ces.v1beta.App.encode(message.app, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.agents != null && message.agents.length) + for (var i = 0; i < message.agents.length; ++i) + $root.google.cloud.ces.v1beta.Agent.encode(message.agents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + $root.google.cloud.ces.v1beta.Tool.encode(message.tools[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.examples != null && message.examples.length) + for (var i = 0; i < message.examples.length; ++i) + $root.google.cloud.ces.v1beta.Example.encode(message.examples[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.guardrails != null && message.guardrails.length) + for (var i = 0; i < message.guardrails.length; ++i) + $root.google.cloud.ces.v1beta.Guardrail.encode(message.guardrails[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.toolsets != null && message.toolsets.length) + for (var i = 0; i < message.toolsets.length; ++i) + $root.google.cloud.ces.v1beta.Toolset.encode(message.toolsets[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AppSnapshot message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AppSnapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @static + * @param {google.cloud.ces.v1beta.IAppSnapshot} message AppSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppSnapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppSnapshot message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AppSnapshot} AppSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppSnapshot.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AppSnapshot(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.app = $root.google.cloud.ces.v1beta.App.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.agents && message.agents.length)) + message.agents = []; + message.agents.push($root.google.cloud.ces.v1beta.Agent.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push($root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.examples && message.examples.length)) + message.examples = []; + message.examples.push($root.google.cloud.ces.v1beta.Example.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.guardrails && message.guardrails.length)) + message.guardrails = []; + message.guardrails.push($root.google.cloud.ces.v1beta.Guardrail.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.toolsets && message.toolsets.length)) + message.toolsets = []; + message.toolsets.push($root.google.cloud.ces.v1beta.Toolset.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AppSnapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AppSnapshot} AppSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppSnapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppSnapshot message. + * @function verify + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppSnapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.app != null && message.hasOwnProperty("app")) { + var error = $root.google.cloud.ces.v1beta.App.verify(message.app); + if (error) + return "app." + error; + } + if (message.agents != null && message.hasOwnProperty("agents")) { + if (!Array.isArray(message.agents)) + return "agents: array expected"; + for (var i = 0; i < message.agents.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Agent.verify(message.agents[i]); + if (error) + return "agents." + error; + } + } + if (message.tools != null && message.hasOwnProperty("tools")) { + if (!Array.isArray(message.tools)) + return "tools: array expected"; + for (var i = 0; i < message.tools.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tools[i]); + if (error) + return "tools." + error; + } + } + if (message.examples != null && message.hasOwnProperty("examples")) { + if (!Array.isArray(message.examples)) + return "examples: array expected"; + for (var i = 0; i < message.examples.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Example.verify(message.examples[i]); + if (error) + return "examples." + error; + } + } + if (message.guardrails != null && message.hasOwnProperty("guardrails")) { + if (!Array.isArray(message.guardrails)) + return "guardrails: array expected"; + for (var i = 0; i < message.guardrails.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Guardrail.verify(message.guardrails[i]); + if (error) + return "guardrails." + error; + } + } + if (message.toolsets != null && message.hasOwnProperty("toolsets")) { + if (!Array.isArray(message.toolsets)) + return "toolsets: array expected"; + for (var i = 0; i < message.toolsets.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Toolset.verify(message.toolsets[i]); + if (error) + return "toolsets." + error; + } + } + return null; + }; + + /** + * Creates an AppSnapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AppSnapshot} AppSnapshot + */ + AppSnapshot.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AppSnapshot) + return object; + var message = new $root.google.cloud.ces.v1beta.AppSnapshot(); + if (object.app != null) { + if (typeof object.app !== "object") + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.app: object expected"); + message.app = $root.google.cloud.ces.v1beta.App.fromObject(object.app); + } + if (object.agents) { + if (!Array.isArray(object.agents)) + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.agents: array expected"); + message.agents = []; + for (var i = 0; i < object.agents.length; ++i) { + if (typeof object.agents[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.agents: object expected"); + message.agents[i] = $root.google.cloud.ces.v1beta.Agent.fromObject(object.agents[i]); + } + } + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) { + if (typeof object.tools[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.tools: object expected"); + message.tools[i] = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tools[i]); + } + } + if (object.examples) { + if (!Array.isArray(object.examples)) + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.examples: array expected"); + message.examples = []; + for (var i = 0; i < object.examples.length; ++i) { + if (typeof object.examples[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.examples: object expected"); + message.examples[i] = $root.google.cloud.ces.v1beta.Example.fromObject(object.examples[i]); + } + } + if (object.guardrails) { + if (!Array.isArray(object.guardrails)) + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.guardrails: array expected"); + message.guardrails = []; + for (var i = 0; i < object.guardrails.length; ++i) { + if (typeof object.guardrails[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.guardrails: object expected"); + message.guardrails[i] = $root.google.cloud.ces.v1beta.Guardrail.fromObject(object.guardrails[i]); + } + } + if (object.toolsets) { + if (!Array.isArray(object.toolsets)) + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.toolsets: array expected"); + message.toolsets = []; + for (var i = 0; i < object.toolsets.length; ++i) { + if (typeof object.toolsets[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.toolsets: object expected"); + message.toolsets[i] = $root.google.cloud.ces.v1beta.Toolset.fromObject(object.toolsets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AppSnapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @static + * @param {google.cloud.ces.v1beta.AppSnapshot} message AppSnapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppSnapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.agents = []; + object.tools = []; + object.examples = []; + object.guardrails = []; + object.toolsets = []; + } + if (options.defaults) + object.app = null; + if (message.app != null && message.hasOwnProperty("app")) + object.app = $root.google.cloud.ces.v1beta.App.toObject(message.app, options); + if (message.agents && message.agents.length) { + object.agents = []; + for (var j = 0; j < message.agents.length; ++j) + object.agents[j] = $root.google.cloud.ces.v1beta.Agent.toObject(message.agents[j], options); + } + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = $root.google.cloud.ces.v1beta.Tool.toObject(message.tools[j], options); + } + if (message.examples && message.examples.length) { + object.examples = []; + for (var j = 0; j < message.examples.length; ++j) + object.examples[j] = $root.google.cloud.ces.v1beta.Example.toObject(message.examples[j], options); + } + if (message.guardrails && message.guardrails.length) { + object.guardrails = []; + for (var j = 0; j < message.guardrails.length; ++j) + object.guardrails[j] = $root.google.cloud.ces.v1beta.Guardrail.toObject(message.guardrails[j], options); + } + if (message.toolsets && message.toolsets.length) { + object.toolsets = []; + for (var j = 0; j < message.toolsets.length; ++j) + object.toolsets[j] = $root.google.cloud.ces.v1beta.Toolset.toObject(message.toolsets[j], options); + } + return object; + }; + + /** + * Converts this AppSnapshot to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @instance + * @returns {Object.} JSON object + */ + AppSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AppSnapshot + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AppSnapshot"; + }; + + return AppSnapshot; + })(); + + v1beta.AppVersion = (function() { + + /** + * Properties of an AppVersion. + * @memberof google.cloud.ces.v1beta + * @interface IAppVersion + * @property {string|null} [name] AppVersion name + * @property {string|null} [displayName] AppVersion displayName + * @property {string|null} [description] AppVersion description + * @property {string|null} [creator] AppVersion creator + * @property {google.protobuf.ITimestamp|null} [createTime] AppVersion createTime + * @property {google.cloud.ces.v1beta.IAppSnapshot|null} [snapshot] AppVersion snapshot + * @property {string|null} [etag] AppVersion etag + */ + + /** + * Constructs a new AppVersion. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an AppVersion. + * @implements IAppVersion + * @constructor + * @param {google.cloud.ces.v1beta.IAppVersion=} [properties] Properties to set + */ + function AppVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppVersion name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.AppVersion + * @instance + */ + AppVersion.prototype.name = ""; + + /** + * AppVersion displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.AppVersion + * @instance + */ + AppVersion.prototype.displayName = ""; + + /** + * AppVersion description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.AppVersion + * @instance + */ + AppVersion.prototype.description = ""; + + /** + * AppVersion creator. + * @member {string} creator + * @memberof google.cloud.ces.v1beta.AppVersion + * @instance + */ + AppVersion.prototype.creator = ""; + + /** + * AppVersion createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.AppVersion + * @instance + */ + AppVersion.prototype.createTime = null; + + /** + * AppVersion snapshot. + * @member {google.cloud.ces.v1beta.IAppSnapshot|null|undefined} snapshot + * @memberof google.cloud.ces.v1beta.AppVersion + * @instance + */ + AppVersion.prototype.snapshot = null; + + /** + * AppVersion etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.AppVersion + * @instance + */ + AppVersion.prototype.etag = ""; + + /** + * Creates a new AppVersion instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AppVersion + * @static + * @param {google.cloud.ces.v1beta.IAppVersion=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AppVersion} AppVersion instance + */ + AppVersion.create = function create(properties) { + return new AppVersion(properties); + }; + + /** + * Encodes the specified AppVersion message. Does not implicitly {@link google.cloud.ces.v1beta.AppVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AppVersion + * @static + * @param {google.cloud.ces.v1beta.IAppVersion} message AppVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppVersion.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.creator); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + $root.google.cloud.ces.v1beta.AppSnapshot.encode(message.snapshot, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AppVersion message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AppVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AppVersion + * @static + * @param {google.cloud.ces.v1beta.IAppVersion} message AppVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AppVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AppVersion} AppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppVersion.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AppVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.creator = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.snapshot = $root.google.cloud.ces.v1beta.AppSnapshot.decode(reader, reader.uint32()); + break; + } + case 7: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AppVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AppVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AppVersion} AppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppVersion message. + * @function verify + * @memberof google.cloud.ces.v1beta.AppVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppVersion.verify = function verify(message) { + if (typeof message !== "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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: 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.snapshot != null && message.hasOwnProperty("snapshot")) { + var error = $root.google.cloud.ces.v1beta.AppSnapshot.verify(message.snapshot); + if (error) + return "snapshot." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an AppVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AppVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AppVersion} AppVersion + */ + AppVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AppVersion) + return object; + var message = new $root.google.cloud.ces.v1beta.AppVersion(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.creator != null) + message.creator = String(object.creator); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.AppVersion.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.snapshot != null) { + if (typeof object.snapshot !== "object") + throw TypeError(".google.cloud.ces.v1beta.AppVersion.snapshot: object expected"); + message.snapshot = $root.google.cloud.ces.v1beta.AppSnapshot.fromObject(object.snapshot); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an AppVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AppVersion + * @static + * @param {google.cloud.ces.v1beta.AppVersion} message AppVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.creator = ""; + object.createTime = null; + object.etag = ""; + object.snapshot = 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = $root.google.cloud.ces.v1beta.AppSnapshot.toObject(message.snapshot, options); + return object; + }; + + /** + * Converts this AppVersion to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AppVersion + * @instance + * @returns {Object.} JSON object + */ + AppVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AppVersion + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AppVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AppVersion"; + }; + + return AppVersion; + })(); + + v1beta.Example = (function() { + + /** + * Properties of an Example. + * @memberof google.cloud.ces.v1beta + * @interface IExample + * @property {string|null} [name] Example name + * @property {string|null} [displayName] Example displayName + * @property {string|null} [description] Example description + * @property {string|null} [entryAgent] Example entryAgent + * @property {Array.|null} [messages] Example messages + * @property {google.protobuf.ITimestamp|null} [createTime] Example createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Example updateTime + * @property {boolean|null} [invalid] Example invalid + * @property {string|null} [etag] Example etag + */ + + /** + * Constructs a new Example. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an Example. + * @implements IExample + * @constructor + * @param {google.cloud.ces.v1beta.IExample=} [properties] Properties to set + */ + function Example(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Example name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Example + * @instance + */ + Example.prototype.name = ""; + + /** + * Example displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.Example + * @instance + */ + Example.prototype.displayName = ""; + + /** + * Example description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.Example + * @instance + */ + Example.prototype.description = ""; + + /** + * Example entryAgent. + * @member {string} entryAgent + * @memberof google.cloud.ces.v1beta.Example + * @instance + */ + Example.prototype.entryAgent = ""; + + /** + * Example messages. + * @member {Array.} messages + * @memberof google.cloud.ces.v1beta.Example + * @instance + */ + Example.prototype.messages = $util.emptyArray; + + /** + * Example createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.Example + * @instance + */ + Example.prototype.createTime = null; + + /** + * Example updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.Example + * @instance + */ + Example.prototype.updateTime = null; + + /** + * Example invalid. + * @member {boolean} invalid + * @memberof google.cloud.ces.v1beta.Example + * @instance + */ + Example.prototype.invalid = false; + + /** + * Example etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.Example + * @instance + */ + Example.prototype.etag = ""; + + /** + * Creates a new Example instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Example + * @static + * @param {google.cloud.ces.v1beta.IExample=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Example} Example instance + */ + Example.create = function create(properties) { + return new Example(properties); + }; + + /** + * Encodes the specified Example message. Does not implicitly {@link google.cloud.ces.v1beta.Example.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Example + * @static + * @param {google.cloud.ces.v1beta.IExample} message Example message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Example.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.entryAgent != null && Object.hasOwnProperty.call(message, "entryAgent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.entryAgent); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.ces.v1beta.Message.encode(message.messages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.invalid != null && Object.hasOwnProperty.call(message, "invalid")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.invalid); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + return writer; + }; + + /** + * Encodes the specified Example message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Example.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Example + * @static + * @param {google.cloud.ces.v1beta.IExample} message Example message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Example.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Example message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Example + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Example} Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Example.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Example(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.entryAgent = reader.string(); + break; + } + case 5: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32())); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.invalid = reader.bool(); + break; + } + case 9: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Example message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Example + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Example} Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Example.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Example message. + * @function verify + * @memberof google.cloud.ces.v1beta.Example + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Example.verify = function verify(message) { + if (typeof message !== "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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) + if (!$util.isString(message.entryAgent)) + return "entryAgent: string expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + 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.invalid != null && message.hasOwnProperty("invalid")) + if (typeof message.invalid !== "boolean") + return "invalid: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an Example message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Example + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Example} Example + */ + Example.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Example) + return object; + var message = new $root.google.cloud.ces.v1beta.Example(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.entryAgent != null) + message.entryAgent = String(object.entryAgent); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.ces.v1beta.Example.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Example.messages: object expected"); + message.messages[i] = $root.google.cloud.ces.v1beta.Message.fromObject(object.messages[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Example.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.ces.v1beta.Example.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.invalid != null) + message.invalid = Boolean(object.invalid); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an Example message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Example + * @static + * @param {google.cloud.ces.v1beta.Example} message Example + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Example.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.entryAgent = ""; + object.createTime = null; + object.updateTime = null; + object.invalid = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) + object.entryAgent = message.entryAgent; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.ces.v1beta.Message.toObject(message.messages[j], options); + } + 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.invalid != null && message.hasOwnProperty("invalid")) + object.invalid = message.invalid; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this Example to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Example + * @instance + * @returns {Object.} JSON object + */ + Example.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Example + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Example + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Example.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Example"; + }; + + return Example; + })(); + + v1beta.Message = (function() { + + /** + * Properties of a Message. + * @memberof google.cloud.ces.v1beta + * @interface IMessage + * @property {string|null} [role] Message role + * @property {Array.|null} [chunks] Message chunks + * @property {google.protobuf.ITimestamp|null} [eventTime] Message eventTime + */ + + /** + * Constructs a new Message. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Message. + * @implements IMessage + * @constructor + * @param {google.cloud.ces.v1beta.IMessage=} [properties] Properties to set + */ + function Message(properties) { + this.chunks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Message role. + * @member {string} role + * @memberof google.cloud.ces.v1beta.Message + * @instance + */ + Message.prototype.role = ""; + + /** + * Message chunks. + * @member {Array.} chunks + * @memberof google.cloud.ces.v1beta.Message + * @instance + */ + Message.prototype.chunks = $util.emptyArray; + + /** + * Message eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.ces.v1beta.Message + * @instance + */ + Message.prototype.eventTime = null; + + /** + * Creates a new Message instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Message + * @static + * @param {google.cloud.ces.v1beta.IMessage=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Message} Message instance + */ + Message.create = function create(properties) { + return new Message(properties); + }; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.ces.v1beta.Message.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Message + * @static + * @param {google.cloud.ces.v1beta.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.chunks != null && message.chunks.length) + for (var i = 0; i < message.chunks.length; ++i) + $root.google.cloud.ces.v1beta.Chunk.encode(message.chunks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Message.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Message + * @static + * @param {google.cloud.ces.v1beta.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Message message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Message(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.chunks && message.chunks.length)) + message.chunks = []; + message.chunks.push($root.google.cloud.ces.v1beta.Chunk.decode(reader, reader.uint32())); + break; + } + case 4: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Message message. + * @function verify + * @memberof google.cloud.ces.v1beta.Message + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Message.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.chunks != null && message.hasOwnProperty("chunks")) { + if (!Array.isArray(message.chunks)) + return "chunks: array expected"; + for (var i = 0; i < message.chunks.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Chunk.verify(message.chunks[i]); + if (error) + return "chunks." + error; + } + } + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + return null; + }; + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Message + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Message} Message + */ + Message.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Message) + return object; + var message = new $root.google.cloud.ces.v1beta.Message(); + if (object.role != null) + message.role = String(object.role); + if (object.chunks) { + if (!Array.isArray(object.chunks)) + throw TypeError(".google.cloud.ces.v1beta.Message.chunks: array expected"); + message.chunks = []; + for (var i = 0; i < object.chunks.length; ++i) { + if (typeof object.chunks[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Message.chunks: object expected"); + message.chunks[i] = $root.google.cloud.ces.v1beta.Chunk.fromObject(object.chunks[i]); + } + } + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Message.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + return message; + }; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Message + * @static + * @param {google.cloud.ces.v1beta.Message} message Message + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Message.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.chunks = []; + if (options.defaults) { + object.role = ""; + object.eventTime = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.chunks && message.chunks.length) { + object.chunks = []; + for (var j = 0; j < message.chunks.length; ++j) + object.chunks[j] = $root.google.cloud.ces.v1beta.Chunk.toObject(message.chunks[j], options); + } + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + return object; + }; + + /** + * Converts this Message to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Message + * @instance + * @returns {Object.} JSON object + */ + Message.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Message + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Message + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Message"; + }; + + return Message; + })(); + + v1beta.Chunk = (function() { + + /** + * Properties of a Chunk. + * @memberof google.cloud.ces.v1beta + * @interface IChunk + * @property {string|null} [text] Chunk text + * @property {string|null} [transcript] Chunk transcript + * @property {google.cloud.ces.v1beta.IBlob|null} [blob] Chunk blob + * @property {google.protobuf.IStruct|null} [payload] Chunk payload + * @property {google.cloud.ces.v1beta.IImage|null} [image] Chunk image + * @property {google.cloud.ces.v1beta.IToolCall|null} [toolCall] Chunk toolCall + * @property {google.cloud.ces.v1beta.IToolResponse|null} [toolResponse] Chunk toolResponse + * @property {google.cloud.ces.v1beta.IAgentTransfer|null} [agentTransfer] Chunk agentTransfer + * @property {google.protobuf.IStruct|null} [updatedVariables] Chunk updatedVariables + * @property {google.protobuf.IStruct|null} [defaultVariables] Chunk defaultVariables + */ + + /** + * Constructs a new Chunk. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Chunk. + * @implements IChunk + * @constructor + * @param {google.cloud.ces.v1beta.IChunk=} [properties] Properties to set + */ + function Chunk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Chunk text. + * @member {string|null|undefined} text + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.text = null; + + /** + * Chunk transcript. + * @member {string|null|undefined} transcript + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.transcript = null; + + /** + * Chunk blob. + * @member {google.cloud.ces.v1beta.IBlob|null|undefined} blob + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.blob = null; + + /** + * Chunk payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.payload = null; + + /** + * Chunk image. + * @member {google.cloud.ces.v1beta.IImage|null|undefined} image + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.image = null; + + /** + * Chunk toolCall. + * @member {google.cloud.ces.v1beta.IToolCall|null|undefined} toolCall + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.toolCall = null; + + /** + * Chunk toolResponse. + * @member {google.cloud.ces.v1beta.IToolResponse|null|undefined} toolResponse + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.toolResponse = null; + + /** + * Chunk agentTransfer. + * @member {google.cloud.ces.v1beta.IAgentTransfer|null|undefined} agentTransfer + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.agentTransfer = null; + + /** + * Chunk updatedVariables. + * @member {google.protobuf.IStruct|null|undefined} updatedVariables + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.updatedVariables = null; + + /** + * Chunk defaultVariables. + * @member {google.protobuf.IStruct|null|undefined} defaultVariables + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.defaultVariables = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Chunk data. + * @member {"text"|"transcript"|"blob"|"payload"|"image"|"toolCall"|"toolResponse"|"agentTransfer"|"updatedVariables"|"defaultVariables"|undefined} data + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Object.defineProperty(Chunk.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["text", "transcript", "blob", "payload", "image", "toolCall", "toolResponse", "agentTransfer", "updatedVariables", "defaultVariables"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Chunk instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Chunk + * @static + * @param {google.cloud.ces.v1beta.IChunk=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Chunk} Chunk instance + */ + Chunk.create = function create(properties) { + return new Chunk(properties); + }; + + /** + * Encodes the specified Chunk message. Does not implicitly {@link google.cloud.ces.v1beta.Chunk.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Chunk + * @static + * @param {google.cloud.ces.v1beta.IChunk} message Chunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.toolCall != null && Object.hasOwnProperty.call(message, "toolCall")) + $root.google.cloud.ces.v1beta.ToolCall.encode(message.toolCall, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolResponse != null && Object.hasOwnProperty.call(message, "toolResponse")) + $root.google.cloud.ces.v1beta.ToolResponse.encode(message.toolResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.agentTransfer != null && Object.hasOwnProperty.call(message, "agentTransfer")) + $root.google.cloud.ces.v1beta.AgentTransfer.encode(message.agentTransfer, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.ces.v1beta.Image.encode(message.image, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.blob != null && Object.hasOwnProperty.call(message, "blob")) + $root.google.cloud.ces.v1beta.Blob.encode(message.blob, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.updatedVariables != null && Object.hasOwnProperty.call(message, "updatedVariables")) + $root.google.protobuf.Struct.encode(message.updatedVariables, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.transcript); + if (message.defaultVariables != null && Object.hasOwnProperty.call(message, "defaultVariables")) + $root.google.protobuf.Struct.encode(message.defaultVariables, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Chunk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Chunk + * @static + * @param {google.cloud.ces.v1beta.IChunk} message Chunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Chunk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Chunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Chunk} Chunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chunk.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Chunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 9: { + message.transcript = reader.string(); + break; + } + case 7: { + message.blob = $root.google.cloud.ces.v1beta.Blob.decode(reader, reader.uint32()); + break; + } + case 11: { + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 5: { + message.image = $root.google.cloud.ces.v1beta.Image.decode(reader, reader.uint32()); + break; + } + case 2: { + message.toolCall = $root.google.cloud.ces.v1beta.ToolCall.decode(reader, reader.uint32()); + break; + } + case 3: { + message.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32()); + break; + } + case 4: { + message.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.decode(reader, reader.uint32()); + break; + } + case 8: { + message.updatedVariables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 10: { + message.defaultVariables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Chunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Chunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Chunk} Chunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Chunk message. + * @function verify + * @memberof google.cloud.ces.v1beta.Chunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Chunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.data = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + } + if (message.blob != null && message.hasOwnProperty("blob")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.ces.v1beta.Blob.verify(message.blob); + if (error) + return "blob." + error; + } + } + if (message.payload != null && message.hasOwnProperty("payload")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.protobuf.Struct.verify(message.payload); + if (error) + return "payload." + error; + } + } + if (message.image != null && message.hasOwnProperty("image")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.ces.v1beta.Image.verify(message.image); + if (error) + return "image." + error; + } + } + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolCall.verify(message.toolCall); + if (error) + return "toolCall." + error; + } + } + if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.toolResponse); + if (error) + return "toolResponse." + error; + } + } + if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.ces.v1beta.AgentTransfer.verify(message.agentTransfer); + if (error) + return "agentTransfer." + error; + } + } + if (message.updatedVariables != null && message.hasOwnProperty("updatedVariables")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.protobuf.Struct.verify(message.updatedVariables); + if (error) + return "updatedVariables." + error; + } + } + if (message.defaultVariables != null && message.hasOwnProperty("defaultVariables")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.protobuf.Struct.verify(message.defaultVariables); + if (error) + return "defaultVariables." + error; + } + } + return null; + }; + + /** + * Creates a Chunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Chunk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Chunk} Chunk + */ + Chunk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Chunk) + return object; + var message = new $root.google.cloud.ces.v1beta.Chunk(); + if (object.text != null) + message.text = String(object.text); + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.blob != null) { + if (typeof object.blob !== "object") + throw TypeError(".google.cloud.ces.v1beta.Chunk.blob: object expected"); + message.blob = $root.google.cloud.ces.v1beta.Blob.fromObject(object.blob); + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.ces.v1beta.Chunk.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload); + } + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.ces.v1beta.Chunk.image: object expected"); + message.image = $root.google.cloud.ces.v1beta.Image.fromObject(object.image); + } + if (object.toolCall != null) { + if (typeof object.toolCall !== "object") + throw TypeError(".google.cloud.ces.v1beta.Chunk.toolCall: object expected"); + message.toolCall = $root.google.cloud.ces.v1beta.ToolCall.fromObject(object.toolCall); + } + if (object.toolResponse != null) { + if (typeof object.toolResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.Chunk.toolResponse: object expected"); + message.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.toolResponse); + } + if (object.agentTransfer != null) { + if (typeof object.agentTransfer !== "object") + throw TypeError(".google.cloud.ces.v1beta.Chunk.agentTransfer: object expected"); + message.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.fromObject(object.agentTransfer); + } + if (object.updatedVariables != null) { + if (typeof object.updatedVariables !== "object") + throw TypeError(".google.cloud.ces.v1beta.Chunk.updatedVariables: object expected"); + message.updatedVariables = $root.google.protobuf.Struct.fromObject(object.updatedVariables); + } + if (object.defaultVariables != null) { + if (typeof object.defaultVariables !== "object") + throw TypeError(".google.cloud.ces.v1beta.Chunk.defaultVariables: object expected"); + message.defaultVariables = $root.google.protobuf.Struct.fromObject(object.defaultVariables); + } + return message; + }; + + /** + * Creates a plain object from a Chunk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Chunk + * @static + * @param {google.cloud.ces.v1beta.Chunk} message Chunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Chunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.data = "text"; + } + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + object.toolCall = $root.google.cloud.ces.v1beta.ToolCall.toObject(message.toolCall, options); + if (options.oneofs) + object.data = "toolCall"; + } + if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { + object.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.toolResponse, options); + if (options.oneofs) + object.data = "toolResponse"; + } + if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { + object.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.toObject(message.agentTransfer, options); + if (options.oneofs) + object.data = "agentTransfer"; + } + if (message.image != null && message.hasOwnProperty("image")) { + object.image = $root.google.cloud.ces.v1beta.Image.toObject(message.image, options); + if (options.oneofs) + object.data = "image"; + } + if (message.blob != null && message.hasOwnProperty("blob")) { + object.blob = $root.google.cloud.ces.v1beta.Blob.toObject(message.blob, options); + if (options.oneofs) + object.data = "blob"; + } + if (message.updatedVariables != null && message.hasOwnProperty("updatedVariables")) { + object.updatedVariables = $root.google.protobuf.Struct.toObject(message.updatedVariables, options); + if (options.oneofs) + object.data = "updatedVariables"; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) { + object.transcript = message.transcript; + if (options.oneofs) + object.data = "transcript"; + } + if (message.defaultVariables != null && message.hasOwnProperty("defaultVariables")) { + object.defaultVariables = $root.google.protobuf.Struct.toObject(message.defaultVariables, options); + if (options.oneofs) + object.data = "defaultVariables"; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (options.oneofs) + object.data = "payload"; + } + return object; + }; + + /** + * Converts this Chunk to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + * @returns {Object.} JSON object + */ + Chunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Chunk + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Chunk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Chunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Chunk"; + }; + + return Chunk; + })(); + + v1beta.Blob = (function() { + + /** + * Properties of a Blob. + * @memberof google.cloud.ces.v1beta + * @interface IBlob + * @property {string|null} [mimeType] Blob mimeType + * @property {Uint8Array|null} [data] Blob data + */ + + /** + * Constructs a new Blob. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Blob. + * @implements IBlob + * @constructor + * @param {google.cloud.ces.v1beta.IBlob=} [properties] Properties to set + */ + function Blob(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Blob mimeType. + * @member {string} mimeType + * @memberof google.cloud.ces.v1beta.Blob + * @instance + */ + Blob.prototype.mimeType = ""; + + /** + * Blob data. + * @member {Uint8Array} data + * @memberof google.cloud.ces.v1beta.Blob + * @instance + */ + Blob.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Blob instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Blob + * @static + * @param {google.cloud.ces.v1beta.IBlob=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Blob} Blob instance + */ + Blob.create = function create(properties) { + return new Blob(properties); + }; + + /** + * Encodes the specified Blob message. Does not implicitly {@link google.cloud.ces.v1beta.Blob.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Blob + * @static + * @param {google.cloud.ces.v1beta.IBlob} message Blob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Blob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Blob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Blob + * @static + * @param {google.cloud.ces.v1beta.IBlob} message Blob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Blob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Blob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Blob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Blob} Blob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Blob.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Blob(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mimeType = reader.string(); + break; + } + case 2: { + message.data = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Blob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Blob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Blob} Blob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Blob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Blob message. + * @function verify + * @memberof google.cloud.ces.v1beta.Blob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Blob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates a Blob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Blob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Blob} Blob + */ + Blob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Blob) + return object; + var message = new $root.google.cloud.ces.v1beta.Blob(); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from a Blob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Blob + * @static + * @param {google.cloud.ces.v1beta.Blob} message Blob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Blob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mimeType = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this Blob to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Blob + * @instance + * @returns {Object.} JSON object + */ + Blob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Blob + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Blob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Blob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Blob"; + }; + + return Blob; + })(); + + v1beta.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.cloud.ces.v1beta + * @interface IImage + * @property {string|null} [mimeType] Image mimeType + * @property {Uint8Array|null} [data] Image data + */ + + /** + * Constructs a new Image. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.ces.v1beta.IImage=} [properties] Properties to set + */ + function Image(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Image mimeType. + * @member {string} mimeType + * @memberof google.cloud.ces.v1beta.Image + * @instance + */ + Image.prototype.mimeType = ""; + + /** + * Image data. + * @member {Uint8Array} data + * @memberof google.cloud.ces.v1beta.Image + * @instance + */ + Image.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Image + * @static + * @param {google.cloud.ces.v1beta.IImage=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.ces.v1beta.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Image + * @static + * @param {google.cloud.ces.v1beta.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Image + * @static + * @param {google.cloud.ces.v1beta.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Image message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mimeType = reader.string(); + break; + } + case 2: { + message.data = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Image message. + * @function verify + * @memberof google.cloud.ces.v1beta.Image + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Image.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Image) + return object; + var message = new $root.google.cloud.ces.v1beta.Image(); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Image + * @static + * @param {google.cloud.ces.v1beta.Image} message Image + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Image.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mimeType = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Image + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Image + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Image.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Image"; + }; + + return Image; + })(); + + v1beta.ToolCall = (function() { + + /** + * Properties of a ToolCall. + * @memberof google.cloud.ces.v1beta + * @interface IToolCall + * @property {string|null} [tool] ToolCall tool + * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] ToolCall toolsetTool + * @property {string|null} [id] ToolCall id + * @property {string|null} [displayName] ToolCall displayName + * @property {google.protobuf.IStruct|null} [args] ToolCall args + */ + + /** + * Constructs a new ToolCall. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ToolCall. + * @implements IToolCall + * @constructor + * @param {google.cloud.ces.v1beta.IToolCall=} [properties] Properties to set + */ + function ToolCall(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolCall tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1beta.ToolCall + * @instance + */ + ToolCall.prototype.tool = null; + + /** + * ToolCall toolsetTool. + * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1beta.ToolCall + * @instance + */ + ToolCall.prototype.toolsetTool = null; + + /** + * ToolCall id. + * @member {string} id + * @memberof google.cloud.ces.v1beta.ToolCall + * @instance + */ + ToolCall.prototype.id = ""; + + /** + * ToolCall displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.ToolCall + * @instance + */ + ToolCall.prototype.displayName = ""; + + /** + * ToolCall args. + * @member {google.protobuf.IStruct|null|undefined} args + * @memberof google.cloud.ces.v1beta.ToolCall + * @instance + */ + ToolCall.prototype.args = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ToolCall toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1beta.ToolCall + * @instance + */ + Object.defineProperty(ToolCall.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ToolCall instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ToolCall + * @static + * @param {google.cloud.ces.v1beta.IToolCall=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ToolCall} ToolCall instance + */ + ToolCall.create = function create(properties) { + return new ToolCall(properties); + }; + + /** + * Encodes the specified ToolCall message. Does not implicitly {@link google.cloud.ces.v1beta.ToolCall.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ToolCall + * @static + * @param {google.cloud.ces.v1beta.IToolCall} message ToolCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCall.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tool); + if (message.args != null && Object.hasOwnProperty.call(message, "args")) + $root.google.protobuf.Struct.encode(message.args, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolCall message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolCall.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ToolCall + * @static + * @param {google.cloud.ces.v1beta.IToolCall} message ToolCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCall.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolCall message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ToolCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ToolCall} ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCall.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ToolCall(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.tool = reader.string(); + break; + } + case 5: { + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 1: { + message.id = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 3: { + message.args = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolCall message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ToolCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ToolCall} ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCall.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolCall message. + * @function verify + * @memberof google.cloud.ces.v1beta.ToolCall + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolCall.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.args != null && message.hasOwnProperty("args")) { + var error = $root.google.protobuf.Struct.verify(message.args); + if (error) + return "args." + error; + } + return null; + }; + + /** + * Creates a ToolCall message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ToolCall + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ToolCall} ToolCall + */ + ToolCall.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ToolCall) + return object; + var message = new $root.google.cloud.ces.v1beta.ToolCall(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.ToolCall.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.args != null) { + if (typeof object.args !== "object") + throw TypeError(".google.cloud.ces.v1beta.ToolCall.args: object expected"); + message.args = $root.google.protobuf.Struct.fromObject(object.args); + } + return message; + }; + + /** + * Creates a plain object from a ToolCall message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ToolCall + * @static + * @param {google.cloud.ces.v1beta.ToolCall} message ToolCall + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolCall.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.args = null; + object.displayName = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.args != null && message.hasOwnProperty("args")) + object.args = $root.google.protobuf.Struct.toObject(message.args, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + return object; + }; + + /** + * Converts this ToolCall to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ToolCall + * @instance + * @returns {Object.} JSON object + */ + ToolCall.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolCall + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ToolCall + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ToolCall"; + }; + + return ToolCall; + })(); + + v1beta.ToolResponse = (function() { + + /** + * Properties of a ToolResponse. + * @memberof google.cloud.ces.v1beta + * @interface IToolResponse + * @property {string|null} [tool] ToolResponse tool + * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] ToolResponse toolsetTool + * @property {string|null} [id] ToolResponse id + * @property {string|null} [displayName] ToolResponse displayName + * @property {google.protobuf.IStruct|null} [response] ToolResponse response + */ + + /** + * Constructs a new ToolResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ToolResponse. + * @implements IToolResponse + * @constructor + * @param {google.cloud.ces.v1beta.IToolResponse=} [properties] Properties to set + */ + function ToolResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolResponse tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1beta.ToolResponse + * @instance + */ + ToolResponse.prototype.tool = null; + + /** + * ToolResponse toolsetTool. + * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1beta.ToolResponse + * @instance + */ + ToolResponse.prototype.toolsetTool = null; + + /** + * ToolResponse id. + * @member {string} id + * @memberof google.cloud.ces.v1beta.ToolResponse + * @instance + */ + ToolResponse.prototype.id = ""; + + /** + * ToolResponse displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.ToolResponse + * @instance + */ + ToolResponse.prototype.displayName = ""; + + /** + * ToolResponse response. + * @member {google.protobuf.IStruct|null|undefined} response + * @memberof google.cloud.ces.v1beta.ToolResponse + * @instance + */ + ToolResponse.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ToolResponse toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1beta.ToolResponse + * @instance + */ + Object.defineProperty(ToolResponse.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ToolResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ToolResponse + * @static + * @param {google.cloud.ces.v1beta.IToolResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ToolResponse} ToolResponse instance + */ + ToolResponse.create = function create(properties) { + return new ToolResponse(properties); + }; + + /** + * Encodes the specified ToolResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ToolResponse + * @static + * @param {google.cloud.ces.v1beta.IToolResponse} message ToolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tool); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Struct.encode(message.response, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ToolResponse + * @static + * @param {google.cloud.ces.v1beta.IToolResponse} message ToolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ToolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ToolResponse} ToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ToolResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.tool = reader.string(); + break; + } + case 5: { + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 1: { + message.id = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 3: { + message.response = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ToolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ToolResponse} ToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ToolResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.response != null && message.hasOwnProperty("response")) { + var error = $root.google.protobuf.Struct.verify(message.response); + if (error) + return "response." + error; + } + return null; + }; + + /** + * Creates a ToolResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ToolResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ToolResponse} ToolResponse + */ + ToolResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ToolResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ToolResponse(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.ToolResponse.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.cloud.ces.v1beta.ToolResponse.response: object expected"); + message.response = $root.google.protobuf.Struct.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from a ToolResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ToolResponse + * @static + * @param {google.cloud.ces.v1beta.ToolResponse} message ToolResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.response = null; + object.displayName = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.response != null && message.hasOwnProperty("response")) + object.response = $root.google.protobuf.Struct.toObject(message.response, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + return object; + }; + + /** + * Converts this ToolResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ToolResponse + * @instance + * @returns {Object.} JSON object + */ + ToolResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ToolResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ToolResponse"; + }; + + return ToolResponse; + })(); + + v1beta.AgentTransfer = (function() { + + /** + * Properties of an AgentTransfer. + * @memberof google.cloud.ces.v1beta + * @interface IAgentTransfer + * @property {string|null} [targetAgent] AgentTransfer targetAgent + * @property {string|null} [displayName] AgentTransfer displayName + */ + + /** + * Constructs a new AgentTransfer. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an AgentTransfer. + * @implements IAgentTransfer + * @constructor + * @param {google.cloud.ces.v1beta.IAgentTransfer=} [properties] Properties to set + */ + function AgentTransfer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AgentTransfer targetAgent. + * @member {string} targetAgent + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @instance + */ + AgentTransfer.prototype.targetAgent = ""; + + /** + * AgentTransfer displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @instance + */ + AgentTransfer.prototype.displayName = ""; + + /** + * Creates a new AgentTransfer instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @static + * @param {google.cloud.ces.v1beta.IAgentTransfer=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AgentTransfer} AgentTransfer instance + */ + AgentTransfer.create = function create(properties) { + return new AgentTransfer(properties); + }; + + /** + * Encodes the specified AgentTransfer message. Does not implicitly {@link google.cloud.ces.v1beta.AgentTransfer.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @static + * @param {google.cloud.ces.v1beta.IAgentTransfer} message AgentTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentTransfer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetAgent != null && Object.hasOwnProperty.call(message, "targetAgent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetAgent); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified AgentTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AgentTransfer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @static + * @param {google.cloud.ces.v1beta.IAgentTransfer} message AgentTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentTransfer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AgentTransfer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AgentTransfer} AgentTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentTransfer.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AgentTransfer(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.targetAgent = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AgentTransfer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AgentTransfer} AgentTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentTransfer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AgentTransfer message. + * @function verify + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AgentTransfer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetAgent != null && message.hasOwnProperty("targetAgent")) + if (!$util.isString(message.targetAgent)) + return "targetAgent: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates an AgentTransfer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AgentTransfer} AgentTransfer + */ + AgentTransfer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AgentTransfer) + return object; + var message = new $root.google.cloud.ces.v1beta.AgentTransfer(); + if (object.targetAgent != null) + message.targetAgent = String(object.targetAgent); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an AgentTransfer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @static + * @param {google.cloud.ces.v1beta.AgentTransfer} message AgentTransfer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AgentTransfer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetAgent = ""; + object.displayName = ""; + } + if (message.targetAgent != null && message.hasOwnProperty("targetAgent")) + object.targetAgent = message.targetAgent; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this AgentTransfer to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @instance + * @returns {Object.} JSON object + */ + AgentTransfer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AgentTransfer + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AgentTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AgentTransfer"; + }; + + return AgentTransfer; + })(); + + v1beta.ToolsetTool = (function() { + + /** + * Properties of a ToolsetTool. + * @memberof google.cloud.ces.v1beta + * @interface IToolsetTool + * @property {string|null} [toolset] ToolsetTool toolset + * @property {string|null} [toolId] ToolsetTool toolId + */ + + /** + * Constructs a new ToolsetTool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ToolsetTool. + * @implements IToolsetTool + * @constructor + * @param {google.cloud.ces.v1beta.IToolsetTool=} [properties] Properties to set + */ + function ToolsetTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolsetTool toolset. + * @member {string} toolset + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @instance + */ + ToolsetTool.prototype.toolset = ""; + + /** + * ToolsetTool toolId. + * @member {string} toolId + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @instance + */ + ToolsetTool.prototype.toolId = ""; + + /** + * Creates a new ToolsetTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @static + * @param {google.cloud.ces.v1beta.IToolsetTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ToolsetTool} ToolsetTool instance + */ + ToolsetTool.create = function create(properties) { + return new ToolsetTool(properties); + }; + + /** + * Encodes the specified ToolsetTool message. Does not implicitly {@link google.cloud.ces.v1beta.ToolsetTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @static + * @param {google.cloud.ces.v1beta.IToolsetTool} message ToolsetTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolsetTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.toolset); + if (message.toolId != null && Object.hasOwnProperty.call(message, "toolId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.toolId); + return writer; + }; + + /** + * Encodes the specified ToolsetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolsetTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @static + * @param {google.cloud.ces.v1beta.IToolsetTool} message ToolsetTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolsetTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolsetTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ToolsetTool} ToolsetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolsetTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ToolsetTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolset = reader.string(); + break; + } + case 3: { + message.toolId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolsetTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ToolsetTool} ToolsetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolsetTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolsetTool message. + * @function verify + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolsetTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolset != null && message.hasOwnProperty("toolset")) + if (!$util.isString(message.toolset)) + return "toolset: string expected"; + if (message.toolId != null && message.hasOwnProperty("toolId")) + if (!$util.isString(message.toolId)) + return "toolId: string expected"; + return null; + }; + + /** + * Creates a ToolsetTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ToolsetTool} ToolsetTool + */ + ToolsetTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ToolsetTool) + return object; + var message = new $root.google.cloud.ces.v1beta.ToolsetTool(); + if (object.toolset != null) + message.toolset = String(object.toolset); + if (object.toolId != null) + message.toolId = String(object.toolId); + return message; + }; + + /** + * Creates a plain object from a ToolsetTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @static + * @param {google.cloud.ces.v1beta.ToolsetTool} message ToolsetTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolsetTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.toolset = ""; + object.toolId = ""; + } + if (message.toolset != null && message.hasOwnProperty("toolset")) + object.toolset = message.toolset; + if (message.toolId != null && message.hasOwnProperty("toolId")) + object.toolId = message.toolId; + return object; + }; + + /** + * Converts this ToolsetTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @instance + * @returns {Object.} JSON object + */ + ToolsetTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolsetTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolsetTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ToolsetTool"; + }; + + return ToolsetTool; + })(); + + v1beta.Guardrail = (function() { + + /** + * Properties of a Guardrail. + * @memberof google.cloud.ces.v1beta + * @interface IGuardrail + * @property {google.cloud.ces.v1beta.Guardrail.IContentFilter|null} [contentFilter] Guardrail contentFilter + * @property {google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity|null} [llmPromptSecurity] Guardrail llmPromptSecurity + * @property {google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null} [llmPolicy] Guardrail llmPolicy + * @property {google.cloud.ces.v1beta.Guardrail.IModelSafety|null} [modelSafety] Guardrail modelSafety + * @property {google.cloud.ces.v1beta.Guardrail.ICodeCallback|null} [codeCallback] Guardrail codeCallback + * @property {string|null} [name] Guardrail name + * @property {string|null} [displayName] Guardrail displayName + * @property {string|null} [description] Guardrail description + * @property {boolean|null} [enabled] Guardrail enabled + * @property {google.cloud.ces.v1beta.ITriggerAction|null} [action] Guardrail action + * @property {google.protobuf.ITimestamp|null} [createTime] Guardrail createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Guardrail updateTime + * @property {string|null} [etag] Guardrail etag + */ + + /** + * Constructs a new Guardrail. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Guardrail. + * @implements IGuardrail + * @constructor + * @param {google.cloud.ces.v1beta.IGuardrail=} [properties] Properties to set + */ + function Guardrail(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Guardrail contentFilter. + * @member {google.cloud.ces.v1beta.Guardrail.IContentFilter|null|undefined} contentFilter + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.contentFilter = null; + + /** + * Guardrail llmPromptSecurity. + * @member {google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity|null|undefined} llmPromptSecurity + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.llmPromptSecurity = null; + + /** + * Guardrail llmPolicy. + * @member {google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null|undefined} llmPolicy + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.llmPolicy = null; + + /** + * Guardrail modelSafety. + * @member {google.cloud.ces.v1beta.Guardrail.IModelSafety|null|undefined} modelSafety + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.modelSafety = null; + + /** + * Guardrail codeCallback. + * @member {google.cloud.ces.v1beta.Guardrail.ICodeCallback|null|undefined} codeCallback + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.codeCallback = null; + + /** + * Guardrail name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.name = ""; + + /** + * Guardrail displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.displayName = ""; + + /** + * Guardrail description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.description = ""; + + /** + * Guardrail enabled. + * @member {boolean} enabled + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.enabled = false; + + /** + * Guardrail action. + * @member {google.cloud.ces.v1beta.ITriggerAction|null|undefined} action + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.action = null; + + /** + * Guardrail createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.createTime = null; + + /** + * Guardrail updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.updateTime = null; + + /** + * Guardrail etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Guardrail guardrailType. + * @member {"contentFilter"|"llmPromptSecurity"|"llmPolicy"|"modelSafety"|"codeCallback"|undefined} guardrailType + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Object.defineProperty(Guardrail.prototype, "guardrailType", { + get: $util.oneOfGetter($oneOfFields = ["contentFilter", "llmPromptSecurity", "llmPolicy", "modelSafety", "codeCallback"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Guardrail instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Guardrail + * @static + * @param {google.cloud.ces.v1beta.IGuardrail=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Guardrail} Guardrail instance + */ + Guardrail.create = function create(properties) { + return new Guardrail(properties); + }; + + /** + * Encodes the specified Guardrail message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Guardrail + * @static + * @param {google.cloud.ces.v1beta.IGuardrail} message Guardrail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Guardrail.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enabled); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + $root.google.cloud.ces.v1beta.TriggerAction.encode(message.action, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.contentFilter != null && Object.hasOwnProperty.call(message, "contentFilter")) + $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.encode(message.contentFilter, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.llmPromptSecurity != null && Object.hasOwnProperty.call(message, "llmPromptSecurity")) + $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.encode(message.llmPromptSecurity, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.llmPolicy != null && Object.hasOwnProperty.call(message, "llmPolicy")) + $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.encode(message.llmPolicy, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + if (message.modelSafety != null && Object.hasOwnProperty.call(message, "modelSafety")) + $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.encode(message.modelSafety, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.codeCallback != null && Object.hasOwnProperty.call(message, "codeCallback")) + $root.google.cloud.ces.v1beta.Guardrail.CodeCallback.encode(message.codeCallback, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Guardrail message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail + * @static + * @param {google.cloud.ces.v1beta.IGuardrail} message Guardrail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Guardrail.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Guardrail message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Guardrail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Guardrail} Guardrail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Guardrail.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 8: { + message.contentFilter = $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.decode(reader, reader.uint32()); + break; + } + case 9: { + message.llmPromptSecurity = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.decode(reader, reader.uint32()); + break; + } + case 10: { + message.llmPolicy = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.decode(reader, reader.uint32()); + break; + } + case 13: { + message.modelSafety = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.decode(reader, reader.uint32()); + break; + } + case 14: { + message.codeCallback = $root.google.cloud.ces.v1beta.Guardrail.CodeCallback.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.enabled = reader.bool(); + break; + } + case 5: { + message.action = $root.google.cloud.ces.v1beta.TriggerAction.decode(reader, reader.uint32()); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Guardrail message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Guardrail} Guardrail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Guardrail.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Guardrail message. + * @function verify + * @memberof google.cloud.ces.v1beta.Guardrail + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Guardrail.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.contentFilter != null && message.hasOwnProperty("contentFilter")) { + properties.guardrailType = 1; + { + var error = $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.verify(message.contentFilter); + if (error) + return "contentFilter." + error; + } + } + if (message.llmPromptSecurity != null && message.hasOwnProperty("llmPromptSecurity")) { + if (properties.guardrailType === 1) + return "guardrailType: multiple values"; + properties.guardrailType = 1; + { + var error = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.verify(message.llmPromptSecurity); + if (error) + return "llmPromptSecurity." + error; + } + } + if (message.llmPolicy != null && message.hasOwnProperty("llmPolicy")) { + if (properties.guardrailType === 1) + return "guardrailType: multiple values"; + properties.guardrailType = 1; + { + var error = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.verify(message.llmPolicy); + if (error) + return "llmPolicy." + error; + } + } + if (message.modelSafety != null && message.hasOwnProperty("modelSafety")) { + if (properties.guardrailType === 1) + return "guardrailType: multiple values"; + properties.guardrailType = 1; + { + var error = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.verify(message.modelSafety); + if (error) + return "modelSafety." + error; + } + } + if (message.codeCallback != null && message.hasOwnProperty("codeCallback")) { + if (properties.guardrailType === 1) + return "guardrailType: multiple values"; + properties.guardrailType = 1; + { + var error = $root.google.cloud.ces.v1beta.Guardrail.CodeCallback.verify(message.codeCallback); + if (error) + return "codeCallback." + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.action != null && message.hasOwnProperty("action")) { + var error = $root.google.cloud.ces.v1beta.TriggerAction.verify(message.action); + if (error) + return "action." + error; + } + 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a Guardrail message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Guardrail + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Guardrail} Guardrail + */ + Guardrail.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Guardrail) + return object; + var message = new $root.google.cloud.ces.v1beta.Guardrail(); + if (object.contentFilter != null) { + if (typeof object.contentFilter !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.contentFilter: object expected"); + message.contentFilter = $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.fromObject(object.contentFilter); + } + if (object.llmPromptSecurity != null) { + if (typeof object.llmPromptSecurity !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.llmPromptSecurity: object expected"); + message.llmPromptSecurity = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.fromObject(object.llmPromptSecurity); + } + if (object.llmPolicy != null) { + if (typeof object.llmPolicy !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.llmPolicy: object expected"); + message.llmPolicy = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.fromObject(object.llmPolicy); + } + if (object.modelSafety != null) { + if (typeof object.modelSafety !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.modelSafety: object expected"); + message.modelSafety = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.fromObject(object.modelSafety); + } + if (object.codeCallback != null) { + if (typeof object.codeCallback !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.codeCallback: object expected"); + message.codeCallback = $root.google.cloud.ces.v1beta.Guardrail.CodeCallback.fromObject(object.codeCallback); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.action != null) { + if (typeof object.action !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.action: object expected"); + message.action = $root.google.cloud.ces.v1beta.TriggerAction.fromObject(object.action); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.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.ces.v1beta.Guardrail.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a Guardrail message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Guardrail + * @static + * @param {google.cloud.ces.v1beta.Guardrail} message Guardrail + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Guardrail.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.enabled = false; + object.action = null; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.action != null && message.hasOwnProperty("action")) + object.action = $root.google.cloud.ces.v1beta.TriggerAction.toObject(message.action, options); + 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.contentFilter != null && message.hasOwnProperty("contentFilter")) { + object.contentFilter = $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.toObject(message.contentFilter, options); + if (options.oneofs) + object.guardrailType = "contentFilter"; + } + if (message.llmPromptSecurity != null && message.hasOwnProperty("llmPromptSecurity")) { + object.llmPromptSecurity = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.toObject(message.llmPromptSecurity, options); + if (options.oneofs) + object.guardrailType = "llmPromptSecurity"; + } + if (message.llmPolicy != null && message.hasOwnProperty("llmPolicy")) { + object.llmPolicy = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.toObject(message.llmPolicy, options); + if (options.oneofs) + object.guardrailType = "llmPolicy"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.modelSafety != null && message.hasOwnProperty("modelSafety")) { + object.modelSafety = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.toObject(message.modelSafety, options); + if (options.oneofs) + object.guardrailType = "modelSafety"; + } + if (message.codeCallback != null && message.hasOwnProperty("codeCallback")) { + object.codeCallback = $root.google.cloud.ces.v1beta.Guardrail.CodeCallback.toObject(message.codeCallback, options); + if (options.oneofs) + object.guardrailType = "codeCallback"; + } + return object; + }; + + /** + * Converts this Guardrail to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + * @returns {Object.} JSON object + */ + Guardrail.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Guardrail + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Guardrail + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Guardrail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail"; + }; + + Guardrail.ContentFilter = (function() { + + /** + * Properties of a ContentFilter. + * @memberof google.cloud.ces.v1beta.Guardrail + * @interface IContentFilter + * @property {Array.|null} [bannedContents] ContentFilter bannedContents + * @property {Array.|null} [bannedContentsInUserInput] ContentFilter bannedContentsInUserInput + * @property {Array.|null} [bannedContentsInAgentResponse] ContentFilter bannedContentsInAgentResponse + * @property {google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType|null} [matchType] ContentFilter matchType + * @property {boolean|null} [disregardDiacritics] ContentFilter disregardDiacritics + */ + + /** + * Constructs a new ContentFilter. + * @memberof google.cloud.ces.v1beta.Guardrail + * @classdesc Represents a ContentFilter. + * @implements IContentFilter + * @constructor + * @param {google.cloud.ces.v1beta.Guardrail.IContentFilter=} [properties] Properties to set + */ + function ContentFilter(properties) { + this.bannedContents = []; + this.bannedContentsInUserInput = []; + this.bannedContentsInAgentResponse = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContentFilter bannedContents. + * @member {Array.} bannedContents + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @instance + */ + ContentFilter.prototype.bannedContents = $util.emptyArray; + + /** + * ContentFilter bannedContentsInUserInput. + * @member {Array.} bannedContentsInUserInput + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @instance + */ + ContentFilter.prototype.bannedContentsInUserInput = $util.emptyArray; + + /** + * ContentFilter bannedContentsInAgentResponse. + * @member {Array.} bannedContentsInAgentResponse + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @instance + */ + ContentFilter.prototype.bannedContentsInAgentResponse = $util.emptyArray; + + /** + * ContentFilter matchType. + * @member {google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType} matchType + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @instance + */ + ContentFilter.prototype.matchType = 0; + + /** + * ContentFilter disregardDiacritics. + * @member {boolean} disregardDiacritics + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @instance + */ + ContentFilter.prototype.disregardDiacritics = false; + + /** + * Creates a new ContentFilter instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @static + * @param {google.cloud.ces.v1beta.Guardrail.IContentFilter=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Guardrail.ContentFilter} ContentFilter instance + */ + ContentFilter.create = function create(properties) { + return new ContentFilter(properties); + }; + + /** + * Encodes the specified ContentFilter message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ContentFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @static + * @param {google.cloud.ces.v1beta.Guardrail.IContentFilter} message ContentFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bannedContents != null && message.bannedContents.length) + for (var i = 0; i < message.bannedContents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bannedContents[i]); + if (message.bannedContentsInUserInput != null && message.bannedContentsInUserInput.length) + for (var i = 0; i < message.bannedContentsInUserInput.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bannedContentsInUserInput[i]); + if (message.bannedContentsInAgentResponse != null && message.bannedContentsInAgentResponse.length) + for (var i = 0; i < message.bannedContentsInAgentResponse.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.bannedContentsInAgentResponse[i]); + if (message.matchType != null && Object.hasOwnProperty.call(message, "matchType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.matchType); + if (message.disregardDiacritics != null && Object.hasOwnProperty.call(message, "disregardDiacritics")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disregardDiacritics); + return writer; + }; + + /** + * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ContentFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @static + * @param {google.cloud.ces.v1beta.Guardrail.IContentFilter} message ContentFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContentFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Guardrail.ContentFilter} ContentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentFilter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.ContentFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.bannedContents && message.bannedContents.length)) + message.bannedContents = []; + message.bannedContents.push(reader.string()); + break; + } + case 2: { + if (!(message.bannedContentsInUserInput && message.bannedContentsInUserInput.length)) + message.bannedContentsInUserInput = []; + message.bannedContentsInUserInput.push(reader.string()); + break; + } + case 3: { + if (!(message.bannedContentsInAgentResponse && message.bannedContentsInAgentResponse.length)) + message.bannedContentsInAgentResponse = []; + message.bannedContentsInAgentResponse.push(reader.string()); + break; + } + case 4: { + message.matchType = reader.int32(); + break; + } + case 5: { + message.disregardDiacritics = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContentFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Guardrail.ContentFilter} ContentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContentFilter message. + * @function verify + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContentFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bannedContents != null && message.hasOwnProperty("bannedContents")) { + if (!Array.isArray(message.bannedContents)) + return "bannedContents: array expected"; + for (var i = 0; i < message.bannedContents.length; ++i) + if (!$util.isString(message.bannedContents[i])) + return "bannedContents: string[] expected"; + } + if (message.bannedContentsInUserInput != null && message.hasOwnProperty("bannedContentsInUserInput")) { + if (!Array.isArray(message.bannedContentsInUserInput)) + return "bannedContentsInUserInput: array expected"; + for (var i = 0; i < message.bannedContentsInUserInput.length; ++i) + if (!$util.isString(message.bannedContentsInUserInput[i])) + return "bannedContentsInUserInput: string[] expected"; + } + if (message.bannedContentsInAgentResponse != null && message.hasOwnProperty("bannedContentsInAgentResponse")) { + if (!Array.isArray(message.bannedContentsInAgentResponse)) + return "bannedContentsInAgentResponse: array expected"; + for (var i = 0; i < message.bannedContentsInAgentResponse.length; ++i) + if (!$util.isString(message.bannedContentsInAgentResponse[i])) + return "bannedContentsInAgentResponse: string[] expected"; + } + if (message.matchType != null && message.hasOwnProperty("matchType")) + switch (message.matchType) { + default: + return "matchType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.disregardDiacritics != null && message.hasOwnProperty("disregardDiacritics")) + if (typeof message.disregardDiacritics !== "boolean") + return "disregardDiacritics: boolean expected"; + return null; + }; + + /** + * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Guardrail.ContentFilter} ContentFilter + */ + ContentFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.ContentFilter) + return object; + var message = new $root.google.cloud.ces.v1beta.Guardrail.ContentFilter(); + if (object.bannedContents) { + if (!Array.isArray(object.bannedContents)) + throw TypeError(".google.cloud.ces.v1beta.Guardrail.ContentFilter.bannedContents: array expected"); + message.bannedContents = []; + for (var i = 0; i < object.bannedContents.length; ++i) + message.bannedContents[i] = String(object.bannedContents[i]); + } + if (object.bannedContentsInUserInput) { + if (!Array.isArray(object.bannedContentsInUserInput)) + throw TypeError(".google.cloud.ces.v1beta.Guardrail.ContentFilter.bannedContentsInUserInput: array expected"); + message.bannedContentsInUserInput = []; + for (var i = 0; i < object.bannedContentsInUserInput.length; ++i) + message.bannedContentsInUserInput[i] = String(object.bannedContentsInUserInput[i]); + } + if (object.bannedContentsInAgentResponse) { + if (!Array.isArray(object.bannedContentsInAgentResponse)) + throw TypeError(".google.cloud.ces.v1beta.Guardrail.ContentFilter.bannedContentsInAgentResponse: array expected"); + message.bannedContentsInAgentResponse = []; + for (var i = 0; i < object.bannedContentsInAgentResponse.length; ++i) + message.bannedContentsInAgentResponse[i] = String(object.bannedContentsInAgentResponse[i]); + } + switch (object.matchType) { + default: + if (typeof object.matchType === "number") { + message.matchType = object.matchType; + break; + } + break; + case "MATCH_TYPE_UNSPECIFIED": + case 0: + message.matchType = 0; + break; + case "SIMPLE_STRING_MATCH": + case 1: + message.matchType = 1; + break; + case "WORD_BOUNDARY_STRING_MATCH": + case 2: + message.matchType = 2; + break; + case "REGEXP_MATCH": + case 3: + message.matchType = 3; + break; + } + if (object.disregardDiacritics != null) + message.disregardDiacritics = Boolean(object.disregardDiacritics); + return message; + }; + + /** + * Creates a plain object from a ContentFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ContentFilter} message ContentFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContentFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bannedContents = []; + object.bannedContentsInUserInput = []; + object.bannedContentsInAgentResponse = []; + } + if (options.defaults) { + object.matchType = options.enums === String ? "MATCH_TYPE_UNSPECIFIED" : 0; + object.disregardDiacritics = false; + } + if (message.bannedContents && message.bannedContents.length) { + object.bannedContents = []; + for (var j = 0; j < message.bannedContents.length; ++j) + object.bannedContents[j] = message.bannedContents[j]; + } + if (message.bannedContentsInUserInput && message.bannedContentsInUserInput.length) { + object.bannedContentsInUserInput = []; + for (var j = 0; j < message.bannedContentsInUserInput.length; ++j) + object.bannedContentsInUserInput[j] = message.bannedContentsInUserInput[j]; + } + if (message.bannedContentsInAgentResponse && message.bannedContentsInAgentResponse.length) { + object.bannedContentsInAgentResponse = []; + for (var j = 0; j < message.bannedContentsInAgentResponse.length; ++j) + object.bannedContentsInAgentResponse[j] = message.bannedContentsInAgentResponse[j]; + } + if (message.matchType != null && message.hasOwnProperty("matchType")) + object.matchType = options.enums === String ? $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType[message.matchType] === undefined ? message.matchType : $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType[message.matchType] : message.matchType; + if (message.disregardDiacritics != null && message.hasOwnProperty("disregardDiacritics")) + object.disregardDiacritics = message.disregardDiacritics; + return object; + }; + + /** + * Converts this ContentFilter to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @instance + * @returns {Object.} JSON object + */ + ContentFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContentFilter + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContentFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.ContentFilter"; + }; + + /** + * MatchType enum. + * @name google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType + * @enum {number} + * @property {number} MATCH_TYPE_UNSPECIFIED=0 MATCH_TYPE_UNSPECIFIED value + * @property {number} SIMPLE_STRING_MATCH=1 SIMPLE_STRING_MATCH value + * @property {number} WORD_BOUNDARY_STRING_MATCH=2 WORD_BOUNDARY_STRING_MATCH value + * @property {number} REGEXP_MATCH=3 REGEXP_MATCH value + */ + ContentFilter.MatchType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MATCH_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SIMPLE_STRING_MATCH"] = 1; + values[valuesById[2] = "WORD_BOUNDARY_STRING_MATCH"] = 2; + values[valuesById[3] = "REGEXP_MATCH"] = 3; + return values; + })(); + + return ContentFilter; + })(); + + Guardrail.LlmPromptSecurity = (function() { + + /** + * Properties of a LlmPromptSecurity. + * @memberof google.cloud.ces.v1beta.Guardrail + * @interface ILlmPromptSecurity + * @property {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null} [defaultSettings] LlmPromptSecurity defaultSettings + * @property {google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null} [customPolicy] LlmPromptSecurity customPolicy + * @property {boolean|null} [failOpen] LlmPromptSecurity failOpen + */ + + /** + * Constructs a new LlmPromptSecurity. + * @memberof google.cloud.ces.v1beta.Guardrail + * @classdesc Represents a LlmPromptSecurity. + * @implements ILlmPromptSecurity + * @constructor + * @param {google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity=} [properties] Properties to set + */ + function LlmPromptSecurity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LlmPromptSecurity defaultSettings. + * @member {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null|undefined} defaultSettings + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @instance + */ + LlmPromptSecurity.prototype.defaultSettings = null; + + /** + * LlmPromptSecurity customPolicy. + * @member {google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null|undefined} customPolicy + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @instance + */ + LlmPromptSecurity.prototype.customPolicy = null; + + /** + * LlmPromptSecurity failOpen. + * @member {boolean} failOpen + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @instance + */ + LlmPromptSecurity.prototype.failOpen = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LlmPromptSecurity securityConfig. + * @member {"defaultSettings"|"customPolicy"|undefined} securityConfig + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @instance + */ + Object.defineProperty(LlmPromptSecurity.prototype, "securityConfig", { + get: $util.oneOfGetter($oneOfFields = ["defaultSettings", "customPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LlmPromptSecurity instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity} LlmPromptSecurity instance + */ + LlmPromptSecurity.create = function create(properties) { + return new LlmPromptSecurity(properties); + }; + + /** + * Encodes the specified LlmPromptSecurity message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity} message LlmPromptSecurity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmPromptSecurity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaultSettings != null && Object.hasOwnProperty.call(message, "defaultSettings")) + $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.encode(message.defaultSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.customPolicy != null && Object.hasOwnProperty.call(message, "customPolicy")) + $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.encode(message.customPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.failOpen != null && Object.hasOwnProperty.call(message, "failOpen")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.failOpen); + return writer; + }; + + /** + * Encodes the specified LlmPromptSecurity message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity} message LlmPromptSecurity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmPromptSecurity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LlmPromptSecurity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity} LlmPromptSecurity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmPromptSecurity.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.defaultSettings = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.customPolicy = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.failOpen = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LlmPromptSecurity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity} LlmPromptSecurity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmPromptSecurity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LlmPromptSecurity message. + * @function verify + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LlmPromptSecurity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.defaultSettings != null && message.hasOwnProperty("defaultSettings")) { + properties.securityConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify(message.defaultSettings); + if (error) + return "defaultSettings." + error; + } + } + if (message.customPolicy != null && message.hasOwnProperty("customPolicy")) { + if (properties.securityConfig === 1) + return "securityConfig: multiple values"; + properties.securityConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.verify(message.customPolicy); + if (error) + return "customPolicy." + error; + } + } + if (message.failOpen != null && message.hasOwnProperty("failOpen")) + if (typeof message.failOpen !== "boolean") + return "failOpen: boolean expected"; + return null; + }; + + /** + * Creates a LlmPromptSecurity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity} LlmPromptSecurity + */ + LlmPromptSecurity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity) + return object; + var message = new $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity(); + if (object.defaultSettings != null) { + if (typeof object.defaultSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.defaultSettings: object expected"); + message.defaultSettings = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.fromObject(object.defaultSettings); + } + if (object.customPolicy != null) { + if (typeof object.customPolicy !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.customPolicy: object expected"); + message.customPolicy = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.fromObject(object.customPolicy); + } + if (object.failOpen != null) + message.failOpen = Boolean(object.failOpen); + return message; + }; + + /** + * Creates a plain object from a LlmPromptSecurity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @static + * @param {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity} message LlmPromptSecurity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LlmPromptSecurity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.failOpen = false; + if (message.defaultSettings != null && message.hasOwnProperty("defaultSettings")) { + object.defaultSettings = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.toObject(message.defaultSettings, options); + if (options.oneofs) + object.securityConfig = "defaultSettings"; + } + if (message.customPolicy != null && message.hasOwnProperty("customPolicy")) { + object.customPolicy = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.toObject(message.customPolicy, options); + if (options.oneofs) + object.securityConfig = "customPolicy"; + } + if (message.failOpen != null && message.hasOwnProperty("failOpen")) + object.failOpen = message.failOpen; + return object; + }; + + /** + * Converts this LlmPromptSecurity to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @instance + * @returns {Object.} JSON object + */ + LlmPromptSecurity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LlmPromptSecurity + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LlmPromptSecurity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity"; + }; + + LlmPromptSecurity.DefaultSecuritySettings = (function() { + + /** + * Properties of a DefaultSecuritySettings. + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @interface IDefaultSecuritySettings + * @property {string|null} [defaultPromptTemplate] DefaultSecuritySettings defaultPromptTemplate + */ + + /** + * Constructs a new DefaultSecuritySettings. + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @classdesc Represents a DefaultSecuritySettings. + * @implements IDefaultSecuritySettings + * @constructor + * @param {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings=} [properties] Properties to set + */ + function DefaultSecuritySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DefaultSecuritySettings defaultPromptTemplate. + * @member {string} defaultPromptTemplate + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @instance + */ + DefaultSecuritySettings.prototype.defaultPromptTemplate = ""; + + /** + * Creates a new DefaultSecuritySettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings instance + */ + DefaultSecuritySettings.create = function create(properties) { + return new DefaultSecuritySettings(properties); + }; + + /** + * Encodes the specified DefaultSecuritySettings message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings} message DefaultSecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultSecuritySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaultPromptTemplate != null && Object.hasOwnProperty.call(message, "defaultPromptTemplate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.defaultPromptTemplate); + return writer; + }; + + /** + * Encodes the specified DefaultSecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings} message DefaultSecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultSecuritySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DefaultSecuritySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultSecuritySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.defaultPromptTemplate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DefaultSecuritySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultSecuritySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DefaultSecuritySettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DefaultSecuritySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaultPromptTemplate != null && message.hasOwnProperty("defaultPromptTemplate")) + if (!$util.isString(message.defaultPromptTemplate)) + return "defaultPromptTemplate: string expected"; + return null; + }; + + /** + * Creates a DefaultSecuritySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings + */ + DefaultSecuritySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings) + return object; + var message = new $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings(); + if (object.defaultPromptTemplate != null) + message.defaultPromptTemplate = String(object.defaultPromptTemplate); + return message; + }; + + /** + * Creates a plain object from a DefaultSecuritySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} message DefaultSecuritySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DefaultSecuritySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.defaultPromptTemplate = ""; + if (message.defaultPromptTemplate != null && message.hasOwnProperty("defaultPromptTemplate")) + object.defaultPromptTemplate = message.defaultPromptTemplate; + return object; + }; + + /** + * Converts this DefaultSecuritySettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @instance + * @returns {Object.} JSON object + */ + DefaultSecuritySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DefaultSecuritySettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DefaultSecuritySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings"; + }; + + return DefaultSecuritySettings; + })(); + + return LlmPromptSecurity; + })(); + + Guardrail.LlmPolicy = (function() { + + /** + * Properties of a LlmPolicy. + * @memberof google.cloud.ces.v1beta.Guardrail + * @interface ILlmPolicy + * @property {number|null} [maxConversationMessages] LlmPolicy maxConversationMessages + * @property {google.cloud.ces.v1beta.IModelSettings|null} [modelSettings] LlmPolicy modelSettings + * @property {string|null} [prompt] LlmPolicy prompt + * @property {google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope|null} [policyScope] LlmPolicy policyScope + * @property {boolean|null} [failOpen] LlmPolicy failOpen + * @property {boolean|null} [allowShortUtterance] LlmPolicy allowShortUtterance + */ + + /** + * Constructs a new LlmPolicy. + * @memberof google.cloud.ces.v1beta.Guardrail + * @classdesc Represents a LlmPolicy. + * @implements ILlmPolicy + * @constructor + * @param {google.cloud.ces.v1beta.Guardrail.ILlmPolicy=} [properties] Properties to set + */ + function LlmPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LlmPolicy maxConversationMessages. + * @member {number} maxConversationMessages + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @instance + */ + LlmPolicy.prototype.maxConversationMessages = 0; + + /** + * LlmPolicy modelSettings. + * @member {google.cloud.ces.v1beta.IModelSettings|null|undefined} modelSettings + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @instance + */ + LlmPolicy.prototype.modelSettings = null; + + /** + * LlmPolicy prompt. + * @member {string} prompt + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @instance + */ + LlmPolicy.prototype.prompt = ""; + + /** + * LlmPolicy policyScope. + * @member {google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope} policyScope + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @instance + */ + LlmPolicy.prototype.policyScope = 0; + + /** + * LlmPolicy failOpen. + * @member {boolean} failOpen + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @instance + */ + LlmPolicy.prototype.failOpen = false; + + /** + * LlmPolicy allowShortUtterance. + * @member {boolean} allowShortUtterance + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @instance + */ + LlmPolicy.prototype.allowShortUtterance = false; + + /** + * Creates a new LlmPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ILlmPolicy=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPolicy} LlmPolicy instance + */ + LlmPolicy.create = function create(properties) { + return new LlmPolicy(properties); + }; + + /** + * Encodes the specified LlmPolicy message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ILlmPolicy} message LlmPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxConversationMessages != null && Object.hasOwnProperty.call(message, "maxConversationMessages")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxConversationMessages); + if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) + $root.google.cloud.ces.v1beta.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.prompt); + if (message.policyScope != null && Object.hasOwnProperty.call(message, "policyScope")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.policyScope); + if (message.failOpen != null && Object.hasOwnProperty.call(message, "failOpen")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.failOpen); + if (message.allowShortUtterance != null && Object.hasOwnProperty.call(message, "allowShortUtterance")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowShortUtterance); + return writer; + }; + + /** + * Encodes the specified LlmPolicy message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ILlmPolicy} message LlmPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LlmPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPolicy} LlmPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.maxConversationMessages = reader.int32(); + break; + } + case 2: { + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.decode(reader, reader.uint32()); + break; + } + case 3: { + message.prompt = reader.string(); + break; + } + case 4: { + message.policyScope = reader.int32(); + break; + } + case 5: { + message.failOpen = reader.bool(); + break; + } + case 6: { + message.allowShortUtterance = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LlmPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPolicy} LlmPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LlmPolicy message. + * @function verify + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LlmPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxConversationMessages != null && message.hasOwnProperty("maxConversationMessages")) + if (!$util.isInteger(message.maxConversationMessages)) + return "maxConversationMessages: integer expected"; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { + var error = $root.google.cloud.ces.v1beta.ModelSettings.verify(message.modelSettings); + if (error) + return "modelSettings." + error; + } + if (message.prompt != null && message.hasOwnProperty("prompt")) + if (!$util.isString(message.prompt)) + return "prompt: string expected"; + if (message.policyScope != null && message.hasOwnProperty("policyScope")) + switch (message.policyScope) { + default: + return "policyScope: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.failOpen != null && message.hasOwnProperty("failOpen")) + if (typeof message.failOpen !== "boolean") + return "failOpen: boolean expected"; + if (message.allowShortUtterance != null && message.hasOwnProperty("allowShortUtterance")) + if (typeof message.allowShortUtterance !== "boolean") + return "allowShortUtterance: boolean expected"; + return null; + }; + + /** + * Creates a LlmPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPolicy} LlmPolicy + */ + LlmPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy) + return object; + var message = new $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy(); + if (object.maxConversationMessages != null) + message.maxConversationMessages = object.maxConversationMessages | 0; + if (object.modelSettings != null) { + if (typeof object.modelSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.LlmPolicy.modelSettings: object expected"); + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.fromObject(object.modelSettings); + } + if (object.prompt != null) + message.prompt = String(object.prompt); + switch (object.policyScope) { + default: + if (typeof object.policyScope === "number") { + message.policyScope = object.policyScope; + break; + } + break; + case "POLICY_SCOPE_UNSPECIFIED": + case 0: + message.policyScope = 0; + break; + case "USER_QUERY": + case 1: + message.policyScope = 1; + break; + case "AGENT_RESPONSE": + case 2: + message.policyScope = 2; + break; + case "USER_QUERY_AND_AGENT_RESPONSE": + case 3: + message.policyScope = 3; + break; + } + if (object.failOpen != null) + message.failOpen = Boolean(object.failOpen); + if (object.allowShortUtterance != null) + message.allowShortUtterance = Boolean(object.allowShortUtterance); + return message; + }; + + /** + * Creates a plain object from a LlmPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @static + * @param {google.cloud.ces.v1beta.Guardrail.LlmPolicy} message LlmPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LlmPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxConversationMessages = 0; + object.modelSettings = null; + object.prompt = ""; + object.policyScope = options.enums === String ? "POLICY_SCOPE_UNSPECIFIED" : 0; + object.failOpen = false; + object.allowShortUtterance = false; + } + if (message.maxConversationMessages != null && message.hasOwnProperty("maxConversationMessages")) + object.maxConversationMessages = message.maxConversationMessages; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) + object.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.toObject(message.modelSettings, options); + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = message.prompt; + if (message.policyScope != null && message.hasOwnProperty("policyScope")) + object.policyScope = options.enums === String ? $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope[message.policyScope] === undefined ? message.policyScope : $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope[message.policyScope] : message.policyScope; + if (message.failOpen != null && message.hasOwnProperty("failOpen")) + object.failOpen = message.failOpen; + if (message.allowShortUtterance != null && message.hasOwnProperty("allowShortUtterance")) + object.allowShortUtterance = message.allowShortUtterance; + return object; + }; + + /** + * Converts this LlmPolicy to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @instance + * @returns {Object.} JSON object + */ + LlmPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LlmPolicy + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LlmPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.LlmPolicy"; + }; + + /** + * PolicyScope enum. + * @name google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope + * @enum {number} + * @property {number} POLICY_SCOPE_UNSPECIFIED=0 POLICY_SCOPE_UNSPECIFIED value + * @property {number} USER_QUERY=1 USER_QUERY value + * @property {number} AGENT_RESPONSE=2 AGENT_RESPONSE value + * @property {number} USER_QUERY_AND_AGENT_RESPONSE=3 USER_QUERY_AND_AGENT_RESPONSE value + */ + LlmPolicy.PolicyScope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "POLICY_SCOPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER_QUERY"] = 1; + values[valuesById[2] = "AGENT_RESPONSE"] = 2; + values[valuesById[3] = "USER_QUERY_AND_AGENT_RESPONSE"] = 3; + return values; + })(); + + return LlmPolicy; + })(); + + Guardrail.ModelSafety = (function() { + + /** + * Properties of a ModelSafety. + * @memberof google.cloud.ces.v1beta.Guardrail + * @interface IModelSafety + * @property {Array.|null} [safetySettings] ModelSafety safetySettings + */ + + /** + * Constructs a new ModelSafety. + * @memberof google.cloud.ces.v1beta.Guardrail + * @classdesc Represents a ModelSafety. + * @implements IModelSafety + * @constructor + * @param {google.cloud.ces.v1beta.Guardrail.IModelSafety=} [properties] Properties to set + */ + function ModelSafety(properties) { + this.safetySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelSafety safetySettings. + * @member {Array.} safetySettings + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @instance + */ + ModelSafety.prototype.safetySettings = $util.emptyArray; + + /** + * Creates a new ModelSafety instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @static + * @param {google.cloud.ces.v1beta.Guardrail.IModelSafety=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety} ModelSafety instance + */ + ModelSafety.create = function create(properties) { + return new ModelSafety(properties); + }; + + /** + * Encodes the specified ModelSafety message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @static + * @param {google.cloud.ces.v1beta.Guardrail.IModelSafety} message ModelSafety message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelSafety.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.safetySettings != null && message.safetySettings.length) + for (var i = 0; i < message.safetySettings.length; ++i) + $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModelSafety message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @static + * @param {google.cloud.ces.v1beta.Guardrail.IModelSafety} message ModelSafety message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelSafety.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelSafety message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety} ModelSafety + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelSafety.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.ModelSafety(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.safetySettings && message.safetySettings.length)) + message.safetySettings = []; + message.safetySettings.push($root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelSafety message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety} ModelSafety + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelSafety.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelSafety message. + * @function verify + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelSafety.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.safetySettings != null && message.hasOwnProperty("safetySettings")) { + if (!Array.isArray(message.safetySettings)) + return "safetySettings: array expected"; + for (var i = 0; i < message.safetySettings.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.verify(message.safetySettings[i]); + if (error) + return "safetySettings." + error; + } + } + return null; + }; + + /** + * Creates a ModelSafety message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety} ModelSafety + */ + ModelSafety.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.ModelSafety) + return object; + var message = new $root.google.cloud.ces.v1beta.Guardrail.ModelSafety(); + if (object.safetySettings) { + if (!Array.isArray(object.safetySettings)) + throw TypeError(".google.cloud.ces.v1beta.Guardrail.ModelSafety.safetySettings: array expected"); + message.safetySettings = []; + for (var i = 0; i < object.safetySettings.length; ++i) { + if (typeof object.safetySettings[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.ModelSafety.safetySettings: object expected"); + message.safetySettings[i] = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.fromObject(object.safetySettings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ModelSafety message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ModelSafety} message ModelSafety + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelSafety.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.safetySettings = []; + if (message.safetySettings && message.safetySettings.length) { + object.safetySettings = []; + for (var j = 0; j < message.safetySettings.length; ++j) + object.safetySettings[j] = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.toObject(message.safetySettings[j], options); + } + return object; + }; + + /** + * Converts this ModelSafety to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @instance + * @returns {Object.} JSON object + */ + ModelSafety.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelSafety + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelSafety.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.ModelSafety"; + }; + + ModelSafety.SafetySetting = (function() { + + /** + * Properties of a SafetySetting. + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @interface ISafetySetting + * @property {google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory|null} [category] SafetySetting category + * @property {google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold|null} [threshold] SafetySetting threshold + */ + + /** + * Constructs a new SafetySetting. + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @classdesc Represents a SafetySetting. + * @implements ISafetySetting + * @constructor + * @param {google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting=} [properties] Properties to set + */ + function SafetySetting(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SafetySetting category. + * @member {google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory} category + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @instance + */ + SafetySetting.prototype.category = 0; + + /** + * SafetySetting threshold. + * @member {google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold} threshold + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @instance + */ + SafetySetting.prototype.threshold = 0; + + /** + * Creates a new SafetySetting instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting} SafetySetting instance + */ + SafetySetting.create = function create(properties) { + return new SafetySetting(properties); + }; + + /** + * Encodes the specified SafetySetting message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting} message SafetySetting message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetySetting.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.category); + if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.threshold); + return writer; + }; + + /** + * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting} message SafetySetting message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetySetting.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SafetySetting message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting} SafetySetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetySetting.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.category = reader.int32(); + break; + } + case 2: { + message.threshold = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SafetySetting message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting} SafetySetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetySetting.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SafetySetting message. + * @function verify + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SafetySetting.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.category != null && message.hasOwnProperty("category")) + switch (message.category) { + default: + return "category: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.threshold != null && message.hasOwnProperty("threshold")) + switch (message.threshold) { + default: + return "threshold: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting} SafetySetting + */ + SafetySetting.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting) + return object; + var message = new $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting(); + switch (object.category) { + default: + if (typeof object.category === "number") { + message.category = object.category; + break; + } + break; + case "HARM_CATEGORY_UNSPECIFIED": + case 0: + message.category = 0; + break; + case "HARM_CATEGORY_HATE_SPEECH": + case 1: + message.category = 1; + break; + case "HARM_CATEGORY_DANGEROUS_CONTENT": + case 2: + message.category = 2; + break; + case "HARM_CATEGORY_HARASSMENT": + case 3: + message.category = 3; + break; + case "HARM_CATEGORY_SEXUALLY_EXPLICIT": + case 4: + message.category = 4; + break; + } + switch (object.threshold) { + default: + if (typeof object.threshold === "number") { + message.threshold = object.threshold; + break; + } + break; + case "HARM_BLOCK_THRESHOLD_UNSPECIFIED": + case 0: + message.threshold = 0; + break; + case "BLOCK_LOW_AND_ABOVE": + case 1: + message.threshold = 1; + break; + case "BLOCK_MEDIUM_AND_ABOVE": + case 2: + message.threshold = 2; + break; + case "BLOCK_ONLY_HIGH": + case 3: + message.threshold = 3; + break; + case "BLOCK_NONE": + case 4: + message.threshold = 4; + break; + case "OFF": + case 5: + message.threshold = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a SafetySetting message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting} message SafetySetting + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SafetySetting.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0; + object.threshold = options.enums === String ? "HARM_BLOCK_THRESHOLD_UNSPECIFIED" : 0; + } + if (message.category != null && message.hasOwnProperty("category")) + object.category = options.enums === String ? $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory[message.category] === undefined ? message.category : $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory[message.category] : message.category; + if (message.threshold != null && message.hasOwnProperty("threshold")) + object.threshold = options.enums === String ? $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold[message.threshold] === undefined ? message.threshold : $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold[message.threshold] : message.threshold; + return object; + }; + + /** + * Converts this SafetySetting to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @instance + * @returns {Object.} JSON object + */ + SafetySetting.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SafetySetting + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SafetySetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting"; + }; + + return SafetySetting; + })(); + + /** + * HarmCategory enum. + * @name google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory + * @enum {number} + * @property {number} HARM_CATEGORY_UNSPECIFIED=0 HARM_CATEGORY_UNSPECIFIED value + * @property {number} HARM_CATEGORY_HATE_SPEECH=1 HARM_CATEGORY_HATE_SPEECH value + * @property {number} HARM_CATEGORY_DANGEROUS_CONTENT=2 HARM_CATEGORY_DANGEROUS_CONTENT value + * @property {number} HARM_CATEGORY_HARASSMENT=3 HARM_CATEGORY_HARASSMENT value + * @property {number} HARM_CATEGORY_SEXUALLY_EXPLICIT=4 HARM_CATEGORY_SEXUALLY_EXPLICIT value + */ + ModelSafety.HarmCategory = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HARM_CATEGORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "HARM_CATEGORY_HATE_SPEECH"] = 1; + values[valuesById[2] = "HARM_CATEGORY_DANGEROUS_CONTENT"] = 2; + values[valuesById[3] = "HARM_CATEGORY_HARASSMENT"] = 3; + values[valuesById[4] = "HARM_CATEGORY_SEXUALLY_EXPLICIT"] = 4; + return values; + })(); + + /** + * HarmBlockThreshold enum. + * @name google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold + * @enum {number} + * @property {number} HARM_BLOCK_THRESHOLD_UNSPECIFIED=0 HARM_BLOCK_THRESHOLD_UNSPECIFIED value + * @property {number} BLOCK_LOW_AND_ABOVE=1 BLOCK_LOW_AND_ABOVE value + * @property {number} BLOCK_MEDIUM_AND_ABOVE=2 BLOCK_MEDIUM_AND_ABOVE value + * @property {number} BLOCK_ONLY_HIGH=3 BLOCK_ONLY_HIGH value + * @property {number} BLOCK_NONE=4 BLOCK_NONE value + * @property {number} OFF=5 OFF value + */ + ModelSafety.HarmBlockThreshold = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOCK_LOW_AND_ABOVE"] = 1; + values[valuesById[2] = "BLOCK_MEDIUM_AND_ABOVE"] = 2; + values[valuesById[3] = "BLOCK_ONLY_HIGH"] = 3; + values[valuesById[4] = "BLOCK_NONE"] = 4; + values[valuesById[5] = "OFF"] = 5; + return values; + })(); + + return ModelSafety; + })(); + + Guardrail.CodeCallback = (function() { + + /** + * Properties of a CodeCallback. + * @memberof google.cloud.ces.v1beta.Guardrail + * @interface ICodeCallback + * @property {google.cloud.ces.v1beta.ICallback|null} [beforeAgentCallback] CodeCallback beforeAgentCallback + * @property {google.cloud.ces.v1beta.ICallback|null} [afterAgentCallback] CodeCallback afterAgentCallback + * @property {google.cloud.ces.v1beta.ICallback|null} [beforeModelCallback] CodeCallback beforeModelCallback + * @property {google.cloud.ces.v1beta.ICallback|null} [afterModelCallback] CodeCallback afterModelCallback + */ + + /** + * Constructs a new CodeCallback. + * @memberof google.cloud.ces.v1beta.Guardrail + * @classdesc Represents a CodeCallback. + * @implements ICodeCallback + * @constructor + * @param {google.cloud.ces.v1beta.Guardrail.ICodeCallback=} [properties] Properties to set + */ + function CodeCallback(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CodeCallback beforeAgentCallback. + * @member {google.cloud.ces.v1beta.ICallback|null|undefined} beforeAgentCallback + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @instance + */ + CodeCallback.prototype.beforeAgentCallback = null; + + /** + * CodeCallback afterAgentCallback. + * @member {google.cloud.ces.v1beta.ICallback|null|undefined} afterAgentCallback + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @instance + */ + CodeCallback.prototype.afterAgentCallback = null; + + /** + * CodeCallback beforeModelCallback. + * @member {google.cloud.ces.v1beta.ICallback|null|undefined} beforeModelCallback + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @instance + */ + CodeCallback.prototype.beforeModelCallback = null; + + /** + * CodeCallback afterModelCallback. + * @member {google.cloud.ces.v1beta.ICallback|null|undefined} afterModelCallback + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @instance + */ + CodeCallback.prototype.afterModelCallback = null; + + /** + * Creates a new CodeCallback instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ICodeCallback=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Guardrail.CodeCallback} CodeCallback instance + */ + CodeCallback.create = function create(properties) { + return new CodeCallback(properties); + }; + + /** + * Encodes the specified CodeCallback message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.CodeCallback.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ICodeCallback} message CodeCallback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeCallback.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.beforeAgentCallback != null && Object.hasOwnProperty.call(message, "beforeAgentCallback")) + $root.google.cloud.ces.v1beta.Callback.encode(message.beforeAgentCallback, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.afterAgentCallback != null && Object.hasOwnProperty.call(message, "afterAgentCallback")) + $root.google.cloud.ces.v1beta.Callback.encode(message.afterAgentCallback, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.beforeModelCallback != null && Object.hasOwnProperty.call(message, "beforeModelCallback")) + $root.google.cloud.ces.v1beta.Callback.encode(message.beforeModelCallback, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.afterModelCallback != null && Object.hasOwnProperty.call(message, "afterModelCallback")) + $root.google.cloud.ces.v1beta.Callback.encode(message.afterModelCallback, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CodeCallback message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.CodeCallback.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ICodeCallback} message CodeCallback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeCallback.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CodeCallback message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Guardrail.CodeCallback} CodeCallback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeCallback.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.CodeCallback(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.beforeAgentCallback = $root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32()); + break; + } + case 2: { + message.afterAgentCallback = $root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32()); + break; + } + case 3: { + message.beforeModelCallback = $root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32()); + break; + } + case 4: { + message.afterModelCallback = $root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CodeCallback message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Guardrail.CodeCallback} CodeCallback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeCallback.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CodeCallback message. + * @function verify + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CodeCallback.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.beforeAgentCallback != null && message.hasOwnProperty("beforeAgentCallback")) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.beforeAgentCallback); + if (error) + return "beforeAgentCallback." + error; + } + if (message.afterAgentCallback != null && message.hasOwnProperty("afterAgentCallback")) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.afterAgentCallback); + if (error) + return "afterAgentCallback." + error; + } + if (message.beforeModelCallback != null && message.hasOwnProperty("beforeModelCallback")) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.beforeModelCallback); + if (error) + return "beforeModelCallback." + error; + } + if (message.afterModelCallback != null && message.hasOwnProperty("afterModelCallback")) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.afterModelCallback); + if (error) + return "afterModelCallback." + error; + } + return null; + }; + + /** + * Creates a CodeCallback message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Guardrail.CodeCallback} CodeCallback + */ + CodeCallback.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.CodeCallback) + return object; + var message = new $root.google.cloud.ces.v1beta.Guardrail.CodeCallback(); + if (object.beforeAgentCallback != null) { + if (typeof object.beforeAgentCallback !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.CodeCallback.beforeAgentCallback: object expected"); + message.beforeAgentCallback = $root.google.cloud.ces.v1beta.Callback.fromObject(object.beforeAgentCallback); + } + if (object.afterAgentCallback != null) { + if (typeof object.afterAgentCallback !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.CodeCallback.afterAgentCallback: object expected"); + message.afterAgentCallback = $root.google.cloud.ces.v1beta.Callback.fromObject(object.afterAgentCallback); + } + if (object.beforeModelCallback != null) { + if (typeof object.beforeModelCallback !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.CodeCallback.beforeModelCallback: object expected"); + message.beforeModelCallback = $root.google.cloud.ces.v1beta.Callback.fromObject(object.beforeModelCallback); + } + if (object.afterModelCallback != null) { + if (typeof object.afterModelCallback !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.CodeCallback.afterModelCallback: object expected"); + message.afterModelCallback = $root.google.cloud.ces.v1beta.Callback.fromObject(object.afterModelCallback); + } + return message; + }; + + /** + * Creates a plain object from a CodeCallback message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @static + * @param {google.cloud.ces.v1beta.Guardrail.CodeCallback} message CodeCallback + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CodeCallback.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.beforeAgentCallback = null; + object.afterAgentCallback = null; + object.beforeModelCallback = null; + object.afterModelCallback = null; + } + if (message.beforeAgentCallback != null && message.hasOwnProperty("beforeAgentCallback")) + object.beforeAgentCallback = $root.google.cloud.ces.v1beta.Callback.toObject(message.beforeAgentCallback, options); + if (message.afterAgentCallback != null && message.hasOwnProperty("afterAgentCallback")) + object.afterAgentCallback = $root.google.cloud.ces.v1beta.Callback.toObject(message.afterAgentCallback, options); + if (message.beforeModelCallback != null && message.hasOwnProperty("beforeModelCallback")) + object.beforeModelCallback = $root.google.cloud.ces.v1beta.Callback.toObject(message.beforeModelCallback, options); + if (message.afterModelCallback != null && message.hasOwnProperty("afterModelCallback")) + object.afterModelCallback = $root.google.cloud.ces.v1beta.Callback.toObject(message.afterModelCallback, options); + return object; + }; + + /** + * Converts this CodeCallback to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @instance + * @returns {Object.} JSON object + */ + CodeCallback.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CodeCallback + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CodeCallback.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.CodeCallback"; + }; + + return CodeCallback; + })(); + + return Guardrail; + })(); + + v1beta.Tool = (function() { + + /** + * Properties of a Tool. + * @memberof google.cloud.ces.v1beta + * @interface ITool + * @property {google.cloud.ces.v1beta.IClientFunction|null} [clientFunction] Tool clientFunction + * @property {google.cloud.ces.v1beta.IOpenApiTool|null} [openApiTool] Tool openApiTool + * @property {google.cloud.ces.v1beta.IGoogleSearchTool|null} [googleSearchTool] Tool googleSearchTool + * @property {google.cloud.ces.v1beta.IConnectorTool|null} [connectorTool] Tool connectorTool + * @property {google.cloud.ces.v1beta.IDataStoreTool|null} [dataStoreTool] Tool dataStoreTool + * @property {google.cloud.ces.v1beta.IPythonFunction|null} [pythonFunction] Tool pythonFunction + * @property {google.cloud.ces.v1beta.IMcpTool|null} [mcpTool] Tool mcpTool + * @property {google.cloud.ces.v1beta.IFileSearchTool|null} [fileSearchTool] Tool fileSearchTool + * @property {google.cloud.ces.v1beta.ISystemTool|null} [systemTool] Tool systemTool + * @property {google.cloud.ces.v1beta.IWidgetTool|null} [widgetTool] Tool widgetTool + * @property {string|null} [name] Tool name + * @property {string|null} [displayName] Tool displayName + * @property {google.cloud.ces.v1beta.ExecutionType|null} [executionType] Tool executionType + * @property {google.protobuf.ITimestamp|null} [createTime] Tool createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Tool updateTime + * @property {string|null} [etag] Tool etag + * @property {string|null} [generatedSummary] Tool generatedSummary + * @property {google.cloud.ces.v1beta.IToolFakeConfig|null} [toolFakeConfig] Tool toolFakeConfig + */ + + /** + * Constructs a new Tool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Tool. + * @implements ITool + * @constructor + * @param {google.cloud.ces.v1beta.ITool=} [properties] Properties to set + */ + function Tool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tool clientFunction. + * @member {google.cloud.ces.v1beta.IClientFunction|null|undefined} clientFunction + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.clientFunction = null; + + /** + * Tool openApiTool. + * @member {google.cloud.ces.v1beta.IOpenApiTool|null|undefined} openApiTool + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.openApiTool = null; + + /** + * Tool googleSearchTool. + * @member {google.cloud.ces.v1beta.IGoogleSearchTool|null|undefined} googleSearchTool + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.googleSearchTool = null; + + /** + * Tool connectorTool. + * @member {google.cloud.ces.v1beta.IConnectorTool|null|undefined} connectorTool + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.connectorTool = null; + + /** + * Tool dataStoreTool. + * @member {google.cloud.ces.v1beta.IDataStoreTool|null|undefined} dataStoreTool + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.dataStoreTool = null; + + /** + * Tool pythonFunction. + * @member {google.cloud.ces.v1beta.IPythonFunction|null|undefined} pythonFunction + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.pythonFunction = null; + + /** + * Tool mcpTool. + * @member {google.cloud.ces.v1beta.IMcpTool|null|undefined} mcpTool + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.mcpTool = null; + + /** + * Tool fileSearchTool. + * @member {google.cloud.ces.v1beta.IFileSearchTool|null|undefined} fileSearchTool + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.fileSearchTool = null; + + /** + * Tool systemTool. + * @member {google.cloud.ces.v1beta.ISystemTool|null|undefined} systemTool + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.systemTool = null; + + /** + * Tool widgetTool. + * @member {google.cloud.ces.v1beta.IWidgetTool|null|undefined} widgetTool + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.widgetTool = null; + + /** + * Tool name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.name = ""; + + /** + * Tool displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.displayName = ""; + + /** + * Tool executionType. + * @member {google.cloud.ces.v1beta.ExecutionType} executionType + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.executionType = 0; + + /** + * Tool createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.createTime = null; + + /** + * Tool updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.updateTime = null; + + /** + * Tool etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.etag = ""; + + /** + * Tool generatedSummary. + * @member {string} generatedSummary + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.generatedSummary = ""; + + /** + * Tool toolFakeConfig. + * @member {google.cloud.ces.v1beta.IToolFakeConfig|null|undefined} toolFakeConfig + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.toolFakeConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Tool toolType. + * @member {"clientFunction"|"openApiTool"|"googleSearchTool"|"connectorTool"|"dataStoreTool"|"pythonFunction"|"mcpTool"|"fileSearchTool"|"systemTool"|"widgetTool"|undefined} toolType + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Object.defineProperty(Tool.prototype, "toolType", { + get: $util.oneOfGetter($oneOfFields = ["clientFunction", "openApiTool", "googleSearchTool", "connectorTool", "dataStoreTool", "pythonFunction", "mcpTool", "fileSearchTool", "systemTool", "widgetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Tool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Tool + * @static + * @param {google.cloud.ces.v1beta.ITool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Tool} Tool instance + */ + Tool.create = function create(properties) { + return new Tool(properties); + }; + + /** + * Encodes the specified Tool message. Does not implicitly {@link google.cloud.ces.v1beta.Tool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Tool + * @static + * @param {google.cloud.ces.v1beta.ITool} message Tool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.clientFunction != null && Object.hasOwnProperty.call(message, "clientFunction")) + $root.google.cloud.ces.v1beta.ClientFunction.encode(message.clientFunction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.openApiTool != null && Object.hasOwnProperty.call(message, "openApiTool")) + $root.google.cloud.ces.v1beta.OpenApiTool.encode(message.openApiTool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.googleSearchTool != null && Object.hasOwnProperty.call(message, "googleSearchTool")) + $root.google.cloud.ces.v1beta.GoogleSearchTool.encode(message.googleSearchTool, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.connectorTool != null && Object.hasOwnProperty.call(message, "connectorTool")) + $root.google.cloud.ces.v1beta.ConnectorTool.encode(message.connectorTool, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.dataStoreTool != null && Object.hasOwnProperty.call(message, "dataStoreTool")) + $root.google.cloud.ces.v1beta.DataStoreTool.encode(message.dataStoreTool, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.pythonFunction != null && Object.hasOwnProperty.call(message, "pythonFunction")) + $root.google.cloud.ces.v1beta.PythonFunction.encode(message.pythonFunction, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.executionType != null && Object.hasOwnProperty.call(message, "executionType")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.executionType); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.displayName); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); + if (message.generatedSummary != null && Object.hasOwnProperty.call(message, "generatedSummary")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.generatedSummary); + if (message.mcpTool != null && Object.hasOwnProperty.call(message, "mcpTool")) + $root.google.cloud.ces.v1beta.McpTool.encode(message.mcpTool, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.fileSearchTool != null && Object.hasOwnProperty.call(message, "fileSearchTool")) + $root.google.cloud.ces.v1beta.FileSearchTool.encode(message.fileSearchTool, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.systemTool != null && Object.hasOwnProperty.call(message, "systemTool")) + $root.google.cloud.ces.v1beta.SystemTool.encode(message.systemTool, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.toolFakeConfig != null && Object.hasOwnProperty.call(message, "toolFakeConfig")) + $root.google.cloud.ces.v1beta.ToolFakeConfig.encode(message.toolFakeConfig, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.widgetTool != null && Object.hasOwnProperty.call(message, "widgetTool")) + $root.google.cloud.ces.v1beta.WidgetTool.encode(message.widgetTool, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Tool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Tool + * @static + * @param {google.cloud.ces.v1beta.ITool} message Tool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Tool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Tool} Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Tool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.clientFunction = $root.google.cloud.ces.v1beta.ClientFunction.decode(reader, reader.uint32()); + break; + } + case 3: { + message.openApiTool = $root.google.cloud.ces.v1beta.OpenApiTool.decode(reader, reader.uint32()); + break; + } + case 5: { + message.googleSearchTool = $root.google.cloud.ces.v1beta.GoogleSearchTool.decode(reader, reader.uint32()); + break; + } + case 8: { + message.connectorTool = $root.google.cloud.ces.v1beta.ConnectorTool.decode(reader, reader.uint32()); + break; + } + case 10: { + message.dataStoreTool = $root.google.cloud.ces.v1beta.DataStoreTool.decode(reader, reader.uint32()); + break; + } + case 11: { + message.pythonFunction = $root.google.cloud.ces.v1beta.PythonFunction.decode(reader, reader.uint32()); + break; + } + case 16: { + message.mcpTool = $root.google.cloud.ces.v1beta.McpTool.decode(reader, reader.uint32()); + break; + } + case 17: { + message.fileSearchTool = $root.google.cloud.ces.v1beta.FileSearchTool.decode(reader, reader.uint32()); + break; + } + case 18: { + message.systemTool = $root.google.cloud.ces.v1beta.SystemTool.decode(reader, reader.uint32()); + break; + } + case 24: { + message.widgetTool = $root.google.cloud.ces.v1beta.WidgetTool.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 13: { + message.displayName = reader.string(); + break; + } + case 12: { + message.executionType = reader.int32(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.etag = reader.string(); + break; + } + case 15: { + message.generatedSummary = reader.string(); + break; + } + case 20: { + message.toolFakeConfig = $root.google.cloud.ces.v1beta.ToolFakeConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Tool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Tool} Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tool message. + * @function verify + * @memberof google.cloud.ces.v1beta.Tool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.clientFunction != null && message.hasOwnProperty("clientFunction")) { + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.ClientFunction.verify(message.clientFunction); + if (error) + return "clientFunction." + error; + } + } + if (message.openApiTool != null && message.hasOwnProperty("openApiTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.OpenApiTool.verify(message.openApiTool); + if (error) + return "openApiTool." + error; + } + } + if (message.googleSearchTool != null && message.hasOwnProperty("googleSearchTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.GoogleSearchTool.verify(message.googleSearchTool); + if (error) + return "googleSearchTool." + error; + } + } + if (message.connectorTool != null && message.hasOwnProperty("connectorTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.ConnectorTool.verify(message.connectorTool); + if (error) + return "connectorTool." + error; + } + } + if (message.dataStoreTool != null && message.hasOwnProperty("dataStoreTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.verify(message.dataStoreTool); + if (error) + return "dataStoreTool." + error; + } + } + if (message.pythonFunction != null && message.hasOwnProperty("pythonFunction")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.PythonFunction.verify(message.pythonFunction); + if (error) + return "pythonFunction." + error; + } + } + if (message.mcpTool != null && message.hasOwnProperty("mcpTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.McpTool.verify(message.mcpTool); + if (error) + return "mcpTool." + error; + } + } + if (message.fileSearchTool != null && message.hasOwnProperty("fileSearchTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.FileSearchTool.verify(message.fileSearchTool); + if (error) + return "fileSearchTool." + error; + } + } + if (message.systemTool != null && message.hasOwnProperty("systemTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.SystemTool.verify(message.systemTool); + if (error) + return "systemTool." + error; + } + } + if (message.widgetTool != null && message.hasOwnProperty("widgetTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.WidgetTool.verify(message.widgetTool); + if (error) + return "widgetTool." + 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.executionType != null && message.hasOwnProperty("executionType")) + switch (message.executionType) { + default: + return "executionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) + if (!$util.isString(message.generatedSummary)) + return "generatedSummary: string expected"; + if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) { + var error = $root.google.cloud.ces.v1beta.ToolFakeConfig.verify(message.toolFakeConfig); + if (error) + return "toolFakeConfig." + error; + } + return null; + }; + + /** + * Creates a Tool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Tool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Tool} Tool + */ + Tool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Tool) + return object; + var message = new $root.google.cloud.ces.v1beta.Tool(); + if (object.clientFunction != null) { + if (typeof object.clientFunction !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.clientFunction: object expected"); + message.clientFunction = $root.google.cloud.ces.v1beta.ClientFunction.fromObject(object.clientFunction); + } + if (object.openApiTool != null) { + if (typeof object.openApiTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.openApiTool: object expected"); + message.openApiTool = $root.google.cloud.ces.v1beta.OpenApiTool.fromObject(object.openApiTool); + } + if (object.googleSearchTool != null) { + if (typeof object.googleSearchTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.googleSearchTool: object expected"); + message.googleSearchTool = $root.google.cloud.ces.v1beta.GoogleSearchTool.fromObject(object.googleSearchTool); + } + if (object.connectorTool != null) { + if (typeof object.connectorTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.connectorTool: object expected"); + message.connectorTool = $root.google.cloud.ces.v1beta.ConnectorTool.fromObject(object.connectorTool); + } + if (object.dataStoreTool != null) { + if (typeof object.dataStoreTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.dataStoreTool: object expected"); + message.dataStoreTool = $root.google.cloud.ces.v1beta.DataStoreTool.fromObject(object.dataStoreTool); + } + if (object.pythonFunction != null) { + if (typeof object.pythonFunction !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.pythonFunction: object expected"); + message.pythonFunction = $root.google.cloud.ces.v1beta.PythonFunction.fromObject(object.pythonFunction); + } + if (object.mcpTool != null) { + if (typeof object.mcpTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.mcpTool: object expected"); + message.mcpTool = $root.google.cloud.ces.v1beta.McpTool.fromObject(object.mcpTool); + } + if (object.fileSearchTool != null) { + if (typeof object.fileSearchTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.fileSearchTool: object expected"); + message.fileSearchTool = $root.google.cloud.ces.v1beta.FileSearchTool.fromObject(object.fileSearchTool); + } + if (object.systemTool != null) { + if (typeof object.systemTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.systemTool: object expected"); + message.systemTool = $root.google.cloud.ces.v1beta.SystemTool.fromObject(object.systemTool); + } + if (object.widgetTool != null) { + if (typeof object.widgetTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.widgetTool: object expected"); + message.widgetTool = $root.google.cloud.ces.v1beta.WidgetTool.fromObject(object.widgetTool); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.executionType) { + default: + if (typeof object.executionType === "number") { + message.executionType = object.executionType; + break; + } + break; + case "EXECUTION_TYPE_UNSPECIFIED": + case 0: + message.executionType = 0; + break; + case "SYNCHRONOUS": + case 1: + message.executionType = 1; + break; + case "ASYNCHRONOUS": + case 2: + message.executionType = 2; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.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.ces.v1beta.Tool.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.generatedSummary != null) + message.generatedSummary = String(object.generatedSummary); + if (object.toolFakeConfig != null) { + if (typeof object.toolFakeConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.toolFakeConfig: object expected"); + message.toolFakeConfig = $root.google.cloud.ces.v1beta.ToolFakeConfig.fromObject(object.toolFakeConfig); + } + return message; + }; + + /** + * Creates a plain object from a Tool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Tool + * @static + * @param {google.cloud.ces.v1beta.Tool} message Tool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.executionType = options.enums === String ? "EXECUTION_TYPE_UNSPECIFIED" : 0; + object.displayName = ""; + object.etag = ""; + object.generatedSummary = ""; + object.toolFakeConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.clientFunction != null && message.hasOwnProperty("clientFunction")) { + object.clientFunction = $root.google.cloud.ces.v1beta.ClientFunction.toObject(message.clientFunction, options); + if (options.oneofs) + object.toolType = "clientFunction"; + } + if (message.openApiTool != null && message.hasOwnProperty("openApiTool")) { + object.openApiTool = $root.google.cloud.ces.v1beta.OpenApiTool.toObject(message.openApiTool, options); + if (options.oneofs) + object.toolType = "openApiTool"; + } + if (message.googleSearchTool != null && message.hasOwnProperty("googleSearchTool")) { + object.googleSearchTool = $root.google.cloud.ces.v1beta.GoogleSearchTool.toObject(message.googleSearchTool, options); + if (options.oneofs) + object.toolType = "googleSearchTool"; + } + 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.connectorTool != null && message.hasOwnProperty("connectorTool")) { + object.connectorTool = $root.google.cloud.ces.v1beta.ConnectorTool.toObject(message.connectorTool, options); + if (options.oneofs) + object.toolType = "connectorTool"; + } + if (message.dataStoreTool != null && message.hasOwnProperty("dataStoreTool")) { + object.dataStoreTool = $root.google.cloud.ces.v1beta.DataStoreTool.toObject(message.dataStoreTool, options); + if (options.oneofs) + object.toolType = "dataStoreTool"; + } + if (message.pythonFunction != null && message.hasOwnProperty("pythonFunction")) { + object.pythonFunction = $root.google.cloud.ces.v1beta.PythonFunction.toObject(message.pythonFunction, options); + if (options.oneofs) + object.toolType = "pythonFunction"; + } + if (message.executionType != null && message.hasOwnProperty("executionType")) + object.executionType = options.enums === String ? $root.google.cloud.ces.v1beta.ExecutionType[message.executionType] === undefined ? message.executionType : $root.google.cloud.ces.v1beta.ExecutionType[message.executionType] : message.executionType; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) + object.generatedSummary = message.generatedSummary; + if (message.mcpTool != null && message.hasOwnProperty("mcpTool")) { + object.mcpTool = $root.google.cloud.ces.v1beta.McpTool.toObject(message.mcpTool, options); + if (options.oneofs) + object.toolType = "mcpTool"; + } + if (message.fileSearchTool != null && message.hasOwnProperty("fileSearchTool")) { + object.fileSearchTool = $root.google.cloud.ces.v1beta.FileSearchTool.toObject(message.fileSearchTool, options); + if (options.oneofs) + object.toolType = "fileSearchTool"; + } + if (message.systemTool != null && message.hasOwnProperty("systemTool")) { + object.systemTool = $root.google.cloud.ces.v1beta.SystemTool.toObject(message.systemTool, options); + if (options.oneofs) + object.toolType = "systemTool"; + } + if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) + object.toolFakeConfig = $root.google.cloud.ces.v1beta.ToolFakeConfig.toObject(message.toolFakeConfig, options); + if (message.widgetTool != null && message.hasOwnProperty("widgetTool")) { + object.widgetTool = $root.google.cloud.ces.v1beta.WidgetTool.toObject(message.widgetTool, options); + if (options.oneofs) + object.toolType = "widgetTool"; + } + return object; + }; + + /** + * Converts this Tool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Tool + * @instance + * @returns {Object.} JSON object + */ + Tool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Tool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Tool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Tool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Tool"; + }; + + return Tool; + })(); + + v1beta.ClientFunction = (function() { + + /** + * Properties of a ClientFunction. + * @memberof google.cloud.ces.v1beta + * @interface IClientFunction + * @property {string|null} [name] ClientFunction name + * @property {string|null} [description] ClientFunction description + * @property {google.cloud.ces.v1beta.ISchema|null} [parameters] ClientFunction parameters + * @property {google.cloud.ces.v1beta.ISchema|null} [response] ClientFunction response + */ + + /** + * Constructs a new ClientFunction. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ClientFunction. + * @implements IClientFunction + * @constructor + * @param {google.cloud.ces.v1beta.IClientFunction=} [properties] Properties to set + */ + function ClientFunction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientFunction name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.ClientFunction + * @instance + */ + ClientFunction.prototype.name = ""; + + /** + * ClientFunction description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.ClientFunction + * @instance + */ + ClientFunction.prototype.description = ""; + + /** + * ClientFunction parameters. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} parameters + * @memberof google.cloud.ces.v1beta.ClientFunction + * @instance + */ + ClientFunction.prototype.parameters = null; + + /** + * ClientFunction response. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} response + * @memberof google.cloud.ces.v1beta.ClientFunction + * @instance + */ + ClientFunction.prototype.response = null; + + /** + * Creates a new ClientFunction instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ClientFunction + * @static + * @param {google.cloud.ces.v1beta.IClientFunction=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ClientFunction} ClientFunction instance + */ + ClientFunction.create = function create(properties) { + return new ClientFunction(properties); + }; + + /** + * Encodes the specified ClientFunction message. Does not implicitly {@link google.cloud.ces.v1beta.ClientFunction.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ClientFunction + * @static + * @param {google.cloud.ces.v1beta.IClientFunction} message ClientFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientFunction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.ces.v1beta.Schema.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.cloud.ces.v1beta.Schema.encode(message.response, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ClientFunction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ClientFunction + * @static + * @param {google.cloud.ces.v1beta.IClientFunction} message ClientFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientFunction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientFunction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ClientFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ClientFunction} ClientFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientFunction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ClientFunction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.parameters = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + case 4: { + message.response = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientFunction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ClientFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ClientFunction} ClientFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientFunction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientFunction message. + * @function verify + * @memberof google.cloud.ces.v1beta.ClientFunction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientFunction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.parameters); + if (error) + return "parameters." + error; + } + if (message.response != null && message.hasOwnProperty("response")) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.response); + if (error) + return "response." + error; + } + return null; + }; + + /** + * Creates a ClientFunction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ClientFunction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ClientFunction} ClientFunction + */ + ClientFunction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ClientFunction) + return object; + var message = new $root.google.cloud.ces.v1beta.ClientFunction(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.ces.v1beta.ClientFunction.parameters: object expected"); + message.parameters = $root.google.cloud.ces.v1beta.Schema.fromObject(object.parameters); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.cloud.ces.v1beta.ClientFunction.response: object expected"); + message.response = $root.google.cloud.ces.v1beta.Schema.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from a ClientFunction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ClientFunction + * @static + * @param {google.cloud.ces.v1beta.ClientFunction} message ClientFunction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientFunction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.parameters = null; + object.response = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.ces.v1beta.Schema.toObject(message.parameters, options); + if (message.response != null && message.hasOwnProperty("response")) + object.response = $root.google.cloud.ces.v1beta.Schema.toObject(message.response, options); + return object; + }; + + /** + * Converts this ClientFunction to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ClientFunction + * @instance + * @returns {Object.} JSON object + */ + ClientFunction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientFunction + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ClientFunction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientFunction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ClientFunction"; + }; + + return ClientFunction; + })(); + + v1beta.Action = (function() { + + /** + * Properties of an Action. + * @memberof google.cloud.ces.v1beta + * @interface IAction + * @property {string|null} [connectionActionId] Action connectionActionId + * @property {google.cloud.ces.v1beta.Action.IEntityOperation|null} [entityOperation] Action entityOperation + * @property {Array.|null} [inputFields] Action inputFields + * @property {Array.|null} [outputFields] Action outputFields + */ + + /** + * Constructs a new Action. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an Action. + * @implements IAction + * @constructor + * @param {google.cloud.ces.v1beta.IAction=} [properties] Properties to set + */ + function Action(properties) { + this.inputFields = []; + this.outputFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Action connectionActionId. + * @member {string|null|undefined} connectionActionId + * @memberof google.cloud.ces.v1beta.Action + * @instance + */ + Action.prototype.connectionActionId = null; + + /** + * Action entityOperation. + * @member {google.cloud.ces.v1beta.Action.IEntityOperation|null|undefined} entityOperation + * @memberof google.cloud.ces.v1beta.Action + * @instance + */ + Action.prototype.entityOperation = null; + + /** + * Action inputFields. + * @member {Array.} inputFields + * @memberof google.cloud.ces.v1beta.Action + * @instance + */ + Action.prototype.inputFields = $util.emptyArray; + + /** + * Action outputFields. + * @member {Array.} outputFields + * @memberof google.cloud.ces.v1beta.Action + * @instance + */ + Action.prototype.outputFields = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Action actionSpec. + * @member {"connectionActionId"|"entityOperation"|undefined} actionSpec + * @memberof google.cloud.ces.v1beta.Action + * @instance + */ + Object.defineProperty(Action.prototype, "actionSpec", { + get: $util.oneOfGetter($oneOfFields = ["connectionActionId", "entityOperation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Action instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Action + * @static + * @param {google.cloud.ces.v1beta.IAction=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Action} Action instance + */ + Action.create = function create(properties) { + return new Action(properties); + }; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.cloud.ces.v1beta.Action.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Action + * @static + * @param {google.cloud.ces.v1beta.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputFields != null && message.inputFields.length) + for (var i = 0; i < message.inputFields.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputFields[i]); + if (message.outputFields != null && message.outputFields.length) + for (var i = 0; i < message.outputFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputFields[i]); + if (message.connectionActionId != null && Object.hasOwnProperty.call(message, "connectionActionId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.connectionActionId); + if (message.entityOperation != null && Object.hasOwnProperty.call(message, "entityOperation")) + $root.google.cloud.ces.v1beta.Action.EntityOperation.encode(message.entityOperation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Action.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Action + * @static + * @param {google.cloud.ces.v1beta.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Action message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Action(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.connectionActionId = reader.string(); + break; + } + case 5: { + message.entityOperation = $root.google.cloud.ces.v1beta.Action.EntityOperation.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.inputFields && message.inputFields.length)) + message.inputFields = []; + message.inputFields.push(reader.string()); + break; + } + case 3: { + if (!(message.outputFields && message.outputFields.length)) + message.outputFields = []; + message.outputFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Action message. + * @function verify + * @memberof google.cloud.ces.v1beta.Action + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Action.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.connectionActionId != null && message.hasOwnProperty("connectionActionId")) { + properties.actionSpec = 1; + if (!$util.isString(message.connectionActionId)) + return "connectionActionId: string expected"; + } + if (message.entityOperation != null && message.hasOwnProperty("entityOperation")) { + if (properties.actionSpec === 1) + return "actionSpec: multiple values"; + properties.actionSpec = 1; + { + var error = $root.google.cloud.ces.v1beta.Action.EntityOperation.verify(message.entityOperation); + if (error) + return "entityOperation." + error; + } + } + if (message.inputFields != null && message.hasOwnProperty("inputFields")) { + if (!Array.isArray(message.inputFields)) + return "inputFields: array expected"; + for (var i = 0; i < message.inputFields.length; ++i) + if (!$util.isString(message.inputFields[i])) + return "inputFields: string[] expected"; + } + if (message.outputFields != null && message.hasOwnProperty("outputFields")) { + if (!Array.isArray(message.outputFields)) + return "outputFields: array expected"; + for (var i = 0; i < message.outputFields.length; ++i) + if (!$util.isString(message.outputFields[i])) + return "outputFields: string[] expected"; + } + return null; + }; + + /** + * Creates an Action message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Action + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Action} Action + */ + Action.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Action) + return object; + var message = new $root.google.cloud.ces.v1beta.Action(); + if (object.connectionActionId != null) + message.connectionActionId = String(object.connectionActionId); + if (object.entityOperation != null) { + if (typeof object.entityOperation !== "object") + throw TypeError(".google.cloud.ces.v1beta.Action.entityOperation: object expected"); + message.entityOperation = $root.google.cloud.ces.v1beta.Action.EntityOperation.fromObject(object.entityOperation); + } + if (object.inputFields) { + if (!Array.isArray(object.inputFields)) + throw TypeError(".google.cloud.ces.v1beta.Action.inputFields: array expected"); + message.inputFields = []; + for (var i = 0; i < object.inputFields.length; ++i) + message.inputFields[i] = String(object.inputFields[i]); + } + if (object.outputFields) { + if (!Array.isArray(object.outputFields)) + throw TypeError(".google.cloud.ces.v1beta.Action.outputFields: array expected"); + message.outputFields = []; + for (var i = 0; i < object.outputFields.length; ++i) + message.outputFields[i] = String(object.outputFields[i]); + } + return message; + }; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Action + * @static + * @param {google.cloud.ces.v1beta.Action} message Action + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Action.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputFields = []; + object.outputFields = []; + } + if (message.inputFields && message.inputFields.length) { + object.inputFields = []; + for (var j = 0; j < message.inputFields.length; ++j) + object.inputFields[j] = message.inputFields[j]; + } + if (message.outputFields && message.outputFields.length) { + object.outputFields = []; + for (var j = 0; j < message.outputFields.length; ++j) + object.outputFields[j] = message.outputFields[j]; + } + if (message.connectionActionId != null && message.hasOwnProperty("connectionActionId")) { + object.connectionActionId = message.connectionActionId; + if (options.oneofs) + object.actionSpec = "connectionActionId"; + } + if (message.entityOperation != null && message.hasOwnProperty("entityOperation")) { + object.entityOperation = $root.google.cloud.ces.v1beta.Action.EntityOperation.toObject(message.entityOperation, options); + if (options.oneofs) + object.actionSpec = "entityOperation"; + } + return object; + }; + + /** + * Converts this Action to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Action + * @instance + * @returns {Object.} JSON object + */ + Action.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Action + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Action + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Action.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Action"; + }; + + Action.EntityOperation = (function() { + + /** + * Properties of an EntityOperation. + * @memberof google.cloud.ces.v1beta.Action + * @interface IEntityOperation + * @property {string|null} [entityId] EntityOperation entityId + * @property {google.cloud.ces.v1beta.Action.EntityOperation.OperationType|null} [operation] EntityOperation operation + */ + + /** + * Constructs a new EntityOperation. + * @memberof google.cloud.ces.v1beta.Action + * @classdesc Represents an EntityOperation. + * @implements IEntityOperation + * @constructor + * @param {google.cloud.ces.v1beta.Action.IEntityOperation=} [properties] Properties to set + */ + function EntityOperation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EntityOperation entityId. + * @member {string} entityId + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @instance + */ + EntityOperation.prototype.entityId = ""; + + /** + * EntityOperation operation. + * @member {google.cloud.ces.v1beta.Action.EntityOperation.OperationType} operation + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @instance + */ + EntityOperation.prototype.operation = 0; + + /** + * Creates a new EntityOperation instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @static + * @param {google.cloud.ces.v1beta.Action.IEntityOperation=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Action.EntityOperation} EntityOperation instance + */ + EntityOperation.create = function create(properties) { + return new EntityOperation(properties); + }; + + /** + * Encodes the specified EntityOperation message. Does not implicitly {@link google.cloud.ces.v1beta.Action.EntityOperation.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @static + * @param {google.cloud.ces.v1beta.Action.IEntityOperation} message EntityOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityOperation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityId); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.operation); + return writer; + }; + + /** + * Encodes the specified EntityOperation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Action.EntityOperation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @static + * @param {google.cloud.ces.v1beta.Action.IEntityOperation} message EntityOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityOperation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityOperation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Action.EntityOperation} EntityOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityOperation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Action.EntityOperation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.entityId = reader.string(); + break; + } + case 2: { + message.operation = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityOperation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Action.EntityOperation} EntityOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityOperation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityOperation message. + * @function verify + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityOperation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityId != null && message.hasOwnProperty("entityId")) + if (!$util.isString(message.entityId)) + return "entityId: string expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + switch (message.operation) { + default: + return "operation: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates an EntityOperation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Action.EntityOperation} EntityOperation + */ + EntityOperation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Action.EntityOperation) + return object; + var message = new $root.google.cloud.ces.v1beta.Action.EntityOperation(); + if (object.entityId != null) + message.entityId = String(object.entityId); + switch (object.operation) { + default: + if (typeof object.operation === "number") { + message.operation = object.operation; + break; + } + break; + case "OPERATION_TYPE_UNSPECIFIED": + case 0: + message.operation = 0; + break; + case "LIST": + case 1: + message.operation = 1; + break; + case "GET": + case 2: + message.operation = 2; + break; + case "CREATE": + case 3: + message.operation = 3; + break; + case "UPDATE": + case 4: + message.operation = 4; + break; + case "DELETE": + case 5: + message.operation = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from an EntityOperation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @static + * @param {google.cloud.ces.v1beta.Action.EntityOperation} message EntityOperation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityOperation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityId = ""; + object.operation = options.enums === String ? "OPERATION_TYPE_UNSPECIFIED" : 0; + } + if (message.entityId != null && message.hasOwnProperty("entityId")) + object.entityId = message.entityId; + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = options.enums === String ? $root.google.cloud.ces.v1beta.Action.EntityOperation.OperationType[message.operation] === undefined ? message.operation : $root.google.cloud.ces.v1beta.Action.EntityOperation.OperationType[message.operation] : message.operation; + return object; + }; + + /** + * Converts this EntityOperation to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @instance + * @returns {Object.} JSON object + */ + EntityOperation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntityOperation + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntityOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Action.EntityOperation"; + }; + + /** + * OperationType enum. + * @name google.cloud.ces.v1beta.Action.EntityOperation.OperationType + * @enum {number} + * @property {number} OPERATION_TYPE_UNSPECIFIED=0 OPERATION_TYPE_UNSPECIFIED value + * @property {number} LIST=1 LIST value + * @property {number} GET=2 GET value + * @property {number} CREATE=3 CREATE value + * @property {number} UPDATE=4 UPDATE value + * @property {number} DELETE=5 DELETE value + */ + EntityOperation.OperationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LIST"] = 1; + values[valuesById[2] = "GET"] = 2; + values[valuesById[3] = "CREATE"] = 3; + values[valuesById[4] = "UPDATE"] = 4; + values[valuesById[5] = "DELETE"] = 5; + return values; + })(); + + return EntityOperation; + })(); + + return Action; + })(); + + v1beta.ConnectorTool = (function() { + + /** + * Properties of a ConnectorTool. + * @memberof google.cloud.ces.v1beta + * @interface IConnectorTool + * @property {string|null} [connection] ConnectorTool connection + * @property {google.cloud.ces.v1beta.IAction|null} [action] ConnectorTool action + * @property {google.cloud.ces.v1beta.IEndUserAuthConfig|null} [authConfig] ConnectorTool authConfig + * @property {string|null} [name] ConnectorTool name + * @property {string|null} [description] ConnectorTool description + */ + + /** + * Constructs a new ConnectorTool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ConnectorTool. + * @implements IConnectorTool + * @constructor + * @param {google.cloud.ces.v1beta.IConnectorTool=} [properties] Properties to set + */ + function ConnectorTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectorTool connection. + * @member {string} connection + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @instance + */ + ConnectorTool.prototype.connection = ""; + + /** + * ConnectorTool action. + * @member {google.cloud.ces.v1beta.IAction|null|undefined} action + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @instance + */ + ConnectorTool.prototype.action = null; + + /** + * ConnectorTool authConfig. + * @member {google.cloud.ces.v1beta.IEndUserAuthConfig|null|undefined} authConfig + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @instance + */ + ConnectorTool.prototype.authConfig = null; + + /** + * ConnectorTool name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @instance + */ + ConnectorTool.prototype.name = ""; + + /** + * ConnectorTool description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @instance + */ + ConnectorTool.prototype.description = ""; + + /** + * Creates a new ConnectorTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @static + * @param {google.cloud.ces.v1beta.IConnectorTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ConnectorTool} ConnectorTool instance + */ + ConnectorTool.create = function create(properties) { + return new ConnectorTool(properties); + }; + + /** + * Encodes the specified ConnectorTool message. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @static + * @param {google.cloud.ces.v1beta.IConnectorTool} message ConnectorTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + $root.google.cloud.ces.v1beta.Action.encode(message.action, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.authConfig != null && Object.hasOwnProperty.call(message, "authConfig")) + $root.google.cloud.ces.v1beta.EndUserAuthConfig.encode(message.authConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + return writer; + }; + + /** + * Encodes the specified ConnectorTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @static + * @param {google.cloud.ces.v1beta.IConnectorTool} message ConnectorTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectorTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ConnectorTool} ConnectorTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ConnectorTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.connection = reader.string(); + break; + } + case 2: { + message.action = $root.google.cloud.ces.v1beta.Action.decode(reader, reader.uint32()); + break; + } + case 3: { + message.authConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.name = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectorTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ConnectorTool} ConnectorTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectorTool message. + * @function verify + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectorTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connection != null && message.hasOwnProperty("connection")) + if (!$util.isString(message.connection)) + return "connection: string expected"; + if (message.action != null && message.hasOwnProperty("action")) { + var error = $root.google.cloud.ces.v1beta.Action.verify(message.action); + if (error) + return "action." + error; + } + if (message.authConfig != null && message.hasOwnProperty("authConfig")) { + var error = $root.google.cloud.ces.v1beta.EndUserAuthConfig.verify(message.authConfig); + if (error) + return "authConfig." + error; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a ConnectorTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ConnectorTool} ConnectorTool + */ + ConnectorTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ConnectorTool) + return object; + var message = new $root.google.cloud.ces.v1beta.ConnectorTool(); + if (object.connection != null) + message.connection = String(object.connection); + if (object.action != null) { + if (typeof object.action !== "object") + throw TypeError(".google.cloud.ces.v1beta.ConnectorTool.action: object expected"); + message.action = $root.google.cloud.ces.v1beta.Action.fromObject(object.action); + } + if (object.authConfig != null) { + if (typeof object.authConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.ConnectorTool.authConfig: object expected"); + message.authConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.fromObject(object.authConfig); + } + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a ConnectorTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @static + * @param {google.cloud.ces.v1beta.ConnectorTool} message ConnectorTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectorTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.connection = ""; + object.action = null; + object.authConfig = null; + object.name = ""; + object.description = ""; + } + if (message.connection != null && message.hasOwnProperty("connection")) + object.connection = message.connection; + if (message.action != null && message.hasOwnProperty("action")) + object.action = $root.google.cloud.ces.v1beta.Action.toObject(message.action, options); + if (message.authConfig != null && message.hasOwnProperty("authConfig")) + object.authConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.toObject(message.authConfig, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this ConnectorTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @instance + * @returns {Object.} JSON object + */ + ConnectorTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectorTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectorTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ConnectorTool"; + }; + + return ConnectorTool; + })(); + + v1beta.ApiKeyConfig = (function() { + + /** + * Properties of an ApiKeyConfig. + * @memberof google.cloud.ces.v1beta + * @interface IApiKeyConfig + * @property {string|null} [keyName] ApiKeyConfig keyName + * @property {string|null} [apiKeySecretVersion] ApiKeyConfig apiKeySecretVersion + * @property {google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation|null} [requestLocation] ApiKeyConfig requestLocation + */ + + /** + * Constructs a new ApiKeyConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ApiKeyConfig. + * @implements IApiKeyConfig + * @constructor + * @param {google.cloud.ces.v1beta.IApiKeyConfig=} [properties] Properties to set + */ + function ApiKeyConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiKeyConfig keyName. + * @member {string} keyName + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @instance + */ + ApiKeyConfig.prototype.keyName = ""; + + /** + * ApiKeyConfig apiKeySecretVersion. + * @member {string} apiKeySecretVersion + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @instance + */ + ApiKeyConfig.prototype.apiKeySecretVersion = ""; + + /** + * ApiKeyConfig requestLocation. + * @member {google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation} requestLocation + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @instance + */ + ApiKeyConfig.prototype.requestLocation = 0; + + /** + * Creates a new ApiKeyConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @static + * @param {google.cloud.ces.v1beta.IApiKeyConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ApiKeyConfig} ApiKeyConfig instance + */ + ApiKeyConfig.create = function create(properties) { + return new ApiKeyConfig(properties); + }; + + /** + * Encodes the specified ApiKeyConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ApiKeyConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @static + * @param {google.cloud.ces.v1beta.IApiKeyConfig} message ApiKeyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiKeyConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyName != null && Object.hasOwnProperty.call(message, "keyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyName); + if (message.apiKeySecretVersion != null && Object.hasOwnProperty.call(message, "apiKeySecretVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.apiKeySecretVersion); + if (message.requestLocation != null && Object.hasOwnProperty.call(message, "requestLocation")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.requestLocation); + return writer; + }; + + /** + * Encodes the specified ApiKeyConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ApiKeyConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @static + * @param {google.cloud.ces.v1beta.IApiKeyConfig} message ApiKeyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiKeyConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ApiKeyConfig} ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiKeyConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ApiKeyConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.keyName = reader.string(); + break; + } + case 2: { + message.apiKeySecretVersion = reader.string(); + break; + } + case 3: { + message.requestLocation = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ApiKeyConfig} ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiKeyConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiKeyConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiKeyConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyName != null && message.hasOwnProperty("keyName")) + if (!$util.isString(message.keyName)) + return "keyName: string expected"; + if (message.apiKeySecretVersion != null && message.hasOwnProperty("apiKeySecretVersion")) + if (!$util.isString(message.apiKeySecretVersion)) + return "apiKeySecretVersion: string expected"; + if (message.requestLocation != null && message.hasOwnProperty("requestLocation")) + switch (message.requestLocation) { + default: + return "requestLocation: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ApiKeyConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ApiKeyConfig} ApiKeyConfig + */ + ApiKeyConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ApiKeyConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.ApiKeyConfig(); + if (object.keyName != null) + message.keyName = String(object.keyName); + if (object.apiKeySecretVersion != null) + message.apiKeySecretVersion = String(object.apiKeySecretVersion); + switch (object.requestLocation) { + default: + if (typeof object.requestLocation === "number") { + message.requestLocation = object.requestLocation; + break; + } + break; + case "REQUEST_LOCATION_UNSPECIFIED": + case 0: + message.requestLocation = 0; + break; + case "HEADER": + case 1: + message.requestLocation = 1; + break; + case "QUERY_STRING": + case 2: + message.requestLocation = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ApiKeyConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @static + * @param {google.cloud.ces.v1beta.ApiKeyConfig} message ApiKeyConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiKeyConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.keyName = ""; + object.apiKeySecretVersion = ""; + object.requestLocation = options.enums === String ? "REQUEST_LOCATION_UNSPECIFIED" : 0; + } + if (message.keyName != null && message.hasOwnProperty("keyName")) + object.keyName = message.keyName; + if (message.apiKeySecretVersion != null && message.hasOwnProperty("apiKeySecretVersion")) + object.apiKeySecretVersion = message.apiKeySecretVersion; + if (message.requestLocation != null && message.hasOwnProperty("requestLocation")) + object.requestLocation = options.enums === String ? $root.google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation[message.requestLocation] === undefined ? message.requestLocation : $root.google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation[message.requestLocation] : message.requestLocation; + return object; + }; + + /** + * Converts this ApiKeyConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @instance + * @returns {Object.} JSON object + */ + ApiKeyConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiKeyConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiKeyConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ApiKeyConfig"; + }; + + /** + * RequestLocation enum. + * @name google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation + * @enum {number} + * @property {number} REQUEST_LOCATION_UNSPECIFIED=0 REQUEST_LOCATION_UNSPECIFIED value + * @property {number} HEADER=1 HEADER value + * @property {number} QUERY_STRING=2 QUERY_STRING value + */ + ApiKeyConfig.RequestLocation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REQUEST_LOCATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "HEADER"] = 1; + values[valuesById[2] = "QUERY_STRING"] = 2; + return values; + })(); + + return ApiKeyConfig; + })(); + + v1beta.OAuthConfig = (function() { + + /** + * Properties of a OAuthConfig. + * @memberof google.cloud.ces.v1beta + * @interface IOAuthConfig + * @property {google.cloud.ces.v1beta.OAuthConfig.OauthGrantType|null} [oauthGrantType] OAuthConfig oauthGrantType + * @property {string|null} [clientId] OAuthConfig clientId + * @property {string|null} [clientSecretVersion] OAuthConfig clientSecretVersion + * @property {string|null} [tokenEndpoint] OAuthConfig tokenEndpoint + * @property {Array.|null} [scopes] OAuthConfig scopes + */ + + /** + * Constructs a new OAuthConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a OAuthConfig. + * @implements IOAuthConfig + * @constructor + * @param {google.cloud.ces.v1beta.IOAuthConfig=} [properties] Properties to set + */ + function OAuthConfig(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OAuthConfig oauthGrantType. + * @member {google.cloud.ces.v1beta.OAuthConfig.OauthGrantType} oauthGrantType + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @instance + */ + OAuthConfig.prototype.oauthGrantType = 0; + + /** + * OAuthConfig clientId. + * @member {string} clientId + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @instance + */ + OAuthConfig.prototype.clientId = ""; + + /** + * OAuthConfig clientSecretVersion. + * @member {string} clientSecretVersion + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @instance + */ + OAuthConfig.prototype.clientSecretVersion = ""; + + /** + * OAuthConfig tokenEndpoint. + * @member {string} tokenEndpoint + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @instance + */ + OAuthConfig.prototype.tokenEndpoint = ""; + + /** + * OAuthConfig scopes. + * @member {Array.} scopes + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @instance + */ + OAuthConfig.prototype.scopes = $util.emptyArray; + + /** + * Creates a new OAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IOAuthConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OAuthConfig} OAuthConfig instance + */ + OAuthConfig.create = function create(properties) { + return new OAuthConfig(properties); + }; + + /** + * Encodes the specified OAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IOAuthConfig} message OAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.oauthGrantType != null && Object.hasOwnProperty.call(message, "oauthGrantType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.oauthGrantType); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientId); + if (message.clientSecretVersion != null && Object.hasOwnProperty.call(message, "clientSecretVersion")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientSecretVersion); + if (message.tokenEndpoint != null && Object.hasOwnProperty.call(message, "tokenEndpoint")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tokenEndpoint); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified OAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IOAuthConfig} message OAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OAuthConfig} OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OAuthConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.oauthGrantType = reader.int32(); + break; + } + case 2: { + message.clientId = reader.string(); + break; + } + case 3: { + message.clientSecretVersion = reader.string(); + break; + } + case 4: { + message.tokenEndpoint = reader.string(); + break; + } + case 5: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OAuthConfig} OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OAuthConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OAuthConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.oauthGrantType != null && message.hasOwnProperty("oauthGrantType")) + switch (message.oauthGrantType) { + default: + return "oauthGrantType: enum value expected"; + case 0: + case 1: + break; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientSecretVersion != null && message.hasOwnProperty("clientSecretVersion")) + if (!$util.isString(message.clientSecretVersion)) + return "clientSecretVersion: string expected"; + if (message.tokenEndpoint != null && message.hasOwnProperty("tokenEndpoint")) + if (!$util.isString(message.tokenEndpoint)) + return "tokenEndpoint: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + return null; + }; + + /** + * Creates a OAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OAuthConfig} OAuthConfig + */ + OAuthConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OAuthConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.OAuthConfig(); + switch (object.oauthGrantType) { + default: + if (typeof object.oauthGrantType === "number") { + message.oauthGrantType = object.oauthGrantType; + break; + } + break; + case "OAUTH_GRANT_TYPE_UNSPECIFIED": + case 0: + message.oauthGrantType = 0; + break; + case "CLIENT_CREDENTIAL": + case 1: + message.oauthGrantType = 1; + break; + } + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientSecretVersion != null) + message.clientSecretVersion = String(object.clientSecretVersion); + if (object.tokenEndpoint != null) + message.tokenEndpoint = String(object.tokenEndpoint); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.ces.v1beta.OAuthConfig.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from a OAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @static + * @param {google.cloud.ces.v1beta.OAuthConfig} message OAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) { + object.oauthGrantType = options.enums === String ? "OAUTH_GRANT_TYPE_UNSPECIFIED" : 0; + object.clientId = ""; + object.clientSecretVersion = ""; + object.tokenEndpoint = ""; + } + if (message.oauthGrantType != null && message.hasOwnProperty("oauthGrantType")) + object.oauthGrantType = options.enums === String ? $root.google.cloud.ces.v1beta.OAuthConfig.OauthGrantType[message.oauthGrantType] === undefined ? message.oauthGrantType : $root.google.cloud.ces.v1beta.OAuthConfig.OauthGrantType[message.oauthGrantType] : message.oauthGrantType; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientSecretVersion != null && message.hasOwnProperty("clientSecretVersion")) + object.clientSecretVersion = message.clientSecretVersion; + if (message.tokenEndpoint != null && message.hasOwnProperty("tokenEndpoint")) + object.tokenEndpoint = message.tokenEndpoint; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this OAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @instance + * @returns {Object.} JSON object + */ + OAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OAuthConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OAuthConfig"; + }; + + /** + * OauthGrantType enum. + * @name google.cloud.ces.v1beta.OAuthConfig.OauthGrantType + * @enum {number} + * @property {number} OAUTH_GRANT_TYPE_UNSPECIFIED=0 OAUTH_GRANT_TYPE_UNSPECIFIED value + * @property {number} CLIENT_CREDENTIAL=1 CLIENT_CREDENTIAL value + */ + OAuthConfig.OauthGrantType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OAUTH_GRANT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLIENT_CREDENTIAL"] = 1; + return values; + })(); + + return OAuthConfig; + })(); + + v1beta.ServiceAgentIdTokenAuthConfig = (function() { + + /** + * Properties of a ServiceAgentIdTokenAuthConfig. + * @memberof google.cloud.ces.v1beta + * @interface IServiceAgentIdTokenAuthConfig + */ + + /** + * Constructs a new ServiceAgentIdTokenAuthConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ServiceAgentIdTokenAuthConfig. + * @implements IServiceAgentIdTokenAuthConfig + * @constructor + * @param {google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig=} [properties] Properties to set + */ + function ServiceAgentIdTokenAuthConfig(properties) { + if (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 ServiceAgentIdTokenAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig instance + */ + ServiceAgentIdTokenAuthConfig.create = function create(properties) { + return new ServiceAgentIdTokenAuthConfig(properties); + }; + + /** + * Encodes the specified ServiceAgentIdTokenAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig} message ServiceAgentIdTokenAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAgentIdTokenAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ServiceAgentIdTokenAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig} message ServiceAgentIdTokenAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAgentIdTokenAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAgentIdTokenAuthConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAgentIdTokenAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAgentIdTokenAuthConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAgentIdTokenAuthConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ServiceAgentIdTokenAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig + */ + ServiceAgentIdTokenAuthConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig) + return object; + return new $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig(); + }; + + /** + * Creates a plain object from a ServiceAgentIdTokenAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @static + * @param {google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig} message ServiceAgentIdTokenAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAgentIdTokenAuthConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ServiceAgentIdTokenAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceAgentIdTokenAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAgentIdTokenAuthConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAgentIdTokenAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig"; + }; + + return ServiceAgentIdTokenAuthConfig; + })(); + + v1beta.ServiceAccountAuthConfig = (function() { + + /** + * Properties of a ServiceAccountAuthConfig. + * @memberof google.cloud.ces.v1beta + * @interface IServiceAccountAuthConfig + * @property {string|null} [serviceAccount] ServiceAccountAuthConfig serviceAccount + * @property {Array.|null} [scopes] ServiceAccountAuthConfig scopes + */ + + /** + * Constructs a new ServiceAccountAuthConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ServiceAccountAuthConfig. + * @implements IServiceAccountAuthConfig + * @constructor + * @param {google.cloud.ces.v1beta.IServiceAccountAuthConfig=} [properties] Properties to set + */ + function ServiceAccountAuthConfig(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceAccountAuthConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @instance + */ + ServiceAccountAuthConfig.prototype.serviceAccount = ""; + + /** + * ServiceAccountAuthConfig scopes. + * @member {Array.} scopes + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @instance + */ + ServiceAccountAuthConfig.prototype.scopes = $util.emptyArray; + + /** + * Creates a new ServiceAccountAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IServiceAccountAuthConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ServiceAccountAuthConfig} ServiceAccountAuthConfig instance + */ + ServiceAccountAuthConfig.create = function create(properties) { + return new ServiceAccountAuthConfig(properties); + }; + + /** + * Encodes the specified ServiceAccountAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAccountAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IServiceAccountAuthConfig} message ServiceAccountAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccount); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified ServiceAccountAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAccountAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IServiceAccountAuthConfig} message ServiceAccountAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ServiceAccountAuthConfig} ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountAuthConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.serviceAccount = reader.string(); + break; + } + case 2: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ServiceAccountAuthConfig} ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAccountAuthConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAccountAuthConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + return null; + }; + + /** + * Creates a ServiceAccountAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ServiceAccountAuthConfig} ServiceAccountAuthConfig + */ + ServiceAccountAuthConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig(); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.ces.v1beta.ServiceAccountAuthConfig.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from a ServiceAccountAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @static + * @param {google.cloud.ces.v1beta.ServiceAccountAuthConfig} message ServiceAccountAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAccountAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) + object.serviceAccount = ""; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this ServiceAccountAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceAccountAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAccountAuthConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAccountAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ServiceAccountAuthConfig"; + }; + + return ServiceAccountAuthConfig; + })(); + + v1beta.BearerTokenConfig = (function() { + + /** + * Properties of a BearerTokenConfig. + * @memberof google.cloud.ces.v1beta + * @interface IBearerTokenConfig + * @property {string|null} [token] BearerTokenConfig token + */ + + /** + * Constructs a new BearerTokenConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a BearerTokenConfig. + * @implements IBearerTokenConfig + * @constructor + * @param {google.cloud.ces.v1beta.IBearerTokenConfig=} [properties] Properties to set + */ + function BearerTokenConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BearerTokenConfig token. + * @member {string} token + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @instance + */ + BearerTokenConfig.prototype.token = ""; + + /** + * Creates a new BearerTokenConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @static + * @param {google.cloud.ces.v1beta.IBearerTokenConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.BearerTokenConfig} BearerTokenConfig instance + */ + BearerTokenConfig.create = function create(properties) { + return new BearerTokenConfig(properties); + }; + + /** + * Encodes the specified BearerTokenConfig message. Does not implicitly {@link google.cloud.ces.v1beta.BearerTokenConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @static + * @param {google.cloud.ces.v1beta.IBearerTokenConfig} message BearerTokenConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BearerTokenConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); + return writer; + }; + + /** + * Encodes the specified BearerTokenConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BearerTokenConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @static + * @param {google.cloud.ces.v1beta.IBearerTokenConfig} message BearerTokenConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BearerTokenConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.BearerTokenConfig} BearerTokenConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BearerTokenConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BearerTokenConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.token = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.BearerTokenConfig} BearerTokenConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BearerTokenConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BearerTokenConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BearerTokenConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.token != null && message.hasOwnProperty("token")) + if (!$util.isString(message.token)) + return "token: string expected"; + return null; + }; + + /** + * Creates a BearerTokenConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.BearerTokenConfig} BearerTokenConfig + */ + BearerTokenConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.BearerTokenConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.BearerTokenConfig(); + if (object.token != null) + message.token = String(object.token); + return message; + }; + + /** + * Creates a plain object from a BearerTokenConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @static + * @param {google.cloud.ces.v1beta.BearerTokenConfig} message BearerTokenConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BearerTokenConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.token = ""; + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + return object; + }; + + /** + * Converts this BearerTokenConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @instance + * @returns {Object.} JSON object + */ + BearerTokenConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BearerTokenConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BearerTokenConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.BearerTokenConfig"; + }; + + return BearerTokenConfig; + })(); + + v1beta.EndUserAuthConfig = (function() { + + /** + * Properties of an EndUserAuthConfig. + * @memberof google.cloud.ces.v1beta + * @interface IEndUserAuthConfig + * @property {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig|null} [oauth2AuthCodeConfig] EndUserAuthConfig oauth2AuthCodeConfig + * @property {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig|null} [oauth2JwtBearerConfig] EndUserAuthConfig oauth2JwtBearerConfig + */ + + /** + * Constructs a new EndUserAuthConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EndUserAuthConfig. + * @implements IEndUserAuthConfig + * @constructor + * @param {google.cloud.ces.v1beta.IEndUserAuthConfig=} [properties] Properties to set + */ + function EndUserAuthConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndUserAuthConfig oauth2AuthCodeConfig. + * @member {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig|null|undefined} oauth2AuthCodeConfig + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @instance + */ + EndUserAuthConfig.prototype.oauth2AuthCodeConfig = null; + + /** + * EndUserAuthConfig oauth2JwtBearerConfig. + * @member {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig|null|undefined} oauth2JwtBearerConfig + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @instance + */ + EndUserAuthConfig.prototype.oauth2JwtBearerConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EndUserAuthConfig authConfig. + * @member {"oauth2AuthCodeConfig"|"oauth2JwtBearerConfig"|undefined} authConfig + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @instance + */ + Object.defineProperty(EndUserAuthConfig.prototype, "authConfig", { + get: $util.oneOfGetter($oneOfFields = ["oauth2AuthCodeConfig", "oauth2JwtBearerConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EndUserAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IEndUserAuthConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig} EndUserAuthConfig instance + */ + EndUserAuthConfig.create = function create(properties) { + return new EndUserAuthConfig(properties); + }; + + /** + * Encodes the specified EndUserAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IEndUserAuthConfig} message EndUserAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndUserAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.oauth2AuthCodeConfig != null && Object.hasOwnProperty.call(message, "oauth2AuthCodeConfig")) + $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.encode(message.oauth2AuthCodeConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.oauth2JwtBearerConfig != null && Object.hasOwnProperty.call(message, "oauth2JwtBearerConfig")) + $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.encode(message.oauth2JwtBearerConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EndUserAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IEndUserAuthConfig} message EndUserAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndUserAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndUserAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig} EndUserAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndUserAuthConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EndUserAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.oauth2AuthCodeConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.oauth2JwtBearerConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndUserAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig} EndUserAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndUserAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndUserAuthConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndUserAuthConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.oauth2AuthCodeConfig != null && message.hasOwnProperty("oauth2AuthCodeConfig")) { + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.verify(message.oauth2AuthCodeConfig); + if (error) + return "oauth2AuthCodeConfig." + error; + } + } + if (message.oauth2JwtBearerConfig != null && message.hasOwnProperty("oauth2JwtBearerConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.verify(message.oauth2JwtBearerConfig); + if (error) + return "oauth2JwtBearerConfig." + error; + } + } + return null; + }; + + /** + * Creates an EndUserAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig} EndUserAuthConfig + */ + EndUserAuthConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EndUserAuthConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.EndUserAuthConfig(); + if (object.oauth2AuthCodeConfig != null) { + if (typeof object.oauth2AuthCodeConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.EndUserAuthConfig.oauth2AuthCodeConfig: object expected"); + message.oauth2AuthCodeConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.fromObject(object.oauth2AuthCodeConfig); + } + if (object.oauth2JwtBearerConfig != null) { + if (typeof object.oauth2JwtBearerConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.EndUserAuthConfig.oauth2JwtBearerConfig: object expected"); + message.oauth2JwtBearerConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.fromObject(object.oauth2JwtBearerConfig); + } + return message; + }; + + /** + * Creates a plain object from an EndUserAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @static + * @param {google.cloud.ces.v1beta.EndUserAuthConfig} message EndUserAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndUserAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.oauth2AuthCodeConfig != null && message.hasOwnProperty("oauth2AuthCodeConfig")) { + object.oauth2AuthCodeConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.toObject(message.oauth2AuthCodeConfig, options); + if (options.oneofs) + object.authConfig = "oauth2AuthCodeConfig"; + } + if (message.oauth2JwtBearerConfig != null && message.hasOwnProperty("oauth2JwtBearerConfig")) { + object.oauth2JwtBearerConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.toObject(message.oauth2JwtBearerConfig, options); + if (options.oneofs) + object.authConfig = "oauth2JwtBearerConfig"; + } + return object; + }; + + /** + * Converts this EndUserAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @instance + * @returns {Object.} JSON object + */ + EndUserAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndUserAuthConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndUserAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EndUserAuthConfig"; + }; + + EndUserAuthConfig.Oauth2AuthCodeConfig = (function() { + + /** + * Properties of an Oauth2AuthCodeConfig. + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @interface IOauth2AuthCodeConfig + * @property {string|null} [oauthToken] Oauth2AuthCodeConfig oauthToken + */ + + /** + * Constructs a new Oauth2AuthCodeConfig. + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @classdesc Represents an Oauth2AuthCodeConfig. + * @implements IOauth2AuthCodeConfig + * @constructor + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig=} [properties] Properties to set + */ + function Oauth2AuthCodeConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Oauth2AuthCodeConfig oauthToken. + * @member {string} oauthToken + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @instance + */ + Oauth2AuthCodeConfig.prototype.oauthToken = ""; + + /** + * Creates a new Oauth2AuthCodeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig instance + */ + Oauth2AuthCodeConfig.create = function create(properties) { + return new Oauth2AuthCodeConfig(properties); + }; + + /** + * Encodes the specified Oauth2AuthCodeConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig} message Oauth2AuthCodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2AuthCodeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.oauthToken != null && Object.hasOwnProperty.call(message, "oauthToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.oauthToken); + return writer; + }; + + /** + * Encodes the specified Oauth2AuthCodeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig} message Oauth2AuthCodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2AuthCodeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2AuthCodeConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.oauthToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2AuthCodeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Oauth2AuthCodeConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Oauth2AuthCodeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.oauthToken != null && message.hasOwnProperty("oauthToken")) + if (!$util.isString(message.oauthToken)) + return "oauthToken: string expected"; + return null; + }; + + /** + * Creates an Oauth2AuthCodeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig + */ + Oauth2AuthCodeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig(); + if (object.oauthToken != null) + message.oauthToken = String(object.oauthToken); + return message; + }; + + /** + * Creates a plain object from an Oauth2AuthCodeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig} message Oauth2AuthCodeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Oauth2AuthCodeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.oauthToken = ""; + if (message.oauthToken != null && message.hasOwnProperty("oauthToken")) + object.oauthToken = message.oauthToken; + return object; + }; + + /** + * Converts this Oauth2AuthCodeConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @instance + * @returns {Object.} JSON object + */ + Oauth2AuthCodeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Oauth2AuthCodeConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Oauth2AuthCodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig"; + }; + + return Oauth2AuthCodeConfig; + })(); + + EndUserAuthConfig.Oauth2JwtBearerConfig = (function() { + + /** + * Properties of an Oauth2JwtBearerConfig. + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @interface IOauth2JwtBearerConfig + * @property {string|null} [issuer] Oauth2JwtBearerConfig issuer + * @property {string|null} [subject] Oauth2JwtBearerConfig subject + * @property {string|null} [clientKey] Oauth2JwtBearerConfig clientKey + */ + + /** + * Constructs a new Oauth2JwtBearerConfig. + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @classdesc Represents an Oauth2JwtBearerConfig. + * @implements IOauth2JwtBearerConfig + * @constructor + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig=} [properties] Properties to set + */ + function Oauth2JwtBearerConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Oauth2JwtBearerConfig issuer. + * @member {string} issuer + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @instance + */ + Oauth2JwtBearerConfig.prototype.issuer = ""; + + /** + * Oauth2JwtBearerConfig subject. + * @member {string} subject + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @instance + */ + Oauth2JwtBearerConfig.prototype.subject = ""; + + /** + * Oauth2JwtBearerConfig clientKey. + * @member {string} clientKey + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @instance + */ + Oauth2JwtBearerConfig.prototype.clientKey = ""; + + /** + * Creates a new Oauth2JwtBearerConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig instance + */ + Oauth2JwtBearerConfig.create = function create(properties) { + return new Oauth2JwtBearerConfig(properties); + }; + + /** + * Encodes the specified Oauth2JwtBearerConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig} message Oauth2JwtBearerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2JwtBearerConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.issuer != null && Object.hasOwnProperty.call(message, "issuer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.issuer); + if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subject); + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientKey); + return writer; + }; + + /** + * Encodes the specified Oauth2JwtBearerConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig} message Oauth2JwtBearerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2JwtBearerConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2JwtBearerConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.issuer = reader.string(); + break; + } + case 2: { + message.subject = reader.string(); + break; + } + case 3: { + message.clientKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2JwtBearerConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Oauth2JwtBearerConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Oauth2JwtBearerConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.issuer != null && message.hasOwnProperty("issuer")) + if (!$util.isString(message.issuer)) + return "issuer: string expected"; + if (message.subject != null && message.hasOwnProperty("subject")) + if (!$util.isString(message.subject)) + return "subject: string expected"; + if (message.clientKey != null && message.hasOwnProperty("clientKey")) + if (!$util.isString(message.clientKey)) + return "clientKey: string expected"; + return null; + }; + + /** + * Creates an Oauth2JwtBearerConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig + */ + Oauth2JwtBearerConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig(); + if (object.issuer != null) + message.issuer = String(object.issuer); + if (object.subject != null) + message.subject = String(object.subject); + if (object.clientKey != null) + message.clientKey = String(object.clientKey); + return message; + }; + + /** + * Creates a plain object from an Oauth2JwtBearerConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig} message Oauth2JwtBearerConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Oauth2JwtBearerConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.issuer = ""; + object.subject = ""; + object.clientKey = ""; + } + if (message.issuer != null && message.hasOwnProperty("issuer")) + object.issuer = message.issuer; + if (message.subject != null && message.hasOwnProperty("subject")) + object.subject = message.subject; + if (message.clientKey != null && message.hasOwnProperty("clientKey")) + object.clientKey = message.clientKey; + return object; + }; + + /** + * Converts this Oauth2JwtBearerConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @instance + * @returns {Object.} JSON object + */ + Oauth2JwtBearerConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Oauth2JwtBearerConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Oauth2JwtBearerConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig"; + }; + + return Oauth2JwtBearerConfig; + })(); + + return EndUserAuthConfig; + })(); + + v1beta.ApiAuthentication = (function() { + + /** + * Properties of an ApiAuthentication. + * @memberof google.cloud.ces.v1beta + * @interface IApiAuthentication + * @property {google.cloud.ces.v1beta.IApiKeyConfig|null} [apiKeyConfig] ApiAuthentication apiKeyConfig + * @property {google.cloud.ces.v1beta.IOAuthConfig|null} [oauthConfig] ApiAuthentication oauthConfig + * @property {google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig|null} [serviceAgentIdTokenAuthConfig] ApiAuthentication serviceAgentIdTokenAuthConfig + * @property {google.cloud.ces.v1beta.IServiceAccountAuthConfig|null} [serviceAccountAuthConfig] ApiAuthentication serviceAccountAuthConfig + * @property {google.cloud.ces.v1beta.IBearerTokenConfig|null} [bearerTokenConfig] ApiAuthentication bearerTokenConfig + */ + + /** + * Constructs a new ApiAuthentication. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ApiAuthentication. + * @implements IApiAuthentication + * @constructor + * @param {google.cloud.ces.v1beta.IApiAuthentication=} [properties] Properties to set + */ + function ApiAuthentication(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiAuthentication apiKeyConfig. + * @member {google.cloud.ces.v1beta.IApiKeyConfig|null|undefined} apiKeyConfig + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @instance + */ + ApiAuthentication.prototype.apiKeyConfig = null; + + /** + * ApiAuthentication oauthConfig. + * @member {google.cloud.ces.v1beta.IOAuthConfig|null|undefined} oauthConfig + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @instance + */ + ApiAuthentication.prototype.oauthConfig = null; + + /** + * ApiAuthentication serviceAgentIdTokenAuthConfig. + * @member {google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig|null|undefined} serviceAgentIdTokenAuthConfig + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @instance + */ + ApiAuthentication.prototype.serviceAgentIdTokenAuthConfig = null; + + /** + * ApiAuthentication serviceAccountAuthConfig. + * @member {google.cloud.ces.v1beta.IServiceAccountAuthConfig|null|undefined} serviceAccountAuthConfig + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @instance + */ + ApiAuthentication.prototype.serviceAccountAuthConfig = null; + + /** + * ApiAuthentication bearerTokenConfig. + * @member {google.cloud.ces.v1beta.IBearerTokenConfig|null|undefined} bearerTokenConfig + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @instance + */ + ApiAuthentication.prototype.bearerTokenConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ApiAuthentication authConfig. + * @member {"apiKeyConfig"|"oauthConfig"|"serviceAgentIdTokenAuthConfig"|"serviceAccountAuthConfig"|"bearerTokenConfig"|undefined} authConfig + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @instance + */ + Object.defineProperty(ApiAuthentication.prototype, "authConfig", { + get: $util.oneOfGetter($oneOfFields = ["apiKeyConfig", "oauthConfig", "serviceAgentIdTokenAuthConfig", "serviceAccountAuthConfig", "bearerTokenConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ApiAuthentication instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @static + * @param {google.cloud.ces.v1beta.IApiAuthentication=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ApiAuthentication} ApiAuthentication instance + */ + ApiAuthentication.create = function create(properties) { + return new ApiAuthentication(properties); + }; + + /** + * Encodes the specified ApiAuthentication message. Does not implicitly {@link google.cloud.ces.v1beta.ApiAuthentication.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @static + * @param {google.cloud.ces.v1beta.IApiAuthentication} message ApiAuthentication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiAuthentication.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiKeyConfig != null && Object.hasOwnProperty.call(message, "apiKeyConfig")) + $root.google.cloud.ces.v1beta.ApiKeyConfig.encode(message.apiKeyConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.oauthConfig != null && Object.hasOwnProperty.call(message, "oauthConfig")) + $root.google.cloud.ces.v1beta.OAuthConfig.encode(message.oauthConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.serviceAgentIdTokenAuthConfig != null && Object.hasOwnProperty.call(message, "serviceAgentIdTokenAuthConfig")) + $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.encode(message.serviceAgentIdTokenAuthConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.serviceAccountAuthConfig != null && Object.hasOwnProperty.call(message, "serviceAccountAuthConfig")) + $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig.encode(message.serviceAccountAuthConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.bearerTokenConfig != null && Object.hasOwnProperty.call(message, "bearerTokenConfig")) + $root.google.cloud.ces.v1beta.BearerTokenConfig.encode(message.bearerTokenConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApiAuthentication message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ApiAuthentication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @static + * @param {google.cloud.ces.v1beta.IApiAuthentication} message ApiAuthentication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiAuthentication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiAuthentication message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ApiAuthentication} ApiAuthentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiAuthentication.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ApiAuthentication(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.apiKeyConfig = $root.google.cloud.ces.v1beta.ApiKeyConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.oauthConfig = $root.google.cloud.ces.v1beta.OAuthConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.serviceAgentIdTokenAuthConfig = $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.serviceAccountAuthConfig = $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.bearerTokenConfig = $root.google.cloud.ces.v1beta.BearerTokenConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiAuthentication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ApiAuthentication} ApiAuthentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiAuthentication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiAuthentication message. + * @function verify + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiAuthentication.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) { + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.ApiKeyConfig.verify(message.apiKeyConfig); + if (error) + return "apiKeyConfig." + error; + } + } + if (message.oauthConfig != null && message.hasOwnProperty("oauthConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.OAuthConfig.verify(message.oauthConfig); + if (error) + return "oauthConfig." + error; + } + } + if (message.serviceAgentIdTokenAuthConfig != null && message.hasOwnProperty("serviceAgentIdTokenAuthConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.verify(message.serviceAgentIdTokenAuthConfig); + if (error) + return "serviceAgentIdTokenAuthConfig." + error; + } + } + if (message.serviceAccountAuthConfig != null && message.hasOwnProperty("serviceAccountAuthConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig.verify(message.serviceAccountAuthConfig); + if (error) + return "serviceAccountAuthConfig." + error; + } + } + if (message.bearerTokenConfig != null && message.hasOwnProperty("bearerTokenConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.BearerTokenConfig.verify(message.bearerTokenConfig); + if (error) + return "bearerTokenConfig." + error; + } + } + return null; + }; + + /** + * Creates an ApiAuthentication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ApiAuthentication} ApiAuthentication + */ + ApiAuthentication.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ApiAuthentication) + return object; + var message = new $root.google.cloud.ces.v1beta.ApiAuthentication(); + if (object.apiKeyConfig != null) { + if (typeof object.apiKeyConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.ApiAuthentication.apiKeyConfig: object expected"); + message.apiKeyConfig = $root.google.cloud.ces.v1beta.ApiKeyConfig.fromObject(object.apiKeyConfig); + } + if (object.oauthConfig != null) { + if (typeof object.oauthConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.ApiAuthentication.oauthConfig: object expected"); + message.oauthConfig = $root.google.cloud.ces.v1beta.OAuthConfig.fromObject(object.oauthConfig); + } + if (object.serviceAgentIdTokenAuthConfig != null) { + if (typeof object.serviceAgentIdTokenAuthConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.ApiAuthentication.serviceAgentIdTokenAuthConfig: object expected"); + message.serviceAgentIdTokenAuthConfig = $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.fromObject(object.serviceAgentIdTokenAuthConfig); + } + if (object.serviceAccountAuthConfig != null) { + if (typeof object.serviceAccountAuthConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.ApiAuthentication.serviceAccountAuthConfig: object expected"); + message.serviceAccountAuthConfig = $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig.fromObject(object.serviceAccountAuthConfig); + } + if (object.bearerTokenConfig != null) { + if (typeof object.bearerTokenConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.ApiAuthentication.bearerTokenConfig: object expected"); + message.bearerTokenConfig = $root.google.cloud.ces.v1beta.BearerTokenConfig.fromObject(object.bearerTokenConfig); + } + return message; + }; + + /** + * Creates a plain object from an ApiAuthentication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @static + * @param {google.cloud.ces.v1beta.ApiAuthentication} message ApiAuthentication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiAuthentication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) { + object.apiKeyConfig = $root.google.cloud.ces.v1beta.ApiKeyConfig.toObject(message.apiKeyConfig, options); + if (options.oneofs) + object.authConfig = "apiKeyConfig"; + } + if (message.oauthConfig != null && message.hasOwnProperty("oauthConfig")) { + object.oauthConfig = $root.google.cloud.ces.v1beta.OAuthConfig.toObject(message.oauthConfig, options); + if (options.oneofs) + object.authConfig = "oauthConfig"; + } + if (message.serviceAgentIdTokenAuthConfig != null && message.hasOwnProperty("serviceAgentIdTokenAuthConfig")) { + object.serviceAgentIdTokenAuthConfig = $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.toObject(message.serviceAgentIdTokenAuthConfig, options); + if (options.oneofs) + object.authConfig = "serviceAgentIdTokenAuthConfig"; + } + if (message.serviceAccountAuthConfig != null && message.hasOwnProperty("serviceAccountAuthConfig")) { + object.serviceAccountAuthConfig = $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig.toObject(message.serviceAccountAuthConfig, options); + if (options.oneofs) + object.authConfig = "serviceAccountAuthConfig"; + } + if (message.bearerTokenConfig != null && message.hasOwnProperty("bearerTokenConfig")) { + object.bearerTokenConfig = $root.google.cloud.ces.v1beta.BearerTokenConfig.toObject(message.bearerTokenConfig, options); + if (options.oneofs) + object.authConfig = "bearerTokenConfig"; + } + return object; + }; + + /** + * Converts this ApiAuthentication to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @instance + * @returns {Object.} JSON object + */ + ApiAuthentication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiAuthentication + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiAuthentication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ApiAuthentication"; + }; + + return ApiAuthentication; + })(); + + v1beta.DataStoreTool = (function() { + + /** + * Properties of a DataStoreTool. + * @memberof google.cloud.ces.v1beta + * @interface IDataStoreTool + * @property {google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource|null} [dataStoreSource] DataStoreTool dataStoreSource + * @property {google.cloud.ces.v1beta.DataStoreTool.IEngineSource|null} [engineSource] DataStoreTool engineSource + * @property {string|null} [name] DataStoreTool name + * @property {string|null} [description] DataStoreTool description + * @property {Array.|null} [boostSpecs] DataStoreTool boostSpecs + * @property {Array.|null} [modalityConfigs] DataStoreTool modalityConfigs + * @property {google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior|null} [filterParameterBehavior] DataStoreTool filterParameterBehavior + */ + + /** + * Constructs a new DataStoreTool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DataStoreTool. + * @implements IDataStoreTool + * @constructor + * @param {google.cloud.ces.v1beta.IDataStoreTool=} [properties] Properties to set + */ + function DataStoreTool(properties) { + this.boostSpecs = []; + this.modalityConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStoreTool dataStoreSource. + * @member {google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource|null|undefined} dataStoreSource + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @instance + */ + DataStoreTool.prototype.dataStoreSource = null; + + /** + * DataStoreTool engineSource. + * @member {google.cloud.ces.v1beta.DataStoreTool.IEngineSource|null|undefined} engineSource + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @instance + */ + DataStoreTool.prototype.engineSource = null; + + /** + * DataStoreTool name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @instance + */ + DataStoreTool.prototype.name = ""; + + /** + * DataStoreTool description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @instance + */ + DataStoreTool.prototype.description = ""; + + /** + * DataStoreTool boostSpecs. + * @member {Array.} boostSpecs + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @instance + */ + DataStoreTool.prototype.boostSpecs = $util.emptyArray; + + /** + * DataStoreTool modalityConfigs. + * @member {Array.} modalityConfigs + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @instance + */ + DataStoreTool.prototype.modalityConfigs = $util.emptyArray; + + /** + * DataStoreTool filterParameterBehavior. + * @member {google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior} filterParameterBehavior + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @instance + */ + DataStoreTool.prototype.filterParameterBehavior = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DataStoreTool searchSource. + * @member {"dataStoreSource"|"engineSource"|undefined} searchSource + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @instance + */ + Object.defineProperty(DataStoreTool.prototype, "searchSource", { + get: $util.oneOfGetter($oneOfFields = ["dataStoreSource", "engineSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataStoreTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @static + * @param {google.cloud.ces.v1beta.IDataStoreTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool} DataStoreTool instance + */ + DataStoreTool.create = function create(properties) { + return new DataStoreTool(properties); + }; + + /** + * Encodes the specified DataStoreTool message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @static + * @param {google.cloud.ces.v1beta.IDataStoreTool} message DataStoreTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.dataStoreSource != null && Object.hasOwnProperty.call(message, "dataStoreSource")) + $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.encode(message.dataStoreSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.engineSource != null && Object.hasOwnProperty.call(message, "engineSource")) + $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource.encode(message.engineSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.boostSpecs != null && message.boostSpecs.length) + for (var i = 0; i < message.boostSpecs.length; ++i) + $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.encode(message.boostSpecs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.modalityConfigs != null && message.modalityConfigs.length) + for (var i = 0; i < message.modalityConfigs.length; ++i) + $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.encode(message.modalityConfigs[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.filterParameterBehavior != null && Object.hasOwnProperty.call(message, "filterParameterBehavior")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.filterParameterBehavior); + return writer; + }; + + /** + * Encodes the specified DataStoreTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @static + * @param {google.cloud.ces.v1beta.IDataStoreTool} message DataStoreTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool} DataStoreTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.dataStoreSource = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.engineSource = $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 8: { + if (!(message.boostSpecs && message.boostSpecs.length)) + message.boostSpecs = []; + message.boostSpecs.push($root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.modalityConfigs && message.modalityConfigs.length)) + message.modalityConfigs = []; + message.modalityConfigs.push($root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.decode(reader, reader.uint32())); + break; + } + case 10: { + message.filterParameterBehavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool} DataStoreTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStoreTool message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStoreTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataStoreSource != null && message.hasOwnProperty("dataStoreSource")) { + properties.searchSource = 1; + { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.verify(message.dataStoreSource); + if (error) + return "dataStoreSource." + error; + } + } + if (message.engineSource != null && message.hasOwnProperty("engineSource")) { + if (properties.searchSource === 1) + return "searchSource: multiple values"; + properties.searchSource = 1; + { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource.verify(message.engineSource); + if (error) + return "engineSource." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.boostSpecs != null && message.hasOwnProperty("boostSpecs")) { + if (!Array.isArray(message.boostSpecs)) + return "boostSpecs: array expected"; + for (var i = 0; i < message.boostSpecs.length; ++i) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.verify(message.boostSpecs[i]); + if (error) + return "boostSpecs." + error; + } + } + if (message.modalityConfigs != null && message.hasOwnProperty("modalityConfigs")) { + if (!Array.isArray(message.modalityConfigs)) + return "modalityConfigs: array expected"; + for (var i = 0; i < message.modalityConfigs.length; ++i) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.verify(message.modalityConfigs[i]); + if (error) + return "modalityConfigs." + error; + } + } + if (message.filterParameterBehavior != null && message.hasOwnProperty("filterParameterBehavior")) + switch (message.filterParameterBehavior) { + default: + return "filterParameterBehavior: enum value expected"; + case 0: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a DataStoreTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool} DataStoreTool + */ + DataStoreTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool(); + if (object.dataStoreSource != null) { + if (typeof object.dataStoreSource !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.dataStoreSource: object expected"); + message.dataStoreSource = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.fromObject(object.dataStoreSource); + } + if (object.engineSource != null) { + if (typeof object.engineSource !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.engineSource: object expected"); + message.engineSource = $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource.fromObject(object.engineSource); + } + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.boostSpecs) { + if (!Array.isArray(object.boostSpecs)) + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.boostSpecs: array expected"); + message.boostSpecs = []; + for (var i = 0; i < object.boostSpecs.length; ++i) { + if (typeof object.boostSpecs[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.boostSpecs: object expected"); + message.boostSpecs[i] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.fromObject(object.boostSpecs[i]); + } + } + if (object.modalityConfigs) { + if (!Array.isArray(object.modalityConfigs)) + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.modalityConfigs: array expected"); + message.modalityConfigs = []; + for (var i = 0; i < object.modalityConfigs.length; ++i) { + if (typeof object.modalityConfigs[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.modalityConfigs: object expected"); + message.modalityConfigs[i] = $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.fromObject(object.modalityConfigs[i]); + } + } + switch (object.filterParameterBehavior) { + default: + if (typeof object.filterParameterBehavior === "number") { + message.filterParameterBehavior = object.filterParameterBehavior; + break; + } + break; + case "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED": + case 0: + message.filterParameterBehavior = 0; + break; + case "ALWAYS_INCLUDE": + case 2: + message.filterParameterBehavior = 2; + break; + case "NEVER_INCLUDE": + case 3: + message.filterParameterBehavior = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a DataStoreTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool} message DataStoreTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStoreTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.boostSpecs = []; + object.modalityConfigs = []; + } + if (options.defaults) { + object.name = ""; + object.description = ""; + object.filterParameterBehavior = options.enums === String ? "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.dataStoreSource != null && message.hasOwnProperty("dataStoreSource")) { + object.dataStoreSource = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.toObject(message.dataStoreSource, options); + if (options.oneofs) + object.searchSource = "dataStoreSource"; + } + if (message.engineSource != null && message.hasOwnProperty("engineSource")) { + object.engineSource = $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource.toObject(message.engineSource, options); + if (options.oneofs) + object.searchSource = "engineSource"; + } + if (message.boostSpecs && message.boostSpecs.length) { + object.boostSpecs = []; + for (var j = 0; j < message.boostSpecs.length; ++j) + object.boostSpecs[j] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.toObject(message.boostSpecs[j], options); + } + if (message.modalityConfigs && message.modalityConfigs.length) { + object.modalityConfigs = []; + for (var j = 0; j < message.modalityConfigs.length; ++j) + object.modalityConfigs[j] = $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.toObject(message.modalityConfigs[j], options); + } + if (message.filterParameterBehavior != null && message.hasOwnProperty("filterParameterBehavior")) + object.filterParameterBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior[message.filterParameterBehavior] === undefined ? message.filterParameterBehavior : $root.google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior[message.filterParameterBehavior] : message.filterParameterBehavior; + return object; + }; + + /** + * Converts this DataStoreTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @instance + * @returns {Object.} JSON object + */ + DataStoreTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStoreTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStoreTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool"; + }; + + DataStoreTool.RewriterConfig = (function() { + + /** + * Properties of a RewriterConfig. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @interface IRewriterConfig + * @property {google.cloud.ces.v1beta.IModelSettings|null} [modelSettings] RewriterConfig modelSettings + * @property {string|null} [prompt] RewriterConfig prompt + * @property {boolean|null} [disabled] RewriterConfig disabled + */ + + /** + * Constructs a new RewriterConfig. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @classdesc Represents a RewriterConfig. + * @implements IRewriterConfig + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig=} [properties] Properties to set + */ + function RewriterConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RewriterConfig modelSettings. + * @member {google.cloud.ces.v1beta.IModelSettings|null|undefined} modelSettings + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @instance + */ + RewriterConfig.prototype.modelSettings = null; + + /** + * RewriterConfig prompt. + * @member {string} prompt + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @instance + */ + RewriterConfig.prototype.prompt = ""; + + /** + * RewriterConfig disabled. + * @member {boolean} disabled + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @instance + */ + RewriterConfig.prototype.disabled = false; + + /** + * Creates a new RewriterConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.RewriterConfig} RewriterConfig instance + */ + RewriterConfig.create = function create(properties) { + return new RewriterConfig(properties); + }; + + /** + * Encodes the specified RewriterConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig} message RewriterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RewriterConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) + $root.google.cloud.ces.v1beta.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.prompt); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.disabled); + return writer; + }; + + /** + * Encodes the specified RewriterConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig} message RewriterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RewriterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RewriterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.RewriterConfig} RewriterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RewriterConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.prompt = reader.string(); + break; + } + case 3: { + message.disabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RewriterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.RewriterConfig} RewriterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RewriterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RewriterConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RewriterConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { + var error = $root.google.cloud.ces.v1beta.ModelSettings.verify(message.modelSettings); + if (error) + return "modelSettings." + error; + } + if (message.prompt != null && message.hasOwnProperty("prompt")) + if (!$util.isString(message.prompt)) + return "prompt: string expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + return null; + }; + + /** + * Creates a RewriterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.RewriterConfig} RewriterConfig + */ + RewriterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig(); + if (object.modelSettings != null) { + if (typeof object.modelSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.modelSettings: object expected"); + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.fromObject(object.modelSettings); + } + if (object.prompt != null) + message.prompt = String(object.prompt); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + return message; + }; + + /** + * Creates a plain object from a RewriterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.RewriterConfig} message RewriterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RewriterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modelSettings = null; + object.prompt = ""; + object.disabled = false; + } + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) + object.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.toObject(message.modelSettings, options); + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = message.prompt; + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + return object; + }; + + /** + * Converts this RewriterConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @instance + * @returns {Object.} JSON object + */ + RewriterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RewriterConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RewriterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.RewriterConfig"; + }; + + return RewriterConfig; + })(); + + DataStoreTool.SummarizationConfig = (function() { + + /** + * Properties of a SummarizationConfig. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @interface ISummarizationConfig + * @property {google.cloud.ces.v1beta.IModelSettings|null} [modelSettings] SummarizationConfig modelSettings + * @property {string|null} [prompt] SummarizationConfig prompt + * @property {boolean|null} [disabled] SummarizationConfig disabled + */ + + /** + * Constructs a new SummarizationConfig. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @classdesc Represents a SummarizationConfig. + * @implements ISummarizationConfig + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig=} [properties] Properties to set + */ + function SummarizationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SummarizationConfig modelSettings. + * @member {google.cloud.ces.v1beta.IModelSettings|null|undefined} modelSettings + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @instance + */ + SummarizationConfig.prototype.modelSettings = null; + + /** + * SummarizationConfig prompt. + * @member {string} prompt + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @instance + */ + SummarizationConfig.prototype.prompt = ""; + + /** + * SummarizationConfig disabled. + * @member {boolean} disabled + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @instance + */ + SummarizationConfig.prototype.disabled = false; + + /** + * Creates a new SummarizationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig} SummarizationConfig instance + */ + SummarizationConfig.create = function create(properties) { + return new SummarizationConfig(properties); + }; + + /** + * Encodes the specified SummarizationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig} message SummarizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SummarizationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) + $root.google.cloud.ces.v1beta.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.prompt); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.disabled); + return writer; + }; + + /** + * Encodes the specified SummarizationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig} message SummarizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SummarizationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SummarizationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig} SummarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SummarizationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.prompt = reader.string(); + break; + } + case 3: { + message.disabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SummarizationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig} SummarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SummarizationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SummarizationConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SummarizationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { + var error = $root.google.cloud.ces.v1beta.ModelSettings.verify(message.modelSettings); + if (error) + return "modelSettings." + error; + } + if (message.prompt != null && message.hasOwnProperty("prompt")) + if (!$util.isString(message.prompt)) + return "prompt: string expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + return null; + }; + + /** + * Creates a SummarizationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig} SummarizationConfig + */ + SummarizationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig(); + if (object.modelSettings != null) { + if (typeof object.modelSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.modelSettings: object expected"); + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.fromObject(object.modelSettings); + } + if (object.prompt != null) + message.prompt = String(object.prompt); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + return message; + }; + + /** + * Creates a plain object from a SummarizationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig} message SummarizationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SummarizationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modelSettings = null; + object.prompt = ""; + object.disabled = false; + } + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) + object.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.toObject(message.modelSettings, options); + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = message.prompt; + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + return object; + }; + + /** + * Converts this SummarizationConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @instance + * @returns {Object.} JSON object + */ + SummarizationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SummarizationConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SummarizationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig"; + }; + + return SummarizationConfig; + })(); + + DataStoreTool.GroundingConfig = (function() { + + /** + * Properties of a GroundingConfig. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @interface IGroundingConfig + * @property {number|null} [groundingLevel] GroundingConfig groundingLevel + * @property {boolean|null} [disabled] GroundingConfig disabled + */ + + /** + * Constructs a new GroundingConfig. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @classdesc Represents a GroundingConfig. + * @implements IGroundingConfig + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig=} [properties] Properties to set + */ + function GroundingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroundingConfig groundingLevel. + * @member {number} groundingLevel + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @instance + */ + GroundingConfig.prototype.groundingLevel = 0; + + /** + * GroundingConfig disabled. + * @member {boolean} disabled + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @instance + */ + GroundingConfig.prototype.disabled = false; + + /** + * Creates a new GroundingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.GroundingConfig} GroundingConfig instance + */ + GroundingConfig.create = function create(properties) { + return new GroundingConfig(properties); + }; + + /** + * Encodes the specified GroundingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig} message GroundingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groundingLevel != null && Object.hasOwnProperty.call(message, "groundingLevel")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.groundingLevel); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.disabled); + return writer; + }; + + /** + * Encodes the specified GroundingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig} message GroundingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroundingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.GroundingConfig} GroundingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.groundingLevel = reader.float(); + break; + } + case 2: { + message.disabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroundingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.GroundingConfig} GroundingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroundingConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroundingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groundingLevel != null && message.hasOwnProperty("groundingLevel")) + if (typeof message.groundingLevel !== "number") + return "groundingLevel: number expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + return null; + }; + + /** + * Creates a GroundingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.GroundingConfig} GroundingConfig + */ + GroundingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig(); + if (object.groundingLevel != null) + message.groundingLevel = Number(object.groundingLevel); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + return message; + }; + + /** + * Creates a plain object from a GroundingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.GroundingConfig} message GroundingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroundingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.groundingLevel = 0; + object.disabled = false; + } + if (message.groundingLevel != null && message.hasOwnProperty("groundingLevel")) + object.groundingLevel = options.json && !isFinite(message.groundingLevel) ? String(message.groundingLevel) : message.groundingLevel; + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + return object; + }; + + /** + * Converts this GroundingConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @instance + * @returns {Object.} JSON object + */ + GroundingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroundingConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroundingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.GroundingConfig"; + }; + + return GroundingConfig; + })(); + + DataStoreTool.DataStoreSource = (function() { + + /** + * Properties of a DataStoreSource. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @interface IDataStoreSource + * @property {string|null} [filter] DataStoreSource filter + * @property {google.cloud.ces.v1beta.IDataStore|null} [dataStore] DataStoreSource dataStore + */ + + /** + * Constructs a new DataStoreSource. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @classdesc Represents a DataStoreSource. + * @implements IDataStoreSource + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource=} [properties] Properties to set + */ + function DataStoreSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStoreSource filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @instance + */ + DataStoreSource.prototype.filter = ""; + + /** + * DataStoreSource dataStore. + * @member {google.cloud.ces.v1beta.IDataStore|null|undefined} dataStore + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @instance + */ + DataStoreSource.prototype.dataStore = null; + + /** + * Creates a new DataStoreSource instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.DataStoreSource} DataStoreSource instance + */ + DataStoreSource.create = function create(properties) { + return new DataStoreSource(properties); + }; + + /** + * Encodes the specified DataStoreSource message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource} message DataStoreSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.dataStore != null && Object.hasOwnProperty.call(message, "dataStore")) + $root.google.cloud.ces.v1beta.DataStore.encode(message.dataStore, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataStoreSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource} message DataStoreSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStoreSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.DataStoreSource} DataStoreSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.filter = reader.string(); + break; + } + case 4: { + message.dataStore = $root.google.cloud.ces.v1beta.DataStore.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataStoreSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.DataStoreSource} DataStoreSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStoreSource message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStoreSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.dataStore != null && message.hasOwnProperty("dataStore")) { + var error = $root.google.cloud.ces.v1beta.DataStore.verify(message.dataStore); + if (error) + return "dataStore." + error; + } + return null; + }; + + /** + * Creates a DataStoreSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.DataStoreSource} DataStoreSource + */ + DataStoreSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.dataStore != null) { + if (typeof object.dataStore !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.dataStore: object expected"); + message.dataStore = $root.google.cloud.ces.v1beta.DataStore.fromObject(object.dataStore); + } + return message; + }; + + /** + * Creates a plain object from a DataStoreSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.DataStoreSource} message DataStoreSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStoreSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.dataStore = null; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.dataStore != null && message.hasOwnProperty("dataStore")) + object.dataStore = $root.google.cloud.ces.v1beta.DataStore.toObject(message.dataStore, options); + return object; + }; + + /** + * Converts this DataStoreSource to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @instance + * @returns {Object.} JSON object + */ + DataStoreSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStoreSource + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStoreSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.DataStoreSource"; + }; + + return DataStoreSource; + })(); + + DataStoreTool.EngineSource = (function() { + + /** + * Properties of an EngineSource. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @interface IEngineSource + * @property {string|null} [engine] EngineSource engine + * @property {Array.|null} [dataStoreSources] EngineSource dataStoreSources + * @property {string|null} [filter] EngineSource filter + */ + + /** + * Constructs a new EngineSource. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @classdesc Represents an EngineSource. + * @implements IEngineSource + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.IEngineSource=} [properties] Properties to set + */ + function EngineSource(properties) { + this.dataStoreSources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EngineSource engine. + * @member {string} engine + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @instance + */ + EngineSource.prototype.engine = ""; + + /** + * EngineSource dataStoreSources. + * @member {Array.} dataStoreSources + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @instance + */ + EngineSource.prototype.dataStoreSources = $util.emptyArray; + + /** + * EngineSource filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @instance + */ + EngineSource.prototype.filter = ""; + + /** + * Creates a new EngineSource instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IEngineSource=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.EngineSource} EngineSource instance + */ + EngineSource.create = function create(properties) { + return new EngineSource(properties); + }; + + /** + * Encodes the specified EngineSource message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.EngineSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IEngineSource} message EngineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EngineSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.engine != null && Object.hasOwnProperty.call(message, "engine")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.engine); + if (message.dataStoreSources != null && message.dataStoreSources.length) + for (var i = 0; i < message.dataStoreSources.length; ++i) + $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.encode(message.dataStoreSources[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + return writer; + }; + + /** + * Encodes the specified EngineSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.EngineSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IEngineSource} message EngineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EngineSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EngineSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.EngineSource} EngineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EngineSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.engine = reader.string(); + break; + } + case 2: { + if (!(message.dataStoreSources && message.dataStoreSources.length)) + message.dataStoreSources = []; + message.dataStoreSources.push($root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.decode(reader, reader.uint32())); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EngineSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.EngineSource} EngineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EngineSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EngineSource message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EngineSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.engine != null && message.hasOwnProperty("engine")) + if (!$util.isString(message.engine)) + return "engine: string expected"; + if (message.dataStoreSources != null && message.hasOwnProperty("dataStoreSources")) { + if (!Array.isArray(message.dataStoreSources)) + return "dataStoreSources: array expected"; + for (var i = 0; i < message.dataStoreSources.length; ++i) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.verify(message.dataStoreSources[i]); + if (error) + return "dataStoreSources." + error; + } + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates an EngineSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.EngineSource} EngineSource + */ + EngineSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource(); + if (object.engine != null) + message.engine = String(object.engine); + if (object.dataStoreSources) { + if (!Array.isArray(object.dataStoreSources)) + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.EngineSource.dataStoreSources: array expected"); + message.dataStoreSources = []; + for (var i = 0; i < object.dataStoreSources.length; ++i) { + if (typeof object.dataStoreSources[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.EngineSource.dataStoreSources: object expected"); + message.dataStoreSources[i] = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.fromObject(object.dataStoreSources[i]); + } + } + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from an EngineSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.EngineSource} message EngineSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EngineSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataStoreSources = []; + if (options.defaults) { + object.engine = ""; + object.filter = ""; + } + if (message.engine != null && message.hasOwnProperty("engine")) + object.engine = message.engine; + if (message.dataStoreSources && message.dataStoreSources.length) { + object.dataStoreSources = []; + for (var j = 0; j < message.dataStoreSources.length; ++j) + object.dataStoreSources[j] = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.toObject(message.dataStoreSources[j], options); + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this EngineSource to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @instance + * @returns {Object.} JSON object + */ + EngineSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EngineSource + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EngineSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.EngineSource"; + }; + + return EngineSource; + })(); + + DataStoreTool.BoostSpecs = (function() { + + /** + * Properties of a BoostSpecs. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @interface IBoostSpecs + * @property {Array.|null} [dataStores] BoostSpecs dataStores + * @property {Array.|null} [spec] BoostSpecs spec + */ + + /** + * Constructs a new BoostSpecs. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @classdesc Represents a BoostSpecs. + * @implements IBoostSpecs + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs=} [properties] Properties to set + */ + function BoostSpecs(properties) { + this.dataStores = []; + this.spec = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostSpecs dataStores. + * @member {Array.} dataStores + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @instance + */ + BoostSpecs.prototype.dataStores = $util.emptyArray; + + /** + * BoostSpecs spec. + * @member {Array.} spec + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @instance + */ + BoostSpecs.prototype.spec = $util.emptyArray; + + /** + * Creates a new BoostSpecs instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpecs} BoostSpecs instance + */ + BoostSpecs.create = function create(properties) { + return new BoostSpecs(properties); + }; + + /** + * Encodes the specified BoostSpecs message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs} message BoostSpecs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpecs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataStores != null && message.dataStores.length) + for (var i = 0; i < message.dataStores.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataStores[i]); + if (message.spec != null && message.spec.length) + for (var i = 0; i < message.spec.length; ++i) + $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.encode(message.spec[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoostSpecs message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs} message BoostSpecs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpecs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpecs} BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpecs.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataStores && message.dataStores.length)) + message.dataStores = []; + message.dataStores.push(reader.string()); + break; + } + case 2: { + if (!(message.spec && message.spec.length)) + message.spec = []; + message.spec.push($root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpecs} BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpecs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostSpecs message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostSpecs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataStores != null && message.hasOwnProperty("dataStores")) { + if (!Array.isArray(message.dataStores)) + return "dataStores: array expected"; + for (var i = 0; i < message.dataStores.length; ++i) + if (!$util.isString(message.dataStores[i])) + return "dataStores: string[] expected"; + } + if (message.spec != null && message.hasOwnProperty("spec")) { + if (!Array.isArray(message.spec)) + return "spec: array expected"; + for (var i = 0; i < message.spec.length; ++i) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.verify(message.spec[i]); + if (error) + return "spec." + error; + } + } + return null; + }; + + /** + * Creates a BoostSpecs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpecs} BoostSpecs + */ + BoostSpecs.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs(); + if (object.dataStores) { + if (!Array.isArray(object.dataStores)) + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.dataStores: array expected"); + message.dataStores = []; + for (var i = 0; i < object.dataStores.length; ++i) + message.dataStores[i] = String(object.dataStores[i]); + } + if (object.spec) { + if (!Array.isArray(object.spec)) + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.spec: array expected"); + message.spec = []; + for (var i = 0; i < object.spec.length; ++i) { + if (typeof object.spec[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.spec: object expected"); + message.spec[i] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.fromObject(object.spec[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoostSpecs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpecs} message BoostSpecs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostSpecs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dataStores = []; + object.spec = []; + } + if (message.dataStores && message.dataStores.length) { + object.dataStores = []; + for (var j = 0; j < message.dataStores.length; ++j) + object.dataStores[j] = message.dataStores[j]; + } + if (message.spec && message.spec.length) { + object.spec = []; + for (var j = 0; j < message.spec.length; ++j) + object.spec[j] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.toObject(message.spec[j], options); + } + return object; + }; + + /** + * Converts this BoostSpecs to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @instance + * @returns {Object.} JSON object + */ + BoostSpecs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostSpecs + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostSpecs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.BoostSpecs"; + }; + + return BoostSpecs; + })(); + + DataStoreTool.BoostSpec = (function() { + + /** + * Properties of a BoostSpec. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @interface IBoostSpec + * @property {Array.|null} [conditionBoostSpecs] BoostSpec conditionBoostSpecs + */ + + /** + * Constructs a new BoostSpec. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @classdesc Represents a BoostSpec. + * @implements IBoostSpec + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpec=} [properties] Properties to set + */ + function BoostSpec(properties) { + this.conditionBoostSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostSpec conditionBoostSpecs. + * @member {Array.} conditionBoostSpecs + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @instance + */ + BoostSpec.prototype.conditionBoostSpecs = $util.emptyArray; + + /** + * Creates a new BoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpec=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec} BoostSpec instance + */ + BoostSpec.create = function create(properties) { + return new BoostSpec(properties); + }; + + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpec} message BoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditionBoostSpecs != null && message.conditionBoostSpecs.length) + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) + $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.encode(message.conditionBoostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpec} message BoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec} BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.conditionBoostSpecs && message.conditionBoostSpecs.length)) + message.conditionBoostSpecs = []; + message.conditionBoostSpecs.push($root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec} BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostSpec message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conditionBoostSpecs != null && message.hasOwnProperty("conditionBoostSpecs")) { + if (!Array.isArray(message.conditionBoostSpecs)) + return "conditionBoostSpecs: array expected"; + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.verify(message.conditionBoostSpecs[i]); + if (error) + return "conditionBoostSpecs." + error; + } + } + return null; + }; + + /** + * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec} BoostSpec + */ + BoostSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec(); + if (object.conditionBoostSpecs) { + if (!Array.isArray(object.conditionBoostSpecs)) + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpec.conditionBoostSpecs: array expected"); + message.conditionBoostSpecs = []; + for (var i = 0; i < object.conditionBoostSpecs.length; ++i) { + if (typeof object.conditionBoostSpecs[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpec.conditionBoostSpecs: object expected"); + message.conditionBoostSpecs[i] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.fromObject(object.conditionBoostSpecs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec} message BoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conditionBoostSpecs = []; + if (message.conditionBoostSpecs && message.conditionBoostSpecs.length) { + object.conditionBoostSpecs = []; + for (var j = 0; j < message.conditionBoostSpecs.length; ++j) + object.conditionBoostSpecs[j] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.toObject(message.conditionBoostSpecs[j], options); + } + return object; + }; + + /** + * Converts this BoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @instance + * @returns {Object.} JSON object + */ + BoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostSpec + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.BoostSpec"; + }; + + BoostSpec.ConditionBoostSpec = (function() { + + /** + * Properties of a ConditionBoostSpec. + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @interface IConditionBoostSpec + * @property {string|null} [condition] ConditionBoostSpec condition + * @property {number|null} [boost] ConditionBoostSpec boost + * @property {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null} [boostControlSpec] ConditionBoostSpec boostControlSpec + */ + + /** + * Constructs a new ConditionBoostSpec. + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @classdesc Represents a ConditionBoostSpec. + * @implements IConditionBoostSpec + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + */ + function ConditionBoostSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConditionBoostSpec condition. + * @member {string} condition + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.condition = ""; + + /** + * ConditionBoostSpec boost. + * @member {number} boost + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.boost = 0; + + /** + * ConditionBoostSpec boostControlSpec. + * @member {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null|undefined} boostControlSpec + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.boostControlSpec = null; + + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec instance + */ + ConditionBoostSpec.create = function create(properties) { + return new ConditionBoostSpec(properties); + }; + + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); + if (message.boostControlSpec != null && Object.hasOwnProperty.call(message, "boostControlSpec")) + $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.encode(message.boostControlSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.condition = reader.string(); + break; + } + case 2: { + message.boost = reader.float(); + break; + } + case 4: { + message.boostControlSpec = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionBoostSpec message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionBoostSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + if (message.boostControlSpec != null && message.hasOwnProperty("boostControlSpec")) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify(message.boostControlSpec); + if (error) + return "boostControlSpec." + error; + } + return null; + }; + + /** + * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + */ + ConditionBoostSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec(); + if (object.condition != null) + message.condition = String(object.condition); + if (object.boost != null) + message.boost = Number(object.boost); + if (object.boostControlSpec != null) { + if (typeof object.boostControlSpec !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.boostControlSpec: object expected"); + message.boostControlSpec = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.fromObject(object.boostControlSpec); + } + return message; + }; + + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec} message ConditionBoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionBoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.condition = ""; + object.boost = 0; + object.boostControlSpec = null; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + if (message.boostControlSpec != null && message.hasOwnProperty("boostControlSpec")) + object.boostControlSpec = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.toObject(message.boostControlSpec, options); + return object; + }; + + /** + * Converts this ConditionBoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @instance + * @returns {Object.} JSON object + */ + ConditionBoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConditionBoostSpec + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConditionBoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec"; + }; + + ConditionBoostSpec.BoostControlSpec = (function() { + + /** + * Properties of a BoostControlSpec. + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @interface IBoostControlSpec + * @property {string|null} [fieldName] BoostControlSpec fieldName + * @property {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|null} [attributeType] BoostControlSpec attributeType + * @property {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|null} [interpolationType] BoostControlSpec interpolationType + * @property {Array.|null} [controlPoints] BoostControlSpec controlPoints + */ + + /** + * Constructs a new BoostControlSpec. + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @classdesc Represents a BoostControlSpec. + * @implements IBoostControlSpec + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec=} [properties] Properties to set + */ + function BoostControlSpec(properties) { + this.controlPoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostControlSpec fieldName. + * @member {string} fieldName + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.fieldName = ""; + + /** + * BoostControlSpec attributeType. + * @member {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType} attributeType + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.attributeType = 0; + + /** + * BoostControlSpec interpolationType. + * @member {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType} interpolationType + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.interpolationType = 0; + + /** + * BoostControlSpec controlPoints. + * @member {Array.} controlPoints + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.controlPoints = $util.emptyArray; + + /** + * Creates a new BoostControlSpec instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec instance + */ + BoostControlSpec.create = function create(properties) { + return new BoostControlSpec(properties); + }; + + /** + * Encodes the specified BoostControlSpec message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec} message BoostControlSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostControlSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldName); + if (message.attributeType != null && Object.hasOwnProperty.call(message, "attributeType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.attributeType); + if (message.interpolationType != null && Object.hasOwnProperty.call(message, "interpolationType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.interpolationType); + if (message.controlPoints != null && message.controlPoints.length) + for (var i = 0; i < message.controlPoints.length; ++i) + $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.encode(message.controlPoints[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoostControlSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec} message BoostControlSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostControlSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostControlSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldName = reader.string(); + break; + } + case 2: { + message.attributeType = reader.int32(); + break; + } + case 3: { + message.interpolationType = reader.int32(); + break; + } + case 4: { + if (!(message.controlPoints && message.controlPoints.length)) + message.controlPoints = []; + message.controlPoints.push($root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostControlSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostControlSpec message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostControlSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + if (message.attributeType != null && message.hasOwnProperty("attributeType")) + switch (message.attributeType) { + default: + return "attributeType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.interpolationType != null && message.hasOwnProperty("interpolationType")) + switch (message.interpolationType) { + default: + return "interpolationType: enum value expected"; + case 0: + case 1: + break; + } + if (message.controlPoints != null && message.hasOwnProperty("controlPoints")) { + if (!Array.isArray(message.controlPoints)) + return "controlPoints: array expected"; + for (var i = 0; i < message.controlPoints.length; ++i) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify(message.controlPoints[i]); + if (error) + return "controlPoints." + error; + } + } + return null; + }; + + /** + * Creates a BoostControlSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + */ + BoostControlSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec(); + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + switch (object.attributeType) { + default: + if (typeof object.attributeType === "number") { + message.attributeType = object.attributeType; + break; + } + break; + case "ATTRIBUTE_TYPE_UNSPECIFIED": + case 0: + message.attributeType = 0; + break; + case "NUMERICAL": + case 1: + message.attributeType = 1; + break; + case "FRESHNESS": + case 2: + message.attributeType = 2; + break; + } + switch (object.interpolationType) { + default: + if (typeof object.interpolationType === "number") { + message.interpolationType = object.interpolationType; + break; + } + break; + case "INTERPOLATION_TYPE_UNSPECIFIED": + case 0: + message.interpolationType = 0; + break; + case "LINEAR": + case 1: + message.interpolationType = 1; + break; + } + if (object.controlPoints) { + if (!Array.isArray(object.controlPoints)) + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.controlPoints: array expected"); + message.controlPoints = []; + for (var i = 0; i < object.controlPoints.length; ++i) { + if (typeof object.controlPoints[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.controlPoints: object expected"); + message.controlPoints[i] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.fromObject(object.controlPoints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoostControlSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} message BoostControlSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostControlSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.controlPoints = []; + if (options.defaults) { + object.fieldName = ""; + object.attributeType = options.enums === String ? "ATTRIBUTE_TYPE_UNSPECIFIED" : 0; + object.interpolationType = options.enums === String ? "INTERPOLATION_TYPE_UNSPECIFIED" : 0; + } + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + object.fieldName = message.fieldName; + if (message.attributeType != null && message.hasOwnProperty("attributeType")) + object.attributeType = options.enums === String ? $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType[message.attributeType] === undefined ? message.attributeType : $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType[message.attributeType] : message.attributeType; + if (message.interpolationType != null && message.hasOwnProperty("interpolationType")) + object.interpolationType = options.enums === String ? $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType[message.interpolationType] === undefined ? message.interpolationType : $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType[message.interpolationType] : message.interpolationType; + if (message.controlPoints && message.controlPoints.length) { + object.controlPoints = []; + for (var j = 0; j < message.controlPoints.length; ++j) + object.controlPoints[j] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.toObject(message.controlPoints[j], options); + } + return object; + }; + + /** + * Converts this BoostControlSpec to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + * @returns {Object.} JSON object + */ + BoostControlSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostControlSpec + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostControlSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec"; + }; + + BoostControlSpec.ControlPoint = (function() { + + /** + * Properties of a ControlPoint. + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @interface IControlPoint + * @property {string|null} [attributeValue] ControlPoint attributeValue + * @property {number|null} [boostAmount] ControlPoint boostAmount + */ + + /** + * Constructs a new ControlPoint. + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @classdesc Represents a ControlPoint. + * @implements IControlPoint + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint=} [properties] Properties to set + */ + function ControlPoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ControlPoint attributeValue. + * @member {string} attributeValue + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @instance + */ + ControlPoint.prototype.attributeValue = ""; + + /** + * ControlPoint boostAmount. + * @member {number} boostAmount + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @instance + */ + ControlPoint.prototype.boostAmount = 0; + + /** + * Creates a new ControlPoint instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint instance + */ + ControlPoint.create = function create(properties) { + return new ControlPoint(properties); + }; + + /** + * Encodes the specified ControlPoint message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint} message ControlPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ControlPoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributeValue != null && Object.hasOwnProperty.call(message, "attributeValue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributeValue); + if (message.boostAmount != null && Object.hasOwnProperty.call(message, "boostAmount")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boostAmount); + return writer; + }; + + /** + * Encodes the specified ControlPoint message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint} message ControlPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ControlPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ControlPoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ControlPoint.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.attributeValue = reader.string(); + break; + } + case 2: { + message.boostAmount = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ControlPoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ControlPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ControlPoint message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ControlPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributeValue != null && message.hasOwnProperty("attributeValue")) + if (!$util.isString(message.attributeValue)) + return "attributeValue: string expected"; + if (message.boostAmount != null && message.hasOwnProperty("boostAmount")) + if (typeof message.boostAmount !== "number") + return "boostAmount: number expected"; + return null; + }; + + /** + * Creates a ControlPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + */ + ControlPoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint(); + if (object.attributeValue != null) + message.attributeValue = String(object.attributeValue); + if (object.boostAmount != null) + message.boostAmount = Number(object.boostAmount); + return message; + }; + + /** + * Creates a plain object from a ControlPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} message ControlPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ControlPoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attributeValue = ""; + object.boostAmount = 0; + } + if (message.attributeValue != null && message.hasOwnProperty("attributeValue")) + object.attributeValue = message.attributeValue; + if (message.boostAmount != null && message.hasOwnProperty("boostAmount")) + object.boostAmount = options.json && !isFinite(message.boostAmount) ? String(message.boostAmount) : message.boostAmount; + return object; + }; + + /** + * Converts this ControlPoint to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @instance + * @returns {Object.} JSON object + */ + ControlPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ControlPoint + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ControlPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint"; + }; + + return ControlPoint; + })(); + + /** + * AttributeType enum. + * @name google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType + * @enum {number} + * @property {number} ATTRIBUTE_TYPE_UNSPECIFIED=0 ATTRIBUTE_TYPE_UNSPECIFIED value + * @property {number} NUMERICAL=1 NUMERICAL value + * @property {number} FRESHNESS=2 FRESHNESS value + */ + BoostControlSpec.AttributeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ATTRIBUTE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NUMERICAL"] = 1; + values[valuesById[2] = "FRESHNESS"] = 2; + return values; + })(); + + /** + * InterpolationType enum. + * @name google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType + * @enum {number} + * @property {number} INTERPOLATION_TYPE_UNSPECIFIED=0 INTERPOLATION_TYPE_UNSPECIFIED value + * @property {number} LINEAR=1 LINEAR value + */ + BoostControlSpec.InterpolationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTERPOLATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINEAR"] = 1; + return values; + })(); + + return BoostControlSpec; + })(); + + return ConditionBoostSpec; + })(); + + return BoostSpec; + })(); + + DataStoreTool.ModalityConfig = (function() { + + /** + * Properties of a ModalityConfig. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @interface IModalityConfig + * @property {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType|null} [modalityType] ModalityConfig modalityType + * @property {google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig|null} [rewriterConfig] ModalityConfig rewriterConfig + * @property {google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig|null} [summarizationConfig] ModalityConfig summarizationConfig + * @property {google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig|null} [groundingConfig] ModalityConfig groundingConfig + */ + + /** + * Constructs a new ModalityConfig. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @classdesc Represents a ModalityConfig. + * @implements IModalityConfig + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.IModalityConfig=} [properties] Properties to set + */ + function ModalityConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModalityConfig modalityType. + * @member {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType} modalityType + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @instance + */ + ModalityConfig.prototype.modalityType = 0; + + /** + * ModalityConfig rewriterConfig. + * @member {google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig|null|undefined} rewriterConfig + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @instance + */ + ModalityConfig.prototype.rewriterConfig = null; + + /** + * ModalityConfig summarizationConfig. + * @member {google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig|null|undefined} summarizationConfig + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @instance + */ + ModalityConfig.prototype.summarizationConfig = null; + + /** + * ModalityConfig groundingConfig. + * @member {google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig|null|undefined} groundingConfig + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @instance + */ + ModalityConfig.prototype.groundingConfig = null; + + /** + * Creates a new ModalityConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IModalityConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig} ModalityConfig instance + */ + ModalityConfig.create = function create(properties) { + return new ModalityConfig(properties); + }; + + /** + * Encodes the specified ModalityConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IModalityConfig} message ModalityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModalityConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modalityType != null && Object.hasOwnProperty.call(message, "modalityType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modalityType); + if (message.rewriterConfig != null && Object.hasOwnProperty.call(message, "rewriterConfig")) + $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.encode(message.rewriterConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.summarizationConfig != null && Object.hasOwnProperty.call(message, "summarizationConfig")) + $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.encode(message.summarizationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.groundingConfig != null && Object.hasOwnProperty.call(message, "groundingConfig")) + $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.encode(message.groundingConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModalityConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IModalityConfig} message ModalityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModalityConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModalityConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig} ModalityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModalityConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.modalityType = reader.int32(); + break; + } + case 2: { + message.rewriterConfig = $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.summarizationConfig = $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.groundingConfig = $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModalityConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig} ModalityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModalityConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModalityConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModalityConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modalityType != null && message.hasOwnProperty("modalityType")) + switch (message.modalityType) { + default: + return "modalityType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.rewriterConfig != null && message.hasOwnProperty("rewriterConfig")) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.verify(message.rewriterConfig); + if (error) + return "rewriterConfig." + error; + } + if (message.summarizationConfig != null && message.hasOwnProperty("summarizationConfig")) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.verify(message.summarizationConfig); + if (error) + return "summarizationConfig." + error; + } + if (message.groundingConfig != null && message.hasOwnProperty("groundingConfig")) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.verify(message.groundingConfig); + if (error) + return "groundingConfig." + error; + } + return null; + }; + + /** + * Creates a ModalityConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig} ModalityConfig + */ + ModalityConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig(); + switch (object.modalityType) { + default: + if (typeof object.modalityType === "number") { + message.modalityType = object.modalityType; + break; + } + break; + case "MODALITY_TYPE_UNSPECIFIED": + case 0: + message.modalityType = 0; + break; + case "TEXT": + case 1: + message.modalityType = 1; + break; + case "AUDIO": + case 2: + message.modalityType = 2; + break; + } + if (object.rewriterConfig != null) { + if (typeof object.rewriterConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.rewriterConfig: object expected"); + message.rewriterConfig = $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.fromObject(object.rewriterConfig); + } + if (object.summarizationConfig != null) { + if (typeof object.summarizationConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.summarizationConfig: object expected"); + message.summarizationConfig = $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.fromObject(object.summarizationConfig); + } + if (object.groundingConfig != null) { + if (typeof object.groundingConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.groundingConfig: object expected"); + message.groundingConfig = $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.fromObject(object.groundingConfig); + } + return message; + }; + + /** + * Creates a plain object from a ModalityConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig} message ModalityConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModalityConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modalityType = options.enums === String ? "MODALITY_TYPE_UNSPECIFIED" : 0; + object.rewriterConfig = null; + object.summarizationConfig = null; + object.groundingConfig = null; + } + if (message.modalityType != null && message.hasOwnProperty("modalityType")) + object.modalityType = options.enums === String ? $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType[message.modalityType] === undefined ? message.modalityType : $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType[message.modalityType] : message.modalityType; + if (message.rewriterConfig != null && message.hasOwnProperty("rewriterConfig")) + object.rewriterConfig = $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.toObject(message.rewriterConfig, options); + if (message.summarizationConfig != null && message.hasOwnProperty("summarizationConfig")) + object.summarizationConfig = $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.toObject(message.summarizationConfig, options); + if (message.groundingConfig != null && message.hasOwnProperty("groundingConfig")) + object.groundingConfig = $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.toObject(message.groundingConfig, options); + return object; + }; + + /** + * Converts this ModalityConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @instance + * @returns {Object.} JSON object + */ + ModalityConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModalityConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModalityConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.ModalityConfig"; + }; + + /** + * ModalityType enum. + * @name google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType + * @enum {number} + * @property {number} MODALITY_TYPE_UNSPECIFIED=0 MODALITY_TYPE_UNSPECIFIED value + * @property {number} TEXT=1 TEXT value + * @property {number} AUDIO=2 AUDIO value + */ + ModalityConfig.ModalityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODALITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "AUDIO"] = 2; + return values; + })(); + + return ModalityConfig; + })(); + + /** + * FilterParameterBehavior enum. + * @name google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior + * @enum {number} + * @property {number} FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED=0 FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED value + * @property {number} ALWAYS_INCLUDE=2 ALWAYS_INCLUDE value + * @property {number} NEVER_INCLUDE=3 NEVER_INCLUDE value + */ + DataStoreTool.FilterParameterBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[2] = "ALWAYS_INCLUDE"] = 2; + values[valuesById[3] = "NEVER_INCLUDE"] = 3; + return values; + })(); + + return DataStoreTool; + })(); + + v1beta.DataStore = (function() { + + /** + * Properties of a DataStore. + * @memberof google.cloud.ces.v1beta + * @interface IDataStore + * @property {string|null} [name] DataStore name + * @property {google.cloud.ces.v1beta.DataStore.DataStoreType|null} [type] DataStore type + * @property {google.cloud.ces.v1beta.DataStore.DocumentProcessingMode|null} [documentProcessingMode] DataStore documentProcessingMode + * @property {string|null} [displayName] DataStore displayName + * @property {google.protobuf.ITimestamp|null} [createTime] DataStore createTime + * @property {google.cloud.ces.v1beta.DataStore.IConnectorConfig|null} [connectorConfig] DataStore connectorConfig + */ + + /** + * Constructs a new DataStore. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DataStore. + * @implements IDataStore + * @constructor + * @param {google.cloud.ces.v1beta.IDataStore=} [properties] Properties to set + */ + function DataStore(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStore name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DataStore + * @instance + */ + DataStore.prototype.name = ""; + + /** + * DataStore type. + * @member {google.cloud.ces.v1beta.DataStore.DataStoreType} type + * @memberof google.cloud.ces.v1beta.DataStore + * @instance + */ + DataStore.prototype.type = 0; + + /** + * DataStore documentProcessingMode. + * @member {google.cloud.ces.v1beta.DataStore.DocumentProcessingMode} documentProcessingMode + * @memberof google.cloud.ces.v1beta.DataStore + * @instance + */ + DataStore.prototype.documentProcessingMode = 0; + + /** + * DataStore displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.DataStore + * @instance + */ + DataStore.prototype.displayName = ""; + + /** + * DataStore createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.DataStore + * @instance + */ + DataStore.prototype.createTime = null; + + /** + * DataStore connectorConfig. + * @member {google.cloud.ces.v1beta.DataStore.IConnectorConfig|null|undefined} connectorConfig + * @memberof google.cloud.ces.v1beta.DataStore + * @instance + */ + DataStore.prototype.connectorConfig = null; + + /** + * Creates a new DataStore instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStore + * @static + * @param {google.cloud.ces.v1beta.IDataStore=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStore} DataStore instance + */ + DataStore.create = function create(properties) { + return new DataStore(properties); + }; + + /** + * Encodes the specified DataStore message. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStore + * @static + * @param {google.cloud.ces.v1beta.IDataStore} message DataStore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStore.encode = function encode(message, writer) { + if (!writer) + 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 0 =*/16).int32(message.type); + if (message.documentProcessingMode != null && Object.hasOwnProperty.call(message, "documentProcessingMode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.documentProcessingMode); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.connectorConfig != null && Object.hasOwnProperty.call(message, "connectorConfig")) + $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig.encode(message.connectorConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataStore message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStore + * @static + * @param {google.cloud.ces.v1beta.IDataStore} message DataStore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStore.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStore message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStore} DataStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStore.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStore(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 4: { + message.documentProcessingMode = reader.int32(); + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.connectorConfig = $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataStore message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStore} DataStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStore.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStore message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStore + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStore.verify = function verify(message) { + if (typeof message !== "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")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.documentProcessingMode != null && message.hasOwnProperty("documentProcessingMode")) + switch (message.documentProcessingMode) { + default: + return "documentProcessingMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: 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.connectorConfig != null && message.hasOwnProperty("connectorConfig")) { + var error = $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig.verify(message.connectorConfig); + if (error) + return "connectorConfig." + error; + } + return null; + }; + + /** + * Creates a DataStore message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStore + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStore} DataStore + */ + DataStore.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStore) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStore(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "DATA_STORE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PUBLIC_WEB": + case 1: + message.type = 1; + break; + case "UNSTRUCTURED": + case 2: + message.type = 2; + break; + case "FAQ": + case 3: + message.type = 3; + break; + case "CONNECTOR": + case 4: + message.type = 4; + break; + } + switch (object.documentProcessingMode) { + default: + if (typeof object.documentProcessingMode === "number") { + message.documentProcessingMode = object.documentProcessingMode; + break; + } + break; + case "DOCUMENT_PROCESSING_MODE_UNSPECIFIED": + case 0: + message.documentProcessingMode = 0; + break; + case "DOCUMENTS": + case 1: + message.documentProcessingMode = 1; + break; + case "CHUNKS": + case 2: + message.documentProcessingMode = 2; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStore.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.connectorConfig != null) { + if (typeof object.connectorConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStore.connectorConfig: object expected"); + message.connectorConfig = $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig.fromObject(object.connectorConfig); + } + return message; + }; + + /** + * Creates a plain object from a DataStore message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStore + * @static + * @param {google.cloud.ces.v1beta.DataStore} message DataStore + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStore.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "DATA_STORE_TYPE_UNSPECIFIED" : 0; + object.documentProcessingMode = options.enums === String ? "DOCUMENT_PROCESSING_MODE_UNSPECIFIED" : 0; + object.displayName = ""; + object.createTime = null; + object.connectorConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.ces.v1beta.DataStore.DataStoreType[message.type] === undefined ? message.type : $root.google.cloud.ces.v1beta.DataStore.DataStoreType[message.type] : message.type; + if (message.documentProcessingMode != null && message.hasOwnProperty("documentProcessingMode")) + object.documentProcessingMode = options.enums === String ? $root.google.cloud.ces.v1beta.DataStore.DocumentProcessingMode[message.documentProcessingMode] === undefined ? message.documentProcessingMode : $root.google.cloud.ces.v1beta.DataStore.DocumentProcessingMode[message.documentProcessingMode] : message.documentProcessingMode; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.connectorConfig != null && message.hasOwnProperty("connectorConfig")) + object.connectorConfig = $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig.toObject(message.connectorConfig, options); + return object; + }; + + /** + * Converts this DataStore to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStore + * @instance + * @returns {Object.} JSON object + */ + DataStore.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStore + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStore + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStore.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStore"; + }; + + DataStore.ConnectorConfig = (function() { + + /** + * Properties of a ConnectorConfig. + * @memberof google.cloud.ces.v1beta.DataStore + * @interface IConnectorConfig + * @property {string|null} [collection] ConnectorConfig collection + * @property {string|null} [collectionDisplayName] ConnectorConfig collectionDisplayName + * @property {string|null} [dataSource] ConnectorConfig dataSource + */ + + /** + * Constructs a new ConnectorConfig. + * @memberof google.cloud.ces.v1beta.DataStore + * @classdesc Represents a ConnectorConfig. + * @implements IConnectorConfig + * @constructor + * @param {google.cloud.ces.v1beta.DataStore.IConnectorConfig=} [properties] Properties to set + */ + function ConnectorConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectorConfig collection. + * @member {string} collection + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @instance + */ + ConnectorConfig.prototype.collection = ""; + + /** + * ConnectorConfig collectionDisplayName. + * @member {string} collectionDisplayName + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @instance + */ + ConnectorConfig.prototype.collectionDisplayName = ""; + + /** + * ConnectorConfig dataSource. + * @member {string} dataSource + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @instance + */ + ConnectorConfig.prototype.dataSource = ""; + + /** + * Creates a new ConnectorConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @static + * @param {google.cloud.ces.v1beta.DataStore.IConnectorConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStore.ConnectorConfig} ConnectorConfig instance + */ + ConnectorConfig.create = function create(properties) { + return new ConnectorConfig(properties); + }; + + /** + * Encodes the specified ConnectorConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.ConnectorConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @static + * @param {google.cloud.ces.v1beta.DataStore.IConnectorConfig} message ConnectorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.collection != null && Object.hasOwnProperty.call(message, "collection")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.collection); + if (message.collectionDisplayName != null && Object.hasOwnProperty.call(message, "collectionDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.collectionDisplayName); + if (message.dataSource != null && Object.hasOwnProperty.call(message, "dataSource")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dataSource); + return writer; + }; + + /** + * Encodes the specified ConnectorConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.ConnectorConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @static + * @param {google.cloud.ces.v1beta.DataStore.IConnectorConfig} message ConnectorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectorConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStore.ConnectorConfig} ConnectorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.collection = reader.string(); + break; + } + case 2: { + message.collectionDisplayName = reader.string(); + break; + } + case 3: { + message.dataSource = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectorConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStore.ConnectorConfig} ConnectorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectorConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectorConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.collection != null && message.hasOwnProperty("collection")) + if (!$util.isString(message.collection)) + return "collection: string expected"; + if (message.collectionDisplayName != null && message.hasOwnProperty("collectionDisplayName")) + if (!$util.isString(message.collectionDisplayName)) + return "collectionDisplayName: string expected"; + if (message.dataSource != null && message.hasOwnProperty("dataSource")) + if (!$util.isString(message.dataSource)) + return "dataSource: string expected"; + return null; + }; + + /** + * Creates a ConnectorConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStore.ConnectorConfig} ConnectorConfig + */ + ConnectorConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig(); + if (object.collection != null) + message.collection = String(object.collection); + if (object.collectionDisplayName != null) + message.collectionDisplayName = String(object.collectionDisplayName); + if (object.dataSource != null) + message.dataSource = String(object.dataSource); + return message; + }; + + /** + * Creates a plain object from a ConnectorConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @static + * @param {google.cloud.ces.v1beta.DataStore.ConnectorConfig} message ConnectorConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectorConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.collection = ""; + object.collectionDisplayName = ""; + object.dataSource = ""; + } + if (message.collection != null && message.hasOwnProperty("collection")) + object.collection = message.collection; + if (message.collectionDisplayName != null && message.hasOwnProperty("collectionDisplayName")) + object.collectionDisplayName = message.collectionDisplayName; + if (message.dataSource != null && message.hasOwnProperty("dataSource")) + object.dataSource = message.dataSource; + return object; + }; + + /** + * Converts this ConnectorConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @instance + * @returns {Object.} JSON object + */ + ConnectorConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectorConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectorConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStore.ConnectorConfig"; + }; + + return ConnectorConfig; + })(); + + /** + * DataStoreType enum. + * @name google.cloud.ces.v1beta.DataStore.DataStoreType + * @enum {number} + * @property {number} DATA_STORE_TYPE_UNSPECIFIED=0 DATA_STORE_TYPE_UNSPECIFIED value + * @property {number} PUBLIC_WEB=1 PUBLIC_WEB value + * @property {number} UNSTRUCTURED=2 UNSTRUCTURED value + * @property {number} FAQ=3 FAQ value + * @property {number} CONNECTOR=4 CONNECTOR value + */ + DataStore.DataStoreType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_STORE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PUBLIC_WEB"] = 1; + values[valuesById[2] = "UNSTRUCTURED"] = 2; + values[valuesById[3] = "FAQ"] = 3; + values[valuesById[4] = "CONNECTOR"] = 4; + return values; + })(); + + /** + * DocumentProcessingMode enum. + * @name google.cloud.ces.v1beta.DataStore.DocumentProcessingMode + * @enum {number} + * @property {number} DOCUMENT_PROCESSING_MODE_UNSPECIFIED=0 DOCUMENT_PROCESSING_MODE_UNSPECIFIED value + * @property {number} DOCUMENTS=1 DOCUMENTS value + * @property {number} CHUNKS=2 CHUNKS value + */ + DataStore.DocumentProcessingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENT_PROCESSING_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DOCUMENTS"] = 1; + values[valuesById[2] = "CHUNKS"] = 2; + return values; + })(); + + return DataStore; + })(); + + v1beta.FileSearchTool = (function() { + + /** + * Properties of a FileSearchTool. + * @memberof google.cloud.ces.v1beta + * @interface IFileSearchTool + * @property {google.cloud.ces.v1beta.FileSearchTool.CorpusType|null} [corpusType] FileSearchTool corpusType + * @property {string|null} [name] FileSearchTool name + * @property {string|null} [description] FileSearchTool description + * @property {string|null} [fileCorpus] FileSearchTool fileCorpus + */ + + /** + * Constructs a new FileSearchTool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a FileSearchTool. + * @implements IFileSearchTool + * @constructor + * @param {google.cloud.ces.v1beta.IFileSearchTool=} [properties] Properties to set + */ + function FileSearchTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileSearchTool corpusType. + * @member {google.cloud.ces.v1beta.FileSearchTool.CorpusType} corpusType + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @instance + */ + FileSearchTool.prototype.corpusType = 0; + + /** + * FileSearchTool name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @instance + */ + FileSearchTool.prototype.name = ""; + + /** + * FileSearchTool description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @instance + */ + FileSearchTool.prototype.description = ""; + + /** + * FileSearchTool fileCorpus. + * @member {string} fileCorpus + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @instance + */ + FileSearchTool.prototype.fileCorpus = ""; + + /** + * Creates a new FileSearchTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @static + * @param {google.cloud.ces.v1beta.IFileSearchTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.FileSearchTool} FileSearchTool instance + */ + FileSearchTool.create = function create(properties) { + return new FileSearchTool(properties); + }; + + /** + * Encodes the specified FileSearchTool message. Does not implicitly {@link google.cloud.ces.v1beta.FileSearchTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @static + * @param {google.cloud.ces.v1beta.IFileSearchTool} message FileSearchTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileSearchTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.corpusType != null && Object.hasOwnProperty.call(message, "corpusType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.corpusType); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.fileCorpus != null && Object.hasOwnProperty.call(message, "fileCorpus")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.fileCorpus); + return writer; + }; + + /** + * Encodes the specified FileSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.FileSearchTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @static + * @param {google.cloud.ces.v1beta.IFileSearchTool} message FileSearchTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileSearchTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileSearchTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.FileSearchTool} FileSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileSearchTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.FileSearchTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.corpusType = reader.int32(); + break; + } + case 4: { + message.name = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.fileCorpus = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileSearchTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.FileSearchTool} FileSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileSearchTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileSearchTool message. + * @function verify + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileSearchTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.corpusType != null && message.hasOwnProperty("corpusType")) + switch (message.corpusType) { + default: + return "corpusType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.fileCorpus != null && message.hasOwnProperty("fileCorpus")) + if (!$util.isString(message.fileCorpus)) + return "fileCorpus: string expected"; + return null; + }; + + /** + * Creates a FileSearchTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.FileSearchTool} FileSearchTool + */ + FileSearchTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.FileSearchTool) + return object; + var message = new $root.google.cloud.ces.v1beta.FileSearchTool(); + switch (object.corpusType) { + default: + if (typeof object.corpusType === "number") { + message.corpusType = object.corpusType; + break; + } + break; + case "CORPUS_TYPE_UNSPECIFIED": + case 0: + message.corpusType = 0; + break; + case "USER_OWNED": + case 1: + message.corpusType = 1; + break; + case "FULLY_MANAGED": + case 2: + message.corpusType = 2; + break; + } + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.fileCorpus != null) + message.fileCorpus = String(object.fileCorpus); + return message; + }; + + /** + * Creates a plain object from a FileSearchTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @static + * @param {google.cloud.ces.v1beta.FileSearchTool} message FileSearchTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileSearchTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.corpusType = options.enums === String ? "CORPUS_TYPE_UNSPECIFIED" : 0; + object.name = ""; + object.description = ""; + object.fileCorpus = ""; + } + if (message.corpusType != null && message.hasOwnProperty("corpusType")) + object.corpusType = options.enums === String ? $root.google.cloud.ces.v1beta.FileSearchTool.CorpusType[message.corpusType] === undefined ? message.corpusType : $root.google.cloud.ces.v1beta.FileSearchTool.CorpusType[message.corpusType] : message.corpusType; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.fileCorpus != null && message.hasOwnProperty("fileCorpus")) + object.fileCorpus = message.fileCorpus; + return object; + }; + + /** + * Converts this FileSearchTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @instance + * @returns {Object.} JSON object + */ + FileSearchTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileSearchTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileSearchTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.FileSearchTool"; + }; + + /** + * CorpusType enum. + * @name google.cloud.ces.v1beta.FileSearchTool.CorpusType + * @enum {number} + * @property {number} CORPUS_TYPE_UNSPECIFIED=0 CORPUS_TYPE_UNSPECIFIED value + * @property {number} USER_OWNED=1 USER_OWNED value + * @property {number} FULLY_MANAGED=2 FULLY_MANAGED value + */ + FileSearchTool.CorpusType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CORPUS_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER_OWNED"] = 1; + values[valuesById[2] = "FULLY_MANAGED"] = 2; + return values; + })(); + + return FileSearchTool; + })(); + + v1beta.GoogleSearchTool = (function() { + + /** + * Properties of a GoogleSearchTool. + * @memberof google.cloud.ces.v1beta + * @interface IGoogleSearchTool + * @property {string|null} [name] GoogleSearchTool name + * @property {string|null} [description] GoogleSearchTool description + * @property {Array.|null} [contextUrls] GoogleSearchTool contextUrls + * @property {Array.|null} [preferredDomains] GoogleSearchTool preferredDomains + * @property {Array.|null} [excludeDomains] GoogleSearchTool excludeDomains + * @property {google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig|null} [promptConfig] GoogleSearchTool promptConfig + */ + + /** + * Constructs a new GoogleSearchTool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GoogleSearchTool. + * @implements IGoogleSearchTool + * @constructor + * @param {google.cloud.ces.v1beta.IGoogleSearchTool=} [properties] Properties to set + */ + function GoogleSearchTool(properties) { + this.contextUrls = []; + this.preferredDomains = []; + this.excludeDomains = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoogleSearchTool name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @instance + */ + GoogleSearchTool.prototype.name = ""; + + /** + * GoogleSearchTool description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @instance + */ + GoogleSearchTool.prototype.description = ""; + + /** + * GoogleSearchTool contextUrls. + * @member {Array.} contextUrls + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @instance + */ + GoogleSearchTool.prototype.contextUrls = $util.emptyArray; + + /** + * GoogleSearchTool preferredDomains. + * @member {Array.} preferredDomains + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @instance + */ + GoogleSearchTool.prototype.preferredDomains = $util.emptyArray; + + /** + * GoogleSearchTool excludeDomains. + * @member {Array.} excludeDomains + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @instance + */ + GoogleSearchTool.prototype.excludeDomains = $util.emptyArray; + + /** + * GoogleSearchTool promptConfig. + * @member {google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig|null|undefined} promptConfig + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @instance + */ + GoogleSearchTool.prototype.promptConfig = null; + + /** + * Creates a new GoogleSearchTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @static + * @param {google.cloud.ces.v1beta.IGoogleSearchTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GoogleSearchTool} GoogleSearchTool instance + */ + GoogleSearchTool.create = function create(properties) { + return new GoogleSearchTool(properties); + }; + + /** + * Encodes the specified GoogleSearchTool message. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @static + * @param {google.cloud.ces.v1beta.IGoogleSearchTool} message GoogleSearchTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearchTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.contextUrls != null && message.contextUrls.length) + for (var i = 0; i < message.contextUrls.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.contextUrls[i]); + if (message.excludeDomains != null && message.excludeDomains.length) + for (var i = 0; i < message.excludeDomains.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.excludeDomains[i]); + if (message.promptConfig != null && Object.hasOwnProperty.call(message, "promptConfig")) + $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.encode(message.promptConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.preferredDomains != null && message.preferredDomains.length) + for (var i = 0; i < message.preferredDomains.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.preferredDomains[i]); + return writer; + }; + + /** + * Encodes the specified GoogleSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @static + * @param {google.cloud.ces.v1beta.IGoogleSearchTool} message GoogleSearchTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearchTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoogleSearchTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GoogleSearchTool} GoogleSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearchTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GoogleSearchTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + if (!(message.contextUrls && message.contextUrls.length)) + message.contextUrls = []; + message.contextUrls.push(reader.string()); + break; + } + case 6: { + if (!(message.preferredDomains && message.preferredDomains.length)) + message.preferredDomains = []; + message.preferredDomains.push(reader.string()); + break; + } + case 4: { + if (!(message.excludeDomains && message.excludeDomains.length)) + message.excludeDomains = []; + message.excludeDomains.push(reader.string()); + break; + } + case 5: { + message.promptConfig = $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoogleSearchTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GoogleSearchTool} GoogleSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearchTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoogleSearchTool message. + * @function verify + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoogleSearchTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.contextUrls != null && message.hasOwnProperty("contextUrls")) { + if (!Array.isArray(message.contextUrls)) + return "contextUrls: array expected"; + for (var i = 0; i < message.contextUrls.length; ++i) + if (!$util.isString(message.contextUrls[i])) + return "contextUrls: string[] expected"; + } + if (message.preferredDomains != null && message.hasOwnProperty("preferredDomains")) { + if (!Array.isArray(message.preferredDomains)) + return "preferredDomains: array expected"; + for (var i = 0; i < message.preferredDomains.length; ++i) + if (!$util.isString(message.preferredDomains[i])) + return "preferredDomains: string[] expected"; + } + if (message.excludeDomains != null && message.hasOwnProperty("excludeDomains")) { + if (!Array.isArray(message.excludeDomains)) + return "excludeDomains: array expected"; + for (var i = 0; i < message.excludeDomains.length; ++i) + if (!$util.isString(message.excludeDomains[i])) + return "excludeDomains: string[] expected"; + } + if (message.promptConfig != null && message.hasOwnProperty("promptConfig")) { + var error = $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.verify(message.promptConfig); + if (error) + return "promptConfig." + error; + } + return null; + }; + + /** + * Creates a GoogleSearchTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GoogleSearchTool} GoogleSearchTool + */ + GoogleSearchTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GoogleSearchTool) + return object; + var message = new $root.google.cloud.ces.v1beta.GoogleSearchTool(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.contextUrls) { + if (!Array.isArray(object.contextUrls)) + throw TypeError(".google.cloud.ces.v1beta.GoogleSearchTool.contextUrls: array expected"); + message.contextUrls = []; + for (var i = 0; i < object.contextUrls.length; ++i) + message.contextUrls[i] = String(object.contextUrls[i]); + } + if (object.preferredDomains) { + if (!Array.isArray(object.preferredDomains)) + throw TypeError(".google.cloud.ces.v1beta.GoogleSearchTool.preferredDomains: array expected"); + message.preferredDomains = []; + for (var i = 0; i < object.preferredDomains.length; ++i) + message.preferredDomains[i] = String(object.preferredDomains[i]); + } + if (object.excludeDomains) { + if (!Array.isArray(object.excludeDomains)) + throw TypeError(".google.cloud.ces.v1beta.GoogleSearchTool.excludeDomains: array expected"); + message.excludeDomains = []; + for (var i = 0; i < object.excludeDomains.length; ++i) + message.excludeDomains[i] = String(object.excludeDomains[i]); + } + if (object.promptConfig != null) { + if (typeof object.promptConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.GoogleSearchTool.promptConfig: object expected"); + message.promptConfig = $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.fromObject(object.promptConfig); + } + return message; + }; + + /** + * Creates a plain object from a GoogleSearchTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @static + * @param {google.cloud.ces.v1beta.GoogleSearchTool} message GoogleSearchTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoogleSearchTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.contextUrls = []; + object.excludeDomains = []; + object.preferredDomains = []; + } + if (options.defaults) { + object.name = ""; + object.description = ""; + object.promptConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.contextUrls && message.contextUrls.length) { + object.contextUrls = []; + for (var j = 0; j < message.contextUrls.length; ++j) + object.contextUrls[j] = message.contextUrls[j]; + } + if (message.excludeDomains && message.excludeDomains.length) { + object.excludeDomains = []; + for (var j = 0; j < message.excludeDomains.length; ++j) + object.excludeDomains[j] = message.excludeDomains[j]; + } + if (message.promptConfig != null && message.hasOwnProperty("promptConfig")) + object.promptConfig = $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.toObject(message.promptConfig, options); + if (message.preferredDomains && message.preferredDomains.length) { + object.preferredDomains = []; + for (var j = 0; j < message.preferredDomains.length; ++j) + object.preferredDomains[j] = message.preferredDomains[j]; + } + return object; + }; + + /** + * Converts this GoogleSearchTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @instance + * @returns {Object.} JSON object + */ + GoogleSearchTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoogleSearchTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoogleSearchTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GoogleSearchTool"; + }; + + GoogleSearchTool.PromptConfig = (function() { + + /** + * Properties of a PromptConfig. + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @interface IPromptConfig + * @property {string|null} [textPrompt] PromptConfig textPrompt + * @property {string|null} [voicePrompt] PromptConfig voicePrompt + */ + + /** + * Constructs a new PromptConfig. + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @classdesc Represents a PromptConfig. + * @implements IPromptConfig + * @constructor + * @param {google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig=} [properties] Properties to set + */ + function PromptConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PromptConfig textPrompt. + * @member {string} textPrompt + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @instance + */ + PromptConfig.prototype.textPrompt = ""; + + /** + * PromptConfig voicePrompt. + * @member {string} voicePrompt + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @instance + */ + PromptConfig.prototype.voicePrompt = ""; + + /** + * Creates a new PromptConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @static + * @param {google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig} PromptConfig instance + */ + PromptConfig.create = function create(properties) { + return new PromptConfig(properties); + }; + + /** + * Encodes the specified PromptConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @static + * @param {google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig} message PromptConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromptConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textPrompt != null && Object.hasOwnProperty.call(message, "textPrompt")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.textPrompt); + if (message.voicePrompt != null && Object.hasOwnProperty.call(message, "voicePrompt")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.voicePrompt); + return writer; + }; + + /** + * Encodes the specified PromptConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @static + * @param {google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig} message PromptConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromptConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PromptConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig} PromptConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromptConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.textPrompt = reader.string(); + break; + } + case 2: { + message.voicePrompt = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PromptConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig} PromptConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromptConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PromptConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PromptConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.textPrompt != null && message.hasOwnProperty("textPrompt")) + if (!$util.isString(message.textPrompt)) + return "textPrompt: string expected"; + if (message.voicePrompt != null && message.hasOwnProperty("voicePrompt")) + if (!$util.isString(message.voicePrompt)) + return "voicePrompt: string expected"; + return null; + }; + + /** + * Creates a PromptConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig} PromptConfig + */ + PromptConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig(); + if (object.textPrompt != null) + message.textPrompt = String(object.textPrompt); + if (object.voicePrompt != null) + message.voicePrompt = String(object.voicePrompt); + return message; + }; + + /** + * Creates a plain object from a PromptConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @static + * @param {google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig} message PromptConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PromptConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.textPrompt = ""; + object.voicePrompt = ""; + } + if (message.textPrompt != null && message.hasOwnProperty("textPrompt")) + object.textPrompt = message.textPrompt; + if (message.voicePrompt != null && message.hasOwnProperty("voicePrompt")) + object.voicePrompt = message.voicePrompt; + return object; + }; + + /** + * Converts this PromptConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @instance + * @returns {Object.} JSON object + */ + PromptConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PromptConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PromptConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig"; + }; + + return PromptConfig; + })(); + + return GoogleSearchTool; + })(); + + v1beta.McpTool = (function() { + + /** + * Properties of a McpTool. + * @memberof google.cloud.ces.v1beta + * @interface IMcpTool + * @property {string|null} [name] McpTool name + * @property {string|null} [description] McpTool description + * @property {google.cloud.ces.v1beta.ISchema|null} [inputSchema] McpTool inputSchema + * @property {google.cloud.ces.v1beta.ISchema|null} [outputSchema] McpTool outputSchema + * @property {string|null} [serverAddress] McpTool serverAddress + * @property {google.cloud.ces.v1beta.IApiAuthentication|null} [apiAuthentication] McpTool apiAuthentication + * @property {google.cloud.ces.v1beta.ITlsConfig|null} [tlsConfig] McpTool tlsConfig + * @property {google.cloud.ces.v1beta.IServiceDirectoryConfig|null} [serviceDirectoryConfig] McpTool serviceDirectoryConfig + */ + + /** + * Constructs a new McpTool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a McpTool. + * @implements IMcpTool + * @constructor + * @param {google.cloud.ces.v1beta.IMcpTool=} [properties] Properties to set + */ + function McpTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * McpTool name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.McpTool + * @instance + */ + McpTool.prototype.name = ""; + + /** + * McpTool description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.McpTool + * @instance + */ + McpTool.prototype.description = ""; + + /** + * McpTool inputSchema. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} inputSchema + * @memberof google.cloud.ces.v1beta.McpTool + * @instance + */ + McpTool.prototype.inputSchema = null; + + /** + * McpTool outputSchema. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} outputSchema + * @memberof google.cloud.ces.v1beta.McpTool + * @instance + */ + McpTool.prototype.outputSchema = null; + + /** + * McpTool serverAddress. + * @member {string} serverAddress + * @memberof google.cloud.ces.v1beta.McpTool + * @instance + */ + McpTool.prototype.serverAddress = ""; + + /** + * McpTool apiAuthentication. + * @member {google.cloud.ces.v1beta.IApiAuthentication|null|undefined} apiAuthentication + * @memberof google.cloud.ces.v1beta.McpTool + * @instance + */ + McpTool.prototype.apiAuthentication = null; + + /** + * McpTool tlsConfig. + * @member {google.cloud.ces.v1beta.ITlsConfig|null|undefined} tlsConfig + * @memberof google.cloud.ces.v1beta.McpTool + * @instance + */ + McpTool.prototype.tlsConfig = null; + + /** + * McpTool serviceDirectoryConfig. + * @member {google.cloud.ces.v1beta.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig + * @memberof google.cloud.ces.v1beta.McpTool + * @instance + */ + McpTool.prototype.serviceDirectoryConfig = null; + + /** + * Creates a new McpTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.McpTool + * @static + * @param {google.cloud.ces.v1beta.IMcpTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.McpTool} McpTool instance + */ + McpTool.create = function create(properties) { + return new McpTool(properties); + }; + + /** + * Encodes the specified McpTool message. Does not implicitly {@link google.cloud.ces.v1beta.McpTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.McpTool + * @static + * @param {google.cloud.ces.v1beta.IMcpTool} message McpTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + McpTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.inputSchema != null && Object.hasOwnProperty.call(message, "inputSchema")) + $root.google.cloud.ces.v1beta.Schema.encode(message.inputSchema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputSchema != null && Object.hasOwnProperty.call(message, "outputSchema")) + $root.google.cloud.ces.v1beta.Schema.encode(message.outputSchema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.serverAddress != null && Object.hasOwnProperty.call(message, "serverAddress")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.serverAddress); + if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) + $root.google.cloud.ces.v1beta.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) + $root.google.cloud.ces.v1beta.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) + $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified McpTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.McpTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.McpTool + * @static + * @param {google.cloud.ces.v1beta.IMcpTool} message McpTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + McpTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a McpTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.McpTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.McpTool} McpTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + McpTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.McpTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.inputSchema = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputSchema = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + case 5: { + message.serverAddress = reader.string(); + break; + } + case 6: { + message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.decode(reader, reader.uint32()); + break; + } + case 7: { + message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a McpTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.McpTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.McpTool} McpTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + McpTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a McpTool message. + * @function verify + * @memberof google.cloud.ces.v1beta.McpTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + McpTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.inputSchema); + if (error) + return "inputSchema." + error; + } + if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.outputSchema); + if (error) + return "outputSchema." + error; + } + if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) + if (!$util.isString(message.serverAddress)) + return "serverAddress: string expected"; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { + var error = $root.google.cloud.ces.v1beta.ApiAuthentication.verify(message.apiAuthentication); + if (error) + return "apiAuthentication." + error; + } + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { + var error = $root.google.cloud.ces.v1beta.TlsConfig.verify(message.tlsConfig); + if (error) + return "tlsConfig." + error; + } + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { + var error = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); + if (error) + return "serviceDirectoryConfig." + error; + } + return null; + }; + + /** + * Creates a McpTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.McpTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.McpTool} McpTool + */ + McpTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.McpTool) + return object; + var message = new $root.google.cloud.ces.v1beta.McpTool(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.inputSchema != null) { + if (typeof object.inputSchema !== "object") + throw TypeError(".google.cloud.ces.v1beta.McpTool.inputSchema: object expected"); + message.inputSchema = $root.google.cloud.ces.v1beta.Schema.fromObject(object.inputSchema); + } + if (object.outputSchema != null) { + if (typeof object.outputSchema !== "object") + throw TypeError(".google.cloud.ces.v1beta.McpTool.outputSchema: object expected"); + message.outputSchema = $root.google.cloud.ces.v1beta.Schema.fromObject(object.outputSchema); + } + if (object.serverAddress != null) + message.serverAddress = String(object.serverAddress); + if (object.apiAuthentication != null) { + if (typeof object.apiAuthentication !== "object") + throw TypeError(".google.cloud.ces.v1beta.McpTool.apiAuthentication: object expected"); + message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.fromObject(object.apiAuthentication); + } + if (object.tlsConfig != null) { + if (typeof object.tlsConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.McpTool.tlsConfig: object expected"); + message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.fromObject(object.tlsConfig); + } + if (object.serviceDirectoryConfig != null) { + if (typeof object.serviceDirectoryConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.McpTool.serviceDirectoryConfig: object expected"); + message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); + } + return message; + }; + + /** + * Creates a plain object from a McpTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.McpTool + * @static + * @param {google.cloud.ces.v1beta.McpTool} message McpTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + McpTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.inputSchema = null; + object.outputSchema = null; + object.serverAddress = ""; + object.apiAuthentication = null; + object.tlsConfig = null; + object.serviceDirectoryConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) + object.inputSchema = $root.google.cloud.ces.v1beta.Schema.toObject(message.inputSchema, options); + if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) + object.outputSchema = $root.google.cloud.ces.v1beta.Schema.toObject(message.outputSchema, options); + if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) + object.serverAddress = message.serverAddress; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) + object.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.toObject(message.apiAuthentication, options); + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) + object.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.toObject(message.tlsConfig, options); + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) + object.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); + return object; + }; + + /** + * Converts this McpTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.McpTool + * @instance + * @returns {Object.} JSON object + */ + McpTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for McpTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.McpTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + McpTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.McpTool"; + }; + + return McpTool; + })(); + + v1beta.OpenApiTool = (function() { + + /** + * Properties of an OpenApiTool. + * @memberof google.cloud.ces.v1beta + * @interface IOpenApiTool + * @property {string|null} [openApiSchema] OpenApiTool openApiSchema + * @property {string|null} [name] OpenApiTool name + * @property {string|null} [description] OpenApiTool description + * @property {google.cloud.ces.v1beta.IApiAuthentication|null} [apiAuthentication] OpenApiTool apiAuthentication + * @property {google.cloud.ces.v1beta.ITlsConfig|null} [tlsConfig] OpenApiTool tlsConfig + * @property {google.cloud.ces.v1beta.IServiceDirectoryConfig|null} [serviceDirectoryConfig] OpenApiTool serviceDirectoryConfig + * @property {boolean|null} [ignoreUnknownFields] OpenApiTool ignoreUnknownFields + * @property {string|null} [url] OpenApiTool url + */ + + /** + * Constructs a new OpenApiTool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an OpenApiTool. + * @implements IOpenApiTool + * @constructor + * @param {google.cloud.ces.v1beta.IOpenApiTool=} [properties] Properties to set + */ + function OpenApiTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpenApiTool openApiSchema. + * @member {string} openApiSchema + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @instance + */ + OpenApiTool.prototype.openApiSchema = ""; + + /** + * OpenApiTool name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @instance + */ + OpenApiTool.prototype.name = ""; + + /** + * OpenApiTool description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @instance + */ + OpenApiTool.prototype.description = ""; + + /** + * OpenApiTool apiAuthentication. + * @member {google.cloud.ces.v1beta.IApiAuthentication|null|undefined} apiAuthentication + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @instance + */ + OpenApiTool.prototype.apiAuthentication = null; + + /** + * OpenApiTool tlsConfig. + * @member {google.cloud.ces.v1beta.ITlsConfig|null|undefined} tlsConfig + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @instance + */ + OpenApiTool.prototype.tlsConfig = null; + + /** + * OpenApiTool serviceDirectoryConfig. + * @member {google.cloud.ces.v1beta.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @instance + */ + OpenApiTool.prototype.serviceDirectoryConfig = null; + + /** + * OpenApiTool ignoreUnknownFields. + * @member {boolean} ignoreUnknownFields + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @instance + */ + OpenApiTool.prototype.ignoreUnknownFields = false; + + /** + * OpenApiTool url. + * @member {string} url + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @instance + */ + OpenApiTool.prototype.url = ""; + + /** + * Creates a new OpenApiTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @static + * @param {google.cloud.ces.v1beta.IOpenApiTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OpenApiTool} OpenApiTool instance + */ + OpenApiTool.create = function create(properties) { + return new OpenApiTool(properties); + }; + + /** + * Encodes the specified OpenApiTool message. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @static + * @param {google.cloud.ces.v1beta.IOpenApiTool} message OpenApiTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.openApiSchema != null && Object.hasOwnProperty.call(message, "openApiSchema")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.openApiSchema); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) + $root.google.cloud.ces.v1beta.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) + $root.google.cloud.ces.v1beta.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) + $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.ignoreUnknownFields != null && Object.hasOwnProperty.call(message, "ignoreUnknownFields")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.ignoreUnknownFields); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.url); + return writer; + }; + + /** + * Encodes the specified OpenApiTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @static + * @param {google.cloud.ces.v1beta.IOpenApiTool} message OpenApiTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OpenApiTool} OpenApiTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OpenApiTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.openApiSchema = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.decode(reader, reader.uint32()); + break; + } + case 5: { + message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.ignoreUnknownFields = reader.bool(); + break; + } + case 8: { + message.url = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OpenApiTool} OpenApiTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpenApiTool message. + * @function verify + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenApiTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) + if (!$util.isString(message.openApiSchema)) + return "openApiSchema: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { + var error = $root.google.cloud.ces.v1beta.ApiAuthentication.verify(message.apiAuthentication); + if (error) + return "apiAuthentication." + error; + } + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { + var error = $root.google.cloud.ces.v1beta.TlsConfig.verify(message.tlsConfig); + if (error) + return "tlsConfig." + error; + } + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { + var error = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); + if (error) + return "serviceDirectoryConfig." + error; + } + if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) + if (typeof message.ignoreUnknownFields !== "boolean") + return "ignoreUnknownFields: boolean expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + return null; + }; + + /** + * Creates an OpenApiTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OpenApiTool} OpenApiTool + */ + OpenApiTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OpenApiTool) + return object; + var message = new $root.google.cloud.ces.v1beta.OpenApiTool(); + if (object.openApiSchema != null) + message.openApiSchema = String(object.openApiSchema); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.apiAuthentication != null) { + if (typeof object.apiAuthentication !== "object") + throw TypeError(".google.cloud.ces.v1beta.OpenApiTool.apiAuthentication: object expected"); + message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.fromObject(object.apiAuthentication); + } + if (object.tlsConfig != null) { + if (typeof object.tlsConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.OpenApiTool.tlsConfig: object expected"); + message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.fromObject(object.tlsConfig); + } + if (object.serviceDirectoryConfig != null) { + if (typeof object.serviceDirectoryConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.OpenApiTool.serviceDirectoryConfig: object expected"); + message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); + } + if (object.ignoreUnknownFields != null) + message.ignoreUnknownFields = Boolean(object.ignoreUnknownFields); + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from an OpenApiTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @static + * @param {google.cloud.ces.v1beta.OpenApiTool} message OpenApiTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenApiTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.openApiSchema = ""; + object.name = ""; + object.description = ""; + object.apiAuthentication = null; + object.tlsConfig = null; + object.serviceDirectoryConfig = null; + object.ignoreUnknownFields = false; + object.url = ""; + } + if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) + object.openApiSchema = message.openApiSchema; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) + object.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.toObject(message.apiAuthentication, options); + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) + object.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.toObject(message.tlsConfig, options); + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) + object.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); + if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) + object.ignoreUnknownFields = message.ignoreUnknownFields; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + return object; + }; + + /** + * Converts this OpenApiTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @instance + * @returns {Object.} JSON object + */ + OpenApiTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OpenApiTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpenApiTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OpenApiTool"; + }; + + return OpenApiTool; + })(); + + v1beta.PythonFunction = (function() { + + /** + * Properties of a PythonFunction. + * @memberof google.cloud.ces.v1beta + * @interface IPythonFunction + * @property {string|null} [name] PythonFunction name + * @property {string|null} [pythonCode] PythonFunction pythonCode + * @property {string|null} [description] PythonFunction description + */ + + /** + * Constructs a new PythonFunction. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a PythonFunction. + * @implements IPythonFunction + * @constructor + * @param {google.cloud.ces.v1beta.IPythonFunction=} [properties] Properties to set + */ + function PythonFunction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonFunction name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.PythonFunction + * @instance + */ + PythonFunction.prototype.name = ""; + + /** + * PythonFunction pythonCode. + * @member {string} pythonCode + * @memberof google.cloud.ces.v1beta.PythonFunction + * @instance + */ + PythonFunction.prototype.pythonCode = ""; + + /** + * PythonFunction description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.PythonFunction + * @instance + */ + PythonFunction.prototype.description = ""; + + /** + * Creates a new PythonFunction instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.PythonFunction + * @static + * @param {google.cloud.ces.v1beta.IPythonFunction=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.PythonFunction} PythonFunction instance + */ + PythonFunction.create = function create(properties) { + return new PythonFunction(properties); + }; + + /** + * Encodes the specified PythonFunction message. Does not implicitly {@link google.cloud.ces.v1beta.PythonFunction.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.PythonFunction + * @static + * @param {google.cloud.ces.v1beta.IPythonFunction} message PythonFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonFunction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pythonCode); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + return writer; + }; + + /** + * Encodes the specified PythonFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.PythonFunction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.PythonFunction + * @static + * @param {google.cloud.ces.v1beta.IPythonFunction} message PythonFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonFunction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonFunction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.PythonFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.PythonFunction} PythonFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonFunction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.PythonFunction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.pythonCode = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonFunction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.PythonFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.PythonFunction} PythonFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonFunction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonFunction message. + * @function verify + * @memberof google.cloud.ces.v1beta.PythonFunction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonFunction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) + if (!$util.isString(message.pythonCode)) + return "pythonCode: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a PythonFunction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.PythonFunction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.PythonFunction} PythonFunction + */ + PythonFunction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.PythonFunction) + return object; + var message = new $root.google.cloud.ces.v1beta.PythonFunction(); + if (object.name != null) + message.name = String(object.name); + if (object.pythonCode != null) + message.pythonCode = String(object.pythonCode); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a PythonFunction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.PythonFunction + * @static + * @param {google.cloud.ces.v1beta.PythonFunction} message PythonFunction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonFunction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pythonCode = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) + object.pythonCode = message.pythonCode; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this PythonFunction to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.PythonFunction + * @instance + * @returns {Object.} JSON object + */ + PythonFunction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonFunction + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.PythonFunction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonFunction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.PythonFunction"; + }; + + return PythonFunction; + })(); + + v1beta.SystemTool = (function() { + + /** + * Properties of a SystemTool. + * @memberof google.cloud.ces.v1beta + * @interface ISystemTool + * @property {string|null} [name] SystemTool name + * @property {string|null} [description] SystemTool description + */ + + /** + * Constructs a new SystemTool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a SystemTool. + * @implements ISystemTool + * @constructor + * @param {google.cloud.ces.v1beta.ISystemTool=} [properties] Properties to set + */ + function SystemTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SystemTool name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.SystemTool + * @instance + */ + SystemTool.prototype.name = ""; + + /** + * SystemTool description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.SystemTool + * @instance + */ + SystemTool.prototype.description = ""; + + /** + * Creates a new SystemTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.SystemTool + * @static + * @param {google.cloud.ces.v1beta.ISystemTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.SystemTool} SystemTool instance + */ + SystemTool.create = function create(properties) { + return new SystemTool(properties); + }; + + /** + * Encodes the specified SystemTool message. Does not implicitly {@link google.cloud.ces.v1beta.SystemTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.SystemTool + * @static + * @param {google.cloud.ces.v1beta.ISystemTool} message SystemTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; + + /** + * Encodes the specified SystemTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SystemTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.SystemTool + * @static + * @param {google.cloud.ces.v1beta.ISystemTool} message SystemTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SystemTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.SystemTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.SystemTool} SystemTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SystemTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SystemTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.SystemTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.SystemTool} SystemTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SystemTool message. + * @function verify + * @memberof google.cloud.ces.v1beta.SystemTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SystemTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a SystemTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.SystemTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.SystemTool} SystemTool + */ + SystemTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.SystemTool) + return object; + var message = new $root.google.cloud.ces.v1beta.SystemTool(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a SystemTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.SystemTool + * @static + * @param {google.cloud.ces.v1beta.SystemTool} message SystemTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SystemTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this SystemTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.SystemTool + * @instance + * @returns {Object.} JSON object + */ + SystemTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SystemTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.SystemTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SystemTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.SystemTool"; + }; + + return SystemTool; + })(); + + v1beta.WidgetTool = (function() { + + /** + * Properties of a WidgetTool. + * @memberof google.cloud.ces.v1beta + * @interface IWidgetTool + * @property {google.cloud.ces.v1beta.ISchema|null} [parameters] WidgetTool parameters + * @property {string|null} [name] WidgetTool name + * @property {string|null} [description] WidgetTool description + * @property {google.cloud.ces.v1beta.WidgetTool.WidgetType|null} [widgetType] WidgetTool widgetType + */ + + /** + * Constructs a new WidgetTool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a WidgetTool. + * @implements IWidgetTool + * @constructor + * @param {google.cloud.ces.v1beta.IWidgetTool=} [properties] Properties to set + */ + function WidgetTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WidgetTool parameters. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} parameters + * @memberof google.cloud.ces.v1beta.WidgetTool + * @instance + */ + WidgetTool.prototype.parameters = null; + + /** + * WidgetTool name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.WidgetTool + * @instance + */ + WidgetTool.prototype.name = ""; + + /** + * WidgetTool description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.WidgetTool + * @instance + */ + WidgetTool.prototype.description = ""; + + /** + * WidgetTool widgetType. + * @member {google.cloud.ces.v1beta.WidgetTool.WidgetType} widgetType + * @memberof google.cloud.ces.v1beta.WidgetTool + * @instance + */ + WidgetTool.prototype.widgetType = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WidgetTool input. + * @member {"parameters"|undefined} input + * @memberof google.cloud.ces.v1beta.WidgetTool + * @instance + */ + Object.defineProperty(WidgetTool.prototype, "input", { + get: $util.oneOfGetter($oneOfFields = ["parameters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WidgetTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.WidgetTool + * @static + * @param {google.cloud.ces.v1beta.IWidgetTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.WidgetTool} WidgetTool instance + */ + WidgetTool.create = function create(properties) { + return new WidgetTool(properties); + }; + + /** + * Encodes the specified WidgetTool message. Does not implicitly {@link google.cloud.ces.v1beta.WidgetTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.WidgetTool + * @static + * @param {google.cloud.ces.v1beta.IWidgetTool} message WidgetTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WidgetTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.widgetType != null && Object.hasOwnProperty.call(message, "widgetType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.widgetType); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.ces.v1beta.Schema.encode(message.parameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WidgetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.WidgetTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.WidgetTool + * @static + * @param {google.cloud.ces.v1beta.IWidgetTool} message WidgetTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WidgetTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WidgetTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.WidgetTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.WidgetTool} WidgetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WidgetTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.WidgetTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.parameters = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.widgetType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WidgetTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.WidgetTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.WidgetTool} WidgetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WidgetTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WidgetTool message. + * @function verify + * @memberof google.cloud.ces.v1beta.WidgetTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WidgetTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + properties.input = 1; + { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.parameters); + if (error) + return "parameters." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.widgetType != null && message.hasOwnProperty("widgetType")) + switch (message.widgetType) { + default: + return "widgetType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + break; + } + return null; + }; + + /** + * Creates a WidgetTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.WidgetTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.WidgetTool} WidgetTool + */ + WidgetTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.WidgetTool) + return object; + var message = new $root.google.cloud.ces.v1beta.WidgetTool(); + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.ces.v1beta.WidgetTool.parameters: object expected"); + message.parameters = $root.google.cloud.ces.v1beta.Schema.fromObject(object.parameters); + } + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + switch (object.widgetType) { + default: + if (typeof object.widgetType === "number") { + message.widgetType = object.widgetType; + break; + } + break; + case "WIDGET_TYPE_UNSPECIFIED": + case 0: + message.widgetType = 0; + break; + case "CUSTOM": + case 1: + message.widgetType = 1; + break; + case "PRODUCT_CAROUSEL": + case 2: + message.widgetType = 2; + break; + case "PRODUCT_DETAILS": + case 3: + message.widgetType = 3; + break; + case "QUICK_ACTIONS": + case 4: + message.widgetType = 4; + break; + case "PRODUCT_COMPARISON": + case 5: + message.widgetType = 5; + break; + case "ADVANCED_PRODUCT_DETAILS": + case 6: + message.widgetType = 6; + break; + case "SHORT_FORM": + case 7: + message.widgetType = 7; + break; + case "OVERALL_SATISFACTION": + case 8: + message.widgetType = 8; + break; + case "ORDER_SUMMARY": + case 9: + message.widgetType = 9; + break; + case "APPOINTMENT_DETAILS": + case 10: + message.widgetType = 10; + break; + case "APPOINTMENT_SCHEDULER": + case 11: + message.widgetType = 11; + break; + case "CONTACT_FORM": + case 12: + message.widgetType = 12; + break; + } + return message; + }; + + /** + * Creates a plain object from a WidgetTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.WidgetTool + * @static + * @param {google.cloud.ces.v1beta.WidgetTool} message WidgetTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WidgetTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.widgetType = options.enums === String ? "WIDGET_TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.widgetType != null && message.hasOwnProperty("widgetType")) + object.widgetType = options.enums === String ? $root.google.cloud.ces.v1beta.WidgetTool.WidgetType[message.widgetType] === undefined ? message.widgetType : $root.google.cloud.ces.v1beta.WidgetTool.WidgetType[message.widgetType] : message.widgetType; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + object.parameters = $root.google.cloud.ces.v1beta.Schema.toObject(message.parameters, options); + if (options.oneofs) + object.input = "parameters"; + } + return object; + }; + + /** + * Converts this WidgetTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.WidgetTool + * @instance + * @returns {Object.} JSON object + */ + WidgetTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WidgetTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.WidgetTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WidgetTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.WidgetTool"; + }; + + /** + * WidgetType enum. + * @name google.cloud.ces.v1beta.WidgetTool.WidgetType + * @enum {number} + * @property {number} WIDGET_TYPE_UNSPECIFIED=0 WIDGET_TYPE_UNSPECIFIED value + * @property {number} CUSTOM=1 CUSTOM value + * @property {number} PRODUCT_CAROUSEL=2 PRODUCT_CAROUSEL value + * @property {number} PRODUCT_DETAILS=3 PRODUCT_DETAILS value + * @property {number} QUICK_ACTIONS=4 QUICK_ACTIONS value + * @property {number} PRODUCT_COMPARISON=5 PRODUCT_COMPARISON value + * @property {number} ADVANCED_PRODUCT_DETAILS=6 ADVANCED_PRODUCT_DETAILS value + * @property {number} SHORT_FORM=7 SHORT_FORM value + * @property {number} OVERALL_SATISFACTION=8 OVERALL_SATISFACTION value + * @property {number} ORDER_SUMMARY=9 ORDER_SUMMARY value + * @property {number} APPOINTMENT_DETAILS=10 APPOINTMENT_DETAILS value + * @property {number} APPOINTMENT_SCHEDULER=11 APPOINTMENT_SCHEDULER value + * @property {number} CONTACT_FORM=12 CONTACT_FORM value + */ + WidgetTool.WidgetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WIDGET_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CUSTOM"] = 1; + values[valuesById[2] = "PRODUCT_CAROUSEL"] = 2; + values[valuesById[3] = "PRODUCT_DETAILS"] = 3; + values[valuesById[4] = "QUICK_ACTIONS"] = 4; + values[valuesById[5] = "PRODUCT_COMPARISON"] = 5; + values[valuesById[6] = "ADVANCED_PRODUCT_DETAILS"] = 6; + values[valuesById[7] = "SHORT_FORM"] = 7; + values[valuesById[8] = "OVERALL_SATISFACTION"] = 8; + values[valuesById[9] = "ORDER_SUMMARY"] = 9; + values[valuesById[10] = "APPOINTMENT_DETAILS"] = 10; + values[valuesById[11] = "APPOINTMENT_SCHEDULER"] = 11; + values[valuesById[12] = "CONTACT_FORM"] = 12; + return values; + })(); + + return WidgetTool; + })(); + + v1beta.Toolset = (function() { + + /** + * Properties of a Toolset. + * @memberof google.cloud.ces.v1beta + * @interface IToolset + * @property {google.cloud.ces.v1beta.IMcpToolset|null} [mcpToolset] Toolset mcpToolset + * @property {google.cloud.ces.v1beta.IOpenApiToolset|null} [openApiToolset] Toolset openApiToolset + * @property {google.cloud.ces.v1beta.IConnectorToolset|null} [connectorToolset] Toolset connectorToolset + * @property {string|null} [name] Toolset name + * @property {string|null} [displayName] Toolset displayName + * @property {string|null} [description] Toolset description + * @property {google.protobuf.ITimestamp|null} [createTime] Toolset createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Toolset updateTime + * @property {string|null} [etag] Toolset etag + * @property {google.cloud.ces.v1beta.ExecutionType|null} [executionType] Toolset executionType + * @property {google.cloud.ces.v1beta.IToolFakeConfig|null} [toolFakeConfig] Toolset toolFakeConfig + */ + + /** + * Constructs a new Toolset. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Toolset. + * @implements IToolset + * @constructor + * @param {google.cloud.ces.v1beta.IToolset=} [properties] Properties to set + */ + function Toolset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Toolset mcpToolset. + * @member {google.cloud.ces.v1beta.IMcpToolset|null|undefined} mcpToolset + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.mcpToolset = null; + + /** + * Toolset openApiToolset. + * @member {google.cloud.ces.v1beta.IOpenApiToolset|null|undefined} openApiToolset + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.openApiToolset = null; + + /** + * Toolset connectorToolset. + * @member {google.cloud.ces.v1beta.IConnectorToolset|null|undefined} connectorToolset + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.connectorToolset = null; + + /** + * Toolset name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.name = ""; + + /** + * Toolset displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.displayName = ""; + + /** + * Toolset description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.description = ""; + + /** + * Toolset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.createTime = null; + + /** + * Toolset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.updateTime = null; + + /** + * Toolset etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.etag = ""; + + /** + * Toolset executionType. + * @member {google.cloud.ces.v1beta.ExecutionType} executionType + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.executionType = 0; + + /** + * Toolset toolFakeConfig. + * @member {google.cloud.ces.v1beta.IToolFakeConfig|null|undefined} toolFakeConfig + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.toolFakeConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Toolset toolsetType. + * @member {"mcpToolset"|"openApiToolset"|"connectorToolset"|undefined} toolsetType + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Object.defineProperty(Toolset.prototype, "toolsetType", { + get: $util.oneOfGetter($oneOfFields = ["mcpToolset", "openApiToolset", "connectorToolset"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Toolset instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Toolset + * @static + * @param {google.cloud.ces.v1beta.IToolset=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Toolset} Toolset instance + */ + Toolset.create = function create(properties) { + return new Toolset(properties); + }; + + /** + * Encodes the specified Toolset message. Does not implicitly {@link google.cloud.ces.v1beta.Toolset.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Toolset + * @static + * @param {google.cloud.ces.v1beta.IToolset} message Toolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Toolset.encode = function encode(message, writer) { + if (!writer) + 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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); + if (message.mcpToolset != null && Object.hasOwnProperty.call(message, "mcpToolset")) + $root.google.cloud.ces.v1beta.McpToolset.encode(message.mcpToolset, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.openApiToolset != null && Object.hasOwnProperty.call(message, "openApiToolset")) + $root.google.cloud.ces.v1beta.OpenApiToolset.encode(message.openApiToolset, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.connectorToolset != null && Object.hasOwnProperty.call(message, "connectorToolset")) + $root.google.cloud.ces.v1beta.ConnectorToolset.encode(message.connectorToolset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.executionType != null && Object.hasOwnProperty.call(message, "executionType")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.executionType); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.description); + if (message.toolFakeConfig != null && Object.hasOwnProperty.call(message, "toolFakeConfig")) + $root.google.cloud.ces.v1beta.ToolFakeConfig.encode(message.toolFakeConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Toolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Toolset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Toolset + * @static + * @param {google.cloud.ces.v1beta.IToolset} message Toolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Toolset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Toolset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Toolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Toolset} Toolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Toolset.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Toolset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 6: { + message.mcpToolset = $root.google.cloud.ces.v1beta.McpToolset.decode(reader, reader.uint32()); + break; + } + case 7: { + message.openApiToolset = $root.google.cloud.ces.v1beta.OpenApiToolset.decode(reader, reader.uint32()); + break; + } + case 8: { + message.connectorToolset = $root.google.cloud.ces.v1beta.ConnectorToolset.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 10: { + message.description = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.etag = reader.string(); + break; + } + case 9: { + message.executionType = reader.int32(); + break; + } + case 11: { + message.toolFakeConfig = $root.google.cloud.ces.v1beta.ToolFakeConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Toolset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Toolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Toolset} Toolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Toolset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Toolset message. + * @function verify + * @memberof google.cloud.ces.v1beta.Toolset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Toolset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.mcpToolset != null && message.hasOwnProperty("mcpToolset")) { + properties.toolsetType = 1; + { + var error = $root.google.cloud.ces.v1beta.McpToolset.verify(message.mcpToolset); + if (error) + return "mcpToolset." + error; + } + } + if (message.openApiToolset != null && message.hasOwnProperty("openApiToolset")) { + if (properties.toolsetType === 1) + return "toolsetType: multiple values"; + properties.toolsetType = 1; + { + var error = $root.google.cloud.ces.v1beta.OpenApiToolset.verify(message.openApiToolset); + if (error) + return "openApiToolset." + error; + } + } + if (message.connectorToolset != null && message.hasOwnProperty("connectorToolset")) { + if (properties.toolsetType === 1) + return "toolsetType: multiple values"; + properties.toolsetType = 1; + { + var error = $root.google.cloud.ces.v1beta.ConnectorToolset.verify(message.connectorToolset); + if (error) + return "connectorToolset." + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.executionType != null && message.hasOwnProperty("executionType")) + switch (message.executionType) { + default: + return "executionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) { + var error = $root.google.cloud.ces.v1beta.ToolFakeConfig.verify(message.toolFakeConfig); + if (error) + return "toolFakeConfig." + error; + } + return null; + }; + + /** + * Creates a Toolset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Toolset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Toolset} Toolset + */ + Toolset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Toolset) + return object; + var message = new $root.google.cloud.ces.v1beta.Toolset(); + if (object.mcpToolset != null) { + if (typeof object.mcpToolset !== "object") + throw TypeError(".google.cloud.ces.v1beta.Toolset.mcpToolset: object expected"); + message.mcpToolset = $root.google.cloud.ces.v1beta.McpToolset.fromObject(object.mcpToolset); + } + if (object.openApiToolset != null) { + if (typeof object.openApiToolset !== "object") + throw TypeError(".google.cloud.ces.v1beta.Toolset.openApiToolset: object expected"); + message.openApiToolset = $root.google.cloud.ces.v1beta.OpenApiToolset.fromObject(object.openApiToolset); + } + if (object.connectorToolset != null) { + if (typeof object.connectorToolset !== "object") + throw TypeError(".google.cloud.ces.v1beta.Toolset.connectorToolset: object expected"); + message.connectorToolset = $root.google.cloud.ces.v1beta.ConnectorToolset.fromObject(object.connectorToolset); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Toolset.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.ces.v1beta.Toolset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + switch (object.executionType) { + default: + if (typeof object.executionType === "number") { + message.executionType = object.executionType; + break; + } + break; + case "EXECUTION_TYPE_UNSPECIFIED": + case 0: + message.executionType = 0; + break; + case "SYNCHRONOUS": + case 1: + message.executionType = 1; + break; + case "ASYNCHRONOUS": + case 2: + message.executionType = 2; + break; + } + if (object.toolFakeConfig != null) { + if (typeof object.toolFakeConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.Toolset.toolFakeConfig: object expected"); + message.toolFakeConfig = $root.google.cloud.ces.v1beta.ToolFakeConfig.fromObject(object.toolFakeConfig); + } + return message; + }; + + /** + * Creates a plain object from a Toolset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Toolset + * @static + * @param {google.cloud.ces.v1beta.Toolset} message Toolset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Toolset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.executionType = options.enums === String ? "EXECUTION_TYPE_UNSPECIFIED" : 0; + object.description = ""; + object.toolFakeConfig = 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.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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.mcpToolset != null && message.hasOwnProperty("mcpToolset")) { + object.mcpToolset = $root.google.cloud.ces.v1beta.McpToolset.toObject(message.mcpToolset, options); + if (options.oneofs) + object.toolsetType = "mcpToolset"; + } + if (message.openApiToolset != null && message.hasOwnProperty("openApiToolset")) { + object.openApiToolset = $root.google.cloud.ces.v1beta.OpenApiToolset.toObject(message.openApiToolset, options); + if (options.oneofs) + object.toolsetType = "openApiToolset"; + } + if (message.connectorToolset != null && message.hasOwnProperty("connectorToolset")) { + object.connectorToolset = $root.google.cloud.ces.v1beta.ConnectorToolset.toObject(message.connectorToolset, options); + if (options.oneofs) + object.toolsetType = "connectorToolset"; + } + if (message.executionType != null && message.hasOwnProperty("executionType")) + object.executionType = options.enums === String ? $root.google.cloud.ces.v1beta.ExecutionType[message.executionType] === undefined ? message.executionType : $root.google.cloud.ces.v1beta.ExecutionType[message.executionType] : message.executionType; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) + object.toolFakeConfig = $root.google.cloud.ces.v1beta.ToolFakeConfig.toObject(message.toolFakeConfig, options); + return object; + }; + + /** + * Converts this Toolset to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + * @returns {Object.} JSON object + */ + Toolset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Toolset + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Toolset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Toolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Toolset"; + }; + + return Toolset; + })(); + + v1beta.ConnectorToolset = (function() { + + /** + * Properties of a ConnectorToolset. + * @memberof google.cloud.ces.v1beta + * @interface IConnectorToolset + * @property {string|null} [connection] ConnectorToolset connection + * @property {google.cloud.ces.v1beta.IEndUserAuthConfig|null} [authConfig] ConnectorToolset authConfig + * @property {Array.|null} [connectorActions] ConnectorToolset connectorActions + */ + + /** + * Constructs a new ConnectorToolset. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ConnectorToolset. + * @implements IConnectorToolset + * @constructor + * @param {google.cloud.ces.v1beta.IConnectorToolset=} [properties] Properties to set + */ + function ConnectorToolset(properties) { + this.connectorActions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectorToolset connection. + * @member {string} connection + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @instance + */ + ConnectorToolset.prototype.connection = ""; + + /** + * ConnectorToolset authConfig. + * @member {google.cloud.ces.v1beta.IEndUserAuthConfig|null|undefined} authConfig + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @instance + */ + ConnectorToolset.prototype.authConfig = null; + + /** + * ConnectorToolset connectorActions. + * @member {Array.} connectorActions + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @instance + */ + ConnectorToolset.prototype.connectorActions = $util.emptyArray; + + /** + * Creates a new ConnectorToolset instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @static + * @param {google.cloud.ces.v1beta.IConnectorToolset=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ConnectorToolset} ConnectorToolset instance + */ + ConnectorToolset.create = function create(properties) { + return new ConnectorToolset(properties); + }; + + /** + * Encodes the specified ConnectorToolset message. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorToolset.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @static + * @param {google.cloud.ces.v1beta.IConnectorToolset} message ConnectorToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorToolset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection); + if (message.authConfig != null && Object.hasOwnProperty.call(message, "authConfig")) + $root.google.cloud.ces.v1beta.EndUserAuthConfig.encode(message.authConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.connectorActions != null && message.connectorActions.length) + for (var i = 0; i < message.connectorActions.length; ++i) + $root.google.cloud.ces.v1beta.Action.encode(message.connectorActions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConnectorToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorToolset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @static + * @param {google.cloud.ces.v1beta.IConnectorToolset} message ConnectorToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorToolset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectorToolset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ConnectorToolset} ConnectorToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorToolset.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ConnectorToolset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.connection = reader.string(); + break; + } + case 2: { + message.authConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.connectorActions && message.connectorActions.length)) + message.connectorActions = []; + message.connectorActions.push($root.google.cloud.ces.v1beta.Action.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectorToolset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ConnectorToolset} ConnectorToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorToolset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectorToolset message. + * @function verify + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectorToolset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connection != null && message.hasOwnProperty("connection")) + if (!$util.isString(message.connection)) + return "connection: string expected"; + if (message.authConfig != null && message.hasOwnProperty("authConfig")) { + var error = $root.google.cloud.ces.v1beta.EndUserAuthConfig.verify(message.authConfig); + if (error) + return "authConfig." + error; + } + if (message.connectorActions != null && message.hasOwnProperty("connectorActions")) { + if (!Array.isArray(message.connectorActions)) + return "connectorActions: array expected"; + for (var i = 0; i < message.connectorActions.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Action.verify(message.connectorActions[i]); + if (error) + return "connectorActions." + error; + } + } + return null; + }; + + /** + * Creates a ConnectorToolset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ConnectorToolset} ConnectorToolset + */ + ConnectorToolset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ConnectorToolset) + return object; + var message = new $root.google.cloud.ces.v1beta.ConnectorToolset(); + if (object.connection != null) + message.connection = String(object.connection); + if (object.authConfig != null) { + if (typeof object.authConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.ConnectorToolset.authConfig: object expected"); + message.authConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.fromObject(object.authConfig); + } + if (object.connectorActions) { + if (!Array.isArray(object.connectorActions)) + throw TypeError(".google.cloud.ces.v1beta.ConnectorToolset.connectorActions: array expected"); + message.connectorActions = []; + for (var i = 0; i < object.connectorActions.length; ++i) { + if (typeof object.connectorActions[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ConnectorToolset.connectorActions: object expected"); + message.connectorActions[i] = $root.google.cloud.ces.v1beta.Action.fromObject(object.connectorActions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ConnectorToolset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @static + * @param {google.cloud.ces.v1beta.ConnectorToolset} message ConnectorToolset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectorToolset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.connectorActions = []; + if (options.defaults) { + object.connection = ""; + object.authConfig = null; + } + if (message.connection != null && message.hasOwnProperty("connection")) + object.connection = message.connection; + if (message.authConfig != null && message.hasOwnProperty("authConfig")) + object.authConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.toObject(message.authConfig, options); + if (message.connectorActions && message.connectorActions.length) { + object.connectorActions = []; + for (var j = 0; j < message.connectorActions.length; ++j) + object.connectorActions[j] = $root.google.cloud.ces.v1beta.Action.toObject(message.connectorActions[j], options); + } + return object; + }; + + /** + * Converts this ConnectorToolset to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @instance + * @returns {Object.} JSON object + */ + ConnectorToolset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectorToolset + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectorToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ConnectorToolset"; + }; + + return ConnectorToolset; + })(); + + v1beta.McpToolset = (function() { + + /** + * Properties of a McpToolset. + * @memberof google.cloud.ces.v1beta + * @interface IMcpToolset + * @property {string|null} [serverAddress] McpToolset serverAddress + * @property {google.cloud.ces.v1beta.IApiAuthentication|null} [apiAuthentication] McpToolset apiAuthentication + * @property {google.cloud.ces.v1beta.IServiceDirectoryConfig|null} [serviceDirectoryConfig] McpToolset serviceDirectoryConfig + * @property {google.cloud.ces.v1beta.ITlsConfig|null} [tlsConfig] McpToolset tlsConfig + */ + + /** + * Constructs a new McpToolset. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a McpToolset. + * @implements IMcpToolset + * @constructor + * @param {google.cloud.ces.v1beta.IMcpToolset=} [properties] Properties to set + */ + function McpToolset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * McpToolset serverAddress. + * @member {string} serverAddress + * @memberof google.cloud.ces.v1beta.McpToolset + * @instance + */ + McpToolset.prototype.serverAddress = ""; + + /** + * McpToolset apiAuthentication. + * @member {google.cloud.ces.v1beta.IApiAuthentication|null|undefined} apiAuthentication + * @memberof google.cloud.ces.v1beta.McpToolset + * @instance + */ + McpToolset.prototype.apiAuthentication = null; + + /** + * McpToolset serviceDirectoryConfig. + * @member {google.cloud.ces.v1beta.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig + * @memberof google.cloud.ces.v1beta.McpToolset + * @instance + */ + McpToolset.prototype.serviceDirectoryConfig = null; + + /** + * McpToolset tlsConfig. + * @member {google.cloud.ces.v1beta.ITlsConfig|null|undefined} tlsConfig + * @memberof google.cloud.ces.v1beta.McpToolset + * @instance + */ + McpToolset.prototype.tlsConfig = null; + + /** + * Creates a new McpToolset instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.McpToolset + * @static + * @param {google.cloud.ces.v1beta.IMcpToolset=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.McpToolset} McpToolset instance + */ + McpToolset.create = function create(properties) { + return new McpToolset(properties); + }; + + /** + * Encodes the specified McpToolset message. Does not implicitly {@link google.cloud.ces.v1beta.McpToolset.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.McpToolset + * @static + * @param {google.cloud.ces.v1beta.IMcpToolset} message McpToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + McpToolset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serverAddress != null && Object.hasOwnProperty.call(message, "serverAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serverAddress); + if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) + $root.google.cloud.ces.v1beta.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) + $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) + $root.google.cloud.ces.v1beta.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified McpToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.McpToolset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.McpToolset + * @static + * @param {google.cloud.ces.v1beta.IMcpToolset} message McpToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + McpToolset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a McpToolset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.McpToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.McpToolset} McpToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + McpToolset.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.McpToolset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.serverAddress = reader.string(); + break; + } + case 2: { + message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.decode(reader, reader.uint32()); + break; + } + case 3: { + message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a McpToolset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.McpToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.McpToolset} McpToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + McpToolset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a McpToolset message. + * @function verify + * @memberof google.cloud.ces.v1beta.McpToolset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + McpToolset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) + if (!$util.isString(message.serverAddress)) + return "serverAddress: string expected"; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { + var error = $root.google.cloud.ces.v1beta.ApiAuthentication.verify(message.apiAuthentication); + if (error) + return "apiAuthentication." + error; + } + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { + var error = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); + if (error) + return "serviceDirectoryConfig." + error; + } + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { + var error = $root.google.cloud.ces.v1beta.TlsConfig.verify(message.tlsConfig); + if (error) + return "tlsConfig." + error; + } + return null; + }; + + /** + * Creates a McpToolset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.McpToolset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.McpToolset} McpToolset + */ + McpToolset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.McpToolset) + return object; + var message = new $root.google.cloud.ces.v1beta.McpToolset(); + if (object.serverAddress != null) + message.serverAddress = String(object.serverAddress); + if (object.apiAuthentication != null) { + if (typeof object.apiAuthentication !== "object") + throw TypeError(".google.cloud.ces.v1beta.McpToolset.apiAuthentication: object expected"); + message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.fromObject(object.apiAuthentication); + } + if (object.serviceDirectoryConfig != null) { + if (typeof object.serviceDirectoryConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.McpToolset.serviceDirectoryConfig: object expected"); + message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); + } + if (object.tlsConfig != null) { + if (typeof object.tlsConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.McpToolset.tlsConfig: object expected"); + message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.fromObject(object.tlsConfig); + } + return message; + }; + + /** + * Creates a plain object from a McpToolset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.McpToolset + * @static + * @param {google.cloud.ces.v1beta.McpToolset} message McpToolset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + McpToolset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serverAddress = ""; + object.apiAuthentication = null; + object.serviceDirectoryConfig = null; + object.tlsConfig = null; + } + if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) + object.serverAddress = message.serverAddress; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) + object.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.toObject(message.apiAuthentication, options); + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) + object.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) + object.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.toObject(message.tlsConfig, options); + return object; + }; + + /** + * Converts this McpToolset to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.McpToolset + * @instance + * @returns {Object.} JSON object + */ + McpToolset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for McpToolset + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.McpToolset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + McpToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.McpToolset"; + }; + + return McpToolset; + })(); + + v1beta.OpenApiToolset = (function() { + + /** + * Properties of an OpenApiToolset. + * @memberof google.cloud.ces.v1beta + * @interface IOpenApiToolset + * @property {string|null} [openApiSchema] OpenApiToolset openApiSchema + * @property {google.cloud.ces.v1beta.IApiAuthentication|null} [apiAuthentication] OpenApiToolset apiAuthentication + * @property {google.cloud.ces.v1beta.ITlsConfig|null} [tlsConfig] OpenApiToolset tlsConfig + * @property {google.cloud.ces.v1beta.IServiceDirectoryConfig|null} [serviceDirectoryConfig] OpenApiToolset serviceDirectoryConfig + * @property {boolean|null} [ignoreUnknownFields] OpenApiToolset ignoreUnknownFields + * @property {string|null} [url] OpenApiToolset url + */ + + /** + * Constructs a new OpenApiToolset. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an OpenApiToolset. + * @implements IOpenApiToolset + * @constructor + * @param {google.cloud.ces.v1beta.IOpenApiToolset=} [properties] Properties to set + */ + function OpenApiToolset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpenApiToolset openApiSchema. + * @member {string} openApiSchema + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @instance + */ + OpenApiToolset.prototype.openApiSchema = ""; + + /** + * OpenApiToolset apiAuthentication. + * @member {google.cloud.ces.v1beta.IApiAuthentication|null|undefined} apiAuthentication + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @instance + */ + OpenApiToolset.prototype.apiAuthentication = null; + + /** + * OpenApiToolset tlsConfig. + * @member {google.cloud.ces.v1beta.ITlsConfig|null|undefined} tlsConfig + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @instance + */ + OpenApiToolset.prototype.tlsConfig = null; + + /** + * OpenApiToolset serviceDirectoryConfig. + * @member {google.cloud.ces.v1beta.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @instance + */ + OpenApiToolset.prototype.serviceDirectoryConfig = null; + + /** + * OpenApiToolset ignoreUnknownFields. + * @member {boolean} ignoreUnknownFields + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @instance + */ + OpenApiToolset.prototype.ignoreUnknownFields = false; + + /** + * OpenApiToolset url. + * @member {string} url + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @instance + */ + OpenApiToolset.prototype.url = ""; + + /** + * Creates a new OpenApiToolset instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @static + * @param {google.cloud.ces.v1beta.IOpenApiToolset=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OpenApiToolset} OpenApiToolset instance + */ + OpenApiToolset.create = function create(properties) { + return new OpenApiToolset(properties); + }; + + /** + * Encodes the specified OpenApiToolset message. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiToolset.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @static + * @param {google.cloud.ces.v1beta.IOpenApiToolset} message OpenApiToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiToolset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.openApiSchema != null && Object.hasOwnProperty.call(message, "openApiSchema")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.openApiSchema); + if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) + $root.google.cloud.ces.v1beta.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) + $root.google.cloud.ces.v1beta.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) + $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ignoreUnknownFields != null && Object.hasOwnProperty.call(message, "ignoreUnknownFields")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.ignoreUnknownFields); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.url); + return writer; + }; + + /** + * Encodes the specified OpenApiToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiToolset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @static + * @param {google.cloud.ces.v1beta.IOpenApiToolset} message OpenApiToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiToolset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenApiToolset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OpenApiToolset} OpenApiToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiToolset.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OpenApiToolset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.openApiSchema = reader.string(); + break; + } + case 2: { + message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.decode(reader, reader.uint32()); + break; + } + case 3: { + message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.ignoreUnknownFields = reader.bool(); + break; + } + case 6: { + message.url = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OpenApiToolset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OpenApiToolset} OpenApiToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiToolset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpenApiToolset message. + * @function verify + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenApiToolset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) + if (!$util.isString(message.openApiSchema)) + return "openApiSchema: string expected"; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { + var error = $root.google.cloud.ces.v1beta.ApiAuthentication.verify(message.apiAuthentication); + if (error) + return "apiAuthentication." + error; + } + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { + var error = $root.google.cloud.ces.v1beta.TlsConfig.verify(message.tlsConfig); + if (error) + return "tlsConfig." + error; + } + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { + var error = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); + if (error) + return "serviceDirectoryConfig." + error; + } + if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) + if (typeof message.ignoreUnknownFields !== "boolean") + return "ignoreUnknownFields: boolean expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + return null; + }; + + /** + * Creates an OpenApiToolset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OpenApiToolset} OpenApiToolset + */ + OpenApiToolset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OpenApiToolset) + return object; + var message = new $root.google.cloud.ces.v1beta.OpenApiToolset(); + if (object.openApiSchema != null) + message.openApiSchema = String(object.openApiSchema); + if (object.apiAuthentication != null) { + if (typeof object.apiAuthentication !== "object") + throw TypeError(".google.cloud.ces.v1beta.OpenApiToolset.apiAuthentication: object expected"); + message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.fromObject(object.apiAuthentication); + } + if (object.tlsConfig != null) { + if (typeof object.tlsConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.OpenApiToolset.tlsConfig: object expected"); + message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.fromObject(object.tlsConfig); + } + if (object.serviceDirectoryConfig != null) { + if (typeof object.serviceDirectoryConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.OpenApiToolset.serviceDirectoryConfig: object expected"); + message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); + } + if (object.ignoreUnknownFields != null) + message.ignoreUnknownFields = Boolean(object.ignoreUnknownFields); + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from an OpenApiToolset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @static + * @param {google.cloud.ces.v1beta.OpenApiToolset} message OpenApiToolset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenApiToolset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.openApiSchema = ""; + object.apiAuthentication = null; + object.tlsConfig = null; + object.serviceDirectoryConfig = null; + object.ignoreUnknownFields = false; + object.url = ""; + } + if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) + object.openApiSchema = message.openApiSchema; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) + object.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.toObject(message.apiAuthentication, options); + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) + object.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.toObject(message.tlsConfig, options); + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) + object.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); + if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) + object.ignoreUnknownFields = message.ignoreUnknownFields; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + return object; + }; + + /** + * Converts this OpenApiToolset to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @instance + * @returns {Object.} JSON object + */ + OpenApiToolset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OpenApiToolset + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpenApiToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OpenApiToolset"; + }; + + return OpenApiToolset; + })(); + + v1beta.Changelog = (function() { + + /** + * Properties of a Changelog. + * @memberof google.cloud.ces.v1beta + * @interface IChangelog + * @property {string|null} [name] Changelog name + * @property {string|null} [author] Changelog author + * @property {string|null} [displayName] Changelog displayName + * @property {string|null} [description] Changelog description + * @property {string|null} [resource] Changelog resource + * @property {string|null} [resourceType] Changelog resourceType + * @property {string|null} [action] Changelog action + * @property {google.protobuf.IStruct|null} [originalResource] Changelog originalResource + * @property {google.protobuf.IStruct|null} [newResource] Changelog newResource + * @property {Array.|null} [dependentResources] Changelog dependentResources + * @property {google.protobuf.ITimestamp|null} [createTime] Changelog createTime + * @property {number|Long|null} [sequenceNumber] Changelog sequenceNumber + */ + + /** + * Constructs a new Changelog. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Changelog. + * @implements IChangelog + * @constructor + * @param {google.cloud.ces.v1beta.IChangelog=} [properties] Properties to set + */ + function Changelog(properties) { + this.dependentResources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Changelog name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.name = ""; + + /** + * Changelog author. + * @member {string} author + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.author = ""; + + /** + * Changelog displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.displayName = ""; + + /** + * Changelog description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.description = ""; + + /** + * Changelog resource. + * @member {string} resource + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.resource = ""; + + /** + * Changelog resourceType. + * @member {string} resourceType + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.resourceType = ""; + + /** + * Changelog action. + * @member {string} action + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.action = ""; + + /** + * Changelog originalResource. + * @member {google.protobuf.IStruct|null|undefined} originalResource + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.originalResource = null; + + /** + * Changelog newResource. + * @member {google.protobuf.IStruct|null|undefined} newResource + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.newResource = null; + + /** + * Changelog dependentResources. + * @member {Array.} dependentResources + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.dependentResources = $util.emptyArray; + + /** + * Changelog createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.createTime = null; + + /** + * Changelog sequenceNumber. + * @member {number|Long} sequenceNumber + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.sequenceNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Changelog instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Changelog + * @static + * @param {google.cloud.ces.v1beta.IChangelog=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Changelog} Changelog instance + */ + Changelog.create = function create(properties) { + return new Changelog(properties); + }; + + /** + * Encodes the specified Changelog message. Does not implicitly {@link google.cloud.ces.v1beta.Changelog.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Changelog + * @static + * @param {google.cloud.ces.v1beta.IChangelog} message Changelog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Changelog.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.author != null && Object.hasOwnProperty.call(message, "author")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.author); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resource); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceType); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.action); + if (message.originalResource != null && Object.hasOwnProperty.call(message, "originalResource")) + $root.google.protobuf.Struct.encode(message.originalResource, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.newResource != null && Object.hasOwnProperty.call(message, "newResource")) + $root.google.protobuf.Struct.encode(message.newResource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.dependentResources != null && message.dependentResources.length) + for (var i = 0; i < message.dependentResources.length; ++i) + $root.google.protobuf.Struct.encode(message.dependentResources[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.description); + if (message.sequenceNumber != null && Object.hasOwnProperty.call(message, "sequenceNumber")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.sequenceNumber); + return writer; + }; + + /** + * Encodes the specified Changelog message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Changelog.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Changelog + * @static + * @param {google.cloud.ces.v1beta.IChangelog} message Changelog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Changelog.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Changelog message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Changelog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Changelog} Changelog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Changelog.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Changelog(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.author = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 11: { + message.description = reader.string(); + break; + } + case 4: { + message.resource = reader.string(); + break; + } + case 5: { + message.resourceType = reader.string(); + break; + } + case 6: { + message.action = reader.string(); + break; + } + case 7: { + message.originalResource = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 8: { + message.newResource = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.dependentResources && message.dependentResources.length)) + message.dependentResources = []; + message.dependentResources.push($root.google.protobuf.Struct.decode(reader, reader.uint32())); + break; + } + case 10: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.sequenceNumber = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Changelog message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Changelog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Changelog} Changelog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Changelog.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Changelog message. + * @function verify + * @memberof google.cloud.ces.v1beta.Changelog + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Changelog.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.author != null && message.hasOwnProperty("author")) + if (!$util.isString(message.author)) + return "author: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.originalResource != null && message.hasOwnProperty("originalResource")) { + var error = $root.google.protobuf.Struct.verify(message.originalResource); + if (error) + return "originalResource." + error; + } + if (message.newResource != null && message.hasOwnProperty("newResource")) { + var error = $root.google.protobuf.Struct.verify(message.newResource); + if (error) + return "newResource." + error; + } + if (message.dependentResources != null && message.hasOwnProperty("dependentResources")) { + if (!Array.isArray(message.dependentResources)) + return "dependentResources: array expected"; + for (var i = 0; i < message.dependentResources.length; ++i) { + var error = $root.google.protobuf.Struct.verify(message.dependentResources[i]); + if (error) + return "dependentResources." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) + if (!$util.isInteger(message.sequenceNumber) && !(message.sequenceNumber && $util.isInteger(message.sequenceNumber.low) && $util.isInteger(message.sequenceNumber.high))) + return "sequenceNumber: integer|Long expected"; + return null; + }; + + /** + * Creates a Changelog message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Changelog + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Changelog} Changelog + */ + Changelog.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Changelog) + return object; + var message = new $root.google.cloud.ces.v1beta.Changelog(); + if (object.name != null) + message.name = String(object.name); + if (object.author != null) + message.author = String(object.author); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.resource != null) + message.resource = String(object.resource); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.action != null) + message.action = String(object.action); + if (object.originalResource != null) { + if (typeof object.originalResource !== "object") + throw TypeError(".google.cloud.ces.v1beta.Changelog.originalResource: object expected"); + message.originalResource = $root.google.protobuf.Struct.fromObject(object.originalResource); + } + if (object.newResource != null) { + if (typeof object.newResource !== "object") + throw TypeError(".google.cloud.ces.v1beta.Changelog.newResource: object expected"); + message.newResource = $root.google.protobuf.Struct.fromObject(object.newResource); + } + if (object.dependentResources) { + if (!Array.isArray(object.dependentResources)) + throw TypeError(".google.cloud.ces.v1beta.Changelog.dependentResources: array expected"); + message.dependentResources = []; + for (var i = 0; i < object.dependentResources.length; ++i) { + if (typeof object.dependentResources[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Changelog.dependentResources: object expected"); + message.dependentResources[i] = $root.google.protobuf.Struct.fromObject(object.dependentResources[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Changelog.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.sequenceNumber != null) + if ($util.Long) + (message.sequenceNumber = $util.Long.fromValue(object.sequenceNumber)).unsigned = false; + else if (typeof object.sequenceNumber === "string") + message.sequenceNumber = parseInt(object.sequenceNumber, 10); + else if (typeof object.sequenceNumber === "number") + message.sequenceNumber = object.sequenceNumber; + else if (typeof object.sequenceNumber === "object") + message.sequenceNumber = new $util.LongBits(object.sequenceNumber.low >>> 0, object.sequenceNumber.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Changelog message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Changelog + * @static + * @param {google.cloud.ces.v1beta.Changelog} message Changelog + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Changelog.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dependentResources = []; + if (options.defaults) { + object.name = ""; + object.author = ""; + object.displayName = ""; + object.resource = ""; + object.resourceType = ""; + object.action = ""; + object.originalResource = null; + object.newResource = null; + object.createTime = null; + object.description = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sequenceNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequenceNumber = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.author != null && message.hasOwnProperty("author")) + object.author = message.author; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.originalResource != null && message.hasOwnProperty("originalResource")) + object.originalResource = $root.google.protobuf.Struct.toObject(message.originalResource, options); + if (message.newResource != null && message.hasOwnProperty("newResource")) + object.newResource = $root.google.protobuf.Struct.toObject(message.newResource, options); + if (message.dependentResources && message.dependentResources.length) { + object.dependentResources = []; + for (var j = 0; j < message.dependentResources.length; ++j) + object.dependentResources[j] = $root.google.protobuf.Struct.toObject(message.dependentResources[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) + if (typeof message.sequenceNumber === "number") + object.sequenceNumber = options.longs === String ? String(message.sequenceNumber) : message.sequenceNumber; + else + object.sequenceNumber = options.longs === String ? $util.Long.prototype.toString.call(message.sequenceNumber) : options.longs === Number ? new $util.LongBits(message.sequenceNumber.low >>> 0, message.sequenceNumber.high >>> 0).toNumber() : message.sequenceNumber; + return object; + }; + + /** + * Converts this Changelog to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + * @returns {Object.} JSON object + */ + Changelog.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Changelog + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Changelog + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Changelog.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Changelog"; + }; + + return Changelog; + })(); + + v1beta.Conversation = (function() { + + /** + * Properties of a Conversation. + * @memberof google.cloud.ces.v1beta + * @interface IConversation + * @property {string|null} [name] Conversation name + * @property {google.protobuf.ITimestamp|null} [startTime] Conversation startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Conversation endTime + * @property {Array.|null} [turns] Conversation turns + * @property {number|null} [turnCount] Conversation turnCount + * @property {google.cloud.ces.v1beta.Conversation.ChannelType|null} [channelType] Conversation channelType + * @property {google.cloud.ces.v1beta.Conversation.Source|null} [source] Conversation source + * @property {Array.|null} [inputTypes] Conversation inputTypes + * @property {string|null} [entryAgent] Conversation entryAgent + * @property {string|null} [deployment] Conversation deployment + * @property {string|null} [appVersion] Conversation appVersion + * @property {string|null} [languageCode] Conversation languageCode + * @property {Array.|null} [messages] Conversation messages + */ + + /** + * Constructs a new Conversation. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Conversation. + * @implements IConversation + * @constructor + * @param {google.cloud.ces.v1beta.IConversation=} [properties] Properties to set + */ + function Conversation(properties) { + this.turns = []; + this.inputTypes = []; + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Conversation name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.name = ""; + + /** + * Conversation startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.startTime = null; + + /** + * Conversation endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.endTime = null; + + /** + * Conversation turns. + * @member {Array.} turns + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.turns = $util.emptyArray; + + /** + * Conversation turnCount. + * @member {number} turnCount + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.turnCount = 0; + + /** + * Conversation channelType. + * @member {google.cloud.ces.v1beta.Conversation.ChannelType} channelType + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.channelType = 0; + + /** + * Conversation source. + * @member {google.cloud.ces.v1beta.Conversation.Source} source + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.source = 0; + + /** + * Conversation inputTypes. + * @member {Array.} inputTypes + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.inputTypes = $util.emptyArray; + + /** + * Conversation entryAgent. + * @member {string} entryAgent + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.entryAgent = ""; + + /** + * Conversation deployment. + * @member {string} deployment + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.deployment = ""; + + /** + * Conversation appVersion. + * @member {string} appVersion + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.appVersion = ""; + + /** + * Conversation languageCode. + * @member {string} languageCode + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.languageCode = ""; + + /** + * Conversation messages. + * @member {Array.} messages + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.messages = $util.emptyArray; + + /** + * Creates a new Conversation instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Conversation + * @static + * @param {google.cloud.ces.v1beta.IConversation=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Conversation} Conversation instance + */ + Conversation.create = function create(properties) { + return new Conversation(properties); + }; + + /** + * Encodes the specified Conversation message. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Conversation + * @static + * @param {google.cloud.ces.v1beta.IConversation} message Conversation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Conversation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.ces.v1beta.Message.encode(message.messages[i], 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 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.turns != null && message.turns.length) + for (var i = 0; i < message.turns.length; ++i) + $root.google.cloud.ces.v1beta.Conversation.Turn.encode(message.turns[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.turnCount != null && Object.hasOwnProperty.call(message, "turnCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.turnCount); + if (message.channelType != null && Object.hasOwnProperty.call(message, "channelType")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.channelType); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.source); + if (message.inputTypes != null && message.inputTypes.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.inputTypes.length; ++i) + writer.int32(message.inputTypes[i]); + writer.ldelim(); + } + if (message.entryAgent != null && Object.hasOwnProperty.call(message, "entryAgent")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.entryAgent); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.deployment); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.appVersion); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified Conversation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Conversation + * @static + * @param {google.cloud.ces.v1beta.IConversation} message Conversation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Conversation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Conversation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Conversation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Conversation} Conversation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Conversation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Conversation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.turns && message.turns.length)) + message.turns = []; + message.turns.push($root.google.cloud.ces.v1beta.Conversation.Turn.decode(reader, reader.uint32())); + break; + } + case 7: { + message.turnCount = reader.int32(); + break; + } + case 8: { + message.channelType = reader.int32(); + break; + } + case 9: { + message.source = reader.int32(); + break; + } + case 10: { + if (!(message.inputTypes && message.inputTypes.length)) + message.inputTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.inputTypes.push(reader.int32()); + } else + message.inputTypes.push(reader.int32()); + break; + } + case 11: { + message.entryAgent = reader.string(); + break; + } + case 12: { + message.deployment = reader.string(); + break; + } + case 13: { + message.appVersion = reader.string(); + break; + } + case 14: { + message.languageCode = reader.string(); + break; + } + case 2: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Conversation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Conversation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Conversation} Conversation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Conversation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Conversation message. + * @function verify + * @memberof google.cloud.ces.v1beta.Conversation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Conversation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string 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.turns != null && message.hasOwnProperty("turns")) { + if (!Array.isArray(message.turns)) + return "turns: array expected"; + for (var i = 0; i < message.turns.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Conversation.Turn.verify(message.turns[i]); + if (error) + return "turns." + error; + } + } + if (message.turnCount != null && message.hasOwnProperty("turnCount")) + if (!$util.isInteger(message.turnCount)) + return "turnCount: integer expected"; + if (message.channelType != null && message.hasOwnProperty("channelType")) + switch (message.channelType) { + default: + return "channelType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.source != null && message.hasOwnProperty("source")) + switch (message.source) { + default: + return "source: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.inputTypes != null && message.hasOwnProperty("inputTypes")) { + if (!Array.isArray(message.inputTypes)) + return "inputTypes: array expected"; + for (var i = 0; i < message.inputTypes.length; ++i) + switch (message.inputTypes[i]) { + default: + return "inputTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + } + if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) + if (!$util.isString(message.entryAgent)) + return "entryAgent: string expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) + if (!$util.isString(message.deployment)) + return "deployment: string expected"; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (!$util.isString(message.appVersion)) + return "appVersion: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + return null; + }; + + /** + * Creates a Conversation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Conversation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Conversation} Conversation + */ + Conversation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Conversation) + return object; + var message = new $root.google.cloud.ces.v1beta.Conversation(); + if (object.name != null) + message.name = String(object.name); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Conversation.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.ces.v1beta.Conversation.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.turns) { + if (!Array.isArray(object.turns)) + throw TypeError(".google.cloud.ces.v1beta.Conversation.turns: array expected"); + message.turns = []; + for (var i = 0; i < object.turns.length; ++i) { + if (typeof object.turns[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Conversation.turns: object expected"); + message.turns[i] = $root.google.cloud.ces.v1beta.Conversation.Turn.fromObject(object.turns[i]); + } + } + if (object.turnCount != null) + message.turnCount = object.turnCount | 0; + switch (object.channelType) { + default: + if (typeof object.channelType === "number") { + message.channelType = object.channelType; + break; + } + break; + case "CHANNEL_TYPE_UNSPECIFIED": + case 0: + message.channelType = 0; + break; + case "TEXT": + case 1: + message.channelType = 1; + break; + case "AUDIO": + case 2: + message.channelType = 2; + break; + case "MULTIMODAL": + case 3: + message.channelType = 3; + break; + } + switch (object.source) { + default: + if (typeof object.source === "number") { + message.source = object.source; + break; + } + break; + case "SOURCE_UNSPECIFIED": + case 0: + message.source = 0; + break; + case "LIVE": + case 1: + message.source = 1; + break; + case "SIMULATOR": + case 2: + message.source = 2; + break; + case "EVAL": + case 3: + message.source = 3; + break; + } + if (object.inputTypes) { + if (!Array.isArray(object.inputTypes)) + throw TypeError(".google.cloud.ces.v1beta.Conversation.inputTypes: array expected"); + message.inputTypes = []; + for (var i = 0; i < object.inputTypes.length; ++i) + switch (object.inputTypes[i]) { + default: + if (typeof object.inputTypes[i] === "number") { + message.inputTypes[i] = object.inputTypes[i]; + break; + } + case "INPUT_TYPE_UNSPECIFIED": + case 0: + message.inputTypes[i] = 0; + break; + case "INPUT_TYPE_TEXT": + case 1: + message.inputTypes[i] = 1; + break; + case "INPUT_TYPE_AUDIO": + case 2: + message.inputTypes[i] = 2; + break; + case "INPUT_TYPE_IMAGE": + case 3: + message.inputTypes[i] = 3; + break; + case "INPUT_TYPE_BLOB": + case 4: + message.inputTypes[i] = 4; + break; + case "INPUT_TYPE_TOOL_RESPONSE": + case 5: + message.inputTypes[i] = 5; + break; + case "INPUT_TYPE_VARIABLES": + case 6: + message.inputTypes[i] = 6; + break; + } + } + if (object.entryAgent != null) + message.entryAgent = String(object.entryAgent); + if (object.deployment != null) + message.deployment = String(object.deployment); + if (object.appVersion != null) + message.appVersion = String(object.appVersion); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.ces.v1beta.Conversation.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Conversation.messages: object expected"); + message.messages[i] = $root.google.cloud.ces.v1beta.Message.fromObject(object.messages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Conversation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Conversation + * @static + * @param {google.cloud.ces.v1beta.Conversation} message Conversation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Conversation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.messages = []; + object.turns = []; + object.inputTypes = []; + } + if (options.defaults) { + object.name = ""; + object.startTime = null; + object.endTime = null; + object.turnCount = 0; + object.channelType = options.enums === String ? "CHANNEL_TYPE_UNSPECIFIED" : 0; + object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; + object.entryAgent = ""; + object.deployment = ""; + object.appVersion = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.ces.v1beta.Message.toObject(message.messages[j], options); + } + 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.turns && message.turns.length) { + object.turns = []; + for (var j = 0; j < message.turns.length; ++j) + object.turns[j] = $root.google.cloud.ces.v1beta.Conversation.Turn.toObject(message.turns[j], options); + } + if (message.turnCount != null && message.hasOwnProperty("turnCount")) + object.turnCount = message.turnCount; + if (message.channelType != null && message.hasOwnProperty("channelType")) + object.channelType = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.ChannelType[message.channelType] === undefined ? message.channelType : $root.google.cloud.ces.v1beta.Conversation.ChannelType[message.channelType] : message.channelType; + if (message.source != null && message.hasOwnProperty("source")) + object.source = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1beta.Conversation.Source[message.source] : message.source; + if (message.inputTypes && message.inputTypes.length) { + object.inputTypes = []; + for (var j = 0; j < message.inputTypes.length; ++j) + object.inputTypes[j] = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.InputType[message.inputTypes[j]] === undefined ? message.inputTypes[j] : $root.google.cloud.ces.v1beta.Conversation.InputType[message.inputTypes[j]] : message.inputTypes[j]; + } + if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) + object.entryAgent = message.entryAgent; + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = message.deployment; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + object.appVersion = message.appVersion; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this Conversation to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + * @returns {Object.} JSON object + */ + Conversation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Conversation + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Conversation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Conversation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Conversation"; + }; + + Conversation.Turn = (function() { + + /** + * Properties of a Turn. + * @memberof google.cloud.ces.v1beta.Conversation + * @interface ITurn + * @property {Array.|null} [messages] Turn messages + * @property {google.cloud.ces.v1beta.ISpan|null} [rootSpan] Turn rootSpan + */ + + /** + * Constructs a new Turn. + * @memberof google.cloud.ces.v1beta.Conversation + * @classdesc Represents a Turn. + * @implements ITurn + * @constructor + * @param {google.cloud.ces.v1beta.Conversation.ITurn=} [properties] Properties to set + */ + function Turn(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Turn messages. + * @member {Array.} messages + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @instance + */ + Turn.prototype.messages = $util.emptyArray; + + /** + * Turn rootSpan. + * @member {google.cloud.ces.v1beta.ISpan|null|undefined} rootSpan + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @instance + */ + Turn.prototype.rootSpan = null; + + /** + * Creates a new Turn instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @static + * @param {google.cloud.ces.v1beta.Conversation.ITurn=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Conversation.Turn} Turn instance + */ + Turn.create = function create(properties) { + return new Turn(properties); + }; + + /** + * Encodes the specified Turn message. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.Turn.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @static + * @param {google.cloud.ces.v1beta.Conversation.ITurn} message Turn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Turn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.ces.v1beta.Message.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rootSpan != null && Object.hasOwnProperty.call(message, "rootSpan")) + $root.google.cloud.ces.v1beta.Span.encode(message.rootSpan, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Turn message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.Turn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @static + * @param {google.cloud.ces.v1beta.Conversation.ITurn} message Turn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Turn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Turn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Conversation.Turn} Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Turn.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Conversation.Turn(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32())); + break; + } + case 2: { + message.rootSpan = $root.google.cloud.ces.v1beta.Span.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Turn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Conversation.Turn} Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Turn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Turn message. + * @function verify + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Turn.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) { + var error = $root.google.cloud.ces.v1beta.Span.verify(message.rootSpan); + if (error) + return "rootSpan." + error; + } + return null; + }; + + /** + * Creates a Turn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Conversation.Turn} Turn + */ + Turn.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Conversation.Turn) + return object; + var message = new $root.google.cloud.ces.v1beta.Conversation.Turn(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.ces.v1beta.Conversation.Turn.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Conversation.Turn.messages: object expected"); + message.messages[i] = $root.google.cloud.ces.v1beta.Message.fromObject(object.messages[i]); + } + } + if (object.rootSpan != null) { + if (typeof object.rootSpan !== "object") + throw TypeError(".google.cloud.ces.v1beta.Conversation.Turn.rootSpan: object expected"); + message.rootSpan = $root.google.cloud.ces.v1beta.Span.fromObject(object.rootSpan); + } + return message; + }; + + /** + * Creates a plain object from a Turn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @static + * @param {google.cloud.ces.v1beta.Conversation.Turn} message Turn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Turn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) + object.rootSpan = null; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.ces.v1beta.Message.toObject(message.messages[j], options); + } + if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) + object.rootSpan = $root.google.cloud.ces.v1beta.Span.toObject(message.rootSpan, options); + return object; + }; + + /** + * Converts this Turn to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @instance + * @returns {Object.} JSON object + */ + Turn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Turn + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Turn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Conversation.Turn"; + }; + + return Turn; + })(); + + /** + * ChannelType enum. + * @name google.cloud.ces.v1beta.Conversation.ChannelType + * @enum {number} + * @property {number} CHANNEL_TYPE_UNSPECIFIED=0 CHANNEL_TYPE_UNSPECIFIED value + * @property {number} TEXT=1 TEXT value + * @property {number} AUDIO=2 AUDIO value + * @property {number} MULTIMODAL=3 MULTIMODAL value + */ + Conversation.ChannelType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CHANNEL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "AUDIO"] = 2; + values[valuesById[3] = "MULTIMODAL"] = 3; + return values; + })(); + + /** + * Source enum. + * @name google.cloud.ces.v1beta.Conversation.Source + * @enum {number} + * @property {number} SOURCE_UNSPECIFIED=0 SOURCE_UNSPECIFIED value + * @property {number} LIVE=1 LIVE value + * @property {number} SIMULATOR=2 SIMULATOR value + * @property {number} EVAL=3 EVAL value + */ + Conversation.Source = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SOURCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LIVE"] = 1; + values[valuesById[2] = "SIMULATOR"] = 2; + values[valuesById[3] = "EVAL"] = 3; + return values; + })(); + + /** + * InputType enum. + * @name google.cloud.ces.v1beta.Conversation.InputType + * @enum {number} + * @property {number} INPUT_TYPE_UNSPECIFIED=0 INPUT_TYPE_UNSPECIFIED value + * @property {number} INPUT_TYPE_TEXT=1 INPUT_TYPE_TEXT value + * @property {number} INPUT_TYPE_AUDIO=2 INPUT_TYPE_AUDIO value + * @property {number} INPUT_TYPE_IMAGE=3 INPUT_TYPE_IMAGE value + * @property {number} INPUT_TYPE_BLOB=4 INPUT_TYPE_BLOB value + * @property {number} INPUT_TYPE_TOOL_RESPONSE=5 INPUT_TYPE_TOOL_RESPONSE value + * @property {number} INPUT_TYPE_VARIABLES=6 INPUT_TYPE_VARIABLES value + */ + Conversation.InputType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INPUT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INPUT_TYPE_TEXT"] = 1; + values[valuesById[2] = "INPUT_TYPE_AUDIO"] = 2; + values[valuesById[3] = "INPUT_TYPE_IMAGE"] = 3; + values[valuesById[4] = "INPUT_TYPE_BLOB"] = 4; + values[valuesById[5] = "INPUT_TYPE_TOOL_RESPONSE"] = 5; + values[valuesById[6] = "INPUT_TYPE_VARIABLES"] = 6; + return values; + })(); + + return Conversation; + })(); + + v1beta.Deployment = (function() { + + /** + * Properties of a Deployment. + * @memberof google.cloud.ces.v1beta + * @interface IDeployment + * @property {string|null} [name] Deployment name + * @property {string|null} [displayName] Deployment displayName + * @property {string|null} [appVersion] Deployment appVersion + * @property {google.cloud.ces.v1beta.IChannelProfile|null} [channelProfile] Deployment channelProfile + * @property {google.protobuf.ITimestamp|null} [createTime] Deployment createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Deployment updateTime + * @property {string|null} [etag] Deployment etag + */ + + /** + * Constructs a new Deployment. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Deployment. + * @implements IDeployment + * @constructor + * @param {google.cloud.ces.v1beta.IDeployment=} [properties] Properties to set + */ + function Deployment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Deployment name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Deployment + * @instance + */ + Deployment.prototype.name = ""; + + /** + * Deployment displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.Deployment + * @instance + */ + Deployment.prototype.displayName = ""; + + /** + * Deployment appVersion. + * @member {string} appVersion + * @memberof google.cloud.ces.v1beta.Deployment + * @instance + */ + Deployment.prototype.appVersion = ""; + + /** + * Deployment channelProfile. + * @member {google.cloud.ces.v1beta.IChannelProfile|null|undefined} channelProfile + * @memberof google.cloud.ces.v1beta.Deployment + * @instance + */ + Deployment.prototype.channelProfile = null; + + /** + * Deployment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.Deployment + * @instance + */ + Deployment.prototype.createTime = null; + + /** + * Deployment updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.Deployment + * @instance + */ + Deployment.prototype.updateTime = null; + + /** + * Deployment etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.Deployment + * @instance + */ + Deployment.prototype.etag = ""; + + /** + * Creates a new Deployment instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Deployment + * @static + * @param {google.cloud.ces.v1beta.IDeployment=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Deployment} Deployment instance + */ + Deployment.create = function create(properties) { + return new Deployment(properties); + }; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.ces.v1beta.Deployment.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Deployment + * @static + * @param {google.cloud.ces.v1beta.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appVersion); + if (message.channelProfile != null && Object.hasOwnProperty.call(message, "channelProfile")) + $root.google.cloud.ces.v1beta.ChannelProfile.encode(message.channelProfile, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + 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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Deployment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Deployment + * @static + * @param {google.cloud.ces.v1beta.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Deployment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 8: { + message.displayName = reader.string(); + break; + } + case 2: { + message.appVersion = reader.string(); + break; + } + case 3: { + message.channelProfile = $root.google.cloud.ces.v1beta.ChannelProfile.decode(reader, reader.uint32()); + 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 7: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Deployment message. + * @function verify + * @memberof google.cloud.ces.v1beta.Deployment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Deployment.verify = function verify(message) { + if (typeof message !== "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.appVersion != null && message.hasOwnProperty("appVersion")) + if (!$util.isString(message.appVersion)) + return "appVersion: string expected"; + if (message.channelProfile != null && message.hasOwnProperty("channelProfile")) { + var error = $root.google.cloud.ces.v1beta.ChannelProfile.verify(message.channelProfile); + if (error) + return "channelProfile." + error; + } + 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Deployment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Deployment} Deployment + */ + Deployment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Deployment) + return object; + var message = new $root.google.cloud.ces.v1beta.Deployment(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.appVersion != null) + message.appVersion = String(object.appVersion); + if (object.channelProfile != null) { + if (typeof object.channelProfile !== "object") + throw TypeError(".google.cloud.ces.v1beta.Deployment.channelProfile: object expected"); + message.channelProfile = $root.google.cloud.ces.v1beta.ChannelProfile.fromObject(object.channelProfile); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Deployment.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.ces.v1beta.Deployment.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Deployment + * @static + * @param {google.cloud.ces.v1beta.Deployment} message Deployment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Deployment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.appVersion = ""; + object.channelProfile = null; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + object.appVersion = message.appVersion; + if (message.channelProfile != null && message.hasOwnProperty("channelProfile")) + object.channelProfile = $root.google.cloud.ces.v1beta.ChannelProfile.toObject(message.channelProfile, options); + 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this Deployment to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Deployment + * @instance + * @returns {Object.} JSON object + */ + Deployment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Deployment + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Deployment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Deployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Deployment"; + }; + + return Deployment; + })(); + + v1beta.AggregatedMetrics = (function() { + + /** + * Properties of an AggregatedMetrics. + * @memberof google.cloud.ces.v1beta + * @interface IAggregatedMetrics + * @property {Array.|null} [metricsByAppVersion] AggregatedMetrics metricsByAppVersion + */ + + /** + * Constructs a new AggregatedMetrics. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an AggregatedMetrics. + * @implements IAggregatedMetrics + * @constructor + * @param {google.cloud.ces.v1beta.IAggregatedMetrics=} [properties] Properties to set + */ + function AggregatedMetrics(properties) { + this.metricsByAppVersion = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedMetrics metricsByAppVersion. + * @member {Array.} metricsByAppVersion + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @instance + */ + AggregatedMetrics.prototype.metricsByAppVersion = $util.emptyArray; + + /** + * Creates a new AggregatedMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @static + * @param {google.cloud.ces.v1beta.IAggregatedMetrics=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AggregatedMetrics} AggregatedMetrics instance + */ + AggregatedMetrics.create = function create(properties) { + return new AggregatedMetrics(properties); + }; + + /** + * Encodes the specified AggregatedMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @static + * @param {google.cloud.ces.v1beta.IAggregatedMetrics} message AggregatedMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metricsByAppVersion != null && message.metricsByAppVersion.length) + for (var i = 0; i < message.metricsByAppVersion.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.encode(message.metricsByAppVersion[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AggregatedMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @static + * @param {google.cloud.ces.v1beta.IAggregatedMetrics} message AggregatedMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AggregatedMetrics} AggregatedMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedMetrics.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + if (!(message.metricsByAppVersion && message.metricsByAppVersion.length)) + message.metricsByAppVersion = []; + message.metricsByAppVersion.push($root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AggregatedMetrics} AggregatedMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedMetrics message. + * @function verify + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metricsByAppVersion != null && message.hasOwnProperty("metricsByAppVersion")) { + if (!Array.isArray(message.metricsByAppVersion)) + return "metricsByAppVersion: array expected"; + for (var i = 0; i < message.metricsByAppVersion.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.verify(message.metricsByAppVersion[i]); + if (error) + return "metricsByAppVersion." + error; + } + } + return null; + }; + + /** + * Creates an AggregatedMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AggregatedMetrics} AggregatedMetrics + */ + AggregatedMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics) + return object; + var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics(); + if (object.metricsByAppVersion) { + if (!Array.isArray(object.metricsByAppVersion)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.metricsByAppVersion: array expected"); + message.metricsByAppVersion = []; + for (var i = 0; i < object.metricsByAppVersion.length; ++i) { + if (typeof object.metricsByAppVersion[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.metricsByAppVersion: object expected"); + message.metricsByAppVersion[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.fromObject(object.metricsByAppVersion[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AggregatedMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics} message AggregatedMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metricsByAppVersion = []; + if (message.metricsByAppVersion && message.metricsByAppVersion.length) { + object.metricsByAppVersion = []; + for (var j = 0; j < message.metricsByAppVersion.length; ++j) + object.metricsByAppVersion[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.toObject(message.metricsByAppVersion[j], options); + } + return object; + }; + + /** + * Converts this AggregatedMetrics to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @instance + * @returns {Object.} JSON object + */ + AggregatedMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AggregatedMetrics + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AggregatedMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics"; + }; + + AggregatedMetrics.ToolMetrics = (function() { + + /** + * Properties of a ToolMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @interface IToolMetrics + * @property {string|null} [tool] ToolMetrics tool + * @property {number|null} [passCount] ToolMetrics passCount + * @property {number|null} [failCount] ToolMetrics failCount + */ + + /** + * Constructs a new ToolMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @classdesc Represents a ToolMetrics. + * @implements IToolMetrics + * @constructor + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics=} [properties] Properties to set + */ + function ToolMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolMetrics tool. + * @member {string} tool + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @instance + */ + ToolMetrics.prototype.tool = ""; + + /** + * ToolMetrics passCount. + * @member {number} passCount + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @instance + */ + ToolMetrics.prototype.passCount = 0; + + /** + * ToolMetrics failCount. + * @member {number} failCount + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @instance + */ + ToolMetrics.prototype.failCount = 0; + + /** + * Creates a new ToolMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics} ToolMetrics instance + */ + ToolMetrics.create = function create(properties) { + return new ToolMetrics(properties); + }; + + /** + * Encodes the specified ToolMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics} message ToolMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.passCount != null && Object.hasOwnProperty.call(message, "passCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.passCount); + if (message.failCount != null && Object.hasOwnProperty.call(message, "failCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.failCount); + return writer; + }; + + /** + * Encodes the specified ToolMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics} message ToolMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics} ToolMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolMetrics.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.passCount = reader.int32(); + break; + } + case 3: { + message.failCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics} ToolMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolMetrics message. + * @function verify + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tool != null && message.hasOwnProperty("tool")) + if (!$util.isString(message.tool)) + return "tool: string expected"; + if (message.passCount != null && message.hasOwnProperty("passCount")) + if (!$util.isInteger(message.passCount)) + return "passCount: integer expected"; + if (message.failCount != null && message.hasOwnProperty("failCount")) + if (!$util.isInteger(message.failCount)) + return "failCount: integer expected"; + return null; + }; + + /** + * Creates a ToolMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics} ToolMetrics + */ + ToolMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics) + return object; + var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.passCount != null) + message.passCount = object.passCount | 0; + if (object.failCount != null) + message.failCount = object.failCount | 0; + return message; + }; + + /** + * Creates a plain object from a ToolMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics} message ToolMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = ""; + object.passCount = 0; + object.failCount = 0; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = message.tool; + if (message.passCount != null && message.hasOwnProperty("passCount")) + object.passCount = message.passCount; + if (message.failCount != null && message.hasOwnProperty("failCount")) + object.failCount = message.failCount; + return object; + }; + + /** + * Converts this ToolMetrics to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @instance + * @returns {Object.} JSON object + */ + ToolMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolMetrics + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics"; + }; + + return ToolMetrics; + })(); + + AggregatedMetrics.TurnLatencyMetrics = (function() { + + /** + * Properties of a TurnLatencyMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @interface ITurnLatencyMetrics + * @property {google.protobuf.IDuration|null} [averageLatency] TurnLatencyMetrics averageLatency + */ + + /** + * Constructs a new TurnLatencyMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @classdesc Represents a TurnLatencyMetrics. + * @implements ITurnLatencyMetrics + * @constructor + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics=} [properties] Properties to set + */ + function TurnLatencyMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TurnLatencyMetrics averageLatency. + * @member {google.protobuf.IDuration|null|undefined} averageLatency + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @instance + */ + TurnLatencyMetrics.prototype.averageLatency = null; + + /** + * Creates a new TurnLatencyMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics} TurnLatencyMetrics instance + */ + TurnLatencyMetrics.create = function create(properties) { + return new TurnLatencyMetrics(properties); + }; + + /** + * Encodes the specified TurnLatencyMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics} message TurnLatencyMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TurnLatencyMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.averageLatency != null && Object.hasOwnProperty.call(message, "averageLatency")) + $root.google.protobuf.Duration.encode(message.averageLatency, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TurnLatencyMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics} message TurnLatencyMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TurnLatencyMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TurnLatencyMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics} TurnLatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TurnLatencyMetrics.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.averageLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TurnLatencyMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics} TurnLatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TurnLatencyMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TurnLatencyMetrics message. + * @function verify + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TurnLatencyMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.averageLatency != null && message.hasOwnProperty("averageLatency")) { + var error = $root.google.protobuf.Duration.verify(message.averageLatency); + if (error) + return "averageLatency." + error; + } + return null; + }; + + /** + * Creates a TurnLatencyMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics} TurnLatencyMetrics + */ + TurnLatencyMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics) + return object; + var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics(); + if (object.averageLatency != null) { + if (typeof object.averageLatency !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.averageLatency: object expected"); + message.averageLatency = $root.google.protobuf.Duration.fromObject(object.averageLatency); + } + return message; + }; + + /** + * Creates a plain object from a TurnLatencyMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics} message TurnLatencyMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TurnLatencyMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.averageLatency = null; + if (message.averageLatency != null && message.hasOwnProperty("averageLatency")) + object.averageLatency = $root.google.protobuf.Duration.toObject(message.averageLatency, options); + return object; + }; + + /** + * Converts this TurnLatencyMetrics to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @instance + * @returns {Object.} JSON object + */ + TurnLatencyMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TurnLatencyMetrics + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TurnLatencyMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics"; + }; + + return TurnLatencyMetrics; + })(); + + AggregatedMetrics.ToolCallLatencyMetrics = (function() { + + /** + * Properties of a ToolCallLatencyMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @interface IToolCallLatencyMetrics + * @property {string|null} [tool] ToolCallLatencyMetrics tool + * @property {google.protobuf.IDuration|null} [averageLatency] ToolCallLatencyMetrics averageLatency + */ + + /** + * Constructs a new ToolCallLatencyMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @classdesc Represents a ToolCallLatencyMetrics. + * @implements IToolCallLatencyMetrics + * @constructor + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics=} [properties] Properties to set + */ + function ToolCallLatencyMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolCallLatencyMetrics tool. + * @member {string} tool + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @instance + */ + ToolCallLatencyMetrics.prototype.tool = ""; + + /** + * ToolCallLatencyMetrics averageLatency. + * @member {google.protobuf.IDuration|null|undefined} averageLatency + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @instance + */ + ToolCallLatencyMetrics.prototype.averageLatency = null; + + /** + * Creates a new ToolCallLatencyMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics} ToolCallLatencyMetrics instance + */ + ToolCallLatencyMetrics.create = function create(properties) { + return new ToolCallLatencyMetrics(properties); + }; + + /** + * Encodes the specified ToolCallLatencyMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics} message ToolCallLatencyMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCallLatencyMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.averageLatency != null && Object.hasOwnProperty.call(message, "averageLatency")) + $root.google.protobuf.Duration.encode(message.averageLatency, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolCallLatencyMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics} message ToolCallLatencyMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCallLatencyMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolCallLatencyMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics} ToolCallLatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCallLatencyMetrics.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.averageLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolCallLatencyMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics} ToolCallLatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCallLatencyMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolCallLatencyMetrics message. + * @function verify + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolCallLatencyMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tool != null && message.hasOwnProperty("tool")) + if (!$util.isString(message.tool)) + return "tool: string expected"; + if (message.averageLatency != null && message.hasOwnProperty("averageLatency")) { + var error = $root.google.protobuf.Duration.verify(message.averageLatency); + if (error) + return "averageLatency." + error; + } + return null; + }; + + /** + * Creates a ToolCallLatencyMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics} ToolCallLatencyMetrics + */ + ToolCallLatencyMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics) + return object; + var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.averageLatency != null) { + if (typeof object.averageLatency !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.averageLatency: object expected"); + message.averageLatency = $root.google.protobuf.Duration.fromObject(object.averageLatency); + } + return message; + }; + + /** + * Creates a plain object from a ToolCallLatencyMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics} message ToolCallLatencyMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolCallLatencyMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = ""; + object.averageLatency = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = message.tool; + if (message.averageLatency != null && message.hasOwnProperty("averageLatency")) + object.averageLatency = $root.google.protobuf.Duration.toObject(message.averageLatency, options); + return object; + }; + + /** + * Converts this ToolCallLatencyMetrics to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @instance + * @returns {Object.} JSON object + */ + ToolCallLatencyMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolCallLatencyMetrics + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolCallLatencyMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics"; + }; + + return ToolCallLatencyMetrics; + })(); + + AggregatedMetrics.SemanticSimilarityMetrics = (function() { + + /** + * Properties of a SemanticSimilarityMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @interface ISemanticSimilarityMetrics + * @property {number|null} [score] SemanticSimilarityMetrics score + */ + + /** + * Constructs a new SemanticSimilarityMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @classdesc Represents a SemanticSimilarityMetrics. + * @implements ISemanticSimilarityMetrics + * @constructor + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics=} [properties] Properties to set + */ + function SemanticSimilarityMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SemanticSimilarityMetrics score. + * @member {number} score + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @instance + */ + SemanticSimilarityMetrics.prototype.score = 0; + + /** + * Creates a new SemanticSimilarityMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics} SemanticSimilarityMetrics instance + */ + SemanticSimilarityMetrics.create = function create(properties) { + return new SemanticSimilarityMetrics(properties); + }; + + /** + * Encodes the specified SemanticSimilarityMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics} message SemanticSimilarityMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticSimilarityMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + return writer; + }; + + /** + * Encodes the specified SemanticSimilarityMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics} message SemanticSimilarityMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticSimilarityMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SemanticSimilarityMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics} SemanticSimilarityMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticSimilarityMetrics.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SemanticSimilarityMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics} SemanticSimilarityMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticSimilarityMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SemanticSimilarityMetrics message. + * @function verify + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SemanticSimilarityMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a SemanticSimilarityMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics} SemanticSimilarityMetrics + */ + SemanticSimilarityMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics) + return object; + var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics(); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a SemanticSimilarityMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics} message SemanticSimilarityMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SemanticSimilarityMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.score = 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this SemanticSimilarityMetrics to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @instance + * @returns {Object.} JSON object + */ + SemanticSimilarityMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SemanticSimilarityMetrics + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticSimilarityMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics"; + }; + + return SemanticSimilarityMetrics; + })(); + + AggregatedMetrics.HallucinationMetrics = (function() { + + /** + * Properties of a HallucinationMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @interface IHallucinationMetrics + * @property {number|null} [score] HallucinationMetrics score + */ + + /** + * Constructs a new HallucinationMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @classdesc Represents a HallucinationMetrics. + * @implements IHallucinationMetrics + * @constructor + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics=} [properties] Properties to set + */ + function HallucinationMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HallucinationMetrics score. + * @member {number} score + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @instance + */ + HallucinationMetrics.prototype.score = 0; + + /** + * Creates a new HallucinationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics} HallucinationMetrics instance + */ + HallucinationMetrics.create = function create(properties) { + return new HallucinationMetrics(properties); + }; + + /** + * Encodes the specified HallucinationMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics} message HallucinationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HallucinationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + return writer; + }; + + /** + * Encodes the specified HallucinationMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics} message HallucinationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HallucinationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HallucinationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics} HallucinationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HallucinationMetrics.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HallucinationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics} HallucinationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HallucinationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HallucinationMetrics message. + * @function verify + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HallucinationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a HallucinationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics} HallucinationMetrics + */ + HallucinationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics) + return object; + var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics(); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a HallucinationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics} message HallucinationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HallucinationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.score = 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this HallucinationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @instance + * @returns {Object.} JSON object + */ + HallucinationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HallucinationMetrics + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HallucinationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics"; + }; + + return HallucinationMetrics; + })(); + + AggregatedMetrics.MetricsByAppVersion = (function() { + + /** + * Properties of a MetricsByAppVersion. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @interface IMetricsByAppVersion + * @property {string|null} [appVersionId] MetricsByAppVersion appVersionId + * @property {Array.|null} [toolMetrics] MetricsByAppVersion toolMetrics + * @property {Array.|null} [semanticSimilarityMetrics] MetricsByAppVersion semanticSimilarityMetrics + * @property {Array.|null} [hallucinationMetrics] MetricsByAppVersion hallucinationMetrics + * @property {Array.|null} [toolCallLatencyMetrics] MetricsByAppVersion toolCallLatencyMetrics + * @property {Array.|null} [turnLatencyMetrics] MetricsByAppVersion turnLatencyMetrics + * @property {number|null} [passCount] MetricsByAppVersion passCount + * @property {number|null} [failCount] MetricsByAppVersion failCount + * @property {Array.|null} [metricsByTurn] MetricsByAppVersion metricsByTurn + */ + + /** + * Constructs a new MetricsByAppVersion. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @classdesc Represents a MetricsByAppVersion. + * @implements IMetricsByAppVersion + * @constructor + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion=} [properties] Properties to set + */ + function MetricsByAppVersion(properties) { + this.toolMetrics = []; + this.semanticSimilarityMetrics = []; + this.hallucinationMetrics = []; + this.toolCallLatencyMetrics = []; + this.turnLatencyMetrics = []; + this.metricsByTurn = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricsByAppVersion appVersionId. + * @member {string} appVersionId + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + */ + MetricsByAppVersion.prototype.appVersionId = ""; + + /** + * MetricsByAppVersion toolMetrics. + * @member {Array.} toolMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + */ + MetricsByAppVersion.prototype.toolMetrics = $util.emptyArray; + + /** + * MetricsByAppVersion semanticSimilarityMetrics. + * @member {Array.} semanticSimilarityMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + */ + MetricsByAppVersion.prototype.semanticSimilarityMetrics = $util.emptyArray; + + /** + * MetricsByAppVersion hallucinationMetrics. + * @member {Array.} hallucinationMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + */ + MetricsByAppVersion.prototype.hallucinationMetrics = $util.emptyArray; + + /** + * MetricsByAppVersion toolCallLatencyMetrics. + * @member {Array.} toolCallLatencyMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + */ + MetricsByAppVersion.prototype.toolCallLatencyMetrics = $util.emptyArray; + + /** + * MetricsByAppVersion turnLatencyMetrics. + * @member {Array.} turnLatencyMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + */ + MetricsByAppVersion.prototype.turnLatencyMetrics = $util.emptyArray; + + /** + * MetricsByAppVersion passCount. + * @member {number} passCount + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + */ + MetricsByAppVersion.prototype.passCount = 0; + + /** + * MetricsByAppVersion failCount. + * @member {number} failCount + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + */ + MetricsByAppVersion.prototype.failCount = 0; + + /** + * MetricsByAppVersion metricsByTurn. + * @member {Array.} metricsByTurn + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + */ + MetricsByAppVersion.prototype.metricsByTurn = $util.emptyArray; + + /** + * Creates a new MetricsByAppVersion instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion} MetricsByAppVersion instance + */ + MetricsByAppVersion.create = function create(properties) { + return new MetricsByAppVersion(properties); + }; + + /** + * Encodes the specified MetricsByAppVersion message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion} message MetricsByAppVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricsByAppVersion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appVersionId != null && Object.hasOwnProperty.call(message, "appVersionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.appVersionId); + if (message.toolMetrics != null && message.toolMetrics.length) + for (var i = 0; i < message.toolMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.encode(message.toolMetrics[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.semanticSimilarityMetrics != null && message.semanticSimilarityMetrics.length) + for (var i = 0; i < message.semanticSimilarityMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.encode(message.semanticSimilarityMetrics[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.metricsByTurn != null && message.metricsByTurn.length) + for (var i = 0; i < message.metricsByTurn.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.encode(message.metricsByTurn[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.hallucinationMetrics != null && message.hallucinationMetrics.length) + for (var i = 0; i < message.hallucinationMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.encode(message.hallucinationMetrics[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.toolCallLatencyMetrics != null && message.toolCallLatencyMetrics.length) + for (var i = 0; i < message.toolCallLatencyMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.encode(message.toolCallLatencyMetrics[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.turnLatencyMetrics != null && message.turnLatencyMetrics.length) + for (var i = 0; i < message.turnLatencyMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.encode(message.turnLatencyMetrics[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.passCount != null && Object.hasOwnProperty.call(message, "passCount")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.passCount); + if (message.failCount != null && Object.hasOwnProperty.call(message, "failCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.failCount); + return writer; + }; + + /** + * Encodes the specified MetricsByAppVersion message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion} message MetricsByAppVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricsByAppVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricsByAppVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion} MetricsByAppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricsByAppVersion.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.appVersionId = reader.string(); + break; + } + case 2: { + if (!(message.toolMetrics && message.toolMetrics.length)) + message.toolMetrics = []; + message.toolMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.semanticSimilarityMetrics && message.semanticSimilarityMetrics.length)) + message.semanticSimilarityMetrics = []; + message.semanticSimilarityMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.hallucinationMetrics && message.hallucinationMetrics.length)) + message.hallucinationMetrics = []; + message.hallucinationMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.toolCallLatencyMetrics && message.toolCallLatencyMetrics.length)) + message.toolCallLatencyMetrics = []; + message.toolCallLatencyMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.turnLatencyMetrics && message.turnLatencyMetrics.length)) + message.turnLatencyMetrics = []; + message.turnLatencyMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.decode(reader, reader.uint32())); + break; + } + case 8: { + message.passCount = reader.int32(); + break; + } + case 9: { + message.failCount = reader.int32(); + break; + } + case 4: { + if (!(message.metricsByTurn && message.metricsByTurn.length)) + message.metricsByTurn = []; + message.metricsByTurn.push($root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricsByAppVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion} MetricsByAppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricsByAppVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricsByAppVersion message. + * @function verify + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricsByAppVersion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.appVersionId != null && message.hasOwnProperty("appVersionId")) + if (!$util.isString(message.appVersionId)) + return "appVersionId: string expected"; + if (message.toolMetrics != null && message.hasOwnProperty("toolMetrics")) { + if (!Array.isArray(message.toolMetrics)) + return "toolMetrics: array expected"; + for (var i = 0; i < message.toolMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.verify(message.toolMetrics[i]); + if (error) + return "toolMetrics." + error; + } + } + if (message.semanticSimilarityMetrics != null && message.hasOwnProperty("semanticSimilarityMetrics")) { + if (!Array.isArray(message.semanticSimilarityMetrics)) + return "semanticSimilarityMetrics: array expected"; + for (var i = 0; i < message.semanticSimilarityMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.verify(message.semanticSimilarityMetrics[i]); + if (error) + return "semanticSimilarityMetrics." + error; + } + } + if (message.hallucinationMetrics != null && message.hasOwnProperty("hallucinationMetrics")) { + if (!Array.isArray(message.hallucinationMetrics)) + return "hallucinationMetrics: array expected"; + for (var i = 0; i < message.hallucinationMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.verify(message.hallucinationMetrics[i]); + if (error) + return "hallucinationMetrics." + error; + } + } + if (message.toolCallLatencyMetrics != null && message.hasOwnProperty("toolCallLatencyMetrics")) { + if (!Array.isArray(message.toolCallLatencyMetrics)) + return "toolCallLatencyMetrics: array expected"; + for (var i = 0; i < message.toolCallLatencyMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.verify(message.toolCallLatencyMetrics[i]); + if (error) + return "toolCallLatencyMetrics." + error; + } + } + if (message.turnLatencyMetrics != null && message.hasOwnProperty("turnLatencyMetrics")) { + if (!Array.isArray(message.turnLatencyMetrics)) + return "turnLatencyMetrics: array expected"; + for (var i = 0; i < message.turnLatencyMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.verify(message.turnLatencyMetrics[i]); + if (error) + return "turnLatencyMetrics." + error; + } + } + if (message.passCount != null && message.hasOwnProperty("passCount")) + if (!$util.isInteger(message.passCount)) + return "passCount: integer expected"; + if (message.failCount != null && message.hasOwnProperty("failCount")) + if (!$util.isInteger(message.failCount)) + return "failCount: integer expected"; + if (message.metricsByTurn != null && message.hasOwnProperty("metricsByTurn")) { + if (!Array.isArray(message.metricsByTurn)) + return "metricsByTurn: array expected"; + for (var i = 0; i < message.metricsByTurn.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.verify(message.metricsByTurn[i]); + if (error) + return "metricsByTurn." + error; + } + } + return null; + }; + + /** + * Creates a MetricsByAppVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion} MetricsByAppVersion + */ + MetricsByAppVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion) + return object; + var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion(); + if (object.appVersionId != null) + message.appVersionId = String(object.appVersionId); + if (object.toolMetrics) { + if (!Array.isArray(object.toolMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.toolMetrics: array expected"); + message.toolMetrics = []; + for (var i = 0; i < object.toolMetrics.length; ++i) { + if (typeof object.toolMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.toolMetrics: object expected"); + message.toolMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.fromObject(object.toolMetrics[i]); + } + } + if (object.semanticSimilarityMetrics) { + if (!Array.isArray(object.semanticSimilarityMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.semanticSimilarityMetrics: array expected"); + message.semanticSimilarityMetrics = []; + for (var i = 0; i < object.semanticSimilarityMetrics.length; ++i) { + if (typeof object.semanticSimilarityMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.semanticSimilarityMetrics: object expected"); + message.semanticSimilarityMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.fromObject(object.semanticSimilarityMetrics[i]); + } + } + if (object.hallucinationMetrics) { + if (!Array.isArray(object.hallucinationMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.hallucinationMetrics: array expected"); + message.hallucinationMetrics = []; + for (var i = 0; i < object.hallucinationMetrics.length; ++i) { + if (typeof object.hallucinationMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.hallucinationMetrics: object expected"); + message.hallucinationMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.fromObject(object.hallucinationMetrics[i]); + } + } + if (object.toolCallLatencyMetrics) { + if (!Array.isArray(object.toolCallLatencyMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.toolCallLatencyMetrics: array expected"); + message.toolCallLatencyMetrics = []; + for (var i = 0; i < object.toolCallLatencyMetrics.length; ++i) { + if (typeof object.toolCallLatencyMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.toolCallLatencyMetrics: object expected"); + message.toolCallLatencyMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.fromObject(object.toolCallLatencyMetrics[i]); + } + } + if (object.turnLatencyMetrics) { + if (!Array.isArray(object.turnLatencyMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.turnLatencyMetrics: array expected"); + message.turnLatencyMetrics = []; + for (var i = 0; i < object.turnLatencyMetrics.length; ++i) { + if (typeof object.turnLatencyMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.turnLatencyMetrics: object expected"); + message.turnLatencyMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.fromObject(object.turnLatencyMetrics[i]); + } + } + if (object.passCount != null) + message.passCount = object.passCount | 0; + if (object.failCount != null) + message.failCount = object.failCount | 0; + if (object.metricsByTurn) { + if (!Array.isArray(object.metricsByTurn)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.metricsByTurn: array expected"); + message.metricsByTurn = []; + for (var i = 0; i < object.metricsByTurn.length; ++i) { + if (typeof object.metricsByTurn[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.metricsByTurn: object expected"); + message.metricsByTurn[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.fromObject(object.metricsByTurn[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MetricsByAppVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion} message MetricsByAppVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricsByAppVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.toolMetrics = []; + object.semanticSimilarityMetrics = []; + object.metricsByTurn = []; + object.hallucinationMetrics = []; + object.toolCallLatencyMetrics = []; + object.turnLatencyMetrics = []; + } + if (options.defaults) { + object.appVersionId = ""; + object.passCount = 0; + object.failCount = 0; + } + if (message.appVersionId != null && message.hasOwnProperty("appVersionId")) + object.appVersionId = message.appVersionId; + if (message.toolMetrics && message.toolMetrics.length) { + object.toolMetrics = []; + for (var j = 0; j < message.toolMetrics.length; ++j) + object.toolMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.toObject(message.toolMetrics[j], options); + } + if (message.semanticSimilarityMetrics && message.semanticSimilarityMetrics.length) { + object.semanticSimilarityMetrics = []; + for (var j = 0; j < message.semanticSimilarityMetrics.length; ++j) + object.semanticSimilarityMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.toObject(message.semanticSimilarityMetrics[j], options); + } + if (message.metricsByTurn && message.metricsByTurn.length) { + object.metricsByTurn = []; + for (var j = 0; j < message.metricsByTurn.length; ++j) + object.metricsByTurn[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.toObject(message.metricsByTurn[j], options); + } + if (message.hallucinationMetrics && message.hallucinationMetrics.length) { + object.hallucinationMetrics = []; + for (var j = 0; j < message.hallucinationMetrics.length; ++j) + object.hallucinationMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.toObject(message.hallucinationMetrics[j], options); + } + if (message.toolCallLatencyMetrics && message.toolCallLatencyMetrics.length) { + object.toolCallLatencyMetrics = []; + for (var j = 0; j < message.toolCallLatencyMetrics.length; ++j) + object.toolCallLatencyMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.toObject(message.toolCallLatencyMetrics[j], options); + } + if (message.turnLatencyMetrics && message.turnLatencyMetrics.length) { + object.turnLatencyMetrics = []; + for (var j = 0; j < message.turnLatencyMetrics.length; ++j) + object.turnLatencyMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.toObject(message.turnLatencyMetrics[j], options); + } + if (message.passCount != null && message.hasOwnProperty("passCount")) + object.passCount = message.passCount; + if (message.failCount != null && message.hasOwnProperty("failCount")) + object.failCount = message.failCount; + return object; + }; + + /** + * Converts this MetricsByAppVersion to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + * @returns {Object.} JSON object + */ + MetricsByAppVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricsByAppVersion + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricsByAppVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion"; + }; + + return MetricsByAppVersion; + })(); + + AggregatedMetrics.MetricsByTurn = (function() { + + /** + * Properties of a MetricsByTurn. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @interface IMetricsByTurn + * @property {number|null} [turnIndex] MetricsByTurn turnIndex + * @property {Array.|null} [toolMetrics] MetricsByTurn toolMetrics + * @property {Array.|null} [semanticSimilarityMetrics] MetricsByTurn semanticSimilarityMetrics + * @property {Array.|null} [hallucinationMetrics] MetricsByTurn hallucinationMetrics + * @property {Array.|null} [toolCallLatencyMetrics] MetricsByTurn toolCallLatencyMetrics + * @property {Array.|null} [turnLatencyMetrics] MetricsByTurn turnLatencyMetrics + */ + + /** + * Constructs a new MetricsByTurn. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @classdesc Represents a MetricsByTurn. + * @implements IMetricsByTurn + * @constructor + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn=} [properties] Properties to set + */ + function MetricsByTurn(properties) { + this.toolMetrics = []; + this.semanticSimilarityMetrics = []; + this.hallucinationMetrics = []; + this.toolCallLatencyMetrics = []; + this.turnLatencyMetrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricsByTurn turnIndex. + * @member {number} turnIndex + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @instance + */ + MetricsByTurn.prototype.turnIndex = 0; + + /** + * MetricsByTurn toolMetrics. + * @member {Array.} toolMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @instance + */ + MetricsByTurn.prototype.toolMetrics = $util.emptyArray; + + /** + * MetricsByTurn semanticSimilarityMetrics. + * @member {Array.} semanticSimilarityMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @instance + */ + MetricsByTurn.prototype.semanticSimilarityMetrics = $util.emptyArray; + + /** + * MetricsByTurn hallucinationMetrics. + * @member {Array.} hallucinationMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @instance + */ + MetricsByTurn.prototype.hallucinationMetrics = $util.emptyArray; + + /** + * MetricsByTurn toolCallLatencyMetrics. + * @member {Array.} toolCallLatencyMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @instance + */ + MetricsByTurn.prototype.toolCallLatencyMetrics = $util.emptyArray; + + /** + * MetricsByTurn turnLatencyMetrics. + * @member {Array.} turnLatencyMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @instance + */ + MetricsByTurn.prototype.turnLatencyMetrics = $util.emptyArray; + + /** + * Creates a new MetricsByTurn instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn} MetricsByTurn instance + */ + MetricsByTurn.create = function create(properties) { + return new MetricsByTurn(properties); + }; + + /** + * Encodes the specified MetricsByTurn message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn} message MetricsByTurn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricsByTurn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.turnIndex != null && Object.hasOwnProperty.call(message, "turnIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.turnIndex); + if (message.toolMetrics != null && message.toolMetrics.length) + for (var i = 0; i < message.toolMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.encode(message.toolMetrics[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.semanticSimilarityMetrics != null && message.semanticSimilarityMetrics.length) + for (var i = 0; i < message.semanticSimilarityMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.encode(message.semanticSimilarityMetrics[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.hallucinationMetrics != null && message.hallucinationMetrics.length) + for (var i = 0; i < message.hallucinationMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.encode(message.hallucinationMetrics[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.toolCallLatencyMetrics != null && message.toolCallLatencyMetrics.length) + for (var i = 0; i < message.toolCallLatencyMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.encode(message.toolCallLatencyMetrics[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.turnLatencyMetrics != null && message.turnLatencyMetrics.length) + for (var i = 0; i < message.turnLatencyMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.encode(message.turnLatencyMetrics[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MetricsByTurn message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn} message MetricsByTurn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricsByTurn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricsByTurn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn} MetricsByTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricsByTurn.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.turnIndex = reader.int32(); + break; + } + case 2: { + if (!(message.toolMetrics && message.toolMetrics.length)) + message.toolMetrics = []; + message.toolMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.semanticSimilarityMetrics && message.semanticSimilarityMetrics.length)) + message.semanticSimilarityMetrics = []; + message.semanticSimilarityMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.hallucinationMetrics && message.hallucinationMetrics.length)) + message.hallucinationMetrics = []; + message.hallucinationMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.toolCallLatencyMetrics && message.toolCallLatencyMetrics.length)) + message.toolCallLatencyMetrics = []; + message.toolCallLatencyMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.turnLatencyMetrics && message.turnLatencyMetrics.length)) + message.turnLatencyMetrics = []; + message.turnLatencyMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricsByTurn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn} MetricsByTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricsByTurn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricsByTurn message. + * @function verify + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricsByTurn.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.turnIndex != null && message.hasOwnProperty("turnIndex")) + if (!$util.isInteger(message.turnIndex)) + return "turnIndex: integer expected"; + if (message.toolMetrics != null && message.hasOwnProperty("toolMetrics")) { + if (!Array.isArray(message.toolMetrics)) + return "toolMetrics: array expected"; + for (var i = 0; i < message.toolMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.verify(message.toolMetrics[i]); + if (error) + return "toolMetrics." + error; + } + } + if (message.semanticSimilarityMetrics != null && message.hasOwnProperty("semanticSimilarityMetrics")) { + if (!Array.isArray(message.semanticSimilarityMetrics)) + return "semanticSimilarityMetrics: array expected"; + for (var i = 0; i < message.semanticSimilarityMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.verify(message.semanticSimilarityMetrics[i]); + if (error) + return "semanticSimilarityMetrics." + error; + } + } + if (message.hallucinationMetrics != null && message.hasOwnProperty("hallucinationMetrics")) { + if (!Array.isArray(message.hallucinationMetrics)) + return "hallucinationMetrics: array expected"; + for (var i = 0; i < message.hallucinationMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.verify(message.hallucinationMetrics[i]); + if (error) + return "hallucinationMetrics." + error; + } + } + if (message.toolCallLatencyMetrics != null && message.hasOwnProperty("toolCallLatencyMetrics")) { + if (!Array.isArray(message.toolCallLatencyMetrics)) + return "toolCallLatencyMetrics: array expected"; + for (var i = 0; i < message.toolCallLatencyMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.verify(message.toolCallLatencyMetrics[i]); + if (error) + return "toolCallLatencyMetrics." + error; + } + } + if (message.turnLatencyMetrics != null && message.hasOwnProperty("turnLatencyMetrics")) { + if (!Array.isArray(message.turnLatencyMetrics)) + return "turnLatencyMetrics: array expected"; + for (var i = 0; i < message.turnLatencyMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.verify(message.turnLatencyMetrics[i]); + if (error) + return "turnLatencyMetrics." + error; + } + } + return null; + }; + + /** + * Creates a MetricsByTurn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn} MetricsByTurn + */ + MetricsByTurn.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn) + return object; + var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn(); + if (object.turnIndex != null) + message.turnIndex = object.turnIndex | 0; + if (object.toolMetrics) { + if (!Array.isArray(object.toolMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.toolMetrics: array expected"); + message.toolMetrics = []; + for (var i = 0; i < object.toolMetrics.length; ++i) { + if (typeof object.toolMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.toolMetrics: object expected"); + message.toolMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.fromObject(object.toolMetrics[i]); + } + } + if (object.semanticSimilarityMetrics) { + if (!Array.isArray(object.semanticSimilarityMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.semanticSimilarityMetrics: array expected"); + message.semanticSimilarityMetrics = []; + for (var i = 0; i < object.semanticSimilarityMetrics.length; ++i) { + if (typeof object.semanticSimilarityMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.semanticSimilarityMetrics: object expected"); + message.semanticSimilarityMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.fromObject(object.semanticSimilarityMetrics[i]); + } + } + if (object.hallucinationMetrics) { + if (!Array.isArray(object.hallucinationMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.hallucinationMetrics: array expected"); + message.hallucinationMetrics = []; + for (var i = 0; i < object.hallucinationMetrics.length; ++i) { + if (typeof object.hallucinationMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.hallucinationMetrics: object expected"); + message.hallucinationMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.fromObject(object.hallucinationMetrics[i]); + } + } + if (object.toolCallLatencyMetrics) { + if (!Array.isArray(object.toolCallLatencyMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.toolCallLatencyMetrics: array expected"); + message.toolCallLatencyMetrics = []; + for (var i = 0; i < object.toolCallLatencyMetrics.length; ++i) { + if (typeof object.toolCallLatencyMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.toolCallLatencyMetrics: object expected"); + message.toolCallLatencyMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.fromObject(object.toolCallLatencyMetrics[i]); + } + } + if (object.turnLatencyMetrics) { + if (!Array.isArray(object.turnLatencyMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.turnLatencyMetrics: array expected"); + message.turnLatencyMetrics = []; + for (var i = 0; i < object.turnLatencyMetrics.length; ++i) { + if (typeof object.turnLatencyMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.turnLatencyMetrics: object expected"); + message.turnLatencyMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.fromObject(object.turnLatencyMetrics[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MetricsByTurn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn} message MetricsByTurn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricsByTurn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.toolMetrics = []; + object.semanticSimilarityMetrics = []; + object.hallucinationMetrics = []; + object.toolCallLatencyMetrics = []; + object.turnLatencyMetrics = []; + } + if (options.defaults) + object.turnIndex = 0; + if (message.turnIndex != null && message.hasOwnProperty("turnIndex")) + object.turnIndex = message.turnIndex; + if (message.toolMetrics && message.toolMetrics.length) { + object.toolMetrics = []; + for (var j = 0; j < message.toolMetrics.length; ++j) + object.toolMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.toObject(message.toolMetrics[j], options); + } + if (message.semanticSimilarityMetrics && message.semanticSimilarityMetrics.length) { + object.semanticSimilarityMetrics = []; + for (var j = 0; j < message.semanticSimilarityMetrics.length; ++j) + object.semanticSimilarityMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.toObject(message.semanticSimilarityMetrics[j], options); + } + if (message.hallucinationMetrics && message.hallucinationMetrics.length) { + object.hallucinationMetrics = []; + for (var j = 0; j < message.hallucinationMetrics.length; ++j) + object.hallucinationMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.toObject(message.hallucinationMetrics[j], options); + } + if (message.toolCallLatencyMetrics && message.toolCallLatencyMetrics.length) { + object.toolCallLatencyMetrics = []; + for (var j = 0; j < message.toolCallLatencyMetrics.length; ++j) + object.toolCallLatencyMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.toObject(message.toolCallLatencyMetrics[j], options); + } + if (message.turnLatencyMetrics && message.turnLatencyMetrics.length) { + object.turnLatencyMetrics = []; + for (var j = 0; j < message.turnLatencyMetrics.length; ++j) + object.turnLatencyMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.toObject(message.turnLatencyMetrics[j], options); + } + return object; + }; + + /** + * Converts this MetricsByTurn to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @instance + * @returns {Object.} JSON object + */ + MetricsByTurn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricsByTurn + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricsByTurn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn"; + }; + + return MetricsByTurn; + })(); + + return AggregatedMetrics; + })(); + + v1beta.Evaluation = (function() { + + /** + * Properties of an Evaluation. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluation + * @property {google.cloud.ces.v1beta.Evaluation.IGolden|null} [golden] Evaluation golden + * @property {google.cloud.ces.v1beta.Evaluation.IScenario|null} [scenario] Evaluation scenario + * @property {string|null} [name] Evaluation name + * @property {string|null} [displayName] Evaluation displayName + * @property {string|null} [description] Evaluation description + * @property {Array.|null} [tags] Evaluation tags + * @property {Array.|null} [evaluationDatasets] Evaluation evaluationDatasets + * @property {google.protobuf.ITimestamp|null} [createTime] Evaluation createTime + * @property {string|null} [createdBy] Evaluation createdBy + * @property {google.protobuf.ITimestamp|null} [updateTime] Evaluation updateTime + * @property {string|null} [lastUpdatedBy] Evaluation lastUpdatedBy + * @property {Array.|null} [evaluationRuns] Evaluation evaluationRuns + * @property {string|null} [etag] Evaluation etag + * @property {google.cloud.ces.v1beta.IAggregatedMetrics|null} [aggregatedMetrics] Evaluation aggregatedMetrics + * @property {google.cloud.ces.v1beta.IEvaluationResult|null} [lastCompletedResult] Evaluation lastCompletedResult + * @property {boolean|null} [invalid] Evaluation invalid + * @property {Array.|null} [lastTenResults] Evaluation lastTenResults + */ + + /** + * Constructs a new Evaluation. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an Evaluation. + * @implements IEvaluation + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluation=} [properties] Properties to set + */ + function Evaluation(properties) { + this.tags = []; + this.evaluationDatasets = []; + this.evaluationRuns = []; + this.lastTenResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Evaluation golden. + * @member {google.cloud.ces.v1beta.Evaluation.IGolden|null|undefined} golden + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.golden = null; + + /** + * Evaluation scenario. + * @member {google.cloud.ces.v1beta.Evaluation.IScenario|null|undefined} scenario + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.scenario = null; + + /** + * Evaluation name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.name = ""; + + /** + * Evaluation displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.displayName = ""; + + /** + * Evaluation description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.description = ""; + + /** + * Evaluation tags. + * @member {Array.} tags + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.tags = $util.emptyArray; + + /** + * Evaluation evaluationDatasets. + * @member {Array.} evaluationDatasets + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.evaluationDatasets = $util.emptyArray; + + /** + * Evaluation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.createTime = null; + + /** + * Evaluation createdBy. + * @member {string} createdBy + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.createdBy = ""; + + /** + * Evaluation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.updateTime = null; + + /** + * Evaluation lastUpdatedBy. + * @member {string} lastUpdatedBy + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.lastUpdatedBy = ""; + + /** + * Evaluation evaluationRuns. + * @member {Array.} evaluationRuns + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.evaluationRuns = $util.emptyArray; + + /** + * Evaluation etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.etag = ""; + + /** + * Evaluation aggregatedMetrics. + * @member {google.cloud.ces.v1beta.IAggregatedMetrics|null|undefined} aggregatedMetrics + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.aggregatedMetrics = null; + + /** + * Evaluation lastCompletedResult. + * @member {google.cloud.ces.v1beta.IEvaluationResult|null|undefined} lastCompletedResult + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.lastCompletedResult = null; + + /** + * Evaluation invalid. + * @member {boolean} invalid + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.invalid = false; + + /** + * Evaluation lastTenResults. + * @member {Array.} lastTenResults + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.lastTenResults = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Evaluation inputs. + * @member {"golden"|"scenario"|undefined} inputs + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Object.defineProperty(Evaluation.prototype, "inputs", { + get: $util.oneOfGetter($oneOfFields = ["golden", "scenario"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Evaluation instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Evaluation + * @static + * @param {google.cloud.ces.v1beta.IEvaluation=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Evaluation} Evaluation instance + */ + Evaluation.create = function create(properties) { + return new Evaluation(properties); + }; + + /** + * Encodes the specified Evaluation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Evaluation + * @static + * @param {google.cloud.ces.v1beta.IEvaluation} message Evaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evaluation.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tags[i]); + if (message.evaluationDatasets != null && message.evaluationDatasets.length) + for (var i = 0; i < message.evaluationDatasets.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.evaluationDatasets[i]); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.etag); + if (message.golden != null && Object.hasOwnProperty.call(message, "golden")) + $root.google.cloud.ces.v1beta.Evaluation.Golden.encode(message.golden, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.scenario != null && Object.hasOwnProperty.call(message, "scenario")) + $root.google.cloud.ces.v1beta.Evaluation.Scenario.encode(message.scenario, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.createdBy != null && Object.hasOwnProperty.call(message, "createdBy")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.createdBy); + if (message.lastUpdatedBy != null && Object.hasOwnProperty.call(message, "lastUpdatedBy")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.lastUpdatedBy); + if (message.evaluationRuns != null && message.evaluationRuns.length) + for (var i = 0; i < message.evaluationRuns.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.evaluationRuns[i]); + if (message.aggregatedMetrics != null && Object.hasOwnProperty.call(message, "aggregatedMetrics")) + $root.google.cloud.ces.v1beta.AggregatedMetrics.encode(message.aggregatedMetrics, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.lastCompletedResult != null && Object.hasOwnProperty.call(message, "lastCompletedResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.encode(message.lastCompletedResult, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.invalid != null && Object.hasOwnProperty.call(message, "invalid")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.invalid); + if (message.lastTenResults != null && message.lastTenResults.length) + for (var i = 0; i < message.lastTenResults.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.encode(message.lastTenResults[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Evaluation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation + * @static + * @param {google.cloud.ces.v1beta.IEvaluation} message Evaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evaluation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Evaluation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Evaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Evaluation} Evaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evaluation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 11: { + message.golden = $root.google.cloud.ces.v1beta.Evaluation.Golden.decode(reader, reader.uint32()); + break; + } + case 12: { + message.scenario = $root.google.cloud.ces.v1beta.Evaluation.Scenario.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + case 5: { + if (!(message.evaluationDatasets && message.evaluationDatasets.length)) + message.evaluationDatasets = []; + message.evaluationDatasets.push(reader.string()); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.createdBy = reader.string(); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.lastUpdatedBy = reader.string(); + break; + } + case 15: { + if (!(message.evaluationRuns && message.evaluationRuns.length)) + message.evaluationRuns = []; + message.evaluationRuns.push(reader.string()); + break; + } + case 10: { + message.etag = reader.string(); + break; + } + case 16: { + message.aggregatedMetrics = $root.google.cloud.ces.v1beta.AggregatedMetrics.decode(reader, reader.uint32()); + break; + } + case 17: { + message.lastCompletedResult = $root.google.cloud.ces.v1beta.EvaluationResult.decode(reader, reader.uint32()); + break; + } + case 18: { + message.invalid = reader.bool(); + break; + } + case 19: { + if (!(message.lastTenResults && message.lastTenResults.length)) + message.lastTenResults = []; + message.lastTenResults.push($root.google.cloud.ces.v1beta.EvaluationResult.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Evaluation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Evaluation} Evaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evaluation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Evaluation message. + * @function verify + * @memberof google.cloud.ces.v1beta.Evaluation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Evaluation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.golden != null && message.hasOwnProperty("golden")) { + properties.inputs = 1; + { + var error = $root.google.cloud.ces.v1beta.Evaluation.Golden.verify(message.golden); + if (error) + return "golden." + error; + } + } + if (message.scenario != null && message.hasOwnProperty("scenario")) { + if (properties.inputs === 1) + return "inputs: multiple values"; + properties.inputs = 1; + { + var error = $root.google.cloud.ces.v1beta.Evaluation.Scenario.verify(message.scenario); + if (error) + return "scenario." + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + if (message.evaluationDatasets != null && message.hasOwnProperty("evaluationDatasets")) { + if (!Array.isArray(message.evaluationDatasets)) + return "evaluationDatasets: array expected"; + for (var i = 0; i < message.evaluationDatasets.length; ++i) + if (!$util.isString(message.evaluationDatasets[i])) + return "evaluationDatasets: 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.createdBy != null && message.hasOwnProperty("createdBy")) + if (!$util.isString(message.createdBy)) + return "createdBy: string expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.lastUpdatedBy != null && message.hasOwnProperty("lastUpdatedBy")) + if (!$util.isString(message.lastUpdatedBy)) + return "lastUpdatedBy: string expected"; + if (message.evaluationRuns != null && message.hasOwnProperty("evaluationRuns")) { + if (!Array.isArray(message.evaluationRuns)) + return "evaluationRuns: array expected"; + for (var i = 0; i < message.evaluationRuns.length; ++i) + if (!$util.isString(message.evaluationRuns[i])) + return "evaluationRuns: string[] expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.aggregatedMetrics != null && message.hasOwnProperty("aggregatedMetrics")) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.verify(message.aggregatedMetrics); + if (error) + return "aggregatedMetrics." + error; + } + if (message.lastCompletedResult != null && message.hasOwnProperty("lastCompletedResult")) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.verify(message.lastCompletedResult); + if (error) + return "lastCompletedResult." + error; + } + if (message.invalid != null && message.hasOwnProperty("invalid")) + if (typeof message.invalid !== "boolean") + return "invalid: boolean expected"; + if (message.lastTenResults != null && message.hasOwnProperty("lastTenResults")) { + if (!Array.isArray(message.lastTenResults)) + return "lastTenResults: array expected"; + for (var i = 0; i < message.lastTenResults.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.verify(message.lastTenResults[i]); + if (error) + return "lastTenResults." + error; + } + } + return null; + }; + + /** + * Creates an Evaluation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Evaluation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Evaluation} Evaluation + */ + Evaluation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Evaluation) + return object; + var message = new $root.google.cloud.ces.v1beta.Evaluation(); + if (object.golden != null) { + if (typeof object.golden !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.golden: object expected"); + message.golden = $root.google.cloud.ces.v1beta.Evaluation.Golden.fromObject(object.golden); + } + if (object.scenario != null) { + if (typeof object.scenario !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.scenario: object expected"); + message.scenario = $root.google.cloud.ces.v1beta.Evaluation.Scenario.fromObject(object.scenario); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.evaluationDatasets) { + if (!Array.isArray(object.evaluationDatasets)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.evaluationDatasets: array expected"); + message.evaluationDatasets = []; + for (var i = 0; i < object.evaluationDatasets.length; ++i) + message.evaluationDatasets[i] = String(object.evaluationDatasets[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.createdBy != null) + message.createdBy = String(object.createdBy); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.lastUpdatedBy != null) + message.lastUpdatedBy = String(object.lastUpdatedBy); + if (object.evaluationRuns) { + if (!Array.isArray(object.evaluationRuns)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.evaluationRuns: array expected"); + message.evaluationRuns = []; + for (var i = 0; i < object.evaluationRuns.length; ++i) + message.evaluationRuns[i] = String(object.evaluationRuns[i]); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.aggregatedMetrics != null) { + if (typeof object.aggregatedMetrics !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.aggregatedMetrics: object expected"); + message.aggregatedMetrics = $root.google.cloud.ces.v1beta.AggregatedMetrics.fromObject(object.aggregatedMetrics); + } + if (object.lastCompletedResult != null) { + if (typeof object.lastCompletedResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.lastCompletedResult: object expected"); + message.lastCompletedResult = $root.google.cloud.ces.v1beta.EvaluationResult.fromObject(object.lastCompletedResult); + } + if (object.invalid != null) + message.invalid = Boolean(object.invalid); + if (object.lastTenResults) { + if (!Array.isArray(object.lastTenResults)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.lastTenResults: array expected"); + message.lastTenResults = []; + for (var i = 0; i < object.lastTenResults.length; ++i) { + if (typeof object.lastTenResults[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.lastTenResults: object expected"); + message.lastTenResults[i] = $root.google.cloud.ces.v1beta.EvaluationResult.fromObject(object.lastTenResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Evaluation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Evaluation + * @static + * @param {google.cloud.ces.v1beta.Evaluation} message Evaluation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Evaluation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tags = []; + object.evaluationDatasets = []; + object.evaluationRuns = []; + object.lastTenResults = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.createdBy = ""; + object.lastUpdatedBy = ""; + object.aggregatedMetrics = null; + object.lastCompletedResult = null; + object.invalid = 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.evaluationDatasets && message.evaluationDatasets.length) { + object.evaluationDatasets = []; + for (var j = 0; j < message.evaluationDatasets.length; ++j) + object.evaluationDatasets[j] = message.evaluationDatasets[j]; + } + 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.golden != null && message.hasOwnProperty("golden")) { + object.golden = $root.google.cloud.ces.v1beta.Evaluation.Golden.toObject(message.golden, options); + if (options.oneofs) + object.inputs = "golden"; + } + if (message.scenario != null && message.hasOwnProperty("scenario")) { + object.scenario = $root.google.cloud.ces.v1beta.Evaluation.Scenario.toObject(message.scenario, options); + if (options.oneofs) + object.inputs = "scenario"; + } + if (message.createdBy != null && message.hasOwnProperty("createdBy")) + object.createdBy = message.createdBy; + if (message.lastUpdatedBy != null && message.hasOwnProperty("lastUpdatedBy")) + object.lastUpdatedBy = message.lastUpdatedBy; + if (message.evaluationRuns && message.evaluationRuns.length) { + object.evaluationRuns = []; + for (var j = 0; j < message.evaluationRuns.length; ++j) + object.evaluationRuns[j] = message.evaluationRuns[j]; + } + if (message.aggregatedMetrics != null && message.hasOwnProperty("aggregatedMetrics")) + object.aggregatedMetrics = $root.google.cloud.ces.v1beta.AggregatedMetrics.toObject(message.aggregatedMetrics, options); + if (message.lastCompletedResult != null && message.hasOwnProperty("lastCompletedResult")) + object.lastCompletedResult = $root.google.cloud.ces.v1beta.EvaluationResult.toObject(message.lastCompletedResult, options); + if (message.invalid != null && message.hasOwnProperty("invalid")) + object.invalid = message.invalid; + if (message.lastTenResults && message.lastTenResults.length) { + object.lastTenResults = []; + for (var j = 0; j < message.lastTenResults.length; ++j) + object.lastTenResults[j] = $root.google.cloud.ces.v1beta.EvaluationResult.toObject(message.lastTenResults[j], options); + } + return object; + }; + + /** + * Converts this Evaluation to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + * @returns {Object.} JSON object + */ + Evaluation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Evaluation + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Evaluation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Evaluation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation"; + }; + + Evaluation.GoldenExpectation = (function() { + + /** + * Properties of a GoldenExpectation. + * @memberof google.cloud.ces.v1beta.Evaluation + * @interface IGoldenExpectation + * @property {google.cloud.ces.v1beta.IToolCall|null} [toolCall] GoldenExpectation toolCall + * @property {google.cloud.ces.v1beta.IToolResponse|null} [toolResponse] GoldenExpectation toolResponse + * @property {google.cloud.ces.v1beta.IMessage|null} [agentResponse] GoldenExpectation agentResponse + * @property {google.cloud.ces.v1beta.IAgentTransfer|null} [agentTransfer] GoldenExpectation agentTransfer + * @property {google.protobuf.IStruct|null} [updatedVariables] GoldenExpectation updatedVariables + * @property {google.cloud.ces.v1beta.IToolResponse|null} [mockToolResponse] GoldenExpectation mockToolResponse + * @property {string|null} [note] GoldenExpectation note + */ + + /** + * Constructs a new GoldenExpectation. + * @memberof google.cloud.ces.v1beta.Evaluation + * @classdesc Represents a GoldenExpectation. + * @implements IGoldenExpectation + * @constructor + * @param {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation=} [properties] Properties to set + */ + function GoldenExpectation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoldenExpectation toolCall. + * @member {google.cloud.ces.v1beta.IToolCall|null|undefined} toolCall + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @instance + */ + GoldenExpectation.prototype.toolCall = null; + + /** + * GoldenExpectation toolResponse. + * @member {google.cloud.ces.v1beta.IToolResponse|null|undefined} toolResponse + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @instance + */ + GoldenExpectation.prototype.toolResponse = null; + + /** + * GoldenExpectation agentResponse. + * @member {google.cloud.ces.v1beta.IMessage|null|undefined} agentResponse + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @instance + */ + GoldenExpectation.prototype.agentResponse = null; + + /** + * GoldenExpectation agentTransfer. + * @member {google.cloud.ces.v1beta.IAgentTransfer|null|undefined} agentTransfer + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @instance + */ + GoldenExpectation.prototype.agentTransfer = null; + + /** + * GoldenExpectation updatedVariables. + * @member {google.protobuf.IStruct|null|undefined} updatedVariables + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @instance + */ + GoldenExpectation.prototype.updatedVariables = null; + + /** + * GoldenExpectation mockToolResponse. + * @member {google.cloud.ces.v1beta.IToolResponse|null|undefined} mockToolResponse + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @instance + */ + GoldenExpectation.prototype.mockToolResponse = null; + + /** + * GoldenExpectation note. + * @member {string} note + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @instance + */ + GoldenExpectation.prototype.note = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GoldenExpectation condition. + * @member {"toolCall"|"toolResponse"|"agentResponse"|"agentTransfer"|"updatedVariables"|"mockToolResponse"|undefined} condition + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @instance + */ + Object.defineProperty(GoldenExpectation.prototype, "condition", { + get: $util.oneOfGetter($oneOfFields = ["toolCall", "toolResponse", "agentResponse", "agentTransfer", "updatedVariables", "mockToolResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GoldenExpectation instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Evaluation.GoldenExpectation} GoldenExpectation instance + */ + GoldenExpectation.create = function create(properties) { + return new GoldenExpectation(properties); + }; + + /** + * Encodes the specified GoldenExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenExpectation.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation} message GoldenExpectation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenExpectation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.note != null && Object.hasOwnProperty.call(message, "note")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.note); + if (message.toolCall != null && Object.hasOwnProperty.call(message, "toolCall")) + $root.google.cloud.ces.v1beta.ToolCall.encode(message.toolCall, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolResponse != null && Object.hasOwnProperty.call(message, "toolResponse")) + $root.google.cloud.ces.v1beta.ToolResponse.encode(message.toolResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.agentResponse != null && Object.hasOwnProperty.call(message, "agentResponse")) + $root.google.cloud.ces.v1beta.Message.encode(message.agentResponse, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.agentTransfer != null && Object.hasOwnProperty.call(message, "agentTransfer")) + $root.google.cloud.ces.v1beta.AgentTransfer.encode(message.agentTransfer, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updatedVariables != null && Object.hasOwnProperty.call(message, "updatedVariables")) + $root.google.protobuf.Struct.encode(message.updatedVariables, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.mockToolResponse != null && Object.hasOwnProperty.call(message, "mockToolResponse")) + $root.google.cloud.ces.v1beta.ToolResponse.encode(message.mockToolResponse, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoldenExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenExpectation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation} message GoldenExpectation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenExpectation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoldenExpectation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Evaluation.GoldenExpectation} GoldenExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenExpectation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.toolCall = $root.google.cloud.ces.v1beta.ToolCall.decode(reader, reader.uint32()); + break; + } + case 3: { + message.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32()); + break; + } + case 4: { + message.agentResponse = $root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32()); + break; + } + case 5: { + message.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updatedVariables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 7: { + message.mockToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32()); + break; + } + case 1: { + message.note = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoldenExpectation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Evaluation.GoldenExpectation} GoldenExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenExpectation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoldenExpectation message. + * @function verify + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoldenExpectation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + properties.condition = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolCall.verify(message.toolCall); + if (error) + return "toolCall." + error; + } + } + if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { + if (properties.condition === 1) + return "condition: multiple values"; + properties.condition = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.toolResponse); + if (error) + return "toolResponse." + error; + } + } + if (message.agentResponse != null && message.hasOwnProperty("agentResponse")) { + if (properties.condition === 1) + return "condition: multiple values"; + properties.condition = 1; + { + var error = $root.google.cloud.ces.v1beta.Message.verify(message.agentResponse); + if (error) + return "agentResponse." + error; + } + } + if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { + if (properties.condition === 1) + return "condition: multiple values"; + properties.condition = 1; + { + var error = $root.google.cloud.ces.v1beta.AgentTransfer.verify(message.agentTransfer); + if (error) + return "agentTransfer." + error; + } + } + if (message.updatedVariables != null && message.hasOwnProperty("updatedVariables")) { + if (properties.condition === 1) + return "condition: multiple values"; + properties.condition = 1; + { + var error = $root.google.protobuf.Struct.verify(message.updatedVariables); + if (error) + return "updatedVariables." + error; + } + } + if (message.mockToolResponse != null && message.hasOwnProperty("mockToolResponse")) { + if (properties.condition === 1) + return "condition: multiple values"; + properties.condition = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.mockToolResponse); + if (error) + return "mockToolResponse." + error; + } + } + if (message.note != null && message.hasOwnProperty("note")) + if (!$util.isString(message.note)) + return "note: string expected"; + return null; + }; + + /** + * Creates a GoldenExpectation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Evaluation.GoldenExpectation} GoldenExpectation + */ + GoldenExpectation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation) + return object; + var message = new $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation(); + if (object.toolCall != null) { + if (typeof object.toolCall !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenExpectation.toolCall: object expected"); + message.toolCall = $root.google.cloud.ces.v1beta.ToolCall.fromObject(object.toolCall); + } + if (object.toolResponse != null) { + if (typeof object.toolResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenExpectation.toolResponse: object expected"); + message.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.toolResponse); + } + if (object.agentResponse != null) { + if (typeof object.agentResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenExpectation.agentResponse: object expected"); + message.agentResponse = $root.google.cloud.ces.v1beta.Message.fromObject(object.agentResponse); + } + if (object.agentTransfer != null) { + if (typeof object.agentTransfer !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenExpectation.agentTransfer: object expected"); + message.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.fromObject(object.agentTransfer); + } + if (object.updatedVariables != null) { + if (typeof object.updatedVariables !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenExpectation.updatedVariables: object expected"); + message.updatedVariables = $root.google.protobuf.Struct.fromObject(object.updatedVariables); + } + if (object.mockToolResponse != null) { + if (typeof object.mockToolResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenExpectation.mockToolResponse: object expected"); + message.mockToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.mockToolResponse); + } + if (object.note != null) + message.note = String(object.note); + return message; + }; + + /** + * Creates a plain object from a GoldenExpectation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.GoldenExpectation} message GoldenExpectation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoldenExpectation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.note = ""; + if (message.note != null && message.hasOwnProperty("note")) + object.note = message.note; + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + object.toolCall = $root.google.cloud.ces.v1beta.ToolCall.toObject(message.toolCall, options); + if (options.oneofs) + object.condition = "toolCall"; + } + if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { + object.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.toolResponse, options); + if (options.oneofs) + object.condition = "toolResponse"; + } + if (message.agentResponse != null && message.hasOwnProperty("agentResponse")) { + object.agentResponse = $root.google.cloud.ces.v1beta.Message.toObject(message.agentResponse, options); + if (options.oneofs) + object.condition = "agentResponse"; + } + if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { + object.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.toObject(message.agentTransfer, options); + if (options.oneofs) + object.condition = "agentTransfer"; + } + if (message.updatedVariables != null && message.hasOwnProperty("updatedVariables")) { + object.updatedVariables = $root.google.protobuf.Struct.toObject(message.updatedVariables, options); + if (options.oneofs) + object.condition = "updatedVariables"; + } + if (message.mockToolResponse != null && message.hasOwnProperty("mockToolResponse")) { + object.mockToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.mockToolResponse, options); + if (options.oneofs) + object.condition = "mockToolResponse"; + } + return object; + }; + + /** + * Converts this GoldenExpectation to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @instance + * @returns {Object.} JSON object + */ + GoldenExpectation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoldenExpectation + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoldenExpectation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.GoldenExpectation"; + }; + + return GoldenExpectation; + })(); + + Evaluation.Step = (function() { + + /** + * Properties of a Step. + * @memberof google.cloud.ces.v1beta.Evaluation + * @interface IStep + * @property {google.cloud.ces.v1beta.ISessionInput|null} [userInput] Step userInput + * @property {google.cloud.ces.v1beta.IAgentTransfer|null} [agentTransfer] Step agentTransfer + * @property {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null} [expectation] Step expectation + */ + + /** + * Constructs a new Step. + * @memberof google.cloud.ces.v1beta.Evaluation + * @classdesc Represents a Step. + * @implements IStep + * @constructor + * @param {google.cloud.ces.v1beta.Evaluation.IStep=} [properties] Properties to set + */ + function Step(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Step userInput. + * @member {google.cloud.ces.v1beta.ISessionInput|null|undefined} userInput + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @instance + */ + Step.prototype.userInput = null; + + /** + * Step agentTransfer. + * @member {google.cloud.ces.v1beta.IAgentTransfer|null|undefined} agentTransfer + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @instance + */ + Step.prototype.agentTransfer = null; + + /** + * Step expectation. + * @member {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null|undefined} expectation + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @instance + */ + Step.prototype.expectation = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Step step. + * @member {"userInput"|"agentTransfer"|"expectation"|undefined} step + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @instance + */ + Object.defineProperty(Step.prototype, "step", { + get: $util.oneOfGetter($oneOfFields = ["userInput", "agentTransfer", "expectation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Step instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IStep=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Evaluation.Step} Step instance + */ + Step.create = function create(properties) { + return new Step(properties); + }; + + /** + * Encodes the specified Step message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Step.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IStep} message Step message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Step.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userInput != null && Object.hasOwnProperty.call(message, "userInput")) + $root.google.cloud.ces.v1beta.SessionInput.encode(message.userInput, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.agentTransfer != null && Object.hasOwnProperty.call(message, "agentTransfer")) + $root.google.cloud.ces.v1beta.AgentTransfer.encode(message.agentTransfer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.expectation != null && Object.hasOwnProperty.call(message, "expectation")) + $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.encode(message.expectation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Step message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Step.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IStep} message Step message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Step.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Step message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Evaluation.Step} Step + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Step.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.Step(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.userInput = $root.google.cloud.ces.v1beta.SessionInput.decode(reader, reader.uint32()); + break; + } + case 2: { + message.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.decode(reader, reader.uint32()); + break; + } + case 3: { + message.expectation = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Step message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Evaluation.Step} Step + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Step.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Step message. + * @function verify + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Step.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.userInput != null && message.hasOwnProperty("userInput")) { + properties.step = 1; + { + var error = $root.google.cloud.ces.v1beta.SessionInput.verify(message.userInput); + if (error) + return "userInput." + error; + } + } + if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { + if (properties.step === 1) + return "step: multiple values"; + properties.step = 1; + { + var error = $root.google.cloud.ces.v1beta.AgentTransfer.verify(message.agentTransfer); + if (error) + return "agentTransfer." + error; + } + } + if (message.expectation != null && message.hasOwnProperty("expectation")) { + if (properties.step === 1) + return "step: multiple values"; + properties.step = 1; + { + var error = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.verify(message.expectation); + if (error) + return "expectation." + error; + } + } + return null; + }; + + /** + * Creates a Step message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Evaluation.Step} Step + */ + Step.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.Step) + return object; + var message = new $root.google.cloud.ces.v1beta.Evaluation.Step(); + if (object.userInput != null) { + if (typeof object.userInput !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Step.userInput: object expected"); + message.userInput = $root.google.cloud.ces.v1beta.SessionInput.fromObject(object.userInput); + } + if (object.agentTransfer != null) { + if (typeof object.agentTransfer !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Step.agentTransfer: object expected"); + message.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.fromObject(object.agentTransfer); + } + if (object.expectation != null) { + if (typeof object.expectation !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Step.expectation: object expected"); + message.expectation = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.fromObject(object.expectation); + } + return message; + }; + + /** + * Creates a plain object from a Step message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @static + * @param {google.cloud.ces.v1beta.Evaluation.Step} message Step + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Step.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.userInput != null && message.hasOwnProperty("userInput")) { + object.userInput = $root.google.cloud.ces.v1beta.SessionInput.toObject(message.userInput, options); + if (options.oneofs) + object.step = "userInput"; + } + if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { + object.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.toObject(message.agentTransfer, options); + if (options.oneofs) + object.step = "agentTransfer"; + } + if (message.expectation != null && message.hasOwnProperty("expectation")) { + object.expectation = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.toObject(message.expectation, options); + if (options.oneofs) + object.step = "expectation"; + } + return object; + }; + + /** + * Converts this Step to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @instance + * @returns {Object.} JSON object + */ + Step.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Step + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Step.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.Step"; + }; + + return Step; + })(); + + Evaluation.GoldenTurn = (function() { + + /** + * Properties of a GoldenTurn. + * @memberof google.cloud.ces.v1beta.Evaluation + * @interface IGoldenTurn + * @property {Array.|null} [steps] GoldenTurn steps + * @property {google.cloud.ces.v1beta.ISpan|null} [rootSpan] GoldenTurn rootSpan + */ + + /** + * Constructs a new GoldenTurn. + * @memberof google.cloud.ces.v1beta.Evaluation + * @classdesc Represents a GoldenTurn. + * @implements IGoldenTurn + * @constructor + * @param {google.cloud.ces.v1beta.Evaluation.IGoldenTurn=} [properties] Properties to set + */ + function GoldenTurn(properties) { + this.steps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoldenTurn steps. + * @member {Array.} steps + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @instance + */ + GoldenTurn.prototype.steps = $util.emptyArray; + + /** + * GoldenTurn rootSpan. + * @member {google.cloud.ces.v1beta.ISpan|null|undefined} rootSpan + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @instance + */ + GoldenTurn.prototype.rootSpan = null; + + /** + * Creates a new GoldenTurn instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IGoldenTurn=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Evaluation.GoldenTurn} GoldenTurn instance + */ + GoldenTurn.create = function create(properties) { + return new GoldenTurn(properties); + }; + + /** + * Encodes the specified GoldenTurn message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenTurn.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IGoldenTurn} message GoldenTurn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenTurn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.steps != null && message.steps.length) + for (var i = 0; i < message.steps.length; ++i) + $root.google.cloud.ces.v1beta.Evaluation.Step.encode(message.steps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rootSpan != null && Object.hasOwnProperty.call(message, "rootSpan")) + $root.google.cloud.ces.v1beta.Span.encode(message.rootSpan, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoldenTurn message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenTurn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IGoldenTurn} message GoldenTurn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenTurn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoldenTurn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Evaluation.GoldenTurn} GoldenTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenTurn.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.steps && message.steps.length)) + message.steps = []; + message.steps.push($root.google.cloud.ces.v1beta.Evaluation.Step.decode(reader, reader.uint32())); + break; + } + case 2: { + message.rootSpan = $root.google.cloud.ces.v1beta.Span.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoldenTurn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Evaluation.GoldenTurn} GoldenTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenTurn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoldenTurn message. + * @function verify + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoldenTurn.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.steps != null && message.hasOwnProperty("steps")) { + if (!Array.isArray(message.steps)) + return "steps: array expected"; + for (var i = 0; i < message.steps.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Evaluation.Step.verify(message.steps[i]); + if (error) + return "steps." + error; + } + } + if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) { + var error = $root.google.cloud.ces.v1beta.Span.verify(message.rootSpan); + if (error) + return "rootSpan." + error; + } + return null; + }; + + /** + * Creates a GoldenTurn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Evaluation.GoldenTurn} GoldenTurn + */ + GoldenTurn.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn) + return object; + var message = new $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn(); + if (object.steps) { + if (!Array.isArray(object.steps)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenTurn.steps: array expected"); + message.steps = []; + for (var i = 0; i < object.steps.length; ++i) { + if (typeof object.steps[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenTurn.steps: object expected"); + message.steps[i] = $root.google.cloud.ces.v1beta.Evaluation.Step.fromObject(object.steps[i]); + } + } + if (object.rootSpan != null) { + if (typeof object.rootSpan !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenTurn.rootSpan: object expected"); + message.rootSpan = $root.google.cloud.ces.v1beta.Span.fromObject(object.rootSpan); + } + return message; + }; + + /** + * Creates a plain object from a GoldenTurn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @static + * @param {google.cloud.ces.v1beta.Evaluation.GoldenTurn} message GoldenTurn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoldenTurn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.steps = []; + if (options.defaults) + object.rootSpan = null; + if (message.steps && message.steps.length) { + object.steps = []; + for (var j = 0; j < message.steps.length; ++j) + object.steps[j] = $root.google.cloud.ces.v1beta.Evaluation.Step.toObject(message.steps[j], options); + } + if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) + object.rootSpan = $root.google.cloud.ces.v1beta.Span.toObject(message.rootSpan, options); + return object; + }; + + /** + * Converts this GoldenTurn to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @instance + * @returns {Object.} JSON object + */ + GoldenTurn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoldenTurn + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoldenTurn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.GoldenTurn"; + }; + + return GoldenTurn; + })(); + + Evaluation.Golden = (function() { + + /** + * Properties of a Golden. + * @memberof google.cloud.ces.v1beta.Evaluation + * @interface IGolden + * @property {Array.|null} [turns] Golden turns + * @property {Array.|null} [evaluationExpectations] Golden evaluationExpectations + */ + + /** + * Constructs a new Golden. + * @memberof google.cloud.ces.v1beta.Evaluation + * @classdesc Represents a Golden. + * @implements IGolden + * @constructor + * @param {google.cloud.ces.v1beta.Evaluation.IGolden=} [properties] Properties to set + */ + function Golden(properties) { + this.turns = []; + this.evaluationExpectations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Golden turns. + * @member {Array.} turns + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @instance + */ + Golden.prototype.turns = $util.emptyArray; + + /** + * Golden evaluationExpectations. + * @member {Array.} evaluationExpectations + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @instance + */ + Golden.prototype.evaluationExpectations = $util.emptyArray; + + /** + * Creates a new Golden instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IGolden=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Evaluation.Golden} Golden instance + */ + Golden.create = function create(properties) { + return new Golden(properties); + }; + + /** + * Encodes the specified Golden message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Golden.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IGolden} message Golden message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Golden.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.turns != null && message.turns.length) + for (var i = 0; i < message.turns.length; ++i) + $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn.encode(message.turns[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.evaluationExpectations != null && message.evaluationExpectations.length) + for (var i = 0; i < message.evaluationExpectations.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.evaluationExpectations[i]); + return writer; + }; + + /** + * Encodes the specified Golden message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Golden.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IGolden} message Golden message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Golden.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Golden message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Evaluation.Golden} Golden + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Golden.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.Golden(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.turns && message.turns.length)) + message.turns = []; + message.turns.push($root.google.cloud.ces.v1beta.Evaluation.GoldenTurn.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.evaluationExpectations && message.evaluationExpectations.length)) + message.evaluationExpectations = []; + message.evaluationExpectations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Golden message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Evaluation.Golden} Golden + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Golden.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Golden message. + * @function verify + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Golden.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.turns != null && message.hasOwnProperty("turns")) { + if (!Array.isArray(message.turns)) + return "turns: array expected"; + for (var i = 0; i < message.turns.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn.verify(message.turns[i]); + if (error) + return "turns." + error; + } + } + if (message.evaluationExpectations != null && message.hasOwnProperty("evaluationExpectations")) { + if (!Array.isArray(message.evaluationExpectations)) + return "evaluationExpectations: array expected"; + for (var i = 0; i < message.evaluationExpectations.length; ++i) + if (!$util.isString(message.evaluationExpectations[i])) + return "evaluationExpectations: string[] expected"; + } + return null; + }; + + /** + * Creates a Golden message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Evaluation.Golden} Golden + */ + Golden.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.Golden) + return object; + var message = new $root.google.cloud.ces.v1beta.Evaluation.Golden(); + if (object.turns) { + if (!Array.isArray(object.turns)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Golden.turns: array expected"); + message.turns = []; + for (var i = 0; i < object.turns.length; ++i) { + if (typeof object.turns[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Golden.turns: object expected"); + message.turns[i] = $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn.fromObject(object.turns[i]); + } + } + if (object.evaluationExpectations) { + if (!Array.isArray(object.evaluationExpectations)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Golden.evaluationExpectations: array expected"); + message.evaluationExpectations = []; + for (var i = 0; i < object.evaluationExpectations.length; ++i) + message.evaluationExpectations[i] = String(object.evaluationExpectations[i]); + } + return message; + }; + + /** + * Creates a plain object from a Golden message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @static + * @param {google.cloud.ces.v1beta.Evaluation.Golden} message Golden + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Golden.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.turns = []; + object.evaluationExpectations = []; + } + if (message.turns && message.turns.length) { + object.turns = []; + for (var j = 0; j < message.turns.length; ++j) + object.turns[j] = $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn.toObject(message.turns[j], options); + } + if (message.evaluationExpectations && message.evaluationExpectations.length) { + object.evaluationExpectations = []; + for (var j = 0; j < message.evaluationExpectations.length; ++j) + object.evaluationExpectations[j] = message.evaluationExpectations[j]; + } + return object; + }; + + /** + * Converts this Golden to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @instance + * @returns {Object.} JSON object + */ + Golden.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Golden + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Golden.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.Golden"; + }; + + return Golden; + })(); + + Evaluation.ScenarioExpectation = (function() { + + /** + * Properties of a ScenarioExpectation. + * @memberof google.cloud.ces.v1beta.Evaluation + * @interface IScenarioExpectation + * @property {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation|null} [toolExpectation] ScenarioExpectation toolExpectation + * @property {google.cloud.ces.v1beta.IMessage|null} [agentResponse] ScenarioExpectation agentResponse + */ + + /** + * Constructs a new ScenarioExpectation. + * @memberof google.cloud.ces.v1beta.Evaluation + * @classdesc Represents a ScenarioExpectation. + * @implements IScenarioExpectation + * @constructor + * @param {google.cloud.ces.v1beta.Evaluation.IScenarioExpectation=} [properties] Properties to set + */ + function ScenarioExpectation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScenarioExpectation toolExpectation. + * @member {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation|null|undefined} toolExpectation + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @instance + */ + ScenarioExpectation.prototype.toolExpectation = null; + + /** + * ScenarioExpectation agentResponse. + * @member {google.cloud.ces.v1beta.IMessage|null|undefined} agentResponse + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @instance + */ + ScenarioExpectation.prototype.agentResponse = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ScenarioExpectation expectation. + * @member {"toolExpectation"|"agentResponse"|undefined} expectation + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @instance + */ + Object.defineProperty(ScenarioExpectation.prototype, "expectation", { + get: $util.oneOfGetter($oneOfFields = ["toolExpectation", "agentResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ScenarioExpectation instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IScenarioExpectation=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation} ScenarioExpectation instance + */ + ScenarioExpectation.create = function create(properties) { + return new ScenarioExpectation(properties); + }; + + /** + * Encodes the specified ScenarioExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IScenarioExpectation} message ScenarioExpectation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScenarioExpectation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolExpectation != null && Object.hasOwnProperty.call(message, "toolExpectation")) + $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.encode(message.toolExpectation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.agentResponse != null && Object.hasOwnProperty.call(message, "agentResponse")) + $root.google.cloud.ces.v1beta.Message.encode(message.agentResponse, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ScenarioExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IScenarioExpectation} message ScenarioExpectation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScenarioExpectation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScenarioExpectation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation} ScenarioExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScenarioExpectation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolExpectation = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.decode(reader, reader.uint32()); + break; + } + case 2: { + message.agentResponse = $root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScenarioExpectation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation} ScenarioExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScenarioExpectation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScenarioExpectation message. + * @function verify + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScenarioExpectation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.toolExpectation != null && message.hasOwnProperty("toolExpectation")) { + properties.expectation = 1; + { + var error = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.verify(message.toolExpectation); + if (error) + return "toolExpectation." + error; + } + } + if (message.agentResponse != null && message.hasOwnProperty("agentResponse")) { + if (properties.expectation === 1) + return "expectation: multiple values"; + properties.expectation = 1; + { + var error = $root.google.cloud.ces.v1beta.Message.verify(message.agentResponse); + if (error) + return "agentResponse." + error; + } + } + return null; + }; + + /** + * Creates a ScenarioExpectation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation} ScenarioExpectation + */ + ScenarioExpectation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation) + return object; + var message = new $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation(); + if (object.toolExpectation != null) { + if (typeof object.toolExpectation !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.toolExpectation: object expected"); + message.toolExpectation = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.fromObject(object.toolExpectation); + } + if (object.agentResponse != null) { + if (typeof object.agentResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.agentResponse: object expected"); + message.agentResponse = $root.google.cloud.ces.v1beta.Message.fromObject(object.agentResponse); + } + return message; + }; + + /** + * Creates a plain object from a ScenarioExpectation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation} message ScenarioExpectation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScenarioExpectation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.toolExpectation != null && message.hasOwnProperty("toolExpectation")) { + object.toolExpectation = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.toObject(message.toolExpectation, options); + if (options.oneofs) + object.expectation = "toolExpectation"; + } + if (message.agentResponse != null && message.hasOwnProperty("agentResponse")) { + object.agentResponse = $root.google.cloud.ces.v1beta.Message.toObject(message.agentResponse, options); + if (options.oneofs) + object.expectation = "agentResponse"; + } + return object; + }; + + /** + * Converts this ScenarioExpectation to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @instance + * @returns {Object.} JSON object + */ + ScenarioExpectation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScenarioExpectation + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScenarioExpectation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.ScenarioExpectation"; + }; + + ScenarioExpectation.ToolExpectation = (function() { + + /** + * Properties of a ToolExpectation. + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @interface IToolExpectation + * @property {google.cloud.ces.v1beta.IToolCall|null} [expectedToolCall] ToolExpectation expectedToolCall + * @property {google.cloud.ces.v1beta.IToolResponse|null} [mockToolResponse] ToolExpectation mockToolResponse + */ + + /** + * Constructs a new ToolExpectation. + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @classdesc Represents a ToolExpectation. + * @implements IToolExpectation + * @constructor + * @param {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation=} [properties] Properties to set + */ + function ToolExpectation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolExpectation expectedToolCall. + * @member {google.cloud.ces.v1beta.IToolCall|null|undefined} expectedToolCall + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @instance + */ + ToolExpectation.prototype.expectedToolCall = null; + + /** + * ToolExpectation mockToolResponse. + * @member {google.cloud.ces.v1beta.IToolResponse|null|undefined} mockToolResponse + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @instance + */ + ToolExpectation.prototype.mockToolResponse = null; + + /** + * Creates a new ToolExpectation instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation} ToolExpectation instance + */ + ToolExpectation.create = function create(properties) { + return new ToolExpectation(properties); + }; + + /** + * Encodes the specified ToolExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation} message ToolExpectation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolExpectation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expectedToolCall != null && Object.hasOwnProperty.call(message, "expectedToolCall")) + $root.google.cloud.ces.v1beta.ToolCall.encode(message.expectedToolCall, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mockToolResponse != null && Object.hasOwnProperty.call(message, "mockToolResponse")) + $root.google.cloud.ces.v1beta.ToolResponse.encode(message.mockToolResponse, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation} message ToolExpectation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolExpectation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolExpectation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation} ToolExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolExpectation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expectedToolCall = $root.google.cloud.ces.v1beta.ToolCall.decode(reader, reader.uint32()); + break; + } + case 2: { + message.mockToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolExpectation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation} ToolExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolExpectation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolExpectation message. + * @function verify + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolExpectation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expectedToolCall != null && message.hasOwnProperty("expectedToolCall")) { + var error = $root.google.cloud.ces.v1beta.ToolCall.verify(message.expectedToolCall); + if (error) + return "expectedToolCall." + error; + } + if (message.mockToolResponse != null && message.hasOwnProperty("mockToolResponse")) { + var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.mockToolResponse); + if (error) + return "mockToolResponse." + error; + } + return null; + }; + + /** + * Creates a ToolExpectation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation} ToolExpectation + */ + ToolExpectation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation) + return object; + var message = new $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation(); + if (object.expectedToolCall != null) { + if (typeof object.expectedToolCall !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.expectedToolCall: object expected"); + message.expectedToolCall = $root.google.cloud.ces.v1beta.ToolCall.fromObject(object.expectedToolCall); + } + if (object.mockToolResponse != null) { + if (typeof object.mockToolResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.mockToolResponse: object expected"); + message.mockToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.mockToolResponse); + } + return message; + }; + + /** + * Creates a plain object from a ToolExpectation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation} message ToolExpectation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolExpectation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expectedToolCall = null; + object.mockToolResponse = null; + } + if (message.expectedToolCall != null && message.hasOwnProperty("expectedToolCall")) + object.expectedToolCall = $root.google.cloud.ces.v1beta.ToolCall.toObject(message.expectedToolCall, options); + if (message.mockToolResponse != null && message.hasOwnProperty("mockToolResponse")) + object.mockToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.mockToolResponse, options); + return object; + }; + + /** + * Converts this ToolExpectation to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @instance + * @returns {Object.} JSON object + */ + ToolExpectation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolExpectation + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolExpectation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation"; + }; + + return ToolExpectation; + })(); + + return ScenarioExpectation; + })(); + + Evaluation.Scenario = (function() { + + /** + * Properties of a Scenario. + * @memberof google.cloud.ces.v1beta.Evaluation + * @interface IScenario + * @property {string|null} [task] Scenario task + * @property {Array.|null} [userFacts] Scenario userFacts + * @property {number|null} [maxTurns] Scenario maxTurns + * @property {Array.|null} [rubrics] Scenario rubrics + * @property {Array.|null} [scenarioExpectations] Scenario scenarioExpectations + * @property {google.protobuf.IStruct|null} [variableOverrides] Scenario variableOverrides + * @property {google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior|null} [taskCompletionBehavior] Scenario taskCompletionBehavior + * @property {google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior|null} [userGoalBehavior] Scenario userGoalBehavior + * @property {Array.|null} [evaluationExpectations] Scenario evaluationExpectations + */ + + /** + * Constructs a new Scenario. + * @memberof google.cloud.ces.v1beta.Evaluation + * @classdesc Represents a Scenario. + * @implements IScenario + * @constructor + * @param {google.cloud.ces.v1beta.Evaluation.IScenario=} [properties] Properties to set + */ + function Scenario(properties) { + this.userFacts = []; + this.rubrics = []; + this.scenarioExpectations = []; + this.evaluationExpectations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Scenario task. + * @member {string} task + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + */ + Scenario.prototype.task = ""; + + /** + * Scenario userFacts. + * @member {Array.} userFacts + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + */ + Scenario.prototype.userFacts = $util.emptyArray; + + /** + * Scenario maxTurns. + * @member {number} maxTurns + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + */ + Scenario.prototype.maxTurns = 0; + + /** + * Scenario rubrics. + * @member {Array.} rubrics + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + */ + Scenario.prototype.rubrics = $util.emptyArray; + + /** + * Scenario scenarioExpectations. + * @member {Array.} scenarioExpectations + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + */ + Scenario.prototype.scenarioExpectations = $util.emptyArray; + + /** + * Scenario variableOverrides. + * @member {google.protobuf.IStruct|null|undefined} variableOverrides + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + */ + Scenario.prototype.variableOverrides = null; + + /** + * Scenario taskCompletionBehavior. + * @member {google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior} taskCompletionBehavior + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + */ + Scenario.prototype.taskCompletionBehavior = 0; + + /** + * Scenario userGoalBehavior. + * @member {google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior} userGoalBehavior + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + */ + Scenario.prototype.userGoalBehavior = 0; + + /** + * Scenario evaluationExpectations. + * @member {Array.} evaluationExpectations + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + */ + Scenario.prototype.evaluationExpectations = $util.emptyArray; + + /** + * Creates a new Scenario instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IScenario=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Evaluation.Scenario} Scenario instance + */ + Scenario.create = function create(properties) { + return new Scenario(properties); + }; + + /** + * Encodes the specified Scenario message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IScenario} message Scenario message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Scenario.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.task != null && Object.hasOwnProperty.call(message, "task")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.task); + if (message.rubrics != null && message.rubrics.length) + for (var i = 0; i < message.rubrics.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rubrics[i]); + if (message.scenarioExpectations != null && message.scenarioExpectations.length) + for (var i = 0; i < message.scenarioExpectations.length; ++i) + $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.encode(message.scenarioExpectations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.userFacts != null && message.userFacts.length) + for (var i = 0; i < message.userFacts.length; ++i) + $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.encode(message.userFacts[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.maxTurns != null && Object.hasOwnProperty.call(message, "maxTurns")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxTurns); + if (message.variableOverrides != null && Object.hasOwnProperty.call(message, "variableOverrides")) + $root.google.protobuf.Struct.encode(message.variableOverrides, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.taskCompletionBehavior != null && Object.hasOwnProperty.call(message, "taskCompletionBehavior")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.taskCompletionBehavior); + if (message.userGoalBehavior != null && Object.hasOwnProperty.call(message, "userGoalBehavior")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.userGoalBehavior); + if (message.evaluationExpectations != null && message.evaluationExpectations.length) + for (var i = 0; i < message.evaluationExpectations.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.evaluationExpectations[i]); + return writer; + }; + + /** + * Encodes the specified Scenario message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IScenario} message Scenario message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Scenario.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Scenario message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Evaluation.Scenario} Scenario + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Scenario.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.Scenario(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.task = reader.string(); + break; + } + case 4: { + if (!(message.userFacts && message.userFacts.length)) + message.userFacts = []; + message.userFacts.push($root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.decode(reader, reader.uint32())); + break; + } + case 5: { + message.maxTurns = reader.int32(); + break; + } + case 2: { + if (!(message.rubrics && message.rubrics.length)) + message.rubrics = []; + message.rubrics.push(reader.string()); + break; + } + case 3: { + if (!(message.scenarioExpectations && message.scenarioExpectations.length)) + message.scenarioExpectations = []; + message.scenarioExpectations.push($root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.decode(reader, reader.uint32())); + break; + } + case 6: { + message.variableOverrides = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 7: { + message.taskCompletionBehavior = reader.int32(); + break; + } + case 8: { + message.userGoalBehavior = reader.int32(); + break; + } + case 10: { + if (!(message.evaluationExpectations && message.evaluationExpectations.length)) + message.evaluationExpectations = []; + message.evaluationExpectations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Scenario message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Evaluation.Scenario} Scenario + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Scenario.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Scenario message. + * @function verify + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Scenario.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.task != null && message.hasOwnProperty("task")) + if (!$util.isString(message.task)) + return "task: string expected"; + if (message.userFacts != null && message.hasOwnProperty("userFacts")) { + if (!Array.isArray(message.userFacts)) + return "userFacts: array expected"; + for (var i = 0; i < message.userFacts.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.verify(message.userFacts[i]); + if (error) + return "userFacts." + error; + } + } + if (message.maxTurns != null && message.hasOwnProperty("maxTurns")) + if (!$util.isInteger(message.maxTurns)) + return "maxTurns: integer expected"; + if (message.rubrics != null && message.hasOwnProperty("rubrics")) { + if (!Array.isArray(message.rubrics)) + return "rubrics: array expected"; + for (var i = 0; i < message.rubrics.length; ++i) + if (!$util.isString(message.rubrics[i])) + return "rubrics: string[] expected"; + } + if (message.scenarioExpectations != null && message.hasOwnProperty("scenarioExpectations")) { + if (!Array.isArray(message.scenarioExpectations)) + return "scenarioExpectations: array expected"; + for (var i = 0; i < message.scenarioExpectations.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.verify(message.scenarioExpectations[i]); + if (error) + return "scenarioExpectations." + error; + } + } + if (message.variableOverrides != null && message.hasOwnProperty("variableOverrides")) { + var error = $root.google.protobuf.Struct.verify(message.variableOverrides); + if (error) + return "variableOverrides." + error; + } + if (message.taskCompletionBehavior != null && message.hasOwnProperty("taskCompletionBehavior")) + switch (message.taskCompletionBehavior) { + default: + return "taskCompletionBehavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.userGoalBehavior != null && message.hasOwnProperty("userGoalBehavior")) + switch (message.userGoalBehavior) { + default: + return "userGoalBehavior: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.evaluationExpectations != null && message.hasOwnProperty("evaluationExpectations")) { + if (!Array.isArray(message.evaluationExpectations)) + return "evaluationExpectations: array expected"; + for (var i = 0; i < message.evaluationExpectations.length; ++i) + if (!$util.isString(message.evaluationExpectations[i])) + return "evaluationExpectations: string[] expected"; + } + return null; + }; + + /** + * Creates a Scenario message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Evaluation.Scenario} Scenario + */ + Scenario.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.Scenario) + return object; + var message = new $root.google.cloud.ces.v1beta.Evaluation.Scenario(); + if (object.task != null) + message.task = String(object.task); + if (object.userFacts) { + if (!Array.isArray(object.userFacts)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.userFacts: array expected"); + message.userFacts = []; + for (var i = 0; i < object.userFacts.length; ++i) { + if (typeof object.userFacts[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.userFacts: object expected"); + message.userFacts[i] = $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.fromObject(object.userFacts[i]); + } + } + if (object.maxTurns != null) + message.maxTurns = object.maxTurns | 0; + if (object.rubrics) { + if (!Array.isArray(object.rubrics)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.rubrics: array expected"); + message.rubrics = []; + for (var i = 0; i < object.rubrics.length; ++i) + message.rubrics[i] = String(object.rubrics[i]); + } + if (object.scenarioExpectations) { + if (!Array.isArray(object.scenarioExpectations)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.scenarioExpectations: array expected"); + message.scenarioExpectations = []; + for (var i = 0; i < object.scenarioExpectations.length; ++i) { + if (typeof object.scenarioExpectations[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.scenarioExpectations: object expected"); + message.scenarioExpectations[i] = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.fromObject(object.scenarioExpectations[i]); + } + } + if (object.variableOverrides != null) { + if (typeof object.variableOverrides !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.variableOverrides: object expected"); + message.variableOverrides = $root.google.protobuf.Struct.fromObject(object.variableOverrides); + } + switch (object.taskCompletionBehavior) { + default: + if (typeof object.taskCompletionBehavior === "number") { + message.taskCompletionBehavior = object.taskCompletionBehavior; + break; + } + break; + case "TASK_COMPLETION_BEHAVIOR_UNSPECIFIED": + case 0: + message.taskCompletionBehavior = 0; + break; + case "TASK_SATISFIED": + case 1: + message.taskCompletionBehavior = 1; + break; + case "TASK_REJECTED": + case 2: + message.taskCompletionBehavior = 2; + break; + } + switch (object.userGoalBehavior) { + default: + if (typeof object.userGoalBehavior === "number") { + message.userGoalBehavior = object.userGoalBehavior; + break; + } + break; + case "USER_GOAL_BEHAVIOR_UNSPECIFIED": + case 0: + message.userGoalBehavior = 0; + break; + case "USER_GOAL_SATISFIED": + case 1: + message.userGoalBehavior = 1; + break; + case "USER_GOAL_REJECTED": + case 2: + message.userGoalBehavior = 2; + break; + case "USER_GOAL_IGNORED": + case 3: + message.userGoalBehavior = 3; + break; + } + if (object.evaluationExpectations) { + if (!Array.isArray(object.evaluationExpectations)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.evaluationExpectations: array expected"); + message.evaluationExpectations = []; + for (var i = 0; i < object.evaluationExpectations.length; ++i) + message.evaluationExpectations[i] = String(object.evaluationExpectations[i]); + } + return message; + }; + + /** + * Creates a plain object from a Scenario message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @static + * @param {google.cloud.ces.v1beta.Evaluation.Scenario} message Scenario + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Scenario.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.rubrics = []; + object.scenarioExpectations = []; + object.userFacts = []; + object.evaluationExpectations = []; + } + if (options.defaults) { + object.task = ""; + object.maxTurns = 0; + object.variableOverrides = null; + object.taskCompletionBehavior = options.enums === String ? "TASK_COMPLETION_BEHAVIOR_UNSPECIFIED" : 0; + object.userGoalBehavior = options.enums === String ? "USER_GOAL_BEHAVIOR_UNSPECIFIED" : 0; + } + if (message.task != null && message.hasOwnProperty("task")) + object.task = message.task; + if (message.rubrics && message.rubrics.length) { + object.rubrics = []; + for (var j = 0; j < message.rubrics.length; ++j) + object.rubrics[j] = message.rubrics[j]; + } + if (message.scenarioExpectations && message.scenarioExpectations.length) { + object.scenarioExpectations = []; + for (var j = 0; j < message.scenarioExpectations.length; ++j) + object.scenarioExpectations[j] = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.toObject(message.scenarioExpectations[j], options); + } + if (message.userFacts && message.userFacts.length) { + object.userFacts = []; + for (var j = 0; j < message.userFacts.length; ++j) + object.userFacts[j] = $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.toObject(message.userFacts[j], options); + } + if (message.maxTurns != null && message.hasOwnProperty("maxTurns")) + object.maxTurns = message.maxTurns; + if (message.variableOverrides != null && message.hasOwnProperty("variableOverrides")) + object.variableOverrides = $root.google.protobuf.Struct.toObject(message.variableOverrides, options); + if (message.taskCompletionBehavior != null && message.hasOwnProperty("taskCompletionBehavior")) + object.taskCompletionBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior[message.taskCompletionBehavior] === undefined ? message.taskCompletionBehavior : $root.google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior[message.taskCompletionBehavior] : message.taskCompletionBehavior; + if (message.userGoalBehavior != null && message.hasOwnProperty("userGoalBehavior")) + object.userGoalBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior[message.userGoalBehavior] === undefined ? message.userGoalBehavior : $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior[message.userGoalBehavior] : message.userGoalBehavior; + if (message.evaluationExpectations && message.evaluationExpectations.length) { + object.evaluationExpectations = []; + for (var j = 0; j < message.evaluationExpectations.length; ++j) + object.evaluationExpectations[j] = message.evaluationExpectations[j]; + } + return object; + }; + + /** + * Converts this Scenario to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + * @returns {Object.} JSON object + */ + Scenario.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Scenario + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Scenario.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.Scenario"; + }; + + Scenario.UserFact = (function() { + + /** + * Properties of a UserFact. + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @interface IUserFact + * @property {string|null} [name] UserFact name + * @property {string|null} [value] UserFact value + */ + + /** + * Constructs a new UserFact. + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @classdesc Represents a UserFact. + * @implements IUserFact + * @constructor + * @param {google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact=} [properties] Properties to set + */ + function UserFact(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserFact name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @instance + */ + UserFact.prototype.name = ""; + + /** + * UserFact value. + * @member {string} value + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @instance + */ + UserFact.prototype.value = ""; + + /** + * Creates a new UserFact instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @static + * @param {google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Evaluation.Scenario.UserFact} UserFact instance + */ + UserFact.create = function create(properties) { + return new UserFact(properties); + }; + + /** + * Encodes the specified UserFact message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @static + * @param {google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact} message UserFact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserFact.encode = function encode(message, writer) { + if (!writer) + 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 && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified UserFact message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @static + * @param {google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact} message UserFact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserFact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserFact message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Evaluation.Scenario.UserFact} UserFact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserFact.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserFact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Evaluation.Scenario.UserFact} UserFact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserFact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserFact message. + * @function verify + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserFact.verify = function verify(message) { + if (typeof message !== "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 (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a UserFact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Evaluation.Scenario.UserFact} UserFact + */ + UserFact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact) + return object; + var message = new $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a UserFact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @static + * @param {google.cloud.ces.v1beta.Evaluation.Scenario.UserFact} message UserFact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserFact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UserFact to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @instance + * @returns {Object.} JSON object + */ + UserFact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserFact + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserFact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.Scenario.UserFact"; + }; + + return UserFact; + })(); + + /** + * TaskCompletionBehavior enum. + * @name google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior + * @enum {number} + * @property {number} TASK_COMPLETION_BEHAVIOR_UNSPECIFIED=0 TASK_COMPLETION_BEHAVIOR_UNSPECIFIED value + * @property {number} TASK_SATISFIED=1 TASK_SATISFIED value + * @property {number} TASK_REJECTED=2 TASK_REJECTED value + */ + Scenario.TaskCompletionBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TASK_COMPLETION_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "TASK_SATISFIED"] = 1; + values[valuesById[2] = "TASK_REJECTED"] = 2; + return values; + })(); + + /** + * UserGoalBehavior enum. + * @name google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior + * @enum {number} + * @property {number} USER_GOAL_BEHAVIOR_UNSPECIFIED=0 USER_GOAL_BEHAVIOR_UNSPECIFIED value + * @property {number} USER_GOAL_SATISFIED=1 USER_GOAL_SATISFIED value + * @property {number} USER_GOAL_REJECTED=2 USER_GOAL_REJECTED value + * @property {number} USER_GOAL_IGNORED=3 USER_GOAL_IGNORED value + */ + Scenario.UserGoalBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_GOAL_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER_GOAL_SATISFIED"] = 1; + values[valuesById[2] = "USER_GOAL_REJECTED"] = 2; + values[valuesById[3] = "USER_GOAL_IGNORED"] = 3; + return values; + })(); + + return Scenario; + })(); + + return Evaluation; + })(); + + v1beta.EvaluationDataset = (function() { + + /** + * Properties of an EvaluationDataset. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluationDataset + * @property {string|null} [name] EvaluationDataset name + * @property {string|null} [displayName] EvaluationDataset displayName + * @property {Array.|null} [evaluations] EvaluationDataset evaluations + * @property {google.protobuf.ITimestamp|null} [createTime] EvaluationDataset createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] EvaluationDataset updateTime + * @property {string|null} [etag] EvaluationDataset etag + * @property {string|null} [createdBy] EvaluationDataset createdBy + * @property {string|null} [lastUpdatedBy] EvaluationDataset lastUpdatedBy + * @property {google.cloud.ces.v1beta.IAggregatedMetrics|null} [aggregatedMetrics] EvaluationDataset aggregatedMetrics + */ + + /** + * Constructs a new EvaluationDataset. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationDataset. + * @implements IEvaluationDataset + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluationDataset=} [properties] Properties to set + */ + function EvaluationDataset(properties) { + this.evaluations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationDataset name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.name = ""; + + /** + * EvaluationDataset displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.displayName = ""; + + /** + * EvaluationDataset evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.evaluations = $util.emptyArray; + + /** + * EvaluationDataset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.createTime = null; + + /** + * EvaluationDataset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.updateTime = null; + + /** + * EvaluationDataset etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.etag = ""; + + /** + * EvaluationDataset createdBy. + * @member {string} createdBy + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.createdBy = ""; + + /** + * EvaluationDataset lastUpdatedBy. + * @member {string} lastUpdatedBy + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.lastUpdatedBy = ""; + + /** + * EvaluationDataset aggregatedMetrics. + * @member {google.cloud.ces.v1beta.IAggregatedMetrics|null|undefined} aggregatedMetrics + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.aggregatedMetrics = null; + + /** + * Creates a new EvaluationDataset instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @static + * @param {google.cloud.ces.v1beta.IEvaluationDataset=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationDataset} EvaluationDataset instance + */ + EvaluationDataset.create = function create(properties) { + return new EvaluationDataset(properties); + }; + + /** + * Encodes the specified EvaluationDataset message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationDataset.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @static + * @param {google.cloud.ces.v1beta.IEvaluationDataset} message EvaluationDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationDataset.encode = function encode(message, writer) { + if (!writer) + 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.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.evaluations[i]); + 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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + if (message.createdBy != null && Object.hasOwnProperty.call(message, "createdBy")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.createdBy); + if (message.lastUpdatedBy != null && Object.hasOwnProperty.call(message, "lastUpdatedBy")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.lastUpdatedBy); + if (message.aggregatedMetrics != null && Object.hasOwnProperty.call(message, "aggregatedMetrics")) + $root.google.cloud.ces.v1beta.AggregatedMetrics.encode(message.aggregatedMetrics, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluationDataset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationDataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @static + * @param {google.cloud.ces.v1beta.IEvaluationDataset} message EvaluationDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationDataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationDataset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationDataset} EvaluationDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationDataset.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationDataset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push(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.etag = reader.string(); + break; + } + case 7: { + message.createdBy = reader.string(); + break; + } + case 8: { + message.lastUpdatedBy = reader.string(); + break; + } + case 9: { + message.aggregatedMetrics = $root.google.cloud.ces.v1beta.AggregatedMetrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationDataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationDataset} EvaluationDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationDataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationDataset message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationDataset.verify = function verify(message) { + if (typeof message !== "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.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) + if (!$util.isString(message.evaluations[i])) + return "evaluations: 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.createdBy != null && message.hasOwnProperty("createdBy")) + if (!$util.isString(message.createdBy)) + return "createdBy: string expected"; + if (message.lastUpdatedBy != null && message.hasOwnProperty("lastUpdatedBy")) + if (!$util.isString(message.lastUpdatedBy)) + return "lastUpdatedBy: string expected"; + if (message.aggregatedMetrics != null && message.hasOwnProperty("aggregatedMetrics")) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.verify(message.aggregatedMetrics); + if (error) + return "aggregatedMetrics." + error; + } + return null; + }; + + /** + * Creates an EvaluationDataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationDataset} EvaluationDataset + */ + EvaluationDataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationDataset) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationDataset(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationDataset.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) + message.evaluations[i] = String(object.evaluations[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationDataset.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.ces.v1beta.EvaluationDataset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.createdBy != null) + message.createdBy = String(object.createdBy); + if (object.lastUpdatedBy != null) + message.lastUpdatedBy = String(object.lastUpdatedBy); + if (object.aggregatedMetrics != null) { + if (typeof object.aggregatedMetrics !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationDataset.aggregatedMetrics: object expected"); + message.aggregatedMetrics = $root.google.cloud.ces.v1beta.AggregatedMetrics.fromObject(object.aggregatedMetrics); + } + return message; + }; + + /** + * Creates a plain object from an EvaluationDataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @static + * @param {google.cloud.ces.v1beta.EvaluationDataset} message EvaluationDataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationDataset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluations = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.createdBy = ""; + object.lastUpdatedBy = ""; + object.aggregatedMetrics = 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.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = message.evaluations[j]; + } + 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.createdBy != null && message.hasOwnProperty("createdBy")) + object.createdBy = message.createdBy; + if (message.lastUpdatedBy != null && message.hasOwnProperty("lastUpdatedBy")) + object.lastUpdatedBy = message.lastUpdatedBy; + if (message.aggregatedMetrics != null && message.hasOwnProperty("aggregatedMetrics")) + object.aggregatedMetrics = $root.google.cloud.ces.v1beta.AggregatedMetrics.toObject(message.aggregatedMetrics, options); + return object; + }; + + /** + * Converts this EvaluationDataset to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + * @returns {Object.} JSON object + */ + EvaluationDataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationDataset + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationDataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationDataset"; + }; + + return EvaluationDataset; + })(); + + v1beta.EvaluationResult = (function() { + + /** + * Properties of an EvaluationResult. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluationResult + * @property {google.cloud.ces.v1beta.EvaluationResult.IGoldenResult|null} [goldenResult] EvaluationResult goldenResult + * @property {google.cloud.ces.v1beta.EvaluationResult.IScenarioResult|null} [scenarioResult] EvaluationResult scenarioResult + * @property {string|null} [name] EvaluationResult name + * @property {string|null} [displayName] EvaluationResult displayName + * @property {google.protobuf.ITimestamp|null} [createTime] EvaluationResult createTime + * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [evaluationStatus] EvaluationResult evaluationStatus + * @property {string|null} [evaluationRun] EvaluationResult evaluationRun + * @property {google.cloud.ces.v1beta.IEvaluationPersona|null} [persona] EvaluationResult persona + * @property {google.cloud.ces.v1beta.IEvaluationErrorInfo|null} [errorInfo] EvaluationResult errorInfo + * @property {google.rpc.IStatus|null} [error] EvaluationResult error + * @property {string|null} [initiatedBy] EvaluationResult initiatedBy + * @property {string|null} [appVersion] EvaluationResult appVersion + * @property {string|null} [appVersionDisplayName] EvaluationResult appVersionDisplayName + * @property {string|null} [changelog] EvaluationResult changelog + * @property {google.protobuf.ITimestamp|null} [changelogCreateTime] EvaluationResult changelogCreateTime + * @property {google.cloud.ces.v1beta.EvaluationResult.ExecutionState|null} [executionState] EvaluationResult executionState + * @property {google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null} [evaluationMetricsThresholds] EvaluationResult evaluationMetricsThresholds + * @property {google.cloud.ces.v1beta.IEvaluationConfig|null} [config] EvaluationResult config + * @property {google.cloud.ces.v1beta.GoldenRunMethod|null} [goldenRunMethod] EvaluationResult goldenRunMethod + */ + + /** + * Constructs a new EvaluationResult. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationResult. + * @implements IEvaluationResult + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluationResult=} [properties] Properties to set + */ + function EvaluationResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationResult goldenResult. + * @member {google.cloud.ces.v1beta.EvaluationResult.IGoldenResult|null|undefined} goldenResult + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.goldenResult = null; + + /** + * EvaluationResult scenarioResult. + * @member {google.cloud.ces.v1beta.EvaluationResult.IScenarioResult|null|undefined} scenarioResult + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.scenarioResult = null; + + /** + * EvaluationResult name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.name = ""; + + /** + * EvaluationResult displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.displayName = ""; + + /** + * EvaluationResult createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.createTime = null; + + /** + * EvaluationResult evaluationStatus. + * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} evaluationStatus + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.evaluationStatus = 0; + + /** + * EvaluationResult evaluationRun. + * @member {string} evaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.evaluationRun = ""; + + /** + * EvaluationResult persona. + * @member {google.cloud.ces.v1beta.IEvaluationPersona|null|undefined} persona + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.persona = null; + + /** + * EvaluationResult errorInfo. + * @member {google.cloud.ces.v1beta.IEvaluationErrorInfo|null|undefined} errorInfo + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.errorInfo = null; + + /** + * EvaluationResult error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.error = null; + + /** + * EvaluationResult initiatedBy. + * @member {string} initiatedBy + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.initiatedBy = ""; + + /** + * EvaluationResult appVersion. + * @member {string} appVersion + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.appVersion = ""; + + /** + * EvaluationResult appVersionDisplayName. + * @member {string} appVersionDisplayName + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.appVersionDisplayName = ""; + + /** + * EvaluationResult changelog. + * @member {string} changelog + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.changelog = ""; + + /** + * EvaluationResult changelogCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} changelogCreateTime + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.changelogCreateTime = null; + + /** + * EvaluationResult executionState. + * @member {google.cloud.ces.v1beta.EvaluationResult.ExecutionState} executionState + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.executionState = 0; + + /** + * EvaluationResult evaluationMetricsThresholds. + * @member {google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null|undefined} evaluationMetricsThresholds + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.evaluationMetricsThresholds = null; + + /** + * EvaluationResult config. + * @member {google.cloud.ces.v1beta.IEvaluationConfig|null|undefined} config + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.config = null; + + /** + * EvaluationResult goldenRunMethod. + * @member {google.cloud.ces.v1beta.GoldenRunMethod} goldenRunMethod + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.goldenRunMethod = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EvaluationResult result. + * @member {"goldenResult"|"scenarioResult"|undefined} result + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + Object.defineProperty(EvaluationResult.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["goldenResult", "scenarioResult"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EvaluationResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @static + * @param {google.cloud.ces.v1beta.IEvaluationResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult} EvaluationResult instance + */ + EvaluationResult.create = function create(properties) { + return new EvaluationResult(properties); + }; + + /** + * Encodes the specified EvaluationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @static + * @param {google.cloud.ces.v1beta.IEvaluationResult} message EvaluationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationResult.encode = function encode(message, writer) { + if (!writer) + 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.evaluationStatus != null && Object.hasOwnProperty.call(message, "evaluationStatus")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.evaluationStatus); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.evaluationRun != null && Object.hasOwnProperty.call(message, "evaluationRun")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.evaluationRun); + if (message.goldenResult != null && Object.hasOwnProperty.call(message, "goldenResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.encode(message.goldenResult, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.scenarioResult != null && Object.hasOwnProperty.call(message, "scenarioResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.encode(message.scenarioResult, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.initiatedBy != null && Object.hasOwnProperty.call(message, "initiatedBy")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.initiatedBy); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.appVersion); + if (message.executionState != null && Object.hasOwnProperty.call(message, "executionState")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.executionState); + if (message.evaluationMetricsThresholds != null && Object.hasOwnProperty.call(message, "evaluationMetricsThresholds")) + $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.encode(message.evaluationMetricsThresholds, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.appVersionDisplayName != null && Object.hasOwnProperty.call(message, "appVersionDisplayName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.appVersionDisplayName); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.errorInfo != null && Object.hasOwnProperty.call(message, "errorInfo")) + $root.google.cloud.ces.v1beta.EvaluationErrorInfo.encode(message.errorInfo, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.persona != null && Object.hasOwnProperty.call(message, "persona")) + $root.google.cloud.ces.v1beta.EvaluationPersona.encode(message.persona, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.ces.v1beta.EvaluationConfig.encode(message.config, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.goldenRunMethod != null && Object.hasOwnProperty.call(message, "goldenRunMethod")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.goldenRunMethod); + if (message.changelog != null && Object.hasOwnProperty.call(message, "changelog")) + writer.uint32(/* id 21, wireType 2 =*/170).string(message.changelog); + if (message.changelogCreateTime != null && Object.hasOwnProperty.call(message, "changelogCreateTime")) + $root.google.protobuf.Timestamp.encode(message.changelogCreateTime, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @static + * @param {google.cloud.ces.v1beta.IEvaluationResult} message EvaluationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult} EvaluationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 7: { + message.goldenResult = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.decode(reader, reader.uint32()); + break; + } + case 8: { + message.scenarioResult = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.evaluationStatus = reader.int32(); + break; + } + case 6: { + message.evaluationRun = reader.string(); + break; + } + case 17: { + message.persona = $root.google.cloud.ces.v1beta.EvaluationPersona.decode(reader, reader.uint32()); + break; + } + case 15: { + message.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.decode(reader, reader.uint32()); + break; + } + case 14: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 9: { + message.initiatedBy = reader.string(); + break; + } + case 10: { + message.appVersion = reader.string(); + break; + } + case 13: { + message.appVersionDisplayName = reader.string(); + break; + } + case 21: { + message.changelog = reader.string(); + break; + } + case 22: { + message.changelogCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.executionState = reader.int32(); + break; + } + case 12: { + message.evaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.decode(reader, reader.uint32()); + break; + } + case 18: { + message.config = $root.google.cloud.ces.v1beta.EvaluationConfig.decode(reader, reader.uint32()); + break; + } + case 19: { + message.goldenRunMethod = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult} EvaluationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.goldenResult != null && message.hasOwnProperty("goldenResult")) { + properties.result = 1; + { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.verify(message.goldenResult); + if (error) + return "goldenResult." + error; + } + } + if (message.scenarioResult != null && message.hasOwnProperty("scenarioResult")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.verify(message.scenarioResult); + if (error) + return "scenarioResult." + 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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.evaluationStatus != null && message.hasOwnProperty("evaluationStatus")) + switch (message.evaluationStatus) { + default: + return "evaluationStatus: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) + if (!$util.isString(message.evaluationRun)) + return "evaluationRun: string expected"; + if (message.persona != null && message.hasOwnProperty("persona")) { + var error = $root.google.cloud.ces.v1beta.EvaluationPersona.verify(message.persona); + if (error) + return "persona." + error; + } + if (message.errorInfo != null && message.hasOwnProperty("errorInfo")) { + var error = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.verify(message.errorInfo); + if (error) + return "errorInfo." + error; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.initiatedBy != null && message.hasOwnProperty("initiatedBy")) + if (!$util.isString(message.initiatedBy)) + return "initiatedBy: string expected"; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (!$util.isString(message.appVersion)) + return "appVersion: string expected"; + if (message.appVersionDisplayName != null && message.hasOwnProperty("appVersionDisplayName")) + if (!$util.isString(message.appVersionDisplayName)) + return "appVersionDisplayName: string expected"; + if (message.changelog != null && message.hasOwnProperty("changelog")) + if (!$util.isString(message.changelog)) + return "changelog: string expected"; + if (message.changelogCreateTime != null && message.hasOwnProperty("changelogCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.changelogCreateTime); + if (error) + return "changelogCreateTime." + error; + } + if (message.executionState != null && message.hasOwnProperty("executionState")) + switch (message.executionState) { + default: + return "executionState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.evaluationMetricsThresholds != null && message.hasOwnProperty("evaluationMetricsThresholds")) { + var error = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.verify(message.evaluationMetricsThresholds); + if (error) + return "evaluationMetricsThresholds." + error; + } + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.ces.v1beta.EvaluationConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) + switch (message.goldenRunMethod) { + default: + return "goldenRunMethod: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an EvaluationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult} EvaluationResult + */ + EvaluationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult(); + if (object.goldenResult != null) { + if (typeof object.goldenResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.goldenResult: object expected"); + message.goldenResult = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.fromObject(object.goldenResult); + } + if (object.scenarioResult != null) { + if (typeof object.scenarioResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.scenarioResult: object expected"); + message.scenarioResult = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.fromObject(object.scenarioResult); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + switch (object.evaluationStatus) { + default: + if (typeof object.evaluationStatus === "number") { + message.evaluationStatus = object.evaluationStatus; + break; + } + break; + case "OUTCOME_UNSPECIFIED": + case 0: + message.evaluationStatus = 0; + break; + case "PASS": + case 1: + message.evaluationStatus = 1; + break; + case "FAIL": + case 2: + message.evaluationStatus = 2; + break; + } + if (object.evaluationRun != null) + message.evaluationRun = String(object.evaluationRun); + if (object.persona != null) { + if (typeof object.persona !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.persona: object expected"); + message.persona = $root.google.cloud.ces.v1beta.EvaluationPersona.fromObject(object.persona); + } + if (object.errorInfo != null) { + if (typeof object.errorInfo !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.errorInfo: object expected"); + message.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.fromObject(object.errorInfo); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.initiatedBy != null) + message.initiatedBy = String(object.initiatedBy); + if (object.appVersion != null) + message.appVersion = String(object.appVersion); + if (object.appVersionDisplayName != null) + message.appVersionDisplayName = String(object.appVersionDisplayName); + if (object.changelog != null) + message.changelog = String(object.changelog); + if (object.changelogCreateTime != null) { + if (typeof object.changelogCreateTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.changelogCreateTime: object expected"); + message.changelogCreateTime = $root.google.protobuf.Timestamp.fromObject(object.changelogCreateTime); + } + switch (object.executionState) { + default: + if (typeof object.executionState === "number") { + message.executionState = object.executionState; + break; + } + break; + case "EXECUTION_STATE_UNSPECIFIED": + case 0: + message.executionState = 0; + break; + case "RUNNING": + case 1: + message.executionState = 1; + break; + case "COMPLETED": + case 2: + message.executionState = 2; + break; + case "ERROR": + case 3: + message.executionState = 3; + break; + } + if (object.evaluationMetricsThresholds != null) { + if (typeof object.evaluationMetricsThresholds !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.evaluationMetricsThresholds: object expected"); + message.evaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.fromObject(object.evaluationMetricsThresholds); + } + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.config: object expected"); + message.config = $root.google.cloud.ces.v1beta.EvaluationConfig.fromObject(object.config); + } + switch (object.goldenRunMethod) { + default: + if (typeof object.goldenRunMethod === "number") { + message.goldenRunMethod = object.goldenRunMethod; + break; + } + break; + case "GOLDEN_RUN_METHOD_UNSPECIFIED": + case 0: + message.goldenRunMethod = 0; + break; + case "STABLE": + case 1: + message.goldenRunMethod = 1; + break; + case "NAIVE": + case 2: + message.goldenRunMethod = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an EvaluationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult} message EvaluationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.evaluationStatus = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; + object.createTime = null; + object.evaluationRun = ""; + object.initiatedBy = ""; + object.appVersion = ""; + object.executionState = options.enums === String ? "EXECUTION_STATE_UNSPECIFIED" : 0; + object.evaluationMetricsThresholds = null; + object.appVersionDisplayName = ""; + object.error = null; + object.errorInfo = null; + object.persona = null; + object.config = null; + object.goldenRunMethod = options.enums === String ? "GOLDEN_RUN_METHOD_UNSPECIFIED" : 0; + object.changelog = ""; + object.changelogCreateTime = 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.evaluationStatus != null && message.hasOwnProperty("evaluationStatus")) + object.evaluationStatus = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.evaluationStatus] === undefined ? message.evaluationStatus : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.evaluationStatus] : message.evaluationStatus; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) + object.evaluationRun = message.evaluationRun; + if (message.goldenResult != null && message.hasOwnProperty("goldenResult")) { + object.goldenResult = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.toObject(message.goldenResult, options); + if (options.oneofs) + object.result = "goldenResult"; + } + if (message.scenarioResult != null && message.hasOwnProperty("scenarioResult")) { + object.scenarioResult = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.toObject(message.scenarioResult, options); + if (options.oneofs) + object.result = "scenarioResult"; + } + if (message.initiatedBy != null && message.hasOwnProperty("initiatedBy")) + object.initiatedBy = message.initiatedBy; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + object.appVersion = message.appVersion; + if (message.executionState != null && message.hasOwnProperty("executionState")) + object.executionState = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.ExecutionState[message.executionState] === undefined ? message.executionState : $root.google.cloud.ces.v1beta.EvaluationResult.ExecutionState[message.executionState] : message.executionState; + if (message.evaluationMetricsThresholds != null && message.hasOwnProperty("evaluationMetricsThresholds")) + object.evaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.toObject(message.evaluationMetricsThresholds, options); + if (message.appVersionDisplayName != null && message.hasOwnProperty("appVersionDisplayName")) + object.appVersionDisplayName = message.appVersionDisplayName; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.errorInfo != null && message.hasOwnProperty("errorInfo")) + object.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.toObject(message.errorInfo, options); + if (message.persona != null && message.hasOwnProperty("persona")) + object.persona = $root.google.cloud.ces.v1beta.EvaluationPersona.toObject(message.persona, options); + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.ces.v1beta.EvaluationConfig.toObject(message.config, options); + if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) + object.goldenRunMethod = options.enums === String ? $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] === undefined ? message.goldenRunMethod : $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] : message.goldenRunMethod; + if (message.changelog != null && message.hasOwnProperty("changelog")) + object.changelog = message.changelog; + if (message.changelogCreateTime != null && message.hasOwnProperty("changelogCreateTime")) + object.changelogCreateTime = $root.google.protobuf.Timestamp.toObject(message.changelogCreateTime, options); + return object; + }; + + /** + * Converts this EvaluationResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + * @returns {Object.} JSON object + */ + EvaluationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult"; + }; + + EvaluationResult.GoldenExpectationOutcome = (function() { + + /** + * Properties of a GoldenExpectationOutcome. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IGoldenExpectationOutcome + * @property {google.cloud.ces.v1beta.IToolCall|null} [observedToolCall] GoldenExpectationOutcome observedToolCall + * @property {google.cloud.ces.v1beta.IToolResponse|null} [observedToolResponse] GoldenExpectationOutcome observedToolResponse + * @property {google.cloud.ces.v1beta.IMessage|null} [observedAgentResponse] GoldenExpectationOutcome observedAgentResponse + * @property {google.cloud.ces.v1beta.IAgentTransfer|null} [observedAgentTransfer] GoldenExpectationOutcome observedAgentTransfer + * @property {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null} [expectation] GoldenExpectationOutcome expectation + * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [outcome] GoldenExpectationOutcome outcome + * @property {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null} [semanticSimilarityResult] GoldenExpectationOutcome semanticSimilarityResult + * @property {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult|null} [toolInvocationResult] GoldenExpectationOutcome toolInvocationResult + */ + + /** + * Constructs a new GoldenExpectationOutcome. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a GoldenExpectationOutcome. + * @implements IGoldenExpectationOutcome + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome=} [properties] Properties to set + */ + function GoldenExpectationOutcome(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoldenExpectationOutcome observedToolCall. + * @member {google.cloud.ces.v1beta.IToolCall|null|undefined} observedToolCall + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + */ + GoldenExpectationOutcome.prototype.observedToolCall = null; + + /** + * GoldenExpectationOutcome observedToolResponse. + * @member {google.cloud.ces.v1beta.IToolResponse|null|undefined} observedToolResponse + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + */ + GoldenExpectationOutcome.prototype.observedToolResponse = null; + + /** + * GoldenExpectationOutcome observedAgentResponse. + * @member {google.cloud.ces.v1beta.IMessage|null|undefined} observedAgentResponse + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + */ + GoldenExpectationOutcome.prototype.observedAgentResponse = null; + + /** + * GoldenExpectationOutcome observedAgentTransfer. + * @member {google.cloud.ces.v1beta.IAgentTransfer|null|undefined} observedAgentTransfer + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + */ + GoldenExpectationOutcome.prototype.observedAgentTransfer = null; + + /** + * GoldenExpectationOutcome expectation. + * @member {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null|undefined} expectation + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + */ + GoldenExpectationOutcome.prototype.expectation = null; + + /** + * GoldenExpectationOutcome outcome. + * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} outcome + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + */ + GoldenExpectationOutcome.prototype.outcome = 0; + + /** + * GoldenExpectationOutcome semanticSimilarityResult. + * @member {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null|undefined} semanticSimilarityResult + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + */ + GoldenExpectationOutcome.prototype.semanticSimilarityResult = null; + + /** + * GoldenExpectationOutcome toolInvocationResult. + * @member {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult|null|undefined} toolInvocationResult + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + */ + GoldenExpectationOutcome.prototype.toolInvocationResult = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GoldenExpectationOutcome result. + * @member {"observedToolCall"|"observedToolResponse"|"observedAgentResponse"|"observedAgentTransfer"|undefined} result + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + */ + Object.defineProperty(GoldenExpectationOutcome.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["observedToolCall", "observedToolResponse", "observedAgentResponse", "observedAgentTransfer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GoldenExpectationOutcome instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome} GoldenExpectationOutcome instance + */ + GoldenExpectationOutcome.create = function create(properties) { + return new GoldenExpectationOutcome(properties); + }; + + /** + * Encodes the specified GoldenExpectationOutcome message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome} message GoldenExpectationOutcome message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenExpectationOutcome.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expectation != null && Object.hasOwnProperty.call(message, "expectation")) + $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.encode(message.expectation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.observedToolCall != null && Object.hasOwnProperty.call(message, "observedToolCall")) + $root.google.cloud.ces.v1beta.ToolCall.encode(message.observedToolCall, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.observedToolResponse != null && Object.hasOwnProperty.call(message, "observedToolResponse")) + $root.google.cloud.ces.v1beta.ToolResponse.encode(message.observedToolResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.observedAgentResponse != null && Object.hasOwnProperty.call(message, "observedAgentResponse")) + $root.google.cloud.ces.v1beta.Message.encode(message.observedAgentResponse, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.observedAgentTransfer != null && Object.hasOwnProperty.call(message, "observedAgentTransfer")) + $root.google.cloud.ces.v1beta.AgentTransfer.encode(message.observedAgentTransfer, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.outcome); + if (message.semanticSimilarityResult != null && Object.hasOwnProperty.call(message, "semanticSimilarityResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.encode(message.semanticSimilarityResult, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.toolInvocationResult != null && Object.hasOwnProperty.call(message, "toolInvocationResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.encode(message.toolInvocationResult, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoldenExpectationOutcome message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome} message GoldenExpectationOutcome message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenExpectationOutcome.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoldenExpectationOutcome message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome} GoldenExpectationOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenExpectationOutcome.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.observedToolCall = $root.google.cloud.ces.v1beta.ToolCall.decode(reader, reader.uint32()); + break; + } + case 3: { + message.observedToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32()); + break; + } + case 4: { + message.observedAgentResponse = $root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32()); + break; + } + case 5: { + message.observedAgentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.decode(reader, reader.uint32()); + break; + } + case 1: { + message.expectation = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.decode(reader, reader.uint32()); + break; + } + case 6: { + message.outcome = reader.int32(); + break; + } + case 7: { + message.semanticSimilarityResult = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.decode(reader, reader.uint32()); + break; + } + case 8: { + message.toolInvocationResult = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoldenExpectationOutcome message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome} GoldenExpectationOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenExpectationOutcome.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoldenExpectationOutcome message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoldenExpectationOutcome.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.observedToolCall != null && message.hasOwnProperty("observedToolCall")) { + properties.result = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolCall.verify(message.observedToolCall); + if (error) + return "observedToolCall." + error; + } + } + if (message.observedToolResponse != null && message.hasOwnProperty("observedToolResponse")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.observedToolResponse); + if (error) + return "observedToolResponse." + error; + } + } + if (message.observedAgentResponse != null && message.hasOwnProperty("observedAgentResponse")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.cloud.ces.v1beta.Message.verify(message.observedAgentResponse); + if (error) + return "observedAgentResponse." + error; + } + } + if (message.observedAgentTransfer != null && message.hasOwnProperty("observedAgentTransfer")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.cloud.ces.v1beta.AgentTransfer.verify(message.observedAgentTransfer); + if (error) + return "observedAgentTransfer." + error; + } + } + if (message.expectation != null && message.hasOwnProperty("expectation")) { + var error = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.verify(message.expectation); + if (error) + return "expectation." + error; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + switch (message.outcome) { + default: + return "outcome: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.semanticSimilarityResult != null && message.hasOwnProperty("semanticSimilarityResult")) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.verify(message.semanticSimilarityResult); + if (error) + return "semanticSimilarityResult." + error; + } + if (message.toolInvocationResult != null && message.hasOwnProperty("toolInvocationResult")) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.verify(message.toolInvocationResult); + if (error) + return "toolInvocationResult." + error; + } + return null; + }; + + /** + * Creates a GoldenExpectationOutcome message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome} GoldenExpectationOutcome + */ + GoldenExpectationOutcome.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome(); + if (object.observedToolCall != null) { + if (typeof object.observedToolCall !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.observedToolCall: object expected"); + message.observedToolCall = $root.google.cloud.ces.v1beta.ToolCall.fromObject(object.observedToolCall); + } + if (object.observedToolResponse != null) { + if (typeof object.observedToolResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.observedToolResponse: object expected"); + message.observedToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.observedToolResponse); + } + if (object.observedAgentResponse != null) { + if (typeof object.observedAgentResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.observedAgentResponse: object expected"); + message.observedAgentResponse = $root.google.cloud.ces.v1beta.Message.fromObject(object.observedAgentResponse); + } + if (object.observedAgentTransfer != null) { + if (typeof object.observedAgentTransfer !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.observedAgentTransfer: object expected"); + message.observedAgentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.fromObject(object.observedAgentTransfer); + } + if (object.expectation != null) { + if (typeof object.expectation !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.expectation: object expected"); + message.expectation = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.fromObject(object.expectation); + } + switch (object.outcome) { + default: + if (typeof object.outcome === "number") { + message.outcome = object.outcome; + break; + } + break; + case "OUTCOME_UNSPECIFIED": + case 0: + message.outcome = 0; + break; + case "PASS": + case 1: + message.outcome = 1; + break; + case "FAIL": + case 2: + message.outcome = 2; + break; + } + if (object.semanticSimilarityResult != null) { + if (typeof object.semanticSimilarityResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.semanticSimilarityResult: object expected"); + message.semanticSimilarityResult = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.fromObject(object.semanticSimilarityResult); + } + if (object.toolInvocationResult != null) { + if (typeof object.toolInvocationResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.toolInvocationResult: object expected"); + message.toolInvocationResult = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.fromObject(object.toolInvocationResult); + } + return message; + }; + + /** + * Creates a plain object from a GoldenExpectationOutcome message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome} message GoldenExpectationOutcome + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoldenExpectationOutcome.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expectation = null; + object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; + object.semanticSimilarityResult = null; + object.toolInvocationResult = null; + } + if (message.expectation != null && message.hasOwnProperty("expectation")) + object.expectation = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.toObject(message.expectation, options); + if (message.observedToolCall != null && message.hasOwnProperty("observedToolCall")) { + object.observedToolCall = $root.google.cloud.ces.v1beta.ToolCall.toObject(message.observedToolCall, options); + if (options.oneofs) + object.result = "observedToolCall"; + } + if (message.observedToolResponse != null && message.hasOwnProperty("observedToolResponse")) { + object.observedToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.observedToolResponse, options); + if (options.oneofs) + object.result = "observedToolResponse"; + } + if (message.observedAgentResponse != null && message.hasOwnProperty("observedAgentResponse")) { + object.observedAgentResponse = $root.google.cloud.ces.v1beta.Message.toObject(message.observedAgentResponse, options); + if (options.oneofs) + object.result = "observedAgentResponse"; + } + if (message.observedAgentTransfer != null && message.hasOwnProperty("observedAgentTransfer")) { + object.observedAgentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.toObject(message.observedAgentTransfer, options); + if (options.oneofs) + object.result = "observedAgentTransfer"; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + object.outcome = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] : message.outcome; + if (message.semanticSimilarityResult != null && message.hasOwnProperty("semanticSimilarityResult")) + object.semanticSimilarityResult = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.toObject(message.semanticSimilarityResult, options); + if (message.toolInvocationResult != null && message.hasOwnProperty("toolInvocationResult")) + object.toolInvocationResult = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.toObject(message.toolInvocationResult, options); + return object; + }; + + /** + * Converts this GoldenExpectationOutcome to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + * @returns {Object.} JSON object + */ + GoldenExpectationOutcome.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoldenExpectationOutcome + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoldenExpectationOutcome.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome"; + }; + + GoldenExpectationOutcome.ToolInvocationResult = (function() { + + /** + * Properties of a ToolInvocationResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @interface IToolInvocationResult + * @property {number|null} [parameterCorrectnessScore] ToolInvocationResult parameterCorrectnessScore + * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [outcome] ToolInvocationResult outcome + * @property {string|null} [explanation] ToolInvocationResult explanation + */ + + /** + * Constructs a new ToolInvocationResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @classdesc Represents a ToolInvocationResult. + * @implements IToolInvocationResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult=} [properties] Properties to set + */ + function ToolInvocationResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolInvocationResult parameterCorrectnessScore. + * @member {number|null|undefined} parameterCorrectnessScore + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @instance + */ + ToolInvocationResult.prototype.parameterCorrectnessScore = null; + + /** + * ToolInvocationResult outcome. + * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} outcome + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @instance + */ + ToolInvocationResult.prototype.outcome = 0; + + /** + * ToolInvocationResult explanation. + * @member {string} explanation + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @instance + */ + ToolInvocationResult.prototype.explanation = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ToolInvocationResult.prototype, "_parameterCorrectnessScore", { + get: $util.oneOfGetter($oneOfFields = ["parameterCorrectnessScore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ToolInvocationResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult} ToolInvocationResult instance + */ + ToolInvocationResult.create = function create(properties) { + return new ToolInvocationResult(properties); + }; + + /** + * Encodes the specified ToolInvocationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult} message ToolInvocationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolInvocationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parameterCorrectnessScore != null && Object.hasOwnProperty.call(message, "parameterCorrectnessScore")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.parameterCorrectnessScore); + if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.outcome); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.explanation); + return writer; + }; + + /** + * Encodes the specified ToolInvocationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult} message ToolInvocationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolInvocationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolInvocationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult} ToolInvocationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolInvocationResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parameterCorrectnessScore = reader.float(); + break; + } + case 2: { + message.outcome = reader.int32(); + break; + } + case 3: { + message.explanation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolInvocationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult} ToolInvocationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolInvocationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolInvocationResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolInvocationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parameterCorrectnessScore != null && message.hasOwnProperty("parameterCorrectnessScore")) { + properties._parameterCorrectnessScore = 1; + if (typeof message.parameterCorrectnessScore !== "number") + return "parameterCorrectnessScore: number expected"; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + switch (message.outcome) { + default: + return "outcome: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.explanation != null && message.hasOwnProperty("explanation")) + if (!$util.isString(message.explanation)) + return "explanation: string expected"; + return null; + }; + + /** + * Creates a ToolInvocationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult} ToolInvocationResult + */ + ToolInvocationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult(); + if (object.parameterCorrectnessScore != null) + message.parameterCorrectnessScore = Number(object.parameterCorrectnessScore); + switch (object.outcome) { + default: + if (typeof object.outcome === "number") { + message.outcome = object.outcome; + break; + } + break; + case "OUTCOME_UNSPECIFIED": + case 0: + message.outcome = 0; + break; + case "PASS": + case 1: + message.outcome = 1; + break; + case "FAIL": + case 2: + message.outcome = 2; + break; + } + if (object.explanation != null) + message.explanation = String(object.explanation); + return message; + }; + + /** + * Creates a plain object from a ToolInvocationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult} message ToolInvocationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolInvocationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; + object.explanation = ""; + } + if (message.parameterCorrectnessScore != null && message.hasOwnProperty("parameterCorrectnessScore")) { + object.parameterCorrectnessScore = options.json && !isFinite(message.parameterCorrectnessScore) ? String(message.parameterCorrectnessScore) : message.parameterCorrectnessScore; + if (options.oneofs) + object._parameterCorrectnessScore = "parameterCorrectnessScore"; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + object.outcome = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] : message.outcome; + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = message.explanation; + return object; + }; + + /** + * Converts this ToolInvocationResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @instance + * @returns {Object.} JSON object + */ + ToolInvocationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolInvocationResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolInvocationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult"; + }; + + return ToolInvocationResult; + })(); + + return GoldenExpectationOutcome; + })(); + + EvaluationResult.EvaluationExpectationResult = (function() { + + /** + * Properties of an EvaluationExpectationResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IEvaluationExpectationResult + * @property {string|null} [evaluationExpectation] EvaluationExpectationResult evaluationExpectation + * @property {string|null} [prompt] EvaluationExpectationResult prompt + * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [outcome] EvaluationExpectationResult outcome + * @property {string|null} [explanation] EvaluationExpectationResult explanation + */ + + /** + * Constructs a new EvaluationExpectationResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents an EvaluationExpectationResult. + * @implements IEvaluationExpectationResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult=} [properties] Properties to set + */ + function EvaluationExpectationResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationExpectationResult evaluationExpectation. + * @member {string} evaluationExpectation + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @instance + */ + EvaluationExpectationResult.prototype.evaluationExpectation = ""; + + /** + * EvaluationExpectationResult prompt. + * @member {string} prompt + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @instance + */ + EvaluationExpectationResult.prototype.prompt = ""; + + /** + * EvaluationExpectationResult outcome. + * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} outcome + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @instance + */ + EvaluationExpectationResult.prototype.outcome = 0; + + /** + * EvaluationExpectationResult explanation. + * @member {string} explanation + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @instance + */ + EvaluationExpectationResult.prototype.explanation = ""; + + /** + * Creates a new EvaluationExpectationResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult} EvaluationExpectationResult instance + */ + EvaluationExpectationResult.create = function create(properties) { + return new EvaluationExpectationResult(properties); + }; + + /** + * Encodes the specified EvaluationExpectationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult} message EvaluationExpectationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationExpectationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationExpectation != null && Object.hasOwnProperty.call(message, "evaluationExpectation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.evaluationExpectation); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.prompt); + if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.outcome); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.explanation); + return writer; + }; + + /** + * Encodes the specified EvaluationExpectationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult} message EvaluationExpectationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationExpectationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationExpectationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult} EvaluationExpectationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationExpectationResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.evaluationExpectation = reader.string(); + break; + } + case 2: { + message.prompt = reader.string(); + break; + } + case 3: { + message.outcome = reader.int32(); + break; + } + case 4: { + message.explanation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationExpectationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult} EvaluationExpectationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationExpectationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationExpectationResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationExpectationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationExpectation != null && message.hasOwnProperty("evaluationExpectation")) + if (!$util.isString(message.evaluationExpectation)) + return "evaluationExpectation: string expected"; + if (message.prompt != null && message.hasOwnProperty("prompt")) + if (!$util.isString(message.prompt)) + return "prompt: string expected"; + if (message.outcome != null && message.hasOwnProperty("outcome")) + switch (message.outcome) { + default: + return "outcome: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.explanation != null && message.hasOwnProperty("explanation")) + if (!$util.isString(message.explanation)) + return "explanation: string expected"; + return null; + }; + + /** + * Creates an EvaluationExpectationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult} EvaluationExpectationResult + */ + EvaluationExpectationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult(); + if (object.evaluationExpectation != null) + message.evaluationExpectation = String(object.evaluationExpectation); + if (object.prompt != null) + message.prompt = String(object.prompt); + switch (object.outcome) { + default: + if (typeof object.outcome === "number") { + message.outcome = object.outcome; + break; + } + break; + case "OUTCOME_UNSPECIFIED": + case 0: + message.outcome = 0; + break; + case "PASS": + case 1: + message.outcome = 1; + break; + case "FAIL": + case 2: + message.outcome = 2; + break; + } + if (object.explanation != null) + message.explanation = String(object.explanation); + return message; + }; + + /** + * Creates a plain object from an EvaluationExpectationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult} message EvaluationExpectationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationExpectationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.evaluationExpectation = ""; + object.prompt = ""; + object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; + object.explanation = ""; + } + if (message.evaluationExpectation != null && message.hasOwnProperty("evaluationExpectation")) + object.evaluationExpectation = message.evaluationExpectation; + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = message.prompt; + if (message.outcome != null && message.hasOwnProperty("outcome")) + object.outcome = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] : message.outcome; + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = message.explanation; + return object; + }; + + /** + * Converts this EvaluationExpectationResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @instance + * @returns {Object.} JSON object + */ + EvaluationExpectationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationExpectationResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationExpectationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult"; + }; + + return EvaluationExpectationResult; + })(); + + EvaluationResult.GoldenResult = (function() { + + /** + * Properties of a GoldenResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IGoldenResult + * @property {Array.|null} [turnReplayResults] GoldenResult turnReplayResults + * @property {Array.|null} [evaluationExpectationResults] GoldenResult evaluationExpectationResults + */ + + /** + * Constructs a new GoldenResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a GoldenResult. + * @implements IGoldenResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenResult=} [properties] Properties to set + */ + function GoldenResult(properties) { + this.turnReplayResults = []; + this.evaluationExpectationResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoldenResult turnReplayResults. + * @member {Array.} turnReplayResults + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @instance + */ + GoldenResult.prototype.turnReplayResults = $util.emptyArray; + + /** + * GoldenResult evaluationExpectationResults. + * @member {Array.} evaluationExpectationResults + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @instance + */ + GoldenResult.prototype.evaluationExpectationResults = $util.emptyArray; + + /** + * Creates a new GoldenResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult} GoldenResult instance + */ + GoldenResult.create = function create(properties) { + return new GoldenResult(properties); + }; + + /** + * Encodes the specified GoldenResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenResult} message GoldenResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.turnReplayResults != null && message.turnReplayResults.length) + for (var i = 0; i < message.turnReplayResults.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.encode(message.turnReplayResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.evaluationExpectationResults != null && message.evaluationExpectationResults.length) + for (var i = 0; i < message.evaluationExpectationResults.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.encode(message.evaluationExpectationResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoldenResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenResult} message GoldenResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoldenResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult} GoldenResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.turnReplayResults && message.turnReplayResults.length)) + message.turnReplayResults = []; + message.turnReplayResults.push($root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.evaluationExpectationResults && message.evaluationExpectationResults.length)) + message.evaluationExpectationResults = []; + message.evaluationExpectationResults.push($root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoldenResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult} GoldenResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoldenResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoldenResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.turnReplayResults != null && message.hasOwnProperty("turnReplayResults")) { + if (!Array.isArray(message.turnReplayResults)) + return "turnReplayResults: array expected"; + for (var i = 0; i < message.turnReplayResults.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.verify(message.turnReplayResults[i]); + if (error) + return "turnReplayResults." + error; + } + } + if (message.evaluationExpectationResults != null && message.hasOwnProperty("evaluationExpectationResults")) { + if (!Array.isArray(message.evaluationExpectationResults)) + return "evaluationExpectationResults: array expected"; + for (var i = 0; i < message.evaluationExpectationResults.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.verify(message.evaluationExpectationResults[i]); + if (error) + return "evaluationExpectationResults." + error; + } + } + return null; + }; + + /** + * Creates a GoldenResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult} GoldenResult + */ + GoldenResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult(); + if (object.turnReplayResults) { + if (!Array.isArray(object.turnReplayResults)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.turnReplayResults: array expected"); + message.turnReplayResults = []; + for (var i = 0; i < object.turnReplayResults.length; ++i) { + if (typeof object.turnReplayResults[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.turnReplayResults: object expected"); + message.turnReplayResults[i] = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.fromObject(object.turnReplayResults[i]); + } + } + if (object.evaluationExpectationResults) { + if (!Array.isArray(object.evaluationExpectationResults)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.evaluationExpectationResults: array expected"); + message.evaluationExpectationResults = []; + for (var i = 0; i < object.evaluationExpectationResults.length; ++i) { + if (typeof object.evaluationExpectationResults[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.evaluationExpectationResults: object expected"); + message.evaluationExpectationResults[i] = $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.fromObject(object.evaluationExpectationResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GoldenResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenResult} message GoldenResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoldenResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.turnReplayResults = []; + object.evaluationExpectationResults = []; + } + if (message.turnReplayResults && message.turnReplayResults.length) { + object.turnReplayResults = []; + for (var j = 0; j < message.turnReplayResults.length; ++j) + object.turnReplayResults[j] = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.toObject(message.turnReplayResults[j], options); + } + if (message.evaluationExpectationResults && message.evaluationExpectationResults.length) { + object.evaluationExpectationResults = []; + for (var j = 0; j < message.evaluationExpectationResults.length; ++j) + object.evaluationExpectationResults[j] = $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.toObject(message.evaluationExpectationResults[j], options); + } + return object; + }; + + /** + * Converts this GoldenResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @instance + * @returns {Object.} JSON object + */ + GoldenResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoldenResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoldenResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.GoldenResult"; + }; + + GoldenResult.TurnReplayResult = (function() { + + /** + * Properties of a TurnReplayResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @interface ITurnReplayResult + * @property {string|null} [conversation] TurnReplayResult conversation + * @property {Array.|null} [expectationOutcome] TurnReplayResult expectationOutcome + * @property {google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult|null} [hallucinationResult] TurnReplayResult hallucinationResult + * @property {number|null} [toolInvocationScore] TurnReplayResult toolInvocationScore + * @property {number|null} [toolOrderedInvocationScore] TurnReplayResult toolOrderedInvocationScore + * @property {google.protobuf.IDuration|null} [turnLatency] TurnReplayResult turnLatency + * @property {Array.|null} [toolCallLatencies] TurnReplayResult toolCallLatencies + * @property {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null} [semanticSimilarityResult] TurnReplayResult semanticSimilarityResult + * @property {google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult|null} [overallToolInvocationResult] TurnReplayResult overallToolInvocationResult + * @property {google.cloud.ces.v1beta.IEvaluationErrorInfo|null} [errorInfo] TurnReplayResult errorInfo + * @property {Array.|null} [spanLatencies] TurnReplayResult spanLatencies + */ + + /** + * Constructs a new TurnReplayResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @classdesc Represents a TurnReplayResult. + * @implements ITurnReplayResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult=} [properties] Properties to set + */ + function TurnReplayResult(properties) { + this.expectationOutcome = []; + this.toolCallLatencies = []; + this.spanLatencies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TurnReplayResult conversation. + * @member {string} conversation + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.conversation = ""; + + /** + * TurnReplayResult expectationOutcome. + * @member {Array.} expectationOutcome + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.expectationOutcome = $util.emptyArray; + + /** + * TurnReplayResult hallucinationResult. + * @member {google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult|null|undefined} hallucinationResult + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.hallucinationResult = null; + + /** + * TurnReplayResult toolInvocationScore. + * @member {number} toolInvocationScore + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.toolInvocationScore = 0; + + /** + * TurnReplayResult toolOrderedInvocationScore. + * @member {number|null|undefined} toolOrderedInvocationScore + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.toolOrderedInvocationScore = null; + + /** + * TurnReplayResult turnLatency. + * @member {google.protobuf.IDuration|null|undefined} turnLatency + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.turnLatency = null; + + /** + * TurnReplayResult toolCallLatencies. + * @member {Array.} toolCallLatencies + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.toolCallLatencies = $util.emptyArray; + + /** + * TurnReplayResult semanticSimilarityResult. + * @member {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null|undefined} semanticSimilarityResult + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.semanticSimilarityResult = null; + + /** + * TurnReplayResult overallToolInvocationResult. + * @member {google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult|null|undefined} overallToolInvocationResult + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.overallToolInvocationResult = null; + + /** + * TurnReplayResult errorInfo. + * @member {google.cloud.ces.v1beta.IEvaluationErrorInfo|null|undefined} errorInfo + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.errorInfo = null; + + /** + * TurnReplayResult spanLatencies. + * @member {Array.} spanLatencies + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.spanLatencies = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TurnReplayResult.prototype, "_toolOrderedInvocationScore", { + get: $util.oneOfGetter($oneOfFields = ["toolOrderedInvocationScore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TurnReplayResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult} TurnReplayResult instance + */ + TurnReplayResult.create = function create(properties) { + return new TurnReplayResult(properties); + }; + + /** + * Encodes the specified TurnReplayResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult} message TurnReplayResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TurnReplayResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversation); + if (message.expectationOutcome != null && message.expectationOutcome.length) + for (var i = 0; i < message.expectationOutcome.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.encode(message.expectationOutcome[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.hallucinationResult != null && Object.hasOwnProperty.call(message, "hallucinationResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.encode(message.hallucinationResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.toolInvocationScore != null && Object.hasOwnProperty.call(message, "toolInvocationScore")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.toolInvocationScore); + if (message.toolOrderedInvocationScore != null && Object.hasOwnProperty.call(message, "toolOrderedInvocationScore")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.toolOrderedInvocationScore); + if (message.turnLatency != null && Object.hasOwnProperty.call(message, "turnLatency")) + $root.google.protobuf.Duration.encode(message.turnLatency, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.toolCallLatencies != null && message.toolCallLatencies.length) + for (var i = 0; i < message.toolCallLatencies.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.encode(message.toolCallLatencies[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.semanticSimilarityResult != null && Object.hasOwnProperty.call(message, "semanticSimilarityResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.encode(message.semanticSimilarityResult, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.overallToolInvocationResult != null && Object.hasOwnProperty.call(message, "overallToolInvocationResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.encode(message.overallToolInvocationResult, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.errorInfo != null && Object.hasOwnProperty.call(message, "errorInfo")) + $root.google.cloud.ces.v1beta.EvaluationErrorInfo.encode(message.errorInfo, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.spanLatencies != null && message.spanLatencies.length) + for (var i = 0; i < message.spanLatencies.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.encode(message.spanLatencies[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TurnReplayResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult} message TurnReplayResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TurnReplayResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TurnReplayResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult} TurnReplayResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TurnReplayResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.conversation = reader.string(); + break; + } + case 2: { + if (!(message.expectationOutcome && message.expectationOutcome.length)) + message.expectationOutcome = []; + message.expectationOutcome.push($root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.decode(reader, reader.uint32())); + break; + } + case 3: { + message.hallucinationResult = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.decode(reader, reader.uint32()); + break; + } + case 4: { + message.toolInvocationScore = reader.float(); + break; + } + case 5: { + message.toolOrderedInvocationScore = reader.float(); + break; + } + case 6: { + message.turnLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.toolCallLatencies && message.toolCallLatencies.length)) + message.toolCallLatencies = []; + message.toolCallLatencies.push($root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.decode(reader, reader.uint32())); + break; + } + case 8: { + message.semanticSimilarityResult = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.decode(reader, reader.uint32()); + break; + } + case 9: { + message.overallToolInvocationResult = $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.decode(reader, reader.uint32()); + break; + } + case 10: { + message.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.spanLatencies && message.spanLatencies.length)) + message.spanLatencies = []; + message.spanLatencies.push($root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TurnReplayResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult} TurnReplayResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TurnReplayResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TurnReplayResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TurnReplayResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.conversation != null && message.hasOwnProperty("conversation")) + if (!$util.isString(message.conversation)) + return "conversation: string expected"; + if (message.expectationOutcome != null && message.hasOwnProperty("expectationOutcome")) { + if (!Array.isArray(message.expectationOutcome)) + return "expectationOutcome: array expected"; + for (var i = 0; i < message.expectationOutcome.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.verify(message.expectationOutcome[i]); + if (error) + return "expectationOutcome." + error; + } + } + if (message.hallucinationResult != null && message.hasOwnProperty("hallucinationResult")) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.verify(message.hallucinationResult); + if (error) + return "hallucinationResult." + error; + } + if (message.toolInvocationScore != null && message.hasOwnProperty("toolInvocationScore")) + if (typeof message.toolInvocationScore !== "number") + return "toolInvocationScore: number expected"; + if (message.toolOrderedInvocationScore != null && message.hasOwnProperty("toolOrderedInvocationScore")) { + properties._toolOrderedInvocationScore = 1; + if (typeof message.toolOrderedInvocationScore !== "number") + return "toolOrderedInvocationScore: number expected"; + } + if (message.turnLatency != null && message.hasOwnProperty("turnLatency")) { + var error = $root.google.protobuf.Duration.verify(message.turnLatency); + if (error) + return "turnLatency." + error; + } + if (message.toolCallLatencies != null && message.hasOwnProperty("toolCallLatencies")) { + if (!Array.isArray(message.toolCallLatencies)) + return "toolCallLatencies: array expected"; + for (var i = 0; i < message.toolCallLatencies.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.verify(message.toolCallLatencies[i]); + if (error) + return "toolCallLatencies." + error; + } + } + if (message.semanticSimilarityResult != null && message.hasOwnProperty("semanticSimilarityResult")) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.verify(message.semanticSimilarityResult); + if (error) + return "semanticSimilarityResult." + error; + } + if (message.overallToolInvocationResult != null && message.hasOwnProperty("overallToolInvocationResult")) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.verify(message.overallToolInvocationResult); + if (error) + return "overallToolInvocationResult." + error; + } + if (message.errorInfo != null && message.hasOwnProperty("errorInfo")) { + var error = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.verify(message.errorInfo); + if (error) + return "errorInfo." + error; + } + if (message.spanLatencies != null && message.hasOwnProperty("spanLatencies")) { + if (!Array.isArray(message.spanLatencies)) + return "spanLatencies: array expected"; + for (var i = 0; i < message.spanLatencies.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.verify(message.spanLatencies[i]); + if (error) + return "spanLatencies." + error; + } + } + return null; + }; + + /** + * Creates a TurnReplayResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult} TurnReplayResult + */ + TurnReplayResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult(); + if (object.conversation != null) + message.conversation = String(object.conversation); + if (object.expectationOutcome) { + if (!Array.isArray(object.expectationOutcome)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.expectationOutcome: array expected"); + message.expectationOutcome = []; + for (var i = 0; i < object.expectationOutcome.length; ++i) { + if (typeof object.expectationOutcome[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.expectationOutcome: object expected"); + message.expectationOutcome[i] = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.fromObject(object.expectationOutcome[i]); + } + } + if (object.hallucinationResult != null) { + if (typeof object.hallucinationResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.hallucinationResult: object expected"); + message.hallucinationResult = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.fromObject(object.hallucinationResult); + } + if (object.toolInvocationScore != null) + message.toolInvocationScore = Number(object.toolInvocationScore); + if (object.toolOrderedInvocationScore != null) + message.toolOrderedInvocationScore = Number(object.toolOrderedInvocationScore); + if (object.turnLatency != null) { + if (typeof object.turnLatency !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.turnLatency: object expected"); + message.turnLatency = $root.google.protobuf.Duration.fromObject(object.turnLatency); + } + if (object.toolCallLatencies) { + if (!Array.isArray(object.toolCallLatencies)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.toolCallLatencies: array expected"); + message.toolCallLatencies = []; + for (var i = 0; i < object.toolCallLatencies.length; ++i) { + if (typeof object.toolCallLatencies[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.toolCallLatencies: object expected"); + message.toolCallLatencies[i] = $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.fromObject(object.toolCallLatencies[i]); + } + } + if (object.semanticSimilarityResult != null) { + if (typeof object.semanticSimilarityResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.semanticSimilarityResult: object expected"); + message.semanticSimilarityResult = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.fromObject(object.semanticSimilarityResult); + } + if (object.overallToolInvocationResult != null) { + if (typeof object.overallToolInvocationResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.overallToolInvocationResult: object expected"); + message.overallToolInvocationResult = $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.fromObject(object.overallToolInvocationResult); + } + if (object.errorInfo != null) { + if (typeof object.errorInfo !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.errorInfo: object expected"); + message.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.fromObject(object.errorInfo); + } + if (object.spanLatencies) { + if (!Array.isArray(object.spanLatencies)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.spanLatencies: array expected"); + message.spanLatencies = []; + for (var i = 0; i < object.spanLatencies.length; ++i) { + if (typeof object.spanLatencies[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.spanLatencies: object expected"); + message.spanLatencies[i] = $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.fromObject(object.spanLatencies[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TurnReplayResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult} message TurnReplayResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TurnReplayResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.expectationOutcome = []; + object.toolCallLatencies = []; + object.spanLatencies = []; + } + if (options.defaults) { + object.conversation = ""; + object.hallucinationResult = null; + object.toolInvocationScore = 0; + object.turnLatency = null; + object.semanticSimilarityResult = null; + object.overallToolInvocationResult = null; + object.errorInfo = null; + } + if (message.conversation != null && message.hasOwnProperty("conversation")) + object.conversation = message.conversation; + if (message.expectationOutcome && message.expectationOutcome.length) { + object.expectationOutcome = []; + for (var j = 0; j < message.expectationOutcome.length; ++j) + object.expectationOutcome[j] = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.toObject(message.expectationOutcome[j], options); + } + if (message.hallucinationResult != null && message.hasOwnProperty("hallucinationResult")) + object.hallucinationResult = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.toObject(message.hallucinationResult, options); + if (message.toolInvocationScore != null && message.hasOwnProperty("toolInvocationScore")) + object.toolInvocationScore = options.json && !isFinite(message.toolInvocationScore) ? String(message.toolInvocationScore) : message.toolInvocationScore; + if (message.toolOrderedInvocationScore != null && message.hasOwnProperty("toolOrderedInvocationScore")) { + object.toolOrderedInvocationScore = options.json && !isFinite(message.toolOrderedInvocationScore) ? String(message.toolOrderedInvocationScore) : message.toolOrderedInvocationScore; + if (options.oneofs) + object._toolOrderedInvocationScore = "toolOrderedInvocationScore"; + } + if (message.turnLatency != null && message.hasOwnProperty("turnLatency")) + object.turnLatency = $root.google.protobuf.Duration.toObject(message.turnLatency, options); + if (message.toolCallLatencies && message.toolCallLatencies.length) { + object.toolCallLatencies = []; + for (var j = 0; j < message.toolCallLatencies.length; ++j) + object.toolCallLatencies[j] = $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.toObject(message.toolCallLatencies[j], options); + } + if (message.semanticSimilarityResult != null && message.hasOwnProperty("semanticSimilarityResult")) + object.semanticSimilarityResult = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.toObject(message.semanticSimilarityResult, options); + if (message.overallToolInvocationResult != null && message.hasOwnProperty("overallToolInvocationResult")) + object.overallToolInvocationResult = $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.toObject(message.overallToolInvocationResult, options); + if (message.errorInfo != null && message.hasOwnProperty("errorInfo")) + object.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.toObject(message.errorInfo, options); + if (message.spanLatencies && message.spanLatencies.length) { + object.spanLatencies = []; + for (var j = 0; j < message.spanLatencies.length; ++j) + object.spanLatencies[j] = $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.toObject(message.spanLatencies[j], options); + } + return object; + }; + + /** + * Converts this TurnReplayResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + * @returns {Object.} JSON object + */ + TurnReplayResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TurnReplayResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TurnReplayResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult"; + }; + + return TurnReplayResult; + })(); + + return GoldenResult; + })(); + + EvaluationResult.ScenarioRubricOutcome = (function() { + + /** + * Properties of a ScenarioRubricOutcome. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IScenarioRubricOutcome + * @property {string|null} [rubric] ScenarioRubricOutcome rubric + * @property {number|null} [score] ScenarioRubricOutcome score + * @property {string|null} [scoreExplanation] ScenarioRubricOutcome scoreExplanation + */ + + /** + * Constructs a new ScenarioRubricOutcome. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a ScenarioRubricOutcome. + * @implements IScenarioRubricOutcome + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome=} [properties] Properties to set + */ + function ScenarioRubricOutcome(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScenarioRubricOutcome rubric. + * @member {string} rubric + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @instance + */ + ScenarioRubricOutcome.prototype.rubric = ""; + + /** + * ScenarioRubricOutcome score. + * @member {number|null|undefined} score + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @instance + */ + ScenarioRubricOutcome.prototype.score = null; + + /** + * ScenarioRubricOutcome scoreExplanation. + * @member {string} scoreExplanation + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @instance + */ + ScenarioRubricOutcome.prototype.scoreExplanation = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ScenarioRubricOutcome.prototype, "_score", { + get: $util.oneOfGetter($oneOfFields = ["score"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ScenarioRubricOutcome instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome} ScenarioRubricOutcome instance + */ + ScenarioRubricOutcome.create = function create(properties) { + return new ScenarioRubricOutcome(properties); + }; + + /** + * Encodes the specified ScenarioRubricOutcome message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome} message ScenarioRubricOutcome message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScenarioRubricOutcome.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rubric != null && Object.hasOwnProperty.call(message, "rubric")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.rubric); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + if (message.scoreExplanation != null && Object.hasOwnProperty.call(message, "scoreExplanation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.scoreExplanation); + return writer; + }; + + /** + * Encodes the specified ScenarioRubricOutcome message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome} message ScenarioRubricOutcome message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScenarioRubricOutcome.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScenarioRubricOutcome message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome} ScenarioRubricOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScenarioRubricOutcome.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rubric = reader.string(); + break; + } + case 2: { + message.score = reader.float(); + break; + } + case 3: { + message.scoreExplanation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScenarioRubricOutcome message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome} ScenarioRubricOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScenarioRubricOutcome.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScenarioRubricOutcome message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScenarioRubricOutcome.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.rubric != null && message.hasOwnProperty("rubric")) + if (!$util.isString(message.rubric)) + return "rubric: string expected"; + if (message.score != null && message.hasOwnProperty("score")) { + properties._score = 1; + if (typeof message.score !== "number") + return "score: number expected"; + } + if (message.scoreExplanation != null && message.hasOwnProperty("scoreExplanation")) + if (!$util.isString(message.scoreExplanation)) + return "scoreExplanation: string expected"; + return null; + }; + + /** + * Creates a ScenarioRubricOutcome message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome} ScenarioRubricOutcome + */ + ScenarioRubricOutcome.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome(); + if (object.rubric != null) + message.rubric = String(object.rubric); + if (object.score != null) + message.score = Number(object.score); + if (object.scoreExplanation != null) + message.scoreExplanation = String(object.scoreExplanation); + return message; + }; + + /** + * Creates a plain object from a ScenarioRubricOutcome message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome} message ScenarioRubricOutcome + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScenarioRubricOutcome.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rubric = ""; + object.scoreExplanation = ""; + } + if (message.rubric != null && message.hasOwnProperty("rubric")) + object.rubric = message.rubric; + if (message.score != null && message.hasOwnProperty("score")) { + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (options.oneofs) + object._score = "score"; + } + if (message.scoreExplanation != null && message.hasOwnProperty("scoreExplanation")) + object.scoreExplanation = message.scoreExplanation; + return object; + }; + + /** + * Converts this ScenarioRubricOutcome to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @instance + * @returns {Object.} JSON object + */ + ScenarioRubricOutcome.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScenarioRubricOutcome + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScenarioRubricOutcome.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome"; + }; + + return ScenarioRubricOutcome; + })(); + + EvaluationResult.ScenarioExpectationOutcome = (function() { + + /** + * Properties of a ScenarioExpectationOutcome. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IScenarioExpectationOutcome + * @property {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall|null} [observedToolCall] ScenarioExpectationOutcome observedToolCall + * @property {google.cloud.ces.v1beta.IMessage|null} [observedAgentResponse] ScenarioExpectationOutcome observedAgentResponse + * @property {google.cloud.ces.v1beta.Evaluation.IScenarioExpectation|null} [expectation] ScenarioExpectationOutcome expectation + * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [outcome] ScenarioExpectationOutcome outcome + */ + + /** + * Constructs a new ScenarioExpectationOutcome. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a ScenarioExpectationOutcome. + * @implements IScenarioExpectationOutcome + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome=} [properties] Properties to set + */ + function ScenarioExpectationOutcome(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScenarioExpectationOutcome observedToolCall. + * @member {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall|null|undefined} observedToolCall + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @instance + */ + ScenarioExpectationOutcome.prototype.observedToolCall = null; + + /** + * ScenarioExpectationOutcome observedAgentResponse. + * @member {google.cloud.ces.v1beta.IMessage|null|undefined} observedAgentResponse + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @instance + */ + ScenarioExpectationOutcome.prototype.observedAgentResponse = null; + + /** + * ScenarioExpectationOutcome expectation. + * @member {google.cloud.ces.v1beta.Evaluation.IScenarioExpectation|null|undefined} expectation + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @instance + */ + ScenarioExpectationOutcome.prototype.expectation = null; + + /** + * ScenarioExpectationOutcome outcome. + * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} outcome + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @instance + */ + ScenarioExpectationOutcome.prototype.outcome = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ScenarioExpectationOutcome result. + * @member {"observedToolCall"|"observedAgentResponse"|undefined} result + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @instance + */ + Object.defineProperty(ScenarioExpectationOutcome.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["observedToolCall", "observedAgentResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ScenarioExpectationOutcome instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome} ScenarioExpectationOutcome instance + */ + ScenarioExpectationOutcome.create = function create(properties) { + return new ScenarioExpectationOutcome(properties); + }; + + /** + * Encodes the specified ScenarioExpectationOutcome message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome} message ScenarioExpectationOutcome message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScenarioExpectationOutcome.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expectation != null && Object.hasOwnProperty.call(message, "expectation")) + $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.encode(message.expectation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.observedToolCall != null && Object.hasOwnProperty.call(message, "observedToolCall")) + $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.encode(message.observedToolCall, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.observedAgentResponse != null && Object.hasOwnProperty.call(message, "observedAgentResponse")) + $root.google.cloud.ces.v1beta.Message.encode(message.observedAgentResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.outcome); + return writer; + }; + + /** + * Encodes the specified ScenarioExpectationOutcome message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome} message ScenarioExpectationOutcome message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScenarioExpectationOutcome.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScenarioExpectationOutcome message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome} ScenarioExpectationOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScenarioExpectationOutcome.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.observedToolCall = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.decode(reader, reader.uint32()); + break; + } + case 3: { + message.observedAgentResponse = $root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32()); + break; + } + case 1: { + message.expectation = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outcome = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScenarioExpectationOutcome message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome} ScenarioExpectationOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScenarioExpectationOutcome.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScenarioExpectationOutcome message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScenarioExpectationOutcome.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.observedToolCall != null && message.hasOwnProperty("observedToolCall")) { + properties.result = 1; + { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.verify(message.observedToolCall); + if (error) + return "observedToolCall." + error; + } + } + if (message.observedAgentResponse != null && message.hasOwnProperty("observedAgentResponse")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.cloud.ces.v1beta.Message.verify(message.observedAgentResponse); + if (error) + return "observedAgentResponse." + error; + } + } + if (message.expectation != null && message.hasOwnProperty("expectation")) { + var error = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.verify(message.expectation); + if (error) + return "expectation." + error; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + switch (message.outcome) { + default: + return "outcome: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ScenarioExpectationOutcome message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome} ScenarioExpectationOutcome + */ + ScenarioExpectationOutcome.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome(); + if (object.observedToolCall != null) { + if (typeof object.observedToolCall !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.observedToolCall: object expected"); + message.observedToolCall = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.fromObject(object.observedToolCall); + } + if (object.observedAgentResponse != null) { + if (typeof object.observedAgentResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.observedAgentResponse: object expected"); + message.observedAgentResponse = $root.google.cloud.ces.v1beta.Message.fromObject(object.observedAgentResponse); + } + if (object.expectation != null) { + if (typeof object.expectation !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.expectation: object expected"); + message.expectation = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.fromObject(object.expectation); + } + switch (object.outcome) { + default: + if (typeof object.outcome === "number") { + message.outcome = object.outcome; + break; + } + break; + case "OUTCOME_UNSPECIFIED": + case 0: + message.outcome = 0; + break; + case "PASS": + case 1: + message.outcome = 1; + break; + case "FAIL": + case 2: + message.outcome = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ScenarioExpectationOutcome message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome} message ScenarioExpectationOutcome + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScenarioExpectationOutcome.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expectation = null; + object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; + } + if (message.expectation != null && message.hasOwnProperty("expectation")) + object.expectation = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.toObject(message.expectation, options); + if (message.observedToolCall != null && message.hasOwnProperty("observedToolCall")) { + object.observedToolCall = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.toObject(message.observedToolCall, options); + if (options.oneofs) + object.result = "observedToolCall"; + } + if (message.observedAgentResponse != null && message.hasOwnProperty("observedAgentResponse")) { + object.observedAgentResponse = $root.google.cloud.ces.v1beta.Message.toObject(message.observedAgentResponse, options); + if (options.oneofs) + object.result = "observedAgentResponse"; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + object.outcome = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] : message.outcome; + return object; + }; + + /** + * Converts this ScenarioExpectationOutcome to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @instance + * @returns {Object.} JSON object + */ + ScenarioExpectationOutcome.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScenarioExpectationOutcome + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScenarioExpectationOutcome.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome"; + }; + + ScenarioExpectationOutcome.ObservedToolCall = (function() { + + /** + * Properties of an ObservedToolCall. + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @interface IObservedToolCall + * @property {google.cloud.ces.v1beta.IToolCall|null} [toolCall] ObservedToolCall toolCall + * @property {google.cloud.ces.v1beta.IToolResponse|null} [toolResponse] ObservedToolCall toolResponse + */ + + /** + * Constructs a new ObservedToolCall. + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @classdesc Represents an ObservedToolCall. + * @implements IObservedToolCall + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall=} [properties] Properties to set + */ + function ObservedToolCall(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObservedToolCall toolCall. + * @member {google.cloud.ces.v1beta.IToolCall|null|undefined} toolCall + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @instance + */ + ObservedToolCall.prototype.toolCall = null; + + /** + * ObservedToolCall toolResponse. + * @member {google.cloud.ces.v1beta.IToolResponse|null|undefined} toolResponse + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @instance + */ + ObservedToolCall.prototype.toolResponse = null; + + /** + * Creates a new ObservedToolCall instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall} ObservedToolCall instance + */ + ObservedToolCall.create = function create(properties) { + return new ObservedToolCall(properties); + }; + + /** + * Encodes the specified ObservedToolCall message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall} message ObservedToolCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObservedToolCall.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolCall != null && Object.hasOwnProperty.call(message, "toolCall")) + $root.google.cloud.ces.v1beta.ToolCall.encode(message.toolCall, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.toolResponse != null && Object.hasOwnProperty.call(message, "toolResponse")) + $root.google.cloud.ces.v1beta.ToolResponse.encode(message.toolResponse, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ObservedToolCall message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall} message ObservedToolCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObservedToolCall.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObservedToolCall message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall} ObservedToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObservedToolCall.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolCall = $root.google.cloud.ces.v1beta.ToolCall.decode(reader, reader.uint32()); + break; + } + case 2: { + message.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObservedToolCall message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall} ObservedToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObservedToolCall.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObservedToolCall message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObservedToolCall.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + var error = $root.google.cloud.ces.v1beta.ToolCall.verify(message.toolCall); + if (error) + return "toolCall." + error; + } + if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { + var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.toolResponse); + if (error) + return "toolResponse." + error; + } + return null; + }; + + /** + * Creates an ObservedToolCall message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall} ObservedToolCall + */ + ObservedToolCall.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall(); + if (object.toolCall != null) { + if (typeof object.toolCall !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.toolCall: object expected"); + message.toolCall = $root.google.cloud.ces.v1beta.ToolCall.fromObject(object.toolCall); + } + if (object.toolResponse != null) { + if (typeof object.toolResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.toolResponse: object expected"); + message.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.toolResponse); + } + return message; + }; + + /** + * Creates a plain object from an ObservedToolCall message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall} message ObservedToolCall + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObservedToolCall.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.toolCall = null; + object.toolResponse = null; + } + if (message.toolCall != null && message.hasOwnProperty("toolCall")) + object.toolCall = $root.google.cloud.ces.v1beta.ToolCall.toObject(message.toolCall, options); + if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) + object.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.toolResponse, options); + return object; + }; + + /** + * Converts this ObservedToolCall to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @instance + * @returns {Object.} JSON object + */ + ObservedToolCall.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObservedToolCall + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObservedToolCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall"; + }; + + return ObservedToolCall; + })(); + + return ScenarioExpectationOutcome; + })(); + + EvaluationResult.ScenarioResult = (function() { + + /** + * Properties of a ScenarioResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IScenarioResult + * @property {string|null} [conversation] ScenarioResult conversation + * @property {string|null} [task] ScenarioResult task + * @property {Array.|null} [userFacts] ScenarioResult userFacts + * @property {Array.|null} [expectationOutcomes] ScenarioResult expectationOutcomes + * @property {Array.|null} [rubricOutcomes] ScenarioResult rubricOutcomes + * @property {Array.|null} [hallucinationResult] ScenarioResult hallucinationResult + * @property {google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult|null} [taskCompletionResult] ScenarioResult taskCompletionResult + * @property {Array.|null} [toolCallLatencies] ScenarioResult toolCallLatencies + * @property {google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult|null} [userGoalSatisfactionResult] ScenarioResult userGoalSatisfactionResult + * @property {boolean|null} [allExpectationsSatisfied] ScenarioResult allExpectationsSatisfied + * @property {boolean|null} [taskCompleted] ScenarioResult taskCompleted + * @property {Array.|null} [spanLatencies] ScenarioResult spanLatencies + * @property {Array.|null} [evaluationExpectationResults] ScenarioResult evaluationExpectationResults + */ + + /** + * Constructs a new ScenarioResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a ScenarioResult. + * @implements IScenarioResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioResult=} [properties] Properties to set + */ + function ScenarioResult(properties) { + this.userFacts = []; + this.expectationOutcomes = []; + this.rubricOutcomes = []; + this.hallucinationResult = []; + this.toolCallLatencies = []; + this.spanLatencies = []; + this.evaluationExpectationResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScenarioResult conversation. + * @member {string} conversation + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.conversation = ""; + + /** + * ScenarioResult task. + * @member {string} task + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.task = ""; + + /** + * ScenarioResult userFacts. + * @member {Array.} userFacts + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.userFacts = $util.emptyArray; + + /** + * ScenarioResult expectationOutcomes. + * @member {Array.} expectationOutcomes + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.expectationOutcomes = $util.emptyArray; + + /** + * ScenarioResult rubricOutcomes. + * @member {Array.} rubricOutcomes + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.rubricOutcomes = $util.emptyArray; + + /** + * ScenarioResult hallucinationResult. + * @member {Array.} hallucinationResult + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.hallucinationResult = $util.emptyArray; + + /** + * ScenarioResult taskCompletionResult. + * @member {google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult|null|undefined} taskCompletionResult + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.taskCompletionResult = null; + + /** + * ScenarioResult toolCallLatencies. + * @member {Array.} toolCallLatencies + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.toolCallLatencies = $util.emptyArray; + + /** + * ScenarioResult userGoalSatisfactionResult. + * @member {google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult|null|undefined} userGoalSatisfactionResult + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.userGoalSatisfactionResult = null; + + /** + * ScenarioResult allExpectationsSatisfied. + * @member {boolean|null|undefined} allExpectationsSatisfied + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.allExpectationsSatisfied = null; + + /** + * ScenarioResult taskCompleted. + * @member {boolean|null|undefined} taskCompleted + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.taskCompleted = null; + + /** + * ScenarioResult spanLatencies. + * @member {Array.} spanLatencies + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.spanLatencies = $util.emptyArray; + + /** + * ScenarioResult evaluationExpectationResults. + * @member {Array.} evaluationExpectationResults + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.evaluationExpectationResults = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ScenarioResult.prototype, "_allExpectationsSatisfied", { + get: $util.oneOfGetter($oneOfFields = ["allExpectationsSatisfied"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ScenarioResult.prototype, "_taskCompleted", { + get: $util.oneOfGetter($oneOfFields = ["taskCompleted"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ScenarioResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioResult} ScenarioResult instance + */ + ScenarioResult.create = function create(properties) { + return new ScenarioResult(properties); + }; + + /** + * Encodes the specified ScenarioResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioResult} message ScenarioResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScenarioResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversation); + if (message.expectationOutcomes != null && message.expectationOutcomes.length) + for (var i = 0; i < message.expectationOutcomes.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.encode(message.expectationOutcomes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.rubricOutcomes != null && message.rubricOutcomes.length) + for (var i = 0; i < message.rubricOutcomes.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.encode(message.rubricOutcomes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.hallucinationResult != null && message.hallucinationResult.length) + for (var i = 0; i < message.hallucinationResult.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.encode(message.hallucinationResult[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.taskCompletionResult != null && Object.hasOwnProperty.call(message, "taskCompletionResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.encode(message.taskCompletionResult, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.toolCallLatencies != null && message.toolCallLatencies.length) + for (var i = 0; i < message.toolCallLatencies.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.encode(message.toolCallLatencies[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.userGoalSatisfactionResult != null && Object.hasOwnProperty.call(message, "userGoalSatisfactionResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.encode(message.userGoalSatisfactionResult, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.allExpectationsSatisfied != null && Object.hasOwnProperty.call(message, "allExpectationsSatisfied")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.allExpectationsSatisfied); + if (message.taskCompleted != null && Object.hasOwnProperty.call(message, "taskCompleted")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.taskCompleted); + if (message.task != null && Object.hasOwnProperty.call(message, "task")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.task); + if (message.userFacts != null && message.userFacts.length) + for (var i = 0; i < message.userFacts.length; ++i) + $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.encode(message.userFacts[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.spanLatencies != null && message.spanLatencies.length) + for (var i = 0; i < message.spanLatencies.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.encode(message.spanLatencies[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.evaluationExpectationResults != null && message.evaluationExpectationResults.length) + for (var i = 0; i < message.evaluationExpectationResults.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.encode(message.evaluationExpectationResults[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ScenarioResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioResult} message ScenarioResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScenarioResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScenarioResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioResult} ScenarioResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScenarioResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.conversation = reader.string(); + break; + } + case 10: { + message.task = reader.string(); + break; + } + case 11: { + if (!(message.userFacts && message.userFacts.length)) + message.userFacts = []; + message.userFacts.push($root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.expectationOutcomes && message.expectationOutcomes.length)) + message.expectationOutcomes = []; + message.expectationOutcomes.push($root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.rubricOutcomes && message.rubricOutcomes.length)) + message.rubricOutcomes = []; + message.rubricOutcomes.push($root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.hallucinationResult && message.hallucinationResult.length)) + message.hallucinationResult = []; + message.hallucinationResult.push($root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.decode(reader, reader.uint32())); + break; + } + case 5: { + message.taskCompletionResult = $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.toolCallLatencies && message.toolCallLatencies.length)) + message.toolCallLatencies = []; + message.toolCallLatencies.push($root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.decode(reader, reader.uint32())); + break; + } + case 7: { + message.userGoalSatisfactionResult = $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.decode(reader, reader.uint32()); + break; + } + case 8: { + message.allExpectationsSatisfied = reader.bool(); + break; + } + case 9: { + message.taskCompleted = reader.bool(); + break; + } + case 12: { + if (!(message.spanLatencies && message.spanLatencies.length)) + message.spanLatencies = []; + message.spanLatencies.push($root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.decode(reader, reader.uint32())); + break; + } + case 13: { + if (!(message.evaluationExpectationResults && message.evaluationExpectationResults.length)) + message.evaluationExpectationResults = []; + message.evaluationExpectationResults.push($root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScenarioResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioResult} ScenarioResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScenarioResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScenarioResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScenarioResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.conversation != null && message.hasOwnProperty("conversation")) + if (!$util.isString(message.conversation)) + return "conversation: string expected"; + if (message.task != null && message.hasOwnProperty("task")) + if (!$util.isString(message.task)) + return "task: string expected"; + if (message.userFacts != null && message.hasOwnProperty("userFacts")) { + if (!Array.isArray(message.userFacts)) + return "userFacts: array expected"; + for (var i = 0; i < message.userFacts.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.verify(message.userFacts[i]); + if (error) + return "userFacts." + error; + } + } + if (message.expectationOutcomes != null && message.hasOwnProperty("expectationOutcomes")) { + if (!Array.isArray(message.expectationOutcomes)) + return "expectationOutcomes: array expected"; + for (var i = 0; i < message.expectationOutcomes.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.verify(message.expectationOutcomes[i]); + if (error) + return "expectationOutcomes." + error; + } + } + if (message.rubricOutcomes != null && message.hasOwnProperty("rubricOutcomes")) { + if (!Array.isArray(message.rubricOutcomes)) + return "rubricOutcomes: array expected"; + for (var i = 0; i < message.rubricOutcomes.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.verify(message.rubricOutcomes[i]); + if (error) + return "rubricOutcomes." + error; + } + } + if (message.hallucinationResult != null && message.hasOwnProperty("hallucinationResult")) { + if (!Array.isArray(message.hallucinationResult)) + return "hallucinationResult: array expected"; + for (var i = 0; i < message.hallucinationResult.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.verify(message.hallucinationResult[i]); + if (error) + return "hallucinationResult." + error; + } + } + if (message.taskCompletionResult != null && message.hasOwnProperty("taskCompletionResult")) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.verify(message.taskCompletionResult); + if (error) + return "taskCompletionResult." + error; + } + if (message.toolCallLatencies != null && message.hasOwnProperty("toolCallLatencies")) { + if (!Array.isArray(message.toolCallLatencies)) + return "toolCallLatencies: array expected"; + for (var i = 0; i < message.toolCallLatencies.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.verify(message.toolCallLatencies[i]); + if (error) + return "toolCallLatencies." + error; + } + } + if (message.userGoalSatisfactionResult != null && message.hasOwnProperty("userGoalSatisfactionResult")) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.verify(message.userGoalSatisfactionResult); + if (error) + return "userGoalSatisfactionResult." + error; + } + if (message.allExpectationsSatisfied != null && message.hasOwnProperty("allExpectationsSatisfied")) { + properties._allExpectationsSatisfied = 1; + if (typeof message.allExpectationsSatisfied !== "boolean") + return "allExpectationsSatisfied: boolean expected"; + } + if (message.taskCompleted != null && message.hasOwnProperty("taskCompleted")) { + properties._taskCompleted = 1; + if (typeof message.taskCompleted !== "boolean") + return "taskCompleted: boolean expected"; + } + if (message.spanLatencies != null && message.hasOwnProperty("spanLatencies")) { + if (!Array.isArray(message.spanLatencies)) + return "spanLatencies: array expected"; + for (var i = 0; i < message.spanLatencies.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.verify(message.spanLatencies[i]); + if (error) + return "spanLatencies." + error; + } + } + if (message.evaluationExpectationResults != null && message.hasOwnProperty("evaluationExpectationResults")) { + if (!Array.isArray(message.evaluationExpectationResults)) + return "evaluationExpectationResults: array expected"; + for (var i = 0; i < message.evaluationExpectationResults.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.verify(message.evaluationExpectationResults[i]); + if (error) + return "evaluationExpectationResults." + error; + } + } + return null; + }; + + /** + * Creates a ScenarioResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioResult} ScenarioResult + */ + ScenarioResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult(); + if (object.conversation != null) + message.conversation = String(object.conversation); + if (object.task != null) + message.task = String(object.task); + if (object.userFacts) { + if (!Array.isArray(object.userFacts)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.userFacts: array expected"); + message.userFacts = []; + for (var i = 0; i < object.userFacts.length; ++i) { + if (typeof object.userFacts[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.userFacts: object expected"); + message.userFacts[i] = $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.fromObject(object.userFacts[i]); + } + } + if (object.expectationOutcomes) { + if (!Array.isArray(object.expectationOutcomes)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.expectationOutcomes: array expected"); + message.expectationOutcomes = []; + for (var i = 0; i < object.expectationOutcomes.length; ++i) { + if (typeof object.expectationOutcomes[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.expectationOutcomes: object expected"); + message.expectationOutcomes[i] = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.fromObject(object.expectationOutcomes[i]); + } + } + if (object.rubricOutcomes) { + if (!Array.isArray(object.rubricOutcomes)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.rubricOutcomes: array expected"); + message.rubricOutcomes = []; + for (var i = 0; i < object.rubricOutcomes.length; ++i) { + if (typeof object.rubricOutcomes[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.rubricOutcomes: object expected"); + message.rubricOutcomes[i] = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.fromObject(object.rubricOutcomes[i]); + } + } + if (object.hallucinationResult) { + if (!Array.isArray(object.hallucinationResult)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.hallucinationResult: array expected"); + message.hallucinationResult = []; + for (var i = 0; i < object.hallucinationResult.length; ++i) { + if (typeof object.hallucinationResult[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.hallucinationResult: object expected"); + message.hallucinationResult[i] = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.fromObject(object.hallucinationResult[i]); + } + } + if (object.taskCompletionResult != null) { + if (typeof object.taskCompletionResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.taskCompletionResult: object expected"); + message.taskCompletionResult = $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.fromObject(object.taskCompletionResult); + } + if (object.toolCallLatencies) { + if (!Array.isArray(object.toolCallLatencies)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.toolCallLatencies: array expected"); + message.toolCallLatencies = []; + for (var i = 0; i < object.toolCallLatencies.length; ++i) { + if (typeof object.toolCallLatencies[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.toolCallLatencies: object expected"); + message.toolCallLatencies[i] = $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.fromObject(object.toolCallLatencies[i]); + } + } + if (object.userGoalSatisfactionResult != null) { + if (typeof object.userGoalSatisfactionResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.userGoalSatisfactionResult: object expected"); + message.userGoalSatisfactionResult = $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.fromObject(object.userGoalSatisfactionResult); + } + if (object.allExpectationsSatisfied != null) + message.allExpectationsSatisfied = Boolean(object.allExpectationsSatisfied); + if (object.taskCompleted != null) + message.taskCompleted = Boolean(object.taskCompleted); + if (object.spanLatencies) { + if (!Array.isArray(object.spanLatencies)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.spanLatencies: array expected"); + message.spanLatencies = []; + for (var i = 0; i < object.spanLatencies.length; ++i) { + if (typeof object.spanLatencies[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.spanLatencies: object expected"); + message.spanLatencies[i] = $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.fromObject(object.spanLatencies[i]); + } + } + if (object.evaluationExpectationResults) { + if (!Array.isArray(object.evaluationExpectationResults)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.evaluationExpectationResults: array expected"); + message.evaluationExpectationResults = []; + for (var i = 0; i < object.evaluationExpectationResults.length; ++i) { + if (typeof object.evaluationExpectationResults[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.evaluationExpectationResults: object expected"); + message.evaluationExpectationResults[i] = $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.fromObject(object.evaluationExpectationResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ScenarioResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioResult} message ScenarioResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScenarioResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.expectationOutcomes = []; + object.rubricOutcomes = []; + object.hallucinationResult = []; + object.toolCallLatencies = []; + object.userFacts = []; + object.spanLatencies = []; + object.evaluationExpectationResults = []; + } + if (options.defaults) { + object.conversation = ""; + object.taskCompletionResult = null; + object.userGoalSatisfactionResult = null; + object.task = ""; + } + if (message.conversation != null && message.hasOwnProperty("conversation")) + object.conversation = message.conversation; + if (message.expectationOutcomes && message.expectationOutcomes.length) { + object.expectationOutcomes = []; + for (var j = 0; j < message.expectationOutcomes.length; ++j) + object.expectationOutcomes[j] = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.toObject(message.expectationOutcomes[j], options); + } + if (message.rubricOutcomes && message.rubricOutcomes.length) { + object.rubricOutcomes = []; + for (var j = 0; j < message.rubricOutcomes.length; ++j) + object.rubricOutcomes[j] = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.toObject(message.rubricOutcomes[j], options); + } + if (message.hallucinationResult && message.hallucinationResult.length) { + object.hallucinationResult = []; + for (var j = 0; j < message.hallucinationResult.length; ++j) + object.hallucinationResult[j] = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.toObject(message.hallucinationResult[j], options); + } + if (message.taskCompletionResult != null && message.hasOwnProperty("taskCompletionResult")) + object.taskCompletionResult = $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.toObject(message.taskCompletionResult, options); + if (message.toolCallLatencies && message.toolCallLatencies.length) { + object.toolCallLatencies = []; + for (var j = 0; j < message.toolCallLatencies.length; ++j) + object.toolCallLatencies[j] = $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.toObject(message.toolCallLatencies[j], options); + } + if (message.userGoalSatisfactionResult != null && message.hasOwnProperty("userGoalSatisfactionResult")) + object.userGoalSatisfactionResult = $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.toObject(message.userGoalSatisfactionResult, options); + if (message.allExpectationsSatisfied != null && message.hasOwnProperty("allExpectationsSatisfied")) { + object.allExpectationsSatisfied = message.allExpectationsSatisfied; + if (options.oneofs) + object._allExpectationsSatisfied = "allExpectationsSatisfied"; + } + if (message.taskCompleted != null && message.hasOwnProperty("taskCompleted")) { + object.taskCompleted = message.taskCompleted; + if (options.oneofs) + object._taskCompleted = "taskCompleted"; + } + if (message.task != null && message.hasOwnProperty("task")) + object.task = message.task; + if (message.userFacts && message.userFacts.length) { + object.userFacts = []; + for (var j = 0; j < message.userFacts.length; ++j) + object.userFacts[j] = $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.toObject(message.userFacts[j], options); + } + if (message.spanLatencies && message.spanLatencies.length) { + object.spanLatencies = []; + for (var j = 0; j < message.spanLatencies.length; ++j) + object.spanLatencies[j] = $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.toObject(message.spanLatencies[j], options); + } + if (message.evaluationExpectationResults && message.evaluationExpectationResults.length) { + object.evaluationExpectationResults = []; + for (var j = 0; j < message.evaluationExpectationResults.length; ++j) + object.evaluationExpectationResults[j] = $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.toObject(message.evaluationExpectationResults[j], options); + } + return object; + }; + + /** + * Converts this ScenarioResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + * @returns {Object.} JSON object + */ + ScenarioResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScenarioResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScenarioResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.ScenarioResult"; + }; + + return ScenarioResult; + })(); + + EvaluationResult.SpanLatency = (function() { + + /** + * Properties of a SpanLatency. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface ISpanLatency + * @property {string|null} [resource] SpanLatency resource + * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolset] SpanLatency toolset + * @property {string|null} [model] SpanLatency model + * @property {string|null} [callback] SpanLatency callback + * @property {google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type|null} [type] SpanLatency type + * @property {string|null} [displayName] SpanLatency displayName + * @property {google.protobuf.ITimestamp|null} [startTime] SpanLatency startTime + * @property {google.protobuf.ITimestamp|null} [endTime] SpanLatency endTime + * @property {google.protobuf.IDuration|null} [executionLatency] SpanLatency executionLatency + */ + + /** + * Constructs a new SpanLatency. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a SpanLatency. + * @implements ISpanLatency + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.ISpanLatency=} [properties] Properties to set + */ + function SpanLatency(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpanLatency resource. + * @member {string|null|undefined} resource + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + SpanLatency.prototype.resource = null; + + /** + * SpanLatency toolset. + * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolset + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + SpanLatency.prototype.toolset = null; + + /** + * SpanLatency model. + * @member {string|null|undefined} model + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + SpanLatency.prototype.model = null; + + /** + * SpanLatency callback. + * @member {string|null|undefined} callback + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + SpanLatency.prototype.callback = null; + + /** + * SpanLatency type. + * @member {google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type} type + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + SpanLatency.prototype.type = 0; + + /** + * SpanLatency displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + SpanLatency.prototype.displayName = ""; + + /** + * SpanLatency startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + SpanLatency.prototype.startTime = null; + + /** + * SpanLatency endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + SpanLatency.prototype.endTime = null; + + /** + * SpanLatency executionLatency. + * @member {google.protobuf.IDuration|null|undefined} executionLatency + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + SpanLatency.prototype.executionLatency = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SpanLatency identifier. + * @member {"resource"|"toolset"|"model"|"callback"|undefined} identifier + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + Object.defineProperty(SpanLatency.prototype, "identifier", { + get: $util.oneOfGetter($oneOfFields = ["resource", "toolset", "model", "callback"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SpanLatency instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ISpanLatency=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.SpanLatency} SpanLatency instance + */ + SpanLatency.create = function create(properties) { + return new SpanLatency(properties); + }; + + /** + * Encodes the specified SpanLatency message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SpanLatency.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ISpanLatency} message SpanLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpanLatency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resource); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.model); + if (message.callback != null && Object.hasOwnProperty.call(message, "callback")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.callback); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.executionLatency != null && Object.hasOwnProperty.call(message, "executionLatency")) + $root.google.protobuf.Duration.encode(message.executionLatency, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified SpanLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SpanLatency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ISpanLatency} message SpanLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpanLatency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpanLatency message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.SpanLatency} SpanLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpanLatency.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.resource = reader.string(); + break; + } + case 3: { + message.toolset = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 4: { + message.model = reader.string(); + break; + } + case 5: { + message.callback = reader.string(); + break; + } + case 1: { + message.type = reader.int32(); + break; + } + case 9: { + message.displayName = reader.string(); + break; + } + case 6: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.executionLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpanLatency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.SpanLatency} SpanLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpanLatency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpanLatency message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpanLatency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.resource != null && message.hasOwnProperty("resource")) { + properties.identifier = 1; + if (!$util.isString(message.resource)) + return "resource: string expected"; + } + if (message.toolset != null && message.hasOwnProperty("toolset")) { + if (properties.identifier === 1) + return "identifier: multiple values"; + properties.identifier = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolset); + if (error) + return "toolset." + error; + } + } + if (message.model != null && message.hasOwnProperty("model")) { + if (properties.identifier === 1) + return "identifier: multiple values"; + properties.identifier = 1; + if (!$util.isString(message.model)) + return "model: string expected"; + } + if (message.callback != null && message.hasOwnProperty("callback")) { + if (properties.identifier === 1) + return "identifier: multiple values"; + properties.identifier = 1; + if (!$util.isString(message.callback)) + return "callback: 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: + case 4: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string 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.executionLatency != null && message.hasOwnProperty("executionLatency")) { + var error = $root.google.protobuf.Duration.verify(message.executionLatency); + if (error) + return "executionLatency." + error; + } + return null; + }; + + /** + * Creates a SpanLatency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.SpanLatency} SpanLatency + */ + SpanLatency.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.toolset != null) { + if (typeof object.toolset !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.SpanLatency.toolset: object expected"); + message.toolset = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolset); + } + if (object.model != null) + message.model = String(object.model); + if (object.callback != null) + message.callback = String(object.callback); + 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 "TOOL": + case 1: + message.type = 1; + break; + case "USER_CALLBACK": + case 2: + message.type = 2; + break; + case "GUARDRAIL": + case 3: + message.type = 3; + break; + case "LLM": + case 4: + message.type = 4; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.SpanLatency.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.ces.v1beta.EvaluationResult.SpanLatency.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.executionLatency != null) { + if (typeof object.executionLatency !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.SpanLatency.executionLatency: object expected"); + message.executionLatency = $root.google.protobuf.Duration.fromObject(object.executionLatency); + } + return message; + }; + + /** + * Creates a plain object from a SpanLatency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.SpanLatency} message SpanLatency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpanLatency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.startTime = null; + object.endTime = null; + object.executionLatency = null; + object.displayName = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type[message.type] === undefined ? message.type : $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type[message.type] : message.type; + if (message.resource != null && message.hasOwnProperty("resource")) { + object.resource = message.resource; + if (options.oneofs) + object.identifier = "resource"; + } + if (message.toolset != null && message.hasOwnProperty("toolset")) { + object.toolset = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolset, options); + if (options.oneofs) + object.identifier = "toolset"; + } + if (message.model != null && message.hasOwnProperty("model")) { + object.model = message.model; + if (options.oneofs) + object.identifier = "model"; + } + if (message.callback != null && message.hasOwnProperty("callback")) { + object.callback = message.callback; + if (options.oneofs) + object.identifier = "callback"; + } + 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.executionLatency != null && message.hasOwnProperty("executionLatency")) + object.executionLatency = $root.google.protobuf.Duration.toObject(message.executionLatency, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this SpanLatency to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + * @returns {Object.} JSON object + */ + SpanLatency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpanLatency + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpanLatency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.SpanLatency"; + }; + + /** + * Type enum. + * @name google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} TOOL=1 TOOL value + * @property {number} USER_CALLBACK=2 USER_CALLBACK value + * @property {number} GUARDRAIL=3 GUARDRAIL value + * @property {number} LLM=4 LLM value + */ + SpanLatency.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TOOL"] = 1; + values[valuesById[2] = "USER_CALLBACK"] = 2; + values[valuesById[3] = "GUARDRAIL"] = 3; + values[valuesById[4] = "LLM"] = 4; + return values; + })(); + + return SpanLatency; + })(); + + EvaluationResult.ToolCallLatency = (function() { + + /** + * Properties of a ToolCallLatency. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IToolCallLatency + * @property {string|null} [tool] ToolCallLatency tool + * @property {string|null} [displayName] ToolCallLatency displayName + * @property {google.protobuf.ITimestamp|null} [startTime] ToolCallLatency startTime + * @property {google.protobuf.ITimestamp|null} [endTime] ToolCallLatency endTime + * @property {google.protobuf.IDuration|null} [executionLatency] ToolCallLatency executionLatency + */ + + /** + * Constructs a new ToolCallLatency. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a ToolCallLatency. + * @implements IToolCallLatency + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency=} [properties] Properties to set + */ + function ToolCallLatency(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolCallLatency tool. + * @member {string} tool + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @instance + */ + ToolCallLatency.prototype.tool = ""; + + /** + * ToolCallLatency displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @instance + */ + ToolCallLatency.prototype.displayName = ""; + + /** + * ToolCallLatency startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @instance + */ + ToolCallLatency.prototype.startTime = null; + + /** + * ToolCallLatency endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @instance + */ + ToolCallLatency.prototype.endTime = null; + + /** + * ToolCallLatency executionLatency. + * @member {google.protobuf.IDuration|null|undefined} executionLatency + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @instance + */ + ToolCallLatency.prototype.executionLatency = null; + + /** + * Creates a new ToolCallLatency instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency} ToolCallLatency instance + */ + ToolCallLatency.create = function create(properties) { + return new ToolCallLatency(properties); + }; + + /** + * Encodes the specified ToolCallLatency message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency} message ToolCallLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCallLatency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.executionLatency != null && Object.hasOwnProperty.call(message, "executionLatency")) + $root.google.protobuf.Duration.encode(message.executionLatency, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolCallLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency} message ToolCallLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCallLatency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolCallLatency message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency} ToolCallLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCallLatency.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.executionLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolCallLatency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency} ToolCallLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCallLatency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolCallLatency message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolCallLatency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tool != null && message.hasOwnProperty("tool")) + if (!$util.isString(message.tool)) + return "tool: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string 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.executionLatency != null && message.hasOwnProperty("executionLatency")) { + var error = $root.google.protobuf.Duration.verify(message.executionLatency); + if (error) + return "executionLatency." + error; + } + return null; + }; + + /** + * Creates a ToolCallLatency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency} ToolCallLatency + */ + ToolCallLatency.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.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.ces.v1beta.EvaluationResult.ToolCallLatency.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.executionLatency != null) { + if (typeof object.executionLatency !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.executionLatency: object expected"); + message.executionLatency = $root.google.protobuf.Duration.fromObject(object.executionLatency); + } + return message; + }; + + /** + * Creates a plain object from a ToolCallLatency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency} message ToolCallLatency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolCallLatency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = ""; + object.displayName = ""; + object.startTime = null; + object.endTime = null; + object.executionLatency = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = message.tool; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + 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.executionLatency != null && message.hasOwnProperty("executionLatency")) + object.executionLatency = $root.google.protobuf.Duration.toObject(message.executionLatency, options); + return object; + }; + + /** + * Converts this ToolCallLatency to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @instance + * @returns {Object.} JSON object + */ + ToolCallLatency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolCallLatency + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolCallLatency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency"; + }; + + return ToolCallLatency; + })(); + + EvaluationResult.HallucinationResult = (function() { + + /** + * Properties of a HallucinationResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IHallucinationResult + * @property {number|null} [score] HallucinationResult score + * @property {string|null} [label] HallucinationResult label + * @property {string|null} [explanation] HallucinationResult explanation + */ + + /** + * Constructs a new HallucinationResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a HallucinationResult. + * @implements IHallucinationResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult=} [properties] Properties to set + */ + function HallucinationResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HallucinationResult score. + * @member {number|null|undefined} score + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @instance + */ + HallucinationResult.prototype.score = null; + + /** + * HallucinationResult label. + * @member {string} label + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @instance + */ + HallucinationResult.prototype.label = ""; + + /** + * HallucinationResult explanation. + * @member {string} explanation + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @instance + */ + HallucinationResult.prototype.explanation = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HallucinationResult.prototype, "_score", { + get: $util.oneOfGetter($oneOfFields = ["score"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HallucinationResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.HallucinationResult} HallucinationResult instance + */ + HallucinationResult.create = function create(properties) { + return new HallucinationResult(properties); + }; + + /** + * Encodes the specified HallucinationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult} message HallucinationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HallucinationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.score); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.explanation); + return writer; + }; + + /** + * Encodes the specified HallucinationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult} message HallucinationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HallucinationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HallucinationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.HallucinationResult} HallucinationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HallucinationResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.int32(); + break; + } + case 2: { + message.label = reader.string(); + break; + } + case 3: { + message.explanation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HallucinationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.HallucinationResult} HallucinationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HallucinationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HallucinationResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HallucinationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.score != null && message.hasOwnProperty("score")) { + properties._score = 1; + if (!$util.isInteger(message.score)) + return "score: integer expected"; + } + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.explanation != null && message.hasOwnProperty("explanation")) + if (!$util.isString(message.explanation)) + return "explanation: string expected"; + return null; + }; + + /** + * Creates a HallucinationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.HallucinationResult} HallucinationResult + */ + HallucinationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult(); + if (object.score != null) + message.score = object.score | 0; + if (object.label != null) + message.label = String(object.label); + if (object.explanation != null) + message.explanation = String(object.explanation); + return message; + }; + + /** + * Creates a plain object from a HallucinationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.HallucinationResult} message HallucinationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HallucinationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.label = ""; + object.explanation = ""; + } + if (message.score != null && message.hasOwnProperty("score")) { + object.score = message.score; + if (options.oneofs) + object._score = "score"; + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = message.explanation; + return object; + }; + + /** + * Converts this HallucinationResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @instance + * @returns {Object.} JSON object + */ + HallucinationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HallucinationResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HallucinationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.HallucinationResult"; + }; + + return HallucinationResult; + })(); + + EvaluationResult.UserGoalSatisfactionResult = (function() { + + /** + * Properties of a UserGoalSatisfactionResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IUserGoalSatisfactionResult + * @property {number|null} [score] UserGoalSatisfactionResult score + * @property {string|null} [label] UserGoalSatisfactionResult label + * @property {string|null} [explanation] UserGoalSatisfactionResult explanation + */ + + /** + * Constructs a new UserGoalSatisfactionResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a UserGoalSatisfactionResult. + * @implements IUserGoalSatisfactionResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult=} [properties] Properties to set + */ + function UserGoalSatisfactionResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserGoalSatisfactionResult score. + * @member {number|null|undefined} score + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @instance + */ + UserGoalSatisfactionResult.prototype.score = null; + + /** + * UserGoalSatisfactionResult label. + * @member {string} label + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @instance + */ + UserGoalSatisfactionResult.prototype.label = ""; + + /** + * UserGoalSatisfactionResult explanation. + * @member {string} explanation + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @instance + */ + UserGoalSatisfactionResult.prototype.explanation = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserGoalSatisfactionResult.prototype, "_score", { + get: $util.oneOfGetter($oneOfFields = ["score"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UserGoalSatisfactionResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult} UserGoalSatisfactionResult instance + */ + UserGoalSatisfactionResult.create = function create(properties) { + return new UserGoalSatisfactionResult(properties); + }; + + /** + * Encodes the specified UserGoalSatisfactionResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult} message UserGoalSatisfactionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserGoalSatisfactionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.score); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.explanation); + return writer; + }; + + /** + * Encodes the specified UserGoalSatisfactionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult} message UserGoalSatisfactionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserGoalSatisfactionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserGoalSatisfactionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult} UserGoalSatisfactionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserGoalSatisfactionResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.int32(); + break; + } + case 2: { + message.label = reader.string(); + break; + } + case 3: { + message.explanation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserGoalSatisfactionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult} UserGoalSatisfactionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserGoalSatisfactionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserGoalSatisfactionResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserGoalSatisfactionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.score != null && message.hasOwnProperty("score")) { + properties._score = 1; + if (!$util.isInteger(message.score)) + return "score: integer expected"; + } + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.explanation != null && message.hasOwnProperty("explanation")) + if (!$util.isString(message.explanation)) + return "explanation: string expected"; + return null; + }; + + /** + * Creates a UserGoalSatisfactionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult} UserGoalSatisfactionResult + */ + UserGoalSatisfactionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult(); + if (object.score != null) + message.score = object.score | 0; + if (object.label != null) + message.label = String(object.label); + if (object.explanation != null) + message.explanation = String(object.explanation); + return message; + }; + + /** + * Creates a plain object from a UserGoalSatisfactionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult} message UserGoalSatisfactionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserGoalSatisfactionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.label = ""; + object.explanation = ""; + } + if (message.score != null && message.hasOwnProperty("score")) { + object.score = message.score; + if (options.oneofs) + object._score = "score"; + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = message.explanation; + return object; + }; + + /** + * Converts this UserGoalSatisfactionResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @instance + * @returns {Object.} JSON object + */ + UserGoalSatisfactionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserGoalSatisfactionResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserGoalSatisfactionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult"; + }; + + return UserGoalSatisfactionResult; + })(); + + EvaluationResult.SemanticSimilarityResult = (function() { + + /** + * Properties of a SemanticSimilarityResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface ISemanticSimilarityResult + * @property {number|null} [score] SemanticSimilarityResult score + * @property {string|null} [label] SemanticSimilarityResult label + * @property {string|null} [explanation] SemanticSimilarityResult explanation + * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [outcome] SemanticSimilarityResult outcome + */ + + /** + * Constructs a new SemanticSimilarityResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a SemanticSimilarityResult. + * @implements ISemanticSimilarityResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult=} [properties] Properties to set + */ + function SemanticSimilarityResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SemanticSimilarityResult score. + * @member {number|null|undefined} score + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @instance + */ + SemanticSimilarityResult.prototype.score = null; + + /** + * SemanticSimilarityResult label. + * @member {string} label + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @instance + */ + SemanticSimilarityResult.prototype.label = ""; + + /** + * SemanticSimilarityResult explanation. + * @member {string} explanation + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @instance + */ + SemanticSimilarityResult.prototype.explanation = ""; + + /** + * SemanticSimilarityResult outcome. + * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} outcome + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @instance + */ + SemanticSimilarityResult.prototype.outcome = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SemanticSimilarityResult.prototype, "_score", { + get: $util.oneOfGetter($oneOfFields = ["score"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SemanticSimilarityResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult} SemanticSimilarityResult instance + */ + SemanticSimilarityResult.create = function create(properties) { + return new SemanticSimilarityResult(properties); + }; + + /** + * Encodes the specified SemanticSimilarityResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult} message SemanticSimilarityResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticSimilarityResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.score); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.explanation); + if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.outcome); + return writer; + }; + + /** + * Encodes the specified SemanticSimilarityResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult} message SemanticSimilarityResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticSimilarityResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SemanticSimilarityResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult} SemanticSimilarityResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticSimilarityResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.int32(); + break; + } + case 2: { + message.label = reader.string(); + break; + } + case 3: { + message.explanation = reader.string(); + break; + } + case 4: { + message.outcome = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SemanticSimilarityResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult} SemanticSimilarityResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticSimilarityResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SemanticSimilarityResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SemanticSimilarityResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.score != null && message.hasOwnProperty("score")) { + properties._score = 1; + if (!$util.isInteger(message.score)) + return "score: integer expected"; + } + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.explanation != null && message.hasOwnProperty("explanation")) + if (!$util.isString(message.explanation)) + return "explanation: string expected"; + if (message.outcome != null && message.hasOwnProperty("outcome")) + switch (message.outcome) { + default: + return "outcome: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a SemanticSimilarityResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult} SemanticSimilarityResult + */ + SemanticSimilarityResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult(); + if (object.score != null) + message.score = object.score | 0; + if (object.label != null) + message.label = String(object.label); + if (object.explanation != null) + message.explanation = String(object.explanation); + switch (object.outcome) { + default: + if (typeof object.outcome === "number") { + message.outcome = object.outcome; + break; + } + break; + case "OUTCOME_UNSPECIFIED": + case 0: + message.outcome = 0; + break; + case "PASS": + case 1: + message.outcome = 1; + break; + case "FAIL": + case 2: + message.outcome = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a SemanticSimilarityResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult} message SemanticSimilarityResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SemanticSimilarityResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.label = ""; + object.explanation = ""; + object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; + } + if (message.score != null && message.hasOwnProperty("score")) { + object.score = message.score; + if (options.oneofs) + object._score = "score"; + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = message.explanation; + if (message.outcome != null && message.hasOwnProperty("outcome")) + object.outcome = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] : message.outcome; + return object; + }; + + /** + * Converts this SemanticSimilarityResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @instance + * @returns {Object.} JSON object + */ + SemanticSimilarityResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SemanticSimilarityResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticSimilarityResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult"; + }; + + return SemanticSimilarityResult; + })(); + + EvaluationResult.OverallToolInvocationResult = (function() { + + /** + * Properties of an OverallToolInvocationResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IOverallToolInvocationResult + * @property {number|null} [toolInvocationScore] OverallToolInvocationResult toolInvocationScore + * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [outcome] OverallToolInvocationResult outcome + */ + + /** + * Constructs a new OverallToolInvocationResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents an OverallToolInvocationResult. + * @implements IOverallToolInvocationResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult=} [properties] Properties to set + */ + function OverallToolInvocationResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OverallToolInvocationResult toolInvocationScore. + * @member {number|null|undefined} toolInvocationScore + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @instance + */ + OverallToolInvocationResult.prototype.toolInvocationScore = null; + + /** + * OverallToolInvocationResult outcome. + * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} outcome + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @instance + */ + OverallToolInvocationResult.prototype.outcome = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OverallToolInvocationResult.prototype, "_toolInvocationScore", { + get: $util.oneOfGetter($oneOfFields = ["toolInvocationScore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OverallToolInvocationResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult} OverallToolInvocationResult instance + */ + OverallToolInvocationResult.create = function create(properties) { + return new OverallToolInvocationResult(properties); + }; + + /** + * Encodes the specified OverallToolInvocationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult} message OverallToolInvocationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OverallToolInvocationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolInvocationScore != null && Object.hasOwnProperty.call(message, "toolInvocationScore")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.toolInvocationScore); + if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.outcome); + return writer; + }; + + /** + * Encodes the specified OverallToolInvocationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult} message OverallToolInvocationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OverallToolInvocationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OverallToolInvocationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult} OverallToolInvocationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OverallToolInvocationResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolInvocationScore = reader.float(); + break; + } + case 2: { + message.outcome = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OverallToolInvocationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult} OverallToolInvocationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OverallToolInvocationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OverallToolInvocationResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OverallToolInvocationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.toolInvocationScore != null && message.hasOwnProperty("toolInvocationScore")) { + properties._toolInvocationScore = 1; + if (typeof message.toolInvocationScore !== "number") + return "toolInvocationScore: number expected"; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + switch (message.outcome) { + default: + return "outcome: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an OverallToolInvocationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult} OverallToolInvocationResult + */ + OverallToolInvocationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult(); + if (object.toolInvocationScore != null) + message.toolInvocationScore = Number(object.toolInvocationScore); + switch (object.outcome) { + default: + if (typeof object.outcome === "number") { + message.outcome = object.outcome; + break; + } + break; + case "OUTCOME_UNSPECIFIED": + case 0: + message.outcome = 0; + break; + case "PASS": + case 1: + message.outcome = 1; + break; + case "FAIL": + case 2: + message.outcome = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an OverallToolInvocationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult} message OverallToolInvocationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OverallToolInvocationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; + if (message.toolInvocationScore != null && message.hasOwnProperty("toolInvocationScore")) { + object.toolInvocationScore = options.json && !isFinite(message.toolInvocationScore) ? String(message.toolInvocationScore) : message.toolInvocationScore; + if (options.oneofs) + object._toolInvocationScore = "toolInvocationScore"; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + object.outcome = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] : message.outcome; + return object; + }; + + /** + * Converts this OverallToolInvocationResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @instance + * @returns {Object.} JSON object + */ + OverallToolInvocationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OverallToolInvocationResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OverallToolInvocationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult"; + }; + + return OverallToolInvocationResult; + })(); + + EvaluationResult.TaskCompletionResult = (function() { + + /** + * Properties of a TaskCompletionResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface ITaskCompletionResult + * @property {number|null} [score] TaskCompletionResult score + * @property {string|null} [label] TaskCompletionResult label + * @property {string|null} [explanation] TaskCompletionResult explanation + */ + + /** + * Constructs a new TaskCompletionResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a TaskCompletionResult. + * @implements ITaskCompletionResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult=} [properties] Properties to set + */ + function TaskCompletionResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskCompletionResult score. + * @member {number|null|undefined} score + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @instance + */ + TaskCompletionResult.prototype.score = null; + + /** + * TaskCompletionResult label. + * @member {string} label + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @instance + */ + TaskCompletionResult.prototype.label = ""; + + /** + * TaskCompletionResult explanation. + * @member {string} explanation + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @instance + */ + TaskCompletionResult.prototype.explanation = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TaskCompletionResult.prototype, "_score", { + get: $util.oneOfGetter($oneOfFields = ["score"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TaskCompletionResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult} TaskCompletionResult instance + */ + TaskCompletionResult.create = function create(properties) { + return new TaskCompletionResult(properties); + }; + + /** + * Encodes the specified TaskCompletionResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult} message TaskCompletionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskCompletionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.score); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.explanation); + return writer; + }; + + /** + * Encodes the specified TaskCompletionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult} message TaskCompletionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskCompletionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskCompletionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult} TaskCompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskCompletionResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.int32(); + break; + } + case 2: { + message.label = reader.string(); + break; + } + case 3: { + message.explanation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskCompletionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult} TaskCompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskCompletionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskCompletionResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskCompletionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.score != null && message.hasOwnProperty("score")) { + properties._score = 1; + if (!$util.isInteger(message.score)) + return "score: integer expected"; + } + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.explanation != null && message.hasOwnProperty("explanation")) + if (!$util.isString(message.explanation)) + return "explanation: string expected"; + return null; + }; + + /** + * Creates a TaskCompletionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult} TaskCompletionResult + */ + TaskCompletionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult(); + if (object.score != null) + message.score = object.score | 0; + if (object.label != null) + message.label = String(object.label); + if (object.explanation != null) + message.explanation = String(object.explanation); + return message; + }; + + /** + * Creates a plain object from a TaskCompletionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult} message TaskCompletionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskCompletionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.label = ""; + object.explanation = ""; + } + if (message.score != null && message.hasOwnProperty("score")) { + object.score = message.score; + if (options.oneofs) + object._score = "score"; + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = message.explanation; + return object; + }; + + /** + * Converts this TaskCompletionResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @instance + * @returns {Object.} JSON object + */ + TaskCompletionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskCompletionResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskCompletionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult"; + }; + + return TaskCompletionResult; + })(); + + /** + * Outcome enum. + * @name google.cloud.ces.v1beta.EvaluationResult.Outcome + * @enum {number} + * @property {number} OUTCOME_UNSPECIFIED=0 OUTCOME_UNSPECIFIED value + * @property {number} PASS=1 PASS value + * @property {number} FAIL=2 FAIL value + */ + EvaluationResult.Outcome = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OUTCOME_UNSPECIFIED"] = 0; + values[valuesById[1] = "PASS"] = 1; + values[valuesById[2] = "FAIL"] = 2; + return values; + })(); + + /** + * ExecutionState enum. + * @name google.cloud.ces.v1beta.EvaluationResult.ExecutionState + * @enum {number} + * @property {number} EXECUTION_STATE_UNSPECIFIED=0 EXECUTION_STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} COMPLETED=2 COMPLETED value + * @property {number} ERROR=3 ERROR value + */ + EvaluationResult.ExecutionState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXECUTION_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "COMPLETED"] = 2; + values[valuesById[3] = "ERROR"] = 3; + return values; + })(); + + return EvaluationResult; + })(); + + v1beta.EvaluationRun = (function() { + + /** + * Properties of an EvaluationRun. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluationRun + * @property {string|null} [name] EvaluationRun name + * @property {string|null} [displayName] EvaluationRun displayName + * @property {Array.|null} [evaluationResults] EvaluationRun evaluationResults + * @property {google.protobuf.ITimestamp|null} [createTime] EvaluationRun createTime + * @property {string|null} [initiatedBy] EvaluationRun initiatedBy + * @property {string|null} [appVersion] EvaluationRun appVersion + * @property {string|null} [appVersionDisplayName] EvaluationRun appVersionDisplayName + * @property {string|null} [changelog] EvaluationRun changelog + * @property {google.protobuf.ITimestamp|null} [changelogCreateTime] EvaluationRun changelogCreateTime + * @property {Array.|null} [evaluations] EvaluationRun evaluations + * @property {string|null} [evaluationDataset] EvaluationRun evaluationDataset + * @property {google.cloud.ces.v1beta.EvaluationRun.EvaluationType|null} [evaluationType] EvaluationRun evaluationType + * @property {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState|null} [state] EvaluationRun state + * @property {google.cloud.ces.v1beta.EvaluationRun.IProgress|null} [progress] EvaluationRun progress + * @property {google.cloud.ces.v1beta.IEvaluationConfig|null} [config] EvaluationRun config + * @property {google.rpc.IStatus|null} [error] EvaluationRun error + * @property {google.cloud.ces.v1beta.IEvaluationErrorInfo|null} [errorInfo] EvaluationRun errorInfo + * @property {Object.|null} [evaluationRunSummaries] EvaluationRun evaluationRunSummaries + * @property {google.cloud.ces.v1beta.ILatencyReport|null} [latencyReport] EvaluationRun latencyReport + * @property {number|null} [runCount] EvaluationRun runCount + * @property {Array.|null} [personaRunConfigs] EvaluationRun personaRunConfigs + * @property {google.cloud.ces.v1beta.IOptimizationConfig|null} [optimizationConfig] EvaluationRun optimizationConfig + * @property {string|null} [scheduledEvaluationRun] EvaluationRun scheduledEvaluationRun + * @property {google.cloud.ces.v1beta.GoldenRunMethod|null} [goldenRunMethod] EvaluationRun goldenRunMethod + */ + + /** + * Constructs a new EvaluationRun. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationRun. + * @implements IEvaluationRun + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluationRun=} [properties] Properties to set + */ + function EvaluationRun(properties) { + this.evaluationResults = []; + this.evaluations = []; + this.evaluationRunSummaries = {}; + this.personaRunConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationRun name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.name = ""; + + /** + * EvaluationRun displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.displayName = ""; + + /** + * EvaluationRun evaluationResults. + * @member {Array.} evaluationResults + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.evaluationResults = $util.emptyArray; + + /** + * EvaluationRun createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.createTime = null; + + /** + * EvaluationRun initiatedBy. + * @member {string} initiatedBy + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.initiatedBy = ""; + + /** + * EvaluationRun appVersion. + * @member {string} appVersion + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.appVersion = ""; + + /** + * EvaluationRun appVersionDisplayName. + * @member {string} appVersionDisplayName + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.appVersionDisplayName = ""; + + /** + * EvaluationRun changelog. + * @member {string} changelog + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.changelog = ""; + + /** + * EvaluationRun changelogCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} changelogCreateTime + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.changelogCreateTime = null; + + /** + * EvaluationRun evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.evaluations = $util.emptyArray; + + /** + * EvaluationRun evaluationDataset. + * @member {string} evaluationDataset + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.evaluationDataset = ""; + + /** + * EvaluationRun evaluationType. + * @member {google.cloud.ces.v1beta.EvaluationRun.EvaluationType} evaluationType + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.evaluationType = 0; + + /** + * EvaluationRun state. + * @member {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState} state + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.state = 0; + + /** + * EvaluationRun progress. + * @member {google.cloud.ces.v1beta.EvaluationRun.IProgress|null|undefined} progress + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.progress = null; + + /** + * EvaluationRun config. + * @member {google.cloud.ces.v1beta.IEvaluationConfig|null|undefined} config + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.config = null; + + /** + * EvaluationRun error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.error = null; + + /** + * EvaluationRun errorInfo. + * @member {google.cloud.ces.v1beta.IEvaluationErrorInfo|null|undefined} errorInfo + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.errorInfo = null; + + /** + * EvaluationRun evaluationRunSummaries. + * @member {Object.} evaluationRunSummaries + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.evaluationRunSummaries = $util.emptyObject; + + /** + * EvaluationRun latencyReport. + * @member {google.cloud.ces.v1beta.ILatencyReport|null|undefined} latencyReport + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.latencyReport = null; + + /** + * EvaluationRun runCount. + * @member {number} runCount + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.runCount = 0; + + /** + * EvaluationRun personaRunConfigs. + * @member {Array.} personaRunConfigs + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.personaRunConfigs = $util.emptyArray; + + /** + * EvaluationRun optimizationConfig. + * @member {google.cloud.ces.v1beta.IOptimizationConfig|null|undefined} optimizationConfig + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.optimizationConfig = null; + + /** + * EvaluationRun scheduledEvaluationRun. + * @member {string} scheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.scheduledEvaluationRun = ""; + + /** + * EvaluationRun goldenRunMethod. + * @member {google.cloud.ces.v1beta.GoldenRunMethod} goldenRunMethod + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.goldenRunMethod = 0; + + /** + * Creates a new EvaluationRun instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @static + * @param {google.cloud.ces.v1beta.IEvaluationRun=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationRun} EvaluationRun instance + */ + EvaluationRun.create = function create(properties) { + return new EvaluationRun(properties); + }; + + /** + * Encodes the specified EvaluationRun message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @static + * @param {google.cloud.ces.v1beta.IEvaluationRun} message EvaluationRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationRun.encode = function encode(message, writer) { + if (!writer) + 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.evaluationResults != null && message.evaluationResults.length) + for (var i = 0; i < message.evaluationResults.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.evaluationResults[i]); + 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.initiatedBy != null && Object.hasOwnProperty.call(message, "initiatedBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.initiatedBy); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.appVersion); + if (message.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.evaluations[i]); + if (message.evaluationDataset != null && Object.hasOwnProperty.call(message, "evaluationDataset")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.evaluationDataset); + if (message.evaluationType != null && Object.hasOwnProperty.call(message, "evaluationType")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.evaluationType); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.cloud.ces.v1beta.EvaluationRun.Progress.encode(message.progress, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.ces.v1beta.EvaluationConfig.encode(message.config, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.appVersionDisplayName != null && Object.hasOwnProperty.call(message, "appVersionDisplayName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.appVersionDisplayName); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.evaluationRunSummaries != null && Object.hasOwnProperty.call(message, "evaluationRunSummaries")) + for (var keys = Object.keys(message.evaluationRunSummaries), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 15, wireType 2 =*/122).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.encode(message.evaluationRunSummaries[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.runCount != null && Object.hasOwnProperty.call(message, "runCount")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.runCount); + if (message.errorInfo != null && Object.hasOwnProperty.call(message, "errorInfo")) + $root.google.cloud.ces.v1beta.EvaluationErrorInfo.encode(message.errorInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.personaRunConfigs != null && message.personaRunConfigs.length) + for (var i = 0; i < message.personaRunConfigs.length; ++i) + $root.google.cloud.ces.v1beta.PersonaRunConfig.encode(message.personaRunConfigs[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.optimizationConfig != null && Object.hasOwnProperty.call(message, "optimizationConfig")) + $root.google.cloud.ces.v1beta.OptimizationConfig.encode(message.optimizationConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.scheduledEvaluationRun != null && Object.hasOwnProperty.call(message, "scheduledEvaluationRun")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.scheduledEvaluationRun); + if (message.goldenRunMethod != null && Object.hasOwnProperty.call(message, "goldenRunMethod")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.goldenRunMethod); + if (message.changelog != null && Object.hasOwnProperty.call(message, "changelog")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.changelog); + if (message.changelogCreateTime != null && Object.hasOwnProperty.call(message, "changelogCreateTime")) + $root.google.protobuf.Timestamp.encode(message.changelogCreateTime, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.latencyReport != null && Object.hasOwnProperty.call(message, "latencyReport")) + $root.google.cloud.ces.v1beta.LatencyReport.encode(message.latencyReport, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluationRun message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @static + * @param {google.cloud.ces.v1beta.IEvaluationRun} message EvaluationRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationRun.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationRun message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationRun} EvaluationRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationRun.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationRun(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + if (!(message.evaluationResults && message.evaluationResults.length)) + message.evaluationResults = []; + message.evaluationResults.push(reader.string()); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.initiatedBy = reader.string(); + break; + } + case 6: { + message.appVersion = reader.string(); + break; + } + case 13: { + message.appVersionDisplayName = reader.string(); + break; + } + case 22: { + message.changelog = reader.string(); + break; + } + case 23: { + message.changelogCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push(reader.string()); + break; + } + case 8: { + message.evaluationDataset = reader.string(); + break; + } + case 9: { + message.evaluationType = reader.int32(); + break; + } + case 10: { + message.state = reader.int32(); + break; + } + case 11: { + message.progress = $root.google.cloud.ces.v1beta.EvaluationRun.Progress.decode(reader, reader.uint32()); + break; + } + case 12: { + message.config = $root.google.cloud.ces.v1beta.EvaluationConfig.decode(reader, reader.uint32()); + break; + } + case 14: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 17: { + message.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.decode(reader, reader.uint32()); + break; + } + case 15: { + if (message.evaluationRunSummaries === $util.emptyObject) + message.evaluationRunSummaries = {}; + 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.ces.v1beta.EvaluationRun.EvaluationRunSummary.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.evaluationRunSummaries[key] = value; + break; + } + case 25: { + message.latencyReport = $root.google.cloud.ces.v1beta.LatencyReport.decode(reader, reader.uint32()); + break; + } + case 16: { + message.runCount = reader.int32(); + break; + } + case 18: { + if (!(message.personaRunConfigs && message.personaRunConfigs.length)) + message.personaRunConfigs = []; + message.personaRunConfigs.push($root.google.cloud.ces.v1beta.PersonaRunConfig.decode(reader, reader.uint32())); + break; + } + case 19: { + message.optimizationConfig = $root.google.cloud.ces.v1beta.OptimizationConfig.decode(reader, reader.uint32()); + break; + } + case 20: { + message.scheduledEvaluationRun = reader.string(); + break; + } + case 21: { + message.goldenRunMethod = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationRun message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationRun} EvaluationRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationRun.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationRun message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationRun.verify = function verify(message) { + if (typeof message !== "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.evaluationResults != null && message.hasOwnProperty("evaluationResults")) { + if (!Array.isArray(message.evaluationResults)) + return "evaluationResults: array expected"; + for (var i = 0; i < message.evaluationResults.length; ++i) + if (!$util.isString(message.evaluationResults[i])) + return "evaluationResults: 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.initiatedBy != null && message.hasOwnProperty("initiatedBy")) + if (!$util.isString(message.initiatedBy)) + return "initiatedBy: string expected"; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (!$util.isString(message.appVersion)) + return "appVersion: string expected"; + if (message.appVersionDisplayName != null && message.hasOwnProperty("appVersionDisplayName")) + if (!$util.isString(message.appVersionDisplayName)) + return "appVersionDisplayName: string expected"; + if (message.changelog != null && message.hasOwnProperty("changelog")) + if (!$util.isString(message.changelog)) + return "changelog: string expected"; + if (message.changelogCreateTime != null && message.hasOwnProperty("changelogCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.changelogCreateTime); + if (error) + return "changelogCreateTime." + error; + } + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) + if (!$util.isString(message.evaluations[i])) + return "evaluations: string[] expected"; + } + if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) + if (!$util.isString(message.evaluationDataset)) + return "evaluationDataset: string expected"; + if (message.evaluationType != null && message.hasOwnProperty("evaluationType")) + switch (message.evaluationType) { + default: + return "evaluationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.cloud.ces.v1beta.EvaluationRun.Progress.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.ces.v1beta.EvaluationConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.errorInfo != null && message.hasOwnProperty("errorInfo")) { + var error = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.verify(message.errorInfo); + if (error) + return "errorInfo." + error; + } + if (message.evaluationRunSummaries != null && message.hasOwnProperty("evaluationRunSummaries")) { + if (!$util.isObject(message.evaluationRunSummaries)) + return "evaluationRunSummaries: object expected"; + var key = Object.keys(message.evaluationRunSummaries); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.verify(message.evaluationRunSummaries[key[i]]); + if (error) + return "evaluationRunSummaries." + error; + } + } + if (message.latencyReport != null && message.hasOwnProperty("latencyReport")) { + var error = $root.google.cloud.ces.v1beta.LatencyReport.verify(message.latencyReport); + if (error) + return "latencyReport." + error; + } + if (message.runCount != null && message.hasOwnProperty("runCount")) + if (!$util.isInteger(message.runCount)) + return "runCount: integer expected"; + if (message.personaRunConfigs != null && message.hasOwnProperty("personaRunConfigs")) { + if (!Array.isArray(message.personaRunConfigs)) + return "personaRunConfigs: array expected"; + for (var i = 0; i < message.personaRunConfigs.length; ++i) { + var error = $root.google.cloud.ces.v1beta.PersonaRunConfig.verify(message.personaRunConfigs[i]); + if (error) + return "personaRunConfigs." + error; + } + } + if (message.optimizationConfig != null && message.hasOwnProperty("optimizationConfig")) { + var error = $root.google.cloud.ces.v1beta.OptimizationConfig.verify(message.optimizationConfig); + if (error) + return "optimizationConfig." + error; + } + if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) + if (!$util.isString(message.scheduledEvaluationRun)) + return "scheduledEvaluationRun: string expected"; + if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) + switch (message.goldenRunMethod) { + default: + return "goldenRunMethod: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an EvaluationRun message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationRun} EvaluationRun + */ + EvaluationRun.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationRun) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationRun(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.evaluationResults) { + if (!Array.isArray(object.evaluationResults)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.evaluationResults: array expected"); + message.evaluationResults = []; + for (var i = 0; i < object.evaluationResults.length; ++i) + message.evaluationResults[i] = String(object.evaluationResults[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.initiatedBy != null) + message.initiatedBy = String(object.initiatedBy); + if (object.appVersion != null) + message.appVersion = String(object.appVersion); + if (object.appVersionDisplayName != null) + message.appVersionDisplayName = String(object.appVersionDisplayName); + if (object.changelog != null) + message.changelog = String(object.changelog); + if (object.changelogCreateTime != null) { + if (typeof object.changelogCreateTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.changelogCreateTime: object expected"); + message.changelogCreateTime = $root.google.protobuf.Timestamp.fromObject(object.changelogCreateTime); + } + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) + message.evaluations[i] = String(object.evaluations[i]); + } + if (object.evaluationDataset != null) + message.evaluationDataset = String(object.evaluationDataset); + switch (object.evaluationType) { + default: + if (typeof object.evaluationType === "number") { + message.evaluationType = object.evaluationType; + break; + } + break; + case "EVALUATION_TYPE_UNSPECIFIED": + case 0: + message.evaluationType = 0; + break; + case "GOLDEN": + case 1: + message.evaluationType = 1; + break; + case "SCENARIO": + case 2: + message.evaluationType = 2; + break; + case "MIXED": + case 3: + message.evaluationType = 3; + break; + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "EVALUATION_RUN_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "COMPLETED": + case 2: + message.state = 2; + break; + case "ERROR": + case 3: + message.state = 3; + break; + } + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.progress: object expected"); + message.progress = $root.google.cloud.ces.v1beta.EvaluationRun.Progress.fromObject(object.progress); + } + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.config: object expected"); + message.config = $root.google.cloud.ces.v1beta.EvaluationConfig.fromObject(object.config); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.errorInfo != null) { + if (typeof object.errorInfo !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.errorInfo: object expected"); + message.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.fromObject(object.errorInfo); + } + if (object.evaluationRunSummaries) { + if (typeof object.evaluationRunSummaries !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.evaluationRunSummaries: object expected"); + message.evaluationRunSummaries = {}; + for (var keys = Object.keys(object.evaluationRunSummaries), i = 0; i < keys.length; ++i) { + if (typeof object.evaluationRunSummaries[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.evaluationRunSummaries: object expected"); + message.evaluationRunSummaries[keys[i]] = $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.fromObject(object.evaluationRunSummaries[keys[i]]); + } + } + if (object.latencyReport != null) { + if (typeof object.latencyReport !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.latencyReport: object expected"); + message.latencyReport = $root.google.cloud.ces.v1beta.LatencyReport.fromObject(object.latencyReport); + } + if (object.runCount != null) + message.runCount = object.runCount | 0; + if (object.personaRunConfigs) { + if (!Array.isArray(object.personaRunConfigs)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.personaRunConfigs: array expected"); + message.personaRunConfigs = []; + for (var i = 0; i < object.personaRunConfigs.length; ++i) { + if (typeof object.personaRunConfigs[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.personaRunConfigs: object expected"); + message.personaRunConfigs[i] = $root.google.cloud.ces.v1beta.PersonaRunConfig.fromObject(object.personaRunConfigs[i]); + } + } + if (object.optimizationConfig != null) { + if (typeof object.optimizationConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.optimizationConfig: object expected"); + message.optimizationConfig = $root.google.cloud.ces.v1beta.OptimizationConfig.fromObject(object.optimizationConfig); + } + if (object.scheduledEvaluationRun != null) + message.scheduledEvaluationRun = String(object.scheduledEvaluationRun); + switch (object.goldenRunMethod) { + default: + if (typeof object.goldenRunMethod === "number") { + message.goldenRunMethod = object.goldenRunMethod; + break; + } + break; + case "GOLDEN_RUN_METHOD_UNSPECIFIED": + case 0: + message.goldenRunMethod = 0; + break; + case "STABLE": + case 1: + message.goldenRunMethod = 1; + break; + case "NAIVE": + case 2: + message.goldenRunMethod = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an EvaluationRun message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @static + * @param {google.cloud.ces.v1beta.EvaluationRun} message EvaluationRun + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationRun.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.evaluationResults = []; + object.evaluations = []; + object.personaRunConfigs = []; + } + if (options.objects || options.defaults) + object.evaluationRunSummaries = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.createTime = null; + object.initiatedBy = ""; + object.appVersion = ""; + object.evaluationDataset = ""; + object.evaluationType = options.enums === String ? "EVALUATION_TYPE_UNSPECIFIED" : 0; + object.state = options.enums === String ? "EVALUATION_RUN_STATE_UNSPECIFIED" : 0; + object.progress = null; + object.config = null; + object.appVersionDisplayName = ""; + object.error = null; + object.runCount = 0; + object.errorInfo = null; + object.optimizationConfig = null; + object.scheduledEvaluationRun = ""; + object.goldenRunMethod = options.enums === String ? "GOLDEN_RUN_METHOD_UNSPECIFIED" : 0; + object.changelog = ""; + object.changelogCreateTime = null; + object.latencyReport = 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.evaluationResults && message.evaluationResults.length) { + object.evaluationResults = []; + for (var j = 0; j < message.evaluationResults.length; ++j) + object.evaluationResults[j] = message.evaluationResults[j]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.initiatedBy != null && message.hasOwnProperty("initiatedBy")) + object.initiatedBy = message.initiatedBy; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + object.appVersion = message.appVersion; + if (message.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = message.evaluations[j]; + } + if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) + object.evaluationDataset = message.evaluationDataset; + if (message.evaluationType != null && message.hasOwnProperty("evaluationType")) + object.evaluationType = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationType[message.evaluationType] === undefined ? message.evaluationType : $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationType[message.evaluationType] : message.evaluationType; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState[message.state] === undefined ? message.state : $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState[message.state] : message.state; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.cloud.ces.v1beta.EvaluationRun.Progress.toObject(message.progress, options); + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.ces.v1beta.EvaluationConfig.toObject(message.config, options); + if (message.appVersionDisplayName != null && message.hasOwnProperty("appVersionDisplayName")) + object.appVersionDisplayName = message.appVersionDisplayName; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + var keys2; + if (message.evaluationRunSummaries && (keys2 = Object.keys(message.evaluationRunSummaries)).length) { + object.evaluationRunSummaries = {}; + for (var j = 0; j < keys2.length; ++j) + object.evaluationRunSummaries[keys2[j]] = $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.toObject(message.evaluationRunSummaries[keys2[j]], options); + } + if (message.runCount != null && message.hasOwnProperty("runCount")) + object.runCount = message.runCount; + if (message.errorInfo != null && message.hasOwnProperty("errorInfo")) + object.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.toObject(message.errorInfo, options); + if (message.personaRunConfigs && message.personaRunConfigs.length) { + object.personaRunConfigs = []; + for (var j = 0; j < message.personaRunConfigs.length; ++j) + object.personaRunConfigs[j] = $root.google.cloud.ces.v1beta.PersonaRunConfig.toObject(message.personaRunConfigs[j], options); + } + if (message.optimizationConfig != null && message.hasOwnProperty("optimizationConfig")) + object.optimizationConfig = $root.google.cloud.ces.v1beta.OptimizationConfig.toObject(message.optimizationConfig, options); + if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) + object.scheduledEvaluationRun = message.scheduledEvaluationRun; + if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) + object.goldenRunMethod = options.enums === String ? $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] === undefined ? message.goldenRunMethod : $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] : message.goldenRunMethod; + if (message.changelog != null && message.hasOwnProperty("changelog")) + object.changelog = message.changelog; + if (message.changelogCreateTime != null && message.hasOwnProperty("changelogCreateTime")) + object.changelogCreateTime = $root.google.protobuf.Timestamp.toObject(message.changelogCreateTime, options); + if (message.latencyReport != null && message.hasOwnProperty("latencyReport")) + object.latencyReport = $root.google.cloud.ces.v1beta.LatencyReport.toObject(message.latencyReport, options); + return object; + }; + + /** + * Converts this EvaluationRun to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + * @returns {Object.} JSON object + */ + EvaluationRun.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationRun + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationRun"; + }; + + EvaluationRun.Progress = (function() { + + /** + * Properties of a Progress. + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @interface IProgress + * @property {number|null} [totalCount] Progress totalCount + * @property {number|null} [failedCount] Progress failedCount + * @property {number|null} [errorCount] Progress errorCount + * @property {number|null} [completedCount] Progress completedCount + * @property {number|null} [passedCount] Progress passedCount + */ + + /** + * Constructs a new Progress. + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @classdesc Represents a Progress. + * @implements IProgress + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationRun.IProgress=} [properties] Properties to set + */ + function Progress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Progress totalCount. + * @member {number} totalCount + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @instance + */ + Progress.prototype.totalCount = 0; + + /** + * Progress failedCount. + * @member {number} failedCount + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @instance + */ + Progress.prototype.failedCount = 0; + + /** + * Progress errorCount. + * @member {number} errorCount + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @instance + */ + Progress.prototype.errorCount = 0; + + /** + * Progress completedCount. + * @member {number} completedCount + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @instance + */ + Progress.prototype.completedCount = 0; + + /** + * Progress passedCount. + * @member {number} passedCount + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @instance + */ + Progress.prototype.passedCount = 0; + + /** + * Creates a new Progress instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @static + * @param {google.cloud.ces.v1beta.EvaluationRun.IProgress=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationRun.Progress} Progress instance + */ + Progress.create = function create(properties) { + return new Progress(properties); + }; + + /** + * Encodes the specified Progress message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.Progress.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @static + * @param {google.cloud.ces.v1beta.EvaluationRun.IProgress} message Progress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Progress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalCount != null && Object.hasOwnProperty.call(message, "totalCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalCount); + if (message.failedCount != null && Object.hasOwnProperty.call(message, "failedCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.failedCount); + if (message.errorCount != null && Object.hasOwnProperty.call(message, "errorCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.errorCount); + if (message.completedCount != null && Object.hasOwnProperty.call(message, "completedCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.completedCount); + if (message.passedCount != null && Object.hasOwnProperty.call(message, "passedCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.passedCount); + return writer; + }; + + /** + * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.Progress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @static + * @param {google.cloud.ces.v1beta.EvaluationRun.IProgress} message Progress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Progress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Progress message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationRun.Progress} Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Progress.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationRun.Progress(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.totalCount = reader.int32(); + break; + } + case 2: { + message.failedCount = reader.int32(); + break; + } + case 3: { + message.errorCount = reader.int32(); + break; + } + case 4: { + message.completedCount = reader.int32(); + break; + } + case 5: { + message.passedCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Progress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationRun.Progress} Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Progress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Progress message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Progress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.totalCount != null && message.hasOwnProperty("totalCount")) + if (!$util.isInteger(message.totalCount)) + return "totalCount: integer expected"; + if (message.failedCount != null && message.hasOwnProperty("failedCount")) + if (!$util.isInteger(message.failedCount)) + return "failedCount: integer expected"; + if (message.errorCount != null && message.hasOwnProperty("errorCount")) + if (!$util.isInteger(message.errorCount)) + return "errorCount: integer expected"; + if (message.completedCount != null && message.hasOwnProperty("completedCount")) + if (!$util.isInteger(message.completedCount)) + return "completedCount: integer expected"; + if (message.passedCount != null && message.hasOwnProperty("passedCount")) + if (!$util.isInteger(message.passedCount)) + return "passedCount: integer expected"; + return null; + }; + + /** + * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationRun.Progress} Progress + */ + Progress.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationRun.Progress) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationRun.Progress(); + if (object.totalCount != null) + message.totalCount = object.totalCount | 0; + if (object.failedCount != null) + message.failedCount = object.failedCount | 0; + if (object.errorCount != null) + message.errorCount = object.errorCount | 0; + if (object.completedCount != null) + message.completedCount = object.completedCount | 0; + if (object.passedCount != null) + message.passedCount = object.passedCount | 0; + return message; + }; + + /** + * Creates a plain object from a Progress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @static + * @param {google.cloud.ces.v1beta.EvaluationRun.Progress} message Progress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Progress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.totalCount = 0; + object.failedCount = 0; + object.errorCount = 0; + object.completedCount = 0; + object.passedCount = 0; + } + if (message.totalCount != null && message.hasOwnProperty("totalCount")) + object.totalCount = message.totalCount; + if (message.failedCount != null && message.hasOwnProperty("failedCount")) + object.failedCount = message.failedCount; + if (message.errorCount != null && message.hasOwnProperty("errorCount")) + object.errorCount = message.errorCount; + if (message.completedCount != null && message.hasOwnProperty("completedCount")) + object.completedCount = message.completedCount; + if (message.passedCount != null && message.hasOwnProperty("passedCount")) + object.passedCount = message.passedCount; + return object; + }; + + /** + * Converts this Progress to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @instance + * @returns {Object.} JSON object + */ + Progress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Progress + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Progress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationRun.Progress"; + }; + + return Progress; + })(); + + EvaluationRun.EvaluationRunSummary = (function() { + + /** + * Properties of an EvaluationRunSummary. + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @interface IEvaluationRunSummary + * @property {number|null} [passedCount] EvaluationRunSummary passedCount + * @property {number|null} [failedCount] EvaluationRunSummary failedCount + * @property {number|null} [errorCount] EvaluationRunSummary errorCount + */ + + /** + * Constructs a new EvaluationRunSummary. + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @classdesc Represents an EvaluationRunSummary. + * @implements IEvaluationRunSummary + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary=} [properties] Properties to set + */ + function EvaluationRunSummary(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationRunSummary passedCount. + * @member {number} passedCount + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @instance + */ + EvaluationRunSummary.prototype.passedCount = 0; + + /** + * EvaluationRunSummary failedCount. + * @member {number} failedCount + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @instance + */ + EvaluationRunSummary.prototype.failedCount = 0; + + /** + * EvaluationRunSummary errorCount. + * @member {number} errorCount + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @instance + */ + EvaluationRunSummary.prototype.errorCount = 0; + + /** + * Creates a new EvaluationRunSummary instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @static + * @param {google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary} EvaluationRunSummary instance + */ + EvaluationRunSummary.create = function create(properties) { + return new EvaluationRunSummary(properties); + }; + + /** + * Encodes the specified EvaluationRunSummary message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @static + * @param {google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary} message EvaluationRunSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationRunSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.passedCount != null && Object.hasOwnProperty.call(message, "passedCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.passedCount); + if (message.failedCount != null && Object.hasOwnProperty.call(message, "failedCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.failedCount); + if (message.errorCount != null && Object.hasOwnProperty.call(message, "errorCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.errorCount); + return writer; + }; + + /** + * Encodes the specified EvaluationRunSummary message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @static + * @param {google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary} message EvaluationRunSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationRunSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationRunSummary message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary} EvaluationRunSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationRunSummary.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.passedCount = reader.int32(); + break; + } + case 2: { + message.failedCount = reader.int32(); + break; + } + case 3: { + message.errorCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationRunSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary} EvaluationRunSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationRunSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationRunSummary message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationRunSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.passedCount != null && message.hasOwnProperty("passedCount")) + if (!$util.isInteger(message.passedCount)) + return "passedCount: integer expected"; + if (message.failedCount != null && message.hasOwnProperty("failedCount")) + if (!$util.isInteger(message.failedCount)) + return "failedCount: integer expected"; + if (message.errorCount != null && message.hasOwnProperty("errorCount")) + if (!$util.isInteger(message.errorCount)) + return "errorCount: integer expected"; + return null; + }; + + /** + * Creates an EvaluationRunSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary} EvaluationRunSummary + */ + EvaluationRunSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary(); + if (object.passedCount != null) + message.passedCount = object.passedCount | 0; + if (object.failedCount != null) + message.failedCount = object.failedCount | 0; + if (object.errorCount != null) + message.errorCount = object.errorCount | 0; + return message; + }; + + /** + * Creates a plain object from an EvaluationRunSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @static + * @param {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary} message EvaluationRunSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationRunSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.passedCount = 0; + object.failedCount = 0; + object.errorCount = 0; + } + if (message.passedCount != null && message.hasOwnProperty("passedCount")) + object.passedCount = message.passedCount; + if (message.failedCount != null && message.hasOwnProperty("failedCount")) + object.failedCount = message.failedCount; + if (message.errorCount != null && message.hasOwnProperty("errorCount")) + object.errorCount = message.errorCount; + return object; + }; + + /** + * Converts this EvaluationRunSummary to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @instance + * @returns {Object.} JSON object + */ + EvaluationRunSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationRunSummary + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationRunSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary"; + }; + + return EvaluationRunSummary; + })(); + + /** + * EvaluationType enum. + * @name google.cloud.ces.v1beta.EvaluationRun.EvaluationType + * @enum {number} + * @property {number} EVALUATION_TYPE_UNSPECIFIED=0 EVALUATION_TYPE_UNSPECIFIED value + * @property {number} GOLDEN=1 GOLDEN value + * @property {number} SCENARIO=2 SCENARIO value + * @property {number} MIXED=3 MIXED value + */ + EvaluationRun.EvaluationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVALUATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOLDEN"] = 1; + values[valuesById[2] = "SCENARIO"] = 2; + values[valuesById[3] = "MIXED"] = 3; + return values; + })(); + + /** + * EvaluationRunState enum. + * @name google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState + * @enum {number} + * @property {number} EVALUATION_RUN_STATE_UNSPECIFIED=0 EVALUATION_RUN_STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} COMPLETED=2 COMPLETED value + * @property {number} ERROR=3 ERROR value + */ + EvaluationRun.EvaluationRunState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVALUATION_RUN_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "COMPLETED"] = 2; + values[valuesById[3] = "ERROR"] = 3; + return values; + })(); + + return EvaluationRun; + })(); + + v1beta.LatencyReport = (function() { + + /** + * Properties of a LatencyReport. + * @memberof google.cloud.ces.v1beta + * @interface ILatencyReport + * @property {Array.|null} [toolLatencies] LatencyReport toolLatencies + * @property {Array.|null} [callbackLatencies] LatencyReport callbackLatencies + * @property {Array.|null} [guardrailLatencies] LatencyReport guardrailLatencies + * @property {Array.|null} [llmCallLatencies] LatencyReport llmCallLatencies + * @property {number|null} [sessionCount] LatencyReport sessionCount + */ + + /** + * Constructs a new LatencyReport. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a LatencyReport. + * @implements ILatencyReport + * @constructor + * @param {google.cloud.ces.v1beta.ILatencyReport=} [properties] Properties to set + */ + function LatencyReport(properties) { + this.toolLatencies = []; + this.callbackLatencies = []; + this.guardrailLatencies = []; + this.llmCallLatencies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LatencyReport toolLatencies. + * @member {Array.} toolLatencies + * @memberof google.cloud.ces.v1beta.LatencyReport + * @instance + */ + LatencyReport.prototype.toolLatencies = $util.emptyArray; + + /** + * LatencyReport callbackLatencies. + * @member {Array.} callbackLatencies + * @memberof google.cloud.ces.v1beta.LatencyReport + * @instance + */ + LatencyReport.prototype.callbackLatencies = $util.emptyArray; + + /** + * LatencyReport guardrailLatencies. + * @member {Array.} guardrailLatencies + * @memberof google.cloud.ces.v1beta.LatencyReport + * @instance + */ + LatencyReport.prototype.guardrailLatencies = $util.emptyArray; + + /** + * LatencyReport llmCallLatencies. + * @member {Array.} llmCallLatencies + * @memberof google.cloud.ces.v1beta.LatencyReport + * @instance + */ + LatencyReport.prototype.llmCallLatencies = $util.emptyArray; + + /** + * LatencyReport sessionCount. + * @member {number} sessionCount + * @memberof google.cloud.ces.v1beta.LatencyReport + * @instance + */ + LatencyReport.prototype.sessionCount = 0; + + /** + * Creates a new LatencyReport instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.LatencyReport + * @static + * @param {google.cloud.ces.v1beta.ILatencyReport=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.LatencyReport} LatencyReport instance + */ + LatencyReport.create = function create(properties) { + return new LatencyReport(properties); + }; + + /** + * Encodes the specified LatencyReport message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.LatencyReport + * @static + * @param {google.cloud.ces.v1beta.ILatencyReport} message LatencyReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatencyReport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolLatencies != null && message.toolLatencies.length) + for (var i = 0; i < message.toolLatencies.length; ++i) + $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency.encode(message.toolLatencies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.callbackLatencies != null && message.callbackLatencies.length) + for (var i = 0; i < message.callbackLatencies.length; ++i) + $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency.encode(message.callbackLatencies[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.guardrailLatencies != null && message.guardrailLatencies.length) + for (var i = 0; i < message.guardrailLatencies.length; ++i) + $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.encode(message.guardrailLatencies[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.llmCallLatencies != null && message.llmCallLatencies.length) + for (var i = 0; i < message.llmCallLatencies.length; ++i) + $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.encode(message.llmCallLatencies[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.sessionCount != null && Object.hasOwnProperty.call(message, "sessionCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.sessionCount); + return writer; + }; + + /** + * Encodes the specified LatencyReport message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport + * @static + * @param {google.cloud.ces.v1beta.ILatencyReport} message LatencyReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatencyReport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatencyReport message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.LatencyReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.LatencyReport} LatencyReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatencyReport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LatencyReport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.toolLatencies && message.toolLatencies.length)) + message.toolLatencies = []; + message.toolLatencies.push($root.google.cloud.ces.v1beta.LatencyReport.ToolLatency.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.callbackLatencies && message.callbackLatencies.length)) + message.callbackLatencies = []; + message.callbackLatencies.push($root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.guardrailLatencies && message.guardrailLatencies.length)) + message.guardrailLatencies = []; + message.guardrailLatencies.push($root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.llmCallLatencies && message.llmCallLatencies.length)) + message.llmCallLatencies = []; + message.llmCallLatencies.push($root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.decode(reader, reader.uint32())); + break; + } + case 5: { + message.sessionCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LatencyReport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.LatencyReport} LatencyReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatencyReport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LatencyReport message. + * @function verify + * @memberof google.cloud.ces.v1beta.LatencyReport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LatencyReport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolLatencies != null && message.hasOwnProperty("toolLatencies")) { + if (!Array.isArray(message.toolLatencies)) + return "toolLatencies: array expected"; + for (var i = 0; i < message.toolLatencies.length; ++i) { + var error = $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency.verify(message.toolLatencies[i]); + if (error) + return "toolLatencies." + error; + } + } + if (message.callbackLatencies != null && message.hasOwnProperty("callbackLatencies")) { + if (!Array.isArray(message.callbackLatencies)) + return "callbackLatencies: array expected"; + for (var i = 0; i < message.callbackLatencies.length; ++i) { + var error = $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency.verify(message.callbackLatencies[i]); + if (error) + return "callbackLatencies." + error; + } + } + if (message.guardrailLatencies != null && message.hasOwnProperty("guardrailLatencies")) { + if (!Array.isArray(message.guardrailLatencies)) + return "guardrailLatencies: array expected"; + for (var i = 0; i < message.guardrailLatencies.length; ++i) { + var error = $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.verify(message.guardrailLatencies[i]); + if (error) + return "guardrailLatencies." + error; + } + } + if (message.llmCallLatencies != null && message.hasOwnProperty("llmCallLatencies")) { + if (!Array.isArray(message.llmCallLatencies)) + return "llmCallLatencies: array expected"; + for (var i = 0; i < message.llmCallLatencies.length; ++i) { + var error = $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.verify(message.llmCallLatencies[i]); + if (error) + return "llmCallLatencies." + error; + } + } + if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) + if (!$util.isInteger(message.sessionCount)) + return "sessionCount: integer expected"; + return null; + }; + + /** + * Creates a LatencyReport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.LatencyReport + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.LatencyReport} LatencyReport + */ + LatencyReport.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.LatencyReport) + return object; + var message = new $root.google.cloud.ces.v1beta.LatencyReport(); + if (object.toolLatencies) { + if (!Array.isArray(object.toolLatencies)) + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.toolLatencies: array expected"); + message.toolLatencies = []; + for (var i = 0; i < object.toolLatencies.length; ++i) { + if (typeof object.toolLatencies[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.toolLatencies: object expected"); + message.toolLatencies[i] = $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency.fromObject(object.toolLatencies[i]); + } + } + if (object.callbackLatencies) { + if (!Array.isArray(object.callbackLatencies)) + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.callbackLatencies: array expected"); + message.callbackLatencies = []; + for (var i = 0; i < object.callbackLatencies.length; ++i) { + if (typeof object.callbackLatencies[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.callbackLatencies: object expected"); + message.callbackLatencies[i] = $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency.fromObject(object.callbackLatencies[i]); + } + } + if (object.guardrailLatencies) { + if (!Array.isArray(object.guardrailLatencies)) + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.guardrailLatencies: array expected"); + message.guardrailLatencies = []; + for (var i = 0; i < object.guardrailLatencies.length; ++i) { + if (typeof object.guardrailLatencies[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.guardrailLatencies: object expected"); + message.guardrailLatencies[i] = $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.fromObject(object.guardrailLatencies[i]); + } + } + if (object.llmCallLatencies) { + if (!Array.isArray(object.llmCallLatencies)) + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.llmCallLatencies: array expected"); + message.llmCallLatencies = []; + for (var i = 0; i < object.llmCallLatencies.length; ++i) { + if (typeof object.llmCallLatencies[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.llmCallLatencies: object expected"); + message.llmCallLatencies[i] = $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.fromObject(object.llmCallLatencies[i]); + } + } + if (object.sessionCount != null) + message.sessionCount = object.sessionCount | 0; + return message; + }; + + /** + * Creates a plain object from a LatencyReport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.LatencyReport + * @static + * @param {google.cloud.ces.v1beta.LatencyReport} message LatencyReport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LatencyReport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.toolLatencies = []; + object.callbackLatencies = []; + object.guardrailLatencies = []; + object.llmCallLatencies = []; + } + if (options.defaults) + object.sessionCount = 0; + if (message.toolLatencies && message.toolLatencies.length) { + object.toolLatencies = []; + for (var j = 0; j < message.toolLatencies.length; ++j) + object.toolLatencies[j] = $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency.toObject(message.toolLatencies[j], options); + } + if (message.callbackLatencies && message.callbackLatencies.length) { + object.callbackLatencies = []; + for (var j = 0; j < message.callbackLatencies.length; ++j) + object.callbackLatencies[j] = $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency.toObject(message.callbackLatencies[j], options); + } + if (message.guardrailLatencies && message.guardrailLatencies.length) { + object.guardrailLatencies = []; + for (var j = 0; j < message.guardrailLatencies.length; ++j) + object.guardrailLatencies[j] = $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.toObject(message.guardrailLatencies[j], options); + } + if (message.llmCallLatencies && message.llmCallLatencies.length) { + object.llmCallLatencies = []; + for (var j = 0; j < message.llmCallLatencies.length; ++j) + object.llmCallLatencies[j] = $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.toObject(message.llmCallLatencies[j], options); + } + if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) + object.sessionCount = message.sessionCount; + return object; + }; + + /** + * Converts this LatencyReport to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.LatencyReport + * @instance + * @returns {Object.} JSON object + */ + LatencyReport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LatencyReport + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.LatencyReport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LatencyReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.LatencyReport"; + }; + + LatencyReport.LatencyMetrics = (function() { + + /** + * Properties of a LatencyMetrics. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @interface ILatencyMetrics + * @property {google.protobuf.IDuration|null} [p50Latency] LatencyMetrics p50Latency + * @property {google.protobuf.IDuration|null} [p90Latency] LatencyMetrics p90Latency + * @property {google.protobuf.IDuration|null} [p99Latency] LatencyMetrics p99Latency + * @property {number|null} [callCount] LatencyMetrics callCount + */ + + /** + * Constructs a new LatencyMetrics. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @classdesc Represents a LatencyMetrics. + * @implements ILatencyMetrics + * @constructor + * @param {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics=} [properties] Properties to set + */ + function LatencyMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LatencyMetrics p50Latency. + * @member {google.protobuf.IDuration|null|undefined} p50Latency + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @instance + */ + LatencyMetrics.prototype.p50Latency = null; + + /** + * LatencyMetrics p90Latency. + * @member {google.protobuf.IDuration|null|undefined} p90Latency + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @instance + */ + LatencyMetrics.prototype.p90Latency = null; + + /** + * LatencyMetrics p99Latency. + * @member {google.protobuf.IDuration|null|undefined} p99Latency + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @instance + */ + LatencyMetrics.prototype.p99Latency = null; + + /** + * LatencyMetrics callCount. + * @member {number} callCount + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @instance + */ + LatencyMetrics.prototype.callCount = 0; + + /** + * Creates a new LatencyMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.LatencyReport.LatencyMetrics} LatencyMetrics instance + */ + LatencyMetrics.create = function create(properties) { + return new LatencyMetrics(properties); + }; + + /** + * Encodes the specified LatencyMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics} message LatencyMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatencyMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.p50Latency != null && Object.hasOwnProperty.call(message, "p50Latency")) + $root.google.protobuf.Duration.encode(message.p50Latency, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.p90Latency != null && Object.hasOwnProperty.call(message, "p90Latency")) + $root.google.protobuf.Duration.encode(message.p90Latency, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.p99Latency != null && Object.hasOwnProperty.call(message, "p99Latency")) + $root.google.protobuf.Duration.encode(message.p99Latency, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.callCount != null && Object.hasOwnProperty.call(message, "callCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.callCount); + return writer; + }; + + /** + * Encodes the specified LatencyMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics} message LatencyMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatencyMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatencyMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.LatencyReport.LatencyMetrics} LatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatencyMetrics.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.p50Latency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.p90Latency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.p99Latency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.callCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LatencyMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.LatencyReport.LatencyMetrics} LatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatencyMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LatencyMetrics message. + * @function verify + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LatencyMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.p50Latency != null && message.hasOwnProperty("p50Latency")) { + var error = $root.google.protobuf.Duration.verify(message.p50Latency); + if (error) + return "p50Latency." + error; + } + if (message.p90Latency != null && message.hasOwnProperty("p90Latency")) { + var error = $root.google.protobuf.Duration.verify(message.p90Latency); + if (error) + return "p90Latency." + error; + } + if (message.p99Latency != null && message.hasOwnProperty("p99Latency")) { + var error = $root.google.protobuf.Duration.verify(message.p99Latency); + if (error) + return "p99Latency." + error; + } + if (message.callCount != null && message.hasOwnProperty("callCount")) + if (!$util.isInteger(message.callCount)) + return "callCount: integer expected"; + return null; + }; + + /** + * Creates a LatencyMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.LatencyReport.LatencyMetrics} LatencyMetrics + */ + LatencyMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics) + return object; + var message = new $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics(); + if (object.p50Latency != null) { + if (typeof object.p50Latency !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.p50Latency: object expected"); + message.p50Latency = $root.google.protobuf.Duration.fromObject(object.p50Latency); + } + if (object.p90Latency != null) { + if (typeof object.p90Latency !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.p90Latency: object expected"); + message.p90Latency = $root.google.protobuf.Duration.fromObject(object.p90Latency); + } + if (object.p99Latency != null) { + if (typeof object.p99Latency !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.p99Latency: object expected"); + message.p99Latency = $root.google.protobuf.Duration.fromObject(object.p99Latency); + } + if (object.callCount != null) + message.callCount = object.callCount | 0; + return message; + }; + + /** + * Creates a plain object from a LatencyMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.LatencyMetrics} message LatencyMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LatencyMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.p50Latency = null; + object.p90Latency = null; + object.p99Latency = null; + object.callCount = 0; + } + if (message.p50Latency != null && message.hasOwnProperty("p50Latency")) + object.p50Latency = $root.google.protobuf.Duration.toObject(message.p50Latency, options); + if (message.p90Latency != null && message.hasOwnProperty("p90Latency")) + object.p90Latency = $root.google.protobuf.Duration.toObject(message.p90Latency, options); + if (message.p99Latency != null && message.hasOwnProperty("p99Latency")) + object.p99Latency = $root.google.protobuf.Duration.toObject(message.p99Latency, options); + if (message.callCount != null && message.hasOwnProperty("callCount")) + object.callCount = message.callCount; + return object; + }; + + /** + * Converts this LatencyMetrics to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @instance + * @returns {Object.} JSON object + */ + LatencyMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LatencyMetrics + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LatencyMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.LatencyReport.LatencyMetrics"; + }; + + return LatencyMetrics; + })(); + + LatencyReport.ToolLatency = (function() { + + /** + * Properties of a ToolLatency. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @interface IToolLatency + * @property {string|null} [tool] ToolLatency tool + * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] ToolLatency toolsetTool + * @property {string|null} [toolDisplayName] ToolLatency toolDisplayName + * @property {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null} [latencyMetrics] ToolLatency latencyMetrics + */ + + /** + * Constructs a new ToolLatency. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @classdesc Represents a ToolLatency. + * @implements IToolLatency + * @constructor + * @param {google.cloud.ces.v1beta.LatencyReport.IToolLatency=} [properties] Properties to set + */ + function ToolLatency(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolLatency tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @instance + */ + ToolLatency.prototype.tool = null; + + /** + * ToolLatency toolsetTool. + * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @instance + */ + ToolLatency.prototype.toolsetTool = null; + + /** + * ToolLatency toolDisplayName. + * @member {string} toolDisplayName + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @instance + */ + ToolLatency.prototype.toolDisplayName = ""; + + /** + * ToolLatency latencyMetrics. + * @member {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null|undefined} latencyMetrics + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @instance + */ + ToolLatency.prototype.latencyMetrics = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ToolLatency toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @instance + */ + Object.defineProperty(ToolLatency.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ToolLatency instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.IToolLatency=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.LatencyReport.ToolLatency} ToolLatency instance + */ + ToolLatency.create = function create(properties) { + return new ToolLatency(properties); + }; + + /** + * Encodes the specified ToolLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.ToolLatency.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.IToolLatency} message ToolLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolLatency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolDisplayName != null && Object.hasOwnProperty.call(message, "toolDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.toolDisplayName); + if (message.latencyMetrics != null && Object.hasOwnProperty.call(message, "latencyMetrics")) + $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.encode(message.latencyMetrics, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.ToolLatency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.IToolLatency} message ToolLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolLatency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolLatency message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.LatencyReport.ToolLatency} ToolLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolLatency.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 3: { + message.toolDisplayName = reader.string(); + break; + } + case 4: { + message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolLatency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.LatencyReport.ToolLatency} ToolLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolLatency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolLatency message. + * @function verify + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolLatency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.toolDisplayName != null && message.hasOwnProperty("toolDisplayName")) + if (!$util.isString(message.toolDisplayName)) + return "toolDisplayName: string expected"; + if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) { + var error = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify(message.latencyMetrics); + if (error) + return "latencyMetrics." + error; + } + return null; + }; + + /** + * Creates a ToolLatency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.LatencyReport.ToolLatency} ToolLatency + */ + ToolLatency.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency) + return object; + var message = new $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.ToolLatency.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.toolDisplayName != null) + message.toolDisplayName = String(object.toolDisplayName); + if (object.latencyMetrics != null) { + if (typeof object.latencyMetrics !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.ToolLatency.latencyMetrics: object expected"); + message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.fromObject(object.latencyMetrics); + } + return message; + }; + + /** + * Creates a plain object from a ToolLatency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ToolLatency} message ToolLatency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolLatency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.toolDisplayName = ""; + object.latencyMetrics = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + if (message.toolDisplayName != null && message.hasOwnProperty("toolDisplayName")) + object.toolDisplayName = message.toolDisplayName; + if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) + object.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.toObject(message.latencyMetrics, options); + return object; + }; + + /** + * Converts this ToolLatency to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @instance + * @returns {Object.} JSON object + */ + ToolLatency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolLatency + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolLatency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.LatencyReport.ToolLatency"; + }; + + return ToolLatency; + })(); + + LatencyReport.CallbackLatency = (function() { + + /** + * Properties of a CallbackLatency. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @interface ICallbackLatency + * @property {string|null} [stage] CallbackLatency stage + * @property {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null} [latencyMetrics] CallbackLatency latencyMetrics + */ + + /** + * Constructs a new CallbackLatency. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @classdesc Represents a CallbackLatency. + * @implements ICallbackLatency + * @constructor + * @param {google.cloud.ces.v1beta.LatencyReport.ICallbackLatency=} [properties] Properties to set + */ + function CallbackLatency(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CallbackLatency stage. + * @member {string} stage + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @instance + */ + CallbackLatency.prototype.stage = ""; + + /** + * CallbackLatency latencyMetrics. + * @member {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null|undefined} latencyMetrics + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @instance + */ + CallbackLatency.prototype.latencyMetrics = null; + + /** + * Creates a new CallbackLatency instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ICallbackLatency=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.LatencyReport.CallbackLatency} CallbackLatency instance + */ + CallbackLatency.create = function create(properties) { + return new CallbackLatency(properties); + }; + + /** + * Encodes the specified CallbackLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.CallbackLatency.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ICallbackLatency} message CallbackLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CallbackLatency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stage != null && Object.hasOwnProperty.call(message, "stage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stage); + if (message.latencyMetrics != null && Object.hasOwnProperty.call(message, "latencyMetrics")) + $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.encode(message.latencyMetrics, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CallbackLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.CallbackLatency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ICallbackLatency} message CallbackLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CallbackLatency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CallbackLatency message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.LatencyReport.CallbackLatency} CallbackLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CallbackLatency.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stage = reader.string(); + break; + } + case 2: { + message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CallbackLatency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.LatencyReport.CallbackLatency} CallbackLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CallbackLatency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CallbackLatency message. + * @function verify + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CallbackLatency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stage != null && message.hasOwnProperty("stage")) + if (!$util.isString(message.stage)) + return "stage: string expected"; + if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) { + var error = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify(message.latencyMetrics); + if (error) + return "latencyMetrics." + error; + } + return null; + }; + + /** + * Creates a CallbackLatency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.LatencyReport.CallbackLatency} CallbackLatency + */ + CallbackLatency.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency) + return object; + var message = new $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency(); + if (object.stage != null) + message.stage = String(object.stage); + if (object.latencyMetrics != null) { + if (typeof object.latencyMetrics !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.CallbackLatency.latencyMetrics: object expected"); + message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.fromObject(object.latencyMetrics); + } + return message; + }; + + /** + * Creates a plain object from a CallbackLatency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.CallbackLatency} message CallbackLatency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CallbackLatency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.stage = ""; + object.latencyMetrics = null; + } + if (message.stage != null && message.hasOwnProperty("stage")) + object.stage = message.stage; + if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) + object.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.toObject(message.latencyMetrics, options); + return object; + }; + + /** + * Converts this CallbackLatency to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @instance + * @returns {Object.} JSON object + */ + CallbackLatency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CallbackLatency + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CallbackLatency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.LatencyReport.CallbackLatency"; + }; + + return CallbackLatency; + })(); + + LatencyReport.GuardrailLatency = (function() { + + /** + * Properties of a GuardrailLatency. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @interface IGuardrailLatency + * @property {string|null} [guardrail] GuardrailLatency guardrail + * @property {string|null} [guardrailDisplayName] GuardrailLatency guardrailDisplayName + * @property {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null} [latencyMetrics] GuardrailLatency latencyMetrics + */ + + /** + * Constructs a new GuardrailLatency. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @classdesc Represents a GuardrailLatency. + * @implements IGuardrailLatency + * @constructor + * @param {google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency=} [properties] Properties to set + */ + function GuardrailLatency(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GuardrailLatency guardrail. + * @member {string} guardrail + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @instance + */ + GuardrailLatency.prototype.guardrail = ""; + + /** + * GuardrailLatency guardrailDisplayName. + * @member {string} guardrailDisplayName + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @instance + */ + GuardrailLatency.prototype.guardrailDisplayName = ""; + + /** + * GuardrailLatency latencyMetrics. + * @member {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null|undefined} latencyMetrics + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @instance + */ + GuardrailLatency.prototype.latencyMetrics = null; + + /** + * Creates a new GuardrailLatency instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.LatencyReport.GuardrailLatency} GuardrailLatency instance + */ + GuardrailLatency.create = function create(properties) { + return new GuardrailLatency(properties); + }; + + /** + * Encodes the specified GuardrailLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency} message GuardrailLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuardrailLatency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.guardrail != null && Object.hasOwnProperty.call(message, "guardrail")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.guardrail); + if (message.guardrailDisplayName != null && Object.hasOwnProperty.call(message, "guardrailDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.guardrailDisplayName); + if (message.latencyMetrics != null && Object.hasOwnProperty.call(message, "latencyMetrics")) + $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.encode(message.latencyMetrics, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GuardrailLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency} message GuardrailLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuardrailLatency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GuardrailLatency message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.LatencyReport.GuardrailLatency} GuardrailLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuardrailLatency.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.guardrail = reader.string(); + break; + } + case 2: { + message.guardrailDisplayName = reader.string(); + break; + } + case 3: { + message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GuardrailLatency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.LatencyReport.GuardrailLatency} GuardrailLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuardrailLatency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GuardrailLatency message. + * @function verify + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GuardrailLatency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.guardrail != null && message.hasOwnProperty("guardrail")) + if (!$util.isString(message.guardrail)) + return "guardrail: string expected"; + if (message.guardrailDisplayName != null && message.hasOwnProperty("guardrailDisplayName")) + if (!$util.isString(message.guardrailDisplayName)) + return "guardrailDisplayName: string expected"; + if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) { + var error = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify(message.latencyMetrics); + if (error) + return "latencyMetrics." + error; + } + return null; + }; + + /** + * Creates a GuardrailLatency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.LatencyReport.GuardrailLatency} GuardrailLatency + */ + GuardrailLatency.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency) + return object; + var message = new $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency(); + if (object.guardrail != null) + message.guardrail = String(object.guardrail); + if (object.guardrailDisplayName != null) + message.guardrailDisplayName = String(object.guardrailDisplayName); + if (object.latencyMetrics != null) { + if (typeof object.latencyMetrics !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.latencyMetrics: object expected"); + message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.fromObject(object.latencyMetrics); + } + return message; + }; + + /** + * Creates a plain object from a GuardrailLatency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.GuardrailLatency} message GuardrailLatency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GuardrailLatency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.guardrail = ""; + object.guardrailDisplayName = ""; + object.latencyMetrics = null; + } + if (message.guardrail != null && message.hasOwnProperty("guardrail")) + object.guardrail = message.guardrail; + if (message.guardrailDisplayName != null && message.hasOwnProperty("guardrailDisplayName")) + object.guardrailDisplayName = message.guardrailDisplayName; + if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) + object.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.toObject(message.latencyMetrics, options); + return object; + }; + + /** + * Converts this GuardrailLatency to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @instance + * @returns {Object.} JSON object + */ + GuardrailLatency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GuardrailLatency + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GuardrailLatency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.LatencyReport.GuardrailLatency"; + }; + + return GuardrailLatency; + })(); + + LatencyReport.LlmCallLatency = (function() { + + /** + * Properties of a LlmCallLatency. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @interface ILlmCallLatency + * @property {string|null} [model] LlmCallLatency model + * @property {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null} [latencyMetrics] LlmCallLatency latencyMetrics + */ + + /** + * Constructs a new LlmCallLatency. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @classdesc Represents a LlmCallLatency. + * @implements ILlmCallLatency + * @constructor + * @param {google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency=} [properties] Properties to set + */ + function LlmCallLatency(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LlmCallLatency model. + * @member {string} model + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @instance + */ + LlmCallLatency.prototype.model = ""; + + /** + * LlmCallLatency latencyMetrics. + * @member {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null|undefined} latencyMetrics + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @instance + */ + LlmCallLatency.prototype.latencyMetrics = null; + + /** + * Creates a new LlmCallLatency instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.LatencyReport.LlmCallLatency} LlmCallLatency instance + */ + LlmCallLatency.create = function create(properties) { + return new LlmCallLatency(properties); + }; + + /** + * Encodes the specified LlmCallLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency} message LlmCallLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmCallLatency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.latencyMetrics != null && Object.hasOwnProperty.call(message, "latencyMetrics")) + $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.encode(message.latencyMetrics, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LlmCallLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency} message LlmCallLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmCallLatency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LlmCallLatency message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.LatencyReport.LlmCallLatency} LlmCallLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmCallLatency.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LlmCallLatency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.LatencyReport.LlmCallLatency} LlmCallLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmCallLatency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LlmCallLatency message. + * @function verify + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LlmCallLatency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) { + var error = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify(message.latencyMetrics); + if (error) + return "latencyMetrics." + error; + } + return null; + }; + + /** + * Creates a LlmCallLatency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.LatencyReport.LlmCallLatency} LlmCallLatency + */ + LlmCallLatency.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency) + return object; + var message = new $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency(); + if (object.model != null) + message.model = String(object.model); + if (object.latencyMetrics != null) { + if (typeof object.latencyMetrics !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.latencyMetrics: object expected"); + message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.fromObject(object.latencyMetrics); + } + return message; + }; + + /** + * Creates a plain object from a LlmCallLatency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.LlmCallLatency} message LlmCallLatency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LlmCallLatency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.latencyMetrics = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) + object.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.toObject(message.latencyMetrics, options); + return object; + }; + + /** + * Converts this LlmCallLatency to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @instance + * @returns {Object.} JSON object + */ + LlmCallLatency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LlmCallLatency + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LlmCallLatency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.LatencyReport.LlmCallLatency"; + }; + + return LlmCallLatency; + })(); + + return LatencyReport; + })(); + + v1beta.EvaluationExpectation = (function() { + + /** + * Properties of an EvaluationExpectation. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluationExpectation + * @property {google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria|null} [llmCriteria] EvaluationExpectation llmCriteria + * @property {string|null} [name] EvaluationExpectation name + * @property {string|null} [displayName] EvaluationExpectation displayName + * @property {Array.|null} [tags] EvaluationExpectation tags + * @property {google.protobuf.ITimestamp|null} [createTime] EvaluationExpectation createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] EvaluationExpectation updateTime + * @property {string|null} [etag] EvaluationExpectation etag + */ + + /** + * Constructs a new EvaluationExpectation. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationExpectation. + * @implements IEvaluationExpectation + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluationExpectation=} [properties] Properties to set + */ + function EvaluationExpectation(properties) { + 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]]; + } + + /** + * EvaluationExpectation llmCriteria. + * @member {google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria|null|undefined} llmCriteria + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @instance + */ + EvaluationExpectation.prototype.llmCriteria = null; + + /** + * EvaluationExpectation name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @instance + */ + EvaluationExpectation.prototype.name = ""; + + /** + * EvaluationExpectation displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @instance + */ + EvaluationExpectation.prototype.displayName = ""; + + /** + * EvaluationExpectation tags. + * @member {Array.} tags + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @instance + */ + EvaluationExpectation.prototype.tags = $util.emptyArray; + + /** + * EvaluationExpectation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @instance + */ + EvaluationExpectation.prototype.createTime = null; + + /** + * EvaluationExpectation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @instance + */ + EvaluationExpectation.prototype.updateTime = null; + + /** + * EvaluationExpectation etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @instance + */ + EvaluationExpectation.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EvaluationExpectation criteria. + * @member {"llmCriteria"|undefined} criteria + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @instance + */ + Object.defineProperty(EvaluationExpectation.prototype, "criteria", { + get: $util.oneOfGetter($oneOfFields = ["llmCriteria"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EvaluationExpectation instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @static + * @param {google.cloud.ces.v1beta.IEvaluationExpectation=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationExpectation} EvaluationExpectation instance + */ + EvaluationExpectation.create = function create(properties) { + return new EvaluationExpectation(properties); + }; + + /** + * Encodes the specified EvaluationExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @static + * @param {google.cloud.ces.v1beta.IEvaluationExpectation} message EvaluationExpectation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationExpectation.encode = function encode(message, writer) { + if (!writer) + 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.llmCriteria != null && Object.hasOwnProperty.call(message, "llmCriteria")) + $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.encode(message.llmCriteria, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + 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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.tags[i]); + return writer; + }; + + /** + * Encodes the specified EvaluationExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @static + * @param {google.cloud.ces.v1beta.IEvaluationExpectation} message EvaluationExpectation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationExpectation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationExpectation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationExpectation} EvaluationExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationExpectation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationExpectation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.llmCriteria = $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 8: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(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.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationExpectation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationExpectation} EvaluationExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationExpectation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationExpectation message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationExpectation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.llmCriteria != null && message.hasOwnProperty("llmCriteria")) { + properties.criteria = 1; + { + var error = $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.verify(message.llmCriteria); + if (error) + return "llmCriteria." + 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.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an EvaluationExpectation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationExpectation} EvaluationExpectation + */ + EvaluationExpectation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationExpectation) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationExpectation(); + if (object.llmCriteria != null) { + if (typeof object.llmCriteria !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationExpectation.llmCriteria: object expected"); + message.llmCriteria = $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.fromObject(object.llmCriteria); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationExpectation.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationExpectation.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.ces.v1beta.EvaluationExpectation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an EvaluationExpectation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @static + * @param {google.cloud.ces.v1beta.EvaluationExpectation} message EvaluationExpectation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationExpectation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tags = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.llmCriteria != null && message.hasOwnProperty("llmCriteria")) { + object.llmCriteria = $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.toObject(message.llmCriteria, options); + if (options.oneofs) + object.criteria = "llmCriteria"; + } + 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + return object; + }; + + /** + * Converts this EvaluationExpectation to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @instance + * @returns {Object.} JSON object + */ + EvaluationExpectation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationExpectation + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationExpectation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationExpectation"; + }; + + EvaluationExpectation.LlmCriteria = (function() { + + /** + * Properties of a LlmCriteria. + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @interface ILlmCriteria + * @property {string|null} [prompt] LlmCriteria prompt + */ + + /** + * Constructs a new LlmCriteria. + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @classdesc Represents a LlmCriteria. + * @implements ILlmCriteria + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria=} [properties] Properties to set + */ + function LlmCriteria(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LlmCriteria prompt. + * @member {string} prompt + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @instance + */ + LlmCriteria.prototype.prompt = ""; + + /** + * Creates a new LlmCriteria instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @static + * @param {google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria} LlmCriteria instance + */ + LlmCriteria.create = function create(properties) { + return new LlmCriteria(properties); + }; + + /** + * Encodes the specified LlmCriteria message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @static + * @param {google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria} message LlmCriteria message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmCriteria.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.prompt); + return writer; + }; + + /** + * Encodes the specified LlmCriteria message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @static + * @param {google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria} message LlmCriteria message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmCriteria.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LlmCriteria message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria} LlmCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmCriteria.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.prompt = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LlmCriteria message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria} LlmCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmCriteria.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LlmCriteria message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LlmCriteria.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.prompt != null && message.hasOwnProperty("prompt")) + if (!$util.isString(message.prompt)) + return "prompt: string expected"; + return null; + }; + + /** + * Creates a LlmCriteria message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria} LlmCriteria + */ + LlmCriteria.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria(); + if (object.prompt != null) + message.prompt = String(object.prompt); + return message; + }; + + /** + * Creates a plain object from a LlmCriteria message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @static + * @param {google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria} message LlmCriteria + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LlmCriteria.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.prompt = ""; + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = message.prompt; + return object; + }; + + /** + * Converts this LlmCriteria to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @instance + * @returns {Object.} JSON object + */ + LlmCriteria.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LlmCriteria + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LlmCriteria.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria"; + }; + + return LlmCriteria; + })(); + + return EvaluationExpectation; + })(); + + v1beta.EvaluationConfig = (function() { + + /** + * Properties of an EvaluationConfig. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluationConfig + * @property {google.cloud.ces.v1beta.IInputAudioConfig|null} [inputAudioConfig] EvaluationConfig inputAudioConfig + * @property {google.cloud.ces.v1beta.IOutputAudioConfig|null} [outputAudioConfig] EvaluationConfig outputAudioConfig + * @property {google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel|null} [evaluationChannel] EvaluationConfig evaluationChannel + * @property {google.cloud.ces.v1beta.EvaluationToolCallBehaviour|null} [toolCallBehaviour] EvaluationConfig toolCallBehaviour + */ + + /** + * Constructs a new EvaluationConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationConfig. + * @implements IEvaluationConfig + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluationConfig=} [properties] Properties to set + */ + function EvaluationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationConfig inputAudioConfig. + * @member {google.cloud.ces.v1beta.IInputAudioConfig|null|undefined} inputAudioConfig + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @instance + */ + EvaluationConfig.prototype.inputAudioConfig = null; + + /** + * EvaluationConfig outputAudioConfig. + * @member {google.cloud.ces.v1beta.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @instance + */ + EvaluationConfig.prototype.outputAudioConfig = null; + + /** + * EvaluationConfig evaluationChannel. + * @member {google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel} evaluationChannel + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @instance + */ + EvaluationConfig.prototype.evaluationChannel = 0; + + /** + * EvaluationConfig toolCallBehaviour. + * @member {google.cloud.ces.v1beta.EvaluationToolCallBehaviour} toolCallBehaviour + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @instance + */ + EvaluationConfig.prototype.toolCallBehaviour = 0; + + /** + * Creates a new EvaluationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @static + * @param {google.cloud.ces.v1beta.IEvaluationConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationConfig} EvaluationConfig instance + */ + EvaluationConfig.create = function create(properties) { + return new EvaluationConfig(properties); + }; + + /** + * Encodes the specified EvaluationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @static + * @param {google.cloud.ces.v1beta.IEvaluationConfig} message EvaluationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputAudioConfig != null && Object.hasOwnProperty.call(message, "inputAudioConfig")) + $root.google.cloud.ces.v1beta.InputAudioConfig.encode(message.inputAudioConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.ces.v1beta.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.evaluationChannel != null && Object.hasOwnProperty.call(message, "evaluationChannel")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.evaluationChannel); + if (message.toolCallBehaviour != null && Object.hasOwnProperty.call(message, "toolCallBehaviour")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.toolCallBehaviour); + return writer; + }; + + /** + * Encodes the specified EvaluationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @static + * @param {google.cloud.ces.v1beta.IEvaluationConfig} message EvaluationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationConfig} EvaluationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputAudioConfig = $root.google.cloud.ces.v1beta.InputAudioConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.outputAudioConfig = $root.google.cloud.ces.v1beta.OutputAudioConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.evaluationChannel = reader.int32(); + break; + } + case 4: { + message.toolCallBehaviour = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationConfig} EvaluationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputAudioConfig != null && message.hasOwnProperty("inputAudioConfig")) { + var error = $root.google.cloud.ces.v1beta.InputAudioConfig.verify(message.inputAudioConfig); + if (error) + return "inputAudioConfig." + error; + } + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.ces.v1beta.OutputAudioConfig.verify(message.outputAudioConfig); + if (error) + return "outputAudioConfig." + error; + } + if (message.evaluationChannel != null && message.hasOwnProperty("evaluationChannel")) + switch (message.evaluationChannel) { + default: + return "evaluationChannel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.toolCallBehaviour != null && message.hasOwnProperty("toolCallBehaviour")) + switch (message.toolCallBehaviour) { + default: + return "toolCallBehaviour: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an EvaluationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationConfig} EvaluationConfig + */ + EvaluationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationConfig(); + if (object.inputAudioConfig != null) { + if (typeof object.inputAudioConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationConfig.inputAudioConfig: object expected"); + message.inputAudioConfig = $root.google.cloud.ces.v1beta.InputAudioConfig.fromObject(object.inputAudioConfig); + } + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationConfig.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.ces.v1beta.OutputAudioConfig.fromObject(object.outputAudioConfig); + } + switch (object.evaluationChannel) { + default: + if (typeof object.evaluationChannel === "number") { + message.evaluationChannel = object.evaluationChannel; + break; + } + break; + case "EVALUATION_CHANNEL_UNSPECIFIED": + case 0: + message.evaluationChannel = 0; + break; + case "TEXT": + case 1: + message.evaluationChannel = 1; + break; + case "AUDIO": + case 2: + message.evaluationChannel = 2; + break; + } + switch (object.toolCallBehaviour) { + default: + if (typeof object.toolCallBehaviour === "number") { + message.toolCallBehaviour = object.toolCallBehaviour; + break; + } + break; + case "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED": + case 0: + message.toolCallBehaviour = 0; + break; + case "REAL": + case 1: + message.toolCallBehaviour = 1; + break; + case "FAKE": + case 2: + message.toolCallBehaviour = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an EvaluationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @static + * @param {google.cloud.ces.v1beta.EvaluationConfig} message EvaluationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputAudioConfig = null; + object.outputAudioConfig = null; + object.evaluationChannel = options.enums === String ? "EVALUATION_CHANNEL_UNSPECIFIED" : 0; + object.toolCallBehaviour = options.enums === String ? "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED" : 0; + } + if (message.inputAudioConfig != null && message.hasOwnProperty("inputAudioConfig")) + object.inputAudioConfig = $root.google.cloud.ces.v1beta.InputAudioConfig.toObject(message.inputAudioConfig, options); + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.ces.v1beta.OutputAudioConfig.toObject(message.outputAudioConfig, options); + if (message.evaluationChannel != null && message.hasOwnProperty("evaluationChannel")) + object.evaluationChannel = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel[message.evaluationChannel] === undefined ? message.evaluationChannel : $root.google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel[message.evaluationChannel] : message.evaluationChannel; + if (message.toolCallBehaviour != null && message.hasOwnProperty("toolCallBehaviour")) + object.toolCallBehaviour = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationToolCallBehaviour[message.toolCallBehaviour] === undefined ? message.toolCallBehaviour : $root.google.cloud.ces.v1beta.EvaluationToolCallBehaviour[message.toolCallBehaviour] : message.toolCallBehaviour; + return object; + }; + + /** + * Converts this EvaluationConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @instance + * @returns {Object.} JSON object + */ + EvaluationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationConfig"; + }; + + /** + * EvaluationChannel enum. + * @name google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel + * @enum {number} + * @property {number} EVALUATION_CHANNEL_UNSPECIFIED=0 EVALUATION_CHANNEL_UNSPECIFIED value + * @property {number} TEXT=1 TEXT value + * @property {number} AUDIO=2 AUDIO value + */ + EvaluationConfig.EvaluationChannel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVALUATION_CHANNEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "AUDIO"] = 2; + return values; + })(); + + return EvaluationConfig; + })(); + + v1beta.EvaluationErrorInfo = (function() { + + /** + * Properties of an EvaluationErrorInfo. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluationErrorInfo + * @property {google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType|null} [errorType] EvaluationErrorInfo errorType + * @property {string|null} [errorMessage] EvaluationErrorInfo errorMessage + * @property {string|null} [sessionId] EvaluationErrorInfo sessionId + */ + + /** + * Constructs a new EvaluationErrorInfo. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationErrorInfo. + * @implements IEvaluationErrorInfo + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluationErrorInfo=} [properties] Properties to set + */ + function EvaluationErrorInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationErrorInfo errorType. + * @member {google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType} errorType + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @instance + */ + EvaluationErrorInfo.prototype.errorType = 0; + + /** + * EvaluationErrorInfo errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @instance + */ + EvaluationErrorInfo.prototype.errorMessage = ""; + + /** + * EvaluationErrorInfo sessionId. + * @member {string} sessionId + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @instance + */ + EvaluationErrorInfo.prototype.sessionId = ""; + + /** + * Creates a new EvaluationErrorInfo instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @static + * @param {google.cloud.ces.v1beta.IEvaluationErrorInfo=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationErrorInfo} EvaluationErrorInfo instance + */ + EvaluationErrorInfo.create = function create(properties) { + return new EvaluationErrorInfo(properties); + }; + + /** + * Encodes the specified EvaluationErrorInfo message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationErrorInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @static + * @param {google.cloud.ces.v1beta.IEvaluationErrorInfo} message EvaluationErrorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationErrorInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorType != null && Object.hasOwnProperty.call(message, "errorType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.errorType); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessage); + if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sessionId); + return writer; + }; + + /** + * Encodes the specified EvaluationErrorInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationErrorInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @static + * @param {google.cloud.ces.v1beta.IEvaluationErrorInfo} message EvaluationErrorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationErrorInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationErrorInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationErrorInfo} EvaluationErrorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationErrorInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationErrorInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.errorType = reader.int32(); + break; + } + case 2: { + message.errorMessage = reader.string(); + break; + } + case 3: { + message.sessionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationErrorInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationErrorInfo} EvaluationErrorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationErrorInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationErrorInfo message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationErrorInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorType != null && message.hasOwnProperty("errorType")) + switch (message.errorType) { + default: + return "errorType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + if (!$util.isString(message.sessionId)) + return "sessionId: string expected"; + return null; + }; + + /** + * Creates an EvaluationErrorInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationErrorInfo} EvaluationErrorInfo + */ + EvaluationErrorInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationErrorInfo) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationErrorInfo(); + switch (object.errorType) { + default: + if (typeof object.errorType === "number") { + message.errorType = object.errorType; + break; + } + break; + case "ERROR_TYPE_UNSPECIFIED": + case 0: + message.errorType = 0; + break; + case "RUNTIME_FAILURE": + case 1: + message.errorType = 1; + break; + case "CONVERSATION_RETRIEVAL_FAILURE": + case 2: + message.errorType = 2; + break; + case "METRIC_CALCULATION_FAILURE": + case 3: + message.errorType = 3; + break; + case "EVALUATION_UPDATE_FAILURE": + case 4: + message.errorType = 4; + break; + case "QUOTA_EXHAUSTED": + case 5: + message.errorType = 5; + break; + case "USER_SIMULATION_FAILURE": + case 6: + message.errorType = 6; + break; + } + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + if (object.sessionId != null) + message.sessionId = String(object.sessionId); + return message; + }; + + /** + * Creates a plain object from an EvaluationErrorInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @static + * @param {google.cloud.ces.v1beta.EvaluationErrorInfo} message EvaluationErrorInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationErrorInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.errorType = options.enums === String ? "ERROR_TYPE_UNSPECIFIED" : 0; + object.errorMessage = ""; + object.sessionId = ""; + } + if (message.errorType != null && message.hasOwnProperty("errorType")) + object.errorType = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType[message.errorType] === undefined ? message.errorType : $root.google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType[message.errorType] : message.errorType; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + object.sessionId = message.sessionId; + return object; + }; + + /** + * Converts this EvaluationErrorInfo to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @instance + * @returns {Object.} JSON object + */ + EvaluationErrorInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationErrorInfo + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationErrorInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationErrorInfo"; + }; + + /** + * ErrorType enum. + * @name google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType + * @enum {number} + * @property {number} ERROR_TYPE_UNSPECIFIED=0 ERROR_TYPE_UNSPECIFIED value + * @property {number} RUNTIME_FAILURE=1 RUNTIME_FAILURE value + * @property {number} CONVERSATION_RETRIEVAL_FAILURE=2 CONVERSATION_RETRIEVAL_FAILURE value + * @property {number} METRIC_CALCULATION_FAILURE=3 METRIC_CALCULATION_FAILURE value + * @property {number} EVALUATION_UPDATE_FAILURE=4 EVALUATION_UPDATE_FAILURE value + * @property {number} QUOTA_EXHAUSTED=5 QUOTA_EXHAUSTED value + * @property {number} USER_SIMULATION_FAILURE=6 USER_SIMULATION_FAILURE value + */ + EvaluationErrorInfo.ErrorType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ERROR_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNTIME_FAILURE"] = 1; + values[valuesById[2] = "CONVERSATION_RETRIEVAL_FAILURE"] = 2; + values[valuesById[3] = "METRIC_CALCULATION_FAILURE"] = 3; + values[valuesById[4] = "EVALUATION_UPDATE_FAILURE"] = 4; + values[valuesById[5] = "QUOTA_EXHAUSTED"] = 5; + values[valuesById[6] = "USER_SIMULATION_FAILURE"] = 6; + return values; + })(); + + return EvaluationErrorInfo; + })(); + + v1beta.RunEvaluationRequest = (function() { + + /** + * Properties of a RunEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IRunEvaluationRequest + * @property {string|null} [app] RunEvaluationRequest app + * @property {Array.|null} [evaluations] RunEvaluationRequest evaluations + * @property {string|null} [evaluationDataset] RunEvaluationRequest evaluationDataset + * @property {string|null} [displayName] RunEvaluationRequest displayName + * @property {string|null} [appVersion] RunEvaluationRequest appVersion + * @property {google.cloud.ces.v1beta.IEvaluationConfig|null} [config] RunEvaluationRequest config + * @property {number|null} [runCount] RunEvaluationRequest runCount + * @property {Array.|null} [personaRunConfigs] RunEvaluationRequest personaRunConfigs + * @property {google.cloud.ces.v1beta.IOptimizationConfig|null} [optimizationConfig] RunEvaluationRequest optimizationConfig + * @property {string|null} [scheduledEvaluationRun] RunEvaluationRequest scheduledEvaluationRun + * @property {google.cloud.ces.v1beta.GoldenRunMethod|null} [goldenRunMethod] RunEvaluationRequest goldenRunMethod + * @property {boolean|null} [generateLatencyReport] RunEvaluationRequest generateLatencyReport + */ + + /** + * Constructs a new RunEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RunEvaluationRequest. + * @implements IRunEvaluationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IRunEvaluationRequest=} [properties] Properties to set + */ + function RunEvaluationRequest(properties) { + this.evaluations = []; + this.personaRunConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunEvaluationRequest app. + * @member {string} app + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.app = ""; + + /** + * RunEvaluationRequest evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.evaluations = $util.emptyArray; + + /** + * RunEvaluationRequest evaluationDataset. + * @member {string} evaluationDataset + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.evaluationDataset = ""; + + /** + * RunEvaluationRequest displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.displayName = ""; + + /** + * RunEvaluationRequest appVersion. + * @member {string} appVersion + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.appVersion = ""; + + /** + * RunEvaluationRequest config. + * @member {google.cloud.ces.v1beta.IEvaluationConfig|null|undefined} config + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.config = null; + + /** + * RunEvaluationRequest runCount. + * @member {number|null|undefined} runCount + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.runCount = null; + + /** + * RunEvaluationRequest personaRunConfigs. + * @member {Array.} personaRunConfigs + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.personaRunConfigs = $util.emptyArray; + + /** + * RunEvaluationRequest optimizationConfig. + * @member {google.cloud.ces.v1beta.IOptimizationConfig|null|undefined} optimizationConfig + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.optimizationConfig = null; + + /** + * RunEvaluationRequest scheduledEvaluationRun. + * @member {string} scheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.scheduledEvaluationRun = ""; + + /** + * RunEvaluationRequest goldenRunMethod. + * @member {google.cloud.ces.v1beta.GoldenRunMethod} goldenRunMethod + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.goldenRunMethod = 0; + + /** + * RunEvaluationRequest generateLatencyReport. + * @member {boolean} generateLatencyReport + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.generateLatencyReport = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RunEvaluationRequest.prototype, "_runCount", { + get: $util.oneOfGetter($oneOfFields = ["runCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RunEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IRunEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RunEvaluationRequest} RunEvaluationRequest instance + */ + RunEvaluationRequest.create = function create(properties) { + return new RunEvaluationRequest(properties); + }; + + /** + * Encodes the specified RunEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IRunEvaluationRequest} message RunEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunEvaluationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.app); + if (message.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluations[i]); + if (message.evaluationDataset != null && Object.hasOwnProperty.call(message, "evaluationDataset")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.evaluationDataset); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.appVersion); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.ces.v1beta.EvaluationConfig.encode(message.config, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.runCount != null && Object.hasOwnProperty.call(message, "runCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.runCount); + if (message.personaRunConfigs != null && message.personaRunConfigs.length) + for (var i = 0; i < message.personaRunConfigs.length; ++i) + $root.google.cloud.ces.v1beta.PersonaRunConfig.encode(message.personaRunConfigs[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.optimizationConfig != null && Object.hasOwnProperty.call(message, "optimizationConfig")) + $root.google.cloud.ces.v1beta.OptimizationConfig.encode(message.optimizationConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.scheduledEvaluationRun != null && Object.hasOwnProperty.call(message, "scheduledEvaluationRun")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.scheduledEvaluationRun); + if (message.goldenRunMethod != null && Object.hasOwnProperty.call(message, "goldenRunMethod")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.goldenRunMethod); + if (message.generateLatencyReport != null && Object.hasOwnProperty.call(message, "generateLatencyReport")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.generateLatencyReport); + return writer; + }; + + /** + * Encodes the specified RunEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IRunEvaluationRequest} message RunEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RunEvaluationRequest} RunEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunEvaluationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RunEvaluationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.app = reader.string(); + break; + } + case 2: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push(reader.string()); + break; + } + case 3: { + message.evaluationDataset = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 6: { + message.appVersion = reader.string(); + break; + } + case 8: { + message.config = $root.google.cloud.ces.v1beta.EvaluationConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.runCount = reader.int32(); + break; + } + case 10: { + if (!(message.personaRunConfigs && message.personaRunConfigs.length)) + message.personaRunConfigs = []; + message.personaRunConfigs.push($root.google.cloud.ces.v1beta.PersonaRunConfig.decode(reader, reader.uint32())); + break; + } + case 11: { + message.optimizationConfig = $root.google.cloud.ces.v1beta.OptimizationConfig.decode(reader, reader.uint32()); + break; + } + case 12: { + message.scheduledEvaluationRun = reader.string(); + break; + } + case 13: { + message.goldenRunMethod = reader.int32(); + break; + } + case 14: { + message.generateLatencyReport = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RunEvaluationRequest} RunEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunEvaluationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunEvaluationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.app != null && message.hasOwnProperty("app")) + if (!$util.isString(message.app)) + return "app: string expected"; + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) + if (!$util.isString(message.evaluations[i])) + return "evaluations: string[] expected"; + } + if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) + if (!$util.isString(message.evaluationDataset)) + return "evaluationDataset: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (!$util.isString(message.appVersion)) + return "appVersion: string expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.ces.v1beta.EvaluationConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.runCount != null && message.hasOwnProperty("runCount")) { + properties._runCount = 1; + if (!$util.isInteger(message.runCount)) + return "runCount: integer expected"; + } + if (message.personaRunConfigs != null && message.hasOwnProperty("personaRunConfigs")) { + if (!Array.isArray(message.personaRunConfigs)) + return "personaRunConfigs: array expected"; + for (var i = 0; i < message.personaRunConfigs.length; ++i) { + var error = $root.google.cloud.ces.v1beta.PersonaRunConfig.verify(message.personaRunConfigs[i]); + if (error) + return "personaRunConfigs." + error; + } + } + if (message.optimizationConfig != null && message.hasOwnProperty("optimizationConfig")) { + var error = $root.google.cloud.ces.v1beta.OptimizationConfig.verify(message.optimizationConfig); + if (error) + return "optimizationConfig." + error; + } + if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) + if (!$util.isString(message.scheduledEvaluationRun)) + return "scheduledEvaluationRun: string expected"; + if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) + switch (message.goldenRunMethod) { + default: + return "goldenRunMethod: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.generateLatencyReport != null && message.hasOwnProperty("generateLatencyReport")) + if (typeof message.generateLatencyReport !== "boolean") + return "generateLatencyReport: boolean expected"; + return null; + }; + + /** + * Creates a RunEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RunEvaluationRequest} RunEvaluationRequest + */ + RunEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RunEvaluationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.RunEvaluationRequest(); + if (object.app != null) + message.app = String(object.app); + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.ces.v1beta.RunEvaluationRequest.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) + message.evaluations[i] = String(object.evaluations[i]); + } + if (object.evaluationDataset != null) + message.evaluationDataset = String(object.evaluationDataset); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.appVersion != null) + message.appVersion = String(object.appVersion); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.ces.v1beta.RunEvaluationRequest.config: object expected"); + message.config = $root.google.cloud.ces.v1beta.EvaluationConfig.fromObject(object.config); + } + if (object.runCount != null) + message.runCount = object.runCount | 0; + if (object.personaRunConfigs) { + if (!Array.isArray(object.personaRunConfigs)) + throw TypeError(".google.cloud.ces.v1beta.RunEvaluationRequest.personaRunConfigs: array expected"); + message.personaRunConfigs = []; + for (var i = 0; i < object.personaRunConfigs.length; ++i) { + if (typeof object.personaRunConfigs[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.RunEvaluationRequest.personaRunConfigs: object expected"); + message.personaRunConfigs[i] = $root.google.cloud.ces.v1beta.PersonaRunConfig.fromObject(object.personaRunConfigs[i]); + } + } + if (object.optimizationConfig != null) { + if (typeof object.optimizationConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.RunEvaluationRequest.optimizationConfig: object expected"); + message.optimizationConfig = $root.google.cloud.ces.v1beta.OptimizationConfig.fromObject(object.optimizationConfig); + } + if (object.scheduledEvaluationRun != null) + message.scheduledEvaluationRun = String(object.scheduledEvaluationRun); + switch (object.goldenRunMethod) { + default: + if (typeof object.goldenRunMethod === "number") { + message.goldenRunMethod = object.goldenRunMethod; + break; + } + break; + case "GOLDEN_RUN_METHOD_UNSPECIFIED": + case 0: + message.goldenRunMethod = 0; + break; + case "STABLE": + case 1: + message.goldenRunMethod = 1; + break; + case "NAIVE": + case 2: + message.goldenRunMethod = 2; + break; + } + if (object.generateLatencyReport != null) + message.generateLatencyReport = Boolean(object.generateLatencyReport); + return message; + }; + + /** + * Creates a plain object from a RunEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.RunEvaluationRequest} message RunEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunEvaluationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.evaluations = []; + object.personaRunConfigs = []; + } + if (options.defaults) { + object.app = ""; + object.evaluationDataset = ""; + object.displayName = ""; + object.appVersion = ""; + object.config = null; + object.optimizationConfig = null; + object.scheduledEvaluationRun = ""; + object.goldenRunMethod = options.enums === String ? "GOLDEN_RUN_METHOD_UNSPECIFIED" : 0; + object.generateLatencyReport = false; + } + if (message.app != null && message.hasOwnProperty("app")) + object.app = message.app; + if (message.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = message.evaluations[j]; + } + if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) + object.evaluationDataset = message.evaluationDataset; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + object.appVersion = message.appVersion; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.ces.v1beta.EvaluationConfig.toObject(message.config, options); + if (message.runCount != null && message.hasOwnProperty("runCount")) { + object.runCount = message.runCount; + if (options.oneofs) + object._runCount = "runCount"; + } + if (message.personaRunConfigs && message.personaRunConfigs.length) { + object.personaRunConfigs = []; + for (var j = 0; j < message.personaRunConfigs.length; ++j) + object.personaRunConfigs[j] = $root.google.cloud.ces.v1beta.PersonaRunConfig.toObject(message.personaRunConfigs[j], options); + } + if (message.optimizationConfig != null && message.hasOwnProperty("optimizationConfig")) + object.optimizationConfig = $root.google.cloud.ces.v1beta.OptimizationConfig.toObject(message.optimizationConfig, options); + if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) + object.scheduledEvaluationRun = message.scheduledEvaluationRun; + if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) + object.goldenRunMethod = options.enums === String ? $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] === undefined ? message.goldenRunMethod : $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] : message.goldenRunMethod; + if (message.generateLatencyReport != null && message.hasOwnProperty("generateLatencyReport")) + object.generateLatencyReport = message.generateLatencyReport; + return object; + }; + + /** + * Converts this RunEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + RunEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RunEvaluationRequest"; + }; + + return RunEvaluationRequest; + })(); + + v1beta.ScheduledEvaluationRun = (function() { + + /** + * Properties of a ScheduledEvaluationRun. + * @memberof google.cloud.ces.v1beta + * @interface IScheduledEvaluationRun + * @property {string|null} [name] ScheduledEvaluationRun name + * @property {string|null} [displayName] ScheduledEvaluationRun displayName + * @property {google.cloud.ces.v1beta.IRunEvaluationRequest|null} [request] ScheduledEvaluationRun request + * @property {string|null} [description] ScheduledEvaluationRun description + * @property {google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig|null} [schedulingConfig] ScheduledEvaluationRun schedulingConfig + * @property {boolean|null} [active] ScheduledEvaluationRun active + * @property {string|null} [lastCompletedRun] ScheduledEvaluationRun lastCompletedRun + * @property {number|null} [totalExecutions] ScheduledEvaluationRun totalExecutions + * @property {google.protobuf.ITimestamp|null} [nextScheduledExecutionTime] ScheduledEvaluationRun nextScheduledExecutionTime + * @property {google.protobuf.ITimestamp|null} [createTime] ScheduledEvaluationRun createTime + * @property {string|null} [createdBy] ScheduledEvaluationRun createdBy + * @property {google.protobuf.ITimestamp|null} [updateTime] ScheduledEvaluationRun updateTime + * @property {string|null} [lastUpdatedBy] ScheduledEvaluationRun lastUpdatedBy + * @property {string|null} [etag] ScheduledEvaluationRun etag + */ + + /** + * Constructs a new ScheduledEvaluationRun. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ScheduledEvaluationRun. + * @implements IScheduledEvaluationRun + * @constructor + * @param {google.cloud.ces.v1beta.IScheduledEvaluationRun=} [properties] Properties to set + */ + function ScheduledEvaluationRun(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScheduledEvaluationRun name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.name = ""; + + /** + * ScheduledEvaluationRun displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.displayName = ""; + + /** + * ScheduledEvaluationRun request. + * @member {google.cloud.ces.v1beta.IRunEvaluationRequest|null|undefined} request + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.request = null; + + /** + * ScheduledEvaluationRun description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.description = ""; + + /** + * ScheduledEvaluationRun schedulingConfig. + * @member {google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig|null|undefined} schedulingConfig + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.schedulingConfig = null; + + /** + * ScheduledEvaluationRun active. + * @member {boolean} active + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.active = false; + + /** + * ScheduledEvaluationRun lastCompletedRun. + * @member {string} lastCompletedRun + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.lastCompletedRun = ""; + + /** + * ScheduledEvaluationRun totalExecutions. + * @member {number} totalExecutions + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.totalExecutions = 0; + + /** + * ScheduledEvaluationRun nextScheduledExecutionTime. + * @member {google.protobuf.ITimestamp|null|undefined} nextScheduledExecutionTime + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.nextScheduledExecutionTime = null; + + /** + * ScheduledEvaluationRun createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.createTime = null; + + /** + * ScheduledEvaluationRun createdBy. + * @member {string} createdBy + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.createdBy = ""; + + /** + * ScheduledEvaluationRun updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.updateTime = null; + + /** + * ScheduledEvaluationRun lastUpdatedBy. + * @member {string} lastUpdatedBy + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.lastUpdatedBy = ""; + + /** + * ScheduledEvaluationRun etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.etag = ""; + + /** + * Creates a new ScheduledEvaluationRun instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @static + * @param {google.cloud.ces.v1beta.IScheduledEvaluationRun=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun} ScheduledEvaluationRun instance + */ + ScheduledEvaluationRun.create = function create(properties) { + return new ScheduledEvaluationRun(properties); + }; + + /** + * Encodes the specified ScheduledEvaluationRun message. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @static + * @param {google.cloud.ces.v1beta.IScheduledEvaluationRun} message ScheduledEvaluationRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduledEvaluationRun.encode = function encode(message, writer) { + if (!writer) + 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.request != null && Object.hasOwnProperty.call(message, "request")) + $root.google.cloud.ces.v1beta.RunEvaluationRequest.encode(message.request, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.schedulingConfig != null && Object.hasOwnProperty.call(message, "schedulingConfig")) + $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.encode(message.schedulingConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.active != null && Object.hasOwnProperty.call(message, "active")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.active); + if (message.lastCompletedRun != null && Object.hasOwnProperty.call(message, "lastCompletedRun")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.lastCompletedRun); + if (message.totalExecutions != null && Object.hasOwnProperty.call(message, "totalExecutions")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.totalExecutions); + if (message.nextScheduledExecutionTime != null && Object.hasOwnProperty.call(message, "nextScheduledExecutionTime")) + $root.google.protobuf.Timestamp.encode(message.nextScheduledExecutionTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.createdBy != null && Object.hasOwnProperty.call(message, "createdBy")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.createdBy); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.lastUpdatedBy != null && Object.hasOwnProperty.call(message, "lastUpdatedBy")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.lastUpdatedBy); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); + return writer; + }; + + /** + * Encodes the specified ScheduledEvaluationRun message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @static + * @param {google.cloud.ces.v1beta.IScheduledEvaluationRun} message ScheduledEvaluationRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduledEvaluationRun.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScheduledEvaluationRun message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun} ScheduledEvaluationRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduledEvaluationRun.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ScheduledEvaluationRun(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.request = $root.google.cloud.ces.v1beta.RunEvaluationRequest.decode(reader, reader.uint32()); + break; + } + case 4: { + message.description = reader.string(); + break; + } + case 5: { + message.schedulingConfig = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.active = reader.bool(); + break; + } + case 7: { + message.lastCompletedRun = reader.string(); + break; + } + case 8: { + message.totalExecutions = reader.int32(); + break; + } + case 9: { + message.nextScheduledExecutionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.createdBy = reader.string(); + break; + } + case 12: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.lastUpdatedBy = reader.string(); + break; + } + case 14: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScheduledEvaluationRun message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun} ScheduledEvaluationRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduledEvaluationRun.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScheduledEvaluationRun message. + * @function verify + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScheduledEvaluationRun.verify = function verify(message) { + if (typeof message !== "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.request != null && message.hasOwnProperty("request")) { + var error = $root.google.cloud.ces.v1beta.RunEvaluationRequest.verify(message.request); + if (error) + return "request." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.schedulingConfig != null && message.hasOwnProperty("schedulingConfig")) { + var error = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.verify(message.schedulingConfig); + if (error) + return "schedulingConfig." + error; + } + if (message.active != null && message.hasOwnProperty("active")) + if (typeof message.active !== "boolean") + return "active: boolean expected"; + if (message.lastCompletedRun != null && message.hasOwnProperty("lastCompletedRun")) + if (!$util.isString(message.lastCompletedRun)) + return "lastCompletedRun: string expected"; + if (message.totalExecutions != null && message.hasOwnProperty("totalExecutions")) + if (!$util.isInteger(message.totalExecutions)) + return "totalExecutions: integer expected"; + if (message.nextScheduledExecutionTime != null && message.hasOwnProperty("nextScheduledExecutionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.nextScheduledExecutionTime); + if (error) + return "nextScheduledExecutionTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.createdBy != null && message.hasOwnProperty("createdBy")) + if (!$util.isString(message.createdBy)) + return "createdBy: string expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.lastUpdatedBy != null && message.hasOwnProperty("lastUpdatedBy")) + if (!$util.isString(message.lastUpdatedBy)) + return "lastUpdatedBy: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a ScheduledEvaluationRun message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun} ScheduledEvaluationRun + */ + ScheduledEvaluationRun.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ScheduledEvaluationRun) + return object; + var message = new $root.google.cloud.ces.v1beta.ScheduledEvaluationRun(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.request: object expected"); + message.request = $root.google.cloud.ces.v1beta.RunEvaluationRequest.fromObject(object.request); + } + if (object.description != null) + message.description = String(object.description); + if (object.schedulingConfig != null) { + if (typeof object.schedulingConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.schedulingConfig: object expected"); + message.schedulingConfig = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.fromObject(object.schedulingConfig); + } + if (object.active != null) + message.active = Boolean(object.active); + if (object.lastCompletedRun != null) + message.lastCompletedRun = String(object.lastCompletedRun); + if (object.totalExecutions != null) + message.totalExecutions = object.totalExecutions | 0; + if (object.nextScheduledExecutionTime != null) { + if (typeof object.nextScheduledExecutionTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.nextScheduledExecutionTime: object expected"); + message.nextScheduledExecutionTime = $root.google.protobuf.Timestamp.fromObject(object.nextScheduledExecutionTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.createdBy != null) + message.createdBy = String(object.createdBy); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.lastUpdatedBy != null) + message.lastUpdatedBy = String(object.lastUpdatedBy); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a ScheduledEvaluationRun message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @static + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun} message ScheduledEvaluationRun + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScheduledEvaluationRun.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.request = null; + object.description = ""; + object.schedulingConfig = null; + object.active = false; + object.lastCompletedRun = ""; + object.totalExecutions = 0; + object.nextScheduledExecutionTime = null; + object.createTime = null; + object.createdBy = ""; + object.updateTime = null; + object.lastUpdatedBy = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.google.cloud.ces.v1beta.RunEvaluationRequest.toObject(message.request, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.schedulingConfig != null && message.hasOwnProperty("schedulingConfig")) + object.schedulingConfig = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.toObject(message.schedulingConfig, options); + if (message.active != null && message.hasOwnProperty("active")) + object.active = message.active; + if (message.lastCompletedRun != null && message.hasOwnProperty("lastCompletedRun")) + object.lastCompletedRun = message.lastCompletedRun; + if (message.totalExecutions != null && message.hasOwnProperty("totalExecutions")) + object.totalExecutions = message.totalExecutions; + if (message.nextScheduledExecutionTime != null && message.hasOwnProperty("nextScheduledExecutionTime")) + object.nextScheduledExecutionTime = $root.google.protobuf.Timestamp.toObject(message.nextScheduledExecutionTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.createdBy != null && message.hasOwnProperty("createdBy")) + object.createdBy = message.createdBy; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.lastUpdatedBy != null && message.hasOwnProperty("lastUpdatedBy")) + object.lastUpdatedBy = message.lastUpdatedBy; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this ScheduledEvaluationRun to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + * @returns {Object.} JSON object + */ + ScheduledEvaluationRun.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScheduledEvaluationRun + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduledEvaluationRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ScheduledEvaluationRun"; + }; + + ScheduledEvaluationRun.SchedulingConfig = (function() { + + /** + * Properties of a SchedulingConfig. + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @interface ISchedulingConfig + * @property {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency|null} [frequency] SchedulingConfig frequency + * @property {google.protobuf.ITimestamp|null} [startTime] SchedulingConfig startTime + * @property {Array.|null} [daysOfWeek] SchedulingConfig daysOfWeek + */ + + /** + * Constructs a new SchedulingConfig. + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @classdesc Represents a SchedulingConfig. + * @implements ISchedulingConfig + * @constructor + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig=} [properties] Properties to set + */ + function SchedulingConfig(properties) { + 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]]; + } + + /** + * SchedulingConfig frequency. + * @member {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency} frequency + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @instance + */ + SchedulingConfig.prototype.frequency = 0; + + /** + * SchedulingConfig startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @instance + */ + SchedulingConfig.prototype.startTime = null; + + /** + * SchedulingConfig daysOfWeek. + * @member {Array.} daysOfWeek + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @instance + */ + SchedulingConfig.prototype.daysOfWeek = $util.emptyArray; + + /** + * Creates a new SchedulingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @static + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig} SchedulingConfig instance + */ + SchedulingConfig.create = function create(properties) { + return new SchedulingConfig(properties); + }; + + /** + * Encodes the specified SchedulingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @static + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig} message SchedulingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frequency != null && Object.hasOwnProperty.call(message, "frequency")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.frequency); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.daysOfWeek != null && message.daysOfWeek.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.daysOfWeek.length; ++i) + writer.int32(message.daysOfWeek[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SchedulingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @static + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig} message SchedulingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchedulingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig} SchedulingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.frequency = reader.int32(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + 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 SchedulingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig} SchedulingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchedulingConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchedulingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frequency != null && message.hasOwnProperty("frequency")) + switch (message.frequency) { + default: + return "frequency: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + 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) + if (!$util.isInteger(message.daysOfWeek[i])) + return "daysOfWeek: integer[] expected"; + } + return null; + }; + + /** + * Creates a SchedulingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig} SchedulingConfig + */ + SchedulingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig(); + switch (object.frequency) { + default: + if (typeof object.frequency === "number") { + message.frequency = object.frequency; + break; + } + break; + case "FREQUENCY_UNSPECIFIED": + case 0: + message.frequency = 0; + break; + case "NONE": + case 1: + message.frequency = 1; + break; + case "DAILY": + case 2: + message.frequency = 2; + break; + case "WEEKLY": + case 3: + message.frequency = 3; + break; + case "BIWEEKLY": + case 4: + message.frequency = 4; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.daysOfWeek) { + if (!Array.isArray(object.daysOfWeek)) + throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.daysOfWeek: array expected"); + message.daysOfWeek = []; + for (var i = 0; i < object.daysOfWeek.length; ++i) + message.daysOfWeek[i] = object.daysOfWeek[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from a SchedulingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @static + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig} message SchedulingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchedulingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.daysOfWeek = []; + if (options.defaults) { + object.frequency = options.enums === String ? "FREQUENCY_UNSPECIFIED" : 0; + object.startTime = null; + } + if (message.frequency != null && message.hasOwnProperty("frequency")) + object.frequency = options.enums === String ? $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency[message.frequency] === undefined ? message.frequency : $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency[message.frequency] : message.frequency; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.daysOfWeek && message.daysOfWeek.length) { + object.daysOfWeek = []; + for (var j = 0; j < message.daysOfWeek.length; ++j) + object.daysOfWeek[j] = message.daysOfWeek[j]; + } + return object; + }; + + /** + * Converts this SchedulingConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @instance + * @returns {Object.} JSON object + */ + SchedulingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchedulingConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchedulingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig"; + }; + + /** + * Frequency enum. + * @name google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency + * @enum {number} + * @property {number} FREQUENCY_UNSPECIFIED=0 FREQUENCY_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} DAILY=2 DAILY value + * @property {number} WEEKLY=3 WEEKLY value + * @property {number} BIWEEKLY=4 BIWEEKLY value + */ + SchedulingConfig.Frequency = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FREQUENCY_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "DAILY"] = 2; + values[valuesById[3] = "WEEKLY"] = 3; + values[valuesById[4] = "BIWEEKLY"] = 4; + return values; + })(); + + return SchedulingConfig; + })(); + + return ScheduledEvaluationRun; + })(); + + v1beta.PersonaRunConfig = (function() { + + /** + * Properties of a PersonaRunConfig. + * @memberof google.cloud.ces.v1beta + * @interface IPersonaRunConfig + * @property {string|null} [persona] PersonaRunConfig persona + * @property {number|null} [taskCount] PersonaRunConfig taskCount + */ + + /** + * Constructs a new PersonaRunConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a PersonaRunConfig. + * @implements IPersonaRunConfig + * @constructor + * @param {google.cloud.ces.v1beta.IPersonaRunConfig=} [properties] Properties to set + */ + function PersonaRunConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonaRunConfig persona. + * @member {string} persona + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @instance + */ + PersonaRunConfig.prototype.persona = ""; + + /** + * PersonaRunConfig taskCount. + * @member {number} taskCount + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @instance + */ + PersonaRunConfig.prototype.taskCount = 0; + + /** + * Creates a new PersonaRunConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @static + * @param {google.cloud.ces.v1beta.IPersonaRunConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.PersonaRunConfig} PersonaRunConfig instance + */ + PersonaRunConfig.create = function create(properties) { + return new PersonaRunConfig(properties); + }; + + /** + * Encodes the specified PersonaRunConfig message. Does not implicitly {@link google.cloud.ces.v1beta.PersonaRunConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @static + * @param {google.cloud.ces.v1beta.IPersonaRunConfig} message PersonaRunConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonaRunConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.persona != null && Object.hasOwnProperty.call(message, "persona")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.persona); + if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.taskCount); + return writer; + }; + + /** + * Encodes the specified PersonaRunConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.PersonaRunConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @static + * @param {google.cloud.ces.v1beta.IPersonaRunConfig} message PersonaRunConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonaRunConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonaRunConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.PersonaRunConfig} PersonaRunConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonaRunConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.PersonaRunConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.persona = reader.string(); + break; + } + case 2: { + message.taskCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PersonaRunConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.PersonaRunConfig} PersonaRunConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonaRunConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonaRunConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonaRunConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.persona != null && message.hasOwnProperty("persona")) + if (!$util.isString(message.persona)) + return "persona: string expected"; + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + if (!$util.isInteger(message.taskCount)) + return "taskCount: integer expected"; + return null; + }; + + /** + * Creates a PersonaRunConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.PersonaRunConfig} PersonaRunConfig + */ + PersonaRunConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.PersonaRunConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.PersonaRunConfig(); + if (object.persona != null) + message.persona = String(object.persona); + if (object.taskCount != null) + message.taskCount = object.taskCount | 0; + return message; + }; + + /** + * Creates a plain object from a PersonaRunConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @static + * @param {google.cloud.ces.v1beta.PersonaRunConfig} message PersonaRunConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonaRunConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.persona = ""; + object.taskCount = 0; + } + if (message.persona != null && message.hasOwnProperty("persona")) + object.persona = message.persona; + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + object.taskCount = message.taskCount; + return object; + }; + + /** + * Converts this PersonaRunConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @instance + * @returns {Object.} JSON object + */ + PersonaRunConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PersonaRunConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PersonaRunConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.PersonaRunConfig"; + }; + + return PersonaRunConfig; + })(); + + v1beta.OptimizationConfig = (function() { + + /** + * Properties of an OptimizationConfig. + * @memberof google.cloud.ces.v1beta + * @interface IOptimizationConfig + * @property {boolean|null} [generateLossReport] OptimizationConfig generateLossReport + * @property {string|null} [assistantSession] OptimizationConfig assistantSession + * @property {string|null} [reportSummary] OptimizationConfig reportSummary + * @property {boolean|null} [shouldSuggestFix] OptimizationConfig shouldSuggestFix + * @property {google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus|null} [status] OptimizationConfig status + * @property {string|null} [errorMessage] OptimizationConfig errorMessage + * @property {google.protobuf.IStruct|null} [lossReport] OptimizationConfig lossReport + */ + + /** + * Constructs a new OptimizationConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an OptimizationConfig. + * @implements IOptimizationConfig + * @constructor + * @param {google.cloud.ces.v1beta.IOptimizationConfig=} [properties] Properties to set + */ + function OptimizationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OptimizationConfig generateLossReport. + * @member {boolean} generateLossReport + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @instance + */ + OptimizationConfig.prototype.generateLossReport = false; + + /** + * OptimizationConfig assistantSession. + * @member {string} assistantSession + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @instance + */ + OptimizationConfig.prototype.assistantSession = ""; + + /** + * OptimizationConfig reportSummary. + * @member {string} reportSummary + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @instance + */ + OptimizationConfig.prototype.reportSummary = ""; + + /** + * OptimizationConfig shouldSuggestFix. + * @member {boolean} shouldSuggestFix + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @instance + */ + OptimizationConfig.prototype.shouldSuggestFix = false; + + /** + * OptimizationConfig status. + * @member {google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus} status + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @instance + */ + OptimizationConfig.prototype.status = 0; + + /** + * OptimizationConfig errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @instance + */ + OptimizationConfig.prototype.errorMessage = ""; + + /** + * OptimizationConfig lossReport. + * @member {google.protobuf.IStruct|null|undefined} lossReport + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @instance + */ + OptimizationConfig.prototype.lossReport = null; + + /** + * Creates a new OptimizationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @static + * @param {google.cloud.ces.v1beta.IOptimizationConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OptimizationConfig} OptimizationConfig instance + */ + OptimizationConfig.create = function create(properties) { + return new OptimizationConfig(properties); + }; + + /** + * Encodes the specified OptimizationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OptimizationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @static + * @param {google.cloud.ces.v1beta.IOptimizationConfig} message OptimizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.generateLossReport != null && Object.hasOwnProperty.call(message, "generateLossReport")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.generateLossReport); + if (message.assistantSession != null && Object.hasOwnProperty.call(message, "assistantSession")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assistantSession); + if (message.reportSummary != null && Object.hasOwnProperty.call(message, "reportSummary")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.reportSummary); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); + if (message.shouldSuggestFix != null && Object.hasOwnProperty.call(message, "shouldSuggestFix")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.shouldSuggestFix); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.errorMessage); + if (message.lossReport != null && Object.hasOwnProperty.call(message, "lossReport")) + $root.google.protobuf.Struct.encode(message.lossReport, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OptimizationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OptimizationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @static + * @param {google.cloud.ces.v1beta.IOptimizationConfig} message OptimizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OptimizationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OptimizationConfig} OptimizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OptimizationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.generateLossReport = reader.bool(); + break; + } + case 2: { + message.assistantSession = reader.string(); + break; + } + case 3: { + message.reportSummary = reader.string(); + break; + } + case 5: { + message.shouldSuggestFix = reader.bool(); + break; + } + case 4: { + message.status = reader.int32(); + break; + } + case 6: { + message.errorMessage = reader.string(); + break; + } + case 7: { + message.lossReport = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OptimizationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OptimizationConfig} OptimizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OptimizationConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OptimizationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.generateLossReport != null && message.hasOwnProperty("generateLossReport")) + if (typeof message.generateLossReport !== "boolean") + return "generateLossReport: boolean expected"; + if (message.assistantSession != null && message.hasOwnProperty("assistantSession")) + if (!$util.isString(message.assistantSession)) + return "assistantSession: string expected"; + if (message.reportSummary != null && message.hasOwnProperty("reportSummary")) + if (!$util.isString(message.reportSummary)) + return "reportSummary: string expected"; + if (message.shouldSuggestFix != null && message.hasOwnProperty("shouldSuggestFix")) + if (typeof message.shouldSuggestFix !== "boolean") + return "shouldSuggestFix: boolean expected"; + 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; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + if (message.lossReport != null && message.hasOwnProperty("lossReport")) { + var error = $root.google.protobuf.Struct.verify(message.lossReport); + if (error) + return "lossReport." + error; + } + return null; + }; + + /** + * Creates an OptimizationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OptimizationConfig} OptimizationConfig + */ + OptimizationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OptimizationConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.OptimizationConfig(); + if (object.generateLossReport != null) + message.generateLossReport = Boolean(object.generateLossReport); + if (object.assistantSession != null) + message.assistantSession = String(object.assistantSession); + if (object.reportSummary != null) + message.reportSummary = String(object.reportSummary); + if (object.shouldSuggestFix != null) + message.shouldSuggestFix = Boolean(object.shouldSuggestFix); + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "OPTIMIZATION_STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "RUNNING": + case 1: + message.status = 1; + break; + case "COMPLETED": + case 2: + message.status = 2; + break; + case "ERROR": + case 3: + message.status = 3; + break; + } + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + if (object.lossReport != null) { + if (typeof object.lossReport !== "object") + throw TypeError(".google.cloud.ces.v1beta.OptimizationConfig.lossReport: object expected"); + message.lossReport = $root.google.protobuf.Struct.fromObject(object.lossReport); + } + return message; + }; + + /** + * Creates a plain object from an OptimizationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @static + * @param {google.cloud.ces.v1beta.OptimizationConfig} message OptimizationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OptimizationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.generateLossReport = false; + object.assistantSession = ""; + object.reportSummary = ""; + object.status = options.enums === String ? "OPTIMIZATION_STATUS_UNSPECIFIED" : 0; + object.shouldSuggestFix = false; + object.errorMessage = ""; + object.lossReport = null; + } + if (message.generateLossReport != null && message.hasOwnProperty("generateLossReport")) + object.generateLossReport = message.generateLossReport; + if (message.assistantSession != null && message.hasOwnProperty("assistantSession")) + object.assistantSession = message.assistantSession; + if (message.reportSummary != null && message.hasOwnProperty("reportSummary")) + object.reportSummary = message.reportSummary; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus[message.status] === undefined ? message.status : $root.google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus[message.status] : message.status; + if (message.shouldSuggestFix != null && message.hasOwnProperty("shouldSuggestFix")) + object.shouldSuggestFix = message.shouldSuggestFix; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + if (message.lossReport != null && message.hasOwnProperty("lossReport")) + object.lossReport = $root.google.protobuf.Struct.toObject(message.lossReport, options); + return object; + }; + + /** + * Converts this OptimizationConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @instance + * @returns {Object.} JSON object + */ + OptimizationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OptimizationConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OptimizationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OptimizationConfig"; + }; + + /** + * OptimizationStatus enum. + * @name google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus + * @enum {number} + * @property {number} OPTIMIZATION_STATUS_UNSPECIFIED=0 OPTIMIZATION_STATUS_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} COMPLETED=2 COMPLETED value + * @property {number} ERROR=3 ERROR value + */ + OptimizationConfig.OptimizationStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPTIMIZATION_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "COMPLETED"] = 2; + values[valuesById[3] = "ERROR"] = 3; + return values; + })(); + + return OptimizationConfig; + })(); + + v1beta.SessionService = (function() { + + /** + * Constructs a new SessionService service. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a SessionService + * @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 SessionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SessionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SessionService; + + /** + * Creates new SessionService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.ces.v1beta.SessionService + * @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 {SessionService} RPC service. Useful where requests and/or responses are streamed. + */ + SessionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.SessionService|runSession}. + * @memberof google.cloud.ces.v1beta.SessionService + * @typedef RunSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.RunSessionResponse} [response] RunSessionResponse + */ + + /** + * Calls RunSession. + * @function runSession + * @memberof google.cloud.ces.v1beta.SessionService + * @instance + * @param {google.cloud.ces.v1beta.IRunSessionRequest} request RunSessionRequest message or plain object + * @param {google.cloud.ces.v1beta.SessionService.RunSessionCallback} callback Node-style callback called with the error, if any, and RunSessionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionService.prototype.runSession = function runSession(request, callback) { + return this.rpcCall(runSession, $root.google.cloud.ces.v1beta.RunSessionRequest, $root.google.cloud.ces.v1beta.RunSessionResponse, request, callback); + }, "name", { value: "RunSession" }); + + /** + * Calls RunSession. + * @function runSession + * @memberof google.cloud.ces.v1beta.SessionService + * @instance + * @param {google.cloud.ces.v1beta.IRunSessionRequest} request RunSessionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.SessionService|bidiRunSession}. + * @memberof google.cloud.ces.v1beta.SessionService + * @typedef BidiRunSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.BidiSessionServerMessage} [response] BidiSessionServerMessage + */ + + /** + * Calls BidiRunSession. + * @function bidiRunSession + * @memberof google.cloud.ces.v1beta.SessionService + * @instance + * @param {google.cloud.ces.v1beta.IBidiSessionClientMessage} request BidiSessionClientMessage message or plain object + * @param {google.cloud.ces.v1beta.SessionService.BidiRunSessionCallback} callback Node-style callback called with the error, if any, and BidiSessionServerMessage + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionService.prototype.bidiRunSession = function bidiRunSession(request, callback) { + return this.rpcCall(bidiRunSession, $root.google.cloud.ces.v1beta.BidiSessionClientMessage, $root.google.cloud.ces.v1beta.BidiSessionServerMessage, request, callback); + }, "name", { value: "BidiRunSession" }); + + /** + * Calls BidiRunSession. + * @function bidiRunSession + * @memberof google.cloud.ces.v1beta.SessionService + * @instance + * @param {google.cloud.ces.v1beta.IBidiSessionClientMessage} request BidiSessionClientMessage message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SessionService; + })(); + + /** + * AudioEncoding enum. + * @name google.cloud.ces.v1beta.AudioEncoding + * @enum {number} + * @property {number} AUDIO_ENCODING_UNSPECIFIED=0 AUDIO_ENCODING_UNSPECIFIED value + * @property {number} LINEAR16=1 LINEAR16 value + * @property {number} MULAW=2 MULAW value + * @property {number} ALAW=3 ALAW value + */ + v1beta.AudioEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUDIO_ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINEAR16"] = 1; + values[valuesById[2] = "MULAW"] = 2; + values[valuesById[3] = "ALAW"] = 3; + return values; + })(); + + v1beta.InputAudioConfig = (function() { + + /** + * Properties of an InputAudioConfig. + * @memberof google.cloud.ces.v1beta + * @interface IInputAudioConfig + * @property {google.cloud.ces.v1beta.AudioEncoding|null} [audioEncoding] InputAudioConfig audioEncoding + * @property {number|null} [sampleRateHertz] InputAudioConfig sampleRateHertz + * @property {string|null} [noiseSuppressionLevel] InputAudioConfig noiseSuppressionLevel + */ + + /** + * Constructs a new InputAudioConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an InputAudioConfig. + * @implements IInputAudioConfig + * @constructor + * @param {google.cloud.ces.v1beta.IInputAudioConfig=} [properties] Properties to set + */ + function InputAudioConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputAudioConfig audioEncoding. + * @member {google.cloud.ces.v1beta.AudioEncoding} audioEncoding + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.audioEncoding = 0; + + /** + * InputAudioConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.sampleRateHertz = 0; + + /** + * InputAudioConfig noiseSuppressionLevel. + * @member {string} noiseSuppressionLevel + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.noiseSuppressionLevel = ""; + + /** + * Creates a new InputAudioConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @static + * @param {google.cloud.ces.v1beta.IInputAudioConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.InputAudioConfig} InputAudioConfig instance + */ + InputAudioConfig.create = function create(properties) { + return new InputAudioConfig(properties); + }; + + /** + * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1beta.InputAudioConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @static + * @param {google.cloud.ces.v1beta.IInputAudioConfig} message InputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputAudioConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); + if (message.noiseSuppressionLevel != null && Object.hasOwnProperty.call(message, "noiseSuppressionLevel")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.noiseSuppressionLevel); + return writer; + }; + + /** + * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.InputAudioConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @static + * @param {google.cloud.ces.v1beta.IInputAudioConfig} message InputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.InputAudioConfig} InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputAudioConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.InputAudioConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audioEncoding = reader.int32(); + break; + } + case 2: { + message.sampleRateHertz = reader.int32(); + break; + } + case 6: { + message.noiseSuppressionLevel = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.InputAudioConfig} InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputAudioConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputAudioConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputAudioConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + switch (message.audioEncoding) { + default: + return "audioEncoding: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) + if (!$util.isString(message.noiseSuppressionLevel)) + return "noiseSuppressionLevel: string expected"; + return null; + }; + + /** + * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.InputAudioConfig} InputAudioConfig + */ + InputAudioConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.InputAudioConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.InputAudioConfig(); + switch (object.audioEncoding) { + default: + if (typeof object.audioEncoding === "number") { + message.audioEncoding = object.audioEncoding; + break; + } + break; + case "AUDIO_ENCODING_UNSPECIFIED": + case 0: + message.audioEncoding = 0; + break; + case "LINEAR16": + case 1: + message.audioEncoding = 1; + break; + case "MULAW": + case 2: + message.audioEncoding = 2; + break; + case "ALAW": + case 3: + message.audioEncoding = 3; + break; + } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + if (object.noiseSuppressionLevel != null) + message.noiseSuppressionLevel = String(object.noiseSuppressionLevel); + return message; + }; + + /** + * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @static + * @param {google.cloud.ces.v1beta.InputAudioConfig} message InputAudioConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputAudioConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.audioEncoding = options.enums === String ? "AUDIO_ENCODING_UNSPECIFIED" : 0; + object.sampleRateHertz = 0; + object.noiseSuppressionLevel = ""; + } + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + object.audioEncoding = options.enums === String ? $root.google.cloud.ces.v1beta.AudioEncoding[message.audioEncoding] === undefined ? message.audioEncoding : $root.google.cloud.ces.v1beta.AudioEncoding[message.audioEncoding] : message.audioEncoding; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) + object.noiseSuppressionLevel = message.noiseSuppressionLevel; + return object; + }; + + /** + * Converts this InputAudioConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @instance + * @returns {Object.} JSON object + */ + InputAudioConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputAudioConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputAudioConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.InputAudioConfig"; + }; + + return InputAudioConfig; + })(); + + v1beta.OutputAudioConfig = (function() { + + /** + * Properties of an OutputAudioConfig. + * @memberof google.cloud.ces.v1beta + * @interface IOutputAudioConfig + * @property {google.cloud.ces.v1beta.AudioEncoding|null} [audioEncoding] OutputAudioConfig audioEncoding + * @property {number|null} [sampleRateHertz] OutputAudioConfig sampleRateHertz + */ + + /** + * Constructs a new OutputAudioConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an OutputAudioConfig. + * @implements IOutputAudioConfig + * @constructor + * @param {google.cloud.ces.v1beta.IOutputAudioConfig=} [properties] Properties to set + */ + function OutputAudioConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputAudioConfig audioEncoding. + * @member {google.cloud.ces.v1beta.AudioEncoding} audioEncoding + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @instance + */ + OutputAudioConfig.prototype.audioEncoding = 0; + + /** + * OutputAudioConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @instance + */ + OutputAudioConfig.prototype.sampleRateHertz = 0; + + /** + * Creates a new OutputAudioConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @static + * @param {google.cloud.ces.v1beta.IOutputAudioConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OutputAudioConfig} OutputAudioConfig instance + */ + OutputAudioConfig.create = function create(properties) { + return new OutputAudioConfig(properties); + }; + + /** + * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OutputAudioConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @static + * @param {google.cloud.ces.v1beta.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudioConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); + return writer; + }; + + /** + * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OutputAudioConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @static + * @param {google.cloud.ces.v1beta.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OutputAudioConfig} OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudioConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OutputAudioConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audioEncoding = reader.int32(); + break; + } + case 2: { + message.sampleRateHertz = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OutputAudioConfig} OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudioConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputAudioConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputAudioConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + switch (message.audioEncoding) { + default: + return "audioEncoding: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + return null; + }; + + /** + * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OutputAudioConfig} OutputAudioConfig + */ + OutputAudioConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OutputAudioConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.OutputAudioConfig(); + switch (object.audioEncoding) { + default: + if (typeof object.audioEncoding === "number") { + message.audioEncoding = object.audioEncoding; + break; + } + break; + case "AUDIO_ENCODING_UNSPECIFIED": + case 0: + message.audioEncoding = 0; + break; + case "LINEAR16": + case 1: + message.audioEncoding = 1; + break; + case "MULAW": + case 2: + message.audioEncoding = 2; + break; + case "ALAW": + case 3: + message.audioEncoding = 3; + break; + } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + return message; + }; + + /** + * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @static + * @param {google.cloud.ces.v1beta.OutputAudioConfig} message OutputAudioConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputAudioConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.audioEncoding = options.enums === String ? "AUDIO_ENCODING_UNSPECIFIED" : 0; + object.sampleRateHertz = 0; + } + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + object.audioEncoding = options.enums === String ? $root.google.cloud.ces.v1beta.AudioEncoding[message.audioEncoding] === undefined ? message.audioEncoding : $root.google.cloud.ces.v1beta.AudioEncoding[message.audioEncoding] : message.audioEncoding; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + return object; + }; + + /** + * Converts this OutputAudioConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @instance + * @returns {Object.} JSON object + */ + OutputAudioConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputAudioConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputAudioConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OutputAudioConfig"; + }; + + return OutputAudioConfig; + })(); + + v1beta.SessionConfig = (function() { + + /** + * Properties of a SessionConfig. + * @memberof google.cloud.ces.v1beta + * @interface ISessionConfig + * @property {string|null} [session] SessionConfig session + * @property {google.cloud.ces.v1beta.IInputAudioConfig|null} [inputAudioConfig] SessionConfig inputAudioConfig + * @property {google.cloud.ces.v1beta.IOutputAudioConfig|null} [outputAudioConfig] SessionConfig outputAudioConfig + * @property {Array.|null} [historicalContexts] SessionConfig historicalContexts + * @property {string|null} [entryAgent] SessionConfig entryAgent + * @property {string|null} [deployment] SessionConfig deployment + * @property {string|null} [timeZone] SessionConfig timeZone + * @property {google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters|null} [remoteDialogflowQueryParameters] SessionConfig remoteDialogflowQueryParameters + */ + + /** + * Constructs a new SessionConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a SessionConfig. + * @implements ISessionConfig + * @constructor + * @param {google.cloud.ces.v1beta.ISessionConfig=} [properties] Properties to set + */ + function SessionConfig(properties) { + this.historicalContexts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionConfig session. + * @member {string} session + * @memberof google.cloud.ces.v1beta.SessionConfig + * @instance + */ + SessionConfig.prototype.session = ""; + + /** + * SessionConfig inputAudioConfig. + * @member {google.cloud.ces.v1beta.IInputAudioConfig|null|undefined} inputAudioConfig + * @memberof google.cloud.ces.v1beta.SessionConfig + * @instance + */ + SessionConfig.prototype.inputAudioConfig = null; + + /** + * SessionConfig outputAudioConfig. + * @member {google.cloud.ces.v1beta.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.ces.v1beta.SessionConfig + * @instance + */ + SessionConfig.prototype.outputAudioConfig = null; + + /** + * SessionConfig historicalContexts. + * @member {Array.} historicalContexts + * @memberof google.cloud.ces.v1beta.SessionConfig + * @instance + */ + SessionConfig.prototype.historicalContexts = $util.emptyArray; + + /** + * SessionConfig entryAgent. + * @member {string} entryAgent + * @memberof google.cloud.ces.v1beta.SessionConfig + * @instance + */ + SessionConfig.prototype.entryAgent = ""; + + /** + * SessionConfig deployment. + * @member {string} deployment + * @memberof google.cloud.ces.v1beta.SessionConfig + * @instance + */ + SessionConfig.prototype.deployment = ""; + + /** + * SessionConfig timeZone. + * @member {string} timeZone + * @memberof google.cloud.ces.v1beta.SessionConfig + * @instance + */ + SessionConfig.prototype.timeZone = ""; + + /** + * SessionConfig remoteDialogflowQueryParameters. + * @member {google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters|null|undefined} remoteDialogflowQueryParameters + * @memberof google.cloud.ces.v1beta.SessionConfig + * @instance + */ + SessionConfig.prototype.remoteDialogflowQueryParameters = null; + + /** + * Creates a new SessionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.SessionConfig + * @static + * @param {google.cloud.ces.v1beta.ISessionConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.SessionConfig} SessionConfig instance + */ + SessionConfig.create = function create(properties) { + return new SessionConfig(properties); + }; + + /** + * Encodes the specified SessionConfig message. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.SessionConfig + * @static + * @param {google.cloud.ces.v1beta.ISessionConfig} message SessionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.inputAudioConfig != null && Object.hasOwnProperty.call(message, "inputAudioConfig")) + $root.google.cloud.ces.v1beta.InputAudioConfig.encode(message.inputAudioConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.ces.v1beta.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.historicalContexts != null && message.historicalContexts.length) + for (var i = 0; i < message.historicalContexts.length; ++i) + $root.google.cloud.ces.v1beta.Message.encode(message.historicalContexts[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.deployment); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.timeZone); + if (message.entryAgent != null && Object.hasOwnProperty.call(message, "entryAgent")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.entryAgent); + if (message.remoteDialogflowQueryParameters != null && Object.hasOwnProperty.call(message, "remoteDialogflowQueryParameters")) + $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.encode(message.remoteDialogflowQueryParameters, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SessionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.SessionConfig + * @static + * @param {google.cloud.ces.v1beta.ISessionConfig} message SessionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.SessionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.SessionConfig} SessionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SessionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.inputAudioConfig = $root.google.cloud.ces.v1beta.InputAudioConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.outputAudioConfig = $root.google.cloud.ces.v1beta.OutputAudioConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.historicalContexts && message.historicalContexts.length)) + message.historicalContexts = []; + message.historicalContexts.push($root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32())); + break; + } + case 12: { + message.entryAgent = reader.string(); + break; + } + case 8: { + message.deployment = reader.string(); + break; + } + case 11: { + message.timeZone = reader.string(); + break; + } + case 15: { + message.remoteDialogflowQueryParameters = $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.SessionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.SessionConfig} SessionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.SessionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.inputAudioConfig != null && message.hasOwnProperty("inputAudioConfig")) { + var error = $root.google.cloud.ces.v1beta.InputAudioConfig.verify(message.inputAudioConfig); + if (error) + return "inputAudioConfig." + error; + } + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.ces.v1beta.OutputAudioConfig.verify(message.outputAudioConfig); + if (error) + return "outputAudioConfig." + error; + } + if (message.historicalContexts != null && message.hasOwnProperty("historicalContexts")) { + if (!Array.isArray(message.historicalContexts)) + return "historicalContexts: array expected"; + for (var i = 0; i < message.historicalContexts.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Message.verify(message.historicalContexts[i]); + if (error) + return "historicalContexts." + error; + } + } + if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) + if (!$util.isString(message.entryAgent)) + return "entryAgent: string expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) + if (!$util.isString(message.deployment)) + return "deployment: string expected"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.remoteDialogflowQueryParameters != null && message.hasOwnProperty("remoteDialogflowQueryParameters")) { + var error = $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.verify(message.remoteDialogflowQueryParameters); + if (error) + return "remoteDialogflowQueryParameters." + error; + } + return null; + }; + + /** + * Creates a SessionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.SessionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.SessionConfig} SessionConfig + */ + SessionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.SessionConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.SessionConfig(); + if (object.session != null) + message.session = String(object.session); + if (object.inputAudioConfig != null) { + if (typeof object.inputAudioConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionConfig.inputAudioConfig: object expected"); + message.inputAudioConfig = $root.google.cloud.ces.v1beta.InputAudioConfig.fromObject(object.inputAudioConfig); + } + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionConfig.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.ces.v1beta.OutputAudioConfig.fromObject(object.outputAudioConfig); + } + if (object.historicalContexts) { + if (!Array.isArray(object.historicalContexts)) + throw TypeError(".google.cloud.ces.v1beta.SessionConfig.historicalContexts: array expected"); + message.historicalContexts = []; + for (var i = 0; i < object.historicalContexts.length; ++i) { + if (typeof object.historicalContexts[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionConfig.historicalContexts: object expected"); + message.historicalContexts[i] = $root.google.cloud.ces.v1beta.Message.fromObject(object.historicalContexts[i]); + } + } + if (object.entryAgent != null) + message.entryAgent = String(object.entryAgent); + if (object.deployment != null) + message.deployment = String(object.deployment); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.remoteDialogflowQueryParameters != null) { + if (typeof object.remoteDialogflowQueryParameters !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionConfig.remoteDialogflowQueryParameters: object expected"); + message.remoteDialogflowQueryParameters = $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.fromObject(object.remoteDialogflowQueryParameters); + } + return message; + }; + + /** + * Creates a plain object from a SessionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.SessionConfig + * @static + * @param {google.cloud.ces.v1beta.SessionConfig} message SessionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.historicalContexts = []; + if (options.defaults) { + object.session = ""; + object.inputAudioConfig = null; + object.outputAudioConfig = null; + object.deployment = ""; + object.timeZone = ""; + object.entryAgent = ""; + object.remoteDialogflowQueryParameters = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.inputAudioConfig != null && message.hasOwnProperty("inputAudioConfig")) + object.inputAudioConfig = $root.google.cloud.ces.v1beta.InputAudioConfig.toObject(message.inputAudioConfig, options); + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.ces.v1beta.OutputAudioConfig.toObject(message.outputAudioConfig, options); + if (message.historicalContexts && message.historicalContexts.length) { + object.historicalContexts = []; + for (var j = 0; j < message.historicalContexts.length; ++j) + object.historicalContexts[j] = $root.google.cloud.ces.v1beta.Message.toObject(message.historicalContexts[j], options); + } + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = message.deployment; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) + object.entryAgent = message.entryAgent; + if (message.remoteDialogflowQueryParameters != null && message.hasOwnProperty("remoteDialogflowQueryParameters")) + object.remoteDialogflowQueryParameters = $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.toObject(message.remoteDialogflowQueryParameters, options); + return object; + }; + + /** + * Converts this SessionConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.SessionConfig + * @instance + * @returns {Object.} JSON object + */ + SessionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.SessionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.SessionConfig"; + }; + + SessionConfig.RemoteDialogflowQueryParameters = (function() { + + /** + * Properties of a RemoteDialogflowQueryParameters. + * @memberof google.cloud.ces.v1beta.SessionConfig + * @interface IRemoteDialogflowQueryParameters + * @property {Object.|null} [webhookHeaders] RemoteDialogflowQueryParameters webhookHeaders + * @property {google.protobuf.IStruct|null} [payload] RemoteDialogflowQueryParameters payload + * @property {google.protobuf.IStruct|null} [endUserMetadata] RemoteDialogflowQueryParameters endUserMetadata + */ + + /** + * Constructs a new RemoteDialogflowQueryParameters. + * @memberof google.cloud.ces.v1beta.SessionConfig + * @classdesc Represents a RemoteDialogflowQueryParameters. + * @implements IRemoteDialogflowQueryParameters + * @constructor + * @param {google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters=} [properties] Properties to set + */ + function RemoteDialogflowQueryParameters(properties) { + this.webhookHeaders = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoteDialogflowQueryParameters webhookHeaders. + * @member {Object.} webhookHeaders + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @instance + */ + RemoteDialogflowQueryParameters.prototype.webhookHeaders = $util.emptyObject; + + /** + * RemoteDialogflowQueryParameters payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @instance + */ + RemoteDialogflowQueryParameters.prototype.payload = null; + + /** + * RemoteDialogflowQueryParameters endUserMetadata. + * @member {google.protobuf.IStruct|null|undefined} endUserMetadata + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @instance + */ + RemoteDialogflowQueryParameters.prototype.endUserMetadata = null; + + /** + * Creates a new RemoteDialogflowQueryParameters instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters instance + */ + RemoteDialogflowQueryParameters.create = function create(properties) { + return new RemoteDialogflowQueryParameters(properties); + }; + + /** + * Encodes the specified RemoteDialogflowQueryParameters message. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters} message RemoteDialogflowQueryParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoteDialogflowQueryParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.webhookHeaders != null && Object.hasOwnProperty.call(message, "webhookHeaders")) + for (var keys = Object.keys(message.webhookHeaders), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.webhookHeaders[keys[i]]).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endUserMetadata != null && Object.hasOwnProperty.call(message, "endUserMetadata")) + $root.google.protobuf.Struct.encode(message.endUserMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RemoteDialogflowQueryParameters message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters} message RemoteDialogflowQueryParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoteDialogflowQueryParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoteDialogflowQueryParameters.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.webhookHeaders === $util.emptyObject) + message.webhookHeaders = {}; + 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.webhookHeaders[key] = value; + break; + } + case 2: { + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endUserMetadata = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoteDialogflowQueryParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoteDialogflowQueryParameters message. + * @function verify + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoteDialogflowQueryParameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.webhookHeaders != null && message.hasOwnProperty("webhookHeaders")) { + if (!$util.isObject(message.webhookHeaders)) + return "webhookHeaders: object expected"; + var key = Object.keys(message.webhookHeaders); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.webhookHeaders[key[i]])) + return "webhookHeaders: string{k:string} expected"; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.protobuf.Struct.verify(message.payload); + if (error) + return "payload." + error; + } + if (message.endUserMetadata != null && message.hasOwnProperty("endUserMetadata")) { + var error = $root.google.protobuf.Struct.verify(message.endUserMetadata); + if (error) + return "endUserMetadata." + error; + } + return null; + }; + + /** + * Creates a RemoteDialogflowQueryParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters + */ + RemoteDialogflowQueryParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters) + return object; + var message = new $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters(); + if (object.webhookHeaders) { + if (typeof object.webhookHeaders !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.webhookHeaders: object expected"); + message.webhookHeaders = {}; + for (var keys = Object.keys(object.webhookHeaders), i = 0; i < keys.length; ++i) + message.webhookHeaders[keys[i]] = String(object.webhookHeaders[keys[i]]); + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload); + } + if (object.endUserMetadata != null) { + if (typeof object.endUserMetadata !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.endUserMetadata: object expected"); + message.endUserMetadata = $root.google.protobuf.Struct.fromObject(object.endUserMetadata); + } + return message; + }; + + /** + * Creates a plain object from a RemoteDialogflowQueryParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters} message RemoteDialogflowQueryParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoteDialogflowQueryParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.webhookHeaders = {}; + if (options.defaults) { + object.payload = null; + object.endUserMetadata = null; + } + var keys2; + if (message.webhookHeaders && (keys2 = Object.keys(message.webhookHeaders)).length) { + object.webhookHeaders = {}; + for (var j = 0; j < keys2.length; ++j) + object.webhookHeaders[keys2[j]] = message.webhookHeaders[keys2[j]]; + } + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (message.endUserMetadata != null && message.hasOwnProperty("endUserMetadata")) + object.endUserMetadata = $root.google.protobuf.Struct.toObject(message.endUserMetadata, options); + return object; + }; + + /** + * Converts this RemoteDialogflowQueryParameters to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @instance + * @returns {Object.} JSON object + */ + RemoteDialogflowQueryParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemoteDialogflowQueryParameters + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoteDialogflowQueryParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters"; + }; + + return RemoteDialogflowQueryParameters; + })(); + + return SessionConfig; + })(); + + v1beta.ToolCalls = (function() { + + /** + * Properties of a ToolCalls. + * @memberof google.cloud.ces.v1beta + * @interface IToolCalls + * @property {Array.|null} [toolCalls] ToolCalls toolCalls + */ + + /** + * Constructs a new ToolCalls. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ToolCalls. + * @implements IToolCalls + * @constructor + * @param {google.cloud.ces.v1beta.IToolCalls=} [properties] Properties to set + */ + function ToolCalls(properties) { + this.toolCalls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolCalls toolCalls. + * @member {Array.} toolCalls + * @memberof google.cloud.ces.v1beta.ToolCalls + * @instance + */ + ToolCalls.prototype.toolCalls = $util.emptyArray; + + /** + * Creates a new ToolCalls instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ToolCalls + * @static + * @param {google.cloud.ces.v1beta.IToolCalls=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ToolCalls} ToolCalls instance + */ + ToolCalls.create = function create(properties) { + return new ToolCalls(properties); + }; + + /** + * Encodes the specified ToolCalls message. Does not implicitly {@link google.cloud.ces.v1beta.ToolCalls.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ToolCalls + * @static + * @param {google.cloud.ces.v1beta.IToolCalls} message ToolCalls message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCalls.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolCalls != null && message.toolCalls.length) + for (var i = 0; i < message.toolCalls.length; ++i) + $root.google.cloud.ces.v1beta.ToolCall.encode(message.toolCalls[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolCalls message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolCalls.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ToolCalls + * @static + * @param {google.cloud.ces.v1beta.IToolCalls} message ToolCalls message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCalls.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolCalls message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ToolCalls + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ToolCalls} ToolCalls + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCalls.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ToolCalls(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.toolCalls && message.toolCalls.length)) + message.toolCalls = []; + message.toolCalls.push($root.google.cloud.ces.v1beta.ToolCall.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolCalls message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ToolCalls + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ToolCalls} ToolCalls + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCalls.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolCalls message. + * @function verify + * @memberof google.cloud.ces.v1beta.ToolCalls + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolCalls.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolCalls != null && message.hasOwnProperty("toolCalls")) { + if (!Array.isArray(message.toolCalls)) + return "toolCalls: array expected"; + for (var i = 0; i < message.toolCalls.length; ++i) { + var error = $root.google.cloud.ces.v1beta.ToolCall.verify(message.toolCalls[i]); + if (error) + return "toolCalls." + error; + } + } + return null; + }; + + /** + * Creates a ToolCalls message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ToolCalls + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ToolCalls} ToolCalls + */ + ToolCalls.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ToolCalls) + return object; + var message = new $root.google.cloud.ces.v1beta.ToolCalls(); + if (object.toolCalls) { + if (!Array.isArray(object.toolCalls)) + throw TypeError(".google.cloud.ces.v1beta.ToolCalls.toolCalls: array expected"); + message.toolCalls = []; + for (var i = 0; i < object.toolCalls.length; ++i) { + if (typeof object.toolCalls[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ToolCalls.toolCalls: object expected"); + message.toolCalls[i] = $root.google.cloud.ces.v1beta.ToolCall.fromObject(object.toolCalls[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ToolCalls message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ToolCalls + * @static + * @param {google.cloud.ces.v1beta.ToolCalls} message ToolCalls + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolCalls.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.toolCalls = []; + if (message.toolCalls && message.toolCalls.length) { + object.toolCalls = []; + for (var j = 0; j < message.toolCalls.length; ++j) + object.toolCalls[j] = $root.google.cloud.ces.v1beta.ToolCall.toObject(message.toolCalls[j], options); + } + return object; + }; + + /** + * Converts this ToolCalls to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ToolCalls + * @instance + * @returns {Object.} JSON object + */ + ToolCalls.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolCalls + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ToolCalls + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolCalls.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ToolCalls"; + }; + + return ToolCalls; + })(); + + v1beta.ToolResponses = (function() { + + /** + * Properties of a ToolResponses. + * @memberof google.cloud.ces.v1beta + * @interface IToolResponses + * @property {Array.|null} [toolResponses] ToolResponses toolResponses + */ + + /** + * Constructs a new ToolResponses. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ToolResponses. + * @implements IToolResponses + * @constructor + * @param {google.cloud.ces.v1beta.IToolResponses=} [properties] Properties to set + */ + function ToolResponses(properties) { + this.toolResponses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolResponses toolResponses. + * @member {Array.} toolResponses + * @memberof google.cloud.ces.v1beta.ToolResponses + * @instance + */ + ToolResponses.prototype.toolResponses = $util.emptyArray; + + /** + * Creates a new ToolResponses instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ToolResponses + * @static + * @param {google.cloud.ces.v1beta.IToolResponses=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ToolResponses} ToolResponses instance + */ + ToolResponses.create = function create(properties) { + return new ToolResponses(properties); + }; + + /** + * Encodes the specified ToolResponses message. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponses.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ToolResponses + * @static + * @param {google.cloud.ces.v1beta.IToolResponses} message ToolResponses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolResponses.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolResponses != null && message.toolResponses.length) + for (var i = 0; i < message.toolResponses.length; ++i) + $root.google.cloud.ces.v1beta.ToolResponse.encode(message.toolResponses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolResponses message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponses.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ToolResponses + * @static + * @param {google.cloud.ces.v1beta.IToolResponses} message ToolResponses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolResponses.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolResponses message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ToolResponses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ToolResponses} ToolResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolResponses.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ToolResponses(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.toolResponses && message.toolResponses.length)) + message.toolResponses = []; + message.toolResponses.push($root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolResponses message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ToolResponses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ToolResponses} ToolResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolResponses.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolResponses message. + * @function verify + * @memberof google.cloud.ces.v1beta.ToolResponses + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolResponses.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolResponses != null && message.hasOwnProperty("toolResponses")) { + if (!Array.isArray(message.toolResponses)) + return "toolResponses: array expected"; + for (var i = 0; i < message.toolResponses.length; ++i) { + var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.toolResponses[i]); + if (error) + return "toolResponses." + error; + } + } + return null; + }; + + /** + * Creates a ToolResponses message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ToolResponses + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ToolResponses} ToolResponses + */ + ToolResponses.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ToolResponses) + return object; + var message = new $root.google.cloud.ces.v1beta.ToolResponses(); + if (object.toolResponses) { + if (!Array.isArray(object.toolResponses)) + throw TypeError(".google.cloud.ces.v1beta.ToolResponses.toolResponses: array expected"); + message.toolResponses = []; + for (var i = 0; i < object.toolResponses.length; ++i) { + if (typeof object.toolResponses[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ToolResponses.toolResponses: object expected"); + message.toolResponses[i] = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.toolResponses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ToolResponses message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ToolResponses + * @static + * @param {google.cloud.ces.v1beta.ToolResponses} message ToolResponses + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolResponses.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.toolResponses = []; + if (message.toolResponses && message.toolResponses.length) { + object.toolResponses = []; + for (var j = 0; j < message.toolResponses.length; ++j) + object.toolResponses[j] = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.toolResponses[j], options); + } + return object; + }; + + /** + * Converts this ToolResponses to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ToolResponses + * @instance + * @returns {Object.} JSON object + */ + ToolResponses.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolResponses + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ToolResponses + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolResponses.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ToolResponses"; + }; + + return ToolResponses; + })(); + + v1beta.Citations = (function() { + + /** + * Properties of a Citations. + * @memberof google.cloud.ces.v1beta + * @interface ICitations + * @property {Array.|null} [citedChunks] Citations citedChunks + */ + + /** + * Constructs a new Citations. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Citations. + * @implements ICitations + * @constructor + * @param {google.cloud.ces.v1beta.ICitations=} [properties] Properties to set + */ + function Citations(properties) { + this.citedChunks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Citations citedChunks. + * @member {Array.} citedChunks + * @memberof google.cloud.ces.v1beta.Citations + * @instance + */ + Citations.prototype.citedChunks = $util.emptyArray; + + /** + * Creates a new Citations instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Citations + * @static + * @param {google.cloud.ces.v1beta.ICitations=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Citations} Citations instance + */ + Citations.create = function create(properties) { + return new Citations(properties); + }; + + /** + * Encodes the specified Citations message. Does not implicitly {@link google.cloud.ces.v1beta.Citations.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Citations + * @static + * @param {google.cloud.ces.v1beta.ICitations} message Citations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Citations.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.citedChunks != null && message.citedChunks.length) + for (var i = 0; i < message.citedChunks.length; ++i) + $root.google.cloud.ces.v1beta.Citations.CitedChunk.encode(message.citedChunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Citations message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Citations.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Citations + * @static + * @param {google.cloud.ces.v1beta.ICitations} message Citations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Citations.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Citations message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Citations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Citations} Citations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Citations.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Citations(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.citedChunks && message.citedChunks.length)) + message.citedChunks = []; + message.citedChunks.push($root.google.cloud.ces.v1beta.Citations.CitedChunk.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Citations message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Citations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Citations} Citations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Citations.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Citations message. + * @function verify + * @memberof google.cloud.ces.v1beta.Citations + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Citations.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.citedChunks != null && message.hasOwnProperty("citedChunks")) { + if (!Array.isArray(message.citedChunks)) + return "citedChunks: array expected"; + for (var i = 0; i < message.citedChunks.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Citations.CitedChunk.verify(message.citedChunks[i]); + if (error) + return "citedChunks." + error; + } + } + return null; + }; + + /** + * Creates a Citations message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Citations + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Citations} Citations + */ + Citations.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Citations) + return object; + var message = new $root.google.cloud.ces.v1beta.Citations(); + if (object.citedChunks) { + if (!Array.isArray(object.citedChunks)) + throw TypeError(".google.cloud.ces.v1beta.Citations.citedChunks: array expected"); + message.citedChunks = []; + for (var i = 0; i < object.citedChunks.length; ++i) { + if (typeof object.citedChunks[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Citations.citedChunks: object expected"); + message.citedChunks[i] = $root.google.cloud.ces.v1beta.Citations.CitedChunk.fromObject(object.citedChunks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Citations message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Citations + * @static + * @param {google.cloud.ces.v1beta.Citations} message Citations + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Citations.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.citedChunks = []; + if (message.citedChunks && message.citedChunks.length) { + object.citedChunks = []; + for (var j = 0; j < message.citedChunks.length; ++j) + object.citedChunks[j] = $root.google.cloud.ces.v1beta.Citations.CitedChunk.toObject(message.citedChunks[j], options); + } + return object; + }; + + /** + * Converts this Citations to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Citations + * @instance + * @returns {Object.} JSON object + */ + Citations.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Citations + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Citations + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Citations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Citations"; + }; + + Citations.CitedChunk = (function() { + + /** + * Properties of a CitedChunk. + * @memberof google.cloud.ces.v1beta.Citations + * @interface ICitedChunk + * @property {string|null} [uri] CitedChunk uri + * @property {string|null} [title] CitedChunk title + * @property {string|null} [text] CitedChunk text + */ + + /** + * Constructs a new CitedChunk. + * @memberof google.cloud.ces.v1beta.Citations + * @classdesc Represents a CitedChunk. + * @implements ICitedChunk + * @constructor + * @param {google.cloud.ces.v1beta.Citations.ICitedChunk=} [properties] Properties to set + */ + function CitedChunk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CitedChunk uri. + * @member {string} uri + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @instance + */ + CitedChunk.prototype.uri = ""; + + /** + * CitedChunk title. + * @member {string} title + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @instance + */ + CitedChunk.prototype.title = ""; + + /** + * CitedChunk text. + * @member {string} text + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @instance + */ + CitedChunk.prototype.text = ""; + + /** + * Creates a new CitedChunk instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @static + * @param {google.cloud.ces.v1beta.Citations.ICitedChunk=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Citations.CitedChunk} CitedChunk instance + */ + CitedChunk.create = function create(properties) { + return new CitedChunk(properties); + }; + + /** + * Encodes the specified CitedChunk message. Does not implicitly {@link google.cloud.ces.v1beta.Citations.CitedChunk.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @static + * @param {google.cloud.ces.v1beta.Citations.ICitedChunk} message CitedChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CitedChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.text); + return writer; + }; + + /** + * Encodes the specified CitedChunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Citations.CitedChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @static + * @param {google.cloud.ces.v1beta.Citations.ICitedChunk} message CitedChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CitedChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CitedChunk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Citations.CitedChunk} CitedChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CitedChunk.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Citations.CitedChunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CitedChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Citations.CitedChunk} CitedChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CitedChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CitedChunk message. + * @function verify + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CitedChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a CitedChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Citations.CitedChunk} CitedChunk + */ + CitedChunk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Citations.CitedChunk) + return object; + var message = new $root.google.cloud.ces.v1beta.Citations.CitedChunk(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.title != null) + message.title = String(object.title); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a CitedChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @static + * @param {google.cloud.ces.v1beta.Citations.CitedChunk} message CitedChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CitedChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.uri = ""; + object.title = ""; + object.text = ""; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this CitedChunk to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @instance + * @returns {Object.} JSON object + */ + CitedChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CitedChunk + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CitedChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Citations.CitedChunk"; + }; + + return CitedChunk; + })(); + + return Citations; + })(); + + v1beta.Event = (function() { + + /** + * Properties of an Event. + * @memberof google.cloud.ces.v1beta + * @interface IEvent + * @property {string|null} [event] Event event + */ + + /** + * Constructs a new Event. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an Event. + * @implements IEvent + * @constructor + * @param {google.cloud.ces.v1beta.IEvent=} [properties] Properties to set + */ + function Event(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Event event. + * @member {string} event + * @memberof google.cloud.ces.v1beta.Event + * @instance + */ + Event.prototype.event = ""; + + /** + * Creates a new Event instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Event + * @static + * @param {google.cloud.ces.v1beta.IEvent=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Event} Event instance + */ + Event.create = function create(properties) { + return new Event(properties); + }; + + /** + * Encodes the specified Event message. Does not implicitly {@link google.cloud.ces.v1beta.Event.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Event + * @static + * @param {google.cloud.ces.v1beta.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.event); + return writer; + }; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Event.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Event + * @static + * @param {google.cloud.ces.v1beta.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Event message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Event(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.event = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Event message. + * @function verify + * @memberof google.cloud.ces.v1beta.Event + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Event.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.event != null && message.hasOwnProperty("event")) + if (!$util.isString(message.event)) + return "event: string expected"; + return null; + }; + + /** + * Creates an Event message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Event + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Event} Event + */ + Event.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Event) + return object; + var message = new $root.google.cloud.ces.v1beta.Event(); + if (object.event != null) + message.event = String(object.event); + return message; + }; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Event + * @static + * @param {google.cloud.ces.v1beta.Event} message Event + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Event.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.event = ""; + if (message.event != null && message.hasOwnProperty("event")) + object.event = message.event; + return object; + }; + + /** + * Converts this Event to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Event + * @instance + * @returns {Object.} JSON object + */ + Event.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Event + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Event + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Event.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Event"; + }; + + return Event; + })(); + + v1beta.SessionInput = (function() { + + /** + * Properties of a SessionInput. + * @memberof google.cloud.ces.v1beta + * @interface ISessionInput + * @property {string|null} [text] SessionInput text + * @property {string|null} [dtmf] SessionInput dtmf + * @property {Uint8Array|null} [audio] SessionInput audio + * @property {google.cloud.ces.v1beta.IToolResponses|null} [toolResponses] SessionInput toolResponses + * @property {google.cloud.ces.v1beta.IImage|null} [image] SessionInput image + * @property {google.cloud.ces.v1beta.IBlob|null} [blob] SessionInput blob + * @property {google.protobuf.IStruct|null} [variables] SessionInput variables + * @property {google.cloud.ces.v1beta.IEvent|null} [event] SessionInput event + * @property {boolean|null} [willContinue] SessionInput willContinue + */ + + /** + * Constructs a new SessionInput. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a SessionInput. + * @implements ISessionInput + * @constructor + * @param {google.cloud.ces.v1beta.ISessionInput=} [properties] Properties to set + */ + function SessionInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionInput text. + * @member {string|null|undefined} text + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + SessionInput.prototype.text = null; + + /** + * SessionInput dtmf. + * @member {string|null|undefined} dtmf + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + SessionInput.prototype.dtmf = null; + + /** + * SessionInput audio. + * @member {Uint8Array|null|undefined} audio + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + SessionInput.prototype.audio = null; + + /** + * SessionInput toolResponses. + * @member {google.cloud.ces.v1beta.IToolResponses|null|undefined} toolResponses + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + SessionInput.prototype.toolResponses = null; + + /** + * SessionInput image. + * @member {google.cloud.ces.v1beta.IImage|null|undefined} image + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + SessionInput.prototype.image = null; + + /** + * SessionInput blob. + * @member {google.cloud.ces.v1beta.IBlob|null|undefined} blob + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + SessionInput.prototype.blob = null; + + /** + * SessionInput variables. + * @member {google.protobuf.IStruct|null|undefined} variables + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + SessionInput.prototype.variables = null; + + /** + * SessionInput event. + * @member {google.cloud.ces.v1beta.IEvent|null|undefined} event + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + SessionInput.prototype.event = null; + + /** + * SessionInput willContinue. + * @member {boolean} willContinue + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + SessionInput.prototype.willContinue = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SessionInput inputType. + * @member {"text"|"dtmf"|"audio"|"toolResponses"|"image"|"blob"|"variables"|"event"|undefined} inputType + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + Object.defineProperty(SessionInput.prototype, "inputType", { + get: $util.oneOfGetter($oneOfFields = ["text", "dtmf", "audio", "toolResponses", "image", "blob", "variables", "event"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SessionInput instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.SessionInput + * @static + * @param {google.cloud.ces.v1beta.ISessionInput=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.SessionInput} SessionInput instance + */ + SessionInput.create = function create(properties) { + return new SessionInput(properties); + }; + + /** + * Encodes the specified SessionInput message. Does not implicitly {@link google.cloud.ces.v1beta.SessionInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.SessionInput + * @static + * @param {google.cloud.ces.v1beta.ISessionInput} message SessionInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audio); + if (message.toolResponses != null && Object.hasOwnProperty.call(message, "toolResponses")) + $root.google.cloud.ces.v1beta.ToolResponses.encode(message.toolResponses, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.ces.v1beta.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) + $root.google.protobuf.Struct.encode(message.variables, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.dtmf != null && Object.hasOwnProperty.call(message, "dtmf")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.dtmf); + if (message.blob != null && Object.hasOwnProperty.call(message, "blob")) + $root.google.cloud.ces.v1beta.Blob.encode(message.blob, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.willContinue != null && Object.hasOwnProperty.call(message, "willContinue")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.willContinue); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + $root.google.cloud.ces.v1beta.Event.encode(message.event, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SessionInput message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.SessionInput + * @static + * @param {google.cloud.ces.v1beta.ISessionInput} message SessionInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.SessionInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.SessionInput} SessionInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionInput.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SessionInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 6: { + message.dtmf = reader.string(); + break; + } + case 2: { + message.audio = reader.bytes(); + break; + } + case 3: { + message.toolResponses = $root.google.cloud.ces.v1beta.ToolResponses.decode(reader, reader.uint32()); + break; + } + case 4: { + message.image = $root.google.cloud.ces.v1beta.Image.decode(reader, reader.uint32()); + break; + } + case 7: { + message.blob = $root.google.cloud.ces.v1beta.Blob.decode(reader, reader.uint32()); + break; + } + case 5: { + message.variables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 9: { + message.event = $root.google.cloud.ces.v1beta.Event.decode(reader, reader.uint32()); + break; + } + case 8: { + message.willContinue = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.SessionInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.SessionInput} SessionInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionInput message. + * @function verify + * @memberof google.cloud.ces.v1beta.SessionInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionInput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.inputType = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.dtmf != null && message.hasOwnProperty("dtmf")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + if (!$util.isString(message.dtmf)) + return "dtmf: string expected"; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; + } + if (message.toolResponses != null && message.hasOwnProperty("toolResponses")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolResponses.verify(message.toolResponses); + if (error) + return "toolResponses." + error; + } + } + if (message.image != null && message.hasOwnProperty("image")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + { + var error = $root.google.cloud.ces.v1beta.Image.verify(message.image); + if (error) + return "image." + error; + } + } + if (message.blob != null && message.hasOwnProperty("blob")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + { + var error = $root.google.cloud.ces.v1beta.Blob.verify(message.blob); + if (error) + return "blob." + error; + } + } + if (message.variables != null && message.hasOwnProperty("variables")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + { + var error = $root.google.protobuf.Struct.verify(message.variables); + if (error) + return "variables." + error; + } + } + if (message.event != null && message.hasOwnProperty("event")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + { + var error = $root.google.cloud.ces.v1beta.Event.verify(message.event); + if (error) + return "event." + error; + } + } + if (message.willContinue != null && message.hasOwnProperty("willContinue")) + if (typeof message.willContinue !== "boolean") + return "willContinue: boolean expected"; + return null; + }; + + /** + * Creates a SessionInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.SessionInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.SessionInput} SessionInput + */ + SessionInput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.SessionInput) + return object; + var message = new $root.google.cloud.ces.v1beta.SessionInput(); + if (object.text != null) + message.text = String(object.text); + if (object.dtmf != null) + message.dtmf = String(object.dtmf); + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length >= 0) + message.audio = object.audio; + if (object.toolResponses != null) { + if (typeof object.toolResponses !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionInput.toolResponses: object expected"); + message.toolResponses = $root.google.cloud.ces.v1beta.ToolResponses.fromObject(object.toolResponses); + } + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionInput.image: object expected"); + message.image = $root.google.cloud.ces.v1beta.Image.fromObject(object.image); + } + if (object.blob != null) { + if (typeof object.blob !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionInput.blob: object expected"); + message.blob = $root.google.cloud.ces.v1beta.Blob.fromObject(object.blob); + } + if (object.variables != null) { + if (typeof object.variables !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionInput.variables: object expected"); + message.variables = $root.google.protobuf.Struct.fromObject(object.variables); + } + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionInput.event: object expected"); + message.event = $root.google.cloud.ces.v1beta.Event.fromObject(object.event); + } + if (object.willContinue != null) + message.willContinue = Boolean(object.willContinue); + return message; + }; + + /** + * Creates a plain object from a SessionInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.SessionInput + * @static + * @param {google.cloud.ces.v1beta.SessionInput} message SessionInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.willContinue = false; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.inputType = "text"; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; + if (options.oneofs) + object.inputType = "audio"; + } + if (message.toolResponses != null && message.hasOwnProperty("toolResponses")) { + object.toolResponses = $root.google.cloud.ces.v1beta.ToolResponses.toObject(message.toolResponses, options); + if (options.oneofs) + object.inputType = "toolResponses"; + } + if (message.image != null && message.hasOwnProperty("image")) { + object.image = $root.google.cloud.ces.v1beta.Image.toObject(message.image, options); + if (options.oneofs) + object.inputType = "image"; + } + if (message.variables != null && message.hasOwnProperty("variables")) { + object.variables = $root.google.protobuf.Struct.toObject(message.variables, options); + if (options.oneofs) + object.inputType = "variables"; + } + if (message.dtmf != null && message.hasOwnProperty("dtmf")) { + object.dtmf = message.dtmf; + if (options.oneofs) + object.inputType = "dtmf"; + } + if (message.blob != null && message.hasOwnProperty("blob")) { + object.blob = $root.google.cloud.ces.v1beta.Blob.toObject(message.blob, options); + if (options.oneofs) + object.inputType = "blob"; + } + if (message.willContinue != null && message.hasOwnProperty("willContinue")) + object.willContinue = message.willContinue; + if (message.event != null && message.hasOwnProperty("event")) { + object.event = $root.google.cloud.ces.v1beta.Event.toObject(message.event, options); + if (options.oneofs) + object.inputType = "event"; + } + return object; + }; + + /** + * Converts this SessionInput to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + * @returns {Object.} JSON object + */ + SessionInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionInput + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.SessionInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.SessionInput"; + }; + + return SessionInput; + })(); + + v1beta.SessionOutput = (function() { + + /** + * Properties of a SessionOutput. + * @memberof google.cloud.ces.v1beta + * @interface ISessionOutput + * @property {string|null} [text] SessionOutput text + * @property {Uint8Array|null} [audio] SessionOutput audio + * @property {google.cloud.ces.v1beta.IToolCalls|null} [toolCalls] SessionOutput toolCalls + * @property {google.cloud.ces.v1beta.ICitations|null} [citations] SessionOutput citations + * @property {google.cloud.ces.v1beta.IGoogleSearchSuggestions|null} [googleSearchSuggestions] SessionOutput googleSearchSuggestions + * @property {google.cloud.ces.v1beta.IEndSession|null} [endSession] SessionOutput endSession + * @property {google.protobuf.IStruct|null} [payload] SessionOutput payload + * @property {number|null} [turnIndex] SessionOutput turnIndex + * @property {boolean|null} [turnCompleted] SessionOutput turnCompleted + * @property {google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo|null} [diagnosticInfo] SessionOutput diagnosticInfo + */ + + /** + * Constructs a new SessionOutput. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a SessionOutput. + * @implements ISessionOutput + * @constructor + * @param {google.cloud.ces.v1beta.ISessionOutput=} [properties] Properties to set + */ + function SessionOutput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionOutput text. + * @member {string|null|undefined} text + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.text = null; + + /** + * SessionOutput audio. + * @member {Uint8Array|null|undefined} audio + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.audio = null; + + /** + * SessionOutput toolCalls. + * @member {google.cloud.ces.v1beta.IToolCalls|null|undefined} toolCalls + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.toolCalls = null; + + /** + * SessionOutput citations. + * @member {google.cloud.ces.v1beta.ICitations|null|undefined} citations + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.citations = null; + + /** + * SessionOutput googleSearchSuggestions. + * @member {google.cloud.ces.v1beta.IGoogleSearchSuggestions|null|undefined} googleSearchSuggestions + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.googleSearchSuggestions = null; + + /** + * SessionOutput endSession. + * @member {google.cloud.ces.v1beta.IEndSession|null|undefined} endSession + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.endSession = null; + + /** + * SessionOutput payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.payload = null; + + /** + * SessionOutput turnIndex. + * @member {number} turnIndex + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.turnIndex = 0; + + /** + * SessionOutput turnCompleted. + * @member {boolean} turnCompleted + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.turnCompleted = false; + + /** + * SessionOutput diagnosticInfo. + * @member {google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo|null|undefined} diagnosticInfo + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.diagnosticInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SessionOutput outputType. + * @member {"text"|"audio"|"toolCalls"|"citations"|"googleSearchSuggestions"|"endSession"|"payload"|undefined} outputType + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + Object.defineProperty(SessionOutput.prototype, "outputType", { + get: $util.oneOfGetter($oneOfFields = ["text", "audio", "toolCalls", "citations", "googleSearchSuggestions", "endSession", "payload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SessionOutput instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.SessionOutput + * @static + * @param {google.cloud.ces.v1beta.ISessionOutput=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.SessionOutput} SessionOutput instance + */ + SessionOutput.create = function create(properties) { + return new SessionOutput(properties); + }; + + /** + * Encodes the specified SessionOutput message. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.SessionOutput + * @static + * @param {google.cloud.ces.v1beta.ISessionOutput} message SessionOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionOutput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audio); + if (message.toolCalls != null && Object.hasOwnProperty.call(message, "toolCalls")) + $root.google.cloud.ces.v1beta.ToolCalls.encode(message.toolCalls, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.turnCompleted != null && Object.hasOwnProperty.call(message, "turnCompleted")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.turnCompleted); + if (message.turnIndex != null && Object.hasOwnProperty.call(message, "turnIndex")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.turnIndex); + if (message.diagnosticInfo != null && Object.hasOwnProperty.call(message, "diagnosticInfo")) + $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.encode(message.diagnosticInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.citations != null && Object.hasOwnProperty.call(message, "citations")) + $root.google.cloud.ces.v1beta.Citations.encode(message.citations, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.endSession != null && Object.hasOwnProperty.call(message, "endSession")) + $root.google.cloud.ces.v1beta.EndSession.encode(message.endSession, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.googleSearchSuggestions != null && Object.hasOwnProperty.call(message, "googleSearchSuggestions")) + $root.google.cloud.ces.v1beta.GoogleSearchSuggestions.encode(message.googleSearchSuggestions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SessionOutput message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.SessionOutput + * @static + * @param {google.cloud.ces.v1beta.ISessionOutput} message SessionOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionOutput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionOutput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.SessionOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.SessionOutput} SessionOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionOutput.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SessionOutput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.audio = reader.bytes(); + break; + } + case 3: { + message.toolCalls = $root.google.cloud.ces.v1beta.ToolCalls.decode(reader, reader.uint32()); + break; + } + case 8: { + message.citations = $root.google.cloud.ces.v1beta.Citations.decode(reader, reader.uint32()); + break; + } + case 10: { + message.googleSearchSuggestions = $root.google.cloud.ces.v1beta.GoogleSearchSuggestions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.endSession = $root.google.cloud.ces.v1beta.EndSession.decode(reader, reader.uint32()); + break; + } + case 11: { + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.turnIndex = reader.int32(); + break; + } + case 4: { + message.turnCompleted = reader.bool(); + break; + } + case 7: { + message.diagnosticInfo = $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionOutput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.SessionOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.SessionOutput} SessionOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionOutput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionOutput message. + * @function verify + * @memberof google.cloud.ces.v1beta.SessionOutput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionOutput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.outputType = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + if (properties.outputType === 1) + return "outputType: multiple values"; + properties.outputType = 1; + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; + } + if (message.toolCalls != null && message.hasOwnProperty("toolCalls")) { + if (properties.outputType === 1) + return "outputType: multiple values"; + properties.outputType = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolCalls.verify(message.toolCalls); + if (error) + return "toolCalls." + error; + } + } + if (message.citations != null && message.hasOwnProperty("citations")) { + if (properties.outputType === 1) + return "outputType: multiple values"; + properties.outputType = 1; + { + var error = $root.google.cloud.ces.v1beta.Citations.verify(message.citations); + if (error) + return "citations." + error; + } + } + if (message.googleSearchSuggestions != null && message.hasOwnProperty("googleSearchSuggestions")) { + if (properties.outputType === 1) + return "outputType: multiple values"; + properties.outputType = 1; + { + var error = $root.google.cloud.ces.v1beta.GoogleSearchSuggestions.verify(message.googleSearchSuggestions); + if (error) + return "googleSearchSuggestions." + error; + } + } + if (message.endSession != null && message.hasOwnProperty("endSession")) { + if (properties.outputType === 1) + return "outputType: multiple values"; + properties.outputType = 1; + { + var error = $root.google.cloud.ces.v1beta.EndSession.verify(message.endSession); + if (error) + return "endSession." + error; + } + } + if (message.payload != null && message.hasOwnProperty("payload")) { + if (properties.outputType === 1) + return "outputType: multiple values"; + properties.outputType = 1; + { + var error = $root.google.protobuf.Struct.verify(message.payload); + if (error) + return "payload." + error; + } + } + if (message.turnIndex != null && message.hasOwnProperty("turnIndex")) + if (!$util.isInteger(message.turnIndex)) + return "turnIndex: integer expected"; + if (message.turnCompleted != null && message.hasOwnProperty("turnCompleted")) + if (typeof message.turnCompleted !== "boolean") + return "turnCompleted: boolean expected"; + if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) { + var error = $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.verify(message.diagnosticInfo); + if (error) + return "diagnosticInfo." + error; + } + return null; + }; + + /** + * Creates a SessionOutput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.SessionOutput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.SessionOutput} SessionOutput + */ + SessionOutput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.SessionOutput) + return object; + var message = new $root.google.cloud.ces.v1beta.SessionOutput(); + if (object.text != null) + message.text = String(object.text); + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length >= 0) + message.audio = object.audio; + if (object.toolCalls != null) { + if (typeof object.toolCalls !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionOutput.toolCalls: object expected"); + message.toolCalls = $root.google.cloud.ces.v1beta.ToolCalls.fromObject(object.toolCalls); + } + if (object.citations != null) { + if (typeof object.citations !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionOutput.citations: object expected"); + message.citations = $root.google.cloud.ces.v1beta.Citations.fromObject(object.citations); + } + if (object.googleSearchSuggestions != null) { + if (typeof object.googleSearchSuggestions !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionOutput.googleSearchSuggestions: object expected"); + message.googleSearchSuggestions = $root.google.cloud.ces.v1beta.GoogleSearchSuggestions.fromObject(object.googleSearchSuggestions); + } + if (object.endSession != null) { + if (typeof object.endSession !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionOutput.endSession: object expected"); + message.endSession = $root.google.cloud.ces.v1beta.EndSession.fromObject(object.endSession); + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionOutput.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload); + } + if (object.turnIndex != null) + message.turnIndex = object.turnIndex | 0; + if (object.turnCompleted != null) + message.turnCompleted = Boolean(object.turnCompleted); + if (object.diagnosticInfo != null) { + if (typeof object.diagnosticInfo !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionOutput.diagnosticInfo: object expected"); + message.diagnosticInfo = $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.fromObject(object.diagnosticInfo); + } + return message; + }; + + /** + * Creates a plain object from a SessionOutput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.SessionOutput + * @static + * @param {google.cloud.ces.v1beta.SessionOutput} message SessionOutput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionOutput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.turnCompleted = false; + object.turnIndex = 0; + object.diagnosticInfo = null; + } + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.outputType = "text"; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; + if (options.oneofs) + object.outputType = "audio"; + } + if (message.toolCalls != null && message.hasOwnProperty("toolCalls")) { + object.toolCalls = $root.google.cloud.ces.v1beta.ToolCalls.toObject(message.toolCalls, options); + if (options.oneofs) + object.outputType = "toolCalls"; + } + if (message.turnCompleted != null && message.hasOwnProperty("turnCompleted")) + object.turnCompleted = message.turnCompleted; + if (message.turnIndex != null && message.hasOwnProperty("turnIndex")) + object.turnIndex = message.turnIndex; + if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) + object.diagnosticInfo = $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.toObject(message.diagnosticInfo, options); + if (message.citations != null && message.hasOwnProperty("citations")) { + object.citations = $root.google.cloud.ces.v1beta.Citations.toObject(message.citations, options); + if (options.oneofs) + object.outputType = "citations"; + } + if (message.endSession != null && message.hasOwnProperty("endSession")) { + object.endSession = $root.google.cloud.ces.v1beta.EndSession.toObject(message.endSession, options); + if (options.oneofs) + object.outputType = "endSession"; + } + if (message.googleSearchSuggestions != null && message.hasOwnProperty("googleSearchSuggestions")) { + object.googleSearchSuggestions = $root.google.cloud.ces.v1beta.GoogleSearchSuggestions.toObject(message.googleSearchSuggestions, options); + if (options.oneofs) + object.outputType = "googleSearchSuggestions"; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (options.oneofs) + object.outputType = "payload"; + } + return object; + }; + + /** + * Converts this SessionOutput to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + * @returns {Object.} JSON object + */ + SessionOutput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionOutput + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.SessionOutput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.SessionOutput"; + }; + + SessionOutput.DiagnosticInfo = (function() { + + /** + * Properties of a DiagnosticInfo. + * @memberof google.cloud.ces.v1beta.SessionOutput + * @interface IDiagnosticInfo + * @property {Array.|null} [messages] DiagnosticInfo messages + * @property {google.cloud.ces.v1beta.ISpan|null} [rootSpan] DiagnosticInfo rootSpan + */ + + /** + * Constructs a new DiagnosticInfo. + * @memberof google.cloud.ces.v1beta.SessionOutput + * @classdesc Represents a DiagnosticInfo. + * @implements IDiagnosticInfo + * @constructor + * @param {google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo=} [properties] Properties to set + */ + function DiagnosticInfo(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiagnosticInfo messages. + * @member {Array.} messages + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @instance + */ + DiagnosticInfo.prototype.messages = $util.emptyArray; + + /** + * DiagnosticInfo rootSpan. + * @member {google.cloud.ces.v1beta.ISpan|null|undefined} rootSpan + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @instance + */ + DiagnosticInfo.prototype.rootSpan = null; + + /** + * Creates a new DiagnosticInfo instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @static + * @param {google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo} DiagnosticInfo instance + */ + DiagnosticInfo.create = function create(properties) { + return new DiagnosticInfo(properties); + }; + + /** + * Encodes the specified DiagnosticInfo message. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @static + * @param {google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo} message DiagnosticInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiagnosticInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.ces.v1beta.Message.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rootSpan != null && Object.hasOwnProperty.call(message, "rootSpan")) + $root.google.cloud.ces.v1beta.Span.encode(message.rootSpan, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DiagnosticInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @static + * @param {google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo} message DiagnosticInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiagnosticInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiagnosticInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo} DiagnosticInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiagnosticInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32())); + break; + } + case 3: { + message.rootSpan = $root.google.cloud.ces.v1beta.Span.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiagnosticInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo} DiagnosticInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiagnosticInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiagnosticInfo message. + * @function verify + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiagnosticInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) { + var error = $root.google.cloud.ces.v1beta.Span.verify(message.rootSpan); + if (error) + return "rootSpan." + error; + } + return null; + }; + + /** + * Creates a DiagnosticInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo} DiagnosticInfo + */ + DiagnosticInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo) + return object; + var message = new $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.messages: object expected"); + message.messages[i] = $root.google.cloud.ces.v1beta.Message.fromObject(object.messages[i]); + } + } + if (object.rootSpan != null) { + if (typeof object.rootSpan !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.rootSpan: object expected"); + message.rootSpan = $root.google.cloud.ces.v1beta.Span.fromObject(object.rootSpan); + } + return message; + }; + + /** + * Creates a plain object from a DiagnosticInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @static + * @param {google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo} message DiagnosticInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiagnosticInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) + object.rootSpan = null; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.ces.v1beta.Message.toObject(message.messages[j], options); + } + if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) + object.rootSpan = $root.google.cloud.ces.v1beta.Span.toObject(message.rootSpan, options); + return object; + }; + + /** + * Converts this DiagnosticInfo to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @instance + * @returns {Object.} JSON object + */ + DiagnosticInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DiagnosticInfo + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DiagnosticInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo"; + }; + + return DiagnosticInfo; + })(); + + return SessionOutput; + })(); + + v1beta.RecognitionResult = (function() { + + /** + * Properties of a RecognitionResult. + * @memberof google.cloud.ces.v1beta + * @interface IRecognitionResult + * @property {string|null} [transcript] RecognitionResult transcript + */ + + /** + * Constructs a new RecognitionResult. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RecognitionResult. + * @implements IRecognitionResult + * @constructor + * @param {google.cloud.ces.v1beta.IRecognitionResult=} [properties] Properties to set + */ + function RecognitionResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognitionResult transcript. + * @member {string} transcript + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @instance + */ + RecognitionResult.prototype.transcript = ""; + + /** + * Creates a new RecognitionResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @static + * @param {google.cloud.ces.v1beta.IRecognitionResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RecognitionResult} RecognitionResult instance + */ + RecognitionResult.create = function create(properties) { + return new RecognitionResult(properties); + }; + + /** + * Encodes the specified RecognitionResult message. Does not implicitly {@link google.cloud.ces.v1beta.RecognitionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @static + * @param {google.cloud.ces.v1beta.IRecognitionResult} message RecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.transcript); + return writer; + }; + + /** + * Encodes the specified RecognitionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RecognitionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @static + * @param {google.cloud.ces.v1beta.IRecognitionResult} message RecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognitionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RecognitionResult} RecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RecognitionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.transcript = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognitionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RecognitionResult} RecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognitionResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognitionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transcript != null && message.hasOwnProperty("transcript")) + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + return null; + }; + + /** + * Creates a RecognitionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RecognitionResult} RecognitionResult + */ + RecognitionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RecognitionResult) + return object; + var message = new $root.google.cloud.ces.v1beta.RecognitionResult(); + if (object.transcript != null) + message.transcript = String(object.transcript); + return message; + }; + + /** + * Creates a plain object from a RecognitionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @static + * @param {google.cloud.ces.v1beta.RecognitionResult} message RecognitionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognitionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.transcript = ""; + if (message.transcript != null && message.hasOwnProperty("transcript")) + object.transcript = message.transcript; + return object; + }; + + /** + * Converts this RecognitionResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @instance + * @returns {Object.} JSON object + */ + RecognitionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognitionResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognitionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RecognitionResult"; + }; + + return RecognitionResult; + })(); + + v1beta.InterruptionSignal = (function() { + + /** + * Properties of an InterruptionSignal. + * @memberof google.cloud.ces.v1beta + * @interface IInterruptionSignal + * @property {boolean|null} [bargeIn] InterruptionSignal bargeIn + */ + + /** + * Constructs a new InterruptionSignal. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an InterruptionSignal. + * @implements IInterruptionSignal + * @constructor + * @param {google.cloud.ces.v1beta.IInterruptionSignal=} [properties] Properties to set + */ + function InterruptionSignal(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterruptionSignal bargeIn. + * @member {boolean} bargeIn + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @instance + */ + InterruptionSignal.prototype.bargeIn = false; + + /** + * Creates a new InterruptionSignal instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @static + * @param {google.cloud.ces.v1beta.IInterruptionSignal=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.InterruptionSignal} InterruptionSignal instance + */ + InterruptionSignal.create = function create(properties) { + return new InterruptionSignal(properties); + }; + + /** + * Encodes the specified InterruptionSignal message. Does not implicitly {@link google.cloud.ces.v1beta.InterruptionSignal.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @static + * @param {google.cloud.ces.v1beta.IInterruptionSignal} message InterruptionSignal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterruptionSignal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bargeIn != null && Object.hasOwnProperty.call(message, "bargeIn")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.bargeIn); + return writer; + }; + + /** + * Encodes the specified InterruptionSignal message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.InterruptionSignal.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @static + * @param {google.cloud.ces.v1beta.IInterruptionSignal} message InterruptionSignal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterruptionSignal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterruptionSignal message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.InterruptionSignal} InterruptionSignal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterruptionSignal.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.InterruptionSignal(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bargeIn = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterruptionSignal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.InterruptionSignal} InterruptionSignal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterruptionSignal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterruptionSignal message. + * @function verify + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterruptionSignal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bargeIn != null && message.hasOwnProperty("bargeIn")) + if (typeof message.bargeIn !== "boolean") + return "bargeIn: boolean expected"; + return null; + }; + + /** + * Creates an InterruptionSignal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.InterruptionSignal} InterruptionSignal + */ + InterruptionSignal.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.InterruptionSignal) + return object; + var message = new $root.google.cloud.ces.v1beta.InterruptionSignal(); + if (object.bargeIn != null) + message.bargeIn = Boolean(object.bargeIn); + return message; + }; + + /** + * Creates a plain object from an InterruptionSignal message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @static + * @param {google.cloud.ces.v1beta.InterruptionSignal} message InterruptionSignal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterruptionSignal.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.bargeIn = false; + if (message.bargeIn != null && message.hasOwnProperty("bargeIn")) + object.bargeIn = message.bargeIn; + return object; + }; + + /** + * Converts this InterruptionSignal to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @instance + * @returns {Object.} JSON object + */ + InterruptionSignal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InterruptionSignal + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InterruptionSignal.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.InterruptionSignal"; + }; + + return InterruptionSignal; + })(); + + v1beta.EndSession = (function() { + + /** + * Properties of an EndSession. + * @memberof google.cloud.ces.v1beta + * @interface IEndSession + * @property {google.protobuf.IStruct|null} [metadata] EndSession metadata + */ + + /** + * Constructs a new EndSession. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EndSession. + * @implements IEndSession + * @constructor + * @param {google.cloud.ces.v1beta.IEndSession=} [properties] Properties to set + */ + function EndSession(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndSession metadata. + * @member {google.protobuf.IStruct|null|undefined} metadata + * @memberof google.cloud.ces.v1beta.EndSession + * @instance + */ + EndSession.prototype.metadata = null; + + /** + * Creates a new EndSession instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EndSession + * @static + * @param {google.cloud.ces.v1beta.IEndSession=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EndSession} EndSession instance + */ + EndSession.create = function create(properties) { + return new EndSession(properties); + }; + + /** + * Encodes the specified EndSession message. Does not implicitly {@link google.cloud.ces.v1beta.EndSession.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EndSession + * @static + * @param {google.cloud.ces.v1beta.IEndSession} message EndSession message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndSession.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EndSession message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndSession.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EndSession + * @static + * @param {google.cloud.ces.v1beta.IEndSession} message EndSession message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndSession.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndSession message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EndSession + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EndSession} EndSession + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndSession.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EndSession(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndSession message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EndSession + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EndSession} EndSession + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndSession.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndSession message. + * @function verify + * @memberof google.cloud.ces.v1beta.EndSession + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndSession.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Struct.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates an EndSession message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EndSession + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EndSession} EndSession + */ + EndSession.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EndSession) + return object; + var message = new $root.google.cloud.ces.v1beta.EndSession(); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.ces.v1beta.EndSession.metadata: object expected"); + message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from an EndSession message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EndSession + * @static + * @param {google.cloud.ces.v1beta.EndSession} message EndSession + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndSession.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this EndSession to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EndSession + * @instance + * @returns {Object.} JSON object + */ + EndSession.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndSession + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EndSession + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndSession.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EndSession"; + }; + + return EndSession; + })(); + + v1beta.GoAway = (function() { + + /** + * Properties of a GoAway. + * @memberof google.cloud.ces.v1beta + * @interface IGoAway + */ + + /** + * Constructs a new GoAway. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GoAway. + * @implements IGoAway + * @constructor + * @param {google.cloud.ces.v1beta.IGoAway=} [properties] Properties to set + */ + function GoAway(properties) { + if (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 GoAway instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GoAway + * @static + * @param {google.cloud.ces.v1beta.IGoAway=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GoAway} GoAway instance + */ + GoAway.create = function create(properties) { + return new GoAway(properties); + }; + + /** + * Encodes the specified GoAway message. Does not implicitly {@link google.cloud.ces.v1beta.GoAway.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GoAway + * @static + * @param {google.cloud.ces.v1beta.IGoAway} message GoAway message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoAway.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GoAway message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoAway.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GoAway + * @static + * @param {google.cloud.ces.v1beta.IGoAway} message GoAway message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoAway.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoAway message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GoAway + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GoAway} GoAway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoAway.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GoAway(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoAway message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GoAway + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GoAway} GoAway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoAway.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoAway message. + * @function verify + * @memberof google.cloud.ces.v1beta.GoAway + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoAway.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GoAway message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GoAway + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GoAway} GoAway + */ + GoAway.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GoAway) + return object; + return new $root.google.cloud.ces.v1beta.GoAway(); + }; + + /** + * Creates a plain object from a GoAway message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GoAway + * @static + * @param {google.cloud.ces.v1beta.GoAway} message GoAway + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoAway.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GoAway to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GoAway + * @instance + * @returns {Object.} JSON object + */ + GoAway.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoAway + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GoAway + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoAway.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GoAway"; + }; + + return GoAway; + })(); + + v1beta.RunSessionRequest = (function() { + + /** + * Properties of a RunSessionRequest. + * @memberof google.cloud.ces.v1beta + * @interface IRunSessionRequest + * @property {google.cloud.ces.v1beta.ISessionConfig|null} [config] RunSessionRequest config + * @property {Array.|null} [inputs] RunSessionRequest inputs + */ + + /** + * Constructs a new RunSessionRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RunSessionRequest. + * @implements IRunSessionRequest + * @constructor + * @param {google.cloud.ces.v1beta.IRunSessionRequest=} [properties] Properties to set + */ + function RunSessionRequest(properties) { + this.inputs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunSessionRequest config. + * @member {google.cloud.ces.v1beta.ISessionConfig|null|undefined} config + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @instance + */ + RunSessionRequest.prototype.config = null; + + /** + * RunSessionRequest inputs. + * @member {Array.} inputs + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @instance + */ + RunSessionRequest.prototype.inputs = $util.emptyArray; + + /** + * Creates a new RunSessionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @static + * @param {google.cloud.ces.v1beta.IRunSessionRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RunSessionRequest} RunSessionRequest instance + */ + RunSessionRequest.create = function create(properties) { + return new RunSessionRequest(properties); + }; + + /** + * Encodes the specified RunSessionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @static + * @param {google.cloud.ces.v1beta.IRunSessionRequest} message RunSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunSessionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.ces.v1beta.SessionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.inputs != null && message.inputs.length) + for (var i = 0; i < message.inputs.length; ++i) + $root.google.cloud.ces.v1beta.SessionInput.encode(message.inputs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunSessionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @static + * @param {google.cloud.ces.v1beta.IRunSessionRequest} message RunSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunSessionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RunSessionRequest} RunSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunSessionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RunSessionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.ces.v1beta.SessionConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.inputs && message.inputs.length)) + message.inputs = []; + message.inputs.push($root.google.cloud.ces.v1beta.SessionInput.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunSessionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RunSessionRequest} RunSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunSessionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunSessionRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunSessionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.ces.v1beta.SessionConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.inputs != null && message.hasOwnProperty("inputs")) { + if (!Array.isArray(message.inputs)) + return "inputs: array expected"; + for (var i = 0; i < message.inputs.length; ++i) { + var error = $root.google.cloud.ces.v1beta.SessionInput.verify(message.inputs[i]); + if (error) + return "inputs." + error; + } + } + return null; + }; + + /** + * Creates a RunSessionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RunSessionRequest} RunSessionRequest + */ + RunSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RunSessionRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.RunSessionRequest(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.ces.v1beta.RunSessionRequest.config: object expected"); + message.config = $root.google.cloud.ces.v1beta.SessionConfig.fromObject(object.config); + } + if (object.inputs) { + if (!Array.isArray(object.inputs)) + throw TypeError(".google.cloud.ces.v1beta.RunSessionRequest.inputs: array expected"); + message.inputs = []; + for (var i = 0; i < object.inputs.length; ++i) { + if (typeof object.inputs[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.RunSessionRequest.inputs: object expected"); + message.inputs[i] = $root.google.cloud.ces.v1beta.SessionInput.fromObject(object.inputs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RunSessionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @static + * @param {google.cloud.ces.v1beta.RunSessionRequest} message RunSessionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunSessionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inputs = []; + if (options.defaults) + object.config = null; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.ces.v1beta.SessionConfig.toObject(message.config, options); + if (message.inputs && message.inputs.length) { + object.inputs = []; + for (var j = 0; j < message.inputs.length; ++j) + object.inputs[j] = $root.google.cloud.ces.v1beta.SessionInput.toObject(message.inputs[j], options); + } + return object; + }; + + /** + * Converts this RunSessionRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @instance + * @returns {Object.} JSON object + */ + RunSessionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunSessionRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RunSessionRequest"; + }; + + return RunSessionRequest; + })(); + + v1beta.RunSessionResponse = (function() { + + /** + * Properties of a RunSessionResponse. + * @memberof google.cloud.ces.v1beta + * @interface IRunSessionResponse + * @property {Array.|null} [outputs] RunSessionResponse outputs + */ + + /** + * Constructs a new RunSessionResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RunSessionResponse. + * @implements IRunSessionResponse + * @constructor + * @param {google.cloud.ces.v1beta.IRunSessionResponse=} [properties] Properties to set + */ + function RunSessionResponse(properties) { + this.outputs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunSessionResponse outputs. + * @member {Array.} outputs + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @instance + */ + RunSessionResponse.prototype.outputs = $util.emptyArray; + + /** + * Creates a new RunSessionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @static + * @param {google.cloud.ces.v1beta.IRunSessionResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RunSessionResponse} RunSessionResponse instance + */ + RunSessionResponse.create = function create(properties) { + return new RunSessionResponse(properties); + }; + + /** + * Encodes the specified RunSessionResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @static + * @param {google.cloud.ces.v1beta.IRunSessionResponse} message RunSessionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunSessionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputs != null && message.outputs.length) + for (var i = 0; i < message.outputs.length; ++i) + $root.google.cloud.ces.v1beta.SessionOutput.encode(message.outputs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunSessionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @static + * @param {google.cloud.ces.v1beta.IRunSessionResponse} message RunSessionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunSessionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunSessionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RunSessionResponse} RunSessionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunSessionResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RunSessionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.outputs && message.outputs.length)) + message.outputs = []; + message.outputs.push($root.google.cloud.ces.v1beta.SessionOutput.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunSessionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RunSessionResponse} RunSessionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunSessionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunSessionResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunSessionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputs != null && message.hasOwnProperty("outputs")) { + if (!Array.isArray(message.outputs)) + return "outputs: array expected"; + for (var i = 0; i < message.outputs.length; ++i) { + var error = $root.google.cloud.ces.v1beta.SessionOutput.verify(message.outputs[i]); + if (error) + return "outputs." + error; + } + } + return null; + }; + + /** + * Creates a RunSessionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RunSessionResponse} RunSessionResponse + */ + RunSessionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RunSessionResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.RunSessionResponse(); + if (object.outputs) { + if (!Array.isArray(object.outputs)) + throw TypeError(".google.cloud.ces.v1beta.RunSessionResponse.outputs: array expected"); + message.outputs = []; + for (var i = 0; i < object.outputs.length; ++i) { + if (typeof object.outputs[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.RunSessionResponse.outputs: object expected"); + message.outputs[i] = $root.google.cloud.ces.v1beta.SessionOutput.fromObject(object.outputs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RunSessionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @static + * @param {google.cloud.ces.v1beta.RunSessionResponse} message RunSessionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunSessionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.outputs = []; + if (message.outputs && message.outputs.length) { + object.outputs = []; + for (var j = 0; j < message.outputs.length; ++j) + object.outputs[j] = $root.google.cloud.ces.v1beta.SessionOutput.toObject(message.outputs[j], options); + } + return object; + }; + + /** + * Converts this RunSessionResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @instance + * @returns {Object.} JSON object + */ + RunSessionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunSessionResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunSessionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RunSessionResponse"; + }; + + return RunSessionResponse; + })(); + + v1beta.BidiSessionClientMessage = (function() { + + /** + * Properties of a BidiSessionClientMessage. + * @memberof google.cloud.ces.v1beta + * @interface IBidiSessionClientMessage + * @property {google.cloud.ces.v1beta.ISessionConfig|null} [config] BidiSessionClientMessage config + * @property {google.cloud.ces.v1beta.ISessionInput|null} [realtimeInput] BidiSessionClientMessage realtimeInput + */ + + /** + * Constructs a new BidiSessionClientMessage. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a BidiSessionClientMessage. + * @implements IBidiSessionClientMessage + * @constructor + * @param {google.cloud.ces.v1beta.IBidiSessionClientMessage=} [properties] Properties to set + */ + function BidiSessionClientMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiSessionClientMessage config. + * @member {google.cloud.ces.v1beta.ISessionConfig|null|undefined} config + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @instance + */ + BidiSessionClientMessage.prototype.config = null; + + /** + * BidiSessionClientMessage realtimeInput. + * @member {google.cloud.ces.v1beta.ISessionInput|null|undefined} realtimeInput + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @instance + */ + BidiSessionClientMessage.prototype.realtimeInput = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BidiSessionClientMessage messageType. + * @member {"config"|"realtimeInput"|undefined} messageType + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @instance + */ + Object.defineProperty(BidiSessionClientMessage.prototype, "messageType", { + get: $util.oneOfGetter($oneOfFields = ["config", "realtimeInput"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BidiSessionClientMessage instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @static + * @param {google.cloud.ces.v1beta.IBidiSessionClientMessage=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.BidiSessionClientMessage} BidiSessionClientMessage instance + */ + BidiSessionClientMessage.create = function create(properties) { + return new BidiSessionClientMessage(properties); + }; + + /** + * Encodes the specified BidiSessionClientMessage message. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionClientMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @static + * @param {google.cloud.ces.v1beta.IBidiSessionClientMessage} message BidiSessionClientMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiSessionClientMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.ces.v1beta.SessionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.realtimeInput != null && Object.hasOwnProperty.call(message, "realtimeInput")) + $root.google.cloud.ces.v1beta.SessionInput.encode(message.realtimeInput, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BidiSessionClientMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionClientMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @static + * @param {google.cloud.ces.v1beta.IBidiSessionClientMessage} message BidiSessionClientMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiSessionClientMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiSessionClientMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.BidiSessionClientMessage} BidiSessionClientMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiSessionClientMessage.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BidiSessionClientMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.ces.v1beta.SessionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.realtimeInput = $root.google.cloud.ces.v1beta.SessionInput.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiSessionClientMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.BidiSessionClientMessage} BidiSessionClientMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiSessionClientMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiSessionClientMessage message. + * @function verify + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiSessionClientMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.config != null && message.hasOwnProperty("config")) { + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1beta.SessionConfig.verify(message.config); + if (error) + return "config." + error; + } + } + if (message.realtimeInput != null && message.hasOwnProperty("realtimeInput")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1beta.SessionInput.verify(message.realtimeInput); + if (error) + return "realtimeInput." + error; + } + } + return null; + }; + + /** + * Creates a BidiSessionClientMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.BidiSessionClientMessage} BidiSessionClientMessage + */ + BidiSessionClientMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.BidiSessionClientMessage) + return object; + var message = new $root.google.cloud.ces.v1beta.BidiSessionClientMessage(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.ces.v1beta.BidiSessionClientMessage.config: object expected"); + message.config = $root.google.cloud.ces.v1beta.SessionConfig.fromObject(object.config); + } + if (object.realtimeInput != null) { + if (typeof object.realtimeInput !== "object") + throw TypeError(".google.cloud.ces.v1beta.BidiSessionClientMessage.realtimeInput: object expected"); + message.realtimeInput = $root.google.cloud.ces.v1beta.SessionInput.fromObject(object.realtimeInput); + } + return message; + }; + + /** + * Creates a plain object from a BidiSessionClientMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @static + * @param {google.cloud.ces.v1beta.BidiSessionClientMessage} message BidiSessionClientMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiSessionClientMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.config != null && message.hasOwnProperty("config")) { + object.config = $root.google.cloud.ces.v1beta.SessionConfig.toObject(message.config, options); + if (options.oneofs) + object.messageType = "config"; + } + if (message.realtimeInput != null && message.hasOwnProperty("realtimeInput")) { + object.realtimeInput = $root.google.cloud.ces.v1beta.SessionInput.toObject(message.realtimeInput, options); + if (options.oneofs) + object.messageType = "realtimeInput"; + } + return object; + }; + + /** + * Converts this BidiSessionClientMessage to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @instance + * @returns {Object.} JSON object + */ + BidiSessionClientMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiSessionClientMessage + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiSessionClientMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.BidiSessionClientMessage"; + }; + + return BidiSessionClientMessage; + })(); + + v1beta.BidiSessionServerMessage = (function() { + + /** + * Properties of a BidiSessionServerMessage. + * @memberof google.cloud.ces.v1beta + * @interface IBidiSessionServerMessage + * @property {google.cloud.ces.v1beta.ISessionOutput|null} [sessionOutput] BidiSessionServerMessage sessionOutput + * @property {google.cloud.ces.v1beta.IRecognitionResult|null} [recognitionResult] BidiSessionServerMessage recognitionResult + * @property {google.cloud.ces.v1beta.IInterruptionSignal|null} [interruptionSignal] BidiSessionServerMessage interruptionSignal + * @property {google.cloud.ces.v1beta.IEndSession|null} [endSession] BidiSessionServerMessage endSession + * @property {google.cloud.ces.v1beta.IGoAway|null} [goAway] BidiSessionServerMessage goAway + */ + + /** + * Constructs a new BidiSessionServerMessage. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a BidiSessionServerMessage. + * @implements IBidiSessionServerMessage + * @constructor + * @param {google.cloud.ces.v1beta.IBidiSessionServerMessage=} [properties] Properties to set + */ + function BidiSessionServerMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiSessionServerMessage sessionOutput. + * @member {google.cloud.ces.v1beta.ISessionOutput|null|undefined} sessionOutput + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @instance + */ + BidiSessionServerMessage.prototype.sessionOutput = null; + + /** + * BidiSessionServerMessage recognitionResult. + * @member {google.cloud.ces.v1beta.IRecognitionResult|null|undefined} recognitionResult + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @instance + */ + BidiSessionServerMessage.prototype.recognitionResult = null; + + /** + * BidiSessionServerMessage interruptionSignal. + * @member {google.cloud.ces.v1beta.IInterruptionSignal|null|undefined} interruptionSignal + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @instance + */ + BidiSessionServerMessage.prototype.interruptionSignal = null; + + /** + * BidiSessionServerMessage endSession. + * @member {google.cloud.ces.v1beta.IEndSession|null|undefined} endSession + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @instance + */ + BidiSessionServerMessage.prototype.endSession = null; + + /** + * BidiSessionServerMessage goAway. + * @member {google.cloud.ces.v1beta.IGoAway|null|undefined} goAway + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @instance + */ + BidiSessionServerMessage.prototype.goAway = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BidiSessionServerMessage messageType. + * @member {"sessionOutput"|"recognitionResult"|"interruptionSignal"|"endSession"|"goAway"|undefined} messageType + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @instance + */ + Object.defineProperty(BidiSessionServerMessage.prototype, "messageType", { + get: $util.oneOfGetter($oneOfFields = ["sessionOutput", "recognitionResult", "interruptionSignal", "endSession", "goAway"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BidiSessionServerMessage instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @static + * @param {google.cloud.ces.v1beta.IBidiSessionServerMessage=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.BidiSessionServerMessage} BidiSessionServerMessage instance + */ + BidiSessionServerMessage.create = function create(properties) { + return new BidiSessionServerMessage(properties); + }; + + /** + * Encodes the specified BidiSessionServerMessage message. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionServerMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @static + * @param {google.cloud.ces.v1beta.IBidiSessionServerMessage} message BidiSessionServerMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiSessionServerMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessionOutput != null && Object.hasOwnProperty.call(message, "sessionOutput")) + $root.google.cloud.ces.v1beta.SessionOutput.encode(message.sessionOutput, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.recognitionResult != null && Object.hasOwnProperty.call(message, "recognitionResult")) + $root.google.cloud.ces.v1beta.RecognitionResult.encode(message.recognitionResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.interruptionSignal != null && Object.hasOwnProperty.call(message, "interruptionSignal")) + $root.google.cloud.ces.v1beta.InterruptionSignal.encode(message.interruptionSignal, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endSession != null && Object.hasOwnProperty.call(message, "endSession")) + $root.google.cloud.ces.v1beta.EndSession.encode(message.endSession, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.goAway != null && Object.hasOwnProperty.call(message, "goAway")) + $root.google.cloud.ces.v1beta.GoAway.encode(message.goAway, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BidiSessionServerMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionServerMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @static + * @param {google.cloud.ces.v1beta.IBidiSessionServerMessage} message BidiSessionServerMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiSessionServerMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiSessionServerMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.BidiSessionServerMessage} BidiSessionServerMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiSessionServerMessage.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BidiSessionServerMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sessionOutput = $root.google.cloud.ces.v1beta.SessionOutput.decode(reader, reader.uint32()); + break; + } + case 2: { + message.recognitionResult = $root.google.cloud.ces.v1beta.RecognitionResult.decode(reader, reader.uint32()); + break; + } + case 3: { + message.interruptionSignal = $root.google.cloud.ces.v1beta.InterruptionSignal.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endSession = $root.google.cloud.ces.v1beta.EndSession.decode(reader, reader.uint32()); + break; + } + case 6: { + message.goAway = $root.google.cloud.ces.v1beta.GoAway.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiSessionServerMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.BidiSessionServerMessage} BidiSessionServerMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiSessionServerMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiSessionServerMessage message. + * @function verify + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiSessionServerMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sessionOutput != null && message.hasOwnProperty("sessionOutput")) { + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1beta.SessionOutput.verify(message.sessionOutput); + if (error) + return "sessionOutput." + error; + } + } + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1beta.RecognitionResult.verify(message.recognitionResult); + if (error) + return "recognitionResult." + error; + } + } + if (message.interruptionSignal != null && message.hasOwnProperty("interruptionSignal")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1beta.InterruptionSignal.verify(message.interruptionSignal); + if (error) + return "interruptionSignal." + error; + } + } + if (message.endSession != null && message.hasOwnProperty("endSession")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1beta.EndSession.verify(message.endSession); + if (error) + return "endSession." + error; + } + } + if (message.goAway != null && message.hasOwnProperty("goAway")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1beta.GoAway.verify(message.goAway); + if (error) + return "goAway." + error; + } + } + return null; + }; + + /** + * Creates a BidiSessionServerMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.BidiSessionServerMessage} BidiSessionServerMessage + */ + BidiSessionServerMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.BidiSessionServerMessage) + return object; + var message = new $root.google.cloud.ces.v1beta.BidiSessionServerMessage(); + if (object.sessionOutput != null) { + if (typeof object.sessionOutput !== "object") + throw TypeError(".google.cloud.ces.v1beta.BidiSessionServerMessage.sessionOutput: object expected"); + message.sessionOutput = $root.google.cloud.ces.v1beta.SessionOutput.fromObject(object.sessionOutput); + } + if (object.recognitionResult != null) { + if (typeof object.recognitionResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.BidiSessionServerMessage.recognitionResult: object expected"); + message.recognitionResult = $root.google.cloud.ces.v1beta.RecognitionResult.fromObject(object.recognitionResult); + } + if (object.interruptionSignal != null) { + if (typeof object.interruptionSignal !== "object") + throw TypeError(".google.cloud.ces.v1beta.BidiSessionServerMessage.interruptionSignal: object expected"); + message.interruptionSignal = $root.google.cloud.ces.v1beta.InterruptionSignal.fromObject(object.interruptionSignal); + } + if (object.endSession != null) { + if (typeof object.endSession !== "object") + throw TypeError(".google.cloud.ces.v1beta.BidiSessionServerMessage.endSession: object expected"); + message.endSession = $root.google.cloud.ces.v1beta.EndSession.fromObject(object.endSession); + } + if (object.goAway != null) { + if (typeof object.goAway !== "object") + throw TypeError(".google.cloud.ces.v1beta.BidiSessionServerMessage.goAway: object expected"); + message.goAway = $root.google.cloud.ces.v1beta.GoAway.fromObject(object.goAway); + } + return message; + }; + + /** + * Creates a plain object from a BidiSessionServerMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @static + * @param {google.cloud.ces.v1beta.BidiSessionServerMessage} message BidiSessionServerMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiSessionServerMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.sessionOutput != null && message.hasOwnProperty("sessionOutput")) { + object.sessionOutput = $root.google.cloud.ces.v1beta.SessionOutput.toObject(message.sessionOutput, options); + if (options.oneofs) + object.messageType = "sessionOutput"; + } + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { + object.recognitionResult = $root.google.cloud.ces.v1beta.RecognitionResult.toObject(message.recognitionResult, options); + if (options.oneofs) + object.messageType = "recognitionResult"; + } + if (message.interruptionSignal != null && message.hasOwnProperty("interruptionSignal")) { + object.interruptionSignal = $root.google.cloud.ces.v1beta.InterruptionSignal.toObject(message.interruptionSignal, options); + if (options.oneofs) + object.messageType = "interruptionSignal"; + } + if (message.endSession != null && message.hasOwnProperty("endSession")) { + object.endSession = $root.google.cloud.ces.v1beta.EndSession.toObject(message.endSession, options); + if (options.oneofs) + object.messageType = "endSession"; + } + if (message.goAway != null && message.hasOwnProperty("goAway")) { + object.goAway = $root.google.cloud.ces.v1beta.GoAway.toObject(message.goAway, options); + if (options.oneofs) + object.messageType = "goAway"; + } + return object; + }; + + /** + * Converts this BidiSessionServerMessage to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @instance + * @returns {Object.} JSON object + */ + BidiSessionServerMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiSessionServerMessage + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiSessionServerMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.BidiSessionServerMessage"; + }; + + return BidiSessionServerMessage; + })(); + + v1beta.GoogleSearchSuggestions = (function() { + + /** + * Properties of a GoogleSearchSuggestions. + * @memberof google.cloud.ces.v1beta + * @interface IGoogleSearchSuggestions + * @property {Array.|null} [htmls] GoogleSearchSuggestions htmls + * @property {Array.|null} [webSearchQueries] GoogleSearchSuggestions webSearchQueries + */ + + /** + * Constructs a new GoogleSearchSuggestions. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GoogleSearchSuggestions. + * @implements IGoogleSearchSuggestions + * @constructor + * @param {google.cloud.ces.v1beta.IGoogleSearchSuggestions=} [properties] Properties to set + */ + function GoogleSearchSuggestions(properties) { + this.htmls = []; + this.webSearchQueries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoogleSearchSuggestions htmls. + * @member {Array.} htmls + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @instance + */ + GoogleSearchSuggestions.prototype.htmls = $util.emptyArray; + + /** + * GoogleSearchSuggestions webSearchQueries. + * @member {Array.} webSearchQueries + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @instance + */ + GoogleSearchSuggestions.prototype.webSearchQueries = $util.emptyArray; + + /** + * Creates a new GoogleSearchSuggestions instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @static + * @param {google.cloud.ces.v1beta.IGoogleSearchSuggestions=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GoogleSearchSuggestions} GoogleSearchSuggestions instance + */ + GoogleSearchSuggestions.create = function create(properties) { + return new GoogleSearchSuggestions(properties); + }; + + /** + * Encodes the specified GoogleSearchSuggestions message. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchSuggestions.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @static + * @param {google.cloud.ces.v1beta.IGoogleSearchSuggestions} message GoogleSearchSuggestions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearchSuggestions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.htmls != null && message.htmls.length) + for (var i = 0; i < message.htmls.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.htmls[i]); + if (message.webSearchQueries != null && message.webSearchQueries.length) + for (var i = 0; i < message.webSearchQueries.length; ++i) + $root.google.cloud.ces.v1beta.WebSearchQuery.encode(message.webSearchQueries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoogleSearchSuggestions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchSuggestions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @static + * @param {google.cloud.ces.v1beta.IGoogleSearchSuggestions} message GoogleSearchSuggestions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearchSuggestions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoogleSearchSuggestions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GoogleSearchSuggestions} GoogleSearchSuggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearchSuggestions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GoogleSearchSuggestions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.htmls && message.htmls.length)) + message.htmls = []; + message.htmls.push(reader.string()); + break; + } + case 2: { + if (!(message.webSearchQueries && message.webSearchQueries.length)) + message.webSearchQueries = []; + message.webSearchQueries.push($root.google.cloud.ces.v1beta.WebSearchQuery.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoogleSearchSuggestions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GoogleSearchSuggestions} GoogleSearchSuggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearchSuggestions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoogleSearchSuggestions message. + * @function verify + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoogleSearchSuggestions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.htmls != null && message.hasOwnProperty("htmls")) { + if (!Array.isArray(message.htmls)) + return "htmls: array expected"; + for (var i = 0; i < message.htmls.length; ++i) + if (!$util.isString(message.htmls[i])) + return "htmls: string[] expected"; + } + if (message.webSearchQueries != null && message.hasOwnProperty("webSearchQueries")) { + if (!Array.isArray(message.webSearchQueries)) + return "webSearchQueries: array expected"; + for (var i = 0; i < message.webSearchQueries.length; ++i) { + var error = $root.google.cloud.ces.v1beta.WebSearchQuery.verify(message.webSearchQueries[i]); + if (error) + return "webSearchQueries." + error; + } + } + return null; + }; + + /** + * Creates a GoogleSearchSuggestions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GoogleSearchSuggestions} GoogleSearchSuggestions + */ + GoogleSearchSuggestions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GoogleSearchSuggestions) + return object; + var message = new $root.google.cloud.ces.v1beta.GoogleSearchSuggestions(); + if (object.htmls) { + if (!Array.isArray(object.htmls)) + throw TypeError(".google.cloud.ces.v1beta.GoogleSearchSuggestions.htmls: array expected"); + message.htmls = []; + for (var i = 0; i < object.htmls.length; ++i) + message.htmls[i] = String(object.htmls[i]); + } + if (object.webSearchQueries) { + if (!Array.isArray(object.webSearchQueries)) + throw TypeError(".google.cloud.ces.v1beta.GoogleSearchSuggestions.webSearchQueries: array expected"); + message.webSearchQueries = []; + for (var i = 0; i < object.webSearchQueries.length; ++i) { + if (typeof object.webSearchQueries[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.GoogleSearchSuggestions.webSearchQueries: object expected"); + message.webSearchQueries[i] = $root.google.cloud.ces.v1beta.WebSearchQuery.fromObject(object.webSearchQueries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GoogleSearchSuggestions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @static + * @param {google.cloud.ces.v1beta.GoogleSearchSuggestions} message GoogleSearchSuggestions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoogleSearchSuggestions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.htmls = []; + object.webSearchQueries = []; + } + if (message.htmls && message.htmls.length) { + object.htmls = []; + for (var j = 0; j < message.htmls.length; ++j) + object.htmls[j] = message.htmls[j]; + } + if (message.webSearchQueries && message.webSearchQueries.length) { + object.webSearchQueries = []; + for (var j = 0; j < message.webSearchQueries.length; ++j) + object.webSearchQueries[j] = $root.google.cloud.ces.v1beta.WebSearchQuery.toObject(message.webSearchQueries[j], options); + } + return object; + }; + + /** + * Converts this GoogleSearchSuggestions to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @instance + * @returns {Object.} JSON object + */ + GoogleSearchSuggestions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoogleSearchSuggestions + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoogleSearchSuggestions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GoogleSearchSuggestions"; + }; + + return GoogleSearchSuggestions; + })(); + + v1beta.WebSearchQuery = (function() { + + /** + * Properties of a WebSearchQuery. + * @memberof google.cloud.ces.v1beta + * @interface IWebSearchQuery + * @property {string|null} [query] WebSearchQuery query + * @property {string|null} [uri] WebSearchQuery uri + */ + + /** + * Constructs a new WebSearchQuery. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a WebSearchQuery. + * @implements IWebSearchQuery + * @constructor + * @param {google.cloud.ces.v1beta.IWebSearchQuery=} [properties] Properties to set + */ + function WebSearchQuery(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebSearchQuery query. + * @member {string} query + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @instance + */ + WebSearchQuery.prototype.query = ""; + + /** + * WebSearchQuery uri. + * @member {string} uri + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @instance + */ + WebSearchQuery.prototype.uri = ""; + + /** + * Creates a new WebSearchQuery instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @static + * @param {google.cloud.ces.v1beta.IWebSearchQuery=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.WebSearchQuery} WebSearchQuery instance + */ + WebSearchQuery.create = function create(properties) { + return new WebSearchQuery(properties); + }; + + /** + * Encodes the specified WebSearchQuery message. Does not implicitly {@link google.cloud.ces.v1beta.WebSearchQuery.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @static + * @param {google.cloud.ces.v1beta.IWebSearchQuery} message WebSearchQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebSearchQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + return writer; + }; + + /** + * Encodes the specified WebSearchQuery message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.WebSearchQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @static + * @param {google.cloud.ces.v1beta.IWebSearchQuery} message WebSearchQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebSearchQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebSearchQuery message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.WebSearchQuery} WebSearchQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebSearchQuery.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.WebSearchQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.query = reader.string(); + break; + } + case 2: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebSearchQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.WebSearchQuery} WebSearchQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebSearchQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebSearchQuery message. + * @function verify + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebSearchQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a WebSearchQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.WebSearchQuery} WebSearchQuery + */ + WebSearchQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.WebSearchQuery) + return object; + var message = new $root.google.cloud.ces.v1beta.WebSearchQuery(); + if (object.query != null) + message.query = String(object.query); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a WebSearchQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @static + * @param {google.cloud.ces.v1beta.WebSearchQuery} message WebSearchQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebSearchQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.query = ""; + object.uri = ""; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this WebSearchQuery to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @instance + * @returns {Object.} JSON object + */ + WebSearchQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebSearchQuery + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebSearchQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.WebSearchQuery"; + }; + + return WebSearchQuery; + })(); + + v1beta.EvaluationService = (function() { + + /** + * Constructs a new EvaluationService service. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationService + * @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 EvaluationService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (EvaluationService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EvaluationService; + + /** + * Creates new EvaluationService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationService + * @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 {EvaluationService} RPC service. Useful where requests and/or responses are streamed. + */ + EvaluationService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|runEvaluation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef RunEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunEvaluation. + * @function runEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IRunEvaluationRequest} request RunEvaluationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.RunEvaluationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.runEvaluation = function runEvaluation(request, callback) { + return this.rpcCall(runEvaluation, $root.google.cloud.ces.v1beta.RunEvaluationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunEvaluation" }); + + /** + * Calls RunEvaluation. + * @function runEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IRunEvaluationRequest} request RunEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|uploadEvaluationAudio}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef UploadEvaluationAudioCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.UploadEvaluationAudioResponse} [response] UploadEvaluationAudioResponse + */ + + /** + * Calls UploadEvaluationAudio. + * @function uploadEvaluationAudio + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioRequest} request UploadEvaluationAudioRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.UploadEvaluationAudioCallback} callback Node-style callback called with the error, if any, and UploadEvaluationAudioResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.uploadEvaluationAudio = function uploadEvaluationAudio(request, callback) { + return this.rpcCall(uploadEvaluationAudio, $root.google.cloud.ces.v1beta.UploadEvaluationAudioRequest, $root.google.cloud.ces.v1beta.UploadEvaluationAudioResponse, request, callback); + }, "name", { value: "UploadEvaluationAudio" }); + + /** + * Calls UploadEvaluationAudio. + * @function uploadEvaluationAudio + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioRequest} request UploadEvaluationAudioRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createEvaluation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef CreateEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Evaluation} [response] Evaluation + */ + + /** + * Calls CreateEvaluation. + * @function createEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ICreateEvaluationRequest} request CreateEvaluationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.CreateEvaluationCallback} callback Node-style callback called with the error, if any, and Evaluation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.createEvaluation = function createEvaluation(request, callback) { + return this.rpcCall(createEvaluation, $root.google.cloud.ces.v1beta.CreateEvaluationRequest, $root.google.cloud.ces.v1beta.Evaluation, request, callback); + }, "name", { value: "CreateEvaluation" }); + + /** + * Calls CreateEvaluation. + * @function createEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ICreateEvaluationRequest} request CreateEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|generateEvaluation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef GenerateEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GenerateEvaluation. + * @function generateEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGenerateEvaluationRequest} request GenerateEvaluationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.GenerateEvaluationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.generateEvaluation = function generateEvaluation(request, callback) { + return this.rpcCall(generateEvaluation, $root.google.cloud.ces.v1beta.GenerateEvaluationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GenerateEvaluation" }); + + /** + * Calls GenerateEvaluation. + * @function generateEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGenerateEvaluationRequest} request GenerateEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|importEvaluations}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef ImportEvaluationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportEvaluations. + * @function importEvaluations + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IImportEvaluationsRequest} request ImportEvaluationsRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.ImportEvaluationsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.importEvaluations = function importEvaluations(request, callback) { + return this.rpcCall(importEvaluations, $root.google.cloud.ces.v1beta.ImportEvaluationsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportEvaluations" }); + + /** + * Calls ImportEvaluations. + * @function importEvaluations + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IImportEvaluationsRequest} request ImportEvaluationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createEvaluationDataset}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef CreateEvaluationDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.EvaluationDataset} [response] EvaluationDataset + */ + + /** + * Calls CreateEvaluationDataset. + * @function createEvaluationDataset + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest} request CreateEvaluationDatasetRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.CreateEvaluationDatasetCallback} callback Node-style callback called with the error, if any, and EvaluationDataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.createEvaluationDataset = function createEvaluationDataset(request, callback) { + return this.rpcCall(createEvaluationDataset, $root.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest, $root.google.cloud.ces.v1beta.EvaluationDataset, request, callback); + }, "name", { value: "CreateEvaluationDataset" }); + + /** + * Calls CreateEvaluationDataset. + * @function createEvaluationDataset + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest} request CreateEvaluationDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateEvaluation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef UpdateEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Evaluation} [response] Evaluation + */ + + /** + * Calls UpdateEvaluation. + * @function updateEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateEvaluationRequest} request UpdateEvaluationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationCallback} callback Node-style callback called with the error, if any, and Evaluation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.updateEvaluation = function updateEvaluation(request, callback) { + return this.rpcCall(updateEvaluation, $root.google.cloud.ces.v1beta.UpdateEvaluationRequest, $root.google.cloud.ces.v1beta.Evaluation, request, callback); + }, "name", { value: "UpdateEvaluation" }); + + /** + * Calls UpdateEvaluation. + * @function updateEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateEvaluationRequest} request UpdateEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateEvaluationDataset}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef UpdateEvaluationDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.EvaluationDataset} [response] EvaluationDataset + */ + + /** + * Calls UpdateEvaluationDataset. + * @function updateEvaluationDataset + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest} request UpdateEvaluationDatasetRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationDatasetCallback} callback Node-style callback called with the error, if any, and EvaluationDataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.updateEvaluationDataset = function updateEvaluationDataset(request, callback) { + return this.rpcCall(updateEvaluationDataset, $root.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest, $root.google.cloud.ces.v1beta.EvaluationDataset, request, callback); + }, "name", { value: "UpdateEvaluationDataset" }); + + /** + * Calls UpdateEvaluationDataset. + * @function updateEvaluationDataset + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest} request UpdateEvaluationDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef DeleteEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteEvaluation. + * @function deleteEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRequest} request DeleteEvaluationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.deleteEvaluation = function deleteEvaluation(request, callback) { + return this.rpcCall(deleteEvaluation, $root.google.cloud.ces.v1beta.DeleteEvaluationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEvaluation" }); + + /** + * Calls DeleteEvaluation. + * @function deleteEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRequest} request DeleteEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationResult}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef DeleteEvaluationResultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteEvaluationResult. + * @function deleteEvaluationResult + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationResultRequest} request DeleteEvaluationResultRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationResultCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.deleteEvaluationResult = function deleteEvaluationResult(request, callback) { + return this.rpcCall(deleteEvaluationResult, $root.google.cloud.ces.v1beta.DeleteEvaluationResultRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEvaluationResult" }); + + /** + * Calls DeleteEvaluationResult. + * @function deleteEvaluationResult + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationResultRequest} request DeleteEvaluationResultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationDataset}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef DeleteEvaluationDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteEvaluationDataset. + * @function deleteEvaluationDataset + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest} request DeleteEvaluationDatasetRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationDatasetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.deleteEvaluationDataset = function deleteEvaluationDataset(request, callback) { + return this.rpcCall(deleteEvaluationDataset, $root.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEvaluationDataset" }); + + /** + * Calls DeleteEvaluationDataset. + * @function deleteEvaluationDataset + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest} request DeleteEvaluationDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationRun}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef DeleteEvaluationRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteEvaluationRun. + * @function deleteEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunRequest} request DeleteEvaluationRunRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationRunCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.deleteEvaluationRun = function deleteEvaluationRun(request, callback) { + return this.rpcCall(deleteEvaluationRun, $root.google.cloud.ces.v1beta.DeleteEvaluationRunRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteEvaluationRun" }); + + /** + * Calls DeleteEvaluationRun. + * @function deleteEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunRequest} request DeleteEvaluationRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef GetEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Evaluation} [response] Evaluation + */ + + /** + * Calls GetEvaluation. + * @function getEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationRequest} request GetEvaluationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.GetEvaluationCallback} callback Node-style callback called with the error, if any, and Evaluation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.getEvaluation = function getEvaluation(request, callback) { + return this.rpcCall(getEvaluation, $root.google.cloud.ces.v1beta.GetEvaluationRequest, $root.google.cloud.ces.v1beta.Evaluation, request, callback); + }, "name", { value: "GetEvaluation" }); + + /** + * Calls GetEvaluation. + * @function getEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationRequest} request GetEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationResult}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef GetEvaluationResultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.EvaluationResult} [response] EvaluationResult + */ + + /** + * Calls GetEvaluationResult. + * @function getEvaluationResult + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationResultRequest} request GetEvaluationResultRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.GetEvaluationResultCallback} callback Node-style callback called with the error, if any, and EvaluationResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.getEvaluationResult = function getEvaluationResult(request, callback) { + return this.rpcCall(getEvaluationResult, $root.google.cloud.ces.v1beta.GetEvaluationResultRequest, $root.google.cloud.ces.v1beta.EvaluationResult, request, callback); + }, "name", { value: "GetEvaluationResult" }); + + /** + * Calls GetEvaluationResult. + * @function getEvaluationResult + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationResultRequest} request GetEvaluationResultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationDataset}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef GetEvaluationDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.EvaluationDataset} [response] EvaluationDataset + */ + + /** + * Calls GetEvaluationDataset. + * @function getEvaluationDataset + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationDatasetRequest} request GetEvaluationDatasetRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.GetEvaluationDatasetCallback} callback Node-style callback called with the error, if any, and EvaluationDataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.getEvaluationDataset = function getEvaluationDataset(request, callback) { + return this.rpcCall(getEvaluationDataset, $root.google.cloud.ces.v1beta.GetEvaluationDatasetRequest, $root.google.cloud.ces.v1beta.EvaluationDataset, request, callback); + }, "name", { value: "GetEvaluationDataset" }); + + /** + * Calls GetEvaluationDataset. + * @function getEvaluationDataset + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationDatasetRequest} request GetEvaluationDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationRun}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef GetEvaluationRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.EvaluationRun} [response] EvaluationRun + */ + + /** + * Calls GetEvaluationRun. + * @function getEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationRunRequest} request GetEvaluationRunRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.GetEvaluationRunCallback} callback Node-style callback called with the error, if any, and EvaluationRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.getEvaluationRun = function getEvaluationRun(request, callback) { + return this.rpcCall(getEvaluationRun, $root.google.cloud.ces.v1beta.GetEvaluationRunRequest, $root.google.cloud.ces.v1beta.EvaluationRun, request, callback); + }, "name", { value: "GetEvaluationRun" }); + + /** + * Calls GetEvaluationRun. + * @function getEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationRunRequest} request GetEvaluationRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluations}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef ListEvaluationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListEvaluationsResponse} [response] ListEvaluationsResponse + */ + + /** + * Calls ListEvaluations. + * @function listEvaluations + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationsRequest} request ListEvaluationsRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.ListEvaluationsCallback} callback Node-style callback called with the error, if any, and ListEvaluationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.listEvaluations = function listEvaluations(request, callback) { + return this.rpcCall(listEvaluations, $root.google.cloud.ces.v1beta.ListEvaluationsRequest, $root.google.cloud.ces.v1beta.ListEvaluationsResponse, request, callback); + }, "name", { value: "ListEvaluations" }); + + /** + * Calls ListEvaluations. + * @function listEvaluations + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationsRequest} request ListEvaluationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationResults}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef ListEvaluationResultsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListEvaluationResultsResponse} [response] ListEvaluationResultsResponse + */ + + /** + * Calls ListEvaluationResults. + * @function listEvaluationResults + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationResultsRequest} request ListEvaluationResultsRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.ListEvaluationResultsCallback} callback Node-style callback called with the error, if any, and ListEvaluationResultsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.listEvaluationResults = function listEvaluationResults(request, callback) { + return this.rpcCall(listEvaluationResults, $root.google.cloud.ces.v1beta.ListEvaluationResultsRequest, $root.google.cloud.ces.v1beta.ListEvaluationResultsResponse, request, callback); + }, "name", { value: "ListEvaluationResults" }); + + /** + * Calls ListEvaluationResults. + * @function listEvaluationResults + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationResultsRequest} request ListEvaluationResultsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationDatasets}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef ListEvaluationDatasetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListEvaluationDatasetsResponse} [response] ListEvaluationDatasetsResponse + */ + + /** + * Calls ListEvaluationDatasets. + * @function listEvaluationDatasets + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsRequest} request ListEvaluationDatasetsRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.ListEvaluationDatasetsCallback} callback Node-style callback called with the error, if any, and ListEvaluationDatasetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.listEvaluationDatasets = function listEvaluationDatasets(request, callback) { + return this.rpcCall(listEvaluationDatasets, $root.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest, $root.google.cloud.ces.v1beta.ListEvaluationDatasetsResponse, request, callback); + }, "name", { value: "ListEvaluationDatasets" }); + + /** + * Calls ListEvaluationDatasets. + * @function listEvaluationDatasets + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsRequest} request ListEvaluationDatasetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationRuns}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef ListEvaluationRunsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListEvaluationRunsResponse} [response] ListEvaluationRunsResponse + */ + + /** + * Calls ListEvaluationRuns. + * @function listEvaluationRuns + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationRunsRequest} request ListEvaluationRunsRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.ListEvaluationRunsCallback} callback Node-style callback called with the error, if any, and ListEvaluationRunsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.listEvaluationRuns = function listEvaluationRuns(request, callback) { + return this.rpcCall(listEvaluationRuns, $root.google.cloud.ces.v1beta.ListEvaluationRunsRequest, $root.google.cloud.ces.v1beta.ListEvaluationRunsResponse, request, callback); + }, "name", { value: "ListEvaluationRuns" }); + + /** + * Calls ListEvaluationRuns. + * @function listEvaluationRuns + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationRunsRequest} request ListEvaluationRunsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationExpectations}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef ListEvaluationExpectationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListEvaluationExpectationsResponse} [response] ListEvaluationExpectationsResponse + */ + + /** + * Calls ListEvaluationExpectations. + * @function listEvaluationExpectations + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsRequest} request ListEvaluationExpectationsRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.ListEvaluationExpectationsCallback} callback Node-style callback called with the error, if any, and ListEvaluationExpectationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.listEvaluationExpectations = function listEvaluationExpectations(request, callback) { + return this.rpcCall(listEvaluationExpectations, $root.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest, $root.google.cloud.ces.v1beta.ListEvaluationExpectationsResponse, request, callback); + }, "name", { value: "ListEvaluationExpectations" }); + + /** + * Calls ListEvaluationExpectations. + * @function listEvaluationExpectations + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsRequest} request ListEvaluationExpectationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationExpectation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef GetEvaluationExpectationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.EvaluationExpectation} [response] EvaluationExpectation + */ + + /** + * Calls GetEvaluationExpectation. + * @function getEvaluationExpectation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationExpectationRequest} request GetEvaluationExpectationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.GetEvaluationExpectationCallback} callback Node-style callback called with the error, if any, and EvaluationExpectation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.getEvaluationExpectation = function getEvaluationExpectation(request, callback) { + return this.rpcCall(getEvaluationExpectation, $root.google.cloud.ces.v1beta.GetEvaluationExpectationRequest, $root.google.cloud.ces.v1beta.EvaluationExpectation, request, callback); + }, "name", { value: "GetEvaluationExpectation" }); + + /** + * Calls GetEvaluationExpectation. + * @function getEvaluationExpectation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationExpectationRequest} request GetEvaluationExpectationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createEvaluationExpectation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef CreateEvaluationExpectationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.EvaluationExpectation} [response] EvaluationExpectation + */ + + /** + * Calls CreateEvaluationExpectation. + * @function createEvaluationExpectation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest} request CreateEvaluationExpectationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.CreateEvaluationExpectationCallback} callback Node-style callback called with the error, if any, and EvaluationExpectation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.createEvaluationExpectation = function createEvaluationExpectation(request, callback) { + return this.rpcCall(createEvaluationExpectation, $root.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest, $root.google.cloud.ces.v1beta.EvaluationExpectation, request, callback); + }, "name", { value: "CreateEvaluationExpectation" }); + + /** + * Calls CreateEvaluationExpectation. + * @function createEvaluationExpectation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest} request CreateEvaluationExpectationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateEvaluationExpectation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef UpdateEvaluationExpectationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.EvaluationExpectation} [response] EvaluationExpectation + */ + + /** + * Calls UpdateEvaluationExpectation. + * @function updateEvaluationExpectation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest} request UpdateEvaluationExpectationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationExpectationCallback} callback Node-style callback called with the error, if any, and EvaluationExpectation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.updateEvaluationExpectation = function updateEvaluationExpectation(request, callback) { + return this.rpcCall(updateEvaluationExpectation, $root.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest, $root.google.cloud.ces.v1beta.EvaluationExpectation, request, callback); + }, "name", { value: "UpdateEvaluationExpectation" }); + + /** + * Calls UpdateEvaluationExpectation. + * @function updateEvaluationExpectation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest} request UpdateEvaluationExpectationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationExpectation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef DeleteEvaluationExpectationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteEvaluationExpectation. + * @function deleteEvaluationExpectation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest} request DeleteEvaluationExpectationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationExpectationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.deleteEvaluationExpectation = function deleteEvaluationExpectation(request, callback) { + return this.rpcCall(deleteEvaluationExpectation, $root.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEvaluationExpectation" }); + + /** + * Calls DeleteEvaluationExpectation. + * @function deleteEvaluationExpectation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest} request DeleteEvaluationExpectationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createScheduledEvaluationRun}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef CreateScheduledEvaluationRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun} [response] ScheduledEvaluationRun + */ + + /** + * Calls CreateScheduledEvaluationRun. + * @function createScheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest} request CreateScheduledEvaluationRunRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.CreateScheduledEvaluationRunCallback} callback Node-style callback called with the error, if any, and ScheduledEvaluationRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.createScheduledEvaluationRun = function createScheduledEvaluationRun(request, callback) { + return this.rpcCall(createScheduledEvaluationRun, $root.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest, $root.google.cloud.ces.v1beta.ScheduledEvaluationRun, request, callback); + }, "name", { value: "CreateScheduledEvaluationRun" }); + + /** + * Calls CreateScheduledEvaluationRun. + * @function createScheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest} request CreateScheduledEvaluationRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getScheduledEvaluationRun}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef GetScheduledEvaluationRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun} [response] ScheduledEvaluationRun + */ + + /** + * Calls GetScheduledEvaluationRun. + * @function getScheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest} request GetScheduledEvaluationRunRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.GetScheduledEvaluationRunCallback} callback Node-style callback called with the error, if any, and ScheduledEvaluationRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.getScheduledEvaluationRun = function getScheduledEvaluationRun(request, callback) { + return this.rpcCall(getScheduledEvaluationRun, $root.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest, $root.google.cloud.ces.v1beta.ScheduledEvaluationRun, request, callback); + }, "name", { value: "GetScheduledEvaluationRun" }); + + /** + * Calls GetScheduledEvaluationRun. + * @function getScheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest} request GetScheduledEvaluationRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listScheduledEvaluationRuns}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef ListScheduledEvaluationRunsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse} [response] ListScheduledEvaluationRunsResponse + */ + + /** + * Calls ListScheduledEvaluationRuns. + * @function listScheduledEvaluationRuns + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest} request ListScheduledEvaluationRunsRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.ListScheduledEvaluationRunsCallback} callback Node-style callback called with the error, if any, and ListScheduledEvaluationRunsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.listScheduledEvaluationRuns = function listScheduledEvaluationRuns(request, callback) { + return this.rpcCall(listScheduledEvaluationRuns, $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest, $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse, request, callback); + }, "name", { value: "ListScheduledEvaluationRuns" }); + + /** + * Calls ListScheduledEvaluationRuns. + * @function listScheduledEvaluationRuns + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest} request ListScheduledEvaluationRunsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateScheduledEvaluationRun}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef UpdateScheduledEvaluationRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun} [response] ScheduledEvaluationRun + */ + + /** + * Calls UpdateScheduledEvaluationRun. + * @function updateScheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest} request UpdateScheduledEvaluationRunRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.UpdateScheduledEvaluationRunCallback} callback Node-style callback called with the error, if any, and ScheduledEvaluationRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.updateScheduledEvaluationRun = function updateScheduledEvaluationRun(request, callback) { + return this.rpcCall(updateScheduledEvaluationRun, $root.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest, $root.google.cloud.ces.v1beta.ScheduledEvaluationRun, request, callback); + }, "name", { value: "UpdateScheduledEvaluationRun" }); + + /** + * Calls UpdateScheduledEvaluationRun. + * @function updateScheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest} request UpdateScheduledEvaluationRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteScheduledEvaluationRun}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef DeleteScheduledEvaluationRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteScheduledEvaluationRun. + * @function deleteScheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest} request DeleteScheduledEvaluationRunRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.DeleteScheduledEvaluationRunCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.deleteScheduledEvaluationRun = function deleteScheduledEvaluationRun(request, callback) { + return this.rpcCall(deleteScheduledEvaluationRun, $root.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteScheduledEvaluationRun" }); + + /** + * Calls DeleteScheduledEvaluationRun. + * @function deleteScheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest} request DeleteScheduledEvaluationRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|testPersonaVoice}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef TestPersonaVoiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.TestPersonaVoiceResponse} [response] TestPersonaVoiceResponse + */ + + /** + * Calls TestPersonaVoice. + * @function testPersonaVoice + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceRequest} request TestPersonaVoiceRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.TestPersonaVoiceCallback} callback Node-style callback called with the error, if any, and TestPersonaVoiceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.testPersonaVoice = function testPersonaVoice(request, callback) { + return this.rpcCall(testPersonaVoice, $root.google.cloud.ces.v1beta.TestPersonaVoiceRequest, $root.google.cloud.ces.v1beta.TestPersonaVoiceResponse, request, callback); + }, "name", { value: "TestPersonaVoice" }); + + /** + * Calls TestPersonaVoice. + * @function testPersonaVoice + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceRequest} request TestPersonaVoiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return EvaluationService; + })(); + + v1beta.RunEvaluationResponse = (function() { + + /** + * Properties of a RunEvaluationResponse. + * @memberof google.cloud.ces.v1beta + * @interface IRunEvaluationResponse + * @property {string|null} [evaluationRun] RunEvaluationResponse evaluationRun + */ + + /** + * Constructs a new RunEvaluationResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RunEvaluationResponse. + * @implements IRunEvaluationResponse + * @constructor + * @param {google.cloud.ces.v1beta.IRunEvaluationResponse=} [properties] Properties to set + */ + function RunEvaluationResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunEvaluationResponse evaluationRun. + * @member {string} evaluationRun + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @instance + */ + RunEvaluationResponse.prototype.evaluationRun = ""; + + /** + * Creates a new RunEvaluationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @static + * @param {google.cloud.ces.v1beta.IRunEvaluationResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RunEvaluationResponse} RunEvaluationResponse instance + */ + RunEvaluationResponse.create = function create(properties) { + return new RunEvaluationResponse(properties); + }; + + /** + * Encodes the specified RunEvaluationResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @static + * @param {google.cloud.ces.v1beta.IRunEvaluationResponse} message RunEvaluationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunEvaluationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationRun != null && Object.hasOwnProperty.call(message, "evaluationRun")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.evaluationRun); + return writer; + }; + + /** + * Encodes the specified RunEvaluationResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @static + * @param {google.cloud.ces.v1beta.IRunEvaluationResponse} message RunEvaluationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunEvaluationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunEvaluationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RunEvaluationResponse} RunEvaluationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunEvaluationResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RunEvaluationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.evaluationRun = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunEvaluationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RunEvaluationResponse} RunEvaluationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunEvaluationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunEvaluationResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunEvaluationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) + if (!$util.isString(message.evaluationRun)) + return "evaluationRun: string expected"; + return null; + }; + + /** + * Creates a RunEvaluationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RunEvaluationResponse} RunEvaluationResponse + */ + RunEvaluationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RunEvaluationResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.RunEvaluationResponse(); + if (object.evaluationRun != null) + message.evaluationRun = String(object.evaluationRun); + return message; + }; + + /** + * Creates a plain object from a RunEvaluationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @static + * @param {google.cloud.ces.v1beta.RunEvaluationResponse} message RunEvaluationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunEvaluationResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.evaluationRun = ""; + if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) + object.evaluationRun = message.evaluationRun; + return object; + }; + + /** + * Converts this RunEvaluationResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @instance + * @returns {Object.} JSON object + */ + RunEvaluationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunEvaluationResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunEvaluationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RunEvaluationResponse"; + }; + + return RunEvaluationResponse; + })(); + + v1beta.RunEvaluationOperationMetadata = (function() { + + /** + * Properties of a RunEvaluationOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @interface IRunEvaluationOperationMetadata + * @property {Array.|null} [evaluations] RunEvaluationOperationMetadata evaluations + * @property {string|null} [evaluationRun] RunEvaluationOperationMetadata evaluationRun + * @property {google.protobuf.ITimestamp|null} [createTime] RunEvaluationOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] RunEvaluationOperationMetadata endTime + * @property {string|null} [verb] RunEvaluationOperationMetadata verb + * @property {boolean|null} [cancelRequested] RunEvaluationOperationMetadata cancelRequested + */ + + /** + * Constructs a new RunEvaluationOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RunEvaluationOperationMetadata. + * @implements IRunEvaluationOperationMetadata + * @constructor + * @param {google.cloud.ces.v1beta.IRunEvaluationOperationMetadata=} [properties] Properties to set + */ + function RunEvaluationOperationMetadata(properties) { + this.evaluations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunEvaluationOperationMetadata evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @instance + */ + RunEvaluationOperationMetadata.prototype.evaluations = $util.emptyArray; + + /** + * RunEvaluationOperationMetadata evaluationRun. + * @member {string} evaluationRun + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @instance + */ + RunEvaluationOperationMetadata.prototype.evaluationRun = ""; + + /** + * RunEvaluationOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @instance + */ + RunEvaluationOperationMetadata.prototype.createTime = null; + + /** + * RunEvaluationOperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @instance + */ + RunEvaluationOperationMetadata.prototype.endTime = null; + + /** + * RunEvaluationOperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @instance + */ + RunEvaluationOperationMetadata.prototype.verb = ""; + + /** + * RunEvaluationOperationMetadata cancelRequested. + * @member {boolean} cancelRequested + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @instance + */ + RunEvaluationOperationMetadata.prototype.cancelRequested = false; + + /** + * Creates a new RunEvaluationOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IRunEvaluationOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RunEvaluationOperationMetadata} RunEvaluationOperationMetadata instance + */ + RunEvaluationOperationMetadata.create = function create(properties) { + return new RunEvaluationOperationMetadata(properties); + }; + + /** + * Encodes the specified RunEvaluationOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IRunEvaluationOperationMetadata} message RunEvaluationOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunEvaluationOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.evaluations[i]); + if (message.evaluationRun != null && Object.hasOwnProperty.call(message, "evaluationRun")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluationRun); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.verb); + if (message.cancelRequested != null && Object.hasOwnProperty.call(message, "cancelRequested")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.cancelRequested); + return writer; + }; + + /** + * Encodes the specified RunEvaluationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IRunEvaluationOperationMetadata} message RunEvaluationOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunEvaluationOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunEvaluationOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RunEvaluationOperationMetadata} RunEvaluationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunEvaluationOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RunEvaluationOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push(reader.string()); + break; + } + case 2: { + message.evaluationRun = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.verb = reader.string(); + break; + } + case 6: { + message.cancelRequested = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunEvaluationOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RunEvaluationOperationMetadata} RunEvaluationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunEvaluationOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunEvaluationOperationMetadata message. + * @function verify + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunEvaluationOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) + if (!$util.isString(message.evaluations[i])) + return "evaluations: string[] expected"; + } + if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) + if (!$util.isString(message.evaluationRun)) + return "evaluationRun: 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.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.cancelRequested != null && message.hasOwnProperty("cancelRequested")) + if (typeof message.cancelRequested !== "boolean") + return "cancelRequested: boolean expected"; + return null; + }; + + /** + * Creates a RunEvaluationOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RunEvaluationOperationMetadata} RunEvaluationOperationMetadata + */ + RunEvaluationOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RunEvaluationOperationMetadata) + return object; + var message = new $root.google.cloud.ces.v1beta.RunEvaluationOperationMetadata(); + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.ces.v1beta.RunEvaluationOperationMetadata.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) + message.evaluations[i] = String(object.evaluations[i]); + } + if (object.evaluationRun != null) + message.evaluationRun = String(object.evaluationRun); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.RunEvaluationOperationMetadata.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.ces.v1beta.RunEvaluationOperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.verb != null) + message.verb = String(object.verb); + if (object.cancelRequested != null) + message.cancelRequested = Boolean(object.cancelRequested); + return message; + }; + + /** + * Creates a plain object from a RunEvaluationOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.RunEvaluationOperationMetadata} message RunEvaluationOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunEvaluationOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluations = []; + if (options.defaults) { + object.evaluationRun = ""; + object.createTime = null; + object.endTime = null; + object.verb = ""; + object.cancelRequested = false; + } + if (message.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = message.evaluations[j]; + } + if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) + object.evaluationRun = message.evaluationRun; + 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.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.cancelRequested != null && message.hasOwnProperty("cancelRequested")) + object.cancelRequested = message.cancelRequested; + return object; + }; + + /** + * Converts this RunEvaluationOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + RunEvaluationOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunEvaluationOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunEvaluationOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RunEvaluationOperationMetadata"; + }; + + return RunEvaluationOperationMetadata; + })(); + + v1beta.GenerateEvaluationOperationMetadata = (function() { + + /** + * Properties of a GenerateEvaluationOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @interface IGenerateEvaluationOperationMetadata + */ + + /** + * Constructs a new GenerateEvaluationOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GenerateEvaluationOperationMetadata. + * @implements IGenerateEvaluationOperationMetadata + * @constructor + * @param {google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata=} [properties] Properties to set + */ + function GenerateEvaluationOperationMetadata(properties) { + if (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 GenerateEvaluationOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata} GenerateEvaluationOperationMetadata instance + */ + GenerateEvaluationOperationMetadata.create = function create(properties) { + return new GenerateEvaluationOperationMetadata(properties); + }; + + /** + * Encodes the specified GenerateEvaluationOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata} message GenerateEvaluationOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateEvaluationOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GenerateEvaluationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata} message GenerateEvaluationOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateEvaluationOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateEvaluationOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata} GenerateEvaluationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateEvaluationOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateEvaluationOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata} GenerateEvaluationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateEvaluationOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateEvaluationOperationMetadata message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateEvaluationOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GenerateEvaluationOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata} GenerateEvaluationOperationMetadata + */ + GenerateEvaluationOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata) + return object; + return new $root.google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata(); + }; + + /** + * Creates a plain object from a GenerateEvaluationOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata} message GenerateEvaluationOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateEvaluationOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GenerateEvaluationOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + GenerateEvaluationOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateEvaluationOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateEvaluationOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata"; + }; + + return GenerateEvaluationOperationMetadata; + })(); + + v1beta.DeleteEvaluationRunOperationMetadata = (function() { + + /** + * Properties of a DeleteEvaluationRunOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteEvaluationRunOperationMetadata + */ + + /** + * Constructs a new DeleteEvaluationRunOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteEvaluationRunOperationMetadata. + * @implements IDeleteEvaluationRunOperationMetadata + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata=} [properties] Properties to set + */ + function DeleteEvaluationRunOperationMetadata(properties) { + if (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 DeleteEvaluationRunOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata} DeleteEvaluationRunOperationMetadata instance + */ + DeleteEvaluationRunOperationMetadata.create = function create(properties) { + return new DeleteEvaluationRunOperationMetadata(properties); + }; + + /** + * Encodes the specified DeleteEvaluationRunOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata} message DeleteEvaluationRunOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationRunOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteEvaluationRunOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata} message DeleteEvaluationRunOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationRunOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEvaluationRunOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata} DeleteEvaluationRunOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationRunOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEvaluationRunOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata} DeleteEvaluationRunOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationRunOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEvaluationRunOperationMetadata message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEvaluationRunOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteEvaluationRunOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata} DeleteEvaluationRunOperationMetadata + */ + DeleteEvaluationRunOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata) + return object; + return new $root.google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata(); + }; + + /** + * Creates a plain object from a DeleteEvaluationRunOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata} message DeleteEvaluationRunOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEvaluationRunOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteEvaluationRunOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteEvaluationRunOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEvaluationRunOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEvaluationRunOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata"; + }; + + return DeleteEvaluationRunOperationMetadata; + })(); + + v1beta.CreateEvaluationRequest = (function() { + + /** + * Properties of a CreateEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateEvaluationRequest + * @property {string|null} [parent] CreateEvaluationRequest parent + * @property {string|null} [evaluationId] CreateEvaluationRequest evaluationId + * @property {google.cloud.ces.v1beta.IEvaluation|null} [evaluation] CreateEvaluationRequest evaluation + */ + + /** + * Constructs a new CreateEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateEvaluationRequest. + * @implements ICreateEvaluationRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateEvaluationRequest=} [properties] Properties to set + */ + function CreateEvaluationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEvaluationRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @instance + */ + CreateEvaluationRequest.prototype.parent = ""; + + /** + * CreateEvaluationRequest evaluationId. + * @member {string} evaluationId + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @instance + */ + CreateEvaluationRequest.prototype.evaluationId = ""; + + /** + * CreateEvaluationRequest evaluation. + * @member {google.cloud.ces.v1beta.IEvaluation|null|undefined} evaluation + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @instance + */ + CreateEvaluationRequest.prototype.evaluation = null; + + /** + * Creates a new CreateEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateEvaluationRequest} CreateEvaluationRequest instance + */ + CreateEvaluationRequest.create = function create(properties) { + return new CreateEvaluationRequest(properties); + }; + + /** + * Encodes the specified CreateEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateEvaluationRequest} message CreateEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEvaluationRequest.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.evaluationId != null && Object.hasOwnProperty.call(message, "evaluationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluationId); + if (message.evaluation != null && Object.hasOwnProperty.call(message, "evaluation")) + $root.google.cloud.ces.v1beta.Evaluation.encode(message.evaluation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateEvaluationRequest} message CreateEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateEvaluationRequest} CreateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEvaluationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateEvaluationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.evaluationId = reader.string(); + break; + } + case 3: { + message.evaluation = $root.google.cloud.ces.v1beta.Evaluation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateEvaluationRequest} CreateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEvaluationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEvaluationRequest.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.evaluationId != null && message.hasOwnProperty("evaluationId")) + if (!$util.isString(message.evaluationId)) + return "evaluationId: string expected"; + if (message.evaluation != null && message.hasOwnProperty("evaluation")) { + var error = $root.google.cloud.ces.v1beta.Evaluation.verify(message.evaluation); + if (error) + return "evaluation." + error; + } + return null; + }; + + /** + * Creates a CreateEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateEvaluationRequest} CreateEvaluationRequest + */ + CreateEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateEvaluationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateEvaluationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.evaluationId != null) + message.evaluationId = String(object.evaluationId); + if (object.evaluation != null) { + if (typeof object.evaluation !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateEvaluationRequest.evaluation: object expected"); + message.evaluation = $root.google.cloud.ces.v1beta.Evaluation.fromObject(object.evaluation); + } + return message; + }; + + /** + * Creates a plain object from a CreateEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.CreateEvaluationRequest} message CreateEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEvaluationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.evaluationId = ""; + object.evaluation = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.evaluationId != null && message.hasOwnProperty("evaluationId")) + object.evaluationId = message.evaluationId; + if (message.evaluation != null && message.hasOwnProperty("evaluation")) + object.evaluation = $root.google.cloud.ces.v1beta.Evaluation.toObject(message.evaluation, options); + return object; + }; + + /** + * Converts this CreateEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateEvaluationRequest"; + }; + + return CreateEvaluationRequest; + })(); + + v1beta.GenerateEvaluationRequest = (function() { + + /** + * Properties of a GenerateEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGenerateEvaluationRequest + * @property {string|null} [conversation] GenerateEvaluationRequest conversation + * @property {google.cloud.ces.v1beta.Conversation.Source|null} [source] GenerateEvaluationRequest source + */ + + /** + * Constructs a new GenerateEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GenerateEvaluationRequest. + * @implements IGenerateEvaluationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGenerateEvaluationRequest=} [properties] Properties to set + */ + function GenerateEvaluationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateEvaluationRequest conversation. + * @member {string} conversation + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @instance + */ + GenerateEvaluationRequest.prototype.conversation = ""; + + /** + * GenerateEvaluationRequest source. + * @member {google.cloud.ces.v1beta.Conversation.Source} source + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @instance + */ + GenerateEvaluationRequest.prototype.source = 0; + + /** + * Creates a new GenerateEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IGenerateEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateEvaluationRequest} GenerateEvaluationRequest instance + */ + GenerateEvaluationRequest.create = function create(properties) { + return new GenerateEvaluationRequest(properties); + }; + + /** + * Encodes the specified GenerateEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IGenerateEvaluationRequest} message GenerateEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateEvaluationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversation); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.source); + return writer; + }; + + /** + * Encodes the specified GenerateEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IGenerateEvaluationRequest} message GenerateEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateEvaluationRequest} GenerateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateEvaluationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateEvaluationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.conversation = reader.string(); + break; + } + case 2: { + message.source = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateEvaluationRequest} GenerateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateEvaluationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateEvaluationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conversation != null && message.hasOwnProperty("conversation")) + if (!$util.isString(message.conversation)) + return "conversation: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + switch (message.source) { + default: + return "source: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a GenerateEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateEvaluationRequest} GenerateEvaluationRequest + */ + GenerateEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateEvaluationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateEvaluationRequest(); + if (object.conversation != null) + message.conversation = String(object.conversation); + switch (object.source) { + default: + if (typeof object.source === "number") { + message.source = object.source; + break; + } + break; + case "SOURCE_UNSPECIFIED": + case 0: + message.source = 0; + break; + case "LIVE": + case 1: + message.source = 1; + break; + case "SIMULATOR": + case 2: + message.source = 2; + break; + case "EVAL": + case 3: + message.source = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a GenerateEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.GenerateEvaluationRequest} message GenerateEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateEvaluationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.conversation = ""; + object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; + } + if (message.conversation != null && message.hasOwnProperty("conversation")) + object.conversation = message.conversation; + if (message.source != null && message.hasOwnProperty("source")) + object.source = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1beta.Conversation.Source[message.source] : message.source; + return object; + }; + + /** + * Converts this GenerateEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateEvaluationRequest"; + }; + + return GenerateEvaluationRequest; + })(); + + v1beta.ImportEvaluationsRequest = (function() { + + /** + * Properties of an ImportEvaluationsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IImportEvaluationsRequest + * @property {google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList|null} [conversationList] ImportEvaluationsRequest conversationList + * @property {string|null} [gcsUri] ImportEvaluationsRequest gcsUri + * @property {Uint8Array|null} [csvContent] ImportEvaluationsRequest csvContent + * @property {string|null} [parent] ImportEvaluationsRequest parent + * @property {google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions|null} [importOptions] ImportEvaluationsRequest importOptions + */ + + /** + * Constructs a new ImportEvaluationsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ImportEvaluationsRequest. + * @implements IImportEvaluationsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IImportEvaluationsRequest=} [properties] Properties to set + */ + function ImportEvaluationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportEvaluationsRequest conversationList. + * @member {google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList|null|undefined} conversationList + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @instance + */ + ImportEvaluationsRequest.prototype.conversationList = null; + + /** + * ImportEvaluationsRequest gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @instance + */ + ImportEvaluationsRequest.prototype.gcsUri = null; + + /** + * ImportEvaluationsRequest csvContent. + * @member {Uint8Array|null|undefined} csvContent + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @instance + */ + ImportEvaluationsRequest.prototype.csvContent = null; + + /** + * ImportEvaluationsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @instance + */ + ImportEvaluationsRequest.prototype.parent = ""; + + /** + * ImportEvaluationsRequest importOptions. + * @member {google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions|null|undefined} importOptions + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @instance + */ + ImportEvaluationsRequest.prototype.importOptions = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportEvaluationsRequest source. + * @member {"conversationList"|"gcsUri"|"csvContent"|undefined} source + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @instance + */ + Object.defineProperty(ImportEvaluationsRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["conversationList", "gcsUri", "csvContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportEvaluationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @static + * @param {google.cloud.ces.v1beta.IImportEvaluationsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest} ImportEvaluationsRequest instance + */ + ImportEvaluationsRequest.create = function create(properties) { + return new ImportEvaluationsRequest(properties); + }; + + /** + * Encodes the specified ImportEvaluationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @static + * @param {google.cloud.ces.v1beta.IImportEvaluationsRequest} message ImportEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEvaluationsRequest.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.conversationList != null && Object.hasOwnProperty.call(message, "conversationList")) + $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.encode(message.conversationList, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsUri); + if (message.csvContent != null && Object.hasOwnProperty.call(message, "csvContent")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.csvContent); + if (message.importOptions != null && Object.hasOwnProperty.call(message, "importOptions")) + $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.encode(message.importOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @static + * @param {google.cloud.ces.v1beta.IImportEvaluationsRequest} message ImportEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEvaluationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportEvaluationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest} ImportEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEvaluationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportEvaluationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.conversationList = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.decode(reader, reader.uint32()); + break; + } + case 3: { + message.gcsUri = reader.string(); + break; + } + case 4: { + message.csvContent = reader.bytes(); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 5: { + message.importOptions = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportEvaluationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest} ImportEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEvaluationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportEvaluationsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportEvaluationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.conversationList != null && message.hasOwnProperty("conversationList")) { + properties.source = 1; + { + var error = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.verify(message.conversationList); + if (error) + return "conversationList." + error; + } + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + if (message.csvContent != null && message.hasOwnProperty("csvContent")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!(message.csvContent && typeof message.csvContent.length === "number" || $util.isString(message.csvContent))) + return "csvContent: buffer expected"; + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.importOptions != null && message.hasOwnProperty("importOptions")) { + var error = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.verify(message.importOptions); + if (error) + return "importOptions." + error; + } + return null; + }; + + /** + * Creates an ImportEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest} ImportEvaluationsRequest + */ + ImportEvaluationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ImportEvaluationsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ImportEvaluationsRequest(); + if (object.conversationList != null) { + if (typeof object.conversationList !== "object") + throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsRequest.conversationList: object expected"); + message.conversationList = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.fromObject(object.conversationList); + } + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.csvContent != null) + if (typeof object.csvContent === "string") + $util.base64.decode(object.csvContent, message.csvContent = $util.newBuffer($util.base64.length(object.csvContent)), 0); + else if (object.csvContent.length >= 0) + message.csvContent = object.csvContent; + if (object.parent != null) + message.parent = String(object.parent); + if (object.importOptions != null) { + if (typeof object.importOptions !== "object") + throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsRequest.importOptions: object expected"); + message.importOptions = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.fromObject(object.importOptions); + } + return message; + }; + + /** + * Creates a plain object from an ImportEvaluationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest} message ImportEvaluationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportEvaluationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.importOptions = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.conversationList != null && message.hasOwnProperty("conversationList")) { + object.conversationList = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.toObject(message.conversationList, options); + if (options.oneofs) + object.source = "conversationList"; + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.source = "gcsUri"; + } + if (message.csvContent != null && message.hasOwnProperty("csvContent")) { + object.csvContent = options.bytes === String ? $util.base64.encode(message.csvContent, 0, message.csvContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.csvContent) : message.csvContent; + if (options.oneofs) + object.source = "csvContent"; + } + if (message.importOptions != null && message.hasOwnProperty("importOptions")) + object.importOptions = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.toObject(message.importOptions, options); + return object; + }; + + /** + * Converts this ImportEvaluationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @instance + * @returns {Object.} JSON object + */ + ImportEvaluationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportEvaluationsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportEvaluationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportEvaluationsRequest"; + }; + + ImportEvaluationsRequest.ConversationList = (function() { + + /** + * Properties of a ConversationList. + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @interface IConversationList + * @property {Array.|null} [conversations] ConversationList conversations + */ + + /** + * Constructs a new ConversationList. + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @classdesc Represents a ConversationList. + * @implements IConversationList + * @constructor + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList=} [properties] Properties to set + */ + function ConversationList(properties) { + this.conversations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConversationList conversations. + * @member {Array.} conversations + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @instance + */ + ConversationList.prototype.conversations = $util.emptyArray; + + /** + * Creates a new ConversationList instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList} ConversationList instance + */ + ConversationList.create = function create(properties) { + return new ConversationList(properties); + }; + + /** + * Encodes the specified ConversationList message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList} message ConversationList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversations != null && message.conversations.length) + for (var i = 0; i < message.conversations.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversations[i]); + return writer; + }; + + /** + * Encodes the specified ConversationList message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList} message ConversationList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConversationList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList} ConversationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationList.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.conversations && message.conversations.length)) + message.conversations = []; + message.conversations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConversationList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList} ConversationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConversationList message. + * @function verify + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConversationList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conversations != null && message.hasOwnProperty("conversations")) { + if (!Array.isArray(message.conversations)) + return "conversations: array expected"; + for (var i = 0; i < message.conversations.length; ++i) + if (!$util.isString(message.conversations[i])) + return "conversations: string[] expected"; + } + return null; + }; + + /** + * Creates a ConversationList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList} ConversationList + */ + ConversationList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList) + return object; + var message = new $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList(); + if (object.conversations) { + if (!Array.isArray(object.conversations)) + throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.conversations: array expected"); + message.conversations = []; + for (var i = 0; i < object.conversations.length; ++i) + message.conversations[i] = String(object.conversations[i]); + } + return message; + }; + + /** + * Creates a plain object from a ConversationList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList} message ConversationList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConversationList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conversations = []; + if (message.conversations && message.conversations.length) { + object.conversations = []; + for (var j = 0; j < message.conversations.length; ++j) + object.conversations[j] = message.conversations[j]; + } + return object; + }; + + /** + * Converts this ConversationList to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @instance + * @returns {Object.} JSON object + */ + ConversationList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConversationList + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConversationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList"; + }; + + return ConversationList; + })(); + + ImportEvaluationsRequest.ImportOptions = (function() { + + /** + * Properties of an ImportOptions. + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @interface IImportOptions + * @property {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy|null} [conflictResolutionStrategy] ImportOptions conflictResolutionStrategy + */ + + /** + * Constructs a new ImportOptions. + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @classdesc Represents an ImportOptions. + * @implements IImportOptions + * @constructor + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions=} [properties] Properties to set + */ + function ImportOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportOptions conflictResolutionStrategy. + * @member {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy} conflictResolutionStrategy + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @instance + */ + ImportOptions.prototype.conflictResolutionStrategy = 0; + + /** + * Creates a new ImportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions} ImportOptions instance + */ + ImportOptions.create = function create(properties) { + return new ImportOptions(properties); + }; + + /** + * Encodes the specified ImportOptions message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions} message ImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conflictResolutionStrategy != null && Object.hasOwnProperty.call(message, "conflictResolutionStrategy")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.conflictResolutionStrategy); + return writer; + }; + + /** + * Encodes the specified ImportOptions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions} message ImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions} ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.conflictResolutionStrategy = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions} ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportOptions message. + * @function verify + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conflictResolutionStrategy != null && message.hasOwnProperty("conflictResolutionStrategy")) + switch (message.conflictResolutionStrategy) { + default: + return "conflictResolutionStrategy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an ImportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions} ImportOptions + */ + ImportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions) + return object; + var message = new $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions(); + switch (object.conflictResolutionStrategy) { + default: + if (typeof object.conflictResolutionStrategy === "number") { + message.conflictResolutionStrategy = object.conflictResolutionStrategy; + break; + } + break; + case "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED": + case 0: + message.conflictResolutionStrategy = 0; + break; + case "OVERWRITE": + case 1: + message.conflictResolutionStrategy = 1; + break; + case "SKIP": + case 2: + message.conflictResolutionStrategy = 2; + break; + case "DUPLICATE": + case 3: + message.conflictResolutionStrategy = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an ImportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions} message ImportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.conflictResolutionStrategy = options.enums === String ? "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED" : 0; + if (message.conflictResolutionStrategy != null && message.hasOwnProperty("conflictResolutionStrategy")) + object.conflictResolutionStrategy = options.enums === String ? $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy[message.conflictResolutionStrategy] === undefined ? message.conflictResolutionStrategy : $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy[message.conflictResolutionStrategy] : message.conflictResolutionStrategy; + return object; + }; + + /** + * Converts this ImportOptions to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @instance + * @returns {Object.} JSON object + */ + ImportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportOptions + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions"; + }; + + /** + * ConflictResolutionStrategy enum. + * @name google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy + * @enum {number} + * @property {number} CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED=0 CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED value + * @property {number} OVERWRITE=1 OVERWRITE value + * @property {number} SKIP=2 SKIP value + * @property {number} DUPLICATE=3 DUPLICATE value + */ + ImportOptions.ConflictResolutionStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "OVERWRITE"] = 1; + values[valuesById[2] = "SKIP"] = 2; + values[valuesById[3] = "DUPLICATE"] = 3; + return values; + })(); + + return ImportOptions; + })(); + + return ImportEvaluationsRequest; + })(); + + v1beta.ImportEvaluationsResponse = (function() { + + /** + * Properties of an ImportEvaluationsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IImportEvaluationsResponse + * @property {Array.|null} [evaluations] ImportEvaluationsResponse evaluations + * @property {Array.|null} [errorMessages] ImportEvaluationsResponse errorMessages + * @property {number|null} [importFailureCount] ImportEvaluationsResponse importFailureCount + */ + + /** + * Constructs a new ImportEvaluationsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ImportEvaluationsResponse. + * @implements IImportEvaluationsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IImportEvaluationsResponse=} [properties] Properties to set + */ + function ImportEvaluationsResponse(properties) { + this.evaluations = []; + this.errorMessages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportEvaluationsResponse evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @instance + */ + ImportEvaluationsResponse.prototype.evaluations = $util.emptyArray; + + /** + * ImportEvaluationsResponse errorMessages. + * @member {Array.} errorMessages + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @instance + */ + ImportEvaluationsResponse.prototype.errorMessages = $util.emptyArray; + + /** + * ImportEvaluationsResponse importFailureCount. + * @member {number} importFailureCount + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @instance + */ + ImportEvaluationsResponse.prototype.importFailureCount = 0; + + /** + * Creates a new ImportEvaluationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @static + * @param {google.cloud.ces.v1beta.IImportEvaluationsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ImportEvaluationsResponse} ImportEvaluationsResponse instance + */ + ImportEvaluationsResponse.create = function create(properties) { + return new ImportEvaluationsResponse(properties); + }; + + /** + * Encodes the specified ImportEvaluationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @static + * @param {google.cloud.ces.v1beta.IImportEvaluationsResponse} message ImportEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEvaluationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + $root.google.cloud.ces.v1beta.Evaluation.encode(message.evaluations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.errorMessages != null && message.errorMessages.length) + for (var i = 0; i < message.errorMessages.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessages[i]); + if (message.importFailureCount != null && Object.hasOwnProperty.call(message, "importFailureCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.importFailureCount); + return writer; + }; + + /** + * Encodes the specified ImportEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @static + * @param {google.cloud.ces.v1beta.IImportEvaluationsResponse} message ImportEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEvaluationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportEvaluationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ImportEvaluationsResponse} ImportEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEvaluationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportEvaluationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push($root.google.cloud.ces.v1beta.Evaluation.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.errorMessages && message.errorMessages.length)) + message.errorMessages = []; + message.errorMessages.push(reader.string()); + break; + } + case 3: { + message.importFailureCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportEvaluationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ImportEvaluationsResponse} ImportEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEvaluationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportEvaluationsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportEvaluationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Evaluation.verify(message.evaluations[i]); + if (error) + return "evaluations." + error; + } + } + if (message.errorMessages != null && message.hasOwnProperty("errorMessages")) { + if (!Array.isArray(message.errorMessages)) + return "errorMessages: array expected"; + for (var i = 0; i < message.errorMessages.length; ++i) + if (!$util.isString(message.errorMessages[i])) + return "errorMessages: string[] expected"; + } + if (message.importFailureCount != null && message.hasOwnProperty("importFailureCount")) + if (!$util.isInteger(message.importFailureCount)) + return "importFailureCount: integer expected"; + return null; + }; + + /** + * Creates an ImportEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ImportEvaluationsResponse} ImportEvaluationsResponse + */ + ImportEvaluationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ImportEvaluationsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ImportEvaluationsResponse(); + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsResponse.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) { + if (typeof object.evaluations[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsResponse.evaluations: object expected"); + message.evaluations[i] = $root.google.cloud.ces.v1beta.Evaluation.fromObject(object.evaluations[i]); + } + } + if (object.errorMessages) { + if (!Array.isArray(object.errorMessages)) + throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsResponse.errorMessages: array expected"); + message.errorMessages = []; + for (var i = 0; i < object.errorMessages.length; ++i) + message.errorMessages[i] = String(object.errorMessages[i]); + } + if (object.importFailureCount != null) + message.importFailureCount = object.importFailureCount | 0; + return message; + }; + + /** + * Creates a plain object from an ImportEvaluationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsResponse} message ImportEvaluationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportEvaluationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.evaluations = []; + object.errorMessages = []; + } + if (options.defaults) + object.importFailureCount = 0; + if (message.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = $root.google.cloud.ces.v1beta.Evaluation.toObject(message.evaluations[j], options); + } + if (message.errorMessages && message.errorMessages.length) { + object.errorMessages = []; + for (var j = 0; j < message.errorMessages.length; ++j) + object.errorMessages[j] = message.errorMessages[j]; + } + if (message.importFailureCount != null && message.hasOwnProperty("importFailureCount")) + object.importFailureCount = message.importFailureCount; + return object; + }; + + /** + * Converts this ImportEvaluationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @instance + * @returns {Object.} JSON object + */ + ImportEvaluationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportEvaluationsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportEvaluationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportEvaluationsResponse"; + }; + + return ImportEvaluationsResponse; + })(); + + v1beta.ImportEvaluationsOperationMetadata = (function() { + + /** + * Properties of an ImportEvaluationsOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @interface IImportEvaluationsOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] ImportEvaluationsOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] ImportEvaluationsOperationMetadata endTime + * @property {string|null} [statusMessage] ImportEvaluationsOperationMetadata statusMessage + */ + + /** + * Constructs a new ImportEvaluationsOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ImportEvaluationsOperationMetadata. + * @implements IImportEvaluationsOperationMetadata + * @constructor + * @param {google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata=} [properties] Properties to set + */ + function ImportEvaluationsOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportEvaluationsOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @instance + */ + ImportEvaluationsOperationMetadata.prototype.createTime = null; + + /** + * ImportEvaluationsOperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @instance + */ + ImportEvaluationsOperationMetadata.prototype.endTime = null; + + /** + * ImportEvaluationsOperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @instance + */ + ImportEvaluationsOperationMetadata.prototype.statusMessage = ""; + + /** + * Creates a new ImportEvaluationsOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata} ImportEvaluationsOperationMetadata instance + */ + ImportEvaluationsOperationMetadata.create = function create(properties) { + return new ImportEvaluationsOperationMetadata(properties); + }; + + /** + * Encodes the specified ImportEvaluationsOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata} message ImportEvaluationsOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEvaluationsOperationMetadata.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.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.statusMessage); + return writer; + }; + + /** + * Encodes the specified ImportEvaluationsOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata} message ImportEvaluationsOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEvaluationsOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportEvaluationsOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata} ImportEvaluationsOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEvaluationsOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + 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.statusMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportEvaluationsOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata} ImportEvaluationsOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEvaluationsOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportEvaluationsOperationMetadata message. + * @function verify + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportEvaluationsOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + return null; + }; + + /** + * Creates an ImportEvaluationsOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata} ImportEvaluationsOperationMetadata + */ + ImportEvaluationsOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata) + return object; + var message = new $root.google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata.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.ces.v1beta.ImportEvaluationsOperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + return message; + }; + + /** + * Creates a plain object from an ImportEvaluationsOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata} message ImportEvaluationsOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportEvaluationsOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.statusMessage = ""; + } + 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.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + return object; + }; + + /** + * Converts this ImportEvaluationsOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportEvaluationsOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportEvaluationsOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportEvaluationsOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata"; + }; + + return ImportEvaluationsOperationMetadata; + })(); + + v1beta.CreateEvaluationDatasetRequest = (function() { + + /** + * Properties of a CreateEvaluationDatasetRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateEvaluationDatasetRequest + * @property {string|null} [parent] CreateEvaluationDatasetRequest parent + * @property {string|null} [evaluationDatasetId] CreateEvaluationDatasetRequest evaluationDatasetId + * @property {google.cloud.ces.v1beta.IEvaluationDataset|null} [evaluationDataset] CreateEvaluationDatasetRequest evaluationDataset + */ + + /** + * Constructs a new CreateEvaluationDatasetRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateEvaluationDatasetRequest. + * @implements ICreateEvaluationDatasetRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest=} [properties] Properties to set + */ + function CreateEvaluationDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEvaluationDatasetRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @instance + */ + CreateEvaluationDatasetRequest.prototype.parent = ""; + + /** + * CreateEvaluationDatasetRequest evaluationDatasetId. + * @member {string} evaluationDatasetId + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @instance + */ + CreateEvaluationDatasetRequest.prototype.evaluationDatasetId = ""; + + /** + * CreateEvaluationDatasetRequest evaluationDataset. + * @member {google.cloud.ces.v1beta.IEvaluationDataset|null|undefined} evaluationDataset + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @instance + */ + CreateEvaluationDatasetRequest.prototype.evaluationDataset = null; + + /** + * Creates a new CreateEvaluationDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateEvaluationDatasetRequest} CreateEvaluationDatasetRequest instance + */ + CreateEvaluationDatasetRequest.create = function create(properties) { + return new CreateEvaluationDatasetRequest(properties); + }; + + /** + * Encodes the specified CreateEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest} message CreateEvaluationDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEvaluationDatasetRequest.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.evaluationDatasetId != null && Object.hasOwnProperty.call(message, "evaluationDatasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluationDatasetId); + if (message.evaluationDataset != null && Object.hasOwnProperty.call(message, "evaluationDataset")) + $root.google.cloud.ces.v1beta.EvaluationDataset.encode(message.evaluationDataset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest} message CreateEvaluationDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEvaluationDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEvaluationDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateEvaluationDatasetRequest} CreateEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEvaluationDatasetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.evaluationDatasetId = reader.string(); + break; + } + case 3: { + message.evaluationDataset = $root.google.cloud.ces.v1beta.EvaluationDataset.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEvaluationDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateEvaluationDatasetRequest} CreateEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEvaluationDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEvaluationDatasetRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEvaluationDatasetRequest.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.evaluationDatasetId != null && message.hasOwnProperty("evaluationDatasetId")) + if (!$util.isString(message.evaluationDatasetId)) + return "evaluationDatasetId: string expected"; + if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) { + var error = $root.google.cloud.ces.v1beta.EvaluationDataset.verify(message.evaluationDataset); + if (error) + return "evaluationDataset." + error; + } + return null; + }; + + /** + * Creates a CreateEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateEvaluationDatasetRequest} CreateEvaluationDatasetRequest + */ + CreateEvaluationDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.evaluationDatasetId != null) + message.evaluationDatasetId = String(object.evaluationDatasetId); + if (object.evaluationDataset != null) { + if (typeof object.evaluationDataset !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateEvaluationDatasetRequest.evaluationDataset: object expected"); + message.evaluationDataset = $root.google.cloud.ces.v1beta.EvaluationDataset.fromObject(object.evaluationDataset); + } + return message; + }; + + /** + * Creates a plain object from a CreateEvaluationDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.CreateEvaluationDatasetRequest} message CreateEvaluationDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEvaluationDatasetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.evaluationDatasetId = ""; + object.evaluationDataset = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.evaluationDatasetId != null && message.hasOwnProperty("evaluationDatasetId")) + object.evaluationDatasetId = message.evaluationDatasetId; + if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) + object.evaluationDataset = $root.google.cloud.ces.v1beta.EvaluationDataset.toObject(message.evaluationDataset, options); + return object; + }; + + /** + * Converts this CreateEvaluationDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEvaluationDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEvaluationDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEvaluationDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateEvaluationDatasetRequest"; + }; + + return CreateEvaluationDatasetRequest; + })(); + + v1beta.UpdateEvaluationRequest = (function() { + + /** + * Properties of an UpdateEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateEvaluationRequest + * @property {google.cloud.ces.v1beta.IEvaluation|null} [evaluation] UpdateEvaluationRequest evaluation + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEvaluationRequest updateMask + */ + + /** + * Constructs a new UpdateEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateEvaluationRequest. + * @implements IUpdateEvaluationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateEvaluationRequest=} [properties] Properties to set + */ + function UpdateEvaluationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateEvaluationRequest evaluation. + * @member {google.cloud.ces.v1beta.IEvaluation|null|undefined} evaluation + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @instance + */ + UpdateEvaluationRequest.prototype.evaluation = null; + + /** + * UpdateEvaluationRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @instance + */ + UpdateEvaluationRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateEvaluationRequest} UpdateEvaluationRequest instance + */ + UpdateEvaluationRequest.create = function create(properties) { + return new UpdateEvaluationRequest(properties); + }; + + /** + * Encodes the specified UpdateEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateEvaluationRequest} message UpdateEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEvaluationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluation != null && Object.hasOwnProperty.call(message, "evaluation")) + $root.google.cloud.ces.v1beta.Evaluation.encode(message.evaluation, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateEvaluationRequest} message UpdateEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateEvaluationRequest} UpdateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEvaluationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateEvaluationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.evaluation = $root.google.cloud.ces.v1beta.Evaluation.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateEvaluationRequest} UpdateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEvaluationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEvaluationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluation != null && message.hasOwnProperty("evaluation")) { + var error = $root.google.cloud.ces.v1beta.Evaluation.verify(message.evaluation); + if (error) + return "evaluation." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateEvaluationRequest} UpdateEvaluationRequest + */ + UpdateEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateEvaluationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateEvaluationRequest(); + if (object.evaluation != null) { + if (typeof object.evaluation !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateEvaluationRequest.evaluation: object expected"); + message.evaluation = $root.google.cloud.ces.v1beta.Evaluation.fromObject(object.evaluation); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateEvaluationRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateEvaluationRequest} message UpdateEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEvaluationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.evaluation = null; + object.updateMask = null; + } + if (message.evaluation != null && message.hasOwnProperty("evaluation")) + object.evaluation = $root.google.cloud.ces.v1beta.Evaluation.toObject(message.evaluation, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateEvaluationRequest"; + }; + + return UpdateEvaluationRequest; + })(); + + v1beta.UpdateEvaluationDatasetRequest = (function() { + + /** + * Properties of an UpdateEvaluationDatasetRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateEvaluationDatasetRequest + * @property {google.cloud.ces.v1beta.IEvaluationDataset|null} [evaluationDataset] UpdateEvaluationDatasetRequest evaluationDataset + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEvaluationDatasetRequest updateMask + */ + + /** + * Constructs a new UpdateEvaluationDatasetRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateEvaluationDatasetRequest. + * @implements IUpdateEvaluationDatasetRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest=} [properties] Properties to set + */ + function UpdateEvaluationDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateEvaluationDatasetRequest evaluationDataset. + * @member {google.cloud.ces.v1beta.IEvaluationDataset|null|undefined} evaluationDataset + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @instance + */ + UpdateEvaluationDatasetRequest.prototype.evaluationDataset = null; + + /** + * UpdateEvaluationDatasetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @instance + */ + UpdateEvaluationDatasetRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateEvaluationDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest} UpdateEvaluationDatasetRequest instance + */ + UpdateEvaluationDatasetRequest.create = function create(properties) { + return new UpdateEvaluationDatasetRequest(properties); + }; + + /** + * Encodes the specified UpdateEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest} message UpdateEvaluationDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEvaluationDatasetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationDataset != null && Object.hasOwnProperty.call(message, "evaluationDataset")) + $root.google.cloud.ces.v1beta.EvaluationDataset.encode(message.evaluationDataset, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest} message UpdateEvaluationDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEvaluationDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEvaluationDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest} UpdateEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEvaluationDatasetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.evaluationDataset = $root.google.cloud.ces.v1beta.EvaluationDataset.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateEvaluationDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest} UpdateEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEvaluationDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEvaluationDatasetRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEvaluationDatasetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) { + var error = $root.google.cloud.ces.v1beta.EvaluationDataset.verify(message.evaluationDataset); + if (error) + return "evaluationDataset." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest} UpdateEvaluationDatasetRequest + */ + UpdateEvaluationDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest(); + if (object.evaluationDataset != null) { + if (typeof object.evaluationDataset !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest.evaluationDataset: object expected"); + message.evaluationDataset = $root.google.cloud.ces.v1beta.EvaluationDataset.fromObject(object.evaluationDataset); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateEvaluationDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest} message UpdateEvaluationDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEvaluationDatasetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.evaluationDataset = null; + object.updateMask = null; + } + if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) + object.evaluationDataset = $root.google.cloud.ces.v1beta.EvaluationDataset.toObject(message.evaluationDataset, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateEvaluationDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEvaluationDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEvaluationDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEvaluationDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest"; + }; + + return UpdateEvaluationDatasetRequest; + })(); + + v1beta.DeleteEvaluationRequest = (function() { + + /** + * Properties of a DeleteEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteEvaluationRequest + * @property {string|null} [name] DeleteEvaluationRequest name + * @property {boolean|null} [force] DeleteEvaluationRequest force + * @property {string|null} [etag] DeleteEvaluationRequest etag + */ + + /** + * Constructs a new DeleteEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteEvaluationRequest. + * @implements IDeleteEvaluationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRequest=} [properties] Properties to set + */ + function DeleteEvaluationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEvaluationRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @instance + */ + DeleteEvaluationRequest.prototype.name = ""; + + /** + * DeleteEvaluationRequest force. + * @member {boolean} force + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @instance + */ + DeleteEvaluationRequest.prototype.force = false; + + /** + * DeleteEvaluationRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @instance + */ + DeleteEvaluationRequest.prototype.etag = ""; + + /** + * Creates a new DeleteEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRequest} DeleteEvaluationRequest instance + */ + DeleteEvaluationRequest.create = function create(properties) { + return new DeleteEvaluationRequest(properties); + }; + + /** + * Encodes the specified DeleteEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRequest} message DeleteEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRequest} message DeleteEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRequest} DeleteEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteEvaluationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRequest} DeleteEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEvaluationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEvaluationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRequest} DeleteEvaluationRequest + */ + DeleteEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteEvaluationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteEvaluationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteEvaluationRequest} message DeleteEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEvaluationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteEvaluationRequest"; + }; + + return DeleteEvaluationRequest; + })(); + + v1beta.DeleteEvaluationResultRequest = (function() { + + /** + * Properties of a DeleteEvaluationResultRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteEvaluationResultRequest + * @property {string|null} [name] DeleteEvaluationResultRequest name + */ + + /** + * Constructs a new DeleteEvaluationResultRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteEvaluationResultRequest. + * @implements IDeleteEvaluationResultRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteEvaluationResultRequest=} [properties] Properties to set + */ + function DeleteEvaluationResultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEvaluationResultRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @instance + */ + DeleteEvaluationResultRequest.prototype.name = ""; + + /** + * Creates a new DeleteEvaluationResultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationResultRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteEvaluationResultRequest} DeleteEvaluationResultRequest instance + */ + DeleteEvaluationResultRequest.create = function create(properties) { + return new DeleteEvaluationResultRequest(properties); + }; + + /** + * Encodes the specified DeleteEvaluationResultRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationResultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationResultRequest} message DeleteEvaluationResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationResultRequest.encode = function encode(message, writer) { + 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 DeleteEvaluationResultRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationResultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationResultRequest} message DeleteEvaluationResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationResultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEvaluationResultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteEvaluationResultRequest} DeleteEvaluationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationResultRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteEvaluationResultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEvaluationResultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteEvaluationResultRequest} DeleteEvaluationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationResultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEvaluationResultRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEvaluationResultRequest.verify = function verify(message) { + if (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 DeleteEvaluationResultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteEvaluationResultRequest} DeleteEvaluationResultRequest + */ + DeleteEvaluationResultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteEvaluationResultRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteEvaluationResultRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteEvaluationResultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteEvaluationResultRequest} message DeleteEvaluationResultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEvaluationResultRequest.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 DeleteEvaluationResultRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEvaluationResultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEvaluationResultRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEvaluationResultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteEvaluationResultRequest"; + }; + + return DeleteEvaluationResultRequest; + })(); + + v1beta.DeleteEvaluationDatasetRequest = (function() { + + /** + * Properties of a DeleteEvaluationDatasetRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteEvaluationDatasetRequest + * @property {string|null} [name] DeleteEvaluationDatasetRequest name + * @property {string|null} [etag] DeleteEvaluationDatasetRequest etag + */ + + /** + * Constructs a new DeleteEvaluationDatasetRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteEvaluationDatasetRequest. + * @implements IDeleteEvaluationDatasetRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest=} [properties] Properties to set + */ + function DeleteEvaluationDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEvaluationDatasetRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @instance + */ + DeleteEvaluationDatasetRequest.prototype.name = ""; + + /** + * DeleteEvaluationDatasetRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @instance + */ + DeleteEvaluationDatasetRequest.prototype.etag = ""; + + /** + * Creates a new DeleteEvaluationDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest} DeleteEvaluationDatasetRequest instance + */ + DeleteEvaluationDatasetRequest.create = function create(properties) { + return new DeleteEvaluationDatasetRequest(properties); + }; + + /** + * Encodes the specified DeleteEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest} message DeleteEvaluationDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationDatasetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest} message DeleteEvaluationDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEvaluationDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest} DeleteEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationDatasetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEvaluationDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest} DeleteEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEvaluationDatasetRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEvaluationDatasetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest} DeleteEvaluationDatasetRequest + */ + DeleteEvaluationDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteEvaluationDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest} message DeleteEvaluationDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEvaluationDatasetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteEvaluationDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEvaluationDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEvaluationDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEvaluationDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest"; + }; + + return DeleteEvaluationDatasetRequest; + })(); + + v1beta.DeleteEvaluationRunRequest = (function() { + + /** + * Properties of a DeleteEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteEvaluationRunRequest + * @property {string|null} [name] DeleteEvaluationRunRequest name + */ + + /** + * Constructs a new DeleteEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteEvaluationRunRequest. + * @implements IDeleteEvaluationRunRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunRequest=} [properties] Properties to set + */ + function DeleteEvaluationRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEvaluationRunRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @instance + */ + DeleteEvaluationRunRequest.prototype.name = ""; + + /** + * Creates a new DeleteEvaluationRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunRequest} DeleteEvaluationRunRequest instance + */ + DeleteEvaluationRunRequest.create = function create(properties) { + return new DeleteEvaluationRunRequest(properties); + }; + + /** + * Encodes the specified DeleteEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunRequest} message DeleteEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationRunRequest.encode = function encode(message, writer) { + 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 DeleteEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunRequest} message DeleteEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEvaluationRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunRequest} DeleteEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationRunRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteEvaluationRunRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunRequest} DeleteEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEvaluationRunRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEvaluationRunRequest.verify = function verify(message) { + if (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 DeleteEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunRequest} DeleteEvaluationRunRequest + */ + DeleteEvaluationRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteEvaluationRunRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteEvaluationRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteEvaluationRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteEvaluationRunRequest} message DeleteEvaluationRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEvaluationRunRequest.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 DeleteEvaluationRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEvaluationRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEvaluationRunRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEvaluationRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteEvaluationRunRequest"; + }; + + return DeleteEvaluationRunRequest; + })(); + + v1beta.GetEvaluationRequest = (function() { + + /** + * Properties of a GetEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetEvaluationRequest + * @property {string|null} [name] GetEvaluationRequest name + */ + + /** + * Constructs a new GetEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetEvaluationRequest. + * @implements IGetEvaluationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetEvaluationRequest=} [properties] Properties to set + */ + function GetEvaluationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvaluationRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @instance + */ + GetEvaluationRequest.prototype.name = ""; + + /** + * Creates a new GetEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetEvaluationRequest} GetEvaluationRequest instance + */ + GetEvaluationRequest.create = function create(properties) { + return new GetEvaluationRequest(properties); + }; + + /** + * Encodes the specified GetEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationRequest} message GetEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationRequest.encode = function encode(message, writer) { + 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 GetEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationRequest} message GetEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetEvaluationRequest} GetEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetEvaluationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetEvaluationRequest} GetEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvaluationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvaluationRequest.verify = function verify(message) { + if (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 GetEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetEvaluationRequest} GetEvaluationRequest + */ + GetEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetEvaluationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetEvaluationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.GetEvaluationRequest} message GetEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvaluationRequest.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 GetEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetEvaluationRequest"; + }; + + return GetEvaluationRequest; + })(); + + v1beta.GetEvaluationResultRequest = (function() { + + /** + * Properties of a GetEvaluationResultRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetEvaluationResultRequest + * @property {string|null} [name] GetEvaluationResultRequest name + */ + + /** + * Constructs a new GetEvaluationResultRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetEvaluationResultRequest. + * @implements IGetEvaluationResultRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetEvaluationResultRequest=} [properties] Properties to set + */ + function GetEvaluationResultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvaluationResultRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @instance + */ + GetEvaluationResultRequest.prototype.name = ""; + + /** + * Creates a new GetEvaluationResultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationResultRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetEvaluationResultRequest} GetEvaluationResultRequest instance + */ + GetEvaluationResultRequest.create = function create(properties) { + return new GetEvaluationResultRequest(properties); + }; + + /** + * Encodes the specified GetEvaluationResultRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationResultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationResultRequest} message GetEvaluationResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationResultRequest.encode = function encode(message, writer) { + 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 GetEvaluationResultRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationResultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationResultRequest} message GetEvaluationResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationResultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvaluationResultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetEvaluationResultRequest} GetEvaluationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationResultRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetEvaluationResultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvaluationResultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetEvaluationResultRequest} GetEvaluationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationResultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvaluationResultRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvaluationResultRequest.verify = function verify(message) { + if (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 GetEvaluationResultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetEvaluationResultRequest} GetEvaluationResultRequest + */ + GetEvaluationResultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetEvaluationResultRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetEvaluationResultRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEvaluationResultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @static + * @param {google.cloud.ces.v1beta.GetEvaluationResultRequest} message GetEvaluationResultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvaluationResultRequest.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 GetEvaluationResultRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvaluationResultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEvaluationResultRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEvaluationResultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetEvaluationResultRequest"; + }; + + return GetEvaluationResultRequest; + })(); + + v1beta.GetEvaluationDatasetRequest = (function() { + + /** + * Properties of a GetEvaluationDatasetRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetEvaluationDatasetRequest + * @property {string|null} [name] GetEvaluationDatasetRequest name + */ + + /** + * Constructs a new GetEvaluationDatasetRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetEvaluationDatasetRequest. + * @implements IGetEvaluationDatasetRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetEvaluationDatasetRequest=} [properties] Properties to set + */ + function GetEvaluationDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvaluationDatasetRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @instance + */ + GetEvaluationDatasetRequest.prototype.name = ""; + + /** + * Creates a new GetEvaluationDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetEvaluationDatasetRequest} GetEvaluationDatasetRequest instance + */ + GetEvaluationDatasetRequest.create = function create(properties) { + return new GetEvaluationDatasetRequest(properties); + }; + + /** + * Encodes the specified GetEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationDatasetRequest} message GetEvaluationDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationDatasetRequest.encode = function encode(message, writer) { + 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 GetEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationDatasetRequest} message GetEvaluationDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvaluationDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetEvaluationDatasetRequest} GetEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationDatasetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetEvaluationDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvaluationDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetEvaluationDatasetRequest} GetEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvaluationDatasetRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvaluationDatasetRequest.verify = function verify(message) { + if (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 GetEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetEvaluationDatasetRequest} GetEvaluationDatasetRequest + */ + GetEvaluationDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetEvaluationDatasetRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetEvaluationDatasetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEvaluationDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.GetEvaluationDatasetRequest} message GetEvaluationDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvaluationDatasetRequest.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 GetEvaluationDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvaluationDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEvaluationDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEvaluationDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetEvaluationDatasetRequest"; + }; + + return GetEvaluationDatasetRequest; + })(); + + v1beta.GetEvaluationRunRequest = (function() { + + /** + * Properties of a GetEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetEvaluationRunRequest + * @property {string|null} [name] GetEvaluationRunRequest name + */ + + /** + * Constructs a new GetEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetEvaluationRunRequest. + * @implements IGetEvaluationRunRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetEvaluationRunRequest=} [properties] Properties to set + */ + function GetEvaluationRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvaluationRunRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @instance + */ + GetEvaluationRunRequest.prototype.name = ""; + + /** + * Creates a new GetEvaluationRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationRunRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetEvaluationRunRequest} GetEvaluationRunRequest instance + */ + GetEvaluationRunRequest.create = function create(properties) { + return new GetEvaluationRunRequest(properties); + }; + + /** + * Encodes the specified GetEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationRunRequest} message GetEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationRunRequest.encode = function encode(message, writer) { + 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 GetEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationRunRequest} message GetEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvaluationRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetEvaluationRunRequest} GetEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationRunRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetEvaluationRunRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetEvaluationRunRequest} GetEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvaluationRunRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvaluationRunRequest.verify = function verify(message) { + if (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 GetEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetEvaluationRunRequest} GetEvaluationRunRequest + */ + GetEvaluationRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetEvaluationRunRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetEvaluationRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEvaluationRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.GetEvaluationRunRequest} message GetEvaluationRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvaluationRunRequest.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 GetEvaluationRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvaluationRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEvaluationRunRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEvaluationRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetEvaluationRunRequest"; + }; + + return GetEvaluationRunRequest; + })(); + + v1beta.ListEvaluationsRequest = (function() { + + /** + * Properties of a ListEvaluationsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationsRequest + * @property {string|null} [parent] ListEvaluationsRequest parent + * @property {number|null} [pageSize] ListEvaluationsRequest pageSize + * @property {string|null} [pageToken] ListEvaluationsRequest pageToken + * @property {string|null} [filter] ListEvaluationsRequest filter + * @property {string|null} [evaluationFilter] ListEvaluationsRequest evaluationFilter + * @property {string|null} [evaluationRunFilter] ListEvaluationsRequest evaluationRunFilter + * @property {string|null} [orderBy] ListEvaluationsRequest orderBy + * @property {boolean|null} [lastTenResults] ListEvaluationsRequest lastTenResults + */ + + /** + * Constructs a new ListEvaluationsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationsRequest. + * @implements IListEvaluationsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationsRequest=} [properties] Properties to set + */ + function ListEvaluationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.parent = ""; + + /** + * ListEvaluationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.pageSize = 0; + + /** + * ListEvaluationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.pageToken = ""; + + /** + * ListEvaluationsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.filter = ""; + + /** + * ListEvaluationsRequest evaluationFilter. + * @member {string} evaluationFilter + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.evaluationFilter = ""; + + /** + * ListEvaluationsRequest evaluationRunFilter. + * @member {string} evaluationRunFilter + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.evaluationRunFilter = ""; + + /** + * ListEvaluationsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.orderBy = ""; + + /** + * ListEvaluationsRequest lastTenResults. + * @member {boolean} lastTenResults + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.lastTenResults = false; + + /** + * Creates a new ListEvaluationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationsRequest} ListEvaluationsRequest instance + */ + ListEvaluationsRequest.create = function create(properties) { + return new ListEvaluationsRequest(properties); + }; + + /** + * Encodes the specified ListEvaluationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationsRequest} message ListEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationsRequest.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.lastTenResults != null && Object.hasOwnProperty.call(message, "lastTenResults")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.lastTenResults); + if (message.evaluationFilter != null && Object.hasOwnProperty.call(message, "evaluationFilter")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.evaluationFilter); + if (message.evaluationRunFilter != null && Object.hasOwnProperty.call(message, "evaluationRunFilter")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.evaluationRunFilter); + return writer; + }; + + /** + * Encodes the specified ListEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationsRequest} message ListEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationsRequest} ListEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 7: { + message.evaluationFilter = reader.string(); + break; + } + case 8: { + message.evaluationRunFilter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 6: { + message.lastTenResults = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationsRequest} ListEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationsRequest.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.evaluationFilter != null && message.hasOwnProperty("evaluationFilter")) + if (!$util.isString(message.evaluationFilter)) + return "evaluationFilter: string expected"; + if (message.evaluationRunFilter != null && message.hasOwnProperty("evaluationRunFilter")) + if (!$util.isString(message.evaluationRunFilter)) + return "evaluationRunFilter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.lastTenResults != null && message.hasOwnProperty("lastTenResults")) + if (typeof message.lastTenResults !== "boolean") + return "lastTenResults: boolean expected"; + return null; + }; + + /** + * Creates a ListEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationsRequest} ListEvaluationsRequest + */ + ListEvaluationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationsRequest(); + 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.evaluationFilter != null) + message.evaluationFilter = String(object.evaluationFilter); + if (object.evaluationRunFilter != null) + message.evaluationRunFilter = String(object.evaluationRunFilter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.lastTenResults != null) + message.lastTenResults = Boolean(object.lastTenResults); + return message; + }; + + /** + * Creates a plain object from a ListEvaluationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationsRequest} message ListEvaluationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationsRequest.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.lastTenResults = false; + object.evaluationFilter = ""; + object.evaluationRunFilter = ""; + } + 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.lastTenResults != null && message.hasOwnProperty("lastTenResults")) + object.lastTenResults = message.lastTenResults; + if (message.evaluationFilter != null && message.hasOwnProperty("evaluationFilter")) + object.evaluationFilter = message.evaluationFilter; + if (message.evaluationRunFilter != null && message.hasOwnProperty("evaluationRunFilter")) + object.evaluationRunFilter = message.evaluationRunFilter; + return object; + }; + + /** + * Converts this ListEvaluationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationsRequest"; + }; + + return ListEvaluationsRequest; + })(); + + v1beta.ListEvaluationResultsRequest = (function() { + + /** + * Properties of a ListEvaluationResultsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationResultsRequest + * @property {string|null} [parent] ListEvaluationResultsRequest parent + * @property {number|null} [pageSize] ListEvaluationResultsRequest pageSize + * @property {string|null} [pageToken] ListEvaluationResultsRequest pageToken + * @property {string|null} [filter] ListEvaluationResultsRequest filter + * @property {string|null} [orderBy] ListEvaluationResultsRequest orderBy + */ + + /** + * Constructs a new ListEvaluationResultsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationResultsRequest. + * @implements IListEvaluationResultsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationResultsRequest=} [properties] Properties to set + */ + function ListEvaluationResultsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationResultsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @instance + */ + ListEvaluationResultsRequest.prototype.parent = ""; + + /** + * ListEvaluationResultsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @instance + */ + ListEvaluationResultsRequest.prototype.pageSize = 0; + + /** + * ListEvaluationResultsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @instance + */ + ListEvaluationResultsRequest.prototype.pageToken = ""; + + /** + * ListEvaluationResultsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @instance + */ + ListEvaluationResultsRequest.prototype.filter = ""; + + /** + * ListEvaluationResultsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @instance + */ + ListEvaluationResultsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListEvaluationResultsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationResultsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationResultsRequest} ListEvaluationResultsRequest instance + */ + ListEvaluationResultsRequest.create = function create(properties) { + return new ListEvaluationResultsRequest(properties); + }; + + /** + * Encodes the specified ListEvaluationResultsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationResultsRequest} message ListEvaluationResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationResultsRequest.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 ListEvaluationResultsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationResultsRequest} message ListEvaluationResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationResultsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationResultsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationResultsRequest} ListEvaluationResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationResultsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationResultsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationResultsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationResultsRequest} ListEvaluationResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationResultsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationResultsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationResultsRequest.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 ListEvaluationResultsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationResultsRequest} ListEvaluationResultsRequest + */ + ListEvaluationResultsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationResultsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationResultsRequest(); + 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 ListEvaluationResultsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationResultsRequest} message ListEvaluationResultsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationResultsRequest.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 ListEvaluationResultsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationResultsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationResultsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationResultsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationResultsRequest"; + }; + + return ListEvaluationResultsRequest; + })(); + + v1beta.ListEvaluationDatasetsRequest = (function() { + + /** + * Properties of a ListEvaluationDatasetsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationDatasetsRequest + * @property {string|null} [parent] ListEvaluationDatasetsRequest parent + * @property {number|null} [pageSize] ListEvaluationDatasetsRequest pageSize + * @property {string|null} [pageToken] ListEvaluationDatasetsRequest pageToken + * @property {string|null} [filter] ListEvaluationDatasetsRequest filter + * @property {string|null} [orderBy] ListEvaluationDatasetsRequest orderBy + */ + + /** + * Constructs a new ListEvaluationDatasetsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationDatasetsRequest. + * @implements IListEvaluationDatasetsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsRequest=} [properties] Properties to set + */ + function ListEvaluationDatasetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationDatasetsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @instance + */ + ListEvaluationDatasetsRequest.prototype.parent = ""; + + /** + * ListEvaluationDatasetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @instance + */ + ListEvaluationDatasetsRequest.prototype.pageSize = 0; + + /** + * ListEvaluationDatasetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @instance + */ + ListEvaluationDatasetsRequest.prototype.pageToken = ""; + + /** + * ListEvaluationDatasetsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @instance + */ + ListEvaluationDatasetsRequest.prototype.filter = ""; + + /** + * ListEvaluationDatasetsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @instance + */ + ListEvaluationDatasetsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListEvaluationDatasetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsRequest} ListEvaluationDatasetsRequest instance + */ + ListEvaluationDatasetsRequest.create = function create(properties) { + return new ListEvaluationDatasetsRequest(properties); + }; + + /** + * Encodes the specified ListEvaluationDatasetsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsRequest} message ListEvaluationDatasetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationDatasetsRequest.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 ListEvaluationDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsRequest} message ListEvaluationDatasetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationDatasetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationDatasetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsRequest} ListEvaluationDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationDatasetsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationDatasetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsRequest} ListEvaluationDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationDatasetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationDatasetsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationDatasetsRequest.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 ListEvaluationDatasetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsRequest} ListEvaluationDatasetsRequest + */ + ListEvaluationDatasetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest(); + 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 ListEvaluationDatasetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationDatasetsRequest} message ListEvaluationDatasetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationDatasetsRequest.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 ListEvaluationDatasetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationDatasetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationDatasetsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationDatasetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationDatasetsRequest"; + }; + + return ListEvaluationDatasetsRequest; + })(); + + v1beta.ListEvaluationRunsRequest = (function() { + + /** + * Properties of a ListEvaluationRunsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationRunsRequest + * @property {string|null} [parent] ListEvaluationRunsRequest parent + * @property {number|null} [pageSize] ListEvaluationRunsRequest pageSize + * @property {string|null} [pageToken] ListEvaluationRunsRequest pageToken + * @property {string|null} [filter] ListEvaluationRunsRequest filter + * @property {string|null} [orderBy] ListEvaluationRunsRequest orderBy + */ + + /** + * Constructs a new ListEvaluationRunsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationRunsRequest. + * @implements IListEvaluationRunsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationRunsRequest=} [properties] Properties to set + */ + function ListEvaluationRunsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationRunsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @instance + */ + ListEvaluationRunsRequest.prototype.parent = ""; + + /** + * ListEvaluationRunsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @instance + */ + ListEvaluationRunsRequest.prototype.pageSize = 0; + + /** + * ListEvaluationRunsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @instance + */ + ListEvaluationRunsRequest.prototype.pageToken = ""; + + /** + * ListEvaluationRunsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @instance + */ + ListEvaluationRunsRequest.prototype.filter = ""; + + /** + * ListEvaluationRunsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @instance + */ + ListEvaluationRunsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListEvaluationRunsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationRunsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationRunsRequest} ListEvaluationRunsRequest instance + */ + ListEvaluationRunsRequest.create = function create(properties) { + return new ListEvaluationRunsRequest(properties); + }; + + /** + * Encodes the specified ListEvaluationRunsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationRunsRequest} message ListEvaluationRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationRunsRequest.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 ListEvaluationRunsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationRunsRequest} message ListEvaluationRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationRunsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationRunsRequest} ListEvaluationRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationRunsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationRunsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationRunsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationRunsRequest} ListEvaluationRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationRunsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationRunsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationRunsRequest.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 ListEvaluationRunsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationRunsRequest} ListEvaluationRunsRequest + */ + ListEvaluationRunsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationRunsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationRunsRequest(); + 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 ListEvaluationRunsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationRunsRequest} message ListEvaluationRunsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationRunsRequest.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 ListEvaluationRunsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationRunsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationRunsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationRunsRequest"; + }; + + return ListEvaluationRunsRequest; + })(); + + v1beta.ListEvaluationsResponse = (function() { + + /** + * Properties of a ListEvaluationsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationsResponse + * @property {Array.|null} [evaluations] ListEvaluationsResponse evaluations + * @property {string|null} [nextPageToken] ListEvaluationsResponse nextPageToken + */ + + /** + * Constructs a new ListEvaluationsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationsResponse. + * @implements IListEvaluationsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationsResponse=} [properties] Properties to set + */ + function ListEvaluationsResponse(properties) { + this.evaluations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationsResponse evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @instance + */ + ListEvaluationsResponse.prototype.evaluations = $util.emptyArray; + + /** + * ListEvaluationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @instance + */ + ListEvaluationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEvaluationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationsResponse} ListEvaluationsResponse instance + */ + ListEvaluationsResponse.create = function create(properties) { + return new ListEvaluationsResponse(properties); + }; + + /** + * Encodes the specified ListEvaluationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationsResponse} message ListEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + $root.google.cloud.ces.v1beta.Evaluation.encode(message.evaluations[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 ListEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationsResponse} message ListEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationsResponse} ListEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push($root.google.cloud.ces.v1beta.Evaluation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationsResponse} ListEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Evaluation.verify(message.evaluations[i]); + if (error) + return "evaluations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationsResponse} ListEvaluationsResponse + */ + ListEvaluationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationsResponse(); + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationsResponse.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) { + if (typeof object.evaluations[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationsResponse.evaluations: object expected"); + message.evaluations[i] = $root.google.cloud.ces.v1beta.Evaluation.fromObject(object.evaluations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEvaluationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationsResponse} message ListEvaluationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = $root.google.cloud.ces.v1beta.Evaluation.toObject(message.evaluations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEvaluationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationsResponse"; + }; + + return ListEvaluationsResponse; + })(); + + v1beta.ListEvaluationResultsResponse = (function() { + + /** + * Properties of a ListEvaluationResultsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationResultsResponse + * @property {Array.|null} [evaluationResults] ListEvaluationResultsResponse evaluationResults + * @property {string|null} [nextPageToken] ListEvaluationResultsResponse nextPageToken + */ + + /** + * Constructs a new ListEvaluationResultsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationResultsResponse. + * @implements IListEvaluationResultsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationResultsResponse=} [properties] Properties to set + */ + function ListEvaluationResultsResponse(properties) { + this.evaluationResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationResultsResponse evaluationResults. + * @member {Array.} evaluationResults + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @instance + */ + ListEvaluationResultsResponse.prototype.evaluationResults = $util.emptyArray; + + /** + * ListEvaluationResultsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @instance + */ + ListEvaluationResultsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEvaluationResultsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationResultsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationResultsResponse} ListEvaluationResultsResponse instance + */ + ListEvaluationResultsResponse.create = function create(properties) { + return new ListEvaluationResultsResponse(properties); + }; + + /** + * Encodes the specified ListEvaluationResultsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationResultsResponse} message ListEvaluationResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationResultsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationResults != null && message.evaluationResults.length) + for (var i = 0; i < message.evaluationResults.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.encode(message.evaluationResults[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 ListEvaluationResultsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationResultsResponse} message ListEvaluationResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationResultsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationResultsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationResultsResponse} ListEvaluationResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationResultsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationResultsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.evaluationResults && message.evaluationResults.length)) + message.evaluationResults = []; + message.evaluationResults.push($root.google.cloud.ces.v1beta.EvaluationResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationResultsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationResultsResponse} ListEvaluationResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationResultsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationResultsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationResultsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationResults != null && message.hasOwnProperty("evaluationResults")) { + if (!Array.isArray(message.evaluationResults)) + return "evaluationResults: array expected"; + for (var i = 0; i < message.evaluationResults.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.verify(message.evaluationResults[i]); + if (error) + return "evaluationResults." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEvaluationResultsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationResultsResponse} ListEvaluationResultsResponse + */ + ListEvaluationResultsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationResultsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationResultsResponse(); + if (object.evaluationResults) { + if (!Array.isArray(object.evaluationResults)) + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationResultsResponse.evaluationResults: array expected"); + message.evaluationResults = []; + for (var i = 0; i < object.evaluationResults.length; ++i) { + if (typeof object.evaluationResults[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationResultsResponse.evaluationResults: object expected"); + message.evaluationResults[i] = $root.google.cloud.ces.v1beta.EvaluationResult.fromObject(object.evaluationResults[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEvaluationResultsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationResultsResponse} message ListEvaluationResultsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationResultsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluationResults = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.evaluationResults && message.evaluationResults.length) { + object.evaluationResults = []; + for (var j = 0; j < message.evaluationResults.length; ++j) + object.evaluationResults[j] = $root.google.cloud.ces.v1beta.EvaluationResult.toObject(message.evaluationResults[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEvaluationResultsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationResultsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationResultsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationResultsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationResultsResponse"; + }; + + return ListEvaluationResultsResponse; + })(); + + v1beta.ListEvaluationDatasetsResponse = (function() { + + /** + * Properties of a ListEvaluationDatasetsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationDatasetsResponse + * @property {Array.|null} [evaluationDatasets] ListEvaluationDatasetsResponse evaluationDatasets + * @property {string|null} [nextPageToken] ListEvaluationDatasetsResponse nextPageToken + */ + + /** + * Constructs a new ListEvaluationDatasetsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationDatasetsResponse. + * @implements IListEvaluationDatasetsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsResponse=} [properties] Properties to set + */ + function ListEvaluationDatasetsResponse(properties) { + this.evaluationDatasets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationDatasetsResponse evaluationDatasets. + * @member {Array.} evaluationDatasets + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @instance + */ + ListEvaluationDatasetsResponse.prototype.evaluationDatasets = $util.emptyArray; + + /** + * ListEvaluationDatasetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @instance + */ + ListEvaluationDatasetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEvaluationDatasetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsResponse} ListEvaluationDatasetsResponse instance + */ + ListEvaluationDatasetsResponse.create = function create(properties) { + return new ListEvaluationDatasetsResponse(properties); + }; + + /** + * Encodes the specified ListEvaluationDatasetsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsResponse} message ListEvaluationDatasetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationDatasetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationDatasets != null && message.evaluationDatasets.length) + for (var i = 0; i < message.evaluationDatasets.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationDataset.encode(message.evaluationDatasets[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 ListEvaluationDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsResponse} message ListEvaluationDatasetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationDatasetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationDatasetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsResponse} ListEvaluationDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationDatasetsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationDatasetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.evaluationDatasets && message.evaluationDatasets.length)) + message.evaluationDatasets = []; + message.evaluationDatasets.push($root.google.cloud.ces.v1beta.EvaluationDataset.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationDatasetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsResponse} ListEvaluationDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationDatasetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationDatasetsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationDatasetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationDatasets != null && message.hasOwnProperty("evaluationDatasets")) { + if (!Array.isArray(message.evaluationDatasets)) + return "evaluationDatasets: array expected"; + for (var i = 0; i < message.evaluationDatasets.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationDataset.verify(message.evaluationDatasets[i]); + if (error) + return "evaluationDatasets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEvaluationDatasetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsResponse} ListEvaluationDatasetsResponse + */ + ListEvaluationDatasetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationDatasetsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationDatasetsResponse(); + if (object.evaluationDatasets) { + if (!Array.isArray(object.evaluationDatasets)) + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.evaluationDatasets: array expected"); + message.evaluationDatasets = []; + for (var i = 0; i < object.evaluationDatasets.length; ++i) { + if (typeof object.evaluationDatasets[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.evaluationDatasets: object expected"); + message.evaluationDatasets[i] = $root.google.cloud.ces.v1beta.EvaluationDataset.fromObject(object.evaluationDatasets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEvaluationDatasetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationDatasetsResponse} message ListEvaluationDatasetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationDatasetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluationDatasets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.evaluationDatasets && message.evaluationDatasets.length) { + object.evaluationDatasets = []; + for (var j = 0; j < message.evaluationDatasets.length; ++j) + object.evaluationDatasets[j] = $root.google.cloud.ces.v1beta.EvaluationDataset.toObject(message.evaluationDatasets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEvaluationDatasetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationDatasetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationDatasetsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationDatasetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationDatasetsResponse"; + }; + + return ListEvaluationDatasetsResponse; + })(); + + v1beta.ListEvaluationRunsResponse = (function() { + + /** + * Properties of a ListEvaluationRunsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationRunsResponse + * @property {Array.|null} [evaluationRuns] ListEvaluationRunsResponse evaluationRuns + * @property {string|null} [nextPageToken] ListEvaluationRunsResponse nextPageToken + */ + + /** + * Constructs a new ListEvaluationRunsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationRunsResponse. + * @implements IListEvaluationRunsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationRunsResponse=} [properties] Properties to set + */ + function ListEvaluationRunsResponse(properties) { + this.evaluationRuns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationRunsResponse evaluationRuns. + * @member {Array.} evaluationRuns + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @instance + */ + ListEvaluationRunsResponse.prototype.evaluationRuns = $util.emptyArray; + + /** + * ListEvaluationRunsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @instance + */ + ListEvaluationRunsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEvaluationRunsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationRunsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationRunsResponse} ListEvaluationRunsResponse instance + */ + ListEvaluationRunsResponse.create = function create(properties) { + return new ListEvaluationRunsResponse(properties); + }; + + /** + * Encodes the specified ListEvaluationRunsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationRunsResponse} message ListEvaluationRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationRunsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationRuns != null && message.evaluationRuns.length) + for (var i = 0; i < message.evaluationRuns.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationRun.encode(message.evaluationRuns[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 ListEvaluationRunsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationRunsResponse} message ListEvaluationRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationRunsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationRunsResponse} ListEvaluationRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationRunsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationRunsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.evaluationRuns && message.evaluationRuns.length)) + message.evaluationRuns = []; + message.evaluationRuns.push($root.google.cloud.ces.v1beta.EvaluationRun.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationRunsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationRunsResponse} ListEvaluationRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationRunsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationRunsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationRunsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationRuns != null && message.hasOwnProperty("evaluationRuns")) { + if (!Array.isArray(message.evaluationRuns)) + return "evaluationRuns: array expected"; + for (var i = 0; i < message.evaluationRuns.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationRun.verify(message.evaluationRuns[i]); + if (error) + return "evaluationRuns." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEvaluationRunsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationRunsResponse} ListEvaluationRunsResponse + */ + ListEvaluationRunsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationRunsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationRunsResponse(); + if (object.evaluationRuns) { + if (!Array.isArray(object.evaluationRuns)) + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationRunsResponse.evaluationRuns: array expected"); + message.evaluationRuns = []; + for (var i = 0; i < object.evaluationRuns.length; ++i) { + if (typeof object.evaluationRuns[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationRunsResponse.evaluationRuns: object expected"); + message.evaluationRuns[i] = $root.google.cloud.ces.v1beta.EvaluationRun.fromObject(object.evaluationRuns[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEvaluationRunsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationRunsResponse} message ListEvaluationRunsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationRunsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluationRuns = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.evaluationRuns && message.evaluationRuns.length) { + object.evaluationRuns = []; + for (var j = 0; j < message.evaluationRuns.length; ++j) + object.evaluationRuns[j] = $root.google.cloud.ces.v1beta.EvaluationRun.toObject(message.evaluationRuns[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEvaluationRunsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationRunsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationRunsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationRunsResponse"; + }; + + return ListEvaluationRunsResponse; + })(); + + v1beta.CreateScheduledEvaluationRunRequest = (function() { + + /** + * Properties of a CreateScheduledEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateScheduledEvaluationRunRequest + * @property {string|null} [parent] CreateScheduledEvaluationRunRequest parent + * @property {string|null} [scheduledEvaluationRunId] CreateScheduledEvaluationRunRequest scheduledEvaluationRunId + * @property {google.cloud.ces.v1beta.IScheduledEvaluationRun|null} [scheduledEvaluationRun] CreateScheduledEvaluationRunRequest scheduledEvaluationRun + */ + + /** + * Constructs a new CreateScheduledEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateScheduledEvaluationRunRequest. + * @implements ICreateScheduledEvaluationRunRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest=} [properties] Properties to set + */ + function CreateScheduledEvaluationRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateScheduledEvaluationRunRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @instance + */ + CreateScheduledEvaluationRunRequest.prototype.parent = ""; + + /** + * CreateScheduledEvaluationRunRequest scheduledEvaluationRunId. + * @member {string} scheduledEvaluationRunId + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @instance + */ + CreateScheduledEvaluationRunRequest.prototype.scheduledEvaluationRunId = ""; + + /** + * CreateScheduledEvaluationRunRequest scheduledEvaluationRun. + * @member {google.cloud.ces.v1beta.IScheduledEvaluationRun|null|undefined} scheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @instance + */ + CreateScheduledEvaluationRunRequest.prototype.scheduledEvaluationRun = null; + + /** + * Creates a new CreateScheduledEvaluationRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest} CreateScheduledEvaluationRunRequest instance + */ + CreateScheduledEvaluationRunRequest.create = function create(properties) { + return new CreateScheduledEvaluationRunRequest(properties); + }; + + /** + * Encodes the specified CreateScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest} message CreateScheduledEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateScheduledEvaluationRunRequest.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.scheduledEvaluationRunId != null && Object.hasOwnProperty.call(message, "scheduledEvaluationRunId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.scheduledEvaluationRunId); + if (message.scheduledEvaluationRun != null && Object.hasOwnProperty.call(message, "scheduledEvaluationRun")) + $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.encode(message.scheduledEvaluationRun, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest} message CreateScheduledEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateScheduledEvaluationRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateScheduledEvaluationRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest} CreateScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateScheduledEvaluationRunRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.scheduledEvaluationRunId = reader.string(); + break; + } + case 3: { + message.scheduledEvaluationRun = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest} CreateScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateScheduledEvaluationRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateScheduledEvaluationRunRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateScheduledEvaluationRunRequest.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.scheduledEvaluationRunId != null && message.hasOwnProperty("scheduledEvaluationRunId")) + if (!$util.isString(message.scheduledEvaluationRunId)) + return "scheduledEvaluationRunId: string expected"; + if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) { + var error = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.verify(message.scheduledEvaluationRun); + if (error) + return "scheduledEvaluationRun." + error; + } + return null; + }; + + /** + * Creates a CreateScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest} CreateScheduledEvaluationRunRequest + */ + CreateScheduledEvaluationRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.scheduledEvaluationRunId != null) + message.scheduledEvaluationRunId = String(object.scheduledEvaluationRunId); + if (object.scheduledEvaluationRun != null) { + if (typeof object.scheduledEvaluationRun !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest.scheduledEvaluationRun: object expected"); + message.scheduledEvaluationRun = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.fromObject(object.scheduledEvaluationRun); + } + return message; + }; + + /** + * Creates a plain object from a CreateScheduledEvaluationRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest} message CreateScheduledEvaluationRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateScheduledEvaluationRunRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.scheduledEvaluationRunId = ""; + object.scheduledEvaluationRun = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.scheduledEvaluationRunId != null && message.hasOwnProperty("scheduledEvaluationRunId")) + object.scheduledEvaluationRunId = message.scheduledEvaluationRunId; + if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) + object.scheduledEvaluationRun = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.toObject(message.scheduledEvaluationRun, options); + return object; + }; + + /** + * Converts this CreateScheduledEvaluationRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @instance + * @returns {Object.} JSON object + */ + CreateScheduledEvaluationRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateScheduledEvaluationRunRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateScheduledEvaluationRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest"; + }; + + return CreateScheduledEvaluationRunRequest; + })(); + + v1beta.GetScheduledEvaluationRunRequest = (function() { + + /** + * Properties of a GetScheduledEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetScheduledEvaluationRunRequest + * @property {string|null} [name] GetScheduledEvaluationRunRequest name + */ + + /** + * Constructs a new GetScheduledEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetScheduledEvaluationRunRequest. + * @implements IGetScheduledEvaluationRunRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest=} [properties] Properties to set + */ + function GetScheduledEvaluationRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetScheduledEvaluationRunRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @instance + */ + GetScheduledEvaluationRunRequest.prototype.name = ""; + + /** + * Creates a new GetScheduledEvaluationRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest} GetScheduledEvaluationRunRequest instance + */ + GetScheduledEvaluationRunRequest.create = function create(properties) { + return new GetScheduledEvaluationRunRequest(properties); + }; + + /** + * Encodes the specified GetScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest} message GetScheduledEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScheduledEvaluationRunRequest.encode = function encode(message, writer) { + 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 GetScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest} message GetScheduledEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScheduledEvaluationRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetScheduledEvaluationRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest} GetScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScheduledEvaluationRunRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest} GetScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScheduledEvaluationRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetScheduledEvaluationRunRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetScheduledEvaluationRunRequest.verify = function verify(message) { + if (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 GetScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest} GetScheduledEvaluationRunRequest + */ + GetScheduledEvaluationRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetScheduledEvaluationRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest} message GetScheduledEvaluationRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetScheduledEvaluationRunRequest.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 GetScheduledEvaluationRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @instance + * @returns {Object.} JSON object + */ + GetScheduledEvaluationRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetScheduledEvaluationRunRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetScheduledEvaluationRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest"; + }; + + return GetScheduledEvaluationRunRequest; + })(); + + v1beta.ListScheduledEvaluationRunsRequest = (function() { + + /** + * Properties of a ListScheduledEvaluationRunsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListScheduledEvaluationRunsRequest + * @property {string|null} [parent] ListScheduledEvaluationRunsRequest parent + * @property {number|null} [pageSize] ListScheduledEvaluationRunsRequest pageSize + * @property {string|null} [pageToken] ListScheduledEvaluationRunsRequest pageToken + * @property {string|null} [filter] ListScheduledEvaluationRunsRequest filter + * @property {string|null} [orderBy] ListScheduledEvaluationRunsRequest orderBy + */ + + /** + * Constructs a new ListScheduledEvaluationRunsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListScheduledEvaluationRunsRequest. + * @implements IListScheduledEvaluationRunsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest=} [properties] Properties to set + */ + function ListScheduledEvaluationRunsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListScheduledEvaluationRunsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @instance + */ + ListScheduledEvaluationRunsRequest.prototype.parent = ""; + + /** + * ListScheduledEvaluationRunsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @instance + */ + ListScheduledEvaluationRunsRequest.prototype.pageSize = 0; + + /** + * ListScheduledEvaluationRunsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @instance + */ + ListScheduledEvaluationRunsRequest.prototype.pageToken = ""; + + /** + * ListScheduledEvaluationRunsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @instance + */ + ListScheduledEvaluationRunsRequest.prototype.filter = ""; + + /** + * ListScheduledEvaluationRunsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @instance + */ + ListScheduledEvaluationRunsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListScheduledEvaluationRunsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @static + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest} ListScheduledEvaluationRunsRequest instance + */ + ListScheduledEvaluationRunsRequest.create = function create(properties) { + return new ListScheduledEvaluationRunsRequest(properties); + }; + + /** + * Encodes the specified ListScheduledEvaluationRunsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @static + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest} message ListScheduledEvaluationRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScheduledEvaluationRunsRequest.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 ListScheduledEvaluationRunsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @static + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest} message ListScheduledEvaluationRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScheduledEvaluationRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListScheduledEvaluationRunsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest} ListScheduledEvaluationRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScheduledEvaluationRunsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListScheduledEvaluationRunsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest} ListScheduledEvaluationRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScheduledEvaluationRunsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListScheduledEvaluationRunsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListScheduledEvaluationRunsRequest.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 ListScheduledEvaluationRunsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest} ListScheduledEvaluationRunsRequest + */ + ListScheduledEvaluationRunsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest(); + 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 ListScheduledEvaluationRunsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @static + * @param {google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest} message ListScheduledEvaluationRunsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListScheduledEvaluationRunsRequest.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 ListScheduledEvaluationRunsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @instance + * @returns {Object.} JSON object + */ + ListScheduledEvaluationRunsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListScheduledEvaluationRunsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListScheduledEvaluationRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest"; + }; + + return ListScheduledEvaluationRunsRequest; + })(); + + v1beta.ListScheduledEvaluationRunsResponse = (function() { + + /** + * Properties of a ListScheduledEvaluationRunsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListScheduledEvaluationRunsResponse + * @property {Array.|null} [scheduledEvaluationRuns] ListScheduledEvaluationRunsResponse scheduledEvaluationRuns + * @property {string|null} [nextPageToken] ListScheduledEvaluationRunsResponse nextPageToken + */ + + /** + * Constructs a new ListScheduledEvaluationRunsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListScheduledEvaluationRunsResponse. + * @implements IListScheduledEvaluationRunsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse=} [properties] Properties to set + */ + function ListScheduledEvaluationRunsResponse(properties) { + this.scheduledEvaluationRuns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListScheduledEvaluationRunsResponse scheduledEvaluationRuns. + * @member {Array.} scheduledEvaluationRuns + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @instance + */ + ListScheduledEvaluationRunsResponse.prototype.scheduledEvaluationRuns = $util.emptyArray; + + /** + * ListScheduledEvaluationRunsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @instance + */ + ListScheduledEvaluationRunsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListScheduledEvaluationRunsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @static + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse} ListScheduledEvaluationRunsResponse instance + */ + ListScheduledEvaluationRunsResponse.create = function create(properties) { + return new ListScheduledEvaluationRunsResponse(properties); + }; + + /** + * Encodes the specified ListScheduledEvaluationRunsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @static + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse} message ListScheduledEvaluationRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScheduledEvaluationRunsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scheduledEvaluationRuns != null && message.scheduledEvaluationRuns.length) + for (var i = 0; i < message.scheduledEvaluationRuns.length; ++i) + $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.encode(message.scheduledEvaluationRuns[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 ListScheduledEvaluationRunsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @static + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse} message ListScheduledEvaluationRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScheduledEvaluationRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListScheduledEvaluationRunsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse} ListScheduledEvaluationRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScheduledEvaluationRunsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.scheduledEvaluationRuns && message.scheduledEvaluationRuns.length)) + message.scheduledEvaluationRuns = []; + message.scheduledEvaluationRuns.push($root.google.cloud.ces.v1beta.ScheduledEvaluationRun.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListScheduledEvaluationRunsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse} ListScheduledEvaluationRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScheduledEvaluationRunsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListScheduledEvaluationRunsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListScheduledEvaluationRunsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scheduledEvaluationRuns != null && message.hasOwnProperty("scheduledEvaluationRuns")) { + if (!Array.isArray(message.scheduledEvaluationRuns)) + return "scheduledEvaluationRuns: array expected"; + for (var i = 0; i < message.scheduledEvaluationRuns.length; ++i) { + var error = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.verify(message.scheduledEvaluationRuns[i]); + if (error) + return "scheduledEvaluationRuns." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListScheduledEvaluationRunsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse} ListScheduledEvaluationRunsResponse + */ + ListScheduledEvaluationRunsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse(); + if (object.scheduledEvaluationRuns) { + if (!Array.isArray(object.scheduledEvaluationRuns)) + throw TypeError(".google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.scheduledEvaluationRuns: array expected"); + message.scheduledEvaluationRuns = []; + for (var i = 0; i < object.scheduledEvaluationRuns.length; ++i) { + if (typeof object.scheduledEvaluationRuns[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.scheduledEvaluationRuns: object expected"); + message.scheduledEvaluationRuns[i] = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.fromObject(object.scheduledEvaluationRuns[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListScheduledEvaluationRunsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @static + * @param {google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse} message ListScheduledEvaluationRunsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListScheduledEvaluationRunsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scheduledEvaluationRuns = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.scheduledEvaluationRuns && message.scheduledEvaluationRuns.length) { + object.scheduledEvaluationRuns = []; + for (var j = 0; j < message.scheduledEvaluationRuns.length; ++j) + object.scheduledEvaluationRuns[j] = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.toObject(message.scheduledEvaluationRuns[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListScheduledEvaluationRunsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @instance + * @returns {Object.} JSON object + */ + ListScheduledEvaluationRunsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListScheduledEvaluationRunsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListScheduledEvaluationRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse"; + }; + + return ListScheduledEvaluationRunsResponse; + })(); + + v1beta.UpdateScheduledEvaluationRunRequest = (function() { + + /** + * Properties of an UpdateScheduledEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateScheduledEvaluationRunRequest + * @property {google.cloud.ces.v1beta.IScheduledEvaluationRun|null} [scheduledEvaluationRun] UpdateScheduledEvaluationRunRequest scheduledEvaluationRun + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateScheduledEvaluationRunRequest updateMask + */ + + /** + * Constructs a new UpdateScheduledEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateScheduledEvaluationRunRequest. + * @implements IUpdateScheduledEvaluationRunRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest=} [properties] Properties to set + */ + function UpdateScheduledEvaluationRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateScheduledEvaluationRunRequest scheduledEvaluationRun. + * @member {google.cloud.ces.v1beta.IScheduledEvaluationRun|null|undefined} scheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @instance + */ + UpdateScheduledEvaluationRunRequest.prototype.scheduledEvaluationRun = null; + + /** + * UpdateScheduledEvaluationRunRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @instance + */ + UpdateScheduledEvaluationRunRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateScheduledEvaluationRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest} UpdateScheduledEvaluationRunRequest instance + */ + UpdateScheduledEvaluationRunRequest.create = function create(properties) { + return new UpdateScheduledEvaluationRunRequest(properties); + }; + + /** + * Encodes the specified UpdateScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest} message UpdateScheduledEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateScheduledEvaluationRunRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scheduledEvaluationRun != null && Object.hasOwnProperty.call(message, "scheduledEvaluationRun")) + $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.encode(message.scheduledEvaluationRun, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest} message UpdateScheduledEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateScheduledEvaluationRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateScheduledEvaluationRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest} UpdateScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateScheduledEvaluationRunRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.scheduledEvaluationRun = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest} UpdateScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateScheduledEvaluationRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateScheduledEvaluationRunRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateScheduledEvaluationRunRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) { + var error = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.verify(message.scheduledEvaluationRun); + if (error) + return "scheduledEvaluationRun." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest} UpdateScheduledEvaluationRunRequest + */ + UpdateScheduledEvaluationRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest(); + if (object.scheduledEvaluationRun != null) { + if (typeof object.scheduledEvaluationRun !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest.scheduledEvaluationRun: object expected"); + message.scheduledEvaluationRun = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.fromObject(object.scheduledEvaluationRun); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateScheduledEvaluationRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest} message UpdateScheduledEvaluationRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateScheduledEvaluationRunRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scheduledEvaluationRun = null; + object.updateMask = null; + } + if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) + object.scheduledEvaluationRun = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.toObject(message.scheduledEvaluationRun, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateScheduledEvaluationRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateScheduledEvaluationRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateScheduledEvaluationRunRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateScheduledEvaluationRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest"; + }; + + return UpdateScheduledEvaluationRunRequest; + })(); + + v1beta.DeleteScheduledEvaluationRunRequest = (function() { + + /** + * Properties of a DeleteScheduledEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteScheduledEvaluationRunRequest + * @property {string|null} [name] DeleteScheduledEvaluationRunRequest name + * @property {string|null} [etag] DeleteScheduledEvaluationRunRequest etag + */ + + /** + * Constructs a new DeleteScheduledEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteScheduledEvaluationRunRequest. + * @implements IDeleteScheduledEvaluationRunRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest=} [properties] Properties to set + */ + function DeleteScheduledEvaluationRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteScheduledEvaluationRunRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @instance + */ + DeleteScheduledEvaluationRunRequest.prototype.name = ""; + + /** + * DeleteScheduledEvaluationRunRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @instance + */ + DeleteScheduledEvaluationRunRequest.prototype.etag = ""; + + /** + * Creates a new DeleteScheduledEvaluationRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest} DeleteScheduledEvaluationRunRequest instance + */ + DeleteScheduledEvaluationRunRequest.create = function create(properties) { + return new DeleteScheduledEvaluationRunRequest(properties); + }; + + /** + * Encodes the specified DeleteScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest} message DeleteScheduledEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteScheduledEvaluationRunRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest} message DeleteScheduledEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteScheduledEvaluationRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteScheduledEvaluationRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest} DeleteScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteScheduledEvaluationRunRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest} DeleteScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteScheduledEvaluationRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteScheduledEvaluationRunRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteScheduledEvaluationRunRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest} DeleteScheduledEvaluationRunRequest + */ + DeleteScheduledEvaluationRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteScheduledEvaluationRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest} message DeleteScheduledEvaluationRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteScheduledEvaluationRunRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteScheduledEvaluationRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteScheduledEvaluationRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteScheduledEvaluationRunRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteScheduledEvaluationRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest"; + }; + + return DeleteScheduledEvaluationRunRequest; + })(); + + v1beta.TestPersonaVoiceRequest = (function() { + + /** + * Properties of a TestPersonaVoiceRequest. + * @memberof google.cloud.ces.v1beta + * @interface ITestPersonaVoiceRequest + * @property {string|null} [app] TestPersonaVoiceRequest app + * @property {string|null} [personaId] TestPersonaVoiceRequest personaId + * @property {string|null} [text] TestPersonaVoiceRequest text + */ + + /** + * Constructs a new TestPersonaVoiceRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a TestPersonaVoiceRequest. + * @implements ITestPersonaVoiceRequest + * @constructor + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceRequest=} [properties] Properties to set + */ + function TestPersonaVoiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestPersonaVoiceRequest app. + * @member {string} app + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @instance + */ + TestPersonaVoiceRequest.prototype.app = ""; + + /** + * TestPersonaVoiceRequest personaId. + * @member {string} personaId + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @instance + */ + TestPersonaVoiceRequest.prototype.personaId = ""; + + /** + * TestPersonaVoiceRequest text. + * @member {string} text + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @instance + */ + TestPersonaVoiceRequest.prototype.text = ""; + + /** + * Creates a new TestPersonaVoiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @static + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TestPersonaVoiceRequest} TestPersonaVoiceRequest instance + */ + TestPersonaVoiceRequest.create = function create(properties) { + return new TestPersonaVoiceRequest(properties); + }; + + /** + * Encodes the specified TestPersonaVoiceRequest message. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @static + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceRequest} message TestPersonaVoiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestPersonaVoiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.app); + if (message.personaId != null && Object.hasOwnProperty.call(message, "personaId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.personaId); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.text); + return writer; + }; + + /** + * Encodes the specified TestPersonaVoiceRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @static + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceRequest} message TestPersonaVoiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestPersonaVoiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestPersonaVoiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TestPersonaVoiceRequest} TestPersonaVoiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestPersonaVoiceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TestPersonaVoiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.app = reader.string(); + break; + } + case 2: { + message.personaId = reader.string(); + break; + } + case 3: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestPersonaVoiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TestPersonaVoiceRequest} TestPersonaVoiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestPersonaVoiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestPersonaVoiceRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestPersonaVoiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.app != null && message.hasOwnProperty("app")) + if (!$util.isString(message.app)) + return "app: string expected"; + if (message.personaId != null && message.hasOwnProperty("personaId")) + if (!$util.isString(message.personaId)) + return "personaId: string expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a TestPersonaVoiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TestPersonaVoiceRequest} TestPersonaVoiceRequest + */ + TestPersonaVoiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TestPersonaVoiceRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.TestPersonaVoiceRequest(); + if (object.app != null) + message.app = String(object.app); + if (object.personaId != null) + message.personaId = String(object.personaId); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a TestPersonaVoiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @static + * @param {google.cloud.ces.v1beta.TestPersonaVoiceRequest} message TestPersonaVoiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestPersonaVoiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.app = ""; + object.personaId = ""; + object.text = ""; + } + if (message.app != null && message.hasOwnProperty("app")) + object.app = message.app; + if (message.personaId != null && message.hasOwnProperty("personaId")) + object.personaId = message.personaId; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this TestPersonaVoiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @instance + * @returns {Object.} JSON object + */ + TestPersonaVoiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestPersonaVoiceRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestPersonaVoiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TestPersonaVoiceRequest"; + }; + + return TestPersonaVoiceRequest; + })(); + + v1beta.UploadEvaluationAudioRequest = (function() { + + /** + * Properties of an UploadEvaluationAudioRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUploadEvaluationAudioRequest + * @property {string|null} [app] UploadEvaluationAudioRequest app + * @property {Uint8Array|null} [audioContent] UploadEvaluationAudioRequest audioContent + */ + + /** + * Constructs a new UploadEvaluationAudioRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UploadEvaluationAudioRequest. + * @implements IUploadEvaluationAudioRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioRequest=} [properties] Properties to set + */ + function UploadEvaluationAudioRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UploadEvaluationAudioRequest app. + * @member {string} app + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @instance + */ + UploadEvaluationAudioRequest.prototype.app = ""; + + /** + * UploadEvaluationAudioRequest audioContent. + * @member {Uint8Array} audioContent + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @instance + */ + UploadEvaluationAudioRequest.prototype.audioContent = $util.newBuffer([]); + + /** + * Creates a new UploadEvaluationAudioRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @static + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioRequest} UploadEvaluationAudioRequest instance + */ + UploadEvaluationAudioRequest.create = function create(properties) { + return new UploadEvaluationAudioRequest(properties); + }; + + /** + * Encodes the specified UploadEvaluationAudioRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @static + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioRequest} message UploadEvaluationAudioRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UploadEvaluationAudioRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.app); + if (message.audioContent != null && Object.hasOwnProperty.call(message, "audioContent")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audioContent); + return writer; + }; + + /** + * Encodes the specified UploadEvaluationAudioRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @static + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioRequest} message UploadEvaluationAudioRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UploadEvaluationAudioRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UploadEvaluationAudioRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioRequest} UploadEvaluationAudioRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UploadEvaluationAudioRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UploadEvaluationAudioRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.app = reader.string(); + break; + } + case 2: { + message.audioContent = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UploadEvaluationAudioRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioRequest} UploadEvaluationAudioRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UploadEvaluationAudioRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UploadEvaluationAudioRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UploadEvaluationAudioRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.app != null && message.hasOwnProperty("app")) + if (!$util.isString(message.app)) + return "app: string expected"; + if (message.audioContent != null && message.hasOwnProperty("audioContent")) + if (!(message.audioContent && typeof message.audioContent.length === "number" || $util.isString(message.audioContent))) + return "audioContent: buffer expected"; + return null; + }; + + /** + * Creates an UploadEvaluationAudioRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioRequest} UploadEvaluationAudioRequest + */ + UploadEvaluationAudioRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UploadEvaluationAudioRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UploadEvaluationAudioRequest(); + if (object.app != null) + message.app = String(object.app); + if (object.audioContent != null) + if (typeof object.audioContent === "string") + $util.base64.decode(object.audioContent, message.audioContent = $util.newBuffer($util.base64.length(object.audioContent)), 0); + else if (object.audioContent.length >= 0) + message.audioContent = object.audioContent; + return message; + }; + + /** + * Creates a plain object from an UploadEvaluationAudioRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @static + * @param {google.cloud.ces.v1beta.UploadEvaluationAudioRequest} message UploadEvaluationAudioRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UploadEvaluationAudioRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.app = ""; + if (options.bytes === String) + object.audioContent = ""; + else { + object.audioContent = []; + if (options.bytes !== Array) + object.audioContent = $util.newBuffer(object.audioContent); + } + } + if (message.app != null && message.hasOwnProperty("app")) + object.app = message.app; + if (message.audioContent != null && message.hasOwnProperty("audioContent")) + object.audioContent = options.bytes === String ? $util.base64.encode(message.audioContent, 0, message.audioContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.audioContent) : message.audioContent; + return object; + }; + + /** + * Converts this UploadEvaluationAudioRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @instance + * @returns {Object.} JSON object + */ + UploadEvaluationAudioRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UploadEvaluationAudioRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UploadEvaluationAudioRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UploadEvaluationAudioRequest"; + }; + + return UploadEvaluationAudioRequest; + })(); + + v1beta.UploadEvaluationAudioResponse = (function() { + + /** + * Properties of an UploadEvaluationAudioResponse. + * @memberof google.cloud.ces.v1beta + * @interface IUploadEvaluationAudioResponse + * @property {string|null} [audioGcsUri] UploadEvaluationAudioResponse audioGcsUri + * @property {string|null} [audioTranscript] UploadEvaluationAudioResponse audioTranscript + * @property {google.protobuf.IDuration|null} [audioDuration] UploadEvaluationAudioResponse audioDuration + */ + + /** + * Constructs a new UploadEvaluationAudioResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UploadEvaluationAudioResponse. + * @implements IUploadEvaluationAudioResponse + * @constructor + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioResponse=} [properties] Properties to set + */ + function UploadEvaluationAudioResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UploadEvaluationAudioResponse audioGcsUri. + * @member {string} audioGcsUri + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @instance + */ + UploadEvaluationAudioResponse.prototype.audioGcsUri = ""; + + /** + * UploadEvaluationAudioResponse audioTranscript. + * @member {string} audioTranscript + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @instance + */ + UploadEvaluationAudioResponse.prototype.audioTranscript = ""; + + /** + * UploadEvaluationAudioResponse audioDuration. + * @member {google.protobuf.IDuration|null|undefined} audioDuration + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @instance + */ + UploadEvaluationAudioResponse.prototype.audioDuration = null; + + /** + * Creates a new UploadEvaluationAudioResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @static + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioResponse} UploadEvaluationAudioResponse instance + */ + UploadEvaluationAudioResponse.create = function create(properties) { + return new UploadEvaluationAudioResponse(properties); + }; + + /** + * Encodes the specified UploadEvaluationAudioResponse message. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @static + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioResponse} message UploadEvaluationAudioResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UploadEvaluationAudioResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioGcsUri != null && Object.hasOwnProperty.call(message, "audioGcsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.audioGcsUri); + if (message.audioTranscript != null && Object.hasOwnProperty.call(message, "audioTranscript")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.audioTranscript); + if (message.audioDuration != null && Object.hasOwnProperty.call(message, "audioDuration")) + $root.google.protobuf.Duration.encode(message.audioDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UploadEvaluationAudioResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @static + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioResponse} message UploadEvaluationAudioResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UploadEvaluationAudioResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UploadEvaluationAudioResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioResponse} UploadEvaluationAudioResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UploadEvaluationAudioResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UploadEvaluationAudioResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audioGcsUri = reader.string(); + break; + } + case 2: { + message.audioTranscript = reader.string(); + break; + } + case 3: { + message.audioDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UploadEvaluationAudioResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioResponse} UploadEvaluationAudioResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UploadEvaluationAudioResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UploadEvaluationAudioResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UploadEvaluationAudioResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.audioGcsUri != null && message.hasOwnProperty("audioGcsUri")) + if (!$util.isString(message.audioGcsUri)) + return "audioGcsUri: string expected"; + if (message.audioTranscript != null && message.hasOwnProperty("audioTranscript")) + if (!$util.isString(message.audioTranscript)) + return "audioTranscript: string expected"; + if (message.audioDuration != null && message.hasOwnProperty("audioDuration")) { + var error = $root.google.protobuf.Duration.verify(message.audioDuration); + if (error) + return "audioDuration." + error; + } + return null; + }; + + /** + * Creates an UploadEvaluationAudioResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioResponse} UploadEvaluationAudioResponse + */ + UploadEvaluationAudioResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UploadEvaluationAudioResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.UploadEvaluationAudioResponse(); + if (object.audioGcsUri != null) + message.audioGcsUri = String(object.audioGcsUri); + if (object.audioTranscript != null) + message.audioTranscript = String(object.audioTranscript); + if (object.audioDuration != null) { + if (typeof object.audioDuration !== "object") + throw TypeError(".google.cloud.ces.v1beta.UploadEvaluationAudioResponse.audioDuration: object expected"); + message.audioDuration = $root.google.protobuf.Duration.fromObject(object.audioDuration); + } + return message; + }; + + /** + * Creates a plain object from an UploadEvaluationAudioResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @static + * @param {google.cloud.ces.v1beta.UploadEvaluationAudioResponse} message UploadEvaluationAudioResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UploadEvaluationAudioResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.audioGcsUri = ""; + object.audioTranscript = ""; + object.audioDuration = null; + } + if (message.audioGcsUri != null && message.hasOwnProperty("audioGcsUri")) + object.audioGcsUri = message.audioGcsUri; + if (message.audioTranscript != null && message.hasOwnProperty("audioTranscript")) + object.audioTranscript = message.audioTranscript; + if (message.audioDuration != null && message.hasOwnProperty("audioDuration")) + object.audioDuration = $root.google.protobuf.Duration.toObject(message.audioDuration, options); + return object; + }; + + /** + * Converts this UploadEvaluationAudioResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @instance + * @returns {Object.} JSON object + */ + UploadEvaluationAudioResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UploadEvaluationAudioResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UploadEvaluationAudioResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UploadEvaluationAudioResponse"; + }; + + return UploadEvaluationAudioResponse; + })(); + + v1beta.TestPersonaVoiceResponse = (function() { + + /** + * Properties of a TestPersonaVoiceResponse. + * @memberof google.cloud.ces.v1beta + * @interface ITestPersonaVoiceResponse + * @property {Uint8Array|null} [audio] TestPersonaVoiceResponse audio + */ + + /** + * Constructs a new TestPersonaVoiceResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a TestPersonaVoiceResponse. + * @implements ITestPersonaVoiceResponse + * @constructor + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceResponse=} [properties] Properties to set + */ + function TestPersonaVoiceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestPersonaVoiceResponse audio. + * @member {Uint8Array} audio + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @instance + */ + TestPersonaVoiceResponse.prototype.audio = $util.newBuffer([]); + + /** + * Creates a new TestPersonaVoiceResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @static + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TestPersonaVoiceResponse} TestPersonaVoiceResponse instance + */ + TestPersonaVoiceResponse.create = function create(properties) { + return new TestPersonaVoiceResponse(properties); + }; + + /** + * Encodes the specified TestPersonaVoiceResponse message. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @static + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceResponse} message TestPersonaVoiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestPersonaVoiceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.audio); + return writer; + }; + + /** + * Encodes the specified TestPersonaVoiceResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @static + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceResponse} message TestPersonaVoiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestPersonaVoiceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestPersonaVoiceResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TestPersonaVoiceResponse} TestPersonaVoiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestPersonaVoiceResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TestPersonaVoiceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audio = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestPersonaVoiceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TestPersonaVoiceResponse} TestPersonaVoiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestPersonaVoiceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestPersonaVoiceResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestPersonaVoiceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.audio != null && message.hasOwnProperty("audio")) + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; + return null; + }; + + /** + * Creates a TestPersonaVoiceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TestPersonaVoiceResponse} TestPersonaVoiceResponse + */ + TestPersonaVoiceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TestPersonaVoiceResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.TestPersonaVoiceResponse(); + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length >= 0) + message.audio = object.audio; + return message; + }; + + /** + * Creates a plain object from a TestPersonaVoiceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @static + * @param {google.cloud.ces.v1beta.TestPersonaVoiceResponse} message TestPersonaVoiceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestPersonaVoiceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.audio = ""; + else { + object.audio = []; + if (options.bytes !== Array) + object.audio = $util.newBuffer(object.audio); + } + if (message.audio != null && message.hasOwnProperty("audio")) + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; + return object; + }; + + /** + * Converts this TestPersonaVoiceResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @instance + * @returns {Object.} JSON object + */ + TestPersonaVoiceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestPersonaVoiceResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestPersonaVoiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TestPersonaVoiceResponse"; + }; + + return TestPersonaVoiceResponse; + })(); + + v1beta.CreateEvaluationExpectationRequest = (function() { + + /** + * Properties of a CreateEvaluationExpectationRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateEvaluationExpectationRequest + * @property {string|null} [parent] CreateEvaluationExpectationRequest parent + * @property {string|null} [evaluationExpectationId] CreateEvaluationExpectationRequest evaluationExpectationId + * @property {google.cloud.ces.v1beta.IEvaluationExpectation|null} [evaluationExpectation] CreateEvaluationExpectationRequest evaluationExpectation + */ + + /** + * Constructs a new CreateEvaluationExpectationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateEvaluationExpectationRequest. + * @implements ICreateEvaluationExpectationRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest=} [properties] Properties to set + */ + function CreateEvaluationExpectationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEvaluationExpectationRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @instance + */ + CreateEvaluationExpectationRequest.prototype.parent = ""; + + /** + * CreateEvaluationExpectationRequest evaluationExpectationId. + * @member {string} evaluationExpectationId + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @instance + */ + CreateEvaluationExpectationRequest.prototype.evaluationExpectationId = ""; + + /** + * CreateEvaluationExpectationRequest evaluationExpectation. + * @member {google.cloud.ces.v1beta.IEvaluationExpectation|null|undefined} evaluationExpectation + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @instance + */ + CreateEvaluationExpectationRequest.prototype.evaluationExpectation = null; + + /** + * Creates a new CreateEvaluationExpectationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateEvaluationExpectationRequest} CreateEvaluationExpectationRequest instance + */ + CreateEvaluationExpectationRequest.create = function create(properties) { + return new CreateEvaluationExpectationRequest(properties); + }; + + /** + * Encodes the specified CreateEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationExpectationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest} message CreateEvaluationExpectationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEvaluationExpectationRequest.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.evaluationExpectationId != null && Object.hasOwnProperty.call(message, "evaluationExpectationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluationExpectationId); + if (message.evaluationExpectation != null && Object.hasOwnProperty.call(message, "evaluationExpectation")) + $root.google.cloud.ces.v1beta.EvaluationExpectation.encode(message.evaluationExpectation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationExpectationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest} message CreateEvaluationExpectationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEvaluationExpectationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEvaluationExpectationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateEvaluationExpectationRequest} CreateEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEvaluationExpectationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.evaluationExpectationId = reader.string(); + break; + } + case 3: { + message.evaluationExpectation = $root.google.cloud.ces.v1beta.EvaluationExpectation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEvaluationExpectationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateEvaluationExpectationRequest} CreateEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEvaluationExpectationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEvaluationExpectationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEvaluationExpectationRequest.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.evaluationExpectationId != null && message.hasOwnProperty("evaluationExpectationId")) + if (!$util.isString(message.evaluationExpectationId)) + return "evaluationExpectationId: string expected"; + if (message.evaluationExpectation != null && message.hasOwnProperty("evaluationExpectation")) { + var error = $root.google.cloud.ces.v1beta.EvaluationExpectation.verify(message.evaluationExpectation); + if (error) + return "evaluationExpectation." + error; + } + return null; + }; + + /** + * Creates a CreateEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateEvaluationExpectationRequest} CreateEvaluationExpectationRequest + */ + CreateEvaluationExpectationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.evaluationExpectationId != null) + message.evaluationExpectationId = String(object.evaluationExpectationId); + if (object.evaluationExpectation != null) { + if (typeof object.evaluationExpectation !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateEvaluationExpectationRequest.evaluationExpectation: object expected"); + message.evaluationExpectation = $root.google.cloud.ces.v1beta.EvaluationExpectation.fromObject(object.evaluationExpectation); + } + return message; + }; + + /** + * Creates a plain object from a CreateEvaluationExpectationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.CreateEvaluationExpectationRequest} message CreateEvaluationExpectationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEvaluationExpectationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.evaluationExpectationId = ""; + object.evaluationExpectation = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.evaluationExpectationId != null && message.hasOwnProperty("evaluationExpectationId")) + object.evaluationExpectationId = message.evaluationExpectationId; + if (message.evaluationExpectation != null && message.hasOwnProperty("evaluationExpectation")) + object.evaluationExpectation = $root.google.cloud.ces.v1beta.EvaluationExpectation.toObject(message.evaluationExpectation, options); + return object; + }; + + /** + * Converts this CreateEvaluationExpectationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEvaluationExpectationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEvaluationExpectationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEvaluationExpectationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateEvaluationExpectationRequest"; + }; + + return CreateEvaluationExpectationRequest; + })(); + + v1beta.UpdateEvaluationExpectationRequest = (function() { + + /** + * Properties of an UpdateEvaluationExpectationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateEvaluationExpectationRequest + * @property {google.cloud.ces.v1beta.IEvaluationExpectation|null} [evaluationExpectation] UpdateEvaluationExpectationRequest evaluationExpectation + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEvaluationExpectationRequest updateMask + */ + + /** + * Constructs a new UpdateEvaluationExpectationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateEvaluationExpectationRequest. + * @implements IUpdateEvaluationExpectationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest=} [properties] Properties to set + */ + function UpdateEvaluationExpectationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateEvaluationExpectationRequest evaluationExpectation. + * @member {google.cloud.ces.v1beta.IEvaluationExpectation|null|undefined} evaluationExpectation + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @instance + */ + UpdateEvaluationExpectationRequest.prototype.evaluationExpectation = null; + + /** + * UpdateEvaluationExpectationRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @instance + */ + UpdateEvaluationExpectationRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateEvaluationExpectationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest} UpdateEvaluationExpectationRequest instance + */ + UpdateEvaluationExpectationRequest.create = function create(properties) { + return new UpdateEvaluationExpectationRequest(properties); + }; + + /** + * Encodes the specified UpdateEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest} message UpdateEvaluationExpectationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEvaluationExpectationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationExpectation != null && Object.hasOwnProperty.call(message, "evaluationExpectation")) + $root.google.cloud.ces.v1beta.EvaluationExpectation.encode(message.evaluationExpectation, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest} message UpdateEvaluationExpectationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEvaluationExpectationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEvaluationExpectationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest} UpdateEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEvaluationExpectationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.evaluationExpectation = $root.google.cloud.ces.v1beta.EvaluationExpectation.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateEvaluationExpectationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest} UpdateEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEvaluationExpectationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEvaluationExpectationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEvaluationExpectationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationExpectation != null && message.hasOwnProperty("evaluationExpectation")) { + var error = $root.google.cloud.ces.v1beta.EvaluationExpectation.verify(message.evaluationExpectation); + if (error) + return "evaluationExpectation." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest} UpdateEvaluationExpectationRequest + */ + UpdateEvaluationExpectationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest(); + if (object.evaluationExpectation != null) { + if (typeof object.evaluationExpectation !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest.evaluationExpectation: object expected"); + message.evaluationExpectation = $root.google.cloud.ces.v1beta.EvaluationExpectation.fromObject(object.evaluationExpectation); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateEvaluationExpectationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest} message UpdateEvaluationExpectationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEvaluationExpectationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.evaluationExpectation = null; + object.updateMask = null; + } + if (message.evaluationExpectation != null && message.hasOwnProperty("evaluationExpectation")) + object.evaluationExpectation = $root.google.cloud.ces.v1beta.EvaluationExpectation.toObject(message.evaluationExpectation, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateEvaluationExpectationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEvaluationExpectationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEvaluationExpectationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEvaluationExpectationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest"; + }; + + return UpdateEvaluationExpectationRequest; + })(); + + v1beta.DeleteEvaluationExpectationRequest = (function() { + + /** + * Properties of a DeleteEvaluationExpectationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteEvaluationExpectationRequest + * @property {string|null} [name] DeleteEvaluationExpectationRequest name + * @property {string|null} [etag] DeleteEvaluationExpectationRequest etag + */ + + /** + * Constructs a new DeleteEvaluationExpectationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteEvaluationExpectationRequest. + * @implements IDeleteEvaluationExpectationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest=} [properties] Properties to set + */ + function DeleteEvaluationExpectationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEvaluationExpectationRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @instance + */ + DeleteEvaluationExpectationRequest.prototype.name = ""; + + /** + * DeleteEvaluationExpectationRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @instance + */ + DeleteEvaluationExpectationRequest.prototype.etag = ""; + + /** + * Creates a new DeleteEvaluationExpectationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest} DeleteEvaluationExpectationRequest instance + */ + DeleteEvaluationExpectationRequest.create = function create(properties) { + return new DeleteEvaluationExpectationRequest(properties); + }; + + /** + * Encodes the specified DeleteEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest} message DeleteEvaluationExpectationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationExpectationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest} message DeleteEvaluationExpectationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationExpectationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEvaluationExpectationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest} DeleteEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationExpectationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEvaluationExpectationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest} DeleteEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationExpectationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEvaluationExpectationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEvaluationExpectationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest} DeleteEvaluationExpectationRequest + */ + DeleteEvaluationExpectationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteEvaluationExpectationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest} message DeleteEvaluationExpectationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEvaluationExpectationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteEvaluationExpectationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEvaluationExpectationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEvaluationExpectationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEvaluationExpectationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest"; + }; + + return DeleteEvaluationExpectationRequest; + })(); + + v1beta.GetEvaluationExpectationRequest = (function() { + + /** + * Properties of a GetEvaluationExpectationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetEvaluationExpectationRequest + * @property {string|null} [name] GetEvaluationExpectationRequest name + */ + + /** + * Constructs a new GetEvaluationExpectationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetEvaluationExpectationRequest. + * @implements IGetEvaluationExpectationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetEvaluationExpectationRequest=} [properties] Properties to set + */ + function GetEvaluationExpectationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvaluationExpectationRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @instance + */ + GetEvaluationExpectationRequest.prototype.name = ""; + + /** + * Creates a new GetEvaluationExpectationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationExpectationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetEvaluationExpectationRequest} GetEvaluationExpectationRequest instance + */ + GetEvaluationExpectationRequest.create = function create(properties) { + return new GetEvaluationExpectationRequest(properties); + }; + + /** + * Encodes the specified GetEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationExpectationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationExpectationRequest} message GetEvaluationExpectationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationExpectationRequest.encode = function encode(message, writer) { + 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 GetEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationExpectationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationExpectationRequest} message GetEvaluationExpectationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationExpectationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvaluationExpectationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetEvaluationExpectationRequest} GetEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationExpectationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetEvaluationExpectationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvaluationExpectationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetEvaluationExpectationRequest} GetEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationExpectationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvaluationExpectationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvaluationExpectationRequest.verify = function verify(message) { + if (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 GetEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetEvaluationExpectationRequest} GetEvaluationExpectationRequest + */ + GetEvaluationExpectationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetEvaluationExpectationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetEvaluationExpectationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEvaluationExpectationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.GetEvaluationExpectationRequest} message GetEvaluationExpectationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvaluationExpectationRequest.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 GetEvaluationExpectationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvaluationExpectationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEvaluationExpectationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEvaluationExpectationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetEvaluationExpectationRequest"; + }; + + return GetEvaluationExpectationRequest; + })(); + + v1beta.ListEvaluationExpectationsRequest = (function() { + + /** + * Properties of a ListEvaluationExpectationsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationExpectationsRequest + * @property {string|null} [parent] ListEvaluationExpectationsRequest parent + * @property {number|null} [pageSize] ListEvaluationExpectationsRequest pageSize + * @property {string|null} [pageToken] ListEvaluationExpectationsRequest pageToken + * @property {string|null} [filter] ListEvaluationExpectationsRequest filter + * @property {string|null} [orderBy] ListEvaluationExpectationsRequest orderBy + */ + + /** + * Constructs a new ListEvaluationExpectationsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationExpectationsRequest. + * @implements IListEvaluationExpectationsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsRequest=} [properties] Properties to set + */ + function ListEvaluationExpectationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationExpectationsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @instance + */ + ListEvaluationExpectationsRequest.prototype.parent = ""; + + /** + * ListEvaluationExpectationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @instance + */ + ListEvaluationExpectationsRequest.prototype.pageSize = 0; + + /** + * ListEvaluationExpectationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @instance + */ + ListEvaluationExpectationsRequest.prototype.pageToken = ""; + + /** + * ListEvaluationExpectationsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @instance + */ + ListEvaluationExpectationsRequest.prototype.filter = ""; + + /** + * ListEvaluationExpectationsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @instance + */ + ListEvaluationExpectationsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListEvaluationExpectationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsRequest} ListEvaluationExpectationsRequest instance + */ + ListEvaluationExpectationsRequest.create = function create(properties) { + return new ListEvaluationExpectationsRequest(properties); + }; + + /** + * Encodes the specified ListEvaluationExpectationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsRequest} message ListEvaluationExpectationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationExpectationsRequest.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 ListEvaluationExpectationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsRequest} message ListEvaluationExpectationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationExpectationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationExpectationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsRequest} ListEvaluationExpectationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationExpectationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationExpectationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsRequest} ListEvaluationExpectationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationExpectationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationExpectationsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationExpectationsRequest.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 ListEvaluationExpectationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsRequest} ListEvaluationExpectationsRequest + */ + ListEvaluationExpectationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest(); + 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 ListEvaluationExpectationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationExpectationsRequest} message ListEvaluationExpectationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationExpectationsRequest.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 ListEvaluationExpectationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationExpectationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationExpectationsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationExpectationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationExpectationsRequest"; + }; + + return ListEvaluationExpectationsRequest; + })(); + + v1beta.ListEvaluationExpectationsResponse = (function() { + + /** + * Properties of a ListEvaluationExpectationsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationExpectationsResponse + * @property {Array.|null} [evaluationExpectations] ListEvaluationExpectationsResponse evaluationExpectations + * @property {string|null} [nextPageToken] ListEvaluationExpectationsResponse nextPageToken + */ + + /** + * Constructs a new ListEvaluationExpectationsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationExpectationsResponse. + * @implements IListEvaluationExpectationsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsResponse=} [properties] Properties to set + */ + function ListEvaluationExpectationsResponse(properties) { + this.evaluationExpectations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationExpectationsResponse evaluationExpectations. + * @member {Array.} evaluationExpectations + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @instance + */ + ListEvaluationExpectationsResponse.prototype.evaluationExpectations = $util.emptyArray; + + /** + * ListEvaluationExpectationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @instance + */ + ListEvaluationExpectationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEvaluationExpectationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsResponse} ListEvaluationExpectationsResponse instance + */ + ListEvaluationExpectationsResponse.create = function create(properties) { + return new ListEvaluationExpectationsResponse(properties); + }; + + /** + * Encodes the specified ListEvaluationExpectationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsResponse} message ListEvaluationExpectationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationExpectationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationExpectations != null && message.evaluationExpectations.length) + for (var i = 0; i < message.evaluationExpectations.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationExpectation.encode(message.evaluationExpectations[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 ListEvaluationExpectationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsResponse} message ListEvaluationExpectationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationExpectationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationExpectationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsResponse} ListEvaluationExpectationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationExpectationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationExpectationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.evaluationExpectations && message.evaluationExpectations.length)) + message.evaluationExpectations = []; + message.evaluationExpectations.push($root.google.cloud.ces.v1beta.EvaluationExpectation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationExpectationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsResponse} ListEvaluationExpectationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationExpectationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationExpectationsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationExpectationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationExpectations != null && message.hasOwnProperty("evaluationExpectations")) { + if (!Array.isArray(message.evaluationExpectations)) + return "evaluationExpectations: array expected"; + for (var i = 0; i < message.evaluationExpectations.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationExpectation.verify(message.evaluationExpectations[i]); + if (error) + return "evaluationExpectations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEvaluationExpectationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsResponse} ListEvaluationExpectationsResponse + */ + ListEvaluationExpectationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationExpectationsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationExpectationsResponse(); + if (object.evaluationExpectations) { + if (!Array.isArray(object.evaluationExpectations)) + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.evaluationExpectations: array expected"); + message.evaluationExpectations = []; + for (var i = 0; i < object.evaluationExpectations.length; ++i) { + if (typeof object.evaluationExpectations[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.evaluationExpectations: object expected"); + message.evaluationExpectations[i] = $root.google.cloud.ces.v1beta.EvaluationExpectation.fromObject(object.evaluationExpectations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEvaluationExpectationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationExpectationsResponse} message ListEvaluationExpectationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationExpectationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluationExpectations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.evaluationExpectations && message.evaluationExpectations.length) { + object.evaluationExpectations = []; + for (var j = 0; j < message.evaluationExpectations.length; ++j) + object.evaluationExpectations[j] = $root.google.cloud.ces.v1beta.EvaluationExpectation.toObject(message.evaluationExpectations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEvaluationExpectationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationExpectationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationExpectationsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationExpectationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationExpectationsResponse"; + }; + + return ListEvaluationExpectationsResponse; + })(); + + v1beta.Omnichannel = (function() { + + /** + * Properties of an Omnichannel. + * @memberof google.cloud.ces.v1beta + * @interface IOmnichannel + * @property {string|null} [name] Omnichannel name + * @property {string|null} [displayName] Omnichannel displayName + * @property {string|null} [description] Omnichannel description + * @property {google.protobuf.ITimestamp|null} [createTime] Omnichannel createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Omnichannel updateTime + * @property {string|null} [etag] Omnichannel etag + * @property {google.cloud.ces.v1beta.IOmnichannelIntegrationConfig|null} [integrationConfig] Omnichannel integrationConfig + */ + + /** + * Constructs a new Omnichannel. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an Omnichannel. + * @implements IOmnichannel + * @constructor + * @param {google.cloud.ces.v1beta.IOmnichannel=} [properties] Properties to set + */ + function Omnichannel(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Omnichannel name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Omnichannel + * @instance + */ + Omnichannel.prototype.name = ""; + + /** + * Omnichannel displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.Omnichannel + * @instance + */ + Omnichannel.prototype.displayName = ""; + + /** + * Omnichannel description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.Omnichannel + * @instance + */ + Omnichannel.prototype.description = ""; + + /** + * Omnichannel createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.Omnichannel + * @instance + */ + Omnichannel.prototype.createTime = null; + + /** + * Omnichannel updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.Omnichannel + * @instance + */ + Omnichannel.prototype.updateTime = null; + + /** + * Omnichannel etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.Omnichannel + * @instance + */ + Omnichannel.prototype.etag = ""; + + /** + * Omnichannel integrationConfig. + * @member {google.cloud.ces.v1beta.IOmnichannelIntegrationConfig|null|undefined} integrationConfig + * @memberof google.cloud.ces.v1beta.Omnichannel + * @instance + */ + Omnichannel.prototype.integrationConfig = null; + + /** + * Creates a new Omnichannel instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Omnichannel + * @static + * @param {google.cloud.ces.v1beta.IOmnichannel=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Omnichannel} Omnichannel instance + */ + Omnichannel.create = function create(properties) { + return new Omnichannel(properties); + }; + + /** + * Encodes the specified Omnichannel message. Does not implicitly {@link google.cloud.ces.v1beta.Omnichannel.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Omnichannel + * @static + * @param {google.cloud.ces.v1beta.IOmnichannel} message Omnichannel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Omnichannel.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + 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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + if (message.integrationConfig != null && Object.hasOwnProperty.call(message, "integrationConfig")) + $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.encode(message.integrationConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Omnichannel message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Omnichannel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Omnichannel + * @static + * @param {google.cloud.ces.v1beta.IOmnichannel} message Omnichannel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Omnichannel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Omnichannel message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Omnichannel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Omnichannel} Omnichannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Omnichannel.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Omnichannel(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = 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.etag = reader.string(); + break; + } + case 7: { + message.integrationConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Omnichannel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Omnichannel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Omnichannel} Omnichannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Omnichannel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Omnichannel message. + * @function verify + * @memberof google.cloud.ces.v1beta.Omnichannel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Omnichannel.verify = function verify(message) { + if (typeof message !== "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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.integrationConfig != null && message.hasOwnProperty("integrationConfig")) { + var error = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.verify(message.integrationConfig); + if (error) + return "integrationConfig." + error; + } + return null; + }; + + /** + * Creates an Omnichannel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Omnichannel + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Omnichannel} Omnichannel + */ + Omnichannel.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Omnichannel) + return object; + var message = new $root.google.cloud.ces.v1beta.Omnichannel(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Omnichannel.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.ces.v1beta.Omnichannel.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.integrationConfig != null) { + if (typeof object.integrationConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.Omnichannel.integrationConfig: object expected"); + message.integrationConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.fromObject(object.integrationConfig); + } + return message; + }; + + /** + * Creates a plain object from an Omnichannel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Omnichannel + * @static + * @param {google.cloud.ces.v1beta.Omnichannel} message Omnichannel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Omnichannel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.integrationConfig = 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.integrationConfig != null && message.hasOwnProperty("integrationConfig")) + object.integrationConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.toObject(message.integrationConfig, options); + return object; + }; + + /** + * Converts this Omnichannel to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Omnichannel + * @instance + * @returns {Object.} JSON object + */ + Omnichannel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Omnichannel + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Omnichannel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Omnichannel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Omnichannel"; + }; + + return Omnichannel; + })(); + + v1beta.OmnichannelIntegrationConfig = (function() { + + /** + * Properties of an OmnichannelIntegrationConfig. + * @memberof google.cloud.ces.v1beta + * @interface IOmnichannelIntegrationConfig + * @property {Object.|null} [channelConfigs] OmnichannelIntegrationConfig channelConfigs + * @property {Object.|null} [subscriberConfigs] OmnichannelIntegrationConfig subscriberConfigs + * @property {Object.|null} [routingConfigs] OmnichannelIntegrationConfig routingConfigs + */ + + /** + * Constructs a new OmnichannelIntegrationConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an OmnichannelIntegrationConfig. + * @implements IOmnichannelIntegrationConfig + * @constructor + * @param {google.cloud.ces.v1beta.IOmnichannelIntegrationConfig=} [properties] Properties to set + */ + function OmnichannelIntegrationConfig(properties) { + this.channelConfigs = {}; + this.subscriberConfigs = {}; + this.routingConfigs = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OmnichannelIntegrationConfig channelConfigs. + * @member {Object.} channelConfigs + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @instance + */ + OmnichannelIntegrationConfig.prototype.channelConfigs = $util.emptyObject; + + /** + * OmnichannelIntegrationConfig subscriberConfigs. + * @member {Object.} subscriberConfigs + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @instance + */ + OmnichannelIntegrationConfig.prototype.subscriberConfigs = $util.emptyObject; + + /** + * OmnichannelIntegrationConfig routingConfigs. + * @member {Object.} routingConfigs + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @instance + */ + OmnichannelIntegrationConfig.prototype.routingConfigs = $util.emptyObject; + + /** + * Creates a new OmnichannelIntegrationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @static + * @param {google.cloud.ces.v1beta.IOmnichannelIntegrationConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig instance + */ + OmnichannelIntegrationConfig.create = function create(properties) { + return new OmnichannelIntegrationConfig(properties); + }; + + /** + * Encodes the specified OmnichannelIntegrationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @static + * @param {google.cloud.ces.v1beta.IOmnichannelIntegrationConfig} message OmnichannelIntegrationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OmnichannelIntegrationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channelConfigs != null && Object.hasOwnProperty.call(message, "channelConfigs")) + for (var keys = Object.keys(message.channelConfigs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.encode(message.channelConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.subscriberConfigs != null && Object.hasOwnProperty.call(message, "subscriberConfigs")) + for (var keys = Object.keys(message.subscriberConfigs), 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.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.encode(message.subscriberConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.routingConfigs != null && Object.hasOwnProperty.call(message, "routingConfigs")) + for (var keys = Object.keys(message.routingConfigs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.encode(message.routingConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified OmnichannelIntegrationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @static + * @param {google.cloud.ces.v1beta.IOmnichannelIntegrationConfig} message OmnichannelIntegrationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OmnichannelIntegrationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OmnichannelIntegrationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.channelConfigs === $util.emptyObject) + message.channelConfigs = {}; + 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.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.channelConfigs[key] = value; + break; + } + case 2: { + if (message.subscriberConfigs === $util.emptyObject) + message.subscriberConfigs = {}; + 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.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.subscriberConfigs[key] = value; + break; + } + case 3: { + if (message.routingConfigs === $util.emptyObject) + message.routingConfigs = {}; + 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.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.routingConfigs[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OmnichannelIntegrationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OmnichannelIntegrationConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OmnichannelIntegrationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channelConfigs != null && message.hasOwnProperty("channelConfigs")) { + if (!$util.isObject(message.channelConfigs)) + return "channelConfigs: object expected"; + var key = Object.keys(message.channelConfigs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.verify(message.channelConfigs[key[i]]); + if (error) + return "channelConfigs." + error; + } + } + if (message.subscriberConfigs != null && message.hasOwnProperty("subscriberConfigs")) { + if (!$util.isObject(message.subscriberConfigs)) + return "subscriberConfigs: object expected"; + var key = Object.keys(message.subscriberConfigs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.verify(message.subscriberConfigs[key[i]]); + if (error) + return "subscriberConfigs." + error; + } + } + if (message.routingConfigs != null && message.hasOwnProperty("routingConfigs")) { + if (!$util.isObject(message.routingConfigs)) + return "routingConfigs: object expected"; + var key = Object.keys(message.routingConfigs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.verify(message.routingConfigs[key[i]]); + if (error) + return "routingConfigs." + error; + } + } + return null; + }; + + /** + * Creates an OmnichannelIntegrationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig + */ + OmnichannelIntegrationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig(); + if (object.channelConfigs) { + if (typeof object.channelConfigs !== "object") + throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.channelConfigs: object expected"); + message.channelConfigs = {}; + for (var keys = Object.keys(object.channelConfigs), i = 0; i < keys.length; ++i) { + if (typeof object.channelConfigs[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.channelConfigs: object expected"); + message.channelConfigs[keys[i]] = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.fromObject(object.channelConfigs[keys[i]]); + } + } + if (object.subscriberConfigs) { + if (typeof object.subscriberConfigs !== "object") + throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.subscriberConfigs: object expected"); + message.subscriberConfigs = {}; + for (var keys = Object.keys(object.subscriberConfigs), i = 0; i < keys.length; ++i) { + if (typeof object.subscriberConfigs[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.subscriberConfigs: object expected"); + message.subscriberConfigs[keys[i]] = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.fromObject(object.subscriberConfigs[keys[i]]); + } + } + if (object.routingConfigs) { + if (typeof object.routingConfigs !== "object") + throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.routingConfigs: object expected"); + message.routingConfigs = {}; + for (var keys = Object.keys(object.routingConfigs), i = 0; i < keys.length; ++i) { + if (typeof object.routingConfigs[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.routingConfigs: object expected"); + message.routingConfigs[keys[i]] = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.fromObject(object.routingConfigs[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an OmnichannelIntegrationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig} message OmnichannelIntegrationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OmnichannelIntegrationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.channelConfigs = {}; + object.subscriberConfigs = {}; + object.routingConfigs = {}; + } + var keys2; + if (message.channelConfigs && (keys2 = Object.keys(message.channelConfigs)).length) { + object.channelConfigs = {}; + for (var j = 0; j < keys2.length; ++j) + object.channelConfigs[keys2[j]] = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.toObject(message.channelConfigs[keys2[j]], options); + } + if (message.subscriberConfigs && (keys2 = Object.keys(message.subscriberConfigs)).length) { + object.subscriberConfigs = {}; + for (var j = 0; j < keys2.length; ++j) + object.subscriberConfigs[keys2[j]] = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.toObject(message.subscriberConfigs[keys2[j]], options); + } + if (message.routingConfigs && (keys2 = Object.keys(message.routingConfigs)).length) { + object.routingConfigs = {}; + for (var j = 0; j < keys2.length; ++j) + object.routingConfigs[keys2[j]] = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.toObject(message.routingConfigs[keys2[j]], options); + } + return object; + }; + + /** + * Converts this OmnichannelIntegrationConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @instance + * @returns {Object.} JSON object + */ + OmnichannelIntegrationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OmnichannelIntegrationConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OmnichannelIntegrationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelIntegrationConfig"; + }; + + OmnichannelIntegrationConfig.ChannelConfig = (function() { + + /** + * Properties of a ChannelConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @interface IChannelConfig + * @property {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig|null} [whatsappConfig] ChannelConfig whatsappConfig + */ + + /** + * Constructs a new ChannelConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @classdesc Represents a ChannelConfig. + * @implements IChannelConfig + * @constructor + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig=} [properties] Properties to set + */ + function ChannelConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChannelConfig whatsappConfig. + * @member {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig|null|undefined} whatsappConfig + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @instance + */ + ChannelConfig.prototype.whatsappConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ChannelConfig channelConfig. + * @member {"whatsappConfig"|undefined} channelConfig + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @instance + */ + Object.defineProperty(ChannelConfig.prototype, "channelConfig", { + get: $util.oneOfGetter($oneOfFields = ["whatsappConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ChannelConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig instance + */ + ChannelConfig.create = function create(properties) { + return new ChannelConfig(properties); + }; + + /** + * Encodes the specified ChannelConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig} message ChannelConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.whatsappConfig != null && Object.hasOwnProperty.call(message, "whatsappConfig")) + $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.encode(message.whatsappConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ChannelConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig} message ChannelConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChannelConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.whatsappConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChannelConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChannelConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChannelConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.whatsappConfig != null && message.hasOwnProperty("whatsappConfig")) { + properties.channelConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.verify(message.whatsappConfig); + if (error) + return "whatsappConfig." + error; + } + } + return null; + }; + + /** + * Creates a ChannelConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig + */ + ChannelConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig(); + if (object.whatsappConfig != null) { + if (typeof object.whatsappConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.whatsappConfig: object expected"); + message.whatsappConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.fromObject(object.whatsappConfig); + } + return message; + }; + + /** + * Creates a plain object from a ChannelConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig} message ChannelConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChannelConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.whatsappConfig != null && message.hasOwnProperty("whatsappConfig")) { + object.whatsappConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.toObject(message.whatsappConfig, options); + if (options.oneofs) + object.channelConfig = "whatsappConfig"; + } + return object; + }; + + /** + * Converts this ChannelConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @instance + * @returns {Object.} JSON object + */ + ChannelConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChannelConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChannelConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig"; + }; + + return ChannelConfig; + })(); + + OmnichannelIntegrationConfig.WhatsappConfig = (function() { + + /** + * Properties of a WhatsappConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @interface IWhatsappConfig + * @property {string|null} [phoneNumberId] WhatsappConfig phoneNumberId + * @property {string|null} [phoneNumber] WhatsappConfig phoneNumber + * @property {string|null} [whatsappBusinessAccountId] WhatsappConfig whatsappBusinessAccountId + * @property {string|null} [webhookVerifyToken] WhatsappConfig webhookVerifyToken + * @property {string|null} [whatsappBusinessToken] WhatsappConfig whatsappBusinessToken + * @property {string|null} [metaBusinessPortfolioId] WhatsappConfig metaBusinessPortfolioId + */ + + /** + * Constructs a new WhatsappConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @classdesc Represents a WhatsappConfig. + * @implements IWhatsappConfig + * @constructor + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig=} [properties] Properties to set + */ + function WhatsappConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WhatsappConfig phoneNumberId. + * @member {string} phoneNumberId + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + */ + WhatsappConfig.prototype.phoneNumberId = ""; + + /** + * WhatsappConfig phoneNumber. + * @member {string} phoneNumber + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + */ + WhatsappConfig.prototype.phoneNumber = ""; + + /** + * WhatsappConfig whatsappBusinessAccountId. + * @member {string} whatsappBusinessAccountId + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + */ + WhatsappConfig.prototype.whatsappBusinessAccountId = ""; + + /** + * WhatsappConfig webhookVerifyToken. + * @member {string} webhookVerifyToken + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + */ + WhatsappConfig.prototype.webhookVerifyToken = ""; + + /** + * WhatsappConfig whatsappBusinessToken. + * @member {string} whatsappBusinessToken + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + */ + WhatsappConfig.prototype.whatsappBusinessToken = ""; + + /** + * WhatsappConfig metaBusinessPortfolioId. + * @member {string} metaBusinessPortfolioId + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + */ + WhatsappConfig.prototype.metaBusinessPortfolioId = ""; + + /** + * Creates a new WhatsappConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig instance + */ + WhatsappConfig.create = function create(properties) { + return new WhatsappConfig(properties); + }; + + /** + * Encodes the specified WhatsappConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig} message WhatsappConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WhatsappConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phoneNumberId != null && Object.hasOwnProperty.call(message, "phoneNumberId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.phoneNumberId); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.phoneNumber); + if (message.whatsappBusinessAccountId != null && Object.hasOwnProperty.call(message, "whatsappBusinessAccountId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.whatsappBusinessAccountId); + if (message.webhookVerifyToken != null && Object.hasOwnProperty.call(message, "webhookVerifyToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.webhookVerifyToken); + if (message.whatsappBusinessToken != null && Object.hasOwnProperty.call(message, "whatsappBusinessToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.whatsappBusinessToken); + if (message.metaBusinessPortfolioId != null && Object.hasOwnProperty.call(message, "metaBusinessPortfolioId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.metaBusinessPortfolioId); + return writer; + }; + + /** + * Encodes the specified WhatsappConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig} message WhatsappConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WhatsappConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WhatsappConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WhatsappConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.phoneNumberId = reader.string(); + break; + } + case 2: { + message.phoneNumber = reader.string(); + break; + } + case 3: { + message.whatsappBusinessAccountId = reader.string(); + break; + } + case 4: { + message.webhookVerifyToken = reader.string(); + break; + } + case 5: { + message.whatsappBusinessToken = reader.string(); + break; + } + case 6: { + message.metaBusinessPortfolioId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WhatsappConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WhatsappConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WhatsappConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WhatsappConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phoneNumberId != null && message.hasOwnProperty("phoneNumberId")) + if (!$util.isString(message.phoneNumberId)) + return "phoneNumberId: string expected"; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + if (!$util.isString(message.phoneNumber)) + return "phoneNumber: string expected"; + if (message.whatsappBusinessAccountId != null && message.hasOwnProperty("whatsappBusinessAccountId")) + if (!$util.isString(message.whatsappBusinessAccountId)) + return "whatsappBusinessAccountId: string expected"; + if (message.webhookVerifyToken != null && message.hasOwnProperty("webhookVerifyToken")) + if (!$util.isString(message.webhookVerifyToken)) + return "webhookVerifyToken: string expected"; + if (message.whatsappBusinessToken != null && message.hasOwnProperty("whatsappBusinessToken")) + if (!$util.isString(message.whatsappBusinessToken)) + return "whatsappBusinessToken: string expected"; + if (message.metaBusinessPortfolioId != null && message.hasOwnProperty("metaBusinessPortfolioId")) + if (!$util.isString(message.metaBusinessPortfolioId)) + return "metaBusinessPortfolioId: string expected"; + return null; + }; + + /** + * Creates a WhatsappConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig + */ + WhatsappConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig(); + if (object.phoneNumberId != null) + message.phoneNumberId = String(object.phoneNumberId); + if (object.phoneNumber != null) + message.phoneNumber = String(object.phoneNumber); + if (object.whatsappBusinessAccountId != null) + message.whatsappBusinessAccountId = String(object.whatsappBusinessAccountId); + if (object.webhookVerifyToken != null) + message.webhookVerifyToken = String(object.webhookVerifyToken); + if (object.whatsappBusinessToken != null) + message.whatsappBusinessToken = String(object.whatsappBusinessToken); + if (object.metaBusinessPortfolioId != null) + message.metaBusinessPortfolioId = String(object.metaBusinessPortfolioId); + return message; + }; + + /** + * Creates a plain object from a WhatsappConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig} message WhatsappConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WhatsappConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.phoneNumberId = ""; + object.phoneNumber = ""; + object.whatsappBusinessAccountId = ""; + object.webhookVerifyToken = ""; + object.whatsappBusinessToken = ""; + object.metaBusinessPortfolioId = ""; + } + if (message.phoneNumberId != null && message.hasOwnProperty("phoneNumberId")) + object.phoneNumberId = message.phoneNumberId; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + object.phoneNumber = message.phoneNumber; + if (message.whatsappBusinessAccountId != null && message.hasOwnProperty("whatsappBusinessAccountId")) + object.whatsappBusinessAccountId = message.whatsappBusinessAccountId; + if (message.webhookVerifyToken != null && message.hasOwnProperty("webhookVerifyToken")) + object.webhookVerifyToken = message.webhookVerifyToken; + if (message.whatsappBusinessToken != null && message.hasOwnProperty("whatsappBusinessToken")) + object.whatsappBusinessToken = message.whatsappBusinessToken; + if (message.metaBusinessPortfolioId != null && message.hasOwnProperty("metaBusinessPortfolioId")) + object.metaBusinessPortfolioId = message.metaBusinessPortfolioId; + return object; + }; + + /** + * Converts this WhatsappConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + * @returns {Object.} JSON object + */ + WhatsappConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WhatsappConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WhatsappConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig"; + }; + + return WhatsappConfig; + })(); + + OmnichannelIntegrationConfig.SubscriberConfig = (function() { + + /** + * Properties of a SubscriberConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @interface ISubscriberConfig + * @property {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig|null} [cesAppConfig] SubscriberConfig cesAppConfig + */ + + /** + * Constructs a new SubscriberConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @classdesc Represents a SubscriberConfig. + * @implements ISubscriberConfig + * @constructor + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig=} [properties] Properties to set + */ + function SubscriberConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubscriberConfig cesAppConfig. + * @member {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig|null|undefined} cesAppConfig + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @instance + */ + SubscriberConfig.prototype.cesAppConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubscriberConfig subscriberConfig. + * @member {"cesAppConfig"|undefined} subscriberConfig + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @instance + */ + Object.defineProperty(SubscriberConfig.prototype, "subscriberConfig", { + get: $util.oneOfGetter($oneOfFields = ["cesAppConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubscriberConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig instance + */ + SubscriberConfig.create = function create(properties) { + return new SubscriberConfig(properties); + }; + + /** + * Encodes the specified SubscriberConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig} message SubscriberConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscriberConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cesAppConfig != null && Object.hasOwnProperty.call(message, "cesAppConfig")) + $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.encode(message.cesAppConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubscriberConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig} message SubscriberConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscriberConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscriberConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscriberConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cesAppConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubscriberConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscriberConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscriberConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscriberConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cesAppConfig != null && message.hasOwnProperty("cesAppConfig")) { + properties.subscriberConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.verify(message.cesAppConfig); + if (error) + return "cesAppConfig." + error; + } + } + return null; + }; + + /** + * Creates a SubscriberConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig + */ + SubscriberConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig(); + if (object.cesAppConfig != null) { + if (typeof object.cesAppConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.cesAppConfig: object expected"); + message.cesAppConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.fromObject(object.cesAppConfig); + } + return message; + }; + + /** + * Creates a plain object from a SubscriberConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig} message SubscriberConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscriberConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.cesAppConfig != null && message.hasOwnProperty("cesAppConfig")) { + object.cesAppConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.toObject(message.cesAppConfig, options); + if (options.oneofs) + object.subscriberConfig = "cesAppConfig"; + } + return object; + }; + + /** + * Converts this SubscriberConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @instance + * @returns {Object.} JSON object + */ + SubscriberConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubscriberConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubscriberConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig"; + }; + + return SubscriberConfig; + })(); + + OmnichannelIntegrationConfig.CesAppConfig = (function() { + + /** + * Properties of a CesAppConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @interface ICesAppConfig + * @property {string|null} [app] CesAppConfig app + */ + + /** + * Constructs a new CesAppConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @classdesc Represents a CesAppConfig. + * @implements ICesAppConfig + * @constructor + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig=} [properties] Properties to set + */ + function CesAppConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CesAppConfig app. + * @member {string} app + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @instance + */ + CesAppConfig.prototype.app = ""; + + /** + * Creates a new CesAppConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig instance + */ + CesAppConfig.create = function create(properties) { + return new CesAppConfig(properties); + }; + + /** + * Encodes the specified CesAppConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig} message CesAppConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CesAppConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.app); + return writer; + }; + + /** + * Encodes the specified CesAppConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig} message CesAppConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CesAppConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CesAppConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CesAppConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.app = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CesAppConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CesAppConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CesAppConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CesAppConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.app != null && message.hasOwnProperty("app")) + if (!$util.isString(message.app)) + return "app: string expected"; + return null; + }; + + /** + * Creates a CesAppConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig + */ + CesAppConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig(); + if (object.app != null) + message.app = String(object.app); + return message; + }; + + /** + * Creates a plain object from a CesAppConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig} message CesAppConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CesAppConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.app = ""; + if (message.app != null && message.hasOwnProperty("app")) + object.app = message.app; + return object; + }; + + /** + * Converts this CesAppConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @instance + * @returns {Object.} JSON object + */ + CesAppConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CesAppConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CesAppConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig"; + }; + + return CesAppConfig; + })(); + + OmnichannelIntegrationConfig.RoutingConfig = (function() { + + /** + * Properties of a RoutingConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @interface IRoutingConfig + * @property {string|null} [subscriberKey] RoutingConfig subscriberKey + */ + + /** + * Constructs a new RoutingConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @classdesc Represents a RoutingConfig. + * @implements IRoutingConfig + * @constructor + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig=} [properties] Properties to set + */ + function RoutingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutingConfig subscriberKey. + * @member {string} subscriberKey + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @instance + */ + RoutingConfig.prototype.subscriberKey = ""; + + /** + * Creates a new RoutingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig instance + */ + RoutingConfig.create = function create(properties) { + return new RoutingConfig(properties); + }; + + /** + * Encodes the specified RoutingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig} message RoutingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscriberKey != null && Object.hasOwnProperty.call(message, "subscriberKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscriberKey); + return writer; + }; + + /** + * Encodes the specified RoutingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig} message RoutingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subscriberKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutingConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscriberKey != null && message.hasOwnProperty("subscriberKey")) + if (!$util.isString(message.subscriberKey)) + return "subscriberKey: string expected"; + return null; + }; + + /** + * Creates a RoutingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig + */ + RoutingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig(); + if (object.subscriberKey != null) + message.subscriberKey = String(object.subscriberKey); + return message; + }; + + /** + * Creates a plain object from a RoutingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig} message RoutingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.subscriberKey = ""; + if (message.subscriberKey != null && message.hasOwnProperty("subscriberKey")) + object.subscriberKey = message.subscriberKey; + return object; + }; + + /** + * Converts this RoutingConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @instance + * @returns {Object.} JSON object + */ + RoutingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutingConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig"; + }; + + return RoutingConfig; + })(); + + return OmnichannelIntegrationConfig; + })(); + + v1beta.OmnichannelOperationMetadata = (function() { + + /** + * Properties of an OmnichannelOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @interface IOmnichannelOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OmnichannelOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OmnichannelOperationMetadata endTime + * @property {string|null} [statusMessage] OmnichannelOperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OmnichannelOperationMetadata requestedCancellation + */ + + /** + * Constructs a new OmnichannelOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an OmnichannelOperationMetadata. + * @implements IOmnichannelOperationMetadata + * @constructor + * @param {google.cloud.ces.v1beta.IOmnichannelOperationMetadata=} [properties] Properties to set + */ + function OmnichannelOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OmnichannelOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @instance + */ + OmnichannelOperationMetadata.prototype.createTime = null; + + /** + * OmnichannelOperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @instance + */ + OmnichannelOperationMetadata.prototype.endTime = null; + + /** + * OmnichannelOperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @instance + */ + OmnichannelOperationMetadata.prototype.statusMessage = ""; + + /** + * OmnichannelOperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @instance + */ + OmnichannelOperationMetadata.prototype.requestedCancellation = false; + + /** + * Creates a new OmnichannelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IOmnichannelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OmnichannelOperationMetadata} OmnichannelOperationMetadata instance + */ + OmnichannelOperationMetadata.create = function create(properties) { + return new OmnichannelOperationMetadata(properties); + }; + + /** + * Encodes the specified OmnichannelOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IOmnichannelOperationMetadata} message OmnichannelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OmnichannelOperationMetadata.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.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.requestedCancellation); + return writer; + }; + + /** + * Encodes the specified OmnichannelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IOmnichannelOperationMetadata} message OmnichannelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OmnichannelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OmnichannelOperationMetadata} OmnichannelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OmnichannelOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + 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.statusMessage = reader.string(); + break; + } + case 4: { + message.requestedCancellation = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OmnichannelOperationMetadata} OmnichannelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OmnichannelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OmnichannelOperationMetadata message. + * @function verify + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OmnichannelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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.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"; + return null; + }; + + /** + * Creates an OmnichannelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OmnichannelOperationMetadata} OmnichannelOperationMetadata + */ + OmnichannelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelOperationMetadata) + return object; + var message = new $root.google.cloud.ces.v1beta.OmnichannelOperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.OmnichannelOperationMetadata.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.ces.v1beta.OmnichannelOperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + return message; + }; + + /** + * Creates a plain object from an OmnichannelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.OmnichannelOperationMetadata} message OmnichannelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OmnichannelOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.statusMessage = ""; + object.requestedCancellation = false; + } + 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.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + return object; + }; + + /** + * Converts this OmnichannelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OmnichannelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OmnichannelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OmnichannelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelOperationMetadata"; + }; + + return OmnichannelOperationMetadata; + })(); + + v1beta.ToolService = (function() { + + /** + * Constructs a new ToolService service. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ToolService + * @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 ToolService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ToolService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ToolService; + + /** + * Creates new ToolService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.ces.v1beta.ToolService + * @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 {ToolService} RPC service. Useful where requests and/or responses are streamed. + */ + ToolService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.ToolService|executeTool}. + * @memberof google.cloud.ces.v1beta.ToolService + * @typedef ExecuteToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ExecuteToolResponse} [response] ExecuteToolResponse + */ + + /** + * Calls ExecuteTool. + * @function executeTool + * @memberof google.cloud.ces.v1beta.ToolService + * @instance + * @param {google.cloud.ces.v1beta.IExecuteToolRequest} request ExecuteToolRequest message or plain object + * @param {google.cloud.ces.v1beta.ToolService.ExecuteToolCallback} callback Node-style callback called with the error, if any, and ExecuteToolResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ToolService.prototype.executeTool = function executeTool(request, callback) { + return this.rpcCall(executeTool, $root.google.cloud.ces.v1beta.ExecuteToolRequest, $root.google.cloud.ces.v1beta.ExecuteToolResponse, request, callback); + }, "name", { value: "ExecuteTool" }); + + /** + * Calls ExecuteTool. + * @function executeTool + * @memberof google.cloud.ces.v1beta.ToolService + * @instance + * @param {google.cloud.ces.v1beta.IExecuteToolRequest} request ExecuteToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.ToolService|retrieveToolSchema}. + * @memberof google.cloud.ces.v1beta.ToolService + * @typedef RetrieveToolSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.RetrieveToolSchemaResponse} [response] RetrieveToolSchemaResponse + */ + + /** + * Calls RetrieveToolSchema. + * @function retrieveToolSchema + * @memberof google.cloud.ces.v1beta.ToolService + * @instance + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaRequest} request RetrieveToolSchemaRequest message or plain object + * @param {google.cloud.ces.v1beta.ToolService.RetrieveToolSchemaCallback} callback Node-style callback called with the error, if any, and RetrieveToolSchemaResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ToolService.prototype.retrieveToolSchema = function retrieveToolSchema(request, callback) { + return this.rpcCall(retrieveToolSchema, $root.google.cloud.ces.v1beta.RetrieveToolSchemaRequest, $root.google.cloud.ces.v1beta.RetrieveToolSchemaResponse, request, callback); + }, "name", { value: "RetrieveToolSchema" }); + + /** + * Calls RetrieveToolSchema. + * @function retrieveToolSchema + * @memberof google.cloud.ces.v1beta.ToolService + * @instance + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaRequest} request RetrieveToolSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.ToolService|retrieveTools}. + * @memberof google.cloud.ces.v1beta.ToolService + * @typedef RetrieveToolsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.RetrieveToolsResponse} [response] RetrieveToolsResponse + */ + + /** + * Calls RetrieveTools. + * @function retrieveTools + * @memberof google.cloud.ces.v1beta.ToolService + * @instance + * @param {google.cloud.ces.v1beta.IRetrieveToolsRequest} request RetrieveToolsRequest message or plain object + * @param {google.cloud.ces.v1beta.ToolService.RetrieveToolsCallback} callback Node-style callback called with the error, if any, and RetrieveToolsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ToolService.prototype.retrieveTools = function retrieveTools(request, callback) { + return this.rpcCall(retrieveTools, $root.google.cloud.ces.v1beta.RetrieveToolsRequest, $root.google.cloud.ces.v1beta.RetrieveToolsResponse, request, callback); + }, "name", { value: "RetrieveTools" }); + + /** + * Calls RetrieveTools. + * @function retrieveTools + * @memberof google.cloud.ces.v1beta.ToolService + * @instance + * @param {google.cloud.ces.v1beta.IRetrieveToolsRequest} request RetrieveToolsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ToolService; + })(); + + v1beta.ExecuteToolRequest = (function() { + + /** + * Properties of an ExecuteToolRequest. + * @memberof google.cloud.ces.v1beta + * @interface IExecuteToolRequest + * @property {string|null} [tool] ExecuteToolRequest tool + * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] ExecuteToolRequest toolsetTool + * @property {string|null} [parent] ExecuteToolRequest parent + * @property {google.protobuf.IStruct|null} [args] ExecuteToolRequest args + * @property {google.protobuf.IStruct|null} [variables] ExecuteToolRequest variables + */ + + /** + * Constructs a new ExecuteToolRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ExecuteToolRequest. + * @implements IExecuteToolRequest + * @constructor + * @param {google.cloud.ces.v1beta.IExecuteToolRequest=} [properties] Properties to set + */ + function ExecuteToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteToolRequest tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @instance + */ + ExecuteToolRequest.prototype.tool = null; + + /** + * ExecuteToolRequest toolsetTool. + * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @instance + */ + ExecuteToolRequest.prototype.toolsetTool = null; + + /** + * ExecuteToolRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @instance + */ + ExecuteToolRequest.prototype.parent = ""; + + /** + * ExecuteToolRequest args. + * @member {google.protobuf.IStruct|null|undefined} args + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @instance + */ + ExecuteToolRequest.prototype.args = null; + + /** + * ExecuteToolRequest variables. + * @member {google.protobuf.IStruct|null|undefined} variables + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @instance + */ + ExecuteToolRequest.prototype.variables = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExecuteToolRequest toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @instance + */ + Object.defineProperty(ExecuteToolRequest.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecuteToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @static + * @param {google.cloud.ces.v1beta.IExecuteToolRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ExecuteToolRequest} ExecuteToolRequest instance + */ + ExecuteToolRequest.create = function create(properties) { + return new ExecuteToolRequest(properties); + }; + + /** + * Encodes the specified ExecuteToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @static + * @param {google.cloud.ces.v1beta.IExecuteToolRequest} message ExecuteToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteToolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.args != null && Object.hasOwnProperty.call(message, "args")) + $root.google.protobuf.Struct.encode(message.args, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) + $root.google.protobuf.Struct.encode(message.variables, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @static + * @param {google.cloud.ces.v1beta.IExecuteToolRequest} message ExecuteToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ExecuteToolRequest} ExecuteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteToolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ExecuteToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 3: { + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 4: { + message.parent = reader.string(); + break; + } + case 2: { + message.args = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 5: { + message.variables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ExecuteToolRequest} ExecuteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteToolRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteToolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.args != null && message.hasOwnProperty("args")) { + var error = $root.google.protobuf.Struct.verify(message.args); + if (error) + return "args." + error; + } + if (message.variables != null && message.hasOwnProperty("variables")) { + var error = $root.google.protobuf.Struct.verify(message.variables); + if (error) + return "variables." + error; + } + return null; + }; + + /** + * Creates an ExecuteToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ExecuteToolRequest} ExecuteToolRequest + */ + ExecuteToolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ExecuteToolRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ExecuteToolRequest(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.ExecuteToolRequest.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.args != null) { + if (typeof object.args !== "object") + throw TypeError(".google.cloud.ces.v1beta.ExecuteToolRequest.args: object expected"); + message.args = $root.google.protobuf.Struct.fromObject(object.args); + } + if (object.variables != null) { + if (typeof object.variables !== "object") + throw TypeError(".google.cloud.ces.v1beta.ExecuteToolRequest.variables: object expected"); + message.variables = $root.google.protobuf.Struct.fromObject(object.variables); + } + return message; + }; + + /** + * Creates a plain object from an ExecuteToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @static + * @param {google.cloud.ces.v1beta.ExecuteToolRequest} message ExecuteToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteToolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.args = null; + object.parent = ""; + object.variables = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.args != null && message.hasOwnProperty("args")) + object.args = $root.google.protobuf.Struct.toObject(message.args, options); + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.variables != null && message.hasOwnProperty("variables")) + object.variables = $root.google.protobuf.Struct.toObject(message.variables, options); + return object; + }; + + /** + * Converts this ExecuteToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @instance + * @returns {Object.} JSON object + */ + ExecuteToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteToolRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ExecuteToolRequest"; + }; + + return ExecuteToolRequest; + })(); + + v1beta.ExecuteToolResponse = (function() { + + /** + * Properties of an ExecuteToolResponse. + * @memberof google.cloud.ces.v1beta + * @interface IExecuteToolResponse + * @property {string|null} [tool] ExecuteToolResponse tool + * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] ExecuteToolResponse toolsetTool + * @property {google.protobuf.IStruct|null} [response] ExecuteToolResponse response + * @property {google.protobuf.IStruct|null} [variables] ExecuteToolResponse variables + */ + + /** + * Constructs a new ExecuteToolResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ExecuteToolResponse. + * @implements IExecuteToolResponse + * @constructor + * @param {google.cloud.ces.v1beta.IExecuteToolResponse=} [properties] Properties to set + */ + function ExecuteToolResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteToolResponse tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @instance + */ + ExecuteToolResponse.prototype.tool = null; + + /** + * ExecuteToolResponse toolsetTool. + * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @instance + */ + ExecuteToolResponse.prototype.toolsetTool = null; + + /** + * ExecuteToolResponse response. + * @member {google.protobuf.IStruct|null|undefined} response + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @instance + */ + ExecuteToolResponse.prototype.response = null; + + /** + * ExecuteToolResponse variables. + * @member {google.protobuf.IStruct|null|undefined} variables + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @instance + */ + ExecuteToolResponse.prototype.variables = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExecuteToolResponse toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @instance + */ + Object.defineProperty(ExecuteToolResponse.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecuteToolResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @static + * @param {google.cloud.ces.v1beta.IExecuteToolResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ExecuteToolResponse} ExecuteToolResponse instance + */ + ExecuteToolResponse.create = function create(properties) { + return new ExecuteToolResponse(properties); + }; + + /** + * Encodes the specified ExecuteToolResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @static + * @param {google.cloud.ces.v1beta.IExecuteToolResponse} message ExecuteToolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteToolResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Struct.encode(message.response, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) + $root.google.protobuf.Struct.encode(message.variables, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @static + * @param {google.cloud.ces.v1beta.IExecuteToolResponse} message ExecuteToolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteToolResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteToolResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ExecuteToolResponse} ExecuteToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteToolResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ExecuteToolResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 3: { + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 2: { + message.response = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 4: { + message.variables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteToolResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ExecuteToolResponse} ExecuteToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteToolResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteToolResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteToolResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + var error = $root.google.protobuf.Struct.verify(message.response); + if (error) + return "response." + error; + } + if (message.variables != null && message.hasOwnProperty("variables")) { + var error = $root.google.protobuf.Struct.verify(message.variables); + if (error) + return "variables." + error; + } + return null; + }; + + /** + * Creates an ExecuteToolResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ExecuteToolResponse} ExecuteToolResponse + */ + ExecuteToolResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ExecuteToolResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ExecuteToolResponse(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.ExecuteToolResponse.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.cloud.ces.v1beta.ExecuteToolResponse.response: object expected"); + message.response = $root.google.protobuf.Struct.fromObject(object.response); + } + if (object.variables != null) { + if (typeof object.variables !== "object") + throw TypeError(".google.cloud.ces.v1beta.ExecuteToolResponse.variables: object expected"); + message.variables = $root.google.protobuf.Struct.fromObject(object.variables); + } + return message; + }; + + /** + * Creates a plain object from an ExecuteToolResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @static + * @param {google.cloud.ces.v1beta.ExecuteToolResponse} message ExecuteToolResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteToolResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.response = null; + object.variables = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.response != null && message.hasOwnProperty("response")) + object.response = $root.google.protobuf.Struct.toObject(message.response, options); + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + if (message.variables != null && message.hasOwnProperty("variables")) + object.variables = $root.google.protobuf.Struct.toObject(message.variables, options); + return object; + }; + + /** + * Converts this ExecuteToolResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @instance + * @returns {Object.} JSON object + */ + ExecuteToolResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteToolResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteToolResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ExecuteToolResponse"; + }; + + return ExecuteToolResponse; + })(); + + v1beta.RetrieveToolSchemaRequest = (function() { + + /** + * Properties of a RetrieveToolSchemaRequest. + * @memberof google.cloud.ces.v1beta + * @interface IRetrieveToolSchemaRequest + * @property {string|null} [tool] RetrieveToolSchemaRequest tool + * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] RetrieveToolSchemaRequest toolsetTool + * @property {string|null} [parent] RetrieveToolSchemaRequest parent + */ + + /** + * Constructs a new RetrieveToolSchemaRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RetrieveToolSchemaRequest. + * @implements IRetrieveToolSchemaRequest + * @constructor + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaRequest=} [properties] Properties to set + */ + function RetrieveToolSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrieveToolSchemaRequest tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @instance + */ + RetrieveToolSchemaRequest.prototype.tool = null; + + /** + * RetrieveToolSchemaRequest toolsetTool. + * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @instance + */ + RetrieveToolSchemaRequest.prototype.toolsetTool = null; + + /** + * RetrieveToolSchemaRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @instance + */ + RetrieveToolSchemaRequest.prototype.parent = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RetrieveToolSchemaRequest toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @instance + */ + Object.defineProperty(RetrieveToolSchemaRequest.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RetrieveToolSchemaRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest instance + */ + RetrieveToolSchemaRequest.create = function create(properties) { + return new RetrieveToolSchemaRequest(properties); + }; + + /** + * Encodes the specified RetrieveToolSchemaRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaRequest} message RetrieveToolSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolSchemaRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); + return writer; + }; + + /** + * Encodes the specified RetrieveToolSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaRequest} message RetrieveToolSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolSchemaRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RetrieveToolSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 3: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrieveToolSchemaRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrieveToolSchemaRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a RetrieveToolSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest + */ + RetrieveToolSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RetrieveToolSchemaRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.RetrieveToolSchemaRequest(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.RetrieveToolSchemaRequest.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a RetrieveToolSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @static + * @param {google.cloud.ces.v1beta.RetrieveToolSchemaRequest} message RetrieveToolSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrieveToolSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this RetrieveToolSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + RetrieveToolSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrieveToolSchemaRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrieveToolSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RetrieveToolSchemaRequest"; + }; + + return RetrieveToolSchemaRequest; + })(); + + v1beta.RetrieveToolSchemaResponse = (function() { + + /** + * Properties of a RetrieveToolSchemaResponse. + * @memberof google.cloud.ces.v1beta + * @interface IRetrieveToolSchemaResponse + * @property {string|null} [tool] RetrieveToolSchemaResponse tool + * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] RetrieveToolSchemaResponse toolsetTool + * @property {google.cloud.ces.v1beta.ISchema|null} [inputSchema] RetrieveToolSchemaResponse inputSchema + * @property {google.cloud.ces.v1beta.ISchema|null} [outputSchema] RetrieveToolSchemaResponse outputSchema + */ + + /** + * Constructs a new RetrieveToolSchemaResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RetrieveToolSchemaResponse. + * @implements IRetrieveToolSchemaResponse + * @constructor + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaResponse=} [properties] Properties to set + */ + function RetrieveToolSchemaResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrieveToolSchemaResponse tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @instance + */ + RetrieveToolSchemaResponse.prototype.tool = null; + + /** + * RetrieveToolSchemaResponse toolsetTool. + * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @instance + */ + RetrieveToolSchemaResponse.prototype.toolsetTool = null; + + /** + * RetrieveToolSchemaResponse inputSchema. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} inputSchema + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @instance + */ + RetrieveToolSchemaResponse.prototype.inputSchema = null; + + /** + * RetrieveToolSchemaResponse outputSchema. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} outputSchema + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @instance + */ + RetrieveToolSchemaResponse.prototype.outputSchema = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RetrieveToolSchemaResponse toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @instance + */ + Object.defineProperty(RetrieveToolSchemaResponse.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RetrieveToolSchemaResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse instance + */ + RetrieveToolSchemaResponse.create = function create(properties) { + return new RetrieveToolSchemaResponse(properties); + }; + + /** + * Encodes the specified RetrieveToolSchemaResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaResponse} message RetrieveToolSchemaResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolSchemaResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inputSchema != null && Object.hasOwnProperty.call(message, "inputSchema")) + $root.google.cloud.ces.v1beta.Schema.encode(message.inputSchema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputSchema != null && Object.hasOwnProperty.call(message, "outputSchema")) + $root.google.cloud.ces.v1beta.Schema.encode(message.outputSchema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RetrieveToolSchemaResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaResponse} message RetrieveToolSchemaResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolSchemaResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolSchemaResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RetrieveToolSchemaResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 3: { + message.inputSchema = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputSchema = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolSchemaResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrieveToolSchemaResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrieveToolSchemaResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.inputSchema); + if (error) + return "inputSchema." + error; + } + if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.outputSchema); + if (error) + return "outputSchema." + error; + } + return null; + }; + + /** + * Creates a RetrieveToolSchemaResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse + */ + RetrieveToolSchemaResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RetrieveToolSchemaResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.RetrieveToolSchemaResponse(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.RetrieveToolSchemaResponse.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.inputSchema != null) { + if (typeof object.inputSchema !== "object") + throw TypeError(".google.cloud.ces.v1beta.RetrieveToolSchemaResponse.inputSchema: object expected"); + message.inputSchema = $root.google.cloud.ces.v1beta.Schema.fromObject(object.inputSchema); + } + if (object.outputSchema != null) { + if (typeof object.outputSchema !== "object") + throw TypeError(".google.cloud.ces.v1beta.RetrieveToolSchemaResponse.outputSchema: object expected"); + message.outputSchema = $root.google.cloud.ces.v1beta.Schema.fromObject(object.outputSchema); + } + return message; + }; + + /** + * Creates a plain object from a RetrieveToolSchemaResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @static + * @param {google.cloud.ces.v1beta.RetrieveToolSchemaResponse} message RetrieveToolSchemaResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrieveToolSchemaResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputSchema = null; + object.outputSchema = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) + object.inputSchema = $root.google.cloud.ces.v1beta.Schema.toObject(message.inputSchema, options); + if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) + object.outputSchema = $root.google.cloud.ces.v1beta.Schema.toObject(message.outputSchema, options); + return object; + }; + + /** + * Converts this RetrieveToolSchemaResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @instance + * @returns {Object.} JSON object + */ + RetrieveToolSchemaResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrieveToolSchemaResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrieveToolSchemaResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RetrieveToolSchemaResponse"; + }; + + return RetrieveToolSchemaResponse; + })(); + + v1beta.RetrieveToolsRequest = (function() { + + /** + * Properties of a RetrieveToolsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IRetrieveToolsRequest + * @property {string|null} [toolset] RetrieveToolsRequest toolset + * @property {Array.|null} [toolIds] RetrieveToolsRequest toolIds + */ + + /** + * Constructs a new RetrieveToolsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RetrieveToolsRequest. + * @implements IRetrieveToolsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IRetrieveToolsRequest=} [properties] Properties to set + */ + function RetrieveToolsRequest(properties) { + this.toolIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrieveToolsRequest toolset. + * @member {string} toolset + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @instance + */ + RetrieveToolsRequest.prototype.toolset = ""; + + /** + * RetrieveToolsRequest toolIds. + * @member {Array.} toolIds + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @instance + */ + RetrieveToolsRequest.prototype.toolIds = $util.emptyArray; + + /** + * Creates a new RetrieveToolsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RetrieveToolsRequest} RetrieveToolsRequest instance + */ + RetrieveToolsRequest.create = function create(properties) { + return new RetrieveToolsRequest(properties); + }; + + /** + * Encodes the specified RetrieveToolsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolsRequest} message RetrieveToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.toolset); + if (message.toolIds != null && message.toolIds.length) + for (var i = 0; i < message.toolIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.toolIds[i]); + return writer; + }; + + /** + * Encodes the specified RetrieveToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolsRequest} message RetrieveToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrieveToolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RetrieveToolsRequest} RetrieveToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RetrieveToolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolset = reader.string(); + break; + } + case 3: { + if (!(message.toolIds && message.toolIds.length)) + message.toolIds = []; + message.toolIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrieveToolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RetrieveToolsRequest} RetrieveToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrieveToolsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrieveToolsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolset != null && message.hasOwnProperty("toolset")) + if (!$util.isString(message.toolset)) + return "toolset: string expected"; + if (message.toolIds != null && message.hasOwnProperty("toolIds")) { + if (!Array.isArray(message.toolIds)) + return "toolIds: array expected"; + for (var i = 0; i < message.toolIds.length; ++i) + if (!$util.isString(message.toolIds[i])) + return "toolIds: string[] expected"; + } + return null; + }; + + /** + * Creates a RetrieveToolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RetrieveToolsRequest} RetrieveToolsRequest + */ + RetrieveToolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RetrieveToolsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.RetrieveToolsRequest(); + if (object.toolset != null) + message.toolset = String(object.toolset); + if (object.toolIds) { + if (!Array.isArray(object.toolIds)) + throw TypeError(".google.cloud.ces.v1beta.RetrieveToolsRequest.toolIds: array expected"); + message.toolIds = []; + for (var i = 0; i < object.toolIds.length; ++i) + message.toolIds[i] = String(object.toolIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a RetrieveToolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @static + * @param {google.cloud.ces.v1beta.RetrieveToolsRequest} message RetrieveToolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrieveToolsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.toolIds = []; + if (options.defaults) + object.toolset = ""; + if (message.toolset != null && message.hasOwnProperty("toolset")) + object.toolset = message.toolset; + if (message.toolIds && message.toolIds.length) { + object.toolIds = []; + for (var j = 0; j < message.toolIds.length; ++j) + object.toolIds[j] = message.toolIds[j]; + } + return object; + }; + + /** + * Converts this RetrieveToolsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @instance + * @returns {Object.} JSON object + */ + RetrieveToolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrieveToolsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrieveToolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RetrieveToolsRequest"; + }; + + return RetrieveToolsRequest; + })(); + + v1beta.RetrieveToolsResponse = (function() { + + /** + * Properties of a RetrieveToolsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IRetrieveToolsResponse + * @property {Array.|null} [tools] RetrieveToolsResponse tools + */ + + /** + * Constructs a new RetrieveToolsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RetrieveToolsResponse. + * @implements IRetrieveToolsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IRetrieveToolsResponse=} [properties] Properties to set + */ + function RetrieveToolsResponse(properties) { + this.tools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrieveToolsResponse tools. + * @member {Array.} tools + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @instance + */ + RetrieveToolsResponse.prototype.tools = $util.emptyArray; + + /** + * Creates a new RetrieveToolsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RetrieveToolsResponse} RetrieveToolsResponse instance + */ + RetrieveToolsResponse.create = function create(properties) { + return new RetrieveToolsResponse(properties); + }; + + /** + * Encodes the specified RetrieveToolsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolsResponse} message RetrieveToolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + $root.google.cloud.ces.v1beta.Tool.encode(message.tools[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RetrieveToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolsResponse} message RetrieveToolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrieveToolsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RetrieveToolsResponse} RetrieveToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RetrieveToolsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push($root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrieveToolsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RetrieveToolsResponse} RetrieveToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrieveToolsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrieveToolsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tools != null && message.hasOwnProperty("tools")) { + if (!Array.isArray(message.tools)) + return "tools: array expected"; + for (var i = 0; i < message.tools.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tools[i]); + if (error) + return "tools." + error; + } + } + return null; + }; + + /** + * Creates a RetrieveToolsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RetrieveToolsResponse} RetrieveToolsResponse + */ + RetrieveToolsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RetrieveToolsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.RetrieveToolsResponse(); + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.cloud.ces.v1beta.RetrieveToolsResponse.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) { + if (typeof object.tools[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.RetrieveToolsResponse.tools: object expected"); + message.tools[i] = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tools[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RetrieveToolsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @static + * @param {google.cloud.ces.v1beta.RetrieveToolsResponse} message RetrieveToolsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrieveToolsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tools = []; + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = $root.google.cloud.ces.v1beta.Tool.toObject(message.tools[j], options); + } + return object; + }; + + /** + * Converts this RetrieveToolsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @instance + * @returns {Object.} JSON object + */ + RetrieveToolsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrieveToolsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrieveToolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RetrieveToolsResponse"; + }; + + return RetrieveToolsResponse; + })(); + + v1beta.WidgetService = (function() { + + /** + * Constructs a new WidgetService service. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a WidgetService + * @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 WidgetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (WidgetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WidgetService; + + /** + * Creates new WidgetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.ces.v1beta.WidgetService + * @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 {WidgetService} RPC service. Useful where requests and/or responses are streamed. + */ + WidgetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.WidgetService|generateChatToken}. + * @memberof google.cloud.ces.v1beta.WidgetService + * @typedef GenerateChatTokenCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.GenerateChatTokenResponse} [response] GenerateChatTokenResponse + */ + + /** + * Calls GenerateChatToken. + * @function generateChatToken + * @memberof google.cloud.ces.v1beta.WidgetService + * @instance + * @param {google.cloud.ces.v1beta.IGenerateChatTokenRequest} request GenerateChatTokenRequest message or plain object + * @param {google.cloud.ces.v1beta.WidgetService.GenerateChatTokenCallback} callback Node-style callback called with the error, if any, and GenerateChatTokenResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WidgetService.prototype.generateChatToken = function generateChatToken(request, callback) { + return this.rpcCall(generateChatToken, $root.google.cloud.ces.v1beta.GenerateChatTokenRequest, $root.google.cloud.ces.v1beta.GenerateChatTokenResponse, request, callback); + }, "name", { value: "GenerateChatToken" }); + + /** + * Calls GenerateChatToken. + * @function generateChatToken + * @memberof google.cloud.ces.v1beta.WidgetService + * @instance + * @param {google.cloud.ces.v1beta.IGenerateChatTokenRequest} request GenerateChatTokenRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return WidgetService; + })(); + + v1beta.GenerateChatTokenRequest = (function() { + + /** + * Properties of a GenerateChatTokenRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGenerateChatTokenRequest + * @property {string|null} [name] GenerateChatTokenRequest name + * @property {string|null} [deployment] GenerateChatTokenRequest deployment + * @property {string|null} [recaptchaToken] GenerateChatTokenRequest recaptchaToken + */ + + /** + * Constructs a new GenerateChatTokenRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GenerateChatTokenRequest. + * @implements IGenerateChatTokenRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGenerateChatTokenRequest=} [properties] Properties to set + */ + function GenerateChatTokenRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateChatTokenRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @instance + */ + GenerateChatTokenRequest.prototype.name = ""; + + /** + * GenerateChatTokenRequest deployment. + * @member {string} deployment + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @instance + */ + GenerateChatTokenRequest.prototype.deployment = ""; + + /** + * GenerateChatTokenRequest recaptchaToken. + * @member {string} recaptchaToken + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @instance + */ + GenerateChatTokenRequest.prototype.recaptchaToken = ""; + + /** + * Creates a new GenerateChatTokenRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @static + * @param {google.cloud.ces.v1beta.IGenerateChatTokenRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateChatTokenRequest} GenerateChatTokenRequest instance + */ + GenerateChatTokenRequest.create = function create(properties) { + return new GenerateChatTokenRequest(properties); + }; + + /** + * Encodes the specified GenerateChatTokenRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @static + * @param {google.cloud.ces.v1beta.IGenerateChatTokenRequest} message GenerateChatTokenRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateChatTokenRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deployment); + if (message.recaptchaToken != null && Object.hasOwnProperty.call(message, "recaptchaToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.recaptchaToken); + return writer; + }; + + /** + * Encodes the specified GenerateChatTokenRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @static + * @param {google.cloud.ces.v1beta.IGenerateChatTokenRequest} message GenerateChatTokenRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateChatTokenRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateChatTokenRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateChatTokenRequest} GenerateChatTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateChatTokenRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateChatTokenRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.deployment = reader.string(); + break; + } + case 3: { + message.recaptchaToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateChatTokenRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateChatTokenRequest} GenerateChatTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateChatTokenRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateChatTokenRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateChatTokenRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) + if (!$util.isString(message.deployment)) + return "deployment: string expected"; + if (message.recaptchaToken != null && message.hasOwnProperty("recaptchaToken")) + if (!$util.isString(message.recaptchaToken)) + return "recaptchaToken: string expected"; + return null; + }; + + /** + * Creates a GenerateChatTokenRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateChatTokenRequest} GenerateChatTokenRequest + */ + GenerateChatTokenRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateChatTokenRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateChatTokenRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.deployment != null) + message.deployment = String(object.deployment); + if (object.recaptchaToken != null) + message.recaptchaToken = String(object.recaptchaToken); + return message; + }; + + /** + * Creates a plain object from a GenerateChatTokenRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @static + * @param {google.cloud.ces.v1beta.GenerateChatTokenRequest} message GenerateChatTokenRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateChatTokenRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.deployment = ""; + object.recaptchaToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = message.deployment; + if (message.recaptchaToken != null && message.hasOwnProperty("recaptchaToken")) + object.recaptchaToken = message.recaptchaToken; + return object; + }; + + /** + * Converts this GenerateChatTokenRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateChatTokenRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateChatTokenRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateChatTokenRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateChatTokenRequest"; + }; + + return GenerateChatTokenRequest; + })(); + + v1beta.GenerateChatTokenResponse = (function() { + + /** + * Properties of a GenerateChatTokenResponse. + * @memberof google.cloud.ces.v1beta + * @interface IGenerateChatTokenResponse + * @property {string|null} [chatToken] GenerateChatTokenResponse chatToken + * @property {google.protobuf.ITimestamp|null} [expireTime] GenerateChatTokenResponse expireTime + */ + + /** + * Constructs a new GenerateChatTokenResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GenerateChatTokenResponse. + * @implements IGenerateChatTokenResponse + * @constructor + * @param {google.cloud.ces.v1beta.IGenerateChatTokenResponse=} [properties] Properties to set + */ + function GenerateChatTokenResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateChatTokenResponse chatToken. + * @member {string} chatToken + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @instance + */ + GenerateChatTokenResponse.prototype.chatToken = ""; + + /** + * GenerateChatTokenResponse expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @instance + */ + GenerateChatTokenResponse.prototype.expireTime = null; + + /** + * Creates a new GenerateChatTokenResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @static + * @param {google.cloud.ces.v1beta.IGenerateChatTokenResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateChatTokenResponse} GenerateChatTokenResponse instance + */ + GenerateChatTokenResponse.create = function create(properties) { + return new GenerateChatTokenResponse(properties); + }; + + /** + * Encodes the specified GenerateChatTokenResponse message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @static + * @param {google.cloud.ces.v1beta.IGenerateChatTokenResponse} message GenerateChatTokenResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateChatTokenResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chatToken != null && Object.hasOwnProperty.call(message, "chatToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.chatToken); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateChatTokenResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @static + * @param {google.cloud.ces.v1beta.IGenerateChatTokenResponse} message GenerateChatTokenResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateChatTokenResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateChatTokenResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateChatTokenResponse} GenerateChatTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateChatTokenResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateChatTokenResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.chatToken = reader.string(); + break; + } + case 2: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateChatTokenResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateChatTokenResponse} GenerateChatTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateChatTokenResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateChatTokenResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateChatTokenResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chatToken != null && message.hasOwnProperty("chatToken")) + if (!$util.isString(message.chatToken)) + return "chatToken: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + return null; + }; + + /** + * Creates a GenerateChatTokenResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateChatTokenResponse} GenerateChatTokenResponse + */ + GenerateChatTokenResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateChatTokenResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateChatTokenResponse(); + if (object.chatToken != null) + message.chatToken = String(object.chatToken); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateChatTokenResponse.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + return message; + }; + + /** + * Creates a plain object from a GenerateChatTokenResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @static + * @param {google.cloud.ces.v1beta.GenerateChatTokenResponse} message GenerateChatTokenResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateChatTokenResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chatToken = ""; + object.expireTime = null; + } + if (message.chatToken != null && message.hasOwnProperty("chatToken")) + object.chatToken = message.chatToken; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + return object; + }; + + /** + * Converts this GenerateChatTokenResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateChatTokenResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateChatTokenResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateChatTokenResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateChatTokenResponse"; + }; + + return GenerateChatTokenResponse; + })(); + + return v1beta; + })(); + + return ces; + })(); + + 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.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * 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(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + 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; + } + 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); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + 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.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(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]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.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.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.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.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.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.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-ces/protos/protos.json b/owl-bot-staging/google-cloud-ces/protos/protos.json new file mode 100644 index 00000000000..201e3b6d4d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/protos/protos.json @@ -0,0 +1,22318 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "ces": { + "nested": { + "v1": { + "options": { + "go_package": "cloud.google.com/go/ces/apiv1/cespb;cespb", + "java_multiple_files": true, + "java_outer_classname": "WidgetServiceProto", + "java_package": "com.google.cloud.ces.v1", + "(google.api.resource_definition).type": "ces.googleapis.com/Session", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/apps/{app}/sessions/{session}" + }, + "nested": { + "Agent": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Agent", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/agents/{agent}", + "(google.api.resource).plural": "agents", + "(google.api.resource).singular": "agent" + }, + "oneofs": { + "agentType": { + "oneof": [ + "llmAgent", + "remoteDialogflowAgent" + ] + } + }, + "fields": { + "llmAgent": { + "type": "LlmAgent", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "remoteDialogflowAgent": { + "type": "RemoteDialogflowAgent", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modelSettings": { + "type": "ModelSettings", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instruction": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tools": { + "rule": "repeated", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "childAgents": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "beforeAgentCallbacks": { + "rule": "repeated", + "type": "Callback", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "afterAgentCallbacks": { + "rule": "repeated", + "type": "Callback", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "beforeModelCallbacks": { + "rule": "repeated", + "type": "Callback", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "afterModelCallbacks": { + "rule": "repeated", + "type": "Callback", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "beforeToolCallbacks": { + "rule": "repeated", + "type": "Callback", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "afterToolCallbacks": { + "rule": "repeated", + "type": "Callback", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "guardrails": { + "rule": "repeated", + "type": "string", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" + } + }, + "etag": { + "type": "string", + "id": 24 + }, + "toolsets": { + "rule": "repeated", + "type": "AgentToolset", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "generatedSummary": { + "type": "string", + "id": 29, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "transferRules": { + "rule": "repeated", + "type": "TransferRule", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "LlmAgent": { + "fields": {} + }, + "RemoteDialogflowAgent": { + "fields": { + "agent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/DialogflowAgent" + } + }, + "flowId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "environmentId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inputVariableMapping": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputVariableMapping": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "respectResponseInterruptionSettings": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AgentToolset": { + "fields": { + "toolset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" + } + }, + "toolIds": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ExpressionCondition": { + "fields": { + "expression": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PythonCodeCondition": { + "fields": { + "pythonCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TransferRule": { + "oneofs": { + "ruleType": { + "oneof": [ + "deterministicTransfer", + "disablePlannerTransfer" + ] + } + }, + "fields": { + "deterministicTransfer": { + "type": "DeterministicTransfer", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disablePlannerTransfer": { + "type": "DisablePlannerTransfer", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "childAgent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "direction": { + "type": "Direction", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "DeterministicTransfer": { + "oneofs": { + "conditionType": { + "oneof": [ + "expressionCondition", + "pythonCodeCondition" + ] + } + }, + "fields": { + "expressionCondition": { + "type": "ExpressionCondition", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pythonCodeCondition": { + "type": "PythonCodeCondition", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DisablePlannerTransfer": { + "fields": { + "expressionCondition": { + "type": "ExpressionCondition", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Direction": { + "values": { + "DIRECTION_UNSPECIFIED": 0, + "PARENT_TO_CHILD": 1, + "CHILD_TO_PARENT": 2 + } + } + } + }, + "ExecutionType": { + "values": { + "EXECUTION_TYPE_UNSPECIFIED": 0, + "SYNCHRONOUS": 1, + "ASYNCHRONOUS": 2 + } + }, + "Callback": { + "oneofs": { + "callback": { + "oneof": [ + "pythonCode" + ] + } + }, + "fields": { + "pythonCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disabled": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "proactiveExecutionEnabled": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ModelSettings": { + "oneofs": { + "_temperature": { + "oneof": [ + "temperature" + ] + } + }, + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "temperature": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "TriggerAction": { + "oneofs": { + "action": { + "oneof": [ + "respondImmediately", + "transferAgent", + "generativeAnswer" + ] + } + }, + "fields": { + "respondImmediately": { + "type": "RespondImmediately", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "transferAgent": { + "type": "TransferAgent", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "generativeAnswer": { + "type": "GenerativeAnswer", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Response": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "disabled": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RespondImmediately": { + "fields": { + "responses": { + "rule": "repeated", + "type": "Response", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GenerativeAnswer": { + "fields": { + "prompt": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TransferAgent": { + "fields": { + "agent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + } + } + } + } + }, + "TlsConfig": { + "fields": { + "caCerts": { + "rule": "repeated", + "type": "CaCert", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "CaCert": { + "fields": { + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cert": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ServiceDirectoryConfig": { + "fields": { + "service": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "servicedirectory.googleapis.com/Service" + } + } + } + }, + "ChannelProfile": { + "fields": { + "profileId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "channelType": { + "type": "ChannelType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "personaProperty": { + "type": "PersonaProperty", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disableDtmf": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disableBargeInControl": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "webWidgetConfig": { + "type": "WebWidgetConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "noiseSuppressionLevel": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PersonaProperty": { + "fields": { + "persona": { + "type": "Persona", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Persona": { + "values": { + "UNKNOWN": 0, + "CONCISE": 1, + "CHATTY": 2 + } + } + } + }, + "WebWidgetConfig": { + "fields": { + "modality": { + "type": "Modality", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "theme": { + "type": "Theme", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "webWidgetTitle": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "securitySettings": { + "type": "SecuritySettings", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SecuritySettings": { + "fields": { + "enablePublicAccess": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableOriginCheck": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowedOrigins": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableRecaptcha": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Modality": { + "values": { + "MODALITY_UNSPECIFIED": 0, + "CHAT_AND_VOICE": 1, + "VOICE_ONLY": 2, + "CHAT_ONLY": 3 + } + }, + "Theme": { + "values": { + "THEME_UNSPECIFIED": 0, + "LIGHT": 1, + "DARK": 2 + } + } + } + }, + "ChannelType": { + "values": { + "UNKNOWN": 0, + "WEB_UI": 2, + "API": 3, + "TWILIO": 4, + "GOOGLE_TELEPHONY_PLATFORM": 5, + "CONTACT_CENTER_AS_A_SERVICE": 6, + "FIVE9": 7 + } + } + } + }, + "Span": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "attributes": { + "type": "google.protobuf.Struct", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "childSpans": { + "rule": "repeated", + "type": "Span", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "AgentService": { + "options": { + "(google.api.default_host)": "ces.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListApps": { + "requestType": "ListAppsRequest", + "responseType": "ListAppsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/apps", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/apps" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetApp": { + "requestType": "GetAppRequest", + "responseType": "App", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apps/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateApp": { + "requestType": "CreateAppRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/apps", + "(google.api.http).body": "app", + "(google.api.method_signature)": "parent,app", + "(google.longrunning.operation_info).response_type": "App", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/apps", + "body": "app" + } + }, + { + "(google.api.method_signature)": "parent,app,app_id" + }, + { + "(google.api.method_signature)": "parent,app" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "App", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateApp": { + "requestType": "UpdateAppRequest", + "responseType": "App", + "options": { + "(google.api.http).patch": "/v1/{app.name=projects/*/locations/*/apps/*}", + "(google.api.http).body": "app", + "(google.api.method_signature)": "app,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{app.name=projects/*/locations/*/apps/*}", + "body": "app" + } + }, + { + "(google.api.method_signature)": "app,update_mask" + } + ] + }, + "DeleteApp": { + "requestType": "DeleteAppRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apps/*}", + "(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/*/apps/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExportApp": { + "requestType": "ExportAppRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/apps/*}:exportApp", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "ExportAppResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/apps/*}:exportApp", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportAppResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ImportApp": { + "requestType": "ImportAppRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/apps:importApp", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,display_name,app_id", + "(google.longrunning.operation_info).response_type": "ImportAppResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/apps:importApp", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,display_name,app_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportAppResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListAgents": { + "requestType": "ListAgentsRequest", + "responseType": "ListAgentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apps/*}/agents", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apps/*}/agents" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetAgent": { + "requestType": "GetAgentRequest", + "responseType": "Agent", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*/agents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apps/*/agents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateAgent": { + "requestType": "CreateAgentRequest", + "responseType": "Agent", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}/agents", + "(google.api.http).body": "agent", + "(google.api.method_signature)": "parent,agent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apps/*}/agents", + "body": "agent" + } + }, + { + "(google.api.method_signature)": "parent,agent,agent_id" + }, + { + "(google.api.method_signature)": "parent,agent" + } + ] + }, + "UpdateAgent": { + "requestType": "UpdateAgentRequest", + "responseType": "Agent", + "options": { + "(google.api.http).patch": "/v1/{agent.name=projects/*/locations/*/apps/*/agents/*}", + "(google.api.http).body": "agent", + "(google.api.method_signature)": "agent,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{agent.name=projects/*/locations/*/apps/*/agents/*}", + "body": "agent" + } + }, + { + "(google.api.method_signature)": "agent,update_mask" + } + ] + }, + "DeleteAgent": { + "requestType": "DeleteAgentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apps/*/agents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apps/*/agents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListExamples": { + "requestType": "ListExamplesRequest", + "responseType": "ListExamplesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apps/*}/examples", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apps/*}/examples" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetExample": { + "requestType": "GetExampleRequest", + "responseType": "Example", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*/examples/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apps/*/examples/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateExample": { + "requestType": "CreateExampleRequest", + "responseType": "Example", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}/examples", + "(google.api.http).body": "example", + "(google.api.method_signature)": "parent,example" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apps/*}/examples", + "body": "example" + } + }, + { + "(google.api.method_signature)": "parent,example,example_id" + }, + { + "(google.api.method_signature)": "parent,example" + } + ] + }, + "UpdateExample": { + "requestType": "UpdateExampleRequest", + "responseType": "Example", + "options": { + "(google.api.http).patch": "/v1/{example.name=projects/*/locations/*/apps/*/examples/*}", + "(google.api.http).body": "example", + "(google.api.method_signature)": "example,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{example.name=projects/*/locations/*/apps/*/examples/*}", + "body": "example" + } + }, + { + "(google.api.method_signature)": "example,update_mask" + } + ] + }, + "DeleteExample": { + "requestType": "DeleteExampleRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apps/*/examples/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apps/*/examples/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTools": { + "requestType": "ListToolsRequest", + "responseType": "ListToolsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apps/*}/tools", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apps/*}/tools" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTool": { + "requestType": "GetToolRequest", + "responseType": "Tool", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*/tools/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apps/*/tools/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListConversations": { + "requestType": "ListConversationsRequest", + "responseType": "ListConversationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apps/*}/conversations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apps/*}/conversations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConversation": { + "requestType": "GetConversationRequest", + "responseType": "Conversation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*/conversations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apps/*/conversations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteConversation": { + "requestType": "DeleteConversationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apps/*/conversations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apps/*/conversations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "BatchDeleteConversations": { + "requestType": "BatchDeleteConversationsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}/conversations:batchDelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "BatchDeleteConversationsResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apps/*}/conversations:batchDelete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchDeleteConversationsResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateTool": { + "requestType": "CreateToolRequest", + "responseType": "Tool", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}/tools", + "(google.api.http).body": "tool", + "(google.api.method_signature)": "parent,tool" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apps/*}/tools", + "body": "tool" + } + }, + { + "(google.api.method_signature)": "parent,tool,tool_id" + }, + { + "(google.api.method_signature)": "parent,tool" + } + ] + }, + "UpdateTool": { + "requestType": "UpdateToolRequest", + "responseType": "Tool", + "options": { + "(google.api.http).patch": "/v1/{tool.name=projects/*/locations/*/apps/*/tools/*}", + "(google.api.http).body": "tool", + "(google.api.method_signature)": "tool,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{tool.name=projects/*/locations/*/apps/*/tools/*}", + "body": "tool" + } + }, + { + "(google.api.method_signature)": "tool,update_mask" + } + ] + }, + "DeleteTool": { + "requestType": "DeleteToolRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apps/*/tools/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apps/*/tools/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListGuardrails": { + "requestType": "ListGuardrailsRequest", + "responseType": "ListGuardrailsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apps/*}/guardrails", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apps/*}/guardrails" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetGuardrail": { + "requestType": "GetGuardrailRequest", + "responseType": "Guardrail", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*/guardrails/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apps/*/guardrails/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateGuardrail": { + "requestType": "CreateGuardrailRequest", + "responseType": "Guardrail", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}/guardrails", + "(google.api.http).body": "guardrail", + "(google.api.method_signature)": "parent,guardrail" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apps/*}/guardrails", + "body": "guardrail" + } + }, + { + "(google.api.method_signature)": "parent,guardrail,guardrail_id" + }, + { + "(google.api.method_signature)": "parent,guardrail" + } + ] + }, + "UpdateGuardrail": { + "requestType": "UpdateGuardrailRequest", + "responseType": "Guardrail", + "options": { + "(google.api.http).patch": "/v1/{guardrail.name=projects/*/locations/*/apps/*/guardrails/*}", + "(google.api.http).body": "guardrail", + "(google.api.method_signature)": "guardrail,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{guardrail.name=projects/*/locations/*/apps/*/guardrails/*}", + "body": "guardrail" + } + }, + { + "(google.api.method_signature)": "guardrail,update_mask" + } + ] + }, + "DeleteGuardrail": { + "requestType": "DeleteGuardrailRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apps/*/guardrails/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apps/*/guardrails/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDeployments": { + "requestType": "ListDeploymentsRequest", + "responseType": "ListDeploymentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apps/*}/deployments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apps/*}/deployments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDeployment": { + "requestType": "GetDeploymentRequest", + "responseType": "Deployment", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*/deployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apps/*/deployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateDeployment": { + "requestType": "CreateDeploymentRequest", + "responseType": "Deployment", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}/deployments", + "(google.api.http).body": "deployment", + "(google.api.method_signature)": "parent,deployment" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apps/*}/deployments", + "body": "deployment" + } + }, + { + "(google.api.method_signature)": "parent,deployment,deployment_id" + }, + { + "(google.api.method_signature)": "parent,deployment" + } + ] + }, + "UpdateDeployment": { + "requestType": "UpdateDeploymentRequest", + "responseType": "Deployment", + "options": { + "(google.api.http).patch": "/v1/{deployment.name=projects/*/locations/*/apps/*/deployments/*}", + "(google.api.http).body": "deployment", + "(google.api.method_signature)": "deployment,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{deployment.name=projects/*/locations/*/apps/*/deployments/*}", + "body": "deployment" + } + }, + { + "(google.api.method_signature)": "deployment,update_mask" + } + ] + }, + "DeleteDeployment": { + "requestType": "DeleteDeploymentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apps/*/deployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apps/*/deployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListToolsets": { + "requestType": "ListToolsetsRequest", + "responseType": "ListToolsetsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apps/*}/toolsets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apps/*}/toolsets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetToolset": { + "requestType": "GetToolsetRequest", + "responseType": "Toolset", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*/toolsets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apps/*/toolsets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateToolset": { + "requestType": "CreateToolsetRequest", + "responseType": "Toolset", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}/toolsets", + "(google.api.http).body": "toolset", + "(google.api.method_signature)": "parent,toolset" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apps/*}/toolsets", + "body": "toolset" + } + }, + { + "(google.api.method_signature)": "parent,toolset,toolset_id" + }, + { + "(google.api.method_signature)": "parent,toolset" + } + ] + }, + "UpdateToolset": { + "requestType": "UpdateToolsetRequest", + "responseType": "Toolset", + "options": { + "(google.api.http).patch": "/v1/{toolset.name=projects/*/locations/*/apps/*/toolsets/*}", + "(google.api.http).body": "toolset", + "(google.api.method_signature)": "toolset,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{toolset.name=projects/*/locations/*/apps/*/toolsets/*}", + "body": "toolset" + } + }, + { + "(google.api.method_signature)": "toolset,update_mask" + } + ] + }, + "DeleteToolset": { + "requestType": "DeleteToolsetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apps/*/toolsets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apps/*/toolsets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListAppVersions": { + "requestType": "ListAppVersionsRequest", + "responseType": "ListAppVersionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apps/*}/versions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apps/*}/versions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetAppVersion": { + "requestType": "GetAppVersionRequest", + "responseType": "AppVersion", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apps/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateAppVersion": { + "requestType": "CreateAppVersionRequest", + "responseType": "AppVersion", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}/versions", + "(google.api.http).body": "app_version", + "(google.api.method_signature)": "parent,app_version" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apps/*}/versions", + "body": "app_version" + } + }, + { + "(google.api.method_signature)": "parent,app_version,app_version_id" + }, + { + "(google.api.method_signature)": "parent,app_version" + } + ] + }, + "DeleteAppVersion": { + "requestType": "DeleteAppVersionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apps/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apps/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "RestoreAppVersion": { + "requestType": "RestoreAppVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/apps/*/versions/*}:restore", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "RestoreAppVersionResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/apps/*/versions/*}:restore", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RestoreAppVersionResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListChangelogs": { + "requestType": "ListChangelogsRequest", + "responseType": "ListChangelogsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apps/*}/changelogs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apps/*}/changelogs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetChangelog": { + "requestType": "GetChangelogRequest", + "responseType": "Changelog", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*/changelogs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apps/*/changelogs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "ListAppsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/App" + } + }, + "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" + } + } + } + }, + "ListAppsResponse": { + "fields": { + "apps": { + "rule": "repeated", + "type": "App", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "UNORDERED_LIST" + } + } + } + }, + "GetAppRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + } + } + }, + "CreateAppRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/App" + } + }, + "appId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "app": { + "type": "App", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateAppRequest": { + "fields": { + "app": { + "type": "App", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteAppRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExportAppRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "exportFormat": { + "type": "ExportFormat", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gcsUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ExportFormat": { + "values": { + "EXPORT_FORMAT_UNSPECIFIED": 0, + "JSON": 1, + "YAML": 2 + } + } + } + }, + "ExportAppResponse": { + "oneofs": { + "app": { + "oneof": [ + "appContent", + "appUri" + ] + } + }, + "fields": { + "appContent": { + "type": "bytes", + "id": 1 + }, + "appUri": { + "type": "string", + "id": 2 + } + } + }, + "ImportAppRequest": { + "oneofs": { + "app": { + "oneof": [ + "gcsUri", + "appContent" + ] + } + }, + "fields": { + "gcsUri": { + "type": "string", + "id": 4 + }, + "appContent": { + "type": "bytes", + "id": 5 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/App" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "appId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "importOptions": { + "type": "ImportOptions", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreAppLock": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ImportOptions": { + "fields": { + "conflictResolutionStrategy": { + "type": "ConflictResolutionStrategy", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ConflictResolutionStrategy": { + "values": { + "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED": 0, + "REPLACE": 1, + "OVERWRITE": 2 + } + } + } + } + } + }, + "ImportAppResponse": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "warnings": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "ListAgentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Agent" + } + }, + "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" + } + } + } + }, + "ListAgentsResponse": { + "fields": { + "agents": { + "rule": "repeated", + "type": "Agent", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetAgentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + } + } + }, + "CreateAgentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Agent" + } + }, + "agentId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agent": { + "type": "Agent", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateAgentRequest": { + "fields": { + "agent": { + "type": "Agent", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteAgentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OperationMetadata": { + "fields": { + "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" + } + }, + "statusMessage": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ListExamplesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Example" + } + }, + "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" + } + } + } + }, + "ListExamplesResponse": { + "fields": { + "examples": { + "rule": "repeated", + "type": "Example", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetExampleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Example" + } + } + } + }, + "CreateExampleRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Example" + } + }, + "exampleId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "example": { + "type": "Example", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateExampleRequest": { + "fields": { + "example": { + "type": "Example", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteExampleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Example" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListToolsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Tool" + } + }, + "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" + } + } + } + }, + "ListToolsResponse": { + "fields": { + "tools": { + "rule": "repeated", + "type": "Tool", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetToolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + } + } + }, + "CreateToolRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Tool" + } + }, + "toolId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tool": { + "type": "Tool", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateToolRequest": { + "fields": { + "tool": { + "type": "Tool", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteToolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListConversationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Conversation" + } + }, + "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" + } + }, + "source": { + "type": "Conversation.Source", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sources": { + "rule": "repeated", + "type": "Conversation.Source", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListConversationsResponse": { + "fields": { + "conversations": { + "rule": "repeated", + "type": "Conversation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetConversationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" + } + }, + "source": { + "type": "Conversation.Source", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteConversationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" + } + }, + "source": { + "type": "Conversation.Source", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchDeleteConversationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Conversation" + } + }, + "conversations": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" + } + } + } + }, + "BatchDeleteConversationsResponse": { + "fields": { + "deletedConversations": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "failedConversations": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "errorMessages": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListGuardrailsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Guardrail" + } + }, + "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" + } + } + } + }, + "ListGuardrailsResponse": { + "fields": { + "guardrails": { + "rule": "repeated", + "type": "Guardrail", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetGuardrailRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" + } + } + } + }, + "CreateGuardrailRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Guardrail" + } + }, + "guardrailId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "guardrail": { + "type": "Guardrail", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateGuardrailRequest": { + "fields": { + "guardrail": { + "type": "Guardrail", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteGuardrailRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDeploymentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Deployment" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDeploymentsResponse": { + "fields": { + "deployments": { + "rule": "repeated", + "type": "Deployment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" + } + } + } + }, + "CreateDeploymentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Deployment" + } + }, + "deploymentId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deployment": { + "type": "Deployment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateDeploymentRequest": { + "fields": { + "deployment": { + "type": "Deployment", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListToolsetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Toolset" + } + }, + "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" + } + } + } + }, + "ListToolsetsResponse": { + "fields": { + "toolsets": { + "rule": "repeated", + "type": "Toolset", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetToolsetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" + } + } + } + }, + "CreateToolsetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Toolset" + } + }, + "toolsetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolset": { + "type": "Toolset", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateToolsetRequest": { + "fields": { + "toolset": { + "type": "Toolset", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteToolsetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListAppVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/AppVersion" + } + }, + "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" + } + } + } + }, + "ListAppVersionsResponse": { + "fields": { + "appVersions": { + "rule": "repeated", + "type": "AppVersion", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetAppVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + } + } + }, + "DeleteAppVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateAppVersionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/AppVersion" + } + }, + "appVersionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "appVersion": { + "type": "AppVersion", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RestoreAppVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + } + } + }, + "RestoreAppVersionResponse": { + "fields": {} + }, + "ListChangelogsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Changelog" + } + }, + "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" + } + } + } + }, + "ListChangelogsResponse": { + "fields": { + "changelogs": { + "rule": "repeated", + "type": "Changelog", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetChangelogRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Changelog" + } + } + } + }, + "App": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/App", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}", + "(google.api.resource).plural": "apps", + "(google.api.resource).singular": "app" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pinned": { + "type": "bool", + "id": 31, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rootAgent": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "languageSettings": { + "type": "LanguageSettings", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeZoneSettings": { + "type": "TimeZoneSettings", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "audioProcessingConfig": { + "type": "AudioProcessingConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "loggingSettings": { + "type": "LoggingSettings", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modelSettings": { + "type": "ModelSettings", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolExecutionMode": { + "type": "ToolExecutionMode", + "id": 32, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationMetricsThresholds": { + "type": "EvaluationMetricsThresholds", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "variableDeclarations": { + "rule": "repeated", + "type": "VariableDeclaration", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "predefinedVariableDeclarations": { + "rule": "repeated", + "type": "VariableDeclaration", + "id": 28, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "globalInstruction": { + "type": "string", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "guardrails": { + "rule": "repeated", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" + } + }, + "dataStoreSettings": { + "type": "DataStoreSettings", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultChannelProfile": { + "type": "ChannelProfile", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deploymentCount": { + "type": "int32", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clientCertificateSettings": { + "type": "ClientCertificateSettings", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "locked": { + "type": "bool", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "VariableDeclaration": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "schema": { + "type": "Schema", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ToolExecutionMode": { + "values": { + "TOOL_EXECUTION_MODE_UNSPECIFIED": 0, + "PARALLEL": 1, + "SEQUENTIAL": 2 + } + } + } + }, + "TimeZoneSettings": { + "fields": { + "timeZone": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "LanguageSettings": { + "fields": { + "defaultLanguageCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "supportedLanguageCodes": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableMultilingualSupport": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fallbackAction": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AudioProcessingConfig": { + "fields": { + "synthesizeSpeechConfigs": { + "keyType": "string", + "type": "SynthesizeSpeechConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bargeInConfig": { + "type": "BargeInConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inactivityTimeout": { + "type": "google.protobuf.Duration", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ambientSoundConfig": { + "type": "AmbientSoundConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AmbientSoundConfig": { + "oneofs": { + "source": { + "oneof": [ + "prebuiltAmbientNoise", + "gcsUri", + "prebuiltAmbientSound" + ] + } + }, + "fields": { + "prebuiltAmbientNoise": { + "type": "PrebuiltAmbientNoise", + "id": 1, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gcsUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prebuiltAmbientSound": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "volumeGainDb": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PrebuiltAmbientNoise": { + "values": { + "PREBUILT_AMBIENT_NOISE_UNSPECIFIED": 0, + "RETAIL_STORE": 1, + "CONVENTION_HALL": 2, + "OUTDOOR": 3 + } + } + } + }, + "BargeInConfig": { + "fields": { + "disableBargeIn": { + "type": "bool", + "id": 1, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bargeInAwareness": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SynthesizeSpeechConfig": { + "fields": { + "voice": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "speakingRate": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "MetricAnalysisSettings": { + "fields": { + "llmMetricsOptedOut": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "LoggingSettings": { + "fields": { + "redactionConfig": { + "type": "RedactionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "audioRecordingConfig": { + "type": "AudioRecordingConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bigqueryExportSettings": { + "type": "BigQueryExportSettings", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cloudLoggingSettings": { + "type": "CloudLoggingSettings", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "conversationLoggingSettings": { + "type": "ConversationLoggingSettings", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationAudioRecordingConfig": { + "type": "AudioRecordingConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "metricAnalysisSettings": { + "type": "MetricAnalysisSettings", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EvaluationMetricsThresholds": { + "fields": { + "goldenEvaluationMetricsThresholds": { + "type": "GoldenEvaluationMetricsThresholds", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "hallucinationMetricBehavior": { + "type": "HallucinationMetricBehavior", + "id": 3, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "goldenHallucinationMetricBehavior": { + "type": "HallucinationMetricBehavior", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scenarioHallucinationMetricBehavior": { + "type": "HallucinationMetricBehavior", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "GoldenEvaluationMetricsThresholds": { + "fields": { + "turnLevelMetricsThresholds": { + "type": "TurnLevelMetricsThresholds", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expectationLevelMetricsThresholds": { + "type": "ExpectationLevelMetricsThresholds", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolMatchingSettings": { + "type": "ToolMatchingSettings", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "TurnLevelMetricsThresholds": { + "oneofs": { + "_semanticSimilaritySuccessThreshold": { + "oneof": [ + "semanticSimilaritySuccessThreshold" + ] + }, + "_overallToolInvocationCorrectnessThreshold": { + "oneof": [ + "overallToolInvocationCorrectnessThreshold" + ] + } + }, + "fields": { + "semanticSimilaritySuccessThreshold": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "overallToolInvocationCorrectnessThreshold": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "semanticSimilarityChannel": { + "type": "SemanticSimilarityChannel", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SemanticSimilarityChannel": { + "values": { + "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED": 0, + "TEXT": 1, + "AUDIO": 2 + } + } + } + }, + "ExpectationLevelMetricsThresholds": { + "oneofs": { + "_toolInvocationParameterCorrectnessThreshold": { + "oneof": [ + "toolInvocationParameterCorrectnessThreshold" + ] + } + }, + "fields": { + "toolInvocationParameterCorrectnessThreshold": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + } + } + }, + "ToolMatchingSettings": { + "fields": { + "extraToolCallBehavior": { + "type": "ExtraToolCallBehavior", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ExtraToolCallBehavior": { + "values": { + "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED": 0, + "FAIL": 1, + "ALLOW": 2 + } + } + } + }, + "HallucinationMetricBehavior": { + "values": { + "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": 0, + "DISABLED": 1, + "ENABLED": 2 + } + } + } + }, + "ClientCertificateSettings": { + "fields": { + "tlsCertificate": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "privateKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "passphrase": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ConversationLoggingSettings": { + "fields": { + "disableConversationLogging": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CloudLoggingSettings": { + "fields": { + "enableCloudLogging": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AudioRecordingConfig": { + "fields": { + "gcsBucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gcsPathPrefix": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RedactionConfig": { + "fields": { + "enableRedaction": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inspectTemplate": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dlp.googleapis.com/InspectTemplate" + } + }, + "deidentifyTemplate": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dlp.googleapis.com/DeidentifyTemplate" + } + } + } + }, + "DataStoreSettings": { + "fields": { + "engines": { + "rule": "repeated", + "type": "Engine", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Engine": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/Engine" + } + }, + "type": { + "type": "Type", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "ENGINE_TYPE_SEARCH": 1, + "ENGINE_TYPE_CHAT": 2 + } + } + } + } + } + }, + "BigQueryExportSettings": { + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "project": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataset": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Schema": { + "oneofs": { + "_minimum": { + "oneof": [ + "minimum" + ] + }, + "_maximum": { + "oneof": [ + "maximum" + ] + } + }, + "fields": { + "type": { + "type": "Type", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "properties": { + "keyType": "string", + "type": "Schema", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "required": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "items": { + "type": "Schema", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nullable": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "uniqueItems": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prefixItems": { + "rule": "repeated", + "type": "Schema", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "additionalProperties": { + "type": "Schema", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "anyOf": { + "rule": "repeated", + "type": "Schema", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enum": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "default": { + "type": "google.protobuf.Value", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ref": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defs": { + "keyType": "string", + "type": "Schema", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "title": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "minItems": { + "type": "int64", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxItems": { + "type": "int64", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "minimum": { + "type": "double", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "maximum": { + "type": "double", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "STRING": 1, + "INTEGER": 2, + "NUMBER": 3, + "BOOLEAN": 4, + "OBJECT": 5, + "ARRAY": 6 + } + } + } + }, + "AppSnapshot": { + "fields": { + "app": { + "type": "App", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agents": { + "rule": "repeated", + "type": "Agent", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tools": { + "rule": "repeated", + "type": "Tool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "examples": { + "rule": "repeated", + "type": "Example", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "guardrails": { + "rule": "repeated", + "type": "Guardrail", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolsets": { + "rule": "repeated", + "type": "Toolset", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AppVersion": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/AppVersion", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/versions/{version}", + "(google.api.resource).plural": "appVersions", + "(google.api.resource).singular": "appVersion" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "creator": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "snapshot": { + "type": "AppSnapshot", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Example": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Example", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/examples/{example}", + "(google.api.resource).plural": "examples", + "(google.api.resource).singular": "example" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "entryAgent": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "messages": { + "rule": "repeated", + "type": "Message", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "invalid": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 9 + } + } + }, + "Message": { + "fields": { + "role": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "chunks": { + "rule": "repeated", + "type": "Chunk", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Chunk": { + "oneofs": { + "data": { + "oneof": [ + "text", + "transcript", + "payload", + "image", + "toolCall", + "toolResponse", + "agentTransfer", + "updatedVariables", + "defaultVariables" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "transcript": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "image": { + "type": "Image", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolCall": { + "type": "ToolCall", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolResponse": { + "type": "ToolResponse", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agentTransfer": { + "type": "AgentTransfer", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updatedVariables": { + "type": "google.protobuf.Struct", + "id": 8 + }, + "defaultVariables": { + "type": "google.protobuf.Struct", + "id": 10 + } + } + }, + "Blob": { + "fields": { + "mimeType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "data": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Image": { + "fields": { + "mimeType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "data": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ToolCall": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "args": { + "type": "google.protobuf.Struct", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ToolResponse": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "response": { + "type": "google.protobuf.Struct", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AgentTransfer": { + "fields": { + "targetAgent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ToolsetTool": { + "fields": { + "toolset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" + } + }, + "toolId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Guardrail": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Guardrail", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}", + "(google.api.resource).plural": "guardrails", + "(google.api.resource).singular": "guardrail" + }, + "oneofs": { + "guardrailType": { + "oneof": [ + "contentFilter", + "llmPromptSecurity", + "llmPolicy", + "modelSafety", + "codeCallback" + ] + } + }, + "fields": { + "contentFilter": { + "type": "ContentFilter", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "llmPromptSecurity": { + "type": "LlmPromptSecurity", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "llmPolicy": { + "type": "LlmPolicy", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modelSafety": { + "type": "ModelSafety", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "codeCallback": { + "type": "CodeCallback", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enabled": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "action": { + "type": "TriggerAction", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 11 + } + }, + "nested": { + "ContentFilter": { + "fields": { + "bannedContents": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bannedContentsInUserInput": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bannedContentsInAgentResponse": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "matchType": { + "type": "MatchType", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "disregardDiacritics": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "MatchType": { + "values": { + "MATCH_TYPE_UNSPECIFIED": 0, + "SIMPLE_STRING_MATCH": 1, + "WORD_BOUNDARY_STRING_MATCH": 2, + "REGEXP_MATCH": 3 + } + } + } + }, + "LlmPromptSecurity": { + "oneofs": { + "securityConfig": { + "oneof": [ + "defaultSettings", + "customPolicy" + ] + } + }, + "fields": { + "defaultSettings": { + "type": "DefaultSecuritySettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "customPolicy": { + "type": "LlmPolicy", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "failOpen": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "DefaultSecuritySettings": { + "fields": { + "defaultPromptTemplate": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "LlmPolicy": { + "fields": { + "maxConversationMessages": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modelSettings": { + "type": "ModelSettings", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prompt": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "policyScope": { + "type": "PolicyScope", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "failOpen": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowShortUtterance": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PolicyScope": { + "values": { + "POLICY_SCOPE_UNSPECIFIED": 0, + "USER_QUERY": 1, + "AGENT_RESPONSE": 2, + "USER_QUERY_AND_AGENT_RESPONSE": 3 + } + } + } + }, + "ModelSafety": { + "fields": { + "safetySettings": { + "rule": "repeated", + "type": "SafetySetting", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "SafetySetting": { + "fields": { + "category": { + "type": "HarmCategory", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "threshold": { + "type": "HarmBlockThreshold", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "HarmCategory": { + "values": { + "HARM_CATEGORY_UNSPECIFIED": 0, + "HARM_CATEGORY_HATE_SPEECH": 1, + "HARM_CATEGORY_DANGEROUS_CONTENT": 2, + "HARM_CATEGORY_HARASSMENT": 3, + "HARM_CATEGORY_SEXUALLY_EXPLICIT": 4 + } + }, + "HarmBlockThreshold": { + "values": { + "HARM_BLOCK_THRESHOLD_UNSPECIFIED": 0, + "BLOCK_LOW_AND_ABOVE": 1, + "BLOCK_MEDIUM_AND_ABOVE": 2, + "BLOCK_ONLY_HIGH": 3, + "BLOCK_NONE": 4, + "OFF": 5 + } + } + } + }, + "CodeCallback": { + "fields": { + "beforeAgentCallback": { + "type": "Callback", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "afterAgentCallback": { + "type": "Callback", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "beforeModelCallback": { + "type": "Callback", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "afterModelCallback": { + "type": "Callback", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "Tool": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Tool", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/tools/{tool}", + "(google.api.resource).plural": "tools", + "(google.api.resource).singular": "tool" + }, + "oneofs": { + "toolType": { + "oneof": [ + "clientFunction", + "openApiTool", + "googleSearchTool", + "connectorTool", + "dataStoreTool", + "pythonFunction", + "mcpTool", + "fileSearchTool", + "systemTool", + "widgetTool" + ] + } + }, + "fields": { + "clientFunction": { + "type": "ClientFunction", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "openApiTool": { + "type": "OpenApiTool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "googleSearchTool": { + "type": "GoogleSearchTool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "connectorTool": { + "type": "ConnectorTool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataStoreTool": { + "type": "DataStoreTool", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pythonFunction": { + "type": "PythonFunction", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mcpTool": { + "type": "McpTool", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileSearchTool": { + "type": "FileSearchTool", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "systemTool": { + "type": "SystemTool", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "widgetTool": { + "type": "WidgetTool", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "executionType": { + "type": "ExecutionType", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 14 + }, + "generatedSummary": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolFakeConfig": { + "type": "ToolFakeConfig", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ClientFunction": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parameters": { + "type": "Schema", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "response": { + "type": "Schema", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Action": { + "oneofs": { + "actionSpec": { + "oneof": [ + "connectionActionId", + "entityOperation" + ] + } + }, + "fields": { + "connectionActionId": { + "type": "string", + "id": 4 + }, + "entityOperation": { + "type": "EntityOperation", + "id": 5 + }, + "inputFields": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputFields": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "EntityOperation": { + "fields": { + "entityId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "operation": { + "type": "OperationType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "OperationType": { + "values": { + "OPERATION_TYPE_UNSPECIFIED": 0, + "LIST": 1, + "GET": 2, + "CREATE": 3, + "UPDATE": 4, + "DELETE": 5 + } + } + } + } + } + }, + "ConnectorTool": { + "fields": { + "connection": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "action": { + "type": "Action", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authConfig": { + "type": "EndUserAuthConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ApiKeyConfig": { + "fields": { + "keyName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiKeySecretVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "requestLocation": { + "type": "RequestLocation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "RequestLocation": { + "values": { + "REQUEST_LOCATION_UNSPECIFIED": 0, + "HEADER": 1, + "QUERY_STRING": 2 + } + } + } + }, + "OAuthConfig": { + "fields": { + "oauthGrantType": { + "type": "OauthGrantType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientSecretVersion": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "tokenEndpoint": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "OauthGrantType": { + "values": { + "OAUTH_GRANT_TYPE_UNSPECIFIED": 0, + "CLIENT_CREDENTIAL": 1 + } + } + } + }, + "ServiceAgentIdTokenAuthConfig": { + "fields": {} + }, + "ServiceAccountAuthConfig": { + "fields": { + "serviceAccount": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BearerTokenConfig": { + "fields": { + "token": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "EndUserAuthConfig": { + "oneofs": { + "authConfig": { + "oneof": [ + "oauth2AuthCodeConfig", + "oauth2JwtBearerConfig" + ] + } + }, + "fields": { + "oauth2AuthCodeConfig": { + "type": "Oauth2AuthCodeConfig", + "id": 2 + }, + "oauth2JwtBearerConfig": { + "type": "Oauth2JwtBearerConfig", + "id": 3 + } + }, + "nested": { + "Oauth2AuthCodeConfig": { + "fields": { + "oauthToken": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Oauth2JwtBearerConfig": { + "fields": { + "issuer": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "subject": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientKey": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ApiAuthentication": { + "oneofs": { + "authConfig": { + "oneof": [ + "apiKeyConfig", + "oauthConfig", + "serviceAgentIdTokenAuthConfig", + "serviceAccountAuthConfig", + "bearerTokenConfig" + ] + } + }, + "fields": { + "apiKeyConfig": { + "type": "ApiKeyConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "oauthConfig": { + "type": "OAuthConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAgentIdTokenAuthConfig": { + "type": "ServiceAgentIdTokenAuthConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccountAuthConfig": { + "type": "ServiceAccountAuthConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bearerTokenConfig": { + "type": "BearerTokenConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DataStoreTool": { + "oneofs": { + "searchSource": { + "oneof": [ + "dataStoreSource", + "engineSource" + ] + } + }, + "fields": { + "dataStoreSource": { + "type": "DataStoreSource", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "engineSource": { + "type": "EngineSource", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "boostSpecs": { + "rule": "repeated", + "type": "BoostSpecs", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modalityConfigs": { + "rule": "repeated", + "type": "ModalityConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filterParameterBehavior": { + "type": "FilterParameterBehavior", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RewriterConfig": { + "fields": { + "modelSettings": { + "type": "ModelSettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "prompt": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disabled": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SummarizationConfig": { + "fields": { + "modelSettings": { + "type": "ModelSettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prompt": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disabled": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GroundingConfig": { + "fields": { + "groundingLevel": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disabled": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DataStoreSource": { + "fields": { + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataStore": { + "type": "DataStore", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EngineSource": { + "fields": { + "engine": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dataStoreSources": { + "rule": "repeated", + "type": "DataStoreSource", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BoostSpecs": { + "fields": { + "dataStores": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "spec": { + "rule": "repeated", + "type": "BoostSpec", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BoostSpec": { + "fields": { + "conditionBoostSpecs": { + "rule": "repeated", + "type": "ConditionBoostSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "ConditionBoostSpec": { + "fields": { + "condition": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "boost": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "boostControlSpec": { + "type": "BoostControlSpec", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "BoostControlSpec": { + "fields": { + "fieldName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributeType": { + "type": "AttributeType", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "interpolationType": { + "type": "InterpolationType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "controlPoints": { + "rule": "repeated", + "type": "ControlPoint", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ControlPoint": { + "fields": { + "attributeValue": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "boostAmount": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AttributeType": { + "values": { + "ATTRIBUTE_TYPE_UNSPECIFIED": 0, + "NUMERICAL": 1, + "FRESHNESS": 2 + } + }, + "InterpolationType": { + "values": { + "INTERPOLATION_TYPE_UNSPECIFIED": 0, + "LINEAR": 1 + } + } + } + } + } + } + } + }, + "ModalityConfig": { + "fields": { + "modalityType": { + "type": "ModalityType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rewriterConfig": { + "type": "RewriterConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "summarizationConfig": { + "type": "SummarizationConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "groundingConfig": { + "type": "GroundingConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ModalityType": { + "values": { + "MODALITY_TYPE_UNSPECIFIED": 0, + "TEXT": 1, + "AUDIO": 2 + } + } + } + }, + "FilterParameterBehavior": { + "values": { + "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED": 0, + "ALWAYS_INCLUDE": 2, + "NEVER_INCLUDE": 3 + } + } + } + }, + "DataStore": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "type": { + "type": "DataStoreType", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "documentProcessingMode": { + "type": "DocumentProcessingMode", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "connectorConfig": { + "type": "ConnectorConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ConnectorConfig": { + "fields": { + "collection": { + "type": "string", + "id": 1 + }, + "collectionDisplayName": { + "type": "string", + "id": 2 + }, + "dataSource": { + "type": "string", + "id": 3 + } + } + }, + "DataStoreType": { + "values": { + "DATA_STORE_TYPE_UNSPECIFIED": 0, + "PUBLIC_WEB": 1, + "UNSTRUCTURED": 2, + "FAQ": 3, + "CONNECTOR": 4 + } + }, + "DocumentProcessingMode": { + "values": { + "DOCUMENT_PROCESSING_MODE_UNSPECIFIED": 0, + "DOCUMENTS": 1, + "CHUNKS": 2 + } + } + } + }, + "CodeBlock": { + "fields": { + "pythonCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ToolFakeConfig": { + "oneofs": { + "toolResponse": { + "oneof": [ + "codeBlock" + ] + } + }, + "fields": { + "codeBlock": { + "type": "CodeBlock", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableFakeMode": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FileSearchTool": { + "fields": { + "corpusType": { + "type": "CorpusType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileCorpus": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CorpusType": { + "values": { + "CORPUS_TYPE_UNSPECIFIED": 0, + "USER_OWNED": 1, + "FULLY_MANAGED": 2 + } + } + } + }, + "GoogleSearchTool": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "contextUrls": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "preferredDomains": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "excludeDomains": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "promptConfig": { + "type": "PromptConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PromptConfig": { + "fields": { + "textPrompt": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "voicePrompt": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "McpTool": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inputSchema": { + "type": "Schema", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputSchema": { + "type": "Schema", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serverAddress": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiAuthentication": { + "type": "ApiAuthentication", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsConfig": { + "type": "TlsConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceDirectoryConfig": { + "type": "ServiceDirectoryConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OpenApiTool": { + "fields": { + "openApiSchema": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "name": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "apiAuthentication": { + "type": "ApiAuthentication", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsConfig": { + "type": "TlsConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceDirectoryConfig": { + "type": "ServiceDirectoryConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreUnknownFields": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "url": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PythonFunction": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pythonCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SystemTool": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "WidgetTool": { + "oneofs": { + "input": { + "oneof": [ + "parameters" + ] + } + }, + "fields": { + "parameters": { + "type": "Schema", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "widgetType": { + "type": "WidgetType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "WidgetType": { + "values": { + "WIDGET_TYPE_UNSPECIFIED": 0, + "CUSTOM": 1, + "PRODUCT_CAROUSEL": 2, + "PRODUCT_DETAILS": 3, + "QUICK_ACTIONS": 4, + "PRODUCT_COMPARISON": 5, + "ADVANCED_PRODUCT_DETAILS": 6, + "SHORT_FORM": 7, + "OVERALL_SATISFACTION": 8, + "ORDER_SUMMARY": 9, + "APPOINTMENT_DETAILS": 10 + } + } + } + }, + "Toolset": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Toolset", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}", + "(google.api.resource).plural": "toolsets", + "(google.api.resource).singular": "toolset" + }, + "oneofs": { + "toolsetType": { + "oneof": [ + "mcpToolset", + "openApiToolset", + "connectorToolset" + ] + } + }, + "fields": { + "mcpToolset": { + "type": "McpToolset", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "openApiToolset": { + "type": "OpenApiToolset", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "connectorToolset": { + "type": "ConnectorToolset", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 5 + }, + "executionType": { + "type": "ExecutionType", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolFakeConfig": { + "type": "ToolFakeConfig", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ConnectorToolset": { + "fields": { + "connection": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authConfig": { + "type": "EndUserAuthConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "connectorActions": { + "rule": "repeated", + "type": "Action", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "McpToolset": { + "fields": { + "serverAddress": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiAuthentication": { + "type": "ApiAuthentication", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceDirectoryConfig": { + "type": "ServiceDirectoryConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsConfig": { + "type": "TlsConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OpenApiToolset": { + "fields": { + "openApiSchema": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiAuthentication": { + "type": "ApiAuthentication", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsConfig": { + "type": "TlsConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceDirectoryConfig": { + "type": "ServiceDirectoryConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreUnknownFields": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "url": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Changelog": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Changelog", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}", + "(google.api.resource).plural": "changelogs", + "(google.api.resource).singular": "changelog" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "author": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resource": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourceType": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "action": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "originalResource": { + "type": "google.protobuf.Struct", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "newResource": { + "type": "google.protobuf.Struct", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dependentResources": { + "rule": "repeated", + "type": "google.protobuf.Struct", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sequenceNumber": { + "type": "int64", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Conversation": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Conversation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}", + "(google.api.resource).plural": "conversations", + "(google.api.resource).singular": "conversation" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "turns": { + "rule": "repeated", + "type": "Turn", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "turnCount": { + "type": "int32", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "channelType": { + "type": "ChannelType", + "id": 8, + "options": { + "deprecated": true + } + }, + "source": { + "type": "Source", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "inputTypes": { + "rule": "repeated", + "type": "InputType", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "entryAgent": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "deployment": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" + } + }, + "appVersion": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + }, + "languageCode": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "messages": { + "rule": "repeated", + "type": "Message", + "id": 2, + "options": { + "deprecated": true + } + } + }, + "nested": { + "Turn": { + "fields": { + "messages": { + "rule": "repeated", + "type": "Message", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rootSpan": { + "type": "Span", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ChannelType": { + "values": { + "CHANNEL_TYPE_UNSPECIFIED": 0, + "TEXT": 1, + "AUDIO": 2, + "MULTIMODAL": 3 + } + }, + "Source": { + "values": { + "SOURCE_UNSPECIFIED": 0, + "LIVE": 1, + "SIMULATOR": 2, + "EVAL": 3 + } + }, + "InputType": { + "values": { + "INPUT_TYPE_UNSPECIFIED": 0, + "INPUT_TYPE_TEXT": 1, + "INPUT_TYPE_AUDIO": 2, + "INPUT_TYPE_IMAGE": 3, + "INPUT_TYPE_BLOB": 4, + "INPUT_TYPE_TOOL_RESPONSE": 5, + "INPUT_TYPE_VARIABLES": 6 + } + } + } + }, + "Deployment": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Deployment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}", + "(google.api.resource).plural": "deployments", + "(google.api.resource).singular": "deployment" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "appVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + }, + "channelProfile": { + "type": "ChannelProfile", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "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" + } + }, + "etag": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Omnichannel": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Omnichannel", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/omnichannels/{omnichannel}", + "(google.api.resource).plural": "omnichannels", + "(google.api.resource).singular": "omnichannel" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "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" + } + }, + "etag": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "integrationConfig": { + "type": "OmnichannelIntegrationConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OmnichannelIntegrationConfig": { + "fields": { + "channelConfigs": { + "keyType": "string", + "type": "ChannelConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subscriberConfigs": { + "keyType": "string", + "type": "SubscriberConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "routingConfigs": { + "keyType": "string", + "type": "RoutingConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ChannelConfig": { + "oneofs": { + "channelConfig": { + "oneof": [ + "whatsappConfig" + ] + } + }, + "fields": { + "whatsappConfig": { + "type": "WhatsappConfig", + "id": 1 + } + } + }, + "WhatsappConfig": { + "fields": { + "phoneNumberId": { + "type": "string", + "id": 1 + }, + "phoneNumber": { + "type": "string", + "id": 2 + }, + "whatsappBusinessAccountId": { + "type": "string", + "id": 3 + }, + "webhookVerifyToken": { + "type": "string", + "id": 4 + }, + "whatsappBusinessToken": { + "type": "string", + "id": 5 + }, + "metaBusinessPortfolioId": { + "type": "string", + "id": 6 + } + } + }, + "SubscriberConfig": { + "oneofs": { + "subscriberConfig": { + "oneof": [ + "cesAppConfig" + ] + } + }, + "fields": { + "cesAppConfig": { + "type": "CesAppConfig", + "id": 1 + } + } + }, + "CesAppConfig": { + "fields": { + "app": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + } + } + }, + "RoutingConfig": { + "fields": { + "subscriberKey": { + "type": "string", + "id": 1 + } + } + } + } + }, + "OmnichannelOperationMetadata": { + "fields": { + "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" + } + }, + "statusMessage": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GoogleSearchSuggestions": { + "fields": { + "htmls": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "webSearchQueries": { + "rule": "repeated", + "type": "WebSearchQuery", + "id": 2 + } + } + }, + "WebSearchQuery": { + "fields": { + "query": { + "type": "string", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + } + } + }, + "SessionService": { + "options": { + "(google.api.default_host)": "ces.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "RunSession": { + "requestType": "RunSessionRequest", + "responseType": "RunSessionResponse", + "options": { + "(google.api.http).post": "/v1/{config.session=projects/*/locations/*/apps/*/sessions/*}:runSession", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{config.session=projects/*/locations/*/apps/*/sessions/*}:runSession", + "body": "*" + } + } + ] + }, + "BidiRunSession": { + "requestType": "BidiSessionClientMessage", + "requestStream": true, + "responseType": "BidiSessionServerMessage", + "responseStream": true + } + } + }, + "AudioEncoding": { + "values": { + "AUDIO_ENCODING_UNSPECIFIED": 0, + "LINEAR16": 1, + "MULAW": 2, + "ALAW": 3 + } + }, + "InputAudioConfig": { + "fields": { + "audioEncoding": { + "type": "AudioEncoding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sampleRateHertz": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "noiseSuppressionLevel": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OutputAudioConfig": { + "fields": { + "audioEncoding": { + "type": "AudioEncoding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sampleRateHertz": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SessionConfig": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Session" + } + }, + "inputAudioConfig": { + "type": "InputAudioConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "historicalContexts": { + "rule": "repeated", + "type": "Message", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "entryAgent": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "deployment": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeZone": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "remoteDialogflowQueryParameters": { + "type": "RemoteDialogflowQueryParameters", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RemoteDialogflowQueryParameters": { + "fields": { + "webhookHeaders": { + "keyType": "string", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endUserMetadata": { + "type": "google.protobuf.Struct", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ToolCalls": { + "fields": { + "toolCalls": { + "rule": "repeated", + "type": "ToolCall", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ToolResponses": { + "fields": { + "toolResponses": { + "rule": "repeated", + "type": "ToolResponse", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Citations": { + "fields": { + "citedChunks": { + "rule": "repeated", + "type": "CitedChunk", + "id": 1 + } + }, + "nested": { + "CitedChunk": { + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "text": { + "type": "string", + "id": 3 + } + } + } + } + }, + "Event": { + "fields": { + "event": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SessionInput": { + "oneofs": { + "inputType": { + "oneof": [ + "text", + "dtmf", + "audio", + "toolResponses", + "image", + "blob", + "variables", + "event" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dtmf": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "audio": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolResponses": { + "type": "ToolResponses", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "image": { + "type": "Image", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "blob": { + "type": "Blob", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "variables": { + "type": "google.protobuf.Struct", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "event": { + "type": "Event", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "willContinue": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SessionOutput": { + "oneofs": { + "outputType": { + "oneof": [ + "text", + "audio", + "toolCalls", + "citations", + "googleSearchSuggestions", + "endSession", + "payload" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "audio": { + "type": "bytes", + "id": 2 + }, + "toolCalls": { + "type": "ToolCalls", + "id": 3 + }, + "citations": { + "type": "Citations", + "id": 8 + }, + "googleSearchSuggestions": { + "type": "GoogleSearchSuggestions", + "id": 10 + }, + "endSession": { + "type": "EndSession", + "id": 9 + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 11 + }, + "turnIndex": { + "type": "int32", + "id": 6 + }, + "turnCompleted": { + "type": "bool", + "id": 4 + }, + "diagnosticInfo": { + "type": "DiagnosticInfo", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "DiagnosticInfo": { + "fields": { + "messages": { + "rule": "repeated", + "type": "Message", + "id": 1 + }, + "rootSpan": { + "type": "Span", + "id": 3 + } + } + } + } + }, + "RecognitionResult": { + "fields": { + "transcript": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InterruptionSignal": { + "fields": { + "bargeIn": { + "type": "bool", + "id": 1 + } + } + }, + "EndSession": { + "fields": { + "metadata": { + "type": "google.protobuf.Struct", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GoAway": { + "fields": {} + }, + "RunSessionRequest": { + "fields": { + "config": { + "type": "SessionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inputs": { + "rule": "repeated", + "type": "SessionInput", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RunSessionResponse": { + "fields": { + "outputs": { + "rule": "repeated", + "type": "SessionOutput", + "id": 1 + } + } + }, + "BidiSessionClientMessage": { + "oneofs": { + "messageType": { + "oneof": [ + "config", + "realtimeInput" + ] + } + }, + "fields": { + "config": { + "type": "SessionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "realtimeInput": { + "type": "SessionInput", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BidiSessionServerMessage": { + "oneofs": { + "messageType": { + "oneof": [ + "sessionOutput", + "recognitionResult", + "interruptionSignal", + "endSession", + "goAway" + ] + } + }, + "fields": { + "sessionOutput": { + "type": "SessionOutput", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "recognitionResult": { + "type": "RecognitionResult", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "interruptionSignal": { + "type": "InterruptionSignal", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endSession": { + "type": "EndSession", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "goAway": { + "type": "GoAway", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ToolService": { + "options": { + "(google.api.default_host)": "ces.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ExecuteTool": { + "requestType": "ExecuteToolRequest", + "responseType": "ExecuteToolResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}:executeTool", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apps/*}:executeTool", + "body": "*" + } + } + ] + }, + "RetrieveToolSchema": { + "requestType": "RetrieveToolSchemaRequest", + "responseType": "RetrieveToolSchemaResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}:retrieveToolSchema", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apps/*}:retrieveToolSchema", + "body": "*" + } + } + ] + }, + "RetrieveTools": { + "requestType": "RetrieveToolsRequest", + "responseType": "RetrieveToolsResponse", + "options": { + "(google.api.http).post": "/v1/{toolset=projects/*/locations/*/apps/*/toolsets/*}:retrieveTools", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{toolset=projects/*/locations/*/apps/*/toolsets/*}:retrieveTools", + "body": "*" + } + } + ] + } + } + }, + "ExecuteToolRequest": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parent": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "args": { + "type": "google.protobuf.Struct", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExecuteToolResponse": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 3 + }, + "response": { + "type": "google.protobuf.Struct", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RetrieveToolSchemaRequest": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parent": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + } + } + }, + "RetrieveToolSchemaResponse": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 2 + }, + "inputSchema": { + "type": "Schema", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputSchema": { + "type": "Schema", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RetrieveToolsRequest": { + "fields": { + "toolset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" + } + }, + "toolIds": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RetrieveToolsResponse": { + "fields": { + "tools": { + "rule": "repeated", + "type": "Tool", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "WidgetService": { + "options": { + "(google.api.default_host)": "ces.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GenerateChatToken": { + "requestType": "GenerateChatTokenRequest", + "responseType": "GenerateChatTokenResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/apps/*/sessions/*}:generateChatToken", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/apps/*/sessions/*}:generateChatToken", + "body": "*" + } + } + ] + } + } + }, + "GenerateChatTokenRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Session" + } + }, + "deployment": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" + } + }, + "recaptchaToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GenerateChatTokenResponse": { + "fields": { + "chatToken": { + "type": "string", + "id": 1 + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + } + } + }, + "v1beta": { + "options": { + "go_package": "cloud.google.com/go/ces/apiv1beta/cespb;cespb", + "java_multiple_files": true, + "java_outer_classname": "WidgetServiceProto", + "java_package": "com.google.cloud.ces.v1beta", + "(google.api.resource_definition).type": "ces.googleapis.com/Session", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/apps/{app}/sessions/{session}" + }, + "nested": { + "Agent": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Agent", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/agents/{agent}", + "(google.api.resource).plural": "agents", + "(google.api.resource).singular": "agent" + }, + "oneofs": { + "agentType": { + "oneof": [ + "llmAgent", + "remoteDialogflowAgent" + ] + } + }, + "fields": { + "llmAgent": { + "type": "LlmAgent", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "remoteDialogflowAgent": { + "type": "RemoteDialogflowAgent", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modelSettings": { + "type": "ModelSettings", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instruction": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tools": { + "rule": "repeated", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "childAgents": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "beforeAgentCallbacks": { + "rule": "repeated", + "type": "Callback", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "afterAgentCallbacks": { + "rule": "repeated", + "type": "Callback", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "beforeModelCallbacks": { + "rule": "repeated", + "type": "Callback", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "afterModelCallbacks": { + "rule": "repeated", + "type": "Callback", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "beforeToolCallbacks": { + "rule": "repeated", + "type": "Callback", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "afterToolCallbacks": { + "rule": "repeated", + "type": "Callback", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "guardrails": { + "rule": "repeated", + "type": "string", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" + } + }, + "etag": { + "type": "string", + "id": 24 + }, + "toolsets": { + "rule": "repeated", + "type": "AgentToolset", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "generatedSummary": { + "type": "string", + "id": 29, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "transferRules": { + "rule": "repeated", + "type": "TransferRule", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "LlmAgent": { + "fields": {} + }, + "RemoteDialogflowAgent": { + "fields": { + "agent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/DialogflowAgent" + } + }, + "flowId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "environmentId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inputVariableMapping": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputVariableMapping": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "respectResponseInterruptionSettings": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AgentToolset": { + "fields": { + "toolset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" + } + }, + "toolIds": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ExpressionCondition": { + "fields": { + "expression": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PythonCodeCondition": { + "fields": { + "pythonCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TransferRule": { + "oneofs": { + "ruleType": { + "oneof": [ + "deterministicTransfer", + "disablePlannerTransfer" + ] + } + }, + "fields": { + "deterministicTransfer": { + "type": "DeterministicTransfer", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disablePlannerTransfer": { + "type": "DisablePlannerTransfer", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "childAgent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "direction": { + "type": "Direction", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "DeterministicTransfer": { + "oneofs": { + "conditionType": { + "oneof": [ + "expressionCondition", + "pythonCodeCondition" + ] + } + }, + "fields": { + "expressionCondition": { + "type": "ExpressionCondition", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pythonCodeCondition": { + "type": "PythonCodeCondition", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DisablePlannerTransfer": { + "fields": { + "expressionCondition": { + "type": "ExpressionCondition", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Direction": { + "values": { + "DIRECTION_UNSPECIFIED": 0, + "PARENT_TO_CHILD": 1, + "CHILD_TO_PARENT": 2 + } + } + } + }, + "ExecutionType": { + "values": { + "EXECUTION_TYPE_UNSPECIFIED": 0, + "SYNCHRONOUS": 1, + "ASYNCHRONOUS": 2 + } + }, + "Callback": { + "oneofs": { + "callback": { + "oneof": [ + "pythonCode" + ] + } + }, + "fields": { + "pythonCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disabled": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "proactiveExecutionEnabled": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ModelSettings": { + "oneofs": { + "_temperature": { + "oneof": [ + "temperature" + ] + } + }, + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "temperature": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "TriggerAction": { + "oneofs": { + "action": { + "oneof": [ + "respondImmediately", + "transferAgent", + "generativeAnswer" + ] + } + }, + "fields": { + "respondImmediately": { + "type": "RespondImmediately", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "transferAgent": { + "type": "TransferAgent", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "generativeAnswer": { + "type": "GenerativeAnswer", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Response": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "disabled": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RespondImmediately": { + "fields": { + "responses": { + "rule": "repeated", + "type": "Response", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GenerativeAnswer": { + "fields": { + "prompt": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TransferAgent": { + "fields": { + "agent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + } + } + } + } + }, + "TlsConfig": { + "fields": { + "caCerts": { + "rule": "repeated", + "type": "CaCert", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "CaCert": { + "fields": { + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cert": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ServiceDirectoryConfig": { + "fields": { + "service": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "servicedirectory.googleapis.com/Service" + } + } + } + }, + "ChannelProfile": { + "fields": { + "profileId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "channelType": { + "type": "ChannelType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "personaProperty": { + "type": "PersonaProperty", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disableDtmf": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disableBargeInControl": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "webWidgetConfig": { + "type": "WebWidgetConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "noiseSuppressionLevel": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PersonaProperty": { + "fields": { + "persona": { + "type": "Persona", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Persona": { + "values": { + "UNKNOWN": 0, + "CONCISE": 1, + "CHATTY": 2 + } + } + } + }, + "WebWidgetConfig": { + "fields": { + "modality": { + "type": "Modality", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "theme": { + "type": "Theme", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "webWidgetTitle": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "securitySettings": { + "type": "SecuritySettings", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SecuritySettings": { + "fields": { + "enablePublicAccess": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableOriginCheck": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowedOrigins": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableRecaptcha": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Modality": { + "values": { + "MODALITY_UNSPECIFIED": 0, + "CHAT_AND_VOICE": 1, + "VOICE_ONLY": 2, + "CHAT_ONLY": 3 + } + }, + "Theme": { + "values": { + "THEME_UNSPECIFIED": 0, + "LIGHT": 1, + "DARK": 2 + } + } + } + }, + "ChannelType": { + "values": { + "UNKNOWN": 0, + "WEB_UI": 2, + "API": 3, + "TWILIO": 4, + "GOOGLE_TELEPHONY_PLATFORM": 5, + "CONTACT_CENTER_AS_A_SERVICE": 6, + "FIVE9": 7, + "CONTACT_CENTER_INTEGRATION": 8 + } + } + } + }, + "Span": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "attributes": { + "type": "google.protobuf.Struct", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "childSpans": { + "rule": "repeated", + "type": "Span", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "AgentService": { + "options": { + "(google.api.default_host)": "ces.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListApps": { + "requestType": "ListAppsRequest", + "responseType": "ListAppsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*}/apps", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*}/apps" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetApp": { + "requestType": "GetAppRequest", + "responseType": "App", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateApp": { + "requestType": "CreateAppRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/apps", + "(google.api.http).body": "app", + "(google.api.method_signature)": "parent,app", + "(google.longrunning.operation_info).response_type": "App", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*}/apps", + "body": "app" + } + }, + { + "(google.api.method_signature)": "parent,app,app_id" + }, + { + "(google.api.method_signature)": "parent,app" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "App", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateApp": { + "requestType": "UpdateAppRequest", + "responseType": "App", + "options": { + "(google.api.http).patch": "/v1beta/{app.name=projects/*/locations/*/apps/*}", + "(google.api.http).body": "app", + "(google.api.method_signature)": "app,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{app.name=projects/*/locations/*/apps/*}", + "body": "app" + } + }, + { + "(google.api.method_signature)": "app,update_mask" + } + ] + }, + "DeleteApp": { + "requestType": "DeleteAppRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*}", + "(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/*/apps/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExportApp": { + "requestType": "ExportAppRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/apps/*}:exportApp", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "ExportAppResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{name=projects/*/locations/*/apps/*}:exportApp", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportAppResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ImportApp": { + "requestType": "ImportAppRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/apps:importApp", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,display_name,app_id", + "(google.longrunning.operation_info).response_type": "ImportAppResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*}/apps:importApp", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,display_name,app_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportAppResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListAgents": { + "requestType": "ListAgentsRequest", + "responseType": "ListAgentsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/agents", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/agents" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetAgent": { + "requestType": "GetAgentRequest", + "responseType": "Agent", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/agents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/agents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateAgent": { + "requestType": "CreateAgentRequest", + "responseType": "Agent", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/agents", + "(google.api.http).body": "agent", + "(google.api.method_signature)": "parent,agent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/agents", + "body": "agent" + } + }, + { + "(google.api.method_signature)": "parent,agent,agent_id" + }, + { + "(google.api.method_signature)": "parent,agent" + } + ] + }, + "UpdateAgent": { + "requestType": "UpdateAgentRequest", + "responseType": "Agent", + "options": { + "(google.api.http).patch": "/v1beta/{agent.name=projects/*/locations/*/apps/*/agents/*}", + "(google.api.http).body": "agent", + "(google.api.method_signature)": "agent,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{agent.name=projects/*/locations/*/apps/*/agents/*}", + "body": "agent" + } + }, + { + "(google.api.method_signature)": "agent,update_mask" + } + ] + }, + "DeleteAgent": { + "requestType": "DeleteAgentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/agents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/agents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListExamples": { + "requestType": "ListExamplesRequest", + "responseType": "ListExamplesResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/examples", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/examples" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetExample": { + "requestType": "GetExampleRequest", + "responseType": "Example", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/examples/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/examples/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateExample": { + "requestType": "CreateExampleRequest", + "responseType": "Example", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/examples", + "(google.api.http).body": "example", + "(google.api.method_signature)": "parent,example" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/examples", + "body": "example" + } + }, + { + "(google.api.method_signature)": "parent,example,example_id" + }, + { + "(google.api.method_signature)": "parent,example" + } + ] + }, + "UpdateExample": { + "requestType": "UpdateExampleRequest", + "responseType": "Example", + "options": { + "(google.api.http).patch": "/v1beta/{example.name=projects/*/locations/*/apps/*/examples/*}", + "(google.api.http).body": "example", + "(google.api.method_signature)": "example,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{example.name=projects/*/locations/*/apps/*/examples/*}", + "body": "example" + } + }, + { + "(google.api.method_signature)": "example,update_mask" + } + ] + }, + "DeleteExample": { + "requestType": "DeleteExampleRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/examples/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/examples/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTools": { + "requestType": "ListToolsRequest", + "responseType": "ListToolsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/tools", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/tools" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTool": { + "requestType": "GetToolRequest", + "responseType": "Tool", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/tools/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/tools/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListConversations": { + "requestType": "ListConversationsRequest", + "responseType": "ListConversationsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/conversations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/conversations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConversation": { + "requestType": "GetConversationRequest", + "responseType": "Conversation", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/conversations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/conversations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteConversation": { + "requestType": "DeleteConversationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/conversations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/conversations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "BatchDeleteConversations": { + "requestType": "BatchDeleteConversationsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/conversations:batchDelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "BatchDeleteConversationsResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/conversations:batchDelete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchDeleteConversationsResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateTool": { + "requestType": "CreateToolRequest", + "responseType": "Tool", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/tools", + "(google.api.http).body": "tool", + "(google.api.method_signature)": "parent,tool" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/tools", + "body": "tool" + } + }, + { + "(google.api.method_signature)": "parent,tool,tool_id" + }, + { + "(google.api.method_signature)": "parent,tool" + } + ] + }, + "UpdateTool": { + "requestType": "UpdateToolRequest", + "responseType": "Tool", + "options": { + "(google.api.http).patch": "/v1beta/{tool.name=projects/*/locations/*/apps/*/tools/*}", + "(google.api.http).body": "tool", + "(google.api.method_signature)": "tool,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{tool.name=projects/*/locations/*/apps/*/tools/*}", + "body": "tool" + } + }, + { + "(google.api.method_signature)": "tool,update_mask" + } + ] + }, + "DeleteTool": { + "requestType": "DeleteToolRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/tools/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/tools/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListGuardrails": { + "requestType": "ListGuardrailsRequest", + "responseType": "ListGuardrailsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/guardrails", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/guardrails" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetGuardrail": { + "requestType": "GetGuardrailRequest", + "responseType": "Guardrail", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/guardrails/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/guardrails/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateGuardrail": { + "requestType": "CreateGuardrailRequest", + "responseType": "Guardrail", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/guardrails", + "(google.api.http).body": "guardrail", + "(google.api.method_signature)": "parent,guardrail" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/guardrails", + "body": "guardrail" + } + }, + { + "(google.api.method_signature)": "parent,guardrail,guardrail_id" + }, + { + "(google.api.method_signature)": "parent,guardrail" + } + ] + }, + "UpdateGuardrail": { + "requestType": "UpdateGuardrailRequest", + "responseType": "Guardrail", + "options": { + "(google.api.http).patch": "/v1beta/{guardrail.name=projects/*/locations/*/apps/*/guardrails/*}", + "(google.api.http).body": "guardrail", + "(google.api.method_signature)": "guardrail,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{guardrail.name=projects/*/locations/*/apps/*/guardrails/*}", + "body": "guardrail" + } + }, + { + "(google.api.method_signature)": "guardrail,update_mask" + } + ] + }, + "DeleteGuardrail": { + "requestType": "DeleteGuardrailRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/guardrails/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/guardrails/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDeployments": { + "requestType": "ListDeploymentsRequest", + "responseType": "ListDeploymentsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/deployments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/deployments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDeployment": { + "requestType": "GetDeploymentRequest", + "responseType": "Deployment", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/deployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/deployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateDeployment": { + "requestType": "CreateDeploymentRequest", + "responseType": "Deployment", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/deployments", + "(google.api.http).body": "deployment", + "(google.api.method_signature)": "parent,deployment" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/deployments", + "body": "deployment" + } + }, + { + "(google.api.method_signature)": "parent,deployment,deployment_id" + }, + { + "(google.api.method_signature)": "parent,deployment" + } + ] + }, + "UpdateDeployment": { + "requestType": "UpdateDeploymentRequest", + "responseType": "Deployment", + "options": { + "(google.api.http).patch": "/v1beta/{deployment.name=projects/*/locations/*/apps/*/deployments/*}", + "(google.api.http).body": "deployment", + "(google.api.method_signature)": "deployment,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{deployment.name=projects/*/locations/*/apps/*/deployments/*}", + "body": "deployment" + } + }, + { + "(google.api.method_signature)": "deployment,update_mask" + } + ] + }, + "DeleteDeployment": { + "requestType": "DeleteDeploymentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/deployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/deployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListToolsets": { + "requestType": "ListToolsetsRequest", + "responseType": "ListToolsetsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/toolsets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/toolsets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetToolset": { + "requestType": "GetToolsetRequest", + "responseType": "Toolset", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/toolsets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/toolsets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateToolset": { + "requestType": "CreateToolsetRequest", + "responseType": "Toolset", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/toolsets", + "(google.api.http).body": "toolset", + "(google.api.method_signature)": "parent,toolset" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/toolsets", + "body": "toolset" + } + }, + { + "(google.api.method_signature)": "parent,toolset,toolset_id" + }, + { + "(google.api.method_signature)": "parent,toolset" + } + ] + }, + "UpdateToolset": { + "requestType": "UpdateToolsetRequest", + "responseType": "Toolset", + "options": { + "(google.api.http).patch": "/v1beta/{toolset.name=projects/*/locations/*/apps/*/toolsets/*}", + "(google.api.http).body": "toolset", + "(google.api.method_signature)": "toolset,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{toolset.name=projects/*/locations/*/apps/*/toolsets/*}", + "body": "toolset" + } + }, + { + "(google.api.method_signature)": "toolset,update_mask" + } + ] + }, + "DeleteToolset": { + "requestType": "DeleteToolsetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/toolsets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/toolsets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListAppVersions": { + "requestType": "ListAppVersionsRequest", + "responseType": "ListAppVersionsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/versions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/versions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetAppVersion": { + "requestType": "GetAppVersionRequest", + "responseType": "AppVersion", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateAppVersion": { + "requestType": "CreateAppVersionRequest", + "responseType": "AppVersion", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/versions", + "(google.api.http).body": "app_version", + "(google.api.method_signature)": "parent,app_version" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/versions", + "body": "app_version" + } + }, + { + "(google.api.method_signature)": "parent,app_version,app_version_id" + }, + { + "(google.api.method_signature)": "parent,app_version" + } + ] + }, + "DeleteAppVersion": { + "requestType": "DeleteAppVersionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "RestoreAppVersion": { + "requestType": "RestoreAppVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}:restore", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "RestoreAppVersionResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}:restore", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RestoreAppVersionResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListChangelogs": { + "requestType": "ListChangelogsRequest", + "responseType": "ListChangelogsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/changelogs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/changelogs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetChangelog": { + "requestType": "GetChangelogRequest", + "responseType": "Changelog", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/changelogs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/changelogs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "ListAppsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/App" + } + }, + "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" + } + } + } + }, + "ListAppsResponse": { + "fields": { + "apps": { + "rule": "repeated", + "type": "App", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "UNORDERED_LIST" + } + } + } + }, + "GetAppRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + } + } + }, + "CreateAppRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/App" + } + }, + "appId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "app": { + "type": "App", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateAppRequest": { + "fields": { + "app": { + "type": "App", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteAppRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExportAppRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "exportFormat": { + "type": "ExportFormat", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gcsUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ExportFormat": { + "values": { + "EXPORT_FORMAT_UNSPECIFIED": 0, + "JSON": 1, + "YAML": 2 + } + } + } + }, + "ExportAppResponse": { + "oneofs": { + "app": { + "oneof": [ + "appContent", + "appUri" + ] + } + }, + "fields": { + "appContent": { + "type": "bytes", + "id": 1 + }, + "appUri": { + "type": "string", + "id": 2 + } + } + }, + "ImportAppRequest": { + "oneofs": { + "app": { + "oneof": [ + "gcsUri", + "appContent" + ] + } + }, + "fields": { + "gcsUri": { + "type": "string", + "id": 4 + }, + "appContent": { + "type": "bytes", + "id": 5 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/App" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "appId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "importOptions": { + "type": "ImportOptions", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreAppLock": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ImportOptions": { + "fields": { + "conflictResolutionStrategy": { + "type": "ConflictResolutionStrategy", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ConflictResolutionStrategy": { + "values": { + "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED": 0, + "REPLACE": 1, + "OVERWRITE": 2 + } + } + } + } + } + }, + "ImportAppResponse": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "warnings": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "ListAgentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Agent" + } + }, + "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" + } + } + } + }, + "ListAgentsResponse": { + "fields": { + "agents": { + "rule": "repeated", + "type": "Agent", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetAgentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + } + } + }, + "CreateAgentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Agent" + } + }, + "agentId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agent": { + "type": "Agent", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateAgentRequest": { + "fields": { + "agent": { + "type": "Agent", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteAgentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OperationMetadata": { + "fields": { + "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" + } + }, + "statusMessage": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ListExamplesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Example" + } + }, + "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" + } + } + } + }, + "ListExamplesResponse": { + "fields": { + "examples": { + "rule": "repeated", + "type": "Example", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetExampleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Example" + } + } + } + }, + "CreateExampleRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Example" + } + }, + "exampleId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "example": { + "type": "Example", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateExampleRequest": { + "fields": { + "example": { + "type": "Example", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteExampleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Example" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListToolsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Tool" + } + }, + "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" + } + } + } + }, + "ListToolsResponse": { + "fields": { + "tools": { + "rule": "repeated", + "type": "Tool", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetToolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + } + } + }, + "CreateToolRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Tool" + } + }, + "toolId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tool": { + "type": "Tool", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateToolRequest": { + "fields": { + "tool": { + "type": "Tool", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteToolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListConversationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Conversation" + } + }, + "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" + } + }, + "source": { + "type": "Conversation.Source", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sources": { + "rule": "repeated", + "type": "Conversation.Source", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListConversationsResponse": { + "fields": { + "conversations": { + "rule": "repeated", + "type": "Conversation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetConversationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" + } + }, + "source": { + "type": "Conversation.Source", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteConversationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" + } + }, + "source": { + "type": "Conversation.Source", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchDeleteConversationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Conversation" + } + }, + "conversations": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" + } + } + } + }, + "BatchDeleteConversationsResponse": { + "fields": { + "deletedConversations": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "failedConversations": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "errorMessages": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListGuardrailsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Guardrail" + } + }, + "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" + } + } + } + }, + "ListGuardrailsResponse": { + "fields": { + "guardrails": { + "rule": "repeated", + "type": "Guardrail", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetGuardrailRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" + } + } + } + }, + "CreateGuardrailRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Guardrail" + } + }, + "guardrailId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "guardrail": { + "type": "Guardrail", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateGuardrailRequest": { + "fields": { + "guardrail": { + "type": "Guardrail", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteGuardrailRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDeploymentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Deployment" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDeploymentsResponse": { + "fields": { + "deployments": { + "rule": "repeated", + "type": "Deployment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" + } + } + } + }, + "CreateDeploymentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Deployment" + } + }, + "deploymentId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deployment": { + "type": "Deployment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateDeploymentRequest": { + "fields": { + "deployment": { + "type": "Deployment", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListToolsetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Toolset" + } + }, + "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" + } + } + } + }, + "ListToolsetsResponse": { + "fields": { + "toolsets": { + "rule": "repeated", + "type": "Toolset", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetToolsetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" + } + } + } + }, + "CreateToolsetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Toolset" + } + }, + "toolsetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolset": { + "type": "Toolset", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateToolsetRequest": { + "fields": { + "toolset": { + "type": "Toolset", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteToolsetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListAppVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/AppVersion" + } + }, + "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" + } + } + } + }, + "ListAppVersionsResponse": { + "fields": { + "appVersions": { + "rule": "repeated", + "type": "AppVersion", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetAppVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + } + } + }, + "DeleteAppVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateAppVersionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/AppVersion" + } + }, + "appVersionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "appVersion": { + "type": "AppVersion", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RestoreAppVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + } + } + }, + "RestoreAppVersionResponse": { + "fields": {} + }, + "GenerateAppResourceResponse": { + "oneofs": { + "generatedResource": { + "oneof": [ + "agent", + "toolset", + "appSnapshot", + "tools", + "evaluations", + "appResources" + ] + } + }, + "fields": { + "agent": { + "type": "Agent", + "id": 1 + }, + "toolset": { + "type": "Toolset", + "id": 3 + }, + "appSnapshot": { + "type": "AppSnapshot", + "id": 4 + }, + "tools": { + "type": "Tools", + "id": 5 + }, + "evaluations": { + "type": "Evaluations", + "id": 6 + }, + "appResources": { + "type": "AppResources", + "id": 7 + }, + "generateResultInfo": { + "type": "GenerateResultInfo", + "id": 2 + } + }, + "nested": { + "Evaluations": { + "fields": { + "evaluations": { + "rule": "repeated", + "type": "Evaluation", + "id": 1 + } + } + }, + "Tools": { + "fields": { + "tools": { + "rule": "repeated", + "type": "Tool", + "id": 1 + } + } + }, + "AppResources": { + "fields": { + "appSnapshot": { + "type": "AppSnapshot", + "id": 1 + }, + "evaluations": { + "rule": "repeated", + "type": "Evaluation", + "id": 2 + } + } + }, + "GenerateResultInfo": { + "fields": { + "explanation": { + "type": "string", + "id": 1 + } + } + } + } + }, + "ListChangelogsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Changelog" + } + }, + "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" + } + } + } + }, + "ListChangelogsResponse": { + "fields": { + "changelogs": { + "rule": "repeated", + "type": "Changelog", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetChangelogRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Changelog" + } + } + } + }, + "App": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/App", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}", + "(google.api.resource).plural": "apps", + "(google.api.resource).singular": "app" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pinned": { + "type": "bool", + "id": 31, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rootAgent": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "languageSettings": { + "type": "LanguageSettings", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeZoneSettings": { + "type": "TimeZoneSettings", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "audioProcessingConfig": { + "type": "AudioProcessingConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "loggingSettings": { + "type": "LoggingSettings", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "errorHandlingSettings": { + "type": "ErrorHandlingSettings", + "id": 34, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modelSettings": { + "type": "ModelSettings", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolExecutionMode": { + "type": "ToolExecutionMode", + "id": 32, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationMetricsThresholds": { + "type": "EvaluationMetricsThresholds", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "variableDeclarations": { + "rule": "repeated", + "type": "VariableDeclaration", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "predefinedVariableDeclarations": { + "rule": "repeated", + "type": "VariableDeclaration", + "id": 28, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "globalInstruction": { + "type": "string", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "guardrails": { + "rule": "repeated", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" + } + }, + "dataStoreSettings": { + "type": "DataStoreSettings", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultChannelProfile": { + "type": "ChannelProfile", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deploymentCount": { + "type": "int32", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clientCertificateSettings": { + "type": "ClientCertificateSettings", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "locked": { + "type": "bool", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationPersonas": { + "rule": "repeated", + "type": "EvaluationPersona", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationSettings": { + "type": "EvaluationSettings", + "id": 33, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "VariableDeclaration": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "schema": { + "type": "Schema", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ToolExecutionMode": { + "values": { + "TOOL_EXECUTION_MODE_UNSPECIFIED": 0, + "PARALLEL": 1, + "SEQUENTIAL": 2 + } + } + } + }, + "TimeZoneSettings": { + "fields": { + "timeZone": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "LanguageSettings": { + "fields": { + "defaultLanguageCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "supportedLanguageCodes": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableMultilingualSupport": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fallbackAction": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AudioProcessingConfig": { + "fields": { + "synthesizeSpeechConfigs": { + "keyType": "string", + "type": "SynthesizeSpeechConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bargeInConfig": { + "type": "BargeInConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inactivityTimeout": { + "type": "google.protobuf.Duration", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ambientSoundConfig": { + "type": "AmbientSoundConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AmbientSoundConfig": { + "oneofs": { + "source": { + "oneof": [ + "prebuiltAmbientNoise", + "gcsUri", + "prebuiltAmbientSound" + ] + } + }, + "fields": { + "prebuiltAmbientNoise": { + "type": "PrebuiltAmbientNoise", + "id": 1, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gcsUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prebuiltAmbientSound": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "volumeGainDb": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PrebuiltAmbientNoise": { + "values": { + "PREBUILT_AMBIENT_NOISE_UNSPECIFIED": 0, + "RETAIL_STORE": 1, + "CONVENTION_HALL": 2, + "OUTDOOR": 3 + } + } + } + }, + "BargeInConfig": { + "fields": { + "disableBargeIn": { + "type": "bool", + "id": 1, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bargeInAwareness": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SynthesizeSpeechConfig": { + "fields": { + "voice": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "speakingRate": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "MetricAnalysisSettings": { + "fields": { + "llmMetricsOptedOut": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "LoggingSettings": { + "fields": { + "redactionConfig": { + "type": "RedactionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "audioRecordingConfig": { + "type": "AudioRecordingConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bigqueryExportSettings": { + "type": "BigQueryExportSettings", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cloudLoggingSettings": { + "type": "CloudLoggingSettings", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "conversationLoggingSettings": { + "type": "ConversationLoggingSettings", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationAudioRecordingConfig": { + "type": "AudioRecordingConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "metricAnalysisSettings": { + "type": "MetricAnalysisSettings", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ErrorHandlingSettings": { + "fields": { + "errorHandlingStrategy": { + "type": "ErrorHandlingStrategy", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ErrorHandlingStrategy": { + "values": { + "ERROR_HANDLING_STRATEGY_UNSPECIFIED": 0, + "NONE": 1, + "FALLBACK_RESPONSE": 2 + } + } + } + }, + "EvaluationMetricsThresholds": { + "fields": { + "goldenEvaluationMetricsThresholds": { + "type": "GoldenEvaluationMetricsThresholds", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "hallucinationMetricBehavior": { + "type": "HallucinationMetricBehavior", + "id": 3, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "goldenHallucinationMetricBehavior": { + "type": "HallucinationMetricBehavior", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scenarioHallucinationMetricBehavior": { + "type": "HallucinationMetricBehavior", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "GoldenEvaluationMetricsThresholds": { + "fields": { + "turnLevelMetricsThresholds": { + "type": "TurnLevelMetricsThresholds", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expectationLevelMetricsThresholds": { + "type": "ExpectationLevelMetricsThresholds", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolMatchingSettings": { + "type": "ToolMatchingSettings", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "TurnLevelMetricsThresholds": { + "oneofs": { + "_semanticSimilaritySuccessThreshold": { + "oneof": [ + "semanticSimilaritySuccessThreshold" + ] + }, + "_overallToolInvocationCorrectnessThreshold": { + "oneof": [ + "overallToolInvocationCorrectnessThreshold" + ] + } + }, + "fields": { + "semanticSimilaritySuccessThreshold": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "overallToolInvocationCorrectnessThreshold": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "semanticSimilarityChannel": { + "type": "SemanticSimilarityChannel", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SemanticSimilarityChannel": { + "values": { + "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED": 0, + "TEXT": 1, + "AUDIO": 2 + } + } + } + }, + "ExpectationLevelMetricsThresholds": { + "oneofs": { + "_toolInvocationParameterCorrectnessThreshold": { + "oneof": [ + "toolInvocationParameterCorrectnessThreshold" + ] + } + }, + "fields": { + "toolInvocationParameterCorrectnessThreshold": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + } + } + }, + "ToolMatchingSettings": { + "fields": { + "extraToolCallBehavior": { + "type": "ExtraToolCallBehavior", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ExtraToolCallBehavior": { + "values": { + "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED": 0, + "FAIL": 1, + "ALLOW": 2 + } + } + } + }, + "HallucinationMetricBehavior": { + "values": { + "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": 0, + "DISABLED": 1, + "ENABLED": 2 + } + } + } + }, + "EvaluationSettings": { + "fields": { + "scenarioConversationInitiator": { + "type": "ScenarioConversationInitiator", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "goldenRunMethod": { + "type": "GoldenRunMethod", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "goldenEvaluationToolCallBehaviour": { + "type": "EvaluationToolCallBehaviour", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scenarioEvaluationToolCallBehaviour": { + "type": "EvaluationToolCallBehaviour", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ScenarioConversationInitiator": { + "values": { + "SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED": 0, + "USER": 1, + "AGENT": 2 + } + } + } + }, + "ClientCertificateSettings": { + "fields": { + "tlsCertificate": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "privateKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "passphrase": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ConversationLoggingSettings": { + "fields": { + "disableConversationLogging": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CloudLoggingSettings": { + "fields": { + "enableCloudLogging": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AudioRecordingConfig": { + "fields": { + "gcsBucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gcsPathPrefix": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RedactionConfig": { + "fields": { + "enableRedaction": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inspectTemplate": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dlp.googleapis.com/InspectTemplate" + } + }, + "deidentifyTemplate": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dlp.googleapis.com/DeidentifyTemplate" + } + } + } + }, + "DataStoreSettings": { + "fields": { + "engines": { + "rule": "repeated", + "type": "Engine", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Engine": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/Engine" + } + }, + "type": { + "type": "Type", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "ENGINE_TYPE_SEARCH": 1, + "ENGINE_TYPE_CHAT": 2 + } + } + } + } + } + }, + "EvaluationPersona": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "personality": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "speechConfig": { + "type": "SpeechConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SpeechConfig": { + "fields": { + "speakingRate": { + "type": "double", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "environment": { + "type": "BackgroundEnvironment", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "voiceId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "BackgroundEnvironment": { + "values": { + "BACKGROUND_ENVIRONMENT_UNSPECIFIED": 0, + "CALL_CENTER": 3, + "TRAFFIC": 4, + "KIDS_NOISE": 5, + "CAFE": 6 + } + } + } + } + } + }, + "BigQueryExportSettings": { + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "project": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataset": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EvaluationToolCallBehaviour": { + "values": { + "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED": 0, + "REAL": 1, + "FAKE": 2 + } + }, + "CodeBlock": { + "fields": { + "pythonCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ToolFakeConfig": { + "oneofs": { + "toolResponse": { + "oneof": [ + "codeBlock" + ] + } + }, + "fields": { + "codeBlock": { + "type": "CodeBlock", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableFakeMode": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GoldenRunMethod": { + "values": { + "GOLDEN_RUN_METHOD_UNSPECIFIED": 0, + "STABLE": 1, + "NAIVE": 2 + } + }, + "Schema": { + "oneofs": { + "_minimum": { + "oneof": [ + "minimum" + ] + }, + "_maximum": { + "oneof": [ + "maximum" + ] + } + }, + "fields": { + "type": { + "type": "Type", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "properties": { + "keyType": "string", + "type": "Schema", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "required": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "items": { + "type": "Schema", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nullable": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "uniqueItems": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prefixItems": { + "rule": "repeated", + "type": "Schema", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "additionalProperties": { + "type": "Schema", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "anyOf": { + "rule": "repeated", + "type": "Schema", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enum": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "default": { + "type": "google.protobuf.Value", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ref": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defs": { + "keyType": "string", + "type": "Schema", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "title": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "minItems": { + "type": "int64", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxItems": { + "type": "int64", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "minimum": { + "type": "double", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "maximum": { + "type": "double", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "STRING": 1, + "INTEGER": 2, + "NUMBER": 3, + "BOOLEAN": 4, + "OBJECT": 5, + "ARRAY": 6 + } + } + } + }, + "AppSnapshot": { + "fields": { + "app": { + "type": "App", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agents": { + "rule": "repeated", + "type": "Agent", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tools": { + "rule": "repeated", + "type": "Tool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "examples": { + "rule": "repeated", + "type": "Example", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "guardrails": { + "rule": "repeated", + "type": "Guardrail", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolsets": { + "rule": "repeated", + "type": "Toolset", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AppVersion": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/AppVersion", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/versions/{version}", + "(google.api.resource).plural": "appVersions", + "(google.api.resource).singular": "appVersion" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "creator": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "snapshot": { + "type": "AppSnapshot", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Example": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Example", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/examples/{example}", + "(google.api.resource).plural": "examples", + "(google.api.resource).singular": "example" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "entryAgent": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "messages": { + "rule": "repeated", + "type": "Message", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "invalid": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 9 + } + } + }, + "Message": { + "fields": { + "role": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "chunks": { + "rule": "repeated", + "type": "Chunk", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Chunk": { + "oneofs": { + "data": { + "oneof": [ + "text", + "transcript", + "blob", + "payload", + "image", + "toolCall", + "toolResponse", + "agentTransfer", + "updatedVariables", + "defaultVariables" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "transcript": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "blob": { + "type": "Blob", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "image": { + "type": "Image", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolCall": { + "type": "ToolCall", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolResponse": { + "type": "ToolResponse", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agentTransfer": { + "type": "AgentTransfer", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updatedVariables": { + "type": "google.protobuf.Struct", + "id": 8 + }, + "defaultVariables": { + "type": "google.protobuf.Struct", + "id": 10 + } + } + }, + "Blob": { + "fields": { + "mimeType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "data": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Image": { + "fields": { + "mimeType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "data": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ToolCall": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "args": { + "type": "google.protobuf.Struct", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ToolResponse": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "response": { + "type": "google.protobuf.Struct", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AgentTransfer": { + "fields": { + "targetAgent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ToolsetTool": { + "fields": { + "toolset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" + } + }, + "toolId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Guardrail": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Guardrail", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}", + "(google.api.resource).plural": "guardrails", + "(google.api.resource).singular": "guardrail" + }, + "oneofs": { + "guardrailType": { + "oneof": [ + "contentFilter", + "llmPromptSecurity", + "llmPolicy", + "modelSafety", + "codeCallback" + ] + } + }, + "fields": { + "contentFilter": { + "type": "ContentFilter", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "llmPromptSecurity": { + "type": "LlmPromptSecurity", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "llmPolicy": { + "type": "LlmPolicy", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modelSafety": { + "type": "ModelSafety", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "codeCallback": { + "type": "CodeCallback", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enabled": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "action": { + "type": "TriggerAction", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 11 + } + }, + "nested": { + "ContentFilter": { + "fields": { + "bannedContents": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bannedContentsInUserInput": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bannedContentsInAgentResponse": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "matchType": { + "type": "MatchType", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "disregardDiacritics": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "MatchType": { + "values": { + "MATCH_TYPE_UNSPECIFIED": 0, + "SIMPLE_STRING_MATCH": 1, + "WORD_BOUNDARY_STRING_MATCH": 2, + "REGEXP_MATCH": 3 + } + } + } + }, + "LlmPromptSecurity": { + "oneofs": { + "securityConfig": { + "oneof": [ + "defaultSettings", + "customPolicy" + ] + } + }, + "fields": { + "defaultSettings": { + "type": "DefaultSecuritySettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "customPolicy": { + "type": "LlmPolicy", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "failOpen": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "DefaultSecuritySettings": { + "fields": { + "defaultPromptTemplate": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "LlmPolicy": { + "fields": { + "maxConversationMessages": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modelSettings": { + "type": "ModelSettings", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prompt": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "policyScope": { + "type": "PolicyScope", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "failOpen": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowShortUtterance": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PolicyScope": { + "values": { + "POLICY_SCOPE_UNSPECIFIED": 0, + "USER_QUERY": 1, + "AGENT_RESPONSE": 2, + "USER_QUERY_AND_AGENT_RESPONSE": 3 + } + } + } + }, + "ModelSafety": { + "fields": { + "safetySettings": { + "rule": "repeated", + "type": "SafetySetting", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "SafetySetting": { + "fields": { + "category": { + "type": "HarmCategory", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "threshold": { + "type": "HarmBlockThreshold", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "HarmCategory": { + "values": { + "HARM_CATEGORY_UNSPECIFIED": 0, + "HARM_CATEGORY_HATE_SPEECH": 1, + "HARM_CATEGORY_DANGEROUS_CONTENT": 2, + "HARM_CATEGORY_HARASSMENT": 3, + "HARM_CATEGORY_SEXUALLY_EXPLICIT": 4 + } + }, + "HarmBlockThreshold": { + "values": { + "HARM_BLOCK_THRESHOLD_UNSPECIFIED": 0, + "BLOCK_LOW_AND_ABOVE": 1, + "BLOCK_MEDIUM_AND_ABOVE": 2, + "BLOCK_ONLY_HIGH": 3, + "BLOCK_NONE": 4, + "OFF": 5 + } + } + } + }, + "CodeCallback": { + "fields": { + "beforeAgentCallback": { + "type": "Callback", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "afterAgentCallback": { + "type": "Callback", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "beforeModelCallback": { + "type": "Callback", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "afterModelCallback": { + "type": "Callback", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "Tool": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Tool", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/tools/{tool}", + "(google.api.resource).plural": "tools", + "(google.api.resource).singular": "tool" + }, + "oneofs": { + "toolType": { + "oneof": [ + "clientFunction", + "openApiTool", + "googleSearchTool", + "connectorTool", + "dataStoreTool", + "pythonFunction", + "mcpTool", + "fileSearchTool", + "systemTool", + "widgetTool" + ] + } + }, + "fields": { + "clientFunction": { + "type": "ClientFunction", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "openApiTool": { + "type": "OpenApiTool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "googleSearchTool": { + "type": "GoogleSearchTool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "connectorTool": { + "type": "ConnectorTool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataStoreTool": { + "type": "DataStoreTool", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pythonFunction": { + "type": "PythonFunction", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mcpTool": { + "type": "McpTool", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileSearchTool": { + "type": "FileSearchTool", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "systemTool": { + "type": "SystemTool", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "widgetTool": { + "type": "WidgetTool", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "executionType": { + "type": "ExecutionType", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 14 + }, + "generatedSummary": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolFakeConfig": { + "type": "ToolFakeConfig", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ClientFunction": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parameters": { + "type": "Schema", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "response": { + "type": "Schema", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Action": { + "oneofs": { + "actionSpec": { + "oneof": [ + "connectionActionId", + "entityOperation" + ] + } + }, + "fields": { + "connectionActionId": { + "type": "string", + "id": 4 + }, + "entityOperation": { + "type": "EntityOperation", + "id": 5 + }, + "inputFields": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputFields": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "EntityOperation": { + "fields": { + "entityId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "operation": { + "type": "OperationType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "OperationType": { + "values": { + "OPERATION_TYPE_UNSPECIFIED": 0, + "LIST": 1, + "GET": 2, + "CREATE": 3, + "UPDATE": 4, + "DELETE": 5 + } + } + } + } + } + }, + "ConnectorTool": { + "fields": { + "connection": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "action": { + "type": "Action", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authConfig": { + "type": "EndUserAuthConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ApiKeyConfig": { + "fields": { + "keyName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiKeySecretVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "requestLocation": { + "type": "RequestLocation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "RequestLocation": { + "values": { + "REQUEST_LOCATION_UNSPECIFIED": 0, + "HEADER": 1, + "QUERY_STRING": 2 + } + } + } + }, + "OAuthConfig": { + "fields": { + "oauthGrantType": { + "type": "OauthGrantType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientSecretVersion": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "tokenEndpoint": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "OauthGrantType": { + "values": { + "OAUTH_GRANT_TYPE_UNSPECIFIED": 0, + "CLIENT_CREDENTIAL": 1 + } + } + } + }, + "ServiceAgentIdTokenAuthConfig": { + "fields": {} + }, + "ServiceAccountAuthConfig": { + "fields": { + "serviceAccount": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BearerTokenConfig": { + "fields": { + "token": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "EndUserAuthConfig": { + "oneofs": { + "authConfig": { + "oneof": [ + "oauth2AuthCodeConfig", + "oauth2JwtBearerConfig" + ] + } + }, + "fields": { + "oauth2AuthCodeConfig": { + "type": "Oauth2AuthCodeConfig", + "id": 2 + }, + "oauth2JwtBearerConfig": { + "type": "Oauth2JwtBearerConfig", + "id": 3 + } + }, + "nested": { + "Oauth2AuthCodeConfig": { + "fields": { + "oauthToken": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Oauth2JwtBearerConfig": { + "fields": { + "issuer": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "subject": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientKey": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ApiAuthentication": { + "oneofs": { + "authConfig": { + "oneof": [ + "apiKeyConfig", + "oauthConfig", + "serviceAgentIdTokenAuthConfig", + "serviceAccountAuthConfig", + "bearerTokenConfig" + ] + } + }, + "fields": { + "apiKeyConfig": { + "type": "ApiKeyConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "oauthConfig": { + "type": "OAuthConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAgentIdTokenAuthConfig": { + "type": "ServiceAgentIdTokenAuthConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccountAuthConfig": { + "type": "ServiceAccountAuthConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bearerTokenConfig": { + "type": "BearerTokenConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DataStoreTool": { + "oneofs": { + "searchSource": { + "oneof": [ + "dataStoreSource", + "engineSource" + ] + } + }, + "fields": { + "dataStoreSource": { + "type": "DataStoreSource", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "engineSource": { + "type": "EngineSource", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "boostSpecs": { + "rule": "repeated", + "type": "BoostSpecs", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modalityConfigs": { + "rule": "repeated", + "type": "ModalityConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filterParameterBehavior": { + "type": "FilterParameterBehavior", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RewriterConfig": { + "fields": { + "modelSettings": { + "type": "ModelSettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "prompt": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disabled": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SummarizationConfig": { + "fields": { + "modelSettings": { + "type": "ModelSettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prompt": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disabled": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GroundingConfig": { + "fields": { + "groundingLevel": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disabled": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DataStoreSource": { + "fields": { + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataStore": { + "type": "DataStore", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EngineSource": { + "fields": { + "engine": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dataStoreSources": { + "rule": "repeated", + "type": "DataStoreSource", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BoostSpecs": { + "fields": { + "dataStores": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "spec": { + "rule": "repeated", + "type": "BoostSpec", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BoostSpec": { + "fields": { + "conditionBoostSpecs": { + "rule": "repeated", + "type": "ConditionBoostSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "ConditionBoostSpec": { + "fields": { + "condition": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "boost": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "boostControlSpec": { + "type": "BoostControlSpec", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "BoostControlSpec": { + "fields": { + "fieldName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributeType": { + "type": "AttributeType", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "interpolationType": { + "type": "InterpolationType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "controlPoints": { + "rule": "repeated", + "type": "ControlPoint", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ControlPoint": { + "fields": { + "attributeValue": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "boostAmount": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AttributeType": { + "values": { + "ATTRIBUTE_TYPE_UNSPECIFIED": 0, + "NUMERICAL": 1, + "FRESHNESS": 2 + } + }, + "InterpolationType": { + "values": { + "INTERPOLATION_TYPE_UNSPECIFIED": 0, + "LINEAR": 1 + } + } + } + } + } + } + } + }, + "ModalityConfig": { + "fields": { + "modalityType": { + "type": "ModalityType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rewriterConfig": { + "type": "RewriterConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "summarizationConfig": { + "type": "SummarizationConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "groundingConfig": { + "type": "GroundingConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ModalityType": { + "values": { + "MODALITY_TYPE_UNSPECIFIED": 0, + "TEXT": 1, + "AUDIO": 2 + } + } + } + }, + "FilterParameterBehavior": { + "values": { + "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED": 0, + "ALWAYS_INCLUDE": 2, + "NEVER_INCLUDE": 3 + } + } + } + }, + "DataStore": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "type": { + "type": "DataStoreType", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "documentProcessingMode": { + "type": "DocumentProcessingMode", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "connectorConfig": { + "type": "ConnectorConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ConnectorConfig": { + "fields": { + "collection": { + "type": "string", + "id": 1 + }, + "collectionDisplayName": { + "type": "string", + "id": 2 + }, + "dataSource": { + "type": "string", + "id": 3 + } + } + }, + "DataStoreType": { + "values": { + "DATA_STORE_TYPE_UNSPECIFIED": 0, + "PUBLIC_WEB": 1, + "UNSTRUCTURED": 2, + "FAQ": 3, + "CONNECTOR": 4 + } + }, + "DocumentProcessingMode": { + "values": { + "DOCUMENT_PROCESSING_MODE_UNSPECIFIED": 0, + "DOCUMENTS": 1, + "CHUNKS": 2 + } + } + } + }, + "FileSearchTool": { + "fields": { + "corpusType": { + "type": "CorpusType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileCorpus": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CorpusType": { + "values": { + "CORPUS_TYPE_UNSPECIFIED": 0, + "USER_OWNED": 1, + "FULLY_MANAGED": 2 + } + } + } + }, + "GoogleSearchTool": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "contextUrls": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "preferredDomains": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "excludeDomains": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "promptConfig": { + "type": "PromptConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PromptConfig": { + "fields": { + "textPrompt": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "voicePrompt": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "McpTool": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inputSchema": { + "type": "Schema", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputSchema": { + "type": "Schema", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serverAddress": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiAuthentication": { + "type": "ApiAuthentication", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsConfig": { + "type": "TlsConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceDirectoryConfig": { + "type": "ServiceDirectoryConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OpenApiTool": { + "fields": { + "openApiSchema": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "name": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "apiAuthentication": { + "type": "ApiAuthentication", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsConfig": { + "type": "TlsConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceDirectoryConfig": { + "type": "ServiceDirectoryConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreUnknownFields": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "url": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PythonFunction": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pythonCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SystemTool": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "WidgetTool": { + "oneofs": { + "input": { + "oneof": [ + "parameters" + ] + } + }, + "fields": { + "parameters": { + "type": "Schema", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "widgetType": { + "type": "WidgetType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "WidgetType": { + "values": { + "WIDGET_TYPE_UNSPECIFIED": 0, + "CUSTOM": 1, + "PRODUCT_CAROUSEL": 2, + "PRODUCT_DETAILS": 3, + "QUICK_ACTIONS": 4, + "PRODUCT_COMPARISON": 5, + "ADVANCED_PRODUCT_DETAILS": 6, + "SHORT_FORM": 7, + "OVERALL_SATISFACTION": 8, + "ORDER_SUMMARY": 9, + "APPOINTMENT_DETAILS": 10, + "APPOINTMENT_SCHEDULER": 11, + "CONTACT_FORM": 12 + } + } + } + }, + "Toolset": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Toolset", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}", + "(google.api.resource).plural": "toolsets", + "(google.api.resource).singular": "toolset" + }, + "oneofs": { + "toolsetType": { + "oneof": [ + "mcpToolset", + "openApiToolset", + "connectorToolset" + ] + } + }, + "fields": { + "mcpToolset": { + "type": "McpToolset", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "openApiToolset": { + "type": "OpenApiToolset", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "connectorToolset": { + "type": "ConnectorToolset", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 5 + }, + "executionType": { + "type": "ExecutionType", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolFakeConfig": { + "type": "ToolFakeConfig", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ConnectorToolset": { + "fields": { + "connection": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authConfig": { + "type": "EndUserAuthConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "connectorActions": { + "rule": "repeated", + "type": "Action", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "McpToolset": { + "fields": { + "serverAddress": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiAuthentication": { + "type": "ApiAuthentication", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceDirectoryConfig": { + "type": "ServiceDirectoryConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsConfig": { + "type": "TlsConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OpenApiToolset": { + "fields": { + "openApiSchema": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiAuthentication": { + "type": "ApiAuthentication", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsConfig": { + "type": "TlsConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceDirectoryConfig": { + "type": "ServiceDirectoryConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreUnknownFields": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "url": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Changelog": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Changelog", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}", + "(google.api.resource).plural": "changelogs", + "(google.api.resource).singular": "changelog" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "author": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resource": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourceType": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "action": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "originalResource": { + "type": "google.protobuf.Struct", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "newResource": { + "type": "google.protobuf.Struct", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dependentResources": { + "rule": "repeated", + "type": "google.protobuf.Struct", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sequenceNumber": { + "type": "int64", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Conversation": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Conversation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}", + "(google.api.resource).plural": "conversations", + "(google.api.resource).singular": "conversation" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "turns": { + "rule": "repeated", + "type": "Turn", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "turnCount": { + "type": "int32", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "channelType": { + "type": "ChannelType", + "id": 8, + "options": { + "deprecated": true + } + }, + "source": { + "type": "Source", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "inputTypes": { + "rule": "repeated", + "type": "InputType", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "entryAgent": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "deployment": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" + } + }, + "appVersion": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + }, + "languageCode": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "messages": { + "rule": "repeated", + "type": "Message", + "id": 2, + "options": { + "deprecated": true + } + } + }, + "nested": { + "Turn": { + "fields": { + "messages": { + "rule": "repeated", + "type": "Message", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rootSpan": { + "type": "Span", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ChannelType": { + "values": { + "CHANNEL_TYPE_UNSPECIFIED": 0, + "TEXT": 1, + "AUDIO": 2, + "MULTIMODAL": 3 + } + }, + "Source": { + "values": { + "SOURCE_UNSPECIFIED": 0, + "LIVE": 1, + "SIMULATOR": 2, + "EVAL": 3 + } + }, + "InputType": { + "values": { + "INPUT_TYPE_UNSPECIFIED": 0, + "INPUT_TYPE_TEXT": 1, + "INPUT_TYPE_AUDIO": 2, + "INPUT_TYPE_IMAGE": 3, + "INPUT_TYPE_BLOB": 4, + "INPUT_TYPE_TOOL_RESPONSE": 5, + "INPUT_TYPE_VARIABLES": 6 + } + } + } + }, + "Deployment": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Deployment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}", + "(google.api.resource).plural": "deployments", + "(google.api.resource).singular": "deployment" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "appVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + }, + "channelProfile": { + "type": "ChannelProfile", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "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" + } + }, + "etag": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "AggregatedMetrics": { + "fields": { + "metricsByAppVersion": { + "rule": "repeated", + "type": "MetricsByAppVersion", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ToolMetrics": { + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "passCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failCount": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "TurnLatencyMetrics": { + "fields": { + "averageLatency": { + "type": "google.protobuf.Duration", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ToolCallLatencyMetrics": { + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "averageLatency": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SemanticSimilarityMetrics": { + "fields": { + "score": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "HallucinationMetrics": { + "fields": { + "score": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "MetricsByAppVersion": { + "fields": { + "appVersionId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolMetrics": { + "rule": "repeated", + "type": "ToolMetrics", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "semanticSimilarityMetrics": { + "rule": "repeated", + "type": "SemanticSimilarityMetrics", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "hallucinationMetrics": { + "rule": "repeated", + "type": "HallucinationMetrics", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolCallLatencyMetrics": { + "rule": "repeated", + "type": "ToolCallLatencyMetrics", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "turnLatencyMetrics": { + "rule": "repeated", + "type": "TurnLatencyMetrics", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "passCount": { + "type": "int32", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failCount": { + "type": "int32", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "metricsByTurn": { + "rule": "repeated", + "type": "MetricsByTurn", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "MetricsByTurn": { + "fields": { + "turnIndex": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolMetrics": { + "rule": "repeated", + "type": "ToolMetrics", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "semanticSimilarityMetrics": { + "rule": "repeated", + "type": "SemanticSimilarityMetrics", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "hallucinationMetrics": { + "rule": "repeated", + "type": "HallucinationMetrics", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolCallLatencyMetrics": { + "rule": "repeated", + "type": "ToolCallLatencyMetrics", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "turnLatencyMetrics": { + "rule": "repeated", + "type": "TurnLatencyMetrics", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "Evaluation": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Evaluation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}", + "(google.api.resource).plural": "evaluations", + "(google.api.resource).singular": "evaluation" + }, + "oneofs": { + "inputs": { + "oneof": [ + "golden", + "scenario" + ] + } + }, + "fields": { + "golden": { + "type": "Golden", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scenario": { + "type": "Scenario", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationDatasets": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationDataset" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createdBy": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastUpdatedBy": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "evaluationRuns": { + "rule": "repeated", + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" + } + }, + "etag": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "aggregatedMetrics": { + "type": "AggregatedMetrics", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastCompletedResult": { + "type": "EvaluationResult", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "invalid": { + "type": "bool", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastTenResults": { + "rule": "repeated", + "type": "EvaluationResult", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "GoldenExpectation": { + "oneofs": { + "condition": { + "oneof": [ + "toolCall", + "toolResponse", + "agentResponse", + "agentTransfer", + "updatedVariables", + "mockToolResponse" + ] + } + }, + "fields": { + "toolCall": { + "type": "ToolCall", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolResponse": { + "type": "ToolResponse", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agentResponse": { + "type": "Message", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agentTransfer": { + "type": "AgentTransfer", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updatedVariables": { + "type": "google.protobuf.Struct", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mockToolResponse": { + "type": "ToolResponse", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "note": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Step": { + "oneofs": { + "step": { + "oneof": [ + "userInput", + "agentTransfer", + "expectation" + ] + } + }, + "fields": { + "userInput": { + "type": "SessionInput", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agentTransfer": { + "type": "AgentTransfer", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expectation": { + "type": "GoldenExpectation", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GoldenTurn": { + "fields": { + "steps": { + "rule": "repeated", + "type": "Step", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rootSpan": { + "type": "Span", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Golden": { + "fields": { + "turns": { + "rule": "repeated", + "type": "GoldenTurn", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "evaluationExpectations": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationExpectation" + } + } + } + }, + "ScenarioExpectation": { + "oneofs": { + "expectation": { + "oneof": [ + "toolExpectation", + "agentResponse" + ] + } + }, + "fields": { + "toolExpectation": { + "type": "ToolExpectation", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agentResponse": { + "type": "Message", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ToolExpectation": { + "fields": { + "expectedToolCall": { + "type": "ToolCall", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mockToolResponse": { + "type": "ToolResponse", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "Scenario": { + "fields": { + "task": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "userFacts": { + "rule": "repeated", + "type": "UserFact", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxTurns": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rubrics": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scenarioExpectations": { + "rule": "repeated", + "type": "ScenarioExpectation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "variableOverrides": { + "type": "google.protobuf.Struct", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "taskCompletionBehavior": { + "type": "TaskCompletionBehavior", + "id": 7, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "userGoalBehavior": { + "type": "UserGoalBehavior", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationExpectations": { + "rule": "repeated", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationExpectation" + } + } + }, + "nested": { + "UserFact": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "value": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TaskCompletionBehavior": { + "values": { + "TASK_COMPLETION_BEHAVIOR_UNSPECIFIED": 0, + "TASK_SATISFIED": 1, + "TASK_REJECTED": 2 + } + }, + "UserGoalBehavior": { + "values": { + "USER_GOAL_BEHAVIOR_UNSPECIFIED": 0, + "USER_GOAL_SATISFIED": 1, + "USER_GOAL_REJECTED": 2, + "USER_GOAL_IGNORED": 3 + } + } + } + } + } + }, + "EvaluationDataset": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/EvaluationDataset", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/evaluationDatasets/{evaluation_dataset}", + "(google.api.resource).plural": "evaluationDatasets", + "(google.api.resource).singular": "evaluationDataset" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "evaluations": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Evaluation" + } + }, + "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" + } + }, + "etag": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createdBy": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastUpdatedBy": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "aggregatedMetrics": { + "type": "AggregatedMetrics", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "EvaluationResult": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/EvaluationResult", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}/results/{evaluation_result}", + "(google.api.resource).plural": "evaluationResults", + "(google.api.resource).singular": "evaluationResult" + }, + "oneofs": { + "result": { + "oneof": [ + "goldenResult", + "scenarioResult" + ] + } + }, + "fields": { + "goldenResult": { + "type": "GoldenResult", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "scenarioResult": { + "type": "ScenarioResult", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "evaluationStatus": { + "type": "Outcome", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "evaluationRun": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" + } + }, + "persona": { + "type": "EvaluationPersona", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorInfo": { + "type": "EvaluationErrorInfo", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "error": { + "type": "google.rpc.Status", + "id": 14, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "initiatedBy": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "appVersion": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + }, + "appVersionDisplayName": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "changelog": { + "type": "string", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Changelog" + } + }, + "changelogCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "executionState": { + "type": "ExecutionState", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "evaluationMetricsThresholds": { + "type": "EvaluationMetricsThresholds", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "config": { + "type": "EvaluationConfig", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "goldenRunMethod": { + "type": "GoldenRunMethod", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "GoldenExpectationOutcome": { + "oneofs": { + "result": { + "oneof": [ + "observedToolCall", + "observedToolResponse", + "observedAgentResponse", + "observedAgentTransfer" + ] + } + }, + "fields": { + "observedToolCall": { + "type": "ToolCall", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "observedToolResponse": { + "type": "ToolResponse", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "observedAgentResponse": { + "type": "Message", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "observedAgentTransfer": { + "type": "AgentTransfer", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expectation": { + "type": "Evaluation.GoldenExpectation", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "outcome": { + "type": "Outcome", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "semanticSimilarityResult": { + "type": "SemanticSimilarityResult", + "id": 7, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolInvocationResult": { + "type": "ToolInvocationResult", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ToolInvocationResult": { + "oneofs": { + "_parameterCorrectnessScore": { + "oneof": [ + "parameterCorrectnessScore" + ] + } + }, + "fields": { + "parameterCorrectnessScore": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "outcome": { + "type": "Outcome", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "explanation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "EvaluationExpectationResult": { + "fields": { + "evaluationExpectation": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationExpectation" + } + }, + "prompt": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "outcome": { + "type": "Outcome", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "explanation": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GoldenResult": { + "fields": { + "turnReplayResults": { + "rule": "repeated", + "type": "TurnReplayResult", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "evaluationExpectationResults": { + "rule": "repeated", + "type": "EvaluationExpectationResult", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "TurnReplayResult": { + "oneofs": { + "_toolOrderedInvocationScore": { + "oneof": [ + "toolOrderedInvocationScore" + ] + } + }, + "fields": { + "conversation": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" + } + }, + "expectationOutcome": { + "rule": "repeated", + "type": "GoldenExpectationOutcome", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "hallucinationResult": { + "type": "HallucinationResult", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolInvocationScore": { + "type": "float", + "id": 4, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolOrderedInvocationScore": { + "type": "float", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "turnLatency": { + "type": "google.protobuf.Duration", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolCallLatencies": { + "rule": "repeated", + "type": "ToolCallLatency", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "semanticSimilarityResult": { + "type": "SemanticSimilarityResult", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "overallToolInvocationResult": { + "type": "OverallToolInvocationResult", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorInfo": { + "type": "EvaluationErrorInfo", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "spanLatencies": { + "rule": "repeated", + "type": "SpanLatency", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "ScenarioRubricOutcome": { + "oneofs": { + "_score": { + "oneof": [ + "score" + ] + } + }, + "fields": { + "rubric": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "score": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "scoreExplanation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ScenarioExpectationOutcome": { + "oneofs": { + "result": { + "oneof": [ + "observedToolCall", + "observedAgentResponse" + ] + } + }, + "fields": { + "observedToolCall": { + "type": "ObservedToolCall", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "observedAgentResponse": { + "type": "Message", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expectation": { + "type": "Evaluation.ScenarioExpectation", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "outcome": { + "type": "Outcome", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ObservedToolCall": { + "fields": { + "toolCall": { + "type": "ToolCall", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolResponse": { + "type": "ToolResponse", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "ScenarioResult": { + "oneofs": { + "_allExpectationsSatisfied": { + "oneof": [ + "allExpectationsSatisfied" + ] + }, + "_taskCompleted": { + "oneof": [ + "taskCompleted" + ] + } + }, + "fields": { + "conversation": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" + } + }, + "task": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "userFacts": { + "rule": "repeated", + "type": "Evaluation.Scenario.UserFact", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expectationOutcomes": { + "rule": "repeated", + "type": "ScenarioExpectationOutcome", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "rubricOutcomes": { + "rule": "repeated", + "type": "ScenarioRubricOutcome", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "hallucinationResult": { + "rule": "repeated", + "type": "HallucinationResult", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "taskCompletionResult": { + "type": "TaskCompletionResult", + "id": 5, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolCallLatencies": { + "rule": "repeated", + "type": "ToolCallLatency", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "userGoalSatisfactionResult": { + "type": "UserGoalSatisfactionResult", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "allExpectationsSatisfied": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "taskCompleted": { + "type": "bool", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "spanLatencies": { + "rule": "repeated", + "type": "SpanLatency", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "evaluationExpectationResults": { + "rule": "repeated", + "type": "EvaluationExpectationResult", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SpanLatency": { + "oneofs": { + "identifier": { + "oneof": [ + "resource", + "toolset", + "model", + "callback" + ] + } + }, + "fields": { + "resource": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolset": { + "type": "ToolsetTool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "model": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "callback": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "Type", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "executionLatency": { + "type": "google.protobuf.Duration", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "TOOL": 1, + "USER_CALLBACK": 2, + "GUARDRAIL": 3, + "LLM": 4 + } + } + } + }, + "ToolCallLatency": { + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "executionLatency": { + "type": "google.protobuf.Duration", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "HallucinationResult": { + "oneofs": { + "_score": { + "oneof": [ + "score" + ] + } + }, + "fields": { + "score": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "label": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "explanation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "UserGoalSatisfactionResult": { + "oneofs": { + "_score": { + "oneof": [ + "score" + ] + } + }, + "fields": { + "score": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "label": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "explanation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SemanticSimilarityResult": { + "oneofs": { + "_score": { + "oneof": [ + "score" + ] + } + }, + "fields": { + "score": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "label": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "explanation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "outcome": { + "type": "Outcome", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "OverallToolInvocationResult": { + "oneofs": { + "_toolInvocationScore": { + "oneof": [ + "toolInvocationScore" + ] + } + }, + "fields": { + "toolInvocationScore": { + "type": "float", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "outcome": { + "type": "Outcome", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "TaskCompletionResult": { + "oneofs": { + "_score": { + "oneof": [ + "score" + ] + } + }, + "fields": { + "score": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "label": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "explanation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Outcome": { + "values": { + "OUTCOME_UNSPECIFIED": 0, + "PASS": 1, + "FAIL": 2 + } + }, + "ExecutionState": { + "values": { + "EXECUTION_STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "COMPLETED": 2, + "ERROR": 3 + } + } + } + }, + "EvaluationRun": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/EvaluationRun", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/evaluationRuns/{evaluation_run}", + "(google.api.resource).plural": "evaluationRuns", + "(google.api.resource).singular": "evaluationRun" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationResults": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationResult" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "initiatedBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "appVersion": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + }, + "appVersionDisplayName": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "changelog": { + "type": "string", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Changelog" + } + }, + "changelogCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "evaluations": { + "rule": "repeated", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Evaluation" + } + }, + "evaluationDataset": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationDataset" + } + }, + "evaluationType": { + "type": "EvaluationType", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "EvaluationRunState", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "progress": { + "type": "Progress", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "config": { + "type": "EvaluationConfig", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "error": { + "type": "google.rpc.Status", + "id": 14, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorInfo": { + "type": "EvaluationErrorInfo", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "evaluationRunSummaries": { + "keyType": "string", + "type": "EvaluationRunSummary", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latencyReport": { + "type": "LatencyReport", + "id": 25, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "runCount": { + "type": "int32", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "personaRunConfigs": { + "rule": "repeated", + "type": "PersonaRunConfig", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "optimizationConfig": { + "type": "OptimizationConfig", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scheduledEvaluationRun": { + "type": "string", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/ScheduledEvaluationRun" + } + }, + "goldenRunMethod": { + "type": "GoldenRunMethod", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Progress": { + "fields": { + "totalCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failedCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorCount": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "completedCount": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "passedCount": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "EvaluationRunSummary": { + "fields": { + "passedCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failedCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorCount": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "EvaluationType": { + "values": { + "EVALUATION_TYPE_UNSPECIFIED": 0, + "GOLDEN": 1, + "SCENARIO": 2, + "MIXED": 3 + } + }, + "EvaluationRunState": { + "values": { + "EVALUATION_RUN_STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "COMPLETED": 2, + "ERROR": 3 + } + } + } + }, + "LatencyReport": { + "fields": { + "toolLatencies": { + "rule": "repeated", + "type": "ToolLatency", + "id": 1, + "options": { + "(google.api.field_behavior)": "UNORDERED_LIST" + } + }, + "callbackLatencies": { + "rule": "repeated", + "type": "CallbackLatency", + "id": 2, + "options": { + "(google.api.field_behavior)": "UNORDERED_LIST" + } + }, + "guardrailLatencies": { + "rule": "repeated", + "type": "GuardrailLatency", + "id": 3, + "options": { + "(google.api.field_behavior)": "UNORDERED_LIST" + } + }, + "llmCallLatencies": { + "rule": "repeated", + "type": "LlmCallLatency", + "id": 4, + "options": { + "(google.api.field_behavior)": "UNORDERED_LIST" + } + }, + "sessionCount": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "LatencyMetrics": { + "fields": { + "p50Latency": { + "type": "google.protobuf.Duration", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "p90Latency": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "p99Latency": { + "type": "google.protobuf.Duration", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "callCount": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ToolLatency": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolDisplayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latencyMetrics": { + "type": "LatencyMetrics", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CallbackLatency": { + "fields": { + "stage": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latencyMetrics": { + "type": "LatencyMetrics", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GuardrailLatency": { + "fields": { + "guardrail": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" + } + }, + "guardrailDisplayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latencyMetrics": { + "type": "LatencyMetrics", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "LlmCallLatency": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latencyMetrics": { + "type": "LatencyMetrics", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "EvaluationExpectation": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/EvaluationExpectation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/evaluationExpectations/{evaluation_expectation}", + "(google.api.resource).plural": "evaluationExpectations", + "(google.api.resource).singular": "evaluationExpectation" + }, + "oneofs": { + "criteria": { + "oneof": [ + "llmCriteria" + ] + } + }, + "fields": { + "llmCriteria": { + "type": "LlmCriteria", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "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" + } + }, + "etag": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "LlmCriteria": { + "fields": { + "prompt": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "EvaluationConfig": { + "fields": { + "inputAudioConfig": { + "type": "InputAudioConfig", + "id": 1, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationChannel": { + "type": "EvaluationChannel", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolCallBehaviour": { + "type": "EvaluationToolCallBehaviour", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "EvaluationChannel": { + "values": { + "EVALUATION_CHANNEL_UNSPECIFIED": 0, + "TEXT": 1, + "AUDIO": 2 + } + } + } + }, + "EvaluationErrorInfo": { + "fields": { + "errorType": { + "type": "ErrorType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorMessage": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sessionId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ErrorType": { + "values": { + "ERROR_TYPE_UNSPECIFIED": 0, + "RUNTIME_FAILURE": 1, + "CONVERSATION_RETRIEVAL_FAILURE": 2, + "METRIC_CALCULATION_FAILURE": 3, + "EVALUATION_UPDATE_FAILURE": 4, + "QUOTA_EXHAUSTED": 5, + "USER_SIMULATION_FAILURE": 6 + } + } + } + }, + "RunEvaluationRequest": { + "oneofs": { + "_runCount": { + "oneof": [ + "runCount" + ] + } + }, + "fields": { + "app": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "evaluations": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Evaluation" + } + }, + "evaluationDataset": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationDataset" + } + }, + "displayName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "appVersion": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + }, + "config": { + "type": "EvaluationConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "runCount": { + "type": "int32", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "personaRunConfigs": { + "rule": "repeated", + "type": "PersonaRunConfig", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "optimizationConfig": { + "type": "OptimizationConfig", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scheduledEvaluationRun": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/ScheduledEvaluationRun" + } + }, + "goldenRunMethod": { + "type": "GoldenRunMethod", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "generateLatencyReport": { + "type": "bool", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ScheduledEvaluationRun": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/ScheduledEvaluationRun", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/scheduledEvaluationRuns/{scheduled_evaluation_run}", + "(google.api.resource).plural": "scheduledEvaluationRuns", + "(google.api.resource).singular": "scheduledEvaluationRun" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "request": { + "type": "RunEvaluationRequest", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schedulingConfig": { + "type": "SchedulingConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "active": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lastCompletedRun": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" + } + }, + "totalExecutions": { + "type": "int32", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextScheduledExecutionTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createdBy": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastUpdatedBy": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "SchedulingConfig": { + "fields": { + "frequency": { + "type": "Frequency", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "daysOfWeek": { + "rule": "repeated", + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Frequency": { + "values": { + "FREQUENCY_UNSPECIFIED": 0, + "NONE": 1, + "DAILY": 2, + "WEEKLY": 3, + "BIWEEKLY": 4 + } + } + } + } + } + }, + "PersonaRunConfig": { + "fields": { + "persona": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "taskCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OptimizationConfig": { + "fields": { + "generateLossReport": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "assistantSession": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reportSummary": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "shouldSuggestFix": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "status": { + "type": "OptimizationStatus", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorMessage": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lossReport": { + "type": "google.protobuf.Struct", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "OptimizationStatus": { + "values": { + "OPTIMIZATION_STATUS_UNSPECIFIED": 0, + "RUNNING": 1, + "COMPLETED": 2, + "ERROR": 3 + } + } + } + }, + "SessionService": { + "options": { + "(google.api.default_host)": "ces.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "RunSession": { + "requestType": "RunSessionRequest", + "responseType": "RunSessionResponse", + "options": { + "(google.api.http).post": "/v1beta/{config.session=projects/*/locations/*/apps/*/sessions/*}:runSession", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{config.session=projects/*/locations/*/apps/*/sessions/*}:runSession", + "body": "*" + } + } + ] + }, + "BidiRunSession": { + "requestType": "BidiSessionClientMessage", + "requestStream": true, + "responseType": "BidiSessionServerMessage", + "responseStream": true + } + } + }, + "AudioEncoding": { + "values": { + "AUDIO_ENCODING_UNSPECIFIED": 0, + "LINEAR16": 1, + "MULAW": 2, + "ALAW": 3 + } + }, + "InputAudioConfig": { + "fields": { + "audioEncoding": { + "type": "AudioEncoding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sampleRateHertz": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "noiseSuppressionLevel": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OutputAudioConfig": { + "fields": { + "audioEncoding": { + "type": "AudioEncoding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sampleRateHertz": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SessionConfig": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Session" + } + }, + "inputAudioConfig": { + "type": "InputAudioConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "historicalContexts": { + "rule": "repeated", + "type": "Message", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "entryAgent": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "deployment": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeZone": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "remoteDialogflowQueryParameters": { + "type": "RemoteDialogflowQueryParameters", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RemoteDialogflowQueryParameters": { + "fields": { + "webhookHeaders": { + "keyType": "string", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endUserMetadata": { + "type": "google.protobuf.Struct", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ToolCalls": { + "fields": { + "toolCalls": { + "rule": "repeated", + "type": "ToolCall", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ToolResponses": { + "fields": { + "toolResponses": { + "rule": "repeated", + "type": "ToolResponse", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Citations": { + "fields": { + "citedChunks": { + "rule": "repeated", + "type": "CitedChunk", + "id": 1 + } + }, + "nested": { + "CitedChunk": { + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "text": { + "type": "string", + "id": 3 + } + } + } + } + }, + "Event": { + "fields": { + "event": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SessionInput": { + "oneofs": { + "inputType": { + "oneof": [ + "text", + "dtmf", + "audio", + "toolResponses", + "image", + "blob", + "variables", + "event" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dtmf": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "audio": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolResponses": { + "type": "ToolResponses", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "image": { + "type": "Image", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "blob": { + "type": "Blob", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "variables": { + "type": "google.protobuf.Struct", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "event": { + "type": "Event", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "willContinue": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SessionOutput": { + "oneofs": { + "outputType": { + "oneof": [ + "text", + "audio", + "toolCalls", + "citations", + "googleSearchSuggestions", + "endSession", + "payload" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "audio": { + "type": "bytes", + "id": 2 + }, + "toolCalls": { + "type": "ToolCalls", + "id": 3 + }, + "citations": { + "type": "Citations", + "id": 8 + }, + "googleSearchSuggestions": { + "type": "GoogleSearchSuggestions", + "id": 10 + }, + "endSession": { + "type": "EndSession", + "id": 9 + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 11 + }, + "turnIndex": { + "type": "int32", + "id": 6 + }, + "turnCompleted": { + "type": "bool", + "id": 4 + }, + "diagnosticInfo": { + "type": "DiagnosticInfo", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "DiagnosticInfo": { + "fields": { + "messages": { + "rule": "repeated", + "type": "Message", + "id": 1 + }, + "rootSpan": { + "type": "Span", + "id": 3 + } + } + } + } + }, + "RecognitionResult": { + "fields": { + "transcript": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InterruptionSignal": { + "fields": { + "bargeIn": { + "type": "bool", + "id": 1 + } + } + }, + "EndSession": { + "fields": { + "metadata": { + "type": "google.protobuf.Struct", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GoAway": { + "fields": {} + }, + "RunSessionRequest": { + "fields": { + "config": { + "type": "SessionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inputs": { + "rule": "repeated", + "type": "SessionInput", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RunSessionResponse": { + "fields": { + "outputs": { + "rule": "repeated", + "type": "SessionOutput", + "id": 1 + } + } + }, + "BidiSessionClientMessage": { + "oneofs": { + "messageType": { + "oneof": [ + "config", + "realtimeInput" + ] + } + }, + "fields": { + "config": { + "type": "SessionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "realtimeInput": { + "type": "SessionInput", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BidiSessionServerMessage": { + "oneofs": { + "messageType": { + "oneof": [ + "sessionOutput", + "recognitionResult", + "interruptionSignal", + "endSession", + "goAway" + ] + } + }, + "fields": { + "sessionOutput": { + "type": "SessionOutput", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "recognitionResult": { + "type": "RecognitionResult", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "interruptionSignal": { + "type": "InterruptionSignal", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endSession": { + "type": "EndSession", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "goAway": { + "type": "GoAway", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GoogleSearchSuggestions": { + "fields": { + "htmls": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "webSearchQueries": { + "rule": "repeated", + "type": "WebSearchQuery", + "id": 2 + } + } + }, + "WebSearchQuery": { + "fields": { + "query": { + "type": "string", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + } + } + }, + "EvaluationService": { + "options": { + "(google.api.default_host)": "ces.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "RunEvaluation": { + "requestType": "RunEvaluationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{app=projects/*/locations/*/apps/*}:runEvaluation", + "(google.api.http).body": "*", + "(google.api.method_signature)": "app", + "(google.longrunning.operation_info).response_type": "RunEvaluationResponse", + "(google.longrunning.operation_info).metadata_type": "RunEvaluationOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{app=projects/*/locations/*/apps/*}:runEvaluation", + "body": "*" + } + }, + { + "(google.api.method_signature)": "app" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RunEvaluationResponse", + "metadata_type": "RunEvaluationOperationMetadata" + } + } + ] + }, + "UploadEvaluationAudio": { + "requestType": "UploadEvaluationAudioRequest", + "responseType": "UploadEvaluationAudioResponse", + "options": { + "(google.api.http).post": "/v1beta/{app=projects/*/locations/*/apps/*}:uploadEvaluationAudio", + "(google.api.http).body": "*", + "(google.api.method_signature)": "app,audio_content" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{app=projects/*/locations/*/apps/*}:uploadEvaluationAudio", + "body": "*" + } + }, + { + "(google.api.method_signature)": "app,audio_content" + } + ] + }, + "CreateEvaluation": { + "requestType": "CreateEvaluationRequest", + "responseType": "Evaluation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluations", + "(google.api.http).body": "evaluation", + "(google.api.method_signature)": "parent,evaluation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluations", + "body": "evaluation" + } + }, + { + "(google.api.method_signature)": "parent,evaluation,evaluation_id" + }, + { + "(google.api.method_signature)": "parent,evaluation" + } + ] + }, + "GenerateEvaluation": { + "requestType": "GenerateEvaluationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{conversation=projects/*/locations/*/apps/*/conversations/*}:generateEvaluation", + "(google.api.http).body": "*", + "(google.api.method_signature)": "conversation", + "(google.longrunning.operation_info).response_type": "Evaluation", + "(google.longrunning.operation_info).metadata_type": "GenerateEvaluationOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{conversation=projects/*/locations/*/apps/*/conversations/*}:generateEvaluation", + "body": "*" + } + }, + { + "(google.api.method_signature)": "conversation" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Evaluation", + "metadata_type": "GenerateEvaluationOperationMetadata" + } + } + ] + }, + "ImportEvaluations": { + "requestType": "ImportEvaluationsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}:importEvaluations", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "ImportEvaluationsResponse", + "(google.longrunning.operation_info).metadata_type": "ImportEvaluationsOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}:importEvaluations", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportEvaluationsResponse", + "metadata_type": "ImportEvaluationsOperationMetadata" + } + } + ] + }, + "CreateEvaluationDataset": { + "requestType": "CreateEvaluationDatasetRequest", + "responseType": "EvaluationDataset", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationDatasets", + "(google.api.http).body": "evaluation_dataset", + "(google.api.method_signature)": "parent,evaluation_dataset" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationDatasets", + "body": "evaluation_dataset" + } + }, + { + "(google.api.method_signature)": "parent,evaluation_dataset,evaluation_dataset_id" + }, + { + "(google.api.method_signature)": "parent,evaluation_dataset" + } + ] + }, + "UpdateEvaluation": { + "requestType": "UpdateEvaluationRequest", + "responseType": "Evaluation", + "options": { + "(google.api.http).patch": "/v1beta/{evaluation.name=projects/*/locations/*/apps/*/evaluations/*}", + "(google.api.http).body": "evaluation", + "(google.api.method_signature)": "evaluation,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{evaluation.name=projects/*/locations/*/apps/*/evaluations/*}", + "body": "evaluation" + } + }, + { + "(google.api.method_signature)": "evaluation,update_mask" + } + ] + }, + "UpdateEvaluationDataset": { + "requestType": "UpdateEvaluationDatasetRequest", + "responseType": "EvaluationDataset", + "options": { + "(google.api.http).patch": "/v1beta/{evaluation_dataset.name=projects/*/locations/*/apps/*/evaluationDatasets/*}", + "(google.api.http).body": "evaluation_dataset", + "(google.api.method_signature)": "evaluation_dataset,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{evaluation_dataset.name=projects/*/locations/*/apps/*/evaluationDatasets/*}", + "body": "evaluation_dataset" + } + }, + { + "(google.api.method_signature)": "evaluation_dataset,update_mask" + } + ] + }, + "DeleteEvaluation": { + "requestType": "DeleteEvaluationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteEvaluationResult": { + "requestType": "DeleteEvaluationResultRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*/results/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*/results/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteEvaluationDataset": { + "requestType": "DeleteEvaluationDatasetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationDatasets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationDatasets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteEvaluationRun": { + "requestType": "DeleteEvaluationRunRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationRuns/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "DeleteEvaluationRunOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationRuns/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "DeleteEvaluationRunOperationMetadata" + } + } + ] + }, + "GetEvaluation": { + "requestType": "GetEvaluationRequest", + "responseType": "Evaluation", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetEvaluationResult": { + "requestType": "GetEvaluationResultRequest", + "responseType": "EvaluationResult", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*/results/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*/results/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetEvaluationDataset": { + "requestType": "GetEvaluationDatasetRequest", + "responseType": "EvaluationDataset", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationDatasets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationDatasets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetEvaluationRun": { + "requestType": "GetEvaluationRunRequest", + "responseType": "EvaluationRun", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationRuns/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationRuns/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListEvaluations": { + "requestType": "ListEvaluationsRequest", + "responseType": "ListEvaluationsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListEvaluationResults": { + "requestType": "ListEvaluationResultsRequest", + "responseType": "ListEvaluationResultsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*/evaluations/*}/results", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*/evaluations/*}/results" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListEvaluationDatasets": { + "requestType": "ListEvaluationDatasetsRequest", + "responseType": "ListEvaluationDatasetsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationDatasets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationDatasets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListEvaluationRuns": { + "requestType": "ListEvaluationRunsRequest", + "responseType": "ListEvaluationRunsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationRuns", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationRuns" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListEvaluationExpectations": { + "requestType": "ListEvaluationExpectationsRequest", + "responseType": "ListEvaluationExpectationsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationExpectations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationExpectations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetEvaluationExpectation": { + "requestType": "GetEvaluationExpectationRequest", + "responseType": "EvaluationExpectation", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationExpectations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationExpectations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateEvaluationExpectation": { + "requestType": "CreateEvaluationExpectationRequest", + "responseType": "EvaluationExpectation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationExpectations", + "(google.api.http).body": "evaluation_expectation", + "(google.api.method_signature)": "parent,evaluation_expectation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationExpectations", + "body": "evaluation_expectation" + } + }, + { + "(google.api.method_signature)": "parent,evaluation_expectation,evaluation_expectation_id" + }, + { + "(google.api.method_signature)": "parent,evaluation_expectation" + } + ] + }, + "UpdateEvaluationExpectation": { + "requestType": "UpdateEvaluationExpectationRequest", + "responseType": "EvaluationExpectation", + "options": { + "(google.api.http).patch": "/v1beta/{evaluation_expectation.name=projects/*/locations/*/apps/*/evaluationExpectations/*}", + "(google.api.http).body": "evaluation_expectation", + "(google.api.method_signature)": "evaluation_expectation,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{evaluation_expectation.name=projects/*/locations/*/apps/*/evaluationExpectations/*}", + "body": "evaluation_expectation" + } + }, + { + "(google.api.method_signature)": "evaluation_expectation,update_mask" + } + ] + }, + "DeleteEvaluationExpectation": { + "requestType": "DeleteEvaluationExpectationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationExpectations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationExpectations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateScheduledEvaluationRun": { + "requestType": "CreateScheduledEvaluationRunRequest", + "responseType": "ScheduledEvaluationRun", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/scheduledEvaluationRuns", + "(google.api.http).body": "scheduled_evaluation_run", + "(google.api.method_signature)": "parent,scheduled_evaluation_run" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/scheduledEvaluationRuns", + "body": "scheduled_evaluation_run" + } + }, + { + "(google.api.method_signature)": "parent,scheduled_evaluation_run,scheduled_evaluation_run_id" + }, + { + "(google.api.method_signature)": "parent,scheduled_evaluation_run" + } + ] + }, + "GetScheduledEvaluationRun": { + "requestType": "GetScheduledEvaluationRunRequest", + "responseType": "ScheduledEvaluationRun", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListScheduledEvaluationRuns": { + "requestType": "ListScheduledEvaluationRunsRequest", + "responseType": "ListScheduledEvaluationRunsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/scheduledEvaluationRuns", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/scheduledEvaluationRuns" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateScheduledEvaluationRun": { + "requestType": "UpdateScheduledEvaluationRunRequest", + "responseType": "ScheduledEvaluationRun", + "options": { + "(google.api.http).patch": "/v1beta/{scheduled_evaluation_run.name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}", + "(google.api.http).body": "scheduled_evaluation_run", + "(google.api.method_signature)": "scheduled_evaluation_run,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{scheduled_evaluation_run.name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}", + "body": "scheduled_evaluation_run" + } + }, + { + "(google.api.method_signature)": "scheduled_evaluation_run,update_mask" + } + ] + }, + "DeleteScheduledEvaluationRun": { + "requestType": "DeleteScheduledEvaluationRunRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "TestPersonaVoice": { + "requestType": "TestPersonaVoiceRequest", + "responseType": "TestPersonaVoiceResponse", + "options": { + "(google.api.http).post": "/v1beta/{app=projects/*/locations/*/apps/*}:testPersonaVoice", + "(google.api.http).body": "*", + "(google.api.method_signature)": "app" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{app=projects/*/locations/*/apps/*}:testPersonaVoice", + "body": "*" + } + }, + { + "(google.api.method_signature)": "app" + } + ] + } + } + }, + "RunEvaluationResponse": { + "fields": { + "evaluationRun": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" + } + } + } + }, + "RunEvaluationOperationMetadata": { + "fields": { + "evaluations": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Evaluation" + } + }, + "evaluationRun": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cancelRequested": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GenerateEvaluationOperationMetadata": { + "fields": {} + }, + "DeleteEvaluationRunOperationMetadata": { + "fields": {} + }, + "CreateEvaluationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "evaluationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluation": { + "type": "Evaluation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GenerateEvaluationRequest": { + "fields": { + "conversation": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" + } + }, + "source": { + "type": "Conversation.Source", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ImportEvaluationsRequest": { + "oneofs": { + "source": { + "oneof": [ + "conversationList", + "gcsUri", + "csvContent" + ] + } + }, + "fields": { + "conversationList": { + "type": "ConversationList", + "id": 2 + }, + "gcsUri": { + "type": "string", + "id": 3 + }, + "csvContent": { + "type": "bytes", + "id": 4 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "importOptions": { + "type": "ImportOptions", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ConversationList": { + "fields": { + "conversations": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ImportOptions": { + "fields": { + "conflictResolutionStrategy": { + "type": "ConflictResolutionStrategy", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ConflictResolutionStrategy": { + "values": { + "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED": 0, + "OVERWRITE": 1, + "SKIP": 2, + "DUPLICATE": 3 + } + } + } + } + } + }, + "ImportEvaluationsResponse": { + "fields": { + "evaluations": { + "rule": "repeated", + "type": "Evaluation", + "id": 1 + }, + "errorMessages": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "importFailureCount": { + "type": "int32", + "id": 3 + } + } + }, + "ImportEvaluationsOperationMetadata": { + "fields": { + "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" + } + }, + "statusMessage": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CreateEvaluationDatasetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "evaluationDatasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationDataset": { + "type": "EvaluationDataset", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateEvaluationRequest": { + "fields": { + "evaluation": { + "type": "Evaluation", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateEvaluationDatasetRequest": { + "fields": { + "evaluationDataset": { + "type": "EvaluationDataset", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteEvaluationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Evaluation" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteEvaluationResultRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationResult" + } + } + } + }, + "DeleteEvaluationDatasetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationDataset" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteEvaluationRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" + } + } + } + }, + "GetEvaluationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Evaluation" + } + } + } + }, + "GetEvaluationResultRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationResult" + } + } + } + }, + "GetEvaluationDatasetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationDataset" + } + } + } + }, + "GetEvaluationRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" + } + } + } + }, + "ListEvaluationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Evaluation" + } + }, + "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": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationFilter": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationRunFilter": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lastTenResults": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListEvaluationResultsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/EvaluationResult" + } + }, + "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" + } + } + } + }, + "ListEvaluationDatasetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/EvaluationDataset" + } + }, + "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" + } + } + } + }, + "ListEvaluationRunsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/EvaluationRun" + } + }, + "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" + } + } + } + }, + "ListEvaluationsResponse": { + "fields": { + "evaluations": { + "rule": "repeated", + "type": "Evaluation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListEvaluationResultsResponse": { + "fields": { + "evaluationResults": { + "rule": "repeated", + "type": "EvaluationResult", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListEvaluationDatasetsResponse": { + "fields": { + "evaluationDatasets": { + "rule": "repeated", + "type": "EvaluationDataset", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListEvaluationRunsResponse": { + "fields": { + "evaluationRuns": { + "rule": "repeated", + "type": "EvaluationRun", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateScheduledEvaluationRunRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "scheduledEvaluationRunId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scheduledEvaluationRun": { + "type": "ScheduledEvaluationRun", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetScheduledEvaluationRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/ScheduledEvaluationRun" + } + } + } + }, + "ListScheduledEvaluationRunsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/ScheduledEvaluationRun" + } + }, + "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" + } + } + } + }, + "ListScheduledEvaluationRunsResponse": { + "fields": { + "scheduledEvaluationRuns": { + "rule": "repeated", + "type": "ScheduledEvaluationRun", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateScheduledEvaluationRunRequest": { + "fields": { + "scheduledEvaluationRun": { + "type": "ScheduledEvaluationRun", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteScheduledEvaluationRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/ScheduledEvaluationRun" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TestPersonaVoiceRequest": { + "fields": { + "app": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "personaId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "text": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UploadEvaluationAudioRequest": { + "fields": { + "app": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "audioContent": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UploadEvaluationAudioResponse": { + "fields": { + "audioGcsUri": { + "type": "string", + "id": 1 + }, + "audioTranscript": { + "type": "string", + "id": 2 + }, + "audioDuration": { + "type": "google.protobuf.Duration", + "id": 3 + } + } + }, + "TestPersonaVoiceResponse": { + "fields": { + "audio": { + "type": "bytes", + "id": 1 + } + } + }, + "CreateEvaluationExpectationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "evaluationExpectationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationExpectation": { + "type": "EvaluationExpectation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateEvaluationExpectationRequest": { + "fields": { + "evaluationExpectation": { + "type": "EvaluationExpectation", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteEvaluationExpectationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationExpectation" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetEvaluationExpectationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationExpectation" + } + } + } + }, + "ListEvaluationExpectationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/EvaluationExpectation" + } + }, + "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" + } + } + } + }, + "ListEvaluationExpectationsResponse": { + "fields": { + "evaluationExpectations": { + "rule": "repeated", + "type": "EvaluationExpectation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "Omnichannel": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Omnichannel", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/omnichannels/{omnichannel}", + "(google.api.resource).plural": "omnichannels", + "(google.api.resource).singular": "omnichannel" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "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" + } + }, + "etag": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "integrationConfig": { + "type": "OmnichannelIntegrationConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OmnichannelIntegrationConfig": { + "fields": { + "channelConfigs": { + "keyType": "string", + "type": "ChannelConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subscriberConfigs": { + "keyType": "string", + "type": "SubscriberConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "routingConfigs": { + "keyType": "string", + "type": "RoutingConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ChannelConfig": { + "oneofs": { + "channelConfig": { + "oneof": [ + "whatsappConfig" + ] + } + }, + "fields": { + "whatsappConfig": { + "type": "WhatsappConfig", + "id": 1 + } + } + }, + "WhatsappConfig": { + "fields": { + "phoneNumberId": { + "type": "string", + "id": 1 + }, + "phoneNumber": { + "type": "string", + "id": 2 + }, + "whatsappBusinessAccountId": { + "type": "string", + "id": 3 + }, + "webhookVerifyToken": { + "type": "string", + "id": 4 + }, + "whatsappBusinessToken": { + "type": "string", + "id": 5 + }, + "metaBusinessPortfolioId": { + "type": "string", + "id": 6 + } + } + }, + "SubscriberConfig": { + "oneofs": { + "subscriberConfig": { + "oneof": [ + "cesAppConfig" + ] + } + }, + "fields": { + "cesAppConfig": { + "type": "CesAppConfig", + "id": 1 + } + } + }, + "CesAppConfig": { + "fields": { + "app": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + } + } + }, + "RoutingConfig": { + "fields": { + "subscriberKey": { + "type": "string", + "id": 1 + } + } + } + } + }, + "OmnichannelOperationMetadata": { + "fields": { + "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" + } + }, + "statusMessage": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ToolService": { + "options": { + "(google.api.default_host)": "ces.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ExecuteTool": { + "requestType": "ExecuteToolRequest", + "responseType": "ExecuteToolResponse", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}:executeTool", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}:executeTool", + "body": "*" + } + } + ] + }, + "RetrieveToolSchema": { + "requestType": "RetrieveToolSchemaRequest", + "responseType": "RetrieveToolSchemaResponse", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}:retrieveToolSchema", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}:retrieveToolSchema", + "body": "*" + } + } + ] + }, + "RetrieveTools": { + "requestType": "RetrieveToolsRequest", + "responseType": "RetrieveToolsResponse", + "options": { + "(google.api.http).post": "/v1beta/{toolset=projects/*/locations/*/apps/*/toolsets/*}:retrieveTools", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{toolset=projects/*/locations/*/apps/*/toolsets/*}:retrieveTools", + "body": "*" + } + } + ] + } + } + }, + "ExecuteToolRequest": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parent": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "args": { + "type": "google.protobuf.Struct", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "variables": { + "type": "google.protobuf.Struct", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExecuteToolResponse": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 3 + }, + "response": { + "type": "google.protobuf.Struct", + "id": 2 + }, + "variables": { + "type": "google.protobuf.Struct", + "id": 4 + } + } + }, + "RetrieveToolSchemaRequest": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parent": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + } + } + }, + "RetrieveToolSchemaResponse": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 2 + }, + "inputSchema": { + "type": "Schema", + "id": 3 + }, + "outputSchema": { + "type": "Schema", + "id": 4 + } + } + }, + "RetrieveToolsRequest": { + "fields": { + "toolset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" + } + }, + "toolIds": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RetrieveToolsResponse": { + "fields": { + "tools": { + "rule": "repeated", + "type": "Tool", + "id": 1 + } + } + }, + "WidgetService": { + "options": { + "(google.api.default_host)": "ces.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GenerateChatToken": { + "requestType": "GenerateChatTokenRequest", + "responseType": "GenerateChatTokenResponse", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/apps/*/sessions/*}:generateChatToken", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{name=projects/*/locations/*/apps/*/sessions/*}:generateChatToken", + "body": "*" + } + } + ] + } + } + }, + "GenerateChatTokenRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Session" + } + }, + "deployment": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" + } + }, + "recaptchaToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GenerateChatTokenResponse": { + "fields": { + "chatToken": { + "type": "string", + "id": 1 + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "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 + } + }, + "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": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "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-ces/samples/generated/v1/agent_service.batch_delete_conversations.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.batch_delete_conversations.js new file mode 100644 index 00000000000..011d8c91463 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.batch_delete_conversations.js @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, conversations) { + // [START ces_v1_generated_AgentService_BatchDeleteConversations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to delete conversations from. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + */ + // const parent = 'abc123' + /** + * Required. The resource names of the conversations to delete. + */ + // const conversations = ['abc','def'] + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callBatchDeleteConversations() { + // Construct request + const request = { + parent, + conversations, + }; + + // Run request + const [operation] = await cesClient.batchDeleteConversations(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchDeleteConversations(); + // [END ces_v1_generated_AgentService_BatchDeleteConversations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_agent.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_agent.js new file mode 100644 index 00000000000..21c3c1315cb --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_agent.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, agent) { + // [START ces_v1_generated_AgentService_CreateAgent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to create an agent in. + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the agent, which will become the final + * component of the agent's resource name. If not provided, a unique ID will + * be automatically assigned for the agent. + */ + // const agentId = 'abc123' + /** + * Required. The agent to create. + */ + // const agent = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callCreateAgent() { + // Construct request + const request = { + parent, + agent, + }; + + // Run request + const response = await cesClient.createAgent(request); + console.log(response); + } + + callCreateAgent(); + // [END ces_v1_generated_AgentService_CreateAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_app.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_app.js new file mode 100644 index 00000000000..2614161d04f --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_app.js @@ -0,0 +1,73 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, app) { + // [START ces_v1_generated_AgentService_CreateApp_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the location to create an app in. + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the app, which will become the final component + * of the app's resource name. If not provided, a unique ID will be + * automatically assigned for the app. + */ + // const appId = 'abc123' + /** + * Required. The app to create. + */ + // const app = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callCreateApp() { + // Construct request + const request = { + parent, + app, + }; + + // Run request + const [operation] = await cesClient.createApp(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateApp(); + // [END ces_v1_generated_AgentService_CreateApp_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_app_version.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_app_version.js new file mode 100644 index 00000000000..de9ec753d41 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_app_version.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, appVersion) { + // [START ces_v1_generated_AgentService_CreateAppVersion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to create an app version in. + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the app version, which will become the final + * component of the app version's resource name. If not provided, a unique ID + * will be automatically assigned for the app version. + */ + // const appVersionId = 'abc123' + /** + * Required. The app version to create. + */ + // const appVersion = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callCreateAppVersion() { + // Construct request + const request = { + parent, + appVersion, + }; + + // Run request + const response = await cesClient.createAppVersion(request); + console.log(response); + } + + callCreateAppVersion(); + // [END ces_v1_generated_AgentService_CreateAppVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_deployment.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_deployment.js new file mode 100644 index 00000000000..5151ccda4a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_deployment.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, deployment) { + // [START ces_v1_generated_AgentService_CreateDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 parent app. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the deployment, which will become the final + * component of the deployment's resource name. If not provided, a unique ID + * will be automatically assigned for the deployment. + */ + // const deploymentId = 'abc123' + /** + * Required. The deployment to create. + */ + // const deployment = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callCreateDeployment() { + // Construct request + const request = { + parent, + deployment, + }; + + // Run request + const response = await cesClient.createDeployment(request); + console.log(response); + } + + callCreateDeployment(); + // [END ces_v1_generated_AgentService_CreateDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_example.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_example.js new file mode 100644 index 00000000000..c093a8166ec --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_example.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, example) { + // [START ces_v1_generated_AgentService_CreateExample_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to create an example in. + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the example, which will become the final + * component of the example's resource name. If not provided, a unique ID will + * be automatically assigned for the example. + */ + // const exampleId = 'abc123' + /** + * Required. The example to create. + */ + // const example = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callCreateExample() { + // Construct request + const request = { + parent, + example, + }; + + // Run request + const response = await cesClient.createExample(request); + console.log(response); + } + + callCreateExample(); + // [END ces_v1_generated_AgentService_CreateExample_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_guardrail.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_guardrail.js new file mode 100644 index 00000000000..d5f598a9c8c --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_guardrail.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, guardrail) { + // [START ces_v1_generated_AgentService_CreateGuardrail_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to create a guardrail in. + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the guardrail, which will become the final + * component of the guardrail's resource name. If not provided, a unique ID + * will be automatically assigned for the guardrail. + */ + // const guardrailId = 'abc123' + /** + * Required. The guardrail to create. + */ + // const guardrail = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callCreateGuardrail() { + // Construct request + const request = { + parent, + guardrail, + }; + + // Run request + const response = await cesClient.createGuardrail(request); + console.log(response); + } + + callCreateGuardrail(); + // [END ces_v1_generated_AgentService_CreateGuardrail_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_tool.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_tool.js new file mode 100644 index 00000000000..597d9ce5520 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_tool.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, tool) { + // [START ces_v1_generated_AgentService_CreateTool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to create a tool in. + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the tool, which will become the final component + * of the tool's resource name. If not provided, a unique ID will be + * automatically assigned for the tool. + */ + // const toolId = 'abc123' + /** + * Required. The tool to create. + */ + // const tool = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callCreateTool() { + // Construct request + const request = { + parent, + tool, + }; + + // Run request + const response = await cesClient.createTool(request); + console.log(response); + } + + callCreateTool(); + // [END ces_v1_generated_AgentService_CreateTool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_toolset.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_toolset.js new file mode 100644 index 00000000000..c1fe783e94c --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_toolset.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, toolset) { + // [START ces_v1_generated_AgentService_CreateToolset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to create a toolset in. + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the toolset, which will become the final + * component of the toolset's resource name. If not provided, a unique ID will + * be automatically assigned for the toolset. + */ + // const toolsetId = 'abc123' + /** + * Required. The toolset to create. + */ + // const toolset = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callCreateToolset() { + // Construct request + const request = { + parent, + toolset, + }; + + // Run request + const response = await cesClient.createToolset(request); + console.log(response); + } + + callCreateToolset(); + // [END ces_v1_generated_AgentService_CreateToolset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_agent.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_agent.js new file mode 100644 index 00000000000..351174cd7df --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_agent.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1_generated_AgentService_DeleteAgent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the agent to delete. + */ + // const name = 'abc123' + /** + * Optional. Indicates whether to forcefully delete the agent, even if it is + * still referenced by other app/agents/examples. + * * If `force = false`, the deletion fails if other agents/examples + * reference it. + * * If `force = true`, delete the agent and remove it from all referencing + * apps/agents/examples. + */ + // const force = true + /** + * Optional. The current etag of the agent. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the agent, deletion will be blocked and + * an ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callDeleteAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteAgent(request); + console.log(response); + } + + callDeleteAgent(); + // [END ces_v1_generated_AgentService_DeleteAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_app.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_app.js new file mode 100644 index 00000000000..c92a148c87f --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_app.js @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1_generated_AgentService_DeleteApp_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to delete. + */ + // const name = 'abc123' + /** + * Optional. The current etag of the app. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the app, deletion will be blocked and an + * ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callDeleteApp() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cesClient.deleteApp(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteApp(); + // [END ces_v1_generated_AgentService_DeleteApp_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_app_version.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_app_version.js new file mode 100644 index 00000000000..3b9918adbbd --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_app_version.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1_generated_AgentService_DeleteAppVersion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app version to delete. + */ + // const name = 'abc123' + /** + * Optional. The current etag of the app version. If an etag is not provided, + * the deletion will overwrite any concurrent changes. If an etag is provided + * and does not match the current etag of the app version, deletion will be + * blocked and an ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callDeleteAppVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteAppVersion(request); + console.log(response); + } + + callDeleteAppVersion(); + // [END ces_v1_generated_AgentService_DeleteAppVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_conversation.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_conversation.js new file mode 100644 index 00000000000..827e993176b --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_conversation.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1_generated_AgentService_DeleteConversation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the conversation to delete. + */ + // const name = 'abc123' + /** + * Optional. Indicate the source of the conversation. If not set, Source.Live + * will be applied by default. + */ + // const source = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callDeleteConversation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteConversation(request); + console.log(response); + } + + callDeleteConversation(); + // [END ces_v1_generated_AgentService_DeleteConversation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_deployment.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_deployment.js new file mode 100644 index 00000000000..8c90895149b --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_deployment.js @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1_generated_AgentService_DeleteDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 deployment to delete. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` + */ + // const name = 'abc123' + /** + * Optional. The etag of the deployment. + * If an etag is provided and does not match the current etag of the + * deployment, deletion will be blocked and an ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callDeleteDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteDeployment(request); + console.log(response); + } + + callDeleteDeployment(); + // [END ces_v1_generated_AgentService_DeleteDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_example.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_example.js new file mode 100644 index 00000000000..56d198130ab --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_example.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1_generated_AgentService_DeleteExample_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the example to delete. + */ + // const name = 'abc123' + /** + * Optional. The current etag of the example. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the example, deletion will be blocked + * and an ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callDeleteExample() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteExample(request); + console.log(response); + } + + callDeleteExample(); + // [END ces_v1_generated_AgentService_DeleteExample_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_guardrail.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_guardrail.js new file mode 100644 index 00000000000..5d36e33cc4e --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_guardrail.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1_generated_AgentService_DeleteGuardrail_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the guardrail to delete. + */ + // const name = 'abc123' + /** + * Optional. Indicates whether to forcefully delete the guardrail, even if it + * is still referenced by app/agents. + * * If `force = false`, the deletion fails if any apps/agents still + * reference the guardrail. + * * If `force = true`, all existing references from apps/agents will be + * removed and the guardrail will be deleted. + */ + // const force = true + /** + * Optional. The current etag of the guardrail. If an etag is not provided, + * the deletion will overwrite any concurrent changes. If an etag is provided + * and does not match the current etag of the guardrail, deletion will be + * blocked and an ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callDeleteGuardrail() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteGuardrail(request); + console.log(response); + } + + callDeleteGuardrail(); + // [END ces_v1_generated_AgentService_DeleteGuardrail_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_tool.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_tool.js new file mode 100644 index 00000000000..db738c047f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_tool.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1_generated_AgentService_DeleteTool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the tool to delete. + */ + // const name = 'abc123' + /** + * Optional. Indicates whether to forcefully delete the tool, even if it is + * still referenced by agents/examples. + * * If `force = false`, the deletion will fail if any agents still + * reference the tool. + * * If `force = true`, all existing references from agents will be removed + * and the tool will be deleted. + */ + // const force = true + /** + * Optional. The current etag of the tool. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the tool, deletion will be blocked and + * an ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callDeleteTool() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteTool(request); + console.log(response); + } + + callDeleteTool(); + // [END ces_v1_generated_AgentService_DeleteTool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_toolset.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_toolset.js new file mode 100644 index 00000000000..1204169576f --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_toolset.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1_generated_AgentService_DeleteToolset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the toolset to delete. + */ + // const name = 'abc123' + /** + * Optional. Indicates whether to forcefully delete the toolset, even if it is + * still referenced by app/agents. + * * If `force = false`, the deletion fails if any agents still + * reference the toolset. + * * If `force = true`, all existing references from agents will be + * removed and the toolset will be deleted. + */ + // const force = true + /** + * Optional. The current etag of the toolset. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the toolset, deletion will be blocked + * and an ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callDeleteToolset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteToolset(request); + console.log(response); + } + + callDeleteToolset(); + // [END ces_v1_generated_AgentService_DeleteToolset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.export_app.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.export_app.js new file mode 100644 index 00000000000..8a2db578f8c --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.export_app.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, exportFormat) { + // [START ces_v1_generated_AgentService_ExportApp_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to export. + */ + // const name = 'abc123' + /** + * Required. The format to export the app in. + */ + // const exportFormat = {} + /** + * Optional. The Google Cloud + * Storage (https://cloud.google.com/storage/docs/) URI to which to export the + * app. The format of this URI must be `gs:///`. The + * exported app archive will be written directly to the specified GCS object. + */ + // const gcsUri = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callExportApp() { + // Construct request + const request = { + name, + exportFormat, + }; + + // Run request + const [operation] = await cesClient.exportApp(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportApp(); + // [END ces_v1_generated_AgentService_ExportApp_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_agent.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_agent.js new file mode 100644 index 00000000000..87cc02d7d0a --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_agent.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1_generated_AgentService_GetAgent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the agent to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getAgent(request); + console.log(response); + } + + callGetAgent(); + // [END ces_v1_generated_AgentService_GetAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_app.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_app.js new file mode 100644 index 00000000000..6767ac16059 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_app.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1_generated_AgentService_GetApp_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetApp() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getApp(request); + console.log(response); + } + + callGetApp(); + // [END ces_v1_generated_AgentService_GetApp_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_app_version.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_app_version.js new file mode 100644 index 00000000000..61170d3bb64 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_app_version.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1_generated_AgentService_GetAppVersion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app version to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetAppVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getAppVersion(request); + console.log(response); + } + + callGetAppVersion(); + // [END ces_v1_generated_AgentService_GetAppVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_changelog.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_changelog.js new file mode 100644 index 00000000000..d38efa4eeff --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_changelog.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1_generated_AgentService_GetChangelog_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the changelog to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetChangelog() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getChangelog(request); + console.log(response); + } + + callGetChangelog(); + // [END ces_v1_generated_AgentService_GetChangelog_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_conversation.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_conversation.js new file mode 100644 index 00000000000..8e502fa889e --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_conversation.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1_generated_AgentService_GetConversation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the conversation to retrieve. + */ + // const name = 'abc123' + /** + * Optional. Indicate the source of the conversation. If not set, all source + * will be searched. + */ + // const source = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetConversation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getConversation(request); + console.log(response); + } + + callGetConversation(); + // [END ces_v1_generated_AgentService_GetConversation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_deployment.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_deployment.js new file mode 100644 index 00000000000..9f993c7ce65 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_deployment.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1_generated_AgentService_GetDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 deployment. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getDeployment(request); + console.log(response); + } + + callGetDeployment(); + // [END ces_v1_generated_AgentService_GetDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_example.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_example.js new file mode 100644 index 00000000000..1856898ef68 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_example.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1_generated_AgentService_GetExample_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the example to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetExample() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getExample(request); + console.log(response); + } + + callGetExample(); + // [END ces_v1_generated_AgentService_GetExample_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_guardrail.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_guardrail.js new file mode 100644 index 00000000000..b08309ea583 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_guardrail.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1_generated_AgentService_GetGuardrail_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the guardrail to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetGuardrail() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getGuardrail(request); + console.log(response); + } + + callGetGuardrail(); + // [END ces_v1_generated_AgentService_GetGuardrail_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_tool.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_tool.js new file mode 100644 index 00000000000..80dc2f0c2c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_tool.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1_generated_AgentService_GetTool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the tool to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetTool() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getTool(request); + console.log(response); + } + + callGetTool(); + // [END ces_v1_generated_AgentService_GetTool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_toolset.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_toolset.js new file mode 100644 index 00000000000..945c20b3838 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_toolset.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1_generated_AgentService_GetToolset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the toolset to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetToolset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getToolset(request); + console.log(response); + } + + callGetToolset(); + // [END ces_v1_generated_AgentService_GetToolset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.import_app.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.import_app.js new file mode 100644 index 00000000000..00bb31645ae --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.import_app.js @@ -0,0 +1,102 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START ces_v1_generated_AgentService_ImportApp_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The Google Cloud Storage (https://cloud.google.com/storage/docs/) URI + * from which to import app. The format of this URI must be + * `gs:///`. + */ + // const gcsUri = 'abc123' + /** + * Raw bytes representing the compressed zip file with the app folder + * structure. + */ + // const appContent = Buffer.from('string') + /** + * Required. The parent resource name with the location of the app to import. + */ + // const parent = 'abc123' + /** + * Optional. The display name of the app to import. + * * If the app is created on import, and the display name is specified, + * the imported app will use this display name. If a conflict is detected + * with an existing app, a timestamp will be appended to the display name + * to make it unique. + * * If the app is a reimport, this field should not be set. Providing a + * display name during reimport will result in an INVALID_ARGUMENT error. + */ + // const displayName = 'abc123' + /** + * Optional. The ID to use for the imported app. + * * If not specified, a unique ID will be automatically assigned for + * the app. + * * Otherwise, the imported app will use this ID as the final component of + * its resource name. If an app with the same ID already exists at the + * specified location in the project, the content of the existing app will be + * replaced. + */ + // const appId = 'abc123' + /** + * Optional. Options governing the import process for the app. + */ + // const importOptions = {} + /** + * Optional. Flag for overriding the app lock during import. + * If set to true, the import process will ignore the app lock. + */ + // const ignoreAppLock = true + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callImportApp() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cesClient.importApp(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportApp(); + // [END ces_v1_generated_AgentService_ImportApp_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_agents.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_agents.js new file mode 100644 index 00000000000..631134f46cb --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_agents.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1_generated_AgentService_ListAgents_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list agents from. + */ + // 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. The + * next_page_token google.cloud.ces.v1.ListAgentsResponse.next_page_token + * value returned from a previous list + * AgentService.ListAgents google.cloud.ces.v1.AgentService.ListAgents + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the agents. + * See https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListAgents() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listAgentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAgents(); + // [END ces_v1_generated_AgentService_ListAgents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_app_versions.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_app_versions.js new file mode 100644 index 00000000000..0ccdbab2955 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_app_versions.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1_generated_AgentService_ListAppVersions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list app versions from. + */ + // 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. The + * next_page_token google.cloud.ces.v1.ListAppVersionsResponse.next_page_token + * value returned from a previous list + * AgentService.ListAppVersions google.cloud.ces.v1.AgentService.ListAppVersions + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the app versions. + * See https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListAppVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listAppVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAppVersions(); + // [END ces_v1_generated_AgentService_ListAppVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_apps.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_apps.js new file mode 100644 index 00000000000..33b3b60360c --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_apps.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START ces_v1_generated_AgentService_ListApps_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the location to list apps from. + */ + // 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. The + * next_page_token google.cloud.ces.v1.ListAppsResponse.next_page_token + * value returned from a previous list + * AgentService.ListApps google.cloud.ces.v1.AgentService.ListApps call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the apps. + * See https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListApps() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listAppsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApps(); + // [END ces_v1_generated_AgentService_ListApps_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_changelogs.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_changelogs.js new file mode 100644 index 00000000000..311eab3ac25 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_changelogs.js @@ -0,0 +1,98 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1_generated_AgentService_ListChangelogs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list changelogs from. + */ + // 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. The + * next_page_token google.cloud.ces.v1.ListChangelogsResponse.next_page_token + * value returned from a previous list + * AgentService.ListChangelogs google.cloud.ces.v1.AgentService.ListChangelogs + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the changelogs. + * See https://google.aip.dev/160 for more details. + * The filter string can be used to filter by `action`, `resource_type`, + * `resource_name`, `author`, and `create_time`. + * The `:` comparator can be used for case-insensitive partial matching on + * string fields, while `=` performs an exact case-sensitive match. + * Examples: + * * `action:update` (case-insensitive partial match) + * * `action="Create"` (case-sensitive exact match) + * * `resource_type:agent` + * * `resource_name:my-agent` + * * `author:me@example.com` + * * `create_time > "2025-01-01T00:00:00Z"` + * * `create_time <= "2025-01-01T00:00:00Z" AND resource_type:tool` + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListChangelogs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listChangelogsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListChangelogs(); + // [END ces_v1_generated_AgentService_ListChangelogs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_conversations.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_conversations.js new file mode 100644 index 00000000000..9267c18b2c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_conversations.js @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START ces_v1_generated_AgentService_ListConversations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list conversations from. + */ + // 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. The + * next_page_token google.cloud.ces.v1.ListConversationsResponse.next_page_token + * value returned from a previous list + * AgentService.ListConversations google.cloud.ces.v1.AgentService.ListConversations + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the conversations. + * See https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Indicate the source of the conversation. If not set, Source.Live + * will be applied by default. Will be deprecated in favor of `sources` field. + */ + // const source = {} + /** + * Optional. Indicate the sources of the conversations. If not set, all + * available sources will be applied by default. + */ + // const sources = [1,2,3,4] + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListConversations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listConversationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListConversations(); + // [END ces_v1_generated_AgentService_ListConversations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_deployments.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_deployments.js new file mode 100644 index 00000000000..bf9a075b0e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_deployments.js @@ -0,0 +1,84 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START ces_v1_generated_AgentService_ListDeployments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 parent app. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of deployments to return. The service may + * return fewer than this value. If unspecified, at most 50 deployments will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDeployments` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDeployments(); + // [END ces_v1_generated_AgentService_ListDeployments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_examples.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_examples.js new file mode 100644 index 00000000000..4dee4c99462 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_examples.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1_generated_AgentService_ListExamples_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list examples from. + */ + // 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. The + * next_page_token google.cloud.ces.v1.ListExamplesResponse.next_page_token + * value returned from a previous list + * AgentService.ListExamples google.cloud.ces.v1.AgentService.ListExamples + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the examples. + * See https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListExamples() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listExamplesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListExamples(); + // [END ces_v1_generated_AgentService_ListExamples_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_guardrails.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_guardrails.js new file mode 100644 index 00000000000..a0d5bb9f4ba --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_guardrails.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1_generated_AgentService_ListGuardrails_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list guardrails from. + */ + // 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. The + * next_page_token google.cloud.ces.v1.ListGuardrailsResponse.next_page_token + * value returned from a previous list + * AgentService.ListGuardrails google.cloud.ces.v1.AgentService.ListGuardrails + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the guardrails. + * See https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListGuardrails() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listGuardrailsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListGuardrails(); + // [END ces_v1_generated_AgentService_ListGuardrails_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_tools.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_tools.js new file mode 100644 index 00000000000..4198b671859 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_tools.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1_generated_AgentService_ListTools_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list tools from. + */ + // 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. The + * next_page_token google.cloud.ces.v1.ListToolsResponse.next_page_token + * value returned from a previous list + * AgentService.ListTools google.cloud.ces.v1.AgentService.ListTools call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the tools. Use + * "include_system_tools=true" to include system tools in the response. See + * https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListTools() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listToolsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTools(); + // [END ces_v1_generated_AgentService_ListTools_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_toolsets.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_toolsets.js new file mode 100644 index 00000000000..728f2117e93 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_toolsets.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1_generated_AgentService_ListToolsets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list toolsets from. + */ + // 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. The + * next_page_token google.cloud.ces.v1.ListToolsetsResponse.next_page_token + * value returned from a previous list + * AgentService.ListToolsets google.cloud.ces.v1.AgentService.ListToolsets + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the toolsets. + * See https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListToolsets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listToolsetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListToolsets(); + // [END ces_v1_generated_AgentService_ListToolsets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.restore_app_version.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.restore_app_version.js new file mode 100644 index 00000000000..0f81205829a --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.restore_app_version.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1_generated_AgentService_RestoreAppVersion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app version to restore. + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callRestoreAppVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cesClient.restoreAppVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestoreAppVersion(); + // [END ces_v1_generated_AgentService_RestoreAppVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_agent.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_agent.js new file mode 100644 index 00000000000..f4c77701a8e --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_agent.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(agent) { + // [START ces_v1_generated_AgentService_UpdateAgent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 agent to update. + */ + // const agent = {} + /** + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callUpdateAgent() { + // Construct request + const request = { + agent, + }; + + // Run request + const response = await cesClient.updateAgent(request); + console.log(response); + } + + callUpdateAgent(); + // [END ces_v1_generated_AgentService_UpdateAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_app.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_app.js new file mode 100644 index 00000000000..9143030d6ed --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_app.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(app) { + // [START ces_v1_generated_AgentService_UpdateApp_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 app to update. + */ + // const app = {} + /** + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callUpdateApp() { + // Construct request + const request = { + app, + }; + + // Run request + const response = await cesClient.updateApp(request); + console.log(response); + } + + callUpdateApp(); + // [END ces_v1_generated_AgentService_UpdateApp_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_deployment.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_deployment.js new file mode 100644 index 00000000000..b289fda2cf6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_deployment.js @@ -0,0 +1,65 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(deployment) { + // [START ces_v1_generated_AgentService_UpdateDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 deployment to update. + */ + // const deployment = {} + /** + * Optional. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callUpdateDeployment() { + // Construct request + const request = { + deployment, + }; + + // Run request + const response = await cesClient.updateDeployment(request); + console.log(response); + } + + callUpdateDeployment(); + // [END ces_v1_generated_AgentService_UpdateDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_example.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_example.js new file mode 100644 index 00000000000..4441122eaf4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_example.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(example) { + // [START ces_v1_generated_AgentService_UpdateExample_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 example to update. + */ + // const example = {} + /** + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callUpdateExample() { + // Construct request + const request = { + example, + }; + + // Run request + const response = await cesClient.updateExample(request); + console.log(response); + } + + callUpdateExample(); + // [END ces_v1_generated_AgentService_UpdateExample_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_guardrail.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_guardrail.js new file mode 100644 index 00000000000..9d41d7d403d --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_guardrail.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(guardrail) { + // [START ces_v1_generated_AgentService_UpdateGuardrail_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 guardrail to update. + */ + // const guardrail = {} + /** + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callUpdateGuardrail() { + // Construct request + const request = { + guardrail, + }; + + // Run request + const response = await cesClient.updateGuardrail(request); + console.log(response); + } + + callUpdateGuardrail(); + // [END ces_v1_generated_AgentService_UpdateGuardrail_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_tool.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_tool.js new file mode 100644 index 00000000000..46152b20751 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_tool.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(tool) { + // [START ces_v1_generated_AgentService_UpdateTool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 tool to update. + */ + // const tool = {} + /** + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callUpdateTool() { + // Construct request + const request = { + tool, + }; + + // Run request + const response = await cesClient.updateTool(request); + console.log(response); + } + + callUpdateTool(); + // [END ces_v1_generated_AgentService_UpdateTool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_toolset.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_toolset.js new file mode 100644 index 00000000000..b1dba2bbddd --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_toolset.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(toolset) { + // [START ces_v1_generated_AgentService_UpdateToolset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 toolset to update. + */ + // const toolset = {} + /** + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callUpdateToolset() { + // Construct request + const request = { + toolset, + }; + + // Run request + const response = await cesClient.updateToolset(request); + console.log(response); + } + + callUpdateToolset(); + // [END ces_v1_generated_AgentService_UpdateToolset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/session_service.bidi_run_session.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/session_service.bidi_run_session.js new file mode 100644 index 00000000000..1c989079045 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/session_service.bidi_run_session.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START ces_v1_generated_SessionService_BidiRunSession_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 initial config message for the session. + */ + // const config = {} + /** + * Optional. Realtime input for the session. + */ + // const realtimeInput = {} + + // Imports the Ces library + const {SessionServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new SessionServiceClient(); + + async function callBidiRunSession() { + // Construct request + const request = { + }; + + // Run request + const stream = await cesClient.bidiRunSession(); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + stream.write(request); + stream.end(); + } + + callBidiRunSession(); + // [END ces_v1_generated_SessionService_BidiRunSession_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/session_service.run_session.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/session_service.run_session.js new file mode 100644 index 00000000000..ff2ec5894a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/session_service.run_session.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(config, inputs) { + // [START ces_v1_generated_SessionService_RunSession_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 configuration for the session. + */ + // const config = {} + /** + * Required. Inputs for the session. + */ + // const inputs = [1,2,3,4] + + // Imports the Ces library + const {SessionServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new SessionServiceClient(); + + async function callRunSession() { + // Construct request + const request = { + config, + inputs, + }; + + // Run request + const response = await cesClient.runSession(request); + console.log(response); + } + + callRunSession(); + // [END ces_v1_generated_SessionService_RunSession_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/snippet_metadata_google.cloud.ces.v1.json b/owl-bot-staging/google-cloud-ces/samples/generated/v1/snippet_metadata_google.cloud.ces.v1.json new file mode 100644 index 00000000000..f42ad2854a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/snippet_metadata_google.cloud.ces.v1.json @@ -0,0 +1,2559 @@ +{ + "clientLibrary": { + "name": "nodejs-ces", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.ces.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "ces_v1_generated_AgentService_ListApps_async", + "title": "AgentService listApps Sample", + "origin": "API_DEFINITION", + "description": " Lists apps in the given project and location.", + "canonical": true, + "file": "agent_service.list_apps.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApps", + "fullName": "google.cloud.ces.v1.AgentService.ListApps", + "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.ces.v1.ListAppsResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "ListApps", + "fullName": "google.cloud.ces.v1.AgentService.ListApps", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_GetApp_async", + "title": "AgentService getApp Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified app.", + "canonical": true, + "file": "agent_service.get_app.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApp", + "fullName": "google.cloud.ces.v1.AgentService.GetApp", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1.App", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "GetApp", + "fullName": "google.cloud.ces.v1.AgentService.GetApp", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_CreateApp_async", + "title": "AgentService createApp Sample", + "origin": "API_DEFINITION", + "description": " Creates a new app in the given project and location.", + "canonical": true, + "file": "agent_service.create_app.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApp", + "fullName": "google.cloud.ces.v1.AgentService.CreateApp", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "app_id", + "type": "TYPE_STRING" + }, + { + "name": "app", + "type": ".google.cloud.ces.v1.App" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "CreateApp", + "fullName": "google.cloud.ces.v1.AgentService.CreateApp", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_UpdateApp_async", + "title": "AgentService updateApp Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified app.", + "canonical": true, + "file": "agent_service.update_app.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApp", + "fullName": "google.cloud.ces.v1.AgentService.UpdateApp", + "async": true, + "parameters": [ + { + "name": "app", + "type": ".google.cloud.ces.v1.App" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.ces.v1.App", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "UpdateApp", + "fullName": "google.cloud.ces.v1.AgentService.UpdateApp", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_DeleteApp_async", + "title": "AgentService deleteApp Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified app.", + "canonical": true, + "file": "agent_service.delete_app.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApp", + "fullName": "google.cloud.ces.v1.AgentService.DeleteApp", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "DeleteApp", + "fullName": "google.cloud.ces.v1.AgentService.DeleteApp", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_ExportApp_async", + "title": "AgentService exportApp Sample", + "origin": "API_DEFINITION", + "description": " Exports the specified app.", + "canonical": true, + "file": "agent_service.export_app.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportApp", + "fullName": "google.cloud.ces.v1.AgentService.ExportApp", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "export_format", + "type": ".google.cloud.ces.v1.ExportAppRequest.ExportFormat" + }, + { + "name": "gcs_uri", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "ExportApp", + "fullName": "google.cloud.ces.v1.AgentService.ExportApp", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_ImportApp_async", + "title": "AgentService importApp Sample", + "origin": "API_DEFINITION", + "description": " Imports the specified app.", + "canonical": true, + "file": "agent_service.import_app.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 94, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportApp", + "fullName": "google.cloud.ces.v1.AgentService.ImportApp", + "async": true, + "parameters": [ + { + "name": "gcs_uri", + "type": "TYPE_STRING" + }, + { + "name": "app_content", + "type": "TYPE_BYTES" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "display_name", + "type": "TYPE_STRING" + }, + { + "name": "app_id", + "type": "TYPE_STRING" + }, + { + "name": "import_options", + "type": ".google.cloud.ces.v1.ImportAppRequest.ImportOptions" + }, + { + "name": "ignore_app_lock", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "ImportApp", + "fullName": "google.cloud.ces.v1.AgentService.ImportApp", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_ListAgents_async", + "title": "AgentService listAgents Sample", + "origin": "API_DEFINITION", + "description": " Lists agents in the given app.", + "canonical": true, + "file": "agent_service.list_agents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAgents", + "fullName": "google.cloud.ces.v1.AgentService.ListAgents", + "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.ces.v1.ListAgentsResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "ListAgents", + "fullName": "google.cloud.ces.v1.AgentService.ListAgents", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_GetAgent_async", + "title": "AgentService getAgent Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified agent.", + "canonical": true, + "file": "agent_service.get_agent.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAgent", + "fullName": "google.cloud.ces.v1.AgentService.GetAgent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1.Agent", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "GetAgent", + "fullName": "google.cloud.ces.v1.AgentService.GetAgent", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_CreateAgent_async", + "title": "AgentService createAgent Sample", + "origin": "API_DEFINITION", + "description": " Creates a new agent in the given app.", + "canonical": true, + "file": "agent_service.create_agent.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAgent", + "fullName": "google.cloud.ces.v1.AgentService.CreateAgent", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "agent_id", + "type": "TYPE_STRING" + }, + { + "name": "agent", + "type": ".google.cloud.ces.v1.Agent" + } + ], + "resultType": ".google.cloud.ces.v1.Agent", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "CreateAgent", + "fullName": "google.cloud.ces.v1.AgentService.CreateAgent", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_UpdateAgent_async", + "title": "AgentService updateAgent Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified agent.", + "canonical": true, + "file": "agent_service.update_agent.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAgent", + "fullName": "google.cloud.ces.v1.AgentService.UpdateAgent", + "async": true, + "parameters": [ + { + "name": "agent", + "type": ".google.cloud.ces.v1.Agent" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.ces.v1.Agent", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "UpdateAgent", + "fullName": "google.cloud.ces.v1.AgentService.UpdateAgent", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_DeleteAgent_async", + "title": "AgentService deleteAgent Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified agent.", + "canonical": true, + "file": "agent_service.delete_agent.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAgent", + "fullName": "google.cloud.ces.v1.AgentService.DeleteAgent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "DeleteAgent", + "fullName": "google.cloud.ces.v1.AgentService.DeleteAgent", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_ListExamples_async", + "title": "AgentService listExamples Sample", + "origin": "API_DEFINITION", + "description": " Lists examples in the given app.", + "canonical": true, + "file": "agent_service.list_examples.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListExamples", + "fullName": "google.cloud.ces.v1.AgentService.ListExamples", + "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.ces.v1.ListExamplesResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "ListExamples", + "fullName": "google.cloud.ces.v1.AgentService.ListExamples", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_GetExample_async", + "title": "AgentService getExample Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified example.", + "canonical": true, + "file": "agent_service.get_example.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetExample", + "fullName": "google.cloud.ces.v1.AgentService.GetExample", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1.Example", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "GetExample", + "fullName": "google.cloud.ces.v1.AgentService.GetExample", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_CreateExample_async", + "title": "AgentService createExample Sample", + "origin": "API_DEFINITION", + "description": " Creates a new example in the given app.", + "canonical": true, + "file": "agent_service.create_example.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateExample", + "fullName": "google.cloud.ces.v1.AgentService.CreateExample", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "example_id", + "type": "TYPE_STRING" + }, + { + "name": "example", + "type": ".google.cloud.ces.v1.Example" + } + ], + "resultType": ".google.cloud.ces.v1.Example", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "CreateExample", + "fullName": "google.cloud.ces.v1.AgentService.CreateExample", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_UpdateExample_async", + "title": "AgentService updateExample Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified example.", + "canonical": true, + "file": "agent_service.update_example.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateExample", + "fullName": "google.cloud.ces.v1.AgentService.UpdateExample", + "async": true, + "parameters": [ + { + "name": "example", + "type": ".google.cloud.ces.v1.Example" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.ces.v1.Example", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "UpdateExample", + "fullName": "google.cloud.ces.v1.AgentService.UpdateExample", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_DeleteExample_async", + "title": "AgentService deleteExample Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified example.", + "canonical": true, + "file": "agent_service.delete_example.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteExample", + "fullName": "google.cloud.ces.v1.AgentService.DeleteExample", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "DeleteExample", + "fullName": "google.cloud.ces.v1.AgentService.DeleteExample", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_ListTools_async", + "title": "AgentService listTools Sample", + "origin": "API_DEFINITION", + "description": " Lists tools in the given app.", + "canonical": true, + "file": "agent_service.list_tools.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTools", + "fullName": "google.cloud.ces.v1.AgentService.ListTools", + "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.ces.v1.ListToolsResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "ListTools", + "fullName": "google.cloud.ces.v1.AgentService.ListTools", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_GetTool_async", + "title": "AgentService getTool Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified tool.", + "canonical": true, + "file": "agent_service.get_tool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTool", + "fullName": "google.cloud.ces.v1.AgentService.GetTool", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1.Tool", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "GetTool", + "fullName": "google.cloud.ces.v1.AgentService.GetTool", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_ListConversations_async", + "title": "AgentService listConversations Sample", + "origin": "API_DEFINITION", + "description": " Lists conversations in the given app.", + "canonical": true, + "file": "agent_service.list_conversations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListConversations", + "fullName": "google.cloud.ces.v1.AgentService.ListConversations", + "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": "source", + "type": ".google.cloud.ces.v1.Conversation.Source" + }, + { + "name": "sources", + "type": "TYPE_ENUM[]" + } + ], + "resultType": ".google.cloud.ces.v1.ListConversationsResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "ListConversations", + "fullName": "google.cloud.ces.v1.AgentService.ListConversations", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_GetConversation_async", + "title": "AgentService getConversation Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified conversation.", + "canonical": true, + "file": "agent_service.get_conversation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConversation", + "fullName": "google.cloud.ces.v1.AgentService.GetConversation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "source", + "type": ".google.cloud.ces.v1.Conversation.Source" + } + ], + "resultType": ".google.cloud.ces.v1.Conversation", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "GetConversation", + "fullName": "google.cloud.ces.v1.AgentService.GetConversation", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_DeleteConversation_async", + "title": "AgentService deleteConversation Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified conversation.", + "canonical": true, + "file": "agent_service.delete_conversation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteConversation", + "fullName": "google.cloud.ces.v1.AgentService.DeleteConversation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "source", + "type": ".google.cloud.ces.v1.Conversation.Source" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "DeleteConversation", + "fullName": "google.cloud.ces.v1.AgentService.DeleteConversation", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_BatchDeleteConversations_async", + "title": "AgentService batchDeleteConversations Sample", + "origin": "API_DEFINITION", + "description": " Batch deletes the specified conversations.", + "canonical": true, + "file": "agent_service.batch_delete_conversations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchDeleteConversations", + "fullName": "google.cloud.ces.v1.AgentService.BatchDeleteConversations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "conversations", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "BatchDeleteConversations", + "fullName": "google.cloud.ces.v1.AgentService.BatchDeleteConversations", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_CreateTool_async", + "title": "AgentService createTool Sample", + "origin": "API_DEFINITION", + "description": " Creates a new tool in the given app.", + "canonical": true, + "file": "agent_service.create_tool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTool", + "fullName": "google.cloud.ces.v1.AgentService.CreateTool", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "tool_id", + "type": "TYPE_STRING" + }, + { + "name": "tool", + "type": ".google.cloud.ces.v1.Tool" + } + ], + "resultType": ".google.cloud.ces.v1.Tool", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "CreateTool", + "fullName": "google.cloud.ces.v1.AgentService.CreateTool", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_UpdateTool_async", + "title": "AgentService updateTool Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified tool.", + "canonical": true, + "file": "agent_service.update_tool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTool", + "fullName": "google.cloud.ces.v1.AgentService.UpdateTool", + "async": true, + "parameters": [ + { + "name": "tool", + "type": ".google.cloud.ces.v1.Tool" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.ces.v1.Tool", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "UpdateTool", + "fullName": "google.cloud.ces.v1.AgentService.UpdateTool", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_DeleteTool_async", + "title": "AgentService deleteTool Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified tool.", + "canonical": true, + "file": "agent_service.delete_tool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTool", + "fullName": "google.cloud.ces.v1.AgentService.DeleteTool", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "DeleteTool", + "fullName": "google.cloud.ces.v1.AgentService.DeleteTool", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_ListGuardrails_async", + "title": "AgentService listGuardrails Sample", + "origin": "API_DEFINITION", + "description": " Lists guardrails in the given app.", + "canonical": true, + "file": "agent_service.list_guardrails.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGuardrails", + "fullName": "google.cloud.ces.v1.AgentService.ListGuardrails", + "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.ces.v1.ListGuardrailsResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "ListGuardrails", + "fullName": "google.cloud.ces.v1.AgentService.ListGuardrails", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_GetGuardrail_async", + "title": "AgentService getGuardrail Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified guardrail.", + "canonical": true, + "file": "agent_service.get_guardrail.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGuardrail", + "fullName": "google.cloud.ces.v1.AgentService.GetGuardrail", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1.Guardrail", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "GetGuardrail", + "fullName": "google.cloud.ces.v1.AgentService.GetGuardrail", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_CreateGuardrail_async", + "title": "AgentService createGuardrail Sample", + "origin": "API_DEFINITION", + "description": " Creates a new guardrail in the given app.", + "canonical": true, + "file": "agent_service.create_guardrail.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGuardrail", + "fullName": "google.cloud.ces.v1.AgentService.CreateGuardrail", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "guardrail_id", + "type": "TYPE_STRING" + }, + { + "name": "guardrail", + "type": ".google.cloud.ces.v1.Guardrail" + } + ], + "resultType": ".google.cloud.ces.v1.Guardrail", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "CreateGuardrail", + "fullName": "google.cloud.ces.v1.AgentService.CreateGuardrail", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_UpdateGuardrail_async", + "title": "AgentService updateGuardrail Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified guardrail.", + "canonical": true, + "file": "agent_service.update_guardrail.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateGuardrail", + "fullName": "google.cloud.ces.v1.AgentService.UpdateGuardrail", + "async": true, + "parameters": [ + { + "name": "guardrail", + "type": ".google.cloud.ces.v1.Guardrail" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.ces.v1.Guardrail", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "UpdateGuardrail", + "fullName": "google.cloud.ces.v1.AgentService.UpdateGuardrail", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_DeleteGuardrail_async", + "title": "AgentService deleteGuardrail Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified guardrail.", + "canonical": true, + "file": "agent_service.delete_guardrail.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGuardrail", + "fullName": "google.cloud.ces.v1.AgentService.DeleteGuardrail", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "DeleteGuardrail", + "fullName": "google.cloud.ces.v1.AgentService.DeleteGuardrail", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_ListDeployments_async", + "title": "AgentService listDeployments Sample", + "origin": "API_DEFINITION", + "description": " Lists deployments in the given app.", + "canonical": true, + "file": "agent_service.list_deployments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDeployments", + "fullName": "google.cloud.ces.v1.AgentService.ListDeployments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1.ListDeploymentsResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "ListDeployments", + "fullName": "google.cloud.ces.v1.AgentService.ListDeployments", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_GetDeployment_async", + "title": "AgentService getDeployment Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified deployment.", + "canonical": true, + "file": "agent_service.get_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDeployment", + "fullName": "google.cloud.ces.v1.AgentService.GetDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1.Deployment", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "GetDeployment", + "fullName": "google.cloud.ces.v1.AgentService.GetDeployment", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_CreateDeployment_async", + "title": "AgentService createDeployment Sample", + "origin": "API_DEFINITION", + "description": " Creates a new deployment in the given app.", + "canonical": true, + "file": "agent_service.create_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDeployment", + "fullName": "google.cloud.ces.v1.AgentService.CreateDeployment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "deployment_id", + "type": "TYPE_STRING" + }, + { + "name": "deployment", + "type": ".google.cloud.ces.v1.Deployment" + } + ], + "resultType": ".google.cloud.ces.v1.Deployment", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "CreateDeployment", + "fullName": "google.cloud.ces.v1.AgentService.CreateDeployment", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_UpdateDeployment_async", + "title": "AgentService updateDeployment Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified deployment.", + "canonical": true, + "file": "agent_service.update_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDeployment", + "fullName": "google.cloud.ces.v1.AgentService.UpdateDeployment", + "async": true, + "parameters": [ + { + "name": "deployment", + "type": ".google.cloud.ces.v1.Deployment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.ces.v1.Deployment", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "UpdateDeployment", + "fullName": "google.cloud.ces.v1.AgentService.UpdateDeployment", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_DeleteDeployment_async", + "title": "AgentService deleteDeployment Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified deployment.", + "canonical": true, + "file": "agent_service.delete_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDeployment", + "fullName": "google.cloud.ces.v1.AgentService.DeleteDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "DeleteDeployment", + "fullName": "google.cloud.ces.v1.AgentService.DeleteDeployment", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_ListToolsets_async", + "title": "AgentService listToolsets Sample", + "origin": "API_DEFINITION", + "description": " Lists toolsets in the given app.", + "canonical": true, + "file": "agent_service.list_toolsets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListToolsets", + "fullName": "google.cloud.ces.v1.AgentService.ListToolsets", + "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.ces.v1.ListToolsetsResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "ListToolsets", + "fullName": "google.cloud.ces.v1.AgentService.ListToolsets", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_GetToolset_async", + "title": "AgentService getToolset Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified toolset.", + "canonical": true, + "file": "agent_service.get_toolset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetToolset", + "fullName": "google.cloud.ces.v1.AgentService.GetToolset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1.Toolset", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "GetToolset", + "fullName": "google.cloud.ces.v1.AgentService.GetToolset", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_CreateToolset_async", + "title": "AgentService createToolset Sample", + "origin": "API_DEFINITION", + "description": " Creates a new toolset in the given app.", + "canonical": true, + "file": "agent_service.create_toolset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateToolset", + "fullName": "google.cloud.ces.v1.AgentService.CreateToolset", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "toolset_id", + "type": "TYPE_STRING" + }, + { + "name": "toolset", + "type": ".google.cloud.ces.v1.Toolset" + } + ], + "resultType": ".google.cloud.ces.v1.Toolset", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "CreateToolset", + "fullName": "google.cloud.ces.v1.AgentService.CreateToolset", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_UpdateToolset_async", + "title": "AgentService updateToolset Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified toolset.", + "canonical": true, + "file": "agent_service.update_toolset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateToolset", + "fullName": "google.cloud.ces.v1.AgentService.UpdateToolset", + "async": true, + "parameters": [ + { + "name": "toolset", + "type": ".google.cloud.ces.v1.Toolset" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.ces.v1.Toolset", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "UpdateToolset", + "fullName": "google.cloud.ces.v1.AgentService.UpdateToolset", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_DeleteToolset_async", + "title": "AgentService deleteToolset Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified toolset.", + "canonical": true, + "file": "agent_service.delete_toolset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteToolset", + "fullName": "google.cloud.ces.v1.AgentService.DeleteToolset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "DeleteToolset", + "fullName": "google.cloud.ces.v1.AgentService.DeleteToolset", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_ListAppVersions_async", + "title": "AgentService listAppVersions Sample", + "origin": "API_DEFINITION", + "description": " Lists all app versions in the given app.", + "canonical": true, + "file": "agent_service.list_app_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAppVersions", + "fullName": "google.cloud.ces.v1.AgentService.ListAppVersions", + "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.ces.v1.ListAppVersionsResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "ListAppVersions", + "fullName": "google.cloud.ces.v1.AgentService.ListAppVersions", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_GetAppVersion_async", + "title": "AgentService getAppVersion Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified app version.", + "canonical": true, + "file": "agent_service.get_app_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAppVersion", + "fullName": "google.cloud.ces.v1.AgentService.GetAppVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1.AppVersion", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "GetAppVersion", + "fullName": "google.cloud.ces.v1.AgentService.GetAppVersion", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_CreateAppVersion_async", + "title": "AgentService createAppVersion Sample", + "origin": "API_DEFINITION", + "description": " Creates a new app version in the given app.", + "canonical": true, + "file": "agent_service.create_app_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAppVersion", + "fullName": "google.cloud.ces.v1.AgentService.CreateAppVersion", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "app_version_id", + "type": "TYPE_STRING" + }, + { + "name": "app_version", + "type": ".google.cloud.ces.v1.AppVersion" + } + ], + "resultType": ".google.cloud.ces.v1.AppVersion", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "CreateAppVersion", + "fullName": "google.cloud.ces.v1.AgentService.CreateAppVersion", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_DeleteAppVersion_async", + "title": "AgentService deleteAppVersion Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified app version.", + "canonical": true, + "file": "agent_service.delete_app_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAppVersion", + "fullName": "google.cloud.ces.v1.AgentService.DeleteAppVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "DeleteAppVersion", + "fullName": "google.cloud.ces.v1.AgentService.DeleteAppVersion", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_RestoreAppVersion_async", + "title": "AgentService restoreAppVersion Sample", + "origin": "API_DEFINITION", + "description": " Restores the specified app version. This will create a new app version from the current draft app and overwrite the current draft with the specified app version.", + "canonical": true, + "file": "agent_service.restore_app_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreAppVersion", + "fullName": "google.cloud.ces.v1.AgentService.RestoreAppVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "RestoreAppVersion", + "fullName": "google.cloud.ces.v1.AgentService.RestoreAppVersion", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_ListChangelogs_async", + "title": "AgentService listChangelogs Sample", + "origin": "API_DEFINITION", + "description": " Lists the changelogs of the specified app.", + "canonical": true, + "file": "agent_service.list_changelogs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 90, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListChangelogs", + "fullName": "google.cloud.ces.v1.AgentService.ListChangelogs", + "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.ces.v1.ListChangelogsResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "ListChangelogs", + "fullName": "google.cloud.ces.v1.AgentService.ListChangelogs", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_AgentService_GetChangelog_async", + "title": "AgentService getChangelog Sample", + "origin": "API_DEFINITION", + "description": " Gets the specified changelog.", + "canonical": true, + "file": "agent_service.get_changelog.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetChangelog", + "fullName": "google.cloud.ces.v1.AgentService.GetChangelog", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1.Changelog", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1.AgentServiceClient" + }, + "method": { + "shortName": "GetChangelog", + "fullName": "google.cloud.ces.v1.AgentService.GetChangelog", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_SessionService_RunSession_async", + "title": "AgentService runSession Sample", + "origin": "API_DEFINITION", + "description": " Initiates a single turn interaction with the CES agent within a session.", + "canonical": true, + "file": "session_service.run_session.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunSession", + "fullName": "google.cloud.ces.v1.SessionService.RunSession", + "async": true, + "parameters": [ + { + "name": "config", + "type": ".google.cloud.ces.v1.SessionConfig" + }, + { + "name": "inputs", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.ces.v1.RunSessionResponse", + "client": { + "shortName": "SessionServiceClient", + "fullName": "google.cloud.ces.v1.SessionServiceClient" + }, + "method": { + "shortName": "RunSession", + "fullName": "google.cloud.ces.v1.SessionService.RunSession", + "service": { + "shortName": "SessionService", + "fullName": "google.cloud.ces.v1.SessionService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_SessionService_BidiRunSession_async", + "title": "AgentService bidiRunSession Sample", + "origin": "API_DEFINITION", + "description": " Establishes a bidirectional streaming connection with the CES agent. The agent processes continuous multimodal inputs (e.g., text, audio) and generates real-time multimodal output streams. --- Client Request Stream --- The client streams requests in the following order: 1. Initialization: The first message must contain [SessionConfig][google.cloud.ces.v1.BidiSessionClientMessage.config]. For audio sessions, this should also include [InputAudioConfig][google.cloud.ces.v1.SessionConfig.input_audio_config] and [OutputAudioConfig][google.cloud.ces.v1.SessionConfig.output_audio_config] to define audio processing and synthesis parameters. 2. Interaction: Subsequent messages stream [SessionInput][google.cloud.ces.v1.BidiSessionClientMessage.realtime_input] containing real-time user input data. 3. Termination: The client should half-close the stream when there is no more user input. It should also half-close upon receiving [EndSession][google.cloud.ces.v1.BidiSessionServerMessage.end_session] or [GoAway][google.cloud.ces.v1.BidiSessionServerMessage.go_away] from the agent. --- Server Response Stream --- For each interaction turn, the agent streams messages in the following sequence: 1. Speech Recognition (First N messages): Contains [RecognitionResult][google.cloud.ces.v1.BidiSessionServerMessage.recognition_result] representing the concatenated user speech segments captured so far. This is only populated for audio sessions. 2. Response (Next M messages): Contains [SessionOutput][google.cloud.ces.v1.BidiSessionServerMessage.session_output] delivering the agent's response in various modalities (e.g., text, audio). 3. Turn Completion (Final message of the turn): Contains [SessionOutput][google.cloud.ces.v1.BidiSessionServerMessage.session_output] with [turn_completed][google.cloud.ces.v1.SessionOutput.turn_completed] set to true. This signals the end of the current turn and includes [DiagnosticInfo][google.cloud.ces.v1.SessionOutput.diagnostic_info] with execution details. --- Audio Best Practices --- 1. Streaming: Stream [audio data][google.cloud.ces.v1.SessionInput.audio] **CONTINUOUSLY**, even during silence. Recommended chunk size: 40-120ms (balances latency vs. efficiency). 2. Playback & Interruption: Play [audio responses][google.cloud.ces.v1.SessionOutput.audio] upon receipt. Stop playback immediately if an [InterruptionSignal][google.cloud.ces.v1.BidiSessionServerMessage.interruption_signal] is received (e.g., user barge-in or new agent response).", + "canonical": true, + "file": "session_service.bidi_run_session.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BidiRunSession", + "fullName": "google.cloud.ces.v1.SessionService.BidiRunSession", + "async": true, + "parameters": [ + { + "name": "config", + "type": ".google.cloud.ces.v1.SessionConfig" + }, + { + "name": "realtime_input", + "type": ".google.cloud.ces.v1.SessionInput" + } + ], + "resultType": ".google.cloud.ces.v1.BidiSessionServerMessage", + "client": { + "shortName": "SessionServiceClient", + "fullName": "google.cloud.ces.v1.SessionServiceClient" + }, + "method": { + "shortName": "BidiRunSession", + "fullName": "google.cloud.ces.v1.SessionService.BidiRunSession", + "service": { + "shortName": "SessionService", + "fullName": "google.cloud.ces.v1.SessionService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_ToolService_ExecuteTool_async", + "title": "AgentService executeTool Sample", + "origin": "API_DEFINITION", + "description": " Executes the given tool with the given arguments.", + "canonical": true, + "file": "tool_service.execute_tool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExecuteTool", + "fullName": "google.cloud.ces.v1.ToolService.ExecuteTool", + "async": true, + "parameters": [ + { + "name": "tool", + "type": "TYPE_STRING" + }, + { + "name": "toolset_tool", + "type": ".google.cloud.ces.v1.ToolsetTool" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "args", + "type": ".google.protobuf.Struct" + } + ], + "resultType": ".google.cloud.ces.v1.ExecuteToolResponse", + "client": { + "shortName": "ToolServiceClient", + "fullName": "google.cloud.ces.v1.ToolServiceClient" + }, + "method": { + "shortName": "ExecuteTool", + "fullName": "google.cloud.ces.v1.ToolService.ExecuteTool", + "service": { + "shortName": "ToolService", + "fullName": "google.cloud.ces.v1.ToolService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_ToolService_RetrieveToolSchema_async", + "title": "AgentService retrieveToolSchema Sample", + "origin": "API_DEFINITION", + "description": " Retrieve the schema of the given tool. The schema is computed on the fly for the given instance of the tool.", + "canonical": true, + "file": "tool_service.retrieve_tool_schema.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RetrieveToolSchema", + "fullName": "google.cloud.ces.v1.ToolService.RetrieveToolSchema", + "async": true, + "parameters": [ + { + "name": "tool", + "type": "TYPE_STRING" + }, + { + "name": "toolset_tool", + "type": ".google.cloud.ces.v1.ToolsetTool" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1.RetrieveToolSchemaResponse", + "client": { + "shortName": "ToolServiceClient", + "fullName": "google.cloud.ces.v1.ToolServiceClient" + }, + "method": { + "shortName": "RetrieveToolSchema", + "fullName": "google.cloud.ces.v1.ToolService.RetrieveToolSchema", + "service": { + "shortName": "ToolService", + "fullName": "google.cloud.ces.v1.ToolService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_ToolService_RetrieveTools_async", + "title": "AgentService retrieveTools Sample", + "origin": "API_DEFINITION", + "description": " Retrieve the list of tools included in the specified toolset.", + "canonical": true, + "file": "tool_service.retrieve_tools.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RetrieveTools", + "fullName": "google.cloud.ces.v1.ToolService.RetrieveTools", + "async": true, + "parameters": [ + { + "name": "toolset", + "type": "TYPE_STRING" + }, + { + "name": "tool_ids", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.ces.v1.RetrieveToolsResponse", + "client": { + "shortName": "ToolServiceClient", + "fullName": "google.cloud.ces.v1.ToolServiceClient" + }, + "method": { + "shortName": "RetrieveTools", + "fullName": "google.cloud.ces.v1.ToolService.RetrieveTools", + "service": { + "shortName": "ToolService", + "fullName": "google.cloud.ces.v1.ToolService" + } + } + } + }, + { + "regionTag": "ces_v1_generated_WidgetService_GenerateChatToken_async", + "title": "AgentService generateChatToken Sample", + "origin": "API_DEFINITION", + "description": " Generates a session scoped token for chat widget to authenticate with Session APIs.", + "canonical": true, + "file": "widget_service.generate_chat_token.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateChatToken", + "fullName": "google.cloud.ces.v1.WidgetService.GenerateChatToken", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "deployment", + "type": "TYPE_STRING" + }, + { + "name": "recaptcha_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1.GenerateChatTokenResponse", + "client": { + "shortName": "WidgetServiceClient", + "fullName": "google.cloud.ces.v1.WidgetServiceClient" + }, + "method": { + "shortName": "GenerateChatToken", + "fullName": "google.cloud.ces.v1.WidgetService.GenerateChatToken", + "service": { + "shortName": "WidgetService", + "fullName": "google.cloud.ces.v1.WidgetService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.execute_tool.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.execute_tool.js new file mode 100644 index 00000000000..b5f6cb6c937 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.execute_tool.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1_generated_ToolService_ExecuteTool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 name of the tool to execute. + * Format: + * projects/{project}/locations/{location}/apps/{app}/tools/{tool} + */ + // const tool = 'abc123' + /** + * Optional. The toolset tool to execute. Only one tool should match the + * predicate from the toolset. Otherwise, an error will be returned. + */ + // const toolsetTool = {} + /** + * Required. The resource name of the app which the tool/toolset belongs to. + * Format: `projects/{project}/locations/{location}/apps/{app}` + */ + // const parent = 'abc123' + /** + * Optional. The input parameters and values for the tool in JSON object + * format. + */ + // const args = {} + + // Imports the Ces library + const {ToolServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new ToolServiceClient(); + + async function callExecuteTool() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await cesClient.executeTool(request); + console.log(response); + } + + callExecuteTool(); + // [END ces_v1_generated_ToolService_ExecuteTool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tool_schema.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tool_schema.js new file mode 100644 index 00000000000..d04df58e449 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tool_schema.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1_generated_ToolService_RetrieveToolSchema_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 name of the tool to retrieve the schema for. + * Format: + * projects/{project}/locations/{location}/apps/{app}/tools/{tool} + */ + // const tool = 'abc123' + /** + * Optional. The toolset tool to retrieve the schema for. Only one tool + * should match the predicate from the toolset. Otherwise, an error will be + * returned. + */ + // const toolsetTool = {} + /** + * Required. The resource name of the app which the tool/toolset belongs to. + * Format: `projects/{project}/locations/{location}/apps/{app}` + */ + // const parent = 'abc123' + + // Imports the Ces library + const {ToolServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new ToolServiceClient(); + + async function callRetrieveToolSchema() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await cesClient.retrieveToolSchema(request); + console.log(response); + } + + callRetrieveToolSchema(); + // [END ces_v1_generated_ToolService_RetrieveToolSchema_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tools.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tools.js new file mode 100644 index 00000000000..517c77442a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tools.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(toolset) { + // [START ces_v1_generated_ToolService_RetrieveTools_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 toolset to retrieve the tools for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + */ + // const toolset = 'abc123' + /** + * Optional. The identifiers of the tools to retrieve from the toolset. + * If empty, all tools in the toolset will be returned. + */ + // const toolIds = ['abc','def'] + + // Imports the Ces library + const {ToolServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new ToolServiceClient(); + + async function callRetrieveTools() { + // Construct request + const request = { + toolset, + }; + + // Run request + const response = await cesClient.retrieveTools(request); + console.log(response); + } + + callRetrieveTools(); + // [END ces_v1_generated_ToolService_RetrieveTools_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/widget_service.generate_chat_token.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/widget_service.generate_chat_token.js new file mode 100644 index 00000000000..c17e0cba557 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1/widget_service.generate_chat_token.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, deployment) { + // [START ces_v1_generated_WidgetService_GenerateChatToken_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 session name to generate the chat token for. + * Format: + * projects/{project}/locations/{location}/apps/{app}/sessions/{session} + */ + // const name = 'abc123' + /** + * Required. The deployment of the app to use for the session. + * Format: + * projects/{project}/locations/{location}/apps/{app}/deployments/{deployment} + */ + // const deployment = 'abc123' + /** + * Optional. The reCAPTCHA token generated by the client-side chat widget. + */ + // const recaptchaToken = 'abc123' + + // Imports the Ces library + const {WidgetServiceClient} = require('@google-cloud/ces').v1; + + // Instantiates a client + const cesClient = new WidgetServiceClient(); + + async function callGenerateChatToken() { + // Construct request + const request = { + name, + deployment, + }; + + // Run request + const response = await cesClient.generateChatToken(request); + console.log(response); + } + + callGenerateChatToken(); + // [END ces_v1_generated_WidgetService_GenerateChatToken_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.batch_delete_conversations.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.batch_delete_conversations.js new file mode 100644 index 00000000000..3b526cae6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.batch_delete_conversations.js @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, conversations) { + // [START ces_v1beta_generated_AgentService_BatchDeleteConversations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to delete conversations from. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + */ + // const parent = 'abc123' + /** + * Required. The resource names of the conversations to delete. + */ + // const conversations = ['abc','def'] + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callBatchDeleteConversations() { + // Construct request + const request = { + parent, + conversations, + }; + + // Run request + const [operation] = await cesClient.batchDeleteConversations(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchDeleteConversations(); + // [END ces_v1beta_generated_AgentService_BatchDeleteConversations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_agent.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_agent.js new file mode 100644 index 00000000000..bb8f12377fb --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_agent.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, agent) { + // [START ces_v1beta_generated_AgentService_CreateAgent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to create an agent in. + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the agent, which will become the final + * component of the agent's resource name. If not provided, a unique ID will + * be automatically assigned for the agent. + */ + // const agentId = 'abc123' + /** + * Required. The agent to create. + */ + // const agent = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callCreateAgent() { + // Construct request + const request = { + parent, + agent, + }; + + // Run request + const response = await cesClient.createAgent(request); + console.log(response); + } + + callCreateAgent(); + // [END ces_v1beta_generated_AgentService_CreateAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_app.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_app.js new file mode 100644 index 00000000000..bb778560c3a --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_app.js @@ -0,0 +1,73 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, app) { + // [START ces_v1beta_generated_AgentService_CreateApp_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the location to create an app in. + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the app, which will become the final component + * of the app's resource name. If not provided, a unique ID will be + * automatically assigned for the app. + */ + // const appId = 'abc123' + /** + * Required. The app to create. + */ + // const app = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callCreateApp() { + // Construct request + const request = { + parent, + app, + }; + + // Run request + const [operation] = await cesClient.createApp(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateApp(); + // [END ces_v1beta_generated_AgentService_CreateApp_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_app_version.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_app_version.js new file mode 100644 index 00000000000..a99a1979646 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_app_version.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, appVersion) { + // [START ces_v1beta_generated_AgentService_CreateAppVersion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to create an app version in. + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the app version, which will become the final + * component of the app version's resource name. If not provided, a unique ID + * will be automatically assigned for the app version. + */ + // const appVersionId = 'abc123' + /** + * Required. The app version to create. + */ + // const appVersion = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callCreateAppVersion() { + // Construct request + const request = { + parent, + appVersion, + }; + + // Run request + const response = await cesClient.createAppVersion(request); + console.log(response); + } + + callCreateAppVersion(); + // [END ces_v1beta_generated_AgentService_CreateAppVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_deployment.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_deployment.js new file mode 100644 index 00000000000..05a50760dc6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_deployment.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, deployment) { + // [START ces_v1beta_generated_AgentService_CreateDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 parent app. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the deployment, which will become the final + * component of the deployment's resource name. If not provided, a unique ID + * will be automatically assigned for the deployment. + */ + // const deploymentId = 'abc123' + /** + * Required. The deployment to create. + */ + // const deployment = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callCreateDeployment() { + // Construct request + const request = { + parent, + deployment, + }; + + // Run request + const response = await cesClient.createDeployment(request); + console.log(response); + } + + callCreateDeployment(); + // [END ces_v1beta_generated_AgentService_CreateDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_example.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_example.js new file mode 100644 index 00000000000..36cf7c7193c --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_example.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, example) { + // [START ces_v1beta_generated_AgentService_CreateExample_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to create an example in. + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the example, which will become the final + * component of the example's resource name. If not provided, a unique ID will + * be automatically assigned for the example. + */ + // const exampleId = 'abc123' + /** + * Required. The example to create. + */ + // const example = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callCreateExample() { + // Construct request + const request = { + parent, + example, + }; + + // Run request + const response = await cesClient.createExample(request); + console.log(response); + } + + callCreateExample(); + // [END ces_v1beta_generated_AgentService_CreateExample_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_guardrail.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_guardrail.js new file mode 100644 index 00000000000..4c99d57f02f --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_guardrail.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, guardrail) { + // [START ces_v1beta_generated_AgentService_CreateGuardrail_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to create a guardrail in. + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the guardrail, which will become the final + * component of the guardrail's resource name. If not provided, a unique ID + * will be automatically assigned for the guardrail. + */ + // const guardrailId = 'abc123' + /** + * Required. The guardrail to create. + */ + // const guardrail = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callCreateGuardrail() { + // Construct request + const request = { + parent, + guardrail, + }; + + // Run request + const response = await cesClient.createGuardrail(request); + console.log(response); + } + + callCreateGuardrail(); + // [END ces_v1beta_generated_AgentService_CreateGuardrail_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_tool.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_tool.js new file mode 100644 index 00000000000..ba41e9d0051 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_tool.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, tool) { + // [START ces_v1beta_generated_AgentService_CreateTool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to create a tool in. + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the tool, which will become the final component + * of the tool's resource name. If not provided, a unique ID will be + * automatically assigned for the tool. + */ + // const toolId = 'abc123' + /** + * Required. The tool to create. + */ + // const tool = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callCreateTool() { + // Construct request + const request = { + parent, + tool, + }; + + // Run request + const response = await cesClient.createTool(request); + console.log(response); + } + + callCreateTool(); + // [END ces_v1beta_generated_AgentService_CreateTool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_toolset.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_toolset.js new file mode 100644 index 00000000000..94fed6e555c --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_toolset.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, toolset) { + // [START ces_v1beta_generated_AgentService_CreateToolset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to create a toolset in. + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the toolset, which will become the final + * component of the toolset's resource name. If not provided, a unique ID will + * be automatically assigned for the toolset. + */ + // const toolsetId = 'abc123' + /** + * Required. The toolset to create. + */ + // const toolset = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callCreateToolset() { + // Construct request + const request = { + parent, + toolset, + }; + + // Run request + const response = await cesClient.createToolset(request); + console.log(response); + } + + callCreateToolset(); + // [END ces_v1beta_generated_AgentService_CreateToolset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_agent.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_agent.js new file mode 100644 index 00000000000..ba82677aca2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_agent.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_AgentService_DeleteAgent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the agent to delete. + */ + // const name = 'abc123' + /** + * Optional. Indicates whether to forcefully delete the agent, even if it is + * still referenced by other app/agents/examples. + * * If `force = false`, the deletion fails if other agents/examples + * reference it. + * * If `force = true`, delete the agent and remove it from all referencing + * apps/agents/examples. + */ + // const force = true + /** + * Optional. The current etag of the agent. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the agent, deletion will be blocked and + * an ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callDeleteAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteAgent(request); + console.log(response); + } + + callDeleteAgent(); + // [END ces_v1beta_generated_AgentService_DeleteAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app.js new file mode 100644 index 00000000000..4dd8a0c26c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app.js @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1beta_generated_AgentService_DeleteApp_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to delete. + */ + // const name = 'abc123' + /** + * Optional. The current etag of the app. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the app, deletion will be blocked and an + * ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callDeleteApp() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cesClient.deleteApp(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteApp(); + // [END ces_v1beta_generated_AgentService_DeleteApp_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app_version.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app_version.js new file mode 100644 index 00000000000..511a91597e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app_version.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1beta_generated_AgentService_DeleteAppVersion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app version to delete. + */ + // const name = 'abc123' + /** + * Optional. The current etag of the app version. If an etag is not provided, + * the deletion will overwrite any concurrent changes. If an etag is provided + * and does not match the current etag of the app version, deletion will be + * blocked and an ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callDeleteAppVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteAppVersion(request); + console.log(response); + } + + callDeleteAppVersion(); + // [END ces_v1beta_generated_AgentService_DeleteAppVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_conversation.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_conversation.js new file mode 100644 index 00000000000..9ad953586c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_conversation.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_AgentService_DeleteConversation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the conversation to delete. + */ + // const name = 'abc123' + /** + * Optional. Indicate the source of the conversation. If not set, Source.Live + * will be applied by default. + */ + // const source = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callDeleteConversation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteConversation(request); + console.log(response); + } + + callDeleteConversation(); + // [END ces_v1beta_generated_AgentService_DeleteConversation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_deployment.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_deployment.js new file mode 100644 index 00000000000..66be289474f --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_deployment.js @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1beta_generated_AgentService_DeleteDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 deployment to delete. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` + */ + // const name = 'abc123' + /** + * Optional. The etag of the deployment. + * If an etag is provided and does not match the current etag of the + * deployment, deletion will be blocked and an ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callDeleteDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteDeployment(request); + console.log(response); + } + + callDeleteDeployment(); + // [END ces_v1beta_generated_AgentService_DeleteDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_example.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_example.js new file mode 100644 index 00000000000..63675b0c286 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_example.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1beta_generated_AgentService_DeleteExample_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the example to delete. + */ + // const name = 'abc123' + /** + * Optional. The current etag of the example. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the example, deletion will be blocked + * and an ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callDeleteExample() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteExample(request); + console.log(response); + } + + callDeleteExample(); + // [END ces_v1beta_generated_AgentService_DeleteExample_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_guardrail.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_guardrail.js new file mode 100644 index 00000000000..ee3b392c438 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_guardrail.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_AgentService_DeleteGuardrail_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the guardrail to delete. + */ + // const name = 'abc123' + /** + * Optional. Indicates whether to forcefully delete the guardrail, even if it + * is still referenced by app/agents. + * * If `force = false`, the deletion fails if any apps/agents still + * reference the guardrail. + * * If `force = true`, all existing references from apps/agents will be + * removed and the guardrail will be deleted. + */ + // const force = true + /** + * Optional. The current etag of the guardrail. If an etag is not provided, + * the deletion will overwrite any concurrent changes. If an etag is provided + * and does not match the current etag of the guardrail, deletion will be + * blocked and an ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callDeleteGuardrail() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteGuardrail(request); + console.log(response); + } + + callDeleteGuardrail(); + // [END ces_v1beta_generated_AgentService_DeleteGuardrail_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_tool.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_tool.js new file mode 100644 index 00000000000..7e5f7882913 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_tool.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_AgentService_DeleteTool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the tool to delete. + */ + // const name = 'abc123' + /** + * Optional. Indicates whether to forcefully delete the tool, even if it is + * still referenced by agents/examples. + * * If `force = false`, the deletion will fail if any agents still + * reference the tool. + * * If `force = true`, all existing references from agents will be removed + * and the tool will be deleted. + */ + // const force = true + /** + * Optional. The current etag of the tool. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the tool, deletion will be blocked and + * an ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callDeleteTool() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteTool(request); + console.log(response); + } + + callDeleteTool(); + // [END ces_v1beta_generated_AgentService_DeleteTool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_toolset.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_toolset.js new file mode 100644 index 00000000000..99049add2dd --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_toolset.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_AgentService_DeleteToolset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the toolset to delete. + */ + // const name = 'abc123' + /** + * Optional. Indicates whether to forcefully delete the toolset, even if it is + * still referenced by app/agents. + * * If `force = false`, the deletion fails if any agents still + * reference the toolset. + * * If `force = true`, all existing references from agents will be + * removed and the toolset will be deleted. + */ + // const force = true + /** + * Optional. The current etag of the toolset. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the toolset, deletion will be blocked + * and an ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callDeleteToolset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteToolset(request); + console.log(response); + } + + callDeleteToolset(); + // [END ces_v1beta_generated_AgentService_DeleteToolset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.export_app.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.export_app.js new file mode 100644 index 00000000000..5bc27edb38e --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.export_app.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, exportFormat) { + // [START ces_v1beta_generated_AgentService_ExportApp_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to export. + */ + // const name = 'abc123' + /** + * Required. The format to export the app in. + */ + // const exportFormat = {} + /** + * Optional. The Google Cloud + * Storage (https://cloud.google.com/storage/docs/) URI to which to export the + * app. The format of this URI must be `gs:///`. The + * exported app archive will be written directly to the specified GCS object. + */ + // const gcsUri = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callExportApp() { + // Construct request + const request = { + name, + exportFormat, + }; + + // Run request + const [operation] = await cesClient.exportApp(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportApp(); + // [END ces_v1beta_generated_AgentService_ExportApp_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_agent.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_agent.js new file mode 100644 index 00000000000..2f48d675cd8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_agent.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_AgentService_GetAgent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the agent to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetAgent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getAgent(request); + console.log(response); + } + + callGetAgent(); + // [END ces_v1beta_generated_AgentService_GetAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_app.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_app.js new file mode 100644 index 00000000000..0ed97b432ef --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_app.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_AgentService_GetApp_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetApp() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getApp(request); + console.log(response); + } + + callGetApp(); + // [END ces_v1beta_generated_AgentService_GetApp_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_app_version.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_app_version.js new file mode 100644 index 00000000000..d41573226e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_app_version.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_AgentService_GetAppVersion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app version to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetAppVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getAppVersion(request); + console.log(response); + } + + callGetAppVersion(); + // [END ces_v1beta_generated_AgentService_GetAppVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_changelog.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_changelog.js new file mode 100644 index 00000000000..a763286d40d --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_changelog.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_AgentService_GetChangelog_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the changelog to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetChangelog() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getChangelog(request); + console.log(response); + } + + callGetChangelog(); + // [END ces_v1beta_generated_AgentService_GetChangelog_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_conversation.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_conversation.js new file mode 100644 index 00000000000..2ac79795e04 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_conversation.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_AgentService_GetConversation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the conversation to retrieve. + */ + // const name = 'abc123' + /** + * Optional. Indicate the source of the conversation. If not set, all source + * will be searched. + */ + // const source = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetConversation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getConversation(request); + console.log(response); + } + + callGetConversation(); + // [END ces_v1beta_generated_AgentService_GetConversation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_deployment.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_deployment.js new file mode 100644 index 00000000000..fb4d25f7068 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_deployment.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1beta_generated_AgentService_GetDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 deployment. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getDeployment(request); + console.log(response); + } + + callGetDeployment(); + // [END ces_v1beta_generated_AgentService_GetDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_example.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_example.js new file mode 100644 index 00000000000..498bd67b0ca --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_example.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_AgentService_GetExample_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the example to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetExample() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getExample(request); + console.log(response); + } + + callGetExample(); + // [END ces_v1beta_generated_AgentService_GetExample_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_guardrail.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_guardrail.js new file mode 100644 index 00000000000..84fe2e3047a --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_guardrail.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_AgentService_GetGuardrail_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the guardrail to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetGuardrail() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getGuardrail(request); + console.log(response); + } + + callGetGuardrail(); + // [END ces_v1beta_generated_AgentService_GetGuardrail_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_tool.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_tool.js new file mode 100644 index 00000000000..ea5995cc3c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_tool.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_AgentService_GetTool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the tool to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetTool() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getTool(request); + console.log(response); + } + + callGetTool(); + // [END ces_v1beta_generated_AgentService_GetTool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_toolset.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_toolset.js new file mode 100644 index 00000000000..90e78f755bc --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_toolset.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_AgentService_GetToolset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the toolset to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGetToolset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getToolset(request); + console.log(response); + } + + callGetToolset(); + // [END ces_v1beta_generated_AgentService_GetToolset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.import_app.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.import_app.js new file mode 100644 index 00000000000..88c56fe875a --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.import_app.js @@ -0,0 +1,102 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START ces_v1beta_generated_AgentService_ImportApp_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The Google Cloud Storage (https://cloud.google.com/storage/docs/) URI + * from which to import app. The format of this URI must be + * `gs:///`. + */ + // const gcsUri = 'abc123' + /** + * Raw bytes representing the compressed zip file with the app folder + * structure. + */ + // const appContent = Buffer.from('string') + /** + * Required. The parent resource name with the location of the app to import. + */ + // const parent = 'abc123' + /** + * Optional. The display name of the app to import. + * * If the app is created on import, and the display name is specified, + * the imported app will use this display name. If a conflict is detected + * with an existing app, a timestamp will be appended to the display name + * to make it unique. + * * If the app is a reimport, this field should not be set. Providing a + * display name during reimport will result in an INVALID_ARGUMENT error. + */ + // const displayName = 'abc123' + /** + * Optional. The ID to use for the imported app. + * * If not specified, a unique ID will be automatically assigned for + * the app. + * * Otherwise, the imported app will use this ID as the final component of + * its resource name. If an app with the same ID already exists at the + * specified location in the project, the content of the existing app will be + * replaced. + */ + // const appId = 'abc123' + /** + * Optional. Options governing the import process for the app. + */ + // const importOptions = {} + /** + * Optional. Flag for overriding the app lock during import. + * If set to true, the import process will ignore the app lock. + */ + // const ignoreAppLock = true + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callImportApp() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cesClient.importApp(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportApp(); + // [END ces_v1beta_generated_AgentService_ImportApp_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_agents.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_agents.js new file mode 100644 index 00000000000..b4d08e18567 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_agents.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1beta_generated_AgentService_ListAgents_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list agents from. + */ + // 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. The + * next_page_token google.cloud.ces.v1beta.ListAgentsResponse.next_page_token + * value returned from a previous list + * AgentService.ListAgents google.cloud.ces.v1beta.AgentService.ListAgents + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the agents. + * See https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListAgents() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listAgentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAgents(); + // [END ces_v1beta_generated_AgentService_ListAgents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_app_versions.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_app_versions.js new file mode 100644 index 00000000000..01d2a69ec9f --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_app_versions.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1beta_generated_AgentService_ListAppVersions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list app versions from. + */ + // 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. The + * next_page_token google.cloud.ces.v1beta.ListAppVersionsResponse.next_page_token + * value returned from a previous list + * AgentService.ListAppVersions google.cloud.ces.v1beta.AgentService.ListAppVersions + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the app versions. + * See https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListAppVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listAppVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAppVersions(); + // [END ces_v1beta_generated_AgentService_ListAppVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_apps.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_apps.js new file mode 100644 index 00000000000..bd52ae83081 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_apps.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1beta_generated_AgentService_ListApps_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the location to list apps from. + */ + // 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. The + * next_page_token google.cloud.ces.v1beta.ListAppsResponse.next_page_token + * value returned from a previous list + * AgentService.ListApps google.cloud.ces.v1beta.AgentService.ListApps + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the apps. + * See https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListApps() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listAppsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApps(); + // [END ces_v1beta_generated_AgentService_ListApps_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_changelogs.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_changelogs.js new file mode 100644 index 00000000000..300afe5f796 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_changelogs.js @@ -0,0 +1,98 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1beta_generated_AgentService_ListChangelogs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list changelogs from. + */ + // 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. The + * next_page_token google.cloud.ces.v1beta.ListChangelogsResponse.next_page_token + * value returned from a previous list + * AgentService.ListChangelogs google.cloud.ces.v1beta.AgentService.ListChangelogs + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the changelogs. + * See https://google.aip.dev/160 for more details. + * The filter string can be used to filter by `action`, `resource_type`, + * `resource_name`, `author`, and `create_time`. + * The `:` comparator can be used for case-insensitive partial matching on + * string fields, while `=` performs an exact case-sensitive match. + * Examples: + * * `action:update` (case-insensitive partial match) + * * `action="Create"` (case-sensitive exact match) + * * `resource_type:agent` + * * `resource_name:my-agent` + * * `author:me@example.com` + * * `create_time > "2025-01-01T00:00:00Z"` + * * `create_time <= "2025-01-01T00:00:00Z" AND resource_type:tool` + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListChangelogs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listChangelogsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListChangelogs(); + // [END ces_v1beta_generated_AgentService_ListChangelogs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_conversations.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_conversations.js new file mode 100644 index 00000000000..9c67103120d --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_conversations.js @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START ces_v1beta_generated_AgentService_ListConversations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list conversations from. + */ + // 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. The + * next_page_token google.cloud.ces.v1beta.ListConversationsResponse.next_page_token + * value returned from a previous list + * AgentService.ListConversations google.cloud.ces.v1beta.AgentService.ListConversations + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the conversations. + * See https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Indicate the source of the conversation. If not set, Source.Live + * will be applied by default. Will be deprecated in favor of `sources` field. + */ + // const source = {} + /** + * Optional. Indicate the sources of the conversations. If not set, all + * available sources will be applied by default. + */ + // const sources = [1,2,3,4] + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListConversations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listConversationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListConversations(); + // [END ces_v1beta_generated_AgentService_ListConversations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_deployments.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_deployments.js new file mode 100644 index 00000000000..abf15e9780b --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_deployments.js @@ -0,0 +1,84 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START ces_v1beta_generated_AgentService_ListDeployments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 parent app. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of deployments to return. The service may + * return fewer than this value. If unspecified, at most 50 deployments will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDeployments` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDeployments(); + // [END ces_v1beta_generated_AgentService_ListDeployments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_examples.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_examples.js new file mode 100644 index 00000000000..a9e38c7a698 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_examples.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1beta_generated_AgentService_ListExamples_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list examples from. + */ + // 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. The + * next_page_token google.cloud.ces.v1beta.ListExamplesResponse.next_page_token + * value returned from a previous list + * AgentService.ListExamples google.cloud.ces.v1beta.AgentService.ListExamples + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the examples. + * See https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListExamples() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listExamplesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListExamples(); + // [END ces_v1beta_generated_AgentService_ListExamples_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_guardrails.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_guardrails.js new file mode 100644 index 00000000000..54bfc68dcab --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_guardrails.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1beta_generated_AgentService_ListGuardrails_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list guardrails from. + */ + // 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. The + * next_page_token google.cloud.ces.v1beta.ListGuardrailsResponse.next_page_token + * value returned from a previous list + * AgentService.ListGuardrails google.cloud.ces.v1beta.AgentService.ListGuardrails + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the guardrails. + * See https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListGuardrails() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listGuardrailsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListGuardrails(); + // [END ces_v1beta_generated_AgentService_ListGuardrails_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_tools.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_tools.js new file mode 100644 index 00000000000..3f361326b7d --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_tools.js @@ -0,0 +1,87 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1beta_generated_AgentService_ListTools_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list tools from. + */ + // 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. The + * next_page_token google.cloud.ces.v1beta.ListToolsResponse.next_page_token + * value returned from a previous list + * AgentService.ListTools google.cloud.ces.v1beta.AgentService.ListTools + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the tools. Use + * "include_system_tools=true" to include system tools in the response. See + * https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListTools() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listToolsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTools(); + // [END ces_v1beta_generated_AgentService_ListTools_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_toolsets.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_toolsets.js new file mode 100644 index 00000000000..64369adb9f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_toolsets.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1beta_generated_AgentService_ListToolsets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list toolsets from. + */ + // 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. The + * next_page_token google.cloud.ces.v1beta.ListToolsetsResponse.next_page_token + * value returned from a previous list + * AgentService.ListToolsets google.cloud.ces.v1beta.AgentService.ListToolsets + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the toolsets. + * See https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callListToolsets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listToolsetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListToolsets(); + // [END ces_v1beta_generated_AgentService_ListToolsets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.restore_app_version.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.restore_app_version.js new file mode 100644 index 00000000000..c4c48ef972d --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.restore_app_version.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_AgentService_RestoreAppVersion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app version to restore. + */ + // const name = 'abc123' + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callRestoreAppVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cesClient.restoreAppVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestoreAppVersion(); + // [END ces_v1beta_generated_AgentService_RestoreAppVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_agent.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_agent.js new file mode 100644 index 00000000000..ad079ca7512 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_agent.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(agent) { + // [START ces_v1beta_generated_AgentService_UpdateAgent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 agent to update. + */ + // const agent = {} + /** + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callUpdateAgent() { + // Construct request + const request = { + agent, + }; + + // Run request + const response = await cesClient.updateAgent(request); + console.log(response); + } + + callUpdateAgent(); + // [END ces_v1beta_generated_AgentService_UpdateAgent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_app.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_app.js new file mode 100644 index 00000000000..9f652129b10 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_app.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(app) { + // [START ces_v1beta_generated_AgentService_UpdateApp_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 app to update. + */ + // const app = {} + /** + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callUpdateApp() { + // Construct request + const request = { + app, + }; + + // Run request + const response = await cesClient.updateApp(request); + console.log(response); + } + + callUpdateApp(); + // [END ces_v1beta_generated_AgentService_UpdateApp_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_deployment.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_deployment.js new file mode 100644 index 00000000000..0c2f234a258 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_deployment.js @@ -0,0 +1,65 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(deployment) { + // [START ces_v1beta_generated_AgentService_UpdateDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 deployment to update. + */ + // const deployment = {} + /** + * Optional. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callUpdateDeployment() { + // Construct request + const request = { + deployment, + }; + + // Run request + const response = await cesClient.updateDeployment(request); + console.log(response); + } + + callUpdateDeployment(); + // [END ces_v1beta_generated_AgentService_UpdateDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_example.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_example.js new file mode 100644 index 00000000000..eb80fa4c7ca --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_example.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(example) { + // [START ces_v1beta_generated_AgentService_UpdateExample_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 example to update. + */ + // const example = {} + /** + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callUpdateExample() { + // Construct request + const request = { + example, + }; + + // Run request + const response = await cesClient.updateExample(request); + console.log(response); + } + + callUpdateExample(); + // [END ces_v1beta_generated_AgentService_UpdateExample_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_guardrail.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_guardrail.js new file mode 100644 index 00000000000..fe308c45bb2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_guardrail.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(guardrail) { + // [START ces_v1beta_generated_AgentService_UpdateGuardrail_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 guardrail to update. + */ + // const guardrail = {} + /** + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callUpdateGuardrail() { + // Construct request + const request = { + guardrail, + }; + + // Run request + const response = await cesClient.updateGuardrail(request); + console.log(response); + } + + callUpdateGuardrail(); + // [END ces_v1beta_generated_AgentService_UpdateGuardrail_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_tool.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_tool.js new file mode 100644 index 00000000000..c8e84d60de6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_tool.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(tool) { + // [START ces_v1beta_generated_AgentService_UpdateTool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 tool to update. + */ + // const tool = {} + /** + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callUpdateTool() { + // Construct request + const request = { + tool, + }; + + // Run request + const response = await cesClient.updateTool(request); + console.log(response); + } + + callUpdateTool(); + // [END ces_v1beta_generated_AgentService_UpdateTool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_toolset.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_toolset.js new file mode 100644 index 00000000000..9485d7802ea --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_toolset.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(toolset) { + // [START ces_v1beta_generated_AgentService_UpdateToolset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 toolset to update. + */ + // const toolset = {} + /** + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callUpdateToolset() { + // Construct request + const request = { + toolset, + }; + + // Run request + const response = await cesClient.updateToolset(request); + console.log(response); + } + + callUpdateToolset(); + // [END ces_v1beta_generated_AgentService_UpdateToolset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation.js new file mode 100644 index 00000000000..0c6ad101cdd --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, evaluation) { + // [START ces_v1beta_generated_EvaluationService_CreateEvaluation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 app to create the evaluation for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the evaluation, which will become the final + * component of the evaluation's resource name. If not provided, a unique ID + * will be automatically assigned for the evaluation. + */ + // const evaluationId = 'abc123' + /** + * Required. The evaluation to create. + */ + // const evaluation = {} + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callCreateEvaluation() { + // Construct request + const request = { + parent, + evaluation, + }; + + // Run request + const response = await cesClient.createEvaluation(request); + console.log(response); + } + + callCreateEvaluation(); + // [END ces_v1beta_generated_EvaluationService_CreateEvaluation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_dataset.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_dataset.js new file mode 100644 index 00000000000..a67a4886de1 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_dataset.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, evaluationDataset) { + // [START ces_v1beta_generated_EvaluationService_CreateEvaluationDataset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 app to create the evaluation for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the evaluation dataset, which will become the + * final component of the evaluation dataset's resource name. If not provided, + * a unique ID will be automatically assigned for the evaluation. + */ + // const evaluationDatasetId = 'abc123' + /** + * Required. The evaluation dataset to create. + */ + // const evaluationDataset = {} + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callCreateEvaluationDataset() { + // Construct request + const request = { + parent, + evaluationDataset, + }; + + // Run request + const response = await cesClient.createEvaluationDataset(request); + console.log(response); + } + + callCreateEvaluationDataset(); + // [END ces_v1beta_generated_EvaluationService_CreateEvaluationDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_expectation.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_expectation.js new file mode 100644 index 00000000000..0214d98dbdf --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_expectation.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, evaluationExpectation) { + // [START ces_v1beta_generated_EvaluationService_CreateEvaluationExpectation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 app to create the evaluation expectation for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the evaluation expectation, which will become + * the final component of the evaluation expectation's resource name. If not + * provided, a unique ID will be automatically assigned for the evaluation + * expectation. + */ + // const evaluationExpectationId = 'abc123' + /** + * Required. The evaluation expectation to create. + */ + // const evaluationExpectation = {} + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callCreateEvaluationExpectation() { + // Construct request + const request = { + parent, + evaluationExpectation, + }; + + // Run request + const response = await cesClient.createEvaluationExpectation(request); + console.log(response); + } + + callCreateEvaluationExpectation(); + // [END ces_v1beta_generated_EvaluationService_CreateEvaluationExpectation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_scheduled_evaluation_run.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_scheduled_evaluation_run.js new file mode 100644 index 00000000000..f1b83d9b5f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_scheduled_evaluation_run.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, scheduledEvaluationRun) { + // [START ces_v1beta_generated_EvaluationService_CreateScheduledEvaluationRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 app to create the scheduled evaluation run for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the scheduled evaluation run, which will become + * the final component of the scheduled evaluation run's resource name. If not + * provided, a unique ID will be automatically assigned. + */ + // const scheduledEvaluationRunId = 'abc123' + /** + * Required. The scheduled evaluation run to create. + */ + // const scheduledEvaluationRun = {} + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callCreateScheduledEvaluationRun() { + // Construct request + const request = { + parent, + scheduledEvaluationRun, + }; + + // Run request + const response = await cesClient.createScheduledEvaluationRun(request); + console.log(response); + } + + callCreateScheduledEvaluationRun(); + // [END ces_v1beta_generated_EvaluationService_CreateScheduledEvaluationRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation.js new file mode 100644 index 00000000000..599bcfeb2fd --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_EvaluationService_DeleteEvaluation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the evaluation to delete. + */ + // const name = 'abc123' + /** + * Optional. Indicates whether to forcefully delete the evaluation, even if it + * is still referenced by evaluation datasets. + * * If `force = false`, the deletion will fail if any datasets still + * reference the evaluation. + * * If `force = true`, all existing references from datasets will be removed + * and the evaluation will be deleted. + */ + // const force = true + /** + * Optional. The current etag of the evaluation. If an etag is not provided, + * the deletion will overwrite any concurrent changes. If an etag is provided + * and does not match the current etag of the evaluation, deletion will be + * blocked and an ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callDeleteEvaluation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteEvaluation(request); + console.log(response); + } + + callDeleteEvaluation(); + // [END ces_v1beta_generated_EvaluationService_DeleteEvaluation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_dataset.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_dataset.js new file mode 100644 index 00000000000..dd121bfae03 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_dataset.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1beta_generated_EvaluationService_DeleteEvaluationDataset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the evaluation dataset to delete. + */ + // const name = 'abc123' + /** + * Optional. The current etag of the evaluation dataset. If an etag is not + * provided, the deletion will overwrite any concurrent changes. If an etag is + * provided and does not match the current etag of the evaluation dataset, + * deletion will be blocked and an ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callDeleteEvaluationDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteEvaluationDataset(request); + console.log(response); + } + + callDeleteEvaluationDataset(); + // [END ces_v1beta_generated_EvaluationService_DeleteEvaluationDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_expectation.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_expectation.js new file mode 100644 index 00000000000..f7f8fd4da32 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_expectation.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1beta_generated_EvaluationService_DeleteEvaluationExpectation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the evaluation expectation to delete. + */ + // const name = 'abc123' + /** + * Optional. The current etag of the evaluation expectation. If an etag is not + * provided, the deletion will overwrite any concurrent changes. If an etag is + * provided and does not match the current etag of the evaluation expectation, + * deletion will be blocked and an ABORTED error will be returned. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callDeleteEvaluationExpectation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteEvaluationExpectation(request); + console.log(response); + } + + callDeleteEvaluationExpectation(); + // [END ces_v1beta_generated_EvaluationService_DeleteEvaluationExpectation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_result.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_result.js new file mode 100644 index 00000000000..719d2b59a69 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_result.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_EvaluationService_DeleteEvaluationResult_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the evaluation result to delete. + */ + // const name = 'abc123' + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callDeleteEvaluationResult() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteEvaluationResult(request); + console.log(response); + } + + callDeleteEvaluationResult(); + // [END ces_v1beta_generated_EvaluationService_DeleteEvaluationResult_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_run.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_run.js new file mode 100644 index 00000000000..28905692682 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_run.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_EvaluationService_DeleteEvaluationRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the evaluation run to delete. + */ + // const name = 'abc123' + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callDeleteEvaluationRun() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cesClient.deleteEvaluationRun(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteEvaluationRun(); + // [END ces_v1beta_generated_EvaluationService_DeleteEvaluationRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_scheduled_evaluation_run.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_scheduled_evaluation_run.js new file mode 100644 index 00000000000..6c168ad03bd --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_scheduled_evaluation_run.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_EvaluationService_DeleteScheduledEvaluationRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the scheduled evaluation run to delete. + */ + // const name = 'abc123' + /** + * Optional. The etag of the ScheduledEvaluationRun. + * If provided, it must match the server's etag. + */ + // const etag = 'abc123' + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callDeleteScheduledEvaluationRun() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.deleteScheduledEvaluationRun(request); + console.log(response); + } + + callDeleteScheduledEvaluationRun(); + // [END ces_v1beta_generated_EvaluationService_DeleteScheduledEvaluationRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.generate_evaluation.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.generate_evaluation.js new file mode 100644 index 00000000000..00b6bdaf54e --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.generate_evaluation.js @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(conversation) { + // [START ces_v1beta_generated_EvaluationService_GenerateEvaluation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 conversation to create the golden evaluation for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}` + */ + // const conversation = 'abc123' + /** + * Optional. Indicate the source of the conversation. If not set, all sources + * will be searched. + */ + // const source = {} + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callGenerateEvaluation() { + // Construct request + const request = { + conversation, + }; + + // Run request + const [operation] = await cesClient.generateEvaluation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callGenerateEvaluation(); + // [END ces_v1beta_generated_EvaluationService_GenerateEvaluation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation.js new file mode 100644 index 00000000000..b9b8ff1a810 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_EvaluationService_GetEvaluation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the evaluation to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callGetEvaluation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getEvaluation(request); + console.log(response); + } + + callGetEvaluation(); + // [END ces_v1beta_generated_EvaluationService_GetEvaluation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_dataset.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_dataset.js new file mode 100644 index 00000000000..ebac96c854a --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_dataset.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_EvaluationService_GetEvaluationDataset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the evaluation dataset to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callGetEvaluationDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getEvaluationDataset(request); + console.log(response); + } + + callGetEvaluationDataset(); + // [END ces_v1beta_generated_EvaluationService_GetEvaluationDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_expectation.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_expectation.js new file mode 100644 index 00000000000..e5646f0b574 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_expectation.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_EvaluationService_GetEvaluationExpectation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the evaluation expectation to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callGetEvaluationExpectation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getEvaluationExpectation(request); + console.log(response); + } + + callGetEvaluationExpectation(); + // [END ces_v1beta_generated_EvaluationService_GetEvaluationExpectation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_result.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_result.js new file mode 100644 index 00000000000..5f08d204350 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_result.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_EvaluationService_GetEvaluationResult_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the evaluation result to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callGetEvaluationResult() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getEvaluationResult(request); + console.log(response); + } + + callGetEvaluationResult(); + // [END ces_v1beta_generated_EvaluationService_GetEvaluationResult_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_run.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_run.js new file mode 100644 index 00000000000..8cd9d07b23a --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_run.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_EvaluationService_GetEvaluationRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the evaluation run to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callGetEvaluationRun() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getEvaluationRun(request); + console.log(response); + } + + callGetEvaluationRun(); + // [END ces_v1beta_generated_EvaluationService_GetEvaluationRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_scheduled_evaluation_run.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_scheduled_evaluation_run.js new file mode 100644 index 00000000000..73974548536 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_scheduled_evaluation_run.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START ces_v1beta_generated_EvaluationService_GetScheduledEvaluationRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the scheduled evaluation run to retrieve. + */ + // const name = 'abc123' + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callGetScheduledEvaluationRun() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cesClient.getScheduledEvaluationRun(request); + console.log(response); + } + + callGetScheduledEvaluationRun(); + // [END ces_v1beta_generated_EvaluationService_GetScheduledEvaluationRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.import_evaluations.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.import_evaluations.js new file mode 100644 index 00000000000..779b9280b8b --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.import_evaluations.js @@ -0,0 +1,82 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START ces_v1beta_generated_EvaluationService_ImportEvaluations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The conversations to import the evaluations from. + */ + // const conversationList = {} + /** + * The Google Cloud Storage (https://cloud.google.com/storage/docs/) URI + * from which to import evaluations. The format of this URI must be + * `gs:///`. + */ + // const gcsUri = 'abc123' + /** + * Raw bytes representing the csv file with the evaluations structure. + */ + // const csvContent = Buffer.from('string') + /** + * Required. The app to import the evaluations into. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + */ + // const parent = 'abc123' + /** + * Optional. Options governing the import process for the evaluations. + */ + // const importOptions = {} + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callImportEvaluations() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cesClient.importEvaluations(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportEvaluations(); + // [END ces_v1beta_generated_EvaluationService_ImportEvaluations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_datasets.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_datasets.js new file mode 100644 index 00000000000..17d54cbf992 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_datasets.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START ces_v1beta_generated_EvaluationService_ListEvaluationDatasets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list evaluation datasets from. + */ + // 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. The + * next_page_token google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.next_page_token + * value returned from a previous list + * EvaluationService.ListEvaluationDatasets google.cloud.ces.v1beta.EvaluationService.ListEvaluationDatasets + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the evaluation datasets. + * See https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callListEvaluationDatasets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listEvaluationDatasetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEvaluationDatasets(); + // [END ces_v1beta_generated_EvaluationService_ListEvaluationDatasets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_expectations.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_expectations.js new file mode 100644 index 00000000000..6a7993fe1b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_expectations.js @@ -0,0 +1,90 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START ces_v1beta_generated_EvaluationService_ListEvaluationExpectations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list evaluation expectations + * from. + */ + // 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. The + * next_page_token google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.next_page_token + * value returned from a previous list + * EvaluationService.ListEvaluationExpectations google.cloud.ces.v1beta.EvaluationService.ListEvaluationExpectations + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the evaluation expectations. + * See https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callListEvaluationExpectations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listEvaluationExpectationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEvaluationExpectations(); + // [END ces_v1beta_generated_EvaluationService_ListEvaluationExpectations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_results.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_results.js new file mode 100644 index 00000000000..881bf818d4c --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_results.js @@ -0,0 +1,92 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START ces_v1beta_generated_EvaluationService_ListEvaluationResults_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the evaluation to list evaluation results + * from. To filter by evaluation run, use `-` as the evaluation ID and specify + * the evaluation run ID in the filter. For example: + * `projects/{project}/locations/{location}/apps/{app}/evaluations/-` + */ + // 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. The + * next_page_token google.cloud.ces.v1beta.ListEvaluationResultsResponse.next_page_token + * value returned from a previous list + * EvaluationService.ListEvaluationResults google.cloud.ces.v1beta.EvaluationService.ListEvaluationResults + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the evaluation results. + * See https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callListEvaluationResults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listEvaluationResultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEvaluationResults(); + // [END ces_v1beta_generated_EvaluationService_ListEvaluationResults_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_runs.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_runs.js new file mode 100644 index 00000000000..5e3943e9b9c --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_runs.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START ces_v1beta_generated_EvaluationService_ListEvaluationRuns_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list evaluation runs from. + */ + // 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. The + * next_page_token google.cloud.ces.v1beta.ListEvaluationRunsResponse.next_page_token + * value returned from a previous list + * EvaluationService.ListEvaluationRuns google.cloud.ces.v1beta.EvaluationService.ListEvaluationRuns + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the evaluation runs. + * See https://google.aip.dev/160 for more details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callListEvaluationRuns() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listEvaluationRunsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEvaluationRuns(); + // [END ces_v1beta_generated_EvaluationService_ListEvaluationRuns_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluations.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluations.js new file mode 100644 index 00000000000..b4071bacddd --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluations.js @@ -0,0 +1,101 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1beta_generated_EvaluationService_ListEvaluations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list evaluations from. + */ + // 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. The + * next_page_token google.cloud.ces.v1beta.ListEvaluationsResponse.next_page_token + * value returned from a previous list + * EvaluationService.ListEvaluations google.cloud.ces.v1beta.EvaluationService.ListEvaluations + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied on the evaluation when listing the + * evaluations. See https://google.aip.dev/160 for more details. Supported + * fields: evaluation_datasets + */ + // const evaluationFilter = 'abc123' + /** + * Optional. Filter string for fields on the associated EvaluationRun + * resources. See https://google.aip.dev/160 for more details. Supported + * fields: create_time, initiated_by, app_version_display_name + */ + // const evaluationRunFilter = 'abc123' + /** + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + */ + // const orderBy = 'abc123' + /** + * Optional. Whether to include the last 10 evaluation results for each + * evaluation in the response. + */ + // const lastTenResults = true + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callListEvaluations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listEvaluationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEvaluations(); + // [END ces_v1beta_generated_EvaluationService_ListEvaluations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_scheduled_evaluation_runs.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_scheduled_evaluation_runs.js new file mode 100644 index 00000000000..7b77e08f5dd --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_scheduled_evaluation_runs.js @@ -0,0 +1,94 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START ces_v1beta_generated_EvaluationService_ListScheduledEvaluationRuns_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the app to list scheduled evaluation runs + * from. + */ + // 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. The + * next_page_token google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.next_page_token + * value returned from a previous list + * EvaluationService.ListScheduledEvaluationRuns google.cloud.ces.v1beta.EvaluationService.ListScheduledEvaluationRuns + * call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter to be applied when listing the scheduled evaluation runs. + * See https://google.aip.dev/160 for more details. + * Currently supports filtering by: + * * request.evaluations:evaluation_id + * * request.evaluation_dataset:evaluation_dataset_id + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. Supported fields are: + * "name" (ascending), "create_time" (descending), "update_time" (descending), + * "next_scheduled_execution" (ascending), and + * "last_completed_run.create_time" (descending). + * If not included, "update_time" will be the default. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callListScheduledEvaluationRuns() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cesClient.listScheduledEvaluationRunsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListScheduledEvaluationRuns(); + // [END ces_v1beta_generated_EvaluationService_ListScheduledEvaluationRuns_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.run_evaluation.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.run_evaluation.js new file mode 100644 index 00000000000..707a36dd042 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.run_evaluation.js @@ -0,0 +1,122 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(app) { + // [START ces_v1beta_generated_EvaluationService_RunEvaluation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 app to evaluate. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + */ + // const app = 'abc123' + /** + * Optional. List of evaluations to run. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}` + */ + // const evaluations = ['abc','def'] + /** + * Optional. An evaluation dataset to run. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/evaluationDatasets/{evaluationDataset}` + */ + // const evaluationDataset = 'abc123' + /** + * Optional. The display name of the evaluation run. + */ + // const displayName = 'abc123' + /** + * Optional. The app version to evaluate. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/versions/{version}` + */ + // const appVersion = 'abc123' + /** + * Optional. The configuration to use for the run. + */ + // const config = {} + /** + * Optional. The number of times to run the evaluation. If not set, the + * default value is 1 per golden, and 5 per scenario. + */ + // const runCount = 1234 + /** + * Optional. The configuration to use for the run per persona. + */ + // const personaRunConfigs = [1,2,3,4] + /** + * Optional. Configuration for running the optimization step after the + * evaluation run. If not set, the optimization step will not be run. + */ + // const optimizationConfig = {} + /** + * Optional. The resource name of the `ScheduledEvaluationRun` that is + * triggering this evaluation run. + * If this field is set, the `scheduled_evaluation_run` field on the created + * `EvaluationRun` resource will be populated from this value. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/scheduledEvaluationRuns/{scheduled_evaluation_run}` + */ + // const scheduledEvaluationRun = 'abc123' + /** + * Optional. The method to run the evaluation if it is a golden evaluation. If + * not set, default to STABLE. + */ + // const goldenRunMethod = {} + /** + * Optional. Whether to generate a latency report for the evaluation run. + */ + // const generateLatencyReport = true + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callRunEvaluation() { + // Construct request + const request = { + app, + }; + + // Run request + const [operation] = await cesClient.runEvaluation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRunEvaluation(); + // [END ces_v1beta_generated_EvaluationService_RunEvaluation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.test_persona_voice.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.test_persona_voice.js new file mode 100644 index 00000000000..02ab493def2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.test_persona_voice.js @@ -0,0 +1,73 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(app, personaId, text) { + // [START ces_v1beta_generated_EvaluationService_TestPersonaVoice_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. the resource name of the app to test the persona voice for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + */ + // const app = 'abc123' + /** + * Required. The persona ID to test the voice for. Also accepts "default". + */ + // const personaId = 'abc123' + /** + * Required. The text to test the voice for. + */ + // const text = 'abc123' + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callTestPersonaVoice() { + // Construct request + const request = { + app, + personaId, + text, + }; + + // Run request + const response = await cesClient.testPersonaVoice(request); + console.log(response); + } + + callTestPersonaVoice(); + // [END ces_v1beta_generated_EvaluationService_TestPersonaVoice_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation.js new file mode 100644 index 00000000000..e9a78635a47 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(evaluation) { + // [START ces_v1beta_generated_EvaluationService_UpdateEvaluation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 evaluation to update. + */ + // const evaluation = {} + /** + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callUpdateEvaluation() { + // Construct request + const request = { + evaluation, + }; + + // Run request + const response = await cesClient.updateEvaluation(request); + console.log(response); + } + + callUpdateEvaluation(); + // [END ces_v1beta_generated_EvaluationService_UpdateEvaluation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_dataset.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_dataset.js new file mode 100644 index 00000000000..8bbafc49e59 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_dataset.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(evaluationDataset) { + // [START ces_v1beta_generated_EvaluationService_UpdateEvaluationDataset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 evaluation dataset to update. + */ + // const evaluationDataset = {} + /** + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callUpdateEvaluationDataset() { + // Construct request + const request = { + evaluationDataset, + }; + + // Run request + const response = await cesClient.updateEvaluationDataset(request); + console.log(response); + } + + callUpdateEvaluationDataset(); + // [END ces_v1beta_generated_EvaluationService_UpdateEvaluationDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_expectation.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_expectation.js new file mode 100644 index 00000000000..6b052450cc3 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_expectation.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(evaluationExpectation) { + // [START ces_v1beta_generated_EvaluationService_UpdateEvaluationExpectation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 evaluation expectation to update. + */ + // const evaluationExpectation = {} + /** + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callUpdateEvaluationExpectation() { + // Construct request + const request = { + evaluationExpectation, + }; + + // Run request + const response = await cesClient.updateEvaluationExpectation(request); + console.log(response); + } + + callUpdateEvaluationExpectation(); + // [END ces_v1beta_generated_EvaluationService_UpdateEvaluationExpectation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_scheduled_evaluation_run.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_scheduled_evaluation_run.js new file mode 100644 index 00000000000..d369cc4b1c3 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_scheduled_evaluation_run.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(scheduledEvaluationRun) { + // [START ces_v1beta_generated_EvaluationService_UpdateScheduledEvaluationRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 scheduled evaluation run to update. + */ + // const scheduledEvaluationRun = {} + /** + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + */ + // const updateMask = {} + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callUpdateScheduledEvaluationRun() { + // Construct request + const request = { + scheduledEvaluationRun, + }; + + // Run request + const response = await cesClient.updateScheduledEvaluationRun(request); + console.log(response); + } + + callUpdateScheduledEvaluationRun(); + // [END ces_v1beta_generated_EvaluationService_UpdateScheduledEvaluationRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.upload_evaluation_audio.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.upload_evaluation_audio.js new file mode 100644 index 00000000000..ae6b0192db5 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.upload_evaluation_audio.js @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(app, audioContent) { + // [START ces_v1beta_generated_EvaluationService_UploadEvaluationAudio_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the App for which to upload the evaluation + * audio. Format: `projects/{project}/locations/{location}/apps/{app}` + */ + // const app = 'abc123' + /** + * Required. The raw audio bytes. + * The format of the audio must be single-channel LINEAR16 with a sample + * rate of 16kHz (default InputAudioConfig). + */ + // const audioContent = Buffer.from('string') + + // Imports the Ces library + const {EvaluationServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new EvaluationServiceClient(); + + async function callUploadEvaluationAudio() { + // Construct request + const request = { + app, + audioContent, + }; + + // Run request + const response = await cesClient.uploadEvaluationAudio(request); + console.log(response); + } + + callUploadEvaluationAudio(); + // [END ces_v1beta_generated_EvaluationService_UploadEvaluationAudio_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/session_service.bidi_run_session.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/session_service.bidi_run_session.js new file mode 100644 index 00000000000..68a231ea51f --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/session_service.bidi_run_session.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START ces_v1beta_generated_SessionService_BidiRunSession_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 initial config message for the session. + */ + // const config = {} + /** + * Optional. Realtime input for the session. + */ + // const realtimeInput = {} + + // Imports the Ces library + const {SessionServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new SessionServiceClient(); + + async function callBidiRunSession() { + // Construct request + const request = { + }; + + // Run request + const stream = await cesClient.bidiRunSession(); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + stream.write(request); + stream.end(); + } + + callBidiRunSession(); + // [END ces_v1beta_generated_SessionService_BidiRunSession_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/session_service.run_session.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/session_service.run_session.js new file mode 100644 index 00000000000..5c6da5b4b59 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/session_service.run_session.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(config, inputs) { + // [START ces_v1beta_generated_SessionService_RunSession_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 configuration for the session. + */ + // const config = {} + /** + * Required. Inputs for the session. + */ + // const inputs = [1,2,3,4] + + // Imports the Ces library + const {SessionServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new SessionServiceClient(); + + async function callRunSession() { + // Construct request + const request = { + config, + inputs, + }; + + // Run request + const response = await cesClient.runSession(request); + console.log(response); + } + + callRunSession(); + // [END ces_v1beta_generated_SessionService_RunSession_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/snippet_metadata_google.cloud.ces.v1beta.json b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/snippet_metadata_google.cloud.ces.v1beta.json new file mode 100644 index 00000000000..cae0b899986 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/snippet_metadata_google.cloud.ces.v1beta.json @@ -0,0 +1,4055 @@ +{ + "clientLibrary": { + "name": "nodejs-ces", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.ces.v1beta", + "version": "v1beta" + } + ] + }, + "snippets": [ + { + "regionTag": "ces_v1beta_generated_AgentService_ListApps_async", + "title": "AgentService listApps Sample", + "origin": "API_DEFINITION", + "description": " Lists apps in the given project and location.", + "canonical": true, + "file": "agent_service.list_apps.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApps", + "fullName": "google.cloud.ces.v1beta.AgentService.ListApps", + "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.ces.v1beta.ListAppsResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "ListApps", + "fullName": "google.cloud.ces.v1beta.AgentService.ListApps", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_GetApp_async", + "title": "AgentService getApp Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified app.", + "canonical": true, + "file": "agent_service.get_app.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApp", + "fullName": "google.cloud.ces.v1beta.AgentService.GetApp", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.App", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "GetApp", + "fullName": "google.cloud.ces.v1beta.AgentService.GetApp", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_CreateApp_async", + "title": "AgentService createApp Sample", + "origin": "API_DEFINITION", + "description": " Creates a new app in the given project and location.", + "canonical": true, + "file": "agent_service.create_app.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApp", + "fullName": "google.cloud.ces.v1beta.AgentService.CreateApp", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "app_id", + "type": "TYPE_STRING" + }, + { + "name": "app", + "type": ".google.cloud.ces.v1beta.App" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "CreateApp", + "fullName": "google.cloud.ces.v1beta.AgentService.CreateApp", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_UpdateApp_async", + "title": "AgentService updateApp Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified app.", + "canonical": true, + "file": "agent_service.update_app.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApp", + "fullName": "google.cloud.ces.v1beta.AgentService.UpdateApp", + "async": true, + "parameters": [ + { + "name": "app", + "type": ".google.cloud.ces.v1beta.App" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.ces.v1beta.App", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "UpdateApp", + "fullName": "google.cloud.ces.v1beta.AgentService.UpdateApp", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_DeleteApp_async", + "title": "AgentService deleteApp Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified app.", + "canonical": true, + "file": "agent_service.delete_app.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApp", + "fullName": "google.cloud.ces.v1beta.AgentService.DeleteApp", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "DeleteApp", + "fullName": "google.cloud.ces.v1beta.AgentService.DeleteApp", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_ExportApp_async", + "title": "AgentService exportApp Sample", + "origin": "API_DEFINITION", + "description": " Exports the specified app.", + "canonical": true, + "file": "agent_service.export_app.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportApp", + "fullName": "google.cloud.ces.v1beta.AgentService.ExportApp", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "export_format", + "type": ".google.cloud.ces.v1beta.ExportAppRequest.ExportFormat" + }, + { + "name": "gcs_uri", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "ExportApp", + "fullName": "google.cloud.ces.v1beta.AgentService.ExportApp", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_ImportApp_async", + "title": "AgentService importApp Sample", + "origin": "API_DEFINITION", + "description": " Imports the specified app.", + "canonical": true, + "file": "agent_service.import_app.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 94, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportApp", + "fullName": "google.cloud.ces.v1beta.AgentService.ImportApp", + "async": true, + "parameters": [ + { + "name": "gcs_uri", + "type": "TYPE_STRING" + }, + { + "name": "app_content", + "type": "TYPE_BYTES" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "display_name", + "type": "TYPE_STRING" + }, + { + "name": "app_id", + "type": "TYPE_STRING" + }, + { + "name": "import_options", + "type": ".google.cloud.ces.v1beta.ImportAppRequest.ImportOptions" + }, + { + "name": "ignore_app_lock", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "ImportApp", + "fullName": "google.cloud.ces.v1beta.AgentService.ImportApp", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_ListAgents_async", + "title": "AgentService listAgents Sample", + "origin": "API_DEFINITION", + "description": " Lists agents in the given app.", + "canonical": true, + "file": "agent_service.list_agents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAgents", + "fullName": "google.cloud.ces.v1beta.AgentService.ListAgents", + "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.ces.v1beta.ListAgentsResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "ListAgents", + "fullName": "google.cloud.ces.v1beta.AgentService.ListAgents", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_GetAgent_async", + "title": "AgentService getAgent Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified agent.", + "canonical": true, + "file": "agent_service.get_agent.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAgent", + "fullName": "google.cloud.ces.v1beta.AgentService.GetAgent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.Agent", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "GetAgent", + "fullName": "google.cloud.ces.v1beta.AgentService.GetAgent", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_CreateAgent_async", + "title": "AgentService createAgent Sample", + "origin": "API_DEFINITION", + "description": " Creates a new agent in the given app.", + "canonical": true, + "file": "agent_service.create_agent.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAgent", + "fullName": "google.cloud.ces.v1beta.AgentService.CreateAgent", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "agent_id", + "type": "TYPE_STRING" + }, + { + "name": "agent", + "type": ".google.cloud.ces.v1beta.Agent" + } + ], + "resultType": ".google.cloud.ces.v1beta.Agent", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "CreateAgent", + "fullName": "google.cloud.ces.v1beta.AgentService.CreateAgent", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_UpdateAgent_async", + "title": "AgentService updateAgent Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified agent.", + "canonical": true, + "file": "agent_service.update_agent.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAgent", + "fullName": "google.cloud.ces.v1beta.AgentService.UpdateAgent", + "async": true, + "parameters": [ + { + "name": "agent", + "type": ".google.cloud.ces.v1beta.Agent" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.ces.v1beta.Agent", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "UpdateAgent", + "fullName": "google.cloud.ces.v1beta.AgentService.UpdateAgent", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_DeleteAgent_async", + "title": "AgentService deleteAgent Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified agent.", + "canonical": true, + "file": "agent_service.delete_agent.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAgent", + "fullName": "google.cloud.ces.v1beta.AgentService.DeleteAgent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "DeleteAgent", + "fullName": "google.cloud.ces.v1beta.AgentService.DeleteAgent", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_ListExamples_async", + "title": "AgentService listExamples Sample", + "origin": "API_DEFINITION", + "description": " Lists examples in the given app.", + "canonical": true, + "file": "agent_service.list_examples.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListExamples", + "fullName": "google.cloud.ces.v1beta.AgentService.ListExamples", + "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.ces.v1beta.ListExamplesResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "ListExamples", + "fullName": "google.cloud.ces.v1beta.AgentService.ListExamples", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_GetExample_async", + "title": "AgentService getExample Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified example.", + "canonical": true, + "file": "agent_service.get_example.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetExample", + "fullName": "google.cloud.ces.v1beta.AgentService.GetExample", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.Example", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "GetExample", + "fullName": "google.cloud.ces.v1beta.AgentService.GetExample", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_CreateExample_async", + "title": "AgentService createExample Sample", + "origin": "API_DEFINITION", + "description": " Creates a new example in the given app.", + "canonical": true, + "file": "agent_service.create_example.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateExample", + "fullName": "google.cloud.ces.v1beta.AgentService.CreateExample", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "example_id", + "type": "TYPE_STRING" + }, + { + "name": "example", + "type": ".google.cloud.ces.v1beta.Example" + } + ], + "resultType": ".google.cloud.ces.v1beta.Example", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "CreateExample", + "fullName": "google.cloud.ces.v1beta.AgentService.CreateExample", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_UpdateExample_async", + "title": "AgentService updateExample Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified example.", + "canonical": true, + "file": "agent_service.update_example.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateExample", + "fullName": "google.cloud.ces.v1beta.AgentService.UpdateExample", + "async": true, + "parameters": [ + { + "name": "example", + "type": ".google.cloud.ces.v1beta.Example" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.ces.v1beta.Example", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "UpdateExample", + "fullName": "google.cloud.ces.v1beta.AgentService.UpdateExample", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_DeleteExample_async", + "title": "AgentService deleteExample Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified example.", + "canonical": true, + "file": "agent_service.delete_example.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteExample", + "fullName": "google.cloud.ces.v1beta.AgentService.DeleteExample", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "DeleteExample", + "fullName": "google.cloud.ces.v1beta.AgentService.DeleteExample", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_ListTools_async", + "title": "AgentService listTools Sample", + "origin": "API_DEFINITION", + "description": " Lists tools in the given app.", + "canonical": true, + "file": "agent_service.list_tools.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTools", + "fullName": "google.cloud.ces.v1beta.AgentService.ListTools", + "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.ces.v1beta.ListToolsResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "ListTools", + "fullName": "google.cloud.ces.v1beta.AgentService.ListTools", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_GetTool_async", + "title": "AgentService getTool Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified tool.", + "canonical": true, + "file": "agent_service.get_tool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTool", + "fullName": "google.cloud.ces.v1beta.AgentService.GetTool", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.Tool", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "GetTool", + "fullName": "google.cloud.ces.v1beta.AgentService.GetTool", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_ListConversations_async", + "title": "AgentService listConversations Sample", + "origin": "API_DEFINITION", + "description": " Lists conversations in the given app.", + "canonical": true, + "file": "agent_service.list_conversations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListConversations", + "fullName": "google.cloud.ces.v1beta.AgentService.ListConversations", + "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": "source", + "type": ".google.cloud.ces.v1beta.Conversation.Source" + }, + { + "name": "sources", + "type": "TYPE_ENUM[]" + } + ], + "resultType": ".google.cloud.ces.v1beta.ListConversationsResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "ListConversations", + "fullName": "google.cloud.ces.v1beta.AgentService.ListConversations", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_GetConversation_async", + "title": "AgentService getConversation Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified conversation.", + "canonical": true, + "file": "agent_service.get_conversation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConversation", + "fullName": "google.cloud.ces.v1beta.AgentService.GetConversation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "source", + "type": ".google.cloud.ces.v1beta.Conversation.Source" + } + ], + "resultType": ".google.cloud.ces.v1beta.Conversation", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "GetConversation", + "fullName": "google.cloud.ces.v1beta.AgentService.GetConversation", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_DeleteConversation_async", + "title": "AgentService deleteConversation Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified conversation.", + "canonical": true, + "file": "agent_service.delete_conversation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteConversation", + "fullName": "google.cloud.ces.v1beta.AgentService.DeleteConversation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "source", + "type": ".google.cloud.ces.v1beta.Conversation.Source" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "DeleteConversation", + "fullName": "google.cloud.ces.v1beta.AgentService.DeleteConversation", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_BatchDeleteConversations_async", + "title": "AgentService batchDeleteConversations Sample", + "origin": "API_DEFINITION", + "description": " Batch deletes the specified conversations.", + "canonical": true, + "file": "agent_service.batch_delete_conversations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchDeleteConversations", + "fullName": "google.cloud.ces.v1beta.AgentService.BatchDeleteConversations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "conversations", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "BatchDeleteConversations", + "fullName": "google.cloud.ces.v1beta.AgentService.BatchDeleteConversations", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_CreateTool_async", + "title": "AgentService createTool Sample", + "origin": "API_DEFINITION", + "description": " Creates a new tool in the given app.", + "canonical": true, + "file": "agent_service.create_tool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTool", + "fullName": "google.cloud.ces.v1beta.AgentService.CreateTool", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "tool_id", + "type": "TYPE_STRING" + }, + { + "name": "tool", + "type": ".google.cloud.ces.v1beta.Tool" + } + ], + "resultType": ".google.cloud.ces.v1beta.Tool", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "CreateTool", + "fullName": "google.cloud.ces.v1beta.AgentService.CreateTool", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_UpdateTool_async", + "title": "AgentService updateTool Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified tool.", + "canonical": true, + "file": "agent_service.update_tool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTool", + "fullName": "google.cloud.ces.v1beta.AgentService.UpdateTool", + "async": true, + "parameters": [ + { + "name": "tool", + "type": ".google.cloud.ces.v1beta.Tool" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.ces.v1beta.Tool", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "UpdateTool", + "fullName": "google.cloud.ces.v1beta.AgentService.UpdateTool", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_DeleteTool_async", + "title": "AgentService deleteTool Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified tool.", + "canonical": true, + "file": "agent_service.delete_tool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTool", + "fullName": "google.cloud.ces.v1beta.AgentService.DeleteTool", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "DeleteTool", + "fullName": "google.cloud.ces.v1beta.AgentService.DeleteTool", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_ListGuardrails_async", + "title": "AgentService listGuardrails Sample", + "origin": "API_DEFINITION", + "description": " Lists guardrails in the given app.", + "canonical": true, + "file": "agent_service.list_guardrails.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGuardrails", + "fullName": "google.cloud.ces.v1beta.AgentService.ListGuardrails", + "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.ces.v1beta.ListGuardrailsResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "ListGuardrails", + "fullName": "google.cloud.ces.v1beta.AgentService.ListGuardrails", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_GetGuardrail_async", + "title": "AgentService getGuardrail Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified guardrail.", + "canonical": true, + "file": "agent_service.get_guardrail.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGuardrail", + "fullName": "google.cloud.ces.v1beta.AgentService.GetGuardrail", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.Guardrail", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "GetGuardrail", + "fullName": "google.cloud.ces.v1beta.AgentService.GetGuardrail", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_CreateGuardrail_async", + "title": "AgentService createGuardrail Sample", + "origin": "API_DEFINITION", + "description": " Creates a new guardrail in the given app.", + "canonical": true, + "file": "agent_service.create_guardrail.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGuardrail", + "fullName": "google.cloud.ces.v1beta.AgentService.CreateGuardrail", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "guardrail_id", + "type": "TYPE_STRING" + }, + { + "name": "guardrail", + "type": ".google.cloud.ces.v1beta.Guardrail" + } + ], + "resultType": ".google.cloud.ces.v1beta.Guardrail", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "CreateGuardrail", + "fullName": "google.cloud.ces.v1beta.AgentService.CreateGuardrail", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_UpdateGuardrail_async", + "title": "AgentService updateGuardrail Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified guardrail.", + "canonical": true, + "file": "agent_service.update_guardrail.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateGuardrail", + "fullName": "google.cloud.ces.v1beta.AgentService.UpdateGuardrail", + "async": true, + "parameters": [ + { + "name": "guardrail", + "type": ".google.cloud.ces.v1beta.Guardrail" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.ces.v1beta.Guardrail", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "UpdateGuardrail", + "fullName": "google.cloud.ces.v1beta.AgentService.UpdateGuardrail", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_DeleteGuardrail_async", + "title": "AgentService deleteGuardrail Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified guardrail.", + "canonical": true, + "file": "agent_service.delete_guardrail.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGuardrail", + "fullName": "google.cloud.ces.v1beta.AgentService.DeleteGuardrail", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "DeleteGuardrail", + "fullName": "google.cloud.ces.v1beta.AgentService.DeleteGuardrail", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_ListDeployments_async", + "title": "AgentService listDeployments Sample", + "origin": "API_DEFINITION", + "description": " Lists deployments in the given app.", + "canonical": true, + "file": "agent_service.list_deployments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDeployments", + "fullName": "google.cloud.ces.v1beta.AgentService.ListDeployments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.ListDeploymentsResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "ListDeployments", + "fullName": "google.cloud.ces.v1beta.AgentService.ListDeployments", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_GetDeployment_async", + "title": "AgentService getDeployment Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified deployment.", + "canonical": true, + "file": "agent_service.get_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDeployment", + "fullName": "google.cloud.ces.v1beta.AgentService.GetDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.Deployment", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "GetDeployment", + "fullName": "google.cloud.ces.v1beta.AgentService.GetDeployment", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_CreateDeployment_async", + "title": "AgentService createDeployment Sample", + "origin": "API_DEFINITION", + "description": " Creates a new deployment in the given app.", + "canonical": true, + "file": "agent_service.create_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDeployment", + "fullName": "google.cloud.ces.v1beta.AgentService.CreateDeployment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "deployment_id", + "type": "TYPE_STRING" + }, + { + "name": "deployment", + "type": ".google.cloud.ces.v1beta.Deployment" + } + ], + "resultType": ".google.cloud.ces.v1beta.Deployment", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "CreateDeployment", + "fullName": "google.cloud.ces.v1beta.AgentService.CreateDeployment", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_UpdateDeployment_async", + "title": "AgentService updateDeployment Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified deployment.", + "canonical": true, + "file": "agent_service.update_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDeployment", + "fullName": "google.cloud.ces.v1beta.AgentService.UpdateDeployment", + "async": true, + "parameters": [ + { + "name": "deployment", + "type": ".google.cloud.ces.v1beta.Deployment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.ces.v1beta.Deployment", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "UpdateDeployment", + "fullName": "google.cloud.ces.v1beta.AgentService.UpdateDeployment", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_DeleteDeployment_async", + "title": "AgentService deleteDeployment Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified deployment.", + "canonical": true, + "file": "agent_service.delete_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDeployment", + "fullName": "google.cloud.ces.v1beta.AgentService.DeleteDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "DeleteDeployment", + "fullName": "google.cloud.ces.v1beta.AgentService.DeleteDeployment", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_ListToolsets_async", + "title": "AgentService listToolsets Sample", + "origin": "API_DEFINITION", + "description": " Lists toolsets in the given app.", + "canonical": true, + "file": "agent_service.list_toolsets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListToolsets", + "fullName": "google.cloud.ces.v1beta.AgentService.ListToolsets", + "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.ces.v1beta.ListToolsetsResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "ListToolsets", + "fullName": "google.cloud.ces.v1beta.AgentService.ListToolsets", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_GetToolset_async", + "title": "AgentService getToolset Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified toolset.", + "canonical": true, + "file": "agent_service.get_toolset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetToolset", + "fullName": "google.cloud.ces.v1beta.AgentService.GetToolset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.Toolset", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "GetToolset", + "fullName": "google.cloud.ces.v1beta.AgentService.GetToolset", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_CreateToolset_async", + "title": "AgentService createToolset Sample", + "origin": "API_DEFINITION", + "description": " Creates a new toolset in the given app.", + "canonical": true, + "file": "agent_service.create_toolset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateToolset", + "fullName": "google.cloud.ces.v1beta.AgentService.CreateToolset", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "toolset_id", + "type": "TYPE_STRING" + }, + { + "name": "toolset", + "type": ".google.cloud.ces.v1beta.Toolset" + } + ], + "resultType": ".google.cloud.ces.v1beta.Toolset", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "CreateToolset", + "fullName": "google.cloud.ces.v1beta.AgentService.CreateToolset", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_UpdateToolset_async", + "title": "AgentService updateToolset Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified toolset.", + "canonical": true, + "file": "agent_service.update_toolset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateToolset", + "fullName": "google.cloud.ces.v1beta.AgentService.UpdateToolset", + "async": true, + "parameters": [ + { + "name": "toolset", + "type": ".google.cloud.ces.v1beta.Toolset" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.ces.v1beta.Toolset", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "UpdateToolset", + "fullName": "google.cloud.ces.v1beta.AgentService.UpdateToolset", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_DeleteToolset_async", + "title": "AgentService deleteToolset Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified toolset.", + "canonical": true, + "file": "agent_service.delete_toolset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteToolset", + "fullName": "google.cloud.ces.v1beta.AgentService.DeleteToolset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "DeleteToolset", + "fullName": "google.cloud.ces.v1beta.AgentService.DeleteToolset", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_ListAppVersions_async", + "title": "AgentService listAppVersions Sample", + "origin": "API_DEFINITION", + "description": " Lists all app versions in the given app.", + "canonical": true, + "file": "agent_service.list_app_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAppVersions", + "fullName": "google.cloud.ces.v1beta.AgentService.ListAppVersions", + "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.ces.v1beta.ListAppVersionsResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "ListAppVersions", + "fullName": "google.cloud.ces.v1beta.AgentService.ListAppVersions", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_GetAppVersion_async", + "title": "AgentService getAppVersion Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified app version.", + "canonical": true, + "file": "agent_service.get_app_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAppVersion", + "fullName": "google.cloud.ces.v1beta.AgentService.GetAppVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.AppVersion", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "GetAppVersion", + "fullName": "google.cloud.ces.v1beta.AgentService.GetAppVersion", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_CreateAppVersion_async", + "title": "AgentService createAppVersion Sample", + "origin": "API_DEFINITION", + "description": " Creates a new app version in the given app.", + "canonical": true, + "file": "agent_service.create_app_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAppVersion", + "fullName": "google.cloud.ces.v1beta.AgentService.CreateAppVersion", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "app_version_id", + "type": "TYPE_STRING" + }, + { + "name": "app_version", + "type": ".google.cloud.ces.v1beta.AppVersion" + } + ], + "resultType": ".google.cloud.ces.v1beta.AppVersion", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "CreateAppVersion", + "fullName": "google.cloud.ces.v1beta.AgentService.CreateAppVersion", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_DeleteAppVersion_async", + "title": "AgentService deleteAppVersion Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified app version.", + "canonical": true, + "file": "agent_service.delete_app_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAppVersion", + "fullName": "google.cloud.ces.v1beta.AgentService.DeleteAppVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "DeleteAppVersion", + "fullName": "google.cloud.ces.v1beta.AgentService.DeleteAppVersion", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_RestoreAppVersion_async", + "title": "AgentService restoreAppVersion Sample", + "origin": "API_DEFINITION", + "description": " Restores the specified app version. This will create a new app version from the current draft app and overwrite the current draft with the specified app version.", + "canonical": true, + "file": "agent_service.restore_app_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreAppVersion", + "fullName": "google.cloud.ces.v1beta.AgentService.RestoreAppVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "RestoreAppVersion", + "fullName": "google.cloud.ces.v1beta.AgentService.RestoreAppVersion", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_ListChangelogs_async", + "title": "AgentService listChangelogs Sample", + "origin": "API_DEFINITION", + "description": " Lists the changelogs of the specified app.", + "canonical": true, + "file": "agent_service.list_changelogs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 90, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListChangelogs", + "fullName": "google.cloud.ces.v1beta.AgentService.ListChangelogs", + "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.ces.v1beta.ListChangelogsResponse", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "ListChangelogs", + "fullName": "google.cloud.ces.v1beta.AgentService.ListChangelogs", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_AgentService_GetChangelog_async", + "title": "AgentService getChangelog Sample", + "origin": "API_DEFINITION", + "description": " Gets the specified changelog.", + "canonical": true, + "file": "agent_service.get_changelog.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetChangelog", + "fullName": "google.cloud.ces.v1beta.AgentService.GetChangelog", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.Changelog", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "GetChangelog", + "fullName": "google.cloud.ces.v1beta.AgentService.GetChangelog", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_RunEvaluation_async", + "title": "AgentService runEvaluation Sample", + "origin": "API_DEFINITION", + "description": " Runs an evaluation of the app.", + "canonical": true, + "file": "evaluation_service.run_evaluation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 114, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunEvaluation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.RunEvaluation", + "async": true, + "parameters": [ + { + "name": "app", + "type": "TYPE_STRING" + }, + { + "name": "evaluations", + "type": "TYPE_STRING[]" + }, + { + "name": "evaluation_dataset", + "type": "TYPE_STRING" + }, + { + "name": "display_name", + "type": "TYPE_STRING" + }, + { + "name": "app_version", + "type": "TYPE_STRING" + }, + { + "name": "config", + "type": ".google.cloud.ces.v1beta.EvaluationConfig" + }, + { + "name": "run_count", + "type": "TYPE_INT32" + }, + { + "name": "persona_run_configs", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "optimization_config", + "type": ".google.cloud.ces.v1beta.OptimizationConfig" + }, + { + "name": "scheduled_evaluation_run", + "type": "TYPE_STRING" + }, + { + "name": "golden_run_method", + "type": ".google.cloud.ces.v1beta.GoldenRunMethod" + }, + { + "name": "generate_latency_report", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "RunEvaluation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.RunEvaluation", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_UploadEvaluationAudio_async", + "title": "AgentService uploadEvaluationAudio Sample", + "origin": "API_DEFINITION", + "description": " Uploads audio for use in Golden Evaluations. Stores the audio in the Cloud Storage bucket defined in 'App.logging_settings.evaluation_audio_recording_config.gcs_bucket' and returns a transcript.", + "canonical": true, + "file": "evaluation_service.upload_evaluation_audio.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UploadEvaluationAudio", + "fullName": "google.cloud.ces.v1beta.EvaluationService.UploadEvaluationAudio", + "async": true, + "parameters": [ + { + "name": "app", + "type": "TYPE_STRING" + }, + { + "name": "audio_content", + "type": "TYPE_BYTES" + } + ], + "resultType": ".google.cloud.ces.v1beta.UploadEvaluationAudioResponse", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "UploadEvaluationAudio", + "fullName": "google.cloud.ces.v1beta.EvaluationService.UploadEvaluationAudio", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_CreateEvaluation_async", + "title": "AgentService createEvaluation Sample", + "origin": "API_DEFINITION", + "description": " Creates an evaluation.", + "canonical": true, + "file": "evaluation_service.create_evaluation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateEvaluation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.CreateEvaluation", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "evaluation_id", + "type": "TYPE_STRING" + }, + { + "name": "evaluation", + "type": ".google.cloud.ces.v1beta.Evaluation" + } + ], + "resultType": ".google.cloud.ces.v1beta.Evaluation", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "CreateEvaluation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.CreateEvaluation", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_GenerateEvaluation_async", + "title": "AgentService generateEvaluation Sample", + "origin": "API_DEFINITION", + "description": " Creates a golden evaluation from a conversation.", + "canonical": true, + "file": "evaluation_service.generate_evaluation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateEvaluation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.GenerateEvaluation", + "async": true, + "parameters": [ + { + "name": "conversation", + "type": "TYPE_STRING" + }, + { + "name": "source", + "type": ".google.cloud.ces.v1beta.Conversation.Source" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "GenerateEvaluation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.GenerateEvaluation", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_ImportEvaluations_async", + "title": "AgentService importEvaluations Sample", + "origin": "API_DEFINITION", + "description": " Imports evaluations into the app.", + "canonical": true, + "file": "evaluation_service.import_evaluations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportEvaluations", + "fullName": "google.cloud.ces.v1beta.EvaluationService.ImportEvaluations", + "async": true, + "parameters": [ + { + "name": "conversation_list", + "type": ".google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList" + }, + { + "name": "gcs_uri", + "type": "TYPE_STRING" + }, + { + "name": "csv_content", + "type": "TYPE_BYTES" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "import_options", + "type": ".google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "ImportEvaluations", + "fullName": "google.cloud.ces.v1beta.EvaluationService.ImportEvaluations", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_CreateEvaluationDataset_async", + "title": "AgentService createEvaluationDataset Sample", + "origin": "API_DEFINITION", + "description": " Creates an evaluation dataset.", + "canonical": true, + "file": "evaluation_service.create_evaluation_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateEvaluationDataset", + "fullName": "google.cloud.ces.v1beta.EvaluationService.CreateEvaluationDataset", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "evaluation_dataset_id", + "type": "TYPE_STRING" + }, + { + "name": "evaluation_dataset", + "type": ".google.cloud.ces.v1beta.EvaluationDataset" + } + ], + "resultType": ".google.cloud.ces.v1beta.EvaluationDataset", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "CreateEvaluationDataset", + "fullName": "google.cloud.ces.v1beta.EvaluationService.CreateEvaluationDataset", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_UpdateEvaluation_async", + "title": "AgentService updateEvaluation Sample", + "origin": "API_DEFINITION", + "description": " Updates an evaluation.", + "canonical": true, + "file": "evaluation_service.update_evaluation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateEvaluation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.UpdateEvaluation", + "async": true, + "parameters": [ + { + "name": "evaluation", + "type": ".google.cloud.ces.v1beta.Evaluation" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.ces.v1beta.Evaluation", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "UpdateEvaluation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.UpdateEvaluation", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_UpdateEvaluationDataset_async", + "title": "AgentService updateEvaluationDataset Sample", + "origin": "API_DEFINITION", + "description": " Updates an evaluation dataset.", + "canonical": true, + "file": "evaluation_service.update_evaluation_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateEvaluationDataset", + "fullName": "google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationDataset", + "async": true, + "parameters": [ + { + "name": "evaluation_dataset", + "type": ".google.cloud.ces.v1beta.EvaluationDataset" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.ces.v1beta.EvaluationDataset", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "UpdateEvaluationDataset", + "fullName": "google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationDataset", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_DeleteEvaluation_async", + "title": "AgentService deleteEvaluation Sample", + "origin": "API_DEFINITION", + "description": " Deletes an evaluation.", + "canonical": true, + "file": "evaluation_service.delete_evaluation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteEvaluation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.DeleteEvaluation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "DeleteEvaluation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.DeleteEvaluation", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_DeleteEvaluationResult_async", + "title": "AgentService deleteEvaluationResult Sample", + "origin": "API_DEFINITION", + "description": " Deletes an evaluation result.", + "canonical": true, + "file": "evaluation_service.delete_evaluation_result.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteEvaluationResult", + "fullName": "google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationResult", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "DeleteEvaluationResult", + "fullName": "google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationResult", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_DeleteEvaluationDataset_async", + "title": "AgentService deleteEvaluationDataset Sample", + "origin": "API_DEFINITION", + "description": " Deletes an evaluation dataset.", + "canonical": true, + "file": "evaluation_service.delete_evaluation_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteEvaluationDataset", + "fullName": "google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "DeleteEvaluationDataset", + "fullName": "google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationDataset", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_DeleteEvaluationRun_async", + "title": "AgentService deleteEvaluationRun Sample", + "origin": "API_DEFINITION", + "description": " Deletes an evaluation run.", + "canonical": true, + "file": "evaluation_service.delete_evaluation_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteEvaluationRun", + "fullName": "google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "DeleteEvaluationRun", + "fullName": "google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationRun", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_GetEvaluation_async", + "title": "AgentService getEvaluation Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified evaluation.", + "canonical": true, + "file": "evaluation_service.get_evaluation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEvaluation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.GetEvaluation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.Evaluation", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "GetEvaluation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.GetEvaluation", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_GetEvaluationResult_async", + "title": "AgentService getEvaluationResult Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified evaluation result.", + "canonical": true, + "file": "evaluation_service.get_evaluation_result.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEvaluationResult", + "fullName": "google.cloud.ces.v1beta.EvaluationService.GetEvaluationResult", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.EvaluationResult", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "GetEvaluationResult", + "fullName": "google.cloud.ces.v1beta.EvaluationService.GetEvaluationResult", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_GetEvaluationDataset_async", + "title": "AgentService getEvaluationDataset Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified evaluation dataset.", + "canonical": true, + "file": "evaluation_service.get_evaluation_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEvaluationDataset", + "fullName": "google.cloud.ces.v1beta.EvaluationService.GetEvaluationDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.EvaluationDataset", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "GetEvaluationDataset", + "fullName": "google.cloud.ces.v1beta.EvaluationService.GetEvaluationDataset", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_GetEvaluationRun_async", + "title": "AgentService getEvaluationRun Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified evaluation run.", + "canonical": true, + "file": "evaluation_service.get_evaluation_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEvaluationRun", + "fullName": "google.cloud.ces.v1beta.EvaluationService.GetEvaluationRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.EvaluationRun", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "GetEvaluationRun", + "fullName": "google.cloud.ces.v1beta.EvaluationService.GetEvaluationRun", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_ListEvaluations_async", + "title": "AgentService listEvaluations Sample", + "origin": "API_DEFINITION", + "description": " Lists all evaluations in the given app.", + "canonical": true, + "file": "evaluation_service.list_evaluations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 93, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEvaluations", + "fullName": "google.cloud.ces.v1beta.EvaluationService.ListEvaluations", + "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": "evaluation_filter", + "type": "TYPE_STRING" + }, + { + "name": "evaluation_run_filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "last_ten_results", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.ces.v1beta.ListEvaluationsResponse", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "ListEvaluations", + "fullName": "google.cloud.ces.v1beta.EvaluationService.ListEvaluations", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_ListEvaluationResults_async", + "title": "AgentService listEvaluationResults Sample", + "origin": "API_DEFINITION", + "description": " Lists all evaluation results for a given evaluation.", + "canonical": true, + "file": "evaluation_service.list_evaluation_results.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEvaluationResults", + "fullName": "google.cloud.ces.v1beta.EvaluationService.ListEvaluationResults", + "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.ces.v1beta.ListEvaluationResultsResponse", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "ListEvaluationResults", + "fullName": "google.cloud.ces.v1beta.EvaluationService.ListEvaluationResults", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_ListEvaluationDatasets_async", + "title": "AgentService listEvaluationDatasets Sample", + "origin": "API_DEFINITION", + "description": " Lists all evaluation datasets in the given app.", + "canonical": true, + "file": "evaluation_service.list_evaluation_datasets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEvaluationDatasets", + "fullName": "google.cloud.ces.v1beta.EvaluationService.ListEvaluationDatasets", + "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.ces.v1beta.ListEvaluationDatasetsResponse", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "ListEvaluationDatasets", + "fullName": "google.cloud.ces.v1beta.EvaluationService.ListEvaluationDatasets", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_ListEvaluationRuns_async", + "title": "AgentService listEvaluationRuns Sample", + "origin": "API_DEFINITION", + "description": " Lists all evaluation runs in the given app.", + "canonical": true, + "file": "evaluation_service.list_evaluation_runs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEvaluationRuns", + "fullName": "google.cloud.ces.v1beta.EvaluationService.ListEvaluationRuns", + "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.ces.v1beta.ListEvaluationRunsResponse", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "ListEvaluationRuns", + "fullName": "google.cloud.ces.v1beta.EvaluationService.ListEvaluationRuns", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_ListEvaluationExpectations_async", + "title": "AgentService listEvaluationExpectations Sample", + "origin": "API_DEFINITION", + "description": " Lists all evaluation expectations in the given app.", + "canonical": true, + "file": "evaluation_service.list_evaluation_expectations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEvaluationExpectations", + "fullName": "google.cloud.ces.v1beta.EvaluationService.ListEvaluationExpectations", + "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.ces.v1beta.ListEvaluationExpectationsResponse", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "ListEvaluationExpectations", + "fullName": "google.cloud.ces.v1beta.EvaluationService.ListEvaluationExpectations", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_GetEvaluationExpectation_async", + "title": "AgentService getEvaluationExpectation Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified evaluation expectation.", + "canonical": true, + "file": "evaluation_service.get_evaluation_expectation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEvaluationExpectation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.GetEvaluationExpectation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.EvaluationExpectation", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "GetEvaluationExpectation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.GetEvaluationExpectation", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_CreateEvaluationExpectation_async", + "title": "AgentService createEvaluationExpectation Sample", + "origin": "API_DEFINITION", + "description": " Creates an evaluation expectation.", + "canonical": true, + "file": "evaluation_service.create_evaluation_expectation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateEvaluationExpectation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.CreateEvaluationExpectation", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "evaluation_expectation_id", + "type": "TYPE_STRING" + }, + { + "name": "evaluation_expectation", + "type": ".google.cloud.ces.v1beta.EvaluationExpectation" + } + ], + "resultType": ".google.cloud.ces.v1beta.EvaluationExpectation", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "CreateEvaluationExpectation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.CreateEvaluationExpectation", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_UpdateEvaluationExpectation_async", + "title": "AgentService updateEvaluationExpectation Sample", + "origin": "API_DEFINITION", + "description": " Updates an evaluation expectation.", + "canonical": true, + "file": "evaluation_service.update_evaluation_expectation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateEvaluationExpectation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationExpectation", + "async": true, + "parameters": [ + { + "name": "evaluation_expectation", + "type": ".google.cloud.ces.v1beta.EvaluationExpectation" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.ces.v1beta.EvaluationExpectation", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "UpdateEvaluationExpectation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationExpectation", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_DeleteEvaluationExpectation_async", + "title": "AgentService deleteEvaluationExpectation Sample", + "origin": "API_DEFINITION", + "description": " Deletes an evaluation expectation.", + "canonical": true, + "file": "evaluation_service.delete_evaluation_expectation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteEvaluationExpectation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationExpectation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "DeleteEvaluationExpectation", + "fullName": "google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationExpectation", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_CreateScheduledEvaluationRun_async", + "title": "AgentService createScheduledEvaluationRun Sample", + "origin": "API_DEFINITION", + "description": " Creates a scheduled evaluation run.", + "canonical": true, + "file": "evaluation_service.create_scheduled_evaluation_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateScheduledEvaluationRun", + "fullName": "google.cloud.ces.v1beta.EvaluationService.CreateScheduledEvaluationRun", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "scheduled_evaluation_run_id", + "type": "TYPE_STRING" + }, + { + "name": "scheduled_evaluation_run", + "type": ".google.cloud.ces.v1beta.ScheduledEvaluationRun" + } + ], + "resultType": ".google.cloud.ces.v1beta.ScheduledEvaluationRun", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "CreateScheduledEvaluationRun", + "fullName": "google.cloud.ces.v1beta.EvaluationService.CreateScheduledEvaluationRun", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_GetScheduledEvaluationRun_async", + "title": "AgentService getScheduledEvaluationRun Sample", + "origin": "API_DEFINITION", + "description": " Gets details of the specified scheduled evaluation run.", + "canonical": true, + "file": "evaluation_service.get_scheduled_evaluation_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetScheduledEvaluationRun", + "fullName": "google.cloud.ces.v1beta.EvaluationService.GetScheduledEvaluationRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.ScheduledEvaluationRun", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "GetScheduledEvaluationRun", + "fullName": "google.cloud.ces.v1beta.EvaluationService.GetScheduledEvaluationRun", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_ListScheduledEvaluationRuns_async", + "title": "AgentService listScheduledEvaluationRuns Sample", + "origin": "API_DEFINITION", + "description": " Lists all scheduled evaluation runs in the given app.", + "canonical": true, + "file": "evaluation_service.list_scheduled_evaluation_runs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 86, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListScheduledEvaluationRuns", + "fullName": "google.cloud.ces.v1beta.EvaluationService.ListScheduledEvaluationRuns", + "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.ces.v1beta.ListScheduledEvaluationRunsResponse", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "ListScheduledEvaluationRuns", + "fullName": "google.cloud.ces.v1beta.EvaluationService.ListScheduledEvaluationRuns", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_UpdateScheduledEvaluationRun_async", + "title": "AgentService updateScheduledEvaluationRun Sample", + "origin": "API_DEFINITION", + "description": " Updates a scheduled evaluation run.", + "canonical": true, + "file": "evaluation_service.update_scheduled_evaluation_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateScheduledEvaluationRun", + "fullName": "google.cloud.ces.v1beta.EvaluationService.UpdateScheduledEvaluationRun", + "async": true, + "parameters": [ + { + "name": "scheduled_evaluation_run", + "type": ".google.cloud.ces.v1beta.ScheduledEvaluationRun" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.ces.v1beta.ScheduledEvaluationRun", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "UpdateScheduledEvaluationRun", + "fullName": "google.cloud.ces.v1beta.EvaluationService.UpdateScheduledEvaluationRun", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_DeleteScheduledEvaluationRun_async", + "title": "AgentService deleteScheduledEvaluationRun Sample", + "origin": "API_DEFINITION", + "description": " Deletes a scheduled evaluation run.", + "canonical": true, + "file": "evaluation_service.delete_scheduled_evaluation_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteScheduledEvaluationRun", + "fullName": "google.cloud.ces.v1beta.EvaluationService.DeleteScheduledEvaluationRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "DeleteScheduledEvaluationRun", + "fullName": "google.cloud.ces.v1beta.EvaluationService.DeleteScheduledEvaluationRun", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_EvaluationService_TestPersonaVoice_async", + "title": "AgentService testPersonaVoice Sample", + "origin": "API_DEFINITION", + "description": " Tests the voice of a persona. Also accepts a default persona.", + "canonical": true, + "file": "evaluation_service.test_persona_voice.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestPersonaVoice", + "fullName": "google.cloud.ces.v1beta.EvaluationService.TestPersonaVoice", + "async": true, + "parameters": [ + { + "name": "app", + "type": "TYPE_STRING" + }, + { + "name": "persona_id", + "type": "TYPE_STRING" + }, + { + "name": "text", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.TestPersonaVoiceResponse", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.ces.v1beta.EvaluationServiceClient" + }, + "method": { + "shortName": "TestPersonaVoice", + "fullName": "google.cloud.ces.v1beta.EvaluationService.TestPersonaVoice", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.ces.v1beta.EvaluationService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_SessionService_RunSession_async", + "title": "AgentService runSession Sample", + "origin": "API_DEFINITION", + "description": " Initiates a single turn interaction with the CES agent within a session.", + "canonical": true, + "file": "session_service.run_session.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunSession", + "fullName": "google.cloud.ces.v1beta.SessionService.RunSession", + "async": true, + "parameters": [ + { + "name": "config", + "type": ".google.cloud.ces.v1beta.SessionConfig" + }, + { + "name": "inputs", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.ces.v1beta.RunSessionResponse", + "client": { + "shortName": "SessionServiceClient", + "fullName": "google.cloud.ces.v1beta.SessionServiceClient" + }, + "method": { + "shortName": "RunSession", + "fullName": "google.cloud.ces.v1beta.SessionService.RunSession", + "service": { + "shortName": "SessionService", + "fullName": "google.cloud.ces.v1beta.SessionService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_SessionService_BidiRunSession_async", + "title": "AgentService bidiRunSession Sample", + "origin": "API_DEFINITION", + "description": " Establishes a bidirectional streaming connection with the CES agent. The agent processes continuous multimodal inputs (e.g., text, audio) and generates real-time multimodal output streams. --- Client Request Stream --- The client streams requests in the following order: 1. Initialization: The first message must contain [SessionConfig][google.cloud.ces.v1beta.BidiSessionClientMessage.config]. For audio sessions, this should also include [InputAudioConfig][google.cloud.ces.v1beta.SessionConfig.input_audio_config] and [OutputAudioConfig][google.cloud.ces.v1beta.SessionConfig.output_audio_config] to define audio processing and synthesis parameters. 2. Interaction: Subsequent messages stream [SessionInput][google.cloud.ces.v1beta.BidiSessionClientMessage.realtime_input] containing real-time user input data. 3. Termination: The client should half-close the stream when there is no more user input. It should also half-close upon receiving [EndSession][google.cloud.ces.v1beta.BidiSessionServerMessage.end_session] or [GoAway][google.cloud.ces.v1beta.BidiSessionServerMessage.go_away] from the agent. --- Server Response Stream --- For each interaction turn, the agent streams messages in the following sequence: 1. Speech Recognition (First N messages): Contains [RecognitionResult][google.cloud.ces.v1beta.BidiSessionServerMessage.recognition_result] representing the concatenated user speech segments captured so far. This is only populated for audio sessions. 2. Response (Next M messages): Contains [SessionOutput][google.cloud.ces.v1beta.BidiSessionServerMessage.session_output] delivering the agent's response in various modalities (e.g., text, audio). 3. Turn Completion (Final message of the turn): Contains [SessionOutput][google.cloud.ces.v1beta.BidiSessionServerMessage.session_output] with [turn_completed][google.cloud.ces.v1beta.SessionOutput.turn_completed] set to true. This signals the end of the current turn and includes [DiagnosticInfo][google.cloud.ces.v1beta.SessionOutput.diagnostic_info] with execution details. --- Audio Best Practices --- 1. Streaming: Stream [audio data][google.cloud.ces.v1beta.SessionInput.audio] **CONTINUOUSLY**, even during silence. Recommended chunk size: 40-120ms (balances latency vs. efficiency). 2. Playback & Interruption: Play [audio responses][google.cloud.ces.v1beta.SessionOutput.audio] upon receipt. Stop playback immediately if an [InterruptionSignal][google.cloud.ces.v1beta.BidiSessionServerMessage.interruption_signal] is received (e.g., user barge-in or new agent response).", + "canonical": true, + "file": "session_service.bidi_run_session.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BidiRunSession", + "fullName": "google.cloud.ces.v1beta.SessionService.BidiRunSession", + "async": true, + "parameters": [ + { + "name": "config", + "type": ".google.cloud.ces.v1beta.SessionConfig" + }, + { + "name": "realtime_input", + "type": ".google.cloud.ces.v1beta.SessionInput" + } + ], + "resultType": ".google.cloud.ces.v1beta.BidiSessionServerMessage", + "client": { + "shortName": "SessionServiceClient", + "fullName": "google.cloud.ces.v1beta.SessionServiceClient" + }, + "method": { + "shortName": "BidiRunSession", + "fullName": "google.cloud.ces.v1beta.SessionService.BidiRunSession", + "service": { + "shortName": "SessionService", + "fullName": "google.cloud.ces.v1beta.SessionService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_ToolService_ExecuteTool_async", + "title": "AgentService executeTool Sample", + "origin": "API_DEFINITION", + "description": " Executes the given tool with the given arguments.", + "canonical": true, + "file": "tool_service.execute_tool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExecuteTool", + "fullName": "google.cloud.ces.v1beta.ToolService.ExecuteTool", + "async": true, + "parameters": [ + { + "name": "tool", + "type": "TYPE_STRING" + }, + { + "name": "toolset_tool", + "type": ".google.cloud.ces.v1beta.ToolsetTool" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "args", + "type": ".google.protobuf.Struct" + }, + { + "name": "variables", + "type": ".google.protobuf.Struct" + } + ], + "resultType": ".google.cloud.ces.v1beta.ExecuteToolResponse", + "client": { + "shortName": "ToolServiceClient", + "fullName": "google.cloud.ces.v1beta.ToolServiceClient" + }, + "method": { + "shortName": "ExecuteTool", + "fullName": "google.cloud.ces.v1beta.ToolService.ExecuteTool", + "service": { + "shortName": "ToolService", + "fullName": "google.cloud.ces.v1beta.ToolService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_ToolService_RetrieveToolSchema_async", + "title": "AgentService retrieveToolSchema Sample", + "origin": "API_DEFINITION", + "description": " Retrieve the schema of the given tool. The schema is computed on the fly for the given instance of the tool.", + "canonical": true, + "file": "tool_service.retrieve_tool_schema.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RetrieveToolSchema", + "fullName": "google.cloud.ces.v1beta.ToolService.RetrieveToolSchema", + "async": true, + "parameters": [ + { + "name": "tool", + "type": "TYPE_STRING" + }, + { + "name": "toolset_tool", + "type": ".google.cloud.ces.v1beta.ToolsetTool" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.RetrieveToolSchemaResponse", + "client": { + "shortName": "ToolServiceClient", + "fullName": "google.cloud.ces.v1beta.ToolServiceClient" + }, + "method": { + "shortName": "RetrieveToolSchema", + "fullName": "google.cloud.ces.v1beta.ToolService.RetrieveToolSchema", + "service": { + "shortName": "ToolService", + "fullName": "google.cloud.ces.v1beta.ToolService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_ToolService_RetrieveTools_async", + "title": "AgentService retrieveTools Sample", + "origin": "API_DEFINITION", + "description": " Retrieve the list of tools included in the specified toolset.", + "canonical": true, + "file": "tool_service.retrieve_tools.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RetrieveTools", + "fullName": "google.cloud.ces.v1beta.ToolService.RetrieveTools", + "async": true, + "parameters": [ + { + "name": "toolset", + "type": "TYPE_STRING" + }, + { + "name": "tool_ids", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.ces.v1beta.RetrieveToolsResponse", + "client": { + "shortName": "ToolServiceClient", + "fullName": "google.cloud.ces.v1beta.ToolServiceClient" + }, + "method": { + "shortName": "RetrieveTools", + "fullName": "google.cloud.ces.v1beta.ToolService.RetrieveTools", + "service": { + "shortName": "ToolService", + "fullName": "google.cloud.ces.v1beta.ToolService" + } + } + } + }, + { + "regionTag": "ces_v1beta_generated_WidgetService_GenerateChatToken_async", + "title": "AgentService generateChatToken Sample", + "origin": "API_DEFINITION", + "description": " Generates a session scoped token for chat widget to authenticate with Session APIs.", + "canonical": true, + "file": "widget_service.generate_chat_token.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateChatToken", + "fullName": "google.cloud.ces.v1beta.WidgetService.GenerateChatToken", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "deployment", + "type": "TYPE_STRING" + }, + { + "name": "recaptcha_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.ces.v1beta.GenerateChatTokenResponse", + "client": { + "shortName": "WidgetServiceClient", + "fullName": "google.cloud.ces.v1beta.WidgetServiceClient" + }, + "method": { + "shortName": "GenerateChatToken", + "fullName": "google.cloud.ces.v1beta.WidgetService.GenerateChatToken", + "service": { + "shortName": "WidgetService", + "fullName": "google.cloud.ces.v1beta.WidgetService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/tool_service.execute_tool.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/tool_service.execute_tool.js new file mode 100644 index 00000000000..36e967fbe13 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/tool_service.execute_tool.js @@ -0,0 +1,82 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START ces_v1beta_generated_ToolService_ExecuteTool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 name of the tool to execute. + * Format: + * projects/{project}/locations/{location}/apps/{app}/tools/{tool} + */ + // const tool = 'abc123' + /** + * Optional. The toolset tool to execute. Only one tool should match the + * predicate from the toolset. Otherwise, an error will be returned. + */ + // const toolsetTool = {} + /** + * Required. The resource name of the app which the tool/toolset belongs to. + * Format: `projects/{project}/locations/{location}/apps/{app}` + */ + // const parent = 'abc123' + /** + * Optional. The input parameters and values for the tool in JSON object + * format. + */ + // const args = {} + /** + * Optional. The variables that are available for the tool execution. + */ + // const variables = {} + + // Imports the Ces library + const {ToolServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new ToolServiceClient(); + + async function callExecuteTool() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await cesClient.executeTool(request); + console.log(response); + } + + callExecuteTool(); + // [END ces_v1beta_generated_ToolService_ExecuteTool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tool_schema.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tool_schema.js new file mode 100644 index 00000000000..598ac597523 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tool_schema.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 ces_v1beta_generated_ToolService_RetrieveToolSchema_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 name of the tool to retrieve the schema for. + * Format: + * projects/{project}/locations/{location}/apps/{app}/tools/{tool} + */ + // const tool = 'abc123' + /** + * Optional. The toolset tool to retrieve the schema for. Only one tool + * should match the predicate from the toolset. Otherwise, an error will be + * returned. + */ + // const toolsetTool = {} + /** + * Required. The resource name of the app which the tool/toolset belongs to. + * Format: `projects/{project}/locations/{location}/apps/{app}` + */ + // const parent = 'abc123' + + // Imports the Ces library + const {ToolServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new ToolServiceClient(); + + async function callRetrieveToolSchema() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await cesClient.retrieveToolSchema(request); + console.log(response); + } + + callRetrieveToolSchema(); + // [END ces_v1beta_generated_ToolService_RetrieveToolSchema_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tools.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tools.js new file mode 100644 index 00000000000..5c9ba21ceea --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tools.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(toolset) { + // [START ces_v1beta_generated_ToolService_RetrieveTools_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 toolset to retrieve the tools for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + */ + // const toolset = 'abc123' + /** + * Optional. The identifiers of the tools to retrieve from the toolset. + * If empty, all tools in the toolset will be returned. + */ + // const toolIds = ['abc','def'] + + // Imports the Ces library + const {ToolServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new ToolServiceClient(); + + async function callRetrieveTools() { + // Construct request + const request = { + toolset, + }; + + // Run request + const response = await cesClient.retrieveTools(request); + console.log(response); + } + + callRetrieveTools(); + // [END ces_v1beta_generated_ToolService_RetrieveTools_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/widget_service.generate_chat_token.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/widget_service.generate_chat_token.js new file mode 100644 index 00000000000..89bd647db1d --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/widget_service.generate_chat_token.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, deployment) { + // [START ces_v1beta_generated_WidgetService_GenerateChatToken_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 session name to generate the chat token for. + * Format: + * projects/{project}/locations/{location}/apps/{app}/sessions/{session} + */ + // const name = 'abc123' + /** + * Required. The deployment of the app to use for the session. + * Format: + * projects/{project}/locations/{location}/apps/{app}/deployments/{deployment} + */ + // const deployment = 'abc123' + /** + * Optional. The reCAPTCHA token generated by the client-side chat widget. + */ + // const recaptchaToken = 'abc123' + + // Imports the Ces library + const {WidgetServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new WidgetServiceClient(); + + async function callGenerateChatToken() { + // Construct request + const request = { + name, + deployment, + }; + + // Run request + const response = await cesClient.generateChatToken(request); + console.log(response); + } + + callGenerateChatToken(); + // [END ces_v1beta_generated_WidgetService_GenerateChatToken_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/src/index.ts b/owl-bot-staging/google-cloud-ces/src/index.ts new file mode 100644 index 00000000000..d7aa3bc90a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/index.ts @@ -0,0 +1,34 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +import * as v1beta from './v1beta'; + +const AgentServiceClient = v1.AgentServiceClient; +type AgentServiceClient = v1.AgentServiceClient; +const SessionServiceClient = v1.SessionServiceClient; +type SessionServiceClient = v1.SessionServiceClient; +const ToolServiceClient = v1.ToolServiceClient; +type ToolServiceClient = v1.ToolServiceClient; +const WidgetServiceClient = v1.WidgetServiceClient; +type WidgetServiceClient = v1.WidgetServiceClient; + +export {v1, v1beta, AgentServiceClient, SessionServiceClient, ToolServiceClient, WidgetServiceClient}; +export default {v1, v1beta, AgentServiceClient, SessionServiceClient, ToolServiceClient, WidgetServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/owl-bot-staging/google-cloud-ces/src/v1/agent_service_client.ts b/owl-bot-staging/google-cloud-ces/src/v1/agent_service_client.ts new file mode 100644 index 00000000000..f5b4a1e68cd --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1/agent_service_client.ts @@ -0,0 +1,7641 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/agent_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './agent_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The service that manages agent-related resources in Gemini Enterprise for + * Customer Engagement (CES). + * @class + * @memberof v1 + */ +export class AgentServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('ces'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + agentServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AgentServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AgentServiceClient({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 AgentServiceClient; + 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 = 'ces.' + 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.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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/agents/{agent}' + ), + appPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}' + ), + appVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/versions/{version}' + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}' + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}' + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/examples/{example}' + ), + guardrailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + omnichannelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/omnichannels/{omnichannel}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/tools/{tool}' + ), + toolsetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}' + ), + }; + + // 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 = { + listApps: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'apps'), + listAgents: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'agents'), + listExamples: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'examples'), + listTools: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tools'), + listConversations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'conversations'), + listGuardrails: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'guardrails'), + listDeployments: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'deployments'), + listToolsets: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'toolsets'), + listAppVersions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'appVersions'), + listChangelogs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'changelogs') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createAppResponse = protoFilesRoot.lookup( + '.google.cloud.ces.v1.App') as gax.protobuf.Type; + const createAppMetadata = protoFilesRoot.lookup( + '.google.cloud.ces.v1.OperationMetadata') as gax.protobuf.Type; + const deleteAppResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteAppMetadata = protoFilesRoot.lookup( + '.google.cloud.ces.v1.OperationMetadata') as gax.protobuf.Type; + const exportAppResponse = protoFilesRoot.lookup( + '.google.cloud.ces.v1.ExportAppResponse') as gax.protobuf.Type; + const exportAppMetadata = protoFilesRoot.lookup( + '.google.cloud.ces.v1.OperationMetadata') as gax.protobuf.Type; + const importAppResponse = protoFilesRoot.lookup( + '.google.cloud.ces.v1.ImportAppResponse') as gax.protobuf.Type; + const importAppMetadata = protoFilesRoot.lookup( + '.google.cloud.ces.v1.OperationMetadata') as gax.protobuf.Type; + const batchDeleteConversationsResponse = protoFilesRoot.lookup( + '.google.cloud.ces.v1.BatchDeleteConversationsResponse') as gax.protobuf.Type; + const batchDeleteConversationsMetadata = protoFilesRoot.lookup( + '.google.cloud.ces.v1.OperationMetadata') as gax.protobuf.Type; + const restoreAppVersionResponse = protoFilesRoot.lookup( + '.google.cloud.ces.v1.RestoreAppVersionResponse') as gax.protobuf.Type; + const restoreAppVersionMetadata = protoFilesRoot.lookup( + '.google.cloud.ces.v1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createApp: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createAppResponse.decode.bind(createAppResponse), + createAppMetadata.decode.bind(createAppMetadata)), + deleteApp: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteAppResponse.decode.bind(deleteAppResponse), + deleteAppMetadata.decode.bind(deleteAppMetadata)), + exportApp: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportAppResponse.decode.bind(exportAppResponse), + exportAppMetadata.decode.bind(exportAppMetadata)), + importApp: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importAppResponse.decode.bind(importAppResponse), + importAppMetadata.decode.bind(importAppMetadata)), + batchDeleteConversations: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchDeleteConversationsResponse.decode.bind(batchDeleteConversationsResponse), + batchDeleteConversationsMetadata.decode.bind(batchDeleteConversationsMetadata)), + restoreAppVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreAppVersionResponse.decode.bind(restoreAppVersionResponse), + restoreAppVersionMetadata.decode.bind(restoreAppVersionMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.ces.v1.AgentService', 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.agentServiceStub) { + return this.agentServiceStub; + } + + // Put together the "service stub" for + // google.cloud.ces.v1.AgentService. + this.agentServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.ces.v1.AgentService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.ces.v1.AgentService, + 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 agentServiceStubMethods = + ['listApps', 'getApp', 'createApp', 'updateApp', 'deleteApp', 'exportApp', 'importApp', 'listAgents', 'getAgent', 'createAgent', 'updateAgent', 'deleteAgent', 'listExamples', 'getExample', 'createExample', 'updateExample', 'deleteExample', 'listTools', 'getTool', 'listConversations', 'getConversation', 'deleteConversation', 'batchDeleteConversations', 'createTool', 'updateTool', 'deleteTool', 'listGuardrails', 'getGuardrail', 'createGuardrail', 'updateGuardrail', 'deleteGuardrail', 'listDeployments', 'getDeployment', 'createDeployment', 'updateDeployment', 'deleteDeployment', 'listToolsets', 'getToolset', 'createToolset', 'updateToolset', 'deleteToolset', 'listAppVersions', 'getAppVersion', 'createAppVersion', 'deleteAppVersion', 'restoreAppVersion', 'listChangelogs', 'getChangelog']; + for (const methodName of agentServiceStubMethods) { + const callPromise = this.agentServiceStub.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.agentServiceStub; + } + + /** + * 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 'ces.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 'ces.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/ces', + '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 the specified app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the app to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.App|App}. + * 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/agent_service.get_app.js + * region_tag:ces_v1_generated_AgentService_GetApp_async + */ + getApp( + request?: protos.google.cloud.ces.v1.IGetAppRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IApp, + protos.google.cloud.ces.v1.IGetAppRequest|undefined, {}|undefined + ]>; + getApp( + request: protos.google.cloud.ces.v1.IGetAppRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IApp, + protos.google.cloud.ces.v1.IGetAppRequest|null|undefined, + {}|null|undefined>): void; + getApp( + request: protos.google.cloud.ces.v1.IGetAppRequest, + callback: Callback< + protos.google.cloud.ces.v1.IApp, + protos.google.cloud.ces.v1.IGetAppRequest|null|undefined, + {}|null|undefined>): void; + getApp( + request?: protos.google.cloud.ces.v1.IGetAppRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IApp, + protos.google.cloud.ces.v1.IGetAppRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IApp, + protos.google.cloud.ces.v1.IGetAppRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IApp, + protos.google.cloud.ces.v1.IGetAppRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getApp request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IApp, + protos.google.cloud.ces.v1.IGetAppRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getApp response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getApp(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IApp, + protos.google.cloud.ces.v1.IGetAppRequest|undefined, + {}|undefined + ]) => { + this._log.info('getApp response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the specified app. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1.App} request.app + * Required. The app to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.App|App}. + * 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/agent_service.update_app.js + * region_tag:ces_v1_generated_AgentService_UpdateApp_async + */ + updateApp( + request?: protos.google.cloud.ces.v1.IUpdateAppRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IApp, + protos.google.cloud.ces.v1.IUpdateAppRequest|undefined, {}|undefined + ]>; + updateApp( + request: protos.google.cloud.ces.v1.IUpdateAppRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IApp, + protos.google.cloud.ces.v1.IUpdateAppRequest|null|undefined, + {}|null|undefined>): void; + updateApp( + request: protos.google.cloud.ces.v1.IUpdateAppRequest, + callback: Callback< + protos.google.cloud.ces.v1.IApp, + protos.google.cloud.ces.v1.IUpdateAppRequest|null|undefined, + {}|null|undefined>): void; + updateApp( + request?: protos.google.cloud.ces.v1.IUpdateAppRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IApp, + protos.google.cloud.ces.v1.IUpdateAppRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IApp, + protos.google.cloud.ces.v1.IUpdateAppRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IApp, + protos.google.cloud.ces.v1.IUpdateAppRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'app.name': request.app!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateApp request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IApp, + protos.google.cloud.ces.v1.IUpdateAppRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateApp response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateApp(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IApp, + protos.google.cloud.ces.v1.IUpdateAppRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateApp response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the agent to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Agent|Agent}. + * 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/agent_service.get_agent.js + * region_tag:ces_v1_generated_AgentService_GetAgent_async + */ + getAgent( + request?: protos.google.cloud.ces.v1.IGetAgentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.IGetAgentRequest|undefined, {}|undefined + ]>; + getAgent( + request: protos.google.cloud.ces.v1.IGetAgentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.IGetAgentRequest|null|undefined, + {}|null|undefined>): void; + getAgent( + request: protos.google.cloud.ces.v1.IGetAgentRequest, + callback: Callback< + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.IGetAgentRequest|null|undefined, + {}|null|undefined>): void; + getAgent( + request?: protos.google.cloud.ces.v1.IGetAgentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.IGetAgentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.IGetAgentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.IGetAgentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getAgent request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.IGetAgentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAgent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getAgent(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.IGetAgentRequest|undefined, + {}|undefined + ]) => { + this._log.info('getAgent response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new agent in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to create an agent in. + * @param {string} [request.agentId] + * Optional. The ID to use for the agent, which will become the final + * component of the agent's resource name. If not provided, a unique ID will + * be automatically assigned for the agent. + * @param {google.cloud.ces.v1.Agent} request.agent + * Required. The agent to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Agent|Agent}. + * 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/agent_service.create_agent.js + * region_tag:ces_v1_generated_AgentService_CreateAgent_async + */ + createAgent( + request?: protos.google.cloud.ces.v1.ICreateAgentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.ICreateAgentRequest|undefined, {}|undefined + ]>; + createAgent( + request: protos.google.cloud.ces.v1.ICreateAgentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.ICreateAgentRequest|null|undefined, + {}|null|undefined>): void; + createAgent( + request: protos.google.cloud.ces.v1.ICreateAgentRequest, + callback: Callback< + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.ICreateAgentRequest|null|undefined, + {}|null|undefined>): void; + createAgent( + request?: protos.google.cloud.ces.v1.ICreateAgentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.ICreateAgentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.ICreateAgentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.ICreateAgentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createAgent request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.ICreateAgentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createAgent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createAgent(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.ICreateAgentRequest|undefined, + {}|undefined + ]) => { + this._log.info('createAgent response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1.Agent} request.agent + * Required. The agent to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Agent|Agent}. + * 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/agent_service.update_agent.js + * region_tag:ces_v1_generated_AgentService_UpdateAgent_async + */ + updateAgent( + request?: protos.google.cloud.ces.v1.IUpdateAgentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.IUpdateAgentRequest|undefined, {}|undefined + ]>; + updateAgent( + request: protos.google.cloud.ces.v1.IUpdateAgentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.IUpdateAgentRequest|null|undefined, + {}|null|undefined>): void; + updateAgent( + request: protos.google.cloud.ces.v1.IUpdateAgentRequest, + callback: Callback< + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.IUpdateAgentRequest|null|undefined, + {}|null|undefined>): void; + updateAgent( + request?: protos.google.cloud.ces.v1.IUpdateAgentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.IUpdateAgentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.IUpdateAgentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.IUpdateAgentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'agent.name': request.agent!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateAgent request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.IUpdateAgentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateAgent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateAgent(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IAgent, + protos.google.cloud.ces.v1.IUpdateAgentRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateAgent response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the agent to delete. + * @param {boolean} [request.force] + * Optional. Indicates whether to forcefully delete the agent, even if it is + * still referenced by other app/agents/examples. + * + * * If `force = false`, the deletion fails if other agents/examples + * reference it. + * * If `force = true`, delete the agent and remove it from all referencing + * apps/agents/examples. + * @param {string} [request.etag] + * Optional. The current etag of the agent. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the agent, 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 {@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/agent_service.delete_agent.js + * region_tag:ces_v1_generated_AgentService_DeleteAgent_async + */ + deleteAgent( + request?: protos.google.cloud.ces.v1.IDeleteAgentRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteAgentRequest|undefined, {}|undefined + ]>; + deleteAgent( + request: protos.google.cloud.ces.v1.IDeleteAgentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteAgentRequest|null|undefined, + {}|null|undefined>): void; + deleteAgent( + request: protos.google.cloud.ces.v1.IDeleteAgentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteAgentRequest|null|undefined, + {}|null|undefined>): void; + deleteAgent( + request?: protos.google.cloud.ces.v1.IDeleteAgentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteAgentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteAgentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteAgentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteAgent request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteAgentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAgent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteAgent(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteAgentRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteAgent response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified example. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the example to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Example|Example}. + * 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/agent_service.get_example.js + * region_tag:ces_v1_generated_AgentService_GetExample_async + */ + getExample( + request?: protos.google.cloud.ces.v1.IGetExampleRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.IGetExampleRequest|undefined, {}|undefined + ]>; + getExample( + request: protos.google.cloud.ces.v1.IGetExampleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.IGetExampleRequest|null|undefined, + {}|null|undefined>): void; + getExample( + request: protos.google.cloud.ces.v1.IGetExampleRequest, + callback: Callback< + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.IGetExampleRequest|null|undefined, + {}|null|undefined>): void; + getExample( + request?: protos.google.cloud.ces.v1.IGetExampleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.IGetExampleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.IGetExampleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.IGetExampleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getExample request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.IGetExampleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getExample response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getExample(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.IGetExampleRequest|undefined, + {}|undefined + ]) => { + this._log.info('getExample response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new example in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to create an example in. + * @param {string} [request.exampleId] + * Optional. The ID to use for the example, which will become the final + * component of the example's resource name. If not provided, a unique ID will + * be automatically assigned for the example. + * @param {google.cloud.ces.v1.Example} request.example + * Required. The example to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Example|Example}. + * 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/agent_service.create_example.js + * region_tag:ces_v1_generated_AgentService_CreateExample_async + */ + createExample( + request?: protos.google.cloud.ces.v1.ICreateExampleRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.ICreateExampleRequest|undefined, {}|undefined + ]>; + createExample( + request: protos.google.cloud.ces.v1.ICreateExampleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.ICreateExampleRequest|null|undefined, + {}|null|undefined>): void; + createExample( + request: protos.google.cloud.ces.v1.ICreateExampleRequest, + callback: Callback< + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.ICreateExampleRequest|null|undefined, + {}|null|undefined>): void; + createExample( + request?: protos.google.cloud.ces.v1.ICreateExampleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.ICreateExampleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.ICreateExampleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.ICreateExampleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createExample request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.ICreateExampleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createExample response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createExample(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.ICreateExampleRequest|undefined, + {}|undefined + ]) => { + this._log.info('createExample response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the specified example. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1.Example} request.example + * Required. The example to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Example|Example}. + * 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/agent_service.update_example.js + * region_tag:ces_v1_generated_AgentService_UpdateExample_async + */ + updateExample( + request?: protos.google.cloud.ces.v1.IUpdateExampleRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.IUpdateExampleRequest|undefined, {}|undefined + ]>; + updateExample( + request: protos.google.cloud.ces.v1.IUpdateExampleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.IUpdateExampleRequest|null|undefined, + {}|null|undefined>): void; + updateExample( + request: protos.google.cloud.ces.v1.IUpdateExampleRequest, + callback: Callback< + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.IUpdateExampleRequest|null|undefined, + {}|null|undefined>): void; + updateExample( + request?: protos.google.cloud.ces.v1.IUpdateExampleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.IUpdateExampleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.IUpdateExampleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.IUpdateExampleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'example.name': request.example!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateExample request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.IUpdateExampleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateExample response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateExample(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IExample, + protos.google.cloud.ces.v1.IUpdateExampleRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateExample response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the specified example. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the example to delete. + * @param {string} [request.etag] + * Optional. The current etag of the example. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the example, 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 {@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/agent_service.delete_example.js + * region_tag:ces_v1_generated_AgentService_DeleteExample_async + */ + deleteExample( + request?: protos.google.cloud.ces.v1.IDeleteExampleRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteExampleRequest|undefined, {}|undefined + ]>; + deleteExample( + request: protos.google.cloud.ces.v1.IDeleteExampleRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteExampleRequest|null|undefined, + {}|null|undefined>): void; + deleteExample( + request: protos.google.cloud.ces.v1.IDeleteExampleRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteExampleRequest|null|undefined, + {}|null|undefined>): void; + deleteExample( + request?: protos.google.cloud.ces.v1.IDeleteExampleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteExampleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteExampleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteExampleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteExample request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteExampleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteExample response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteExample(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteExampleRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteExample response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified tool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the tool to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Tool|Tool}. + * 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/agent_service.get_tool.js + * region_tag:ces_v1_generated_AgentService_GetTool_async + */ + getTool( + request?: protos.google.cloud.ces.v1.IGetToolRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.IGetToolRequest|undefined, {}|undefined + ]>; + getTool( + request: protos.google.cloud.ces.v1.IGetToolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.IGetToolRequest|null|undefined, + {}|null|undefined>): void; + getTool( + request: protos.google.cloud.ces.v1.IGetToolRequest, + callback: Callback< + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.IGetToolRequest|null|undefined, + {}|null|undefined>): void; + getTool( + request?: protos.google.cloud.ces.v1.IGetToolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.IGetToolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.IGetToolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.IGetToolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getTool request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.IGetToolRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getTool(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.IGetToolRequest|undefined, + {}|undefined + ]) => { + this._log.info('getTool response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the conversation to retrieve. + * @param {google.cloud.ces.v1.Conversation.Source} [request.source] + * Optional. Indicate the source of the conversation. If not set, all source + * will be searched. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Conversation|Conversation}. + * 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/agent_service.get_conversation.js + * region_tag:ces_v1_generated_AgentService_GetConversation_async + */ + getConversation( + request?: protos.google.cloud.ces.v1.IGetConversationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IConversation, + protos.google.cloud.ces.v1.IGetConversationRequest|undefined, {}|undefined + ]>; + getConversation( + request: protos.google.cloud.ces.v1.IGetConversationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IConversation, + protos.google.cloud.ces.v1.IGetConversationRequest|null|undefined, + {}|null|undefined>): void; + getConversation( + request: protos.google.cloud.ces.v1.IGetConversationRequest, + callback: Callback< + protos.google.cloud.ces.v1.IConversation, + protos.google.cloud.ces.v1.IGetConversationRequest|null|undefined, + {}|null|undefined>): void; + getConversation( + request?: protos.google.cloud.ces.v1.IGetConversationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IConversation, + protos.google.cloud.ces.v1.IGetConversationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IConversation, + protos.google.cloud.ces.v1.IGetConversationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IConversation, + protos.google.cloud.ces.v1.IGetConversationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getConversation request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IConversation, + protos.google.cloud.ces.v1.IGetConversationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConversation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getConversation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IConversation, + protos.google.cloud.ces.v1.IGetConversationRequest|undefined, + {}|undefined + ]) => { + this._log.info('getConversation response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the specified conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the conversation to delete. + * @param {google.cloud.ces.v1.Conversation.Source} [request.source] + * Optional. Indicate the source of the conversation. If not set, Source.Live + * will be applied by default. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/agent_service.delete_conversation.js + * region_tag:ces_v1_generated_AgentService_DeleteConversation_async + */ + deleteConversation( + request?: protos.google.cloud.ces.v1.IDeleteConversationRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteConversationRequest|undefined, {}|undefined + ]>; + deleteConversation( + request: protos.google.cloud.ces.v1.IDeleteConversationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteConversationRequest|null|undefined, + {}|null|undefined>): void; + deleteConversation( + request: protos.google.cloud.ces.v1.IDeleteConversationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteConversationRequest|null|undefined, + {}|null|undefined>): void; + deleteConversation( + request?: protos.google.cloud.ces.v1.IDeleteConversationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteConversationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteConversationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteConversationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteConversation request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteConversationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteConversation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteConversation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteConversationRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteConversation response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new tool in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to create a tool in. + * @param {string} [request.toolId] + * Optional. The ID to use for the tool, which will become the final component + * of the tool's resource name. If not provided, a unique ID will be + * automatically assigned for the tool. + * @param {google.cloud.ces.v1.Tool} request.tool + * Required. The tool to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Tool|Tool}. + * 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/agent_service.create_tool.js + * region_tag:ces_v1_generated_AgentService_CreateTool_async + */ + createTool( + request?: protos.google.cloud.ces.v1.ICreateToolRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.ICreateToolRequest|undefined, {}|undefined + ]>; + createTool( + request: protos.google.cloud.ces.v1.ICreateToolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.ICreateToolRequest|null|undefined, + {}|null|undefined>): void; + createTool( + request: protos.google.cloud.ces.v1.ICreateToolRequest, + callback: Callback< + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.ICreateToolRequest|null|undefined, + {}|null|undefined>): void; + createTool( + request?: protos.google.cloud.ces.v1.ICreateToolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.ICreateToolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.ICreateToolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.ICreateToolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createTool request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.ICreateToolRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createTool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createTool(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.ICreateToolRequest|undefined, + {}|undefined + ]) => { + this._log.info('createTool response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the specified tool. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1.Tool} request.tool + * Required. The tool to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Tool|Tool}. + * 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/agent_service.update_tool.js + * region_tag:ces_v1_generated_AgentService_UpdateTool_async + */ + updateTool( + request?: protos.google.cloud.ces.v1.IUpdateToolRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.IUpdateToolRequest|undefined, {}|undefined + ]>; + updateTool( + request: protos.google.cloud.ces.v1.IUpdateToolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.IUpdateToolRequest|null|undefined, + {}|null|undefined>): void; + updateTool( + request: protos.google.cloud.ces.v1.IUpdateToolRequest, + callback: Callback< + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.IUpdateToolRequest|null|undefined, + {}|null|undefined>): void; + updateTool( + request?: protos.google.cloud.ces.v1.IUpdateToolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.IUpdateToolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.IUpdateToolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.IUpdateToolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'tool.name': request.tool!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateTool request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.IUpdateToolRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateTool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateTool(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.ITool, + protos.google.cloud.ces.v1.IUpdateToolRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateTool response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the specified tool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the tool to delete. + * @param {boolean} [request.force] + * Optional. Indicates whether to forcefully delete the tool, even if it is + * still referenced by agents/examples. + * + * * If `force = false`, the deletion will fail if any agents still + * reference the tool. + * * If `force = true`, all existing references from agents will be removed + * and the tool will be deleted. + * @param {string} [request.etag] + * Optional. The current etag of the tool. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the tool, 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 {@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/agent_service.delete_tool.js + * region_tag:ces_v1_generated_AgentService_DeleteTool_async + */ + deleteTool( + request?: protos.google.cloud.ces.v1.IDeleteToolRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteToolRequest|undefined, {}|undefined + ]>; + deleteTool( + request: protos.google.cloud.ces.v1.IDeleteToolRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteToolRequest|null|undefined, + {}|null|undefined>): void; + deleteTool( + request: protos.google.cloud.ces.v1.IDeleteToolRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteToolRequest|null|undefined, + {}|null|undefined>): void; + deleteTool( + request?: protos.google.cloud.ces.v1.IDeleteToolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteToolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteToolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteToolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteTool request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteToolRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteTool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteTool(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteToolRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteTool response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified guardrail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the guardrail to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Guardrail|Guardrail}. + * 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/agent_service.get_guardrail.js + * region_tag:ces_v1_generated_AgentService_GetGuardrail_async + */ + getGuardrail( + request?: protos.google.cloud.ces.v1.IGetGuardrailRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.IGetGuardrailRequest|undefined, {}|undefined + ]>; + getGuardrail( + request: protos.google.cloud.ces.v1.IGetGuardrailRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.IGetGuardrailRequest|null|undefined, + {}|null|undefined>): void; + getGuardrail( + request: protos.google.cloud.ces.v1.IGetGuardrailRequest, + callback: Callback< + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.IGetGuardrailRequest|null|undefined, + {}|null|undefined>): void; + getGuardrail( + request?: protos.google.cloud.ces.v1.IGetGuardrailRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.IGetGuardrailRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.IGetGuardrailRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.IGetGuardrailRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getGuardrail request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.IGetGuardrailRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getGuardrail response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getGuardrail(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.IGetGuardrailRequest|undefined, + {}|undefined + ]) => { + this._log.info('getGuardrail response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new guardrail in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to create a guardrail in. + * @param {string} [request.guardrailId] + * Optional. The ID to use for the guardrail, which will become the final + * component of the guardrail's resource name. If not provided, a unique ID + * will be automatically assigned for the guardrail. + * @param {google.cloud.ces.v1.Guardrail} request.guardrail + * Required. The guardrail to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Guardrail|Guardrail}. + * 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/agent_service.create_guardrail.js + * region_tag:ces_v1_generated_AgentService_CreateGuardrail_async + */ + createGuardrail( + request?: protos.google.cloud.ces.v1.ICreateGuardrailRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.ICreateGuardrailRequest|undefined, {}|undefined + ]>; + createGuardrail( + request: protos.google.cloud.ces.v1.ICreateGuardrailRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.ICreateGuardrailRequest|null|undefined, + {}|null|undefined>): void; + createGuardrail( + request: protos.google.cloud.ces.v1.ICreateGuardrailRequest, + callback: Callback< + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.ICreateGuardrailRequest|null|undefined, + {}|null|undefined>): void; + createGuardrail( + request?: protos.google.cloud.ces.v1.ICreateGuardrailRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.ICreateGuardrailRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.ICreateGuardrailRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.ICreateGuardrailRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createGuardrail request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.ICreateGuardrailRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createGuardrail response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createGuardrail(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.ICreateGuardrailRequest|undefined, + {}|undefined + ]) => { + this._log.info('createGuardrail response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the specified guardrail. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1.Guardrail} request.guardrail + * Required. The guardrail to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Guardrail|Guardrail}. + * 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/agent_service.update_guardrail.js + * region_tag:ces_v1_generated_AgentService_UpdateGuardrail_async + */ + updateGuardrail( + request?: protos.google.cloud.ces.v1.IUpdateGuardrailRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.IUpdateGuardrailRequest|undefined, {}|undefined + ]>; + updateGuardrail( + request: protos.google.cloud.ces.v1.IUpdateGuardrailRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.IUpdateGuardrailRequest|null|undefined, + {}|null|undefined>): void; + updateGuardrail( + request: protos.google.cloud.ces.v1.IUpdateGuardrailRequest, + callback: Callback< + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.IUpdateGuardrailRequest|null|undefined, + {}|null|undefined>): void; + updateGuardrail( + request?: protos.google.cloud.ces.v1.IUpdateGuardrailRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.IUpdateGuardrailRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.IUpdateGuardrailRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.IUpdateGuardrailRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'guardrail.name': request.guardrail!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateGuardrail request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.IUpdateGuardrailRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateGuardrail response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateGuardrail(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IGuardrail, + protos.google.cloud.ces.v1.IUpdateGuardrailRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateGuardrail response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the specified guardrail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the guardrail to delete. + * @param {boolean} [request.force] + * Optional. Indicates whether to forcefully delete the guardrail, even if it + * is still referenced by app/agents. + * + * * If `force = false`, the deletion fails if any apps/agents still + * reference the guardrail. + * * If `force = true`, all existing references from apps/agents will be + * removed and the guardrail will be deleted. + * @param {string} [request.etag] + * Optional. The current etag of the guardrail. If an etag is not provided, + * the deletion will overwrite any concurrent changes. If an etag is provided + * and does not match the current etag of the guardrail, 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 {@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/agent_service.delete_guardrail.js + * region_tag:ces_v1_generated_AgentService_DeleteGuardrail_async + */ + deleteGuardrail( + request?: protos.google.cloud.ces.v1.IDeleteGuardrailRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteGuardrailRequest|undefined, {}|undefined + ]>; + deleteGuardrail( + request: protos.google.cloud.ces.v1.IDeleteGuardrailRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteGuardrailRequest|null|undefined, + {}|null|undefined>): void; + deleteGuardrail( + request: protos.google.cloud.ces.v1.IDeleteGuardrailRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteGuardrailRequest|null|undefined, + {}|null|undefined>): void; + deleteGuardrail( + request?: protos.google.cloud.ces.v1.IDeleteGuardrailRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteGuardrailRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteGuardrailRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteGuardrailRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteGuardrail request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteGuardrailRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteGuardrail response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteGuardrail(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteGuardrailRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteGuardrail response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Deployment|Deployment}. + * 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/agent_service.get_deployment.js + * region_tag:ces_v1_generated_AgentService_GetDeployment_async + */ + getDeployment( + request?: protos.google.cloud.ces.v1.IGetDeploymentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.IGetDeploymentRequest|undefined, {}|undefined + ]>; + getDeployment( + request: protos.google.cloud.ces.v1.IGetDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.IGetDeploymentRequest|null|undefined, + {}|null|undefined>): void; + getDeployment( + request: protos.google.cloud.ces.v1.IGetDeploymentRequest, + callback: Callback< + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.IGetDeploymentRequest|null|undefined, + {}|null|undefined>): void; + getDeployment( + request?: protos.google.cloud.ces.v1.IGetDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.IGetDeploymentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.IGetDeploymentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.IGetDeploymentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getDeployment request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.IGetDeploymentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getDeployment(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.IGetDeploymentRequest|undefined, + {}|undefined + ]) => { + this._log.info('getDeployment response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new deployment in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent app. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + * @param {string} [request.deploymentId] + * Optional. The ID to use for the deployment, which will become the final + * component of the deployment's resource name. If not provided, a unique ID + * will be automatically assigned for the deployment. + * @param {google.cloud.ces.v1.Deployment} request.deployment + * Required. The deployment to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Deployment|Deployment}. + * 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/agent_service.create_deployment.js + * region_tag:ces_v1_generated_AgentService_CreateDeployment_async + */ + createDeployment( + request?: protos.google.cloud.ces.v1.ICreateDeploymentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.ICreateDeploymentRequest|undefined, {}|undefined + ]>; + createDeployment( + request: protos.google.cloud.ces.v1.ICreateDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.ICreateDeploymentRequest|null|undefined, + {}|null|undefined>): void; + createDeployment( + request: protos.google.cloud.ces.v1.ICreateDeploymentRequest, + callback: Callback< + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.ICreateDeploymentRequest|null|undefined, + {}|null|undefined>): void; + createDeployment( + request?: protos.google.cloud.ces.v1.ICreateDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.ICreateDeploymentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.ICreateDeploymentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.ICreateDeploymentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createDeployment request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.ICreateDeploymentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createDeployment(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.ICreateDeploymentRequest|undefined, + {}|undefined + ]) => { + this._log.info('createDeployment response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the specified deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1.Deployment} request.deployment + * Required. The deployment to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Deployment|Deployment}. + * 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/agent_service.update_deployment.js + * region_tag:ces_v1_generated_AgentService_UpdateDeployment_async + */ + updateDeployment( + request?: protos.google.cloud.ces.v1.IUpdateDeploymentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.IUpdateDeploymentRequest|undefined, {}|undefined + ]>; + updateDeployment( + request: protos.google.cloud.ces.v1.IUpdateDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.IUpdateDeploymentRequest|null|undefined, + {}|null|undefined>): void; + updateDeployment( + request: protos.google.cloud.ces.v1.IUpdateDeploymentRequest, + callback: Callback< + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.IUpdateDeploymentRequest|null|undefined, + {}|null|undefined>): void; + updateDeployment( + request?: protos.google.cloud.ces.v1.IUpdateDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.IUpdateDeploymentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.IUpdateDeploymentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.IUpdateDeploymentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'deployment.name': request.deployment!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateDeployment request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.IUpdateDeploymentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateDeployment(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IDeployment, + protos.google.cloud.ces.v1.IUpdateDeploymentRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateDeployment response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the specified deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment to delete. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` + * @param {string} [request.etag] + * Optional. The etag of the deployment. + * If an etag is provided and does not match the current etag of the + * deployment, 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 {@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/agent_service.delete_deployment.js + * region_tag:ces_v1_generated_AgentService_DeleteDeployment_async + */ + deleteDeployment( + request?: protos.google.cloud.ces.v1.IDeleteDeploymentRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteDeploymentRequest|undefined, {}|undefined + ]>; + deleteDeployment( + request: protos.google.cloud.ces.v1.IDeleteDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteDeploymentRequest|null|undefined, + {}|null|undefined>): void; + deleteDeployment( + request: protos.google.cloud.ces.v1.IDeleteDeploymentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteDeploymentRequest|null|undefined, + {}|null|undefined>): void; + deleteDeployment( + request?: protos.google.cloud.ces.v1.IDeleteDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteDeploymentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteDeploymentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteDeploymentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteDeployment request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteDeploymentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteDeployment(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteDeploymentRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteDeployment response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified toolset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the toolset to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Toolset|Toolset}. + * 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/agent_service.get_toolset.js + * region_tag:ces_v1_generated_AgentService_GetToolset_async + */ + getToolset( + request?: protos.google.cloud.ces.v1.IGetToolsetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.IGetToolsetRequest|undefined, {}|undefined + ]>; + getToolset( + request: protos.google.cloud.ces.v1.IGetToolsetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.IGetToolsetRequest|null|undefined, + {}|null|undefined>): void; + getToolset( + request: protos.google.cloud.ces.v1.IGetToolsetRequest, + callback: Callback< + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.IGetToolsetRequest|null|undefined, + {}|null|undefined>): void; + getToolset( + request?: protos.google.cloud.ces.v1.IGetToolsetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.IGetToolsetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.IGetToolsetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.IGetToolsetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getToolset request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.IGetToolsetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getToolset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getToolset(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.IGetToolsetRequest|undefined, + {}|undefined + ]) => { + this._log.info('getToolset response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new toolset in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to create a toolset in. + * @param {string} [request.toolsetId] + * Optional. The ID to use for the toolset, which will become the final + * component of the toolset's resource name. If not provided, a unique ID will + * be automatically assigned for the toolset. + * @param {google.cloud.ces.v1.Toolset} request.toolset + * Required. The toolset to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Toolset|Toolset}. + * 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/agent_service.create_toolset.js + * region_tag:ces_v1_generated_AgentService_CreateToolset_async + */ + createToolset( + request?: protos.google.cloud.ces.v1.ICreateToolsetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.ICreateToolsetRequest|undefined, {}|undefined + ]>; + createToolset( + request: protos.google.cloud.ces.v1.ICreateToolsetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.ICreateToolsetRequest|null|undefined, + {}|null|undefined>): void; + createToolset( + request: protos.google.cloud.ces.v1.ICreateToolsetRequest, + callback: Callback< + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.ICreateToolsetRequest|null|undefined, + {}|null|undefined>): void; + createToolset( + request?: protos.google.cloud.ces.v1.ICreateToolsetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.ICreateToolsetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.ICreateToolsetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.ICreateToolsetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createToolset request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.ICreateToolsetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createToolset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createToolset(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.ICreateToolsetRequest|undefined, + {}|undefined + ]) => { + this._log.info('createToolset response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the specified toolset. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1.Toolset} request.toolset + * Required. The toolset to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Toolset|Toolset}. + * 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/agent_service.update_toolset.js + * region_tag:ces_v1_generated_AgentService_UpdateToolset_async + */ + updateToolset( + request?: protos.google.cloud.ces.v1.IUpdateToolsetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.IUpdateToolsetRequest|undefined, {}|undefined + ]>; + updateToolset( + request: protos.google.cloud.ces.v1.IUpdateToolsetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.IUpdateToolsetRequest|null|undefined, + {}|null|undefined>): void; + updateToolset( + request: protos.google.cloud.ces.v1.IUpdateToolsetRequest, + callback: Callback< + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.IUpdateToolsetRequest|null|undefined, + {}|null|undefined>): void; + updateToolset( + request?: protos.google.cloud.ces.v1.IUpdateToolsetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.IUpdateToolsetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.IUpdateToolsetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.IUpdateToolsetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'toolset.name': request.toolset!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateToolset request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.IUpdateToolsetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateToolset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateToolset(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IToolset, + protos.google.cloud.ces.v1.IUpdateToolsetRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateToolset response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the specified toolset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the toolset to delete. + * @param {boolean} [request.force] + * Optional. Indicates whether to forcefully delete the toolset, even if it is + * still referenced by app/agents. + * + * * If `force = false`, the deletion fails if any agents still + * reference the toolset. + * * If `force = true`, all existing references from agents will be + * removed and the toolset will be deleted. + * @param {string} [request.etag] + * Optional. The current etag of the toolset. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the toolset, 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 {@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/agent_service.delete_toolset.js + * region_tag:ces_v1_generated_AgentService_DeleteToolset_async + */ + deleteToolset( + request?: protos.google.cloud.ces.v1.IDeleteToolsetRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteToolsetRequest|undefined, {}|undefined + ]>; + deleteToolset( + request: protos.google.cloud.ces.v1.IDeleteToolsetRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteToolsetRequest|null|undefined, + {}|null|undefined>): void; + deleteToolset( + request: protos.google.cloud.ces.v1.IDeleteToolsetRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteToolsetRequest|null|undefined, + {}|null|undefined>): void; + deleteToolset( + request?: protos.google.cloud.ces.v1.IDeleteToolsetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteToolsetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteToolsetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteToolsetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteToolset request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteToolsetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteToolset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteToolset(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteToolsetRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteToolset response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified app version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the app version to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.AppVersion|AppVersion}. + * 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/agent_service.get_app_version.js + * region_tag:ces_v1_generated_AgentService_GetAppVersion_async + */ + getAppVersion( + request?: protos.google.cloud.ces.v1.IGetAppVersionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IAppVersion, + protos.google.cloud.ces.v1.IGetAppVersionRequest|undefined, {}|undefined + ]>; + getAppVersion( + request: protos.google.cloud.ces.v1.IGetAppVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IAppVersion, + protos.google.cloud.ces.v1.IGetAppVersionRequest|null|undefined, + {}|null|undefined>): void; + getAppVersion( + request: protos.google.cloud.ces.v1.IGetAppVersionRequest, + callback: Callback< + protos.google.cloud.ces.v1.IAppVersion, + protos.google.cloud.ces.v1.IGetAppVersionRequest|null|undefined, + {}|null|undefined>): void; + getAppVersion( + request?: protos.google.cloud.ces.v1.IGetAppVersionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IAppVersion, + protos.google.cloud.ces.v1.IGetAppVersionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IAppVersion, + protos.google.cloud.ces.v1.IGetAppVersionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IAppVersion, + protos.google.cloud.ces.v1.IGetAppVersionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getAppVersion request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IAppVersion, + protos.google.cloud.ces.v1.IGetAppVersionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAppVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getAppVersion(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IAppVersion, + protos.google.cloud.ces.v1.IGetAppVersionRequest|undefined, + {}|undefined + ]) => { + this._log.info('getAppVersion response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new app version in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to create an app version in. + * @param {string} [request.appVersionId] + * Optional. The ID to use for the app version, which will become the final + * component of the app version's resource name. If not provided, a unique ID + * will be automatically assigned for the app version. + * @param {google.cloud.ces.v1.AppVersion} request.appVersion + * Required. The app version to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.AppVersion|AppVersion}. + * 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/agent_service.create_app_version.js + * region_tag:ces_v1_generated_AgentService_CreateAppVersion_async + */ + createAppVersion( + request?: protos.google.cloud.ces.v1.ICreateAppVersionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IAppVersion, + protos.google.cloud.ces.v1.ICreateAppVersionRequest|undefined, {}|undefined + ]>; + createAppVersion( + request: protos.google.cloud.ces.v1.ICreateAppVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IAppVersion, + protos.google.cloud.ces.v1.ICreateAppVersionRequest|null|undefined, + {}|null|undefined>): void; + createAppVersion( + request: protos.google.cloud.ces.v1.ICreateAppVersionRequest, + callback: Callback< + protos.google.cloud.ces.v1.IAppVersion, + protos.google.cloud.ces.v1.ICreateAppVersionRequest|null|undefined, + {}|null|undefined>): void; + createAppVersion( + request?: protos.google.cloud.ces.v1.ICreateAppVersionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IAppVersion, + protos.google.cloud.ces.v1.ICreateAppVersionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IAppVersion, + protos.google.cloud.ces.v1.ICreateAppVersionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IAppVersion, + protos.google.cloud.ces.v1.ICreateAppVersionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createAppVersion request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IAppVersion, + protos.google.cloud.ces.v1.ICreateAppVersionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createAppVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createAppVersion(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IAppVersion, + protos.google.cloud.ces.v1.ICreateAppVersionRequest|undefined, + {}|undefined + ]) => { + this._log.info('createAppVersion response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the specified app version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the app version to delete. + * @param {string} [request.etag] + * Optional. The current etag of the app version. If an etag is not provided, + * the deletion will overwrite any concurrent changes. If an etag is provided + * and does not match the current etag of the app version, 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 {@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/agent_service.delete_app_version.js + * region_tag:ces_v1_generated_AgentService_DeleteAppVersion_async + */ + deleteAppVersion( + request?: protos.google.cloud.ces.v1.IDeleteAppVersionRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteAppVersionRequest|undefined, {}|undefined + ]>; + deleteAppVersion( + request: protos.google.cloud.ces.v1.IDeleteAppVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteAppVersionRequest|null|undefined, + {}|null|undefined>): void; + deleteAppVersion( + request: protos.google.cloud.ces.v1.IDeleteAppVersionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteAppVersionRequest|null|undefined, + {}|null|undefined>): void; + deleteAppVersion( + request?: protos.google.cloud.ces.v1.IDeleteAppVersionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteAppVersionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteAppVersionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteAppVersionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteAppVersion request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteAppVersionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAppVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteAppVersion(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1.IDeleteAppVersionRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteAppVersion response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets the specified changelog. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the changelog to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Changelog|Changelog}. + * 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/agent_service.get_changelog.js + * region_tag:ces_v1_generated_AgentService_GetChangelog_async + */ + getChangelog( + request?: protos.google.cloud.ces.v1.IGetChangelogRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IChangelog, + protos.google.cloud.ces.v1.IGetChangelogRequest|undefined, {}|undefined + ]>; + getChangelog( + request: protos.google.cloud.ces.v1.IGetChangelogRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IChangelog, + protos.google.cloud.ces.v1.IGetChangelogRequest|null|undefined, + {}|null|undefined>): void; + getChangelog( + request: protos.google.cloud.ces.v1.IGetChangelogRequest, + callback: Callback< + protos.google.cloud.ces.v1.IChangelog, + protos.google.cloud.ces.v1.IGetChangelogRequest|null|undefined, + {}|null|undefined>): void; + getChangelog( + request?: protos.google.cloud.ces.v1.IGetChangelogRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IChangelog, + protos.google.cloud.ces.v1.IGetChangelogRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IChangelog, + protos.google.cloud.ces.v1.IGetChangelogRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IChangelog, + protos.google.cloud.ces.v1.IGetChangelogRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getChangelog request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IChangelog, + protos.google.cloud.ces.v1.IGetChangelogRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getChangelog response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getChangelog(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IChangelog, + protos.google.cloud.ces.v1.IGetChangelogRequest|undefined, + {}|undefined + ]) => { + this._log.info('getChangelog response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Creates a new app in the given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location to create an app in. + * @param {string} [request.appId] + * Optional. The ID to use for the app, which will become the final component + * of the app's resource name. If not provided, a unique ID will be + * automatically assigned for the app. + * @param {google.cloud.ces.v1.App} request.app + * Required. The app to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/agent_service.create_app.js + * region_tag:ces_v1_generated_AgentService_CreateApp_async + */ + createApp( + request?: protos.google.cloud.ces.v1.ICreateAppRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createApp( + request: protos.google.cloud.ces.v1.ICreateAppRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createApp( + request: protos.google.cloud.ces.v1.ICreateAppRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createApp( + request?: protos.google.cloud.ces.v1.ICreateAppRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createApp response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createApp request %j', request); + return this.innerApiCalls.createApp(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createApp response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createApp()`. + * @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/agent_service.create_app.js + * region_tag:ces_v1_generated_AgentService_CreateApp_async + */ + async checkCreateAppProgress(name: string): Promise>{ + this._log.info('createApp long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createApp, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes the specified app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the app to delete. + * @param {string} [request.etag] + * Optional. The current etag of the app. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the app, 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/agent_service.delete_app.js + * region_tag:ces_v1_generated_AgentService_DeleteApp_async + */ + deleteApp( + request?: protos.google.cloud.ces.v1.IDeleteAppRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteApp( + request: protos.google.cloud.ces.v1.IDeleteAppRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteApp( + request: protos.google.cloud.ces.v1.IDeleteAppRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteApp( + request?: protos.google.cloud.ces.v1.IDeleteAppRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteApp response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteApp request %j', request); + return this.innerApiCalls.deleteApp(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteApp response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteApp()`. + * @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/agent_service.delete_app.js + * region_tag:ces_v1_generated_AgentService_DeleteApp_async + */ + async checkDeleteAppProgress(name: string): Promise>{ + this._log.info('deleteApp long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteApp, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Exports the specified app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the app to export. + * @param {google.cloud.ces.v1.ExportAppRequest.ExportFormat} request.exportFormat + * Required. The format to export the app in. + * @param {string} [request.gcsUri] + * Optional. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to which to export the + * app. The format of this URI must be `gs:///`. The + * exported app archive will be written directly to the specified GCS object. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/agent_service.export_app.js + * region_tag:ces_v1_generated_AgentService_ExportApp_async + */ + exportApp( + request?: protos.google.cloud.ces.v1.IExportAppRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + exportApp( + request: protos.google.cloud.ces.v1.IExportAppRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportApp( + request: protos.google.cloud.ces.v1.IExportAppRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportApp( + request?: protos.google.cloud.ces.v1.IExportAppRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportApp response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportApp request %j', request); + return this.innerApiCalls.exportApp(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('exportApp response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `exportApp()`. + * @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/agent_service.export_app.js + * region_tag:ces_v1_generated_AgentService_ExportApp_async + */ + async checkExportAppProgress(name: string): Promise>{ + this._log.info('exportApp long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportApp, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Imports the specified app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.gcsUri + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * from which to import app. The format of this URI must be + * `gs:///`. + * @param {Buffer} request.appContent + * Raw bytes representing the compressed zip file with the app folder + * structure. + * @param {string} request.parent + * Required. The parent resource name with the location of the app to import. + * @param {string} [request.displayName] + * Optional. The display name of the app to import. + * * If the app is created on import, and the display name is specified, + * the imported app will use this display name. If a conflict is detected + * with an existing app, a timestamp will be appended to the display name + * to make it unique. + * * If the app is a reimport, this field should not be set. Providing a + * display name during reimport will result in an INVALID_ARGUMENT error. + * @param {string} [request.appId] + * Optional. The ID to use for the imported app. + * * If not specified, a unique ID will be automatically assigned for + * the app. + * * Otherwise, the imported app will use this ID as the final component of + * its resource name. If an app with the same ID already exists at the + * specified location in the project, the content of the existing app will be + * replaced. + * @param {google.cloud.ces.v1.ImportAppRequest.ImportOptions} [request.importOptions] + * Optional. Options governing the import process for the app. + * @param {boolean} [request.ignoreAppLock] + * Optional. Flag for overriding the app lock during import. + * If set to true, the import process will ignore the app lock. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/agent_service.import_app.js + * region_tag:ces_v1_generated_AgentService_ImportApp_async + */ + importApp( + request?: protos.google.cloud.ces.v1.IImportAppRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + importApp( + request: protos.google.cloud.ces.v1.IImportAppRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importApp( + request: protos.google.cloud.ces.v1.IImportAppRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importApp( + request?: protos.google.cloud.ces.v1.IImportAppRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importApp response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importApp request %j', request); + return this.innerApiCalls.importApp(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('importApp response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `importApp()`. + * @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/agent_service.import_app.js + * region_tag:ces_v1_generated_AgentService_ImportApp_async + */ + async checkImportAppProgress(name: string): Promise>{ + this._log.info('importApp long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importApp, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Batch deletes the specified conversations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to delete conversations from. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + * @param {string[]} request.conversations + * Required. The resource names of the conversations to 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/v1/agent_service.batch_delete_conversations.js + * region_tag:ces_v1_generated_AgentService_BatchDeleteConversations_async + */ + batchDeleteConversations( + request?: protos.google.cloud.ces.v1.IBatchDeleteConversationsRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + batchDeleteConversations( + request: protos.google.cloud.ces.v1.IBatchDeleteConversationsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchDeleteConversations( + request: protos.google.cloud.ces.v1.IBatchDeleteConversationsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchDeleteConversations( + request?: protos.google.cloud.ces.v1.IBatchDeleteConversationsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('batchDeleteConversations response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchDeleteConversations request %j', request); + return this.innerApiCalls.batchDeleteConversations(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('batchDeleteConversations response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `batchDeleteConversations()`. + * @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/agent_service.batch_delete_conversations.js + * region_tag:ces_v1_generated_AgentService_BatchDeleteConversations_async + */ + async checkBatchDeleteConversationsProgress(name: string): Promise>{ + this._log.info('batchDeleteConversations long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchDeleteConversations, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Restores the specified app version. + * This will create a new app version from the current draft app and overwrite + * the current draft with the specified app version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the app version to restore. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/agent_service.restore_app_version.js + * region_tag:ces_v1_generated_AgentService_RestoreAppVersion_async + */ + restoreAppVersion( + request?: protos.google.cloud.ces.v1.IRestoreAppVersionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restoreAppVersion( + request: protos.google.cloud.ces.v1.IRestoreAppVersionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreAppVersion( + request: protos.google.cloud.ces.v1.IRestoreAppVersionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreAppVersion( + request?: protos.google.cloud.ces.v1.IRestoreAppVersionRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restoreAppVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreAppVersion request %j', request); + return this.innerApiCalls.restoreAppVersion(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('restoreAppVersion response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `restoreAppVersion()`. + * @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/agent_service.restore_app_version.js + * region_tag:ces_v1_generated_AgentService_RestoreAppVersion_async + */ + async checkRestoreAppVersionProgress(name: string): Promise>{ + this._log.info('restoreAppVersion long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreAppVersion, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists apps in the given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location to list apps from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListAppsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListApps|AgentService.ListApps} call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the apps. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.App|App}. + * 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 `listAppsAsync()` + * 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. + */ + listApps( + request?: protos.google.cloud.ces.v1.IListAppsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IApp[], + protos.google.cloud.ces.v1.IListAppsRequest|null, + protos.google.cloud.ces.v1.IListAppsResponse + ]>; + listApps( + request: protos.google.cloud.ces.v1.IListAppsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListAppsRequest, + protos.google.cloud.ces.v1.IListAppsResponse|null|undefined, + protos.google.cloud.ces.v1.IApp>): void; + listApps( + request: protos.google.cloud.ces.v1.IListAppsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListAppsRequest, + protos.google.cloud.ces.v1.IListAppsResponse|null|undefined, + protos.google.cloud.ces.v1.IApp>): void; + listApps( + request?: protos.google.cloud.ces.v1.IListAppsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1.IListAppsRequest, + protos.google.cloud.ces.v1.IListAppsResponse|null|undefined, + protos.google.cloud.ces.v1.IApp>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1.IListAppsRequest, + protos.google.cloud.ces.v1.IListAppsResponse|null|undefined, + protos.google.cloud.ces.v1.IApp>): + Promise<[ + protos.google.cloud.ces.v1.IApp[], + protos.google.cloud.ces.v1.IListAppsRequest|null, + protos.google.cloud.ces.v1.IListAppsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1.IListAppsRequest, + protos.google.cloud.ces.v1.IListAppsResponse|null|undefined, + protos.google.cloud.ces.v1.IApp>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listApps values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listApps request %j', request); + return this.innerApiCalls + .listApps(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1.IApp[], + protos.google.cloud.ces.v1.IListAppsRequest|null, + protos.google.cloud.ces.v1.IListAppsResponse + ]) => { + this._log.info('listApps values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listApps`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location to list apps from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListAppsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListApps|AgentService.ListApps} call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the apps. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1.App|App} 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 `listAppsAsync()` + * 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. + */ + listAppsStream( + request?: protos.google.cloud.ces.v1.IListAppsRequest, + 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['listApps']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listApps stream %j', request); + return this.descriptors.page.listApps.createStream( + this.innerApiCalls.listApps as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listApps`, 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 resource name of the location to list apps from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListAppsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListApps|AgentService.ListApps} call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the apps. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1.App|App}. 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/agent_service.list_apps.js + * region_tag:ces_v1_generated_AgentService_ListApps_async + */ + listAppsAsync( + request?: protos.google.cloud.ces.v1.IListAppsRequest, + 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['listApps']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listApps iterate %j', request); + return this.descriptors.page.listApps.asyncIterate( + this.innerApiCalls['listApps'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists agents in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list agents from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListAgentsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListAgents|AgentService.ListAgents} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the agents. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.Agent|Agent}. + * 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 `listAgentsAsync()` + * 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. + */ + listAgents( + request?: protos.google.cloud.ces.v1.IListAgentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IAgent[], + protos.google.cloud.ces.v1.IListAgentsRequest|null, + protos.google.cloud.ces.v1.IListAgentsResponse + ]>; + listAgents( + request: protos.google.cloud.ces.v1.IListAgentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListAgentsRequest, + protos.google.cloud.ces.v1.IListAgentsResponse|null|undefined, + protos.google.cloud.ces.v1.IAgent>): void; + listAgents( + request: protos.google.cloud.ces.v1.IListAgentsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListAgentsRequest, + protos.google.cloud.ces.v1.IListAgentsResponse|null|undefined, + protos.google.cloud.ces.v1.IAgent>): void; + listAgents( + request?: protos.google.cloud.ces.v1.IListAgentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1.IListAgentsRequest, + protos.google.cloud.ces.v1.IListAgentsResponse|null|undefined, + protos.google.cloud.ces.v1.IAgent>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1.IListAgentsRequest, + protos.google.cloud.ces.v1.IListAgentsResponse|null|undefined, + protos.google.cloud.ces.v1.IAgent>): + Promise<[ + protos.google.cloud.ces.v1.IAgent[], + protos.google.cloud.ces.v1.IListAgentsRequest|null, + protos.google.cloud.ces.v1.IListAgentsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1.IListAgentsRequest, + protos.google.cloud.ces.v1.IListAgentsResponse|null|undefined, + protos.google.cloud.ces.v1.IAgent>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAgents values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAgents request %j', request); + return this.innerApiCalls + .listAgents(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1.IAgent[], + protos.google.cloud.ces.v1.IListAgentsRequest|null, + protos.google.cloud.ces.v1.IListAgentsResponse + ]) => { + this._log.info('listAgents values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listAgents`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list agents from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListAgentsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListAgents|AgentService.ListAgents} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the agents. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1.Agent|Agent} 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 `listAgentsAsync()` + * 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. + */ + listAgentsStream( + request?: protos.google.cloud.ces.v1.IListAgentsRequest, + 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['listAgents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAgents stream %j', request); + return this.descriptors.page.listAgents.createStream( + this.innerApiCalls.listAgents as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAgents`, 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 resource name of the app to list agents from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListAgentsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListAgents|AgentService.ListAgents} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the agents. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1.Agent|Agent}. 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/agent_service.list_agents.js + * region_tag:ces_v1_generated_AgentService_ListAgents_async + */ + listAgentsAsync( + request?: protos.google.cloud.ces.v1.IListAgentsRequest, + 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['listAgents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAgents iterate %j', request); + return this.descriptors.page.listAgents.asyncIterate( + this.innerApiCalls['listAgents'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists examples in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list examples from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListExamplesResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListExamples|AgentService.ListExamples} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the examples. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.Example|Example}. + * 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 `listExamplesAsync()` + * 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. + */ + listExamples( + request?: protos.google.cloud.ces.v1.IListExamplesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IExample[], + protos.google.cloud.ces.v1.IListExamplesRequest|null, + protos.google.cloud.ces.v1.IListExamplesResponse + ]>; + listExamples( + request: protos.google.cloud.ces.v1.IListExamplesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListExamplesRequest, + protos.google.cloud.ces.v1.IListExamplesResponse|null|undefined, + protos.google.cloud.ces.v1.IExample>): void; + listExamples( + request: protos.google.cloud.ces.v1.IListExamplesRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListExamplesRequest, + protos.google.cloud.ces.v1.IListExamplesResponse|null|undefined, + protos.google.cloud.ces.v1.IExample>): void; + listExamples( + request?: protos.google.cloud.ces.v1.IListExamplesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1.IListExamplesRequest, + protos.google.cloud.ces.v1.IListExamplesResponse|null|undefined, + protos.google.cloud.ces.v1.IExample>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1.IListExamplesRequest, + protos.google.cloud.ces.v1.IListExamplesResponse|null|undefined, + protos.google.cloud.ces.v1.IExample>): + Promise<[ + protos.google.cloud.ces.v1.IExample[], + protos.google.cloud.ces.v1.IListExamplesRequest|null, + protos.google.cloud.ces.v1.IListExamplesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1.IListExamplesRequest, + protos.google.cloud.ces.v1.IListExamplesResponse|null|undefined, + protos.google.cloud.ces.v1.IExample>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listExamples values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listExamples request %j', request); + return this.innerApiCalls + .listExamples(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1.IExample[], + protos.google.cloud.ces.v1.IListExamplesRequest|null, + protos.google.cloud.ces.v1.IListExamplesResponse + ]) => { + this._log.info('listExamples values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listExamples`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list examples from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListExamplesResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListExamples|AgentService.ListExamples} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the examples. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1.Example|Example} 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 `listExamplesAsync()` + * 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. + */ + listExamplesStream( + request?: protos.google.cloud.ces.v1.IListExamplesRequest, + 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['listExamples']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listExamples stream %j', request); + return this.descriptors.page.listExamples.createStream( + this.innerApiCalls.listExamples as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listExamples`, 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 resource name of the app to list examples from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListExamplesResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListExamples|AgentService.ListExamples} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the examples. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1.Example|Example}. 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/agent_service.list_examples.js + * region_tag:ces_v1_generated_AgentService_ListExamples_async + */ + listExamplesAsync( + request?: protos.google.cloud.ces.v1.IListExamplesRequest, + 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['listExamples']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listExamples iterate %j', request); + return this.descriptors.page.listExamples.asyncIterate( + this.innerApiCalls['listExamples'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists tools in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list tools from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListToolsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListTools|AgentService.ListTools} call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the tools. Use + * "include_system_tools=true" to include system tools in the response. See + * https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.Tool|Tool}. + * 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 `listToolsAsync()` + * 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. + */ + listTools( + request?: protos.google.cloud.ces.v1.IListToolsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.ITool[], + protos.google.cloud.ces.v1.IListToolsRequest|null, + protos.google.cloud.ces.v1.IListToolsResponse + ]>; + listTools( + request: protos.google.cloud.ces.v1.IListToolsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListToolsRequest, + protos.google.cloud.ces.v1.IListToolsResponse|null|undefined, + protos.google.cloud.ces.v1.ITool>): void; + listTools( + request: protos.google.cloud.ces.v1.IListToolsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListToolsRequest, + protos.google.cloud.ces.v1.IListToolsResponse|null|undefined, + protos.google.cloud.ces.v1.ITool>): void; + listTools( + request?: protos.google.cloud.ces.v1.IListToolsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1.IListToolsRequest, + protos.google.cloud.ces.v1.IListToolsResponse|null|undefined, + protos.google.cloud.ces.v1.ITool>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1.IListToolsRequest, + protos.google.cloud.ces.v1.IListToolsResponse|null|undefined, + protos.google.cloud.ces.v1.ITool>): + Promise<[ + protos.google.cloud.ces.v1.ITool[], + protos.google.cloud.ces.v1.IListToolsRequest|null, + protos.google.cloud.ces.v1.IListToolsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1.IListToolsRequest, + protos.google.cloud.ces.v1.IListToolsResponse|null|undefined, + protos.google.cloud.ces.v1.ITool>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTools values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTools request %j', request); + return this.innerApiCalls + .listTools(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1.ITool[], + protos.google.cloud.ces.v1.IListToolsRequest|null, + protos.google.cloud.ces.v1.IListToolsResponse + ]) => { + this._log.info('listTools values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listTools`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list tools from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListToolsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListTools|AgentService.ListTools} call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the tools. Use + * "include_system_tools=true" to include system tools in the response. See + * https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1.Tool|Tool} 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 `listToolsAsync()` + * 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. + */ + listToolsStream( + request?: protos.google.cloud.ces.v1.IListToolsRequest, + 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['listTools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listTools stream %j', request); + return this.descriptors.page.listTools.createStream( + this.innerApiCalls.listTools as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTools`, 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 resource name of the app to list tools from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListToolsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListTools|AgentService.ListTools} call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the tools. Use + * "include_system_tools=true" to include system tools in the response. See + * https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1.Tool|Tool}. 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/agent_service.list_tools.js + * region_tag:ces_v1_generated_AgentService_ListTools_async + */ + listToolsAsync( + request?: protos.google.cloud.ces.v1.IListToolsRequest, + 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['listTools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listTools iterate %j', request); + return this.descriptors.page.listTools.asyncIterate( + this.innerApiCalls['listTools'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists conversations in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list conversations from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListConversationsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListConversations|AgentService.ListConversations} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the conversations. + * See https://google.aip.dev/160 for more details. + * @param {google.cloud.ces.v1.Conversation.Source} [request.source] + * Optional. Indicate the source of the conversation. If not set, Source.Live + * will be applied by default. Will be deprecated in favor of `sources` field. + * @param {number[]} [request.sources] + * Optional. Indicate the sources of the conversations. If not set, all + * available sources will be applied by default. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.Conversation|Conversation}. + * 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 `listConversationsAsync()` + * 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. + */ + listConversations( + request?: protos.google.cloud.ces.v1.IListConversationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IConversation[], + protos.google.cloud.ces.v1.IListConversationsRequest|null, + protos.google.cloud.ces.v1.IListConversationsResponse + ]>; + listConversations( + request: protos.google.cloud.ces.v1.IListConversationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListConversationsRequest, + protos.google.cloud.ces.v1.IListConversationsResponse|null|undefined, + protos.google.cloud.ces.v1.IConversation>): void; + listConversations( + request: protos.google.cloud.ces.v1.IListConversationsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListConversationsRequest, + protos.google.cloud.ces.v1.IListConversationsResponse|null|undefined, + protos.google.cloud.ces.v1.IConversation>): void; + listConversations( + request?: protos.google.cloud.ces.v1.IListConversationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1.IListConversationsRequest, + protos.google.cloud.ces.v1.IListConversationsResponse|null|undefined, + protos.google.cloud.ces.v1.IConversation>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1.IListConversationsRequest, + protos.google.cloud.ces.v1.IListConversationsResponse|null|undefined, + protos.google.cloud.ces.v1.IConversation>): + Promise<[ + protos.google.cloud.ces.v1.IConversation[], + protos.google.cloud.ces.v1.IListConversationsRequest|null, + protos.google.cloud.ces.v1.IListConversationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1.IListConversationsRequest, + protos.google.cloud.ces.v1.IListConversationsResponse|null|undefined, + protos.google.cloud.ces.v1.IConversation>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listConversations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listConversations request %j', request); + return this.innerApiCalls + .listConversations(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1.IConversation[], + protos.google.cloud.ces.v1.IListConversationsRequest|null, + protos.google.cloud.ces.v1.IListConversationsResponse + ]) => { + this._log.info('listConversations values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listConversations`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list conversations from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListConversationsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListConversations|AgentService.ListConversations} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the conversations. + * See https://google.aip.dev/160 for more details. + * @param {google.cloud.ces.v1.Conversation.Source} [request.source] + * Optional. Indicate the source of the conversation. If not set, Source.Live + * will be applied by default. Will be deprecated in favor of `sources` field. + * @param {number[]} [request.sources] + * Optional. Indicate the sources of the conversations. If not set, all + * available sources will be applied by default. + * @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.ces.v1.Conversation|Conversation} 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 `listConversationsAsync()` + * 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. + */ + listConversationsStream( + request?: protos.google.cloud.ces.v1.IListConversationsRequest, + 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['listConversations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listConversations stream %j', request); + return this.descriptors.page.listConversations.createStream( + this.innerApiCalls.listConversations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listConversations`, 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 resource name of the app to list conversations from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListConversationsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListConversations|AgentService.ListConversations} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the conversations. + * See https://google.aip.dev/160 for more details. + * @param {google.cloud.ces.v1.Conversation.Source} [request.source] + * Optional. Indicate the source of the conversation. If not set, Source.Live + * will be applied by default. Will be deprecated in favor of `sources` field. + * @param {number[]} [request.sources] + * Optional. Indicate the sources of the conversations. If not set, all + * available sources will be applied by default. + * @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.ces.v1.Conversation|Conversation}. 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/agent_service.list_conversations.js + * region_tag:ces_v1_generated_AgentService_ListConversations_async + */ + listConversationsAsync( + request?: protos.google.cloud.ces.v1.IListConversationsRequest, + 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['listConversations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listConversations iterate %j', request); + return this.descriptors.page.listConversations.asyncIterate( + this.innerApiCalls['listConversations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists guardrails in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list guardrails from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListGuardrailsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListGuardrails|AgentService.ListGuardrails} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the guardrails. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.Guardrail|Guardrail}. + * 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 `listGuardrailsAsync()` + * 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. + */ + listGuardrails( + request?: protos.google.cloud.ces.v1.IListGuardrailsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IGuardrail[], + protos.google.cloud.ces.v1.IListGuardrailsRequest|null, + protos.google.cloud.ces.v1.IListGuardrailsResponse + ]>; + listGuardrails( + request: protos.google.cloud.ces.v1.IListGuardrailsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListGuardrailsRequest, + protos.google.cloud.ces.v1.IListGuardrailsResponse|null|undefined, + protos.google.cloud.ces.v1.IGuardrail>): void; + listGuardrails( + request: protos.google.cloud.ces.v1.IListGuardrailsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListGuardrailsRequest, + protos.google.cloud.ces.v1.IListGuardrailsResponse|null|undefined, + protos.google.cloud.ces.v1.IGuardrail>): void; + listGuardrails( + request?: protos.google.cloud.ces.v1.IListGuardrailsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1.IListGuardrailsRequest, + protos.google.cloud.ces.v1.IListGuardrailsResponse|null|undefined, + protos.google.cloud.ces.v1.IGuardrail>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1.IListGuardrailsRequest, + protos.google.cloud.ces.v1.IListGuardrailsResponse|null|undefined, + protos.google.cloud.ces.v1.IGuardrail>): + Promise<[ + protos.google.cloud.ces.v1.IGuardrail[], + protos.google.cloud.ces.v1.IListGuardrailsRequest|null, + protos.google.cloud.ces.v1.IListGuardrailsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1.IListGuardrailsRequest, + protos.google.cloud.ces.v1.IListGuardrailsResponse|null|undefined, + protos.google.cloud.ces.v1.IGuardrail>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listGuardrails values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listGuardrails request %j', request); + return this.innerApiCalls + .listGuardrails(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1.IGuardrail[], + protos.google.cloud.ces.v1.IListGuardrailsRequest|null, + protos.google.cloud.ces.v1.IListGuardrailsResponse + ]) => { + this._log.info('listGuardrails values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listGuardrails`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list guardrails from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListGuardrailsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListGuardrails|AgentService.ListGuardrails} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the guardrails. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1.Guardrail|Guardrail} 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 `listGuardrailsAsync()` + * 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. + */ + listGuardrailsStream( + request?: protos.google.cloud.ces.v1.IListGuardrailsRequest, + 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['listGuardrails']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listGuardrails stream %j', request); + return this.descriptors.page.listGuardrails.createStream( + this.innerApiCalls.listGuardrails as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listGuardrails`, 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 resource name of the app to list guardrails from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListGuardrailsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListGuardrails|AgentService.ListGuardrails} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the guardrails. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1.Guardrail|Guardrail}. 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/agent_service.list_guardrails.js + * region_tag:ces_v1_generated_AgentService_ListGuardrails_async + */ + listGuardrailsAsync( + request?: protos.google.cloud.ces.v1.IListGuardrailsRequest, + 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['listGuardrails']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listGuardrails iterate %j', request); + return this.descriptors.page.listGuardrails.asyncIterate( + this.innerApiCalls['listGuardrails'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists deployments in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent app. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + * @param {number} [request.pageSize] + * Optional. The maximum number of deployments to return. The service may + * return fewer than this value. If unspecified, at most 50 deployments will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDeployments` must + * match the call that provided the page token. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.Deployment|Deployment}. + * 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 `listDeploymentsAsync()` + * 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. + */ + listDeployments( + request?: protos.google.cloud.ces.v1.IListDeploymentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IDeployment[], + protos.google.cloud.ces.v1.IListDeploymentsRequest|null, + protos.google.cloud.ces.v1.IListDeploymentsResponse + ]>; + listDeployments( + request: protos.google.cloud.ces.v1.IListDeploymentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListDeploymentsRequest, + protos.google.cloud.ces.v1.IListDeploymentsResponse|null|undefined, + protos.google.cloud.ces.v1.IDeployment>): void; + listDeployments( + request: protos.google.cloud.ces.v1.IListDeploymentsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListDeploymentsRequest, + protos.google.cloud.ces.v1.IListDeploymentsResponse|null|undefined, + protos.google.cloud.ces.v1.IDeployment>): void; + listDeployments( + request?: protos.google.cloud.ces.v1.IListDeploymentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1.IListDeploymentsRequest, + protos.google.cloud.ces.v1.IListDeploymentsResponse|null|undefined, + protos.google.cloud.ces.v1.IDeployment>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1.IListDeploymentsRequest, + protos.google.cloud.ces.v1.IListDeploymentsResponse|null|undefined, + protos.google.cloud.ces.v1.IDeployment>): + Promise<[ + protos.google.cloud.ces.v1.IDeployment[], + protos.google.cloud.ces.v1.IListDeploymentsRequest|null, + protos.google.cloud.ces.v1.IListDeploymentsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1.IListDeploymentsRequest, + protos.google.cloud.ces.v1.IListDeploymentsResponse|null|undefined, + protos.google.cloud.ces.v1.IDeployment>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDeployments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDeployments request %j', request); + return this.innerApiCalls + .listDeployments(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1.IDeployment[], + protos.google.cloud.ces.v1.IListDeploymentsRequest|null, + protos.google.cloud.ces.v1.IListDeploymentsResponse + ]) => { + this._log.info('listDeployments values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listDeployments`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent app. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + * @param {number} [request.pageSize] + * Optional. The maximum number of deployments to return. The service may + * return fewer than this value. If unspecified, at most 50 deployments will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDeployments` must + * match the call that provided the page token. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1.Deployment|Deployment} 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 `listDeploymentsAsync()` + * 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. + */ + listDeploymentsStream( + request?: protos.google.cloud.ces.v1.IListDeploymentsRequest, + 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['listDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDeployments stream %j', request); + return this.descriptors.page.listDeployments.createStream( + this.innerApiCalls.listDeployments as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDeployments`, 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 parent app. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + * @param {number} [request.pageSize] + * Optional. The maximum number of deployments to return. The service may + * return fewer than this value. If unspecified, at most 50 deployments will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDeployments` must + * match the call that provided the page token. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1.Deployment|Deployment}. 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/agent_service.list_deployments.js + * region_tag:ces_v1_generated_AgentService_ListDeployments_async + */ + listDeploymentsAsync( + request?: protos.google.cloud.ces.v1.IListDeploymentsRequest, + 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['listDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDeployments iterate %j', request); + return this.descriptors.page.listDeployments.asyncIterate( + this.innerApiCalls['listDeployments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists toolsets in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list toolsets from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListToolsetsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListToolsets|AgentService.ListToolsets} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the toolsets. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.Toolset|Toolset}. + * 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 `listToolsetsAsync()` + * 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. + */ + listToolsets( + request?: protos.google.cloud.ces.v1.IListToolsetsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IToolset[], + protos.google.cloud.ces.v1.IListToolsetsRequest|null, + protos.google.cloud.ces.v1.IListToolsetsResponse + ]>; + listToolsets( + request: protos.google.cloud.ces.v1.IListToolsetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListToolsetsRequest, + protos.google.cloud.ces.v1.IListToolsetsResponse|null|undefined, + protos.google.cloud.ces.v1.IToolset>): void; + listToolsets( + request: protos.google.cloud.ces.v1.IListToolsetsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListToolsetsRequest, + protos.google.cloud.ces.v1.IListToolsetsResponse|null|undefined, + protos.google.cloud.ces.v1.IToolset>): void; + listToolsets( + request?: protos.google.cloud.ces.v1.IListToolsetsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1.IListToolsetsRequest, + protos.google.cloud.ces.v1.IListToolsetsResponse|null|undefined, + protos.google.cloud.ces.v1.IToolset>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1.IListToolsetsRequest, + protos.google.cloud.ces.v1.IListToolsetsResponse|null|undefined, + protos.google.cloud.ces.v1.IToolset>): + Promise<[ + protos.google.cloud.ces.v1.IToolset[], + protos.google.cloud.ces.v1.IListToolsetsRequest|null, + protos.google.cloud.ces.v1.IListToolsetsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1.IListToolsetsRequest, + protos.google.cloud.ces.v1.IListToolsetsResponse|null|undefined, + protos.google.cloud.ces.v1.IToolset>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listToolsets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listToolsets request %j', request); + return this.innerApiCalls + .listToolsets(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1.IToolset[], + protos.google.cloud.ces.v1.IListToolsetsRequest|null, + protos.google.cloud.ces.v1.IListToolsetsResponse + ]) => { + this._log.info('listToolsets values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listToolsets`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list toolsets from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListToolsetsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListToolsets|AgentService.ListToolsets} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the toolsets. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1.Toolset|Toolset} 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 `listToolsetsAsync()` + * 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. + */ + listToolsetsStream( + request?: protos.google.cloud.ces.v1.IListToolsetsRequest, + 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['listToolsets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listToolsets stream %j', request); + return this.descriptors.page.listToolsets.createStream( + this.innerApiCalls.listToolsets as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listToolsets`, 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 resource name of the app to list toolsets from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListToolsetsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListToolsets|AgentService.ListToolsets} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the toolsets. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1.Toolset|Toolset}. 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/agent_service.list_toolsets.js + * region_tag:ces_v1_generated_AgentService_ListToolsets_async + */ + listToolsetsAsync( + request?: protos.google.cloud.ces.v1.IListToolsetsRequest, + 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['listToolsets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listToolsets iterate %j', request); + return this.descriptors.page.listToolsets.asyncIterate( + this.innerApiCalls['listToolsets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all app versions in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list app versions from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListAppVersionsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListAppVersions|AgentService.ListAppVersions} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the app versions. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.AppVersion|AppVersion}. + * 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 `listAppVersionsAsync()` + * 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. + */ + listAppVersions( + request?: protos.google.cloud.ces.v1.IListAppVersionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IAppVersion[], + protos.google.cloud.ces.v1.IListAppVersionsRequest|null, + protos.google.cloud.ces.v1.IListAppVersionsResponse + ]>; + listAppVersions( + request: protos.google.cloud.ces.v1.IListAppVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListAppVersionsRequest, + protos.google.cloud.ces.v1.IListAppVersionsResponse|null|undefined, + protos.google.cloud.ces.v1.IAppVersion>): void; + listAppVersions( + request: protos.google.cloud.ces.v1.IListAppVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListAppVersionsRequest, + protos.google.cloud.ces.v1.IListAppVersionsResponse|null|undefined, + protos.google.cloud.ces.v1.IAppVersion>): void; + listAppVersions( + request?: protos.google.cloud.ces.v1.IListAppVersionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1.IListAppVersionsRequest, + protos.google.cloud.ces.v1.IListAppVersionsResponse|null|undefined, + protos.google.cloud.ces.v1.IAppVersion>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1.IListAppVersionsRequest, + protos.google.cloud.ces.v1.IListAppVersionsResponse|null|undefined, + protos.google.cloud.ces.v1.IAppVersion>): + Promise<[ + protos.google.cloud.ces.v1.IAppVersion[], + protos.google.cloud.ces.v1.IListAppVersionsRequest|null, + protos.google.cloud.ces.v1.IListAppVersionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1.IListAppVersionsRequest, + protos.google.cloud.ces.v1.IListAppVersionsResponse|null|undefined, + protos.google.cloud.ces.v1.IAppVersion>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAppVersions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAppVersions request %j', request); + return this.innerApiCalls + .listAppVersions(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1.IAppVersion[], + protos.google.cloud.ces.v1.IListAppVersionsRequest|null, + protos.google.cloud.ces.v1.IListAppVersionsResponse + ]) => { + this._log.info('listAppVersions values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listAppVersions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list app versions from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListAppVersionsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListAppVersions|AgentService.ListAppVersions} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the app versions. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1.AppVersion|AppVersion} 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 `listAppVersionsAsync()` + * 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. + */ + listAppVersionsStream( + request?: protos.google.cloud.ces.v1.IListAppVersionsRequest, + 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['listAppVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAppVersions stream %j', request); + return this.descriptors.page.listAppVersions.createStream( + this.innerApiCalls.listAppVersions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAppVersions`, 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 resource name of the app to list app versions from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListAppVersionsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListAppVersions|AgentService.ListAppVersions} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the app versions. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1.AppVersion|AppVersion}. 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/agent_service.list_app_versions.js + * region_tag:ces_v1_generated_AgentService_ListAppVersions_async + */ + listAppVersionsAsync( + request?: protos.google.cloud.ces.v1.IListAppVersionsRequest, + 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['listAppVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAppVersions iterate %j', request); + return this.descriptors.page.listAppVersions.asyncIterate( + this.innerApiCalls['listAppVersions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the changelogs of the specified app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list changelogs from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListChangelogsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListChangelogs|AgentService.ListChangelogs} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the changelogs. + * See https://google.aip.dev/160 for more details. + * + * The filter string can be used to filter by `action`, `resource_type`, + * `resource_name`, `author`, and `create_time`. + * The `:` comparator can be used for case-insensitive partial matching on + * string fields, while `=` performs an exact case-sensitive match. + * + * Examples: + * * `action:update` (case-insensitive partial match) + * * `action="Create"` (case-sensitive exact match) + * * `resource_type:agent` + * * `resource_name:my-agent` + * * `author:me@example.com` + * * `create_time > "2025-01-01T00:00:00Z"` + * * `create_time <= "2025-01-01T00:00:00Z" AND resource_type:tool` + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.Changelog|Changelog}. + * 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 `listChangelogsAsync()` + * 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. + */ + listChangelogs( + request?: protos.google.cloud.ces.v1.IListChangelogsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IChangelog[], + protos.google.cloud.ces.v1.IListChangelogsRequest|null, + protos.google.cloud.ces.v1.IListChangelogsResponse + ]>; + listChangelogs( + request: protos.google.cloud.ces.v1.IListChangelogsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListChangelogsRequest, + protos.google.cloud.ces.v1.IListChangelogsResponse|null|undefined, + protos.google.cloud.ces.v1.IChangelog>): void; + listChangelogs( + request: protos.google.cloud.ces.v1.IListChangelogsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1.IListChangelogsRequest, + protos.google.cloud.ces.v1.IListChangelogsResponse|null|undefined, + protos.google.cloud.ces.v1.IChangelog>): void; + listChangelogs( + request?: protos.google.cloud.ces.v1.IListChangelogsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1.IListChangelogsRequest, + protos.google.cloud.ces.v1.IListChangelogsResponse|null|undefined, + protos.google.cloud.ces.v1.IChangelog>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1.IListChangelogsRequest, + protos.google.cloud.ces.v1.IListChangelogsResponse|null|undefined, + protos.google.cloud.ces.v1.IChangelog>): + Promise<[ + protos.google.cloud.ces.v1.IChangelog[], + protos.google.cloud.ces.v1.IListChangelogsRequest|null, + protos.google.cloud.ces.v1.IListChangelogsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1.IListChangelogsRequest, + protos.google.cloud.ces.v1.IListChangelogsResponse|null|undefined, + protos.google.cloud.ces.v1.IChangelog>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listChangelogs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listChangelogs request %j', request); + return this.innerApiCalls + .listChangelogs(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1.IChangelog[], + protos.google.cloud.ces.v1.IListChangelogsRequest|null, + protos.google.cloud.ces.v1.IListChangelogsResponse + ]) => { + this._log.info('listChangelogs values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listChangelogs`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list changelogs from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListChangelogsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListChangelogs|AgentService.ListChangelogs} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the changelogs. + * See https://google.aip.dev/160 for more details. + * + * The filter string can be used to filter by `action`, `resource_type`, + * `resource_name`, `author`, and `create_time`. + * The `:` comparator can be used for case-insensitive partial matching on + * string fields, while `=` performs an exact case-sensitive match. + * + * Examples: + * * `action:update` (case-insensitive partial match) + * * `action="Create"` (case-sensitive exact match) + * * `resource_type:agent` + * * `resource_name:my-agent` + * * `author:me@example.com` + * * `create_time > "2025-01-01T00:00:00Z"` + * * `create_time <= "2025-01-01T00:00:00Z" AND resource_type:tool` + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1.Changelog|Changelog} 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 `listChangelogsAsync()` + * 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. + */ + listChangelogsStream( + request?: protos.google.cloud.ces.v1.IListChangelogsRequest, + 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['listChangelogs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listChangelogs stream %j', request); + return this.descriptors.page.listChangelogs.createStream( + this.innerApiCalls.listChangelogs as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listChangelogs`, 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 resource name of the app to list changelogs from. + * @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. The + * {@link protos.google.cloud.ces.v1.ListChangelogsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1.AgentService.ListChangelogs|AgentService.ListChangelogs} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the changelogs. + * See https://google.aip.dev/160 for more details. + * + * The filter string can be used to filter by `action`, `resource_type`, + * `resource_name`, `author`, and `create_time`. + * The `:` comparator can be used for case-insensitive partial matching on + * string fields, while `=` performs an exact case-sensitive match. + * + * Examples: + * * `action:update` (case-insensitive partial match) + * * `action="Create"` (case-sensitive exact match) + * * `resource_type:agent` + * * `resource_name:my-agent` + * * `author:me@example.com` + * * `create_time > "2025-01-01T00:00:00Z"` + * * `create_time <= "2025-01-01T00:00:00Z" AND resource_type:tool` + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1.Changelog|Changelog}. 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/agent_service.list_changelogs.js + * region_tag:ces_v1_generated_AgentService_ListChangelogs_async + */ + listChangelogsAsync( + request?: protos.google.cloud.ces.v1.IListChangelogsRequest, + 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['listChangelogs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listChangelogs iterate %j', request); + return this.descriptors.page.listChangelogs.asyncIterate( + this.innerApiCalls['listChangelogs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project:string,location:string,app:string,agent:string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + app: app, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the app from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the app. + */ + matchAppFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).app; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified app resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @returns {string} Resource name string. + */ + appPath(project:string,location:string,app:string) { + return this.pathTemplates.appPathTemplate.render({ + project: project, + location: location, + app: app, + }); + } + + /** + * Parse the project from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).project; + } + + /** + * Parse the location from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).location; + } + + /** + * Parse the app from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the app. + */ + matchAppFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).app; + } + + /** + * Return a fully-qualified appVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} version + * @returns {string} Resource name string. + */ + appVersionPath(project:string,location:string,app:string,version:string) { + return this.pathTemplates.appVersionPathTemplate.render({ + project: project, + location: location, + app: app, + version: version, + }); + } + + /** + * Parse the project from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).project; + } + + /** + * Parse the location from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).location; + } + + /** + * Parse the app from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the app. + */ + matchAppFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).app; + } + + /** + * Parse the version from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).version; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath(project:string,location:string,app:string,changelog:string) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + app: app, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).location; + } + + /** + * Parse the app from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the app. + */ + matchAppFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).app; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).changelog; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath(project:string,location:string,app:string,conversation:string) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + app: app, + conversation: conversation, + }); + } + + /** + * Parse the project from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).project; + } + + /** + * Parse the location from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).location; + } + + /** + * Parse the app from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the app. + */ + matchAppFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).app; + } + + /** + * Parse the conversation from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).conversation; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,app:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + app: app, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the app from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the app. + */ + matchAppFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).app; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath(project:string,location:string,app:string,example:string) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + app: app, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the app from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the app. + */ + matchAppFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).app; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified guardrail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} guardrail + * @returns {string} Resource name string. + */ + guardrailPath(project:string,location:string,app:string,guardrail:string) { + return this.pathTemplates.guardrailPathTemplate.render({ + project: project, + location: location, + app: app, + guardrail: guardrail, + }); + } + + /** + * Parse the project from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).project; + } + + /** + * Parse the location from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).location; + } + + /** + * Parse the app from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the app. + */ + matchAppFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).app; + } + + /** + * Parse the guardrail from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the guardrail. + */ + matchGuardrailFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).guardrail; + } + + /** + * 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 omnichannel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} omnichannel + * @returns {string} Resource name string. + */ + omnichannelPath(project:string,location:string,omnichannel:string) { + return this.pathTemplates.omnichannelPathTemplate.render({ + project: project, + location: location, + omnichannel: omnichannel, + }); + } + + /** + * Parse the project from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).project; + } + + /** + * Parse the location from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).location; + } + + /** + * Parse the omnichannel from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the omnichannel. + */ + matchOmnichannelFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).omnichannel; + } + + /** + * 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 tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project:string,location:string,app:string,tool:string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + app: app, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the app from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the app. + */ + matchAppFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).app; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} toolset + * @returns {string} Resource name string. + */ + toolsetPath(project:string,location:string,app:string,toolset:string) { + return this.pathTemplates.toolsetPathTemplate.render({ + project: project, + location: location, + app: app, + toolset: toolset, + }); + } + + /** + * Parse the project from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).project; + } + + /** + * Parse the location from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).location; + } + + /** + * Parse the app from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the app. + */ + matchAppFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).app; + } + + /** + * Parse the toolset from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the toolset. + */ + matchToolsetFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).toolset; + } + + /** + * 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.agentServiceStub && !this._terminated) { + return this.agentServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/src/v1/agent_service_client_config.json b/owl-bot-staging/google-cloud-ces/src/v1/agent_service_client_config.json new file mode 100644 index 00000000000..655c633e475 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1/agent_service_client_config.json @@ -0,0 +1,266 @@ +{ + "interfaces": { + "google.cloud.ces.v1.AgentService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListApps": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetApp": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateApp": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateApp": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteApp": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ExportApp": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ImportApp": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListAgents": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetAgent": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateAgent": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateAgent": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteAgent": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListExamples": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetExample": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateExample": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateExample": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteExample": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListTools": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetTool": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListConversations": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetConversation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteConversation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "BatchDeleteConversations": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateTool": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateTool": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteTool": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListGuardrails": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetGuardrail": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateGuardrail": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateGuardrail": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteGuardrail": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListDeployments": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListToolsets": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetToolset": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateToolset": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateToolset": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteToolset": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListAppVersions": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetAppVersion": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateAppVersion": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteAppVersion": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "RestoreAppVersion": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListChangelogs": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetChangelog": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-ces/src/v1/agent_service_proto_list.json b/owl-bot-staging/google-cloud-ces/src/v1/agent_service_proto_list.json new file mode 100644 index 00000000000..7f9a4c1d7f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1/agent_service_proto_list.json @@ -0,0 +1,40 @@ +[ + "../../protos/google/cloud/ces/v1/agent.proto", + "../../protos/google/cloud/ces/v1/agent_service.proto", + "../../protos/google/cloud/ces/v1/agent_transfers.proto", + "../../protos/google/cloud/ces/v1/app.proto", + "../../protos/google/cloud/ces/v1/app_version.proto", + "../../protos/google/cloud/ces/v1/auth.proto", + "../../protos/google/cloud/ces/v1/bigquery_export.proto", + "../../protos/google/cloud/ces/v1/changelog.proto", + "../../protos/google/cloud/ces/v1/client_function.proto", + "../../protos/google/cloud/ces/v1/common.proto", + "../../protos/google/cloud/ces/v1/connector_tool.proto", + "../../protos/google/cloud/ces/v1/connector_toolset.proto", + "../../protos/google/cloud/ces/v1/conversation.proto", + "../../protos/google/cloud/ces/v1/data_store.proto", + "../../protos/google/cloud/ces/v1/data_store_tool.proto", + "../../protos/google/cloud/ces/v1/deployment.proto", + "../../protos/google/cloud/ces/v1/example.proto", + "../../protos/google/cloud/ces/v1/fakes.proto", + "../../protos/google/cloud/ces/v1/file_search_tool.proto", + "../../protos/google/cloud/ces/v1/google_search_tool.proto", + "../../protos/google/cloud/ces/v1/guardrail.proto", + "../../protos/google/cloud/ces/v1/mcp_tool.proto", + "../../protos/google/cloud/ces/v1/mcp_toolset.proto", + "../../protos/google/cloud/ces/v1/omnichannel.proto", + "../../protos/google/cloud/ces/v1/omnichannel_service.proto", + "../../protos/google/cloud/ces/v1/open_api_tool.proto", + "../../protos/google/cloud/ces/v1/open_api_toolset.proto", + "../../protos/google/cloud/ces/v1/python_function.proto", + "../../protos/google/cloud/ces/v1/schema.proto", + "../../protos/google/cloud/ces/v1/search_suggestions.proto", + "../../protos/google/cloud/ces/v1/session_service.proto", + "../../protos/google/cloud/ces/v1/system_tool.proto", + "../../protos/google/cloud/ces/v1/tool.proto", + "../../protos/google/cloud/ces/v1/tool_service.proto", + "../../protos/google/cloud/ces/v1/toolset.proto", + "../../protos/google/cloud/ces/v1/toolset_tool.proto", + "../../protos/google/cloud/ces/v1/widget_service.proto", + "../../protos/google/cloud/ces/v1/widget_tool.proto" +] diff --git a/owl-bot-staging/google-cloud-ces/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-ces/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..2dc1cdbae2e --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1/gapic_metadata.json @@ -0,0 +1,640 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.ces.v1", + "libraryPackage": "@google-cloud/ces", + "services": { + "AgentService": { + "clients": { + "grpc": { + "libraryClient": "AgentServiceClient", + "rpcs": { + "GetApp": { + "methods": [ + "getApp" + ] + }, + "UpdateApp": { + "methods": [ + "updateApp" + ] + }, + "GetAgent": { + "methods": [ + "getAgent" + ] + }, + "CreateAgent": { + "methods": [ + "createAgent" + ] + }, + "UpdateAgent": { + "methods": [ + "updateAgent" + ] + }, + "DeleteAgent": { + "methods": [ + "deleteAgent" + ] + }, + "GetExample": { + "methods": [ + "getExample" + ] + }, + "CreateExample": { + "methods": [ + "createExample" + ] + }, + "UpdateExample": { + "methods": [ + "updateExample" + ] + }, + "DeleteExample": { + "methods": [ + "deleteExample" + ] + }, + "GetTool": { + "methods": [ + "getTool" + ] + }, + "GetConversation": { + "methods": [ + "getConversation" + ] + }, + "DeleteConversation": { + "methods": [ + "deleteConversation" + ] + }, + "CreateTool": { + "methods": [ + "createTool" + ] + }, + "UpdateTool": { + "methods": [ + "updateTool" + ] + }, + "DeleteTool": { + "methods": [ + "deleteTool" + ] + }, + "GetGuardrail": { + "methods": [ + "getGuardrail" + ] + }, + "CreateGuardrail": { + "methods": [ + "createGuardrail" + ] + }, + "UpdateGuardrail": { + "methods": [ + "updateGuardrail" + ] + }, + "DeleteGuardrail": { + "methods": [ + "deleteGuardrail" + ] + }, + "GetDeployment": { + "methods": [ + "getDeployment" + ] + }, + "CreateDeployment": { + "methods": [ + "createDeployment" + ] + }, + "UpdateDeployment": { + "methods": [ + "updateDeployment" + ] + }, + "DeleteDeployment": { + "methods": [ + "deleteDeployment" + ] + }, + "GetToolset": { + "methods": [ + "getToolset" + ] + }, + "CreateToolset": { + "methods": [ + "createToolset" + ] + }, + "UpdateToolset": { + "methods": [ + "updateToolset" + ] + }, + "DeleteToolset": { + "methods": [ + "deleteToolset" + ] + }, + "GetAppVersion": { + "methods": [ + "getAppVersion" + ] + }, + "CreateAppVersion": { + "methods": [ + "createAppVersion" + ] + }, + "DeleteAppVersion": { + "methods": [ + "deleteAppVersion" + ] + }, + "GetChangelog": { + "methods": [ + "getChangelog" + ] + }, + "CreateApp": { + "methods": [ + "createApp" + ] + }, + "DeleteApp": { + "methods": [ + "deleteApp" + ] + }, + "ExportApp": { + "methods": [ + "exportApp" + ] + }, + "ImportApp": { + "methods": [ + "importApp" + ] + }, + "BatchDeleteConversations": { + "methods": [ + "batchDeleteConversations" + ] + }, + "RestoreAppVersion": { + "methods": [ + "restoreAppVersion" + ] + }, + "ListApps": { + "methods": [ + "listApps", + "listAppsStream", + "listAppsAsync" + ] + }, + "ListAgents": { + "methods": [ + "listAgents", + "listAgentsStream", + "listAgentsAsync" + ] + }, + "ListExamples": { + "methods": [ + "listExamples", + "listExamplesStream", + "listExamplesAsync" + ] + }, + "ListTools": { + "methods": [ + "listTools", + "listToolsStream", + "listToolsAsync" + ] + }, + "ListConversations": { + "methods": [ + "listConversations", + "listConversationsStream", + "listConversationsAsync" + ] + }, + "ListGuardrails": { + "methods": [ + "listGuardrails", + "listGuardrailsStream", + "listGuardrailsAsync" + ] + }, + "ListDeployments": { + "methods": [ + "listDeployments", + "listDeploymentsStream", + "listDeploymentsAsync" + ] + }, + "ListToolsets": { + "methods": [ + "listToolsets", + "listToolsetsStream", + "listToolsetsAsync" + ] + }, + "ListAppVersions": { + "methods": [ + "listAppVersions", + "listAppVersionsStream", + "listAppVersionsAsync" + ] + }, + "ListChangelogs": { + "methods": [ + "listChangelogs", + "listChangelogsStream", + "listChangelogsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AgentServiceClient", + "rpcs": { + "GetApp": { + "methods": [ + "getApp" + ] + }, + "UpdateApp": { + "methods": [ + "updateApp" + ] + }, + "GetAgent": { + "methods": [ + "getAgent" + ] + }, + "CreateAgent": { + "methods": [ + "createAgent" + ] + }, + "UpdateAgent": { + "methods": [ + "updateAgent" + ] + }, + "DeleteAgent": { + "methods": [ + "deleteAgent" + ] + }, + "GetExample": { + "methods": [ + "getExample" + ] + }, + "CreateExample": { + "methods": [ + "createExample" + ] + }, + "UpdateExample": { + "methods": [ + "updateExample" + ] + }, + "DeleteExample": { + "methods": [ + "deleteExample" + ] + }, + "GetTool": { + "methods": [ + "getTool" + ] + }, + "GetConversation": { + "methods": [ + "getConversation" + ] + }, + "DeleteConversation": { + "methods": [ + "deleteConversation" + ] + }, + "CreateTool": { + "methods": [ + "createTool" + ] + }, + "UpdateTool": { + "methods": [ + "updateTool" + ] + }, + "DeleteTool": { + "methods": [ + "deleteTool" + ] + }, + "GetGuardrail": { + "methods": [ + "getGuardrail" + ] + }, + "CreateGuardrail": { + "methods": [ + "createGuardrail" + ] + }, + "UpdateGuardrail": { + "methods": [ + "updateGuardrail" + ] + }, + "DeleteGuardrail": { + "methods": [ + "deleteGuardrail" + ] + }, + "GetDeployment": { + "methods": [ + "getDeployment" + ] + }, + "CreateDeployment": { + "methods": [ + "createDeployment" + ] + }, + "UpdateDeployment": { + "methods": [ + "updateDeployment" + ] + }, + "DeleteDeployment": { + "methods": [ + "deleteDeployment" + ] + }, + "GetToolset": { + "methods": [ + "getToolset" + ] + }, + "CreateToolset": { + "methods": [ + "createToolset" + ] + }, + "UpdateToolset": { + "methods": [ + "updateToolset" + ] + }, + "DeleteToolset": { + "methods": [ + "deleteToolset" + ] + }, + "GetAppVersion": { + "methods": [ + "getAppVersion" + ] + }, + "CreateAppVersion": { + "methods": [ + "createAppVersion" + ] + }, + "DeleteAppVersion": { + "methods": [ + "deleteAppVersion" + ] + }, + "GetChangelog": { + "methods": [ + "getChangelog" + ] + }, + "CreateApp": { + "methods": [ + "createApp" + ] + }, + "DeleteApp": { + "methods": [ + "deleteApp" + ] + }, + "ExportApp": { + "methods": [ + "exportApp" + ] + }, + "ImportApp": { + "methods": [ + "importApp" + ] + }, + "BatchDeleteConversations": { + "methods": [ + "batchDeleteConversations" + ] + }, + "RestoreAppVersion": { + "methods": [ + "restoreAppVersion" + ] + }, + "ListApps": { + "methods": [ + "listApps", + "listAppsStream", + "listAppsAsync" + ] + }, + "ListAgents": { + "methods": [ + "listAgents", + "listAgentsStream", + "listAgentsAsync" + ] + }, + "ListExamples": { + "methods": [ + "listExamples", + "listExamplesStream", + "listExamplesAsync" + ] + }, + "ListTools": { + "methods": [ + "listTools", + "listToolsStream", + "listToolsAsync" + ] + }, + "ListConversations": { + "methods": [ + "listConversations", + "listConversationsStream", + "listConversationsAsync" + ] + }, + "ListGuardrails": { + "methods": [ + "listGuardrails", + "listGuardrailsStream", + "listGuardrailsAsync" + ] + }, + "ListDeployments": { + "methods": [ + "listDeployments", + "listDeploymentsStream", + "listDeploymentsAsync" + ] + }, + "ListToolsets": { + "methods": [ + "listToolsets", + "listToolsetsStream", + "listToolsetsAsync" + ] + }, + "ListAppVersions": { + "methods": [ + "listAppVersions", + "listAppVersionsStream", + "listAppVersionsAsync" + ] + }, + "ListChangelogs": { + "methods": [ + "listChangelogs", + "listChangelogsStream", + "listChangelogsAsync" + ] + } + } + } + } + }, + "SessionService": { + "clients": { + "grpc": { + "libraryClient": "SessionServiceClient", + "rpcs": { + "RunSession": { + "methods": [ + "runSession" + ] + }, + "BidiRunSession": { + "methods": [ + "bidiRunSession" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SessionServiceClient", + "rpcs": { + "RunSession": { + "methods": [ + "runSession" + ] + } + } + } + } + }, + "ToolService": { + "clients": { + "grpc": { + "libraryClient": "ToolServiceClient", + "rpcs": { + "ExecuteTool": { + "methods": [ + "executeTool" + ] + }, + "RetrieveToolSchema": { + "methods": [ + "retrieveToolSchema" + ] + }, + "RetrieveTools": { + "methods": [ + "retrieveTools" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ToolServiceClient", + "rpcs": { + "ExecuteTool": { + "methods": [ + "executeTool" + ] + }, + "RetrieveToolSchema": { + "methods": [ + "retrieveToolSchema" + ] + }, + "RetrieveTools": { + "methods": [ + "retrieveTools" + ] + } + } + } + } + }, + "WidgetService": { + "clients": { + "grpc": { + "libraryClient": "WidgetServiceClient", + "rpcs": { + "GenerateChatToken": { + "methods": [ + "generateChatToken" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "WidgetServiceClient", + "rpcs": { + "GenerateChatToken": { + "methods": [ + "generateChatToken" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-ces/src/v1/index.ts b/owl-bot-staging/google-cloud-ces/src/v1/index.ts new file mode 100644 index 00000000000..c1a4da87b94 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1/index.ts @@ -0,0 +1,22 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {AgentServiceClient} from './agent_service_client'; +export {SessionServiceClient} from './session_service_client'; +export {ToolServiceClient} from './tool_service_client'; +export {WidgetServiceClient} from './widget_service_client'; diff --git a/owl-bot-staging/google-cloud-ces/src/v1/session_service_client.ts b/owl-bot-staging/google-cloud-ces/src/v1/session_service_client.ts new file mode 100644 index 00000000000..11eec14af45 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1/session_service_client.ts @@ -0,0 +1,1383 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, LocationsClient, LocationProtos} from 'google-gax'; +import {PassThrough} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/session_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './session_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Session service provides APIs for interacting with CES agents. + * @class + * @memberof v1 + */ +export class SessionServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('ces'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + sessionServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SessionServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SessionServiceClient({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 SessionServiceClient; + 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 = 'ces.' + 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.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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/agents/{agent}' + ), + appPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}' + ), + appVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/versions/{version}' + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}' + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}' + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/examples/{example}' + ), + guardrailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}' + ), + omnichannelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/omnichannels/{omnichannel}' + ), + sessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/sessions/{session}' + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/tools/{tool}' + ), + toolsetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}' + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + bidiRunSession: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.ces.v1.SessionService', 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.sessionServiceStub) { + return this.sessionServiceStub; + } + + // Put together the "service stub" for + // google.cloud.ces.v1.SessionService. + this.sessionServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.ces.v1.SessionService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.ces.v1.SessionService, + 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 sessionServiceStubMethods = + ['runSession', 'bidiRunSession']; + for (const methodName of sessionServiceStubMethods) { + const callPromise = this.sessionServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({objectMode: true}); + setImmediate(() => { + stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); + }); + return stream; + } + 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.stream[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.sessionServiceStub; + } + + /** + * 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 'ces.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 'ces.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/ces', + '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 -- + // ------------------- +/** + * Initiates a single turn interaction with the CES agent within a + * session. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1.SessionConfig} request.config + * Required. The configuration for the session. + * @param {number[]} request.inputs + * Required. Inputs for the session. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.RunSessionResponse|RunSessionResponse}. + * 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/session_service.run_session.js + * region_tag:ces_v1_generated_SessionService_RunSession_async + */ + runSession( + request?: protos.google.cloud.ces.v1.IRunSessionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IRunSessionResponse, + protos.google.cloud.ces.v1.IRunSessionRequest|undefined, {}|undefined + ]>; + runSession( + request: protos.google.cloud.ces.v1.IRunSessionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IRunSessionResponse, + protos.google.cloud.ces.v1.IRunSessionRequest|null|undefined, + {}|null|undefined>): void; + runSession( + request: protos.google.cloud.ces.v1.IRunSessionRequest, + callback: Callback< + protos.google.cloud.ces.v1.IRunSessionResponse, + protos.google.cloud.ces.v1.IRunSessionRequest|null|undefined, + {}|null|undefined>): void; + runSession( + request?: protos.google.cloud.ces.v1.IRunSessionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IRunSessionResponse, + protos.google.cloud.ces.v1.IRunSessionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IRunSessionResponse, + protos.google.cloud.ces.v1.IRunSessionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IRunSessionResponse, + protos.google.cloud.ces.v1.IRunSessionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'config.session': request.config!.session ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('runSession request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IRunSessionResponse, + protos.google.cloud.ces.v1.IRunSessionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('runSession response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.runSession(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IRunSessionResponse, + protos.google.cloud.ces.v1.IRunSessionRequest|undefined, + {}|undefined + ]) => { + this._log.info('runSession response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Establishes a bidirectional streaming connection with the CES agent. + * The agent processes continuous multimodal inputs (e.g., text, audio) and + * generates real-time multimodal output streams. + * + * --- Client Request Stream --- + * The client streams requests in the following order: + * + * 1. Initialization: + * The first message must contain + * {@link protos.google.cloud.ces.v1.BidiSessionClientMessage.config|SessionConfig}. + * For audio sessions, this should also include + * {@link protos.google.cloud.ces.v1.SessionConfig.input_audio_config|InputAudioConfig} + * and + * {@link protos.google.cloud.ces.v1.SessionConfig.output_audio_config|OutputAudioConfig} + * to define audio processing and synthesis parameters. + * + * 2. Interaction: + * Subsequent messages stream + * {@link protos.google.cloud.ces.v1.BidiSessionClientMessage.realtime_input|SessionInput} + * containing real-time user input data. + * + * 3. Termination: + * The client should half-close the stream when there is no more user + * input. It should also half-close upon receiving + * {@link protos.google.cloud.ces.v1.BidiSessionServerMessage.end_session|EndSession} + * or {@link protos.google.cloud.ces.v1.BidiSessionServerMessage.go_away|GoAway} from + * the agent. + * + * --- Server Response Stream --- + * For each interaction turn, the agent streams messages in the following + * sequence: + * + * 1. Speech Recognition (First N messages): + * Contains + * {@link protos.google.cloud.ces.v1.BidiSessionServerMessage.recognition_result|RecognitionResult} + * representing the concatenated user speech segments captured so far. + * This is only populated for audio sessions. + * + * 2. Response (Next M messages): + * Contains + * {@link protos.google.cloud.ces.v1.BidiSessionServerMessage.session_output|SessionOutput} + * delivering the agent's response in various modalities (e.g., text, + * audio). + * + * 3. Turn Completion (Final message of the turn): + * Contains + * {@link protos.google.cloud.ces.v1.BidiSessionServerMessage.session_output|SessionOutput} + * with {@link protos.google.cloud.ces.v1.SessionOutput.turn_completed|turn_completed} + * set to true. This signals the end of the current turn and includes + * {@link protos.google.cloud.ces.v1.SessionOutput.diagnostic_info|DiagnosticInfo} + * with execution details. + * + * --- Audio Best Practices --- + * 1. Streaming: + * Stream {@link protos.google.cloud.ces.v1.SessionInput.audio|audio data} + * **CONTINUOUSLY**, even during silence. Recommended chunk size: 40-120ms + * (balances latency vs. efficiency). + * + * 2. Playback & Interruption: + * Play {@link protos.google.cloud.ces.v1.SessionOutput.audio|audio responses} upon + * receipt. Stop playback immediately if an + * {@link protos.google.cloud.ces.v1.BidiSessionServerMessage.interruption_signal|InterruptionSignal} + * is received (e.g., user barge-in or new agent response). + * + * @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 is both readable and writable. It accepts objects + * representing {@link protos.google.cloud.ces.v1.BidiSessionClientMessage|BidiSessionClientMessage} for write() method, and + * will emit objects representing {@link protos.google.cloud.ces.v1.BidiSessionServerMessage|BidiSessionServerMessage} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v1/session_service.bidi_run_session.js + * region_tag:ces_v1_generated_SessionService_BidiRunSession_async + */ + bidiRunSession( + options?: CallOptions): + gax.CancellableStream { + this.initialize().catch(err => {throw err}); + this._log.info('bidiRunSession stream %j', options); + return this.innerApiCalls.bidiRunSession(null, options); + } + +/** + * 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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project:string,location:string,app:string,agent:string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + app: app, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the app from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the app. + */ + matchAppFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).app; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified app resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @returns {string} Resource name string. + */ + appPath(project:string,location:string,app:string) { + return this.pathTemplates.appPathTemplate.render({ + project: project, + location: location, + app: app, + }); + } + + /** + * Parse the project from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).project; + } + + /** + * Parse the location from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).location; + } + + /** + * Parse the app from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the app. + */ + matchAppFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).app; + } + + /** + * Return a fully-qualified appVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} version + * @returns {string} Resource name string. + */ + appVersionPath(project:string,location:string,app:string,version:string) { + return this.pathTemplates.appVersionPathTemplate.render({ + project: project, + location: location, + app: app, + version: version, + }); + } + + /** + * Parse the project from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).project; + } + + /** + * Parse the location from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).location; + } + + /** + * Parse the app from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the app. + */ + matchAppFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).app; + } + + /** + * Parse the version from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).version; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath(project:string,location:string,app:string,changelog:string) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + app: app, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).location; + } + + /** + * Parse the app from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the app. + */ + matchAppFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).app; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).changelog; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath(project:string,location:string,app:string,conversation:string) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + app: app, + conversation: conversation, + }); + } + + /** + * Parse the project from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).project; + } + + /** + * Parse the location from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).location; + } + + /** + * Parse the app from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the app. + */ + matchAppFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).app; + } + + /** + * Parse the conversation from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).conversation; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,app:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + app: app, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the app from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the app. + */ + matchAppFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).app; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath(project:string,location:string,app:string,example:string) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + app: app, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the app from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the app. + */ + matchAppFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).app; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified guardrail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} guardrail + * @returns {string} Resource name string. + */ + guardrailPath(project:string,location:string,app:string,guardrail:string) { + return this.pathTemplates.guardrailPathTemplate.render({ + project: project, + location: location, + app: app, + guardrail: guardrail, + }); + } + + /** + * Parse the project from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).project; + } + + /** + * Parse the location from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).location; + } + + /** + * Parse the app from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the app. + */ + matchAppFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).app; + } + + /** + * Parse the guardrail from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the guardrail. + */ + matchGuardrailFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).guardrail; + } + + /** + * Return a fully-qualified omnichannel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} omnichannel + * @returns {string} Resource name string. + */ + omnichannelPath(project:string,location:string,omnichannel:string) { + return this.pathTemplates.omnichannelPathTemplate.render({ + project: project, + location: location, + omnichannel: omnichannel, + }); + } + + /** + * Parse the project from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).project; + } + + /** + * Parse the location from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).location; + } + + /** + * Parse the omnichannel from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the omnichannel. + */ + matchOmnichannelFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).omnichannel; + } + + /** + * Return a fully-qualified session resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} session + * @returns {string} Resource name string. + */ + sessionPath(project:string,location:string,app:string,session:string) { + return this.pathTemplates.sessionPathTemplate.render({ + project: project, + location: location, + app: app, + session: session, + }); + } + + /** + * Parse the project from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).project; + } + + /** + * Parse the location from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).location; + } + + /** + * Parse the app from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the app. + */ + matchAppFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).app; + } + + /** + * Parse the session from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).session; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project:string,location:string,app:string,tool:string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + app: app, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the app from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the app. + */ + matchAppFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).app; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} toolset + * @returns {string} Resource name string. + */ + toolsetPath(project:string,location:string,app:string,toolset:string) { + return this.pathTemplates.toolsetPathTemplate.render({ + project: project, + location: location, + app: app, + toolset: toolset, + }); + } + + /** + * Parse the project from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).project; + } + + /** + * Parse the location from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).location; + } + + /** + * Parse the app from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the app. + */ + matchAppFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).app; + } + + /** + * Parse the toolset from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the toolset. + */ + matchToolsetFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).toolset; + } + + /** + * 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.sessionServiceStub && !this._terminated) { + return this.sessionServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/src/v1/session_service_client_config.json b/owl-bot-staging/google-cloud-ces/src/v1/session_service_client_config.json new file mode 100644 index 00000000000..a34904d9094 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1/session_service_client_config.json @@ -0,0 +1,36 @@ +{ + "interfaces": { + "google.cloud.ces.v1.SessionService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "RunSession": { + "timeout_millis": 220000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BidiRunSession": { + "timeout_millis": 3600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-ces/src/v1/session_service_proto_list.json b/owl-bot-staging/google-cloud-ces/src/v1/session_service_proto_list.json new file mode 100644 index 00000000000..7f9a4c1d7f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1/session_service_proto_list.json @@ -0,0 +1,40 @@ +[ + "../../protos/google/cloud/ces/v1/agent.proto", + "../../protos/google/cloud/ces/v1/agent_service.proto", + "../../protos/google/cloud/ces/v1/agent_transfers.proto", + "../../protos/google/cloud/ces/v1/app.proto", + "../../protos/google/cloud/ces/v1/app_version.proto", + "../../protos/google/cloud/ces/v1/auth.proto", + "../../protos/google/cloud/ces/v1/bigquery_export.proto", + "../../protos/google/cloud/ces/v1/changelog.proto", + "../../protos/google/cloud/ces/v1/client_function.proto", + "../../protos/google/cloud/ces/v1/common.proto", + "../../protos/google/cloud/ces/v1/connector_tool.proto", + "../../protos/google/cloud/ces/v1/connector_toolset.proto", + "../../protos/google/cloud/ces/v1/conversation.proto", + "../../protos/google/cloud/ces/v1/data_store.proto", + "../../protos/google/cloud/ces/v1/data_store_tool.proto", + "../../protos/google/cloud/ces/v1/deployment.proto", + "../../protos/google/cloud/ces/v1/example.proto", + "../../protos/google/cloud/ces/v1/fakes.proto", + "../../protos/google/cloud/ces/v1/file_search_tool.proto", + "../../protos/google/cloud/ces/v1/google_search_tool.proto", + "../../protos/google/cloud/ces/v1/guardrail.proto", + "../../protos/google/cloud/ces/v1/mcp_tool.proto", + "../../protos/google/cloud/ces/v1/mcp_toolset.proto", + "../../protos/google/cloud/ces/v1/omnichannel.proto", + "../../protos/google/cloud/ces/v1/omnichannel_service.proto", + "../../protos/google/cloud/ces/v1/open_api_tool.proto", + "../../protos/google/cloud/ces/v1/open_api_toolset.proto", + "../../protos/google/cloud/ces/v1/python_function.proto", + "../../protos/google/cloud/ces/v1/schema.proto", + "../../protos/google/cloud/ces/v1/search_suggestions.proto", + "../../protos/google/cloud/ces/v1/session_service.proto", + "../../protos/google/cloud/ces/v1/system_tool.proto", + "../../protos/google/cloud/ces/v1/tool.proto", + "../../protos/google/cloud/ces/v1/tool_service.proto", + "../../protos/google/cloud/ces/v1/toolset.proto", + "../../protos/google/cloud/ces/v1/toolset_tool.proto", + "../../protos/google/cloud/ces/v1/widget_service.proto", + "../../protos/google/cloud/ces/v1/widget_tool.proto" +] diff --git a/owl-bot-staging/google-cloud-ces/src/v1/tool_service_client.ts b/owl-bot-staging/google-cloud-ces/src/v1/tool_service_client.ts new file mode 100644 index 00000000000..a3caf366aac --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1/tool_service_client.ts @@ -0,0 +1,1431 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, LocationsClient, LocationProtos} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/tool_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './tool_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Tool service provides APIs for interacting with CES tools. + * @class + * @memberof v1 + */ +export class ToolServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('ces'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + toolServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ToolServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ToolServiceClient({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 ToolServiceClient; + 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 = 'ces.' + 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.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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/agents/{agent}' + ), + appPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}' + ), + appVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/versions/{version}' + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}' + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}' + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/examples/{example}' + ), + guardrailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}' + ), + omnichannelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/omnichannels/{omnichannel}' + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/tools/{tool}' + ), + toolsetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.ces.v1.ToolService', 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.toolServiceStub) { + return this.toolServiceStub; + } + + // Put together the "service stub" for + // google.cloud.ces.v1.ToolService. + this.toolServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.ces.v1.ToolService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.ces.v1.ToolService, + 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 toolServiceStubMethods = + ['executeTool', 'retrieveToolSchema', 'retrieveTools']; + for (const methodName of toolServiceStubMethods) { + const callPromise = this.toolServiceStub.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 = + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.toolServiceStub; + } + + /** + * 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 'ces.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 'ces.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/ces', + '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 -- + // ------------------- +/** + * Executes the given tool with the given arguments. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.tool] + * Optional. The name of the tool to execute. + * Format: + * projects/{project}/locations/{location}/apps/{app}/tools/{tool} + * @param {google.cloud.ces.v1.ToolsetTool} [request.toolsetTool] + * Optional. The toolset tool to execute. Only one tool should match the + * predicate from the toolset. Otherwise, an error will be returned. + * @param {string} request.parent + * Required. The resource name of the app which the tool/toolset belongs to. + * Format: `projects/{project}/locations/{location}/apps/{app}` + * @param {google.protobuf.Struct} [request.args] + * Optional. The input parameters and values for the tool in JSON object + * format. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.ExecuteToolResponse|ExecuteToolResponse}. + * 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/tool_service.execute_tool.js + * region_tag:ces_v1_generated_ToolService_ExecuteTool_async + */ + executeTool( + request?: protos.google.cloud.ces.v1.IExecuteToolRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IExecuteToolResponse, + protos.google.cloud.ces.v1.IExecuteToolRequest|undefined, {}|undefined + ]>; + executeTool( + request: protos.google.cloud.ces.v1.IExecuteToolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IExecuteToolResponse, + protos.google.cloud.ces.v1.IExecuteToolRequest|null|undefined, + {}|null|undefined>): void; + executeTool( + request: protos.google.cloud.ces.v1.IExecuteToolRequest, + callback: Callback< + protos.google.cloud.ces.v1.IExecuteToolResponse, + protos.google.cloud.ces.v1.IExecuteToolRequest|null|undefined, + {}|null|undefined>): void; + executeTool( + request?: protos.google.cloud.ces.v1.IExecuteToolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IExecuteToolResponse, + protos.google.cloud.ces.v1.IExecuteToolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IExecuteToolResponse, + protos.google.cloud.ces.v1.IExecuteToolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IExecuteToolResponse, + protos.google.cloud.ces.v1.IExecuteToolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('executeTool request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IExecuteToolResponse, + protos.google.cloud.ces.v1.IExecuteToolRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('executeTool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.executeTool(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IExecuteToolResponse, + protos.google.cloud.ces.v1.IExecuteToolRequest|undefined, + {}|undefined + ]) => { + this._log.info('executeTool response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Retrieve the schema of the given tool. The schema is computed on the fly + * for the given instance of the tool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.tool] + * Optional. The name of the tool to retrieve the schema for. + * Format: + * projects/{project}/locations/{location}/apps/{app}/tools/{tool} + * @param {google.cloud.ces.v1.ToolsetTool} [request.toolsetTool] + * Optional. The toolset tool to retrieve the schema for. Only one tool + * should match the predicate from the toolset. Otherwise, an error will be + * returned. + * @param {string} request.parent + * Required. The resource name of the app which the tool/toolset belongs to. + * Format: `projects/{project}/locations/{location}/apps/{app}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.RetrieveToolSchemaResponse|RetrieveToolSchemaResponse}. + * 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/tool_service.retrieve_tool_schema.js + * region_tag:ces_v1_generated_ToolService_RetrieveToolSchema_async + */ + retrieveToolSchema( + request?: protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IRetrieveToolSchemaResponse, + protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest|undefined, {}|undefined + ]>; + retrieveToolSchema( + request: protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IRetrieveToolSchemaResponse, + protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest|null|undefined, + {}|null|undefined>): void; + retrieveToolSchema( + request: protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest, + callback: Callback< + protos.google.cloud.ces.v1.IRetrieveToolSchemaResponse, + protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest|null|undefined, + {}|null|undefined>): void; + retrieveToolSchema( + request?: protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IRetrieveToolSchemaResponse, + protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IRetrieveToolSchemaResponse, + protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IRetrieveToolSchemaResponse, + protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('retrieveToolSchema request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IRetrieveToolSchemaResponse, + protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('retrieveToolSchema response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.retrieveToolSchema(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IRetrieveToolSchemaResponse, + protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest|undefined, + {}|undefined + ]) => { + this._log.info('retrieveToolSchema response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Retrieve the list of tools included in the specified toolset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.toolset + * Required. The name of the toolset to retrieve the tools for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + * @param {string[]} [request.toolIds] + * Optional. The identifiers of the tools to retrieve from the toolset. + * If empty, all tools in the toolset 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 {@link protos.google.cloud.ces.v1.RetrieveToolsResponse|RetrieveToolsResponse}. + * 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/tool_service.retrieve_tools.js + * region_tag:ces_v1_generated_ToolService_RetrieveTools_async + */ + retrieveTools( + request?: protos.google.cloud.ces.v1.IRetrieveToolsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IRetrieveToolsResponse, + protos.google.cloud.ces.v1.IRetrieveToolsRequest|undefined, {}|undefined + ]>; + retrieveTools( + request: protos.google.cloud.ces.v1.IRetrieveToolsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IRetrieveToolsResponse, + protos.google.cloud.ces.v1.IRetrieveToolsRequest|null|undefined, + {}|null|undefined>): void; + retrieveTools( + request: protos.google.cloud.ces.v1.IRetrieveToolsRequest, + callback: Callback< + protos.google.cloud.ces.v1.IRetrieveToolsResponse, + protos.google.cloud.ces.v1.IRetrieveToolsRequest|null|undefined, + {}|null|undefined>): void; + retrieveTools( + request?: protos.google.cloud.ces.v1.IRetrieveToolsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IRetrieveToolsResponse, + protos.google.cloud.ces.v1.IRetrieveToolsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IRetrieveToolsResponse, + protos.google.cloud.ces.v1.IRetrieveToolsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IRetrieveToolsResponse, + protos.google.cloud.ces.v1.IRetrieveToolsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'toolset': request.toolset ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('retrieveTools request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IRetrieveToolsResponse, + protos.google.cloud.ces.v1.IRetrieveToolsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('retrieveTools response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.retrieveTools(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IRetrieveToolsResponse, + protos.google.cloud.ces.v1.IRetrieveToolsRequest|undefined, + {}|undefined + ]) => { + this._log.info('retrieveTools response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Gets 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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project:string,location:string,app:string,agent:string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + app: app, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the app from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the app. + */ + matchAppFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).app; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified app resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @returns {string} Resource name string. + */ + appPath(project:string,location:string,app:string) { + return this.pathTemplates.appPathTemplate.render({ + project: project, + location: location, + app: app, + }); + } + + /** + * Parse the project from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).project; + } + + /** + * Parse the location from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).location; + } + + /** + * Parse the app from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the app. + */ + matchAppFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).app; + } + + /** + * Return a fully-qualified appVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} version + * @returns {string} Resource name string. + */ + appVersionPath(project:string,location:string,app:string,version:string) { + return this.pathTemplates.appVersionPathTemplate.render({ + project: project, + location: location, + app: app, + version: version, + }); + } + + /** + * Parse the project from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).project; + } + + /** + * Parse the location from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).location; + } + + /** + * Parse the app from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the app. + */ + matchAppFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).app; + } + + /** + * Parse the version from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).version; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath(project:string,location:string,app:string,changelog:string) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + app: app, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).location; + } + + /** + * Parse the app from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the app. + */ + matchAppFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).app; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).changelog; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath(project:string,location:string,app:string,conversation:string) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + app: app, + conversation: conversation, + }); + } + + /** + * Parse the project from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).project; + } + + /** + * Parse the location from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).location; + } + + /** + * Parse the app from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the app. + */ + matchAppFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).app; + } + + /** + * Parse the conversation from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).conversation; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,app:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + app: app, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the app from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the app. + */ + matchAppFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).app; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath(project:string,location:string,app:string,example:string) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + app: app, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the app from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the app. + */ + matchAppFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).app; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified guardrail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} guardrail + * @returns {string} Resource name string. + */ + guardrailPath(project:string,location:string,app:string,guardrail:string) { + return this.pathTemplates.guardrailPathTemplate.render({ + project: project, + location: location, + app: app, + guardrail: guardrail, + }); + } + + /** + * Parse the project from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).project; + } + + /** + * Parse the location from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).location; + } + + /** + * Parse the app from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the app. + */ + matchAppFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).app; + } + + /** + * Parse the guardrail from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the guardrail. + */ + matchGuardrailFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).guardrail; + } + + /** + * Return a fully-qualified omnichannel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} omnichannel + * @returns {string} Resource name string. + */ + omnichannelPath(project:string,location:string,omnichannel:string) { + return this.pathTemplates.omnichannelPathTemplate.render({ + project: project, + location: location, + omnichannel: omnichannel, + }); + } + + /** + * Parse the project from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).project; + } + + /** + * Parse the location from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).location; + } + + /** + * Parse the omnichannel from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the omnichannel. + */ + matchOmnichannelFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).omnichannel; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project:string,location:string,app:string,tool:string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + app: app, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the app from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the app. + */ + matchAppFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).app; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} toolset + * @returns {string} Resource name string. + */ + toolsetPath(project:string,location:string,app:string,toolset:string) { + return this.pathTemplates.toolsetPathTemplate.render({ + project: project, + location: location, + app: app, + toolset: toolset, + }); + } + + /** + * Parse the project from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).project; + } + + /** + * Parse the location from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).location; + } + + /** + * Parse the app from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the app. + */ + matchAppFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).app; + } + + /** + * Parse the toolset from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the toolset. + */ + matchToolsetFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).toolset; + } + + /** + * 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.toolServiceStub && !this._terminated) { + return this.toolServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/src/v1/tool_service_client_config.json b/owl-bot-staging/google-cloud-ces/src/v1/tool_service_client_config.json new file mode 100644 index 00000000000..313bee156d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1/tool_service_client_config.json @@ -0,0 +1,41 @@ +{ + "interfaces": { + "google.cloud.ces.v1.ToolService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ExecuteTool": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "RetrieveToolSchema": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "RetrieveTools": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-ces/src/v1/tool_service_proto_list.json b/owl-bot-staging/google-cloud-ces/src/v1/tool_service_proto_list.json new file mode 100644 index 00000000000..7f9a4c1d7f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1/tool_service_proto_list.json @@ -0,0 +1,40 @@ +[ + "../../protos/google/cloud/ces/v1/agent.proto", + "../../protos/google/cloud/ces/v1/agent_service.proto", + "../../protos/google/cloud/ces/v1/agent_transfers.proto", + "../../protos/google/cloud/ces/v1/app.proto", + "../../protos/google/cloud/ces/v1/app_version.proto", + "../../protos/google/cloud/ces/v1/auth.proto", + "../../protos/google/cloud/ces/v1/bigquery_export.proto", + "../../protos/google/cloud/ces/v1/changelog.proto", + "../../protos/google/cloud/ces/v1/client_function.proto", + "../../protos/google/cloud/ces/v1/common.proto", + "../../protos/google/cloud/ces/v1/connector_tool.proto", + "../../protos/google/cloud/ces/v1/connector_toolset.proto", + "../../protos/google/cloud/ces/v1/conversation.proto", + "../../protos/google/cloud/ces/v1/data_store.proto", + "../../protos/google/cloud/ces/v1/data_store_tool.proto", + "../../protos/google/cloud/ces/v1/deployment.proto", + "../../protos/google/cloud/ces/v1/example.proto", + "../../protos/google/cloud/ces/v1/fakes.proto", + "../../protos/google/cloud/ces/v1/file_search_tool.proto", + "../../protos/google/cloud/ces/v1/google_search_tool.proto", + "../../protos/google/cloud/ces/v1/guardrail.proto", + "../../protos/google/cloud/ces/v1/mcp_tool.proto", + "../../protos/google/cloud/ces/v1/mcp_toolset.proto", + "../../protos/google/cloud/ces/v1/omnichannel.proto", + "../../protos/google/cloud/ces/v1/omnichannel_service.proto", + "../../protos/google/cloud/ces/v1/open_api_tool.proto", + "../../protos/google/cloud/ces/v1/open_api_toolset.proto", + "../../protos/google/cloud/ces/v1/python_function.proto", + "../../protos/google/cloud/ces/v1/schema.proto", + "../../protos/google/cloud/ces/v1/search_suggestions.proto", + "../../protos/google/cloud/ces/v1/session_service.proto", + "../../protos/google/cloud/ces/v1/system_tool.proto", + "../../protos/google/cloud/ces/v1/tool.proto", + "../../protos/google/cloud/ces/v1/tool_service.proto", + "../../protos/google/cloud/ces/v1/toolset.proto", + "../../protos/google/cloud/ces/v1/toolset_tool.proto", + "../../protos/google/cloud/ces/v1/widget_service.proto", + "../../protos/google/cloud/ces/v1/widget_tool.proto" +] diff --git a/owl-bot-staging/google-cloud-ces/src/v1/widget_service_client.ts b/owl-bot-staging/google-cloud-ces/src/v1/widget_service_client.ts new file mode 100644 index 00000000000..4192fca5f6f --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1/widget_service_client.ts @@ -0,0 +1,1291 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, LocationsClient, LocationProtos} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/widget_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './widget_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Provides APIs for widgets to interact with CES APIs. + * @class + * @memberof v1 + */ +export class WidgetServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('ces'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + widgetServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of WidgetServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new WidgetServiceClient({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 WidgetServiceClient; + 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 = 'ces.' + 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.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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/agents/{agent}' + ), + appPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}' + ), + appVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/versions/{version}' + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}' + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}' + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/examples/{example}' + ), + guardrailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}' + ), + omnichannelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/omnichannels/{omnichannel}' + ), + sessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/sessions/{session}' + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/tools/{tool}' + ), + toolsetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.ces.v1.WidgetService', 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.widgetServiceStub) { + return this.widgetServiceStub; + } + + // Put together the "service stub" for + // google.cloud.ces.v1.WidgetService. + this.widgetServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.ces.v1.WidgetService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.ces.v1.WidgetService, + 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 widgetServiceStubMethods = + ['generateChatToken']; + for (const methodName of widgetServiceStubMethods) { + const callPromise = this.widgetServiceStub.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 = + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.widgetServiceStub; + } + + /** + * 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 'ces.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 'ces.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/ces', + '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 -- + // ------------------- +/** + * Generates a session scoped token for chat widget to authenticate with + * Session APIs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The session name to generate the chat token for. + * Format: + * projects/{project}/locations/{location}/apps/{app}/sessions/{session} + * @param {string} request.deployment + * Required. The deployment of the app to use for the session. + * Format: + * projects/{project}/locations/{location}/apps/{app}/deployments/{deployment} + * @param {string} [request.recaptchaToken] + * Optional. The reCAPTCHA token generated by the client-side chat widget. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.GenerateChatTokenResponse|GenerateChatTokenResponse}. + * 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/widget_service.generate_chat_token.js + * region_tag:ces_v1_generated_WidgetService_GenerateChatToken_async + */ + generateChatToken( + request?: protos.google.cloud.ces.v1.IGenerateChatTokenRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1.IGenerateChatTokenResponse, + protos.google.cloud.ces.v1.IGenerateChatTokenRequest|undefined, {}|undefined + ]>; + generateChatToken( + request: protos.google.cloud.ces.v1.IGenerateChatTokenRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1.IGenerateChatTokenResponse, + protos.google.cloud.ces.v1.IGenerateChatTokenRequest|null|undefined, + {}|null|undefined>): void; + generateChatToken( + request: protos.google.cloud.ces.v1.IGenerateChatTokenRequest, + callback: Callback< + protos.google.cloud.ces.v1.IGenerateChatTokenResponse, + protos.google.cloud.ces.v1.IGenerateChatTokenRequest|null|undefined, + {}|null|undefined>): void; + generateChatToken( + request?: protos.google.cloud.ces.v1.IGenerateChatTokenRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1.IGenerateChatTokenResponse, + protos.google.cloud.ces.v1.IGenerateChatTokenRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1.IGenerateChatTokenResponse, + protos.google.cloud.ces.v1.IGenerateChatTokenRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1.IGenerateChatTokenResponse, + protos.google.cloud.ces.v1.IGenerateChatTokenRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('generateChatToken request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1.IGenerateChatTokenResponse, + protos.google.cloud.ces.v1.IGenerateChatTokenRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateChatToken response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.generateChatToken(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1.IGenerateChatTokenResponse, + protos.google.cloud.ces.v1.IGenerateChatTokenRequest|undefined, + {}|undefined + ]) => { + this._log.info('generateChatToken response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Gets 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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project:string,location:string,app:string,agent:string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + app: app, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the app from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the app. + */ + matchAppFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).app; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified app resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @returns {string} Resource name string. + */ + appPath(project:string,location:string,app:string) { + return this.pathTemplates.appPathTemplate.render({ + project: project, + location: location, + app: app, + }); + } + + /** + * Parse the project from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).project; + } + + /** + * Parse the location from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).location; + } + + /** + * Parse the app from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the app. + */ + matchAppFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).app; + } + + /** + * Return a fully-qualified appVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} version + * @returns {string} Resource name string. + */ + appVersionPath(project:string,location:string,app:string,version:string) { + return this.pathTemplates.appVersionPathTemplate.render({ + project: project, + location: location, + app: app, + version: version, + }); + } + + /** + * Parse the project from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).project; + } + + /** + * Parse the location from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).location; + } + + /** + * Parse the app from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the app. + */ + matchAppFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).app; + } + + /** + * Parse the version from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).version; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath(project:string,location:string,app:string,changelog:string) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + app: app, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).location; + } + + /** + * Parse the app from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the app. + */ + matchAppFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).app; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).changelog; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath(project:string,location:string,app:string,conversation:string) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + app: app, + conversation: conversation, + }); + } + + /** + * Parse the project from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).project; + } + + /** + * Parse the location from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).location; + } + + /** + * Parse the app from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the app. + */ + matchAppFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).app; + } + + /** + * Parse the conversation from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).conversation; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,app:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + app: app, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the app from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the app. + */ + matchAppFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).app; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath(project:string,location:string,app:string,example:string) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + app: app, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the app from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the app. + */ + matchAppFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).app; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified guardrail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} guardrail + * @returns {string} Resource name string. + */ + guardrailPath(project:string,location:string,app:string,guardrail:string) { + return this.pathTemplates.guardrailPathTemplate.render({ + project: project, + location: location, + app: app, + guardrail: guardrail, + }); + } + + /** + * Parse the project from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).project; + } + + /** + * Parse the location from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).location; + } + + /** + * Parse the app from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the app. + */ + matchAppFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).app; + } + + /** + * Parse the guardrail from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the guardrail. + */ + matchGuardrailFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).guardrail; + } + + /** + * Return a fully-qualified omnichannel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} omnichannel + * @returns {string} Resource name string. + */ + omnichannelPath(project:string,location:string,omnichannel:string) { + return this.pathTemplates.omnichannelPathTemplate.render({ + project: project, + location: location, + omnichannel: omnichannel, + }); + } + + /** + * Parse the project from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).project; + } + + /** + * Parse the location from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).location; + } + + /** + * Parse the omnichannel from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the omnichannel. + */ + matchOmnichannelFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).omnichannel; + } + + /** + * Return a fully-qualified session resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} session + * @returns {string} Resource name string. + */ + sessionPath(project:string,location:string,app:string,session:string) { + return this.pathTemplates.sessionPathTemplate.render({ + project: project, + location: location, + app: app, + session: session, + }); + } + + /** + * Parse the project from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).project; + } + + /** + * Parse the location from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).location; + } + + /** + * Parse the app from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the app. + */ + matchAppFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).app; + } + + /** + * Parse the session from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).session; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project:string,location:string,app:string,tool:string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + app: app, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the app from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the app. + */ + matchAppFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).app; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} toolset + * @returns {string} Resource name string. + */ + toolsetPath(project:string,location:string,app:string,toolset:string) { + return this.pathTemplates.toolsetPathTemplate.render({ + project: project, + location: location, + app: app, + toolset: toolset, + }); + } + + /** + * Parse the project from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).project; + } + + /** + * Parse the location from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).location; + } + + /** + * Parse the app from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the app. + */ + matchAppFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).app; + } + + /** + * Parse the toolset from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the toolset. + */ + matchToolsetFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).toolset; + } + + /** + * 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.widgetServiceStub && !this._terminated) { + return this.widgetServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/src/v1/widget_service_client_config.json b/owl-bot-staging/google-cloud-ces/src/v1/widget_service_client_config.json new file mode 100644 index 00000000000..562d960fe94 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1/widget_service_client_config.json @@ -0,0 +1,30 @@ +{ + "interfaces": { + "google.cloud.ces.v1.WidgetService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GenerateChatToken": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-ces/src/v1/widget_service_proto_list.json b/owl-bot-staging/google-cloud-ces/src/v1/widget_service_proto_list.json new file mode 100644 index 00000000000..7f9a4c1d7f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1/widget_service_proto_list.json @@ -0,0 +1,40 @@ +[ + "../../protos/google/cloud/ces/v1/agent.proto", + "../../protos/google/cloud/ces/v1/agent_service.proto", + "../../protos/google/cloud/ces/v1/agent_transfers.proto", + "../../protos/google/cloud/ces/v1/app.proto", + "../../protos/google/cloud/ces/v1/app_version.proto", + "../../protos/google/cloud/ces/v1/auth.proto", + "../../protos/google/cloud/ces/v1/bigquery_export.proto", + "../../protos/google/cloud/ces/v1/changelog.proto", + "../../protos/google/cloud/ces/v1/client_function.proto", + "../../protos/google/cloud/ces/v1/common.proto", + "../../protos/google/cloud/ces/v1/connector_tool.proto", + "../../protos/google/cloud/ces/v1/connector_toolset.proto", + "../../protos/google/cloud/ces/v1/conversation.proto", + "../../protos/google/cloud/ces/v1/data_store.proto", + "../../protos/google/cloud/ces/v1/data_store_tool.proto", + "../../protos/google/cloud/ces/v1/deployment.proto", + "../../protos/google/cloud/ces/v1/example.proto", + "../../protos/google/cloud/ces/v1/fakes.proto", + "../../protos/google/cloud/ces/v1/file_search_tool.proto", + "../../protos/google/cloud/ces/v1/google_search_tool.proto", + "../../protos/google/cloud/ces/v1/guardrail.proto", + "../../protos/google/cloud/ces/v1/mcp_tool.proto", + "../../protos/google/cloud/ces/v1/mcp_toolset.proto", + "../../protos/google/cloud/ces/v1/omnichannel.proto", + "../../protos/google/cloud/ces/v1/omnichannel_service.proto", + "../../protos/google/cloud/ces/v1/open_api_tool.proto", + "../../protos/google/cloud/ces/v1/open_api_toolset.proto", + "../../protos/google/cloud/ces/v1/python_function.proto", + "../../protos/google/cloud/ces/v1/schema.proto", + "../../protos/google/cloud/ces/v1/search_suggestions.proto", + "../../protos/google/cloud/ces/v1/session_service.proto", + "../../protos/google/cloud/ces/v1/system_tool.proto", + "../../protos/google/cloud/ces/v1/tool.proto", + "../../protos/google/cloud/ces/v1/tool_service.proto", + "../../protos/google/cloud/ces/v1/toolset.proto", + "../../protos/google/cloud/ces/v1/toolset_tool.proto", + "../../protos/google/cloud/ces/v1/widget_service.proto", + "../../protos/google/cloud/ces/v1/widget_tool.proto" +] diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/agent_service_client.ts b/owl-bot-staging/google-cloud-ces/src/v1beta/agent_service_client.ts new file mode 100644 index 00000000000..c5fb6ee802c --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1beta/agent_service_client.ts @@ -0,0 +1,8050 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1beta/agent_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './agent_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The service that manages agent-related resources in Gemini Enterprise for + * Customer Engagement (CES). + * @class + * @memberof v1beta + */ +export class AgentServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('ces'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + agentServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AgentServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AgentServiceClient({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 AgentServiceClient; + 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 = 'ces.' + 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.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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/agents/{agent}' + ), + appPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}' + ), + appVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/versions/{version}' + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}' + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}' + ), + evaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}' + ), + evaluationDatasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluationDatasets/{evaluation_dataset}' + ), + evaluationExpectationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluationExpectations/{evaluation_expectation}' + ), + evaluationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}/results/{evaluation_result}' + ), + evaluationRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluationRuns/{evaluation_run}' + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/examples/{example}' + ), + guardrailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + omnichannelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/omnichannels/{omnichannel}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + scheduledEvaluationRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/scheduledEvaluationRuns/{scheduled_evaluation_run}' + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/tools/{tool}' + ), + toolsetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}' + ), + }; + + // 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 = { + listApps: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'apps'), + listAgents: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'agents'), + listExamples: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'examples'), + listTools: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tools'), + listConversations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'conversations'), + listGuardrails: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'guardrails'), + listDeployments: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'deployments'), + listToolsets: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'toolsets'), + listAppVersions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'appVersions'), + listChangelogs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'changelogs') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1beta/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1beta/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1beta/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{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 createAppResponse = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.App') as gax.protobuf.Type; + const createAppMetadata = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.OperationMetadata') as gax.protobuf.Type; + const deleteAppResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteAppMetadata = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.OperationMetadata') as gax.protobuf.Type; + const exportAppResponse = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.ExportAppResponse') as gax.protobuf.Type; + const exportAppMetadata = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.OperationMetadata') as gax.protobuf.Type; + const importAppResponse = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.ImportAppResponse') as gax.protobuf.Type; + const importAppMetadata = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.OperationMetadata') as gax.protobuf.Type; + const batchDeleteConversationsResponse = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.BatchDeleteConversationsResponse') as gax.protobuf.Type; + const batchDeleteConversationsMetadata = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.OperationMetadata') as gax.protobuf.Type; + const restoreAppVersionResponse = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.RestoreAppVersionResponse') as gax.protobuf.Type; + const restoreAppVersionMetadata = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createApp: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createAppResponse.decode.bind(createAppResponse), + createAppMetadata.decode.bind(createAppMetadata)), + deleteApp: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteAppResponse.decode.bind(deleteAppResponse), + deleteAppMetadata.decode.bind(deleteAppMetadata)), + exportApp: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportAppResponse.decode.bind(exportAppResponse), + exportAppMetadata.decode.bind(exportAppMetadata)), + importApp: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importAppResponse.decode.bind(importAppResponse), + importAppMetadata.decode.bind(importAppMetadata)), + batchDeleteConversations: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchDeleteConversationsResponse.decode.bind(batchDeleteConversationsResponse), + batchDeleteConversationsMetadata.decode.bind(batchDeleteConversationsMetadata)), + restoreAppVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreAppVersionResponse.decode.bind(restoreAppVersionResponse), + restoreAppVersionMetadata.decode.bind(restoreAppVersionMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.ces.v1beta.AgentService', 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.agentServiceStub) { + return this.agentServiceStub; + } + + // Put together the "service stub" for + // google.cloud.ces.v1beta.AgentService. + this.agentServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.ces.v1beta.AgentService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.ces.v1beta.AgentService, + 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 agentServiceStubMethods = + ['listApps', 'getApp', 'createApp', 'updateApp', 'deleteApp', 'exportApp', 'importApp', 'listAgents', 'getAgent', 'createAgent', 'updateAgent', 'deleteAgent', 'listExamples', 'getExample', 'createExample', 'updateExample', 'deleteExample', 'listTools', 'getTool', 'listConversations', 'getConversation', 'deleteConversation', 'batchDeleteConversations', 'createTool', 'updateTool', 'deleteTool', 'listGuardrails', 'getGuardrail', 'createGuardrail', 'updateGuardrail', 'deleteGuardrail', 'listDeployments', 'getDeployment', 'createDeployment', 'updateDeployment', 'deleteDeployment', 'listToolsets', 'getToolset', 'createToolset', 'updateToolset', 'deleteToolset', 'listAppVersions', 'getAppVersion', 'createAppVersion', 'deleteAppVersion', 'restoreAppVersion', 'listChangelogs', 'getChangelog']; + for (const methodName of agentServiceStubMethods) { + const callPromise = this.agentServiceStub.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.agentServiceStub; + } + + /** + * 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 'ces.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 'ces.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/ces', + '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 the specified app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the app to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.App|App}. + * 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/agent_service.get_app.js + * region_tag:ces_v1beta_generated_AgentService_GetApp_async + */ + getApp( + request?: protos.google.cloud.ces.v1beta.IGetAppRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IApp, + protos.google.cloud.ces.v1beta.IGetAppRequest|undefined, {}|undefined + ]>; + getApp( + request: protos.google.cloud.ces.v1beta.IGetAppRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IApp, + protos.google.cloud.ces.v1beta.IGetAppRequest|null|undefined, + {}|null|undefined>): void; + getApp( + request: protos.google.cloud.ces.v1beta.IGetAppRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IApp, + protos.google.cloud.ces.v1beta.IGetAppRequest|null|undefined, + {}|null|undefined>): void; + getApp( + request?: protos.google.cloud.ces.v1beta.IGetAppRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IApp, + protos.google.cloud.ces.v1beta.IGetAppRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IApp, + protos.google.cloud.ces.v1beta.IGetAppRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IApp, + protos.google.cloud.ces.v1beta.IGetAppRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getApp request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IApp, + protos.google.cloud.ces.v1beta.IGetAppRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getApp response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getApp(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IApp, + protos.google.cloud.ces.v1beta.IGetAppRequest|undefined, + {}|undefined + ]) => { + this._log.info('getApp response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the specified app. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1beta.App} request.app + * Required. The app to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.App|App}. + * 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/agent_service.update_app.js + * region_tag:ces_v1beta_generated_AgentService_UpdateApp_async + */ + updateApp( + request?: protos.google.cloud.ces.v1beta.IUpdateAppRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IApp, + protos.google.cloud.ces.v1beta.IUpdateAppRequest|undefined, {}|undefined + ]>; + updateApp( + request: protos.google.cloud.ces.v1beta.IUpdateAppRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IApp, + protos.google.cloud.ces.v1beta.IUpdateAppRequest|null|undefined, + {}|null|undefined>): void; + updateApp( + request: protos.google.cloud.ces.v1beta.IUpdateAppRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IApp, + protos.google.cloud.ces.v1beta.IUpdateAppRequest|null|undefined, + {}|null|undefined>): void; + updateApp( + request?: protos.google.cloud.ces.v1beta.IUpdateAppRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IApp, + protos.google.cloud.ces.v1beta.IUpdateAppRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IApp, + protos.google.cloud.ces.v1beta.IUpdateAppRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IApp, + protos.google.cloud.ces.v1beta.IUpdateAppRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'app.name': request.app!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateApp request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IApp, + protos.google.cloud.ces.v1beta.IUpdateAppRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateApp response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateApp(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IApp, + protos.google.cloud.ces.v1beta.IUpdateAppRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateApp response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the agent to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Agent|Agent}. + * 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/agent_service.get_agent.js + * region_tag:ces_v1beta_generated_AgentService_GetAgent_async + */ + getAgent( + request?: protos.google.cloud.ces.v1beta.IGetAgentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.IGetAgentRequest|undefined, {}|undefined + ]>; + getAgent( + request: protos.google.cloud.ces.v1beta.IGetAgentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.IGetAgentRequest|null|undefined, + {}|null|undefined>): void; + getAgent( + request: protos.google.cloud.ces.v1beta.IGetAgentRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.IGetAgentRequest|null|undefined, + {}|null|undefined>): void; + getAgent( + request?: protos.google.cloud.ces.v1beta.IGetAgentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.IGetAgentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.IGetAgentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.IGetAgentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getAgent request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.IGetAgentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAgent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getAgent(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.IGetAgentRequest|undefined, + {}|undefined + ]) => { + this._log.info('getAgent response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new agent in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to create an agent in. + * @param {string} [request.agentId] + * Optional. The ID to use for the agent, which will become the final + * component of the agent's resource name. If not provided, a unique ID will + * be automatically assigned for the agent. + * @param {google.cloud.ces.v1beta.Agent} request.agent + * Required. The agent to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Agent|Agent}. + * 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/agent_service.create_agent.js + * region_tag:ces_v1beta_generated_AgentService_CreateAgent_async + */ + createAgent( + request?: protos.google.cloud.ces.v1beta.ICreateAgentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.ICreateAgentRequest|undefined, {}|undefined + ]>; + createAgent( + request: protos.google.cloud.ces.v1beta.ICreateAgentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.ICreateAgentRequest|null|undefined, + {}|null|undefined>): void; + createAgent( + request: protos.google.cloud.ces.v1beta.ICreateAgentRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.ICreateAgentRequest|null|undefined, + {}|null|undefined>): void; + createAgent( + request?: protos.google.cloud.ces.v1beta.ICreateAgentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.ICreateAgentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.ICreateAgentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.ICreateAgentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createAgent request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.ICreateAgentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createAgent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createAgent(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.ICreateAgentRequest|undefined, + {}|undefined + ]) => { + this._log.info('createAgent response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1beta.Agent} request.agent + * Required. The agent to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Agent|Agent}. + * 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/agent_service.update_agent.js + * region_tag:ces_v1beta_generated_AgentService_UpdateAgent_async + */ + updateAgent( + request?: protos.google.cloud.ces.v1beta.IUpdateAgentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.IUpdateAgentRequest|undefined, {}|undefined + ]>; + updateAgent( + request: protos.google.cloud.ces.v1beta.IUpdateAgentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.IUpdateAgentRequest|null|undefined, + {}|null|undefined>): void; + updateAgent( + request: protos.google.cloud.ces.v1beta.IUpdateAgentRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.IUpdateAgentRequest|null|undefined, + {}|null|undefined>): void; + updateAgent( + request?: protos.google.cloud.ces.v1beta.IUpdateAgentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.IUpdateAgentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.IUpdateAgentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.IUpdateAgentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'agent.name': request.agent!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateAgent request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.IUpdateAgentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateAgent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateAgent(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IAgent, + protos.google.cloud.ces.v1beta.IUpdateAgentRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateAgent response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the agent to delete. + * @param {boolean} [request.force] + * Optional. Indicates whether to forcefully delete the agent, even if it is + * still referenced by other app/agents/examples. + * + * * If `force = false`, the deletion fails if other agents/examples + * reference it. + * * If `force = true`, delete the agent and remove it from all referencing + * apps/agents/examples. + * @param {string} [request.etag] + * Optional. The current etag of the agent. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the agent, 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 {@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/agent_service.delete_agent.js + * region_tag:ces_v1beta_generated_AgentService_DeleteAgent_async + */ + deleteAgent( + request?: protos.google.cloud.ces.v1beta.IDeleteAgentRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteAgentRequest|undefined, {}|undefined + ]>; + deleteAgent( + request: protos.google.cloud.ces.v1beta.IDeleteAgentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteAgentRequest|null|undefined, + {}|null|undefined>): void; + deleteAgent( + request: protos.google.cloud.ces.v1beta.IDeleteAgentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteAgentRequest|null|undefined, + {}|null|undefined>): void; + deleteAgent( + request?: protos.google.cloud.ces.v1beta.IDeleteAgentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteAgentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteAgentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteAgentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteAgent request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteAgentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAgent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteAgent(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteAgentRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteAgent response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified example. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the example to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Example|Example}. + * 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/agent_service.get_example.js + * region_tag:ces_v1beta_generated_AgentService_GetExample_async + */ + getExample( + request?: protos.google.cloud.ces.v1beta.IGetExampleRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.IGetExampleRequest|undefined, {}|undefined + ]>; + getExample( + request: protos.google.cloud.ces.v1beta.IGetExampleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.IGetExampleRequest|null|undefined, + {}|null|undefined>): void; + getExample( + request: protos.google.cloud.ces.v1beta.IGetExampleRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.IGetExampleRequest|null|undefined, + {}|null|undefined>): void; + getExample( + request?: protos.google.cloud.ces.v1beta.IGetExampleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.IGetExampleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.IGetExampleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.IGetExampleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getExample request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.IGetExampleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getExample response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getExample(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.IGetExampleRequest|undefined, + {}|undefined + ]) => { + this._log.info('getExample response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new example in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to create an example in. + * @param {string} [request.exampleId] + * Optional. The ID to use for the example, which will become the final + * component of the example's resource name. If not provided, a unique ID will + * be automatically assigned for the example. + * @param {google.cloud.ces.v1beta.Example} request.example + * Required. The example to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Example|Example}. + * 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/agent_service.create_example.js + * region_tag:ces_v1beta_generated_AgentService_CreateExample_async + */ + createExample( + request?: protos.google.cloud.ces.v1beta.ICreateExampleRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.ICreateExampleRequest|undefined, {}|undefined + ]>; + createExample( + request: protos.google.cloud.ces.v1beta.ICreateExampleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.ICreateExampleRequest|null|undefined, + {}|null|undefined>): void; + createExample( + request: protos.google.cloud.ces.v1beta.ICreateExampleRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.ICreateExampleRequest|null|undefined, + {}|null|undefined>): void; + createExample( + request?: protos.google.cloud.ces.v1beta.ICreateExampleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.ICreateExampleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.ICreateExampleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.ICreateExampleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createExample request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.ICreateExampleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createExample response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createExample(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.ICreateExampleRequest|undefined, + {}|undefined + ]) => { + this._log.info('createExample response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the specified example. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1beta.Example} request.example + * Required. The example to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Example|Example}. + * 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/agent_service.update_example.js + * region_tag:ces_v1beta_generated_AgentService_UpdateExample_async + */ + updateExample( + request?: protos.google.cloud.ces.v1beta.IUpdateExampleRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.IUpdateExampleRequest|undefined, {}|undefined + ]>; + updateExample( + request: protos.google.cloud.ces.v1beta.IUpdateExampleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.IUpdateExampleRequest|null|undefined, + {}|null|undefined>): void; + updateExample( + request: protos.google.cloud.ces.v1beta.IUpdateExampleRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.IUpdateExampleRequest|null|undefined, + {}|null|undefined>): void; + updateExample( + request?: protos.google.cloud.ces.v1beta.IUpdateExampleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.IUpdateExampleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.IUpdateExampleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.IUpdateExampleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'example.name': request.example!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateExample request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.IUpdateExampleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateExample response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateExample(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IExample, + protos.google.cloud.ces.v1beta.IUpdateExampleRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateExample response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the specified example. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the example to delete. + * @param {string} [request.etag] + * Optional. The current etag of the example. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the example, 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 {@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/agent_service.delete_example.js + * region_tag:ces_v1beta_generated_AgentService_DeleteExample_async + */ + deleteExample( + request?: protos.google.cloud.ces.v1beta.IDeleteExampleRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteExampleRequest|undefined, {}|undefined + ]>; + deleteExample( + request: protos.google.cloud.ces.v1beta.IDeleteExampleRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteExampleRequest|null|undefined, + {}|null|undefined>): void; + deleteExample( + request: protos.google.cloud.ces.v1beta.IDeleteExampleRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteExampleRequest|null|undefined, + {}|null|undefined>): void; + deleteExample( + request?: protos.google.cloud.ces.v1beta.IDeleteExampleRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteExampleRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteExampleRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteExampleRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteExample request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteExampleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteExample response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteExample(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteExampleRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteExample response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified tool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the tool to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Tool|Tool}. + * 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/agent_service.get_tool.js + * region_tag:ces_v1beta_generated_AgentService_GetTool_async + */ + getTool( + request?: protos.google.cloud.ces.v1beta.IGetToolRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.IGetToolRequest|undefined, {}|undefined + ]>; + getTool( + request: protos.google.cloud.ces.v1beta.IGetToolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.IGetToolRequest|null|undefined, + {}|null|undefined>): void; + getTool( + request: protos.google.cloud.ces.v1beta.IGetToolRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.IGetToolRequest|null|undefined, + {}|null|undefined>): void; + getTool( + request?: protos.google.cloud.ces.v1beta.IGetToolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.IGetToolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.IGetToolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.IGetToolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getTool request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.IGetToolRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getTool(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.IGetToolRequest|undefined, + {}|undefined + ]) => { + this._log.info('getTool response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the conversation to retrieve. + * @param {google.cloud.ces.v1beta.Conversation.Source} [request.source] + * Optional. Indicate the source of the conversation. If not set, all source + * will be searched. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Conversation|Conversation}. + * 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/agent_service.get_conversation.js + * region_tag:ces_v1beta_generated_AgentService_GetConversation_async + */ + getConversation( + request?: protos.google.cloud.ces.v1beta.IGetConversationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IConversation, + protos.google.cloud.ces.v1beta.IGetConversationRequest|undefined, {}|undefined + ]>; + getConversation( + request: protos.google.cloud.ces.v1beta.IGetConversationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IConversation, + protos.google.cloud.ces.v1beta.IGetConversationRequest|null|undefined, + {}|null|undefined>): void; + getConversation( + request: protos.google.cloud.ces.v1beta.IGetConversationRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IConversation, + protos.google.cloud.ces.v1beta.IGetConversationRequest|null|undefined, + {}|null|undefined>): void; + getConversation( + request?: protos.google.cloud.ces.v1beta.IGetConversationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IConversation, + protos.google.cloud.ces.v1beta.IGetConversationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IConversation, + protos.google.cloud.ces.v1beta.IGetConversationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IConversation, + protos.google.cloud.ces.v1beta.IGetConversationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getConversation request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IConversation, + protos.google.cloud.ces.v1beta.IGetConversationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConversation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getConversation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IConversation, + protos.google.cloud.ces.v1beta.IGetConversationRequest|undefined, + {}|undefined + ]) => { + this._log.info('getConversation response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the specified conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the conversation to delete. + * @param {google.cloud.ces.v1beta.Conversation.Source} [request.source] + * Optional. Indicate the source of the conversation. If not set, Source.Live + * will be applied by default. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/agent_service.delete_conversation.js + * region_tag:ces_v1beta_generated_AgentService_DeleteConversation_async + */ + deleteConversation( + request?: protos.google.cloud.ces.v1beta.IDeleteConversationRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteConversationRequest|undefined, {}|undefined + ]>; + deleteConversation( + request: protos.google.cloud.ces.v1beta.IDeleteConversationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteConversationRequest|null|undefined, + {}|null|undefined>): void; + deleteConversation( + request: protos.google.cloud.ces.v1beta.IDeleteConversationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteConversationRequest|null|undefined, + {}|null|undefined>): void; + deleteConversation( + request?: protos.google.cloud.ces.v1beta.IDeleteConversationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteConversationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteConversationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteConversationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteConversation request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteConversationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteConversation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteConversation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteConversationRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteConversation response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new tool in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to create a tool in. + * @param {string} [request.toolId] + * Optional. The ID to use for the tool, which will become the final component + * of the tool's resource name. If not provided, a unique ID will be + * automatically assigned for the tool. + * @param {google.cloud.ces.v1beta.Tool} request.tool + * Required. The tool to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Tool|Tool}. + * 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/agent_service.create_tool.js + * region_tag:ces_v1beta_generated_AgentService_CreateTool_async + */ + createTool( + request?: protos.google.cloud.ces.v1beta.ICreateToolRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.ICreateToolRequest|undefined, {}|undefined + ]>; + createTool( + request: protos.google.cloud.ces.v1beta.ICreateToolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.ICreateToolRequest|null|undefined, + {}|null|undefined>): void; + createTool( + request: protos.google.cloud.ces.v1beta.ICreateToolRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.ICreateToolRequest|null|undefined, + {}|null|undefined>): void; + createTool( + request?: protos.google.cloud.ces.v1beta.ICreateToolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.ICreateToolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.ICreateToolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.ICreateToolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createTool request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.ICreateToolRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createTool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createTool(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.ICreateToolRequest|undefined, + {}|undefined + ]) => { + this._log.info('createTool response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the specified tool. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1beta.Tool} request.tool + * Required. The tool to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Tool|Tool}. + * 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/agent_service.update_tool.js + * region_tag:ces_v1beta_generated_AgentService_UpdateTool_async + */ + updateTool( + request?: protos.google.cloud.ces.v1beta.IUpdateToolRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.IUpdateToolRequest|undefined, {}|undefined + ]>; + updateTool( + request: protos.google.cloud.ces.v1beta.IUpdateToolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.IUpdateToolRequest|null|undefined, + {}|null|undefined>): void; + updateTool( + request: protos.google.cloud.ces.v1beta.IUpdateToolRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.IUpdateToolRequest|null|undefined, + {}|null|undefined>): void; + updateTool( + request?: protos.google.cloud.ces.v1beta.IUpdateToolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.IUpdateToolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.IUpdateToolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.IUpdateToolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'tool.name': request.tool!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateTool request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.IUpdateToolRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateTool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateTool(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.ITool, + protos.google.cloud.ces.v1beta.IUpdateToolRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateTool response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the specified tool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the tool to delete. + * @param {boolean} [request.force] + * Optional. Indicates whether to forcefully delete the tool, even if it is + * still referenced by agents/examples. + * + * * If `force = false`, the deletion will fail if any agents still + * reference the tool. + * * If `force = true`, all existing references from agents will be removed + * and the tool will be deleted. + * @param {string} [request.etag] + * Optional. The current etag of the tool. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the tool, 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 {@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/agent_service.delete_tool.js + * region_tag:ces_v1beta_generated_AgentService_DeleteTool_async + */ + deleteTool( + request?: protos.google.cloud.ces.v1beta.IDeleteToolRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteToolRequest|undefined, {}|undefined + ]>; + deleteTool( + request: protos.google.cloud.ces.v1beta.IDeleteToolRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteToolRequest|null|undefined, + {}|null|undefined>): void; + deleteTool( + request: protos.google.cloud.ces.v1beta.IDeleteToolRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteToolRequest|null|undefined, + {}|null|undefined>): void; + deleteTool( + request?: protos.google.cloud.ces.v1beta.IDeleteToolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteToolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteToolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteToolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteTool request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteToolRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteTool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteTool(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteToolRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteTool response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified guardrail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the guardrail to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Guardrail|Guardrail}. + * 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/agent_service.get_guardrail.js + * region_tag:ces_v1beta_generated_AgentService_GetGuardrail_async + */ + getGuardrail( + request?: protos.google.cloud.ces.v1beta.IGetGuardrailRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.IGetGuardrailRequest|undefined, {}|undefined + ]>; + getGuardrail( + request: protos.google.cloud.ces.v1beta.IGetGuardrailRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.IGetGuardrailRequest|null|undefined, + {}|null|undefined>): void; + getGuardrail( + request: protos.google.cloud.ces.v1beta.IGetGuardrailRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.IGetGuardrailRequest|null|undefined, + {}|null|undefined>): void; + getGuardrail( + request?: protos.google.cloud.ces.v1beta.IGetGuardrailRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.IGetGuardrailRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.IGetGuardrailRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.IGetGuardrailRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getGuardrail request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.IGetGuardrailRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getGuardrail response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getGuardrail(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.IGetGuardrailRequest|undefined, + {}|undefined + ]) => { + this._log.info('getGuardrail response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new guardrail in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to create a guardrail in. + * @param {string} [request.guardrailId] + * Optional. The ID to use for the guardrail, which will become the final + * component of the guardrail's resource name. If not provided, a unique ID + * will be automatically assigned for the guardrail. + * @param {google.cloud.ces.v1beta.Guardrail} request.guardrail + * Required. The guardrail to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Guardrail|Guardrail}. + * 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/agent_service.create_guardrail.js + * region_tag:ces_v1beta_generated_AgentService_CreateGuardrail_async + */ + createGuardrail( + request?: protos.google.cloud.ces.v1beta.ICreateGuardrailRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.ICreateGuardrailRequest|undefined, {}|undefined + ]>; + createGuardrail( + request: protos.google.cloud.ces.v1beta.ICreateGuardrailRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.ICreateGuardrailRequest|null|undefined, + {}|null|undefined>): void; + createGuardrail( + request: protos.google.cloud.ces.v1beta.ICreateGuardrailRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.ICreateGuardrailRequest|null|undefined, + {}|null|undefined>): void; + createGuardrail( + request?: protos.google.cloud.ces.v1beta.ICreateGuardrailRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.ICreateGuardrailRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.ICreateGuardrailRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.ICreateGuardrailRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createGuardrail request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.ICreateGuardrailRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createGuardrail response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createGuardrail(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.ICreateGuardrailRequest|undefined, + {}|undefined + ]) => { + this._log.info('createGuardrail response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the specified guardrail. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1beta.Guardrail} request.guardrail + * Required. The guardrail to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Guardrail|Guardrail}. + * 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/agent_service.update_guardrail.js + * region_tag:ces_v1beta_generated_AgentService_UpdateGuardrail_async + */ + updateGuardrail( + request?: protos.google.cloud.ces.v1beta.IUpdateGuardrailRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.IUpdateGuardrailRequest|undefined, {}|undefined + ]>; + updateGuardrail( + request: protos.google.cloud.ces.v1beta.IUpdateGuardrailRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.IUpdateGuardrailRequest|null|undefined, + {}|null|undefined>): void; + updateGuardrail( + request: protos.google.cloud.ces.v1beta.IUpdateGuardrailRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.IUpdateGuardrailRequest|null|undefined, + {}|null|undefined>): void; + updateGuardrail( + request?: protos.google.cloud.ces.v1beta.IUpdateGuardrailRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.IUpdateGuardrailRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.IUpdateGuardrailRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.IUpdateGuardrailRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'guardrail.name': request.guardrail!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateGuardrail request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.IUpdateGuardrailRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateGuardrail response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateGuardrail(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IGuardrail, + protos.google.cloud.ces.v1beta.IUpdateGuardrailRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateGuardrail response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the specified guardrail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the guardrail to delete. + * @param {boolean} [request.force] + * Optional. Indicates whether to forcefully delete the guardrail, even if it + * is still referenced by app/agents. + * + * * If `force = false`, the deletion fails if any apps/agents still + * reference the guardrail. + * * If `force = true`, all existing references from apps/agents will be + * removed and the guardrail will be deleted. + * @param {string} [request.etag] + * Optional. The current etag of the guardrail. If an etag is not provided, + * the deletion will overwrite any concurrent changes. If an etag is provided + * and does not match the current etag of the guardrail, 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 {@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/agent_service.delete_guardrail.js + * region_tag:ces_v1beta_generated_AgentService_DeleteGuardrail_async + */ + deleteGuardrail( + request?: protos.google.cloud.ces.v1beta.IDeleteGuardrailRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteGuardrailRequest|undefined, {}|undefined + ]>; + deleteGuardrail( + request: protos.google.cloud.ces.v1beta.IDeleteGuardrailRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteGuardrailRequest|null|undefined, + {}|null|undefined>): void; + deleteGuardrail( + request: protos.google.cloud.ces.v1beta.IDeleteGuardrailRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteGuardrailRequest|null|undefined, + {}|null|undefined>): void; + deleteGuardrail( + request?: protos.google.cloud.ces.v1beta.IDeleteGuardrailRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteGuardrailRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteGuardrailRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteGuardrailRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteGuardrail request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteGuardrailRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteGuardrail response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteGuardrail(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteGuardrailRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteGuardrail response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Deployment|Deployment}. + * 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/agent_service.get_deployment.js + * region_tag:ces_v1beta_generated_AgentService_GetDeployment_async + */ + getDeployment( + request?: protos.google.cloud.ces.v1beta.IGetDeploymentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.IGetDeploymentRequest|undefined, {}|undefined + ]>; + getDeployment( + request: protos.google.cloud.ces.v1beta.IGetDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.IGetDeploymentRequest|null|undefined, + {}|null|undefined>): void; + getDeployment( + request: protos.google.cloud.ces.v1beta.IGetDeploymentRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.IGetDeploymentRequest|null|undefined, + {}|null|undefined>): void; + getDeployment( + request?: protos.google.cloud.ces.v1beta.IGetDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.IGetDeploymentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.IGetDeploymentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.IGetDeploymentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getDeployment request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.IGetDeploymentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getDeployment(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.IGetDeploymentRequest|undefined, + {}|undefined + ]) => { + this._log.info('getDeployment response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new deployment in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent app. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + * @param {string} [request.deploymentId] + * Optional. The ID to use for the deployment, which will become the final + * component of the deployment's resource name. If not provided, a unique ID + * will be automatically assigned for the deployment. + * @param {google.cloud.ces.v1beta.Deployment} request.deployment + * Required. The deployment to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Deployment|Deployment}. + * 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/agent_service.create_deployment.js + * region_tag:ces_v1beta_generated_AgentService_CreateDeployment_async + */ + createDeployment( + request?: protos.google.cloud.ces.v1beta.ICreateDeploymentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.ICreateDeploymentRequest|undefined, {}|undefined + ]>; + createDeployment( + request: protos.google.cloud.ces.v1beta.ICreateDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.ICreateDeploymentRequest|null|undefined, + {}|null|undefined>): void; + createDeployment( + request: protos.google.cloud.ces.v1beta.ICreateDeploymentRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.ICreateDeploymentRequest|null|undefined, + {}|null|undefined>): void; + createDeployment( + request?: protos.google.cloud.ces.v1beta.ICreateDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.ICreateDeploymentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.ICreateDeploymentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.ICreateDeploymentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createDeployment request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.ICreateDeploymentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createDeployment(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.ICreateDeploymentRequest|undefined, + {}|undefined + ]) => { + this._log.info('createDeployment response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the specified deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1beta.Deployment} request.deployment + * Required. The deployment to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Deployment|Deployment}. + * 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/agent_service.update_deployment.js + * region_tag:ces_v1beta_generated_AgentService_UpdateDeployment_async + */ + updateDeployment( + request?: protos.google.cloud.ces.v1beta.IUpdateDeploymentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.IUpdateDeploymentRequest|undefined, {}|undefined + ]>; + updateDeployment( + request: protos.google.cloud.ces.v1beta.IUpdateDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.IUpdateDeploymentRequest|null|undefined, + {}|null|undefined>): void; + updateDeployment( + request: protos.google.cloud.ces.v1beta.IUpdateDeploymentRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.IUpdateDeploymentRequest|null|undefined, + {}|null|undefined>): void; + updateDeployment( + request?: protos.google.cloud.ces.v1beta.IUpdateDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.IUpdateDeploymentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.IUpdateDeploymentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.IUpdateDeploymentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'deployment.name': request.deployment!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateDeployment request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.IUpdateDeploymentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateDeployment(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IDeployment, + protos.google.cloud.ces.v1beta.IUpdateDeploymentRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateDeployment response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the specified deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment to delete. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` + * @param {string} [request.etag] + * Optional. The etag of the deployment. + * If an etag is provided and does not match the current etag of the + * deployment, 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 {@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/agent_service.delete_deployment.js + * region_tag:ces_v1beta_generated_AgentService_DeleteDeployment_async + */ + deleteDeployment( + request?: protos.google.cloud.ces.v1beta.IDeleteDeploymentRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteDeploymentRequest|undefined, {}|undefined + ]>; + deleteDeployment( + request: protos.google.cloud.ces.v1beta.IDeleteDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteDeploymentRequest|null|undefined, + {}|null|undefined>): void; + deleteDeployment( + request: protos.google.cloud.ces.v1beta.IDeleteDeploymentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteDeploymentRequest|null|undefined, + {}|null|undefined>): void; + deleteDeployment( + request?: protos.google.cloud.ces.v1beta.IDeleteDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteDeploymentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteDeploymentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteDeploymentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteDeployment request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteDeploymentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteDeployment(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteDeploymentRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteDeployment response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified toolset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the toolset to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Toolset|Toolset}. + * 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/agent_service.get_toolset.js + * region_tag:ces_v1beta_generated_AgentService_GetToolset_async + */ + getToolset( + request?: protos.google.cloud.ces.v1beta.IGetToolsetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.IGetToolsetRequest|undefined, {}|undefined + ]>; + getToolset( + request: protos.google.cloud.ces.v1beta.IGetToolsetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.IGetToolsetRequest|null|undefined, + {}|null|undefined>): void; + getToolset( + request: protos.google.cloud.ces.v1beta.IGetToolsetRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.IGetToolsetRequest|null|undefined, + {}|null|undefined>): void; + getToolset( + request?: protos.google.cloud.ces.v1beta.IGetToolsetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.IGetToolsetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.IGetToolsetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.IGetToolsetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getToolset request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.IGetToolsetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getToolset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getToolset(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.IGetToolsetRequest|undefined, + {}|undefined + ]) => { + this._log.info('getToolset response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new toolset in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to create a toolset in. + * @param {string} [request.toolsetId] + * Optional. The ID to use for the toolset, which will become the final + * component of the toolset's resource name. If not provided, a unique ID will + * be automatically assigned for the toolset. + * @param {google.cloud.ces.v1beta.Toolset} request.toolset + * Required. The toolset to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Toolset|Toolset}. + * 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/agent_service.create_toolset.js + * region_tag:ces_v1beta_generated_AgentService_CreateToolset_async + */ + createToolset( + request?: protos.google.cloud.ces.v1beta.ICreateToolsetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.ICreateToolsetRequest|undefined, {}|undefined + ]>; + createToolset( + request: protos.google.cloud.ces.v1beta.ICreateToolsetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.ICreateToolsetRequest|null|undefined, + {}|null|undefined>): void; + createToolset( + request: protos.google.cloud.ces.v1beta.ICreateToolsetRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.ICreateToolsetRequest|null|undefined, + {}|null|undefined>): void; + createToolset( + request?: protos.google.cloud.ces.v1beta.ICreateToolsetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.ICreateToolsetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.ICreateToolsetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.ICreateToolsetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createToolset request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.ICreateToolsetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createToolset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createToolset(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.ICreateToolsetRequest|undefined, + {}|undefined + ]) => { + this._log.info('createToolset response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the specified toolset. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1beta.Toolset} request.toolset + * Required. The toolset to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Toolset|Toolset}. + * 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/agent_service.update_toolset.js + * region_tag:ces_v1beta_generated_AgentService_UpdateToolset_async + */ + updateToolset( + request?: protos.google.cloud.ces.v1beta.IUpdateToolsetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.IUpdateToolsetRequest|undefined, {}|undefined + ]>; + updateToolset( + request: protos.google.cloud.ces.v1beta.IUpdateToolsetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.IUpdateToolsetRequest|null|undefined, + {}|null|undefined>): void; + updateToolset( + request: protos.google.cloud.ces.v1beta.IUpdateToolsetRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.IUpdateToolsetRequest|null|undefined, + {}|null|undefined>): void; + updateToolset( + request?: protos.google.cloud.ces.v1beta.IUpdateToolsetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.IUpdateToolsetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.IUpdateToolsetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.IUpdateToolsetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'toolset.name': request.toolset!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateToolset request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.IUpdateToolsetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateToolset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateToolset(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IToolset, + protos.google.cloud.ces.v1beta.IUpdateToolsetRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateToolset response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the specified toolset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the toolset to delete. + * @param {boolean} [request.force] + * Optional. Indicates whether to forcefully delete the toolset, even if it is + * still referenced by app/agents. + * + * * If `force = false`, the deletion fails if any agents still + * reference the toolset. + * * If `force = true`, all existing references from agents will be + * removed and the toolset will be deleted. + * @param {string} [request.etag] + * Optional. The current etag of the toolset. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the toolset, 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 {@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/agent_service.delete_toolset.js + * region_tag:ces_v1beta_generated_AgentService_DeleteToolset_async + */ + deleteToolset( + request?: protos.google.cloud.ces.v1beta.IDeleteToolsetRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteToolsetRequest|undefined, {}|undefined + ]>; + deleteToolset( + request: protos.google.cloud.ces.v1beta.IDeleteToolsetRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteToolsetRequest|null|undefined, + {}|null|undefined>): void; + deleteToolset( + request: protos.google.cloud.ces.v1beta.IDeleteToolsetRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteToolsetRequest|null|undefined, + {}|null|undefined>): void; + deleteToolset( + request?: protos.google.cloud.ces.v1beta.IDeleteToolsetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteToolsetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteToolsetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteToolsetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteToolset request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteToolsetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteToolset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteToolset(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteToolsetRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteToolset response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified app version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the app version to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.AppVersion|AppVersion}. + * 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/agent_service.get_app_version.js + * region_tag:ces_v1beta_generated_AgentService_GetAppVersion_async + */ + getAppVersion( + request?: protos.google.cloud.ces.v1beta.IGetAppVersionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IAppVersion, + protos.google.cloud.ces.v1beta.IGetAppVersionRequest|undefined, {}|undefined + ]>; + getAppVersion( + request: protos.google.cloud.ces.v1beta.IGetAppVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IAppVersion, + protos.google.cloud.ces.v1beta.IGetAppVersionRequest|null|undefined, + {}|null|undefined>): void; + getAppVersion( + request: protos.google.cloud.ces.v1beta.IGetAppVersionRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IAppVersion, + protos.google.cloud.ces.v1beta.IGetAppVersionRequest|null|undefined, + {}|null|undefined>): void; + getAppVersion( + request?: protos.google.cloud.ces.v1beta.IGetAppVersionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IAppVersion, + protos.google.cloud.ces.v1beta.IGetAppVersionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IAppVersion, + protos.google.cloud.ces.v1beta.IGetAppVersionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IAppVersion, + protos.google.cloud.ces.v1beta.IGetAppVersionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getAppVersion request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IAppVersion, + protos.google.cloud.ces.v1beta.IGetAppVersionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAppVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getAppVersion(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IAppVersion, + protos.google.cloud.ces.v1beta.IGetAppVersionRequest|undefined, + {}|undefined + ]) => { + this._log.info('getAppVersion response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new app version in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to create an app version in. + * @param {string} [request.appVersionId] + * Optional. The ID to use for the app version, which will become the final + * component of the app version's resource name. If not provided, a unique ID + * will be automatically assigned for the app version. + * @param {google.cloud.ces.v1beta.AppVersion} request.appVersion + * Required. The app version to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.AppVersion|AppVersion}. + * 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/agent_service.create_app_version.js + * region_tag:ces_v1beta_generated_AgentService_CreateAppVersion_async + */ + createAppVersion( + request?: protos.google.cloud.ces.v1beta.ICreateAppVersionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IAppVersion, + protos.google.cloud.ces.v1beta.ICreateAppVersionRequest|undefined, {}|undefined + ]>; + createAppVersion( + request: protos.google.cloud.ces.v1beta.ICreateAppVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IAppVersion, + protos.google.cloud.ces.v1beta.ICreateAppVersionRequest|null|undefined, + {}|null|undefined>): void; + createAppVersion( + request: protos.google.cloud.ces.v1beta.ICreateAppVersionRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IAppVersion, + protos.google.cloud.ces.v1beta.ICreateAppVersionRequest|null|undefined, + {}|null|undefined>): void; + createAppVersion( + request?: protos.google.cloud.ces.v1beta.ICreateAppVersionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IAppVersion, + protos.google.cloud.ces.v1beta.ICreateAppVersionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IAppVersion, + protos.google.cloud.ces.v1beta.ICreateAppVersionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IAppVersion, + protos.google.cloud.ces.v1beta.ICreateAppVersionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createAppVersion request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IAppVersion, + protos.google.cloud.ces.v1beta.ICreateAppVersionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createAppVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createAppVersion(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IAppVersion, + protos.google.cloud.ces.v1beta.ICreateAppVersionRequest|undefined, + {}|undefined + ]) => { + this._log.info('createAppVersion response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the specified app version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the app version to delete. + * @param {string} [request.etag] + * Optional. The current etag of the app version. If an etag is not provided, + * the deletion will overwrite any concurrent changes. If an etag is provided + * and does not match the current etag of the app version, 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 {@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/agent_service.delete_app_version.js + * region_tag:ces_v1beta_generated_AgentService_DeleteAppVersion_async + */ + deleteAppVersion( + request?: protos.google.cloud.ces.v1beta.IDeleteAppVersionRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteAppVersionRequest|undefined, {}|undefined + ]>; + deleteAppVersion( + request: protos.google.cloud.ces.v1beta.IDeleteAppVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteAppVersionRequest|null|undefined, + {}|null|undefined>): void; + deleteAppVersion( + request: protos.google.cloud.ces.v1beta.IDeleteAppVersionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteAppVersionRequest|null|undefined, + {}|null|undefined>): void; + deleteAppVersion( + request?: protos.google.cloud.ces.v1beta.IDeleteAppVersionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteAppVersionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteAppVersionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteAppVersionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteAppVersion request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteAppVersionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAppVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteAppVersion(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteAppVersionRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteAppVersion response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets the specified changelog. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the changelog to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Changelog|Changelog}. + * 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/agent_service.get_changelog.js + * region_tag:ces_v1beta_generated_AgentService_GetChangelog_async + */ + getChangelog( + request?: protos.google.cloud.ces.v1beta.IGetChangelogRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IChangelog, + protos.google.cloud.ces.v1beta.IGetChangelogRequest|undefined, {}|undefined + ]>; + getChangelog( + request: protos.google.cloud.ces.v1beta.IGetChangelogRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IChangelog, + protos.google.cloud.ces.v1beta.IGetChangelogRequest|null|undefined, + {}|null|undefined>): void; + getChangelog( + request: protos.google.cloud.ces.v1beta.IGetChangelogRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IChangelog, + protos.google.cloud.ces.v1beta.IGetChangelogRequest|null|undefined, + {}|null|undefined>): void; + getChangelog( + request?: protos.google.cloud.ces.v1beta.IGetChangelogRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IChangelog, + protos.google.cloud.ces.v1beta.IGetChangelogRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IChangelog, + protos.google.cloud.ces.v1beta.IGetChangelogRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IChangelog, + protos.google.cloud.ces.v1beta.IGetChangelogRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getChangelog request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IChangelog, + protos.google.cloud.ces.v1beta.IGetChangelogRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getChangelog response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getChangelog(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IChangelog, + protos.google.cloud.ces.v1beta.IGetChangelogRequest|undefined, + {}|undefined + ]) => { + this._log.info('getChangelog response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Creates a new app in the given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location to create an app in. + * @param {string} [request.appId] + * Optional. The ID to use for the app, which will become the final component + * of the app's resource name. If not provided, a unique ID will be + * automatically assigned for the app. + * @param {google.cloud.ces.v1beta.App} request.app + * Required. The app to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/agent_service.create_app.js + * region_tag:ces_v1beta_generated_AgentService_CreateApp_async + */ + createApp( + request?: protos.google.cloud.ces.v1beta.ICreateAppRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createApp( + request: protos.google.cloud.ces.v1beta.ICreateAppRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createApp( + request: protos.google.cloud.ces.v1beta.ICreateAppRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createApp( + request?: protos.google.cloud.ces.v1beta.ICreateAppRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createApp response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createApp request %j', request); + return this.innerApiCalls.createApp(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createApp response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createApp()`. + * @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/agent_service.create_app.js + * region_tag:ces_v1beta_generated_AgentService_CreateApp_async + */ + async checkCreateAppProgress(name: string): Promise>{ + this._log.info('createApp long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createApp, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes the specified app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the app to delete. + * @param {string} [request.etag] + * Optional. The current etag of the app. If an etag is not provided, the + * deletion will overwrite any concurrent changes. If an etag is provided and + * does not match the current etag of the app, 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/agent_service.delete_app.js + * region_tag:ces_v1beta_generated_AgentService_DeleteApp_async + */ + deleteApp( + request?: protos.google.cloud.ces.v1beta.IDeleteAppRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteApp( + request: protos.google.cloud.ces.v1beta.IDeleteAppRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteApp( + request: protos.google.cloud.ces.v1beta.IDeleteAppRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteApp( + request?: protos.google.cloud.ces.v1beta.IDeleteAppRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteApp response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteApp request %j', request); + return this.innerApiCalls.deleteApp(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteApp response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteApp()`. + * @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/agent_service.delete_app.js + * region_tag:ces_v1beta_generated_AgentService_DeleteApp_async + */ + async checkDeleteAppProgress(name: string): Promise>{ + this._log.info('deleteApp long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteApp, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Exports the specified app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the app to export. + * @param {google.cloud.ces.v1beta.ExportAppRequest.ExportFormat} request.exportFormat + * Required. The format to export the app in. + * @param {string} [request.gcsUri] + * Optional. The [Google Cloud + * Storage](https://cloud.google.com/storage/docs/) URI to which to export the + * app. The format of this URI must be `gs:///`. The + * exported app archive will be written directly to the specified GCS object. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/agent_service.export_app.js + * region_tag:ces_v1beta_generated_AgentService_ExportApp_async + */ + exportApp( + request?: protos.google.cloud.ces.v1beta.IExportAppRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + exportApp( + request: protos.google.cloud.ces.v1beta.IExportAppRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportApp( + request: protos.google.cloud.ces.v1beta.IExportAppRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportApp( + request?: protos.google.cloud.ces.v1beta.IExportAppRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportApp response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportApp request %j', request); + return this.innerApiCalls.exportApp(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('exportApp response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `exportApp()`. + * @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/agent_service.export_app.js + * region_tag:ces_v1beta_generated_AgentService_ExportApp_async + */ + async checkExportAppProgress(name: string): Promise>{ + this._log.info('exportApp long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportApp, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Imports the specified app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.gcsUri + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * from which to import app. The format of this URI must be + * `gs:///`. + * @param {Buffer} request.appContent + * Raw bytes representing the compressed zip file with the app folder + * structure. + * @param {string} request.parent + * Required. The parent resource name with the location of the app to import. + * @param {string} [request.displayName] + * Optional. The display name of the app to import. + * * If the app is created on import, and the display name is specified, + * the imported app will use this display name. If a conflict is detected + * with an existing app, a timestamp will be appended to the display name + * to make it unique. + * * If the app is a reimport, this field should not be set. Providing a + * display name during reimport will result in an INVALID_ARGUMENT error. + * @param {string} [request.appId] + * Optional. The ID to use for the imported app. + * * If not specified, a unique ID will be automatically assigned for + * the app. + * * Otherwise, the imported app will use this ID as the final component of + * its resource name. If an app with the same ID already exists at the + * specified location in the project, the content of the existing app will be + * replaced. + * @param {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions} [request.importOptions] + * Optional. Options governing the import process for the app. + * @param {boolean} [request.ignoreAppLock] + * Optional. Flag for overriding the app lock during import. + * If set to true, the import process will ignore the app lock. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/agent_service.import_app.js + * region_tag:ces_v1beta_generated_AgentService_ImportApp_async + */ + importApp( + request?: protos.google.cloud.ces.v1beta.IImportAppRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + importApp( + request: protos.google.cloud.ces.v1beta.IImportAppRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importApp( + request: protos.google.cloud.ces.v1beta.IImportAppRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importApp( + request?: protos.google.cloud.ces.v1beta.IImportAppRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importApp response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importApp request %j', request); + return this.innerApiCalls.importApp(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('importApp response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `importApp()`. + * @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/agent_service.import_app.js + * region_tag:ces_v1beta_generated_AgentService_ImportApp_async + */ + async checkImportAppProgress(name: string): Promise>{ + this._log.info('importApp long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importApp, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Batch deletes the specified conversations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to delete conversations from. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + * @param {string[]} request.conversations + * Required. The resource names of the conversations to 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/agent_service.batch_delete_conversations.js + * region_tag:ces_v1beta_generated_AgentService_BatchDeleteConversations_async + */ + batchDeleteConversations( + request?: protos.google.cloud.ces.v1beta.IBatchDeleteConversationsRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + batchDeleteConversations( + request: protos.google.cloud.ces.v1beta.IBatchDeleteConversationsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchDeleteConversations( + request: protos.google.cloud.ces.v1beta.IBatchDeleteConversationsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchDeleteConversations( + request?: protos.google.cloud.ces.v1beta.IBatchDeleteConversationsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('batchDeleteConversations response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchDeleteConversations request %j', request); + return this.innerApiCalls.batchDeleteConversations(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('batchDeleteConversations response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `batchDeleteConversations()`. + * @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/agent_service.batch_delete_conversations.js + * region_tag:ces_v1beta_generated_AgentService_BatchDeleteConversations_async + */ + async checkBatchDeleteConversationsProgress(name: string): Promise>{ + this._log.info('batchDeleteConversations long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchDeleteConversations, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Restores the specified app version. + * This will create a new app version from the current draft app and overwrite + * the current draft with the specified app version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the app version to restore. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/agent_service.restore_app_version.js + * region_tag:ces_v1beta_generated_AgentService_RestoreAppVersion_async + */ + restoreAppVersion( + request?: protos.google.cloud.ces.v1beta.IRestoreAppVersionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restoreAppVersion( + request: protos.google.cloud.ces.v1beta.IRestoreAppVersionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreAppVersion( + request: protos.google.cloud.ces.v1beta.IRestoreAppVersionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreAppVersion( + request?: protos.google.cloud.ces.v1beta.IRestoreAppVersionRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restoreAppVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreAppVersion request %j', request); + return this.innerApiCalls.restoreAppVersion(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('restoreAppVersion response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `restoreAppVersion()`. + * @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/agent_service.restore_app_version.js + * region_tag:ces_v1beta_generated_AgentService_RestoreAppVersion_async + */ + async checkRestoreAppVersionProgress(name: string): Promise>{ + this._log.info('restoreAppVersion long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreAppVersion, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists apps in the given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location to list apps from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListAppsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListApps|AgentService.ListApps} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the apps. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1beta.App|App}. + * 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 `listAppsAsync()` + * 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. + */ + listApps( + request?: protos.google.cloud.ces.v1beta.IListAppsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IApp[], + protos.google.cloud.ces.v1beta.IListAppsRequest|null, + protos.google.cloud.ces.v1beta.IListAppsResponse + ]>; + listApps( + request: protos.google.cloud.ces.v1beta.IListAppsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListAppsRequest, + protos.google.cloud.ces.v1beta.IListAppsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IApp>): void; + listApps( + request: protos.google.cloud.ces.v1beta.IListAppsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListAppsRequest, + protos.google.cloud.ces.v1beta.IListAppsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IApp>): void; + listApps( + request?: protos.google.cloud.ces.v1beta.IListAppsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1beta.IListAppsRequest, + protos.google.cloud.ces.v1beta.IListAppsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IApp>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1beta.IListAppsRequest, + protos.google.cloud.ces.v1beta.IListAppsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IApp>): + Promise<[ + protos.google.cloud.ces.v1beta.IApp[], + protos.google.cloud.ces.v1beta.IListAppsRequest|null, + protos.google.cloud.ces.v1beta.IListAppsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListAppsRequest, + protos.google.cloud.ces.v1beta.IListAppsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IApp>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listApps values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listApps request %j', request); + return this.innerApiCalls + .listApps(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1beta.IApp[], + protos.google.cloud.ces.v1beta.IListAppsRequest|null, + protos.google.cloud.ces.v1beta.IListAppsResponse + ]) => { + this._log.info('listApps values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listApps`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location to list apps from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListAppsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListApps|AgentService.ListApps} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the apps. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.App|App} 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 `listAppsAsync()` + * 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. + */ + listAppsStream( + request?: protos.google.cloud.ces.v1beta.IListAppsRequest, + 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['listApps']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listApps stream %j', request); + return this.descriptors.page.listApps.createStream( + this.innerApiCalls.listApps as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listApps`, 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 resource name of the location to list apps from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListAppsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListApps|AgentService.ListApps} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the apps. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.App|App}. 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/agent_service.list_apps.js + * region_tag:ces_v1beta_generated_AgentService_ListApps_async + */ + listAppsAsync( + request?: protos.google.cloud.ces.v1beta.IListAppsRequest, + 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['listApps']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listApps iterate %j', request); + return this.descriptors.page.listApps.asyncIterate( + this.innerApiCalls['listApps'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists agents in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list agents from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListAgentsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListAgents|AgentService.ListAgents} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the agents. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1beta.Agent|Agent}. + * 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 `listAgentsAsync()` + * 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. + */ + listAgents( + request?: protos.google.cloud.ces.v1beta.IListAgentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IAgent[], + protos.google.cloud.ces.v1beta.IListAgentsRequest|null, + protos.google.cloud.ces.v1beta.IListAgentsResponse + ]>; + listAgents( + request: protos.google.cloud.ces.v1beta.IListAgentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListAgentsRequest, + protos.google.cloud.ces.v1beta.IListAgentsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IAgent>): void; + listAgents( + request: protos.google.cloud.ces.v1beta.IListAgentsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListAgentsRequest, + protos.google.cloud.ces.v1beta.IListAgentsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IAgent>): void; + listAgents( + request?: protos.google.cloud.ces.v1beta.IListAgentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1beta.IListAgentsRequest, + protos.google.cloud.ces.v1beta.IListAgentsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IAgent>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1beta.IListAgentsRequest, + protos.google.cloud.ces.v1beta.IListAgentsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IAgent>): + Promise<[ + protos.google.cloud.ces.v1beta.IAgent[], + protos.google.cloud.ces.v1beta.IListAgentsRequest|null, + protos.google.cloud.ces.v1beta.IListAgentsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListAgentsRequest, + protos.google.cloud.ces.v1beta.IListAgentsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IAgent>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAgents values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAgents request %j', request); + return this.innerApiCalls + .listAgents(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1beta.IAgent[], + protos.google.cloud.ces.v1beta.IListAgentsRequest|null, + protos.google.cloud.ces.v1beta.IListAgentsResponse + ]) => { + this._log.info('listAgents values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listAgents`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list agents from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListAgentsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListAgents|AgentService.ListAgents} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the agents. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.Agent|Agent} 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 `listAgentsAsync()` + * 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. + */ + listAgentsStream( + request?: protos.google.cloud.ces.v1beta.IListAgentsRequest, + 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['listAgents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAgents stream %j', request); + return this.descriptors.page.listAgents.createStream( + this.innerApiCalls.listAgents as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAgents`, 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 resource name of the app to list agents from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListAgentsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListAgents|AgentService.ListAgents} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the agents. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.Agent|Agent}. 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/agent_service.list_agents.js + * region_tag:ces_v1beta_generated_AgentService_ListAgents_async + */ + listAgentsAsync( + request?: protos.google.cloud.ces.v1beta.IListAgentsRequest, + 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['listAgents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAgents iterate %j', request); + return this.descriptors.page.listAgents.asyncIterate( + this.innerApiCalls['listAgents'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists examples in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list examples from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListExamplesResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListExamples|AgentService.ListExamples} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the examples. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1beta.Example|Example}. + * 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 `listExamplesAsync()` + * 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. + */ + listExamples( + request?: protos.google.cloud.ces.v1beta.IListExamplesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IExample[], + protos.google.cloud.ces.v1beta.IListExamplesRequest|null, + protos.google.cloud.ces.v1beta.IListExamplesResponse + ]>; + listExamples( + request: protos.google.cloud.ces.v1beta.IListExamplesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListExamplesRequest, + protos.google.cloud.ces.v1beta.IListExamplesResponse|null|undefined, + protos.google.cloud.ces.v1beta.IExample>): void; + listExamples( + request: protos.google.cloud.ces.v1beta.IListExamplesRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListExamplesRequest, + protos.google.cloud.ces.v1beta.IListExamplesResponse|null|undefined, + protos.google.cloud.ces.v1beta.IExample>): void; + listExamples( + request?: protos.google.cloud.ces.v1beta.IListExamplesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1beta.IListExamplesRequest, + protos.google.cloud.ces.v1beta.IListExamplesResponse|null|undefined, + protos.google.cloud.ces.v1beta.IExample>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1beta.IListExamplesRequest, + protos.google.cloud.ces.v1beta.IListExamplesResponse|null|undefined, + protos.google.cloud.ces.v1beta.IExample>): + Promise<[ + protos.google.cloud.ces.v1beta.IExample[], + protos.google.cloud.ces.v1beta.IListExamplesRequest|null, + protos.google.cloud.ces.v1beta.IListExamplesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListExamplesRequest, + protos.google.cloud.ces.v1beta.IListExamplesResponse|null|undefined, + protos.google.cloud.ces.v1beta.IExample>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listExamples values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listExamples request %j', request); + return this.innerApiCalls + .listExamples(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1beta.IExample[], + protos.google.cloud.ces.v1beta.IListExamplesRequest|null, + protos.google.cloud.ces.v1beta.IListExamplesResponse + ]) => { + this._log.info('listExamples values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listExamples`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list examples from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListExamplesResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListExamples|AgentService.ListExamples} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the examples. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.Example|Example} 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 `listExamplesAsync()` + * 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. + */ + listExamplesStream( + request?: protos.google.cloud.ces.v1beta.IListExamplesRequest, + 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['listExamples']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listExamples stream %j', request); + return this.descriptors.page.listExamples.createStream( + this.innerApiCalls.listExamples as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listExamples`, 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 resource name of the app to list examples from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListExamplesResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListExamples|AgentService.ListExamples} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the examples. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.Example|Example}. 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/agent_service.list_examples.js + * region_tag:ces_v1beta_generated_AgentService_ListExamples_async + */ + listExamplesAsync( + request?: protos.google.cloud.ces.v1beta.IListExamplesRequest, + 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['listExamples']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listExamples iterate %j', request); + return this.descriptors.page.listExamples.asyncIterate( + this.innerApiCalls['listExamples'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists tools in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list tools from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListToolsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListTools|AgentService.ListTools} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the tools. Use + * "include_system_tools=true" to include system tools in the response. See + * https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1beta.Tool|Tool}. + * 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 `listToolsAsync()` + * 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. + */ + listTools( + request?: protos.google.cloud.ces.v1beta.IListToolsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.ITool[], + protos.google.cloud.ces.v1beta.IListToolsRequest|null, + protos.google.cloud.ces.v1beta.IListToolsResponse + ]>; + listTools( + request: protos.google.cloud.ces.v1beta.IListToolsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListToolsRequest, + protos.google.cloud.ces.v1beta.IListToolsResponse|null|undefined, + protos.google.cloud.ces.v1beta.ITool>): void; + listTools( + request: protos.google.cloud.ces.v1beta.IListToolsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListToolsRequest, + protos.google.cloud.ces.v1beta.IListToolsResponse|null|undefined, + protos.google.cloud.ces.v1beta.ITool>): void; + listTools( + request?: protos.google.cloud.ces.v1beta.IListToolsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1beta.IListToolsRequest, + protos.google.cloud.ces.v1beta.IListToolsResponse|null|undefined, + protos.google.cloud.ces.v1beta.ITool>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1beta.IListToolsRequest, + protos.google.cloud.ces.v1beta.IListToolsResponse|null|undefined, + protos.google.cloud.ces.v1beta.ITool>): + Promise<[ + protos.google.cloud.ces.v1beta.ITool[], + protos.google.cloud.ces.v1beta.IListToolsRequest|null, + protos.google.cloud.ces.v1beta.IListToolsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListToolsRequest, + protos.google.cloud.ces.v1beta.IListToolsResponse|null|undefined, + protos.google.cloud.ces.v1beta.ITool>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTools values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTools request %j', request); + return this.innerApiCalls + .listTools(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1beta.ITool[], + protos.google.cloud.ces.v1beta.IListToolsRequest|null, + protos.google.cloud.ces.v1beta.IListToolsResponse + ]) => { + this._log.info('listTools values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listTools`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list tools from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListToolsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListTools|AgentService.ListTools} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the tools. Use + * "include_system_tools=true" to include system tools in the response. See + * https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.Tool|Tool} 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 `listToolsAsync()` + * 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. + */ + listToolsStream( + request?: protos.google.cloud.ces.v1beta.IListToolsRequest, + 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['listTools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listTools stream %j', request); + return this.descriptors.page.listTools.createStream( + this.innerApiCalls.listTools as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTools`, 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 resource name of the app to list tools from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListToolsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListTools|AgentService.ListTools} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the tools. Use + * "include_system_tools=true" to include system tools in the response. See + * https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.Tool|Tool}. 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/agent_service.list_tools.js + * region_tag:ces_v1beta_generated_AgentService_ListTools_async + */ + listToolsAsync( + request?: protos.google.cloud.ces.v1beta.IListToolsRequest, + 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['listTools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listTools iterate %j', request); + return this.descriptors.page.listTools.asyncIterate( + this.innerApiCalls['listTools'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists conversations in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list conversations from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListConversationsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListConversations|AgentService.ListConversations} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the conversations. + * See https://google.aip.dev/160 for more details. + * @param {google.cloud.ces.v1beta.Conversation.Source} [request.source] + * Optional. Indicate the source of the conversation. If not set, Source.Live + * will be applied by default. Will be deprecated in favor of `sources` field. + * @param {number[]} [request.sources] + * Optional. Indicate the sources of the conversations. If not set, all + * available sources will be applied by default. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1beta.Conversation|Conversation}. + * 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 `listConversationsAsync()` + * 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. + */ + listConversations( + request?: protos.google.cloud.ces.v1beta.IListConversationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IConversation[], + protos.google.cloud.ces.v1beta.IListConversationsRequest|null, + protos.google.cloud.ces.v1beta.IListConversationsResponse + ]>; + listConversations( + request: protos.google.cloud.ces.v1beta.IListConversationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListConversationsRequest, + protos.google.cloud.ces.v1beta.IListConversationsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IConversation>): void; + listConversations( + request: protos.google.cloud.ces.v1beta.IListConversationsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListConversationsRequest, + protos.google.cloud.ces.v1beta.IListConversationsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IConversation>): void; + listConversations( + request?: protos.google.cloud.ces.v1beta.IListConversationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1beta.IListConversationsRequest, + protos.google.cloud.ces.v1beta.IListConversationsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IConversation>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1beta.IListConversationsRequest, + protos.google.cloud.ces.v1beta.IListConversationsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IConversation>): + Promise<[ + protos.google.cloud.ces.v1beta.IConversation[], + protos.google.cloud.ces.v1beta.IListConversationsRequest|null, + protos.google.cloud.ces.v1beta.IListConversationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListConversationsRequest, + protos.google.cloud.ces.v1beta.IListConversationsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IConversation>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listConversations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listConversations request %j', request); + return this.innerApiCalls + .listConversations(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1beta.IConversation[], + protos.google.cloud.ces.v1beta.IListConversationsRequest|null, + protos.google.cloud.ces.v1beta.IListConversationsResponse + ]) => { + this._log.info('listConversations values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listConversations`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list conversations from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListConversationsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListConversations|AgentService.ListConversations} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the conversations. + * See https://google.aip.dev/160 for more details. + * @param {google.cloud.ces.v1beta.Conversation.Source} [request.source] + * Optional. Indicate the source of the conversation. If not set, Source.Live + * will be applied by default. Will be deprecated in favor of `sources` field. + * @param {number[]} [request.sources] + * Optional. Indicate the sources of the conversations. If not set, all + * available sources will be applied by default. + * @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.ces.v1beta.Conversation|Conversation} 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 `listConversationsAsync()` + * 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. + */ + listConversationsStream( + request?: protos.google.cloud.ces.v1beta.IListConversationsRequest, + 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['listConversations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listConversations stream %j', request); + return this.descriptors.page.listConversations.createStream( + this.innerApiCalls.listConversations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listConversations`, 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 resource name of the app to list conversations from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListConversationsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListConversations|AgentService.ListConversations} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the conversations. + * See https://google.aip.dev/160 for more details. + * @param {google.cloud.ces.v1beta.Conversation.Source} [request.source] + * Optional. Indicate the source of the conversation. If not set, Source.Live + * will be applied by default. Will be deprecated in favor of `sources` field. + * @param {number[]} [request.sources] + * Optional. Indicate the sources of the conversations. If not set, all + * available sources will be applied by default. + * @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.ces.v1beta.Conversation|Conversation}. 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/agent_service.list_conversations.js + * region_tag:ces_v1beta_generated_AgentService_ListConversations_async + */ + listConversationsAsync( + request?: protos.google.cloud.ces.v1beta.IListConversationsRequest, + 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['listConversations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listConversations iterate %j', request); + return this.descriptors.page.listConversations.asyncIterate( + this.innerApiCalls['listConversations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists guardrails in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list guardrails from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListGuardrailsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListGuardrails|AgentService.ListGuardrails} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the guardrails. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1beta.Guardrail|Guardrail}. + * 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 `listGuardrailsAsync()` + * 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. + */ + listGuardrails( + request?: protos.google.cloud.ces.v1beta.IListGuardrailsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IGuardrail[], + protos.google.cloud.ces.v1beta.IListGuardrailsRequest|null, + protos.google.cloud.ces.v1beta.IListGuardrailsResponse + ]>; + listGuardrails( + request: protos.google.cloud.ces.v1beta.IListGuardrailsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListGuardrailsRequest, + protos.google.cloud.ces.v1beta.IListGuardrailsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IGuardrail>): void; + listGuardrails( + request: protos.google.cloud.ces.v1beta.IListGuardrailsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListGuardrailsRequest, + protos.google.cloud.ces.v1beta.IListGuardrailsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IGuardrail>): void; + listGuardrails( + request?: protos.google.cloud.ces.v1beta.IListGuardrailsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1beta.IListGuardrailsRequest, + protos.google.cloud.ces.v1beta.IListGuardrailsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IGuardrail>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1beta.IListGuardrailsRequest, + protos.google.cloud.ces.v1beta.IListGuardrailsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IGuardrail>): + Promise<[ + protos.google.cloud.ces.v1beta.IGuardrail[], + protos.google.cloud.ces.v1beta.IListGuardrailsRequest|null, + protos.google.cloud.ces.v1beta.IListGuardrailsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListGuardrailsRequest, + protos.google.cloud.ces.v1beta.IListGuardrailsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IGuardrail>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listGuardrails values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listGuardrails request %j', request); + return this.innerApiCalls + .listGuardrails(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1beta.IGuardrail[], + protos.google.cloud.ces.v1beta.IListGuardrailsRequest|null, + protos.google.cloud.ces.v1beta.IListGuardrailsResponse + ]) => { + this._log.info('listGuardrails values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listGuardrails`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list guardrails from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListGuardrailsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListGuardrails|AgentService.ListGuardrails} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the guardrails. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.Guardrail|Guardrail} 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 `listGuardrailsAsync()` + * 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. + */ + listGuardrailsStream( + request?: protos.google.cloud.ces.v1beta.IListGuardrailsRequest, + 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['listGuardrails']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listGuardrails stream %j', request); + return this.descriptors.page.listGuardrails.createStream( + this.innerApiCalls.listGuardrails as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listGuardrails`, 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 resource name of the app to list guardrails from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListGuardrailsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListGuardrails|AgentService.ListGuardrails} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the guardrails. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.Guardrail|Guardrail}. 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/agent_service.list_guardrails.js + * region_tag:ces_v1beta_generated_AgentService_ListGuardrails_async + */ + listGuardrailsAsync( + request?: protos.google.cloud.ces.v1beta.IListGuardrailsRequest, + 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['listGuardrails']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listGuardrails iterate %j', request); + return this.descriptors.page.listGuardrails.asyncIterate( + this.innerApiCalls['listGuardrails'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists deployments in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent app. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + * @param {number} [request.pageSize] + * Optional. The maximum number of deployments to return. The service may + * return fewer than this value. If unspecified, at most 50 deployments will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDeployments` must + * match the call that provided the page token. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1beta.Deployment|Deployment}. + * 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 `listDeploymentsAsync()` + * 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. + */ + listDeployments( + request?: protos.google.cloud.ces.v1beta.IListDeploymentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IDeployment[], + protos.google.cloud.ces.v1beta.IListDeploymentsRequest|null, + protos.google.cloud.ces.v1beta.IListDeploymentsResponse + ]>; + listDeployments( + request: protos.google.cloud.ces.v1beta.IListDeploymentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListDeploymentsRequest, + protos.google.cloud.ces.v1beta.IListDeploymentsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IDeployment>): void; + listDeployments( + request: protos.google.cloud.ces.v1beta.IListDeploymentsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListDeploymentsRequest, + protos.google.cloud.ces.v1beta.IListDeploymentsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IDeployment>): void; + listDeployments( + request?: protos.google.cloud.ces.v1beta.IListDeploymentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1beta.IListDeploymentsRequest, + protos.google.cloud.ces.v1beta.IListDeploymentsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IDeployment>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1beta.IListDeploymentsRequest, + protos.google.cloud.ces.v1beta.IListDeploymentsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IDeployment>): + Promise<[ + protos.google.cloud.ces.v1beta.IDeployment[], + protos.google.cloud.ces.v1beta.IListDeploymentsRequest|null, + protos.google.cloud.ces.v1beta.IListDeploymentsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListDeploymentsRequest, + protos.google.cloud.ces.v1beta.IListDeploymentsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IDeployment>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDeployments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDeployments request %j', request); + return this.innerApiCalls + .listDeployments(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1beta.IDeployment[], + protos.google.cloud.ces.v1beta.IListDeploymentsRequest|null, + protos.google.cloud.ces.v1beta.IListDeploymentsResponse + ]) => { + this._log.info('listDeployments values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listDeployments`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent app. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + * @param {number} [request.pageSize] + * Optional. The maximum number of deployments to return. The service may + * return fewer than this value. If unspecified, at most 50 deployments will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDeployments` must + * match the call that provided the page token. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.Deployment|Deployment} 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 `listDeploymentsAsync()` + * 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. + */ + listDeploymentsStream( + request?: protos.google.cloud.ces.v1beta.IListDeploymentsRequest, + 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['listDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDeployments stream %j', request); + return this.descriptors.page.listDeployments.createStream( + this.innerApiCalls.listDeployments as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDeployments`, 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 parent app. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + * @param {number} [request.pageSize] + * Optional. The maximum number of deployments to return. The service may + * return fewer than this value. If unspecified, at most 50 deployments will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDeployments` must + * match the call that provided the page token. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.Deployment|Deployment}. 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/agent_service.list_deployments.js + * region_tag:ces_v1beta_generated_AgentService_ListDeployments_async + */ + listDeploymentsAsync( + request?: protos.google.cloud.ces.v1beta.IListDeploymentsRequest, + 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['listDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDeployments iterate %j', request); + return this.descriptors.page.listDeployments.asyncIterate( + this.innerApiCalls['listDeployments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists toolsets in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list toolsets from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListToolsetsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListToolsets|AgentService.ListToolsets} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the toolsets. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1beta.Toolset|Toolset}. + * 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 `listToolsetsAsync()` + * 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. + */ + listToolsets( + request?: protos.google.cloud.ces.v1beta.IListToolsetsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IToolset[], + protos.google.cloud.ces.v1beta.IListToolsetsRequest|null, + protos.google.cloud.ces.v1beta.IListToolsetsResponse + ]>; + listToolsets( + request: protos.google.cloud.ces.v1beta.IListToolsetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListToolsetsRequest, + protos.google.cloud.ces.v1beta.IListToolsetsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IToolset>): void; + listToolsets( + request: protos.google.cloud.ces.v1beta.IListToolsetsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListToolsetsRequest, + protos.google.cloud.ces.v1beta.IListToolsetsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IToolset>): void; + listToolsets( + request?: protos.google.cloud.ces.v1beta.IListToolsetsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1beta.IListToolsetsRequest, + protos.google.cloud.ces.v1beta.IListToolsetsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IToolset>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1beta.IListToolsetsRequest, + protos.google.cloud.ces.v1beta.IListToolsetsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IToolset>): + Promise<[ + protos.google.cloud.ces.v1beta.IToolset[], + protos.google.cloud.ces.v1beta.IListToolsetsRequest|null, + protos.google.cloud.ces.v1beta.IListToolsetsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListToolsetsRequest, + protos.google.cloud.ces.v1beta.IListToolsetsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IToolset>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listToolsets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listToolsets request %j', request); + return this.innerApiCalls + .listToolsets(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1beta.IToolset[], + protos.google.cloud.ces.v1beta.IListToolsetsRequest|null, + protos.google.cloud.ces.v1beta.IListToolsetsResponse + ]) => { + this._log.info('listToolsets values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listToolsets`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list toolsets from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListToolsetsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListToolsets|AgentService.ListToolsets} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the toolsets. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.Toolset|Toolset} 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 `listToolsetsAsync()` + * 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. + */ + listToolsetsStream( + request?: protos.google.cloud.ces.v1beta.IListToolsetsRequest, + 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['listToolsets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listToolsets stream %j', request); + return this.descriptors.page.listToolsets.createStream( + this.innerApiCalls.listToolsets as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listToolsets`, 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 resource name of the app to list toolsets from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListToolsetsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListToolsets|AgentService.ListToolsets} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the toolsets. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.Toolset|Toolset}. 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/agent_service.list_toolsets.js + * region_tag:ces_v1beta_generated_AgentService_ListToolsets_async + */ + listToolsetsAsync( + request?: protos.google.cloud.ces.v1beta.IListToolsetsRequest, + 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['listToolsets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listToolsets iterate %j', request); + return this.descriptors.page.listToolsets.asyncIterate( + this.innerApiCalls['listToolsets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all app versions in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list app versions from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListAppVersionsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListAppVersions|AgentService.ListAppVersions} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the app versions. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1beta.AppVersion|AppVersion}. + * 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 `listAppVersionsAsync()` + * 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. + */ + listAppVersions( + request?: protos.google.cloud.ces.v1beta.IListAppVersionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IAppVersion[], + protos.google.cloud.ces.v1beta.IListAppVersionsRequest|null, + protos.google.cloud.ces.v1beta.IListAppVersionsResponse + ]>; + listAppVersions( + request: protos.google.cloud.ces.v1beta.IListAppVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListAppVersionsRequest, + protos.google.cloud.ces.v1beta.IListAppVersionsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IAppVersion>): void; + listAppVersions( + request: protos.google.cloud.ces.v1beta.IListAppVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListAppVersionsRequest, + protos.google.cloud.ces.v1beta.IListAppVersionsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IAppVersion>): void; + listAppVersions( + request?: protos.google.cloud.ces.v1beta.IListAppVersionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1beta.IListAppVersionsRequest, + protos.google.cloud.ces.v1beta.IListAppVersionsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IAppVersion>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1beta.IListAppVersionsRequest, + protos.google.cloud.ces.v1beta.IListAppVersionsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IAppVersion>): + Promise<[ + protos.google.cloud.ces.v1beta.IAppVersion[], + protos.google.cloud.ces.v1beta.IListAppVersionsRequest|null, + protos.google.cloud.ces.v1beta.IListAppVersionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListAppVersionsRequest, + protos.google.cloud.ces.v1beta.IListAppVersionsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IAppVersion>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAppVersions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAppVersions request %j', request); + return this.innerApiCalls + .listAppVersions(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1beta.IAppVersion[], + protos.google.cloud.ces.v1beta.IListAppVersionsRequest|null, + protos.google.cloud.ces.v1beta.IListAppVersionsResponse + ]) => { + this._log.info('listAppVersions values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listAppVersions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list app versions from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListAppVersionsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListAppVersions|AgentService.ListAppVersions} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the app versions. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.AppVersion|AppVersion} 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 `listAppVersionsAsync()` + * 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. + */ + listAppVersionsStream( + request?: protos.google.cloud.ces.v1beta.IListAppVersionsRequest, + 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['listAppVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAppVersions stream %j', request); + return this.descriptors.page.listAppVersions.createStream( + this.innerApiCalls.listAppVersions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAppVersions`, 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 resource name of the app to list app versions from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListAppVersionsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListAppVersions|AgentService.ListAppVersions} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the app versions. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.AppVersion|AppVersion}. 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/agent_service.list_app_versions.js + * region_tag:ces_v1beta_generated_AgentService_ListAppVersions_async + */ + listAppVersionsAsync( + request?: protos.google.cloud.ces.v1beta.IListAppVersionsRequest, + 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['listAppVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAppVersions iterate %j', request); + return this.descriptors.page.listAppVersions.asyncIterate( + this.innerApiCalls['listAppVersions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the changelogs of the specified app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list changelogs from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListChangelogsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListChangelogs|AgentService.ListChangelogs} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the changelogs. + * See https://google.aip.dev/160 for more details. + * + * The filter string can be used to filter by `action`, `resource_type`, + * `resource_name`, `author`, and `create_time`. + * The `:` comparator can be used for case-insensitive partial matching on + * string fields, while `=` performs an exact case-sensitive match. + * + * Examples: + * * `action:update` (case-insensitive partial match) + * * `action="Create"` (case-sensitive exact match) + * * `resource_type:agent` + * * `resource_name:my-agent` + * * `author:me@example.com` + * * `create_time > "2025-01-01T00:00:00Z"` + * * `create_time <= "2025-01-01T00:00:00Z" AND resource_type:tool` + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1beta.Changelog|Changelog}. + * 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 `listChangelogsAsync()` + * 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. + */ + listChangelogs( + request?: protos.google.cloud.ces.v1beta.IListChangelogsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IChangelog[], + protos.google.cloud.ces.v1beta.IListChangelogsRequest|null, + protos.google.cloud.ces.v1beta.IListChangelogsResponse + ]>; + listChangelogs( + request: protos.google.cloud.ces.v1beta.IListChangelogsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListChangelogsRequest, + protos.google.cloud.ces.v1beta.IListChangelogsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IChangelog>): void; + listChangelogs( + request: protos.google.cloud.ces.v1beta.IListChangelogsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListChangelogsRequest, + protos.google.cloud.ces.v1beta.IListChangelogsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IChangelog>): void; + listChangelogs( + request?: protos.google.cloud.ces.v1beta.IListChangelogsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1beta.IListChangelogsRequest, + protos.google.cloud.ces.v1beta.IListChangelogsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IChangelog>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1beta.IListChangelogsRequest, + protos.google.cloud.ces.v1beta.IListChangelogsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IChangelog>): + Promise<[ + protos.google.cloud.ces.v1beta.IChangelog[], + protos.google.cloud.ces.v1beta.IListChangelogsRequest|null, + protos.google.cloud.ces.v1beta.IListChangelogsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListChangelogsRequest, + protos.google.cloud.ces.v1beta.IListChangelogsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IChangelog>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listChangelogs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listChangelogs request %j', request); + return this.innerApiCalls + .listChangelogs(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1beta.IChangelog[], + protos.google.cloud.ces.v1beta.IListChangelogsRequest|null, + protos.google.cloud.ces.v1beta.IListChangelogsResponse + ]) => { + this._log.info('listChangelogs values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listChangelogs`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list changelogs from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListChangelogsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListChangelogs|AgentService.ListChangelogs} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the changelogs. + * See https://google.aip.dev/160 for more details. + * + * The filter string can be used to filter by `action`, `resource_type`, + * `resource_name`, `author`, and `create_time`. + * The `:` comparator can be used for case-insensitive partial matching on + * string fields, while `=` performs an exact case-sensitive match. + * + * Examples: + * * `action:update` (case-insensitive partial match) + * * `action="Create"` (case-sensitive exact match) + * * `resource_type:agent` + * * `resource_name:my-agent` + * * `author:me@example.com` + * * `create_time > "2025-01-01T00:00:00Z"` + * * `create_time <= "2025-01-01T00:00:00Z" AND resource_type:tool` + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.Changelog|Changelog} 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 `listChangelogsAsync()` + * 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. + */ + listChangelogsStream( + request?: protos.google.cloud.ces.v1beta.IListChangelogsRequest, + 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['listChangelogs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listChangelogs stream %j', request); + return this.descriptors.page.listChangelogs.createStream( + this.innerApiCalls.listChangelogs as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listChangelogs`, 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 resource name of the app to list changelogs from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListChangelogsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.AgentService.ListChangelogs|AgentService.ListChangelogs} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the changelogs. + * See https://google.aip.dev/160 for more details. + * + * The filter string can be used to filter by `action`, `resource_type`, + * `resource_name`, `author`, and `create_time`. + * The `:` comparator can be used for case-insensitive partial matching on + * string fields, while `=` performs an exact case-sensitive match. + * + * Examples: + * * `action:update` (case-insensitive partial match) + * * `action="Create"` (case-sensitive exact match) + * * `resource_type:agent` + * * `resource_name:my-agent` + * * `author:me@example.com` + * * `create_time > "2025-01-01T00:00:00Z"` + * * `create_time <= "2025-01-01T00:00:00Z" AND resource_type:tool` + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time" is supported. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.Changelog|Changelog}. 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/agent_service.list_changelogs.js + * region_tag:ces_v1beta_generated_AgentService_ListChangelogs_async + */ + listChangelogsAsync( + request?: protos.google.cloud.ces.v1beta.IListChangelogsRequest, + 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['listChangelogs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listChangelogs iterate %j', request); + return this.descriptors.page.listChangelogs.asyncIterate( + this.innerApiCalls['listChangelogs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project:string,location:string,app:string,agent:string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + app: app, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the app from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the app. + */ + matchAppFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).app; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified app resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @returns {string} Resource name string. + */ + appPath(project:string,location:string,app:string) { + return this.pathTemplates.appPathTemplate.render({ + project: project, + location: location, + app: app, + }); + } + + /** + * Parse the project from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).project; + } + + /** + * Parse the location from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).location; + } + + /** + * Parse the app from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the app. + */ + matchAppFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).app; + } + + /** + * Return a fully-qualified appVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} version + * @returns {string} Resource name string. + */ + appVersionPath(project:string,location:string,app:string,version:string) { + return this.pathTemplates.appVersionPathTemplate.render({ + project: project, + location: location, + app: app, + version: version, + }); + } + + /** + * Parse the project from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).project; + } + + /** + * Parse the location from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).location; + } + + /** + * Parse the app from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the app. + */ + matchAppFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).app; + } + + /** + * Parse the version from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).version; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath(project:string,location:string,app:string,changelog:string) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + app: app, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).location; + } + + /** + * Parse the app from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the app. + */ + matchAppFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).app; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).changelog; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath(project:string,location:string,app:string,conversation:string) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + app: app, + conversation: conversation, + }); + } + + /** + * Parse the project from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).project; + } + + /** + * Parse the location from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).location; + } + + /** + * Parse the app from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the app. + */ + matchAppFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).app; + } + + /** + * Parse the conversation from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).conversation; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,app:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + app: app, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the app from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the app. + */ + matchAppFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).app; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified evaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation + * @returns {string} Resource name string. + */ + evaluationPath(project:string,location:string,app:string,evaluation:string) { + return this.pathTemplates.evaluationPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation: evaluation, + }); + } + + /** + * Parse the project from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project; + } + + /** + * Parse the location from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location; + } + + /** + * Parse the app from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).app; + } + + /** + * Parse the evaluation from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation; + } + + /** + * Return a fully-qualified evaluationDataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation_dataset + * @returns {string} Resource name string. + */ + evaluationDatasetPath(project:string,location:string,app:string,evaluationDataset:string) { + return this.pathTemplates.evaluationDatasetPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation_dataset: evaluationDataset, + }); + } + + /** + * Parse the project from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).project; + } + + /** + * Parse the location from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).location; + } + + /** + * Parse the app from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).app; + } + + /** + * Parse the evaluation_dataset from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the evaluation_dataset. + */ + matchEvaluationDatasetFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).evaluation_dataset; + } + + /** + * Return a fully-qualified evaluationExpectation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation_expectation + * @returns {string} Resource name string. + */ + evaluationExpectationPath(project:string,location:string,app:string,evaluationExpectation:string) { + return this.pathTemplates.evaluationExpectationPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation_expectation: evaluationExpectation, + }); + } + + /** + * Parse the project from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).project; + } + + /** + * Parse the location from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).location; + } + + /** + * Parse the app from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).app; + } + + /** + * Parse the evaluation_expectation from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the evaluation_expectation. + */ + matchEvaluationExpectationFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).evaluation_expectation; + } + + /** + * Return a fully-qualified evaluationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation + * @param {string} evaluation_result + * @returns {string} Resource name string. + */ + evaluationResultPath(project:string,location:string,app:string,evaluation:string,evaluationResult:string) { + return this.pathTemplates.evaluationResultPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation: evaluation, + evaluation_result: evaluationResult, + }); + } + + /** + * Parse the project from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).project; + } + + /** + * Parse the location from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).location; + } + + /** + * Parse the app from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).app; + } + + /** + * Parse the evaluation from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).evaluation; + } + + /** + * Parse the evaluation_result from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the evaluation_result. + */ + matchEvaluationResultFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).evaluation_result; + } + + /** + * Return a fully-qualified evaluationRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation_run + * @returns {string} Resource name string. + */ + evaluationRunPath(project:string,location:string,app:string,evaluationRun:string) { + return this.pathTemplates.evaluationRunPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation_run: evaluationRun, + }); + } + + /** + * Parse the project from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).project; + } + + /** + * Parse the location from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).location; + } + + /** + * Parse the app from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).app; + } + + /** + * Parse the evaluation_run from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the evaluation_run. + */ + matchEvaluationRunFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).evaluation_run; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath(project:string,location:string,app:string,example:string) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + app: app, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the app from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the app. + */ + matchAppFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).app; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified guardrail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} guardrail + * @returns {string} Resource name string. + */ + guardrailPath(project:string,location:string,app:string,guardrail:string) { + return this.pathTemplates.guardrailPathTemplate.render({ + project: project, + location: location, + app: app, + guardrail: guardrail, + }); + } + + /** + * Parse the project from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).project; + } + + /** + * Parse the location from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).location; + } + + /** + * Parse the app from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the app. + */ + matchAppFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).app; + } + + /** + * Parse the guardrail from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the guardrail. + */ + matchGuardrailFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).guardrail; + } + + /** + * 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 omnichannel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} omnichannel + * @returns {string} Resource name string. + */ + omnichannelPath(project:string,location:string,omnichannel:string) { + return this.pathTemplates.omnichannelPathTemplate.render({ + project: project, + location: location, + omnichannel: omnichannel, + }); + } + + /** + * Parse the project from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).project; + } + + /** + * Parse the location from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).location; + } + + /** + * Parse the omnichannel from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the omnichannel. + */ + matchOmnichannelFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).omnichannel; + } + + /** + * 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 scheduledEvaluationRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} scheduled_evaluation_run + * @returns {string} Resource name string. + */ + scheduledEvaluationRunPath(project:string,location:string,app:string,scheduledEvaluationRun:string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.render({ + project: project, + location: location, + app: app, + scheduled_evaluation_run: scheduledEvaluationRun, + }); + } + + /** + * Parse the project from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).project; + } + + /** + * Parse the location from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).location; + } + + /** + * Parse the app from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the app. + */ + matchAppFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).app; + } + + /** + * Parse the scheduled_evaluation_run from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the scheduled_evaluation_run. + */ + matchScheduledEvaluationRunFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).scheduled_evaluation_run; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project:string,location:string,app:string,tool:string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + app: app, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the app from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the app. + */ + matchAppFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).app; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} toolset + * @returns {string} Resource name string. + */ + toolsetPath(project:string,location:string,app:string,toolset:string) { + return this.pathTemplates.toolsetPathTemplate.render({ + project: project, + location: location, + app: app, + toolset: toolset, + }); + } + + /** + * Parse the project from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).project; + } + + /** + * Parse the location from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).location; + } + + /** + * Parse the app from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the app. + */ + matchAppFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).app; + } + + /** + * Parse the toolset from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the toolset. + */ + matchToolsetFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).toolset; + } + + /** + * 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.agentServiceStub && !this._terminated) { + return this.agentServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/agent_service_client_config.json b/owl-bot-staging/google-cloud-ces/src/v1beta/agent_service_client_config.json new file mode 100644 index 00000000000..f57deec54df --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1beta/agent_service_client_config.json @@ -0,0 +1,266 @@ +{ + "interfaces": { + "google.cloud.ces.v1beta.AgentService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListApps": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetApp": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateApp": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateApp": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteApp": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ExportApp": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ImportApp": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListAgents": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetAgent": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateAgent": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateAgent": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteAgent": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListExamples": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetExample": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateExample": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateExample": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteExample": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListTools": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetTool": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListConversations": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetConversation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteConversation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "BatchDeleteConversations": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateTool": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateTool": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteTool": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListGuardrails": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetGuardrail": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateGuardrail": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateGuardrail": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteGuardrail": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListDeployments": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListToolsets": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetToolset": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateToolset": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateToolset": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteToolset": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListAppVersions": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetAppVersion": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateAppVersion": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteAppVersion": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "RestoreAppVersion": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListChangelogs": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetChangelog": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/agent_service_proto_list.json b/owl-bot-staging/google-cloud-ces/src/v1beta/agent_service_proto_list.json new file mode 100644 index 00000000000..19d10d699ff --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1beta/agent_service_proto_list.json @@ -0,0 +1,43 @@ +[ + "../../protos/google/cloud/ces/v1beta/agent.proto", + "../../protos/google/cloud/ces/v1beta/agent_service.proto", + "../../protos/google/cloud/ces/v1beta/agent_transfers.proto", + "../../protos/google/cloud/ces/v1beta/app.proto", + "../../protos/google/cloud/ces/v1beta/app_version.proto", + "../../protos/google/cloud/ces/v1beta/auth.proto", + "../../protos/google/cloud/ces/v1beta/bigquery_export.proto", + "../../protos/google/cloud/ces/v1beta/changelog.proto", + "../../protos/google/cloud/ces/v1beta/client_function.proto", + "../../protos/google/cloud/ces/v1beta/common.proto", + "../../protos/google/cloud/ces/v1beta/connector_tool.proto", + "../../protos/google/cloud/ces/v1beta/connector_toolset.proto", + "../../protos/google/cloud/ces/v1beta/conversation.proto", + "../../protos/google/cloud/ces/v1beta/data_store.proto", + "../../protos/google/cloud/ces/v1beta/data_store_tool.proto", + "../../protos/google/cloud/ces/v1beta/deployment.proto", + "../../protos/google/cloud/ces/v1beta/evaluation.proto", + "../../protos/google/cloud/ces/v1beta/evaluation_service.proto", + "../../protos/google/cloud/ces/v1beta/example.proto", + "../../protos/google/cloud/ces/v1beta/fakes.proto", + "../../protos/google/cloud/ces/v1beta/file_search_tool.proto", + "../../protos/google/cloud/ces/v1beta/golden_run.proto", + "../../protos/google/cloud/ces/v1beta/google_search_tool.proto", + "../../protos/google/cloud/ces/v1beta/guardrail.proto", + "../../protos/google/cloud/ces/v1beta/mcp_tool.proto", + "../../protos/google/cloud/ces/v1beta/mcp_toolset.proto", + "../../protos/google/cloud/ces/v1beta/omnichannel.proto", + "../../protos/google/cloud/ces/v1beta/omnichannel_service.proto", + "../../protos/google/cloud/ces/v1beta/open_api_tool.proto", + "../../protos/google/cloud/ces/v1beta/open_api_toolset.proto", + "../../protos/google/cloud/ces/v1beta/python_function.proto", + "../../protos/google/cloud/ces/v1beta/schema.proto", + "../../protos/google/cloud/ces/v1beta/search_suggestions.proto", + "../../protos/google/cloud/ces/v1beta/session_service.proto", + "../../protos/google/cloud/ces/v1beta/system_tool.proto", + "../../protos/google/cloud/ces/v1beta/tool.proto", + "../../protos/google/cloud/ces/v1beta/tool_service.proto", + "../../protos/google/cloud/ces/v1beta/toolset.proto", + "../../protos/google/cloud/ces/v1beta/toolset_tool.proto", + "../../protos/google/cloud/ces/v1beta/widget_service.proto", + "../../protos/google/cloud/ces/v1beta/widget_tool.proto" +] diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/evaluation_service_client.ts b/owl-bot-staging/google-cloud-ces/src/v1beta/evaluation_service_client.ts new file mode 100644 index 00000000000..ec03c207868 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1beta/evaluation_service_client.ts @@ -0,0 +1,5887 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1beta/evaluation_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './evaluation_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * EvaluationService exposes methods to perform evaluation for the CES app. + * @class + * @memberof v1beta + */ +export class EvaluationServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('ces'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + evaluationServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of EvaluationServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new EvaluationServiceClient({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 EvaluationServiceClient; + 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 = 'ces.' + 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.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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/agents/{agent}' + ), + appPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}' + ), + appVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/versions/{version}' + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}' + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}' + ), + evaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}' + ), + evaluationDatasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluationDatasets/{evaluation_dataset}' + ), + evaluationExpectationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluationExpectations/{evaluation_expectation}' + ), + evaluationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}/results/{evaluation_result}' + ), + evaluationRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluationRuns/{evaluation_run}' + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/examples/{example}' + ), + guardrailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + omnichannelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/omnichannels/{omnichannel}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + scheduledEvaluationRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/scheduledEvaluationRuns/{scheduled_evaluation_run}' + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/tools/{tool}' + ), + toolsetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}' + ), + }; + + // 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 = { + listEvaluations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'evaluations'), + listEvaluationResults: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'evaluationResults'), + listEvaluationDatasets: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'evaluationDatasets'), + listEvaluationRuns: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'evaluationRuns'), + listEvaluationExpectations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'evaluationExpectations'), + listScheduledEvaluationRuns: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'scheduledEvaluationRuns') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1beta/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1beta/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1beta/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{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 runEvaluationResponse = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.RunEvaluationResponse') as gax.protobuf.Type; + const runEvaluationMetadata = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.RunEvaluationOperationMetadata') as gax.protobuf.Type; + const generateEvaluationResponse = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.Evaluation') as gax.protobuf.Type; + const generateEvaluationMetadata = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata') as gax.protobuf.Type; + const importEvaluationsResponse = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.ImportEvaluationsResponse') as gax.protobuf.Type; + const importEvaluationsMetadata = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata') as gax.protobuf.Type; + const deleteEvaluationRunResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteEvaluationRunMetadata = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + runEvaluation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + runEvaluationResponse.decode.bind(runEvaluationResponse), + runEvaluationMetadata.decode.bind(runEvaluationMetadata)), + generateEvaluation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + generateEvaluationResponse.decode.bind(generateEvaluationResponse), + generateEvaluationMetadata.decode.bind(generateEvaluationMetadata)), + importEvaluations: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importEvaluationsResponse.decode.bind(importEvaluationsResponse), + importEvaluationsMetadata.decode.bind(importEvaluationsMetadata)), + deleteEvaluationRun: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteEvaluationRunResponse.decode.bind(deleteEvaluationRunResponse), + deleteEvaluationRunMetadata.decode.bind(deleteEvaluationRunMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.ces.v1beta.EvaluationService', 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.evaluationServiceStub) { + return this.evaluationServiceStub; + } + + // Put together the "service stub" for + // google.cloud.ces.v1beta.EvaluationService. + this.evaluationServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.ces.v1beta.EvaluationService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.ces.v1beta.EvaluationService, + 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 evaluationServiceStubMethods = + ['runEvaluation', 'uploadEvaluationAudio', 'createEvaluation', 'generateEvaluation', 'importEvaluations', 'createEvaluationDataset', 'updateEvaluation', 'updateEvaluationDataset', 'deleteEvaluation', 'deleteEvaluationResult', 'deleteEvaluationDataset', 'deleteEvaluationRun', 'getEvaluation', 'getEvaluationResult', 'getEvaluationDataset', 'getEvaluationRun', 'listEvaluations', 'listEvaluationResults', 'listEvaluationDatasets', 'listEvaluationRuns', 'listEvaluationExpectations', 'getEvaluationExpectation', 'createEvaluationExpectation', 'updateEvaluationExpectation', 'deleteEvaluationExpectation', 'createScheduledEvaluationRun', 'getScheduledEvaluationRun', 'listScheduledEvaluationRuns', 'updateScheduledEvaluationRun', 'deleteScheduledEvaluationRun', 'testPersonaVoice']; + for (const methodName of evaluationServiceStubMethods) { + const callPromise = this.evaluationServiceStub.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.evaluationServiceStub; + } + + /** + * 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 'ces.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 'ces.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/ces', + '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 -- + // ------------------- +/** + * Uploads audio for use in Golden Evaluations. Stores the audio in the Cloud + * Storage bucket defined in + * 'App.logging_settings.evaluation_audio_recording_config.gcs_bucket' and + * returns a transcript. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.app + * Required. The resource name of the App for which to upload the evaluation + * audio. Format: `projects/{project}/locations/{location}/apps/{app}` + * @param {Buffer} request.audioContent + * Required. The raw audio bytes. + * The format of the audio must be single-channel LINEAR16 with a sample + * rate of 16kHz (default InputAudioConfig). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.UploadEvaluationAudioResponse|UploadEvaluationAudioResponse}. + * 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/evaluation_service.upload_evaluation_audio.js + * region_tag:ces_v1beta_generated_EvaluationService_UploadEvaluationAudio_async + */ + uploadEvaluationAudio( + request?: protos.google.cloud.ces.v1beta.IUploadEvaluationAudioRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IUploadEvaluationAudioResponse, + protos.google.cloud.ces.v1beta.IUploadEvaluationAudioRequest|undefined, {}|undefined + ]>; + uploadEvaluationAudio( + request: protos.google.cloud.ces.v1beta.IUploadEvaluationAudioRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IUploadEvaluationAudioResponse, + protos.google.cloud.ces.v1beta.IUploadEvaluationAudioRequest|null|undefined, + {}|null|undefined>): void; + uploadEvaluationAudio( + request: protos.google.cloud.ces.v1beta.IUploadEvaluationAudioRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IUploadEvaluationAudioResponse, + protos.google.cloud.ces.v1beta.IUploadEvaluationAudioRequest|null|undefined, + {}|null|undefined>): void; + uploadEvaluationAudio( + request?: protos.google.cloud.ces.v1beta.IUploadEvaluationAudioRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IUploadEvaluationAudioResponse, + protos.google.cloud.ces.v1beta.IUploadEvaluationAudioRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IUploadEvaluationAudioResponse, + protos.google.cloud.ces.v1beta.IUploadEvaluationAudioRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IUploadEvaluationAudioResponse, + protos.google.cloud.ces.v1beta.IUploadEvaluationAudioRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'app': request.app ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('uploadEvaluationAudio request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IUploadEvaluationAudioResponse, + protos.google.cloud.ces.v1beta.IUploadEvaluationAudioRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('uploadEvaluationAudio response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.uploadEvaluationAudio(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IUploadEvaluationAudioResponse, + protos.google.cloud.ces.v1beta.IUploadEvaluationAudioRequest|undefined, + {}|undefined + ]) => { + this._log.info('uploadEvaluationAudio response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates an evaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The app to create the evaluation for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + * @param {string} [request.evaluationId] + * Optional. The ID to use for the evaluation, which will become the final + * component of the evaluation's resource name. If not provided, a unique ID + * will be automatically assigned for the evaluation. + * @param {google.cloud.ces.v1beta.Evaluation} request.evaluation + * Required. The evaluation to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Evaluation|Evaluation}. + * 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/evaluation_service.create_evaluation.js + * region_tag:ces_v1beta_generated_EvaluationService_CreateEvaluation_async + */ + createEvaluation( + request?: protos.google.cloud.ces.v1beta.ICreateEvaluationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.ICreateEvaluationRequest|undefined, {}|undefined + ]>; + createEvaluation( + request: protos.google.cloud.ces.v1beta.ICreateEvaluationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.ICreateEvaluationRequest|null|undefined, + {}|null|undefined>): void; + createEvaluation( + request: protos.google.cloud.ces.v1beta.ICreateEvaluationRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.ICreateEvaluationRequest|null|undefined, + {}|null|undefined>): void; + createEvaluation( + request?: protos.google.cloud.ces.v1beta.ICreateEvaluationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.ICreateEvaluationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.ICreateEvaluationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.ICreateEvaluationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createEvaluation request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.ICreateEvaluationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createEvaluation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createEvaluation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.ICreateEvaluationRequest|undefined, + {}|undefined + ]) => { + this._log.info('createEvaluation response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates an evaluation dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The app to create the evaluation for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + * @param {string} [request.evaluationDatasetId] + * Optional. The ID to use for the evaluation dataset, which will become the + * final component of the evaluation dataset's resource name. If not provided, + * a unique ID will be automatically assigned for the evaluation. + * @param {google.cloud.ces.v1beta.EvaluationDataset} request.evaluationDataset + * Required. The evaluation dataset to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.EvaluationDataset|EvaluationDataset}. + * 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/evaluation_service.create_evaluation_dataset.js + * region_tag:ces_v1beta_generated_EvaluationService_CreateEvaluationDataset_async + */ + createEvaluationDataset( + request?: protos.google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest|undefined, {}|undefined + ]>; + createEvaluationDataset( + request: protos.google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest|null|undefined, + {}|null|undefined>): void; + createEvaluationDataset( + request: protos.google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest|null|undefined, + {}|null|undefined>): void; + createEvaluationDataset( + request?: protos.google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createEvaluationDataset request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createEvaluationDataset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createEvaluationDataset(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest|undefined, + {}|undefined + ]) => { + this._log.info('createEvaluationDataset response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates an evaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1beta.Evaluation} request.evaluation + * Required. The evaluation to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Evaluation|Evaluation}. + * 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/evaluation_service.update_evaluation.js + * region_tag:ces_v1beta_generated_EvaluationService_UpdateEvaluation_async + */ + updateEvaluation( + request?: protos.google.cloud.ces.v1beta.IUpdateEvaluationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.IUpdateEvaluationRequest|undefined, {}|undefined + ]>; + updateEvaluation( + request: protos.google.cloud.ces.v1beta.IUpdateEvaluationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.IUpdateEvaluationRequest|null|undefined, + {}|null|undefined>): void; + updateEvaluation( + request: protos.google.cloud.ces.v1beta.IUpdateEvaluationRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.IUpdateEvaluationRequest|null|undefined, + {}|null|undefined>): void; + updateEvaluation( + request?: protos.google.cloud.ces.v1beta.IUpdateEvaluationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.IUpdateEvaluationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.IUpdateEvaluationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.IUpdateEvaluationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'evaluation.name': request.evaluation!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateEvaluation request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.IUpdateEvaluationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateEvaluation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateEvaluation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.IUpdateEvaluationRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateEvaluation response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates an evaluation dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1beta.EvaluationDataset} request.evaluationDataset + * Required. The evaluation dataset to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.EvaluationDataset|EvaluationDataset}. + * 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/evaluation_service.update_evaluation_dataset.js + * region_tag:ces_v1beta_generated_EvaluationService_UpdateEvaluationDataset_async + */ + updateEvaluationDataset( + request?: protos.google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest|undefined, {}|undefined + ]>; + updateEvaluationDataset( + request: protos.google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest|null|undefined, + {}|null|undefined>): void; + updateEvaluationDataset( + request: protos.google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest|null|undefined, + {}|null|undefined>): void; + updateEvaluationDataset( + request?: protos.google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'evaluation_dataset.name': request.evaluationDataset!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateEvaluationDataset request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateEvaluationDataset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateEvaluationDataset(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateEvaluationDataset response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes an evaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the evaluation to delete. + * @param {boolean} [request.force] + * Optional. Indicates whether to forcefully delete the evaluation, even if it + * is still referenced by evaluation datasets. + * + * * If `force = false`, the deletion will fail if any datasets still + * reference the evaluation. + * * If `force = true`, all existing references from datasets will be removed + * and the evaluation will be deleted. + * @param {string} [request.etag] + * Optional. The current etag of the evaluation. If an etag is not provided, + * the deletion will overwrite any concurrent changes. If an etag is provided + * and does not match the current etag of the evaluation, 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 {@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/evaluation_service.delete_evaluation.js + * region_tag:ces_v1beta_generated_EvaluationService_DeleteEvaluation_async + */ + deleteEvaluation( + request?: protos.google.cloud.ces.v1beta.IDeleteEvaluationRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationRequest|undefined, {}|undefined + ]>; + deleteEvaluation( + request: protos.google.cloud.ces.v1beta.IDeleteEvaluationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationRequest|null|undefined, + {}|null|undefined>): void; + deleteEvaluation( + request: protos.google.cloud.ces.v1beta.IDeleteEvaluationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationRequest|null|undefined, + {}|null|undefined>): void; + deleteEvaluation( + request?: protos.google.cloud.ces.v1beta.IDeleteEvaluationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteEvaluation request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteEvaluation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteEvaluation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteEvaluation response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes an evaluation result. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the evaluation result to 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 {@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/evaluation_service.delete_evaluation_result.js + * region_tag:ces_v1beta_generated_EvaluationService_DeleteEvaluationResult_async + */ + deleteEvaluationResult( + request?: protos.google.cloud.ces.v1beta.IDeleteEvaluationResultRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationResultRequest|undefined, {}|undefined + ]>; + deleteEvaluationResult( + request: protos.google.cloud.ces.v1beta.IDeleteEvaluationResultRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationResultRequest|null|undefined, + {}|null|undefined>): void; + deleteEvaluationResult( + request: protos.google.cloud.ces.v1beta.IDeleteEvaluationResultRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationResultRequest|null|undefined, + {}|null|undefined>): void; + deleteEvaluationResult( + request?: protos.google.cloud.ces.v1beta.IDeleteEvaluationResultRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationResultRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationResultRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationResultRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteEvaluationResult request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationResultRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteEvaluationResult response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteEvaluationResult(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationResultRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteEvaluationResult response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes an evaluation dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the evaluation dataset to delete. + * @param {string} [request.etag] + * Optional. The current etag of the evaluation dataset. If an etag is not + * provided, the deletion will overwrite any concurrent changes. If an etag is + * provided and does not match the current etag of the evaluation dataset, + * 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 {@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/evaluation_service.delete_evaluation_dataset.js + * region_tag:ces_v1beta_generated_EvaluationService_DeleteEvaluationDataset_async + */ + deleteEvaluationDataset( + request?: protos.google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest|undefined, {}|undefined + ]>; + deleteEvaluationDataset( + request: protos.google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest|null|undefined, + {}|null|undefined>): void; + deleteEvaluationDataset( + request: protos.google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest|null|undefined, + {}|null|undefined>): void; + deleteEvaluationDataset( + request?: protos.google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteEvaluationDataset request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteEvaluationDataset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteEvaluationDataset(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteEvaluationDataset response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified evaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the evaluation to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.Evaluation|Evaluation}. + * 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/evaluation_service.get_evaluation.js + * region_tag:ces_v1beta_generated_EvaluationService_GetEvaluation_async + */ + getEvaluation( + request?: protos.google.cloud.ces.v1beta.IGetEvaluationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.IGetEvaluationRequest|undefined, {}|undefined + ]>; + getEvaluation( + request: protos.google.cloud.ces.v1beta.IGetEvaluationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.IGetEvaluationRequest|null|undefined, + {}|null|undefined>): void; + getEvaluation( + request: protos.google.cloud.ces.v1beta.IGetEvaluationRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.IGetEvaluationRequest|null|undefined, + {}|null|undefined>): void; + getEvaluation( + request?: protos.google.cloud.ces.v1beta.IGetEvaluationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.IGetEvaluationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.IGetEvaluationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.IGetEvaluationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getEvaluation request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.IGetEvaluationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEvaluation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getEvaluation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IEvaluation, + protos.google.cloud.ces.v1beta.IGetEvaluationRequest|undefined, + {}|undefined + ]) => { + this._log.info('getEvaluation response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified evaluation result. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the evaluation result to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.EvaluationResult|EvaluationResult}. + * 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/evaluation_service.get_evaluation_result.js + * region_tag:ces_v1beta_generated_EvaluationService_GetEvaluationResult_async + */ + getEvaluationResult( + request?: protos.google.cloud.ces.v1beta.IGetEvaluationResultRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationResult, + protos.google.cloud.ces.v1beta.IGetEvaluationResultRequest|undefined, {}|undefined + ]>; + getEvaluationResult( + request: protos.google.cloud.ces.v1beta.IGetEvaluationResultRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationResult, + protos.google.cloud.ces.v1beta.IGetEvaluationResultRequest|null|undefined, + {}|null|undefined>): void; + getEvaluationResult( + request: protos.google.cloud.ces.v1beta.IGetEvaluationResultRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationResult, + protos.google.cloud.ces.v1beta.IGetEvaluationResultRequest|null|undefined, + {}|null|undefined>): void; + getEvaluationResult( + request?: protos.google.cloud.ces.v1beta.IGetEvaluationResultRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IEvaluationResult, + protos.google.cloud.ces.v1beta.IGetEvaluationResultRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IEvaluationResult, + protos.google.cloud.ces.v1beta.IGetEvaluationResultRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationResult, + protos.google.cloud.ces.v1beta.IGetEvaluationResultRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getEvaluationResult request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationResult, + protos.google.cloud.ces.v1beta.IGetEvaluationResultRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEvaluationResult response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getEvaluationResult(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IEvaluationResult, + protos.google.cloud.ces.v1beta.IGetEvaluationResultRequest|undefined, + {}|undefined + ]) => { + this._log.info('getEvaluationResult response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified evaluation dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the evaluation dataset to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.EvaluationDataset|EvaluationDataset}. + * 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/evaluation_service.get_evaluation_dataset.js + * region_tag:ces_v1beta_generated_EvaluationService_GetEvaluationDataset_async + */ + getEvaluationDataset( + request?: protos.google.cloud.ces.v1beta.IGetEvaluationDatasetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.IGetEvaluationDatasetRequest|undefined, {}|undefined + ]>; + getEvaluationDataset( + request: protos.google.cloud.ces.v1beta.IGetEvaluationDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.IGetEvaluationDatasetRequest|null|undefined, + {}|null|undefined>): void; + getEvaluationDataset( + request: protos.google.cloud.ces.v1beta.IGetEvaluationDatasetRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.IGetEvaluationDatasetRequest|null|undefined, + {}|null|undefined>): void; + getEvaluationDataset( + request?: protos.google.cloud.ces.v1beta.IGetEvaluationDatasetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.IGetEvaluationDatasetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.IGetEvaluationDatasetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.IGetEvaluationDatasetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getEvaluationDataset request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.IGetEvaluationDatasetRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEvaluationDataset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getEvaluationDataset(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IEvaluationDataset, + protos.google.cloud.ces.v1beta.IGetEvaluationDatasetRequest|undefined, + {}|undefined + ]) => { + this._log.info('getEvaluationDataset response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified evaluation run. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the evaluation run to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.EvaluationRun|EvaluationRun}. + * 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/evaluation_service.get_evaluation_run.js + * region_tag:ces_v1beta_generated_EvaluationService_GetEvaluationRun_async + */ + getEvaluationRun( + request?: protos.google.cloud.ces.v1beta.IGetEvaluationRunRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationRun, + protos.google.cloud.ces.v1beta.IGetEvaluationRunRequest|undefined, {}|undefined + ]>; + getEvaluationRun( + request: protos.google.cloud.ces.v1beta.IGetEvaluationRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationRun, + protos.google.cloud.ces.v1beta.IGetEvaluationRunRequest|null|undefined, + {}|null|undefined>): void; + getEvaluationRun( + request: protos.google.cloud.ces.v1beta.IGetEvaluationRunRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationRun, + protos.google.cloud.ces.v1beta.IGetEvaluationRunRequest|null|undefined, + {}|null|undefined>): void; + getEvaluationRun( + request?: protos.google.cloud.ces.v1beta.IGetEvaluationRunRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IEvaluationRun, + protos.google.cloud.ces.v1beta.IGetEvaluationRunRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IEvaluationRun, + protos.google.cloud.ces.v1beta.IGetEvaluationRunRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationRun, + protos.google.cloud.ces.v1beta.IGetEvaluationRunRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getEvaluationRun request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationRun, + protos.google.cloud.ces.v1beta.IGetEvaluationRunRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEvaluationRun response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getEvaluationRun(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IEvaluationRun, + protos.google.cloud.ces.v1beta.IGetEvaluationRunRequest|undefined, + {}|undefined + ]) => { + this._log.info('getEvaluationRun response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified evaluation expectation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the evaluation expectation to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.EvaluationExpectation|EvaluationExpectation}. + * 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/evaluation_service.get_evaluation_expectation.js + * region_tag:ces_v1beta_generated_EvaluationService_GetEvaluationExpectation_async + */ + getEvaluationExpectation( + request?: protos.google.cloud.ces.v1beta.IGetEvaluationExpectationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.IGetEvaluationExpectationRequest|undefined, {}|undefined + ]>; + getEvaluationExpectation( + request: protos.google.cloud.ces.v1beta.IGetEvaluationExpectationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.IGetEvaluationExpectationRequest|null|undefined, + {}|null|undefined>): void; + getEvaluationExpectation( + request: protos.google.cloud.ces.v1beta.IGetEvaluationExpectationRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.IGetEvaluationExpectationRequest|null|undefined, + {}|null|undefined>): void; + getEvaluationExpectation( + request?: protos.google.cloud.ces.v1beta.IGetEvaluationExpectationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.IGetEvaluationExpectationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.IGetEvaluationExpectationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.IGetEvaluationExpectationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getEvaluationExpectation request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.IGetEvaluationExpectationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEvaluationExpectation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getEvaluationExpectation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.IGetEvaluationExpectationRequest|undefined, + {}|undefined + ]) => { + this._log.info('getEvaluationExpectation response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates an evaluation expectation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The app to create the evaluation expectation for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + * @param {string} [request.evaluationExpectationId] + * Optional. The ID to use for the evaluation expectation, which will become + * the final component of the evaluation expectation's resource name. If not + * provided, a unique ID will be automatically assigned for the evaluation + * expectation. + * @param {google.cloud.ces.v1beta.EvaluationExpectation} request.evaluationExpectation + * Required. The evaluation expectation to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.EvaluationExpectation|EvaluationExpectation}. + * 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/evaluation_service.create_evaluation_expectation.js + * region_tag:ces_v1beta_generated_EvaluationService_CreateEvaluationExpectation_async + */ + createEvaluationExpectation( + request?: protos.google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest|undefined, {}|undefined + ]>; + createEvaluationExpectation( + request: protos.google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest|null|undefined, + {}|null|undefined>): void; + createEvaluationExpectation( + request: protos.google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest|null|undefined, + {}|null|undefined>): void; + createEvaluationExpectation( + request?: protos.google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createEvaluationExpectation request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createEvaluationExpectation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createEvaluationExpectation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest|undefined, + {}|undefined + ]) => { + this._log.info('createEvaluationExpectation response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates an evaluation expectation. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1beta.EvaluationExpectation} request.evaluationExpectation + * Required. The evaluation expectation to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.EvaluationExpectation|EvaluationExpectation}. + * 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/evaluation_service.update_evaluation_expectation.js + * region_tag:ces_v1beta_generated_EvaluationService_UpdateEvaluationExpectation_async + */ + updateEvaluationExpectation( + request?: protos.google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest|undefined, {}|undefined + ]>; + updateEvaluationExpectation( + request: protos.google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest|null|undefined, + {}|null|undefined>): void; + updateEvaluationExpectation( + request: protos.google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest|null|undefined, + {}|null|undefined>): void; + updateEvaluationExpectation( + request?: protos.google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'evaluation_expectation.name': request.evaluationExpectation!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateEvaluationExpectation request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateEvaluationExpectation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateEvaluationExpectation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IEvaluationExpectation, + protos.google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateEvaluationExpectation response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes an evaluation expectation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the evaluation expectation to delete. + * @param {string} [request.etag] + * Optional. The current etag of the evaluation expectation. If an etag is not + * provided, the deletion will overwrite any concurrent changes. If an etag is + * provided and does not match the current etag of the evaluation expectation, + * 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 {@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/evaluation_service.delete_evaluation_expectation.js + * region_tag:ces_v1beta_generated_EvaluationService_DeleteEvaluationExpectation_async + */ + deleteEvaluationExpectation( + request?: protos.google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest|undefined, {}|undefined + ]>; + deleteEvaluationExpectation( + request: protos.google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest|null|undefined, + {}|null|undefined>): void; + deleteEvaluationExpectation( + request: protos.google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest|null|undefined, + {}|null|undefined>): void; + deleteEvaluationExpectation( + request?: protos.google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteEvaluationExpectation request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteEvaluationExpectation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteEvaluationExpectation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteEvaluationExpectation response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a scheduled evaluation run. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The app to create the scheduled evaluation run for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + * @param {string} [request.scheduledEvaluationRunId] + * Optional. The ID to use for the scheduled evaluation run, which will become + * the final component of the scheduled evaluation run's resource name. If not + * provided, a unique ID will be automatically assigned. + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun} request.scheduledEvaluationRun + * Required. The scheduled evaluation run to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.ScheduledEvaluationRun|ScheduledEvaluationRun}. + * 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/evaluation_service.create_scheduled_evaluation_run.js + * region_tag:ces_v1beta_generated_EvaluationService_CreateScheduledEvaluationRun_async + */ + createScheduledEvaluationRun( + request?: protos.google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest|undefined, {}|undefined + ]>; + createScheduledEvaluationRun( + request: protos.google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>): void; + createScheduledEvaluationRun( + request: protos.google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>): void; + createScheduledEvaluationRun( + request?: protos.google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createScheduledEvaluationRun request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createScheduledEvaluationRun response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createScheduledEvaluationRun(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest|undefined, + {}|undefined + ]) => { + this._log.info('createScheduledEvaluationRun response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of the specified scheduled evaluation run. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the scheduled evaluation run to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.ScheduledEvaluationRun|ScheduledEvaluationRun}. + * 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/evaluation_service.get_scheduled_evaluation_run.js + * region_tag:ces_v1beta_generated_EvaluationService_GetScheduledEvaluationRun_async + */ + getScheduledEvaluationRun( + request?: protos.google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest|undefined, {}|undefined + ]>; + getScheduledEvaluationRun( + request: protos.google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>): void; + getScheduledEvaluationRun( + request: protos.google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>): void; + getScheduledEvaluationRun( + request?: protos.google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getScheduledEvaluationRun request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getScheduledEvaluationRun response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getScheduledEvaluationRun(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest|undefined, + {}|undefined + ]) => { + this._log.info('getScheduledEvaluationRun response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates a scheduled evaluation run. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun} request.scheduledEvaluationRun + * Required. The scheduled evaluation run to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to control which fields get updated. If the + * mask is not present, all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.ScheduledEvaluationRun|ScheduledEvaluationRun}. + * 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/evaluation_service.update_scheduled_evaluation_run.js + * region_tag:ces_v1beta_generated_EvaluationService_UpdateScheduledEvaluationRun_async + */ + updateScheduledEvaluationRun( + request?: protos.google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest|undefined, {}|undefined + ]>; + updateScheduledEvaluationRun( + request: protos.google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>): void; + updateScheduledEvaluationRun( + request: protos.google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>): void; + updateScheduledEvaluationRun( + request?: protos.google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scheduled_evaluation_run.name': request.scheduledEvaluationRun!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateScheduledEvaluationRun request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateScheduledEvaluationRun response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateScheduledEvaluationRun(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun, + protos.google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateScheduledEvaluationRun response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes a scheduled evaluation run. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the scheduled evaluation run to delete. + * @param {string} [request.etag] + * Optional. The etag of the ScheduledEvaluationRun. + * If provided, it must match the server's etag. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/evaluation_service.delete_scheduled_evaluation_run.js + * region_tag:ces_v1beta_generated_EvaluationService_DeleteScheduledEvaluationRun_async + */ + deleteScheduledEvaluationRun( + request?: protos.google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest|undefined, {}|undefined + ]>; + deleteScheduledEvaluationRun( + request: protos.google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>): void; + deleteScheduledEvaluationRun( + request: protos.google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>): void; + deleteScheduledEvaluationRun( + request?: protos.google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteScheduledEvaluationRun request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteScheduledEvaluationRun response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteScheduledEvaluationRun(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteScheduledEvaluationRun response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Tests the voice of a persona. Also accepts a default persona. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.app + * Required. the resource name of the app to test the persona voice for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + * @param {string} request.personaId + * Required. The persona ID to test the voice for. Also accepts "default". + * @param {string} request.text + * Required. The text to test the voice for. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.TestPersonaVoiceResponse|TestPersonaVoiceResponse}. + * 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/evaluation_service.test_persona_voice.js + * region_tag:ces_v1beta_generated_EvaluationService_TestPersonaVoice_async + */ + testPersonaVoice( + request?: protos.google.cloud.ces.v1beta.ITestPersonaVoiceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.ITestPersonaVoiceResponse, + protos.google.cloud.ces.v1beta.ITestPersonaVoiceRequest|undefined, {}|undefined + ]>; + testPersonaVoice( + request: protos.google.cloud.ces.v1beta.ITestPersonaVoiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.ITestPersonaVoiceResponse, + protos.google.cloud.ces.v1beta.ITestPersonaVoiceRequest|null|undefined, + {}|null|undefined>): void; + testPersonaVoice( + request: protos.google.cloud.ces.v1beta.ITestPersonaVoiceRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.ITestPersonaVoiceResponse, + protos.google.cloud.ces.v1beta.ITestPersonaVoiceRequest|null|undefined, + {}|null|undefined>): void; + testPersonaVoice( + request?: protos.google.cloud.ces.v1beta.ITestPersonaVoiceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.ITestPersonaVoiceResponse, + protos.google.cloud.ces.v1beta.ITestPersonaVoiceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.ITestPersonaVoiceResponse, + protos.google.cloud.ces.v1beta.ITestPersonaVoiceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.ITestPersonaVoiceResponse, + protos.google.cloud.ces.v1beta.ITestPersonaVoiceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'app': request.app ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('testPersonaVoice request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.ITestPersonaVoiceResponse, + protos.google.cloud.ces.v1beta.ITestPersonaVoiceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testPersonaVoice response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.testPersonaVoice(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.ITestPersonaVoiceResponse, + protos.google.cloud.ces.v1beta.ITestPersonaVoiceRequest|undefined, + {}|undefined + ]) => { + this._log.info('testPersonaVoice response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Runs an evaluation of the app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.app + * Required. The app to evaluate. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + * @param {string[]} [request.evaluations] + * Optional. List of evaluations to run. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}` + * @param {string} [request.evaluationDataset] + * Optional. An evaluation dataset to run. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/evaluationDatasets/{evaluationDataset}` + * @param {string} [request.displayName] + * Optional. The display name of the evaluation run. + * @param {string} [request.appVersion] + * Optional. The app version to evaluate. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/versions/{version}` + * @param {google.cloud.ces.v1beta.EvaluationConfig} [request.config] + * Optional. The configuration to use for the run. + * @param {number} [request.runCount] + * Optional. The number of times to run the evaluation. If not set, the + * default value is 1 per golden, and 5 per scenario. + * @param {number[]} [request.personaRunConfigs] + * Optional. The configuration to use for the run per persona. + * @param {google.cloud.ces.v1beta.OptimizationConfig} [request.optimizationConfig] + * Optional. Configuration for running the optimization step after the + * evaluation run. If not set, the optimization step will not be run. + * @param {string} [request.scheduledEvaluationRun] + * Optional. The resource name of the `ScheduledEvaluationRun` that is + * triggering this evaluation run. + * + * If this field is set, the `scheduled_evaluation_run` field on the created + * `EvaluationRun` resource will be populated from this value. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/scheduledEvaluationRuns/{scheduled_evaluation_run}` + * @param {google.cloud.ces.v1beta.GoldenRunMethod} [request.goldenRunMethod] + * Optional. The method to run the evaluation if it is a golden evaluation. If + * not set, default to STABLE. + * @param {boolean} [request.generateLatencyReport] + * Optional. Whether to generate a latency report for the evaluation run. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/evaluation_service.run_evaluation.js + * region_tag:ces_v1beta_generated_EvaluationService_RunEvaluation_async + */ + runEvaluation( + request?: protos.google.cloud.ces.v1beta.IRunEvaluationRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + runEvaluation( + request: protos.google.cloud.ces.v1beta.IRunEvaluationRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + runEvaluation( + request: protos.google.cloud.ces.v1beta.IRunEvaluationRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + runEvaluation( + request?: protos.google.cloud.ces.v1beta.IRunEvaluationRequest, + 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({ + 'app': request.app ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('runEvaluation response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('runEvaluation request %j', request); + return this.innerApiCalls.runEvaluation(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('runEvaluation response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `runEvaluation()`. + * @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/evaluation_service.run_evaluation.js + * region_tag:ces_v1beta_generated_EvaluationService_RunEvaluation_async + */ + async checkRunEvaluationProgress(name: string): Promise>{ + this._log.info('runEvaluation long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.runEvaluation, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a golden evaluation from a conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.conversation + * Required. The conversation to create the golden evaluation for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}` + * @param {google.cloud.ces.v1beta.Conversation.Source} [request.source] + * Optional. Indicate the source of the conversation. If not set, all sources + * will be searched. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/evaluation_service.generate_evaluation.js + * region_tag:ces_v1beta_generated_EvaluationService_GenerateEvaluation_async + */ + generateEvaluation( + request?: protos.google.cloud.ces.v1beta.IGenerateEvaluationRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + generateEvaluation( + request: protos.google.cloud.ces.v1beta.IGenerateEvaluationRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + generateEvaluation( + request: protos.google.cloud.ces.v1beta.IGenerateEvaluationRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + generateEvaluation( + request?: protos.google.cloud.ces.v1beta.IGenerateEvaluationRequest, + 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({ + 'conversation': request.conversation ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('generateEvaluation response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('generateEvaluation request %j', request); + return this.innerApiCalls.generateEvaluation(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('generateEvaluation response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `generateEvaluation()`. + * @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/evaluation_service.generate_evaluation.js + * region_tag:ces_v1beta_generated_EvaluationService_GenerateEvaluation_async + */ + async checkGenerateEvaluationProgress(name: string): Promise>{ + this._log.info('generateEvaluation long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.generateEvaluation, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Imports evaluations into the app. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList} request.conversationList + * The conversations to import the evaluations from. + * @param {string} request.gcsUri + * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI + * from which to import evaluations. The format of this URI must be + * `gs:///`. + * @param {Buffer} request.csvContent + * Raw bytes representing the csv file with the evaluations structure. + * @param {string} request.parent + * Required. The app to import the evaluations into. + * Format: + * `projects/{project}/locations/{location}/apps/{app}` + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions} [request.importOptions] + * Optional. Options governing the import process for the evaluations. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/evaluation_service.import_evaluations.js + * region_tag:ces_v1beta_generated_EvaluationService_ImportEvaluations_async + */ + importEvaluations( + request?: protos.google.cloud.ces.v1beta.IImportEvaluationsRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + importEvaluations( + request: protos.google.cloud.ces.v1beta.IImportEvaluationsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importEvaluations( + request: protos.google.cloud.ces.v1beta.IImportEvaluationsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importEvaluations( + request?: protos.google.cloud.ces.v1beta.IImportEvaluationsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importEvaluations response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importEvaluations request %j', request); + return this.innerApiCalls.importEvaluations(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('importEvaluations response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `importEvaluations()`. + * @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/evaluation_service.import_evaluations.js + * region_tag:ces_v1beta_generated_EvaluationService_ImportEvaluations_async + */ + async checkImportEvaluationsProgress(name: string): Promise>{ + this._log.info('importEvaluations long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importEvaluations, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes an evaluation run. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the evaluation run to 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/evaluation_service.delete_evaluation_run.js + * region_tag:ces_v1beta_generated_EvaluationService_DeleteEvaluationRun_async + */ + deleteEvaluationRun( + request?: protos.google.cloud.ces.v1beta.IDeleteEvaluationRunRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteEvaluationRun( + request: protos.google.cloud.ces.v1beta.IDeleteEvaluationRunRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteEvaluationRun( + request: protos.google.cloud.ces.v1beta.IDeleteEvaluationRunRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteEvaluationRun( + request?: protos.google.cloud.ces.v1beta.IDeleteEvaluationRunRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteEvaluationRun response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteEvaluationRun request %j', request); + return this.innerApiCalls.deleteEvaluationRun(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteEvaluationRun response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteEvaluationRun()`. + * @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/evaluation_service.delete_evaluation_run.js + * region_tag:ces_v1beta_generated_EvaluationService_DeleteEvaluationRun_async + */ + async checkDeleteEvaluationRunProgress(name: string): Promise>{ + this._log.info('deleteEvaluationRun long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteEvaluationRun, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists all evaluations in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list evaluations from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListEvaluationsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.EvaluationService.ListEvaluations|EvaluationService.ListEvaluations} + * call. + * @param {string} [request.filter] + * Optional. Deprecated: Use evaluation_filter and evaluation_run_filter + * instead. + * @param {string} [request.evaluationFilter] + * Optional. Filter to be applied on the evaluation when listing the + * evaluations. See https://google.aip.dev/160 for more details. Supported + * fields: evaluation_datasets + * @param {string} [request.evaluationRunFilter] + * Optional. Filter string for fields on the associated EvaluationRun + * resources. See https://google.aip.dev/160 for more details. Supported + * fields: create_time, initiated_by, app_version_display_name + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + * @param {boolean} [request.lastTenResults] + * Optional. Whether to include the last 10 evaluation results for each + * evaluation in the response. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1beta.Evaluation|Evaluation}. + * 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 `listEvaluationsAsync()` + * 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. + */ + listEvaluations( + request?: protos.google.cloud.ces.v1beta.IListEvaluationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluation[], + protos.google.cloud.ces.v1beta.IListEvaluationsRequest|null, + protos.google.cloud.ces.v1beta.IListEvaluationsResponse + ]>; + listEvaluations( + request: protos.google.cloud.ces.v1beta.IListEvaluationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluation>): void; + listEvaluations( + request: protos.google.cloud.ces.v1beta.IListEvaluationsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluation>): void; + listEvaluations( + request?: protos.google.cloud.ces.v1beta.IListEvaluationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluation>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluation>): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluation[], + protos.google.cloud.ces.v1beta.IListEvaluationsRequest|null, + protos.google.cloud.ces.v1beta.IListEvaluationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluation>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEvaluations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEvaluations request %j', request); + return this.innerApiCalls + .listEvaluations(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1beta.IEvaluation[], + protos.google.cloud.ces.v1beta.IListEvaluationsRequest|null, + protos.google.cloud.ces.v1beta.IListEvaluationsResponse + ]) => { + this._log.info('listEvaluations values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listEvaluations`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list evaluations from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListEvaluationsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.EvaluationService.ListEvaluations|EvaluationService.ListEvaluations} + * call. + * @param {string} [request.filter] + * Optional. Deprecated: Use evaluation_filter and evaluation_run_filter + * instead. + * @param {string} [request.evaluationFilter] + * Optional. Filter to be applied on the evaluation when listing the + * evaluations. See https://google.aip.dev/160 for more details. Supported + * fields: evaluation_datasets + * @param {string} [request.evaluationRunFilter] + * Optional. Filter string for fields on the associated EvaluationRun + * resources. See https://google.aip.dev/160 for more details. Supported + * fields: create_time, initiated_by, app_version_display_name + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + * @param {boolean} [request.lastTenResults] + * Optional. Whether to include the last 10 evaluation results for each + * evaluation in the response. + * @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.ces.v1beta.Evaluation|Evaluation} 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 `listEvaluationsAsync()` + * 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. + */ + listEvaluationsStream( + request?: protos.google.cloud.ces.v1beta.IListEvaluationsRequest, + 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['listEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEvaluations stream %j', request); + return this.descriptors.page.listEvaluations.createStream( + this.innerApiCalls.listEvaluations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listEvaluations`, 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 resource name of the app to list evaluations from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListEvaluationsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.EvaluationService.ListEvaluations|EvaluationService.ListEvaluations} + * call. + * @param {string} [request.filter] + * Optional. Deprecated: Use evaluation_filter and evaluation_run_filter + * instead. + * @param {string} [request.evaluationFilter] + * Optional. Filter to be applied on the evaluation when listing the + * evaluations. See https://google.aip.dev/160 for more details. Supported + * fields: evaluation_datasets + * @param {string} [request.evaluationRunFilter] + * Optional. Filter string for fields on the associated EvaluationRun + * resources. See https://google.aip.dev/160 for more details. Supported + * fields: create_time, initiated_by, app_version_display_name + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + * @param {boolean} [request.lastTenResults] + * Optional. Whether to include the last 10 evaluation results for each + * evaluation in the response. + * @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.ces.v1beta.Evaluation|Evaluation}. 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/evaluation_service.list_evaluations.js + * region_tag:ces_v1beta_generated_EvaluationService_ListEvaluations_async + */ + listEvaluationsAsync( + request?: protos.google.cloud.ces.v1beta.IListEvaluationsRequest, + 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['listEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEvaluations iterate %j', request); + return this.descriptors.page.listEvaluations.asyncIterate( + this.innerApiCalls['listEvaluations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all evaluation results for a given evaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the evaluation to list evaluation results + * from. To filter by evaluation run, use `-` as the evaluation ID and specify + * the evaluation run ID in the filter. For example: + * `projects/{project}/locations/{location}/apps/{app}/evaluations/-` + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListEvaluationResultsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.EvaluationService.ListEvaluationResults|EvaluationService.ListEvaluationResults} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the evaluation results. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1beta.EvaluationResult|EvaluationResult}. + * 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 `listEvaluationResultsAsync()` + * 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. + */ + listEvaluationResults( + request?: protos.google.cloud.ces.v1beta.IListEvaluationResultsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationResult[], + protos.google.cloud.ces.v1beta.IListEvaluationResultsRequest|null, + protos.google.cloud.ces.v1beta.IListEvaluationResultsResponse + ]>; + listEvaluationResults( + request: protos.google.cloud.ces.v1beta.IListEvaluationResultsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationResultsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationResultsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationResult>): void; + listEvaluationResults( + request: protos.google.cloud.ces.v1beta.IListEvaluationResultsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationResultsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationResultsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationResult>): void; + listEvaluationResults( + request?: protos.google.cloud.ces.v1beta.IListEvaluationResultsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationResultsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationResultsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationResult>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationResultsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationResultsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationResult>): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationResult[], + protos.google.cloud.ces.v1beta.IListEvaluationResultsRequest|null, + protos.google.cloud.ces.v1beta.IListEvaluationResultsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationResultsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationResultsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationResult>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEvaluationResults values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEvaluationResults request %j', request); + return this.innerApiCalls + .listEvaluationResults(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1beta.IEvaluationResult[], + protos.google.cloud.ces.v1beta.IListEvaluationResultsRequest|null, + protos.google.cloud.ces.v1beta.IListEvaluationResultsResponse + ]) => { + this._log.info('listEvaluationResults values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listEvaluationResults`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the evaluation to list evaluation results + * from. To filter by evaluation run, use `-` as the evaluation ID and specify + * the evaluation run ID in the filter. For example: + * `projects/{project}/locations/{location}/apps/{app}/evaluations/-` + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListEvaluationResultsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.EvaluationService.ListEvaluationResults|EvaluationService.ListEvaluationResults} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the evaluation results. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + * @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.ces.v1beta.EvaluationResult|EvaluationResult} 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 `listEvaluationResultsAsync()` + * 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. + */ + listEvaluationResultsStream( + request?: protos.google.cloud.ces.v1beta.IListEvaluationResultsRequest, + 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['listEvaluationResults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEvaluationResults stream %j', request); + return this.descriptors.page.listEvaluationResults.createStream( + this.innerApiCalls.listEvaluationResults as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listEvaluationResults`, 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 resource name of the evaluation to list evaluation results + * from. To filter by evaluation run, use `-` as the evaluation ID and specify + * the evaluation run ID in the filter. For example: + * `projects/{project}/locations/{location}/apps/{app}/evaluations/-` + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListEvaluationResultsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.EvaluationService.ListEvaluationResults|EvaluationService.ListEvaluationResults} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the evaluation results. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + * @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.ces.v1beta.EvaluationResult|EvaluationResult}. 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/evaluation_service.list_evaluation_results.js + * region_tag:ces_v1beta_generated_EvaluationService_ListEvaluationResults_async + */ + listEvaluationResultsAsync( + request?: protos.google.cloud.ces.v1beta.IListEvaluationResultsRequest, + 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['listEvaluationResults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEvaluationResults iterate %j', request); + return this.descriptors.page.listEvaluationResults.asyncIterate( + this.innerApiCalls['listEvaluationResults'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all evaluation datasets in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list evaluation datasets from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.EvaluationService.ListEvaluationDatasets|EvaluationService.ListEvaluationDatasets} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the evaluation datasets. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1beta.EvaluationDataset|EvaluationDataset}. + * 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 `listEvaluationDatasetsAsync()` + * 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. + */ + listEvaluationDatasets( + request?: protos.google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationDataset[], + protos.google.cloud.ces.v1beta.IListEvaluationDatasetsRequest|null, + protos.google.cloud.ces.v1beta.IListEvaluationDatasetsResponse + ]>; + listEvaluationDatasets( + request: protos.google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationDatasetsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationDataset>): void; + listEvaluationDatasets( + request: protos.google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationDatasetsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationDataset>): void; + listEvaluationDatasets( + request?: protos.google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationDatasetsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationDataset>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationDatasetsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationDataset>): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationDataset[], + protos.google.cloud.ces.v1beta.IListEvaluationDatasetsRequest|null, + protos.google.cloud.ces.v1beta.IListEvaluationDatasetsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationDatasetsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationDataset>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEvaluationDatasets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEvaluationDatasets request %j', request); + return this.innerApiCalls + .listEvaluationDatasets(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1beta.IEvaluationDataset[], + protos.google.cloud.ces.v1beta.IListEvaluationDatasetsRequest|null, + protos.google.cloud.ces.v1beta.IListEvaluationDatasetsResponse + ]) => { + this._log.info('listEvaluationDatasets values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listEvaluationDatasets`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list evaluation datasets from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.EvaluationService.ListEvaluationDatasets|EvaluationService.ListEvaluationDatasets} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the evaluation datasets. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + * @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.ces.v1beta.EvaluationDataset|EvaluationDataset} 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 `listEvaluationDatasetsAsync()` + * 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. + */ + listEvaluationDatasetsStream( + request?: protos.google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, + 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['listEvaluationDatasets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEvaluationDatasets stream %j', request); + return this.descriptors.page.listEvaluationDatasets.createStream( + this.innerApiCalls.listEvaluationDatasets as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listEvaluationDatasets`, 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 resource name of the app to list evaluation datasets from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.EvaluationService.ListEvaluationDatasets|EvaluationService.ListEvaluationDatasets} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the evaluation datasets. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + * @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.ces.v1beta.EvaluationDataset|EvaluationDataset}. 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/evaluation_service.list_evaluation_datasets.js + * region_tag:ces_v1beta_generated_EvaluationService_ListEvaluationDatasets_async + */ + listEvaluationDatasetsAsync( + request?: protos.google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, + 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['listEvaluationDatasets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEvaluationDatasets iterate %j', request); + return this.descriptors.page.listEvaluationDatasets.asyncIterate( + this.innerApiCalls['listEvaluationDatasets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all evaluation runs in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list evaluation runs from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListEvaluationRunsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.EvaluationService.ListEvaluationRuns|EvaluationService.ListEvaluationRuns} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the evaluation runs. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1beta.EvaluationRun|EvaluationRun}. + * 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 `listEvaluationRunsAsync()` + * 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. + */ + listEvaluationRuns( + request?: protos.google.cloud.ces.v1beta.IListEvaluationRunsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationRun[], + protos.google.cloud.ces.v1beta.IListEvaluationRunsRequest|null, + protos.google.cloud.ces.v1beta.IListEvaluationRunsResponse + ]>; + listEvaluationRuns( + request: protos.google.cloud.ces.v1beta.IListEvaluationRunsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationRunsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationRunsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationRun>): void; + listEvaluationRuns( + request: protos.google.cloud.ces.v1beta.IListEvaluationRunsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationRunsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationRunsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationRun>): void; + listEvaluationRuns( + request?: protos.google.cloud.ces.v1beta.IListEvaluationRunsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationRunsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationRunsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationRun>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationRunsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationRunsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationRun>): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationRun[], + protos.google.cloud.ces.v1beta.IListEvaluationRunsRequest|null, + protos.google.cloud.ces.v1beta.IListEvaluationRunsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationRunsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationRunsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationRun>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEvaluationRuns values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEvaluationRuns request %j', request); + return this.innerApiCalls + .listEvaluationRuns(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1beta.IEvaluationRun[], + protos.google.cloud.ces.v1beta.IListEvaluationRunsRequest|null, + protos.google.cloud.ces.v1beta.IListEvaluationRunsResponse + ]) => { + this._log.info('listEvaluationRuns values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listEvaluationRuns`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list evaluation runs from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListEvaluationRunsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.EvaluationService.ListEvaluationRuns|EvaluationService.ListEvaluationRuns} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the evaluation runs. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + * @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.ces.v1beta.EvaluationRun|EvaluationRun} 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 `listEvaluationRunsAsync()` + * 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. + */ + listEvaluationRunsStream( + request?: protos.google.cloud.ces.v1beta.IListEvaluationRunsRequest, + 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['listEvaluationRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEvaluationRuns stream %j', request); + return this.descriptors.page.listEvaluationRuns.createStream( + this.innerApiCalls.listEvaluationRuns as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listEvaluationRuns`, 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 resource name of the app to list evaluation runs from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListEvaluationRunsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.EvaluationService.ListEvaluationRuns|EvaluationService.ListEvaluationRuns} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the evaluation runs. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + * @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.ces.v1beta.EvaluationRun|EvaluationRun}. 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/evaluation_service.list_evaluation_runs.js + * region_tag:ces_v1beta_generated_EvaluationService_ListEvaluationRuns_async + */ + listEvaluationRunsAsync( + request?: protos.google.cloud.ces.v1beta.IListEvaluationRunsRequest, + 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['listEvaluationRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEvaluationRuns iterate %j', request); + return this.descriptors.page.listEvaluationRuns.asyncIterate( + this.innerApiCalls['listEvaluationRuns'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all evaluation expectations in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list evaluation expectations + * from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.EvaluationService.ListEvaluationExpectations|EvaluationService.ListEvaluationExpectations} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the evaluation expectations. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1beta.EvaluationExpectation|EvaluationExpectation}. + * 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 `listEvaluationExpectationsAsync()` + * 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. + */ + listEvaluationExpectations( + request?: protos.google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationExpectation[], + protos.google.cloud.ces.v1beta.IListEvaluationExpectationsRequest|null, + protos.google.cloud.ces.v1beta.IListEvaluationExpectationsResponse + ]>; + listEvaluationExpectations( + request: protos.google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationExpectationsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationExpectation>): void; + listEvaluationExpectations( + request: protos.google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationExpectationsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationExpectation>): void; + listEvaluationExpectations( + request?: protos.google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationExpectationsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationExpectation>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationExpectationsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationExpectation>): + Promise<[ + protos.google.cloud.ces.v1beta.IEvaluationExpectation[], + protos.google.cloud.ces.v1beta.IListEvaluationExpectationsRequest|null, + protos.google.cloud.ces.v1beta.IListEvaluationExpectationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, + protos.google.cloud.ces.v1beta.IListEvaluationExpectationsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IEvaluationExpectation>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEvaluationExpectations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEvaluationExpectations request %j', request); + return this.innerApiCalls + .listEvaluationExpectations(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1beta.IEvaluationExpectation[], + protos.google.cloud.ces.v1beta.IListEvaluationExpectationsRequest|null, + protos.google.cloud.ces.v1beta.IListEvaluationExpectationsResponse + ]) => { + this._log.info('listEvaluationExpectations values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listEvaluationExpectations`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list evaluation expectations + * from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.EvaluationService.ListEvaluationExpectations|EvaluationService.ListEvaluationExpectations} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the evaluation expectations. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + * @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.ces.v1beta.EvaluationExpectation|EvaluationExpectation} 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 `listEvaluationExpectationsAsync()` + * 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. + */ + listEvaluationExpectationsStream( + request?: protos.google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, + 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['listEvaluationExpectations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEvaluationExpectations stream %j', request); + return this.descriptors.page.listEvaluationExpectations.createStream( + this.innerApiCalls.listEvaluationExpectations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listEvaluationExpectations`, 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 resource name of the app to list evaluation expectations + * from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.EvaluationService.ListEvaluationExpectations|EvaluationService.ListEvaluationExpectations} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the evaluation expectations. + * See https://google.aip.dev/160 for more details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. Only "name" and "create_time", and + * "update_time" are supported. Time fields are ordered in descending order, + * and the name field is ordered in ascending order. If not included, + * "update_time" will be the default. See https://google.aip.dev/132#ordering + * for more details. + * @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.ces.v1beta.EvaluationExpectation|EvaluationExpectation}. 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/evaluation_service.list_evaluation_expectations.js + * region_tag:ces_v1beta_generated_EvaluationService_ListEvaluationExpectations_async + */ + listEvaluationExpectationsAsync( + request?: protos.google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, + 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['listEvaluationExpectations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEvaluationExpectations iterate %j', request); + return this.descriptors.page.listEvaluationExpectations.asyncIterate( + this.innerApiCalls['listEvaluationExpectations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all scheduled evaluation runs in the given app. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list scheduled evaluation runs + * from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.EvaluationService.ListScheduledEvaluationRuns|EvaluationService.ListScheduledEvaluationRuns} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the scheduled evaluation runs. + * See https://google.aip.dev/160 for more details. + * Currently supports filtering by: + * * request.evaluations:evaluation_id + * * request.evaluation_dataset:evaluation_dataset_id + * @param {string} [request.orderBy] + * Optional. Field to sort by. Supported fields are: + * "name" (ascending), "create_time" (descending), "update_time" (descending), + * "next_scheduled_execution" (ascending), and + * "last_completed_run.create_time" (descending). + * If not included, "update_time" will be the default. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1beta.ScheduledEvaluationRun|ScheduledEvaluationRun}. + * 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 `listScheduledEvaluationRunsAsync()` + * 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. + */ + listScheduledEvaluationRuns( + request?: protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun[], + protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest|null, + protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse + ]>; + listScheduledEvaluationRuns( + request: protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, + protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun>): void; + listScheduledEvaluationRuns( + request: protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, + callback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, + protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun>): void; + listScheduledEvaluationRuns( + request?: protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, + protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun>, + callback?: PaginationCallback< + protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, + protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun>): + Promise<[ + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun[], + protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest|null, + protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, + protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse|null|undefined, + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listScheduledEvaluationRuns values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listScheduledEvaluationRuns request %j', request); + return this.innerApiCalls + .listScheduledEvaluationRuns(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.ces.v1beta.IScheduledEvaluationRun[], + protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest|null, + protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse + ]) => { + this._log.info('listScheduledEvaluationRuns values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listScheduledEvaluationRuns`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the app to list scheduled evaluation runs + * from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.EvaluationService.ListScheduledEvaluationRuns|EvaluationService.ListScheduledEvaluationRuns} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the scheduled evaluation runs. + * See https://google.aip.dev/160 for more details. + * Currently supports filtering by: + * * request.evaluations:evaluation_id + * * request.evaluation_dataset:evaluation_dataset_id + * @param {string} [request.orderBy] + * Optional. Field to sort by. Supported fields are: + * "name" (ascending), "create_time" (descending), "update_time" (descending), + * "next_scheduled_execution" (ascending), and + * "last_completed_run.create_time" (descending). + * If not included, "update_time" will be the default. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.ScheduledEvaluationRun|ScheduledEvaluationRun} 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 `listScheduledEvaluationRunsAsync()` + * 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. + */ + listScheduledEvaluationRunsStream( + request?: protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, + 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['listScheduledEvaluationRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listScheduledEvaluationRuns stream %j', request); + return this.descriptors.page.listScheduledEvaluationRuns.createStream( + this.innerApiCalls.listScheduledEvaluationRuns as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listScheduledEvaluationRuns`, 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 resource name of the app to list scheduled evaluation runs + * from. + * @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. The + * {@link protos.google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.next_page_token|next_page_token} + * value returned from a previous list + * {@link protos.google.cloud.ces.v1beta.EvaluationService.ListScheduledEvaluationRuns|EvaluationService.ListScheduledEvaluationRuns} + * call. + * @param {string} [request.filter] + * Optional. Filter to be applied when listing the scheduled evaluation runs. + * See https://google.aip.dev/160 for more details. + * Currently supports filtering by: + * * request.evaluations:evaluation_id + * * request.evaluation_dataset:evaluation_dataset_id + * @param {string} [request.orderBy] + * Optional. Field to sort by. Supported fields are: + * "name" (ascending), "create_time" (descending), "update_time" (descending), + * "next_scheduled_execution" (ascending), and + * "last_completed_run.create_time" (descending). + * If not included, "update_time" will be the default. + * See https://google.aip.dev/132#ordering for more details. + * @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.ces.v1beta.ScheduledEvaluationRun|ScheduledEvaluationRun}. 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/evaluation_service.list_scheduled_evaluation_runs.js + * region_tag:ces_v1beta_generated_EvaluationService_ListScheduledEvaluationRuns_async + */ + listScheduledEvaluationRunsAsync( + request?: protos.google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, + 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['listScheduledEvaluationRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listScheduledEvaluationRuns iterate %j', request); + return this.descriptors.page.listScheduledEvaluationRuns.asyncIterate( + this.innerApiCalls['listScheduledEvaluationRuns'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project:string,location:string,app:string,agent:string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + app: app, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the app from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the app. + */ + matchAppFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).app; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified app resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @returns {string} Resource name string. + */ + appPath(project:string,location:string,app:string) { + return this.pathTemplates.appPathTemplate.render({ + project: project, + location: location, + app: app, + }); + } + + /** + * Parse the project from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).project; + } + + /** + * Parse the location from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).location; + } + + /** + * Parse the app from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the app. + */ + matchAppFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).app; + } + + /** + * Return a fully-qualified appVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} version + * @returns {string} Resource name string. + */ + appVersionPath(project:string,location:string,app:string,version:string) { + return this.pathTemplates.appVersionPathTemplate.render({ + project: project, + location: location, + app: app, + version: version, + }); + } + + /** + * Parse the project from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).project; + } + + /** + * Parse the location from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).location; + } + + /** + * Parse the app from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the app. + */ + matchAppFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).app; + } + + /** + * Parse the version from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).version; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath(project:string,location:string,app:string,changelog:string) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + app: app, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).location; + } + + /** + * Parse the app from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the app. + */ + matchAppFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).app; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).changelog; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath(project:string,location:string,app:string,conversation:string) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + app: app, + conversation: conversation, + }); + } + + /** + * Parse the project from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).project; + } + + /** + * Parse the location from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).location; + } + + /** + * Parse the app from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the app. + */ + matchAppFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).app; + } + + /** + * Parse the conversation from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).conversation; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,app:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + app: app, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the app from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the app. + */ + matchAppFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).app; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified evaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation + * @returns {string} Resource name string. + */ + evaluationPath(project:string,location:string,app:string,evaluation:string) { + return this.pathTemplates.evaluationPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation: evaluation, + }); + } + + /** + * Parse the project from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project; + } + + /** + * Parse the location from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location; + } + + /** + * Parse the app from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).app; + } + + /** + * Parse the evaluation from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation; + } + + /** + * Return a fully-qualified evaluationDataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation_dataset + * @returns {string} Resource name string. + */ + evaluationDatasetPath(project:string,location:string,app:string,evaluationDataset:string) { + return this.pathTemplates.evaluationDatasetPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation_dataset: evaluationDataset, + }); + } + + /** + * Parse the project from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).project; + } + + /** + * Parse the location from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).location; + } + + /** + * Parse the app from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).app; + } + + /** + * Parse the evaluation_dataset from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the evaluation_dataset. + */ + matchEvaluationDatasetFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).evaluation_dataset; + } + + /** + * Return a fully-qualified evaluationExpectation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation_expectation + * @returns {string} Resource name string. + */ + evaluationExpectationPath(project:string,location:string,app:string,evaluationExpectation:string) { + return this.pathTemplates.evaluationExpectationPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation_expectation: evaluationExpectation, + }); + } + + /** + * Parse the project from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).project; + } + + /** + * Parse the location from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).location; + } + + /** + * Parse the app from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).app; + } + + /** + * Parse the evaluation_expectation from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the evaluation_expectation. + */ + matchEvaluationExpectationFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).evaluation_expectation; + } + + /** + * Return a fully-qualified evaluationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation + * @param {string} evaluation_result + * @returns {string} Resource name string. + */ + evaluationResultPath(project:string,location:string,app:string,evaluation:string,evaluationResult:string) { + return this.pathTemplates.evaluationResultPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation: evaluation, + evaluation_result: evaluationResult, + }); + } + + /** + * Parse the project from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).project; + } + + /** + * Parse the location from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).location; + } + + /** + * Parse the app from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).app; + } + + /** + * Parse the evaluation from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).evaluation; + } + + /** + * Parse the evaluation_result from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the evaluation_result. + */ + matchEvaluationResultFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).evaluation_result; + } + + /** + * Return a fully-qualified evaluationRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation_run + * @returns {string} Resource name string. + */ + evaluationRunPath(project:string,location:string,app:string,evaluationRun:string) { + return this.pathTemplates.evaluationRunPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation_run: evaluationRun, + }); + } + + /** + * Parse the project from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).project; + } + + /** + * Parse the location from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).location; + } + + /** + * Parse the app from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).app; + } + + /** + * Parse the evaluation_run from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the evaluation_run. + */ + matchEvaluationRunFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).evaluation_run; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath(project:string,location:string,app:string,example:string) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + app: app, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the app from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the app. + */ + matchAppFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).app; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified guardrail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} guardrail + * @returns {string} Resource name string. + */ + guardrailPath(project:string,location:string,app:string,guardrail:string) { + return this.pathTemplates.guardrailPathTemplate.render({ + project: project, + location: location, + app: app, + guardrail: guardrail, + }); + } + + /** + * Parse the project from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).project; + } + + /** + * Parse the location from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).location; + } + + /** + * Parse the app from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the app. + */ + matchAppFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).app; + } + + /** + * Parse the guardrail from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the guardrail. + */ + matchGuardrailFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).guardrail; + } + + /** + * 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 omnichannel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} omnichannel + * @returns {string} Resource name string. + */ + omnichannelPath(project:string,location:string,omnichannel:string) { + return this.pathTemplates.omnichannelPathTemplate.render({ + project: project, + location: location, + omnichannel: omnichannel, + }); + } + + /** + * Parse the project from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).project; + } + + /** + * Parse the location from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).location; + } + + /** + * Parse the omnichannel from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the omnichannel. + */ + matchOmnichannelFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).omnichannel; + } + + /** + * 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 scheduledEvaluationRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} scheduled_evaluation_run + * @returns {string} Resource name string. + */ + scheduledEvaluationRunPath(project:string,location:string,app:string,scheduledEvaluationRun:string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.render({ + project: project, + location: location, + app: app, + scheduled_evaluation_run: scheduledEvaluationRun, + }); + } + + /** + * Parse the project from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).project; + } + + /** + * Parse the location from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).location; + } + + /** + * Parse the app from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the app. + */ + matchAppFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).app; + } + + /** + * Parse the scheduled_evaluation_run from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the scheduled_evaluation_run. + */ + matchScheduledEvaluationRunFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).scheduled_evaluation_run; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project:string,location:string,app:string,tool:string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + app: app, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the app from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the app. + */ + matchAppFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).app; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} toolset + * @returns {string} Resource name string. + */ + toolsetPath(project:string,location:string,app:string,toolset:string) { + return this.pathTemplates.toolsetPathTemplate.render({ + project: project, + location: location, + app: app, + toolset: toolset, + }); + } + + /** + * Parse the project from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).project; + } + + /** + * Parse the location from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).location; + } + + /** + * Parse the app from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the app. + */ + matchAppFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).app; + } + + /** + * Parse the toolset from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the toolset. + */ + matchToolsetFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).toolset; + } + + /** + * 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.evaluationServiceStub && !this._terminated) { + return this.evaluationServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/evaluation_service_client_config.json b/owl-bot-staging/google-cloud-ces/src/v1beta/evaluation_service_client_config.json new file mode 100644 index 00000000000..c2aea510be7 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1beta/evaluation_service_client_config.json @@ -0,0 +1,181 @@ +{ + "interfaces": { + "google.cloud.ces.v1beta.EvaluationService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "RunEvaluation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UploadEvaluationAudio": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateEvaluation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GenerateEvaluation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ImportEvaluations": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateEvaluationDataset": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateEvaluation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateEvaluationDataset": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteEvaluation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteEvaluationResult": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteEvaluationDataset": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteEvaluationRun": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetEvaluation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetEvaluationResult": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetEvaluationDataset": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetEvaluationRun": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListEvaluations": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListEvaluationResults": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListEvaluationDatasets": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListEvaluationRuns": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListEvaluationExpectations": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetEvaluationExpectation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateEvaluationExpectation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateEvaluationExpectation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteEvaluationExpectation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateScheduledEvaluationRun": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetScheduledEvaluationRun": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListScheduledEvaluationRuns": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateScheduledEvaluationRun": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteScheduledEvaluationRun": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "TestPersonaVoice": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/evaluation_service_proto_list.json b/owl-bot-staging/google-cloud-ces/src/v1beta/evaluation_service_proto_list.json new file mode 100644 index 00000000000..19d10d699ff --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1beta/evaluation_service_proto_list.json @@ -0,0 +1,43 @@ +[ + "../../protos/google/cloud/ces/v1beta/agent.proto", + "../../protos/google/cloud/ces/v1beta/agent_service.proto", + "../../protos/google/cloud/ces/v1beta/agent_transfers.proto", + "../../protos/google/cloud/ces/v1beta/app.proto", + "../../protos/google/cloud/ces/v1beta/app_version.proto", + "../../protos/google/cloud/ces/v1beta/auth.proto", + "../../protos/google/cloud/ces/v1beta/bigquery_export.proto", + "../../protos/google/cloud/ces/v1beta/changelog.proto", + "../../protos/google/cloud/ces/v1beta/client_function.proto", + "../../protos/google/cloud/ces/v1beta/common.proto", + "../../protos/google/cloud/ces/v1beta/connector_tool.proto", + "../../protos/google/cloud/ces/v1beta/connector_toolset.proto", + "../../protos/google/cloud/ces/v1beta/conversation.proto", + "../../protos/google/cloud/ces/v1beta/data_store.proto", + "../../protos/google/cloud/ces/v1beta/data_store_tool.proto", + "../../protos/google/cloud/ces/v1beta/deployment.proto", + "../../protos/google/cloud/ces/v1beta/evaluation.proto", + "../../protos/google/cloud/ces/v1beta/evaluation_service.proto", + "../../protos/google/cloud/ces/v1beta/example.proto", + "../../protos/google/cloud/ces/v1beta/fakes.proto", + "../../protos/google/cloud/ces/v1beta/file_search_tool.proto", + "../../protos/google/cloud/ces/v1beta/golden_run.proto", + "../../protos/google/cloud/ces/v1beta/google_search_tool.proto", + "../../protos/google/cloud/ces/v1beta/guardrail.proto", + "../../protos/google/cloud/ces/v1beta/mcp_tool.proto", + "../../protos/google/cloud/ces/v1beta/mcp_toolset.proto", + "../../protos/google/cloud/ces/v1beta/omnichannel.proto", + "../../protos/google/cloud/ces/v1beta/omnichannel_service.proto", + "../../protos/google/cloud/ces/v1beta/open_api_tool.proto", + "../../protos/google/cloud/ces/v1beta/open_api_toolset.proto", + "../../protos/google/cloud/ces/v1beta/python_function.proto", + "../../protos/google/cloud/ces/v1beta/schema.proto", + "../../protos/google/cloud/ces/v1beta/search_suggestions.proto", + "../../protos/google/cloud/ces/v1beta/session_service.proto", + "../../protos/google/cloud/ces/v1beta/system_tool.proto", + "../../protos/google/cloud/ces/v1beta/tool.proto", + "../../protos/google/cloud/ces/v1beta/tool_service.proto", + "../../protos/google/cloud/ces/v1beta/toolset.proto", + "../../protos/google/cloud/ces/v1beta/toolset_tool.proto", + "../../protos/google/cloud/ces/v1beta/widget_service.proto", + "../../protos/google/cloud/ces/v1beta/widget_tool.proto" +] diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/gapic_metadata.json b/owl-bot-staging/google-cloud-ces/src/v1beta/gapic_metadata.json new file mode 100644 index 00000000000..84157333df4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1beta/gapic_metadata.json @@ -0,0 +1,988 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.ces.v1beta", + "libraryPackage": "@google-cloud/ces", + "services": { + "AgentService": { + "clients": { + "grpc": { + "libraryClient": "AgentServiceClient", + "rpcs": { + "GetApp": { + "methods": [ + "getApp" + ] + }, + "UpdateApp": { + "methods": [ + "updateApp" + ] + }, + "GetAgent": { + "methods": [ + "getAgent" + ] + }, + "CreateAgent": { + "methods": [ + "createAgent" + ] + }, + "UpdateAgent": { + "methods": [ + "updateAgent" + ] + }, + "DeleteAgent": { + "methods": [ + "deleteAgent" + ] + }, + "GetExample": { + "methods": [ + "getExample" + ] + }, + "CreateExample": { + "methods": [ + "createExample" + ] + }, + "UpdateExample": { + "methods": [ + "updateExample" + ] + }, + "DeleteExample": { + "methods": [ + "deleteExample" + ] + }, + "GetTool": { + "methods": [ + "getTool" + ] + }, + "GetConversation": { + "methods": [ + "getConversation" + ] + }, + "DeleteConversation": { + "methods": [ + "deleteConversation" + ] + }, + "CreateTool": { + "methods": [ + "createTool" + ] + }, + "UpdateTool": { + "methods": [ + "updateTool" + ] + }, + "DeleteTool": { + "methods": [ + "deleteTool" + ] + }, + "GetGuardrail": { + "methods": [ + "getGuardrail" + ] + }, + "CreateGuardrail": { + "methods": [ + "createGuardrail" + ] + }, + "UpdateGuardrail": { + "methods": [ + "updateGuardrail" + ] + }, + "DeleteGuardrail": { + "methods": [ + "deleteGuardrail" + ] + }, + "GetDeployment": { + "methods": [ + "getDeployment" + ] + }, + "CreateDeployment": { + "methods": [ + "createDeployment" + ] + }, + "UpdateDeployment": { + "methods": [ + "updateDeployment" + ] + }, + "DeleteDeployment": { + "methods": [ + "deleteDeployment" + ] + }, + "GetToolset": { + "methods": [ + "getToolset" + ] + }, + "CreateToolset": { + "methods": [ + "createToolset" + ] + }, + "UpdateToolset": { + "methods": [ + "updateToolset" + ] + }, + "DeleteToolset": { + "methods": [ + "deleteToolset" + ] + }, + "GetAppVersion": { + "methods": [ + "getAppVersion" + ] + }, + "CreateAppVersion": { + "methods": [ + "createAppVersion" + ] + }, + "DeleteAppVersion": { + "methods": [ + "deleteAppVersion" + ] + }, + "GetChangelog": { + "methods": [ + "getChangelog" + ] + }, + "CreateApp": { + "methods": [ + "createApp" + ] + }, + "DeleteApp": { + "methods": [ + "deleteApp" + ] + }, + "ExportApp": { + "methods": [ + "exportApp" + ] + }, + "ImportApp": { + "methods": [ + "importApp" + ] + }, + "BatchDeleteConversations": { + "methods": [ + "batchDeleteConversations" + ] + }, + "RestoreAppVersion": { + "methods": [ + "restoreAppVersion" + ] + }, + "ListApps": { + "methods": [ + "listApps", + "listAppsStream", + "listAppsAsync" + ] + }, + "ListAgents": { + "methods": [ + "listAgents", + "listAgentsStream", + "listAgentsAsync" + ] + }, + "ListExamples": { + "methods": [ + "listExamples", + "listExamplesStream", + "listExamplesAsync" + ] + }, + "ListTools": { + "methods": [ + "listTools", + "listToolsStream", + "listToolsAsync" + ] + }, + "ListConversations": { + "methods": [ + "listConversations", + "listConversationsStream", + "listConversationsAsync" + ] + }, + "ListGuardrails": { + "methods": [ + "listGuardrails", + "listGuardrailsStream", + "listGuardrailsAsync" + ] + }, + "ListDeployments": { + "methods": [ + "listDeployments", + "listDeploymentsStream", + "listDeploymentsAsync" + ] + }, + "ListToolsets": { + "methods": [ + "listToolsets", + "listToolsetsStream", + "listToolsetsAsync" + ] + }, + "ListAppVersions": { + "methods": [ + "listAppVersions", + "listAppVersionsStream", + "listAppVersionsAsync" + ] + }, + "ListChangelogs": { + "methods": [ + "listChangelogs", + "listChangelogsStream", + "listChangelogsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AgentServiceClient", + "rpcs": { + "GetApp": { + "methods": [ + "getApp" + ] + }, + "UpdateApp": { + "methods": [ + "updateApp" + ] + }, + "GetAgent": { + "methods": [ + "getAgent" + ] + }, + "CreateAgent": { + "methods": [ + "createAgent" + ] + }, + "UpdateAgent": { + "methods": [ + "updateAgent" + ] + }, + "DeleteAgent": { + "methods": [ + "deleteAgent" + ] + }, + "GetExample": { + "methods": [ + "getExample" + ] + }, + "CreateExample": { + "methods": [ + "createExample" + ] + }, + "UpdateExample": { + "methods": [ + "updateExample" + ] + }, + "DeleteExample": { + "methods": [ + "deleteExample" + ] + }, + "GetTool": { + "methods": [ + "getTool" + ] + }, + "GetConversation": { + "methods": [ + "getConversation" + ] + }, + "DeleteConversation": { + "methods": [ + "deleteConversation" + ] + }, + "CreateTool": { + "methods": [ + "createTool" + ] + }, + "UpdateTool": { + "methods": [ + "updateTool" + ] + }, + "DeleteTool": { + "methods": [ + "deleteTool" + ] + }, + "GetGuardrail": { + "methods": [ + "getGuardrail" + ] + }, + "CreateGuardrail": { + "methods": [ + "createGuardrail" + ] + }, + "UpdateGuardrail": { + "methods": [ + "updateGuardrail" + ] + }, + "DeleteGuardrail": { + "methods": [ + "deleteGuardrail" + ] + }, + "GetDeployment": { + "methods": [ + "getDeployment" + ] + }, + "CreateDeployment": { + "methods": [ + "createDeployment" + ] + }, + "UpdateDeployment": { + "methods": [ + "updateDeployment" + ] + }, + "DeleteDeployment": { + "methods": [ + "deleteDeployment" + ] + }, + "GetToolset": { + "methods": [ + "getToolset" + ] + }, + "CreateToolset": { + "methods": [ + "createToolset" + ] + }, + "UpdateToolset": { + "methods": [ + "updateToolset" + ] + }, + "DeleteToolset": { + "methods": [ + "deleteToolset" + ] + }, + "GetAppVersion": { + "methods": [ + "getAppVersion" + ] + }, + "CreateAppVersion": { + "methods": [ + "createAppVersion" + ] + }, + "DeleteAppVersion": { + "methods": [ + "deleteAppVersion" + ] + }, + "GetChangelog": { + "methods": [ + "getChangelog" + ] + }, + "CreateApp": { + "methods": [ + "createApp" + ] + }, + "DeleteApp": { + "methods": [ + "deleteApp" + ] + }, + "ExportApp": { + "methods": [ + "exportApp" + ] + }, + "ImportApp": { + "methods": [ + "importApp" + ] + }, + "BatchDeleteConversations": { + "methods": [ + "batchDeleteConversations" + ] + }, + "RestoreAppVersion": { + "methods": [ + "restoreAppVersion" + ] + }, + "ListApps": { + "methods": [ + "listApps", + "listAppsStream", + "listAppsAsync" + ] + }, + "ListAgents": { + "methods": [ + "listAgents", + "listAgentsStream", + "listAgentsAsync" + ] + }, + "ListExamples": { + "methods": [ + "listExamples", + "listExamplesStream", + "listExamplesAsync" + ] + }, + "ListTools": { + "methods": [ + "listTools", + "listToolsStream", + "listToolsAsync" + ] + }, + "ListConversations": { + "methods": [ + "listConversations", + "listConversationsStream", + "listConversationsAsync" + ] + }, + "ListGuardrails": { + "methods": [ + "listGuardrails", + "listGuardrailsStream", + "listGuardrailsAsync" + ] + }, + "ListDeployments": { + "methods": [ + "listDeployments", + "listDeploymentsStream", + "listDeploymentsAsync" + ] + }, + "ListToolsets": { + "methods": [ + "listToolsets", + "listToolsetsStream", + "listToolsetsAsync" + ] + }, + "ListAppVersions": { + "methods": [ + "listAppVersions", + "listAppVersionsStream", + "listAppVersionsAsync" + ] + }, + "ListChangelogs": { + "methods": [ + "listChangelogs", + "listChangelogsStream", + "listChangelogsAsync" + ] + } + } + } + } + }, + "EvaluationService": { + "clients": { + "grpc": { + "libraryClient": "EvaluationServiceClient", + "rpcs": { + "UploadEvaluationAudio": { + "methods": [ + "uploadEvaluationAudio" + ] + }, + "CreateEvaluation": { + "methods": [ + "createEvaluation" + ] + }, + "CreateEvaluationDataset": { + "methods": [ + "createEvaluationDataset" + ] + }, + "UpdateEvaluation": { + "methods": [ + "updateEvaluation" + ] + }, + "UpdateEvaluationDataset": { + "methods": [ + "updateEvaluationDataset" + ] + }, + "DeleteEvaluation": { + "methods": [ + "deleteEvaluation" + ] + }, + "DeleteEvaluationResult": { + "methods": [ + "deleteEvaluationResult" + ] + }, + "DeleteEvaluationDataset": { + "methods": [ + "deleteEvaluationDataset" + ] + }, + "GetEvaluation": { + "methods": [ + "getEvaluation" + ] + }, + "GetEvaluationResult": { + "methods": [ + "getEvaluationResult" + ] + }, + "GetEvaluationDataset": { + "methods": [ + "getEvaluationDataset" + ] + }, + "GetEvaluationRun": { + "methods": [ + "getEvaluationRun" + ] + }, + "GetEvaluationExpectation": { + "methods": [ + "getEvaluationExpectation" + ] + }, + "CreateEvaluationExpectation": { + "methods": [ + "createEvaluationExpectation" + ] + }, + "UpdateEvaluationExpectation": { + "methods": [ + "updateEvaluationExpectation" + ] + }, + "DeleteEvaluationExpectation": { + "methods": [ + "deleteEvaluationExpectation" + ] + }, + "CreateScheduledEvaluationRun": { + "methods": [ + "createScheduledEvaluationRun" + ] + }, + "GetScheduledEvaluationRun": { + "methods": [ + "getScheduledEvaluationRun" + ] + }, + "UpdateScheduledEvaluationRun": { + "methods": [ + "updateScheduledEvaluationRun" + ] + }, + "DeleteScheduledEvaluationRun": { + "methods": [ + "deleteScheduledEvaluationRun" + ] + }, + "TestPersonaVoice": { + "methods": [ + "testPersonaVoice" + ] + }, + "RunEvaluation": { + "methods": [ + "runEvaluation" + ] + }, + "GenerateEvaluation": { + "methods": [ + "generateEvaluation" + ] + }, + "ImportEvaluations": { + "methods": [ + "importEvaluations" + ] + }, + "DeleteEvaluationRun": { + "methods": [ + "deleteEvaluationRun" + ] + }, + "ListEvaluations": { + "methods": [ + "listEvaluations", + "listEvaluationsStream", + "listEvaluationsAsync" + ] + }, + "ListEvaluationResults": { + "methods": [ + "listEvaluationResults", + "listEvaluationResultsStream", + "listEvaluationResultsAsync" + ] + }, + "ListEvaluationDatasets": { + "methods": [ + "listEvaluationDatasets", + "listEvaluationDatasetsStream", + "listEvaluationDatasetsAsync" + ] + }, + "ListEvaluationRuns": { + "methods": [ + "listEvaluationRuns", + "listEvaluationRunsStream", + "listEvaluationRunsAsync" + ] + }, + "ListEvaluationExpectations": { + "methods": [ + "listEvaluationExpectations", + "listEvaluationExpectationsStream", + "listEvaluationExpectationsAsync" + ] + }, + "ListScheduledEvaluationRuns": { + "methods": [ + "listScheduledEvaluationRuns", + "listScheduledEvaluationRunsStream", + "listScheduledEvaluationRunsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "EvaluationServiceClient", + "rpcs": { + "UploadEvaluationAudio": { + "methods": [ + "uploadEvaluationAudio" + ] + }, + "CreateEvaluation": { + "methods": [ + "createEvaluation" + ] + }, + "CreateEvaluationDataset": { + "methods": [ + "createEvaluationDataset" + ] + }, + "UpdateEvaluation": { + "methods": [ + "updateEvaluation" + ] + }, + "UpdateEvaluationDataset": { + "methods": [ + "updateEvaluationDataset" + ] + }, + "DeleteEvaluation": { + "methods": [ + "deleteEvaluation" + ] + }, + "DeleteEvaluationResult": { + "methods": [ + "deleteEvaluationResult" + ] + }, + "DeleteEvaluationDataset": { + "methods": [ + "deleteEvaluationDataset" + ] + }, + "GetEvaluation": { + "methods": [ + "getEvaluation" + ] + }, + "GetEvaluationResult": { + "methods": [ + "getEvaluationResult" + ] + }, + "GetEvaluationDataset": { + "methods": [ + "getEvaluationDataset" + ] + }, + "GetEvaluationRun": { + "methods": [ + "getEvaluationRun" + ] + }, + "GetEvaluationExpectation": { + "methods": [ + "getEvaluationExpectation" + ] + }, + "CreateEvaluationExpectation": { + "methods": [ + "createEvaluationExpectation" + ] + }, + "UpdateEvaluationExpectation": { + "methods": [ + "updateEvaluationExpectation" + ] + }, + "DeleteEvaluationExpectation": { + "methods": [ + "deleteEvaluationExpectation" + ] + }, + "CreateScheduledEvaluationRun": { + "methods": [ + "createScheduledEvaluationRun" + ] + }, + "GetScheduledEvaluationRun": { + "methods": [ + "getScheduledEvaluationRun" + ] + }, + "UpdateScheduledEvaluationRun": { + "methods": [ + "updateScheduledEvaluationRun" + ] + }, + "DeleteScheduledEvaluationRun": { + "methods": [ + "deleteScheduledEvaluationRun" + ] + }, + "TestPersonaVoice": { + "methods": [ + "testPersonaVoice" + ] + }, + "RunEvaluation": { + "methods": [ + "runEvaluation" + ] + }, + "GenerateEvaluation": { + "methods": [ + "generateEvaluation" + ] + }, + "ImportEvaluations": { + "methods": [ + "importEvaluations" + ] + }, + "DeleteEvaluationRun": { + "methods": [ + "deleteEvaluationRun" + ] + }, + "ListEvaluations": { + "methods": [ + "listEvaluations", + "listEvaluationsStream", + "listEvaluationsAsync" + ] + }, + "ListEvaluationResults": { + "methods": [ + "listEvaluationResults", + "listEvaluationResultsStream", + "listEvaluationResultsAsync" + ] + }, + "ListEvaluationDatasets": { + "methods": [ + "listEvaluationDatasets", + "listEvaluationDatasetsStream", + "listEvaluationDatasetsAsync" + ] + }, + "ListEvaluationRuns": { + "methods": [ + "listEvaluationRuns", + "listEvaluationRunsStream", + "listEvaluationRunsAsync" + ] + }, + "ListEvaluationExpectations": { + "methods": [ + "listEvaluationExpectations", + "listEvaluationExpectationsStream", + "listEvaluationExpectationsAsync" + ] + }, + "ListScheduledEvaluationRuns": { + "methods": [ + "listScheduledEvaluationRuns", + "listScheduledEvaluationRunsStream", + "listScheduledEvaluationRunsAsync" + ] + } + } + } + } + }, + "SessionService": { + "clients": { + "grpc": { + "libraryClient": "SessionServiceClient", + "rpcs": { + "RunSession": { + "methods": [ + "runSession" + ] + }, + "BidiRunSession": { + "methods": [ + "bidiRunSession" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SessionServiceClient", + "rpcs": { + "RunSession": { + "methods": [ + "runSession" + ] + } + } + } + } + }, + "ToolService": { + "clients": { + "grpc": { + "libraryClient": "ToolServiceClient", + "rpcs": { + "ExecuteTool": { + "methods": [ + "executeTool" + ] + }, + "RetrieveToolSchema": { + "methods": [ + "retrieveToolSchema" + ] + }, + "RetrieveTools": { + "methods": [ + "retrieveTools" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ToolServiceClient", + "rpcs": { + "ExecuteTool": { + "methods": [ + "executeTool" + ] + }, + "RetrieveToolSchema": { + "methods": [ + "retrieveToolSchema" + ] + }, + "RetrieveTools": { + "methods": [ + "retrieveTools" + ] + } + } + } + } + }, + "WidgetService": { + "clients": { + "grpc": { + "libraryClient": "WidgetServiceClient", + "rpcs": { + "GenerateChatToken": { + "methods": [ + "generateChatToken" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "WidgetServiceClient", + "rpcs": { + "GenerateChatToken": { + "methods": [ + "generateChatToken" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/index.ts b/owl-bot-staging/google-cloud-ces/src/v1beta/index.ts new file mode 100644 index 00000000000..42842d77fec --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1beta/index.ts @@ -0,0 +1,23 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {AgentServiceClient} from './agent_service_client'; +export {EvaluationServiceClient} from './evaluation_service_client'; +export {SessionServiceClient} from './session_service_client'; +export {ToolServiceClient} from './tool_service_client'; +export {WidgetServiceClient} from './widget_service_client'; diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/session_service_client.ts b/owl-bot-staging/google-cloud-ces/src/v1beta/session_service_client.ts new file mode 100644 index 00000000000..20b87294c4a --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1beta/session_service_client.ts @@ -0,0 +1,1787 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, LocationsClient, LocationProtos} from 'google-gax'; +import {PassThrough} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1beta/session_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './session_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Session service provides APIs for interacting with CES agents. + * @class + * @memberof v1beta + */ +export class SessionServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('ces'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + sessionServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SessionServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SessionServiceClient({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 SessionServiceClient; + 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 = 'ces.' + 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.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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/agents/{agent}' + ), + appPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}' + ), + appVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/versions/{version}' + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}' + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}' + ), + evaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}' + ), + evaluationDatasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluationDatasets/{evaluation_dataset}' + ), + evaluationExpectationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluationExpectations/{evaluation_expectation}' + ), + evaluationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}/results/{evaluation_result}' + ), + evaluationRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluationRuns/{evaluation_run}' + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/examples/{example}' + ), + guardrailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}' + ), + omnichannelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/omnichannels/{omnichannel}' + ), + scheduledEvaluationRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/scheduledEvaluationRuns/{scheduled_evaluation_run}' + ), + sessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/sessions/{session}' + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/tools/{tool}' + ), + toolsetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}' + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + bidiRunSession: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.ces.v1beta.SessionService', 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.sessionServiceStub) { + return this.sessionServiceStub; + } + + // Put together the "service stub" for + // google.cloud.ces.v1beta.SessionService. + this.sessionServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.ces.v1beta.SessionService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.ces.v1beta.SessionService, + 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 sessionServiceStubMethods = + ['runSession', 'bidiRunSession']; + for (const methodName of sessionServiceStubMethods) { + const callPromise = this.sessionServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({objectMode: true}); + setImmediate(() => { + stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); + }); + return stream; + } + 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.stream[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.sessionServiceStub; + } + + /** + * 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 'ces.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 'ces.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/ces', + '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 -- + // ------------------- +/** + * Initiates a single turn interaction with the CES agent within a + * session. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1beta.SessionConfig} request.config + * Required. The configuration for the session. + * @param {number[]} request.inputs + * Required. Inputs for the session. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.RunSessionResponse|RunSessionResponse}. + * 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/session_service.run_session.js + * region_tag:ces_v1beta_generated_SessionService_RunSession_async + */ + runSession( + request?: protos.google.cloud.ces.v1beta.IRunSessionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IRunSessionResponse, + protos.google.cloud.ces.v1beta.IRunSessionRequest|undefined, {}|undefined + ]>; + runSession( + request: protos.google.cloud.ces.v1beta.IRunSessionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IRunSessionResponse, + protos.google.cloud.ces.v1beta.IRunSessionRequest|null|undefined, + {}|null|undefined>): void; + runSession( + request: protos.google.cloud.ces.v1beta.IRunSessionRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IRunSessionResponse, + protos.google.cloud.ces.v1beta.IRunSessionRequest|null|undefined, + {}|null|undefined>): void; + runSession( + request?: protos.google.cloud.ces.v1beta.IRunSessionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IRunSessionResponse, + protos.google.cloud.ces.v1beta.IRunSessionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IRunSessionResponse, + protos.google.cloud.ces.v1beta.IRunSessionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IRunSessionResponse, + protos.google.cloud.ces.v1beta.IRunSessionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'config.session': request.config!.session ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('runSession request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IRunSessionResponse, + protos.google.cloud.ces.v1beta.IRunSessionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('runSession response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.runSession(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IRunSessionResponse, + protos.google.cloud.ces.v1beta.IRunSessionRequest|undefined, + {}|undefined + ]) => { + this._log.info('runSession response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Establishes a bidirectional streaming connection with the CES agent. + * The agent processes continuous multimodal inputs (e.g., text, audio) and + * generates real-time multimodal output streams. + * + * --- Client Request Stream --- + * The client streams requests in the following order: + * + * 1. Initialization: + * The first message must contain + * {@link protos.google.cloud.ces.v1beta.BidiSessionClientMessage.config|SessionConfig}. + * For audio sessions, this should also include + * {@link protos.google.cloud.ces.v1beta.SessionConfig.input_audio_config|InputAudioConfig} + * and + * {@link protos.google.cloud.ces.v1beta.SessionConfig.output_audio_config|OutputAudioConfig} + * to define audio processing and synthesis parameters. + * + * 2. Interaction: + * Subsequent messages stream + * {@link protos.google.cloud.ces.v1beta.BidiSessionClientMessage.realtime_input|SessionInput} + * containing real-time user input data. + * + * 3. Termination: + * The client should half-close the stream when there is no more user + * input. It should also half-close upon receiving + * {@link protos.google.cloud.ces.v1beta.BidiSessionServerMessage.end_session|EndSession} + * or {@link protos.google.cloud.ces.v1beta.BidiSessionServerMessage.go_away|GoAway} + * from the agent. + * + * --- Server Response Stream --- + * For each interaction turn, the agent streams messages in the following + * sequence: + * + * 1. Speech Recognition (First N messages): + * Contains + * {@link protos.google.cloud.ces.v1beta.BidiSessionServerMessage.recognition_result|RecognitionResult} + * representing the concatenated user speech segments captured so far. + * This is only populated for audio sessions. + * + * 2. Response (Next M messages): + * Contains + * {@link protos.google.cloud.ces.v1beta.BidiSessionServerMessage.session_output|SessionOutput} + * delivering the agent's response in various modalities (e.g., text, + * audio). + * + * 3. Turn Completion (Final message of the turn): + * Contains + * {@link protos.google.cloud.ces.v1beta.BidiSessionServerMessage.session_output|SessionOutput} + * with + * {@link protos.google.cloud.ces.v1beta.SessionOutput.turn_completed|turn_completed} + * set to true. This signals the end of the current turn and includes + * {@link protos.google.cloud.ces.v1beta.SessionOutput.diagnostic_info|DiagnosticInfo} + * with execution details. + * + * --- Audio Best Practices --- + * 1. Streaming: + * Stream {@link protos.google.cloud.ces.v1beta.SessionInput.audio|audio data} + * **CONTINUOUSLY**, even during silence. Recommended chunk size: 40-120ms + * (balances latency vs. efficiency). + * + * 2. Playback & Interruption: + * Play {@link protos.google.cloud.ces.v1beta.SessionOutput.audio|audio responses} + * upon receipt. Stop playback immediately if an + * {@link protos.google.cloud.ces.v1beta.BidiSessionServerMessage.interruption_signal|InterruptionSignal} + * is received (e.g., user barge-in or new agent response). + * + * @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 is both readable and writable. It accepts objects + * representing {@link protos.google.cloud.ces.v1beta.BidiSessionClientMessage|BidiSessionClientMessage} for write() method, and + * will emit objects representing {@link protos.google.cloud.ces.v1beta.BidiSessionServerMessage|BidiSessionServerMessage} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/session_service.bidi_run_session.js + * region_tag:ces_v1beta_generated_SessionService_BidiRunSession_async + */ + bidiRunSession( + options?: CallOptions): + gax.CancellableStream { + this.initialize().catch(err => {throw err}); + this._log.info('bidiRunSession stream %j', options); + return this.innerApiCalls.bidiRunSession(null, options); + } + +/** + * 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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project:string,location:string,app:string,agent:string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + app: app, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the app from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the app. + */ + matchAppFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).app; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified app resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @returns {string} Resource name string. + */ + appPath(project:string,location:string,app:string) { + return this.pathTemplates.appPathTemplate.render({ + project: project, + location: location, + app: app, + }); + } + + /** + * Parse the project from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).project; + } + + /** + * Parse the location from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).location; + } + + /** + * Parse the app from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the app. + */ + matchAppFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).app; + } + + /** + * Return a fully-qualified appVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} version + * @returns {string} Resource name string. + */ + appVersionPath(project:string,location:string,app:string,version:string) { + return this.pathTemplates.appVersionPathTemplate.render({ + project: project, + location: location, + app: app, + version: version, + }); + } + + /** + * Parse the project from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).project; + } + + /** + * Parse the location from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).location; + } + + /** + * Parse the app from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the app. + */ + matchAppFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).app; + } + + /** + * Parse the version from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).version; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath(project:string,location:string,app:string,changelog:string) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + app: app, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).location; + } + + /** + * Parse the app from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the app. + */ + matchAppFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).app; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).changelog; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath(project:string,location:string,app:string,conversation:string) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + app: app, + conversation: conversation, + }); + } + + /** + * Parse the project from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).project; + } + + /** + * Parse the location from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).location; + } + + /** + * Parse the app from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the app. + */ + matchAppFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).app; + } + + /** + * Parse the conversation from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).conversation; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,app:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + app: app, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the app from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the app. + */ + matchAppFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).app; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified evaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation + * @returns {string} Resource name string. + */ + evaluationPath(project:string,location:string,app:string,evaluation:string) { + return this.pathTemplates.evaluationPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation: evaluation, + }); + } + + /** + * Parse the project from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project; + } + + /** + * Parse the location from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location; + } + + /** + * Parse the app from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).app; + } + + /** + * Parse the evaluation from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation; + } + + /** + * Return a fully-qualified evaluationDataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation_dataset + * @returns {string} Resource name string. + */ + evaluationDatasetPath(project:string,location:string,app:string,evaluationDataset:string) { + return this.pathTemplates.evaluationDatasetPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation_dataset: evaluationDataset, + }); + } + + /** + * Parse the project from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).project; + } + + /** + * Parse the location from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).location; + } + + /** + * Parse the app from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).app; + } + + /** + * Parse the evaluation_dataset from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the evaluation_dataset. + */ + matchEvaluationDatasetFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).evaluation_dataset; + } + + /** + * Return a fully-qualified evaluationExpectation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation_expectation + * @returns {string} Resource name string. + */ + evaluationExpectationPath(project:string,location:string,app:string,evaluationExpectation:string) { + return this.pathTemplates.evaluationExpectationPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation_expectation: evaluationExpectation, + }); + } + + /** + * Parse the project from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).project; + } + + /** + * Parse the location from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).location; + } + + /** + * Parse the app from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).app; + } + + /** + * Parse the evaluation_expectation from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the evaluation_expectation. + */ + matchEvaluationExpectationFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).evaluation_expectation; + } + + /** + * Return a fully-qualified evaluationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation + * @param {string} evaluation_result + * @returns {string} Resource name string. + */ + evaluationResultPath(project:string,location:string,app:string,evaluation:string,evaluationResult:string) { + return this.pathTemplates.evaluationResultPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation: evaluation, + evaluation_result: evaluationResult, + }); + } + + /** + * Parse the project from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).project; + } + + /** + * Parse the location from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).location; + } + + /** + * Parse the app from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).app; + } + + /** + * Parse the evaluation from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).evaluation; + } + + /** + * Parse the evaluation_result from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the evaluation_result. + */ + matchEvaluationResultFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).evaluation_result; + } + + /** + * Return a fully-qualified evaluationRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation_run + * @returns {string} Resource name string. + */ + evaluationRunPath(project:string,location:string,app:string,evaluationRun:string) { + return this.pathTemplates.evaluationRunPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation_run: evaluationRun, + }); + } + + /** + * Parse the project from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).project; + } + + /** + * Parse the location from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).location; + } + + /** + * Parse the app from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).app; + } + + /** + * Parse the evaluation_run from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the evaluation_run. + */ + matchEvaluationRunFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).evaluation_run; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath(project:string,location:string,app:string,example:string) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + app: app, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the app from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the app. + */ + matchAppFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).app; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified guardrail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} guardrail + * @returns {string} Resource name string. + */ + guardrailPath(project:string,location:string,app:string,guardrail:string) { + return this.pathTemplates.guardrailPathTemplate.render({ + project: project, + location: location, + app: app, + guardrail: guardrail, + }); + } + + /** + * Parse the project from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).project; + } + + /** + * Parse the location from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).location; + } + + /** + * Parse the app from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the app. + */ + matchAppFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).app; + } + + /** + * Parse the guardrail from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the guardrail. + */ + matchGuardrailFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).guardrail; + } + + /** + * Return a fully-qualified omnichannel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} omnichannel + * @returns {string} Resource name string. + */ + omnichannelPath(project:string,location:string,omnichannel:string) { + return this.pathTemplates.omnichannelPathTemplate.render({ + project: project, + location: location, + omnichannel: omnichannel, + }); + } + + /** + * Parse the project from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).project; + } + + /** + * Parse the location from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).location; + } + + /** + * Parse the omnichannel from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the omnichannel. + */ + matchOmnichannelFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).omnichannel; + } + + /** + * Return a fully-qualified scheduledEvaluationRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} scheduled_evaluation_run + * @returns {string} Resource name string. + */ + scheduledEvaluationRunPath(project:string,location:string,app:string,scheduledEvaluationRun:string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.render({ + project: project, + location: location, + app: app, + scheduled_evaluation_run: scheduledEvaluationRun, + }); + } + + /** + * Parse the project from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).project; + } + + /** + * Parse the location from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).location; + } + + /** + * Parse the app from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the app. + */ + matchAppFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).app; + } + + /** + * Parse the scheduled_evaluation_run from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the scheduled_evaluation_run. + */ + matchScheduledEvaluationRunFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).scheduled_evaluation_run; + } + + /** + * Return a fully-qualified session resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} session + * @returns {string} Resource name string. + */ + sessionPath(project:string,location:string,app:string,session:string) { + return this.pathTemplates.sessionPathTemplate.render({ + project: project, + location: location, + app: app, + session: session, + }); + } + + /** + * Parse the project from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).project; + } + + /** + * Parse the location from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).location; + } + + /** + * Parse the app from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the app. + */ + matchAppFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).app; + } + + /** + * Parse the session from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).session; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project:string,location:string,app:string,tool:string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + app: app, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the app from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the app. + */ + matchAppFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).app; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} toolset + * @returns {string} Resource name string. + */ + toolsetPath(project:string,location:string,app:string,toolset:string) { + return this.pathTemplates.toolsetPathTemplate.render({ + project: project, + location: location, + app: app, + toolset: toolset, + }); + } + + /** + * Parse the project from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).project; + } + + /** + * Parse the location from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).location; + } + + /** + * Parse the app from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the app. + */ + matchAppFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).app; + } + + /** + * Parse the toolset from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the toolset. + */ + matchToolsetFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).toolset; + } + + /** + * 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.sessionServiceStub && !this._terminated) { + return this.sessionServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/session_service_client_config.json b/owl-bot-staging/google-cloud-ces/src/v1beta/session_service_client_config.json new file mode 100644 index 00000000000..49d54f49e29 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1beta/session_service_client_config.json @@ -0,0 +1,36 @@ +{ + "interfaces": { + "google.cloud.ces.v1beta.SessionService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "RunSession": { + "timeout_millis": 220000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BidiRunSession": { + "timeout_millis": 3600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/session_service_proto_list.json b/owl-bot-staging/google-cloud-ces/src/v1beta/session_service_proto_list.json new file mode 100644 index 00000000000..19d10d699ff --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1beta/session_service_proto_list.json @@ -0,0 +1,43 @@ +[ + "../../protos/google/cloud/ces/v1beta/agent.proto", + "../../protos/google/cloud/ces/v1beta/agent_service.proto", + "../../protos/google/cloud/ces/v1beta/agent_transfers.proto", + "../../protos/google/cloud/ces/v1beta/app.proto", + "../../protos/google/cloud/ces/v1beta/app_version.proto", + "../../protos/google/cloud/ces/v1beta/auth.proto", + "../../protos/google/cloud/ces/v1beta/bigquery_export.proto", + "../../protos/google/cloud/ces/v1beta/changelog.proto", + "../../protos/google/cloud/ces/v1beta/client_function.proto", + "../../protos/google/cloud/ces/v1beta/common.proto", + "../../protos/google/cloud/ces/v1beta/connector_tool.proto", + "../../protos/google/cloud/ces/v1beta/connector_toolset.proto", + "../../protos/google/cloud/ces/v1beta/conversation.proto", + "../../protos/google/cloud/ces/v1beta/data_store.proto", + "../../protos/google/cloud/ces/v1beta/data_store_tool.proto", + "../../protos/google/cloud/ces/v1beta/deployment.proto", + "../../protos/google/cloud/ces/v1beta/evaluation.proto", + "../../protos/google/cloud/ces/v1beta/evaluation_service.proto", + "../../protos/google/cloud/ces/v1beta/example.proto", + "../../protos/google/cloud/ces/v1beta/fakes.proto", + "../../protos/google/cloud/ces/v1beta/file_search_tool.proto", + "../../protos/google/cloud/ces/v1beta/golden_run.proto", + "../../protos/google/cloud/ces/v1beta/google_search_tool.proto", + "../../protos/google/cloud/ces/v1beta/guardrail.proto", + "../../protos/google/cloud/ces/v1beta/mcp_tool.proto", + "../../protos/google/cloud/ces/v1beta/mcp_toolset.proto", + "../../protos/google/cloud/ces/v1beta/omnichannel.proto", + "../../protos/google/cloud/ces/v1beta/omnichannel_service.proto", + "../../protos/google/cloud/ces/v1beta/open_api_tool.proto", + "../../protos/google/cloud/ces/v1beta/open_api_toolset.proto", + "../../protos/google/cloud/ces/v1beta/python_function.proto", + "../../protos/google/cloud/ces/v1beta/schema.proto", + "../../protos/google/cloud/ces/v1beta/search_suggestions.proto", + "../../protos/google/cloud/ces/v1beta/session_service.proto", + "../../protos/google/cloud/ces/v1beta/system_tool.proto", + "../../protos/google/cloud/ces/v1beta/tool.proto", + "../../protos/google/cloud/ces/v1beta/tool_service.proto", + "../../protos/google/cloud/ces/v1beta/toolset.proto", + "../../protos/google/cloud/ces/v1beta/toolset_tool.proto", + "../../protos/google/cloud/ces/v1beta/widget_service.proto", + "../../protos/google/cloud/ces/v1beta/widget_tool.proto" +] diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/tool_service_client.ts b/owl-bot-staging/google-cloud-ces/src/v1beta/tool_service_client.ts new file mode 100644 index 00000000000..55276886886 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1beta/tool_service_client.ts @@ -0,0 +1,1836 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, LocationsClient, LocationProtos} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1beta/tool_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './tool_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Tool service provides APIs for interacting with CES tools. + * @class + * @memberof v1beta + */ +export class ToolServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('ces'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + toolServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ToolServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ToolServiceClient({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 ToolServiceClient; + 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 = 'ces.' + 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.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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/agents/{agent}' + ), + appPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}' + ), + appVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/versions/{version}' + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}' + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}' + ), + evaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}' + ), + evaluationDatasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluationDatasets/{evaluation_dataset}' + ), + evaluationExpectationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluationExpectations/{evaluation_expectation}' + ), + evaluationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}/results/{evaluation_result}' + ), + evaluationRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluationRuns/{evaluation_run}' + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/examples/{example}' + ), + guardrailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}' + ), + omnichannelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/omnichannels/{omnichannel}' + ), + scheduledEvaluationRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/scheduledEvaluationRuns/{scheduled_evaluation_run}' + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/tools/{tool}' + ), + toolsetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.ces.v1beta.ToolService', 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.toolServiceStub) { + return this.toolServiceStub; + } + + // Put together the "service stub" for + // google.cloud.ces.v1beta.ToolService. + this.toolServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.ces.v1beta.ToolService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.ces.v1beta.ToolService, + 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 toolServiceStubMethods = + ['executeTool', 'retrieveToolSchema', 'retrieveTools']; + for (const methodName of toolServiceStubMethods) { + const callPromise = this.toolServiceStub.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 = + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.toolServiceStub; + } + + /** + * 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 'ces.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 'ces.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/ces', + '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 -- + // ------------------- +/** + * Executes the given tool with the given arguments. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.tool] + * Optional. The name of the tool to execute. + * Format: + * projects/{project}/locations/{location}/apps/{app}/tools/{tool} + * @param {google.cloud.ces.v1beta.ToolsetTool} [request.toolsetTool] + * Optional. The toolset tool to execute. Only one tool should match the + * predicate from the toolset. Otherwise, an error will be returned. + * @param {string} request.parent + * Required. The resource name of the app which the tool/toolset belongs to. + * Format: `projects/{project}/locations/{location}/apps/{app}` + * @param {google.protobuf.Struct} [request.args] + * Optional. The input parameters and values for the tool in JSON object + * format. + * @param {google.protobuf.Struct} [request.variables] + * Optional. The variables that are available for the tool execution. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.ExecuteToolResponse|ExecuteToolResponse}. + * 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/tool_service.execute_tool.js + * region_tag:ces_v1beta_generated_ToolService_ExecuteTool_async + */ + executeTool( + request?: protos.google.cloud.ces.v1beta.IExecuteToolRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IExecuteToolResponse, + protos.google.cloud.ces.v1beta.IExecuteToolRequest|undefined, {}|undefined + ]>; + executeTool( + request: protos.google.cloud.ces.v1beta.IExecuteToolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IExecuteToolResponse, + protos.google.cloud.ces.v1beta.IExecuteToolRequest|null|undefined, + {}|null|undefined>): void; + executeTool( + request: protos.google.cloud.ces.v1beta.IExecuteToolRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IExecuteToolResponse, + protos.google.cloud.ces.v1beta.IExecuteToolRequest|null|undefined, + {}|null|undefined>): void; + executeTool( + request?: protos.google.cloud.ces.v1beta.IExecuteToolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IExecuteToolResponse, + protos.google.cloud.ces.v1beta.IExecuteToolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IExecuteToolResponse, + protos.google.cloud.ces.v1beta.IExecuteToolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IExecuteToolResponse, + protos.google.cloud.ces.v1beta.IExecuteToolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('executeTool request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IExecuteToolResponse, + protos.google.cloud.ces.v1beta.IExecuteToolRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('executeTool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.executeTool(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IExecuteToolResponse, + protos.google.cloud.ces.v1beta.IExecuteToolRequest|undefined, + {}|undefined + ]) => { + this._log.info('executeTool response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Retrieve the schema of the given tool. The schema is computed on the fly + * for the given instance of the tool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.tool] + * Optional. The name of the tool to retrieve the schema for. + * Format: + * projects/{project}/locations/{location}/apps/{app}/tools/{tool} + * @param {google.cloud.ces.v1beta.ToolsetTool} [request.toolsetTool] + * Optional. The toolset tool to retrieve the schema for. Only one tool + * should match the predicate from the toolset. Otherwise, an error will be + * returned. + * @param {string} request.parent + * Required. The resource name of the app which the tool/toolset belongs to. + * Format: `projects/{project}/locations/{location}/apps/{app}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.RetrieveToolSchemaResponse|RetrieveToolSchemaResponse}. + * 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/tool_service.retrieve_tool_schema.js + * region_tag:ces_v1beta_generated_ToolService_RetrieveToolSchema_async + */ + retrieveToolSchema( + request?: protos.google.cloud.ces.v1beta.IRetrieveToolSchemaRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IRetrieveToolSchemaResponse, + protos.google.cloud.ces.v1beta.IRetrieveToolSchemaRequest|undefined, {}|undefined + ]>; + retrieveToolSchema( + request: protos.google.cloud.ces.v1beta.IRetrieveToolSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IRetrieveToolSchemaResponse, + protos.google.cloud.ces.v1beta.IRetrieveToolSchemaRequest|null|undefined, + {}|null|undefined>): void; + retrieveToolSchema( + request: protos.google.cloud.ces.v1beta.IRetrieveToolSchemaRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IRetrieveToolSchemaResponse, + protos.google.cloud.ces.v1beta.IRetrieveToolSchemaRequest|null|undefined, + {}|null|undefined>): void; + retrieveToolSchema( + request?: protos.google.cloud.ces.v1beta.IRetrieveToolSchemaRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IRetrieveToolSchemaResponse, + protos.google.cloud.ces.v1beta.IRetrieveToolSchemaRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IRetrieveToolSchemaResponse, + protos.google.cloud.ces.v1beta.IRetrieveToolSchemaRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IRetrieveToolSchemaResponse, + protos.google.cloud.ces.v1beta.IRetrieveToolSchemaRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('retrieveToolSchema request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IRetrieveToolSchemaResponse, + protos.google.cloud.ces.v1beta.IRetrieveToolSchemaRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('retrieveToolSchema response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.retrieveToolSchema(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IRetrieveToolSchemaResponse, + protos.google.cloud.ces.v1beta.IRetrieveToolSchemaRequest|undefined, + {}|undefined + ]) => { + this._log.info('retrieveToolSchema response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Retrieve the list of tools included in the specified toolset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.toolset + * Required. The name of the toolset to retrieve the tools for. + * Format: + * `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + * @param {string[]} [request.toolIds] + * Optional. The identifiers of the tools to retrieve from the toolset. + * If empty, all tools in the toolset 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 {@link protos.google.cloud.ces.v1beta.RetrieveToolsResponse|RetrieveToolsResponse}. + * 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/tool_service.retrieve_tools.js + * region_tag:ces_v1beta_generated_ToolService_RetrieveTools_async + */ + retrieveTools( + request?: protos.google.cloud.ces.v1beta.IRetrieveToolsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IRetrieveToolsResponse, + protos.google.cloud.ces.v1beta.IRetrieveToolsRequest|undefined, {}|undefined + ]>; + retrieveTools( + request: protos.google.cloud.ces.v1beta.IRetrieveToolsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IRetrieveToolsResponse, + protos.google.cloud.ces.v1beta.IRetrieveToolsRequest|null|undefined, + {}|null|undefined>): void; + retrieveTools( + request: protos.google.cloud.ces.v1beta.IRetrieveToolsRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IRetrieveToolsResponse, + protos.google.cloud.ces.v1beta.IRetrieveToolsRequest|null|undefined, + {}|null|undefined>): void; + retrieveTools( + request?: protos.google.cloud.ces.v1beta.IRetrieveToolsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IRetrieveToolsResponse, + protos.google.cloud.ces.v1beta.IRetrieveToolsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IRetrieveToolsResponse, + protos.google.cloud.ces.v1beta.IRetrieveToolsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IRetrieveToolsResponse, + protos.google.cloud.ces.v1beta.IRetrieveToolsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'toolset': request.toolset ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('retrieveTools request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IRetrieveToolsResponse, + protos.google.cloud.ces.v1beta.IRetrieveToolsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('retrieveTools response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.retrieveTools(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IRetrieveToolsResponse, + protos.google.cloud.ces.v1beta.IRetrieveToolsRequest|undefined, + {}|undefined + ]) => { + this._log.info('retrieveTools response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Gets 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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project:string,location:string,app:string,agent:string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + app: app, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the app from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the app. + */ + matchAppFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).app; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified app resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @returns {string} Resource name string. + */ + appPath(project:string,location:string,app:string) { + return this.pathTemplates.appPathTemplate.render({ + project: project, + location: location, + app: app, + }); + } + + /** + * Parse the project from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).project; + } + + /** + * Parse the location from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).location; + } + + /** + * Parse the app from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the app. + */ + matchAppFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).app; + } + + /** + * Return a fully-qualified appVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} version + * @returns {string} Resource name string. + */ + appVersionPath(project:string,location:string,app:string,version:string) { + return this.pathTemplates.appVersionPathTemplate.render({ + project: project, + location: location, + app: app, + version: version, + }); + } + + /** + * Parse the project from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).project; + } + + /** + * Parse the location from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).location; + } + + /** + * Parse the app from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the app. + */ + matchAppFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).app; + } + + /** + * Parse the version from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).version; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath(project:string,location:string,app:string,changelog:string) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + app: app, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).location; + } + + /** + * Parse the app from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the app. + */ + matchAppFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).app; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).changelog; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath(project:string,location:string,app:string,conversation:string) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + app: app, + conversation: conversation, + }); + } + + /** + * Parse the project from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).project; + } + + /** + * Parse the location from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).location; + } + + /** + * Parse the app from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the app. + */ + matchAppFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).app; + } + + /** + * Parse the conversation from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).conversation; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,app:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + app: app, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the app from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the app. + */ + matchAppFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).app; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified evaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation + * @returns {string} Resource name string. + */ + evaluationPath(project:string,location:string,app:string,evaluation:string) { + return this.pathTemplates.evaluationPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation: evaluation, + }); + } + + /** + * Parse the project from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project; + } + + /** + * Parse the location from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location; + } + + /** + * Parse the app from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).app; + } + + /** + * Parse the evaluation from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation; + } + + /** + * Return a fully-qualified evaluationDataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation_dataset + * @returns {string} Resource name string. + */ + evaluationDatasetPath(project:string,location:string,app:string,evaluationDataset:string) { + return this.pathTemplates.evaluationDatasetPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation_dataset: evaluationDataset, + }); + } + + /** + * Parse the project from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).project; + } + + /** + * Parse the location from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).location; + } + + /** + * Parse the app from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).app; + } + + /** + * Parse the evaluation_dataset from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the evaluation_dataset. + */ + matchEvaluationDatasetFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).evaluation_dataset; + } + + /** + * Return a fully-qualified evaluationExpectation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation_expectation + * @returns {string} Resource name string. + */ + evaluationExpectationPath(project:string,location:string,app:string,evaluationExpectation:string) { + return this.pathTemplates.evaluationExpectationPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation_expectation: evaluationExpectation, + }); + } + + /** + * Parse the project from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).project; + } + + /** + * Parse the location from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).location; + } + + /** + * Parse the app from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).app; + } + + /** + * Parse the evaluation_expectation from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the evaluation_expectation. + */ + matchEvaluationExpectationFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).evaluation_expectation; + } + + /** + * Return a fully-qualified evaluationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation + * @param {string} evaluation_result + * @returns {string} Resource name string. + */ + evaluationResultPath(project:string,location:string,app:string,evaluation:string,evaluationResult:string) { + return this.pathTemplates.evaluationResultPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation: evaluation, + evaluation_result: evaluationResult, + }); + } + + /** + * Parse the project from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).project; + } + + /** + * Parse the location from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).location; + } + + /** + * Parse the app from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).app; + } + + /** + * Parse the evaluation from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).evaluation; + } + + /** + * Parse the evaluation_result from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the evaluation_result. + */ + matchEvaluationResultFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).evaluation_result; + } + + /** + * Return a fully-qualified evaluationRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation_run + * @returns {string} Resource name string. + */ + evaluationRunPath(project:string,location:string,app:string,evaluationRun:string) { + return this.pathTemplates.evaluationRunPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation_run: evaluationRun, + }); + } + + /** + * Parse the project from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).project; + } + + /** + * Parse the location from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).location; + } + + /** + * Parse the app from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).app; + } + + /** + * Parse the evaluation_run from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the evaluation_run. + */ + matchEvaluationRunFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).evaluation_run; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath(project:string,location:string,app:string,example:string) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + app: app, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the app from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the app. + */ + matchAppFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).app; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified guardrail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} guardrail + * @returns {string} Resource name string. + */ + guardrailPath(project:string,location:string,app:string,guardrail:string) { + return this.pathTemplates.guardrailPathTemplate.render({ + project: project, + location: location, + app: app, + guardrail: guardrail, + }); + } + + /** + * Parse the project from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).project; + } + + /** + * Parse the location from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).location; + } + + /** + * Parse the app from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the app. + */ + matchAppFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).app; + } + + /** + * Parse the guardrail from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the guardrail. + */ + matchGuardrailFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).guardrail; + } + + /** + * Return a fully-qualified omnichannel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} omnichannel + * @returns {string} Resource name string. + */ + omnichannelPath(project:string,location:string,omnichannel:string) { + return this.pathTemplates.omnichannelPathTemplate.render({ + project: project, + location: location, + omnichannel: omnichannel, + }); + } + + /** + * Parse the project from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).project; + } + + /** + * Parse the location from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).location; + } + + /** + * Parse the omnichannel from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the omnichannel. + */ + matchOmnichannelFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).omnichannel; + } + + /** + * Return a fully-qualified scheduledEvaluationRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} scheduled_evaluation_run + * @returns {string} Resource name string. + */ + scheduledEvaluationRunPath(project:string,location:string,app:string,scheduledEvaluationRun:string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.render({ + project: project, + location: location, + app: app, + scheduled_evaluation_run: scheduledEvaluationRun, + }); + } + + /** + * Parse the project from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).project; + } + + /** + * Parse the location from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).location; + } + + /** + * Parse the app from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the app. + */ + matchAppFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).app; + } + + /** + * Parse the scheduled_evaluation_run from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the scheduled_evaluation_run. + */ + matchScheduledEvaluationRunFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).scheduled_evaluation_run; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project:string,location:string,app:string,tool:string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + app: app, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the app from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the app. + */ + matchAppFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).app; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} toolset + * @returns {string} Resource name string. + */ + toolsetPath(project:string,location:string,app:string,toolset:string) { + return this.pathTemplates.toolsetPathTemplate.render({ + project: project, + location: location, + app: app, + toolset: toolset, + }); + } + + /** + * Parse the project from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).project; + } + + /** + * Parse the location from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).location; + } + + /** + * Parse the app from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the app. + */ + matchAppFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).app; + } + + /** + * Parse the toolset from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the toolset. + */ + matchToolsetFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).toolset; + } + + /** + * 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.toolServiceStub && !this._terminated) { + return this.toolServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/tool_service_client_config.json b/owl-bot-staging/google-cloud-ces/src/v1beta/tool_service_client_config.json new file mode 100644 index 00000000000..d3868c53fe8 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1beta/tool_service_client_config.json @@ -0,0 +1,41 @@ +{ + "interfaces": { + "google.cloud.ces.v1beta.ToolService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ExecuteTool": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "RetrieveToolSchema": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "RetrieveTools": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/tool_service_proto_list.json b/owl-bot-staging/google-cloud-ces/src/v1beta/tool_service_proto_list.json new file mode 100644 index 00000000000..19d10d699ff --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1beta/tool_service_proto_list.json @@ -0,0 +1,43 @@ +[ + "../../protos/google/cloud/ces/v1beta/agent.proto", + "../../protos/google/cloud/ces/v1beta/agent_service.proto", + "../../protos/google/cloud/ces/v1beta/agent_transfers.proto", + "../../protos/google/cloud/ces/v1beta/app.proto", + "../../protos/google/cloud/ces/v1beta/app_version.proto", + "../../protos/google/cloud/ces/v1beta/auth.proto", + "../../protos/google/cloud/ces/v1beta/bigquery_export.proto", + "../../protos/google/cloud/ces/v1beta/changelog.proto", + "../../protos/google/cloud/ces/v1beta/client_function.proto", + "../../protos/google/cloud/ces/v1beta/common.proto", + "../../protos/google/cloud/ces/v1beta/connector_tool.proto", + "../../protos/google/cloud/ces/v1beta/connector_toolset.proto", + "../../protos/google/cloud/ces/v1beta/conversation.proto", + "../../protos/google/cloud/ces/v1beta/data_store.proto", + "../../protos/google/cloud/ces/v1beta/data_store_tool.proto", + "../../protos/google/cloud/ces/v1beta/deployment.proto", + "../../protos/google/cloud/ces/v1beta/evaluation.proto", + "../../protos/google/cloud/ces/v1beta/evaluation_service.proto", + "../../protos/google/cloud/ces/v1beta/example.proto", + "../../protos/google/cloud/ces/v1beta/fakes.proto", + "../../protos/google/cloud/ces/v1beta/file_search_tool.proto", + "../../protos/google/cloud/ces/v1beta/golden_run.proto", + "../../protos/google/cloud/ces/v1beta/google_search_tool.proto", + "../../protos/google/cloud/ces/v1beta/guardrail.proto", + "../../protos/google/cloud/ces/v1beta/mcp_tool.proto", + "../../protos/google/cloud/ces/v1beta/mcp_toolset.proto", + "../../protos/google/cloud/ces/v1beta/omnichannel.proto", + "../../protos/google/cloud/ces/v1beta/omnichannel_service.proto", + "../../protos/google/cloud/ces/v1beta/open_api_tool.proto", + "../../protos/google/cloud/ces/v1beta/open_api_toolset.proto", + "../../protos/google/cloud/ces/v1beta/python_function.proto", + "../../protos/google/cloud/ces/v1beta/schema.proto", + "../../protos/google/cloud/ces/v1beta/search_suggestions.proto", + "../../protos/google/cloud/ces/v1beta/session_service.proto", + "../../protos/google/cloud/ces/v1beta/system_tool.proto", + "../../protos/google/cloud/ces/v1beta/tool.proto", + "../../protos/google/cloud/ces/v1beta/tool_service.proto", + "../../protos/google/cloud/ces/v1beta/toolset.proto", + "../../protos/google/cloud/ces/v1beta/toolset_tool.proto", + "../../protos/google/cloud/ces/v1beta/widget_service.proto", + "../../protos/google/cloud/ces/v1beta/widget_tool.proto" +] diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/widget_service_client.ts b/owl-bot-staging/google-cloud-ces/src/v1beta/widget_service_client.ts new file mode 100644 index 00000000000..be4a2fcf3ca --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1beta/widget_service_client.ts @@ -0,0 +1,1694 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, LocationsClient, LocationProtos} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1beta/widget_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './widget_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Provides APIs for widgets to interact with CES APIs. + * @class + * @memberof v1beta + */ +export class WidgetServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('ces'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + widgetServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of WidgetServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new WidgetServiceClient({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 WidgetServiceClient; + 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 = 'ces.' + 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.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 = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/agents/{agent}' + ), + appPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}' + ), + appVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/versions/{version}' + ), + changelogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}' + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}' + ), + evaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}' + ), + evaluationDatasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluationDatasets/{evaluation_dataset}' + ), + evaluationExpectationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluationExpectations/{evaluation_expectation}' + ), + evaluationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}/results/{evaluation_result}' + ), + evaluationRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/evaluationRuns/{evaluation_run}' + ), + examplePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/examples/{example}' + ), + guardrailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}' + ), + omnichannelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/omnichannels/{omnichannel}' + ), + scheduledEvaluationRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/scheduledEvaluationRuns/{scheduled_evaluation_run}' + ), + sessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/sessions/{session}' + ), + toolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/tools/{tool}' + ), + toolsetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.ces.v1beta.WidgetService', 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.widgetServiceStub) { + return this.widgetServiceStub; + } + + // Put together the "service stub" for + // google.cloud.ces.v1beta.WidgetService. + this.widgetServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.ces.v1beta.WidgetService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.ces.v1beta.WidgetService, + 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 widgetServiceStubMethods = + ['generateChatToken']; + for (const methodName of widgetServiceStubMethods) { + const callPromise = this.widgetServiceStub.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 = + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.widgetServiceStub; + } + + /** + * 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 'ces.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 'ces.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/ces', + '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 -- + // ------------------- +/** + * Generates a session scoped token for chat widget to authenticate with + * Session APIs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The session name to generate the chat token for. + * Format: + * projects/{project}/locations/{location}/apps/{app}/sessions/{session} + * @param {string} request.deployment + * Required. The deployment of the app to use for the session. + * Format: + * projects/{project}/locations/{location}/apps/{app}/deployments/{deployment} + * @param {string} [request.recaptchaToken] + * Optional. The reCAPTCHA token generated by the client-side chat widget. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1beta.GenerateChatTokenResponse|GenerateChatTokenResponse}. + * 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/widget_service.generate_chat_token.js + * region_tag:ces_v1beta_generated_WidgetService_GenerateChatToken_async + */ + generateChatToken( + request?: protos.google.cloud.ces.v1beta.IGenerateChatTokenRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.ces.v1beta.IGenerateChatTokenResponse, + protos.google.cloud.ces.v1beta.IGenerateChatTokenRequest|undefined, {}|undefined + ]>; + generateChatToken( + request: protos.google.cloud.ces.v1beta.IGenerateChatTokenRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.ces.v1beta.IGenerateChatTokenResponse, + protos.google.cloud.ces.v1beta.IGenerateChatTokenRequest|null|undefined, + {}|null|undefined>): void; + generateChatToken( + request: protos.google.cloud.ces.v1beta.IGenerateChatTokenRequest, + callback: Callback< + protos.google.cloud.ces.v1beta.IGenerateChatTokenResponse, + protos.google.cloud.ces.v1beta.IGenerateChatTokenRequest|null|undefined, + {}|null|undefined>): void; + generateChatToken( + request?: protos.google.cloud.ces.v1beta.IGenerateChatTokenRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.ces.v1beta.IGenerateChatTokenResponse, + protos.google.cloud.ces.v1beta.IGenerateChatTokenRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.ces.v1beta.IGenerateChatTokenResponse, + protos.google.cloud.ces.v1beta.IGenerateChatTokenRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.ces.v1beta.IGenerateChatTokenResponse, + protos.google.cloud.ces.v1beta.IGenerateChatTokenRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('generateChatToken request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.ces.v1beta.IGenerateChatTokenResponse, + protos.google.cloud.ces.v1beta.IGenerateChatTokenRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateChatToken response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.generateChatToken(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.ces.v1beta.IGenerateChatTokenResponse, + protos.google.cloud.ces.v1beta.IGenerateChatTokenRequest|undefined, + {}|undefined + ]) => { + this._log.info('generateChatToken response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Gets 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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project:string,location:string,app:string,agent:string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + app: app, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the app from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the app. + */ + matchAppFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).app; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified app resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @returns {string} Resource name string. + */ + appPath(project:string,location:string,app:string) { + return this.pathTemplates.appPathTemplate.render({ + project: project, + location: location, + app: app, + }); + } + + /** + * Parse the project from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).project; + } + + /** + * Parse the location from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).location; + } + + /** + * Parse the app from App resource. + * + * @param {string} appName + * A fully-qualified path representing App resource. + * @returns {string} A string representing the app. + */ + matchAppFromAppName(appName: string) { + return this.pathTemplates.appPathTemplate.match(appName).app; + } + + /** + * Return a fully-qualified appVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} version + * @returns {string} Resource name string. + */ + appVersionPath(project:string,location:string,app:string,version:string) { + return this.pathTemplates.appVersionPathTemplate.render({ + project: project, + location: location, + app: app, + version: version, + }); + } + + /** + * Parse the project from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).project; + } + + /** + * Parse the location from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).location; + } + + /** + * Parse the app from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the app. + */ + matchAppFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).app; + } + + /** + * Parse the version from AppVersion resource. + * + * @param {string} appVersionName + * A fully-qualified path representing AppVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromAppVersionName(appVersionName: string) { + return this.pathTemplates.appVersionPathTemplate.match(appVersionName).version; + } + + /** + * Return a fully-qualified changelog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} changelog + * @returns {string} Resource name string. + */ + changelogPath(project:string,location:string,app:string,changelog:string) { + return this.pathTemplates.changelogPathTemplate.render({ + project: project, + location: location, + app: app, + changelog: changelog, + }); + } + + /** + * Parse the project from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).project; + } + + /** + * Parse the location from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).location; + } + + /** + * Parse the app from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the app. + */ + matchAppFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).app; + } + + /** + * Parse the changelog from Changelog resource. + * + * @param {string} changelogName + * A fully-qualified path representing Changelog resource. + * @returns {string} A string representing the changelog. + */ + matchChangelogFromChangelogName(changelogName: string) { + return this.pathTemplates.changelogPathTemplate.match(changelogName).changelog; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath(project:string,location:string,app:string,conversation:string) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + app: app, + conversation: conversation, + }); + } + + /** + * Parse the project from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).project; + } + + /** + * Parse the location from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).location; + } + + /** + * Parse the app from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the app. + */ + matchAppFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).app; + } + + /** + * Parse the conversation from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).conversation; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,app:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + app: app, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the app from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the app. + */ + matchAppFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).app; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified evaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation + * @returns {string} Resource name string. + */ + evaluationPath(project:string,location:string,app:string,evaluation:string) { + return this.pathTemplates.evaluationPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation: evaluation, + }); + } + + /** + * Parse the project from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project; + } + + /** + * Parse the location from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location; + } + + /** + * Parse the app from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).app; + } + + /** + * Parse the evaluation from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation; + } + + /** + * Return a fully-qualified evaluationDataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation_dataset + * @returns {string} Resource name string. + */ + evaluationDatasetPath(project:string,location:string,app:string,evaluationDataset:string) { + return this.pathTemplates.evaluationDatasetPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation_dataset: evaluationDataset, + }); + } + + /** + * Parse the project from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).project; + } + + /** + * Parse the location from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).location; + } + + /** + * Parse the app from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).app; + } + + /** + * Parse the evaluation_dataset from EvaluationDataset resource. + * + * @param {string} evaluationDatasetName + * A fully-qualified path representing EvaluationDataset resource. + * @returns {string} A string representing the evaluation_dataset. + */ + matchEvaluationDatasetFromEvaluationDatasetName(evaluationDatasetName: string) { + return this.pathTemplates.evaluationDatasetPathTemplate.match(evaluationDatasetName).evaluation_dataset; + } + + /** + * Return a fully-qualified evaluationExpectation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation_expectation + * @returns {string} Resource name string. + */ + evaluationExpectationPath(project:string,location:string,app:string,evaluationExpectation:string) { + return this.pathTemplates.evaluationExpectationPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation_expectation: evaluationExpectation, + }); + } + + /** + * Parse the project from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).project; + } + + /** + * Parse the location from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).location; + } + + /** + * Parse the app from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).app; + } + + /** + * Parse the evaluation_expectation from EvaluationExpectation resource. + * + * @param {string} evaluationExpectationName + * A fully-qualified path representing EvaluationExpectation resource. + * @returns {string} A string representing the evaluation_expectation. + */ + matchEvaluationExpectationFromEvaluationExpectationName(evaluationExpectationName: string) { + return this.pathTemplates.evaluationExpectationPathTemplate.match(evaluationExpectationName).evaluation_expectation; + } + + /** + * Return a fully-qualified evaluationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation + * @param {string} evaluation_result + * @returns {string} Resource name string. + */ + evaluationResultPath(project:string,location:string,app:string,evaluation:string,evaluationResult:string) { + return this.pathTemplates.evaluationResultPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation: evaluation, + evaluation_result: evaluationResult, + }); + } + + /** + * Parse the project from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).project; + } + + /** + * Parse the location from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).location; + } + + /** + * Parse the app from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).app; + } + + /** + * Parse the evaluation from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).evaluation; + } + + /** + * Parse the evaluation_result from EvaluationResult resource. + * + * @param {string} evaluationResultName + * A fully-qualified path representing EvaluationResult resource. + * @returns {string} A string representing the evaluation_result. + */ + matchEvaluationResultFromEvaluationResultName(evaluationResultName: string) { + return this.pathTemplates.evaluationResultPathTemplate.match(evaluationResultName).evaluation_result; + } + + /** + * Return a fully-qualified evaluationRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} evaluation_run + * @returns {string} Resource name string. + */ + evaluationRunPath(project:string,location:string,app:string,evaluationRun:string) { + return this.pathTemplates.evaluationRunPathTemplate.render({ + project: project, + location: location, + app: app, + evaluation_run: evaluationRun, + }); + } + + /** + * Parse the project from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).project; + } + + /** + * Parse the location from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).location; + } + + /** + * Parse the app from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the app. + */ + matchAppFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).app; + } + + /** + * Parse the evaluation_run from EvaluationRun resource. + * + * @param {string} evaluationRunName + * A fully-qualified path representing EvaluationRun resource. + * @returns {string} A string representing the evaluation_run. + */ + matchEvaluationRunFromEvaluationRunName(evaluationRunName: string) { + return this.pathTemplates.evaluationRunPathTemplate.match(evaluationRunName).evaluation_run; + } + + /** + * Return a fully-qualified example resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} example + * @returns {string} Resource name string. + */ + examplePath(project:string,location:string,app:string,example:string) { + return this.pathTemplates.examplePathTemplate.render({ + project: project, + location: location, + app: app, + example: example, + }); + } + + /** + * Parse the project from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).project; + } + + /** + * Parse the location from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).location; + } + + /** + * Parse the app from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the app. + */ + matchAppFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).app; + } + + /** + * Parse the example from Example resource. + * + * @param {string} exampleName + * A fully-qualified path representing Example resource. + * @returns {string} A string representing the example. + */ + matchExampleFromExampleName(exampleName: string) { + return this.pathTemplates.examplePathTemplate.match(exampleName).example; + } + + /** + * Return a fully-qualified guardrail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} guardrail + * @returns {string} Resource name string. + */ + guardrailPath(project:string,location:string,app:string,guardrail:string) { + return this.pathTemplates.guardrailPathTemplate.render({ + project: project, + location: location, + app: app, + guardrail: guardrail, + }); + } + + /** + * Parse the project from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).project; + } + + /** + * Parse the location from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).location; + } + + /** + * Parse the app from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the app. + */ + matchAppFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).app; + } + + /** + * Parse the guardrail from Guardrail resource. + * + * @param {string} guardrailName + * A fully-qualified path representing Guardrail resource. + * @returns {string} A string representing the guardrail. + */ + matchGuardrailFromGuardrailName(guardrailName: string) { + return this.pathTemplates.guardrailPathTemplate.match(guardrailName).guardrail; + } + + /** + * Return a fully-qualified omnichannel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} omnichannel + * @returns {string} Resource name string. + */ + omnichannelPath(project:string,location:string,omnichannel:string) { + return this.pathTemplates.omnichannelPathTemplate.render({ + project: project, + location: location, + omnichannel: omnichannel, + }); + } + + /** + * Parse the project from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).project; + } + + /** + * Parse the location from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).location; + } + + /** + * Parse the omnichannel from Omnichannel resource. + * + * @param {string} omnichannelName + * A fully-qualified path representing Omnichannel resource. + * @returns {string} A string representing the omnichannel. + */ + matchOmnichannelFromOmnichannelName(omnichannelName: string) { + return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).omnichannel; + } + + /** + * Return a fully-qualified scheduledEvaluationRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} scheduled_evaluation_run + * @returns {string} Resource name string. + */ + scheduledEvaluationRunPath(project:string,location:string,app:string,scheduledEvaluationRun:string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.render({ + project: project, + location: location, + app: app, + scheduled_evaluation_run: scheduledEvaluationRun, + }); + } + + /** + * Parse the project from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).project; + } + + /** + * Parse the location from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).location; + } + + /** + * Parse the app from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the app. + */ + matchAppFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).app; + } + + /** + * Parse the scheduled_evaluation_run from ScheduledEvaluationRun resource. + * + * @param {string} scheduledEvaluationRunName + * A fully-qualified path representing ScheduledEvaluationRun resource. + * @returns {string} A string representing the scheduled_evaluation_run. + */ + matchScheduledEvaluationRunFromScheduledEvaluationRunName(scheduledEvaluationRunName: string) { + return this.pathTemplates.scheduledEvaluationRunPathTemplate.match(scheduledEvaluationRunName).scheduled_evaluation_run; + } + + /** + * Return a fully-qualified session resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} session + * @returns {string} Resource name string. + */ + sessionPath(project:string,location:string,app:string,session:string) { + return this.pathTemplates.sessionPathTemplate.render({ + project: project, + location: location, + app: app, + session: session, + }); + } + + /** + * Parse the project from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).project; + } + + /** + * Parse the location from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).location; + } + + /** + * Parse the app from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the app. + */ + matchAppFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).app; + } + + /** + * Parse the session from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).session; + } + + /** + * Return a fully-qualified tool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} tool + * @returns {string} Resource name string. + */ + toolPath(project:string,location:string,app:string,tool:string) { + return this.pathTemplates.toolPathTemplate.render({ + project: project, + location: location, + app: app, + tool: tool, + }); + } + + /** + * Parse the project from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).project; + } + + /** + * Parse the location from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).location; + } + + /** + * Parse the app from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the app. + */ + matchAppFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).app; + } + + /** + * Parse the tool from Tool resource. + * + * @param {string} toolName + * A fully-qualified path representing Tool resource. + * @returns {string} A string representing the tool. + */ + matchToolFromToolName(toolName: string) { + return this.pathTemplates.toolPathTemplate.match(toolName).tool; + } + + /** + * Return a fully-qualified toolset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} app + * @param {string} toolset + * @returns {string} Resource name string. + */ + toolsetPath(project:string,location:string,app:string,toolset:string) { + return this.pathTemplates.toolsetPathTemplate.render({ + project: project, + location: location, + app: app, + toolset: toolset, + }); + } + + /** + * Parse the project from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).project; + } + + /** + * Parse the location from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).location; + } + + /** + * Parse the app from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the app. + */ + matchAppFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).app; + } + + /** + * Parse the toolset from Toolset resource. + * + * @param {string} toolsetName + * A fully-qualified path representing Toolset resource. + * @returns {string} A string representing the toolset. + */ + matchToolsetFromToolsetName(toolsetName: string) { + return this.pathTemplates.toolsetPathTemplate.match(toolsetName).toolset; + } + + /** + * 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.widgetServiceStub && !this._terminated) { + return this.widgetServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/widget_service_client_config.json b/owl-bot-staging/google-cloud-ces/src/v1beta/widget_service_client_config.json new file mode 100644 index 00000000000..97b9ca82bd4 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1beta/widget_service_client_config.json @@ -0,0 +1,30 @@ +{ + "interfaces": { + "google.cloud.ces.v1beta.WidgetService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GenerateChatToken": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/widget_service_proto_list.json b/owl-bot-staging/google-cloud-ces/src/v1beta/widget_service_proto_list.json new file mode 100644 index 00000000000..19d10d699ff --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/src/v1beta/widget_service_proto_list.json @@ -0,0 +1,43 @@ +[ + "../../protos/google/cloud/ces/v1beta/agent.proto", + "../../protos/google/cloud/ces/v1beta/agent_service.proto", + "../../protos/google/cloud/ces/v1beta/agent_transfers.proto", + "../../protos/google/cloud/ces/v1beta/app.proto", + "../../protos/google/cloud/ces/v1beta/app_version.proto", + "../../protos/google/cloud/ces/v1beta/auth.proto", + "../../protos/google/cloud/ces/v1beta/bigquery_export.proto", + "../../protos/google/cloud/ces/v1beta/changelog.proto", + "../../protos/google/cloud/ces/v1beta/client_function.proto", + "../../protos/google/cloud/ces/v1beta/common.proto", + "../../protos/google/cloud/ces/v1beta/connector_tool.proto", + "../../protos/google/cloud/ces/v1beta/connector_toolset.proto", + "../../protos/google/cloud/ces/v1beta/conversation.proto", + "../../protos/google/cloud/ces/v1beta/data_store.proto", + "../../protos/google/cloud/ces/v1beta/data_store_tool.proto", + "../../protos/google/cloud/ces/v1beta/deployment.proto", + "../../protos/google/cloud/ces/v1beta/evaluation.proto", + "../../protos/google/cloud/ces/v1beta/evaluation_service.proto", + "../../protos/google/cloud/ces/v1beta/example.proto", + "../../protos/google/cloud/ces/v1beta/fakes.proto", + "../../protos/google/cloud/ces/v1beta/file_search_tool.proto", + "../../protos/google/cloud/ces/v1beta/golden_run.proto", + "../../protos/google/cloud/ces/v1beta/google_search_tool.proto", + "../../protos/google/cloud/ces/v1beta/guardrail.proto", + "../../protos/google/cloud/ces/v1beta/mcp_tool.proto", + "../../protos/google/cloud/ces/v1beta/mcp_toolset.proto", + "../../protos/google/cloud/ces/v1beta/omnichannel.proto", + "../../protos/google/cloud/ces/v1beta/omnichannel_service.proto", + "../../protos/google/cloud/ces/v1beta/open_api_tool.proto", + "../../protos/google/cloud/ces/v1beta/open_api_toolset.proto", + "../../protos/google/cloud/ces/v1beta/python_function.proto", + "../../protos/google/cloud/ces/v1beta/schema.proto", + "../../protos/google/cloud/ces/v1beta/search_suggestions.proto", + "../../protos/google/cloud/ces/v1beta/session_service.proto", + "../../protos/google/cloud/ces/v1beta/system_tool.proto", + "../../protos/google/cloud/ces/v1beta/tool.proto", + "../../protos/google/cloud/ces/v1beta/tool_service.proto", + "../../protos/google/cloud/ces/v1beta/toolset.proto", + "../../protos/google/cloud/ces/v1beta/toolset_tool.proto", + "../../protos/google/cloud/ces/v1beta/widget_service.proto", + "../../protos/google/cloud/ces/v1beta/widget_tool.proto" +] diff --git a/owl-bot-staging/google-cloud-ces/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-ces/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..5b0de58aa1e --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/system-test/fixtures/sample/src/index.js @@ -0,0 +1,30 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 ces = require('@google-cloud/ces'); + +function main() { + const agentServiceClient = new ces.AgentServiceClient(); + const sessionServiceClient = new ces.SessionServiceClient(); + const toolServiceClient = new ces.ToolServiceClient(); + const widgetServiceClient = new ces.WidgetServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-ces/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-ces/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..7aa59cc5d63 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,50 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {AgentServiceClient, SessionServiceClient, ToolServiceClient, WidgetServiceClient} from '@google-cloud/ces'; + +// check that the client class type name can be used +function doStuffWithAgentServiceClient(client: AgentServiceClient) { + client.close(); +} +function doStuffWithSessionServiceClient(client: SessionServiceClient) { + client.close(); +} +function doStuffWithToolServiceClient(client: ToolServiceClient) { + client.close(); +} +function doStuffWithWidgetServiceClient(client: WidgetServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const agentServiceClient = new AgentServiceClient(); + doStuffWithAgentServiceClient(agentServiceClient); + // check that the client instance can be created + const sessionServiceClient = new SessionServiceClient(); + doStuffWithSessionServiceClient(sessionServiceClient); + // check that the client instance can be created + const toolServiceClient = new ToolServiceClient(); + doStuffWithToolServiceClient(toolServiceClient); + // check that the client instance can be created + const widgetServiceClient = new WidgetServiceClient(); + doStuffWithWidgetServiceClient(widgetServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-ces/system-test/install.ts b/owl-bot-staging/google-cloud-ces/system-test/install.ts new file mode 100644 index 00000000000..394f3362d20 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-ces/test/gapic_agent_service_v1.ts b/owl-bot-staging/google-cloud-ces/test/gapic_agent_service_v1.ts new file mode 100644 index 00000000000..5713676ea6d --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/test/gapic_agent_service_v1.ts @@ -0,0 +1,8205 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 agentserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, 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.AgentServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new agentserviceModule.v1.AgentServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new agentserviceModule.v1.AgentServiceClient(); + 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 = agentserviceModule.v1.AgentServiceClient.servicePath; + assert.strictEqual(servicePath, 'ces.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = agentserviceModule.v1.AgentServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new agentserviceModule.v1.AgentServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new agentserviceModule.v1.AgentServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 agentserviceModule.v1.AgentServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 agentserviceModule.v1.AgentServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 agentserviceModule.v1.AgentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = agentserviceModule.v1.AgentServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new agentserviceModule.v1.AgentServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.agentServiceStub, undefined); + await client.initialize(); + assert(client.agentServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.agentServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.agentServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new agentserviceModule.v1.AgentServiceClient({ + 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 agentserviceModule.v1.AgentServiceClient({ + 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('getApp', () => { + it('invokes getApp without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.App() + ); + client.innerApiCalls.getApp = stubSimpleCall(expectedResponse); + const [response] = await client.getApp(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApp without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.App() + ); + client.innerApiCalls.getApp = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApp( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IApp|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApp with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApp = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getApp(request), expectedError); + const actualRequest = (client.innerApiCalls.getApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApp with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetAppRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getApp(request), expectedError); + }); + }); + + describe('updateApp', () => { + it('invokes updateApp without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateAppRequest() + ); + request.app ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateAppRequest', ['app', 'name']); + request.app.name = defaultValue1; + const expectedHeaderRequestParams = `app.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.App() + ); + client.innerApiCalls.updateApp = stubSimpleCall(expectedResponse); + const [response] = await client.updateApp(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApp without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateAppRequest() + ); + request.app ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateAppRequest', ['app', 'name']); + request.app.name = defaultValue1; + const expectedHeaderRequestParams = `app.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.App() + ); + client.innerApiCalls.updateApp = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateApp( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IApp|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApp with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateAppRequest() + ); + request.app ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateAppRequest', ['app', 'name']); + request.app.name = defaultValue1; + const expectedHeaderRequestParams = `app.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApp = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateApp(request), expectedError); + const actualRequest = (client.innerApiCalls.updateApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApp with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateAppRequest() + ); + request.app ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateAppRequest', ['app', 'name']); + request.app.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateApp(request), expectedError); + }); + }); + + describe('getAgent', () => { + it('invokes getAgent without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetAgentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Agent() + ); + client.innerApiCalls.getAgent = stubSimpleCall(expectedResponse); + const [response] = await client.getAgent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgent without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetAgentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Agent() + ); + client.innerApiCalls.getAgent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAgent( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IAgent|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgent with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetAgentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAgent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAgent(request), expectedError); + const actualRequest = (client.innerApiCalls.getAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgent with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetAgentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getAgent(request), expectedError); + }); + }); + + describe('createAgent', () => { + it('invokes createAgent without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateAgentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Agent() + ); + client.innerApiCalls.createAgent = stubSimpleCall(expectedResponse); + const [response] = await client.createAgent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAgent without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateAgentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Agent() + ); + client.innerApiCalls.createAgent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAgent( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IAgent|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAgent with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateAgentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAgent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createAgent(request), expectedError); + const actualRequest = (client.innerApiCalls.createAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAgent with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateAgentRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createAgent(request), expectedError); + }); + }); + + describe('updateAgent', () => { + it('invokes updateAgent without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateAgentRequest() + ); + request.agent ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateAgentRequest', ['agent', 'name']); + request.agent.name = defaultValue1; + const expectedHeaderRequestParams = `agent.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Agent() + ); + client.innerApiCalls.updateAgent = stubSimpleCall(expectedResponse); + const [response] = await client.updateAgent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAgent without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateAgentRequest() + ); + request.agent ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateAgentRequest', ['agent', 'name']); + request.agent.name = defaultValue1; + const expectedHeaderRequestParams = `agent.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Agent() + ); + client.innerApiCalls.updateAgent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAgent( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IAgent|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAgent with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateAgentRequest() + ); + request.agent ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateAgentRequest', ['agent', 'name']); + request.agent.name = defaultValue1; + const expectedHeaderRequestParams = `agent.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAgent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateAgent(request), expectedError); + const actualRequest = (client.innerApiCalls.updateAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAgent with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateAgentRequest() + ); + request.agent ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateAgentRequest', ['agent', 'name']); + request.agent.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateAgent(request), expectedError); + }); + }); + + describe('deleteAgent', () => { + it('invokes deleteAgent without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteAgentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAgent = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAgent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAgent without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteAgentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAgent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAgent( + 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.deleteAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAgent with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteAgentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAgent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteAgent(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAgent with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteAgentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteAgent(request), expectedError); + }); + }); + + describe('getExample', () => { + it('invokes getExample without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetExampleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Example() + ); + client.innerApiCalls.getExample = stubSimpleCall(expectedResponse); + const [response] = await client.getExample(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExample without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetExampleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Example() + ); + client.innerApiCalls.getExample = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getExample( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IExample|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExample with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetExampleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getExample = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getExample(request), expectedError); + const actualRequest = (client.innerApiCalls.getExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExample with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetExampleRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getExample(request), expectedError); + }); + }); + + describe('createExample', () => { + it('invokes createExample without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateExampleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Example() + ); + client.innerApiCalls.createExample = stubSimpleCall(expectedResponse); + const [response] = await client.createExample(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExample without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateExampleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Example() + ); + client.innerApiCalls.createExample = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createExample( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IExample|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExample with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateExampleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createExample = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createExample(request), expectedError); + const actualRequest = (client.innerApiCalls.createExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExample with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateExampleRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createExample(request), expectedError); + }); + }); + + describe('updateExample', () => { + it('invokes updateExample without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateExampleRequest() + ); + request.example ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateExampleRequest', ['example', 'name']); + request.example.name = defaultValue1; + const expectedHeaderRequestParams = `example.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Example() + ); + client.innerApiCalls.updateExample = stubSimpleCall(expectedResponse); + const [response] = await client.updateExample(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExample without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateExampleRequest() + ); + request.example ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateExampleRequest', ['example', 'name']); + request.example.name = defaultValue1; + const expectedHeaderRequestParams = `example.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Example() + ); + client.innerApiCalls.updateExample = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExample( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IExample|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExample with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateExampleRequest() + ); + request.example ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateExampleRequest', ['example', 'name']); + request.example.name = defaultValue1; + const expectedHeaderRequestParams = `example.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExample = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateExample(request), expectedError); + const actualRequest = (client.innerApiCalls.updateExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExample with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateExampleRequest() + ); + request.example ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateExampleRequest', ['example', 'name']); + request.example.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateExample(request), expectedError); + }); + }); + + describe('deleteExample', () => { + it('invokes deleteExample without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteExampleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteExample = stubSimpleCall(expectedResponse); + const [response] = await client.deleteExample(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExample without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteExampleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteExample = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteExample( + 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.deleteExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExample with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteExampleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExample = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteExample(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExample with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteExampleRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteExample(request), expectedError); + }); + }); + + describe('getTool', () => { + it('invokes getTool without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetToolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Tool() + ); + client.innerApiCalls.getTool = stubSimpleCall(expectedResponse); + const [response] = await client.getTool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTool without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetToolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Tool() + ); + client.innerApiCalls.getTool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTool( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.ITool|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTool with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetToolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTool(request), expectedError); + const actualRequest = (client.innerApiCalls.getTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTool with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetToolRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getTool(request), expectedError); + }); + }); + + describe('getConversation', () => { + it('invokes getConversation without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetConversationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Conversation() + ); + client.innerApiCalls.getConversation = stubSimpleCall(expectedResponse); + const [response] = await client.getConversation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConversation without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetConversationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Conversation() + ); + client.innerApiCalls.getConversation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConversation( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IConversation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConversation with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetConversationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConversation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getConversation(request), expectedError); + const actualRequest = (client.innerApiCalls.getConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConversation with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetConversationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getConversation(request), expectedError); + }); + }); + + describe('deleteConversation', () => { + it('invokes deleteConversation without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteConversationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteConversation = stubSimpleCall(expectedResponse); + const [response] = await client.deleteConversation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConversation without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteConversationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteConversation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteConversation( + 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.deleteConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConversation with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteConversationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConversation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteConversation(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConversation with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteConversationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteConversation(request), expectedError); + }); + }); + + describe('createTool', () => { + it('invokes createTool without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateToolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Tool() + ); + client.innerApiCalls.createTool = stubSimpleCall(expectedResponse); + const [response] = await client.createTool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTool without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateToolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Tool() + ); + client.innerApiCalls.createTool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTool( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.ITool|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTool with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateToolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTool(request), expectedError); + const actualRequest = (client.innerApiCalls.createTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTool with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateToolRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createTool(request), expectedError); + }); + }); + + describe('updateTool', () => { + it('invokes updateTool without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateToolRequest() + ); + request.tool ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateToolRequest', ['tool', 'name']); + request.tool.name = defaultValue1; + const expectedHeaderRequestParams = `tool.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Tool() + ); + client.innerApiCalls.updateTool = stubSimpleCall(expectedResponse); + const [response] = await client.updateTool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTool without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateToolRequest() + ); + request.tool ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateToolRequest', ['tool', 'name']); + request.tool.name = defaultValue1; + const expectedHeaderRequestParams = `tool.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Tool() + ); + client.innerApiCalls.updateTool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTool( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.ITool|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTool with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateToolRequest() + ); + request.tool ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateToolRequest', ['tool', 'name']); + request.tool.name = defaultValue1; + const expectedHeaderRequestParams = `tool.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateTool(request), expectedError); + const actualRequest = (client.innerApiCalls.updateTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTool with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateToolRequest() + ); + request.tool ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateToolRequest', ['tool', 'name']); + request.tool.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateTool(request), expectedError); + }); + }); + + describe('deleteTool', () => { + it('invokes deleteTool without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteToolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTool = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTool without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteToolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTool( + 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.deleteTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTool with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteToolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteTool(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTool with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteToolRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteTool(request), expectedError); + }); + }); + + describe('getGuardrail', () => { + it('invokes getGuardrail without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetGuardrailRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Guardrail() + ); + client.innerApiCalls.getGuardrail = stubSimpleCall(expectedResponse); + const [response] = await client.getGuardrail(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGuardrail without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetGuardrailRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Guardrail() + ); + client.innerApiCalls.getGuardrail = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGuardrail( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IGuardrail|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGuardrail with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetGuardrailRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGuardrail = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getGuardrail(request), expectedError); + const actualRequest = (client.innerApiCalls.getGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGuardrail with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetGuardrailRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getGuardrail(request), expectedError); + }); + }); + + describe('createGuardrail', () => { + it('invokes createGuardrail without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateGuardrailRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Guardrail() + ); + client.innerApiCalls.createGuardrail = stubSimpleCall(expectedResponse); + const [response] = await client.createGuardrail(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGuardrail without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateGuardrailRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Guardrail() + ); + client.innerApiCalls.createGuardrail = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGuardrail( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IGuardrail|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGuardrail with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateGuardrailRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGuardrail = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createGuardrail(request), expectedError); + const actualRequest = (client.innerApiCalls.createGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGuardrail with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateGuardrailRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createGuardrail(request), expectedError); + }); + }); + + describe('updateGuardrail', () => { + it('invokes updateGuardrail without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateGuardrailRequest() + ); + request.guardrail ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateGuardrailRequest', ['guardrail', 'name']); + request.guardrail.name = defaultValue1; + const expectedHeaderRequestParams = `guardrail.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Guardrail() + ); + client.innerApiCalls.updateGuardrail = stubSimpleCall(expectedResponse); + const [response] = await client.updateGuardrail(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGuardrail without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateGuardrailRequest() + ); + request.guardrail ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateGuardrailRequest', ['guardrail', 'name']); + request.guardrail.name = defaultValue1; + const expectedHeaderRequestParams = `guardrail.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Guardrail() + ); + client.innerApiCalls.updateGuardrail = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGuardrail( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IGuardrail|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGuardrail with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateGuardrailRequest() + ); + request.guardrail ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateGuardrailRequest', ['guardrail', 'name']); + request.guardrail.name = defaultValue1; + const expectedHeaderRequestParams = `guardrail.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGuardrail = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateGuardrail(request), expectedError); + const actualRequest = (client.innerApiCalls.updateGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGuardrail with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateGuardrailRequest() + ); + request.guardrail ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateGuardrailRequest', ['guardrail', 'name']); + request.guardrail.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateGuardrail(request), expectedError); + }); + }); + + describe('deleteGuardrail', () => { + it('invokes deleteGuardrail without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteGuardrailRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteGuardrail = stubSimpleCall(expectedResponse); + const [response] = await client.deleteGuardrail(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGuardrail without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteGuardrailRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteGuardrail = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteGuardrail( + 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.deleteGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGuardrail with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteGuardrailRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGuardrail = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteGuardrail(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGuardrail with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteGuardrailRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteGuardrail(request), expectedError); + }); + }); + + describe('getDeployment', () => { + it('invokes getDeployment without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Deployment() + ); + client.innerApiCalls.getDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.getDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Deployment() + ); + client.innerApiCalls.getDeployment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDeployment( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IDeployment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDeployment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getDeployment(request), expectedError); + }); + }); + + describe('createDeployment', () => { + it('invokes createDeployment without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Deployment() + ); + client.innerApiCalls.createDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.createDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeployment without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Deployment() + ); + client.innerApiCalls.createDeployment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDeployment( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IDeployment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeployment with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDeployment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeployment with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createDeployment(request), expectedError); + }); + }); + + describe('updateDeployment', () => { + it('invokes updateDeployment without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateDeploymentRequest', ['deployment', 'name']); + request.deployment.name = defaultValue1; + const expectedHeaderRequestParams = `deployment.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Deployment() + ); + client.innerApiCalls.updateDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.updateDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeployment without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateDeploymentRequest', ['deployment', 'name']); + request.deployment.name = defaultValue1; + const expectedHeaderRequestParams = `deployment.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Deployment() + ); + client.innerApiCalls.updateDeployment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDeployment( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IDeployment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeployment with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateDeploymentRequest', ['deployment', 'name']); + request.deployment.name = defaultValue1; + const expectedHeaderRequestParams = `deployment.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDeployment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeployment with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateDeploymentRequest', ['deployment', 'name']); + request.deployment.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateDeployment(request), expectedError); + }); + }); + + describe('deleteDeployment', () => { + it('invokes deleteDeployment without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeployment without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDeployment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDeployment( + 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.deleteDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeployment with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDeployment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeployment with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteDeployment(request), expectedError); + }); + }); + + describe('getToolset', () => { + it('invokes getToolset without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetToolsetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Toolset() + ); + client.innerApiCalls.getToolset = stubSimpleCall(expectedResponse); + const [response] = await client.getToolset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getToolset without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetToolsetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Toolset() + ); + client.innerApiCalls.getToolset = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getToolset( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IToolset|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getToolset with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetToolsetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getToolset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getToolset(request), expectedError); + const actualRequest = (client.innerApiCalls.getToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getToolset with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetToolsetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getToolset(request), expectedError); + }); + }); + + describe('createToolset', () => { + it('invokes createToolset without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateToolsetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Toolset() + ); + client.innerApiCalls.createToolset = stubSimpleCall(expectedResponse); + const [response] = await client.createToolset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createToolset without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateToolsetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Toolset() + ); + client.innerApiCalls.createToolset = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createToolset( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IToolset|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createToolset with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateToolsetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createToolset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createToolset(request), expectedError); + const actualRequest = (client.innerApiCalls.createToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createToolset with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateToolsetRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createToolset(request), expectedError); + }); + }); + + describe('updateToolset', () => { + it('invokes updateToolset without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateToolsetRequest() + ); + request.toolset ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateToolsetRequest', ['toolset', 'name']); + request.toolset.name = defaultValue1; + const expectedHeaderRequestParams = `toolset.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Toolset() + ); + client.innerApiCalls.updateToolset = stubSimpleCall(expectedResponse); + const [response] = await client.updateToolset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateToolset without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateToolsetRequest() + ); + request.toolset ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateToolsetRequest', ['toolset', 'name']); + request.toolset.name = defaultValue1; + const expectedHeaderRequestParams = `toolset.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Toolset() + ); + client.innerApiCalls.updateToolset = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateToolset( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IToolset|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateToolset with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateToolsetRequest() + ); + request.toolset ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateToolsetRequest', ['toolset', 'name']); + request.toolset.name = defaultValue1; + const expectedHeaderRequestParams = `toolset.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateToolset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateToolset(request), expectedError); + const actualRequest = (client.innerApiCalls.updateToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateToolset with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.UpdateToolsetRequest() + ); + request.toolset ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.UpdateToolsetRequest', ['toolset', 'name']); + request.toolset.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateToolset(request), expectedError); + }); + }); + + describe('deleteToolset', () => { + it('invokes deleteToolset without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteToolsetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteToolset = stubSimpleCall(expectedResponse); + const [response] = await client.deleteToolset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteToolset without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteToolsetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteToolset = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteToolset( + 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.deleteToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteToolset with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteToolsetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteToolset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteToolset(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteToolset with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteToolsetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteToolset(request), expectedError); + }); + }); + + describe('getAppVersion', () => { + it('invokes getAppVersion without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.AppVersion() + ); + client.innerApiCalls.getAppVersion = stubSimpleCall(expectedResponse); + const [response] = await client.getAppVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAppVersion without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.AppVersion() + ); + client.innerApiCalls.getAppVersion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAppVersion( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IAppVersion|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAppVersion with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAppVersion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAppVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.getAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAppVersion with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getAppVersion(request), expectedError); + }); + }); + + describe('createAppVersion', () => { + it('invokes createAppVersion without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateAppVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.AppVersion() + ); + client.innerApiCalls.createAppVersion = stubSimpleCall(expectedResponse); + const [response] = await client.createAppVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAppVersion without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateAppVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.AppVersion() + ); + client.innerApiCalls.createAppVersion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAppVersion( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IAppVersion|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAppVersion with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateAppVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAppVersion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createAppVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.createAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAppVersion with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateAppVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createAppVersion(request), expectedError); + }); + }); + + describe('deleteAppVersion', () => { + it('invokes deleteAppVersion without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAppVersion = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAppVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAppVersion without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAppVersion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAppVersion( + 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.deleteAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAppVersion with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAppVersion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteAppVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAppVersion with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteAppVersion(request), expectedError); + }); + }); + + describe('getChangelog', () => { + it('invokes getChangelog without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetChangelogRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetChangelogRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Changelog() + ); + client.innerApiCalls.getChangelog = stubSimpleCall(expectedResponse); + const [response] = await client.getChangelog(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getChangelog as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getChangelog as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChangelog without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetChangelogRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetChangelogRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.Changelog() + ); + client.innerApiCalls.getChangelog = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getChangelog( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IChangelog|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getChangelog as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getChangelog as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChangelog with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetChangelogRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetChangelogRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getChangelog = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getChangelog(request), expectedError); + const actualRequest = (client.innerApiCalls.getChangelog as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getChangelog as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChangelog with closed client', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GetChangelogRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GetChangelogRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getChangelog(request), expectedError); + }); + }); + + describe('createApp', () => { + it('invokes createApp without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateAppRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createApp = stubLongRunningCall(expectedResponse); + const [operation] = await client.createApp(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApp without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateAppRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createApp = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApp( + 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.createApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApp with call error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateAppRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApp = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createApp(request), expectedError); + const actualRequest = (client.innerApiCalls.createApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApp with LRO error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.CreateAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.CreateAppRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApp = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createApp(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateAppProgress without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateAppProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateAppProgress with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateAppProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteApp', () => { + it('invokes deleteApp without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteApp = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteApp(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApp without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteApp = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteApp( + 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.deleteApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApp with call error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApp = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteApp(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApp with LRO error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.DeleteAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.DeleteAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApp = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteApp(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteAppProgress without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteAppProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteAppProgress with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteAppProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('exportApp', () => { + it('invokes exportApp without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ExportAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ExportAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportApp = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportApp(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.exportApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportApp without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ExportAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ExportAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportApp = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportApp( + 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.exportApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportApp with call error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ExportAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ExportAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportApp = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportApp(request), expectedError); + const actualRequest = (client.innerApiCalls.exportApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportApp with LRO error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ExportAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ExportAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportApp = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportApp(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.exportApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportAppProgress without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkExportAppProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportAppProgress with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkExportAppProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('importApp', () => { + it('invokes importApp without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ImportAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ImportAppRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importApp = stubLongRunningCall(expectedResponse); + const [operation] = await client.importApp(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.importApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importApp without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ImportAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ImportAppRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importApp = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importApp( + 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.importApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importApp with call error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ImportAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ImportAppRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.importApp = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.importApp(request), expectedError); + const actualRequest = (client.innerApiCalls.importApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importApp with LRO error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ImportAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ImportAppRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.importApp = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.importApp(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.importApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportAppProgress without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkImportAppProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportAppProgress with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkImportAppProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('batchDeleteConversations', () => { + it('invokes batchDeleteConversations without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.BatchDeleteConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.BatchDeleteConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchDeleteConversations = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchDeleteConversations(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchDeleteConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteConversations without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.BatchDeleteConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.BatchDeleteConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchDeleteConversations = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchDeleteConversations( + 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.batchDeleteConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteConversations with call error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.BatchDeleteConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.BatchDeleteConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchDeleteConversations = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchDeleteConversations(request), expectedError); + const actualRequest = (client.innerApiCalls.batchDeleteConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteConversations with LRO error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.BatchDeleteConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.BatchDeleteConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchDeleteConversations = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchDeleteConversations(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.batchDeleteConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchDeleteConversationsProgress without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchDeleteConversationsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchDeleteConversationsProgress with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkBatchDeleteConversationsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('restoreAppVersion', () => { + it('invokes restoreAppVersion without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.RestoreAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.RestoreAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreAppVersion = stubLongRunningCall(expectedResponse); + const [operation] = await client.restoreAppVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restoreAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreAppVersion without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.RestoreAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.RestoreAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreAppVersion = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreAppVersion( + 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.restoreAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreAppVersion with call error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.RestoreAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.RestoreAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreAppVersion = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restoreAppVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.restoreAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreAppVersion with LRO error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.RestoreAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.RestoreAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreAppVersion = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restoreAppVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.restoreAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestoreAppVersionProgress without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRestoreAppVersionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestoreAppVersionProgress with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkRestoreAppVersionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listApps', () => { + it('invokes listApps without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAppsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAppsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.App()), + generateSampleMessage(new protos.google.cloud.ces.v1.App()), + generateSampleMessage(new protos.google.cloud.ces.v1.App()), + ]; + client.innerApiCalls.listApps = stubSimpleCall(expectedResponse); + const [response] = await client.listApps(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listApps as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listApps as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApps without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAppsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAppsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.App()), + generateSampleMessage(new protos.google.cloud.ces.v1.App()), + generateSampleMessage(new protos.google.cloud.ces.v1.App()), + ]; + client.innerApiCalls.listApps = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApps( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IApp[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listApps as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listApps as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApps with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAppsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAppsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApps = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listApps(request), expectedError); + const actualRequest = (client.innerApiCalls.listApps as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listApps as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAppsStream without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAppsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAppsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.App()), + generateSampleMessage(new protos.google.cloud.ces.v1.App()), + generateSampleMessage(new protos.google.cloud.ces.v1.App()), + ]; + client.descriptors.page.listApps.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAppsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.App[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.App) => { + 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.listApps.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listApps, request)); + assert( + (client.descriptors.page.listApps.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAppsStream with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAppsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAppsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listApps.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAppsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.App[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.App) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listApps.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listApps, request)); + assert( + (client.descriptors.page.listApps.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApps without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAppsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAppsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.App()), + generateSampleMessage(new protos.google.cloud.ces.v1.App()), + generateSampleMessage(new protos.google.cloud.ces.v1.App()), + ]; + client.descriptors.page.listApps.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1.IApp[] = []; + const iterable = client.listAppsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listApps.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listApps.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApps with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAppsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAppsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listApps.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAppsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1.IApp[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listApps.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listApps.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAgents', () => { + it('invokes listAgents without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAgentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAgentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), + generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), + generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), + ]; + client.innerApiCalls.listAgents = stubSimpleCall(expectedResponse); + const [response] = await client.listAgents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAgents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAgents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAgents without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAgentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAgentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), + generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), + generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), + ]; + client.innerApiCalls.listAgents = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAgents( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IAgent[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAgents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAgents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAgents with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAgentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAgentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAgents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAgents(request), expectedError); + const actualRequest = (client.innerApiCalls.listAgents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAgents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAgentsStream without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAgentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAgentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), + generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), + generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), + ]; + client.descriptors.page.listAgents.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAgentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.Agent[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.Agent) => { + 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.listAgents.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAgents, request)); + assert( + (client.descriptors.page.listAgents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAgentsStream with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAgentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAgentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAgents.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAgentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.Agent[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.Agent) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAgents.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAgents, request)); + assert( + (client.descriptors.page.listAgents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAgents without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAgentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAgentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), + generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), + generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), + ]; + client.descriptors.page.listAgents.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1.IAgent[] = []; + const iterable = client.listAgentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAgents.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAgents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAgents with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAgentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAgentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAgents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAgentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1.IAgent[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAgents.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAgents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listExamples', () => { + it('invokes listExamples without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListExamplesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListExamplesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Example()), + generateSampleMessage(new protos.google.cloud.ces.v1.Example()), + generateSampleMessage(new protos.google.cloud.ces.v1.Example()), + ]; + client.innerApiCalls.listExamples = stubSimpleCall(expectedResponse); + const [response] = await client.listExamples(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listExamples as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExamples as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExamples without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListExamplesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListExamplesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Example()), + generateSampleMessage(new protos.google.cloud.ces.v1.Example()), + generateSampleMessage(new protos.google.cloud.ces.v1.Example()), + ]; + client.innerApiCalls.listExamples = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listExamples( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IExample[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listExamples as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExamples as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExamples with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListExamplesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListExamplesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listExamples = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listExamples(request), expectedError); + const actualRequest = (client.innerApiCalls.listExamples as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExamples as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExamplesStream without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListExamplesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListExamplesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Example()), + generateSampleMessage(new protos.google.cloud.ces.v1.Example()), + generateSampleMessage(new protos.google.cloud.ces.v1.Example()), + ]; + client.descriptors.page.listExamples.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listExamplesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.Example[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.Example) => { + 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.listExamples.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listExamples, request)); + assert( + (client.descriptors.page.listExamples.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listExamplesStream with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListExamplesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListExamplesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listExamples.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listExamplesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.Example[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.Example) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listExamples.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listExamples, request)); + assert( + (client.descriptors.page.listExamples.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listExamples without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListExamplesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListExamplesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Example()), + generateSampleMessage(new protos.google.cloud.ces.v1.Example()), + generateSampleMessage(new protos.google.cloud.ces.v1.Example()), + ]; + client.descriptors.page.listExamples.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1.IExample[] = []; + const iterable = client.listExamplesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listExamples.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listExamples.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listExamples with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListExamplesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListExamplesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listExamples.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listExamplesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1.IExample[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listExamples.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listExamples.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTools', () => { + it('invokes listTools without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListToolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), + generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), + generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), + ]; + client.innerApiCalls.listTools = stubSimpleCall(expectedResponse); + const [response] = await client.listTools(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTools without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListToolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), + generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), + generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), + ]; + client.innerApiCalls.listTools = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTools( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.ITool[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTools with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListToolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTools = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTools(request), expectedError); + const actualRequest = (client.innerApiCalls.listTools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listToolsStream without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListToolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), + generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), + generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), + ]; + client.descriptors.page.listTools.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listToolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.Tool[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.Tool) => { + 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.listTools.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTools, request)); + assert( + (client.descriptors.page.listTools.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listToolsStream with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListToolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listTools.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listToolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.Tool[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.Tool) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTools.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTools, request)); + assert( + (client.descriptors.page.listTools.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTools without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListToolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), + generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), + generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), + ]; + client.descriptors.page.listTools.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1.ITool[] = []; + const iterable = client.listToolsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTools.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTools.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTools with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListToolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listTools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listToolsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1.ITool[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTools.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTools.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listConversations', () => { + it('invokes listConversations without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), + generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), + generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), + ]; + client.innerApiCalls.listConversations = stubSimpleCall(expectedResponse); + const [response] = await client.listConversations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConversations without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), + generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), + generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), + ]; + client.innerApiCalls.listConversations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listConversations( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IConversation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConversations with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listConversations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listConversations(request), expectedError); + const actualRequest = (client.innerApiCalls.listConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConversationsStream without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), + generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), + generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), + ]; + client.descriptors.page.listConversations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listConversationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.Conversation[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.Conversation) => { + 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.listConversations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listConversations, request)); + assert( + (client.descriptors.page.listConversations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listConversationsStream with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listConversations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listConversationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.Conversation[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.Conversation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listConversations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listConversations, request)); + assert( + (client.descriptors.page.listConversations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConversations without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), + generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), + generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), + ]; + client.descriptors.page.listConversations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1.IConversation[] = []; + const iterable = client.listConversationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listConversations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listConversations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConversations with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listConversations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listConversationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1.IConversation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listConversations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listConversations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listGuardrails', () => { + it('invokes listGuardrails without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListGuardrailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListGuardrailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), + generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), + generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), + ]; + client.innerApiCalls.listGuardrails = stubSimpleCall(expectedResponse); + const [response] = await client.listGuardrails(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listGuardrails as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listGuardrails as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGuardrails without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListGuardrailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListGuardrailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), + generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), + generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), + ]; + client.innerApiCalls.listGuardrails = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGuardrails( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IGuardrail[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listGuardrails as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listGuardrails as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGuardrails with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListGuardrailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListGuardrailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listGuardrails = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listGuardrails(request), expectedError); + const actualRequest = (client.innerApiCalls.listGuardrails as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listGuardrails as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGuardrailsStream without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListGuardrailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListGuardrailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), + generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), + generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), + ]; + client.descriptors.page.listGuardrails.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listGuardrailsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.Guardrail[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.Guardrail) => { + 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.listGuardrails.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listGuardrails, request)); + assert( + (client.descriptors.page.listGuardrails.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listGuardrailsStream with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListGuardrailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListGuardrailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listGuardrails.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listGuardrailsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.Guardrail[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.Guardrail) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listGuardrails.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listGuardrails, request)); + assert( + (client.descriptors.page.listGuardrails.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGuardrails without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListGuardrailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListGuardrailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), + generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), + generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), + ]; + client.descriptors.page.listGuardrails.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1.IGuardrail[] = []; + const iterable = client.listGuardrailsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listGuardrails.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listGuardrails.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGuardrails with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListGuardrailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListGuardrailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listGuardrails.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listGuardrailsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1.IGuardrail[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listGuardrails.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listGuardrails.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDeployments', () => { + it('invokes listDeployments without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), + ]; + client.innerApiCalls.listDeployments = stubSimpleCall(expectedResponse); + const [response] = await client.listDeployments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeployments without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), + ]; + client.innerApiCalls.listDeployments = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDeployments( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IDeployment[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeployments with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDeployments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDeployments(request), expectedError); + const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeploymentsStream without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), + ]; + client.descriptors.page.listDeployments.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.Deployment[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.Deployment) => { + 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.listDeployments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDeployments, request)); + assert( + (client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDeploymentsStream with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeployments.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.Deployment[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.Deployment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDeployments, request)); + assert( + (client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDeployments without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), + ]; + client.descriptors.page.listDeployments.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1.IDeployment[] = []; + const iterable = client.listDeploymentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDeployments with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeployments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDeploymentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1.IDeployment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listToolsets', () => { + it('invokes listToolsets without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListToolsetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListToolsetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), + generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), + generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), + ]; + client.innerApiCalls.listToolsets = stubSimpleCall(expectedResponse); + const [response] = await client.listToolsets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listToolsets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listToolsets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listToolsets without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListToolsetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListToolsetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), + generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), + generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), + ]; + client.innerApiCalls.listToolsets = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listToolsets( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IToolset[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listToolsets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listToolsets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listToolsets with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListToolsetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListToolsetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listToolsets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listToolsets(request), expectedError); + const actualRequest = (client.innerApiCalls.listToolsets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listToolsets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listToolsetsStream without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListToolsetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListToolsetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), + generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), + generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), + ]; + client.descriptors.page.listToolsets.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listToolsetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.Toolset[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.Toolset) => { + 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.listToolsets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listToolsets, request)); + assert( + (client.descriptors.page.listToolsets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listToolsetsStream with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListToolsetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListToolsetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listToolsets.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listToolsetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.Toolset[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.Toolset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listToolsets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listToolsets, request)); + assert( + (client.descriptors.page.listToolsets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listToolsets without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListToolsetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListToolsetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), + generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), + generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), + ]; + client.descriptors.page.listToolsets.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1.IToolset[] = []; + const iterable = client.listToolsetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listToolsets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listToolsets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listToolsets with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListToolsetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListToolsetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listToolsets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listToolsetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1.IToolset[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listToolsets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listToolsets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAppVersions', () => { + it('invokes listAppVersions without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAppVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAppVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), + generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), + generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), + ]; + client.innerApiCalls.listAppVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listAppVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAppVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAppVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAppVersions without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAppVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAppVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), + generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), + generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), + ]; + client.innerApiCalls.listAppVersions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAppVersions( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IAppVersion[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAppVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAppVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAppVersions with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAppVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAppVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAppVersions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAppVersions(request), expectedError); + const actualRequest = (client.innerApiCalls.listAppVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAppVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAppVersionsStream without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAppVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAppVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), + generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), + generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), + ]; + client.descriptors.page.listAppVersions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAppVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.AppVersion[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.AppVersion) => { + 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.listAppVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAppVersions, request)); + assert( + (client.descriptors.page.listAppVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAppVersionsStream with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAppVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAppVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAppVersions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAppVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.AppVersion[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.AppVersion) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAppVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAppVersions, request)); + assert( + (client.descriptors.page.listAppVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAppVersions without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAppVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAppVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), + generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), + generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), + ]; + client.descriptors.page.listAppVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1.IAppVersion[] = []; + const iterable = client.listAppVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAppVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAppVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAppVersions with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListAppVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListAppVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAppVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAppVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1.IAppVersion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAppVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAppVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listChangelogs', () => { + it('invokes listChangelogs without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListChangelogsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListChangelogsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), + generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), + generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), + ]; + client.innerApiCalls.listChangelogs = stubSimpleCall(expectedResponse); + const [response] = await client.listChangelogs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listChangelogs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listChangelogs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChangelogs without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListChangelogsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListChangelogsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), + generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), + generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), + ]; + client.innerApiCalls.listChangelogs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listChangelogs( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IChangelog[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listChangelogs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listChangelogs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChangelogs with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListChangelogsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListChangelogsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listChangelogs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listChangelogs(request), expectedError); + const actualRequest = (client.innerApiCalls.listChangelogs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listChangelogs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChangelogsStream without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListChangelogsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListChangelogsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), + generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), + generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), + ]; + client.descriptors.page.listChangelogs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listChangelogsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.Changelog[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.Changelog) => { + 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.listChangelogs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listChangelogs, request)); + assert( + (client.descriptors.page.listChangelogs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listChangelogsStream with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListChangelogsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListChangelogsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listChangelogs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listChangelogsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1.Changelog[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1.Changelog) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listChangelogs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listChangelogs, request)); + assert( + (client.descriptors.page.listChangelogs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listChangelogs without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListChangelogsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListChangelogsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), + generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), + generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), + ]; + client.descriptors.page.listChangelogs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1.IChangelog[] = []; + const iterable = client.listChangelogsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listChangelogs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listChangelogs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listChangelogs with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ListChangelogsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ListChangelogsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listChangelogs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listChangelogsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1.IChangelog[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listChangelogs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listChangelogs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + 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 agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + 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 agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + 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 agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('agent', async () => { + const fakePath = "/rendered/path/agent"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + agent: "agentValue", + }; + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.agentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath("projectValue", "locationValue", "appValue", "agentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAgentName', () => { + const result = client.matchAppFromAgentName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, "agentValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('app', async () => { + const fakePath = "/rendered/path/app"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + }; + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.appPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('appPath', () => { + const result = client.appPath("projectValue", "locationValue", "appValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.appPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAppName', () => { + const result = client.matchProjectFromAppName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAppName', () => { + const result = client.matchLocationFromAppName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAppName', () => { + const result = client.matchAppFromAppName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('appVersion', async () => { + const fakePath = "/rendered/path/appVersion"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + version: "versionValue", + }; + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appVersionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.appVersionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('appVersionPath', () => { + const result = client.appVersionPath("projectValue", "locationValue", "appValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.appVersionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAppVersionName', () => { + const result = client.matchProjectFromAppVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAppVersionName', () => { + const result = client.matchLocationFromAppVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAppVersionName', () => { + const result = client.matchAppFromAppVersionName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromAppVersionName', () => { + const result = client.matchVersionFromAppVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('changelog', async () => { + const fakePath = "/rendered/path/changelog"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + changelog: "changelogValue", + }; + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath("projectValue", "locationValue", "appValue", "changelogValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromChangelogName', () => { + const result = client.matchAppFromChangelogName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, "changelogValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('conversation', async () => { + const fakePath = "/rendered/path/conversation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + conversation: "conversationValue", + }; + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.conversationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.conversationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('conversationPath', () => { + const result = client.conversationPath("projectValue", "locationValue", "appValue", "conversationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.conversationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConversationName', () => { + const result = client.matchProjectFromConversationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConversationName', () => { + const result = client.matchLocationFromConversationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromConversationName', () => { + const result = client.matchAppFromConversationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConversationFromConversationName', () => { + const result = client.matchConversationFromConversationName(fakePath); + assert.strictEqual(result, "conversationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', async () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + deployment: "deploymentValue", + }; + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "appValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromDeploymentName', () => { + const result = client.matchAppFromDeploymentName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('example', async () => { + const fakePath = "/rendered/path/example"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + example: "exampleValue", + }; + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.examplePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath("projectValue", "locationValue", "appValue", "exampleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromExampleName', () => { + const result = client.matchAppFromExampleName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, "exampleValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('guardrail', async () => { + const fakePath = "/rendered/path/guardrail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + guardrail: "guardrailValue", + }; + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.guardrailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.guardrailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('guardrailPath', () => { + const result = client.guardrailPath("projectValue", "locationValue", "appValue", "guardrailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.guardrailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGuardrailName', () => { + const result = client.matchProjectFromGuardrailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGuardrailName', () => { + const result = client.matchLocationFromGuardrailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromGuardrailName', () => { + const result = client.matchAppFromGuardrailName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGuardrailFromGuardrailName', () => { + const result = client.matchGuardrailFromGuardrailName(fakePath); + assert.strictEqual(result, "guardrailValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('omnichannel', async () => { + const fakePath = "/rendered/path/omnichannel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + omnichannel: "omnichannelValue", + }; + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.omnichannelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.omnichannelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('omnichannelPath', () => { + const result = client.omnichannelPath("projectValue", "locationValue", "omnichannelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.omnichannelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromOmnichannelName', () => { + const result = client.matchProjectFromOmnichannelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOmnichannelName', () => { + const result = client.matchLocationFromOmnichannelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOmnichannelFromOmnichannelName', () => { + const result = client.matchOmnichannelFromOmnichannelName(fakePath); + assert.strictEqual(result, "omnichannelValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tool', async () => { + const fakePath = "/rendered/path/tool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + tool: "toolValue", + }; + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.toolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath("projectValue", "locationValue", "appValue", "toolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromToolName', () => { + const result = client.matchAppFromToolName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, "toolValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('toolset', async () => { + const fakePath = "/rendered/path/toolset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + toolset: "toolsetValue", + }; + const client = new agentserviceModule.v1.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolsetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.toolsetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('toolsetPath', () => { + const result = client.toolsetPath("projectValue", "locationValue", "appValue", "toolsetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.toolsetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromToolsetName', () => { + const result = client.matchProjectFromToolsetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromToolsetName', () => { + const result = client.matchLocationFromToolsetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromToolsetName', () => { + const result = client.matchAppFromToolsetName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchToolsetFromToolsetName', () => { + const result = client.matchToolsetFromToolsetName(fakePath); + assert.strictEqual(result, "toolsetValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-ces/test/gapic_agent_service_v1beta.ts b/owl-bot-staging/google-cloud-ces/test/gapic_agent_service_v1beta.ts new file mode 100644 index 00000000000..bc020d1840d --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/test/gapic_agent_service_v1beta.ts @@ -0,0 +1,8537 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 agentserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, 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.AgentServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new agentserviceModule.v1beta.AgentServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new agentserviceModule.v1beta.AgentServiceClient(); + 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 = agentserviceModule.v1beta.AgentServiceClient.servicePath; + assert.strictEqual(servicePath, 'ces.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = agentserviceModule.v1beta.AgentServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 agentserviceModule.v1beta.AgentServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 agentserviceModule.v1beta.AgentServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 agentserviceModule.v1beta.AgentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = agentserviceModule.v1beta.AgentServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new agentserviceModule.v1beta.AgentServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.agentServiceStub, undefined); + await client.initialize(); + assert(client.agentServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.agentServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.agentServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + 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 agentserviceModule.v1beta.AgentServiceClient({ + 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('getApp', () => { + it('invokes getApp without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.App() + ); + client.innerApiCalls.getApp = stubSimpleCall(expectedResponse); + const [response] = await client.getApp(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApp without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.App() + ); + client.innerApiCalls.getApp = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApp( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IApp|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApp with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApp = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getApp(request), expectedError); + const actualRequest = (client.innerApiCalls.getApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApp with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetAppRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getApp(request), expectedError); + }); + }); + + describe('updateApp', () => { + it('invokes updateApp without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateAppRequest() + ); + request.app ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateAppRequest', ['app', 'name']); + request.app.name = defaultValue1; + const expectedHeaderRequestParams = `app.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.App() + ); + client.innerApiCalls.updateApp = stubSimpleCall(expectedResponse); + const [response] = await client.updateApp(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApp without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateAppRequest() + ); + request.app ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateAppRequest', ['app', 'name']); + request.app.name = defaultValue1; + const expectedHeaderRequestParams = `app.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.App() + ); + client.innerApiCalls.updateApp = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateApp( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IApp|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApp with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateAppRequest() + ); + request.app ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateAppRequest', ['app', 'name']); + request.app.name = defaultValue1; + const expectedHeaderRequestParams = `app.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApp = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateApp(request), expectedError); + const actualRequest = (client.innerApiCalls.updateApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApp with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateAppRequest() + ); + request.app ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateAppRequest', ['app', 'name']); + request.app.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateApp(request), expectedError); + }); + }); + + describe('getAgent', () => { + it('invokes getAgent without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetAgentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Agent() + ); + client.innerApiCalls.getAgent = stubSimpleCall(expectedResponse); + const [response] = await client.getAgent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgent without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetAgentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Agent() + ); + client.innerApiCalls.getAgent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAgent( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IAgent|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgent with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetAgentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAgent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAgent(request), expectedError); + const actualRequest = (client.innerApiCalls.getAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgent with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetAgentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getAgent(request), expectedError); + }); + }); + + describe('createAgent', () => { + it('invokes createAgent without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateAgentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Agent() + ); + client.innerApiCalls.createAgent = stubSimpleCall(expectedResponse); + const [response] = await client.createAgent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAgent without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateAgentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Agent() + ); + client.innerApiCalls.createAgent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAgent( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IAgent|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAgent with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateAgentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAgent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createAgent(request), expectedError); + const actualRequest = (client.innerApiCalls.createAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAgent with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateAgentRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createAgent(request), expectedError); + }); + }); + + describe('updateAgent', () => { + it('invokes updateAgent without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateAgentRequest() + ); + request.agent ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateAgentRequest', ['agent', 'name']); + request.agent.name = defaultValue1; + const expectedHeaderRequestParams = `agent.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Agent() + ); + client.innerApiCalls.updateAgent = stubSimpleCall(expectedResponse); + const [response] = await client.updateAgent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAgent without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateAgentRequest() + ); + request.agent ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateAgentRequest', ['agent', 'name']); + request.agent.name = defaultValue1; + const expectedHeaderRequestParams = `agent.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Agent() + ); + client.innerApiCalls.updateAgent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAgent( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IAgent|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAgent with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateAgentRequest() + ); + request.agent ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateAgentRequest', ['agent', 'name']); + request.agent.name = defaultValue1; + const expectedHeaderRequestParams = `agent.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAgent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateAgent(request), expectedError); + const actualRequest = (client.innerApiCalls.updateAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAgent with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateAgentRequest() + ); + request.agent ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateAgentRequest', ['agent', 'name']); + request.agent.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateAgent(request), expectedError); + }); + }); + + describe('deleteAgent', () => { + it('invokes deleteAgent without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteAgentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAgent = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAgent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAgent without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteAgentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAgent = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAgent( + 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.deleteAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAgent with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteAgentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAgent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteAgent(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteAgent as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAgent as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAgent with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteAgentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteAgentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteAgent(request), expectedError); + }); + }); + + describe('getExample', () => { + it('invokes getExample without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetExampleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Example() + ); + client.innerApiCalls.getExample = stubSimpleCall(expectedResponse); + const [response] = await client.getExample(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExample without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetExampleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Example() + ); + client.innerApiCalls.getExample = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getExample( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IExample|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExample with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetExampleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getExample = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getExample(request), expectedError); + const actualRequest = (client.innerApiCalls.getExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExample with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetExampleRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getExample(request), expectedError); + }); + }); + + describe('createExample', () => { + it('invokes createExample without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateExampleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Example() + ); + client.innerApiCalls.createExample = stubSimpleCall(expectedResponse); + const [response] = await client.createExample(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExample without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateExampleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Example() + ); + client.innerApiCalls.createExample = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createExample( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IExample|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExample with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateExampleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createExample = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createExample(request), expectedError); + const actualRequest = (client.innerApiCalls.createExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExample with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateExampleRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createExample(request), expectedError); + }); + }); + + describe('updateExample', () => { + it('invokes updateExample without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateExampleRequest() + ); + request.example ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateExampleRequest', ['example', 'name']); + request.example.name = defaultValue1; + const expectedHeaderRequestParams = `example.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Example() + ); + client.innerApiCalls.updateExample = stubSimpleCall(expectedResponse); + const [response] = await client.updateExample(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExample without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateExampleRequest() + ); + request.example ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateExampleRequest', ['example', 'name']); + request.example.name = defaultValue1; + const expectedHeaderRequestParams = `example.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Example() + ); + client.innerApiCalls.updateExample = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExample( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IExample|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExample with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateExampleRequest() + ); + request.example ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateExampleRequest', ['example', 'name']); + request.example.name = defaultValue1; + const expectedHeaderRequestParams = `example.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExample = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateExample(request), expectedError); + const actualRequest = (client.innerApiCalls.updateExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExample with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateExampleRequest() + ); + request.example ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateExampleRequest', ['example', 'name']); + request.example.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateExample(request), expectedError); + }); + }); + + describe('deleteExample', () => { + it('invokes deleteExample without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteExampleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteExample = stubSimpleCall(expectedResponse); + const [response] = await client.deleteExample(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExample without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteExampleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteExample = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteExample( + 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.deleteExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExample with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteExampleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExample = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteExample(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteExample as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExample as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExample with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteExampleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteExampleRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteExample(request), expectedError); + }); + }); + + describe('getTool', () => { + it('invokes getTool without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetToolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Tool() + ); + client.innerApiCalls.getTool = stubSimpleCall(expectedResponse); + const [response] = await client.getTool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTool without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetToolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Tool() + ); + client.innerApiCalls.getTool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTool( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.ITool|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTool with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetToolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTool(request), expectedError); + const actualRequest = (client.innerApiCalls.getTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTool with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetToolRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getTool(request), expectedError); + }); + }); + + describe('getConversation', () => { + it('invokes getConversation without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetConversationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Conversation() + ); + client.innerApiCalls.getConversation = stubSimpleCall(expectedResponse); + const [response] = await client.getConversation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConversation without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetConversationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Conversation() + ); + client.innerApiCalls.getConversation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConversation( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IConversation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConversation with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetConversationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConversation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getConversation(request), expectedError); + const actualRequest = (client.innerApiCalls.getConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConversation with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetConversationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getConversation(request), expectedError); + }); + }); + + describe('deleteConversation', () => { + it('invokes deleteConversation without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteConversationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteConversation = stubSimpleCall(expectedResponse); + const [response] = await client.deleteConversation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConversation without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteConversationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteConversation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteConversation( + 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.deleteConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConversation with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteConversationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConversation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteConversation(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConversation with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteConversationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteConversation(request), expectedError); + }); + }); + + describe('createTool', () => { + it('invokes createTool without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateToolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Tool() + ); + client.innerApiCalls.createTool = stubSimpleCall(expectedResponse); + const [response] = await client.createTool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTool without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateToolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Tool() + ); + client.innerApiCalls.createTool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTool( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.ITool|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTool with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateToolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTool(request), expectedError); + const actualRequest = (client.innerApiCalls.createTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTool with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateToolRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createTool(request), expectedError); + }); + }); + + describe('updateTool', () => { + it('invokes updateTool without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateToolRequest() + ); + request.tool ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateToolRequest', ['tool', 'name']); + request.tool.name = defaultValue1; + const expectedHeaderRequestParams = `tool.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Tool() + ); + client.innerApiCalls.updateTool = stubSimpleCall(expectedResponse); + const [response] = await client.updateTool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTool without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateToolRequest() + ); + request.tool ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateToolRequest', ['tool', 'name']); + request.tool.name = defaultValue1; + const expectedHeaderRequestParams = `tool.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Tool() + ); + client.innerApiCalls.updateTool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTool( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.ITool|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTool with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateToolRequest() + ); + request.tool ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateToolRequest', ['tool', 'name']); + request.tool.name = defaultValue1; + const expectedHeaderRequestParams = `tool.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateTool(request), expectedError); + const actualRequest = (client.innerApiCalls.updateTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTool with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateToolRequest() + ); + request.tool ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateToolRequest', ['tool', 'name']); + request.tool.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateTool(request), expectedError); + }); + }); + + describe('deleteTool', () => { + it('invokes deleteTool without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteToolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTool = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTool without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteToolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTool( + 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.deleteTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTool with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteToolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteTool(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTool with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteToolRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteTool(request), expectedError); + }); + }); + + describe('getGuardrail', () => { + it('invokes getGuardrail without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetGuardrailRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Guardrail() + ); + client.innerApiCalls.getGuardrail = stubSimpleCall(expectedResponse); + const [response] = await client.getGuardrail(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGuardrail without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetGuardrailRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Guardrail() + ); + client.innerApiCalls.getGuardrail = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGuardrail( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IGuardrail|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGuardrail with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetGuardrailRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGuardrail = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getGuardrail(request), expectedError); + const actualRequest = (client.innerApiCalls.getGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGuardrail with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetGuardrailRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getGuardrail(request), expectedError); + }); + }); + + describe('createGuardrail', () => { + it('invokes createGuardrail without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateGuardrailRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Guardrail() + ); + client.innerApiCalls.createGuardrail = stubSimpleCall(expectedResponse); + const [response] = await client.createGuardrail(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGuardrail without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateGuardrailRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Guardrail() + ); + client.innerApiCalls.createGuardrail = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGuardrail( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IGuardrail|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGuardrail with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateGuardrailRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGuardrail = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createGuardrail(request), expectedError); + const actualRequest = (client.innerApiCalls.createGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGuardrail with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateGuardrailRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createGuardrail(request), expectedError); + }); + }); + + describe('updateGuardrail', () => { + it('invokes updateGuardrail without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateGuardrailRequest() + ); + request.guardrail ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateGuardrailRequest', ['guardrail', 'name']); + request.guardrail.name = defaultValue1; + const expectedHeaderRequestParams = `guardrail.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Guardrail() + ); + client.innerApiCalls.updateGuardrail = stubSimpleCall(expectedResponse); + const [response] = await client.updateGuardrail(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGuardrail without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateGuardrailRequest() + ); + request.guardrail ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateGuardrailRequest', ['guardrail', 'name']); + request.guardrail.name = defaultValue1; + const expectedHeaderRequestParams = `guardrail.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Guardrail() + ); + client.innerApiCalls.updateGuardrail = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGuardrail( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IGuardrail|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGuardrail with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateGuardrailRequest() + ); + request.guardrail ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateGuardrailRequest', ['guardrail', 'name']); + request.guardrail.name = defaultValue1; + const expectedHeaderRequestParams = `guardrail.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGuardrail = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateGuardrail(request), expectedError); + const actualRequest = (client.innerApiCalls.updateGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGuardrail with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateGuardrailRequest() + ); + request.guardrail ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateGuardrailRequest', ['guardrail', 'name']); + request.guardrail.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateGuardrail(request), expectedError); + }); + }); + + describe('deleteGuardrail', () => { + it('invokes deleteGuardrail without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteGuardrailRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteGuardrail = stubSimpleCall(expectedResponse); + const [response] = await client.deleteGuardrail(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGuardrail without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteGuardrailRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteGuardrail = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteGuardrail( + 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.deleteGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGuardrail with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteGuardrailRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGuardrail = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteGuardrail(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteGuardrail as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGuardrail as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGuardrail with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteGuardrailRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteGuardrailRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteGuardrail(request), expectedError); + }); + }); + + describe('getDeployment', () => { + it('invokes getDeployment without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Deployment() + ); + client.innerApiCalls.getDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.getDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Deployment() + ); + client.innerApiCalls.getDeployment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDeployment( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IDeployment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDeployment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getDeployment(request), expectedError); + }); + }); + + describe('createDeployment', () => { + it('invokes createDeployment without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Deployment() + ); + client.innerApiCalls.createDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.createDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeployment without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Deployment() + ); + client.innerApiCalls.createDeployment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDeployment( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IDeployment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeployment with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDeployment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeployment with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createDeployment(request), expectedError); + }); + }); + + describe('updateDeployment', () => { + it('invokes updateDeployment without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateDeploymentRequest', ['deployment', 'name']); + request.deployment.name = defaultValue1; + const expectedHeaderRequestParams = `deployment.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Deployment() + ); + client.innerApiCalls.updateDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.updateDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeployment without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateDeploymentRequest', ['deployment', 'name']); + request.deployment.name = defaultValue1; + const expectedHeaderRequestParams = `deployment.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Deployment() + ); + client.innerApiCalls.updateDeployment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDeployment( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IDeployment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeployment with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateDeploymentRequest', ['deployment', 'name']); + request.deployment.name = defaultValue1; + const expectedHeaderRequestParams = `deployment.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDeployment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeployment with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateDeploymentRequest', ['deployment', 'name']); + request.deployment.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateDeployment(request), expectedError); + }); + }); + + describe('deleteDeployment', () => { + it('invokes deleteDeployment without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeployment without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDeployment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDeployment( + 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.deleteDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeployment with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDeployment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeployment with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteDeployment(request), expectedError); + }); + }); + + describe('getToolset', () => { + it('invokes getToolset without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetToolsetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Toolset() + ); + client.innerApiCalls.getToolset = stubSimpleCall(expectedResponse); + const [response] = await client.getToolset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getToolset without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetToolsetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Toolset() + ); + client.innerApiCalls.getToolset = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getToolset( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IToolset|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getToolset with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetToolsetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getToolset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getToolset(request), expectedError); + const actualRequest = (client.innerApiCalls.getToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getToolset with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetToolsetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getToolset(request), expectedError); + }); + }); + + describe('createToolset', () => { + it('invokes createToolset without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateToolsetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Toolset() + ); + client.innerApiCalls.createToolset = stubSimpleCall(expectedResponse); + const [response] = await client.createToolset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createToolset without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateToolsetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Toolset() + ); + client.innerApiCalls.createToolset = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createToolset( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IToolset|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createToolset with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateToolsetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createToolset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createToolset(request), expectedError); + const actualRequest = (client.innerApiCalls.createToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createToolset with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateToolsetRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createToolset(request), expectedError); + }); + }); + + describe('updateToolset', () => { + it('invokes updateToolset without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateToolsetRequest() + ); + request.toolset ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateToolsetRequest', ['toolset', 'name']); + request.toolset.name = defaultValue1; + const expectedHeaderRequestParams = `toolset.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Toolset() + ); + client.innerApiCalls.updateToolset = stubSimpleCall(expectedResponse); + const [response] = await client.updateToolset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateToolset without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateToolsetRequest() + ); + request.toolset ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateToolsetRequest', ['toolset', 'name']); + request.toolset.name = defaultValue1; + const expectedHeaderRequestParams = `toolset.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Toolset() + ); + client.innerApiCalls.updateToolset = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateToolset( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IToolset|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateToolset with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateToolsetRequest() + ); + request.toolset ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateToolsetRequest', ['toolset', 'name']); + request.toolset.name = defaultValue1; + const expectedHeaderRequestParams = `toolset.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateToolset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateToolset(request), expectedError); + const actualRequest = (client.innerApiCalls.updateToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateToolset with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateToolsetRequest() + ); + request.toolset ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateToolsetRequest', ['toolset', 'name']); + request.toolset.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateToolset(request), expectedError); + }); + }); + + describe('deleteToolset', () => { + it('invokes deleteToolset without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteToolsetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteToolset = stubSimpleCall(expectedResponse); + const [response] = await client.deleteToolset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteToolset without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteToolsetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteToolset = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteToolset( + 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.deleteToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteToolset with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteToolsetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteToolset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteToolset(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteToolset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteToolset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteToolset with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteToolsetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteToolsetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteToolset(request), expectedError); + }); + }); + + describe('getAppVersion', () => { + it('invokes getAppVersion without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.AppVersion() + ); + client.innerApiCalls.getAppVersion = stubSimpleCall(expectedResponse); + const [response] = await client.getAppVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAppVersion without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.AppVersion() + ); + client.innerApiCalls.getAppVersion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAppVersion( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IAppVersion|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAppVersion with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAppVersion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAppVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.getAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAppVersion with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getAppVersion(request), expectedError); + }); + }); + + describe('createAppVersion', () => { + it('invokes createAppVersion without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateAppVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.AppVersion() + ); + client.innerApiCalls.createAppVersion = stubSimpleCall(expectedResponse); + const [response] = await client.createAppVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAppVersion without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateAppVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.AppVersion() + ); + client.innerApiCalls.createAppVersion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAppVersion( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IAppVersion|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAppVersion with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateAppVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAppVersion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createAppVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.createAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAppVersion with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateAppVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createAppVersion(request), expectedError); + }); + }); + + describe('deleteAppVersion', () => { + it('invokes deleteAppVersion without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAppVersion = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAppVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAppVersion without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAppVersion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAppVersion( + 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.deleteAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAppVersion with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAppVersion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteAppVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAppVersion with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteAppVersion(request), expectedError); + }); + }); + + describe('getChangelog', () => { + it('invokes getChangelog without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetChangelogRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetChangelogRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Changelog() + ); + client.innerApiCalls.getChangelog = stubSimpleCall(expectedResponse); + const [response] = await client.getChangelog(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getChangelog as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getChangelog as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChangelog without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetChangelogRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetChangelogRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Changelog() + ); + client.innerApiCalls.getChangelog = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getChangelog( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IChangelog|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getChangelog as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getChangelog as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChangelog with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetChangelogRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetChangelogRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getChangelog = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getChangelog(request), expectedError); + const actualRequest = (client.innerApiCalls.getChangelog as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getChangelog as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChangelog with closed client', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetChangelogRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetChangelogRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getChangelog(request), expectedError); + }); + }); + + describe('createApp', () => { + it('invokes createApp without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateAppRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createApp = stubLongRunningCall(expectedResponse); + const [operation] = await client.createApp(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApp without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateAppRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createApp = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApp( + 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.createApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApp with call error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateAppRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApp = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createApp(request), expectedError); + const actualRequest = (client.innerApiCalls.createApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApp with LRO error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateAppRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApp = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createApp(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateAppProgress without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateAppProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateAppProgress with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateAppProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteApp', () => { + it('invokes deleteApp without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteApp = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteApp(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApp without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteApp = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteApp( + 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.deleteApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApp with call error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApp = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteApp(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApp with LRO error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApp = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteApp(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteAppProgress without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteAppProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteAppProgress with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteAppProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('exportApp', () => { + it('invokes exportApp without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ExportAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ExportAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportApp = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportApp(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.exportApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportApp without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ExportAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ExportAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportApp = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportApp( + 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.exportApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportApp with call error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ExportAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ExportAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportApp = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportApp(request), expectedError); + const actualRequest = (client.innerApiCalls.exportApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportApp with LRO error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ExportAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ExportAppRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportApp = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportApp(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.exportApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportAppProgress without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkExportAppProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportAppProgress with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkExportAppProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('importApp', () => { + it('invokes importApp without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ImportAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ImportAppRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importApp = stubLongRunningCall(expectedResponse); + const [operation] = await client.importApp(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.importApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importApp without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ImportAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ImportAppRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importApp = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importApp( + 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.importApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importApp with call error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ImportAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ImportAppRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.importApp = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.importApp(request), expectedError); + const actualRequest = (client.innerApiCalls.importApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importApp with LRO error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ImportAppRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ImportAppRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.importApp = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.importApp(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.importApp as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importApp as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportAppProgress without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkImportAppProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportAppProgress with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkImportAppProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('batchDeleteConversations', () => { + it('invokes batchDeleteConversations without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.BatchDeleteConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.BatchDeleteConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchDeleteConversations = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchDeleteConversations(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchDeleteConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteConversations without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.BatchDeleteConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.BatchDeleteConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchDeleteConversations = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchDeleteConversations( + 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.batchDeleteConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteConversations with call error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.BatchDeleteConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.BatchDeleteConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchDeleteConversations = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchDeleteConversations(request), expectedError); + const actualRequest = (client.innerApiCalls.batchDeleteConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteConversations with LRO error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.BatchDeleteConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.BatchDeleteConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchDeleteConversations = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchDeleteConversations(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.batchDeleteConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchDeleteConversationsProgress without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchDeleteConversationsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchDeleteConversationsProgress with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkBatchDeleteConversationsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('restoreAppVersion', () => { + it('invokes restoreAppVersion without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RestoreAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RestoreAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreAppVersion = stubLongRunningCall(expectedResponse); + const [operation] = await client.restoreAppVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restoreAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreAppVersion without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RestoreAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RestoreAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreAppVersion = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreAppVersion( + 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.restoreAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreAppVersion with call error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RestoreAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RestoreAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreAppVersion = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restoreAppVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.restoreAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreAppVersion with LRO error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RestoreAppVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RestoreAppVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreAppVersion = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restoreAppVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.restoreAppVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreAppVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestoreAppVersionProgress without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRestoreAppVersionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestoreAppVersionProgress with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkRestoreAppVersionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listApps', () => { + it('invokes listApps without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAppsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAppsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.App()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.App()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.App()), + ]; + client.innerApiCalls.listApps = stubSimpleCall(expectedResponse); + const [response] = await client.listApps(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listApps as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listApps as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApps without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAppsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAppsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.App()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.App()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.App()), + ]; + client.innerApiCalls.listApps = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApps( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IApp[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listApps as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listApps as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApps with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAppsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAppsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApps = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listApps(request), expectedError); + const actualRequest = (client.innerApiCalls.listApps as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listApps as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAppsStream without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAppsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAppsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.App()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.App()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.App()), + ]; + client.descriptors.page.listApps.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAppsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.App[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.App) => { + 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.listApps.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listApps, request)); + assert( + (client.descriptors.page.listApps.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAppsStream with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAppsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAppsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listApps.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAppsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.App[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.App) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listApps.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listApps, request)); + assert( + (client.descriptors.page.listApps.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApps without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAppsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAppsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.App()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.App()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.App()), + ]; + client.descriptors.page.listApps.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1beta.IApp[] = []; + const iterable = client.listAppsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listApps.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listApps.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApps with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAppsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAppsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listApps.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAppsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1beta.IApp[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listApps.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listApps.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAgents', () => { + it('invokes listAgents without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAgentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAgentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Agent()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Agent()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Agent()), + ]; + client.innerApiCalls.listAgents = stubSimpleCall(expectedResponse); + const [response] = await client.listAgents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAgents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAgents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAgents without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAgentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAgentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Agent()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Agent()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Agent()), + ]; + client.innerApiCalls.listAgents = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAgents( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IAgent[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAgents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAgents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAgents with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAgentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAgentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAgents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAgents(request), expectedError); + const actualRequest = (client.innerApiCalls.listAgents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAgents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAgentsStream without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAgentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAgentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Agent()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Agent()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Agent()), + ]; + client.descriptors.page.listAgents.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAgentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.Agent[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.Agent) => { + 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.listAgents.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAgents, request)); + assert( + (client.descriptors.page.listAgents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAgentsStream with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAgentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAgentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAgents.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAgentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.Agent[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.Agent) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAgents.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAgents, request)); + assert( + (client.descriptors.page.listAgents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAgents without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAgentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAgentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Agent()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Agent()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Agent()), + ]; + client.descriptors.page.listAgents.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1beta.IAgent[] = []; + const iterable = client.listAgentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAgents.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAgents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAgents with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAgentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAgentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAgents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAgentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1beta.IAgent[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAgents.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAgents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listExamples', () => { + it('invokes listExamples without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListExamplesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListExamplesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Example()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Example()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Example()), + ]; + client.innerApiCalls.listExamples = stubSimpleCall(expectedResponse); + const [response] = await client.listExamples(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listExamples as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExamples as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExamples without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListExamplesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListExamplesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Example()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Example()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Example()), + ]; + client.innerApiCalls.listExamples = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listExamples( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IExample[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listExamples as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExamples as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExamples with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListExamplesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListExamplesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listExamples = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listExamples(request), expectedError); + const actualRequest = (client.innerApiCalls.listExamples as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExamples as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExamplesStream without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListExamplesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListExamplesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Example()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Example()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Example()), + ]; + client.descriptors.page.listExamples.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listExamplesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.Example[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.Example) => { + 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.listExamples.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listExamples, request)); + assert( + (client.descriptors.page.listExamples.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listExamplesStream with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListExamplesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListExamplesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listExamples.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listExamplesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.Example[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.Example) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listExamples.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listExamples, request)); + assert( + (client.descriptors.page.listExamples.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listExamples without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListExamplesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListExamplesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Example()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Example()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Example()), + ]; + client.descriptors.page.listExamples.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1beta.IExample[] = []; + const iterable = client.listExamplesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listExamples.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listExamples.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listExamples with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListExamplesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListExamplesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listExamples.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listExamplesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1beta.IExample[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listExamples.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listExamples.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTools', () => { + it('invokes listTools without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListToolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Tool()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Tool()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Tool()), + ]; + client.innerApiCalls.listTools = stubSimpleCall(expectedResponse); + const [response] = await client.listTools(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTools without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListToolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Tool()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Tool()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Tool()), + ]; + client.innerApiCalls.listTools = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTools( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.ITool[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTools with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListToolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTools = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTools(request), expectedError); + const actualRequest = (client.innerApiCalls.listTools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listToolsStream without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListToolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Tool()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Tool()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Tool()), + ]; + client.descriptors.page.listTools.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listToolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.Tool[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.Tool) => { + 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.listTools.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTools, request)); + assert( + (client.descriptors.page.listTools.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listToolsStream with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListToolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listTools.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listToolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.Tool[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.Tool) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTools.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTools, request)); + assert( + (client.descriptors.page.listTools.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTools without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListToolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Tool()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Tool()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Tool()), + ]; + client.descriptors.page.listTools.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1beta.ITool[] = []; + const iterable = client.listToolsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTools.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTools.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTools with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListToolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listTools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listToolsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1beta.ITool[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTools.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTools.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listConversations', () => { + it('invokes listConversations without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Conversation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Conversation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Conversation()), + ]; + client.innerApiCalls.listConversations = stubSimpleCall(expectedResponse); + const [response] = await client.listConversations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConversations without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Conversation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Conversation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Conversation()), + ]; + client.innerApiCalls.listConversations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listConversations( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IConversation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConversations with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listConversations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listConversations(request), expectedError); + const actualRequest = (client.innerApiCalls.listConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConversationsStream without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Conversation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Conversation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Conversation()), + ]; + client.descriptors.page.listConversations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listConversationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.Conversation[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.Conversation) => { + 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.listConversations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listConversations, request)); + assert( + (client.descriptors.page.listConversations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listConversationsStream with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listConversations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listConversationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.Conversation[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.Conversation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listConversations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listConversations, request)); + assert( + (client.descriptors.page.listConversations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConversations without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Conversation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Conversation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Conversation()), + ]; + client.descriptors.page.listConversations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1beta.IConversation[] = []; + const iterable = client.listConversationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listConversations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listConversations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConversations with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listConversations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listConversationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1beta.IConversation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listConversations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listConversations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listGuardrails', () => { + it('invokes listGuardrails without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListGuardrailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListGuardrailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Guardrail()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Guardrail()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Guardrail()), + ]; + client.innerApiCalls.listGuardrails = stubSimpleCall(expectedResponse); + const [response] = await client.listGuardrails(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listGuardrails as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listGuardrails as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGuardrails without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListGuardrailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListGuardrailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Guardrail()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Guardrail()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Guardrail()), + ]; + client.innerApiCalls.listGuardrails = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGuardrails( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IGuardrail[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listGuardrails as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listGuardrails as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGuardrails with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListGuardrailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListGuardrailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listGuardrails = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listGuardrails(request), expectedError); + const actualRequest = (client.innerApiCalls.listGuardrails as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listGuardrails as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGuardrailsStream without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListGuardrailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListGuardrailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Guardrail()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Guardrail()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Guardrail()), + ]; + client.descriptors.page.listGuardrails.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listGuardrailsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.Guardrail[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.Guardrail) => { + 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.listGuardrails.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listGuardrails, request)); + assert( + (client.descriptors.page.listGuardrails.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listGuardrailsStream with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListGuardrailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListGuardrailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listGuardrails.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listGuardrailsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.Guardrail[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.Guardrail) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listGuardrails.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listGuardrails, request)); + assert( + (client.descriptors.page.listGuardrails.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGuardrails without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListGuardrailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListGuardrailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Guardrail()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Guardrail()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Guardrail()), + ]; + client.descriptors.page.listGuardrails.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1beta.IGuardrail[] = []; + const iterable = client.listGuardrailsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listGuardrails.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listGuardrails.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGuardrails with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListGuardrailsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListGuardrailsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listGuardrails.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listGuardrailsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1beta.IGuardrail[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listGuardrails.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listGuardrails.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDeployments', () => { + it('invokes listDeployments without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Deployment()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Deployment()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Deployment()), + ]; + client.innerApiCalls.listDeployments = stubSimpleCall(expectedResponse); + const [response] = await client.listDeployments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeployments without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Deployment()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Deployment()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Deployment()), + ]; + client.innerApiCalls.listDeployments = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDeployments( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IDeployment[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeployments with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDeployments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDeployments(request), expectedError); + const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeploymentsStream without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Deployment()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Deployment()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Deployment()), + ]; + client.descriptors.page.listDeployments.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.Deployment[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.Deployment) => { + 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.listDeployments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDeployments, request)); + assert( + (client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDeploymentsStream with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeployments.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.Deployment[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.Deployment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDeployments, request)); + assert( + (client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDeployments without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Deployment()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Deployment()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Deployment()), + ]; + client.descriptors.page.listDeployments.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1beta.IDeployment[] = []; + const iterable = client.listDeploymentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDeployments with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeployments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDeploymentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1beta.IDeployment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listToolsets', () => { + it('invokes listToolsets without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListToolsetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListToolsetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Toolset()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Toolset()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Toolset()), + ]; + client.innerApiCalls.listToolsets = stubSimpleCall(expectedResponse); + const [response] = await client.listToolsets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listToolsets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listToolsets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listToolsets without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListToolsetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListToolsetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Toolset()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Toolset()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Toolset()), + ]; + client.innerApiCalls.listToolsets = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listToolsets( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IToolset[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listToolsets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listToolsets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listToolsets with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListToolsetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListToolsetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listToolsets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listToolsets(request), expectedError); + const actualRequest = (client.innerApiCalls.listToolsets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listToolsets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listToolsetsStream without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListToolsetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListToolsetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Toolset()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Toolset()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Toolset()), + ]; + client.descriptors.page.listToolsets.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listToolsetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.Toolset[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.Toolset) => { + 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.listToolsets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listToolsets, request)); + assert( + (client.descriptors.page.listToolsets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listToolsetsStream with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListToolsetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListToolsetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listToolsets.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listToolsetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.Toolset[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.Toolset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listToolsets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listToolsets, request)); + assert( + (client.descriptors.page.listToolsets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listToolsets without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListToolsetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListToolsetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Toolset()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Toolset()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Toolset()), + ]; + client.descriptors.page.listToolsets.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1beta.IToolset[] = []; + const iterable = client.listToolsetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listToolsets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listToolsets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listToolsets with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListToolsetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListToolsetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listToolsets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listToolsetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1beta.IToolset[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listToolsets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listToolsets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAppVersions', () => { + it('invokes listAppVersions without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAppVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAppVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.AppVersion()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.AppVersion()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.AppVersion()), + ]; + client.innerApiCalls.listAppVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listAppVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAppVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAppVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAppVersions without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAppVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAppVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.AppVersion()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.AppVersion()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.AppVersion()), + ]; + client.innerApiCalls.listAppVersions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAppVersions( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IAppVersion[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAppVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAppVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAppVersions with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAppVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAppVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAppVersions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAppVersions(request), expectedError); + const actualRequest = (client.innerApiCalls.listAppVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAppVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAppVersionsStream without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAppVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAppVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.AppVersion()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.AppVersion()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.AppVersion()), + ]; + client.descriptors.page.listAppVersions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAppVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.AppVersion[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.AppVersion) => { + 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.listAppVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAppVersions, request)); + assert( + (client.descriptors.page.listAppVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAppVersionsStream with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAppVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAppVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAppVersions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAppVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.AppVersion[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.AppVersion) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAppVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAppVersions, request)); + assert( + (client.descriptors.page.listAppVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAppVersions without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAppVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAppVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.AppVersion()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.AppVersion()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.AppVersion()), + ]; + client.descriptors.page.listAppVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1beta.IAppVersion[] = []; + const iterable = client.listAppVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAppVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAppVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAppVersions with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListAppVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListAppVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAppVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAppVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1beta.IAppVersion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAppVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAppVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listChangelogs', () => { + it('invokes listChangelogs without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListChangelogsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListChangelogsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Changelog()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Changelog()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Changelog()), + ]; + client.innerApiCalls.listChangelogs = stubSimpleCall(expectedResponse); + const [response] = await client.listChangelogs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listChangelogs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listChangelogs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChangelogs without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListChangelogsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListChangelogsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Changelog()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Changelog()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Changelog()), + ]; + client.innerApiCalls.listChangelogs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listChangelogs( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IChangelog[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listChangelogs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listChangelogs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChangelogs with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListChangelogsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListChangelogsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listChangelogs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listChangelogs(request), expectedError); + const actualRequest = (client.innerApiCalls.listChangelogs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listChangelogs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChangelogsStream without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListChangelogsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListChangelogsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Changelog()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Changelog()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Changelog()), + ]; + client.descriptors.page.listChangelogs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listChangelogsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.Changelog[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.Changelog) => { + 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.listChangelogs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listChangelogs, request)); + assert( + (client.descriptors.page.listChangelogs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listChangelogsStream with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListChangelogsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListChangelogsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listChangelogs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listChangelogsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.Changelog[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.Changelog) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listChangelogs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listChangelogs, request)); + assert( + (client.descriptors.page.listChangelogs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listChangelogs without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListChangelogsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListChangelogsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Changelog()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Changelog()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Changelog()), + ]; + client.descriptors.page.listChangelogs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1beta.IChangelog[] = []; + const iterable = client.listChangelogsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listChangelogs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listChangelogs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listChangelogs with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListChangelogsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListChangelogsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listChangelogs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listChangelogsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1beta.IChangelog[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listChangelogs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listChangelogs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + 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 agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + 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 agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + 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 agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('agent', async () => { + const fakePath = "/rendered/path/agent"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + agent: "agentValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.agentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath("projectValue", "locationValue", "appValue", "agentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAgentName', () => { + const result = client.matchAppFromAgentName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, "agentValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('app', async () => { + const fakePath = "/rendered/path/app"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.appPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('appPath', () => { + const result = client.appPath("projectValue", "locationValue", "appValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.appPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAppName', () => { + const result = client.matchProjectFromAppName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAppName', () => { + const result = client.matchLocationFromAppName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAppName', () => { + const result = client.matchAppFromAppName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('appVersion', async () => { + const fakePath = "/rendered/path/appVersion"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + version: "versionValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appVersionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.appVersionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('appVersionPath', () => { + const result = client.appVersionPath("projectValue", "locationValue", "appValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.appVersionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAppVersionName', () => { + const result = client.matchProjectFromAppVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAppVersionName', () => { + const result = client.matchLocationFromAppVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAppVersionName', () => { + const result = client.matchAppFromAppVersionName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromAppVersionName', () => { + const result = client.matchVersionFromAppVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('changelog', async () => { + const fakePath = "/rendered/path/changelog"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + changelog: "changelogValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath("projectValue", "locationValue", "appValue", "changelogValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromChangelogName', () => { + const result = client.matchAppFromChangelogName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, "changelogValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('conversation', async () => { + const fakePath = "/rendered/path/conversation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + conversation: "conversationValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.conversationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.conversationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('conversationPath', () => { + const result = client.conversationPath("projectValue", "locationValue", "appValue", "conversationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.conversationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConversationName', () => { + const result = client.matchProjectFromConversationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConversationName', () => { + const result = client.matchLocationFromConversationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromConversationName', () => { + const result = client.matchAppFromConversationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConversationFromConversationName', () => { + const result = client.matchConversationFromConversationName(fakePath); + assert.strictEqual(result, "conversationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', async () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + deployment: "deploymentValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "appValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromDeploymentName', () => { + const result = client.matchAppFromDeploymentName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluation', async () => { + const fakePath = "/rendered/path/evaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation: "evaluationValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationPath', () => { + const result = client.evaluationPath("projectValue", "locationValue", "appValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationName', () => { + const result = client.matchProjectFromEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationName', () => { + const result = client.matchLocationFromEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationName', () => { + const result = client.matchAppFromEvaluationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromEvaluationName', () => { + const result = client.matchEvaluationFromEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationDataset', async () => { + const fakePath = "/rendered/path/evaluationDataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation_dataset: "evaluationDatasetValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationDatasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationDatasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationDatasetPath', () => { + const result = client.evaluationDatasetPath("projectValue", "locationValue", "appValue", "evaluationDatasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationDatasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationDatasetName', () => { + const result = client.matchProjectFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationDatasetName', () => { + const result = client.matchLocationFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationDatasetName', () => { + const result = client.matchAppFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationDatasetFromEvaluationDatasetName', () => { + const result = client.matchEvaluationDatasetFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "evaluationDatasetValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationExpectation', async () => { + const fakePath = "/rendered/path/evaluationExpectation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation_expectation: "evaluationExpectationValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationExpectationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationExpectationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationExpectationPath', () => { + const result = client.evaluationExpectationPath("projectValue", "locationValue", "appValue", "evaluationExpectationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationExpectationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationExpectationName', () => { + const result = client.matchProjectFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationExpectationName', () => { + const result = client.matchLocationFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationExpectationName', () => { + const result = client.matchAppFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationExpectationFromEvaluationExpectationName', () => { + const result = client.matchEvaluationExpectationFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "evaluationExpectationValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationResult', async () => { + const fakePath = "/rendered/path/evaluationResult"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation: "evaluationValue", + evaluation_result: "evaluationResultValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationResultPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationResultPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationResultPath', () => { + const result = client.evaluationResultPath("projectValue", "locationValue", "appValue", "evaluationValue", "evaluationResultValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationResultPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationResultName', () => { + const result = client.matchProjectFromEvaluationResultName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationResultName', () => { + const result = client.matchLocationFromEvaluationResultName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationResultName', () => { + const result = client.matchAppFromEvaluationResultName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromEvaluationResultName', () => { + const result = client.matchEvaluationFromEvaluationResultName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationResultFromEvaluationResultName', () => { + const result = client.matchEvaluationResultFromEvaluationResultName(fakePath); + assert.strictEqual(result, "evaluationResultValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationRun', async () => { + const fakePath = "/rendered/path/evaluationRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation_run: "evaluationRunValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationRunPath', () => { + const result = client.evaluationRunPath("projectValue", "locationValue", "appValue", "evaluationRunValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationRunName', () => { + const result = client.matchProjectFromEvaluationRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationRunName', () => { + const result = client.matchLocationFromEvaluationRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationRunName', () => { + const result = client.matchAppFromEvaluationRunName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationRunFromEvaluationRunName', () => { + const result = client.matchEvaluationRunFromEvaluationRunName(fakePath); + assert.strictEqual(result, "evaluationRunValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('example', async () => { + const fakePath = "/rendered/path/example"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + example: "exampleValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.examplePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath("projectValue", "locationValue", "appValue", "exampleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromExampleName', () => { + const result = client.matchAppFromExampleName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, "exampleValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('guardrail', async () => { + const fakePath = "/rendered/path/guardrail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + guardrail: "guardrailValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.guardrailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.guardrailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('guardrailPath', () => { + const result = client.guardrailPath("projectValue", "locationValue", "appValue", "guardrailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.guardrailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGuardrailName', () => { + const result = client.matchProjectFromGuardrailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGuardrailName', () => { + const result = client.matchLocationFromGuardrailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromGuardrailName', () => { + const result = client.matchAppFromGuardrailName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGuardrailFromGuardrailName', () => { + const result = client.matchGuardrailFromGuardrailName(fakePath); + assert.strictEqual(result, "guardrailValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('omnichannel', async () => { + const fakePath = "/rendered/path/omnichannel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + omnichannel: "omnichannelValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.omnichannelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.omnichannelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('omnichannelPath', () => { + const result = client.omnichannelPath("projectValue", "locationValue", "omnichannelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.omnichannelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromOmnichannelName', () => { + const result = client.matchProjectFromOmnichannelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOmnichannelName', () => { + const result = client.matchLocationFromOmnichannelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOmnichannelFromOmnichannelName', () => { + const result = client.matchOmnichannelFromOmnichannelName(fakePath); + assert.strictEqual(result, "omnichannelValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('scheduledEvaluationRun', async () => { + const fakePath = "/rendered/path/scheduledEvaluationRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + scheduled_evaluation_run: "scheduledEvaluationRunValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.scheduledEvaluationRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.scheduledEvaluationRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('scheduledEvaluationRunPath', () => { + const result = client.scheduledEvaluationRunPath("projectValue", "locationValue", "appValue", "scheduledEvaluationRunValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduledEvaluationRunName', () => { + const result = client.matchProjectFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduledEvaluationRunName', () => { + const result = client.matchLocationFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromScheduledEvaluationRunName', () => { + const result = client.matchAppFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduledEvaluationRunFromScheduledEvaluationRunName', () => { + const result = client.matchScheduledEvaluationRunFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "scheduledEvaluationRunValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tool', async () => { + const fakePath = "/rendered/path/tool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + tool: "toolValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.toolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath("projectValue", "locationValue", "appValue", "toolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromToolName', () => { + const result = client.matchAppFromToolName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, "toolValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('toolset', async () => { + const fakePath = "/rendered/path/toolset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + toolset: "toolsetValue", + }; + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolsetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.toolsetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('toolsetPath', () => { + const result = client.toolsetPath("projectValue", "locationValue", "appValue", "toolsetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.toolsetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromToolsetName', () => { + const result = client.matchProjectFromToolsetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromToolsetName', () => { + const result = client.matchLocationFromToolsetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromToolsetName', () => { + const result = client.matchAppFromToolsetName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchToolsetFromToolsetName', () => { + const result = client.matchToolsetFromToolsetName(fakePath); + assert.strictEqual(result, "toolsetValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-ces/test/gapic_evaluation_service_v1beta.ts b/owl-bot-staging/google-cloud-ces/test/gapic_evaluation_service_v1beta.ts new file mode 100644 index 00000000000..b7b44cba807 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/test/gapic_evaluation_service_v1beta.ts @@ -0,0 +1,6049 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 evaluationserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, 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.EvaluationServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient(); + 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 = evaluationserviceModule.v1beta.EvaluationServiceClient.servicePath; + assert.strictEqual(servicePath, 'ces.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = evaluationserviceModule.v1beta.EvaluationServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 evaluationserviceModule.v1beta.EvaluationServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 evaluationserviceModule.v1beta.EvaluationServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 evaluationserviceModule.v1beta.EvaluationServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = evaluationserviceModule.v1beta.EvaluationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.evaluationServiceStub, undefined); + await client.initialize(); + assert(client.evaluationServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.evaluationServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.evaluationServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + 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 evaluationserviceModule.v1beta.EvaluationServiceClient({ + 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('uploadEvaluationAudio', () => { + it('invokes uploadEvaluationAudio without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UploadEvaluationAudioRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UploadEvaluationAudioRequest', ['app']); + request.app = defaultValue1; + const expectedHeaderRequestParams = `app=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UploadEvaluationAudioResponse() + ); + client.innerApiCalls.uploadEvaluationAudio = stubSimpleCall(expectedResponse); + const [response] = await client.uploadEvaluationAudio(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.uploadEvaluationAudio as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.uploadEvaluationAudio as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes uploadEvaluationAudio without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UploadEvaluationAudioRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UploadEvaluationAudioRequest', ['app']); + request.app = defaultValue1; + const expectedHeaderRequestParams = `app=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UploadEvaluationAudioResponse() + ); + client.innerApiCalls.uploadEvaluationAudio = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.uploadEvaluationAudio( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IUploadEvaluationAudioResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.uploadEvaluationAudio as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.uploadEvaluationAudio as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes uploadEvaluationAudio with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UploadEvaluationAudioRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UploadEvaluationAudioRequest', ['app']); + request.app = defaultValue1; + const expectedHeaderRequestParams = `app=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.uploadEvaluationAudio = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.uploadEvaluationAudio(request), expectedError); + const actualRequest = (client.innerApiCalls.uploadEvaluationAudio as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.uploadEvaluationAudio as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes uploadEvaluationAudio with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UploadEvaluationAudioRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UploadEvaluationAudioRequest', ['app']); + request.app = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.uploadEvaluationAudio(request), expectedError); + }); + }); + + describe('createEvaluation', () => { + it('invokes createEvaluation without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateEvaluationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Evaluation() + ); + client.innerApiCalls.createEvaluation = stubSimpleCall(expectedResponse); + const [response] = await client.createEvaluation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvaluation without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateEvaluationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Evaluation() + ); + client.innerApiCalls.createEvaluation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEvaluation( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IEvaluation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvaluation with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateEvaluationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEvaluation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createEvaluation(request), expectedError); + const actualRequest = (client.innerApiCalls.createEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvaluation with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateEvaluationRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createEvaluation(request), expectedError); + }); + }); + + describe('createEvaluationDataset', () => { + it('invokes createEvaluationDataset without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.EvaluationDataset() + ); + client.innerApiCalls.createEvaluationDataset = stubSimpleCall(expectedResponse); + const [response] = await client.createEvaluationDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createEvaluationDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEvaluationDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvaluationDataset without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.EvaluationDataset() + ); + client.innerApiCalls.createEvaluationDataset = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEvaluationDataset( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IEvaluationDataset|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createEvaluationDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEvaluationDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvaluationDataset with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEvaluationDataset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createEvaluationDataset(request), expectedError); + const actualRequest = (client.innerApiCalls.createEvaluationDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEvaluationDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvaluationDataset with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createEvaluationDataset(request), expectedError); + }); + }); + + describe('updateEvaluation', () => { + it('invokes updateEvaluation without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateEvaluationRequest() + ); + request.evaluation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateEvaluationRequest', ['evaluation', 'name']); + request.evaluation.name = defaultValue1; + const expectedHeaderRequestParams = `evaluation.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Evaluation() + ); + client.innerApiCalls.updateEvaluation = stubSimpleCall(expectedResponse); + const [response] = await client.updateEvaluation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEvaluation without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateEvaluationRequest() + ); + request.evaluation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateEvaluationRequest', ['evaluation', 'name']); + request.evaluation.name = defaultValue1; + const expectedHeaderRequestParams = `evaluation.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Evaluation() + ); + client.innerApiCalls.updateEvaluation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEvaluation( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IEvaluation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEvaluation with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateEvaluationRequest() + ); + request.evaluation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateEvaluationRequest', ['evaluation', 'name']); + request.evaluation.name = defaultValue1; + const expectedHeaderRequestParams = `evaluation.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEvaluation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateEvaluation(request), expectedError); + const actualRequest = (client.innerApiCalls.updateEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEvaluation with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateEvaluationRequest() + ); + request.evaluation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateEvaluationRequest', ['evaluation', 'name']); + request.evaluation.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateEvaluation(request), expectedError); + }); + }); + + describe('updateEvaluationDataset', () => { + it('invokes updateEvaluationDataset without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest() + ); + request.evaluationDataset ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest', ['evaluationDataset', 'name']); + request.evaluationDataset.name = defaultValue1; + const expectedHeaderRequestParams = `evaluation_dataset.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.EvaluationDataset() + ); + client.innerApiCalls.updateEvaluationDataset = stubSimpleCall(expectedResponse); + const [response] = await client.updateEvaluationDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateEvaluationDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEvaluationDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEvaluationDataset without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest() + ); + request.evaluationDataset ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest', ['evaluationDataset', 'name']); + request.evaluationDataset.name = defaultValue1; + const expectedHeaderRequestParams = `evaluation_dataset.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.EvaluationDataset() + ); + client.innerApiCalls.updateEvaluationDataset = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEvaluationDataset( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IEvaluationDataset|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateEvaluationDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEvaluationDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEvaluationDataset with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest() + ); + request.evaluationDataset ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest', ['evaluationDataset', 'name']); + request.evaluationDataset.name = defaultValue1; + const expectedHeaderRequestParams = `evaluation_dataset.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEvaluationDataset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateEvaluationDataset(request), expectedError); + const actualRequest = (client.innerApiCalls.updateEvaluationDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEvaluationDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEvaluationDataset with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest() + ); + request.evaluationDataset ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest', ['evaluationDataset', 'name']); + request.evaluationDataset.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateEvaluationDataset(request), expectedError); + }); + }); + + describe('deleteEvaluation', () => { + it('invokes deleteEvaluation without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteEvaluation = stubSimpleCall(expectedResponse); + const [response] = await client.deleteEvaluation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvaluation without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteEvaluation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEvaluation( + 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.deleteEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvaluation with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEvaluation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteEvaluation(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvaluation with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteEvaluation(request), expectedError); + }); + }); + + describe('deleteEvaluationResult', () => { + it('invokes deleteEvaluationResult without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationResultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationResultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteEvaluationResult = stubSimpleCall(expectedResponse); + const [response] = await client.deleteEvaluationResult(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteEvaluationResult as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvaluationResult as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvaluationResult without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationResultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationResultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteEvaluationResult = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEvaluationResult( + 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.deleteEvaluationResult as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvaluationResult as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvaluationResult with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationResultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationResultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEvaluationResult = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteEvaluationResult(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteEvaluationResult as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvaluationResult as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvaluationResult with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationResultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationResultRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteEvaluationResult(request), expectedError); + }); + }); + + describe('deleteEvaluationDataset', () => { + it('invokes deleteEvaluationDataset without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteEvaluationDataset = stubSimpleCall(expectedResponse); + const [response] = await client.deleteEvaluationDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteEvaluationDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvaluationDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvaluationDataset without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteEvaluationDataset = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEvaluationDataset( + 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.deleteEvaluationDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvaluationDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvaluationDataset with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEvaluationDataset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteEvaluationDataset(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteEvaluationDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvaluationDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvaluationDataset with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteEvaluationDataset(request), expectedError); + }); + }); + + describe('getEvaluation', () => { + it('invokes getEvaluation without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Evaluation() + ); + client.innerApiCalls.getEvaluation = stubSimpleCall(expectedResponse); + const [response] = await client.getEvaluation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluation without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.Evaluation() + ); + client.innerApiCalls.getEvaluation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEvaluation( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IEvaluation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluation with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEvaluation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEvaluation(request), expectedError); + const actualRequest = (client.innerApiCalls.getEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluation with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getEvaluation(request), expectedError); + }); + }); + + describe('getEvaluationResult', () => { + it('invokes getEvaluationResult without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationResultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationResultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.EvaluationResult() + ); + client.innerApiCalls.getEvaluationResult = stubSimpleCall(expectedResponse); + const [response] = await client.getEvaluationResult(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEvaluationResult as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluationResult as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluationResult without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationResultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationResultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.EvaluationResult() + ); + client.innerApiCalls.getEvaluationResult = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEvaluationResult( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IEvaluationResult|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEvaluationResult as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluationResult as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluationResult with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationResultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationResultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEvaluationResult = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEvaluationResult(request), expectedError); + const actualRequest = (client.innerApiCalls.getEvaluationResult as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluationResult as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluationResult with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationResultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationResultRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getEvaluationResult(request), expectedError); + }); + }); + + describe('getEvaluationDataset', () => { + it('invokes getEvaluationDataset without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationDatasetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.EvaluationDataset() + ); + client.innerApiCalls.getEvaluationDataset = stubSimpleCall(expectedResponse); + const [response] = await client.getEvaluationDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEvaluationDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluationDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluationDataset without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationDatasetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.EvaluationDataset() + ); + client.innerApiCalls.getEvaluationDataset = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEvaluationDataset( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IEvaluationDataset|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEvaluationDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluationDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluationDataset with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationDatasetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEvaluationDataset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEvaluationDataset(request), expectedError); + const actualRequest = (client.innerApiCalls.getEvaluationDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluationDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluationDataset with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationDatasetRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getEvaluationDataset(request), expectedError); + }); + }); + + describe('getEvaluationRun', () => { + it('invokes getEvaluationRun without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.EvaluationRun() + ); + client.innerApiCalls.getEvaluationRun = stubSimpleCall(expectedResponse); + const [response] = await client.getEvaluationRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluationRun without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.EvaluationRun() + ); + client.innerApiCalls.getEvaluationRun = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEvaluationRun( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IEvaluationRun|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluationRun with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEvaluationRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEvaluationRun(request), expectedError); + const actualRequest = (client.innerApiCalls.getEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluationRun with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationRunRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getEvaluationRun(request), expectedError); + }); + }); + + describe('getEvaluationExpectation', () => { + it('invokes getEvaluationExpectation without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationExpectationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationExpectationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.EvaluationExpectation() + ); + client.innerApiCalls.getEvaluationExpectation = stubSimpleCall(expectedResponse); + const [response] = await client.getEvaluationExpectation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEvaluationExpectation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluationExpectation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluationExpectation without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationExpectationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationExpectationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.EvaluationExpectation() + ); + client.innerApiCalls.getEvaluationExpectation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEvaluationExpectation( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IEvaluationExpectation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEvaluationExpectation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluationExpectation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluationExpectation with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationExpectationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationExpectationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEvaluationExpectation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEvaluationExpectation(request), expectedError); + const actualRequest = (client.innerApiCalls.getEvaluationExpectation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluationExpectation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluationExpectation with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetEvaluationExpectationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetEvaluationExpectationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getEvaluationExpectation(request), expectedError); + }); + }); + + describe('createEvaluationExpectation', () => { + it('invokes createEvaluationExpectation without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.EvaluationExpectation() + ); + client.innerApiCalls.createEvaluationExpectation = stubSimpleCall(expectedResponse); + const [response] = await client.createEvaluationExpectation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createEvaluationExpectation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEvaluationExpectation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvaluationExpectation without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.EvaluationExpectation() + ); + client.innerApiCalls.createEvaluationExpectation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEvaluationExpectation( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IEvaluationExpectation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createEvaluationExpectation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEvaluationExpectation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvaluationExpectation with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEvaluationExpectation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createEvaluationExpectation(request), expectedError); + const actualRequest = (client.innerApiCalls.createEvaluationExpectation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEvaluationExpectation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvaluationExpectation with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createEvaluationExpectation(request), expectedError); + }); + }); + + describe('updateEvaluationExpectation', () => { + it('invokes updateEvaluationExpectation without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest() + ); + request.evaluationExpectation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest', ['evaluationExpectation', 'name']); + request.evaluationExpectation.name = defaultValue1; + const expectedHeaderRequestParams = `evaluation_expectation.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.EvaluationExpectation() + ); + client.innerApiCalls.updateEvaluationExpectation = stubSimpleCall(expectedResponse); + const [response] = await client.updateEvaluationExpectation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateEvaluationExpectation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEvaluationExpectation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEvaluationExpectation without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest() + ); + request.evaluationExpectation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest', ['evaluationExpectation', 'name']); + request.evaluationExpectation.name = defaultValue1; + const expectedHeaderRequestParams = `evaluation_expectation.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.EvaluationExpectation() + ); + client.innerApiCalls.updateEvaluationExpectation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEvaluationExpectation( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IEvaluationExpectation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateEvaluationExpectation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEvaluationExpectation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEvaluationExpectation with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest() + ); + request.evaluationExpectation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest', ['evaluationExpectation', 'name']); + request.evaluationExpectation.name = defaultValue1; + const expectedHeaderRequestParams = `evaluation_expectation.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEvaluationExpectation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateEvaluationExpectation(request), expectedError); + const actualRequest = (client.innerApiCalls.updateEvaluationExpectation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEvaluationExpectation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEvaluationExpectation with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest() + ); + request.evaluationExpectation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest', ['evaluationExpectation', 'name']); + request.evaluationExpectation.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateEvaluationExpectation(request), expectedError); + }); + }); + + describe('deleteEvaluationExpectation', () => { + it('invokes deleteEvaluationExpectation without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteEvaluationExpectation = stubSimpleCall(expectedResponse); + const [response] = await client.deleteEvaluationExpectation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteEvaluationExpectation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvaluationExpectation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvaluationExpectation without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteEvaluationExpectation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEvaluationExpectation( + 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.deleteEvaluationExpectation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvaluationExpectation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvaluationExpectation with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEvaluationExpectation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteEvaluationExpectation(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteEvaluationExpectation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvaluationExpectation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvaluationExpectation with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteEvaluationExpectation(request), expectedError); + }); + }); + + describe('createScheduledEvaluationRun', () => { + it('invokes createScheduledEvaluationRun without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ScheduledEvaluationRun() + ); + client.innerApiCalls.createScheduledEvaluationRun = stubSimpleCall(expectedResponse); + const [response] = await client.createScheduledEvaluationRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createScheduledEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createScheduledEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createScheduledEvaluationRun without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ScheduledEvaluationRun() + ); + client.innerApiCalls.createScheduledEvaluationRun = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createScheduledEvaluationRun( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IScheduledEvaluationRun|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createScheduledEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createScheduledEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createScheduledEvaluationRun with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createScheduledEvaluationRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createScheduledEvaluationRun(request), expectedError); + const actualRequest = (client.innerApiCalls.createScheduledEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createScheduledEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createScheduledEvaluationRun with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createScheduledEvaluationRun(request), expectedError); + }); + }); + + describe('getScheduledEvaluationRun', () => { + it('invokes getScheduledEvaluationRun without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ScheduledEvaluationRun() + ); + client.innerApiCalls.getScheduledEvaluationRun = stubSimpleCall(expectedResponse); + const [response] = await client.getScheduledEvaluationRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getScheduledEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getScheduledEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScheduledEvaluationRun without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ScheduledEvaluationRun() + ); + client.innerApiCalls.getScheduledEvaluationRun = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getScheduledEvaluationRun( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IScheduledEvaluationRun|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getScheduledEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getScheduledEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScheduledEvaluationRun with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getScheduledEvaluationRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getScheduledEvaluationRun(request), expectedError); + const actualRequest = (client.innerApiCalls.getScheduledEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getScheduledEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScheduledEvaluationRun with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getScheduledEvaluationRun(request), expectedError); + }); + }); + + describe('updateScheduledEvaluationRun', () => { + it('invokes updateScheduledEvaluationRun without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest() + ); + request.scheduledEvaluationRun ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest', ['scheduledEvaluationRun', 'name']); + request.scheduledEvaluationRun.name = defaultValue1; + const expectedHeaderRequestParams = `scheduled_evaluation_run.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ScheduledEvaluationRun() + ); + client.innerApiCalls.updateScheduledEvaluationRun = stubSimpleCall(expectedResponse); + const [response] = await client.updateScheduledEvaluationRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateScheduledEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateScheduledEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateScheduledEvaluationRun without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest() + ); + request.scheduledEvaluationRun ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest', ['scheduledEvaluationRun', 'name']); + request.scheduledEvaluationRun.name = defaultValue1; + const expectedHeaderRequestParams = `scheduled_evaluation_run.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ScheduledEvaluationRun() + ); + client.innerApiCalls.updateScheduledEvaluationRun = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateScheduledEvaluationRun( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IScheduledEvaluationRun|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateScheduledEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateScheduledEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateScheduledEvaluationRun with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest() + ); + request.scheduledEvaluationRun ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest', ['scheduledEvaluationRun', 'name']); + request.scheduledEvaluationRun.name = defaultValue1; + const expectedHeaderRequestParams = `scheduled_evaluation_run.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateScheduledEvaluationRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateScheduledEvaluationRun(request), expectedError); + const actualRequest = (client.innerApiCalls.updateScheduledEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateScheduledEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateScheduledEvaluationRun with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest() + ); + request.scheduledEvaluationRun ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest', ['scheduledEvaluationRun', 'name']); + request.scheduledEvaluationRun.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateScheduledEvaluationRun(request), expectedError); + }); + }); + + describe('deleteScheduledEvaluationRun', () => { + it('invokes deleteScheduledEvaluationRun without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteScheduledEvaluationRun = stubSimpleCall(expectedResponse); + const [response] = await client.deleteScheduledEvaluationRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteScheduledEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteScheduledEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteScheduledEvaluationRun without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteScheduledEvaluationRun = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteScheduledEvaluationRun( + 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.deleteScheduledEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteScheduledEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteScheduledEvaluationRun with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteScheduledEvaluationRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteScheduledEvaluationRun(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteScheduledEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteScheduledEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteScheduledEvaluationRun with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteScheduledEvaluationRun(request), expectedError); + }); + }); + + describe('testPersonaVoice', () => { + it('invokes testPersonaVoice without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.TestPersonaVoiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.TestPersonaVoiceRequest', ['app']); + request.app = defaultValue1; + const expectedHeaderRequestParams = `app=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.TestPersonaVoiceResponse() + ); + client.innerApiCalls.testPersonaVoice = stubSimpleCall(expectedResponse); + const [response] = await client.testPersonaVoice(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.testPersonaVoice as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testPersonaVoice as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testPersonaVoice without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.TestPersonaVoiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.TestPersonaVoiceRequest', ['app']); + request.app = defaultValue1; + const expectedHeaderRequestParams = `app=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.TestPersonaVoiceResponse() + ); + client.innerApiCalls.testPersonaVoice = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testPersonaVoice( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.ITestPersonaVoiceResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.testPersonaVoice as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testPersonaVoice as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testPersonaVoice with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.TestPersonaVoiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.TestPersonaVoiceRequest', ['app']); + request.app = defaultValue1; + const expectedHeaderRequestParams = `app=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.testPersonaVoice = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testPersonaVoice(request), expectedError); + const actualRequest = (client.innerApiCalls.testPersonaVoice as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testPersonaVoice as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testPersonaVoice with closed client', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.TestPersonaVoiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.TestPersonaVoiceRequest', ['app']); + request.app = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.testPersonaVoice(request), expectedError); + }); + }); + + describe('runEvaluation', () => { + it('invokes runEvaluation without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RunEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RunEvaluationRequest', ['app']); + request.app = defaultValue1; + const expectedHeaderRequestParams = `app=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runEvaluation = stubLongRunningCall(expectedResponse); + const [operation] = await client.runEvaluation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.runEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runEvaluation without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RunEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RunEvaluationRequest', ['app']); + request.app = defaultValue1; + const expectedHeaderRequestParams = `app=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runEvaluation = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runEvaluation( + 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.runEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runEvaluation with call error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RunEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RunEvaluationRequest', ['app']); + request.app = defaultValue1; + const expectedHeaderRequestParams = `app=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.runEvaluation = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.runEvaluation(request), expectedError); + const actualRequest = (client.innerApiCalls.runEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runEvaluation with LRO error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RunEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RunEvaluationRequest', ['app']); + request.app = defaultValue1; + const expectedHeaderRequestParams = `app=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.runEvaluation = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.runEvaluation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.runEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRunEvaluationProgress without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRunEvaluationProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunEvaluationProgress with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkRunEvaluationProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('generateEvaluation', () => { + it('invokes generateEvaluation without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GenerateEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GenerateEvaluationRequest', ['conversation']); + request.conversation = defaultValue1; + const expectedHeaderRequestParams = `conversation=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.generateEvaluation = stubLongRunningCall(expectedResponse); + const [operation] = await client.generateEvaluation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.generateEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateEvaluation without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GenerateEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GenerateEvaluationRequest', ['conversation']); + request.conversation = defaultValue1; + const expectedHeaderRequestParams = `conversation=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.generateEvaluation = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateEvaluation( + 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.generateEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateEvaluation with call error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GenerateEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GenerateEvaluationRequest', ['conversation']); + request.conversation = defaultValue1; + const expectedHeaderRequestParams = `conversation=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateEvaluation = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.generateEvaluation(request), expectedError); + const actualRequest = (client.innerApiCalls.generateEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateEvaluation with LRO error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GenerateEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GenerateEvaluationRequest', ['conversation']); + request.conversation = defaultValue1; + const expectedHeaderRequestParams = `conversation=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateEvaluation = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.generateEvaluation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.generateEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkGenerateEvaluationProgress without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkGenerateEvaluationProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkGenerateEvaluationProgress with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkGenerateEvaluationProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('importEvaluations', () => { + it('invokes importEvaluations without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ImportEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ImportEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importEvaluations = stubLongRunningCall(expectedResponse); + const [operation] = await client.importEvaluations(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.importEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importEvaluations without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ImportEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ImportEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importEvaluations = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importEvaluations( + 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.importEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importEvaluations with call error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ImportEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ImportEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.importEvaluations = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.importEvaluations(request), expectedError); + const actualRequest = (client.innerApiCalls.importEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importEvaluations with LRO error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ImportEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ImportEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.importEvaluations = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.importEvaluations(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.importEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportEvaluationsProgress without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkImportEvaluationsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportEvaluationsProgress with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkImportEvaluationsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteEvaluationRun', () => { + it('invokes deleteEvaluationRun without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteEvaluationRun = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteEvaluationRun(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvaluationRun without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteEvaluationRun = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEvaluationRun( + 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.deleteEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvaluationRun with call error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEvaluationRun = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteEvaluationRun(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvaluationRun with LRO error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.DeleteEvaluationRunRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.DeleteEvaluationRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEvaluationRun = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteEvaluationRun(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteEvaluationRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEvaluationRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteEvaluationRunProgress without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteEvaluationRunProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteEvaluationRunProgress with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteEvaluationRunProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listEvaluations', () => { + it('invokes listEvaluations without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Evaluation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Evaluation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Evaluation()), + ]; + client.innerApiCalls.listEvaluations = stubSimpleCall(expectedResponse); + const [response] = await client.listEvaluations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluations without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Evaluation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Evaluation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Evaluation()), + ]; + client.innerApiCalls.listEvaluations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEvaluations( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IEvaluation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluations with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEvaluations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEvaluations(request), expectedError); + const actualRequest = (client.innerApiCalls.listEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluationsStream without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Evaluation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Evaluation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Evaluation()), + ]; + client.descriptors.page.listEvaluations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.Evaluation[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.Evaluation) => { + 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.listEvaluations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEvaluations, request)); + assert( + (client.descriptors.page.listEvaluations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEvaluationsStream with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvaluations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.Evaluation[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.Evaluation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listEvaluations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEvaluations, request)); + assert( + (client.descriptors.page.listEvaluations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvaluations without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.Evaluation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Evaluation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.Evaluation()), + ]; + client.descriptors.page.listEvaluations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1beta.IEvaluation[] = []; + const iterable = client.listEvaluationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvaluations with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvaluations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEvaluationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1beta.IEvaluation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listEvaluationResults', () => { + it('invokes listEvaluationResults without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationResultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationResultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationResult()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationResult()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationResult()), + ]; + client.innerApiCalls.listEvaluationResults = stubSimpleCall(expectedResponse); + const [response] = await client.listEvaluationResults(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEvaluationResults as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluationResults as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluationResults without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationResultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationResultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationResult()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationResult()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationResult()), + ]; + client.innerApiCalls.listEvaluationResults = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEvaluationResults( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IEvaluationResult[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEvaluationResults as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluationResults as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluationResults with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationResultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationResultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEvaluationResults = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEvaluationResults(request), expectedError); + const actualRequest = (client.innerApiCalls.listEvaluationResults as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluationResults as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluationResultsStream without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationResultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationResultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationResult()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationResult()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationResult()), + ]; + client.descriptors.page.listEvaluationResults.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listEvaluationResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.EvaluationResult[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.EvaluationResult) => { + 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.listEvaluationResults.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEvaluationResults, request)); + assert( + (client.descriptors.page.listEvaluationResults.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEvaluationResultsStream with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationResultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationResultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvaluationResults.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listEvaluationResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.EvaluationResult[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.EvaluationResult) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listEvaluationResults.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEvaluationResults, request)); + assert( + (client.descriptors.page.listEvaluationResults.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvaluationResults without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationResultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationResultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationResult()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationResult()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationResult()), + ]; + client.descriptors.page.listEvaluationResults.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1beta.IEvaluationResult[] = []; + const iterable = client.listEvaluationResultsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEvaluationResults.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEvaluationResults.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvaluationResults with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationResultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationResultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvaluationResults.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEvaluationResultsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1beta.IEvaluationResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEvaluationResults.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEvaluationResults.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listEvaluationDatasets', () => { + it('invokes listEvaluationDatasets without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationDataset()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationDataset()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationDataset()), + ]; + client.innerApiCalls.listEvaluationDatasets = stubSimpleCall(expectedResponse); + const [response] = await client.listEvaluationDatasets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEvaluationDatasets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluationDatasets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluationDatasets without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationDataset()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationDataset()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationDataset()), + ]; + client.innerApiCalls.listEvaluationDatasets = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEvaluationDatasets( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IEvaluationDataset[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEvaluationDatasets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluationDatasets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluationDatasets with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEvaluationDatasets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEvaluationDatasets(request), expectedError); + const actualRequest = (client.innerApiCalls.listEvaluationDatasets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluationDatasets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluationDatasetsStream without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationDataset()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationDataset()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationDataset()), + ]; + client.descriptors.page.listEvaluationDatasets.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listEvaluationDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.EvaluationDataset[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.EvaluationDataset) => { + 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.listEvaluationDatasets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEvaluationDatasets, request)); + assert( + (client.descriptors.page.listEvaluationDatasets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEvaluationDatasetsStream with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvaluationDatasets.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listEvaluationDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.EvaluationDataset[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.EvaluationDataset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listEvaluationDatasets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEvaluationDatasets, request)); + assert( + (client.descriptors.page.listEvaluationDatasets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvaluationDatasets without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationDataset()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationDataset()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationDataset()), + ]; + client.descriptors.page.listEvaluationDatasets.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1beta.IEvaluationDataset[] = []; + const iterable = client.listEvaluationDatasetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEvaluationDatasets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEvaluationDatasets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvaluationDatasets with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvaluationDatasets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEvaluationDatasetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1beta.IEvaluationDataset[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEvaluationDatasets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEvaluationDatasets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listEvaluationRuns', () => { + it('invokes listEvaluationRuns without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationRunsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationRun()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationRun()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationRun()), + ]; + client.innerApiCalls.listEvaluationRuns = stubSimpleCall(expectedResponse); + const [response] = await client.listEvaluationRuns(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEvaluationRuns as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluationRuns as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluationRuns without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationRunsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationRun()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationRun()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationRun()), + ]; + client.innerApiCalls.listEvaluationRuns = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEvaluationRuns( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IEvaluationRun[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEvaluationRuns as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluationRuns as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluationRuns with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationRunsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEvaluationRuns = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEvaluationRuns(request), expectedError); + const actualRequest = (client.innerApiCalls.listEvaluationRuns as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluationRuns as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluationRunsStream without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationRunsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationRun()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationRun()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationRun()), + ]; + client.descriptors.page.listEvaluationRuns.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listEvaluationRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.EvaluationRun[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.EvaluationRun) => { + 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.listEvaluationRuns.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEvaluationRuns, request)); + assert( + (client.descriptors.page.listEvaluationRuns.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEvaluationRunsStream with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationRunsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvaluationRuns.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listEvaluationRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.EvaluationRun[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.EvaluationRun) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listEvaluationRuns.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEvaluationRuns, request)); + assert( + (client.descriptors.page.listEvaluationRuns.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvaluationRuns without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationRunsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationRun()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationRun()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationRun()), + ]; + client.descriptors.page.listEvaluationRuns.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1beta.IEvaluationRun[] = []; + const iterable = client.listEvaluationRunsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEvaluationRuns.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEvaluationRuns.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvaluationRuns with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationRunsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvaluationRuns.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEvaluationRunsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1beta.IEvaluationRun[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEvaluationRuns.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEvaluationRuns.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listEvaluationExpectations', () => { + it('invokes listEvaluationExpectations without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationExpectation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationExpectation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationExpectation()), + ]; + client.innerApiCalls.listEvaluationExpectations = stubSimpleCall(expectedResponse); + const [response] = await client.listEvaluationExpectations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEvaluationExpectations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluationExpectations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluationExpectations without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationExpectation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationExpectation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationExpectation()), + ]; + client.innerApiCalls.listEvaluationExpectations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEvaluationExpectations( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IEvaluationExpectation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEvaluationExpectations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluationExpectations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluationExpectations with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEvaluationExpectations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEvaluationExpectations(request), expectedError); + const actualRequest = (client.innerApiCalls.listEvaluationExpectations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluationExpectations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluationExpectationsStream without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationExpectation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationExpectation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationExpectation()), + ]; + client.descriptors.page.listEvaluationExpectations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listEvaluationExpectationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.EvaluationExpectation[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.EvaluationExpectation) => { + 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.listEvaluationExpectations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEvaluationExpectations, request)); + assert( + (client.descriptors.page.listEvaluationExpectations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEvaluationExpectationsStream with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvaluationExpectations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listEvaluationExpectationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.EvaluationExpectation[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.EvaluationExpectation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listEvaluationExpectations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEvaluationExpectations, request)); + assert( + (client.descriptors.page.listEvaluationExpectations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvaluationExpectations without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationExpectation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationExpectation()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.EvaluationExpectation()), + ]; + client.descriptors.page.listEvaluationExpectations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1beta.IEvaluationExpectation[] = []; + const iterable = client.listEvaluationExpectationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEvaluationExpectations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEvaluationExpectations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvaluationExpectations with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvaluationExpectations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEvaluationExpectationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1beta.IEvaluationExpectation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEvaluationExpectations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEvaluationExpectations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listScheduledEvaluationRuns', () => { + it('invokes listScheduledEvaluationRuns without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.ScheduledEvaluationRun()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.ScheduledEvaluationRun()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.ScheduledEvaluationRun()), + ]; + client.innerApiCalls.listScheduledEvaluationRuns = stubSimpleCall(expectedResponse); + const [response] = await client.listScheduledEvaluationRuns(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listScheduledEvaluationRuns as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listScheduledEvaluationRuns as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScheduledEvaluationRuns without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.ScheduledEvaluationRun()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.ScheduledEvaluationRun()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.ScheduledEvaluationRun()), + ]; + client.innerApiCalls.listScheduledEvaluationRuns = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listScheduledEvaluationRuns( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IScheduledEvaluationRun[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listScheduledEvaluationRuns as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listScheduledEvaluationRuns as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScheduledEvaluationRuns with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listScheduledEvaluationRuns = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listScheduledEvaluationRuns(request), expectedError); + const actualRequest = (client.innerApiCalls.listScheduledEvaluationRuns as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listScheduledEvaluationRuns as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScheduledEvaluationRunsStream without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.ScheduledEvaluationRun()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.ScheduledEvaluationRun()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.ScheduledEvaluationRun()), + ]; + client.descriptors.page.listScheduledEvaluationRuns.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listScheduledEvaluationRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.ScheduledEvaluationRun[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.ScheduledEvaluationRun) => { + 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.listScheduledEvaluationRuns.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listScheduledEvaluationRuns, request)); + assert( + (client.descriptors.page.listScheduledEvaluationRuns.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listScheduledEvaluationRunsStream with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listScheduledEvaluationRuns.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listScheduledEvaluationRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.ces.v1beta.ScheduledEvaluationRun[] = []; + stream.on('data', (response: protos.google.cloud.ces.v1beta.ScheduledEvaluationRun) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listScheduledEvaluationRuns.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listScheduledEvaluationRuns, request)); + assert( + (client.descriptors.page.listScheduledEvaluationRuns.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listScheduledEvaluationRuns without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.ces.v1beta.ScheduledEvaluationRun()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.ScheduledEvaluationRun()), + generateSampleMessage(new protos.google.cloud.ces.v1beta.ScheduledEvaluationRun()), + ]; + client.descriptors.page.listScheduledEvaluationRuns.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.ces.v1beta.IScheduledEvaluationRun[] = []; + const iterable = client.listScheduledEvaluationRunsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listScheduledEvaluationRuns.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listScheduledEvaluationRuns.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listScheduledEvaluationRuns with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listScheduledEvaluationRuns.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listScheduledEvaluationRunsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.ces.v1beta.IScheduledEvaluationRun[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listScheduledEvaluationRuns.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listScheduledEvaluationRuns.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + 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 evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + 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 evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + 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 evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('agent', async () => { + const fakePath = "/rendered/path/agent"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + agent: "agentValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.agentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath("projectValue", "locationValue", "appValue", "agentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAgentName', () => { + const result = client.matchAppFromAgentName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, "agentValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('app', async () => { + const fakePath = "/rendered/path/app"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.appPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('appPath', () => { + const result = client.appPath("projectValue", "locationValue", "appValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.appPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAppName', () => { + const result = client.matchProjectFromAppName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAppName', () => { + const result = client.matchLocationFromAppName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAppName', () => { + const result = client.matchAppFromAppName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('appVersion', async () => { + const fakePath = "/rendered/path/appVersion"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + version: "versionValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appVersionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.appVersionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('appVersionPath', () => { + const result = client.appVersionPath("projectValue", "locationValue", "appValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.appVersionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAppVersionName', () => { + const result = client.matchProjectFromAppVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAppVersionName', () => { + const result = client.matchLocationFromAppVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAppVersionName', () => { + const result = client.matchAppFromAppVersionName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromAppVersionName', () => { + const result = client.matchVersionFromAppVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('changelog', async () => { + const fakePath = "/rendered/path/changelog"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + changelog: "changelogValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath("projectValue", "locationValue", "appValue", "changelogValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromChangelogName', () => { + const result = client.matchAppFromChangelogName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, "changelogValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('conversation', async () => { + const fakePath = "/rendered/path/conversation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + conversation: "conversationValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.conversationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.conversationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('conversationPath', () => { + const result = client.conversationPath("projectValue", "locationValue", "appValue", "conversationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.conversationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConversationName', () => { + const result = client.matchProjectFromConversationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConversationName', () => { + const result = client.matchLocationFromConversationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromConversationName', () => { + const result = client.matchAppFromConversationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConversationFromConversationName', () => { + const result = client.matchConversationFromConversationName(fakePath); + assert.strictEqual(result, "conversationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', async () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + deployment: "deploymentValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "appValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromDeploymentName', () => { + const result = client.matchAppFromDeploymentName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluation', async () => { + const fakePath = "/rendered/path/evaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation: "evaluationValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationPath', () => { + const result = client.evaluationPath("projectValue", "locationValue", "appValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationName', () => { + const result = client.matchProjectFromEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationName', () => { + const result = client.matchLocationFromEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationName', () => { + const result = client.matchAppFromEvaluationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromEvaluationName', () => { + const result = client.matchEvaluationFromEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationDataset', async () => { + const fakePath = "/rendered/path/evaluationDataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation_dataset: "evaluationDatasetValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationDatasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationDatasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationDatasetPath', () => { + const result = client.evaluationDatasetPath("projectValue", "locationValue", "appValue", "evaluationDatasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationDatasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationDatasetName', () => { + const result = client.matchProjectFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationDatasetName', () => { + const result = client.matchLocationFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationDatasetName', () => { + const result = client.matchAppFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationDatasetFromEvaluationDatasetName', () => { + const result = client.matchEvaluationDatasetFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "evaluationDatasetValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationExpectation', async () => { + const fakePath = "/rendered/path/evaluationExpectation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation_expectation: "evaluationExpectationValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationExpectationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationExpectationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationExpectationPath', () => { + const result = client.evaluationExpectationPath("projectValue", "locationValue", "appValue", "evaluationExpectationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationExpectationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationExpectationName', () => { + const result = client.matchProjectFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationExpectationName', () => { + const result = client.matchLocationFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationExpectationName', () => { + const result = client.matchAppFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationExpectationFromEvaluationExpectationName', () => { + const result = client.matchEvaluationExpectationFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "evaluationExpectationValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationResult', async () => { + const fakePath = "/rendered/path/evaluationResult"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation: "evaluationValue", + evaluation_result: "evaluationResultValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationResultPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationResultPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationResultPath', () => { + const result = client.evaluationResultPath("projectValue", "locationValue", "appValue", "evaluationValue", "evaluationResultValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationResultPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationResultName', () => { + const result = client.matchProjectFromEvaluationResultName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationResultName', () => { + const result = client.matchLocationFromEvaluationResultName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationResultName', () => { + const result = client.matchAppFromEvaluationResultName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromEvaluationResultName', () => { + const result = client.matchEvaluationFromEvaluationResultName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationResultFromEvaluationResultName', () => { + const result = client.matchEvaluationResultFromEvaluationResultName(fakePath); + assert.strictEqual(result, "evaluationResultValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationRun', async () => { + const fakePath = "/rendered/path/evaluationRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation_run: "evaluationRunValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationRunPath', () => { + const result = client.evaluationRunPath("projectValue", "locationValue", "appValue", "evaluationRunValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationRunName', () => { + const result = client.matchProjectFromEvaluationRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationRunName', () => { + const result = client.matchLocationFromEvaluationRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationRunName', () => { + const result = client.matchAppFromEvaluationRunName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationRunFromEvaluationRunName', () => { + const result = client.matchEvaluationRunFromEvaluationRunName(fakePath); + assert.strictEqual(result, "evaluationRunValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('example', async () => { + const fakePath = "/rendered/path/example"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + example: "exampleValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.examplePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath("projectValue", "locationValue", "appValue", "exampleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromExampleName', () => { + const result = client.matchAppFromExampleName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, "exampleValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('guardrail', async () => { + const fakePath = "/rendered/path/guardrail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + guardrail: "guardrailValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.guardrailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.guardrailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('guardrailPath', () => { + const result = client.guardrailPath("projectValue", "locationValue", "appValue", "guardrailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.guardrailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGuardrailName', () => { + const result = client.matchProjectFromGuardrailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGuardrailName', () => { + const result = client.matchLocationFromGuardrailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromGuardrailName', () => { + const result = client.matchAppFromGuardrailName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGuardrailFromGuardrailName', () => { + const result = client.matchGuardrailFromGuardrailName(fakePath); + assert.strictEqual(result, "guardrailValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('omnichannel', async () => { + const fakePath = "/rendered/path/omnichannel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + omnichannel: "omnichannelValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.omnichannelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.omnichannelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('omnichannelPath', () => { + const result = client.omnichannelPath("projectValue", "locationValue", "omnichannelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.omnichannelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromOmnichannelName', () => { + const result = client.matchProjectFromOmnichannelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOmnichannelName', () => { + const result = client.matchLocationFromOmnichannelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOmnichannelFromOmnichannelName', () => { + const result = client.matchOmnichannelFromOmnichannelName(fakePath); + assert.strictEqual(result, "omnichannelValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('scheduledEvaluationRun', async () => { + const fakePath = "/rendered/path/scheduledEvaluationRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + scheduled_evaluation_run: "scheduledEvaluationRunValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.scheduledEvaluationRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.scheduledEvaluationRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('scheduledEvaluationRunPath', () => { + const result = client.scheduledEvaluationRunPath("projectValue", "locationValue", "appValue", "scheduledEvaluationRunValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduledEvaluationRunName', () => { + const result = client.matchProjectFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduledEvaluationRunName', () => { + const result = client.matchLocationFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromScheduledEvaluationRunName', () => { + const result = client.matchAppFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduledEvaluationRunFromScheduledEvaluationRunName', () => { + const result = client.matchScheduledEvaluationRunFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "scheduledEvaluationRunValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tool', async () => { + const fakePath = "/rendered/path/tool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + tool: "toolValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.toolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath("projectValue", "locationValue", "appValue", "toolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromToolName', () => { + const result = client.matchAppFromToolName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, "toolValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('toolset', async () => { + const fakePath = "/rendered/path/toolset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + toolset: "toolsetValue", + }; + const client = new evaluationserviceModule.v1beta.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolsetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.toolsetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('toolsetPath', () => { + const result = client.toolsetPath("projectValue", "locationValue", "appValue", "toolsetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.toolsetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromToolsetName', () => { + const result = client.matchProjectFromToolsetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromToolsetName', () => { + const result = client.matchLocationFromToolsetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromToolsetName', () => { + const result = client.matchAppFromToolsetName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchToolsetFromToolsetName', () => { + const result = client.matchToolsetFromToolsetName(fakePath); + assert.strictEqual(result, "toolsetValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-ces/test/gapic_session_service_v1.ts b/owl-bot-staging/google-cloud-ces/test/gapic_session_service_v1.ts new file mode 100644 index 00000000000..85e591e4c94 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/test/gapic_session_service_v1.ts @@ -0,0 +1,1222 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 sessionserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, 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 stubBidiStreamingCall(response?: ResponseType, error?: Error) { + const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + 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.SessionServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new sessionserviceModule.v1.SessionServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new sessionserviceModule.v1.SessionServiceClient(); + 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 = sessionserviceModule.v1.SessionServiceClient.servicePath; + assert.strictEqual(servicePath, 'ces.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = sessionserviceModule.v1.SessionServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new sessionserviceModule.v1.SessionServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new sessionserviceModule.v1.SessionServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 sessionserviceModule.v1.SessionServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 sessionserviceModule.v1.SessionServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 sessionserviceModule.v1.SessionServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = sessionserviceModule.v1.SessionServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new sessionserviceModule.v1.SessionServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new sessionserviceModule.v1.SessionServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.sessionServiceStub, undefined); + await client.initialize(); + assert(client.sessionServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.sessionServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.sessionServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new sessionserviceModule.v1.SessionServiceClient({ + 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 sessionserviceModule.v1.SessionServiceClient({ + 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('runSession', () => { + it('invokes runSession without error', async () => { + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.RunSessionRequest() + ); + request.config ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.RunSessionRequest', ['config', 'session']); + request.config.session = defaultValue1; + const expectedHeaderRequestParams = `config.session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.RunSessionResponse() + ); + client.innerApiCalls.runSession = stubSimpleCall(expectedResponse); + const [response] = await client.runSession(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.runSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runSession without error using callback', async () => { + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.RunSessionRequest() + ); + request.config ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.RunSessionRequest', ['config', 'session']); + request.config.session = defaultValue1; + const expectedHeaderRequestParams = `config.session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.RunSessionResponse() + ); + client.innerApiCalls.runSession = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runSession( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IRunSessionResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.runSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runSession with error', async () => { + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.RunSessionRequest() + ); + request.config ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.RunSessionRequest', ['config', 'session']); + request.config.session = defaultValue1; + const expectedHeaderRequestParams = `config.session=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.runSession = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.runSession(request), expectedError); + const actualRequest = (client.innerApiCalls.runSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runSession with closed client', async () => { + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.RunSessionRequest() + ); + request.config ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.RunSessionRequest', ['config', 'session']); + request.config.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.runSession(request), expectedError); + }); + }); + + describe('bidiRunSession', () => { + it('invokes bidiRunSession without error', async () => { + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.BidiSessionClientMessage() + ); + + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.BidiSessionServerMessage() + ); + client.innerApiCalls.bidiRunSession = stubBidiStreamingCall(expectedResponse); + const stream = client.bidiRunSession(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.ces.v1.BidiSessionServerMessage) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.bidiRunSession as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + + it('invokes bidiRunSession with error', async () => { + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.BidiSessionClientMessage() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.bidiRunSession = stubBidiStreamingCall(undefined, expectedError); + const stream = client.bidiRunSession(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.ces.v1.BidiSessionServerMessage) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert((client.innerApiCalls.bidiRunSession as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('agent', async () => { + const fakePath = "/rendered/path/agent"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + agent: "agentValue", + }; + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.agentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath("projectValue", "locationValue", "appValue", "agentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAgentName', () => { + const result = client.matchAppFromAgentName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, "agentValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('app', async () => { + const fakePath = "/rendered/path/app"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + }; + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.appPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('appPath', () => { + const result = client.appPath("projectValue", "locationValue", "appValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.appPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAppName', () => { + const result = client.matchProjectFromAppName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAppName', () => { + const result = client.matchLocationFromAppName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAppName', () => { + const result = client.matchAppFromAppName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('appVersion', async () => { + const fakePath = "/rendered/path/appVersion"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + version: "versionValue", + }; + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appVersionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.appVersionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('appVersionPath', () => { + const result = client.appVersionPath("projectValue", "locationValue", "appValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.appVersionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAppVersionName', () => { + const result = client.matchProjectFromAppVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAppVersionName', () => { + const result = client.matchLocationFromAppVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAppVersionName', () => { + const result = client.matchAppFromAppVersionName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromAppVersionName', () => { + const result = client.matchVersionFromAppVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('changelog', async () => { + const fakePath = "/rendered/path/changelog"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + changelog: "changelogValue", + }; + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath("projectValue", "locationValue", "appValue", "changelogValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromChangelogName', () => { + const result = client.matchAppFromChangelogName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, "changelogValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('conversation', async () => { + const fakePath = "/rendered/path/conversation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + conversation: "conversationValue", + }; + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.conversationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.conversationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('conversationPath', () => { + const result = client.conversationPath("projectValue", "locationValue", "appValue", "conversationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.conversationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConversationName', () => { + const result = client.matchProjectFromConversationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConversationName', () => { + const result = client.matchLocationFromConversationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromConversationName', () => { + const result = client.matchAppFromConversationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConversationFromConversationName', () => { + const result = client.matchConversationFromConversationName(fakePath); + assert.strictEqual(result, "conversationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', async () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + deployment: "deploymentValue", + }; + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "appValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromDeploymentName', () => { + const result = client.matchAppFromDeploymentName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('example', async () => { + const fakePath = "/rendered/path/example"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + example: "exampleValue", + }; + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.examplePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath("projectValue", "locationValue", "appValue", "exampleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromExampleName', () => { + const result = client.matchAppFromExampleName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, "exampleValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('guardrail', async () => { + const fakePath = "/rendered/path/guardrail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + guardrail: "guardrailValue", + }; + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.guardrailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.guardrailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('guardrailPath', () => { + const result = client.guardrailPath("projectValue", "locationValue", "appValue", "guardrailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.guardrailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGuardrailName', () => { + const result = client.matchProjectFromGuardrailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGuardrailName', () => { + const result = client.matchLocationFromGuardrailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromGuardrailName', () => { + const result = client.matchAppFromGuardrailName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGuardrailFromGuardrailName', () => { + const result = client.matchGuardrailFromGuardrailName(fakePath); + assert.strictEqual(result, "guardrailValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('omnichannel', async () => { + const fakePath = "/rendered/path/omnichannel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + omnichannel: "omnichannelValue", + }; + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.omnichannelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.omnichannelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('omnichannelPath', () => { + const result = client.omnichannelPath("projectValue", "locationValue", "omnichannelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.omnichannelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromOmnichannelName', () => { + const result = client.matchProjectFromOmnichannelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOmnichannelName', () => { + const result = client.matchLocationFromOmnichannelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOmnichannelFromOmnichannelName', () => { + const result = client.matchOmnichannelFromOmnichannelName(fakePath); + assert.strictEqual(result, "omnichannelValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('session', async () => { + const fakePath = "/rendered/path/session"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + session: "sessionValue", + }; + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionPath', () => { + const result = client.sessionPath("projectValue", "locationValue", "appValue", "sessionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionName', () => { + const result = client.matchProjectFromSessionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionName', () => { + const result = client.matchLocationFromSessionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromSessionName', () => { + const result = client.matchAppFromSessionName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSessionFromSessionName', () => { + const result = client.matchSessionFromSessionName(fakePath); + assert.strictEqual(result, "sessionValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tool', async () => { + const fakePath = "/rendered/path/tool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + tool: "toolValue", + }; + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.toolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath("projectValue", "locationValue", "appValue", "toolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromToolName', () => { + const result = client.matchAppFromToolName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, "toolValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('toolset', async () => { + const fakePath = "/rendered/path/toolset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + toolset: "toolsetValue", + }; + const client = new sessionserviceModule.v1.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolsetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.toolsetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('toolsetPath', () => { + const result = client.toolsetPath("projectValue", "locationValue", "appValue", "toolsetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.toolsetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromToolsetName', () => { + const result = client.matchProjectFromToolsetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromToolsetName', () => { + const result = client.matchLocationFromToolsetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromToolsetName', () => { + const result = client.matchAppFromToolsetName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchToolsetFromToolsetName', () => { + const result = client.matchToolsetFromToolsetName(fakePath); + assert.strictEqual(result, "toolsetValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-ces/test/gapic_session_service_v1beta.ts b/owl-bot-staging/google-cloud-ces/test/gapic_session_service_v1beta.ts new file mode 100644 index 00000000000..61dedbad812 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/test/gapic_session_service_v1beta.ts @@ -0,0 +1,1554 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 sessionserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, 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 stubBidiStreamingCall(response?: ResponseType, error?: Error) { + const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + 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.SessionServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new sessionserviceModule.v1beta.SessionServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new sessionserviceModule.v1beta.SessionServiceClient(); + 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 = sessionserviceModule.v1beta.SessionServiceClient.servicePath; + assert.strictEqual(servicePath, 'ces.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = sessionserviceModule.v1beta.SessionServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new sessionserviceModule.v1beta.SessionServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new sessionserviceModule.v1beta.SessionServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 sessionserviceModule.v1beta.SessionServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 sessionserviceModule.v1beta.SessionServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 sessionserviceModule.v1beta.SessionServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = sessionserviceModule.v1beta.SessionServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new sessionserviceModule.v1beta.SessionServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.sessionServiceStub, undefined); + await client.initialize(); + assert(client.sessionServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.sessionServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.sessionServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + 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 sessionserviceModule.v1beta.SessionServiceClient({ + 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('runSession', () => { + it('invokes runSession without error', async () => { + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RunSessionRequest() + ); + request.config ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RunSessionRequest', ['config', 'session']); + request.config.session = defaultValue1; + const expectedHeaderRequestParams = `config.session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RunSessionResponse() + ); + client.innerApiCalls.runSession = stubSimpleCall(expectedResponse); + const [response] = await client.runSession(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.runSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runSession without error using callback', async () => { + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RunSessionRequest() + ); + request.config ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RunSessionRequest', ['config', 'session']); + request.config.session = defaultValue1; + const expectedHeaderRequestParams = `config.session=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RunSessionResponse() + ); + client.innerApiCalls.runSession = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runSession( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IRunSessionResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.runSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runSession with error', async () => { + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RunSessionRequest() + ); + request.config ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RunSessionRequest', ['config', 'session']); + request.config.session = defaultValue1; + const expectedHeaderRequestParams = `config.session=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.runSession = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.runSession(request), expectedError); + const actualRequest = (client.innerApiCalls.runSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runSession with closed client', async () => { + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RunSessionRequest() + ); + request.config ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RunSessionRequest', ['config', 'session']); + request.config.session = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.runSession(request), expectedError); + }); + }); + + describe('bidiRunSession', () => { + it('invokes bidiRunSession without error', async () => { + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.BidiSessionClientMessage() + ); + + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.BidiSessionServerMessage() + ); + client.innerApiCalls.bidiRunSession = stubBidiStreamingCall(expectedResponse); + const stream = client.bidiRunSession(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.ces.v1beta.BidiSessionServerMessage) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.bidiRunSession as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + + it('invokes bidiRunSession with error', async () => { + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.BidiSessionClientMessage() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.bidiRunSession = stubBidiStreamingCall(undefined, expectedError); + const stream = client.bidiRunSession(); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.ces.v1beta.BidiSessionServerMessage) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert((client.innerApiCalls.bidiRunSession as SinonStub) + .getCall(0).calledWith(null)); + assert.deepStrictEqual(((stream as unknown as PassThrough) + ._transform as SinonStub).getCall(0).args[0], request); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('agent', async () => { + const fakePath = "/rendered/path/agent"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + agent: "agentValue", + }; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.agentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath("projectValue", "locationValue", "appValue", "agentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAgentName', () => { + const result = client.matchAppFromAgentName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, "agentValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('app', async () => { + const fakePath = "/rendered/path/app"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + }; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.appPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('appPath', () => { + const result = client.appPath("projectValue", "locationValue", "appValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.appPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAppName', () => { + const result = client.matchProjectFromAppName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAppName', () => { + const result = client.matchLocationFromAppName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAppName', () => { + const result = client.matchAppFromAppName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('appVersion', async () => { + const fakePath = "/rendered/path/appVersion"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + version: "versionValue", + }; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appVersionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.appVersionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('appVersionPath', () => { + const result = client.appVersionPath("projectValue", "locationValue", "appValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.appVersionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAppVersionName', () => { + const result = client.matchProjectFromAppVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAppVersionName', () => { + const result = client.matchLocationFromAppVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAppVersionName', () => { + const result = client.matchAppFromAppVersionName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromAppVersionName', () => { + const result = client.matchVersionFromAppVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('changelog', async () => { + const fakePath = "/rendered/path/changelog"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + changelog: "changelogValue", + }; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath("projectValue", "locationValue", "appValue", "changelogValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromChangelogName', () => { + const result = client.matchAppFromChangelogName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, "changelogValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('conversation', async () => { + const fakePath = "/rendered/path/conversation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + conversation: "conversationValue", + }; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.conversationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.conversationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('conversationPath', () => { + const result = client.conversationPath("projectValue", "locationValue", "appValue", "conversationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.conversationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConversationName', () => { + const result = client.matchProjectFromConversationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConversationName', () => { + const result = client.matchLocationFromConversationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromConversationName', () => { + const result = client.matchAppFromConversationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConversationFromConversationName', () => { + const result = client.matchConversationFromConversationName(fakePath); + assert.strictEqual(result, "conversationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', async () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + deployment: "deploymentValue", + }; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "appValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromDeploymentName', () => { + const result = client.matchAppFromDeploymentName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluation', async () => { + const fakePath = "/rendered/path/evaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation: "evaluationValue", + }; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationPath', () => { + const result = client.evaluationPath("projectValue", "locationValue", "appValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationName', () => { + const result = client.matchProjectFromEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationName', () => { + const result = client.matchLocationFromEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationName', () => { + const result = client.matchAppFromEvaluationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromEvaluationName', () => { + const result = client.matchEvaluationFromEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationDataset', async () => { + const fakePath = "/rendered/path/evaluationDataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation_dataset: "evaluationDatasetValue", + }; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationDatasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationDatasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationDatasetPath', () => { + const result = client.evaluationDatasetPath("projectValue", "locationValue", "appValue", "evaluationDatasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationDatasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationDatasetName', () => { + const result = client.matchProjectFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationDatasetName', () => { + const result = client.matchLocationFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationDatasetName', () => { + const result = client.matchAppFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationDatasetFromEvaluationDatasetName', () => { + const result = client.matchEvaluationDatasetFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "evaluationDatasetValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationExpectation', async () => { + const fakePath = "/rendered/path/evaluationExpectation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation_expectation: "evaluationExpectationValue", + }; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationExpectationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationExpectationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationExpectationPath', () => { + const result = client.evaluationExpectationPath("projectValue", "locationValue", "appValue", "evaluationExpectationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationExpectationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationExpectationName', () => { + const result = client.matchProjectFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationExpectationName', () => { + const result = client.matchLocationFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationExpectationName', () => { + const result = client.matchAppFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationExpectationFromEvaluationExpectationName', () => { + const result = client.matchEvaluationExpectationFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "evaluationExpectationValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationResult', async () => { + const fakePath = "/rendered/path/evaluationResult"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation: "evaluationValue", + evaluation_result: "evaluationResultValue", + }; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationResultPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationResultPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationResultPath', () => { + const result = client.evaluationResultPath("projectValue", "locationValue", "appValue", "evaluationValue", "evaluationResultValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationResultPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationResultName', () => { + const result = client.matchProjectFromEvaluationResultName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationResultName', () => { + const result = client.matchLocationFromEvaluationResultName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationResultName', () => { + const result = client.matchAppFromEvaluationResultName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromEvaluationResultName', () => { + const result = client.matchEvaluationFromEvaluationResultName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationResultFromEvaluationResultName', () => { + const result = client.matchEvaluationResultFromEvaluationResultName(fakePath); + assert.strictEqual(result, "evaluationResultValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationRun', async () => { + const fakePath = "/rendered/path/evaluationRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation_run: "evaluationRunValue", + }; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationRunPath', () => { + const result = client.evaluationRunPath("projectValue", "locationValue", "appValue", "evaluationRunValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationRunName', () => { + const result = client.matchProjectFromEvaluationRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationRunName', () => { + const result = client.matchLocationFromEvaluationRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationRunName', () => { + const result = client.matchAppFromEvaluationRunName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationRunFromEvaluationRunName', () => { + const result = client.matchEvaluationRunFromEvaluationRunName(fakePath); + assert.strictEqual(result, "evaluationRunValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('example', async () => { + const fakePath = "/rendered/path/example"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + example: "exampleValue", + }; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.examplePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath("projectValue", "locationValue", "appValue", "exampleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromExampleName', () => { + const result = client.matchAppFromExampleName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, "exampleValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('guardrail', async () => { + const fakePath = "/rendered/path/guardrail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + guardrail: "guardrailValue", + }; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.guardrailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.guardrailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('guardrailPath', () => { + const result = client.guardrailPath("projectValue", "locationValue", "appValue", "guardrailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.guardrailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGuardrailName', () => { + const result = client.matchProjectFromGuardrailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGuardrailName', () => { + const result = client.matchLocationFromGuardrailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromGuardrailName', () => { + const result = client.matchAppFromGuardrailName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGuardrailFromGuardrailName', () => { + const result = client.matchGuardrailFromGuardrailName(fakePath); + assert.strictEqual(result, "guardrailValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('omnichannel', async () => { + const fakePath = "/rendered/path/omnichannel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + omnichannel: "omnichannelValue", + }; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.omnichannelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.omnichannelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('omnichannelPath', () => { + const result = client.omnichannelPath("projectValue", "locationValue", "omnichannelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.omnichannelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromOmnichannelName', () => { + const result = client.matchProjectFromOmnichannelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOmnichannelName', () => { + const result = client.matchLocationFromOmnichannelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOmnichannelFromOmnichannelName', () => { + const result = client.matchOmnichannelFromOmnichannelName(fakePath); + assert.strictEqual(result, "omnichannelValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('scheduledEvaluationRun', async () => { + const fakePath = "/rendered/path/scheduledEvaluationRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + scheduled_evaluation_run: "scheduledEvaluationRunValue", + }; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.scheduledEvaluationRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.scheduledEvaluationRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('scheduledEvaluationRunPath', () => { + const result = client.scheduledEvaluationRunPath("projectValue", "locationValue", "appValue", "scheduledEvaluationRunValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduledEvaluationRunName', () => { + const result = client.matchProjectFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduledEvaluationRunName', () => { + const result = client.matchLocationFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromScheduledEvaluationRunName', () => { + const result = client.matchAppFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduledEvaluationRunFromScheduledEvaluationRunName', () => { + const result = client.matchScheduledEvaluationRunFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "scheduledEvaluationRunValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('session', async () => { + const fakePath = "/rendered/path/session"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + session: "sessionValue", + }; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionPath', () => { + const result = client.sessionPath("projectValue", "locationValue", "appValue", "sessionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionName', () => { + const result = client.matchProjectFromSessionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionName', () => { + const result = client.matchLocationFromSessionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromSessionName', () => { + const result = client.matchAppFromSessionName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSessionFromSessionName', () => { + const result = client.matchSessionFromSessionName(fakePath); + assert.strictEqual(result, "sessionValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tool', async () => { + const fakePath = "/rendered/path/tool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + tool: "toolValue", + }; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.toolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath("projectValue", "locationValue", "appValue", "toolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromToolName', () => { + const result = client.matchAppFromToolName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, "toolValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('toolset', async () => { + const fakePath = "/rendered/path/toolset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + toolset: "toolsetValue", + }; + const client = new sessionserviceModule.v1beta.SessionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolsetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.toolsetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('toolsetPath', () => { + const result = client.toolsetPath("projectValue", "locationValue", "appValue", "toolsetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.toolsetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromToolsetName', () => { + const result = client.matchProjectFromToolsetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromToolsetName', () => { + const result = client.matchLocationFromToolsetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromToolsetName', () => { + const result = client.matchAppFromToolsetName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchToolsetFromToolsetName', () => { + const result = client.matchToolsetFromToolsetName(fakePath); + assert.strictEqual(result, "toolsetValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-ces/test/gapic_tool_service_v1.ts b/owl-bot-staging/google-cloud-ces/test/gapic_tool_service_v1.ts new file mode 100644 index 00000000000..588ddeeb222 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/test/gapic_tool_service_v1.ts @@ -0,0 +1,1305 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 toolserviceModule from '../src'; + +import {protobuf, 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 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.ToolServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new toolserviceModule.v1.ToolServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new toolserviceModule.v1.ToolServiceClient(); + 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 = toolserviceModule.v1.ToolServiceClient.servicePath; + assert.strictEqual(servicePath, 'ces.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = toolserviceModule.v1.ToolServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new toolserviceModule.v1.ToolServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new toolserviceModule.v1.ToolServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 toolserviceModule.v1.ToolServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 toolserviceModule.v1.ToolServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 toolserviceModule.v1.ToolServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = toolserviceModule.v1.ToolServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new toolserviceModule.v1.ToolServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.toolServiceStub, undefined); + await client.initialize(); + assert(client.toolServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.toolServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.toolServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new toolserviceModule.v1.ToolServiceClient({ + 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 toolserviceModule.v1.ToolServiceClient({ + 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('executeTool', () => { + it('invokes executeTool without error', async () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ExecuteToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ExecuteToolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.ExecuteToolResponse() + ); + client.innerApiCalls.executeTool = stubSimpleCall(expectedResponse); + const [response] = await client.executeTool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.executeTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeTool without error using callback', async () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ExecuteToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ExecuteToolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.ExecuteToolResponse() + ); + client.innerApiCalls.executeTool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.executeTool( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IExecuteToolResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.executeTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeTool with error', async () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ExecuteToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ExecuteToolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.executeTool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.executeTool(request), expectedError); + const actualRequest = (client.innerApiCalls.executeTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeTool with closed client', async () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.ExecuteToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.ExecuteToolRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.executeTool(request), expectedError); + }); + }); + + describe('retrieveToolSchema', () => { + it('invokes retrieveToolSchema without error', async () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.RetrieveToolSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.RetrieveToolSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.RetrieveToolSchemaResponse() + ); + client.innerApiCalls.retrieveToolSchema = stubSimpleCall(expectedResponse); + const [response] = await client.retrieveToolSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.retrieveToolSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.retrieveToolSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveToolSchema without error using callback', async () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.RetrieveToolSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.RetrieveToolSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.RetrieveToolSchemaResponse() + ); + client.innerApiCalls.retrieveToolSchema = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.retrieveToolSchema( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IRetrieveToolSchemaResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.retrieveToolSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.retrieveToolSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveToolSchema with error', async () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.RetrieveToolSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.RetrieveToolSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.retrieveToolSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.retrieveToolSchema(request), expectedError); + const actualRequest = (client.innerApiCalls.retrieveToolSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.retrieveToolSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveToolSchema with closed client', async () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.RetrieveToolSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.RetrieveToolSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.retrieveToolSchema(request), expectedError); + }); + }); + + describe('retrieveTools', () => { + it('invokes retrieveTools without error', async () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.RetrieveToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.RetrieveToolsRequest', ['toolset']); + request.toolset = defaultValue1; + const expectedHeaderRequestParams = `toolset=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.RetrieveToolsResponse() + ); + client.innerApiCalls.retrieveTools = stubSimpleCall(expectedResponse); + const [response] = await client.retrieveTools(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.retrieveTools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.retrieveTools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveTools without error using callback', async () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.RetrieveToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.RetrieveToolsRequest', ['toolset']); + request.toolset = defaultValue1; + const expectedHeaderRequestParams = `toolset=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.RetrieveToolsResponse() + ); + client.innerApiCalls.retrieveTools = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.retrieveTools( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IRetrieveToolsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.retrieveTools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.retrieveTools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveTools with error', async () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.RetrieveToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.RetrieveToolsRequest', ['toolset']); + request.toolset = defaultValue1; + const expectedHeaderRequestParams = `toolset=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.retrieveTools = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.retrieveTools(request), expectedError); + const actualRequest = (client.innerApiCalls.retrieveTools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.retrieveTools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveTools with closed client', async () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.RetrieveToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.RetrieveToolsRequest', ['toolset']); + request.toolset = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.retrieveTools(request), expectedError); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('agent', async () => { + const fakePath = "/rendered/path/agent"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + agent: "agentValue", + }; + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.agentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath("projectValue", "locationValue", "appValue", "agentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAgentName', () => { + const result = client.matchAppFromAgentName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, "agentValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('app', async () => { + const fakePath = "/rendered/path/app"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + }; + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.appPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('appPath', () => { + const result = client.appPath("projectValue", "locationValue", "appValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.appPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAppName', () => { + const result = client.matchProjectFromAppName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAppName', () => { + const result = client.matchLocationFromAppName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAppName', () => { + const result = client.matchAppFromAppName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('appVersion', async () => { + const fakePath = "/rendered/path/appVersion"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + version: "versionValue", + }; + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appVersionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.appVersionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('appVersionPath', () => { + const result = client.appVersionPath("projectValue", "locationValue", "appValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.appVersionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAppVersionName', () => { + const result = client.matchProjectFromAppVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAppVersionName', () => { + const result = client.matchLocationFromAppVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAppVersionName', () => { + const result = client.matchAppFromAppVersionName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromAppVersionName', () => { + const result = client.matchVersionFromAppVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('changelog', async () => { + const fakePath = "/rendered/path/changelog"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + changelog: "changelogValue", + }; + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath("projectValue", "locationValue", "appValue", "changelogValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromChangelogName', () => { + const result = client.matchAppFromChangelogName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, "changelogValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('conversation', async () => { + const fakePath = "/rendered/path/conversation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + conversation: "conversationValue", + }; + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.conversationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.conversationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('conversationPath', () => { + const result = client.conversationPath("projectValue", "locationValue", "appValue", "conversationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.conversationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConversationName', () => { + const result = client.matchProjectFromConversationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConversationName', () => { + const result = client.matchLocationFromConversationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromConversationName', () => { + const result = client.matchAppFromConversationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConversationFromConversationName', () => { + const result = client.matchConversationFromConversationName(fakePath); + assert.strictEqual(result, "conversationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', async () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + deployment: "deploymentValue", + }; + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "appValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromDeploymentName', () => { + const result = client.matchAppFromDeploymentName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('example', async () => { + const fakePath = "/rendered/path/example"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + example: "exampleValue", + }; + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.examplePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath("projectValue", "locationValue", "appValue", "exampleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromExampleName', () => { + const result = client.matchAppFromExampleName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, "exampleValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('guardrail', async () => { + const fakePath = "/rendered/path/guardrail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + guardrail: "guardrailValue", + }; + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.guardrailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.guardrailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('guardrailPath', () => { + const result = client.guardrailPath("projectValue", "locationValue", "appValue", "guardrailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.guardrailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGuardrailName', () => { + const result = client.matchProjectFromGuardrailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGuardrailName', () => { + const result = client.matchLocationFromGuardrailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromGuardrailName', () => { + const result = client.matchAppFromGuardrailName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGuardrailFromGuardrailName', () => { + const result = client.matchGuardrailFromGuardrailName(fakePath); + assert.strictEqual(result, "guardrailValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('omnichannel', async () => { + const fakePath = "/rendered/path/omnichannel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + omnichannel: "omnichannelValue", + }; + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.omnichannelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.omnichannelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('omnichannelPath', () => { + const result = client.omnichannelPath("projectValue", "locationValue", "omnichannelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.omnichannelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromOmnichannelName', () => { + const result = client.matchProjectFromOmnichannelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOmnichannelName', () => { + const result = client.matchLocationFromOmnichannelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOmnichannelFromOmnichannelName', () => { + const result = client.matchOmnichannelFromOmnichannelName(fakePath); + assert.strictEqual(result, "omnichannelValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tool', async () => { + const fakePath = "/rendered/path/tool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + tool: "toolValue", + }; + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.toolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath("projectValue", "locationValue", "appValue", "toolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromToolName', () => { + const result = client.matchAppFromToolName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, "toolValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('toolset', async () => { + const fakePath = "/rendered/path/toolset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + toolset: "toolsetValue", + }; + const client = new toolserviceModule.v1.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolsetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.toolsetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('toolsetPath', () => { + const result = client.toolsetPath("projectValue", "locationValue", "appValue", "toolsetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.toolsetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromToolsetName', () => { + const result = client.matchProjectFromToolsetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromToolsetName', () => { + const result = client.matchLocationFromToolsetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromToolsetName', () => { + const result = client.matchAppFromToolsetName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchToolsetFromToolsetName', () => { + const result = client.matchToolsetFromToolsetName(fakePath); + assert.strictEqual(result, "toolsetValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-ces/test/gapic_tool_service_v1beta.ts b/owl-bot-staging/google-cloud-ces/test/gapic_tool_service_v1beta.ts new file mode 100644 index 00000000000..73398eabc06 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/test/gapic_tool_service_v1beta.ts @@ -0,0 +1,1637 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 toolserviceModule from '../src'; + +import {protobuf, 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 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.ToolServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new toolserviceModule.v1beta.ToolServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new toolserviceModule.v1beta.ToolServiceClient(); + 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 = toolserviceModule.v1beta.ToolServiceClient.servicePath; + assert.strictEqual(servicePath, 'ces.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = toolserviceModule.v1beta.ToolServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 toolserviceModule.v1beta.ToolServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 toolserviceModule.v1beta.ToolServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 toolserviceModule.v1beta.ToolServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = toolserviceModule.v1beta.ToolServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new toolserviceModule.v1beta.ToolServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.toolServiceStub, undefined); + await client.initialize(); + assert(client.toolServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.toolServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.toolServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new toolserviceModule.v1beta.ToolServiceClient({ + 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 toolserviceModule.v1beta.ToolServiceClient({ + 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('executeTool', () => { + it('invokes executeTool without error', async () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ExecuteToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ExecuteToolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ExecuteToolResponse() + ); + client.innerApiCalls.executeTool = stubSimpleCall(expectedResponse); + const [response] = await client.executeTool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.executeTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeTool without error using callback', async () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ExecuteToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ExecuteToolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ExecuteToolResponse() + ); + client.innerApiCalls.executeTool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.executeTool( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IExecuteToolResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.executeTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeTool with error', async () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ExecuteToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ExecuteToolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.executeTool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.executeTool(request), expectedError); + const actualRequest = (client.innerApiCalls.executeTool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeTool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeTool with closed client', async () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.ExecuteToolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.ExecuteToolRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.executeTool(request), expectedError); + }); + }); + + describe('retrieveToolSchema', () => { + it('invokes retrieveToolSchema without error', async () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RetrieveToolSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RetrieveToolSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RetrieveToolSchemaResponse() + ); + client.innerApiCalls.retrieveToolSchema = stubSimpleCall(expectedResponse); + const [response] = await client.retrieveToolSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.retrieveToolSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.retrieveToolSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveToolSchema without error using callback', async () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RetrieveToolSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RetrieveToolSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RetrieveToolSchemaResponse() + ); + client.innerApiCalls.retrieveToolSchema = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.retrieveToolSchema( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IRetrieveToolSchemaResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.retrieveToolSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.retrieveToolSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveToolSchema with error', async () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RetrieveToolSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RetrieveToolSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.retrieveToolSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.retrieveToolSchema(request), expectedError); + const actualRequest = (client.innerApiCalls.retrieveToolSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.retrieveToolSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveToolSchema with closed client', async () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RetrieveToolSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RetrieveToolSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.retrieveToolSchema(request), expectedError); + }); + }); + + describe('retrieveTools', () => { + it('invokes retrieveTools without error', async () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RetrieveToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RetrieveToolsRequest', ['toolset']); + request.toolset = defaultValue1; + const expectedHeaderRequestParams = `toolset=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RetrieveToolsResponse() + ); + client.innerApiCalls.retrieveTools = stubSimpleCall(expectedResponse); + const [response] = await client.retrieveTools(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.retrieveTools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.retrieveTools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveTools without error using callback', async () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RetrieveToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RetrieveToolsRequest', ['toolset']); + request.toolset = defaultValue1; + const expectedHeaderRequestParams = `toolset=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RetrieveToolsResponse() + ); + client.innerApiCalls.retrieveTools = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.retrieveTools( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IRetrieveToolsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.retrieveTools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.retrieveTools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveTools with error', async () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RetrieveToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RetrieveToolsRequest', ['toolset']); + request.toolset = defaultValue1; + const expectedHeaderRequestParams = `toolset=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.retrieveTools = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.retrieveTools(request), expectedError); + const actualRequest = (client.innerApiCalls.retrieveTools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.retrieveTools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveTools with closed client', async () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.RetrieveToolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.RetrieveToolsRequest', ['toolset']); + request.toolset = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.retrieveTools(request), expectedError); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('agent', async () => { + const fakePath = "/rendered/path/agent"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + agent: "agentValue", + }; + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.agentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath("projectValue", "locationValue", "appValue", "agentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAgentName', () => { + const result = client.matchAppFromAgentName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, "agentValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('app', async () => { + const fakePath = "/rendered/path/app"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + }; + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.appPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('appPath', () => { + const result = client.appPath("projectValue", "locationValue", "appValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.appPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAppName', () => { + const result = client.matchProjectFromAppName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAppName', () => { + const result = client.matchLocationFromAppName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAppName', () => { + const result = client.matchAppFromAppName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('appVersion', async () => { + const fakePath = "/rendered/path/appVersion"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + version: "versionValue", + }; + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appVersionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.appVersionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('appVersionPath', () => { + const result = client.appVersionPath("projectValue", "locationValue", "appValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.appVersionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAppVersionName', () => { + const result = client.matchProjectFromAppVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAppVersionName', () => { + const result = client.matchLocationFromAppVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAppVersionName', () => { + const result = client.matchAppFromAppVersionName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromAppVersionName', () => { + const result = client.matchVersionFromAppVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('changelog', async () => { + const fakePath = "/rendered/path/changelog"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + changelog: "changelogValue", + }; + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath("projectValue", "locationValue", "appValue", "changelogValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromChangelogName', () => { + const result = client.matchAppFromChangelogName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, "changelogValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('conversation', async () => { + const fakePath = "/rendered/path/conversation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + conversation: "conversationValue", + }; + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.conversationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.conversationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('conversationPath', () => { + const result = client.conversationPath("projectValue", "locationValue", "appValue", "conversationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.conversationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConversationName', () => { + const result = client.matchProjectFromConversationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConversationName', () => { + const result = client.matchLocationFromConversationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromConversationName', () => { + const result = client.matchAppFromConversationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConversationFromConversationName', () => { + const result = client.matchConversationFromConversationName(fakePath); + assert.strictEqual(result, "conversationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', async () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + deployment: "deploymentValue", + }; + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "appValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromDeploymentName', () => { + const result = client.matchAppFromDeploymentName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluation', async () => { + const fakePath = "/rendered/path/evaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation: "evaluationValue", + }; + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationPath', () => { + const result = client.evaluationPath("projectValue", "locationValue", "appValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationName', () => { + const result = client.matchProjectFromEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationName', () => { + const result = client.matchLocationFromEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationName', () => { + const result = client.matchAppFromEvaluationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromEvaluationName', () => { + const result = client.matchEvaluationFromEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationDataset', async () => { + const fakePath = "/rendered/path/evaluationDataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation_dataset: "evaluationDatasetValue", + }; + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationDatasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationDatasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationDatasetPath', () => { + const result = client.evaluationDatasetPath("projectValue", "locationValue", "appValue", "evaluationDatasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationDatasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationDatasetName', () => { + const result = client.matchProjectFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationDatasetName', () => { + const result = client.matchLocationFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationDatasetName', () => { + const result = client.matchAppFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationDatasetFromEvaluationDatasetName', () => { + const result = client.matchEvaluationDatasetFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "evaluationDatasetValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationExpectation', async () => { + const fakePath = "/rendered/path/evaluationExpectation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation_expectation: "evaluationExpectationValue", + }; + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationExpectationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationExpectationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationExpectationPath', () => { + const result = client.evaluationExpectationPath("projectValue", "locationValue", "appValue", "evaluationExpectationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationExpectationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationExpectationName', () => { + const result = client.matchProjectFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationExpectationName', () => { + const result = client.matchLocationFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationExpectationName', () => { + const result = client.matchAppFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationExpectationFromEvaluationExpectationName', () => { + const result = client.matchEvaluationExpectationFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "evaluationExpectationValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationResult', async () => { + const fakePath = "/rendered/path/evaluationResult"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation: "evaluationValue", + evaluation_result: "evaluationResultValue", + }; + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationResultPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationResultPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationResultPath', () => { + const result = client.evaluationResultPath("projectValue", "locationValue", "appValue", "evaluationValue", "evaluationResultValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationResultPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationResultName', () => { + const result = client.matchProjectFromEvaluationResultName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationResultName', () => { + const result = client.matchLocationFromEvaluationResultName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationResultName', () => { + const result = client.matchAppFromEvaluationResultName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromEvaluationResultName', () => { + const result = client.matchEvaluationFromEvaluationResultName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationResultFromEvaluationResultName', () => { + const result = client.matchEvaluationResultFromEvaluationResultName(fakePath); + assert.strictEqual(result, "evaluationResultValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationRun', async () => { + const fakePath = "/rendered/path/evaluationRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation_run: "evaluationRunValue", + }; + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationRunPath', () => { + const result = client.evaluationRunPath("projectValue", "locationValue", "appValue", "evaluationRunValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationRunName', () => { + const result = client.matchProjectFromEvaluationRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationRunName', () => { + const result = client.matchLocationFromEvaluationRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationRunName', () => { + const result = client.matchAppFromEvaluationRunName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationRunFromEvaluationRunName', () => { + const result = client.matchEvaluationRunFromEvaluationRunName(fakePath); + assert.strictEqual(result, "evaluationRunValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('example', async () => { + const fakePath = "/rendered/path/example"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + example: "exampleValue", + }; + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.examplePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath("projectValue", "locationValue", "appValue", "exampleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromExampleName', () => { + const result = client.matchAppFromExampleName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, "exampleValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('guardrail', async () => { + const fakePath = "/rendered/path/guardrail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + guardrail: "guardrailValue", + }; + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.guardrailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.guardrailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('guardrailPath', () => { + const result = client.guardrailPath("projectValue", "locationValue", "appValue", "guardrailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.guardrailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGuardrailName', () => { + const result = client.matchProjectFromGuardrailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGuardrailName', () => { + const result = client.matchLocationFromGuardrailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromGuardrailName', () => { + const result = client.matchAppFromGuardrailName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGuardrailFromGuardrailName', () => { + const result = client.matchGuardrailFromGuardrailName(fakePath); + assert.strictEqual(result, "guardrailValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('omnichannel', async () => { + const fakePath = "/rendered/path/omnichannel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + omnichannel: "omnichannelValue", + }; + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.omnichannelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.omnichannelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('omnichannelPath', () => { + const result = client.omnichannelPath("projectValue", "locationValue", "omnichannelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.omnichannelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromOmnichannelName', () => { + const result = client.matchProjectFromOmnichannelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOmnichannelName', () => { + const result = client.matchLocationFromOmnichannelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOmnichannelFromOmnichannelName', () => { + const result = client.matchOmnichannelFromOmnichannelName(fakePath); + assert.strictEqual(result, "omnichannelValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('scheduledEvaluationRun', async () => { + const fakePath = "/rendered/path/scheduledEvaluationRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + scheduled_evaluation_run: "scheduledEvaluationRunValue", + }; + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.scheduledEvaluationRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.scheduledEvaluationRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('scheduledEvaluationRunPath', () => { + const result = client.scheduledEvaluationRunPath("projectValue", "locationValue", "appValue", "scheduledEvaluationRunValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduledEvaluationRunName', () => { + const result = client.matchProjectFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduledEvaluationRunName', () => { + const result = client.matchLocationFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromScheduledEvaluationRunName', () => { + const result = client.matchAppFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduledEvaluationRunFromScheduledEvaluationRunName', () => { + const result = client.matchScheduledEvaluationRunFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "scheduledEvaluationRunValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tool', async () => { + const fakePath = "/rendered/path/tool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + tool: "toolValue", + }; + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.toolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath("projectValue", "locationValue", "appValue", "toolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromToolName', () => { + const result = client.matchAppFromToolName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, "toolValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('toolset', async () => { + const fakePath = "/rendered/path/toolset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + toolset: "toolsetValue", + }; + const client = new toolserviceModule.v1beta.ToolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolsetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.toolsetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('toolsetPath', () => { + const result = client.toolsetPath("projectValue", "locationValue", "appValue", "toolsetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.toolsetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromToolsetName', () => { + const result = client.matchProjectFromToolsetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromToolsetName', () => { + const result = client.matchLocationFromToolsetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromToolsetName', () => { + const result = client.matchAppFromToolsetName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchToolsetFromToolsetName', () => { + const result = client.matchToolsetFromToolsetName(fakePath); + assert.strictEqual(result, "toolsetValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-ces/test/gapic_widget_service_v1.ts b/owl-bot-staging/google-cloud-ces/test/gapic_widget_service_v1.ts new file mode 100644 index 00000000000..eb75d8d4f4b --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/test/gapic_widget_service_v1.ts @@ -0,0 +1,1143 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 widgetserviceModule from '../src'; + +import {protobuf, 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 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.WidgetServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new widgetserviceModule.v1.WidgetServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new widgetserviceModule.v1.WidgetServiceClient(); + 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 = widgetserviceModule.v1.WidgetServiceClient.servicePath; + assert.strictEqual(servicePath, 'ces.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = widgetserviceModule.v1.WidgetServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new widgetserviceModule.v1.WidgetServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new widgetserviceModule.v1.WidgetServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 widgetserviceModule.v1.WidgetServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 widgetserviceModule.v1.WidgetServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 widgetserviceModule.v1.WidgetServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = widgetserviceModule.v1.WidgetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new widgetserviceModule.v1.WidgetServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new widgetserviceModule.v1.WidgetServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.widgetServiceStub, undefined); + await client.initialize(); + assert(client.widgetServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.widgetServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.widgetServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new widgetserviceModule.v1.WidgetServiceClient({ + 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 widgetserviceModule.v1.WidgetServiceClient({ + 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('generateChatToken', () => { + it('invokes generateChatToken without error', async () => { + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GenerateChatTokenRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GenerateChatTokenRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.GenerateChatTokenResponse() + ); + client.innerApiCalls.generateChatToken = stubSimpleCall(expectedResponse); + const [response] = await client.generateChatToken(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.generateChatToken as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateChatToken as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateChatToken without error using callback', async () => { + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GenerateChatTokenRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GenerateChatTokenRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1.GenerateChatTokenResponse() + ); + client.innerApiCalls.generateChatToken = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateChatToken( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1.IGenerateChatTokenResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.generateChatToken as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateChatToken as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateChatToken with error', async () => { + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GenerateChatTokenRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GenerateChatTokenRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateChatToken = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.generateChatToken(request), expectedError); + const actualRequest = (client.innerApiCalls.generateChatToken as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateChatToken as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateChatToken with closed client', async () => { + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1.GenerateChatTokenRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1.GenerateChatTokenRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.generateChatToken(request), expectedError); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('agent', async () => { + const fakePath = "/rendered/path/agent"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + agent: "agentValue", + }; + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.agentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath("projectValue", "locationValue", "appValue", "agentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAgentName', () => { + const result = client.matchAppFromAgentName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, "agentValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('app', async () => { + const fakePath = "/rendered/path/app"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + }; + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.appPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('appPath', () => { + const result = client.appPath("projectValue", "locationValue", "appValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.appPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAppName', () => { + const result = client.matchProjectFromAppName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAppName', () => { + const result = client.matchLocationFromAppName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAppName', () => { + const result = client.matchAppFromAppName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('appVersion', async () => { + const fakePath = "/rendered/path/appVersion"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + version: "versionValue", + }; + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appVersionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.appVersionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('appVersionPath', () => { + const result = client.appVersionPath("projectValue", "locationValue", "appValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.appVersionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAppVersionName', () => { + const result = client.matchProjectFromAppVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAppVersionName', () => { + const result = client.matchLocationFromAppVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAppVersionName', () => { + const result = client.matchAppFromAppVersionName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromAppVersionName', () => { + const result = client.matchVersionFromAppVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('changelog', async () => { + const fakePath = "/rendered/path/changelog"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + changelog: "changelogValue", + }; + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath("projectValue", "locationValue", "appValue", "changelogValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromChangelogName', () => { + const result = client.matchAppFromChangelogName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, "changelogValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('conversation', async () => { + const fakePath = "/rendered/path/conversation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + conversation: "conversationValue", + }; + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.conversationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.conversationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('conversationPath', () => { + const result = client.conversationPath("projectValue", "locationValue", "appValue", "conversationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.conversationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConversationName', () => { + const result = client.matchProjectFromConversationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConversationName', () => { + const result = client.matchLocationFromConversationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromConversationName', () => { + const result = client.matchAppFromConversationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConversationFromConversationName', () => { + const result = client.matchConversationFromConversationName(fakePath); + assert.strictEqual(result, "conversationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', async () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + deployment: "deploymentValue", + }; + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "appValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromDeploymentName', () => { + const result = client.matchAppFromDeploymentName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('example', async () => { + const fakePath = "/rendered/path/example"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + example: "exampleValue", + }; + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.examplePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath("projectValue", "locationValue", "appValue", "exampleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromExampleName', () => { + const result = client.matchAppFromExampleName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, "exampleValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('guardrail', async () => { + const fakePath = "/rendered/path/guardrail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + guardrail: "guardrailValue", + }; + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.guardrailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.guardrailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('guardrailPath', () => { + const result = client.guardrailPath("projectValue", "locationValue", "appValue", "guardrailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.guardrailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGuardrailName', () => { + const result = client.matchProjectFromGuardrailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGuardrailName', () => { + const result = client.matchLocationFromGuardrailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromGuardrailName', () => { + const result = client.matchAppFromGuardrailName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGuardrailFromGuardrailName', () => { + const result = client.matchGuardrailFromGuardrailName(fakePath); + assert.strictEqual(result, "guardrailValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('omnichannel', async () => { + const fakePath = "/rendered/path/omnichannel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + omnichannel: "omnichannelValue", + }; + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.omnichannelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.omnichannelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('omnichannelPath', () => { + const result = client.omnichannelPath("projectValue", "locationValue", "omnichannelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.omnichannelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromOmnichannelName', () => { + const result = client.matchProjectFromOmnichannelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOmnichannelName', () => { + const result = client.matchLocationFromOmnichannelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOmnichannelFromOmnichannelName', () => { + const result = client.matchOmnichannelFromOmnichannelName(fakePath); + assert.strictEqual(result, "omnichannelValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('session', async () => { + const fakePath = "/rendered/path/session"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + session: "sessionValue", + }; + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionPath', () => { + const result = client.sessionPath("projectValue", "locationValue", "appValue", "sessionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionName', () => { + const result = client.matchProjectFromSessionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionName', () => { + const result = client.matchLocationFromSessionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromSessionName', () => { + const result = client.matchAppFromSessionName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSessionFromSessionName', () => { + const result = client.matchSessionFromSessionName(fakePath); + assert.strictEqual(result, "sessionValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tool', async () => { + const fakePath = "/rendered/path/tool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + tool: "toolValue", + }; + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.toolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath("projectValue", "locationValue", "appValue", "toolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromToolName', () => { + const result = client.matchAppFromToolName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, "toolValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('toolset', async () => { + const fakePath = "/rendered/path/toolset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + toolset: "toolsetValue", + }; + const client = new widgetserviceModule.v1.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolsetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.toolsetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('toolsetPath', () => { + const result = client.toolsetPath("projectValue", "locationValue", "appValue", "toolsetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.toolsetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromToolsetName', () => { + const result = client.matchProjectFromToolsetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromToolsetName', () => { + const result = client.matchLocationFromToolsetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromToolsetName', () => { + const result = client.matchAppFromToolsetName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchToolsetFromToolsetName', () => { + const result = client.matchToolsetFromToolsetName(fakePath); + assert.strictEqual(result, "toolsetValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-ces/test/gapic_widget_service_v1beta.ts b/owl-bot-staging/google-cloud-ces/test/gapic_widget_service_v1beta.ts new file mode 100644 index 00000000000..1db2e94aff2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/test/gapic_widget_service_v1beta.ts @@ -0,0 +1,1475 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 widgetserviceModule from '../src'; + +import {protobuf, 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 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.WidgetServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new widgetserviceModule.v1beta.WidgetServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new widgetserviceModule.v1beta.WidgetServiceClient(); + 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 = widgetserviceModule.v1beta.WidgetServiceClient.servicePath; + assert.strictEqual(servicePath, 'ces.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = widgetserviceModule.v1beta.WidgetServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new widgetserviceModule.v1beta.WidgetServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new widgetserviceModule.v1beta.WidgetServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 widgetserviceModule.v1beta.WidgetServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 widgetserviceModule.v1beta.WidgetServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'ces.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 widgetserviceModule.v1beta.WidgetServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = widgetserviceModule.v1beta.WidgetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new widgetserviceModule.v1beta.WidgetServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.widgetServiceStub, undefined); + await client.initialize(); + assert(client.widgetServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.widgetServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.widgetServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + 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 widgetserviceModule.v1beta.WidgetServiceClient({ + 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('generateChatToken', () => { + it('invokes generateChatToken without error', async () => { + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GenerateChatTokenRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GenerateChatTokenRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GenerateChatTokenResponse() + ); + client.innerApiCalls.generateChatToken = stubSimpleCall(expectedResponse); + const [response] = await client.generateChatToken(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.generateChatToken as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateChatToken as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateChatToken without error using callback', async () => { + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GenerateChatTokenRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GenerateChatTokenRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GenerateChatTokenResponse() + ); + client.innerApiCalls.generateChatToken = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateChatToken( + request, + (err?: Error|null, result?: protos.google.cloud.ces.v1beta.IGenerateChatTokenResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.generateChatToken as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateChatToken as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateChatToken with error', async () => { + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GenerateChatTokenRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GenerateChatTokenRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateChatToken = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.generateChatToken(request), expectedError); + const actualRequest = (client.innerApiCalls.generateChatToken as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateChatToken as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateChatToken with closed client', async () => { + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GenerateChatTokenRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GenerateChatTokenRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.generateChatToken(request), expectedError); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('agent', async () => { + const fakePath = "/rendered/path/agent"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + agent: "agentValue", + }; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.agentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.agentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath("projectValue", "locationValue", "appValue", "agentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAgentName', () => { + const result = client.matchAppFromAgentName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, "agentValue"); + assert((client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('app', async () => { + const fakePath = "/rendered/path/app"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + }; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.appPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('appPath', () => { + const result = client.appPath("projectValue", "locationValue", "appValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.appPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAppName', () => { + const result = client.matchProjectFromAppName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAppName', () => { + const result = client.matchLocationFromAppName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAppName', () => { + const result = client.matchAppFromAppName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.appPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('appVersion', async () => { + const fakePath = "/rendered/path/appVersion"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + version: "versionValue", + }; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.appVersionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.appVersionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('appVersionPath', () => { + const result = client.appVersionPath("projectValue", "locationValue", "appValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.appVersionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAppVersionName', () => { + const result = client.matchProjectFromAppVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAppVersionName', () => { + const result = client.matchLocationFromAppVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromAppVersionName', () => { + const result = client.matchAppFromAppVersionName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromAppVersionName', () => { + const result = client.matchVersionFromAppVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('changelog', async () => { + const fakePath = "/rendered/path/changelog"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + changelog: "changelogValue", + }; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.changelogPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.changelogPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('changelogPath', () => { + const result = client.changelogPath("projectValue", "locationValue", "appValue", "changelogValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.changelogPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromChangelogName', () => { + const result = client.matchProjectFromChangelogName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromChangelogName', () => { + const result = client.matchLocationFromChangelogName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromChangelogName', () => { + const result = client.matchAppFromChangelogName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchChangelogFromChangelogName', () => { + const result = client.matchChangelogFromChangelogName(fakePath); + assert.strictEqual(result, "changelogValue"); + assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('conversation', async () => { + const fakePath = "/rendered/path/conversation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + conversation: "conversationValue", + }; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.conversationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.conversationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('conversationPath', () => { + const result = client.conversationPath("projectValue", "locationValue", "appValue", "conversationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.conversationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConversationName', () => { + const result = client.matchProjectFromConversationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConversationName', () => { + const result = client.matchLocationFromConversationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromConversationName', () => { + const result = client.matchAppFromConversationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConversationFromConversationName', () => { + const result = client.matchConversationFromConversationName(fakePath); + assert.strictEqual(result, "conversationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', async () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + deployment: "deploymentValue", + }; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "appValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromDeploymentName', () => { + const result = client.matchAppFromDeploymentName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluation', async () => { + const fakePath = "/rendered/path/evaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation: "evaluationValue", + }; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationPath', () => { + const result = client.evaluationPath("projectValue", "locationValue", "appValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationName', () => { + const result = client.matchProjectFromEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationName', () => { + const result = client.matchLocationFromEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationName', () => { + const result = client.matchAppFromEvaluationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromEvaluationName', () => { + const result = client.matchEvaluationFromEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationDataset', async () => { + const fakePath = "/rendered/path/evaluationDataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation_dataset: "evaluationDatasetValue", + }; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationDatasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationDatasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationDatasetPath', () => { + const result = client.evaluationDatasetPath("projectValue", "locationValue", "appValue", "evaluationDatasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationDatasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationDatasetName', () => { + const result = client.matchProjectFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationDatasetName', () => { + const result = client.matchLocationFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationDatasetName', () => { + const result = client.matchAppFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationDatasetFromEvaluationDatasetName', () => { + const result = client.matchEvaluationDatasetFromEvaluationDatasetName(fakePath); + assert.strictEqual(result, "evaluationDatasetValue"); + assert((client.pathTemplates.evaluationDatasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationExpectation', async () => { + const fakePath = "/rendered/path/evaluationExpectation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation_expectation: "evaluationExpectationValue", + }; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationExpectationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationExpectationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationExpectationPath', () => { + const result = client.evaluationExpectationPath("projectValue", "locationValue", "appValue", "evaluationExpectationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationExpectationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationExpectationName', () => { + const result = client.matchProjectFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationExpectationName', () => { + const result = client.matchLocationFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationExpectationName', () => { + const result = client.matchAppFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationExpectationFromEvaluationExpectationName', () => { + const result = client.matchEvaluationExpectationFromEvaluationExpectationName(fakePath); + assert.strictEqual(result, "evaluationExpectationValue"); + assert((client.pathTemplates.evaluationExpectationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationResult', async () => { + const fakePath = "/rendered/path/evaluationResult"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation: "evaluationValue", + evaluation_result: "evaluationResultValue", + }; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationResultPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationResultPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationResultPath', () => { + const result = client.evaluationResultPath("projectValue", "locationValue", "appValue", "evaluationValue", "evaluationResultValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationResultPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationResultName', () => { + const result = client.matchProjectFromEvaluationResultName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationResultName', () => { + const result = client.matchLocationFromEvaluationResultName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationResultName', () => { + const result = client.matchAppFromEvaluationResultName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromEvaluationResultName', () => { + const result = client.matchEvaluationFromEvaluationResultName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationResultFromEvaluationResultName', () => { + const result = client.matchEvaluationResultFromEvaluationResultName(fakePath); + assert.strictEqual(result, "evaluationResultValue"); + assert((client.pathTemplates.evaluationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluationRun', async () => { + const fakePath = "/rendered/path/evaluationRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + evaluation_run: "evaluationRunValue", + }; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationRunPath', () => { + const result = client.evaluationRunPath("projectValue", "locationValue", "appValue", "evaluationRunValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationRunName', () => { + const result = client.matchProjectFromEvaluationRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationRunName', () => { + const result = client.matchLocationFromEvaluationRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromEvaluationRunName', () => { + const result = client.matchAppFromEvaluationRunName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationRunFromEvaluationRunName', () => { + const result = client.matchEvaluationRunFromEvaluationRunName(fakePath); + assert.strictEqual(result, "evaluationRunValue"); + assert((client.pathTemplates.evaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('example', async () => { + const fakePath = "/rendered/path/example"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + example: "exampleValue", + }; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.examplePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.examplePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('examplePath', () => { + const result = client.examplePath("projectValue", "locationValue", "appValue", "exampleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.examplePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExampleName', () => { + const result = client.matchProjectFromExampleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExampleName', () => { + const result = client.matchLocationFromExampleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromExampleName', () => { + const result = client.matchAppFromExampleName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExampleFromExampleName', () => { + const result = client.matchExampleFromExampleName(fakePath); + assert.strictEqual(result, "exampleValue"); + assert((client.pathTemplates.examplePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('guardrail', async () => { + const fakePath = "/rendered/path/guardrail"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + guardrail: "guardrailValue", + }; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.guardrailPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.guardrailPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('guardrailPath', () => { + const result = client.guardrailPath("projectValue", "locationValue", "appValue", "guardrailValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.guardrailPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGuardrailName', () => { + const result = client.matchProjectFromGuardrailName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGuardrailName', () => { + const result = client.matchLocationFromGuardrailName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromGuardrailName', () => { + const result = client.matchAppFromGuardrailName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGuardrailFromGuardrailName', () => { + const result = client.matchGuardrailFromGuardrailName(fakePath); + assert.strictEqual(result, "guardrailValue"); + assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('omnichannel', async () => { + const fakePath = "/rendered/path/omnichannel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + omnichannel: "omnichannelValue", + }; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.omnichannelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.omnichannelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('omnichannelPath', () => { + const result = client.omnichannelPath("projectValue", "locationValue", "omnichannelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.omnichannelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromOmnichannelName', () => { + const result = client.matchProjectFromOmnichannelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOmnichannelName', () => { + const result = client.matchLocationFromOmnichannelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOmnichannelFromOmnichannelName', () => { + const result = client.matchOmnichannelFromOmnichannelName(fakePath); + assert.strictEqual(result, "omnichannelValue"); + assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('scheduledEvaluationRun', async () => { + const fakePath = "/rendered/path/scheduledEvaluationRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + scheduled_evaluation_run: "scheduledEvaluationRunValue", + }; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.scheduledEvaluationRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.scheduledEvaluationRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('scheduledEvaluationRunPath', () => { + const result = client.scheduledEvaluationRunPath("projectValue", "locationValue", "appValue", "scheduledEvaluationRunValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromScheduledEvaluationRunName', () => { + const result = client.matchProjectFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromScheduledEvaluationRunName', () => { + const result = client.matchLocationFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromScheduledEvaluationRunName', () => { + const result = client.matchAppFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchScheduledEvaluationRunFromScheduledEvaluationRunName', () => { + const result = client.matchScheduledEvaluationRunFromScheduledEvaluationRunName(fakePath); + assert.strictEqual(result, "scheduledEvaluationRunValue"); + assert((client.pathTemplates.scheduledEvaluationRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('session', async () => { + const fakePath = "/rendered/path/session"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + session: "sessionValue", + }; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionPath', () => { + const result = client.sessionPath("projectValue", "locationValue", "appValue", "sessionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionName', () => { + const result = client.matchProjectFromSessionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionName', () => { + const result = client.matchLocationFromSessionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromSessionName', () => { + const result = client.matchAppFromSessionName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSessionFromSessionName', () => { + const result = client.matchSessionFromSessionName(fakePath); + assert.strictEqual(result, "sessionValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tool', async () => { + const fakePath = "/rendered/path/tool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + tool: "toolValue", + }; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.toolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('toolPath', () => { + const result = client.toolPath("projectValue", "locationValue", "appValue", "toolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.toolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromToolName', () => { + const result = client.matchProjectFromToolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromToolName', () => { + const result = client.matchLocationFromToolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromToolName', () => { + const result = client.matchAppFromToolName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchToolFromToolName', () => { + const result = client.matchToolFromToolName(fakePath); + assert.strictEqual(result, "toolValue"); + assert((client.pathTemplates.toolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('toolset', async () => { + const fakePath = "/rendered/path/toolset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + app: "appValue", + toolset: "toolsetValue", + }; + const client = new widgetserviceModule.v1beta.WidgetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.toolsetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.toolsetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('toolsetPath', () => { + const result = client.toolsetPath("projectValue", "locationValue", "appValue", "toolsetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.toolsetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromToolsetName', () => { + const result = client.matchProjectFromToolsetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromToolsetName', () => { + const result = client.matchLocationFromToolsetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAppFromToolsetName', () => { + const result = client.matchAppFromToolsetName(fakePath); + assert.strictEqual(result, "appValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchToolsetFromToolsetName', () => { + const result = client.matchToolsetFromToolsetName(fakePath); + assert.strictEqual(result, "toolsetValue"); + assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-ces/tsconfig.json b/owl-bot-staging/google-cloud-ces/tsconfig.json new file mode 100644 index 00000000000..ca73e7bfc82 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/owl-bot-staging/google-cloud-ces/webpack.config.js b/owl-bot-staging/google-cloud-ces/webpack.config.js new file mode 100644 index 00000000000..e4d0d078fe2 --- /dev/null +++ b/owl-bot-staging/google-cloud-ces/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: 'AgentService', + filename: './agent-service.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 0b9adae7631db265afa6cd31b6e71ce5068b9cbf Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 20 Feb 2026 01:22:56 +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 --- owl-bot-staging/google-cloud-ces/.OwlBot.yaml | 19 - .../google-cloud-ces/.eslintignore | 7 - .../google-cloud-ces/.eslintrc.json | 3 - .../google-cloud-ces/.gitattributes | 4 - owl-bot-staging/google-cloud-ces/.gitignore | 14 - owl-bot-staging/google-cloud-ces/.jsdoc.js | 55 - owl-bot-staging/google-cloud-ces/.mocharc.js | 33 - owl-bot-staging/google-cloud-ces/.nycrc | 24 - .../google-cloud-ces/.prettierignore | 6 - .../google-cloud-ces/.prettierrc.js | 22 - .../google-cloud-ces/CODE_OF_CONDUCT.md | 94 - .../google-cloud-ces/CONTRIBUTING.md | 76 - owl-bot-staging/google-cloud-ces/LICENSE | 202 - owl-bot-staging/google-cloud-ces/README.md | 253 - .../protos/google/cloud/ces/v1/agent.proto | 236 - .../google/cloud/ces/v1/agent_service.proto | 1695 - .../google/cloud/ces/v1/agent_transfers.proto | 101 - .../protos/google/cloud/ces/v1/app.proto | 651 - .../google/cloud/ces/v1/app_version.proto | 91 - .../protos/google/cloud/ces/v1/auth.proto | 195 - .../google/cloud/ces/v1/bigquery_export.proto | 40 - .../google/cloud/ces/v1/changelog.proto | 82 - .../google/cloud/ces/v1/client_function.proto | 44 - .../protos/google/cloud/ces/v1/common.proto | 344 - .../google/cloud/ces/v1/connector_tool.proto | 111 - .../cloud/ces/v1/connector_toolset.proto | 50 - .../google/cloud/ces/v1/conversation.proto | 165 - .../google/cloud/ces/v1/data_store.proto | 98 - .../google/cloud/ces/v1/data_store_tool.proto | 302 - .../google/cloud/ces/v1/deployment.proto | 70 - .../protos/google/cloud/ces/v1/example.proto | 225 - .../protos/google/cloud/ces/v1/fakes.proto | 50 - .../cloud/ces/v1/file_search_tool.proto | 55 - .../cloud/ces/v1/google_search_tool.proto | 69 - .../google/cloud/ces/v1/guardrail.proto | 311 - .../protos/google/cloud/ces/v1/mcp_tool.proto | 69 - .../google/cloud/ces/v1/mcp_toolset.proto | 54 - .../google/cloud/ces/v1/omnichannel.proto | 135 - .../cloud/ces/v1/omnichannel_service.proto | 46 - .../google/cloud/ces/v1/open_api_tool.proto | 65 - .../cloud/ces/v1/open_api_toolset.proto | 56 - .../google/cloud/ces/v1/python_function.proto | 39 - .../protos/google/cloud/ces/v1/schema.proto | 140 - .../cloud/ces/v1/search_suggestions.proto | 45 - .../google/cloud/ces/v1/session_service.proto | 456 - .../google/cloud/ces/v1/system_tool.proto | 33 - .../protos/google/cloud/ces/v1/tool.proto | 124 - .../google/cloud/ces/v1/tool_service.proto | 189 - .../protos/google/cloud/ces/v1/toolset.proto | 90 - .../google/cloud/ces/v1/toolset_tool.proto | 39 - .../google/cloud/ces/v1/widget_service.proto | 79 - .../google/cloud/ces/v1/widget_tool.proto | 84 - .../google-cloud-ces/protos/protos.d.ts | 72921 ------ .../google-cloud-ces/protos/protos.js | 185109 --------------- .../google-cloud-ces/protos/protos.json | 22318 -- ...gent_service.batch_delete_conversations.js | 69 - .../v1/agent_service.create_agent.js | 72 - .../generated/v1/agent_service.create_app.js | 73 - .../v1/agent_service.create_app_version.js | 72 - .../v1/agent_service.create_deployment.js | 74 - .../v1/agent_service.create_example.js | 72 - .../v1/agent_service.create_guardrail.js | 72 - .../generated/v1/agent_service.create_tool.js | 72 - .../v1/agent_service.create_toolset.js | 72 - .../v1/agent_service.delete_agent.js | 77 - .../generated/v1/agent_service.delete_app.js | 69 - .../v1/agent_service.delete_app_version.js | 68 - .../v1/agent_service.delete_conversation.js | 66 - .../v1/agent_service.delete_deployment.js | 69 - .../v1/agent_service.delete_example.js | 68 - .../v1/agent_service.delete_guardrail.js | 77 - .../generated/v1/agent_service.delete_tool.js | 77 - .../v1/agent_service.delete_toolset.js | 77 - .../generated/v1/agent_service.export_app.js | 74 - .../generated/v1/agent_service.get_agent.js | 61 - .../generated/v1/agent_service.get_app.js | 61 - .../v1/agent_service.get_app_version.js | 61 - .../v1/agent_service.get_changelog.js | 61 - .../v1/agent_service.get_conversation.js | 66 - .../v1/agent_service.get_deployment.js | 63 - .../generated/v1/agent_service.get_example.js | 61 - .../v1/agent_service.get_guardrail.js | 61 - .../generated/v1/agent_service.get_tool.js | 61 - .../generated/v1/agent_service.get_toolset.js | 61 - .../generated/v1/agent_service.import_app.js | 102 - .../generated/v1/agent_service.list_agents.js | 86 - .../v1/agent_service.list_app_versions.js | 86 - .../generated/v1/agent_service.list_apps.js | 85 - .../v1/agent_service.list_changelogs.js | 98 - .../v1/agent_service.list_conversations.js | 91 - .../v1/agent_service.list_deployments.js | 84 - .../v1/agent_service.list_examples.js | 86 - .../v1/agent_service.list_guardrails.js | 86 - .../generated/v1/agent_service.list_tools.js | 86 - .../v1/agent_service.list_toolsets.js | 86 - .../v1/agent_service.restore_app_version.js | 62 - .../v1/agent_service.update_agent.js | 66 - .../generated/v1/agent_service.update_app.js | 66 - .../v1/agent_service.update_deployment.js | 65 - .../v1/agent_service.update_example.js | 66 - .../v1/agent_service.update_guardrail.js | 66 - .../generated/v1/agent_service.update_tool.js | 66 - .../v1/agent_service.update_toolset.js | 66 - .../v1/session_service.bidi_run_session.js | 68 - .../v1/session_service.run_session.js | 66 - .../snippet_metadata_google.cloud.ces.v1.json | 2559 - .../generated/v1/tool_service.execute_tool.js | 78 - .../v1/tool_service.retrieve_tool_schema.js | 74 - .../v1/tool_service.retrieve_tools.js | 68 - .../v1/widget_service.generate_chat_token.js | 74 - owl-bot-staging/google-cloud-ces/src/index.ts | 34 - .../src/v1/agent_service_client.ts | 7641 - .../src/v1/agent_service_client_config.json | 266 - .../src/v1/agent_service_proto_list.json | 40 - .../src/v1/gapic_metadata.json | 640 - .../google-cloud-ces/src/v1/index.ts | 22 - .../src/v1/session_service_client.ts | 1383 - .../src/v1/session_service_client_config.json | 36 - .../src/v1/session_service_proto_list.json | 40 - .../src/v1/tool_service_client.ts | 1431 - .../src/v1/tool_service_client_config.json | 41 - .../src/v1/tool_service_proto_list.json | 40 - .../src/v1/widget_service_client.ts | 1291 - .../src/v1/widget_service_client_config.json | 30 - .../src/v1/widget_service_proto_list.json | 40 - .../system-test/fixtures/sample/src/index.js | 30 - .../system-test/fixtures/sample/src/index.ts | 50 - .../google-cloud-ces/system-test/install.ts | 49 - .../test/gapic_agent_service_v1.ts | 8205 - .../test/gapic_session_service_v1.ts | 1222 - .../test/gapic_tool_service_v1.ts | 1305 - .../test/gapic_widget_service_v1.ts | 1143 - .../google-cloud-ces/tsconfig.json | 22 - .../google-cloud-ces/webpack.config.js | 64 - packages/google-cloud-ces/README.md | 86 + .../google/cloud/ces/v1beta/agent.proto | 0 .../cloud/ces/v1beta/agent_service.proto | 0 .../cloud/ces/v1beta/agent_transfers.proto | 0 .../protos/google/cloud/ces/v1beta/app.proto | 0 .../google/cloud/ces/v1beta/app_version.proto | 0 .../protos/google/cloud/ces/v1beta/auth.proto | 0 .../cloud/ces/v1beta/bigquery_export.proto | 0 .../google/cloud/ces/v1beta/changelog.proto | 0 .../cloud/ces/v1beta/client_function.proto | 0 .../google/cloud/ces/v1beta/common.proto | 0 .../cloud/ces/v1beta/connector_tool.proto | 0 .../cloud/ces/v1beta/connector_toolset.proto | 0 .../cloud/ces/v1beta/conversation.proto | 0 .../google/cloud/ces/v1beta/data_store.proto | 0 .../cloud/ces/v1beta/data_store_tool.proto | 0 .../google/cloud/ces/v1beta/deployment.proto | 0 .../google/cloud/ces/v1beta/evaluation.proto | 0 .../cloud/ces/v1beta/evaluation_service.proto | 0 .../google/cloud/ces/v1beta/example.proto | 0 .../google/cloud/ces/v1beta/fakes.proto | 0 .../cloud/ces/v1beta/file_search_tool.proto | 0 .../google/cloud/ces/v1beta/golden_run.proto | 0 .../cloud/ces/v1beta/google_search_tool.proto | 0 .../google/cloud/ces/v1beta/guardrail.proto | 0 .../google/cloud/ces/v1beta/mcp_tool.proto | 0 .../google/cloud/ces/v1beta/mcp_toolset.proto | 0 .../google/cloud/ces/v1beta/omnichannel.proto | 0 .../ces/v1beta/omnichannel_service.proto | 0 .../cloud/ces/v1beta/open_api_tool.proto | 0 .../cloud/ces/v1beta/open_api_toolset.proto | 0 .../cloud/ces/v1beta/python_function.proto | 0 .../google/cloud/ces/v1beta/schema.proto | 0 .../cloud/ces/v1beta/search_suggestions.proto | 0 .../cloud/ces/v1beta/session_service.proto | 0 .../google/cloud/ces/v1beta/system_tool.proto | 0 .../protos/google/cloud/ces/v1beta/tool.proto | 0 .../cloud/ces/v1beta/tool_service.proto | 0 .../google/cloud/ces/v1beta/toolset.proto | 0 .../cloud/ces/v1beta/toolset_tool.proto | 0 .../cloud/ces/v1beta/widget_service.proto | 0 .../google/cloud/ces/v1beta/widget_tool.proto | 0 packages/google-cloud-ces/protos/protos.d.ts | 39027 +++ packages/google-cloud-ces/protos/protos.js | 98491 ++++++++ packages/google-cloud-ces/protos/protos.json | 12305 + ...gent_service.batch_delete_conversations.js | 0 .../v1beta/agent_service.create_agent.js | 0 .../v1beta/agent_service.create_app.js | 0 .../agent_service.create_app_version.js | 0 .../v1beta/agent_service.create_deployment.js | 0 .../v1beta/agent_service.create_example.js | 0 .../v1beta/agent_service.create_guardrail.js | 0 .../v1beta/agent_service.create_tool.js | 0 .../v1beta/agent_service.create_toolset.js | 0 .../v1beta/agent_service.delete_agent.js | 0 .../v1beta/agent_service.delete_app.js | 0 .../agent_service.delete_app_version.js | 0 .../agent_service.delete_conversation.js | 0 .../v1beta/agent_service.delete_deployment.js | 0 .../v1beta/agent_service.delete_example.js | 0 .../v1beta/agent_service.delete_guardrail.js | 0 .../v1beta/agent_service.delete_tool.js | 0 .../v1beta/agent_service.delete_toolset.js | 0 .../v1beta/agent_service.export_app.js | 0 .../v1beta/agent_service.get_agent.js | 0 .../generated/v1beta/agent_service.get_app.js | 0 .../v1beta/agent_service.get_app_version.js | 0 .../v1beta/agent_service.get_changelog.js | 0 .../v1beta/agent_service.get_conversation.js | 0 .../v1beta/agent_service.get_deployment.js | 0 .../v1beta/agent_service.get_example.js | 0 .../v1beta/agent_service.get_guardrail.js | 0 .../v1beta/agent_service.get_tool.js | 0 .../v1beta/agent_service.get_toolset.js | 0 .../v1beta/agent_service.import_app.js | 0 .../v1beta/agent_service.list_agents.js | 0 .../v1beta/agent_service.list_app_versions.js | 0 .../v1beta/agent_service.list_apps.js | 0 .../v1beta/agent_service.list_changelogs.js | 0 .../agent_service.list_conversations.js | 0 .../v1beta/agent_service.list_deployments.js | 0 .../v1beta/agent_service.list_examples.js | 0 .../v1beta/agent_service.list_guardrails.js | 0 .../v1beta/agent_service.list_tools.js | 0 .../v1beta/agent_service.list_toolsets.js | 0 .../agent_service.restore_app_version.js | 0 .../v1beta/agent_service.update_agent.js | 0 .../v1beta/agent_service.update_app.js | 0 .../v1beta/agent_service.update_deployment.js | 0 .../v1beta/agent_service.update_example.js | 0 .../v1beta/agent_service.update_guardrail.js | 0 .../v1beta/agent_service.update_tool.js | 0 .../v1beta/agent_service.update_toolset.js | 0 .../evaluation_service.create_evaluation.js | 0 ...ation_service.create_evaluation_dataset.js | 0 ...n_service.create_evaluation_expectation.js | 0 ...service.create_scheduled_evaluation_run.js | 0 .../evaluation_service.delete_evaluation.js | 0 ...ation_service.delete_evaluation_dataset.js | 0 ...n_service.delete_evaluation_expectation.js | 0 ...uation_service.delete_evaluation_result.js | 0 ...valuation_service.delete_evaluation_run.js | 0 ...service.delete_scheduled_evaluation_run.js | 0 .../evaluation_service.generate_evaluation.js | 0 .../evaluation_service.get_evaluation.js | 0 ...aluation_service.get_evaluation_dataset.js | 0 ...tion_service.get_evaluation_expectation.js | 0 ...valuation_service.get_evaluation_result.js | 0 .../evaluation_service.get_evaluation_run.js | 0 ...on_service.get_scheduled_evaluation_run.js | 0 .../evaluation_service.import_evaluations.js | 0 ...uation_service.list_evaluation_datasets.js | 0 ...on_service.list_evaluation_expectations.js | 0 ...luation_service.list_evaluation_results.js | 0 ...evaluation_service.list_evaluation_runs.js | 0 .../evaluation_service.list_evaluations.js | 0 ..._service.list_scheduled_evaluation_runs.js | 0 .../evaluation_service.run_evaluation.js | 0 .../evaluation_service.test_persona_voice.js | 0 .../evaluation_service.update_evaluation.js | 0 ...ation_service.update_evaluation_dataset.js | 0 ...n_service.update_evaluation_expectation.js | 0 ...service.update_scheduled_evaluation_run.js | 0 ...luation_service.upload_evaluation_audio.js | 0 .../session_service.bidi_run_session.js | 0 .../v1beta/session_service.run_session.js | 0 ...ppet_metadata_google.cloud.ces.v1beta.json | 0 .../v1beta/tool_service.execute_tool.js | 0 .../tool_service.retrieve_tool_schema.js | 0 .../v1beta/tool_service.retrieve_tools.js | 0 .../widget_service.generate_chat_token.js | 0 packages/google-cloud-ces/src/index.ts | 5 +- .../src/v1beta/agent_service_client.ts | 0 .../v1beta/agent_service_client_config.json | 0 .../src/v1beta/agent_service_proto_list.json | 0 .../src/v1beta/evaluation_service_client.ts | 0 .../evaluation_service_client_config.json | 0 .../v1beta/evaluation_service_proto_list.json | 0 .../src/v1beta/gapic_metadata.json | 0 .../google-cloud-ces/src/v1beta/index.ts | 0 .../src/v1beta/session_service_client.ts | 0 .../v1beta/session_service_client_config.json | 0 .../v1beta/session_service_proto_list.json | 0 .../src/v1beta/tool_service_client.ts | 0 .../v1beta/tool_service_client_config.json | 0 .../src/v1beta/tool_service_proto_list.json | 0 .../src/v1beta/widget_service_client.ts | 0 .../v1beta/widget_service_client_config.json | 0 .../src/v1beta/widget_service_proto_list.json | 0 .../test/gapic_agent_service_v1beta.ts | 0 .../test/gapic_evaluation_service_v1beta.ts | 0 .../test/gapic_session_service_v1beta.ts | 0 .../test/gapic_tool_service_v1beta.ts | 0 .../test/gapic_widget_service_v1beta.ts | 0 288 files changed, 149912 insertions(+), 319428 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-ces/.OwlBot.yaml delete mode 100644 owl-bot-staging/google-cloud-ces/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-ces/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-ces/.gitattributes delete mode 100644 owl-bot-staging/google-cloud-ces/.gitignore delete mode 100644 owl-bot-staging/google-cloud-ces/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-ces/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-ces/.nycrc delete mode 100644 owl-bot-staging/google-cloud-ces/.prettierignore delete mode 100644 owl-bot-staging/google-cloud-ces/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-ces/CODE_OF_CONDUCT.md delete mode 100644 owl-bot-staging/google-cloud-ces/CONTRIBUTING.md delete mode 100644 owl-bot-staging/google-cloud-ces/LICENSE delete mode 100644 owl-bot-staging/google-cloud-ces/README.md delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent_service.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent_transfers.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/app.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/app_version.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/auth.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/bigquery_export.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/changelog.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/client_function.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/common.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/connector_tool.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/connector_toolset.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/conversation.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/data_store.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/data_store_tool.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/deployment.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/example.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/fakes.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/file_search_tool.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/google_search_tool.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/guardrail.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/mcp_tool.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/mcp_toolset.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/omnichannel.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/omnichannel_service.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/open_api_tool.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/open_api_toolset.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/python_function.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/schema.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/search_suggestions.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/session_service.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/system_tool.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/tool.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/tool_service.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/toolset.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/toolset_tool.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/widget_service.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/widget_tool.proto delete mode 100644 owl-bot-staging/google-cloud-ces/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-ces/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-ces/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.batch_delete_conversations.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_agent.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_app.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_app_version.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_deployment.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_example.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_guardrail.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_tool.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_toolset.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_agent.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_app.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_app_version.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_conversation.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_deployment.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_example.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_guardrail.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_tool.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_toolset.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.export_app.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_agent.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_app.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_app_version.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_changelog.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_conversation.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_deployment.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_example.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_guardrail.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_tool.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_toolset.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.import_app.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_agents.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_app_versions.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_apps.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_changelogs.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_conversations.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_deployments.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_examples.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_guardrails.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_tools.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_toolsets.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.restore_app_version.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_agent.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_app.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_deployment.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_example.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_guardrail.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_tool.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_toolset.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/session_service.bidi_run_session.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/session_service.run_session.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/snippet_metadata_google.cloud.ces.v1.json delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.execute_tool.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tool_schema.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tools.js delete mode 100644 owl-bot-staging/google-cloud-ces/samples/generated/v1/widget_service.generate_chat_token.js delete mode 100644 owl-bot-staging/google-cloud-ces/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-ces/src/v1/agent_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-ces/src/v1/agent_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-ces/src/v1/agent_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-ces/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-ces/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-ces/src/v1/session_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-ces/src/v1/session_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-ces/src/v1/session_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-ces/src/v1/tool_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-ces/src/v1/tool_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-ces/src/v1/tool_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-ces/src/v1/widget_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-ces/src/v1/widget_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-ces/src/v1/widget_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-ces/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-ces/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-ces/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-ces/test/gapic_agent_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-ces/test/gapic_session_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-ces/test/gapic_tool_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-ces/test/gapic_widget_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-ces/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-ces/webpack.config.js rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/agent.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_service.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_transfers.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/app.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/app_version.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/auth.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/bigquery_export.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/changelog.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/client_function.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/common.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/connector_tool.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/connector_toolset.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/conversation.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/data_store.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/data_store_tool.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/deployment.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/evaluation.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/evaluation_service.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/example.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/fakes.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/file_search_tool.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/golden_run.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/google_search_tool.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/guardrail.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/mcp_tool.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/mcp_toolset.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/omnichannel.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/omnichannel_service.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/open_api_tool.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/open_api_toolset.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/python_function.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/schema.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/search_suggestions.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/session_service.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/system_tool.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/tool.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/tool_service.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/toolset.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/toolset_tool.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/widget_service.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/protos/google/cloud/ces/v1beta/widget_tool.proto (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.batch_delete_conversations.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.create_agent.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.create_app.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.create_app_version.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.create_deployment.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.create_example.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.create_guardrail.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.create_tool.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.create_toolset.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.delete_agent.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app_version.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.delete_conversation.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.delete_deployment.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.delete_example.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.delete_guardrail.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.delete_tool.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.delete_toolset.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.export_app.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.get_agent.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.get_app.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.get_app_version.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.get_changelog.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.get_conversation.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.get_deployment.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.get_example.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.get_guardrail.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.get_tool.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.get_toolset.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.import_app.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.list_agents.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.list_app_versions.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.list_apps.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.list_changelogs.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.list_conversations.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.list_deployments.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.list_examples.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.list_guardrails.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.list_tools.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.list_toolsets.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.restore_app_version.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.update_agent.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.update_app.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.update_deployment.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.update_example.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.update_guardrail.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.update_tool.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/agent_service.update_toolset.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_dataset.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_expectation.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_scheduled_evaluation_run.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_dataset.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_expectation.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_result.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_run.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_scheduled_evaluation_run.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.generate_evaluation.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_dataset.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_expectation.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_result.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_run.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_scheduled_evaluation_run.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.import_evaluations.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_datasets.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_expectations.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_results.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_runs.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluations.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_scheduled_evaluation_runs.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.run_evaluation.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.test_persona_voice.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_dataset.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_expectation.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_scheduled_evaluation_run.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/evaluation_service.upload_evaluation_audio.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/session_service.bidi_run_session.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/session_service.run_session.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/snippet_metadata_google.cloud.ces.v1beta.json (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/tool_service.execute_tool.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tool_schema.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tools.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/samples/generated/v1beta/widget_service.generate_chat_token.js (100%) rename {owl-bot-staging => packages}/google-cloud-ces/src/v1beta/agent_service_client.ts (100%) rename {owl-bot-staging => packages}/google-cloud-ces/src/v1beta/agent_service_client_config.json (100%) rename {owl-bot-staging => packages}/google-cloud-ces/src/v1beta/agent_service_proto_list.json (100%) rename {owl-bot-staging => packages}/google-cloud-ces/src/v1beta/evaluation_service_client.ts (100%) rename {owl-bot-staging => packages}/google-cloud-ces/src/v1beta/evaluation_service_client_config.json (100%) rename {owl-bot-staging => packages}/google-cloud-ces/src/v1beta/evaluation_service_proto_list.json (100%) rename {owl-bot-staging => packages}/google-cloud-ces/src/v1beta/gapic_metadata.json (100%) rename {owl-bot-staging => packages}/google-cloud-ces/src/v1beta/index.ts (100%) rename {owl-bot-staging => packages}/google-cloud-ces/src/v1beta/session_service_client.ts (100%) rename {owl-bot-staging => packages}/google-cloud-ces/src/v1beta/session_service_client_config.json (100%) rename {owl-bot-staging => packages}/google-cloud-ces/src/v1beta/session_service_proto_list.json (100%) rename {owl-bot-staging => packages}/google-cloud-ces/src/v1beta/tool_service_client.ts (100%) rename {owl-bot-staging => packages}/google-cloud-ces/src/v1beta/tool_service_client_config.json (100%) rename {owl-bot-staging => packages}/google-cloud-ces/src/v1beta/tool_service_proto_list.json (100%) rename {owl-bot-staging => packages}/google-cloud-ces/src/v1beta/widget_service_client.ts (100%) rename {owl-bot-staging => packages}/google-cloud-ces/src/v1beta/widget_service_client_config.json (100%) rename {owl-bot-staging => packages}/google-cloud-ces/src/v1beta/widget_service_proto_list.json (100%) rename {owl-bot-staging => packages}/google-cloud-ces/test/gapic_agent_service_v1beta.ts (100%) rename {owl-bot-staging => packages}/google-cloud-ces/test/gapic_evaluation_service_v1beta.ts (100%) rename {owl-bot-staging => packages}/google-cloud-ces/test/gapic_session_service_v1beta.ts (100%) rename {owl-bot-staging => packages}/google-cloud-ces/test/gapic_tool_service_v1beta.ts (100%) rename {owl-bot-staging => packages}/google-cloud-ces/test/gapic_widget_service_v1beta.ts (100%) diff --git a/owl-bot-staging/google-cloud-ces/.OwlBot.yaml b/owl-bot-staging/google-cloud-ces/.OwlBot.yaml deleted file mode 100644 index f556cf1b8e2..00000000000 --- a/owl-bot-staging/google-cloud-ces/.OwlBot.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -deep-copy-regex: - - source: /google/cloud/ces/google-cloud-ces-nodejs - dest: /owl-bot-staging/google-cloud-ces - -api-name: ces \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/.eslintignore b/owl-bot-staging/google-cloud-ces/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-ces/.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-ces/.eslintrc.json b/owl-bot-staging/google-cloud-ces/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-ces/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-ces/.gitattributes b/owl-bot-staging/google-cloud-ces/.gitattributes deleted file mode 100644 index 33739cb74e4..00000000000 --- a/owl-bot-staging/google-cloud-ces/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -*.ts text eol=lf -*.js text eol=lf -protos/* linguist-generated -**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/google-cloud-ces/.gitignore b/owl-bot-staging/google-cloud-ces/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-ces/.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-ces/.jsdoc.js b/owl-bot-staging/google-cloud-ces/.jsdoc.js deleted file mode 100644 index d3f4c9562f6..00000000000 --- a/owl-bot-staging/google-cloud-ces/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2026 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/ces', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-ces/.mocharc.js b/owl-bot-staging/google-cloud-ces/.mocharc.js deleted file mode 100644 index 5eb34e86c87..00000000000 --- a/owl-bot-staging/google-cloud-ces/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-cloud-ces/.nycrc b/owl-bot-staging/google-cloud-ces/.nycrc deleted file mode 100644 index 81a95fc94b0..00000000000 --- a/owl-bot-staging/google-cloud-ces/.nycrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "report-dir": "./.coverage", - "reporter": ["text", "lcov"], - "exclude": [ - "**/*-test", - "**/.coverage", - "**/apis", - "**/benchmark", - "**/conformance", - "**/docs", - "**/samples", - "**/scripts", - "**/protos", - "**/test", - "**/*.d.ts", - ".jsdoc.js", - "**/.jsdoc.js", - "karma.conf.js", - "webpack-tests.config.js", - "webpack.config.js" - ], - "exclude-after-remap": false, - "all": true -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/.prettierignore b/owl-bot-staging/google-cloud-ces/.prettierignore deleted file mode 100644 index 9340ad9b86d..00000000000 --- a/owl-bot-staging/google-cloud-ces/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/coverage -test/fixtures -build/ -docs/ -protos/ diff --git a/owl-bot-staging/google-cloud-ces/.prettierrc.js b/owl-bot-staging/google-cloud-ces/.prettierrc.js deleted file mode 100644 index 7649ee3c254..00000000000 --- a/owl-bot-staging/google-cloud-ces/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-cloud-ces/CODE_OF_CONDUCT.md b/owl-bot-staging/google-cloud-ces/CODE_OF_CONDUCT.md deleted file mode 100644 index 2add2547a81..00000000000 --- a/owl-bot-staging/google-cloud-ces/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of -experience, education, socio-economic status, nationality, personal appearance, -race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, or to ban temporarily or permanently any -contributor for other behaviors that they deem inappropriate, threatening, -offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -This Code of Conduct also applies outside the project spaces when the Project -Steward has a reasonable belief that an individual's behavior may have a -negative impact on the project or its community. - -## Conflict Resolution - -We do not believe that all conflict is bad; healthy debate and disagreement -often yield positive results. However, it is never okay to be disrespectful or -to engage in behavior that violates the project’s code of conduct. - -If you see someone violating the code of conduct, you are encouraged to address -the behavior directly with those involved. Many issues can be resolved quickly -and easily, and this gives people more control over the outcome of their -dispute. If you are unable to resolve the matter for any reason, or if the -behavior is threatening or harassing, report it. We are dedicated to providing -an environment where participants feel welcome and safe. - -Reports should be directed to *googleapis-stewards@google.com*, the -Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to -receive and address reported violations of the code of conduct. They will then -work with a committee consisting of representatives from the Open Source -Programs Office and the Google Open Source Strategy team. If for any reason you -are uncomfortable reaching out to the Project Steward, please email -opensource@google.com. - -We will investigate every complaint, but you may not receive a direct response. -We will use our discretion in determining when and how to follow up on reported -incidents, which may range from not taking action to permanent expulsion from -the project and project-sponsored spaces. We will notify the accused of the -report and provide them an opportunity to discuss it before any action is taken. -The identity of the reporter will be omitted from the details of the report -supplied to the accused. In potentially harmful situations, such as ongoing -harassment or threats to anyone's safety, we may take action without notice. - -## Attribution - -This Code of Conduct is adapted from the Contributor Covenant, version 1.4, -available at -https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/CONTRIBUTING.md b/owl-bot-staging/google-cloud-ces/CONTRIBUTING.md deleted file mode 100644 index ab779cdc399..00000000000 --- a/owl-bot-staging/google-cloud-ces/CONTRIBUTING.md +++ /dev/null @@ -1,76 +0,0 @@ -# How to become a contributor and submit your own code - -**Table of contents** - -* [Contributor License Agreements](#contributor-license-agreements) -* [Contributing a patch](#contributing-a-patch) -* [Running the tests](#running-the-tests) -* [Releasing the library](#releasing-the-library) - -## Contributor License Agreements - -We'd love to accept your sample apps and patches! Before we can take them, we -have to jump a couple of legal hurdles. - -Please fill out either the individual or corporate Contributor License Agreement -(CLA). - - * If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). - * If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). - -Follow either of the two links above to access the appropriate CLA and -instructions for how to sign and return it. Once we receive it, we'll be able to -accept your pull requests. - -## Contributing A Patch - -1. Submit an issue describing your proposed change to the repo in question. -1. The repo owner will respond to your issue promptly. -1. If your proposed change is accepted, and you haven't already done so, sign a - Contributor License Agreement (see details above). -1. Fork the desired repo, develop and test your code changes. -1. Ensure that your code adheres to the existing style in the code to which - you are contributing. -1. Ensure that your code has an appropriate set of tests which all pass. -1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. -1. Submit a pull request. - -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Ces API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the - API from your local workstation. - - -## Running the tests - -1. [Prepare your environment for Node.js setup][setup]. - -1. Install dependencies: - - npm install - -1. Run the tests: - - # Run unit tests. - npm test - - # Run sample integration tests. - npm run samples-test - - # Run all system tests. - npm run system-test - -1. Lint (and maybe fix) any changes: - - npm run fix - -[setup]: https://cloud.google.com/nodejs/docs/setup -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=ces.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/LICENSE b/owl-bot-staging/google-cloud-ces/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/owl-bot-staging/google-cloud-ces/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-ces/README.md b/owl-bot-staging/google-cloud-ces/README.md deleted file mode 100644 index 42995b8cdeb..00000000000 --- a/owl-bot-staging/google-cloud-ces/README.md +++ /dev/null @@ -1,253 +0,0 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "The comments you see below are used to generate those parts of the template in later states." -Google Cloud Platform logo - -# [Gemini Enterprise for Customer Experience API: Nodejs Client][homepage] - -This library is considered to be in **preview**. This means it is still a -work-in-progress and under active development. Any release is subject to -backwards-incompatible changes at any time. - -[![npm version](https://img.shields.io/npm/v/@google-cloud/ces.svg)](https://www.npmjs.org/package/@google-cloud/ces) - -Gemini Enterprise for Customer Experience API client for Node.js - -[//]: # "partials.introduction" - -A comprehensive list of changes in each version may be found in -[the CHANGELOG][homepage_changelog]. - -* [Gemini Enterprise for Customer Experience API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/ces/latest) -* [Gemini Enterprise for Customer Experience API Documentation](https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps) - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - -**Table of contents:** - -* [Quickstart](#quickstart) - * [Before you begin](#before-you-begin) - * [Installing the client library](#installing-the-client-library) - -* [Versioning](#versioning) -* [Contributing](#contributing) -* [License](#license) - -## Quickstart -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Gemini Enterprise for Customer Experience API API][enable_api]. -1. [Set up authentication][auth] so you can access the - API from your local workstation. -### Installing the client library - -```bash -npm install @google-cloud/ces -``` - -[//]: # "partials.body" - -## Samples - -Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. - -| Sample | Source Code | -| --------------------------- | --------------------------------- | -| batch delete conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.batch_delete_conversations.js) | -| create agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.create_agent.js) | -| create app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.create_app.js) | -| create app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.create_app_version.js) | -| create deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.create_deployment.js) | -| create example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.create_example.js) | -| create guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.create_guardrail.js) | -| create tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.create_tool.js) | -| create toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.create_toolset.js) | -| delete agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.delete_agent.js) | -| delete app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.delete_app.js) | -| delete app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.delete_app_version.js) | -| delete conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.delete_conversation.js) | -| delete deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.delete_deployment.js) | -| delete example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.delete_example.js) | -| delete guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.delete_guardrail.js) | -| delete tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.delete_tool.js) | -| delete toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.delete_toolset.js) | -| export app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.export_app.js) | -| get agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_agent.js) | -| get app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_app.js) | -| get app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_app_version.js) | -| get changelog | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_changelog.js) | -| get conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_conversation.js) | -| get deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_deployment.js) | -| get example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_example.js) | -| get guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_guardrail.js) | -| get tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_tool.js) | -| get toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.get_toolset.js) | -| import app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.import_app.js) | -| list agents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_agents.js) | -| list app versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_app_versions.js) | -| list apps | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_apps.js) | -| list changelogs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_changelogs.js) | -| list conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_conversations.js) | -| list deployments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_deployments.js) | -| list examples | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_examples.js) | -| list guardrails | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_guardrails.js) | -| list tools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_tools.js) | -| list toolsets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.list_toolsets.js) | -| restore app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.restore_app_version.js) | -| update agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.update_agent.js) | -| update app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.update_app.js) | -| update deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.update_deployment.js) | -| update example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.update_example.js) | -| update guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.update_guardrail.js) | -| update tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.update_tool.js) | -| update toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/agent_service.update_toolset.js) | -| bidi run session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/session_service.bidi_run_session.js) | -| run session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/session_service.run_session.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/snippet_metadata_google.cloud.ces.v1.json) | -| execute tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/tool_service.execute_tool.js) | -| retrieve tool schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tool_schema.js) | -| retrieve tools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tools.js) | -| generate chat token | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/widget_service.generate_chat_token.js) | -| batch delete conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.batch_delete_conversations.js) | -| create agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_agent.js) | -| create app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_app.js) | -| create app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_app_version.js) | -| create deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_deployment.js) | -| create example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_example.js) | -| create guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_guardrail.js) | -| create tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_tool.js) | -| create toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_toolset.js) | -| delete agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_agent.js) | -| delete app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app.js) | -| delete app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app_version.js) | -| delete conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_conversation.js) | -| delete deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_deployment.js) | -| delete example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_example.js) | -| delete guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_guardrail.js) | -| delete tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_tool.js) | -| delete toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_toolset.js) | -| export app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.export_app.js) | -| get agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_agent.js) | -| get app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_app.js) | -| get app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_app_version.js) | -| get changelog | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_changelog.js) | -| get conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_conversation.js) | -| get deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_deployment.js) | -| get example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_example.js) | -| get guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_guardrail.js) | -| get tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_tool.js) | -| get toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_toolset.js) | -| import app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.import_app.js) | -| list agents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_agents.js) | -| list app versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_app_versions.js) | -| list apps | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_apps.js) | -| list changelogs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_changelogs.js) | -| list conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_conversations.js) | -| list deployments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_deployments.js) | -| list examples | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_examples.js) | -| list guardrails | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_guardrails.js) | -| list tools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_tools.js) | -| list toolsets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_toolsets.js) | -| restore app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.restore_app_version.js) | -| update agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_agent.js) | -| update app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_app.js) | -| update deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_deployment.js) | -| update example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_example.js) | -| update guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_guardrail.js) | -| update tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_tool.js) | -| update toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_toolset.js) | -| create evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation.js) | -| create evaluation dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_dataset.js) | -| create evaluation expectation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_expectation.js) | -| create scheduled evaluation run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_scheduled_evaluation_run.js) | -| delete evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation.js) | -| delete evaluation dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_dataset.js) | -| delete evaluation expectation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_expectation.js) | -| delete evaluation result | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_result.js) | -| delete evaluation run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_run.js) | -| delete scheduled evaluation run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_scheduled_evaluation_run.js) | -| generate evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.generate_evaluation.js) | -| get evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation.js) | -| get evaluation dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_dataset.js) | -| get evaluation expectation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_expectation.js) | -| get evaluation result | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_result.js) | -| get evaluation run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_run.js) | -| get scheduled evaluation run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_scheduled_evaluation_run.js) | -| import evaluations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.import_evaluations.js) | -| list evaluation datasets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_datasets.js) | -| list evaluation expectations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_expectations.js) | -| list evaluation results | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_results.js) | -| list evaluation runs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_runs.js) | -| list evaluations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluations.js) | -| list scheduled evaluation runs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_scheduled_evaluation_runs.js) | -| run evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.run_evaluation.js) | -| test persona voice | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.test_persona_voice.js) | -| update evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation.js) | -| update evaluation dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_dataset.js) | -| update evaluation expectation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_expectation.js) | -| update scheduled evaluation run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_scheduled_evaluation_run.js) | -| upload evaluation audio | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.upload_evaluation_audio.js) | -| bidi run session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/session_service.bidi_run_session.js) | -| run session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/session_service.run_session.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/snippet_metadata_google.cloud.ces.v1beta.json) | -| execute tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/tool_service.execute_tool.js) | -| retrieve tool schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tool_schema.js) | -| retrieve tools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tools.js) | -| generate chat token | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/widget_service.generate_chat_token.js) | - - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). -Libraries are compatible with all current _active_ and _maintenance_ versions of -Node.js. -If you are using an end-of-life version of Node.js, we recommend that you update -as soon as possible to an actively supported LTS version. - -Google's client libraries support legacy versions of Node.js runtimes on a -best-efforts basis with the following warnings: - -* Legacy versions are not tested in continuous integration. -* Some security patches and features cannot be backported. -* Dependencies cannot be kept up-to-date. - -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. -For example, `npm install @google-cloud/ces@legacy-8` installs client libraries -for versions compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - -More Information: [Google Cloud Platform Launch Stages][launch_stages] - -[launch_stages]: https://cloud.google.com/terms/launch-stages - -## Contributing - -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/CONTRIBUTING.md). - -Please note that this `README.md` -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/LICENSE) - -[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=ces.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local -[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples -[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/CHANGELOG.md -[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent.proto deleted file mode 100644 index ffe04a307fc..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent.proto +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/ces/v1/agent_transfers.proto"; -import "google/cloud/ces/v1/common.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "AgentProto"; -option java_package = "com.google.cloud.ces.v1"; -option (google.api.resource_definition) = { - type: "dialogflow.googleapis.com/DialogflowAgent" - pattern: "projects/{project}/locations/{location}/agents/{agent}" -}; - -// An agent acts as the fundamental building block that provides instructions to -// the Large Language Model (LLM) for executing specific tasks. -message Agent { - option (google.api.resource) = { - type: "ces.googleapis.com/Agent" - pattern: "projects/{project}/locations/{location}/apps/{app}/agents/{agent}" - plural: "agents" - singular: "agent" - }; - - // Default agent type. The agent uses instructions and callbacks specified in - // the agent to perform the task using a large language model. - message LlmAgent {} - - // The agent which will transfer execution to a remote - // [Dialogflow - // CX](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) agent. - // The Dialogflow agent will process subsequent user queries until the session - // ends or flow ends, and the control is transferred back to the parent CES - // agent. - message RemoteDialogflowAgent { - // Required. The - // [Dialogflow](https://docs.cloud.google.com/dialogflow/cx/docs/concept/agent) - // agent resource name. - // Format: `projects/{project}/locations/{location}/agents/{agent}` - string agent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dialogflow.googleapis.com/DialogflowAgent" - } - ]; - - // Optional. The flow ID of the flow in the Dialogflow agent. - string flow_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The environment ID of the Dialogflow agent to be used for the - // agent execution. If not specified, the draft environment will be used. - string environment_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The mapping of the app variables names to the Dialogflow - // session parameters names to be sent to the Dialogflow agent as input. - map input_variable_mapping = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The mapping of the Dialogflow session parameters names to the - // app variables names to be sent back to the CES agent after the Dialogflow - // agent execution ends. - map output_variable_mapping = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicates whether to respect the message-level interruption - // settings configured in the Dialogflow agent. - // - // * If false: all response messages from the Dialogflow agent follow the - // app-level barge-in settings. - // * If true: only response messages with - // [`allow_playback_interruption`](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#text) - // set to true will be interruptable, all other messages follow the - // app-level barge-in settings. - bool respect_response_interruption_settings = 6 - [(google.api.field_behavior) = OPTIONAL]; - } - - // A toolset with a selection of its tools. - message AgentToolset { - // Required. The resource name of the toolset. - // Format: - // `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` - string toolset = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Toolset" } - ]; - - // Optional. The tools IDs to filter the toolset. - repeated string tool_ids = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // The type of agent. - oneof agent_type { - // Optional. The default agent type. - LlmAgent llm_agent = 26 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The remote - // [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) - // agent to be used for the agent execution. If this field is set, all other - // agent level properties will be ignored. - // - // Note: If the Dialogflow agent is in a different project from the app, you - // should grant `roles/dialogflow.client` to the CES service agent - // `service-@gcp-sa-ces.iam.gserviceaccount.com`. - RemoteDialogflowAgent remote_dialogflow_agent = 27 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Identifier. The unique identifier of the agent. - // Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. Display name of the agent. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Human-readable description of the agent. - string description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Configurations for the LLM model. - ModelSettings model_settings = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Instructions for the LLM model to guide the agent's behavior. - string instruction = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of available tools for the agent. - // Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` - repeated string tools = 7 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } - ]; - - // Optional. List of child agents in the agent tree. - // Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` - repeated string child_agents = 8 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } - ]; - - // Optional. The callbacks to execute before the agent is called. - // The provided callbacks are executed sequentially in the exact order they - // are given in the list. If a callback returns an overridden response, - // execution stops and any remaining callbacks are skipped. - repeated Callback before_agent_callbacks = 18 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The callbacks to execute after the agent is called. - // The provided callbacks are executed sequentially in the exact order they - // are given in the list. If a callback returns an overridden response, - // execution stops and any remaining callbacks are skipped. - repeated Callback after_agent_callbacks = 19 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The callbacks to execute before the model is called. If there are - // multiple calls to the model, the callback will be executed multiple times. - // The provided callbacks are executed sequentially in the exact order they - // are given in the list. If a callback returns an overridden response, - // execution stops and any remaining callbacks are skipped. - repeated Callback before_model_callbacks = 20 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The callbacks to execute after the model is called. If there are - // multiple calls to the model, the callback will be executed multiple times. - // The provided callbacks are executed sequentially in the exact order they - // are given in the list. If a callback returns an overridden response, - // execution stops and any remaining callbacks are skipped. - repeated Callback after_model_callbacks = 21 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The callbacks to execute before the tool is invoked. If there are - // multiple tool invocations, the callback will be executed multiple times. - // The provided callbacks are executed sequentially in the exact order they - // are given in the list. If a callback returns an overridden response, - // execution stops and any remaining callbacks are skipped. - repeated Callback before_tool_callbacks = 22 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The callbacks to execute after the tool is invoked. If there are - // multiple tool invocations, the callback will be executed multiple times. - // The provided callbacks are executed sequentially in the exact order they - // are given in the list. If a callback returns an overridden response, - // execution stops and any remaining callbacks are skipped. - repeated Callback after_tool_callbacks = 23 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Timestamp when the agent was created. - google.protobuf.Timestamp create_time = 15 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when the agent was last updated. - google.protobuf.Timestamp update_time = 16 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. List of guardrails for the agent. - // Format: - // `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}` - repeated string guardrails = 17 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { type: "ces.googleapis.com/Guardrail" } - ]; - - // Etag used to ensure the object hasn't changed during a read-modify-write - // operation. If the etag is empty, the update will overwrite any concurrent - // changes. - string etag = 24; - - // Optional. List of toolsets for the agent. - repeated AgentToolset toolsets = 28 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. If the agent is generated by the LLM assistant, this field - // contains a descriptive summary of the generation. - string generated_summary = 29 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Agent transfer rules. - // If multiple rules match, the first one in the list will be used. - repeated TransferRule transfer_rules = 30 - [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent_service.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent_service.proto deleted file mode 100644 index 71912ad2380..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent_service.proto +++ /dev/null @@ -1,1695 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/ces/v1/agent.proto"; -import "google/cloud/ces/v1/app.proto"; -import "google/cloud/ces/v1/app_version.proto"; -import "google/cloud/ces/v1/changelog.proto"; -import "google/cloud/ces/v1/conversation.proto"; -import "google/cloud/ces/v1/deployment.proto"; -import "google/cloud/ces/v1/example.proto"; -import "google/cloud/ces/v1/guardrail.proto"; -import "google/cloud/ces/v1/tool.proto"; -import "google/cloud/ces/v1/toolset.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "AgentServiceProto"; -option java_package = "com.google.cloud.ces.v1"; -option (google.api.resource_definition) = { - type: "contactcenterinsights.googleapis.com/Dataset" - pattern: "projects/{project}/locations/{location}/datasets/{dataset}" -}; - -// The service that manages agent-related resources in Gemini Enterprise for -// Customer Engagement (CES). -service AgentService { - option (google.api.default_host) = "ces.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/ces," - "https://www.googleapis.com/auth/cloud-platform"; - - // Lists apps in the given project and location. - rpc ListApps(ListAppsRequest) returns (ListAppsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/apps" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of the specified app. - rpc GetApp(GetAppRequest) returns (App) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apps/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new app in the given project and location. - rpc CreateApp(CreateAppRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/apps" - body: "app" - }; - option (google.api.method_signature) = "parent,app,app_id"; - option (google.api.method_signature) = "parent,app"; - option (google.longrunning.operation_info) = { - response_type: "App" - metadata_type: "OperationMetadata" - }; - } - - // Updates the specified app. - rpc UpdateApp(UpdateAppRequest) returns (App) { - option (google.api.http) = { - patch: "/v1/{app.name=projects/*/locations/*/apps/*}" - body: "app" - }; - option (google.api.method_signature) = "app,update_mask"; - } - - // Deletes the specified app. - rpc DeleteApp(DeleteAppRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/apps/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Exports the specified app. - rpc ExportApp(ExportAppRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/apps/*}:exportApp" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "ExportAppResponse" - metadata_type: "OperationMetadata" - }; - } - - // Imports the specified app. - rpc ImportApp(ImportAppRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/apps:importApp" - body: "*" - }; - option (google.api.method_signature) = "parent,display_name,app_id"; - option (google.longrunning.operation_info) = { - response_type: "ImportAppResponse" - metadata_type: "OperationMetadata" - }; - } - - // Lists agents in the given app. - rpc ListAgents(ListAgentsRequest) returns (ListAgentsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/apps/*}/agents" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of the specified agent. - rpc GetAgent(GetAgentRequest) returns (Agent) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apps/*/agents/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new agent in the given app. - rpc CreateAgent(CreateAgentRequest) returns (Agent) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/apps/*}/agents" - body: "agent" - }; - option (google.api.method_signature) = "parent,agent,agent_id"; - option (google.api.method_signature) = "parent,agent"; - } - - // Updates the specified agent. - rpc UpdateAgent(UpdateAgentRequest) returns (Agent) { - option (google.api.http) = { - patch: "/v1/{agent.name=projects/*/locations/*/apps/*/agents/*}" - body: "agent" - }; - option (google.api.method_signature) = "agent,update_mask"; - } - - // Deletes the specified agent. - rpc DeleteAgent(DeleteAgentRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/apps/*/agents/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists examples in the given app. - rpc ListExamples(ListExamplesRequest) returns (ListExamplesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/apps/*}/examples" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of the specified example. - rpc GetExample(GetExampleRequest) returns (Example) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apps/*/examples/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new example in the given app. - rpc CreateExample(CreateExampleRequest) returns (Example) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/apps/*}/examples" - body: "example" - }; - option (google.api.method_signature) = "parent,example,example_id"; - option (google.api.method_signature) = "parent,example"; - } - - // Updates the specified example. - rpc UpdateExample(UpdateExampleRequest) returns (Example) { - option (google.api.http) = { - patch: "/v1/{example.name=projects/*/locations/*/apps/*/examples/*}" - body: "example" - }; - option (google.api.method_signature) = "example,update_mask"; - } - - // Deletes the specified example. - rpc DeleteExample(DeleteExampleRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/apps/*/examples/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists tools in the given app. - rpc ListTools(ListToolsRequest) returns (ListToolsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/apps/*}/tools" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of the specified tool. - rpc GetTool(GetToolRequest) returns (Tool) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apps/*/tools/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists conversations in the given app. - rpc ListConversations(ListConversationsRequest) - returns (ListConversationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/apps/*}/conversations" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of the specified conversation. - rpc GetConversation(GetConversationRequest) returns (Conversation) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apps/*/conversations/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Deletes the specified conversation. - rpc DeleteConversation(DeleteConversationRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/apps/*/conversations/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Batch deletes the specified conversations. - rpc BatchDeleteConversations(BatchDeleteConversationsRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/apps/*}/conversations:batchDelete" - body: "*" - }; - option (google.api.method_signature) = "parent"; - option (google.longrunning.operation_info) = { - response_type: "BatchDeleteConversationsResponse" - metadata_type: "OperationMetadata" - }; - } - - // Creates a new tool in the given app. - rpc CreateTool(CreateToolRequest) returns (Tool) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/apps/*}/tools" - body: "tool" - }; - option (google.api.method_signature) = "parent,tool,tool_id"; - option (google.api.method_signature) = "parent,tool"; - } - - // Updates the specified tool. - rpc UpdateTool(UpdateToolRequest) returns (Tool) { - option (google.api.http) = { - patch: "/v1/{tool.name=projects/*/locations/*/apps/*/tools/*}" - body: "tool" - }; - option (google.api.method_signature) = "tool,update_mask"; - } - - // Deletes the specified tool. - rpc DeleteTool(DeleteToolRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/apps/*/tools/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists guardrails in the given app. - rpc ListGuardrails(ListGuardrailsRequest) returns (ListGuardrailsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/apps/*}/guardrails" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of the specified guardrail. - rpc GetGuardrail(GetGuardrailRequest) returns (Guardrail) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apps/*/guardrails/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new guardrail in the given app. - rpc CreateGuardrail(CreateGuardrailRequest) returns (Guardrail) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/apps/*}/guardrails" - body: "guardrail" - }; - option (google.api.method_signature) = "parent,guardrail,guardrail_id"; - option (google.api.method_signature) = "parent,guardrail"; - } - - // Updates the specified guardrail. - rpc UpdateGuardrail(UpdateGuardrailRequest) returns (Guardrail) { - option (google.api.http) = { - patch: "/v1/{guardrail.name=projects/*/locations/*/apps/*/guardrails/*}" - body: "guardrail" - }; - option (google.api.method_signature) = "guardrail,update_mask"; - } - - // Deletes the specified guardrail. - rpc DeleteGuardrail(DeleteGuardrailRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/apps/*/guardrails/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists deployments in the given app. - rpc ListDeployments(ListDeploymentsRequest) - returns (ListDeploymentsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/apps/*}/deployments" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of the specified deployment. - rpc GetDeployment(GetDeploymentRequest) returns (Deployment) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apps/*/deployments/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new deployment in the given app. - rpc CreateDeployment(CreateDeploymentRequest) returns (Deployment) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/apps/*}/deployments" - body: "deployment" - }; - option (google.api.method_signature) = "parent,deployment,deployment_id"; - option (google.api.method_signature) = "parent,deployment"; - } - - // Updates the specified deployment. - rpc UpdateDeployment(UpdateDeploymentRequest) returns (Deployment) { - option (google.api.http) = { - patch: "/v1/{deployment.name=projects/*/locations/*/apps/*/deployments/*}" - body: "deployment" - }; - option (google.api.method_signature) = "deployment,update_mask"; - } - - // Deletes the specified deployment. - rpc DeleteDeployment(DeleteDeploymentRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/apps/*/deployments/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists toolsets in the given app. - rpc ListToolsets(ListToolsetsRequest) returns (ListToolsetsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/apps/*}/toolsets" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of the specified toolset. - rpc GetToolset(GetToolsetRequest) returns (Toolset) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apps/*/toolsets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new toolset in the given app. - rpc CreateToolset(CreateToolsetRequest) returns (Toolset) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/apps/*}/toolsets" - body: "toolset" - }; - option (google.api.method_signature) = "parent,toolset,toolset_id"; - option (google.api.method_signature) = "parent,toolset"; - } - - // Updates the specified toolset. - rpc UpdateToolset(UpdateToolsetRequest) returns (Toolset) { - option (google.api.http) = { - patch: "/v1/{toolset.name=projects/*/locations/*/apps/*/toolsets/*}" - body: "toolset" - }; - option (google.api.method_signature) = "toolset,update_mask"; - } - - // Deletes the specified toolset. - rpc DeleteToolset(DeleteToolsetRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/apps/*/toolsets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists all app versions in the given app. - rpc ListAppVersions(ListAppVersionsRequest) - returns (ListAppVersionsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/apps/*}/versions" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of the specified app version. - rpc GetAppVersion(GetAppVersionRequest) returns (AppVersion) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apps/*/versions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new app version in the given app. - rpc CreateAppVersion(CreateAppVersionRequest) returns (AppVersion) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/apps/*}/versions" - body: "app_version" - }; - option (google.api.method_signature) = "parent,app_version,app_version_id"; - option (google.api.method_signature) = "parent,app_version"; - } - - // Deletes the specified app version. - rpc DeleteAppVersion(DeleteAppVersionRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/apps/*/versions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Restores the specified app version. - // This will create a new app version from the current draft app and overwrite - // the current draft with the specified app version. - rpc RestoreAppVersion(RestoreAppVersionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/apps/*/versions/*}:restore" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "RestoreAppVersionResponse" - metadata_type: "OperationMetadata" - }; - } - - // Lists the changelogs of the specified app. - rpc ListChangelogs(ListChangelogsRequest) returns (ListChangelogsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/apps/*}/changelogs" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets the specified changelog. - rpc GetChangelog(GetChangelogRequest) returns (Changelog) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apps/*/changelogs/*}" - }; - option (google.api.method_signature) = "name"; - } -} - -// Request message for -// [AgentService.ListApps][google.cloud.ces.v1.AgentService.ListApps]. -message ListAppsRequest { - // Required. The resource name of the location to list apps from. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { child_type: "ces.googleapis.com/App" } - ]; - - // 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. The - // [next_page_token][google.cloud.ces.v1.ListAppsResponse.next_page_token] - // value returned from a previous list - // [AgentService.ListApps][google.cloud.ces.v1.AgentService.ListApps] call. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filter to be applied when listing the apps. - // See https://google.aip.dev/160 for more details. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Field to sort by. Only "name" and "create_time" is supported. - // See https://google.aip.dev/132#ordering for more details. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [AgentService.ListApps][google.cloud.ces.v1.AgentService.ListApps]. -message ListAppsResponse { - // The list of apps. - repeated App apps = 1; - - // A token that can be sent as - // [ListAppsRequest.page_token][google.cloud.ces.v1.ListAppsRequest.page_token] - // to retrieve the next page. Absence of this field indicates there are no - // subsequent pages. - string next_page_token = 2; - - // Unordered list. Locations that could not be reached. - repeated string unreachable = 3 - [(google.api.field_behavior) = UNORDERED_LIST]; -} - -// Request message for -// [AgentService.GetApp][google.cloud.ces.v1.AgentService.GetApp]. -message GetAppRequest { - // Required. The resource name of the app to retrieve. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/App" } - ]; -} - -// Request message for -// [AgentService.CreateApp][google.cloud.ces.v1.AgentService.CreateApp]. -message CreateAppRequest { - // Required. The resource name of the location to create an app in. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { child_type: "ces.googleapis.com/App" } - ]; - - // Optional. The ID to use for the app, which will become the final component - // of the app's resource name. If not provided, a unique ID will be - // automatically assigned for the app. - string app_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The app to create. - App app = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [AgentService.UpdateApp][google.cloud.ces.v1.AgentService.UpdateApp]. -message UpdateAppRequest { - // Required. The app to update. - App app = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Field mask is used to control which fields get updated. If the - // mask is not present, all fields will be updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [AgentService.DeleteApp][google.cloud.ces.v1.AgentService.DeleteApp]. -message DeleteAppRequest { - // Required. The resource name of the app to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/App" } - ]; - - // Optional. The current etag of the app. If an etag is not provided, the - // deletion will overwrite any concurrent changes. If an etag is provided and - // does not match the current etag of the app, deletion will be blocked and an - // ABORTED error will be returned. - string etag = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [AgentService.ExportApp][google.cloud.ces.v1.AgentService.ExportApp]. -message ExportAppRequest { - // Export format for the app. - enum ExportFormat { - // The export format is unspecified. - EXPORT_FORMAT_UNSPECIFIED = 0; - - // The export format is JSON. - JSON = 1; - - // The export format is YAML. - YAML = 2; - } - - // Required. The resource name of the app to export. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/App" } - ]; - - // Required. The format to export the app in. - ExportFormat export_format = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The [Google Cloud - // Storage](https://cloud.google.com/storage/docs/) URI to which to export the - // app. The format of this URI must be `gs:///`. The - // exported app archive will be written directly to the specified GCS object. - string gcs_uri = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [AgentService.ExportApp][google.cloud.ces.v1.AgentService.ExportApp]. -message ExportAppResponse { - // The exported app. - oneof app { - // App folder compressed as a zip file. - bytes app_content = 1; - - // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI - // to which the app was exported. - string app_uri = 2; - } -} - -// Request message for -// [AgentService.ImportApp][google.cloud.ces.v1.AgentService.ImportApp]. -message ImportAppRequest { - // Configuration options for the app import process. - // These options control how the import behaves, particularly when - // conflicts arise with existing app data. - message ImportOptions { - // Defines the strategy for handling conflicts when an app with the same ID - // already exists, or when imported resources (like Agents, Tools, etc.) - // have the same display names as existing resources within that app. - enum ConflictResolutionStrategy { - // The conflict resolution strategy is unspecified. - CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED = 0; - - // Replace existing data with imported data. - // If an app with the same `app_id` already exists, its content will be - // updated based on the imported app. - // - Resources (App, Agents, Tools, Examples, Guardrails, Toolsets) in the - // imported app that have the same display name as existing resources - // will overwrite the existing ones. - // - Imported resources with new display names will be created. - // - Existing resources that do not have a matching display name in the - // imported app will remain untouched. - REPLACE = 1; - - // Overwrite existing data with imported data. - // If an app with the same `app_id` already exists, its content will be - // overwritten with the imported app. - // - Existing resources (Agents, Tools, Examples, Guardrails, Toolsets) in - // the app will be deleted. - // - Imported resources will be created as new resources. - OVERWRITE = 2; - } - - // Optional. The strategy to use when resolving conflicts during import. - ConflictResolutionStrategy conflict_resolution_strategy = 1 - [(google.api.field_behavior) = OPTIONAL]; - } - - // The app to import. - oneof app { - // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI - // from which to import app. The format of this URI must be - // `gs:///`. - string gcs_uri = 4; - - // Raw bytes representing the compressed zip file with the app folder - // structure. - bytes app_content = 5; - } - - // Required. The parent resource name with the location of the app to import. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { child_type: "ces.googleapis.com/App" } - ]; - - // Optional. The display name of the app to import. - // * If the app is created on import, and the display name is specified, - // the imported app will use this display name. If a conflict is detected - // with an existing app, a timestamp will be appended to the display name - // to make it unique. - // * If the app is a reimport, this field should not be set. Providing a - // display name during reimport will result in an INVALID_ARGUMENT error. - string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The ID to use for the imported app. - // * If not specified, a unique ID will be automatically assigned for - // the app. - // * Otherwise, the imported app will use this ID as the final component of - // its resource name. If an app with the same ID already exists at the - // specified location in the project, the content of the existing app will be - // replaced. - string app_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Options governing the import process for the app. - ImportOptions import_options = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Flag for overriding the app lock during import. - // If set to true, the import process will ignore the app lock. - bool ignore_app_lock = 7 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [AgentService.ImportApp][google.cloud.ces.v1.AgentService.ImportApp]. -message ImportAppResponse { - // The resource name of the app that was imported. - string name = 1 - [(google.api.resource_reference) = { type: "ces.googleapis.com/App" }]; - - // Warning messages generated during the import process. - // If errors occur for specific resources, they will not be included in the - // imported app and the error will be mentioned here. - repeated string warnings = 2; -} - -// Request message for -// [AgentService.ListAgents][google.cloud.ces.v1.AgentService.ListAgents]. -message ListAgentsRequest { - // Required. The resource name of the app to list agents from. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { child_type: "ces.googleapis.com/Agent" } - ]; - - // 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. The - // [next_page_token][google.cloud.ces.v1.ListAgentsResponse.next_page_token] - // value returned from a previous list - // [AgentService.ListAgents][google.cloud.ces.v1.AgentService.ListAgents] - // call. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filter to be applied when listing the agents. - // See https://google.aip.dev/160 for more details. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Field to sort by. Only "name" and "create_time" is supported. - // See https://google.aip.dev/132#ordering for more details. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [AgentService.ListAgents][google.cloud.ces.v1.AgentService.ListAgents]. -message ListAgentsResponse { - // The list of agents. - repeated Agent agents = 1; - - // A token that can be sent as - // [ListAgentsRequest.page_token][google.cloud.ces.v1.ListAgentsRequest.page_token] - // to retrieve the next page. Absence of this field indicates there are no - // subsequent pages. - string next_page_token = 2; -} - -// Request message for -// [AgentService.GetAgent][google.cloud.ces.v1.AgentService.GetAgent]. -message GetAgentRequest { - // Required. The resource name of the agent to retrieve. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } - ]; -} - -// Request message for -// [AgentService.CreateAgent][google.cloud.ces.v1.AgentService.CreateAgent]. -message CreateAgentRequest { - // Required. The resource name of the app to create an agent in. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { child_type: "ces.googleapis.com/Agent" } - ]; - - // Optional. The ID to use for the agent, which will become the final - // component of the agent's resource name. If not provided, a unique ID will - // be automatically assigned for the agent. - string agent_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The agent to create. - Agent agent = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [AgentService.UpdateAgent][google.cloud.ces.v1.AgentService.UpdateAgent]. -message UpdateAgentRequest { - // Required. The agent to update. - Agent agent = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Field mask is used to control which fields get updated. If the - // mask is not present, all fields will be updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [AgentService.DeleteAgent][google.cloud.ces.v1.AgentService.DeleteAgent]. -message DeleteAgentRequest { - // Required. The resource name of the agent to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } - ]; - - // Optional. Indicates whether to forcefully delete the agent, even if it is - // still referenced by other app/agents/examples. - // - // * If `force = false`, the deletion fails if other agents/examples - // reference it. - // * If `force = true`, delete the agent and remove it from all referencing - // apps/agents/examples. - bool force = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The current etag of the agent. If an etag is not provided, the - // deletion will overwrite any concurrent changes. If an etag is provided and - // does not match the current etag of the agent, deletion will be blocked and - // an ABORTED error will be returned. - string etag = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Represents the metadata of the long-running operation. -message OperationMetadata { - // 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. Human-readable status of the operation, if any. - string status_message = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Identifies whether the user has requested cancellation of the - // operation. Operations that have been cancelled successfully have - // [google.longrunning.Operation.error][google.longrunning.Operation.error] - // value with a [google.rpc.Status.code][google.rpc.Status.code] of `1`, - // corresponding to `Code.CANCELLED`. - bool requested_cancellation = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request message for -// [AgentService.ListExamples][google.cloud.ces.v1.AgentService.ListExamples]. -message ListExamplesRequest { - // Required. The resource name of the app to list examples from. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "ces.googleapis.com/Example" - } - ]; - - // 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. The - // [next_page_token][google.cloud.ces.v1.ListExamplesResponse.next_page_token] - // value returned from a previous list - // [AgentService.ListExamples][google.cloud.ces.v1.AgentService.ListExamples] - // call. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filter to be applied when listing the examples. - // See https://google.aip.dev/160 for more details. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Field to sort by. Only "name" and "create_time" is supported. - // See https://google.aip.dev/132#ordering for more details. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [AgentService.ListExamples][google.cloud.ces.v1.AgentService.ListExamples]. -message ListExamplesResponse { - // The list of examples. - repeated Example examples = 1; - - // A token that can be sent as - // [ListExamplesRequest.page_token][google.cloud.ces.v1.ListExamplesRequest.page_token] - // to retrieve the next page. Absence of this field indicates there are no - // subsequent pages. - string next_page_token = 2; -} - -// Request message for -// [AgentService.GetExample][google.cloud.ces.v1.AgentService.GetExample]. -message GetExampleRequest { - // Required. The resource name of the example to retrieve. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Example" } - ]; -} - -// Request message for -// [AgentService.CreateExample][google.cloud.ces.v1.AgentService.CreateExample]. -message CreateExampleRequest { - // Required. The resource name of the app to create an example in. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "ces.googleapis.com/Example" - } - ]; - - // Optional. The ID to use for the example, which will become the final - // component of the example's resource name. If not provided, a unique ID will - // be automatically assigned for the example. - string example_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The example to create. - Example example = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [AgentService.UpdateExample][google.cloud.ces.v1.AgentService.UpdateExample]. -message UpdateExampleRequest { - // Required. The example to update. - Example example = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Field mask is used to control which fields get updated. If the - // mask is not present, all fields will be updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [AgentService.DeleteExample][google.cloud.ces.v1.AgentService.DeleteExample]. -message DeleteExampleRequest { - // Required. The resource name of the example to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Example" } - ]; - - // Optional. The current etag of the example. If an etag is not provided, the - // deletion will overwrite any concurrent changes. If an etag is provided and - // does not match the current etag of the example, deletion will be blocked - // and an ABORTED error will be returned. - string etag = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [AgentService.ListTools][google.cloud.ces.v1.AgentService.ListTools]. -message ListToolsRequest { - // Required. The resource name of the app to list tools from. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { child_type: "ces.googleapis.com/Tool" } - ]; - - // 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. The - // [next_page_token][google.cloud.ces.v1.ListToolsResponse.next_page_token] - // value returned from a previous list - // [AgentService.ListTools][google.cloud.ces.v1.AgentService.ListTools] call. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filter to be applied when listing the tools. Use - // "include_system_tools=true" to include system tools in the response. See - // https://google.aip.dev/160 for more details. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Field to sort by. Only "name" and "create_time" is supported. - // See https://google.aip.dev/132#ordering for more details. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [AgentService.ListTools][google.cloud.ces.v1.AgentService.ListTools]. -message ListToolsResponse { - // The list of tools. - repeated Tool tools = 1; - - // A token that can be sent as - // [ListToolsRequest.page_token][google.cloud.ces.v1.ListToolsRequest.page_token] - // to retrieve the next page. Absence of this field indicates there are no - // subsequent pages. - string next_page_token = 2; -} - -// Request message for -// [AgentService.GetTool][google.cloud.ces.v1.AgentService.GetTool]. -message GetToolRequest { - // Required. The resource name of the tool to retrieve. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } - ]; -} - -// Request message for -// [AgentService.CreateTool][google.cloud.ces.v1.AgentService.CreateTool]. -message CreateToolRequest { - // Required. The resource name of the app to create a tool in. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { child_type: "ces.googleapis.com/Tool" } - ]; - - // Optional. The ID to use for the tool, which will become the final component - // of the tool's resource name. If not provided, a unique ID will be - // automatically assigned for the tool. - string tool_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The tool to create. - Tool tool = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [AgentService.UpdateTool][google.cloud.ces.v1.AgentService.UpdateTool]. -message UpdateToolRequest { - // Required. The tool to update. - Tool tool = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Field mask is used to control which fields get updated. If the - // mask is not present, all fields will be updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [AgentService.DeleteTool][google.cloud.ces.v1.AgentService.DeleteTool]. -message DeleteToolRequest { - // Required. The resource name of the tool to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } - ]; - - // Optional. Indicates whether to forcefully delete the tool, even if it is - // still referenced by agents/examples. - // - // * If `force = false`, the deletion will fail if any agents still - // reference the tool. - // * If `force = true`, all existing references from agents will be removed - // and the tool will be deleted. - bool force = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The current etag of the tool. If an etag is not provided, the - // deletion will overwrite any concurrent changes. If an etag is provided and - // does not match the current etag of the tool, deletion will be blocked and - // an ABORTED error will be returned. - string etag = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [AgentService.ListConversations][google.cloud.ces.v1.AgentService.ListConversations]. -message ListConversationsRequest { - // Required. The resource name of the app to list conversations from. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "ces.googleapis.com/Conversation" - } - ]; - - // 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. The - // [next_page_token][google.cloud.ces.v1.ListConversationsResponse.next_page_token] - // value returned from a previous list - // [AgentService.ListConversations][google.cloud.ces.v1.AgentService.ListConversations] - // call. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filter to be applied when listing the conversations. - // See https://google.aip.dev/160 for more details. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicate the source of the conversation. If not set, Source.Live - // will be applied by default. Will be deprecated in favor of `sources` field. - Conversation.Source source = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicate the sources of the conversations. If not set, all - // available sources will be applied by default. - repeated Conversation.Source sources = 6 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [AgentService.ListConversations][google.cloud.ces.v1.AgentService.ListConversations]. -message ListConversationsResponse { - // The list of conversations. - repeated Conversation conversations = 1; - - // A token that can be sent as - // [ListConversationsRequest.page_token][google.cloud.ces.v1.ListConversationsRequest.page_token] - // to retrieve the next page. Absence of this field indicates there are no - // subsequent pages. - string next_page_token = 2; -} - -// Request message for -// [AgentService.GetConversation][google.cloud.ces.v1.AgentService.GetConversation]. -message GetConversationRequest { - // Required. The resource name of the conversation to retrieve. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "ces.googleapis.com/Conversation" - } - ]; - - // Optional. Indicate the source of the conversation. If not set, all source - // will be searched. - Conversation.Source source = 2 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [AgentService.DeleteConversation][google.cloud.ces.v1.AgentService.DeleteConversation]. -message DeleteConversationRequest { - // Required. The resource name of the conversation to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "ces.googleapis.com/Conversation" - } - ]; - - // Optional. Indicate the source of the conversation. If not set, Source.Live - // will be applied by default. - Conversation.Source source = 2 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [AgentService.BatchDeleteConversations][google.cloud.ces.v1.AgentService.BatchDeleteConversations]. -message BatchDeleteConversationsRequest { - // Required. The resource name of the app to delete conversations from. - // Format: - // `projects/{project}/locations/{location}/apps/{app}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "ces.googleapis.com/Conversation" - } - ]; - - // Required. The resource names of the conversations to delete. - repeated string conversations = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "ces.googleapis.com/Conversation" - } - ]; -} - -// Response message for -// [AgentService.BatchDeleteConversations][google.cloud.ces.v1.AgentService.BatchDeleteConversations]. -message BatchDeleteConversationsResponse { - // The list of conversations that were successfully deleted. - repeated string deleted_conversations = 1; - - // The list of conversations that failed to be deleted. - repeated string failed_conversations = 2; - - // Optional. A list of error messages associated with conversations that - // failed to be deleted. - repeated string error_messages = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [AgentService.ListGuardrails][google.cloud.ces.v1.AgentService.ListGuardrails]. -message ListGuardrailsRequest { - // Required. The resource name of the app to list guardrails from. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "ces.googleapis.com/Guardrail" - } - ]; - - // 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. The - // [next_page_token][google.cloud.ces.v1.ListGuardrailsResponse.next_page_token] - // value returned from a previous list - // [AgentService.ListGuardrails][google.cloud.ces.v1.AgentService.ListGuardrails] - // call. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filter to be applied when listing the guardrails. - // See https://google.aip.dev/160 for more details. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Field to sort by. Only "name" and "create_time" is supported. - // See https://google.aip.dev/132#ordering for more details. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [AgentService.ListGuardrails][google.cloud.ces.v1.AgentService.ListGuardrails]. -message ListGuardrailsResponse { - // The list of guardrails. - repeated Guardrail guardrails = 1; - - // A token that can be sent as - // [ListGuardrailsRequest.page_token][google.cloud.ces.v1.ListGuardrailsRequest.page_token] - // to retrieve the next page. Absence of this field indicates there are no - // subsequent pages. - string next_page_token = 2; -} - -// Request message for -// [AgentService.GetGuardrail][google.cloud.ces.v1.AgentService.GetGuardrail]. -message GetGuardrailRequest { - // Required. The resource name of the guardrail to retrieve. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Guardrail" } - ]; -} - -// Request message for -// [AgentService.CreateGuardrail][google.cloud.ces.v1.AgentService.CreateGuardrail]. -message CreateGuardrailRequest { - // Required. The resource name of the app to create a guardrail in. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "ces.googleapis.com/Guardrail" - } - ]; - - // Optional. The ID to use for the guardrail, which will become the final - // component of the guardrail's resource name. If not provided, a unique ID - // will be automatically assigned for the guardrail. - string guardrail_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The guardrail to create. - Guardrail guardrail = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [AgentService.UpdateGuardrail][google.cloud.ces.v1.AgentService.UpdateGuardrail]. -message UpdateGuardrailRequest { - // Required. The guardrail to update. - Guardrail guardrail = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Field mask is used to control which fields get updated. If the - // mask is not present, all fields will be updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [AgentService.DeleteGuardrail][google.cloud.ces.v1.AgentService.DeleteGuardrail]. -message DeleteGuardrailRequest { - // Required. The resource name of the guardrail to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Guardrail" } - ]; - - // Optional. Indicates whether to forcefully delete the guardrail, even if it - // is still referenced by app/agents. - // - // * If `force = false`, the deletion fails if any apps/agents still - // reference the guardrail. - // * If `force = true`, all existing references from apps/agents will be - // removed and the guardrail will be deleted. - bool force = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The current etag of the guardrail. If an etag is not provided, - // the deletion will overwrite any concurrent changes. If an etag is provided - // and does not match the current etag of the guardrail, deletion will be - // blocked and an ABORTED error will be returned. - string etag = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [AgentService.ListDeployments][google.cloud.ces.v1.AgentService.ListDeployments]. -message ListDeploymentsRequest { - // Required. The parent app. - // Format: - // `projects/{project}/locations/{location}/apps/{app}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "ces.googleapis.com/Deployment" - } - ]; - - // Optional. The maximum number of deployments to return. The service may - // return fewer than this value. If unspecified, at most 50 deployments will - // be returned. The maximum value is 1000; values above 1000 will be coerced - // to 1000. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous `ListDeployments` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListDeployments` must - // match the call that provided the page token. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Field to sort by. Only "name" and "create_time" is supported. - // See https://google.aip.dev/132#ordering for more details. - string order_by = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [AgentService.ListDeployments][google.cloud.ces.v1.AgentService.ListDeployments]. -message ListDeploymentsResponse { - // The list of deployments. - repeated Deployment deployments = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for -// [AgentService.GetDeployment][google.cloud.ces.v1.AgentService.GetDeployment]. -message GetDeploymentRequest { - // Required. The name of the deployment. - // Format: - // `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Deployment" } - ]; -} - -// Request message for -// [AgentService.CreateDeployment][google.cloud.ces.v1.AgentService.CreateDeployment]. -message CreateDeploymentRequest { - // Required. The parent app. - // Format: - // `projects/{project}/locations/{location}/apps/{app}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "ces.googleapis.com/Deployment" - } - ]; - - // Optional. The ID to use for the deployment, which will become the final - // component of the deployment's resource name. If not provided, a unique ID - // will be automatically assigned for the deployment. - string deployment_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The deployment to create. - Deployment deployment = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [AgentService.UpdateDeployment][google.cloud.ces.v1.AgentService.UpdateDeployment]. -message UpdateDeploymentRequest { - // Required. The deployment to update. - Deployment deployment = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The list of fields to update. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [AgentService.DeleteDeployment][google.cloud.ces.v1.AgentService.DeleteDeployment]. -message DeleteDeploymentRequest { - // Required. The name of the deployment to delete. - // Format: - // `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Deployment" } - ]; - - // Optional. The etag of the deployment. - // If an etag is provided and does not match the current etag of the - // deployment, deletion will be blocked and an ABORTED error will be returned. - string etag = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [AgentService.ListToolsets][google.cloud.ces.v1.AgentService.ListToolsets]. -message ListToolsetsRequest { - // Required. The resource name of the app to list toolsets from. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "ces.googleapis.com/Toolset" - } - ]; - - // 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. The - // [next_page_token][google.cloud.ces.v1.ListToolsetsResponse.next_page_token] - // value returned from a previous list - // [AgentService.ListToolsets][google.cloud.ces.v1.AgentService.ListToolsets] - // call. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filter to be applied when listing the toolsets. - // See https://google.aip.dev/160 for more details. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Field to sort by. Only "name" and "create_time" is supported. - // See https://google.aip.dev/132#ordering for more details. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [AgentService.ListToolsets][google.cloud.ces.v1.AgentService.ListToolsets]. -message ListToolsetsResponse { - // The list of toolsets. - repeated Toolset toolsets = 1; - - // A token that can be sent as - // [ListToolsetsRequest.page_token][google.cloud.ces.v1.ListToolsetsRequest.page_token] - // to retrieve the next page. Absence of this field indicates there are no - // subsequent pages. - string next_page_token = 2; -} - -// Request message for -// [AgentService.GetToolset][google.cloud.ces.v1.AgentService.GetToolset]. -message GetToolsetRequest { - // Required. The resource name of the toolset to retrieve. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Toolset" } - ]; -} - -// Request message for -// [AgentService.CreateToolset][google.cloud.ces.v1.AgentService.CreateToolset]. -message CreateToolsetRequest { - // Required. The resource name of the app to create a toolset in. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "ces.googleapis.com/Toolset" - } - ]; - - // Optional. The ID to use for the toolset, which will become the final - // component of the toolset's resource name. If not provided, a unique ID will - // be automatically assigned for the toolset. - string toolset_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The toolset to create. - Toolset toolset = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [AgentService.UpdateToolset][google.cloud.ces.v1.AgentService.UpdateToolset]. -message UpdateToolsetRequest { - // Required. The toolset to update. - Toolset toolset = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Field mask is used to control which fields get updated. If the - // mask is not present, all fields will be updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [AgentService.DeleteToolset][google.cloud.ces.v1.AgentService.DeleteToolset]. -message DeleteToolsetRequest { - // Required. The resource name of the toolset to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Toolset" } - ]; - - // Optional. Indicates whether to forcefully delete the toolset, even if it is - // still referenced by app/agents. - // - // * If `force = false`, the deletion fails if any agents still - // reference the toolset. - // * If `force = true`, all existing references from agents will be - // removed and the toolset will be deleted. - bool force = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The current etag of the toolset. If an etag is not provided, the - // deletion will overwrite any concurrent changes. If an etag is provided and - // does not match the current etag of the toolset, deletion will be blocked - // and an ABORTED error will be returned. - string etag = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [AgentService.ListAppVersions][google.cloud.ces.v1.AgentService.ListAppVersions]. -message ListAppVersionsRequest { - // Required. The resource name of the app to list app versions from. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "ces.googleapis.com/AppVersion" - } - ]; - - // 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. The - // [next_page_token][google.cloud.ces.v1.ListAppVersionsResponse.next_page_token] - // value returned from a previous list - // [AgentService.ListAppVersions][google.cloud.ces.v1.AgentService.ListAppVersions] - // call. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filter to be applied when listing the app versions. - // See https://google.aip.dev/160 for more details. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Field to sort by. Only "name" and "create_time" is supported. - // See https://google.aip.dev/132#ordering for more details. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [AgentService.ListAppVersions][google.cloud.ces.v1.AgentService.ListAppVersions]. -message ListAppVersionsResponse { - // The list of app versions. - repeated AppVersion app_versions = 1; - - // A token that can be sent as - // [ListAppVersionsRequest.page_token][google.cloud.ces.v1.ListAppVersionsRequest.page_token] - // to retrieve the next page. Absence of this field indicates there are no - // subsequent pages. - string next_page_token = 2; -} - -// Request message for -// [AgentService.GetAppVersion][google.cloud.ces.v1.AgentService.GetAppVersion]. -message GetAppVersionRequest { - // Required. The resource name of the app version to retrieve. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/AppVersion" } - ]; -} - -// Request message for -// [AgentService.DeleteAppVersion][google.cloud.ces.v1.AgentService.DeleteAppVersion]. -message DeleteAppVersionRequest { - // Required. The resource name of the app version to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/AppVersion" } - ]; - - // Optional. The current etag of the app version. If an etag is not provided, - // the deletion will overwrite any concurrent changes. If an etag is provided - // and does not match the current etag of the app version, deletion will be - // blocked and an ABORTED error will be returned. - string etag = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for -// [AgentService.CreateAppVersion][google.cloud.ces.v1.AgentService.CreateAppVersion] -message CreateAppVersionRequest { - // Required. The resource name of the app to create an app version in. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "ces.googleapis.com/AppVersion" - } - ]; - - // Optional. The ID to use for the app version, which will become the final - // component of the app version's resource name. If not provided, a unique ID - // will be automatically assigned for the app version. - string app_version_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The app version to create. - AppVersion app_version = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [AgentService.RestoreAppVersion][google.cloud.ces.v1.AgentService.RestoreAppVersion] -message RestoreAppVersionRequest { - // Required. The resource name of the app version to restore. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/AppVersion" } - ]; -} - -// Response message for -// [AgentService.RestoreAppVersion][google.cloud.ces.v1.AgentService.RestoreAppVersion] -message RestoreAppVersionResponse {} - -// Request message for -// [AgentService.ListChangelogs][google.cloud.ces.v1.AgentService.ListChangelogs]. -message ListChangelogsRequest { - // Required. The resource name of the app to list changelogs from. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "ces.googleapis.com/Changelog" - } - ]; - - // 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. The - // [next_page_token][google.cloud.ces.v1.ListChangelogsResponse.next_page_token] - // value returned from a previous list - // [AgentService.ListChangelogs][google.cloud.ces.v1.AgentService.ListChangelogs] - // call. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filter to be applied when listing the changelogs. - // See https://google.aip.dev/160 for more details. - // - // The filter string can be used to filter by `action`, `resource_type`, - // `resource_name`, `author`, and `create_time`. - // The `:` comparator can be used for case-insensitive partial matching on - // string fields, while `=` performs an exact case-sensitive match. - // - // Examples: - // * `action:update` (case-insensitive partial match) - // * `action="Create"` (case-sensitive exact match) - // * `resource_type:agent` - // * `resource_name:my-agent` - // * `author:me@example.com` - // * `create_time > "2025-01-01T00:00:00Z"` - // * `create_time <= "2025-01-01T00:00:00Z" AND resource_type:tool` - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Field to sort by. Only "name" and "create_time" is supported. - // See https://google.aip.dev/132#ordering for more details. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [AgentService.ListChangelogs][google.cloud.ces.v1.AgentService.ListChangelogs]. -message ListChangelogsResponse { - // The list of changelogs. - repeated Changelog changelogs = 1; - - // A token that can be sent as - // [ListChangelogsRequest.page_token][google.cloud.ces.v1.ListChangelogsRequest.page_token] - // to retrieve the next page. Absence of this field indicates there are no - // subsequent pages. - string next_page_token = 2; -} - -// Request message for -// [AgentService.GetChangelog][google.cloud.ces.v1.AgentService.GetChangelog]. -message GetChangelogRequest { - // Required. The resource name of the changelog to retrieve. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Changelog" } - ]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent_transfers.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent_transfers.proto deleted file mode 100644 index 790e59f8ce0..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/agent_transfers.proto +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "AgentTransfersProto"; -option java_package = "com.google.cloud.ces.v1"; - -// Expression condition based on session state. -message ExpressionCondition { - // Required. The string representation of cloud.api.Expression condition. - string expression = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Python code block to evaluate the condition. -message PythonCodeCondition { - // Required. The python code to execute. - string python_code = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Rule for transferring to a specific agent. -message TransferRule { - // Deterministic transfer rule. When the condition evaluates to true, the - // transfer occurs. - message DeterministicTransfer { - // The condition to evaluate. - oneof condition_type { - // Optional. A rule that evaluates a session state condition. - // If the condition evaluates to true, the transfer occurs. - ExpressionCondition expression_condition = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A rule that uses Python code block to evaluate the - // conditions. If the condition evaluates to true, the transfer occurs. - PythonCodeCondition python_code_condition = 2 - [(google.api.field_behavior) = OPTIONAL]; - } - } - - // A rule that prevents the planner from transferring to the target agent. - message DisablePlannerTransfer { - // Required. If the condition evaluates to true, planner will not be allowed - // to transfer to the target agent. - ExpressionCondition expression_condition = 1 - [(google.api.field_behavior) = REQUIRED]; - } - - // The direction of the transfer. - enum Direction { - // Unspecified direction. - DIRECTION_UNSPECIFIED = 0; - - // Transfer from the parent agent to the child agent. - PARENT_TO_CHILD = 1; - - // Transfer from the child agent to the parent agent. - CHILD_TO_PARENT = 2; - } - - // The rule type. - oneof rule_type { - // Optional. A rule that immediately transfers to the target agent when the - // condition is met. - DeterministicTransfer deterministic_transfer = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Rule that prevents the planner from transferring to the target - // agent. - DisablePlannerTransfer disable_planner_transfer = 4 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. The resource name of the child agent the rule applies to. - // Format: - // `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` - string child_agent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } - ]; - - // Required. The direction of the transfer. - Direction direction = 2 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/app.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/app.proto deleted file mode 100644 index c62fd0194a7..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/app.proto +++ /dev/null @@ -1,651 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/ces/v1/bigquery_export.proto"; -import "google/cloud/ces/v1/common.proto"; -import "google/cloud/ces/v1/schema.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "AppProto"; -option java_package = "com.google.cloud.ces.v1"; -option (google.api.resource_definition) = { - type: "dlp.googleapis.com/InspectTemplate" - pattern: "organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}" - pattern: "projects/{project}/locations/{location}/inspectTemplates/{inspect_template}" -}; -option (google.api.resource_definition) = { - type: "dlp.googleapis.com/DeidentifyTemplate" - pattern: "organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}" - pattern: "projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}" -}; -option (google.api.resource_definition) = { - type: "discoveryengine.googleapis.com/Engine" - pattern: "projects/{project}/locations/{location}/collections/{collection}/engines/{engine}" -}; - -// An app serves as a top-level container for a group of agents, including the -// root agent and its sub-agents, along with their associated configurations. -// These agents work together to achieve specific goals within the app's -// context. -message App { - option (google.api.resource) = { - type: "ces.googleapis.com/App" - pattern: "projects/{project}/locations/{location}/apps/{app}" - plural: "apps" - singular: "app" - }; - - // Defines the structure and metadata for a variable. - message VariableDeclaration { - // Required. The name of the variable. The name must start with a letter or - // underscore and contain only letters, numbers, or underscores. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The description of the variable. - string description = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The schema of the variable. - Schema schema = 3 [(google.api.field_behavior) = REQUIRED]; - } - - // Defines the tool execution behavior if there are **multiple** tools being - // selected by the agent **at the same time**. - enum ToolExecutionMode { - // Unspecified tool execution mode. Default to PARALLEL. - TOOL_EXECUTION_MODE_UNSPECIFIED = 0; - - // If there are multiple tools being selected, they will be executed in - // parallel, with the same - // [ToolContext](https://google.github.io/adk-docs/context/#the-different-types-of-context). - PARALLEL = 1; - - // If there are multiple tools being selected, they will be executed - // sequentially. The next tool will only be executed after the previous tool - // completes and it can see updated - // [ToolContext](https://google.github.io/adk-docs/context/#the-different-types-of-context) - // from the previous tool. - SEQUENTIAL = 2; - } - - // Identifier. The unique identifier of the app. - // Format: `projects/{project}/locations/{location}/apps/{app}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. Display name of the app. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Human-readable description of the app. - string description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether the app is pinned in the app list. - bool pinned = 31 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The root agent is the entry point of the app. - // Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` - string root_agent = 4 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } - ]; - - // Optional. Language settings of the app. - LanguageSettings language_settings = 18 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. TimeZone settings of the app. - TimeZoneSettings time_zone_settings = 27 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Audio processing configuration of the app. - AudioProcessingConfig audio_processing_config = 7 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Logging settings of the app. - LoggingSettings logging_settings = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The default LLM model settings for the app. - // Individual resources (e.g. agents, guardrails) can override these - // configurations as needed. - ModelSettings model_settings = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The tool execution mode for the app. If not provided, will - // default to PARALLEL. - ToolExecutionMode tool_execution_mode = 32 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The evaluation thresholds for the app. - EvaluationMetricsThresholds evaluation_metrics_thresholds = 24 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The declarations of the variables. - repeated VariableDeclaration variable_declarations = 14 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The declarations of predefined variables for the app. - repeated VariableDeclaration predefined_variable_declarations = 28 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Instructions for all the agents in the app. - // You can use this instruction to set up a stable identity or personality - // across all the agents. - string global_instruction = 17 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of guardrails for the app. - // Format: - // `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}` - repeated string guardrails = 10 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { type: "ces.googleapis.com/Guardrail" } - ]; - - // Optional. The data store settings for the app. - DataStoreSettings data_store_settings = 15 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The default channel profile used by the app. - ChannelProfile default_channel_profile = 22 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Metadata about the app. This field can be used to store - // additional information relevant to the app's details or intended usages. - map metadata = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Timestamp when the app was created. - google.protobuf.Timestamp create_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when the app was last updated. - google.protobuf.Timestamp update_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Etag used to ensure the object hasn't changed during a - // read-modify-write operation. If the etag is empty, the update will - // overwrite any concurrent changes. - string etag = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Number of deployments in the app. - int32 deployment_count = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The default client certificate settings for the app. - ClientCertificateSettings client_certificate_settings = 25 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicates whether the app is locked for changes. If the app is - // locked, modifications to the app resources will be rejected. - bool locked = 29 [(google.api.field_behavior) = OPTIONAL]; -} - -// TimeZone settings of the app. -message TimeZoneSettings { - // Optional. The time zone of the app from the [time zone - // database](https://www.iana.org/time-zones), e.g., America/Los_Angeles, - // Europe/Paris. - string time_zone = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// Language settings of the app. -message LanguageSettings { - // Optional. The default language code of the app. - string default_language_code = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of languages codes supported by the app, in addition to the - // `default_language_code`. - repeated string supported_language_codes = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Enables multilingual support. If true, agents in the app will use - // pre-built instructions to improve handling of multilingual input. - bool enable_multilingual_support = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The action to perform when an agent receives input in an - // unsupported language. - // - // This can be a predefined action or a custom tool call. - // Valid values are: - // - A tool's full resource name, which triggers a specific tool execution. - // - A predefined system action, such as "escalate" or "exit", which triggers - // an [EndSession][google.cloud.ces.v1.EndSession] signal with corresponding - // [metadata][google.cloud.ces.v1.EndSession.metadata] to terminate the - // conversation. - string fallback_action = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration for how the input and output audio should be processed and -// delivered. -message AudioProcessingConfig { - // Optional. Configuration of how the agent response should be synthesized, - // mapping from the language code to - // [SynthesizeSpeechConfig][google.cloud.ces.v1.SynthesizeSpeechConfig]. - // - // If the configuration for the specified language code is not found, the - // configuration for the root language code will be used. For example, if the - // map contains "en-us" and "en", and the specified language code is "en-gb", - // then "en" configuration will be used. - // - // Note: Language code is case-insensitive. - map synthesize_speech_configs = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Configures the agent behavior for the user barge-in activities. - BargeInConfig barge_in_config = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The duration of user inactivity (no speech or interaction) before - // the agent prompts the user for reengagement. If not set, the agent will not - // prompt the user for reengagement. - google.protobuf.Duration inactivity_timeout = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Configuration for the ambient sound to be played with the - // synthesized agent response, to enhance the naturalness of the conversation. - AmbientSoundConfig ambient_sound_config = 5 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration for the ambient sound to be played with the synthesized agent -// response, to enhance the naturalness of the conversation. -message AmbientSoundConfig { - // Prebuilt ambient noise. - enum PrebuiltAmbientNoise { - // Not specified. - PREBUILT_AMBIENT_NOISE_UNSPECIFIED = 0; - - // Ambient noise of a retail store. - RETAIL_STORE = 1; - - // Ambient noise of a convention hall. - CONVENTION_HALL = 2; - - // Ambient noise of a street. - OUTDOOR = 3; - } - - // Ambient noise to be played with the synthesized agent response, to - // enhance the naturalness of the conversation. - oneof source { - // Optional. Deprecated: `prebuilt_ambient_noise` is deprecated in favor of - // `prebuilt_ambient_sound`. - PrebuiltAmbientNoise prebuilt_ambient_noise = 1 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; - - // Optional. Ambient noise as a mono-channel, 16kHz WAV file stored in - // [Cloud Storage](https://cloud.google.com/storage). - // - // Note: Please make sure the CES service agent - // `service-@gcp-sa-ces.iam.gserviceaccount.com` has - // `storage.objects.get` permission to the Cloud Storage object. - string gcs_uri = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Name of the prebuilt ambient sound. - // Valid values are: - // - "coffee_shop" - // - "keyboard" - // - "keypad" - // - "hum" - // - "office_1" - // - "office_2" - // - "office_3" - // - "room_1" - // - "room_2" - // - "room_3" - // - "room_4" - // - "room_5" - // - "air_conditioner" - string prebuilt_ambient_sound = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. Volume gain (in dB) of the normal native volume supported by - // ambient noise, in the range [-96.0, 16.0]. If unset, or set to a value of - // 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) - // will play at approximately half the amplitude of the normal native signal - // amplitude. A value of +6.0 (dB) will play at approximately twice the - // amplitude of the normal native signal amplitude. We strongly recommend not - // to exceed +10 (dB) as there's usually no effective increase in loudness for - // any value greater than that. - double volume_gain_db = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration for how the user barge-in activities should be handled. -message BargeInConfig { - // Optional. Disables user barge-in while the agent is speaking. If true, user - // input during agent response playback will be ignored. - // - // Deprecated: `disable_barge_in` is deprecated in favor of - // [`disable_barge_in_control`][google.cloud.ces.v1.ChannelProfile.disable_barge_in_control] - // in ChannelProfile. - bool disable_barge_in = 1 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; - - // Optional. If enabled, the agent will adapt its next response based on the - // assumption that the user hasn't heard the full preceding agent message. - // This should not be used in scenarios where agent responses are displayed - // visually. - bool barge_in_awareness = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration for how the agent response should be synthesized. -message SynthesizeSpeechConfig { - // Optional. The name of the voice. If not set, the service will choose a - // voice based on the other parameters such as language_code. - // - // For the list of available voices, please refer to [Supported voices and - // languages](https://cloud.google.com/text-to-speech/docs/voices) from Cloud - // Text-to-Speech. - string voice = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The speaking rate/speed in the range [0.25, 2.0]. 1.0 is the - // normal native speed supported by the specific voice. 2.0 is twice as fast, - // and 0.5 is half as fast. Values outside of the range [0.25, 2.0] will - // return an error. - double speaking_rate = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Settings to describe the conversation data collection behaviors for LLM -// analysis metrics pipeline. -message MetricAnalysisSettings { - // Optional. Whether to collect conversation data for llm analysis metrics. If - // true, conversation data will not be collected for llm analysis metrics; - // otherwise, conversation data will be collected. - bool llm_metrics_opted_out = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// Settings to describe the logging behaviors for the app. -message LoggingSettings { - // Optional. Configuration for how sensitive data should be redacted. - RedactionConfig redaction_config = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Configuration for how audio interactions should be recorded. - AudioRecordingConfig audio_recording_config = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Settings to describe the BigQuery export behaviors for the app. - // The conversation data will be exported to BigQuery tables if it is enabled. - BigQueryExportSettings bigquery_export_settings = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Settings to describe the Cloud Logging behaviors for the app. - CloudLoggingSettings cloud_logging_settings = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Settings to describe the conversation logging behaviors for the - // app. - ConversationLoggingSettings conversation_logging_settings = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Configuration for how audio interactions should be recorded for - // the evaluation. By default, audio recording is not enabled for evaluation - // sessions. - AudioRecordingConfig evaluation_audio_recording_config = 6 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Settings to describe the conversation data collection behaviors - // for the LLM analysis pipeline for the app. - MetricAnalysisSettings metric_analysis_settings = 7 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Threshold settings for metrics in an Evaluation. -message EvaluationMetricsThresholds { - // Settings for golden evaluations. - message GoldenEvaluationMetricsThresholds { - // Turn level metrics thresholds. - message TurnLevelMetricsThresholds { - // Semantic similarity channel to use. - enum SemanticSimilarityChannel { - // Metric unspecified. Defaults to TEXT. - SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED = 0; - - // Use text semantic similarity. - TEXT = 1; - - // Use audio semantic similarity. - AUDIO = 2; - } - - // Optional. The success threshold for semantic similarity. Must be an - // integer between 0 and 4. Default is >= 3. - optional int32 semantic_similarity_success_threshold = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The success threshold for overall tool invocation - // correctness. Must be a float between 0 and 1. Default is 1.0. - optional float overall_tool_invocation_correctness_threshold = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The semantic similarity channel to use for evaluation. - SemanticSimilarityChannel semantic_similarity_channel = 3 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Expectation level metrics thresholds. - message ExpectationLevelMetricsThresholds { - // Optional. The success threshold for individual tool invocation - // parameter correctness. Must be a float between 0 and 1. Default is 1.0. - optional float tool_invocation_parameter_correctness_threshold = 1 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. The turn level metrics thresholds. - TurnLevelMetricsThresholds turn_level_metrics_thresholds = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The expectation level metrics thresholds. - ExpectationLevelMetricsThresholds expectation_level_metrics_thresholds = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The tool matching settings. An - // extra tool call is a tool call that is present in the execution but does - // not match any tool call in the golden expectation. - ToolMatchingSettings tool_matching_settings = 3 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Settings for matching tool calls. - message ToolMatchingSettings { - // Defines the behavior when an extra tool call is encountered. An extra - // tool call is a tool call that is present in the execution but does not - // match any tool call in the golden expectation. - enum ExtraToolCallBehavior { - // Unspecified behavior. Defaults to FAIL. - EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED = 0; - - // Fail the evaluation if an extra tool call is encountered. - FAIL = 1; - - // Allow the extra tool call. - ALLOW = 2; - } - - // Optional. Behavior for extra tool calls. - // Defaults to FAIL. - ExtraToolCallBehavior extra_tool_call_behavior = 1 - [(google.api.field_behavior) = OPTIONAL]; - } - - // The hallucination metric behavior. Regardless of the behavior, the metric - // will always be calculated. The difference is that when disabled, the - // metric is not used to calculate the overall evaluation score. - enum HallucinationMetricBehavior { - // Unspecified hallucination metric behavior. - HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED = 0; - - // Disable hallucination metric. - DISABLED = 1; - - // Enable hallucination metric. - ENABLED = 2; - } - - // Optional. The golden evaluation metrics thresholds. - GoldenEvaluationMetricsThresholds golden_evaluation_metrics_thresholds = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Deprecated: Use `golden_hallucination_metric_behavior` instead. - // The hallucination metric behavior is currently used for golden evaluations. - HallucinationMetricBehavior hallucination_metric_behavior = 3 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; - - // Optional. The hallucination metric behavior for golden evaluations. - HallucinationMetricBehavior golden_hallucination_metric_behavior = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The hallucination metric behavior for scenario evaluations. - HallucinationMetricBehavior scenario_hallucination_metric_behavior = 4 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Settings for custom client certificates. -message ClientCertificateSettings { - // Required. The TLS certificate encoded in PEM format. This string must - // include the begin header and end footer lines. - string tls_certificate = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the SecretManager secret version resource storing the - // private key encoded in PEM format. - // Format: `projects/{project}/secrets/{secret}/versions/{version}` - string private_key = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "secretmanager.googleapis.com/SecretVersion" - } - ]; - - // Optional. The name of the SecretManager secret version resource storing the - // passphrase to decrypt the private key. Should be left unset if the private - // key is not encrypted. - // Format: `projects/{project}/secrets/{secret}/versions/{version}` - string passphrase = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Settings to describe the conversation logging behaviors for the app. -message ConversationLoggingSettings { - // Optional. Whether to disable conversation logging for the sessions. - bool disable_conversation_logging = 1 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Settings to describe the Cloud Logging behaviors for the app. -message CloudLoggingSettings { - // Optional. Whether to enable Cloud Logging for the sessions. - bool enable_cloud_logging = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration for how the audio interactions should be recorded. -message AudioRecordingConfig { - // Optional. The [Cloud Storage](https://cloud.google.com/storage) bucket to - // store the session audio recordings. The URI must start with "gs://". - // - // Please choose a bucket location that meets your data residency - // requirements. - // - // Note: If the Cloud Storage bucket is in a different project from the app, - // you should grant `storage.objects.create` permission to the CES service - // agent `service-@gcp-sa-ces.iam.gserviceaccount.com`. - string gcs_bucket = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Cloud Storage path prefix for audio recordings. - // - // This prefix can include the following placeholders, which will be - // dynamically substituted at serving time: - // - $project: project ID - // - $location: app location - // - $app: app ID - // - $date: session date in YYYY-MM-DD format - // - $session: session ID - // - // If the path prefix is not specified, the default prefix - // `$project/$location/$app/$date/$session/` will be used. - string gcs_path_prefix = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration to instruct how sensitive data should be handled. -message RedactionConfig { - // Optional. If true, redaction will be applied in various logging scenarios, - // including conversation history, Cloud Logging and audio recording. - bool enable_redaction = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. [DLP](https://cloud.google.com/dlp/docs) inspect template name to - // configure detection of sensitive data types. - // - // Format: - // `projects/{project}/locations/{location}/inspectTemplates/{inspect_template}` - string inspect_template = 2 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/InspectTemplate" - } - ]; - - // Optional. [DLP](https://cloud.google.com/dlp/docs) deidentify template name - // to instruct on how to de-identify content. - // - // Format: - // `projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}` - string deidentify_template = 3 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/DeidentifyTemplate" - } - ]; -} - -// Data store related settings for the app. -message DataStoreSettings { - // An engine to which the data stores are connected. - // See Vertex AI Search: - // https://cloud.google.com/generative-ai-app-builder/docs/enterprise-search-introduction. - message Engine { - // The type of the engine. - // See the documentation available at - // https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/SolutionType - // and - // https://cloud.google.com/generative-ai-app-builder/docs/create-datastore-ingest. - enum Type { - // Unspecified engine type. - TYPE_UNSPECIFIED = 0; - - // The SOLUTION_TYPE_SEARCH engine for the app. All connector data stores - // added to the app will be added to this engine. - ENGINE_TYPE_SEARCH = 1; - - // Chat engine type. - // The SOLUTION_TYPE_CHAT engine for the app. All connector data stores - // added to the app will be added to this engine. - ENGINE_TYPE_CHAT = 2; - } - - // Output only. The resource name of the engine. - // Format: - // `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` - string name = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "discoveryengine.googleapis.com/Engine" - } - ]; - - // Output only. The type of the engine. - Type type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. The engines for the app. - repeated Engine engines = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/app_version.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/app_version.proto deleted file mode 100644 index ff383d97347..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/app_version.proto +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/ces/v1/agent.proto"; -import "google/cloud/ces/v1/app.proto"; -import "google/cloud/ces/v1/example.proto"; -import "google/cloud/ces/v1/guardrail.proto"; -import "google/cloud/ces/v1/tool.proto"; -import "google/cloud/ces/v1/toolset.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "AppVersionProto"; -option java_package = "com.google.cloud.ces.v1"; - -// A snapshot of the app. -message AppSnapshot { - // Optional. The basic settings for the app. - App app = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of agents in the app. - repeated Agent agents = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of tools in the app. - repeated Tool tools = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of examples in the app. - repeated Example examples = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of guardrails in the app. - repeated Guardrail guardrails = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of toolsets in the app. - repeated Toolset toolsets = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// In Customer Engagement Suite (CES), an app version is a snapshot of the app -// at a specific point in time. It is immutable and cannot be modified once -// created. -message AppVersion { - option (google.api.resource) = { - type: "ces.googleapis.com/AppVersion" - pattern: "projects/{project}/locations/{location}/apps/{app}/versions/{version}" - plural: "appVersions" - singular: "appVersion" - }; - - // Identifier. The unique identifier of the app version. - // Format: - // `projects/{project}/locations/{location}/apps/{app}/versions/{version}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Optional. The display name of the app version. - string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The description of the app version. - string description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Email of the user who created the app version. - string creator = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when the app version was created. - google.protobuf.Timestamp create_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The snapshot of the app when the version is created. - AppSnapshot snapshot = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Etag used to ensure the object hasn't changed during a - // read-modify-write operation. If the etag is empty, the update will - // overwrite any concurrent changes. - string etag = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/auth.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/auth.proto deleted file mode 100644 index 882c3689138..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/auth.proto +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "AuthProto"; -option java_package = "com.google.cloud.ces.v1"; -option (google.api.resource_definition) = { - type: "secretmanager.googleapis.com/SecretVersion" - pattern: "projects/{project}/secrets/{secret}/versions/{secret_version}" -}; - -// Configurations for authentication with API key. -message ApiKeyConfig { - // The location of the API key in the request. - enum RequestLocation { - // Unspecified. This value should not be used. - REQUEST_LOCATION_UNSPECIFIED = 0; - - // Represents the key in http header. - HEADER = 1; - - // Represents the key in query string. - QUERY_STRING = 2; - } - - // Required. The parameter name or the header name of the API key. - // E.g., If the API request is "https://example.com/act?X-Api-Key=", "X-Api-Key" would be the parameter name. - string key_name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the SecretManager secret version resource storing the - // API key. Format: `projects/{project}/secrets/{secret}/versions/{version}` - // - // Note: You should grant `roles/secretmanager.secretAccessor` role to the CES - // service agent - // `service-@gcp-sa-ces.iam.gserviceaccount.com`. - string api_key_secret_version = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "secretmanager.googleapis.com/SecretVersion" - } - ]; - - // Required. Key location in the request. - RequestLocation request_location = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Configurations for authentication with OAuth. -message OAuthConfig { - // OAuth grant types. Only [client credential - // grant](https://oauth.net/2/grant-types/client-credentials) is supported. - enum OauthGrantType { - // Unspecified. Defaults to CLIENT_CREDENTIAL. - OAUTH_GRANT_TYPE_UNSPECIFIED = 0; - - // Represents the [client credential - // flow](https://oauth.net/2/grant-types/client-credentials). - CLIENT_CREDENTIAL = 1; - } - - // Required. OAuth grant types. - OauthGrantType oauth_grant_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The client ID from the OAuth provider. - string client_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the SecretManager secret version resource storing the - // client secret. - // Format: `projects/{project}/secrets/{secret}/versions/{version}` - // - // Note: You should grant `roles/secretmanager.secretAccessor` role to the CES - // service agent - // `service-@gcp-sa-ces.iam.gserviceaccount.com`. - string client_secret_version = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "secretmanager.googleapis.com/SecretVersion" - } - ]; - - // Required. The token endpoint in the OAuth provider to exchange for an - // access token. - string token_endpoint = 4 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The OAuth scopes to grant. - repeated string scopes = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configurations for authentication with [ID -// token](https://cloud.google.com/docs/authentication/token-types#id) generated -// from service agent. -message ServiceAgentIdTokenAuthConfig {} - -// Configurations for authentication using a custom service account. -message ServiceAccountAuthConfig { - // Required. The email address of the service account used for authentication. - // CES uses this service account to exchange an access token and the access - // token is then sent in the `Authorization` header of the request. - // - // The service account must have the - // `roles/iam.serviceAccountTokenCreator` role granted to the - // CES service agent - // `service-@gcp-sa-ces.iam.gserviceaccount.com`. - string service_account = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The OAuth scopes to grant. If not specified, the default scope - // `https://www.googleapis.com/auth/cloud-platform` is used. - repeated string scopes = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configurations for authentication with a bearer token. -message BearerTokenConfig { - // Required. The bearer token. - // Must be in the format `$context.variables.`. - string token = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// End-user authentication configuration used for Connection calls. -// The field values must be the names of context variables in the format -// `$context.variables.`. -message EndUserAuthConfig { - // Oauth 2.0 Authorization Code authentication configuration. - message Oauth2AuthCodeConfig { - // Required. Oauth token parameter name to pass through. - // Must be in the format `$context.variables.`. - string oauth_token = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // JWT Profile Oauth 2.0 Authorization Grant authentication configuration. - message Oauth2JwtBearerConfig { - // Required. Issuer parameter name to pass through. - // Must be in the format `$context.variables.`. - string issuer = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Subject parameter name to pass through. - // Must be in the format `$context.variables.`. - string subject = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Client parameter name to pass through. - // Must be in the format `$context.variables.`. - string client_key = 3 [(google.api.field_behavior) = REQUIRED]; - } - - // The auth configuration. - oneof auth_config { - // Oauth 2.0 Authorization Code authentication. - Oauth2AuthCodeConfig oauth2_auth_code_config = 2; - - // JWT Profile Oauth 2.0 Authorization Grant authentication. - Oauth2JwtBearerConfig oauth2_jwt_bearer_config = 3; - } -} - -// Authentication information required for API calls. -message ApiAuthentication { - // The auth configuration. - oneof auth_config { - // Optional. Config for API key auth. - ApiKeyConfig api_key_config = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Config for OAuth. - OAuthConfig oauth_config = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Config for ID token auth generated from CES service agent. - ServiceAgentIdTokenAuthConfig service_agent_id_token_auth_config = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Config for service account authentication. - ServiceAccountAuthConfig service_account_auth_config = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Config for bearer token auth. - BearerTokenConfig bearer_token_config = 5 - [(google.api.field_behavior) = OPTIONAL]; - } -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/bigquery_export.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/bigquery_export.proto deleted file mode 100644 index dd9e7cc1f71..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/bigquery_export.proto +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "BigQueryExportProto"; -option java_package = "com.google.cloud.ces.v1"; - -// Settings to describe the BigQuery export behaviors for the app. -message BigQueryExportSettings { - // Optional. Indicates whether the BigQuery export is enabled. - bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The project ID of the BigQuery dataset to export the data to. - // - // Note: If the BigQuery dataset is in a different project from the app, - // you should grant `roles/bigquery.admin` role to the CES service agent - // `service-@gcp-sa-ces.iam.gserviceaccount.com`. - string project = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The BigQuery dataset to export the data to. - string dataset = 3 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/changelog.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/changelog.proto deleted file mode 100644 index 5b20de06e94..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/changelog.proto +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "ChangelogProto"; -option java_package = "com.google.cloud.ces.v1"; - -// Changelogs represent a change made to the app or to an resource within the -// app. -message Changelog { - option (google.api.resource) = { - type: "ces.googleapis.com/Changelog" - pattern: "projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}" - plural: "changelogs" - singular: "changelog" - }; - - // Identifier. The unique identifier of the changelog. - // Format: - // `projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Output only. Email address of the change author. - string author = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Display name of the change. It typically should be the display - // name of the resource that was changed. - string display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Description of the change. which typically captures the - // changed fields in the resource. - string description = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The resource that was changed. - string resource = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The type of the resource that was changed. - string resource_type = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The action that was performed on the resource. - string action = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The original resource before the change. - google.protobuf.Struct original_resource = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The new resource after the change. - google.protobuf.Struct new_resource = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The dependent resources that were changed. - repeated google.protobuf.Struct dependent_resources = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the change was made. - google.protobuf.Timestamp create_time = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The monotonically increasing sequence number of the changelog. - int64 sequence_number = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/client_function.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/client_function.proto deleted file mode 100644 index 02b793a4ba8..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/client_function.proto +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/cloud/ces/v1/schema.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "ClientFunctionProto"; -option java_package = "com.google.cloud.ces.v1"; - -// Represents a client-side function that the agent can invoke. When the -// tool is chosen by the agent, control is handed off to the client. -// The client is responsible for executing the function and returning the result -// as a [ToolResponse][google.cloud.ces.v1.ToolResponse] to continue the -// interaction with the agent. -message ClientFunction { - // Required. The function name. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The function description. - string description = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The schema of the function parameters. - Schema parameters = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The schema of the function response. - Schema response = 4 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/common.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/common.proto deleted file mode 100644 index c5e638848cd..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/common.proto +++ /dev/null @@ -1,344 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "CommonProto"; -option java_package = "com.google.cloud.ces.v1"; -option (google.api.resource_definition) = { - type: "servicedirectory.googleapis.com/Service" - pattern: "projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}" -}; - -// The execution type of the tool or toolset. -enum ExecutionType { - // The execution type is unspecified. Defaults to `SYNCHRONOUS` if - // unspecified. - EXECUTION_TYPE_UNSPECIFIED = 0; - - // The tool is executed synchronously. The session is blocked - // until the tool returns. - SYNCHRONOUS = 1; - - // The tool is executed asynchronously. The session will - // continue while the tool is executing. - ASYNCHRONOUS = 2; -} - -// A callback defines the custom logic to be executed at various stages of -// agent interaction. -message Callback { - // The callback to execute. - oneof callback { - // Required. The python code to execute for the callback. - string python_code = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Optional. Human-readable description of the callback. - string description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether the callback is disabled. Disabled callbacks are ignored - // by the agent. - bool disabled = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If enabled, the callback will also be executed on intermediate - // model outputs. This setting only affects after model callback. - // **ENABLE WITH CAUTION**. Typically after model callback only needs to be - // executed after receiving all model responses. Enabling proactive execution - // may have negative implication on the execution cost and latency, and - // should only be enabled in rare situations. - bool proactive_execution_enabled = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Model settings contains various configurations for the LLM model. -message ModelSettings { - // Optional. The LLM model that the agent should use. - // If not set, the agent will inherit the model from its parent agent. - string model = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, this temperature will be used for the LLM model. - // Temperature controls the randomness of the model's responses. Lower - // temperatures produce responses that are more predictable. Higher - // temperatures produce responses that are more creative. - optional double temperature = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Action that is taken when a certain precondition is met. -message TriggerAction { - // Represents a response from the agent. - message Response { - // Required. Text for the agent to respond with. - string text = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Whether the response is disabled. Disabled responses are not - // used by the agent. - bool disabled = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // The agent will immediately respond with a preconfigured response. - message RespondImmediately { - // Required. The canned responses for the agent to choose from. The response - // is chosen randomly. - repeated Response responses = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // The agent will immediately respond with a generative answer. - message GenerativeAnswer { - // Required. The prompt to use for the generative answer. - string prompt = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // The agent will transfer the conversation to a different agent. - message TransferAgent { - // Required. The name of the agent to transfer the conversation to. The - // agent must be in the same app as the current agent. Format: - // `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` - string agent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } - ]; - } - - // The action to take. - oneof action { - // Optional. Immediately respond with a preconfigured response. - RespondImmediately respond_immediately = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Transfer the conversation to a different agent. - TransferAgent transfer_agent = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Respond with a generative answer. - GenerativeAnswer generative_answer = 3 - [(google.api.field_behavior) = OPTIONAL]; - } -} - -// The TLS configuration. -message TlsConfig { - // The CA certificate. - message CaCert { - // Required. The name of the allowed custom CA certificates. This - // can be used to disambiguate the custom CA certificates. - string display_name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The allowed custom CA certificates (in DER format) for - // HTTPS verification. This overrides the default SSL trust store. If this - // is empty or unspecified, CES will use Google's default trust - // store to verify certificates. N.B. Make sure the HTTPS server - // certificates are signed with "subject alt name". For instance a - // certificate can be self-signed using the following command, - // openssl x509 -req -days 200 -in example.com.csr \ - // -signkey example.com.key \ - // -out example.com.crt \ - // -extfile <(printf "\nsubjectAltName='DNS:www.example.com'") - bytes cert = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Required. Specifies a list of allowed custom CA certificates for HTTPS - // verification. - repeated CaCert ca_certs = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Configuration for tools using Service Directory. -message ServiceDirectoryConfig { - // Required. The name of [Service - // Directory](https://cloud.google.com/service-directory) service. - // Format: - // `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}`. - // Location of the service directory must be the same as the location of the - // app. - string service = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "servicedirectory.googleapis.com/Service" - } - ]; -} - -// A ChannelProfile configures the agent's behavior for a specific communication -// channel, such as web UI or telephony. -message ChannelProfile { - // Represents the persona property of a channel. - message PersonaProperty { - // The persona of the channel. - enum Persona { - // UNKNOWN persona. - UNKNOWN = 0; - - // The agent keeps the responses concise and to the point - CONCISE = 1; - - // The agent provides additional context, explanations, and details - CHATTY = 2; - } - - // Optional. The persona of the channel. - Persona persona = 1 [(google.api.field_behavior) = OPTIONAL]; - } - - // Message for configuration for the web widget. - message WebWidgetConfig { - // Security settings for the web widget. - message SecuritySettings { - // Optional. Indicates whether public access to the web widget is enabled. - // If `true`, the web widget will be publicly accessible. - // If `false`, the web widget must be integrated with your own - // authentication and authorization system to return valid credentials for - // accessing the CES agent. - bool enable_public_access = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicates whether origin check for the web widget is enabled. - // If `true`, the web widget will check the origin of the website that - // loads the web widget and only allow it to be loaded in the same origin - // or any of the allowed origins. - bool enable_origin_check = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The origins that are allowed to host the web widget. An - // origin is defined by RFC 6454. If empty, all origins are allowed. A - // maximum of 100 origins is allowed. Example: "https://example.com" - repeated string allowed_origins = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicates whether reCAPTCHA verification for the web widget - // is enabled. - bool enable_recaptcha = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // Modality of the web widget. - enum Modality { - // Unknown modality. - MODALITY_UNSPECIFIED = 0; - - // Widget supports both chat and voice input. - CHAT_AND_VOICE = 1; - - // Widget supports only voice input. - VOICE_ONLY = 2; - - // Widget supports only chat input. - CHAT_ONLY = 3; - } - - // Theme of the web widget. - enum Theme { - // Unknown theme. - THEME_UNSPECIFIED = 0; - - // Light theme. - LIGHT = 1; - - // Dark theme. - DARK = 2; - } - - // Optional. The modality of the web widget. - Modality modality = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The theme of the web widget. - Theme theme = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The title of the web widget. - string web_widget_title = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The security settings of the web widget. - SecuritySettings security_settings = 4 - [(google.api.field_behavior) = OPTIONAL]; - } - - // The type of the channel profile. - enum ChannelType { - // Unknown channel type. - UNKNOWN = 0; - - // Web UI channel. - WEB_UI = 2; - - // API channel. - API = 3; - - // Twilio channel. - TWILIO = 4; - - // Google Telephony Platform channel. - GOOGLE_TELEPHONY_PLATFORM = 5; - - // Contact Center as a Service (CCaaS) channel. - CONTACT_CENTER_AS_A_SERVICE = 6; - - // Five9 channel. - FIVE9 = 7; - } - - // Optional. The unique identifier of the channel profile. - string profile_id = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The type of the channel profile. - ChannelType channel_type = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The persona property of the channel profile. - PersonaProperty persona_property = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether to disable DTMF (dual-tone multi-frequency). - bool disable_dtmf = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether to disable user barge-in control in the conversation. - // - **true**: User interruptions are disabled while the agent is speaking. - // - **false**: The agent retains automatic control over when the user can - // interrupt. - bool disable_barge_in_control = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The configuration for the web widget. - WebWidgetConfig web_widget_config = 7 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The noise suppression level of the channel profile. - // Available values are "low", "moderate", "high", "very_high". - string noise_suppression_level = 8 [(google.api.field_behavior) = OPTIONAL]; -} - -// A span is a unit of work or a single operation during the request processing. -message Span { - // Output only. The name of the span. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The start time of the span. - google.protobuf.Timestamp start_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The end time of the span. - google.protobuf.Timestamp end_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The duration of the span. - google.protobuf.Duration duration = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Key-value attributes associated with the span. - google.protobuf.Struct attributes = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The child spans that are nested under this span. - repeated Span child_spans = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/connector_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/connector_tool.proto deleted file mode 100644 index a0a98bfd7a1..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/connector_tool.proto +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/cloud/ces/v1/auth.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "ConnectorToolProto"; -option java_package = "com.google.cloud.ces.v1"; - -// Configuration of an Action for the tool to use. -// Note: This can be either an Action or an Operation. See -// https://cloud.google.com/integration-connectors/docs/entities-operation-action -// for details. -message Action { - // Entity CRUD operation specification. - message EntityOperation { - // The operation to perform on the entity. - enum OperationType { - // Operation type unspecified. Invalid, ConnectorTool create/update - // will fail. - OPERATION_TYPE_UNSPECIFIED = 0; - - // List operation. - LIST = 1; - - // Get operation. - GET = 2; - - // Create operation. - CREATE = 3; - - // Update operation. - UPDATE = 4; - - // Delete operation. - DELETE = 5; - } - - // Required. ID of the entity. - string entity_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Operation to perform on the entity. - OperationType operation = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Specification for an action to configure for the tool to use. - oneof action_spec { - // ID of a Connection action for the tool to use. - string connection_action_id = 4; - - // Entity operation configuration for the tool to use. - EntityOperation entity_operation = 5; - } - - // Optional. Entity fields to use as inputs for the operation. - // If no fields are specified, all fields of the Entity will be used. - repeated string input_fields = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Entity fields to return from the operation. - // If no fields are specified, all fields of the Entity will be returned. - repeated string output_fields = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// A ConnectorTool allows connections to different integrations. -// See: https://cloud.google.com/integration-connectors/docs/overview. -message ConnectorTool { - // Required. The full resource name of the referenced Integration Connectors - // Connection. - // Format: - // `projects/{project}/locations/{location}/connections/{connection}` - string connection = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Action for the tool to use. - Action action = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Configures how authentication is handled in Integration - // Connectors. By default, an admin authentication is passed in the - // Integration Connectors API requests. You can override it with a different - // end-user authentication config. - // **Note**: The Connection must have authentication override enabled in - // order to specify an EUC configuration here - otherwise, the ConnectorTool - // creation will fail. See - // https://cloud.google.com/application-integration/docs/configure-connectors-task#configure-authentication-override - // for details. - EndUserAuthConfig auth_config = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The name of the tool that can be used by the Agent to decide - // whether to call this ConnectorTool. - string name = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The description of the tool that can be used by the Agent to - // decide whether to call this ConnectorTool. - string description = 5 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/connector_toolset.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/connector_toolset.proto deleted file mode 100644 index e30b9e651de..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/connector_toolset.proto +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/cloud/ces/v1/auth.proto"; -import "google/cloud/ces/v1/connector_tool.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "ConnectorToolsetProto"; -option java_package = "com.google.cloud.ces.v1"; - -// A toolset that generates tools from an Integration Connectors Connection. -message ConnectorToolset { - // Required. The full resource name of the referenced Integration Connectors - // Connection. - // Format: - // `projects/{project}/locations/{location}/connections/{connection}` - string connection = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Configures how authentication is handled in Integration - // Connectors. By default, an admin authentication is passed in the - // Integration Connectors API requests. You can override it with a different - // end-user authentication config. - // **Note**: The Connection must have authentication override enabled in - // order to specify an EUC configuration here - otherwise, the Toolset - // creation will fail. See: - // https://cloud.google.com/application-integration/docs/configure-connectors-task#configure-authentication-override - EndUserAuthConfig auth_config = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The list of connector actions/entity operations to generate tools - // for. - repeated Action connector_actions = 3 - [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/conversation.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/conversation.proto deleted file mode 100644 index 6630ac30c73..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/conversation.proto +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/ces/v1/common.proto"; -import "google/cloud/ces/v1/example.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "ConversationProto"; -option java_package = "com.google.cloud.ces.v1"; - -// A conversation represents an interaction between an end user and the CES app. -message Conversation { - option (google.api.resource) = { - type: "ces.googleapis.com/Conversation" - pattern: "projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}" - plural: "conversations" - singular: "conversation" - }; - - // All information about a single turn in the conversation. - message Turn { - // Optional. List of messages in the conversation turn, including user - // input, agent responses and intermediate events during the processing. - repeated Message messages = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The root span of the action processing. - Span root_span = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // The channel type of the conversation. - enum ChannelType { - // Unspecified channel type. - CHANNEL_TYPE_UNSPECIFIED = 0; - - // The conversation only contains text messages between the end user and the - // agent. - TEXT = 1; - - // The conversation contains audio messages between the end user and the - // agent. - AUDIO = 2; - - // The conversation multi-modal messages (e.g. image) between the end user - // and the agent. - MULTIMODAL = 3; - } - - // The source of the conversation. - enum Source { - // Unspecified source. - SOURCE_UNSPECIFIED = 0; - - // The conversation is from the live end user. - LIVE = 1; - - // The conversation is from the simulator. - SIMULATOR = 2; - - // The conversation is from the evaluation. - EVAL = 3; - } - - // Type of the input message. - enum InputType { - // Unspecified input type. - INPUT_TYPE_UNSPECIFIED = 0; - - // The input message is text. - INPUT_TYPE_TEXT = 1; - - // The input message is audio. - INPUT_TYPE_AUDIO = 2; - - // The input message is image. - INPUT_TYPE_IMAGE = 3; - - // The input message is blob file. - INPUT_TYPE_BLOB = 4; - - // The input message is client function tool response. - INPUT_TYPE_TOOL_RESPONSE = 5; - - // The input message are variables. - INPUT_TYPE_VARIABLES = 6; - } - - // Identifier. The unique identifier of the conversation. - // Format: - // `projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Output only. Timestamp when the conversation was created. - google.protobuf.Timestamp start_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when the conversation was completed. - google.protobuf.Timestamp end_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The turns in the conversation. - repeated Turn turns = 6 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The number of turns in the conversation. - int32 turn_count = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // DEPRECATED. Please use - // [input_types][google.cloud.ces.v1.Conversation.input_types] instead. - ChannelType channel_type = 8 [deprecated = true]; - - // Output only. Indicate the source of the conversation. - Source source = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The input types of the conversation. - repeated InputType input_types = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The agent that initially handles the conversation. If not - // specified, the conversation is handled by the root agent. Format: - // `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` - string entry_agent = 11 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } - ]; - - // Output only. The deployment of the app used for processing the - // conversation. Format: - // `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` - string deployment = 12 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "ces.googleapis.com/Deployment" } - ]; - - // Output only. The version of the app used for processing the conversation. - // Format: - // `projects/{project}/locations/{location}/apps/{app}/versions/{version}` - string app_version = 13 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "ces.googleapis.com/AppVersion" } - ]; - - // Output only. The language code of the conversation. - string language_code = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Deprecated. Use turns instead. - repeated Message messages = 2 [deprecated = true]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/data_store.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/data_store.proto deleted file mode 100644 index 08772a55ba4..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/data_store.proto +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "DataStoreProto"; -option java_package = "com.google.cloud.ces.v1"; - -// A DataStore resource in Vertex AI Search. -message DataStore { - // The connector config for the data store connection. - message ConnectorConfig { - // Resource name of the collection the data store belongs to. - string collection = 1; - - // Display name of the collection the data store belongs to. - string collection_display_name = 2; - - // The name of the data source. - // Example: `salesforce`, `jira`, `confluence`, `bigquery`. - string data_source = 3; - } - - // The type of the data store. - enum DataStoreType { - // Not specified. This value indicates that the data store type is not - // specified, so it will not be used during search. - DATA_STORE_TYPE_UNSPECIFIED = 0; - - // A data store that contains public web content. - PUBLIC_WEB = 1; - - // A data store that contains unstructured private data. - UNSTRUCTURED = 2; - - // A data store that contains structured data used as FAQ. - FAQ = 3; - - // A data store that is a connector to a first-party or a third-party - // service. - CONNECTOR = 4; - } - - // The document processing mode of the data store. - enum DocumentProcessingMode { - // Not specified. - DOCUMENT_PROCESSING_MODE_UNSPECIFIED = 0; - - // Documents are processed as documents. - DOCUMENTS = 1; - - // Documents are converted to chunks. - CHUNKS = 2; - } - - // Required. Full resource name of the DataStore. - // Format: - // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The type of the data store. This field is readonly and - // populated by the server. - DataStoreType type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The document processing mode for the data store connection. - // Only set for PUBLIC_WEB and UNSTRUCTURED data stores. - DocumentProcessingMode document_processing_mode = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The display name of the data store. - string display_name = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when the data store was created. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The connector config for the data store connection. - ConnectorConfig connector_config = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/data_store_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/data_store_tool.proto deleted file mode 100644 index 23c9ca00ade..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/data_store_tool.proto +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/cloud/ces/v1/common.proto"; -import "google/cloud/ces/v1/data_store.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "DataStoreToolProto"; -option java_package = "com.google.cloud.ces.v1"; - -// Tool to retrieve from Vertex AI Search datastore or engine for grounding. -// Accepts either a datastore or an engine, but not both. -// See Vertex AI Search: -// https://cloud.google.com/generative-ai-app-builder/docs/enterprise-search-introduction. -message DataStoreTool { - // Rewriter configuration. - message RewriterConfig { - // Required. Configurations for the LLM model. - ModelSettings model_settings = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The prompt definition. If not set, default prompt will be used. - string prompt = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether the rewriter is disabled. - bool disabled = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // Summarization configuration. - message SummarizationConfig { - // Optional. Configurations for the LLM model. - ModelSettings model_settings = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The prompt definition. If not set, default prompt will be used. - string prompt = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether summarization is disabled. - bool disabled = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // Grounding configuration. - message GroundingConfig { - // Optional. The groundedness threshold of the answer based on the retrieved - // sources. The value has a configurable range of [1, 5]. The level is used - // to threshold the groundedness of the answer, meaning that all responses - // with a groundedness score below the threshold will fall back to returning - // relevant snippets only. - // - // For example, a level of 3 means that the groundedness score must be - // 3 or higher for the response to be returned. - float grounding_level = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether grounding is disabled. - bool disabled = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration for searching within a specific DataStore. - message DataStoreSource { - // Optional. Filter specification for the DataStore. - // See: - // https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The data store. - DataStore data_store = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration for searching within an Engine, potentially targeting - // specific DataStores. - message EngineSource { - // Required. Full resource name of the Engine. - // Format: - // `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` - string engine = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Use to target specific DataStores within the Engine. - // If empty, the search applies to all DataStores associated with the - // Engine. - repeated DataStoreSource data_store_sources = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A filter applied to the search across the Engine. Not relevant - // and not used if 'data_store_sources' is provided. See: - // https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata - string filter = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // Boost specifications to boost certain documents. - // For more information, please refer to - // https://cloud.google.com/generative-ai-app-builder/docs/boosting. - message BoostSpecs { - // Required. The Data Store where the boosting configuration is applied. - // Full resource name of DataStore, such as - // projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}. - repeated string data_stores = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A list of boosting specifications. - repeated BoostSpec spec = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Boost specification to boost certain documents. - message BoostSpec { - // Boost specification for a condition. - message ConditionBoostSpec { - // Specification for custom ranking based on customer specified attribute - // value. It provides more controls for customized ranking than the simple - // (condition, boost) combination above. - message BoostControlSpec { - // The control points used to define the curve. The curve defined - // through these control points can only be monotonically increasing - // or decreasing(constant values are acceptable). - message ControlPoint { - // Optional. Can be one of: - // 1. The numerical field value. - // 2. The duration spec for freshness: - // The value must be formatted as an XSD `dayTimeDuration` value (a - // restricted subset of an ISO 8601 duration value). The pattern for - // this is: `[nD][T[nH][nM][nS]]`. - string attribute_value = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The value between -1 to 1 by which to boost the score if - // the attribute_value evaluates to the value specified above. - float boost_amount = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // The attribute(or function) for which the custom ranking is to be - // applied. - enum AttributeType { - // Unspecified AttributeType. - ATTRIBUTE_TYPE_UNSPECIFIED = 0; - - // The value of the numerical field will be used to dynamically update - // the boost amount. In this case, the attribute_value (the x value) - // of the control point will be the actual value of the numerical - // field for which the boost_amount is specified. - NUMERICAL = 1; - - // For the freshness use case the attribute value will be the duration - // between the current time and the date in the datetime field - // specified. The value must be formatted as an XSD `dayTimeDuration` - // value (a restricted subset of an ISO 8601 duration value). The - // pattern for this is: `[nD][T[nH][nM][nS]]`. - // E.g. `5D`, `3DT12H30M`, `T24H`. - FRESHNESS = 2; - } - - // The interpolation type to be applied. Default will be linear - // (Piecewise Linear). - enum InterpolationType { - // Interpolation type is unspecified. In this case, it defaults to - // Linear. - INTERPOLATION_TYPE_UNSPECIFIED = 0; - - // Piecewise linear interpolation will be applied. - LINEAR = 1; - } - - // Optional. The name of the field whose value will be used to determine - // the boost amount. - string field_name = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The attribute type to be used to determine the boost - // amount. The attribute value can be derived from the field value of - // the specified field_name. In the case of numerical it is - // straightforward i.e. attribute_value = numerical_field_value. In the - // case of freshness however, attribute_value = (time.now() - - // datetime_field_value). - AttributeType attribute_type = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The interpolation type to be applied to connect the control - // points listed below. - InterpolationType interpolation_type = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The control points used to define the curve. The monotonic - // function (defined through the interpolation_type above) passes - // through the control points listed here. - repeated ControlPoint control_points = 4 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. An expression which specifies a boost condition. The syntax - // is the same as filter expression syntax. Currently, the only supported - // condition is a list of BCP-47 lang codes. Example: To boost suggestions - // in languages en or fr: (lang_code: ANY("en", "fr")) - string condition = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Strength of the boost, which should be in [-1, 1]. Negative - // boost means demotion. Default is 0.0. - // - // Setting to 1.0 gives the suggestions a big promotion. However, it does - // not necessarily mean that the top result will be a boosted suggestion. - // - // Setting to -1.0 gives the suggestions a big demotion. However, other - // suggestions that are relevant might still be shown. - // - // Setting to 0.0 means no boost applied. The boosting condition is - // ignored. - float boost = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Complex specification for custom ranking based on customer - // defined attribute value. - BoostControlSpec boost_control_spec = 4 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. A list of boosting specifications. - repeated ConditionBoostSpec condition_boost_specs = 1 - [(google.api.field_behavior) = REQUIRED]; - } - - // If specified, will apply the given configuration for the specified - // modality. - message ModalityConfig { - // The modality type. - enum ModalityType { - // Unspecified modality type. - MODALITY_TYPE_UNSPECIFIED = 0; - - // Text modality. - TEXT = 1; - - // Audio modality. - AUDIO = 2; - } - - // Required. The modality type. - ModalityType modality_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The rewriter config. - RewriterConfig rewriter_config = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The summarization config. - SummarizationConfig summarization_config = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The grounding configuration. - GroundingConfig grounding_config = 4 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Filter parameter behavior. - enum FilterParameterBehavior { - // Default filter behavior. - // Include filter parameter for connector datastores. - // For the rest of the datastore types, the filter input parameter is - // omitted. - FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED = 0; - - // Always include filter parameter for all datastore types. - ALWAYS_INCLUDE = 2; - - // The filter parameter is never included in the list of tool parameters, - // regardless of the datastore type. - NEVER_INCLUDE = 3; - } - - // Defines the search source, either a single DataStore or an Engine. - oneof search_source { - // Optional. Search within a single specific DataStore. - DataStoreSource data_store_source = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Search within an Engine (potentially across multiple - // DataStores). - EngineSource engine_source = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. The data store tool name. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The tool description. - string description = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Boost specification to boost certain documents. - repeated BoostSpecs boost_specs = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The modality configs for the data store. - repeated ModalityConfig modality_configs = 9 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The filter parameter behavior. - FilterParameterBehavior filter_parameter_behavior = 10 - [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/deployment.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/deployment.proto deleted file mode 100644 index 0edb8ebdb68..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/deployment.proto +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/ces/v1/common.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "ChannelProfileProto"; -option java_package = "com.google.cloud.ces.v1"; - -// A deployment represents an immutable, queryable version of the app. -// It is used to deploy an app version with a specific channel profile. -message Deployment { - option (google.api.resource) = { - type: "ces.googleapis.com/Deployment" - pattern: "projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}" - plural: "deployments" - singular: "deployment" - }; - - // Identifier. The resource name of the deployment. - // Format: - // projects/{project}/locations/{location}/apps/{app}/deployments/{deployment} - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. Display name of the deployment. - string display_name = 8 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource name of the app version to deploy. - // Format: - // projects/{project}/locations/{location}/apps/{app}/versions/{version} - string app_version = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/AppVersion" } - ]; - - // Required. The channel profile used in the deployment. - ChannelProfile channel_profile = 3 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Timestamp when this deployment was created. - google.protobuf.Timestamp create_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this deployment was last updated. - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Etag used to ensure the object hasn't changed during a - // read-modify-write operation. If the etag is empty, the update will - // overwrite any concurrent changes. - string etag = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/example.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/example.proto deleted file mode 100644 index 8f5097320f5..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/example.proto +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/ces/v1/toolset_tool.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "ExampleProto"; -option java_package = "com.google.cloud.ces.v1"; - -// An example represents a sample conversation between the user and the -// agent(s). -message Example { - option (google.api.resource) = { - type: "ces.googleapis.com/Example" - pattern: "projects/{project}/locations/{location}/apps/{app}/examples/{example}" - plural: "examples" - singular: "example" - }; - - // Identifier. The unique identifier of the example. - // Format: - // `projects/{project}/locations/{location}/apps/{app}/examples/{example}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. Display name of the example. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Human-readable description of the example. - string description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The agent that initially handles the conversation. If not - // specified, the example represents a conversation that is handled by the - // root agent. Format: - // `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` - string entry_agent = 4 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } - ]; - - // Optional. The collection of messages that make up the conversation. - repeated Message messages = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Timestamp when the example was created. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when the example was last updated. - google.protobuf.Timestamp update_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The example may become invalid if referencing resources are - // deleted. Invalid examples will not be used as few-shot examples. - bool invalid = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Etag used to ensure the object hasn't changed during a read-modify-write - // operation. If the etag is empty, the update will overwrite any concurrent - // changes. - string etag = 9; -} - -// A message within a conversation. -message Message { - // Optional. The role within the conversation, e.g., user, agent. - string role = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Content of the message as a series of chunks. - repeated Chunk chunks = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Timestamp when the message was sent or received. Should not be - // used if the message is part of an [example][google.cloud.ces.v1.Example]. - google.protobuf.Timestamp event_time = 4 - [(google.api.field_behavior) = OPTIONAL]; -} - -// A chunk of content within a message. -message Chunk { - // Chunk data. - oneof data { - // Optional. Text data. - string text = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Transcript associated with the audio. - string transcript = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Custom payload data. - google.protobuf.Struct payload = 11 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Image data. - Image image = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Tool execution request. - ToolCall tool_call = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Tool execution response. - ToolResponse tool_response = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Agent transfer event. - AgentTransfer agent_transfer = 4 [(google.api.field_behavior) = OPTIONAL]; - - // A struct represents variables that were updated in the conversation, - // keyed by variable names. - google.protobuf.Struct updated_variables = 8; - - // A struct represents default variables at the start of the conversation, - // keyed by variable names. - google.protobuf.Struct default_variables = 10; - } -} - -// Represents a blob input or output in the conversation. -message Blob { - // Required. The IANA standard MIME type of the source data. - string mime_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Raw bytes of the blob. - bytes data = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Represents an image input or output in the conversation. -message Image { - // Required. The IANA standard MIME type of the source data. - // Supported image types includes: - // * image/png - // * image/jpeg - // * image/webp - string mime_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Raw bytes of the image. - bytes data = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for the client or the agent to execute the specified tool. -message ToolCall { - // The identifier of the tool to execute. It could be either a persisted tool - // or a tool from a toolset. - oneof tool_identifier { - // Optional. The name of the tool to execute. - // Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` - string tool = 2 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } - ]; - - // Optional. The toolset tool to execute. - ToolsetTool toolset_tool = 5 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. The unique identifier of the tool call. If populated, the client - // should return the execution result with the matching ID in - // [ToolResponse][google.cloud.ces.v1.ToolResponse.id]. - string id = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Display name of the tool. - string display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The input parameters and values for the tool in JSON object - // format. - google.protobuf.Struct args = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// The execution result of a specific tool from the client or the agent. -message ToolResponse { - // The identifier of the tool that got executed. It could be either a - // persisted tool or a tool from a toolset. - oneof tool_identifier { - // Optional. The name of the tool to execute. - // Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` - string tool = 2 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } - ]; - - // Optional. The toolset tool that got executed. - ToolsetTool toolset_tool = 5 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. The matching ID of the [tool call][google.cloud.ces.v1.ToolCall] - // the response is for. - string id = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Display name of the tool. - string display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The tool execution result in JSON object format. - // Use "output" key to specify tool response and "error" key to specify - // error details (if any). If "output" and "error" keys are not specified, - // then whole "response" is treated as tool execution result. - google.protobuf.Struct response = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Represents an event indicating the transfer of a conversation to a different -// agent. -message AgentTransfer { - // Required. The agent to which the conversation is being transferred. The - // agent will handle the conversation from this point forward. Format: - // `projects/{project}/locations/{location}/apps/{app}/agents/{agent}` - string target_agent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } - ]; - - // Output only. Display name of the agent. - string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/fakes.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/fakes.proto deleted file mode 100644 index da813b58452..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/fakes.proto +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "FakesProto"; -option java_package = "com.google.cloud.ces.v1"; - -// A code block to be executed instead of a real tool call. -message CodeBlock { - // Required. Python code which will be invoked in tool fake mode. - // Expected Python function signature - - // To catch all tool calls: - // def fake_tool_call(tool: Tool, input: dict[str, Any], - // callback_context: CallbackContext) -> Optional[dict[str, Any]]: - // To catch a specific tool call: - // def fake_{tool_id}(tool: Tool, input: dict[str, Any], - // callback_context: CallbackContext) -> Optional[dict[str, Any]]: - // If the function returns None, the real tool will be invoked instead. - string python_code = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Configuration for tool behavior in fake mode. -message ToolFakeConfig { - // The response is either static or it is provided by a python function. - oneof tool_response { - // Optional. Code block which will be executed instead of a real tool call. - CodeBlock code_block = 1 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. Whether the tool is using fake mode. - bool enable_fake_mode = 2 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/file_search_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/file_search_tool.proto deleted file mode 100644 index 5e7da9cc765..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/file_search_tool.proto +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.ces.v1; - -import "google/api/field_behavior.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "FileSearchToolProto"; -option java_package = "com.google.cloud.ces.v1"; - -// The file search tool allows the agent to search across the files uploaded by -// the app/agent developer. It has presets to give relatively good quality -// search over the uploaded files and summarization of the retrieved results. -message FileSearchTool { - // The type of the Vertex RAG corpus. - enum CorpusType { - // Unspecified corpus type. - CORPUS_TYPE_UNSPECIFIED = 0; - - // The corpus is created and owned by the user. - USER_OWNED = 1; - - // The corpus is created by the agent. - FULLY_MANAGED = 2; - } - - // Optional. The type of the corpus. Default is FULLY_MANAGED. - CorpusType corpus_type = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The tool name. - string name = 4 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The tool description. - string description = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The corpus where files are stored. - // Format: - // projects/{project}/locations/{location}/ragCorpora/{rag_corpus} - string file_corpus = 6 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/google_search_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/google_search_tool.proto deleted file mode 100644 index fa3bceb359b..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/google_search_tool.proto +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "GoogleSearchToolProto"; -option java_package = "com.google.cloud.ces.v1"; - -// Represents a tool to perform Google web searches for grounding. -// See -// https://cloud.google.com/customer-engagement-ai/conversational-agents/ps/tool#google-search. -message GoogleSearchTool { - // Prompt settings used by the model when processing or summarizing the - // google search results. - message PromptConfig { - // Optional. Defines the prompt used for the system instructions when - // interacting with the agent in chat conversations. If not set, default - // prompt will be used. - string text_prompt = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Defines the prompt used for the system instructions when - // interacting with the agent in voice conversations. If not set, default - // prompt will be used. - string voice_prompt = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. The name of the tool. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Description of the tool's purpose. - string description = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Content will be fetched directly from these URLs for context and - // grounding. Example: "https://example.com/path.html". A maximum of 20 URLs - // are allowed. - repeated string context_urls = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies domains to restrict search results to. - // Example: "example.com", "another.site". A maximum of 20 domains can be - // specified. - repeated string preferred_domains = 6 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of domains to be excluded from the search results. - // Example: "example.com". - // A maximum of 2000 domains can be excluded. - repeated string exclude_domains = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Prompt instructions passed to planner on how the search results - // should be processed for text and voice. - PromptConfig prompt_config = 5 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/guardrail.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/guardrail.proto deleted file mode 100644 index b964860c5b9..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/guardrail.proto +++ /dev/null @@ -1,311 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/ces/v1/common.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "GuardrailProto"; -option java_package = "com.google.cloud.ces.v1"; - -// Guardrail contains a list of checks and balances to keep the agents safe and -// secure. -message Guardrail { - option (google.api.resource) = { - type: "ces.googleapis.com/Guardrail" - pattern: "projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}" - plural: "guardrails" - singular: "guardrail" - }; - - // Guardrail that bans certain content from being used in the conversation. - message ContentFilter { - // Match type for the content filter. - enum MatchType { - // Match type is not specified. - MATCH_TYPE_UNSPECIFIED = 0; - - // Content is matched for substrings character by character. - SIMPLE_STRING_MATCH = 1; - - // Content only matches if the pattern found in the text is - // surrounded by word delimiters. Banned phrases can also contain word - // delimiters. - WORD_BOUNDARY_STRING_MATCH = 2; - - // Content is matched using regular expression syntax. - REGEXP_MATCH = 3; - } - - // Optional. List of banned phrases. Applies to both user inputs and agent - // responses. - repeated string banned_contents = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of banned phrases. Applies only to user inputs. - repeated string banned_contents_in_user_input = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of banned phrases. Applies only to agent responses. - repeated string banned_contents_in_agent_response = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. Match type for the content filter. - MatchType match_type = 4 [(google.api.field_behavior) = REQUIRED]; - - // Optional. If true, diacritics are ignored during matching. - bool disregard_diacritics = 5 [(google.api.field_behavior) = OPTIONAL]; - } - - // Guardrail that blocks the conversation if the input is considered unsafe - // based on the LLM classification. - message LlmPromptSecurity { - // Configuration for default system security settings. - message DefaultSecuritySettings { - // Output only. The default prompt template used by the system. - // This field is for display purposes to show the user what prompt - // the system uses by default. It is OUTPUT_ONLY. - string default_prompt_template = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Defines the security configuration mode. - // The user must choose one of the following configurations. - oneof security_config { - // Optional. Use the system's predefined default security settings. - // To select this mode, include an empty 'default_settings' message - // in the request. The 'default_prompt_template' field within - // will be populated by the server in the response. - DefaultSecuritySettings default_settings = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Use a user-defined LlmPolicy to configure the security - // guardrail. - LlmPolicy custom_policy = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. Determines the behavior when the guardrail encounters an LLM - // error. - // - If true: the guardrail is bypassed. - // - If false (default): the guardrail triggers/blocks. - // - // Note: If a custom policy is provided, this field is ignored in favor - // of the policy's 'fail_open' configuration. - bool fail_open = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // Guardrail that blocks the conversation if the LLM response is considered - // violating the policy based on the LLM classification. - message LlmPolicy { - // Defines when to apply the policy check during the conversation. - enum PolicyScope { - // Policy scope is not specified. - POLICY_SCOPE_UNSPECIFIED = 0; - - // Policy check is triggered on user input. - USER_QUERY = 1; - - // Policy check is triggered on agent response. Applying this policy - // scope will introduce additional latency before the agent can respond. - AGENT_RESPONSE = 2; - - // Policy check is triggered on both user input and agent response. - // Applying this policy scope will introduce additional latency before - // the agent can respond. - USER_QUERY_AND_AGENT_RESPONSE = 3; - } - - // Optional. When checking this policy, consider the last 'n' messages in - // the conversation. When not set a default value of 10 will be used. - int32 max_conversation_messages = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Model settings. - ModelSettings model_settings = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Policy prompt. - string prompt = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. Defines when to apply the policy check during the conversation. - // If set to `POLICY_SCOPE_UNSPECIFIED`, the policy will be applied to the - // user input. When applying the policy to the agent response, additional - // latency will be introduced before the agent can respond. - PolicyScope policy_scope = 4 [(google.api.field_behavior) = REQUIRED]; - - // Optional. If an error occurs during the policy check, fail open and do - // not trigger the guardrail. - bool fail_open = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. By default, the LLM policy check is bypassed for short - // utterances. Enabling this setting applies the policy check to all - // utterances, including those that would normally be skipped. - bool allow_short_utterance = 6 [(google.api.field_behavior) = OPTIONAL]; - } - - // Model safety settings overrides. When this is set, it will override the - // default settings and trigger the guardrail if the response is considered - // unsafe. - message ModelSafety { - // Safety setting. - message SafetySetting { - // Required. The harm category. - HarmCategory category = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The harm block threshold. - HarmBlockThreshold threshold = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Harm category. - enum HarmCategory { - // The harm category is unspecified. - HARM_CATEGORY_UNSPECIFIED = 0; - - // The harm category is hate speech. - HARM_CATEGORY_HATE_SPEECH = 1; - - // The harm category is dangerous content. - HARM_CATEGORY_DANGEROUS_CONTENT = 2; - - // The harm category is harassment. - HARM_CATEGORY_HARASSMENT = 3; - - // The harm category is sexually explicit content. - HARM_CATEGORY_SEXUALLY_EXPLICIT = 4; - } - - // Probability based thresholds levels for blocking. - enum HarmBlockThreshold { - // Unspecified harm block threshold. - HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0; - - // Block low threshold and above (i.e. block more). - BLOCK_LOW_AND_ABOVE = 1; - - // Block medium threshold and above. - BLOCK_MEDIUM_AND_ABOVE = 2; - - // Block only high threshold (i.e. block less). - BLOCK_ONLY_HIGH = 3; - - // Block none. - BLOCK_NONE = 4; - - // Turn off the safety filter. - OFF = 5; - } - - // Required. List of safety settings. - repeated SafetySetting safety_settings = 1 - [(google.api.field_behavior) = REQUIRED]; - } - - // Guardrail that blocks the conversation based on the code callbacks - // provided. - message CodeCallback { - // Optional. The callback to execute before the agent is called. - // Each callback function is expected to return a structure (e.g., a dict or - // object) containing at least: - // - 'decision': Either 'OK' or 'TRIGGER'. - // - 'reason': A string explaining the decision. - // A 'TRIGGER' decision may halt further processing. - Callback before_agent_callback = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The callback to execute after the agent is called. - // Each callback function is expected to return a structure (e.g., a dict or - // object) containing at least: - // - 'decision': Either 'OK' or 'TRIGGER'. - // - 'reason': A string explaining the decision. - // A 'TRIGGER' decision may halt further processing. - Callback after_agent_callback = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The callback to execute before the model is called. If there - // are multiple calls to the model, the callback will be executed multiple - // times. Each callback function is expected to return a structure (e.g., a - // dict or object) containing at least: - // - 'decision': Either 'OK' or 'TRIGGER'. - // - 'reason': A string explaining the decision. - // A 'TRIGGER' decision may halt further processing. - Callback before_model_callback = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The callback to execute after the model is called. If there are - // multiple calls to the model, the callback will be executed multiple - // times. Each callback function is expected to return a structure (e.g., a - // dict or object) containing at least: - // - 'decision': Either 'OK' or 'TRIGGER'. - // - 'reason': A string explaining the decision. - // A 'TRIGGER' decision may halt further processing. - Callback after_model_callback = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // Guardrail type. - oneof guardrail_type { - // Optional. Guardrail that bans certain content from being used in the - // conversation. - ContentFilter content_filter = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Guardrail that blocks the conversation if the prompt is - // considered unsafe based on the LLM classification. - LlmPromptSecurity llm_prompt_security = 9 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Guardrail that blocks the conversation if the LLM response is - // considered violating the policy based on the LLM classification. - LlmPolicy llm_policy = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Guardrail that blocks the conversation if the LLM response is - // considered unsafe based on the model safety settings. - ModelSafety model_safety = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Guardrail that potentially blocks the conversation based on the - // result of the callback execution. - CodeCallback code_callback = 14 [(google.api.field_behavior) = OPTIONAL]; - } - - // Identifier. The unique identifier of the guardrail. - // Format: - // `projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. Display name of the guardrail. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Description of the guardrail. - string description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether the guardrail is enabled. - bool enabled = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Action to take when the guardrail is triggered. - TriggerAction action = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Timestamp when the guardrail was created. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when the guardrail was last updated. - google.protobuf.Timestamp update_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Etag used to ensure the object hasn't changed during a read-modify-write - // operation. If the etag is empty, the update will overwrite any concurrent - // changes. - string etag = 11; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/mcp_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/mcp_tool.proto deleted file mode 100644 index fddc46e157e..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/mcp_tool.proto +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/cloud/ces/v1/auth.proto"; -import "google/cloud/ces/v1/common.proto"; -import "google/cloud/ces/v1/schema.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "McpToolProto"; -option java_package = "com.google.cloud.ces.v1"; - -// An MCP tool. -// See https://modelcontextprotocol.io/specification/2025-06-18/server/tools for -// more details. -message McpTool { - // Required. The name of the MCP tool. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The description of the MCP tool. - string description = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The schema of the input arguments of the MCP tool. - Schema input_schema = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The schema of the output arguments of the MCP tool. - Schema output_schema = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The server address of the MCP server, e.g., - // "https://example.com/mcp/". If the server is built with the MCP SDK, the - // url should be suffixed with - // "/mcp/". Only Streamable HTTP transport based servers are supported. This - // is the same as the server_address in the McpToolset. See - // https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http - // for more details. - string server_address = 5 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Authentication information required to execute the tool against - // the MCP server. For bearer token authentication, the token applies only to - // tool execution, not to listing tools. This requires that tools can be - // listed without authentication. - ApiAuthentication api_authentication = 6 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The TLS configuration. Includes the custom server certificates - // that the client should trust. - TlsConfig tls_config = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Service Directory configuration for VPC-SC, used to resolve - // service names within a perimeter. - ServiceDirectoryConfig service_directory_config = 8 - [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/mcp_toolset.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/mcp_toolset.proto deleted file mode 100644 index 4f3e3ab8a52..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/mcp_toolset.proto +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/cloud/ces/v1/auth.proto"; -import "google/cloud/ces/v1/common.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "McpToolsetProto"; -option java_package = "com.google.cloud.ces.v1"; - -// A toolset that contains a list of tools that are offered by the MCP -// server. -message McpToolset { - // Required. The address of the MCP server, for example, - // "https://example.com/mcp/". If the server is built with the MCP SDK, the - // url should be suffixed with - // "/mcp/". Only Streamable HTTP transport based servers are supported. See - // https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http - // for more details. - string server_address = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Authentication information required to access tools and execute a - // tool against the MCP server. For bearer token authentication, the token - // applies only to tool execution, not to listing tools. This requires that - // tools can be listed without authentication. - ApiAuthentication api_authentication = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Service Directory configuration for VPC-SC, used to resolve - // service names within a perimeter. - ServiceDirectoryConfig service_directory_config = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The TLS configuration. Includes the custom server certificates - // that the client should trust. - TlsConfig tls_config = 4 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/omnichannel.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/omnichannel.proto deleted file mode 100644 index 562638232c9..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/omnichannel.proto +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "OmnichannelProto"; -option java_package = "com.google.cloud.ces.v1"; - -// Represents an Omnichannel resource. -message Omnichannel { - option (google.api.resource) = { - type: "ces.googleapis.com/Omnichannel" - pattern: "projects/{project}/locations/{location}/omnichannels/{omnichannel}" - plural: "omnichannels" - singular: "omnichannel" - }; - - // Identifier. The unique identifier of the omnichannel resource. - // Format: - // `projects/{project}/locations/{location}/omnichannels/{omnichannel}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. Display name of the omnichannel resource. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Human-readable description of the omnichannel resource. - string description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Timestamp when the omnichannel resource was created. - google.protobuf.Timestamp create_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when the omnichannel resource was last updated. - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Etag used to ensure the object hasn't changed during a - // read-modify-write operation. - string etag = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The integration config for the omnichannel resource. - OmnichannelIntegrationConfig integration_config = 7 - [(google.api.field_behavior) = OPTIONAL]; -} - -// OmnichannelIntegrationConfig contains all App integration configs. -message OmnichannelIntegrationConfig { - // ChannelConfig contains config for various of app integration. - message ChannelConfig { - // The config for the app. - oneof channel_config { - // WhatsApp config. - WhatsappConfig whatsapp_config = 1; - } - } - - // How Omnichannel should receive/reply events from WhatsApp. - message WhatsappConfig { - // The Phone Number ID associated with the WhatsApp Business Account. - string phone_number_id = 1; - - // The phone number used for sending/receiving messages. - string phone_number = 2; - - // The customer's WhatsApp Business Account (WABA) ID. - string whatsapp_business_account_id = 3; - - // The verify token configured in the Meta App Dashboard for webhook - // verification. - string webhook_verify_token = 4; - - // The access token for authenticating API calls to the WhatsApp Cloud API. - // https://developers.facebook.com/docs/whatsapp/business-management-api/get-started/#business-integration-system-user-access-tokens - string whatsapp_business_token = 5; - - // The Meta Business Portfolio (MBP) ID. - // https://www.facebook.com/business/help/1710077379203657 - string meta_business_portfolio_id = 6; - } - - // Configs of subscribers. - message SubscriberConfig { - // The config for the subscriber. - oneof subscriber_config { - // Ces app config. - CesAppConfig ces_app_config = 1; - } - } - - // Configs for CES app. - message CesAppConfig { - // The unique identifier of the CES app. - // Format: `projects/{project}/locations/{location}/apps/{app}` - string app = 1 - [(google.api.resource_reference) = { type: "ces.googleapis.com/App" }]; - } - - // Routing config specify how/who to route app events to a subscriber. - message RoutingConfig { - // The key of the subscriber. - string subscriber_key = 1; - } - - // Optional. Various of configuration for handling App events. - map channel_configs = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Various of subscribers configs. - map subscriber_configs = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The key of routing_configs is a key of `app_configs`, value is a - // `RoutingConfig`, which contains subscriber's key. - map routing_configs = 3 - [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/omnichannel_service.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/omnichannel_service.proto deleted file mode 100644 index eef8c314c25..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/omnichannel_service.proto +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "OmnichannelServiceProto"; -option java_package = "com.google.cloud.ces.v1"; - -// Represents the metadata of the long-running operation. -message OmnichannelOperationMetadata { - // 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. Human-readable status of the operation, if any. - string status_message = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Identifies whether the user has requested cancellation of the - // operation. - bool requested_cancellation = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/open_api_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/open_api_tool.proto deleted file mode 100644 index b5f1b232347..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/open_api_tool.proto +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/cloud/ces/v1/auth.proto"; -import "google/cloud/ces/v1/common.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "OpenApiToolProto"; -option java_package = "com.google.cloud.ces.v1"; - -// A remote API tool defined by an OpenAPI schema. -message OpenApiTool { - // Required. The OpenAPI schema in JSON or YAML format. - string open_api_schema = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The name of the tool. If not provided, the name of the tool will - // be derived from the OpenAPI schema, from `operation.operationId`. - string name = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The description of the tool. If not provided, the description of - // the tool will be derived from the OpenAPI schema, from - // `operation.description` or `operation.summary`. - string description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Authentication information required by the API. - ApiAuthentication api_authentication = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The TLS configuration. Includes the custom server certificates - // that the client will trust. - TlsConfig tls_config = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Service Directory configuration. - ServiceDirectoryConfig service_directory_config = 6 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, the agent will ignore unknown fields in the API - // response. - bool ignore_unknown_fields = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The server URL of the Open API schema. - // This field is only set in tools in the environment dependencies during the - // export process if the schema contains a server url. During the import - // process, if this url is present in the environment dependencies and the - // schema has the $env_var placeholder, it will replace the placeholder in the - // schema. - string url = 8 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/open_api_toolset.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/open_api_toolset.proto deleted file mode 100644 index ffb88c74ecd..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/open_api_toolset.proto +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/cloud/ces/v1/auth.proto"; -import "google/cloud/ces/v1/common.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "OpenApiToolsetProto"; -option java_package = "com.google.cloud.ces.v1"; - -// A toolset that contains a list of tools that are defined by an OpenAPI -// schema. -message OpenApiToolset { - // Required. The OpenAPI schema of the toolset. - string open_api_schema = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Authentication information required by the API. - ApiAuthentication api_authentication = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The TLS configuration. Includes the custom server certificates - TlsConfig tls_config = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Service Directory configuration. - ServiceDirectoryConfig service_directory_config = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, the agent will ignore unknown fields in the API response - // for all operations defined in the OpenAPI schema. - bool ignore_unknown_fields = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The server URL of the Open API schema. - // This field is only set in toolsets in the environment dependencies during - // the export process if the schema contains a server url. During the import - // process, if this url is present in the environment dependencies and the - // schema has the $env_var placeholder, it will replace the placeholder in the - // schema. - string url = 6 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/python_function.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/python_function.proto deleted file mode 100644 index a0bf77d823a..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/python_function.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "PythonFunctionProto"; -option java_package = "com.google.cloud.ces.v1"; - -// A Python function tool. -message PythonFunction { - // Optional. The name of the Python function to execute. Must match a Python - // function name defined in the python code. Case sensitive. If the name is - // not provided, the first function defined in the python code will be used. - string name = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Python code to execute for the tool. - string python_code = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The description of the Python function, parsed from the python - // code's docstring. - string description = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/schema.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/schema.proto deleted file mode 100644 index 1beb9564308..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/schema.proto +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/struct.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "SchemaProto"; -option java_package = "com.google.cloud.ces.v1"; - -// Represents a select subset of an OpenAPI 3.0 schema object. -message Schema { - // OpenAPI data types. - enum Type { - // Type unspecified. - TYPE_UNSPECIFIED = 0; - - // String type. - STRING = 1; - - // Integer type. - INTEGER = 2; - - // Number type. - NUMBER = 3; - - // Boolean type. - BOOLEAN = 4; - - // Object type. - OBJECT = 5; - - // Array type. - ARRAY = 6; - } - - // Required. The type of the data. - Type type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Properties of Type.OBJECT. - map properties = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Required properties of Type.OBJECT. - repeated string required = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The description of the data. - string description = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Schema of the elements of Type.ARRAY. - Schema items = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicates if the value may be null. - bool nullable = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicate the items in the array must be unique. Only applies to - // TYPE.ARRAY. - bool unique_items = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Schemas of initial elements of Type.ARRAY. - repeated Schema prefix_items = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Can either be a boolean or an object, controls the presence of - // additional properties. - Schema additional_properties = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The value should be validated against any (one or more) of the - // subschemas in the list. - repeated Schema any_of = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Possible values of the element of primitive type with enum - // format. Examples: - // 1. We can define direction as : - // {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} - // 2. We can define apartment number as : - // {type:INTEGER, format:enum, enum:["101", "201", "301"]} - repeated string enum = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Default value of the data. - google.protobuf.Value default = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Allows indirect references between schema nodes. The value should - // be a valid reference to a child of the root `defs`. - // - // For example, the following schema defines a reference to a schema node - // named "Pet": - // - // ``` - // type: object - // properties: - // pet: - // ref: #/defs/Pet - // defs: - // Pet: - // type: object - // properties: - // name: - // type: string - // ``` - // - // The value of the "pet" property is a reference to the schema node - // named "Pet". - // See details in - // https://json-schema.org/understanding-json-schema/structuring. - string ref = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A map of definitions for use by `ref`. Only allowed at the root - // of the schema. - map defs = 14 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The title of the schema. - string title = 15 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Minimum number of the elements for Type.ARRAY. - int64 min_items = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Maximum number of the elements for Type.ARRAY. - int64 max_items = 17 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Minimum value for Type.INTEGER and Type.NUMBER. - optional double minimum = 18 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Maximum value for Type.INTEGER and Type.NUMBER. - optional double maximum = 19 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/search_suggestions.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/search_suggestions.proto deleted file mode 100644 index 06b0fde799d..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/search_suggestions.proto +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "SearchSuggestionsProto"; -option java_package = "com.google.cloud.ces.v1"; - -// Search suggestions from [Google Search -// Tool][google.cloud.ces.v1.GoogleSearchTool]. -message GoogleSearchSuggestions { - // Compliant HTML and CSS styling for search suggestions. - // The provided HTML and CSS automatically adapts to your device settings, - // displaying in either light or dark mode indicated by - // `@media(prefers-color-scheme)`. - repeated string htmls = 1; - - // List of queries used to perform the google search along with the search - // result URIs forming the search suggestions. - repeated WebSearchQuery web_search_queries = 2; -} - -// Represents a single web search query and its associated search uri. -message WebSearchQuery { - // The search query text. - string query = 1; - - // The URI to the Google Search results page for the query. - string uri = 2; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/session_service.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/session_service.proto deleted file mode 100644 index 7804515b178..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/session_service.proto +++ /dev/null @@ -1,456 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/ces/v1/common.proto"; -import "google/cloud/ces/v1/example.proto"; -import "google/cloud/ces/v1/search_suggestions.proto"; -import "google/protobuf/struct.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "SessionServiceProto"; -option java_package = "com.google.cloud.ces.v1"; -option (google.api.resource_definition) = { - type: "ces.googleapis.com/Session" - pattern: "projects/{project}/locations/{location}/apps/{app}/sessions/{session}" -}; - -// Session service provides APIs for interacting with CES agents. -service SessionService { - option (google.api.default_host) = "ces.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/ces," - "https://www.googleapis.com/auth/cloud-platform"; - - // Initiates a single turn interaction with the CES agent within a - // session. - rpc RunSession(RunSessionRequest) returns (RunSessionResponse) { - option (google.api.http) = { - post: "/v1/{config.session=projects/*/locations/*/apps/*/sessions/*}:runSession" - body: "*" - }; - } - - // Establishes a bidirectional streaming connection with the CES agent. - // The agent processes continuous multimodal inputs (e.g., text, audio) and - // generates real-time multimodal output streams. - // - // --- Client Request Stream --- - // The client streams requests in the following order: - // - // 1. Initialization: - // The first message must contain - // [SessionConfig][google.cloud.ces.v1.BidiSessionClientMessage.config]. - // For audio sessions, this should also include - // [InputAudioConfig][google.cloud.ces.v1.SessionConfig.input_audio_config] - // and - // [OutputAudioConfig][google.cloud.ces.v1.SessionConfig.output_audio_config] - // to define audio processing and synthesis parameters. - // - // 2. Interaction: - // Subsequent messages stream - // [SessionInput][google.cloud.ces.v1.BidiSessionClientMessage.realtime_input] - // containing real-time user input data. - // - // 3. Termination: - // The client should half-close the stream when there is no more user - // input. It should also half-close upon receiving - // [EndSession][google.cloud.ces.v1.BidiSessionServerMessage.end_session] - // or [GoAway][google.cloud.ces.v1.BidiSessionServerMessage.go_away] from - // the agent. - // - // --- Server Response Stream --- - // For each interaction turn, the agent streams messages in the following - // sequence: - // - // 1. Speech Recognition (First N messages): - // Contains - // [RecognitionResult][google.cloud.ces.v1.BidiSessionServerMessage.recognition_result] - // representing the concatenated user speech segments captured so far. - // This is only populated for audio sessions. - // - // 2. Response (Next M messages): - // Contains - // [SessionOutput][google.cloud.ces.v1.BidiSessionServerMessage.session_output] - // delivering the agent's response in various modalities (e.g., text, - // audio). - // - // 3. Turn Completion (Final message of the turn): - // Contains - // [SessionOutput][google.cloud.ces.v1.BidiSessionServerMessage.session_output] - // with [turn_completed][google.cloud.ces.v1.SessionOutput.turn_completed] - // set to true. This signals the end of the current turn and includes - // [DiagnosticInfo][google.cloud.ces.v1.SessionOutput.diagnostic_info] - // with execution details. - // - // --- Audio Best Practices --- - // 1. Streaming: - // Stream [audio data][google.cloud.ces.v1.SessionInput.audio] - // **CONTINUOUSLY**, even during silence. Recommended chunk size: 40-120ms - // (balances latency vs. efficiency). - // - // 2. Playback & Interruption: - // Play [audio responses][google.cloud.ces.v1.SessionOutput.audio] upon - // receipt. Stop playback immediately if an - // [InterruptionSignal][google.cloud.ces.v1.BidiSessionServerMessage.interruption_signal] - // is received (e.g., user barge-in or new agent response). - rpc BidiRunSession(stream BidiSessionClientMessage) - returns (stream BidiSessionServerMessage) {} -} - -// AudioEncoding specifies the encoding format for audio data. -enum AudioEncoding { - // Unspecified audio encoding. - AUDIO_ENCODING_UNSPECIFIED = 0; - - // 16-bit linear PCM audio encoding. - LINEAR16 = 1; - - // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - MULAW = 2; - - // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law. - ALAW = 3; -} - -// InputAudioConfig configures how the CES agent should interpret the incoming -// audio data. -message InputAudioConfig { - // Required. The encoding of the input audio data. - AudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The sample rate (in Hertz) of the input audio data. - int32 sample_rate_hertz = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Whether to enable noise suppression on the input audio. - // Available values are "low", "moderate", "high", "very_high". - string noise_suppression_level = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// OutputAudioConfig configures how the CES agent should synthesize outgoing -// audio responses. -message OutputAudioConfig { - // Required. The encoding of the output audio data. - AudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The sample rate (in Hertz) of the output audio data. - int32 sample_rate_hertz = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The configuration for the session. -message SessionConfig { - // [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters) - // to send to the remote - // [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) - // agent when the session control is transferred to the remote agent. - message RemoteDialogflowQueryParameters { - // Optional. The HTTP headers to be sent as webhook_headers in - // [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters). - map webhook_headers = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The payload to be sent in - // [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters). - google.protobuf.Struct payload = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The end user metadata to be sent in - // [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters). - google.protobuf.Struct end_user_metadata = 3 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. The unique identifier of the session. - // Format: - // `projects/{project}/locations/{location}/apps/{app}/sessions/{session}` - string session = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Session" } - ]; - - // Optional. Configuration for processing the input audio. - InputAudioConfig input_audio_config = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Configuration for generating the output audio. - OutputAudioConfig output_audio_config = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The historical context of the session, including user inputs, - // agent responses, and other messages. Typically, CES agent would manage - // session automatically so client doesn't need to explicitly populate this - // field. However, client can optionally override the historical contexts to - // force the session start from certain state. - repeated Message historical_contexts = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The entry agent to handle the session. If not specified, the - // session will be handled by the [root - // agent][google.cloud.ces.v1.App.root_agent] of the app. Format: - // `projects/{project}/locations/{location}/agents/{agent}` - string entry_agent = 12 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } - ]; - - // Optional. The deployment of the app to use for the session. - // Format: - // `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` - string deployment = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The time zone of the user. If provided, the agent will use the - // time zone for date and time related variables. Otherwise, the agent will - // use the time zone specified in the App.time_zone_settings. - // - // The format is the IANA Time Zone Database time zone, e.g. - // "America/Los_Angeles". - string time_zone = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. - // [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters) - // to send to the remote - // [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) - // agent when the session control is transferred to the remote agent. - RemoteDialogflowQueryParameters remote_dialogflow_query_parameters = 15 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Request for the client to execute the tools and return the execution results -// before continuing the session. -message ToolCalls { - // Optional. The list of tool calls to execute. - repeated ToolCall tool_calls = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// Execution results for the requested tool calls from the client. -message ToolResponses { - // Optional. The list of tool execution results. - repeated ToolResponse tool_responses = 1 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Citations associated with the agent response. -message Citations { - // Piece of cited information. - message CitedChunk { - // URI used for citation. - string uri = 1; - - // Title of the cited document. - string title = 2; - - // Text used for citation. - string text = 3; - } - - // List of cited pieces of information. - repeated CitedChunk cited_chunks = 1; -} - -// Event input. -message Event { - // Required. The name of the event. - string event = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Input for the session. -message SessionInput { - // The type of the input. - oneof input_type { - // Optional. Text data from the end user. - string text = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. DTMF digits from the end user. - string dtmf = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Audio data from the end user. - bytes audio = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Execution results for the tool calls from the client. - ToolResponses tool_responses = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Image data from the end user. - Image image = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Blob data from the end user. - Blob blob = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Contextual variables for the session, keyed by name. Only - // variables declared in the app will be used by the CES agent. - // - // Unrecognized variables will still be sent to the [Dialogflow - // agent][Agent.RemoteDialogflowAgent] as additional session parameters. - google.protobuf.Struct variables = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Event input. - Event event = 9 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. A flag to indicate if the current message is a fragment of a - // larger input in the bidi streaming session. When `true`, the agent will - // defer processing until a subsequent message with `will_continue` set to - // `false` is received. - // - // Note: This flag has no effect on audio and DTMF inputs, which are always - // processed in real-time. - bool will_continue = 8 [(google.api.field_behavior) = OPTIONAL]; -} - -// Output for the session. -message SessionOutput { - // Contains execution details during the processing. - message DiagnosticInfo { - // List of the messages that happened during the processing. - repeated Message messages = 1; - - // A trace of the entire request processing, represented as a root span. - // This span can contain nested child spans for specific operations. - Span root_span = 3; - } - - // The type of the output. - oneof output_type { - // Output text from the CES agent. - string text = 1; - - // Output audio from the CES agent. - bytes audio = 2; - - // Request for the client to execute the tools. - ToolCalls tool_calls = 3; - - // Citations that provide the source information for the agent's generated - // text. - Citations citations = 8; - - // The suggestions returned from Google Search as a result of invoking the - // [GoogleSearchTool][google.cloud.ces.v1.GoogleSearchTool]. - GoogleSearchSuggestions google_search_suggestions = 10; - - // Indicates the session has ended. - EndSession end_session = 9; - - // Custom payload with structured output from the CES agent. - google.protobuf.Struct payload = 11; - } - - // Indicates the sequential order of conversation turn to which this output - // belongs to, starting from 1. - int32 turn_index = 6; - - // If true, the CES agent has detected the end of the current conversation - // turn and will provide no further output for this turn. - bool turn_completed = 4; - - // Optional. Diagnostic information contains execution details during the - // processing of the input. Only populated in the last SessionOutput (with - // `turn_completed=true`) for each turn. - DiagnosticInfo diagnostic_info = 7 [(google.api.field_behavior) = OPTIONAL]; -} - -// Speech recognition result for the audio input. -message RecognitionResult { - // Optional. Concatenated user speech segments captured during the current - // turn. - string transcript = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// Indicates the agent's audio response has been interrupted. The client should -// immediately stop any current audio playback (e.g., due to user barge-in or -// a new agent response being generated). -message InterruptionSignal { - // Whether the interruption is caused by a user barge-in event. - bool barge_in = 1; -} - -// Indicates the session has terminated, due to either successful completion -// (e.g. user says "Good bye!" ) or an agent escalation. -// -// The agent will not process any further inputs after session is terminated and -// the client should half-close and disconnect after receiving all remaining -// responses from the agent. -message EndSession { - // Optional. Provides additional information about the end session signal, - // such as the reason for ending the session. - google.protobuf.Struct metadata = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// Indicates that the server will disconnect soon and the client should -// half-close and restart the connection. -message GoAway {} - -// Request message for -// [SessionService.RunSession][google.cloud.ces.v1.SessionService.RunSession]. -message RunSessionRequest { - // Required. The configuration for the session. - SessionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Inputs for the session. - repeated SessionInput inputs = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for -// [SessionService.RunSession][google.cloud.ces.v1.SessionService.RunSession]. -message RunSessionResponse { - // Outputs for the session. - repeated SessionOutput outputs = 1; -} - -// The top-level message sent by the client for the -// [SessionService.BidiRunSession][google.cloud.ces.v1.SessionService.BidiRunSession] -// method. -message BidiSessionClientMessage { - // The type of the message. - oneof message_type { - // Optional. The initial config message for the session. - SessionConfig config = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Realtime input for the session. - SessionInput realtime_input = 2 [(google.api.field_behavior) = OPTIONAL]; - } -} - -// The top-level message returned from -// [SessionService.BidiRunSession][google.cloud.ces.v1.SessionService.BidiRunSession] -// method. -message BidiSessionServerMessage { - // The type of the message. - oneof message_type { - // Optional. Processing result from the CES agent. - SessionOutput session_output = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Realtime speech recognition result for the audio input. - RecognitionResult recognition_result = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Interruption signal detected from the audio input. - InterruptionSignal interruption_signal = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicates that the session has ended. - EndSession end_session = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicates that the server will disconnect soon and the client - // should half-close and restart the connection. - GoAway go_away = 6 [(google.api.field_behavior) = OPTIONAL]; - } -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/system_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/system_tool.proto deleted file mode 100644 index a628f37785d..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/system_tool.proto +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.ces.v1; - -import "google/api/field_behavior.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "SystemToolProto"; -option java_package = "com.google.cloud.ces.v1"; - -// Pre-defined system tool. -message SystemTool { - // Required. The name of the system tool. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The description of the system tool. - string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/tool.proto deleted file mode 100644 index 6b30a6d9263..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/tool.proto +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/ces/v1/client_function.proto"; -import "google/cloud/ces/v1/common.proto"; -import "google/cloud/ces/v1/connector_tool.proto"; -import "google/cloud/ces/v1/data_store_tool.proto"; -import "google/cloud/ces/v1/fakes.proto"; -import "google/cloud/ces/v1/file_search_tool.proto"; -import "google/cloud/ces/v1/google_search_tool.proto"; -import "google/cloud/ces/v1/mcp_tool.proto"; -import "google/cloud/ces/v1/open_api_tool.proto"; -import "google/cloud/ces/v1/python_function.proto"; -import "google/cloud/ces/v1/system_tool.proto"; -import "google/cloud/ces/v1/widget_tool.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "ToolProto"; -option java_package = "com.google.cloud.ces.v1"; - -// A tool represents an action that the CES agent can take to achieve certain -// goals. -message Tool { - option (google.api.resource) = { - type: "ces.googleapis.com/Tool" - pattern: "projects/{project}/locations/{location}/apps/{app}/tools/{tool}" - plural: "tools" - singular: "tool" - }; - - // The type of the tool. - oneof tool_type { - // Optional. The client function. - ClientFunction client_function = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The open API tool. - OpenApiTool open_api_tool = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The google search tool. - GoogleSearchTool google_search_tool = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Integration Connector tool. - ConnectorTool connector_tool = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The data store tool. - DataStoreTool data_store_tool = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The python function tool. - PythonFunction python_function = 11 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The MCP tool. An MCP tool cannot be created or updated directly - // and is managed by the MCP toolset. - McpTool mcp_tool = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The file search tool. - FileSearchTool file_search_tool = 17 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The system tool. - SystemTool system_tool = 18 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The widget tool. - WidgetTool widget_tool = 24 [(google.api.field_behavior) = OPTIONAL]; - } - - // Identifier. The unique identifier of the tool. - // Format: - // - `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` for - // ## standalone tools. - // - // `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}/tools/{tool}` - // for tools retrieved from a toolset. These tools are dynamic and - // output-only, they cannot be referenced directly where a tool is expected. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Output only. The display name of the tool, derived based on the tool's - // type. For example, display name of a [ClientFunction][Tool.ClientFunction] - // is derived from its `name` property. - string display_name = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The execution type of the tool. - ExecutionType execution_type = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Timestamp when the tool was created. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when the tool was last updated. - google.protobuf.Timestamp update_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Etag used to ensure the object hasn't changed during a read-modify-write - // operation. If the etag is empty, the update will overwrite any concurrent - // changes. - string etag = 14; - - // Output only. If the tool is generated by the LLM assistant, this field - // contains a descriptive summary of the generation. - string generated_summary = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Configuration for tool behavior in fake mode. - ToolFakeConfig tool_fake_config = 20 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/tool_service.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/tool_service.proto deleted file mode 100644 index 650c8f50cb4..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/tool_service.proto +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/ces/v1/schema.proto"; -import "google/cloud/ces/v1/tool.proto"; -import "google/cloud/ces/v1/toolset_tool.proto"; -import "google/protobuf/struct.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "ToolServiceProto"; -option java_package = "com.google.cloud.ces.v1"; - -// Tool service provides APIs for interacting with CES tools. -service ToolService { - option (google.api.default_host) = "ces.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/ces," - "https://www.googleapis.com/auth/cloud-platform"; - - // Executes the given tool with the given arguments. - rpc ExecuteTool(ExecuteToolRequest) returns (ExecuteToolResponse) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/apps/*}:executeTool" - body: "*" - }; - } - - // Retrieve the schema of the given tool. The schema is computed on the fly - // for the given instance of the tool. - rpc RetrieveToolSchema(RetrieveToolSchemaRequest) - returns (RetrieveToolSchemaResponse) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/apps/*}:retrieveToolSchema" - body: "*" - }; - } - - // Retrieve the list of tools included in the specified toolset. - rpc RetrieveTools(RetrieveToolsRequest) returns (RetrieveToolsResponse) { - option (google.api.http) = { - post: "/v1/{toolset=projects/*/locations/*/apps/*/toolsets/*}:retrieveTools" - body: "*" - }; - } -} - -// Request message for -// [ToolService.ExecuteTool][google.cloud.ces.v1.ToolService.ExecuteTool]. -message ExecuteToolRequest { - // The identifier of the tool to execute. It could be either a persisted tool - // or a tool from a toolset. - oneof tool_identifier { - // Optional. The name of the tool to execute. - // Format: - // projects/{project}/locations/{location}/apps/{app}/tools/{tool} - string tool = 1 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } - ]; - - // Optional. The toolset tool to execute. Only one tool should match the - // predicate from the toolset. Otherwise, an error will be returned. - ToolsetTool toolset_tool = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. The resource name of the app which the tool/toolset belongs to. - // Format: `projects/{project}/locations/{location}/apps/{app}` - string parent = 4 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/App" } - ]; - - // Optional. The input parameters and values for the tool in JSON object - // format. - google.protobuf.Struct args = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [ToolService.ExecuteTool][google.cloud.ces.v1.ToolService.ExecuteTool]. -message ExecuteToolResponse { - // The identifier of the tool that got executed. - oneof tool_identifier { - // The name of the tool that got executed. - // Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` - string tool = 1 - [(google.api.resource_reference) = { type: "ces.googleapis.com/Tool" }]; - - // The toolset tool that got executed. - ToolsetTool toolset_tool = 3; - } - - // Required. The tool execution result in JSON object format. - // Use "output" key to specify tool response and "error" key to specify - // error details (if any). If "output" and "error" keys are not specified, - // then whole "response" is treated as tool execution result. - google.protobuf.Struct response = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [ToolService.RetrieveToolSchema][google.cloud.ces.v1.ToolService.RetrieveToolSchema]. -message RetrieveToolSchemaRequest { - // The identifier of the tool to retrieve the schema for. It could be either a - // persisted tool or a tool from a toolset. - oneof tool_identifier { - // Optional. The name of the tool to retrieve the schema for. - // Format: - // projects/{project}/locations/{location}/apps/{app}/tools/{tool} - string tool = 1 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { type: "ces.googleapis.com/Tool" } - ]; - - // Optional. The toolset tool to retrieve the schema for. Only one tool - // should match the predicate from the toolset. Otherwise, an error will be - // returned. - ToolsetTool toolset_tool = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. The resource name of the app which the tool/toolset belongs to. - // Format: `projects/{project}/locations/{location}/apps/{app}` - string parent = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/App" } - ]; -} - -// Response message for -// [ToolService.RetrieveToolSchema][google.cloud.ces.v1.ToolService.RetrieveToolSchema]. -message RetrieveToolSchemaResponse { - // The identifier of the tool that the schema is for. - oneof tool_identifier { - // The name of the tool that the schema is for. - // Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` - string tool = 1 - [(google.api.resource_reference) = { type: "ces.googleapis.com/Tool" }]; - - // The toolset tool that the schema is for. - ToolsetTool toolset_tool = 2; - } - - // Required. The schema of the tool input parameters. - Schema input_schema = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The schema of the tool output parameters. - Schema output_schema = 4 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [ToolService.RetrieveTools][google.cloud.ces.v1.ToolService.RetrieveTools]. -message RetrieveToolsRequest { - // Required. The name of the toolset to retrieve the tools for. - // Format: - // `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` - string toolset = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Toolset" } - ]; - - // Optional. The identifiers of the tools to retrieve from the toolset. - // If empty, all tools in the toolset will be returned. - repeated string tool_ids = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [ToolService.RetrieveTools][google.cloud.ces.v1.ToolService.RetrieveTools]. -message RetrieveToolsResponse { - // Required. The list of tools that are included in the specified toolset. - repeated Tool tools = 1 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/toolset.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/toolset.proto deleted file mode 100644 index 81ee47207cd..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/toolset.proto +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/ces/v1/common.proto"; -import "google/cloud/ces/v1/connector_toolset.proto"; -import "google/cloud/ces/v1/fakes.proto"; -import "google/cloud/ces/v1/mcp_toolset.proto"; -import "google/cloud/ces/v1/open_api_toolset.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "ToolsetProto"; -option java_package = "com.google.cloud.ces.v1"; - -// A toolset represents a group of dynamically managed tools that can be used -// by the agent. -message Toolset { - option (google.api.resource) = { - type: "ces.googleapis.com/Toolset" - pattern: "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}" - plural: "toolsets" - singular: "toolset" - }; - - // The type of the toolset. - oneof toolset_type { - // Optional. A toolset that contains a list of tools that are offered by the - // MCP server. - McpToolset mcp_toolset = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A toolset that contains a list of tools that are defined by an - // OpenAPI schema. - OpenApiToolset open_api_toolset = 7 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A toolset that generates tools from an Integration Connectors - // Connection. - ConnectorToolset connector_toolset = 8 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Identifier. The unique identifier of the toolset. - // Format: - // `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Optional. The display name of the toolset. Must be unique within the same - // app. - string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The description of the toolset. - string description = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Timestamp when the toolset was created. - google.protobuf.Timestamp create_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when the toolset was last updated. - google.protobuf.Timestamp update_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // ETag used to ensure the object hasn't changed during a read-modify-write - // operation. If the etag is empty, the update will overwrite any concurrent - // changes. - string etag = 5; - - // Optional. The execution type of the tools in the toolset. - ExecutionType execution_type = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Configuration for tools behavior in fake mode. - ToolFakeConfig tool_fake_config = 11 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/toolset_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/toolset_tool.proto deleted file mode 100644 index a2147435c9c..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/toolset_tool.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "ToolsetToolProto"; -option java_package = "com.google.cloud.ces.v1"; - -// A tool that is created from a toolset. -message ToolsetTool { - // Required. The resource name of the Toolset from which this tool is derived. - // Format: - // `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` - string toolset = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Toolset" } - ]; - - // Optional. The tool ID to filter the tools to retrieve the schema for. - string tool_id = 3 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/widget_service.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/widget_service.proto deleted file mode 100644 index 2aba8953115..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/widget_service.proto +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.ces.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "WidgetServiceProto"; -option java_package = "com.google.cloud.ces.v1"; - -// Provides APIs for widgets to interact with CES APIs. -service WidgetService { - option (google.api.default_host) = "ces.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/ces," - "https://www.googleapis.com/auth/cloud-platform"; - - // Generates a session scoped token for chat widget to authenticate with - // Session APIs. - rpc GenerateChatToken(GenerateChatTokenRequest) - returns (GenerateChatTokenResponse) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/apps/*/sessions/*}:generateChatToken" - body: "*" - }; - } -} - -// Request message for -// [WidgetService.GenerateChatToken][google.cloud.ces.v1.WidgetService.GenerateChatToken]. -message GenerateChatTokenRequest { - // Required. The session name to generate the chat token for. - // Format: - // projects/{project}/locations/{location}/apps/{app}/sessions/{session} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Session" } - ]; - - // Required. The deployment of the app to use for the session. - // Format: - // projects/{project}/locations/{location}/apps/{app}/deployments/{deployment} - string deployment = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "ces.googleapis.com/Deployment" } - ]; - - // Optional. The reCAPTCHA token generated by the client-side chat widget. - string recaptcha_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for -// [WidgetService.GenerateChatToken][google.cloud.ces.v1.WidgetService.GenerateChatToken]. -message GenerateChatTokenResponse { - // The session scoped token for chat widget to authenticate with Session APIs. - string chat_token = 1; - - // The time at which the chat token expires. - google.protobuf.Timestamp expire_time = 2; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/widget_tool.proto b/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/widget_tool.proto deleted file mode 100644 index dff7057ab73..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1/widget_tool.proto +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.ces.v1; - -import "google/api/field_behavior.proto"; -import "google/cloud/ces/v1/schema.proto"; - -option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb"; -option java_multiple_files = true; -option java_outer_classname = "WidgetToolProto"; -option java_package = "com.google.cloud.ces.v1"; - -// Represents a widget tool that the agent can invoke. When the tool is chosen -// by the agent, agent will return the widget to the client. The client is -// responsible for processing the widget and generating the next user query to -// continue the interaction with the agent. -message WidgetTool { - // All available widget types. - // New values may be added to this enum in the future. - enum WidgetType { - // Unspecified widget type. - WIDGET_TYPE_UNSPECIFIED = 0; - - // Custom widget type. - CUSTOM = 1; - - // Product carousel widget. - PRODUCT_CAROUSEL = 2; - - // Product details widget. - PRODUCT_DETAILS = 3; - - // Quick actions widget. - QUICK_ACTIONS = 4; - - // Product comparison widget. - PRODUCT_COMPARISON = 5; - - // Advanced product details widget. - ADVANCED_PRODUCT_DETAILS = 6; - - // Short form widget. - SHORT_FORM = 7; - - // Overall satisfaction widget. - OVERALL_SATISFACTION = 8; - - // Order summary widget. - ORDER_SUMMARY = 9; - - // Appointment details widget. - APPOINTMENT_DETAILS = 10; - } - - // The input of the widget tool. - oneof input { - // Optional. The input parameters of the widget tool. - Schema parameters = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. The display name of the widget tool. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The description of the widget tool. - string description = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The type of the widget tool. If not specified, the default type - // will be CUSTOMIZED. - WidgetType widget_type = 3 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-ces/protos/protos.d.ts b/owl-bot-staging/google-cloud-ces/protos/protos.d.ts deleted file mode 100644 index c43519c0865..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/protos.d.ts +++ /dev/null @@ -1,72921 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace cloud. */ - namespace cloud { - - /** Namespace ces. */ - namespace ces { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of an Agent. */ - interface IAgent { - - /** Agent llmAgent */ - llmAgent?: (google.cloud.ces.v1.Agent.ILlmAgent|null); - - /** Agent remoteDialogflowAgent */ - remoteDialogflowAgent?: (google.cloud.ces.v1.Agent.IRemoteDialogflowAgent|null); - - /** Agent name */ - name?: (string|null); - - /** Agent displayName */ - displayName?: (string|null); - - /** Agent description */ - description?: (string|null); - - /** Agent modelSettings */ - modelSettings?: (google.cloud.ces.v1.IModelSettings|null); - - /** Agent instruction */ - instruction?: (string|null); - - /** Agent tools */ - tools?: (string[]|null); - - /** Agent childAgents */ - childAgents?: (string[]|null); - - /** Agent beforeAgentCallbacks */ - beforeAgentCallbacks?: (google.cloud.ces.v1.ICallback[]|null); - - /** Agent afterAgentCallbacks */ - afterAgentCallbacks?: (google.cloud.ces.v1.ICallback[]|null); - - /** Agent beforeModelCallbacks */ - beforeModelCallbacks?: (google.cloud.ces.v1.ICallback[]|null); - - /** Agent afterModelCallbacks */ - afterModelCallbacks?: (google.cloud.ces.v1.ICallback[]|null); - - /** Agent beforeToolCallbacks */ - beforeToolCallbacks?: (google.cloud.ces.v1.ICallback[]|null); - - /** Agent afterToolCallbacks */ - afterToolCallbacks?: (google.cloud.ces.v1.ICallback[]|null); - - /** Agent createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Agent updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Agent guardrails */ - guardrails?: (string[]|null); - - /** Agent etag */ - etag?: (string|null); - - /** Agent toolsets */ - toolsets?: (google.cloud.ces.v1.Agent.IAgentToolset[]|null); - - /** Agent generatedSummary */ - generatedSummary?: (string|null); - - /** Agent transferRules */ - transferRules?: (google.cloud.ces.v1.ITransferRule[]|null); - } - - /** Represents an Agent. */ - class Agent implements IAgent { - - /** - * Constructs a new Agent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IAgent); - - /** Agent llmAgent. */ - public llmAgent?: (google.cloud.ces.v1.Agent.ILlmAgent|null); - - /** Agent remoteDialogflowAgent. */ - public remoteDialogflowAgent?: (google.cloud.ces.v1.Agent.IRemoteDialogflowAgent|null); - - /** Agent name. */ - public name: string; - - /** Agent displayName. */ - public displayName: string; - - /** Agent description. */ - public description: string; - - /** Agent modelSettings. */ - public modelSettings?: (google.cloud.ces.v1.IModelSettings|null); - - /** Agent instruction. */ - public instruction: string; - - /** Agent tools. */ - public tools: string[]; - - /** Agent childAgents. */ - public childAgents: string[]; - - /** Agent beforeAgentCallbacks. */ - public beforeAgentCallbacks: google.cloud.ces.v1.ICallback[]; - - /** Agent afterAgentCallbacks. */ - public afterAgentCallbacks: google.cloud.ces.v1.ICallback[]; - - /** Agent beforeModelCallbacks. */ - public beforeModelCallbacks: google.cloud.ces.v1.ICallback[]; - - /** Agent afterModelCallbacks. */ - public afterModelCallbacks: google.cloud.ces.v1.ICallback[]; - - /** Agent beforeToolCallbacks. */ - public beforeToolCallbacks: google.cloud.ces.v1.ICallback[]; - - /** Agent afterToolCallbacks. */ - public afterToolCallbacks: google.cloud.ces.v1.ICallback[]; - - /** Agent createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Agent updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Agent guardrails. */ - public guardrails: string[]; - - /** Agent etag. */ - public etag: string; - - /** Agent toolsets. */ - public toolsets: google.cloud.ces.v1.Agent.IAgentToolset[]; - - /** Agent generatedSummary. */ - public generatedSummary: string; - - /** Agent transferRules. */ - public transferRules: google.cloud.ces.v1.ITransferRule[]; - - /** Agent agentType. */ - public agentType?: ("llmAgent"|"remoteDialogflowAgent"); - - /** - * Creates a new Agent instance using the specified properties. - * @param [properties] Properties to set - * @returns Agent instance - */ - public static create(properties?: google.cloud.ces.v1.IAgent): google.cloud.ces.v1.Agent; - - /** - * Encodes the specified Agent message. Does not implicitly {@link google.cloud.ces.v1.Agent.verify|verify} messages. - * @param message Agent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IAgent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Agent message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Agent.verify|verify} messages. - * @param message Agent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IAgent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Agent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Agent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Agent; - - /** - * Decodes an Agent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Agent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Agent; - - /** - * Verifies an Agent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Agent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Agent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Agent; - - /** - * Creates a plain object from an Agent message. Also converts values to other types if specified. - * @param message Agent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Agent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Agent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Agent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Agent { - - /** Properties of a LlmAgent. */ - interface ILlmAgent { - } - - /** Represents a LlmAgent. */ - class LlmAgent implements ILlmAgent { - - /** - * Constructs a new LlmAgent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.Agent.ILlmAgent); - - /** - * Creates a new LlmAgent instance using the specified properties. - * @param [properties] Properties to set - * @returns LlmAgent instance - */ - public static create(properties?: google.cloud.ces.v1.Agent.ILlmAgent): google.cloud.ces.v1.Agent.LlmAgent; - - /** - * Encodes the specified LlmAgent message. Does not implicitly {@link google.cloud.ces.v1.Agent.LlmAgent.verify|verify} messages. - * @param message LlmAgent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.Agent.ILlmAgent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LlmAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Agent.LlmAgent.verify|verify} messages. - * @param message LlmAgent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.Agent.ILlmAgent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LlmAgent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LlmAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Agent.LlmAgent; - - /** - * Decodes a LlmAgent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LlmAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Agent.LlmAgent; - - /** - * Verifies a LlmAgent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LlmAgent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LlmAgent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Agent.LlmAgent; - - /** - * Creates a plain object from a LlmAgent message. Also converts values to other types if specified. - * @param message LlmAgent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Agent.LlmAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LlmAgent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LlmAgent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RemoteDialogflowAgent. */ - interface IRemoteDialogflowAgent { - - /** RemoteDialogflowAgent agent */ - agent?: (string|null); - - /** RemoteDialogflowAgent flowId */ - flowId?: (string|null); - - /** RemoteDialogflowAgent environmentId */ - environmentId?: (string|null); - - /** RemoteDialogflowAgent inputVariableMapping */ - inputVariableMapping?: ({ [k: string]: string }|null); - - /** RemoteDialogflowAgent outputVariableMapping */ - outputVariableMapping?: ({ [k: string]: string }|null); - - /** RemoteDialogflowAgent respectResponseInterruptionSettings */ - respectResponseInterruptionSettings?: (boolean|null); - } - - /** Represents a RemoteDialogflowAgent. */ - class RemoteDialogflowAgent implements IRemoteDialogflowAgent { - - /** - * Constructs a new RemoteDialogflowAgent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.Agent.IRemoteDialogflowAgent); - - /** RemoteDialogflowAgent agent. */ - public agent: string; - - /** RemoteDialogflowAgent flowId. */ - public flowId: string; - - /** RemoteDialogflowAgent environmentId. */ - public environmentId: string; - - /** RemoteDialogflowAgent inputVariableMapping. */ - public inputVariableMapping: { [k: string]: string }; - - /** RemoteDialogflowAgent outputVariableMapping. */ - public outputVariableMapping: { [k: string]: string }; - - /** RemoteDialogflowAgent respectResponseInterruptionSettings. */ - public respectResponseInterruptionSettings: boolean; - - /** - * Creates a new RemoteDialogflowAgent instance using the specified properties. - * @param [properties] Properties to set - * @returns RemoteDialogflowAgent instance - */ - public static create(properties?: google.cloud.ces.v1.Agent.IRemoteDialogflowAgent): google.cloud.ces.v1.Agent.RemoteDialogflowAgent; - - /** - * Encodes the specified RemoteDialogflowAgent message. Does not implicitly {@link google.cloud.ces.v1.Agent.RemoteDialogflowAgent.verify|verify} messages. - * @param message RemoteDialogflowAgent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.Agent.IRemoteDialogflowAgent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RemoteDialogflowAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Agent.RemoteDialogflowAgent.verify|verify} messages. - * @param message RemoteDialogflowAgent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.Agent.IRemoteDialogflowAgent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RemoteDialogflowAgent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RemoteDialogflowAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Agent.RemoteDialogflowAgent; - - /** - * Decodes a RemoteDialogflowAgent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RemoteDialogflowAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Agent.RemoteDialogflowAgent; - - /** - * Verifies a RemoteDialogflowAgent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RemoteDialogflowAgent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RemoteDialogflowAgent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Agent.RemoteDialogflowAgent; - - /** - * Creates a plain object from a RemoteDialogflowAgent message. Also converts values to other types if specified. - * @param message RemoteDialogflowAgent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Agent.RemoteDialogflowAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RemoteDialogflowAgent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RemoteDialogflowAgent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AgentToolset. */ - interface IAgentToolset { - - /** AgentToolset toolset */ - toolset?: (string|null); - - /** AgentToolset toolIds */ - toolIds?: (string[]|null); - } - - /** Represents an AgentToolset. */ - class AgentToolset implements IAgentToolset { - - /** - * Constructs a new AgentToolset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.Agent.IAgentToolset); - - /** AgentToolset toolset. */ - public toolset: string; - - /** AgentToolset toolIds. */ - public toolIds: string[]; - - /** - * Creates a new AgentToolset instance using the specified properties. - * @param [properties] Properties to set - * @returns AgentToolset instance - */ - public static create(properties?: google.cloud.ces.v1.Agent.IAgentToolset): google.cloud.ces.v1.Agent.AgentToolset; - - /** - * Encodes the specified AgentToolset message. Does not implicitly {@link google.cloud.ces.v1.Agent.AgentToolset.verify|verify} messages. - * @param message AgentToolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.Agent.IAgentToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AgentToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Agent.AgentToolset.verify|verify} messages. - * @param message AgentToolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.Agent.IAgentToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AgentToolset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AgentToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Agent.AgentToolset; - - /** - * Decodes an AgentToolset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AgentToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Agent.AgentToolset; - - /** - * Verifies an AgentToolset message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AgentToolset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AgentToolset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Agent.AgentToolset; - - /** - * Creates a plain object from an AgentToolset message. Also converts values to other types if specified. - * @param message AgentToolset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Agent.AgentToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AgentToolset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AgentToolset - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExpressionCondition. */ - interface IExpressionCondition { - - /** ExpressionCondition expression */ - expression?: (string|null); - } - - /** Represents an ExpressionCondition. */ - class ExpressionCondition implements IExpressionCondition { - - /** - * Constructs a new ExpressionCondition. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IExpressionCondition); - - /** ExpressionCondition expression. */ - public expression: string; - - /** - * Creates a new ExpressionCondition instance using the specified properties. - * @param [properties] Properties to set - * @returns ExpressionCondition instance - */ - public static create(properties?: google.cloud.ces.v1.IExpressionCondition): google.cloud.ces.v1.ExpressionCondition; - - /** - * Encodes the specified ExpressionCondition message. Does not implicitly {@link google.cloud.ces.v1.ExpressionCondition.verify|verify} messages. - * @param message ExpressionCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IExpressionCondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExpressionCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExpressionCondition.verify|verify} messages. - * @param message ExpressionCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IExpressionCondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExpressionCondition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExpressionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ExpressionCondition; - - /** - * Decodes an ExpressionCondition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExpressionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ExpressionCondition; - - /** - * Verifies an ExpressionCondition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExpressionCondition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExpressionCondition - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ExpressionCondition; - - /** - * Creates a plain object from an ExpressionCondition message. Also converts values to other types if specified. - * @param message ExpressionCondition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ExpressionCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExpressionCondition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExpressionCondition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonCodeCondition. */ - interface IPythonCodeCondition { - - /** PythonCodeCondition pythonCode */ - pythonCode?: (string|null); - } - - /** Represents a PythonCodeCondition. */ - class PythonCodeCondition implements IPythonCodeCondition { - - /** - * Constructs a new PythonCodeCondition. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IPythonCodeCondition); - - /** PythonCodeCondition pythonCode. */ - public pythonCode: string; - - /** - * Creates a new PythonCodeCondition instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonCodeCondition instance - */ - public static create(properties?: google.cloud.ces.v1.IPythonCodeCondition): google.cloud.ces.v1.PythonCodeCondition; - - /** - * Encodes the specified PythonCodeCondition message. Does not implicitly {@link google.cloud.ces.v1.PythonCodeCondition.verify|verify} messages. - * @param message PythonCodeCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IPythonCodeCondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonCodeCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1.PythonCodeCondition.verify|verify} messages. - * @param message PythonCodeCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IPythonCodeCondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonCodeCondition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonCodeCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.PythonCodeCondition; - - /** - * Decodes a PythonCodeCondition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonCodeCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.PythonCodeCondition; - - /** - * Verifies a PythonCodeCondition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PythonCodeCondition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonCodeCondition - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.PythonCodeCondition; - - /** - * Creates a plain object from a PythonCodeCondition message. Also converts values to other types if specified. - * @param message PythonCodeCondition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.PythonCodeCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonCodeCondition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonCodeCondition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TransferRule. */ - interface ITransferRule { - - /** TransferRule deterministicTransfer */ - deterministicTransfer?: (google.cloud.ces.v1.TransferRule.IDeterministicTransfer|null); - - /** TransferRule disablePlannerTransfer */ - disablePlannerTransfer?: (google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer|null); - - /** TransferRule childAgent */ - childAgent?: (string|null); - - /** TransferRule direction */ - direction?: (google.cloud.ces.v1.TransferRule.Direction|keyof typeof google.cloud.ces.v1.TransferRule.Direction|null); - } - - /** Represents a TransferRule. */ - class TransferRule implements ITransferRule { - - /** - * Constructs a new TransferRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ITransferRule); - - /** TransferRule deterministicTransfer. */ - public deterministicTransfer?: (google.cloud.ces.v1.TransferRule.IDeterministicTransfer|null); - - /** TransferRule disablePlannerTransfer. */ - public disablePlannerTransfer?: (google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer|null); - - /** TransferRule childAgent. */ - public childAgent: string; - - /** TransferRule direction. */ - public direction: (google.cloud.ces.v1.TransferRule.Direction|keyof typeof google.cloud.ces.v1.TransferRule.Direction); - - /** TransferRule ruleType. */ - public ruleType?: ("deterministicTransfer"|"disablePlannerTransfer"); - - /** - * Creates a new TransferRule instance using the specified properties. - * @param [properties] Properties to set - * @returns TransferRule instance - */ - public static create(properties?: google.cloud.ces.v1.ITransferRule): google.cloud.ces.v1.TransferRule; - - /** - * Encodes the specified TransferRule message. Does not implicitly {@link google.cloud.ces.v1.TransferRule.verify|verify} messages. - * @param message TransferRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ITransferRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransferRule message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TransferRule.verify|verify} messages. - * @param message TransferRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ITransferRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransferRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransferRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TransferRule; - - /** - * Decodes a TransferRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransferRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TransferRule; - - /** - * Verifies a TransferRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TransferRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransferRule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TransferRule; - - /** - * Creates a plain object from a TransferRule message. Also converts values to other types if specified. - * @param message TransferRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.TransferRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransferRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransferRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TransferRule { - - /** Properties of a DeterministicTransfer. */ - interface IDeterministicTransfer { - - /** DeterministicTransfer expressionCondition */ - expressionCondition?: (google.cloud.ces.v1.IExpressionCondition|null); - - /** DeterministicTransfer pythonCodeCondition */ - pythonCodeCondition?: (google.cloud.ces.v1.IPythonCodeCondition|null); - } - - /** Represents a DeterministicTransfer. */ - class DeterministicTransfer implements IDeterministicTransfer { - - /** - * Constructs a new DeterministicTransfer. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.TransferRule.IDeterministicTransfer); - - /** DeterministicTransfer expressionCondition. */ - public expressionCondition?: (google.cloud.ces.v1.IExpressionCondition|null); - - /** DeterministicTransfer pythonCodeCondition. */ - public pythonCodeCondition?: (google.cloud.ces.v1.IPythonCodeCondition|null); - - /** DeterministicTransfer conditionType. */ - public conditionType?: ("expressionCondition"|"pythonCodeCondition"); - - /** - * Creates a new DeterministicTransfer instance using the specified properties. - * @param [properties] Properties to set - * @returns DeterministicTransfer instance - */ - public static create(properties?: google.cloud.ces.v1.TransferRule.IDeterministicTransfer): google.cloud.ces.v1.TransferRule.DeterministicTransfer; - - /** - * Encodes the specified DeterministicTransfer message. Does not implicitly {@link google.cloud.ces.v1.TransferRule.DeterministicTransfer.verify|verify} messages. - * @param message DeterministicTransfer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.TransferRule.IDeterministicTransfer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeterministicTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TransferRule.DeterministicTransfer.verify|verify} messages. - * @param message DeterministicTransfer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.TransferRule.IDeterministicTransfer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeterministicTransfer message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeterministicTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TransferRule.DeterministicTransfer; - - /** - * Decodes a DeterministicTransfer message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeterministicTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TransferRule.DeterministicTransfer; - - /** - * Verifies a DeterministicTransfer message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeterministicTransfer message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeterministicTransfer - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TransferRule.DeterministicTransfer; - - /** - * Creates a plain object from a DeterministicTransfer message. Also converts values to other types if specified. - * @param message DeterministicTransfer - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.TransferRule.DeterministicTransfer, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeterministicTransfer to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeterministicTransfer - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DisablePlannerTransfer. */ - interface IDisablePlannerTransfer { - - /** DisablePlannerTransfer expressionCondition */ - expressionCondition?: (google.cloud.ces.v1.IExpressionCondition|null); - } - - /** Represents a DisablePlannerTransfer. */ - class DisablePlannerTransfer implements IDisablePlannerTransfer { - - /** - * Constructs a new DisablePlannerTransfer. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer); - - /** DisablePlannerTransfer expressionCondition. */ - public expressionCondition?: (google.cloud.ces.v1.IExpressionCondition|null); - - /** - * Creates a new DisablePlannerTransfer instance using the specified properties. - * @param [properties] Properties to set - * @returns DisablePlannerTransfer instance - */ - public static create(properties?: google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer): google.cloud.ces.v1.TransferRule.DisablePlannerTransfer; - - /** - * Encodes the specified DisablePlannerTransfer message. Does not implicitly {@link google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.verify|verify} messages. - * @param message DisablePlannerTransfer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DisablePlannerTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.verify|verify} messages. - * @param message DisablePlannerTransfer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DisablePlannerTransfer message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DisablePlannerTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TransferRule.DisablePlannerTransfer; - - /** - * Decodes a DisablePlannerTransfer message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DisablePlannerTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TransferRule.DisablePlannerTransfer; - - /** - * Verifies a DisablePlannerTransfer message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DisablePlannerTransfer message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DisablePlannerTransfer - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TransferRule.DisablePlannerTransfer; - - /** - * Creates a plain object from a DisablePlannerTransfer message. Also converts values to other types if specified. - * @param message DisablePlannerTransfer - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.TransferRule.DisablePlannerTransfer, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DisablePlannerTransfer to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DisablePlannerTransfer - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Direction enum. */ - enum Direction { - DIRECTION_UNSPECIFIED = 0, - PARENT_TO_CHILD = 1, - CHILD_TO_PARENT = 2 - } - } - - /** ExecutionType enum. */ - enum ExecutionType { - EXECUTION_TYPE_UNSPECIFIED = 0, - SYNCHRONOUS = 1, - ASYNCHRONOUS = 2 - } - - /** Properties of a Callback. */ - interface ICallback { - - /** Callback pythonCode */ - pythonCode?: (string|null); - - /** Callback description */ - description?: (string|null); - - /** Callback disabled */ - disabled?: (boolean|null); - - /** Callback proactiveExecutionEnabled */ - proactiveExecutionEnabled?: (boolean|null); - } - - /** Represents a Callback. */ - class Callback implements ICallback { - - /** - * Constructs a new Callback. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ICallback); - - /** Callback pythonCode. */ - public pythonCode?: (string|null); - - /** Callback description. */ - public description: string; - - /** Callback disabled. */ - public disabled: boolean; - - /** Callback proactiveExecutionEnabled. */ - public proactiveExecutionEnabled: boolean; - - /** Callback callback. */ - public callback?: "pythonCode"; - - /** - * Creates a new Callback instance using the specified properties. - * @param [properties] Properties to set - * @returns Callback instance - */ - public static create(properties?: google.cloud.ces.v1.ICallback): google.cloud.ces.v1.Callback; - - /** - * Encodes the specified Callback message. Does not implicitly {@link google.cloud.ces.v1.Callback.verify|verify} messages. - * @param message Callback message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ICallback, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Callback message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Callback.verify|verify} messages. - * @param message Callback message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ICallback, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Callback message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Callback - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Callback; - - /** - * Decodes a Callback message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Callback - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Callback; - - /** - * Verifies a Callback message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Callback message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Callback - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Callback; - - /** - * Creates a plain object from a Callback message. Also converts values to other types if specified. - * @param message Callback - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Callback, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Callback to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Callback - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ModelSettings. */ - interface IModelSettings { - - /** ModelSettings model */ - model?: (string|null); - - /** ModelSettings temperature */ - temperature?: (number|null); - } - - /** Represents a ModelSettings. */ - class ModelSettings implements IModelSettings { - - /** - * Constructs a new ModelSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IModelSettings); - - /** ModelSettings model. */ - public model: string; - - /** ModelSettings temperature. */ - public temperature?: (number|null); - - /** - * Creates a new ModelSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ModelSettings instance - */ - public static create(properties?: google.cloud.ces.v1.IModelSettings): google.cloud.ces.v1.ModelSettings; - - /** - * Encodes the specified ModelSettings message. Does not implicitly {@link google.cloud.ces.v1.ModelSettings.verify|verify} messages. - * @param message ModelSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IModelSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ModelSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ModelSettings.verify|verify} messages. - * @param message ModelSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IModelSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ModelSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ModelSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ModelSettings; - - /** - * Decodes a ModelSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ModelSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ModelSettings; - - /** - * Verifies a ModelSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ModelSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ModelSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ModelSettings; - - /** - * Creates a plain object from a ModelSettings message. Also converts values to other types if specified. - * @param message ModelSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ModelSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ModelSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ModelSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TriggerAction. */ - interface ITriggerAction { - - /** TriggerAction respondImmediately */ - respondImmediately?: (google.cloud.ces.v1.TriggerAction.IRespondImmediately|null); - - /** TriggerAction transferAgent */ - transferAgent?: (google.cloud.ces.v1.TriggerAction.ITransferAgent|null); - - /** TriggerAction generativeAnswer */ - generativeAnswer?: (google.cloud.ces.v1.TriggerAction.IGenerativeAnswer|null); - } - - /** Represents a TriggerAction. */ - class TriggerAction implements ITriggerAction { - - /** - * Constructs a new TriggerAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ITriggerAction); - - /** TriggerAction respondImmediately. */ - public respondImmediately?: (google.cloud.ces.v1.TriggerAction.IRespondImmediately|null); - - /** TriggerAction transferAgent. */ - public transferAgent?: (google.cloud.ces.v1.TriggerAction.ITransferAgent|null); - - /** TriggerAction generativeAnswer. */ - public generativeAnswer?: (google.cloud.ces.v1.TriggerAction.IGenerativeAnswer|null); - - /** TriggerAction action. */ - public action?: ("respondImmediately"|"transferAgent"|"generativeAnswer"); - - /** - * Creates a new TriggerAction instance using the specified properties. - * @param [properties] Properties to set - * @returns TriggerAction instance - */ - public static create(properties?: google.cloud.ces.v1.ITriggerAction): google.cloud.ces.v1.TriggerAction; - - /** - * Encodes the specified TriggerAction message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.verify|verify} messages. - * @param message TriggerAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ITriggerAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TriggerAction message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.verify|verify} messages. - * @param message TriggerAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ITriggerAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TriggerAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TriggerAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TriggerAction; - - /** - * Decodes a TriggerAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TriggerAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TriggerAction; - - /** - * Verifies a TriggerAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TriggerAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TriggerAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TriggerAction; - - /** - * Creates a plain object from a TriggerAction message. Also converts values to other types if specified. - * @param message TriggerAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.TriggerAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TriggerAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TriggerAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TriggerAction { - - /** Properties of a Response. */ - interface IResponse { - - /** Response text */ - text?: (string|null); - - /** Response disabled */ - disabled?: (boolean|null); - } - - /** Represents a Response. */ - class Response implements IResponse { - - /** - * Constructs a new Response. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.TriggerAction.IResponse); - - /** Response text. */ - public text: string; - - /** Response disabled. */ - public disabled: boolean; - - /** - * Creates a new Response instance using the specified properties. - * @param [properties] Properties to set - * @returns Response instance - */ - public static create(properties?: google.cloud.ces.v1.TriggerAction.IResponse): google.cloud.ces.v1.TriggerAction.Response; - - /** - * Encodes the specified Response message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.Response.verify|verify} messages. - * @param message Response message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.TriggerAction.IResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Response message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.Response.verify|verify} messages. - * @param message Response message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.TriggerAction.IResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Response message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Response - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TriggerAction.Response; - - /** - * Decodes a Response message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Response - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TriggerAction.Response; - - /** - * Verifies a Response message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Response message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Response - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TriggerAction.Response; - - /** - * Creates a plain object from a Response message. Also converts values to other types if specified. - * @param message Response - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.TriggerAction.Response, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Response to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Response - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RespondImmediately. */ - interface IRespondImmediately { - - /** RespondImmediately responses */ - responses?: (google.cloud.ces.v1.TriggerAction.IResponse[]|null); - } - - /** Represents a RespondImmediately. */ - class RespondImmediately implements IRespondImmediately { - - /** - * Constructs a new RespondImmediately. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.TriggerAction.IRespondImmediately); - - /** RespondImmediately responses. */ - public responses: google.cloud.ces.v1.TriggerAction.IResponse[]; - - /** - * Creates a new RespondImmediately instance using the specified properties. - * @param [properties] Properties to set - * @returns RespondImmediately instance - */ - public static create(properties?: google.cloud.ces.v1.TriggerAction.IRespondImmediately): google.cloud.ces.v1.TriggerAction.RespondImmediately; - - /** - * Encodes the specified RespondImmediately message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.RespondImmediately.verify|verify} messages. - * @param message RespondImmediately message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.TriggerAction.IRespondImmediately, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RespondImmediately message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.RespondImmediately.verify|verify} messages. - * @param message RespondImmediately message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.TriggerAction.IRespondImmediately, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RespondImmediately message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RespondImmediately - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TriggerAction.RespondImmediately; - - /** - * Decodes a RespondImmediately message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RespondImmediately - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TriggerAction.RespondImmediately; - - /** - * Verifies a RespondImmediately message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RespondImmediately message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RespondImmediately - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TriggerAction.RespondImmediately; - - /** - * Creates a plain object from a RespondImmediately message. Also converts values to other types if specified. - * @param message RespondImmediately - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.TriggerAction.RespondImmediately, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RespondImmediately to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RespondImmediately - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GenerativeAnswer. */ - interface IGenerativeAnswer { - - /** GenerativeAnswer prompt */ - prompt?: (string|null); - } - - /** Represents a GenerativeAnswer. */ - class GenerativeAnswer implements IGenerativeAnswer { - - /** - * Constructs a new GenerativeAnswer. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.TriggerAction.IGenerativeAnswer); - - /** GenerativeAnswer prompt. */ - public prompt: string; - - /** - * Creates a new GenerativeAnswer instance using the specified properties. - * @param [properties] Properties to set - * @returns GenerativeAnswer instance - */ - public static create(properties?: google.cloud.ces.v1.TriggerAction.IGenerativeAnswer): google.cloud.ces.v1.TriggerAction.GenerativeAnswer; - - /** - * Encodes the specified GenerativeAnswer message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.GenerativeAnswer.verify|verify} messages. - * @param message GenerativeAnswer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.TriggerAction.IGenerativeAnswer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenerativeAnswer message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.GenerativeAnswer.verify|verify} messages. - * @param message GenerativeAnswer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.TriggerAction.IGenerativeAnswer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenerativeAnswer message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenerativeAnswer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TriggerAction.GenerativeAnswer; - - /** - * Decodes a GenerativeAnswer message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenerativeAnswer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TriggerAction.GenerativeAnswer; - - /** - * Verifies a GenerativeAnswer message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenerativeAnswer message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenerativeAnswer - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TriggerAction.GenerativeAnswer; - - /** - * Creates a plain object from a GenerativeAnswer message. Also converts values to other types if specified. - * @param message GenerativeAnswer - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.TriggerAction.GenerativeAnswer, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenerativeAnswer to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenerativeAnswer - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TransferAgent. */ - interface ITransferAgent { - - /** TransferAgent agent */ - agent?: (string|null); - } - - /** Represents a TransferAgent. */ - class TransferAgent implements ITransferAgent { - - /** - * Constructs a new TransferAgent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.TriggerAction.ITransferAgent); - - /** TransferAgent agent. */ - public agent: string; - - /** - * Creates a new TransferAgent instance using the specified properties. - * @param [properties] Properties to set - * @returns TransferAgent instance - */ - public static create(properties?: google.cloud.ces.v1.TriggerAction.ITransferAgent): google.cloud.ces.v1.TriggerAction.TransferAgent; - - /** - * Encodes the specified TransferAgent message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.TransferAgent.verify|verify} messages. - * @param message TransferAgent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.TriggerAction.ITransferAgent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransferAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.TransferAgent.verify|verify} messages. - * @param message TransferAgent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.TriggerAction.ITransferAgent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransferAgent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransferAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TriggerAction.TransferAgent; - - /** - * Decodes a TransferAgent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransferAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TriggerAction.TransferAgent; - - /** - * Verifies a TransferAgent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TransferAgent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransferAgent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TriggerAction.TransferAgent; - - /** - * Creates a plain object from a TransferAgent message. Also converts values to other types if specified. - * @param message TransferAgent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.TriggerAction.TransferAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransferAgent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransferAgent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a TlsConfig. */ - interface ITlsConfig { - - /** TlsConfig caCerts */ - caCerts?: (google.cloud.ces.v1.TlsConfig.ICaCert[]|null); - } - - /** Represents a TlsConfig. */ - class TlsConfig implements ITlsConfig { - - /** - * Constructs a new TlsConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ITlsConfig); - - /** TlsConfig caCerts. */ - public caCerts: google.cloud.ces.v1.TlsConfig.ICaCert[]; - - /** - * Creates a new TlsConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns TlsConfig instance - */ - public static create(properties?: google.cloud.ces.v1.ITlsConfig): google.cloud.ces.v1.TlsConfig; - - /** - * Encodes the specified TlsConfig message. Does not implicitly {@link google.cloud.ces.v1.TlsConfig.verify|verify} messages. - * @param message TlsConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ITlsConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TlsConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TlsConfig.verify|verify} messages. - * @param message TlsConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ITlsConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TlsConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TlsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TlsConfig; - - /** - * Decodes a TlsConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TlsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TlsConfig; - - /** - * Verifies a TlsConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TlsConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TlsConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TlsConfig; - - /** - * Creates a plain object from a TlsConfig message. Also converts values to other types if specified. - * @param message TlsConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.TlsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TlsConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TlsConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TlsConfig { - - /** Properties of a CaCert. */ - interface ICaCert { - - /** CaCert displayName */ - displayName?: (string|null); - - /** CaCert cert */ - cert?: (Uint8Array|Buffer|string|null); - } - - /** Represents a CaCert. */ - class CaCert implements ICaCert { - - /** - * Constructs a new CaCert. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.TlsConfig.ICaCert); - - /** CaCert displayName. */ - public displayName: string; - - /** CaCert cert. */ - public cert: (Uint8Array|Buffer|string); - - /** - * Creates a new CaCert instance using the specified properties. - * @param [properties] Properties to set - * @returns CaCert instance - */ - public static create(properties?: google.cloud.ces.v1.TlsConfig.ICaCert): google.cloud.ces.v1.TlsConfig.CaCert; - - /** - * Encodes the specified CaCert message. Does not implicitly {@link google.cloud.ces.v1.TlsConfig.CaCert.verify|verify} messages. - * @param message CaCert message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.TlsConfig.ICaCert, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CaCert message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TlsConfig.CaCert.verify|verify} messages. - * @param message CaCert message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.TlsConfig.ICaCert, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CaCert message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CaCert - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TlsConfig.CaCert; - - /** - * Decodes a CaCert message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CaCert - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TlsConfig.CaCert; - - /** - * Verifies a CaCert message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CaCert message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CaCert - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TlsConfig.CaCert; - - /** - * Creates a plain object from a CaCert message. Also converts values to other types if specified. - * @param message CaCert - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.TlsConfig.CaCert, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CaCert to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CaCert - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ServiceDirectoryConfig. */ - interface IServiceDirectoryConfig { - - /** ServiceDirectoryConfig service */ - service?: (string|null); - } - - /** Represents a ServiceDirectoryConfig. */ - class ServiceDirectoryConfig implements IServiceDirectoryConfig { - - /** - * Constructs a new ServiceDirectoryConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IServiceDirectoryConfig); - - /** ServiceDirectoryConfig service. */ - public service: string; - - /** - * Creates a new ServiceDirectoryConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDirectoryConfig instance - */ - public static create(properties?: google.cloud.ces.v1.IServiceDirectoryConfig): google.cloud.ces.v1.ServiceDirectoryConfig; - - /** - * Encodes the specified ServiceDirectoryConfig message. Does not implicitly {@link google.cloud.ces.v1.ServiceDirectoryConfig.verify|verify} messages. - * @param message ServiceDirectoryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IServiceDirectoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDirectoryConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ServiceDirectoryConfig.verify|verify} messages. - * @param message ServiceDirectoryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IServiceDirectoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDirectoryConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDirectoryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ServiceDirectoryConfig; - - /** - * Decodes a ServiceDirectoryConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDirectoryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ServiceDirectoryConfig; - - /** - * Verifies a ServiceDirectoryConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDirectoryConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDirectoryConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ServiceDirectoryConfig; - - /** - * Creates a plain object from a ServiceDirectoryConfig message. Also converts values to other types if specified. - * @param message ServiceDirectoryConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ServiceDirectoryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDirectoryConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDirectoryConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ChannelProfile. */ - interface IChannelProfile { - - /** ChannelProfile profileId */ - profileId?: (string|null); - - /** ChannelProfile channelType */ - channelType?: (google.cloud.ces.v1.ChannelProfile.ChannelType|keyof typeof google.cloud.ces.v1.ChannelProfile.ChannelType|null); - - /** ChannelProfile personaProperty */ - personaProperty?: (google.cloud.ces.v1.ChannelProfile.IPersonaProperty|null); - - /** ChannelProfile disableDtmf */ - disableDtmf?: (boolean|null); - - /** ChannelProfile disableBargeInControl */ - disableBargeInControl?: (boolean|null); - - /** ChannelProfile webWidgetConfig */ - webWidgetConfig?: (google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig|null); - - /** ChannelProfile noiseSuppressionLevel */ - noiseSuppressionLevel?: (string|null); - } - - /** Represents a ChannelProfile. */ - class ChannelProfile implements IChannelProfile { - - /** - * Constructs a new ChannelProfile. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IChannelProfile); - - /** ChannelProfile profileId. */ - public profileId: string; - - /** ChannelProfile channelType. */ - public channelType: (google.cloud.ces.v1.ChannelProfile.ChannelType|keyof typeof google.cloud.ces.v1.ChannelProfile.ChannelType); - - /** ChannelProfile personaProperty. */ - public personaProperty?: (google.cloud.ces.v1.ChannelProfile.IPersonaProperty|null); - - /** ChannelProfile disableDtmf. */ - public disableDtmf: boolean; - - /** ChannelProfile disableBargeInControl. */ - public disableBargeInControl: boolean; - - /** ChannelProfile webWidgetConfig. */ - public webWidgetConfig?: (google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig|null); - - /** ChannelProfile noiseSuppressionLevel. */ - public noiseSuppressionLevel: string; - - /** - * Creates a new ChannelProfile instance using the specified properties. - * @param [properties] Properties to set - * @returns ChannelProfile instance - */ - public static create(properties?: google.cloud.ces.v1.IChannelProfile): google.cloud.ces.v1.ChannelProfile; - - /** - * Encodes the specified ChannelProfile message. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.verify|verify} messages. - * @param message ChannelProfile message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IChannelProfile, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChannelProfile message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.verify|verify} messages. - * @param message ChannelProfile message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IChannelProfile, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChannelProfile message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChannelProfile - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ChannelProfile; - - /** - * Decodes a ChannelProfile message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChannelProfile - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ChannelProfile; - - /** - * Verifies a ChannelProfile message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ChannelProfile message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChannelProfile - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ChannelProfile; - - /** - * Creates a plain object from a ChannelProfile message. Also converts values to other types if specified. - * @param message ChannelProfile - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ChannelProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChannelProfile to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ChannelProfile - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ChannelProfile { - - /** Properties of a PersonaProperty. */ - interface IPersonaProperty { - - /** PersonaProperty persona */ - persona?: (google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona|keyof typeof google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona|null); - } - - /** Represents a PersonaProperty. */ - class PersonaProperty implements IPersonaProperty { - - /** - * Constructs a new PersonaProperty. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ChannelProfile.IPersonaProperty); - - /** PersonaProperty persona. */ - public persona: (google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona|keyof typeof google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona); - - /** - * Creates a new PersonaProperty instance using the specified properties. - * @param [properties] Properties to set - * @returns PersonaProperty instance - */ - public static create(properties?: google.cloud.ces.v1.ChannelProfile.IPersonaProperty): google.cloud.ces.v1.ChannelProfile.PersonaProperty; - - /** - * Encodes the specified PersonaProperty message. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.PersonaProperty.verify|verify} messages. - * @param message PersonaProperty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ChannelProfile.IPersonaProperty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PersonaProperty message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.PersonaProperty.verify|verify} messages. - * @param message PersonaProperty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ChannelProfile.IPersonaProperty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PersonaProperty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PersonaProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ChannelProfile.PersonaProperty; - - /** - * Decodes a PersonaProperty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PersonaProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ChannelProfile.PersonaProperty; - - /** - * Verifies a PersonaProperty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PersonaProperty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PersonaProperty - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ChannelProfile.PersonaProperty; - - /** - * Creates a plain object from a PersonaProperty message. Also converts values to other types if specified. - * @param message PersonaProperty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ChannelProfile.PersonaProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PersonaProperty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PersonaProperty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PersonaProperty { - - /** Persona enum. */ - enum Persona { - UNKNOWN = 0, - CONCISE = 1, - CHATTY = 2 - } - } - - /** Properties of a WebWidgetConfig. */ - interface IWebWidgetConfig { - - /** WebWidgetConfig modality */ - modality?: (google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality|keyof typeof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality|null); - - /** WebWidgetConfig theme */ - theme?: (google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme|keyof typeof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme|null); - - /** WebWidgetConfig webWidgetTitle */ - webWidgetTitle?: (string|null); - - /** WebWidgetConfig securitySettings */ - securitySettings?: (google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings|null); - } - - /** Represents a WebWidgetConfig. */ - class WebWidgetConfig implements IWebWidgetConfig { - - /** - * Constructs a new WebWidgetConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig); - - /** WebWidgetConfig modality. */ - public modality: (google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality|keyof typeof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality); - - /** WebWidgetConfig theme. */ - public theme: (google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme|keyof typeof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme); - - /** WebWidgetConfig webWidgetTitle. */ - public webWidgetTitle: string; - - /** WebWidgetConfig securitySettings. */ - public securitySettings?: (google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings|null); - - /** - * Creates a new WebWidgetConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns WebWidgetConfig instance - */ - public static create(properties?: google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig): google.cloud.ces.v1.ChannelProfile.WebWidgetConfig; - - /** - * Encodes the specified WebWidgetConfig message. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.verify|verify} messages. - * @param message WebWidgetConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WebWidgetConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.verify|verify} messages. - * @param message WebWidgetConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WebWidgetConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WebWidgetConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ChannelProfile.WebWidgetConfig; - - /** - * Decodes a WebWidgetConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WebWidgetConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ChannelProfile.WebWidgetConfig; - - /** - * Verifies a WebWidgetConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WebWidgetConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WebWidgetConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ChannelProfile.WebWidgetConfig; - - /** - * Creates a plain object from a WebWidgetConfig message. Also converts values to other types if specified. - * @param message WebWidgetConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ChannelProfile.WebWidgetConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WebWidgetConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WebWidgetConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace WebWidgetConfig { - - /** Properties of a SecuritySettings. */ - interface ISecuritySettings { - - /** SecuritySettings enablePublicAccess */ - enablePublicAccess?: (boolean|null); - - /** SecuritySettings enableOriginCheck */ - enableOriginCheck?: (boolean|null); - - /** SecuritySettings allowedOrigins */ - allowedOrigins?: (string[]|null); - - /** SecuritySettings enableRecaptcha */ - enableRecaptcha?: (boolean|null); - } - - /** Represents a SecuritySettings. */ - class SecuritySettings implements ISecuritySettings { - - /** - * Constructs a new SecuritySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings); - - /** SecuritySettings enablePublicAccess. */ - public enablePublicAccess: boolean; - - /** SecuritySettings enableOriginCheck. */ - public enableOriginCheck: boolean; - - /** SecuritySettings allowedOrigins. */ - public allowedOrigins: string[]; - - /** SecuritySettings enableRecaptcha. */ - public enableRecaptcha: boolean; - - /** - * Creates a new SecuritySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns SecuritySettings instance - */ - public static create(properties?: google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings): google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings; - - /** - * Encodes the specified SecuritySettings message. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. - * @param message SecuritySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. - * @param message SecuritySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecuritySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecuritySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings; - - /** - * Decodes a SecuritySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecuritySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings; - - /** - * Verifies a SecuritySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SecuritySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecuritySettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings; - - /** - * Creates a plain object from a SecuritySettings message. Also converts values to other types if specified. - * @param message SecuritySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecuritySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SecuritySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Modality enum. */ - enum Modality { - MODALITY_UNSPECIFIED = 0, - CHAT_AND_VOICE = 1, - VOICE_ONLY = 2, - CHAT_ONLY = 3 - } - - /** Theme enum. */ - enum Theme { - THEME_UNSPECIFIED = 0, - LIGHT = 1, - DARK = 2 - } - } - - /** ChannelType enum. */ - enum ChannelType { - UNKNOWN = 0, - WEB_UI = 2, - API = 3, - TWILIO = 4, - GOOGLE_TELEPHONY_PLATFORM = 5, - CONTACT_CENTER_AS_A_SERVICE = 6, - FIVE9 = 7 - } - } - - /** Properties of a Span. */ - interface ISpan { - - /** Span name */ - name?: (string|null); - - /** Span startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** Span endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** Span duration */ - duration?: (google.protobuf.IDuration|null); - - /** Span attributes */ - attributes?: (google.protobuf.IStruct|null); - - /** Span childSpans */ - childSpans?: (google.cloud.ces.v1.ISpan[]|null); - } - - /** Represents a Span. */ - class Span implements ISpan { - - /** - * Constructs a new Span. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ISpan); - - /** Span name. */ - public name: string; - - /** Span startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** Span endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** Span duration. */ - public duration?: (google.protobuf.IDuration|null); - - /** Span attributes. */ - public attributes?: (google.protobuf.IStruct|null); - - /** Span childSpans. */ - public childSpans: google.cloud.ces.v1.ISpan[]; - - /** - * Creates a new Span instance using the specified properties. - * @param [properties] Properties to set - * @returns Span instance - */ - public static create(properties?: google.cloud.ces.v1.ISpan): google.cloud.ces.v1.Span; - - /** - * Encodes the specified Span message. Does not implicitly {@link google.cloud.ces.v1.Span.verify|verify} messages. - * @param message Span message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ISpan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Span message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Span.verify|verify} messages. - * @param message Span message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ISpan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Span message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Span - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Span; - - /** - * Decodes a Span message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Span - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Span; - - /** - * Verifies a Span message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Span message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Span - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Span; - - /** - * Creates a plain object from a Span message. Also converts values to other types if specified. - * @param message Span - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Span, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Span to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Span - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents an AgentService */ - class AgentService extends $protobuf.rpc.Service { - - /** - * Constructs a new AgentService 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 AgentService 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): AgentService; - - /** - * Calls ListApps. - * @param request ListAppsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAppsResponse - */ - public listApps(request: google.cloud.ces.v1.IListAppsRequest, callback: google.cloud.ces.v1.AgentService.ListAppsCallback): void; - - /** - * Calls ListApps. - * @param request ListAppsRequest message or plain object - * @returns Promise - */ - public listApps(request: google.cloud.ces.v1.IListAppsRequest): Promise; - - /** - * Calls GetApp. - * @param request GetAppRequest message or plain object - * @param callback Node-style callback called with the error, if any, and App - */ - public getApp(request: google.cloud.ces.v1.IGetAppRequest, callback: google.cloud.ces.v1.AgentService.GetAppCallback): void; - - /** - * Calls GetApp. - * @param request GetAppRequest message or plain object - * @returns Promise - */ - public getApp(request: google.cloud.ces.v1.IGetAppRequest): Promise; - - /** - * Calls CreateApp. - * @param request CreateAppRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createApp(request: google.cloud.ces.v1.ICreateAppRequest, callback: google.cloud.ces.v1.AgentService.CreateAppCallback): void; - - /** - * Calls CreateApp. - * @param request CreateAppRequest message or plain object - * @returns Promise - */ - public createApp(request: google.cloud.ces.v1.ICreateAppRequest): Promise; - - /** - * Calls UpdateApp. - * @param request UpdateAppRequest message or plain object - * @param callback Node-style callback called with the error, if any, and App - */ - public updateApp(request: google.cloud.ces.v1.IUpdateAppRequest, callback: google.cloud.ces.v1.AgentService.UpdateAppCallback): void; - - /** - * Calls UpdateApp. - * @param request UpdateAppRequest message or plain object - * @returns Promise - */ - public updateApp(request: google.cloud.ces.v1.IUpdateAppRequest): Promise; - - /** - * Calls DeleteApp. - * @param request DeleteAppRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteApp(request: google.cloud.ces.v1.IDeleteAppRequest, callback: google.cloud.ces.v1.AgentService.DeleteAppCallback): void; - - /** - * Calls DeleteApp. - * @param request DeleteAppRequest message or plain object - * @returns Promise - */ - public deleteApp(request: google.cloud.ces.v1.IDeleteAppRequest): Promise; - - /** - * Calls ExportApp. - * @param request ExportAppRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public exportApp(request: google.cloud.ces.v1.IExportAppRequest, callback: google.cloud.ces.v1.AgentService.ExportAppCallback): void; - - /** - * Calls ExportApp. - * @param request ExportAppRequest message or plain object - * @returns Promise - */ - public exportApp(request: google.cloud.ces.v1.IExportAppRequest): Promise; - - /** - * Calls ImportApp. - * @param request ImportAppRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public importApp(request: google.cloud.ces.v1.IImportAppRequest, callback: google.cloud.ces.v1.AgentService.ImportAppCallback): void; - - /** - * Calls ImportApp. - * @param request ImportAppRequest message or plain object - * @returns Promise - */ - public importApp(request: google.cloud.ces.v1.IImportAppRequest): Promise; - - /** - * Calls ListAgents. - * @param request ListAgentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAgentsResponse - */ - public listAgents(request: google.cloud.ces.v1.IListAgentsRequest, callback: google.cloud.ces.v1.AgentService.ListAgentsCallback): void; - - /** - * Calls ListAgents. - * @param request ListAgentsRequest message or plain object - * @returns Promise - */ - public listAgents(request: google.cloud.ces.v1.IListAgentsRequest): Promise; - - /** - * Calls GetAgent. - * @param request GetAgentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Agent - */ - public getAgent(request: google.cloud.ces.v1.IGetAgentRequest, callback: google.cloud.ces.v1.AgentService.GetAgentCallback): void; - - /** - * Calls GetAgent. - * @param request GetAgentRequest message or plain object - * @returns Promise - */ - public getAgent(request: google.cloud.ces.v1.IGetAgentRequest): Promise; - - /** - * Calls CreateAgent. - * @param request CreateAgentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Agent - */ - public createAgent(request: google.cloud.ces.v1.ICreateAgentRequest, callback: google.cloud.ces.v1.AgentService.CreateAgentCallback): void; - - /** - * Calls CreateAgent. - * @param request CreateAgentRequest message or plain object - * @returns Promise - */ - public createAgent(request: google.cloud.ces.v1.ICreateAgentRequest): Promise; - - /** - * Calls UpdateAgent. - * @param request UpdateAgentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Agent - */ - public updateAgent(request: google.cloud.ces.v1.IUpdateAgentRequest, callback: google.cloud.ces.v1.AgentService.UpdateAgentCallback): void; - - /** - * Calls UpdateAgent. - * @param request UpdateAgentRequest message or plain object - * @returns Promise - */ - public updateAgent(request: google.cloud.ces.v1.IUpdateAgentRequest): Promise; - - /** - * Calls DeleteAgent. - * @param request DeleteAgentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteAgent(request: google.cloud.ces.v1.IDeleteAgentRequest, callback: google.cloud.ces.v1.AgentService.DeleteAgentCallback): void; - - /** - * Calls DeleteAgent. - * @param request DeleteAgentRequest message or plain object - * @returns Promise - */ - public deleteAgent(request: google.cloud.ces.v1.IDeleteAgentRequest): Promise; - - /** - * Calls ListExamples. - * @param request ListExamplesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListExamplesResponse - */ - public listExamples(request: google.cloud.ces.v1.IListExamplesRequest, callback: google.cloud.ces.v1.AgentService.ListExamplesCallback): void; - - /** - * Calls ListExamples. - * @param request ListExamplesRequest message or plain object - * @returns Promise - */ - public listExamples(request: google.cloud.ces.v1.IListExamplesRequest): Promise; - - /** - * Calls GetExample. - * @param request GetExampleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Example - */ - public getExample(request: google.cloud.ces.v1.IGetExampleRequest, callback: google.cloud.ces.v1.AgentService.GetExampleCallback): void; - - /** - * Calls GetExample. - * @param request GetExampleRequest message or plain object - * @returns Promise - */ - public getExample(request: google.cloud.ces.v1.IGetExampleRequest): Promise; - - /** - * Calls CreateExample. - * @param request CreateExampleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Example - */ - public createExample(request: google.cloud.ces.v1.ICreateExampleRequest, callback: google.cloud.ces.v1.AgentService.CreateExampleCallback): void; - - /** - * Calls CreateExample. - * @param request CreateExampleRequest message or plain object - * @returns Promise - */ - public createExample(request: google.cloud.ces.v1.ICreateExampleRequest): Promise; - - /** - * Calls UpdateExample. - * @param request UpdateExampleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Example - */ - public updateExample(request: google.cloud.ces.v1.IUpdateExampleRequest, callback: google.cloud.ces.v1.AgentService.UpdateExampleCallback): void; - - /** - * Calls UpdateExample. - * @param request UpdateExampleRequest message or plain object - * @returns Promise - */ - public updateExample(request: google.cloud.ces.v1.IUpdateExampleRequest): Promise; - - /** - * Calls DeleteExample. - * @param request DeleteExampleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteExample(request: google.cloud.ces.v1.IDeleteExampleRequest, callback: google.cloud.ces.v1.AgentService.DeleteExampleCallback): void; - - /** - * Calls DeleteExample. - * @param request DeleteExampleRequest message or plain object - * @returns Promise - */ - public deleteExample(request: google.cloud.ces.v1.IDeleteExampleRequest): Promise; - - /** - * Calls ListTools. - * @param request ListToolsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListToolsResponse - */ - public listTools(request: google.cloud.ces.v1.IListToolsRequest, callback: google.cloud.ces.v1.AgentService.ListToolsCallback): void; - - /** - * Calls ListTools. - * @param request ListToolsRequest message or plain object - * @returns Promise - */ - public listTools(request: google.cloud.ces.v1.IListToolsRequest): Promise; - - /** - * Calls GetTool. - * @param request GetToolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Tool - */ - public getTool(request: google.cloud.ces.v1.IGetToolRequest, callback: google.cloud.ces.v1.AgentService.GetToolCallback): void; - - /** - * Calls GetTool. - * @param request GetToolRequest message or plain object - * @returns Promise - */ - public getTool(request: google.cloud.ces.v1.IGetToolRequest): Promise; - - /** - * Calls ListConversations. - * @param request ListConversationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListConversationsResponse - */ - public listConversations(request: google.cloud.ces.v1.IListConversationsRequest, callback: google.cloud.ces.v1.AgentService.ListConversationsCallback): void; - - /** - * Calls ListConversations. - * @param request ListConversationsRequest message or plain object - * @returns Promise - */ - public listConversations(request: google.cloud.ces.v1.IListConversationsRequest): Promise; - - /** - * Calls GetConversation. - * @param request GetConversationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Conversation - */ - public getConversation(request: google.cloud.ces.v1.IGetConversationRequest, callback: google.cloud.ces.v1.AgentService.GetConversationCallback): void; - - /** - * Calls GetConversation. - * @param request GetConversationRequest message or plain object - * @returns Promise - */ - public getConversation(request: google.cloud.ces.v1.IGetConversationRequest): Promise; - - /** - * Calls DeleteConversation. - * @param request DeleteConversationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteConversation(request: google.cloud.ces.v1.IDeleteConversationRequest, callback: google.cloud.ces.v1.AgentService.DeleteConversationCallback): void; - - /** - * Calls DeleteConversation. - * @param request DeleteConversationRequest message or plain object - * @returns Promise - */ - public deleteConversation(request: google.cloud.ces.v1.IDeleteConversationRequest): Promise; - - /** - * Calls BatchDeleteConversations. - * @param request BatchDeleteConversationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public batchDeleteConversations(request: google.cloud.ces.v1.IBatchDeleteConversationsRequest, callback: google.cloud.ces.v1.AgentService.BatchDeleteConversationsCallback): void; - - /** - * Calls BatchDeleteConversations. - * @param request BatchDeleteConversationsRequest message or plain object - * @returns Promise - */ - public batchDeleteConversations(request: google.cloud.ces.v1.IBatchDeleteConversationsRequest): Promise; - - /** - * Calls CreateTool. - * @param request CreateToolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Tool - */ - public createTool(request: google.cloud.ces.v1.ICreateToolRequest, callback: google.cloud.ces.v1.AgentService.CreateToolCallback): void; - - /** - * Calls CreateTool. - * @param request CreateToolRequest message or plain object - * @returns Promise - */ - public createTool(request: google.cloud.ces.v1.ICreateToolRequest): Promise; - - /** - * Calls UpdateTool. - * @param request UpdateToolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Tool - */ - public updateTool(request: google.cloud.ces.v1.IUpdateToolRequest, callback: google.cloud.ces.v1.AgentService.UpdateToolCallback): void; - - /** - * Calls UpdateTool. - * @param request UpdateToolRequest message or plain object - * @returns Promise - */ - public updateTool(request: google.cloud.ces.v1.IUpdateToolRequest): Promise; - - /** - * Calls DeleteTool. - * @param request DeleteToolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteTool(request: google.cloud.ces.v1.IDeleteToolRequest, callback: google.cloud.ces.v1.AgentService.DeleteToolCallback): void; - - /** - * Calls DeleteTool. - * @param request DeleteToolRequest message or plain object - * @returns Promise - */ - public deleteTool(request: google.cloud.ces.v1.IDeleteToolRequest): Promise; - - /** - * Calls ListGuardrails. - * @param request ListGuardrailsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListGuardrailsResponse - */ - public listGuardrails(request: google.cloud.ces.v1.IListGuardrailsRequest, callback: google.cloud.ces.v1.AgentService.ListGuardrailsCallback): void; - - /** - * Calls ListGuardrails. - * @param request ListGuardrailsRequest message or plain object - * @returns Promise - */ - public listGuardrails(request: google.cloud.ces.v1.IListGuardrailsRequest): Promise; - - /** - * Calls GetGuardrail. - * @param request GetGuardrailRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Guardrail - */ - public getGuardrail(request: google.cloud.ces.v1.IGetGuardrailRequest, callback: google.cloud.ces.v1.AgentService.GetGuardrailCallback): void; - - /** - * Calls GetGuardrail. - * @param request GetGuardrailRequest message or plain object - * @returns Promise - */ - public getGuardrail(request: google.cloud.ces.v1.IGetGuardrailRequest): Promise; - - /** - * Calls CreateGuardrail. - * @param request CreateGuardrailRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Guardrail - */ - public createGuardrail(request: google.cloud.ces.v1.ICreateGuardrailRequest, callback: google.cloud.ces.v1.AgentService.CreateGuardrailCallback): void; - - /** - * Calls CreateGuardrail. - * @param request CreateGuardrailRequest message or plain object - * @returns Promise - */ - public createGuardrail(request: google.cloud.ces.v1.ICreateGuardrailRequest): Promise; - - /** - * Calls UpdateGuardrail. - * @param request UpdateGuardrailRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Guardrail - */ - public updateGuardrail(request: google.cloud.ces.v1.IUpdateGuardrailRequest, callback: google.cloud.ces.v1.AgentService.UpdateGuardrailCallback): void; - - /** - * Calls UpdateGuardrail. - * @param request UpdateGuardrailRequest message or plain object - * @returns Promise - */ - public updateGuardrail(request: google.cloud.ces.v1.IUpdateGuardrailRequest): Promise; - - /** - * Calls DeleteGuardrail. - * @param request DeleteGuardrailRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteGuardrail(request: google.cloud.ces.v1.IDeleteGuardrailRequest, callback: google.cloud.ces.v1.AgentService.DeleteGuardrailCallback): void; - - /** - * Calls DeleteGuardrail. - * @param request DeleteGuardrailRequest message or plain object - * @returns Promise - */ - public deleteGuardrail(request: google.cloud.ces.v1.IDeleteGuardrailRequest): Promise; - - /** - * Calls ListDeployments. - * @param request ListDeploymentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDeploymentsResponse - */ - public listDeployments(request: google.cloud.ces.v1.IListDeploymentsRequest, callback: google.cloud.ces.v1.AgentService.ListDeploymentsCallback): void; - - /** - * Calls ListDeployments. - * @param request ListDeploymentsRequest message or plain object - * @returns Promise - */ - public listDeployments(request: google.cloud.ces.v1.IListDeploymentsRequest): Promise; - - /** - * Calls GetDeployment. - * @param request GetDeploymentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Deployment - */ - public getDeployment(request: google.cloud.ces.v1.IGetDeploymentRequest, callback: google.cloud.ces.v1.AgentService.GetDeploymentCallback): void; - - /** - * Calls GetDeployment. - * @param request GetDeploymentRequest message or plain object - * @returns Promise - */ - public getDeployment(request: google.cloud.ces.v1.IGetDeploymentRequest): Promise; - - /** - * Calls CreateDeployment. - * @param request CreateDeploymentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Deployment - */ - public createDeployment(request: google.cloud.ces.v1.ICreateDeploymentRequest, callback: google.cloud.ces.v1.AgentService.CreateDeploymentCallback): void; - - /** - * Calls CreateDeployment. - * @param request CreateDeploymentRequest message or plain object - * @returns Promise - */ - public createDeployment(request: google.cloud.ces.v1.ICreateDeploymentRequest): Promise; - - /** - * Calls UpdateDeployment. - * @param request UpdateDeploymentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Deployment - */ - public updateDeployment(request: google.cloud.ces.v1.IUpdateDeploymentRequest, callback: google.cloud.ces.v1.AgentService.UpdateDeploymentCallback): void; - - /** - * Calls UpdateDeployment. - * @param request UpdateDeploymentRequest message or plain object - * @returns Promise - */ - public updateDeployment(request: google.cloud.ces.v1.IUpdateDeploymentRequest): Promise; - - /** - * Calls DeleteDeployment. - * @param request DeleteDeploymentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteDeployment(request: google.cloud.ces.v1.IDeleteDeploymentRequest, callback: google.cloud.ces.v1.AgentService.DeleteDeploymentCallback): void; - - /** - * Calls DeleteDeployment. - * @param request DeleteDeploymentRequest message or plain object - * @returns Promise - */ - public deleteDeployment(request: google.cloud.ces.v1.IDeleteDeploymentRequest): Promise; - - /** - * Calls ListToolsets. - * @param request ListToolsetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListToolsetsResponse - */ - public listToolsets(request: google.cloud.ces.v1.IListToolsetsRequest, callback: google.cloud.ces.v1.AgentService.ListToolsetsCallback): void; - - /** - * Calls ListToolsets. - * @param request ListToolsetsRequest message or plain object - * @returns Promise - */ - public listToolsets(request: google.cloud.ces.v1.IListToolsetsRequest): Promise; - - /** - * Calls GetToolset. - * @param request GetToolsetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Toolset - */ - public getToolset(request: google.cloud.ces.v1.IGetToolsetRequest, callback: google.cloud.ces.v1.AgentService.GetToolsetCallback): void; - - /** - * Calls GetToolset. - * @param request GetToolsetRequest message or plain object - * @returns Promise - */ - public getToolset(request: google.cloud.ces.v1.IGetToolsetRequest): Promise; - - /** - * Calls CreateToolset. - * @param request CreateToolsetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Toolset - */ - public createToolset(request: google.cloud.ces.v1.ICreateToolsetRequest, callback: google.cloud.ces.v1.AgentService.CreateToolsetCallback): void; - - /** - * Calls CreateToolset. - * @param request CreateToolsetRequest message or plain object - * @returns Promise - */ - public createToolset(request: google.cloud.ces.v1.ICreateToolsetRequest): Promise; - - /** - * Calls UpdateToolset. - * @param request UpdateToolsetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Toolset - */ - public updateToolset(request: google.cloud.ces.v1.IUpdateToolsetRequest, callback: google.cloud.ces.v1.AgentService.UpdateToolsetCallback): void; - - /** - * Calls UpdateToolset. - * @param request UpdateToolsetRequest message or plain object - * @returns Promise - */ - public updateToolset(request: google.cloud.ces.v1.IUpdateToolsetRequest): Promise; - - /** - * Calls DeleteToolset. - * @param request DeleteToolsetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteToolset(request: google.cloud.ces.v1.IDeleteToolsetRequest, callback: google.cloud.ces.v1.AgentService.DeleteToolsetCallback): void; - - /** - * Calls DeleteToolset. - * @param request DeleteToolsetRequest message or plain object - * @returns Promise - */ - public deleteToolset(request: google.cloud.ces.v1.IDeleteToolsetRequest): Promise; - - /** - * Calls ListAppVersions. - * @param request ListAppVersionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAppVersionsResponse - */ - public listAppVersions(request: google.cloud.ces.v1.IListAppVersionsRequest, callback: google.cloud.ces.v1.AgentService.ListAppVersionsCallback): void; - - /** - * Calls ListAppVersions. - * @param request ListAppVersionsRequest message or plain object - * @returns Promise - */ - public listAppVersions(request: google.cloud.ces.v1.IListAppVersionsRequest): Promise; - - /** - * Calls GetAppVersion. - * @param request GetAppVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AppVersion - */ - public getAppVersion(request: google.cloud.ces.v1.IGetAppVersionRequest, callback: google.cloud.ces.v1.AgentService.GetAppVersionCallback): void; - - /** - * Calls GetAppVersion. - * @param request GetAppVersionRequest message or plain object - * @returns Promise - */ - public getAppVersion(request: google.cloud.ces.v1.IGetAppVersionRequest): Promise; - - /** - * Calls CreateAppVersion. - * @param request CreateAppVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AppVersion - */ - public createAppVersion(request: google.cloud.ces.v1.ICreateAppVersionRequest, callback: google.cloud.ces.v1.AgentService.CreateAppVersionCallback): void; - - /** - * Calls CreateAppVersion. - * @param request CreateAppVersionRequest message or plain object - * @returns Promise - */ - public createAppVersion(request: google.cloud.ces.v1.ICreateAppVersionRequest): Promise; - - /** - * Calls DeleteAppVersion. - * @param request DeleteAppVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteAppVersion(request: google.cloud.ces.v1.IDeleteAppVersionRequest, callback: google.cloud.ces.v1.AgentService.DeleteAppVersionCallback): void; - - /** - * Calls DeleteAppVersion. - * @param request DeleteAppVersionRequest message or plain object - * @returns Promise - */ - public deleteAppVersion(request: google.cloud.ces.v1.IDeleteAppVersionRequest): Promise; - - /** - * Calls RestoreAppVersion. - * @param request RestoreAppVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public restoreAppVersion(request: google.cloud.ces.v1.IRestoreAppVersionRequest, callback: google.cloud.ces.v1.AgentService.RestoreAppVersionCallback): void; - - /** - * Calls RestoreAppVersion. - * @param request RestoreAppVersionRequest message or plain object - * @returns Promise - */ - public restoreAppVersion(request: google.cloud.ces.v1.IRestoreAppVersionRequest): Promise; - - /** - * Calls ListChangelogs. - * @param request ListChangelogsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListChangelogsResponse - */ - public listChangelogs(request: google.cloud.ces.v1.IListChangelogsRequest, callback: google.cloud.ces.v1.AgentService.ListChangelogsCallback): void; - - /** - * Calls ListChangelogs. - * @param request ListChangelogsRequest message or plain object - * @returns Promise - */ - public listChangelogs(request: google.cloud.ces.v1.IListChangelogsRequest): Promise; - - /** - * Calls GetChangelog. - * @param request GetChangelogRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Changelog - */ - public getChangelog(request: google.cloud.ces.v1.IGetChangelogRequest, callback: google.cloud.ces.v1.AgentService.GetChangelogCallback): void; - - /** - * Calls GetChangelog. - * @param request GetChangelogRequest message or plain object - * @returns Promise - */ - public getChangelog(request: google.cloud.ces.v1.IGetChangelogRequest): Promise; - } - - namespace AgentService { - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listApps}. - * @param error Error, if any - * @param [response] ListAppsResponse - */ - type ListAppsCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListAppsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getApp}. - * @param error Error, if any - * @param [response] App - */ - type GetAppCallback = (error: (Error|null), response?: google.cloud.ces.v1.App) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|createApp}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|updateApp}. - * @param error Error, if any - * @param [response] App - */ - type UpdateAppCallback = (error: (Error|null), response?: google.cloud.ces.v1.App) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteApp}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|exportApp}. - * @param error Error, if any - * @param [response] Operation - */ - type ExportAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|importApp}. - * @param error Error, if any - * @param [response] Operation - */ - type ImportAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listAgents}. - * @param error Error, if any - * @param [response] ListAgentsResponse - */ - type ListAgentsCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListAgentsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getAgent}. - * @param error Error, if any - * @param [response] Agent - */ - type GetAgentCallback = (error: (Error|null), response?: google.cloud.ces.v1.Agent) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|createAgent}. - * @param error Error, if any - * @param [response] Agent - */ - type CreateAgentCallback = (error: (Error|null), response?: google.cloud.ces.v1.Agent) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|updateAgent}. - * @param error Error, if any - * @param [response] Agent - */ - type UpdateAgentCallback = (error: (Error|null), response?: google.cloud.ces.v1.Agent) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteAgent}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteAgentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listExamples}. - * @param error Error, if any - * @param [response] ListExamplesResponse - */ - type ListExamplesCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListExamplesResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getExample}. - * @param error Error, if any - * @param [response] Example - */ - type GetExampleCallback = (error: (Error|null), response?: google.cloud.ces.v1.Example) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|createExample}. - * @param error Error, if any - * @param [response] Example - */ - type CreateExampleCallback = (error: (Error|null), response?: google.cloud.ces.v1.Example) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|updateExample}. - * @param error Error, if any - * @param [response] Example - */ - type UpdateExampleCallback = (error: (Error|null), response?: google.cloud.ces.v1.Example) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteExample}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteExampleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listTools}. - * @param error Error, if any - * @param [response] ListToolsResponse - */ - type ListToolsCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListToolsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getTool}. - * @param error Error, if any - * @param [response] Tool - */ - type GetToolCallback = (error: (Error|null), response?: google.cloud.ces.v1.Tool) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listConversations}. - * @param error Error, if any - * @param [response] ListConversationsResponse - */ - type ListConversationsCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListConversationsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getConversation}. - * @param error Error, if any - * @param [response] Conversation - */ - type GetConversationCallback = (error: (Error|null), response?: google.cloud.ces.v1.Conversation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteConversation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteConversationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|batchDeleteConversations}. - * @param error Error, if any - * @param [response] Operation - */ - type BatchDeleteConversationsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|createTool}. - * @param error Error, if any - * @param [response] Tool - */ - type CreateToolCallback = (error: (Error|null), response?: google.cloud.ces.v1.Tool) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|updateTool}. - * @param error Error, if any - * @param [response] Tool - */ - type UpdateToolCallback = (error: (Error|null), response?: google.cloud.ces.v1.Tool) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteTool}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteToolCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listGuardrails}. - * @param error Error, if any - * @param [response] ListGuardrailsResponse - */ - type ListGuardrailsCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListGuardrailsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getGuardrail}. - * @param error Error, if any - * @param [response] Guardrail - */ - type GetGuardrailCallback = (error: (Error|null), response?: google.cloud.ces.v1.Guardrail) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|createGuardrail}. - * @param error Error, if any - * @param [response] Guardrail - */ - type CreateGuardrailCallback = (error: (Error|null), response?: google.cloud.ces.v1.Guardrail) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|updateGuardrail}. - * @param error Error, if any - * @param [response] Guardrail - */ - type UpdateGuardrailCallback = (error: (Error|null), response?: google.cloud.ces.v1.Guardrail) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteGuardrail}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteGuardrailCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listDeployments}. - * @param error Error, if any - * @param [response] ListDeploymentsResponse - */ - type ListDeploymentsCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListDeploymentsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getDeployment}. - * @param error Error, if any - * @param [response] Deployment - */ - type GetDeploymentCallback = (error: (Error|null), response?: google.cloud.ces.v1.Deployment) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|createDeployment}. - * @param error Error, if any - * @param [response] Deployment - */ - type CreateDeploymentCallback = (error: (Error|null), response?: google.cloud.ces.v1.Deployment) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|updateDeployment}. - * @param error Error, if any - * @param [response] Deployment - */ - type UpdateDeploymentCallback = (error: (Error|null), response?: google.cloud.ces.v1.Deployment) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteDeployment}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteDeploymentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listToolsets}. - * @param error Error, if any - * @param [response] ListToolsetsResponse - */ - type ListToolsetsCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListToolsetsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getToolset}. - * @param error Error, if any - * @param [response] Toolset - */ - type GetToolsetCallback = (error: (Error|null), response?: google.cloud.ces.v1.Toolset) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|createToolset}. - * @param error Error, if any - * @param [response] Toolset - */ - type CreateToolsetCallback = (error: (Error|null), response?: google.cloud.ces.v1.Toolset) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|updateToolset}. - * @param error Error, if any - * @param [response] Toolset - */ - type UpdateToolsetCallback = (error: (Error|null), response?: google.cloud.ces.v1.Toolset) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteToolset}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteToolsetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listAppVersions}. - * @param error Error, if any - * @param [response] ListAppVersionsResponse - */ - type ListAppVersionsCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListAppVersionsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getAppVersion}. - * @param error Error, if any - * @param [response] AppVersion - */ - type GetAppVersionCallback = (error: (Error|null), response?: google.cloud.ces.v1.AppVersion) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|createAppVersion}. - * @param error Error, if any - * @param [response] AppVersion - */ - type CreateAppVersionCallback = (error: (Error|null), response?: google.cloud.ces.v1.AppVersion) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteAppVersion}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteAppVersionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|restoreAppVersion}. - * @param error Error, if any - * @param [response] Operation - */ - type RestoreAppVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listChangelogs}. - * @param error Error, if any - * @param [response] ListChangelogsResponse - */ - type ListChangelogsCallback = (error: (Error|null), response?: google.cloud.ces.v1.ListChangelogsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getChangelog}. - * @param error Error, if any - * @param [response] Changelog - */ - type GetChangelogCallback = (error: (Error|null), response?: google.cloud.ces.v1.Changelog) => void; - } - - /** Properties of a ListAppsRequest. */ - interface IListAppsRequest { - - /** ListAppsRequest parent */ - parent?: (string|null); - - /** ListAppsRequest pageSize */ - pageSize?: (number|null); - - /** ListAppsRequest pageToken */ - pageToken?: (string|null); - - /** ListAppsRequest filter */ - filter?: (string|null); - - /** ListAppsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListAppsRequest. */ - class ListAppsRequest implements IListAppsRequest { - - /** - * Constructs a new ListAppsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListAppsRequest); - - /** ListAppsRequest parent. */ - public parent: string; - - /** ListAppsRequest pageSize. */ - public pageSize: number; - - /** ListAppsRequest pageToken. */ - public pageToken: string; - - /** ListAppsRequest filter. */ - public filter: string; - - /** ListAppsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListAppsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAppsRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IListAppsRequest): google.cloud.ces.v1.ListAppsRequest; - - /** - * Encodes the specified ListAppsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListAppsRequest.verify|verify} messages. - * @param message ListAppsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListAppsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAppsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAppsRequest.verify|verify} messages. - * @param message ListAppsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListAppsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAppsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAppsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListAppsRequest; - - /** - * Decodes a ListAppsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAppsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListAppsRequest; - - /** - * Verifies a ListAppsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAppsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAppsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListAppsRequest; - - /** - * Creates a plain object from a ListAppsRequest message. Also converts values to other types if specified. - * @param message ListAppsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListAppsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAppsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAppsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAppsResponse. */ - interface IListAppsResponse { - - /** ListAppsResponse apps */ - apps?: (google.cloud.ces.v1.IApp[]|null); - - /** ListAppsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListAppsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListAppsResponse. */ - class ListAppsResponse implements IListAppsResponse { - - /** - * Constructs a new ListAppsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListAppsResponse); - - /** ListAppsResponse apps. */ - public apps: google.cloud.ces.v1.IApp[]; - - /** ListAppsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListAppsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListAppsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAppsResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IListAppsResponse): google.cloud.ces.v1.ListAppsResponse; - - /** - * Encodes the specified ListAppsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListAppsResponse.verify|verify} messages. - * @param message ListAppsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListAppsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAppsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAppsResponse.verify|verify} messages. - * @param message ListAppsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListAppsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAppsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAppsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListAppsResponse; - - /** - * Decodes a ListAppsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAppsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListAppsResponse; - - /** - * Verifies a ListAppsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAppsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAppsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListAppsResponse; - - /** - * Creates a plain object from a ListAppsResponse message. Also converts values to other types if specified. - * @param message ListAppsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListAppsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAppsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAppsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetAppRequest. */ - interface IGetAppRequest { - - /** GetAppRequest name */ - name?: (string|null); - } - - /** Represents a GetAppRequest. */ - class GetAppRequest implements IGetAppRequest { - - /** - * Constructs a new GetAppRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IGetAppRequest); - - /** GetAppRequest name. */ - public name: string; - - /** - * Creates a new GetAppRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetAppRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IGetAppRequest): google.cloud.ces.v1.GetAppRequest; - - /** - * Encodes the specified GetAppRequest message. Does not implicitly {@link google.cloud.ces.v1.GetAppRequest.verify|verify} messages. - * @param message GetAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IGetAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetAppRequest.verify|verify} messages. - * @param message GetAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IGetAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetAppRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetAppRequest; - - /** - * Decodes a GetAppRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetAppRequest; - - /** - * Verifies a GetAppRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetAppRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetAppRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetAppRequest; - - /** - * Creates a plain object from a GetAppRequest message. Also converts values to other types if specified. - * @param message GetAppRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.GetAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetAppRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetAppRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateAppRequest. */ - interface ICreateAppRequest { - - /** CreateAppRequest parent */ - parent?: (string|null); - - /** CreateAppRequest appId */ - appId?: (string|null); - - /** CreateAppRequest app */ - app?: (google.cloud.ces.v1.IApp|null); - } - - /** Represents a CreateAppRequest. */ - class CreateAppRequest implements ICreateAppRequest { - - /** - * Constructs a new CreateAppRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ICreateAppRequest); - - /** CreateAppRequest parent. */ - public parent: string; - - /** CreateAppRequest appId. */ - public appId: string; - - /** CreateAppRequest app. */ - public app?: (google.cloud.ces.v1.IApp|null); - - /** - * Creates a new CreateAppRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateAppRequest instance - */ - public static create(properties?: google.cloud.ces.v1.ICreateAppRequest): google.cloud.ces.v1.CreateAppRequest; - - /** - * Encodes the specified CreateAppRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateAppRequest.verify|verify} messages. - * @param message CreateAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ICreateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateAppRequest.verify|verify} messages. - * @param message CreateAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ICreateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateAppRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CreateAppRequest; - - /** - * Decodes a CreateAppRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CreateAppRequest; - - /** - * Verifies a CreateAppRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateAppRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateAppRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CreateAppRequest; - - /** - * Creates a plain object from a CreateAppRequest message. Also converts values to other types if specified. - * @param message CreateAppRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.CreateAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateAppRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateAppRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateAppRequest. */ - interface IUpdateAppRequest { - - /** UpdateAppRequest app */ - app?: (google.cloud.ces.v1.IApp|null); - - /** UpdateAppRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateAppRequest. */ - class UpdateAppRequest implements IUpdateAppRequest { - - /** - * Constructs a new UpdateAppRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IUpdateAppRequest); - - /** UpdateAppRequest app. */ - public app?: (google.cloud.ces.v1.IApp|null); - - /** UpdateAppRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateAppRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateAppRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IUpdateAppRequest): google.cloud.ces.v1.UpdateAppRequest; - - /** - * Encodes the specified UpdateAppRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateAppRequest.verify|verify} messages. - * @param message UpdateAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IUpdateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateAppRequest.verify|verify} messages. - * @param message UpdateAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IUpdateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateAppRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.UpdateAppRequest; - - /** - * Decodes an UpdateAppRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.UpdateAppRequest; - - /** - * Verifies an UpdateAppRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateAppRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateAppRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.UpdateAppRequest; - - /** - * Creates a plain object from an UpdateAppRequest message. Also converts values to other types if specified. - * @param message UpdateAppRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.UpdateAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateAppRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateAppRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteAppRequest. */ - interface IDeleteAppRequest { - - /** DeleteAppRequest name */ - name?: (string|null); - - /** DeleteAppRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteAppRequest. */ - class DeleteAppRequest implements IDeleteAppRequest { - - /** - * Constructs a new DeleteAppRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IDeleteAppRequest); - - /** DeleteAppRequest name. */ - public name: string; - - /** DeleteAppRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteAppRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteAppRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IDeleteAppRequest): google.cloud.ces.v1.DeleteAppRequest; - - /** - * Encodes the specified DeleteAppRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteAppRequest.verify|verify} messages. - * @param message DeleteAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IDeleteAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteAppRequest.verify|verify} messages. - * @param message DeleteAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IDeleteAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteAppRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DeleteAppRequest; - - /** - * Decodes a DeleteAppRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DeleteAppRequest; - - /** - * Verifies a DeleteAppRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteAppRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteAppRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DeleteAppRequest; - - /** - * Creates a plain object from a DeleteAppRequest message. Also converts values to other types if specified. - * @param message DeleteAppRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DeleteAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteAppRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteAppRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExportAppRequest. */ - interface IExportAppRequest { - - /** ExportAppRequest name */ - name?: (string|null); - - /** ExportAppRequest exportFormat */ - exportFormat?: (google.cloud.ces.v1.ExportAppRequest.ExportFormat|keyof typeof google.cloud.ces.v1.ExportAppRequest.ExportFormat|null); - - /** ExportAppRequest gcsUri */ - gcsUri?: (string|null); - } - - /** Represents an ExportAppRequest. */ - class ExportAppRequest implements IExportAppRequest { - - /** - * Constructs a new ExportAppRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IExportAppRequest); - - /** ExportAppRequest name. */ - public name: string; - - /** ExportAppRequest exportFormat. */ - public exportFormat: (google.cloud.ces.v1.ExportAppRequest.ExportFormat|keyof typeof google.cloud.ces.v1.ExportAppRequest.ExportFormat); - - /** ExportAppRequest gcsUri. */ - public gcsUri: string; - - /** - * Creates a new ExportAppRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportAppRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IExportAppRequest): google.cloud.ces.v1.ExportAppRequest; - - /** - * Encodes the specified ExportAppRequest message. Does not implicitly {@link google.cloud.ces.v1.ExportAppRequest.verify|verify} messages. - * @param message ExportAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IExportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExportAppRequest.verify|verify} messages. - * @param message ExportAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IExportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExportAppRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ExportAppRequest; - - /** - * Decodes an ExportAppRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ExportAppRequest; - - /** - * Verifies an ExportAppRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExportAppRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportAppRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ExportAppRequest; - - /** - * Creates a plain object from an ExportAppRequest message. Also converts values to other types if specified. - * @param message ExportAppRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ExportAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportAppRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExportAppRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExportAppRequest { - - /** ExportFormat enum. */ - enum ExportFormat { - EXPORT_FORMAT_UNSPECIFIED = 0, - JSON = 1, - YAML = 2 - } - } - - /** Properties of an ExportAppResponse. */ - interface IExportAppResponse { - - /** ExportAppResponse appContent */ - appContent?: (Uint8Array|Buffer|string|null); - - /** ExportAppResponse appUri */ - appUri?: (string|null); - } - - /** Represents an ExportAppResponse. */ - class ExportAppResponse implements IExportAppResponse { - - /** - * Constructs a new ExportAppResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IExportAppResponse); - - /** ExportAppResponse appContent. */ - public appContent?: (Uint8Array|Buffer|string|null); - - /** ExportAppResponse appUri. */ - public appUri?: (string|null); - - /** ExportAppResponse app. */ - public app?: ("appContent"|"appUri"); - - /** - * Creates a new ExportAppResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportAppResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IExportAppResponse): google.cloud.ces.v1.ExportAppResponse; - - /** - * Encodes the specified ExportAppResponse message. Does not implicitly {@link google.cloud.ces.v1.ExportAppResponse.verify|verify} messages. - * @param message ExportAppResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IExportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExportAppResponse.verify|verify} messages. - * @param message ExportAppResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IExportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExportAppResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportAppResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ExportAppResponse; - - /** - * Decodes an ExportAppResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportAppResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ExportAppResponse; - - /** - * Verifies an ExportAppResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExportAppResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportAppResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ExportAppResponse; - - /** - * Creates a plain object from an ExportAppResponse message. Also converts values to other types if specified. - * @param message ExportAppResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ExportAppResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportAppResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExportAppResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ImportAppRequest. */ - interface IImportAppRequest { - - /** ImportAppRequest gcsUri */ - gcsUri?: (string|null); - - /** ImportAppRequest appContent */ - appContent?: (Uint8Array|Buffer|string|null); - - /** ImportAppRequest parent */ - parent?: (string|null); - - /** ImportAppRequest displayName */ - displayName?: (string|null); - - /** ImportAppRequest appId */ - appId?: (string|null); - - /** ImportAppRequest importOptions */ - importOptions?: (google.cloud.ces.v1.ImportAppRequest.IImportOptions|null); - - /** ImportAppRequest ignoreAppLock */ - ignoreAppLock?: (boolean|null); - } - - /** Represents an ImportAppRequest. */ - class ImportAppRequest implements IImportAppRequest { - - /** - * Constructs a new ImportAppRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IImportAppRequest); - - /** ImportAppRequest gcsUri. */ - public gcsUri?: (string|null); - - /** ImportAppRequest appContent. */ - public appContent?: (Uint8Array|Buffer|string|null); - - /** ImportAppRequest parent. */ - public parent: string; - - /** ImportAppRequest displayName. */ - public displayName: string; - - /** ImportAppRequest appId. */ - public appId: string; - - /** ImportAppRequest importOptions. */ - public importOptions?: (google.cloud.ces.v1.ImportAppRequest.IImportOptions|null); - - /** ImportAppRequest ignoreAppLock. */ - public ignoreAppLock: boolean; - - /** ImportAppRequest app. */ - public app?: ("gcsUri"|"appContent"); - - /** - * Creates a new ImportAppRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportAppRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IImportAppRequest): google.cloud.ces.v1.ImportAppRequest; - - /** - * Encodes the specified ImportAppRequest message. Does not implicitly {@link google.cloud.ces.v1.ImportAppRequest.verify|verify} messages. - * @param message ImportAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IImportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ImportAppRequest.verify|verify} messages. - * @param message ImportAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IImportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportAppRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ImportAppRequest; - - /** - * Decodes an ImportAppRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ImportAppRequest; - - /** - * Verifies an ImportAppRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ImportAppRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportAppRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ImportAppRequest; - - /** - * Creates a plain object from an ImportAppRequest message. Also converts values to other types if specified. - * @param message ImportAppRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ImportAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportAppRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportAppRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ImportAppRequest { - - /** Properties of an ImportOptions. */ - interface IImportOptions { - - /** ImportOptions conflictResolutionStrategy */ - conflictResolutionStrategy?: (google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|keyof typeof google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|null); - } - - /** Represents an ImportOptions. */ - class ImportOptions implements IImportOptions { - - /** - * Constructs a new ImportOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ImportAppRequest.IImportOptions); - - /** ImportOptions conflictResolutionStrategy. */ - public conflictResolutionStrategy: (google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|keyof typeof google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy); - - /** - * Creates a new ImportOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportOptions instance - */ - public static create(properties?: google.cloud.ces.v1.ImportAppRequest.IImportOptions): google.cloud.ces.v1.ImportAppRequest.ImportOptions; - - /** - * Encodes the specified ImportOptions message. Does not implicitly {@link google.cloud.ces.v1.ImportAppRequest.ImportOptions.verify|verify} messages. - * @param message ImportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ImportAppRequest.IImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportOptions message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ImportAppRequest.ImportOptions.verify|verify} messages. - * @param message ImportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ImportAppRequest.IImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ImportAppRequest.ImportOptions; - - /** - * Decodes an ImportOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ImportAppRequest.ImportOptions; - - /** - * Verifies an ImportOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ImportOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ImportAppRequest.ImportOptions; - - /** - * Creates a plain object from an ImportOptions message. Also converts values to other types if specified. - * @param message ImportOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ImportAppRequest.ImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ImportOptions { - - /** ConflictResolutionStrategy enum. */ - enum ConflictResolutionStrategy { - CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED = 0, - REPLACE = 1, - OVERWRITE = 2 - } - } - } - - /** Properties of an ImportAppResponse. */ - interface IImportAppResponse { - - /** ImportAppResponse name */ - name?: (string|null); - - /** ImportAppResponse warnings */ - warnings?: (string[]|null); - } - - /** Represents an ImportAppResponse. */ - class ImportAppResponse implements IImportAppResponse { - - /** - * Constructs a new ImportAppResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IImportAppResponse); - - /** ImportAppResponse name. */ - public name: string; - - /** ImportAppResponse warnings. */ - public warnings: string[]; - - /** - * Creates a new ImportAppResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportAppResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IImportAppResponse): google.cloud.ces.v1.ImportAppResponse; - - /** - * Encodes the specified ImportAppResponse message. Does not implicitly {@link google.cloud.ces.v1.ImportAppResponse.verify|verify} messages. - * @param message ImportAppResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IImportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ImportAppResponse.verify|verify} messages. - * @param message ImportAppResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IImportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportAppResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportAppResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ImportAppResponse; - - /** - * Decodes an ImportAppResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportAppResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ImportAppResponse; - - /** - * Verifies an ImportAppResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ImportAppResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportAppResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ImportAppResponse; - - /** - * Creates a plain object from an ImportAppResponse message. Also converts values to other types if specified. - * @param message ImportAppResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ImportAppResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportAppResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportAppResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAgentsRequest. */ - interface IListAgentsRequest { - - /** ListAgentsRequest parent */ - parent?: (string|null); - - /** ListAgentsRequest pageSize */ - pageSize?: (number|null); - - /** ListAgentsRequest pageToken */ - pageToken?: (string|null); - - /** ListAgentsRequest filter */ - filter?: (string|null); - - /** ListAgentsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListAgentsRequest. */ - class ListAgentsRequest implements IListAgentsRequest { - - /** - * Constructs a new ListAgentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListAgentsRequest); - - /** ListAgentsRequest parent. */ - public parent: string; - - /** ListAgentsRequest pageSize. */ - public pageSize: number; - - /** ListAgentsRequest pageToken. */ - public pageToken: string; - - /** ListAgentsRequest filter. */ - public filter: string; - - /** ListAgentsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListAgentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAgentsRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IListAgentsRequest): google.cloud.ces.v1.ListAgentsRequest; - - /** - * Encodes the specified ListAgentsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListAgentsRequest.verify|verify} messages. - * @param message ListAgentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListAgentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAgentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAgentsRequest.verify|verify} messages. - * @param message ListAgentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListAgentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAgentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAgentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListAgentsRequest; - - /** - * Decodes a ListAgentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAgentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListAgentsRequest; - - /** - * Verifies a ListAgentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAgentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAgentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListAgentsRequest; - - /** - * Creates a plain object from a ListAgentsRequest message. Also converts values to other types if specified. - * @param message ListAgentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListAgentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAgentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAgentsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAgentsResponse. */ - interface IListAgentsResponse { - - /** ListAgentsResponse agents */ - agents?: (google.cloud.ces.v1.IAgent[]|null); - - /** ListAgentsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListAgentsResponse. */ - class ListAgentsResponse implements IListAgentsResponse { - - /** - * Constructs a new ListAgentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListAgentsResponse); - - /** ListAgentsResponse agents. */ - public agents: google.cloud.ces.v1.IAgent[]; - - /** ListAgentsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListAgentsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAgentsResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IListAgentsResponse): google.cloud.ces.v1.ListAgentsResponse; - - /** - * Encodes the specified ListAgentsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListAgentsResponse.verify|verify} messages. - * @param message ListAgentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListAgentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAgentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAgentsResponse.verify|verify} messages. - * @param message ListAgentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListAgentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAgentsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAgentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListAgentsResponse; - - /** - * Decodes a ListAgentsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAgentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListAgentsResponse; - - /** - * Verifies a ListAgentsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAgentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAgentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListAgentsResponse; - - /** - * Creates a plain object from a ListAgentsResponse message. Also converts values to other types if specified. - * @param message ListAgentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListAgentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAgentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAgentsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetAgentRequest. */ - interface IGetAgentRequest { - - /** GetAgentRequest name */ - name?: (string|null); - } - - /** Represents a GetAgentRequest. */ - class GetAgentRequest implements IGetAgentRequest { - - /** - * Constructs a new GetAgentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IGetAgentRequest); - - /** GetAgentRequest name. */ - public name: string; - - /** - * Creates a new GetAgentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetAgentRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IGetAgentRequest): google.cloud.ces.v1.GetAgentRequest; - - /** - * Encodes the specified GetAgentRequest message. Does not implicitly {@link google.cloud.ces.v1.GetAgentRequest.verify|verify} messages. - * @param message GetAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IGetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetAgentRequest.verify|verify} messages. - * @param message GetAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IGetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetAgentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetAgentRequest; - - /** - * Decodes a GetAgentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetAgentRequest; - - /** - * Verifies a GetAgentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetAgentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetAgentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetAgentRequest; - - /** - * Creates a plain object from a GetAgentRequest message. Also converts values to other types if specified. - * @param message GetAgentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.GetAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetAgentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetAgentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateAgentRequest. */ - interface ICreateAgentRequest { - - /** CreateAgentRequest parent */ - parent?: (string|null); - - /** CreateAgentRequest agentId */ - agentId?: (string|null); - - /** CreateAgentRequest agent */ - agent?: (google.cloud.ces.v1.IAgent|null); - } - - /** Represents a CreateAgentRequest. */ - class CreateAgentRequest implements ICreateAgentRequest { - - /** - * Constructs a new CreateAgentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ICreateAgentRequest); - - /** CreateAgentRequest parent. */ - public parent: string; - - /** CreateAgentRequest agentId. */ - public agentId: string; - - /** CreateAgentRequest agent. */ - public agent?: (google.cloud.ces.v1.IAgent|null); - - /** - * Creates a new CreateAgentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateAgentRequest instance - */ - public static create(properties?: google.cloud.ces.v1.ICreateAgentRequest): google.cloud.ces.v1.CreateAgentRequest; - - /** - * Encodes the specified CreateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateAgentRequest.verify|verify} messages. - * @param message CreateAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ICreateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateAgentRequest.verify|verify} messages. - * @param message CreateAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ICreateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateAgentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CreateAgentRequest; - - /** - * Decodes a CreateAgentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CreateAgentRequest; - - /** - * Verifies a CreateAgentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateAgentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateAgentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CreateAgentRequest; - - /** - * Creates a plain object from a CreateAgentRequest message. Also converts values to other types if specified. - * @param message CreateAgentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.CreateAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateAgentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateAgentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateAgentRequest. */ - interface IUpdateAgentRequest { - - /** UpdateAgentRequest agent */ - agent?: (google.cloud.ces.v1.IAgent|null); - - /** UpdateAgentRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateAgentRequest. */ - class UpdateAgentRequest implements IUpdateAgentRequest { - - /** - * Constructs a new UpdateAgentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IUpdateAgentRequest); - - /** UpdateAgentRequest agent. */ - public agent?: (google.cloud.ces.v1.IAgent|null); - - /** UpdateAgentRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateAgentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateAgentRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IUpdateAgentRequest): google.cloud.ces.v1.UpdateAgentRequest; - - /** - * Encodes the specified UpdateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateAgentRequest.verify|verify} messages. - * @param message UpdateAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IUpdateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateAgentRequest.verify|verify} messages. - * @param message UpdateAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IUpdateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateAgentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.UpdateAgentRequest; - - /** - * Decodes an UpdateAgentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.UpdateAgentRequest; - - /** - * Verifies an UpdateAgentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateAgentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateAgentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.UpdateAgentRequest; - - /** - * Creates a plain object from an UpdateAgentRequest message. Also converts values to other types if specified. - * @param message UpdateAgentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.UpdateAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateAgentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateAgentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteAgentRequest. */ - interface IDeleteAgentRequest { - - /** DeleteAgentRequest name */ - name?: (string|null); - - /** DeleteAgentRequest force */ - force?: (boolean|null); - - /** DeleteAgentRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteAgentRequest. */ - class DeleteAgentRequest implements IDeleteAgentRequest { - - /** - * Constructs a new DeleteAgentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IDeleteAgentRequest); - - /** DeleteAgentRequest name. */ - public name: string; - - /** DeleteAgentRequest force. */ - public force: boolean; - - /** DeleteAgentRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteAgentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteAgentRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IDeleteAgentRequest): google.cloud.ces.v1.DeleteAgentRequest; - - /** - * Encodes the specified DeleteAgentRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteAgentRequest.verify|verify} messages. - * @param message DeleteAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IDeleteAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteAgentRequest.verify|verify} messages. - * @param message DeleteAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IDeleteAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteAgentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DeleteAgentRequest; - - /** - * Decodes a DeleteAgentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DeleteAgentRequest; - - /** - * Verifies a DeleteAgentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteAgentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteAgentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DeleteAgentRequest; - - /** - * Creates a plain object from a DeleteAgentRequest message. Also converts values to other types if specified. - * @param message DeleteAgentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DeleteAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteAgentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteAgentRequest - * @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 createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata statusMessage */ - statusMessage?: (string|null); - - /** OperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); - } - - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { - - /** - * Constructs a new OperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IOperationMetadata); - - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata statusMessage. */ - public statusMessage: string; - - /** OperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationMetadata instance - */ - public static create(properties?: google.cloud.ces.v1.IOperationMetadata): google.cloud.ces.v1.OperationMetadata; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.ces.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.ces.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.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.ces.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.ces.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.ces.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.ces.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.ces.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 ListExamplesRequest. */ - interface IListExamplesRequest { - - /** ListExamplesRequest parent */ - parent?: (string|null); - - /** ListExamplesRequest pageSize */ - pageSize?: (number|null); - - /** ListExamplesRequest pageToken */ - pageToken?: (string|null); - - /** ListExamplesRequest filter */ - filter?: (string|null); - - /** ListExamplesRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListExamplesRequest. */ - class ListExamplesRequest implements IListExamplesRequest { - - /** - * Constructs a new ListExamplesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListExamplesRequest); - - /** ListExamplesRequest parent. */ - public parent: string; - - /** ListExamplesRequest pageSize. */ - public pageSize: number; - - /** ListExamplesRequest pageToken. */ - public pageToken: string; - - /** ListExamplesRequest filter. */ - public filter: string; - - /** ListExamplesRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListExamplesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListExamplesRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IListExamplesRequest): google.cloud.ces.v1.ListExamplesRequest; - - /** - * Encodes the specified ListExamplesRequest message. Does not implicitly {@link google.cloud.ces.v1.ListExamplesRequest.verify|verify} messages. - * @param message ListExamplesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListExamplesRequest.verify|verify} messages. - * @param message ListExamplesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListExamplesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListExamplesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListExamplesRequest; - - /** - * Decodes a ListExamplesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListExamplesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListExamplesRequest; - - /** - * Verifies a ListExamplesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListExamplesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListExamplesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListExamplesRequest; - - /** - * Creates a plain object from a ListExamplesRequest message. Also converts values to other types if specified. - * @param message ListExamplesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListExamplesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListExamplesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListExamplesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListExamplesResponse. */ - interface IListExamplesResponse { - - /** ListExamplesResponse examples */ - examples?: (google.cloud.ces.v1.IExample[]|null); - - /** ListExamplesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListExamplesResponse. */ - class ListExamplesResponse implements IListExamplesResponse { - - /** - * Constructs a new ListExamplesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListExamplesResponse); - - /** ListExamplesResponse examples. */ - public examples: google.cloud.ces.v1.IExample[]; - - /** ListExamplesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListExamplesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListExamplesResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IListExamplesResponse): google.cloud.ces.v1.ListExamplesResponse; - - /** - * Encodes the specified ListExamplesResponse message. Does not implicitly {@link google.cloud.ces.v1.ListExamplesResponse.verify|verify} messages. - * @param message ListExamplesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListExamplesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListExamplesResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListExamplesResponse.verify|verify} messages. - * @param message ListExamplesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListExamplesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListExamplesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListExamplesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListExamplesResponse; - - /** - * Decodes a ListExamplesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListExamplesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListExamplesResponse; - - /** - * Verifies a ListExamplesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListExamplesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListExamplesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListExamplesResponse; - - /** - * Creates a plain object from a ListExamplesResponse message. Also converts values to other types if specified. - * @param message ListExamplesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListExamplesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListExamplesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListExamplesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetExampleRequest. */ - interface IGetExampleRequest { - - /** GetExampleRequest name */ - name?: (string|null); - } - - /** Represents a GetExampleRequest. */ - class GetExampleRequest implements IGetExampleRequest { - - /** - * Constructs a new GetExampleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IGetExampleRequest); - - /** GetExampleRequest name. */ - public name: string; - - /** - * Creates a new GetExampleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetExampleRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IGetExampleRequest): google.cloud.ces.v1.GetExampleRequest; - - /** - * Encodes the specified GetExampleRequest message. Does not implicitly {@link google.cloud.ces.v1.GetExampleRequest.verify|verify} messages. - * @param message GetExampleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IGetExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetExampleRequest.verify|verify} messages. - * @param message GetExampleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IGetExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetExampleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetExampleRequest; - - /** - * Decodes a GetExampleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetExampleRequest; - - /** - * Verifies a GetExampleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetExampleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetExampleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetExampleRequest; - - /** - * Creates a plain object from a GetExampleRequest message. Also converts values to other types if specified. - * @param message GetExampleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.GetExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetExampleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetExampleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateExampleRequest. */ - interface ICreateExampleRequest { - - /** CreateExampleRequest parent */ - parent?: (string|null); - - /** CreateExampleRequest exampleId */ - exampleId?: (string|null); - - /** CreateExampleRequest example */ - example?: (google.cloud.ces.v1.IExample|null); - } - - /** Represents a CreateExampleRequest. */ - class CreateExampleRequest implements ICreateExampleRequest { - - /** - * Constructs a new CreateExampleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ICreateExampleRequest); - - /** CreateExampleRequest parent. */ - public parent: string; - - /** CreateExampleRequest exampleId. */ - public exampleId: string; - - /** CreateExampleRequest example. */ - public example?: (google.cloud.ces.v1.IExample|null); - - /** - * Creates a new CreateExampleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateExampleRequest instance - */ - public static create(properties?: google.cloud.ces.v1.ICreateExampleRequest): google.cloud.ces.v1.CreateExampleRequest; - - /** - * Encodes the specified CreateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateExampleRequest.verify|verify} messages. - * @param message CreateExampleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ICreateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateExampleRequest.verify|verify} messages. - * @param message CreateExampleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ICreateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateExampleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CreateExampleRequest; - - /** - * Decodes a CreateExampleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CreateExampleRequest; - - /** - * Verifies a CreateExampleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateExampleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateExampleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CreateExampleRequest; - - /** - * Creates a plain object from a CreateExampleRequest message. Also converts values to other types if specified. - * @param message CreateExampleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.CreateExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateExampleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateExampleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateExampleRequest. */ - interface IUpdateExampleRequest { - - /** UpdateExampleRequest example */ - example?: (google.cloud.ces.v1.IExample|null); - - /** UpdateExampleRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateExampleRequest. */ - class UpdateExampleRequest implements IUpdateExampleRequest { - - /** - * Constructs a new UpdateExampleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IUpdateExampleRequest); - - /** UpdateExampleRequest example. */ - public example?: (google.cloud.ces.v1.IExample|null); - - /** UpdateExampleRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateExampleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateExampleRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IUpdateExampleRequest): google.cloud.ces.v1.UpdateExampleRequest; - - /** - * Encodes the specified UpdateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateExampleRequest.verify|verify} messages. - * @param message UpdateExampleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IUpdateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateExampleRequest.verify|verify} messages. - * @param message UpdateExampleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IUpdateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateExampleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.UpdateExampleRequest; - - /** - * Decodes an UpdateExampleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.UpdateExampleRequest; - - /** - * Verifies an UpdateExampleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateExampleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateExampleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.UpdateExampleRequest; - - /** - * Creates a plain object from an UpdateExampleRequest message. Also converts values to other types if specified. - * @param message UpdateExampleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.UpdateExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateExampleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateExampleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteExampleRequest. */ - interface IDeleteExampleRequest { - - /** DeleteExampleRequest name */ - name?: (string|null); - - /** DeleteExampleRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteExampleRequest. */ - class DeleteExampleRequest implements IDeleteExampleRequest { - - /** - * Constructs a new DeleteExampleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IDeleteExampleRequest); - - /** DeleteExampleRequest name. */ - public name: string; - - /** DeleteExampleRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteExampleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteExampleRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IDeleteExampleRequest): google.cloud.ces.v1.DeleteExampleRequest; - - /** - * Encodes the specified DeleteExampleRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteExampleRequest.verify|verify} messages. - * @param message DeleteExampleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IDeleteExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteExampleRequest.verify|verify} messages. - * @param message DeleteExampleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IDeleteExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteExampleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DeleteExampleRequest; - - /** - * Decodes a DeleteExampleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DeleteExampleRequest; - - /** - * Verifies a DeleteExampleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteExampleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteExampleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DeleteExampleRequest; - - /** - * Creates a plain object from a DeleteExampleRequest message. Also converts values to other types if specified. - * @param message DeleteExampleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DeleteExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteExampleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteExampleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListToolsRequest. */ - interface IListToolsRequest { - - /** ListToolsRequest parent */ - parent?: (string|null); - - /** ListToolsRequest pageSize */ - pageSize?: (number|null); - - /** ListToolsRequest pageToken */ - pageToken?: (string|null); - - /** ListToolsRequest filter */ - filter?: (string|null); - - /** ListToolsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListToolsRequest. */ - class ListToolsRequest implements IListToolsRequest { - - /** - * Constructs a new ListToolsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListToolsRequest); - - /** ListToolsRequest parent. */ - public parent: string; - - /** ListToolsRequest pageSize. */ - public pageSize: number; - - /** ListToolsRequest pageToken. */ - public pageToken: string; - - /** ListToolsRequest filter. */ - public filter: string; - - /** ListToolsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListToolsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListToolsRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IListToolsRequest): google.cloud.ces.v1.ListToolsRequest; - - /** - * Encodes the specified ListToolsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListToolsRequest.verify|verify} messages. - * @param message ListToolsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListToolsRequest.verify|verify} messages. - * @param message ListToolsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListToolsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListToolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListToolsRequest; - - /** - * Decodes a ListToolsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListToolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListToolsRequest; - - /** - * Verifies a ListToolsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListToolsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListToolsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListToolsRequest; - - /** - * Creates a plain object from a ListToolsRequest message. Also converts values to other types if specified. - * @param message ListToolsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListToolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListToolsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListToolsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListToolsResponse. */ - interface IListToolsResponse { - - /** ListToolsResponse tools */ - tools?: (google.cloud.ces.v1.ITool[]|null); - - /** ListToolsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListToolsResponse. */ - class ListToolsResponse implements IListToolsResponse { - - /** - * Constructs a new ListToolsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListToolsResponse); - - /** ListToolsResponse tools. */ - public tools: google.cloud.ces.v1.ITool[]; - - /** ListToolsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListToolsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListToolsResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IListToolsResponse): google.cloud.ces.v1.ListToolsResponse; - - /** - * Encodes the specified ListToolsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListToolsResponse.verify|verify} messages. - * @param message ListToolsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListToolsResponse.verify|verify} messages. - * @param message ListToolsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListToolsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListToolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListToolsResponse; - - /** - * Decodes a ListToolsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListToolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListToolsResponse; - - /** - * Verifies a ListToolsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListToolsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListToolsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListToolsResponse; - - /** - * Creates a plain object from a ListToolsResponse message. Also converts values to other types if specified. - * @param message ListToolsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListToolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListToolsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListToolsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetToolRequest. */ - interface IGetToolRequest { - - /** GetToolRequest name */ - name?: (string|null); - } - - /** Represents a GetToolRequest. */ - class GetToolRequest implements IGetToolRequest { - - /** - * Constructs a new GetToolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IGetToolRequest); - - /** GetToolRequest name. */ - public name: string; - - /** - * Creates a new GetToolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetToolRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IGetToolRequest): google.cloud.ces.v1.GetToolRequest; - - /** - * Encodes the specified GetToolRequest message. Does not implicitly {@link google.cloud.ces.v1.GetToolRequest.verify|verify} messages. - * @param message GetToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IGetToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetToolRequest.verify|verify} messages. - * @param message GetToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IGetToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetToolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetToolRequest; - - /** - * Decodes a GetToolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetToolRequest; - - /** - * Verifies a GetToolRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetToolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetToolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetToolRequest; - - /** - * Creates a plain object from a GetToolRequest message. Also converts values to other types if specified. - * @param message GetToolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.GetToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetToolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetToolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateToolRequest. */ - interface ICreateToolRequest { - - /** CreateToolRequest parent */ - parent?: (string|null); - - /** CreateToolRequest toolId */ - toolId?: (string|null); - - /** CreateToolRequest tool */ - tool?: (google.cloud.ces.v1.ITool|null); - } - - /** Represents a CreateToolRequest. */ - class CreateToolRequest implements ICreateToolRequest { - - /** - * Constructs a new CreateToolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ICreateToolRequest); - - /** CreateToolRequest parent. */ - public parent: string; - - /** CreateToolRequest toolId. */ - public toolId: string; - - /** CreateToolRequest tool. */ - public tool?: (google.cloud.ces.v1.ITool|null); - - /** - * Creates a new CreateToolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateToolRequest instance - */ - public static create(properties?: google.cloud.ces.v1.ICreateToolRequest): google.cloud.ces.v1.CreateToolRequest; - - /** - * Encodes the specified CreateToolRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateToolRequest.verify|verify} messages. - * @param message CreateToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ICreateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateToolRequest.verify|verify} messages. - * @param message CreateToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ICreateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateToolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CreateToolRequest; - - /** - * Decodes a CreateToolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CreateToolRequest; - - /** - * Verifies a CreateToolRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateToolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateToolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CreateToolRequest; - - /** - * Creates a plain object from a CreateToolRequest message. Also converts values to other types if specified. - * @param message CreateToolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.CreateToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateToolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateToolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateToolRequest. */ - interface IUpdateToolRequest { - - /** UpdateToolRequest tool */ - tool?: (google.cloud.ces.v1.ITool|null); - - /** UpdateToolRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateToolRequest. */ - class UpdateToolRequest implements IUpdateToolRequest { - - /** - * Constructs a new UpdateToolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IUpdateToolRequest); - - /** UpdateToolRequest tool. */ - public tool?: (google.cloud.ces.v1.ITool|null); - - /** UpdateToolRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateToolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateToolRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IUpdateToolRequest): google.cloud.ces.v1.UpdateToolRequest; - - /** - * Encodes the specified UpdateToolRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateToolRequest.verify|verify} messages. - * @param message UpdateToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IUpdateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateToolRequest.verify|verify} messages. - * @param message UpdateToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IUpdateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateToolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.UpdateToolRequest; - - /** - * Decodes an UpdateToolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.UpdateToolRequest; - - /** - * Verifies an UpdateToolRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateToolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateToolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.UpdateToolRequest; - - /** - * Creates a plain object from an UpdateToolRequest message. Also converts values to other types if specified. - * @param message UpdateToolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.UpdateToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateToolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateToolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteToolRequest. */ - interface IDeleteToolRequest { - - /** DeleteToolRequest name */ - name?: (string|null); - - /** DeleteToolRequest force */ - force?: (boolean|null); - - /** DeleteToolRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteToolRequest. */ - class DeleteToolRequest implements IDeleteToolRequest { - - /** - * Constructs a new DeleteToolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IDeleteToolRequest); - - /** DeleteToolRequest name. */ - public name: string; - - /** DeleteToolRequest force. */ - public force: boolean; - - /** DeleteToolRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteToolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteToolRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IDeleteToolRequest): google.cloud.ces.v1.DeleteToolRequest; - - /** - * Encodes the specified DeleteToolRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteToolRequest.verify|verify} messages. - * @param message DeleteToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IDeleteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteToolRequest.verify|verify} messages. - * @param message DeleteToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IDeleteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteToolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DeleteToolRequest; - - /** - * Decodes a DeleteToolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DeleteToolRequest; - - /** - * Verifies a DeleteToolRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteToolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteToolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DeleteToolRequest; - - /** - * Creates a plain object from a DeleteToolRequest message. Also converts values to other types if specified. - * @param message DeleteToolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DeleteToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteToolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteToolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListConversationsRequest. */ - interface IListConversationsRequest { - - /** ListConversationsRequest parent */ - parent?: (string|null); - - /** ListConversationsRequest pageSize */ - pageSize?: (number|null); - - /** ListConversationsRequest pageToken */ - pageToken?: (string|null); - - /** ListConversationsRequest filter */ - filter?: (string|null); - - /** ListConversationsRequest source */ - source?: (google.cloud.ces.v1.Conversation.Source|keyof typeof google.cloud.ces.v1.Conversation.Source|null); - - /** ListConversationsRequest sources */ - sources?: (google.cloud.ces.v1.Conversation.Source[]|null); - } - - /** Represents a ListConversationsRequest. */ - class ListConversationsRequest implements IListConversationsRequest { - - /** - * Constructs a new ListConversationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListConversationsRequest); - - /** ListConversationsRequest parent. */ - public parent: string; - - /** ListConversationsRequest pageSize. */ - public pageSize: number; - - /** ListConversationsRequest pageToken. */ - public pageToken: string; - - /** ListConversationsRequest filter. */ - public filter: string; - - /** ListConversationsRequest source. */ - public source: (google.cloud.ces.v1.Conversation.Source|keyof typeof google.cloud.ces.v1.Conversation.Source); - - /** ListConversationsRequest sources. */ - public sources: google.cloud.ces.v1.Conversation.Source[]; - - /** - * Creates a new ListConversationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListConversationsRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IListConversationsRequest): google.cloud.ces.v1.ListConversationsRequest; - - /** - * Encodes the specified ListConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListConversationsRequest.verify|verify} messages. - * @param message ListConversationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListConversationsRequest.verify|verify} messages. - * @param message ListConversationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListConversationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListConversationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListConversationsRequest; - - /** - * Decodes a ListConversationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListConversationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListConversationsRequest; - - /** - * Verifies a ListConversationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListConversationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListConversationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListConversationsRequest; - - /** - * Creates a plain object from a ListConversationsRequest message. Also converts values to other types if specified. - * @param message ListConversationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListConversationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListConversationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListConversationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListConversationsResponse. */ - interface IListConversationsResponse { - - /** ListConversationsResponse conversations */ - conversations?: (google.cloud.ces.v1.IConversation[]|null); - - /** ListConversationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListConversationsResponse. */ - class ListConversationsResponse implements IListConversationsResponse { - - /** - * Constructs a new ListConversationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListConversationsResponse); - - /** ListConversationsResponse conversations. */ - public conversations: google.cloud.ces.v1.IConversation[]; - - /** ListConversationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListConversationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListConversationsResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IListConversationsResponse): google.cloud.ces.v1.ListConversationsResponse; - - /** - * Encodes the specified ListConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListConversationsResponse.verify|verify} messages. - * @param message ListConversationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListConversationsResponse.verify|verify} messages. - * @param message ListConversationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListConversationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListConversationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListConversationsResponse; - - /** - * Decodes a ListConversationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListConversationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListConversationsResponse; - - /** - * Verifies a ListConversationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListConversationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListConversationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListConversationsResponse; - - /** - * Creates a plain object from a ListConversationsResponse message. Also converts values to other types if specified. - * @param message ListConversationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListConversationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListConversationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListConversationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetConversationRequest. */ - interface IGetConversationRequest { - - /** GetConversationRequest name */ - name?: (string|null); - - /** GetConversationRequest source */ - source?: (google.cloud.ces.v1.Conversation.Source|keyof typeof google.cloud.ces.v1.Conversation.Source|null); - } - - /** Represents a GetConversationRequest. */ - class GetConversationRequest implements IGetConversationRequest { - - /** - * Constructs a new GetConversationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IGetConversationRequest); - - /** GetConversationRequest name. */ - public name: string; - - /** GetConversationRequest source. */ - public source: (google.cloud.ces.v1.Conversation.Source|keyof typeof google.cloud.ces.v1.Conversation.Source); - - /** - * Creates a new GetConversationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetConversationRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IGetConversationRequest): google.cloud.ces.v1.GetConversationRequest; - - /** - * Encodes the specified GetConversationRequest message. Does not implicitly {@link google.cloud.ces.v1.GetConversationRequest.verify|verify} messages. - * @param message GetConversationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IGetConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetConversationRequest.verify|verify} messages. - * @param message GetConversationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IGetConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetConversationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetConversationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetConversationRequest; - - /** - * Decodes a GetConversationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetConversationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetConversationRequest; - - /** - * Verifies a GetConversationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetConversationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetConversationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetConversationRequest; - - /** - * Creates a plain object from a GetConversationRequest message. Also converts values to other types if specified. - * @param message GetConversationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.GetConversationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetConversationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetConversationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteConversationRequest. */ - interface IDeleteConversationRequest { - - /** DeleteConversationRequest name */ - name?: (string|null); - - /** DeleteConversationRequest source */ - source?: (google.cloud.ces.v1.Conversation.Source|keyof typeof google.cloud.ces.v1.Conversation.Source|null); - } - - /** Represents a DeleteConversationRequest. */ - class DeleteConversationRequest implements IDeleteConversationRequest { - - /** - * Constructs a new DeleteConversationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IDeleteConversationRequest); - - /** DeleteConversationRequest name. */ - public name: string; - - /** DeleteConversationRequest source. */ - public source: (google.cloud.ces.v1.Conversation.Source|keyof typeof google.cloud.ces.v1.Conversation.Source); - - /** - * Creates a new DeleteConversationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteConversationRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IDeleteConversationRequest): google.cloud.ces.v1.DeleteConversationRequest; - - /** - * Encodes the specified DeleteConversationRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteConversationRequest.verify|verify} messages. - * @param message DeleteConversationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IDeleteConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteConversationRequest.verify|verify} messages. - * @param message DeleteConversationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IDeleteConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteConversationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteConversationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DeleteConversationRequest; - - /** - * Decodes a DeleteConversationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteConversationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DeleteConversationRequest; - - /** - * Verifies a DeleteConversationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteConversationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteConversationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DeleteConversationRequest; - - /** - * Creates a plain object from a DeleteConversationRequest message. Also converts values to other types if specified. - * @param message DeleteConversationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DeleteConversationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteConversationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteConversationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchDeleteConversationsRequest. */ - interface IBatchDeleteConversationsRequest { - - /** BatchDeleteConversationsRequest parent */ - parent?: (string|null); - - /** BatchDeleteConversationsRequest conversations */ - conversations?: (string[]|null); - } - - /** Represents a BatchDeleteConversationsRequest. */ - class BatchDeleteConversationsRequest implements IBatchDeleteConversationsRequest { - - /** - * Constructs a new BatchDeleteConversationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IBatchDeleteConversationsRequest); - - /** BatchDeleteConversationsRequest parent. */ - public parent: string; - - /** BatchDeleteConversationsRequest conversations. */ - public conversations: string[]; - - /** - * Creates a new BatchDeleteConversationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchDeleteConversationsRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IBatchDeleteConversationsRequest): google.cloud.ces.v1.BatchDeleteConversationsRequest; - - /** - * Encodes the specified BatchDeleteConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1.BatchDeleteConversationsRequest.verify|verify} messages. - * @param message BatchDeleteConversationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IBatchDeleteConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchDeleteConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BatchDeleteConversationsRequest.verify|verify} messages. - * @param message BatchDeleteConversationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IBatchDeleteConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchDeleteConversationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.BatchDeleteConversationsRequest; - - /** - * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchDeleteConversationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.BatchDeleteConversationsRequest; - - /** - * Verifies a BatchDeleteConversationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchDeleteConversationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchDeleteConversationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.BatchDeleteConversationsRequest; - - /** - * Creates a plain object from a BatchDeleteConversationsRequest message. Also converts values to other types if specified. - * @param message BatchDeleteConversationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.BatchDeleteConversationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchDeleteConversationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchDeleteConversationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchDeleteConversationsResponse. */ - interface IBatchDeleteConversationsResponse { - - /** BatchDeleteConversationsResponse deletedConversations */ - deletedConversations?: (string[]|null); - - /** BatchDeleteConversationsResponse failedConversations */ - failedConversations?: (string[]|null); - - /** BatchDeleteConversationsResponse errorMessages */ - errorMessages?: (string[]|null); - } - - /** Represents a BatchDeleteConversationsResponse. */ - class BatchDeleteConversationsResponse implements IBatchDeleteConversationsResponse { - - /** - * Constructs a new BatchDeleteConversationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IBatchDeleteConversationsResponse); - - /** BatchDeleteConversationsResponse deletedConversations. */ - public deletedConversations: string[]; - - /** BatchDeleteConversationsResponse failedConversations. */ - public failedConversations: string[]; - - /** BatchDeleteConversationsResponse errorMessages. */ - public errorMessages: string[]; - - /** - * Creates a new BatchDeleteConversationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchDeleteConversationsResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IBatchDeleteConversationsResponse): google.cloud.ces.v1.BatchDeleteConversationsResponse; - - /** - * Encodes the specified BatchDeleteConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1.BatchDeleteConversationsResponse.verify|verify} messages. - * @param message BatchDeleteConversationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IBatchDeleteConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchDeleteConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BatchDeleteConversationsResponse.verify|verify} messages. - * @param message BatchDeleteConversationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IBatchDeleteConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchDeleteConversationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.BatchDeleteConversationsResponse; - - /** - * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchDeleteConversationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.BatchDeleteConversationsResponse; - - /** - * Verifies a BatchDeleteConversationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchDeleteConversationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchDeleteConversationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.BatchDeleteConversationsResponse; - - /** - * Creates a plain object from a BatchDeleteConversationsResponse message. Also converts values to other types if specified. - * @param message BatchDeleteConversationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.BatchDeleteConversationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchDeleteConversationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchDeleteConversationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListGuardrailsRequest. */ - interface IListGuardrailsRequest { - - /** ListGuardrailsRequest parent */ - parent?: (string|null); - - /** ListGuardrailsRequest pageSize */ - pageSize?: (number|null); - - /** ListGuardrailsRequest pageToken */ - pageToken?: (string|null); - - /** ListGuardrailsRequest filter */ - filter?: (string|null); - - /** ListGuardrailsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListGuardrailsRequest. */ - class ListGuardrailsRequest implements IListGuardrailsRequest { - - /** - * Constructs a new ListGuardrailsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListGuardrailsRequest); - - /** ListGuardrailsRequest parent. */ - public parent: string; - - /** ListGuardrailsRequest pageSize. */ - public pageSize: number; - - /** ListGuardrailsRequest pageToken. */ - public pageToken: string; - - /** ListGuardrailsRequest filter. */ - public filter: string; - - /** ListGuardrailsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListGuardrailsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListGuardrailsRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IListGuardrailsRequest): google.cloud.ces.v1.ListGuardrailsRequest; - - /** - * Encodes the specified ListGuardrailsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListGuardrailsRequest.verify|verify} messages. - * @param message ListGuardrailsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListGuardrailsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListGuardrailsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListGuardrailsRequest.verify|verify} messages. - * @param message ListGuardrailsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListGuardrailsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListGuardrailsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListGuardrailsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListGuardrailsRequest; - - /** - * Decodes a ListGuardrailsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListGuardrailsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListGuardrailsRequest; - - /** - * Verifies a ListGuardrailsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListGuardrailsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListGuardrailsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListGuardrailsRequest; - - /** - * Creates a plain object from a ListGuardrailsRequest message. Also converts values to other types if specified. - * @param message ListGuardrailsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListGuardrailsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListGuardrailsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListGuardrailsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListGuardrailsResponse. */ - interface IListGuardrailsResponse { - - /** ListGuardrailsResponse guardrails */ - guardrails?: (google.cloud.ces.v1.IGuardrail[]|null); - - /** ListGuardrailsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListGuardrailsResponse. */ - class ListGuardrailsResponse implements IListGuardrailsResponse { - - /** - * Constructs a new ListGuardrailsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListGuardrailsResponse); - - /** ListGuardrailsResponse guardrails. */ - public guardrails: google.cloud.ces.v1.IGuardrail[]; - - /** ListGuardrailsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListGuardrailsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListGuardrailsResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IListGuardrailsResponse): google.cloud.ces.v1.ListGuardrailsResponse; - - /** - * Encodes the specified ListGuardrailsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListGuardrailsResponse.verify|verify} messages. - * @param message ListGuardrailsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListGuardrailsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListGuardrailsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListGuardrailsResponse.verify|verify} messages. - * @param message ListGuardrailsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListGuardrailsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListGuardrailsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListGuardrailsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListGuardrailsResponse; - - /** - * Decodes a ListGuardrailsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListGuardrailsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListGuardrailsResponse; - - /** - * Verifies a ListGuardrailsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListGuardrailsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListGuardrailsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListGuardrailsResponse; - - /** - * Creates a plain object from a ListGuardrailsResponse message. Also converts values to other types if specified. - * @param message ListGuardrailsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListGuardrailsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListGuardrailsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListGuardrailsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetGuardrailRequest. */ - interface IGetGuardrailRequest { - - /** GetGuardrailRequest name */ - name?: (string|null); - } - - /** Represents a GetGuardrailRequest. */ - class GetGuardrailRequest implements IGetGuardrailRequest { - - /** - * Constructs a new GetGuardrailRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IGetGuardrailRequest); - - /** GetGuardrailRequest name. */ - public name: string; - - /** - * Creates a new GetGuardrailRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetGuardrailRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IGetGuardrailRequest): google.cloud.ces.v1.GetGuardrailRequest; - - /** - * Encodes the specified GetGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1.GetGuardrailRequest.verify|verify} messages. - * @param message GetGuardrailRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IGetGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetGuardrailRequest.verify|verify} messages. - * @param message GetGuardrailRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IGetGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetGuardrailRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetGuardrailRequest; - - /** - * Decodes a GetGuardrailRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetGuardrailRequest; - - /** - * Verifies a GetGuardrailRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetGuardrailRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetGuardrailRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetGuardrailRequest; - - /** - * Creates a plain object from a GetGuardrailRequest message. Also converts values to other types if specified. - * @param message GetGuardrailRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.GetGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetGuardrailRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetGuardrailRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateGuardrailRequest. */ - interface ICreateGuardrailRequest { - - /** CreateGuardrailRequest parent */ - parent?: (string|null); - - /** CreateGuardrailRequest guardrailId */ - guardrailId?: (string|null); - - /** CreateGuardrailRequest guardrail */ - guardrail?: (google.cloud.ces.v1.IGuardrail|null); - } - - /** Represents a CreateGuardrailRequest. */ - class CreateGuardrailRequest implements ICreateGuardrailRequest { - - /** - * Constructs a new CreateGuardrailRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ICreateGuardrailRequest); - - /** CreateGuardrailRequest parent. */ - public parent: string; - - /** CreateGuardrailRequest guardrailId. */ - public guardrailId: string; - - /** CreateGuardrailRequest guardrail. */ - public guardrail?: (google.cloud.ces.v1.IGuardrail|null); - - /** - * Creates a new CreateGuardrailRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateGuardrailRequest instance - */ - public static create(properties?: google.cloud.ces.v1.ICreateGuardrailRequest): google.cloud.ces.v1.CreateGuardrailRequest; - - /** - * Encodes the specified CreateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateGuardrailRequest.verify|verify} messages. - * @param message CreateGuardrailRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ICreateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateGuardrailRequest.verify|verify} messages. - * @param message CreateGuardrailRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ICreateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateGuardrailRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CreateGuardrailRequest; - - /** - * Decodes a CreateGuardrailRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CreateGuardrailRequest; - - /** - * Verifies a CreateGuardrailRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateGuardrailRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateGuardrailRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CreateGuardrailRequest; - - /** - * Creates a plain object from a CreateGuardrailRequest message. Also converts values to other types if specified. - * @param message CreateGuardrailRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.CreateGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateGuardrailRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateGuardrailRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateGuardrailRequest. */ - interface IUpdateGuardrailRequest { - - /** UpdateGuardrailRequest guardrail */ - guardrail?: (google.cloud.ces.v1.IGuardrail|null); - - /** UpdateGuardrailRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateGuardrailRequest. */ - class UpdateGuardrailRequest implements IUpdateGuardrailRequest { - - /** - * Constructs a new UpdateGuardrailRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IUpdateGuardrailRequest); - - /** UpdateGuardrailRequest guardrail. */ - public guardrail?: (google.cloud.ces.v1.IGuardrail|null); - - /** UpdateGuardrailRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateGuardrailRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateGuardrailRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IUpdateGuardrailRequest): google.cloud.ces.v1.UpdateGuardrailRequest; - - /** - * Encodes the specified UpdateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateGuardrailRequest.verify|verify} messages. - * @param message UpdateGuardrailRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IUpdateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateGuardrailRequest.verify|verify} messages. - * @param message UpdateGuardrailRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IUpdateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateGuardrailRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.UpdateGuardrailRequest; - - /** - * Decodes an UpdateGuardrailRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.UpdateGuardrailRequest; - - /** - * Verifies an UpdateGuardrailRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateGuardrailRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateGuardrailRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.UpdateGuardrailRequest; - - /** - * Creates a plain object from an UpdateGuardrailRequest message. Also converts values to other types if specified. - * @param message UpdateGuardrailRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.UpdateGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateGuardrailRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateGuardrailRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteGuardrailRequest. */ - interface IDeleteGuardrailRequest { - - /** DeleteGuardrailRequest name */ - name?: (string|null); - - /** DeleteGuardrailRequest force */ - force?: (boolean|null); - - /** DeleteGuardrailRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteGuardrailRequest. */ - class DeleteGuardrailRequest implements IDeleteGuardrailRequest { - - /** - * Constructs a new DeleteGuardrailRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IDeleteGuardrailRequest); - - /** DeleteGuardrailRequest name. */ - public name: string; - - /** DeleteGuardrailRequest force. */ - public force: boolean; - - /** DeleteGuardrailRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteGuardrailRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteGuardrailRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IDeleteGuardrailRequest): google.cloud.ces.v1.DeleteGuardrailRequest; - - /** - * Encodes the specified DeleteGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteGuardrailRequest.verify|verify} messages. - * @param message DeleteGuardrailRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IDeleteGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteGuardrailRequest.verify|verify} messages. - * @param message DeleteGuardrailRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IDeleteGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteGuardrailRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DeleteGuardrailRequest; - - /** - * Decodes a DeleteGuardrailRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DeleteGuardrailRequest; - - /** - * Verifies a DeleteGuardrailRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteGuardrailRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteGuardrailRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DeleteGuardrailRequest; - - /** - * Creates a plain object from a DeleteGuardrailRequest message. Also converts values to other types if specified. - * @param message DeleteGuardrailRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DeleteGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteGuardrailRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteGuardrailRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDeploymentsRequest. */ - interface IListDeploymentsRequest { - - /** ListDeploymentsRequest parent */ - parent?: (string|null); - - /** ListDeploymentsRequest pageSize */ - pageSize?: (number|null); - - /** ListDeploymentsRequest pageToken */ - pageToken?: (string|null); - - /** ListDeploymentsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListDeploymentsRequest. */ - class ListDeploymentsRequest implements IListDeploymentsRequest { - - /** - * Constructs a new ListDeploymentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListDeploymentsRequest); - - /** ListDeploymentsRequest parent. */ - public parent: string; - - /** ListDeploymentsRequest pageSize. */ - public pageSize: number; - - /** ListDeploymentsRequest pageToken. */ - public pageToken: string; - - /** ListDeploymentsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListDeploymentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDeploymentsRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IListDeploymentsRequest): google.cloud.ces.v1.ListDeploymentsRequest; - - /** - * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListDeploymentsRequest.verify|verify} messages. - * @param message ListDeploymentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListDeploymentsRequest.verify|verify} messages. - * @param message ListDeploymentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDeploymentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDeploymentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListDeploymentsRequest; - - /** - * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDeploymentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListDeploymentsRequest; - - /** - * Verifies a ListDeploymentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDeploymentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListDeploymentsRequest; - - /** - * Creates a plain object from a ListDeploymentsRequest message. Also converts values to other types if specified. - * @param message ListDeploymentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListDeploymentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDeploymentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDeploymentsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDeploymentsResponse. */ - interface IListDeploymentsResponse { - - /** ListDeploymentsResponse deployments */ - deployments?: (google.cloud.ces.v1.IDeployment[]|null); - - /** ListDeploymentsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListDeploymentsResponse. */ - class ListDeploymentsResponse implements IListDeploymentsResponse { - - /** - * Constructs a new ListDeploymentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListDeploymentsResponse); - - /** ListDeploymentsResponse deployments. */ - public deployments: google.cloud.ces.v1.IDeployment[]; - - /** ListDeploymentsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListDeploymentsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDeploymentsResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IListDeploymentsResponse): google.cloud.ces.v1.ListDeploymentsResponse; - - /** - * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListDeploymentsResponse.verify|verify} messages. - * @param message ListDeploymentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListDeploymentsResponse.verify|verify} messages. - * @param message ListDeploymentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDeploymentsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDeploymentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListDeploymentsResponse; - - /** - * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDeploymentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListDeploymentsResponse; - - /** - * Verifies a ListDeploymentsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDeploymentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListDeploymentsResponse; - - /** - * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. - * @param message ListDeploymentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListDeploymentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDeploymentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDeploymentsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetDeploymentRequest. */ - interface IGetDeploymentRequest { - - /** GetDeploymentRequest name */ - name?: (string|null); - } - - /** Represents a GetDeploymentRequest. */ - class GetDeploymentRequest implements IGetDeploymentRequest { - - /** - * Constructs a new GetDeploymentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IGetDeploymentRequest); - - /** GetDeploymentRequest name. */ - public name: string; - - /** - * Creates a new GetDeploymentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDeploymentRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IGetDeploymentRequest): google.cloud.ces.v1.GetDeploymentRequest; - - /** - * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1.GetDeploymentRequest.verify|verify} messages. - * @param message GetDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetDeploymentRequest.verify|verify} messages. - * @param message GetDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetDeploymentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetDeploymentRequest; - - /** - * Decodes a GetDeploymentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetDeploymentRequest; - - /** - * Verifies a GetDeploymentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDeploymentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetDeploymentRequest; - - /** - * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. - * @param message GetDeploymentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.GetDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDeploymentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetDeploymentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateDeploymentRequest. */ - interface ICreateDeploymentRequest { - - /** CreateDeploymentRequest parent */ - parent?: (string|null); - - /** CreateDeploymentRequest deploymentId */ - deploymentId?: (string|null); - - /** CreateDeploymentRequest deployment */ - deployment?: (google.cloud.ces.v1.IDeployment|null); - } - - /** Represents a CreateDeploymentRequest. */ - class CreateDeploymentRequest implements ICreateDeploymentRequest { - - /** - * Constructs a new CreateDeploymentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ICreateDeploymentRequest); - - /** CreateDeploymentRequest parent. */ - public parent: string; - - /** CreateDeploymentRequest deploymentId. */ - public deploymentId: string; - - /** CreateDeploymentRequest deployment. */ - public deployment?: (google.cloud.ces.v1.IDeployment|null); - - /** - * Creates a new CreateDeploymentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateDeploymentRequest instance - */ - public static create(properties?: google.cloud.ces.v1.ICreateDeploymentRequest): google.cloud.ces.v1.CreateDeploymentRequest; - - /** - * Encodes the specified CreateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateDeploymentRequest.verify|verify} messages. - * @param message CreateDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ICreateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateDeploymentRequest.verify|verify} messages. - * @param message CreateDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ICreateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateDeploymentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CreateDeploymentRequest; - - /** - * Decodes a CreateDeploymentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CreateDeploymentRequest; - - /** - * Verifies a CreateDeploymentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateDeploymentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CreateDeploymentRequest; - - /** - * Creates a plain object from a CreateDeploymentRequest message. Also converts values to other types if specified. - * @param message CreateDeploymentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.CreateDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateDeploymentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateDeploymentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDeploymentRequest. */ - interface IUpdateDeploymentRequest { - - /** UpdateDeploymentRequest deployment */ - deployment?: (google.cloud.ces.v1.IDeployment|null); - - /** UpdateDeploymentRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateDeploymentRequest. */ - class UpdateDeploymentRequest implements IUpdateDeploymentRequest { - - /** - * Constructs a new UpdateDeploymentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IUpdateDeploymentRequest); - - /** UpdateDeploymentRequest deployment. */ - public deployment?: (google.cloud.ces.v1.IDeployment|null); - - /** UpdateDeploymentRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateDeploymentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDeploymentRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IUpdateDeploymentRequest): google.cloud.ces.v1.UpdateDeploymentRequest; - - /** - * Encodes the specified UpdateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateDeploymentRequest.verify|verify} messages. - * @param message UpdateDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IUpdateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateDeploymentRequest.verify|verify} messages. - * @param message UpdateDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IUpdateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDeploymentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.UpdateDeploymentRequest; - - /** - * Decodes an UpdateDeploymentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.UpdateDeploymentRequest; - - /** - * Verifies an UpdateDeploymentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDeploymentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.UpdateDeploymentRequest; - - /** - * Creates a plain object from an UpdateDeploymentRequest message. Also converts values to other types if specified. - * @param message UpdateDeploymentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.UpdateDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDeploymentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDeploymentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteDeploymentRequest. */ - interface IDeleteDeploymentRequest { - - /** DeleteDeploymentRequest name */ - name?: (string|null); - - /** DeleteDeploymentRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteDeploymentRequest. */ - class DeleteDeploymentRequest implements IDeleteDeploymentRequest { - - /** - * Constructs a new DeleteDeploymentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IDeleteDeploymentRequest); - - /** DeleteDeploymentRequest name. */ - public name: string; - - /** DeleteDeploymentRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteDeploymentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteDeploymentRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IDeleteDeploymentRequest): google.cloud.ces.v1.DeleteDeploymentRequest; - - /** - * Encodes the specified DeleteDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteDeploymentRequest.verify|verify} messages. - * @param message DeleteDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IDeleteDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteDeploymentRequest.verify|verify} messages. - * @param message DeleteDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IDeleteDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteDeploymentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DeleteDeploymentRequest; - - /** - * Decodes a DeleteDeploymentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DeleteDeploymentRequest; - - /** - * Verifies a DeleteDeploymentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteDeploymentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DeleteDeploymentRequest; - - /** - * Creates a plain object from a DeleteDeploymentRequest message. Also converts values to other types if specified. - * @param message DeleteDeploymentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DeleteDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteDeploymentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteDeploymentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListToolsetsRequest. */ - interface IListToolsetsRequest { - - /** ListToolsetsRequest parent */ - parent?: (string|null); - - /** ListToolsetsRequest pageSize */ - pageSize?: (number|null); - - /** ListToolsetsRequest pageToken */ - pageToken?: (string|null); - - /** ListToolsetsRequest filter */ - filter?: (string|null); - - /** ListToolsetsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListToolsetsRequest. */ - class ListToolsetsRequest implements IListToolsetsRequest { - - /** - * Constructs a new ListToolsetsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListToolsetsRequest); - - /** ListToolsetsRequest parent. */ - public parent: string; - - /** ListToolsetsRequest pageSize. */ - public pageSize: number; - - /** ListToolsetsRequest pageToken. */ - public pageToken: string; - - /** ListToolsetsRequest filter. */ - public filter: string; - - /** ListToolsetsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListToolsetsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListToolsetsRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IListToolsetsRequest): google.cloud.ces.v1.ListToolsetsRequest; - - /** - * Encodes the specified ListToolsetsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListToolsetsRequest.verify|verify} messages. - * @param message ListToolsetsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListToolsetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListToolsetsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListToolsetsRequest.verify|verify} messages. - * @param message ListToolsetsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListToolsetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListToolsetsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListToolsetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListToolsetsRequest; - - /** - * Decodes a ListToolsetsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListToolsetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListToolsetsRequest; - - /** - * Verifies a ListToolsetsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListToolsetsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListToolsetsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListToolsetsRequest; - - /** - * Creates a plain object from a ListToolsetsRequest message. Also converts values to other types if specified. - * @param message ListToolsetsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListToolsetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListToolsetsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListToolsetsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListToolsetsResponse. */ - interface IListToolsetsResponse { - - /** ListToolsetsResponse toolsets */ - toolsets?: (google.cloud.ces.v1.IToolset[]|null); - - /** ListToolsetsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListToolsetsResponse. */ - class ListToolsetsResponse implements IListToolsetsResponse { - - /** - * Constructs a new ListToolsetsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListToolsetsResponse); - - /** ListToolsetsResponse toolsets. */ - public toolsets: google.cloud.ces.v1.IToolset[]; - - /** ListToolsetsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListToolsetsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListToolsetsResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IListToolsetsResponse): google.cloud.ces.v1.ListToolsetsResponse; - - /** - * Encodes the specified ListToolsetsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListToolsetsResponse.verify|verify} messages. - * @param message ListToolsetsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListToolsetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListToolsetsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListToolsetsResponse.verify|verify} messages. - * @param message ListToolsetsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListToolsetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListToolsetsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListToolsetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListToolsetsResponse; - - /** - * Decodes a ListToolsetsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListToolsetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListToolsetsResponse; - - /** - * Verifies a ListToolsetsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListToolsetsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListToolsetsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListToolsetsResponse; - - /** - * Creates a plain object from a ListToolsetsResponse message. Also converts values to other types if specified. - * @param message ListToolsetsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListToolsetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListToolsetsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListToolsetsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetToolsetRequest. */ - interface IGetToolsetRequest { - - /** GetToolsetRequest name */ - name?: (string|null); - } - - /** Represents a GetToolsetRequest. */ - class GetToolsetRequest implements IGetToolsetRequest { - - /** - * Constructs a new GetToolsetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IGetToolsetRequest); - - /** GetToolsetRequest name. */ - public name: string; - - /** - * Creates a new GetToolsetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetToolsetRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IGetToolsetRequest): google.cloud.ces.v1.GetToolsetRequest; - - /** - * Encodes the specified GetToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1.GetToolsetRequest.verify|verify} messages. - * @param message GetToolsetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IGetToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetToolsetRequest.verify|verify} messages. - * @param message GetToolsetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IGetToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetToolsetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetToolsetRequest; - - /** - * Decodes a GetToolsetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetToolsetRequest; - - /** - * Verifies a GetToolsetRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetToolsetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetToolsetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetToolsetRequest; - - /** - * Creates a plain object from a GetToolsetRequest message. Also converts values to other types if specified. - * @param message GetToolsetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.GetToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetToolsetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetToolsetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateToolsetRequest. */ - interface ICreateToolsetRequest { - - /** CreateToolsetRequest parent */ - parent?: (string|null); - - /** CreateToolsetRequest toolsetId */ - toolsetId?: (string|null); - - /** CreateToolsetRequest toolset */ - toolset?: (google.cloud.ces.v1.IToolset|null); - } - - /** Represents a CreateToolsetRequest. */ - class CreateToolsetRequest implements ICreateToolsetRequest { - - /** - * Constructs a new CreateToolsetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ICreateToolsetRequest); - - /** CreateToolsetRequest parent. */ - public parent: string; - - /** CreateToolsetRequest toolsetId. */ - public toolsetId: string; - - /** CreateToolsetRequest toolset. */ - public toolset?: (google.cloud.ces.v1.IToolset|null); - - /** - * Creates a new CreateToolsetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateToolsetRequest instance - */ - public static create(properties?: google.cloud.ces.v1.ICreateToolsetRequest): google.cloud.ces.v1.CreateToolsetRequest; - - /** - * Encodes the specified CreateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateToolsetRequest.verify|verify} messages. - * @param message CreateToolsetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ICreateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateToolsetRequest.verify|verify} messages. - * @param message CreateToolsetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ICreateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateToolsetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CreateToolsetRequest; - - /** - * Decodes a CreateToolsetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CreateToolsetRequest; - - /** - * Verifies a CreateToolsetRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateToolsetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateToolsetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CreateToolsetRequest; - - /** - * Creates a plain object from a CreateToolsetRequest message. Also converts values to other types if specified. - * @param message CreateToolsetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.CreateToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateToolsetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateToolsetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateToolsetRequest. */ - interface IUpdateToolsetRequest { - - /** UpdateToolsetRequest toolset */ - toolset?: (google.cloud.ces.v1.IToolset|null); - - /** UpdateToolsetRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateToolsetRequest. */ - class UpdateToolsetRequest implements IUpdateToolsetRequest { - - /** - * Constructs a new UpdateToolsetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IUpdateToolsetRequest); - - /** UpdateToolsetRequest toolset. */ - public toolset?: (google.cloud.ces.v1.IToolset|null); - - /** UpdateToolsetRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateToolsetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateToolsetRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IUpdateToolsetRequest): google.cloud.ces.v1.UpdateToolsetRequest; - - /** - * Encodes the specified UpdateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateToolsetRequest.verify|verify} messages. - * @param message UpdateToolsetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IUpdateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateToolsetRequest.verify|verify} messages. - * @param message UpdateToolsetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IUpdateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateToolsetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.UpdateToolsetRequest; - - /** - * Decodes an UpdateToolsetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.UpdateToolsetRequest; - - /** - * Verifies an UpdateToolsetRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateToolsetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateToolsetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.UpdateToolsetRequest; - - /** - * Creates a plain object from an UpdateToolsetRequest message. Also converts values to other types if specified. - * @param message UpdateToolsetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.UpdateToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateToolsetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateToolsetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteToolsetRequest. */ - interface IDeleteToolsetRequest { - - /** DeleteToolsetRequest name */ - name?: (string|null); - - /** DeleteToolsetRequest force */ - force?: (boolean|null); - - /** DeleteToolsetRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteToolsetRequest. */ - class DeleteToolsetRequest implements IDeleteToolsetRequest { - - /** - * Constructs a new DeleteToolsetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IDeleteToolsetRequest); - - /** DeleteToolsetRequest name. */ - public name: string; - - /** DeleteToolsetRequest force. */ - public force: boolean; - - /** DeleteToolsetRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteToolsetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteToolsetRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IDeleteToolsetRequest): google.cloud.ces.v1.DeleteToolsetRequest; - - /** - * Encodes the specified DeleteToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteToolsetRequest.verify|verify} messages. - * @param message DeleteToolsetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IDeleteToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteToolsetRequest.verify|verify} messages. - * @param message DeleteToolsetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IDeleteToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteToolsetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DeleteToolsetRequest; - - /** - * Decodes a DeleteToolsetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DeleteToolsetRequest; - - /** - * Verifies a DeleteToolsetRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteToolsetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteToolsetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DeleteToolsetRequest; - - /** - * Creates a plain object from a DeleteToolsetRequest message. Also converts values to other types if specified. - * @param message DeleteToolsetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DeleteToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteToolsetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteToolsetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAppVersionsRequest. */ - interface IListAppVersionsRequest { - - /** ListAppVersionsRequest parent */ - parent?: (string|null); - - /** ListAppVersionsRequest pageSize */ - pageSize?: (number|null); - - /** ListAppVersionsRequest pageToken */ - pageToken?: (string|null); - - /** ListAppVersionsRequest filter */ - filter?: (string|null); - - /** ListAppVersionsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListAppVersionsRequest. */ - class ListAppVersionsRequest implements IListAppVersionsRequest { - - /** - * Constructs a new ListAppVersionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListAppVersionsRequest); - - /** ListAppVersionsRequest parent. */ - public parent: string; - - /** ListAppVersionsRequest pageSize. */ - public pageSize: number; - - /** ListAppVersionsRequest pageToken. */ - public pageToken: string; - - /** ListAppVersionsRequest filter. */ - public filter: string; - - /** ListAppVersionsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListAppVersionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAppVersionsRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IListAppVersionsRequest): google.cloud.ces.v1.ListAppVersionsRequest; - - /** - * Encodes the specified ListAppVersionsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListAppVersionsRequest.verify|verify} messages. - * @param message ListAppVersionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListAppVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAppVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAppVersionsRequest.verify|verify} messages. - * @param message ListAppVersionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListAppVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAppVersionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAppVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListAppVersionsRequest; - - /** - * Decodes a ListAppVersionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAppVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListAppVersionsRequest; - - /** - * Verifies a ListAppVersionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAppVersionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAppVersionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListAppVersionsRequest; - - /** - * Creates a plain object from a ListAppVersionsRequest message. Also converts values to other types if specified. - * @param message ListAppVersionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListAppVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAppVersionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAppVersionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAppVersionsResponse. */ - interface IListAppVersionsResponse { - - /** ListAppVersionsResponse appVersions */ - appVersions?: (google.cloud.ces.v1.IAppVersion[]|null); - - /** ListAppVersionsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListAppVersionsResponse. */ - class ListAppVersionsResponse implements IListAppVersionsResponse { - - /** - * Constructs a new ListAppVersionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListAppVersionsResponse); - - /** ListAppVersionsResponse appVersions. */ - public appVersions: google.cloud.ces.v1.IAppVersion[]; - - /** ListAppVersionsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListAppVersionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAppVersionsResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IListAppVersionsResponse): google.cloud.ces.v1.ListAppVersionsResponse; - - /** - * Encodes the specified ListAppVersionsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListAppVersionsResponse.verify|verify} messages. - * @param message ListAppVersionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListAppVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAppVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAppVersionsResponse.verify|verify} messages. - * @param message ListAppVersionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListAppVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAppVersionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAppVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListAppVersionsResponse; - - /** - * Decodes a ListAppVersionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAppVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListAppVersionsResponse; - - /** - * Verifies a ListAppVersionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAppVersionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAppVersionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListAppVersionsResponse; - - /** - * Creates a plain object from a ListAppVersionsResponse message. Also converts values to other types if specified. - * @param message ListAppVersionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListAppVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAppVersionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAppVersionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetAppVersionRequest. */ - interface IGetAppVersionRequest { - - /** GetAppVersionRequest name */ - name?: (string|null); - } - - /** Represents a GetAppVersionRequest. */ - class GetAppVersionRequest implements IGetAppVersionRequest { - - /** - * Constructs a new GetAppVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IGetAppVersionRequest); - - /** GetAppVersionRequest name. */ - public name: string; - - /** - * Creates a new GetAppVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetAppVersionRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IGetAppVersionRequest): google.cloud.ces.v1.GetAppVersionRequest; - - /** - * Encodes the specified GetAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1.GetAppVersionRequest.verify|verify} messages. - * @param message GetAppVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IGetAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetAppVersionRequest.verify|verify} messages. - * @param message GetAppVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IGetAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetAppVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetAppVersionRequest; - - /** - * Decodes a GetAppVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetAppVersionRequest; - - /** - * Verifies a GetAppVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetAppVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetAppVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetAppVersionRequest; - - /** - * Creates a plain object from a GetAppVersionRequest message. Also converts values to other types if specified. - * @param message GetAppVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.GetAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetAppVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetAppVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteAppVersionRequest. */ - interface IDeleteAppVersionRequest { - - /** DeleteAppVersionRequest name */ - name?: (string|null); - - /** DeleteAppVersionRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteAppVersionRequest. */ - class DeleteAppVersionRequest implements IDeleteAppVersionRequest { - - /** - * Constructs a new DeleteAppVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IDeleteAppVersionRequest); - - /** DeleteAppVersionRequest name. */ - public name: string; - - /** DeleteAppVersionRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteAppVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteAppVersionRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IDeleteAppVersionRequest): google.cloud.ces.v1.DeleteAppVersionRequest; - - /** - * Encodes the specified DeleteAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteAppVersionRequest.verify|verify} messages. - * @param message DeleteAppVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IDeleteAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteAppVersionRequest.verify|verify} messages. - * @param message DeleteAppVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IDeleteAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteAppVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DeleteAppVersionRequest; - - /** - * Decodes a DeleteAppVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DeleteAppVersionRequest; - - /** - * Verifies a DeleteAppVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteAppVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteAppVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DeleteAppVersionRequest; - - /** - * Creates a plain object from a DeleteAppVersionRequest message. Also converts values to other types if specified. - * @param message DeleteAppVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DeleteAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteAppVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteAppVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateAppVersionRequest. */ - interface ICreateAppVersionRequest { - - /** CreateAppVersionRequest parent */ - parent?: (string|null); - - /** CreateAppVersionRequest appVersionId */ - appVersionId?: (string|null); - - /** CreateAppVersionRequest appVersion */ - appVersion?: (google.cloud.ces.v1.IAppVersion|null); - } - - /** Represents a CreateAppVersionRequest. */ - class CreateAppVersionRequest implements ICreateAppVersionRequest { - - /** - * Constructs a new CreateAppVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ICreateAppVersionRequest); - - /** CreateAppVersionRequest parent. */ - public parent: string; - - /** CreateAppVersionRequest appVersionId. */ - public appVersionId: string; - - /** CreateAppVersionRequest appVersion. */ - public appVersion?: (google.cloud.ces.v1.IAppVersion|null); - - /** - * Creates a new CreateAppVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateAppVersionRequest instance - */ - public static create(properties?: google.cloud.ces.v1.ICreateAppVersionRequest): google.cloud.ces.v1.CreateAppVersionRequest; - - /** - * Encodes the specified CreateAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateAppVersionRequest.verify|verify} messages. - * @param message CreateAppVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ICreateAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateAppVersionRequest.verify|verify} messages. - * @param message CreateAppVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ICreateAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateAppVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CreateAppVersionRequest; - - /** - * Decodes a CreateAppVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CreateAppVersionRequest; - - /** - * Verifies a CreateAppVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateAppVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateAppVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CreateAppVersionRequest; - - /** - * Creates a plain object from a CreateAppVersionRequest message. Also converts values to other types if specified. - * @param message CreateAppVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.CreateAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateAppVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateAppVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RestoreAppVersionRequest. */ - interface IRestoreAppVersionRequest { - - /** RestoreAppVersionRequest name */ - name?: (string|null); - } - - /** Represents a RestoreAppVersionRequest. */ - class RestoreAppVersionRequest implements IRestoreAppVersionRequest { - - /** - * Constructs a new RestoreAppVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IRestoreAppVersionRequest); - - /** RestoreAppVersionRequest name. */ - public name: string; - - /** - * Creates a new RestoreAppVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreAppVersionRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IRestoreAppVersionRequest): google.cloud.ces.v1.RestoreAppVersionRequest; - - /** - * Encodes the specified RestoreAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1.RestoreAppVersionRequest.verify|verify} messages. - * @param message RestoreAppVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IRestoreAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RestoreAppVersionRequest.verify|verify} messages. - * @param message RestoreAppVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IRestoreAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreAppVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RestoreAppVersionRequest; - - /** - * Decodes a RestoreAppVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RestoreAppVersionRequest; - - /** - * Verifies a RestoreAppVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreAppVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreAppVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RestoreAppVersionRequest; - - /** - * Creates a plain object from a RestoreAppVersionRequest message. Also converts values to other types if specified. - * @param message RestoreAppVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.RestoreAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreAppVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreAppVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RestoreAppVersionResponse. */ - interface IRestoreAppVersionResponse { - } - - /** Represents a RestoreAppVersionResponse. */ - class RestoreAppVersionResponse implements IRestoreAppVersionResponse { - - /** - * Constructs a new RestoreAppVersionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IRestoreAppVersionResponse); - - /** - * Creates a new RestoreAppVersionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreAppVersionResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IRestoreAppVersionResponse): google.cloud.ces.v1.RestoreAppVersionResponse; - - /** - * Encodes the specified RestoreAppVersionResponse message. Does not implicitly {@link google.cloud.ces.v1.RestoreAppVersionResponse.verify|verify} messages. - * @param message RestoreAppVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IRestoreAppVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreAppVersionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RestoreAppVersionResponse.verify|verify} messages. - * @param message RestoreAppVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IRestoreAppVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreAppVersionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreAppVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RestoreAppVersionResponse; - - /** - * Decodes a RestoreAppVersionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreAppVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RestoreAppVersionResponse; - - /** - * Verifies a RestoreAppVersionResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreAppVersionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreAppVersionResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RestoreAppVersionResponse; - - /** - * Creates a plain object from a RestoreAppVersionResponse message. Also converts values to other types if specified. - * @param message RestoreAppVersionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.RestoreAppVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreAppVersionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreAppVersionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListChangelogsRequest. */ - interface IListChangelogsRequest { - - /** ListChangelogsRequest parent */ - parent?: (string|null); - - /** ListChangelogsRequest pageSize */ - pageSize?: (number|null); - - /** ListChangelogsRequest pageToken */ - pageToken?: (string|null); - - /** ListChangelogsRequest filter */ - filter?: (string|null); - - /** ListChangelogsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListChangelogsRequest. */ - class ListChangelogsRequest implements IListChangelogsRequest { - - /** - * Constructs a new ListChangelogsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListChangelogsRequest); - - /** ListChangelogsRequest parent. */ - public parent: string; - - /** ListChangelogsRequest pageSize. */ - public pageSize: number; - - /** ListChangelogsRequest pageToken. */ - public pageToken: string; - - /** ListChangelogsRequest filter. */ - public filter: string; - - /** ListChangelogsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListChangelogsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListChangelogsRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IListChangelogsRequest): google.cloud.ces.v1.ListChangelogsRequest; - - /** - * Encodes the specified ListChangelogsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListChangelogsRequest.verify|verify} messages. - * @param message ListChangelogsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListChangelogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListChangelogsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListChangelogsRequest.verify|verify} messages. - * @param message ListChangelogsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListChangelogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListChangelogsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListChangelogsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListChangelogsRequest; - - /** - * Decodes a ListChangelogsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListChangelogsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListChangelogsRequest; - - /** - * Verifies a ListChangelogsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListChangelogsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListChangelogsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListChangelogsRequest; - - /** - * Creates a plain object from a ListChangelogsRequest message. Also converts values to other types if specified. - * @param message ListChangelogsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListChangelogsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListChangelogsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListChangelogsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListChangelogsResponse. */ - interface IListChangelogsResponse { - - /** ListChangelogsResponse changelogs */ - changelogs?: (google.cloud.ces.v1.IChangelog[]|null); - - /** ListChangelogsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListChangelogsResponse. */ - class ListChangelogsResponse implements IListChangelogsResponse { - - /** - * Constructs a new ListChangelogsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IListChangelogsResponse); - - /** ListChangelogsResponse changelogs. */ - public changelogs: google.cloud.ces.v1.IChangelog[]; - - /** ListChangelogsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListChangelogsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListChangelogsResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IListChangelogsResponse): google.cloud.ces.v1.ListChangelogsResponse; - - /** - * Encodes the specified ListChangelogsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListChangelogsResponse.verify|verify} messages. - * @param message ListChangelogsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IListChangelogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListChangelogsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListChangelogsResponse.verify|verify} messages. - * @param message ListChangelogsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IListChangelogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListChangelogsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListChangelogsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ListChangelogsResponse; - - /** - * Decodes a ListChangelogsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListChangelogsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ListChangelogsResponse; - - /** - * Verifies a ListChangelogsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListChangelogsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListChangelogsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ListChangelogsResponse; - - /** - * Creates a plain object from a ListChangelogsResponse message. Also converts values to other types if specified. - * @param message ListChangelogsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ListChangelogsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListChangelogsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListChangelogsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetChangelogRequest. */ - interface IGetChangelogRequest { - - /** GetChangelogRequest name */ - name?: (string|null); - } - - /** Represents a GetChangelogRequest. */ - class GetChangelogRequest implements IGetChangelogRequest { - - /** - * Constructs a new GetChangelogRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IGetChangelogRequest); - - /** GetChangelogRequest name. */ - public name: string; - - /** - * Creates a new GetChangelogRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetChangelogRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IGetChangelogRequest): google.cloud.ces.v1.GetChangelogRequest; - - /** - * Encodes the specified GetChangelogRequest message. Does not implicitly {@link google.cloud.ces.v1.GetChangelogRequest.verify|verify} messages. - * @param message GetChangelogRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IGetChangelogRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetChangelogRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetChangelogRequest.verify|verify} messages. - * @param message GetChangelogRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IGetChangelogRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetChangelogRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetChangelogRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GetChangelogRequest; - - /** - * Decodes a GetChangelogRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetChangelogRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GetChangelogRequest; - - /** - * Verifies a GetChangelogRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetChangelogRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetChangelogRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GetChangelogRequest; - - /** - * Creates a plain object from a GetChangelogRequest message. Also converts values to other types if specified. - * @param message GetChangelogRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.GetChangelogRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetChangelogRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetChangelogRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an App. */ - interface IApp { - - /** App name */ - name?: (string|null); - - /** App displayName */ - displayName?: (string|null); - - /** App description */ - description?: (string|null); - - /** App pinned */ - pinned?: (boolean|null); - - /** App rootAgent */ - rootAgent?: (string|null); - - /** App languageSettings */ - languageSettings?: (google.cloud.ces.v1.ILanguageSettings|null); - - /** App timeZoneSettings */ - timeZoneSettings?: (google.cloud.ces.v1.ITimeZoneSettings|null); - - /** App audioProcessingConfig */ - audioProcessingConfig?: (google.cloud.ces.v1.IAudioProcessingConfig|null); - - /** App loggingSettings */ - loggingSettings?: (google.cloud.ces.v1.ILoggingSettings|null); - - /** App modelSettings */ - modelSettings?: (google.cloud.ces.v1.IModelSettings|null); - - /** App toolExecutionMode */ - toolExecutionMode?: (google.cloud.ces.v1.App.ToolExecutionMode|keyof typeof google.cloud.ces.v1.App.ToolExecutionMode|null); - - /** App evaluationMetricsThresholds */ - evaluationMetricsThresholds?: (google.cloud.ces.v1.IEvaluationMetricsThresholds|null); - - /** App variableDeclarations */ - variableDeclarations?: (google.cloud.ces.v1.App.IVariableDeclaration[]|null); - - /** App predefinedVariableDeclarations */ - predefinedVariableDeclarations?: (google.cloud.ces.v1.App.IVariableDeclaration[]|null); - - /** App globalInstruction */ - globalInstruction?: (string|null); - - /** App guardrails */ - guardrails?: (string[]|null); - - /** App dataStoreSettings */ - dataStoreSettings?: (google.cloud.ces.v1.IDataStoreSettings|null); - - /** App defaultChannelProfile */ - defaultChannelProfile?: (google.cloud.ces.v1.IChannelProfile|null); - - /** App metadata */ - metadata?: ({ [k: string]: string }|null); - - /** App createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** App updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** App etag */ - etag?: (string|null); - - /** App deploymentCount */ - deploymentCount?: (number|null); - - /** App clientCertificateSettings */ - clientCertificateSettings?: (google.cloud.ces.v1.IClientCertificateSettings|null); - - /** App locked */ - locked?: (boolean|null); - } - - /** Represents an App. */ - class App implements IApp { - - /** - * Constructs a new App. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IApp); - - /** App name. */ - public name: string; - - /** App displayName. */ - public displayName: string; - - /** App description. */ - public description: string; - - /** App pinned. */ - public pinned: boolean; - - /** App rootAgent. */ - public rootAgent: string; - - /** App languageSettings. */ - public languageSettings?: (google.cloud.ces.v1.ILanguageSettings|null); - - /** App timeZoneSettings. */ - public timeZoneSettings?: (google.cloud.ces.v1.ITimeZoneSettings|null); - - /** App audioProcessingConfig. */ - public audioProcessingConfig?: (google.cloud.ces.v1.IAudioProcessingConfig|null); - - /** App loggingSettings. */ - public loggingSettings?: (google.cloud.ces.v1.ILoggingSettings|null); - - /** App modelSettings. */ - public modelSettings?: (google.cloud.ces.v1.IModelSettings|null); - - /** App toolExecutionMode. */ - public toolExecutionMode: (google.cloud.ces.v1.App.ToolExecutionMode|keyof typeof google.cloud.ces.v1.App.ToolExecutionMode); - - /** App evaluationMetricsThresholds. */ - public evaluationMetricsThresholds?: (google.cloud.ces.v1.IEvaluationMetricsThresholds|null); - - /** App variableDeclarations. */ - public variableDeclarations: google.cloud.ces.v1.App.IVariableDeclaration[]; - - /** App predefinedVariableDeclarations. */ - public predefinedVariableDeclarations: google.cloud.ces.v1.App.IVariableDeclaration[]; - - /** App globalInstruction. */ - public globalInstruction: string; - - /** App guardrails. */ - public guardrails: string[]; - - /** App dataStoreSettings. */ - public dataStoreSettings?: (google.cloud.ces.v1.IDataStoreSettings|null); - - /** App defaultChannelProfile. */ - public defaultChannelProfile?: (google.cloud.ces.v1.IChannelProfile|null); - - /** App metadata. */ - public metadata: { [k: string]: string }; - - /** App createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** App updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** App etag. */ - public etag: string; - - /** App deploymentCount. */ - public deploymentCount: number; - - /** App clientCertificateSettings. */ - public clientCertificateSettings?: (google.cloud.ces.v1.IClientCertificateSettings|null); - - /** App locked. */ - public locked: boolean; - - /** - * Creates a new App instance using the specified properties. - * @param [properties] Properties to set - * @returns App instance - */ - public static create(properties?: google.cloud.ces.v1.IApp): google.cloud.ces.v1.App; - - /** - * Encodes the specified App message. Does not implicitly {@link google.cloud.ces.v1.App.verify|verify} messages. - * @param message App message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IApp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified App message, length delimited. Does not implicitly {@link google.cloud.ces.v1.App.verify|verify} messages. - * @param message App message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IApp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an App message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.App; - - /** - * Decodes an App message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.App; - - /** - * Verifies an App message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an App message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns App - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.App; - - /** - * Creates a plain object from an App message. Also converts values to other types if specified. - * @param message App - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.App, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this App to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for App - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace App { - - /** Properties of a VariableDeclaration. */ - interface IVariableDeclaration { - - /** VariableDeclaration name */ - name?: (string|null); - - /** VariableDeclaration description */ - description?: (string|null); - - /** VariableDeclaration schema */ - schema?: (google.cloud.ces.v1.ISchema|null); - } - - /** Represents a VariableDeclaration. */ - class VariableDeclaration implements IVariableDeclaration { - - /** - * Constructs a new VariableDeclaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.App.IVariableDeclaration); - - /** VariableDeclaration name. */ - public name: string; - - /** VariableDeclaration description. */ - public description: string; - - /** VariableDeclaration schema. */ - public schema?: (google.cloud.ces.v1.ISchema|null); - - /** - * Creates a new VariableDeclaration instance using the specified properties. - * @param [properties] Properties to set - * @returns VariableDeclaration instance - */ - public static create(properties?: google.cloud.ces.v1.App.IVariableDeclaration): google.cloud.ces.v1.App.VariableDeclaration; - - /** - * Encodes the specified VariableDeclaration message. Does not implicitly {@link google.cloud.ces.v1.App.VariableDeclaration.verify|verify} messages. - * @param message VariableDeclaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.App.IVariableDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VariableDeclaration message, length delimited. Does not implicitly {@link google.cloud.ces.v1.App.VariableDeclaration.verify|verify} messages. - * @param message VariableDeclaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.App.IVariableDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VariableDeclaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VariableDeclaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.App.VariableDeclaration; - - /** - * Decodes a VariableDeclaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VariableDeclaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.App.VariableDeclaration; - - /** - * Verifies a VariableDeclaration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a VariableDeclaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VariableDeclaration - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.App.VariableDeclaration; - - /** - * Creates a plain object from a VariableDeclaration message. Also converts values to other types if specified. - * @param message VariableDeclaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.App.VariableDeclaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this VariableDeclaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for VariableDeclaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** ToolExecutionMode enum. */ - enum ToolExecutionMode { - TOOL_EXECUTION_MODE_UNSPECIFIED = 0, - PARALLEL = 1, - SEQUENTIAL = 2 - } - } - - /** Properties of a TimeZoneSettings. */ - interface ITimeZoneSettings { - - /** TimeZoneSettings timeZone */ - timeZone?: (string|null); - } - - /** Represents a TimeZoneSettings. */ - class TimeZoneSettings implements ITimeZoneSettings { - - /** - * Constructs a new TimeZoneSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ITimeZoneSettings); - - /** TimeZoneSettings timeZone. */ - public timeZone: string; - - /** - * Creates a new TimeZoneSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns TimeZoneSettings instance - */ - public static create(properties?: google.cloud.ces.v1.ITimeZoneSettings): google.cloud.ces.v1.TimeZoneSettings; - - /** - * Encodes the specified TimeZoneSettings message. Does not implicitly {@link google.cloud.ces.v1.TimeZoneSettings.verify|verify} messages. - * @param message TimeZoneSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ITimeZoneSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimeZoneSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TimeZoneSettings.verify|verify} messages. - * @param message TimeZoneSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ITimeZoneSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TimeZoneSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimeZoneSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.TimeZoneSettings; - - /** - * Decodes a TimeZoneSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimeZoneSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.TimeZoneSettings; - - /** - * Verifies a TimeZoneSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TimeZoneSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimeZoneSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.TimeZoneSettings; - - /** - * Creates a plain object from a TimeZoneSettings message. Also converts values to other types if specified. - * @param message TimeZoneSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.TimeZoneSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimeZoneSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TimeZoneSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LanguageSettings. */ - interface ILanguageSettings { - - /** LanguageSettings defaultLanguageCode */ - defaultLanguageCode?: (string|null); - - /** LanguageSettings supportedLanguageCodes */ - supportedLanguageCodes?: (string[]|null); - - /** LanguageSettings enableMultilingualSupport */ - enableMultilingualSupport?: (boolean|null); - - /** LanguageSettings fallbackAction */ - fallbackAction?: (string|null); - } - - /** Represents a LanguageSettings. */ - class LanguageSettings implements ILanguageSettings { - - /** - * Constructs a new LanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ILanguageSettings); - - /** LanguageSettings defaultLanguageCode. */ - public defaultLanguageCode: string; - - /** LanguageSettings supportedLanguageCodes. */ - public supportedLanguageCodes: string[]; - - /** LanguageSettings enableMultilingualSupport. */ - public enableMultilingualSupport: boolean; - - /** LanguageSettings fallbackAction. */ - public fallbackAction: string; - - /** - * Creates a new LanguageSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns LanguageSettings instance - */ - public static create(properties?: google.cloud.ces.v1.ILanguageSettings): google.cloud.ces.v1.LanguageSettings; - - /** - * Encodes the specified LanguageSettings message. Does not implicitly {@link google.cloud.ces.v1.LanguageSettings.verify|verify} messages. - * @param message LanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ILanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LanguageSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.LanguageSettings.verify|verify} messages. - * @param message LanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ILanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LanguageSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.LanguageSettings; - - /** - * Decodes a LanguageSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.LanguageSettings; - - /** - * Verifies a LanguageSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LanguageSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.LanguageSettings; - - /** - * Creates a plain object from a LanguageSettings message. Also converts values to other types if specified. - * @param message LanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.LanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AudioProcessingConfig. */ - interface IAudioProcessingConfig { - - /** AudioProcessingConfig synthesizeSpeechConfigs */ - synthesizeSpeechConfigs?: ({ [k: string]: google.cloud.ces.v1.ISynthesizeSpeechConfig }|null); - - /** AudioProcessingConfig bargeInConfig */ - bargeInConfig?: (google.cloud.ces.v1.IBargeInConfig|null); - - /** AudioProcessingConfig inactivityTimeout */ - inactivityTimeout?: (google.protobuf.IDuration|null); - - /** AudioProcessingConfig ambientSoundConfig */ - ambientSoundConfig?: (google.cloud.ces.v1.IAmbientSoundConfig|null); - } - - /** Represents an AudioProcessingConfig. */ - class AudioProcessingConfig implements IAudioProcessingConfig { - - /** - * Constructs a new AudioProcessingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IAudioProcessingConfig); - - /** AudioProcessingConfig synthesizeSpeechConfigs. */ - public synthesizeSpeechConfigs: { [k: string]: google.cloud.ces.v1.ISynthesizeSpeechConfig }; - - /** AudioProcessingConfig bargeInConfig. */ - public bargeInConfig?: (google.cloud.ces.v1.IBargeInConfig|null); - - /** AudioProcessingConfig inactivityTimeout. */ - public inactivityTimeout?: (google.protobuf.IDuration|null); - - /** AudioProcessingConfig ambientSoundConfig. */ - public ambientSoundConfig?: (google.cloud.ces.v1.IAmbientSoundConfig|null); - - /** - * Creates a new AudioProcessingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AudioProcessingConfig instance - */ - public static create(properties?: google.cloud.ces.v1.IAudioProcessingConfig): google.cloud.ces.v1.AudioProcessingConfig; - - /** - * Encodes the specified AudioProcessingConfig message. Does not implicitly {@link google.cloud.ces.v1.AudioProcessingConfig.verify|verify} messages. - * @param message AudioProcessingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IAudioProcessingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AudioProcessingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AudioProcessingConfig.verify|verify} messages. - * @param message AudioProcessingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IAudioProcessingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AudioProcessingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AudioProcessingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.AudioProcessingConfig; - - /** - * Decodes an AudioProcessingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AudioProcessingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.AudioProcessingConfig; - - /** - * Verifies an AudioProcessingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AudioProcessingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AudioProcessingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.AudioProcessingConfig; - - /** - * Creates a plain object from an AudioProcessingConfig message. Also converts values to other types if specified. - * @param message AudioProcessingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.AudioProcessingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AudioProcessingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AudioProcessingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AmbientSoundConfig. */ - interface IAmbientSoundConfig { - - /** AmbientSoundConfig prebuiltAmbientNoise */ - prebuiltAmbientNoise?: (google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise|keyof typeof google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise|null); - - /** AmbientSoundConfig gcsUri */ - gcsUri?: (string|null); - - /** AmbientSoundConfig prebuiltAmbientSound */ - prebuiltAmbientSound?: (string|null); - - /** AmbientSoundConfig volumeGainDb */ - volumeGainDb?: (number|null); - } - - /** Represents an AmbientSoundConfig. */ - class AmbientSoundConfig implements IAmbientSoundConfig { - - /** - * Constructs a new AmbientSoundConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IAmbientSoundConfig); - - /** AmbientSoundConfig prebuiltAmbientNoise. */ - public prebuiltAmbientNoise?: (google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise|keyof typeof google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise|null); - - /** AmbientSoundConfig gcsUri. */ - public gcsUri?: (string|null); - - /** AmbientSoundConfig prebuiltAmbientSound. */ - public prebuiltAmbientSound?: (string|null); - - /** AmbientSoundConfig volumeGainDb. */ - public volumeGainDb: number; - - /** AmbientSoundConfig source. */ - public source?: ("prebuiltAmbientNoise"|"gcsUri"|"prebuiltAmbientSound"); - - /** - * Creates a new AmbientSoundConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AmbientSoundConfig instance - */ - public static create(properties?: google.cloud.ces.v1.IAmbientSoundConfig): google.cloud.ces.v1.AmbientSoundConfig; - - /** - * Encodes the specified AmbientSoundConfig message. Does not implicitly {@link google.cloud.ces.v1.AmbientSoundConfig.verify|verify} messages. - * @param message AmbientSoundConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IAmbientSoundConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AmbientSoundConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AmbientSoundConfig.verify|verify} messages. - * @param message AmbientSoundConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IAmbientSoundConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AmbientSoundConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AmbientSoundConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.AmbientSoundConfig; - - /** - * Decodes an AmbientSoundConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AmbientSoundConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.AmbientSoundConfig; - - /** - * Verifies an AmbientSoundConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AmbientSoundConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AmbientSoundConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.AmbientSoundConfig; - - /** - * Creates a plain object from an AmbientSoundConfig message. Also converts values to other types if specified. - * @param message AmbientSoundConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.AmbientSoundConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AmbientSoundConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AmbientSoundConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AmbientSoundConfig { - - /** PrebuiltAmbientNoise enum. */ - enum PrebuiltAmbientNoise { - PREBUILT_AMBIENT_NOISE_UNSPECIFIED = 0, - RETAIL_STORE = 1, - CONVENTION_HALL = 2, - OUTDOOR = 3 - } - } - - /** Properties of a BargeInConfig. */ - interface IBargeInConfig { - - /** BargeInConfig disableBargeIn */ - disableBargeIn?: (boolean|null); - - /** BargeInConfig bargeInAwareness */ - bargeInAwareness?: (boolean|null); - } - - /** Represents a BargeInConfig. */ - class BargeInConfig implements IBargeInConfig { - - /** - * Constructs a new BargeInConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IBargeInConfig); - - /** BargeInConfig disableBargeIn. */ - public disableBargeIn: boolean; - - /** BargeInConfig bargeInAwareness. */ - public bargeInAwareness: boolean; - - /** - * Creates a new BargeInConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns BargeInConfig instance - */ - public static create(properties?: google.cloud.ces.v1.IBargeInConfig): google.cloud.ces.v1.BargeInConfig; - - /** - * Encodes the specified BargeInConfig message. Does not implicitly {@link google.cloud.ces.v1.BargeInConfig.verify|verify} messages. - * @param message BargeInConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IBargeInConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BargeInConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BargeInConfig.verify|verify} messages. - * @param message BargeInConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IBargeInConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BargeInConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BargeInConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.BargeInConfig; - - /** - * Decodes a BargeInConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BargeInConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.BargeInConfig; - - /** - * Verifies a BargeInConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BargeInConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BargeInConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.BargeInConfig; - - /** - * Creates a plain object from a BargeInConfig message. Also converts values to other types if specified. - * @param message BargeInConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.BargeInConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BargeInConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BargeInConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SynthesizeSpeechConfig. */ - interface ISynthesizeSpeechConfig { - - /** SynthesizeSpeechConfig voice */ - voice?: (string|null); - - /** SynthesizeSpeechConfig speakingRate */ - speakingRate?: (number|null); - } - - /** Represents a SynthesizeSpeechConfig. */ - class SynthesizeSpeechConfig implements ISynthesizeSpeechConfig { - - /** - * Constructs a new SynthesizeSpeechConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ISynthesizeSpeechConfig); - - /** SynthesizeSpeechConfig voice. */ - public voice: string; - - /** SynthesizeSpeechConfig speakingRate. */ - public speakingRate: number; - - /** - * Creates a new SynthesizeSpeechConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SynthesizeSpeechConfig instance - */ - public static create(properties?: google.cloud.ces.v1.ISynthesizeSpeechConfig): google.cloud.ces.v1.SynthesizeSpeechConfig; - - /** - * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.ces.v1.SynthesizeSpeechConfig.verify|verify} messages. - * @param message SynthesizeSpeechConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SynthesizeSpeechConfig.verify|verify} messages. - * @param message SynthesizeSpeechConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SynthesizeSpeechConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.SynthesizeSpeechConfig; - - /** - * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SynthesizeSpeechConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.SynthesizeSpeechConfig; - - /** - * Verifies a SynthesizeSpeechConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SynthesizeSpeechConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.SynthesizeSpeechConfig; - - /** - * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. - * @param message SynthesizeSpeechConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.SynthesizeSpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SynthesizeSpeechConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SynthesizeSpeechConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MetricAnalysisSettings. */ - interface IMetricAnalysisSettings { - - /** MetricAnalysisSettings llmMetricsOptedOut */ - llmMetricsOptedOut?: (boolean|null); - } - - /** Represents a MetricAnalysisSettings. */ - class MetricAnalysisSettings implements IMetricAnalysisSettings { - - /** - * Constructs a new MetricAnalysisSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IMetricAnalysisSettings); - - /** MetricAnalysisSettings llmMetricsOptedOut. */ - public llmMetricsOptedOut: boolean; - - /** - * Creates a new MetricAnalysisSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MetricAnalysisSettings instance - */ - public static create(properties?: google.cloud.ces.v1.IMetricAnalysisSettings): google.cloud.ces.v1.MetricAnalysisSettings; - - /** - * Encodes the specified MetricAnalysisSettings message. Does not implicitly {@link google.cloud.ces.v1.MetricAnalysisSettings.verify|verify} messages. - * @param message MetricAnalysisSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IMetricAnalysisSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MetricAnalysisSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.MetricAnalysisSettings.verify|verify} messages. - * @param message MetricAnalysisSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IMetricAnalysisSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MetricAnalysisSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MetricAnalysisSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.MetricAnalysisSettings; - - /** - * Decodes a MetricAnalysisSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MetricAnalysisSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.MetricAnalysisSettings; - - /** - * Verifies a MetricAnalysisSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MetricAnalysisSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MetricAnalysisSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.MetricAnalysisSettings; - - /** - * Creates a plain object from a MetricAnalysisSettings message. Also converts values to other types if specified. - * @param message MetricAnalysisSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.MetricAnalysisSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MetricAnalysisSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MetricAnalysisSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LoggingSettings. */ - interface ILoggingSettings { - - /** LoggingSettings redactionConfig */ - redactionConfig?: (google.cloud.ces.v1.IRedactionConfig|null); - - /** LoggingSettings audioRecordingConfig */ - audioRecordingConfig?: (google.cloud.ces.v1.IAudioRecordingConfig|null); - - /** LoggingSettings bigqueryExportSettings */ - bigqueryExportSettings?: (google.cloud.ces.v1.IBigQueryExportSettings|null); - - /** LoggingSettings cloudLoggingSettings */ - cloudLoggingSettings?: (google.cloud.ces.v1.ICloudLoggingSettings|null); - - /** LoggingSettings conversationLoggingSettings */ - conversationLoggingSettings?: (google.cloud.ces.v1.IConversationLoggingSettings|null); - - /** LoggingSettings evaluationAudioRecordingConfig */ - evaluationAudioRecordingConfig?: (google.cloud.ces.v1.IAudioRecordingConfig|null); - - /** LoggingSettings metricAnalysisSettings */ - metricAnalysisSettings?: (google.cloud.ces.v1.IMetricAnalysisSettings|null); - } - - /** Represents a LoggingSettings. */ - class LoggingSettings implements ILoggingSettings { - - /** - * Constructs a new LoggingSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ILoggingSettings); - - /** LoggingSettings redactionConfig. */ - public redactionConfig?: (google.cloud.ces.v1.IRedactionConfig|null); - - /** LoggingSettings audioRecordingConfig. */ - public audioRecordingConfig?: (google.cloud.ces.v1.IAudioRecordingConfig|null); - - /** LoggingSettings bigqueryExportSettings. */ - public bigqueryExportSettings?: (google.cloud.ces.v1.IBigQueryExportSettings|null); - - /** LoggingSettings cloudLoggingSettings. */ - public cloudLoggingSettings?: (google.cloud.ces.v1.ICloudLoggingSettings|null); - - /** LoggingSettings conversationLoggingSettings. */ - public conversationLoggingSettings?: (google.cloud.ces.v1.IConversationLoggingSettings|null); - - /** LoggingSettings evaluationAudioRecordingConfig. */ - public evaluationAudioRecordingConfig?: (google.cloud.ces.v1.IAudioRecordingConfig|null); - - /** LoggingSettings metricAnalysisSettings. */ - public metricAnalysisSettings?: (google.cloud.ces.v1.IMetricAnalysisSettings|null); - - /** - * Creates a new LoggingSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns LoggingSettings instance - */ - public static create(properties?: google.cloud.ces.v1.ILoggingSettings): google.cloud.ces.v1.LoggingSettings; - - /** - * Encodes the specified LoggingSettings message. Does not implicitly {@link google.cloud.ces.v1.LoggingSettings.verify|verify} messages. - * @param message LoggingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ILoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.LoggingSettings.verify|verify} messages. - * @param message LoggingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ILoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LoggingSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.LoggingSettings; - - /** - * Decodes a LoggingSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.LoggingSettings; - - /** - * Verifies a LoggingSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LoggingSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LoggingSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.LoggingSettings; - - /** - * Creates a plain object from a LoggingSettings message. Also converts values to other types if specified. - * @param message LoggingSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.LoggingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LoggingSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LoggingSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EvaluationMetricsThresholds. */ - interface IEvaluationMetricsThresholds { - - /** EvaluationMetricsThresholds goldenEvaluationMetricsThresholds */ - goldenEvaluationMetricsThresholds?: (google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null); - - /** EvaluationMetricsThresholds hallucinationMetricBehavior */ - hallucinationMetricBehavior?: (google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|null); - - /** EvaluationMetricsThresholds goldenHallucinationMetricBehavior */ - goldenHallucinationMetricBehavior?: (google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|null); - - /** EvaluationMetricsThresholds scenarioHallucinationMetricBehavior */ - scenarioHallucinationMetricBehavior?: (google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|null); - } - - /** Represents an EvaluationMetricsThresholds. */ - class EvaluationMetricsThresholds implements IEvaluationMetricsThresholds { - - /** - * Constructs a new EvaluationMetricsThresholds. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IEvaluationMetricsThresholds); - - /** EvaluationMetricsThresholds goldenEvaluationMetricsThresholds. */ - public goldenEvaluationMetricsThresholds?: (google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null); - - /** EvaluationMetricsThresholds hallucinationMetricBehavior. */ - public hallucinationMetricBehavior: (google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior); - - /** EvaluationMetricsThresholds goldenHallucinationMetricBehavior. */ - public goldenHallucinationMetricBehavior: (google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior); - - /** EvaluationMetricsThresholds scenarioHallucinationMetricBehavior. */ - public scenarioHallucinationMetricBehavior: (google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior); - - /** - * Creates a new EvaluationMetricsThresholds instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluationMetricsThresholds instance - */ - public static create(properties?: google.cloud.ces.v1.IEvaluationMetricsThresholds): google.cloud.ces.v1.EvaluationMetricsThresholds; - - /** - * Encodes the specified EvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.verify|verify} messages. - * @param message EvaluationMetricsThresholds message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.verify|verify} messages. - * @param message EvaluationMetricsThresholds message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluationMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.EvaluationMetricsThresholds; - - /** - * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluationMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.EvaluationMetricsThresholds; - - /** - * Verifies an EvaluationMetricsThresholds message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluationMetricsThresholds - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.EvaluationMetricsThresholds; - - /** - * Creates a plain object from an EvaluationMetricsThresholds message. Also converts values to other types if specified. - * @param message EvaluationMetricsThresholds - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.EvaluationMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluationMetricsThresholds to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluationMetricsThresholds - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EvaluationMetricsThresholds { - - /** Properties of a GoldenEvaluationMetricsThresholds. */ - interface IGoldenEvaluationMetricsThresholds { - - /** GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds */ - turnLevelMetricsThresholds?: (google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null); - - /** GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds */ - expectationLevelMetricsThresholds?: (google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null); - - /** GoldenEvaluationMetricsThresholds toolMatchingSettings */ - toolMatchingSettings?: (google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings|null); - } - - /** Represents a GoldenEvaluationMetricsThresholds. */ - class GoldenEvaluationMetricsThresholds implements IGoldenEvaluationMetricsThresholds { - - /** - * Constructs a new GoldenEvaluationMetricsThresholds. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds); - - /** GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds. */ - public turnLevelMetricsThresholds?: (google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null); - - /** GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds. */ - public expectationLevelMetricsThresholds?: (google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null); - - /** GoldenEvaluationMetricsThresholds toolMatchingSettings. */ - public toolMatchingSettings?: (google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings|null); - - /** - * Creates a new GoldenEvaluationMetricsThresholds instance using the specified properties. - * @param [properties] Properties to set - * @returns GoldenEvaluationMetricsThresholds instance - */ - public static create(properties?: google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; - - /** - * Encodes the specified GoldenEvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. - * @param message GoldenEvaluationMetricsThresholds message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoldenEvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. - * @param message GoldenEvaluationMetricsThresholds message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoldenEvaluationMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; - - /** - * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoldenEvaluationMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; - - /** - * Verifies a GoldenEvaluationMetricsThresholds message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoldenEvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoldenEvaluationMetricsThresholds - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; - - /** - * Creates a plain object from a GoldenEvaluationMetricsThresholds message. Also converts values to other types if specified. - * @param message GoldenEvaluationMetricsThresholds - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoldenEvaluationMetricsThresholds to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoldenEvaluationMetricsThresholds - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GoldenEvaluationMetricsThresholds { - - /** Properties of a TurnLevelMetricsThresholds. */ - interface ITurnLevelMetricsThresholds { - - /** TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold */ - semanticSimilaritySuccessThreshold?: (number|null); - - /** TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold */ - overallToolInvocationCorrectnessThreshold?: (number|null); - - /** TurnLevelMetricsThresholds semanticSimilarityChannel */ - semanticSimilarityChannel?: (google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|null); - } - - /** Represents a TurnLevelMetricsThresholds. */ - class TurnLevelMetricsThresholds implements ITurnLevelMetricsThresholds { - - /** - * Constructs a new TurnLevelMetricsThresholds. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds); - - /** TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold. */ - public semanticSimilaritySuccessThreshold?: (number|null); - - /** TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold. */ - public overallToolInvocationCorrectnessThreshold?: (number|null); - - /** TurnLevelMetricsThresholds semanticSimilarityChannel. */ - public semanticSimilarityChannel: (google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel); - - /** - * Creates a new TurnLevelMetricsThresholds instance using the specified properties. - * @param [properties] Properties to set - * @returns TurnLevelMetricsThresholds instance - */ - public static create(properties?: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; - - /** - * Encodes the specified TurnLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. - * @param message TurnLevelMetricsThresholds message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TurnLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. - * @param message TurnLevelMetricsThresholds message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TurnLevelMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; - - /** - * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TurnLevelMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; - - /** - * Verifies a TurnLevelMetricsThresholds message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TurnLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TurnLevelMetricsThresholds - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; - - /** - * Creates a plain object from a TurnLevelMetricsThresholds message. Also converts values to other types if specified. - * @param message TurnLevelMetricsThresholds - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TurnLevelMetricsThresholds to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TurnLevelMetricsThresholds - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TurnLevelMetricsThresholds { - - /** SemanticSimilarityChannel enum. */ - enum SemanticSimilarityChannel { - SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED = 0, - TEXT = 1, - AUDIO = 2 - } - } - - /** Properties of an ExpectationLevelMetricsThresholds. */ - interface IExpectationLevelMetricsThresholds { - - /** ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold */ - toolInvocationParameterCorrectnessThreshold?: (number|null); - } - - /** Represents an ExpectationLevelMetricsThresholds. */ - class ExpectationLevelMetricsThresholds implements IExpectationLevelMetricsThresholds { - - /** - * Constructs a new ExpectationLevelMetricsThresholds. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds); - - /** ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold. */ - public toolInvocationParameterCorrectnessThreshold?: (number|null); - - /** - * Creates a new ExpectationLevelMetricsThresholds instance using the specified properties. - * @param [properties] Properties to set - * @returns ExpectationLevelMetricsThresholds instance - */ - public static create(properties?: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; - - /** - * Encodes the specified ExpectationLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. - * @param message ExpectationLevelMetricsThresholds message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExpectationLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. - * @param message ExpectationLevelMetricsThresholds message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExpectationLevelMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; - - /** - * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExpectationLevelMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; - - /** - * Verifies an ExpectationLevelMetricsThresholds message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExpectationLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExpectationLevelMetricsThresholds - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; - - /** - * Creates a plain object from an ExpectationLevelMetricsThresholds message. Also converts values to other types if specified. - * @param message ExpectationLevelMetricsThresholds - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExpectationLevelMetricsThresholds to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExpectationLevelMetricsThresholds - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ToolMatchingSettings. */ - interface IToolMatchingSettings { - - /** ToolMatchingSettings extraToolCallBehavior */ - extraToolCallBehavior?: (google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|null); - } - - /** Represents a ToolMatchingSettings. */ - class ToolMatchingSettings implements IToolMatchingSettings { - - /** - * Constructs a new ToolMatchingSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings); - - /** ToolMatchingSettings extraToolCallBehavior. */ - public extraToolCallBehavior: (google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|keyof typeof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior); - - /** - * Creates a new ToolMatchingSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolMatchingSettings instance - */ - public static create(properties?: google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings): google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings; - - /** - * Encodes the specified ToolMatchingSettings message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. - * @param message ToolMatchingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolMatchingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. - * @param message ToolMatchingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolMatchingSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolMatchingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings; - - /** - * Decodes a ToolMatchingSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolMatchingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings; - - /** - * Verifies a ToolMatchingSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolMatchingSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolMatchingSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings; - - /** - * Creates a plain object from a ToolMatchingSettings message. Also converts values to other types if specified. - * @param message ToolMatchingSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolMatchingSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolMatchingSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ToolMatchingSettings { - - /** ExtraToolCallBehavior enum. */ - enum ExtraToolCallBehavior { - EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED = 0, - FAIL = 1, - ALLOW = 2 - } - } - - /** HallucinationMetricBehavior enum. */ - enum HallucinationMetricBehavior { - HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED = 0, - DISABLED = 1, - ENABLED = 2 - } - } - - /** Properties of a ClientCertificateSettings. */ - interface IClientCertificateSettings { - - /** ClientCertificateSettings tlsCertificate */ - tlsCertificate?: (string|null); - - /** ClientCertificateSettings privateKey */ - privateKey?: (string|null); - - /** ClientCertificateSettings passphrase */ - passphrase?: (string|null); - } - - /** Represents a ClientCertificateSettings. */ - class ClientCertificateSettings implements IClientCertificateSettings { - - /** - * Constructs a new ClientCertificateSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IClientCertificateSettings); - - /** ClientCertificateSettings tlsCertificate. */ - public tlsCertificate: string; - - /** ClientCertificateSettings privateKey. */ - public privateKey: string; - - /** ClientCertificateSettings passphrase. */ - public passphrase: string; - - /** - * Creates a new ClientCertificateSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientCertificateSettings instance - */ - public static create(properties?: google.cloud.ces.v1.IClientCertificateSettings): google.cloud.ces.v1.ClientCertificateSettings; - - /** - * Encodes the specified ClientCertificateSettings message. Does not implicitly {@link google.cloud.ces.v1.ClientCertificateSettings.verify|verify} messages. - * @param message ClientCertificateSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IClientCertificateSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientCertificateSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ClientCertificateSettings.verify|verify} messages. - * @param message ClientCertificateSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IClientCertificateSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientCertificateSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientCertificateSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ClientCertificateSettings; - - /** - * Decodes a ClientCertificateSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientCertificateSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ClientCertificateSettings; - - /** - * Verifies a ClientCertificateSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientCertificateSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientCertificateSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ClientCertificateSettings; - - /** - * Creates a plain object from a ClientCertificateSettings message. Also converts values to other types if specified. - * @param message ClientCertificateSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ClientCertificateSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientCertificateSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientCertificateSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ConversationLoggingSettings. */ - interface IConversationLoggingSettings { - - /** ConversationLoggingSettings disableConversationLogging */ - disableConversationLogging?: (boolean|null); - } - - /** Represents a ConversationLoggingSettings. */ - class ConversationLoggingSettings implements IConversationLoggingSettings { - - /** - * Constructs a new ConversationLoggingSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IConversationLoggingSettings); - - /** ConversationLoggingSettings disableConversationLogging. */ - public disableConversationLogging: boolean; - - /** - * Creates a new ConversationLoggingSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ConversationLoggingSettings instance - */ - public static create(properties?: google.cloud.ces.v1.IConversationLoggingSettings): google.cloud.ces.v1.ConversationLoggingSettings; - - /** - * Encodes the specified ConversationLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1.ConversationLoggingSettings.verify|verify} messages. - * @param message ConversationLoggingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IConversationLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConversationLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ConversationLoggingSettings.verify|verify} messages. - * @param message ConversationLoggingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IConversationLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConversationLoggingSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConversationLoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ConversationLoggingSettings; - - /** - * Decodes a ConversationLoggingSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConversationLoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ConversationLoggingSettings; - - /** - * Verifies a ConversationLoggingSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConversationLoggingSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConversationLoggingSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ConversationLoggingSettings; - - /** - * Creates a plain object from a ConversationLoggingSettings message. Also converts values to other types if specified. - * @param message ConversationLoggingSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ConversationLoggingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConversationLoggingSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConversationLoggingSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudLoggingSettings. */ - interface ICloudLoggingSettings { - - /** CloudLoggingSettings enableCloudLogging */ - enableCloudLogging?: (boolean|null); - } - - /** Represents a CloudLoggingSettings. */ - class CloudLoggingSettings implements ICloudLoggingSettings { - - /** - * Constructs a new CloudLoggingSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ICloudLoggingSettings); - - /** CloudLoggingSettings enableCloudLogging. */ - public enableCloudLogging: boolean; - - /** - * Creates a new CloudLoggingSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudLoggingSettings instance - */ - public static create(properties?: google.cloud.ces.v1.ICloudLoggingSettings): google.cloud.ces.v1.CloudLoggingSettings; - - /** - * Encodes the specified CloudLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1.CloudLoggingSettings.verify|verify} messages. - * @param message CloudLoggingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ICloudLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CloudLoggingSettings.verify|verify} messages. - * @param message CloudLoggingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ICloudLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudLoggingSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudLoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CloudLoggingSettings; - - /** - * Decodes a CloudLoggingSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudLoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CloudLoggingSettings; - - /** - * Verifies a CloudLoggingSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudLoggingSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudLoggingSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CloudLoggingSettings; - - /** - * Creates a plain object from a CloudLoggingSettings message. Also converts values to other types if specified. - * @param message CloudLoggingSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.CloudLoggingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudLoggingSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudLoggingSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AudioRecordingConfig. */ - interface IAudioRecordingConfig { - - /** AudioRecordingConfig gcsBucket */ - gcsBucket?: (string|null); - - /** AudioRecordingConfig gcsPathPrefix */ - gcsPathPrefix?: (string|null); - } - - /** Represents an AudioRecordingConfig. */ - class AudioRecordingConfig implements IAudioRecordingConfig { - - /** - * Constructs a new AudioRecordingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IAudioRecordingConfig); - - /** AudioRecordingConfig gcsBucket. */ - public gcsBucket: string; - - /** AudioRecordingConfig gcsPathPrefix. */ - public gcsPathPrefix: string; - - /** - * Creates a new AudioRecordingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AudioRecordingConfig instance - */ - public static create(properties?: google.cloud.ces.v1.IAudioRecordingConfig): google.cloud.ces.v1.AudioRecordingConfig; - - /** - * Encodes the specified AudioRecordingConfig message. Does not implicitly {@link google.cloud.ces.v1.AudioRecordingConfig.verify|verify} messages. - * @param message AudioRecordingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IAudioRecordingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AudioRecordingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AudioRecordingConfig.verify|verify} messages. - * @param message AudioRecordingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IAudioRecordingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AudioRecordingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AudioRecordingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.AudioRecordingConfig; - - /** - * Decodes an AudioRecordingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AudioRecordingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.AudioRecordingConfig; - - /** - * Verifies an AudioRecordingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AudioRecordingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AudioRecordingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.AudioRecordingConfig; - - /** - * Creates a plain object from an AudioRecordingConfig message. Also converts values to other types if specified. - * @param message AudioRecordingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.AudioRecordingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AudioRecordingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AudioRecordingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RedactionConfig. */ - interface IRedactionConfig { - - /** RedactionConfig enableRedaction */ - enableRedaction?: (boolean|null); - - /** RedactionConfig inspectTemplate */ - inspectTemplate?: (string|null); - - /** RedactionConfig deidentifyTemplate */ - deidentifyTemplate?: (string|null); - } - - /** Represents a RedactionConfig. */ - class RedactionConfig implements IRedactionConfig { - - /** - * Constructs a new RedactionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IRedactionConfig); - - /** RedactionConfig enableRedaction. */ - public enableRedaction: boolean; - - /** RedactionConfig inspectTemplate. */ - public inspectTemplate: string; - - /** RedactionConfig deidentifyTemplate. */ - public deidentifyTemplate: string; - - /** - * Creates a new RedactionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns RedactionConfig instance - */ - public static create(properties?: google.cloud.ces.v1.IRedactionConfig): google.cloud.ces.v1.RedactionConfig; - - /** - * Encodes the specified RedactionConfig message. Does not implicitly {@link google.cloud.ces.v1.RedactionConfig.verify|verify} messages. - * @param message RedactionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IRedactionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RedactionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RedactionConfig.verify|verify} messages. - * @param message RedactionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IRedactionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RedactionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RedactionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RedactionConfig; - - /** - * Decodes a RedactionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RedactionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RedactionConfig; - - /** - * Verifies a RedactionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RedactionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RedactionConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RedactionConfig; - - /** - * Creates a plain object from a RedactionConfig message. Also converts values to other types if specified. - * @param message RedactionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.RedactionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RedactionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RedactionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DataStoreSettings. */ - interface IDataStoreSettings { - - /** DataStoreSettings engines */ - engines?: (google.cloud.ces.v1.DataStoreSettings.IEngine[]|null); - } - - /** Represents a DataStoreSettings. */ - class DataStoreSettings implements IDataStoreSettings { - - /** - * Constructs a new DataStoreSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IDataStoreSettings); - - /** DataStoreSettings engines. */ - public engines: google.cloud.ces.v1.DataStoreSettings.IEngine[]; - - /** - * Creates a new DataStoreSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DataStoreSettings instance - */ - public static create(properties?: google.cloud.ces.v1.IDataStoreSettings): google.cloud.ces.v1.DataStoreSettings; - - /** - * Encodes the specified DataStoreSettings message. Does not implicitly {@link google.cloud.ces.v1.DataStoreSettings.verify|verify} messages. - * @param message DataStoreSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IDataStoreSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataStoreSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreSettings.verify|verify} messages. - * @param message DataStoreSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IDataStoreSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataStoreSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataStoreSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreSettings; - - /** - * Decodes a DataStoreSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataStoreSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreSettings; - - /** - * Verifies a DataStoreSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataStoreSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataStoreSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreSettings; - - /** - * Creates a plain object from a DataStoreSettings message. Also converts values to other types if specified. - * @param message DataStoreSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DataStoreSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataStoreSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataStoreSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DataStoreSettings { - - /** Properties of an Engine. */ - interface IEngine { - - /** Engine name */ - name?: (string|null); - - /** Engine type */ - type?: (google.cloud.ces.v1.DataStoreSettings.Engine.Type|keyof typeof google.cloud.ces.v1.DataStoreSettings.Engine.Type|null); - } - - /** Represents an Engine. */ - class Engine implements IEngine { - - /** - * Constructs a new Engine. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.DataStoreSettings.IEngine); - - /** Engine name. */ - public name: string; - - /** Engine type. */ - public type: (google.cloud.ces.v1.DataStoreSettings.Engine.Type|keyof typeof google.cloud.ces.v1.DataStoreSettings.Engine.Type); - - /** - * Creates a new Engine instance using the specified properties. - * @param [properties] Properties to set - * @returns Engine instance - */ - public static create(properties?: google.cloud.ces.v1.DataStoreSettings.IEngine): google.cloud.ces.v1.DataStoreSettings.Engine; - - /** - * Encodes the specified Engine message. Does not implicitly {@link google.cloud.ces.v1.DataStoreSettings.Engine.verify|verify} messages. - * @param message Engine message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.DataStoreSettings.IEngine, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Engine message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreSettings.Engine.verify|verify} messages. - * @param message Engine message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.DataStoreSettings.IEngine, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Engine message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Engine - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreSettings.Engine; - - /** - * Decodes an Engine message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Engine - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreSettings.Engine; - - /** - * Verifies an Engine message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Engine message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Engine - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreSettings.Engine; - - /** - * Creates a plain object from an Engine message. Also converts values to other types if specified. - * @param message Engine - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DataStoreSettings.Engine, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Engine to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Engine - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Engine { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - ENGINE_TYPE_SEARCH = 1, - ENGINE_TYPE_CHAT = 2 - } - } - } - - /** Properties of a BigQueryExportSettings. */ - interface IBigQueryExportSettings { - - /** BigQueryExportSettings enabled */ - enabled?: (boolean|null); - - /** BigQueryExportSettings project */ - project?: (string|null); - - /** BigQueryExportSettings dataset */ - dataset?: (string|null); - } - - /** Represents a BigQueryExportSettings. */ - class BigQueryExportSettings implements IBigQueryExportSettings { - - /** - * Constructs a new BigQueryExportSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IBigQueryExportSettings); - - /** BigQueryExportSettings enabled. */ - public enabled: boolean; - - /** BigQueryExportSettings project. */ - public project: string; - - /** BigQueryExportSettings dataset. */ - public dataset: string; - - /** - * Creates a new BigQueryExportSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns BigQueryExportSettings instance - */ - public static create(properties?: google.cloud.ces.v1.IBigQueryExportSettings): google.cloud.ces.v1.BigQueryExportSettings; - - /** - * Encodes the specified BigQueryExportSettings message. Does not implicitly {@link google.cloud.ces.v1.BigQueryExportSettings.verify|verify} messages. - * @param message BigQueryExportSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IBigQueryExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BigQueryExportSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BigQueryExportSettings.verify|verify} messages. - * @param message BigQueryExportSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IBigQueryExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BigQueryExportSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BigQueryExportSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.BigQueryExportSettings; - - /** - * Decodes a BigQueryExportSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BigQueryExportSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.BigQueryExportSettings; - - /** - * Verifies a BigQueryExportSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BigQueryExportSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BigQueryExportSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.BigQueryExportSettings; - - /** - * Creates a plain object from a BigQueryExportSettings message. Also converts values to other types if specified. - * @param message BigQueryExportSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.BigQueryExportSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BigQueryExportSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BigQueryExportSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Schema. */ - interface ISchema { - - /** Schema type */ - type?: (google.cloud.ces.v1.Schema.Type|keyof typeof google.cloud.ces.v1.Schema.Type|null); - - /** Schema properties */ - properties?: ({ [k: string]: google.cloud.ces.v1.ISchema }|null); - - /** Schema required */ - required?: (string[]|null); - - /** Schema description */ - description?: (string|null); - - /** Schema items */ - items?: (google.cloud.ces.v1.ISchema|null); - - /** Schema nullable */ - nullable?: (boolean|null); - - /** Schema uniqueItems */ - uniqueItems?: (boolean|null); - - /** Schema prefixItems */ - prefixItems?: (google.cloud.ces.v1.ISchema[]|null); - - /** Schema additionalProperties */ - additionalProperties?: (google.cloud.ces.v1.ISchema|null); - - /** Schema anyOf */ - anyOf?: (google.cloud.ces.v1.ISchema[]|null); - - /** Schema enum */ - "enum"?: (string[]|null); - - /** Schema default */ - "default"?: (google.protobuf.IValue|null); - - /** Schema ref */ - ref?: (string|null); - - /** Schema defs */ - defs?: ({ [k: string]: google.cloud.ces.v1.ISchema }|null); - - /** Schema title */ - title?: (string|null); - - /** Schema minItems */ - minItems?: (number|Long|string|null); - - /** Schema maxItems */ - maxItems?: (number|Long|string|null); - - /** Schema minimum */ - minimum?: (number|null); - - /** Schema maximum */ - maximum?: (number|null); - } - - /** Represents a Schema. */ - class Schema implements ISchema { - - /** - * Constructs a new Schema. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ISchema); - - /** Schema type. */ - public type: (google.cloud.ces.v1.Schema.Type|keyof typeof google.cloud.ces.v1.Schema.Type); - - /** Schema properties. */ - public properties: { [k: string]: google.cloud.ces.v1.ISchema }; - - /** Schema required. */ - public required: string[]; - - /** Schema description. */ - public description: string; - - /** Schema items. */ - public items?: (google.cloud.ces.v1.ISchema|null); - - /** Schema nullable. */ - public nullable: boolean; - - /** Schema uniqueItems. */ - public uniqueItems: boolean; - - /** Schema prefixItems. */ - public prefixItems: google.cloud.ces.v1.ISchema[]; - - /** Schema additionalProperties. */ - public additionalProperties?: (google.cloud.ces.v1.ISchema|null); - - /** Schema anyOf. */ - public anyOf: google.cloud.ces.v1.ISchema[]; - - /** Schema enum. */ - public enum: string[]; - - /** Schema default. */ - public default?: (google.protobuf.IValue|null); - - /** Schema ref. */ - public ref: string; - - /** Schema defs. */ - public defs: { [k: string]: google.cloud.ces.v1.ISchema }; - - /** Schema title. */ - public title: string; - - /** Schema minItems. */ - public minItems: (number|Long|string); - - /** Schema maxItems. */ - public maxItems: (number|Long|string); - - /** Schema minimum. */ - public minimum?: (number|null); - - /** Schema maximum. */ - public maximum?: (number|null); - - /** - * Creates a new Schema instance using the specified properties. - * @param [properties] Properties to set - * @returns Schema instance - */ - public static create(properties?: google.cloud.ces.v1.ISchema): google.cloud.ces.v1.Schema; - - /** - * Encodes the specified Schema message. Does not implicitly {@link google.cloud.ces.v1.Schema.verify|verify} messages. - * @param message Schema message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Schema.verify|verify} messages. - * @param message Schema message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Schema message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Schema - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Schema; - - /** - * Decodes a Schema message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Schema - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Schema; - - /** - * Verifies a Schema message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Schema message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Schema - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Schema; - - /** - * Creates a plain object from a Schema message. Also converts values to other types if specified. - * @param message Schema - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Schema, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Schema to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Schema - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Schema { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - STRING = 1, - INTEGER = 2, - NUMBER = 3, - BOOLEAN = 4, - OBJECT = 5, - ARRAY = 6 - } - } - - /** Properties of an AppSnapshot. */ - interface IAppSnapshot { - - /** AppSnapshot app */ - app?: (google.cloud.ces.v1.IApp|null); - - /** AppSnapshot agents */ - agents?: (google.cloud.ces.v1.IAgent[]|null); - - /** AppSnapshot tools */ - tools?: (google.cloud.ces.v1.ITool[]|null); - - /** AppSnapshot examples */ - examples?: (google.cloud.ces.v1.IExample[]|null); - - /** AppSnapshot guardrails */ - guardrails?: (google.cloud.ces.v1.IGuardrail[]|null); - - /** AppSnapshot toolsets */ - toolsets?: (google.cloud.ces.v1.IToolset[]|null); - } - - /** Represents an AppSnapshot. */ - class AppSnapshot implements IAppSnapshot { - - /** - * Constructs a new AppSnapshot. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IAppSnapshot); - - /** AppSnapshot app. */ - public app?: (google.cloud.ces.v1.IApp|null); - - /** AppSnapshot agents. */ - public agents: google.cloud.ces.v1.IAgent[]; - - /** AppSnapshot tools. */ - public tools: google.cloud.ces.v1.ITool[]; - - /** AppSnapshot examples. */ - public examples: google.cloud.ces.v1.IExample[]; - - /** AppSnapshot guardrails. */ - public guardrails: google.cloud.ces.v1.IGuardrail[]; - - /** AppSnapshot toolsets. */ - public toolsets: google.cloud.ces.v1.IToolset[]; - - /** - * Creates a new AppSnapshot instance using the specified properties. - * @param [properties] Properties to set - * @returns AppSnapshot instance - */ - public static create(properties?: google.cloud.ces.v1.IAppSnapshot): google.cloud.ces.v1.AppSnapshot; - - /** - * Encodes the specified AppSnapshot message. Does not implicitly {@link google.cloud.ces.v1.AppSnapshot.verify|verify} messages. - * @param message AppSnapshot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IAppSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AppSnapshot message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AppSnapshot.verify|verify} messages. - * @param message AppSnapshot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IAppSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AppSnapshot message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AppSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.AppSnapshot; - - /** - * Decodes an AppSnapshot message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AppSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.AppSnapshot; - - /** - * Verifies an AppSnapshot message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AppSnapshot message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AppSnapshot - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.AppSnapshot; - - /** - * Creates a plain object from an AppSnapshot message. Also converts values to other types if specified. - * @param message AppSnapshot - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.AppSnapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AppSnapshot to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AppSnapshot - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AppVersion. */ - interface IAppVersion { - - /** AppVersion name */ - name?: (string|null); - - /** AppVersion displayName */ - displayName?: (string|null); - - /** AppVersion description */ - description?: (string|null); - - /** AppVersion creator */ - creator?: (string|null); - - /** AppVersion createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** AppVersion snapshot */ - snapshot?: (google.cloud.ces.v1.IAppSnapshot|null); - - /** AppVersion etag */ - etag?: (string|null); - } - - /** Represents an AppVersion. */ - class AppVersion implements IAppVersion { - - /** - * Constructs a new AppVersion. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IAppVersion); - - /** AppVersion name. */ - public name: string; - - /** AppVersion displayName. */ - public displayName: string; - - /** AppVersion description. */ - public description: string; - - /** AppVersion creator. */ - public creator: string; - - /** AppVersion createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** AppVersion snapshot. */ - public snapshot?: (google.cloud.ces.v1.IAppSnapshot|null); - - /** AppVersion etag. */ - public etag: string; - - /** - * Creates a new AppVersion instance using the specified properties. - * @param [properties] Properties to set - * @returns AppVersion instance - */ - public static create(properties?: google.cloud.ces.v1.IAppVersion): google.cloud.ces.v1.AppVersion; - - /** - * Encodes the specified AppVersion message. Does not implicitly {@link google.cloud.ces.v1.AppVersion.verify|verify} messages. - * @param message AppVersion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AppVersion message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AppVersion.verify|verify} messages. - * @param message AppVersion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AppVersion message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AppVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.AppVersion; - - /** - * Decodes an AppVersion message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AppVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.AppVersion; - - /** - * Verifies an AppVersion message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AppVersion message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AppVersion - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.AppVersion; - - /** - * Creates a plain object from an AppVersion message. Also converts values to other types if specified. - * @param message AppVersion - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.AppVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AppVersion to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AppVersion - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Example. */ - interface IExample { - - /** Example name */ - name?: (string|null); - - /** Example displayName */ - displayName?: (string|null); - - /** Example description */ - description?: (string|null); - - /** Example entryAgent */ - entryAgent?: (string|null); - - /** Example messages */ - messages?: (google.cloud.ces.v1.IMessage[]|null); - - /** Example createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Example updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Example invalid */ - invalid?: (boolean|null); - - /** Example etag */ - etag?: (string|null); - } - - /** Represents an Example. */ - class Example implements IExample { - - /** - * Constructs a new Example. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IExample); - - /** Example name. */ - public name: string; - - /** Example displayName. */ - public displayName: string; - - /** Example description. */ - public description: string; - - /** Example entryAgent. */ - public entryAgent: string; - - /** Example messages. */ - public messages: google.cloud.ces.v1.IMessage[]; - - /** Example createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Example updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Example invalid. */ - public invalid: boolean; - - /** Example etag. */ - public etag: string; - - /** - * Creates a new Example instance using the specified properties. - * @param [properties] Properties to set - * @returns Example instance - */ - public static create(properties?: google.cloud.ces.v1.IExample): google.cloud.ces.v1.Example; - - /** - * Encodes the specified Example message. Does not implicitly {@link google.cloud.ces.v1.Example.verify|verify} messages. - * @param message Example message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IExample, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Example message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Example.verify|verify} messages. - * @param message Example message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IExample, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Example message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Example - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Example; - - /** - * Decodes an Example message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Example - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Example; - - /** - * Verifies an Example message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Example message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Example - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Example; - - /** - * Creates a plain object from an Example message. Also converts values to other types if specified. - * @param message Example - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Example, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Example to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Example - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Message. */ - interface IMessage { - - /** Message role */ - role?: (string|null); - - /** Message chunks */ - chunks?: (google.cloud.ces.v1.IChunk[]|null); - - /** Message eventTime */ - eventTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a Message. */ - class Message implements IMessage { - - /** - * Constructs a new Message. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IMessage); - - /** Message role. */ - public role: string; - - /** Message chunks. */ - public chunks: google.cloud.ces.v1.IChunk[]; - - /** Message eventTime. */ - public eventTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new Message instance using the specified properties. - * @param [properties] Properties to set - * @returns Message instance - */ - public static create(properties?: google.cloud.ces.v1.IMessage): google.cloud.ces.v1.Message; - - /** - * Encodes the specified Message message. Does not implicitly {@link google.cloud.ces.v1.Message.verify|verify} messages. - * @param message Message message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Message.verify|verify} messages. - * @param message Message message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Message message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Message; - - /** - * Decodes a Message message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Message; - - /** - * Verifies a Message message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Message - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Message; - - /** - * Creates a plain object from a Message message. Also converts values to other types if specified. - * @param message Message - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Message to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Message - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Chunk. */ - interface IChunk { - - /** Chunk text */ - text?: (string|null); - - /** Chunk transcript */ - transcript?: (string|null); - - /** Chunk payload */ - payload?: (google.protobuf.IStruct|null); - - /** Chunk image */ - image?: (google.cloud.ces.v1.IImage|null); - - /** Chunk toolCall */ - toolCall?: (google.cloud.ces.v1.IToolCall|null); - - /** Chunk toolResponse */ - toolResponse?: (google.cloud.ces.v1.IToolResponse|null); - - /** Chunk agentTransfer */ - agentTransfer?: (google.cloud.ces.v1.IAgentTransfer|null); - - /** Chunk updatedVariables */ - updatedVariables?: (google.protobuf.IStruct|null); - - /** Chunk defaultVariables */ - defaultVariables?: (google.protobuf.IStruct|null); - } - - /** Represents a Chunk. */ - class Chunk implements IChunk { - - /** - * Constructs a new Chunk. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IChunk); - - /** Chunk text. */ - public text?: (string|null); - - /** Chunk transcript. */ - public transcript?: (string|null); - - /** Chunk payload. */ - public payload?: (google.protobuf.IStruct|null); - - /** Chunk image. */ - public image?: (google.cloud.ces.v1.IImage|null); - - /** Chunk toolCall. */ - public toolCall?: (google.cloud.ces.v1.IToolCall|null); - - /** Chunk toolResponse. */ - public toolResponse?: (google.cloud.ces.v1.IToolResponse|null); - - /** Chunk agentTransfer. */ - public agentTransfer?: (google.cloud.ces.v1.IAgentTransfer|null); - - /** Chunk updatedVariables. */ - public updatedVariables?: (google.protobuf.IStruct|null); - - /** Chunk defaultVariables. */ - public defaultVariables?: (google.protobuf.IStruct|null); - - /** Chunk data. */ - public data?: ("text"|"transcript"|"payload"|"image"|"toolCall"|"toolResponse"|"agentTransfer"|"updatedVariables"|"defaultVariables"); - - /** - * Creates a new Chunk instance using the specified properties. - * @param [properties] Properties to set - * @returns Chunk instance - */ - public static create(properties?: google.cloud.ces.v1.IChunk): google.cloud.ces.v1.Chunk; - - /** - * Encodes the specified Chunk message. Does not implicitly {@link google.cloud.ces.v1.Chunk.verify|verify} messages. - * @param message Chunk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Chunk.verify|verify} messages. - * @param message Chunk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Chunk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Chunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Chunk; - - /** - * Decodes a Chunk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Chunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Chunk; - - /** - * Verifies a Chunk message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Chunk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Chunk - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Chunk; - - /** - * Creates a plain object from a Chunk message. Also converts values to other types if specified. - * @param message Chunk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Chunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Chunk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Chunk - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Blob. */ - interface IBlob { - - /** Blob mimeType */ - mimeType?: (string|null); - - /** Blob data */ - data?: (Uint8Array|Buffer|string|null); - } - - /** Represents a Blob. */ - class Blob implements IBlob { - - /** - * Constructs a new Blob. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IBlob); - - /** Blob mimeType. */ - public mimeType: string; - - /** Blob data. */ - public data: (Uint8Array|Buffer|string); - - /** - * Creates a new Blob instance using the specified properties. - * @param [properties] Properties to set - * @returns Blob instance - */ - public static create(properties?: google.cloud.ces.v1.IBlob): google.cloud.ces.v1.Blob; - - /** - * Encodes the specified Blob message. Does not implicitly {@link google.cloud.ces.v1.Blob.verify|verify} messages. - * @param message Blob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IBlob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Blob.verify|verify} messages. - * @param message Blob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IBlob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Blob message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Blob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Blob; - - /** - * Decodes a Blob message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Blob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Blob; - - /** - * Verifies a Blob message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Blob message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Blob - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Blob; - - /** - * Creates a plain object from a Blob message. Also converts values to other types if specified. - * @param message Blob - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Blob, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Blob to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Blob - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Image. */ - interface IImage { - - /** Image mimeType */ - mimeType?: (string|null); - - /** Image data */ - data?: (Uint8Array|Buffer|string|null); - } - - /** Represents an Image. */ - class Image implements IImage { - - /** - * Constructs a new Image. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IImage); - - /** Image mimeType. */ - public mimeType: string; - - /** Image data. */ - public data: (Uint8Array|Buffer|string); - - /** - * Creates a new Image instance using the specified properties. - * @param [properties] Properties to set - * @returns Image instance - */ - public static create(properties?: google.cloud.ces.v1.IImage): google.cloud.ces.v1.Image; - - /** - * Encodes the specified Image message. Does not implicitly {@link google.cloud.ces.v1.Image.verify|verify} messages. - * @param message Image message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Image.verify|verify} messages. - * @param message Image message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Image message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Image; - - /** - * Decodes an Image message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Image; - - /** - * Verifies an Image message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Image message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Image - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Image; - - /** - * Creates a plain object from an Image message. Also converts values to other types if specified. - * @param message Image - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Image to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Image - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ToolCall. */ - interface IToolCall { - - /** ToolCall tool */ - tool?: (string|null); - - /** ToolCall toolsetTool */ - toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); - - /** ToolCall id */ - id?: (string|null); - - /** ToolCall displayName */ - displayName?: (string|null); - - /** ToolCall args */ - args?: (google.protobuf.IStruct|null); - } - - /** Represents a ToolCall. */ - class ToolCall implements IToolCall { - - /** - * Constructs a new ToolCall. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IToolCall); - - /** ToolCall tool. */ - public tool?: (string|null); - - /** ToolCall toolsetTool. */ - public toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); - - /** ToolCall id. */ - public id: string; - - /** ToolCall displayName. */ - public displayName: string; - - /** ToolCall args. */ - public args?: (google.protobuf.IStruct|null); - - /** ToolCall toolIdentifier. */ - public toolIdentifier?: ("tool"|"toolsetTool"); - - /** - * Creates a new ToolCall instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolCall instance - */ - public static create(properties?: google.cloud.ces.v1.IToolCall): google.cloud.ces.v1.ToolCall; - - /** - * Encodes the specified ToolCall message. Does not implicitly {@link google.cloud.ces.v1.ToolCall.verify|verify} messages. - * @param message ToolCall message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IToolCall, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolCall message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolCall.verify|verify} messages. - * @param message ToolCall message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IToolCall, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolCall message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolCall - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ToolCall; - - /** - * Decodes a ToolCall message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolCall - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ToolCall; - - /** - * Verifies a ToolCall message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolCall message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolCall - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ToolCall; - - /** - * Creates a plain object from a ToolCall message. Also converts values to other types if specified. - * @param message ToolCall - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ToolCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolCall to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolCall - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ToolResponse. */ - interface IToolResponse { - - /** ToolResponse tool */ - tool?: (string|null); - - /** ToolResponse toolsetTool */ - toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); - - /** ToolResponse id */ - id?: (string|null); - - /** ToolResponse displayName */ - displayName?: (string|null); - - /** ToolResponse response */ - response?: (google.protobuf.IStruct|null); - } - - /** Represents a ToolResponse. */ - class ToolResponse implements IToolResponse { - - /** - * Constructs a new ToolResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IToolResponse); - - /** ToolResponse tool. */ - public tool?: (string|null); - - /** ToolResponse toolsetTool. */ - public toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); - - /** ToolResponse id. */ - public id: string; - - /** ToolResponse displayName. */ - public displayName: string; - - /** ToolResponse response. */ - public response?: (google.protobuf.IStruct|null); - - /** ToolResponse toolIdentifier. */ - public toolIdentifier?: ("tool"|"toolsetTool"); - - /** - * Creates a new ToolResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IToolResponse): google.cloud.ces.v1.ToolResponse; - - /** - * Encodes the specified ToolResponse message. Does not implicitly {@link google.cloud.ces.v1.ToolResponse.verify|verify} messages. - * @param message ToolResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolResponse.verify|verify} messages. - * @param message ToolResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ToolResponse; - - /** - * Decodes a ToolResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ToolResponse; - - /** - * Verifies a ToolResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ToolResponse; - - /** - * Creates a plain object from a ToolResponse message. Also converts values to other types if specified. - * @param message ToolResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ToolResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AgentTransfer. */ - interface IAgentTransfer { - - /** AgentTransfer targetAgent */ - targetAgent?: (string|null); - - /** AgentTransfer displayName */ - displayName?: (string|null); - } - - /** Represents an AgentTransfer. */ - class AgentTransfer implements IAgentTransfer { - - /** - * Constructs a new AgentTransfer. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IAgentTransfer); - - /** AgentTransfer targetAgent. */ - public targetAgent: string; - - /** AgentTransfer displayName. */ - public displayName: string; - - /** - * Creates a new AgentTransfer instance using the specified properties. - * @param [properties] Properties to set - * @returns AgentTransfer instance - */ - public static create(properties?: google.cloud.ces.v1.IAgentTransfer): google.cloud.ces.v1.AgentTransfer; - - /** - * Encodes the specified AgentTransfer message. Does not implicitly {@link google.cloud.ces.v1.AgentTransfer.verify|verify} messages. - * @param message AgentTransfer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IAgentTransfer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AgentTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AgentTransfer.verify|verify} messages. - * @param message AgentTransfer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IAgentTransfer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AgentTransfer message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AgentTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.AgentTransfer; - - /** - * Decodes an AgentTransfer message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AgentTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.AgentTransfer; - - /** - * Verifies an AgentTransfer message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AgentTransfer message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AgentTransfer - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.AgentTransfer; - - /** - * Creates a plain object from an AgentTransfer message. Also converts values to other types if specified. - * @param message AgentTransfer - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.AgentTransfer, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AgentTransfer to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AgentTransfer - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ToolsetTool. */ - interface IToolsetTool { - - /** ToolsetTool toolset */ - toolset?: (string|null); - - /** ToolsetTool toolId */ - toolId?: (string|null); - } - - /** Represents a ToolsetTool. */ - class ToolsetTool implements IToolsetTool { - - /** - * Constructs a new ToolsetTool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IToolsetTool); - - /** ToolsetTool toolset. */ - public toolset: string; - - /** ToolsetTool toolId. */ - public toolId: string; - - /** - * Creates a new ToolsetTool instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolsetTool instance - */ - public static create(properties?: google.cloud.ces.v1.IToolsetTool): google.cloud.ces.v1.ToolsetTool; - - /** - * Encodes the specified ToolsetTool message. Does not implicitly {@link google.cloud.ces.v1.ToolsetTool.verify|verify} messages. - * @param message ToolsetTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IToolsetTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolsetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolsetTool.verify|verify} messages. - * @param message ToolsetTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IToolsetTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolsetTool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolsetTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ToolsetTool; - - /** - * Decodes a ToolsetTool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolsetTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ToolsetTool; - - /** - * Verifies a ToolsetTool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolsetTool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolsetTool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ToolsetTool; - - /** - * Creates a plain object from a ToolsetTool message. Also converts values to other types if specified. - * @param message ToolsetTool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ToolsetTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolsetTool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolsetTool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Guardrail. */ - interface IGuardrail { - - /** Guardrail contentFilter */ - contentFilter?: (google.cloud.ces.v1.Guardrail.IContentFilter|null); - - /** Guardrail llmPromptSecurity */ - llmPromptSecurity?: (google.cloud.ces.v1.Guardrail.ILlmPromptSecurity|null); - - /** Guardrail llmPolicy */ - llmPolicy?: (google.cloud.ces.v1.Guardrail.ILlmPolicy|null); - - /** Guardrail modelSafety */ - modelSafety?: (google.cloud.ces.v1.Guardrail.IModelSafety|null); - - /** Guardrail codeCallback */ - codeCallback?: (google.cloud.ces.v1.Guardrail.ICodeCallback|null); - - /** Guardrail name */ - name?: (string|null); - - /** Guardrail displayName */ - displayName?: (string|null); - - /** Guardrail description */ - description?: (string|null); - - /** Guardrail enabled */ - enabled?: (boolean|null); - - /** Guardrail action */ - action?: (google.cloud.ces.v1.ITriggerAction|null); - - /** Guardrail createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Guardrail updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Guardrail etag */ - etag?: (string|null); - } - - /** Represents a Guardrail. */ - class Guardrail implements IGuardrail { - - /** - * Constructs a new Guardrail. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IGuardrail); - - /** Guardrail contentFilter. */ - public contentFilter?: (google.cloud.ces.v1.Guardrail.IContentFilter|null); - - /** Guardrail llmPromptSecurity. */ - public llmPromptSecurity?: (google.cloud.ces.v1.Guardrail.ILlmPromptSecurity|null); - - /** Guardrail llmPolicy. */ - public llmPolicy?: (google.cloud.ces.v1.Guardrail.ILlmPolicy|null); - - /** Guardrail modelSafety. */ - public modelSafety?: (google.cloud.ces.v1.Guardrail.IModelSafety|null); - - /** Guardrail codeCallback. */ - public codeCallback?: (google.cloud.ces.v1.Guardrail.ICodeCallback|null); - - /** Guardrail name. */ - public name: string; - - /** Guardrail displayName. */ - public displayName: string; - - /** Guardrail description. */ - public description: string; - - /** Guardrail enabled. */ - public enabled: boolean; - - /** Guardrail action. */ - public action?: (google.cloud.ces.v1.ITriggerAction|null); - - /** Guardrail createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Guardrail updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Guardrail etag. */ - public etag: string; - - /** Guardrail guardrailType. */ - public guardrailType?: ("contentFilter"|"llmPromptSecurity"|"llmPolicy"|"modelSafety"|"codeCallback"); - - /** - * Creates a new Guardrail instance using the specified properties. - * @param [properties] Properties to set - * @returns Guardrail instance - */ - public static create(properties?: google.cloud.ces.v1.IGuardrail): google.cloud.ces.v1.Guardrail; - - /** - * Encodes the specified Guardrail message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.verify|verify} messages. - * @param message Guardrail message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IGuardrail, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Guardrail message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.verify|verify} messages. - * @param message Guardrail message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IGuardrail, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Guardrail message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Guardrail - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Guardrail; - - /** - * Decodes a Guardrail message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Guardrail - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Guardrail; - - /** - * Verifies a Guardrail message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Guardrail message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Guardrail - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Guardrail; - - /** - * Creates a plain object from a Guardrail message. Also converts values to other types if specified. - * @param message Guardrail - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Guardrail, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Guardrail to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Guardrail - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Guardrail { - - /** Properties of a ContentFilter. */ - interface IContentFilter { - - /** ContentFilter bannedContents */ - bannedContents?: (string[]|null); - - /** ContentFilter bannedContentsInUserInput */ - bannedContentsInUserInput?: (string[]|null); - - /** ContentFilter bannedContentsInAgentResponse */ - bannedContentsInAgentResponse?: (string[]|null); - - /** ContentFilter matchType */ - matchType?: (google.cloud.ces.v1.Guardrail.ContentFilter.MatchType|keyof typeof google.cloud.ces.v1.Guardrail.ContentFilter.MatchType|null); - - /** ContentFilter disregardDiacritics */ - disregardDiacritics?: (boolean|null); - } - - /** Represents a ContentFilter. */ - class ContentFilter implements IContentFilter { - - /** - * Constructs a new ContentFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.Guardrail.IContentFilter); - - /** ContentFilter bannedContents. */ - public bannedContents: string[]; - - /** ContentFilter bannedContentsInUserInput. */ - public bannedContentsInUserInput: string[]; - - /** ContentFilter bannedContentsInAgentResponse. */ - public bannedContentsInAgentResponse: string[]; - - /** ContentFilter matchType. */ - public matchType: (google.cloud.ces.v1.Guardrail.ContentFilter.MatchType|keyof typeof google.cloud.ces.v1.Guardrail.ContentFilter.MatchType); - - /** ContentFilter disregardDiacritics. */ - public disregardDiacritics: boolean; - - /** - * Creates a new ContentFilter instance using the specified properties. - * @param [properties] Properties to set - * @returns ContentFilter instance - */ - public static create(properties?: google.cloud.ces.v1.Guardrail.IContentFilter): google.cloud.ces.v1.Guardrail.ContentFilter; - - /** - * Encodes the specified ContentFilter message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ContentFilter.verify|verify} messages. - * @param message ContentFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.Guardrail.IContentFilter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ContentFilter.verify|verify} messages. - * @param message ContentFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.Guardrail.IContentFilter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ContentFilter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContentFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Guardrail.ContentFilter; - - /** - * Decodes a ContentFilter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContentFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Guardrail.ContentFilter; - - /** - * Verifies a ContentFilter message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContentFilter - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Guardrail.ContentFilter; - - /** - * Creates a plain object from a ContentFilter message. Also converts values to other types if specified. - * @param message ContentFilter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Guardrail.ContentFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ContentFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ContentFilter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ContentFilter { - - /** MatchType enum. */ - enum MatchType { - MATCH_TYPE_UNSPECIFIED = 0, - SIMPLE_STRING_MATCH = 1, - WORD_BOUNDARY_STRING_MATCH = 2, - REGEXP_MATCH = 3 - } - } - - /** Properties of a LlmPromptSecurity. */ - interface ILlmPromptSecurity { - - /** LlmPromptSecurity defaultSettings */ - defaultSettings?: (google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null); - - /** LlmPromptSecurity customPolicy */ - customPolicy?: (google.cloud.ces.v1.Guardrail.ILlmPolicy|null); - - /** LlmPromptSecurity failOpen */ - failOpen?: (boolean|null); - } - - /** Represents a LlmPromptSecurity. */ - class LlmPromptSecurity implements ILlmPromptSecurity { - - /** - * Constructs a new LlmPromptSecurity. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.Guardrail.ILlmPromptSecurity); - - /** LlmPromptSecurity defaultSettings. */ - public defaultSettings?: (google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null); - - /** LlmPromptSecurity customPolicy. */ - public customPolicy?: (google.cloud.ces.v1.Guardrail.ILlmPolicy|null); - - /** LlmPromptSecurity failOpen. */ - public failOpen: boolean; - - /** LlmPromptSecurity securityConfig. */ - public securityConfig?: ("defaultSettings"|"customPolicy"); - - /** - * Creates a new LlmPromptSecurity instance using the specified properties. - * @param [properties] Properties to set - * @returns LlmPromptSecurity instance - */ - public static create(properties?: google.cloud.ces.v1.Guardrail.ILlmPromptSecurity): google.cloud.ces.v1.Guardrail.LlmPromptSecurity; - - /** - * Encodes the specified LlmPromptSecurity message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPromptSecurity.verify|verify} messages. - * @param message LlmPromptSecurity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.Guardrail.ILlmPromptSecurity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LlmPromptSecurity message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPromptSecurity.verify|verify} messages. - * @param message LlmPromptSecurity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.Guardrail.ILlmPromptSecurity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LlmPromptSecurity message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LlmPromptSecurity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Guardrail.LlmPromptSecurity; - - /** - * Decodes a LlmPromptSecurity message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LlmPromptSecurity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Guardrail.LlmPromptSecurity; - - /** - * Verifies a LlmPromptSecurity message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LlmPromptSecurity message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LlmPromptSecurity - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Guardrail.LlmPromptSecurity; - - /** - * Creates a plain object from a LlmPromptSecurity message. Also converts values to other types if specified. - * @param message LlmPromptSecurity - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Guardrail.LlmPromptSecurity, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LlmPromptSecurity to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LlmPromptSecurity - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace LlmPromptSecurity { - - /** Properties of a DefaultSecuritySettings. */ - interface IDefaultSecuritySettings { - - /** DefaultSecuritySettings defaultPromptTemplate */ - defaultPromptTemplate?: (string|null); - } - - /** Represents a DefaultSecuritySettings. */ - class DefaultSecuritySettings implements IDefaultSecuritySettings { - - /** - * Constructs a new DefaultSecuritySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings); - - /** DefaultSecuritySettings defaultPromptTemplate. */ - public defaultPromptTemplate: string; - - /** - * Creates a new DefaultSecuritySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DefaultSecuritySettings instance - */ - public static create(properties?: google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings): google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; - - /** - * Encodes the specified DefaultSecuritySettings message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. - * @param message DefaultSecuritySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DefaultSecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. - * @param message DefaultSecuritySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DefaultSecuritySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DefaultSecuritySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; - - /** - * Decodes a DefaultSecuritySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DefaultSecuritySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; - - /** - * Verifies a DefaultSecuritySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DefaultSecuritySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DefaultSecuritySettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; - - /** - * Creates a plain object from a DefaultSecuritySettings message. Also converts values to other types if specified. - * @param message DefaultSecuritySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DefaultSecuritySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DefaultSecuritySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a LlmPolicy. */ - interface ILlmPolicy { - - /** LlmPolicy maxConversationMessages */ - maxConversationMessages?: (number|null); - - /** LlmPolicy modelSettings */ - modelSettings?: (google.cloud.ces.v1.IModelSettings|null); - - /** LlmPolicy prompt */ - prompt?: (string|null); - - /** LlmPolicy policyScope */ - policyScope?: (google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope|keyof typeof google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope|null); - - /** LlmPolicy failOpen */ - failOpen?: (boolean|null); - - /** LlmPolicy allowShortUtterance */ - allowShortUtterance?: (boolean|null); - } - - /** Represents a LlmPolicy. */ - class LlmPolicy implements ILlmPolicy { - - /** - * Constructs a new LlmPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.Guardrail.ILlmPolicy); - - /** LlmPolicy maxConversationMessages. */ - public maxConversationMessages: number; - - /** LlmPolicy modelSettings. */ - public modelSettings?: (google.cloud.ces.v1.IModelSettings|null); - - /** LlmPolicy prompt. */ - public prompt: string; - - /** LlmPolicy policyScope. */ - public policyScope: (google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope|keyof typeof google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope); - - /** LlmPolicy failOpen. */ - public failOpen: boolean; - - /** LlmPolicy allowShortUtterance. */ - public allowShortUtterance: boolean; - - /** - * Creates a new LlmPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns LlmPolicy instance - */ - public static create(properties?: google.cloud.ces.v1.Guardrail.ILlmPolicy): google.cloud.ces.v1.Guardrail.LlmPolicy; - - /** - * Encodes the specified LlmPolicy message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPolicy.verify|verify} messages. - * @param message LlmPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.Guardrail.ILlmPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LlmPolicy message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPolicy.verify|verify} messages. - * @param message LlmPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.Guardrail.ILlmPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LlmPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LlmPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Guardrail.LlmPolicy; - - /** - * Decodes a LlmPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LlmPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Guardrail.LlmPolicy; - - /** - * Verifies a LlmPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LlmPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LlmPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Guardrail.LlmPolicy; - - /** - * Creates a plain object from a LlmPolicy message. Also converts values to other types if specified. - * @param message LlmPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Guardrail.LlmPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LlmPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LlmPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace LlmPolicy { - - /** PolicyScope enum. */ - enum PolicyScope { - POLICY_SCOPE_UNSPECIFIED = 0, - USER_QUERY = 1, - AGENT_RESPONSE = 2, - USER_QUERY_AND_AGENT_RESPONSE = 3 - } - } - - /** Properties of a ModelSafety. */ - interface IModelSafety { - - /** ModelSafety safetySettings */ - safetySettings?: (google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting[]|null); - } - - /** Represents a ModelSafety. */ - class ModelSafety implements IModelSafety { - - /** - * Constructs a new ModelSafety. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.Guardrail.IModelSafety); - - /** ModelSafety safetySettings. */ - public safetySettings: google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting[]; - - /** - * Creates a new ModelSafety instance using the specified properties. - * @param [properties] Properties to set - * @returns ModelSafety instance - */ - public static create(properties?: google.cloud.ces.v1.Guardrail.IModelSafety): google.cloud.ces.v1.Guardrail.ModelSafety; - - /** - * Encodes the specified ModelSafety message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ModelSafety.verify|verify} messages. - * @param message ModelSafety message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.Guardrail.IModelSafety, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ModelSafety message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ModelSafety.verify|verify} messages. - * @param message ModelSafety message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.Guardrail.IModelSafety, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ModelSafety message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ModelSafety - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Guardrail.ModelSafety; - - /** - * Decodes a ModelSafety message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ModelSafety - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Guardrail.ModelSafety; - - /** - * Verifies a ModelSafety message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ModelSafety message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ModelSafety - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Guardrail.ModelSafety; - - /** - * Creates a plain object from a ModelSafety message. Also converts values to other types if specified. - * @param message ModelSafety - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Guardrail.ModelSafety, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ModelSafety to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ModelSafety - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ModelSafety { - - /** Properties of a SafetySetting. */ - interface ISafetySetting { - - /** SafetySetting category */ - category?: (google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory|keyof typeof google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory|null); - - /** SafetySetting threshold */ - threshold?: (google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold|keyof typeof google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold|null); - } - - /** Represents a SafetySetting. */ - class SafetySetting implements ISafetySetting { - - /** - * Constructs a new SafetySetting. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting); - - /** SafetySetting category. */ - public category: (google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory|keyof typeof google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory); - - /** SafetySetting threshold. */ - public threshold: (google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold|keyof typeof google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold); - - /** - * Creates a new SafetySetting instance using the specified properties. - * @param [properties] Properties to set - * @returns SafetySetting instance - */ - public static create(properties?: google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting): google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting; - - /** - * Encodes the specified SafetySetting message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. - * @param message SafetySetting message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. - * @param message SafetySetting message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SafetySetting message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SafetySetting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting; - - /** - * Decodes a SafetySetting message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SafetySetting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting; - - /** - * Verifies a SafetySetting message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SafetySetting - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting; - - /** - * Creates a plain object from a SafetySetting message. Also converts values to other types if specified. - * @param message SafetySetting - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SafetySetting to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SafetySetting - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** HarmCategory enum. */ - enum HarmCategory { - HARM_CATEGORY_UNSPECIFIED = 0, - HARM_CATEGORY_HATE_SPEECH = 1, - HARM_CATEGORY_DANGEROUS_CONTENT = 2, - HARM_CATEGORY_HARASSMENT = 3, - HARM_CATEGORY_SEXUALLY_EXPLICIT = 4 - } - - /** HarmBlockThreshold enum. */ - enum HarmBlockThreshold { - HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0, - BLOCK_LOW_AND_ABOVE = 1, - BLOCK_MEDIUM_AND_ABOVE = 2, - BLOCK_ONLY_HIGH = 3, - BLOCK_NONE = 4, - OFF = 5 - } - } - - /** Properties of a CodeCallback. */ - interface ICodeCallback { - - /** CodeCallback beforeAgentCallback */ - beforeAgentCallback?: (google.cloud.ces.v1.ICallback|null); - - /** CodeCallback afterAgentCallback */ - afterAgentCallback?: (google.cloud.ces.v1.ICallback|null); - - /** CodeCallback beforeModelCallback */ - beforeModelCallback?: (google.cloud.ces.v1.ICallback|null); - - /** CodeCallback afterModelCallback */ - afterModelCallback?: (google.cloud.ces.v1.ICallback|null); - } - - /** Represents a CodeCallback. */ - class CodeCallback implements ICodeCallback { - - /** - * Constructs a new CodeCallback. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.Guardrail.ICodeCallback); - - /** CodeCallback beforeAgentCallback. */ - public beforeAgentCallback?: (google.cloud.ces.v1.ICallback|null); - - /** CodeCallback afterAgentCallback. */ - public afterAgentCallback?: (google.cloud.ces.v1.ICallback|null); - - /** CodeCallback beforeModelCallback. */ - public beforeModelCallback?: (google.cloud.ces.v1.ICallback|null); - - /** CodeCallback afterModelCallback. */ - public afterModelCallback?: (google.cloud.ces.v1.ICallback|null); - - /** - * Creates a new CodeCallback instance using the specified properties. - * @param [properties] Properties to set - * @returns CodeCallback instance - */ - public static create(properties?: google.cloud.ces.v1.Guardrail.ICodeCallback): google.cloud.ces.v1.Guardrail.CodeCallback; - - /** - * Encodes the specified CodeCallback message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.CodeCallback.verify|verify} messages. - * @param message CodeCallback message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.Guardrail.ICodeCallback, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CodeCallback message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.CodeCallback.verify|verify} messages. - * @param message CodeCallback message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.Guardrail.ICodeCallback, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CodeCallback message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CodeCallback - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Guardrail.CodeCallback; - - /** - * Decodes a CodeCallback message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CodeCallback - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Guardrail.CodeCallback; - - /** - * Verifies a CodeCallback message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CodeCallback message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CodeCallback - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Guardrail.CodeCallback; - - /** - * Creates a plain object from a CodeCallback message. Also converts values to other types if specified. - * @param message CodeCallback - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Guardrail.CodeCallback, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CodeCallback to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CodeCallback - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Tool. */ - interface ITool { - - /** Tool clientFunction */ - clientFunction?: (google.cloud.ces.v1.IClientFunction|null); - - /** Tool openApiTool */ - openApiTool?: (google.cloud.ces.v1.IOpenApiTool|null); - - /** Tool googleSearchTool */ - googleSearchTool?: (google.cloud.ces.v1.IGoogleSearchTool|null); - - /** Tool connectorTool */ - connectorTool?: (google.cloud.ces.v1.IConnectorTool|null); - - /** Tool dataStoreTool */ - dataStoreTool?: (google.cloud.ces.v1.IDataStoreTool|null); - - /** Tool pythonFunction */ - pythonFunction?: (google.cloud.ces.v1.IPythonFunction|null); - - /** Tool mcpTool */ - mcpTool?: (google.cloud.ces.v1.IMcpTool|null); - - /** Tool fileSearchTool */ - fileSearchTool?: (google.cloud.ces.v1.IFileSearchTool|null); - - /** Tool systemTool */ - systemTool?: (google.cloud.ces.v1.ISystemTool|null); - - /** Tool widgetTool */ - widgetTool?: (google.cloud.ces.v1.IWidgetTool|null); - - /** Tool name */ - name?: (string|null); - - /** Tool displayName */ - displayName?: (string|null); - - /** Tool executionType */ - executionType?: (google.cloud.ces.v1.ExecutionType|keyof typeof google.cloud.ces.v1.ExecutionType|null); - - /** Tool createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Tool updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Tool etag */ - etag?: (string|null); - - /** Tool generatedSummary */ - generatedSummary?: (string|null); - - /** Tool toolFakeConfig */ - toolFakeConfig?: (google.cloud.ces.v1.IToolFakeConfig|null); - } - - /** Represents a Tool. */ - class Tool implements ITool { - - /** - * Constructs a new Tool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ITool); - - /** Tool clientFunction. */ - public clientFunction?: (google.cloud.ces.v1.IClientFunction|null); - - /** Tool openApiTool. */ - public openApiTool?: (google.cloud.ces.v1.IOpenApiTool|null); - - /** Tool googleSearchTool. */ - public googleSearchTool?: (google.cloud.ces.v1.IGoogleSearchTool|null); - - /** Tool connectorTool. */ - public connectorTool?: (google.cloud.ces.v1.IConnectorTool|null); - - /** Tool dataStoreTool. */ - public dataStoreTool?: (google.cloud.ces.v1.IDataStoreTool|null); - - /** Tool pythonFunction. */ - public pythonFunction?: (google.cloud.ces.v1.IPythonFunction|null); - - /** Tool mcpTool. */ - public mcpTool?: (google.cloud.ces.v1.IMcpTool|null); - - /** Tool fileSearchTool. */ - public fileSearchTool?: (google.cloud.ces.v1.IFileSearchTool|null); - - /** Tool systemTool. */ - public systemTool?: (google.cloud.ces.v1.ISystemTool|null); - - /** Tool widgetTool. */ - public widgetTool?: (google.cloud.ces.v1.IWidgetTool|null); - - /** Tool name. */ - public name: string; - - /** Tool displayName. */ - public displayName: string; - - /** Tool executionType. */ - public executionType: (google.cloud.ces.v1.ExecutionType|keyof typeof google.cloud.ces.v1.ExecutionType); - - /** Tool createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Tool updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Tool etag. */ - public etag: string; - - /** Tool generatedSummary. */ - public generatedSummary: string; - - /** Tool toolFakeConfig. */ - public toolFakeConfig?: (google.cloud.ces.v1.IToolFakeConfig|null); - - /** Tool toolType. */ - public toolType?: ("clientFunction"|"openApiTool"|"googleSearchTool"|"connectorTool"|"dataStoreTool"|"pythonFunction"|"mcpTool"|"fileSearchTool"|"systemTool"|"widgetTool"); - - /** - * Creates a new Tool instance using the specified properties. - * @param [properties] Properties to set - * @returns Tool instance - */ - public static create(properties?: google.cloud.ces.v1.ITool): google.cloud.ces.v1.Tool; - - /** - * Encodes the specified Tool message. Does not implicitly {@link google.cloud.ces.v1.Tool.verify|verify} messages. - * @param message Tool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ITool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Tool.verify|verify} messages. - * @param message Tool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ITool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Tool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Tool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Tool; - - /** - * Decodes a Tool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Tool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Tool; - - /** - * Verifies a Tool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Tool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Tool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Tool; - - /** - * Creates a plain object from a Tool message. Also converts values to other types if specified. - * @param message Tool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Tool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Tool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Tool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientFunction. */ - interface IClientFunction { - - /** ClientFunction name */ - name?: (string|null); - - /** ClientFunction description */ - description?: (string|null); - - /** ClientFunction parameters */ - parameters?: (google.cloud.ces.v1.ISchema|null); - - /** ClientFunction response */ - response?: (google.cloud.ces.v1.ISchema|null); - } - - /** Represents a ClientFunction. */ - class ClientFunction implements IClientFunction { - - /** - * Constructs a new ClientFunction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IClientFunction); - - /** ClientFunction name. */ - public name: string; - - /** ClientFunction description. */ - public description: string; - - /** ClientFunction parameters. */ - public parameters?: (google.cloud.ces.v1.ISchema|null); - - /** ClientFunction response. */ - public response?: (google.cloud.ces.v1.ISchema|null); - - /** - * Creates a new ClientFunction instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientFunction instance - */ - public static create(properties?: google.cloud.ces.v1.IClientFunction): google.cloud.ces.v1.ClientFunction; - - /** - * Encodes the specified ClientFunction message. Does not implicitly {@link google.cloud.ces.v1.ClientFunction.verify|verify} messages. - * @param message ClientFunction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IClientFunction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ClientFunction.verify|verify} messages. - * @param message ClientFunction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IClientFunction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientFunction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientFunction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ClientFunction; - - /** - * Decodes a ClientFunction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientFunction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ClientFunction; - - /** - * Verifies a ClientFunction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientFunction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientFunction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ClientFunction; - - /** - * Creates a plain object from a ClientFunction message. Also converts values to other types if specified. - * @param message ClientFunction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ClientFunction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientFunction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientFunction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Action. */ - interface IAction { - - /** Action connectionActionId */ - connectionActionId?: (string|null); - - /** Action entityOperation */ - entityOperation?: (google.cloud.ces.v1.Action.IEntityOperation|null); - - /** Action inputFields */ - inputFields?: (string[]|null); - - /** Action outputFields */ - outputFields?: (string[]|null); - } - - /** Represents an Action. */ - class Action implements IAction { - - /** - * Constructs a new Action. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IAction); - - /** Action connectionActionId. */ - public connectionActionId?: (string|null); - - /** Action entityOperation. */ - public entityOperation?: (google.cloud.ces.v1.Action.IEntityOperation|null); - - /** Action inputFields. */ - public inputFields: string[]; - - /** Action outputFields. */ - public outputFields: string[]; - - /** Action actionSpec. */ - public actionSpec?: ("connectionActionId"|"entityOperation"); - - /** - * Creates a new Action instance using the specified properties. - * @param [properties] Properties to set - * @returns Action instance - */ - public static create(properties?: google.cloud.ces.v1.IAction): google.cloud.ces.v1.Action; - - /** - * Encodes the specified Action message. Does not implicitly {@link google.cloud.ces.v1.Action.verify|verify} messages. - * @param message Action message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Action.verify|verify} messages. - * @param message Action message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Action message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Action - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Action; - - /** - * Decodes an Action message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Action - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Action; - - /** - * Verifies an Action message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Action message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Action - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Action; - - /** - * Creates a plain object from an Action message. Also converts values to other types if specified. - * @param message Action - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Action, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Action to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Action - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Action { - - /** Properties of an EntityOperation. */ - interface IEntityOperation { - - /** EntityOperation entityId */ - entityId?: (string|null); - - /** EntityOperation operation */ - operation?: (google.cloud.ces.v1.Action.EntityOperation.OperationType|keyof typeof google.cloud.ces.v1.Action.EntityOperation.OperationType|null); - } - - /** Represents an EntityOperation. */ - class EntityOperation implements IEntityOperation { - - /** - * Constructs a new EntityOperation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.Action.IEntityOperation); - - /** EntityOperation entityId. */ - public entityId: string; - - /** EntityOperation operation. */ - public operation: (google.cloud.ces.v1.Action.EntityOperation.OperationType|keyof typeof google.cloud.ces.v1.Action.EntityOperation.OperationType); - - /** - * Creates a new EntityOperation instance using the specified properties. - * @param [properties] Properties to set - * @returns EntityOperation instance - */ - public static create(properties?: google.cloud.ces.v1.Action.IEntityOperation): google.cloud.ces.v1.Action.EntityOperation; - - /** - * Encodes the specified EntityOperation message. Does not implicitly {@link google.cloud.ces.v1.Action.EntityOperation.verify|verify} messages. - * @param message EntityOperation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.Action.IEntityOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EntityOperation message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Action.EntityOperation.verify|verify} messages. - * @param message EntityOperation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.Action.IEntityOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EntityOperation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EntityOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Action.EntityOperation; - - /** - * Decodes an EntityOperation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EntityOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Action.EntityOperation; - - /** - * Verifies an EntityOperation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EntityOperation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EntityOperation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Action.EntityOperation; - - /** - * Creates a plain object from an EntityOperation message. Also converts values to other types if specified. - * @param message EntityOperation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Action.EntityOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EntityOperation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EntityOperation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EntityOperation { - - /** OperationType enum. */ - enum OperationType { - OPERATION_TYPE_UNSPECIFIED = 0, - LIST = 1, - GET = 2, - CREATE = 3, - UPDATE = 4, - DELETE = 5 - } - } - } - - /** Properties of a ConnectorTool. */ - interface IConnectorTool { - - /** ConnectorTool connection */ - connection?: (string|null); - - /** ConnectorTool action */ - action?: (google.cloud.ces.v1.IAction|null); - - /** ConnectorTool authConfig */ - authConfig?: (google.cloud.ces.v1.IEndUserAuthConfig|null); - - /** ConnectorTool name */ - name?: (string|null); - - /** ConnectorTool description */ - description?: (string|null); - } - - /** Represents a ConnectorTool. */ - class ConnectorTool implements IConnectorTool { - - /** - * Constructs a new ConnectorTool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IConnectorTool); - - /** ConnectorTool connection. */ - public connection: string; - - /** ConnectorTool action. */ - public action?: (google.cloud.ces.v1.IAction|null); - - /** ConnectorTool authConfig. */ - public authConfig?: (google.cloud.ces.v1.IEndUserAuthConfig|null); - - /** ConnectorTool name. */ - public name: string; - - /** ConnectorTool description. */ - public description: string; - - /** - * Creates a new ConnectorTool instance using the specified properties. - * @param [properties] Properties to set - * @returns ConnectorTool instance - */ - public static create(properties?: google.cloud.ces.v1.IConnectorTool): google.cloud.ces.v1.ConnectorTool; - - /** - * Encodes the specified ConnectorTool message. Does not implicitly {@link google.cloud.ces.v1.ConnectorTool.verify|verify} messages. - * @param message ConnectorTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IConnectorTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConnectorTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ConnectorTool.verify|verify} messages. - * @param message ConnectorTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IConnectorTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConnectorTool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConnectorTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ConnectorTool; - - /** - * Decodes a ConnectorTool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConnectorTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ConnectorTool; - - /** - * Verifies a ConnectorTool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConnectorTool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConnectorTool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ConnectorTool; - - /** - * Creates a plain object from a ConnectorTool message. Also converts values to other types if specified. - * @param message ConnectorTool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ConnectorTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConnectorTool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConnectorTool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ApiKeyConfig. */ - interface IApiKeyConfig { - - /** ApiKeyConfig keyName */ - keyName?: (string|null); - - /** ApiKeyConfig apiKeySecretVersion */ - apiKeySecretVersion?: (string|null); - - /** ApiKeyConfig requestLocation */ - requestLocation?: (google.cloud.ces.v1.ApiKeyConfig.RequestLocation|keyof typeof google.cloud.ces.v1.ApiKeyConfig.RequestLocation|null); - } - - /** Represents an ApiKeyConfig. */ - class ApiKeyConfig implements IApiKeyConfig { - - /** - * Constructs a new ApiKeyConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IApiKeyConfig); - - /** ApiKeyConfig keyName. */ - public keyName: string; - - /** ApiKeyConfig apiKeySecretVersion. */ - public apiKeySecretVersion: string; - - /** ApiKeyConfig requestLocation. */ - public requestLocation: (google.cloud.ces.v1.ApiKeyConfig.RequestLocation|keyof typeof google.cloud.ces.v1.ApiKeyConfig.RequestLocation); - - /** - * Creates a new ApiKeyConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ApiKeyConfig instance - */ - public static create(properties?: google.cloud.ces.v1.IApiKeyConfig): google.cloud.ces.v1.ApiKeyConfig; - - /** - * Encodes the specified ApiKeyConfig message. Does not implicitly {@link google.cloud.ces.v1.ApiKeyConfig.verify|verify} messages. - * @param message ApiKeyConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IApiKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ApiKeyConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ApiKeyConfig.verify|verify} messages. - * @param message ApiKeyConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IApiKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ApiKeyConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ApiKeyConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ApiKeyConfig; - - /** - * Decodes an ApiKeyConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ApiKeyConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ApiKeyConfig; - - /** - * Verifies an ApiKeyConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ApiKeyConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ApiKeyConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ApiKeyConfig; - - /** - * Creates a plain object from an ApiKeyConfig message. Also converts values to other types if specified. - * @param message ApiKeyConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ApiKeyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ApiKeyConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ApiKeyConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ApiKeyConfig { - - /** RequestLocation enum. */ - enum RequestLocation { - REQUEST_LOCATION_UNSPECIFIED = 0, - HEADER = 1, - QUERY_STRING = 2 - } - } - - /** Properties of a OAuthConfig. */ - interface IOAuthConfig { - - /** OAuthConfig oauthGrantType */ - oauthGrantType?: (google.cloud.ces.v1.OAuthConfig.OauthGrantType|keyof typeof google.cloud.ces.v1.OAuthConfig.OauthGrantType|null); - - /** OAuthConfig clientId */ - clientId?: (string|null); - - /** OAuthConfig clientSecretVersion */ - clientSecretVersion?: (string|null); - - /** OAuthConfig tokenEndpoint */ - tokenEndpoint?: (string|null); - - /** OAuthConfig scopes */ - scopes?: (string[]|null); - } - - /** Represents a OAuthConfig. */ - class OAuthConfig implements IOAuthConfig { - - /** - * Constructs a new OAuthConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IOAuthConfig); - - /** OAuthConfig oauthGrantType. */ - public oauthGrantType: (google.cloud.ces.v1.OAuthConfig.OauthGrantType|keyof typeof google.cloud.ces.v1.OAuthConfig.OauthGrantType); - - /** OAuthConfig clientId. */ - public clientId: string; - - /** OAuthConfig clientSecretVersion. */ - public clientSecretVersion: string; - - /** OAuthConfig tokenEndpoint. */ - public tokenEndpoint: string; - - /** OAuthConfig scopes. */ - public scopes: string[]; - - /** - * Creates a new OAuthConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns OAuthConfig instance - */ - public static create(properties?: google.cloud.ces.v1.IOAuthConfig): google.cloud.ces.v1.OAuthConfig; - - /** - * Encodes the specified OAuthConfig message. Does not implicitly {@link google.cloud.ces.v1.OAuthConfig.verify|verify} messages. - * @param message OAuthConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IOAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OAuthConfig.verify|verify} messages. - * @param message OAuthConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IOAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a OAuthConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OAuthConfig; - - /** - * Decodes a OAuthConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OAuthConfig; - - /** - * Verifies a OAuthConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a OAuthConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OAuthConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OAuthConfig; - - /** - * Creates a plain object from a OAuthConfig message. Also converts values to other types if specified. - * @param message OAuthConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.OAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OAuthConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OAuthConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace OAuthConfig { - - /** OauthGrantType enum. */ - enum OauthGrantType { - OAUTH_GRANT_TYPE_UNSPECIFIED = 0, - CLIENT_CREDENTIAL = 1 - } - } - - /** Properties of a ServiceAgentIdTokenAuthConfig. */ - interface IServiceAgentIdTokenAuthConfig { - } - - /** Represents a ServiceAgentIdTokenAuthConfig. */ - class ServiceAgentIdTokenAuthConfig implements IServiceAgentIdTokenAuthConfig { - - /** - * Constructs a new ServiceAgentIdTokenAuthConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig); - - /** - * Creates a new ServiceAgentIdTokenAuthConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceAgentIdTokenAuthConfig instance - */ - public static create(properties?: google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig): google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig; - - /** - * Encodes the specified ServiceAgentIdTokenAuthConfig message. Does not implicitly {@link google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig.verify|verify} messages. - * @param message ServiceAgentIdTokenAuthConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceAgentIdTokenAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig.verify|verify} messages. - * @param message ServiceAgentIdTokenAuthConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceAgentIdTokenAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig; - - /** - * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceAgentIdTokenAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig; - - /** - * Verifies a ServiceAgentIdTokenAuthConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceAgentIdTokenAuthConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceAgentIdTokenAuthConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig; - - /** - * Creates a plain object from a ServiceAgentIdTokenAuthConfig message. Also converts values to other types if specified. - * @param message ServiceAgentIdTokenAuthConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceAgentIdTokenAuthConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceAgentIdTokenAuthConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceAccountAuthConfig. */ - interface IServiceAccountAuthConfig { - - /** ServiceAccountAuthConfig serviceAccount */ - serviceAccount?: (string|null); - - /** ServiceAccountAuthConfig scopes */ - scopes?: (string[]|null); - } - - /** Represents a ServiceAccountAuthConfig. */ - class ServiceAccountAuthConfig implements IServiceAccountAuthConfig { - - /** - * Constructs a new ServiceAccountAuthConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IServiceAccountAuthConfig); - - /** ServiceAccountAuthConfig serviceAccount. */ - public serviceAccount: string; - - /** ServiceAccountAuthConfig scopes. */ - public scopes: string[]; - - /** - * Creates a new ServiceAccountAuthConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceAccountAuthConfig instance - */ - public static create(properties?: google.cloud.ces.v1.IServiceAccountAuthConfig): google.cloud.ces.v1.ServiceAccountAuthConfig; - - /** - * Encodes the specified ServiceAccountAuthConfig message. Does not implicitly {@link google.cloud.ces.v1.ServiceAccountAuthConfig.verify|verify} messages. - * @param message ServiceAccountAuthConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IServiceAccountAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceAccountAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ServiceAccountAuthConfig.verify|verify} messages. - * @param message ServiceAccountAuthConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IServiceAccountAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceAccountAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ServiceAccountAuthConfig; - - /** - * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceAccountAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ServiceAccountAuthConfig; - - /** - * Verifies a ServiceAccountAuthConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceAccountAuthConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceAccountAuthConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ServiceAccountAuthConfig; - - /** - * Creates a plain object from a ServiceAccountAuthConfig message. Also converts values to other types if specified. - * @param message ServiceAccountAuthConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ServiceAccountAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceAccountAuthConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceAccountAuthConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BearerTokenConfig. */ - interface IBearerTokenConfig { - - /** BearerTokenConfig token */ - token?: (string|null); - } - - /** Represents a BearerTokenConfig. */ - class BearerTokenConfig implements IBearerTokenConfig { - - /** - * Constructs a new BearerTokenConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IBearerTokenConfig); - - /** BearerTokenConfig token. */ - public token: string; - - /** - * Creates a new BearerTokenConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns BearerTokenConfig instance - */ - public static create(properties?: google.cloud.ces.v1.IBearerTokenConfig): google.cloud.ces.v1.BearerTokenConfig; - - /** - * Encodes the specified BearerTokenConfig message. Does not implicitly {@link google.cloud.ces.v1.BearerTokenConfig.verify|verify} messages. - * @param message BearerTokenConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IBearerTokenConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BearerTokenConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BearerTokenConfig.verify|verify} messages. - * @param message BearerTokenConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IBearerTokenConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BearerTokenConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BearerTokenConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.BearerTokenConfig; - - /** - * Decodes a BearerTokenConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BearerTokenConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.BearerTokenConfig; - - /** - * Verifies a BearerTokenConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BearerTokenConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BearerTokenConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.BearerTokenConfig; - - /** - * Creates a plain object from a BearerTokenConfig message. Also converts values to other types if specified. - * @param message BearerTokenConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.BearerTokenConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BearerTokenConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BearerTokenConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EndUserAuthConfig. */ - interface IEndUserAuthConfig { - - /** EndUserAuthConfig oauth2AuthCodeConfig */ - oauth2AuthCodeConfig?: (google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig|null); - - /** EndUserAuthConfig oauth2JwtBearerConfig */ - oauth2JwtBearerConfig?: (google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig|null); - } - - /** Represents an EndUserAuthConfig. */ - class EndUserAuthConfig implements IEndUserAuthConfig { - - /** - * Constructs a new EndUserAuthConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IEndUserAuthConfig); - - /** EndUserAuthConfig oauth2AuthCodeConfig. */ - public oauth2AuthCodeConfig?: (google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig|null); - - /** EndUserAuthConfig oauth2JwtBearerConfig. */ - public oauth2JwtBearerConfig?: (google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig|null); - - /** EndUserAuthConfig authConfig. */ - public authConfig?: ("oauth2AuthCodeConfig"|"oauth2JwtBearerConfig"); - - /** - * Creates a new EndUserAuthConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns EndUserAuthConfig instance - */ - public static create(properties?: google.cloud.ces.v1.IEndUserAuthConfig): google.cloud.ces.v1.EndUserAuthConfig; - - /** - * Encodes the specified EndUserAuthConfig message. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.verify|verify} messages. - * @param message EndUserAuthConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IEndUserAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EndUserAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.verify|verify} messages. - * @param message EndUserAuthConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IEndUserAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EndUserAuthConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EndUserAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.EndUserAuthConfig; - - /** - * Decodes an EndUserAuthConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EndUserAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.EndUserAuthConfig; - - /** - * Verifies an EndUserAuthConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EndUserAuthConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EndUserAuthConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.EndUserAuthConfig; - - /** - * Creates a plain object from an EndUserAuthConfig message. Also converts values to other types if specified. - * @param message EndUserAuthConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.EndUserAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EndUserAuthConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EndUserAuthConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EndUserAuthConfig { - - /** Properties of an Oauth2AuthCodeConfig. */ - interface IOauth2AuthCodeConfig { - - /** Oauth2AuthCodeConfig oauthToken */ - oauthToken?: (string|null); - } - - /** Represents an Oauth2AuthCodeConfig. */ - class Oauth2AuthCodeConfig implements IOauth2AuthCodeConfig { - - /** - * Constructs a new Oauth2AuthCodeConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig); - - /** Oauth2AuthCodeConfig oauthToken. */ - public oauthToken: string; - - /** - * Creates a new Oauth2AuthCodeConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns Oauth2AuthCodeConfig instance - */ - public static create(properties?: google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig): google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig; - - /** - * Encodes the specified Oauth2AuthCodeConfig message. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. - * @param message Oauth2AuthCodeConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Oauth2AuthCodeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. - * @param message Oauth2AuthCodeConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Oauth2AuthCodeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig; - - /** - * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Oauth2AuthCodeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig; - - /** - * Verifies an Oauth2AuthCodeConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Oauth2AuthCodeConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Oauth2AuthCodeConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig; - - /** - * Creates a plain object from an Oauth2AuthCodeConfig message. Also converts values to other types if specified. - * @param message Oauth2AuthCodeConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Oauth2AuthCodeConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Oauth2AuthCodeConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Oauth2JwtBearerConfig. */ - interface IOauth2JwtBearerConfig { - - /** Oauth2JwtBearerConfig issuer */ - issuer?: (string|null); - - /** Oauth2JwtBearerConfig subject */ - subject?: (string|null); - - /** Oauth2JwtBearerConfig clientKey */ - clientKey?: (string|null); - } - - /** Represents an Oauth2JwtBearerConfig. */ - class Oauth2JwtBearerConfig implements IOauth2JwtBearerConfig { - - /** - * Constructs a new Oauth2JwtBearerConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig); - - /** Oauth2JwtBearerConfig issuer. */ - public issuer: string; - - /** Oauth2JwtBearerConfig subject. */ - public subject: string; - - /** Oauth2JwtBearerConfig clientKey. */ - public clientKey: string; - - /** - * Creates a new Oauth2JwtBearerConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns Oauth2JwtBearerConfig instance - */ - public static create(properties?: google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig): google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig; - - /** - * Encodes the specified Oauth2JwtBearerConfig message. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. - * @param message Oauth2JwtBearerConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Oauth2JwtBearerConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. - * @param message Oauth2JwtBearerConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Oauth2JwtBearerConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig; - - /** - * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Oauth2JwtBearerConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig; - - /** - * Verifies an Oauth2JwtBearerConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Oauth2JwtBearerConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Oauth2JwtBearerConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig; - - /** - * Creates a plain object from an Oauth2JwtBearerConfig message. Also converts values to other types if specified. - * @param message Oauth2JwtBearerConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Oauth2JwtBearerConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Oauth2JwtBearerConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ApiAuthentication. */ - interface IApiAuthentication { - - /** ApiAuthentication apiKeyConfig */ - apiKeyConfig?: (google.cloud.ces.v1.IApiKeyConfig|null); - - /** ApiAuthentication oauthConfig */ - oauthConfig?: (google.cloud.ces.v1.IOAuthConfig|null); - - /** ApiAuthentication serviceAgentIdTokenAuthConfig */ - serviceAgentIdTokenAuthConfig?: (google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig|null); - - /** ApiAuthentication serviceAccountAuthConfig */ - serviceAccountAuthConfig?: (google.cloud.ces.v1.IServiceAccountAuthConfig|null); - - /** ApiAuthentication bearerTokenConfig */ - bearerTokenConfig?: (google.cloud.ces.v1.IBearerTokenConfig|null); - } - - /** Represents an ApiAuthentication. */ - class ApiAuthentication implements IApiAuthentication { - - /** - * Constructs a new ApiAuthentication. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IApiAuthentication); - - /** ApiAuthentication apiKeyConfig. */ - public apiKeyConfig?: (google.cloud.ces.v1.IApiKeyConfig|null); - - /** ApiAuthentication oauthConfig. */ - public oauthConfig?: (google.cloud.ces.v1.IOAuthConfig|null); - - /** ApiAuthentication serviceAgentIdTokenAuthConfig. */ - public serviceAgentIdTokenAuthConfig?: (google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig|null); - - /** ApiAuthentication serviceAccountAuthConfig. */ - public serviceAccountAuthConfig?: (google.cloud.ces.v1.IServiceAccountAuthConfig|null); - - /** ApiAuthentication bearerTokenConfig. */ - public bearerTokenConfig?: (google.cloud.ces.v1.IBearerTokenConfig|null); - - /** ApiAuthentication authConfig. */ - public authConfig?: ("apiKeyConfig"|"oauthConfig"|"serviceAgentIdTokenAuthConfig"|"serviceAccountAuthConfig"|"bearerTokenConfig"); - - /** - * Creates a new ApiAuthentication instance using the specified properties. - * @param [properties] Properties to set - * @returns ApiAuthentication instance - */ - public static create(properties?: google.cloud.ces.v1.IApiAuthentication): google.cloud.ces.v1.ApiAuthentication; - - /** - * Encodes the specified ApiAuthentication message. Does not implicitly {@link google.cloud.ces.v1.ApiAuthentication.verify|verify} messages. - * @param message ApiAuthentication message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IApiAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ApiAuthentication message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ApiAuthentication.verify|verify} messages. - * @param message ApiAuthentication message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IApiAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ApiAuthentication message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ApiAuthentication - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ApiAuthentication; - - /** - * Decodes an ApiAuthentication message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ApiAuthentication - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ApiAuthentication; - - /** - * Verifies an ApiAuthentication message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ApiAuthentication message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ApiAuthentication - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ApiAuthentication; - - /** - * Creates a plain object from an ApiAuthentication message. Also converts values to other types if specified. - * @param message ApiAuthentication - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ApiAuthentication, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ApiAuthentication to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ApiAuthentication - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DataStoreTool. */ - interface IDataStoreTool { - - /** DataStoreTool dataStoreSource */ - dataStoreSource?: (google.cloud.ces.v1.DataStoreTool.IDataStoreSource|null); - - /** DataStoreTool engineSource */ - engineSource?: (google.cloud.ces.v1.DataStoreTool.IEngineSource|null); - - /** DataStoreTool name */ - name?: (string|null); - - /** DataStoreTool description */ - description?: (string|null); - - /** DataStoreTool boostSpecs */ - boostSpecs?: (google.cloud.ces.v1.DataStoreTool.IBoostSpecs[]|null); - - /** DataStoreTool modalityConfigs */ - modalityConfigs?: (google.cloud.ces.v1.DataStoreTool.IModalityConfig[]|null); - - /** DataStoreTool filterParameterBehavior */ - filterParameterBehavior?: (google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior|keyof typeof google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior|null); - } - - /** Represents a DataStoreTool. */ - class DataStoreTool implements IDataStoreTool { - - /** - * Constructs a new DataStoreTool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IDataStoreTool); - - /** DataStoreTool dataStoreSource. */ - public dataStoreSource?: (google.cloud.ces.v1.DataStoreTool.IDataStoreSource|null); - - /** DataStoreTool engineSource. */ - public engineSource?: (google.cloud.ces.v1.DataStoreTool.IEngineSource|null); - - /** DataStoreTool name. */ - public name: string; - - /** DataStoreTool description. */ - public description: string; - - /** DataStoreTool boostSpecs. */ - public boostSpecs: google.cloud.ces.v1.DataStoreTool.IBoostSpecs[]; - - /** DataStoreTool modalityConfigs. */ - public modalityConfigs: google.cloud.ces.v1.DataStoreTool.IModalityConfig[]; - - /** DataStoreTool filterParameterBehavior. */ - public filterParameterBehavior: (google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior|keyof typeof google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior); - - /** DataStoreTool searchSource. */ - public searchSource?: ("dataStoreSource"|"engineSource"); - - /** - * Creates a new DataStoreTool instance using the specified properties. - * @param [properties] Properties to set - * @returns DataStoreTool instance - */ - public static create(properties?: google.cloud.ces.v1.IDataStoreTool): google.cloud.ces.v1.DataStoreTool; - - /** - * Encodes the specified DataStoreTool message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.verify|verify} messages. - * @param message DataStoreTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IDataStoreTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataStoreTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.verify|verify} messages. - * @param message DataStoreTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IDataStoreTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataStoreTool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataStoreTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool; - - /** - * Decodes a DataStoreTool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataStoreTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool; - - /** - * Verifies a DataStoreTool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataStoreTool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataStoreTool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool; - - /** - * Creates a plain object from a DataStoreTool message. Also converts values to other types if specified. - * @param message DataStoreTool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DataStoreTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataStoreTool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataStoreTool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DataStoreTool { - - /** Properties of a RewriterConfig. */ - interface IRewriterConfig { - - /** RewriterConfig modelSettings */ - modelSettings?: (google.cloud.ces.v1.IModelSettings|null); - - /** RewriterConfig prompt */ - prompt?: (string|null); - - /** RewriterConfig disabled */ - disabled?: (boolean|null); - } - - /** Represents a RewriterConfig. */ - class RewriterConfig implements IRewriterConfig { - - /** - * Constructs a new RewriterConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.DataStoreTool.IRewriterConfig); - - /** RewriterConfig modelSettings. */ - public modelSettings?: (google.cloud.ces.v1.IModelSettings|null); - - /** RewriterConfig prompt. */ - public prompt: string; - - /** RewriterConfig disabled. */ - public disabled: boolean; - - /** - * Creates a new RewriterConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns RewriterConfig instance - */ - public static create(properties?: google.cloud.ces.v1.DataStoreTool.IRewriterConfig): google.cloud.ces.v1.DataStoreTool.RewriterConfig; - - /** - * Encodes the specified RewriterConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.RewriterConfig.verify|verify} messages. - * @param message RewriterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.DataStoreTool.IRewriterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RewriterConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.RewriterConfig.verify|verify} messages. - * @param message RewriterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.IRewriterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RewriterConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RewriterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.RewriterConfig; - - /** - * Decodes a RewriterConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RewriterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.RewriterConfig; - - /** - * Verifies a RewriterConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RewriterConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RewriterConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.RewriterConfig; - - /** - * Creates a plain object from a RewriterConfig message. Also converts values to other types if specified. - * @param message RewriterConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DataStoreTool.RewriterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RewriterConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RewriterConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SummarizationConfig. */ - interface ISummarizationConfig { - - /** SummarizationConfig modelSettings */ - modelSettings?: (google.cloud.ces.v1.IModelSettings|null); - - /** SummarizationConfig prompt */ - prompt?: (string|null); - - /** SummarizationConfig disabled */ - disabled?: (boolean|null); - } - - /** Represents a SummarizationConfig. */ - class SummarizationConfig implements ISummarizationConfig { - - /** - * Constructs a new SummarizationConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.DataStoreTool.ISummarizationConfig); - - /** SummarizationConfig modelSettings. */ - public modelSettings?: (google.cloud.ces.v1.IModelSettings|null); - - /** SummarizationConfig prompt. */ - public prompt: string; - - /** SummarizationConfig disabled. */ - public disabled: boolean; - - /** - * Creates a new SummarizationConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SummarizationConfig instance - */ - public static create(properties?: google.cloud.ces.v1.DataStoreTool.ISummarizationConfig): google.cloud.ces.v1.DataStoreTool.SummarizationConfig; - - /** - * Encodes the specified SummarizationConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.SummarizationConfig.verify|verify} messages. - * @param message SummarizationConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.DataStoreTool.ISummarizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SummarizationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.SummarizationConfig.verify|verify} messages. - * @param message SummarizationConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.ISummarizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SummarizationConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SummarizationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.SummarizationConfig; - - /** - * Decodes a SummarizationConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SummarizationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.SummarizationConfig; - - /** - * Verifies a SummarizationConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SummarizationConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SummarizationConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.SummarizationConfig; - - /** - * Creates a plain object from a SummarizationConfig message. Also converts values to other types if specified. - * @param message SummarizationConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DataStoreTool.SummarizationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SummarizationConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SummarizationConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GroundingConfig. */ - interface IGroundingConfig { - - /** GroundingConfig groundingLevel */ - groundingLevel?: (number|null); - - /** GroundingConfig disabled */ - disabled?: (boolean|null); - } - - /** Represents a GroundingConfig. */ - class GroundingConfig implements IGroundingConfig { - - /** - * Constructs a new GroundingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.DataStoreTool.IGroundingConfig); - - /** GroundingConfig groundingLevel. */ - public groundingLevel: number; - - /** GroundingConfig disabled. */ - public disabled: boolean; - - /** - * Creates a new GroundingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns GroundingConfig instance - */ - public static create(properties?: google.cloud.ces.v1.DataStoreTool.IGroundingConfig): google.cloud.ces.v1.DataStoreTool.GroundingConfig; - - /** - * Encodes the specified GroundingConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.GroundingConfig.verify|verify} messages. - * @param message GroundingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.DataStoreTool.IGroundingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GroundingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.GroundingConfig.verify|verify} messages. - * @param message GroundingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.IGroundingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GroundingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GroundingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.GroundingConfig; - - /** - * Decodes a GroundingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GroundingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.GroundingConfig; - - /** - * Verifies a GroundingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GroundingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GroundingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.GroundingConfig; - - /** - * Creates a plain object from a GroundingConfig message. Also converts values to other types if specified. - * @param message GroundingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DataStoreTool.GroundingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GroundingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GroundingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DataStoreSource. */ - interface IDataStoreSource { - - /** DataStoreSource filter */ - filter?: (string|null); - - /** DataStoreSource dataStore */ - dataStore?: (google.cloud.ces.v1.IDataStore|null); - } - - /** Represents a DataStoreSource. */ - class DataStoreSource implements IDataStoreSource { - - /** - * Constructs a new DataStoreSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.DataStoreTool.IDataStoreSource); - - /** DataStoreSource filter. */ - public filter: string; - - /** DataStoreSource dataStore. */ - public dataStore?: (google.cloud.ces.v1.IDataStore|null); - - /** - * Creates a new DataStoreSource instance using the specified properties. - * @param [properties] Properties to set - * @returns DataStoreSource instance - */ - public static create(properties?: google.cloud.ces.v1.DataStoreTool.IDataStoreSource): google.cloud.ces.v1.DataStoreTool.DataStoreSource; - - /** - * Encodes the specified DataStoreSource message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.DataStoreSource.verify|verify} messages. - * @param message DataStoreSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.DataStoreTool.IDataStoreSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataStoreSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.DataStoreSource.verify|verify} messages. - * @param message DataStoreSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.IDataStoreSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataStoreSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataStoreSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.DataStoreSource; - - /** - * Decodes a DataStoreSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataStoreSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.DataStoreSource; - - /** - * Verifies a DataStoreSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataStoreSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataStoreSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.DataStoreSource; - - /** - * Creates a plain object from a DataStoreSource message. Also converts values to other types if specified. - * @param message DataStoreSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DataStoreTool.DataStoreSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataStoreSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataStoreSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EngineSource. */ - interface IEngineSource { - - /** EngineSource engine */ - engine?: (string|null); - - /** EngineSource dataStoreSources */ - dataStoreSources?: (google.cloud.ces.v1.DataStoreTool.IDataStoreSource[]|null); - - /** EngineSource filter */ - filter?: (string|null); - } - - /** Represents an EngineSource. */ - class EngineSource implements IEngineSource { - - /** - * Constructs a new EngineSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.DataStoreTool.IEngineSource); - - /** EngineSource engine. */ - public engine: string; - - /** EngineSource dataStoreSources. */ - public dataStoreSources: google.cloud.ces.v1.DataStoreTool.IDataStoreSource[]; - - /** EngineSource filter. */ - public filter: string; - - /** - * Creates a new EngineSource instance using the specified properties. - * @param [properties] Properties to set - * @returns EngineSource instance - */ - public static create(properties?: google.cloud.ces.v1.DataStoreTool.IEngineSource): google.cloud.ces.v1.DataStoreTool.EngineSource; - - /** - * Encodes the specified EngineSource message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.EngineSource.verify|verify} messages. - * @param message EngineSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.DataStoreTool.IEngineSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EngineSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.EngineSource.verify|verify} messages. - * @param message EngineSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.IEngineSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EngineSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EngineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.EngineSource; - - /** - * Decodes an EngineSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EngineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.EngineSource; - - /** - * Verifies an EngineSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EngineSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EngineSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.EngineSource; - - /** - * Creates a plain object from an EngineSource message. Also converts values to other types if specified. - * @param message EngineSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DataStoreTool.EngineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EngineSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EngineSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BoostSpecs. */ - interface IBoostSpecs { - - /** BoostSpecs dataStores */ - dataStores?: (string[]|null); - - /** BoostSpecs spec */ - spec?: (google.cloud.ces.v1.DataStoreTool.IBoostSpec[]|null); - } - - /** Represents a BoostSpecs. */ - class BoostSpecs implements IBoostSpecs { - - /** - * Constructs a new BoostSpecs. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.DataStoreTool.IBoostSpecs); - - /** BoostSpecs dataStores. */ - public dataStores: string[]; - - /** BoostSpecs spec. */ - public spec: google.cloud.ces.v1.DataStoreTool.IBoostSpec[]; - - /** - * Creates a new BoostSpecs instance using the specified properties. - * @param [properties] Properties to set - * @returns BoostSpecs instance - */ - public static create(properties?: google.cloud.ces.v1.DataStoreTool.IBoostSpecs): google.cloud.ces.v1.DataStoreTool.BoostSpecs; - - /** - * Encodes the specified BoostSpecs message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpecs.verify|verify} messages. - * @param message BoostSpecs message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.DataStoreTool.IBoostSpecs, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BoostSpecs message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpecs.verify|verify} messages. - * @param message BoostSpecs message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.IBoostSpecs, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BoostSpecs message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoostSpecs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.BoostSpecs; - - /** - * Decodes a BoostSpecs message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoostSpecs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.BoostSpecs; - - /** - * Verifies a BoostSpecs message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BoostSpecs message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoostSpecs - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.BoostSpecs; - - /** - * Creates a plain object from a BoostSpecs message. Also converts values to other types if specified. - * @param message BoostSpecs - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DataStoreTool.BoostSpecs, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoostSpecs to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BoostSpecs - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BoostSpec. */ - interface IBoostSpec { - - /** BoostSpec conditionBoostSpecs */ - conditionBoostSpecs?: (google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec[]|null); - } - - /** Represents a BoostSpec. */ - class BoostSpec implements IBoostSpec { - - /** - * Constructs a new BoostSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.DataStoreTool.IBoostSpec); - - /** BoostSpec conditionBoostSpecs. */ - public conditionBoostSpecs: google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec[]; - - /** - * Creates a new BoostSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns BoostSpec instance - */ - public static create(properties?: google.cloud.ces.v1.DataStoreTool.IBoostSpec): google.cloud.ces.v1.DataStoreTool.BoostSpec; - - /** - * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.verify|verify} messages. - * @param message BoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.DataStoreTool.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.verify|verify} messages. - * @param message BoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BoostSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.BoostSpec; - - /** - * Decodes a BoostSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.BoostSpec; - - /** - * Verifies a BoostSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoostSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.BoostSpec; - - /** - * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. - * @param message BoostSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DataStoreTool.BoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoostSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BoostSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BoostSpec { - - /** Properties of a ConditionBoostSpec. */ - interface IConditionBoostSpec { - - /** ConditionBoostSpec condition */ - condition?: (string|null); - - /** ConditionBoostSpec boost */ - boost?: (number|null); - - /** ConditionBoostSpec boostControlSpec */ - boostControlSpec?: (google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null); - } - - /** Represents a ConditionBoostSpec. */ - class ConditionBoostSpec implements IConditionBoostSpec { - - /** - * Constructs a new ConditionBoostSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec); - - /** ConditionBoostSpec condition. */ - public condition: string; - - /** ConditionBoostSpec boost. */ - public boost: number; - - /** ConditionBoostSpec boostControlSpec. */ - public boostControlSpec?: (google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null); - - /** - * Creates a new ConditionBoostSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns ConditionBoostSpec instance - */ - public static create(properties?: google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec; - - /** - * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @param message ConditionBoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @param message ConditionBoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConditionBoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec; - - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConditionBoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec; - - /** - * Verifies a ConditionBoostSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConditionBoostSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec; - - /** - * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. - * @param message ConditionBoostSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConditionBoostSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConditionBoostSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ConditionBoostSpec { - - /** Properties of a BoostControlSpec. */ - interface IBoostControlSpec { - - /** BoostControlSpec fieldName */ - fieldName?: (string|null); - - /** BoostControlSpec attributeType */ - attributeType?: (google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|keyof typeof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|null); - - /** BoostControlSpec interpolationType */ - interpolationType?: (google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|keyof typeof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|null); - - /** BoostControlSpec controlPoints */ - controlPoints?: (google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint[]|null); - } - - /** Represents a BoostControlSpec. */ - class BoostControlSpec implements IBoostControlSpec { - - /** - * Constructs a new BoostControlSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec); - - /** BoostControlSpec fieldName. */ - public fieldName: string; - - /** BoostControlSpec attributeType. */ - public attributeType: (google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|keyof typeof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType); - - /** BoostControlSpec interpolationType. */ - public interpolationType: (google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|keyof typeof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType); - - /** BoostControlSpec controlPoints. */ - public controlPoints: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint[]; - - /** - * Creates a new BoostControlSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns BoostControlSpec instance - */ - public static create(properties?: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; - - /** - * Encodes the specified BoostControlSpec message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. - * @param message BoostControlSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BoostControlSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. - * @param message BoostControlSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BoostControlSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoostControlSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; - - /** - * Decodes a BoostControlSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoostControlSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; - - /** - * Verifies a BoostControlSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BoostControlSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoostControlSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; - - /** - * Creates a plain object from a BoostControlSpec message. Also converts values to other types if specified. - * @param message BoostControlSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoostControlSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BoostControlSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BoostControlSpec { - - /** Properties of a ControlPoint. */ - interface IControlPoint { - - /** ControlPoint attributeValue */ - attributeValue?: (string|null); - - /** ControlPoint boostAmount */ - boostAmount?: (number|null); - } - - /** Represents a ControlPoint. */ - class ControlPoint implements IControlPoint { - - /** - * Constructs a new ControlPoint. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint); - - /** ControlPoint attributeValue. */ - public attributeValue: string; - - /** ControlPoint boostAmount. */ - public boostAmount: number; - - /** - * Creates a new ControlPoint instance using the specified properties. - * @param [properties] Properties to set - * @returns ControlPoint instance - */ - public static create(properties?: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; - - /** - * Encodes the specified ControlPoint message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. - * @param message ControlPoint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ControlPoint message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. - * @param message ControlPoint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ControlPoint message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ControlPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; - - /** - * Decodes a ControlPoint message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ControlPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; - - /** - * Verifies a ControlPoint message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ControlPoint message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ControlPoint - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; - - /** - * Creates a plain object from a ControlPoint message. Also converts values to other types if specified. - * @param message ControlPoint - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ControlPoint to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ControlPoint - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** AttributeType enum. */ - enum AttributeType { - ATTRIBUTE_TYPE_UNSPECIFIED = 0, - NUMERICAL = 1, - FRESHNESS = 2 - } - - /** InterpolationType enum. */ - enum InterpolationType { - INTERPOLATION_TYPE_UNSPECIFIED = 0, - LINEAR = 1 - } - } - } - } - - /** Properties of a ModalityConfig. */ - interface IModalityConfig { - - /** ModalityConfig modalityType */ - modalityType?: (google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType|keyof typeof google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType|null); - - /** ModalityConfig rewriterConfig */ - rewriterConfig?: (google.cloud.ces.v1.DataStoreTool.IRewriterConfig|null); - - /** ModalityConfig summarizationConfig */ - summarizationConfig?: (google.cloud.ces.v1.DataStoreTool.ISummarizationConfig|null); - - /** ModalityConfig groundingConfig */ - groundingConfig?: (google.cloud.ces.v1.DataStoreTool.IGroundingConfig|null); - } - - /** Represents a ModalityConfig. */ - class ModalityConfig implements IModalityConfig { - - /** - * Constructs a new ModalityConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.DataStoreTool.IModalityConfig); - - /** ModalityConfig modalityType. */ - public modalityType: (google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType|keyof typeof google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType); - - /** ModalityConfig rewriterConfig. */ - public rewriterConfig?: (google.cloud.ces.v1.DataStoreTool.IRewriterConfig|null); - - /** ModalityConfig summarizationConfig. */ - public summarizationConfig?: (google.cloud.ces.v1.DataStoreTool.ISummarizationConfig|null); - - /** ModalityConfig groundingConfig. */ - public groundingConfig?: (google.cloud.ces.v1.DataStoreTool.IGroundingConfig|null); - - /** - * Creates a new ModalityConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ModalityConfig instance - */ - public static create(properties?: google.cloud.ces.v1.DataStoreTool.IModalityConfig): google.cloud.ces.v1.DataStoreTool.ModalityConfig; - - /** - * Encodes the specified ModalityConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.ModalityConfig.verify|verify} messages. - * @param message ModalityConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.DataStoreTool.IModalityConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ModalityConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.ModalityConfig.verify|verify} messages. - * @param message ModalityConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.DataStoreTool.IModalityConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ModalityConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ModalityConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStoreTool.ModalityConfig; - - /** - * Decodes a ModalityConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ModalityConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStoreTool.ModalityConfig; - - /** - * Verifies a ModalityConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ModalityConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ModalityConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStoreTool.ModalityConfig; - - /** - * Creates a plain object from a ModalityConfig message. Also converts values to other types if specified. - * @param message ModalityConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DataStoreTool.ModalityConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ModalityConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ModalityConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ModalityConfig { - - /** ModalityType enum. */ - enum ModalityType { - MODALITY_TYPE_UNSPECIFIED = 0, - TEXT = 1, - AUDIO = 2 - } - } - - /** FilterParameterBehavior enum. */ - enum FilterParameterBehavior { - FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED = 0, - ALWAYS_INCLUDE = 2, - NEVER_INCLUDE = 3 - } - } - - /** Properties of a DataStore. */ - interface IDataStore { - - /** DataStore name */ - name?: (string|null); - - /** DataStore type */ - type?: (google.cloud.ces.v1.DataStore.DataStoreType|keyof typeof google.cloud.ces.v1.DataStore.DataStoreType|null); - - /** DataStore documentProcessingMode */ - documentProcessingMode?: (google.cloud.ces.v1.DataStore.DocumentProcessingMode|keyof typeof google.cloud.ces.v1.DataStore.DocumentProcessingMode|null); - - /** DataStore displayName */ - displayName?: (string|null); - - /** DataStore createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** DataStore connectorConfig */ - connectorConfig?: (google.cloud.ces.v1.DataStore.IConnectorConfig|null); - } - - /** Represents a DataStore. */ - class DataStore implements IDataStore { - - /** - * Constructs a new DataStore. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IDataStore); - - /** DataStore name. */ - public name: string; - - /** DataStore type. */ - public type: (google.cloud.ces.v1.DataStore.DataStoreType|keyof typeof google.cloud.ces.v1.DataStore.DataStoreType); - - /** DataStore documentProcessingMode. */ - public documentProcessingMode: (google.cloud.ces.v1.DataStore.DocumentProcessingMode|keyof typeof google.cloud.ces.v1.DataStore.DocumentProcessingMode); - - /** DataStore displayName. */ - public displayName: string; - - /** DataStore createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** DataStore connectorConfig. */ - public connectorConfig?: (google.cloud.ces.v1.DataStore.IConnectorConfig|null); - - /** - * Creates a new DataStore instance using the specified properties. - * @param [properties] Properties to set - * @returns DataStore instance - */ - public static create(properties?: google.cloud.ces.v1.IDataStore): google.cloud.ces.v1.DataStore; - - /** - * Encodes the specified DataStore message. Does not implicitly {@link google.cloud.ces.v1.DataStore.verify|verify} messages. - * @param message DataStore message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IDataStore, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataStore message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStore.verify|verify} messages. - * @param message DataStore message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IDataStore, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataStore message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataStore - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStore; - - /** - * Decodes a DataStore message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataStore - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStore; - - /** - * Verifies a DataStore message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataStore message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataStore - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStore; - - /** - * Creates a plain object from a DataStore message. Also converts values to other types if specified. - * @param message DataStore - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DataStore, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataStore to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataStore - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DataStore { - - /** Properties of a ConnectorConfig. */ - interface IConnectorConfig { - - /** ConnectorConfig collection */ - collection?: (string|null); - - /** ConnectorConfig collectionDisplayName */ - collectionDisplayName?: (string|null); - - /** ConnectorConfig dataSource */ - dataSource?: (string|null); - } - - /** Represents a ConnectorConfig. */ - class ConnectorConfig implements IConnectorConfig { - - /** - * Constructs a new ConnectorConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.DataStore.IConnectorConfig); - - /** ConnectorConfig collection. */ - public collection: string; - - /** ConnectorConfig collectionDisplayName. */ - public collectionDisplayName: string; - - /** ConnectorConfig dataSource. */ - public dataSource: string; - - /** - * Creates a new ConnectorConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ConnectorConfig instance - */ - public static create(properties?: google.cloud.ces.v1.DataStore.IConnectorConfig): google.cloud.ces.v1.DataStore.ConnectorConfig; - - /** - * Encodes the specified ConnectorConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStore.ConnectorConfig.verify|verify} messages. - * @param message ConnectorConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.DataStore.IConnectorConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConnectorConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStore.ConnectorConfig.verify|verify} messages. - * @param message ConnectorConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.DataStore.IConnectorConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConnectorConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConnectorConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.DataStore.ConnectorConfig; - - /** - * Decodes a ConnectorConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConnectorConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.DataStore.ConnectorConfig; - - /** - * Verifies a ConnectorConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConnectorConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConnectorConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.DataStore.ConnectorConfig; - - /** - * Creates a plain object from a ConnectorConfig message. Also converts values to other types if specified. - * @param message ConnectorConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.DataStore.ConnectorConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConnectorConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConnectorConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** DataStoreType enum. */ - enum DataStoreType { - DATA_STORE_TYPE_UNSPECIFIED = 0, - PUBLIC_WEB = 1, - UNSTRUCTURED = 2, - FAQ = 3, - CONNECTOR = 4 - } - - /** DocumentProcessingMode enum. */ - enum DocumentProcessingMode { - DOCUMENT_PROCESSING_MODE_UNSPECIFIED = 0, - DOCUMENTS = 1, - CHUNKS = 2 - } - } - - /** Properties of a CodeBlock. */ - interface ICodeBlock { - - /** CodeBlock pythonCode */ - pythonCode?: (string|null); - } - - /** Represents a CodeBlock. */ - class CodeBlock implements ICodeBlock { - - /** - * Constructs a new CodeBlock. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ICodeBlock); - - /** CodeBlock pythonCode. */ - public pythonCode: string; - - /** - * Creates a new CodeBlock instance using the specified properties. - * @param [properties] Properties to set - * @returns CodeBlock instance - */ - public static create(properties?: google.cloud.ces.v1.ICodeBlock): google.cloud.ces.v1.CodeBlock; - - /** - * Encodes the specified CodeBlock message. Does not implicitly {@link google.cloud.ces.v1.CodeBlock.verify|verify} messages. - * @param message CodeBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ICodeBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CodeBlock message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CodeBlock.verify|verify} messages. - * @param message CodeBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ICodeBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CodeBlock message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CodeBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.CodeBlock; - - /** - * Decodes a CodeBlock message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CodeBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.CodeBlock; - - /** - * Verifies a CodeBlock message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CodeBlock message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CodeBlock - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.CodeBlock; - - /** - * Creates a plain object from a CodeBlock message. Also converts values to other types if specified. - * @param message CodeBlock - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.CodeBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CodeBlock to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CodeBlock - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ToolFakeConfig. */ - interface IToolFakeConfig { - - /** ToolFakeConfig codeBlock */ - codeBlock?: (google.cloud.ces.v1.ICodeBlock|null); - - /** ToolFakeConfig enableFakeMode */ - enableFakeMode?: (boolean|null); - } - - /** Represents a ToolFakeConfig. */ - class ToolFakeConfig implements IToolFakeConfig { - - /** - * Constructs a new ToolFakeConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IToolFakeConfig); - - /** ToolFakeConfig codeBlock. */ - public codeBlock?: (google.cloud.ces.v1.ICodeBlock|null); - - /** ToolFakeConfig enableFakeMode. */ - public enableFakeMode: boolean; - - /** ToolFakeConfig toolResponse. */ - public toolResponse?: "codeBlock"; - - /** - * Creates a new ToolFakeConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolFakeConfig instance - */ - public static create(properties?: google.cloud.ces.v1.IToolFakeConfig): google.cloud.ces.v1.ToolFakeConfig; - - /** - * Encodes the specified ToolFakeConfig message. Does not implicitly {@link google.cloud.ces.v1.ToolFakeConfig.verify|verify} messages. - * @param message ToolFakeConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IToolFakeConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolFakeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolFakeConfig.verify|verify} messages. - * @param message ToolFakeConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IToolFakeConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolFakeConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolFakeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ToolFakeConfig; - - /** - * Decodes a ToolFakeConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolFakeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ToolFakeConfig; - - /** - * Verifies a ToolFakeConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolFakeConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolFakeConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ToolFakeConfig; - - /** - * Creates a plain object from a ToolFakeConfig message. Also converts values to other types if specified. - * @param message ToolFakeConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ToolFakeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolFakeConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolFakeConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileSearchTool. */ - interface IFileSearchTool { - - /** FileSearchTool corpusType */ - corpusType?: (google.cloud.ces.v1.FileSearchTool.CorpusType|keyof typeof google.cloud.ces.v1.FileSearchTool.CorpusType|null); - - /** FileSearchTool name */ - name?: (string|null); - - /** FileSearchTool description */ - description?: (string|null); - - /** FileSearchTool fileCorpus */ - fileCorpus?: (string|null); - } - - /** Represents a FileSearchTool. */ - class FileSearchTool implements IFileSearchTool { - - /** - * Constructs a new FileSearchTool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IFileSearchTool); - - /** FileSearchTool corpusType. */ - public corpusType: (google.cloud.ces.v1.FileSearchTool.CorpusType|keyof typeof google.cloud.ces.v1.FileSearchTool.CorpusType); - - /** FileSearchTool name. */ - public name: string; - - /** FileSearchTool description. */ - public description: string; - - /** FileSearchTool fileCorpus. */ - public fileCorpus: string; - - /** - * Creates a new FileSearchTool instance using the specified properties. - * @param [properties] Properties to set - * @returns FileSearchTool instance - */ - public static create(properties?: google.cloud.ces.v1.IFileSearchTool): google.cloud.ces.v1.FileSearchTool; - - /** - * Encodes the specified FileSearchTool message. Does not implicitly {@link google.cloud.ces.v1.FileSearchTool.verify|verify} messages. - * @param message FileSearchTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IFileSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.FileSearchTool.verify|verify} messages. - * @param message FileSearchTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IFileSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileSearchTool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileSearchTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.FileSearchTool; - - /** - * Decodes a FileSearchTool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileSearchTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.FileSearchTool; - - /** - * Verifies a FileSearchTool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileSearchTool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileSearchTool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.FileSearchTool; - - /** - * Creates a plain object from a FileSearchTool message. Also converts values to other types if specified. - * @param message FileSearchTool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.FileSearchTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileSearchTool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileSearchTool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileSearchTool { - - /** CorpusType enum. */ - enum CorpusType { - CORPUS_TYPE_UNSPECIFIED = 0, - USER_OWNED = 1, - FULLY_MANAGED = 2 - } - } - - /** Properties of a GoogleSearchTool. */ - interface IGoogleSearchTool { - - /** GoogleSearchTool name */ - name?: (string|null); - - /** GoogleSearchTool description */ - description?: (string|null); - - /** GoogleSearchTool contextUrls */ - contextUrls?: (string[]|null); - - /** GoogleSearchTool preferredDomains */ - preferredDomains?: (string[]|null); - - /** GoogleSearchTool excludeDomains */ - excludeDomains?: (string[]|null); - - /** GoogleSearchTool promptConfig */ - promptConfig?: (google.cloud.ces.v1.GoogleSearchTool.IPromptConfig|null); - } - - /** Represents a GoogleSearchTool. */ - class GoogleSearchTool implements IGoogleSearchTool { - - /** - * Constructs a new GoogleSearchTool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IGoogleSearchTool); - - /** GoogleSearchTool name. */ - public name: string; - - /** GoogleSearchTool description. */ - public description: string; - - /** GoogleSearchTool contextUrls. */ - public contextUrls: string[]; - - /** GoogleSearchTool preferredDomains. */ - public preferredDomains: string[]; - - /** GoogleSearchTool excludeDomains. */ - public excludeDomains: string[]; - - /** GoogleSearchTool promptConfig. */ - public promptConfig?: (google.cloud.ces.v1.GoogleSearchTool.IPromptConfig|null); - - /** - * Creates a new GoogleSearchTool instance using the specified properties. - * @param [properties] Properties to set - * @returns GoogleSearchTool instance - */ - public static create(properties?: google.cloud.ces.v1.IGoogleSearchTool): google.cloud.ces.v1.GoogleSearchTool; - - /** - * Encodes the specified GoogleSearchTool message. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchTool.verify|verify} messages. - * @param message GoogleSearchTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IGoogleSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoogleSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchTool.verify|verify} messages. - * @param message GoogleSearchTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IGoogleSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoogleSearchTool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoogleSearchTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GoogleSearchTool; - - /** - * Decodes a GoogleSearchTool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoogleSearchTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GoogleSearchTool; - - /** - * Verifies a GoogleSearchTool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoogleSearchTool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoogleSearchTool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GoogleSearchTool; - - /** - * Creates a plain object from a GoogleSearchTool message. Also converts values to other types if specified. - * @param message GoogleSearchTool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.GoogleSearchTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoogleSearchTool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoogleSearchTool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GoogleSearchTool { - - /** Properties of a PromptConfig. */ - interface IPromptConfig { - - /** PromptConfig textPrompt */ - textPrompt?: (string|null); - - /** PromptConfig voicePrompt */ - voicePrompt?: (string|null); - } - - /** Represents a PromptConfig. */ - class PromptConfig implements IPromptConfig { - - /** - * Constructs a new PromptConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.GoogleSearchTool.IPromptConfig); - - /** PromptConfig textPrompt. */ - public textPrompt: string; - - /** PromptConfig voicePrompt. */ - public voicePrompt: string; - - /** - * Creates a new PromptConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PromptConfig instance - */ - public static create(properties?: google.cloud.ces.v1.GoogleSearchTool.IPromptConfig): google.cloud.ces.v1.GoogleSearchTool.PromptConfig; - - /** - * Encodes the specified PromptConfig message. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchTool.PromptConfig.verify|verify} messages. - * @param message PromptConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.GoogleSearchTool.IPromptConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PromptConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchTool.PromptConfig.verify|verify} messages. - * @param message PromptConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.GoogleSearchTool.IPromptConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PromptConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PromptConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GoogleSearchTool.PromptConfig; - - /** - * Decodes a PromptConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PromptConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GoogleSearchTool.PromptConfig; - - /** - * Verifies a PromptConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PromptConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PromptConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GoogleSearchTool.PromptConfig; - - /** - * Creates a plain object from a PromptConfig message. Also converts values to other types if specified. - * @param message PromptConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.GoogleSearchTool.PromptConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PromptConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PromptConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a McpTool. */ - interface IMcpTool { - - /** McpTool name */ - name?: (string|null); - - /** McpTool description */ - description?: (string|null); - - /** McpTool inputSchema */ - inputSchema?: (google.cloud.ces.v1.ISchema|null); - - /** McpTool outputSchema */ - outputSchema?: (google.cloud.ces.v1.ISchema|null); - - /** McpTool serverAddress */ - serverAddress?: (string|null); - - /** McpTool apiAuthentication */ - apiAuthentication?: (google.cloud.ces.v1.IApiAuthentication|null); - - /** McpTool tlsConfig */ - tlsConfig?: (google.cloud.ces.v1.ITlsConfig|null); - - /** McpTool serviceDirectoryConfig */ - serviceDirectoryConfig?: (google.cloud.ces.v1.IServiceDirectoryConfig|null); - } - - /** Represents a McpTool. */ - class McpTool implements IMcpTool { - - /** - * Constructs a new McpTool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IMcpTool); - - /** McpTool name. */ - public name: string; - - /** McpTool description. */ - public description: string; - - /** McpTool inputSchema. */ - public inputSchema?: (google.cloud.ces.v1.ISchema|null); - - /** McpTool outputSchema. */ - public outputSchema?: (google.cloud.ces.v1.ISchema|null); - - /** McpTool serverAddress. */ - public serverAddress: string; - - /** McpTool apiAuthentication. */ - public apiAuthentication?: (google.cloud.ces.v1.IApiAuthentication|null); - - /** McpTool tlsConfig. */ - public tlsConfig?: (google.cloud.ces.v1.ITlsConfig|null); - - /** McpTool serviceDirectoryConfig. */ - public serviceDirectoryConfig?: (google.cloud.ces.v1.IServiceDirectoryConfig|null); - - /** - * Creates a new McpTool instance using the specified properties. - * @param [properties] Properties to set - * @returns McpTool instance - */ - public static create(properties?: google.cloud.ces.v1.IMcpTool): google.cloud.ces.v1.McpTool; - - /** - * Encodes the specified McpTool message. Does not implicitly {@link google.cloud.ces.v1.McpTool.verify|verify} messages. - * @param message McpTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IMcpTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified McpTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.McpTool.verify|verify} messages. - * @param message McpTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IMcpTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a McpTool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns McpTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.McpTool; - - /** - * Decodes a McpTool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns McpTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.McpTool; - - /** - * Verifies a McpTool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a McpTool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns McpTool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.McpTool; - - /** - * Creates a plain object from a McpTool message. Also converts values to other types if specified. - * @param message McpTool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.McpTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this McpTool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for McpTool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OpenApiTool. */ - interface IOpenApiTool { - - /** OpenApiTool openApiSchema */ - openApiSchema?: (string|null); - - /** OpenApiTool name */ - name?: (string|null); - - /** OpenApiTool description */ - description?: (string|null); - - /** OpenApiTool apiAuthentication */ - apiAuthentication?: (google.cloud.ces.v1.IApiAuthentication|null); - - /** OpenApiTool tlsConfig */ - tlsConfig?: (google.cloud.ces.v1.ITlsConfig|null); - - /** OpenApiTool serviceDirectoryConfig */ - serviceDirectoryConfig?: (google.cloud.ces.v1.IServiceDirectoryConfig|null); - - /** OpenApiTool ignoreUnknownFields */ - ignoreUnknownFields?: (boolean|null); - - /** OpenApiTool url */ - url?: (string|null); - } - - /** Represents an OpenApiTool. */ - class OpenApiTool implements IOpenApiTool { - - /** - * Constructs a new OpenApiTool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IOpenApiTool); - - /** OpenApiTool openApiSchema. */ - public openApiSchema: string; - - /** OpenApiTool name. */ - public name: string; - - /** OpenApiTool description. */ - public description: string; - - /** OpenApiTool apiAuthentication. */ - public apiAuthentication?: (google.cloud.ces.v1.IApiAuthentication|null); - - /** OpenApiTool tlsConfig. */ - public tlsConfig?: (google.cloud.ces.v1.ITlsConfig|null); - - /** OpenApiTool serviceDirectoryConfig. */ - public serviceDirectoryConfig?: (google.cloud.ces.v1.IServiceDirectoryConfig|null); - - /** OpenApiTool ignoreUnknownFields. */ - public ignoreUnknownFields: boolean; - - /** OpenApiTool url. */ - public url: string; - - /** - * Creates a new OpenApiTool instance using the specified properties. - * @param [properties] Properties to set - * @returns OpenApiTool instance - */ - public static create(properties?: google.cloud.ces.v1.IOpenApiTool): google.cloud.ces.v1.OpenApiTool; - - /** - * Encodes the specified OpenApiTool message. Does not implicitly {@link google.cloud.ces.v1.OpenApiTool.verify|verify} messages. - * @param message OpenApiTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IOpenApiTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OpenApiTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OpenApiTool.verify|verify} messages. - * @param message OpenApiTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IOpenApiTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OpenApiTool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OpenApiTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OpenApiTool; - - /** - * Decodes an OpenApiTool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OpenApiTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OpenApiTool; - - /** - * Verifies an OpenApiTool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OpenApiTool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OpenApiTool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OpenApiTool; - - /** - * Creates a plain object from an OpenApiTool message. Also converts values to other types if specified. - * @param message OpenApiTool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.OpenApiTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OpenApiTool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OpenApiTool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonFunction. */ - interface IPythonFunction { - - /** PythonFunction name */ - name?: (string|null); - - /** PythonFunction pythonCode */ - pythonCode?: (string|null); - - /** PythonFunction description */ - description?: (string|null); - } - - /** Represents a PythonFunction. */ - class PythonFunction implements IPythonFunction { - - /** - * Constructs a new PythonFunction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IPythonFunction); - - /** PythonFunction name. */ - public name: string; - - /** PythonFunction pythonCode. */ - public pythonCode: string; - - /** PythonFunction description. */ - public description: string; - - /** - * Creates a new PythonFunction instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonFunction instance - */ - public static create(properties?: google.cloud.ces.v1.IPythonFunction): google.cloud.ces.v1.PythonFunction; - - /** - * Encodes the specified PythonFunction message. Does not implicitly {@link google.cloud.ces.v1.PythonFunction.verify|verify} messages. - * @param message PythonFunction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IPythonFunction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1.PythonFunction.verify|verify} messages. - * @param message PythonFunction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IPythonFunction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonFunction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonFunction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.PythonFunction; - - /** - * Decodes a PythonFunction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonFunction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.PythonFunction; - - /** - * Verifies a PythonFunction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PythonFunction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonFunction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.PythonFunction; - - /** - * Creates a plain object from a PythonFunction message. Also converts values to other types if specified. - * @param message PythonFunction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.PythonFunction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonFunction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonFunction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SystemTool. */ - interface ISystemTool { - - /** SystemTool name */ - name?: (string|null); - - /** SystemTool description */ - description?: (string|null); - } - - /** Represents a SystemTool. */ - class SystemTool implements ISystemTool { - - /** - * Constructs a new SystemTool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ISystemTool); - - /** SystemTool name. */ - public name: string; - - /** SystemTool description. */ - public description: string; - - /** - * Creates a new SystemTool instance using the specified properties. - * @param [properties] Properties to set - * @returns SystemTool instance - */ - public static create(properties?: google.cloud.ces.v1.ISystemTool): google.cloud.ces.v1.SystemTool; - - /** - * Encodes the specified SystemTool message. Does not implicitly {@link google.cloud.ces.v1.SystemTool.verify|verify} messages. - * @param message SystemTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ISystemTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SystemTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SystemTool.verify|verify} messages. - * @param message SystemTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ISystemTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SystemTool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SystemTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.SystemTool; - - /** - * Decodes a SystemTool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SystemTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.SystemTool; - - /** - * Verifies a SystemTool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SystemTool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SystemTool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.SystemTool; - - /** - * Creates a plain object from a SystemTool message. Also converts values to other types if specified. - * @param message SystemTool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.SystemTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SystemTool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SystemTool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WidgetTool. */ - interface IWidgetTool { - - /** WidgetTool parameters */ - parameters?: (google.cloud.ces.v1.ISchema|null); - - /** WidgetTool name */ - name?: (string|null); - - /** WidgetTool description */ - description?: (string|null); - - /** WidgetTool widgetType */ - widgetType?: (google.cloud.ces.v1.WidgetTool.WidgetType|keyof typeof google.cloud.ces.v1.WidgetTool.WidgetType|null); - } - - /** Represents a WidgetTool. */ - class WidgetTool implements IWidgetTool { - - /** - * Constructs a new WidgetTool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IWidgetTool); - - /** WidgetTool parameters. */ - public parameters?: (google.cloud.ces.v1.ISchema|null); - - /** WidgetTool name. */ - public name: string; - - /** WidgetTool description. */ - public description: string; - - /** WidgetTool widgetType. */ - public widgetType: (google.cloud.ces.v1.WidgetTool.WidgetType|keyof typeof google.cloud.ces.v1.WidgetTool.WidgetType); - - /** WidgetTool input. */ - public input?: "parameters"; - - /** - * Creates a new WidgetTool instance using the specified properties. - * @param [properties] Properties to set - * @returns WidgetTool instance - */ - public static create(properties?: google.cloud.ces.v1.IWidgetTool): google.cloud.ces.v1.WidgetTool; - - /** - * Encodes the specified WidgetTool message. Does not implicitly {@link google.cloud.ces.v1.WidgetTool.verify|verify} messages. - * @param message WidgetTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IWidgetTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WidgetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.WidgetTool.verify|verify} messages. - * @param message WidgetTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IWidgetTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WidgetTool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WidgetTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.WidgetTool; - - /** - * Decodes a WidgetTool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WidgetTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.WidgetTool; - - /** - * Verifies a WidgetTool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WidgetTool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WidgetTool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.WidgetTool; - - /** - * Creates a plain object from a WidgetTool message. Also converts values to other types if specified. - * @param message WidgetTool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.WidgetTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WidgetTool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WidgetTool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace WidgetTool { - - /** WidgetType enum. */ - enum WidgetType { - WIDGET_TYPE_UNSPECIFIED = 0, - CUSTOM = 1, - PRODUCT_CAROUSEL = 2, - PRODUCT_DETAILS = 3, - QUICK_ACTIONS = 4, - PRODUCT_COMPARISON = 5, - ADVANCED_PRODUCT_DETAILS = 6, - SHORT_FORM = 7, - OVERALL_SATISFACTION = 8, - ORDER_SUMMARY = 9, - APPOINTMENT_DETAILS = 10 - } - } - - /** Properties of a Toolset. */ - interface IToolset { - - /** Toolset mcpToolset */ - mcpToolset?: (google.cloud.ces.v1.IMcpToolset|null); - - /** Toolset openApiToolset */ - openApiToolset?: (google.cloud.ces.v1.IOpenApiToolset|null); - - /** Toolset connectorToolset */ - connectorToolset?: (google.cloud.ces.v1.IConnectorToolset|null); - - /** Toolset name */ - name?: (string|null); - - /** Toolset displayName */ - displayName?: (string|null); - - /** Toolset description */ - description?: (string|null); - - /** Toolset createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Toolset updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Toolset etag */ - etag?: (string|null); - - /** Toolset executionType */ - executionType?: (google.cloud.ces.v1.ExecutionType|keyof typeof google.cloud.ces.v1.ExecutionType|null); - - /** Toolset toolFakeConfig */ - toolFakeConfig?: (google.cloud.ces.v1.IToolFakeConfig|null); - } - - /** Represents a Toolset. */ - class Toolset implements IToolset { - - /** - * Constructs a new Toolset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IToolset); - - /** Toolset mcpToolset. */ - public mcpToolset?: (google.cloud.ces.v1.IMcpToolset|null); - - /** Toolset openApiToolset. */ - public openApiToolset?: (google.cloud.ces.v1.IOpenApiToolset|null); - - /** Toolset connectorToolset. */ - public connectorToolset?: (google.cloud.ces.v1.IConnectorToolset|null); - - /** Toolset name. */ - public name: string; - - /** Toolset displayName. */ - public displayName: string; - - /** Toolset description. */ - public description: string; - - /** Toolset createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Toolset updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Toolset etag. */ - public etag: string; - - /** Toolset executionType. */ - public executionType: (google.cloud.ces.v1.ExecutionType|keyof typeof google.cloud.ces.v1.ExecutionType); - - /** Toolset toolFakeConfig. */ - public toolFakeConfig?: (google.cloud.ces.v1.IToolFakeConfig|null); - - /** Toolset toolsetType. */ - public toolsetType?: ("mcpToolset"|"openApiToolset"|"connectorToolset"); - - /** - * Creates a new Toolset instance using the specified properties. - * @param [properties] Properties to set - * @returns Toolset instance - */ - public static create(properties?: google.cloud.ces.v1.IToolset): google.cloud.ces.v1.Toolset; - - /** - * Encodes the specified Toolset message. Does not implicitly {@link google.cloud.ces.v1.Toolset.verify|verify} messages. - * @param message Toolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Toolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Toolset.verify|verify} messages. - * @param message Toolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Toolset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Toolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Toolset; - - /** - * Decodes a Toolset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Toolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Toolset; - - /** - * Verifies a Toolset message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Toolset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Toolset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Toolset; - - /** - * Creates a plain object from a Toolset message. Also converts values to other types if specified. - * @param message Toolset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Toolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Toolset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Toolset - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ConnectorToolset. */ - interface IConnectorToolset { - - /** ConnectorToolset connection */ - connection?: (string|null); - - /** ConnectorToolset authConfig */ - authConfig?: (google.cloud.ces.v1.IEndUserAuthConfig|null); - - /** ConnectorToolset connectorActions */ - connectorActions?: (google.cloud.ces.v1.IAction[]|null); - } - - /** Represents a ConnectorToolset. */ - class ConnectorToolset implements IConnectorToolset { - - /** - * Constructs a new ConnectorToolset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IConnectorToolset); - - /** ConnectorToolset connection. */ - public connection: string; - - /** ConnectorToolset authConfig. */ - public authConfig?: (google.cloud.ces.v1.IEndUserAuthConfig|null); - - /** ConnectorToolset connectorActions. */ - public connectorActions: google.cloud.ces.v1.IAction[]; - - /** - * Creates a new ConnectorToolset instance using the specified properties. - * @param [properties] Properties to set - * @returns ConnectorToolset instance - */ - public static create(properties?: google.cloud.ces.v1.IConnectorToolset): google.cloud.ces.v1.ConnectorToolset; - - /** - * Encodes the specified ConnectorToolset message. Does not implicitly {@link google.cloud.ces.v1.ConnectorToolset.verify|verify} messages. - * @param message ConnectorToolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IConnectorToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConnectorToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ConnectorToolset.verify|verify} messages. - * @param message ConnectorToolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IConnectorToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConnectorToolset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConnectorToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ConnectorToolset; - - /** - * Decodes a ConnectorToolset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConnectorToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ConnectorToolset; - - /** - * Verifies a ConnectorToolset message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConnectorToolset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConnectorToolset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ConnectorToolset; - - /** - * Creates a plain object from a ConnectorToolset message. Also converts values to other types if specified. - * @param message ConnectorToolset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ConnectorToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConnectorToolset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConnectorToolset - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a McpToolset. */ - interface IMcpToolset { - - /** McpToolset serverAddress */ - serverAddress?: (string|null); - - /** McpToolset apiAuthentication */ - apiAuthentication?: (google.cloud.ces.v1.IApiAuthentication|null); - - /** McpToolset serviceDirectoryConfig */ - serviceDirectoryConfig?: (google.cloud.ces.v1.IServiceDirectoryConfig|null); - - /** McpToolset tlsConfig */ - tlsConfig?: (google.cloud.ces.v1.ITlsConfig|null); - } - - /** Represents a McpToolset. */ - class McpToolset implements IMcpToolset { - - /** - * Constructs a new McpToolset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IMcpToolset); - - /** McpToolset serverAddress. */ - public serverAddress: string; - - /** McpToolset apiAuthentication. */ - public apiAuthentication?: (google.cloud.ces.v1.IApiAuthentication|null); - - /** McpToolset serviceDirectoryConfig. */ - public serviceDirectoryConfig?: (google.cloud.ces.v1.IServiceDirectoryConfig|null); - - /** McpToolset tlsConfig. */ - public tlsConfig?: (google.cloud.ces.v1.ITlsConfig|null); - - /** - * Creates a new McpToolset instance using the specified properties. - * @param [properties] Properties to set - * @returns McpToolset instance - */ - public static create(properties?: google.cloud.ces.v1.IMcpToolset): google.cloud.ces.v1.McpToolset; - - /** - * Encodes the specified McpToolset message. Does not implicitly {@link google.cloud.ces.v1.McpToolset.verify|verify} messages. - * @param message McpToolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IMcpToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified McpToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.McpToolset.verify|verify} messages. - * @param message McpToolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IMcpToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a McpToolset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns McpToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.McpToolset; - - /** - * Decodes a McpToolset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns McpToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.McpToolset; - - /** - * Verifies a McpToolset message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a McpToolset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns McpToolset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.McpToolset; - - /** - * Creates a plain object from a McpToolset message. Also converts values to other types if specified. - * @param message McpToolset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.McpToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this McpToolset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for McpToolset - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OpenApiToolset. */ - interface IOpenApiToolset { - - /** OpenApiToolset openApiSchema */ - openApiSchema?: (string|null); - - /** OpenApiToolset apiAuthentication */ - apiAuthentication?: (google.cloud.ces.v1.IApiAuthentication|null); - - /** OpenApiToolset tlsConfig */ - tlsConfig?: (google.cloud.ces.v1.ITlsConfig|null); - - /** OpenApiToolset serviceDirectoryConfig */ - serviceDirectoryConfig?: (google.cloud.ces.v1.IServiceDirectoryConfig|null); - - /** OpenApiToolset ignoreUnknownFields */ - ignoreUnknownFields?: (boolean|null); - - /** OpenApiToolset url */ - url?: (string|null); - } - - /** Represents an OpenApiToolset. */ - class OpenApiToolset implements IOpenApiToolset { - - /** - * Constructs a new OpenApiToolset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IOpenApiToolset); - - /** OpenApiToolset openApiSchema. */ - public openApiSchema: string; - - /** OpenApiToolset apiAuthentication. */ - public apiAuthentication?: (google.cloud.ces.v1.IApiAuthentication|null); - - /** OpenApiToolset tlsConfig. */ - public tlsConfig?: (google.cloud.ces.v1.ITlsConfig|null); - - /** OpenApiToolset serviceDirectoryConfig. */ - public serviceDirectoryConfig?: (google.cloud.ces.v1.IServiceDirectoryConfig|null); - - /** OpenApiToolset ignoreUnknownFields. */ - public ignoreUnknownFields: boolean; - - /** OpenApiToolset url. */ - public url: string; - - /** - * Creates a new OpenApiToolset instance using the specified properties. - * @param [properties] Properties to set - * @returns OpenApiToolset instance - */ - public static create(properties?: google.cloud.ces.v1.IOpenApiToolset): google.cloud.ces.v1.OpenApiToolset; - - /** - * Encodes the specified OpenApiToolset message. Does not implicitly {@link google.cloud.ces.v1.OpenApiToolset.verify|verify} messages. - * @param message OpenApiToolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IOpenApiToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OpenApiToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OpenApiToolset.verify|verify} messages. - * @param message OpenApiToolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IOpenApiToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OpenApiToolset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OpenApiToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OpenApiToolset; - - /** - * Decodes an OpenApiToolset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OpenApiToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OpenApiToolset; - - /** - * Verifies an OpenApiToolset message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OpenApiToolset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OpenApiToolset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OpenApiToolset; - - /** - * Creates a plain object from an OpenApiToolset message. Also converts values to other types if specified. - * @param message OpenApiToolset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.OpenApiToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OpenApiToolset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OpenApiToolset - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Changelog. */ - interface IChangelog { - - /** Changelog name */ - name?: (string|null); - - /** Changelog author */ - author?: (string|null); - - /** Changelog displayName */ - displayName?: (string|null); - - /** Changelog description */ - description?: (string|null); - - /** Changelog resource */ - resource?: (string|null); - - /** Changelog resourceType */ - resourceType?: (string|null); - - /** Changelog action */ - action?: (string|null); - - /** Changelog originalResource */ - originalResource?: (google.protobuf.IStruct|null); - - /** Changelog newResource */ - newResource?: (google.protobuf.IStruct|null); - - /** Changelog dependentResources */ - dependentResources?: (google.protobuf.IStruct[]|null); - - /** Changelog createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Changelog sequenceNumber */ - sequenceNumber?: (number|Long|string|null); - } - - /** Represents a Changelog. */ - class Changelog implements IChangelog { - - /** - * Constructs a new Changelog. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IChangelog); - - /** Changelog name. */ - public name: string; - - /** Changelog author. */ - public author: string; - - /** Changelog displayName. */ - public displayName: string; - - /** Changelog description. */ - public description: string; - - /** Changelog resource. */ - public resource: string; - - /** Changelog resourceType. */ - public resourceType: string; - - /** Changelog action. */ - public action: string; - - /** Changelog originalResource. */ - public originalResource?: (google.protobuf.IStruct|null); - - /** Changelog newResource. */ - public newResource?: (google.protobuf.IStruct|null); - - /** Changelog dependentResources. */ - public dependentResources: google.protobuf.IStruct[]; - - /** Changelog createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Changelog sequenceNumber. */ - public sequenceNumber: (number|Long|string); - - /** - * Creates a new Changelog instance using the specified properties. - * @param [properties] Properties to set - * @returns Changelog instance - */ - public static create(properties?: google.cloud.ces.v1.IChangelog): google.cloud.ces.v1.Changelog; - - /** - * Encodes the specified Changelog message. Does not implicitly {@link google.cloud.ces.v1.Changelog.verify|verify} messages. - * @param message Changelog message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IChangelog, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Changelog message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Changelog.verify|verify} messages. - * @param message Changelog message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IChangelog, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Changelog message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Changelog - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Changelog; - - /** - * Decodes a Changelog message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Changelog - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Changelog; - - /** - * Verifies a Changelog message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Changelog message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Changelog - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Changelog; - - /** - * Creates a plain object from a Changelog message. Also converts values to other types if specified. - * @param message Changelog - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Changelog, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Changelog to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Changelog - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Conversation. */ - interface IConversation { - - /** Conversation name */ - name?: (string|null); - - /** Conversation startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** Conversation endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** Conversation turns */ - turns?: (google.cloud.ces.v1.Conversation.ITurn[]|null); - - /** Conversation turnCount */ - turnCount?: (number|null); - - /** Conversation channelType */ - channelType?: (google.cloud.ces.v1.Conversation.ChannelType|keyof typeof google.cloud.ces.v1.Conversation.ChannelType|null); - - /** Conversation source */ - source?: (google.cloud.ces.v1.Conversation.Source|keyof typeof google.cloud.ces.v1.Conversation.Source|null); - - /** Conversation inputTypes */ - inputTypes?: (google.cloud.ces.v1.Conversation.InputType[]|null); - - /** Conversation entryAgent */ - entryAgent?: (string|null); - - /** Conversation deployment */ - deployment?: (string|null); - - /** Conversation appVersion */ - appVersion?: (string|null); - - /** Conversation languageCode */ - languageCode?: (string|null); - - /** Conversation messages */ - messages?: (google.cloud.ces.v1.IMessage[]|null); - } - - /** Represents a Conversation. */ - class Conversation implements IConversation { - - /** - * Constructs a new Conversation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IConversation); - - /** Conversation name. */ - public name: string; - - /** Conversation startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** Conversation endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** Conversation turns. */ - public turns: google.cloud.ces.v1.Conversation.ITurn[]; - - /** Conversation turnCount. */ - public turnCount: number; - - /** Conversation channelType. */ - public channelType: (google.cloud.ces.v1.Conversation.ChannelType|keyof typeof google.cloud.ces.v1.Conversation.ChannelType); - - /** Conversation source. */ - public source: (google.cloud.ces.v1.Conversation.Source|keyof typeof google.cloud.ces.v1.Conversation.Source); - - /** Conversation inputTypes. */ - public inputTypes: google.cloud.ces.v1.Conversation.InputType[]; - - /** Conversation entryAgent. */ - public entryAgent: string; - - /** Conversation deployment. */ - public deployment: string; - - /** Conversation appVersion. */ - public appVersion: string; - - /** Conversation languageCode. */ - public languageCode: string; - - /** Conversation messages. */ - public messages: google.cloud.ces.v1.IMessage[]; - - /** - * Creates a new Conversation instance using the specified properties. - * @param [properties] Properties to set - * @returns Conversation instance - */ - public static create(properties?: google.cloud.ces.v1.IConversation): google.cloud.ces.v1.Conversation; - - /** - * Encodes the specified Conversation message. Does not implicitly {@link google.cloud.ces.v1.Conversation.verify|verify} messages. - * @param message Conversation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Conversation message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Conversation.verify|verify} messages. - * @param message Conversation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Conversation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Conversation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Conversation; - - /** - * Decodes a Conversation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Conversation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Conversation; - - /** - * Verifies a Conversation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Conversation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Conversation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Conversation; - - /** - * Creates a plain object from a Conversation message. Also converts values to other types if specified. - * @param message Conversation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Conversation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Conversation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Conversation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Conversation { - - /** Properties of a Turn. */ - interface ITurn { - - /** Turn messages */ - messages?: (google.cloud.ces.v1.IMessage[]|null); - - /** Turn rootSpan */ - rootSpan?: (google.cloud.ces.v1.ISpan|null); - } - - /** Represents a Turn. */ - class Turn implements ITurn { - - /** - * Constructs a new Turn. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.Conversation.ITurn); - - /** Turn messages. */ - public messages: google.cloud.ces.v1.IMessage[]; - - /** Turn rootSpan. */ - public rootSpan?: (google.cloud.ces.v1.ISpan|null); - - /** - * Creates a new Turn instance using the specified properties. - * @param [properties] Properties to set - * @returns Turn instance - */ - public static create(properties?: google.cloud.ces.v1.Conversation.ITurn): google.cloud.ces.v1.Conversation.Turn; - - /** - * Encodes the specified Turn message. Does not implicitly {@link google.cloud.ces.v1.Conversation.Turn.verify|verify} messages. - * @param message Turn message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.Conversation.ITurn, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Turn message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Conversation.Turn.verify|verify} messages. - * @param message Turn message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.Conversation.ITurn, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Turn message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Turn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Conversation.Turn; - - /** - * Decodes a Turn message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Turn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Conversation.Turn; - - /** - * Verifies a Turn message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Turn message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Turn - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Conversation.Turn; - - /** - * Creates a plain object from a Turn message. Also converts values to other types if specified. - * @param message Turn - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Conversation.Turn, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Turn to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Turn - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** ChannelType enum. */ - enum ChannelType { - CHANNEL_TYPE_UNSPECIFIED = 0, - TEXT = 1, - AUDIO = 2, - MULTIMODAL = 3 - } - - /** Source enum. */ - enum Source { - SOURCE_UNSPECIFIED = 0, - LIVE = 1, - SIMULATOR = 2, - EVAL = 3 - } - - /** InputType enum. */ - enum InputType { - INPUT_TYPE_UNSPECIFIED = 0, - INPUT_TYPE_TEXT = 1, - INPUT_TYPE_AUDIO = 2, - INPUT_TYPE_IMAGE = 3, - INPUT_TYPE_BLOB = 4, - INPUT_TYPE_TOOL_RESPONSE = 5, - INPUT_TYPE_VARIABLES = 6 - } - } - - /** Properties of a Deployment. */ - interface IDeployment { - - /** Deployment name */ - name?: (string|null); - - /** Deployment displayName */ - displayName?: (string|null); - - /** Deployment appVersion */ - appVersion?: (string|null); - - /** Deployment channelProfile */ - channelProfile?: (google.cloud.ces.v1.IChannelProfile|null); - - /** Deployment createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Deployment updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Deployment etag */ - etag?: (string|null); - } - - /** Represents a Deployment. */ - class Deployment implements IDeployment { - - /** - * Constructs a new Deployment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IDeployment); - - /** Deployment name. */ - public name: string; - - /** Deployment displayName. */ - public displayName: string; - - /** Deployment appVersion. */ - public appVersion: string; - - /** Deployment channelProfile. */ - public channelProfile?: (google.cloud.ces.v1.IChannelProfile|null); - - /** Deployment createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Deployment updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Deployment etag. */ - public etag: string; - - /** - * Creates a new Deployment instance using the specified properties. - * @param [properties] Properties to set - * @returns Deployment instance - */ - public static create(properties?: google.cloud.ces.v1.IDeployment): google.cloud.ces.v1.Deployment; - - /** - * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.ces.v1.Deployment.verify|verify} messages. - * @param message Deployment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Deployment.verify|verify} messages. - * @param message Deployment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Deployment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Deployment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Deployment; - - /** - * Decodes a Deployment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Deployment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Deployment; - - /** - * Verifies a Deployment message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Deployment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Deployment - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Deployment; - - /** - * Creates a plain object from a Deployment message. Also converts values to other types if specified. - * @param message Deployment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Deployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Deployment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Deployment - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Omnichannel. */ - interface IOmnichannel { - - /** Omnichannel name */ - name?: (string|null); - - /** Omnichannel displayName */ - displayName?: (string|null); - - /** Omnichannel description */ - description?: (string|null); - - /** Omnichannel createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Omnichannel updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Omnichannel etag */ - etag?: (string|null); - - /** Omnichannel integrationConfig */ - integrationConfig?: (google.cloud.ces.v1.IOmnichannelIntegrationConfig|null); - } - - /** Represents an Omnichannel. */ - class Omnichannel implements IOmnichannel { - - /** - * Constructs a new Omnichannel. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IOmnichannel); - - /** Omnichannel name. */ - public name: string; - - /** Omnichannel displayName. */ - public displayName: string; - - /** Omnichannel description. */ - public description: string; - - /** Omnichannel createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Omnichannel updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Omnichannel etag. */ - public etag: string; - - /** Omnichannel integrationConfig. */ - public integrationConfig?: (google.cloud.ces.v1.IOmnichannelIntegrationConfig|null); - - /** - * Creates a new Omnichannel instance using the specified properties. - * @param [properties] Properties to set - * @returns Omnichannel instance - */ - public static create(properties?: google.cloud.ces.v1.IOmnichannel): google.cloud.ces.v1.Omnichannel; - - /** - * Encodes the specified Omnichannel message. Does not implicitly {@link google.cloud.ces.v1.Omnichannel.verify|verify} messages. - * @param message Omnichannel message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IOmnichannel, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Omnichannel message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Omnichannel.verify|verify} messages. - * @param message Omnichannel message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IOmnichannel, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Omnichannel message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Omnichannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Omnichannel; - - /** - * Decodes an Omnichannel message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Omnichannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Omnichannel; - - /** - * Verifies an Omnichannel message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Omnichannel message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Omnichannel - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Omnichannel; - - /** - * Creates a plain object from an Omnichannel message. Also converts values to other types if specified. - * @param message Omnichannel - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Omnichannel, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Omnichannel to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Omnichannel - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OmnichannelIntegrationConfig. */ - interface IOmnichannelIntegrationConfig { - - /** OmnichannelIntegrationConfig channelConfigs */ - channelConfigs?: ({ [k: string]: google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig }|null); - - /** OmnichannelIntegrationConfig subscriberConfigs */ - subscriberConfigs?: ({ [k: string]: google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig }|null); - - /** OmnichannelIntegrationConfig routingConfigs */ - routingConfigs?: ({ [k: string]: google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig }|null); - } - - /** Represents an OmnichannelIntegrationConfig. */ - class OmnichannelIntegrationConfig implements IOmnichannelIntegrationConfig { - - /** - * Constructs a new OmnichannelIntegrationConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IOmnichannelIntegrationConfig); - - /** OmnichannelIntegrationConfig channelConfigs. */ - public channelConfigs: { [k: string]: google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig }; - - /** OmnichannelIntegrationConfig subscriberConfigs. */ - public subscriberConfigs: { [k: string]: google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig }; - - /** OmnichannelIntegrationConfig routingConfigs. */ - public routingConfigs: { [k: string]: google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig }; - - /** - * Creates a new OmnichannelIntegrationConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns OmnichannelIntegrationConfig instance - */ - public static create(properties?: google.cloud.ces.v1.IOmnichannelIntegrationConfig): google.cloud.ces.v1.OmnichannelIntegrationConfig; - - /** - * Encodes the specified OmnichannelIntegrationConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.verify|verify} messages. - * @param message OmnichannelIntegrationConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IOmnichannelIntegrationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OmnichannelIntegrationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.verify|verify} messages. - * @param message OmnichannelIntegrationConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IOmnichannelIntegrationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OmnichannelIntegrationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OmnichannelIntegrationConfig; - - /** - * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OmnichannelIntegrationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OmnichannelIntegrationConfig; - - /** - * Verifies an OmnichannelIntegrationConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OmnichannelIntegrationConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OmnichannelIntegrationConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OmnichannelIntegrationConfig; - - /** - * Creates a plain object from an OmnichannelIntegrationConfig message. Also converts values to other types if specified. - * @param message OmnichannelIntegrationConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.OmnichannelIntegrationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OmnichannelIntegrationConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OmnichannelIntegrationConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace OmnichannelIntegrationConfig { - - /** Properties of a ChannelConfig. */ - interface IChannelConfig { - - /** ChannelConfig whatsappConfig */ - whatsappConfig?: (google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig|null); - } - - /** Represents a ChannelConfig. */ - class ChannelConfig implements IChannelConfig { - - /** - * Constructs a new ChannelConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig); - - /** ChannelConfig whatsappConfig. */ - public whatsappConfig?: (google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig|null); - - /** ChannelConfig channelConfig. */ - public channelConfig?: "whatsappConfig"; - - /** - * Creates a new ChannelConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ChannelConfig instance - */ - public static create(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig): google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig; - - /** - * Encodes the specified ChannelConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. - * @param message ChannelConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChannelConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. - * @param message ChannelConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChannelConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChannelConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig; - - /** - * Decodes a ChannelConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChannelConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig; - - /** - * Verifies a ChannelConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ChannelConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChannelConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig; - - /** - * Creates a plain object from a ChannelConfig message. Also converts values to other types if specified. - * @param message ChannelConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChannelConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ChannelConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WhatsappConfig. */ - interface IWhatsappConfig { - - /** WhatsappConfig phoneNumberId */ - phoneNumberId?: (string|null); - - /** WhatsappConfig phoneNumber */ - phoneNumber?: (string|null); - - /** WhatsappConfig whatsappBusinessAccountId */ - whatsappBusinessAccountId?: (string|null); - - /** WhatsappConfig webhookVerifyToken */ - webhookVerifyToken?: (string|null); - - /** WhatsappConfig whatsappBusinessToken */ - whatsappBusinessToken?: (string|null); - - /** WhatsappConfig metaBusinessPortfolioId */ - metaBusinessPortfolioId?: (string|null); - } - - /** Represents a WhatsappConfig. */ - class WhatsappConfig implements IWhatsappConfig { - - /** - * Constructs a new WhatsappConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig); - - /** WhatsappConfig phoneNumberId. */ - public phoneNumberId: string; - - /** WhatsappConfig phoneNumber. */ - public phoneNumber: string; - - /** WhatsappConfig whatsappBusinessAccountId. */ - public whatsappBusinessAccountId: string; - - /** WhatsappConfig webhookVerifyToken. */ - public webhookVerifyToken: string; - - /** WhatsappConfig whatsappBusinessToken. */ - public whatsappBusinessToken: string; - - /** WhatsappConfig metaBusinessPortfolioId. */ - public metaBusinessPortfolioId: string; - - /** - * Creates a new WhatsappConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns WhatsappConfig instance - */ - public static create(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig): google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig; - - /** - * Encodes the specified WhatsappConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. - * @param message WhatsappConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WhatsappConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. - * @param message WhatsappConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WhatsappConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WhatsappConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig; - - /** - * Decodes a WhatsappConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WhatsappConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig; - - /** - * Verifies a WhatsappConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WhatsappConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WhatsappConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig; - - /** - * Creates a plain object from a WhatsappConfig message. Also converts values to other types if specified. - * @param message WhatsappConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WhatsappConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WhatsappConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SubscriberConfig. */ - interface ISubscriberConfig { - - /** SubscriberConfig cesAppConfig */ - cesAppConfig?: (google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig|null); - } - - /** Represents a SubscriberConfig. */ - class SubscriberConfig implements ISubscriberConfig { - - /** - * Constructs a new SubscriberConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig); - - /** SubscriberConfig cesAppConfig. */ - public cesAppConfig?: (google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig|null); - - /** SubscriberConfig subscriberConfig. */ - public subscriberConfig?: "cesAppConfig"; - - /** - * Creates a new SubscriberConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SubscriberConfig instance - */ - public static create(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig): google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig; - - /** - * Encodes the specified SubscriberConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. - * @param message SubscriberConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SubscriberConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. - * @param message SubscriberConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SubscriberConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SubscriberConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig; - - /** - * Decodes a SubscriberConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SubscriberConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig; - - /** - * Verifies a SubscriberConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SubscriberConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SubscriberConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig; - - /** - * Creates a plain object from a SubscriberConfig message. Also converts values to other types if specified. - * @param message SubscriberConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SubscriberConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SubscriberConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CesAppConfig. */ - interface ICesAppConfig { - - /** CesAppConfig app */ - app?: (string|null); - } - - /** Represents a CesAppConfig. */ - class CesAppConfig implements ICesAppConfig { - - /** - * Constructs a new CesAppConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig); - - /** CesAppConfig app. */ - public app: string; - - /** - * Creates a new CesAppConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns CesAppConfig instance - */ - public static create(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig): google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig; - - /** - * Encodes the specified CesAppConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. - * @param message CesAppConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CesAppConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. - * @param message CesAppConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CesAppConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CesAppConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig; - - /** - * Decodes a CesAppConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CesAppConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig; - - /** - * Verifies a CesAppConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CesAppConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CesAppConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig; - - /** - * Creates a plain object from a CesAppConfig message. Also converts values to other types if specified. - * @param message CesAppConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CesAppConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CesAppConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RoutingConfig. */ - interface IRoutingConfig { - - /** RoutingConfig subscriberKey */ - subscriberKey?: (string|null); - } - - /** Represents a RoutingConfig. */ - class RoutingConfig implements IRoutingConfig { - - /** - * Constructs a new RoutingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig); - - /** RoutingConfig subscriberKey. */ - public subscriberKey: string; - - /** - * Creates a new RoutingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns RoutingConfig instance - */ - public static create(properties?: google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig): google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig; - - /** - * Encodes the specified RoutingConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. - * @param message RoutingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RoutingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. - * @param message RoutingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RoutingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RoutingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig; - - /** - * Decodes a RoutingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RoutingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig; - - /** - * Verifies a RoutingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RoutingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RoutingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig; - - /** - * Creates a plain object from a RoutingConfig message. Also converts values to other types if specified. - * @param message RoutingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RoutingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RoutingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OmnichannelOperationMetadata. */ - interface IOmnichannelOperationMetadata { - - /** OmnichannelOperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** OmnichannelOperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** OmnichannelOperationMetadata statusMessage */ - statusMessage?: (string|null); - - /** OmnichannelOperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); - } - - /** Represents an OmnichannelOperationMetadata. */ - class OmnichannelOperationMetadata implements IOmnichannelOperationMetadata { - - /** - * Constructs a new OmnichannelOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IOmnichannelOperationMetadata); - - /** OmnichannelOperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OmnichannelOperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OmnichannelOperationMetadata statusMessage. */ - public statusMessage: string; - - /** OmnichannelOperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; - - /** - * Creates a new OmnichannelOperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns OmnichannelOperationMetadata instance - */ - public static create(properties?: google.cloud.ces.v1.IOmnichannelOperationMetadata): google.cloud.ces.v1.OmnichannelOperationMetadata; - - /** - * Encodes the specified OmnichannelOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelOperationMetadata.verify|verify} messages. - * @param message OmnichannelOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IOmnichannelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OmnichannelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelOperationMetadata.verify|verify} messages. - * @param message OmnichannelOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IOmnichannelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OmnichannelOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OmnichannelOperationMetadata; - - /** - * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OmnichannelOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OmnichannelOperationMetadata; - - /** - * Verifies an OmnichannelOperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OmnichannelOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OmnichannelOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OmnichannelOperationMetadata; - - /** - * Creates a plain object from an OmnichannelOperationMetadata message. Also converts values to other types if specified. - * @param message OmnichannelOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.OmnichannelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OmnichannelOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OmnichannelOperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoogleSearchSuggestions. */ - interface IGoogleSearchSuggestions { - - /** GoogleSearchSuggestions htmls */ - htmls?: (string[]|null); - - /** GoogleSearchSuggestions webSearchQueries */ - webSearchQueries?: (google.cloud.ces.v1.IWebSearchQuery[]|null); - } - - /** Represents a GoogleSearchSuggestions. */ - class GoogleSearchSuggestions implements IGoogleSearchSuggestions { - - /** - * Constructs a new GoogleSearchSuggestions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IGoogleSearchSuggestions); - - /** GoogleSearchSuggestions htmls. */ - public htmls: string[]; - - /** GoogleSearchSuggestions webSearchQueries. */ - public webSearchQueries: google.cloud.ces.v1.IWebSearchQuery[]; - - /** - * Creates a new GoogleSearchSuggestions instance using the specified properties. - * @param [properties] Properties to set - * @returns GoogleSearchSuggestions instance - */ - public static create(properties?: google.cloud.ces.v1.IGoogleSearchSuggestions): google.cloud.ces.v1.GoogleSearchSuggestions; - - /** - * Encodes the specified GoogleSearchSuggestions message. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchSuggestions.verify|verify} messages. - * @param message GoogleSearchSuggestions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IGoogleSearchSuggestions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoogleSearchSuggestions message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchSuggestions.verify|verify} messages. - * @param message GoogleSearchSuggestions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IGoogleSearchSuggestions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoogleSearchSuggestions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoogleSearchSuggestions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GoogleSearchSuggestions; - - /** - * Decodes a GoogleSearchSuggestions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoogleSearchSuggestions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GoogleSearchSuggestions; - - /** - * Verifies a GoogleSearchSuggestions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoogleSearchSuggestions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoogleSearchSuggestions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GoogleSearchSuggestions; - - /** - * Creates a plain object from a GoogleSearchSuggestions message. Also converts values to other types if specified. - * @param message GoogleSearchSuggestions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.GoogleSearchSuggestions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoogleSearchSuggestions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoogleSearchSuggestions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WebSearchQuery. */ - interface IWebSearchQuery { - - /** WebSearchQuery query */ - query?: (string|null); - - /** WebSearchQuery uri */ - uri?: (string|null); - } - - /** Represents a WebSearchQuery. */ - class WebSearchQuery implements IWebSearchQuery { - - /** - * Constructs a new WebSearchQuery. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IWebSearchQuery); - - /** WebSearchQuery query. */ - public query: string; - - /** WebSearchQuery uri. */ - public uri: string; - - /** - * Creates a new WebSearchQuery instance using the specified properties. - * @param [properties] Properties to set - * @returns WebSearchQuery instance - */ - public static create(properties?: google.cloud.ces.v1.IWebSearchQuery): google.cloud.ces.v1.WebSearchQuery; - - /** - * Encodes the specified WebSearchQuery message. Does not implicitly {@link google.cloud.ces.v1.WebSearchQuery.verify|verify} messages. - * @param message WebSearchQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IWebSearchQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WebSearchQuery message, length delimited. Does not implicitly {@link google.cloud.ces.v1.WebSearchQuery.verify|verify} messages. - * @param message WebSearchQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IWebSearchQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WebSearchQuery message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WebSearchQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.WebSearchQuery; - - /** - * Decodes a WebSearchQuery message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WebSearchQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.WebSearchQuery; - - /** - * Verifies a WebSearchQuery message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WebSearchQuery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WebSearchQuery - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.WebSearchQuery; - - /** - * Creates a plain object from a WebSearchQuery message. Also converts values to other types if specified. - * @param message WebSearchQuery - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.WebSearchQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WebSearchQuery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WebSearchQuery - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a SessionService */ - class SessionService extends $protobuf.rpc.Service { - - /** - * Constructs a new SessionService 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 SessionService 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): SessionService; - - /** - * Calls RunSession. - * @param request RunSessionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RunSessionResponse - */ - public runSession(request: google.cloud.ces.v1.IRunSessionRequest, callback: google.cloud.ces.v1.SessionService.RunSessionCallback): void; - - /** - * Calls RunSession. - * @param request RunSessionRequest message or plain object - * @returns Promise - */ - public runSession(request: google.cloud.ces.v1.IRunSessionRequest): Promise; - - /** - * Calls BidiRunSession. - * @param request BidiSessionClientMessage message or plain object - * @param callback Node-style callback called with the error, if any, and BidiSessionServerMessage - */ - public bidiRunSession(request: google.cloud.ces.v1.IBidiSessionClientMessage, callback: google.cloud.ces.v1.SessionService.BidiRunSessionCallback): void; - - /** - * Calls BidiRunSession. - * @param request BidiSessionClientMessage message or plain object - * @returns Promise - */ - public bidiRunSession(request: google.cloud.ces.v1.IBidiSessionClientMessage): Promise; - } - - namespace SessionService { - - /** - * Callback as used by {@link google.cloud.ces.v1.SessionService|runSession}. - * @param error Error, if any - * @param [response] RunSessionResponse - */ - type RunSessionCallback = (error: (Error|null), response?: google.cloud.ces.v1.RunSessionResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.SessionService|bidiRunSession}. - * @param error Error, if any - * @param [response] BidiSessionServerMessage - */ - type BidiRunSessionCallback = (error: (Error|null), response?: google.cloud.ces.v1.BidiSessionServerMessage) => void; - } - - /** AudioEncoding enum. */ - enum AudioEncoding { - AUDIO_ENCODING_UNSPECIFIED = 0, - LINEAR16 = 1, - MULAW = 2, - ALAW = 3 - } - - /** Properties of an InputAudioConfig. */ - interface IInputAudioConfig { - - /** InputAudioConfig audioEncoding */ - audioEncoding?: (google.cloud.ces.v1.AudioEncoding|keyof typeof google.cloud.ces.v1.AudioEncoding|null); - - /** InputAudioConfig sampleRateHertz */ - sampleRateHertz?: (number|null); - - /** InputAudioConfig noiseSuppressionLevel */ - noiseSuppressionLevel?: (string|null); - } - - /** Represents an InputAudioConfig. */ - class InputAudioConfig implements IInputAudioConfig { - - /** - * Constructs a new InputAudioConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IInputAudioConfig); - - /** InputAudioConfig audioEncoding. */ - public audioEncoding: (google.cloud.ces.v1.AudioEncoding|keyof typeof google.cloud.ces.v1.AudioEncoding); - - /** InputAudioConfig sampleRateHertz. */ - public sampleRateHertz: number; - - /** InputAudioConfig noiseSuppressionLevel. */ - public noiseSuppressionLevel: string; - - /** - * Creates a new InputAudioConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns InputAudioConfig instance - */ - public static create(properties?: google.cloud.ces.v1.IInputAudioConfig): google.cloud.ces.v1.InputAudioConfig; - - /** - * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1.InputAudioConfig.verify|verify} messages. - * @param message InputAudioConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.InputAudioConfig.verify|verify} messages. - * @param message InputAudioConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InputAudioConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InputAudioConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.InputAudioConfig; - - /** - * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InputAudioConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.InputAudioConfig; - - /** - * Verifies an InputAudioConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InputAudioConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.InputAudioConfig; - - /** - * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. - * @param message InputAudioConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.InputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InputAudioConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InputAudioConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OutputAudioConfig. */ - interface IOutputAudioConfig { - - /** OutputAudioConfig audioEncoding */ - audioEncoding?: (google.cloud.ces.v1.AudioEncoding|keyof typeof google.cloud.ces.v1.AudioEncoding|null); - - /** OutputAudioConfig sampleRateHertz */ - sampleRateHertz?: (number|null); - } - - /** Represents an OutputAudioConfig. */ - class OutputAudioConfig implements IOutputAudioConfig { - - /** - * Constructs a new OutputAudioConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IOutputAudioConfig); - - /** OutputAudioConfig audioEncoding. */ - public audioEncoding: (google.cloud.ces.v1.AudioEncoding|keyof typeof google.cloud.ces.v1.AudioEncoding); - - /** OutputAudioConfig sampleRateHertz. */ - public sampleRateHertz: number; - - /** - * Creates a new OutputAudioConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns OutputAudioConfig instance - */ - public static create(properties?: google.cloud.ces.v1.IOutputAudioConfig): google.cloud.ces.v1.OutputAudioConfig; - - /** - * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1.OutputAudioConfig.verify|verify} messages. - * @param message OutputAudioConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OutputAudioConfig.verify|verify} messages. - * @param message OutputAudioConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OutputAudioConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OutputAudioConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.OutputAudioConfig; - - /** - * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OutputAudioConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.OutputAudioConfig; - - /** - * Verifies an OutputAudioConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OutputAudioConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.OutputAudioConfig; - - /** - * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. - * @param message OutputAudioConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.OutputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OutputAudioConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OutputAudioConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SessionConfig. */ - interface ISessionConfig { - - /** SessionConfig session */ - session?: (string|null); - - /** SessionConfig inputAudioConfig */ - inputAudioConfig?: (google.cloud.ces.v1.IInputAudioConfig|null); - - /** SessionConfig outputAudioConfig */ - outputAudioConfig?: (google.cloud.ces.v1.IOutputAudioConfig|null); - - /** SessionConfig historicalContexts */ - historicalContexts?: (google.cloud.ces.v1.IMessage[]|null); - - /** SessionConfig entryAgent */ - entryAgent?: (string|null); - - /** SessionConfig deployment */ - deployment?: (string|null); - - /** SessionConfig timeZone */ - timeZone?: (string|null); - - /** SessionConfig remoteDialogflowQueryParameters */ - remoteDialogflowQueryParameters?: (google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters|null); - } - - /** Represents a SessionConfig. */ - class SessionConfig implements ISessionConfig { - - /** - * Constructs a new SessionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ISessionConfig); - - /** SessionConfig session. */ - public session: string; - - /** SessionConfig inputAudioConfig. */ - public inputAudioConfig?: (google.cloud.ces.v1.IInputAudioConfig|null); - - /** SessionConfig outputAudioConfig. */ - public outputAudioConfig?: (google.cloud.ces.v1.IOutputAudioConfig|null); - - /** SessionConfig historicalContexts. */ - public historicalContexts: google.cloud.ces.v1.IMessage[]; - - /** SessionConfig entryAgent. */ - public entryAgent: string; - - /** SessionConfig deployment. */ - public deployment: string; - - /** SessionConfig timeZone. */ - public timeZone: string; - - /** SessionConfig remoteDialogflowQueryParameters. */ - public remoteDialogflowQueryParameters?: (google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters|null); - - /** - * Creates a new SessionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SessionConfig instance - */ - public static create(properties?: google.cloud.ces.v1.ISessionConfig): google.cloud.ces.v1.SessionConfig; - - /** - * Encodes the specified SessionConfig message. Does not implicitly {@link google.cloud.ces.v1.SessionConfig.verify|verify} messages. - * @param message SessionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ISessionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SessionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionConfig.verify|verify} messages. - * @param message SessionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ISessionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SessionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SessionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.SessionConfig; - - /** - * Decodes a SessionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SessionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.SessionConfig; - - /** - * Verifies a SessionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SessionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SessionConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.SessionConfig; - - /** - * Creates a plain object from a SessionConfig message. Also converts values to other types if specified. - * @param message SessionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.SessionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SessionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SessionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SessionConfig { - - /** Properties of a RemoteDialogflowQueryParameters. */ - interface IRemoteDialogflowQueryParameters { - - /** RemoteDialogflowQueryParameters webhookHeaders */ - webhookHeaders?: ({ [k: string]: string }|null); - - /** RemoteDialogflowQueryParameters payload */ - payload?: (google.protobuf.IStruct|null); - - /** RemoteDialogflowQueryParameters endUserMetadata */ - endUserMetadata?: (google.protobuf.IStruct|null); - } - - /** Represents a RemoteDialogflowQueryParameters. */ - class RemoteDialogflowQueryParameters implements IRemoteDialogflowQueryParameters { - - /** - * Constructs a new RemoteDialogflowQueryParameters. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters); - - /** RemoteDialogflowQueryParameters webhookHeaders. */ - public webhookHeaders: { [k: string]: string }; - - /** RemoteDialogflowQueryParameters payload. */ - public payload?: (google.protobuf.IStruct|null); - - /** RemoteDialogflowQueryParameters endUserMetadata. */ - public endUserMetadata?: (google.protobuf.IStruct|null); - - /** - * Creates a new RemoteDialogflowQueryParameters instance using the specified properties. - * @param [properties] Properties to set - * @returns RemoteDialogflowQueryParameters instance - */ - public static create(properties?: google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters): google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters; - - /** - * Encodes the specified RemoteDialogflowQueryParameters message. Does not implicitly {@link google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. - * @param message RemoteDialogflowQueryParameters message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RemoteDialogflowQueryParameters message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. - * @param message RemoteDialogflowQueryParameters message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RemoteDialogflowQueryParameters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters; - - /** - * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RemoteDialogflowQueryParameters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters; - - /** - * Verifies a RemoteDialogflowQueryParameters message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RemoteDialogflowQueryParameters message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RemoteDialogflowQueryParameters - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters; - - /** - * Creates a plain object from a RemoteDialogflowQueryParameters message. Also converts values to other types if specified. - * @param message RemoteDialogflowQueryParameters - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RemoteDialogflowQueryParameters to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RemoteDialogflowQueryParameters - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ToolCalls. */ - interface IToolCalls { - - /** ToolCalls toolCalls */ - toolCalls?: (google.cloud.ces.v1.IToolCall[]|null); - } - - /** Represents a ToolCalls. */ - class ToolCalls implements IToolCalls { - - /** - * Constructs a new ToolCalls. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IToolCalls); - - /** ToolCalls toolCalls. */ - public toolCalls: google.cloud.ces.v1.IToolCall[]; - - /** - * Creates a new ToolCalls instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolCalls instance - */ - public static create(properties?: google.cloud.ces.v1.IToolCalls): google.cloud.ces.v1.ToolCalls; - - /** - * Encodes the specified ToolCalls message. Does not implicitly {@link google.cloud.ces.v1.ToolCalls.verify|verify} messages. - * @param message ToolCalls message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IToolCalls, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolCalls message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolCalls.verify|verify} messages. - * @param message ToolCalls message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IToolCalls, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolCalls message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolCalls - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ToolCalls; - - /** - * Decodes a ToolCalls message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolCalls - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ToolCalls; - - /** - * Verifies a ToolCalls message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolCalls message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolCalls - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ToolCalls; - - /** - * Creates a plain object from a ToolCalls message. Also converts values to other types if specified. - * @param message ToolCalls - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ToolCalls, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolCalls to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolCalls - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ToolResponses. */ - interface IToolResponses { - - /** ToolResponses toolResponses */ - toolResponses?: (google.cloud.ces.v1.IToolResponse[]|null); - } - - /** Represents a ToolResponses. */ - class ToolResponses implements IToolResponses { - - /** - * Constructs a new ToolResponses. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IToolResponses); - - /** ToolResponses toolResponses. */ - public toolResponses: google.cloud.ces.v1.IToolResponse[]; - - /** - * Creates a new ToolResponses instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolResponses instance - */ - public static create(properties?: google.cloud.ces.v1.IToolResponses): google.cloud.ces.v1.ToolResponses; - - /** - * Encodes the specified ToolResponses message. Does not implicitly {@link google.cloud.ces.v1.ToolResponses.verify|verify} messages. - * @param message ToolResponses message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IToolResponses, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolResponses message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolResponses.verify|verify} messages. - * @param message ToolResponses message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IToolResponses, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolResponses message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolResponses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ToolResponses; - - /** - * Decodes a ToolResponses message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolResponses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ToolResponses; - - /** - * Verifies a ToolResponses message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolResponses message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolResponses - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ToolResponses; - - /** - * Creates a plain object from a ToolResponses message. Also converts values to other types if specified. - * @param message ToolResponses - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ToolResponses, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolResponses to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolResponses - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Citations. */ - interface ICitations { - - /** Citations citedChunks */ - citedChunks?: (google.cloud.ces.v1.Citations.ICitedChunk[]|null); - } - - /** Represents a Citations. */ - class Citations implements ICitations { - - /** - * Constructs a new Citations. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ICitations); - - /** Citations citedChunks. */ - public citedChunks: google.cloud.ces.v1.Citations.ICitedChunk[]; - - /** - * Creates a new Citations instance using the specified properties. - * @param [properties] Properties to set - * @returns Citations instance - */ - public static create(properties?: google.cloud.ces.v1.ICitations): google.cloud.ces.v1.Citations; - - /** - * Encodes the specified Citations message. Does not implicitly {@link google.cloud.ces.v1.Citations.verify|verify} messages. - * @param message Citations message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ICitations, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Citations message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Citations.verify|verify} messages. - * @param message Citations message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ICitations, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Citations message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Citations - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Citations; - - /** - * Decodes a Citations message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Citations - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Citations; - - /** - * Verifies a Citations message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Citations message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Citations - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Citations; - - /** - * Creates a plain object from a Citations message. Also converts values to other types if specified. - * @param message Citations - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Citations, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Citations to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Citations - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Citations { - - /** Properties of a CitedChunk. */ - interface ICitedChunk { - - /** CitedChunk uri */ - uri?: (string|null); - - /** CitedChunk title */ - title?: (string|null); - - /** CitedChunk text */ - text?: (string|null); - } - - /** Represents a CitedChunk. */ - class CitedChunk implements ICitedChunk { - - /** - * Constructs a new CitedChunk. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.Citations.ICitedChunk); - - /** CitedChunk uri. */ - public uri: string; - - /** CitedChunk title. */ - public title: string; - - /** CitedChunk text. */ - public text: string; - - /** - * Creates a new CitedChunk instance using the specified properties. - * @param [properties] Properties to set - * @returns CitedChunk instance - */ - public static create(properties?: google.cloud.ces.v1.Citations.ICitedChunk): google.cloud.ces.v1.Citations.CitedChunk; - - /** - * Encodes the specified CitedChunk message. Does not implicitly {@link google.cloud.ces.v1.Citations.CitedChunk.verify|verify} messages. - * @param message CitedChunk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.Citations.ICitedChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CitedChunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Citations.CitedChunk.verify|verify} messages. - * @param message CitedChunk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.Citations.ICitedChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CitedChunk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CitedChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Citations.CitedChunk; - - /** - * Decodes a CitedChunk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CitedChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Citations.CitedChunk; - - /** - * Verifies a CitedChunk message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CitedChunk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CitedChunk - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Citations.CitedChunk; - - /** - * Creates a plain object from a CitedChunk message. Also converts values to other types if specified. - * @param message CitedChunk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Citations.CitedChunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CitedChunk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CitedChunk - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an Event. */ - interface IEvent { - - /** Event event */ - event?: (string|null); - } - - /** Represents an Event. */ - class Event implements IEvent { - - /** - * Constructs a new Event. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IEvent); - - /** Event event. */ - public event: string; - - /** - * Creates a new Event instance using the specified properties. - * @param [properties] Properties to set - * @returns Event instance - */ - public static create(properties?: google.cloud.ces.v1.IEvent): google.cloud.ces.v1.Event; - - /** - * Encodes the specified Event message. Does not implicitly {@link google.cloud.ces.v1.Event.verify|verify} messages. - * @param message Event message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Event.verify|verify} messages. - * @param message Event message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Event message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Event - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.Event; - - /** - * Decodes an Event message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Event - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.Event; - - /** - * Verifies an Event message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Event message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Event - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.Event; - - /** - * Creates a plain object from an Event message. Also converts values to other types if specified. - * @param message Event - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.Event, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Event to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Event - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SessionInput. */ - interface ISessionInput { - - /** SessionInput text */ - text?: (string|null); - - /** SessionInput dtmf */ - dtmf?: (string|null); - - /** SessionInput audio */ - audio?: (Uint8Array|Buffer|string|null); - - /** SessionInput toolResponses */ - toolResponses?: (google.cloud.ces.v1.IToolResponses|null); - - /** SessionInput image */ - image?: (google.cloud.ces.v1.IImage|null); - - /** SessionInput blob */ - blob?: (google.cloud.ces.v1.IBlob|null); - - /** SessionInput variables */ - variables?: (google.protobuf.IStruct|null); - - /** SessionInput event */ - event?: (google.cloud.ces.v1.IEvent|null); - - /** SessionInput willContinue */ - willContinue?: (boolean|null); - } - - /** Represents a SessionInput. */ - class SessionInput implements ISessionInput { - - /** - * Constructs a new SessionInput. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ISessionInput); - - /** SessionInput text. */ - public text?: (string|null); - - /** SessionInput dtmf. */ - public dtmf?: (string|null); - - /** SessionInput audio. */ - public audio?: (Uint8Array|Buffer|string|null); - - /** SessionInput toolResponses. */ - public toolResponses?: (google.cloud.ces.v1.IToolResponses|null); - - /** SessionInput image. */ - public image?: (google.cloud.ces.v1.IImage|null); - - /** SessionInput blob. */ - public blob?: (google.cloud.ces.v1.IBlob|null); - - /** SessionInput variables. */ - public variables?: (google.protobuf.IStruct|null); - - /** SessionInput event. */ - public event?: (google.cloud.ces.v1.IEvent|null); - - /** SessionInput willContinue. */ - public willContinue: boolean; - - /** SessionInput inputType. */ - public inputType?: ("text"|"dtmf"|"audio"|"toolResponses"|"image"|"blob"|"variables"|"event"); - - /** - * Creates a new SessionInput instance using the specified properties. - * @param [properties] Properties to set - * @returns SessionInput instance - */ - public static create(properties?: google.cloud.ces.v1.ISessionInput): google.cloud.ces.v1.SessionInput; - - /** - * Encodes the specified SessionInput message. Does not implicitly {@link google.cloud.ces.v1.SessionInput.verify|verify} messages. - * @param message SessionInput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ISessionInput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SessionInput message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionInput.verify|verify} messages. - * @param message SessionInput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ISessionInput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SessionInput message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SessionInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.SessionInput; - - /** - * Decodes a SessionInput message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SessionInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.SessionInput; - - /** - * Verifies a SessionInput message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SessionInput message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SessionInput - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.SessionInput; - - /** - * Creates a plain object from a SessionInput message. Also converts values to other types if specified. - * @param message SessionInput - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.SessionInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SessionInput to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SessionInput - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SessionOutput. */ - interface ISessionOutput { - - /** SessionOutput text */ - text?: (string|null); - - /** SessionOutput audio */ - audio?: (Uint8Array|Buffer|string|null); - - /** SessionOutput toolCalls */ - toolCalls?: (google.cloud.ces.v1.IToolCalls|null); - - /** SessionOutput citations */ - citations?: (google.cloud.ces.v1.ICitations|null); - - /** SessionOutput googleSearchSuggestions */ - googleSearchSuggestions?: (google.cloud.ces.v1.IGoogleSearchSuggestions|null); - - /** SessionOutput endSession */ - endSession?: (google.cloud.ces.v1.IEndSession|null); - - /** SessionOutput payload */ - payload?: (google.protobuf.IStruct|null); - - /** SessionOutput turnIndex */ - turnIndex?: (number|null); - - /** SessionOutput turnCompleted */ - turnCompleted?: (boolean|null); - - /** SessionOutput diagnosticInfo */ - diagnosticInfo?: (google.cloud.ces.v1.SessionOutput.IDiagnosticInfo|null); - } - - /** Represents a SessionOutput. */ - class SessionOutput implements ISessionOutput { - - /** - * Constructs a new SessionOutput. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.ISessionOutput); - - /** SessionOutput text. */ - public text?: (string|null); - - /** SessionOutput audio. */ - public audio?: (Uint8Array|Buffer|string|null); - - /** SessionOutput toolCalls. */ - public toolCalls?: (google.cloud.ces.v1.IToolCalls|null); - - /** SessionOutput citations. */ - public citations?: (google.cloud.ces.v1.ICitations|null); - - /** SessionOutput googleSearchSuggestions. */ - public googleSearchSuggestions?: (google.cloud.ces.v1.IGoogleSearchSuggestions|null); - - /** SessionOutput endSession. */ - public endSession?: (google.cloud.ces.v1.IEndSession|null); - - /** SessionOutput payload. */ - public payload?: (google.protobuf.IStruct|null); - - /** SessionOutput turnIndex. */ - public turnIndex: number; - - /** SessionOutput turnCompleted. */ - public turnCompleted: boolean; - - /** SessionOutput diagnosticInfo. */ - public diagnosticInfo?: (google.cloud.ces.v1.SessionOutput.IDiagnosticInfo|null); - - /** SessionOutput outputType. */ - public outputType?: ("text"|"audio"|"toolCalls"|"citations"|"googleSearchSuggestions"|"endSession"|"payload"); - - /** - * Creates a new SessionOutput instance using the specified properties. - * @param [properties] Properties to set - * @returns SessionOutput instance - */ - public static create(properties?: google.cloud.ces.v1.ISessionOutput): google.cloud.ces.v1.SessionOutput; - - /** - * Encodes the specified SessionOutput message. Does not implicitly {@link google.cloud.ces.v1.SessionOutput.verify|verify} messages. - * @param message SessionOutput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.ISessionOutput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SessionOutput message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionOutput.verify|verify} messages. - * @param message SessionOutput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.ISessionOutput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SessionOutput message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SessionOutput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.SessionOutput; - - /** - * Decodes a SessionOutput message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SessionOutput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.SessionOutput; - - /** - * Verifies a SessionOutput message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SessionOutput message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SessionOutput - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.SessionOutput; - - /** - * Creates a plain object from a SessionOutput message. Also converts values to other types if specified. - * @param message SessionOutput - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.SessionOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SessionOutput to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SessionOutput - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SessionOutput { - - /** Properties of a DiagnosticInfo. */ - interface IDiagnosticInfo { - - /** DiagnosticInfo messages */ - messages?: (google.cloud.ces.v1.IMessage[]|null); - - /** DiagnosticInfo rootSpan */ - rootSpan?: (google.cloud.ces.v1.ISpan|null); - } - - /** Represents a DiagnosticInfo. */ - class DiagnosticInfo implements IDiagnosticInfo { - - /** - * Constructs a new DiagnosticInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.SessionOutput.IDiagnosticInfo); - - /** DiagnosticInfo messages. */ - public messages: google.cloud.ces.v1.IMessage[]; - - /** DiagnosticInfo rootSpan. */ - public rootSpan?: (google.cloud.ces.v1.ISpan|null); - - /** - * Creates a new DiagnosticInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns DiagnosticInfo instance - */ - public static create(properties?: google.cloud.ces.v1.SessionOutput.IDiagnosticInfo): google.cloud.ces.v1.SessionOutput.DiagnosticInfo; - - /** - * Encodes the specified DiagnosticInfo message. Does not implicitly {@link google.cloud.ces.v1.SessionOutput.DiagnosticInfo.verify|verify} messages. - * @param message DiagnosticInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.SessionOutput.IDiagnosticInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DiagnosticInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionOutput.DiagnosticInfo.verify|verify} messages. - * @param message DiagnosticInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.SessionOutput.IDiagnosticInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DiagnosticInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DiagnosticInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.SessionOutput.DiagnosticInfo; - - /** - * Decodes a DiagnosticInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DiagnosticInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.SessionOutput.DiagnosticInfo; - - /** - * Verifies a DiagnosticInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DiagnosticInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DiagnosticInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.SessionOutput.DiagnosticInfo; - - /** - * Creates a plain object from a DiagnosticInfo message. Also converts values to other types if specified. - * @param message DiagnosticInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.SessionOutput.DiagnosticInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DiagnosticInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DiagnosticInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a RecognitionResult. */ - interface IRecognitionResult { - - /** RecognitionResult transcript */ - transcript?: (string|null); - } - - /** Represents a RecognitionResult. */ - class RecognitionResult implements IRecognitionResult { - - /** - * Constructs a new RecognitionResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IRecognitionResult); - - /** RecognitionResult transcript. */ - public transcript: string; - - /** - * Creates a new RecognitionResult instance using the specified properties. - * @param [properties] Properties to set - * @returns RecognitionResult instance - */ - public static create(properties?: google.cloud.ces.v1.IRecognitionResult): google.cloud.ces.v1.RecognitionResult; - - /** - * Encodes the specified RecognitionResult message. Does not implicitly {@link google.cloud.ces.v1.RecognitionResult.verify|verify} messages. - * @param message RecognitionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RecognitionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RecognitionResult.verify|verify} messages. - * @param message RecognitionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RecognitionResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RecognitionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RecognitionResult; - - /** - * Decodes a RecognitionResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RecognitionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RecognitionResult; - - /** - * Verifies a RecognitionResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RecognitionResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RecognitionResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RecognitionResult; - - /** - * Creates a plain object from a RecognitionResult message. Also converts values to other types if specified. - * @param message RecognitionResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.RecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RecognitionResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RecognitionResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InterruptionSignal. */ - interface IInterruptionSignal { - - /** InterruptionSignal bargeIn */ - bargeIn?: (boolean|null); - } - - /** Represents an InterruptionSignal. */ - class InterruptionSignal implements IInterruptionSignal { - - /** - * Constructs a new InterruptionSignal. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IInterruptionSignal); - - /** InterruptionSignal bargeIn. */ - public bargeIn: boolean; - - /** - * Creates a new InterruptionSignal instance using the specified properties. - * @param [properties] Properties to set - * @returns InterruptionSignal instance - */ - public static create(properties?: google.cloud.ces.v1.IInterruptionSignal): google.cloud.ces.v1.InterruptionSignal; - - /** - * Encodes the specified InterruptionSignal message. Does not implicitly {@link google.cloud.ces.v1.InterruptionSignal.verify|verify} messages. - * @param message InterruptionSignal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IInterruptionSignal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InterruptionSignal message, length delimited. Does not implicitly {@link google.cloud.ces.v1.InterruptionSignal.verify|verify} messages. - * @param message InterruptionSignal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IInterruptionSignal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InterruptionSignal message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InterruptionSignal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.InterruptionSignal; - - /** - * Decodes an InterruptionSignal message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InterruptionSignal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.InterruptionSignal; - - /** - * Verifies an InterruptionSignal message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InterruptionSignal message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InterruptionSignal - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.InterruptionSignal; - - /** - * Creates a plain object from an InterruptionSignal message. Also converts values to other types if specified. - * @param message InterruptionSignal - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.InterruptionSignal, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InterruptionSignal to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InterruptionSignal - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EndSession. */ - interface IEndSession { - - /** EndSession metadata */ - metadata?: (google.protobuf.IStruct|null); - } - - /** Represents an EndSession. */ - class EndSession implements IEndSession { - - /** - * Constructs a new EndSession. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IEndSession); - - /** EndSession metadata. */ - public metadata?: (google.protobuf.IStruct|null); - - /** - * Creates a new EndSession instance using the specified properties. - * @param [properties] Properties to set - * @returns EndSession instance - */ - public static create(properties?: google.cloud.ces.v1.IEndSession): google.cloud.ces.v1.EndSession; - - /** - * Encodes the specified EndSession message. Does not implicitly {@link google.cloud.ces.v1.EndSession.verify|verify} messages. - * @param message EndSession message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IEndSession, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EndSession message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EndSession.verify|verify} messages. - * @param message EndSession message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IEndSession, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EndSession message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EndSession - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.EndSession; - - /** - * Decodes an EndSession message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EndSession - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.EndSession; - - /** - * Verifies an EndSession message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EndSession message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EndSession - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.EndSession; - - /** - * Creates a plain object from an EndSession message. Also converts values to other types if specified. - * @param message EndSession - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.EndSession, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EndSession to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EndSession - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoAway. */ - interface IGoAway { - } - - /** Represents a GoAway. */ - class GoAway implements IGoAway { - - /** - * Constructs a new GoAway. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IGoAway); - - /** - * Creates a new GoAway instance using the specified properties. - * @param [properties] Properties to set - * @returns GoAway instance - */ - public static create(properties?: google.cloud.ces.v1.IGoAway): google.cloud.ces.v1.GoAway; - - /** - * Encodes the specified GoAway message. Does not implicitly {@link google.cloud.ces.v1.GoAway.verify|verify} messages. - * @param message GoAway message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IGoAway, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoAway message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GoAway.verify|verify} messages. - * @param message GoAway message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IGoAway, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoAway message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoAway - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GoAway; - - /** - * Decodes a GoAway message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoAway - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GoAway; - - /** - * Verifies a GoAway message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoAway message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoAway - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GoAway; - - /** - * Creates a plain object from a GoAway message. Also converts values to other types if specified. - * @param message GoAway - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.GoAway, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoAway to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoAway - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RunSessionRequest. */ - interface IRunSessionRequest { - - /** RunSessionRequest config */ - config?: (google.cloud.ces.v1.ISessionConfig|null); - - /** RunSessionRequest inputs */ - inputs?: (google.cloud.ces.v1.ISessionInput[]|null); - } - - /** Represents a RunSessionRequest. */ - class RunSessionRequest implements IRunSessionRequest { - - /** - * Constructs a new RunSessionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IRunSessionRequest); - - /** RunSessionRequest config. */ - public config?: (google.cloud.ces.v1.ISessionConfig|null); - - /** RunSessionRequest inputs. */ - public inputs: google.cloud.ces.v1.ISessionInput[]; - - /** - * Creates a new RunSessionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RunSessionRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IRunSessionRequest): google.cloud.ces.v1.RunSessionRequest; - - /** - * Encodes the specified RunSessionRequest message. Does not implicitly {@link google.cloud.ces.v1.RunSessionRequest.verify|verify} messages. - * @param message RunSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IRunSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RunSessionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RunSessionRequest.verify|verify} messages. - * @param message RunSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IRunSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RunSessionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RunSessionRequest; - - /** - * Decodes a RunSessionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RunSessionRequest; - - /** - * Verifies a RunSessionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RunSessionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunSessionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RunSessionRequest; - - /** - * Creates a plain object from a RunSessionRequest message. Also converts values to other types if specified. - * @param message RunSessionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.RunSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunSessionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunSessionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RunSessionResponse. */ - interface IRunSessionResponse { - - /** RunSessionResponse outputs */ - outputs?: (google.cloud.ces.v1.ISessionOutput[]|null); - } - - /** Represents a RunSessionResponse. */ - class RunSessionResponse implements IRunSessionResponse { - - /** - * Constructs a new RunSessionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IRunSessionResponse); - - /** RunSessionResponse outputs. */ - public outputs: google.cloud.ces.v1.ISessionOutput[]; - - /** - * Creates a new RunSessionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RunSessionResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IRunSessionResponse): google.cloud.ces.v1.RunSessionResponse; - - /** - * Encodes the specified RunSessionResponse message. Does not implicitly {@link google.cloud.ces.v1.RunSessionResponse.verify|verify} messages. - * @param message RunSessionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IRunSessionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RunSessionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RunSessionResponse.verify|verify} messages. - * @param message RunSessionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IRunSessionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RunSessionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunSessionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RunSessionResponse; - - /** - * Decodes a RunSessionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunSessionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RunSessionResponse; - - /** - * Verifies a RunSessionResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RunSessionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunSessionResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RunSessionResponse; - - /** - * Creates a plain object from a RunSessionResponse message. Also converts values to other types if specified. - * @param message RunSessionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.RunSessionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunSessionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunSessionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BidiSessionClientMessage. */ - interface IBidiSessionClientMessage { - - /** BidiSessionClientMessage config */ - config?: (google.cloud.ces.v1.ISessionConfig|null); - - /** BidiSessionClientMessage realtimeInput */ - realtimeInput?: (google.cloud.ces.v1.ISessionInput|null); - } - - /** Represents a BidiSessionClientMessage. */ - class BidiSessionClientMessage implements IBidiSessionClientMessage { - - /** - * Constructs a new BidiSessionClientMessage. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IBidiSessionClientMessage); - - /** BidiSessionClientMessage config. */ - public config?: (google.cloud.ces.v1.ISessionConfig|null); - - /** BidiSessionClientMessage realtimeInput. */ - public realtimeInput?: (google.cloud.ces.v1.ISessionInput|null); - - /** BidiSessionClientMessage messageType. */ - public messageType?: ("config"|"realtimeInput"); - - /** - * Creates a new BidiSessionClientMessage instance using the specified properties. - * @param [properties] Properties to set - * @returns BidiSessionClientMessage instance - */ - public static create(properties?: google.cloud.ces.v1.IBidiSessionClientMessage): google.cloud.ces.v1.BidiSessionClientMessage; - - /** - * Encodes the specified BidiSessionClientMessage message. Does not implicitly {@link google.cloud.ces.v1.BidiSessionClientMessage.verify|verify} messages. - * @param message BidiSessionClientMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IBidiSessionClientMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BidiSessionClientMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BidiSessionClientMessage.verify|verify} messages. - * @param message BidiSessionClientMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IBidiSessionClientMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BidiSessionClientMessage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BidiSessionClientMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.BidiSessionClientMessage; - - /** - * Decodes a BidiSessionClientMessage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BidiSessionClientMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.BidiSessionClientMessage; - - /** - * Verifies a BidiSessionClientMessage message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BidiSessionClientMessage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BidiSessionClientMessage - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.BidiSessionClientMessage; - - /** - * Creates a plain object from a BidiSessionClientMessage message. Also converts values to other types if specified. - * @param message BidiSessionClientMessage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.BidiSessionClientMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BidiSessionClientMessage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BidiSessionClientMessage - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BidiSessionServerMessage. */ - interface IBidiSessionServerMessage { - - /** BidiSessionServerMessage sessionOutput */ - sessionOutput?: (google.cloud.ces.v1.ISessionOutput|null); - - /** BidiSessionServerMessage recognitionResult */ - recognitionResult?: (google.cloud.ces.v1.IRecognitionResult|null); - - /** BidiSessionServerMessage interruptionSignal */ - interruptionSignal?: (google.cloud.ces.v1.IInterruptionSignal|null); - - /** BidiSessionServerMessage endSession */ - endSession?: (google.cloud.ces.v1.IEndSession|null); - - /** BidiSessionServerMessage goAway */ - goAway?: (google.cloud.ces.v1.IGoAway|null); - } - - /** Represents a BidiSessionServerMessage. */ - class BidiSessionServerMessage implements IBidiSessionServerMessage { - - /** - * Constructs a new BidiSessionServerMessage. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IBidiSessionServerMessage); - - /** BidiSessionServerMessage sessionOutput. */ - public sessionOutput?: (google.cloud.ces.v1.ISessionOutput|null); - - /** BidiSessionServerMessage recognitionResult. */ - public recognitionResult?: (google.cloud.ces.v1.IRecognitionResult|null); - - /** BidiSessionServerMessage interruptionSignal. */ - public interruptionSignal?: (google.cloud.ces.v1.IInterruptionSignal|null); - - /** BidiSessionServerMessage endSession. */ - public endSession?: (google.cloud.ces.v1.IEndSession|null); - - /** BidiSessionServerMessage goAway. */ - public goAway?: (google.cloud.ces.v1.IGoAway|null); - - /** BidiSessionServerMessage messageType. */ - public messageType?: ("sessionOutput"|"recognitionResult"|"interruptionSignal"|"endSession"|"goAway"); - - /** - * Creates a new BidiSessionServerMessage instance using the specified properties. - * @param [properties] Properties to set - * @returns BidiSessionServerMessage instance - */ - public static create(properties?: google.cloud.ces.v1.IBidiSessionServerMessage): google.cloud.ces.v1.BidiSessionServerMessage; - - /** - * Encodes the specified BidiSessionServerMessage message. Does not implicitly {@link google.cloud.ces.v1.BidiSessionServerMessage.verify|verify} messages. - * @param message BidiSessionServerMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IBidiSessionServerMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BidiSessionServerMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BidiSessionServerMessage.verify|verify} messages. - * @param message BidiSessionServerMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IBidiSessionServerMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BidiSessionServerMessage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BidiSessionServerMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.BidiSessionServerMessage; - - /** - * Decodes a BidiSessionServerMessage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BidiSessionServerMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.BidiSessionServerMessage; - - /** - * Verifies a BidiSessionServerMessage message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BidiSessionServerMessage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BidiSessionServerMessage - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.BidiSessionServerMessage; - - /** - * Creates a plain object from a BidiSessionServerMessage message. Also converts values to other types if specified. - * @param message BidiSessionServerMessage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.BidiSessionServerMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BidiSessionServerMessage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BidiSessionServerMessage - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a ToolService */ - class ToolService extends $protobuf.rpc.Service { - - /** - * Constructs a new ToolService 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 ToolService 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): ToolService; - - /** - * Calls ExecuteTool. - * @param request ExecuteToolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ExecuteToolResponse - */ - public executeTool(request: google.cloud.ces.v1.IExecuteToolRequest, callback: google.cloud.ces.v1.ToolService.ExecuteToolCallback): void; - - /** - * Calls ExecuteTool. - * @param request ExecuteToolRequest message or plain object - * @returns Promise - */ - public executeTool(request: google.cloud.ces.v1.IExecuteToolRequest): Promise; - - /** - * Calls RetrieveToolSchema. - * @param request RetrieveToolSchemaRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RetrieveToolSchemaResponse - */ - public retrieveToolSchema(request: google.cloud.ces.v1.IRetrieveToolSchemaRequest, callback: google.cloud.ces.v1.ToolService.RetrieveToolSchemaCallback): void; - - /** - * Calls RetrieveToolSchema. - * @param request RetrieveToolSchemaRequest message or plain object - * @returns Promise - */ - public retrieveToolSchema(request: google.cloud.ces.v1.IRetrieveToolSchemaRequest): Promise; - - /** - * Calls RetrieveTools. - * @param request RetrieveToolsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RetrieveToolsResponse - */ - public retrieveTools(request: google.cloud.ces.v1.IRetrieveToolsRequest, callback: google.cloud.ces.v1.ToolService.RetrieveToolsCallback): void; - - /** - * Calls RetrieveTools. - * @param request RetrieveToolsRequest message or plain object - * @returns Promise - */ - public retrieveTools(request: google.cloud.ces.v1.IRetrieveToolsRequest): Promise; - } - - namespace ToolService { - - /** - * Callback as used by {@link google.cloud.ces.v1.ToolService|executeTool}. - * @param error Error, if any - * @param [response] ExecuteToolResponse - */ - type ExecuteToolCallback = (error: (Error|null), response?: google.cloud.ces.v1.ExecuteToolResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.ToolService|retrieveToolSchema}. - * @param error Error, if any - * @param [response] RetrieveToolSchemaResponse - */ - type RetrieveToolSchemaCallback = (error: (Error|null), response?: google.cloud.ces.v1.RetrieveToolSchemaResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1.ToolService|retrieveTools}. - * @param error Error, if any - * @param [response] RetrieveToolsResponse - */ - type RetrieveToolsCallback = (error: (Error|null), response?: google.cloud.ces.v1.RetrieveToolsResponse) => void; - } - - /** Properties of an ExecuteToolRequest. */ - interface IExecuteToolRequest { - - /** ExecuteToolRequest tool */ - tool?: (string|null); - - /** ExecuteToolRequest toolsetTool */ - toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); - - /** ExecuteToolRequest parent */ - parent?: (string|null); - - /** ExecuteToolRequest args */ - args?: (google.protobuf.IStruct|null); - } - - /** Represents an ExecuteToolRequest. */ - class ExecuteToolRequest implements IExecuteToolRequest { - - /** - * Constructs a new ExecuteToolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IExecuteToolRequest); - - /** ExecuteToolRequest tool. */ - public tool?: (string|null); - - /** ExecuteToolRequest toolsetTool. */ - public toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); - - /** ExecuteToolRequest parent. */ - public parent: string; - - /** ExecuteToolRequest args. */ - public args?: (google.protobuf.IStruct|null); - - /** ExecuteToolRequest toolIdentifier. */ - public toolIdentifier?: ("tool"|"toolsetTool"); - - /** - * Creates a new ExecuteToolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteToolRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IExecuteToolRequest): google.cloud.ces.v1.ExecuteToolRequest; - - /** - * Encodes the specified ExecuteToolRequest message. Does not implicitly {@link google.cloud.ces.v1.ExecuteToolRequest.verify|verify} messages. - * @param message ExecuteToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IExecuteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExecuteToolRequest.verify|verify} messages. - * @param message ExecuteToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IExecuteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteToolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ExecuteToolRequest; - - /** - * Decodes an ExecuteToolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ExecuteToolRequest; - - /** - * Verifies an ExecuteToolRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteToolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteToolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ExecuteToolRequest; - - /** - * Creates a plain object from an ExecuteToolRequest message. Also converts values to other types if specified. - * @param message ExecuteToolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ExecuteToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteToolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteToolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExecuteToolResponse. */ - interface IExecuteToolResponse { - - /** ExecuteToolResponse tool */ - tool?: (string|null); - - /** ExecuteToolResponse toolsetTool */ - toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); - - /** ExecuteToolResponse response */ - response?: (google.protobuf.IStruct|null); - } - - /** Represents an ExecuteToolResponse. */ - class ExecuteToolResponse implements IExecuteToolResponse { - - /** - * Constructs a new ExecuteToolResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IExecuteToolResponse); - - /** ExecuteToolResponse tool. */ - public tool?: (string|null); - - /** ExecuteToolResponse toolsetTool. */ - public toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); - - /** ExecuteToolResponse response. */ - public response?: (google.protobuf.IStruct|null); - - /** ExecuteToolResponse toolIdentifier. */ - public toolIdentifier?: ("tool"|"toolsetTool"); - - /** - * Creates a new ExecuteToolResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteToolResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IExecuteToolResponse): google.cloud.ces.v1.ExecuteToolResponse; - - /** - * Encodes the specified ExecuteToolResponse message. Does not implicitly {@link google.cloud.ces.v1.ExecuteToolResponse.verify|verify} messages. - * @param message ExecuteToolResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IExecuteToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExecuteToolResponse.verify|verify} messages. - * @param message ExecuteToolResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IExecuteToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteToolResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteToolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.ExecuteToolResponse; - - /** - * Decodes an ExecuteToolResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteToolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.ExecuteToolResponse; - - /** - * Verifies an ExecuteToolResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteToolResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteToolResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.ExecuteToolResponse; - - /** - * Creates a plain object from an ExecuteToolResponse message. Also converts values to other types if specified. - * @param message ExecuteToolResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.ExecuteToolResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteToolResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteToolResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RetrieveToolSchemaRequest. */ - interface IRetrieveToolSchemaRequest { - - /** RetrieveToolSchemaRequest tool */ - tool?: (string|null); - - /** RetrieveToolSchemaRequest toolsetTool */ - toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); - - /** RetrieveToolSchemaRequest parent */ - parent?: (string|null); - } - - /** Represents a RetrieveToolSchemaRequest. */ - class RetrieveToolSchemaRequest implements IRetrieveToolSchemaRequest { - - /** - * Constructs a new RetrieveToolSchemaRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IRetrieveToolSchemaRequest); - - /** RetrieveToolSchemaRequest tool. */ - public tool?: (string|null); - - /** RetrieveToolSchemaRequest toolsetTool. */ - public toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); - - /** RetrieveToolSchemaRequest parent. */ - public parent: string; - - /** RetrieveToolSchemaRequest toolIdentifier. */ - public toolIdentifier?: ("tool"|"toolsetTool"); - - /** - * Creates a new RetrieveToolSchemaRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RetrieveToolSchemaRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IRetrieveToolSchemaRequest): google.cloud.ces.v1.RetrieveToolSchemaRequest; - - /** - * Encodes the specified RetrieveToolSchemaRequest message. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolSchemaRequest.verify|verify} messages. - * @param message RetrieveToolSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IRetrieveToolSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RetrieveToolSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolSchemaRequest.verify|verify} messages. - * @param message RetrieveToolSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IRetrieveToolSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RetrieveToolSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RetrieveToolSchemaRequest; - - /** - * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RetrieveToolSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RetrieveToolSchemaRequest; - - /** - * Verifies a RetrieveToolSchemaRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RetrieveToolSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RetrieveToolSchemaRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RetrieveToolSchemaRequest; - - /** - * Creates a plain object from a RetrieveToolSchemaRequest message. Also converts values to other types if specified. - * @param message RetrieveToolSchemaRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.RetrieveToolSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RetrieveToolSchemaRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RetrieveToolSchemaRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RetrieveToolSchemaResponse. */ - interface IRetrieveToolSchemaResponse { - - /** RetrieveToolSchemaResponse tool */ - tool?: (string|null); - - /** RetrieveToolSchemaResponse toolsetTool */ - toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); - - /** RetrieveToolSchemaResponse inputSchema */ - inputSchema?: (google.cloud.ces.v1.ISchema|null); - - /** RetrieveToolSchemaResponse outputSchema */ - outputSchema?: (google.cloud.ces.v1.ISchema|null); - } - - /** Represents a RetrieveToolSchemaResponse. */ - class RetrieveToolSchemaResponse implements IRetrieveToolSchemaResponse { - - /** - * Constructs a new RetrieveToolSchemaResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IRetrieveToolSchemaResponse); - - /** RetrieveToolSchemaResponse tool. */ - public tool?: (string|null); - - /** RetrieveToolSchemaResponse toolsetTool. */ - public toolsetTool?: (google.cloud.ces.v1.IToolsetTool|null); - - /** RetrieveToolSchemaResponse inputSchema. */ - public inputSchema?: (google.cloud.ces.v1.ISchema|null); - - /** RetrieveToolSchemaResponse outputSchema. */ - public outputSchema?: (google.cloud.ces.v1.ISchema|null); - - /** RetrieveToolSchemaResponse toolIdentifier. */ - public toolIdentifier?: ("tool"|"toolsetTool"); - - /** - * Creates a new RetrieveToolSchemaResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RetrieveToolSchemaResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IRetrieveToolSchemaResponse): google.cloud.ces.v1.RetrieveToolSchemaResponse; - - /** - * Encodes the specified RetrieveToolSchemaResponse message. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolSchemaResponse.verify|verify} messages. - * @param message RetrieveToolSchemaResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IRetrieveToolSchemaResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RetrieveToolSchemaResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolSchemaResponse.verify|verify} messages. - * @param message RetrieveToolSchemaResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IRetrieveToolSchemaResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RetrieveToolSchemaResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RetrieveToolSchemaResponse; - - /** - * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RetrieveToolSchemaResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RetrieveToolSchemaResponse; - - /** - * Verifies a RetrieveToolSchemaResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RetrieveToolSchemaResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RetrieveToolSchemaResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RetrieveToolSchemaResponse; - - /** - * Creates a plain object from a RetrieveToolSchemaResponse message. Also converts values to other types if specified. - * @param message RetrieveToolSchemaResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.RetrieveToolSchemaResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RetrieveToolSchemaResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RetrieveToolSchemaResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RetrieveToolsRequest. */ - interface IRetrieveToolsRequest { - - /** RetrieveToolsRequest toolset */ - toolset?: (string|null); - - /** RetrieveToolsRequest toolIds */ - toolIds?: (string[]|null); - } - - /** Represents a RetrieveToolsRequest. */ - class RetrieveToolsRequest implements IRetrieveToolsRequest { - - /** - * Constructs a new RetrieveToolsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IRetrieveToolsRequest); - - /** RetrieveToolsRequest toolset. */ - public toolset: string; - - /** RetrieveToolsRequest toolIds. */ - public toolIds: string[]; - - /** - * Creates a new RetrieveToolsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RetrieveToolsRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IRetrieveToolsRequest): google.cloud.ces.v1.RetrieveToolsRequest; - - /** - * Encodes the specified RetrieveToolsRequest message. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolsRequest.verify|verify} messages. - * @param message RetrieveToolsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IRetrieveToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RetrieveToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolsRequest.verify|verify} messages. - * @param message RetrieveToolsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IRetrieveToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RetrieveToolsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RetrieveToolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RetrieveToolsRequest; - - /** - * Decodes a RetrieveToolsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RetrieveToolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RetrieveToolsRequest; - - /** - * Verifies a RetrieveToolsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RetrieveToolsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RetrieveToolsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RetrieveToolsRequest; - - /** - * Creates a plain object from a RetrieveToolsRequest message. Also converts values to other types if specified. - * @param message RetrieveToolsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.RetrieveToolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RetrieveToolsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RetrieveToolsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RetrieveToolsResponse. */ - interface IRetrieveToolsResponse { - - /** RetrieveToolsResponse tools */ - tools?: (google.cloud.ces.v1.ITool[]|null); - } - - /** Represents a RetrieveToolsResponse. */ - class RetrieveToolsResponse implements IRetrieveToolsResponse { - - /** - * Constructs a new RetrieveToolsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IRetrieveToolsResponse); - - /** RetrieveToolsResponse tools. */ - public tools: google.cloud.ces.v1.ITool[]; - - /** - * Creates a new RetrieveToolsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RetrieveToolsResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IRetrieveToolsResponse): google.cloud.ces.v1.RetrieveToolsResponse; - - /** - * Encodes the specified RetrieveToolsResponse message. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolsResponse.verify|verify} messages. - * @param message RetrieveToolsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IRetrieveToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RetrieveToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolsResponse.verify|verify} messages. - * @param message RetrieveToolsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IRetrieveToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RetrieveToolsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RetrieveToolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.RetrieveToolsResponse; - - /** - * Decodes a RetrieveToolsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RetrieveToolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.RetrieveToolsResponse; - - /** - * Verifies a RetrieveToolsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RetrieveToolsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RetrieveToolsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.RetrieveToolsResponse; - - /** - * Creates a plain object from a RetrieveToolsResponse message. Also converts values to other types if specified. - * @param message RetrieveToolsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.RetrieveToolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RetrieveToolsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RetrieveToolsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a WidgetService */ - class WidgetService extends $protobuf.rpc.Service { - - /** - * Constructs a new WidgetService 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 WidgetService 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): WidgetService; - - /** - * Calls GenerateChatToken. - * @param request GenerateChatTokenRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GenerateChatTokenResponse - */ - public generateChatToken(request: google.cloud.ces.v1.IGenerateChatTokenRequest, callback: google.cloud.ces.v1.WidgetService.GenerateChatTokenCallback): void; - - /** - * Calls GenerateChatToken. - * @param request GenerateChatTokenRequest message or plain object - * @returns Promise - */ - public generateChatToken(request: google.cloud.ces.v1.IGenerateChatTokenRequest): Promise; - } - - namespace WidgetService { - - /** - * Callback as used by {@link google.cloud.ces.v1.WidgetService|generateChatToken}. - * @param error Error, if any - * @param [response] GenerateChatTokenResponse - */ - type GenerateChatTokenCallback = (error: (Error|null), response?: google.cloud.ces.v1.GenerateChatTokenResponse) => void; - } - - /** Properties of a GenerateChatTokenRequest. */ - interface IGenerateChatTokenRequest { - - /** GenerateChatTokenRequest name */ - name?: (string|null); - - /** GenerateChatTokenRequest deployment */ - deployment?: (string|null); - - /** GenerateChatTokenRequest recaptchaToken */ - recaptchaToken?: (string|null); - } - - /** Represents a GenerateChatTokenRequest. */ - class GenerateChatTokenRequest implements IGenerateChatTokenRequest { - - /** - * Constructs a new GenerateChatTokenRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IGenerateChatTokenRequest); - - /** GenerateChatTokenRequest name. */ - public name: string; - - /** GenerateChatTokenRequest deployment. */ - public deployment: string; - - /** GenerateChatTokenRequest recaptchaToken. */ - public recaptchaToken: string; - - /** - * Creates a new GenerateChatTokenRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GenerateChatTokenRequest instance - */ - public static create(properties?: google.cloud.ces.v1.IGenerateChatTokenRequest): google.cloud.ces.v1.GenerateChatTokenRequest; - - /** - * Encodes the specified GenerateChatTokenRequest message. Does not implicitly {@link google.cloud.ces.v1.GenerateChatTokenRequest.verify|verify} messages. - * @param message GenerateChatTokenRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IGenerateChatTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenerateChatTokenRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GenerateChatTokenRequest.verify|verify} messages. - * @param message GenerateChatTokenRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IGenerateChatTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenerateChatTokenRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenerateChatTokenRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GenerateChatTokenRequest; - - /** - * Decodes a GenerateChatTokenRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenerateChatTokenRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GenerateChatTokenRequest; - - /** - * Verifies a GenerateChatTokenRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenerateChatTokenRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenerateChatTokenRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GenerateChatTokenRequest; - - /** - * Creates a plain object from a GenerateChatTokenRequest message. Also converts values to other types if specified. - * @param message GenerateChatTokenRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.GenerateChatTokenRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenerateChatTokenRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenerateChatTokenRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GenerateChatTokenResponse. */ - interface IGenerateChatTokenResponse { - - /** GenerateChatTokenResponse chatToken */ - chatToken?: (string|null); - - /** GenerateChatTokenResponse expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a GenerateChatTokenResponse. */ - class GenerateChatTokenResponse implements IGenerateChatTokenResponse { - - /** - * Constructs a new GenerateChatTokenResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1.IGenerateChatTokenResponse); - - /** GenerateChatTokenResponse chatToken. */ - public chatToken: string; - - /** GenerateChatTokenResponse expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new GenerateChatTokenResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns GenerateChatTokenResponse instance - */ - public static create(properties?: google.cloud.ces.v1.IGenerateChatTokenResponse): google.cloud.ces.v1.GenerateChatTokenResponse; - - /** - * Encodes the specified GenerateChatTokenResponse message. Does not implicitly {@link google.cloud.ces.v1.GenerateChatTokenResponse.verify|verify} messages. - * @param message GenerateChatTokenResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1.IGenerateChatTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenerateChatTokenResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GenerateChatTokenResponse.verify|verify} messages. - * @param message GenerateChatTokenResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1.IGenerateChatTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenerateChatTokenResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenerateChatTokenResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1.GenerateChatTokenResponse; - - /** - * Decodes a GenerateChatTokenResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenerateChatTokenResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1.GenerateChatTokenResponse; - - /** - * Verifies a GenerateChatTokenResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenerateChatTokenResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenerateChatTokenResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1.GenerateChatTokenResponse; - - /** - * Creates a plain object from a GenerateChatTokenResponse message. Also converts values to other types if specified. - * @param message GenerateChatTokenResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1.GenerateChatTokenResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenerateChatTokenResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenerateChatTokenResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace v1beta. */ - namespace v1beta { - - /** Properties of an Agent. */ - interface IAgent { - - /** Agent llmAgent */ - llmAgent?: (google.cloud.ces.v1beta.Agent.ILlmAgent|null); - - /** Agent remoteDialogflowAgent */ - remoteDialogflowAgent?: (google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent|null); - - /** Agent name */ - name?: (string|null); - - /** Agent displayName */ - displayName?: (string|null); - - /** Agent description */ - description?: (string|null); - - /** Agent modelSettings */ - modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); - - /** Agent instruction */ - instruction?: (string|null); - - /** Agent tools */ - tools?: (string[]|null); - - /** Agent childAgents */ - childAgents?: (string[]|null); - - /** Agent beforeAgentCallbacks */ - beforeAgentCallbacks?: (google.cloud.ces.v1beta.ICallback[]|null); - - /** Agent afterAgentCallbacks */ - afterAgentCallbacks?: (google.cloud.ces.v1beta.ICallback[]|null); - - /** Agent beforeModelCallbacks */ - beforeModelCallbacks?: (google.cloud.ces.v1beta.ICallback[]|null); - - /** Agent afterModelCallbacks */ - afterModelCallbacks?: (google.cloud.ces.v1beta.ICallback[]|null); - - /** Agent beforeToolCallbacks */ - beforeToolCallbacks?: (google.cloud.ces.v1beta.ICallback[]|null); - - /** Agent afterToolCallbacks */ - afterToolCallbacks?: (google.cloud.ces.v1beta.ICallback[]|null); - - /** Agent createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Agent updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Agent guardrails */ - guardrails?: (string[]|null); - - /** Agent etag */ - etag?: (string|null); - - /** Agent toolsets */ - toolsets?: (google.cloud.ces.v1beta.Agent.IAgentToolset[]|null); - - /** Agent generatedSummary */ - generatedSummary?: (string|null); - - /** Agent transferRules */ - transferRules?: (google.cloud.ces.v1beta.ITransferRule[]|null); - } - - /** Represents an Agent. */ - class Agent implements IAgent { - - /** - * Constructs a new Agent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IAgent); - - /** Agent llmAgent. */ - public llmAgent?: (google.cloud.ces.v1beta.Agent.ILlmAgent|null); - - /** Agent remoteDialogflowAgent. */ - public remoteDialogflowAgent?: (google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent|null); - - /** Agent name. */ - public name: string; - - /** Agent displayName. */ - public displayName: string; - - /** Agent description. */ - public description: string; - - /** Agent modelSettings. */ - public modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); - - /** Agent instruction. */ - public instruction: string; - - /** Agent tools. */ - public tools: string[]; - - /** Agent childAgents. */ - public childAgents: string[]; - - /** Agent beforeAgentCallbacks. */ - public beforeAgentCallbacks: google.cloud.ces.v1beta.ICallback[]; - - /** Agent afterAgentCallbacks. */ - public afterAgentCallbacks: google.cloud.ces.v1beta.ICallback[]; - - /** Agent beforeModelCallbacks. */ - public beforeModelCallbacks: google.cloud.ces.v1beta.ICallback[]; - - /** Agent afterModelCallbacks. */ - public afterModelCallbacks: google.cloud.ces.v1beta.ICallback[]; - - /** Agent beforeToolCallbacks. */ - public beforeToolCallbacks: google.cloud.ces.v1beta.ICallback[]; - - /** Agent afterToolCallbacks. */ - public afterToolCallbacks: google.cloud.ces.v1beta.ICallback[]; - - /** Agent createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Agent updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Agent guardrails. */ - public guardrails: string[]; - - /** Agent etag. */ - public etag: string; - - /** Agent toolsets. */ - public toolsets: google.cloud.ces.v1beta.Agent.IAgentToolset[]; - - /** Agent generatedSummary. */ - public generatedSummary: string; - - /** Agent transferRules. */ - public transferRules: google.cloud.ces.v1beta.ITransferRule[]; - - /** Agent agentType. */ - public agentType?: ("llmAgent"|"remoteDialogflowAgent"); - - /** - * Creates a new Agent instance using the specified properties. - * @param [properties] Properties to set - * @returns Agent instance - */ - public static create(properties?: google.cloud.ces.v1beta.IAgent): google.cloud.ces.v1beta.Agent; - - /** - * Encodes the specified Agent message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.verify|verify} messages. - * @param message Agent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IAgent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Agent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.verify|verify} messages. - * @param message Agent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IAgent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Agent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Agent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Agent; - - /** - * Decodes an Agent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Agent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Agent; - - /** - * Verifies an Agent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Agent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Agent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Agent; - - /** - * Creates a plain object from an Agent message. Also converts values to other types if specified. - * @param message Agent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Agent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Agent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Agent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Agent { - - /** Properties of a LlmAgent. */ - interface ILlmAgent { - } - - /** Represents a LlmAgent. */ - class LlmAgent implements ILlmAgent { - - /** - * Constructs a new LlmAgent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Agent.ILlmAgent); - - /** - * Creates a new LlmAgent instance using the specified properties. - * @param [properties] Properties to set - * @returns LlmAgent instance - */ - public static create(properties?: google.cloud.ces.v1beta.Agent.ILlmAgent): google.cloud.ces.v1beta.Agent.LlmAgent; - - /** - * Encodes the specified LlmAgent message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.LlmAgent.verify|verify} messages. - * @param message LlmAgent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Agent.ILlmAgent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LlmAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.LlmAgent.verify|verify} messages. - * @param message LlmAgent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Agent.ILlmAgent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LlmAgent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LlmAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Agent.LlmAgent; - - /** - * Decodes a LlmAgent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LlmAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Agent.LlmAgent; - - /** - * Verifies a LlmAgent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LlmAgent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LlmAgent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Agent.LlmAgent; - - /** - * Creates a plain object from a LlmAgent message. Also converts values to other types if specified. - * @param message LlmAgent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Agent.LlmAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LlmAgent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LlmAgent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RemoteDialogflowAgent. */ - interface IRemoteDialogflowAgent { - - /** RemoteDialogflowAgent agent */ - agent?: (string|null); - - /** RemoteDialogflowAgent flowId */ - flowId?: (string|null); - - /** RemoteDialogflowAgent environmentId */ - environmentId?: (string|null); - - /** RemoteDialogflowAgent inputVariableMapping */ - inputVariableMapping?: ({ [k: string]: string }|null); - - /** RemoteDialogflowAgent outputVariableMapping */ - outputVariableMapping?: ({ [k: string]: string }|null); - - /** RemoteDialogflowAgent respectResponseInterruptionSettings */ - respectResponseInterruptionSettings?: (boolean|null); - } - - /** Represents a RemoteDialogflowAgent. */ - class RemoteDialogflowAgent implements IRemoteDialogflowAgent { - - /** - * Constructs a new RemoteDialogflowAgent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent); - - /** RemoteDialogflowAgent agent. */ - public agent: string; - - /** RemoteDialogflowAgent flowId. */ - public flowId: string; - - /** RemoteDialogflowAgent environmentId. */ - public environmentId: string; - - /** RemoteDialogflowAgent inputVariableMapping. */ - public inputVariableMapping: { [k: string]: string }; - - /** RemoteDialogflowAgent outputVariableMapping. */ - public outputVariableMapping: { [k: string]: string }; - - /** RemoteDialogflowAgent respectResponseInterruptionSettings. */ - public respectResponseInterruptionSettings: boolean; - - /** - * Creates a new RemoteDialogflowAgent instance using the specified properties. - * @param [properties] Properties to set - * @returns RemoteDialogflowAgent instance - */ - public static create(properties?: google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent): google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent; - - /** - * Encodes the specified RemoteDialogflowAgent message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.verify|verify} messages. - * @param message RemoteDialogflowAgent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RemoteDialogflowAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.verify|verify} messages. - * @param message RemoteDialogflowAgent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RemoteDialogflowAgent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RemoteDialogflowAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent; - - /** - * Decodes a RemoteDialogflowAgent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RemoteDialogflowAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent; - - /** - * Verifies a RemoteDialogflowAgent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RemoteDialogflowAgent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RemoteDialogflowAgent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent; - - /** - * Creates a plain object from a RemoteDialogflowAgent message. Also converts values to other types if specified. - * @param message RemoteDialogflowAgent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RemoteDialogflowAgent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RemoteDialogflowAgent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AgentToolset. */ - interface IAgentToolset { - - /** AgentToolset toolset */ - toolset?: (string|null); - - /** AgentToolset toolIds */ - toolIds?: (string[]|null); - } - - /** Represents an AgentToolset. */ - class AgentToolset implements IAgentToolset { - - /** - * Constructs a new AgentToolset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Agent.IAgentToolset); - - /** AgentToolset toolset. */ - public toolset: string; - - /** AgentToolset toolIds. */ - public toolIds: string[]; - - /** - * Creates a new AgentToolset instance using the specified properties. - * @param [properties] Properties to set - * @returns AgentToolset instance - */ - public static create(properties?: google.cloud.ces.v1beta.Agent.IAgentToolset): google.cloud.ces.v1beta.Agent.AgentToolset; - - /** - * Encodes the specified AgentToolset message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.AgentToolset.verify|verify} messages. - * @param message AgentToolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Agent.IAgentToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AgentToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.AgentToolset.verify|verify} messages. - * @param message AgentToolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Agent.IAgentToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AgentToolset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AgentToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Agent.AgentToolset; - - /** - * Decodes an AgentToolset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AgentToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Agent.AgentToolset; - - /** - * Verifies an AgentToolset message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AgentToolset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AgentToolset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Agent.AgentToolset; - - /** - * Creates a plain object from an AgentToolset message. Also converts values to other types if specified. - * @param message AgentToolset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Agent.AgentToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AgentToolset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AgentToolset - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExpressionCondition. */ - interface IExpressionCondition { - - /** ExpressionCondition expression */ - expression?: (string|null); - } - - /** Represents an ExpressionCondition. */ - class ExpressionCondition implements IExpressionCondition { - - /** - * Constructs a new ExpressionCondition. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IExpressionCondition); - - /** ExpressionCondition expression. */ - public expression: string; - - /** - * Creates a new ExpressionCondition instance using the specified properties. - * @param [properties] Properties to set - * @returns ExpressionCondition instance - */ - public static create(properties?: google.cloud.ces.v1beta.IExpressionCondition): google.cloud.ces.v1beta.ExpressionCondition; - - /** - * Encodes the specified ExpressionCondition message. Does not implicitly {@link google.cloud.ces.v1beta.ExpressionCondition.verify|verify} messages. - * @param message ExpressionCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IExpressionCondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExpressionCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExpressionCondition.verify|verify} messages. - * @param message ExpressionCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IExpressionCondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExpressionCondition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExpressionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ExpressionCondition; - - /** - * Decodes an ExpressionCondition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExpressionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ExpressionCondition; - - /** - * Verifies an ExpressionCondition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExpressionCondition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExpressionCondition - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ExpressionCondition; - - /** - * Creates a plain object from an ExpressionCondition message. Also converts values to other types if specified. - * @param message ExpressionCondition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ExpressionCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExpressionCondition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExpressionCondition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonCodeCondition. */ - interface IPythonCodeCondition { - - /** PythonCodeCondition pythonCode */ - pythonCode?: (string|null); - } - - /** Represents a PythonCodeCondition. */ - class PythonCodeCondition implements IPythonCodeCondition { - - /** - * Constructs a new PythonCodeCondition. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IPythonCodeCondition); - - /** PythonCodeCondition pythonCode. */ - public pythonCode: string; - - /** - * Creates a new PythonCodeCondition instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonCodeCondition instance - */ - public static create(properties?: google.cloud.ces.v1beta.IPythonCodeCondition): google.cloud.ces.v1beta.PythonCodeCondition; - - /** - * Encodes the specified PythonCodeCondition message. Does not implicitly {@link google.cloud.ces.v1beta.PythonCodeCondition.verify|verify} messages. - * @param message PythonCodeCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IPythonCodeCondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonCodeCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.PythonCodeCondition.verify|verify} messages. - * @param message PythonCodeCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IPythonCodeCondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonCodeCondition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonCodeCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.PythonCodeCondition; - - /** - * Decodes a PythonCodeCondition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonCodeCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.PythonCodeCondition; - - /** - * Verifies a PythonCodeCondition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PythonCodeCondition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonCodeCondition - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.PythonCodeCondition; - - /** - * Creates a plain object from a PythonCodeCondition message. Also converts values to other types if specified. - * @param message PythonCodeCondition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.PythonCodeCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonCodeCondition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonCodeCondition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TransferRule. */ - interface ITransferRule { - - /** TransferRule deterministicTransfer */ - deterministicTransfer?: (google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer|null); - - /** TransferRule disablePlannerTransfer */ - disablePlannerTransfer?: (google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer|null); - - /** TransferRule childAgent */ - childAgent?: (string|null); - - /** TransferRule direction */ - direction?: (google.cloud.ces.v1beta.TransferRule.Direction|keyof typeof google.cloud.ces.v1beta.TransferRule.Direction|null); - } - - /** Represents a TransferRule. */ - class TransferRule implements ITransferRule { - - /** - * Constructs a new TransferRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ITransferRule); - - /** TransferRule deterministicTransfer. */ - public deterministicTransfer?: (google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer|null); - - /** TransferRule disablePlannerTransfer. */ - public disablePlannerTransfer?: (google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer|null); - - /** TransferRule childAgent. */ - public childAgent: string; - - /** TransferRule direction. */ - public direction: (google.cloud.ces.v1beta.TransferRule.Direction|keyof typeof google.cloud.ces.v1beta.TransferRule.Direction); - - /** TransferRule ruleType. */ - public ruleType?: ("deterministicTransfer"|"disablePlannerTransfer"); - - /** - * Creates a new TransferRule instance using the specified properties. - * @param [properties] Properties to set - * @returns TransferRule instance - */ - public static create(properties?: google.cloud.ces.v1beta.ITransferRule): google.cloud.ces.v1beta.TransferRule; - - /** - * Encodes the specified TransferRule message. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.verify|verify} messages. - * @param message TransferRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ITransferRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransferRule message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.verify|verify} messages. - * @param message TransferRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ITransferRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransferRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransferRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TransferRule; - - /** - * Decodes a TransferRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransferRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TransferRule; - - /** - * Verifies a TransferRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TransferRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransferRule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TransferRule; - - /** - * Creates a plain object from a TransferRule message. Also converts values to other types if specified. - * @param message TransferRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.TransferRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransferRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransferRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TransferRule { - - /** Properties of a DeterministicTransfer. */ - interface IDeterministicTransfer { - - /** DeterministicTransfer expressionCondition */ - expressionCondition?: (google.cloud.ces.v1beta.IExpressionCondition|null); - - /** DeterministicTransfer pythonCodeCondition */ - pythonCodeCondition?: (google.cloud.ces.v1beta.IPythonCodeCondition|null); - } - - /** Represents a DeterministicTransfer. */ - class DeterministicTransfer implements IDeterministicTransfer { - - /** - * Constructs a new DeterministicTransfer. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer); - - /** DeterministicTransfer expressionCondition. */ - public expressionCondition?: (google.cloud.ces.v1beta.IExpressionCondition|null); - - /** DeterministicTransfer pythonCodeCondition. */ - public pythonCodeCondition?: (google.cloud.ces.v1beta.IPythonCodeCondition|null); - - /** DeterministicTransfer conditionType. */ - public conditionType?: ("expressionCondition"|"pythonCodeCondition"); - - /** - * Creates a new DeterministicTransfer instance using the specified properties. - * @param [properties] Properties to set - * @returns DeterministicTransfer instance - */ - public static create(properties?: google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer): google.cloud.ces.v1beta.TransferRule.DeterministicTransfer; - - /** - * Encodes the specified DeterministicTransfer message. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.verify|verify} messages. - * @param message DeterministicTransfer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeterministicTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.verify|verify} messages. - * @param message DeterministicTransfer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeterministicTransfer message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeterministicTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TransferRule.DeterministicTransfer; - - /** - * Decodes a DeterministicTransfer message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeterministicTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TransferRule.DeterministicTransfer; - - /** - * Verifies a DeterministicTransfer message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeterministicTransfer message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeterministicTransfer - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TransferRule.DeterministicTransfer; - - /** - * Creates a plain object from a DeterministicTransfer message. Also converts values to other types if specified. - * @param message DeterministicTransfer - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.TransferRule.DeterministicTransfer, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeterministicTransfer to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeterministicTransfer - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DisablePlannerTransfer. */ - interface IDisablePlannerTransfer { - - /** DisablePlannerTransfer expressionCondition */ - expressionCondition?: (google.cloud.ces.v1beta.IExpressionCondition|null); - } - - /** Represents a DisablePlannerTransfer. */ - class DisablePlannerTransfer implements IDisablePlannerTransfer { - - /** - * Constructs a new DisablePlannerTransfer. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer); - - /** DisablePlannerTransfer expressionCondition. */ - public expressionCondition?: (google.cloud.ces.v1beta.IExpressionCondition|null); - - /** - * Creates a new DisablePlannerTransfer instance using the specified properties. - * @param [properties] Properties to set - * @returns DisablePlannerTransfer instance - */ - public static create(properties?: google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer): google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer; - - /** - * Encodes the specified DisablePlannerTransfer message. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.verify|verify} messages. - * @param message DisablePlannerTransfer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DisablePlannerTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.verify|verify} messages. - * @param message DisablePlannerTransfer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DisablePlannerTransfer message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DisablePlannerTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer; - - /** - * Decodes a DisablePlannerTransfer message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DisablePlannerTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer; - - /** - * Verifies a DisablePlannerTransfer message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DisablePlannerTransfer message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DisablePlannerTransfer - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer; - - /** - * Creates a plain object from a DisablePlannerTransfer message. Also converts values to other types if specified. - * @param message DisablePlannerTransfer - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DisablePlannerTransfer to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DisablePlannerTransfer - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Direction enum. */ - enum Direction { - DIRECTION_UNSPECIFIED = 0, - PARENT_TO_CHILD = 1, - CHILD_TO_PARENT = 2 - } - } - - /** ExecutionType enum. */ - enum ExecutionType { - EXECUTION_TYPE_UNSPECIFIED = 0, - SYNCHRONOUS = 1, - ASYNCHRONOUS = 2 - } - - /** Properties of a Callback. */ - interface ICallback { - - /** Callback pythonCode */ - pythonCode?: (string|null); - - /** Callback description */ - description?: (string|null); - - /** Callback disabled */ - disabled?: (boolean|null); - - /** Callback proactiveExecutionEnabled */ - proactiveExecutionEnabled?: (boolean|null); - } - - /** Represents a Callback. */ - class Callback implements ICallback { - - /** - * Constructs a new Callback. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ICallback); - - /** Callback pythonCode. */ - public pythonCode?: (string|null); - - /** Callback description. */ - public description: string; - - /** Callback disabled. */ - public disabled: boolean; - - /** Callback proactiveExecutionEnabled. */ - public proactiveExecutionEnabled: boolean; - - /** Callback callback. */ - public callback?: "pythonCode"; - - /** - * Creates a new Callback instance using the specified properties. - * @param [properties] Properties to set - * @returns Callback instance - */ - public static create(properties?: google.cloud.ces.v1beta.ICallback): google.cloud.ces.v1beta.Callback; - - /** - * Encodes the specified Callback message. Does not implicitly {@link google.cloud.ces.v1beta.Callback.verify|verify} messages. - * @param message Callback message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ICallback, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Callback message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Callback.verify|verify} messages. - * @param message Callback message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ICallback, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Callback message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Callback - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Callback; - - /** - * Decodes a Callback message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Callback - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Callback; - - /** - * Verifies a Callback message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Callback message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Callback - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Callback; - - /** - * Creates a plain object from a Callback message. Also converts values to other types if specified. - * @param message Callback - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Callback, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Callback to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Callback - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ModelSettings. */ - interface IModelSettings { - - /** ModelSettings model */ - model?: (string|null); - - /** ModelSettings temperature */ - temperature?: (number|null); - } - - /** Represents a ModelSettings. */ - class ModelSettings implements IModelSettings { - - /** - * Constructs a new ModelSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IModelSettings); - - /** ModelSettings model. */ - public model: string; - - /** ModelSettings temperature. */ - public temperature?: (number|null); - - /** - * Creates a new ModelSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ModelSettings instance - */ - public static create(properties?: google.cloud.ces.v1beta.IModelSettings): google.cloud.ces.v1beta.ModelSettings; - - /** - * Encodes the specified ModelSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ModelSettings.verify|verify} messages. - * @param message ModelSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IModelSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ModelSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ModelSettings.verify|verify} messages. - * @param message ModelSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IModelSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ModelSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ModelSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ModelSettings; - - /** - * Decodes a ModelSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ModelSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ModelSettings; - - /** - * Verifies a ModelSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ModelSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ModelSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ModelSettings; - - /** - * Creates a plain object from a ModelSettings message. Also converts values to other types if specified. - * @param message ModelSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ModelSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ModelSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ModelSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TriggerAction. */ - interface ITriggerAction { - - /** TriggerAction respondImmediately */ - respondImmediately?: (google.cloud.ces.v1beta.TriggerAction.IRespondImmediately|null); - - /** TriggerAction transferAgent */ - transferAgent?: (google.cloud.ces.v1beta.TriggerAction.ITransferAgent|null); - - /** TriggerAction generativeAnswer */ - generativeAnswer?: (google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer|null); - } - - /** Represents a TriggerAction. */ - class TriggerAction implements ITriggerAction { - - /** - * Constructs a new TriggerAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ITriggerAction); - - /** TriggerAction respondImmediately. */ - public respondImmediately?: (google.cloud.ces.v1beta.TriggerAction.IRespondImmediately|null); - - /** TriggerAction transferAgent. */ - public transferAgent?: (google.cloud.ces.v1beta.TriggerAction.ITransferAgent|null); - - /** TriggerAction generativeAnswer. */ - public generativeAnswer?: (google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer|null); - - /** TriggerAction action. */ - public action?: ("respondImmediately"|"transferAgent"|"generativeAnswer"); - - /** - * Creates a new TriggerAction instance using the specified properties. - * @param [properties] Properties to set - * @returns TriggerAction instance - */ - public static create(properties?: google.cloud.ces.v1beta.ITriggerAction): google.cloud.ces.v1beta.TriggerAction; - - /** - * Encodes the specified TriggerAction message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.verify|verify} messages. - * @param message TriggerAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ITriggerAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TriggerAction message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.verify|verify} messages. - * @param message TriggerAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ITriggerAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TriggerAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TriggerAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TriggerAction; - - /** - * Decodes a TriggerAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TriggerAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TriggerAction; - - /** - * Verifies a TriggerAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TriggerAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TriggerAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TriggerAction; - - /** - * Creates a plain object from a TriggerAction message. Also converts values to other types if specified. - * @param message TriggerAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.TriggerAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TriggerAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TriggerAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TriggerAction { - - /** Properties of a Response. */ - interface IResponse { - - /** Response text */ - text?: (string|null); - - /** Response disabled */ - disabled?: (boolean|null); - } - - /** Represents a Response. */ - class Response implements IResponse { - - /** - * Constructs a new Response. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.TriggerAction.IResponse); - - /** Response text. */ - public text: string; - - /** Response disabled. */ - public disabled: boolean; - - /** - * Creates a new Response instance using the specified properties. - * @param [properties] Properties to set - * @returns Response instance - */ - public static create(properties?: google.cloud.ces.v1beta.TriggerAction.IResponse): google.cloud.ces.v1beta.TriggerAction.Response; - - /** - * Encodes the specified Response message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.Response.verify|verify} messages. - * @param message Response message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.TriggerAction.IResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Response message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.Response.verify|verify} messages. - * @param message Response message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.TriggerAction.IResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Response message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Response - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TriggerAction.Response; - - /** - * Decodes a Response message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Response - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TriggerAction.Response; - - /** - * Verifies a Response message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Response message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Response - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TriggerAction.Response; - - /** - * Creates a plain object from a Response message. Also converts values to other types if specified. - * @param message Response - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.TriggerAction.Response, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Response to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Response - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RespondImmediately. */ - interface IRespondImmediately { - - /** RespondImmediately responses */ - responses?: (google.cloud.ces.v1beta.TriggerAction.IResponse[]|null); - } - - /** Represents a RespondImmediately. */ - class RespondImmediately implements IRespondImmediately { - - /** - * Constructs a new RespondImmediately. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.TriggerAction.IRespondImmediately); - - /** RespondImmediately responses. */ - public responses: google.cloud.ces.v1beta.TriggerAction.IResponse[]; - - /** - * Creates a new RespondImmediately instance using the specified properties. - * @param [properties] Properties to set - * @returns RespondImmediately instance - */ - public static create(properties?: google.cloud.ces.v1beta.TriggerAction.IRespondImmediately): google.cloud.ces.v1beta.TriggerAction.RespondImmediately; - - /** - * Encodes the specified RespondImmediately message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.RespondImmediately.verify|verify} messages. - * @param message RespondImmediately message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.TriggerAction.IRespondImmediately, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RespondImmediately message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.RespondImmediately.verify|verify} messages. - * @param message RespondImmediately message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.TriggerAction.IRespondImmediately, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RespondImmediately message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RespondImmediately - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TriggerAction.RespondImmediately; - - /** - * Decodes a RespondImmediately message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RespondImmediately - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TriggerAction.RespondImmediately; - - /** - * Verifies a RespondImmediately message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RespondImmediately message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RespondImmediately - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TriggerAction.RespondImmediately; - - /** - * Creates a plain object from a RespondImmediately message. Also converts values to other types if specified. - * @param message RespondImmediately - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.TriggerAction.RespondImmediately, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RespondImmediately to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RespondImmediately - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GenerativeAnswer. */ - interface IGenerativeAnswer { - - /** GenerativeAnswer prompt */ - prompt?: (string|null); - } - - /** Represents a GenerativeAnswer. */ - class GenerativeAnswer implements IGenerativeAnswer { - - /** - * Constructs a new GenerativeAnswer. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer); - - /** GenerativeAnswer prompt. */ - public prompt: string; - - /** - * Creates a new GenerativeAnswer instance using the specified properties. - * @param [properties] Properties to set - * @returns GenerativeAnswer instance - */ - public static create(properties?: google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer): google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer; - - /** - * Encodes the specified GenerativeAnswer message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.verify|verify} messages. - * @param message GenerativeAnswer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenerativeAnswer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.verify|verify} messages. - * @param message GenerativeAnswer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenerativeAnswer message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenerativeAnswer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer; - - /** - * Decodes a GenerativeAnswer message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenerativeAnswer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer; - - /** - * Verifies a GenerativeAnswer message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenerativeAnswer message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenerativeAnswer - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer; - - /** - * Creates a plain object from a GenerativeAnswer message. Also converts values to other types if specified. - * @param message GenerativeAnswer - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenerativeAnswer to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenerativeAnswer - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TransferAgent. */ - interface ITransferAgent { - - /** TransferAgent agent */ - agent?: (string|null); - } - - /** Represents a TransferAgent. */ - class TransferAgent implements ITransferAgent { - - /** - * Constructs a new TransferAgent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.TriggerAction.ITransferAgent); - - /** TransferAgent agent. */ - public agent: string; - - /** - * Creates a new TransferAgent instance using the specified properties. - * @param [properties] Properties to set - * @returns TransferAgent instance - */ - public static create(properties?: google.cloud.ces.v1beta.TriggerAction.ITransferAgent): google.cloud.ces.v1beta.TriggerAction.TransferAgent; - - /** - * Encodes the specified TransferAgent message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.TransferAgent.verify|verify} messages. - * @param message TransferAgent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.TriggerAction.ITransferAgent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransferAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.TransferAgent.verify|verify} messages. - * @param message TransferAgent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.TriggerAction.ITransferAgent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransferAgent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransferAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TriggerAction.TransferAgent; - - /** - * Decodes a TransferAgent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransferAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TriggerAction.TransferAgent; - - /** - * Verifies a TransferAgent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TransferAgent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransferAgent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TriggerAction.TransferAgent; - - /** - * Creates a plain object from a TransferAgent message. Also converts values to other types if specified. - * @param message TransferAgent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.TriggerAction.TransferAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransferAgent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransferAgent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a TlsConfig. */ - interface ITlsConfig { - - /** TlsConfig caCerts */ - caCerts?: (google.cloud.ces.v1beta.TlsConfig.ICaCert[]|null); - } - - /** Represents a TlsConfig. */ - class TlsConfig implements ITlsConfig { - - /** - * Constructs a new TlsConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ITlsConfig); - - /** TlsConfig caCerts. */ - public caCerts: google.cloud.ces.v1beta.TlsConfig.ICaCert[]; - - /** - * Creates a new TlsConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns TlsConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.ITlsConfig): google.cloud.ces.v1beta.TlsConfig; - - /** - * Encodes the specified TlsConfig message. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.verify|verify} messages. - * @param message TlsConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ITlsConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TlsConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.verify|verify} messages. - * @param message TlsConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ITlsConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TlsConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TlsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TlsConfig; - - /** - * Decodes a TlsConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TlsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TlsConfig; - - /** - * Verifies a TlsConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TlsConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TlsConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TlsConfig; - - /** - * Creates a plain object from a TlsConfig message. Also converts values to other types if specified. - * @param message TlsConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.TlsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TlsConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TlsConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TlsConfig { - - /** Properties of a CaCert. */ - interface ICaCert { - - /** CaCert displayName */ - displayName?: (string|null); - - /** CaCert cert */ - cert?: (Uint8Array|Buffer|string|null); - } - - /** Represents a CaCert. */ - class CaCert implements ICaCert { - - /** - * Constructs a new CaCert. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.TlsConfig.ICaCert); - - /** CaCert displayName. */ - public displayName: string; - - /** CaCert cert. */ - public cert: (Uint8Array|Buffer|string); - - /** - * Creates a new CaCert instance using the specified properties. - * @param [properties] Properties to set - * @returns CaCert instance - */ - public static create(properties?: google.cloud.ces.v1beta.TlsConfig.ICaCert): google.cloud.ces.v1beta.TlsConfig.CaCert; - - /** - * Encodes the specified CaCert message. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.CaCert.verify|verify} messages. - * @param message CaCert message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.TlsConfig.ICaCert, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CaCert message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.CaCert.verify|verify} messages. - * @param message CaCert message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.TlsConfig.ICaCert, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CaCert message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CaCert - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TlsConfig.CaCert; - - /** - * Decodes a CaCert message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CaCert - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TlsConfig.CaCert; - - /** - * Verifies a CaCert message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CaCert message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CaCert - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TlsConfig.CaCert; - - /** - * Creates a plain object from a CaCert message. Also converts values to other types if specified. - * @param message CaCert - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.TlsConfig.CaCert, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CaCert to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CaCert - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ServiceDirectoryConfig. */ - interface IServiceDirectoryConfig { - - /** ServiceDirectoryConfig service */ - service?: (string|null); - } - - /** Represents a ServiceDirectoryConfig. */ - class ServiceDirectoryConfig implements IServiceDirectoryConfig { - - /** - * Constructs a new ServiceDirectoryConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IServiceDirectoryConfig); - - /** ServiceDirectoryConfig service. */ - public service: string; - - /** - * Creates a new ServiceDirectoryConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDirectoryConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IServiceDirectoryConfig): google.cloud.ces.v1beta.ServiceDirectoryConfig; - - /** - * Encodes the specified ServiceDirectoryConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ServiceDirectoryConfig.verify|verify} messages. - * @param message ServiceDirectoryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IServiceDirectoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDirectoryConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ServiceDirectoryConfig.verify|verify} messages. - * @param message ServiceDirectoryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IServiceDirectoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDirectoryConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDirectoryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ServiceDirectoryConfig; - - /** - * Decodes a ServiceDirectoryConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDirectoryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ServiceDirectoryConfig; - - /** - * Verifies a ServiceDirectoryConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDirectoryConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDirectoryConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ServiceDirectoryConfig; - - /** - * Creates a plain object from a ServiceDirectoryConfig message. Also converts values to other types if specified. - * @param message ServiceDirectoryConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ServiceDirectoryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDirectoryConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDirectoryConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ChannelProfile. */ - interface IChannelProfile { - - /** ChannelProfile profileId */ - profileId?: (string|null); - - /** ChannelProfile channelType */ - channelType?: (google.cloud.ces.v1beta.ChannelProfile.ChannelType|keyof typeof google.cloud.ces.v1beta.ChannelProfile.ChannelType|null); - - /** ChannelProfile personaProperty */ - personaProperty?: (google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty|null); - - /** ChannelProfile disableDtmf */ - disableDtmf?: (boolean|null); - - /** ChannelProfile disableBargeInControl */ - disableBargeInControl?: (boolean|null); - - /** ChannelProfile webWidgetConfig */ - webWidgetConfig?: (google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig|null); - - /** ChannelProfile noiseSuppressionLevel */ - noiseSuppressionLevel?: (string|null); - } - - /** Represents a ChannelProfile. */ - class ChannelProfile implements IChannelProfile { - - /** - * Constructs a new ChannelProfile. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IChannelProfile); - - /** ChannelProfile profileId. */ - public profileId: string; - - /** ChannelProfile channelType. */ - public channelType: (google.cloud.ces.v1beta.ChannelProfile.ChannelType|keyof typeof google.cloud.ces.v1beta.ChannelProfile.ChannelType); - - /** ChannelProfile personaProperty. */ - public personaProperty?: (google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty|null); - - /** ChannelProfile disableDtmf. */ - public disableDtmf: boolean; - - /** ChannelProfile disableBargeInControl. */ - public disableBargeInControl: boolean; - - /** ChannelProfile webWidgetConfig. */ - public webWidgetConfig?: (google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig|null); - - /** ChannelProfile noiseSuppressionLevel. */ - public noiseSuppressionLevel: string; - - /** - * Creates a new ChannelProfile instance using the specified properties. - * @param [properties] Properties to set - * @returns ChannelProfile instance - */ - public static create(properties?: google.cloud.ces.v1beta.IChannelProfile): google.cloud.ces.v1beta.ChannelProfile; - - /** - * Encodes the specified ChannelProfile message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.verify|verify} messages. - * @param message ChannelProfile message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IChannelProfile, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChannelProfile message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.verify|verify} messages. - * @param message ChannelProfile message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IChannelProfile, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChannelProfile message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChannelProfile - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ChannelProfile; - - /** - * Decodes a ChannelProfile message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChannelProfile - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ChannelProfile; - - /** - * Verifies a ChannelProfile message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ChannelProfile message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChannelProfile - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ChannelProfile; - - /** - * Creates a plain object from a ChannelProfile message. Also converts values to other types if specified. - * @param message ChannelProfile - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ChannelProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChannelProfile to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ChannelProfile - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ChannelProfile { - - /** Properties of a PersonaProperty. */ - interface IPersonaProperty { - - /** PersonaProperty persona */ - persona?: (google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona|keyof typeof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona|null); - } - - /** Represents a PersonaProperty. */ - class PersonaProperty implements IPersonaProperty { - - /** - * Constructs a new PersonaProperty. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty); - - /** PersonaProperty persona. */ - public persona: (google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona|keyof typeof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona); - - /** - * Creates a new PersonaProperty instance using the specified properties. - * @param [properties] Properties to set - * @returns PersonaProperty instance - */ - public static create(properties?: google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty): google.cloud.ces.v1beta.ChannelProfile.PersonaProperty; - - /** - * Encodes the specified PersonaProperty message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.verify|verify} messages. - * @param message PersonaProperty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PersonaProperty message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.verify|verify} messages. - * @param message PersonaProperty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PersonaProperty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PersonaProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ChannelProfile.PersonaProperty; - - /** - * Decodes a PersonaProperty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PersonaProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ChannelProfile.PersonaProperty; - - /** - * Verifies a PersonaProperty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PersonaProperty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PersonaProperty - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ChannelProfile.PersonaProperty; - - /** - * Creates a plain object from a PersonaProperty message. Also converts values to other types if specified. - * @param message PersonaProperty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ChannelProfile.PersonaProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PersonaProperty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PersonaProperty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PersonaProperty { - - /** Persona enum. */ - enum Persona { - UNKNOWN = 0, - CONCISE = 1, - CHATTY = 2 - } - } - - /** Properties of a WebWidgetConfig. */ - interface IWebWidgetConfig { - - /** WebWidgetConfig modality */ - modality?: (google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality|keyof typeof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality|null); - - /** WebWidgetConfig theme */ - theme?: (google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme|keyof typeof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme|null); - - /** WebWidgetConfig webWidgetTitle */ - webWidgetTitle?: (string|null); - - /** WebWidgetConfig securitySettings */ - securitySettings?: (google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings|null); - } - - /** Represents a WebWidgetConfig. */ - class WebWidgetConfig implements IWebWidgetConfig { - - /** - * Constructs a new WebWidgetConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig); - - /** WebWidgetConfig modality. */ - public modality: (google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality|keyof typeof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality); - - /** WebWidgetConfig theme. */ - public theme: (google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme|keyof typeof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme); - - /** WebWidgetConfig webWidgetTitle. */ - public webWidgetTitle: string; - - /** WebWidgetConfig securitySettings. */ - public securitySettings?: (google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings|null); - - /** - * Creates a new WebWidgetConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns WebWidgetConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig; - - /** - * Encodes the specified WebWidgetConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.verify|verify} messages. - * @param message WebWidgetConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WebWidgetConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.verify|verify} messages. - * @param message WebWidgetConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WebWidgetConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WebWidgetConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig; - - /** - * Decodes a WebWidgetConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WebWidgetConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig; - - /** - * Verifies a WebWidgetConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WebWidgetConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WebWidgetConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig; - - /** - * Creates a plain object from a WebWidgetConfig message. Also converts values to other types if specified. - * @param message WebWidgetConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WebWidgetConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WebWidgetConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace WebWidgetConfig { - - /** Properties of a SecuritySettings. */ - interface ISecuritySettings { - - /** SecuritySettings enablePublicAccess */ - enablePublicAccess?: (boolean|null); - - /** SecuritySettings enableOriginCheck */ - enableOriginCheck?: (boolean|null); - - /** SecuritySettings allowedOrigins */ - allowedOrigins?: (string[]|null); - - /** SecuritySettings enableRecaptcha */ - enableRecaptcha?: (boolean|null); - } - - /** Represents a SecuritySettings. */ - class SecuritySettings implements ISecuritySettings { - - /** - * Constructs a new SecuritySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings); - - /** SecuritySettings enablePublicAccess. */ - public enablePublicAccess: boolean; - - /** SecuritySettings enableOriginCheck. */ - public enableOriginCheck: boolean; - - /** SecuritySettings allowedOrigins. */ - public allowedOrigins: string[]; - - /** SecuritySettings enableRecaptcha. */ - public enableRecaptcha: boolean; - - /** - * Creates a new SecuritySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns SecuritySettings instance - */ - public static create(properties?: google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings; - - /** - * Encodes the specified SecuritySettings message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. - * @param message SecuritySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. - * @param message SecuritySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecuritySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecuritySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings; - - /** - * Decodes a SecuritySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecuritySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings; - - /** - * Verifies a SecuritySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SecuritySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecuritySettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings; - - /** - * Creates a plain object from a SecuritySettings message. Also converts values to other types if specified. - * @param message SecuritySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecuritySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SecuritySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Modality enum. */ - enum Modality { - MODALITY_UNSPECIFIED = 0, - CHAT_AND_VOICE = 1, - VOICE_ONLY = 2, - CHAT_ONLY = 3 - } - - /** Theme enum. */ - enum Theme { - THEME_UNSPECIFIED = 0, - LIGHT = 1, - DARK = 2 - } - } - - /** ChannelType enum. */ - enum ChannelType { - UNKNOWN = 0, - WEB_UI = 2, - API = 3, - TWILIO = 4, - GOOGLE_TELEPHONY_PLATFORM = 5, - CONTACT_CENTER_AS_A_SERVICE = 6, - FIVE9 = 7, - CONTACT_CENTER_INTEGRATION = 8 - } - } - - /** Properties of a Span. */ - interface ISpan { - - /** Span name */ - name?: (string|null); - - /** Span startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** Span endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** Span duration */ - duration?: (google.protobuf.IDuration|null); - - /** Span attributes */ - attributes?: (google.protobuf.IStruct|null); - - /** Span childSpans */ - childSpans?: (google.cloud.ces.v1beta.ISpan[]|null); - } - - /** Represents a Span. */ - class Span implements ISpan { - - /** - * Constructs a new Span. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ISpan); - - /** Span name. */ - public name: string; - - /** Span startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** Span endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** Span duration. */ - public duration?: (google.protobuf.IDuration|null); - - /** Span attributes. */ - public attributes?: (google.protobuf.IStruct|null); - - /** Span childSpans. */ - public childSpans: google.cloud.ces.v1beta.ISpan[]; - - /** - * Creates a new Span instance using the specified properties. - * @param [properties] Properties to set - * @returns Span instance - */ - public static create(properties?: google.cloud.ces.v1beta.ISpan): google.cloud.ces.v1beta.Span; - - /** - * Encodes the specified Span message. Does not implicitly {@link google.cloud.ces.v1beta.Span.verify|verify} messages. - * @param message Span message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ISpan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Span message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Span.verify|verify} messages. - * @param message Span message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ISpan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Span message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Span - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Span; - - /** - * Decodes a Span message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Span - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Span; - - /** - * Verifies a Span message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Span message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Span - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Span; - - /** - * Creates a plain object from a Span message. Also converts values to other types if specified. - * @param message Span - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Span, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Span to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Span - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents an AgentService */ - class AgentService extends $protobuf.rpc.Service { - - /** - * Constructs a new AgentService 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 AgentService 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): AgentService; - - /** - * Calls ListApps. - * @param request ListAppsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAppsResponse - */ - public listApps(request: google.cloud.ces.v1beta.IListAppsRequest, callback: google.cloud.ces.v1beta.AgentService.ListAppsCallback): void; - - /** - * Calls ListApps. - * @param request ListAppsRequest message or plain object - * @returns Promise - */ - public listApps(request: google.cloud.ces.v1beta.IListAppsRequest): Promise; - - /** - * Calls GetApp. - * @param request GetAppRequest message or plain object - * @param callback Node-style callback called with the error, if any, and App - */ - public getApp(request: google.cloud.ces.v1beta.IGetAppRequest, callback: google.cloud.ces.v1beta.AgentService.GetAppCallback): void; - - /** - * Calls GetApp. - * @param request GetAppRequest message or plain object - * @returns Promise - */ - public getApp(request: google.cloud.ces.v1beta.IGetAppRequest): Promise; - - /** - * Calls CreateApp. - * @param request CreateAppRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createApp(request: google.cloud.ces.v1beta.ICreateAppRequest, callback: google.cloud.ces.v1beta.AgentService.CreateAppCallback): void; - - /** - * Calls CreateApp. - * @param request CreateAppRequest message or plain object - * @returns Promise - */ - public createApp(request: google.cloud.ces.v1beta.ICreateAppRequest): Promise; - - /** - * Calls UpdateApp. - * @param request UpdateAppRequest message or plain object - * @param callback Node-style callback called with the error, if any, and App - */ - public updateApp(request: google.cloud.ces.v1beta.IUpdateAppRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateAppCallback): void; - - /** - * Calls UpdateApp. - * @param request UpdateAppRequest message or plain object - * @returns Promise - */ - public updateApp(request: google.cloud.ces.v1beta.IUpdateAppRequest): Promise; - - /** - * Calls DeleteApp. - * @param request DeleteAppRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteApp(request: google.cloud.ces.v1beta.IDeleteAppRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteAppCallback): void; - - /** - * Calls DeleteApp. - * @param request DeleteAppRequest message or plain object - * @returns Promise - */ - public deleteApp(request: google.cloud.ces.v1beta.IDeleteAppRequest): Promise; - - /** - * Calls ExportApp. - * @param request ExportAppRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public exportApp(request: google.cloud.ces.v1beta.IExportAppRequest, callback: google.cloud.ces.v1beta.AgentService.ExportAppCallback): void; - - /** - * Calls ExportApp. - * @param request ExportAppRequest message or plain object - * @returns Promise - */ - public exportApp(request: google.cloud.ces.v1beta.IExportAppRequest): Promise; - - /** - * Calls ImportApp. - * @param request ImportAppRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public importApp(request: google.cloud.ces.v1beta.IImportAppRequest, callback: google.cloud.ces.v1beta.AgentService.ImportAppCallback): void; - - /** - * Calls ImportApp. - * @param request ImportAppRequest message or plain object - * @returns Promise - */ - public importApp(request: google.cloud.ces.v1beta.IImportAppRequest): Promise; - - /** - * Calls ListAgents. - * @param request ListAgentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAgentsResponse - */ - public listAgents(request: google.cloud.ces.v1beta.IListAgentsRequest, callback: google.cloud.ces.v1beta.AgentService.ListAgentsCallback): void; - - /** - * Calls ListAgents. - * @param request ListAgentsRequest message or plain object - * @returns Promise - */ - public listAgents(request: google.cloud.ces.v1beta.IListAgentsRequest): Promise; - - /** - * Calls GetAgent. - * @param request GetAgentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Agent - */ - public getAgent(request: google.cloud.ces.v1beta.IGetAgentRequest, callback: google.cloud.ces.v1beta.AgentService.GetAgentCallback): void; - - /** - * Calls GetAgent. - * @param request GetAgentRequest message or plain object - * @returns Promise - */ - public getAgent(request: google.cloud.ces.v1beta.IGetAgentRequest): Promise; - - /** - * Calls CreateAgent. - * @param request CreateAgentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Agent - */ - public createAgent(request: google.cloud.ces.v1beta.ICreateAgentRequest, callback: google.cloud.ces.v1beta.AgentService.CreateAgentCallback): void; - - /** - * Calls CreateAgent. - * @param request CreateAgentRequest message or plain object - * @returns Promise - */ - public createAgent(request: google.cloud.ces.v1beta.ICreateAgentRequest): Promise; - - /** - * Calls UpdateAgent. - * @param request UpdateAgentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Agent - */ - public updateAgent(request: google.cloud.ces.v1beta.IUpdateAgentRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateAgentCallback): void; - - /** - * Calls UpdateAgent. - * @param request UpdateAgentRequest message or plain object - * @returns Promise - */ - public updateAgent(request: google.cloud.ces.v1beta.IUpdateAgentRequest): Promise; - - /** - * Calls DeleteAgent. - * @param request DeleteAgentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteAgent(request: google.cloud.ces.v1beta.IDeleteAgentRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteAgentCallback): void; - - /** - * Calls DeleteAgent. - * @param request DeleteAgentRequest message or plain object - * @returns Promise - */ - public deleteAgent(request: google.cloud.ces.v1beta.IDeleteAgentRequest): Promise; - - /** - * Calls ListExamples. - * @param request ListExamplesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListExamplesResponse - */ - public listExamples(request: google.cloud.ces.v1beta.IListExamplesRequest, callback: google.cloud.ces.v1beta.AgentService.ListExamplesCallback): void; - - /** - * Calls ListExamples. - * @param request ListExamplesRequest message or plain object - * @returns Promise - */ - public listExamples(request: google.cloud.ces.v1beta.IListExamplesRequest): Promise; - - /** - * Calls GetExample. - * @param request GetExampleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Example - */ - public getExample(request: google.cloud.ces.v1beta.IGetExampleRequest, callback: google.cloud.ces.v1beta.AgentService.GetExampleCallback): void; - - /** - * Calls GetExample. - * @param request GetExampleRequest message or plain object - * @returns Promise - */ - public getExample(request: google.cloud.ces.v1beta.IGetExampleRequest): Promise; - - /** - * Calls CreateExample. - * @param request CreateExampleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Example - */ - public createExample(request: google.cloud.ces.v1beta.ICreateExampleRequest, callback: google.cloud.ces.v1beta.AgentService.CreateExampleCallback): void; - - /** - * Calls CreateExample. - * @param request CreateExampleRequest message or plain object - * @returns Promise - */ - public createExample(request: google.cloud.ces.v1beta.ICreateExampleRequest): Promise; - - /** - * Calls UpdateExample. - * @param request UpdateExampleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Example - */ - public updateExample(request: google.cloud.ces.v1beta.IUpdateExampleRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateExampleCallback): void; - - /** - * Calls UpdateExample. - * @param request UpdateExampleRequest message or plain object - * @returns Promise - */ - public updateExample(request: google.cloud.ces.v1beta.IUpdateExampleRequest): Promise; - - /** - * Calls DeleteExample. - * @param request DeleteExampleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteExample(request: google.cloud.ces.v1beta.IDeleteExampleRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteExampleCallback): void; - - /** - * Calls DeleteExample. - * @param request DeleteExampleRequest message or plain object - * @returns Promise - */ - public deleteExample(request: google.cloud.ces.v1beta.IDeleteExampleRequest): Promise; - - /** - * Calls ListTools. - * @param request ListToolsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListToolsResponse - */ - public listTools(request: google.cloud.ces.v1beta.IListToolsRequest, callback: google.cloud.ces.v1beta.AgentService.ListToolsCallback): void; - - /** - * Calls ListTools. - * @param request ListToolsRequest message or plain object - * @returns Promise - */ - public listTools(request: google.cloud.ces.v1beta.IListToolsRequest): Promise; - - /** - * Calls GetTool. - * @param request GetToolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Tool - */ - public getTool(request: google.cloud.ces.v1beta.IGetToolRequest, callback: google.cloud.ces.v1beta.AgentService.GetToolCallback): void; - - /** - * Calls GetTool. - * @param request GetToolRequest message or plain object - * @returns Promise - */ - public getTool(request: google.cloud.ces.v1beta.IGetToolRequest): Promise; - - /** - * Calls ListConversations. - * @param request ListConversationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListConversationsResponse - */ - public listConversations(request: google.cloud.ces.v1beta.IListConversationsRequest, callback: google.cloud.ces.v1beta.AgentService.ListConversationsCallback): void; - - /** - * Calls ListConversations. - * @param request ListConversationsRequest message or plain object - * @returns Promise - */ - public listConversations(request: google.cloud.ces.v1beta.IListConversationsRequest): Promise; - - /** - * Calls GetConversation. - * @param request GetConversationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Conversation - */ - public getConversation(request: google.cloud.ces.v1beta.IGetConversationRequest, callback: google.cloud.ces.v1beta.AgentService.GetConversationCallback): void; - - /** - * Calls GetConversation. - * @param request GetConversationRequest message or plain object - * @returns Promise - */ - public getConversation(request: google.cloud.ces.v1beta.IGetConversationRequest): Promise; - - /** - * Calls DeleteConversation. - * @param request DeleteConversationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteConversation(request: google.cloud.ces.v1beta.IDeleteConversationRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteConversationCallback): void; - - /** - * Calls DeleteConversation. - * @param request DeleteConversationRequest message or plain object - * @returns Promise - */ - public deleteConversation(request: google.cloud.ces.v1beta.IDeleteConversationRequest): Promise; - - /** - * Calls BatchDeleteConversations. - * @param request BatchDeleteConversationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public batchDeleteConversations(request: google.cloud.ces.v1beta.IBatchDeleteConversationsRequest, callback: google.cloud.ces.v1beta.AgentService.BatchDeleteConversationsCallback): void; - - /** - * Calls BatchDeleteConversations. - * @param request BatchDeleteConversationsRequest message or plain object - * @returns Promise - */ - public batchDeleteConversations(request: google.cloud.ces.v1beta.IBatchDeleteConversationsRequest): Promise; - - /** - * Calls CreateTool. - * @param request CreateToolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Tool - */ - public createTool(request: google.cloud.ces.v1beta.ICreateToolRequest, callback: google.cloud.ces.v1beta.AgentService.CreateToolCallback): void; - - /** - * Calls CreateTool. - * @param request CreateToolRequest message or plain object - * @returns Promise - */ - public createTool(request: google.cloud.ces.v1beta.ICreateToolRequest): Promise; - - /** - * Calls UpdateTool. - * @param request UpdateToolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Tool - */ - public updateTool(request: google.cloud.ces.v1beta.IUpdateToolRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateToolCallback): void; - - /** - * Calls UpdateTool. - * @param request UpdateToolRequest message or plain object - * @returns Promise - */ - public updateTool(request: google.cloud.ces.v1beta.IUpdateToolRequest): Promise; - - /** - * Calls DeleteTool. - * @param request DeleteToolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteTool(request: google.cloud.ces.v1beta.IDeleteToolRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteToolCallback): void; - - /** - * Calls DeleteTool. - * @param request DeleteToolRequest message or plain object - * @returns Promise - */ - public deleteTool(request: google.cloud.ces.v1beta.IDeleteToolRequest): Promise; - - /** - * Calls ListGuardrails. - * @param request ListGuardrailsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListGuardrailsResponse - */ - public listGuardrails(request: google.cloud.ces.v1beta.IListGuardrailsRequest, callback: google.cloud.ces.v1beta.AgentService.ListGuardrailsCallback): void; - - /** - * Calls ListGuardrails. - * @param request ListGuardrailsRequest message or plain object - * @returns Promise - */ - public listGuardrails(request: google.cloud.ces.v1beta.IListGuardrailsRequest): Promise; - - /** - * Calls GetGuardrail. - * @param request GetGuardrailRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Guardrail - */ - public getGuardrail(request: google.cloud.ces.v1beta.IGetGuardrailRequest, callback: google.cloud.ces.v1beta.AgentService.GetGuardrailCallback): void; - - /** - * Calls GetGuardrail. - * @param request GetGuardrailRequest message or plain object - * @returns Promise - */ - public getGuardrail(request: google.cloud.ces.v1beta.IGetGuardrailRequest): Promise; - - /** - * Calls CreateGuardrail. - * @param request CreateGuardrailRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Guardrail - */ - public createGuardrail(request: google.cloud.ces.v1beta.ICreateGuardrailRequest, callback: google.cloud.ces.v1beta.AgentService.CreateGuardrailCallback): void; - - /** - * Calls CreateGuardrail. - * @param request CreateGuardrailRequest message or plain object - * @returns Promise - */ - public createGuardrail(request: google.cloud.ces.v1beta.ICreateGuardrailRequest): Promise; - - /** - * Calls UpdateGuardrail. - * @param request UpdateGuardrailRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Guardrail - */ - public updateGuardrail(request: google.cloud.ces.v1beta.IUpdateGuardrailRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateGuardrailCallback): void; - - /** - * Calls UpdateGuardrail. - * @param request UpdateGuardrailRequest message or plain object - * @returns Promise - */ - public updateGuardrail(request: google.cloud.ces.v1beta.IUpdateGuardrailRequest): Promise; - - /** - * Calls DeleteGuardrail. - * @param request DeleteGuardrailRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteGuardrail(request: google.cloud.ces.v1beta.IDeleteGuardrailRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteGuardrailCallback): void; - - /** - * Calls DeleteGuardrail. - * @param request DeleteGuardrailRequest message or plain object - * @returns Promise - */ - public deleteGuardrail(request: google.cloud.ces.v1beta.IDeleteGuardrailRequest): Promise; - - /** - * Calls ListDeployments. - * @param request ListDeploymentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDeploymentsResponse - */ - public listDeployments(request: google.cloud.ces.v1beta.IListDeploymentsRequest, callback: google.cloud.ces.v1beta.AgentService.ListDeploymentsCallback): void; - - /** - * Calls ListDeployments. - * @param request ListDeploymentsRequest message or plain object - * @returns Promise - */ - public listDeployments(request: google.cloud.ces.v1beta.IListDeploymentsRequest): Promise; - - /** - * Calls GetDeployment. - * @param request GetDeploymentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Deployment - */ - public getDeployment(request: google.cloud.ces.v1beta.IGetDeploymentRequest, callback: google.cloud.ces.v1beta.AgentService.GetDeploymentCallback): void; - - /** - * Calls GetDeployment. - * @param request GetDeploymentRequest message or plain object - * @returns Promise - */ - public getDeployment(request: google.cloud.ces.v1beta.IGetDeploymentRequest): Promise; - - /** - * Calls CreateDeployment. - * @param request CreateDeploymentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Deployment - */ - public createDeployment(request: google.cloud.ces.v1beta.ICreateDeploymentRequest, callback: google.cloud.ces.v1beta.AgentService.CreateDeploymentCallback): void; - - /** - * Calls CreateDeployment. - * @param request CreateDeploymentRequest message or plain object - * @returns Promise - */ - public createDeployment(request: google.cloud.ces.v1beta.ICreateDeploymentRequest): Promise; - - /** - * Calls UpdateDeployment. - * @param request UpdateDeploymentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Deployment - */ - public updateDeployment(request: google.cloud.ces.v1beta.IUpdateDeploymentRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateDeploymentCallback): void; - - /** - * Calls UpdateDeployment. - * @param request UpdateDeploymentRequest message or plain object - * @returns Promise - */ - public updateDeployment(request: google.cloud.ces.v1beta.IUpdateDeploymentRequest): Promise; - - /** - * Calls DeleteDeployment. - * @param request DeleteDeploymentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteDeployment(request: google.cloud.ces.v1beta.IDeleteDeploymentRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteDeploymentCallback): void; - - /** - * Calls DeleteDeployment. - * @param request DeleteDeploymentRequest message or plain object - * @returns Promise - */ - public deleteDeployment(request: google.cloud.ces.v1beta.IDeleteDeploymentRequest): Promise; - - /** - * Calls ListToolsets. - * @param request ListToolsetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListToolsetsResponse - */ - public listToolsets(request: google.cloud.ces.v1beta.IListToolsetsRequest, callback: google.cloud.ces.v1beta.AgentService.ListToolsetsCallback): void; - - /** - * Calls ListToolsets. - * @param request ListToolsetsRequest message or plain object - * @returns Promise - */ - public listToolsets(request: google.cloud.ces.v1beta.IListToolsetsRequest): Promise; - - /** - * Calls GetToolset. - * @param request GetToolsetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Toolset - */ - public getToolset(request: google.cloud.ces.v1beta.IGetToolsetRequest, callback: google.cloud.ces.v1beta.AgentService.GetToolsetCallback): void; - - /** - * Calls GetToolset. - * @param request GetToolsetRequest message or plain object - * @returns Promise - */ - public getToolset(request: google.cloud.ces.v1beta.IGetToolsetRequest): Promise; - - /** - * Calls CreateToolset. - * @param request CreateToolsetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Toolset - */ - public createToolset(request: google.cloud.ces.v1beta.ICreateToolsetRequest, callback: google.cloud.ces.v1beta.AgentService.CreateToolsetCallback): void; - - /** - * Calls CreateToolset. - * @param request CreateToolsetRequest message or plain object - * @returns Promise - */ - public createToolset(request: google.cloud.ces.v1beta.ICreateToolsetRequest): Promise; - - /** - * Calls UpdateToolset. - * @param request UpdateToolsetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Toolset - */ - public updateToolset(request: google.cloud.ces.v1beta.IUpdateToolsetRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateToolsetCallback): void; - - /** - * Calls UpdateToolset. - * @param request UpdateToolsetRequest message or plain object - * @returns Promise - */ - public updateToolset(request: google.cloud.ces.v1beta.IUpdateToolsetRequest): Promise; - - /** - * Calls DeleteToolset. - * @param request DeleteToolsetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteToolset(request: google.cloud.ces.v1beta.IDeleteToolsetRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteToolsetCallback): void; - - /** - * Calls DeleteToolset. - * @param request DeleteToolsetRequest message or plain object - * @returns Promise - */ - public deleteToolset(request: google.cloud.ces.v1beta.IDeleteToolsetRequest): Promise; - - /** - * Calls ListAppVersions. - * @param request ListAppVersionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAppVersionsResponse - */ - public listAppVersions(request: google.cloud.ces.v1beta.IListAppVersionsRequest, callback: google.cloud.ces.v1beta.AgentService.ListAppVersionsCallback): void; - - /** - * Calls ListAppVersions. - * @param request ListAppVersionsRequest message or plain object - * @returns Promise - */ - public listAppVersions(request: google.cloud.ces.v1beta.IListAppVersionsRequest): Promise; - - /** - * Calls GetAppVersion. - * @param request GetAppVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AppVersion - */ - public getAppVersion(request: google.cloud.ces.v1beta.IGetAppVersionRequest, callback: google.cloud.ces.v1beta.AgentService.GetAppVersionCallback): void; - - /** - * Calls GetAppVersion. - * @param request GetAppVersionRequest message or plain object - * @returns Promise - */ - public getAppVersion(request: google.cloud.ces.v1beta.IGetAppVersionRequest): Promise; - - /** - * Calls CreateAppVersion. - * @param request CreateAppVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AppVersion - */ - public createAppVersion(request: google.cloud.ces.v1beta.ICreateAppVersionRequest, callback: google.cloud.ces.v1beta.AgentService.CreateAppVersionCallback): void; - - /** - * Calls CreateAppVersion. - * @param request CreateAppVersionRequest message or plain object - * @returns Promise - */ - public createAppVersion(request: google.cloud.ces.v1beta.ICreateAppVersionRequest): Promise; - - /** - * Calls DeleteAppVersion. - * @param request DeleteAppVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteAppVersion(request: google.cloud.ces.v1beta.IDeleteAppVersionRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteAppVersionCallback): void; - - /** - * Calls DeleteAppVersion. - * @param request DeleteAppVersionRequest message or plain object - * @returns Promise - */ - public deleteAppVersion(request: google.cloud.ces.v1beta.IDeleteAppVersionRequest): Promise; - - /** - * Calls RestoreAppVersion. - * @param request RestoreAppVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public restoreAppVersion(request: google.cloud.ces.v1beta.IRestoreAppVersionRequest, callback: google.cloud.ces.v1beta.AgentService.RestoreAppVersionCallback): void; - - /** - * Calls RestoreAppVersion. - * @param request RestoreAppVersionRequest message or plain object - * @returns Promise - */ - public restoreAppVersion(request: google.cloud.ces.v1beta.IRestoreAppVersionRequest): Promise; - - /** - * Calls ListChangelogs. - * @param request ListChangelogsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListChangelogsResponse - */ - public listChangelogs(request: google.cloud.ces.v1beta.IListChangelogsRequest, callback: google.cloud.ces.v1beta.AgentService.ListChangelogsCallback): void; - - /** - * Calls ListChangelogs. - * @param request ListChangelogsRequest message or plain object - * @returns Promise - */ - public listChangelogs(request: google.cloud.ces.v1beta.IListChangelogsRequest): Promise; - - /** - * Calls GetChangelog. - * @param request GetChangelogRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Changelog - */ - public getChangelog(request: google.cloud.ces.v1beta.IGetChangelogRequest, callback: google.cloud.ces.v1beta.AgentService.GetChangelogCallback): void; - - /** - * Calls GetChangelog. - * @param request GetChangelogRequest message or plain object - * @returns Promise - */ - public getChangelog(request: google.cloud.ces.v1beta.IGetChangelogRequest): Promise; - } - - namespace AgentService { - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listApps}. - * @param error Error, if any - * @param [response] ListAppsResponse - */ - type ListAppsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListAppsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getApp}. - * @param error Error, if any - * @param [response] App - */ - type GetAppCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.App) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createApp}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateApp}. - * @param error Error, if any - * @param [response] App - */ - type UpdateAppCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.App) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteApp}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|exportApp}. - * @param error Error, if any - * @param [response] Operation - */ - type ExportAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|importApp}. - * @param error Error, if any - * @param [response] Operation - */ - type ImportAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listAgents}. - * @param error Error, if any - * @param [response] ListAgentsResponse - */ - type ListAgentsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListAgentsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getAgent}. - * @param error Error, if any - * @param [response] Agent - */ - type GetAgentCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Agent) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createAgent}. - * @param error Error, if any - * @param [response] Agent - */ - type CreateAgentCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Agent) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateAgent}. - * @param error Error, if any - * @param [response] Agent - */ - type UpdateAgentCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Agent) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteAgent}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteAgentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listExamples}. - * @param error Error, if any - * @param [response] ListExamplesResponse - */ - type ListExamplesCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListExamplesResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getExample}. - * @param error Error, if any - * @param [response] Example - */ - type GetExampleCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Example) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createExample}. - * @param error Error, if any - * @param [response] Example - */ - type CreateExampleCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Example) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateExample}. - * @param error Error, if any - * @param [response] Example - */ - type UpdateExampleCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Example) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteExample}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteExampleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listTools}. - * @param error Error, if any - * @param [response] ListToolsResponse - */ - type ListToolsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListToolsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getTool}. - * @param error Error, if any - * @param [response] Tool - */ - type GetToolCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Tool) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listConversations}. - * @param error Error, if any - * @param [response] ListConversationsResponse - */ - type ListConversationsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListConversationsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getConversation}. - * @param error Error, if any - * @param [response] Conversation - */ - type GetConversationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Conversation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteConversation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteConversationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|batchDeleteConversations}. - * @param error Error, if any - * @param [response] Operation - */ - type BatchDeleteConversationsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createTool}. - * @param error Error, if any - * @param [response] Tool - */ - type CreateToolCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Tool) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateTool}. - * @param error Error, if any - * @param [response] Tool - */ - type UpdateToolCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Tool) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteTool}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteToolCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listGuardrails}. - * @param error Error, if any - * @param [response] ListGuardrailsResponse - */ - type ListGuardrailsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListGuardrailsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getGuardrail}. - * @param error Error, if any - * @param [response] Guardrail - */ - type GetGuardrailCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Guardrail) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createGuardrail}. - * @param error Error, if any - * @param [response] Guardrail - */ - type CreateGuardrailCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Guardrail) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateGuardrail}. - * @param error Error, if any - * @param [response] Guardrail - */ - type UpdateGuardrailCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Guardrail) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteGuardrail}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteGuardrailCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listDeployments}. - * @param error Error, if any - * @param [response] ListDeploymentsResponse - */ - type ListDeploymentsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListDeploymentsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getDeployment}. - * @param error Error, if any - * @param [response] Deployment - */ - type GetDeploymentCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Deployment) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createDeployment}. - * @param error Error, if any - * @param [response] Deployment - */ - type CreateDeploymentCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Deployment) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateDeployment}. - * @param error Error, if any - * @param [response] Deployment - */ - type UpdateDeploymentCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Deployment) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteDeployment}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteDeploymentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listToolsets}. - * @param error Error, if any - * @param [response] ListToolsetsResponse - */ - type ListToolsetsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListToolsetsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getToolset}. - * @param error Error, if any - * @param [response] Toolset - */ - type GetToolsetCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Toolset) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createToolset}. - * @param error Error, if any - * @param [response] Toolset - */ - type CreateToolsetCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Toolset) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateToolset}. - * @param error Error, if any - * @param [response] Toolset - */ - type UpdateToolsetCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Toolset) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteToolset}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteToolsetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listAppVersions}. - * @param error Error, if any - * @param [response] ListAppVersionsResponse - */ - type ListAppVersionsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListAppVersionsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getAppVersion}. - * @param error Error, if any - * @param [response] AppVersion - */ - type GetAppVersionCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.AppVersion) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createAppVersion}. - * @param error Error, if any - * @param [response] AppVersion - */ - type CreateAppVersionCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.AppVersion) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteAppVersion}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteAppVersionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|restoreAppVersion}. - * @param error Error, if any - * @param [response] Operation - */ - type RestoreAppVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listChangelogs}. - * @param error Error, if any - * @param [response] ListChangelogsResponse - */ - type ListChangelogsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListChangelogsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getChangelog}. - * @param error Error, if any - * @param [response] Changelog - */ - type GetChangelogCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Changelog) => void; - } - - /** Properties of a ListAppsRequest. */ - interface IListAppsRequest { - - /** ListAppsRequest parent */ - parent?: (string|null); - - /** ListAppsRequest pageSize */ - pageSize?: (number|null); - - /** ListAppsRequest pageToken */ - pageToken?: (string|null); - - /** ListAppsRequest filter */ - filter?: (string|null); - - /** ListAppsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListAppsRequest. */ - class ListAppsRequest implements IListAppsRequest { - - /** - * Constructs a new ListAppsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListAppsRequest); - - /** ListAppsRequest parent. */ - public parent: string; - - /** ListAppsRequest pageSize. */ - public pageSize: number; - - /** ListAppsRequest pageToken. */ - public pageToken: string; - - /** ListAppsRequest filter. */ - public filter: string; - - /** ListAppsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListAppsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAppsRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListAppsRequest): google.cloud.ces.v1beta.ListAppsRequest; - - /** - * Encodes the specified ListAppsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsRequest.verify|verify} messages. - * @param message ListAppsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListAppsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAppsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsRequest.verify|verify} messages. - * @param message ListAppsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListAppsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAppsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAppsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListAppsRequest; - - /** - * Decodes a ListAppsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAppsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListAppsRequest; - - /** - * Verifies a ListAppsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAppsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAppsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListAppsRequest; - - /** - * Creates a plain object from a ListAppsRequest message. Also converts values to other types if specified. - * @param message ListAppsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListAppsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAppsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAppsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAppsResponse. */ - interface IListAppsResponse { - - /** ListAppsResponse apps */ - apps?: (google.cloud.ces.v1beta.IApp[]|null); - - /** ListAppsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListAppsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListAppsResponse. */ - class ListAppsResponse implements IListAppsResponse { - - /** - * Constructs a new ListAppsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListAppsResponse); - - /** ListAppsResponse apps. */ - public apps: google.cloud.ces.v1beta.IApp[]; - - /** ListAppsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListAppsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListAppsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAppsResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListAppsResponse): google.cloud.ces.v1beta.ListAppsResponse; - - /** - * Encodes the specified ListAppsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsResponse.verify|verify} messages. - * @param message ListAppsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListAppsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAppsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsResponse.verify|verify} messages. - * @param message ListAppsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListAppsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAppsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAppsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListAppsResponse; - - /** - * Decodes a ListAppsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAppsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListAppsResponse; - - /** - * Verifies a ListAppsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAppsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAppsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListAppsResponse; - - /** - * Creates a plain object from a ListAppsResponse message. Also converts values to other types if specified. - * @param message ListAppsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListAppsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAppsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAppsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetAppRequest. */ - interface IGetAppRequest { - - /** GetAppRequest name */ - name?: (string|null); - } - - /** Represents a GetAppRequest. */ - class GetAppRequest implements IGetAppRequest { - - /** - * Constructs a new GetAppRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGetAppRequest); - - /** GetAppRequest name. */ - public name: string; - - /** - * Creates a new GetAppRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetAppRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGetAppRequest): google.cloud.ces.v1beta.GetAppRequest; - - /** - * Encodes the specified GetAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetAppRequest.verify|verify} messages. - * @param message GetAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGetAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetAppRequest.verify|verify} messages. - * @param message GetAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGetAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetAppRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetAppRequest; - - /** - * Decodes a GetAppRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetAppRequest; - - /** - * Verifies a GetAppRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetAppRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetAppRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetAppRequest; - - /** - * Creates a plain object from a GetAppRequest message. Also converts values to other types if specified. - * @param message GetAppRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GetAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetAppRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetAppRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateAppRequest. */ - interface ICreateAppRequest { - - /** CreateAppRequest parent */ - parent?: (string|null); - - /** CreateAppRequest appId */ - appId?: (string|null); - - /** CreateAppRequest app */ - app?: (google.cloud.ces.v1beta.IApp|null); - } - - /** Represents a CreateAppRequest. */ - class CreateAppRequest implements ICreateAppRequest { - - /** - * Constructs a new CreateAppRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ICreateAppRequest); - - /** CreateAppRequest parent. */ - public parent: string; - - /** CreateAppRequest appId. */ - public appId: string; - - /** CreateAppRequest app. */ - public app?: (google.cloud.ces.v1beta.IApp|null); - - /** - * Creates a new CreateAppRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateAppRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.ICreateAppRequest): google.cloud.ces.v1beta.CreateAppRequest; - - /** - * Encodes the specified CreateAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppRequest.verify|verify} messages. - * @param message CreateAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ICreateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppRequest.verify|verify} messages. - * @param message CreateAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateAppRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateAppRequest; - - /** - * Decodes a CreateAppRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateAppRequest; - - /** - * Verifies a CreateAppRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateAppRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateAppRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateAppRequest; - - /** - * Creates a plain object from a CreateAppRequest message. Also converts values to other types if specified. - * @param message CreateAppRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.CreateAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateAppRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateAppRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateAppRequest. */ - interface IUpdateAppRequest { - - /** UpdateAppRequest app */ - app?: (google.cloud.ces.v1beta.IApp|null); - - /** UpdateAppRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateAppRequest. */ - class UpdateAppRequest implements IUpdateAppRequest { - - /** - * Constructs a new UpdateAppRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IUpdateAppRequest); - - /** UpdateAppRequest app. */ - public app?: (google.cloud.ces.v1beta.IApp|null); - - /** UpdateAppRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateAppRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateAppRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IUpdateAppRequest): google.cloud.ces.v1beta.UpdateAppRequest; - - /** - * Encodes the specified UpdateAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAppRequest.verify|verify} messages. - * @param message UpdateAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IUpdateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAppRequest.verify|verify} messages. - * @param message UpdateAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateAppRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateAppRequest; - - /** - * Decodes an UpdateAppRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateAppRequest; - - /** - * Verifies an UpdateAppRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateAppRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateAppRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateAppRequest; - - /** - * Creates a plain object from an UpdateAppRequest message. Also converts values to other types if specified. - * @param message UpdateAppRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.UpdateAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateAppRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateAppRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteAppRequest. */ - interface IDeleteAppRequest { - - /** DeleteAppRequest name */ - name?: (string|null); - - /** DeleteAppRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteAppRequest. */ - class DeleteAppRequest implements IDeleteAppRequest { - - /** - * Constructs a new DeleteAppRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDeleteAppRequest); - - /** DeleteAppRequest name. */ - public name: string; - - /** DeleteAppRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteAppRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteAppRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDeleteAppRequest): google.cloud.ces.v1beta.DeleteAppRequest; - - /** - * Encodes the specified DeleteAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppRequest.verify|verify} messages. - * @param message DeleteAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDeleteAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppRequest.verify|verify} messages. - * @param message DeleteAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteAppRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteAppRequest; - - /** - * Decodes a DeleteAppRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteAppRequest; - - /** - * Verifies a DeleteAppRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteAppRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteAppRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteAppRequest; - - /** - * Creates a plain object from a DeleteAppRequest message. Also converts values to other types if specified. - * @param message DeleteAppRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DeleteAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteAppRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteAppRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExportAppRequest. */ - interface IExportAppRequest { - - /** ExportAppRequest name */ - name?: (string|null); - - /** ExportAppRequest exportFormat */ - exportFormat?: (google.cloud.ces.v1beta.ExportAppRequest.ExportFormat|keyof typeof google.cloud.ces.v1beta.ExportAppRequest.ExportFormat|null); - - /** ExportAppRequest gcsUri */ - gcsUri?: (string|null); - } - - /** Represents an ExportAppRequest. */ - class ExportAppRequest implements IExportAppRequest { - - /** - * Constructs a new ExportAppRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IExportAppRequest); - - /** ExportAppRequest name. */ - public name: string; - - /** ExportAppRequest exportFormat. */ - public exportFormat: (google.cloud.ces.v1beta.ExportAppRequest.ExportFormat|keyof typeof google.cloud.ces.v1beta.ExportAppRequest.ExportFormat); - - /** ExportAppRequest gcsUri. */ - public gcsUri: string; - - /** - * Creates a new ExportAppRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportAppRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IExportAppRequest): google.cloud.ces.v1beta.ExportAppRequest; - - /** - * Encodes the specified ExportAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppRequest.verify|verify} messages. - * @param message ExportAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IExportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppRequest.verify|verify} messages. - * @param message ExportAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IExportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExportAppRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ExportAppRequest; - - /** - * Decodes an ExportAppRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ExportAppRequest; - - /** - * Verifies an ExportAppRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExportAppRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportAppRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ExportAppRequest; - - /** - * Creates a plain object from an ExportAppRequest message. Also converts values to other types if specified. - * @param message ExportAppRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ExportAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportAppRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExportAppRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExportAppRequest { - - /** ExportFormat enum. */ - enum ExportFormat { - EXPORT_FORMAT_UNSPECIFIED = 0, - JSON = 1, - YAML = 2 - } - } - - /** Properties of an ExportAppResponse. */ - interface IExportAppResponse { - - /** ExportAppResponse appContent */ - appContent?: (Uint8Array|Buffer|string|null); - - /** ExportAppResponse appUri */ - appUri?: (string|null); - } - - /** Represents an ExportAppResponse. */ - class ExportAppResponse implements IExportAppResponse { - - /** - * Constructs a new ExportAppResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IExportAppResponse); - - /** ExportAppResponse appContent. */ - public appContent?: (Uint8Array|Buffer|string|null); - - /** ExportAppResponse appUri. */ - public appUri?: (string|null); - - /** ExportAppResponse app. */ - public app?: ("appContent"|"appUri"); - - /** - * Creates a new ExportAppResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportAppResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IExportAppResponse): google.cloud.ces.v1beta.ExportAppResponse; - - /** - * Encodes the specified ExportAppResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppResponse.verify|verify} messages. - * @param message ExportAppResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IExportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppResponse.verify|verify} messages. - * @param message ExportAppResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IExportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExportAppResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportAppResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ExportAppResponse; - - /** - * Decodes an ExportAppResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportAppResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ExportAppResponse; - - /** - * Verifies an ExportAppResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExportAppResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportAppResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ExportAppResponse; - - /** - * Creates a plain object from an ExportAppResponse message. Also converts values to other types if specified. - * @param message ExportAppResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ExportAppResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportAppResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExportAppResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ImportAppRequest. */ - interface IImportAppRequest { - - /** ImportAppRequest gcsUri */ - gcsUri?: (string|null); - - /** ImportAppRequest appContent */ - appContent?: (Uint8Array|Buffer|string|null); - - /** ImportAppRequest parent */ - parent?: (string|null); - - /** ImportAppRequest displayName */ - displayName?: (string|null); - - /** ImportAppRequest appId */ - appId?: (string|null); - - /** ImportAppRequest importOptions */ - importOptions?: (google.cloud.ces.v1beta.ImportAppRequest.IImportOptions|null); - - /** ImportAppRequest ignoreAppLock */ - ignoreAppLock?: (boolean|null); - } - - /** Represents an ImportAppRequest. */ - class ImportAppRequest implements IImportAppRequest { - - /** - * Constructs a new ImportAppRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IImportAppRequest); - - /** ImportAppRequest gcsUri. */ - public gcsUri?: (string|null); - - /** ImportAppRequest appContent. */ - public appContent?: (Uint8Array|Buffer|string|null); - - /** ImportAppRequest parent. */ - public parent: string; - - /** ImportAppRequest displayName. */ - public displayName: string; - - /** ImportAppRequest appId. */ - public appId: string; - - /** ImportAppRequest importOptions. */ - public importOptions?: (google.cloud.ces.v1beta.ImportAppRequest.IImportOptions|null); - - /** ImportAppRequest ignoreAppLock. */ - public ignoreAppLock: boolean; - - /** ImportAppRequest app. */ - public app?: ("gcsUri"|"appContent"); - - /** - * Creates a new ImportAppRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportAppRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IImportAppRequest): google.cloud.ces.v1beta.ImportAppRequest; - - /** - * Encodes the specified ImportAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.verify|verify} messages. - * @param message ImportAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IImportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.verify|verify} messages. - * @param message ImportAppRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IImportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportAppRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportAppRequest; - - /** - * Decodes an ImportAppRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportAppRequest; - - /** - * Verifies an ImportAppRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ImportAppRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportAppRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportAppRequest; - - /** - * Creates a plain object from an ImportAppRequest message. Also converts values to other types if specified. - * @param message ImportAppRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ImportAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportAppRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportAppRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ImportAppRequest { - - /** Properties of an ImportOptions. */ - interface IImportOptions { - - /** ImportOptions conflictResolutionStrategy */ - conflictResolutionStrategy?: (google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|keyof typeof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|null); - } - - /** Represents an ImportOptions. */ - class ImportOptions implements IImportOptions { - - /** - * Constructs a new ImportOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ImportAppRequest.IImportOptions); - - /** ImportOptions conflictResolutionStrategy. */ - public conflictResolutionStrategy: (google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|keyof typeof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy); - - /** - * Creates a new ImportOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportOptions instance - */ - public static create(properties?: google.cloud.ces.v1beta.ImportAppRequest.IImportOptions): google.cloud.ces.v1beta.ImportAppRequest.ImportOptions; - - /** - * Encodes the specified ImportOptions message. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.verify|verify} messages. - * @param message ImportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ImportAppRequest.IImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportOptions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.verify|verify} messages. - * @param message ImportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ImportAppRequest.IImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportAppRequest.ImportOptions; - - /** - * Decodes an ImportOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportAppRequest.ImportOptions; - - /** - * Verifies an ImportOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ImportOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportAppRequest.ImportOptions; - - /** - * Creates a plain object from an ImportOptions message. Also converts values to other types if specified. - * @param message ImportOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ImportAppRequest.ImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ImportOptions { - - /** ConflictResolutionStrategy enum. */ - enum ConflictResolutionStrategy { - CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED = 0, - REPLACE = 1, - OVERWRITE = 2 - } - } - } - - /** Properties of an ImportAppResponse. */ - interface IImportAppResponse { - - /** ImportAppResponse name */ - name?: (string|null); - - /** ImportAppResponse warnings */ - warnings?: (string[]|null); - } - - /** Represents an ImportAppResponse. */ - class ImportAppResponse implements IImportAppResponse { - - /** - * Constructs a new ImportAppResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IImportAppResponse); - - /** ImportAppResponse name. */ - public name: string; - - /** ImportAppResponse warnings. */ - public warnings: string[]; - - /** - * Creates a new ImportAppResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportAppResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IImportAppResponse): google.cloud.ces.v1beta.ImportAppResponse; - - /** - * Encodes the specified ImportAppResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppResponse.verify|verify} messages. - * @param message ImportAppResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IImportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppResponse.verify|verify} messages. - * @param message ImportAppResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IImportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportAppResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportAppResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportAppResponse; - - /** - * Decodes an ImportAppResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportAppResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportAppResponse; - - /** - * Verifies an ImportAppResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ImportAppResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportAppResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportAppResponse; - - /** - * Creates a plain object from an ImportAppResponse message. Also converts values to other types if specified. - * @param message ImportAppResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ImportAppResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportAppResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportAppResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAgentsRequest. */ - interface IListAgentsRequest { - - /** ListAgentsRequest parent */ - parent?: (string|null); - - /** ListAgentsRequest pageSize */ - pageSize?: (number|null); - - /** ListAgentsRequest pageToken */ - pageToken?: (string|null); - - /** ListAgentsRequest filter */ - filter?: (string|null); - - /** ListAgentsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListAgentsRequest. */ - class ListAgentsRequest implements IListAgentsRequest { - - /** - * Constructs a new ListAgentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListAgentsRequest); - - /** ListAgentsRequest parent. */ - public parent: string; - - /** ListAgentsRequest pageSize. */ - public pageSize: number; - - /** ListAgentsRequest pageToken. */ - public pageToken: string; - - /** ListAgentsRequest filter. */ - public filter: string; - - /** ListAgentsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListAgentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAgentsRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListAgentsRequest): google.cloud.ces.v1beta.ListAgentsRequest; - - /** - * Encodes the specified ListAgentsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsRequest.verify|verify} messages. - * @param message ListAgentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListAgentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAgentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsRequest.verify|verify} messages. - * @param message ListAgentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListAgentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAgentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAgentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListAgentsRequest; - - /** - * Decodes a ListAgentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAgentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListAgentsRequest; - - /** - * Verifies a ListAgentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAgentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAgentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListAgentsRequest; - - /** - * Creates a plain object from a ListAgentsRequest message. Also converts values to other types if specified. - * @param message ListAgentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListAgentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAgentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAgentsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAgentsResponse. */ - interface IListAgentsResponse { - - /** ListAgentsResponse agents */ - agents?: (google.cloud.ces.v1beta.IAgent[]|null); - - /** ListAgentsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListAgentsResponse. */ - class ListAgentsResponse implements IListAgentsResponse { - - /** - * Constructs a new ListAgentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListAgentsResponse); - - /** ListAgentsResponse agents. */ - public agents: google.cloud.ces.v1beta.IAgent[]; - - /** ListAgentsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListAgentsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAgentsResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListAgentsResponse): google.cloud.ces.v1beta.ListAgentsResponse; - - /** - * Encodes the specified ListAgentsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsResponse.verify|verify} messages. - * @param message ListAgentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListAgentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAgentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsResponse.verify|verify} messages. - * @param message ListAgentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListAgentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAgentsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAgentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListAgentsResponse; - - /** - * Decodes a ListAgentsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAgentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListAgentsResponse; - - /** - * Verifies a ListAgentsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAgentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAgentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListAgentsResponse; - - /** - * Creates a plain object from a ListAgentsResponse message. Also converts values to other types if specified. - * @param message ListAgentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListAgentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAgentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAgentsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetAgentRequest. */ - interface IGetAgentRequest { - - /** GetAgentRequest name */ - name?: (string|null); - } - - /** Represents a GetAgentRequest. */ - class GetAgentRequest implements IGetAgentRequest { - - /** - * Constructs a new GetAgentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGetAgentRequest); - - /** GetAgentRequest name. */ - public name: string; - - /** - * Creates a new GetAgentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetAgentRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGetAgentRequest): google.cloud.ces.v1beta.GetAgentRequest; - - /** - * Encodes the specified GetAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetAgentRequest.verify|verify} messages. - * @param message GetAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetAgentRequest.verify|verify} messages. - * @param message GetAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetAgentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetAgentRequest; - - /** - * Decodes a GetAgentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetAgentRequest; - - /** - * Verifies a GetAgentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetAgentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetAgentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetAgentRequest; - - /** - * Creates a plain object from a GetAgentRequest message. Also converts values to other types if specified. - * @param message GetAgentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GetAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetAgentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetAgentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateAgentRequest. */ - interface ICreateAgentRequest { - - /** CreateAgentRequest parent */ - parent?: (string|null); - - /** CreateAgentRequest agentId */ - agentId?: (string|null); - - /** CreateAgentRequest agent */ - agent?: (google.cloud.ces.v1beta.IAgent|null); - } - - /** Represents a CreateAgentRequest. */ - class CreateAgentRequest implements ICreateAgentRequest { - - /** - * Constructs a new CreateAgentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ICreateAgentRequest); - - /** CreateAgentRequest parent. */ - public parent: string; - - /** CreateAgentRequest agentId. */ - public agentId: string; - - /** CreateAgentRequest agent. */ - public agent?: (google.cloud.ces.v1beta.IAgent|null); - - /** - * Creates a new CreateAgentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateAgentRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.ICreateAgentRequest): google.cloud.ces.v1beta.CreateAgentRequest; - - /** - * Encodes the specified CreateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateAgentRequest.verify|verify} messages. - * @param message CreateAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ICreateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateAgentRequest.verify|verify} messages. - * @param message CreateAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateAgentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateAgentRequest; - - /** - * Decodes a CreateAgentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateAgentRequest; - - /** - * Verifies a CreateAgentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateAgentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateAgentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateAgentRequest; - - /** - * Creates a plain object from a CreateAgentRequest message. Also converts values to other types if specified. - * @param message CreateAgentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.CreateAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateAgentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateAgentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateAgentRequest. */ - interface IUpdateAgentRequest { - - /** UpdateAgentRequest agent */ - agent?: (google.cloud.ces.v1beta.IAgent|null); - - /** UpdateAgentRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateAgentRequest. */ - class UpdateAgentRequest implements IUpdateAgentRequest { - - /** - * Constructs a new UpdateAgentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IUpdateAgentRequest); - - /** UpdateAgentRequest agent. */ - public agent?: (google.cloud.ces.v1beta.IAgent|null); - - /** UpdateAgentRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateAgentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateAgentRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IUpdateAgentRequest): google.cloud.ces.v1beta.UpdateAgentRequest; - - /** - * Encodes the specified UpdateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAgentRequest.verify|verify} messages. - * @param message UpdateAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IUpdateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAgentRequest.verify|verify} messages. - * @param message UpdateAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateAgentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateAgentRequest; - - /** - * Decodes an UpdateAgentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateAgentRequest; - - /** - * Verifies an UpdateAgentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateAgentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateAgentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateAgentRequest; - - /** - * Creates a plain object from an UpdateAgentRequest message. Also converts values to other types if specified. - * @param message UpdateAgentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.UpdateAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateAgentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateAgentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteAgentRequest. */ - interface IDeleteAgentRequest { - - /** DeleteAgentRequest name */ - name?: (string|null); - - /** DeleteAgentRequest force */ - force?: (boolean|null); - - /** DeleteAgentRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteAgentRequest. */ - class DeleteAgentRequest implements IDeleteAgentRequest { - - /** - * Constructs a new DeleteAgentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDeleteAgentRequest); - - /** DeleteAgentRequest name. */ - public name: string; - - /** DeleteAgentRequest force. */ - public force: boolean; - - /** DeleteAgentRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteAgentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteAgentRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDeleteAgentRequest): google.cloud.ces.v1beta.DeleteAgentRequest; - - /** - * Encodes the specified DeleteAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAgentRequest.verify|verify} messages. - * @param message DeleteAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDeleteAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAgentRequest.verify|verify} messages. - * @param message DeleteAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteAgentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteAgentRequest; - - /** - * Decodes a DeleteAgentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteAgentRequest; - - /** - * Verifies a DeleteAgentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteAgentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteAgentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteAgentRequest; - - /** - * Creates a plain object from a DeleteAgentRequest message. Also converts values to other types if specified. - * @param message DeleteAgentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DeleteAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteAgentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteAgentRequest - * @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 createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata statusMessage */ - statusMessage?: (string|null); - - /** OperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); - } - - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { - - /** - * Constructs a new OperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IOperationMetadata); - - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata statusMessage. */ - public statusMessage: string; - - /** OperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationMetadata instance - */ - public static create(properties?: google.cloud.ces.v1beta.IOperationMetadata): google.cloud.ces.v1beta.OperationMetadata; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.ces.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.ces.v1beta.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.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.ces.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.ces.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.ces.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.ces.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.ces.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 ListExamplesRequest. */ - interface IListExamplesRequest { - - /** ListExamplesRequest parent */ - parent?: (string|null); - - /** ListExamplesRequest pageSize */ - pageSize?: (number|null); - - /** ListExamplesRequest pageToken */ - pageToken?: (string|null); - - /** ListExamplesRequest filter */ - filter?: (string|null); - - /** ListExamplesRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListExamplesRequest. */ - class ListExamplesRequest implements IListExamplesRequest { - - /** - * Constructs a new ListExamplesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListExamplesRequest); - - /** ListExamplesRequest parent. */ - public parent: string; - - /** ListExamplesRequest pageSize. */ - public pageSize: number; - - /** ListExamplesRequest pageToken. */ - public pageToken: string; - - /** ListExamplesRequest filter. */ - public filter: string; - - /** ListExamplesRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListExamplesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListExamplesRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListExamplesRequest): google.cloud.ces.v1beta.ListExamplesRequest; - - /** - * Encodes the specified ListExamplesRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesRequest.verify|verify} messages. - * @param message ListExamplesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesRequest.verify|verify} messages. - * @param message ListExamplesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListExamplesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListExamplesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListExamplesRequest; - - /** - * Decodes a ListExamplesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListExamplesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListExamplesRequest; - - /** - * Verifies a ListExamplesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListExamplesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListExamplesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListExamplesRequest; - - /** - * Creates a plain object from a ListExamplesRequest message. Also converts values to other types if specified. - * @param message ListExamplesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListExamplesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListExamplesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListExamplesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListExamplesResponse. */ - interface IListExamplesResponse { - - /** ListExamplesResponse examples */ - examples?: (google.cloud.ces.v1beta.IExample[]|null); - - /** ListExamplesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListExamplesResponse. */ - class ListExamplesResponse implements IListExamplesResponse { - - /** - * Constructs a new ListExamplesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListExamplesResponse); - - /** ListExamplesResponse examples. */ - public examples: google.cloud.ces.v1beta.IExample[]; - - /** ListExamplesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListExamplesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListExamplesResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListExamplesResponse): google.cloud.ces.v1beta.ListExamplesResponse; - - /** - * Encodes the specified ListExamplesResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesResponse.verify|verify} messages. - * @param message ListExamplesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListExamplesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListExamplesResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesResponse.verify|verify} messages. - * @param message ListExamplesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListExamplesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListExamplesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListExamplesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListExamplesResponse; - - /** - * Decodes a ListExamplesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListExamplesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListExamplesResponse; - - /** - * Verifies a ListExamplesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListExamplesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListExamplesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListExamplesResponse; - - /** - * Creates a plain object from a ListExamplesResponse message. Also converts values to other types if specified. - * @param message ListExamplesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListExamplesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListExamplesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListExamplesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetExampleRequest. */ - interface IGetExampleRequest { - - /** GetExampleRequest name */ - name?: (string|null); - } - - /** Represents a GetExampleRequest. */ - class GetExampleRequest implements IGetExampleRequest { - - /** - * Constructs a new GetExampleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGetExampleRequest); - - /** GetExampleRequest name. */ - public name: string; - - /** - * Creates a new GetExampleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetExampleRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGetExampleRequest): google.cloud.ces.v1beta.GetExampleRequest; - - /** - * Encodes the specified GetExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetExampleRequest.verify|verify} messages. - * @param message GetExampleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGetExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetExampleRequest.verify|verify} messages. - * @param message GetExampleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGetExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetExampleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetExampleRequest; - - /** - * Decodes a GetExampleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetExampleRequest; - - /** - * Verifies a GetExampleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetExampleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetExampleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetExampleRequest; - - /** - * Creates a plain object from a GetExampleRequest message. Also converts values to other types if specified. - * @param message GetExampleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GetExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetExampleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetExampleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateExampleRequest. */ - interface ICreateExampleRequest { - - /** CreateExampleRequest parent */ - parent?: (string|null); - - /** CreateExampleRequest exampleId */ - exampleId?: (string|null); - - /** CreateExampleRequest example */ - example?: (google.cloud.ces.v1beta.IExample|null); - } - - /** Represents a CreateExampleRequest. */ - class CreateExampleRequest implements ICreateExampleRequest { - - /** - * Constructs a new CreateExampleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ICreateExampleRequest); - - /** CreateExampleRequest parent. */ - public parent: string; - - /** CreateExampleRequest exampleId. */ - public exampleId: string; - - /** CreateExampleRequest example. */ - public example?: (google.cloud.ces.v1beta.IExample|null); - - /** - * Creates a new CreateExampleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateExampleRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.ICreateExampleRequest): google.cloud.ces.v1beta.CreateExampleRequest; - - /** - * Encodes the specified CreateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateExampleRequest.verify|verify} messages. - * @param message CreateExampleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ICreateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateExampleRequest.verify|verify} messages. - * @param message CreateExampleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateExampleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateExampleRequest; - - /** - * Decodes a CreateExampleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateExampleRequest; - - /** - * Verifies a CreateExampleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateExampleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateExampleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateExampleRequest; - - /** - * Creates a plain object from a CreateExampleRequest message. Also converts values to other types if specified. - * @param message CreateExampleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.CreateExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateExampleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateExampleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateExampleRequest. */ - interface IUpdateExampleRequest { - - /** UpdateExampleRequest example */ - example?: (google.cloud.ces.v1beta.IExample|null); - - /** UpdateExampleRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateExampleRequest. */ - class UpdateExampleRequest implements IUpdateExampleRequest { - - /** - * Constructs a new UpdateExampleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IUpdateExampleRequest); - - /** UpdateExampleRequest example. */ - public example?: (google.cloud.ces.v1beta.IExample|null); - - /** UpdateExampleRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateExampleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateExampleRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IUpdateExampleRequest): google.cloud.ces.v1beta.UpdateExampleRequest; - - /** - * Encodes the specified UpdateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateExampleRequest.verify|verify} messages. - * @param message UpdateExampleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IUpdateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateExampleRequest.verify|verify} messages. - * @param message UpdateExampleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateExampleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateExampleRequest; - - /** - * Decodes an UpdateExampleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateExampleRequest; - - /** - * Verifies an UpdateExampleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateExampleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateExampleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateExampleRequest; - - /** - * Creates a plain object from an UpdateExampleRequest message. Also converts values to other types if specified. - * @param message UpdateExampleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.UpdateExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateExampleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateExampleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteExampleRequest. */ - interface IDeleteExampleRequest { - - /** DeleteExampleRequest name */ - name?: (string|null); - - /** DeleteExampleRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteExampleRequest. */ - class DeleteExampleRequest implements IDeleteExampleRequest { - - /** - * Constructs a new DeleteExampleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDeleteExampleRequest); - - /** DeleteExampleRequest name. */ - public name: string; - - /** DeleteExampleRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteExampleRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteExampleRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDeleteExampleRequest): google.cloud.ces.v1beta.DeleteExampleRequest; - - /** - * Encodes the specified DeleteExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteExampleRequest.verify|verify} messages. - * @param message DeleteExampleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDeleteExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteExampleRequest.verify|verify} messages. - * @param message DeleteExampleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteExampleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteExampleRequest; - - /** - * Decodes a DeleteExampleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteExampleRequest; - - /** - * Verifies a DeleteExampleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteExampleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteExampleRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteExampleRequest; - - /** - * Creates a plain object from a DeleteExampleRequest message. Also converts values to other types if specified. - * @param message DeleteExampleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DeleteExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteExampleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteExampleRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListToolsRequest. */ - interface IListToolsRequest { - - /** ListToolsRequest parent */ - parent?: (string|null); - - /** ListToolsRequest pageSize */ - pageSize?: (number|null); - - /** ListToolsRequest pageToken */ - pageToken?: (string|null); - - /** ListToolsRequest filter */ - filter?: (string|null); - - /** ListToolsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListToolsRequest. */ - class ListToolsRequest implements IListToolsRequest { - - /** - * Constructs a new ListToolsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListToolsRequest); - - /** ListToolsRequest parent. */ - public parent: string; - - /** ListToolsRequest pageSize. */ - public pageSize: number; - - /** ListToolsRequest pageToken. */ - public pageToken: string; - - /** ListToolsRequest filter. */ - public filter: string; - - /** ListToolsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListToolsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListToolsRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListToolsRequest): google.cloud.ces.v1beta.ListToolsRequest; - - /** - * Encodes the specified ListToolsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsRequest.verify|verify} messages. - * @param message ListToolsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsRequest.verify|verify} messages. - * @param message ListToolsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListToolsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListToolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListToolsRequest; - - /** - * Decodes a ListToolsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListToolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListToolsRequest; - - /** - * Verifies a ListToolsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListToolsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListToolsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListToolsRequest; - - /** - * Creates a plain object from a ListToolsRequest message. Also converts values to other types if specified. - * @param message ListToolsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListToolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListToolsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListToolsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListToolsResponse. */ - interface IListToolsResponse { - - /** ListToolsResponse tools */ - tools?: (google.cloud.ces.v1beta.ITool[]|null); - - /** ListToolsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListToolsResponse. */ - class ListToolsResponse implements IListToolsResponse { - - /** - * Constructs a new ListToolsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListToolsResponse); - - /** ListToolsResponse tools. */ - public tools: google.cloud.ces.v1beta.ITool[]; - - /** ListToolsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListToolsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListToolsResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListToolsResponse): google.cloud.ces.v1beta.ListToolsResponse; - - /** - * Encodes the specified ListToolsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsResponse.verify|verify} messages. - * @param message ListToolsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsResponse.verify|verify} messages. - * @param message ListToolsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListToolsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListToolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListToolsResponse; - - /** - * Decodes a ListToolsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListToolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListToolsResponse; - - /** - * Verifies a ListToolsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListToolsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListToolsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListToolsResponse; - - /** - * Creates a plain object from a ListToolsResponse message. Also converts values to other types if specified. - * @param message ListToolsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListToolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListToolsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListToolsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetToolRequest. */ - interface IGetToolRequest { - - /** GetToolRequest name */ - name?: (string|null); - } - - /** Represents a GetToolRequest. */ - class GetToolRequest implements IGetToolRequest { - - /** - * Constructs a new GetToolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGetToolRequest); - - /** GetToolRequest name. */ - public name: string; - - /** - * Creates a new GetToolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetToolRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGetToolRequest): google.cloud.ces.v1beta.GetToolRequest; - - /** - * Encodes the specified GetToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetToolRequest.verify|verify} messages. - * @param message GetToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGetToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetToolRequest.verify|verify} messages. - * @param message GetToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGetToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetToolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetToolRequest; - - /** - * Decodes a GetToolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetToolRequest; - - /** - * Verifies a GetToolRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetToolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetToolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetToolRequest; - - /** - * Creates a plain object from a GetToolRequest message. Also converts values to other types if specified. - * @param message GetToolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GetToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetToolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetToolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateToolRequest. */ - interface ICreateToolRequest { - - /** CreateToolRequest parent */ - parent?: (string|null); - - /** CreateToolRequest toolId */ - toolId?: (string|null); - - /** CreateToolRequest tool */ - tool?: (google.cloud.ces.v1beta.ITool|null); - } - - /** Represents a CreateToolRequest. */ - class CreateToolRequest implements ICreateToolRequest { - - /** - * Constructs a new CreateToolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ICreateToolRequest); - - /** CreateToolRequest parent. */ - public parent: string; - - /** CreateToolRequest toolId. */ - public toolId: string; - - /** CreateToolRequest tool. */ - public tool?: (google.cloud.ces.v1beta.ITool|null); - - /** - * Creates a new CreateToolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateToolRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.ICreateToolRequest): google.cloud.ces.v1beta.CreateToolRequest; - - /** - * Encodes the specified CreateToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolRequest.verify|verify} messages. - * @param message CreateToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ICreateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolRequest.verify|verify} messages. - * @param message CreateToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateToolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateToolRequest; - - /** - * Decodes a CreateToolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateToolRequest; - - /** - * Verifies a CreateToolRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateToolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateToolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateToolRequest; - - /** - * Creates a plain object from a CreateToolRequest message. Also converts values to other types if specified. - * @param message CreateToolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.CreateToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateToolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateToolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateToolRequest. */ - interface IUpdateToolRequest { - - /** UpdateToolRequest tool */ - tool?: (google.cloud.ces.v1beta.ITool|null); - - /** UpdateToolRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateToolRequest. */ - class UpdateToolRequest implements IUpdateToolRequest { - - /** - * Constructs a new UpdateToolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IUpdateToolRequest); - - /** UpdateToolRequest tool. */ - public tool?: (google.cloud.ces.v1beta.ITool|null); - - /** UpdateToolRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateToolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateToolRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IUpdateToolRequest): google.cloud.ces.v1beta.UpdateToolRequest; - - /** - * Encodes the specified UpdateToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolRequest.verify|verify} messages. - * @param message UpdateToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IUpdateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolRequest.verify|verify} messages. - * @param message UpdateToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateToolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateToolRequest; - - /** - * Decodes an UpdateToolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateToolRequest; - - /** - * Verifies an UpdateToolRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateToolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateToolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateToolRequest; - - /** - * Creates a plain object from an UpdateToolRequest message. Also converts values to other types if specified. - * @param message UpdateToolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.UpdateToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateToolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateToolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteToolRequest. */ - interface IDeleteToolRequest { - - /** DeleteToolRequest name */ - name?: (string|null); - - /** DeleteToolRequest force */ - force?: (boolean|null); - - /** DeleteToolRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteToolRequest. */ - class DeleteToolRequest implements IDeleteToolRequest { - - /** - * Constructs a new DeleteToolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDeleteToolRequest); - - /** DeleteToolRequest name. */ - public name: string; - - /** DeleteToolRequest force. */ - public force: boolean; - - /** DeleteToolRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteToolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteToolRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDeleteToolRequest): google.cloud.ces.v1beta.DeleteToolRequest; - - /** - * Encodes the specified DeleteToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolRequest.verify|verify} messages. - * @param message DeleteToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDeleteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolRequest.verify|verify} messages. - * @param message DeleteToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteToolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteToolRequest; - - /** - * Decodes a DeleteToolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteToolRequest; - - /** - * Verifies a DeleteToolRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteToolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteToolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteToolRequest; - - /** - * Creates a plain object from a DeleteToolRequest message. Also converts values to other types if specified. - * @param message DeleteToolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DeleteToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteToolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteToolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListConversationsRequest. */ - interface IListConversationsRequest { - - /** ListConversationsRequest parent */ - parent?: (string|null); - - /** ListConversationsRequest pageSize */ - pageSize?: (number|null); - - /** ListConversationsRequest pageToken */ - pageToken?: (string|null); - - /** ListConversationsRequest filter */ - filter?: (string|null); - - /** ListConversationsRequest source */ - source?: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source|null); - - /** ListConversationsRequest sources */ - sources?: (google.cloud.ces.v1beta.Conversation.Source[]|null); - } - - /** Represents a ListConversationsRequest. */ - class ListConversationsRequest implements IListConversationsRequest { - - /** - * Constructs a new ListConversationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListConversationsRequest); - - /** ListConversationsRequest parent. */ - public parent: string; - - /** ListConversationsRequest pageSize. */ - public pageSize: number; - - /** ListConversationsRequest pageToken. */ - public pageToken: string; - - /** ListConversationsRequest filter. */ - public filter: string; - - /** ListConversationsRequest source. */ - public source: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source); - - /** ListConversationsRequest sources. */ - public sources: google.cloud.ces.v1beta.Conversation.Source[]; - - /** - * Creates a new ListConversationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListConversationsRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListConversationsRequest): google.cloud.ces.v1beta.ListConversationsRequest; - - /** - * Encodes the specified ListConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsRequest.verify|verify} messages. - * @param message ListConversationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsRequest.verify|verify} messages. - * @param message ListConversationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListConversationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListConversationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListConversationsRequest; - - /** - * Decodes a ListConversationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListConversationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListConversationsRequest; - - /** - * Verifies a ListConversationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListConversationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListConversationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListConversationsRequest; - - /** - * Creates a plain object from a ListConversationsRequest message. Also converts values to other types if specified. - * @param message ListConversationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListConversationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListConversationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListConversationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListConversationsResponse. */ - interface IListConversationsResponse { - - /** ListConversationsResponse conversations */ - conversations?: (google.cloud.ces.v1beta.IConversation[]|null); - - /** ListConversationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListConversationsResponse. */ - class ListConversationsResponse implements IListConversationsResponse { - - /** - * Constructs a new ListConversationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListConversationsResponse); - - /** ListConversationsResponse conversations. */ - public conversations: google.cloud.ces.v1beta.IConversation[]; - - /** ListConversationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListConversationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListConversationsResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListConversationsResponse): google.cloud.ces.v1beta.ListConversationsResponse; - - /** - * Encodes the specified ListConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsResponse.verify|verify} messages. - * @param message ListConversationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsResponse.verify|verify} messages. - * @param message ListConversationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListConversationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListConversationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListConversationsResponse; - - /** - * Decodes a ListConversationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListConversationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListConversationsResponse; - - /** - * Verifies a ListConversationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListConversationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListConversationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListConversationsResponse; - - /** - * Creates a plain object from a ListConversationsResponse message. Also converts values to other types if specified. - * @param message ListConversationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListConversationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListConversationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListConversationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetConversationRequest. */ - interface IGetConversationRequest { - - /** GetConversationRequest name */ - name?: (string|null); - - /** GetConversationRequest source */ - source?: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source|null); - } - - /** Represents a GetConversationRequest. */ - class GetConversationRequest implements IGetConversationRequest { - - /** - * Constructs a new GetConversationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGetConversationRequest); - - /** GetConversationRequest name. */ - public name: string; - - /** GetConversationRequest source. */ - public source: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source); - - /** - * Creates a new GetConversationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetConversationRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGetConversationRequest): google.cloud.ces.v1beta.GetConversationRequest; - - /** - * Encodes the specified GetConversationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetConversationRequest.verify|verify} messages. - * @param message GetConversationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGetConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetConversationRequest.verify|verify} messages. - * @param message GetConversationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGetConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetConversationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetConversationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetConversationRequest; - - /** - * Decodes a GetConversationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetConversationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetConversationRequest; - - /** - * Verifies a GetConversationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetConversationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetConversationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetConversationRequest; - - /** - * Creates a plain object from a GetConversationRequest message. Also converts values to other types if specified. - * @param message GetConversationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GetConversationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetConversationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetConversationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteConversationRequest. */ - interface IDeleteConversationRequest { - - /** DeleteConversationRequest name */ - name?: (string|null); - - /** DeleteConversationRequest source */ - source?: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source|null); - } - - /** Represents a DeleteConversationRequest. */ - class DeleteConversationRequest implements IDeleteConversationRequest { - - /** - * Constructs a new DeleteConversationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDeleteConversationRequest); - - /** DeleteConversationRequest name. */ - public name: string; - - /** DeleteConversationRequest source. */ - public source: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source); - - /** - * Creates a new DeleteConversationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteConversationRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDeleteConversationRequest): google.cloud.ces.v1beta.DeleteConversationRequest; - - /** - * Encodes the specified DeleteConversationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteConversationRequest.verify|verify} messages. - * @param message DeleteConversationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDeleteConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteConversationRequest.verify|verify} messages. - * @param message DeleteConversationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteConversationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteConversationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteConversationRequest; - - /** - * Decodes a DeleteConversationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteConversationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteConversationRequest; - - /** - * Verifies a DeleteConversationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteConversationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteConversationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteConversationRequest; - - /** - * Creates a plain object from a DeleteConversationRequest message. Also converts values to other types if specified. - * @param message DeleteConversationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DeleteConversationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteConversationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteConversationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchDeleteConversationsRequest. */ - interface IBatchDeleteConversationsRequest { - - /** BatchDeleteConversationsRequest parent */ - parent?: (string|null); - - /** BatchDeleteConversationsRequest conversations */ - conversations?: (string[]|null); - } - - /** Represents a BatchDeleteConversationsRequest. */ - class BatchDeleteConversationsRequest implements IBatchDeleteConversationsRequest { - - /** - * Constructs a new BatchDeleteConversationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IBatchDeleteConversationsRequest); - - /** BatchDeleteConversationsRequest parent. */ - public parent: string; - - /** BatchDeleteConversationsRequest conversations. */ - public conversations: string[]; - - /** - * Creates a new BatchDeleteConversationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchDeleteConversationsRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IBatchDeleteConversationsRequest): google.cloud.ces.v1beta.BatchDeleteConversationsRequest; - - /** - * Encodes the specified BatchDeleteConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsRequest.verify|verify} messages. - * @param message BatchDeleteConversationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IBatchDeleteConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchDeleteConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsRequest.verify|verify} messages. - * @param message BatchDeleteConversationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IBatchDeleteConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchDeleteConversationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BatchDeleteConversationsRequest; - - /** - * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchDeleteConversationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BatchDeleteConversationsRequest; - - /** - * Verifies a BatchDeleteConversationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchDeleteConversationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchDeleteConversationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BatchDeleteConversationsRequest; - - /** - * Creates a plain object from a BatchDeleteConversationsRequest message. Also converts values to other types if specified. - * @param message BatchDeleteConversationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.BatchDeleteConversationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchDeleteConversationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchDeleteConversationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchDeleteConversationsResponse. */ - interface IBatchDeleteConversationsResponse { - - /** BatchDeleteConversationsResponse deletedConversations */ - deletedConversations?: (string[]|null); - - /** BatchDeleteConversationsResponse failedConversations */ - failedConversations?: (string[]|null); - - /** BatchDeleteConversationsResponse errorMessages */ - errorMessages?: (string[]|null); - } - - /** Represents a BatchDeleteConversationsResponse. */ - class BatchDeleteConversationsResponse implements IBatchDeleteConversationsResponse { - - /** - * Constructs a new BatchDeleteConversationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IBatchDeleteConversationsResponse); - - /** BatchDeleteConversationsResponse deletedConversations. */ - public deletedConversations: string[]; - - /** BatchDeleteConversationsResponse failedConversations. */ - public failedConversations: string[]; - - /** BatchDeleteConversationsResponse errorMessages. */ - public errorMessages: string[]; - - /** - * Creates a new BatchDeleteConversationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchDeleteConversationsResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IBatchDeleteConversationsResponse): google.cloud.ces.v1beta.BatchDeleteConversationsResponse; - - /** - * Encodes the specified BatchDeleteConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsResponse.verify|verify} messages. - * @param message BatchDeleteConversationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IBatchDeleteConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchDeleteConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsResponse.verify|verify} messages. - * @param message BatchDeleteConversationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IBatchDeleteConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchDeleteConversationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BatchDeleteConversationsResponse; - - /** - * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchDeleteConversationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BatchDeleteConversationsResponse; - - /** - * Verifies a BatchDeleteConversationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchDeleteConversationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchDeleteConversationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BatchDeleteConversationsResponse; - - /** - * Creates a plain object from a BatchDeleteConversationsResponse message. Also converts values to other types if specified. - * @param message BatchDeleteConversationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.BatchDeleteConversationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchDeleteConversationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchDeleteConversationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListGuardrailsRequest. */ - interface IListGuardrailsRequest { - - /** ListGuardrailsRequest parent */ - parent?: (string|null); - - /** ListGuardrailsRequest pageSize */ - pageSize?: (number|null); - - /** ListGuardrailsRequest pageToken */ - pageToken?: (string|null); - - /** ListGuardrailsRequest filter */ - filter?: (string|null); - - /** ListGuardrailsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListGuardrailsRequest. */ - class ListGuardrailsRequest implements IListGuardrailsRequest { - - /** - * Constructs a new ListGuardrailsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListGuardrailsRequest); - - /** ListGuardrailsRequest parent. */ - public parent: string; - - /** ListGuardrailsRequest pageSize. */ - public pageSize: number; - - /** ListGuardrailsRequest pageToken. */ - public pageToken: string; - - /** ListGuardrailsRequest filter. */ - public filter: string; - - /** ListGuardrailsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListGuardrailsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListGuardrailsRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListGuardrailsRequest): google.cloud.ces.v1beta.ListGuardrailsRequest; - - /** - * Encodes the specified ListGuardrailsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsRequest.verify|verify} messages. - * @param message ListGuardrailsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListGuardrailsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListGuardrailsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsRequest.verify|verify} messages. - * @param message ListGuardrailsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListGuardrailsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListGuardrailsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListGuardrailsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListGuardrailsRequest; - - /** - * Decodes a ListGuardrailsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListGuardrailsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListGuardrailsRequest; - - /** - * Verifies a ListGuardrailsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListGuardrailsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListGuardrailsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListGuardrailsRequest; - - /** - * Creates a plain object from a ListGuardrailsRequest message. Also converts values to other types if specified. - * @param message ListGuardrailsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListGuardrailsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListGuardrailsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListGuardrailsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListGuardrailsResponse. */ - interface IListGuardrailsResponse { - - /** ListGuardrailsResponse guardrails */ - guardrails?: (google.cloud.ces.v1beta.IGuardrail[]|null); - - /** ListGuardrailsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListGuardrailsResponse. */ - class ListGuardrailsResponse implements IListGuardrailsResponse { - - /** - * Constructs a new ListGuardrailsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListGuardrailsResponse); - - /** ListGuardrailsResponse guardrails. */ - public guardrails: google.cloud.ces.v1beta.IGuardrail[]; - - /** ListGuardrailsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListGuardrailsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListGuardrailsResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListGuardrailsResponse): google.cloud.ces.v1beta.ListGuardrailsResponse; - - /** - * Encodes the specified ListGuardrailsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsResponse.verify|verify} messages. - * @param message ListGuardrailsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListGuardrailsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListGuardrailsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsResponse.verify|verify} messages. - * @param message ListGuardrailsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListGuardrailsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListGuardrailsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListGuardrailsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListGuardrailsResponse; - - /** - * Decodes a ListGuardrailsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListGuardrailsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListGuardrailsResponse; - - /** - * Verifies a ListGuardrailsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListGuardrailsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListGuardrailsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListGuardrailsResponse; - - /** - * Creates a plain object from a ListGuardrailsResponse message. Also converts values to other types if specified. - * @param message ListGuardrailsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListGuardrailsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListGuardrailsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListGuardrailsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetGuardrailRequest. */ - interface IGetGuardrailRequest { - - /** GetGuardrailRequest name */ - name?: (string|null); - } - - /** Represents a GetGuardrailRequest. */ - class GetGuardrailRequest implements IGetGuardrailRequest { - - /** - * Constructs a new GetGuardrailRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGetGuardrailRequest); - - /** GetGuardrailRequest name. */ - public name: string; - - /** - * Creates a new GetGuardrailRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetGuardrailRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGetGuardrailRequest): google.cloud.ces.v1beta.GetGuardrailRequest; - - /** - * Encodes the specified GetGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetGuardrailRequest.verify|verify} messages. - * @param message GetGuardrailRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGetGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetGuardrailRequest.verify|verify} messages. - * @param message GetGuardrailRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGetGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetGuardrailRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetGuardrailRequest; - - /** - * Decodes a GetGuardrailRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetGuardrailRequest; - - /** - * Verifies a GetGuardrailRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetGuardrailRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetGuardrailRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetGuardrailRequest; - - /** - * Creates a plain object from a GetGuardrailRequest message. Also converts values to other types if specified. - * @param message GetGuardrailRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GetGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetGuardrailRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetGuardrailRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateGuardrailRequest. */ - interface ICreateGuardrailRequest { - - /** CreateGuardrailRequest parent */ - parent?: (string|null); - - /** CreateGuardrailRequest guardrailId */ - guardrailId?: (string|null); - - /** CreateGuardrailRequest guardrail */ - guardrail?: (google.cloud.ces.v1beta.IGuardrail|null); - } - - /** Represents a CreateGuardrailRequest. */ - class CreateGuardrailRequest implements ICreateGuardrailRequest { - - /** - * Constructs a new CreateGuardrailRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ICreateGuardrailRequest); - - /** CreateGuardrailRequest parent. */ - public parent: string; - - /** CreateGuardrailRequest guardrailId. */ - public guardrailId: string; - - /** CreateGuardrailRequest guardrail. */ - public guardrail?: (google.cloud.ces.v1beta.IGuardrail|null); - - /** - * Creates a new CreateGuardrailRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateGuardrailRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.ICreateGuardrailRequest): google.cloud.ces.v1beta.CreateGuardrailRequest; - - /** - * Encodes the specified CreateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateGuardrailRequest.verify|verify} messages. - * @param message CreateGuardrailRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ICreateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateGuardrailRequest.verify|verify} messages. - * @param message CreateGuardrailRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateGuardrailRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateGuardrailRequest; - - /** - * Decodes a CreateGuardrailRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateGuardrailRequest; - - /** - * Verifies a CreateGuardrailRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateGuardrailRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateGuardrailRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateGuardrailRequest; - - /** - * Creates a plain object from a CreateGuardrailRequest message. Also converts values to other types if specified. - * @param message CreateGuardrailRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.CreateGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateGuardrailRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateGuardrailRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateGuardrailRequest. */ - interface IUpdateGuardrailRequest { - - /** UpdateGuardrailRequest guardrail */ - guardrail?: (google.cloud.ces.v1beta.IGuardrail|null); - - /** UpdateGuardrailRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateGuardrailRequest. */ - class UpdateGuardrailRequest implements IUpdateGuardrailRequest { - - /** - * Constructs a new UpdateGuardrailRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IUpdateGuardrailRequest); - - /** UpdateGuardrailRequest guardrail. */ - public guardrail?: (google.cloud.ces.v1beta.IGuardrail|null); - - /** UpdateGuardrailRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateGuardrailRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateGuardrailRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IUpdateGuardrailRequest): google.cloud.ces.v1beta.UpdateGuardrailRequest; - - /** - * Encodes the specified UpdateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateGuardrailRequest.verify|verify} messages. - * @param message UpdateGuardrailRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IUpdateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateGuardrailRequest.verify|verify} messages. - * @param message UpdateGuardrailRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateGuardrailRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateGuardrailRequest; - - /** - * Decodes an UpdateGuardrailRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateGuardrailRequest; - - /** - * Verifies an UpdateGuardrailRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateGuardrailRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateGuardrailRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateGuardrailRequest; - - /** - * Creates a plain object from an UpdateGuardrailRequest message. Also converts values to other types if specified. - * @param message UpdateGuardrailRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.UpdateGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateGuardrailRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateGuardrailRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteGuardrailRequest. */ - interface IDeleteGuardrailRequest { - - /** DeleteGuardrailRequest name */ - name?: (string|null); - - /** DeleteGuardrailRequest force */ - force?: (boolean|null); - - /** DeleteGuardrailRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteGuardrailRequest. */ - class DeleteGuardrailRequest implements IDeleteGuardrailRequest { - - /** - * Constructs a new DeleteGuardrailRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDeleteGuardrailRequest); - - /** DeleteGuardrailRequest name. */ - public name: string; - - /** DeleteGuardrailRequest force. */ - public force: boolean; - - /** DeleteGuardrailRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteGuardrailRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteGuardrailRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDeleteGuardrailRequest): google.cloud.ces.v1beta.DeleteGuardrailRequest; - - /** - * Encodes the specified DeleteGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteGuardrailRequest.verify|verify} messages. - * @param message DeleteGuardrailRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDeleteGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteGuardrailRequest.verify|verify} messages. - * @param message DeleteGuardrailRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteGuardrailRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteGuardrailRequest; - - /** - * Decodes a DeleteGuardrailRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteGuardrailRequest; - - /** - * Verifies a DeleteGuardrailRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteGuardrailRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteGuardrailRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteGuardrailRequest; - - /** - * Creates a plain object from a DeleteGuardrailRequest message. Also converts values to other types if specified. - * @param message DeleteGuardrailRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DeleteGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteGuardrailRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteGuardrailRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDeploymentsRequest. */ - interface IListDeploymentsRequest { - - /** ListDeploymentsRequest parent */ - parent?: (string|null); - - /** ListDeploymentsRequest pageSize */ - pageSize?: (number|null); - - /** ListDeploymentsRequest pageToken */ - pageToken?: (string|null); - - /** ListDeploymentsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListDeploymentsRequest. */ - class ListDeploymentsRequest implements IListDeploymentsRequest { - - /** - * Constructs a new ListDeploymentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListDeploymentsRequest); - - /** ListDeploymentsRequest parent. */ - public parent: string; - - /** ListDeploymentsRequest pageSize. */ - public pageSize: number; - - /** ListDeploymentsRequest pageToken. */ - public pageToken: string; - - /** ListDeploymentsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListDeploymentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDeploymentsRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListDeploymentsRequest): google.cloud.ces.v1beta.ListDeploymentsRequest; - - /** - * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsRequest.verify|verify} messages. - * @param message ListDeploymentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsRequest.verify|verify} messages. - * @param message ListDeploymentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDeploymentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDeploymentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListDeploymentsRequest; - - /** - * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDeploymentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListDeploymentsRequest; - - /** - * Verifies a ListDeploymentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDeploymentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListDeploymentsRequest; - - /** - * Creates a plain object from a ListDeploymentsRequest message. Also converts values to other types if specified. - * @param message ListDeploymentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListDeploymentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDeploymentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDeploymentsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDeploymentsResponse. */ - interface IListDeploymentsResponse { - - /** ListDeploymentsResponse deployments */ - deployments?: (google.cloud.ces.v1beta.IDeployment[]|null); - - /** ListDeploymentsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListDeploymentsResponse. */ - class ListDeploymentsResponse implements IListDeploymentsResponse { - - /** - * Constructs a new ListDeploymentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListDeploymentsResponse); - - /** ListDeploymentsResponse deployments. */ - public deployments: google.cloud.ces.v1beta.IDeployment[]; - - /** ListDeploymentsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListDeploymentsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDeploymentsResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListDeploymentsResponse): google.cloud.ces.v1beta.ListDeploymentsResponse; - - /** - * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsResponse.verify|verify} messages. - * @param message ListDeploymentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsResponse.verify|verify} messages. - * @param message ListDeploymentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDeploymentsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDeploymentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListDeploymentsResponse; - - /** - * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDeploymentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListDeploymentsResponse; - - /** - * Verifies a ListDeploymentsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDeploymentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListDeploymentsResponse; - - /** - * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. - * @param message ListDeploymentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListDeploymentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDeploymentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDeploymentsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetDeploymentRequest. */ - interface IGetDeploymentRequest { - - /** GetDeploymentRequest name */ - name?: (string|null); - } - - /** Represents a GetDeploymentRequest. */ - class GetDeploymentRequest implements IGetDeploymentRequest { - - /** - * Constructs a new GetDeploymentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGetDeploymentRequest); - - /** GetDeploymentRequest name. */ - public name: string; - - /** - * Creates a new GetDeploymentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDeploymentRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGetDeploymentRequest): google.cloud.ces.v1beta.GetDeploymentRequest; - - /** - * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetDeploymentRequest.verify|verify} messages. - * @param message GetDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetDeploymentRequest.verify|verify} messages. - * @param message GetDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetDeploymentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetDeploymentRequest; - - /** - * Decodes a GetDeploymentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetDeploymentRequest; - - /** - * Verifies a GetDeploymentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDeploymentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetDeploymentRequest; - - /** - * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. - * @param message GetDeploymentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GetDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDeploymentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetDeploymentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateDeploymentRequest. */ - interface ICreateDeploymentRequest { - - /** CreateDeploymentRequest parent */ - parent?: (string|null); - - /** CreateDeploymentRequest deploymentId */ - deploymentId?: (string|null); - - /** CreateDeploymentRequest deployment */ - deployment?: (google.cloud.ces.v1beta.IDeployment|null); - } - - /** Represents a CreateDeploymentRequest. */ - class CreateDeploymentRequest implements ICreateDeploymentRequest { - - /** - * Constructs a new CreateDeploymentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ICreateDeploymentRequest); - - /** CreateDeploymentRequest parent. */ - public parent: string; - - /** CreateDeploymentRequest deploymentId. */ - public deploymentId: string; - - /** CreateDeploymentRequest deployment. */ - public deployment?: (google.cloud.ces.v1beta.IDeployment|null); - - /** - * Creates a new CreateDeploymentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateDeploymentRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.ICreateDeploymentRequest): google.cloud.ces.v1beta.CreateDeploymentRequest; - - /** - * Encodes the specified CreateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateDeploymentRequest.verify|verify} messages. - * @param message CreateDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ICreateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateDeploymentRequest.verify|verify} messages. - * @param message CreateDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateDeploymentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateDeploymentRequest; - - /** - * Decodes a CreateDeploymentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateDeploymentRequest; - - /** - * Verifies a CreateDeploymentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateDeploymentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateDeploymentRequest; - - /** - * Creates a plain object from a CreateDeploymentRequest message. Also converts values to other types if specified. - * @param message CreateDeploymentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.CreateDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateDeploymentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateDeploymentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDeploymentRequest. */ - interface IUpdateDeploymentRequest { - - /** UpdateDeploymentRequest deployment */ - deployment?: (google.cloud.ces.v1beta.IDeployment|null); - - /** UpdateDeploymentRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateDeploymentRequest. */ - class UpdateDeploymentRequest implements IUpdateDeploymentRequest { - - /** - * Constructs a new UpdateDeploymentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IUpdateDeploymentRequest); - - /** UpdateDeploymentRequest deployment. */ - public deployment?: (google.cloud.ces.v1beta.IDeployment|null); - - /** UpdateDeploymentRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateDeploymentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDeploymentRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IUpdateDeploymentRequest): google.cloud.ces.v1beta.UpdateDeploymentRequest; - - /** - * Encodes the specified UpdateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateDeploymentRequest.verify|verify} messages. - * @param message UpdateDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IUpdateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateDeploymentRequest.verify|verify} messages. - * @param message UpdateDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDeploymentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateDeploymentRequest; - - /** - * Decodes an UpdateDeploymentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateDeploymentRequest; - - /** - * Verifies an UpdateDeploymentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDeploymentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateDeploymentRequest; - - /** - * Creates a plain object from an UpdateDeploymentRequest message. Also converts values to other types if specified. - * @param message UpdateDeploymentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.UpdateDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDeploymentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDeploymentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteDeploymentRequest. */ - interface IDeleteDeploymentRequest { - - /** DeleteDeploymentRequest name */ - name?: (string|null); - - /** DeleteDeploymentRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteDeploymentRequest. */ - class DeleteDeploymentRequest implements IDeleteDeploymentRequest { - - /** - * Constructs a new DeleteDeploymentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDeleteDeploymentRequest); - - /** DeleteDeploymentRequest name. */ - public name: string; - - /** DeleteDeploymentRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteDeploymentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteDeploymentRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDeleteDeploymentRequest): google.cloud.ces.v1beta.DeleteDeploymentRequest; - - /** - * Encodes the specified DeleteDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteDeploymentRequest.verify|verify} messages. - * @param message DeleteDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDeleteDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteDeploymentRequest.verify|verify} messages. - * @param message DeleteDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteDeploymentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteDeploymentRequest; - - /** - * Decodes a DeleteDeploymentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteDeploymentRequest; - - /** - * Verifies a DeleteDeploymentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteDeploymentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteDeploymentRequest; - - /** - * Creates a plain object from a DeleteDeploymentRequest message. Also converts values to other types if specified. - * @param message DeleteDeploymentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DeleteDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteDeploymentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteDeploymentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListToolsetsRequest. */ - interface IListToolsetsRequest { - - /** ListToolsetsRequest parent */ - parent?: (string|null); - - /** ListToolsetsRequest pageSize */ - pageSize?: (number|null); - - /** ListToolsetsRequest pageToken */ - pageToken?: (string|null); - - /** ListToolsetsRequest filter */ - filter?: (string|null); - - /** ListToolsetsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListToolsetsRequest. */ - class ListToolsetsRequest implements IListToolsetsRequest { - - /** - * Constructs a new ListToolsetsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListToolsetsRequest); - - /** ListToolsetsRequest parent. */ - public parent: string; - - /** ListToolsetsRequest pageSize. */ - public pageSize: number; - - /** ListToolsetsRequest pageToken. */ - public pageToken: string; - - /** ListToolsetsRequest filter. */ - public filter: string; - - /** ListToolsetsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListToolsetsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListToolsetsRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListToolsetsRequest): google.cloud.ces.v1beta.ListToolsetsRequest; - - /** - * Encodes the specified ListToolsetsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsRequest.verify|verify} messages. - * @param message ListToolsetsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListToolsetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListToolsetsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsRequest.verify|verify} messages. - * @param message ListToolsetsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListToolsetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListToolsetsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListToolsetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListToolsetsRequest; - - /** - * Decodes a ListToolsetsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListToolsetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListToolsetsRequest; - - /** - * Verifies a ListToolsetsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListToolsetsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListToolsetsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListToolsetsRequest; - - /** - * Creates a plain object from a ListToolsetsRequest message. Also converts values to other types if specified. - * @param message ListToolsetsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListToolsetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListToolsetsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListToolsetsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListToolsetsResponse. */ - interface IListToolsetsResponse { - - /** ListToolsetsResponse toolsets */ - toolsets?: (google.cloud.ces.v1beta.IToolset[]|null); - - /** ListToolsetsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListToolsetsResponse. */ - class ListToolsetsResponse implements IListToolsetsResponse { - - /** - * Constructs a new ListToolsetsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListToolsetsResponse); - - /** ListToolsetsResponse toolsets. */ - public toolsets: google.cloud.ces.v1beta.IToolset[]; - - /** ListToolsetsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListToolsetsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListToolsetsResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListToolsetsResponse): google.cloud.ces.v1beta.ListToolsetsResponse; - - /** - * Encodes the specified ListToolsetsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsResponse.verify|verify} messages. - * @param message ListToolsetsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListToolsetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListToolsetsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsResponse.verify|verify} messages. - * @param message ListToolsetsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListToolsetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListToolsetsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListToolsetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListToolsetsResponse; - - /** - * Decodes a ListToolsetsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListToolsetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListToolsetsResponse; - - /** - * Verifies a ListToolsetsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListToolsetsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListToolsetsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListToolsetsResponse; - - /** - * Creates a plain object from a ListToolsetsResponse message. Also converts values to other types if specified. - * @param message ListToolsetsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListToolsetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListToolsetsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListToolsetsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetToolsetRequest. */ - interface IGetToolsetRequest { - - /** GetToolsetRequest name */ - name?: (string|null); - } - - /** Represents a GetToolsetRequest. */ - class GetToolsetRequest implements IGetToolsetRequest { - - /** - * Constructs a new GetToolsetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGetToolsetRequest); - - /** GetToolsetRequest name. */ - public name: string; - - /** - * Creates a new GetToolsetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetToolsetRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGetToolsetRequest): google.cloud.ces.v1beta.GetToolsetRequest; - - /** - * Encodes the specified GetToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetToolsetRequest.verify|verify} messages. - * @param message GetToolsetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGetToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetToolsetRequest.verify|verify} messages. - * @param message GetToolsetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGetToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetToolsetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetToolsetRequest; - - /** - * Decodes a GetToolsetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetToolsetRequest; - - /** - * Verifies a GetToolsetRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetToolsetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetToolsetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetToolsetRequest; - - /** - * Creates a plain object from a GetToolsetRequest message. Also converts values to other types if specified. - * @param message GetToolsetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GetToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetToolsetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetToolsetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateToolsetRequest. */ - interface ICreateToolsetRequest { - - /** CreateToolsetRequest parent */ - parent?: (string|null); - - /** CreateToolsetRequest toolsetId */ - toolsetId?: (string|null); - - /** CreateToolsetRequest toolset */ - toolset?: (google.cloud.ces.v1beta.IToolset|null); - } - - /** Represents a CreateToolsetRequest. */ - class CreateToolsetRequest implements ICreateToolsetRequest { - - /** - * Constructs a new CreateToolsetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ICreateToolsetRequest); - - /** CreateToolsetRequest parent. */ - public parent: string; - - /** CreateToolsetRequest toolsetId. */ - public toolsetId: string; - - /** CreateToolsetRequest toolset. */ - public toolset?: (google.cloud.ces.v1beta.IToolset|null); - - /** - * Creates a new CreateToolsetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateToolsetRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.ICreateToolsetRequest): google.cloud.ces.v1beta.CreateToolsetRequest; - - /** - * Encodes the specified CreateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolsetRequest.verify|verify} messages. - * @param message CreateToolsetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ICreateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolsetRequest.verify|verify} messages. - * @param message CreateToolsetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateToolsetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateToolsetRequest; - - /** - * Decodes a CreateToolsetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateToolsetRequest; - - /** - * Verifies a CreateToolsetRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateToolsetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateToolsetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateToolsetRequest; - - /** - * Creates a plain object from a CreateToolsetRequest message. Also converts values to other types if specified. - * @param message CreateToolsetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.CreateToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateToolsetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateToolsetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateToolsetRequest. */ - interface IUpdateToolsetRequest { - - /** UpdateToolsetRequest toolset */ - toolset?: (google.cloud.ces.v1beta.IToolset|null); - - /** UpdateToolsetRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateToolsetRequest. */ - class UpdateToolsetRequest implements IUpdateToolsetRequest { - - /** - * Constructs a new UpdateToolsetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IUpdateToolsetRequest); - - /** UpdateToolsetRequest toolset. */ - public toolset?: (google.cloud.ces.v1beta.IToolset|null); - - /** UpdateToolsetRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateToolsetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateToolsetRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IUpdateToolsetRequest): google.cloud.ces.v1beta.UpdateToolsetRequest; - - /** - * Encodes the specified UpdateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolsetRequest.verify|verify} messages. - * @param message UpdateToolsetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IUpdateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolsetRequest.verify|verify} messages. - * @param message UpdateToolsetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateToolsetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateToolsetRequest; - - /** - * Decodes an UpdateToolsetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateToolsetRequest; - - /** - * Verifies an UpdateToolsetRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateToolsetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateToolsetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateToolsetRequest; - - /** - * Creates a plain object from an UpdateToolsetRequest message. Also converts values to other types if specified. - * @param message UpdateToolsetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.UpdateToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateToolsetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateToolsetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteToolsetRequest. */ - interface IDeleteToolsetRequest { - - /** DeleteToolsetRequest name */ - name?: (string|null); - - /** DeleteToolsetRequest force */ - force?: (boolean|null); - - /** DeleteToolsetRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteToolsetRequest. */ - class DeleteToolsetRequest implements IDeleteToolsetRequest { - - /** - * Constructs a new DeleteToolsetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDeleteToolsetRequest); - - /** DeleteToolsetRequest name. */ - public name: string; - - /** DeleteToolsetRequest force. */ - public force: boolean; - - /** DeleteToolsetRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteToolsetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteToolsetRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDeleteToolsetRequest): google.cloud.ces.v1beta.DeleteToolsetRequest; - - /** - * Encodes the specified DeleteToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolsetRequest.verify|verify} messages. - * @param message DeleteToolsetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDeleteToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolsetRequest.verify|verify} messages. - * @param message DeleteToolsetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteToolsetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteToolsetRequest; - - /** - * Decodes a DeleteToolsetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteToolsetRequest; - - /** - * Verifies a DeleteToolsetRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteToolsetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteToolsetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteToolsetRequest; - - /** - * Creates a plain object from a DeleteToolsetRequest message. Also converts values to other types if specified. - * @param message DeleteToolsetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DeleteToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteToolsetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteToolsetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAppVersionsRequest. */ - interface IListAppVersionsRequest { - - /** ListAppVersionsRequest parent */ - parent?: (string|null); - - /** ListAppVersionsRequest pageSize */ - pageSize?: (number|null); - - /** ListAppVersionsRequest pageToken */ - pageToken?: (string|null); - - /** ListAppVersionsRequest filter */ - filter?: (string|null); - - /** ListAppVersionsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListAppVersionsRequest. */ - class ListAppVersionsRequest implements IListAppVersionsRequest { - - /** - * Constructs a new ListAppVersionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListAppVersionsRequest); - - /** ListAppVersionsRequest parent. */ - public parent: string; - - /** ListAppVersionsRequest pageSize. */ - public pageSize: number; - - /** ListAppVersionsRequest pageToken. */ - public pageToken: string; - - /** ListAppVersionsRequest filter. */ - public filter: string; - - /** ListAppVersionsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListAppVersionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAppVersionsRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListAppVersionsRequest): google.cloud.ces.v1beta.ListAppVersionsRequest; - - /** - * Encodes the specified ListAppVersionsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsRequest.verify|verify} messages. - * @param message ListAppVersionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListAppVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAppVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsRequest.verify|verify} messages. - * @param message ListAppVersionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListAppVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAppVersionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAppVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListAppVersionsRequest; - - /** - * Decodes a ListAppVersionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAppVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListAppVersionsRequest; - - /** - * Verifies a ListAppVersionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAppVersionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAppVersionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListAppVersionsRequest; - - /** - * Creates a plain object from a ListAppVersionsRequest message. Also converts values to other types if specified. - * @param message ListAppVersionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListAppVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAppVersionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAppVersionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAppVersionsResponse. */ - interface IListAppVersionsResponse { - - /** ListAppVersionsResponse appVersions */ - appVersions?: (google.cloud.ces.v1beta.IAppVersion[]|null); - - /** ListAppVersionsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListAppVersionsResponse. */ - class ListAppVersionsResponse implements IListAppVersionsResponse { - - /** - * Constructs a new ListAppVersionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListAppVersionsResponse); - - /** ListAppVersionsResponse appVersions. */ - public appVersions: google.cloud.ces.v1beta.IAppVersion[]; - - /** ListAppVersionsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListAppVersionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAppVersionsResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListAppVersionsResponse): google.cloud.ces.v1beta.ListAppVersionsResponse; - - /** - * Encodes the specified ListAppVersionsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsResponse.verify|verify} messages. - * @param message ListAppVersionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListAppVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAppVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsResponse.verify|verify} messages. - * @param message ListAppVersionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListAppVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAppVersionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAppVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListAppVersionsResponse; - - /** - * Decodes a ListAppVersionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAppVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListAppVersionsResponse; - - /** - * Verifies a ListAppVersionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAppVersionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAppVersionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListAppVersionsResponse; - - /** - * Creates a plain object from a ListAppVersionsResponse message. Also converts values to other types if specified. - * @param message ListAppVersionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListAppVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAppVersionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAppVersionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetAppVersionRequest. */ - interface IGetAppVersionRequest { - - /** GetAppVersionRequest name */ - name?: (string|null); - } - - /** Represents a GetAppVersionRequest. */ - class GetAppVersionRequest implements IGetAppVersionRequest { - - /** - * Constructs a new GetAppVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGetAppVersionRequest); - - /** GetAppVersionRequest name. */ - public name: string; - - /** - * Creates a new GetAppVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetAppVersionRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGetAppVersionRequest): google.cloud.ces.v1beta.GetAppVersionRequest; - - /** - * Encodes the specified GetAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetAppVersionRequest.verify|verify} messages. - * @param message GetAppVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGetAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetAppVersionRequest.verify|verify} messages. - * @param message GetAppVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGetAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetAppVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetAppVersionRequest; - - /** - * Decodes a GetAppVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetAppVersionRequest; - - /** - * Verifies a GetAppVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetAppVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetAppVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetAppVersionRequest; - - /** - * Creates a plain object from a GetAppVersionRequest message. Also converts values to other types if specified. - * @param message GetAppVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GetAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetAppVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetAppVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteAppVersionRequest. */ - interface IDeleteAppVersionRequest { - - /** DeleteAppVersionRequest name */ - name?: (string|null); - - /** DeleteAppVersionRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteAppVersionRequest. */ - class DeleteAppVersionRequest implements IDeleteAppVersionRequest { - - /** - * Constructs a new DeleteAppVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDeleteAppVersionRequest); - - /** DeleteAppVersionRequest name. */ - public name: string; - - /** DeleteAppVersionRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteAppVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteAppVersionRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDeleteAppVersionRequest): google.cloud.ces.v1beta.DeleteAppVersionRequest; - - /** - * Encodes the specified DeleteAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppVersionRequest.verify|verify} messages. - * @param message DeleteAppVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDeleteAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppVersionRequest.verify|verify} messages. - * @param message DeleteAppVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteAppVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteAppVersionRequest; - - /** - * Decodes a DeleteAppVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteAppVersionRequest; - - /** - * Verifies a DeleteAppVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteAppVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteAppVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteAppVersionRequest; - - /** - * Creates a plain object from a DeleteAppVersionRequest message. Also converts values to other types if specified. - * @param message DeleteAppVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DeleteAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteAppVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteAppVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateAppVersionRequest. */ - interface ICreateAppVersionRequest { - - /** CreateAppVersionRequest parent */ - parent?: (string|null); - - /** CreateAppVersionRequest appVersionId */ - appVersionId?: (string|null); - - /** CreateAppVersionRequest appVersion */ - appVersion?: (google.cloud.ces.v1beta.IAppVersion|null); - } - - /** Represents a CreateAppVersionRequest. */ - class CreateAppVersionRequest implements ICreateAppVersionRequest { - - /** - * Constructs a new CreateAppVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ICreateAppVersionRequest); - - /** CreateAppVersionRequest parent. */ - public parent: string; - - /** CreateAppVersionRequest appVersionId. */ - public appVersionId: string; - - /** CreateAppVersionRequest appVersion. */ - public appVersion?: (google.cloud.ces.v1beta.IAppVersion|null); - - /** - * Creates a new CreateAppVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateAppVersionRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.ICreateAppVersionRequest): google.cloud.ces.v1beta.CreateAppVersionRequest; - - /** - * Encodes the specified CreateAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppVersionRequest.verify|verify} messages. - * @param message CreateAppVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ICreateAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppVersionRequest.verify|verify} messages. - * @param message CreateAppVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateAppVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateAppVersionRequest; - - /** - * Decodes a CreateAppVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateAppVersionRequest; - - /** - * Verifies a CreateAppVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateAppVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateAppVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateAppVersionRequest; - - /** - * Creates a plain object from a CreateAppVersionRequest message. Also converts values to other types if specified. - * @param message CreateAppVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.CreateAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateAppVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateAppVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RestoreAppVersionRequest. */ - interface IRestoreAppVersionRequest { - - /** RestoreAppVersionRequest name */ - name?: (string|null); - } - - /** Represents a RestoreAppVersionRequest. */ - class RestoreAppVersionRequest implements IRestoreAppVersionRequest { - - /** - * Constructs a new RestoreAppVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IRestoreAppVersionRequest); - - /** RestoreAppVersionRequest name. */ - public name: string; - - /** - * Creates a new RestoreAppVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreAppVersionRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IRestoreAppVersionRequest): google.cloud.ces.v1beta.RestoreAppVersionRequest; - - /** - * Encodes the specified RestoreAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionRequest.verify|verify} messages. - * @param message RestoreAppVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IRestoreAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionRequest.verify|verify} messages. - * @param message RestoreAppVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IRestoreAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreAppVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RestoreAppVersionRequest; - - /** - * Decodes a RestoreAppVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RestoreAppVersionRequest; - - /** - * Verifies a RestoreAppVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreAppVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreAppVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RestoreAppVersionRequest; - - /** - * Creates a plain object from a RestoreAppVersionRequest message. Also converts values to other types if specified. - * @param message RestoreAppVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.RestoreAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreAppVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreAppVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RestoreAppVersionResponse. */ - interface IRestoreAppVersionResponse { - } - - /** Represents a RestoreAppVersionResponse. */ - class RestoreAppVersionResponse implements IRestoreAppVersionResponse { - - /** - * Constructs a new RestoreAppVersionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IRestoreAppVersionResponse); - - /** - * Creates a new RestoreAppVersionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreAppVersionResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IRestoreAppVersionResponse): google.cloud.ces.v1beta.RestoreAppVersionResponse; - - /** - * Encodes the specified RestoreAppVersionResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionResponse.verify|verify} messages. - * @param message RestoreAppVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IRestoreAppVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreAppVersionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionResponse.verify|verify} messages. - * @param message RestoreAppVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IRestoreAppVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreAppVersionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreAppVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RestoreAppVersionResponse; - - /** - * Decodes a RestoreAppVersionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreAppVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RestoreAppVersionResponse; - - /** - * Verifies a RestoreAppVersionResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreAppVersionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreAppVersionResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RestoreAppVersionResponse; - - /** - * Creates a plain object from a RestoreAppVersionResponse message. Also converts values to other types if specified. - * @param message RestoreAppVersionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.RestoreAppVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreAppVersionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreAppVersionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GenerateAppResourceResponse. */ - interface IGenerateAppResourceResponse { - - /** GenerateAppResourceResponse agent */ - agent?: (google.cloud.ces.v1beta.IAgent|null); - - /** GenerateAppResourceResponse toolset */ - toolset?: (google.cloud.ces.v1beta.IToolset|null); - - /** GenerateAppResourceResponse appSnapshot */ - appSnapshot?: (google.cloud.ces.v1beta.IAppSnapshot|null); - - /** GenerateAppResourceResponse tools */ - tools?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools|null); - - /** GenerateAppResourceResponse evaluations */ - evaluations?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations|null); - - /** GenerateAppResourceResponse appResources */ - appResources?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources|null); - - /** GenerateAppResourceResponse generateResultInfo */ - generateResultInfo?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo|null); - } - - /** Represents a GenerateAppResourceResponse. */ - class GenerateAppResourceResponse implements IGenerateAppResourceResponse { - - /** - * Constructs a new GenerateAppResourceResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGenerateAppResourceResponse); - - /** GenerateAppResourceResponse agent. */ - public agent?: (google.cloud.ces.v1beta.IAgent|null); - - /** GenerateAppResourceResponse toolset. */ - public toolset?: (google.cloud.ces.v1beta.IToolset|null); - - /** GenerateAppResourceResponse appSnapshot. */ - public appSnapshot?: (google.cloud.ces.v1beta.IAppSnapshot|null); - - /** GenerateAppResourceResponse tools. */ - public tools?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools|null); - - /** GenerateAppResourceResponse evaluations. */ - public evaluations?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations|null); - - /** GenerateAppResourceResponse appResources. */ - public appResources?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources|null); - - /** GenerateAppResourceResponse generateResultInfo. */ - public generateResultInfo?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo|null); - - /** GenerateAppResourceResponse generatedResource. */ - public generatedResource?: ("agent"|"toolset"|"appSnapshot"|"tools"|"evaluations"|"appResources"); - - /** - * Creates a new GenerateAppResourceResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns GenerateAppResourceResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGenerateAppResourceResponse): google.cloud.ces.v1beta.GenerateAppResourceResponse; - - /** - * Encodes the specified GenerateAppResourceResponse message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.verify|verify} messages. - * @param message GenerateAppResourceResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGenerateAppResourceResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenerateAppResourceResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.verify|verify} messages. - * @param message GenerateAppResourceResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGenerateAppResourceResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenerateAppResourceResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenerateAppResourceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateAppResourceResponse; - - /** - * Decodes a GenerateAppResourceResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenerateAppResourceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateAppResourceResponse; - - /** - * Verifies a GenerateAppResourceResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenerateAppResourceResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenerateAppResourceResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceResponse; - - /** - * Creates a plain object from a GenerateAppResourceResponse message. Also converts values to other types if specified. - * @param message GenerateAppResourceResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenerateAppResourceResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenerateAppResourceResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GenerateAppResourceResponse { - - /** Properties of an Evaluations. */ - interface IEvaluations { - - /** Evaluations evaluations */ - evaluations?: (google.cloud.ces.v1beta.IEvaluation[]|null); - } - - /** Represents an Evaluations. */ - class Evaluations implements IEvaluations { - - /** - * Constructs a new Evaluations. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations); - - /** Evaluations evaluations. */ - public evaluations: google.cloud.ces.v1beta.IEvaluation[]; - - /** - * Creates a new Evaluations instance using the specified properties. - * @param [properties] Properties to set - * @returns Evaluations instance - */ - public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations): google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations; - - /** - * Encodes the specified Evaluations message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.verify|verify} messages. - * @param message Evaluations message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Evaluations message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.verify|verify} messages. - * @param message Evaluations message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Evaluations message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Evaluations - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations; - - /** - * Decodes an Evaluations message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Evaluations - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations; - - /** - * Verifies an Evaluations message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Evaluations message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Evaluations - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations; - - /** - * Creates a plain object from an Evaluations message. Also converts values to other types if specified. - * @param message Evaluations - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Evaluations to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Evaluations - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Tools. */ - interface ITools { - - /** Tools tools */ - tools?: (google.cloud.ces.v1beta.ITool[]|null); - } - - /** Represents a Tools. */ - class Tools implements ITools { - - /** - * Constructs a new Tools. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools); - - /** Tools tools. */ - public tools: google.cloud.ces.v1beta.ITool[]; - - /** - * Creates a new Tools instance using the specified properties. - * @param [properties] Properties to set - * @returns Tools instance - */ - public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools): google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools; - - /** - * Encodes the specified Tools message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.verify|verify} messages. - * @param message Tools message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Tools message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.verify|verify} messages. - * @param message Tools message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Tools message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Tools - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools; - - /** - * Decodes a Tools message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Tools - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools; - - /** - * Verifies a Tools message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Tools message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Tools - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools; - - /** - * Creates a plain object from a Tools message. Also converts values to other types if specified. - * @param message Tools - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Tools to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Tools - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AppResources. */ - interface IAppResources { - - /** AppResources appSnapshot */ - appSnapshot?: (google.cloud.ces.v1beta.IAppSnapshot|null); - - /** AppResources evaluations */ - evaluations?: (google.cloud.ces.v1beta.IEvaluation[]|null); - } - - /** Represents an AppResources. */ - class AppResources implements IAppResources { - - /** - * Constructs a new AppResources. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources); - - /** AppResources appSnapshot. */ - public appSnapshot?: (google.cloud.ces.v1beta.IAppSnapshot|null); - - /** AppResources evaluations. */ - public evaluations: google.cloud.ces.v1beta.IEvaluation[]; - - /** - * Creates a new AppResources instance using the specified properties. - * @param [properties] Properties to set - * @returns AppResources instance - */ - public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources): google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources; - - /** - * Encodes the specified AppResources message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.verify|verify} messages. - * @param message AppResources message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AppResources message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.verify|verify} messages. - * @param message AppResources message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AppResources message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AppResources - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources; - - /** - * Decodes an AppResources message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AppResources - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources; - - /** - * Verifies an AppResources message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AppResources message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AppResources - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources; - - /** - * Creates a plain object from an AppResources message. Also converts values to other types if specified. - * @param message AppResources - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AppResources to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AppResources - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GenerateResultInfo. */ - interface IGenerateResultInfo { - - /** GenerateResultInfo explanation */ - explanation?: (string|null); - } - - /** Represents a GenerateResultInfo. */ - class GenerateResultInfo implements IGenerateResultInfo { - - /** - * Constructs a new GenerateResultInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo); - - /** GenerateResultInfo explanation. */ - public explanation: string; - - /** - * Creates a new GenerateResultInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GenerateResultInfo instance - */ - public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo): google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo; - - /** - * Encodes the specified GenerateResultInfo message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.verify|verify} messages. - * @param message GenerateResultInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenerateResultInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.verify|verify} messages. - * @param message GenerateResultInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenerateResultInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenerateResultInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo; - - /** - * Decodes a GenerateResultInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenerateResultInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo; - - /** - * Verifies a GenerateResultInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenerateResultInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenerateResultInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo; - - /** - * Creates a plain object from a GenerateResultInfo message. Also converts values to other types if specified. - * @param message GenerateResultInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenerateResultInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenerateResultInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ListChangelogsRequest. */ - interface IListChangelogsRequest { - - /** ListChangelogsRequest parent */ - parent?: (string|null); - - /** ListChangelogsRequest pageSize */ - pageSize?: (number|null); - - /** ListChangelogsRequest pageToken */ - pageToken?: (string|null); - - /** ListChangelogsRequest filter */ - filter?: (string|null); - - /** ListChangelogsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListChangelogsRequest. */ - class ListChangelogsRequest implements IListChangelogsRequest { - - /** - * Constructs a new ListChangelogsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListChangelogsRequest); - - /** ListChangelogsRequest parent. */ - public parent: string; - - /** ListChangelogsRequest pageSize. */ - public pageSize: number; - - /** ListChangelogsRequest pageToken. */ - public pageToken: string; - - /** ListChangelogsRequest filter. */ - public filter: string; - - /** ListChangelogsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListChangelogsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListChangelogsRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListChangelogsRequest): google.cloud.ces.v1beta.ListChangelogsRequest; - - /** - * Encodes the specified ListChangelogsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsRequest.verify|verify} messages. - * @param message ListChangelogsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListChangelogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListChangelogsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsRequest.verify|verify} messages. - * @param message ListChangelogsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListChangelogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListChangelogsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListChangelogsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListChangelogsRequest; - - /** - * Decodes a ListChangelogsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListChangelogsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListChangelogsRequest; - - /** - * Verifies a ListChangelogsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListChangelogsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListChangelogsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListChangelogsRequest; - - /** - * Creates a plain object from a ListChangelogsRequest message. Also converts values to other types if specified. - * @param message ListChangelogsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListChangelogsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListChangelogsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListChangelogsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListChangelogsResponse. */ - interface IListChangelogsResponse { - - /** ListChangelogsResponse changelogs */ - changelogs?: (google.cloud.ces.v1beta.IChangelog[]|null); - - /** ListChangelogsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListChangelogsResponse. */ - class ListChangelogsResponse implements IListChangelogsResponse { - - /** - * Constructs a new ListChangelogsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListChangelogsResponse); - - /** ListChangelogsResponse changelogs. */ - public changelogs: google.cloud.ces.v1beta.IChangelog[]; - - /** ListChangelogsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListChangelogsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListChangelogsResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListChangelogsResponse): google.cloud.ces.v1beta.ListChangelogsResponse; - - /** - * Encodes the specified ListChangelogsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsResponse.verify|verify} messages. - * @param message ListChangelogsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListChangelogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListChangelogsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsResponse.verify|verify} messages. - * @param message ListChangelogsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListChangelogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListChangelogsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListChangelogsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListChangelogsResponse; - - /** - * Decodes a ListChangelogsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListChangelogsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListChangelogsResponse; - - /** - * Verifies a ListChangelogsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListChangelogsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListChangelogsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListChangelogsResponse; - - /** - * Creates a plain object from a ListChangelogsResponse message. Also converts values to other types if specified. - * @param message ListChangelogsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListChangelogsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListChangelogsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListChangelogsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetChangelogRequest. */ - interface IGetChangelogRequest { - - /** GetChangelogRequest name */ - name?: (string|null); - } - - /** Represents a GetChangelogRequest. */ - class GetChangelogRequest implements IGetChangelogRequest { - - /** - * Constructs a new GetChangelogRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGetChangelogRequest); - - /** GetChangelogRequest name. */ - public name: string; - - /** - * Creates a new GetChangelogRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetChangelogRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGetChangelogRequest): google.cloud.ces.v1beta.GetChangelogRequest; - - /** - * Encodes the specified GetChangelogRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetChangelogRequest.verify|verify} messages. - * @param message GetChangelogRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGetChangelogRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetChangelogRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetChangelogRequest.verify|verify} messages. - * @param message GetChangelogRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGetChangelogRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetChangelogRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetChangelogRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetChangelogRequest; - - /** - * Decodes a GetChangelogRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetChangelogRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetChangelogRequest; - - /** - * Verifies a GetChangelogRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetChangelogRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetChangelogRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetChangelogRequest; - - /** - * Creates a plain object from a GetChangelogRequest message. Also converts values to other types if specified. - * @param message GetChangelogRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GetChangelogRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetChangelogRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetChangelogRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an App. */ - interface IApp { - - /** App name */ - name?: (string|null); - - /** App displayName */ - displayName?: (string|null); - - /** App description */ - description?: (string|null); - - /** App pinned */ - pinned?: (boolean|null); - - /** App rootAgent */ - rootAgent?: (string|null); - - /** App languageSettings */ - languageSettings?: (google.cloud.ces.v1beta.ILanguageSettings|null); - - /** App timeZoneSettings */ - timeZoneSettings?: (google.cloud.ces.v1beta.ITimeZoneSettings|null); - - /** App audioProcessingConfig */ - audioProcessingConfig?: (google.cloud.ces.v1beta.IAudioProcessingConfig|null); - - /** App loggingSettings */ - loggingSettings?: (google.cloud.ces.v1beta.ILoggingSettings|null); - - /** App errorHandlingSettings */ - errorHandlingSettings?: (google.cloud.ces.v1beta.IErrorHandlingSettings|null); - - /** App modelSettings */ - modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); - - /** App toolExecutionMode */ - toolExecutionMode?: (google.cloud.ces.v1beta.App.ToolExecutionMode|keyof typeof google.cloud.ces.v1beta.App.ToolExecutionMode|null); - - /** App evaluationMetricsThresholds */ - evaluationMetricsThresholds?: (google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null); - - /** App variableDeclarations */ - variableDeclarations?: (google.cloud.ces.v1beta.App.IVariableDeclaration[]|null); - - /** App predefinedVariableDeclarations */ - predefinedVariableDeclarations?: (google.cloud.ces.v1beta.App.IVariableDeclaration[]|null); - - /** App globalInstruction */ - globalInstruction?: (string|null); - - /** App guardrails */ - guardrails?: (string[]|null); - - /** App dataStoreSettings */ - dataStoreSettings?: (google.cloud.ces.v1beta.IDataStoreSettings|null); - - /** App defaultChannelProfile */ - defaultChannelProfile?: (google.cloud.ces.v1beta.IChannelProfile|null); - - /** App metadata */ - metadata?: ({ [k: string]: string }|null); - - /** App createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** App updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** App etag */ - etag?: (string|null); - - /** App deploymentCount */ - deploymentCount?: (number|null); - - /** App clientCertificateSettings */ - clientCertificateSettings?: (google.cloud.ces.v1beta.IClientCertificateSettings|null); - - /** App locked */ - locked?: (boolean|null); - - /** App evaluationPersonas */ - evaluationPersonas?: (google.cloud.ces.v1beta.IEvaluationPersona[]|null); - - /** App evaluationSettings */ - evaluationSettings?: (google.cloud.ces.v1beta.IEvaluationSettings|null); - } - - /** Represents an App. */ - class App implements IApp { - - /** - * Constructs a new App. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IApp); - - /** App name. */ - public name: string; - - /** App displayName. */ - public displayName: string; - - /** App description. */ - public description: string; - - /** App pinned. */ - public pinned: boolean; - - /** App rootAgent. */ - public rootAgent: string; - - /** App languageSettings. */ - public languageSettings?: (google.cloud.ces.v1beta.ILanguageSettings|null); - - /** App timeZoneSettings. */ - public timeZoneSettings?: (google.cloud.ces.v1beta.ITimeZoneSettings|null); - - /** App audioProcessingConfig. */ - public audioProcessingConfig?: (google.cloud.ces.v1beta.IAudioProcessingConfig|null); - - /** App loggingSettings. */ - public loggingSettings?: (google.cloud.ces.v1beta.ILoggingSettings|null); - - /** App errorHandlingSettings. */ - public errorHandlingSettings?: (google.cloud.ces.v1beta.IErrorHandlingSettings|null); - - /** App modelSettings. */ - public modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); - - /** App toolExecutionMode. */ - public toolExecutionMode: (google.cloud.ces.v1beta.App.ToolExecutionMode|keyof typeof google.cloud.ces.v1beta.App.ToolExecutionMode); - - /** App evaluationMetricsThresholds. */ - public evaluationMetricsThresholds?: (google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null); - - /** App variableDeclarations. */ - public variableDeclarations: google.cloud.ces.v1beta.App.IVariableDeclaration[]; - - /** App predefinedVariableDeclarations. */ - public predefinedVariableDeclarations: google.cloud.ces.v1beta.App.IVariableDeclaration[]; - - /** App globalInstruction. */ - public globalInstruction: string; - - /** App guardrails. */ - public guardrails: string[]; - - /** App dataStoreSettings. */ - public dataStoreSettings?: (google.cloud.ces.v1beta.IDataStoreSettings|null); - - /** App defaultChannelProfile. */ - public defaultChannelProfile?: (google.cloud.ces.v1beta.IChannelProfile|null); - - /** App metadata. */ - public metadata: { [k: string]: string }; - - /** App createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** App updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** App etag. */ - public etag: string; - - /** App deploymentCount. */ - public deploymentCount: number; - - /** App clientCertificateSettings. */ - public clientCertificateSettings?: (google.cloud.ces.v1beta.IClientCertificateSettings|null); - - /** App locked. */ - public locked: boolean; - - /** App evaluationPersonas. */ - public evaluationPersonas: google.cloud.ces.v1beta.IEvaluationPersona[]; - - /** App evaluationSettings. */ - public evaluationSettings?: (google.cloud.ces.v1beta.IEvaluationSettings|null); - - /** - * Creates a new App instance using the specified properties. - * @param [properties] Properties to set - * @returns App instance - */ - public static create(properties?: google.cloud.ces.v1beta.IApp): google.cloud.ces.v1beta.App; - - /** - * Encodes the specified App message. Does not implicitly {@link google.cloud.ces.v1beta.App.verify|verify} messages. - * @param message App message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IApp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified App message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.App.verify|verify} messages. - * @param message App message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IApp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an App message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.App; - - /** - * Decodes an App message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.App; - - /** - * Verifies an App message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an App message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns App - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.App; - - /** - * Creates a plain object from an App message. Also converts values to other types if specified. - * @param message App - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.App, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this App to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for App - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace App { - - /** Properties of a VariableDeclaration. */ - interface IVariableDeclaration { - - /** VariableDeclaration name */ - name?: (string|null); - - /** VariableDeclaration description */ - description?: (string|null); - - /** VariableDeclaration schema */ - schema?: (google.cloud.ces.v1beta.ISchema|null); - } - - /** Represents a VariableDeclaration. */ - class VariableDeclaration implements IVariableDeclaration { - - /** - * Constructs a new VariableDeclaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.App.IVariableDeclaration); - - /** VariableDeclaration name. */ - public name: string; - - /** VariableDeclaration description. */ - public description: string; - - /** VariableDeclaration schema. */ - public schema?: (google.cloud.ces.v1beta.ISchema|null); - - /** - * Creates a new VariableDeclaration instance using the specified properties. - * @param [properties] Properties to set - * @returns VariableDeclaration instance - */ - public static create(properties?: google.cloud.ces.v1beta.App.IVariableDeclaration): google.cloud.ces.v1beta.App.VariableDeclaration; - - /** - * Encodes the specified VariableDeclaration message. Does not implicitly {@link google.cloud.ces.v1beta.App.VariableDeclaration.verify|verify} messages. - * @param message VariableDeclaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.App.IVariableDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VariableDeclaration message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.App.VariableDeclaration.verify|verify} messages. - * @param message VariableDeclaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.App.IVariableDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VariableDeclaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VariableDeclaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.App.VariableDeclaration; - - /** - * Decodes a VariableDeclaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VariableDeclaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.App.VariableDeclaration; - - /** - * Verifies a VariableDeclaration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a VariableDeclaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VariableDeclaration - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.App.VariableDeclaration; - - /** - * Creates a plain object from a VariableDeclaration message. Also converts values to other types if specified. - * @param message VariableDeclaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.App.VariableDeclaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this VariableDeclaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for VariableDeclaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** ToolExecutionMode enum. */ - enum ToolExecutionMode { - TOOL_EXECUTION_MODE_UNSPECIFIED = 0, - PARALLEL = 1, - SEQUENTIAL = 2 - } - } - - /** Properties of a TimeZoneSettings. */ - interface ITimeZoneSettings { - - /** TimeZoneSettings timeZone */ - timeZone?: (string|null); - } - - /** Represents a TimeZoneSettings. */ - class TimeZoneSettings implements ITimeZoneSettings { - - /** - * Constructs a new TimeZoneSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ITimeZoneSettings); - - /** TimeZoneSettings timeZone. */ - public timeZone: string; - - /** - * Creates a new TimeZoneSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns TimeZoneSettings instance - */ - public static create(properties?: google.cloud.ces.v1beta.ITimeZoneSettings): google.cloud.ces.v1beta.TimeZoneSettings; - - /** - * Encodes the specified TimeZoneSettings message. Does not implicitly {@link google.cloud.ces.v1beta.TimeZoneSettings.verify|verify} messages. - * @param message TimeZoneSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ITimeZoneSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimeZoneSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TimeZoneSettings.verify|verify} messages. - * @param message TimeZoneSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ITimeZoneSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TimeZoneSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimeZoneSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TimeZoneSettings; - - /** - * Decodes a TimeZoneSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimeZoneSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TimeZoneSettings; - - /** - * Verifies a TimeZoneSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TimeZoneSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimeZoneSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TimeZoneSettings; - - /** - * Creates a plain object from a TimeZoneSettings message. Also converts values to other types if specified. - * @param message TimeZoneSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.TimeZoneSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimeZoneSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TimeZoneSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LanguageSettings. */ - interface ILanguageSettings { - - /** LanguageSettings defaultLanguageCode */ - defaultLanguageCode?: (string|null); - - /** LanguageSettings supportedLanguageCodes */ - supportedLanguageCodes?: (string[]|null); - - /** LanguageSettings enableMultilingualSupport */ - enableMultilingualSupport?: (boolean|null); - - /** LanguageSettings fallbackAction */ - fallbackAction?: (string|null); - } - - /** Represents a LanguageSettings. */ - class LanguageSettings implements ILanguageSettings { - - /** - * Constructs a new LanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ILanguageSettings); - - /** LanguageSettings defaultLanguageCode. */ - public defaultLanguageCode: string; - - /** LanguageSettings supportedLanguageCodes. */ - public supportedLanguageCodes: string[]; - - /** LanguageSettings enableMultilingualSupport. */ - public enableMultilingualSupport: boolean; - - /** LanguageSettings fallbackAction. */ - public fallbackAction: string; - - /** - * Creates a new LanguageSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns LanguageSettings instance - */ - public static create(properties?: google.cloud.ces.v1beta.ILanguageSettings): google.cloud.ces.v1beta.LanguageSettings; - - /** - * Encodes the specified LanguageSettings message. Does not implicitly {@link google.cloud.ces.v1beta.LanguageSettings.verify|verify} messages. - * @param message LanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ILanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LanguageSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LanguageSettings.verify|verify} messages. - * @param message LanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ILanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LanguageSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LanguageSettings; - - /** - * Decodes a LanguageSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LanguageSettings; - - /** - * Verifies a LanguageSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LanguageSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LanguageSettings; - - /** - * Creates a plain object from a LanguageSettings message. Also converts values to other types if specified. - * @param message LanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.LanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AudioProcessingConfig. */ - interface IAudioProcessingConfig { - - /** AudioProcessingConfig synthesizeSpeechConfigs */ - synthesizeSpeechConfigs?: ({ [k: string]: google.cloud.ces.v1beta.ISynthesizeSpeechConfig }|null); - - /** AudioProcessingConfig bargeInConfig */ - bargeInConfig?: (google.cloud.ces.v1beta.IBargeInConfig|null); - - /** AudioProcessingConfig inactivityTimeout */ - inactivityTimeout?: (google.protobuf.IDuration|null); - - /** AudioProcessingConfig ambientSoundConfig */ - ambientSoundConfig?: (google.cloud.ces.v1beta.IAmbientSoundConfig|null); - } - - /** Represents an AudioProcessingConfig. */ - class AudioProcessingConfig implements IAudioProcessingConfig { - - /** - * Constructs a new AudioProcessingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IAudioProcessingConfig); - - /** AudioProcessingConfig synthesizeSpeechConfigs. */ - public synthesizeSpeechConfigs: { [k: string]: google.cloud.ces.v1beta.ISynthesizeSpeechConfig }; - - /** AudioProcessingConfig bargeInConfig. */ - public bargeInConfig?: (google.cloud.ces.v1beta.IBargeInConfig|null); - - /** AudioProcessingConfig inactivityTimeout. */ - public inactivityTimeout?: (google.protobuf.IDuration|null); - - /** AudioProcessingConfig ambientSoundConfig. */ - public ambientSoundConfig?: (google.cloud.ces.v1beta.IAmbientSoundConfig|null); - - /** - * Creates a new AudioProcessingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AudioProcessingConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IAudioProcessingConfig): google.cloud.ces.v1beta.AudioProcessingConfig; - - /** - * Encodes the specified AudioProcessingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.AudioProcessingConfig.verify|verify} messages. - * @param message AudioProcessingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IAudioProcessingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AudioProcessingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AudioProcessingConfig.verify|verify} messages. - * @param message AudioProcessingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IAudioProcessingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AudioProcessingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AudioProcessingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AudioProcessingConfig; - - /** - * Decodes an AudioProcessingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AudioProcessingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AudioProcessingConfig; - - /** - * Verifies an AudioProcessingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AudioProcessingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AudioProcessingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AudioProcessingConfig; - - /** - * Creates a plain object from an AudioProcessingConfig message. Also converts values to other types if specified. - * @param message AudioProcessingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.AudioProcessingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AudioProcessingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AudioProcessingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AmbientSoundConfig. */ - interface IAmbientSoundConfig { - - /** AmbientSoundConfig prebuiltAmbientNoise */ - prebuiltAmbientNoise?: (google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise|keyof typeof google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise|null); - - /** AmbientSoundConfig gcsUri */ - gcsUri?: (string|null); - - /** AmbientSoundConfig prebuiltAmbientSound */ - prebuiltAmbientSound?: (string|null); - - /** AmbientSoundConfig volumeGainDb */ - volumeGainDb?: (number|null); - } - - /** Represents an AmbientSoundConfig. */ - class AmbientSoundConfig implements IAmbientSoundConfig { - - /** - * Constructs a new AmbientSoundConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IAmbientSoundConfig); - - /** AmbientSoundConfig prebuiltAmbientNoise. */ - public prebuiltAmbientNoise?: (google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise|keyof typeof google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise|null); - - /** AmbientSoundConfig gcsUri. */ - public gcsUri?: (string|null); - - /** AmbientSoundConfig prebuiltAmbientSound. */ - public prebuiltAmbientSound?: (string|null); - - /** AmbientSoundConfig volumeGainDb. */ - public volumeGainDb: number; - - /** AmbientSoundConfig source. */ - public source?: ("prebuiltAmbientNoise"|"gcsUri"|"prebuiltAmbientSound"); - - /** - * Creates a new AmbientSoundConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AmbientSoundConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IAmbientSoundConfig): google.cloud.ces.v1beta.AmbientSoundConfig; - - /** - * Encodes the specified AmbientSoundConfig message. Does not implicitly {@link google.cloud.ces.v1beta.AmbientSoundConfig.verify|verify} messages. - * @param message AmbientSoundConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IAmbientSoundConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AmbientSoundConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AmbientSoundConfig.verify|verify} messages. - * @param message AmbientSoundConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IAmbientSoundConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AmbientSoundConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AmbientSoundConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AmbientSoundConfig; - - /** - * Decodes an AmbientSoundConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AmbientSoundConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AmbientSoundConfig; - - /** - * Verifies an AmbientSoundConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AmbientSoundConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AmbientSoundConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AmbientSoundConfig; - - /** - * Creates a plain object from an AmbientSoundConfig message. Also converts values to other types if specified. - * @param message AmbientSoundConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.AmbientSoundConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AmbientSoundConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AmbientSoundConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AmbientSoundConfig { - - /** PrebuiltAmbientNoise enum. */ - enum PrebuiltAmbientNoise { - PREBUILT_AMBIENT_NOISE_UNSPECIFIED = 0, - RETAIL_STORE = 1, - CONVENTION_HALL = 2, - OUTDOOR = 3 - } - } - - /** Properties of a BargeInConfig. */ - interface IBargeInConfig { - - /** BargeInConfig disableBargeIn */ - disableBargeIn?: (boolean|null); - - /** BargeInConfig bargeInAwareness */ - bargeInAwareness?: (boolean|null); - } - - /** Represents a BargeInConfig. */ - class BargeInConfig implements IBargeInConfig { - - /** - * Constructs a new BargeInConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IBargeInConfig); - - /** BargeInConfig disableBargeIn. */ - public disableBargeIn: boolean; - - /** BargeInConfig bargeInAwareness. */ - public bargeInAwareness: boolean; - - /** - * Creates a new BargeInConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns BargeInConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IBargeInConfig): google.cloud.ces.v1beta.BargeInConfig; - - /** - * Encodes the specified BargeInConfig message. Does not implicitly {@link google.cloud.ces.v1beta.BargeInConfig.verify|verify} messages. - * @param message BargeInConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IBargeInConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BargeInConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BargeInConfig.verify|verify} messages. - * @param message BargeInConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IBargeInConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BargeInConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BargeInConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BargeInConfig; - - /** - * Decodes a BargeInConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BargeInConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BargeInConfig; - - /** - * Verifies a BargeInConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BargeInConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BargeInConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BargeInConfig; - - /** - * Creates a plain object from a BargeInConfig message. Also converts values to other types if specified. - * @param message BargeInConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.BargeInConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BargeInConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BargeInConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SynthesizeSpeechConfig. */ - interface ISynthesizeSpeechConfig { - - /** SynthesizeSpeechConfig voice */ - voice?: (string|null); - - /** SynthesizeSpeechConfig speakingRate */ - speakingRate?: (number|null); - } - - /** Represents a SynthesizeSpeechConfig. */ - class SynthesizeSpeechConfig implements ISynthesizeSpeechConfig { - - /** - * Constructs a new SynthesizeSpeechConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ISynthesizeSpeechConfig); - - /** SynthesizeSpeechConfig voice. */ - public voice: string; - - /** SynthesizeSpeechConfig speakingRate. */ - public speakingRate: number; - - /** - * Creates a new SynthesizeSpeechConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SynthesizeSpeechConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.ISynthesizeSpeechConfig): google.cloud.ces.v1beta.SynthesizeSpeechConfig; - - /** - * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.ces.v1beta.SynthesizeSpeechConfig.verify|verify} messages. - * @param message SynthesizeSpeechConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SynthesizeSpeechConfig.verify|verify} messages. - * @param message SynthesizeSpeechConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SynthesizeSpeechConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SynthesizeSpeechConfig; - - /** - * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SynthesizeSpeechConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SynthesizeSpeechConfig; - - /** - * Verifies a SynthesizeSpeechConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SynthesizeSpeechConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SynthesizeSpeechConfig; - - /** - * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. - * @param message SynthesizeSpeechConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.SynthesizeSpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SynthesizeSpeechConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SynthesizeSpeechConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MetricAnalysisSettings. */ - interface IMetricAnalysisSettings { - - /** MetricAnalysisSettings llmMetricsOptedOut */ - llmMetricsOptedOut?: (boolean|null); - } - - /** Represents a MetricAnalysisSettings. */ - class MetricAnalysisSettings implements IMetricAnalysisSettings { - - /** - * Constructs a new MetricAnalysisSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IMetricAnalysisSettings); - - /** MetricAnalysisSettings llmMetricsOptedOut. */ - public llmMetricsOptedOut: boolean; - - /** - * Creates a new MetricAnalysisSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MetricAnalysisSettings instance - */ - public static create(properties?: google.cloud.ces.v1beta.IMetricAnalysisSettings): google.cloud.ces.v1beta.MetricAnalysisSettings; - - /** - * Encodes the specified MetricAnalysisSettings message. Does not implicitly {@link google.cloud.ces.v1beta.MetricAnalysisSettings.verify|verify} messages. - * @param message MetricAnalysisSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IMetricAnalysisSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MetricAnalysisSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.MetricAnalysisSettings.verify|verify} messages. - * @param message MetricAnalysisSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IMetricAnalysisSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MetricAnalysisSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MetricAnalysisSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.MetricAnalysisSettings; - - /** - * Decodes a MetricAnalysisSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MetricAnalysisSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.MetricAnalysisSettings; - - /** - * Verifies a MetricAnalysisSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MetricAnalysisSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MetricAnalysisSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.MetricAnalysisSettings; - - /** - * Creates a plain object from a MetricAnalysisSettings message. Also converts values to other types if specified. - * @param message MetricAnalysisSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.MetricAnalysisSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MetricAnalysisSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MetricAnalysisSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LoggingSettings. */ - interface ILoggingSettings { - - /** LoggingSettings redactionConfig */ - redactionConfig?: (google.cloud.ces.v1beta.IRedactionConfig|null); - - /** LoggingSettings audioRecordingConfig */ - audioRecordingConfig?: (google.cloud.ces.v1beta.IAudioRecordingConfig|null); - - /** LoggingSettings bigqueryExportSettings */ - bigqueryExportSettings?: (google.cloud.ces.v1beta.IBigQueryExportSettings|null); - - /** LoggingSettings cloudLoggingSettings */ - cloudLoggingSettings?: (google.cloud.ces.v1beta.ICloudLoggingSettings|null); - - /** LoggingSettings conversationLoggingSettings */ - conversationLoggingSettings?: (google.cloud.ces.v1beta.IConversationLoggingSettings|null); - - /** LoggingSettings evaluationAudioRecordingConfig */ - evaluationAudioRecordingConfig?: (google.cloud.ces.v1beta.IAudioRecordingConfig|null); - - /** LoggingSettings metricAnalysisSettings */ - metricAnalysisSettings?: (google.cloud.ces.v1beta.IMetricAnalysisSettings|null); - } - - /** Represents a LoggingSettings. */ - class LoggingSettings implements ILoggingSettings { - - /** - * Constructs a new LoggingSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ILoggingSettings); - - /** LoggingSettings redactionConfig. */ - public redactionConfig?: (google.cloud.ces.v1beta.IRedactionConfig|null); - - /** LoggingSettings audioRecordingConfig. */ - public audioRecordingConfig?: (google.cloud.ces.v1beta.IAudioRecordingConfig|null); - - /** LoggingSettings bigqueryExportSettings. */ - public bigqueryExportSettings?: (google.cloud.ces.v1beta.IBigQueryExportSettings|null); - - /** LoggingSettings cloudLoggingSettings. */ - public cloudLoggingSettings?: (google.cloud.ces.v1beta.ICloudLoggingSettings|null); - - /** LoggingSettings conversationLoggingSettings. */ - public conversationLoggingSettings?: (google.cloud.ces.v1beta.IConversationLoggingSettings|null); - - /** LoggingSettings evaluationAudioRecordingConfig. */ - public evaluationAudioRecordingConfig?: (google.cloud.ces.v1beta.IAudioRecordingConfig|null); - - /** LoggingSettings metricAnalysisSettings. */ - public metricAnalysisSettings?: (google.cloud.ces.v1beta.IMetricAnalysisSettings|null); - - /** - * Creates a new LoggingSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns LoggingSettings instance - */ - public static create(properties?: google.cloud.ces.v1beta.ILoggingSettings): google.cloud.ces.v1beta.LoggingSettings; - - /** - * Encodes the specified LoggingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.LoggingSettings.verify|verify} messages. - * @param message LoggingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ILoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LoggingSettings.verify|verify} messages. - * @param message LoggingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ILoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LoggingSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LoggingSettings; - - /** - * Decodes a LoggingSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LoggingSettings; - - /** - * Verifies a LoggingSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LoggingSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LoggingSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LoggingSettings; - - /** - * Creates a plain object from a LoggingSettings message. Also converts values to other types if specified. - * @param message LoggingSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.LoggingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LoggingSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LoggingSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ErrorHandlingSettings. */ - interface IErrorHandlingSettings { - - /** ErrorHandlingSettings errorHandlingStrategy */ - errorHandlingStrategy?: (google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy|keyof typeof google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy|null); - } - - /** Represents an ErrorHandlingSettings. */ - class ErrorHandlingSettings implements IErrorHandlingSettings { - - /** - * Constructs a new ErrorHandlingSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IErrorHandlingSettings); - - /** ErrorHandlingSettings errorHandlingStrategy. */ - public errorHandlingStrategy: (google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy|keyof typeof google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy); - - /** - * Creates a new ErrorHandlingSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ErrorHandlingSettings instance - */ - public static create(properties?: google.cloud.ces.v1beta.IErrorHandlingSettings): google.cloud.ces.v1beta.ErrorHandlingSettings; - - /** - * Encodes the specified ErrorHandlingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ErrorHandlingSettings.verify|verify} messages. - * @param message ErrorHandlingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IErrorHandlingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ErrorHandlingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ErrorHandlingSettings.verify|verify} messages. - * @param message ErrorHandlingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IErrorHandlingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ErrorHandlingSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ErrorHandlingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ErrorHandlingSettings; - - /** - * Decodes an ErrorHandlingSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ErrorHandlingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ErrorHandlingSettings; - - /** - * Verifies an ErrorHandlingSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ErrorHandlingSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ErrorHandlingSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ErrorHandlingSettings; - - /** - * Creates a plain object from an ErrorHandlingSettings message. Also converts values to other types if specified. - * @param message ErrorHandlingSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ErrorHandlingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ErrorHandlingSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ErrorHandlingSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ErrorHandlingSettings { - - /** ErrorHandlingStrategy enum. */ - enum ErrorHandlingStrategy { - ERROR_HANDLING_STRATEGY_UNSPECIFIED = 0, - NONE = 1, - FALLBACK_RESPONSE = 2 - } - } - - /** Properties of an EvaluationMetricsThresholds. */ - interface IEvaluationMetricsThresholds { - - /** EvaluationMetricsThresholds goldenEvaluationMetricsThresholds */ - goldenEvaluationMetricsThresholds?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null); - - /** EvaluationMetricsThresholds hallucinationMetricBehavior */ - hallucinationMetricBehavior?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|null); - - /** EvaluationMetricsThresholds goldenHallucinationMetricBehavior */ - goldenHallucinationMetricBehavior?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|null); - - /** EvaluationMetricsThresholds scenarioHallucinationMetricBehavior */ - scenarioHallucinationMetricBehavior?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|null); - } - - /** Represents an EvaluationMetricsThresholds. */ - class EvaluationMetricsThresholds implements IEvaluationMetricsThresholds { - - /** - * Constructs a new EvaluationMetricsThresholds. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IEvaluationMetricsThresholds); - - /** EvaluationMetricsThresholds goldenEvaluationMetricsThresholds. */ - public goldenEvaluationMetricsThresholds?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null); - - /** EvaluationMetricsThresholds hallucinationMetricBehavior. */ - public hallucinationMetricBehavior: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior); - - /** EvaluationMetricsThresholds goldenHallucinationMetricBehavior. */ - public goldenHallucinationMetricBehavior: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior); - - /** EvaluationMetricsThresholds scenarioHallucinationMetricBehavior. */ - public scenarioHallucinationMetricBehavior: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior); - - /** - * Creates a new EvaluationMetricsThresholds instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluationMetricsThresholds instance - */ - public static create(properties?: google.cloud.ces.v1beta.IEvaluationMetricsThresholds): google.cloud.ces.v1beta.EvaluationMetricsThresholds; - - /** - * Encodes the specified EvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.verify|verify} messages. - * @param message EvaluationMetricsThresholds message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.verify|verify} messages. - * @param message EvaluationMetricsThresholds message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluationMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationMetricsThresholds; - - /** - * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluationMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationMetricsThresholds; - - /** - * Verifies an EvaluationMetricsThresholds message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluationMetricsThresholds - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationMetricsThresholds; - - /** - * Creates a plain object from an EvaluationMetricsThresholds message. Also converts values to other types if specified. - * @param message EvaluationMetricsThresholds - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluationMetricsThresholds to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluationMetricsThresholds - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EvaluationMetricsThresholds { - - /** Properties of a GoldenEvaluationMetricsThresholds. */ - interface IGoldenEvaluationMetricsThresholds { - - /** GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds */ - turnLevelMetricsThresholds?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null); - - /** GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds */ - expectationLevelMetricsThresholds?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null); - - /** GoldenEvaluationMetricsThresholds toolMatchingSettings */ - toolMatchingSettings?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings|null); - } - - /** Represents a GoldenEvaluationMetricsThresholds. */ - class GoldenEvaluationMetricsThresholds implements IGoldenEvaluationMetricsThresholds { - - /** - * Constructs a new GoldenEvaluationMetricsThresholds. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds); - - /** GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds. */ - public turnLevelMetricsThresholds?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null); - - /** GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds. */ - public expectationLevelMetricsThresholds?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null); - - /** GoldenEvaluationMetricsThresholds toolMatchingSettings. */ - public toolMatchingSettings?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings|null); - - /** - * Creates a new GoldenEvaluationMetricsThresholds instance using the specified properties. - * @param [properties] Properties to set - * @returns GoldenEvaluationMetricsThresholds instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; - - /** - * Encodes the specified GoldenEvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. - * @param message GoldenEvaluationMetricsThresholds message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoldenEvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. - * @param message GoldenEvaluationMetricsThresholds message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoldenEvaluationMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; - - /** - * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoldenEvaluationMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; - - /** - * Verifies a GoldenEvaluationMetricsThresholds message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoldenEvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoldenEvaluationMetricsThresholds - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; - - /** - * Creates a plain object from a GoldenEvaluationMetricsThresholds message. Also converts values to other types if specified. - * @param message GoldenEvaluationMetricsThresholds - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoldenEvaluationMetricsThresholds to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoldenEvaluationMetricsThresholds - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GoldenEvaluationMetricsThresholds { - - /** Properties of a TurnLevelMetricsThresholds. */ - interface ITurnLevelMetricsThresholds { - - /** TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold */ - semanticSimilaritySuccessThreshold?: (number|null); - - /** TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold */ - overallToolInvocationCorrectnessThreshold?: (number|null); - - /** TurnLevelMetricsThresholds semanticSimilarityChannel */ - semanticSimilarityChannel?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|null); - } - - /** Represents a TurnLevelMetricsThresholds. */ - class TurnLevelMetricsThresholds implements ITurnLevelMetricsThresholds { - - /** - * Constructs a new TurnLevelMetricsThresholds. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds); - - /** TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold. */ - public semanticSimilaritySuccessThreshold?: (number|null); - - /** TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold. */ - public overallToolInvocationCorrectnessThreshold?: (number|null); - - /** TurnLevelMetricsThresholds semanticSimilarityChannel. */ - public semanticSimilarityChannel: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel); - - /** - * Creates a new TurnLevelMetricsThresholds instance using the specified properties. - * @param [properties] Properties to set - * @returns TurnLevelMetricsThresholds instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; - - /** - * Encodes the specified TurnLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. - * @param message TurnLevelMetricsThresholds message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TurnLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. - * @param message TurnLevelMetricsThresholds message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TurnLevelMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; - - /** - * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TurnLevelMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; - - /** - * Verifies a TurnLevelMetricsThresholds message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TurnLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TurnLevelMetricsThresholds - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; - - /** - * Creates a plain object from a TurnLevelMetricsThresholds message. Also converts values to other types if specified. - * @param message TurnLevelMetricsThresholds - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TurnLevelMetricsThresholds to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TurnLevelMetricsThresholds - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TurnLevelMetricsThresholds { - - /** SemanticSimilarityChannel enum. */ - enum SemanticSimilarityChannel { - SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED = 0, - TEXT = 1, - AUDIO = 2 - } - } - - /** Properties of an ExpectationLevelMetricsThresholds. */ - interface IExpectationLevelMetricsThresholds { - - /** ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold */ - toolInvocationParameterCorrectnessThreshold?: (number|null); - } - - /** Represents an ExpectationLevelMetricsThresholds. */ - class ExpectationLevelMetricsThresholds implements IExpectationLevelMetricsThresholds { - - /** - * Constructs a new ExpectationLevelMetricsThresholds. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds); - - /** ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold. */ - public toolInvocationParameterCorrectnessThreshold?: (number|null); - - /** - * Creates a new ExpectationLevelMetricsThresholds instance using the specified properties. - * @param [properties] Properties to set - * @returns ExpectationLevelMetricsThresholds instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; - - /** - * Encodes the specified ExpectationLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. - * @param message ExpectationLevelMetricsThresholds message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExpectationLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. - * @param message ExpectationLevelMetricsThresholds message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExpectationLevelMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; - - /** - * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExpectationLevelMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; - - /** - * Verifies an ExpectationLevelMetricsThresholds message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExpectationLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExpectationLevelMetricsThresholds - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; - - /** - * Creates a plain object from an ExpectationLevelMetricsThresholds message. Also converts values to other types if specified. - * @param message ExpectationLevelMetricsThresholds - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExpectationLevelMetricsThresholds to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExpectationLevelMetricsThresholds - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ToolMatchingSettings. */ - interface IToolMatchingSettings { - - /** ToolMatchingSettings extraToolCallBehavior */ - extraToolCallBehavior?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|null); - } - - /** Represents a ToolMatchingSettings. */ - class ToolMatchingSettings implements IToolMatchingSettings { - - /** - * Constructs a new ToolMatchingSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings); - - /** ToolMatchingSettings extraToolCallBehavior. */ - public extraToolCallBehavior: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior); - - /** - * Creates a new ToolMatchingSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolMatchingSettings instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings): google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings; - - /** - * Encodes the specified ToolMatchingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. - * @param message ToolMatchingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolMatchingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. - * @param message ToolMatchingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolMatchingSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolMatchingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings; - - /** - * Decodes a ToolMatchingSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolMatchingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings; - - /** - * Verifies a ToolMatchingSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolMatchingSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolMatchingSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings; - - /** - * Creates a plain object from a ToolMatchingSettings message. Also converts values to other types if specified. - * @param message ToolMatchingSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolMatchingSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolMatchingSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ToolMatchingSettings { - - /** ExtraToolCallBehavior enum. */ - enum ExtraToolCallBehavior { - EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED = 0, - FAIL = 1, - ALLOW = 2 - } - } - - /** HallucinationMetricBehavior enum. */ - enum HallucinationMetricBehavior { - HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED = 0, - DISABLED = 1, - ENABLED = 2 - } - } - - /** Properties of an EvaluationSettings. */ - interface IEvaluationSettings { - - /** EvaluationSettings scenarioConversationInitiator */ - scenarioConversationInitiator?: (google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator|keyof typeof google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator|null); - - /** EvaluationSettings goldenRunMethod */ - goldenRunMethod?: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod|null); - - /** EvaluationSettings goldenEvaluationToolCallBehaviour */ - goldenEvaluationToolCallBehaviour?: (google.cloud.ces.v1beta.EvaluationToolCallBehaviour|keyof typeof google.cloud.ces.v1beta.EvaluationToolCallBehaviour|null); - - /** EvaluationSettings scenarioEvaluationToolCallBehaviour */ - scenarioEvaluationToolCallBehaviour?: (google.cloud.ces.v1beta.EvaluationToolCallBehaviour|keyof typeof google.cloud.ces.v1beta.EvaluationToolCallBehaviour|null); - } - - /** Represents an EvaluationSettings. */ - class EvaluationSettings implements IEvaluationSettings { - - /** - * Constructs a new EvaluationSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IEvaluationSettings); - - /** EvaluationSettings scenarioConversationInitiator. */ - public scenarioConversationInitiator: (google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator|keyof typeof google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator); - - /** EvaluationSettings goldenRunMethod. */ - public goldenRunMethod: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod); - - /** EvaluationSettings goldenEvaluationToolCallBehaviour. */ - public goldenEvaluationToolCallBehaviour: (google.cloud.ces.v1beta.EvaluationToolCallBehaviour|keyof typeof google.cloud.ces.v1beta.EvaluationToolCallBehaviour); - - /** EvaluationSettings scenarioEvaluationToolCallBehaviour. */ - public scenarioEvaluationToolCallBehaviour: (google.cloud.ces.v1beta.EvaluationToolCallBehaviour|keyof typeof google.cloud.ces.v1beta.EvaluationToolCallBehaviour); - - /** - * Creates a new EvaluationSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluationSettings instance - */ - public static create(properties?: google.cloud.ces.v1beta.IEvaluationSettings): google.cloud.ces.v1beta.EvaluationSettings; - - /** - * Encodes the specified EvaluationSettings message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationSettings.verify|verify} messages. - * @param message EvaluationSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IEvaluationSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluationSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationSettings.verify|verify} messages. - * @param message EvaluationSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluationSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluationSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationSettings; - - /** - * Decodes an EvaluationSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluationSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationSettings; - - /** - * Verifies an EvaluationSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EvaluationSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluationSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationSettings; - - /** - * Creates a plain object from an EvaluationSettings message. Also converts values to other types if specified. - * @param message EvaluationSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluationSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluationSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EvaluationSettings { - - /** ScenarioConversationInitiator enum. */ - enum ScenarioConversationInitiator { - SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED = 0, - USER = 1, - AGENT = 2 - } - } - - /** Properties of a ClientCertificateSettings. */ - interface IClientCertificateSettings { - - /** ClientCertificateSettings tlsCertificate */ - tlsCertificate?: (string|null); - - /** ClientCertificateSettings privateKey */ - privateKey?: (string|null); - - /** ClientCertificateSettings passphrase */ - passphrase?: (string|null); - } - - /** Represents a ClientCertificateSettings. */ - class ClientCertificateSettings implements IClientCertificateSettings { - - /** - * Constructs a new ClientCertificateSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IClientCertificateSettings); - - /** ClientCertificateSettings tlsCertificate. */ - public tlsCertificate: string; - - /** ClientCertificateSettings privateKey. */ - public privateKey: string; - - /** ClientCertificateSettings passphrase. */ - public passphrase: string; - - /** - * Creates a new ClientCertificateSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientCertificateSettings instance - */ - public static create(properties?: google.cloud.ces.v1beta.IClientCertificateSettings): google.cloud.ces.v1beta.ClientCertificateSettings; - - /** - * Encodes the specified ClientCertificateSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ClientCertificateSettings.verify|verify} messages. - * @param message ClientCertificateSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IClientCertificateSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientCertificateSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ClientCertificateSettings.verify|verify} messages. - * @param message ClientCertificateSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IClientCertificateSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientCertificateSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientCertificateSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ClientCertificateSettings; - - /** - * Decodes a ClientCertificateSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientCertificateSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ClientCertificateSettings; - - /** - * Verifies a ClientCertificateSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientCertificateSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientCertificateSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ClientCertificateSettings; - - /** - * Creates a plain object from a ClientCertificateSettings message. Also converts values to other types if specified. - * @param message ClientCertificateSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ClientCertificateSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientCertificateSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientCertificateSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ConversationLoggingSettings. */ - interface IConversationLoggingSettings { - - /** ConversationLoggingSettings disableConversationLogging */ - disableConversationLogging?: (boolean|null); - } - - /** Represents a ConversationLoggingSettings. */ - class ConversationLoggingSettings implements IConversationLoggingSettings { - - /** - * Constructs a new ConversationLoggingSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IConversationLoggingSettings); - - /** ConversationLoggingSettings disableConversationLogging. */ - public disableConversationLogging: boolean; - - /** - * Creates a new ConversationLoggingSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ConversationLoggingSettings instance - */ - public static create(properties?: google.cloud.ces.v1beta.IConversationLoggingSettings): google.cloud.ces.v1beta.ConversationLoggingSettings; - - /** - * Encodes the specified ConversationLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ConversationLoggingSettings.verify|verify} messages. - * @param message ConversationLoggingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IConversationLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConversationLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ConversationLoggingSettings.verify|verify} messages. - * @param message ConversationLoggingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IConversationLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConversationLoggingSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConversationLoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ConversationLoggingSettings; - - /** - * Decodes a ConversationLoggingSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConversationLoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ConversationLoggingSettings; - - /** - * Verifies a ConversationLoggingSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConversationLoggingSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConversationLoggingSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ConversationLoggingSettings; - - /** - * Creates a plain object from a ConversationLoggingSettings message. Also converts values to other types if specified. - * @param message ConversationLoggingSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ConversationLoggingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConversationLoggingSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConversationLoggingSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudLoggingSettings. */ - interface ICloudLoggingSettings { - - /** CloudLoggingSettings enableCloudLogging */ - enableCloudLogging?: (boolean|null); - } - - /** Represents a CloudLoggingSettings. */ - class CloudLoggingSettings implements ICloudLoggingSettings { - - /** - * Constructs a new CloudLoggingSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ICloudLoggingSettings); - - /** CloudLoggingSettings enableCloudLogging. */ - public enableCloudLogging: boolean; - - /** - * Creates a new CloudLoggingSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudLoggingSettings instance - */ - public static create(properties?: google.cloud.ces.v1beta.ICloudLoggingSettings): google.cloud.ces.v1beta.CloudLoggingSettings; - - /** - * Encodes the specified CloudLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.CloudLoggingSettings.verify|verify} messages. - * @param message CloudLoggingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ICloudLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CloudLoggingSettings.verify|verify} messages. - * @param message CloudLoggingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ICloudLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudLoggingSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudLoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CloudLoggingSettings; - - /** - * Decodes a CloudLoggingSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudLoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CloudLoggingSettings; - - /** - * Verifies a CloudLoggingSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudLoggingSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudLoggingSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CloudLoggingSettings; - - /** - * Creates a plain object from a CloudLoggingSettings message. Also converts values to other types if specified. - * @param message CloudLoggingSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.CloudLoggingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudLoggingSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudLoggingSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AudioRecordingConfig. */ - interface IAudioRecordingConfig { - - /** AudioRecordingConfig gcsBucket */ - gcsBucket?: (string|null); - - /** AudioRecordingConfig gcsPathPrefix */ - gcsPathPrefix?: (string|null); - } - - /** Represents an AudioRecordingConfig. */ - class AudioRecordingConfig implements IAudioRecordingConfig { - - /** - * Constructs a new AudioRecordingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IAudioRecordingConfig); - - /** AudioRecordingConfig gcsBucket. */ - public gcsBucket: string; - - /** AudioRecordingConfig gcsPathPrefix. */ - public gcsPathPrefix: string; - - /** - * Creates a new AudioRecordingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AudioRecordingConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IAudioRecordingConfig): google.cloud.ces.v1beta.AudioRecordingConfig; - - /** - * Encodes the specified AudioRecordingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.AudioRecordingConfig.verify|verify} messages. - * @param message AudioRecordingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IAudioRecordingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AudioRecordingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AudioRecordingConfig.verify|verify} messages. - * @param message AudioRecordingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IAudioRecordingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AudioRecordingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AudioRecordingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AudioRecordingConfig; - - /** - * Decodes an AudioRecordingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AudioRecordingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AudioRecordingConfig; - - /** - * Verifies an AudioRecordingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AudioRecordingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AudioRecordingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AudioRecordingConfig; - - /** - * Creates a plain object from an AudioRecordingConfig message. Also converts values to other types if specified. - * @param message AudioRecordingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.AudioRecordingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AudioRecordingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AudioRecordingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RedactionConfig. */ - interface IRedactionConfig { - - /** RedactionConfig enableRedaction */ - enableRedaction?: (boolean|null); - - /** RedactionConfig inspectTemplate */ - inspectTemplate?: (string|null); - - /** RedactionConfig deidentifyTemplate */ - deidentifyTemplate?: (string|null); - } - - /** Represents a RedactionConfig. */ - class RedactionConfig implements IRedactionConfig { - - /** - * Constructs a new RedactionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IRedactionConfig); - - /** RedactionConfig enableRedaction. */ - public enableRedaction: boolean; - - /** RedactionConfig inspectTemplate. */ - public inspectTemplate: string; - - /** RedactionConfig deidentifyTemplate. */ - public deidentifyTemplate: string; - - /** - * Creates a new RedactionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns RedactionConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IRedactionConfig): google.cloud.ces.v1beta.RedactionConfig; - - /** - * Encodes the specified RedactionConfig message. Does not implicitly {@link google.cloud.ces.v1beta.RedactionConfig.verify|verify} messages. - * @param message RedactionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IRedactionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RedactionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RedactionConfig.verify|verify} messages. - * @param message RedactionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IRedactionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RedactionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RedactionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RedactionConfig; - - /** - * Decodes a RedactionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RedactionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RedactionConfig; - - /** - * Verifies a RedactionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RedactionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RedactionConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RedactionConfig; - - /** - * Creates a plain object from a RedactionConfig message. Also converts values to other types if specified. - * @param message RedactionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.RedactionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RedactionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RedactionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DataStoreSettings. */ - interface IDataStoreSettings { - - /** DataStoreSettings engines */ - engines?: (google.cloud.ces.v1beta.DataStoreSettings.IEngine[]|null); - } - - /** Represents a DataStoreSettings. */ - class DataStoreSettings implements IDataStoreSettings { - - /** - * Constructs a new DataStoreSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDataStoreSettings); - - /** DataStoreSettings engines. */ - public engines: google.cloud.ces.v1beta.DataStoreSettings.IEngine[]; - - /** - * Creates a new DataStoreSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DataStoreSettings instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDataStoreSettings): google.cloud.ces.v1beta.DataStoreSettings; - - /** - * Encodes the specified DataStoreSettings message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.verify|verify} messages. - * @param message DataStoreSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDataStoreSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataStoreSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.verify|verify} messages. - * @param message DataStoreSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDataStoreSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataStoreSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataStoreSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreSettings; - - /** - * Decodes a DataStoreSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataStoreSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreSettings; - - /** - * Verifies a DataStoreSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataStoreSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataStoreSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreSettings; - - /** - * Creates a plain object from a DataStoreSettings message. Also converts values to other types if specified. - * @param message DataStoreSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DataStoreSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataStoreSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataStoreSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DataStoreSettings { - - /** Properties of an Engine. */ - interface IEngine { - - /** Engine name */ - name?: (string|null); - - /** Engine type */ - type?: (google.cloud.ces.v1beta.DataStoreSettings.Engine.Type|keyof typeof google.cloud.ces.v1beta.DataStoreSettings.Engine.Type|null); - } - - /** Represents an Engine. */ - class Engine implements IEngine { - - /** - * Constructs a new Engine. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.DataStoreSettings.IEngine); - - /** Engine name. */ - public name: string; - - /** Engine type. */ - public type: (google.cloud.ces.v1beta.DataStoreSettings.Engine.Type|keyof typeof google.cloud.ces.v1beta.DataStoreSettings.Engine.Type); - - /** - * Creates a new Engine instance using the specified properties. - * @param [properties] Properties to set - * @returns Engine instance - */ - public static create(properties?: google.cloud.ces.v1beta.DataStoreSettings.IEngine): google.cloud.ces.v1beta.DataStoreSettings.Engine; - - /** - * Encodes the specified Engine message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.Engine.verify|verify} messages. - * @param message Engine message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.DataStoreSettings.IEngine, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Engine message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.Engine.verify|verify} messages. - * @param message Engine message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreSettings.IEngine, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Engine message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Engine - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreSettings.Engine; - - /** - * Decodes an Engine message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Engine - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreSettings.Engine; - - /** - * Verifies an Engine message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Engine message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Engine - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreSettings.Engine; - - /** - * Creates a plain object from an Engine message. Also converts values to other types if specified. - * @param message Engine - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DataStoreSettings.Engine, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Engine to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Engine - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Engine { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - ENGINE_TYPE_SEARCH = 1, - ENGINE_TYPE_CHAT = 2 - } - } - } - - /** Properties of an EvaluationPersona. */ - interface IEvaluationPersona { - - /** EvaluationPersona name */ - name?: (string|null); - - /** EvaluationPersona description */ - description?: (string|null); - - /** EvaluationPersona displayName */ - displayName?: (string|null); - - /** EvaluationPersona personality */ - personality?: (string|null); - - /** EvaluationPersona speechConfig */ - speechConfig?: (google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig|null); - } - - /** Represents an EvaluationPersona. */ - class EvaluationPersona implements IEvaluationPersona { - - /** - * Constructs a new EvaluationPersona. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IEvaluationPersona); - - /** EvaluationPersona name. */ - public name: string; - - /** EvaluationPersona description. */ - public description: string; - - /** EvaluationPersona displayName. */ - public displayName: string; - - /** EvaluationPersona personality. */ - public personality: string; - - /** EvaluationPersona speechConfig. */ - public speechConfig?: (google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig|null); - - /** - * Creates a new EvaluationPersona instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluationPersona instance - */ - public static create(properties?: google.cloud.ces.v1beta.IEvaluationPersona): google.cloud.ces.v1beta.EvaluationPersona; - - /** - * Encodes the specified EvaluationPersona message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.verify|verify} messages. - * @param message EvaluationPersona message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IEvaluationPersona, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluationPersona message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.verify|verify} messages. - * @param message EvaluationPersona message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationPersona, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluationPersona message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluationPersona - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationPersona; - - /** - * Decodes an EvaluationPersona message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluationPersona - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationPersona; - - /** - * Verifies an EvaluationPersona message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EvaluationPersona message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluationPersona - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationPersona; - - /** - * Creates a plain object from an EvaluationPersona message. Also converts values to other types if specified. - * @param message EvaluationPersona - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationPersona, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluationPersona to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluationPersona - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EvaluationPersona { - - /** Properties of a SpeechConfig. */ - interface ISpeechConfig { - - /** SpeechConfig speakingRate */ - speakingRate?: (number|null); - - /** SpeechConfig environment */ - environment?: (google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment|keyof typeof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment|null); - - /** SpeechConfig voiceId */ - voiceId?: (string|null); - } - - /** Represents a SpeechConfig. */ - class SpeechConfig implements ISpeechConfig { - - /** - * Constructs a new SpeechConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig); - - /** SpeechConfig speakingRate. */ - public speakingRate: number; - - /** SpeechConfig environment. */ - public environment: (google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment|keyof typeof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment); - - /** SpeechConfig voiceId. */ - public voiceId: string; - - /** - * Creates a new SpeechConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SpeechConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig): google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig; - - /** - * Encodes the specified SpeechConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.verify|verify} messages. - * @param message SpeechConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SpeechConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.verify|verify} messages. - * @param message SpeechConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SpeechConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SpeechConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig; - - /** - * Decodes a SpeechConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SpeechConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig; - - /** - * Verifies a SpeechConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SpeechConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SpeechConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig; - - /** - * Creates a plain object from a SpeechConfig message. Also converts values to other types if specified. - * @param message SpeechConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SpeechConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SpeechConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SpeechConfig { - - /** BackgroundEnvironment enum. */ - enum BackgroundEnvironment { - BACKGROUND_ENVIRONMENT_UNSPECIFIED = 0, - CALL_CENTER = 3, - TRAFFIC = 4, - KIDS_NOISE = 5, - CAFE = 6 - } - } - } - - /** Properties of a BigQueryExportSettings. */ - interface IBigQueryExportSettings { - - /** BigQueryExportSettings enabled */ - enabled?: (boolean|null); - - /** BigQueryExportSettings project */ - project?: (string|null); - - /** BigQueryExportSettings dataset */ - dataset?: (string|null); - } - - /** Represents a BigQueryExportSettings. */ - class BigQueryExportSettings implements IBigQueryExportSettings { - - /** - * Constructs a new BigQueryExportSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IBigQueryExportSettings); - - /** BigQueryExportSettings enabled. */ - public enabled: boolean; - - /** BigQueryExportSettings project. */ - public project: string; - - /** BigQueryExportSettings dataset. */ - public dataset: string; - - /** - * Creates a new BigQueryExportSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns BigQueryExportSettings instance - */ - public static create(properties?: google.cloud.ces.v1beta.IBigQueryExportSettings): google.cloud.ces.v1beta.BigQueryExportSettings; - - /** - * Encodes the specified BigQueryExportSettings message. Does not implicitly {@link google.cloud.ces.v1beta.BigQueryExportSettings.verify|verify} messages. - * @param message BigQueryExportSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IBigQueryExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BigQueryExportSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BigQueryExportSettings.verify|verify} messages. - * @param message BigQueryExportSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IBigQueryExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BigQueryExportSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BigQueryExportSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BigQueryExportSettings; - - /** - * Decodes a BigQueryExportSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BigQueryExportSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BigQueryExportSettings; - - /** - * Verifies a BigQueryExportSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BigQueryExportSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BigQueryExportSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BigQueryExportSettings; - - /** - * Creates a plain object from a BigQueryExportSettings message. Also converts values to other types if specified. - * @param message BigQueryExportSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.BigQueryExportSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BigQueryExportSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BigQueryExportSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** EvaluationToolCallBehaviour enum. */ - enum EvaluationToolCallBehaviour { - EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED = 0, - REAL = 1, - FAKE = 2 - } - - /** Properties of a CodeBlock. */ - interface ICodeBlock { - - /** CodeBlock pythonCode */ - pythonCode?: (string|null); - } - - /** Represents a CodeBlock. */ - class CodeBlock implements ICodeBlock { - - /** - * Constructs a new CodeBlock. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ICodeBlock); - - /** CodeBlock pythonCode. */ - public pythonCode: string; - - /** - * Creates a new CodeBlock instance using the specified properties. - * @param [properties] Properties to set - * @returns CodeBlock instance - */ - public static create(properties?: google.cloud.ces.v1beta.ICodeBlock): google.cloud.ces.v1beta.CodeBlock; - - /** - * Encodes the specified CodeBlock message. Does not implicitly {@link google.cloud.ces.v1beta.CodeBlock.verify|verify} messages. - * @param message CodeBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ICodeBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CodeBlock message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CodeBlock.verify|verify} messages. - * @param message CodeBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ICodeBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CodeBlock message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CodeBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CodeBlock; - - /** - * Decodes a CodeBlock message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CodeBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CodeBlock; - - /** - * Verifies a CodeBlock message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CodeBlock message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CodeBlock - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CodeBlock; - - /** - * Creates a plain object from a CodeBlock message. Also converts values to other types if specified. - * @param message CodeBlock - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.CodeBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CodeBlock to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CodeBlock - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ToolFakeConfig. */ - interface IToolFakeConfig { - - /** ToolFakeConfig codeBlock */ - codeBlock?: (google.cloud.ces.v1beta.ICodeBlock|null); - - /** ToolFakeConfig enableFakeMode */ - enableFakeMode?: (boolean|null); - } - - /** Represents a ToolFakeConfig. */ - class ToolFakeConfig implements IToolFakeConfig { - - /** - * Constructs a new ToolFakeConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IToolFakeConfig); - - /** ToolFakeConfig codeBlock. */ - public codeBlock?: (google.cloud.ces.v1beta.ICodeBlock|null); - - /** ToolFakeConfig enableFakeMode. */ - public enableFakeMode: boolean; - - /** ToolFakeConfig toolResponse. */ - public toolResponse?: "codeBlock"; - - /** - * Creates a new ToolFakeConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolFakeConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IToolFakeConfig): google.cloud.ces.v1beta.ToolFakeConfig; - - /** - * Encodes the specified ToolFakeConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ToolFakeConfig.verify|verify} messages. - * @param message ToolFakeConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IToolFakeConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolFakeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolFakeConfig.verify|verify} messages. - * @param message ToolFakeConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IToolFakeConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolFakeConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolFakeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ToolFakeConfig; - - /** - * Decodes a ToolFakeConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolFakeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ToolFakeConfig; - - /** - * Verifies a ToolFakeConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolFakeConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolFakeConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ToolFakeConfig; - - /** - * Creates a plain object from a ToolFakeConfig message. Also converts values to other types if specified. - * @param message ToolFakeConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ToolFakeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolFakeConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolFakeConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** GoldenRunMethod enum. */ - enum GoldenRunMethod { - GOLDEN_RUN_METHOD_UNSPECIFIED = 0, - STABLE = 1, - NAIVE = 2 - } - - /** Properties of a Schema. */ - interface ISchema { - - /** Schema type */ - type?: (google.cloud.ces.v1beta.Schema.Type|keyof typeof google.cloud.ces.v1beta.Schema.Type|null); - - /** Schema properties */ - properties?: ({ [k: string]: google.cloud.ces.v1beta.ISchema }|null); - - /** Schema required */ - required?: (string[]|null); - - /** Schema description */ - description?: (string|null); - - /** Schema items */ - items?: (google.cloud.ces.v1beta.ISchema|null); - - /** Schema nullable */ - nullable?: (boolean|null); - - /** Schema uniqueItems */ - uniqueItems?: (boolean|null); - - /** Schema prefixItems */ - prefixItems?: (google.cloud.ces.v1beta.ISchema[]|null); - - /** Schema additionalProperties */ - additionalProperties?: (google.cloud.ces.v1beta.ISchema|null); - - /** Schema anyOf */ - anyOf?: (google.cloud.ces.v1beta.ISchema[]|null); - - /** Schema enum */ - "enum"?: (string[]|null); - - /** Schema default */ - "default"?: (google.protobuf.IValue|null); - - /** Schema ref */ - ref?: (string|null); - - /** Schema defs */ - defs?: ({ [k: string]: google.cloud.ces.v1beta.ISchema }|null); - - /** Schema title */ - title?: (string|null); - - /** Schema minItems */ - minItems?: (number|Long|string|null); - - /** Schema maxItems */ - maxItems?: (number|Long|string|null); - - /** Schema minimum */ - minimum?: (number|null); - - /** Schema maximum */ - maximum?: (number|null); - } - - /** Represents a Schema. */ - class Schema implements ISchema { - - /** - * Constructs a new Schema. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ISchema); - - /** Schema type. */ - public type: (google.cloud.ces.v1beta.Schema.Type|keyof typeof google.cloud.ces.v1beta.Schema.Type); - - /** Schema properties. */ - public properties: { [k: string]: google.cloud.ces.v1beta.ISchema }; - - /** Schema required. */ - public required: string[]; - - /** Schema description. */ - public description: string; - - /** Schema items. */ - public items?: (google.cloud.ces.v1beta.ISchema|null); - - /** Schema nullable. */ - public nullable: boolean; - - /** Schema uniqueItems. */ - public uniqueItems: boolean; - - /** Schema prefixItems. */ - public prefixItems: google.cloud.ces.v1beta.ISchema[]; - - /** Schema additionalProperties. */ - public additionalProperties?: (google.cloud.ces.v1beta.ISchema|null); - - /** Schema anyOf. */ - public anyOf: google.cloud.ces.v1beta.ISchema[]; - - /** Schema enum. */ - public enum: string[]; - - /** Schema default. */ - public default?: (google.protobuf.IValue|null); - - /** Schema ref. */ - public ref: string; - - /** Schema defs. */ - public defs: { [k: string]: google.cloud.ces.v1beta.ISchema }; - - /** Schema title. */ - public title: string; - - /** Schema minItems. */ - public minItems: (number|Long|string); - - /** Schema maxItems. */ - public maxItems: (number|Long|string); - - /** Schema minimum. */ - public minimum?: (number|null); - - /** Schema maximum. */ - public maximum?: (number|null); - - /** - * Creates a new Schema instance using the specified properties. - * @param [properties] Properties to set - * @returns Schema instance - */ - public static create(properties?: google.cloud.ces.v1beta.ISchema): google.cloud.ces.v1beta.Schema; - - /** - * Encodes the specified Schema message. Does not implicitly {@link google.cloud.ces.v1beta.Schema.verify|verify} messages. - * @param message Schema message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Schema.verify|verify} messages. - * @param message Schema message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Schema message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Schema - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Schema; - - /** - * Decodes a Schema message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Schema - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Schema; - - /** - * Verifies a Schema message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Schema message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Schema - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Schema; - - /** - * Creates a plain object from a Schema message. Also converts values to other types if specified. - * @param message Schema - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Schema, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Schema to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Schema - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Schema { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - STRING = 1, - INTEGER = 2, - NUMBER = 3, - BOOLEAN = 4, - OBJECT = 5, - ARRAY = 6 - } - } - - /** Properties of an AppSnapshot. */ - interface IAppSnapshot { - - /** AppSnapshot app */ - app?: (google.cloud.ces.v1beta.IApp|null); - - /** AppSnapshot agents */ - agents?: (google.cloud.ces.v1beta.IAgent[]|null); - - /** AppSnapshot tools */ - tools?: (google.cloud.ces.v1beta.ITool[]|null); - - /** AppSnapshot examples */ - examples?: (google.cloud.ces.v1beta.IExample[]|null); - - /** AppSnapshot guardrails */ - guardrails?: (google.cloud.ces.v1beta.IGuardrail[]|null); - - /** AppSnapshot toolsets */ - toolsets?: (google.cloud.ces.v1beta.IToolset[]|null); - } - - /** Represents an AppSnapshot. */ - class AppSnapshot implements IAppSnapshot { - - /** - * Constructs a new AppSnapshot. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IAppSnapshot); - - /** AppSnapshot app. */ - public app?: (google.cloud.ces.v1beta.IApp|null); - - /** AppSnapshot agents. */ - public agents: google.cloud.ces.v1beta.IAgent[]; - - /** AppSnapshot tools. */ - public tools: google.cloud.ces.v1beta.ITool[]; - - /** AppSnapshot examples. */ - public examples: google.cloud.ces.v1beta.IExample[]; - - /** AppSnapshot guardrails. */ - public guardrails: google.cloud.ces.v1beta.IGuardrail[]; - - /** AppSnapshot toolsets. */ - public toolsets: google.cloud.ces.v1beta.IToolset[]; - - /** - * Creates a new AppSnapshot instance using the specified properties. - * @param [properties] Properties to set - * @returns AppSnapshot instance - */ - public static create(properties?: google.cloud.ces.v1beta.IAppSnapshot): google.cloud.ces.v1beta.AppSnapshot; - - /** - * Encodes the specified AppSnapshot message. Does not implicitly {@link google.cloud.ces.v1beta.AppSnapshot.verify|verify} messages. - * @param message AppSnapshot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IAppSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AppSnapshot message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AppSnapshot.verify|verify} messages. - * @param message AppSnapshot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IAppSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AppSnapshot message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AppSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AppSnapshot; - - /** - * Decodes an AppSnapshot message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AppSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AppSnapshot; - - /** - * Verifies an AppSnapshot message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AppSnapshot message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AppSnapshot - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AppSnapshot; - - /** - * Creates a plain object from an AppSnapshot message. Also converts values to other types if specified. - * @param message AppSnapshot - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.AppSnapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AppSnapshot to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AppSnapshot - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AppVersion. */ - interface IAppVersion { - - /** AppVersion name */ - name?: (string|null); - - /** AppVersion displayName */ - displayName?: (string|null); - - /** AppVersion description */ - description?: (string|null); - - /** AppVersion creator */ - creator?: (string|null); - - /** AppVersion createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** AppVersion snapshot */ - snapshot?: (google.cloud.ces.v1beta.IAppSnapshot|null); - - /** AppVersion etag */ - etag?: (string|null); - } - - /** Represents an AppVersion. */ - class AppVersion implements IAppVersion { - - /** - * Constructs a new AppVersion. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IAppVersion); - - /** AppVersion name. */ - public name: string; - - /** AppVersion displayName. */ - public displayName: string; - - /** AppVersion description. */ - public description: string; - - /** AppVersion creator. */ - public creator: string; - - /** AppVersion createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** AppVersion snapshot. */ - public snapshot?: (google.cloud.ces.v1beta.IAppSnapshot|null); - - /** AppVersion etag. */ - public etag: string; - - /** - * Creates a new AppVersion instance using the specified properties. - * @param [properties] Properties to set - * @returns AppVersion instance - */ - public static create(properties?: google.cloud.ces.v1beta.IAppVersion): google.cloud.ces.v1beta.AppVersion; - - /** - * Encodes the specified AppVersion message. Does not implicitly {@link google.cloud.ces.v1beta.AppVersion.verify|verify} messages. - * @param message AppVersion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AppVersion message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AppVersion.verify|verify} messages. - * @param message AppVersion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AppVersion message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AppVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AppVersion; - - /** - * Decodes an AppVersion message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AppVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AppVersion; - - /** - * Verifies an AppVersion message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AppVersion message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AppVersion - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AppVersion; - - /** - * Creates a plain object from an AppVersion message. Also converts values to other types if specified. - * @param message AppVersion - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.AppVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AppVersion to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AppVersion - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Example. */ - interface IExample { - - /** Example name */ - name?: (string|null); - - /** Example displayName */ - displayName?: (string|null); - - /** Example description */ - description?: (string|null); - - /** Example entryAgent */ - entryAgent?: (string|null); - - /** Example messages */ - messages?: (google.cloud.ces.v1beta.IMessage[]|null); - - /** Example createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Example updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Example invalid */ - invalid?: (boolean|null); - - /** Example etag */ - etag?: (string|null); - } - - /** Represents an Example. */ - class Example implements IExample { - - /** - * Constructs a new Example. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IExample); - - /** Example name. */ - public name: string; - - /** Example displayName. */ - public displayName: string; - - /** Example description. */ - public description: string; - - /** Example entryAgent. */ - public entryAgent: string; - - /** Example messages. */ - public messages: google.cloud.ces.v1beta.IMessage[]; - - /** Example createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Example updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Example invalid. */ - public invalid: boolean; - - /** Example etag. */ - public etag: string; - - /** - * Creates a new Example instance using the specified properties. - * @param [properties] Properties to set - * @returns Example instance - */ - public static create(properties?: google.cloud.ces.v1beta.IExample): google.cloud.ces.v1beta.Example; - - /** - * Encodes the specified Example message. Does not implicitly {@link google.cloud.ces.v1beta.Example.verify|verify} messages. - * @param message Example message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IExample, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Example message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Example.verify|verify} messages. - * @param message Example message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IExample, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Example message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Example - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Example; - - /** - * Decodes an Example message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Example - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Example; - - /** - * Verifies an Example message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Example message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Example - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Example; - - /** - * Creates a plain object from an Example message. Also converts values to other types if specified. - * @param message Example - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Example, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Example to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Example - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Message. */ - interface IMessage { - - /** Message role */ - role?: (string|null); - - /** Message chunks */ - chunks?: (google.cloud.ces.v1beta.IChunk[]|null); - - /** Message eventTime */ - eventTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a Message. */ - class Message implements IMessage { - - /** - * Constructs a new Message. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IMessage); - - /** Message role. */ - public role: string; - - /** Message chunks. */ - public chunks: google.cloud.ces.v1beta.IChunk[]; - - /** Message eventTime. */ - public eventTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new Message instance using the specified properties. - * @param [properties] Properties to set - * @returns Message instance - */ - public static create(properties?: google.cloud.ces.v1beta.IMessage): google.cloud.ces.v1beta.Message; - - /** - * Encodes the specified Message message. Does not implicitly {@link google.cloud.ces.v1beta.Message.verify|verify} messages. - * @param message Message message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Message.verify|verify} messages. - * @param message Message message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Message message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Message; - - /** - * Decodes a Message message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Message; - - /** - * Verifies a Message message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Message - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Message; - - /** - * Creates a plain object from a Message message. Also converts values to other types if specified. - * @param message Message - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Message to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Message - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Chunk. */ - interface IChunk { - - /** Chunk text */ - text?: (string|null); - - /** Chunk transcript */ - transcript?: (string|null); - - /** Chunk blob */ - blob?: (google.cloud.ces.v1beta.IBlob|null); - - /** Chunk payload */ - payload?: (google.protobuf.IStruct|null); - - /** Chunk image */ - image?: (google.cloud.ces.v1beta.IImage|null); - - /** Chunk toolCall */ - toolCall?: (google.cloud.ces.v1beta.IToolCall|null); - - /** Chunk toolResponse */ - toolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); - - /** Chunk agentTransfer */ - agentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); - - /** Chunk updatedVariables */ - updatedVariables?: (google.protobuf.IStruct|null); - - /** Chunk defaultVariables */ - defaultVariables?: (google.protobuf.IStruct|null); - } - - /** Represents a Chunk. */ - class Chunk implements IChunk { - - /** - * Constructs a new Chunk. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IChunk); - - /** Chunk text. */ - public text?: (string|null); - - /** Chunk transcript. */ - public transcript?: (string|null); - - /** Chunk blob. */ - public blob?: (google.cloud.ces.v1beta.IBlob|null); - - /** Chunk payload. */ - public payload?: (google.protobuf.IStruct|null); - - /** Chunk image. */ - public image?: (google.cloud.ces.v1beta.IImage|null); - - /** Chunk toolCall. */ - public toolCall?: (google.cloud.ces.v1beta.IToolCall|null); - - /** Chunk toolResponse. */ - public toolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); - - /** Chunk agentTransfer. */ - public agentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); - - /** Chunk updatedVariables. */ - public updatedVariables?: (google.protobuf.IStruct|null); - - /** Chunk defaultVariables. */ - public defaultVariables?: (google.protobuf.IStruct|null); - - /** Chunk data. */ - public data?: ("text"|"transcript"|"blob"|"payload"|"image"|"toolCall"|"toolResponse"|"agentTransfer"|"updatedVariables"|"defaultVariables"); - - /** - * Creates a new Chunk instance using the specified properties. - * @param [properties] Properties to set - * @returns Chunk instance - */ - public static create(properties?: google.cloud.ces.v1beta.IChunk): google.cloud.ces.v1beta.Chunk; - - /** - * Encodes the specified Chunk message. Does not implicitly {@link google.cloud.ces.v1beta.Chunk.verify|verify} messages. - * @param message Chunk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Chunk.verify|verify} messages. - * @param message Chunk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Chunk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Chunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Chunk; - - /** - * Decodes a Chunk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Chunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Chunk; - - /** - * Verifies a Chunk message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Chunk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Chunk - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Chunk; - - /** - * Creates a plain object from a Chunk message. Also converts values to other types if specified. - * @param message Chunk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Chunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Chunk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Chunk - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Blob. */ - interface IBlob { - - /** Blob mimeType */ - mimeType?: (string|null); - - /** Blob data */ - data?: (Uint8Array|Buffer|string|null); - } - - /** Represents a Blob. */ - class Blob implements IBlob { - - /** - * Constructs a new Blob. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IBlob); - - /** Blob mimeType. */ - public mimeType: string; - - /** Blob data. */ - public data: (Uint8Array|Buffer|string); - - /** - * Creates a new Blob instance using the specified properties. - * @param [properties] Properties to set - * @returns Blob instance - */ - public static create(properties?: google.cloud.ces.v1beta.IBlob): google.cloud.ces.v1beta.Blob; - - /** - * Encodes the specified Blob message. Does not implicitly {@link google.cloud.ces.v1beta.Blob.verify|verify} messages. - * @param message Blob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IBlob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Blob.verify|verify} messages. - * @param message Blob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IBlob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Blob message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Blob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Blob; - - /** - * Decodes a Blob message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Blob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Blob; - - /** - * Verifies a Blob message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Blob message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Blob - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Blob; - - /** - * Creates a plain object from a Blob message. Also converts values to other types if specified. - * @param message Blob - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Blob, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Blob to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Blob - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Image. */ - interface IImage { - - /** Image mimeType */ - mimeType?: (string|null); - - /** Image data */ - data?: (Uint8Array|Buffer|string|null); - } - - /** Represents an Image. */ - class Image implements IImage { - - /** - * Constructs a new Image. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IImage); - - /** Image mimeType. */ - public mimeType: string; - - /** Image data. */ - public data: (Uint8Array|Buffer|string); - - /** - * Creates a new Image instance using the specified properties. - * @param [properties] Properties to set - * @returns Image instance - */ - public static create(properties?: google.cloud.ces.v1beta.IImage): google.cloud.ces.v1beta.Image; - - /** - * Encodes the specified Image message. Does not implicitly {@link google.cloud.ces.v1beta.Image.verify|verify} messages. - * @param message Image message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IImage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Image.verify|verify} messages. - * @param message Image message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IImage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Image message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Image; - - /** - * Decodes an Image message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Image; - - /** - * Verifies an Image message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Image message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Image - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Image; - - /** - * Creates a plain object from an Image message. Also converts values to other types if specified. - * @param message Image - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Image to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Image - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ToolCall. */ - interface IToolCall { - - /** ToolCall tool */ - tool?: (string|null); - - /** ToolCall toolsetTool */ - toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); - - /** ToolCall id */ - id?: (string|null); - - /** ToolCall displayName */ - displayName?: (string|null); - - /** ToolCall args */ - args?: (google.protobuf.IStruct|null); - } - - /** Represents a ToolCall. */ - class ToolCall implements IToolCall { - - /** - * Constructs a new ToolCall. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IToolCall); - - /** ToolCall tool. */ - public tool?: (string|null); - - /** ToolCall toolsetTool. */ - public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); - - /** ToolCall id. */ - public id: string; - - /** ToolCall displayName. */ - public displayName: string; - - /** ToolCall args. */ - public args?: (google.protobuf.IStruct|null); - - /** ToolCall toolIdentifier. */ - public toolIdentifier?: ("tool"|"toolsetTool"); - - /** - * Creates a new ToolCall instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolCall instance - */ - public static create(properties?: google.cloud.ces.v1beta.IToolCall): google.cloud.ces.v1beta.ToolCall; - - /** - * Encodes the specified ToolCall message. Does not implicitly {@link google.cloud.ces.v1beta.ToolCall.verify|verify} messages. - * @param message ToolCall message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IToolCall, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolCall message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolCall.verify|verify} messages. - * @param message ToolCall message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IToolCall, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolCall message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolCall - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ToolCall; - - /** - * Decodes a ToolCall message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolCall - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ToolCall; - - /** - * Verifies a ToolCall message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolCall message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolCall - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ToolCall; - - /** - * Creates a plain object from a ToolCall message. Also converts values to other types if specified. - * @param message ToolCall - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ToolCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolCall to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolCall - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ToolResponse. */ - interface IToolResponse { - - /** ToolResponse tool */ - tool?: (string|null); - - /** ToolResponse toolsetTool */ - toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); - - /** ToolResponse id */ - id?: (string|null); - - /** ToolResponse displayName */ - displayName?: (string|null); - - /** ToolResponse response */ - response?: (google.protobuf.IStruct|null); - } - - /** Represents a ToolResponse. */ - class ToolResponse implements IToolResponse { - - /** - * Constructs a new ToolResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IToolResponse); - - /** ToolResponse tool. */ - public tool?: (string|null); - - /** ToolResponse toolsetTool. */ - public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); - - /** ToolResponse id. */ - public id: string; - - /** ToolResponse displayName. */ - public displayName: string; - - /** ToolResponse response. */ - public response?: (google.protobuf.IStruct|null); - - /** ToolResponse toolIdentifier. */ - public toolIdentifier?: ("tool"|"toolsetTool"); - - /** - * Creates a new ToolResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IToolResponse): google.cloud.ces.v1beta.ToolResponse; - - /** - * Encodes the specified ToolResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponse.verify|verify} messages. - * @param message ToolResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponse.verify|verify} messages. - * @param message ToolResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ToolResponse; - - /** - * Decodes a ToolResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ToolResponse; - - /** - * Verifies a ToolResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ToolResponse; - - /** - * Creates a plain object from a ToolResponse message. Also converts values to other types if specified. - * @param message ToolResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ToolResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AgentTransfer. */ - interface IAgentTransfer { - - /** AgentTransfer targetAgent */ - targetAgent?: (string|null); - - /** AgentTransfer displayName */ - displayName?: (string|null); - } - - /** Represents an AgentTransfer. */ - class AgentTransfer implements IAgentTransfer { - - /** - * Constructs a new AgentTransfer. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IAgentTransfer); - - /** AgentTransfer targetAgent. */ - public targetAgent: string; - - /** AgentTransfer displayName. */ - public displayName: string; - - /** - * Creates a new AgentTransfer instance using the specified properties. - * @param [properties] Properties to set - * @returns AgentTransfer instance - */ - public static create(properties?: google.cloud.ces.v1beta.IAgentTransfer): google.cloud.ces.v1beta.AgentTransfer; - - /** - * Encodes the specified AgentTransfer message. Does not implicitly {@link google.cloud.ces.v1beta.AgentTransfer.verify|verify} messages. - * @param message AgentTransfer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IAgentTransfer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AgentTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AgentTransfer.verify|verify} messages. - * @param message AgentTransfer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IAgentTransfer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AgentTransfer message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AgentTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AgentTransfer; - - /** - * Decodes an AgentTransfer message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AgentTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AgentTransfer; - - /** - * Verifies an AgentTransfer message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AgentTransfer message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AgentTransfer - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AgentTransfer; - - /** - * Creates a plain object from an AgentTransfer message. Also converts values to other types if specified. - * @param message AgentTransfer - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.AgentTransfer, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AgentTransfer to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AgentTransfer - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ToolsetTool. */ - interface IToolsetTool { - - /** ToolsetTool toolset */ - toolset?: (string|null); - - /** ToolsetTool toolId */ - toolId?: (string|null); - } - - /** Represents a ToolsetTool. */ - class ToolsetTool implements IToolsetTool { - - /** - * Constructs a new ToolsetTool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IToolsetTool); - - /** ToolsetTool toolset. */ - public toolset: string; - - /** ToolsetTool toolId. */ - public toolId: string; - - /** - * Creates a new ToolsetTool instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolsetTool instance - */ - public static create(properties?: google.cloud.ces.v1beta.IToolsetTool): google.cloud.ces.v1beta.ToolsetTool; - - /** - * Encodes the specified ToolsetTool message. Does not implicitly {@link google.cloud.ces.v1beta.ToolsetTool.verify|verify} messages. - * @param message ToolsetTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IToolsetTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolsetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolsetTool.verify|verify} messages. - * @param message ToolsetTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IToolsetTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolsetTool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolsetTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ToolsetTool; - - /** - * Decodes a ToolsetTool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolsetTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ToolsetTool; - - /** - * Verifies a ToolsetTool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolsetTool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolsetTool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ToolsetTool; - - /** - * Creates a plain object from a ToolsetTool message. Also converts values to other types if specified. - * @param message ToolsetTool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ToolsetTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolsetTool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolsetTool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Guardrail. */ - interface IGuardrail { - - /** Guardrail contentFilter */ - contentFilter?: (google.cloud.ces.v1beta.Guardrail.IContentFilter|null); - - /** Guardrail llmPromptSecurity */ - llmPromptSecurity?: (google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity|null); - - /** Guardrail llmPolicy */ - llmPolicy?: (google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null); - - /** Guardrail modelSafety */ - modelSafety?: (google.cloud.ces.v1beta.Guardrail.IModelSafety|null); - - /** Guardrail codeCallback */ - codeCallback?: (google.cloud.ces.v1beta.Guardrail.ICodeCallback|null); - - /** Guardrail name */ - name?: (string|null); - - /** Guardrail displayName */ - displayName?: (string|null); - - /** Guardrail description */ - description?: (string|null); - - /** Guardrail enabled */ - enabled?: (boolean|null); - - /** Guardrail action */ - action?: (google.cloud.ces.v1beta.ITriggerAction|null); - - /** Guardrail createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Guardrail updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Guardrail etag */ - etag?: (string|null); - } - - /** Represents a Guardrail. */ - class Guardrail implements IGuardrail { - - /** - * Constructs a new Guardrail. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGuardrail); - - /** Guardrail contentFilter. */ - public contentFilter?: (google.cloud.ces.v1beta.Guardrail.IContentFilter|null); - - /** Guardrail llmPromptSecurity. */ - public llmPromptSecurity?: (google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity|null); - - /** Guardrail llmPolicy. */ - public llmPolicy?: (google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null); - - /** Guardrail modelSafety. */ - public modelSafety?: (google.cloud.ces.v1beta.Guardrail.IModelSafety|null); - - /** Guardrail codeCallback. */ - public codeCallback?: (google.cloud.ces.v1beta.Guardrail.ICodeCallback|null); - - /** Guardrail name. */ - public name: string; - - /** Guardrail displayName. */ - public displayName: string; - - /** Guardrail description. */ - public description: string; - - /** Guardrail enabled. */ - public enabled: boolean; - - /** Guardrail action. */ - public action?: (google.cloud.ces.v1beta.ITriggerAction|null); - - /** Guardrail createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Guardrail updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Guardrail etag. */ - public etag: string; - - /** Guardrail guardrailType. */ - public guardrailType?: ("contentFilter"|"llmPromptSecurity"|"llmPolicy"|"modelSafety"|"codeCallback"); - - /** - * Creates a new Guardrail instance using the specified properties. - * @param [properties] Properties to set - * @returns Guardrail instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGuardrail): google.cloud.ces.v1beta.Guardrail; - - /** - * Encodes the specified Guardrail message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.verify|verify} messages. - * @param message Guardrail message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGuardrail, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Guardrail message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.verify|verify} messages. - * @param message Guardrail message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGuardrail, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Guardrail message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Guardrail - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail; - - /** - * Decodes a Guardrail message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Guardrail - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail; - - /** - * Verifies a Guardrail message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Guardrail message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Guardrail - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail; - - /** - * Creates a plain object from a Guardrail message. Also converts values to other types if specified. - * @param message Guardrail - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Guardrail, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Guardrail to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Guardrail - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Guardrail { - - /** Properties of a ContentFilter. */ - interface IContentFilter { - - /** ContentFilter bannedContents */ - bannedContents?: (string[]|null); - - /** ContentFilter bannedContentsInUserInput */ - bannedContentsInUserInput?: (string[]|null); - - /** ContentFilter bannedContentsInAgentResponse */ - bannedContentsInAgentResponse?: (string[]|null); - - /** ContentFilter matchType */ - matchType?: (google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType|keyof typeof google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType|null); - - /** ContentFilter disregardDiacritics */ - disregardDiacritics?: (boolean|null); - } - - /** Represents a ContentFilter. */ - class ContentFilter implements IContentFilter { - - /** - * Constructs a new ContentFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Guardrail.IContentFilter); - - /** ContentFilter bannedContents. */ - public bannedContents: string[]; - - /** ContentFilter bannedContentsInUserInput. */ - public bannedContentsInUserInput: string[]; - - /** ContentFilter bannedContentsInAgentResponse. */ - public bannedContentsInAgentResponse: string[]; - - /** ContentFilter matchType. */ - public matchType: (google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType|keyof typeof google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType); - - /** ContentFilter disregardDiacritics. */ - public disregardDiacritics: boolean; - - /** - * Creates a new ContentFilter instance using the specified properties. - * @param [properties] Properties to set - * @returns ContentFilter instance - */ - public static create(properties?: google.cloud.ces.v1beta.Guardrail.IContentFilter): google.cloud.ces.v1beta.Guardrail.ContentFilter; - - /** - * Encodes the specified ContentFilter message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ContentFilter.verify|verify} messages. - * @param message ContentFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Guardrail.IContentFilter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ContentFilter.verify|verify} messages. - * @param message ContentFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.IContentFilter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ContentFilter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContentFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.ContentFilter; - - /** - * Decodes a ContentFilter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContentFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.ContentFilter; - - /** - * Verifies a ContentFilter message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContentFilter - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.ContentFilter; - - /** - * Creates a plain object from a ContentFilter message. Also converts values to other types if specified. - * @param message ContentFilter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Guardrail.ContentFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ContentFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ContentFilter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ContentFilter { - - /** MatchType enum. */ - enum MatchType { - MATCH_TYPE_UNSPECIFIED = 0, - SIMPLE_STRING_MATCH = 1, - WORD_BOUNDARY_STRING_MATCH = 2, - REGEXP_MATCH = 3 - } - } - - /** Properties of a LlmPromptSecurity. */ - interface ILlmPromptSecurity { - - /** LlmPromptSecurity defaultSettings */ - defaultSettings?: (google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null); - - /** LlmPromptSecurity customPolicy */ - customPolicy?: (google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null); - - /** LlmPromptSecurity failOpen */ - failOpen?: (boolean|null); - } - - /** Represents a LlmPromptSecurity. */ - class LlmPromptSecurity implements ILlmPromptSecurity { - - /** - * Constructs a new LlmPromptSecurity. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity); - - /** LlmPromptSecurity defaultSettings. */ - public defaultSettings?: (google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null); - - /** LlmPromptSecurity customPolicy. */ - public customPolicy?: (google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null); - - /** LlmPromptSecurity failOpen. */ - public failOpen: boolean; - - /** LlmPromptSecurity securityConfig. */ - public securityConfig?: ("defaultSettings"|"customPolicy"); - - /** - * Creates a new LlmPromptSecurity instance using the specified properties. - * @param [properties] Properties to set - * @returns LlmPromptSecurity instance - */ - public static create(properties?: google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity; - - /** - * Encodes the specified LlmPromptSecurity message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.verify|verify} messages. - * @param message LlmPromptSecurity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LlmPromptSecurity message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.verify|verify} messages. - * @param message LlmPromptSecurity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LlmPromptSecurity message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LlmPromptSecurity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity; - - /** - * Decodes a LlmPromptSecurity message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LlmPromptSecurity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity; - - /** - * Verifies a LlmPromptSecurity message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LlmPromptSecurity message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LlmPromptSecurity - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity; - - /** - * Creates a plain object from a LlmPromptSecurity message. Also converts values to other types if specified. - * @param message LlmPromptSecurity - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LlmPromptSecurity to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LlmPromptSecurity - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace LlmPromptSecurity { - - /** Properties of a DefaultSecuritySettings. */ - interface IDefaultSecuritySettings { - - /** DefaultSecuritySettings defaultPromptTemplate */ - defaultPromptTemplate?: (string|null); - } - - /** Represents a DefaultSecuritySettings. */ - class DefaultSecuritySettings implements IDefaultSecuritySettings { - - /** - * Constructs a new DefaultSecuritySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings); - - /** DefaultSecuritySettings defaultPromptTemplate. */ - public defaultPromptTemplate: string; - - /** - * Creates a new DefaultSecuritySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DefaultSecuritySettings instance - */ - public static create(properties?: google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; - - /** - * Encodes the specified DefaultSecuritySettings message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. - * @param message DefaultSecuritySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DefaultSecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. - * @param message DefaultSecuritySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DefaultSecuritySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DefaultSecuritySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; - - /** - * Decodes a DefaultSecuritySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DefaultSecuritySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; - - /** - * Verifies a DefaultSecuritySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DefaultSecuritySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DefaultSecuritySettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; - - /** - * Creates a plain object from a DefaultSecuritySettings message. Also converts values to other types if specified. - * @param message DefaultSecuritySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DefaultSecuritySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DefaultSecuritySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a LlmPolicy. */ - interface ILlmPolicy { - - /** LlmPolicy maxConversationMessages */ - maxConversationMessages?: (number|null); - - /** LlmPolicy modelSettings */ - modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); - - /** LlmPolicy prompt */ - prompt?: (string|null); - - /** LlmPolicy policyScope */ - policyScope?: (google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope|keyof typeof google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope|null); - - /** LlmPolicy failOpen */ - failOpen?: (boolean|null); - - /** LlmPolicy allowShortUtterance */ - allowShortUtterance?: (boolean|null); - } - - /** Represents a LlmPolicy. */ - class LlmPolicy implements ILlmPolicy { - - /** - * Constructs a new LlmPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Guardrail.ILlmPolicy); - - /** LlmPolicy maxConversationMessages. */ - public maxConversationMessages: number; - - /** LlmPolicy modelSettings. */ - public modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); - - /** LlmPolicy prompt. */ - public prompt: string; - - /** LlmPolicy policyScope. */ - public policyScope: (google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope|keyof typeof google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope); - - /** LlmPolicy failOpen. */ - public failOpen: boolean; - - /** LlmPolicy allowShortUtterance. */ - public allowShortUtterance: boolean; - - /** - * Creates a new LlmPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns LlmPolicy instance - */ - public static create(properties?: google.cloud.ces.v1beta.Guardrail.ILlmPolicy): google.cloud.ces.v1beta.Guardrail.LlmPolicy; - - /** - * Encodes the specified LlmPolicy message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPolicy.verify|verify} messages. - * @param message LlmPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Guardrail.ILlmPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LlmPolicy message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPolicy.verify|verify} messages. - * @param message LlmPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.ILlmPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LlmPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LlmPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.LlmPolicy; - - /** - * Decodes a LlmPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LlmPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.LlmPolicy; - - /** - * Verifies a LlmPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LlmPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LlmPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.LlmPolicy; - - /** - * Creates a plain object from a LlmPolicy message. Also converts values to other types if specified. - * @param message LlmPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Guardrail.LlmPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LlmPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LlmPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace LlmPolicy { - - /** PolicyScope enum. */ - enum PolicyScope { - POLICY_SCOPE_UNSPECIFIED = 0, - USER_QUERY = 1, - AGENT_RESPONSE = 2, - USER_QUERY_AND_AGENT_RESPONSE = 3 - } - } - - /** Properties of a ModelSafety. */ - interface IModelSafety { - - /** ModelSafety safetySettings */ - safetySettings?: (google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting[]|null); - } - - /** Represents a ModelSafety. */ - class ModelSafety implements IModelSafety { - - /** - * Constructs a new ModelSafety. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Guardrail.IModelSafety); - - /** ModelSafety safetySettings. */ - public safetySettings: google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting[]; - - /** - * Creates a new ModelSafety instance using the specified properties. - * @param [properties] Properties to set - * @returns ModelSafety instance - */ - public static create(properties?: google.cloud.ces.v1beta.Guardrail.IModelSafety): google.cloud.ces.v1beta.Guardrail.ModelSafety; - - /** - * Encodes the specified ModelSafety message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.verify|verify} messages. - * @param message ModelSafety message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Guardrail.IModelSafety, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ModelSafety message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.verify|verify} messages. - * @param message ModelSafety message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.IModelSafety, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ModelSafety message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ModelSafety - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.ModelSafety; - - /** - * Decodes a ModelSafety message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ModelSafety - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.ModelSafety; - - /** - * Verifies a ModelSafety message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ModelSafety message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ModelSafety - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.ModelSafety; - - /** - * Creates a plain object from a ModelSafety message. Also converts values to other types if specified. - * @param message ModelSafety - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Guardrail.ModelSafety, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ModelSafety to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ModelSafety - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ModelSafety { - - /** Properties of a SafetySetting. */ - interface ISafetySetting { - - /** SafetySetting category */ - category?: (google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory|keyof typeof google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory|null); - - /** SafetySetting threshold */ - threshold?: (google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold|keyof typeof google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold|null); - } - - /** Represents a SafetySetting. */ - class SafetySetting implements ISafetySetting { - - /** - * Constructs a new SafetySetting. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting); - - /** SafetySetting category. */ - public category: (google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory|keyof typeof google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory); - - /** SafetySetting threshold. */ - public threshold: (google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold|keyof typeof google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold); - - /** - * Creates a new SafetySetting instance using the specified properties. - * @param [properties] Properties to set - * @returns SafetySetting instance - */ - public static create(properties?: google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting): google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting; - - /** - * Encodes the specified SafetySetting message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. - * @param message SafetySetting message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. - * @param message SafetySetting message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SafetySetting message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SafetySetting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting; - - /** - * Decodes a SafetySetting message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SafetySetting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting; - - /** - * Verifies a SafetySetting message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SafetySetting - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting; - - /** - * Creates a plain object from a SafetySetting message. Also converts values to other types if specified. - * @param message SafetySetting - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SafetySetting to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SafetySetting - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** HarmCategory enum. */ - enum HarmCategory { - HARM_CATEGORY_UNSPECIFIED = 0, - HARM_CATEGORY_HATE_SPEECH = 1, - HARM_CATEGORY_DANGEROUS_CONTENT = 2, - HARM_CATEGORY_HARASSMENT = 3, - HARM_CATEGORY_SEXUALLY_EXPLICIT = 4 - } - - /** HarmBlockThreshold enum. */ - enum HarmBlockThreshold { - HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0, - BLOCK_LOW_AND_ABOVE = 1, - BLOCK_MEDIUM_AND_ABOVE = 2, - BLOCK_ONLY_HIGH = 3, - BLOCK_NONE = 4, - OFF = 5 - } - } - - /** Properties of a CodeCallback. */ - interface ICodeCallback { - - /** CodeCallback beforeAgentCallback */ - beforeAgentCallback?: (google.cloud.ces.v1beta.ICallback|null); - - /** CodeCallback afterAgentCallback */ - afterAgentCallback?: (google.cloud.ces.v1beta.ICallback|null); - - /** CodeCallback beforeModelCallback */ - beforeModelCallback?: (google.cloud.ces.v1beta.ICallback|null); - - /** CodeCallback afterModelCallback */ - afterModelCallback?: (google.cloud.ces.v1beta.ICallback|null); - } - - /** Represents a CodeCallback. */ - class CodeCallback implements ICodeCallback { - - /** - * Constructs a new CodeCallback. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Guardrail.ICodeCallback); - - /** CodeCallback beforeAgentCallback. */ - public beforeAgentCallback?: (google.cloud.ces.v1beta.ICallback|null); - - /** CodeCallback afterAgentCallback. */ - public afterAgentCallback?: (google.cloud.ces.v1beta.ICallback|null); - - /** CodeCallback beforeModelCallback. */ - public beforeModelCallback?: (google.cloud.ces.v1beta.ICallback|null); - - /** CodeCallback afterModelCallback. */ - public afterModelCallback?: (google.cloud.ces.v1beta.ICallback|null); - - /** - * Creates a new CodeCallback instance using the specified properties. - * @param [properties] Properties to set - * @returns CodeCallback instance - */ - public static create(properties?: google.cloud.ces.v1beta.Guardrail.ICodeCallback): google.cloud.ces.v1beta.Guardrail.CodeCallback; - - /** - * Encodes the specified CodeCallback message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.CodeCallback.verify|verify} messages. - * @param message CodeCallback message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Guardrail.ICodeCallback, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CodeCallback message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.CodeCallback.verify|verify} messages. - * @param message CodeCallback message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.ICodeCallback, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CodeCallback message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CodeCallback - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.CodeCallback; - - /** - * Decodes a CodeCallback message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CodeCallback - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.CodeCallback; - - /** - * Verifies a CodeCallback message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CodeCallback message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CodeCallback - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.CodeCallback; - - /** - * Creates a plain object from a CodeCallback message. Also converts values to other types if specified. - * @param message CodeCallback - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Guardrail.CodeCallback, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CodeCallback to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CodeCallback - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Tool. */ - interface ITool { - - /** Tool clientFunction */ - clientFunction?: (google.cloud.ces.v1beta.IClientFunction|null); - - /** Tool openApiTool */ - openApiTool?: (google.cloud.ces.v1beta.IOpenApiTool|null); - - /** Tool googleSearchTool */ - googleSearchTool?: (google.cloud.ces.v1beta.IGoogleSearchTool|null); - - /** Tool connectorTool */ - connectorTool?: (google.cloud.ces.v1beta.IConnectorTool|null); - - /** Tool dataStoreTool */ - dataStoreTool?: (google.cloud.ces.v1beta.IDataStoreTool|null); - - /** Tool pythonFunction */ - pythonFunction?: (google.cloud.ces.v1beta.IPythonFunction|null); - - /** Tool mcpTool */ - mcpTool?: (google.cloud.ces.v1beta.IMcpTool|null); - - /** Tool fileSearchTool */ - fileSearchTool?: (google.cloud.ces.v1beta.IFileSearchTool|null); - - /** Tool systemTool */ - systemTool?: (google.cloud.ces.v1beta.ISystemTool|null); - - /** Tool widgetTool */ - widgetTool?: (google.cloud.ces.v1beta.IWidgetTool|null); - - /** Tool name */ - name?: (string|null); - - /** Tool displayName */ - displayName?: (string|null); - - /** Tool executionType */ - executionType?: (google.cloud.ces.v1beta.ExecutionType|keyof typeof google.cloud.ces.v1beta.ExecutionType|null); - - /** Tool createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Tool updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Tool etag */ - etag?: (string|null); - - /** Tool generatedSummary */ - generatedSummary?: (string|null); - - /** Tool toolFakeConfig */ - toolFakeConfig?: (google.cloud.ces.v1beta.IToolFakeConfig|null); - } - - /** Represents a Tool. */ - class Tool implements ITool { - - /** - * Constructs a new Tool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ITool); - - /** Tool clientFunction. */ - public clientFunction?: (google.cloud.ces.v1beta.IClientFunction|null); - - /** Tool openApiTool. */ - public openApiTool?: (google.cloud.ces.v1beta.IOpenApiTool|null); - - /** Tool googleSearchTool. */ - public googleSearchTool?: (google.cloud.ces.v1beta.IGoogleSearchTool|null); - - /** Tool connectorTool. */ - public connectorTool?: (google.cloud.ces.v1beta.IConnectorTool|null); - - /** Tool dataStoreTool. */ - public dataStoreTool?: (google.cloud.ces.v1beta.IDataStoreTool|null); - - /** Tool pythonFunction. */ - public pythonFunction?: (google.cloud.ces.v1beta.IPythonFunction|null); - - /** Tool mcpTool. */ - public mcpTool?: (google.cloud.ces.v1beta.IMcpTool|null); - - /** Tool fileSearchTool. */ - public fileSearchTool?: (google.cloud.ces.v1beta.IFileSearchTool|null); - - /** Tool systemTool. */ - public systemTool?: (google.cloud.ces.v1beta.ISystemTool|null); - - /** Tool widgetTool. */ - public widgetTool?: (google.cloud.ces.v1beta.IWidgetTool|null); - - /** Tool name. */ - public name: string; - - /** Tool displayName. */ - public displayName: string; - - /** Tool executionType. */ - public executionType: (google.cloud.ces.v1beta.ExecutionType|keyof typeof google.cloud.ces.v1beta.ExecutionType); - - /** Tool createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Tool updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Tool etag. */ - public etag: string; - - /** Tool generatedSummary. */ - public generatedSummary: string; - - /** Tool toolFakeConfig. */ - public toolFakeConfig?: (google.cloud.ces.v1beta.IToolFakeConfig|null); - - /** Tool toolType. */ - public toolType?: ("clientFunction"|"openApiTool"|"googleSearchTool"|"connectorTool"|"dataStoreTool"|"pythonFunction"|"mcpTool"|"fileSearchTool"|"systemTool"|"widgetTool"); - - /** - * Creates a new Tool instance using the specified properties. - * @param [properties] Properties to set - * @returns Tool instance - */ - public static create(properties?: google.cloud.ces.v1beta.ITool): google.cloud.ces.v1beta.Tool; - - /** - * Encodes the specified Tool message. Does not implicitly {@link google.cloud.ces.v1beta.Tool.verify|verify} messages. - * @param message Tool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ITool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Tool.verify|verify} messages. - * @param message Tool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ITool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Tool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Tool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Tool; - - /** - * Decodes a Tool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Tool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Tool; - - /** - * Verifies a Tool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Tool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Tool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Tool; - - /** - * Creates a plain object from a Tool message. Also converts values to other types if specified. - * @param message Tool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Tool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Tool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Tool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientFunction. */ - interface IClientFunction { - - /** ClientFunction name */ - name?: (string|null); - - /** ClientFunction description */ - description?: (string|null); - - /** ClientFunction parameters */ - parameters?: (google.cloud.ces.v1beta.ISchema|null); - - /** ClientFunction response */ - response?: (google.cloud.ces.v1beta.ISchema|null); - } - - /** Represents a ClientFunction. */ - class ClientFunction implements IClientFunction { - - /** - * Constructs a new ClientFunction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IClientFunction); - - /** ClientFunction name. */ - public name: string; - - /** ClientFunction description. */ - public description: string; - - /** ClientFunction parameters. */ - public parameters?: (google.cloud.ces.v1beta.ISchema|null); - - /** ClientFunction response. */ - public response?: (google.cloud.ces.v1beta.ISchema|null); - - /** - * Creates a new ClientFunction instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientFunction instance - */ - public static create(properties?: google.cloud.ces.v1beta.IClientFunction): google.cloud.ces.v1beta.ClientFunction; - - /** - * Encodes the specified ClientFunction message. Does not implicitly {@link google.cloud.ces.v1beta.ClientFunction.verify|verify} messages. - * @param message ClientFunction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IClientFunction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ClientFunction.verify|verify} messages. - * @param message ClientFunction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IClientFunction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientFunction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientFunction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ClientFunction; - - /** - * Decodes a ClientFunction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientFunction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ClientFunction; - - /** - * Verifies a ClientFunction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientFunction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientFunction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ClientFunction; - - /** - * Creates a plain object from a ClientFunction message. Also converts values to other types if specified. - * @param message ClientFunction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ClientFunction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientFunction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientFunction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Action. */ - interface IAction { - - /** Action connectionActionId */ - connectionActionId?: (string|null); - - /** Action entityOperation */ - entityOperation?: (google.cloud.ces.v1beta.Action.IEntityOperation|null); - - /** Action inputFields */ - inputFields?: (string[]|null); - - /** Action outputFields */ - outputFields?: (string[]|null); - } - - /** Represents an Action. */ - class Action implements IAction { - - /** - * Constructs a new Action. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IAction); - - /** Action connectionActionId. */ - public connectionActionId?: (string|null); - - /** Action entityOperation. */ - public entityOperation?: (google.cloud.ces.v1beta.Action.IEntityOperation|null); - - /** Action inputFields. */ - public inputFields: string[]; - - /** Action outputFields. */ - public outputFields: string[]; - - /** Action actionSpec. */ - public actionSpec?: ("connectionActionId"|"entityOperation"); - - /** - * Creates a new Action instance using the specified properties. - * @param [properties] Properties to set - * @returns Action instance - */ - public static create(properties?: google.cloud.ces.v1beta.IAction): google.cloud.ces.v1beta.Action; - - /** - * Encodes the specified Action message. Does not implicitly {@link google.cloud.ces.v1beta.Action.verify|verify} messages. - * @param message Action message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Action.verify|verify} messages. - * @param message Action message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Action message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Action - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Action; - - /** - * Decodes an Action message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Action - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Action; - - /** - * Verifies an Action message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Action message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Action - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Action; - - /** - * Creates a plain object from an Action message. Also converts values to other types if specified. - * @param message Action - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Action, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Action to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Action - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Action { - - /** Properties of an EntityOperation. */ - interface IEntityOperation { - - /** EntityOperation entityId */ - entityId?: (string|null); - - /** EntityOperation operation */ - operation?: (google.cloud.ces.v1beta.Action.EntityOperation.OperationType|keyof typeof google.cloud.ces.v1beta.Action.EntityOperation.OperationType|null); - } - - /** Represents an EntityOperation. */ - class EntityOperation implements IEntityOperation { - - /** - * Constructs a new EntityOperation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Action.IEntityOperation); - - /** EntityOperation entityId. */ - public entityId: string; - - /** EntityOperation operation. */ - public operation: (google.cloud.ces.v1beta.Action.EntityOperation.OperationType|keyof typeof google.cloud.ces.v1beta.Action.EntityOperation.OperationType); - - /** - * Creates a new EntityOperation instance using the specified properties. - * @param [properties] Properties to set - * @returns EntityOperation instance - */ - public static create(properties?: google.cloud.ces.v1beta.Action.IEntityOperation): google.cloud.ces.v1beta.Action.EntityOperation; - - /** - * Encodes the specified EntityOperation message. Does not implicitly {@link google.cloud.ces.v1beta.Action.EntityOperation.verify|verify} messages. - * @param message EntityOperation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Action.IEntityOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EntityOperation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Action.EntityOperation.verify|verify} messages. - * @param message EntityOperation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Action.IEntityOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EntityOperation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EntityOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Action.EntityOperation; - - /** - * Decodes an EntityOperation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EntityOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Action.EntityOperation; - - /** - * Verifies an EntityOperation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EntityOperation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EntityOperation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Action.EntityOperation; - - /** - * Creates a plain object from an EntityOperation message. Also converts values to other types if specified. - * @param message EntityOperation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Action.EntityOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EntityOperation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EntityOperation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EntityOperation { - - /** OperationType enum. */ - enum OperationType { - OPERATION_TYPE_UNSPECIFIED = 0, - LIST = 1, - GET = 2, - CREATE = 3, - UPDATE = 4, - DELETE = 5 - } - } - } - - /** Properties of a ConnectorTool. */ - interface IConnectorTool { - - /** ConnectorTool connection */ - connection?: (string|null); - - /** ConnectorTool action */ - action?: (google.cloud.ces.v1beta.IAction|null); - - /** ConnectorTool authConfig */ - authConfig?: (google.cloud.ces.v1beta.IEndUserAuthConfig|null); - - /** ConnectorTool name */ - name?: (string|null); - - /** ConnectorTool description */ - description?: (string|null); - } - - /** Represents a ConnectorTool. */ - class ConnectorTool implements IConnectorTool { - - /** - * Constructs a new ConnectorTool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IConnectorTool); - - /** ConnectorTool connection. */ - public connection: string; - - /** ConnectorTool action. */ - public action?: (google.cloud.ces.v1beta.IAction|null); - - /** ConnectorTool authConfig. */ - public authConfig?: (google.cloud.ces.v1beta.IEndUserAuthConfig|null); - - /** ConnectorTool name. */ - public name: string; - - /** ConnectorTool description. */ - public description: string; - - /** - * Creates a new ConnectorTool instance using the specified properties. - * @param [properties] Properties to set - * @returns ConnectorTool instance - */ - public static create(properties?: google.cloud.ces.v1beta.IConnectorTool): google.cloud.ces.v1beta.ConnectorTool; - - /** - * Encodes the specified ConnectorTool message. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorTool.verify|verify} messages. - * @param message ConnectorTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IConnectorTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConnectorTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorTool.verify|verify} messages. - * @param message ConnectorTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IConnectorTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConnectorTool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConnectorTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ConnectorTool; - - /** - * Decodes a ConnectorTool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConnectorTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ConnectorTool; - - /** - * Verifies a ConnectorTool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConnectorTool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConnectorTool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ConnectorTool; - - /** - * Creates a plain object from a ConnectorTool message. Also converts values to other types if specified. - * @param message ConnectorTool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ConnectorTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConnectorTool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConnectorTool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ApiKeyConfig. */ - interface IApiKeyConfig { - - /** ApiKeyConfig keyName */ - keyName?: (string|null); - - /** ApiKeyConfig apiKeySecretVersion */ - apiKeySecretVersion?: (string|null); - - /** ApiKeyConfig requestLocation */ - requestLocation?: (google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation|keyof typeof google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation|null); - } - - /** Represents an ApiKeyConfig. */ - class ApiKeyConfig implements IApiKeyConfig { - - /** - * Constructs a new ApiKeyConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IApiKeyConfig); - - /** ApiKeyConfig keyName. */ - public keyName: string; - - /** ApiKeyConfig apiKeySecretVersion. */ - public apiKeySecretVersion: string; - - /** ApiKeyConfig requestLocation. */ - public requestLocation: (google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation|keyof typeof google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation); - - /** - * Creates a new ApiKeyConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ApiKeyConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IApiKeyConfig): google.cloud.ces.v1beta.ApiKeyConfig; - - /** - * Encodes the specified ApiKeyConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ApiKeyConfig.verify|verify} messages. - * @param message ApiKeyConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IApiKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ApiKeyConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ApiKeyConfig.verify|verify} messages. - * @param message ApiKeyConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IApiKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ApiKeyConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ApiKeyConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ApiKeyConfig; - - /** - * Decodes an ApiKeyConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ApiKeyConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ApiKeyConfig; - - /** - * Verifies an ApiKeyConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ApiKeyConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ApiKeyConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ApiKeyConfig; - - /** - * Creates a plain object from an ApiKeyConfig message. Also converts values to other types if specified. - * @param message ApiKeyConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ApiKeyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ApiKeyConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ApiKeyConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ApiKeyConfig { - - /** RequestLocation enum. */ - enum RequestLocation { - REQUEST_LOCATION_UNSPECIFIED = 0, - HEADER = 1, - QUERY_STRING = 2 - } - } - - /** Properties of a OAuthConfig. */ - interface IOAuthConfig { - - /** OAuthConfig oauthGrantType */ - oauthGrantType?: (google.cloud.ces.v1beta.OAuthConfig.OauthGrantType|keyof typeof google.cloud.ces.v1beta.OAuthConfig.OauthGrantType|null); - - /** OAuthConfig clientId */ - clientId?: (string|null); - - /** OAuthConfig clientSecretVersion */ - clientSecretVersion?: (string|null); - - /** OAuthConfig tokenEndpoint */ - tokenEndpoint?: (string|null); - - /** OAuthConfig scopes */ - scopes?: (string[]|null); - } - - /** Represents a OAuthConfig. */ - class OAuthConfig implements IOAuthConfig { - - /** - * Constructs a new OAuthConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IOAuthConfig); - - /** OAuthConfig oauthGrantType. */ - public oauthGrantType: (google.cloud.ces.v1beta.OAuthConfig.OauthGrantType|keyof typeof google.cloud.ces.v1beta.OAuthConfig.OauthGrantType); - - /** OAuthConfig clientId. */ - public clientId: string; - - /** OAuthConfig clientSecretVersion. */ - public clientSecretVersion: string; - - /** OAuthConfig tokenEndpoint. */ - public tokenEndpoint: string; - - /** OAuthConfig scopes. */ - public scopes: string[]; - - /** - * Creates a new OAuthConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns OAuthConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IOAuthConfig): google.cloud.ces.v1beta.OAuthConfig; - - /** - * Encodes the specified OAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OAuthConfig.verify|verify} messages. - * @param message OAuthConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IOAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OAuthConfig.verify|verify} messages. - * @param message OAuthConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IOAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a OAuthConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OAuthConfig; - - /** - * Decodes a OAuthConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OAuthConfig; - - /** - * Verifies a OAuthConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a OAuthConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OAuthConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OAuthConfig; - - /** - * Creates a plain object from a OAuthConfig message. Also converts values to other types if specified. - * @param message OAuthConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.OAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OAuthConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OAuthConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace OAuthConfig { - - /** OauthGrantType enum. */ - enum OauthGrantType { - OAUTH_GRANT_TYPE_UNSPECIFIED = 0, - CLIENT_CREDENTIAL = 1 - } - } - - /** Properties of a ServiceAgentIdTokenAuthConfig. */ - interface IServiceAgentIdTokenAuthConfig { - } - - /** Represents a ServiceAgentIdTokenAuthConfig. */ - class ServiceAgentIdTokenAuthConfig implements IServiceAgentIdTokenAuthConfig { - - /** - * Constructs a new ServiceAgentIdTokenAuthConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig); - - /** - * Creates a new ServiceAgentIdTokenAuthConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceAgentIdTokenAuthConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig): google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig; - - /** - * Encodes the specified ServiceAgentIdTokenAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.verify|verify} messages. - * @param message ServiceAgentIdTokenAuthConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceAgentIdTokenAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.verify|verify} messages. - * @param message ServiceAgentIdTokenAuthConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceAgentIdTokenAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig; - - /** - * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceAgentIdTokenAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig; - - /** - * Verifies a ServiceAgentIdTokenAuthConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceAgentIdTokenAuthConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceAgentIdTokenAuthConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig; - - /** - * Creates a plain object from a ServiceAgentIdTokenAuthConfig message. Also converts values to other types if specified. - * @param message ServiceAgentIdTokenAuthConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceAgentIdTokenAuthConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceAgentIdTokenAuthConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceAccountAuthConfig. */ - interface IServiceAccountAuthConfig { - - /** ServiceAccountAuthConfig serviceAccount */ - serviceAccount?: (string|null); - - /** ServiceAccountAuthConfig scopes */ - scopes?: (string[]|null); - } - - /** Represents a ServiceAccountAuthConfig. */ - class ServiceAccountAuthConfig implements IServiceAccountAuthConfig { - - /** - * Constructs a new ServiceAccountAuthConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IServiceAccountAuthConfig); - - /** ServiceAccountAuthConfig serviceAccount. */ - public serviceAccount: string; - - /** ServiceAccountAuthConfig scopes. */ - public scopes: string[]; - - /** - * Creates a new ServiceAccountAuthConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceAccountAuthConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IServiceAccountAuthConfig): google.cloud.ces.v1beta.ServiceAccountAuthConfig; - - /** - * Encodes the specified ServiceAccountAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAccountAuthConfig.verify|verify} messages. - * @param message ServiceAccountAuthConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IServiceAccountAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceAccountAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAccountAuthConfig.verify|verify} messages. - * @param message ServiceAccountAuthConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IServiceAccountAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceAccountAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ServiceAccountAuthConfig; - - /** - * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceAccountAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ServiceAccountAuthConfig; - - /** - * Verifies a ServiceAccountAuthConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceAccountAuthConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceAccountAuthConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ServiceAccountAuthConfig; - - /** - * Creates a plain object from a ServiceAccountAuthConfig message. Also converts values to other types if specified. - * @param message ServiceAccountAuthConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ServiceAccountAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceAccountAuthConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceAccountAuthConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BearerTokenConfig. */ - interface IBearerTokenConfig { - - /** BearerTokenConfig token */ - token?: (string|null); - } - - /** Represents a BearerTokenConfig. */ - class BearerTokenConfig implements IBearerTokenConfig { - - /** - * Constructs a new BearerTokenConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IBearerTokenConfig); - - /** BearerTokenConfig token. */ - public token: string; - - /** - * Creates a new BearerTokenConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns BearerTokenConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IBearerTokenConfig): google.cloud.ces.v1beta.BearerTokenConfig; - - /** - * Encodes the specified BearerTokenConfig message. Does not implicitly {@link google.cloud.ces.v1beta.BearerTokenConfig.verify|verify} messages. - * @param message BearerTokenConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IBearerTokenConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BearerTokenConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BearerTokenConfig.verify|verify} messages. - * @param message BearerTokenConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IBearerTokenConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BearerTokenConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BearerTokenConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BearerTokenConfig; - - /** - * Decodes a BearerTokenConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BearerTokenConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BearerTokenConfig; - - /** - * Verifies a BearerTokenConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BearerTokenConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BearerTokenConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BearerTokenConfig; - - /** - * Creates a plain object from a BearerTokenConfig message. Also converts values to other types if specified. - * @param message BearerTokenConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.BearerTokenConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BearerTokenConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BearerTokenConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EndUserAuthConfig. */ - interface IEndUserAuthConfig { - - /** EndUserAuthConfig oauth2AuthCodeConfig */ - oauth2AuthCodeConfig?: (google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig|null); - - /** EndUserAuthConfig oauth2JwtBearerConfig */ - oauth2JwtBearerConfig?: (google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig|null); - } - - /** Represents an EndUserAuthConfig. */ - class EndUserAuthConfig implements IEndUserAuthConfig { - - /** - * Constructs a new EndUserAuthConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IEndUserAuthConfig); - - /** EndUserAuthConfig oauth2AuthCodeConfig. */ - public oauth2AuthCodeConfig?: (google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig|null); - - /** EndUserAuthConfig oauth2JwtBearerConfig. */ - public oauth2JwtBearerConfig?: (google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig|null); - - /** EndUserAuthConfig authConfig. */ - public authConfig?: ("oauth2AuthCodeConfig"|"oauth2JwtBearerConfig"); - - /** - * Creates a new EndUserAuthConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns EndUserAuthConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IEndUserAuthConfig): google.cloud.ces.v1beta.EndUserAuthConfig; - - /** - * Encodes the specified EndUserAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.verify|verify} messages. - * @param message EndUserAuthConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IEndUserAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EndUserAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.verify|verify} messages. - * @param message EndUserAuthConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IEndUserAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EndUserAuthConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EndUserAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EndUserAuthConfig; - - /** - * Decodes an EndUserAuthConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EndUserAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EndUserAuthConfig; - - /** - * Verifies an EndUserAuthConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EndUserAuthConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EndUserAuthConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EndUserAuthConfig; - - /** - * Creates a plain object from an EndUserAuthConfig message. Also converts values to other types if specified. - * @param message EndUserAuthConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EndUserAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EndUserAuthConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EndUserAuthConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EndUserAuthConfig { - - /** Properties of an Oauth2AuthCodeConfig. */ - interface IOauth2AuthCodeConfig { - - /** Oauth2AuthCodeConfig oauthToken */ - oauthToken?: (string|null); - } - - /** Represents an Oauth2AuthCodeConfig. */ - class Oauth2AuthCodeConfig implements IOauth2AuthCodeConfig { - - /** - * Constructs a new Oauth2AuthCodeConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig); - - /** Oauth2AuthCodeConfig oauthToken. */ - public oauthToken: string; - - /** - * Creates a new Oauth2AuthCodeConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns Oauth2AuthCodeConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig; - - /** - * Encodes the specified Oauth2AuthCodeConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. - * @param message Oauth2AuthCodeConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Oauth2AuthCodeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. - * @param message Oauth2AuthCodeConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Oauth2AuthCodeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig; - - /** - * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Oauth2AuthCodeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig; - - /** - * Verifies an Oauth2AuthCodeConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Oauth2AuthCodeConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Oauth2AuthCodeConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig; - - /** - * Creates a plain object from an Oauth2AuthCodeConfig message. Also converts values to other types if specified. - * @param message Oauth2AuthCodeConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Oauth2AuthCodeConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Oauth2AuthCodeConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Oauth2JwtBearerConfig. */ - interface IOauth2JwtBearerConfig { - - /** Oauth2JwtBearerConfig issuer */ - issuer?: (string|null); - - /** Oauth2JwtBearerConfig subject */ - subject?: (string|null); - - /** Oauth2JwtBearerConfig clientKey */ - clientKey?: (string|null); - } - - /** Represents an Oauth2JwtBearerConfig. */ - class Oauth2JwtBearerConfig implements IOauth2JwtBearerConfig { - - /** - * Constructs a new Oauth2JwtBearerConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig); - - /** Oauth2JwtBearerConfig issuer. */ - public issuer: string; - - /** Oauth2JwtBearerConfig subject. */ - public subject: string; - - /** Oauth2JwtBearerConfig clientKey. */ - public clientKey: string; - - /** - * Creates a new Oauth2JwtBearerConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns Oauth2JwtBearerConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig; - - /** - * Encodes the specified Oauth2JwtBearerConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. - * @param message Oauth2JwtBearerConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Oauth2JwtBearerConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. - * @param message Oauth2JwtBearerConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Oauth2JwtBearerConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig; - - /** - * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Oauth2JwtBearerConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig; - - /** - * Verifies an Oauth2JwtBearerConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Oauth2JwtBearerConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Oauth2JwtBearerConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig; - - /** - * Creates a plain object from an Oauth2JwtBearerConfig message. Also converts values to other types if specified. - * @param message Oauth2JwtBearerConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Oauth2JwtBearerConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Oauth2JwtBearerConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ApiAuthentication. */ - interface IApiAuthentication { - - /** ApiAuthentication apiKeyConfig */ - apiKeyConfig?: (google.cloud.ces.v1beta.IApiKeyConfig|null); - - /** ApiAuthentication oauthConfig */ - oauthConfig?: (google.cloud.ces.v1beta.IOAuthConfig|null); - - /** ApiAuthentication serviceAgentIdTokenAuthConfig */ - serviceAgentIdTokenAuthConfig?: (google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig|null); - - /** ApiAuthentication serviceAccountAuthConfig */ - serviceAccountAuthConfig?: (google.cloud.ces.v1beta.IServiceAccountAuthConfig|null); - - /** ApiAuthentication bearerTokenConfig */ - bearerTokenConfig?: (google.cloud.ces.v1beta.IBearerTokenConfig|null); - } - - /** Represents an ApiAuthentication. */ - class ApiAuthentication implements IApiAuthentication { - - /** - * Constructs a new ApiAuthentication. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IApiAuthentication); - - /** ApiAuthentication apiKeyConfig. */ - public apiKeyConfig?: (google.cloud.ces.v1beta.IApiKeyConfig|null); - - /** ApiAuthentication oauthConfig. */ - public oauthConfig?: (google.cloud.ces.v1beta.IOAuthConfig|null); - - /** ApiAuthentication serviceAgentIdTokenAuthConfig. */ - public serviceAgentIdTokenAuthConfig?: (google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig|null); - - /** ApiAuthentication serviceAccountAuthConfig. */ - public serviceAccountAuthConfig?: (google.cloud.ces.v1beta.IServiceAccountAuthConfig|null); - - /** ApiAuthentication bearerTokenConfig. */ - public bearerTokenConfig?: (google.cloud.ces.v1beta.IBearerTokenConfig|null); - - /** ApiAuthentication authConfig. */ - public authConfig?: ("apiKeyConfig"|"oauthConfig"|"serviceAgentIdTokenAuthConfig"|"serviceAccountAuthConfig"|"bearerTokenConfig"); - - /** - * Creates a new ApiAuthentication instance using the specified properties. - * @param [properties] Properties to set - * @returns ApiAuthentication instance - */ - public static create(properties?: google.cloud.ces.v1beta.IApiAuthentication): google.cloud.ces.v1beta.ApiAuthentication; - - /** - * Encodes the specified ApiAuthentication message. Does not implicitly {@link google.cloud.ces.v1beta.ApiAuthentication.verify|verify} messages. - * @param message ApiAuthentication message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IApiAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ApiAuthentication message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ApiAuthentication.verify|verify} messages. - * @param message ApiAuthentication message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IApiAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ApiAuthentication message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ApiAuthentication - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ApiAuthentication; - - /** - * Decodes an ApiAuthentication message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ApiAuthentication - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ApiAuthentication; - - /** - * Verifies an ApiAuthentication message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ApiAuthentication message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ApiAuthentication - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ApiAuthentication; - - /** - * Creates a plain object from an ApiAuthentication message. Also converts values to other types if specified. - * @param message ApiAuthentication - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ApiAuthentication, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ApiAuthentication to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ApiAuthentication - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DataStoreTool. */ - interface IDataStoreTool { - - /** DataStoreTool dataStoreSource */ - dataStoreSource?: (google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource|null); - - /** DataStoreTool engineSource */ - engineSource?: (google.cloud.ces.v1beta.DataStoreTool.IEngineSource|null); - - /** DataStoreTool name */ - name?: (string|null); - - /** DataStoreTool description */ - description?: (string|null); - - /** DataStoreTool boostSpecs */ - boostSpecs?: (google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs[]|null); - - /** DataStoreTool modalityConfigs */ - modalityConfigs?: (google.cloud.ces.v1beta.DataStoreTool.IModalityConfig[]|null); - - /** DataStoreTool filterParameterBehavior */ - filterParameterBehavior?: (google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior|keyof typeof google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior|null); - } - - /** Represents a DataStoreTool. */ - class DataStoreTool implements IDataStoreTool { - - /** - * Constructs a new DataStoreTool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDataStoreTool); - - /** DataStoreTool dataStoreSource. */ - public dataStoreSource?: (google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource|null); - - /** DataStoreTool engineSource. */ - public engineSource?: (google.cloud.ces.v1beta.DataStoreTool.IEngineSource|null); - - /** DataStoreTool name. */ - public name: string; - - /** DataStoreTool description. */ - public description: string; - - /** DataStoreTool boostSpecs. */ - public boostSpecs: google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs[]; - - /** DataStoreTool modalityConfigs. */ - public modalityConfigs: google.cloud.ces.v1beta.DataStoreTool.IModalityConfig[]; - - /** DataStoreTool filterParameterBehavior. */ - public filterParameterBehavior: (google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior|keyof typeof google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior); - - /** DataStoreTool searchSource. */ - public searchSource?: ("dataStoreSource"|"engineSource"); - - /** - * Creates a new DataStoreTool instance using the specified properties. - * @param [properties] Properties to set - * @returns DataStoreTool instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDataStoreTool): google.cloud.ces.v1beta.DataStoreTool; - - /** - * Encodes the specified DataStoreTool message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.verify|verify} messages. - * @param message DataStoreTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDataStoreTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataStoreTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.verify|verify} messages. - * @param message DataStoreTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDataStoreTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataStoreTool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataStoreTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool; - - /** - * Decodes a DataStoreTool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataStoreTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool; - - /** - * Verifies a DataStoreTool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataStoreTool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataStoreTool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool; - - /** - * Creates a plain object from a DataStoreTool message. Also converts values to other types if specified. - * @param message DataStoreTool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DataStoreTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataStoreTool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataStoreTool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DataStoreTool { - - /** Properties of a RewriterConfig. */ - interface IRewriterConfig { - - /** RewriterConfig modelSettings */ - modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); - - /** RewriterConfig prompt */ - prompt?: (string|null); - - /** RewriterConfig disabled */ - disabled?: (boolean|null); - } - - /** Represents a RewriterConfig. */ - class RewriterConfig implements IRewriterConfig { - - /** - * Constructs a new RewriterConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig); - - /** RewriterConfig modelSettings. */ - public modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); - - /** RewriterConfig prompt. */ - public prompt: string; - - /** RewriterConfig disabled. */ - public disabled: boolean; - - /** - * Creates a new RewriterConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns RewriterConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig): google.cloud.ces.v1beta.DataStoreTool.RewriterConfig; - - /** - * Encodes the specified RewriterConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.verify|verify} messages. - * @param message RewriterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RewriterConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.verify|verify} messages. - * @param message RewriterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RewriterConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RewriterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.RewriterConfig; - - /** - * Decodes a RewriterConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RewriterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.RewriterConfig; - - /** - * Verifies a RewriterConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RewriterConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RewriterConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.RewriterConfig; - - /** - * Creates a plain object from a RewriterConfig message. Also converts values to other types if specified. - * @param message RewriterConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.RewriterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RewriterConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RewriterConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SummarizationConfig. */ - interface ISummarizationConfig { - - /** SummarizationConfig modelSettings */ - modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); - - /** SummarizationConfig prompt */ - prompt?: (string|null); - - /** SummarizationConfig disabled */ - disabled?: (boolean|null); - } - - /** Represents a SummarizationConfig. */ - class SummarizationConfig implements ISummarizationConfig { - - /** - * Constructs a new SummarizationConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig); - - /** SummarizationConfig modelSettings. */ - public modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); - - /** SummarizationConfig prompt. */ - public prompt: string; - - /** SummarizationConfig disabled. */ - public disabled: boolean; - - /** - * Creates a new SummarizationConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SummarizationConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig): google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig; - - /** - * Encodes the specified SummarizationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.verify|verify} messages. - * @param message SummarizationConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SummarizationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.verify|verify} messages. - * @param message SummarizationConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SummarizationConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SummarizationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig; - - /** - * Decodes a SummarizationConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SummarizationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig; - - /** - * Verifies a SummarizationConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SummarizationConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SummarizationConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig; - - /** - * Creates a plain object from a SummarizationConfig message. Also converts values to other types if specified. - * @param message SummarizationConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SummarizationConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SummarizationConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GroundingConfig. */ - interface IGroundingConfig { - - /** GroundingConfig groundingLevel */ - groundingLevel?: (number|null); - - /** GroundingConfig disabled */ - disabled?: (boolean|null); - } - - /** Represents a GroundingConfig. */ - class GroundingConfig implements IGroundingConfig { - - /** - * Constructs a new GroundingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig); - - /** GroundingConfig groundingLevel. */ - public groundingLevel: number; - - /** GroundingConfig disabled. */ - public disabled: boolean; - - /** - * Creates a new GroundingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns GroundingConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig): google.cloud.ces.v1beta.DataStoreTool.GroundingConfig; - - /** - * Encodes the specified GroundingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.verify|verify} messages. - * @param message GroundingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GroundingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.verify|verify} messages. - * @param message GroundingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GroundingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GroundingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.GroundingConfig; - - /** - * Decodes a GroundingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GroundingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.GroundingConfig; - - /** - * Verifies a GroundingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GroundingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GroundingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.GroundingConfig; - - /** - * Creates a plain object from a GroundingConfig message. Also converts values to other types if specified. - * @param message GroundingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.GroundingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GroundingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GroundingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DataStoreSource. */ - interface IDataStoreSource { - - /** DataStoreSource filter */ - filter?: (string|null); - - /** DataStoreSource dataStore */ - dataStore?: (google.cloud.ces.v1beta.IDataStore|null); - } - - /** Represents a DataStoreSource. */ - class DataStoreSource implements IDataStoreSource { - - /** - * Constructs a new DataStoreSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource); - - /** DataStoreSource filter. */ - public filter: string; - - /** DataStoreSource dataStore. */ - public dataStore?: (google.cloud.ces.v1beta.IDataStore|null); - - /** - * Creates a new DataStoreSource instance using the specified properties. - * @param [properties] Properties to set - * @returns DataStoreSource instance - */ - public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource): google.cloud.ces.v1beta.DataStoreTool.DataStoreSource; - - /** - * Encodes the specified DataStoreSource message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.verify|verify} messages. - * @param message DataStoreSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataStoreSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.verify|verify} messages. - * @param message DataStoreSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataStoreSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataStoreSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.DataStoreSource; - - /** - * Decodes a DataStoreSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataStoreSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.DataStoreSource; - - /** - * Verifies a DataStoreSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataStoreSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataStoreSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.DataStoreSource; - - /** - * Creates a plain object from a DataStoreSource message. Also converts values to other types if specified. - * @param message DataStoreSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.DataStoreSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataStoreSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataStoreSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EngineSource. */ - interface IEngineSource { - - /** EngineSource engine */ - engine?: (string|null); - - /** EngineSource dataStoreSources */ - dataStoreSources?: (google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource[]|null); - - /** EngineSource filter */ - filter?: (string|null); - } - - /** Represents an EngineSource. */ - class EngineSource implements IEngineSource { - - /** - * Constructs a new EngineSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IEngineSource); - - /** EngineSource engine. */ - public engine: string; - - /** EngineSource dataStoreSources. */ - public dataStoreSources: google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource[]; - - /** EngineSource filter. */ - public filter: string; - - /** - * Creates a new EngineSource instance using the specified properties. - * @param [properties] Properties to set - * @returns EngineSource instance - */ - public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IEngineSource): google.cloud.ces.v1beta.DataStoreTool.EngineSource; - - /** - * Encodes the specified EngineSource message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.EngineSource.verify|verify} messages. - * @param message EngineSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IEngineSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EngineSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.EngineSource.verify|verify} messages. - * @param message EngineSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IEngineSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EngineSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EngineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.EngineSource; - - /** - * Decodes an EngineSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EngineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.EngineSource; - - /** - * Verifies an EngineSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EngineSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EngineSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.EngineSource; - - /** - * Creates a plain object from an EngineSource message. Also converts values to other types if specified. - * @param message EngineSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.EngineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EngineSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EngineSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BoostSpecs. */ - interface IBoostSpecs { - - /** BoostSpecs dataStores */ - dataStores?: (string[]|null); - - /** BoostSpecs spec */ - spec?: (google.cloud.ces.v1beta.DataStoreTool.IBoostSpec[]|null); - } - - /** Represents a BoostSpecs. */ - class BoostSpecs implements IBoostSpecs { - - /** - * Constructs a new BoostSpecs. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs); - - /** BoostSpecs dataStores. */ - public dataStores: string[]; - - /** BoostSpecs spec. */ - public spec: google.cloud.ces.v1beta.DataStoreTool.IBoostSpec[]; - - /** - * Creates a new BoostSpecs instance using the specified properties. - * @param [properties] Properties to set - * @returns BoostSpecs instance - */ - public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs): google.cloud.ces.v1beta.DataStoreTool.BoostSpecs; - - /** - * Encodes the specified BoostSpecs message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.verify|verify} messages. - * @param message BoostSpecs message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BoostSpecs message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.verify|verify} messages. - * @param message BoostSpecs message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BoostSpecs message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoostSpecs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.BoostSpecs; - - /** - * Decodes a BoostSpecs message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoostSpecs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.BoostSpecs; - - /** - * Verifies a BoostSpecs message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BoostSpecs message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoostSpecs - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.BoostSpecs; - - /** - * Creates a plain object from a BoostSpecs message. Also converts values to other types if specified. - * @param message BoostSpecs - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpecs, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoostSpecs to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BoostSpecs - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BoostSpec. */ - interface IBoostSpec { - - /** BoostSpec conditionBoostSpecs */ - conditionBoostSpecs?: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec[]|null); - } - - /** Represents a BoostSpec. */ - class BoostSpec implements IBoostSpec { - - /** - * Constructs a new BoostSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IBoostSpec); - - /** BoostSpec conditionBoostSpecs. */ - public conditionBoostSpecs: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec[]; - - /** - * Creates a new BoostSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns BoostSpec instance - */ - public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IBoostSpec): google.cloud.ces.v1beta.DataStoreTool.BoostSpec; - - /** - * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.verify|verify} messages. - * @param message BoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.verify|verify} messages. - * @param message BoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BoostSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.BoostSpec; - - /** - * Decodes a BoostSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.BoostSpec; - - /** - * Verifies a BoostSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoostSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.BoostSpec; - - /** - * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. - * @param message BoostSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoostSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BoostSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BoostSpec { - - /** Properties of a ConditionBoostSpec. */ - interface IConditionBoostSpec { - - /** ConditionBoostSpec condition */ - condition?: (string|null); - - /** ConditionBoostSpec boost */ - boost?: (number|null); - - /** ConditionBoostSpec boostControlSpec */ - boostControlSpec?: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null); - } - - /** Represents a ConditionBoostSpec. */ - class ConditionBoostSpec implements IConditionBoostSpec { - - /** - * Constructs a new ConditionBoostSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec); - - /** ConditionBoostSpec condition. */ - public condition: string; - - /** ConditionBoostSpec boost. */ - public boost: number; - - /** ConditionBoostSpec boostControlSpec. */ - public boostControlSpec?: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null); - - /** - * Creates a new ConditionBoostSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns ConditionBoostSpec instance - */ - public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec; - - /** - * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @param message ConditionBoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @param message ConditionBoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConditionBoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec; - - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConditionBoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec; - - /** - * Verifies a ConditionBoostSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConditionBoostSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec; - - /** - * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. - * @param message ConditionBoostSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConditionBoostSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConditionBoostSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ConditionBoostSpec { - - /** Properties of a BoostControlSpec. */ - interface IBoostControlSpec { - - /** BoostControlSpec fieldName */ - fieldName?: (string|null); - - /** BoostControlSpec attributeType */ - attributeType?: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|keyof typeof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|null); - - /** BoostControlSpec interpolationType */ - interpolationType?: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|keyof typeof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|null); - - /** BoostControlSpec controlPoints */ - controlPoints?: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint[]|null); - } - - /** Represents a BoostControlSpec. */ - class BoostControlSpec implements IBoostControlSpec { - - /** - * Constructs a new BoostControlSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec); - - /** BoostControlSpec fieldName. */ - public fieldName: string; - - /** BoostControlSpec attributeType. */ - public attributeType: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|keyof typeof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType); - - /** BoostControlSpec interpolationType. */ - public interpolationType: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|keyof typeof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType); - - /** BoostControlSpec controlPoints. */ - public controlPoints: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint[]; - - /** - * Creates a new BoostControlSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns BoostControlSpec instance - */ - public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; - - /** - * Encodes the specified BoostControlSpec message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. - * @param message BoostControlSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BoostControlSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. - * @param message BoostControlSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BoostControlSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoostControlSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; - - /** - * Decodes a BoostControlSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoostControlSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; - - /** - * Verifies a BoostControlSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BoostControlSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoostControlSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; - - /** - * Creates a plain object from a BoostControlSpec message. Also converts values to other types if specified. - * @param message BoostControlSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoostControlSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BoostControlSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BoostControlSpec { - - /** Properties of a ControlPoint. */ - interface IControlPoint { - - /** ControlPoint attributeValue */ - attributeValue?: (string|null); - - /** ControlPoint boostAmount */ - boostAmount?: (number|null); - } - - /** Represents a ControlPoint. */ - class ControlPoint implements IControlPoint { - - /** - * Constructs a new ControlPoint. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint); - - /** ControlPoint attributeValue. */ - public attributeValue: string; - - /** ControlPoint boostAmount. */ - public boostAmount: number; - - /** - * Creates a new ControlPoint instance using the specified properties. - * @param [properties] Properties to set - * @returns ControlPoint instance - */ - public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; - - /** - * Encodes the specified ControlPoint message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. - * @param message ControlPoint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ControlPoint message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. - * @param message ControlPoint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ControlPoint message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ControlPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; - - /** - * Decodes a ControlPoint message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ControlPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; - - /** - * Verifies a ControlPoint message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ControlPoint message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ControlPoint - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; - - /** - * Creates a plain object from a ControlPoint message. Also converts values to other types if specified. - * @param message ControlPoint - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ControlPoint to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ControlPoint - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** AttributeType enum. */ - enum AttributeType { - ATTRIBUTE_TYPE_UNSPECIFIED = 0, - NUMERICAL = 1, - FRESHNESS = 2 - } - - /** InterpolationType enum. */ - enum InterpolationType { - INTERPOLATION_TYPE_UNSPECIFIED = 0, - LINEAR = 1 - } - } - } - } - - /** Properties of a ModalityConfig. */ - interface IModalityConfig { - - /** ModalityConfig modalityType */ - modalityType?: (google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType|keyof typeof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType|null); - - /** ModalityConfig rewriterConfig */ - rewriterConfig?: (google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig|null); - - /** ModalityConfig summarizationConfig */ - summarizationConfig?: (google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig|null); - - /** ModalityConfig groundingConfig */ - groundingConfig?: (google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig|null); - } - - /** Represents a ModalityConfig. */ - class ModalityConfig implements IModalityConfig { - - /** - * Constructs a new ModalityConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IModalityConfig); - - /** ModalityConfig modalityType. */ - public modalityType: (google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType|keyof typeof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType); - - /** ModalityConfig rewriterConfig. */ - public rewriterConfig?: (google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig|null); - - /** ModalityConfig summarizationConfig. */ - public summarizationConfig?: (google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig|null); - - /** ModalityConfig groundingConfig. */ - public groundingConfig?: (google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig|null); - - /** - * Creates a new ModalityConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ModalityConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IModalityConfig): google.cloud.ces.v1beta.DataStoreTool.ModalityConfig; - - /** - * Encodes the specified ModalityConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.verify|verify} messages. - * @param message ModalityConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IModalityConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ModalityConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.verify|verify} messages. - * @param message ModalityConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IModalityConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ModalityConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ModalityConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.ModalityConfig; - - /** - * Decodes a ModalityConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ModalityConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.ModalityConfig; - - /** - * Verifies a ModalityConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ModalityConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ModalityConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.ModalityConfig; - - /** - * Creates a plain object from a ModalityConfig message. Also converts values to other types if specified. - * @param message ModalityConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.ModalityConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ModalityConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ModalityConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ModalityConfig { - - /** ModalityType enum. */ - enum ModalityType { - MODALITY_TYPE_UNSPECIFIED = 0, - TEXT = 1, - AUDIO = 2 - } - } - - /** FilterParameterBehavior enum. */ - enum FilterParameterBehavior { - FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED = 0, - ALWAYS_INCLUDE = 2, - NEVER_INCLUDE = 3 - } - } - - /** Properties of a DataStore. */ - interface IDataStore { - - /** DataStore name */ - name?: (string|null); - - /** DataStore type */ - type?: (google.cloud.ces.v1beta.DataStore.DataStoreType|keyof typeof google.cloud.ces.v1beta.DataStore.DataStoreType|null); - - /** DataStore documentProcessingMode */ - documentProcessingMode?: (google.cloud.ces.v1beta.DataStore.DocumentProcessingMode|keyof typeof google.cloud.ces.v1beta.DataStore.DocumentProcessingMode|null); - - /** DataStore displayName */ - displayName?: (string|null); - - /** DataStore createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** DataStore connectorConfig */ - connectorConfig?: (google.cloud.ces.v1beta.DataStore.IConnectorConfig|null); - } - - /** Represents a DataStore. */ - class DataStore implements IDataStore { - - /** - * Constructs a new DataStore. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDataStore); - - /** DataStore name. */ - public name: string; - - /** DataStore type. */ - public type: (google.cloud.ces.v1beta.DataStore.DataStoreType|keyof typeof google.cloud.ces.v1beta.DataStore.DataStoreType); - - /** DataStore documentProcessingMode. */ - public documentProcessingMode: (google.cloud.ces.v1beta.DataStore.DocumentProcessingMode|keyof typeof google.cloud.ces.v1beta.DataStore.DocumentProcessingMode); - - /** DataStore displayName. */ - public displayName: string; - - /** DataStore createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** DataStore connectorConfig. */ - public connectorConfig?: (google.cloud.ces.v1beta.DataStore.IConnectorConfig|null); - - /** - * Creates a new DataStore instance using the specified properties. - * @param [properties] Properties to set - * @returns DataStore instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDataStore): google.cloud.ces.v1beta.DataStore; - - /** - * Encodes the specified DataStore message. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.verify|verify} messages. - * @param message DataStore message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDataStore, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataStore message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.verify|verify} messages. - * @param message DataStore message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDataStore, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataStore message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataStore - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStore; - - /** - * Decodes a DataStore message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataStore - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStore; - - /** - * Verifies a DataStore message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataStore message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataStore - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStore; - - /** - * Creates a plain object from a DataStore message. Also converts values to other types if specified. - * @param message DataStore - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DataStore, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataStore to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataStore - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DataStore { - - /** Properties of a ConnectorConfig. */ - interface IConnectorConfig { - - /** ConnectorConfig collection */ - collection?: (string|null); - - /** ConnectorConfig collectionDisplayName */ - collectionDisplayName?: (string|null); - - /** ConnectorConfig dataSource */ - dataSource?: (string|null); - } - - /** Represents a ConnectorConfig. */ - class ConnectorConfig implements IConnectorConfig { - - /** - * Constructs a new ConnectorConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.DataStore.IConnectorConfig); - - /** ConnectorConfig collection. */ - public collection: string; - - /** ConnectorConfig collectionDisplayName. */ - public collectionDisplayName: string; - - /** ConnectorConfig dataSource. */ - public dataSource: string; - - /** - * Creates a new ConnectorConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ConnectorConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.DataStore.IConnectorConfig): google.cloud.ces.v1beta.DataStore.ConnectorConfig; - - /** - * Encodes the specified ConnectorConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.ConnectorConfig.verify|verify} messages. - * @param message ConnectorConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.DataStore.IConnectorConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConnectorConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.ConnectorConfig.verify|verify} messages. - * @param message ConnectorConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.DataStore.IConnectorConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConnectorConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConnectorConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStore.ConnectorConfig; - - /** - * Decodes a ConnectorConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConnectorConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStore.ConnectorConfig; - - /** - * Verifies a ConnectorConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConnectorConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConnectorConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStore.ConnectorConfig; - - /** - * Creates a plain object from a ConnectorConfig message. Also converts values to other types if specified. - * @param message ConnectorConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DataStore.ConnectorConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConnectorConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConnectorConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** DataStoreType enum. */ - enum DataStoreType { - DATA_STORE_TYPE_UNSPECIFIED = 0, - PUBLIC_WEB = 1, - UNSTRUCTURED = 2, - FAQ = 3, - CONNECTOR = 4 - } - - /** DocumentProcessingMode enum. */ - enum DocumentProcessingMode { - DOCUMENT_PROCESSING_MODE_UNSPECIFIED = 0, - DOCUMENTS = 1, - CHUNKS = 2 - } - } - - /** Properties of a FileSearchTool. */ - interface IFileSearchTool { - - /** FileSearchTool corpusType */ - corpusType?: (google.cloud.ces.v1beta.FileSearchTool.CorpusType|keyof typeof google.cloud.ces.v1beta.FileSearchTool.CorpusType|null); - - /** FileSearchTool name */ - name?: (string|null); - - /** FileSearchTool description */ - description?: (string|null); - - /** FileSearchTool fileCorpus */ - fileCorpus?: (string|null); - } - - /** Represents a FileSearchTool. */ - class FileSearchTool implements IFileSearchTool { - - /** - * Constructs a new FileSearchTool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IFileSearchTool); - - /** FileSearchTool corpusType. */ - public corpusType: (google.cloud.ces.v1beta.FileSearchTool.CorpusType|keyof typeof google.cloud.ces.v1beta.FileSearchTool.CorpusType); - - /** FileSearchTool name. */ - public name: string; - - /** FileSearchTool description. */ - public description: string; - - /** FileSearchTool fileCorpus. */ - public fileCorpus: string; - - /** - * Creates a new FileSearchTool instance using the specified properties. - * @param [properties] Properties to set - * @returns FileSearchTool instance - */ - public static create(properties?: google.cloud.ces.v1beta.IFileSearchTool): google.cloud.ces.v1beta.FileSearchTool; - - /** - * Encodes the specified FileSearchTool message. Does not implicitly {@link google.cloud.ces.v1beta.FileSearchTool.verify|verify} messages. - * @param message FileSearchTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IFileSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.FileSearchTool.verify|verify} messages. - * @param message FileSearchTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IFileSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileSearchTool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileSearchTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.FileSearchTool; - - /** - * Decodes a FileSearchTool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileSearchTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.FileSearchTool; - - /** - * Verifies a FileSearchTool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileSearchTool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileSearchTool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.FileSearchTool; - - /** - * Creates a plain object from a FileSearchTool message. Also converts values to other types if specified. - * @param message FileSearchTool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.FileSearchTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileSearchTool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileSearchTool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileSearchTool { - - /** CorpusType enum. */ - enum CorpusType { - CORPUS_TYPE_UNSPECIFIED = 0, - USER_OWNED = 1, - FULLY_MANAGED = 2 - } - } - - /** Properties of a GoogleSearchTool. */ - interface IGoogleSearchTool { - - /** GoogleSearchTool name */ - name?: (string|null); - - /** GoogleSearchTool description */ - description?: (string|null); - - /** GoogleSearchTool contextUrls */ - contextUrls?: (string[]|null); - - /** GoogleSearchTool preferredDomains */ - preferredDomains?: (string[]|null); - - /** GoogleSearchTool excludeDomains */ - excludeDomains?: (string[]|null); - - /** GoogleSearchTool promptConfig */ - promptConfig?: (google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig|null); - } - - /** Represents a GoogleSearchTool. */ - class GoogleSearchTool implements IGoogleSearchTool { - - /** - * Constructs a new GoogleSearchTool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGoogleSearchTool); - - /** GoogleSearchTool name. */ - public name: string; - - /** GoogleSearchTool description. */ - public description: string; - - /** GoogleSearchTool contextUrls. */ - public contextUrls: string[]; - - /** GoogleSearchTool preferredDomains. */ - public preferredDomains: string[]; - - /** GoogleSearchTool excludeDomains. */ - public excludeDomains: string[]; - - /** GoogleSearchTool promptConfig. */ - public promptConfig?: (google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig|null); - - /** - * Creates a new GoogleSearchTool instance using the specified properties. - * @param [properties] Properties to set - * @returns GoogleSearchTool instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGoogleSearchTool): google.cloud.ces.v1beta.GoogleSearchTool; - - /** - * Encodes the specified GoogleSearchTool message. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.verify|verify} messages. - * @param message GoogleSearchTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGoogleSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoogleSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.verify|verify} messages. - * @param message GoogleSearchTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGoogleSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoogleSearchTool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoogleSearchTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GoogleSearchTool; - - /** - * Decodes a GoogleSearchTool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoogleSearchTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GoogleSearchTool; - - /** - * Verifies a GoogleSearchTool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoogleSearchTool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoogleSearchTool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GoogleSearchTool; - - /** - * Creates a plain object from a GoogleSearchTool message. Also converts values to other types if specified. - * @param message GoogleSearchTool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GoogleSearchTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoogleSearchTool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoogleSearchTool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GoogleSearchTool { - - /** Properties of a PromptConfig. */ - interface IPromptConfig { - - /** PromptConfig textPrompt */ - textPrompt?: (string|null); - - /** PromptConfig voicePrompt */ - voicePrompt?: (string|null); - } - - /** Represents a PromptConfig. */ - class PromptConfig implements IPromptConfig { - - /** - * Constructs a new PromptConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig); - - /** PromptConfig textPrompt. */ - public textPrompt: string; - - /** PromptConfig voicePrompt. */ - public voicePrompt: string; - - /** - * Creates a new PromptConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PromptConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig): google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig; - - /** - * Encodes the specified PromptConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.verify|verify} messages. - * @param message PromptConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PromptConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.verify|verify} messages. - * @param message PromptConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PromptConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PromptConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig; - - /** - * Decodes a PromptConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PromptConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig; - - /** - * Verifies a PromptConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PromptConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PromptConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig; - - /** - * Creates a plain object from a PromptConfig message. Also converts values to other types if specified. - * @param message PromptConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PromptConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PromptConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a McpTool. */ - interface IMcpTool { - - /** McpTool name */ - name?: (string|null); - - /** McpTool description */ - description?: (string|null); - - /** McpTool inputSchema */ - inputSchema?: (google.cloud.ces.v1beta.ISchema|null); - - /** McpTool outputSchema */ - outputSchema?: (google.cloud.ces.v1beta.ISchema|null); - - /** McpTool serverAddress */ - serverAddress?: (string|null); - - /** McpTool apiAuthentication */ - apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); - - /** McpTool tlsConfig */ - tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); - - /** McpTool serviceDirectoryConfig */ - serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); - } - - /** Represents a McpTool. */ - class McpTool implements IMcpTool { - - /** - * Constructs a new McpTool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IMcpTool); - - /** McpTool name. */ - public name: string; - - /** McpTool description. */ - public description: string; - - /** McpTool inputSchema. */ - public inputSchema?: (google.cloud.ces.v1beta.ISchema|null); - - /** McpTool outputSchema. */ - public outputSchema?: (google.cloud.ces.v1beta.ISchema|null); - - /** McpTool serverAddress. */ - public serverAddress: string; - - /** McpTool apiAuthentication. */ - public apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); - - /** McpTool tlsConfig. */ - public tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); - - /** McpTool serviceDirectoryConfig. */ - public serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); - - /** - * Creates a new McpTool instance using the specified properties. - * @param [properties] Properties to set - * @returns McpTool instance - */ - public static create(properties?: google.cloud.ces.v1beta.IMcpTool): google.cloud.ces.v1beta.McpTool; - - /** - * Encodes the specified McpTool message. Does not implicitly {@link google.cloud.ces.v1beta.McpTool.verify|verify} messages. - * @param message McpTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IMcpTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified McpTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.McpTool.verify|verify} messages. - * @param message McpTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IMcpTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a McpTool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns McpTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.McpTool; - - /** - * Decodes a McpTool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns McpTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.McpTool; - - /** - * Verifies a McpTool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a McpTool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns McpTool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.McpTool; - - /** - * Creates a plain object from a McpTool message. Also converts values to other types if specified. - * @param message McpTool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.McpTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this McpTool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for McpTool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OpenApiTool. */ - interface IOpenApiTool { - - /** OpenApiTool openApiSchema */ - openApiSchema?: (string|null); - - /** OpenApiTool name */ - name?: (string|null); - - /** OpenApiTool description */ - description?: (string|null); - - /** OpenApiTool apiAuthentication */ - apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); - - /** OpenApiTool tlsConfig */ - tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); - - /** OpenApiTool serviceDirectoryConfig */ - serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); - - /** OpenApiTool ignoreUnknownFields */ - ignoreUnknownFields?: (boolean|null); - - /** OpenApiTool url */ - url?: (string|null); - } - - /** Represents an OpenApiTool. */ - class OpenApiTool implements IOpenApiTool { - - /** - * Constructs a new OpenApiTool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IOpenApiTool); - - /** OpenApiTool openApiSchema. */ - public openApiSchema: string; - - /** OpenApiTool name. */ - public name: string; - - /** OpenApiTool description. */ - public description: string; - - /** OpenApiTool apiAuthentication. */ - public apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); - - /** OpenApiTool tlsConfig. */ - public tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); - - /** OpenApiTool serviceDirectoryConfig. */ - public serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); - - /** OpenApiTool ignoreUnknownFields. */ - public ignoreUnknownFields: boolean; - - /** OpenApiTool url. */ - public url: string; - - /** - * Creates a new OpenApiTool instance using the specified properties. - * @param [properties] Properties to set - * @returns OpenApiTool instance - */ - public static create(properties?: google.cloud.ces.v1beta.IOpenApiTool): google.cloud.ces.v1beta.OpenApiTool; - - /** - * Encodes the specified OpenApiTool message. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiTool.verify|verify} messages. - * @param message OpenApiTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IOpenApiTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OpenApiTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiTool.verify|verify} messages. - * @param message OpenApiTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IOpenApiTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OpenApiTool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OpenApiTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OpenApiTool; - - /** - * Decodes an OpenApiTool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OpenApiTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OpenApiTool; - - /** - * Verifies an OpenApiTool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OpenApiTool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OpenApiTool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OpenApiTool; - - /** - * Creates a plain object from an OpenApiTool message. Also converts values to other types if specified. - * @param message OpenApiTool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.OpenApiTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OpenApiTool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OpenApiTool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonFunction. */ - interface IPythonFunction { - - /** PythonFunction name */ - name?: (string|null); - - /** PythonFunction pythonCode */ - pythonCode?: (string|null); - - /** PythonFunction description */ - description?: (string|null); - } - - /** Represents a PythonFunction. */ - class PythonFunction implements IPythonFunction { - - /** - * Constructs a new PythonFunction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IPythonFunction); - - /** PythonFunction name. */ - public name: string; - - /** PythonFunction pythonCode. */ - public pythonCode: string; - - /** PythonFunction description. */ - public description: string; - - /** - * Creates a new PythonFunction instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonFunction instance - */ - public static create(properties?: google.cloud.ces.v1beta.IPythonFunction): google.cloud.ces.v1beta.PythonFunction; - - /** - * Encodes the specified PythonFunction message. Does not implicitly {@link google.cloud.ces.v1beta.PythonFunction.verify|verify} messages. - * @param message PythonFunction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IPythonFunction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.PythonFunction.verify|verify} messages. - * @param message PythonFunction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IPythonFunction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonFunction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonFunction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.PythonFunction; - - /** - * Decodes a PythonFunction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonFunction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.PythonFunction; - - /** - * Verifies a PythonFunction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PythonFunction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonFunction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.PythonFunction; - - /** - * Creates a plain object from a PythonFunction message. Also converts values to other types if specified. - * @param message PythonFunction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.PythonFunction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonFunction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonFunction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SystemTool. */ - interface ISystemTool { - - /** SystemTool name */ - name?: (string|null); - - /** SystemTool description */ - description?: (string|null); - } - - /** Represents a SystemTool. */ - class SystemTool implements ISystemTool { - - /** - * Constructs a new SystemTool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ISystemTool); - - /** SystemTool name. */ - public name: string; - - /** SystemTool description. */ - public description: string; - - /** - * Creates a new SystemTool instance using the specified properties. - * @param [properties] Properties to set - * @returns SystemTool instance - */ - public static create(properties?: google.cloud.ces.v1beta.ISystemTool): google.cloud.ces.v1beta.SystemTool; - - /** - * Encodes the specified SystemTool message. Does not implicitly {@link google.cloud.ces.v1beta.SystemTool.verify|verify} messages. - * @param message SystemTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ISystemTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SystemTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SystemTool.verify|verify} messages. - * @param message SystemTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ISystemTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SystemTool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SystemTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SystemTool; - - /** - * Decodes a SystemTool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SystemTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SystemTool; - - /** - * Verifies a SystemTool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SystemTool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SystemTool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SystemTool; - - /** - * Creates a plain object from a SystemTool message. Also converts values to other types if specified. - * @param message SystemTool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.SystemTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SystemTool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SystemTool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WidgetTool. */ - interface IWidgetTool { - - /** WidgetTool parameters */ - parameters?: (google.cloud.ces.v1beta.ISchema|null); - - /** WidgetTool name */ - name?: (string|null); - - /** WidgetTool description */ - description?: (string|null); - - /** WidgetTool widgetType */ - widgetType?: (google.cloud.ces.v1beta.WidgetTool.WidgetType|keyof typeof google.cloud.ces.v1beta.WidgetTool.WidgetType|null); - } - - /** Represents a WidgetTool. */ - class WidgetTool implements IWidgetTool { - - /** - * Constructs a new WidgetTool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IWidgetTool); - - /** WidgetTool parameters. */ - public parameters?: (google.cloud.ces.v1beta.ISchema|null); - - /** WidgetTool name. */ - public name: string; - - /** WidgetTool description. */ - public description: string; - - /** WidgetTool widgetType. */ - public widgetType: (google.cloud.ces.v1beta.WidgetTool.WidgetType|keyof typeof google.cloud.ces.v1beta.WidgetTool.WidgetType); - - /** WidgetTool input. */ - public input?: "parameters"; - - /** - * Creates a new WidgetTool instance using the specified properties. - * @param [properties] Properties to set - * @returns WidgetTool instance - */ - public static create(properties?: google.cloud.ces.v1beta.IWidgetTool): google.cloud.ces.v1beta.WidgetTool; - - /** - * Encodes the specified WidgetTool message. Does not implicitly {@link google.cloud.ces.v1beta.WidgetTool.verify|verify} messages. - * @param message WidgetTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IWidgetTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WidgetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.WidgetTool.verify|verify} messages. - * @param message WidgetTool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IWidgetTool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WidgetTool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WidgetTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.WidgetTool; - - /** - * Decodes a WidgetTool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WidgetTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.WidgetTool; - - /** - * Verifies a WidgetTool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WidgetTool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WidgetTool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.WidgetTool; - - /** - * Creates a plain object from a WidgetTool message. Also converts values to other types if specified. - * @param message WidgetTool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.WidgetTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WidgetTool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WidgetTool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace WidgetTool { - - /** WidgetType enum. */ - enum WidgetType { - WIDGET_TYPE_UNSPECIFIED = 0, - CUSTOM = 1, - PRODUCT_CAROUSEL = 2, - PRODUCT_DETAILS = 3, - QUICK_ACTIONS = 4, - PRODUCT_COMPARISON = 5, - ADVANCED_PRODUCT_DETAILS = 6, - SHORT_FORM = 7, - OVERALL_SATISFACTION = 8, - ORDER_SUMMARY = 9, - APPOINTMENT_DETAILS = 10, - APPOINTMENT_SCHEDULER = 11, - CONTACT_FORM = 12 - } - } - - /** Properties of a Toolset. */ - interface IToolset { - - /** Toolset mcpToolset */ - mcpToolset?: (google.cloud.ces.v1beta.IMcpToolset|null); - - /** Toolset openApiToolset */ - openApiToolset?: (google.cloud.ces.v1beta.IOpenApiToolset|null); - - /** Toolset connectorToolset */ - connectorToolset?: (google.cloud.ces.v1beta.IConnectorToolset|null); - - /** Toolset name */ - name?: (string|null); - - /** Toolset displayName */ - displayName?: (string|null); - - /** Toolset description */ - description?: (string|null); - - /** Toolset createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Toolset updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Toolset etag */ - etag?: (string|null); - - /** Toolset executionType */ - executionType?: (google.cloud.ces.v1beta.ExecutionType|keyof typeof google.cloud.ces.v1beta.ExecutionType|null); - - /** Toolset toolFakeConfig */ - toolFakeConfig?: (google.cloud.ces.v1beta.IToolFakeConfig|null); - } - - /** Represents a Toolset. */ - class Toolset implements IToolset { - - /** - * Constructs a new Toolset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IToolset); - - /** Toolset mcpToolset. */ - public mcpToolset?: (google.cloud.ces.v1beta.IMcpToolset|null); - - /** Toolset openApiToolset. */ - public openApiToolset?: (google.cloud.ces.v1beta.IOpenApiToolset|null); - - /** Toolset connectorToolset. */ - public connectorToolset?: (google.cloud.ces.v1beta.IConnectorToolset|null); - - /** Toolset name. */ - public name: string; - - /** Toolset displayName. */ - public displayName: string; - - /** Toolset description. */ - public description: string; - - /** Toolset createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Toolset updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Toolset etag. */ - public etag: string; - - /** Toolset executionType. */ - public executionType: (google.cloud.ces.v1beta.ExecutionType|keyof typeof google.cloud.ces.v1beta.ExecutionType); - - /** Toolset toolFakeConfig. */ - public toolFakeConfig?: (google.cloud.ces.v1beta.IToolFakeConfig|null); - - /** Toolset toolsetType. */ - public toolsetType?: ("mcpToolset"|"openApiToolset"|"connectorToolset"); - - /** - * Creates a new Toolset instance using the specified properties. - * @param [properties] Properties to set - * @returns Toolset instance - */ - public static create(properties?: google.cloud.ces.v1beta.IToolset): google.cloud.ces.v1beta.Toolset; - - /** - * Encodes the specified Toolset message. Does not implicitly {@link google.cloud.ces.v1beta.Toolset.verify|verify} messages. - * @param message Toolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Toolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Toolset.verify|verify} messages. - * @param message Toolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Toolset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Toolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Toolset; - - /** - * Decodes a Toolset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Toolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Toolset; - - /** - * Verifies a Toolset message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Toolset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Toolset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Toolset; - - /** - * Creates a plain object from a Toolset message. Also converts values to other types if specified. - * @param message Toolset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Toolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Toolset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Toolset - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ConnectorToolset. */ - interface IConnectorToolset { - - /** ConnectorToolset connection */ - connection?: (string|null); - - /** ConnectorToolset authConfig */ - authConfig?: (google.cloud.ces.v1beta.IEndUserAuthConfig|null); - - /** ConnectorToolset connectorActions */ - connectorActions?: (google.cloud.ces.v1beta.IAction[]|null); - } - - /** Represents a ConnectorToolset. */ - class ConnectorToolset implements IConnectorToolset { - - /** - * Constructs a new ConnectorToolset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IConnectorToolset); - - /** ConnectorToolset connection. */ - public connection: string; - - /** ConnectorToolset authConfig. */ - public authConfig?: (google.cloud.ces.v1beta.IEndUserAuthConfig|null); - - /** ConnectorToolset connectorActions. */ - public connectorActions: google.cloud.ces.v1beta.IAction[]; - - /** - * Creates a new ConnectorToolset instance using the specified properties. - * @param [properties] Properties to set - * @returns ConnectorToolset instance - */ - public static create(properties?: google.cloud.ces.v1beta.IConnectorToolset): google.cloud.ces.v1beta.ConnectorToolset; - - /** - * Encodes the specified ConnectorToolset message. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorToolset.verify|verify} messages. - * @param message ConnectorToolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IConnectorToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConnectorToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorToolset.verify|verify} messages. - * @param message ConnectorToolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IConnectorToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConnectorToolset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConnectorToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ConnectorToolset; - - /** - * Decodes a ConnectorToolset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConnectorToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ConnectorToolset; - - /** - * Verifies a ConnectorToolset message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConnectorToolset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConnectorToolset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ConnectorToolset; - - /** - * Creates a plain object from a ConnectorToolset message. Also converts values to other types if specified. - * @param message ConnectorToolset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ConnectorToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConnectorToolset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConnectorToolset - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a McpToolset. */ - interface IMcpToolset { - - /** McpToolset serverAddress */ - serverAddress?: (string|null); - - /** McpToolset apiAuthentication */ - apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); - - /** McpToolset serviceDirectoryConfig */ - serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); - - /** McpToolset tlsConfig */ - tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); - } - - /** Represents a McpToolset. */ - class McpToolset implements IMcpToolset { - - /** - * Constructs a new McpToolset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IMcpToolset); - - /** McpToolset serverAddress. */ - public serverAddress: string; - - /** McpToolset apiAuthentication. */ - public apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); - - /** McpToolset serviceDirectoryConfig. */ - public serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); - - /** McpToolset tlsConfig. */ - public tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); - - /** - * Creates a new McpToolset instance using the specified properties. - * @param [properties] Properties to set - * @returns McpToolset instance - */ - public static create(properties?: google.cloud.ces.v1beta.IMcpToolset): google.cloud.ces.v1beta.McpToolset; - - /** - * Encodes the specified McpToolset message. Does not implicitly {@link google.cloud.ces.v1beta.McpToolset.verify|verify} messages. - * @param message McpToolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IMcpToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified McpToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.McpToolset.verify|verify} messages. - * @param message McpToolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IMcpToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a McpToolset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns McpToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.McpToolset; - - /** - * Decodes a McpToolset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns McpToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.McpToolset; - - /** - * Verifies a McpToolset message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a McpToolset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns McpToolset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.McpToolset; - - /** - * Creates a plain object from a McpToolset message. Also converts values to other types if specified. - * @param message McpToolset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.McpToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this McpToolset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for McpToolset - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OpenApiToolset. */ - interface IOpenApiToolset { - - /** OpenApiToolset openApiSchema */ - openApiSchema?: (string|null); - - /** OpenApiToolset apiAuthentication */ - apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); - - /** OpenApiToolset tlsConfig */ - tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); - - /** OpenApiToolset serviceDirectoryConfig */ - serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); - - /** OpenApiToolset ignoreUnknownFields */ - ignoreUnknownFields?: (boolean|null); - - /** OpenApiToolset url */ - url?: (string|null); - } - - /** Represents an OpenApiToolset. */ - class OpenApiToolset implements IOpenApiToolset { - - /** - * Constructs a new OpenApiToolset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IOpenApiToolset); - - /** OpenApiToolset openApiSchema. */ - public openApiSchema: string; - - /** OpenApiToolset apiAuthentication. */ - public apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); - - /** OpenApiToolset tlsConfig. */ - public tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); - - /** OpenApiToolset serviceDirectoryConfig. */ - public serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); - - /** OpenApiToolset ignoreUnknownFields. */ - public ignoreUnknownFields: boolean; - - /** OpenApiToolset url. */ - public url: string; - - /** - * Creates a new OpenApiToolset instance using the specified properties. - * @param [properties] Properties to set - * @returns OpenApiToolset instance - */ - public static create(properties?: google.cloud.ces.v1beta.IOpenApiToolset): google.cloud.ces.v1beta.OpenApiToolset; - - /** - * Encodes the specified OpenApiToolset message. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiToolset.verify|verify} messages. - * @param message OpenApiToolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IOpenApiToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OpenApiToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiToolset.verify|verify} messages. - * @param message OpenApiToolset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IOpenApiToolset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OpenApiToolset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OpenApiToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OpenApiToolset; - - /** - * Decodes an OpenApiToolset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OpenApiToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OpenApiToolset; - - /** - * Verifies an OpenApiToolset message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OpenApiToolset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OpenApiToolset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OpenApiToolset; - - /** - * Creates a plain object from an OpenApiToolset message. Also converts values to other types if specified. - * @param message OpenApiToolset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.OpenApiToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OpenApiToolset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OpenApiToolset - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Changelog. */ - interface IChangelog { - - /** Changelog name */ - name?: (string|null); - - /** Changelog author */ - author?: (string|null); - - /** Changelog displayName */ - displayName?: (string|null); - - /** Changelog description */ - description?: (string|null); - - /** Changelog resource */ - resource?: (string|null); - - /** Changelog resourceType */ - resourceType?: (string|null); - - /** Changelog action */ - action?: (string|null); - - /** Changelog originalResource */ - originalResource?: (google.protobuf.IStruct|null); - - /** Changelog newResource */ - newResource?: (google.protobuf.IStruct|null); - - /** Changelog dependentResources */ - dependentResources?: (google.protobuf.IStruct[]|null); - - /** Changelog createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Changelog sequenceNumber */ - sequenceNumber?: (number|Long|string|null); - } - - /** Represents a Changelog. */ - class Changelog implements IChangelog { - - /** - * Constructs a new Changelog. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IChangelog); - - /** Changelog name. */ - public name: string; - - /** Changelog author. */ - public author: string; - - /** Changelog displayName. */ - public displayName: string; - - /** Changelog description. */ - public description: string; - - /** Changelog resource. */ - public resource: string; - - /** Changelog resourceType. */ - public resourceType: string; - - /** Changelog action. */ - public action: string; - - /** Changelog originalResource. */ - public originalResource?: (google.protobuf.IStruct|null); - - /** Changelog newResource. */ - public newResource?: (google.protobuf.IStruct|null); - - /** Changelog dependentResources. */ - public dependentResources: google.protobuf.IStruct[]; - - /** Changelog createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Changelog sequenceNumber. */ - public sequenceNumber: (number|Long|string); - - /** - * Creates a new Changelog instance using the specified properties. - * @param [properties] Properties to set - * @returns Changelog instance - */ - public static create(properties?: google.cloud.ces.v1beta.IChangelog): google.cloud.ces.v1beta.Changelog; - - /** - * Encodes the specified Changelog message. Does not implicitly {@link google.cloud.ces.v1beta.Changelog.verify|verify} messages. - * @param message Changelog message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IChangelog, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Changelog message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Changelog.verify|verify} messages. - * @param message Changelog message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IChangelog, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Changelog message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Changelog - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Changelog; - - /** - * Decodes a Changelog message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Changelog - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Changelog; - - /** - * Verifies a Changelog message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Changelog message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Changelog - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Changelog; - - /** - * Creates a plain object from a Changelog message. Also converts values to other types if specified. - * @param message Changelog - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Changelog, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Changelog to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Changelog - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Conversation. */ - interface IConversation { - - /** Conversation name */ - name?: (string|null); - - /** Conversation startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** Conversation endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** Conversation turns */ - turns?: (google.cloud.ces.v1beta.Conversation.ITurn[]|null); - - /** Conversation turnCount */ - turnCount?: (number|null); - - /** Conversation channelType */ - channelType?: (google.cloud.ces.v1beta.Conversation.ChannelType|keyof typeof google.cloud.ces.v1beta.Conversation.ChannelType|null); - - /** Conversation source */ - source?: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source|null); - - /** Conversation inputTypes */ - inputTypes?: (google.cloud.ces.v1beta.Conversation.InputType[]|null); - - /** Conversation entryAgent */ - entryAgent?: (string|null); - - /** Conversation deployment */ - deployment?: (string|null); - - /** Conversation appVersion */ - appVersion?: (string|null); - - /** Conversation languageCode */ - languageCode?: (string|null); - - /** Conversation messages */ - messages?: (google.cloud.ces.v1beta.IMessage[]|null); - } - - /** Represents a Conversation. */ - class Conversation implements IConversation { - - /** - * Constructs a new Conversation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IConversation); - - /** Conversation name. */ - public name: string; - - /** Conversation startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** Conversation endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** Conversation turns. */ - public turns: google.cloud.ces.v1beta.Conversation.ITurn[]; - - /** Conversation turnCount. */ - public turnCount: number; - - /** Conversation channelType. */ - public channelType: (google.cloud.ces.v1beta.Conversation.ChannelType|keyof typeof google.cloud.ces.v1beta.Conversation.ChannelType); - - /** Conversation source. */ - public source: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source); - - /** Conversation inputTypes. */ - public inputTypes: google.cloud.ces.v1beta.Conversation.InputType[]; - - /** Conversation entryAgent. */ - public entryAgent: string; - - /** Conversation deployment. */ - public deployment: string; - - /** Conversation appVersion. */ - public appVersion: string; - - /** Conversation languageCode. */ - public languageCode: string; - - /** Conversation messages. */ - public messages: google.cloud.ces.v1beta.IMessage[]; - - /** - * Creates a new Conversation instance using the specified properties. - * @param [properties] Properties to set - * @returns Conversation instance - */ - public static create(properties?: google.cloud.ces.v1beta.IConversation): google.cloud.ces.v1beta.Conversation; - - /** - * Encodes the specified Conversation message. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.verify|verify} messages. - * @param message Conversation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Conversation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.verify|verify} messages. - * @param message Conversation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Conversation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Conversation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Conversation; - - /** - * Decodes a Conversation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Conversation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Conversation; - - /** - * Verifies a Conversation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Conversation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Conversation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Conversation; - - /** - * Creates a plain object from a Conversation message. Also converts values to other types if specified. - * @param message Conversation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Conversation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Conversation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Conversation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Conversation { - - /** Properties of a Turn. */ - interface ITurn { - - /** Turn messages */ - messages?: (google.cloud.ces.v1beta.IMessage[]|null); - - /** Turn rootSpan */ - rootSpan?: (google.cloud.ces.v1beta.ISpan|null); - } - - /** Represents a Turn. */ - class Turn implements ITurn { - - /** - * Constructs a new Turn. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Conversation.ITurn); - - /** Turn messages. */ - public messages: google.cloud.ces.v1beta.IMessage[]; - - /** Turn rootSpan. */ - public rootSpan?: (google.cloud.ces.v1beta.ISpan|null); - - /** - * Creates a new Turn instance using the specified properties. - * @param [properties] Properties to set - * @returns Turn instance - */ - public static create(properties?: google.cloud.ces.v1beta.Conversation.ITurn): google.cloud.ces.v1beta.Conversation.Turn; - - /** - * Encodes the specified Turn message. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.Turn.verify|verify} messages. - * @param message Turn message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Conversation.ITurn, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Turn message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.Turn.verify|verify} messages. - * @param message Turn message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Conversation.ITurn, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Turn message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Turn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Conversation.Turn; - - /** - * Decodes a Turn message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Turn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Conversation.Turn; - - /** - * Verifies a Turn message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Turn message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Turn - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Conversation.Turn; - - /** - * Creates a plain object from a Turn message. Also converts values to other types if specified. - * @param message Turn - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Conversation.Turn, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Turn to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Turn - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** ChannelType enum. */ - enum ChannelType { - CHANNEL_TYPE_UNSPECIFIED = 0, - TEXT = 1, - AUDIO = 2, - MULTIMODAL = 3 - } - - /** Source enum. */ - enum Source { - SOURCE_UNSPECIFIED = 0, - LIVE = 1, - SIMULATOR = 2, - EVAL = 3 - } - - /** InputType enum. */ - enum InputType { - INPUT_TYPE_UNSPECIFIED = 0, - INPUT_TYPE_TEXT = 1, - INPUT_TYPE_AUDIO = 2, - INPUT_TYPE_IMAGE = 3, - INPUT_TYPE_BLOB = 4, - INPUT_TYPE_TOOL_RESPONSE = 5, - INPUT_TYPE_VARIABLES = 6 - } - } - - /** Properties of a Deployment. */ - interface IDeployment { - - /** Deployment name */ - name?: (string|null); - - /** Deployment displayName */ - displayName?: (string|null); - - /** Deployment appVersion */ - appVersion?: (string|null); - - /** Deployment channelProfile */ - channelProfile?: (google.cloud.ces.v1beta.IChannelProfile|null); - - /** Deployment createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Deployment updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Deployment etag */ - etag?: (string|null); - } - - /** Represents a Deployment. */ - class Deployment implements IDeployment { - - /** - * Constructs a new Deployment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDeployment); - - /** Deployment name. */ - public name: string; - - /** Deployment displayName. */ - public displayName: string; - - /** Deployment appVersion. */ - public appVersion: string; - - /** Deployment channelProfile. */ - public channelProfile?: (google.cloud.ces.v1beta.IChannelProfile|null); - - /** Deployment createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Deployment updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Deployment etag. */ - public etag: string; - - /** - * Creates a new Deployment instance using the specified properties. - * @param [properties] Properties to set - * @returns Deployment instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDeployment): google.cloud.ces.v1beta.Deployment; - - /** - * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.ces.v1beta.Deployment.verify|verify} messages. - * @param message Deployment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Deployment.verify|verify} messages. - * @param message Deployment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Deployment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Deployment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Deployment; - - /** - * Decodes a Deployment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Deployment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Deployment; - - /** - * Verifies a Deployment message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Deployment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Deployment - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Deployment; - - /** - * Creates a plain object from a Deployment message. Also converts values to other types if specified. - * @param message Deployment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Deployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Deployment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Deployment - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AggregatedMetrics. */ - interface IAggregatedMetrics { - - /** AggregatedMetrics metricsByAppVersion */ - metricsByAppVersion?: (google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion[]|null); - } - - /** Represents an AggregatedMetrics. */ - class AggregatedMetrics implements IAggregatedMetrics { - - /** - * Constructs a new AggregatedMetrics. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IAggregatedMetrics); - - /** AggregatedMetrics metricsByAppVersion. */ - public metricsByAppVersion: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion[]; - - /** - * Creates a new AggregatedMetrics instance using the specified properties. - * @param [properties] Properties to set - * @returns AggregatedMetrics instance - */ - public static create(properties?: google.cloud.ces.v1beta.IAggregatedMetrics): google.cloud.ces.v1beta.AggregatedMetrics; - - /** - * Encodes the specified AggregatedMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.verify|verify} messages. - * @param message AggregatedMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IAggregatedMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AggregatedMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.verify|verify} messages. - * @param message AggregatedMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IAggregatedMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AggregatedMetrics message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AggregatedMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics; - - /** - * Decodes an AggregatedMetrics message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AggregatedMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics; - - /** - * Verifies an AggregatedMetrics message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AggregatedMetrics message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AggregatedMetrics - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics; - - /** - * Creates a plain object from an AggregatedMetrics message. Also converts values to other types if specified. - * @param message AggregatedMetrics - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AggregatedMetrics to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AggregatedMetrics - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AggregatedMetrics { - - /** Properties of a ToolMetrics. */ - interface IToolMetrics { - - /** ToolMetrics tool */ - tool?: (string|null); - - /** ToolMetrics passCount */ - passCount?: (number|null); - - /** ToolMetrics failCount */ - failCount?: (number|null); - } - - /** Represents a ToolMetrics. */ - class ToolMetrics implements IToolMetrics { - - /** - * Constructs a new ToolMetrics. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics); - - /** ToolMetrics tool. */ - public tool: string; - - /** ToolMetrics passCount. */ - public passCount: number; - - /** ToolMetrics failCount. */ - public failCount: number; - - /** - * Creates a new ToolMetrics instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolMetrics instance - */ - public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics): google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics; - - /** - * Encodes the specified ToolMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.verify|verify} messages. - * @param message ToolMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.verify|verify} messages. - * @param message ToolMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolMetrics message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics; - - /** - * Decodes a ToolMetrics message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics; - - /** - * Verifies a ToolMetrics message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolMetrics message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolMetrics - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics; - - /** - * Creates a plain object from a ToolMetrics message. Also converts values to other types if specified. - * @param message ToolMetrics - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolMetrics to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolMetrics - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TurnLatencyMetrics. */ - interface ITurnLatencyMetrics { - - /** TurnLatencyMetrics averageLatency */ - averageLatency?: (google.protobuf.IDuration|null); - } - - /** Represents a TurnLatencyMetrics. */ - class TurnLatencyMetrics implements ITurnLatencyMetrics { - - /** - * Constructs a new TurnLatencyMetrics. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics); - - /** TurnLatencyMetrics averageLatency. */ - public averageLatency?: (google.protobuf.IDuration|null); - - /** - * Creates a new TurnLatencyMetrics instance using the specified properties. - * @param [properties] Properties to set - * @returns TurnLatencyMetrics instance - */ - public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics): google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics; - - /** - * Encodes the specified TurnLatencyMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.verify|verify} messages. - * @param message TurnLatencyMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TurnLatencyMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.verify|verify} messages. - * @param message TurnLatencyMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TurnLatencyMetrics message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TurnLatencyMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics; - - /** - * Decodes a TurnLatencyMetrics message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TurnLatencyMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics; - - /** - * Verifies a TurnLatencyMetrics message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TurnLatencyMetrics message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TurnLatencyMetrics - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics; - - /** - * Creates a plain object from a TurnLatencyMetrics message. Also converts values to other types if specified. - * @param message TurnLatencyMetrics - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TurnLatencyMetrics to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TurnLatencyMetrics - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ToolCallLatencyMetrics. */ - interface IToolCallLatencyMetrics { - - /** ToolCallLatencyMetrics tool */ - tool?: (string|null); - - /** ToolCallLatencyMetrics averageLatency */ - averageLatency?: (google.protobuf.IDuration|null); - } - - /** Represents a ToolCallLatencyMetrics. */ - class ToolCallLatencyMetrics implements IToolCallLatencyMetrics { - - /** - * Constructs a new ToolCallLatencyMetrics. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics); - - /** ToolCallLatencyMetrics tool. */ - public tool: string; - - /** ToolCallLatencyMetrics averageLatency. */ - public averageLatency?: (google.protobuf.IDuration|null); - - /** - * Creates a new ToolCallLatencyMetrics instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolCallLatencyMetrics instance - */ - public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics): google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics; - - /** - * Encodes the specified ToolCallLatencyMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.verify|verify} messages. - * @param message ToolCallLatencyMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolCallLatencyMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.verify|verify} messages. - * @param message ToolCallLatencyMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolCallLatencyMetrics message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolCallLatencyMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics; - - /** - * Decodes a ToolCallLatencyMetrics message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolCallLatencyMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics; - - /** - * Verifies a ToolCallLatencyMetrics message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolCallLatencyMetrics message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolCallLatencyMetrics - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics; - - /** - * Creates a plain object from a ToolCallLatencyMetrics message. Also converts values to other types if specified. - * @param message ToolCallLatencyMetrics - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolCallLatencyMetrics to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolCallLatencyMetrics - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SemanticSimilarityMetrics. */ - interface ISemanticSimilarityMetrics { - - /** SemanticSimilarityMetrics score */ - score?: (number|null); - } - - /** Represents a SemanticSimilarityMetrics. */ - class SemanticSimilarityMetrics implements ISemanticSimilarityMetrics { - - /** - * Constructs a new SemanticSimilarityMetrics. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics); - - /** SemanticSimilarityMetrics score. */ - public score: number; - - /** - * Creates a new SemanticSimilarityMetrics instance using the specified properties. - * @param [properties] Properties to set - * @returns SemanticSimilarityMetrics instance - */ - public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics): google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics; - - /** - * Encodes the specified SemanticSimilarityMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.verify|verify} messages. - * @param message SemanticSimilarityMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SemanticSimilarityMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.verify|verify} messages. - * @param message SemanticSimilarityMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SemanticSimilarityMetrics message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SemanticSimilarityMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics; - - /** - * Decodes a SemanticSimilarityMetrics message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SemanticSimilarityMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics; - - /** - * Verifies a SemanticSimilarityMetrics message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SemanticSimilarityMetrics message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SemanticSimilarityMetrics - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics; - - /** - * Creates a plain object from a SemanticSimilarityMetrics message. Also converts values to other types if specified. - * @param message SemanticSimilarityMetrics - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SemanticSimilarityMetrics to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SemanticSimilarityMetrics - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HallucinationMetrics. */ - interface IHallucinationMetrics { - - /** HallucinationMetrics score */ - score?: (number|null); - } - - /** Represents a HallucinationMetrics. */ - class HallucinationMetrics implements IHallucinationMetrics { - - /** - * Constructs a new HallucinationMetrics. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics); - - /** HallucinationMetrics score. */ - public score: number; - - /** - * Creates a new HallucinationMetrics instance using the specified properties. - * @param [properties] Properties to set - * @returns HallucinationMetrics instance - */ - public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics): google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics; - - /** - * Encodes the specified HallucinationMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.verify|verify} messages. - * @param message HallucinationMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HallucinationMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.verify|verify} messages. - * @param message HallucinationMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HallucinationMetrics message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HallucinationMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics; - - /** - * Decodes a HallucinationMetrics message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HallucinationMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics; - - /** - * Verifies a HallucinationMetrics message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HallucinationMetrics message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HallucinationMetrics - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics; - - /** - * Creates a plain object from a HallucinationMetrics message. Also converts values to other types if specified. - * @param message HallucinationMetrics - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HallucinationMetrics to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HallucinationMetrics - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MetricsByAppVersion. */ - interface IMetricsByAppVersion { - - /** MetricsByAppVersion appVersionId */ - appVersionId?: (string|null); - - /** MetricsByAppVersion toolMetrics */ - toolMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics[]|null); - - /** MetricsByAppVersion semanticSimilarityMetrics */ - semanticSimilarityMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics[]|null); - - /** MetricsByAppVersion hallucinationMetrics */ - hallucinationMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics[]|null); - - /** MetricsByAppVersion toolCallLatencyMetrics */ - toolCallLatencyMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics[]|null); - - /** MetricsByAppVersion turnLatencyMetrics */ - turnLatencyMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics[]|null); - - /** MetricsByAppVersion passCount */ - passCount?: (number|null); - - /** MetricsByAppVersion failCount */ - failCount?: (number|null); - - /** MetricsByAppVersion metricsByTurn */ - metricsByTurn?: (google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn[]|null); - } - - /** Represents a MetricsByAppVersion. */ - class MetricsByAppVersion implements IMetricsByAppVersion { - - /** - * Constructs a new MetricsByAppVersion. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion); - - /** MetricsByAppVersion appVersionId. */ - public appVersionId: string; - - /** MetricsByAppVersion toolMetrics. */ - public toolMetrics: google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics[]; - - /** MetricsByAppVersion semanticSimilarityMetrics. */ - public semanticSimilarityMetrics: google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics[]; - - /** MetricsByAppVersion hallucinationMetrics. */ - public hallucinationMetrics: google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics[]; - - /** MetricsByAppVersion toolCallLatencyMetrics. */ - public toolCallLatencyMetrics: google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics[]; - - /** MetricsByAppVersion turnLatencyMetrics. */ - public turnLatencyMetrics: google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics[]; - - /** MetricsByAppVersion passCount. */ - public passCount: number; - - /** MetricsByAppVersion failCount. */ - public failCount: number; - - /** MetricsByAppVersion metricsByTurn. */ - public metricsByTurn: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn[]; - - /** - * Creates a new MetricsByAppVersion instance using the specified properties. - * @param [properties] Properties to set - * @returns MetricsByAppVersion instance - */ - public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion; - - /** - * Encodes the specified MetricsByAppVersion message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.verify|verify} messages. - * @param message MetricsByAppVersion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MetricsByAppVersion message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.verify|verify} messages. - * @param message MetricsByAppVersion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MetricsByAppVersion message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MetricsByAppVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion; - - /** - * Decodes a MetricsByAppVersion message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MetricsByAppVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion; - - /** - * Verifies a MetricsByAppVersion message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MetricsByAppVersion message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MetricsByAppVersion - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion; - - /** - * Creates a plain object from a MetricsByAppVersion message. Also converts values to other types if specified. - * @param message MetricsByAppVersion - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MetricsByAppVersion to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MetricsByAppVersion - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MetricsByTurn. */ - interface IMetricsByTurn { - - /** MetricsByTurn turnIndex */ - turnIndex?: (number|null); - - /** MetricsByTurn toolMetrics */ - toolMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics[]|null); - - /** MetricsByTurn semanticSimilarityMetrics */ - semanticSimilarityMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics[]|null); - - /** MetricsByTurn hallucinationMetrics */ - hallucinationMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics[]|null); - - /** MetricsByTurn toolCallLatencyMetrics */ - toolCallLatencyMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics[]|null); - - /** MetricsByTurn turnLatencyMetrics */ - turnLatencyMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics[]|null); - } - - /** Represents a MetricsByTurn. */ - class MetricsByTurn implements IMetricsByTurn { - - /** - * Constructs a new MetricsByTurn. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn); - - /** MetricsByTurn turnIndex. */ - public turnIndex: number; - - /** MetricsByTurn toolMetrics. */ - public toolMetrics: google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics[]; - - /** MetricsByTurn semanticSimilarityMetrics. */ - public semanticSimilarityMetrics: google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics[]; - - /** MetricsByTurn hallucinationMetrics. */ - public hallucinationMetrics: google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics[]; - - /** MetricsByTurn toolCallLatencyMetrics. */ - public toolCallLatencyMetrics: google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics[]; - - /** MetricsByTurn turnLatencyMetrics. */ - public turnLatencyMetrics: google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics[]; - - /** - * Creates a new MetricsByTurn instance using the specified properties. - * @param [properties] Properties to set - * @returns MetricsByTurn instance - */ - public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn; - - /** - * Encodes the specified MetricsByTurn message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.verify|verify} messages. - * @param message MetricsByTurn message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MetricsByTurn message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.verify|verify} messages. - * @param message MetricsByTurn message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MetricsByTurn message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MetricsByTurn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn; - - /** - * Decodes a MetricsByTurn message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MetricsByTurn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn; - - /** - * Verifies a MetricsByTurn message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MetricsByTurn message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MetricsByTurn - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn; - - /** - * Creates a plain object from a MetricsByTurn message. Also converts values to other types if specified. - * @param message MetricsByTurn - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MetricsByTurn to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MetricsByTurn - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an Evaluation. */ - interface IEvaluation { - - /** Evaluation golden */ - golden?: (google.cloud.ces.v1beta.Evaluation.IGolden|null); - - /** Evaluation scenario */ - scenario?: (google.cloud.ces.v1beta.Evaluation.IScenario|null); - - /** Evaluation name */ - name?: (string|null); - - /** Evaluation displayName */ - displayName?: (string|null); - - /** Evaluation description */ - description?: (string|null); - - /** Evaluation tags */ - tags?: (string[]|null); - - /** Evaluation evaluationDatasets */ - evaluationDatasets?: (string[]|null); - - /** Evaluation createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Evaluation createdBy */ - createdBy?: (string|null); - - /** Evaluation updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Evaluation lastUpdatedBy */ - lastUpdatedBy?: (string|null); - - /** Evaluation evaluationRuns */ - evaluationRuns?: (string[]|null); - - /** Evaluation etag */ - etag?: (string|null); - - /** Evaluation aggregatedMetrics */ - aggregatedMetrics?: (google.cloud.ces.v1beta.IAggregatedMetrics|null); - - /** Evaluation lastCompletedResult */ - lastCompletedResult?: (google.cloud.ces.v1beta.IEvaluationResult|null); - - /** Evaluation invalid */ - invalid?: (boolean|null); - - /** Evaluation lastTenResults */ - lastTenResults?: (google.cloud.ces.v1beta.IEvaluationResult[]|null); - } - - /** Represents an Evaluation. */ - class Evaluation implements IEvaluation { - - /** - * Constructs a new Evaluation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IEvaluation); - - /** Evaluation golden. */ - public golden?: (google.cloud.ces.v1beta.Evaluation.IGolden|null); - - /** Evaluation scenario. */ - public scenario?: (google.cloud.ces.v1beta.Evaluation.IScenario|null); - - /** Evaluation name. */ - public name: string; - - /** Evaluation displayName. */ - public displayName: string; - - /** Evaluation description. */ - public description: string; - - /** Evaluation tags. */ - public tags: string[]; - - /** Evaluation evaluationDatasets. */ - public evaluationDatasets: string[]; - - /** Evaluation createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Evaluation createdBy. */ - public createdBy: string; - - /** Evaluation updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Evaluation lastUpdatedBy. */ - public lastUpdatedBy: string; - - /** Evaluation evaluationRuns. */ - public evaluationRuns: string[]; - - /** Evaluation etag. */ - public etag: string; - - /** Evaluation aggregatedMetrics. */ - public aggregatedMetrics?: (google.cloud.ces.v1beta.IAggregatedMetrics|null); - - /** Evaluation lastCompletedResult. */ - public lastCompletedResult?: (google.cloud.ces.v1beta.IEvaluationResult|null); - - /** Evaluation invalid. */ - public invalid: boolean; - - /** Evaluation lastTenResults. */ - public lastTenResults: google.cloud.ces.v1beta.IEvaluationResult[]; - - /** Evaluation inputs. */ - public inputs?: ("golden"|"scenario"); - - /** - * Creates a new Evaluation instance using the specified properties. - * @param [properties] Properties to set - * @returns Evaluation instance - */ - public static create(properties?: google.cloud.ces.v1beta.IEvaluation): google.cloud.ces.v1beta.Evaluation; - - /** - * Encodes the specified Evaluation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.verify|verify} messages. - * @param message Evaluation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Evaluation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.verify|verify} messages. - * @param message Evaluation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Evaluation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Evaluation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation; - - /** - * Decodes an Evaluation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Evaluation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation; - - /** - * Verifies an Evaluation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Evaluation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Evaluation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation; - - /** - * Creates a plain object from an Evaluation message. Also converts values to other types if specified. - * @param message Evaluation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Evaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Evaluation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Evaluation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Evaluation { - - /** Properties of a GoldenExpectation. */ - interface IGoldenExpectation { - - /** GoldenExpectation toolCall */ - toolCall?: (google.cloud.ces.v1beta.IToolCall|null); - - /** GoldenExpectation toolResponse */ - toolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); - - /** GoldenExpectation agentResponse */ - agentResponse?: (google.cloud.ces.v1beta.IMessage|null); - - /** GoldenExpectation agentTransfer */ - agentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); - - /** GoldenExpectation updatedVariables */ - updatedVariables?: (google.protobuf.IStruct|null); - - /** GoldenExpectation mockToolResponse */ - mockToolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); - - /** GoldenExpectation note */ - note?: (string|null); - } - - /** Represents a GoldenExpectation. */ - class GoldenExpectation implements IGoldenExpectation { - - /** - * Constructs a new GoldenExpectation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Evaluation.IGoldenExpectation); - - /** GoldenExpectation toolCall. */ - public toolCall?: (google.cloud.ces.v1beta.IToolCall|null); - - /** GoldenExpectation toolResponse. */ - public toolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); - - /** GoldenExpectation agentResponse. */ - public agentResponse?: (google.cloud.ces.v1beta.IMessage|null); - - /** GoldenExpectation agentTransfer. */ - public agentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); - - /** GoldenExpectation updatedVariables. */ - public updatedVariables?: (google.protobuf.IStruct|null); - - /** GoldenExpectation mockToolResponse. */ - public mockToolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); - - /** GoldenExpectation note. */ - public note: string; - - /** GoldenExpectation condition. */ - public condition?: ("toolCall"|"toolResponse"|"agentResponse"|"agentTransfer"|"updatedVariables"|"mockToolResponse"); - - /** - * Creates a new GoldenExpectation instance using the specified properties. - * @param [properties] Properties to set - * @returns GoldenExpectation instance - */ - public static create(properties?: google.cloud.ces.v1beta.Evaluation.IGoldenExpectation): google.cloud.ces.v1beta.Evaluation.GoldenExpectation; - - /** - * Encodes the specified GoldenExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenExpectation.verify|verify} messages. - * @param message GoldenExpectation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Evaluation.IGoldenExpectation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoldenExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenExpectation.verify|verify} messages. - * @param message GoldenExpectation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.IGoldenExpectation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoldenExpectation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoldenExpectation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.GoldenExpectation; - - /** - * Decodes a GoldenExpectation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoldenExpectation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.GoldenExpectation; - - /** - * Verifies a GoldenExpectation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoldenExpectation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoldenExpectation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.GoldenExpectation; - - /** - * Creates a plain object from a GoldenExpectation message. Also converts values to other types if specified. - * @param message GoldenExpectation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Evaluation.GoldenExpectation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoldenExpectation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoldenExpectation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Step. */ - interface IStep { - - /** Step userInput */ - userInput?: (google.cloud.ces.v1beta.ISessionInput|null); - - /** Step agentTransfer */ - agentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); - - /** Step expectation */ - expectation?: (google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null); - } - - /** Represents a Step. */ - class Step implements IStep { - - /** - * Constructs a new Step. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Evaluation.IStep); - - /** Step userInput. */ - public userInput?: (google.cloud.ces.v1beta.ISessionInput|null); - - /** Step agentTransfer. */ - public agentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); - - /** Step expectation. */ - public expectation?: (google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null); - - /** Step step. */ - public step?: ("userInput"|"agentTransfer"|"expectation"); - - /** - * Creates a new Step instance using the specified properties. - * @param [properties] Properties to set - * @returns Step instance - */ - public static create(properties?: google.cloud.ces.v1beta.Evaluation.IStep): google.cloud.ces.v1beta.Evaluation.Step; - - /** - * Encodes the specified Step message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Step.verify|verify} messages. - * @param message Step message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Evaluation.IStep, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Step message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Step.verify|verify} messages. - * @param message Step message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.IStep, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Step message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Step - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.Step; - - /** - * Decodes a Step message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Step - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.Step; - - /** - * Verifies a Step message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Step message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Step - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.Step; - - /** - * Creates a plain object from a Step message. Also converts values to other types if specified. - * @param message Step - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Evaluation.Step, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Step to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Step - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoldenTurn. */ - interface IGoldenTurn { - - /** GoldenTurn steps */ - steps?: (google.cloud.ces.v1beta.Evaluation.IStep[]|null); - - /** GoldenTurn rootSpan */ - rootSpan?: (google.cloud.ces.v1beta.ISpan|null); - } - - /** Represents a GoldenTurn. */ - class GoldenTurn implements IGoldenTurn { - - /** - * Constructs a new GoldenTurn. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Evaluation.IGoldenTurn); - - /** GoldenTurn steps. */ - public steps: google.cloud.ces.v1beta.Evaluation.IStep[]; - - /** GoldenTurn rootSpan. */ - public rootSpan?: (google.cloud.ces.v1beta.ISpan|null); - - /** - * Creates a new GoldenTurn instance using the specified properties. - * @param [properties] Properties to set - * @returns GoldenTurn instance - */ - public static create(properties?: google.cloud.ces.v1beta.Evaluation.IGoldenTurn): google.cloud.ces.v1beta.Evaluation.GoldenTurn; - - /** - * Encodes the specified GoldenTurn message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenTurn.verify|verify} messages. - * @param message GoldenTurn message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Evaluation.IGoldenTurn, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoldenTurn message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenTurn.verify|verify} messages. - * @param message GoldenTurn message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.IGoldenTurn, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoldenTurn message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoldenTurn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.GoldenTurn; - - /** - * Decodes a GoldenTurn message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoldenTurn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.GoldenTurn; - - /** - * Verifies a GoldenTurn message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoldenTurn message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoldenTurn - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.GoldenTurn; - - /** - * Creates a plain object from a GoldenTurn message. Also converts values to other types if specified. - * @param message GoldenTurn - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Evaluation.GoldenTurn, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoldenTurn to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoldenTurn - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Golden. */ - interface IGolden { - - /** Golden turns */ - turns?: (google.cloud.ces.v1beta.Evaluation.IGoldenTurn[]|null); - - /** Golden evaluationExpectations */ - evaluationExpectations?: (string[]|null); - } - - /** Represents a Golden. */ - class Golden implements IGolden { - - /** - * Constructs a new Golden. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Evaluation.IGolden); - - /** Golden turns. */ - public turns: google.cloud.ces.v1beta.Evaluation.IGoldenTurn[]; - - /** Golden evaluationExpectations. */ - public evaluationExpectations: string[]; - - /** - * Creates a new Golden instance using the specified properties. - * @param [properties] Properties to set - * @returns Golden instance - */ - public static create(properties?: google.cloud.ces.v1beta.Evaluation.IGolden): google.cloud.ces.v1beta.Evaluation.Golden; - - /** - * Encodes the specified Golden message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Golden.verify|verify} messages. - * @param message Golden message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Evaluation.IGolden, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Golden message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Golden.verify|verify} messages. - * @param message Golden message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.IGolden, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Golden message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Golden - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.Golden; - - /** - * Decodes a Golden message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Golden - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.Golden; - - /** - * Verifies a Golden message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Golden message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Golden - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.Golden; - - /** - * Creates a plain object from a Golden message. Also converts values to other types if specified. - * @param message Golden - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Evaluation.Golden, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Golden to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Golden - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ScenarioExpectation. */ - interface IScenarioExpectation { - - /** ScenarioExpectation toolExpectation */ - toolExpectation?: (google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation|null); - - /** ScenarioExpectation agentResponse */ - agentResponse?: (google.cloud.ces.v1beta.IMessage|null); - } - - /** Represents a ScenarioExpectation. */ - class ScenarioExpectation implements IScenarioExpectation { - - /** - * Constructs a new ScenarioExpectation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Evaluation.IScenarioExpectation); - - /** ScenarioExpectation toolExpectation. */ - public toolExpectation?: (google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation|null); - - /** ScenarioExpectation agentResponse. */ - public agentResponse?: (google.cloud.ces.v1beta.IMessage|null); - - /** ScenarioExpectation expectation. */ - public expectation?: ("toolExpectation"|"agentResponse"); - - /** - * Creates a new ScenarioExpectation instance using the specified properties. - * @param [properties] Properties to set - * @returns ScenarioExpectation instance - */ - public static create(properties?: google.cloud.ces.v1beta.Evaluation.IScenarioExpectation): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation; - - /** - * Encodes the specified ScenarioExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.verify|verify} messages. - * @param message ScenarioExpectation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Evaluation.IScenarioExpectation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ScenarioExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.verify|verify} messages. - * @param message ScenarioExpectation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.IScenarioExpectation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ScenarioExpectation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ScenarioExpectation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation; - - /** - * Decodes a ScenarioExpectation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ScenarioExpectation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation; - - /** - * Verifies a ScenarioExpectation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ScenarioExpectation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ScenarioExpectation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation; - - /** - * Creates a plain object from a ScenarioExpectation message. Also converts values to other types if specified. - * @param message ScenarioExpectation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Evaluation.ScenarioExpectation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ScenarioExpectation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ScenarioExpectation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ScenarioExpectation { - - /** Properties of a ToolExpectation. */ - interface IToolExpectation { - - /** ToolExpectation expectedToolCall */ - expectedToolCall?: (google.cloud.ces.v1beta.IToolCall|null); - - /** ToolExpectation mockToolResponse */ - mockToolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); - } - - /** Represents a ToolExpectation. */ - class ToolExpectation implements IToolExpectation { - - /** - * Constructs a new ToolExpectation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation); - - /** ToolExpectation expectedToolCall. */ - public expectedToolCall?: (google.cloud.ces.v1beta.IToolCall|null); - - /** ToolExpectation mockToolResponse. */ - public mockToolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); - - /** - * Creates a new ToolExpectation instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolExpectation instance - */ - public static create(properties?: google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation; - - /** - * Encodes the specified ToolExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.verify|verify} messages. - * @param message ToolExpectation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.verify|verify} messages. - * @param message ToolExpectation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolExpectation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolExpectation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation; - - /** - * Decodes a ToolExpectation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolExpectation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation; - - /** - * Verifies a ToolExpectation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolExpectation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolExpectation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation; - - /** - * Creates a plain object from a ToolExpectation message. Also converts values to other types if specified. - * @param message ToolExpectation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolExpectation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolExpectation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Scenario. */ - interface IScenario { - - /** Scenario task */ - task?: (string|null); - - /** Scenario userFacts */ - userFacts?: (google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact[]|null); - - /** Scenario maxTurns */ - maxTurns?: (number|null); - - /** Scenario rubrics */ - rubrics?: (string[]|null); - - /** Scenario scenarioExpectations */ - scenarioExpectations?: (google.cloud.ces.v1beta.Evaluation.IScenarioExpectation[]|null); - - /** Scenario variableOverrides */ - variableOverrides?: (google.protobuf.IStruct|null); - - /** Scenario taskCompletionBehavior */ - taskCompletionBehavior?: (google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior|keyof typeof google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior|null); - - /** Scenario userGoalBehavior */ - userGoalBehavior?: (google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior|keyof typeof google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior|null); - - /** Scenario evaluationExpectations */ - evaluationExpectations?: (string[]|null); - } - - /** Represents a Scenario. */ - class Scenario implements IScenario { - - /** - * Constructs a new Scenario. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Evaluation.IScenario); - - /** Scenario task. */ - public task: string; - - /** Scenario userFacts. */ - public userFacts: google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact[]; - - /** Scenario maxTurns. */ - public maxTurns: number; - - /** Scenario rubrics. */ - public rubrics: string[]; - - /** Scenario scenarioExpectations. */ - public scenarioExpectations: google.cloud.ces.v1beta.Evaluation.IScenarioExpectation[]; - - /** Scenario variableOverrides. */ - public variableOverrides?: (google.protobuf.IStruct|null); - - /** Scenario taskCompletionBehavior. */ - public taskCompletionBehavior: (google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior|keyof typeof google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior); - - /** Scenario userGoalBehavior. */ - public userGoalBehavior: (google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior|keyof typeof google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior); - - /** Scenario evaluationExpectations. */ - public evaluationExpectations: string[]; - - /** - * Creates a new Scenario instance using the specified properties. - * @param [properties] Properties to set - * @returns Scenario instance - */ - public static create(properties?: google.cloud.ces.v1beta.Evaluation.IScenario): google.cloud.ces.v1beta.Evaluation.Scenario; - - /** - * Encodes the specified Scenario message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.verify|verify} messages. - * @param message Scenario message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Evaluation.IScenario, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Scenario message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.verify|verify} messages. - * @param message Scenario message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.IScenario, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Scenario message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Scenario - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.Scenario; - - /** - * Decodes a Scenario message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Scenario - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.Scenario; - - /** - * Verifies a Scenario message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Scenario message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Scenario - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.Scenario; - - /** - * Creates a plain object from a Scenario message. Also converts values to other types if specified. - * @param message Scenario - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Evaluation.Scenario, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Scenario to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Scenario - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Scenario { - - /** Properties of a UserFact. */ - interface IUserFact { - - /** UserFact name */ - name?: (string|null); - - /** UserFact value */ - value?: (string|null); - } - - /** Represents a UserFact. */ - class UserFact implements IUserFact { - - /** - * Constructs a new UserFact. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact); - - /** UserFact name. */ - public name: string; - - /** UserFact value. */ - public value: string; - - /** - * Creates a new UserFact instance using the specified properties. - * @param [properties] Properties to set - * @returns UserFact instance - */ - public static create(properties?: google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact): google.cloud.ces.v1beta.Evaluation.Scenario.UserFact; - - /** - * Encodes the specified UserFact message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.verify|verify} messages. - * @param message UserFact message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UserFact message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.verify|verify} messages. - * @param message UserFact message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UserFact message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UserFact - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.Scenario.UserFact; - - /** - * Decodes a UserFact message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UserFact - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.Scenario.UserFact; - - /** - * Verifies a UserFact message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UserFact message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UserFact - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.Scenario.UserFact; - - /** - * Creates a plain object from a UserFact message. Also converts values to other types if specified. - * @param message UserFact - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Evaluation.Scenario.UserFact, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UserFact to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UserFact - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** TaskCompletionBehavior enum. */ - enum TaskCompletionBehavior { - TASK_COMPLETION_BEHAVIOR_UNSPECIFIED = 0, - TASK_SATISFIED = 1, - TASK_REJECTED = 2 - } - - /** UserGoalBehavior enum. */ - enum UserGoalBehavior { - USER_GOAL_BEHAVIOR_UNSPECIFIED = 0, - USER_GOAL_SATISFIED = 1, - USER_GOAL_REJECTED = 2, - USER_GOAL_IGNORED = 3 - } - } - } - - /** Properties of an EvaluationDataset. */ - interface IEvaluationDataset { - - /** EvaluationDataset name */ - name?: (string|null); - - /** EvaluationDataset displayName */ - displayName?: (string|null); - - /** EvaluationDataset evaluations */ - evaluations?: (string[]|null); - - /** EvaluationDataset createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** EvaluationDataset updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** EvaluationDataset etag */ - etag?: (string|null); - - /** EvaluationDataset createdBy */ - createdBy?: (string|null); - - /** EvaluationDataset lastUpdatedBy */ - lastUpdatedBy?: (string|null); - - /** EvaluationDataset aggregatedMetrics */ - aggregatedMetrics?: (google.cloud.ces.v1beta.IAggregatedMetrics|null); - } - - /** Represents an EvaluationDataset. */ - class EvaluationDataset implements IEvaluationDataset { - - /** - * Constructs a new EvaluationDataset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IEvaluationDataset); - - /** EvaluationDataset name. */ - public name: string; - - /** EvaluationDataset displayName. */ - public displayName: string; - - /** EvaluationDataset evaluations. */ - public evaluations: string[]; - - /** EvaluationDataset createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** EvaluationDataset updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** EvaluationDataset etag. */ - public etag: string; - - /** EvaluationDataset createdBy. */ - public createdBy: string; - - /** EvaluationDataset lastUpdatedBy. */ - public lastUpdatedBy: string; - - /** EvaluationDataset aggregatedMetrics. */ - public aggregatedMetrics?: (google.cloud.ces.v1beta.IAggregatedMetrics|null); - - /** - * Creates a new EvaluationDataset instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluationDataset instance - */ - public static create(properties?: google.cloud.ces.v1beta.IEvaluationDataset): google.cloud.ces.v1beta.EvaluationDataset; - - /** - * Encodes the specified EvaluationDataset message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationDataset.verify|verify} messages. - * @param message EvaluationDataset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IEvaluationDataset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluationDataset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationDataset.verify|verify} messages. - * @param message EvaluationDataset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationDataset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluationDataset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluationDataset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationDataset; - - /** - * Decodes an EvaluationDataset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluationDataset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationDataset; - - /** - * Verifies an EvaluationDataset message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EvaluationDataset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluationDataset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationDataset; - - /** - * Creates a plain object from an EvaluationDataset message. Also converts values to other types if specified. - * @param message EvaluationDataset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationDataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluationDataset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluationDataset - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EvaluationResult. */ - interface IEvaluationResult { - - /** EvaluationResult goldenResult */ - goldenResult?: (google.cloud.ces.v1beta.EvaluationResult.IGoldenResult|null); - - /** EvaluationResult scenarioResult */ - scenarioResult?: (google.cloud.ces.v1beta.EvaluationResult.IScenarioResult|null); - - /** EvaluationResult name */ - name?: (string|null); - - /** EvaluationResult displayName */ - displayName?: (string|null); - - /** EvaluationResult createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** EvaluationResult evaluationStatus */ - evaluationStatus?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); - - /** EvaluationResult evaluationRun */ - evaluationRun?: (string|null); - - /** EvaluationResult persona */ - persona?: (google.cloud.ces.v1beta.IEvaluationPersona|null); - - /** EvaluationResult errorInfo */ - errorInfo?: (google.cloud.ces.v1beta.IEvaluationErrorInfo|null); - - /** EvaluationResult error */ - error?: (google.rpc.IStatus|null); - - /** EvaluationResult initiatedBy */ - initiatedBy?: (string|null); - - /** EvaluationResult appVersion */ - appVersion?: (string|null); - - /** EvaluationResult appVersionDisplayName */ - appVersionDisplayName?: (string|null); - - /** EvaluationResult changelog */ - changelog?: (string|null); - - /** EvaluationResult changelogCreateTime */ - changelogCreateTime?: (google.protobuf.ITimestamp|null); - - /** EvaluationResult executionState */ - executionState?: (google.cloud.ces.v1beta.EvaluationResult.ExecutionState|keyof typeof google.cloud.ces.v1beta.EvaluationResult.ExecutionState|null); - - /** EvaluationResult evaluationMetricsThresholds */ - evaluationMetricsThresholds?: (google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null); - - /** EvaluationResult config */ - config?: (google.cloud.ces.v1beta.IEvaluationConfig|null); - - /** EvaluationResult goldenRunMethod */ - goldenRunMethod?: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod|null); - } - - /** Represents an EvaluationResult. */ - class EvaluationResult implements IEvaluationResult { - - /** - * Constructs a new EvaluationResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IEvaluationResult); - - /** EvaluationResult goldenResult. */ - public goldenResult?: (google.cloud.ces.v1beta.EvaluationResult.IGoldenResult|null); - - /** EvaluationResult scenarioResult. */ - public scenarioResult?: (google.cloud.ces.v1beta.EvaluationResult.IScenarioResult|null); - - /** EvaluationResult name. */ - public name: string; - - /** EvaluationResult displayName. */ - public displayName: string; - - /** EvaluationResult createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** EvaluationResult evaluationStatus. */ - public evaluationStatus: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); - - /** EvaluationResult evaluationRun. */ - public evaluationRun: string; - - /** EvaluationResult persona. */ - public persona?: (google.cloud.ces.v1beta.IEvaluationPersona|null); - - /** EvaluationResult errorInfo. */ - public errorInfo?: (google.cloud.ces.v1beta.IEvaluationErrorInfo|null); - - /** EvaluationResult error. */ - public error?: (google.rpc.IStatus|null); - - /** EvaluationResult initiatedBy. */ - public initiatedBy: string; - - /** EvaluationResult appVersion. */ - public appVersion: string; - - /** EvaluationResult appVersionDisplayName. */ - public appVersionDisplayName: string; - - /** EvaluationResult changelog. */ - public changelog: string; - - /** EvaluationResult changelogCreateTime. */ - public changelogCreateTime?: (google.protobuf.ITimestamp|null); - - /** EvaluationResult executionState. */ - public executionState: (google.cloud.ces.v1beta.EvaluationResult.ExecutionState|keyof typeof google.cloud.ces.v1beta.EvaluationResult.ExecutionState); - - /** EvaluationResult evaluationMetricsThresholds. */ - public evaluationMetricsThresholds?: (google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null); - - /** EvaluationResult config. */ - public config?: (google.cloud.ces.v1beta.IEvaluationConfig|null); - - /** EvaluationResult goldenRunMethod. */ - public goldenRunMethod: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod); - - /** EvaluationResult result. */ - public result?: ("goldenResult"|"scenarioResult"); - - /** - * Creates a new EvaluationResult instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluationResult instance - */ - public static create(properties?: google.cloud.ces.v1beta.IEvaluationResult): google.cloud.ces.v1beta.EvaluationResult; - - /** - * Encodes the specified EvaluationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.verify|verify} messages. - * @param message EvaluationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IEvaluationResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.verify|verify} messages. - * @param message EvaluationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluationResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult; - - /** - * Decodes an EvaluationResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult; - - /** - * Verifies an EvaluationResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EvaluationResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluationResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult; - - /** - * Creates a plain object from an EvaluationResult message. Also converts values to other types if specified. - * @param message EvaluationResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluationResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluationResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EvaluationResult { - - /** Properties of a GoldenExpectationOutcome. */ - interface IGoldenExpectationOutcome { - - /** GoldenExpectationOutcome observedToolCall */ - observedToolCall?: (google.cloud.ces.v1beta.IToolCall|null); - - /** GoldenExpectationOutcome observedToolResponse */ - observedToolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); - - /** GoldenExpectationOutcome observedAgentResponse */ - observedAgentResponse?: (google.cloud.ces.v1beta.IMessage|null); - - /** GoldenExpectationOutcome observedAgentTransfer */ - observedAgentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); - - /** GoldenExpectationOutcome expectation */ - expectation?: (google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null); - - /** GoldenExpectationOutcome outcome */ - outcome?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); - - /** GoldenExpectationOutcome semanticSimilarityResult */ - semanticSimilarityResult?: (google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null); - - /** GoldenExpectationOutcome toolInvocationResult */ - toolInvocationResult?: (google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult|null); - } - - /** Represents a GoldenExpectationOutcome. */ - class GoldenExpectationOutcome implements IGoldenExpectationOutcome { - - /** - * Constructs a new GoldenExpectationOutcome. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome); - - /** GoldenExpectationOutcome observedToolCall. */ - public observedToolCall?: (google.cloud.ces.v1beta.IToolCall|null); - - /** GoldenExpectationOutcome observedToolResponse. */ - public observedToolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); - - /** GoldenExpectationOutcome observedAgentResponse. */ - public observedAgentResponse?: (google.cloud.ces.v1beta.IMessage|null); - - /** GoldenExpectationOutcome observedAgentTransfer. */ - public observedAgentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); - - /** GoldenExpectationOutcome expectation. */ - public expectation?: (google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null); - - /** GoldenExpectationOutcome outcome. */ - public outcome: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); - - /** GoldenExpectationOutcome semanticSimilarityResult. */ - public semanticSimilarityResult?: (google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null); - - /** GoldenExpectationOutcome toolInvocationResult. */ - public toolInvocationResult?: (google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult|null); - - /** GoldenExpectationOutcome result. */ - public result?: ("observedToolCall"|"observedToolResponse"|"observedAgentResponse"|"observedAgentTransfer"); - - /** - * Creates a new GoldenExpectationOutcome instance using the specified properties. - * @param [properties] Properties to set - * @returns GoldenExpectationOutcome instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome; - - /** - * Encodes the specified GoldenExpectationOutcome message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.verify|verify} messages. - * @param message GoldenExpectationOutcome message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoldenExpectationOutcome message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.verify|verify} messages. - * @param message GoldenExpectationOutcome message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoldenExpectationOutcome message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoldenExpectationOutcome - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome; - - /** - * Decodes a GoldenExpectationOutcome message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoldenExpectationOutcome - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome; - - /** - * Verifies a GoldenExpectationOutcome message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoldenExpectationOutcome message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoldenExpectationOutcome - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome; - - /** - * Creates a plain object from a GoldenExpectationOutcome message. Also converts values to other types if specified. - * @param message GoldenExpectationOutcome - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoldenExpectationOutcome to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoldenExpectationOutcome - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GoldenExpectationOutcome { - - /** Properties of a ToolInvocationResult. */ - interface IToolInvocationResult { - - /** ToolInvocationResult parameterCorrectnessScore */ - parameterCorrectnessScore?: (number|null); - - /** ToolInvocationResult outcome */ - outcome?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); - - /** ToolInvocationResult explanation */ - explanation?: (string|null); - } - - /** Represents a ToolInvocationResult. */ - class ToolInvocationResult implements IToolInvocationResult { - - /** - * Constructs a new ToolInvocationResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult); - - /** ToolInvocationResult parameterCorrectnessScore. */ - public parameterCorrectnessScore?: (number|null); - - /** ToolInvocationResult outcome. */ - public outcome: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); - - /** ToolInvocationResult explanation. */ - public explanation: string; - - /** - * Creates a new ToolInvocationResult instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolInvocationResult instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult; - - /** - * Encodes the specified ToolInvocationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.verify|verify} messages. - * @param message ToolInvocationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolInvocationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.verify|verify} messages. - * @param message ToolInvocationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolInvocationResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolInvocationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult; - - /** - * Decodes a ToolInvocationResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolInvocationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult; - - /** - * Verifies a ToolInvocationResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolInvocationResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolInvocationResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult; - - /** - * Creates a plain object from a ToolInvocationResult message. Also converts values to other types if specified. - * @param message ToolInvocationResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolInvocationResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolInvocationResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EvaluationExpectationResult. */ - interface IEvaluationExpectationResult { - - /** EvaluationExpectationResult evaluationExpectation */ - evaluationExpectation?: (string|null); - - /** EvaluationExpectationResult prompt */ - prompt?: (string|null); - - /** EvaluationExpectationResult outcome */ - outcome?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); - - /** EvaluationExpectationResult explanation */ - explanation?: (string|null); - } - - /** Represents an EvaluationExpectationResult. */ - class EvaluationExpectationResult implements IEvaluationExpectationResult { - - /** - * Constructs a new EvaluationExpectationResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult); - - /** EvaluationExpectationResult evaluationExpectation. */ - public evaluationExpectation: string; - - /** EvaluationExpectationResult prompt. */ - public prompt: string; - - /** EvaluationExpectationResult outcome. */ - public outcome: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); - - /** EvaluationExpectationResult explanation. */ - public explanation: string; - - /** - * Creates a new EvaluationExpectationResult instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluationExpectationResult instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult): google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult; - - /** - * Encodes the specified EvaluationExpectationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.verify|verify} messages. - * @param message EvaluationExpectationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluationExpectationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.verify|verify} messages. - * @param message EvaluationExpectationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluationExpectationResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluationExpectationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult; - - /** - * Decodes an EvaluationExpectationResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluationExpectationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult; - - /** - * Verifies an EvaluationExpectationResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EvaluationExpectationResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluationExpectationResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult; - - /** - * Creates a plain object from an EvaluationExpectationResult message. Also converts values to other types if specified. - * @param message EvaluationExpectationResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluationExpectationResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluationExpectationResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoldenResult. */ - interface IGoldenResult { - - /** GoldenResult turnReplayResults */ - turnReplayResults?: (google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult[]|null); - - /** GoldenResult evaluationExpectationResults */ - evaluationExpectationResults?: (google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult[]|null); - } - - /** Represents a GoldenResult. */ - class GoldenResult implements IGoldenResult { - - /** - * Constructs a new GoldenResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IGoldenResult); - - /** GoldenResult turnReplayResults. */ - public turnReplayResults: google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult[]; - - /** GoldenResult evaluationExpectationResults. */ - public evaluationExpectationResults: google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult[]; - - /** - * Creates a new GoldenResult instance using the specified properties. - * @param [properties] Properties to set - * @returns GoldenResult instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IGoldenResult): google.cloud.ces.v1beta.EvaluationResult.GoldenResult; - - /** - * Encodes the specified GoldenResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.verify|verify} messages. - * @param message GoldenResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IGoldenResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoldenResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.verify|verify} messages. - * @param message GoldenResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IGoldenResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoldenResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoldenResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.GoldenResult; - - /** - * Decodes a GoldenResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoldenResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.GoldenResult; - - /** - * Verifies a GoldenResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoldenResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoldenResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.GoldenResult; - - /** - * Creates a plain object from a GoldenResult message. Also converts values to other types if specified. - * @param message GoldenResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.GoldenResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoldenResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoldenResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GoldenResult { - - /** Properties of a TurnReplayResult. */ - interface ITurnReplayResult { - - /** TurnReplayResult conversation */ - conversation?: (string|null); - - /** TurnReplayResult expectationOutcome */ - expectationOutcome?: (google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome[]|null); - - /** TurnReplayResult hallucinationResult */ - hallucinationResult?: (google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult|null); - - /** TurnReplayResult toolInvocationScore */ - toolInvocationScore?: (number|null); - - /** TurnReplayResult toolOrderedInvocationScore */ - toolOrderedInvocationScore?: (number|null); - - /** TurnReplayResult turnLatency */ - turnLatency?: (google.protobuf.IDuration|null); - - /** TurnReplayResult toolCallLatencies */ - toolCallLatencies?: (google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency[]|null); - - /** TurnReplayResult semanticSimilarityResult */ - semanticSimilarityResult?: (google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null); - - /** TurnReplayResult overallToolInvocationResult */ - overallToolInvocationResult?: (google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult|null); - - /** TurnReplayResult errorInfo */ - errorInfo?: (google.cloud.ces.v1beta.IEvaluationErrorInfo|null); - - /** TurnReplayResult spanLatencies */ - spanLatencies?: (google.cloud.ces.v1beta.EvaluationResult.ISpanLatency[]|null); - } - - /** Represents a TurnReplayResult. */ - class TurnReplayResult implements ITurnReplayResult { - - /** - * Constructs a new TurnReplayResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult); - - /** TurnReplayResult conversation. */ - public conversation: string; - - /** TurnReplayResult expectationOutcome. */ - public expectationOutcome: google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome[]; - - /** TurnReplayResult hallucinationResult. */ - public hallucinationResult?: (google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult|null); - - /** TurnReplayResult toolInvocationScore. */ - public toolInvocationScore: number; - - /** TurnReplayResult toolOrderedInvocationScore. */ - public toolOrderedInvocationScore?: (number|null); - - /** TurnReplayResult turnLatency. */ - public turnLatency?: (google.protobuf.IDuration|null); - - /** TurnReplayResult toolCallLatencies. */ - public toolCallLatencies: google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency[]; - - /** TurnReplayResult semanticSimilarityResult. */ - public semanticSimilarityResult?: (google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null); - - /** TurnReplayResult overallToolInvocationResult. */ - public overallToolInvocationResult?: (google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult|null); - - /** TurnReplayResult errorInfo. */ - public errorInfo?: (google.cloud.ces.v1beta.IEvaluationErrorInfo|null); - - /** TurnReplayResult spanLatencies. */ - public spanLatencies: google.cloud.ces.v1beta.EvaluationResult.ISpanLatency[]; - - /** - * Creates a new TurnReplayResult instance using the specified properties. - * @param [properties] Properties to set - * @returns TurnReplayResult instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult): google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult; - - /** - * Encodes the specified TurnReplayResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.verify|verify} messages. - * @param message TurnReplayResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TurnReplayResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.verify|verify} messages. - * @param message TurnReplayResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TurnReplayResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TurnReplayResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult; - - /** - * Decodes a TurnReplayResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TurnReplayResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult; - - /** - * Verifies a TurnReplayResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TurnReplayResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TurnReplayResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult; - - /** - * Creates a plain object from a TurnReplayResult message. Also converts values to other types if specified. - * @param message TurnReplayResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TurnReplayResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TurnReplayResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ScenarioRubricOutcome. */ - interface IScenarioRubricOutcome { - - /** ScenarioRubricOutcome rubric */ - rubric?: (string|null); - - /** ScenarioRubricOutcome score */ - score?: (number|null); - - /** ScenarioRubricOutcome scoreExplanation */ - scoreExplanation?: (string|null); - } - - /** Represents a ScenarioRubricOutcome. */ - class ScenarioRubricOutcome implements IScenarioRubricOutcome { - - /** - * Constructs a new ScenarioRubricOutcome. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome); - - /** ScenarioRubricOutcome rubric. */ - public rubric: string; - - /** ScenarioRubricOutcome score. */ - public score?: (number|null); - - /** ScenarioRubricOutcome scoreExplanation. */ - public scoreExplanation: string; - - /** - * Creates a new ScenarioRubricOutcome instance using the specified properties. - * @param [properties] Properties to set - * @returns ScenarioRubricOutcome instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome): google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome; - - /** - * Encodes the specified ScenarioRubricOutcome message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.verify|verify} messages. - * @param message ScenarioRubricOutcome message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ScenarioRubricOutcome message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.verify|verify} messages. - * @param message ScenarioRubricOutcome message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ScenarioRubricOutcome message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ScenarioRubricOutcome - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome; - - /** - * Decodes a ScenarioRubricOutcome message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ScenarioRubricOutcome - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome; - - /** - * Verifies a ScenarioRubricOutcome message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ScenarioRubricOutcome message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ScenarioRubricOutcome - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome; - - /** - * Creates a plain object from a ScenarioRubricOutcome message. Also converts values to other types if specified. - * @param message ScenarioRubricOutcome - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ScenarioRubricOutcome to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ScenarioRubricOutcome - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ScenarioExpectationOutcome. */ - interface IScenarioExpectationOutcome { - - /** ScenarioExpectationOutcome observedToolCall */ - observedToolCall?: (google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall|null); - - /** ScenarioExpectationOutcome observedAgentResponse */ - observedAgentResponse?: (google.cloud.ces.v1beta.IMessage|null); - - /** ScenarioExpectationOutcome expectation */ - expectation?: (google.cloud.ces.v1beta.Evaluation.IScenarioExpectation|null); - - /** ScenarioExpectationOutcome outcome */ - outcome?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); - } - - /** Represents a ScenarioExpectationOutcome. */ - class ScenarioExpectationOutcome implements IScenarioExpectationOutcome { - - /** - * Constructs a new ScenarioExpectationOutcome. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome); - - /** ScenarioExpectationOutcome observedToolCall. */ - public observedToolCall?: (google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall|null); - - /** ScenarioExpectationOutcome observedAgentResponse. */ - public observedAgentResponse?: (google.cloud.ces.v1beta.IMessage|null); - - /** ScenarioExpectationOutcome expectation. */ - public expectation?: (google.cloud.ces.v1beta.Evaluation.IScenarioExpectation|null); - - /** ScenarioExpectationOutcome outcome. */ - public outcome: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); - - /** ScenarioExpectationOutcome result. */ - public result?: ("observedToolCall"|"observedAgentResponse"); - - /** - * Creates a new ScenarioExpectationOutcome instance using the specified properties. - * @param [properties] Properties to set - * @returns ScenarioExpectationOutcome instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome; - - /** - * Encodes the specified ScenarioExpectationOutcome message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.verify|verify} messages. - * @param message ScenarioExpectationOutcome message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ScenarioExpectationOutcome message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.verify|verify} messages. - * @param message ScenarioExpectationOutcome message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ScenarioExpectationOutcome message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ScenarioExpectationOutcome - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome; - - /** - * Decodes a ScenarioExpectationOutcome message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ScenarioExpectationOutcome - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome; - - /** - * Verifies a ScenarioExpectationOutcome message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ScenarioExpectationOutcome message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ScenarioExpectationOutcome - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome; - - /** - * Creates a plain object from a ScenarioExpectationOutcome message. Also converts values to other types if specified. - * @param message ScenarioExpectationOutcome - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ScenarioExpectationOutcome to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ScenarioExpectationOutcome - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ScenarioExpectationOutcome { - - /** Properties of an ObservedToolCall. */ - interface IObservedToolCall { - - /** ObservedToolCall toolCall */ - toolCall?: (google.cloud.ces.v1beta.IToolCall|null); - - /** ObservedToolCall toolResponse */ - toolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); - } - - /** Represents an ObservedToolCall. */ - class ObservedToolCall implements IObservedToolCall { - - /** - * Constructs a new ObservedToolCall. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall); - - /** ObservedToolCall toolCall. */ - public toolCall?: (google.cloud.ces.v1beta.IToolCall|null); - - /** ObservedToolCall toolResponse. */ - public toolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); - - /** - * Creates a new ObservedToolCall instance using the specified properties. - * @param [properties] Properties to set - * @returns ObservedToolCall instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall; - - /** - * Encodes the specified ObservedToolCall message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.verify|verify} messages. - * @param message ObservedToolCall message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ObservedToolCall message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.verify|verify} messages. - * @param message ObservedToolCall message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ObservedToolCall message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ObservedToolCall - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall; - - /** - * Decodes an ObservedToolCall message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ObservedToolCall - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall; - - /** - * Verifies an ObservedToolCall message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ObservedToolCall message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ObservedToolCall - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall; - - /** - * Creates a plain object from an ObservedToolCall message. Also converts values to other types if specified. - * @param message ObservedToolCall - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ObservedToolCall to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ObservedToolCall - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ScenarioResult. */ - interface IScenarioResult { - - /** ScenarioResult conversation */ - conversation?: (string|null); - - /** ScenarioResult task */ - task?: (string|null); - - /** ScenarioResult userFacts */ - userFacts?: (google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact[]|null); - - /** ScenarioResult expectationOutcomes */ - expectationOutcomes?: (google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome[]|null); - - /** ScenarioResult rubricOutcomes */ - rubricOutcomes?: (google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome[]|null); - - /** ScenarioResult hallucinationResult */ - hallucinationResult?: (google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult[]|null); - - /** ScenarioResult taskCompletionResult */ - taskCompletionResult?: (google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult|null); - - /** ScenarioResult toolCallLatencies */ - toolCallLatencies?: (google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency[]|null); - - /** ScenarioResult userGoalSatisfactionResult */ - userGoalSatisfactionResult?: (google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult|null); - - /** ScenarioResult allExpectationsSatisfied */ - allExpectationsSatisfied?: (boolean|null); - - /** ScenarioResult taskCompleted */ - taskCompleted?: (boolean|null); - - /** ScenarioResult spanLatencies */ - spanLatencies?: (google.cloud.ces.v1beta.EvaluationResult.ISpanLatency[]|null); - - /** ScenarioResult evaluationExpectationResults */ - evaluationExpectationResults?: (google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult[]|null); - } - - /** Represents a ScenarioResult. */ - class ScenarioResult implements IScenarioResult { - - /** - * Constructs a new ScenarioResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IScenarioResult); - - /** ScenarioResult conversation. */ - public conversation: string; - - /** ScenarioResult task. */ - public task: string; - - /** ScenarioResult userFacts. */ - public userFacts: google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact[]; - - /** ScenarioResult expectationOutcomes. */ - public expectationOutcomes: google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome[]; - - /** ScenarioResult rubricOutcomes. */ - public rubricOutcomes: google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome[]; - - /** ScenarioResult hallucinationResult. */ - public hallucinationResult: google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult[]; - - /** ScenarioResult taskCompletionResult. */ - public taskCompletionResult?: (google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult|null); - - /** ScenarioResult toolCallLatencies. */ - public toolCallLatencies: google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency[]; - - /** ScenarioResult userGoalSatisfactionResult. */ - public userGoalSatisfactionResult?: (google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult|null); - - /** ScenarioResult allExpectationsSatisfied. */ - public allExpectationsSatisfied?: (boolean|null); - - /** ScenarioResult taskCompleted. */ - public taskCompleted?: (boolean|null); - - /** ScenarioResult spanLatencies. */ - public spanLatencies: google.cloud.ces.v1beta.EvaluationResult.ISpanLatency[]; - - /** ScenarioResult evaluationExpectationResults. */ - public evaluationExpectationResults: google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult[]; - - /** - * Creates a new ScenarioResult instance using the specified properties. - * @param [properties] Properties to set - * @returns ScenarioResult instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IScenarioResult): google.cloud.ces.v1beta.EvaluationResult.ScenarioResult; - - /** - * Encodes the specified ScenarioResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.verify|verify} messages. - * @param message ScenarioResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IScenarioResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ScenarioResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.verify|verify} messages. - * @param message ScenarioResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IScenarioResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ScenarioResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ScenarioResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.ScenarioResult; - - /** - * Decodes a ScenarioResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ScenarioResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.ScenarioResult; - - /** - * Verifies a ScenarioResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ScenarioResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ScenarioResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.ScenarioResult; - - /** - * Creates a plain object from a ScenarioResult message. Also converts values to other types if specified. - * @param message ScenarioResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.ScenarioResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ScenarioResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ScenarioResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SpanLatency. */ - interface ISpanLatency { - - /** SpanLatency resource */ - resource?: (string|null); - - /** SpanLatency toolset */ - toolset?: (google.cloud.ces.v1beta.IToolsetTool|null); - - /** SpanLatency model */ - model?: (string|null); - - /** SpanLatency callback */ - callback?: (string|null); - - /** SpanLatency type */ - type?: (google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type|keyof typeof google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type|null); - - /** SpanLatency displayName */ - displayName?: (string|null); - - /** SpanLatency startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** SpanLatency endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** SpanLatency executionLatency */ - executionLatency?: (google.protobuf.IDuration|null); - } - - /** Represents a SpanLatency. */ - class SpanLatency implements ISpanLatency { - - /** - * Constructs a new SpanLatency. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.ISpanLatency); - - /** SpanLatency resource. */ - public resource?: (string|null); - - /** SpanLatency toolset. */ - public toolset?: (google.cloud.ces.v1beta.IToolsetTool|null); - - /** SpanLatency model. */ - public model?: (string|null); - - /** SpanLatency callback. */ - public callback?: (string|null); - - /** SpanLatency type. */ - public type: (google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type|keyof typeof google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type); - - /** SpanLatency displayName. */ - public displayName: string; - - /** SpanLatency startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** SpanLatency endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** SpanLatency executionLatency. */ - public executionLatency?: (google.protobuf.IDuration|null); - - /** SpanLatency identifier. */ - public identifier?: ("resource"|"toolset"|"model"|"callback"); - - /** - * Creates a new SpanLatency instance using the specified properties. - * @param [properties] Properties to set - * @returns SpanLatency instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.ISpanLatency): google.cloud.ces.v1beta.EvaluationResult.SpanLatency; - - /** - * Encodes the specified SpanLatency message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SpanLatency.verify|verify} messages. - * @param message SpanLatency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationResult.ISpanLatency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SpanLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SpanLatency.verify|verify} messages. - * @param message SpanLatency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.ISpanLatency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SpanLatency message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SpanLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.SpanLatency; - - /** - * Decodes a SpanLatency message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SpanLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.SpanLatency; - - /** - * Verifies a SpanLatency message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SpanLatency message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SpanLatency - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.SpanLatency; - - /** - * Creates a plain object from a SpanLatency message. Also converts values to other types if specified. - * @param message SpanLatency - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.SpanLatency, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SpanLatency to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SpanLatency - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SpanLatency { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - TOOL = 1, - USER_CALLBACK = 2, - GUARDRAIL = 3, - LLM = 4 - } - } - - /** Properties of a ToolCallLatency. */ - interface IToolCallLatency { - - /** ToolCallLatency tool */ - tool?: (string|null); - - /** ToolCallLatency displayName */ - displayName?: (string|null); - - /** ToolCallLatency startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** ToolCallLatency endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** ToolCallLatency executionLatency */ - executionLatency?: (google.protobuf.IDuration|null); - } - - /** Represents a ToolCallLatency. */ - class ToolCallLatency implements IToolCallLatency { - - /** - * Constructs a new ToolCallLatency. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency); - - /** ToolCallLatency tool. */ - public tool: string; - - /** ToolCallLatency displayName. */ - public displayName: string; - - /** ToolCallLatency startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** ToolCallLatency endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** ToolCallLatency executionLatency. */ - public executionLatency?: (google.protobuf.IDuration|null); - - /** - * Creates a new ToolCallLatency instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolCallLatency instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency): google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency; - - /** - * Encodes the specified ToolCallLatency message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.verify|verify} messages. - * @param message ToolCallLatency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolCallLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.verify|verify} messages. - * @param message ToolCallLatency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolCallLatency message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolCallLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency; - - /** - * Decodes a ToolCallLatency message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolCallLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency; - - /** - * Verifies a ToolCallLatency message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolCallLatency message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolCallLatency - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency; - - /** - * Creates a plain object from a ToolCallLatency message. Also converts values to other types if specified. - * @param message ToolCallLatency - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolCallLatency to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolCallLatency - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HallucinationResult. */ - interface IHallucinationResult { - - /** HallucinationResult score */ - score?: (number|null); - - /** HallucinationResult label */ - label?: (string|null); - - /** HallucinationResult explanation */ - explanation?: (string|null); - } - - /** Represents a HallucinationResult. */ - class HallucinationResult implements IHallucinationResult { - - /** - * Constructs a new HallucinationResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult); - - /** HallucinationResult score. */ - public score?: (number|null); - - /** HallucinationResult label. */ - public label: string; - - /** HallucinationResult explanation. */ - public explanation: string; - - /** - * Creates a new HallucinationResult instance using the specified properties. - * @param [properties] Properties to set - * @returns HallucinationResult instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult): google.cloud.ces.v1beta.EvaluationResult.HallucinationResult; - - /** - * Encodes the specified HallucinationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.verify|verify} messages. - * @param message HallucinationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HallucinationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.verify|verify} messages. - * @param message HallucinationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HallucinationResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HallucinationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.HallucinationResult; - - /** - * Decodes a HallucinationResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HallucinationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.HallucinationResult; - - /** - * Verifies a HallucinationResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HallucinationResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HallucinationResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.HallucinationResult; - - /** - * Creates a plain object from a HallucinationResult message. Also converts values to other types if specified. - * @param message HallucinationResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.HallucinationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HallucinationResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HallucinationResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UserGoalSatisfactionResult. */ - interface IUserGoalSatisfactionResult { - - /** UserGoalSatisfactionResult score */ - score?: (number|null); - - /** UserGoalSatisfactionResult label */ - label?: (string|null); - - /** UserGoalSatisfactionResult explanation */ - explanation?: (string|null); - } - - /** Represents a UserGoalSatisfactionResult. */ - class UserGoalSatisfactionResult implements IUserGoalSatisfactionResult { - - /** - * Constructs a new UserGoalSatisfactionResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult); - - /** UserGoalSatisfactionResult score. */ - public score?: (number|null); - - /** UserGoalSatisfactionResult label. */ - public label: string; - - /** UserGoalSatisfactionResult explanation. */ - public explanation: string; - - /** - * Creates a new UserGoalSatisfactionResult instance using the specified properties. - * @param [properties] Properties to set - * @returns UserGoalSatisfactionResult instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult): google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult; - - /** - * Encodes the specified UserGoalSatisfactionResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.verify|verify} messages. - * @param message UserGoalSatisfactionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UserGoalSatisfactionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.verify|verify} messages. - * @param message UserGoalSatisfactionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UserGoalSatisfactionResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UserGoalSatisfactionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult; - - /** - * Decodes a UserGoalSatisfactionResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UserGoalSatisfactionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult; - - /** - * Verifies a UserGoalSatisfactionResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UserGoalSatisfactionResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UserGoalSatisfactionResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult; - - /** - * Creates a plain object from a UserGoalSatisfactionResult message. Also converts values to other types if specified. - * @param message UserGoalSatisfactionResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UserGoalSatisfactionResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UserGoalSatisfactionResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SemanticSimilarityResult. */ - interface ISemanticSimilarityResult { - - /** SemanticSimilarityResult score */ - score?: (number|null); - - /** SemanticSimilarityResult label */ - label?: (string|null); - - /** SemanticSimilarityResult explanation */ - explanation?: (string|null); - - /** SemanticSimilarityResult outcome */ - outcome?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); - } - - /** Represents a SemanticSimilarityResult. */ - class SemanticSimilarityResult implements ISemanticSimilarityResult { - - /** - * Constructs a new SemanticSimilarityResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult); - - /** SemanticSimilarityResult score. */ - public score?: (number|null); - - /** SemanticSimilarityResult label. */ - public label: string; - - /** SemanticSimilarityResult explanation. */ - public explanation: string; - - /** SemanticSimilarityResult outcome. */ - public outcome: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); - - /** - * Creates a new SemanticSimilarityResult instance using the specified properties. - * @param [properties] Properties to set - * @returns SemanticSimilarityResult instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult): google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult; - - /** - * Encodes the specified SemanticSimilarityResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.verify|verify} messages. - * @param message SemanticSimilarityResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SemanticSimilarityResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.verify|verify} messages. - * @param message SemanticSimilarityResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SemanticSimilarityResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SemanticSimilarityResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult; - - /** - * Decodes a SemanticSimilarityResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SemanticSimilarityResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult; - - /** - * Verifies a SemanticSimilarityResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SemanticSimilarityResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SemanticSimilarityResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult; - - /** - * Creates a plain object from a SemanticSimilarityResult message. Also converts values to other types if specified. - * @param message SemanticSimilarityResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SemanticSimilarityResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SemanticSimilarityResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OverallToolInvocationResult. */ - interface IOverallToolInvocationResult { - - /** OverallToolInvocationResult toolInvocationScore */ - toolInvocationScore?: (number|null); - - /** OverallToolInvocationResult outcome */ - outcome?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); - } - - /** Represents an OverallToolInvocationResult. */ - class OverallToolInvocationResult implements IOverallToolInvocationResult { - - /** - * Constructs a new OverallToolInvocationResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult); - - /** OverallToolInvocationResult toolInvocationScore. */ - public toolInvocationScore?: (number|null); - - /** OverallToolInvocationResult outcome. */ - public outcome: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); - - /** - * Creates a new OverallToolInvocationResult instance using the specified properties. - * @param [properties] Properties to set - * @returns OverallToolInvocationResult instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult): google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult; - - /** - * Encodes the specified OverallToolInvocationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.verify|verify} messages. - * @param message OverallToolInvocationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OverallToolInvocationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.verify|verify} messages. - * @param message OverallToolInvocationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OverallToolInvocationResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OverallToolInvocationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult; - - /** - * Decodes an OverallToolInvocationResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OverallToolInvocationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult; - - /** - * Verifies an OverallToolInvocationResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OverallToolInvocationResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OverallToolInvocationResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult; - - /** - * Creates a plain object from an OverallToolInvocationResult message. Also converts values to other types if specified. - * @param message OverallToolInvocationResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OverallToolInvocationResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OverallToolInvocationResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TaskCompletionResult. */ - interface ITaskCompletionResult { - - /** TaskCompletionResult score */ - score?: (number|null); - - /** TaskCompletionResult label */ - label?: (string|null); - - /** TaskCompletionResult explanation */ - explanation?: (string|null); - } - - /** Represents a TaskCompletionResult. */ - class TaskCompletionResult implements ITaskCompletionResult { - - /** - * Constructs a new TaskCompletionResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult); - - /** TaskCompletionResult score. */ - public score?: (number|null); - - /** TaskCompletionResult label. */ - public label: string; - - /** TaskCompletionResult explanation. */ - public explanation: string; - - /** - * Creates a new TaskCompletionResult instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskCompletionResult instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult): google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult; - - /** - * Encodes the specified TaskCompletionResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.verify|verify} messages. - * @param message TaskCompletionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskCompletionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.verify|verify} messages. - * @param message TaskCompletionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskCompletionResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskCompletionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult; - - /** - * Decodes a TaskCompletionResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskCompletionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult; - - /** - * Verifies a TaskCompletionResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskCompletionResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskCompletionResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult; - - /** - * Creates a plain object from a TaskCompletionResult message. Also converts values to other types if specified. - * @param message TaskCompletionResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskCompletionResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskCompletionResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Outcome enum. */ - enum Outcome { - OUTCOME_UNSPECIFIED = 0, - PASS = 1, - FAIL = 2 - } - - /** ExecutionState enum. */ - enum ExecutionState { - EXECUTION_STATE_UNSPECIFIED = 0, - RUNNING = 1, - COMPLETED = 2, - ERROR = 3 - } - } - - /** Properties of an EvaluationRun. */ - interface IEvaluationRun { - - /** EvaluationRun name */ - name?: (string|null); - - /** EvaluationRun displayName */ - displayName?: (string|null); - - /** EvaluationRun evaluationResults */ - evaluationResults?: (string[]|null); - - /** EvaluationRun createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** EvaluationRun initiatedBy */ - initiatedBy?: (string|null); - - /** EvaluationRun appVersion */ - appVersion?: (string|null); - - /** EvaluationRun appVersionDisplayName */ - appVersionDisplayName?: (string|null); - - /** EvaluationRun changelog */ - changelog?: (string|null); - - /** EvaluationRun changelogCreateTime */ - changelogCreateTime?: (google.protobuf.ITimestamp|null); - - /** EvaluationRun evaluations */ - evaluations?: (string[]|null); - - /** EvaluationRun evaluationDataset */ - evaluationDataset?: (string|null); - - /** EvaluationRun evaluationType */ - evaluationType?: (google.cloud.ces.v1beta.EvaluationRun.EvaluationType|keyof typeof google.cloud.ces.v1beta.EvaluationRun.EvaluationType|null); - - /** EvaluationRun state */ - state?: (google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState|keyof typeof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState|null); - - /** EvaluationRun progress */ - progress?: (google.cloud.ces.v1beta.EvaluationRun.IProgress|null); - - /** EvaluationRun config */ - config?: (google.cloud.ces.v1beta.IEvaluationConfig|null); - - /** EvaluationRun error */ - error?: (google.rpc.IStatus|null); - - /** EvaluationRun errorInfo */ - errorInfo?: (google.cloud.ces.v1beta.IEvaluationErrorInfo|null); - - /** EvaluationRun evaluationRunSummaries */ - evaluationRunSummaries?: ({ [k: string]: google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary }|null); - - /** EvaluationRun latencyReport */ - latencyReport?: (google.cloud.ces.v1beta.ILatencyReport|null); - - /** EvaluationRun runCount */ - runCount?: (number|null); - - /** EvaluationRun personaRunConfigs */ - personaRunConfigs?: (google.cloud.ces.v1beta.IPersonaRunConfig[]|null); - - /** EvaluationRun optimizationConfig */ - optimizationConfig?: (google.cloud.ces.v1beta.IOptimizationConfig|null); - - /** EvaluationRun scheduledEvaluationRun */ - scheduledEvaluationRun?: (string|null); - - /** EvaluationRun goldenRunMethod */ - goldenRunMethod?: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod|null); - } - - /** Represents an EvaluationRun. */ - class EvaluationRun implements IEvaluationRun { - - /** - * Constructs a new EvaluationRun. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IEvaluationRun); - - /** EvaluationRun name. */ - public name: string; - - /** EvaluationRun displayName. */ - public displayName: string; - - /** EvaluationRun evaluationResults. */ - public evaluationResults: string[]; - - /** EvaluationRun createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** EvaluationRun initiatedBy. */ - public initiatedBy: string; - - /** EvaluationRun appVersion. */ - public appVersion: string; - - /** EvaluationRun appVersionDisplayName. */ - public appVersionDisplayName: string; - - /** EvaluationRun changelog. */ - public changelog: string; - - /** EvaluationRun changelogCreateTime. */ - public changelogCreateTime?: (google.protobuf.ITimestamp|null); - - /** EvaluationRun evaluations. */ - public evaluations: string[]; - - /** EvaluationRun evaluationDataset. */ - public evaluationDataset: string; - - /** EvaluationRun evaluationType. */ - public evaluationType: (google.cloud.ces.v1beta.EvaluationRun.EvaluationType|keyof typeof google.cloud.ces.v1beta.EvaluationRun.EvaluationType); - - /** EvaluationRun state. */ - public state: (google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState|keyof typeof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState); - - /** EvaluationRun progress. */ - public progress?: (google.cloud.ces.v1beta.EvaluationRun.IProgress|null); - - /** EvaluationRun config. */ - public config?: (google.cloud.ces.v1beta.IEvaluationConfig|null); - - /** EvaluationRun error. */ - public error?: (google.rpc.IStatus|null); - - /** EvaluationRun errorInfo. */ - public errorInfo?: (google.cloud.ces.v1beta.IEvaluationErrorInfo|null); - - /** EvaluationRun evaluationRunSummaries. */ - public evaluationRunSummaries: { [k: string]: google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary }; - - /** EvaluationRun latencyReport. */ - public latencyReport?: (google.cloud.ces.v1beta.ILatencyReport|null); - - /** EvaluationRun runCount. */ - public runCount: number; - - /** EvaluationRun personaRunConfigs. */ - public personaRunConfigs: google.cloud.ces.v1beta.IPersonaRunConfig[]; - - /** EvaluationRun optimizationConfig. */ - public optimizationConfig?: (google.cloud.ces.v1beta.IOptimizationConfig|null); - - /** EvaluationRun scheduledEvaluationRun. */ - public scheduledEvaluationRun: string; - - /** EvaluationRun goldenRunMethod. */ - public goldenRunMethod: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod); - - /** - * Creates a new EvaluationRun instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluationRun instance - */ - public static create(properties?: google.cloud.ces.v1beta.IEvaluationRun): google.cloud.ces.v1beta.EvaluationRun; - - /** - * Encodes the specified EvaluationRun message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.verify|verify} messages. - * @param message EvaluationRun message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IEvaluationRun, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluationRun message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.verify|verify} messages. - * @param message EvaluationRun message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationRun, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluationRun message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluationRun - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationRun; - - /** - * Decodes an EvaluationRun message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluationRun - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationRun; - - /** - * Verifies an EvaluationRun message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EvaluationRun message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluationRun - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationRun; - - /** - * Creates a plain object from an EvaluationRun message. Also converts values to other types if specified. - * @param message EvaluationRun - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluationRun to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluationRun - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EvaluationRun { - - /** Properties of a Progress. */ - interface IProgress { - - /** Progress totalCount */ - totalCount?: (number|null); - - /** Progress failedCount */ - failedCount?: (number|null); - - /** Progress errorCount */ - errorCount?: (number|null); - - /** Progress completedCount */ - completedCount?: (number|null); - - /** Progress passedCount */ - passedCount?: (number|null); - } - - /** Represents a Progress. */ - class Progress implements IProgress { - - /** - * Constructs a new Progress. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationRun.IProgress); - - /** Progress totalCount. */ - public totalCount: number; - - /** Progress failedCount. */ - public failedCount: number; - - /** Progress errorCount. */ - public errorCount: number; - - /** Progress completedCount. */ - public completedCount: number; - - /** Progress passedCount. */ - public passedCount: number; - - /** - * Creates a new Progress instance using the specified properties. - * @param [properties] Properties to set - * @returns Progress instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationRun.IProgress): google.cloud.ces.v1beta.EvaluationRun.Progress; - - /** - * Encodes the specified Progress message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.Progress.verify|verify} messages. - * @param message Progress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationRun.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.Progress.verify|verify} messages. - * @param message Progress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationRun.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Progress message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Progress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationRun.Progress; - - /** - * Decodes a Progress message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Progress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationRun.Progress; - - /** - * Verifies a Progress message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Progress message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Progress - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationRun.Progress; - - /** - * Creates a plain object from a Progress message. Also converts values to other types if specified. - * @param message Progress - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationRun.Progress, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Progress to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Progress - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EvaluationRunSummary. */ - interface IEvaluationRunSummary { - - /** EvaluationRunSummary passedCount */ - passedCount?: (number|null); - - /** EvaluationRunSummary failedCount */ - failedCount?: (number|null); - - /** EvaluationRunSummary errorCount */ - errorCount?: (number|null); - } - - /** Represents an EvaluationRunSummary. */ - class EvaluationRunSummary implements IEvaluationRunSummary { - - /** - * Constructs a new EvaluationRunSummary. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary); - - /** EvaluationRunSummary passedCount. */ - public passedCount: number; - - /** EvaluationRunSummary failedCount. */ - public failedCount: number; - - /** EvaluationRunSummary errorCount. */ - public errorCount: number; - - /** - * Creates a new EvaluationRunSummary instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluationRunSummary instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary): google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary; - - /** - * Encodes the specified EvaluationRunSummary message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.verify|verify} messages. - * @param message EvaluationRunSummary message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluationRunSummary message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.verify|verify} messages. - * @param message EvaluationRunSummary message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluationRunSummary message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluationRunSummary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary; - - /** - * Decodes an EvaluationRunSummary message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluationRunSummary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary; - - /** - * Verifies an EvaluationRunSummary message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EvaluationRunSummary message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluationRunSummary - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary; - - /** - * Creates a plain object from an EvaluationRunSummary message. Also converts values to other types if specified. - * @param message EvaluationRunSummary - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluationRunSummary to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluationRunSummary - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** EvaluationType enum. */ - enum EvaluationType { - EVALUATION_TYPE_UNSPECIFIED = 0, - GOLDEN = 1, - SCENARIO = 2, - MIXED = 3 - } - - /** EvaluationRunState enum. */ - enum EvaluationRunState { - EVALUATION_RUN_STATE_UNSPECIFIED = 0, - RUNNING = 1, - COMPLETED = 2, - ERROR = 3 - } - } - - /** Properties of a LatencyReport. */ - interface ILatencyReport { - - /** LatencyReport toolLatencies */ - toolLatencies?: (google.cloud.ces.v1beta.LatencyReport.IToolLatency[]|null); - - /** LatencyReport callbackLatencies */ - callbackLatencies?: (google.cloud.ces.v1beta.LatencyReport.ICallbackLatency[]|null); - - /** LatencyReport guardrailLatencies */ - guardrailLatencies?: (google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency[]|null); - - /** LatencyReport llmCallLatencies */ - llmCallLatencies?: (google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency[]|null); - - /** LatencyReport sessionCount */ - sessionCount?: (number|null); - } - - /** Represents a LatencyReport. */ - class LatencyReport implements ILatencyReport { - - /** - * Constructs a new LatencyReport. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ILatencyReport); - - /** LatencyReport toolLatencies. */ - public toolLatencies: google.cloud.ces.v1beta.LatencyReport.IToolLatency[]; - - /** LatencyReport callbackLatencies. */ - public callbackLatencies: google.cloud.ces.v1beta.LatencyReport.ICallbackLatency[]; - - /** LatencyReport guardrailLatencies. */ - public guardrailLatencies: google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency[]; - - /** LatencyReport llmCallLatencies. */ - public llmCallLatencies: google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency[]; - - /** LatencyReport sessionCount. */ - public sessionCount: number; - - /** - * Creates a new LatencyReport instance using the specified properties. - * @param [properties] Properties to set - * @returns LatencyReport instance - */ - public static create(properties?: google.cloud.ces.v1beta.ILatencyReport): google.cloud.ces.v1beta.LatencyReport; - - /** - * Encodes the specified LatencyReport message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.verify|verify} messages. - * @param message LatencyReport message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ILatencyReport, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LatencyReport message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.verify|verify} messages. - * @param message LatencyReport message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ILatencyReport, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LatencyReport message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LatencyReport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LatencyReport; - - /** - * Decodes a LatencyReport message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LatencyReport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LatencyReport; - - /** - * Verifies a LatencyReport message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LatencyReport message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LatencyReport - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LatencyReport; - - /** - * Creates a plain object from a LatencyReport message. Also converts values to other types if specified. - * @param message LatencyReport - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.LatencyReport, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LatencyReport to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LatencyReport - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace LatencyReport { - - /** Properties of a LatencyMetrics. */ - interface ILatencyMetrics { - - /** LatencyMetrics p50Latency */ - p50Latency?: (google.protobuf.IDuration|null); - - /** LatencyMetrics p90Latency */ - p90Latency?: (google.protobuf.IDuration|null); - - /** LatencyMetrics p99Latency */ - p99Latency?: (google.protobuf.IDuration|null); - - /** LatencyMetrics callCount */ - callCount?: (number|null); - } - - /** Represents a LatencyMetrics. */ - class LatencyMetrics implements ILatencyMetrics { - - /** - * Constructs a new LatencyMetrics. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics); - - /** LatencyMetrics p50Latency. */ - public p50Latency?: (google.protobuf.IDuration|null); - - /** LatencyMetrics p90Latency. */ - public p90Latency?: (google.protobuf.IDuration|null); - - /** LatencyMetrics p99Latency. */ - public p99Latency?: (google.protobuf.IDuration|null); - - /** LatencyMetrics callCount. */ - public callCount: number; - - /** - * Creates a new LatencyMetrics instance using the specified properties. - * @param [properties] Properties to set - * @returns LatencyMetrics instance - */ - public static create(properties?: google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics): google.cloud.ces.v1beta.LatencyReport.LatencyMetrics; - - /** - * Encodes the specified LatencyMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify|verify} messages. - * @param message LatencyMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LatencyMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify|verify} messages. - * @param message LatencyMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LatencyMetrics message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LatencyMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LatencyReport.LatencyMetrics; - - /** - * Decodes a LatencyMetrics message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LatencyMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LatencyReport.LatencyMetrics; - - /** - * Verifies a LatencyMetrics message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LatencyMetrics message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LatencyMetrics - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LatencyReport.LatencyMetrics; - - /** - * Creates a plain object from a LatencyMetrics message. Also converts values to other types if specified. - * @param message LatencyMetrics - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.LatencyReport.LatencyMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LatencyMetrics to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LatencyMetrics - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ToolLatency. */ - interface IToolLatency { - - /** ToolLatency tool */ - tool?: (string|null); - - /** ToolLatency toolsetTool */ - toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); - - /** ToolLatency toolDisplayName */ - toolDisplayName?: (string|null); - - /** ToolLatency latencyMetrics */ - latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); - } - - /** Represents a ToolLatency. */ - class ToolLatency implements IToolLatency { - - /** - * Constructs a new ToolLatency. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.LatencyReport.IToolLatency); - - /** ToolLatency tool. */ - public tool?: (string|null); - - /** ToolLatency toolsetTool. */ - public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); - - /** ToolLatency toolDisplayName. */ - public toolDisplayName: string; - - /** ToolLatency latencyMetrics. */ - public latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); - - /** ToolLatency toolIdentifier. */ - public toolIdentifier?: ("tool"|"toolsetTool"); - - /** - * Creates a new ToolLatency instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolLatency instance - */ - public static create(properties?: google.cloud.ces.v1beta.LatencyReport.IToolLatency): google.cloud.ces.v1beta.LatencyReport.ToolLatency; - - /** - * Encodes the specified ToolLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.ToolLatency.verify|verify} messages. - * @param message ToolLatency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.LatencyReport.IToolLatency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.ToolLatency.verify|verify} messages. - * @param message ToolLatency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.LatencyReport.IToolLatency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolLatency message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LatencyReport.ToolLatency; - - /** - * Decodes a ToolLatency message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LatencyReport.ToolLatency; - - /** - * Verifies a ToolLatency message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolLatency message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolLatency - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LatencyReport.ToolLatency; - - /** - * Creates a plain object from a ToolLatency message. Also converts values to other types if specified. - * @param message ToolLatency - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.LatencyReport.ToolLatency, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolLatency to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolLatency - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CallbackLatency. */ - interface ICallbackLatency { - - /** CallbackLatency stage */ - stage?: (string|null); - - /** CallbackLatency latencyMetrics */ - latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); - } - - /** Represents a CallbackLatency. */ - class CallbackLatency implements ICallbackLatency { - - /** - * Constructs a new CallbackLatency. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.LatencyReport.ICallbackLatency); - - /** CallbackLatency stage. */ - public stage: string; - - /** CallbackLatency latencyMetrics. */ - public latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); - - /** - * Creates a new CallbackLatency instance using the specified properties. - * @param [properties] Properties to set - * @returns CallbackLatency instance - */ - public static create(properties?: google.cloud.ces.v1beta.LatencyReport.ICallbackLatency): google.cloud.ces.v1beta.LatencyReport.CallbackLatency; - - /** - * Encodes the specified CallbackLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.CallbackLatency.verify|verify} messages. - * @param message CallbackLatency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.LatencyReport.ICallbackLatency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CallbackLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.CallbackLatency.verify|verify} messages. - * @param message CallbackLatency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.LatencyReport.ICallbackLatency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CallbackLatency message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CallbackLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LatencyReport.CallbackLatency; - - /** - * Decodes a CallbackLatency message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CallbackLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LatencyReport.CallbackLatency; - - /** - * Verifies a CallbackLatency message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CallbackLatency message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CallbackLatency - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LatencyReport.CallbackLatency; - - /** - * Creates a plain object from a CallbackLatency message. Also converts values to other types if specified. - * @param message CallbackLatency - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.LatencyReport.CallbackLatency, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CallbackLatency to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CallbackLatency - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GuardrailLatency. */ - interface IGuardrailLatency { - - /** GuardrailLatency guardrail */ - guardrail?: (string|null); - - /** GuardrailLatency guardrailDisplayName */ - guardrailDisplayName?: (string|null); - - /** GuardrailLatency latencyMetrics */ - latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); - } - - /** Represents a GuardrailLatency. */ - class GuardrailLatency implements IGuardrailLatency { - - /** - * Constructs a new GuardrailLatency. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency); - - /** GuardrailLatency guardrail. */ - public guardrail: string; - - /** GuardrailLatency guardrailDisplayName. */ - public guardrailDisplayName: string; - - /** GuardrailLatency latencyMetrics. */ - public latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); - - /** - * Creates a new GuardrailLatency instance using the specified properties. - * @param [properties] Properties to set - * @returns GuardrailLatency instance - */ - public static create(properties?: google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency): google.cloud.ces.v1beta.LatencyReport.GuardrailLatency; - - /** - * Encodes the specified GuardrailLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.verify|verify} messages. - * @param message GuardrailLatency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GuardrailLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.verify|verify} messages. - * @param message GuardrailLatency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GuardrailLatency message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GuardrailLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LatencyReport.GuardrailLatency; - - /** - * Decodes a GuardrailLatency message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GuardrailLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LatencyReport.GuardrailLatency; - - /** - * Verifies a GuardrailLatency message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GuardrailLatency message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GuardrailLatency - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LatencyReport.GuardrailLatency; - - /** - * Creates a plain object from a GuardrailLatency message. Also converts values to other types if specified. - * @param message GuardrailLatency - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.LatencyReport.GuardrailLatency, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GuardrailLatency to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GuardrailLatency - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LlmCallLatency. */ - interface ILlmCallLatency { - - /** LlmCallLatency model */ - model?: (string|null); - - /** LlmCallLatency latencyMetrics */ - latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); - } - - /** Represents a LlmCallLatency. */ - class LlmCallLatency implements ILlmCallLatency { - - /** - * Constructs a new LlmCallLatency. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency); - - /** LlmCallLatency model. */ - public model: string; - - /** LlmCallLatency latencyMetrics. */ - public latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); - - /** - * Creates a new LlmCallLatency instance using the specified properties. - * @param [properties] Properties to set - * @returns LlmCallLatency instance - */ - public static create(properties?: google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency): google.cloud.ces.v1beta.LatencyReport.LlmCallLatency; - - /** - * Encodes the specified LlmCallLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.verify|verify} messages. - * @param message LlmCallLatency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LlmCallLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.verify|verify} messages. - * @param message LlmCallLatency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LlmCallLatency message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LlmCallLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LatencyReport.LlmCallLatency; - - /** - * Decodes a LlmCallLatency message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LlmCallLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LatencyReport.LlmCallLatency; - - /** - * Verifies a LlmCallLatency message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LlmCallLatency message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LlmCallLatency - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LatencyReport.LlmCallLatency; - - /** - * Creates a plain object from a LlmCallLatency message. Also converts values to other types if specified. - * @param message LlmCallLatency - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.LatencyReport.LlmCallLatency, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LlmCallLatency to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LlmCallLatency - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EvaluationExpectation. */ - interface IEvaluationExpectation { - - /** EvaluationExpectation llmCriteria */ - llmCriteria?: (google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria|null); - - /** EvaluationExpectation name */ - name?: (string|null); - - /** EvaluationExpectation displayName */ - displayName?: (string|null); - - /** EvaluationExpectation tags */ - tags?: (string[]|null); - - /** EvaluationExpectation createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** EvaluationExpectation updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** EvaluationExpectation etag */ - etag?: (string|null); - } - - /** Represents an EvaluationExpectation. */ - class EvaluationExpectation implements IEvaluationExpectation { - - /** - * Constructs a new EvaluationExpectation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IEvaluationExpectation); - - /** EvaluationExpectation llmCriteria. */ - public llmCriteria?: (google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria|null); - - /** EvaluationExpectation name. */ - public name: string; - - /** EvaluationExpectation displayName. */ - public displayName: string; - - /** EvaluationExpectation tags. */ - public tags: string[]; - - /** EvaluationExpectation createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** EvaluationExpectation updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** EvaluationExpectation etag. */ - public etag: string; - - /** EvaluationExpectation criteria. */ - public criteria?: "llmCriteria"; - - /** - * Creates a new EvaluationExpectation instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluationExpectation instance - */ - public static create(properties?: google.cloud.ces.v1beta.IEvaluationExpectation): google.cloud.ces.v1beta.EvaluationExpectation; - - /** - * Encodes the specified EvaluationExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.verify|verify} messages. - * @param message EvaluationExpectation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IEvaluationExpectation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluationExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.verify|verify} messages. - * @param message EvaluationExpectation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationExpectation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluationExpectation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluationExpectation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationExpectation; - - /** - * Decodes an EvaluationExpectation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluationExpectation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationExpectation; - - /** - * Verifies an EvaluationExpectation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EvaluationExpectation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluationExpectation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationExpectation; - - /** - * Creates a plain object from an EvaluationExpectation message. Also converts values to other types if specified. - * @param message EvaluationExpectation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationExpectation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluationExpectation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluationExpectation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EvaluationExpectation { - - /** Properties of a LlmCriteria. */ - interface ILlmCriteria { - - /** LlmCriteria prompt */ - prompt?: (string|null); - } - - /** Represents a LlmCriteria. */ - class LlmCriteria implements ILlmCriteria { - - /** - * Constructs a new LlmCriteria. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria); - - /** LlmCriteria prompt. */ - public prompt: string; - - /** - * Creates a new LlmCriteria instance using the specified properties. - * @param [properties] Properties to set - * @returns LlmCriteria instance - */ - public static create(properties?: google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria): google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria; - - /** - * Encodes the specified LlmCriteria message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.verify|verify} messages. - * @param message LlmCriteria message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LlmCriteria message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.verify|verify} messages. - * @param message LlmCriteria message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LlmCriteria message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LlmCriteria - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria; - - /** - * Decodes a LlmCriteria message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LlmCriteria - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria; - - /** - * Verifies a LlmCriteria message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LlmCriteria message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LlmCriteria - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria; - - /** - * Creates a plain object from a LlmCriteria message. Also converts values to other types if specified. - * @param message LlmCriteria - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LlmCriteria to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LlmCriteria - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EvaluationConfig. */ - interface IEvaluationConfig { - - /** EvaluationConfig inputAudioConfig */ - inputAudioConfig?: (google.cloud.ces.v1beta.IInputAudioConfig|null); - - /** EvaluationConfig outputAudioConfig */ - outputAudioConfig?: (google.cloud.ces.v1beta.IOutputAudioConfig|null); - - /** EvaluationConfig evaluationChannel */ - evaluationChannel?: (google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel|keyof typeof google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel|null); - - /** EvaluationConfig toolCallBehaviour */ - toolCallBehaviour?: (google.cloud.ces.v1beta.EvaluationToolCallBehaviour|keyof typeof google.cloud.ces.v1beta.EvaluationToolCallBehaviour|null); - } - - /** Represents an EvaluationConfig. */ - class EvaluationConfig implements IEvaluationConfig { - - /** - * Constructs a new EvaluationConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IEvaluationConfig); - - /** EvaluationConfig inputAudioConfig. */ - public inputAudioConfig?: (google.cloud.ces.v1beta.IInputAudioConfig|null); - - /** EvaluationConfig outputAudioConfig. */ - public outputAudioConfig?: (google.cloud.ces.v1beta.IOutputAudioConfig|null); - - /** EvaluationConfig evaluationChannel. */ - public evaluationChannel: (google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel|keyof typeof google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel); - - /** EvaluationConfig toolCallBehaviour. */ - public toolCallBehaviour: (google.cloud.ces.v1beta.EvaluationToolCallBehaviour|keyof typeof google.cloud.ces.v1beta.EvaluationToolCallBehaviour); - - /** - * Creates a new EvaluationConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluationConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IEvaluationConfig): google.cloud.ces.v1beta.EvaluationConfig; - - /** - * Encodes the specified EvaluationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationConfig.verify|verify} messages. - * @param message EvaluationConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IEvaluationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationConfig.verify|verify} messages. - * @param message EvaluationConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluationConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationConfig; - - /** - * Decodes an EvaluationConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationConfig; - - /** - * Verifies an EvaluationConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EvaluationConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluationConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationConfig; - - /** - * Creates a plain object from an EvaluationConfig message. Also converts values to other types if specified. - * @param message EvaluationConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluationConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluationConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EvaluationConfig { - - /** EvaluationChannel enum. */ - enum EvaluationChannel { - EVALUATION_CHANNEL_UNSPECIFIED = 0, - TEXT = 1, - AUDIO = 2 - } - } - - /** Properties of an EvaluationErrorInfo. */ - interface IEvaluationErrorInfo { - - /** EvaluationErrorInfo errorType */ - errorType?: (google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType|keyof typeof google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType|null); - - /** EvaluationErrorInfo errorMessage */ - errorMessage?: (string|null); - - /** EvaluationErrorInfo sessionId */ - sessionId?: (string|null); - } - - /** Represents an EvaluationErrorInfo. */ - class EvaluationErrorInfo implements IEvaluationErrorInfo { - - /** - * Constructs a new EvaluationErrorInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IEvaluationErrorInfo); - - /** EvaluationErrorInfo errorType. */ - public errorType: (google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType|keyof typeof google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType); - - /** EvaluationErrorInfo errorMessage. */ - public errorMessage: string; - - /** EvaluationErrorInfo sessionId. */ - public sessionId: string; - - /** - * Creates a new EvaluationErrorInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluationErrorInfo instance - */ - public static create(properties?: google.cloud.ces.v1beta.IEvaluationErrorInfo): google.cloud.ces.v1beta.EvaluationErrorInfo; - - /** - * Encodes the specified EvaluationErrorInfo message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationErrorInfo.verify|verify} messages. - * @param message EvaluationErrorInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IEvaluationErrorInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluationErrorInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationErrorInfo.verify|verify} messages. - * @param message EvaluationErrorInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationErrorInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluationErrorInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluationErrorInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationErrorInfo; - - /** - * Decodes an EvaluationErrorInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluationErrorInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationErrorInfo; - - /** - * Verifies an EvaluationErrorInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EvaluationErrorInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluationErrorInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationErrorInfo; - - /** - * Creates a plain object from an EvaluationErrorInfo message. Also converts values to other types if specified. - * @param message EvaluationErrorInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EvaluationErrorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluationErrorInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluationErrorInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EvaluationErrorInfo { - - /** ErrorType enum. */ - enum ErrorType { - ERROR_TYPE_UNSPECIFIED = 0, - RUNTIME_FAILURE = 1, - CONVERSATION_RETRIEVAL_FAILURE = 2, - METRIC_CALCULATION_FAILURE = 3, - EVALUATION_UPDATE_FAILURE = 4, - QUOTA_EXHAUSTED = 5, - USER_SIMULATION_FAILURE = 6 - } - } - - /** Properties of a RunEvaluationRequest. */ - interface IRunEvaluationRequest { - - /** RunEvaluationRequest app */ - app?: (string|null); - - /** RunEvaluationRequest evaluations */ - evaluations?: (string[]|null); - - /** RunEvaluationRequest evaluationDataset */ - evaluationDataset?: (string|null); - - /** RunEvaluationRequest displayName */ - displayName?: (string|null); - - /** RunEvaluationRequest appVersion */ - appVersion?: (string|null); - - /** RunEvaluationRequest config */ - config?: (google.cloud.ces.v1beta.IEvaluationConfig|null); - - /** RunEvaluationRequest runCount */ - runCount?: (number|null); - - /** RunEvaluationRequest personaRunConfigs */ - personaRunConfigs?: (google.cloud.ces.v1beta.IPersonaRunConfig[]|null); - - /** RunEvaluationRequest optimizationConfig */ - optimizationConfig?: (google.cloud.ces.v1beta.IOptimizationConfig|null); - - /** RunEvaluationRequest scheduledEvaluationRun */ - scheduledEvaluationRun?: (string|null); - - /** RunEvaluationRequest goldenRunMethod */ - goldenRunMethod?: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod|null); - - /** RunEvaluationRequest generateLatencyReport */ - generateLatencyReport?: (boolean|null); - } - - /** Represents a RunEvaluationRequest. */ - class RunEvaluationRequest implements IRunEvaluationRequest { - - /** - * Constructs a new RunEvaluationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IRunEvaluationRequest); - - /** RunEvaluationRequest app. */ - public app: string; - - /** RunEvaluationRequest evaluations. */ - public evaluations: string[]; - - /** RunEvaluationRequest evaluationDataset. */ - public evaluationDataset: string; - - /** RunEvaluationRequest displayName. */ - public displayName: string; - - /** RunEvaluationRequest appVersion. */ - public appVersion: string; - - /** RunEvaluationRequest config. */ - public config?: (google.cloud.ces.v1beta.IEvaluationConfig|null); - - /** RunEvaluationRequest runCount. */ - public runCount?: (number|null); - - /** RunEvaluationRequest personaRunConfigs. */ - public personaRunConfigs: google.cloud.ces.v1beta.IPersonaRunConfig[]; - - /** RunEvaluationRequest optimizationConfig. */ - public optimizationConfig?: (google.cloud.ces.v1beta.IOptimizationConfig|null); - - /** RunEvaluationRequest scheduledEvaluationRun. */ - public scheduledEvaluationRun: string; - - /** RunEvaluationRequest goldenRunMethod. */ - public goldenRunMethod: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod); - - /** RunEvaluationRequest generateLatencyReport. */ - public generateLatencyReport: boolean; - - /** - * Creates a new RunEvaluationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RunEvaluationRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IRunEvaluationRequest): google.cloud.ces.v1beta.RunEvaluationRequest; - - /** - * Encodes the specified RunEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationRequest.verify|verify} messages. - * @param message RunEvaluationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IRunEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RunEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationRequest.verify|verify} messages. - * @param message RunEvaluationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IRunEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RunEvaluationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RunEvaluationRequest; - - /** - * Decodes a RunEvaluationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RunEvaluationRequest; - - /** - * Verifies a RunEvaluationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RunEvaluationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunEvaluationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RunEvaluationRequest; - - /** - * Creates a plain object from a RunEvaluationRequest message. Also converts values to other types if specified. - * @param message RunEvaluationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.RunEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunEvaluationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunEvaluationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ScheduledEvaluationRun. */ - interface IScheduledEvaluationRun { - - /** ScheduledEvaluationRun name */ - name?: (string|null); - - /** ScheduledEvaluationRun displayName */ - displayName?: (string|null); - - /** ScheduledEvaluationRun request */ - request?: (google.cloud.ces.v1beta.IRunEvaluationRequest|null); - - /** ScheduledEvaluationRun description */ - description?: (string|null); - - /** ScheduledEvaluationRun schedulingConfig */ - schedulingConfig?: (google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig|null); - - /** ScheduledEvaluationRun active */ - active?: (boolean|null); - - /** ScheduledEvaluationRun lastCompletedRun */ - lastCompletedRun?: (string|null); - - /** ScheduledEvaluationRun totalExecutions */ - totalExecutions?: (number|null); - - /** ScheduledEvaluationRun nextScheduledExecutionTime */ - nextScheduledExecutionTime?: (google.protobuf.ITimestamp|null); - - /** ScheduledEvaluationRun createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ScheduledEvaluationRun createdBy */ - createdBy?: (string|null); - - /** ScheduledEvaluationRun updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** ScheduledEvaluationRun lastUpdatedBy */ - lastUpdatedBy?: (string|null); - - /** ScheduledEvaluationRun etag */ - etag?: (string|null); - } - - /** Represents a ScheduledEvaluationRun. */ - class ScheduledEvaluationRun implements IScheduledEvaluationRun { - - /** - * Constructs a new ScheduledEvaluationRun. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IScheduledEvaluationRun); - - /** ScheduledEvaluationRun name. */ - public name: string; - - /** ScheduledEvaluationRun displayName. */ - public displayName: string; - - /** ScheduledEvaluationRun request. */ - public request?: (google.cloud.ces.v1beta.IRunEvaluationRequest|null); - - /** ScheduledEvaluationRun description. */ - public description: string; - - /** ScheduledEvaluationRun schedulingConfig. */ - public schedulingConfig?: (google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig|null); - - /** ScheduledEvaluationRun active. */ - public active: boolean; - - /** ScheduledEvaluationRun lastCompletedRun. */ - public lastCompletedRun: string; - - /** ScheduledEvaluationRun totalExecutions. */ - public totalExecutions: number; - - /** ScheduledEvaluationRun nextScheduledExecutionTime. */ - public nextScheduledExecutionTime?: (google.protobuf.ITimestamp|null); - - /** ScheduledEvaluationRun createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ScheduledEvaluationRun createdBy. */ - public createdBy: string; - - /** ScheduledEvaluationRun updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** ScheduledEvaluationRun lastUpdatedBy. */ - public lastUpdatedBy: string; - - /** ScheduledEvaluationRun etag. */ - public etag: string; - - /** - * Creates a new ScheduledEvaluationRun instance using the specified properties. - * @param [properties] Properties to set - * @returns ScheduledEvaluationRun instance - */ - public static create(properties?: google.cloud.ces.v1beta.IScheduledEvaluationRun): google.cloud.ces.v1beta.ScheduledEvaluationRun; - - /** - * Encodes the specified ScheduledEvaluationRun message. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.verify|verify} messages. - * @param message ScheduledEvaluationRun message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IScheduledEvaluationRun, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ScheduledEvaluationRun message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.verify|verify} messages. - * @param message ScheduledEvaluationRun message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IScheduledEvaluationRun, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ScheduledEvaluationRun message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ScheduledEvaluationRun - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ScheduledEvaluationRun; - - /** - * Decodes a ScheduledEvaluationRun message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ScheduledEvaluationRun - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ScheduledEvaluationRun; - - /** - * Verifies a ScheduledEvaluationRun message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ScheduledEvaluationRun message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ScheduledEvaluationRun - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ScheduledEvaluationRun; - - /** - * Creates a plain object from a ScheduledEvaluationRun message. Also converts values to other types if specified. - * @param message ScheduledEvaluationRun - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ScheduledEvaluationRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ScheduledEvaluationRun to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ScheduledEvaluationRun - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ScheduledEvaluationRun { - - /** Properties of a SchedulingConfig. */ - interface ISchedulingConfig { - - /** SchedulingConfig frequency */ - frequency?: (google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency|keyof typeof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency|null); - - /** SchedulingConfig startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** SchedulingConfig daysOfWeek */ - daysOfWeek?: (number[]|null); - } - - /** Represents a SchedulingConfig. */ - class SchedulingConfig implements ISchedulingConfig { - - /** - * Constructs a new SchedulingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig); - - /** SchedulingConfig frequency. */ - public frequency: (google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency|keyof typeof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency); - - /** SchedulingConfig startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** SchedulingConfig daysOfWeek. */ - public daysOfWeek: number[]; - - /** - * Creates a new SchedulingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SchedulingConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig): google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig; - - /** - * Encodes the specified SchedulingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.verify|verify} messages. - * @param message SchedulingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SchedulingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.verify|verify} messages. - * @param message SchedulingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SchedulingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SchedulingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig; - - /** - * Decodes a SchedulingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SchedulingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig; - - /** - * Verifies a SchedulingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SchedulingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SchedulingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig; - - /** - * Creates a plain object from a SchedulingConfig message. Also converts values to other types if specified. - * @param message SchedulingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SchedulingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SchedulingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SchedulingConfig { - - /** Frequency enum. */ - enum Frequency { - FREQUENCY_UNSPECIFIED = 0, - NONE = 1, - DAILY = 2, - WEEKLY = 3, - BIWEEKLY = 4 - } - } - } - - /** Properties of a PersonaRunConfig. */ - interface IPersonaRunConfig { - - /** PersonaRunConfig persona */ - persona?: (string|null); - - /** PersonaRunConfig taskCount */ - taskCount?: (number|null); - } - - /** Represents a PersonaRunConfig. */ - class PersonaRunConfig implements IPersonaRunConfig { - - /** - * Constructs a new PersonaRunConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IPersonaRunConfig); - - /** PersonaRunConfig persona. */ - public persona: string; - - /** PersonaRunConfig taskCount. */ - public taskCount: number; - - /** - * Creates a new PersonaRunConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PersonaRunConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IPersonaRunConfig): google.cloud.ces.v1beta.PersonaRunConfig; - - /** - * Encodes the specified PersonaRunConfig message. Does not implicitly {@link google.cloud.ces.v1beta.PersonaRunConfig.verify|verify} messages. - * @param message PersonaRunConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IPersonaRunConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PersonaRunConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.PersonaRunConfig.verify|verify} messages. - * @param message PersonaRunConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IPersonaRunConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PersonaRunConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PersonaRunConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.PersonaRunConfig; - - /** - * Decodes a PersonaRunConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PersonaRunConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.PersonaRunConfig; - - /** - * Verifies a PersonaRunConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PersonaRunConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PersonaRunConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.PersonaRunConfig; - - /** - * Creates a plain object from a PersonaRunConfig message. Also converts values to other types if specified. - * @param message PersonaRunConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.PersonaRunConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PersonaRunConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PersonaRunConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OptimizationConfig. */ - interface IOptimizationConfig { - - /** OptimizationConfig generateLossReport */ - generateLossReport?: (boolean|null); - - /** OptimizationConfig assistantSession */ - assistantSession?: (string|null); - - /** OptimizationConfig reportSummary */ - reportSummary?: (string|null); - - /** OptimizationConfig shouldSuggestFix */ - shouldSuggestFix?: (boolean|null); - - /** OptimizationConfig status */ - status?: (google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus|keyof typeof google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus|null); - - /** OptimizationConfig errorMessage */ - errorMessage?: (string|null); - - /** OptimizationConfig lossReport */ - lossReport?: (google.protobuf.IStruct|null); - } - - /** Represents an OptimizationConfig. */ - class OptimizationConfig implements IOptimizationConfig { - - /** - * Constructs a new OptimizationConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IOptimizationConfig); - - /** OptimizationConfig generateLossReport. */ - public generateLossReport: boolean; - - /** OptimizationConfig assistantSession. */ - public assistantSession: string; - - /** OptimizationConfig reportSummary. */ - public reportSummary: string; - - /** OptimizationConfig shouldSuggestFix. */ - public shouldSuggestFix: boolean; - - /** OptimizationConfig status. */ - public status: (google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus|keyof typeof google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus); - - /** OptimizationConfig errorMessage. */ - public errorMessage: string; - - /** OptimizationConfig lossReport. */ - public lossReport?: (google.protobuf.IStruct|null); - - /** - * Creates a new OptimizationConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns OptimizationConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IOptimizationConfig): google.cloud.ces.v1beta.OptimizationConfig; - - /** - * Encodes the specified OptimizationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OptimizationConfig.verify|verify} messages. - * @param message OptimizationConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IOptimizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OptimizationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OptimizationConfig.verify|verify} messages. - * @param message OptimizationConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IOptimizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OptimizationConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OptimizationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OptimizationConfig; - - /** - * Decodes an OptimizationConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OptimizationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OptimizationConfig; - - /** - * Verifies an OptimizationConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OptimizationConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OptimizationConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OptimizationConfig; - - /** - * Creates a plain object from an OptimizationConfig message. Also converts values to other types if specified. - * @param message OptimizationConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.OptimizationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OptimizationConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OptimizationConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace OptimizationConfig { - - /** OptimizationStatus enum. */ - enum OptimizationStatus { - OPTIMIZATION_STATUS_UNSPECIFIED = 0, - RUNNING = 1, - COMPLETED = 2, - ERROR = 3 - } - } - - /** Represents a SessionService */ - class SessionService extends $protobuf.rpc.Service { - - /** - * Constructs a new SessionService 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 SessionService 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): SessionService; - - /** - * Calls RunSession. - * @param request RunSessionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RunSessionResponse - */ - public runSession(request: google.cloud.ces.v1beta.IRunSessionRequest, callback: google.cloud.ces.v1beta.SessionService.RunSessionCallback): void; - - /** - * Calls RunSession. - * @param request RunSessionRequest message or plain object - * @returns Promise - */ - public runSession(request: google.cloud.ces.v1beta.IRunSessionRequest): Promise; - - /** - * Calls BidiRunSession. - * @param request BidiSessionClientMessage message or plain object - * @param callback Node-style callback called with the error, if any, and BidiSessionServerMessage - */ - public bidiRunSession(request: google.cloud.ces.v1beta.IBidiSessionClientMessage, callback: google.cloud.ces.v1beta.SessionService.BidiRunSessionCallback): void; - - /** - * Calls BidiRunSession. - * @param request BidiSessionClientMessage message or plain object - * @returns Promise - */ - public bidiRunSession(request: google.cloud.ces.v1beta.IBidiSessionClientMessage): Promise; - } - - namespace SessionService { - - /** - * Callback as used by {@link google.cloud.ces.v1beta.SessionService|runSession}. - * @param error Error, if any - * @param [response] RunSessionResponse - */ - type RunSessionCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.RunSessionResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.SessionService|bidiRunSession}. - * @param error Error, if any - * @param [response] BidiSessionServerMessage - */ - type BidiRunSessionCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.BidiSessionServerMessage) => void; - } - - /** AudioEncoding enum. */ - enum AudioEncoding { - AUDIO_ENCODING_UNSPECIFIED = 0, - LINEAR16 = 1, - MULAW = 2, - ALAW = 3 - } - - /** Properties of an InputAudioConfig. */ - interface IInputAudioConfig { - - /** InputAudioConfig audioEncoding */ - audioEncoding?: (google.cloud.ces.v1beta.AudioEncoding|keyof typeof google.cloud.ces.v1beta.AudioEncoding|null); - - /** InputAudioConfig sampleRateHertz */ - sampleRateHertz?: (number|null); - - /** InputAudioConfig noiseSuppressionLevel */ - noiseSuppressionLevel?: (string|null); - } - - /** Represents an InputAudioConfig. */ - class InputAudioConfig implements IInputAudioConfig { - - /** - * Constructs a new InputAudioConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IInputAudioConfig); - - /** InputAudioConfig audioEncoding. */ - public audioEncoding: (google.cloud.ces.v1beta.AudioEncoding|keyof typeof google.cloud.ces.v1beta.AudioEncoding); - - /** InputAudioConfig sampleRateHertz. */ - public sampleRateHertz: number; - - /** InputAudioConfig noiseSuppressionLevel. */ - public noiseSuppressionLevel: string; - - /** - * Creates a new InputAudioConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns InputAudioConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IInputAudioConfig): google.cloud.ces.v1beta.InputAudioConfig; - - /** - * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1beta.InputAudioConfig.verify|verify} messages. - * @param message InputAudioConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.InputAudioConfig.verify|verify} messages. - * @param message InputAudioConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InputAudioConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InputAudioConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.InputAudioConfig; - - /** - * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InputAudioConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.InputAudioConfig; - - /** - * Verifies an InputAudioConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InputAudioConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.InputAudioConfig; - - /** - * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. - * @param message InputAudioConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.InputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InputAudioConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InputAudioConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OutputAudioConfig. */ - interface IOutputAudioConfig { - - /** OutputAudioConfig audioEncoding */ - audioEncoding?: (google.cloud.ces.v1beta.AudioEncoding|keyof typeof google.cloud.ces.v1beta.AudioEncoding|null); - - /** OutputAudioConfig sampleRateHertz */ - sampleRateHertz?: (number|null); - } - - /** Represents an OutputAudioConfig. */ - class OutputAudioConfig implements IOutputAudioConfig { - - /** - * Constructs a new OutputAudioConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IOutputAudioConfig); - - /** OutputAudioConfig audioEncoding. */ - public audioEncoding: (google.cloud.ces.v1beta.AudioEncoding|keyof typeof google.cloud.ces.v1beta.AudioEncoding); - - /** OutputAudioConfig sampleRateHertz. */ - public sampleRateHertz: number; - - /** - * Creates a new OutputAudioConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns OutputAudioConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IOutputAudioConfig): google.cloud.ces.v1beta.OutputAudioConfig; - - /** - * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OutputAudioConfig.verify|verify} messages. - * @param message OutputAudioConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OutputAudioConfig.verify|verify} messages. - * @param message OutputAudioConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OutputAudioConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OutputAudioConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OutputAudioConfig; - - /** - * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OutputAudioConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OutputAudioConfig; - - /** - * Verifies an OutputAudioConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OutputAudioConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OutputAudioConfig; - - /** - * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. - * @param message OutputAudioConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.OutputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OutputAudioConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OutputAudioConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SessionConfig. */ - interface ISessionConfig { - - /** SessionConfig session */ - session?: (string|null); - - /** SessionConfig inputAudioConfig */ - inputAudioConfig?: (google.cloud.ces.v1beta.IInputAudioConfig|null); - - /** SessionConfig outputAudioConfig */ - outputAudioConfig?: (google.cloud.ces.v1beta.IOutputAudioConfig|null); - - /** SessionConfig historicalContexts */ - historicalContexts?: (google.cloud.ces.v1beta.IMessage[]|null); - - /** SessionConfig entryAgent */ - entryAgent?: (string|null); - - /** SessionConfig deployment */ - deployment?: (string|null); - - /** SessionConfig timeZone */ - timeZone?: (string|null); - - /** SessionConfig remoteDialogflowQueryParameters */ - remoteDialogflowQueryParameters?: (google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters|null); - } - - /** Represents a SessionConfig. */ - class SessionConfig implements ISessionConfig { - - /** - * Constructs a new SessionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ISessionConfig); - - /** SessionConfig session. */ - public session: string; - - /** SessionConfig inputAudioConfig. */ - public inputAudioConfig?: (google.cloud.ces.v1beta.IInputAudioConfig|null); - - /** SessionConfig outputAudioConfig. */ - public outputAudioConfig?: (google.cloud.ces.v1beta.IOutputAudioConfig|null); - - /** SessionConfig historicalContexts. */ - public historicalContexts: google.cloud.ces.v1beta.IMessage[]; - - /** SessionConfig entryAgent. */ - public entryAgent: string; - - /** SessionConfig deployment. */ - public deployment: string; - - /** SessionConfig timeZone. */ - public timeZone: string; - - /** SessionConfig remoteDialogflowQueryParameters. */ - public remoteDialogflowQueryParameters?: (google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters|null); - - /** - * Creates a new SessionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SessionConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.ISessionConfig): google.cloud.ces.v1beta.SessionConfig; - - /** - * Encodes the specified SessionConfig message. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.verify|verify} messages. - * @param message SessionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ISessionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SessionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.verify|verify} messages. - * @param message SessionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ISessionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SessionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SessionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SessionConfig; - - /** - * Decodes a SessionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SessionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SessionConfig; - - /** - * Verifies a SessionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SessionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SessionConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SessionConfig; - - /** - * Creates a plain object from a SessionConfig message. Also converts values to other types if specified. - * @param message SessionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.SessionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SessionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SessionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SessionConfig { - - /** Properties of a RemoteDialogflowQueryParameters. */ - interface IRemoteDialogflowQueryParameters { - - /** RemoteDialogflowQueryParameters webhookHeaders */ - webhookHeaders?: ({ [k: string]: string }|null); - - /** RemoteDialogflowQueryParameters payload */ - payload?: (google.protobuf.IStruct|null); - - /** RemoteDialogflowQueryParameters endUserMetadata */ - endUserMetadata?: (google.protobuf.IStruct|null); - } - - /** Represents a RemoteDialogflowQueryParameters. */ - class RemoteDialogflowQueryParameters implements IRemoteDialogflowQueryParameters { - - /** - * Constructs a new RemoteDialogflowQueryParameters. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters); - - /** RemoteDialogflowQueryParameters webhookHeaders. */ - public webhookHeaders: { [k: string]: string }; - - /** RemoteDialogflowQueryParameters payload. */ - public payload?: (google.protobuf.IStruct|null); - - /** RemoteDialogflowQueryParameters endUserMetadata. */ - public endUserMetadata?: (google.protobuf.IStruct|null); - - /** - * Creates a new RemoteDialogflowQueryParameters instance using the specified properties. - * @param [properties] Properties to set - * @returns RemoteDialogflowQueryParameters instance - */ - public static create(properties?: google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters): google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters; - - /** - * Encodes the specified RemoteDialogflowQueryParameters message. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. - * @param message RemoteDialogflowQueryParameters message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RemoteDialogflowQueryParameters message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. - * @param message RemoteDialogflowQueryParameters message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RemoteDialogflowQueryParameters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters; - - /** - * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RemoteDialogflowQueryParameters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters; - - /** - * Verifies a RemoteDialogflowQueryParameters message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RemoteDialogflowQueryParameters message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RemoteDialogflowQueryParameters - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters; - - /** - * Creates a plain object from a RemoteDialogflowQueryParameters message. Also converts values to other types if specified. - * @param message RemoteDialogflowQueryParameters - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RemoteDialogflowQueryParameters to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RemoteDialogflowQueryParameters - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ToolCalls. */ - interface IToolCalls { - - /** ToolCalls toolCalls */ - toolCalls?: (google.cloud.ces.v1beta.IToolCall[]|null); - } - - /** Represents a ToolCalls. */ - class ToolCalls implements IToolCalls { - - /** - * Constructs a new ToolCalls. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IToolCalls); - - /** ToolCalls toolCalls. */ - public toolCalls: google.cloud.ces.v1beta.IToolCall[]; - - /** - * Creates a new ToolCalls instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolCalls instance - */ - public static create(properties?: google.cloud.ces.v1beta.IToolCalls): google.cloud.ces.v1beta.ToolCalls; - - /** - * Encodes the specified ToolCalls message. Does not implicitly {@link google.cloud.ces.v1beta.ToolCalls.verify|verify} messages. - * @param message ToolCalls message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IToolCalls, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolCalls message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolCalls.verify|verify} messages. - * @param message ToolCalls message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IToolCalls, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolCalls message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolCalls - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ToolCalls; - - /** - * Decodes a ToolCalls message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolCalls - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ToolCalls; - - /** - * Verifies a ToolCalls message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolCalls message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolCalls - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ToolCalls; - - /** - * Creates a plain object from a ToolCalls message. Also converts values to other types if specified. - * @param message ToolCalls - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ToolCalls, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolCalls to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolCalls - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ToolResponses. */ - interface IToolResponses { - - /** ToolResponses toolResponses */ - toolResponses?: (google.cloud.ces.v1beta.IToolResponse[]|null); - } - - /** Represents a ToolResponses. */ - class ToolResponses implements IToolResponses { - - /** - * Constructs a new ToolResponses. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IToolResponses); - - /** ToolResponses toolResponses. */ - public toolResponses: google.cloud.ces.v1beta.IToolResponse[]; - - /** - * Creates a new ToolResponses instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolResponses instance - */ - public static create(properties?: google.cloud.ces.v1beta.IToolResponses): google.cloud.ces.v1beta.ToolResponses; - - /** - * Encodes the specified ToolResponses message. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponses.verify|verify} messages. - * @param message ToolResponses message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IToolResponses, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolResponses message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponses.verify|verify} messages. - * @param message ToolResponses message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IToolResponses, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolResponses message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolResponses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ToolResponses; - - /** - * Decodes a ToolResponses message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolResponses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ToolResponses; - - /** - * Verifies a ToolResponses message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolResponses message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolResponses - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ToolResponses; - - /** - * Creates a plain object from a ToolResponses message. Also converts values to other types if specified. - * @param message ToolResponses - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ToolResponses, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolResponses to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolResponses - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Citations. */ - interface ICitations { - - /** Citations citedChunks */ - citedChunks?: (google.cloud.ces.v1beta.Citations.ICitedChunk[]|null); - } - - /** Represents a Citations. */ - class Citations implements ICitations { - - /** - * Constructs a new Citations. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ICitations); - - /** Citations citedChunks. */ - public citedChunks: google.cloud.ces.v1beta.Citations.ICitedChunk[]; - - /** - * Creates a new Citations instance using the specified properties. - * @param [properties] Properties to set - * @returns Citations instance - */ - public static create(properties?: google.cloud.ces.v1beta.ICitations): google.cloud.ces.v1beta.Citations; - - /** - * Encodes the specified Citations message. Does not implicitly {@link google.cloud.ces.v1beta.Citations.verify|verify} messages. - * @param message Citations message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ICitations, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Citations message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Citations.verify|verify} messages. - * @param message Citations message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ICitations, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Citations message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Citations - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Citations; - - /** - * Decodes a Citations message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Citations - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Citations; - - /** - * Verifies a Citations message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Citations message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Citations - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Citations; - - /** - * Creates a plain object from a Citations message. Also converts values to other types if specified. - * @param message Citations - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Citations, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Citations to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Citations - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Citations { - - /** Properties of a CitedChunk. */ - interface ICitedChunk { - - /** CitedChunk uri */ - uri?: (string|null); - - /** CitedChunk title */ - title?: (string|null); - - /** CitedChunk text */ - text?: (string|null); - } - - /** Represents a CitedChunk. */ - class CitedChunk implements ICitedChunk { - - /** - * Constructs a new CitedChunk. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.Citations.ICitedChunk); - - /** CitedChunk uri. */ - public uri: string; - - /** CitedChunk title. */ - public title: string; - - /** CitedChunk text. */ - public text: string; - - /** - * Creates a new CitedChunk instance using the specified properties. - * @param [properties] Properties to set - * @returns CitedChunk instance - */ - public static create(properties?: google.cloud.ces.v1beta.Citations.ICitedChunk): google.cloud.ces.v1beta.Citations.CitedChunk; - - /** - * Encodes the specified CitedChunk message. Does not implicitly {@link google.cloud.ces.v1beta.Citations.CitedChunk.verify|verify} messages. - * @param message CitedChunk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.Citations.ICitedChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CitedChunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Citations.CitedChunk.verify|verify} messages. - * @param message CitedChunk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.Citations.ICitedChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CitedChunk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CitedChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Citations.CitedChunk; - - /** - * Decodes a CitedChunk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CitedChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Citations.CitedChunk; - - /** - * Verifies a CitedChunk message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CitedChunk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CitedChunk - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Citations.CitedChunk; - - /** - * Creates a plain object from a CitedChunk message. Also converts values to other types if specified. - * @param message CitedChunk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Citations.CitedChunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CitedChunk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CitedChunk - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an Event. */ - interface IEvent { - - /** Event event */ - event?: (string|null); - } - - /** Represents an Event. */ - class Event implements IEvent { - - /** - * Constructs a new Event. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IEvent); - - /** Event event. */ - public event: string; - - /** - * Creates a new Event instance using the specified properties. - * @param [properties] Properties to set - * @returns Event instance - */ - public static create(properties?: google.cloud.ces.v1beta.IEvent): google.cloud.ces.v1beta.Event; - - /** - * Encodes the specified Event message. Does not implicitly {@link google.cloud.ces.v1beta.Event.verify|verify} messages. - * @param message Event message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Event.verify|verify} messages. - * @param message Event message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Event message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Event - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Event; - - /** - * Decodes an Event message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Event - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Event; - - /** - * Verifies an Event message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Event message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Event - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Event; - - /** - * Creates a plain object from an Event message. Also converts values to other types if specified. - * @param message Event - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Event, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Event to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Event - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SessionInput. */ - interface ISessionInput { - - /** SessionInput text */ - text?: (string|null); - - /** SessionInput dtmf */ - dtmf?: (string|null); - - /** SessionInput audio */ - audio?: (Uint8Array|Buffer|string|null); - - /** SessionInput toolResponses */ - toolResponses?: (google.cloud.ces.v1beta.IToolResponses|null); - - /** SessionInput image */ - image?: (google.cloud.ces.v1beta.IImage|null); - - /** SessionInput blob */ - blob?: (google.cloud.ces.v1beta.IBlob|null); - - /** SessionInput variables */ - variables?: (google.protobuf.IStruct|null); - - /** SessionInput event */ - event?: (google.cloud.ces.v1beta.IEvent|null); - - /** SessionInput willContinue */ - willContinue?: (boolean|null); - } - - /** Represents a SessionInput. */ - class SessionInput implements ISessionInput { - - /** - * Constructs a new SessionInput. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ISessionInput); - - /** SessionInput text. */ - public text?: (string|null); - - /** SessionInput dtmf. */ - public dtmf?: (string|null); - - /** SessionInput audio. */ - public audio?: (Uint8Array|Buffer|string|null); - - /** SessionInput toolResponses. */ - public toolResponses?: (google.cloud.ces.v1beta.IToolResponses|null); - - /** SessionInput image. */ - public image?: (google.cloud.ces.v1beta.IImage|null); - - /** SessionInput blob. */ - public blob?: (google.cloud.ces.v1beta.IBlob|null); - - /** SessionInput variables. */ - public variables?: (google.protobuf.IStruct|null); - - /** SessionInput event. */ - public event?: (google.cloud.ces.v1beta.IEvent|null); - - /** SessionInput willContinue. */ - public willContinue: boolean; - - /** SessionInput inputType. */ - public inputType?: ("text"|"dtmf"|"audio"|"toolResponses"|"image"|"blob"|"variables"|"event"); - - /** - * Creates a new SessionInput instance using the specified properties. - * @param [properties] Properties to set - * @returns SessionInput instance - */ - public static create(properties?: google.cloud.ces.v1beta.ISessionInput): google.cloud.ces.v1beta.SessionInput; - - /** - * Encodes the specified SessionInput message. Does not implicitly {@link google.cloud.ces.v1beta.SessionInput.verify|verify} messages. - * @param message SessionInput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ISessionInput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SessionInput message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionInput.verify|verify} messages. - * @param message SessionInput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ISessionInput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SessionInput message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SessionInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SessionInput; - - /** - * Decodes a SessionInput message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SessionInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SessionInput; - - /** - * Verifies a SessionInput message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SessionInput message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SessionInput - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SessionInput; - - /** - * Creates a plain object from a SessionInput message. Also converts values to other types if specified. - * @param message SessionInput - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.SessionInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SessionInput to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SessionInput - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SessionOutput. */ - interface ISessionOutput { - - /** SessionOutput text */ - text?: (string|null); - - /** SessionOutput audio */ - audio?: (Uint8Array|Buffer|string|null); - - /** SessionOutput toolCalls */ - toolCalls?: (google.cloud.ces.v1beta.IToolCalls|null); - - /** SessionOutput citations */ - citations?: (google.cloud.ces.v1beta.ICitations|null); - - /** SessionOutput googleSearchSuggestions */ - googleSearchSuggestions?: (google.cloud.ces.v1beta.IGoogleSearchSuggestions|null); - - /** SessionOutput endSession */ - endSession?: (google.cloud.ces.v1beta.IEndSession|null); - - /** SessionOutput payload */ - payload?: (google.protobuf.IStruct|null); - - /** SessionOutput turnIndex */ - turnIndex?: (number|null); - - /** SessionOutput turnCompleted */ - turnCompleted?: (boolean|null); - - /** SessionOutput diagnosticInfo */ - diagnosticInfo?: (google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo|null); - } - - /** Represents a SessionOutput. */ - class SessionOutput implements ISessionOutput { - - /** - * Constructs a new SessionOutput. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ISessionOutput); - - /** SessionOutput text. */ - public text?: (string|null); - - /** SessionOutput audio. */ - public audio?: (Uint8Array|Buffer|string|null); - - /** SessionOutput toolCalls. */ - public toolCalls?: (google.cloud.ces.v1beta.IToolCalls|null); - - /** SessionOutput citations. */ - public citations?: (google.cloud.ces.v1beta.ICitations|null); - - /** SessionOutput googleSearchSuggestions. */ - public googleSearchSuggestions?: (google.cloud.ces.v1beta.IGoogleSearchSuggestions|null); - - /** SessionOutput endSession. */ - public endSession?: (google.cloud.ces.v1beta.IEndSession|null); - - /** SessionOutput payload. */ - public payload?: (google.protobuf.IStruct|null); - - /** SessionOutput turnIndex. */ - public turnIndex: number; - - /** SessionOutput turnCompleted. */ - public turnCompleted: boolean; - - /** SessionOutput diagnosticInfo. */ - public diagnosticInfo?: (google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo|null); - - /** SessionOutput outputType. */ - public outputType?: ("text"|"audio"|"toolCalls"|"citations"|"googleSearchSuggestions"|"endSession"|"payload"); - - /** - * Creates a new SessionOutput instance using the specified properties. - * @param [properties] Properties to set - * @returns SessionOutput instance - */ - public static create(properties?: google.cloud.ces.v1beta.ISessionOutput): google.cloud.ces.v1beta.SessionOutput; - - /** - * Encodes the specified SessionOutput message. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.verify|verify} messages. - * @param message SessionOutput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ISessionOutput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SessionOutput message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.verify|verify} messages. - * @param message SessionOutput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ISessionOutput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SessionOutput message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SessionOutput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SessionOutput; - - /** - * Decodes a SessionOutput message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SessionOutput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SessionOutput; - - /** - * Verifies a SessionOutput message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SessionOutput message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SessionOutput - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SessionOutput; - - /** - * Creates a plain object from a SessionOutput message. Also converts values to other types if specified. - * @param message SessionOutput - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.SessionOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SessionOutput to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SessionOutput - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SessionOutput { - - /** Properties of a DiagnosticInfo. */ - interface IDiagnosticInfo { - - /** DiagnosticInfo messages */ - messages?: (google.cloud.ces.v1beta.IMessage[]|null); - - /** DiagnosticInfo rootSpan */ - rootSpan?: (google.cloud.ces.v1beta.ISpan|null); - } - - /** Represents a DiagnosticInfo. */ - class DiagnosticInfo implements IDiagnosticInfo { - - /** - * Constructs a new DiagnosticInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo); - - /** DiagnosticInfo messages. */ - public messages: google.cloud.ces.v1beta.IMessage[]; - - /** DiagnosticInfo rootSpan. */ - public rootSpan?: (google.cloud.ces.v1beta.ISpan|null); - - /** - * Creates a new DiagnosticInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns DiagnosticInfo instance - */ - public static create(properties?: google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo): google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo; - - /** - * Encodes the specified DiagnosticInfo message. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.verify|verify} messages. - * @param message DiagnosticInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DiagnosticInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.verify|verify} messages. - * @param message DiagnosticInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DiagnosticInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DiagnosticInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo; - - /** - * Decodes a DiagnosticInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DiagnosticInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo; - - /** - * Verifies a DiagnosticInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DiagnosticInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DiagnosticInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo; - - /** - * Creates a plain object from a DiagnosticInfo message. Also converts values to other types if specified. - * @param message DiagnosticInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DiagnosticInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DiagnosticInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a RecognitionResult. */ - interface IRecognitionResult { - - /** RecognitionResult transcript */ - transcript?: (string|null); - } - - /** Represents a RecognitionResult. */ - class RecognitionResult implements IRecognitionResult { - - /** - * Constructs a new RecognitionResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IRecognitionResult); - - /** RecognitionResult transcript. */ - public transcript: string; - - /** - * Creates a new RecognitionResult instance using the specified properties. - * @param [properties] Properties to set - * @returns RecognitionResult instance - */ - public static create(properties?: google.cloud.ces.v1beta.IRecognitionResult): google.cloud.ces.v1beta.RecognitionResult; - - /** - * Encodes the specified RecognitionResult message. Does not implicitly {@link google.cloud.ces.v1beta.RecognitionResult.verify|verify} messages. - * @param message RecognitionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RecognitionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RecognitionResult.verify|verify} messages. - * @param message RecognitionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RecognitionResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RecognitionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RecognitionResult; - - /** - * Decodes a RecognitionResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RecognitionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RecognitionResult; - - /** - * Verifies a RecognitionResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RecognitionResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RecognitionResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RecognitionResult; - - /** - * Creates a plain object from a RecognitionResult message. Also converts values to other types if specified. - * @param message RecognitionResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.RecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RecognitionResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RecognitionResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InterruptionSignal. */ - interface IInterruptionSignal { - - /** InterruptionSignal bargeIn */ - bargeIn?: (boolean|null); - } - - /** Represents an InterruptionSignal. */ - class InterruptionSignal implements IInterruptionSignal { - - /** - * Constructs a new InterruptionSignal. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IInterruptionSignal); - - /** InterruptionSignal bargeIn. */ - public bargeIn: boolean; - - /** - * Creates a new InterruptionSignal instance using the specified properties. - * @param [properties] Properties to set - * @returns InterruptionSignal instance - */ - public static create(properties?: google.cloud.ces.v1beta.IInterruptionSignal): google.cloud.ces.v1beta.InterruptionSignal; - - /** - * Encodes the specified InterruptionSignal message. Does not implicitly {@link google.cloud.ces.v1beta.InterruptionSignal.verify|verify} messages. - * @param message InterruptionSignal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IInterruptionSignal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InterruptionSignal message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.InterruptionSignal.verify|verify} messages. - * @param message InterruptionSignal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IInterruptionSignal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InterruptionSignal message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InterruptionSignal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.InterruptionSignal; - - /** - * Decodes an InterruptionSignal message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InterruptionSignal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.InterruptionSignal; - - /** - * Verifies an InterruptionSignal message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InterruptionSignal message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InterruptionSignal - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.InterruptionSignal; - - /** - * Creates a plain object from an InterruptionSignal message. Also converts values to other types if specified. - * @param message InterruptionSignal - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.InterruptionSignal, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InterruptionSignal to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InterruptionSignal - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EndSession. */ - interface IEndSession { - - /** EndSession metadata */ - metadata?: (google.protobuf.IStruct|null); - } - - /** Represents an EndSession. */ - class EndSession implements IEndSession { - - /** - * Constructs a new EndSession. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IEndSession); - - /** EndSession metadata. */ - public metadata?: (google.protobuf.IStruct|null); - - /** - * Creates a new EndSession instance using the specified properties. - * @param [properties] Properties to set - * @returns EndSession instance - */ - public static create(properties?: google.cloud.ces.v1beta.IEndSession): google.cloud.ces.v1beta.EndSession; - - /** - * Encodes the specified EndSession message. Does not implicitly {@link google.cloud.ces.v1beta.EndSession.verify|verify} messages. - * @param message EndSession message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IEndSession, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EndSession message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndSession.verify|verify} messages. - * @param message EndSession message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IEndSession, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EndSession message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EndSession - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EndSession; - - /** - * Decodes an EndSession message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EndSession - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EndSession; - - /** - * Verifies an EndSession message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EndSession message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EndSession - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EndSession; - - /** - * Creates a plain object from an EndSession message. Also converts values to other types if specified. - * @param message EndSession - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.EndSession, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EndSession to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EndSession - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoAway. */ - interface IGoAway { - } - - /** Represents a GoAway. */ - class GoAway implements IGoAway { - - /** - * Constructs a new GoAway. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGoAway); - - /** - * Creates a new GoAway instance using the specified properties. - * @param [properties] Properties to set - * @returns GoAway instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGoAway): google.cloud.ces.v1beta.GoAway; - - /** - * Encodes the specified GoAway message. Does not implicitly {@link google.cloud.ces.v1beta.GoAway.verify|verify} messages. - * @param message GoAway message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGoAway, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoAway message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoAway.verify|verify} messages. - * @param message GoAway message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGoAway, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoAway message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoAway - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GoAway; - - /** - * Decodes a GoAway message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoAway - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GoAway; - - /** - * Verifies a GoAway message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoAway message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoAway - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GoAway; - - /** - * Creates a plain object from a GoAway message. Also converts values to other types if specified. - * @param message GoAway - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GoAway, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoAway to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoAway - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RunSessionRequest. */ - interface IRunSessionRequest { - - /** RunSessionRequest config */ - config?: (google.cloud.ces.v1beta.ISessionConfig|null); - - /** RunSessionRequest inputs */ - inputs?: (google.cloud.ces.v1beta.ISessionInput[]|null); - } - - /** Represents a RunSessionRequest. */ - class RunSessionRequest implements IRunSessionRequest { - - /** - * Constructs a new RunSessionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IRunSessionRequest); - - /** RunSessionRequest config. */ - public config?: (google.cloud.ces.v1beta.ISessionConfig|null); - - /** RunSessionRequest inputs. */ - public inputs: google.cloud.ces.v1beta.ISessionInput[]; - - /** - * Creates a new RunSessionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RunSessionRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IRunSessionRequest): google.cloud.ces.v1beta.RunSessionRequest; - - /** - * Encodes the specified RunSessionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionRequest.verify|verify} messages. - * @param message RunSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IRunSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RunSessionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionRequest.verify|verify} messages. - * @param message RunSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IRunSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RunSessionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RunSessionRequest; - - /** - * Decodes a RunSessionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RunSessionRequest; - - /** - * Verifies a RunSessionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RunSessionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunSessionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RunSessionRequest; - - /** - * Creates a plain object from a RunSessionRequest message. Also converts values to other types if specified. - * @param message RunSessionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.RunSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunSessionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunSessionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RunSessionResponse. */ - interface IRunSessionResponse { - - /** RunSessionResponse outputs */ - outputs?: (google.cloud.ces.v1beta.ISessionOutput[]|null); - } - - /** Represents a RunSessionResponse. */ - class RunSessionResponse implements IRunSessionResponse { - - /** - * Constructs a new RunSessionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IRunSessionResponse); - - /** RunSessionResponse outputs. */ - public outputs: google.cloud.ces.v1beta.ISessionOutput[]; - - /** - * Creates a new RunSessionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RunSessionResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IRunSessionResponse): google.cloud.ces.v1beta.RunSessionResponse; - - /** - * Encodes the specified RunSessionResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionResponse.verify|verify} messages. - * @param message RunSessionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IRunSessionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RunSessionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionResponse.verify|verify} messages. - * @param message RunSessionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IRunSessionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RunSessionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunSessionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RunSessionResponse; - - /** - * Decodes a RunSessionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunSessionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RunSessionResponse; - - /** - * Verifies a RunSessionResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RunSessionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunSessionResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RunSessionResponse; - - /** - * Creates a plain object from a RunSessionResponse message. Also converts values to other types if specified. - * @param message RunSessionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.RunSessionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunSessionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunSessionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BidiSessionClientMessage. */ - interface IBidiSessionClientMessage { - - /** BidiSessionClientMessage config */ - config?: (google.cloud.ces.v1beta.ISessionConfig|null); - - /** BidiSessionClientMessage realtimeInput */ - realtimeInput?: (google.cloud.ces.v1beta.ISessionInput|null); - } - - /** Represents a BidiSessionClientMessage. */ - class BidiSessionClientMessage implements IBidiSessionClientMessage { - - /** - * Constructs a new BidiSessionClientMessage. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IBidiSessionClientMessage); - - /** BidiSessionClientMessage config. */ - public config?: (google.cloud.ces.v1beta.ISessionConfig|null); - - /** BidiSessionClientMessage realtimeInput. */ - public realtimeInput?: (google.cloud.ces.v1beta.ISessionInput|null); - - /** BidiSessionClientMessage messageType. */ - public messageType?: ("config"|"realtimeInput"); - - /** - * Creates a new BidiSessionClientMessage instance using the specified properties. - * @param [properties] Properties to set - * @returns BidiSessionClientMessage instance - */ - public static create(properties?: google.cloud.ces.v1beta.IBidiSessionClientMessage): google.cloud.ces.v1beta.BidiSessionClientMessage; - - /** - * Encodes the specified BidiSessionClientMessage message. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionClientMessage.verify|verify} messages. - * @param message BidiSessionClientMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IBidiSessionClientMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BidiSessionClientMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionClientMessage.verify|verify} messages. - * @param message BidiSessionClientMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IBidiSessionClientMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BidiSessionClientMessage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BidiSessionClientMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BidiSessionClientMessage; - - /** - * Decodes a BidiSessionClientMessage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BidiSessionClientMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BidiSessionClientMessage; - - /** - * Verifies a BidiSessionClientMessage message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BidiSessionClientMessage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BidiSessionClientMessage - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BidiSessionClientMessage; - - /** - * Creates a plain object from a BidiSessionClientMessage message. Also converts values to other types if specified. - * @param message BidiSessionClientMessage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.BidiSessionClientMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BidiSessionClientMessage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BidiSessionClientMessage - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BidiSessionServerMessage. */ - interface IBidiSessionServerMessage { - - /** BidiSessionServerMessage sessionOutput */ - sessionOutput?: (google.cloud.ces.v1beta.ISessionOutput|null); - - /** BidiSessionServerMessage recognitionResult */ - recognitionResult?: (google.cloud.ces.v1beta.IRecognitionResult|null); - - /** BidiSessionServerMessage interruptionSignal */ - interruptionSignal?: (google.cloud.ces.v1beta.IInterruptionSignal|null); - - /** BidiSessionServerMessage endSession */ - endSession?: (google.cloud.ces.v1beta.IEndSession|null); - - /** BidiSessionServerMessage goAway */ - goAway?: (google.cloud.ces.v1beta.IGoAway|null); - } - - /** Represents a BidiSessionServerMessage. */ - class BidiSessionServerMessage implements IBidiSessionServerMessage { - - /** - * Constructs a new BidiSessionServerMessage. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IBidiSessionServerMessage); - - /** BidiSessionServerMessage sessionOutput. */ - public sessionOutput?: (google.cloud.ces.v1beta.ISessionOutput|null); - - /** BidiSessionServerMessage recognitionResult. */ - public recognitionResult?: (google.cloud.ces.v1beta.IRecognitionResult|null); - - /** BidiSessionServerMessage interruptionSignal. */ - public interruptionSignal?: (google.cloud.ces.v1beta.IInterruptionSignal|null); - - /** BidiSessionServerMessage endSession. */ - public endSession?: (google.cloud.ces.v1beta.IEndSession|null); - - /** BidiSessionServerMessage goAway. */ - public goAway?: (google.cloud.ces.v1beta.IGoAway|null); - - /** BidiSessionServerMessage messageType. */ - public messageType?: ("sessionOutput"|"recognitionResult"|"interruptionSignal"|"endSession"|"goAway"); - - /** - * Creates a new BidiSessionServerMessage instance using the specified properties. - * @param [properties] Properties to set - * @returns BidiSessionServerMessage instance - */ - public static create(properties?: google.cloud.ces.v1beta.IBidiSessionServerMessage): google.cloud.ces.v1beta.BidiSessionServerMessage; - - /** - * Encodes the specified BidiSessionServerMessage message. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionServerMessage.verify|verify} messages. - * @param message BidiSessionServerMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IBidiSessionServerMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BidiSessionServerMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionServerMessage.verify|verify} messages. - * @param message BidiSessionServerMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IBidiSessionServerMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BidiSessionServerMessage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BidiSessionServerMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BidiSessionServerMessage; - - /** - * Decodes a BidiSessionServerMessage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BidiSessionServerMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BidiSessionServerMessage; - - /** - * Verifies a BidiSessionServerMessage message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BidiSessionServerMessage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BidiSessionServerMessage - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BidiSessionServerMessage; - - /** - * Creates a plain object from a BidiSessionServerMessage message. Also converts values to other types if specified. - * @param message BidiSessionServerMessage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.BidiSessionServerMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BidiSessionServerMessage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BidiSessionServerMessage - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoogleSearchSuggestions. */ - interface IGoogleSearchSuggestions { - - /** GoogleSearchSuggestions htmls */ - htmls?: (string[]|null); - - /** GoogleSearchSuggestions webSearchQueries */ - webSearchQueries?: (google.cloud.ces.v1beta.IWebSearchQuery[]|null); - } - - /** Represents a GoogleSearchSuggestions. */ - class GoogleSearchSuggestions implements IGoogleSearchSuggestions { - - /** - * Constructs a new GoogleSearchSuggestions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGoogleSearchSuggestions); - - /** GoogleSearchSuggestions htmls. */ - public htmls: string[]; - - /** GoogleSearchSuggestions webSearchQueries. */ - public webSearchQueries: google.cloud.ces.v1beta.IWebSearchQuery[]; - - /** - * Creates a new GoogleSearchSuggestions instance using the specified properties. - * @param [properties] Properties to set - * @returns GoogleSearchSuggestions instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGoogleSearchSuggestions): google.cloud.ces.v1beta.GoogleSearchSuggestions; - - /** - * Encodes the specified GoogleSearchSuggestions message. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchSuggestions.verify|verify} messages. - * @param message GoogleSearchSuggestions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGoogleSearchSuggestions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoogleSearchSuggestions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchSuggestions.verify|verify} messages. - * @param message GoogleSearchSuggestions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGoogleSearchSuggestions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoogleSearchSuggestions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoogleSearchSuggestions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GoogleSearchSuggestions; - - /** - * Decodes a GoogleSearchSuggestions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoogleSearchSuggestions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GoogleSearchSuggestions; - - /** - * Verifies a GoogleSearchSuggestions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoogleSearchSuggestions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoogleSearchSuggestions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GoogleSearchSuggestions; - - /** - * Creates a plain object from a GoogleSearchSuggestions message. Also converts values to other types if specified. - * @param message GoogleSearchSuggestions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GoogleSearchSuggestions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoogleSearchSuggestions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoogleSearchSuggestions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WebSearchQuery. */ - interface IWebSearchQuery { - - /** WebSearchQuery query */ - query?: (string|null); - - /** WebSearchQuery uri */ - uri?: (string|null); - } - - /** Represents a WebSearchQuery. */ - class WebSearchQuery implements IWebSearchQuery { - - /** - * Constructs a new WebSearchQuery. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IWebSearchQuery); - - /** WebSearchQuery query. */ - public query: string; - - /** WebSearchQuery uri. */ - public uri: string; - - /** - * Creates a new WebSearchQuery instance using the specified properties. - * @param [properties] Properties to set - * @returns WebSearchQuery instance - */ - public static create(properties?: google.cloud.ces.v1beta.IWebSearchQuery): google.cloud.ces.v1beta.WebSearchQuery; - - /** - * Encodes the specified WebSearchQuery message. Does not implicitly {@link google.cloud.ces.v1beta.WebSearchQuery.verify|verify} messages. - * @param message WebSearchQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IWebSearchQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WebSearchQuery message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.WebSearchQuery.verify|verify} messages. - * @param message WebSearchQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IWebSearchQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WebSearchQuery message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WebSearchQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.WebSearchQuery; - - /** - * Decodes a WebSearchQuery message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WebSearchQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.WebSearchQuery; - - /** - * Verifies a WebSearchQuery message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WebSearchQuery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WebSearchQuery - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.WebSearchQuery; - - /** - * Creates a plain object from a WebSearchQuery message. Also converts values to other types if specified. - * @param message WebSearchQuery - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.WebSearchQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WebSearchQuery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WebSearchQuery - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents an EvaluationService */ - class EvaluationService extends $protobuf.rpc.Service { - - /** - * Constructs a new EvaluationService 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 EvaluationService 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): EvaluationService; - - /** - * Calls RunEvaluation. - * @param request RunEvaluationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public runEvaluation(request: google.cloud.ces.v1beta.IRunEvaluationRequest, callback: google.cloud.ces.v1beta.EvaluationService.RunEvaluationCallback): void; - - /** - * Calls RunEvaluation. - * @param request RunEvaluationRequest message or plain object - * @returns Promise - */ - public runEvaluation(request: google.cloud.ces.v1beta.IRunEvaluationRequest): Promise; - - /** - * Calls UploadEvaluationAudio. - * @param request UploadEvaluationAudioRequest message or plain object - * @param callback Node-style callback called with the error, if any, and UploadEvaluationAudioResponse - */ - public uploadEvaluationAudio(request: google.cloud.ces.v1beta.IUploadEvaluationAudioRequest, callback: google.cloud.ces.v1beta.EvaluationService.UploadEvaluationAudioCallback): void; - - /** - * Calls UploadEvaluationAudio. - * @param request UploadEvaluationAudioRequest message or plain object - * @returns Promise - */ - public uploadEvaluationAudio(request: google.cloud.ces.v1beta.IUploadEvaluationAudioRequest): Promise; - - /** - * Calls CreateEvaluation. - * @param request CreateEvaluationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Evaluation - */ - public createEvaluation(request: google.cloud.ces.v1beta.ICreateEvaluationRequest, callback: google.cloud.ces.v1beta.EvaluationService.CreateEvaluationCallback): void; - - /** - * Calls CreateEvaluation. - * @param request CreateEvaluationRequest message or plain object - * @returns Promise - */ - public createEvaluation(request: google.cloud.ces.v1beta.ICreateEvaluationRequest): Promise; - - /** - * Calls GenerateEvaluation. - * @param request GenerateEvaluationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public generateEvaluation(request: google.cloud.ces.v1beta.IGenerateEvaluationRequest, callback: google.cloud.ces.v1beta.EvaluationService.GenerateEvaluationCallback): void; - - /** - * Calls GenerateEvaluation. - * @param request GenerateEvaluationRequest message or plain object - * @returns Promise - */ - public generateEvaluation(request: google.cloud.ces.v1beta.IGenerateEvaluationRequest): Promise; - - /** - * Calls ImportEvaluations. - * @param request ImportEvaluationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public importEvaluations(request: google.cloud.ces.v1beta.IImportEvaluationsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ImportEvaluationsCallback): void; - - /** - * Calls ImportEvaluations. - * @param request ImportEvaluationsRequest message or plain object - * @returns Promise - */ - public importEvaluations(request: google.cloud.ces.v1beta.IImportEvaluationsRequest): Promise; - - /** - * Calls CreateEvaluationDataset. - * @param request CreateEvaluationDatasetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EvaluationDataset - */ - public createEvaluationDataset(request: google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest, callback: google.cloud.ces.v1beta.EvaluationService.CreateEvaluationDatasetCallback): void; - - /** - * Calls CreateEvaluationDataset. - * @param request CreateEvaluationDatasetRequest message or plain object - * @returns Promise - */ - public createEvaluationDataset(request: google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest): Promise; - - /** - * Calls UpdateEvaluation. - * @param request UpdateEvaluationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Evaluation - */ - public updateEvaluation(request: google.cloud.ces.v1beta.IUpdateEvaluationRequest, callback: google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationCallback): void; - - /** - * Calls UpdateEvaluation. - * @param request UpdateEvaluationRequest message or plain object - * @returns Promise - */ - public updateEvaluation(request: google.cloud.ces.v1beta.IUpdateEvaluationRequest): Promise; - - /** - * Calls UpdateEvaluationDataset. - * @param request UpdateEvaluationDatasetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EvaluationDataset - */ - public updateEvaluationDataset(request: google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest, callback: google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationDatasetCallback): void; - - /** - * Calls UpdateEvaluationDataset. - * @param request UpdateEvaluationDatasetRequest message or plain object - * @returns Promise - */ - public updateEvaluationDataset(request: google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest): Promise; - - /** - * Calls DeleteEvaluation. - * @param request DeleteEvaluationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteEvaluation(request: google.cloud.ces.v1beta.IDeleteEvaluationRequest, callback: google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationCallback): void; - - /** - * Calls DeleteEvaluation. - * @param request DeleteEvaluationRequest message or plain object - * @returns Promise - */ - public deleteEvaluation(request: google.cloud.ces.v1beta.IDeleteEvaluationRequest): Promise; - - /** - * Calls DeleteEvaluationResult. - * @param request DeleteEvaluationResultRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteEvaluationResult(request: google.cloud.ces.v1beta.IDeleteEvaluationResultRequest, callback: google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationResultCallback): void; - - /** - * Calls DeleteEvaluationResult. - * @param request DeleteEvaluationResultRequest message or plain object - * @returns Promise - */ - public deleteEvaluationResult(request: google.cloud.ces.v1beta.IDeleteEvaluationResultRequest): Promise; - - /** - * Calls DeleteEvaluationDataset. - * @param request DeleteEvaluationDatasetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteEvaluationDataset(request: google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest, callback: google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationDatasetCallback): void; - - /** - * Calls DeleteEvaluationDataset. - * @param request DeleteEvaluationDatasetRequest message or plain object - * @returns Promise - */ - public deleteEvaluationDataset(request: google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest): Promise; - - /** - * Calls DeleteEvaluationRun. - * @param request DeleteEvaluationRunRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteEvaluationRun(request: google.cloud.ces.v1beta.IDeleteEvaluationRunRequest, callback: google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationRunCallback): void; - - /** - * Calls DeleteEvaluationRun. - * @param request DeleteEvaluationRunRequest message or plain object - * @returns Promise - */ - public deleteEvaluationRun(request: google.cloud.ces.v1beta.IDeleteEvaluationRunRequest): Promise; - - /** - * Calls GetEvaluation. - * @param request GetEvaluationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Evaluation - */ - public getEvaluation(request: google.cloud.ces.v1beta.IGetEvaluationRequest, callback: google.cloud.ces.v1beta.EvaluationService.GetEvaluationCallback): void; - - /** - * Calls GetEvaluation. - * @param request GetEvaluationRequest message or plain object - * @returns Promise - */ - public getEvaluation(request: google.cloud.ces.v1beta.IGetEvaluationRequest): Promise; - - /** - * Calls GetEvaluationResult. - * @param request GetEvaluationResultRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EvaluationResult - */ - public getEvaluationResult(request: google.cloud.ces.v1beta.IGetEvaluationResultRequest, callback: google.cloud.ces.v1beta.EvaluationService.GetEvaluationResultCallback): void; - - /** - * Calls GetEvaluationResult. - * @param request GetEvaluationResultRequest message or plain object - * @returns Promise - */ - public getEvaluationResult(request: google.cloud.ces.v1beta.IGetEvaluationResultRequest): Promise; - - /** - * Calls GetEvaluationDataset. - * @param request GetEvaluationDatasetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EvaluationDataset - */ - public getEvaluationDataset(request: google.cloud.ces.v1beta.IGetEvaluationDatasetRequest, callback: google.cloud.ces.v1beta.EvaluationService.GetEvaluationDatasetCallback): void; - - /** - * Calls GetEvaluationDataset. - * @param request GetEvaluationDatasetRequest message or plain object - * @returns Promise - */ - public getEvaluationDataset(request: google.cloud.ces.v1beta.IGetEvaluationDatasetRequest): Promise; - - /** - * Calls GetEvaluationRun. - * @param request GetEvaluationRunRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EvaluationRun - */ - public getEvaluationRun(request: google.cloud.ces.v1beta.IGetEvaluationRunRequest, callback: google.cloud.ces.v1beta.EvaluationService.GetEvaluationRunCallback): void; - - /** - * Calls GetEvaluationRun. - * @param request GetEvaluationRunRequest message or plain object - * @returns Promise - */ - public getEvaluationRun(request: google.cloud.ces.v1beta.IGetEvaluationRunRequest): Promise; - - /** - * Calls ListEvaluations. - * @param request ListEvaluationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListEvaluationsResponse - */ - public listEvaluations(request: google.cloud.ces.v1beta.IListEvaluationsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ListEvaluationsCallback): void; - - /** - * Calls ListEvaluations. - * @param request ListEvaluationsRequest message or plain object - * @returns Promise - */ - public listEvaluations(request: google.cloud.ces.v1beta.IListEvaluationsRequest): Promise; - - /** - * Calls ListEvaluationResults. - * @param request ListEvaluationResultsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListEvaluationResultsResponse - */ - public listEvaluationResults(request: google.cloud.ces.v1beta.IListEvaluationResultsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ListEvaluationResultsCallback): void; - - /** - * Calls ListEvaluationResults. - * @param request ListEvaluationResultsRequest message or plain object - * @returns Promise - */ - public listEvaluationResults(request: google.cloud.ces.v1beta.IListEvaluationResultsRequest): Promise; - - /** - * Calls ListEvaluationDatasets. - * @param request ListEvaluationDatasetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListEvaluationDatasetsResponse - */ - public listEvaluationDatasets(request: google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ListEvaluationDatasetsCallback): void; - - /** - * Calls ListEvaluationDatasets. - * @param request ListEvaluationDatasetsRequest message or plain object - * @returns Promise - */ - public listEvaluationDatasets(request: google.cloud.ces.v1beta.IListEvaluationDatasetsRequest): Promise; - - /** - * Calls ListEvaluationRuns. - * @param request ListEvaluationRunsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListEvaluationRunsResponse - */ - public listEvaluationRuns(request: google.cloud.ces.v1beta.IListEvaluationRunsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ListEvaluationRunsCallback): void; - - /** - * Calls ListEvaluationRuns. - * @param request ListEvaluationRunsRequest message or plain object - * @returns Promise - */ - public listEvaluationRuns(request: google.cloud.ces.v1beta.IListEvaluationRunsRequest): Promise; - - /** - * Calls ListEvaluationExpectations. - * @param request ListEvaluationExpectationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListEvaluationExpectationsResponse - */ - public listEvaluationExpectations(request: google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ListEvaluationExpectationsCallback): void; - - /** - * Calls ListEvaluationExpectations. - * @param request ListEvaluationExpectationsRequest message or plain object - * @returns Promise - */ - public listEvaluationExpectations(request: google.cloud.ces.v1beta.IListEvaluationExpectationsRequest): Promise; - - /** - * Calls GetEvaluationExpectation. - * @param request GetEvaluationExpectationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EvaluationExpectation - */ - public getEvaluationExpectation(request: google.cloud.ces.v1beta.IGetEvaluationExpectationRequest, callback: google.cloud.ces.v1beta.EvaluationService.GetEvaluationExpectationCallback): void; - - /** - * Calls GetEvaluationExpectation. - * @param request GetEvaluationExpectationRequest message or plain object - * @returns Promise - */ - public getEvaluationExpectation(request: google.cloud.ces.v1beta.IGetEvaluationExpectationRequest): Promise; - - /** - * Calls CreateEvaluationExpectation. - * @param request CreateEvaluationExpectationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EvaluationExpectation - */ - public createEvaluationExpectation(request: google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest, callback: google.cloud.ces.v1beta.EvaluationService.CreateEvaluationExpectationCallback): void; - - /** - * Calls CreateEvaluationExpectation. - * @param request CreateEvaluationExpectationRequest message or plain object - * @returns Promise - */ - public createEvaluationExpectation(request: google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest): Promise; - - /** - * Calls UpdateEvaluationExpectation. - * @param request UpdateEvaluationExpectationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EvaluationExpectation - */ - public updateEvaluationExpectation(request: google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest, callback: google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationExpectationCallback): void; - - /** - * Calls UpdateEvaluationExpectation. - * @param request UpdateEvaluationExpectationRequest message or plain object - * @returns Promise - */ - public updateEvaluationExpectation(request: google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest): Promise; - - /** - * Calls DeleteEvaluationExpectation. - * @param request DeleteEvaluationExpectationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteEvaluationExpectation(request: google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest, callback: google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationExpectationCallback): void; - - /** - * Calls DeleteEvaluationExpectation. - * @param request DeleteEvaluationExpectationRequest message or plain object - * @returns Promise - */ - public deleteEvaluationExpectation(request: google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest): Promise; - - /** - * Calls CreateScheduledEvaluationRun. - * @param request CreateScheduledEvaluationRunRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ScheduledEvaluationRun - */ - public createScheduledEvaluationRun(request: google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest, callback: google.cloud.ces.v1beta.EvaluationService.CreateScheduledEvaluationRunCallback): void; - - /** - * Calls CreateScheduledEvaluationRun. - * @param request CreateScheduledEvaluationRunRequest message or plain object - * @returns Promise - */ - public createScheduledEvaluationRun(request: google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest): Promise; - - /** - * Calls GetScheduledEvaluationRun. - * @param request GetScheduledEvaluationRunRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ScheduledEvaluationRun - */ - public getScheduledEvaluationRun(request: google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest, callback: google.cloud.ces.v1beta.EvaluationService.GetScheduledEvaluationRunCallback): void; - - /** - * Calls GetScheduledEvaluationRun. - * @param request GetScheduledEvaluationRunRequest message or plain object - * @returns Promise - */ - public getScheduledEvaluationRun(request: google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest): Promise; - - /** - * Calls ListScheduledEvaluationRuns. - * @param request ListScheduledEvaluationRunsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListScheduledEvaluationRunsResponse - */ - public listScheduledEvaluationRuns(request: google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ListScheduledEvaluationRunsCallback): void; - - /** - * Calls ListScheduledEvaluationRuns. - * @param request ListScheduledEvaluationRunsRequest message or plain object - * @returns Promise - */ - public listScheduledEvaluationRuns(request: google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest): Promise; - - /** - * Calls UpdateScheduledEvaluationRun. - * @param request UpdateScheduledEvaluationRunRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ScheduledEvaluationRun - */ - public updateScheduledEvaluationRun(request: google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest, callback: google.cloud.ces.v1beta.EvaluationService.UpdateScheduledEvaluationRunCallback): void; - - /** - * Calls UpdateScheduledEvaluationRun. - * @param request UpdateScheduledEvaluationRunRequest message or plain object - * @returns Promise - */ - public updateScheduledEvaluationRun(request: google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest): Promise; - - /** - * Calls DeleteScheduledEvaluationRun. - * @param request DeleteScheduledEvaluationRunRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteScheduledEvaluationRun(request: google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest, callback: google.cloud.ces.v1beta.EvaluationService.DeleteScheduledEvaluationRunCallback): void; - - /** - * Calls DeleteScheduledEvaluationRun. - * @param request DeleteScheduledEvaluationRunRequest message or plain object - * @returns Promise - */ - public deleteScheduledEvaluationRun(request: google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest): Promise; - - /** - * Calls TestPersonaVoice. - * @param request TestPersonaVoiceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestPersonaVoiceResponse - */ - public testPersonaVoice(request: google.cloud.ces.v1beta.ITestPersonaVoiceRequest, callback: google.cloud.ces.v1beta.EvaluationService.TestPersonaVoiceCallback): void; - - /** - * Calls TestPersonaVoice. - * @param request TestPersonaVoiceRequest message or plain object - * @returns Promise - */ - public testPersonaVoice(request: google.cloud.ces.v1beta.ITestPersonaVoiceRequest): Promise; - } - - namespace EvaluationService { - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|runEvaluation}. - * @param error Error, if any - * @param [response] Operation - */ - type RunEvaluationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|uploadEvaluationAudio}. - * @param error Error, if any - * @param [response] UploadEvaluationAudioResponse - */ - type UploadEvaluationAudioCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.UploadEvaluationAudioResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createEvaluation}. - * @param error Error, if any - * @param [response] Evaluation - */ - type CreateEvaluationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Evaluation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|generateEvaluation}. - * @param error Error, if any - * @param [response] Operation - */ - type GenerateEvaluationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|importEvaluations}. - * @param error Error, if any - * @param [response] Operation - */ - type ImportEvaluationsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createEvaluationDataset}. - * @param error Error, if any - * @param [response] EvaluationDataset - */ - type CreateEvaluationDatasetCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationDataset) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateEvaluation}. - * @param error Error, if any - * @param [response] Evaluation - */ - type UpdateEvaluationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Evaluation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateEvaluationDataset}. - * @param error Error, if any - * @param [response] EvaluationDataset - */ - type UpdateEvaluationDatasetCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationDataset) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteEvaluationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationResult}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteEvaluationResultCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationDataset}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteEvaluationDatasetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationRun}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteEvaluationRunCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluation}. - * @param error Error, if any - * @param [response] Evaluation - */ - type GetEvaluationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Evaluation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationResult}. - * @param error Error, if any - * @param [response] EvaluationResult - */ - type GetEvaluationResultCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationResult) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationDataset}. - * @param error Error, if any - * @param [response] EvaluationDataset - */ - type GetEvaluationDatasetCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationDataset) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationRun}. - * @param error Error, if any - * @param [response] EvaluationRun - */ - type GetEvaluationRunCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationRun) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluations}. - * @param error Error, if any - * @param [response] ListEvaluationsResponse - */ - type ListEvaluationsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListEvaluationsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationResults}. - * @param error Error, if any - * @param [response] ListEvaluationResultsResponse - */ - type ListEvaluationResultsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListEvaluationResultsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationDatasets}. - * @param error Error, if any - * @param [response] ListEvaluationDatasetsResponse - */ - type ListEvaluationDatasetsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListEvaluationDatasetsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationRuns}. - * @param error Error, if any - * @param [response] ListEvaluationRunsResponse - */ - type ListEvaluationRunsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListEvaluationRunsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationExpectations}. - * @param error Error, if any - * @param [response] ListEvaluationExpectationsResponse - */ - type ListEvaluationExpectationsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListEvaluationExpectationsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationExpectation}. - * @param error Error, if any - * @param [response] EvaluationExpectation - */ - type GetEvaluationExpectationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationExpectation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createEvaluationExpectation}. - * @param error Error, if any - * @param [response] EvaluationExpectation - */ - type CreateEvaluationExpectationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationExpectation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateEvaluationExpectation}. - * @param error Error, if any - * @param [response] EvaluationExpectation - */ - type UpdateEvaluationExpectationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationExpectation) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationExpectation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteEvaluationExpectationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createScheduledEvaluationRun}. - * @param error Error, if any - * @param [response] ScheduledEvaluationRun - */ - type CreateScheduledEvaluationRunCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ScheduledEvaluationRun) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getScheduledEvaluationRun}. - * @param error Error, if any - * @param [response] ScheduledEvaluationRun - */ - type GetScheduledEvaluationRunCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ScheduledEvaluationRun) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listScheduledEvaluationRuns}. - * @param error Error, if any - * @param [response] ListScheduledEvaluationRunsResponse - */ - type ListScheduledEvaluationRunsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateScheduledEvaluationRun}. - * @param error Error, if any - * @param [response] ScheduledEvaluationRun - */ - type UpdateScheduledEvaluationRunCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ScheduledEvaluationRun) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteScheduledEvaluationRun}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteScheduledEvaluationRunCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|testPersonaVoice}. - * @param error Error, if any - * @param [response] TestPersonaVoiceResponse - */ - type TestPersonaVoiceCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.TestPersonaVoiceResponse) => void; - } - - /** Properties of a RunEvaluationResponse. */ - interface IRunEvaluationResponse { - - /** RunEvaluationResponse evaluationRun */ - evaluationRun?: (string|null); - } - - /** Represents a RunEvaluationResponse. */ - class RunEvaluationResponse implements IRunEvaluationResponse { - - /** - * Constructs a new RunEvaluationResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IRunEvaluationResponse); - - /** RunEvaluationResponse evaluationRun. */ - public evaluationRun: string; - - /** - * Creates a new RunEvaluationResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RunEvaluationResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IRunEvaluationResponse): google.cloud.ces.v1beta.RunEvaluationResponse; - - /** - * Encodes the specified RunEvaluationResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationResponse.verify|verify} messages. - * @param message RunEvaluationResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IRunEvaluationResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RunEvaluationResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationResponse.verify|verify} messages. - * @param message RunEvaluationResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IRunEvaluationResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RunEvaluationResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunEvaluationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RunEvaluationResponse; - - /** - * Decodes a RunEvaluationResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunEvaluationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RunEvaluationResponse; - - /** - * Verifies a RunEvaluationResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RunEvaluationResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunEvaluationResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RunEvaluationResponse; - - /** - * Creates a plain object from a RunEvaluationResponse message. Also converts values to other types if specified. - * @param message RunEvaluationResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.RunEvaluationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunEvaluationResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunEvaluationResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RunEvaluationOperationMetadata. */ - interface IRunEvaluationOperationMetadata { - - /** RunEvaluationOperationMetadata evaluations */ - evaluations?: (string[]|null); - - /** RunEvaluationOperationMetadata evaluationRun */ - evaluationRun?: (string|null); - - /** RunEvaluationOperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** RunEvaluationOperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** RunEvaluationOperationMetadata verb */ - verb?: (string|null); - - /** RunEvaluationOperationMetadata cancelRequested */ - cancelRequested?: (boolean|null); - } - - /** Represents a RunEvaluationOperationMetadata. */ - class RunEvaluationOperationMetadata implements IRunEvaluationOperationMetadata { - - /** - * Constructs a new RunEvaluationOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IRunEvaluationOperationMetadata); - - /** RunEvaluationOperationMetadata evaluations. */ - public evaluations: string[]; - - /** RunEvaluationOperationMetadata evaluationRun. */ - public evaluationRun: string; - - /** RunEvaluationOperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** RunEvaluationOperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** RunEvaluationOperationMetadata verb. */ - public verb: string; - - /** RunEvaluationOperationMetadata cancelRequested. */ - public cancelRequested: boolean; - - /** - * Creates a new RunEvaluationOperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns RunEvaluationOperationMetadata instance - */ - public static create(properties?: google.cloud.ces.v1beta.IRunEvaluationOperationMetadata): google.cloud.ces.v1beta.RunEvaluationOperationMetadata; - - /** - * Encodes the specified RunEvaluationOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationOperationMetadata.verify|verify} messages. - * @param message RunEvaluationOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IRunEvaluationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RunEvaluationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationOperationMetadata.verify|verify} messages. - * @param message RunEvaluationOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IRunEvaluationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RunEvaluationOperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunEvaluationOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RunEvaluationOperationMetadata; - - /** - * Decodes a RunEvaluationOperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunEvaluationOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RunEvaluationOperationMetadata; - - /** - * Verifies a RunEvaluationOperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RunEvaluationOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunEvaluationOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RunEvaluationOperationMetadata; - - /** - * Creates a plain object from a RunEvaluationOperationMetadata message. Also converts values to other types if specified. - * @param message RunEvaluationOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.RunEvaluationOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunEvaluationOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunEvaluationOperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GenerateEvaluationOperationMetadata. */ - interface IGenerateEvaluationOperationMetadata { - } - - /** Represents a GenerateEvaluationOperationMetadata. */ - class GenerateEvaluationOperationMetadata implements IGenerateEvaluationOperationMetadata { - - /** - * Constructs a new GenerateEvaluationOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata); - - /** - * Creates a new GenerateEvaluationOperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns GenerateEvaluationOperationMetadata instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata): google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata; - - /** - * Encodes the specified GenerateEvaluationOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata.verify|verify} messages. - * @param message GenerateEvaluationOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenerateEvaluationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata.verify|verify} messages. - * @param message GenerateEvaluationOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenerateEvaluationOperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenerateEvaluationOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata; - - /** - * Decodes a GenerateEvaluationOperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenerateEvaluationOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata; - - /** - * Verifies a GenerateEvaluationOperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenerateEvaluationOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenerateEvaluationOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata; - - /** - * Creates a plain object from a GenerateEvaluationOperationMetadata message. Also converts values to other types if specified. - * @param message GenerateEvaluationOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenerateEvaluationOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenerateEvaluationOperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteEvaluationRunOperationMetadata. */ - interface IDeleteEvaluationRunOperationMetadata { - } - - /** Represents a DeleteEvaluationRunOperationMetadata. */ - class DeleteEvaluationRunOperationMetadata implements IDeleteEvaluationRunOperationMetadata { - - /** - * Constructs a new DeleteEvaluationRunOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata); - - /** - * Creates a new DeleteEvaluationRunOperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteEvaluationRunOperationMetadata instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata): google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata; - - /** - * Encodes the specified DeleteEvaluationRunOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata.verify|verify} messages. - * @param message DeleteEvaluationRunOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteEvaluationRunOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata.verify|verify} messages. - * @param message DeleteEvaluationRunOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteEvaluationRunOperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteEvaluationRunOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata; - - /** - * Decodes a DeleteEvaluationRunOperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteEvaluationRunOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata; - - /** - * Verifies a DeleteEvaluationRunOperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteEvaluationRunOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteEvaluationRunOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata; - - /** - * Creates a plain object from a DeleteEvaluationRunOperationMetadata message. Also converts values to other types if specified. - * @param message DeleteEvaluationRunOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteEvaluationRunOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteEvaluationRunOperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateEvaluationRequest. */ - interface ICreateEvaluationRequest { - - /** CreateEvaluationRequest parent */ - parent?: (string|null); - - /** CreateEvaluationRequest evaluationId */ - evaluationId?: (string|null); - - /** CreateEvaluationRequest evaluation */ - evaluation?: (google.cloud.ces.v1beta.IEvaluation|null); - } - - /** Represents a CreateEvaluationRequest. */ - class CreateEvaluationRequest implements ICreateEvaluationRequest { - - /** - * Constructs a new CreateEvaluationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ICreateEvaluationRequest); - - /** CreateEvaluationRequest parent. */ - public parent: string; - - /** CreateEvaluationRequest evaluationId. */ - public evaluationId: string; - - /** CreateEvaluationRequest evaluation. */ - public evaluation?: (google.cloud.ces.v1beta.IEvaluation|null); - - /** - * Creates a new CreateEvaluationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateEvaluationRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.ICreateEvaluationRequest): google.cloud.ces.v1beta.CreateEvaluationRequest; - - /** - * Encodes the specified CreateEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationRequest.verify|verify} messages. - * @param message CreateEvaluationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ICreateEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationRequest.verify|verify} messages. - * @param message CreateEvaluationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateEvaluationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateEvaluationRequest; - - /** - * Decodes a CreateEvaluationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateEvaluationRequest; - - /** - * Verifies a CreateEvaluationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateEvaluationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateEvaluationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateEvaluationRequest; - - /** - * Creates a plain object from a CreateEvaluationRequest message. Also converts values to other types if specified. - * @param message CreateEvaluationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.CreateEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateEvaluationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateEvaluationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GenerateEvaluationRequest. */ - interface IGenerateEvaluationRequest { - - /** GenerateEvaluationRequest conversation */ - conversation?: (string|null); - - /** GenerateEvaluationRequest source */ - source?: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source|null); - } - - /** Represents a GenerateEvaluationRequest. */ - class GenerateEvaluationRequest implements IGenerateEvaluationRequest { - - /** - * Constructs a new GenerateEvaluationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGenerateEvaluationRequest); - - /** GenerateEvaluationRequest conversation. */ - public conversation: string; - - /** GenerateEvaluationRequest source. */ - public source: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source); - - /** - * Creates a new GenerateEvaluationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GenerateEvaluationRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGenerateEvaluationRequest): google.cloud.ces.v1beta.GenerateEvaluationRequest; - - /** - * Encodes the specified GenerateEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationRequest.verify|verify} messages. - * @param message GenerateEvaluationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGenerateEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenerateEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationRequest.verify|verify} messages. - * @param message GenerateEvaluationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGenerateEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenerateEvaluationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenerateEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateEvaluationRequest; - - /** - * Decodes a GenerateEvaluationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenerateEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateEvaluationRequest; - - /** - * Verifies a GenerateEvaluationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenerateEvaluationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenerateEvaluationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateEvaluationRequest; - - /** - * Creates a plain object from a GenerateEvaluationRequest message. Also converts values to other types if specified. - * @param message GenerateEvaluationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GenerateEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenerateEvaluationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenerateEvaluationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ImportEvaluationsRequest. */ - interface IImportEvaluationsRequest { - - /** ImportEvaluationsRequest conversationList */ - conversationList?: (google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList|null); - - /** ImportEvaluationsRequest gcsUri */ - gcsUri?: (string|null); - - /** ImportEvaluationsRequest csvContent */ - csvContent?: (Uint8Array|Buffer|string|null); - - /** ImportEvaluationsRequest parent */ - parent?: (string|null); - - /** ImportEvaluationsRequest importOptions */ - importOptions?: (google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions|null); - } - - /** Represents an ImportEvaluationsRequest. */ - class ImportEvaluationsRequest implements IImportEvaluationsRequest { - - /** - * Constructs a new ImportEvaluationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IImportEvaluationsRequest); - - /** ImportEvaluationsRequest conversationList. */ - public conversationList?: (google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList|null); - - /** ImportEvaluationsRequest gcsUri. */ - public gcsUri?: (string|null); - - /** ImportEvaluationsRequest csvContent. */ - public csvContent?: (Uint8Array|Buffer|string|null); - - /** ImportEvaluationsRequest parent. */ - public parent: string; - - /** ImportEvaluationsRequest importOptions. */ - public importOptions?: (google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions|null); - - /** ImportEvaluationsRequest source. */ - public source?: ("conversationList"|"gcsUri"|"csvContent"); - - /** - * Creates a new ImportEvaluationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportEvaluationsRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IImportEvaluationsRequest): google.cloud.ces.v1beta.ImportEvaluationsRequest; - - /** - * Encodes the specified ImportEvaluationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.verify|verify} messages. - * @param message ImportEvaluationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IImportEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.verify|verify} messages. - * @param message ImportEvaluationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IImportEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportEvaluationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportEvaluationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportEvaluationsRequest; - - /** - * Decodes an ImportEvaluationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportEvaluationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportEvaluationsRequest; - - /** - * Verifies an ImportEvaluationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ImportEvaluationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportEvaluationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportEvaluationsRequest; - - /** - * Creates a plain object from an ImportEvaluationsRequest message. Also converts values to other types if specified. - * @param message ImportEvaluationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ImportEvaluationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportEvaluationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportEvaluationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ImportEvaluationsRequest { - - /** Properties of a ConversationList. */ - interface IConversationList { - - /** ConversationList conversations */ - conversations?: (string[]|null); - } - - /** Represents a ConversationList. */ - class ConversationList implements IConversationList { - - /** - * Constructs a new ConversationList. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList); - - /** ConversationList conversations. */ - public conversations: string[]; - - /** - * Creates a new ConversationList instance using the specified properties. - * @param [properties] Properties to set - * @returns ConversationList instance - */ - public static create(properties?: google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList): google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList; - - /** - * Encodes the specified ConversationList message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.verify|verify} messages. - * @param message ConversationList message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConversationList message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.verify|verify} messages. - * @param message ConversationList message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConversationList message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConversationList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList; - - /** - * Decodes a ConversationList message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConversationList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList; - - /** - * Verifies a ConversationList message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConversationList message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConversationList - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList; - - /** - * Creates a plain object from a ConversationList message. Also converts values to other types if specified. - * @param message ConversationList - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConversationList to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConversationList - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ImportOptions. */ - interface IImportOptions { - - /** ImportOptions conflictResolutionStrategy */ - conflictResolutionStrategy?: (google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy|keyof typeof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy|null); - } - - /** Represents an ImportOptions. */ - class ImportOptions implements IImportOptions { - - /** - * Constructs a new ImportOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions); - - /** ImportOptions conflictResolutionStrategy. */ - public conflictResolutionStrategy: (google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy|keyof typeof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy); - - /** - * Creates a new ImportOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportOptions instance - */ - public static create(properties?: google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions): google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions; - - /** - * Encodes the specified ImportOptions message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.verify|verify} messages. - * @param message ImportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportOptions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.verify|verify} messages. - * @param message ImportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions; - - /** - * Decodes an ImportOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions; - - /** - * Verifies an ImportOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ImportOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions; - - /** - * Creates a plain object from an ImportOptions message. Also converts values to other types if specified. - * @param message ImportOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ImportOptions { - - /** ConflictResolutionStrategy enum. */ - enum ConflictResolutionStrategy { - CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED = 0, - OVERWRITE = 1, - SKIP = 2, - DUPLICATE = 3 - } - } - } - - /** Properties of an ImportEvaluationsResponse. */ - interface IImportEvaluationsResponse { - - /** ImportEvaluationsResponse evaluations */ - evaluations?: (google.cloud.ces.v1beta.IEvaluation[]|null); - - /** ImportEvaluationsResponse errorMessages */ - errorMessages?: (string[]|null); - - /** ImportEvaluationsResponse importFailureCount */ - importFailureCount?: (number|null); - } - - /** Represents an ImportEvaluationsResponse. */ - class ImportEvaluationsResponse implements IImportEvaluationsResponse { - - /** - * Constructs a new ImportEvaluationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IImportEvaluationsResponse); - - /** ImportEvaluationsResponse evaluations. */ - public evaluations: google.cloud.ces.v1beta.IEvaluation[]; - - /** ImportEvaluationsResponse errorMessages. */ - public errorMessages: string[]; - - /** ImportEvaluationsResponse importFailureCount. */ - public importFailureCount: number; - - /** - * Creates a new ImportEvaluationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportEvaluationsResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IImportEvaluationsResponse): google.cloud.ces.v1beta.ImportEvaluationsResponse; - - /** - * Encodes the specified ImportEvaluationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsResponse.verify|verify} messages. - * @param message ImportEvaluationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IImportEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsResponse.verify|verify} messages. - * @param message ImportEvaluationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IImportEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportEvaluationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportEvaluationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportEvaluationsResponse; - - /** - * Decodes an ImportEvaluationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportEvaluationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportEvaluationsResponse; - - /** - * Verifies an ImportEvaluationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ImportEvaluationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportEvaluationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportEvaluationsResponse; - - /** - * Creates a plain object from an ImportEvaluationsResponse message. Also converts values to other types if specified. - * @param message ImportEvaluationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ImportEvaluationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportEvaluationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportEvaluationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ImportEvaluationsOperationMetadata. */ - interface IImportEvaluationsOperationMetadata { - - /** ImportEvaluationsOperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ImportEvaluationsOperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** ImportEvaluationsOperationMetadata statusMessage */ - statusMessage?: (string|null); - } - - /** Represents an ImportEvaluationsOperationMetadata. */ - class ImportEvaluationsOperationMetadata implements IImportEvaluationsOperationMetadata { - - /** - * Constructs a new ImportEvaluationsOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata); - - /** ImportEvaluationsOperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ImportEvaluationsOperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** ImportEvaluationsOperationMetadata statusMessage. */ - public statusMessage: string; - - /** - * Creates a new ImportEvaluationsOperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportEvaluationsOperationMetadata instance - */ - public static create(properties?: google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata): google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata; - - /** - * Encodes the specified ImportEvaluationsOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata.verify|verify} messages. - * @param message ImportEvaluationsOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportEvaluationsOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata.verify|verify} messages. - * @param message ImportEvaluationsOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportEvaluationsOperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportEvaluationsOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata; - - /** - * Decodes an ImportEvaluationsOperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportEvaluationsOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata; - - /** - * Verifies an ImportEvaluationsOperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ImportEvaluationsOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportEvaluationsOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata; - - /** - * Creates a plain object from an ImportEvaluationsOperationMetadata message. Also converts values to other types if specified. - * @param message ImportEvaluationsOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportEvaluationsOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportEvaluationsOperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateEvaluationDatasetRequest. */ - interface ICreateEvaluationDatasetRequest { - - /** CreateEvaluationDatasetRequest parent */ - parent?: (string|null); - - /** CreateEvaluationDatasetRequest evaluationDatasetId */ - evaluationDatasetId?: (string|null); - - /** CreateEvaluationDatasetRequest evaluationDataset */ - evaluationDataset?: (google.cloud.ces.v1beta.IEvaluationDataset|null); - } - - /** Represents a CreateEvaluationDatasetRequest. */ - class CreateEvaluationDatasetRequest implements ICreateEvaluationDatasetRequest { - - /** - * Constructs a new CreateEvaluationDatasetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest); - - /** CreateEvaluationDatasetRequest parent. */ - public parent: string; - - /** CreateEvaluationDatasetRequest evaluationDatasetId. */ - public evaluationDatasetId: string; - - /** CreateEvaluationDatasetRequest evaluationDataset. */ - public evaluationDataset?: (google.cloud.ces.v1beta.IEvaluationDataset|null); - - /** - * Creates a new CreateEvaluationDatasetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateEvaluationDatasetRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest): google.cloud.ces.v1beta.CreateEvaluationDatasetRequest; - - /** - * Encodes the specified CreateEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationDatasetRequest.verify|verify} messages. - * @param message CreateEvaluationDatasetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationDatasetRequest.verify|verify} messages. - * @param message CreateEvaluationDatasetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateEvaluationDatasetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateEvaluationDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateEvaluationDatasetRequest; - - /** - * Decodes a CreateEvaluationDatasetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateEvaluationDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateEvaluationDatasetRequest; - - /** - * Verifies a CreateEvaluationDatasetRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateEvaluationDatasetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateEvaluationDatasetRequest; - - /** - * Creates a plain object from a CreateEvaluationDatasetRequest message. Also converts values to other types if specified. - * @param message CreateEvaluationDatasetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.CreateEvaluationDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateEvaluationDatasetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateEvaluationDatasetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateEvaluationRequest. */ - interface IUpdateEvaluationRequest { - - /** UpdateEvaluationRequest evaluation */ - evaluation?: (google.cloud.ces.v1beta.IEvaluation|null); - - /** UpdateEvaluationRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateEvaluationRequest. */ - class UpdateEvaluationRequest implements IUpdateEvaluationRequest { - - /** - * Constructs a new UpdateEvaluationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IUpdateEvaluationRequest); - - /** UpdateEvaluationRequest evaluation. */ - public evaluation?: (google.cloud.ces.v1beta.IEvaluation|null); - - /** UpdateEvaluationRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateEvaluationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateEvaluationRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IUpdateEvaluationRequest): google.cloud.ces.v1beta.UpdateEvaluationRequest; - - /** - * Encodes the specified UpdateEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationRequest.verify|verify} messages. - * @param message UpdateEvaluationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IUpdateEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationRequest.verify|verify} messages. - * @param message UpdateEvaluationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateEvaluationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateEvaluationRequest; - - /** - * Decodes an UpdateEvaluationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateEvaluationRequest; - - /** - * Verifies an UpdateEvaluationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateEvaluationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateEvaluationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateEvaluationRequest; - - /** - * Creates a plain object from an UpdateEvaluationRequest message. Also converts values to other types if specified. - * @param message UpdateEvaluationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.UpdateEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateEvaluationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateEvaluationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateEvaluationDatasetRequest. */ - interface IUpdateEvaluationDatasetRequest { - - /** UpdateEvaluationDatasetRequest evaluationDataset */ - evaluationDataset?: (google.cloud.ces.v1beta.IEvaluationDataset|null); - - /** UpdateEvaluationDatasetRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateEvaluationDatasetRequest. */ - class UpdateEvaluationDatasetRequest implements IUpdateEvaluationDatasetRequest { - - /** - * Constructs a new UpdateEvaluationDatasetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest); - - /** UpdateEvaluationDatasetRequest evaluationDataset. */ - public evaluationDataset?: (google.cloud.ces.v1beta.IEvaluationDataset|null); - - /** UpdateEvaluationDatasetRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateEvaluationDatasetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateEvaluationDatasetRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest): google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest; - - /** - * Encodes the specified UpdateEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest.verify|verify} messages. - * @param message UpdateEvaluationDatasetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest.verify|verify} messages. - * @param message UpdateEvaluationDatasetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateEvaluationDatasetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateEvaluationDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest; - - /** - * Decodes an UpdateEvaluationDatasetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateEvaluationDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest; - - /** - * Verifies an UpdateEvaluationDatasetRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateEvaluationDatasetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest; - - /** - * Creates a plain object from an UpdateEvaluationDatasetRequest message. Also converts values to other types if specified. - * @param message UpdateEvaluationDatasetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateEvaluationDatasetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateEvaluationDatasetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteEvaluationRequest. */ - interface IDeleteEvaluationRequest { - - /** DeleteEvaluationRequest name */ - name?: (string|null); - - /** DeleteEvaluationRequest force */ - force?: (boolean|null); - - /** DeleteEvaluationRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteEvaluationRequest. */ - class DeleteEvaluationRequest implements IDeleteEvaluationRequest { - - /** - * Constructs a new DeleteEvaluationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDeleteEvaluationRequest); - - /** DeleteEvaluationRequest name. */ - public name: string; - - /** DeleteEvaluationRequest force. */ - public force: boolean; - - /** DeleteEvaluationRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteEvaluationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteEvaluationRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDeleteEvaluationRequest): google.cloud.ces.v1beta.DeleteEvaluationRequest; - - /** - * Encodes the specified DeleteEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRequest.verify|verify} messages. - * @param message DeleteEvaluationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDeleteEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRequest.verify|verify} messages. - * @param message DeleteEvaluationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteEvaluationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteEvaluationRequest; - - /** - * Decodes a DeleteEvaluationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteEvaluationRequest; - - /** - * Verifies a DeleteEvaluationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteEvaluationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteEvaluationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteEvaluationRequest; - - /** - * Creates a plain object from a DeleteEvaluationRequest message. Also converts values to other types if specified. - * @param message DeleteEvaluationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DeleteEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteEvaluationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteEvaluationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteEvaluationResultRequest. */ - interface IDeleteEvaluationResultRequest { - - /** DeleteEvaluationResultRequest name */ - name?: (string|null); - } - - /** Represents a DeleteEvaluationResultRequest. */ - class DeleteEvaluationResultRequest implements IDeleteEvaluationResultRequest { - - /** - * Constructs a new DeleteEvaluationResultRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDeleteEvaluationResultRequest); - - /** DeleteEvaluationResultRequest name. */ - public name: string; - - /** - * Creates a new DeleteEvaluationResultRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteEvaluationResultRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDeleteEvaluationResultRequest): google.cloud.ces.v1beta.DeleteEvaluationResultRequest; - - /** - * Encodes the specified DeleteEvaluationResultRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationResultRequest.verify|verify} messages. - * @param message DeleteEvaluationResultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDeleteEvaluationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteEvaluationResultRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationResultRequest.verify|verify} messages. - * @param message DeleteEvaluationResultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteEvaluationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteEvaluationResultRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteEvaluationResultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteEvaluationResultRequest; - - /** - * Decodes a DeleteEvaluationResultRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteEvaluationResultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteEvaluationResultRequest; - - /** - * Verifies a DeleteEvaluationResultRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteEvaluationResultRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteEvaluationResultRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteEvaluationResultRequest; - - /** - * Creates a plain object from a DeleteEvaluationResultRequest message. Also converts values to other types if specified. - * @param message DeleteEvaluationResultRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DeleteEvaluationResultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteEvaluationResultRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteEvaluationResultRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteEvaluationDatasetRequest. */ - interface IDeleteEvaluationDatasetRequest { - - /** DeleteEvaluationDatasetRequest name */ - name?: (string|null); - - /** DeleteEvaluationDatasetRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteEvaluationDatasetRequest. */ - class DeleteEvaluationDatasetRequest implements IDeleteEvaluationDatasetRequest { - - /** - * Constructs a new DeleteEvaluationDatasetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest); - - /** DeleteEvaluationDatasetRequest name. */ - public name: string; - - /** DeleteEvaluationDatasetRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteEvaluationDatasetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteEvaluationDatasetRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest): google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest; - - /** - * Encodes the specified DeleteEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest.verify|verify} messages. - * @param message DeleteEvaluationDatasetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest.verify|verify} messages. - * @param message DeleteEvaluationDatasetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteEvaluationDatasetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteEvaluationDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest; - - /** - * Decodes a DeleteEvaluationDatasetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteEvaluationDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest; - - /** - * Verifies a DeleteEvaluationDatasetRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteEvaluationDatasetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest; - - /** - * Creates a plain object from a DeleteEvaluationDatasetRequest message. Also converts values to other types if specified. - * @param message DeleteEvaluationDatasetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteEvaluationDatasetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteEvaluationDatasetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteEvaluationRunRequest. */ - interface IDeleteEvaluationRunRequest { - - /** DeleteEvaluationRunRequest name */ - name?: (string|null); - } - - /** Represents a DeleteEvaluationRunRequest. */ - class DeleteEvaluationRunRequest implements IDeleteEvaluationRunRequest { - - /** - * Constructs a new DeleteEvaluationRunRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDeleteEvaluationRunRequest); - - /** DeleteEvaluationRunRequest name. */ - public name: string; - - /** - * Creates a new DeleteEvaluationRunRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteEvaluationRunRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDeleteEvaluationRunRequest): google.cloud.ces.v1beta.DeleteEvaluationRunRequest; - - /** - * Encodes the specified DeleteEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunRequest.verify|verify} messages. - * @param message DeleteEvaluationRunRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDeleteEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunRequest.verify|verify} messages. - * @param message DeleteEvaluationRunRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteEvaluationRunRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteEvaluationRunRequest; - - /** - * Decodes a DeleteEvaluationRunRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteEvaluationRunRequest; - - /** - * Verifies a DeleteEvaluationRunRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteEvaluationRunRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteEvaluationRunRequest; - - /** - * Creates a plain object from a DeleteEvaluationRunRequest message. Also converts values to other types if specified. - * @param message DeleteEvaluationRunRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DeleteEvaluationRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteEvaluationRunRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteEvaluationRunRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetEvaluationRequest. */ - interface IGetEvaluationRequest { - - /** GetEvaluationRequest name */ - name?: (string|null); - } - - /** Represents a GetEvaluationRequest. */ - class GetEvaluationRequest implements IGetEvaluationRequest { - - /** - * Constructs a new GetEvaluationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGetEvaluationRequest); - - /** GetEvaluationRequest name. */ - public name: string; - - /** - * Creates a new GetEvaluationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetEvaluationRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGetEvaluationRequest): google.cloud.ces.v1beta.GetEvaluationRequest; - - /** - * Encodes the specified GetEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRequest.verify|verify} messages. - * @param message GetEvaluationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGetEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRequest.verify|verify} messages. - * @param message GetEvaluationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGetEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetEvaluationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetEvaluationRequest; - - /** - * Decodes a GetEvaluationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetEvaluationRequest; - - /** - * Verifies a GetEvaluationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetEvaluationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetEvaluationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetEvaluationRequest; - - /** - * Creates a plain object from a GetEvaluationRequest message. Also converts values to other types if specified. - * @param message GetEvaluationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GetEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetEvaluationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetEvaluationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetEvaluationResultRequest. */ - interface IGetEvaluationResultRequest { - - /** GetEvaluationResultRequest name */ - name?: (string|null); - } - - /** Represents a GetEvaluationResultRequest. */ - class GetEvaluationResultRequest implements IGetEvaluationResultRequest { - - /** - * Constructs a new GetEvaluationResultRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGetEvaluationResultRequest); - - /** GetEvaluationResultRequest name. */ - public name: string; - - /** - * Creates a new GetEvaluationResultRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetEvaluationResultRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGetEvaluationResultRequest): google.cloud.ces.v1beta.GetEvaluationResultRequest; - - /** - * Encodes the specified GetEvaluationResultRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationResultRequest.verify|verify} messages. - * @param message GetEvaluationResultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGetEvaluationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetEvaluationResultRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationResultRequest.verify|verify} messages. - * @param message GetEvaluationResultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGetEvaluationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetEvaluationResultRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetEvaluationResultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetEvaluationResultRequest; - - /** - * Decodes a GetEvaluationResultRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetEvaluationResultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetEvaluationResultRequest; - - /** - * Verifies a GetEvaluationResultRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetEvaluationResultRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetEvaluationResultRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetEvaluationResultRequest; - - /** - * Creates a plain object from a GetEvaluationResultRequest message. Also converts values to other types if specified. - * @param message GetEvaluationResultRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GetEvaluationResultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetEvaluationResultRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetEvaluationResultRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetEvaluationDatasetRequest. */ - interface IGetEvaluationDatasetRequest { - - /** GetEvaluationDatasetRequest name */ - name?: (string|null); - } - - /** Represents a GetEvaluationDatasetRequest. */ - class GetEvaluationDatasetRequest implements IGetEvaluationDatasetRequest { - - /** - * Constructs a new GetEvaluationDatasetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGetEvaluationDatasetRequest); - - /** GetEvaluationDatasetRequest name. */ - public name: string; - - /** - * Creates a new GetEvaluationDatasetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetEvaluationDatasetRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGetEvaluationDatasetRequest): google.cloud.ces.v1beta.GetEvaluationDatasetRequest; - - /** - * Encodes the specified GetEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationDatasetRequest.verify|verify} messages. - * @param message GetEvaluationDatasetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGetEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationDatasetRequest.verify|verify} messages. - * @param message GetEvaluationDatasetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGetEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetEvaluationDatasetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetEvaluationDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetEvaluationDatasetRequest; - - /** - * Decodes a GetEvaluationDatasetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetEvaluationDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetEvaluationDatasetRequest; - - /** - * Verifies a GetEvaluationDatasetRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetEvaluationDatasetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetEvaluationDatasetRequest; - - /** - * Creates a plain object from a GetEvaluationDatasetRequest message. Also converts values to other types if specified. - * @param message GetEvaluationDatasetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GetEvaluationDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetEvaluationDatasetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetEvaluationDatasetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetEvaluationRunRequest. */ - interface IGetEvaluationRunRequest { - - /** GetEvaluationRunRequest name */ - name?: (string|null); - } - - /** Represents a GetEvaluationRunRequest. */ - class GetEvaluationRunRequest implements IGetEvaluationRunRequest { - - /** - * Constructs a new GetEvaluationRunRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGetEvaluationRunRequest); - - /** GetEvaluationRunRequest name. */ - public name: string; - - /** - * Creates a new GetEvaluationRunRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetEvaluationRunRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGetEvaluationRunRequest): google.cloud.ces.v1beta.GetEvaluationRunRequest; - - /** - * Encodes the specified GetEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRunRequest.verify|verify} messages. - * @param message GetEvaluationRunRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGetEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRunRequest.verify|verify} messages. - * @param message GetEvaluationRunRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGetEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetEvaluationRunRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetEvaluationRunRequest; - - /** - * Decodes a GetEvaluationRunRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetEvaluationRunRequest; - - /** - * Verifies a GetEvaluationRunRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetEvaluationRunRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetEvaluationRunRequest; - - /** - * Creates a plain object from a GetEvaluationRunRequest message. Also converts values to other types if specified. - * @param message GetEvaluationRunRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GetEvaluationRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetEvaluationRunRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetEvaluationRunRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEvaluationsRequest. */ - interface IListEvaluationsRequest { - - /** ListEvaluationsRequest parent */ - parent?: (string|null); - - /** ListEvaluationsRequest pageSize */ - pageSize?: (number|null); - - /** ListEvaluationsRequest pageToken */ - pageToken?: (string|null); - - /** ListEvaluationsRequest filter */ - filter?: (string|null); - - /** ListEvaluationsRequest evaluationFilter */ - evaluationFilter?: (string|null); - - /** ListEvaluationsRequest evaluationRunFilter */ - evaluationRunFilter?: (string|null); - - /** ListEvaluationsRequest orderBy */ - orderBy?: (string|null); - - /** ListEvaluationsRequest lastTenResults */ - lastTenResults?: (boolean|null); - } - - /** Represents a ListEvaluationsRequest. */ - class ListEvaluationsRequest implements IListEvaluationsRequest { - - /** - * Constructs a new ListEvaluationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListEvaluationsRequest); - - /** ListEvaluationsRequest parent. */ - public parent: string; - - /** ListEvaluationsRequest pageSize. */ - public pageSize: number; - - /** ListEvaluationsRequest pageToken. */ - public pageToken: string; - - /** ListEvaluationsRequest filter. */ - public filter: string; - - /** ListEvaluationsRequest evaluationFilter. */ - public evaluationFilter: string; - - /** ListEvaluationsRequest evaluationRunFilter. */ - public evaluationRunFilter: string; - - /** ListEvaluationsRequest orderBy. */ - public orderBy: string; - - /** ListEvaluationsRequest lastTenResults. */ - public lastTenResults: boolean; - - /** - * Creates a new ListEvaluationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEvaluationsRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListEvaluationsRequest): google.cloud.ces.v1beta.ListEvaluationsRequest; - - /** - * Encodes the specified ListEvaluationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsRequest.verify|verify} messages. - * @param message ListEvaluationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsRequest.verify|verify} messages. - * @param message ListEvaluationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEvaluationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEvaluationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationsRequest; - - /** - * Decodes a ListEvaluationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEvaluationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationsRequest; - - /** - * Verifies a ListEvaluationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEvaluationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEvaluationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationsRequest; - - /** - * Creates a plain object from a ListEvaluationsRequest message. Also converts values to other types if specified. - * @param message ListEvaluationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListEvaluationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEvaluationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEvaluationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEvaluationResultsRequest. */ - interface IListEvaluationResultsRequest { - - /** ListEvaluationResultsRequest parent */ - parent?: (string|null); - - /** ListEvaluationResultsRequest pageSize */ - pageSize?: (number|null); - - /** ListEvaluationResultsRequest pageToken */ - pageToken?: (string|null); - - /** ListEvaluationResultsRequest filter */ - filter?: (string|null); - - /** ListEvaluationResultsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListEvaluationResultsRequest. */ - class ListEvaluationResultsRequest implements IListEvaluationResultsRequest { - - /** - * Constructs a new ListEvaluationResultsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListEvaluationResultsRequest); - - /** ListEvaluationResultsRequest parent. */ - public parent: string; - - /** ListEvaluationResultsRequest pageSize. */ - public pageSize: number; - - /** ListEvaluationResultsRequest pageToken. */ - public pageToken: string; - - /** ListEvaluationResultsRequest filter. */ - public filter: string; - - /** ListEvaluationResultsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListEvaluationResultsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEvaluationResultsRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListEvaluationResultsRequest): google.cloud.ces.v1beta.ListEvaluationResultsRequest; - - /** - * Encodes the specified ListEvaluationResultsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsRequest.verify|verify} messages. - * @param message ListEvaluationResultsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListEvaluationResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEvaluationResultsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsRequest.verify|verify} messages. - * @param message ListEvaluationResultsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEvaluationResultsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEvaluationResultsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationResultsRequest; - - /** - * Decodes a ListEvaluationResultsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEvaluationResultsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationResultsRequest; - - /** - * Verifies a ListEvaluationResultsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEvaluationResultsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEvaluationResultsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationResultsRequest; - - /** - * Creates a plain object from a ListEvaluationResultsRequest message. Also converts values to other types if specified. - * @param message ListEvaluationResultsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListEvaluationResultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEvaluationResultsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEvaluationResultsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEvaluationDatasetsRequest. */ - interface IListEvaluationDatasetsRequest { - - /** ListEvaluationDatasetsRequest parent */ - parent?: (string|null); - - /** ListEvaluationDatasetsRequest pageSize */ - pageSize?: (number|null); - - /** ListEvaluationDatasetsRequest pageToken */ - pageToken?: (string|null); - - /** ListEvaluationDatasetsRequest filter */ - filter?: (string|null); - - /** ListEvaluationDatasetsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListEvaluationDatasetsRequest. */ - class ListEvaluationDatasetsRequest implements IListEvaluationDatasetsRequest { - - /** - * Constructs a new ListEvaluationDatasetsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListEvaluationDatasetsRequest); - - /** ListEvaluationDatasetsRequest parent. */ - public parent: string; - - /** ListEvaluationDatasetsRequest pageSize. */ - public pageSize: number; - - /** ListEvaluationDatasetsRequest pageToken. */ - public pageToken: string; - - /** ListEvaluationDatasetsRequest filter. */ - public filter: string; - - /** ListEvaluationDatasetsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListEvaluationDatasetsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEvaluationDatasetsRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListEvaluationDatasetsRequest): google.cloud.ces.v1beta.ListEvaluationDatasetsRequest; - - /** - * Encodes the specified ListEvaluationDatasetsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsRequest.verify|verify} messages. - * @param message ListEvaluationDatasetsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEvaluationDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsRequest.verify|verify} messages. - * @param message ListEvaluationDatasetsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEvaluationDatasetsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEvaluationDatasetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationDatasetsRequest; - - /** - * Decodes a ListEvaluationDatasetsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEvaluationDatasetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationDatasetsRequest; - - /** - * Verifies a ListEvaluationDatasetsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEvaluationDatasetsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEvaluationDatasetsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationDatasetsRequest; - - /** - * Creates a plain object from a ListEvaluationDatasetsRequest message. Also converts values to other types if specified. - * @param message ListEvaluationDatasetsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListEvaluationDatasetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEvaluationDatasetsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEvaluationDatasetsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEvaluationRunsRequest. */ - interface IListEvaluationRunsRequest { - - /** ListEvaluationRunsRequest parent */ - parent?: (string|null); - - /** ListEvaluationRunsRequest pageSize */ - pageSize?: (number|null); - - /** ListEvaluationRunsRequest pageToken */ - pageToken?: (string|null); - - /** ListEvaluationRunsRequest filter */ - filter?: (string|null); - - /** ListEvaluationRunsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListEvaluationRunsRequest. */ - class ListEvaluationRunsRequest implements IListEvaluationRunsRequest { - - /** - * Constructs a new ListEvaluationRunsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListEvaluationRunsRequest); - - /** ListEvaluationRunsRequest parent. */ - public parent: string; - - /** ListEvaluationRunsRequest pageSize. */ - public pageSize: number; - - /** ListEvaluationRunsRequest pageToken. */ - public pageToken: string; - - /** ListEvaluationRunsRequest filter. */ - public filter: string; - - /** ListEvaluationRunsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListEvaluationRunsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEvaluationRunsRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListEvaluationRunsRequest): google.cloud.ces.v1beta.ListEvaluationRunsRequest; - - /** - * Encodes the specified ListEvaluationRunsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsRequest.verify|verify} messages. - * @param message ListEvaluationRunsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListEvaluationRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEvaluationRunsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsRequest.verify|verify} messages. - * @param message ListEvaluationRunsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEvaluationRunsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEvaluationRunsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationRunsRequest; - - /** - * Decodes a ListEvaluationRunsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEvaluationRunsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationRunsRequest; - - /** - * Verifies a ListEvaluationRunsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEvaluationRunsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEvaluationRunsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationRunsRequest; - - /** - * Creates a plain object from a ListEvaluationRunsRequest message. Also converts values to other types if specified. - * @param message ListEvaluationRunsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListEvaluationRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEvaluationRunsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEvaluationRunsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEvaluationsResponse. */ - interface IListEvaluationsResponse { - - /** ListEvaluationsResponse evaluations */ - evaluations?: (google.cloud.ces.v1beta.IEvaluation[]|null); - - /** ListEvaluationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListEvaluationsResponse. */ - class ListEvaluationsResponse implements IListEvaluationsResponse { - - /** - * Constructs a new ListEvaluationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListEvaluationsResponse); - - /** ListEvaluationsResponse evaluations. */ - public evaluations: google.cloud.ces.v1beta.IEvaluation[]; - - /** ListEvaluationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListEvaluationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEvaluationsResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListEvaluationsResponse): google.cloud.ces.v1beta.ListEvaluationsResponse; - - /** - * Encodes the specified ListEvaluationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsResponse.verify|verify} messages. - * @param message ListEvaluationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsResponse.verify|verify} messages. - * @param message ListEvaluationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEvaluationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEvaluationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationsResponse; - - /** - * Decodes a ListEvaluationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEvaluationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationsResponse; - - /** - * Verifies a ListEvaluationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEvaluationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEvaluationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationsResponse; - - /** - * Creates a plain object from a ListEvaluationsResponse message. Also converts values to other types if specified. - * @param message ListEvaluationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListEvaluationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEvaluationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEvaluationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEvaluationResultsResponse. */ - interface IListEvaluationResultsResponse { - - /** ListEvaluationResultsResponse evaluationResults */ - evaluationResults?: (google.cloud.ces.v1beta.IEvaluationResult[]|null); - - /** ListEvaluationResultsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListEvaluationResultsResponse. */ - class ListEvaluationResultsResponse implements IListEvaluationResultsResponse { - - /** - * Constructs a new ListEvaluationResultsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListEvaluationResultsResponse); - - /** ListEvaluationResultsResponse evaluationResults. */ - public evaluationResults: google.cloud.ces.v1beta.IEvaluationResult[]; - - /** ListEvaluationResultsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListEvaluationResultsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEvaluationResultsResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListEvaluationResultsResponse): google.cloud.ces.v1beta.ListEvaluationResultsResponse; - - /** - * Encodes the specified ListEvaluationResultsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsResponse.verify|verify} messages. - * @param message ListEvaluationResultsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListEvaluationResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEvaluationResultsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsResponse.verify|verify} messages. - * @param message ListEvaluationResultsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEvaluationResultsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEvaluationResultsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationResultsResponse; - - /** - * Decodes a ListEvaluationResultsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEvaluationResultsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationResultsResponse; - - /** - * Verifies a ListEvaluationResultsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEvaluationResultsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEvaluationResultsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationResultsResponse; - - /** - * Creates a plain object from a ListEvaluationResultsResponse message. Also converts values to other types if specified. - * @param message ListEvaluationResultsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListEvaluationResultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEvaluationResultsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEvaluationResultsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEvaluationDatasetsResponse. */ - interface IListEvaluationDatasetsResponse { - - /** ListEvaluationDatasetsResponse evaluationDatasets */ - evaluationDatasets?: (google.cloud.ces.v1beta.IEvaluationDataset[]|null); - - /** ListEvaluationDatasetsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListEvaluationDatasetsResponse. */ - class ListEvaluationDatasetsResponse implements IListEvaluationDatasetsResponse { - - /** - * Constructs a new ListEvaluationDatasetsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListEvaluationDatasetsResponse); - - /** ListEvaluationDatasetsResponse evaluationDatasets. */ - public evaluationDatasets: google.cloud.ces.v1beta.IEvaluationDataset[]; - - /** ListEvaluationDatasetsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListEvaluationDatasetsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEvaluationDatasetsResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListEvaluationDatasetsResponse): google.cloud.ces.v1beta.ListEvaluationDatasetsResponse; - - /** - * Encodes the specified ListEvaluationDatasetsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.verify|verify} messages. - * @param message ListEvaluationDatasetsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListEvaluationDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEvaluationDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.verify|verify} messages. - * @param message ListEvaluationDatasetsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEvaluationDatasetsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEvaluationDatasetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationDatasetsResponse; - - /** - * Decodes a ListEvaluationDatasetsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEvaluationDatasetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationDatasetsResponse; - - /** - * Verifies a ListEvaluationDatasetsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEvaluationDatasetsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEvaluationDatasetsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationDatasetsResponse; - - /** - * Creates a plain object from a ListEvaluationDatasetsResponse message. Also converts values to other types if specified. - * @param message ListEvaluationDatasetsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListEvaluationDatasetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEvaluationDatasetsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEvaluationDatasetsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEvaluationRunsResponse. */ - interface IListEvaluationRunsResponse { - - /** ListEvaluationRunsResponse evaluationRuns */ - evaluationRuns?: (google.cloud.ces.v1beta.IEvaluationRun[]|null); - - /** ListEvaluationRunsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListEvaluationRunsResponse. */ - class ListEvaluationRunsResponse implements IListEvaluationRunsResponse { - - /** - * Constructs a new ListEvaluationRunsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListEvaluationRunsResponse); - - /** ListEvaluationRunsResponse evaluationRuns. */ - public evaluationRuns: google.cloud.ces.v1beta.IEvaluationRun[]; - - /** ListEvaluationRunsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListEvaluationRunsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEvaluationRunsResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListEvaluationRunsResponse): google.cloud.ces.v1beta.ListEvaluationRunsResponse; - - /** - * Encodes the specified ListEvaluationRunsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsResponse.verify|verify} messages. - * @param message ListEvaluationRunsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListEvaluationRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEvaluationRunsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsResponse.verify|verify} messages. - * @param message ListEvaluationRunsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEvaluationRunsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEvaluationRunsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationRunsResponse; - - /** - * Decodes a ListEvaluationRunsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEvaluationRunsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationRunsResponse; - - /** - * Verifies a ListEvaluationRunsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEvaluationRunsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEvaluationRunsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationRunsResponse; - - /** - * Creates a plain object from a ListEvaluationRunsResponse message. Also converts values to other types if specified. - * @param message ListEvaluationRunsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListEvaluationRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEvaluationRunsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEvaluationRunsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateScheduledEvaluationRunRequest. */ - interface ICreateScheduledEvaluationRunRequest { - - /** CreateScheduledEvaluationRunRequest parent */ - parent?: (string|null); - - /** CreateScheduledEvaluationRunRequest scheduledEvaluationRunId */ - scheduledEvaluationRunId?: (string|null); - - /** CreateScheduledEvaluationRunRequest scheduledEvaluationRun */ - scheduledEvaluationRun?: (google.cloud.ces.v1beta.IScheduledEvaluationRun|null); - } - - /** Represents a CreateScheduledEvaluationRunRequest. */ - class CreateScheduledEvaluationRunRequest implements ICreateScheduledEvaluationRunRequest { - - /** - * Constructs a new CreateScheduledEvaluationRunRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest); - - /** CreateScheduledEvaluationRunRequest parent. */ - public parent: string; - - /** CreateScheduledEvaluationRunRequest scheduledEvaluationRunId. */ - public scheduledEvaluationRunId: string; - - /** CreateScheduledEvaluationRunRequest scheduledEvaluationRun. */ - public scheduledEvaluationRun?: (google.cloud.ces.v1beta.IScheduledEvaluationRun|null); - - /** - * Creates a new CreateScheduledEvaluationRunRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateScheduledEvaluationRunRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest): google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest; - - /** - * Encodes the specified CreateScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest.verify|verify} messages. - * @param message CreateScheduledEvaluationRunRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest.verify|verify} messages. - * @param message CreateScheduledEvaluationRunRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateScheduledEvaluationRunRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateScheduledEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest; - - /** - * Decodes a CreateScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateScheduledEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest; - - /** - * Verifies a CreateScheduledEvaluationRunRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateScheduledEvaluationRunRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest; - - /** - * Creates a plain object from a CreateScheduledEvaluationRunRequest message. Also converts values to other types if specified. - * @param message CreateScheduledEvaluationRunRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateScheduledEvaluationRunRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateScheduledEvaluationRunRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetScheduledEvaluationRunRequest. */ - interface IGetScheduledEvaluationRunRequest { - - /** GetScheduledEvaluationRunRequest name */ - name?: (string|null); - } - - /** Represents a GetScheduledEvaluationRunRequest. */ - class GetScheduledEvaluationRunRequest implements IGetScheduledEvaluationRunRequest { - - /** - * Constructs a new GetScheduledEvaluationRunRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest); - - /** GetScheduledEvaluationRunRequest name. */ - public name: string; - - /** - * Creates a new GetScheduledEvaluationRunRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetScheduledEvaluationRunRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest): google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest; - - /** - * Encodes the specified GetScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest.verify|verify} messages. - * @param message GetScheduledEvaluationRunRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest.verify|verify} messages. - * @param message GetScheduledEvaluationRunRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetScheduledEvaluationRunRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetScheduledEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest; - - /** - * Decodes a GetScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetScheduledEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest; - - /** - * Verifies a GetScheduledEvaluationRunRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetScheduledEvaluationRunRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest; - - /** - * Creates a plain object from a GetScheduledEvaluationRunRequest message. Also converts values to other types if specified. - * @param message GetScheduledEvaluationRunRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetScheduledEvaluationRunRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetScheduledEvaluationRunRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListScheduledEvaluationRunsRequest. */ - interface IListScheduledEvaluationRunsRequest { - - /** ListScheduledEvaluationRunsRequest parent */ - parent?: (string|null); - - /** ListScheduledEvaluationRunsRequest pageSize */ - pageSize?: (number|null); - - /** ListScheduledEvaluationRunsRequest pageToken */ - pageToken?: (string|null); - - /** ListScheduledEvaluationRunsRequest filter */ - filter?: (string|null); - - /** ListScheduledEvaluationRunsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListScheduledEvaluationRunsRequest. */ - class ListScheduledEvaluationRunsRequest implements IListScheduledEvaluationRunsRequest { - - /** - * Constructs a new ListScheduledEvaluationRunsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest); - - /** ListScheduledEvaluationRunsRequest parent. */ - public parent: string; - - /** ListScheduledEvaluationRunsRequest pageSize. */ - public pageSize: number; - - /** ListScheduledEvaluationRunsRequest pageToken. */ - public pageToken: string; - - /** ListScheduledEvaluationRunsRequest filter. */ - public filter: string; - - /** ListScheduledEvaluationRunsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListScheduledEvaluationRunsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListScheduledEvaluationRunsRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest): google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest; - - /** - * Encodes the specified ListScheduledEvaluationRunsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest.verify|verify} messages. - * @param message ListScheduledEvaluationRunsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListScheduledEvaluationRunsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest.verify|verify} messages. - * @param message ListScheduledEvaluationRunsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListScheduledEvaluationRunsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListScheduledEvaluationRunsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest; - - /** - * Decodes a ListScheduledEvaluationRunsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListScheduledEvaluationRunsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest; - - /** - * Verifies a ListScheduledEvaluationRunsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListScheduledEvaluationRunsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListScheduledEvaluationRunsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest; - - /** - * Creates a plain object from a ListScheduledEvaluationRunsRequest message. Also converts values to other types if specified. - * @param message ListScheduledEvaluationRunsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListScheduledEvaluationRunsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListScheduledEvaluationRunsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListScheduledEvaluationRunsResponse. */ - interface IListScheduledEvaluationRunsResponse { - - /** ListScheduledEvaluationRunsResponse scheduledEvaluationRuns */ - scheduledEvaluationRuns?: (google.cloud.ces.v1beta.IScheduledEvaluationRun[]|null); - - /** ListScheduledEvaluationRunsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListScheduledEvaluationRunsResponse. */ - class ListScheduledEvaluationRunsResponse implements IListScheduledEvaluationRunsResponse { - - /** - * Constructs a new ListScheduledEvaluationRunsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse); - - /** ListScheduledEvaluationRunsResponse scheduledEvaluationRuns. */ - public scheduledEvaluationRuns: google.cloud.ces.v1beta.IScheduledEvaluationRun[]; - - /** ListScheduledEvaluationRunsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListScheduledEvaluationRunsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListScheduledEvaluationRunsResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse): google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse; - - /** - * Encodes the specified ListScheduledEvaluationRunsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.verify|verify} messages. - * @param message ListScheduledEvaluationRunsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListScheduledEvaluationRunsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.verify|verify} messages. - * @param message ListScheduledEvaluationRunsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListScheduledEvaluationRunsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListScheduledEvaluationRunsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse; - - /** - * Decodes a ListScheduledEvaluationRunsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListScheduledEvaluationRunsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse; - - /** - * Verifies a ListScheduledEvaluationRunsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListScheduledEvaluationRunsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListScheduledEvaluationRunsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse; - - /** - * Creates a plain object from a ListScheduledEvaluationRunsResponse message. Also converts values to other types if specified. - * @param message ListScheduledEvaluationRunsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListScheduledEvaluationRunsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListScheduledEvaluationRunsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateScheduledEvaluationRunRequest. */ - interface IUpdateScheduledEvaluationRunRequest { - - /** UpdateScheduledEvaluationRunRequest scheduledEvaluationRun */ - scheduledEvaluationRun?: (google.cloud.ces.v1beta.IScheduledEvaluationRun|null); - - /** UpdateScheduledEvaluationRunRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateScheduledEvaluationRunRequest. */ - class UpdateScheduledEvaluationRunRequest implements IUpdateScheduledEvaluationRunRequest { - - /** - * Constructs a new UpdateScheduledEvaluationRunRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest); - - /** UpdateScheduledEvaluationRunRequest scheduledEvaluationRun. */ - public scheduledEvaluationRun?: (google.cloud.ces.v1beta.IScheduledEvaluationRun|null); - - /** UpdateScheduledEvaluationRunRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateScheduledEvaluationRunRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateScheduledEvaluationRunRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest): google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest; - - /** - * Encodes the specified UpdateScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest.verify|verify} messages. - * @param message UpdateScheduledEvaluationRunRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest.verify|verify} messages. - * @param message UpdateScheduledEvaluationRunRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateScheduledEvaluationRunRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateScheduledEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest; - - /** - * Decodes an UpdateScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateScheduledEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest; - - /** - * Verifies an UpdateScheduledEvaluationRunRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateScheduledEvaluationRunRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest; - - /** - * Creates a plain object from an UpdateScheduledEvaluationRunRequest message. Also converts values to other types if specified. - * @param message UpdateScheduledEvaluationRunRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateScheduledEvaluationRunRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateScheduledEvaluationRunRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteScheduledEvaluationRunRequest. */ - interface IDeleteScheduledEvaluationRunRequest { - - /** DeleteScheduledEvaluationRunRequest name */ - name?: (string|null); - - /** DeleteScheduledEvaluationRunRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteScheduledEvaluationRunRequest. */ - class DeleteScheduledEvaluationRunRequest implements IDeleteScheduledEvaluationRunRequest { - - /** - * Constructs a new DeleteScheduledEvaluationRunRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest); - - /** DeleteScheduledEvaluationRunRequest name. */ - public name: string; - - /** DeleteScheduledEvaluationRunRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteScheduledEvaluationRunRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteScheduledEvaluationRunRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest): google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest; - - /** - * Encodes the specified DeleteScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest.verify|verify} messages. - * @param message DeleteScheduledEvaluationRunRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest.verify|verify} messages. - * @param message DeleteScheduledEvaluationRunRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteScheduledEvaluationRunRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteScheduledEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest; - - /** - * Decodes a DeleteScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteScheduledEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest; - - /** - * Verifies a DeleteScheduledEvaluationRunRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteScheduledEvaluationRunRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest; - - /** - * Creates a plain object from a DeleteScheduledEvaluationRunRequest message. Also converts values to other types if specified. - * @param message DeleteScheduledEvaluationRunRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteScheduledEvaluationRunRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteScheduledEvaluationRunRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TestPersonaVoiceRequest. */ - interface ITestPersonaVoiceRequest { - - /** TestPersonaVoiceRequest app */ - app?: (string|null); - - /** TestPersonaVoiceRequest personaId */ - personaId?: (string|null); - - /** TestPersonaVoiceRequest text */ - text?: (string|null); - } - - /** Represents a TestPersonaVoiceRequest. */ - class TestPersonaVoiceRequest implements ITestPersonaVoiceRequest { - - /** - * Constructs a new TestPersonaVoiceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ITestPersonaVoiceRequest); - - /** TestPersonaVoiceRequest app. */ - public app: string; - - /** TestPersonaVoiceRequest personaId. */ - public personaId: string; - - /** TestPersonaVoiceRequest text. */ - public text: string; - - /** - * Creates a new TestPersonaVoiceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns TestPersonaVoiceRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.ITestPersonaVoiceRequest): google.cloud.ces.v1beta.TestPersonaVoiceRequest; - - /** - * Encodes the specified TestPersonaVoiceRequest message. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceRequest.verify|verify} messages. - * @param message TestPersonaVoiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ITestPersonaVoiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TestPersonaVoiceRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceRequest.verify|verify} messages. - * @param message TestPersonaVoiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ITestPersonaVoiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TestPersonaVoiceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestPersonaVoiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TestPersonaVoiceRequest; - - /** - * Decodes a TestPersonaVoiceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestPersonaVoiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TestPersonaVoiceRequest; - - /** - * Verifies a TestPersonaVoiceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TestPersonaVoiceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestPersonaVoiceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TestPersonaVoiceRequest; - - /** - * Creates a plain object from a TestPersonaVoiceRequest message. Also converts values to other types if specified. - * @param message TestPersonaVoiceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.TestPersonaVoiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TestPersonaVoiceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TestPersonaVoiceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UploadEvaluationAudioRequest. */ - interface IUploadEvaluationAudioRequest { - - /** UploadEvaluationAudioRequest app */ - app?: (string|null); - - /** UploadEvaluationAudioRequest audioContent */ - audioContent?: (Uint8Array|Buffer|string|null); - } - - /** Represents an UploadEvaluationAudioRequest. */ - class UploadEvaluationAudioRequest implements IUploadEvaluationAudioRequest { - - /** - * Constructs a new UploadEvaluationAudioRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IUploadEvaluationAudioRequest); - - /** UploadEvaluationAudioRequest app. */ - public app: string; - - /** UploadEvaluationAudioRequest audioContent. */ - public audioContent: (Uint8Array|Buffer|string); - - /** - * Creates a new UploadEvaluationAudioRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UploadEvaluationAudioRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IUploadEvaluationAudioRequest): google.cloud.ces.v1beta.UploadEvaluationAudioRequest; - - /** - * Encodes the specified UploadEvaluationAudioRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioRequest.verify|verify} messages. - * @param message UploadEvaluationAudioRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IUploadEvaluationAudioRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UploadEvaluationAudioRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioRequest.verify|verify} messages. - * @param message UploadEvaluationAudioRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IUploadEvaluationAudioRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UploadEvaluationAudioRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UploadEvaluationAudioRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UploadEvaluationAudioRequest; - - /** - * Decodes an UploadEvaluationAudioRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UploadEvaluationAudioRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UploadEvaluationAudioRequest; - - /** - * Verifies an UploadEvaluationAudioRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UploadEvaluationAudioRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UploadEvaluationAudioRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UploadEvaluationAudioRequest; - - /** - * Creates a plain object from an UploadEvaluationAudioRequest message. Also converts values to other types if specified. - * @param message UploadEvaluationAudioRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.UploadEvaluationAudioRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UploadEvaluationAudioRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UploadEvaluationAudioRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UploadEvaluationAudioResponse. */ - interface IUploadEvaluationAudioResponse { - - /** UploadEvaluationAudioResponse audioGcsUri */ - audioGcsUri?: (string|null); - - /** UploadEvaluationAudioResponse audioTranscript */ - audioTranscript?: (string|null); - - /** UploadEvaluationAudioResponse audioDuration */ - audioDuration?: (google.protobuf.IDuration|null); - } - - /** Represents an UploadEvaluationAudioResponse. */ - class UploadEvaluationAudioResponse implements IUploadEvaluationAudioResponse { - - /** - * Constructs a new UploadEvaluationAudioResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IUploadEvaluationAudioResponse); - - /** UploadEvaluationAudioResponse audioGcsUri. */ - public audioGcsUri: string; - - /** UploadEvaluationAudioResponse audioTranscript. */ - public audioTranscript: string; - - /** UploadEvaluationAudioResponse audioDuration. */ - public audioDuration?: (google.protobuf.IDuration|null); - - /** - * Creates a new UploadEvaluationAudioResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns UploadEvaluationAudioResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IUploadEvaluationAudioResponse): google.cloud.ces.v1beta.UploadEvaluationAudioResponse; - - /** - * Encodes the specified UploadEvaluationAudioResponse message. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioResponse.verify|verify} messages. - * @param message UploadEvaluationAudioResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IUploadEvaluationAudioResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UploadEvaluationAudioResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioResponse.verify|verify} messages. - * @param message UploadEvaluationAudioResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IUploadEvaluationAudioResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UploadEvaluationAudioResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UploadEvaluationAudioResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UploadEvaluationAudioResponse; - - /** - * Decodes an UploadEvaluationAudioResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UploadEvaluationAudioResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UploadEvaluationAudioResponse; - - /** - * Verifies an UploadEvaluationAudioResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UploadEvaluationAudioResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UploadEvaluationAudioResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UploadEvaluationAudioResponse; - - /** - * Creates a plain object from an UploadEvaluationAudioResponse message. Also converts values to other types if specified. - * @param message UploadEvaluationAudioResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.UploadEvaluationAudioResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UploadEvaluationAudioResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UploadEvaluationAudioResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TestPersonaVoiceResponse. */ - interface ITestPersonaVoiceResponse { - - /** TestPersonaVoiceResponse audio */ - audio?: (Uint8Array|Buffer|string|null); - } - - /** Represents a TestPersonaVoiceResponse. */ - class TestPersonaVoiceResponse implements ITestPersonaVoiceResponse { - - /** - * Constructs a new TestPersonaVoiceResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ITestPersonaVoiceResponse); - - /** TestPersonaVoiceResponse audio. */ - public audio: (Uint8Array|Buffer|string); - - /** - * Creates a new TestPersonaVoiceResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns TestPersonaVoiceResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.ITestPersonaVoiceResponse): google.cloud.ces.v1beta.TestPersonaVoiceResponse; - - /** - * Encodes the specified TestPersonaVoiceResponse message. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceResponse.verify|verify} messages. - * @param message TestPersonaVoiceResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ITestPersonaVoiceResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TestPersonaVoiceResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceResponse.verify|verify} messages. - * @param message TestPersonaVoiceResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ITestPersonaVoiceResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TestPersonaVoiceResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestPersonaVoiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TestPersonaVoiceResponse; - - /** - * Decodes a TestPersonaVoiceResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestPersonaVoiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TestPersonaVoiceResponse; - - /** - * Verifies a TestPersonaVoiceResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TestPersonaVoiceResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestPersonaVoiceResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TestPersonaVoiceResponse; - - /** - * Creates a plain object from a TestPersonaVoiceResponse message. Also converts values to other types if specified. - * @param message TestPersonaVoiceResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.TestPersonaVoiceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TestPersonaVoiceResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TestPersonaVoiceResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateEvaluationExpectationRequest. */ - interface ICreateEvaluationExpectationRequest { - - /** CreateEvaluationExpectationRequest parent */ - parent?: (string|null); - - /** CreateEvaluationExpectationRequest evaluationExpectationId */ - evaluationExpectationId?: (string|null); - - /** CreateEvaluationExpectationRequest evaluationExpectation */ - evaluationExpectation?: (google.cloud.ces.v1beta.IEvaluationExpectation|null); - } - - /** Represents a CreateEvaluationExpectationRequest. */ - class CreateEvaluationExpectationRequest implements ICreateEvaluationExpectationRequest { - - /** - * Constructs a new CreateEvaluationExpectationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest); - - /** CreateEvaluationExpectationRequest parent. */ - public parent: string; - - /** CreateEvaluationExpectationRequest evaluationExpectationId. */ - public evaluationExpectationId: string; - - /** CreateEvaluationExpectationRequest evaluationExpectation. */ - public evaluationExpectation?: (google.cloud.ces.v1beta.IEvaluationExpectation|null); - - /** - * Creates a new CreateEvaluationExpectationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateEvaluationExpectationRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest): google.cloud.ces.v1beta.CreateEvaluationExpectationRequest; - - /** - * Encodes the specified CreateEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationExpectationRequest.verify|verify} messages. - * @param message CreateEvaluationExpectationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationExpectationRequest.verify|verify} messages. - * @param message CreateEvaluationExpectationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateEvaluationExpectationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateEvaluationExpectationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateEvaluationExpectationRequest; - - /** - * Decodes a CreateEvaluationExpectationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateEvaluationExpectationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateEvaluationExpectationRequest; - - /** - * Verifies a CreateEvaluationExpectationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateEvaluationExpectationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateEvaluationExpectationRequest; - - /** - * Creates a plain object from a CreateEvaluationExpectationRequest message. Also converts values to other types if specified. - * @param message CreateEvaluationExpectationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.CreateEvaluationExpectationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateEvaluationExpectationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateEvaluationExpectationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateEvaluationExpectationRequest. */ - interface IUpdateEvaluationExpectationRequest { - - /** UpdateEvaluationExpectationRequest evaluationExpectation */ - evaluationExpectation?: (google.cloud.ces.v1beta.IEvaluationExpectation|null); - - /** UpdateEvaluationExpectationRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateEvaluationExpectationRequest. */ - class UpdateEvaluationExpectationRequest implements IUpdateEvaluationExpectationRequest { - - /** - * Constructs a new UpdateEvaluationExpectationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest); - - /** UpdateEvaluationExpectationRequest evaluationExpectation. */ - public evaluationExpectation?: (google.cloud.ces.v1beta.IEvaluationExpectation|null); - - /** UpdateEvaluationExpectationRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateEvaluationExpectationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateEvaluationExpectationRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest): google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest; - - /** - * Encodes the specified UpdateEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest.verify|verify} messages. - * @param message UpdateEvaluationExpectationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest.verify|verify} messages. - * @param message UpdateEvaluationExpectationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateEvaluationExpectationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateEvaluationExpectationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest; - - /** - * Decodes an UpdateEvaluationExpectationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateEvaluationExpectationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest; - - /** - * Verifies an UpdateEvaluationExpectationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateEvaluationExpectationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest; - - /** - * Creates a plain object from an UpdateEvaluationExpectationRequest message. Also converts values to other types if specified. - * @param message UpdateEvaluationExpectationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateEvaluationExpectationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateEvaluationExpectationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteEvaluationExpectationRequest. */ - interface IDeleteEvaluationExpectationRequest { - - /** DeleteEvaluationExpectationRequest name */ - name?: (string|null); - - /** DeleteEvaluationExpectationRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteEvaluationExpectationRequest. */ - class DeleteEvaluationExpectationRequest implements IDeleteEvaluationExpectationRequest { - - /** - * Constructs a new DeleteEvaluationExpectationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest); - - /** DeleteEvaluationExpectationRequest name. */ - public name: string; - - /** DeleteEvaluationExpectationRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteEvaluationExpectationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteEvaluationExpectationRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest): google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest; - - /** - * Encodes the specified DeleteEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest.verify|verify} messages. - * @param message DeleteEvaluationExpectationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest.verify|verify} messages. - * @param message DeleteEvaluationExpectationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteEvaluationExpectationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteEvaluationExpectationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest; - - /** - * Decodes a DeleteEvaluationExpectationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteEvaluationExpectationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest; - - /** - * Verifies a DeleteEvaluationExpectationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteEvaluationExpectationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest; - - /** - * Creates a plain object from a DeleteEvaluationExpectationRequest message. Also converts values to other types if specified. - * @param message DeleteEvaluationExpectationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteEvaluationExpectationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteEvaluationExpectationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetEvaluationExpectationRequest. */ - interface IGetEvaluationExpectationRequest { - - /** GetEvaluationExpectationRequest name */ - name?: (string|null); - } - - /** Represents a GetEvaluationExpectationRequest. */ - class GetEvaluationExpectationRequest implements IGetEvaluationExpectationRequest { - - /** - * Constructs a new GetEvaluationExpectationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGetEvaluationExpectationRequest); - - /** GetEvaluationExpectationRequest name. */ - public name: string; - - /** - * Creates a new GetEvaluationExpectationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetEvaluationExpectationRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGetEvaluationExpectationRequest): google.cloud.ces.v1beta.GetEvaluationExpectationRequest; - - /** - * Encodes the specified GetEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationExpectationRequest.verify|verify} messages. - * @param message GetEvaluationExpectationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGetEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationExpectationRequest.verify|verify} messages. - * @param message GetEvaluationExpectationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGetEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetEvaluationExpectationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetEvaluationExpectationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetEvaluationExpectationRequest; - - /** - * Decodes a GetEvaluationExpectationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetEvaluationExpectationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetEvaluationExpectationRequest; - - /** - * Verifies a GetEvaluationExpectationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetEvaluationExpectationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetEvaluationExpectationRequest; - - /** - * Creates a plain object from a GetEvaluationExpectationRequest message. Also converts values to other types if specified. - * @param message GetEvaluationExpectationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GetEvaluationExpectationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetEvaluationExpectationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetEvaluationExpectationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEvaluationExpectationsRequest. */ - interface IListEvaluationExpectationsRequest { - - /** ListEvaluationExpectationsRequest parent */ - parent?: (string|null); - - /** ListEvaluationExpectationsRequest pageSize */ - pageSize?: (number|null); - - /** ListEvaluationExpectationsRequest pageToken */ - pageToken?: (string|null); - - /** ListEvaluationExpectationsRequest filter */ - filter?: (string|null); - - /** ListEvaluationExpectationsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListEvaluationExpectationsRequest. */ - class ListEvaluationExpectationsRequest implements IListEvaluationExpectationsRequest { - - /** - * Constructs a new ListEvaluationExpectationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListEvaluationExpectationsRequest); - - /** ListEvaluationExpectationsRequest parent. */ - public parent: string; - - /** ListEvaluationExpectationsRequest pageSize. */ - public pageSize: number; - - /** ListEvaluationExpectationsRequest pageToken. */ - public pageToken: string; - - /** ListEvaluationExpectationsRequest filter. */ - public filter: string; - - /** ListEvaluationExpectationsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListEvaluationExpectationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEvaluationExpectationsRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListEvaluationExpectationsRequest): google.cloud.ces.v1beta.ListEvaluationExpectationsRequest; - - /** - * Encodes the specified ListEvaluationExpectationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsRequest.verify|verify} messages. - * @param message ListEvaluationExpectationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEvaluationExpectationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsRequest.verify|verify} messages. - * @param message ListEvaluationExpectationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEvaluationExpectationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEvaluationExpectationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationExpectationsRequest; - - /** - * Decodes a ListEvaluationExpectationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEvaluationExpectationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationExpectationsRequest; - - /** - * Verifies a ListEvaluationExpectationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEvaluationExpectationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEvaluationExpectationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationExpectationsRequest; - - /** - * Creates a plain object from a ListEvaluationExpectationsRequest message. Also converts values to other types if specified. - * @param message ListEvaluationExpectationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListEvaluationExpectationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEvaluationExpectationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEvaluationExpectationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEvaluationExpectationsResponse. */ - interface IListEvaluationExpectationsResponse { - - /** ListEvaluationExpectationsResponse evaluationExpectations */ - evaluationExpectations?: (google.cloud.ces.v1beta.IEvaluationExpectation[]|null); - - /** ListEvaluationExpectationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListEvaluationExpectationsResponse. */ - class ListEvaluationExpectationsResponse implements IListEvaluationExpectationsResponse { - - /** - * Constructs a new ListEvaluationExpectationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IListEvaluationExpectationsResponse); - - /** ListEvaluationExpectationsResponse evaluationExpectations. */ - public evaluationExpectations: google.cloud.ces.v1beta.IEvaluationExpectation[]; - - /** ListEvaluationExpectationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListEvaluationExpectationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEvaluationExpectationsResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IListEvaluationExpectationsResponse): google.cloud.ces.v1beta.ListEvaluationExpectationsResponse; - - /** - * Encodes the specified ListEvaluationExpectationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.verify|verify} messages. - * @param message ListEvaluationExpectationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IListEvaluationExpectationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEvaluationExpectationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.verify|verify} messages. - * @param message ListEvaluationExpectationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationExpectationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEvaluationExpectationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEvaluationExpectationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationExpectationsResponse; - - /** - * Decodes a ListEvaluationExpectationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEvaluationExpectationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationExpectationsResponse; - - /** - * Verifies a ListEvaluationExpectationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEvaluationExpectationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEvaluationExpectationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationExpectationsResponse; - - /** - * Creates a plain object from a ListEvaluationExpectationsResponse message. Also converts values to other types if specified. - * @param message ListEvaluationExpectationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ListEvaluationExpectationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEvaluationExpectationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEvaluationExpectationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Omnichannel. */ - interface IOmnichannel { - - /** Omnichannel name */ - name?: (string|null); - - /** Omnichannel displayName */ - displayName?: (string|null); - - /** Omnichannel description */ - description?: (string|null); - - /** Omnichannel createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Omnichannel updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Omnichannel etag */ - etag?: (string|null); - - /** Omnichannel integrationConfig */ - integrationConfig?: (google.cloud.ces.v1beta.IOmnichannelIntegrationConfig|null); - } - - /** Represents an Omnichannel. */ - class Omnichannel implements IOmnichannel { - - /** - * Constructs a new Omnichannel. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IOmnichannel); - - /** Omnichannel name. */ - public name: string; - - /** Omnichannel displayName. */ - public displayName: string; - - /** Omnichannel description. */ - public description: string; - - /** Omnichannel createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Omnichannel updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Omnichannel etag. */ - public etag: string; - - /** Omnichannel integrationConfig. */ - public integrationConfig?: (google.cloud.ces.v1beta.IOmnichannelIntegrationConfig|null); - - /** - * Creates a new Omnichannel instance using the specified properties. - * @param [properties] Properties to set - * @returns Omnichannel instance - */ - public static create(properties?: google.cloud.ces.v1beta.IOmnichannel): google.cloud.ces.v1beta.Omnichannel; - - /** - * Encodes the specified Omnichannel message. Does not implicitly {@link google.cloud.ces.v1beta.Omnichannel.verify|verify} messages. - * @param message Omnichannel message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IOmnichannel, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Omnichannel message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Omnichannel.verify|verify} messages. - * @param message Omnichannel message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IOmnichannel, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Omnichannel message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Omnichannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Omnichannel; - - /** - * Decodes an Omnichannel message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Omnichannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Omnichannel; - - /** - * Verifies an Omnichannel message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Omnichannel message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Omnichannel - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Omnichannel; - - /** - * Creates a plain object from an Omnichannel message. Also converts values to other types if specified. - * @param message Omnichannel - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.Omnichannel, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Omnichannel to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Omnichannel - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OmnichannelIntegrationConfig. */ - interface IOmnichannelIntegrationConfig { - - /** OmnichannelIntegrationConfig channelConfigs */ - channelConfigs?: ({ [k: string]: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig }|null); - - /** OmnichannelIntegrationConfig subscriberConfigs */ - subscriberConfigs?: ({ [k: string]: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig }|null); - - /** OmnichannelIntegrationConfig routingConfigs */ - routingConfigs?: ({ [k: string]: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig }|null); - } - - /** Represents an OmnichannelIntegrationConfig. */ - class OmnichannelIntegrationConfig implements IOmnichannelIntegrationConfig { - - /** - * Constructs a new OmnichannelIntegrationConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IOmnichannelIntegrationConfig); - - /** OmnichannelIntegrationConfig channelConfigs. */ - public channelConfigs: { [k: string]: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig }; - - /** OmnichannelIntegrationConfig subscriberConfigs. */ - public subscriberConfigs: { [k: string]: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig }; - - /** OmnichannelIntegrationConfig routingConfigs. */ - public routingConfigs: { [k: string]: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig }; - - /** - * Creates a new OmnichannelIntegrationConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns OmnichannelIntegrationConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.IOmnichannelIntegrationConfig): google.cloud.ces.v1beta.OmnichannelIntegrationConfig; - - /** - * Encodes the specified OmnichannelIntegrationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.verify|verify} messages. - * @param message OmnichannelIntegrationConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IOmnichannelIntegrationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OmnichannelIntegrationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.verify|verify} messages. - * @param message OmnichannelIntegrationConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IOmnichannelIntegrationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OmnichannelIntegrationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelIntegrationConfig; - - /** - * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OmnichannelIntegrationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelIntegrationConfig; - - /** - * Verifies an OmnichannelIntegrationConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OmnichannelIntegrationConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OmnichannelIntegrationConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelIntegrationConfig; - - /** - * Creates a plain object from an OmnichannelIntegrationConfig message. Also converts values to other types if specified. - * @param message OmnichannelIntegrationConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OmnichannelIntegrationConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OmnichannelIntegrationConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace OmnichannelIntegrationConfig { - - /** Properties of a ChannelConfig. */ - interface IChannelConfig { - - /** ChannelConfig whatsappConfig */ - whatsappConfig?: (google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig|null); - } - - /** Represents a ChannelConfig. */ - class ChannelConfig implements IChannelConfig { - - /** - * Constructs a new ChannelConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig); - - /** ChannelConfig whatsappConfig. */ - public whatsappConfig?: (google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig|null); - - /** ChannelConfig channelConfig. */ - public channelConfig?: "whatsappConfig"; - - /** - * Creates a new ChannelConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ChannelConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig; - - /** - * Encodes the specified ChannelConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. - * @param message ChannelConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChannelConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. - * @param message ChannelConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChannelConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChannelConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig; - - /** - * Decodes a ChannelConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChannelConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig; - - /** - * Verifies a ChannelConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ChannelConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChannelConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig; - - /** - * Creates a plain object from a ChannelConfig message. Also converts values to other types if specified. - * @param message ChannelConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChannelConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ChannelConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WhatsappConfig. */ - interface IWhatsappConfig { - - /** WhatsappConfig phoneNumberId */ - phoneNumberId?: (string|null); - - /** WhatsappConfig phoneNumber */ - phoneNumber?: (string|null); - - /** WhatsappConfig whatsappBusinessAccountId */ - whatsappBusinessAccountId?: (string|null); - - /** WhatsappConfig webhookVerifyToken */ - webhookVerifyToken?: (string|null); - - /** WhatsappConfig whatsappBusinessToken */ - whatsappBusinessToken?: (string|null); - - /** WhatsappConfig metaBusinessPortfolioId */ - metaBusinessPortfolioId?: (string|null); - } - - /** Represents a WhatsappConfig. */ - class WhatsappConfig implements IWhatsappConfig { - - /** - * Constructs a new WhatsappConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig); - - /** WhatsappConfig phoneNumberId. */ - public phoneNumberId: string; - - /** WhatsappConfig phoneNumber. */ - public phoneNumber: string; - - /** WhatsappConfig whatsappBusinessAccountId. */ - public whatsappBusinessAccountId: string; - - /** WhatsappConfig webhookVerifyToken. */ - public webhookVerifyToken: string; - - /** WhatsappConfig whatsappBusinessToken. */ - public whatsappBusinessToken: string; - - /** WhatsappConfig metaBusinessPortfolioId. */ - public metaBusinessPortfolioId: string; - - /** - * Creates a new WhatsappConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns WhatsappConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig; - - /** - * Encodes the specified WhatsappConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. - * @param message WhatsappConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WhatsappConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. - * @param message WhatsappConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WhatsappConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WhatsappConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig; - - /** - * Decodes a WhatsappConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WhatsappConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig; - - /** - * Verifies a WhatsappConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WhatsappConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WhatsappConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig; - - /** - * Creates a plain object from a WhatsappConfig message. Also converts values to other types if specified. - * @param message WhatsappConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WhatsappConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WhatsappConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SubscriberConfig. */ - interface ISubscriberConfig { - - /** SubscriberConfig cesAppConfig */ - cesAppConfig?: (google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig|null); - } - - /** Represents a SubscriberConfig. */ - class SubscriberConfig implements ISubscriberConfig { - - /** - * Constructs a new SubscriberConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig); - - /** SubscriberConfig cesAppConfig. */ - public cesAppConfig?: (google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig|null); - - /** SubscriberConfig subscriberConfig. */ - public subscriberConfig?: "cesAppConfig"; - - /** - * Creates a new SubscriberConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SubscriberConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig; - - /** - * Encodes the specified SubscriberConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. - * @param message SubscriberConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SubscriberConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. - * @param message SubscriberConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SubscriberConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SubscriberConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig; - - /** - * Decodes a SubscriberConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SubscriberConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig; - - /** - * Verifies a SubscriberConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SubscriberConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SubscriberConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig; - - /** - * Creates a plain object from a SubscriberConfig message. Also converts values to other types if specified. - * @param message SubscriberConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SubscriberConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SubscriberConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CesAppConfig. */ - interface ICesAppConfig { - - /** CesAppConfig app */ - app?: (string|null); - } - - /** Represents a CesAppConfig. */ - class CesAppConfig implements ICesAppConfig { - - /** - * Constructs a new CesAppConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig); - - /** CesAppConfig app. */ - public app: string; - - /** - * Creates a new CesAppConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns CesAppConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig; - - /** - * Encodes the specified CesAppConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. - * @param message CesAppConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CesAppConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. - * @param message CesAppConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CesAppConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CesAppConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig; - - /** - * Decodes a CesAppConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CesAppConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig; - - /** - * Verifies a CesAppConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CesAppConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CesAppConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig; - - /** - * Creates a plain object from a CesAppConfig message. Also converts values to other types if specified. - * @param message CesAppConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CesAppConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CesAppConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RoutingConfig. */ - interface IRoutingConfig { - - /** RoutingConfig subscriberKey */ - subscriberKey?: (string|null); - } - - /** Represents a RoutingConfig. */ - class RoutingConfig implements IRoutingConfig { - - /** - * Constructs a new RoutingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig); - - /** RoutingConfig subscriberKey. */ - public subscriberKey: string; - - /** - * Creates a new RoutingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns RoutingConfig instance - */ - public static create(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig; - - /** - * Encodes the specified RoutingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. - * @param message RoutingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RoutingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. - * @param message RoutingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RoutingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RoutingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig; - - /** - * Decodes a RoutingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RoutingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig; - - /** - * Verifies a RoutingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RoutingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RoutingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig; - - /** - * Creates a plain object from a RoutingConfig message. Also converts values to other types if specified. - * @param message RoutingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RoutingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RoutingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OmnichannelOperationMetadata. */ - interface IOmnichannelOperationMetadata { - - /** OmnichannelOperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** OmnichannelOperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** OmnichannelOperationMetadata statusMessage */ - statusMessage?: (string|null); - - /** OmnichannelOperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); - } - - /** Represents an OmnichannelOperationMetadata. */ - class OmnichannelOperationMetadata implements IOmnichannelOperationMetadata { - - /** - * Constructs a new OmnichannelOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IOmnichannelOperationMetadata); - - /** OmnichannelOperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OmnichannelOperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OmnichannelOperationMetadata statusMessage. */ - public statusMessage: string; - - /** OmnichannelOperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; - - /** - * Creates a new OmnichannelOperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns OmnichannelOperationMetadata instance - */ - public static create(properties?: google.cloud.ces.v1beta.IOmnichannelOperationMetadata): google.cloud.ces.v1beta.OmnichannelOperationMetadata; - - /** - * Encodes the specified OmnichannelOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelOperationMetadata.verify|verify} messages. - * @param message OmnichannelOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IOmnichannelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OmnichannelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelOperationMetadata.verify|verify} messages. - * @param message OmnichannelOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IOmnichannelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OmnichannelOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelOperationMetadata; - - /** - * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OmnichannelOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelOperationMetadata; - - /** - * Verifies an OmnichannelOperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OmnichannelOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OmnichannelOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelOperationMetadata; - - /** - * Creates a plain object from an OmnichannelOperationMetadata message. Also converts values to other types if specified. - * @param message OmnichannelOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.OmnichannelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OmnichannelOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OmnichannelOperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a ToolService */ - class ToolService extends $protobuf.rpc.Service { - - /** - * Constructs a new ToolService 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 ToolService 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): ToolService; - - /** - * Calls ExecuteTool. - * @param request ExecuteToolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ExecuteToolResponse - */ - public executeTool(request: google.cloud.ces.v1beta.IExecuteToolRequest, callback: google.cloud.ces.v1beta.ToolService.ExecuteToolCallback): void; - - /** - * Calls ExecuteTool. - * @param request ExecuteToolRequest message or plain object - * @returns Promise - */ - public executeTool(request: google.cloud.ces.v1beta.IExecuteToolRequest): Promise; - - /** - * Calls RetrieveToolSchema. - * @param request RetrieveToolSchemaRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RetrieveToolSchemaResponse - */ - public retrieveToolSchema(request: google.cloud.ces.v1beta.IRetrieveToolSchemaRequest, callback: google.cloud.ces.v1beta.ToolService.RetrieveToolSchemaCallback): void; - - /** - * Calls RetrieveToolSchema. - * @param request RetrieveToolSchemaRequest message or plain object - * @returns Promise - */ - public retrieveToolSchema(request: google.cloud.ces.v1beta.IRetrieveToolSchemaRequest): Promise; - - /** - * Calls RetrieveTools. - * @param request RetrieveToolsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RetrieveToolsResponse - */ - public retrieveTools(request: google.cloud.ces.v1beta.IRetrieveToolsRequest, callback: google.cloud.ces.v1beta.ToolService.RetrieveToolsCallback): void; - - /** - * Calls RetrieveTools. - * @param request RetrieveToolsRequest message or plain object - * @returns Promise - */ - public retrieveTools(request: google.cloud.ces.v1beta.IRetrieveToolsRequest): Promise; - } - - namespace ToolService { - - /** - * Callback as used by {@link google.cloud.ces.v1beta.ToolService|executeTool}. - * @param error Error, if any - * @param [response] ExecuteToolResponse - */ - type ExecuteToolCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ExecuteToolResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.ToolService|retrieveToolSchema}. - * @param error Error, if any - * @param [response] RetrieveToolSchemaResponse - */ - type RetrieveToolSchemaCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.RetrieveToolSchemaResponse) => void; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.ToolService|retrieveTools}. - * @param error Error, if any - * @param [response] RetrieveToolsResponse - */ - type RetrieveToolsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.RetrieveToolsResponse) => void; - } - - /** Properties of an ExecuteToolRequest. */ - interface IExecuteToolRequest { - - /** ExecuteToolRequest tool */ - tool?: (string|null); - - /** ExecuteToolRequest toolsetTool */ - toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); - - /** ExecuteToolRequest parent */ - parent?: (string|null); - - /** ExecuteToolRequest args */ - args?: (google.protobuf.IStruct|null); - - /** ExecuteToolRequest variables */ - variables?: (google.protobuf.IStruct|null); - } - - /** Represents an ExecuteToolRequest. */ - class ExecuteToolRequest implements IExecuteToolRequest { - - /** - * Constructs a new ExecuteToolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IExecuteToolRequest); - - /** ExecuteToolRequest tool. */ - public tool?: (string|null); - - /** ExecuteToolRequest toolsetTool. */ - public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); - - /** ExecuteToolRequest parent. */ - public parent: string; - - /** ExecuteToolRequest args. */ - public args?: (google.protobuf.IStruct|null); - - /** ExecuteToolRequest variables. */ - public variables?: (google.protobuf.IStruct|null); - - /** ExecuteToolRequest toolIdentifier. */ - public toolIdentifier?: ("tool"|"toolsetTool"); - - /** - * Creates a new ExecuteToolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteToolRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IExecuteToolRequest): google.cloud.ces.v1beta.ExecuteToolRequest; - - /** - * Encodes the specified ExecuteToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolRequest.verify|verify} messages. - * @param message ExecuteToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IExecuteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolRequest.verify|verify} messages. - * @param message ExecuteToolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IExecuteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteToolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ExecuteToolRequest; - - /** - * Decodes an ExecuteToolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ExecuteToolRequest; - - /** - * Verifies an ExecuteToolRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteToolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteToolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ExecuteToolRequest; - - /** - * Creates a plain object from an ExecuteToolRequest message. Also converts values to other types if specified. - * @param message ExecuteToolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ExecuteToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteToolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteToolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExecuteToolResponse. */ - interface IExecuteToolResponse { - - /** ExecuteToolResponse tool */ - tool?: (string|null); - - /** ExecuteToolResponse toolsetTool */ - toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); - - /** ExecuteToolResponse response */ - response?: (google.protobuf.IStruct|null); - - /** ExecuteToolResponse variables */ - variables?: (google.protobuf.IStruct|null); - } - - /** Represents an ExecuteToolResponse. */ - class ExecuteToolResponse implements IExecuteToolResponse { - - /** - * Constructs a new ExecuteToolResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IExecuteToolResponse); - - /** ExecuteToolResponse tool. */ - public tool?: (string|null); - - /** ExecuteToolResponse toolsetTool. */ - public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); - - /** ExecuteToolResponse response. */ - public response?: (google.protobuf.IStruct|null); - - /** ExecuteToolResponse variables. */ - public variables?: (google.protobuf.IStruct|null); - - /** ExecuteToolResponse toolIdentifier. */ - public toolIdentifier?: ("tool"|"toolsetTool"); - - /** - * Creates a new ExecuteToolResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteToolResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IExecuteToolResponse): google.cloud.ces.v1beta.ExecuteToolResponse; - - /** - * Encodes the specified ExecuteToolResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolResponse.verify|verify} messages. - * @param message ExecuteToolResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IExecuteToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolResponse.verify|verify} messages. - * @param message ExecuteToolResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IExecuteToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteToolResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteToolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ExecuteToolResponse; - - /** - * Decodes an ExecuteToolResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteToolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ExecuteToolResponse; - - /** - * Verifies an ExecuteToolResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteToolResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteToolResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ExecuteToolResponse; - - /** - * Creates a plain object from an ExecuteToolResponse message. Also converts values to other types if specified. - * @param message ExecuteToolResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.ExecuteToolResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteToolResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteToolResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RetrieveToolSchemaRequest. */ - interface IRetrieveToolSchemaRequest { - - /** RetrieveToolSchemaRequest tool */ - tool?: (string|null); - - /** RetrieveToolSchemaRequest toolsetTool */ - toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); - - /** RetrieveToolSchemaRequest parent */ - parent?: (string|null); - } - - /** Represents a RetrieveToolSchemaRequest. */ - class RetrieveToolSchemaRequest implements IRetrieveToolSchemaRequest { - - /** - * Constructs a new RetrieveToolSchemaRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IRetrieveToolSchemaRequest); - - /** RetrieveToolSchemaRequest tool. */ - public tool?: (string|null); - - /** RetrieveToolSchemaRequest toolsetTool. */ - public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); - - /** RetrieveToolSchemaRequest parent. */ - public parent: string; - - /** RetrieveToolSchemaRequest toolIdentifier. */ - public toolIdentifier?: ("tool"|"toolsetTool"); - - /** - * Creates a new RetrieveToolSchemaRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RetrieveToolSchemaRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IRetrieveToolSchemaRequest): google.cloud.ces.v1beta.RetrieveToolSchemaRequest; - - /** - * Encodes the specified RetrieveToolSchemaRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaRequest.verify|verify} messages. - * @param message RetrieveToolSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IRetrieveToolSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RetrieveToolSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaRequest.verify|verify} messages. - * @param message RetrieveToolSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IRetrieveToolSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RetrieveToolSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RetrieveToolSchemaRequest; - - /** - * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RetrieveToolSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RetrieveToolSchemaRequest; - - /** - * Verifies a RetrieveToolSchemaRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RetrieveToolSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RetrieveToolSchemaRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RetrieveToolSchemaRequest; - - /** - * Creates a plain object from a RetrieveToolSchemaRequest message. Also converts values to other types if specified. - * @param message RetrieveToolSchemaRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.RetrieveToolSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RetrieveToolSchemaRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RetrieveToolSchemaRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RetrieveToolSchemaResponse. */ - interface IRetrieveToolSchemaResponse { - - /** RetrieveToolSchemaResponse tool */ - tool?: (string|null); - - /** RetrieveToolSchemaResponse toolsetTool */ - toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); - - /** RetrieveToolSchemaResponse inputSchema */ - inputSchema?: (google.cloud.ces.v1beta.ISchema|null); - - /** RetrieveToolSchemaResponse outputSchema */ - outputSchema?: (google.cloud.ces.v1beta.ISchema|null); - } - - /** Represents a RetrieveToolSchemaResponse. */ - class RetrieveToolSchemaResponse implements IRetrieveToolSchemaResponse { - - /** - * Constructs a new RetrieveToolSchemaResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IRetrieveToolSchemaResponse); - - /** RetrieveToolSchemaResponse tool. */ - public tool?: (string|null); - - /** RetrieveToolSchemaResponse toolsetTool. */ - public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); - - /** RetrieveToolSchemaResponse inputSchema. */ - public inputSchema?: (google.cloud.ces.v1beta.ISchema|null); - - /** RetrieveToolSchemaResponse outputSchema. */ - public outputSchema?: (google.cloud.ces.v1beta.ISchema|null); - - /** RetrieveToolSchemaResponse toolIdentifier. */ - public toolIdentifier?: ("tool"|"toolsetTool"); - - /** - * Creates a new RetrieveToolSchemaResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RetrieveToolSchemaResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IRetrieveToolSchemaResponse): google.cloud.ces.v1beta.RetrieveToolSchemaResponse; - - /** - * Encodes the specified RetrieveToolSchemaResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaResponse.verify|verify} messages. - * @param message RetrieveToolSchemaResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IRetrieveToolSchemaResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RetrieveToolSchemaResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaResponse.verify|verify} messages. - * @param message RetrieveToolSchemaResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IRetrieveToolSchemaResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RetrieveToolSchemaResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RetrieveToolSchemaResponse; - - /** - * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RetrieveToolSchemaResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RetrieveToolSchemaResponse; - - /** - * Verifies a RetrieveToolSchemaResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RetrieveToolSchemaResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RetrieveToolSchemaResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RetrieveToolSchemaResponse; - - /** - * Creates a plain object from a RetrieveToolSchemaResponse message. Also converts values to other types if specified. - * @param message RetrieveToolSchemaResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.RetrieveToolSchemaResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RetrieveToolSchemaResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RetrieveToolSchemaResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RetrieveToolsRequest. */ - interface IRetrieveToolsRequest { - - /** RetrieveToolsRequest toolset */ - toolset?: (string|null); - - /** RetrieveToolsRequest toolIds */ - toolIds?: (string[]|null); - } - - /** Represents a RetrieveToolsRequest. */ - class RetrieveToolsRequest implements IRetrieveToolsRequest { - - /** - * Constructs a new RetrieveToolsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IRetrieveToolsRequest); - - /** RetrieveToolsRequest toolset. */ - public toolset: string; - - /** RetrieveToolsRequest toolIds. */ - public toolIds: string[]; - - /** - * Creates a new RetrieveToolsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RetrieveToolsRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IRetrieveToolsRequest): google.cloud.ces.v1beta.RetrieveToolsRequest; - - /** - * Encodes the specified RetrieveToolsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsRequest.verify|verify} messages. - * @param message RetrieveToolsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IRetrieveToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RetrieveToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsRequest.verify|verify} messages. - * @param message RetrieveToolsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IRetrieveToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RetrieveToolsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RetrieveToolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RetrieveToolsRequest; - - /** - * Decodes a RetrieveToolsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RetrieveToolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RetrieveToolsRequest; - - /** - * Verifies a RetrieveToolsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RetrieveToolsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RetrieveToolsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RetrieveToolsRequest; - - /** - * Creates a plain object from a RetrieveToolsRequest message. Also converts values to other types if specified. - * @param message RetrieveToolsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.RetrieveToolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RetrieveToolsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RetrieveToolsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RetrieveToolsResponse. */ - interface IRetrieveToolsResponse { - - /** RetrieveToolsResponse tools */ - tools?: (google.cloud.ces.v1beta.ITool[]|null); - } - - /** Represents a RetrieveToolsResponse. */ - class RetrieveToolsResponse implements IRetrieveToolsResponse { - - /** - * Constructs a new RetrieveToolsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IRetrieveToolsResponse); - - /** RetrieveToolsResponse tools. */ - public tools: google.cloud.ces.v1beta.ITool[]; - - /** - * Creates a new RetrieveToolsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RetrieveToolsResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IRetrieveToolsResponse): google.cloud.ces.v1beta.RetrieveToolsResponse; - - /** - * Encodes the specified RetrieveToolsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsResponse.verify|verify} messages. - * @param message RetrieveToolsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IRetrieveToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RetrieveToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsResponse.verify|verify} messages. - * @param message RetrieveToolsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IRetrieveToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RetrieveToolsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RetrieveToolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RetrieveToolsResponse; - - /** - * Decodes a RetrieveToolsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RetrieveToolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RetrieveToolsResponse; - - /** - * Verifies a RetrieveToolsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RetrieveToolsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RetrieveToolsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RetrieveToolsResponse; - - /** - * Creates a plain object from a RetrieveToolsResponse message. Also converts values to other types if specified. - * @param message RetrieveToolsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.RetrieveToolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RetrieveToolsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RetrieveToolsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a WidgetService */ - class WidgetService extends $protobuf.rpc.Service { - - /** - * Constructs a new WidgetService 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 WidgetService 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): WidgetService; - - /** - * Calls GenerateChatToken. - * @param request GenerateChatTokenRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GenerateChatTokenResponse - */ - public generateChatToken(request: google.cloud.ces.v1beta.IGenerateChatTokenRequest, callback: google.cloud.ces.v1beta.WidgetService.GenerateChatTokenCallback): void; - - /** - * Calls GenerateChatToken. - * @param request GenerateChatTokenRequest message or plain object - * @returns Promise - */ - public generateChatToken(request: google.cloud.ces.v1beta.IGenerateChatTokenRequest): Promise; - } - - namespace WidgetService { - - /** - * Callback as used by {@link google.cloud.ces.v1beta.WidgetService|generateChatToken}. - * @param error Error, if any - * @param [response] GenerateChatTokenResponse - */ - type GenerateChatTokenCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.GenerateChatTokenResponse) => void; - } - - /** Properties of a GenerateChatTokenRequest. */ - interface IGenerateChatTokenRequest { - - /** GenerateChatTokenRequest name */ - name?: (string|null); - - /** GenerateChatTokenRequest deployment */ - deployment?: (string|null); - - /** GenerateChatTokenRequest recaptchaToken */ - recaptchaToken?: (string|null); - } - - /** Represents a GenerateChatTokenRequest. */ - class GenerateChatTokenRequest implements IGenerateChatTokenRequest { - - /** - * Constructs a new GenerateChatTokenRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGenerateChatTokenRequest); - - /** GenerateChatTokenRequest name. */ - public name: string; - - /** GenerateChatTokenRequest deployment. */ - public deployment: string; - - /** GenerateChatTokenRequest recaptchaToken. */ - public recaptchaToken: string; - - /** - * Creates a new GenerateChatTokenRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GenerateChatTokenRequest instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGenerateChatTokenRequest): google.cloud.ces.v1beta.GenerateChatTokenRequest; - - /** - * Encodes the specified GenerateChatTokenRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenRequest.verify|verify} messages. - * @param message GenerateChatTokenRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGenerateChatTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenerateChatTokenRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenRequest.verify|verify} messages. - * @param message GenerateChatTokenRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGenerateChatTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenerateChatTokenRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenerateChatTokenRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateChatTokenRequest; - - /** - * Decodes a GenerateChatTokenRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenerateChatTokenRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateChatTokenRequest; - - /** - * Verifies a GenerateChatTokenRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenerateChatTokenRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenerateChatTokenRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateChatTokenRequest; - - /** - * Creates a plain object from a GenerateChatTokenRequest message. Also converts values to other types if specified. - * @param message GenerateChatTokenRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GenerateChatTokenRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenerateChatTokenRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenerateChatTokenRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GenerateChatTokenResponse. */ - interface IGenerateChatTokenResponse { - - /** GenerateChatTokenResponse chatToken */ - chatToken?: (string|null); - - /** GenerateChatTokenResponse expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a GenerateChatTokenResponse. */ - class GenerateChatTokenResponse implements IGenerateChatTokenResponse { - - /** - * Constructs a new GenerateChatTokenResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.ces.v1beta.IGenerateChatTokenResponse); - - /** GenerateChatTokenResponse chatToken. */ - public chatToken: string; - - /** GenerateChatTokenResponse expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new GenerateChatTokenResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns GenerateChatTokenResponse instance - */ - public static create(properties?: google.cloud.ces.v1beta.IGenerateChatTokenResponse): google.cloud.ces.v1beta.GenerateChatTokenResponse; - - /** - * Encodes the specified GenerateChatTokenResponse message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenResponse.verify|verify} messages. - * @param message GenerateChatTokenResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.ces.v1beta.IGenerateChatTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenerateChatTokenResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenResponse.verify|verify} messages. - * @param message GenerateChatTokenResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.ces.v1beta.IGenerateChatTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenerateChatTokenResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenerateChatTokenResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateChatTokenResponse; - - /** - * Decodes a GenerateChatTokenResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenerateChatTokenResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateChatTokenResponse; - - /** - * Verifies a GenerateChatTokenResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenerateChatTokenResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenerateChatTokenResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateChatTokenResponse; - - /** - * Creates a plain object from a GenerateChatTokenResponse message. Also converts values to other types if specified. - * @param message GenerateChatTokenResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.GenerateChatTokenResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenerateChatTokenResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenerateChatTokenResponse - * @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 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.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|Buffer|string|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|Buffer|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; - - /** - * Verifies a FeatureSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Struct. */ - interface IStruct { - - /** Struct fields */ - fields?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a Struct. */ - class Struct implements IStruct { - - /** - * Constructs a new Struct. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStruct); - - /** Struct fields. */ - public fields: { [k: string]: google.protobuf.IValue }; - - /** - * Creates a new Struct instance using the specified properties. - * @param [properties] Properties to set - * @returns Struct instance - */ - public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; - - /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @param message Struct message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @param message Struct message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Struct message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; - - /** - * Decodes a Struct message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; - - /** - * Verifies a Struct message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Struct - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; - - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @param message Struct - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Struct to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Struct - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Value. */ - interface IValue { - - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue */ - numberValue?: (number|null); - - /** Value stringValue */ - stringValue?: (string|null); - - /** Value boolValue */ - boolValue?: (boolean|null); - - /** Value structValue */ - structValue?: (google.protobuf.IStruct|null); - - /** Value listValue */ - listValue?: (google.protobuf.IListValue|null); - } - - /** Represents a Value. */ - class Value implements IValue { - - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IValue); - - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue. */ - public numberValue?: (number|null); - - /** Value stringValue. */ - public stringValue?: (string|null); - - /** Value boolValue. */ - public boolValue?: (boolean|null); - - /** Value structValue. */ - public structValue?: (google.protobuf.IStruct|null); - - /** Value listValue. */ - public listValue?: (google.protobuf.IListValue|null); - - /** Value kind. */ - public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); - - /** - * Creates a new Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Value instance - */ - public static create(properties?: google.protobuf.IValue): google.protobuf.Value; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @param message Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @param message Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; - - /** - * Verifies a Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Value; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** NullValue enum. */ - enum NullValue { - NULL_VALUE = 0 - } - - /** Properties of a ListValue. */ - interface IListValue { - - /** ListValue values */ - values?: (google.protobuf.IValue[]|null); - } - - /** Represents a ListValue. */ - class ListValue implements IListValue { - - /** - * Constructs a new ListValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IListValue); - - /** ListValue values. */ - public values: google.protobuf.IValue[]; - - /** - * Creates a new ListValue instance using the specified properties. - * @param [properties] Properties to set - * @returns ListValue instance - */ - public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; - - /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; - - /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; - - /** - * Verifies a ListValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; - - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @param message ListValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListValue - * @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 an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Any - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates a new Empty instance using the specified properties. - * @param [properties] Properties to set - * @returns Empty instance - */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; - - /** - * Verifies an Empty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Empty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldMask. */ - interface IFieldMask { - - /** FieldMask paths */ - paths?: (string[]|null); - } - - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { - - /** - * Constructs a new FieldMask. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldMask); - - /** FieldMask paths. */ - public paths: string[]; - - /** - * Creates a new FieldMask instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldMask instance - */ - public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; - - /** - * Verifies a FieldMask message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldMask - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldMask - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace 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-ces/protos/protos.js b/owl-bot-staging/google-cloud-ces/protos/protos.js deleted file mode 100644 index 76b1c3b6925..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/protos.js +++ /dev/null @@ -1,185109 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -(function(global, factory) { /* global define, require, module */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define(["protobufjs/minimal"], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); - -})(this, function($protobuf) { - "use strict"; - - // Common aliases - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - - // Exported root namespace - var $root = $protobuf.roots._google_cloud_ces_protos || ($protobuf.roots._google_cloud_ces_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.cloud = (function() { - - /** - * Namespace cloud. - * @memberof google - * @namespace - */ - var cloud = {}; - - cloud.ces = (function() { - - /** - * Namespace ces. - * @memberof google.cloud - * @namespace - */ - var ces = {}; - - ces.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.cloud.ces - * @namespace - */ - var v1 = {}; - - v1.Agent = (function() { - - /** - * Properties of an Agent. - * @memberof google.cloud.ces.v1 - * @interface IAgent - * @property {google.cloud.ces.v1.Agent.ILlmAgent|null} [llmAgent] Agent llmAgent - * @property {google.cloud.ces.v1.Agent.IRemoteDialogflowAgent|null} [remoteDialogflowAgent] Agent remoteDialogflowAgent - * @property {string|null} [name] Agent name - * @property {string|null} [displayName] Agent displayName - * @property {string|null} [description] Agent description - * @property {google.cloud.ces.v1.IModelSettings|null} [modelSettings] Agent modelSettings - * @property {string|null} [instruction] Agent instruction - * @property {Array.|null} [tools] Agent tools - * @property {Array.|null} [childAgents] Agent childAgents - * @property {Array.|null} [beforeAgentCallbacks] Agent beforeAgentCallbacks - * @property {Array.|null} [afterAgentCallbacks] Agent afterAgentCallbacks - * @property {Array.|null} [beforeModelCallbacks] Agent beforeModelCallbacks - * @property {Array.|null} [afterModelCallbacks] Agent afterModelCallbacks - * @property {Array.|null} [beforeToolCallbacks] Agent beforeToolCallbacks - * @property {Array.|null} [afterToolCallbacks] Agent afterToolCallbacks - * @property {google.protobuf.ITimestamp|null} [createTime] Agent createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Agent updateTime - * @property {Array.|null} [guardrails] Agent guardrails - * @property {string|null} [etag] Agent etag - * @property {Array.|null} [toolsets] Agent toolsets - * @property {string|null} [generatedSummary] Agent generatedSummary - * @property {Array.|null} [transferRules] Agent transferRules - */ - - /** - * Constructs a new Agent. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an Agent. - * @implements IAgent - * @constructor - * @param {google.cloud.ces.v1.IAgent=} [properties] Properties to set - */ - function Agent(properties) { - this.tools = []; - this.childAgents = []; - this.beforeAgentCallbacks = []; - this.afterAgentCallbacks = []; - this.beforeModelCallbacks = []; - this.afterModelCallbacks = []; - this.beforeToolCallbacks = []; - this.afterToolCallbacks = []; - this.guardrails = []; - this.toolsets = []; - this.transferRules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Agent llmAgent. - * @member {google.cloud.ces.v1.Agent.ILlmAgent|null|undefined} llmAgent - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.llmAgent = null; - - /** - * Agent remoteDialogflowAgent. - * @member {google.cloud.ces.v1.Agent.IRemoteDialogflowAgent|null|undefined} remoteDialogflowAgent - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.remoteDialogflowAgent = null; - - /** - * Agent name. - * @member {string} name - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.name = ""; - - /** - * Agent displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.displayName = ""; - - /** - * Agent description. - * @member {string} description - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.description = ""; - - /** - * Agent modelSettings. - * @member {google.cloud.ces.v1.IModelSettings|null|undefined} modelSettings - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.modelSettings = null; - - /** - * Agent instruction. - * @member {string} instruction - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.instruction = ""; - - /** - * Agent tools. - * @member {Array.} tools - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.tools = $util.emptyArray; - - /** - * Agent childAgents. - * @member {Array.} childAgents - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.childAgents = $util.emptyArray; - - /** - * Agent beforeAgentCallbacks. - * @member {Array.} beforeAgentCallbacks - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.beforeAgentCallbacks = $util.emptyArray; - - /** - * Agent afterAgentCallbacks. - * @member {Array.} afterAgentCallbacks - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.afterAgentCallbacks = $util.emptyArray; - - /** - * Agent beforeModelCallbacks. - * @member {Array.} beforeModelCallbacks - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.beforeModelCallbacks = $util.emptyArray; - - /** - * Agent afterModelCallbacks. - * @member {Array.} afterModelCallbacks - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.afterModelCallbacks = $util.emptyArray; - - /** - * Agent beforeToolCallbacks. - * @member {Array.} beforeToolCallbacks - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.beforeToolCallbacks = $util.emptyArray; - - /** - * Agent afterToolCallbacks. - * @member {Array.} afterToolCallbacks - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.afterToolCallbacks = $util.emptyArray; - - /** - * Agent createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.createTime = null; - - /** - * Agent updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.updateTime = null; - - /** - * Agent guardrails. - * @member {Array.} guardrails - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.guardrails = $util.emptyArray; - - /** - * Agent etag. - * @member {string} etag - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.etag = ""; - - /** - * Agent toolsets. - * @member {Array.} toolsets - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.toolsets = $util.emptyArray; - - /** - * Agent generatedSummary. - * @member {string} generatedSummary - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.generatedSummary = ""; - - /** - * Agent transferRules. - * @member {Array.} transferRules - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Agent.prototype.transferRules = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Agent agentType. - * @member {"llmAgent"|"remoteDialogflowAgent"|undefined} agentType - * @memberof google.cloud.ces.v1.Agent - * @instance - */ - Object.defineProperty(Agent.prototype, "agentType", { - get: $util.oneOfGetter($oneOfFields = ["llmAgent", "remoteDialogflowAgent"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Agent instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Agent - * @static - * @param {google.cloud.ces.v1.IAgent=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Agent} Agent instance - */ - Agent.create = function create(properties) { - return new Agent(properties); - }; - - /** - * Encodes the specified Agent message. Does not implicitly {@link google.cloud.ces.v1.Agent.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Agent - * @static - * @param {google.cloud.ces.v1.IAgent} message Agent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Agent.encode = function encode(message, writer) { - if (!writer) - 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.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) - $root.google.cloud.ces.v1.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.instruction != null && Object.hasOwnProperty.call(message, "instruction")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.instruction); - if (message.tools != null && message.tools.length) - for (var i = 0; i < message.tools.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.tools[i]); - if (message.childAgents != null && message.childAgents.length) - for (var i = 0; i < message.childAgents.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.childAgents[i]); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.guardrails != null && message.guardrails.length) - for (var i = 0; i < message.guardrails.length; ++i) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.guardrails[i]); - if (message.beforeAgentCallbacks != null && message.beforeAgentCallbacks.length) - for (var i = 0; i < message.beforeAgentCallbacks.length; ++i) - $root.google.cloud.ces.v1.Callback.encode(message.beforeAgentCallbacks[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.afterAgentCallbacks != null && message.afterAgentCallbacks.length) - for (var i = 0; i < message.afterAgentCallbacks.length; ++i) - $root.google.cloud.ces.v1.Callback.encode(message.afterAgentCallbacks[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.beforeModelCallbacks != null && message.beforeModelCallbacks.length) - for (var i = 0; i < message.beforeModelCallbacks.length; ++i) - $root.google.cloud.ces.v1.Callback.encode(message.beforeModelCallbacks[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.afterModelCallbacks != null && message.afterModelCallbacks.length) - for (var i = 0; i < message.afterModelCallbacks.length; ++i) - $root.google.cloud.ces.v1.Callback.encode(message.afterModelCallbacks[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.beforeToolCallbacks != null && message.beforeToolCallbacks.length) - for (var i = 0; i < message.beforeToolCallbacks.length; ++i) - $root.google.cloud.ces.v1.Callback.encode(message.beforeToolCallbacks[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.afterToolCallbacks != null && message.afterToolCallbacks.length) - for (var i = 0; i < message.afterToolCallbacks.length; ++i) - $root.google.cloud.ces.v1.Callback.encode(message.afterToolCallbacks[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 24, wireType 2 =*/194).string(message.etag); - if (message.llmAgent != null && Object.hasOwnProperty.call(message, "llmAgent")) - $root.google.cloud.ces.v1.Agent.LlmAgent.encode(message.llmAgent, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.remoteDialogflowAgent != null && Object.hasOwnProperty.call(message, "remoteDialogflowAgent")) - $root.google.cloud.ces.v1.Agent.RemoteDialogflowAgent.encode(message.remoteDialogflowAgent, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.toolsets != null && message.toolsets.length) - for (var i = 0; i < message.toolsets.length; ++i) - $root.google.cloud.ces.v1.Agent.AgentToolset.encode(message.toolsets[i], writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - if (message.generatedSummary != null && Object.hasOwnProperty.call(message, "generatedSummary")) - writer.uint32(/* id 29, wireType 2 =*/234).string(message.generatedSummary); - if (message.transferRules != null && message.transferRules.length) - for (var i = 0; i < message.transferRules.length; ++i) - $root.google.cloud.ces.v1.TransferRule.encode(message.transferRules[i], writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Agent message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Agent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Agent - * @static - * @param {google.cloud.ces.v1.IAgent} message Agent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Agent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Agent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Agent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Agent} Agent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Agent.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Agent(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 26: { - message.llmAgent = $root.google.cloud.ces.v1.Agent.LlmAgent.decode(reader, reader.uint32()); - break; - } - case 27: { - message.remoteDialogflowAgent = $root.google.cloud.ces.v1.Agent.RemoteDialogflowAgent.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.decode(reader, reader.uint32()); - break; - } - case 6: { - message.instruction = reader.string(); - break; - } - case 7: { - if (!(message.tools && message.tools.length)) - message.tools = []; - message.tools.push(reader.string()); - break; - } - case 8: { - if (!(message.childAgents && message.childAgents.length)) - message.childAgents = []; - message.childAgents.push(reader.string()); - break; - } - case 18: { - if (!(message.beforeAgentCallbacks && message.beforeAgentCallbacks.length)) - message.beforeAgentCallbacks = []; - message.beforeAgentCallbacks.push($root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32())); - break; - } - case 19: { - if (!(message.afterAgentCallbacks && message.afterAgentCallbacks.length)) - message.afterAgentCallbacks = []; - message.afterAgentCallbacks.push($root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32())); - break; - } - case 20: { - if (!(message.beforeModelCallbacks && message.beforeModelCallbacks.length)) - message.beforeModelCallbacks = []; - message.beforeModelCallbacks.push($root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32())); - break; - } - case 21: { - if (!(message.afterModelCallbacks && message.afterModelCallbacks.length)) - message.afterModelCallbacks = []; - message.afterModelCallbacks.push($root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32())); - break; - } - case 22: { - if (!(message.beforeToolCallbacks && message.beforeToolCallbacks.length)) - message.beforeToolCallbacks = []; - message.beforeToolCallbacks.push($root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32())); - break; - } - case 23: { - if (!(message.afterToolCallbacks && message.afterToolCallbacks.length)) - message.afterToolCallbacks = []; - message.afterToolCallbacks.push($root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32())); - break; - } - case 15: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 16: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 17: { - if (!(message.guardrails && message.guardrails.length)) - message.guardrails = []; - message.guardrails.push(reader.string()); - break; - } - case 24: { - message.etag = reader.string(); - break; - } - case 28: { - if (!(message.toolsets && message.toolsets.length)) - message.toolsets = []; - message.toolsets.push($root.google.cloud.ces.v1.Agent.AgentToolset.decode(reader, reader.uint32())); - break; - } - case 29: { - message.generatedSummary = reader.string(); - break; - } - case 30: { - if (!(message.transferRules && message.transferRules.length)) - message.transferRules = []; - message.transferRules.push($root.google.cloud.ces.v1.TransferRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Agent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Agent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Agent} Agent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Agent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Agent message. - * @function verify - * @memberof google.cloud.ces.v1.Agent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Agent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.llmAgent != null && message.hasOwnProperty("llmAgent")) { - properties.agentType = 1; - { - var error = $root.google.cloud.ces.v1.Agent.LlmAgent.verify(message.llmAgent); - if (error) - return "llmAgent." + error; - } - } - if (message.remoteDialogflowAgent != null && message.hasOwnProperty("remoteDialogflowAgent")) { - if (properties.agentType === 1) - return "agentType: multiple values"; - properties.agentType = 1; - { - var error = $root.google.cloud.ces.v1.Agent.RemoteDialogflowAgent.verify(message.remoteDialogflowAgent); - if (error) - return "remoteDialogflowAgent." + 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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { - var error = $root.google.cloud.ces.v1.ModelSettings.verify(message.modelSettings); - if (error) - return "modelSettings." + error; - } - if (message.instruction != null && message.hasOwnProperty("instruction")) - if (!$util.isString(message.instruction)) - return "instruction: string expected"; - if (message.tools != null && message.hasOwnProperty("tools")) { - if (!Array.isArray(message.tools)) - return "tools: array expected"; - for (var i = 0; i < message.tools.length; ++i) - if (!$util.isString(message.tools[i])) - return "tools: string[] expected"; - } - if (message.childAgents != null && message.hasOwnProperty("childAgents")) { - if (!Array.isArray(message.childAgents)) - return "childAgents: array expected"; - for (var i = 0; i < message.childAgents.length; ++i) - if (!$util.isString(message.childAgents[i])) - return "childAgents: string[] expected"; - } - if (message.beforeAgentCallbacks != null && message.hasOwnProperty("beforeAgentCallbacks")) { - if (!Array.isArray(message.beforeAgentCallbacks)) - return "beforeAgentCallbacks: array expected"; - for (var i = 0; i < message.beforeAgentCallbacks.length; ++i) { - var error = $root.google.cloud.ces.v1.Callback.verify(message.beforeAgentCallbacks[i]); - if (error) - return "beforeAgentCallbacks." + error; - } - } - if (message.afterAgentCallbacks != null && message.hasOwnProperty("afterAgentCallbacks")) { - if (!Array.isArray(message.afterAgentCallbacks)) - return "afterAgentCallbacks: array expected"; - for (var i = 0; i < message.afterAgentCallbacks.length; ++i) { - var error = $root.google.cloud.ces.v1.Callback.verify(message.afterAgentCallbacks[i]); - if (error) - return "afterAgentCallbacks." + error; - } - } - if (message.beforeModelCallbacks != null && message.hasOwnProperty("beforeModelCallbacks")) { - if (!Array.isArray(message.beforeModelCallbacks)) - return "beforeModelCallbacks: array expected"; - for (var i = 0; i < message.beforeModelCallbacks.length; ++i) { - var error = $root.google.cloud.ces.v1.Callback.verify(message.beforeModelCallbacks[i]); - if (error) - return "beforeModelCallbacks." + error; - } - } - if (message.afterModelCallbacks != null && message.hasOwnProperty("afterModelCallbacks")) { - if (!Array.isArray(message.afterModelCallbacks)) - return "afterModelCallbacks: array expected"; - for (var i = 0; i < message.afterModelCallbacks.length; ++i) { - var error = $root.google.cloud.ces.v1.Callback.verify(message.afterModelCallbacks[i]); - if (error) - return "afterModelCallbacks." + error; - } - } - if (message.beforeToolCallbacks != null && message.hasOwnProperty("beforeToolCallbacks")) { - if (!Array.isArray(message.beforeToolCallbacks)) - return "beforeToolCallbacks: array expected"; - for (var i = 0; i < message.beforeToolCallbacks.length; ++i) { - var error = $root.google.cloud.ces.v1.Callback.verify(message.beforeToolCallbacks[i]); - if (error) - return "beforeToolCallbacks." + error; - } - } - if (message.afterToolCallbacks != null && message.hasOwnProperty("afterToolCallbacks")) { - if (!Array.isArray(message.afterToolCallbacks)) - return "afterToolCallbacks: array expected"; - for (var i = 0; i < message.afterToolCallbacks.length; ++i) { - var error = $root.google.cloud.ces.v1.Callback.verify(message.afterToolCallbacks[i]); - if (error) - return "afterToolCallbacks." + error; - } - } - 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.guardrails != null && message.hasOwnProperty("guardrails")) { - if (!Array.isArray(message.guardrails)) - return "guardrails: array expected"; - for (var i = 0; i < message.guardrails.length; ++i) - if (!$util.isString(message.guardrails[i])) - return "guardrails: string[] expected"; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.toolsets != null && message.hasOwnProperty("toolsets")) { - if (!Array.isArray(message.toolsets)) - return "toolsets: array expected"; - for (var i = 0; i < message.toolsets.length; ++i) { - var error = $root.google.cloud.ces.v1.Agent.AgentToolset.verify(message.toolsets[i]); - if (error) - return "toolsets." + error; - } - } - if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) - if (!$util.isString(message.generatedSummary)) - return "generatedSummary: string expected"; - if (message.transferRules != null && message.hasOwnProperty("transferRules")) { - if (!Array.isArray(message.transferRules)) - return "transferRules: array expected"; - for (var i = 0; i < message.transferRules.length; ++i) { - var error = $root.google.cloud.ces.v1.TransferRule.verify(message.transferRules[i]); - if (error) - return "transferRules." + error; - } - } - return null; - }; - - /** - * Creates an Agent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Agent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Agent} Agent - */ - Agent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Agent) - return object; - var message = new $root.google.cloud.ces.v1.Agent(); - if (object.llmAgent != null) { - if (typeof object.llmAgent !== "object") - throw TypeError(".google.cloud.ces.v1.Agent.llmAgent: object expected"); - message.llmAgent = $root.google.cloud.ces.v1.Agent.LlmAgent.fromObject(object.llmAgent); - } - if (object.remoteDialogflowAgent != null) { - if (typeof object.remoteDialogflowAgent !== "object") - throw TypeError(".google.cloud.ces.v1.Agent.remoteDialogflowAgent: object expected"); - message.remoteDialogflowAgent = $root.google.cloud.ces.v1.Agent.RemoteDialogflowAgent.fromObject(object.remoteDialogflowAgent); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.modelSettings != null) { - if (typeof object.modelSettings !== "object") - throw TypeError(".google.cloud.ces.v1.Agent.modelSettings: object expected"); - message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.fromObject(object.modelSettings); - } - if (object.instruction != null) - message.instruction = String(object.instruction); - if (object.tools) { - if (!Array.isArray(object.tools)) - throw TypeError(".google.cloud.ces.v1.Agent.tools: array expected"); - message.tools = []; - for (var i = 0; i < object.tools.length; ++i) - message.tools[i] = String(object.tools[i]); - } - if (object.childAgents) { - if (!Array.isArray(object.childAgents)) - throw TypeError(".google.cloud.ces.v1.Agent.childAgents: array expected"); - message.childAgents = []; - for (var i = 0; i < object.childAgents.length; ++i) - message.childAgents[i] = String(object.childAgents[i]); - } - if (object.beforeAgentCallbacks) { - if (!Array.isArray(object.beforeAgentCallbacks)) - throw TypeError(".google.cloud.ces.v1.Agent.beforeAgentCallbacks: array expected"); - message.beforeAgentCallbacks = []; - for (var i = 0; i < object.beforeAgentCallbacks.length; ++i) { - if (typeof object.beforeAgentCallbacks[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Agent.beforeAgentCallbacks: object expected"); - message.beforeAgentCallbacks[i] = $root.google.cloud.ces.v1.Callback.fromObject(object.beforeAgentCallbacks[i]); - } - } - if (object.afterAgentCallbacks) { - if (!Array.isArray(object.afterAgentCallbacks)) - throw TypeError(".google.cloud.ces.v1.Agent.afterAgentCallbacks: array expected"); - message.afterAgentCallbacks = []; - for (var i = 0; i < object.afterAgentCallbacks.length; ++i) { - if (typeof object.afterAgentCallbacks[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Agent.afterAgentCallbacks: object expected"); - message.afterAgentCallbacks[i] = $root.google.cloud.ces.v1.Callback.fromObject(object.afterAgentCallbacks[i]); - } - } - if (object.beforeModelCallbacks) { - if (!Array.isArray(object.beforeModelCallbacks)) - throw TypeError(".google.cloud.ces.v1.Agent.beforeModelCallbacks: array expected"); - message.beforeModelCallbacks = []; - for (var i = 0; i < object.beforeModelCallbacks.length; ++i) { - if (typeof object.beforeModelCallbacks[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Agent.beforeModelCallbacks: object expected"); - message.beforeModelCallbacks[i] = $root.google.cloud.ces.v1.Callback.fromObject(object.beforeModelCallbacks[i]); - } - } - if (object.afterModelCallbacks) { - if (!Array.isArray(object.afterModelCallbacks)) - throw TypeError(".google.cloud.ces.v1.Agent.afterModelCallbacks: array expected"); - message.afterModelCallbacks = []; - for (var i = 0; i < object.afterModelCallbacks.length; ++i) { - if (typeof object.afterModelCallbacks[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Agent.afterModelCallbacks: object expected"); - message.afterModelCallbacks[i] = $root.google.cloud.ces.v1.Callback.fromObject(object.afterModelCallbacks[i]); - } - } - if (object.beforeToolCallbacks) { - if (!Array.isArray(object.beforeToolCallbacks)) - throw TypeError(".google.cloud.ces.v1.Agent.beforeToolCallbacks: array expected"); - message.beforeToolCallbacks = []; - for (var i = 0; i < object.beforeToolCallbacks.length; ++i) { - if (typeof object.beforeToolCallbacks[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Agent.beforeToolCallbacks: object expected"); - message.beforeToolCallbacks[i] = $root.google.cloud.ces.v1.Callback.fromObject(object.beforeToolCallbacks[i]); - } - } - if (object.afterToolCallbacks) { - if (!Array.isArray(object.afterToolCallbacks)) - throw TypeError(".google.cloud.ces.v1.Agent.afterToolCallbacks: array expected"); - message.afterToolCallbacks = []; - for (var i = 0; i < object.afterToolCallbacks.length; ++i) { - if (typeof object.afterToolCallbacks[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Agent.afterToolCallbacks: object expected"); - message.afterToolCallbacks[i] = $root.google.cloud.ces.v1.Callback.fromObject(object.afterToolCallbacks[i]); - } - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1.Agent.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.ces.v1.Agent.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.guardrails) { - if (!Array.isArray(object.guardrails)) - throw TypeError(".google.cloud.ces.v1.Agent.guardrails: array expected"); - message.guardrails = []; - for (var i = 0; i < object.guardrails.length; ++i) - message.guardrails[i] = String(object.guardrails[i]); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.toolsets) { - if (!Array.isArray(object.toolsets)) - throw TypeError(".google.cloud.ces.v1.Agent.toolsets: array expected"); - message.toolsets = []; - for (var i = 0; i < object.toolsets.length; ++i) { - if (typeof object.toolsets[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Agent.toolsets: object expected"); - message.toolsets[i] = $root.google.cloud.ces.v1.Agent.AgentToolset.fromObject(object.toolsets[i]); - } - } - if (object.generatedSummary != null) - message.generatedSummary = String(object.generatedSummary); - if (object.transferRules) { - if (!Array.isArray(object.transferRules)) - throw TypeError(".google.cloud.ces.v1.Agent.transferRules: array expected"); - message.transferRules = []; - for (var i = 0; i < object.transferRules.length; ++i) { - if (typeof object.transferRules[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Agent.transferRules: object expected"); - message.transferRules[i] = $root.google.cloud.ces.v1.TransferRule.fromObject(object.transferRules[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an Agent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Agent - * @static - * @param {google.cloud.ces.v1.Agent} message Agent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Agent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.tools = []; - object.childAgents = []; - object.guardrails = []; - object.beforeAgentCallbacks = []; - object.afterAgentCallbacks = []; - object.beforeModelCallbacks = []; - object.afterModelCallbacks = []; - object.beforeToolCallbacks = []; - object.afterToolCallbacks = []; - object.toolsets = []; - object.transferRules = []; - } - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.modelSettings = null; - object.instruction = ""; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - object.generatedSummary = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) - object.modelSettings = $root.google.cloud.ces.v1.ModelSettings.toObject(message.modelSettings, options); - if (message.instruction != null && message.hasOwnProperty("instruction")) - object.instruction = message.instruction; - if (message.tools && message.tools.length) { - object.tools = []; - for (var j = 0; j < message.tools.length; ++j) - object.tools[j] = message.tools[j]; - } - if (message.childAgents && message.childAgents.length) { - object.childAgents = []; - for (var j = 0; j < message.childAgents.length; ++j) - object.childAgents[j] = message.childAgents[j]; - } - 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.guardrails && message.guardrails.length) { - object.guardrails = []; - for (var j = 0; j < message.guardrails.length; ++j) - object.guardrails[j] = message.guardrails[j]; - } - if (message.beforeAgentCallbacks && message.beforeAgentCallbacks.length) { - object.beforeAgentCallbacks = []; - for (var j = 0; j < message.beforeAgentCallbacks.length; ++j) - object.beforeAgentCallbacks[j] = $root.google.cloud.ces.v1.Callback.toObject(message.beforeAgentCallbacks[j], options); - } - if (message.afterAgentCallbacks && message.afterAgentCallbacks.length) { - object.afterAgentCallbacks = []; - for (var j = 0; j < message.afterAgentCallbacks.length; ++j) - object.afterAgentCallbacks[j] = $root.google.cloud.ces.v1.Callback.toObject(message.afterAgentCallbacks[j], options); - } - if (message.beforeModelCallbacks && message.beforeModelCallbacks.length) { - object.beforeModelCallbacks = []; - for (var j = 0; j < message.beforeModelCallbacks.length; ++j) - object.beforeModelCallbacks[j] = $root.google.cloud.ces.v1.Callback.toObject(message.beforeModelCallbacks[j], options); - } - if (message.afterModelCallbacks && message.afterModelCallbacks.length) { - object.afterModelCallbacks = []; - for (var j = 0; j < message.afterModelCallbacks.length; ++j) - object.afterModelCallbacks[j] = $root.google.cloud.ces.v1.Callback.toObject(message.afterModelCallbacks[j], options); - } - if (message.beforeToolCallbacks && message.beforeToolCallbacks.length) { - object.beforeToolCallbacks = []; - for (var j = 0; j < message.beforeToolCallbacks.length; ++j) - object.beforeToolCallbacks[j] = $root.google.cloud.ces.v1.Callback.toObject(message.beforeToolCallbacks[j], options); - } - if (message.afterToolCallbacks && message.afterToolCallbacks.length) { - object.afterToolCallbacks = []; - for (var j = 0; j < message.afterToolCallbacks.length; ++j) - object.afterToolCallbacks[j] = $root.google.cloud.ces.v1.Callback.toObject(message.afterToolCallbacks[j], options); - } - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.llmAgent != null && message.hasOwnProperty("llmAgent")) { - object.llmAgent = $root.google.cloud.ces.v1.Agent.LlmAgent.toObject(message.llmAgent, options); - if (options.oneofs) - object.agentType = "llmAgent"; - } - if (message.remoteDialogflowAgent != null && message.hasOwnProperty("remoteDialogflowAgent")) { - object.remoteDialogflowAgent = $root.google.cloud.ces.v1.Agent.RemoteDialogflowAgent.toObject(message.remoteDialogflowAgent, options); - if (options.oneofs) - object.agentType = "remoteDialogflowAgent"; - } - if (message.toolsets && message.toolsets.length) { - object.toolsets = []; - for (var j = 0; j < message.toolsets.length; ++j) - object.toolsets[j] = $root.google.cloud.ces.v1.Agent.AgentToolset.toObject(message.toolsets[j], options); - } - if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) - object.generatedSummary = message.generatedSummary; - if (message.transferRules && message.transferRules.length) { - object.transferRules = []; - for (var j = 0; j < message.transferRules.length; ++j) - object.transferRules[j] = $root.google.cloud.ces.v1.TransferRule.toObject(message.transferRules[j], options); - } - return object; - }; - - /** - * Converts this Agent to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Agent - * @instance - * @returns {Object.} JSON object - */ - Agent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Agent - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Agent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Agent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Agent"; - }; - - Agent.LlmAgent = (function() { - - /** - * Properties of a LlmAgent. - * @memberof google.cloud.ces.v1.Agent - * @interface ILlmAgent - */ - - /** - * Constructs a new LlmAgent. - * @memberof google.cloud.ces.v1.Agent - * @classdesc Represents a LlmAgent. - * @implements ILlmAgent - * @constructor - * @param {google.cloud.ces.v1.Agent.ILlmAgent=} [properties] Properties to set - */ - function LlmAgent(properties) { - if (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 LlmAgent instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Agent.LlmAgent - * @static - * @param {google.cloud.ces.v1.Agent.ILlmAgent=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Agent.LlmAgent} LlmAgent instance - */ - LlmAgent.create = function create(properties) { - return new LlmAgent(properties); - }; - - /** - * Encodes the specified LlmAgent message. Does not implicitly {@link google.cloud.ces.v1.Agent.LlmAgent.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Agent.LlmAgent - * @static - * @param {google.cloud.ces.v1.Agent.ILlmAgent} message LlmAgent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LlmAgent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified LlmAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Agent.LlmAgent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Agent.LlmAgent - * @static - * @param {google.cloud.ces.v1.Agent.ILlmAgent} message LlmAgent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LlmAgent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LlmAgent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Agent.LlmAgent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Agent.LlmAgent} LlmAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LlmAgent.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Agent.LlmAgent(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LlmAgent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Agent.LlmAgent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Agent.LlmAgent} LlmAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LlmAgent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LlmAgent message. - * @function verify - * @memberof google.cloud.ces.v1.Agent.LlmAgent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LlmAgent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a LlmAgent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Agent.LlmAgent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Agent.LlmAgent} LlmAgent - */ - LlmAgent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Agent.LlmAgent) - return object; - return new $root.google.cloud.ces.v1.Agent.LlmAgent(); - }; - - /** - * Creates a plain object from a LlmAgent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Agent.LlmAgent - * @static - * @param {google.cloud.ces.v1.Agent.LlmAgent} message LlmAgent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LlmAgent.toObject = function toObject() { - return {}; - }; - - /** - * Converts this LlmAgent to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Agent.LlmAgent - * @instance - * @returns {Object.} JSON object - */ - LlmAgent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LlmAgent - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Agent.LlmAgent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LlmAgent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Agent.LlmAgent"; - }; - - return LlmAgent; - })(); - - Agent.RemoteDialogflowAgent = (function() { - - /** - * Properties of a RemoteDialogflowAgent. - * @memberof google.cloud.ces.v1.Agent - * @interface IRemoteDialogflowAgent - * @property {string|null} [agent] RemoteDialogflowAgent agent - * @property {string|null} [flowId] RemoteDialogflowAgent flowId - * @property {string|null} [environmentId] RemoteDialogflowAgent environmentId - * @property {Object.|null} [inputVariableMapping] RemoteDialogflowAgent inputVariableMapping - * @property {Object.|null} [outputVariableMapping] RemoteDialogflowAgent outputVariableMapping - * @property {boolean|null} [respectResponseInterruptionSettings] RemoteDialogflowAgent respectResponseInterruptionSettings - */ - - /** - * Constructs a new RemoteDialogflowAgent. - * @memberof google.cloud.ces.v1.Agent - * @classdesc Represents a RemoteDialogflowAgent. - * @implements IRemoteDialogflowAgent - * @constructor - * @param {google.cloud.ces.v1.Agent.IRemoteDialogflowAgent=} [properties] Properties to set - */ - function RemoteDialogflowAgent(properties) { - this.inputVariableMapping = {}; - this.outputVariableMapping = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RemoteDialogflowAgent agent. - * @member {string} agent - * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent - * @instance - */ - RemoteDialogflowAgent.prototype.agent = ""; - - /** - * RemoteDialogflowAgent flowId. - * @member {string} flowId - * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent - * @instance - */ - RemoteDialogflowAgent.prototype.flowId = ""; - - /** - * RemoteDialogflowAgent environmentId. - * @member {string} environmentId - * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent - * @instance - */ - RemoteDialogflowAgent.prototype.environmentId = ""; - - /** - * RemoteDialogflowAgent inputVariableMapping. - * @member {Object.} inputVariableMapping - * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent - * @instance - */ - RemoteDialogflowAgent.prototype.inputVariableMapping = $util.emptyObject; - - /** - * RemoteDialogflowAgent outputVariableMapping. - * @member {Object.} outputVariableMapping - * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent - * @instance - */ - RemoteDialogflowAgent.prototype.outputVariableMapping = $util.emptyObject; - - /** - * RemoteDialogflowAgent respectResponseInterruptionSettings. - * @member {boolean} respectResponseInterruptionSettings - * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent - * @instance - */ - RemoteDialogflowAgent.prototype.respectResponseInterruptionSettings = false; - - /** - * Creates a new RemoteDialogflowAgent instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent - * @static - * @param {google.cloud.ces.v1.Agent.IRemoteDialogflowAgent=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent instance - */ - RemoteDialogflowAgent.create = function create(properties) { - return new RemoteDialogflowAgent(properties); - }; - - /** - * Encodes the specified RemoteDialogflowAgent message. Does not implicitly {@link google.cloud.ces.v1.Agent.RemoteDialogflowAgent.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent - * @static - * @param {google.cloud.ces.v1.Agent.IRemoteDialogflowAgent} message RemoteDialogflowAgent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RemoteDialogflowAgent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.agent); - if (message.flowId != null && Object.hasOwnProperty.call(message, "flowId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.flowId); - if (message.environmentId != null && Object.hasOwnProperty.call(message, "environmentId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.environmentId); - if (message.inputVariableMapping != null && Object.hasOwnProperty.call(message, "inputVariableMapping")) - for (var keys = Object.keys(message.inputVariableMapping), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.inputVariableMapping[keys[i]]).ldelim(); - if (message.outputVariableMapping != null && Object.hasOwnProperty.call(message, "outputVariableMapping")) - for (var keys = Object.keys(message.outputVariableMapping), i = 0; i < keys.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.outputVariableMapping[keys[i]]).ldelim(); - if (message.respectResponseInterruptionSettings != null && Object.hasOwnProperty.call(message, "respectResponseInterruptionSettings")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.respectResponseInterruptionSettings); - return writer; - }; - - /** - * Encodes the specified RemoteDialogflowAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Agent.RemoteDialogflowAgent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent - * @static - * @param {google.cloud.ces.v1.Agent.IRemoteDialogflowAgent} message RemoteDialogflowAgent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RemoteDialogflowAgent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RemoteDialogflowAgent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RemoteDialogflowAgent.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Agent.RemoteDialogflowAgent(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.agent = reader.string(); - break; - } - case 2: { - message.flowId = reader.string(); - break; - } - case 3: { - message.environmentId = reader.string(); - break; - } - case 4: { - if (message.inputVariableMapping === $util.emptyObject) - message.inputVariableMapping = {}; - 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.inputVariableMapping[key] = value; - break; - } - case 5: { - if (message.outputVariableMapping === $util.emptyObject) - message.outputVariableMapping = {}; - 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.outputVariableMapping[key] = value; - break; - } - case 6: { - message.respectResponseInterruptionSettings = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RemoteDialogflowAgent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RemoteDialogflowAgent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RemoteDialogflowAgent message. - * @function verify - * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RemoteDialogflowAgent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.agent != null && message.hasOwnProperty("agent")) - if (!$util.isString(message.agent)) - return "agent: string expected"; - if (message.flowId != null && message.hasOwnProperty("flowId")) - if (!$util.isString(message.flowId)) - return "flowId: string expected"; - if (message.environmentId != null && message.hasOwnProperty("environmentId")) - if (!$util.isString(message.environmentId)) - return "environmentId: string expected"; - if (message.inputVariableMapping != null && message.hasOwnProperty("inputVariableMapping")) { - if (!$util.isObject(message.inputVariableMapping)) - return "inputVariableMapping: object expected"; - var key = Object.keys(message.inputVariableMapping); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.inputVariableMapping[key[i]])) - return "inputVariableMapping: string{k:string} expected"; - } - if (message.outputVariableMapping != null && message.hasOwnProperty("outputVariableMapping")) { - if (!$util.isObject(message.outputVariableMapping)) - return "outputVariableMapping: object expected"; - var key = Object.keys(message.outputVariableMapping); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.outputVariableMapping[key[i]])) - return "outputVariableMapping: string{k:string} expected"; - } - if (message.respectResponseInterruptionSettings != null && message.hasOwnProperty("respectResponseInterruptionSettings")) - if (typeof message.respectResponseInterruptionSettings !== "boolean") - return "respectResponseInterruptionSettings: boolean expected"; - return null; - }; - - /** - * Creates a RemoteDialogflowAgent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent - */ - RemoteDialogflowAgent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Agent.RemoteDialogflowAgent) - return object; - var message = new $root.google.cloud.ces.v1.Agent.RemoteDialogflowAgent(); - if (object.agent != null) - message.agent = String(object.agent); - if (object.flowId != null) - message.flowId = String(object.flowId); - if (object.environmentId != null) - message.environmentId = String(object.environmentId); - if (object.inputVariableMapping) { - if (typeof object.inputVariableMapping !== "object") - throw TypeError(".google.cloud.ces.v1.Agent.RemoteDialogflowAgent.inputVariableMapping: object expected"); - message.inputVariableMapping = {}; - for (var keys = Object.keys(object.inputVariableMapping), i = 0; i < keys.length; ++i) - message.inputVariableMapping[keys[i]] = String(object.inputVariableMapping[keys[i]]); - } - if (object.outputVariableMapping) { - if (typeof object.outputVariableMapping !== "object") - throw TypeError(".google.cloud.ces.v1.Agent.RemoteDialogflowAgent.outputVariableMapping: object expected"); - message.outputVariableMapping = {}; - for (var keys = Object.keys(object.outputVariableMapping), i = 0; i < keys.length; ++i) - message.outputVariableMapping[keys[i]] = String(object.outputVariableMapping[keys[i]]); - } - if (object.respectResponseInterruptionSettings != null) - message.respectResponseInterruptionSettings = Boolean(object.respectResponseInterruptionSettings); - return message; - }; - - /** - * Creates a plain object from a RemoteDialogflowAgent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent - * @static - * @param {google.cloud.ces.v1.Agent.RemoteDialogflowAgent} message RemoteDialogflowAgent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RemoteDialogflowAgent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.inputVariableMapping = {}; - object.outputVariableMapping = {}; - } - if (options.defaults) { - object.agent = ""; - object.flowId = ""; - object.environmentId = ""; - object.respectResponseInterruptionSettings = false; - } - if (message.agent != null && message.hasOwnProperty("agent")) - object.agent = message.agent; - if (message.flowId != null && message.hasOwnProperty("flowId")) - object.flowId = message.flowId; - if (message.environmentId != null && message.hasOwnProperty("environmentId")) - object.environmentId = message.environmentId; - var keys2; - if (message.inputVariableMapping && (keys2 = Object.keys(message.inputVariableMapping)).length) { - object.inputVariableMapping = {}; - for (var j = 0; j < keys2.length; ++j) - object.inputVariableMapping[keys2[j]] = message.inputVariableMapping[keys2[j]]; - } - if (message.outputVariableMapping && (keys2 = Object.keys(message.outputVariableMapping)).length) { - object.outputVariableMapping = {}; - for (var j = 0; j < keys2.length; ++j) - object.outputVariableMapping[keys2[j]] = message.outputVariableMapping[keys2[j]]; - } - if (message.respectResponseInterruptionSettings != null && message.hasOwnProperty("respectResponseInterruptionSettings")) - object.respectResponseInterruptionSettings = message.respectResponseInterruptionSettings; - return object; - }; - - /** - * Converts this RemoteDialogflowAgent to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent - * @instance - * @returns {Object.} JSON object - */ - RemoteDialogflowAgent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RemoteDialogflowAgent - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Agent.RemoteDialogflowAgent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RemoteDialogflowAgent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Agent.RemoteDialogflowAgent"; - }; - - return RemoteDialogflowAgent; - })(); - - Agent.AgentToolset = (function() { - - /** - * Properties of an AgentToolset. - * @memberof google.cloud.ces.v1.Agent - * @interface IAgentToolset - * @property {string|null} [toolset] AgentToolset toolset - * @property {Array.|null} [toolIds] AgentToolset toolIds - */ - - /** - * Constructs a new AgentToolset. - * @memberof google.cloud.ces.v1.Agent - * @classdesc Represents an AgentToolset. - * @implements IAgentToolset - * @constructor - * @param {google.cloud.ces.v1.Agent.IAgentToolset=} [properties] Properties to set - */ - function AgentToolset(properties) { - this.toolIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AgentToolset toolset. - * @member {string} toolset - * @memberof google.cloud.ces.v1.Agent.AgentToolset - * @instance - */ - AgentToolset.prototype.toolset = ""; - - /** - * AgentToolset toolIds. - * @member {Array.} toolIds - * @memberof google.cloud.ces.v1.Agent.AgentToolset - * @instance - */ - AgentToolset.prototype.toolIds = $util.emptyArray; - - /** - * Creates a new AgentToolset instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Agent.AgentToolset - * @static - * @param {google.cloud.ces.v1.Agent.IAgentToolset=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Agent.AgentToolset} AgentToolset instance - */ - AgentToolset.create = function create(properties) { - return new AgentToolset(properties); - }; - - /** - * Encodes the specified AgentToolset message. Does not implicitly {@link google.cloud.ces.v1.Agent.AgentToolset.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Agent.AgentToolset - * @static - * @param {google.cloud.ces.v1.Agent.IAgentToolset} message AgentToolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AgentToolset.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.toolset); - if (message.toolIds != null && message.toolIds.length) - for (var i = 0; i < message.toolIds.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.toolIds[i]); - return writer; - }; - - /** - * Encodes the specified AgentToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Agent.AgentToolset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Agent.AgentToolset - * @static - * @param {google.cloud.ces.v1.Agent.IAgentToolset} message AgentToolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AgentToolset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AgentToolset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Agent.AgentToolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Agent.AgentToolset} AgentToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AgentToolset.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Agent.AgentToolset(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.toolset = reader.string(); - break; - } - case 4: { - if (!(message.toolIds && message.toolIds.length)) - message.toolIds = []; - message.toolIds.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AgentToolset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Agent.AgentToolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Agent.AgentToolset} AgentToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AgentToolset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AgentToolset message. - * @function verify - * @memberof google.cloud.ces.v1.Agent.AgentToolset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AgentToolset.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.toolset != null && message.hasOwnProperty("toolset")) - if (!$util.isString(message.toolset)) - return "toolset: string expected"; - if (message.toolIds != null && message.hasOwnProperty("toolIds")) { - if (!Array.isArray(message.toolIds)) - return "toolIds: array expected"; - for (var i = 0; i < message.toolIds.length; ++i) - if (!$util.isString(message.toolIds[i])) - return "toolIds: string[] expected"; - } - return null; - }; - - /** - * Creates an AgentToolset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Agent.AgentToolset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Agent.AgentToolset} AgentToolset - */ - AgentToolset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Agent.AgentToolset) - return object; - var message = new $root.google.cloud.ces.v1.Agent.AgentToolset(); - if (object.toolset != null) - message.toolset = String(object.toolset); - if (object.toolIds) { - if (!Array.isArray(object.toolIds)) - throw TypeError(".google.cloud.ces.v1.Agent.AgentToolset.toolIds: array expected"); - message.toolIds = []; - for (var i = 0; i < object.toolIds.length; ++i) - message.toolIds[i] = String(object.toolIds[i]); - } - return message; - }; - - /** - * Creates a plain object from an AgentToolset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Agent.AgentToolset - * @static - * @param {google.cloud.ces.v1.Agent.AgentToolset} message AgentToolset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AgentToolset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.toolIds = []; - if (options.defaults) - object.toolset = ""; - if (message.toolset != null && message.hasOwnProperty("toolset")) - object.toolset = message.toolset; - if (message.toolIds && message.toolIds.length) { - object.toolIds = []; - for (var j = 0; j < message.toolIds.length; ++j) - object.toolIds[j] = message.toolIds[j]; - } - return object; - }; - - /** - * Converts this AgentToolset to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Agent.AgentToolset - * @instance - * @returns {Object.} JSON object - */ - AgentToolset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AgentToolset - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Agent.AgentToolset - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AgentToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Agent.AgentToolset"; - }; - - return AgentToolset; - })(); - - return Agent; - })(); - - v1.ExpressionCondition = (function() { - - /** - * Properties of an ExpressionCondition. - * @memberof google.cloud.ces.v1 - * @interface IExpressionCondition - * @property {string|null} [expression] ExpressionCondition expression - */ - - /** - * Constructs a new ExpressionCondition. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an ExpressionCondition. - * @implements IExpressionCondition - * @constructor - * @param {google.cloud.ces.v1.IExpressionCondition=} [properties] Properties to set - */ - function ExpressionCondition(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExpressionCondition expression. - * @member {string} expression - * @memberof google.cloud.ces.v1.ExpressionCondition - * @instance - */ - ExpressionCondition.prototype.expression = ""; - - /** - * Creates a new ExpressionCondition instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ExpressionCondition - * @static - * @param {google.cloud.ces.v1.IExpressionCondition=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ExpressionCondition} ExpressionCondition instance - */ - ExpressionCondition.create = function create(properties) { - return new ExpressionCondition(properties); - }; - - /** - * Encodes the specified ExpressionCondition message. Does not implicitly {@link google.cloud.ces.v1.ExpressionCondition.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ExpressionCondition - * @static - * @param {google.cloud.ces.v1.IExpressionCondition} message ExpressionCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExpressionCondition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); - return writer; - }; - - /** - * Encodes the specified ExpressionCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExpressionCondition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ExpressionCondition - * @static - * @param {google.cloud.ces.v1.IExpressionCondition} message ExpressionCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExpressionCondition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExpressionCondition message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ExpressionCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ExpressionCondition} ExpressionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExpressionCondition.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ExpressionCondition(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.expression = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExpressionCondition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ExpressionCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ExpressionCondition} ExpressionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExpressionCondition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExpressionCondition message. - * @function verify - * @memberof google.cloud.ces.v1.ExpressionCondition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExpressionCondition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expression != null && message.hasOwnProperty("expression")) - if (!$util.isString(message.expression)) - return "expression: string expected"; - return null; - }; - - /** - * Creates an ExpressionCondition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ExpressionCondition - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ExpressionCondition} ExpressionCondition - */ - ExpressionCondition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ExpressionCondition) - return object; - var message = new $root.google.cloud.ces.v1.ExpressionCondition(); - if (object.expression != null) - message.expression = String(object.expression); - return message; - }; - - /** - * Creates a plain object from an ExpressionCondition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ExpressionCondition - * @static - * @param {google.cloud.ces.v1.ExpressionCondition} message ExpressionCondition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExpressionCondition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.expression = ""; - if (message.expression != null && message.hasOwnProperty("expression")) - object.expression = message.expression; - return object; - }; - - /** - * Converts this ExpressionCondition to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ExpressionCondition - * @instance - * @returns {Object.} JSON object - */ - ExpressionCondition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExpressionCondition - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ExpressionCondition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExpressionCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ExpressionCondition"; - }; - - return ExpressionCondition; - })(); - - v1.PythonCodeCondition = (function() { - - /** - * Properties of a PythonCodeCondition. - * @memberof google.cloud.ces.v1 - * @interface IPythonCodeCondition - * @property {string|null} [pythonCode] PythonCodeCondition pythonCode - */ - - /** - * Constructs a new PythonCodeCondition. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a PythonCodeCondition. - * @implements IPythonCodeCondition - * @constructor - * @param {google.cloud.ces.v1.IPythonCodeCondition=} [properties] Properties to set - */ - function PythonCodeCondition(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonCodeCondition pythonCode. - * @member {string} pythonCode - * @memberof google.cloud.ces.v1.PythonCodeCondition - * @instance - */ - PythonCodeCondition.prototype.pythonCode = ""; - - /** - * Creates a new PythonCodeCondition instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.PythonCodeCondition - * @static - * @param {google.cloud.ces.v1.IPythonCodeCondition=} [properties] Properties to set - * @returns {google.cloud.ces.v1.PythonCodeCondition} PythonCodeCondition instance - */ - PythonCodeCondition.create = function create(properties) { - return new PythonCodeCondition(properties); - }; - - /** - * Encodes the specified PythonCodeCondition message. Does not implicitly {@link google.cloud.ces.v1.PythonCodeCondition.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.PythonCodeCondition - * @static - * @param {google.cloud.ces.v1.IPythonCodeCondition} message PythonCodeCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonCodeCondition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pythonCode); - return writer; - }; - - /** - * Encodes the specified PythonCodeCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1.PythonCodeCondition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.PythonCodeCondition - * @static - * @param {google.cloud.ces.v1.IPythonCodeCondition} message PythonCodeCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonCodeCondition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonCodeCondition message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.PythonCodeCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.PythonCodeCondition} PythonCodeCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonCodeCondition.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.PythonCodeCondition(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pythonCode = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonCodeCondition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.PythonCodeCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.PythonCodeCondition} PythonCodeCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonCodeCondition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonCodeCondition message. - * @function verify - * @memberof google.cloud.ces.v1.PythonCodeCondition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonCodeCondition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) - if (!$util.isString(message.pythonCode)) - return "pythonCode: string expected"; - return null; - }; - - /** - * Creates a PythonCodeCondition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.PythonCodeCondition - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.PythonCodeCondition} PythonCodeCondition - */ - PythonCodeCondition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.PythonCodeCondition) - return object; - var message = new $root.google.cloud.ces.v1.PythonCodeCondition(); - if (object.pythonCode != null) - message.pythonCode = String(object.pythonCode); - return message; - }; - - /** - * Creates a plain object from a PythonCodeCondition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.PythonCodeCondition - * @static - * @param {google.cloud.ces.v1.PythonCodeCondition} message PythonCodeCondition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonCodeCondition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.pythonCode = ""; - if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) - object.pythonCode = message.pythonCode; - return object; - }; - - /** - * Converts this PythonCodeCondition to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.PythonCodeCondition - * @instance - * @returns {Object.} JSON object - */ - PythonCodeCondition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonCodeCondition - * @function getTypeUrl - * @memberof google.cloud.ces.v1.PythonCodeCondition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonCodeCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.PythonCodeCondition"; - }; - - return PythonCodeCondition; - })(); - - v1.TransferRule = (function() { - - /** - * Properties of a TransferRule. - * @memberof google.cloud.ces.v1 - * @interface ITransferRule - * @property {google.cloud.ces.v1.TransferRule.IDeterministicTransfer|null} [deterministicTransfer] TransferRule deterministicTransfer - * @property {google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer|null} [disablePlannerTransfer] TransferRule disablePlannerTransfer - * @property {string|null} [childAgent] TransferRule childAgent - * @property {google.cloud.ces.v1.TransferRule.Direction|null} [direction] TransferRule direction - */ - - /** - * Constructs a new TransferRule. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a TransferRule. - * @implements ITransferRule - * @constructor - * @param {google.cloud.ces.v1.ITransferRule=} [properties] Properties to set - */ - function TransferRule(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TransferRule deterministicTransfer. - * @member {google.cloud.ces.v1.TransferRule.IDeterministicTransfer|null|undefined} deterministicTransfer - * @memberof google.cloud.ces.v1.TransferRule - * @instance - */ - TransferRule.prototype.deterministicTransfer = null; - - /** - * TransferRule disablePlannerTransfer. - * @member {google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer|null|undefined} disablePlannerTransfer - * @memberof google.cloud.ces.v1.TransferRule - * @instance - */ - TransferRule.prototype.disablePlannerTransfer = null; - - /** - * TransferRule childAgent. - * @member {string} childAgent - * @memberof google.cloud.ces.v1.TransferRule - * @instance - */ - TransferRule.prototype.childAgent = ""; - - /** - * TransferRule direction. - * @member {google.cloud.ces.v1.TransferRule.Direction} direction - * @memberof google.cloud.ces.v1.TransferRule - * @instance - */ - TransferRule.prototype.direction = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TransferRule ruleType. - * @member {"deterministicTransfer"|"disablePlannerTransfer"|undefined} ruleType - * @memberof google.cloud.ces.v1.TransferRule - * @instance - */ - Object.defineProperty(TransferRule.prototype, "ruleType", { - get: $util.oneOfGetter($oneOfFields = ["deterministicTransfer", "disablePlannerTransfer"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TransferRule instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.TransferRule - * @static - * @param {google.cloud.ces.v1.ITransferRule=} [properties] Properties to set - * @returns {google.cloud.ces.v1.TransferRule} TransferRule instance - */ - TransferRule.create = function create(properties) { - return new TransferRule(properties); - }; - - /** - * Encodes the specified TransferRule message. Does not implicitly {@link google.cloud.ces.v1.TransferRule.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.TransferRule - * @static - * @param {google.cloud.ces.v1.ITransferRule} message TransferRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransferRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.childAgent != null && Object.hasOwnProperty.call(message, "childAgent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.childAgent); - if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.direction); - if (message.deterministicTransfer != null && Object.hasOwnProperty.call(message, "deterministicTransfer")) - $root.google.cloud.ces.v1.TransferRule.DeterministicTransfer.encode(message.deterministicTransfer, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.disablePlannerTransfer != null && Object.hasOwnProperty.call(message, "disablePlannerTransfer")) - $root.google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.encode(message.disablePlannerTransfer, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TransferRule message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TransferRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.TransferRule - * @static - * @param {google.cloud.ces.v1.ITransferRule} message TransferRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransferRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransferRule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.TransferRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.TransferRule} TransferRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransferRule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TransferRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.deterministicTransfer = $root.google.cloud.ces.v1.TransferRule.DeterministicTransfer.decode(reader, reader.uint32()); - break; - } - case 4: { - message.disablePlannerTransfer = $root.google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.decode(reader, reader.uint32()); - break; - } - case 1: { - message.childAgent = reader.string(); - break; - } - case 2: { - message.direction = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransferRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.TransferRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.TransferRule} TransferRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransferRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransferRule message. - * @function verify - * @memberof google.cloud.ces.v1.TransferRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransferRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.deterministicTransfer != null && message.hasOwnProperty("deterministicTransfer")) { - properties.ruleType = 1; - { - var error = $root.google.cloud.ces.v1.TransferRule.DeterministicTransfer.verify(message.deterministicTransfer); - if (error) - return "deterministicTransfer." + error; - } - } - if (message.disablePlannerTransfer != null && message.hasOwnProperty("disablePlannerTransfer")) { - if (properties.ruleType === 1) - return "ruleType: multiple values"; - properties.ruleType = 1; - { - var error = $root.google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.verify(message.disablePlannerTransfer); - if (error) - return "disablePlannerTransfer." + error; - } - } - if (message.childAgent != null && message.hasOwnProperty("childAgent")) - if (!$util.isString(message.childAgent)) - return "childAgent: string expected"; - if (message.direction != null && message.hasOwnProperty("direction")) - switch (message.direction) { - default: - return "direction: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a TransferRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.TransferRule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.TransferRule} TransferRule - */ - TransferRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.TransferRule) - return object; - var message = new $root.google.cloud.ces.v1.TransferRule(); - if (object.deterministicTransfer != null) { - if (typeof object.deterministicTransfer !== "object") - throw TypeError(".google.cloud.ces.v1.TransferRule.deterministicTransfer: object expected"); - message.deterministicTransfer = $root.google.cloud.ces.v1.TransferRule.DeterministicTransfer.fromObject(object.deterministicTransfer); - } - if (object.disablePlannerTransfer != null) { - if (typeof object.disablePlannerTransfer !== "object") - throw TypeError(".google.cloud.ces.v1.TransferRule.disablePlannerTransfer: object expected"); - message.disablePlannerTransfer = $root.google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.fromObject(object.disablePlannerTransfer); - } - if (object.childAgent != null) - message.childAgent = String(object.childAgent); - switch (object.direction) { - default: - if (typeof object.direction === "number") { - message.direction = object.direction; - break; - } - break; - case "DIRECTION_UNSPECIFIED": - case 0: - message.direction = 0; - break; - case "PARENT_TO_CHILD": - case 1: - message.direction = 1; - break; - case "CHILD_TO_PARENT": - case 2: - message.direction = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a TransferRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.TransferRule - * @static - * @param {google.cloud.ces.v1.TransferRule} message TransferRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransferRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.childAgent = ""; - object.direction = options.enums === String ? "DIRECTION_UNSPECIFIED" : 0; - } - if (message.childAgent != null && message.hasOwnProperty("childAgent")) - object.childAgent = message.childAgent; - if (message.direction != null && message.hasOwnProperty("direction")) - object.direction = options.enums === String ? $root.google.cloud.ces.v1.TransferRule.Direction[message.direction] === undefined ? message.direction : $root.google.cloud.ces.v1.TransferRule.Direction[message.direction] : message.direction; - if (message.deterministicTransfer != null && message.hasOwnProperty("deterministicTransfer")) { - object.deterministicTransfer = $root.google.cloud.ces.v1.TransferRule.DeterministicTransfer.toObject(message.deterministicTransfer, options); - if (options.oneofs) - object.ruleType = "deterministicTransfer"; - } - if (message.disablePlannerTransfer != null && message.hasOwnProperty("disablePlannerTransfer")) { - object.disablePlannerTransfer = $root.google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.toObject(message.disablePlannerTransfer, options); - if (options.oneofs) - object.ruleType = "disablePlannerTransfer"; - } - return object; - }; - - /** - * Converts this TransferRule to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.TransferRule - * @instance - * @returns {Object.} JSON object - */ - TransferRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransferRule - * @function getTypeUrl - * @memberof google.cloud.ces.v1.TransferRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransferRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.TransferRule"; - }; - - TransferRule.DeterministicTransfer = (function() { - - /** - * Properties of a DeterministicTransfer. - * @memberof google.cloud.ces.v1.TransferRule - * @interface IDeterministicTransfer - * @property {google.cloud.ces.v1.IExpressionCondition|null} [expressionCondition] DeterministicTransfer expressionCondition - * @property {google.cloud.ces.v1.IPythonCodeCondition|null} [pythonCodeCondition] DeterministicTransfer pythonCodeCondition - */ - - /** - * Constructs a new DeterministicTransfer. - * @memberof google.cloud.ces.v1.TransferRule - * @classdesc Represents a DeterministicTransfer. - * @implements IDeterministicTransfer - * @constructor - * @param {google.cloud.ces.v1.TransferRule.IDeterministicTransfer=} [properties] Properties to set - */ - function DeterministicTransfer(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeterministicTransfer expressionCondition. - * @member {google.cloud.ces.v1.IExpressionCondition|null|undefined} expressionCondition - * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer - * @instance - */ - DeterministicTransfer.prototype.expressionCondition = null; - - /** - * DeterministicTransfer pythonCodeCondition. - * @member {google.cloud.ces.v1.IPythonCodeCondition|null|undefined} pythonCodeCondition - * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer - * @instance - */ - DeterministicTransfer.prototype.pythonCodeCondition = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * DeterministicTransfer conditionType. - * @member {"expressionCondition"|"pythonCodeCondition"|undefined} conditionType - * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer - * @instance - */ - Object.defineProperty(DeterministicTransfer.prototype, "conditionType", { - get: $util.oneOfGetter($oneOfFields = ["expressionCondition", "pythonCodeCondition"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DeterministicTransfer instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer - * @static - * @param {google.cloud.ces.v1.TransferRule.IDeterministicTransfer=} [properties] Properties to set - * @returns {google.cloud.ces.v1.TransferRule.DeterministicTransfer} DeterministicTransfer instance - */ - DeterministicTransfer.create = function create(properties) { - return new DeterministicTransfer(properties); - }; - - /** - * Encodes the specified DeterministicTransfer message. Does not implicitly {@link google.cloud.ces.v1.TransferRule.DeterministicTransfer.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer - * @static - * @param {google.cloud.ces.v1.TransferRule.IDeterministicTransfer} message DeterministicTransfer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeterministicTransfer.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expressionCondition != null && Object.hasOwnProperty.call(message, "expressionCondition")) - $root.google.cloud.ces.v1.ExpressionCondition.encode(message.expressionCondition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pythonCodeCondition != null && Object.hasOwnProperty.call(message, "pythonCodeCondition")) - $root.google.cloud.ces.v1.PythonCodeCondition.encode(message.pythonCodeCondition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DeterministicTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TransferRule.DeterministicTransfer.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer - * @static - * @param {google.cloud.ces.v1.TransferRule.IDeterministicTransfer} message DeterministicTransfer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeterministicTransfer.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeterministicTransfer message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.TransferRule.DeterministicTransfer} DeterministicTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeterministicTransfer.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TransferRule.DeterministicTransfer(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.expressionCondition = $root.google.cloud.ces.v1.ExpressionCondition.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pythonCodeCondition = $root.google.cloud.ces.v1.PythonCodeCondition.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeterministicTransfer message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.TransferRule.DeterministicTransfer} DeterministicTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeterministicTransfer.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeterministicTransfer message. - * @function verify - * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeterministicTransfer.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) { - properties.conditionType = 1; - { - var error = $root.google.cloud.ces.v1.ExpressionCondition.verify(message.expressionCondition); - if (error) - return "expressionCondition." + error; - } - } - if (message.pythonCodeCondition != null && message.hasOwnProperty("pythonCodeCondition")) { - if (properties.conditionType === 1) - return "conditionType: multiple values"; - properties.conditionType = 1; - { - var error = $root.google.cloud.ces.v1.PythonCodeCondition.verify(message.pythonCodeCondition); - if (error) - return "pythonCodeCondition." + error; - } - } - return null; - }; - - /** - * Creates a DeterministicTransfer message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.TransferRule.DeterministicTransfer} DeterministicTransfer - */ - DeterministicTransfer.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.TransferRule.DeterministicTransfer) - return object; - var message = new $root.google.cloud.ces.v1.TransferRule.DeterministicTransfer(); - if (object.expressionCondition != null) { - if (typeof object.expressionCondition !== "object") - throw TypeError(".google.cloud.ces.v1.TransferRule.DeterministicTransfer.expressionCondition: object expected"); - message.expressionCondition = $root.google.cloud.ces.v1.ExpressionCondition.fromObject(object.expressionCondition); - } - if (object.pythonCodeCondition != null) { - if (typeof object.pythonCodeCondition !== "object") - throw TypeError(".google.cloud.ces.v1.TransferRule.DeterministicTransfer.pythonCodeCondition: object expected"); - message.pythonCodeCondition = $root.google.cloud.ces.v1.PythonCodeCondition.fromObject(object.pythonCodeCondition); - } - return message; - }; - - /** - * Creates a plain object from a DeterministicTransfer message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer - * @static - * @param {google.cloud.ces.v1.TransferRule.DeterministicTransfer} message DeterministicTransfer - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeterministicTransfer.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) { - object.expressionCondition = $root.google.cloud.ces.v1.ExpressionCondition.toObject(message.expressionCondition, options); - if (options.oneofs) - object.conditionType = "expressionCondition"; - } - if (message.pythonCodeCondition != null && message.hasOwnProperty("pythonCodeCondition")) { - object.pythonCodeCondition = $root.google.cloud.ces.v1.PythonCodeCondition.toObject(message.pythonCodeCondition, options); - if (options.oneofs) - object.conditionType = "pythonCodeCondition"; - } - return object; - }; - - /** - * Converts this DeterministicTransfer to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer - * @instance - * @returns {Object.} JSON object - */ - DeterministicTransfer.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeterministicTransfer - * @function getTypeUrl - * @memberof google.cloud.ces.v1.TransferRule.DeterministicTransfer - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeterministicTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.TransferRule.DeterministicTransfer"; - }; - - return DeterministicTransfer; - })(); - - TransferRule.DisablePlannerTransfer = (function() { - - /** - * Properties of a DisablePlannerTransfer. - * @memberof google.cloud.ces.v1.TransferRule - * @interface IDisablePlannerTransfer - * @property {google.cloud.ces.v1.IExpressionCondition|null} [expressionCondition] DisablePlannerTransfer expressionCondition - */ - - /** - * Constructs a new DisablePlannerTransfer. - * @memberof google.cloud.ces.v1.TransferRule - * @classdesc Represents a DisablePlannerTransfer. - * @implements IDisablePlannerTransfer - * @constructor - * @param {google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer=} [properties] Properties to set - */ - function DisablePlannerTransfer(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DisablePlannerTransfer expressionCondition. - * @member {google.cloud.ces.v1.IExpressionCondition|null|undefined} expressionCondition - * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer - * @instance - */ - DisablePlannerTransfer.prototype.expressionCondition = null; - - /** - * Creates a new DisablePlannerTransfer instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer - * @static - * @param {google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer=} [properties] Properties to set - * @returns {google.cloud.ces.v1.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer instance - */ - DisablePlannerTransfer.create = function create(properties) { - return new DisablePlannerTransfer(properties); - }; - - /** - * Encodes the specified DisablePlannerTransfer message. Does not implicitly {@link google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer - * @static - * @param {google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer} message DisablePlannerTransfer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisablePlannerTransfer.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expressionCondition != null && Object.hasOwnProperty.call(message, "expressionCondition")) - $root.google.cloud.ces.v1.ExpressionCondition.encode(message.expressionCondition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DisablePlannerTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer - * @static - * @param {google.cloud.ces.v1.TransferRule.IDisablePlannerTransfer} message DisablePlannerTransfer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisablePlannerTransfer.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DisablePlannerTransfer message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisablePlannerTransfer.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TransferRule.DisablePlannerTransfer(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.expressionCondition = $root.google.cloud.ces.v1.ExpressionCondition.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DisablePlannerTransfer message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisablePlannerTransfer.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DisablePlannerTransfer message. - * @function verify - * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DisablePlannerTransfer.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) { - var error = $root.google.cloud.ces.v1.ExpressionCondition.verify(message.expressionCondition); - if (error) - return "expressionCondition." + error; - } - return null; - }; - - /** - * Creates a DisablePlannerTransfer message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer - */ - DisablePlannerTransfer.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.TransferRule.DisablePlannerTransfer) - return object; - var message = new $root.google.cloud.ces.v1.TransferRule.DisablePlannerTransfer(); - if (object.expressionCondition != null) { - if (typeof object.expressionCondition !== "object") - throw TypeError(".google.cloud.ces.v1.TransferRule.DisablePlannerTransfer.expressionCondition: object expected"); - message.expressionCondition = $root.google.cloud.ces.v1.ExpressionCondition.fromObject(object.expressionCondition); - } - return message; - }; - - /** - * Creates a plain object from a DisablePlannerTransfer message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer - * @static - * @param {google.cloud.ces.v1.TransferRule.DisablePlannerTransfer} message DisablePlannerTransfer - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DisablePlannerTransfer.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.expressionCondition = null; - if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) - object.expressionCondition = $root.google.cloud.ces.v1.ExpressionCondition.toObject(message.expressionCondition, options); - return object; - }; - - /** - * Converts this DisablePlannerTransfer to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer - * @instance - * @returns {Object.} JSON object - */ - DisablePlannerTransfer.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DisablePlannerTransfer - * @function getTypeUrl - * @memberof google.cloud.ces.v1.TransferRule.DisablePlannerTransfer - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DisablePlannerTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.TransferRule.DisablePlannerTransfer"; - }; - - return DisablePlannerTransfer; - })(); - - /** - * Direction enum. - * @name google.cloud.ces.v1.TransferRule.Direction - * @enum {number} - * @property {number} DIRECTION_UNSPECIFIED=0 DIRECTION_UNSPECIFIED value - * @property {number} PARENT_TO_CHILD=1 PARENT_TO_CHILD value - * @property {number} CHILD_TO_PARENT=2 CHILD_TO_PARENT value - */ - TransferRule.Direction = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "PARENT_TO_CHILD"] = 1; - values[valuesById[2] = "CHILD_TO_PARENT"] = 2; - return values; - })(); - - return TransferRule; - })(); - - /** - * ExecutionType enum. - * @name google.cloud.ces.v1.ExecutionType - * @enum {number} - * @property {number} EXECUTION_TYPE_UNSPECIFIED=0 EXECUTION_TYPE_UNSPECIFIED value - * @property {number} SYNCHRONOUS=1 SYNCHRONOUS value - * @property {number} ASYNCHRONOUS=2 ASYNCHRONOUS value - */ - v1.ExecutionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EXECUTION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SYNCHRONOUS"] = 1; - values[valuesById[2] = "ASYNCHRONOUS"] = 2; - return values; - })(); - - v1.Callback = (function() { - - /** - * Properties of a Callback. - * @memberof google.cloud.ces.v1 - * @interface ICallback - * @property {string|null} [pythonCode] Callback pythonCode - * @property {string|null} [description] Callback description - * @property {boolean|null} [disabled] Callback disabled - * @property {boolean|null} [proactiveExecutionEnabled] Callback proactiveExecutionEnabled - */ - - /** - * Constructs a new Callback. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a Callback. - * @implements ICallback - * @constructor - * @param {google.cloud.ces.v1.ICallback=} [properties] Properties to set - */ - function Callback(properties) { - if (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 pythonCode. - * @member {string|null|undefined} pythonCode - * @memberof google.cloud.ces.v1.Callback - * @instance - */ - Callback.prototype.pythonCode = null; - - /** - * Callback description. - * @member {string} description - * @memberof google.cloud.ces.v1.Callback - * @instance - */ - Callback.prototype.description = ""; - - /** - * Callback disabled. - * @member {boolean} disabled - * @memberof google.cloud.ces.v1.Callback - * @instance - */ - Callback.prototype.disabled = false; - - /** - * Callback proactiveExecutionEnabled. - * @member {boolean} proactiveExecutionEnabled - * @memberof google.cloud.ces.v1.Callback - * @instance - */ - Callback.prototype.proactiveExecutionEnabled = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Callback callback. - * @member {"pythonCode"|undefined} callback - * @memberof google.cloud.ces.v1.Callback - * @instance - */ - Object.defineProperty(Callback.prototype, "callback", { - get: $util.oneOfGetter($oneOfFields = ["pythonCode"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Callback instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Callback - * @static - * @param {google.cloud.ces.v1.ICallback=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Callback} Callback instance - */ - Callback.create = function create(properties) { - return new Callback(properties); - }; - - /** - * Encodes the specified Callback message. Does not implicitly {@link google.cloud.ces.v1.Callback.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Callback - * @static - * @param {google.cloud.ces.v1.ICallback} message Callback message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Callback.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pythonCode); - if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.disabled); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.proactiveExecutionEnabled != null && Object.hasOwnProperty.call(message, "proactiveExecutionEnabled")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.proactiveExecutionEnabled); - return writer; - }; - - /** - * Encodes the specified Callback message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Callback.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Callback - * @static - * @param {google.cloud.ces.v1.ICallback} message Callback message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Callback.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Callback message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Callback - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Callback} Callback - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Callback.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Callback(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pythonCode = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 2: { - message.disabled = reader.bool(); - break; - } - case 4: { - message.proactiveExecutionEnabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Callback message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Callback - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Callback} Callback - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Callback.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Callback message. - * @function verify - * @memberof google.cloud.ces.v1.Callback - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Callback.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) { - properties.callback = 1; - if (!$util.isString(message.pythonCode)) - return "pythonCode: string expected"; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.disabled != null && message.hasOwnProperty("disabled")) - if (typeof message.disabled !== "boolean") - return "disabled: boolean expected"; - if (message.proactiveExecutionEnabled != null && message.hasOwnProperty("proactiveExecutionEnabled")) - if (typeof message.proactiveExecutionEnabled !== "boolean") - return "proactiveExecutionEnabled: boolean expected"; - return null; - }; - - /** - * Creates a Callback message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Callback - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Callback} Callback - */ - Callback.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Callback) - return object; - var message = new $root.google.cloud.ces.v1.Callback(); - if (object.pythonCode != null) - message.pythonCode = String(object.pythonCode); - if (object.description != null) - message.description = String(object.description); - if (object.disabled != null) - message.disabled = Boolean(object.disabled); - if (object.proactiveExecutionEnabled != null) - message.proactiveExecutionEnabled = Boolean(object.proactiveExecutionEnabled); - return message; - }; - - /** - * Creates a plain object from a Callback message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Callback - * @static - * @param {google.cloud.ces.v1.Callback} message Callback - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Callback.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.disabled = false; - object.description = ""; - object.proactiveExecutionEnabled = false; - } - if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) { - object.pythonCode = message.pythonCode; - if (options.oneofs) - object.callback = "pythonCode"; - } - if (message.disabled != null && message.hasOwnProperty("disabled")) - object.disabled = message.disabled; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.proactiveExecutionEnabled != null && message.hasOwnProperty("proactiveExecutionEnabled")) - object.proactiveExecutionEnabled = message.proactiveExecutionEnabled; - return object; - }; - - /** - * Converts this Callback to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Callback - * @instance - * @returns {Object.} JSON object - */ - Callback.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Callback - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Callback - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Callback.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Callback"; - }; - - return Callback; - })(); - - v1.ModelSettings = (function() { - - /** - * Properties of a ModelSettings. - * @memberof google.cloud.ces.v1 - * @interface IModelSettings - * @property {string|null} [model] ModelSettings model - * @property {number|null} [temperature] ModelSettings temperature - */ - - /** - * Constructs a new ModelSettings. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ModelSettings. - * @implements IModelSettings - * @constructor - * @param {google.cloud.ces.v1.IModelSettings=} [properties] Properties to set - */ - function ModelSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ModelSettings model. - * @member {string} model - * @memberof google.cloud.ces.v1.ModelSettings - * @instance - */ - ModelSettings.prototype.model = ""; - - /** - * ModelSettings temperature. - * @member {number|null|undefined} temperature - * @memberof google.cloud.ces.v1.ModelSettings - * @instance - */ - ModelSettings.prototype.temperature = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ModelSettings.prototype, "_temperature", { - get: $util.oneOfGetter($oneOfFields = ["temperature"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ModelSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ModelSettings - * @static - * @param {google.cloud.ces.v1.IModelSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ModelSettings} ModelSettings instance - */ - ModelSettings.create = function create(properties) { - return new ModelSettings(properties); - }; - - /** - * Encodes the specified ModelSettings message. Does not implicitly {@link google.cloud.ces.v1.ModelSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ModelSettings - * @static - * @param {google.cloud.ces.v1.IModelSettings} message ModelSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModelSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); - if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.temperature); - return writer; - }; - - /** - * Encodes the specified ModelSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ModelSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ModelSettings - * @static - * @param {google.cloud.ces.v1.IModelSettings} message ModelSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModelSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ModelSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ModelSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ModelSettings} ModelSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModelSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ModelSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.model = reader.string(); - break; - } - case 2: { - message.temperature = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ModelSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ModelSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ModelSettings} ModelSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModelSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ModelSettings message. - * @function verify - * @memberof google.cloud.ces.v1.ModelSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ModelSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.model != null && message.hasOwnProperty("model")) - if (!$util.isString(message.model)) - return "model: string expected"; - if (message.temperature != null && message.hasOwnProperty("temperature")) { - properties._temperature = 1; - if (typeof message.temperature !== "number") - return "temperature: number expected"; - } - return null; - }; - - /** - * Creates a ModelSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ModelSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ModelSettings} ModelSettings - */ - ModelSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ModelSettings) - return object; - var message = new $root.google.cloud.ces.v1.ModelSettings(); - if (object.model != null) - message.model = String(object.model); - if (object.temperature != null) - message.temperature = Number(object.temperature); - return message; - }; - - /** - * Creates a plain object from a ModelSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ModelSettings - * @static - * @param {google.cloud.ces.v1.ModelSettings} message ModelSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ModelSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.model = ""; - if (message.model != null && message.hasOwnProperty("model")) - object.model = message.model; - if (message.temperature != null && message.hasOwnProperty("temperature")) { - object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; - if (options.oneofs) - object._temperature = "temperature"; - } - return object; - }; - - /** - * Converts this ModelSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ModelSettings - * @instance - * @returns {Object.} JSON object - */ - ModelSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ModelSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ModelSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ModelSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ModelSettings"; - }; - - return ModelSettings; - })(); - - v1.TriggerAction = (function() { - - /** - * Properties of a TriggerAction. - * @memberof google.cloud.ces.v1 - * @interface ITriggerAction - * @property {google.cloud.ces.v1.TriggerAction.IRespondImmediately|null} [respondImmediately] TriggerAction respondImmediately - * @property {google.cloud.ces.v1.TriggerAction.ITransferAgent|null} [transferAgent] TriggerAction transferAgent - * @property {google.cloud.ces.v1.TriggerAction.IGenerativeAnswer|null} [generativeAnswer] TriggerAction generativeAnswer - */ - - /** - * Constructs a new TriggerAction. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a TriggerAction. - * @implements ITriggerAction - * @constructor - * @param {google.cloud.ces.v1.ITriggerAction=} [properties] Properties to set - */ - function TriggerAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TriggerAction respondImmediately. - * @member {google.cloud.ces.v1.TriggerAction.IRespondImmediately|null|undefined} respondImmediately - * @memberof google.cloud.ces.v1.TriggerAction - * @instance - */ - TriggerAction.prototype.respondImmediately = null; - - /** - * TriggerAction transferAgent. - * @member {google.cloud.ces.v1.TriggerAction.ITransferAgent|null|undefined} transferAgent - * @memberof google.cloud.ces.v1.TriggerAction - * @instance - */ - TriggerAction.prototype.transferAgent = null; - - /** - * TriggerAction generativeAnswer. - * @member {google.cloud.ces.v1.TriggerAction.IGenerativeAnswer|null|undefined} generativeAnswer - * @memberof google.cloud.ces.v1.TriggerAction - * @instance - */ - TriggerAction.prototype.generativeAnswer = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TriggerAction action. - * @member {"respondImmediately"|"transferAgent"|"generativeAnswer"|undefined} action - * @memberof google.cloud.ces.v1.TriggerAction - * @instance - */ - Object.defineProperty(TriggerAction.prototype, "action", { - get: $util.oneOfGetter($oneOfFields = ["respondImmediately", "transferAgent", "generativeAnswer"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TriggerAction instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.TriggerAction - * @static - * @param {google.cloud.ces.v1.ITriggerAction=} [properties] Properties to set - * @returns {google.cloud.ces.v1.TriggerAction} TriggerAction instance - */ - TriggerAction.create = function create(properties) { - return new TriggerAction(properties); - }; - - /** - * Encodes the specified TriggerAction message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.TriggerAction - * @static - * @param {google.cloud.ces.v1.ITriggerAction} message TriggerAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TriggerAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.respondImmediately != null && Object.hasOwnProperty.call(message, "respondImmediately")) - $root.google.cloud.ces.v1.TriggerAction.RespondImmediately.encode(message.respondImmediately, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.transferAgent != null && Object.hasOwnProperty.call(message, "transferAgent")) - $root.google.cloud.ces.v1.TriggerAction.TransferAgent.encode(message.transferAgent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.generativeAnswer != null && Object.hasOwnProperty.call(message, "generativeAnswer")) - $root.google.cloud.ces.v1.TriggerAction.GenerativeAnswer.encode(message.generativeAnswer, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TriggerAction message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.TriggerAction - * @static - * @param {google.cloud.ces.v1.ITriggerAction} message TriggerAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TriggerAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TriggerAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.TriggerAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.TriggerAction} TriggerAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TriggerAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TriggerAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.respondImmediately = $root.google.cloud.ces.v1.TriggerAction.RespondImmediately.decode(reader, reader.uint32()); - break; - } - case 2: { - message.transferAgent = $root.google.cloud.ces.v1.TriggerAction.TransferAgent.decode(reader, reader.uint32()); - break; - } - case 3: { - message.generativeAnswer = $root.google.cloud.ces.v1.TriggerAction.GenerativeAnswer.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TriggerAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.TriggerAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.TriggerAction} TriggerAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TriggerAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TriggerAction message. - * @function verify - * @memberof google.cloud.ces.v1.TriggerAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TriggerAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.respondImmediately != null && message.hasOwnProperty("respondImmediately")) { - properties.action = 1; - { - var error = $root.google.cloud.ces.v1.TriggerAction.RespondImmediately.verify(message.respondImmediately); - if (error) - return "respondImmediately." + error; - } - } - if (message.transferAgent != null && message.hasOwnProperty("transferAgent")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.ces.v1.TriggerAction.TransferAgent.verify(message.transferAgent); - if (error) - return "transferAgent." + error; - } - } - if (message.generativeAnswer != null && message.hasOwnProperty("generativeAnswer")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.ces.v1.TriggerAction.GenerativeAnswer.verify(message.generativeAnswer); - if (error) - return "generativeAnswer." + error; - } - } - return null; - }; - - /** - * Creates a TriggerAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.TriggerAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.TriggerAction} TriggerAction - */ - TriggerAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.TriggerAction) - return object; - var message = new $root.google.cloud.ces.v1.TriggerAction(); - if (object.respondImmediately != null) { - if (typeof object.respondImmediately !== "object") - throw TypeError(".google.cloud.ces.v1.TriggerAction.respondImmediately: object expected"); - message.respondImmediately = $root.google.cloud.ces.v1.TriggerAction.RespondImmediately.fromObject(object.respondImmediately); - } - if (object.transferAgent != null) { - if (typeof object.transferAgent !== "object") - throw TypeError(".google.cloud.ces.v1.TriggerAction.transferAgent: object expected"); - message.transferAgent = $root.google.cloud.ces.v1.TriggerAction.TransferAgent.fromObject(object.transferAgent); - } - if (object.generativeAnswer != null) { - if (typeof object.generativeAnswer !== "object") - throw TypeError(".google.cloud.ces.v1.TriggerAction.generativeAnswer: object expected"); - message.generativeAnswer = $root.google.cloud.ces.v1.TriggerAction.GenerativeAnswer.fromObject(object.generativeAnswer); - } - return message; - }; - - /** - * Creates a plain object from a TriggerAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.TriggerAction - * @static - * @param {google.cloud.ces.v1.TriggerAction} message TriggerAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TriggerAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.respondImmediately != null && message.hasOwnProperty("respondImmediately")) { - object.respondImmediately = $root.google.cloud.ces.v1.TriggerAction.RespondImmediately.toObject(message.respondImmediately, options); - if (options.oneofs) - object.action = "respondImmediately"; - } - if (message.transferAgent != null && message.hasOwnProperty("transferAgent")) { - object.transferAgent = $root.google.cloud.ces.v1.TriggerAction.TransferAgent.toObject(message.transferAgent, options); - if (options.oneofs) - object.action = "transferAgent"; - } - if (message.generativeAnswer != null && message.hasOwnProperty("generativeAnswer")) { - object.generativeAnswer = $root.google.cloud.ces.v1.TriggerAction.GenerativeAnswer.toObject(message.generativeAnswer, options); - if (options.oneofs) - object.action = "generativeAnswer"; - } - return object; - }; - - /** - * Converts this TriggerAction to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.TriggerAction - * @instance - * @returns {Object.} JSON object - */ - TriggerAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TriggerAction - * @function getTypeUrl - * @memberof google.cloud.ces.v1.TriggerAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TriggerAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.TriggerAction"; - }; - - TriggerAction.Response = (function() { - - /** - * Properties of a Response. - * @memberof google.cloud.ces.v1.TriggerAction - * @interface IResponse - * @property {string|null} [text] Response text - * @property {boolean|null} [disabled] Response disabled - */ - - /** - * Constructs a new Response. - * @memberof google.cloud.ces.v1.TriggerAction - * @classdesc Represents a Response. - * @implements IResponse - * @constructor - * @param {google.cloud.ces.v1.TriggerAction.IResponse=} [properties] Properties to set - */ - function Response(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Response text. - * @member {string} text - * @memberof google.cloud.ces.v1.TriggerAction.Response - * @instance - */ - Response.prototype.text = ""; - - /** - * Response disabled. - * @member {boolean} disabled - * @memberof google.cloud.ces.v1.TriggerAction.Response - * @instance - */ - Response.prototype.disabled = false; - - /** - * Creates a new Response instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.TriggerAction.Response - * @static - * @param {google.cloud.ces.v1.TriggerAction.IResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.TriggerAction.Response} Response instance - */ - Response.create = function create(properties) { - return new Response(properties); - }; - - /** - * Encodes the specified Response message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.Response.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.TriggerAction.Response - * @static - * @param {google.cloud.ces.v1.TriggerAction.IResponse} message Response message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Response.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.disabled); - return writer; - }; - - /** - * Encodes the specified Response message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.Response.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.TriggerAction.Response - * @static - * @param {google.cloud.ces.v1.TriggerAction.IResponse} message Response message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Response.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Response message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.TriggerAction.Response - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.TriggerAction.Response} Response - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Response.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TriggerAction.Response(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.text = reader.string(); - break; - } - case 2: { - message.disabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Response message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.TriggerAction.Response - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.TriggerAction.Response} Response - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Response.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Response message. - * @function verify - * @memberof google.cloud.ces.v1.TriggerAction.Response - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Response.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.disabled != null && message.hasOwnProperty("disabled")) - if (typeof message.disabled !== "boolean") - return "disabled: boolean expected"; - return null; - }; - - /** - * Creates a Response message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.TriggerAction.Response - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.TriggerAction.Response} Response - */ - Response.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.TriggerAction.Response) - return object; - var message = new $root.google.cloud.ces.v1.TriggerAction.Response(); - if (object.text != null) - message.text = String(object.text); - if (object.disabled != null) - message.disabled = Boolean(object.disabled); - return message; - }; - - /** - * Creates a plain object from a Response message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.TriggerAction.Response - * @static - * @param {google.cloud.ces.v1.TriggerAction.Response} message Response - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Response.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.text = ""; - object.disabled = false; - } - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.disabled != null && message.hasOwnProperty("disabled")) - object.disabled = message.disabled; - return object; - }; - - /** - * Converts this Response to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.TriggerAction.Response - * @instance - * @returns {Object.} JSON object - */ - Response.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Response - * @function getTypeUrl - * @memberof google.cloud.ces.v1.TriggerAction.Response - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Response.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.TriggerAction.Response"; - }; - - return Response; - })(); - - TriggerAction.RespondImmediately = (function() { - - /** - * Properties of a RespondImmediately. - * @memberof google.cloud.ces.v1.TriggerAction - * @interface IRespondImmediately - * @property {Array.|null} [responses] RespondImmediately responses - */ - - /** - * Constructs a new RespondImmediately. - * @memberof google.cloud.ces.v1.TriggerAction - * @classdesc Represents a RespondImmediately. - * @implements IRespondImmediately - * @constructor - * @param {google.cloud.ces.v1.TriggerAction.IRespondImmediately=} [properties] Properties to set - */ - function RespondImmediately(properties) { - this.responses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RespondImmediately responses. - * @member {Array.} responses - * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately - * @instance - */ - RespondImmediately.prototype.responses = $util.emptyArray; - - /** - * Creates a new RespondImmediately instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately - * @static - * @param {google.cloud.ces.v1.TriggerAction.IRespondImmediately=} [properties] Properties to set - * @returns {google.cloud.ces.v1.TriggerAction.RespondImmediately} RespondImmediately instance - */ - RespondImmediately.create = function create(properties) { - return new RespondImmediately(properties); - }; - - /** - * Encodes the specified RespondImmediately message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.RespondImmediately.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately - * @static - * @param {google.cloud.ces.v1.TriggerAction.IRespondImmediately} message RespondImmediately message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RespondImmediately.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responses != null && message.responses.length) - for (var i = 0; i < message.responses.length; ++i) - $root.google.cloud.ces.v1.TriggerAction.Response.encode(message.responses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RespondImmediately message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.RespondImmediately.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately - * @static - * @param {google.cloud.ces.v1.TriggerAction.IRespondImmediately} message RespondImmediately message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RespondImmediately.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RespondImmediately message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.TriggerAction.RespondImmediately} RespondImmediately - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RespondImmediately.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TriggerAction.RespondImmediately(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.responses && message.responses.length)) - message.responses = []; - message.responses.push($root.google.cloud.ces.v1.TriggerAction.Response.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RespondImmediately message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.TriggerAction.RespondImmediately} RespondImmediately - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RespondImmediately.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RespondImmediately message. - * @function verify - * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RespondImmediately.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responses != null && message.hasOwnProperty("responses")) { - if (!Array.isArray(message.responses)) - return "responses: array expected"; - for (var i = 0; i < message.responses.length; ++i) { - var error = $root.google.cloud.ces.v1.TriggerAction.Response.verify(message.responses[i]); - if (error) - return "responses." + error; - } - } - return null; - }; - - /** - * Creates a RespondImmediately message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.TriggerAction.RespondImmediately} RespondImmediately - */ - RespondImmediately.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.TriggerAction.RespondImmediately) - return object; - var message = new $root.google.cloud.ces.v1.TriggerAction.RespondImmediately(); - if (object.responses) { - if (!Array.isArray(object.responses)) - throw TypeError(".google.cloud.ces.v1.TriggerAction.RespondImmediately.responses: array expected"); - message.responses = []; - for (var i = 0; i < object.responses.length; ++i) { - if (typeof object.responses[i] !== "object") - throw TypeError(".google.cloud.ces.v1.TriggerAction.RespondImmediately.responses: object expected"); - message.responses[i] = $root.google.cloud.ces.v1.TriggerAction.Response.fromObject(object.responses[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RespondImmediately message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately - * @static - * @param {google.cloud.ces.v1.TriggerAction.RespondImmediately} message RespondImmediately - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RespondImmediately.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.responses = []; - if (message.responses && message.responses.length) { - object.responses = []; - for (var j = 0; j < message.responses.length; ++j) - object.responses[j] = $root.google.cloud.ces.v1.TriggerAction.Response.toObject(message.responses[j], options); - } - return object; - }; - - /** - * Converts this RespondImmediately to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately - * @instance - * @returns {Object.} JSON object - */ - RespondImmediately.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RespondImmediately - * @function getTypeUrl - * @memberof google.cloud.ces.v1.TriggerAction.RespondImmediately - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RespondImmediately.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.TriggerAction.RespondImmediately"; - }; - - return RespondImmediately; - })(); - - TriggerAction.GenerativeAnswer = (function() { - - /** - * Properties of a GenerativeAnswer. - * @memberof google.cloud.ces.v1.TriggerAction - * @interface IGenerativeAnswer - * @property {string|null} [prompt] GenerativeAnswer prompt - */ - - /** - * Constructs a new GenerativeAnswer. - * @memberof google.cloud.ces.v1.TriggerAction - * @classdesc Represents a GenerativeAnswer. - * @implements IGenerativeAnswer - * @constructor - * @param {google.cloud.ces.v1.TriggerAction.IGenerativeAnswer=} [properties] Properties to set - */ - function GenerativeAnswer(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenerativeAnswer prompt. - * @member {string} prompt - * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer - * @instance - */ - GenerativeAnswer.prototype.prompt = ""; - - /** - * Creates a new GenerativeAnswer instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer - * @static - * @param {google.cloud.ces.v1.TriggerAction.IGenerativeAnswer=} [properties] Properties to set - * @returns {google.cloud.ces.v1.TriggerAction.GenerativeAnswer} GenerativeAnswer instance - */ - GenerativeAnswer.create = function create(properties) { - return new GenerativeAnswer(properties); - }; - - /** - * Encodes the specified GenerativeAnswer message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.GenerativeAnswer.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer - * @static - * @param {google.cloud.ces.v1.TriggerAction.IGenerativeAnswer} message GenerativeAnswer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerativeAnswer.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.prompt); - return writer; - }; - - /** - * Encodes the specified GenerativeAnswer message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.GenerativeAnswer.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer - * @static - * @param {google.cloud.ces.v1.TriggerAction.IGenerativeAnswer} message GenerativeAnswer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerativeAnswer.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenerativeAnswer message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.TriggerAction.GenerativeAnswer} GenerativeAnswer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerativeAnswer.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TriggerAction.GenerativeAnswer(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.prompt = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenerativeAnswer message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.TriggerAction.GenerativeAnswer} GenerativeAnswer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerativeAnswer.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenerativeAnswer message. - * @function verify - * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenerativeAnswer.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.prompt != null && message.hasOwnProperty("prompt")) - if (!$util.isString(message.prompt)) - return "prompt: string expected"; - return null; - }; - - /** - * Creates a GenerativeAnswer message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.TriggerAction.GenerativeAnswer} GenerativeAnswer - */ - GenerativeAnswer.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.TriggerAction.GenerativeAnswer) - return object; - var message = new $root.google.cloud.ces.v1.TriggerAction.GenerativeAnswer(); - if (object.prompt != null) - message.prompt = String(object.prompt); - return message; - }; - - /** - * Creates a plain object from a GenerativeAnswer message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer - * @static - * @param {google.cloud.ces.v1.TriggerAction.GenerativeAnswer} message GenerativeAnswer - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenerativeAnswer.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.prompt = ""; - if (message.prompt != null && message.hasOwnProperty("prompt")) - object.prompt = message.prompt; - return object; - }; - - /** - * Converts this GenerativeAnswer to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer - * @instance - * @returns {Object.} JSON object - */ - GenerativeAnswer.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenerativeAnswer - * @function getTypeUrl - * @memberof google.cloud.ces.v1.TriggerAction.GenerativeAnswer - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenerativeAnswer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.TriggerAction.GenerativeAnswer"; - }; - - return GenerativeAnswer; - })(); - - TriggerAction.TransferAgent = (function() { - - /** - * Properties of a TransferAgent. - * @memberof google.cloud.ces.v1.TriggerAction - * @interface ITransferAgent - * @property {string|null} [agent] TransferAgent agent - */ - - /** - * Constructs a new TransferAgent. - * @memberof google.cloud.ces.v1.TriggerAction - * @classdesc Represents a TransferAgent. - * @implements ITransferAgent - * @constructor - * @param {google.cloud.ces.v1.TriggerAction.ITransferAgent=} [properties] Properties to set - */ - function TransferAgent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TransferAgent agent. - * @member {string} agent - * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent - * @instance - */ - TransferAgent.prototype.agent = ""; - - /** - * Creates a new TransferAgent instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent - * @static - * @param {google.cloud.ces.v1.TriggerAction.ITransferAgent=} [properties] Properties to set - * @returns {google.cloud.ces.v1.TriggerAction.TransferAgent} TransferAgent instance - */ - TransferAgent.create = function create(properties) { - return new TransferAgent(properties); - }; - - /** - * Encodes the specified TransferAgent message. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.TransferAgent.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent - * @static - * @param {google.cloud.ces.v1.TriggerAction.ITransferAgent} message TransferAgent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransferAgent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.agent); - return writer; - }; - - /** - * Encodes the specified TransferAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TriggerAction.TransferAgent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent - * @static - * @param {google.cloud.ces.v1.TriggerAction.ITransferAgent} message TransferAgent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransferAgent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransferAgent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.TriggerAction.TransferAgent} TransferAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransferAgent.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TriggerAction.TransferAgent(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.agent = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransferAgent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.TriggerAction.TransferAgent} TransferAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransferAgent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransferAgent message. - * @function verify - * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransferAgent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.agent != null && message.hasOwnProperty("agent")) - if (!$util.isString(message.agent)) - return "agent: string expected"; - return null; - }; - - /** - * Creates a TransferAgent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.TriggerAction.TransferAgent} TransferAgent - */ - TransferAgent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.TriggerAction.TransferAgent) - return object; - var message = new $root.google.cloud.ces.v1.TriggerAction.TransferAgent(); - if (object.agent != null) - message.agent = String(object.agent); - return message; - }; - - /** - * Creates a plain object from a TransferAgent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent - * @static - * @param {google.cloud.ces.v1.TriggerAction.TransferAgent} message TransferAgent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransferAgent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.agent = ""; - if (message.agent != null && message.hasOwnProperty("agent")) - object.agent = message.agent; - return object; - }; - - /** - * Converts this TransferAgent to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent - * @instance - * @returns {Object.} JSON object - */ - TransferAgent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransferAgent - * @function getTypeUrl - * @memberof google.cloud.ces.v1.TriggerAction.TransferAgent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransferAgent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.TriggerAction.TransferAgent"; - }; - - return TransferAgent; - })(); - - return TriggerAction; - })(); - - v1.TlsConfig = (function() { - - /** - * Properties of a TlsConfig. - * @memberof google.cloud.ces.v1 - * @interface ITlsConfig - * @property {Array.|null} [caCerts] TlsConfig caCerts - */ - - /** - * Constructs a new TlsConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a TlsConfig. - * @implements ITlsConfig - * @constructor - * @param {google.cloud.ces.v1.ITlsConfig=} [properties] Properties to set - */ - function TlsConfig(properties) { - this.caCerts = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TlsConfig caCerts. - * @member {Array.} caCerts - * @memberof google.cloud.ces.v1.TlsConfig - * @instance - */ - TlsConfig.prototype.caCerts = $util.emptyArray; - - /** - * Creates a new TlsConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.TlsConfig - * @static - * @param {google.cloud.ces.v1.ITlsConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.TlsConfig} TlsConfig instance - */ - TlsConfig.create = function create(properties) { - return new TlsConfig(properties); - }; - - /** - * Encodes the specified TlsConfig message. Does not implicitly {@link google.cloud.ces.v1.TlsConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.TlsConfig - * @static - * @param {google.cloud.ces.v1.ITlsConfig} message TlsConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TlsConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.caCerts != null && message.caCerts.length) - for (var i = 0; i < message.caCerts.length; ++i) - $root.google.cloud.ces.v1.TlsConfig.CaCert.encode(message.caCerts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TlsConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TlsConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.TlsConfig - * @static - * @param {google.cloud.ces.v1.ITlsConfig} message TlsConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TlsConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TlsConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.TlsConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.TlsConfig} TlsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TlsConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TlsConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.caCerts && message.caCerts.length)) - message.caCerts = []; - message.caCerts.push($root.google.cloud.ces.v1.TlsConfig.CaCert.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TlsConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.TlsConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.TlsConfig} TlsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TlsConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TlsConfig message. - * @function verify - * @memberof google.cloud.ces.v1.TlsConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TlsConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.caCerts != null && message.hasOwnProperty("caCerts")) { - if (!Array.isArray(message.caCerts)) - return "caCerts: array expected"; - for (var i = 0; i < message.caCerts.length; ++i) { - var error = $root.google.cloud.ces.v1.TlsConfig.CaCert.verify(message.caCerts[i]); - if (error) - return "caCerts." + error; - } - } - return null; - }; - - /** - * Creates a TlsConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.TlsConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.TlsConfig} TlsConfig - */ - TlsConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.TlsConfig) - return object; - var message = new $root.google.cloud.ces.v1.TlsConfig(); - if (object.caCerts) { - if (!Array.isArray(object.caCerts)) - throw TypeError(".google.cloud.ces.v1.TlsConfig.caCerts: array expected"); - message.caCerts = []; - for (var i = 0; i < object.caCerts.length; ++i) { - if (typeof object.caCerts[i] !== "object") - throw TypeError(".google.cloud.ces.v1.TlsConfig.caCerts: object expected"); - message.caCerts[i] = $root.google.cloud.ces.v1.TlsConfig.CaCert.fromObject(object.caCerts[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TlsConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.TlsConfig - * @static - * @param {google.cloud.ces.v1.TlsConfig} message TlsConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TlsConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.caCerts = []; - if (message.caCerts && message.caCerts.length) { - object.caCerts = []; - for (var j = 0; j < message.caCerts.length; ++j) - object.caCerts[j] = $root.google.cloud.ces.v1.TlsConfig.CaCert.toObject(message.caCerts[j], options); - } - return object; - }; - - /** - * Converts this TlsConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.TlsConfig - * @instance - * @returns {Object.} JSON object - */ - TlsConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TlsConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.TlsConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TlsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.TlsConfig"; - }; - - TlsConfig.CaCert = (function() { - - /** - * Properties of a CaCert. - * @memberof google.cloud.ces.v1.TlsConfig - * @interface ICaCert - * @property {string|null} [displayName] CaCert displayName - * @property {Uint8Array|null} [cert] CaCert cert - */ - - /** - * Constructs a new CaCert. - * @memberof google.cloud.ces.v1.TlsConfig - * @classdesc Represents a CaCert. - * @implements ICaCert - * @constructor - * @param {google.cloud.ces.v1.TlsConfig.ICaCert=} [properties] Properties to set - */ - function CaCert(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CaCert displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1.TlsConfig.CaCert - * @instance - */ - CaCert.prototype.displayName = ""; - - /** - * CaCert cert. - * @member {Uint8Array} cert - * @memberof google.cloud.ces.v1.TlsConfig.CaCert - * @instance - */ - CaCert.prototype.cert = $util.newBuffer([]); - - /** - * Creates a new CaCert instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.TlsConfig.CaCert - * @static - * @param {google.cloud.ces.v1.TlsConfig.ICaCert=} [properties] Properties to set - * @returns {google.cloud.ces.v1.TlsConfig.CaCert} CaCert instance - */ - CaCert.create = function create(properties) { - return new CaCert(properties); - }; - - /** - * Encodes the specified CaCert message. Does not implicitly {@link google.cloud.ces.v1.TlsConfig.CaCert.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.TlsConfig.CaCert - * @static - * @param {google.cloud.ces.v1.TlsConfig.ICaCert} message CaCert message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CaCert.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); - if (message.cert != null && Object.hasOwnProperty.call(message, "cert")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.cert); - return writer; - }; - - /** - * Encodes the specified CaCert message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TlsConfig.CaCert.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.TlsConfig.CaCert - * @static - * @param {google.cloud.ces.v1.TlsConfig.ICaCert} message CaCert message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CaCert.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CaCert message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.TlsConfig.CaCert - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.TlsConfig.CaCert} CaCert - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CaCert.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TlsConfig.CaCert(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.displayName = reader.string(); - break; - } - case 2: { - message.cert = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CaCert message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.TlsConfig.CaCert - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.TlsConfig.CaCert} CaCert - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CaCert.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CaCert message. - * @function verify - * @memberof google.cloud.ces.v1.TlsConfig.CaCert - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CaCert.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.cert != null && message.hasOwnProperty("cert")) - if (!(message.cert && typeof message.cert.length === "number" || $util.isString(message.cert))) - return "cert: buffer expected"; - return null; - }; - - /** - * Creates a CaCert message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.TlsConfig.CaCert - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.TlsConfig.CaCert} CaCert - */ - CaCert.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.TlsConfig.CaCert) - return object; - var message = new $root.google.cloud.ces.v1.TlsConfig.CaCert(); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.cert != null) - if (typeof object.cert === "string") - $util.base64.decode(object.cert, message.cert = $util.newBuffer($util.base64.length(object.cert)), 0); - else if (object.cert.length >= 0) - message.cert = object.cert; - return message; - }; - - /** - * Creates a plain object from a CaCert message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.TlsConfig.CaCert - * @static - * @param {google.cloud.ces.v1.TlsConfig.CaCert} message CaCert - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CaCert.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.displayName = ""; - if (options.bytes === String) - object.cert = ""; - else { - object.cert = []; - if (options.bytes !== Array) - object.cert = $util.newBuffer(object.cert); - } - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.cert != null && message.hasOwnProperty("cert")) - object.cert = options.bytes === String ? $util.base64.encode(message.cert, 0, message.cert.length) : options.bytes === Array ? Array.prototype.slice.call(message.cert) : message.cert; - return object; - }; - - /** - * Converts this CaCert to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.TlsConfig.CaCert - * @instance - * @returns {Object.} JSON object - */ - CaCert.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CaCert - * @function getTypeUrl - * @memberof google.cloud.ces.v1.TlsConfig.CaCert - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CaCert.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.TlsConfig.CaCert"; - }; - - return CaCert; - })(); - - return TlsConfig; - })(); - - v1.ServiceDirectoryConfig = (function() { - - /** - * Properties of a ServiceDirectoryConfig. - * @memberof google.cloud.ces.v1 - * @interface IServiceDirectoryConfig - * @property {string|null} [service] ServiceDirectoryConfig service - */ - - /** - * Constructs a new ServiceDirectoryConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ServiceDirectoryConfig. - * @implements IServiceDirectoryConfig - * @constructor - * @param {google.cloud.ces.v1.IServiceDirectoryConfig=} [properties] Properties to set - */ - function ServiceDirectoryConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDirectoryConfig service. - * @member {string} service - * @memberof google.cloud.ces.v1.ServiceDirectoryConfig - * @instance - */ - ServiceDirectoryConfig.prototype.service = ""; - - /** - * Creates a new ServiceDirectoryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ServiceDirectoryConfig - * @static - * @param {google.cloud.ces.v1.IServiceDirectoryConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ServiceDirectoryConfig} ServiceDirectoryConfig instance - */ - ServiceDirectoryConfig.create = function create(properties) { - return new ServiceDirectoryConfig(properties); - }; - - /** - * Encodes the specified ServiceDirectoryConfig message. Does not implicitly {@link google.cloud.ces.v1.ServiceDirectoryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ServiceDirectoryConfig - * @static - * @param {google.cloud.ces.v1.IServiceDirectoryConfig} message ServiceDirectoryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDirectoryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); - return writer; - }; - - /** - * Encodes the specified ServiceDirectoryConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ServiceDirectoryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ServiceDirectoryConfig - * @static - * @param {google.cloud.ces.v1.IServiceDirectoryConfig} message ServiceDirectoryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDirectoryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDirectoryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ServiceDirectoryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ServiceDirectoryConfig} ServiceDirectoryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDirectoryConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ServiceDirectoryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.service = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDirectoryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ServiceDirectoryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ServiceDirectoryConfig} ServiceDirectoryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDirectoryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDirectoryConfig message. - * @function verify - * @memberof google.cloud.ces.v1.ServiceDirectoryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDirectoryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - return null; - }; - - /** - * Creates a ServiceDirectoryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ServiceDirectoryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ServiceDirectoryConfig} ServiceDirectoryConfig - */ - ServiceDirectoryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ServiceDirectoryConfig) - return object; - var message = new $root.google.cloud.ces.v1.ServiceDirectoryConfig(); - if (object.service != null) - message.service = String(object.service); - return message; - }; - - /** - * Creates a plain object from a ServiceDirectoryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ServiceDirectoryConfig - * @static - * @param {google.cloud.ces.v1.ServiceDirectoryConfig} message ServiceDirectoryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDirectoryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.service = ""; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - return object; - }; - - /** - * Converts this ServiceDirectoryConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ServiceDirectoryConfig - * @instance - * @returns {Object.} JSON object - */ - ServiceDirectoryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDirectoryConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ServiceDirectoryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDirectoryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ServiceDirectoryConfig"; - }; - - return ServiceDirectoryConfig; - })(); - - v1.ChannelProfile = (function() { - - /** - * Properties of a ChannelProfile. - * @memberof google.cloud.ces.v1 - * @interface IChannelProfile - * @property {string|null} [profileId] ChannelProfile profileId - * @property {google.cloud.ces.v1.ChannelProfile.ChannelType|null} [channelType] ChannelProfile channelType - * @property {google.cloud.ces.v1.ChannelProfile.IPersonaProperty|null} [personaProperty] ChannelProfile personaProperty - * @property {boolean|null} [disableDtmf] ChannelProfile disableDtmf - * @property {boolean|null} [disableBargeInControl] ChannelProfile disableBargeInControl - * @property {google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig|null} [webWidgetConfig] ChannelProfile webWidgetConfig - * @property {string|null} [noiseSuppressionLevel] ChannelProfile noiseSuppressionLevel - */ - - /** - * Constructs a new ChannelProfile. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ChannelProfile. - * @implements IChannelProfile - * @constructor - * @param {google.cloud.ces.v1.IChannelProfile=} [properties] Properties to set - */ - function ChannelProfile(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChannelProfile profileId. - * @member {string} profileId - * @memberof google.cloud.ces.v1.ChannelProfile - * @instance - */ - ChannelProfile.prototype.profileId = ""; - - /** - * ChannelProfile channelType. - * @member {google.cloud.ces.v1.ChannelProfile.ChannelType} channelType - * @memberof google.cloud.ces.v1.ChannelProfile - * @instance - */ - ChannelProfile.prototype.channelType = 0; - - /** - * ChannelProfile personaProperty. - * @member {google.cloud.ces.v1.ChannelProfile.IPersonaProperty|null|undefined} personaProperty - * @memberof google.cloud.ces.v1.ChannelProfile - * @instance - */ - ChannelProfile.prototype.personaProperty = null; - - /** - * ChannelProfile disableDtmf. - * @member {boolean} disableDtmf - * @memberof google.cloud.ces.v1.ChannelProfile - * @instance - */ - ChannelProfile.prototype.disableDtmf = false; - - /** - * ChannelProfile disableBargeInControl. - * @member {boolean} disableBargeInControl - * @memberof google.cloud.ces.v1.ChannelProfile - * @instance - */ - ChannelProfile.prototype.disableBargeInControl = false; - - /** - * ChannelProfile webWidgetConfig. - * @member {google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig|null|undefined} webWidgetConfig - * @memberof google.cloud.ces.v1.ChannelProfile - * @instance - */ - ChannelProfile.prototype.webWidgetConfig = null; - - /** - * ChannelProfile noiseSuppressionLevel. - * @member {string} noiseSuppressionLevel - * @memberof google.cloud.ces.v1.ChannelProfile - * @instance - */ - ChannelProfile.prototype.noiseSuppressionLevel = ""; - - /** - * Creates a new ChannelProfile instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ChannelProfile - * @static - * @param {google.cloud.ces.v1.IChannelProfile=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ChannelProfile} ChannelProfile instance - */ - ChannelProfile.create = function create(properties) { - return new ChannelProfile(properties); - }; - - /** - * Encodes the specified ChannelProfile message. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ChannelProfile - * @static - * @param {google.cloud.ces.v1.IChannelProfile} message ChannelProfile message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChannelProfile.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.profileId != null && Object.hasOwnProperty.call(message, "profileId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.profileId); - if (message.personaProperty != null && Object.hasOwnProperty.call(message, "personaProperty")) - $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty.encode(message.personaProperty, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.channelType != null && Object.hasOwnProperty.call(message, "channelType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.channelType); - if (message.disableDtmf != null && Object.hasOwnProperty.call(message, "disableDtmf")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.disableDtmf); - if (message.disableBargeInControl != null && Object.hasOwnProperty.call(message, "disableBargeInControl")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disableBargeInControl); - if (message.webWidgetConfig != null && Object.hasOwnProperty.call(message, "webWidgetConfig")) - $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.encode(message.webWidgetConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.noiseSuppressionLevel != null && Object.hasOwnProperty.call(message, "noiseSuppressionLevel")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.noiseSuppressionLevel); - return writer; - }; - - /** - * Encodes the specified ChannelProfile message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ChannelProfile - * @static - * @param {google.cloud.ces.v1.IChannelProfile} message ChannelProfile message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChannelProfile.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChannelProfile message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ChannelProfile - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ChannelProfile} ChannelProfile - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChannelProfile.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ChannelProfile(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.profileId = reader.string(); - break; - } - case 3: { - message.channelType = reader.int32(); - break; - } - case 2: { - message.personaProperty = $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty.decode(reader, reader.uint32()); - break; - } - case 4: { - message.disableDtmf = reader.bool(); - break; - } - case 5: { - message.disableBargeInControl = reader.bool(); - break; - } - case 7: { - message.webWidgetConfig = $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.decode(reader, reader.uint32()); - break; - } - case 8: { - message.noiseSuppressionLevel = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChannelProfile message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ChannelProfile - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ChannelProfile} ChannelProfile - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChannelProfile.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChannelProfile message. - * @function verify - * @memberof google.cloud.ces.v1.ChannelProfile - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChannelProfile.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.profileId != null && message.hasOwnProperty("profileId")) - if (!$util.isString(message.profileId)) - return "profileId: string expected"; - if (message.channelType != null && message.hasOwnProperty("channelType")) - switch (message.channelType) { - default: - return "channelType: enum value expected"; - case 0: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.personaProperty != null && message.hasOwnProperty("personaProperty")) { - var error = $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty.verify(message.personaProperty); - if (error) - return "personaProperty." + error; - } - if (message.disableDtmf != null && message.hasOwnProperty("disableDtmf")) - if (typeof message.disableDtmf !== "boolean") - return "disableDtmf: boolean expected"; - if (message.disableBargeInControl != null && message.hasOwnProperty("disableBargeInControl")) - if (typeof message.disableBargeInControl !== "boolean") - return "disableBargeInControl: boolean expected"; - if (message.webWidgetConfig != null && message.hasOwnProperty("webWidgetConfig")) { - var error = $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.verify(message.webWidgetConfig); - if (error) - return "webWidgetConfig." + error; - } - if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) - if (!$util.isString(message.noiseSuppressionLevel)) - return "noiseSuppressionLevel: string expected"; - return null; - }; - - /** - * Creates a ChannelProfile message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ChannelProfile - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ChannelProfile} ChannelProfile - */ - ChannelProfile.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ChannelProfile) - return object; - var message = new $root.google.cloud.ces.v1.ChannelProfile(); - if (object.profileId != null) - message.profileId = String(object.profileId); - switch (object.channelType) { - default: - if (typeof object.channelType === "number") { - message.channelType = object.channelType; - break; - } - break; - case "UNKNOWN": - case 0: - message.channelType = 0; - break; - case "WEB_UI": - case 2: - message.channelType = 2; - break; - case "API": - case 3: - message.channelType = 3; - break; - case "TWILIO": - case 4: - message.channelType = 4; - break; - case "GOOGLE_TELEPHONY_PLATFORM": - case 5: - message.channelType = 5; - break; - case "CONTACT_CENTER_AS_A_SERVICE": - case 6: - message.channelType = 6; - break; - case "FIVE9": - case 7: - message.channelType = 7; - break; - } - if (object.personaProperty != null) { - if (typeof object.personaProperty !== "object") - throw TypeError(".google.cloud.ces.v1.ChannelProfile.personaProperty: object expected"); - message.personaProperty = $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty.fromObject(object.personaProperty); - } - if (object.disableDtmf != null) - message.disableDtmf = Boolean(object.disableDtmf); - if (object.disableBargeInControl != null) - message.disableBargeInControl = Boolean(object.disableBargeInControl); - if (object.webWidgetConfig != null) { - if (typeof object.webWidgetConfig !== "object") - throw TypeError(".google.cloud.ces.v1.ChannelProfile.webWidgetConfig: object expected"); - message.webWidgetConfig = $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.fromObject(object.webWidgetConfig); - } - if (object.noiseSuppressionLevel != null) - message.noiseSuppressionLevel = String(object.noiseSuppressionLevel); - return message; - }; - - /** - * Creates a plain object from a ChannelProfile message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ChannelProfile - * @static - * @param {google.cloud.ces.v1.ChannelProfile} message ChannelProfile - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChannelProfile.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.profileId = ""; - object.personaProperty = null; - object.channelType = options.enums === String ? "UNKNOWN" : 0; - object.disableDtmf = false; - object.disableBargeInControl = false; - object.webWidgetConfig = null; - object.noiseSuppressionLevel = ""; - } - if (message.profileId != null && message.hasOwnProperty("profileId")) - object.profileId = message.profileId; - if (message.personaProperty != null && message.hasOwnProperty("personaProperty")) - object.personaProperty = $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty.toObject(message.personaProperty, options); - if (message.channelType != null && message.hasOwnProperty("channelType")) - object.channelType = options.enums === String ? $root.google.cloud.ces.v1.ChannelProfile.ChannelType[message.channelType] === undefined ? message.channelType : $root.google.cloud.ces.v1.ChannelProfile.ChannelType[message.channelType] : message.channelType; - if (message.disableDtmf != null && message.hasOwnProperty("disableDtmf")) - object.disableDtmf = message.disableDtmf; - if (message.disableBargeInControl != null && message.hasOwnProperty("disableBargeInControl")) - object.disableBargeInControl = message.disableBargeInControl; - if (message.webWidgetConfig != null && message.hasOwnProperty("webWidgetConfig")) - object.webWidgetConfig = $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.toObject(message.webWidgetConfig, options); - if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) - object.noiseSuppressionLevel = message.noiseSuppressionLevel; - return object; - }; - - /** - * Converts this ChannelProfile to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ChannelProfile - * @instance - * @returns {Object.} JSON object - */ - ChannelProfile.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ChannelProfile - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ChannelProfile - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ChannelProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ChannelProfile"; - }; - - ChannelProfile.PersonaProperty = (function() { - - /** - * Properties of a PersonaProperty. - * @memberof google.cloud.ces.v1.ChannelProfile - * @interface IPersonaProperty - * @property {google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona|null} [persona] PersonaProperty persona - */ - - /** - * Constructs a new PersonaProperty. - * @memberof google.cloud.ces.v1.ChannelProfile - * @classdesc Represents a PersonaProperty. - * @implements IPersonaProperty - * @constructor - * @param {google.cloud.ces.v1.ChannelProfile.IPersonaProperty=} [properties] Properties to set - */ - function PersonaProperty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PersonaProperty persona. - * @member {google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona} persona - * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty - * @instance - */ - PersonaProperty.prototype.persona = 0; - - /** - * Creates a new PersonaProperty instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty - * @static - * @param {google.cloud.ces.v1.ChannelProfile.IPersonaProperty=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ChannelProfile.PersonaProperty} PersonaProperty instance - */ - PersonaProperty.create = function create(properties) { - return new PersonaProperty(properties); - }; - - /** - * Encodes the specified PersonaProperty message. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.PersonaProperty.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty - * @static - * @param {google.cloud.ces.v1.ChannelProfile.IPersonaProperty} message PersonaProperty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PersonaProperty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.persona != null && Object.hasOwnProperty.call(message, "persona")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.persona); - return writer; - }; - - /** - * Encodes the specified PersonaProperty message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.PersonaProperty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty - * @static - * @param {google.cloud.ces.v1.ChannelProfile.IPersonaProperty} message PersonaProperty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PersonaProperty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PersonaProperty message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ChannelProfile.PersonaProperty} PersonaProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PersonaProperty.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.persona = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PersonaProperty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ChannelProfile.PersonaProperty} PersonaProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PersonaProperty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PersonaProperty message. - * @function verify - * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PersonaProperty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.persona != null && message.hasOwnProperty("persona")) - switch (message.persona) { - default: - return "persona: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a PersonaProperty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ChannelProfile.PersonaProperty} PersonaProperty - */ - PersonaProperty.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty) - return object; - var message = new $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty(); - switch (object.persona) { - default: - if (typeof object.persona === "number") { - message.persona = object.persona; - break; - } - break; - case "UNKNOWN": - case 0: - message.persona = 0; - break; - case "CONCISE": - case 1: - message.persona = 1; - break; - case "CHATTY": - case 2: - message.persona = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a PersonaProperty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty - * @static - * @param {google.cloud.ces.v1.ChannelProfile.PersonaProperty} message PersonaProperty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PersonaProperty.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.persona = options.enums === String ? "UNKNOWN" : 0; - if (message.persona != null && message.hasOwnProperty("persona")) - object.persona = options.enums === String ? $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona[message.persona] === undefined ? message.persona : $root.google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona[message.persona] : message.persona; - return object; - }; - - /** - * Converts this PersonaProperty to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty - * @instance - * @returns {Object.} JSON object - */ - PersonaProperty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PersonaProperty - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ChannelProfile.PersonaProperty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PersonaProperty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ChannelProfile.PersonaProperty"; - }; - - /** - * Persona enum. - * @name google.cloud.ces.v1.ChannelProfile.PersonaProperty.Persona - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} CONCISE=1 CONCISE value - * @property {number} CHATTY=2 CHATTY value - */ - PersonaProperty.Persona = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "CONCISE"] = 1; - values[valuesById[2] = "CHATTY"] = 2; - return values; - })(); - - return PersonaProperty; - })(); - - ChannelProfile.WebWidgetConfig = (function() { - - /** - * Properties of a WebWidgetConfig. - * @memberof google.cloud.ces.v1.ChannelProfile - * @interface IWebWidgetConfig - * @property {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality|null} [modality] WebWidgetConfig modality - * @property {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme|null} [theme] WebWidgetConfig theme - * @property {string|null} [webWidgetTitle] WebWidgetConfig webWidgetTitle - * @property {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings|null} [securitySettings] WebWidgetConfig securitySettings - */ - - /** - * Constructs a new WebWidgetConfig. - * @memberof google.cloud.ces.v1.ChannelProfile - * @classdesc Represents a WebWidgetConfig. - * @implements IWebWidgetConfig - * @constructor - * @param {google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig=} [properties] Properties to set - */ - function WebWidgetConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WebWidgetConfig modality. - * @member {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality} modality - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig - * @instance - */ - WebWidgetConfig.prototype.modality = 0; - - /** - * WebWidgetConfig theme. - * @member {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme} theme - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig - * @instance - */ - WebWidgetConfig.prototype.theme = 0; - - /** - * WebWidgetConfig webWidgetTitle. - * @member {string} webWidgetTitle - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig - * @instance - */ - WebWidgetConfig.prototype.webWidgetTitle = ""; - - /** - * WebWidgetConfig securitySettings. - * @member {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings|null|undefined} securitySettings - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig - * @instance - */ - WebWidgetConfig.prototype.securitySettings = null; - - /** - * Creates a new WebWidgetConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig - * @static - * @param {google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig} WebWidgetConfig instance - */ - WebWidgetConfig.create = function create(properties) { - return new WebWidgetConfig(properties); - }; - - /** - * Encodes the specified WebWidgetConfig message. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig - * @static - * @param {google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig} message WebWidgetConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebWidgetConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.modality != null && Object.hasOwnProperty.call(message, "modality")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modality); - if (message.theme != null && Object.hasOwnProperty.call(message, "theme")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.theme); - if (message.webWidgetTitle != null && Object.hasOwnProperty.call(message, "webWidgetTitle")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.webWidgetTitle); - if (message.securitySettings != null && Object.hasOwnProperty.call(message, "securitySettings")) - $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.encode(message.securitySettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WebWidgetConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig - * @static - * @param {google.cloud.ces.v1.ChannelProfile.IWebWidgetConfig} message WebWidgetConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebWidgetConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WebWidgetConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig} WebWidgetConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebWidgetConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.modality = reader.int32(); - break; - } - case 2: { - message.theme = reader.int32(); - break; - } - case 3: { - message.webWidgetTitle = reader.string(); - break; - } - case 4: { - message.securitySettings = $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WebWidgetConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig} WebWidgetConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebWidgetConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WebWidgetConfig message. - * @function verify - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WebWidgetConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.modality != null && message.hasOwnProperty("modality")) - switch (message.modality) { - default: - return "modality: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.theme != null && message.hasOwnProperty("theme")) - switch (message.theme) { - default: - return "theme: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.webWidgetTitle != null && message.hasOwnProperty("webWidgetTitle")) - if (!$util.isString(message.webWidgetTitle)) - return "webWidgetTitle: string expected"; - if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) { - var error = $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.verify(message.securitySettings); - if (error) - return "securitySettings." + error; - } - return null; - }; - - /** - * Creates a WebWidgetConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig} WebWidgetConfig - */ - WebWidgetConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig) - return object; - var message = new $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig(); - switch (object.modality) { - default: - if (typeof object.modality === "number") { - message.modality = object.modality; - break; - } - break; - case "MODALITY_UNSPECIFIED": - case 0: - message.modality = 0; - break; - case "CHAT_AND_VOICE": - case 1: - message.modality = 1; - break; - case "VOICE_ONLY": - case 2: - message.modality = 2; - break; - case "CHAT_ONLY": - case 3: - message.modality = 3; - break; - } - switch (object.theme) { - default: - if (typeof object.theme === "number") { - message.theme = object.theme; - break; - } - break; - case "THEME_UNSPECIFIED": - case 0: - message.theme = 0; - break; - case "LIGHT": - case 1: - message.theme = 1; - break; - case "DARK": - case 2: - message.theme = 2; - break; - } - if (object.webWidgetTitle != null) - message.webWidgetTitle = String(object.webWidgetTitle); - if (object.securitySettings != null) { - if (typeof object.securitySettings !== "object") - throw TypeError(".google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.securitySettings: object expected"); - message.securitySettings = $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.fromObject(object.securitySettings); - } - return message; - }; - - /** - * Creates a plain object from a WebWidgetConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig - * @static - * @param {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig} message WebWidgetConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WebWidgetConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.modality = options.enums === String ? "MODALITY_UNSPECIFIED" : 0; - object.theme = options.enums === String ? "THEME_UNSPECIFIED" : 0; - object.webWidgetTitle = ""; - object.securitySettings = null; - } - if (message.modality != null && message.hasOwnProperty("modality")) - object.modality = options.enums === String ? $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality[message.modality] === undefined ? message.modality : $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality[message.modality] : message.modality; - if (message.theme != null && message.hasOwnProperty("theme")) - object.theme = options.enums === String ? $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme[message.theme] === undefined ? message.theme : $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme[message.theme] : message.theme; - if (message.webWidgetTitle != null && message.hasOwnProperty("webWidgetTitle")) - object.webWidgetTitle = message.webWidgetTitle; - if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) - object.securitySettings = $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.toObject(message.securitySettings, options); - return object; - }; - - /** - * Converts this WebWidgetConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig - * @instance - * @returns {Object.} JSON object - */ - WebWidgetConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WebWidgetConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WebWidgetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ChannelProfile.WebWidgetConfig"; - }; - - WebWidgetConfig.SecuritySettings = (function() { - - /** - * Properties of a SecuritySettings. - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig - * @interface ISecuritySettings - * @property {boolean|null} [enablePublicAccess] SecuritySettings enablePublicAccess - * @property {boolean|null} [enableOriginCheck] SecuritySettings enableOriginCheck - * @property {Array.|null} [allowedOrigins] SecuritySettings allowedOrigins - * @property {boolean|null} [enableRecaptcha] SecuritySettings enableRecaptcha - */ - - /** - * Constructs a new SecuritySettings. - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig - * @classdesc Represents a SecuritySettings. - * @implements ISecuritySettings - * @constructor - * @param {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings=} [properties] Properties to set - */ - function SecuritySettings(properties) { - this.allowedOrigins = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SecuritySettings enablePublicAccess. - * @member {boolean} enablePublicAccess - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings - * @instance - */ - SecuritySettings.prototype.enablePublicAccess = false; - - /** - * SecuritySettings enableOriginCheck. - * @member {boolean} enableOriginCheck - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings - * @instance - */ - SecuritySettings.prototype.enableOriginCheck = false; - - /** - * SecuritySettings allowedOrigins. - * @member {Array.} allowedOrigins - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings - * @instance - */ - SecuritySettings.prototype.allowedOrigins = $util.emptyArray; - - /** - * SecuritySettings enableRecaptcha. - * @member {boolean} enableRecaptcha - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings - * @instance - */ - SecuritySettings.prototype.enableRecaptcha = false; - - /** - * Creates a new SecuritySettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings - * @static - * @param {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings instance - */ - SecuritySettings.create = function create(properties) { - return new SecuritySettings(properties); - }; - - /** - * Encodes the specified SecuritySettings message. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings - * @static - * @param {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings} message SecuritySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecuritySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enablePublicAccess != null && Object.hasOwnProperty.call(message, "enablePublicAccess")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePublicAccess); - if (message.allowedOrigins != null && message.allowedOrigins.length) - for (var i = 0; i < message.allowedOrigins.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedOrigins[i]); - if (message.enableRecaptcha != null && Object.hasOwnProperty.call(message, "enableRecaptcha")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableRecaptcha); - if (message.enableOriginCheck != null && Object.hasOwnProperty.call(message, "enableOriginCheck")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableOriginCheck); - return writer; - }; - - /** - * Encodes the specified SecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings - * @static - * @param {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.ISecuritySettings} message SecuritySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecuritySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecuritySettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecuritySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enablePublicAccess = reader.bool(); - break; - } - case 4: { - message.enableOriginCheck = reader.bool(); - break; - } - case 2: { - if (!(message.allowedOrigins && message.allowedOrigins.length)) - message.allowedOrigins = []; - message.allowedOrigins.push(reader.string()); - break; - } - case 3: { - message.enableRecaptcha = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecuritySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecuritySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecuritySettings message. - * @function verify - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecuritySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enablePublicAccess != null && message.hasOwnProperty("enablePublicAccess")) - if (typeof message.enablePublicAccess !== "boolean") - return "enablePublicAccess: boolean expected"; - if (message.enableOriginCheck != null && message.hasOwnProperty("enableOriginCheck")) - if (typeof message.enableOriginCheck !== "boolean") - return "enableOriginCheck: boolean expected"; - if (message.allowedOrigins != null && message.hasOwnProperty("allowedOrigins")) { - if (!Array.isArray(message.allowedOrigins)) - return "allowedOrigins: array expected"; - for (var i = 0; i < message.allowedOrigins.length; ++i) - if (!$util.isString(message.allowedOrigins[i])) - return "allowedOrigins: string[] expected"; - } - if (message.enableRecaptcha != null && message.hasOwnProperty("enableRecaptcha")) - if (typeof message.enableRecaptcha !== "boolean") - return "enableRecaptcha: boolean expected"; - return null; - }; - - /** - * Creates a SecuritySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings - */ - SecuritySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings) - return object; - var message = new $root.google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings(); - if (object.enablePublicAccess != null) - message.enablePublicAccess = Boolean(object.enablePublicAccess); - if (object.enableOriginCheck != null) - message.enableOriginCheck = Boolean(object.enableOriginCheck); - if (object.allowedOrigins) { - if (!Array.isArray(object.allowedOrigins)) - throw TypeError(".google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings.allowedOrigins: array expected"); - message.allowedOrigins = []; - for (var i = 0; i < object.allowedOrigins.length; ++i) - message.allowedOrigins[i] = String(object.allowedOrigins[i]); - } - if (object.enableRecaptcha != null) - message.enableRecaptcha = Boolean(object.enableRecaptcha); - return message; - }; - - /** - * Creates a plain object from a SecuritySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings - * @static - * @param {google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings} message SecuritySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecuritySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedOrigins = []; - if (options.defaults) { - object.enablePublicAccess = false; - object.enableRecaptcha = false; - object.enableOriginCheck = false; - } - if (message.enablePublicAccess != null && message.hasOwnProperty("enablePublicAccess")) - object.enablePublicAccess = message.enablePublicAccess; - if (message.allowedOrigins && message.allowedOrigins.length) { - object.allowedOrigins = []; - for (var j = 0; j < message.allowedOrigins.length; ++j) - object.allowedOrigins[j] = message.allowedOrigins[j]; - } - if (message.enableRecaptcha != null && message.hasOwnProperty("enableRecaptcha")) - object.enableRecaptcha = message.enableRecaptcha; - if (message.enableOriginCheck != null && message.hasOwnProperty("enableOriginCheck")) - object.enableOriginCheck = message.enableOriginCheck; - return object; - }; - - /** - * Converts this SecuritySettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings - * @instance - * @returns {Object.} JSON object - */ - SecuritySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SecuritySettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecuritySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.SecuritySettings"; - }; - - return SecuritySettings; - })(); - - /** - * Modality enum. - * @name google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Modality - * @enum {number} - * @property {number} MODALITY_UNSPECIFIED=0 MODALITY_UNSPECIFIED value - * @property {number} CHAT_AND_VOICE=1 CHAT_AND_VOICE value - * @property {number} VOICE_ONLY=2 VOICE_ONLY value - * @property {number} CHAT_ONLY=3 CHAT_ONLY value - */ - WebWidgetConfig.Modality = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODALITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "CHAT_AND_VOICE"] = 1; - values[valuesById[2] = "VOICE_ONLY"] = 2; - values[valuesById[3] = "CHAT_ONLY"] = 3; - return values; - })(); - - /** - * Theme enum. - * @name google.cloud.ces.v1.ChannelProfile.WebWidgetConfig.Theme - * @enum {number} - * @property {number} THEME_UNSPECIFIED=0 THEME_UNSPECIFIED value - * @property {number} LIGHT=1 LIGHT value - * @property {number} DARK=2 DARK value - */ - WebWidgetConfig.Theme = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "THEME_UNSPECIFIED"] = 0; - values[valuesById[1] = "LIGHT"] = 1; - values[valuesById[2] = "DARK"] = 2; - return values; - })(); - - return WebWidgetConfig; - })(); - - /** - * ChannelType enum. - * @name google.cloud.ces.v1.ChannelProfile.ChannelType - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} WEB_UI=2 WEB_UI value - * @property {number} API=3 API value - * @property {number} TWILIO=4 TWILIO value - * @property {number} GOOGLE_TELEPHONY_PLATFORM=5 GOOGLE_TELEPHONY_PLATFORM value - * @property {number} CONTACT_CENTER_AS_A_SERVICE=6 CONTACT_CENTER_AS_A_SERVICE value - * @property {number} FIVE9=7 FIVE9 value - */ - ChannelProfile.ChannelType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[2] = "WEB_UI"] = 2; - values[valuesById[3] = "API"] = 3; - values[valuesById[4] = "TWILIO"] = 4; - values[valuesById[5] = "GOOGLE_TELEPHONY_PLATFORM"] = 5; - values[valuesById[6] = "CONTACT_CENTER_AS_A_SERVICE"] = 6; - values[valuesById[7] = "FIVE9"] = 7; - return values; - })(); - - return ChannelProfile; - })(); - - v1.Span = (function() { - - /** - * Properties of a Span. - * @memberof google.cloud.ces.v1 - * @interface ISpan - * @property {string|null} [name] Span name - * @property {google.protobuf.ITimestamp|null} [startTime] Span startTime - * @property {google.protobuf.ITimestamp|null} [endTime] Span endTime - * @property {google.protobuf.IDuration|null} [duration] Span duration - * @property {google.protobuf.IStruct|null} [attributes] Span attributes - * @property {Array.|null} [childSpans] Span childSpans - */ - - /** - * Constructs a new Span. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a Span. - * @implements ISpan - * @constructor - * @param {google.cloud.ces.v1.ISpan=} [properties] Properties to set - */ - function Span(properties) { - this.childSpans = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Span name. - * @member {string} name - * @memberof google.cloud.ces.v1.Span - * @instance - */ - Span.prototype.name = ""; - - /** - * Span startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.ces.v1.Span - * @instance - */ - Span.prototype.startTime = null; - - /** - * Span endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.ces.v1.Span - * @instance - */ - Span.prototype.endTime = null; - - /** - * Span duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.cloud.ces.v1.Span - * @instance - */ - Span.prototype.duration = null; - - /** - * Span attributes. - * @member {google.protobuf.IStruct|null|undefined} attributes - * @memberof google.cloud.ces.v1.Span - * @instance - */ - Span.prototype.attributes = null; - - /** - * Span childSpans. - * @member {Array.} childSpans - * @memberof google.cloud.ces.v1.Span - * @instance - */ - Span.prototype.childSpans = $util.emptyArray; - - /** - * Creates a new Span instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Span - * @static - * @param {google.cloud.ces.v1.ISpan=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Span} Span instance - */ - Span.create = function create(properties) { - return new Span(properties); - }; - - /** - * Encodes the specified Span message. Does not implicitly {@link google.cloud.ces.v1.Span.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Span - * @static - * @param {google.cloud.ces.v1.ISpan} message Span message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Span.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - $root.google.protobuf.Struct.encode(message.attributes, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.childSpans != null && message.childSpans.length) - for (var i = 0; i < message.childSpans.length; ++i) - $root.google.cloud.ces.v1.Span.encode(message.childSpans[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Span message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Span.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Span - * @static - * @param {google.cloud.ces.v1.ISpan} message Span message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Span.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Span message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Span - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Span} Span - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Span.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Span(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.attributes = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 5: { - if (!(message.childSpans && message.childSpans.length)) - message.childSpans = []; - message.childSpans.push($root.google.cloud.ces.v1.Span.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Span message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Span - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Span} Span - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Span.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Span message. - * @function verify - * @memberof google.cloud.ces.v1.Span - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Span.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string 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.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.protobuf.Duration.verify(message.duration); - if (error) - return "duration." + error; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - var error = $root.google.protobuf.Struct.verify(message.attributes); - if (error) - return "attributes." + error; - } - if (message.childSpans != null && message.hasOwnProperty("childSpans")) { - if (!Array.isArray(message.childSpans)) - return "childSpans: array expected"; - for (var i = 0; i < message.childSpans.length; ++i) { - var error = $root.google.cloud.ces.v1.Span.verify(message.childSpans[i]); - if (error) - return "childSpans." + error; - } - } - return null; - }; - - /** - * Creates a Span message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Span - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Span} Span - */ - Span.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Span) - return object; - var message = new $root.google.cloud.ces.v1.Span(); - if (object.name != null) - message.name = String(object.name); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.ces.v1.Span.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.ces.v1.Span.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.cloud.ces.v1.Span.duration: object expected"); - message.duration = $root.google.protobuf.Duration.fromObject(object.duration); - } - if (object.attributes != null) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.ces.v1.Span.attributes: object expected"); - message.attributes = $root.google.protobuf.Struct.fromObject(object.attributes); - } - if (object.childSpans) { - if (!Array.isArray(object.childSpans)) - throw TypeError(".google.cloud.ces.v1.Span.childSpans: array expected"); - message.childSpans = []; - for (var i = 0; i < object.childSpans.length; ++i) { - if (typeof object.childSpans[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Span.childSpans: object expected"); - message.childSpans[i] = $root.google.cloud.ces.v1.Span.fromObject(object.childSpans[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Span message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Span - * @static - * @param {google.cloud.ces.v1.Span} message Span - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Span.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.childSpans = []; - if (options.defaults) { - object.name = ""; - object.startTime = null; - object.endTime = null; - object.attributes = null; - object.duration = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - 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.attributes != null && message.hasOwnProperty("attributes")) - object.attributes = $root.google.protobuf.Struct.toObject(message.attributes, options); - if (message.childSpans && message.childSpans.length) { - object.childSpans = []; - for (var j = 0; j < message.childSpans.length; ++j) - object.childSpans[j] = $root.google.cloud.ces.v1.Span.toObject(message.childSpans[j], options); - } - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); - return object; - }; - - /** - * Converts this Span to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Span - * @instance - * @returns {Object.} JSON object - */ - Span.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Span - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Span - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Span.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Span"; - }; - - return Span; - })(); - - v1.AgentService = (function() { - - /** - * Constructs a new AgentService service. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an AgentService - * @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 AgentService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AgentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AgentService; - - /** - * Creates new AgentService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.ces.v1.AgentService - * @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 {AgentService} RPC service. Useful where requests and/or responses are streamed. - */ - AgentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listApps}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef ListAppsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.ListAppsResponse} [response] ListAppsResponse - */ - - /** - * Calls ListApps. - * @function listApps - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListAppsRequest} request ListAppsRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.ListAppsCallback} callback Node-style callback called with the error, if any, and ListAppsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listApps = function listApps(request, callback) { - return this.rpcCall(listApps, $root.google.cloud.ces.v1.ListAppsRequest, $root.google.cloud.ces.v1.ListAppsResponse, request, callback); - }, "name", { value: "ListApps" }); - - /** - * Calls ListApps. - * @function listApps - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListAppsRequest} request ListAppsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getApp}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef GetAppCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.App} [response] App - */ - - /** - * Calls GetApp. - * @function getApp - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetAppRequest} request GetAppRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.GetAppCallback} callback Node-style callback called with the error, if any, and App - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getApp = function getApp(request, callback) { - return this.rpcCall(getApp, $root.google.cloud.ces.v1.GetAppRequest, $root.google.cloud.ces.v1.App, request, callback); - }, "name", { value: "GetApp" }); - - /** - * Calls GetApp. - * @function getApp - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetAppRequest} request GetAppRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|createApp}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef CreateAppCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateApp. - * @function createApp - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.ICreateAppRequest} request CreateAppRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.CreateAppCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.createApp = function createApp(request, callback) { - return this.rpcCall(createApp, $root.google.cloud.ces.v1.CreateAppRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateApp" }); - - /** - * Calls CreateApp. - * @function createApp - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.ICreateAppRequest} request CreateAppRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|updateApp}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef UpdateAppCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.App} [response] App - */ - - /** - * Calls UpdateApp. - * @function updateApp - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IUpdateAppRequest} request UpdateAppRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.UpdateAppCallback} callback Node-style callback called with the error, if any, and App - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.updateApp = function updateApp(request, callback) { - return this.rpcCall(updateApp, $root.google.cloud.ces.v1.UpdateAppRequest, $root.google.cloud.ces.v1.App, request, callback); - }, "name", { value: "UpdateApp" }); - - /** - * Calls UpdateApp. - * @function updateApp - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IUpdateAppRequest} request UpdateAppRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteApp}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef DeleteAppCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteApp. - * @function deleteApp - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IDeleteAppRequest} request DeleteAppRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.DeleteAppCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.deleteApp = function deleteApp(request, callback) { - return this.rpcCall(deleteApp, $root.google.cloud.ces.v1.DeleteAppRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteApp" }); - - /** - * Calls DeleteApp. - * @function deleteApp - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IDeleteAppRequest} request DeleteAppRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|exportApp}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef ExportAppCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ExportApp. - * @function exportApp - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IExportAppRequest} request ExportAppRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.ExportAppCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.exportApp = function exportApp(request, callback) { - return this.rpcCall(exportApp, $root.google.cloud.ces.v1.ExportAppRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ExportApp" }); - - /** - * Calls ExportApp. - * @function exportApp - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IExportAppRequest} request ExportAppRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|importApp}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef ImportAppCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ImportApp. - * @function importApp - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IImportAppRequest} request ImportAppRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.ImportAppCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.importApp = function importApp(request, callback) { - return this.rpcCall(importApp, $root.google.cloud.ces.v1.ImportAppRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportApp" }); - - /** - * Calls ImportApp. - * @function importApp - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IImportAppRequest} request ImportAppRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listAgents}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef ListAgentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.ListAgentsResponse} [response] ListAgentsResponse - */ - - /** - * Calls ListAgents. - * @function listAgents - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListAgentsRequest} request ListAgentsRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.ListAgentsCallback} callback Node-style callback called with the error, if any, and ListAgentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listAgents = function listAgents(request, callback) { - return this.rpcCall(listAgents, $root.google.cloud.ces.v1.ListAgentsRequest, $root.google.cloud.ces.v1.ListAgentsResponse, request, callback); - }, "name", { value: "ListAgents" }); - - /** - * Calls ListAgents. - * @function listAgents - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListAgentsRequest} request ListAgentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getAgent}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef GetAgentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Agent} [response] Agent - */ - - /** - * Calls GetAgent. - * @function getAgent - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetAgentRequest} request GetAgentRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.GetAgentCallback} callback Node-style callback called with the error, if any, and Agent - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getAgent = function getAgent(request, callback) { - return this.rpcCall(getAgent, $root.google.cloud.ces.v1.GetAgentRequest, $root.google.cloud.ces.v1.Agent, request, callback); - }, "name", { value: "GetAgent" }); - - /** - * Calls GetAgent. - * @function getAgent - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetAgentRequest} request GetAgentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|createAgent}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef CreateAgentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Agent} [response] Agent - */ - - /** - * Calls CreateAgent. - * @function createAgent - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.ICreateAgentRequest} request CreateAgentRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.CreateAgentCallback} callback Node-style callback called with the error, if any, and Agent - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.createAgent = function createAgent(request, callback) { - return this.rpcCall(createAgent, $root.google.cloud.ces.v1.CreateAgentRequest, $root.google.cloud.ces.v1.Agent, request, callback); - }, "name", { value: "CreateAgent" }); - - /** - * Calls CreateAgent. - * @function createAgent - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.ICreateAgentRequest} request CreateAgentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|updateAgent}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef UpdateAgentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Agent} [response] Agent - */ - - /** - * Calls UpdateAgent. - * @function updateAgent - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IUpdateAgentRequest} request UpdateAgentRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.UpdateAgentCallback} callback Node-style callback called with the error, if any, and Agent - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.updateAgent = function updateAgent(request, callback) { - return this.rpcCall(updateAgent, $root.google.cloud.ces.v1.UpdateAgentRequest, $root.google.cloud.ces.v1.Agent, request, callback); - }, "name", { value: "UpdateAgent" }); - - /** - * Calls UpdateAgent. - * @function updateAgent - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IUpdateAgentRequest} request UpdateAgentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteAgent}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef DeleteAgentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteAgent. - * @function deleteAgent - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IDeleteAgentRequest} request DeleteAgentRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.DeleteAgentCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.deleteAgent = function deleteAgent(request, callback) { - return this.rpcCall(deleteAgent, $root.google.cloud.ces.v1.DeleteAgentRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteAgent" }); - - /** - * Calls DeleteAgent. - * @function deleteAgent - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IDeleteAgentRequest} request DeleteAgentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listExamples}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef ListExamplesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.ListExamplesResponse} [response] ListExamplesResponse - */ - - /** - * Calls ListExamples. - * @function listExamples - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListExamplesRequest} request ListExamplesRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.ListExamplesCallback} callback Node-style callback called with the error, if any, and ListExamplesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listExamples = function listExamples(request, callback) { - return this.rpcCall(listExamples, $root.google.cloud.ces.v1.ListExamplesRequest, $root.google.cloud.ces.v1.ListExamplesResponse, request, callback); - }, "name", { value: "ListExamples" }); - - /** - * Calls ListExamples. - * @function listExamples - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListExamplesRequest} request ListExamplesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getExample}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef GetExampleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Example} [response] Example - */ - - /** - * Calls GetExample. - * @function getExample - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetExampleRequest} request GetExampleRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.GetExampleCallback} callback Node-style callback called with the error, if any, and Example - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getExample = function getExample(request, callback) { - return this.rpcCall(getExample, $root.google.cloud.ces.v1.GetExampleRequest, $root.google.cloud.ces.v1.Example, request, callback); - }, "name", { value: "GetExample" }); - - /** - * Calls GetExample. - * @function getExample - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetExampleRequest} request GetExampleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|createExample}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef CreateExampleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Example} [response] Example - */ - - /** - * Calls CreateExample. - * @function createExample - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.ICreateExampleRequest} request CreateExampleRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.CreateExampleCallback} callback Node-style callback called with the error, if any, and Example - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.createExample = function createExample(request, callback) { - return this.rpcCall(createExample, $root.google.cloud.ces.v1.CreateExampleRequest, $root.google.cloud.ces.v1.Example, request, callback); - }, "name", { value: "CreateExample" }); - - /** - * Calls CreateExample. - * @function createExample - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.ICreateExampleRequest} request CreateExampleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|updateExample}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef UpdateExampleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Example} [response] Example - */ - - /** - * Calls UpdateExample. - * @function updateExample - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IUpdateExampleRequest} request UpdateExampleRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.UpdateExampleCallback} callback Node-style callback called with the error, if any, and Example - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.updateExample = function updateExample(request, callback) { - return this.rpcCall(updateExample, $root.google.cloud.ces.v1.UpdateExampleRequest, $root.google.cloud.ces.v1.Example, request, callback); - }, "name", { value: "UpdateExample" }); - - /** - * Calls UpdateExample. - * @function updateExample - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IUpdateExampleRequest} request UpdateExampleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteExample}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef DeleteExampleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteExample. - * @function deleteExample - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IDeleteExampleRequest} request DeleteExampleRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.DeleteExampleCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.deleteExample = function deleteExample(request, callback) { - return this.rpcCall(deleteExample, $root.google.cloud.ces.v1.DeleteExampleRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteExample" }); - - /** - * Calls DeleteExample. - * @function deleteExample - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IDeleteExampleRequest} request DeleteExampleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listTools}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef ListToolsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.ListToolsResponse} [response] ListToolsResponse - */ - - /** - * Calls ListTools. - * @function listTools - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListToolsRequest} request ListToolsRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.ListToolsCallback} callback Node-style callback called with the error, if any, and ListToolsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listTools = function listTools(request, callback) { - return this.rpcCall(listTools, $root.google.cloud.ces.v1.ListToolsRequest, $root.google.cloud.ces.v1.ListToolsResponse, request, callback); - }, "name", { value: "ListTools" }); - - /** - * Calls ListTools. - * @function listTools - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListToolsRequest} request ListToolsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getTool}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef GetToolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Tool} [response] Tool - */ - - /** - * Calls GetTool. - * @function getTool - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetToolRequest} request GetToolRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.GetToolCallback} callback Node-style callback called with the error, if any, and Tool - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getTool = function getTool(request, callback) { - return this.rpcCall(getTool, $root.google.cloud.ces.v1.GetToolRequest, $root.google.cloud.ces.v1.Tool, request, callback); - }, "name", { value: "GetTool" }); - - /** - * Calls GetTool. - * @function getTool - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetToolRequest} request GetToolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listConversations}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef ListConversationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.ListConversationsResponse} [response] ListConversationsResponse - */ - - /** - * Calls ListConversations. - * @function listConversations - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListConversationsRequest} request ListConversationsRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.ListConversationsCallback} callback Node-style callback called with the error, if any, and ListConversationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listConversations = function listConversations(request, callback) { - return this.rpcCall(listConversations, $root.google.cloud.ces.v1.ListConversationsRequest, $root.google.cloud.ces.v1.ListConversationsResponse, request, callback); - }, "name", { value: "ListConversations" }); - - /** - * Calls ListConversations. - * @function listConversations - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListConversationsRequest} request ListConversationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getConversation}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef GetConversationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Conversation} [response] Conversation - */ - - /** - * Calls GetConversation. - * @function getConversation - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetConversationRequest} request GetConversationRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.GetConversationCallback} callback Node-style callback called with the error, if any, and Conversation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getConversation = function getConversation(request, callback) { - return this.rpcCall(getConversation, $root.google.cloud.ces.v1.GetConversationRequest, $root.google.cloud.ces.v1.Conversation, request, callback); - }, "name", { value: "GetConversation" }); - - /** - * Calls GetConversation. - * @function getConversation - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetConversationRequest} request GetConversationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteConversation}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef DeleteConversationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteConversation. - * @function deleteConversation - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IDeleteConversationRequest} request DeleteConversationRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.DeleteConversationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.deleteConversation = function deleteConversation(request, callback) { - return this.rpcCall(deleteConversation, $root.google.cloud.ces.v1.DeleteConversationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteConversation" }); - - /** - * Calls DeleteConversation. - * @function deleteConversation - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IDeleteConversationRequest} request DeleteConversationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|batchDeleteConversations}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef BatchDeleteConversationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls BatchDeleteConversations. - * @function batchDeleteConversations - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IBatchDeleteConversationsRequest} request BatchDeleteConversationsRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.BatchDeleteConversationsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.batchDeleteConversations = function batchDeleteConversations(request, callback) { - return this.rpcCall(batchDeleteConversations, $root.google.cloud.ces.v1.BatchDeleteConversationsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchDeleteConversations" }); - - /** - * Calls BatchDeleteConversations. - * @function batchDeleteConversations - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IBatchDeleteConversationsRequest} request BatchDeleteConversationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|createTool}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef CreateToolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Tool} [response] Tool - */ - - /** - * Calls CreateTool. - * @function createTool - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.ICreateToolRequest} request CreateToolRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.CreateToolCallback} callback Node-style callback called with the error, if any, and Tool - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.createTool = function createTool(request, callback) { - return this.rpcCall(createTool, $root.google.cloud.ces.v1.CreateToolRequest, $root.google.cloud.ces.v1.Tool, request, callback); - }, "name", { value: "CreateTool" }); - - /** - * Calls CreateTool. - * @function createTool - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.ICreateToolRequest} request CreateToolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|updateTool}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef UpdateToolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Tool} [response] Tool - */ - - /** - * Calls UpdateTool. - * @function updateTool - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IUpdateToolRequest} request UpdateToolRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.UpdateToolCallback} callback Node-style callback called with the error, if any, and Tool - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.updateTool = function updateTool(request, callback) { - return this.rpcCall(updateTool, $root.google.cloud.ces.v1.UpdateToolRequest, $root.google.cloud.ces.v1.Tool, request, callback); - }, "name", { value: "UpdateTool" }); - - /** - * Calls UpdateTool. - * @function updateTool - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IUpdateToolRequest} request UpdateToolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteTool}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef DeleteToolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteTool. - * @function deleteTool - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IDeleteToolRequest} request DeleteToolRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.DeleteToolCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.deleteTool = function deleteTool(request, callback) { - return this.rpcCall(deleteTool, $root.google.cloud.ces.v1.DeleteToolRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteTool" }); - - /** - * Calls DeleteTool. - * @function deleteTool - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IDeleteToolRequest} request DeleteToolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listGuardrails}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef ListGuardrailsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.ListGuardrailsResponse} [response] ListGuardrailsResponse - */ - - /** - * Calls ListGuardrails. - * @function listGuardrails - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListGuardrailsRequest} request ListGuardrailsRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.ListGuardrailsCallback} callback Node-style callback called with the error, if any, and ListGuardrailsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listGuardrails = function listGuardrails(request, callback) { - return this.rpcCall(listGuardrails, $root.google.cloud.ces.v1.ListGuardrailsRequest, $root.google.cloud.ces.v1.ListGuardrailsResponse, request, callback); - }, "name", { value: "ListGuardrails" }); - - /** - * Calls ListGuardrails. - * @function listGuardrails - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListGuardrailsRequest} request ListGuardrailsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getGuardrail}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef GetGuardrailCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Guardrail} [response] Guardrail - */ - - /** - * Calls GetGuardrail. - * @function getGuardrail - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetGuardrailRequest} request GetGuardrailRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.GetGuardrailCallback} callback Node-style callback called with the error, if any, and Guardrail - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getGuardrail = function getGuardrail(request, callback) { - return this.rpcCall(getGuardrail, $root.google.cloud.ces.v1.GetGuardrailRequest, $root.google.cloud.ces.v1.Guardrail, request, callback); - }, "name", { value: "GetGuardrail" }); - - /** - * Calls GetGuardrail. - * @function getGuardrail - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetGuardrailRequest} request GetGuardrailRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|createGuardrail}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef CreateGuardrailCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Guardrail} [response] Guardrail - */ - - /** - * Calls CreateGuardrail. - * @function createGuardrail - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.ICreateGuardrailRequest} request CreateGuardrailRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.CreateGuardrailCallback} callback Node-style callback called with the error, if any, and Guardrail - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.createGuardrail = function createGuardrail(request, callback) { - return this.rpcCall(createGuardrail, $root.google.cloud.ces.v1.CreateGuardrailRequest, $root.google.cloud.ces.v1.Guardrail, request, callback); - }, "name", { value: "CreateGuardrail" }); - - /** - * Calls CreateGuardrail. - * @function createGuardrail - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.ICreateGuardrailRequest} request CreateGuardrailRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|updateGuardrail}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef UpdateGuardrailCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Guardrail} [response] Guardrail - */ - - /** - * Calls UpdateGuardrail. - * @function updateGuardrail - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IUpdateGuardrailRequest} request UpdateGuardrailRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.UpdateGuardrailCallback} callback Node-style callback called with the error, if any, and Guardrail - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.updateGuardrail = function updateGuardrail(request, callback) { - return this.rpcCall(updateGuardrail, $root.google.cloud.ces.v1.UpdateGuardrailRequest, $root.google.cloud.ces.v1.Guardrail, request, callback); - }, "name", { value: "UpdateGuardrail" }); - - /** - * Calls UpdateGuardrail. - * @function updateGuardrail - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IUpdateGuardrailRequest} request UpdateGuardrailRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteGuardrail}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef DeleteGuardrailCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteGuardrail. - * @function deleteGuardrail - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IDeleteGuardrailRequest} request DeleteGuardrailRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.DeleteGuardrailCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.deleteGuardrail = function deleteGuardrail(request, callback) { - return this.rpcCall(deleteGuardrail, $root.google.cloud.ces.v1.DeleteGuardrailRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteGuardrail" }); - - /** - * Calls DeleteGuardrail. - * @function deleteGuardrail - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IDeleteGuardrailRequest} request DeleteGuardrailRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listDeployments}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef ListDeploymentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.ListDeploymentsResponse} [response] ListDeploymentsResponse - */ - - /** - * Calls ListDeployments. - * @function listDeployments - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.ListDeploymentsCallback} callback Node-style callback called with the error, if any, and ListDeploymentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listDeployments = function listDeployments(request, callback) { - return this.rpcCall(listDeployments, $root.google.cloud.ces.v1.ListDeploymentsRequest, $root.google.cloud.ces.v1.ListDeploymentsResponse, request, callback); - }, "name", { value: "ListDeployments" }); - - /** - * Calls ListDeployments. - * @function listDeployments - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getDeployment}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef GetDeploymentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Deployment} [response] Deployment - */ - - /** - * Calls GetDeployment. - * @function getDeployment - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetDeploymentRequest} request GetDeploymentRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.GetDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getDeployment = function getDeployment(request, callback) { - return this.rpcCall(getDeployment, $root.google.cloud.ces.v1.GetDeploymentRequest, $root.google.cloud.ces.v1.Deployment, request, callback); - }, "name", { value: "GetDeployment" }); - - /** - * Calls GetDeployment. - * @function getDeployment - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetDeploymentRequest} request GetDeploymentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|createDeployment}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef CreateDeploymentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Deployment} [response] Deployment - */ - - /** - * Calls CreateDeployment. - * @function createDeployment - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.ICreateDeploymentRequest} request CreateDeploymentRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.CreateDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.createDeployment = function createDeployment(request, callback) { - return this.rpcCall(createDeployment, $root.google.cloud.ces.v1.CreateDeploymentRequest, $root.google.cloud.ces.v1.Deployment, request, callback); - }, "name", { value: "CreateDeployment" }); - - /** - * Calls CreateDeployment. - * @function createDeployment - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.ICreateDeploymentRequest} request CreateDeploymentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|updateDeployment}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef UpdateDeploymentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Deployment} [response] Deployment - */ - - /** - * Calls UpdateDeployment. - * @function updateDeployment - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IUpdateDeploymentRequest} request UpdateDeploymentRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.UpdateDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.updateDeployment = function updateDeployment(request, callback) { - return this.rpcCall(updateDeployment, $root.google.cloud.ces.v1.UpdateDeploymentRequest, $root.google.cloud.ces.v1.Deployment, request, callback); - }, "name", { value: "UpdateDeployment" }); - - /** - * Calls UpdateDeployment. - * @function updateDeployment - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IUpdateDeploymentRequest} request UpdateDeploymentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteDeployment}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef DeleteDeploymentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteDeployment. - * @function deleteDeployment - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IDeleteDeploymentRequest} request DeleteDeploymentRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.DeleteDeploymentCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.deleteDeployment = function deleteDeployment(request, callback) { - return this.rpcCall(deleteDeployment, $root.google.cloud.ces.v1.DeleteDeploymentRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteDeployment" }); - - /** - * Calls DeleteDeployment. - * @function deleteDeployment - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IDeleteDeploymentRequest} request DeleteDeploymentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listToolsets}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef ListToolsetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.ListToolsetsResponse} [response] ListToolsetsResponse - */ - - /** - * Calls ListToolsets. - * @function listToolsets - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListToolsetsRequest} request ListToolsetsRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.ListToolsetsCallback} callback Node-style callback called with the error, if any, and ListToolsetsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listToolsets = function listToolsets(request, callback) { - return this.rpcCall(listToolsets, $root.google.cloud.ces.v1.ListToolsetsRequest, $root.google.cloud.ces.v1.ListToolsetsResponse, request, callback); - }, "name", { value: "ListToolsets" }); - - /** - * Calls ListToolsets. - * @function listToolsets - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListToolsetsRequest} request ListToolsetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getToolset}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef GetToolsetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Toolset} [response] Toolset - */ - - /** - * Calls GetToolset. - * @function getToolset - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetToolsetRequest} request GetToolsetRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.GetToolsetCallback} callback Node-style callback called with the error, if any, and Toolset - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getToolset = function getToolset(request, callback) { - return this.rpcCall(getToolset, $root.google.cloud.ces.v1.GetToolsetRequest, $root.google.cloud.ces.v1.Toolset, request, callback); - }, "name", { value: "GetToolset" }); - - /** - * Calls GetToolset. - * @function getToolset - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetToolsetRequest} request GetToolsetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|createToolset}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef CreateToolsetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Toolset} [response] Toolset - */ - - /** - * Calls CreateToolset. - * @function createToolset - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.ICreateToolsetRequest} request CreateToolsetRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.CreateToolsetCallback} callback Node-style callback called with the error, if any, and Toolset - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.createToolset = function createToolset(request, callback) { - return this.rpcCall(createToolset, $root.google.cloud.ces.v1.CreateToolsetRequest, $root.google.cloud.ces.v1.Toolset, request, callback); - }, "name", { value: "CreateToolset" }); - - /** - * Calls CreateToolset. - * @function createToolset - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.ICreateToolsetRequest} request CreateToolsetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|updateToolset}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef UpdateToolsetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Toolset} [response] Toolset - */ - - /** - * Calls UpdateToolset. - * @function updateToolset - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IUpdateToolsetRequest} request UpdateToolsetRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.UpdateToolsetCallback} callback Node-style callback called with the error, if any, and Toolset - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.updateToolset = function updateToolset(request, callback) { - return this.rpcCall(updateToolset, $root.google.cloud.ces.v1.UpdateToolsetRequest, $root.google.cloud.ces.v1.Toolset, request, callback); - }, "name", { value: "UpdateToolset" }); - - /** - * Calls UpdateToolset. - * @function updateToolset - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IUpdateToolsetRequest} request UpdateToolsetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteToolset}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef DeleteToolsetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteToolset. - * @function deleteToolset - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IDeleteToolsetRequest} request DeleteToolsetRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.DeleteToolsetCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.deleteToolset = function deleteToolset(request, callback) { - return this.rpcCall(deleteToolset, $root.google.cloud.ces.v1.DeleteToolsetRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteToolset" }); - - /** - * Calls DeleteToolset. - * @function deleteToolset - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IDeleteToolsetRequest} request DeleteToolsetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listAppVersions}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef ListAppVersionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.ListAppVersionsResponse} [response] ListAppVersionsResponse - */ - - /** - * Calls ListAppVersions. - * @function listAppVersions - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListAppVersionsRequest} request ListAppVersionsRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.ListAppVersionsCallback} callback Node-style callback called with the error, if any, and ListAppVersionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listAppVersions = function listAppVersions(request, callback) { - return this.rpcCall(listAppVersions, $root.google.cloud.ces.v1.ListAppVersionsRequest, $root.google.cloud.ces.v1.ListAppVersionsResponse, request, callback); - }, "name", { value: "ListAppVersions" }); - - /** - * Calls ListAppVersions. - * @function listAppVersions - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListAppVersionsRequest} request ListAppVersionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getAppVersion}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef GetAppVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.AppVersion} [response] AppVersion - */ - - /** - * Calls GetAppVersion. - * @function getAppVersion - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetAppVersionRequest} request GetAppVersionRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.GetAppVersionCallback} callback Node-style callback called with the error, if any, and AppVersion - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getAppVersion = function getAppVersion(request, callback) { - return this.rpcCall(getAppVersion, $root.google.cloud.ces.v1.GetAppVersionRequest, $root.google.cloud.ces.v1.AppVersion, request, callback); - }, "name", { value: "GetAppVersion" }); - - /** - * Calls GetAppVersion. - * @function getAppVersion - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetAppVersionRequest} request GetAppVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|createAppVersion}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef CreateAppVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.AppVersion} [response] AppVersion - */ - - /** - * Calls CreateAppVersion. - * @function createAppVersion - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.ICreateAppVersionRequest} request CreateAppVersionRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.CreateAppVersionCallback} callback Node-style callback called with the error, if any, and AppVersion - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.createAppVersion = function createAppVersion(request, callback) { - return this.rpcCall(createAppVersion, $root.google.cloud.ces.v1.CreateAppVersionRequest, $root.google.cloud.ces.v1.AppVersion, request, callback); - }, "name", { value: "CreateAppVersion" }); - - /** - * Calls CreateAppVersion. - * @function createAppVersion - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.ICreateAppVersionRequest} request CreateAppVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|deleteAppVersion}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef DeleteAppVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteAppVersion. - * @function deleteAppVersion - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IDeleteAppVersionRequest} request DeleteAppVersionRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.DeleteAppVersionCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.deleteAppVersion = function deleteAppVersion(request, callback) { - return this.rpcCall(deleteAppVersion, $root.google.cloud.ces.v1.DeleteAppVersionRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteAppVersion" }); - - /** - * Calls DeleteAppVersion. - * @function deleteAppVersion - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IDeleteAppVersionRequest} request DeleteAppVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|restoreAppVersion}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef RestoreAppVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RestoreAppVersion. - * @function restoreAppVersion - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IRestoreAppVersionRequest} request RestoreAppVersionRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.RestoreAppVersionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.restoreAppVersion = function restoreAppVersion(request, callback) { - return this.rpcCall(restoreAppVersion, $root.google.cloud.ces.v1.RestoreAppVersionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestoreAppVersion" }); - - /** - * Calls RestoreAppVersion. - * @function restoreAppVersion - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IRestoreAppVersionRequest} request RestoreAppVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|listChangelogs}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef ListChangelogsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.ListChangelogsResponse} [response] ListChangelogsResponse - */ - - /** - * Calls ListChangelogs. - * @function listChangelogs - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListChangelogsRequest} request ListChangelogsRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.ListChangelogsCallback} callback Node-style callback called with the error, if any, and ListChangelogsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listChangelogs = function listChangelogs(request, callback) { - return this.rpcCall(listChangelogs, $root.google.cloud.ces.v1.ListChangelogsRequest, $root.google.cloud.ces.v1.ListChangelogsResponse, request, callback); - }, "name", { value: "ListChangelogs" }); - - /** - * Calls ListChangelogs. - * @function listChangelogs - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IListChangelogsRequest} request ListChangelogsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.AgentService|getChangelog}. - * @memberof google.cloud.ces.v1.AgentService - * @typedef GetChangelogCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.Changelog} [response] Changelog - */ - - /** - * Calls GetChangelog. - * @function getChangelog - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetChangelogRequest} request GetChangelogRequest message or plain object - * @param {google.cloud.ces.v1.AgentService.GetChangelogCallback} callback Node-style callback called with the error, if any, and Changelog - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getChangelog = function getChangelog(request, callback) { - return this.rpcCall(getChangelog, $root.google.cloud.ces.v1.GetChangelogRequest, $root.google.cloud.ces.v1.Changelog, request, callback); - }, "name", { value: "GetChangelog" }); - - /** - * Calls GetChangelog. - * @function getChangelog - * @memberof google.cloud.ces.v1.AgentService - * @instance - * @param {google.cloud.ces.v1.IGetChangelogRequest} request GetChangelogRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return AgentService; - })(); - - v1.ListAppsRequest = (function() { - - /** - * Properties of a ListAppsRequest. - * @memberof google.cloud.ces.v1 - * @interface IListAppsRequest - * @property {string|null} [parent] ListAppsRequest parent - * @property {number|null} [pageSize] ListAppsRequest pageSize - * @property {string|null} [pageToken] ListAppsRequest pageToken - * @property {string|null} [filter] ListAppsRequest filter - * @property {string|null} [orderBy] ListAppsRequest orderBy - */ - - /** - * Constructs a new ListAppsRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListAppsRequest. - * @implements IListAppsRequest - * @constructor - * @param {google.cloud.ces.v1.IListAppsRequest=} [properties] Properties to set - */ - function ListAppsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAppsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.ListAppsRequest - * @instance - */ - ListAppsRequest.prototype.parent = ""; - - /** - * ListAppsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1.ListAppsRequest - * @instance - */ - ListAppsRequest.prototype.pageSize = 0; - - /** - * ListAppsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1.ListAppsRequest - * @instance - */ - ListAppsRequest.prototype.pageToken = ""; - - /** - * ListAppsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1.ListAppsRequest - * @instance - */ - ListAppsRequest.prototype.filter = ""; - - /** - * ListAppsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1.ListAppsRequest - * @instance - */ - ListAppsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListAppsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListAppsRequest - * @static - * @param {google.cloud.ces.v1.IListAppsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListAppsRequest} ListAppsRequest instance - */ - ListAppsRequest.create = function create(properties) { - return new ListAppsRequest(properties); - }; - - /** - * Encodes the specified ListAppsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListAppsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListAppsRequest - * @static - * @param {google.cloud.ces.v1.IListAppsRequest} message ListAppsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAppsRequest.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 ListAppsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAppsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListAppsRequest - * @static - * @param {google.cloud.ces.v1.IListAppsRequest} message ListAppsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAppsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAppsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListAppsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListAppsRequest} ListAppsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAppsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListAppsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAppsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListAppsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListAppsRequest} ListAppsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAppsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAppsRequest message. - * @function verify - * @memberof google.cloud.ces.v1.ListAppsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAppsRequest.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 ListAppsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListAppsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListAppsRequest} ListAppsRequest - */ - ListAppsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListAppsRequest) - return object; - var message = new $root.google.cloud.ces.v1.ListAppsRequest(); - 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 ListAppsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListAppsRequest - * @static - * @param {google.cloud.ces.v1.ListAppsRequest} message ListAppsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAppsRequest.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 ListAppsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListAppsRequest - * @instance - * @returns {Object.} JSON object - */ - ListAppsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAppsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListAppsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAppsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListAppsRequest"; - }; - - return ListAppsRequest; - })(); - - v1.ListAppsResponse = (function() { - - /** - * Properties of a ListAppsResponse. - * @memberof google.cloud.ces.v1 - * @interface IListAppsResponse - * @property {Array.|null} [apps] ListAppsResponse apps - * @property {string|null} [nextPageToken] ListAppsResponse nextPageToken - * @property {Array.|null} [unreachable] ListAppsResponse unreachable - */ - - /** - * Constructs a new ListAppsResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListAppsResponse. - * @implements IListAppsResponse - * @constructor - * @param {google.cloud.ces.v1.IListAppsResponse=} [properties] Properties to set - */ - function ListAppsResponse(properties) { - this.apps = []; - 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]]; - } - - /** - * ListAppsResponse apps. - * @member {Array.} apps - * @memberof google.cloud.ces.v1.ListAppsResponse - * @instance - */ - ListAppsResponse.prototype.apps = $util.emptyArray; - - /** - * ListAppsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1.ListAppsResponse - * @instance - */ - ListAppsResponse.prototype.nextPageToken = ""; - - /** - * ListAppsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.ces.v1.ListAppsResponse - * @instance - */ - ListAppsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListAppsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListAppsResponse - * @static - * @param {google.cloud.ces.v1.IListAppsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListAppsResponse} ListAppsResponse instance - */ - ListAppsResponse.create = function create(properties) { - return new ListAppsResponse(properties); - }; - - /** - * Encodes the specified ListAppsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListAppsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListAppsResponse - * @static - * @param {google.cloud.ces.v1.IListAppsResponse} message ListAppsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAppsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.apps != null && message.apps.length) - for (var i = 0; i < message.apps.length; ++i) - $root.google.cloud.ces.v1.App.encode(message.apps[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 ListAppsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAppsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListAppsResponse - * @static - * @param {google.cloud.ces.v1.IListAppsResponse} message ListAppsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAppsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAppsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListAppsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListAppsResponse} ListAppsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAppsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListAppsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.apps && message.apps.length)) - message.apps = []; - message.apps.push($root.google.cloud.ces.v1.App.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 ListAppsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListAppsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListAppsResponse} ListAppsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAppsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAppsResponse message. - * @function verify - * @memberof google.cloud.ces.v1.ListAppsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAppsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.apps != null && message.hasOwnProperty("apps")) { - if (!Array.isArray(message.apps)) - return "apps: array expected"; - for (var i = 0; i < message.apps.length; ++i) { - var error = $root.google.cloud.ces.v1.App.verify(message.apps[i]); - if (error) - return "apps." + 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 ListAppsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListAppsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListAppsResponse} ListAppsResponse - */ - ListAppsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListAppsResponse) - return object; - var message = new $root.google.cloud.ces.v1.ListAppsResponse(); - if (object.apps) { - if (!Array.isArray(object.apps)) - throw TypeError(".google.cloud.ces.v1.ListAppsResponse.apps: array expected"); - message.apps = []; - for (var i = 0; i < object.apps.length; ++i) { - if (typeof object.apps[i] !== "object") - throw TypeError(".google.cloud.ces.v1.ListAppsResponse.apps: object expected"); - message.apps[i] = $root.google.cloud.ces.v1.App.fromObject(object.apps[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.ces.v1.ListAppsResponse.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 ListAppsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListAppsResponse - * @static - * @param {google.cloud.ces.v1.ListAppsResponse} message ListAppsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAppsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.apps = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.apps && message.apps.length) { - object.apps = []; - for (var j = 0; j < message.apps.length; ++j) - object.apps[j] = $root.google.cloud.ces.v1.App.toObject(message.apps[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 ListAppsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListAppsResponse - * @instance - * @returns {Object.} JSON object - */ - ListAppsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAppsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListAppsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAppsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListAppsResponse"; - }; - - return ListAppsResponse; - })(); - - v1.GetAppRequest = (function() { - - /** - * Properties of a GetAppRequest. - * @memberof google.cloud.ces.v1 - * @interface IGetAppRequest - * @property {string|null} [name] GetAppRequest name - */ - - /** - * Constructs a new GetAppRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a GetAppRequest. - * @implements IGetAppRequest - * @constructor - * @param {google.cloud.ces.v1.IGetAppRequest=} [properties] Properties to set - */ - function GetAppRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetAppRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.GetAppRequest - * @instance - */ - GetAppRequest.prototype.name = ""; - - /** - * Creates a new GetAppRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.GetAppRequest - * @static - * @param {google.cloud.ces.v1.IGetAppRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.GetAppRequest} GetAppRequest instance - */ - GetAppRequest.create = function create(properties) { - return new GetAppRequest(properties); - }; - - /** - * Encodes the specified GetAppRequest message. Does not implicitly {@link google.cloud.ces.v1.GetAppRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.GetAppRequest - * @static - * @param {google.cloud.ces.v1.IGetAppRequest} message GetAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAppRequest.encode = function encode(message, writer) { - 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 GetAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetAppRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.GetAppRequest - * @static - * @param {google.cloud.ces.v1.IGetAppRequest} message GetAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAppRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetAppRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.GetAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.GetAppRequest} GetAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAppRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetAppRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetAppRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.GetAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.GetAppRequest} GetAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAppRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetAppRequest message. - * @function verify - * @memberof google.cloud.ces.v1.GetAppRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetAppRequest.verify = function verify(message) { - if (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 GetAppRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.GetAppRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.GetAppRequest} GetAppRequest - */ - GetAppRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.GetAppRequest) - return object; - var message = new $root.google.cloud.ces.v1.GetAppRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetAppRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.GetAppRequest - * @static - * @param {google.cloud.ces.v1.GetAppRequest} message GetAppRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetAppRequest.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 GetAppRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.GetAppRequest - * @instance - * @returns {Object.} JSON object - */ - GetAppRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetAppRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.GetAppRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.GetAppRequest"; - }; - - return GetAppRequest; - })(); - - v1.CreateAppRequest = (function() { - - /** - * Properties of a CreateAppRequest. - * @memberof google.cloud.ces.v1 - * @interface ICreateAppRequest - * @property {string|null} [parent] CreateAppRequest parent - * @property {string|null} [appId] CreateAppRequest appId - * @property {google.cloud.ces.v1.IApp|null} [app] CreateAppRequest app - */ - - /** - * Constructs a new CreateAppRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a CreateAppRequest. - * @implements ICreateAppRequest - * @constructor - * @param {google.cloud.ces.v1.ICreateAppRequest=} [properties] Properties to set - */ - function CreateAppRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateAppRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.CreateAppRequest - * @instance - */ - CreateAppRequest.prototype.parent = ""; - - /** - * CreateAppRequest appId. - * @member {string} appId - * @memberof google.cloud.ces.v1.CreateAppRequest - * @instance - */ - CreateAppRequest.prototype.appId = ""; - - /** - * CreateAppRequest app. - * @member {google.cloud.ces.v1.IApp|null|undefined} app - * @memberof google.cloud.ces.v1.CreateAppRequest - * @instance - */ - CreateAppRequest.prototype.app = null; - - /** - * Creates a new CreateAppRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.CreateAppRequest - * @static - * @param {google.cloud.ces.v1.ICreateAppRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.CreateAppRequest} CreateAppRequest instance - */ - CreateAppRequest.create = function create(properties) { - return new CreateAppRequest(properties); - }; - - /** - * Encodes the specified CreateAppRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateAppRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.CreateAppRequest - * @static - * @param {google.cloud.ces.v1.ICreateAppRequest} message CreateAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAppRequest.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.appId != null && Object.hasOwnProperty.call(message, "appId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.appId); - if (message.app != null && Object.hasOwnProperty.call(message, "app")) - $root.google.cloud.ces.v1.App.encode(message.app, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateAppRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.CreateAppRequest - * @static - * @param {google.cloud.ces.v1.ICreateAppRequest} message CreateAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAppRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateAppRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.CreateAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.CreateAppRequest} CreateAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAppRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CreateAppRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.appId = reader.string(); - break; - } - case 3: { - message.app = $root.google.cloud.ces.v1.App.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateAppRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.CreateAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.CreateAppRequest} CreateAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAppRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateAppRequest message. - * @function verify - * @memberof google.cloud.ces.v1.CreateAppRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateAppRequest.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.appId != null && message.hasOwnProperty("appId")) - if (!$util.isString(message.appId)) - return "appId: string expected"; - if (message.app != null && message.hasOwnProperty("app")) { - var error = $root.google.cloud.ces.v1.App.verify(message.app); - if (error) - return "app." + error; - } - return null; - }; - - /** - * Creates a CreateAppRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.CreateAppRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.CreateAppRequest} CreateAppRequest - */ - CreateAppRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.CreateAppRequest) - return object; - var message = new $root.google.cloud.ces.v1.CreateAppRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.appId != null) - message.appId = String(object.appId); - if (object.app != null) { - if (typeof object.app !== "object") - throw TypeError(".google.cloud.ces.v1.CreateAppRequest.app: object expected"); - message.app = $root.google.cloud.ces.v1.App.fromObject(object.app); - } - return message; - }; - - /** - * Creates a plain object from a CreateAppRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.CreateAppRequest - * @static - * @param {google.cloud.ces.v1.CreateAppRequest} message CreateAppRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateAppRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.appId = ""; - object.app = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.appId != null && message.hasOwnProperty("appId")) - object.appId = message.appId; - if (message.app != null && message.hasOwnProperty("app")) - object.app = $root.google.cloud.ces.v1.App.toObject(message.app, options); - return object; - }; - - /** - * Converts this CreateAppRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.CreateAppRequest - * @instance - * @returns {Object.} JSON object - */ - CreateAppRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateAppRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.CreateAppRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.CreateAppRequest"; - }; - - return CreateAppRequest; - })(); - - v1.UpdateAppRequest = (function() { - - /** - * Properties of an UpdateAppRequest. - * @memberof google.cloud.ces.v1 - * @interface IUpdateAppRequest - * @property {google.cloud.ces.v1.IApp|null} [app] UpdateAppRequest app - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAppRequest updateMask - */ - - /** - * Constructs a new UpdateAppRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an UpdateAppRequest. - * @implements IUpdateAppRequest - * @constructor - * @param {google.cloud.ces.v1.IUpdateAppRequest=} [properties] Properties to set - */ - function UpdateAppRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateAppRequest app. - * @member {google.cloud.ces.v1.IApp|null|undefined} app - * @memberof google.cloud.ces.v1.UpdateAppRequest - * @instance - */ - UpdateAppRequest.prototype.app = null; - - /** - * UpdateAppRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.ces.v1.UpdateAppRequest - * @instance - */ - UpdateAppRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateAppRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.UpdateAppRequest - * @static - * @param {google.cloud.ces.v1.IUpdateAppRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.UpdateAppRequest} UpdateAppRequest instance - */ - UpdateAppRequest.create = function create(properties) { - return new UpdateAppRequest(properties); - }; - - /** - * Encodes the specified UpdateAppRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateAppRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.UpdateAppRequest - * @static - * @param {google.cloud.ces.v1.IUpdateAppRequest} message UpdateAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateAppRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.app != null && Object.hasOwnProperty.call(message, "app")) - $root.google.cloud.ces.v1.App.encode(message.app, 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 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateAppRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.UpdateAppRequest - * @static - * @param {google.cloud.ces.v1.IUpdateAppRequest} message UpdateAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateAppRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateAppRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.UpdateAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.UpdateAppRequest} UpdateAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateAppRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.UpdateAppRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.app = $root.google.cloud.ces.v1.App.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateAppRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.UpdateAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.UpdateAppRequest} UpdateAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateAppRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateAppRequest message. - * @function verify - * @memberof google.cloud.ces.v1.UpdateAppRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateAppRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.app != null && message.hasOwnProperty("app")) { - var error = $root.google.cloud.ces.v1.App.verify(message.app); - if (error) - return "app." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateAppRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.UpdateAppRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.UpdateAppRequest} UpdateAppRequest - */ - UpdateAppRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.UpdateAppRequest) - return object; - var message = new $root.google.cloud.ces.v1.UpdateAppRequest(); - if (object.app != null) { - if (typeof object.app !== "object") - throw TypeError(".google.cloud.ces.v1.UpdateAppRequest.app: object expected"); - message.app = $root.google.cloud.ces.v1.App.fromObject(object.app); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.ces.v1.UpdateAppRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateAppRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.UpdateAppRequest - * @static - * @param {google.cloud.ces.v1.UpdateAppRequest} message UpdateAppRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateAppRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.app = null; - object.updateMask = null; - } - if (message.app != null && message.hasOwnProperty("app")) - object.app = $root.google.cloud.ces.v1.App.toObject(message.app, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateAppRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.UpdateAppRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateAppRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateAppRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.UpdateAppRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.UpdateAppRequest"; - }; - - return UpdateAppRequest; - })(); - - v1.DeleteAppRequest = (function() { - - /** - * Properties of a DeleteAppRequest. - * @memberof google.cloud.ces.v1 - * @interface IDeleteAppRequest - * @property {string|null} [name] DeleteAppRequest name - * @property {string|null} [etag] DeleteAppRequest etag - */ - - /** - * Constructs a new DeleteAppRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a DeleteAppRequest. - * @implements IDeleteAppRequest - * @constructor - * @param {google.cloud.ces.v1.IDeleteAppRequest=} [properties] Properties to set - */ - function DeleteAppRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteAppRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.DeleteAppRequest - * @instance - */ - DeleteAppRequest.prototype.name = ""; - - /** - * DeleteAppRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1.DeleteAppRequest - * @instance - */ - DeleteAppRequest.prototype.etag = ""; - - /** - * Creates a new DeleteAppRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DeleteAppRequest - * @static - * @param {google.cloud.ces.v1.IDeleteAppRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DeleteAppRequest} DeleteAppRequest instance - */ - DeleteAppRequest.create = function create(properties) { - return new DeleteAppRequest(properties); - }; - - /** - * Encodes the specified DeleteAppRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteAppRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DeleteAppRequest - * @static - * @param {google.cloud.ces.v1.IDeleteAppRequest} message DeleteAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAppRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteAppRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DeleteAppRequest - * @static - * @param {google.cloud.ces.v1.IDeleteAppRequest} message DeleteAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAppRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteAppRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DeleteAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DeleteAppRequest} DeleteAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAppRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DeleteAppRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteAppRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DeleteAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DeleteAppRequest} DeleteAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAppRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteAppRequest message. - * @function verify - * @memberof google.cloud.ces.v1.DeleteAppRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteAppRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteAppRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DeleteAppRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DeleteAppRequest} DeleteAppRequest - */ - DeleteAppRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DeleteAppRequest) - return object; - var message = new $root.google.cloud.ces.v1.DeleteAppRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteAppRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DeleteAppRequest - * @static - * @param {google.cloud.ces.v1.DeleteAppRequest} message DeleteAppRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteAppRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteAppRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DeleteAppRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteAppRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteAppRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DeleteAppRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DeleteAppRequest"; - }; - - return DeleteAppRequest; - })(); - - v1.ExportAppRequest = (function() { - - /** - * Properties of an ExportAppRequest. - * @memberof google.cloud.ces.v1 - * @interface IExportAppRequest - * @property {string|null} [name] ExportAppRequest name - * @property {google.cloud.ces.v1.ExportAppRequest.ExportFormat|null} [exportFormat] ExportAppRequest exportFormat - * @property {string|null} [gcsUri] ExportAppRequest gcsUri - */ - - /** - * Constructs a new ExportAppRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an ExportAppRequest. - * @implements IExportAppRequest - * @constructor - * @param {google.cloud.ces.v1.IExportAppRequest=} [properties] Properties to set - */ - function ExportAppRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExportAppRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.ExportAppRequest - * @instance - */ - ExportAppRequest.prototype.name = ""; - - /** - * ExportAppRequest exportFormat. - * @member {google.cloud.ces.v1.ExportAppRequest.ExportFormat} exportFormat - * @memberof google.cloud.ces.v1.ExportAppRequest - * @instance - */ - ExportAppRequest.prototype.exportFormat = 0; - - /** - * ExportAppRequest gcsUri. - * @member {string} gcsUri - * @memberof google.cloud.ces.v1.ExportAppRequest - * @instance - */ - ExportAppRequest.prototype.gcsUri = ""; - - /** - * Creates a new ExportAppRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ExportAppRequest - * @static - * @param {google.cloud.ces.v1.IExportAppRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ExportAppRequest} ExportAppRequest instance - */ - ExportAppRequest.create = function create(properties) { - return new ExportAppRequest(properties); - }; - - /** - * Encodes the specified ExportAppRequest message. Does not implicitly {@link google.cloud.ces.v1.ExportAppRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ExportAppRequest - * @static - * @param {google.cloud.ces.v1.IExportAppRequest} message ExportAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportAppRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.exportFormat != null && Object.hasOwnProperty.call(message, "exportFormat")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.exportFormat); - if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsUri); - return writer; - }; - - /** - * Encodes the specified ExportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExportAppRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ExportAppRequest - * @static - * @param {google.cloud.ces.v1.IExportAppRequest} message ExportAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportAppRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportAppRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ExportAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ExportAppRequest} ExportAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportAppRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ExportAppRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.exportFormat = reader.int32(); - break; - } - case 3: { - message.gcsUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExportAppRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ExportAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ExportAppRequest} ExportAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportAppRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExportAppRequest message. - * @function verify - * @memberof google.cloud.ces.v1.ExportAppRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportAppRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.exportFormat != null && message.hasOwnProperty("exportFormat")) - switch (message.exportFormat) { - default: - return "exportFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - if (!$util.isString(message.gcsUri)) - return "gcsUri: string expected"; - return null; - }; - - /** - * Creates an ExportAppRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ExportAppRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ExportAppRequest} ExportAppRequest - */ - ExportAppRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ExportAppRequest) - return object; - var message = new $root.google.cloud.ces.v1.ExportAppRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.exportFormat) { - default: - if (typeof object.exportFormat === "number") { - message.exportFormat = object.exportFormat; - break; - } - break; - case "EXPORT_FORMAT_UNSPECIFIED": - case 0: - message.exportFormat = 0; - break; - case "JSON": - case 1: - message.exportFormat = 1; - break; - case "YAML": - case 2: - message.exportFormat = 2; - break; - } - if (object.gcsUri != null) - message.gcsUri = String(object.gcsUri); - return message; - }; - - /** - * Creates a plain object from an ExportAppRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ExportAppRequest - * @static - * @param {google.cloud.ces.v1.ExportAppRequest} message ExportAppRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportAppRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.exportFormat = options.enums === String ? "EXPORT_FORMAT_UNSPECIFIED" : 0; - object.gcsUri = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.exportFormat != null && message.hasOwnProperty("exportFormat")) - object.exportFormat = options.enums === String ? $root.google.cloud.ces.v1.ExportAppRequest.ExportFormat[message.exportFormat] === undefined ? message.exportFormat : $root.google.cloud.ces.v1.ExportAppRequest.ExportFormat[message.exportFormat] : message.exportFormat; - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - object.gcsUri = message.gcsUri; - return object; - }; - - /** - * Converts this ExportAppRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ExportAppRequest - * @instance - * @returns {Object.} JSON object - */ - ExportAppRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExportAppRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ExportAppRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ExportAppRequest"; - }; - - /** - * ExportFormat enum. - * @name google.cloud.ces.v1.ExportAppRequest.ExportFormat - * @enum {number} - * @property {number} EXPORT_FORMAT_UNSPECIFIED=0 EXPORT_FORMAT_UNSPECIFIED value - * @property {number} JSON=1 JSON value - * @property {number} YAML=2 YAML value - */ - ExportAppRequest.ExportFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EXPORT_FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "JSON"] = 1; - values[valuesById[2] = "YAML"] = 2; - return values; - })(); - - return ExportAppRequest; - })(); - - v1.ExportAppResponse = (function() { - - /** - * Properties of an ExportAppResponse. - * @memberof google.cloud.ces.v1 - * @interface IExportAppResponse - * @property {Uint8Array|null} [appContent] ExportAppResponse appContent - * @property {string|null} [appUri] ExportAppResponse appUri - */ - - /** - * Constructs a new ExportAppResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an ExportAppResponse. - * @implements IExportAppResponse - * @constructor - * @param {google.cloud.ces.v1.IExportAppResponse=} [properties] Properties to set - */ - function ExportAppResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExportAppResponse appContent. - * @member {Uint8Array|null|undefined} appContent - * @memberof google.cloud.ces.v1.ExportAppResponse - * @instance - */ - ExportAppResponse.prototype.appContent = null; - - /** - * ExportAppResponse appUri. - * @member {string|null|undefined} appUri - * @memberof google.cloud.ces.v1.ExportAppResponse - * @instance - */ - ExportAppResponse.prototype.appUri = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ExportAppResponse app. - * @member {"appContent"|"appUri"|undefined} app - * @memberof google.cloud.ces.v1.ExportAppResponse - * @instance - */ - Object.defineProperty(ExportAppResponse.prototype, "app", { - get: $util.oneOfGetter($oneOfFields = ["appContent", "appUri"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExportAppResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ExportAppResponse - * @static - * @param {google.cloud.ces.v1.IExportAppResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ExportAppResponse} ExportAppResponse instance - */ - ExportAppResponse.create = function create(properties) { - return new ExportAppResponse(properties); - }; - - /** - * Encodes the specified ExportAppResponse message. Does not implicitly {@link google.cloud.ces.v1.ExportAppResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ExportAppResponse - * @static - * @param {google.cloud.ces.v1.IExportAppResponse} message ExportAppResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportAppResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.appContent != null && Object.hasOwnProperty.call(message, "appContent")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.appContent); - if (message.appUri != null && Object.hasOwnProperty.call(message, "appUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.appUri); - return writer; - }; - - /** - * Encodes the specified ExportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExportAppResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ExportAppResponse - * @static - * @param {google.cloud.ces.v1.IExportAppResponse} message ExportAppResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportAppResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportAppResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ExportAppResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ExportAppResponse} ExportAppResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportAppResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ExportAppResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.appContent = reader.bytes(); - break; - } - case 2: { - message.appUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExportAppResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ExportAppResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ExportAppResponse} ExportAppResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportAppResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExportAppResponse message. - * @function verify - * @memberof google.cloud.ces.v1.ExportAppResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportAppResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.appContent != null && message.hasOwnProperty("appContent")) { - properties.app = 1; - if (!(message.appContent && typeof message.appContent.length === "number" || $util.isString(message.appContent))) - return "appContent: buffer expected"; - } - if (message.appUri != null && message.hasOwnProperty("appUri")) { - if (properties.app === 1) - return "app: multiple values"; - properties.app = 1; - if (!$util.isString(message.appUri)) - return "appUri: string expected"; - } - return null; - }; - - /** - * Creates an ExportAppResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ExportAppResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ExportAppResponse} ExportAppResponse - */ - ExportAppResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ExportAppResponse) - return object; - var message = new $root.google.cloud.ces.v1.ExportAppResponse(); - if (object.appContent != null) - if (typeof object.appContent === "string") - $util.base64.decode(object.appContent, message.appContent = $util.newBuffer($util.base64.length(object.appContent)), 0); - else if (object.appContent.length >= 0) - message.appContent = object.appContent; - if (object.appUri != null) - message.appUri = String(object.appUri); - return message; - }; - - /** - * Creates a plain object from an ExportAppResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ExportAppResponse - * @static - * @param {google.cloud.ces.v1.ExportAppResponse} message ExportAppResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportAppResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.appContent != null && message.hasOwnProperty("appContent")) { - object.appContent = options.bytes === String ? $util.base64.encode(message.appContent, 0, message.appContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.appContent) : message.appContent; - if (options.oneofs) - object.app = "appContent"; - } - if (message.appUri != null && message.hasOwnProperty("appUri")) { - object.appUri = message.appUri; - if (options.oneofs) - object.app = "appUri"; - } - return object; - }; - - /** - * Converts this ExportAppResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ExportAppResponse - * @instance - * @returns {Object.} JSON object - */ - ExportAppResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExportAppResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ExportAppResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportAppResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ExportAppResponse"; - }; - - return ExportAppResponse; - })(); - - v1.ImportAppRequest = (function() { - - /** - * Properties of an ImportAppRequest. - * @memberof google.cloud.ces.v1 - * @interface IImportAppRequest - * @property {string|null} [gcsUri] ImportAppRequest gcsUri - * @property {Uint8Array|null} [appContent] ImportAppRequest appContent - * @property {string|null} [parent] ImportAppRequest parent - * @property {string|null} [displayName] ImportAppRequest displayName - * @property {string|null} [appId] ImportAppRequest appId - * @property {google.cloud.ces.v1.ImportAppRequest.IImportOptions|null} [importOptions] ImportAppRequest importOptions - * @property {boolean|null} [ignoreAppLock] ImportAppRequest ignoreAppLock - */ - - /** - * Constructs a new ImportAppRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an ImportAppRequest. - * @implements IImportAppRequest - * @constructor - * @param {google.cloud.ces.v1.IImportAppRequest=} [properties] Properties to set - */ - function ImportAppRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportAppRequest gcsUri. - * @member {string|null|undefined} gcsUri - * @memberof google.cloud.ces.v1.ImportAppRequest - * @instance - */ - ImportAppRequest.prototype.gcsUri = null; - - /** - * ImportAppRequest appContent. - * @member {Uint8Array|null|undefined} appContent - * @memberof google.cloud.ces.v1.ImportAppRequest - * @instance - */ - ImportAppRequest.prototype.appContent = null; - - /** - * ImportAppRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.ImportAppRequest - * @instance - */ - ImportAppRequest.prototype.parent = ""; - - /** - * ImportAppRequest displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1.ImportAppRequest - * @instance - */ - ImportAppRequest.prototype.displayName = ""; - - /** - * ImportAppRequest appId. - * @member {string} appId - * @memberof google.cloud.ces.v1.ImportAppRequest - * @instance - */ - ImportAppRequest.prototype.appId = ""; - - /** - * ImportAppRequest importOptions. - * @member {google.cloud.ces.v1.ImportAppRequest.IImportOptions|null|undefined} importOptions - * @memberof google.cloud.ces.v1.ImportAppRequest - * @instance - */ - ImportAppRequest.prototype.importOptions = null; - - /** - * ImportAppRequest ignoreAppLock. - * @member {boolean} ignoreAppLock - * @memberof google.cloud.ces.v1.ImportAppRequest - * @instance - */ - ImportAppRequest.prototype.ignoreAppLock = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ImportAppRequest app. - * @member {"gcsUri"|"appContent"|undefined} app - * @memberof google.cloud.ces.v1.ImportAppRequest - * @instance - */ - Object.defineProperty(ImportAppRequest.prototype, "app", { - get: $util.oneOfGetter($oneOfFields = ["gcsUri", "appContent"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ImportAppRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ImportAppRequest - * @static - * @param {google.cloud.ces.v1.IImportAppRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ImportAppRequest} ImportAppRequest instance - */ - ImportAppRequest.create = function create(properties) { - return new ImportAppRequest(properties); - }; - - /** - * Encodes the specified ImportAppRequest message. Does not implicitly {@link google.cloud.ces.v1.ImportAppRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ImportAppRequest - * @static - * @param {google.cloud.ces.v1.IImportAppRequest} message ImportAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportAppRequest.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.appId != null && Object.hasOwnProperty.call(message, "appId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.appId); - if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.gcsUri); - if (message.appContent != null && Object.hasOwnProperty.call(message, "appContent")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.appContent); - if (message.importOptions != null && Object.hasOwnProperty.call(message, "importOptions")) - $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions.encode(message.importOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.ignoreAppLock != null && Object.hasOwnProperty.call(message, "ignoreAppLock")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.ignoreAppLock); - return writer; - }; - - /** - * Encodes the specified ImportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ImportAppRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ImportAppRequest - * @static - * @param {google.cloud.ces.v1.IImportAppRequest} message ImportAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportAppRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportAppRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ImportAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ImportAppRequest} ImportAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportAppRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ImportAppRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.gcsUri = reader.string(); - break; - } - case 5: { - message.appContent = reader.bytes(); - break; - } - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.appId = reader.string(); - break; - } - case 6: { - message.importOptions = $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions.decode(reader, reader.uint32()); - break; - } - case 7: { - message.ignoreAppLock = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportAppRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ImportAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ImportAppRequest} ImportAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportAppRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportAppRequest message. - * @function verify - * @memberof google.cloud.ces.v1.ImportAppRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportAppRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { - properties.app = 1; - if (!$util.isString(message.gcsUri)) - return "gcsUri: string expected"; - } - if (message.appContent != null && message.hasOwnProperty("appContent")) { - if (properties.app === 1) - return "app: multiple values"; - properties.app = 1; - if (!(message.appContent && typeof message.appContent.length === "number" || $util.isString(message.appContent))) - return "appContent: buffer expected"; - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.appId != null && message.hasOwnProperty("appId")) - if (!$util.isString(message.appId)) - return "appId: string expected"; - if (message.importOptions != null && message.hasOwnProperty("importOptions")) { - var error = $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions.verify(message.importOptions); - if (error) - return "importOptions." + error; - } - if (message.ignoreAppLock != null && message.hasOwnProperty("ignoreAppLock")) - if (typeof message.ignoreAppLock !== "boolean") - return "ignoreAppLock: boolean expected"; - return null; - }; - - /** - * Creates an ImportAppRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ImportAppRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ImportAppRequest} ImportAppRequest - */ - ImportAppRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ImportAppRequest) - return object; - var message = new $root.google.cloud.ces.v1.ImportAppRequest(); - if (object.gcsUri != null) - message.gcsUri = String(object.gcsUri); - if (object.appContent != null) - if (typeof object.appContent === "string") - $util.base64.decode(object.appContent, message.appContent = $util.newBuffer($util.base64.length(object.appContent)), 0); - else if (object.appContent.length >= 0) - message.appContent = object.appContent; - if (object.parent != null) - message.parent = String(object.parent); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.appId != null) - message.appId = String(object.appId); - if (object.importOptions != null) { - if (typeof object.importOptions !== "object") - throw TypeError(".google.cloud.ces.v1.ImportAppRequest.importOptions: object expected"); - message.importOptions = $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions.fromObject(object.importOptions); - } - if (object.ignoreAppLock != null) - message.ignoreAppLock = Boolean(object.ignoreAppLock); - return message; - }; - - /** - * Creates a plain object from an ImportAppRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ImportAppRequest - * @static - * @param {google.cloud.ces.v1.ImportAppRequest} message ImportAppRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportAppRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.displayName = ""; - object.appId = ""; - object.importOptions = null; - object.ignoreAppLock = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.appId != null && message.hasOwnProperty("appId")) - object.appId = message.appId; - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { - object.gcsUri = message.gcsUri; - if (options.oneofs) - object.app = "gcsUri"; - } - if (message.appContent != null && message.hasOwnProperty("appContent")) { - object.appContent = options.bytes === String ? $util.base64.encode(message.appContent, 0, message.appContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.appContent) : message.appContent; - if (options.oneofs) - object.app = "appContent"; - } - if (message.importOptions != null && message.hasOwnProperty("importOptions")) - object.importOptions = $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions.toObject(message.importOptions, options); - if (message.ignoreAppLock != null && message.hasOwnProperty("ignoreAppLock")) - object.ignoreAppLock = message.ignoreAppLock; - return object; - }; - - /** - * Converts this ImportAppRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ImportAppRequest - * @instance - * @returns {Object.} JSON object - */ - ImportAppRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportAppRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ImportAppRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ImportAppRequest"; - }; - - ImportAppRequest.ImportOptions = (function() { - - /** - * Properties of an ImportOptions. - * @memberof google.cloud.ces.v1.ImportAppRequest - * @interface IImportOptions - * @property {google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|null} [conflictResolutionStrategy] ImportOptions conflictResolutionStrategy - */ - - /** - * Constructs a new ImportOptions. - * @memberof google.cloud.ces.v1.ImportAppRequest - * @classdesc Represents an ImportOptions. - * @implements IImportOptions - * @constructor - * @param {google.cloud.ces.v1.ImportAppRequest.IImportOptions=} [properties] Properties to set - */ - function ImportOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportOptions conflictResolutionStrategy. - * @member {google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy} conflictResolutionStrategy - * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions - * @instance - */ - ImportOptions.prototype.conflictResolutionStrategy = 0; - - /** - * Creates a new ImportOptions instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions - * @static - * @param {google.cloud.ces.v1.ImportAppRequest.IImportOptions=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ImportAppRequest.ImportOptions} ImportOptions instance - */ - ImportOptions.create = function create(properties) { - return new ImportOptions(properties); - }; - - /** - * Encodes the specified ImportOptions message. Does not implicitly {@link google.cloud.ces.v1.ImportAppRequest.ImportOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions - * @static - * @param {google.cloud.ces.v1.ImportAppRequest.IImportOptions} message ImportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.conflictResolutionStrategy != null && Object.hasOwnProperty.call(message, "conflictResolutionStrategy")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.conflictResolutionStrategy); - return writer; - }; - - /** - * Encodes the specified ImportOptions message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ImportAppRequest.ImportOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions - * @static - * @param {google.cloud.ces.v1.ImportAppRequest.IImportOptions} message ImportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ImportAppRequest.ImportOptions} ImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.conflictResolutionStrategy = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ImportAppRequest.ImportOptions} ImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportOptions message. - * @function verify - * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.conflictResolutionStrategy != null && message.hasOwnProperty("conflictResolutionStrategy")) - switch (message.conflictResolutionStrategy) { - default: - return "conflictResolutionStrategy: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an ImportOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ImportAppRequest.ImportOptions} ImportOptions - */ - ImportOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions) - return object; - var message = new $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions(); - switch (object.conflictResolutionStrategy) { - default: - if (typeof object.conflictResolutionStrategy === "number") { - message.conflictResolutionStrategy = object.conflictResolutionStrategy; - break; - } - break; - case "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED": - case 0: - message.conflictResolutionStrategy = 0; - break; - case "REPLACE": - case 1: - message.conflictResolutionStrategy = 1; - break; - case "OVERWRITE": - case 2: - message.conflictResolutionStrategy = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an ImportOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions - * @static - * @param {google.cloud.ces.v1.ImportAppRequest.ImportOptions} message ImportOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.conflictResolutionStrategy = options.enums === String ? "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED" : 0; - if (message.conflictResolutionStrategy != null && message.hasOwnProperty("conflictResolutionStrategy")) - object.conflictResolutionStrategy = options.enums === String ? $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy[message.conflictResolutionStrategy] === undefined ? message.conflictResolutionStrategy : $root.google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy[message.conflictResolutionStrategy] : message.conflictResolutionStrategy; - return object; - }; - - /** - * Converts this ImportOptions to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions - * @instance - * @returns {Object.} JSON object - */ - ImportOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportOptions - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ImportAppRequest.ImportOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ImportAppRequest.ImportOptions"; - }; - - /** - * ConflictResolutionStrategy enum. - * @name google.cloud.ces.v1.ImportAppRequest.ImportOptions.ConflictResolutionStrategy - * @enum {number} - * @property {number} CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED=0 CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED value - * @property {number} REPLACE=1 REPLACE value - * @property {number} OVERWRITE=2 OVERWRITE value - */ - ImportOptions.ConflictResolutionStrategy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED"] = 0; - values[valuesById[1] = "REPLACE"] = 1; - values[valuesById[2] = "OVERWRITE"] = 2; - return values; - })(); - - return ImportOptions; - })(); - - return ImportAppRequest; - })(); - - v1.ImportAppResponse = (function() { - - /** - * Properties of an ImportAppResponse. - * @memberof google.cloud.ces.v1 - * @interface IImportAppResponse - * @property {string|null} [name] ImportAppResponse name - * @property {Array.|null} [warnings] ImportAppResponse warnings - */ - - /** - * Constructs a new ImportAppResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an ImportAppResponse. - * @implements IImportAppResponse - * @constructor - * @param {google.cloud.ces.v1.IImportAppResponse=} [properties] Properties to set - */ - function ImportAppResponse(properties) { - this.warnings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportAppResponse name. - * @member {string} name - * @memberof google.cloud.ces.v1.ImportAppResponse - * @instance - */ - ImportAppResponse.prototype.name = ""; - - /** - * ImportAppResponse warnings. - * @member {Array.} warnings - * @memberof google.cloud.ces.v1.ImportAppResponse - * @instance - */ - ImportAppResponse.prototype.warnings = $util.emptyArray; - - /** - * Creates a new ImportAppResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ImportAppResponse - * @static - * @param {google.cloud.ces.v1.IImportAppResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ImportAppResponse} ImportAppResponse instance - */ - ImportAppResponse.create = function create(properties) { - return new ImportAppResponse(properties); - }; - - /** - * Encodes the specified ImportAppResponse message. Does not implicitly {@link google.cloud.ces.v1.ImportAppResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ImportAppResponse - * @static - * @param {google.cloud.ces.v1.IImportAppResponse} message ImportAppResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportAppResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.warnings != null && message.warnings.length) - for (var i = 0; i < message.warnings.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.warnings[i]); - return writer; - }; - - /** - * Encodes the specified ImportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ImportAppResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ImportAppResponse - * @static - * @param {google.cloud.ces.v1.IImportAppResponse} message ImportAppResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportAppResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportAppResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ImportAppResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ImportAppResponse} ImportAppResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportAppResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ImportAppResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.warnings && message.warnings.length)) - message.warnings = []; - message.warnings.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportAppResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ImportAppResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ImportAppResponse} ImportAppResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportAppResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportAppResponse message. - * @function verify - * @memberof google.cloud.ces.v1.ImportAppResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportAppResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.warnings != null && message.hasOwnProperty("warnings")) { - if (!Array.isArray(message.warnings)) - return "warnings: array expected"; - for (var i = 0; i < message.warnings.length; ++i) - if (!$util.isString(message.warnings[i])) - return "warnings: string[] expected"; - } - return null; - }; - - /** - * Creates an ImportAppResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ImportAppResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ImportAppResponse} ImportAppResponse - */ - ImportAppResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ImportAppResponse) - return object; - var message = new $root.google.cloud.ces.v1.ImportAppResponse(); - if (object.name != null) - message.name = String(object.name); - if (object.warnings) { - if (!Array.isArray(object.warnings)) - throw TypeError(".google.cloud.ces.v1.ImportAppResponse.warnings: array expected"); - message.warnings = []; - for (var i = 0; i < object.warnings.length; ++i) - message.warnings[i] = String(object.warnings[i]); - } - return message; - }; - - /** - * Creates a plain object from an ImportAppResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ImportAppResponse - * @static - * @param {google.cloud.ces.v1.ImportAppResponse} message ImportAppResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportAppResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.warnings = []; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.warnings && message.warnings.length) { - object.warnings = []; - for (var j = 0; j < message.warnings.length; ++j) - object.warnings[j] = message.warnings[j]; - } - return object; - }; - - /** - * Converts this ImportAppResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ImportAppResponse - * @instance - * @returns {Object.} JSON object - */ - ImportAppResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportAppResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ImportAppResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportAppResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ImportAppResponse"; - }; - - return ImportAppResponse; - })(); - - v1.ListAgentsRequest = (function() { - - /** - * Properties of a ListAgentsRequest. - * @memberof google.cloud.ces.v1 - * @interface IListAgentsRequest - * @property {string|null} [parent] ListAgentsRequest parent - * @property {number|null} [pageSize] ListAgentsRequest pageSize - * @property {string|null} [pageToken] ListAgentsRequest pageToken - * @property {string|null} [filter] ListAgentsRequest filter - * @property {string|null} [orderBy] ListAgentsRequest orderBy - */ - - /** - * Constructs a new ListAgentsRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListAgentsRequest. - * @implements IListAgentsRequest - * @constructor - * @param {google.cloud.ces.v1.IListAgentsRequest=} [properties] Properties to set - */ - function ListAgentsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAgentsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.ListAgentsRequest - * @instance - */ - ListAgentsRequest.prototype.parent = ""; - - /** - * ListAgentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1.ListAgentsRequest - * @instance - */ - ListAgentsRequest.prototype.pageSize = 0; - - /** - * ListAgentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1.ListAgentsRequest - * @instance - */ - ListAgentsRequest.prototype.pageToken = ""; - - /** - * ListAgentsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1.ListAgentsRequest - * @instance - */ - ListAgentsRequest.prototype.filter = ""; - - /** - * ListAgentsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1.ListAgentsRequest - * @instance - */ - ListAgentsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListAgentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListAgentsRequest - * @static - * @param {google.cloud.ces.v1.IListAgentsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListAgentsRequest} ListAgentsRequest instance - */ - ListAgentsRequest.create = function create(properties) { - return new ListAgentsRequest(properties); - }; - - /** - * Encodes the specified ListAgentsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListAgentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListAgentsRequest - * @static - * @param {google.cloud.ces.v1.IListAgentsRequest} message ListAgentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAgentsRequest.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 ListAgentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAgentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListAgentsRequest - * @static - * @param {google.cloud.ces.v1.IListAgentsRequest} message ListAgentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAgentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAgentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListAgentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListAgentsRequest} ListAgentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAgentsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListAgentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAgentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListAgentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListAgentsRequest} ListAgentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAgentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAgentsRequest message. - * @function verify - * @memberof google.cloud.ces.v1.ListAgentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAgentsRequest.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 ListAgentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListAgentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListAgentsRequest} ListAgentsRequest - */ - ListAgentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListAgentsRequest) - return object; - var message = new $root.google.cloud.ces.v1.ListAgentsRequest(); - 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 ListAgentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListAgentsRequest - * @static - * @param {google.cloud.ces.v1.ListAgentsRequest} message ListAgentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAgentsRequest.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 ListAgentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListAgentsRequest - * @instance - * @returns {Object.} JSON object - */ - ListAgentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAgentsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListAgentsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAgentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListAgentsRequest"; - }; - - return ListAgentsRequest; - })(); - - v1.ListAgentsResponse = (function() { - - /** - * Properties of a ListAgentsResponse. - * @memberof google.cloud.ces.v1 - * @interface IListAgentsResponse - * @property {Array.|null} [agents] ListAgentsResponse agents - * @property {string|null} [nextPageToken] ListAgentsResponse nextPageToken - */ - - /** - * Constructs a new ListAgentsResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListAgentsResponse. - * @implements IListAgentsResponse - * @constructor - * @param {google.cloud.ces.v1.IListAgentsResponse=} [properties] Properties to set - */ - function ListAgentsResponse(properties) { - this.agents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAgentsResponse agents. - * @member {Array.} agents - * @memberof google.cloud.ces.v1.ListAgentsResponse - * @instance - */ - ListAgentsResponse.prototype.agents = $util.emptyArray; - - /** - * ListAgentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1.ListAgentsResponse - * @instance - */ - ListAgentsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListAgentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListAgentsResponse - * @static - * @param {google.cloud.ces.v1.IListAgentsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListAgentsResponse} ListAgentsResponse instance - */ - ListAgentsResponse.create = function create(properties) { - return new ListAgentsResponse(properties); - }; - - /** - * Encodes the specified ListAgentsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListAgentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListAgentsResponse - * @static - * @param {google.cloud.ces.v1.IListAgentsResponse} message ListAgentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAgentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.agents != null && message.agents.length) - for (var i = 0; i < message.agents.length; ++i) - $root.google.cloud.ces.v1.Agent.encode(message.agents[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 ListAgentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAgentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListAgentsResponse - * @static - * @param {google.cloud.ces.v1.IListAgentsResponse} message ListAgentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAgentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAgentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListAgentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListAgentsResponse} ListAgentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAgentsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListAgentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.agents && message.agents.length)) - message.agents = []; - message.agents.push($root.google.cloud.ces.v1.Agent.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAgentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListAgentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListAgentsResponse} ListAgentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAgentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAgentsResponse message. - * @function verify - * @memberof google.cloud.ces.v1.ListAgentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAgentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.agents != null && message.hasOwnProperty("agents")) { - if (!Array.isArray(message.agents)) - return "agents: array expected"; - for (var i = 0; i < message.agents.length; ++i) { - var error = $root.google.cloud.ces.v1.Agent.verify(message.agents[i]); - if (error) - return "agents." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListAgentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListAgentsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListAgentsResponse} ListAgentsResponse - */ - ListAgentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListAgentsResponse) - return object; - var message = new $root.google.cloud.ces.v1.ListAgentsResponse(); - if (object.agents) { - if (!Array.isArray(object.agents)) - throw TypeError(".google.cloud.ces.v1.ListAgentsResponse.agents: array expected"); - message.agents = []; - for (var i = 0; i < object.agents.length; ++i) { - if (typeof object.agents[i] !== "object") - throw TypeError(".google.cloud.ces.v1.ListAgentsResponse.agents: object expected"); - message.agents[i] = $root.google.cloud.ces.v1.Agent.fromObject(object.agents[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListAgentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListAgentsResponse - * @static - * @param {google.cloud.ces.v1.ListAgentsResponse} message ListAgentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAgentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.agents = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.agents && message.agents.length) { - object.agents = []; - for (var j = 0; j < message.agents.length; ++j) - object.agents[j] = $root.google.cloud.ces.v1.Agent.toObject(message.agents[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListAgentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListAgentsResponse - * @instance - * @returns {Object.} JSON object - */ - ListAgentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAgentsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListAgentsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAgentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListAgentsResponse"; - }; - - return ListAgentsResponse; - })(); - - v1.GetAgentRequest = (function() { - - /** - * Properties of a GetAgentRequest. - * @memberof google.cloud.ces.v1 - * @interface IGetAgentRequest - * @property {string|null} [name] GetAgentRequest name - */ - - /** - * Constructs a new GetAgentRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a GetAgentRequest. - * @implements IGetAgentRequest - * @constructor - * @param {google.cloud.ces.v1.IGetAgentRequest=} [properties] Properties to set - */ - function GetAgentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetAgentRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.GetAgentRequest - * @instance - */ - GetAgentRequest.prototype.name = ""; - - /** - * Creates a new GetAgentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.GetAgentRequest - * @static - * @param {google.cloud.ces.v1.IGetAgentRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.GetAgentRequest} GetAgentRequest instance - */ - GetAgentRequest.create = function create(properties) { - return new GetAgentRequest(properties); - }; - - /** - * Encodes the specified GetAgentRequest message. Does not implicitly {@link google.cloud.ces.v1.GetAgentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.GetAgentRequest - * @static - * @param {google.cloud.ces.v1.IGetAgentRequest} message GetAgentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAgentRequest.encode = function encode(message, writer) { - 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 GetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetAgentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.GetAgentRequest - * @static - * @param {google.cloud.ces.v1.IGetAgentRequest} message GetAgentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetAgentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.GetAgentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.GetAgentRequest} GetAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAgentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetAgentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetAgentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.GetAgentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.GetAgentRequest} GetAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAgentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetAgentRequest message. - * @function verify - * @memberof google.cloud.ces.v1.GetAgentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetAgentRequest.verify = function verify(message) { - if (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 GetAgentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.GetAgentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.GetAgentRequest} GetAgentRequest - */ - GetAgentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.GetAgentRequest) - return object; - var message = new $root.google.cloud.ces.v1.GetAgentRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetAgentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.GetAgentRequest - * @static - * @param {google.cloud.ces.v1.GetAgentRequest} message GetAgentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetAgentRequest.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 GetAgentRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.GetAgentRequest - * @instance - * @returns {Object.} JSON object - */ - GetAgentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetAgentRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.GetAgentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.GetAgentRequest"; - }; - - return GetAgentRequest; - })(); - - v1.CreateAgentRequest = (function() { - - /** - * Properties of a CreateAgentRequest. - * @memberof google.cloud.ces.v1 - * @interface ICreateAgentRequest - * @property {string|null} [parent] CreateAgentRequest parent - * @property {string|null} [agentId] CreateAgentRequest agentId - * @property {google.cloud.ces.v1.IAgent|null} [agent] CreateAgentRequest agent - */ - - /** - * Constructs a new CreateAgentRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a CreateAgentRequest. - * @implements ICreateAgentRequest - * @constructor - * @param {google.cloud.ces.v1.ICreateAgentRequest=} [properties] Properties to set - */ - function CreateAgentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateAgentRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.CreateAgentRequest - * @instance - */ - CreateAgentRequest.prototype.parent = ""; - - /** - * CreateAgentRequest agentId. - * @member {string} agentId - * @memberof google.cloud.ces.v1.CreateAgentRequest - * @instance - */ - CreateAgentRequest.prototype.agentId = ""; - - /** - * CreateAgentRequest agent. - * @member {google.cloud.ces.v1.IAgent|null|undefined} agent - * @memberof google.cloud.ces.v1.CreateAgentRequest - * @instance - */ - CreateAgentRequest.prototype.agent = null; - - /** - * Creates a new CreateAgentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.CreateAgentRequest - * @static - * @param {google.cloud.ces.v1.ICreateAgentRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.CreateAgentRequest} CreateAgentRequest instance - */ - CreateAgentRequest.create = function create(properties) { - return new CreateAgentRequest(properties); - }; - - /** - * Encodes the specified CreateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateAgentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.CreateAgentRequest - * @static - * @param {google.cloud.ces.v1.ICreateAgentRequest} message CreateAgentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAgentRequest.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.agentId != null && Object.hasOwnProperty.call(message, "agentId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.agentId); - if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) - $root.google.cloud.ces.v1.Agent.encode(message.agent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateAgentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.CreateAgentRequest - * @static - * @param {google.cloud.ces.v1.ICreateAgentRequest} message CreateAgentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateAgentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.CreateAgentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.CreateAgentRequest} CreateAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAgentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CreateAgentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.agentId = reader.string(); - break; - } - case 3: { - message.agent = $root.google.cloud.ces.v1.Agent.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateAgentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.CreateAgentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.CreateAgentRequest} CreateAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAgentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateAgentRequest message. - * @function verify - * @memberof google.cloud.ces.v1.CreateAgentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateAgentRequest.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.agentId != null && message.hasOwnProperty("agentId")) - if (!$util.isString(message.agentId)) - return "agentId: string expected"; - if (message.agent != null && message.hasOwnProperty("agent")) { - var error = $root.google.cloud.ces.v1.Agent.verify(message.agent); - if (error) - return "agent." + error; - } - return null; - }; - - /** - * Creates a CreateAgentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.CreateAgentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.CreateAgentRequest} CreateAgentRequest - */ - CreateAgentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.CreateAgentRequest) - return object; - var message = new $root.google.cloud.ces.v1.CreateAgentRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.agentId != null) - message.agentId = String(object.agentId); - if (object.agent != null) { - if (typeof object.agent !== "object") - throw TypeError(".google.cloud.ces.v1.CreateAgentRequest.agent: object expected"); - message.agent = $root.google.cloud.ces.v1.Agent.fromObject(object.agent); - } - return message; - }; - - /** - * Creates a plain object from a CreateAgentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.CreateAgentRequest - * @static - * @param {google.cloud.ces.v1.CreateAgentRequest} message CreateAgentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateAgentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.agentId = ""; - object.agent = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.agentId != null && message.hasOwnProperty("agentId")) - object.agentId = message.agentId; - if (message.agent != null && message.hasOwnProperty("agent")) - object.agent = $root.google.cloud.ces.v1.Agent.toObject(message.agent, options); - return object; - }; - - /** - * Converts this CreateAgentRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.CreateAgentRequest - * @instance - * @returns {Object.} JSON object - */ - CreateAgentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateAgentRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.CreateAgentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.CreateAgentRequest"; - }; - - return CreateAgentRequest; - })(); - - v1.UpdateAgentRequest = (function() { - - /** - * Properties of an UpdateAgentRequest. - * @memberof google.cloud.ces.v1 - * @interface IUpdateAgentRequest - * @property {google.cloud.ces.v1.IAgent|null} [agent] UpdateAgentRequest agent - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAgentRequest updateMask - */ - - /** - * Constructs a new UpdateAgentRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an UpdateAgentRequest. - * @implements IUpdateAgentRequest - * @constructor - * @param {google.cloud.ces.v1.IUpdateAgentRequest=} [properties] Properties to set - */ - function UpdateAgentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateAgentRequest agent. - * @member {google.cloud.ces.v1.IAgent|null|undefined} agent - * @memberof google.cloud.ces.v1.UpdateAgentRequest - * @instance - */ - UpdateAgentRequest.prototype.agent = null; - - /** - * UpdateAgentRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.ces.v1.UpdateAgentRequest - * @instance - */ - UpdateAgentRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateAgentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.UpdateAgentRequest - * @static - * @param {google.cloud.ces.v1.IUpdateAgentRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.UpdateAgentRequest} UpdateAgentRequest instance - */ - UpdateAgentRequest.create = function create(properties) { - return new UpdateAgentRequest(properties); - }; - - /** - * Encodes the specified UpdateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateAgentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.UpdateAgentRequest - * @static - * @param {google.cloud.ces.v1.IUpdateAgentRequest} message UpdateAgentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateAgentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) - $root.google.cloud.ces.v1.Agent.encode(message.agent, 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 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateAgentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.UpdateAgentRequest - * @static - * @param {google.cloud.ces.v1.IUpdateAgentRequest} message UpdateAgentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateAgentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.UpdateAgentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.UpdateAgentRequest} UpdateAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateAgentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.UpdateAgentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.agent = $root.google.cloud.ces.v1.Agent.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateAgentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.UpdateAgentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.UpdateAgentRequest} UpdateAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateAgentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateAgentRequest message. - * @function verify - * @memberof google.cloud.ces.v1.UpdateAgentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateAgentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.agent != null && message.hasOwnProperty("agent")) { - var error = $root.google.cloud.ces.v1.Agent.verify(message.agent); - if (error) - return "agent." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateAgentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.UpdateAgentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.UpdateAgentRequest} UpdateAgentRequest - */ - UpdateAgentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.UpdateAgentRequest) - return object; - var message = new $root.google.cloud.ces.v1.UpdateAgentRequest(); - if (object.agent != null) { - if (typeof object.agent !== "object") - throw TypeError(".google.cloud.ces.v1.UpdateAgentRequest.agent: object expected"); - message.agent = $root.google.cloud.ces.v1.Agent.fromObject(object.agent); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.ces.v1.UpdateAgentRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateAgentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.UpdateAgentRequest - * @static - * @param {google.cloud.ces.v1.UpdateAgentRequest} message UpdateAgentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateAgentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.agent = null; - object.updateMask = null; - } - if (message.agent != null && message.hasOwnProperty("agent")) - object.agent = $root.google.cloud.ces.v1.Agent.toObject(message.agent, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateAgentRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.UpdateAgentRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateAgentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateAgentRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.UpdateAgentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.UpdateAgentRequest"; - }; - - return UpdateAgentRequest; - })(); - - v1.DeleteAgentRequest = (function() { - - /** - * Properties of a DeleteAgentRequest. - * @memberof google.cloud.ces.v1 - * @interface IDeleteAgentRequest - * @property {string|null} [name] DeleteAgentRequest name - * @property {boolean|null} [force] DeleteAgentRequest force - * @property {string|null} [etag] DeleteAgentRequest etag - */ - - /** - * Constructs a new DeleteAgentRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a DeleteAgentRequest. - * @implements IDeleteAgentRequest - * @constructor - * @param {google.cloud.ces.v1.IDeleteAgentRequest=} [properties] Properties to set - */ - function DeleteAgentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteAgentRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.DeleteAgentRequest - * @instance - */ - DeleteAgentRequest.prototype.name = ""; - - /** - * DeleteAgentRequest force. - * @member {boolean} force - * @memberof google.cloud.ces.v1.DeleteAgentRequest - * @instance - */ - DeleteAgentRequest.prototype.force = false; - - /** - * DeleteAgentRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1.DeleteAgentRequest - * @instance - */ - DeleteAgentRequest.prototype.etag = ""; - - /** - * Creates a new DeleteAgentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DeleteAgentRequest - * @static - * @param {google.cloud.ces.v1.IDeleteAgentRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DeleteAgentRequest} DeleteAgentRequest instance - */ - DeleteAgentRequest.create = function create(properties) { - return new DeleteAgentRequest(properties); - }; - - /** - * Encodes the specified DeleteAgentRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteAgentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DeleteAgentRequest - * @static - * @param {google.cloud.ces.v1.IDeleteAgentRequest} message DeleteAgentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAgentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteAgentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DeleteAgentRequest - * @static - * @param {google.cloud.ces.v1.IDeleteAgentRequest} message DeleteAgentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteAgentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DeleteAgentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DeleteAgentRequest} DeleteAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAgentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DeleteAgentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.force = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteAgentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DeleteAgentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DeleteAgentRequest} DeleteAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAgentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteAgentRequest message. - * @function verify - * @memberof google.cloud.ces.v1.DeleteAgentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteAgentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteAgentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DeleteAgentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DeleteAgentRequest} DeleteAgentRequest - */ - DeleteAgentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DeleteAgentRequest) - return object; - var message = new $root.google.cloud.ces.v1.DeleteAgentRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.force != null) - message.force = Boolean(object.force); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteAgentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DeleteAgentRequest - * @static - * @param {google.cloud.ces.v1.DeleteAgentRequest} message DeleteAgentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteAgentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.force = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteAgentRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DeleteAgentRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteAgentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteAgentRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DeleteAgentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DeleteAgentRequest"; - }; - - return DeleteAgentRequest; - })(); - - v1.OperationMetadata = (function() { - - /** - * Properties of an OperationMetadata. - * @memberof google.cloud.ces.v1 - * @interface IOperationMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [statusMessage] OperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - */ - - /** - * Constructs a new OperationMetadata. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata - * @constructor - * @param {google.cloud.ces.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 createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.ces.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.endTime = null; - - /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.ces.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.statusMessage = ""; - - /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.ces.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.requestedCancellation = false; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.OperationMetadata - * @static - * @param {google.cloud.ces.v1.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.ces.v1.OperationMetadata} OperationMetadata instance - */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); - }; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.ces.v1.OperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.OperationMetadata - * @static - * @param {google.cloud.ces.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.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.requestedCancellation); - return writer; - }; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.OperationMetadata - * @static - * @param {google.cloud.ces.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.ces.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.ces.v1.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - 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.statusMessage = reader.string(); - break; - } - case 4: { - message.requestedCancellation = reader.bool(); - 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.ces.v1.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.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.ces.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"; - 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.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"; - return null; - }; - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.OperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.OperationMetadata} OperationMetadata - */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.OperationMetadata) - return object; - var message = new $root.google.cloud.ces.v1.OperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.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.ces.v1.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - return message; - }; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.OperationMetadata - * @static - * @param {google.cloud.ces.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.statusMessage = ""; - object.requestedCancellation = false; - } - 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.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - return object; - }; - - /** - * Converts this OperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.ces.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.ces.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.ces.v1.OperationMetadata"; - }; - - return OperationMetadata; - })(); - - v1.ListExamplesRequest = (function() { - - /** - * Properties of a ListExamplesRequest. - * @memberof google.cloud.ces.v1 - * @interface IListExamplesRequest - * @property {string|null} [parent] ListExamplesRequest parent - * @property {number|null} [pageSize] ListExamplesRequest pageSize - * @property {string|null} [pageToken] ListExamplesRequest pageToken - * @property {string|null} [filter] ListExamplesRequest filter - * @property {string|null} [orderBy] ListExamplesRequest orderBy - */ - - /** - * Constructs a new ListExamplesRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListExamplesRequest. - * @implements IListExamplesRequest - * @constructor - * @param {google.cloud.ces.v1.IListExamplesRequest=} [properties] Properties to set - */ - function ListExamplesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListExamplesRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.ListExamplesRequest - * @instance - */ - ListExamplesRequest.prototype.parent = ""; - - /** - * ListExamplesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1.ListExamplesRequest - * @instance - */ - ListExamplesRequest.prototype.pageSize = 0; - - /** - * ListExamplesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1.ListExamplesRequest - * @instance - */ - ListExamplesRequest.prototype.pageToken = ""; - - /** - * ListExamplesRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1.ListExamplesRequest - * @instance - */ - ListExamplesRequest.prototype.filter = ""; - - /** - * ListExamplesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1.ListExamplesRequest - * @instance - */ - ListExamplesRequest.prototype.orderBy = ""; - - /** - * Creates a new ListExamplesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListExamplesRequest - * @static - * @param {google.cloud.ces.v1.IListExamplesRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListExamplesRequest} ListExamplesRequest instance - */ - ListExamplesRequest.create = function create(properties) { - return new ListExamplesRequest(properties); - }; - - /** - * Encodes the specified ListExamplesRequest message. Does not implicitly {@link google.cloud.ces.v1.ListExamplesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListExamplesRequest - * @static - * @param {google.cloud.ces.v1.IListExamplesRequest} message ListExamplesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExamplesRequest.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 ListExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListExamplesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListExamplesRequest - * @static - * @param {google.cloud.ces.v1.IListExamplesRequest} message ListExamplesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExamplesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListExamplesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListExamplesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListExamplesRequest} ListExamplesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExamplesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListExamplesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListExamplesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListExamplesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListExamplesRequest} ListExamplesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExamplesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListExamplesRequest message. - * @function verify - * @memberof google.cloud.ces.v1.ListExamplesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListExamplesRequest.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 ListExamplesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListExamplesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListExamplesRequest} ListExamplesRequest - */ - ListExamplesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListExamplesRequest) - return object; - var message = new $root.google.cloud.ces.v1.ListExamplesRequest(); - 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 ListExamplesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListExamplesRequest - * @static - * @param {google.cloud.ces.v1.ListExamplesRequest} message ListExamplesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListExamplesRequest.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 ListExamplesRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListExamplesRequest - * @instance - * @returns {Object.} JSON object - */ - ListExamplesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListExamplesRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListExamplesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListExamplesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListExamplesRequest"; - }; - - return ListExamplesRequest; - })(); - - v1.ListExamplesResponse = (function() { - - /** - * Properties of a ListExamplesResponse. - * @memberof google.cloud.ces.v1 - * @interface IListExamplesResponse - * @property {Array.|null} [examples] ListExamplesResponse examples - * @property {string|null} [nextPageToken] ListExamplesResponse nextPageToken - */ - - /** - * Constructs a new ListExamplesResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListExamplesResponse. - * @implements IListExamplesResponse - * @constructor - * @param {google.cloud.ces.v1.IListExamplesResponse=} [properties] Properties to set - */ - function ListExamplesResponse(properties) { - this.examples = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListExamplesResponse examples. - * @member {Array.} examples - * @memberof google.cloud.ces.v1.ListExamplesResponse - * @instance - */ - ListExamplesResponse.prototype.examples = $util.emptyArray; - - /** - * ListExamplesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1.ListExamplesResponse - * @instance - */ - ListExamplesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListExamplesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListExamplesResponse - * @static - * @param {google.cloud.ces.v1.IListExamplesResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListExamplesResponse} ListExamplesResponse instance - */ - ListExamplesResponse.create = function create(properties) { - return new ListExamplesResponse(properties); - }; - - /** - * Encodes the specified ListExamplesResponse message. Does not implicitly {@link google.cloud.ces.v1.ListExamplesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListExamplesResponse - * @static - * @param {google.cloud.ces.v1.IListExamplesResponse} message ListExamplesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExamplesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.examples != null && message.examples.length) - for (var i = 0; i < message.examples.length; ++i) - $root.google.cloud.ces.v1.Example.encode(message.examples[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 ListExamplesResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListExamplesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListExamplesResponse - * @static - * @param {google.cloud.ces.v1.IListExamplesResponse} message ListExamplesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExamplesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListExamplesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListExamplesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListExamplesResponse} ListExamplesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExamplesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListExamplesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.examples && message.examples.length)) - message.examples = []; - message.examples.push($root.google.cloud.ces.v1.Example.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListExamplesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListExamplesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListExamplesResponse} ListExamplesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExamplesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListExamplesResponse message. - * @function verify - * @memberof google.cloud.ces.v1.ListExamplesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListExamplesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.examples != null && message.hasOwnProperty("examples")) { - if (!Array.isArray(message.examples)) - return "examples: array expected"; - for (var i = 0; i < message.examples.length; ++i) { - var error = $root.google.cloud.ces.v1.Example.verify(message.examples[i]); - if (error) - return "examples." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListExamplesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListExamplesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListExamplesResponse} ListExamplesResponse - */ - ListExamplesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListExamplesResponse) - return object; - var message = new $root.google.cloud.ces.v1.ListExamplesResponse(); - if (object.examples) { - if (!Array.isArray(object.examples)) - throw TypeError(".google.cloud.ces.v1.ListExamplesResponse.examples: array expected"); - message.examples = []; - for (var i = 0; i < object.examples.length; ++i) { - if (typeof object.examples[i] !== "object") - throw TypeError(".google.cloud.ces.v1.ListExamplesResponse.examples: object expected"); - message.examples[i] = $root.google.cloud.ces.v1.Example.fromObject(object.examples[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListExamplesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListExamplesResponse - * @static - * @param {google.cloud.ces.v1.ListExamplesResponse} message ListExamplesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListExamplesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.examples = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.examples && message.examples.length) { - object.examples = []; - for (var j = 0; j < message.examples.length; ++j) - object.examples[j] = $root.google.cloud.ces.v1.Example.toObject(message.examples[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListExamplesResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListExamplesResponse - * @instance - * @returns {Object.} JSON object - */ - ListExamplesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListExamplesResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListExamplesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListExamplesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListExamplesResponse"; - }; - - return ListExamplesResponse; - })(); - - v1.GetExampleRequest = (function() { - - /** - * Properties of a GetExampleRequest. - * @memberof google.cloud.ces.v1 - * @interface IGetExampleRequest - * @property {string|null} [name] GetExampleRequest name - */ - - /** - * Constructs a new GetExampleRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a GetExampleRequest. - * @implements IGetExampleRequest - * @constructor - * @param {google.cloud.ces.v1.IGetExampleRequest=} [properties] Properties to set - */ - function GetExampleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetExampleRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.GetExampleRequest - * @instance - */ - GetExampleRequest.prototype.name = ""; - - /** - * Creates a new GetExampleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.GetExampleRequest - * @static - * @param {google.cloud.ces.v1.IGetExampleRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.GetExampleRequest} GetExampleRequest instance - */ - GetExampleRequest.create = function create(properties) { - return new GetExampleRequest(properties); - }; - - /** - * Encodes the specified GetExampleRequest message. Does not implicitly {@link google.cloud.ces.v1.GetExampleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.GetExampleRequest - * @static - * @param {google.cloud.ces.v1.IGetExampleRequest} message GetExampleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetExampleRequest.encode = function encode(message, writer) { - 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 GetExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetExampleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.GetExampleRequest - * @static - * @param {google.cloud.ces.v1.IGetExampleRequest} message GetExampleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetExampleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.GetExampleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.GetExampleRequest} GetExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetExampleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetExampleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetExampleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.GetExampleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.GetExampleRequest} GetExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetExampleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetExampleRequest message. - * @function verify - * @memberof google.cloud.ces.v1.GetExampleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetExampleRequest.verify = function verify(message) { - if (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 GetExampleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.GetExampleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.GetExampleRequest} GetExampleRequest - */ - GetExampleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.GetExampleRequest) - return object; - var message = new $root.google.cloud.ces.v1.GetExampleRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetExampleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.GetExampleRequest - * @static - * @param {google.cloud.ces.v1.GetExampleRequest} message GetExampleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetExampleRequest.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 GetExampleRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.GetExampleRequest - * @instance - * @returns {Object.} JSON object - */ - GetExampleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetExampleRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.GetExampleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.GetExampleRequest"; - }; - - return GetExampleRequest; - })(); - - v1.CreateExampleRequest = (function() { - - /** - * Properties of a CreateExampleRequest. - * @memberof google.cloud.ces.v1 - * @interface ICreateExampleRequest - * @property {string|null} [parent] CreateExampleRequest parent - * @property {string|null} [exampleId] CreateExampleRequest exampleId - * @property {google.cloud.ces.v1.IExample|null} [example] CreateExampleRequest example - */ - - /** - * Constructs a new CreateExampleRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a CreateExampleRequest. - * @implements ICreateExampleRequest - * @constructor - * @param {google.cloud.ces.v1.ICreateExampleRequest=} [properties] Properties to set - */ - function CreateExampleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateExampleRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.CreateExampleRequest - * @instance - */ - CreateExampleRequest.prototype.parent = ""; - - /** - * CreateExampleRequest exampleId. - * @member {string} exampleId - * @memberof google.cloud.ces.v1.CreateExampleRequest - * @instance - */ - CreateExampleRequest.prototype.exampleId = ""; - - /** - * CreateExampleRequest example. - * @member {google.cloud.ces.v1.IExample|null|undefined} example - * @memberof google.cloud.ces.v1.CreateExampleRequest - * @instance - */ - CreateExampleRequest.prototype.example = null; - - /** - * Creates a new CreateExampleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.CreateExampleRequest - * @static - * @param {google.cloud.ces.v1.ICreateExampleRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.CreateExampleRequest} CreateExampleRequest instance - */ - CreateExampleRequest.create = function create(properties) { - return new CreateExampleRequest(properties); - }; - - /** - * Encodes the specified CreateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateExampleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.CreateExampleRequest - * @static - * @param {google.cloud.ces.v1.ICreateExampleRequest} message CreateExampleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateExampleRequest.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.exampleId != null && Object.hasOwnProperty.call(message, "exampleId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.exampleId); - if (message.example != null && Object.hasOwnProperty.call(message, "example")) - $root.google.cloud.ces.v1.Example.encode(message.example, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateExampleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.CreateExampleRequest - * @static - * @param {google.cloud.ces.v1.ICreateExampleRequest} message CreateExampleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateExampleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.CreateExampleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.CreateExampleRequest} CreateExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateExampleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CreateExampleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.exampleId = reader.string(); - break; - } - case 3: { - message.example = $root.google.cloud.ces.v1.Example.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateExampleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.CreateExampleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.CreateExampleRequest} CreateExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateExampleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateExampleRequest message. - * @function verify - * @memberof google.cloud.ces.v1.CreateExampleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateExampleRequest.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.exampleId != null && message.hasOwnProperty("exampleId")) - if (!$util.isString(message.exampleId)) - return "exampleId: string expected"; - if (message.example != null && message.hasOwnProperty("example")) { - var error = $root.google.cloud.ces.v1.Example.verify(message.example); - if (error) - return "example." + error; - } - return null; - }; - - /** - * Creates a CreateExampleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.CreateExampleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.CreateExampleRequest} CreateExampleRequest - */ - CreateExampleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.CreateExampleRequest) - return object; - var message = new $root.google.cloud.ces.v1.CreateExampleRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.exampleId != null) - message.exampleId = String(object.exampleId); - if (object.example != null) { - if (typeof object.example !== "object") - throw TypeError(".google.cloud.ces.v1.CreateExampleRequest.example: object expected"); - message.example = $root.google.cloud.ces.v1.Example.fromObject(object.example); - } - return message; - }; - - /** - * Creates a plain object from a CreateExampleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.CreateExampleRequest - * @static - * @param {google.cloud.ces.v1.CreateExampleRequest} message CreateExampleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateExampleRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.exampleId = ""; - object.example = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.exampleId != null && message.hasOwnProperty("exampleId")) - object.exampleId = message.exampleId; - if (message.example != null && message.hasOwnProperty("example")) - object.example = $root.google.cloud.ces.v1.Example.toObject(message.example, options); - return object; - }; - - /** - * Converts this CreateExampleRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.CreateExampleRequest - * @instance - * @returns {Object.} JSON object - */ - CreateExampleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateExampleRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.CreateExampleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.CreateExampleRequest"; - }; - - return CreateExampleRequest; - })(); - - v1.UpdateExampleRequest = (function() { - - /** - * Properties of an UpdateExampleRequest. - * @memberof google.cloud.ces.v1 - * @interface IUpdateExampleRequest - * @property {google.cloud.ces.v1.IExample|null} [example] UpdateExampleRequest example - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateExampleRequest updateMask - */ - - /** - * Constructs a new UpdateExampleRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an UpdateExampleRequest. - * @implements IUpdateExampleRequest - * @constructor - * @param {google.cloud.ces.v1.IUpdateExampleRequest=} [properties] Properties to set - */ - function UpdateExampleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateExampleRequest example. - * @member {google.cloud.ces.v1.IExample|null|undefined} example - * @memberof google.cloud.ces.v1.UpdateExampleRequest - * @instance - */ - UpdateExampleRequest.prototype.example = null; - - /** - * UpdateExampleRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.ces.v1.UpdateExampleRequest - * @instance - */ - UpdateExampleRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateExampleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.UpdateExampleRequest - * @static - * @param {google.cloud.ces.v1.IUpdateExampleRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.UpdateExampleRequest} UpdateExampleRequest instance - */ - UpdateExampleRequest.create = function create(properties) { - return new UpdateExampleRequest(properties); - }; - - /** - * Encodes the specified UpdateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateExampleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.UpdateExampleRequest - * @static - * @param {google.cloud.ces.v1.IUpdateExampleRequest} message UpdateExampleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateExampleRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.example != null && Object.hasOwnProperty.call(message, "example")) - $root.google.cloud.ces.v1.Example.encode(message.example, 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 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateExampleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.UpdateExampleRequest - * @static - * @param {google.cloud.ces.v1.IUpdateExampleRequest} message UpdateExampleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateExampleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.UpdateExampleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.UpdateExampleRequest} UpdateExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateExampleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.UpdateExampleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.example = $root.google.cloud.ces.v1.Example.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateExampleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.UpdateExampleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.UpdateExampleRequest} UpdateExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateExampleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateExampleRequest message. - * @function verify - * @memberof google.cloud.ces.v1.UpdateExampleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateExampleRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.example != null && message.hasOwnProperty("example")) { - var error = $root.google.cloud.ces.v1.Example.verify(message.example); - if (error) - return "example." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateExampleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.UpdateExampleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.UpdateExampleRequest} UpdateExampleRequest - */ - UpdateExampleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.UpdateExampleRequest) - return object; - var message = new $root.google.cloud.ces.v1.UpdateExampleRequest(); - if (object.example != null) { - if (typeof object.example !== "object") - throw TypeError(".google.cloud.ces.v1.UpdateExampleRequest.example: object expected"); - message.example = $root.google.cloud.ces.v1.Example.fromObject(object.example); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.ces.v1.UpdateExampleRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateExampleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.UpdateExampleRequest - * @static - * @param {google.cloud.ces.v1.UpdateExampleRequest} message UpdateExampleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateExampleRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.example = null; - object.updateMask = null; - } - if (message.example != null && message.hasOwnProperty("example")) - object.example = $root.google.cloud.ces.v1.Example.toObject(message.example, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateExampleRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.UpdateExampleRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateExampleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateExampleRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.UpdateExampleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.UpdateExampleRequest"; - }; - - return UpdateExampleRequest; - })(); - - v1.DeleteExampleRequest = (function() { - - /** - * Properties of a DeleteExampleRequest. - * @memberof google.cloud.ces.v1 - * @interface IDeleteExampleRequest - * @property {string|null} [name] DeleteExampleRequest name - * @property {string|null} [etag] DeleteExampleRequest etag - */ - - /** - * Constructs a new DeleteExampleRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a DeleteExampleRequest. - * @implements IDeleteExampleRequest - * @constructor - * @param {google.cloud.ces.v1.IDeleteExampleRequest=} [properties] Properties to set - */ - function DeleteExampleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteExampleRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.DeleteExampleRequest - * @instance - */ - DeleteExampleRequest.prototype.name = ""; - - /** - * DeleteExampleRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1.DeleteExampleRequest - * @instance - */ - DeleteExampleRequest.prototype.etag = ""; - - /** - * Creates a new DeleteExampleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DeleteExampleRequest - * @static - * @param {google.cloud.ces.v1.IDeleteExampleRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DeleteExampleRequest} DeleteExampleRequest instance - */ - DeleteExampleRequest.create = function create(properties) { - return new DeleteExampleRequest(properties); - }; - - /** - * Encodes the specified DeleteExampleRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteExampleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DeleteExampleRequest - * @static - * @param {google.cloud.ces.v1.IDeleteExampleRequest} message DeleteExampleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteExampleRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteExampleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DeleteExampleRequest - * @static - * @param {google.cloud.ces.v1.IDeleteExampleRequest} message DeleteExampleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteExampleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DeleteExampleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DeleteExampleRequest} DeleteExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteExampleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DeleteExampleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteExampleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DeleteExampleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DeleteExampleRequest} DeleteExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteExampleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteExampleRequest message. - * @function verify - * @memberof google.cloud.ces.v1.DeleteExampleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteExampleRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteExampleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DeleteExampleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DeleteExampleRequest} DeleteExampleRequest - */ - DeleteExampleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DeleteExampleRequest) - return object; - var message = new $root.google.cloud.ces.v1.DeleteExampleRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteExampleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DeleteExampleRequest - * @static - * @param {google.cloud.ces.v1.DeleteExampleRequest} message DeleteExampleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteExampleRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteExampleRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DeleteExampleRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteExampleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteExampleRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DeleteExampleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DeleteExampleRequest"; - }; - - return DeleteExampleRequest; - })(); - - v1.ListToolsRequest = (function() { - - /** - * Properties of a ListToolsRequest. - * @memberof google.cloud.ces.v1 - * @interface IListToolsRequest - * @property {string|null} [parent] ListToolsRequest parent - * @property {number|null} [pageSize] ListToolsRequest pageSize - * @property {string|null} [pageToken] ListToolsRequest pageToken - * @property {string|null} [filter] ListToolsRequest filter - * @property {string|null} [orderBy] ListToolsRequest orderBy - */ - - /** - * Constructs a new ListToolsRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListToolsRequest. - * @implements IListToolsRequest - * @constructor - * @param {google.cloud.ces.v1.IListToolsRequest=} [properties] Properties to set - */ - function ListToolsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListToolsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.ListToolsRequest - * @instance - */ - ListToolsRequest.prototype.parent = ""; - - /** - * ListToolsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1.ListToolsRequest - * @instance - */ - ListToolsRequest.prototype.pageSize = 0; - - /** - * ListToolsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1.ListToolsRequest - * @instance - */ - ListToolsRequest.prototype.pageToken = ""; - - /** - * ListToolsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1.ListToolsRequest - * @instance - */ - ListToolsRequest.prototype.filter = ""; - - /** - * ListToolsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1.ListToolsRequest - * @instance - */ - ListToolsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListToolsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListToolsRequest - * @static - * @param {google.cloud.ces.v1.IListToolsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListToolsRequest} ListToolsRequest instance - */ - ListToolsRequest.create = function create(properties) { - return new ListToolsRequest(properties); - }; - - /** - * Encodes the specified ListToolsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListToolsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListToolsRequest - * @static - * @param {google.cloud.ces.v1.IListToolsRequest} message ListToolsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListToolsRequest.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 ListToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListToolsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListToolsRequest - * @static - * @param {google.cloud.ces.v1.IListToolsRequest} message ListToolsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListToolsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListToolsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListToolsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListToolsRequest} ListToolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListToolsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListToolsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListToolsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListToolsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListToolsRequest} ListToolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListToolsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListToolsRequest message. - * @function verify - * @memberof google.cloud.ces.v1.ListToolsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListToolsRequest.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 ListToolsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListToolsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListToolsRequest} ListToolsRequest - */ - ListToolsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListToolsRequest) - return object; - var message = new $root.google.cloud.ces.v1.ListToolsRequest(); - 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 ListToolsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListToolsRequest - * @static - * @param {google.cloud.ces.v1.ListToolsRequest} message ListToolsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListToolsRequest.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 ListToolsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListToolsRequest - * @instance - * @returns {Object.} JSON object - */ - ListToolsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListToolsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListToolsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListToolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListToolsRequest"; - }; - - return ListToolsRequest; - })(); - - v1.ListToolsResponse = (function() { - - /** - * Properties of a ListToolsResponse. - * @memberof google.cloud.ces.v1 - * @interface IListToolsResponse - * @property {Array.|null} [tools] ListToolsResponse tools - * @property {string|null} [nextPageToken] ListToolsResponse nextPageToken - */ - - /** - * Constructs a new ListToolsResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListToolsResponse. - * @implements IListToolsResponse - * @constructor - * @param {google.cloud.ces.v1.IListToolsResponse=} [properties] Properties to set - */ - function ListToolsResponse(properties) { - this.tools = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListToolsResponse tools. - * @member {Array.} tools - * @memberof google.cloud.ces.v1.ListToolsResponse - * @instance - */ - ListToolsResponse.prototype.tools = $util.emptyArray; - - /** - * ListToolsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1.ListToolsResponse - * @instance - */ - ListToolsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListToolsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListToolsResponse - * @static - * @param {google.cloud.ces.v1.IListToolsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListToolsResponse} ListToolsResponse instance - */ - ListToolsResponse.create = function create(properties) { - return new ListToolsResponse(properties); - }; - - /** - * Encodes the specified ListToolsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListToolsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListToolsResponse - * @static - * @param {google.cloud.ces.v1.IListToolsResponse} message ListToolsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListToolsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tools != null && message.tools.length) - for (var i = 0; i < message.tools.length; ++i) - $root.google.cloud.ces.v1.Tool.encode(message.tools[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 ListToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListToolsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListToolsResponse - * @static - * @param {google.cloud.ces.v1.IListToolsResponse} message ListToolsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListToolsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListToolsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListToolsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListToolsResponse} ListToolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListToolsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListToolsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.tools && message.tools.length)) - message.tools = []; - message.tools.push($root.google.cloud.ces.v1.Tool.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListToolsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListToolsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListToolsResponse} ListToolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListToolsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListToolsResponse message. - * @function verify - * @memberof google.cloud.ces.v1.ListToolsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListToolsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tools != null && message.hasOwnProperty("tools")) { - if (!Array.isArray(message.tools)) - return "tools: array expected"; - for (var i = 0; i < message.tools.length; ++i) { - var error = $root.google.cloud.ces.v1.Tool.verify(message.tools[i]); - if (error) - return "tools." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListToolsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListToolsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListToolsResponse} ListToolsResponse - */ - ListToolsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListToolsResponse) - return object; - var message = new $root.google.cloud.ces.v1.ListToolsResponse(); - if (object.tools) { - if (!Array.isArray(object.tools)) - throw TypeError(".google.cloud.ces.v1.ListToolsResponse.tools: array expected"); - message.tools = []; - for (var i = 0; i < object.tools.length; ++i) { - if (typeof object.tools[i] !== "object") - throw TypeError(".google.cloud.ces.v1.ListToolsResponse.tools: object expected"); - message.tools[i] = $root.google.cloud.ces.v1.Tool.fromObject(object.tools[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListToolsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListToolsResponse - * @static - * @param {google.cloud.ces.v1.ListToolsResponse} message ListToolsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListToolsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tools = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.tools && message.tools.length) { - object.tools = []; - for (var j = 0; j < message.tools.length; ++j) - object.tools[j] = $root.google.cloud.ces.v1.Tool.toObject(message.tools[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListToolsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListToolsResponse - * @instance - * @returns {Object.} JSON object - */ - ListToolsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListToolsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListToolsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListToolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListToolsResponse"; - }; - - return ListToolsResponse; - })(); - - v1.GetToolRequest = (function() { - - /** - * Properties of a GetToolRequest. - * @memberof google.cloud.ces.v1 - * @interface IGetToolRequest - * @property {string|null} [name] GetToolRequest name - */ - - /** - * Constructs a new GetToolRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a GetToolRequest. - * @implements IGetToolRequest - * @constructor - * @param {google.cloud.ces.v1.IGetToolRequest=} [properties] Properties to set - */ - function GetToolRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetToolRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.GetToolRequest - * @instance - */ - GetToolRequest.prototype.name = ""; - - /** - * Creates a new GetToolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.GetToolRequest - * @static - * @param {google.cloud.ces.v1.IGetToolRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.GetToolRequest} GetToolRequest instance - */ - GetToolRequest.create = function create(properties) { - return new GetToolRequest(properties); - }; - - /** - * Encodes the specified GetToolRequest message. Does not implicitly {@link google.cloud.ces.v1.GetToolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.GetToolRequest - * @static - * @param {google.cloud.ces.v1.IGetToolRequest} message GetToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetToolRequest.encode = function encode(message, writer) { - 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 GetToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetToolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.GetToolRequest - * @static - * @param {google.cloud.ces.v1.IGetToolRequest} message GetToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetToolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetToolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.GetToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.GetToolRequest} GetToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetToolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetToolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetToolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.GetToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.GetToolRequest} GetToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetToolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetToolRequest message. - * @function verify - * @memberof google.cloud.ces.v1.GetToolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetToolRequest.verify = function verify(message) { - if (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 GetToolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.GetToolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.GetToolRequest} GetToolRequest - */ - GetToolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.GetToolRequest) - return object; - var message = new $root.google.cloud.ces.v1.GetToolRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetToolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.GetToolRequest - * @static - * @param {google.cloud.ces.v1.GetToolRequest} message GetToolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetToolRequest.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 GetToolRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.GetToolRequest - * @instance - * @returns {Object.} JSON object - */ - GetToolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetToolRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.GetToolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.GetToolRequest"; - }; - - return GetToolRequest; - })(); - - v1.CreateToolRequest = (function() { - - /** - * Properties of a CreateToolRequest. - * @memberof google.cloud.ces.v1 - * @interface ICreateToolRequest - * @property {string|null} [parent] CreateToolRequest parent - * @property {string|null} [toolId] CreateToolRequest toolId - * @property {google.cloud.ces.v1.ITool|null} [tool] CreateToolRequest tool - */ - - /** - * Constructs a new CreateToolRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a CreateToolRequest. - * @implements ICreateToolRequest - * @constructor - * @param {google.cloud.ces.v1.ICreateToolRequest=} [properties] Properties to set - */ - function CreateToolRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateToolRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.CreateToolRequest - * @instance - */ - CreateToolRequest.prototype.parent = ""; - - /** - * CreateToolRequest toolId. - * @member {string} toolId - * @memberof google.cloud.ces.v1.CreateToolRequest - * @instance - */ - CreateToolRequest.prototype.toolId = ""; - - /** - * CreateToolRequest tool. - * @member {google.cloud.ces.v1.ITool|null|undefined} tool - * @memberof google.cloud.ces.v1.CreateToolRequest - * @instance - */ - CreateToolRequest.prototype.tool = null; - - /** - * Creates a new CreateToolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.CreateToolRequest - * @static - * @param {google.cloud.ces.v1.ICreateToolRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.CreateToolRequest} CreateToolRequest instance - */ - CreateToolRequest.create = function create(properties) { - return new CreateToolRequest(properties); - }; - - /** - * Encodes the specified CreateToolRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateToolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.CreateToolRequest - * @static - * @param {google.cloud.ces.v1.ICreateToolRequest} message CreateToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateToolRequest.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.toolId != null && Object.hasOwnProperty.call(message, "toolId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.toolId); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - $root.google.cloud.ces.v1.Tool.encode(message.tool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateToolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.CreateToolRequest - * @static - * @param {google.cloud.ces.v1.ICreateToolRequest} message CreateToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateToolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateToolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.CreateToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.CreateToolRequest} CreateToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateToolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CreateToolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.toolId = reader.string(); - break; - } - case 3: { - message.tool = $root.google.cloud.ces.v1.Tool.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateToolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.CreateToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.CreateToolRequest} CreateToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateToolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateToolRequest message. - * @function verify - * @memberof google.cloud.ces.v1.CreateToolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateToolRequest.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.toolId != null && message.hasOwnProperty("toolId")) - if (!$util.isString(message.toolId)) - return "toolId: string expected"; - if (message.tool != null && message.hasOwnProperty("tool")) { - var error = $root.google.cloud.ces.v1.Tool.verify(message.tool); - if (error) - return "tool." + error; - } - return null; - }; - - /** - * Creates a CreateToolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.CreateToolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.CreateToolRequest} CreateToolRequest - */ - CreateToolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.CreateToolRequest) - return object; - var message = new $root.google.cloud.ces.v1.CreateToolRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.toolId != null) - message.toolId = String(object.toolId); - if (object.tool != null) { - if (typeof object.tool !== "object") - throw TypeError(".google.cloud.ces.v1.CreateToolRequest.tool: object expected"); - message.tool = $root.google.cloud.ces.v1.Tool.fromObject(object.tool); - } - return message; - }; - - /** - * Creates a plain object from a CreateToolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.CreateToolRequest - * @static - * @param {google.cloud.ces.v1.CreateToolRequest} message CreateToolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateToolRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.toolId = ""; - object.tool = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.toolId != null && message.hasOwnProperty("toolId")) - object.toolId = message.toolId; - if (message.tool != null && message.hasOwnProperty("tool")) - object.tool = $root.google.cloud.ces.v1.Tool.toObject(message.tool, options); - return object; - }; - - /** - * Converts this CreateToolRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.CreateToolRequest - * @instance - * @returns {Object.} JSON object - */ - CreateToolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateToolRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.CreateToolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.CreateToolRequest"; - }; - - return CreateToolRequest; - })(); - - v1.UpdateToolRequest = (function() { - - /** - * Properties of an UpdateToolRequest. - * @memberof google.cloud.ces.v1 - * @interface IUpdateToolRequest - * @property {google.cloud.ces.v1.ITool|null} [tool] UpdateToolRequest tool - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateToolRequest updateMask - */ - - /** - * Constructs a new UpdateToolRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an UpdateToolRequest. - * @implements IUpdateToolRequest - * @constructor - * @param {google.cloud.ces.v1.IUpdateToolRequest=} [properties] Properties to set - */ - function UpdateToolRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateToolRequest tool. - * @member {google.cloud.ces.v1.ITool|null|undefined} tool - * @memberof google.cloud.ces.v1.UpdateToolRequest - * @instance - */ - UpdateToolRequest.prototype.tool = null; - - /** - * UpdateToolRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.ces.v1.UpdateToolRequest - * @instance - */ - UpdateToolRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateToolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.UpdateToolRequest - * @static - * @param {google.cloud.ces.v1.IUpdateToolRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.UpdateToolRequest} UpdateToolRequest instance - */ - UpdateToolRequest.create = function create(properties) { - return new UpdateToolRequest(properties); - }; - - /** - * Encodes the specified UpdateToolRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateToolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.UpdateToolRequest - * @static - * @param {google.cloud.ces.v1.IUpdateToolRequest} message UpdateToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateToolRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - $root.google.cloud.ces.v1.Tool.encode(message.tool, 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 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateToolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.UpdateToolRequest - * @static - * @param {google.cloud.ces.v1.IUpdateToolRequest} message UpdateToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateToolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateToolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.UpdateToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.UpdateToolRequest} UpdateToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateToolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.UpdateToolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tool = $root.google.cloud.ces.v1.Tool.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateToolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.UpdateToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.UpdateToolRequest} UpdateToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateToolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateToolRequest message. - * @function verify - * @memberof google.cloud.ces.v1.UpdateToolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateToolRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tool != null && message.hasOwnProperty("tool")) { - var error = $root.google.cloud.ces.v1.Tool.verify(message.tool); - if (error) - return "tool." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateToolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.UpdateToolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.UpdateToolRequest} UpdateToolRequest - */ - UpdateToolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.UpdateToolRequest) - return object; - var message = new $root.google.cloud.ces.v1.UpdateToolRequest(); - if (object.tool != null) { - if (typeof object.tool !== "object") - throw TypeError(".google.cloud.ces.v1.UpdateToolRequest.tool: object expected"); - message.tool = $root.google.cloud.ces.v1.Tool.fromObject(object.tool); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.ces.v1.UpdateToolRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateToolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.UpdateToolRequest - * @static - * @param {google.cloud.ces.v1.UpdateToolRequest} message UpdateToolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateToolRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.tool = null; - object.updateMask = null; - } - if (message.tool != null && message.hasOwnProperty("tool")) - object.tool = $root.google.cloud.ces.v1.Tool.toObject(message.tool, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateToolRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.UpdateToolRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateToolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateToolRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.UpdateToolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.UpdateToolRequest"; - }; - - return UpdateToolRequest; - })(); - - v1.DeleteToolRequest = (function() { - - /** - * Properties of a DeleteToolRequest. - * @memberof google.cloud.ces.v1 - * @interface IDeleteToolRequest - * @property {string|null} [name] DeleteToolRequest name - * @property {boolean|null} [force] DeleteToolRequest force - * @property {string|null} [etag] DeleteToolRequest etag - */ - - /** - * Constructs a new DeleteToolRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a DeleteToolRequest. - * @implements IDeleteToolRequest - * @constructor - * @param {google.cloud.ces.v1.IDeleteToolRequest=} [properties] Properties to set - */ - function DeleteToolRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteToolRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.DeleteToolRequest - * @instance - */ - DeleteToolRequest.prototype.name = ""; - - /** - * DeleteToolRequest force. - * @member {boolean} force - * @memberof google.cloud.ces.v1.DeleteToolRequest - * @instance - */ - DeleteToolRequest.prototype.force = false; - - /** - * DeleteToolRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1.DeleteToolRequest - * @instance - */ - DeleteToolRequest.prototype.etag = ""; - - /** - * Creates a new DeleteToolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DeleteToolRequest - * @static - * @param {google.cloud.ces.v1.IDeleteToolRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DeleteToolRequest} DeleteToolRequest instance - */ - DeleteToolRequest.create = function create(properties) { - return new DeleteToolRequest(properties); - }; - - /** - * Encodes the specified DeleteToolRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteToolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DeleteToolRequest - * @static - * @param {google.cloud.ces.v1.IDeleteToolRequest} message DeleteToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteToolRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteToolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DeleteToolRequest - * @static - * @param {google.cloud.ces.v1.IDeleteToolRequest} message DeleteToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteToolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteToolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DeleteToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DeleteToolRequest} DeleteToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteToolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DeleteToolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.force = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteToolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DeleteToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DeleteToolRequest} DeleteToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteToolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteToolRequest message. - * @function verify - * @memberof google.cloud.ces.v1.DeleteToolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteToolRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteToolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DeleteToolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DeleteToolRequest} DeleteToolRequest - */ - DeleteToolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DeleteToolRequest) - return object; - var message = new $root.google.cloud.ces.v1.DeleteToolRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.force != null) - message.force = Boolean(object.force); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteToolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DeleteToolRequest - * @static - * @param {google.cloud.ces.v1.DeleteToolRequest} message DeleteToolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteToolRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.force = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteToolRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DeleteToolRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteToolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteToolRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DeleteToolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DeleteToolRequest"; - }; - - return DeleteToolRequest; - })(); - - v1.ListConversationsRequest = (function() { - - /** - * Properties of a ListConversationsRequest. - * @memberof google.cloud.ces.v1 - * @interface IListConversationsRequest - * @property {string|null} [parent] ListConversationsRequest parent - * @property {number|null} [pageSize] ListConversationsRequest pageSize - * @property {string|null} [pageToken] ListConversationsRequest pageToken - * @property {string|null} [filter] ListConversationsRequest filter - * @property {google.cloud.ces.v1.Conversation.Source|null} [source] ListConversationsRequest source - * @property {Array.|null} [sources] ListConversationsRequest sources - */ - - /** - * Constructs a new ListConversationsRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListConversationsRequest. - * @implements IListConversationsRequest - * @constructor - * @param {google.cloud.ces.v1.IListConversationsRequest=} [properties] Properties to set - */ - function ListConversationsRequest(properties) { - this.sources = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListConversationsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.ListConversationsRequest - * @instance - */ - ListConversationsRequest.prototype.parent = ""; - - /** - * ListConversationsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1.ListConversationsRequest - * @instance - */ - ListConversationsRequest.prototype.pageSize = 0; - - /** - * ListConversationsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1.ListConversationsRequest - * @instance - */ - ListConversationsRequest.prototype.pageToken = ""; - - /** - * ListConversationsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1.ListConversationsRequest - * @instance - */ - ListConversationsRequest.prototype.filter = ""; - - /** - * ListConversationsRequest source. - * @member {google.cloud.ces.v1.Conversation.Source} source - * @memberof google.cloud.ces.v1.ListConversationsRequest - * @instance - */ - ListConversationsRequest.prototype.source = 0; - - /** - * ListConversationsRequest sources. - * @member {Array.} sources - * @memberof google.cloud.ces.v1.ListConversationsRequest - * @instance - */ - ListConversationsRequest.prototype.sources = $util.emptyArray; - - /** - * Creates a new ListConversationsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListConversationsRequest - * @static - * @param {google.cloud.ces.v1.IListConversationsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListConversationsRequest} ListConversationsRequest instance - */ - ListConversationsRequest.create = function create(properties) { - return new ListConversationsRequest(properties); - }; - - /** - * Encodes the specified ListConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListConversationsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListConversationsRequest - * @static - * @param {google.cloud.ces.v1.IListConversationsRequest} message ListConversationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListConversationsRequest.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.source != null && Object.hasOwnProperty.call(message, "source")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.source); - if (message.sources != null && message.sources.length) { - writer.uint32(/* id 6, wireType 2 =*/50).fork(); - for (var i = 0; i < message.sources.length; ++i) - writer.int32(message.sources[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ListConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListConversationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListConversationsRequest - * @static - * @param {google.cloud.ces.v1.IListConversationsRequest} message ListConversationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListConversationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListConversationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListConversationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListConversationsRequest} ListConversationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListConversationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListConversationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.source = reader.int32(); - break; - } - case 6: { - if (!(message.sources && message.sources.length)) - message.sources = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.sources.push(reader.int32()); - } else - message.sources.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListConversationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListConversationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListConversationsRequest} ListConversationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListConversationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListConversationsRequest message. - * @function verify - * @memberof google.cloud.ces.v1.ListConversationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListConversationsRequest.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.source != null && message.hasOwnProperty("source")) - switch (message.source) { - default: - return "source: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.sources != null && message.hasOwnProperty("sources")) { - if (!Array.isArray(message.sources)) - return "sources: array expected"; - for (var i = 0; i < message.sources.length; ++i) - switch (message.sources[i]) { - default: - return "sources: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - return null; - }; - - /** - * Creates a ListConversationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListConversationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListConversationsRequest} ListConversationsRequest - */ - ListConversationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListConversationsRequest) - return object; - var message = new $root.google.cloud.ces.v1.ListConversationsRequest(); - 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); - switch (object.source) { - default: - if (typeof object.source === "number") { - message.source = object.source; - break; - } - break; - case "SOURCE_UNSPECIFIED": - case 0: - message.source = 0; - break; - case "LIVE": - case 1: - message.source = 1; - break; - case "SIMULATOR": - case 2: - message.source = 2; - break; - case "EVAL": - case 3: - message.source = 3; - break; - } - if (object.sources) { - if (!Array.isArray(object.sources)) - throw TypeError(".google.cloud.ces.v1.ListConversationsRequest.sources: array expected"); - message.sources = []; - for (var i = 0; i < object.sources.length; ++i) - switch (object.sources[i]) { - default: - if (typeof object.sources[i] === "number") { - message.sources[i] = object.sources[i]; - break; - } - case "SOURCE_UNSPECIFIED": - case 0: - message.sources[i] = 0; - break; - case "LIVE": - case 1: - message.sources[i] = 1; - break; - case "SIMULATOR": - case 2: - message.sources[i] = 2; - break; - case "EVAL": - case 3: - message.sources[i] = 3; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a ListConversationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListConversationsRequest - * @static - * @param {google.cloud.ces.v1.ListConversationsRequest} message ListConversationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListConversationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.sources = []; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.source != null && message.hasOwnProperty("source")) - object.source = options.enums === String ? $root.google.cloud.ces.v1.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1.Conversation.Source[message.source] : message.source; - if (message.sources && message.sources.length) { - object.sources = []; - for (var j = 0; j < message.sources.length; ++j) - object.sources[j] = options.enums === String ? $root.google.cloud.ces.v1.Conversation.Source[message.sources[j]] === undefined ? message.sources[j] : $root.google.cloud.ces.v1.Conversation.Source[message.sources[j]] : message.sources[j]; - } - return object; - }; - - /** - * Converts this ListConversationsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListConversationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListConversationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListConversationsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListConversationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListConversationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListConversationsRequest"; - }; - - return ListConversationsRequest; - })(); - - v1.ListConversationsResponse = (function() { - - /** - * Properties of a ListConversationsResponse. - * @memberof google.cloud.ces.v1 - * @interface IListConversationsResponse - * @property {Array.|null} [conversations] ListConversationsResponse conversations - * @property {string|null} [nextPageToken] ListConversationsResponse nextPageToken - */ - - /** - * Constructs a new ListConversationsResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListConversationsResponse. - * @implements IListConversationsResponse - * @constructor - * @param {google.cloud.ces.v1.IListConversationsResponse=} [properties] Properties to set - */ - function ListConversationsResponse(properties) { - this.conversations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListConversationsResponse conversations. - * @member {Array.} conversations - * @memberof google.cloud.ces.v1.ListConversationsResponse - * @instance - */ - ListConversationsResponse.prototype.conversations = $util.emptyArray; - - /** - * ListConversationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1.ListConversationsResponse - * @instance - */ - ListConversationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListConversationsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListConversationsResponse - * @static - * @param {google.cloud.ces.v1.IListConversationsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListConversationsResponse} ListConversationsResponse instance - */ - ListConversationsResponse.create = function create(properties) { - return new ListConversationsResponse(properties); - }; - - /** - * Encodes the specified ListConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListConversationsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListConversationsResponse - * @static - * @param {google.cloud.ces.v1.IListConversationsResponse} message ListConversationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListConversationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.conversations != null && message.conversations.length) - for (var i = 0; i < message.conversations.length; ++i) - $root.google.cloud.ces.v1.Conversation.encode(message.conversations[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 ListConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListConversationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListConversationsResponse - * @static - * @param {google.cloud.ces.v1.IListConversationsResponse} message ListConversationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListConversationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListConversationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListConversationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListConversationsResponse} ListConversationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListConversationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListConversationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.conversations && message.conversations.length)) - message.conversations = []; - message.conversations.push($root.google.cloud.ces.v1.Conversation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListConversationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListConversationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListConversationsResponse} ListConversationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListConversationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListConversationsResponse message. - * @function verify - * @memberof google.cloud.ces.v1.ListConversationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListConversationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.conversations != null && message.hasOwnProperty("conversations")) { - if (!Array.isArray(message.conversations)) - return "conversations: array expected"; - for (var i = 0; i < message.conversations.length; ++i) { - var error = $root.google.cloud.ces.v1.Conversation.verify(message.conversations[i]); - if (error) - return "conversations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListConversationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListConversationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListConversationsResponse} ListConversationsResponse - */ - ListConversationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListConversationsResponse) - return object; - var message = new $root.google.cloud.ces.v1.ListConversationsResponse(); - if (object.conversations) { - if (!Array.isArray(object.conversations)) - throw TypeError(".google.cloud.ces.v1.ListConversationsResponse.conversations: array expected"); - message.conversations = []; - for (var i = 0; i < object.conversations.length; ++i) { - if (typeof object.conversations[i] !== "object") - throw TypeError(".google.cloud.ces.v1.ListConversationsResponse.conversations: object expected"); - message.conversations[i] = $root.google.cloud.ces.v1.Conversation.fromObject(object.conversations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListConversationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListConversationsResponse - * @static - * @param {google.cloud.ces.v1.ListConversationsResponse} message ListConversationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListConversationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.conversations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.conversations && message.conversations.length) { - object.conversations = []; - for (var j = 0; j < message.conversations.length; ++j) - object.conversations[j] = $root.google.cloud.ces.v1.Conversation.toObject(message.conversations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListConversationsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListConversationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListConversationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListConversationsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListConversationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListConversationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListConversationsResponse"; - }; - - return ListConversationsResponse; - })(); - - v1.GetConversationRequest = (function() { - - /** - * Properties of a GetConversationRequest. - * @memberof google.cloud.ces.v1 - * @interface IGetConversationRequest - * @property {string|null} [name] GetConversationRequest name - * @property {google.cloud.ces.v1.Conversation.Source|null} [source] GetConversationRequest source - */ - - /** - * Constructs a new GetConversationRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a GetConversationRequest. - * @implements IGetConversationRequest - * @constructor - * @param {google.cloud.ces.v1.IGetConversationRequest=} [properties] Properties to set - */ - function GetConversationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetConversationRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.GetConversationRequest - * @instance - */ - GetConversationRequest.prototype.name = ""; - - /** - * GetConversationRequest source. - * @member {google.cloud.ces.v1.Conversation.Source} source - * @memberof google.cloud.ces.v1.GetConversationRequest - * @instance - */ - GetConversationRequest.prototype.source = 0; - - /** - * Creates a new GetConversationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.GetConversationRequest - * @static - * @param {google.cloud.ces.v1.IGetConversationRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.GetConversationRequest} GetConversationRequest instance - */ - GetConversationRequest.create = function create(properties) { - return new GetConversationRequest(properties); - }; - - /** - * Encodes the specified GetConversationRequest message. Does not implicitly {@link google.cloud.ces.v1.GetConversationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.GetConversationRequest - * @static - * @param {google.cloud.ces.v1.IGetConversationRequest} message GetConversationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConversationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.source != null && Object.hasOwnProperty.call(message, "source")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.source); - return writer; - }; - - /** - * Encodes the specified GetConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetConversationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.GetConversationRequest - * @static - * @param {google.cloud.ces.v1.IGetConversationRequest} message GetConversationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConversationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetConversationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.GetConversationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.GetConversationRequest} GetConversationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConversationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetConversationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.source = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetConversationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.GetConversationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.GetConversationRequest} GetConversationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConversationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetConversationRequest message. - * @function verify - * @memberof google.cloud.ces.v1.GetConversationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetConversationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.source != null && message.hasOwnProperty("source")) - switch (message.source) { - default: - return "source: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a GetConversationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.GetConversationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.GetConversationRequest} GetConversationRequest - */ - GetConversationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.GetConversationRequest) - return object; - var message = new $root.google.cloud.ces.v1.GetConversationRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.source) { - default: - if (typeof object.source === "number") { - message.source = object.source; - break; - } - break; - case "SOURCE_UNSPECIFIED": - case 0: - message.source = 0; - break; - case "LIVE": - case 1: - message.source = 1; - break; - case "SIMULATOR": - case 2: - message.source = 2; - break; - case "EVAL": - case 3: - message.source = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a GetConversationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.GetConversationRequest - * @static - * @param {google.cloud.ces.v1.GetConversationRequest} message GetConversationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetConversationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.source != null && message.hasOwnProperty("source")) - object.source = options.enums === String ? $root.google.cloud.ces.v1.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1.Conversation.Source[message.source] : message.source; - return object; - }; - - /** - * Converts this GetConversationRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.GetConversationRequest - * @instance - * @returns {Object.} JSON object - */ - GetConversationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetConversationRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.GetConversationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetConversationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.GetConversationRequest"; - }; - - return GetConversationRequest; - })(); - - v1.DeleteConversationRequest = (function() { - - /** - * Properties of a DeleteConversationRequest. - * @memberof google.cloud.ces.v1 - * @interface IDeleteConversationRequest - * @property {string|null} [name] DeleteConversationRequest name - * @property {google.cloud.ces.v1.Conversation.Source|null} [source] DeleteConversationRequest source - */ - - /** - * Constructs a new DeleteConversationRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a DeleteConversationRequest. - * @implements IDeleteConversationRequest - * @constructor - * @param {google.cloud.ces.v1.IDeleteConversationRequest=} [properties] Properties to set - */ - function DeleteConversationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteConversationRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.DeleteConversationRequest - * @instance - */ - DeleteConversationRequest.prototype.name = ""; - - /** - * DeleteConversationRequest source. - * @member {google.cloud.ces.v1.Conversation.Source} source - * @memberof google.cloud.ces.v1.DeleteConversationRequest - * @instance - */ - DeleteConversationRequest.prototype.source = 0; - - /** - * Creates a new DeleteConversationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DeleteConversationRequest - * @static - * @param {google.cloud.ces.v1.IDeleteConversationRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DeleteConversationRequest} DeleteConversationRequest instance - */ - DeleteConversationRequest.create = function create(properties) { - return new DeleteConversationRequest(properties); - }; - - /** - * Encodes the specified DeleteConversationRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteConversationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DeleteConversationRequest - * @static - * @param {google.cloud.ces.v1.IDeleteConversationRequest} message DeleteConversationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteConversationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.source != null && Object.hasOwnProperty.call(message, "source")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.source); - return writer; - }; - - /** - * Encodes the specified DeleteConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteConversationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DeleteConversationRequest - * @static - * @param {google.cloud.ces.v1.IDeleteConversationRequest} message DeleteConversationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteConversationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteConversationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DeleteConversationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DeleteConversationRequest} DeleteConversationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteConversationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DeleteConversationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.source = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteConversationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DeleteConversationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DeleteConversationRequest} DeleteConversationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteConversationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteConversationRequest message. - * @function verify - * @memberof google.cloud.ces.v1.DeleteConversationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteConversationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.source != null && message.hasOwnProperty("source")) - switch (message.source) { - default: - return "source: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a DeleteConversationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DeleteConversationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DeleteConversationRequest} DeleteConversationRequest - */ - DeleteConversationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DeleteConversationRequest) - return object; - var message = new $root.google.cloud.ces.v1.DeleteConversationRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.source) { - default: - if (typeof object.source === "number") { - message.source = object.source; - break; - } - break; - case "SOURCE_UNSPECIFIED": - case 0: - message.source = 0; - break; - case "LIVE": - case 1: - message.source = 1; - break; - case "SIMULATOR": - case 2: - message.source = 2; - break; - case "EVAL": - case 3: - message.source = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a DeleteConversationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DeleteConversationRequest - * @static - * @param {google.cloud.ces.v1.DeleteConversationRequest} message DeleteConversationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteConversationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.source != null && message.hasOwnProperty("source")) - object.source = options.enums === String ? $root.google.cloud.ces.v1.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1.Conversation.Source[message.source] : message.source; - return object; - }; - - /** - * Converts this DeleteConversationRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DeleteConversationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteConversationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteConversationRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DeleteConversationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteConversationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DeleteConversationRequest"; - }; - - return DeleteConversationRequest; - })(); - - v1.BatchDeleteConversationsRequest = (function() { - - /** - * Properties of a BatchDeleteConversationsRequest. - * @memberof google.cloud.ces.v1 - * @interface IBatchDeleteConversationsRequest - * @property {string|null} [parent] BatchDeleteConversationsRequest parent - * @property {Array.|null} [conversations] BatchDeleteConversationsRequest conversations - */ - - /** - * Constructs a new BatchDeleteConversationsRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a BatchDeleteConversationsRequest. - * @implements IBatchDeleteConversationsRequest - * @constructor - * @param {google.cloud.ces.v1.IBatchDeleteConversationsRequest=} [properties] Properties to set - */ - function BatchDeleteConversationsRequest(properties) { - this.conversations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchDeleteConversationsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest - * @instance - */ - BatchDeleteConversationsRequest.prototype.parent = ""; - - /** - * BatchDeleteConversationsRequest conversations. - * @member {Array.} conversations - * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest - * @instance - */ - BatchDeleteConversationsRequest.prototype.conversations = $util.emptyArray; - - /** - * Creates a new BatchDeleteConversationsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest - * @static - * @param {google.cloud.ces.v1.IBatchDeleteConversationsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest instance - */ - BatchDeleteConversationsRequest.create = function create(properties) { - return new BatchDeleteConversationsRequest(properties); - }; - - /** - * Encodes the specified BatchDeleteConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1.BatchDeleteConversationsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest - * @static - * @param {google.cloud.ces.v1.IBatchDeleteConversationsRequest} message BatchDeleteConversationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteConversationsRequest.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.conversations != null && message.conversations.length) - for (var i = 0; i < message.conversations.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.conversations[i]); - return writer; - }; - - /** - * Encodes the specified BatchDeleteConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BatchDeleteConversationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest - * @static - * @param {google.cloud.ces.v1.IBatchDeleteConversationsRequest} message BatchDeleteConversationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteConversationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteConversationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.BatchDeleteConversationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - if (!(message.conversations && message.conversations.length)) - message.conversations = []; - message.conversations.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteConversationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchDeleteConversationsRequest message. - * @function verify - * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchDeleteConversationsRequest.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.conversations != null && message.hasOwnProperty("conversations")) { - if (!Array.isArray(message.conversations)) - return "conversations: array expected"; - for (var i = 0; i < message.conversations.length; ++i) - if (!$util.isString(message.conversations[i])) - return "conversations: string[] expected"; - } - return null; - }; - - /** - * Creates a BatchDeleteConversationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest - */ - BatchDeleteConversationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.BatchDeleteConversationsRequest) - return object; - var message = new $root.google.cloud.ces.v1.BatchDeleteConversationsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.conversations) { - if (!Array.isArray(object.conversations)) - throw TypeError(".google.cloud.ces.v1.BatchDeleteConversationsRequest.conversations: array expected"); - message.conversations = []; - for (var i = 0; i < object.conversations.length; ++i) - message.conversations[i] = String(object.conversations[i]); - } - return message; - }; - - /** - * Creates a plain object from a BatchDeleteConversationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest - * @static - * @param {google.cloud.ces.v1.BatchDeleteConversationsRequest} message BatchDeleteConversationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchDeleteConversationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.conversations = []; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.conversations && message.conversations.length) { - object.conversations = []; - for (var j = 0; j < message.conversations.length; ++j) - object.conversations[j] = message.conversations[j]; - } - return object; - }; - - /** - * Converts this BatchDeleteConversationsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest - * @instance - * @returns {Object.} JSON object - */ - BatchDeleteConversationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchDeleteConversationsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.BatchDeleteConversationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchDeleteConversationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.BatchDeleteConversationsRequest"; - }; - - return BatchDeleteConversationsRequest; - })(); - - v1.BatchDeleteConversationsResponse = (function() { - - /** - * Properties of a BatchDeleteConversationsResponse. - * @memberof google.cloud.ces.v1 - * @interface IBatchDeleteConversationsResponse - * @property {Array.|null} [deletedConversations] BatchDeleteConversationsResponse deletedConversations - * @property {Array.|null} [failedConversations] BatchDeleteConversationsResponse failedConversations - * @property {Array.|null} [errorMessages] BatchDeleteConversationsResponse errorMessages - */ - - /** - * Constructs a new BatchDeleteConversationsResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a BatchDeleteConversationsResponse. - * @implements IBatchDeleteConversationsResponse - * @constructor - * @param {google.cloud.ces.v1.IBatchDeleteConversationsResponse=} [properties] Properties to set - */ - function BatchDeleteConversationsResponse(properties) { - this.deletedConversations = []; - this.failedConversations = []; - this.errorMessages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchDeleteConversationsResponse deletedConversations. - * @member {Array.} deletedConversations - * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse - * @instance - */ - BatchDeleteConversationsResponse.prototype.deletedConversations = $util.emptyArray; - - /** - * BatchDeleteConversationsResponse failedConversations. - * @member {Array.} failedConversations - * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse - * @instance - */ - BatchDeleteConversationsResponse.prototype.failedConversations = $util.emptyArray; - - /** - * BatchDeleteConversationsResponse errorMessages. - * @member {Array.} errorMessages - * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse - * @instance - */ - BatchDeleteConversationsResponse.prototype.errorMessages = $util.emptyArray; - - /** - * Creates a new BatchDeleteConversationsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse - * @static - * @param {google.cloud.ces.v1.IBatchDeleteConversationsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse instance - */ - BatchDeleteConversationsResponse.create = function create(properties) { - return new BatchDeleteConversationsResponse(properties); - }; - - /** - * Encodes the specified BatchDeleteConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1.BatchDeleteConversationsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse - * @static - * @param {google.cloud.ces.v1.IBatchDeleteConversationsResponse} message BatchDeleteConversationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteConversationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deletedConversations != null && message.deletedConversations.length) - for (var i = 0; i < message.deletedConversations.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.deletedConversations[i]); - if (message.failedConversations != null && message.failedConversations.length) - for (var i = 0; i < message.failedConversations.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.failedConversations[i]); - if (message.errorMessages != null && message.errorMessages.length) - for (var i = 0; i < message.errorMessages.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorMessages[i]); - return writer; - }; - - /** - * Encodes the specified BatchDeleteConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BatchDeleteConversationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse - * @static - * @param {google.cloud.ces.v1.IBatchDeleteConversationsResponse} message BatchDeleteConversationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteConversationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteConversationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.BatchDeleteConversationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.deletedConversations && message.deletedConversations.length)) - message.deletedConversations = []; - message.deletedConversations.push(reader.string()); - break; - } - case 2: { - if (!(message.failedConversations && message.failedConversations.length)) - message.failedConversations = []; - message.failedConversations.push(reader.string()); - break; - } - case 3: { - if (!(message.errorMessages && message.errorMessages.length)) - message.errorMessages = []; - message.errorMessages.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteConversationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchDeleteConversationsResponse message. - * @function verify - * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchDeleteConversationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deletedConversations != null && message.hasOwnProperty("deletedConversations")) { - if (!Array.isArray(message.deletedConversations)) - return "deletedConversations: array expected"; - for (var i = 0; i < message.deletedConversations.length; ++i) - if (!$util.isString(message.deletedConversations[i])) - return "deletedConversations: string[] expected"; - } - if (message.failedConversations != null && message.hasOwnProperty("failedConversations")) { - if (!Array.isArray(message.failedConversations)) - return "failedConversations: array expected"; - for (var i = 0; i < message.failedConversations.length; ++i) - if (!$util.isString(message.failedConversations[i])) - return "failedConversations: string[] expected"; - } - if (message.errorMessages != null && message.hasOwnProperty("errorMessages")) { - if (!Array.isArray(message.errorMessages)) - return "errorMessages: array expected"; - for (var i = 0; i < message.errorMessages.length; ++i) - if (!$util.isString(message.errorMessages[i])) - return "errorMessages: string[] expected"; - } - return null; - }; - - /** - * Creates a BatchDeleteConversationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse - */ - BatchDeleteConversationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.BatchDeleteConversationsResponse) - return object; - var message = new $root.google.cloud.ces.v1.BatchDeleteConversationsResponse(); - if (object.deletedConversations) { - if (!Array.isArray(object.deletedConversations)) - throw TypeError(".google.cloud.ces.v1.BatchDeleteConversationsResponse.deletedConversations: array expected"); - message.deletedConversations = []; - for (var i = 0; i < object.deletedConversations.length; ++i) - message.deletedConversations[i] = String(object.deletedConversations[i]); - } - if (object.failedConversations) { - if (!Array.isArray(object.failedConversations)) - throw TypeError(".google.cloud.ces.v1.BatchDeleteConversationsResponse.failedConversations: array expected"); - message.failedConversations = []; - for (var i = 0; i < object.failedConversations.length; ++i) - message.failedConversations[i] = String(object.failedConversations[i]); - } - if (object.errorMessages) { - if (!Array.isArray(object.errorMessages)) - throw TypeError(".google.cloud.ces.v1.BatchDeleteConversationsResponse.errorMessages: array expected"); - message.errorMessages = []; - for (var i = 0; i < object.errorMessages.length; ++i) - message.errorMessages[i] = String(object.errorMessages[i]); - } - return message; - }; - - /** - * Creates a plain object from a BatchDeleteConversationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse - * @static - * @param {google.cloud.ces.v1.BatchDeleteConversationsResponse} message BatchDeleteConversationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchDeleteConversationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.deletedConversations = []; - object.failedConversations = []; - object.errorMessages = []; - } - if (message.deletedConversations && message.deletedConversations.length) { - object.deletedConversations = []; - for (var j = 0; j < message.deletedConversations.length; ++j) - object.deletedConversations[j] = message.deletedConversations[j]; - } - if (message.failedConversations && message.failedConversations.length) { - object.failedConversations = []; - for (var j = 0; j < message.failedConversations.length; ++j) - object.failedConversations[j] = message.failedConversations[j]; - } - if (message.errorMessages && message.errorMessages.length) { - object.errorMessages = []; - for (var j = 0; j < message.errorMessages.length; ++j) - object.errorMessages[j] = message.errorMessages[j]; - } - return object; - }; - - /** - * Converts this BatchDeleteConversationsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse - * @instance - * @returns {Object.} JSON object - */ - BatchDeleteConversationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchDeleteConversationsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.BatchDeleteConversationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchDeleteConversationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.BatchDeleteConversationsResponse"; - }; - - return BatchDeleteConversationsResponse; - })(); - - v1.ListGuardrailsRequest = (function() { - - /** - * Properties of a ListGuardrailsRequest. - * @memberof google.cloud.ces.v1 - * @interface IListGuardrailsRequest - * @property {string|null} [parent] ListGuardrailsRequest parent - * @property {number|null} [pageSize] ListGuardrailsRequest pageSize - * @property {string|null} [pageToken] ListGuardrailsRequest pageToken - * @property {string|null} [filter] ListGuardrailsRequest filter - * @property {string|null} [orderBy] ListGuardrailsRequest orderBy - */ - - /** - * Constructs a new ListGuardrailsRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListGuardrailsRequest. - * @implements IListGuardrailsRequest - * @constructor - * @param {google.cloud.ces.v1.IListGuardrailsRequest=} [properties] Properties to set - */ - function ListGuardrailsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListGuardrailsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.ListGuardrailsRequest - * @instance - */ - ListGuardrailsRequest.prototype.parent = ""; - - /** - * ListGuardrailsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1.ListGuardrailsRequest - * @instance - */ - ListGuardrailsRequest.prototype.pageSize = 0; - - /** - * ListGuardrailsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1.ListGuardrailsRequest - * @instance - */ - ListGuardrailsRequest.prototype.pageToken = ""; - - /** - * ListGuardrailsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1.ListGuardrailsRequest - * @instance - */ - ListGuardrailsRequest.prototype.filter = ""; - - /** - * ListGuardrailsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1.ListGuardrailsRequest - * @instance - */ - ListGuardrailsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListGuardrailsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListGuardrailsRequest - * @static - * @param {google.cloud.ces.v1.IListGuardrailsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListGuardrailsRequest} ListGuardrailsRequest instance - */ - ListGuardrailsRequest.create = function create(properties) { - return new ListGuardrailsRequest(properties); - }; - - /** - * Encodes the specified ListGuardrailsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListGuardrailsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListGuardrailsRequest - * @static - * @param {google.cloud.ces.v1.IListGuardrailsRequest} message ListGuardrailsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListGuardrailsRequest.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 ListGuardrailsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListGuardrailsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListGuardrailsRequest - * @static - * @param {google.cloud.ces.v1.IListGuardrailsRequest} message ListGuardrailsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListGuardrailsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListGuardrailsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListGuardrailsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListGuardrailsRequest} ListGuardrailsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListGuardrailsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListGuardrailsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListGuardrailsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListGuardrailsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListGuardrailsRequest} ListGuardrailsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListGuardrailsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListGuardrailsRequest message. - * @function verify - * @memberof google.cloud.ces.v1.ListGuardrailsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListGuardrailsRequest.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 ListGuardrailsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListGuardrailsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListGuardrailsRequest} ListGuardrailsRequest - */ - ListGuardrailsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListGuardrailsRequest) - return object; - var message = new $root.google.cloud.ces.v1.ListGuardrailsRequest(); - 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 ListGuardrailsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListGuardrailsRequest - * @static - * @param {google.cloud.ces.v1.ListGuardrailsRequest} message ListGuardrailsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListGuardrailsRequest.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 ListGuardrailsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListGuardrailsRequest - * @instance - * @returns {Object.} JSON object - */ - ListGuardrailsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListGuardrailsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListGuardrailsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListGuardrailsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListGuardrailsRequest"; - }; - - return ListGuardrailsRequest; - })(); - - v1.ListGuardrailsResponse = (function() { - - /** - * Properties of a ListGuardrailsResponse. - * @memberof google.cloud.ces.v1 - * @interface IListGuardrailsResponse - * @property {Array.|null} [guardrails] ListGuardrailsResponse guardrails - * @property {string|null} [nextPageToken] ListGuardrailsResponse nextPageToken - */ - - /** - * Constructs a new ListGuardrailsResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListGuardrailsResponse. - * @implements IListGuardrailsResponse - * @constructor - * @param {google.cloud.ces.v1.IListGuardrailsResponse=} [properties] Properties to set - */ - function ListGuardrailsResponse(properties) { - this.guardrails = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListGuardrailsResponse guardrails. - * @member {Array.} guardrails - * @memberof google.cloud.ces.v1.ListGuardrailsResponse - * @instance - */ - ListGuardrailsResponse.prototype.guardrails = $util.emptyArray; - - /** - * ListGuardrailsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1.ListGuardrailsResponse - * @instance - */ - ListGuardrailsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListGuardrailsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListGuardrailsResponse - * @static - * @param {google.cloud.ces.v1.IListGuardrailsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListGuardrailsResponse} ListGuardrailsResponse instance - */ - ListGuardrailsResponse.create = function create(properties) { - return new ListGuardrailsResponse(properties); - }; - - /** - * Encodes the specified ListGuardrailsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListGuardrailsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListGuardrailsResponse - * @static - * @param {google.cloud.ces.v1.IListGuardrailsResponse} message ListGuardrailsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListGuardrailsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.guardrails != null && message.guardrails.length) - for (var i = 0; i < message.guardrails.length; ++i) - $root.google.cloud.ces.v1.Guardrail.encode(message.guardrails[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 ListGuardrailsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListGuardrailsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListGuardrailsResponse - * @static - * @param {google.cloud.ces.v1.IListGuardrailsResponse} message ListGuardrailsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListGuardrailsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListGuardrailsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListGuardrailsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListGuardrailsResponse} ListGuardrailsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListGuardrailsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListGuardrailsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.guardrails && message.guardrails.length)) - message.guardrails = []; - message.guardrails.push($root.google.cloud.ces.v1.Guardrail.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListGuardrailsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListGuardrailsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListGuardrailsResponse} ListGuardrailsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListGuardrailsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListGuardrailsResponse message. - * @function verify - * @memberof google.cloud.ces.v1.ListGuardrailsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListGuardrailsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.guardrails != null && message.hasOwnProperty("guardrails")) { - if (!Array.isArray(message.guardrails)) - return "guardrails: array expected"; - for (var i = 0; i < message.guardrails.length; ++i) { - var error = $root.google.cloud.ces.v1.Guardrail.verify(message.guardrails[i]); - if (error) - return "guardrails." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListGuardrailsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListGuardrailsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListGuardrailsResponse} ListGuardrailsResponse - */ - ListGuardrailsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListGuardrailsResponse) - return object; - var message = new $root.google.cloud.ces.v1.ListGuardrailsResponse(); - if (object.guardrails) { - if (!Array.isArray(object.guardrails)) - throw TypeError(".google.cloud.ces.v1.ListGuardrailsResponse.guardrails: array expected"); - message.guardrails = []; - for (var i = 0; i < object.guardrails.length; ++i) { - if (typeof object.guardrails[i] !== "object") - throw TypeError(".google.cloud.ces.v1.ListGuardrailsResponse.guardrails: object expected"); - message.guardrails[i] = $root.google.cloud.ces.v1.Guardrail.fromObject(object.guardrails[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListGuardrailsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListGuardrailsResponse - * @static - * @param {google.cloud.ces.v1.ListGuardrailsResponse} message ListGuardrailsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListGuardrailsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.guardrails = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.guardrails && message.guardrails.length) { - object.guardrails = []; - for (var j = 0; j < message.guardrails.length; ++j) - object.guardrails[j] = $root.google.cloud.ces.v1.Guardrail.toObject(message.guardrails[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListGuardrailsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListGuardrailsResponse - * @instance - * @returns {Object.} JSON object - */ - ListGuardrailsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListGuardrailsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListGuardrailsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListGuardrailsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListGuardrailsResponse"; - }; - - return ListGuardrailsResponse; - })(); - - v1.GetGuardrailRequest = (function() { - - /** - * Properties of a GetGuardrailRequest. - * @memberof google.cloud.ces.v1 - * @interface IGetGuardrailRequest - * @property {string|null} [name] GetGuardrailRequest name - */ - - /** - * Constructs a new GetGuardrailRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a GetGuardrailRequest. - * @implements IGetGuardrailRequest - * @constructor - * @param {google.cloud.ces.v1.IGetGuardrailRequest=} [properties] Properties to set - */ - function GetGuardrailRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGuardrailRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.GetGuardrailRequest - * @instance - */ - GetGuardrailRequest.prototype.name = ""; - - /** - * Creates a new GetGuardrailRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.GetGuardrailRequest - * @static - * @param {google.cloud.ces.v1.IGetGuardrailRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.GetGuardrailRequest} GetGuardrailRequest instance - */ - GetGuardrailRequest.create = function create(properties) { - return new GetGuardrailRequest(properties); - }; - - /** - * Encodes the specified GetGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1.GetGuardrailRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.GetGuardrailRequest - * @static - * @param {google.cloud.ces.v1.IGetGuardrailRequest} message GetGuardrailRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGuardrailRequest.encode = function encode(message, writer) { - 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 GetGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetGuardrailRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.GetGuardrailRequest - * @static - * @param {google.cloud.ces.v1.IGetGuardrailRequest} message GetGuardrailRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGuardrailRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.GetGuardrailRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.GetGuardrailRequest} GetGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGuardrailRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetGuardrailRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGuardrailRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.GetGuardrailRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.GetGuardrailRequest} GetGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGuardrailRequest message. - * @function verify - * @memberof google.cloud.ces.v1.GetGuardrailRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGuardrailRequest.verify = function verify(message) { - if (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 GetGuardrailRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.GetGuardrailRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.GetGuardrailRequest} GetGuardrailRequest - */ - GetGuardrailRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.GetGuardrailRequest) - return object; - var message = new $root.google.cloud.ces.v1.GetGuardrailRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetGuardrailRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.GetGuardrailRequest - * @static - * @param {google.cloud.ces.v1.GetGuardrailRequest} message GetGuardrailRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGuardrailRequest.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 GetGuardrailRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.GetGuardrailRequest - * @instance - * @returns {Object.} JSON object - */ - GetGuardrailRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetGuardrailRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.GetGuardrailRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.GetGuardrailRequest"; - }; - - return GetGuardrailRequest; - })(); - - v1.CreateGuardrailRequest = (function() { - - /** - * Properties of a CreateGuardrailRequest. - * @memberof google.cloud.ces.v1 - * @interface ICreateGuardrailRequest - * @property {string|null} [parent] CreateGuardrailRequest parent - * @property {string|null} [guardrailId] CreateGuardrailRequest guardrailId - * @property {google.cloud.ces.v1.IGuardrail|null} [guardrail] CreateGuardrailRequest guardrail - */ - - /** - * Constructs a new CreateGuardrailRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a CreateGuardrailRequest. - * @implements ICreateGuardrailRequest - * @constructor - * @param {google.cloud.ces.v1.ICreateGuardrailRequest=} [properties] Properties to set - */ - function CreateGuardrailRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateGuardrailRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.CreateGuardrailRequest - * @instance - */ - CreateGuardrailRequest.prototype.parent = ""; - - /** - * CreateGuardrailRequest guardrailId. - * @member {string} guardrailId - * @memberof google.cloud.ces.v1.CreateGuardrailRequest - * @instance - */ - CreateGuardrailRequest.prototype.guardrailId = ""; - - /** - * CreateGuardrailRequest guardrail. - * @member {google.cloud.ces.v1.IGuardrail|null|undefined} guardrail - * @memberof google.cloud.ces.v1.CreateGuardrailRequest - * @instance - */ - CreateGuardrailRequest.prototype.guardrail = null; - - /** - * Creates a new CreateGuardrailRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.CreateGuardrailRequest - * @static - * @param {google.cloud.ces.v1.ICreateGuardrailRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.CreateGuardrailRequest} CreateGuardrailRequest instance - */ - CreateGuardrailRequest.create = function create(properties) { - return new CreateGuardrailRequest(properties); - }; - - /** - * Encodes the specified CreateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateGuardrailRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.CreateGuardrailRequest - * @static - * @param {google.cloud.ces.v1.ICreateGuardrailRequest} message CreateGuardrailRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateGuardrailRequest.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.guardrailId != null && Object.hasOwnProperty.call(message, "guardrailId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.guardrailId); - if (message.guardrail != null && Object.hasOwnProperty.call(message, "guardrail")) - $root.google.cloud.ces.v1.Guardrail.encode(message.guardrail, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateGuardrailRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.CreateGuardrailRequest - * @static - * @param {google.cloud.ces.v1.ICreateGuardrailRequest} message CreateGuardrailRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateGuardrailRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.CreateGuardrailRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.CreateGuardrailRequest} CreateGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateGuardrailRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CreateGuardrailRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.guardrailId = reader.string(); - break; - } - case 3: { - message.guardrail = $root.google.cloud.ces.v1.Guardrail.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateGuardrailRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.CreateGuardrailRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.CreateGuardrailRequest} CreateGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateGuardrailRequest message. - * @function verify - * @memberof google.cloud.ces.v1.CreateGuardrailRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateGuardrailRequest.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.guardrailId != null && message.hasOwnProperty("guardrailId")) - if (!$util.isString(message.guardrailId)) - return "guardrailId: string expected"; - if (message.guardrail != null && message.hasOwnProperty("guardrail")) { - var error = $root.google.cloud.ces.v1.Guardrail.verify(message.guardrail); - if (error) - return "guardrail." + error; - } - return null; - }; - - /** - * Creates a CreateGuardrailRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.CreateGuardrailRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.CreateGuardrailRequest} CreateGuardrailRequest - */ - CreateGuardrailRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.CreateGuardrailRequest) - return object; - var message = new $root.google.cloud.ces.v1.CreateGuardrailRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.guardrailId != null) - message.guardrailId = String(object.guardrailId); - if (object.guardrail != null) { - if (typeof object.guardrail !== "object") - throw TypeError(".google.cloud.ces.v1.CreateGuardrailRequest.guardrail: object expected"); - message.guardrail = $root.google.cloud.ces.v1.Guardrail.fromObject(object.guardrail); - } - return message; - }; - - /** - * Creates a plain object from a CreateGuardrailRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.CreateGuardrailRequest - * @static - * @param {google.cloud.ces.v1.CreateGuardrailRequest} message CreateGuardrailRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateGuardrailRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.guardrailId = ""; - object.guardrail = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.guardrailId != null && message.hasOwnProperty("guardrailId")) - object.guardrailId = message.guardrailId; - if (message.guardrail != null && message.hasOwnProperty("guardrail")) - object.guardrail = $root.google.cloud.ces.v1.Guardrail.toObject(message.guardrail, options); - return object; - }; - - /** - * Converts this CreateGuardrailRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.CreateGuardrailRequest - * @instance - * @returns {Object.} JSON object - */ - CreateGuardrailRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateGuardrailRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.CreateGuardrailRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.CreateGuardrailRequest"; - }; - - return CreateGuardrailRequest; - })(); - - v1.UpdateGuardrailRequest = (function() { - - /** - * Properties of an UpdateGuardrailRequest. - * @memberof google.cloud.ces.v1 - * @interface IUpdateGuardrailRequest - * @property {google.cloud.ces.v1.IGuardrail|null} [guardrail] UpdateGuardrailRequest guardrail - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGuardrailRequest updateMask - */ - - /** - * Constructs a new UpdateGuardrailRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an UpdateGuardrailRequest. - * @implements IUpdateGuardrailRequest - * @constructor - * @param {google.cloud.ces.v1.IUpdateGuardrailRequest=} [properties] Properties to set - */ - function UpdateGuardrailRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateGuardrailRequest guardrail. - * @member {google.cloud.ces.v1.IGuardrail|null|undefined} guardrail - * @memberof google.cloud.ces.v1.UpdateGuardrailRequest - * @instance - */ - UpdateGuardrailRequest.prototype.guardrail = null; - - /** - * UpdateGuardrailRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.ces.v1.UpdateGuardrailRequest - * @instance - */ - UpdateGuardrailRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateGuardrailRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.UpdateGuardrailRequest - * @static - * @param {google.cloud.ces.v1.IUpdateGuardrailRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.UpdateGuardrailRequest} UpdateGuardrailRequest instance - */ - UpdateGuardrailRequest.create = function create(properties) { - return new UpdateGuardrailRequest(properties); - }; - - /** - * Encodes the specified UpdateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateGuardrailRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.UpdateGuardrailRequest - * @static - * @param {google.cloud.ces.v1.IUpdateGuardrailRequest} message UpdateGuardrailRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateGuardrailRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.guardrail != null && Object.hasOwnProperty.call(message, "guardrail")) - $root.google.cloud.ces.v1.Guardrail.encode(message.guardrail, 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 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateGuardrailRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.UpdateGuardrailRequest - * @static - * @param {google.cloud.ces.v1.IUpdateGuardrailRequest} message UpdateGuardrailRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateGuardrailRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.UpdateGuardrailRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.UpdateGuardrailRequest} UpdateGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateGuardrailRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.UpdateGuardrailRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.guardrail = $root.google.cloud.ces.v1.Guardrail.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateGuardrailRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.UpdateGuardrailRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.UpdateGuardrailRequest} UpdateGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateGuardrailRequest message. - * @function verify - * @memberof google.cloud.ces.v1.UpdateGuardrailRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateGuardrailRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.guardrail != null && message.hasOwnProperty("guardrail")) { - var error = $root.google.cloud.ces.v1.Guardrail.verify(message.guardrail); - if (error) - return "guardrail." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateGuardrailRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.UpdateGuardrailRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.UpdateGuardrailRequest} UpdateGuardrailRequest - */ - UpdateGuardrailRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.UpdateGuardrailRequest) - return object; - var message = new $root.google.cloud.ces.v1.UpdateGuardrailRequest(); - if (object.guardrail != null) { - if (typeof object.guardrail !== "object") - throw TypeError(".google.cloud.ces.v1.UpdateGuardrailRequest.guardrail: object expected"); - message.guardrail = $root.google.cloud.ces.v1.Guardrail.fromObject(object.guardrail); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.ces.v1.UpdateGuardrailRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateGuardrailRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.UpdateGuardrailRequest - * @static - * @param {google.cloud.ces.v1.UpdateGuardrailRequest} message UpdateGuardrailRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateGuardrailRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.guardrail = null; - object.updateMask = null; - } - if (message.guardrail != null && message.hasOwnProperty("guardrail")) - object.guardrail = $root.google.cloud.ces.v1.Guardrail.toObject(message.guardrail, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateGuardrailRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.UpdateGuardrailRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateGuardrailRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateGuardrailRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.UpdateGuardrailRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.UpdateGuardrailRequest"; - }; - - return UpdateGuardrailRequest; - })(); - - v1.DeleteGuardrailRequest = (function() { - - /** - * Properties of a DeleteGuardrailRequest. - * @memberof google.cloud.ces.v1 - * @interface IDeleteGuardrailRequest - * @property {string|null} [name] DeleteGuardrailRequest name - * @property {boolean|null} [force] DeleteGuardrailRequest force - * @property {string|null} [etag] DeleteGuardrailRequest etag - */ - - /** - * Constructs a new DeleteGuardrailRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a DeleteGuardrailRequest. - * @implements IDeleteGuardrailRequest - * @constructor - * @param {google.cloud.ces.v1.IDeleteGuardrailRequest=} [properties] Properties to set - */ - function DeleteGuardrailRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteGuardrailRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.DeleteGuardrailRequest - * @instance - */ - DeleteGuardrailRequest.prototype.name = ""; - - /** - * DeleteGuardrailRequest force. - * @member {boolean} force - * @memberof google.cloud.ces.v1.DeleteGuardrailRequest - * @instance - */ - DeleteGuardrailRequest.prototype.force = false; - - /** - * DeleteGuardrailRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1.DeleteGuardrailRequest - * @instance - */ - DeleteGuardrailRequest.prototype.etag = ""; - - /** - * Creates a new DeleteGuardrailRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DeleteGuardrailRequest - * @static - * @param {google.cloud.ces.v1.IDeleteGuardrailRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DeleteGuardrailRequest} DeleteGuardrailRequest instance - */ - DeleteGuardrailRequest.create = function create(properties) { - return new DeleteGuardrailRequest(properties); - }; - - /** - * Encodes the specified DeleteGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteGuardrailRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DeleteGuardrailRequest - * @static - * @param {google.cloud.ces.v1.IDeleteGuardrailRequest} message DeleteGuardrailRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteGuardrailRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteGuardrailRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DeleteGuardrailRequest - * @static - * @param {google.cloud.ces.v1.IDeleteGuardrailRequest} message DeleteGuardrailRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteGuardrailRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DeleteGuardrailRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DeleteGuardrailRequest} DeleteGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteGuardrailRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DeleteGuardrailRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.force = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteGuardrailRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DeleteGuardrailRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DeleteGuardrailRequest} DeleteGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteGuardrailRequest message. - * @function verify - * @memberof google.cloud.ces.v1.DeleteGuardrailRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteGuardrailRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteGuardrailRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DeleteGuardrailRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DeleteGuardrailRequest} DeleteGuardrailRequest - */ - DeleteGuardrailRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DeleteGuardrailRequest) - return object; - var message = new $root.google.cloud.ces.v1.DeleteGuardrailRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.force != null) - message.force = Boolean(object.force); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteGuardrailRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DeleteGuardrailRequest - * @static - * @param {google.cloud.ces.v1.DeleteGuardrailRequest} message DeleteGuardrailRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteGuardrailRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.force = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteGuardrailRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DeleteGuardrailRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteGuardrailRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteGuardrailRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DeleteGuardrailRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DeleteGuardrailRequest"; - }; - - return DeleteGuardrailRequest; - })(); - - v1.ListDeploymentsRequest = (function() { - - /** - * Properties of a ListDeploymentsRequest. - * @memberof google.cloud.ces.v1 - * @interface IListDeploymentsRequest - * @property {string|null} [parent] ListDeploymentsRequest parent - * @property {number|null} [pageSize] ListDeploymentsRequest pageSize - * @property {string|null} [pageToken] ListDeploymentsRequest pageToken - * @property {string|null} [orderBy] ListDeploymentsRequest orderBy - */ - - /** - * Constructs a new ListDeploymentsRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListDeploymentsRequest. - * @implements IListDeploymentsRequest - * @constructor - * @param {google.cloud.ces.v1.IListDeploymentsRequest=} [properties] Properties to set - */ - function ListDeploymentsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDeploymentsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.ListDeploymentsRequest - * @instance - */ - ListDeploymentsRequest.prototype.parent = ""; - - /** - * ListDeploymentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1.ListDeploymentsRequest - * @instance - */ - ListDeploymentsRequest.prototype.pageSize = 0; - - /** - * ListDeploymentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1.ListDeploymentsRequest - * @instance - */ - ListDeploymentsRequest.prototype.pageToken = ""; - - /** - * ListDeploymentsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1.ListDeploymentsRequest - * @instance - */ - ListDeploymentsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListDeploymentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListDeploymentsRequest - * @static - * @param {google.cloud.ces.v1.IListDeploymentsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListDeploymentsRequest} ListDeploymentsRequest instance - */ - ListDeploymentsRequest.create = function create(properties) { - return new ListDeploymentsRequest(properties); - }; - - /** - * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListDeploymentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListDeploymentsRequest - * @static - * @param {google.cloud.ces.v1.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDeploymentsRequest.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListDeploymentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListDeploymentsRequest - * @static - * @param {google.cloud.ces.v1.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDeploymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDeploymentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListDeploymentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListDeploymentsRequest} ListDeploymentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDeploymentsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListDeploymentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListDeploymentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListDeploymentsRequest} ListDeploymentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDeploymentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDeploymentsRequest message. - * @function verify - * @memberof google.cloud.ces.v1.ListDeploymentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDeploymentsRequest.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.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; - - /** - * Creates a ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListDeploymentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListDeploymentsRequest} ListDeploymentsRequest - */ - ListDeploymentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListDeploymentsRequest) - return object; - var message = new $root.google.cloud.ces.v1.ListDeploymentsRequest(); - 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.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListDeploymentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListDeploymentsRequest - * @static - * @param {google.cloud.ces.v1.ListDeploymentsRequest} message ListDeploymentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDeploymentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - 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.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListDeploymentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListDeploymentsRequest - * @instance - * @returns {Object.} JSON object - */ - ListDeploymentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDeploymentsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListDeploymentsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDeploymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListDeploymentsRequest"; - }; - - return ListDeploymentsRequest; - })(); - - v1.ListDeploymentsResponse = (function() { - - /** - * Properties of a ListDeploymentsResponse. - * @memberof google.cloud.ces.v1 - * @interface IListDeploymentsResponse - * @property {Array.|null} [deployments] ListDeploymentsResponse deployments - * @property {string|null} [nextPageToken] ListDeploymentsResponse nextPageToken - */ - - /** - * Constructs a new ListDeploymentsResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListDeploymentsResponse. - * @implements IListDeploymentsResponse - * @constructor - * @param {google.cloud.ces.v1.IListDeploymentsResponse=} [properties] Properties to set - */ - function ListDeploymentsResponse(properties) { - this.deployments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDeploymentsResponse deployments. - * @member {Array.} deployments - * @memberof google.cloud.ces.v1.ListDeploymentsResponse - * @instance - */ - ListDeploymentsResponse.prototype.deployments = $util.emptyArray; - - /** - * ListDeploymentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1.ListDeploymentsResponse - * @instance - */ - ListDeploymentsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListDeploymentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListDeploymentsResponse - * @static - * @param {google.cloud.ces.v1.IListDeploymentsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListDeploymentsResponse} ListDeploymentsResponse instance - */ - ListDeploymentsResponse.create = function create(properties) { - return new ListDeploymentsResponse(properties); - }; - - /** - * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListDeploymentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListDeploymentsResponse - * @static - * @param {google.cloud.ces.v1.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDeploymentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deployments != null && message.deployments.length) - for (var i = 0; i < message.deployments.length; ++i) - $root.google.cloud.ces.v1.Deployment.encode(message.deployments[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 ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListDeploymentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListDeploymentsResponse - * @static - * @param {google.cloud.ces.v1.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDeploymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDeploymentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListDeploymentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListDeploymentsResponse} ListDeploymentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDeploymentsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListDeploymentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.deployments && message.deployments.length)) - message.deployments = []; - message.deployments.push($root.google.cloud.ces.v1.Deployment.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListDeploymentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListDeploymentsResponse} ListDeploymentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDeploymentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDeploymentsResponse message. - * @function verify - * @memberof google.cloud.ces.v1.ListDeploymentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDeploymentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deployments != null && message.hasOwnProperty("deployments")) { - if (!Array.isArray(message.deployments)) - return "deployments: array expected"; - for (var i = 0; i < message.deployments.length; ++i) { - var error = $root.google.cloud.ces.v1.Deployment.verify(message.deployments[i]); - if (error) - return "deployments." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListDeploymentsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListDeploymentsResponse} ListDeploymentsResponse - */ - ListDeploymentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListDeploymentsResponse) - return object; - var message = new $root.google.cloud.ces.v1.ListDeploymentsResponse(); - if (object.deployments) { - if (!Array.isArray(object.deployments)) - throw TypeError(".google.cloud.ces.v1.ListDeploymentsResponse.deployments: array expected"); - message.deployments = []; - for (var i = 0; i < object.deployments.length; ++i) { - if (typeof object.deployments[i] !== "object") - throw TypeError(".google.cloud.ces.v1.ListDeploymentsResponse.deployments: object expected"); - message.deployments[i] = $root.google.cloud.ces.v1.Deployment.fromObject(object.deployments[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListDeploymentsResponse - * @static - * @param {google.cloud.ces.v1.ListDeploymentsResponse} message ListDeploymentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDeploymentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.deployments = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.deployments && message.deployments.length) { - object.deployments = []; - for (var j = 0; j < message.deployments.length; ++j) - object.deployments[j] = $root.google.cloud.ces.v1.Deployment.toObject(message.deployments[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListDeploymentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListDeploymentsResponse - * @instance - * @returns {Object.} JSON object - */ - ListDeploymentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDeploymentsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListDeploymentsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDeploymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListDeploymentsResponse"; - }; - - return ListDeploymentsResponse; - })(); - - v1.GetDeploymentRequest = (function() { - - /** - * Properties of a GetDeploymentRequest. - * @memberof google.cloud.ces.v1 - * @interface IGetDeploymentRequest - * @property {string|null} [name] GetDeploymentRequest name - */ - - /** - * Constructs a new GetDeploymentRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a GetDeploymentRequest. - * @implements IGetDeploymentRequest - * @constructor - * @param {google.cloud.ces.v1.IGetDeploymentRequest=} [properties] Properties to set - */ - function GetDeploymentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDeploymentRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.GetDeploymentRequest - * @instance - */ - GetDeploymentRequest.prototype.name = ""; - - /** - * Creates a new GetDeploymentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.GetDeploymentRequest - * @static - * @param {google.cloud.ces.v1.IGetDeploymentRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.GetDeploymentRequest} GetDeploymentRequest instance - */ - GetDeploymentRequest.create = function create(properties) { - return new GetDeploymentRequest(properties); - }; - - /** - * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1.GetDeploymentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.GetDeploymentRequest - * @static - * @param {google.cloud.ces.v1.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDeploymentRequest.encode = function encode(message, writer) { - 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 GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetDeploymentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.GetDeploymentRequest - * @static - * @param {google.cloud.ces.v1.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDeploymentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.GetDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.GetDeploymentRequest} GetDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDeploymentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetDeploymentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDeploymentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.GetDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.GetDeploymentRequest} GetDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDeploymentRequest message. - * @function verify - * @memberof google.cloud.ces.v1.GetDeploymentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDeploymentRequest.verify = function verify(message) { - if (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 GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.GetDeploymentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.GetDeploymentRequest} GetDeploymentRequest - */ - GetDeploymentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.GetDeploymentRequest) - return object; - var message = new $root.google.cloud.ces.v1.GetDeploymentRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.GetDeploymentRequest - * @static - * @param {google.cloud.ces.v1.GetDeploymentRequest} message GetDeploymentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDeploymentRequest.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 GetDeploymentRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.GetDeploymentRequest - * @instance - * @returns {Object.} JSON object - */ - GetDeploymentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetDeploymentRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.GetDeploymentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.GetDeploymentRequest"; - }; - - return GetDeploymentRequest; - })(); - - v1.CreateDeploymentRequest = (function() { - - /** - * Properties of a CreateDeploymentRequest. - * @memberof google.cloud.ces.v1 - * @interface ICreateDeploymentRequest - * @property {string|null} [parent] CreateDeploymentRequest parent - * @property {string|null} [deploymentId] CreateDeploymentRequest deploymentId - * @property {google.cloud.ces.v1.IDeployment|null} [deployment] CreateDeploymentRequest deployment - */ - - /** - * Constructs a new CreateDeploymentRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a CreateDeploymentRequest. - * @implements ICreateDeploymentRequest - * @constructor - * @param {google.cloud.ces.v1.ICreateDeploymentRequest=} [properties] Properties to set - */ - function CreateDeploymentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateDeploymentRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.CreateDeploymentRequest - * @instance - */ - CreateDeploymentRequest.prototype.parent = ""; - - /** - * CreateDeploymentRequest deploymentId. - * @member {string} deploymentId - * @memberof google.cloud.ces.v1.CreateDeploymentRequest - * @instance - */ - CreateDeploymentRequest.prototype.deploymentId = ""; - - /** - * CreateDeploymentRequest deployment. - * @member {google.cloud.ces.v1.IDeployment|null|undefined} deployment - * @memberof google.cloud.ces.v1.CreateDeploymentRequest - * @instance - */ - CreateDeploymentRequest.prototype.deployment = null; - - /** - * Creates a new CreateDeploymentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.CreateDeploymentRequest - * @static - * @param {google.cloud.ces.v1.ICreateDeploymentRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.CreateDeploymentRequest} CreateDeploymentRequest instance - */ - CreateDeploymentRequest.create = function create(properties) { - return new CreateDeploymentRequest(properties); - }; - - /** - * Encodes the specified CreateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateDeploymentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.CreateDeploymentRequest - * @static - * @param {google.cloud.ces.v1.ICreateDeploymentRequest} message CreateDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDeploymentRequest.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.deployment != null && Object.hasOwnProperty.call(message, "deployment")) - $root.google.cloud.ces.v1.Deployment.encode(message.deployment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.deploymentId != null && Object.hasOwnProperty.call(message, "deploymentId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.deploymentId); - return writer; - }; - - /** - * Encodes the specified CreateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateDeploymentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.CreateDeploymentRequest - * @static - * @param {google.cloud.ces.v1.ICreateDeploymentRequest} message CreateDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateDeploymentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.CreateDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.CreateDeploymentRequest} CreateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDeploymentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CreateDeploymentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 3: { - message.deploymentId = reader.string(); - break; - } - case 2: { - message.deployment = $root.google.cloud.ces.v1.Deployment.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateDeploymentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.CreateDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.CreateDeploymentRequest} CreateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateDeploymentRequest message. - * @function verify - * @memberof google.cloud.ces.v1.CreateDeploymentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateDeploymentRequest.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.deploymentId != null && message.hasOwnProperty("deploymentId")) - if (!$util.isString(message.deploymentId)) - return "deploymentId: string expected"; - if (message.deployment != null && message.hasOwnProperty("deployment")) { - var error = $root.google.cloud.ces.v1.Deployment.verify(message.deployment); - if (error) - return "deployment." + error; - } - return null; - }; - - /** - * Creates a CreateDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.CreateDeploymentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.CreateDeploymentRequest} CreateDeploymentRequest - */ - CreateDeploymentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.CreateDeploymentRequest) - return object; - var message = new $root.google.cloud.ces.v1.CreateDeploymentRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.deploymentId != null) - message.deploymentId = String(object.deploymentId); - if (object.deployment != null) { - if (typeof object.deployment !== "object") - throw TypeError(".google.cloud.ces.v1.CreateDeploymentRequest.deployment: object expected"); - message.deployment = $root.google.cloud.ces.v1.Deployment.fromObject(object.deployment); - } - return message; - }; - - /** - * Creates a plain object from a CreateDeploymentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.CreateDeploymentRequest - * @static - * @param {google.cloud.ces.v1.CreateDeploymentRequest} message CreateDeploymentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateDeploymentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.deployment = null; - object.deploymentId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.deployment != null && message.hasOwnProperty("deployment")) - object.deployment = $root.google.cloud.ces.v1.Deployment.toObject(message.deployment, options); - if (message.deploymentId != null && message.hasOwnProperty("deploymentId")) - object.deploymentId = message.deploymentId; - return object; - }; - - /** - * Converts this CreateDeploymentRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.CreateDeploymentRequest - * @instance - * @returns {Object.} JSON object - */ - CreateDeploymentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateDeploymentRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.CreateDeploymentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.CreateDeploymentRequest"; - }; - - return CreateDeploymentRequest; - })(); - - v1.UpdateDeploymentRequest = (function() { - - /** - * Properties of an UpdateDeploymentRequest. - * @memberof google.cloud.ces.v1 - * @interface IUpdateDeploymentRequest - * @property {google.cloud.ces.v1.IDeployment|null} [deployment] UpdateDeploymentRequest deployment - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDeploymentRequest updateMask - */ - - /** - * Constructs a new UpdateDeploymentRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an UpdateDeploymentRequest. - * @implements IUpdateDeploymentRequest - * @constructor - * @param {google.cloud.ces.v1.IUpdateDeploymentRequest=} [properties] Properties to set - */ - function UpdateDeploymentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateDeploymentRequest deployment. - * @member {google.cloud.ces.v1.IDeployment|null|undefined} deployment - * @memberof google.cloud.ces.v1.UpdateDeploymentRequest - * @instance - */ - UpdateDeploymentRequest.prototype.deployment = null; - - /** - * UpdateDeploymentRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.ces.v1.UpdateDeploymentRequest - * @instance - */ - UpdateDeploymentRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateDeploymentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.UpdateDeploymentRequest - * @static - * @param {google.cloud.ces.v1.IUpdateDeploymentRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.UpdateDeploymentRequest} UpdateDeploymentRequest instance - */ - UpdateDeploymentRequest.create = function create(properties) { - return new UpdateDeploymentRequest(properties); - }; - - /** - * Encodes the specified UpdateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateDeploymentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.UpdateDeploymentRequest - * @static - * @param {google.cloud.ces.v1.IUpdateDeploymentRequest} message UpdateDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDeploymentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) - $root.google.cloud.ces.v1.Deployment.encode(message.deployment, 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 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateDeploymentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.UpdateDeploymentRequest - * @static - * @param {google.cloud.ces.v1.IUpdateDeploymentRequest} message UpdateDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDeploymentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.UpdateDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.UpdateDeploymentRequest} UpdateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDeploymentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.UpdateDeploymentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.deployment = $root.google.cloud.ces.v1.Deployment.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDeploymentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.UpdateDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.UpdateDeploymentRequest} UpdateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDeploymentRequest message. - * @function verify - * @memberof google.cloud.ces.v1.UpdateDeploymentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDeploymentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deployment != null && message.hasOwnProperty("deployment")) { - var error = $root.google.cloud.ces.v1.Deployment.verify(message.deployment); - if (error) - return "deployment." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.UpdateDeploymentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.UpdateDeploymentRequest} UpdateDeploymentRequest - */ - UpdateDeploymentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.UpdateDeploymentRequest) - return object; - var message = new $root.google.cloud.ces.v1.UpdateDeploymentRequest(); - if (object.deployment != null) { - if (typeof object.deployment !== "object") - throw TypeError(".google.cloud.ces.v1.UpdateDeploymentRequest.deployment: object expected"); - message.deployment = $root.google.cloud.ces.v1.Deployment.fromObject(object.deployment); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.ces.v1.UpdateDeploymentRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateDeploymentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.UpdateDeploymentRequest - * @static - * @param {google.cloud.ces.v1.UpdateDeploymentRequest} message UpdateDeploymentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDeploymentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.deployment = null; - object.updateMask = null; - } - if (message.deployment != null && message.hasOwnProperty("deployment")) - object.deployment = $root.google.cloud.ces.v1.Deployment.toObject(message.deployment, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateDeploymentRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.UpdateDeploymentRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateDeploymentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDeploymentRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.UpdateDeploymentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.UpdateDeploymentRequest"; - }; - - return UpdateDeploymentRequest; - })(); - - v1.DeleteDeploymentRequest = (function() { - - /** - * Properties of a DeleteDeploymentRequest. - * @memberof google.cloud.ces.v1 - * @interface IDeleteDeploymentRequest - * @property {string|null} [name] DeleteDeploymentRequest name - * @property {string|null} [etag] DeleteDeploymentRequest etag - */ - - /** - * Constructs a new DeleteDeploymentRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a DeleteDeploymentRequest. - * @implements IDeleteDeploymentRequest - * @constructor - * @param {google.cloud.ces.v1.IDeleteDeploymentRequest=} [properties] Properties to set - */ - function DeleteDeploymentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteDeploymentRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.DeleteDeploymentRequest - * @instance - */ - DeleteDeploymentRequest.prototype.name = ""; - - /** - * DeleteDeploymentRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1.DeleteDeploymentRequest - * @instance - */ - DeleteDeploymentRequest.prototype.etag = ""; - - /** - * Creates a new DeleteDeploymentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DeleteDeploymentRequest - * @static - * @param {google.cloud.ces.v1.IDeleteDeploymentRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DeleteDeploymentRequest} DeleteDeploymentRequest instance - */ - DeleteDeploymentRequest.create = function create(properties) { - return new DeleteDeploymentRequest(properties); - }; - - /** - * Encodes the specified DeleteDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteDeploymentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DeleteDeploymentRequest - * @static - * @param {google.cloud.ces.v1.IDeleteDeploymentRequest} message DeleteDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteDeploymentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteDeploymentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DeleteDeploymentRequest - * @static - * @param {google.cloud.ces.v1.IDeleteDeploymentRequest} message DeleteDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteDeploymentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DeleteDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DeleteDeploymentRequest} DeleteDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteDeploymentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DeleteDeploymentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteDeploymentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DeleteDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DeleteDeploymentRequest} DeleteDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteDeploymentRequest message. - * @function verify - * @memberof google.cloud.ces.v1.DeleteDeploymentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteDeploymentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DeleteDeploymentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DeleteDeploymentRequest} DeleteDeploymentRequest - */ - DeleteDeploymentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DeleteDeploymentRequest) - return object; - var message = new $root.google.cloud.ces.v1.DeleteDeploymentRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteDeploymentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DeleteDeploymentRequest - * @static - * @param {google.cloud.ces.v1.DeleteDeploymentRequest} message DeleteDeploymentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteDeploymentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteDeploymentRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DeleteDeploymentRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteDeploymentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteDeploymentRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DeleteDeploymentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DeleteDeploymentRequest"; - }; - - return DeleteDeploymentRequest; - })(); - - v1.ListToolsetsRequest = (function() { - - /** - * Properties of a ListToolsetsRequest. - * @memberof google.cloud.ces.v1 - * @interface IListToolsetsRequest - * @property {string|null} [parent] ListToolsetsRequest parent - * @property {number|null} [pageSize] ListToolsetsRequest pageSize - * @property {string|null} [pageToken] ListToolsetsRequest pageToken - * @property {string|null} [filter] ListToolsetsRequest filter - * @property {string|null} [orderBy] ListToolsetsRequest orderBy - */ - - /** - * Constructs a new ListToolsetsRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListToolsetsRequest. - * @implements IListToolsetsRequest - * @constructor - * @param {google.cloud.ces.v1.IListToolsetsRequest=} [properties] Properties to set - */ - function ListToolsetsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListToolsetsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.ListToolsetsRequest - * @instance - */ - ListToolsetsRequest.prototype.parent = ""; - - /** - * ListToolsetsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1.ListToolsetsRequest - * @instance - */ - ListToolsetsRequest.prototype.pageSize = 0; - - /** - * ListToolsetsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1.ListToolsetsRequest - * @instance - */ - ListToolsetsRequest.prototype.pageToken = ""; - - /** - * ListToolsetsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1.ListToolsetsRequest - * @instance - */ - ListToolsetsRequest.prototype.filter = ""; - - /** - * ListToolsetsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1.ListToolsetsRequest - * @instance - */ - ListToolsetsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListToolsetsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListToolsetsRequest - * @static - * @param {google.cloud.ces.v1.IListToolsetsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListToolsetsRequest} ListToolsetsRequest instance - */ - ListToolsetsRequest.create = function create(properties) { - return new ListToolsetsRequest(properties); - }; - - /** - * Encodes the specified ListToolsetsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListToolsetsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListToolsetsRequest - * @static - * @param {google.cloud.ces.v1.IListToolsetsRequest} message ListToolsetsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListToolsetsRequest.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 ListToolsetsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListToolsetsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListToolsetsRequest - * @static - * @param {google.cloud.ces.v1.IListToolsetsRequest} message ListToolsetsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListToolsetsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListToolsetsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListToolsetsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListToolsetsRequest} ListToolsetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListToolsetsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListToolsetsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListToolsetsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListToolsetsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListToolsetsRequest} ListToolsetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListToolsetsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListToolsetsRequest message. - * @function verify - * @memberof google.cloud.ces.v1.ListToolsetsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListToolsetsRequest.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 ListToolsetsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListToolsetsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListToolsetsRequest} ListToolsetsRequest - */ - ListToolsetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListToolsetsRequest) - return object; - var message = new $root.google.cloud.ces.v1.ListToolsetsRequest(); - 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 ListToolsetsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListToolsetsRequest - * @static - * @param {google.cloud.ces.v1.ListToolsetsRequest} message ListToolsetsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListToolsetsRequest.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 ListToolsetsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListToolsetsRequest - * @instance - * @returns {Object.} JSON object - */ - ListToolsetsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListToolsetsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListToolsetsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListToolsetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListToolsetsRequest"; - }; - - return ListToolsetsRequest; - })(); - - v1.ListToolsetsResponse = (function() { - - /** - * Properties of a ListToolsetsResponse. - * @memberof google.cloud.ces.v1 - * @interface IListToolsetsResponse - * @property {Array.|null} [toolsets] ListToolsetsResponse toolsets - * @property {string|null} [nextPageToken] ListToolsetsResponse nextPageToken - */ - - /** - * Constructs a new ListToolsetsResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListToolsetsResponse. - * @implements IListToolsetsResponse - * @constructor - * @param {google.cloud.ces.v1.IListToolsetsResponse=} [properties] Properties to set - */ - function ListToolsetsResponse(properties) { - this.toolsets = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListToolsetsResponse toolsets. - * @member {Array.} toolsets - * @memberof google.cloud.ces.v1.ListToolsetsResponse - * @instance - */ - ListToolsetsResponse.prototype.toolsets = $util.emptyArray; - - /** - * ListToolsetsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1.ListToolsetsResponse - * @instance - */ - ListToolsetsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListToolsetsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListToolsetsResponse - * @static - * @param {google.cloud.ces.v1.IListToolsetsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListToolsetsResponse} ListToolsetsResponse instance - */ - ListToolsetsResponse.create = function create(properties) { - return new ListToolsetsResponse(properties); - }; - - /** - * Encodes the specified ListToolsetsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListToolsetsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListToolsetsResponse - * @static - * @param {google.cloud.ces.v1.IListToolsetsResponse} message ListToolsetsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListToolsetsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolsets != null && message.toolsets.length) - for (var i = 0; i < message.toolsets.length; ++i) - $root.google.cloud.ces.v1.Toolset.encode(message.toolsets[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 ListToolsetsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListToolsetsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListToolsetsResponse - * @static - * @param {google.cloud.ces.v1.IListToolsetsResponse} message ListToolsetsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListToolsetsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListToolsetsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListToolsetsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListToolsetsResponse} ListToolsetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListToolsetsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListToolsetsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.toolsets && message.toolsets.length)) - message.toolsets = []; - message.toolsets.push($root.google.cloud.ces.v1.Toolset.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListToolsetsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListToolsetsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListToolsetsResponse} ListToolsetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListToolsetsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListToolsetsResponse message. - * @function verify - * @memberof google.cloud.ces.v1.ListToolsetsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListToolsetsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.toolsets != null && message.hasOwnProperty("toolsets")) { - if (!Array.isArray(message.toolsets)) - return "toolsets: array expected"; - for (var i = 0; i < message.toolsets.length; ++i) { - var error = $root.google.cloud.ces.v1.Toolset.verify(message.toolsets[i]); - if (error) - return "toolsets." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListToolsetsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListToolsetsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListToolsetsResponse} ListToolsetsResponse - */ - ListToolsetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListToolsetsResponse) - return object; - var message = new $root.google.cloud.ces.v1.ListToolsetsResponse(); - if (object.toolsets) { - if (!Array.isArray(object.toolsets)) - throw TypeError(".google.cloud.ces.v1.ListToolsetsResponse.toolsets: array expected"); - message.toolsets = []; - for (var i = 0; i < object.toolsets.length; ++i) { - if (typeof object.toolsets[i] !== "object") - throw TypeError(".google.cloud.ces.v1.ListToolsetsResponse.toolsets: object expected"); - message.toolsets[i] = $root.google.cloud.ces.v1.Toolset.fromObject(object.toolsets[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListToolsetsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListToolsetsResponse - * @static - * @param {google.cloud.ces.v1.ListToolsetsResponse} message ListToolsetsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListToolsetsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.toolsets = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.toolsets && message.toolsets.length) { - object.toolsets = []; - for (var j = 0; j < message.toolsets.length; ++j) - object.toolsets[j] = $root.google.cloud.ces.v1.Toolset.toObject(message.toolsets[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListToolsetsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListToolsetsResponse - * @instance - * @returns {Object.} JSON object - */ - ListToolsetsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListToolsetsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListToolsetsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListToolsetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListToolsetsResponse"; - }; - - return ListToolsetsResponse; - })(); - - v1.GetToolsetRequest = (function() { - - /** - * Properties of a GetToolsetRequest. - * @memberof google.cloud.ces.v1 - * @interface IGetToolsetRequest - * @property {string|null} [name] GetToolsetRequest name - */ - - /** - * Constructs a new GetToolsetRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a GetToolsetRequest. - * @implements IGetToolsetRequest - * @constructor - * @param {google.cloud.ces.v1.IGetToolsetRequest=} [properties] Properties to set - */ - function GetToolsetRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetToolsetRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.GetToolsetRequest - * @instance - */ - GetToolsetRequest.prototype.name = ""; - - /** - * Creates a new GetToolsetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.GetToolsetRequest - * @static - * @param {google.cloud.ces.v1.IGetToolsetRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.GetToolsetRequest} GetToolsetRequest instance - */ - GetToolsetRequest.create = function create(properties) { - return new GetToolsetRequest(properties); - }; - - /** - * Encodes the specified GetToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1.GetToolsetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.GetToolsetRequest - * @static - * @param {google.cloud.ces.v1.IGetToolsetRequest} message GetToolsetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetToolsetRequest.encode = function encode(message, writer) { - 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 GetToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetToolsetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.GetToolsetRequest - * @static - * @param {google.cloud.ces.v1.IGetToolsetRequest} message GetToolsetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetToolsetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.GetToolsetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.GetToolsetRequest} GetToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetToolsetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetToolsetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetToolsetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.GetToolsetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.GetToolsetRequest} GetToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetToolsetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetToolsetRequest message. - * @function verify - * @memberof google.cloud.ces.v1.GetToolsetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetToolsetRequest.verify = function verify(message) { - if (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 GetToolsetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.GetToolsetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.GetToolsetRequest} GetToolsetRequest - */ - GetToolsetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.GetToolsetRequest) - return object; - var message = new $root.google.cloud.ces.v1.GetToolsetRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetToolsetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.GetToolsetRequest - * @static - * @param {google.cloud.ces.v1.GetToolsetRequest} message GetToolsetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetToolsetRequest.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 GetToolsetRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.GetToolsetRequest - * @instance - * @returns {Object.} JSON object - */ - GetToolsetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetToolsetRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.GetToolsetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.GetToolsetRequest"; - }; - - return GetToolsetRequest; - })(); - - v1.CreateToolsetRequest = (function() { - - /** - * Properties of a CreateToolsetRequest. - * @memberof google.cloud.ces.v1 - * @interface ICreateToolsetRequest - * @property {string|null} [parent] CreateToolsetRequest parent - * @property {string|null} [toolsetId] CreateToolsetRequest toolsetId - * @property {google.cloud.ces.v1.IToolset|null} [toolset] CreateToolsetRequest toolset - */ - - /** - * Constructs a new CreateToolsetRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a CreateToolsetRequest. - * @implements ICreateToolsetRequest - * @constructor - * @param {google.cloud.ces.v1.ICreateToolsetRequest=} [properties] Properties to set - */ - function CreateToolsetRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateToolsetRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.CreateToolsetRequest - * @instance - */ - CreateToolsetRequest.prototype.parent = ""; - - /** - * CreateToolsetRequest toolsetId. - * @member {string} toolsetId - * @memberof google.cloud.ces.v1.CreateToolsetRequest - * @instance - */ - CreateToolsetRequest.prototype.toolsetId = ""; - - /** - * CreateToolsetRequest toolset. - * @member {google.cloud.ces.v1.IToolset|null|undefined} toolset - * @memberof google.cloud.ces.v1.CreateToolsetRequest - * @instance - */ - CreateToolsetRequest.prototype.toolset = null; - - /** - * Creates a new CreateToolsetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.CreateToolsetRequest - * @static - * @param {google.cloud.ces.v1.ICreateToolsetRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.CreateToolsetRequest} CreateToolsetRequest instance - */ - CreateToolsetRequest.create = function create(properties) { - return new CreateToolsetRequest(properties); - }; - - /** - * Encodes the specified CreateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateToolsetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.CreateToolsetRequest - * @static - * @param {google.cloud.ces.v1.ICreateToolsetRequest} message CreateToolsetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateToolsetRequest.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.toolsetId != null && Object.hasOwnProperty.call(message, "toolsetId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.toolsetId); - if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) - $root.google.cloud.ces.v1.Toolset.encode(message.toolset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateToolsetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.CreateToolsetRequest - * @static - * @param {google.cloud.ces.v1.ICreateToolsetRequest} message CreateToolsetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateToolsetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.CreateToolsetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.CreateToolsetRequest} CreateToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateToolsetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CreateToolsetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.toolsetId = reader.string(); - break; - } - case 3: { - message.toolset = $root.google.cloud.ces.v1.Toolset.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateToolsetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.CreateToolsetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.CreateToolsetRequest} CreateToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateToolsetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateToolsetRequest message. - * @function verify - * @memberof google.cloud.ces.v1.CreateToolsetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateToolsetRequest.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.toolsetId != null && message.hasOwnProperty("toolsetId")) - if (!$util.isString(message.toolsetId)) - return "toolsetId: string expected"; - if (message.toolset != null && message.hasOwnProperty("toolset")) { - var error = $root.google.cloud.ces.v1.Toolset.verify(message.toolset); - if (error) - return "toolset." + error; - } - return null; - }; - - /** - * Creates a CreateToolsetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.CreateToolsetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.CreateToolsetRequest} CreateToolsetRequest - */ - CreateToolsetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.CreateToolsetRequest) - return object; - var message = new $root.google.cloud.ces.v1.CreateToolsetRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.toolsetId != null) - message.toolsetId = String(object.toolsetId); - if (object.toolset != null) { - if (typeof object.toolset !== "object") - throw TypeError(".google.cloud.ces.v1.CreateToolsetRequest.toolset: object expected"); - message.toolset = $root.google.cloud.ces.v1.Toolset.fromObject(object.toolset); - } - return message; - }; - - /** - * Creates a plain object from a CreateToolsetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.CreateToolsetRequest - * @static - * @param {google.cloud.ces.v1.CreateToolsetRequest} message CreateToolsetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateToolsetRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.toolsetId = ""; - object.toolset = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.toolsetId != null && message.hasOwnProperty("toolsetId")) - object.toolsetId = message.toolsetId; - if (message.toolset != null && message.hasOwnProperty("toolset")) - object.toolset = $root.google.cloud.ces.v1.Toolset.toObject(message.toolset, options); - return object; - }; - - /** - * Converts this CreateToolsetRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.CreateToolsetRequest - * @instance - * @returns {Object.} JSON object - */ - CreateToolsetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateToolsetRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.CreateToolsetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.CreateToolsetRequest"; - }; - - return CreateToolsetRequest; - })(); - - v1.UpdateToolsetRequest = (function() { - - /** - * Properties of an UpdateToolsetRequest. - * @memberof google.cloud.ces.v1 - * @interface IUpdateToolsetRequest - * @property {google.cloud.ces.v1.IToolset|null} [toolset] UpdateToolsetRequest toolset - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateToolsetRequest updateMask - */ - - /** - * Constructs a new UpdateToolsetRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an UpdateToolsetRequest. - * @implements IUpdateToolsetRequest - * @constructor - * @param {google.cloud.ces.v1.IUpdateToolsetRequest=} [properties] Properties to set - */ - function UpdateToolsetRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateToolsetRequest toolset. - * @member {google.cloud.ces.v1.IToolset|null|undefined} toolset - * @memberof google.cloud.ces.v1.UpdateToolsetRequest - * @instance - */ - UpdateToolsetRequest.prototype.toolset = null; - - /** - * UpdateToolsetRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.ces.v1.UpdateToolsetRequest - * @instance - */ - UpdateToolsetRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateToolsetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.UpdateToolsetRequest - * @static - * @param {google.cloud.ces.v1.IUpdateToolsetRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.UpdateToolsetRequest} UpdateToolsetRequest instance - */ - UpdateToolsetRequest.create = function create(properties) { - return new UpdateToolsetRequest(properties); - }; - - /** - * Encodes the specified UpdateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1.UpdateToolsetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.UpdateToolsetRequest - * @static - * @param {google.cloud.ces.v1.IUpdateToolsetRequest} message UpdateToolsetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateToolsetRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) - $root.google.cloud.ces.v1.Toolset.encode(message.toolset, 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 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.UpdateToolsetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.UpdateToolsetRequest - * @static - * @param {google.cloud.ces.v1.IUpdateToolsetRequest} message UpdateToolsetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateToolsetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.UpdateToolsetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.UpdateToolsetRequest} UpdateToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateToolsetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.UpdateToolsetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.toolset = $root.google.cloud.ces.v1.Toolset.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateToolsetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.UpdateToolsetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.UpdateToolsetRequest} UpdateToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateToolsetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateToolsetRequest message. - * @function verify - * @memberof google.cloud.ces.v1.UpdateToolsetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateToolsetRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.toolset != null && message.hasOwnProperty("toolset")) { - var error = $root.google.cloud.ces.v1.Toolset.verify(message.toolset); - if (error) - return "toolset." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateToolsetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.UpdateToolsetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.UpdateToolsetRequest} UpdateToolsetRequest - */ - UpdateToolsetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.UpdateToolsetRequest) - return object; - var message = new $root.google.cloud.ces.v1.UpdateToolsetRequest(); - if (object.toolset != null) { - if (typeof object.toolset !== "object") - throw TypeError(".google.cloud.ces.v1.UpdateToolsetRequest.toolset: object expected"); - message.toolset = $root.google.cloud.ces.v1.Toolset.fromObject(object.toolset); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.ces.v1.UpdateToolsetRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateToolsetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.UpdateToolsetRequest - * @static - * @param {google.cloud.ces.v1.UpdateToolsetRequest} message UpdateToolsetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateToolsetRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.toolset = null; - object.updateMask = null; - } - if (message.toolset != null && message.hasOwnProperty("toolset")) - object.toolset = $root.google.cloud.ces.v1.Toolset.toObject(message.toolset, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateToolsetRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.UpdateToolsetRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateToolsetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateToolsetRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.UpdateToolsetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.UpdateToolsetRequest"; - }; - - return UpdateToolsetRequest; - })(); - - v1.DeleteToolsetRequest = (function() { - - /** - * Properties of a DeleteToolsetRequest. - * @memberof google.cloud.ces.v1 - * @interface IDeleteToolsetRequest - * @property {string|null} [name] DeleteToolsetRequest name - * @property {boolean|null} [force] DeleteToolsetRequest force - * @property {string|null} [etag] DeleteToolsetRequest etag - */ - - /** - * Constructs a new DeleteToolsetRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a DeleteToolsetRequest. - * @implements IDeleteToolsetRequest - * @constructor - * @param {google.cloud.ces.v1.IDeleteToolsetRequest=} [properties] Properties to set - */ - function DeleteToolsetRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteToolsetRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.DeleteToolsetRequest - * @instance - */ - DeleteToolsetRequest.prototype.name = ""; - - /** - * DeleteToolsetRequest force. - * @member {boolean} force - * @memberof google.cloud.ces.v1.DeleteToolsetRequest - * @instance - */ - DeleteToolsetRequest.prototype.force = false; - - /** - * DeleteToolsetRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1.DeleteToolsetRequest - * @instance - */ - DeleteToolsetRequest.prototype.etag = ""; - - /** - * Creates a new DeleteToolsetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DeleteToolsetRequest - * @static - * @param {google.cloud.ces.v1.IDeleteToolsetRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DeleteToolsetRequest} DeleteToolsetRequest instance - */ - DeleteToolsetRequest.create = function create(properties) { - return new DeleteToolsetRequest(properties); - }; - - /** - * Encodes the specified DeleteToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteToolsetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DeleteToolsetRequest - * @static - * @param {google.cloud.ces.v1.IDeleteToolsetRequest} message DeleteToolsetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteToolsetRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteToolsetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DeleteToolsetRequest - * @static - * @param {google.cloud.ces.v1.IDeleteToolsetRequest} message DeleteToolsetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteToolsetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DeleteToolsetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DeleteToolsetRequest} DeleteToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteToolsetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DeleteToolsetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.force = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteToolsetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DeleteToolsetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DeleteToolsetRequest} DeleteToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteToolsetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteToolsetRequest message. - * @function verify - * @memberof google.cloud.ces.v1.DeleteToolsetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteToolsetRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteToolsetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DeleteToolsetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DeleteToolsetRequest} DeleteToolsetRequest - */ - DeleteToolsetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DeleteToolsetRequest) - return object; - var message = new $root.google.cloud.ces.v1.DeleteToolsetRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.force != null) - message.force = Boolean(object.force); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteToolsetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DeleteToolsetRequest - * @static - * @param {google.cloud.ces.v1.DeleteToolsetRequest} message DeleteToolsetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteToolsetRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.force = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteToolsetRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DeleteToolsetRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteToolsetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteToolsetRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DeleteToolsetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DeleteToolsetRequest"; - }; - - return DeleteToolsetRequest; - })(); - - v1.ListAppVersionsRequest = (function() { - - /** - * Properties of a ListAppVersionsRequest. - * @memberof google.cloud.ces.v1 - * @interface IListAppVersionsRequest - * @property {string|null} [parent] ListAppVersionsRequest parent - * @property {number|null} [pageSize] ListAppVersionsRequest pageSize - * @property {string|null} [pageToken] ListAppVersionsRequest pageToken - * @property {string|null} [filter] ListAppVersionsRequest filter - * @property {string|null} [orderBy] ListAppVersionsRequest orderBy - */ - - /** - * Constructs a new ListAppVersionsRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListAppVersionsRequest. - * @implements IListAppVersionsRequest - * @constructor - * @param {google.cloud.ces.v1.IListAppVersionsRequest=} [properties] Properties to set - */ - function ListAppVersionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAppVersionsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.ListAppVersionsRequest - * @instance - */ - ListAppVersionsRequest.prototype.parent = ""; - - /** - * ListAppVersionsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1.ListAppVersionsRequest - * @instance - */ - ListAppVersionsRequest.prototype.pageSize = 0; - - /** - * ListAppVersionsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1.ListAppVersionsRequest - * @instance - */ - ListAppVersionsRequest.prototype.pageToken = ""; - - /** - * ListAppVersionsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1.ListAppVersionsRequest - * @instance - */ - ListAppVersionsRequest.prototype.filter = ""; - - /** - * ListAppVersionsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1.ListAppVersionsRequest - * @instance - */ - ListAppVersionsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListAppVersionsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListAppVersionsRequest - * @static - * @param {google.cloud.ces.v1.IListAppVersionsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListAppVersionsRequest} ListAppVersionsRequest instance - */ - ListAppVersionsRequest.create = function create(properties) { - return new ListAppVersionsRequest(properties); - }; - - /** - * Encodes the specified ListAppVersionsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListAppVersionsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListAppVersionsRequest - * @static - * @param {google.cloud.ces.v1.IListAppVersionsRequest} message ListAppVersionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAppVersionsRequest.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 ListAppVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAppVersionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListAppVersionsRequest - * @static - * @param {google.cloud.ces.v1.IListAppVersionsRequest} message ListAppVersionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAppVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAppVersionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListAppVersionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListAppVersionsRequest} ListAppVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAppVersionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListAppVersionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAppVersionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListAppVersionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListAppVersionsRequest} ListAppVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAppVersionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAppVersionsRequest message. - * @function verify - * @memberof google.cloud.ces.v1.ListAppVersionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAppVersionsRequest.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 ListAppVersionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListAppVersionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListAppVersionsRequest} ListAppVersionsRequest - */ - ListAppVersionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListAppVersionsRequest) - return object; - var message = new $root.google.cloud.ces.v1.ListAppVersionsRequest(); - 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 ListAppVersionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListAppVersionsRequest - * @static - * @param {google.cloud.ces.v1.ListAppVersionsRequest} message ListAppVersionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAppVersionsRequest.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 ListAppVersionsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListAppVersionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListAppVersionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAppVersionsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListAppVersionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAppVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListAppVersionsRequest"; - }; - - return ListAppVersionsRequest; - })(); - - v1.ListAppVersionsResponse = (function() { - - /** - * Properties of a ListAppVersionsResponse. - * @memberof google.cloud.ces.v1 - * @interface IListAppVersionsResponse - * @property {Array.|null} [appVersions] ListAppVersionsResponse appVersions - * @property {string|null} [nextPageToken] ListAppVersionsResponse nextPageToken - */ - - /** - * Constructs a new ListAppVersionsResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListAppVersionsResponse. - * @implements IListAppVersionsResponse - * @constructor - * @param {google.cloud.ces.v1.IListAppVersionsResponse=} [properties] Properties to set - */ - function ListAppVersionsResponse(properties) { - this.appVersions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAppVersionsResponse appVersions. - * @member {Array.} appVersions - * @memberof google.cloud.ces.v1.ListAppVersionsResponse - * @instance - */ - ListAppVersionsResponse.prototype.appVersions = $util.emptyArray; - - /** - * ListAppVersionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1.ListAppVersionsResponse - * @instance - */ - ListAppVersionsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListAppVersionsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListAppVersionsResponse - * @static - * @param {google.cloud.ces.v1.IListAppVersionsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListAppVersionsResponse} ListAppVersionsResponse instance - */ - ListAppVersionsResponse.create = function create(properties) { - return new ListAppVersionsResponse(properties); - }; - - /** - * Encodes the specified ListAppVersionsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListAppVersionsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListAppVersionsResponse - * @static - * @param {google.cloud.ces.v1.IListAppVersionsResponse} message ListAppVersionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAppVersionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.appVersions != null && message.appVersions.length) - for (var i = 0; i < message.appVersions.length; ++i) - $root.google.cloud.ces.v1.AppVersion.encode(message.appVersions[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 ListAppVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListAppVersionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListAppVersionsResponse - * @static - * @param {google.cloud.ces.v1.IListAppVersionsResponse} message ListAppVersionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAppVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAppVersionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListAppVersionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListAppVersionsResponse} ListAppVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAppVersionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListAppVersionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.appVersions && message.appVersions.length)) - message.appVersions = []; - message.appVersions.push($root.google.cloud.ces.v1.AppVersion.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAppVersionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListAppVersionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListAppVersionsResponse} ListAppVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAppVersionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAppVersionsResponse message. - * @function verify - * @memberof google.cloud.ces.v1.ListAppVersionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAppVersionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.appVersions != null && message.hasOwnProperty("appVersions")) { - if (!Array.isArray(message.appVersions)) - return "appVersions: array expected"; - for (var i = 0; i < message.appVersions.length; ++i) { - var error = $root.google.cloud.ces.v1.AppVersion.verify(message.appVersions[i]); - if (error) - return "appVersions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListAppVersionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListAppVersionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListAppVersionsResponse} ListAppVersionsResponse - */ - ListAppVersionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListAppVersionsResponse) - return object; - var message = new $root.google.cloud.ces.v1.ListAppVersionsResponse(); - if (object.appVersions) { - if (!Array.isArray(object.appVersions)) - throw TypeError(".google.cloud.ces.v1.ListAppVersionsResponse.appVersions: array expected"); - message.appVersions = []; - for (var i = 0; i < object.appVersions.length; ++i) { - if (typeof object.appVersions[i] !== "object") - throw TypeError(".google.cloud.ces.v1.ListAppVersionsResponse.appVersions: object expected"); - message.appVersions[i] = $root.google.cloud.ces.v1.AppVersion.fromObject(object.appVersions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListAppVersionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListAppVersionsResponse - * @static - * @param {google.cloud.ces.v1.ListAppVersionsResponse} message ListAppVersionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAppVersionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.appVersions = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.appVersions && message.appVersions.length) { - object.appVersions = []; - for (var j = 0; j < message.appVersions.length; ++j) - object.appVersions[j] = $root.google.cloud.ces.v1.AppVersion.toObject(message.appVersions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListAppVersionsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListAppVersionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListAppVersionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAppVersionsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListAppVersionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAppVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListAppVersionsResponse"; - }; - - return ListAppVersionsResponse; - })(); - - v1.GetAppVersionRequest = (function() { - - /** - * Properties of a GetAppVersionRequest. - * @memberof google.cloud.ces.v1 - * @interface IGetAppVersionRequest - * @property {string|null} [name] GetAppVersionRequest name - */ - - /** - * Constructs a new GetAppVersionRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a GetAppVersionRequest. - * @implements IGetAppVersionRequest - * @constructor - * @param {google.cloud.ces.v1.IGetAppVersionRequest=} [properties] Properties to set - */ - function GetAppVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetAppVersionRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.GetAppVersionRequest - * @instance - */ - GetAppVersionRequest.prototype.name = ""; - - /** - * Creates a new GetAppVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.GetAppVersionRequest - * @static - * @param {google.cloud.ces.v1.IGetAppVersionRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.GetAppVersionRequest} GetAppVersionRequest instance - */ - GetAppVersionRequest.create = function create(properties) { - return new GetAppVersionRequest(properties); - }; - - /** - * Encodes the specified GetAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1.GetAppVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.GetAppVersionRequest - * @static - * @param {google.cloud.ces.v1.IGetAppVersionRequest} message GetAppVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAppVersionRequest.encode = function encode(message, writer) { - 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 GetAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetAppVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.GetAppVersionRequest - * @static - * @param {google.cloud.ces.v1.IGetAppVersionRequest} message GetAppVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetAppVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.GetAppVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.GetAppVersionRequest} GetAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAppVersionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetAppVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetAppVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.GetAppVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.GetAppVersionRequest} GetAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetAppVersionRequest message. - * @function verify - * @memberof google.cloud.ces.v1.GetAppVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetAppVersionRequest.verify = function verify(message) { - if (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 GetAppVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.GetAppVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.GetAppVersionRequest} GetAppVersionRequest - */ - GetAppVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.GetAppVersionRequest) - return object; - var message = new $root.google.cloud.ces.v1.GetAppVersionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetAppVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.GetAppVersionRequest - * @static - * @param {google.cloud.ces.v1.GetAppVersionRequest} message GetAppVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetAppVersionRequest.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 GetAppVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.GetAppVersionRequest - * @instance - * @returns {Object.} JSON object - */ - GetAppVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetAppVersionRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.GetAppVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.GetAppVersionRequest"; - }; - - return GetAppVersionRequest; - })(); - - v1.DeleteAppVersionRequest = (function() { - - /** - * Properties of a DeleteAppVersionRequest. - * @memberof google.cloud.ces.v1 - * @interface IDeleteAppVersionRequest - * @property {string|null} [name] DeleteAppVersionRequest name - * @property {string|null} [etag] DeleteAppVersionRequest etag - */ - - /** - * Constructs a new DeleteAppVersionRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a DeleteAppVersionRequest. - * @implements IDeleteAppVersionRequest - * @constructor - * @param {google.cloud.ces.v1.IDeleteAppVersionRequest=} [properties] Properties to set - */ - function DeleteAppVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteAppVersionRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.DeleteAppVersionRequest - * @instance - */ - DeleteAppVersionRequest.prototype.name = ""; - - /** - * DeleteAppVersionRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1.DeleteAppVersionRequest - * @instance - */ - DeleteAppVersionRequest.prototype.etag = ""; - - /** - * Creates a new DeleteAppVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DeleteAppVersionRequest - * @static - * @param {google.cloud.ces.v1.IDeleteAppVersionRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DeleteAppVersionRequest} DeleteAppVersionRequest instance - */ - DeleteAppVersionRequest.create = function create(properties) { - return new DeleteAppVersionRequest(properties); - }; - - /** - * Encodes the specified DeleteAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1.DeleteAppVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DeleteAppVersionRequest - * @static - * @param {google.cloud.ces.v1.IDeleteAppVersionRequest} message DeleteAppVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAppVersionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DeleteAppVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DeleteAppVersionRequest - * @static - * @param {google.cloud.ces.v1.IDeleteAppVersionRequest} message DeleteAppVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteAppVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DeleteAppVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DeleteAppVersionRequest} DeleteAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAppVersionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DeleteAppVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteAppVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DeleteAppVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DeleteAppVersionRequest} DeleteAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteAppVersionRequest message. - * @function verify - * @memberof google.cloud.ces.v1.DeleteAppVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteAppVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteAppVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DeleteAppVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DeleteAppVersionRequest} DeleteAppVersionRequest - */ - DeleteAppVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DeleteAppVersionRequest) - return object; - var message = new $root.google.cloud.ces.v1.DeleteAppVersionRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteAppVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DeleteAppVersionRequest - * @static - * @param {google.cloud.ces.v1.DeleteAppVersionRequest} message DeleteAppVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteAppVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteAppVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DeleteAppVersionRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteAppVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteAppVersionRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DeleteAppVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DeleteAppVersionRequest"; - }; - - return DeleteAppVersionRequest; - })(); - - v1.CreateAppVersionRequest = (function() { - - /** - * Properties of a CreateAppVersionRequest. - * @memberof google.cloud.ces.v1 - * @interface ICreateAppVersionRequest - * @property {string|null} [parent] CreateAppVersionRequest parent - * @property {string|null} [appVersionId] CreateAppVersionRequest appVersionId - * @property {google.cloud.ces.v1.IAppVersion|null} [appVersion] CreateAppVersionRequest appVersion - */ - - /** - * Constructs a new CreateAppVersionRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a CreateAppVersionRequest. - * @implements ICreateAppVersionRequest - * @constructor - * @param {google.cloud.ces.v1.ICreateAppVersionRequest=} [properties] Properties to set - */ - function CreateAppVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateAppVersionRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.CreateAppVersionRequest - * @instance - */ - CreateAppVersionRequest.prototype.parent = ""; - - /** - * CreateAppVersionRequest appVersionId. - * @member {string} appVersionId - * @memberof google.cloud.ces.v1.CreateAppVersionRequest - * @instance - */ - CreateAppVersionRequest.prototype.appVersionId = ""; - - /** - * CreateAppVersionRequest appVersion. - * @member {google.cloud.ces.v1.IAppVersion|null|undefined} appVersion - * @memberof google.cloud.ces.v1.CreateAppVersionRequest - * @instance - */ - CreateAppVersionRequest.prototype.appVersion = null; - - /** - * Creates a new CreateAppVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.CreateAppVersionRequest - * @static - * @param {google.cloud.ces.v1.ICreateAppVersionRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.CreateAppVersionRequest} CreateAppVersionRequest instance - */ - CreateAppVersionRequest.create = function create(properties) { - return new CreateAppVersionRequest(properties); - }; - - /** - * Encodes the specified CreateAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1.CreateAppVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.CreateAppVersionRequest - * @static - * @param {google.cloud.ces.v1.ICreateAppVersionRequest} message CreateAppVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAppVersionRequest.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.appVersionId != null && Object.hasOwnProperty.call(message, "appVersionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.appVersionId); - if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) - $root.google.cloud.ces.v1.AppVersion.encode(message.appVersion, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CreateAppVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.CreateAppVersionRequest - * @static - * @param {google.cloud.ces.v1.ICreateAppVersionRequest} message CreateAppVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateAppVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.CreateAppVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.CreateAppVersionRequest} CreateAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAppVersionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CreateAppVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.appVersionId = reader.string(); - break; - } - case 3: { - message.appVersion = $root.google.cloud.ces.v1.AppVersion.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateAppVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.CreateAppVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.CreateAppVersionRequest} CreateAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateAppVersionRequest message. - * @function verify - * @memberof google.cloud.ces.v1.CreateAppVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateAppVersionRequest.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.appVersionId != null && message.hasOwnProperty("appVersionId")) - if (!$util.isString(message.appVersionId)) - return "appVersionId: string expected"; - if (message.appVersion != null && message.hasOwnProperty("appVersion")) { - var error = $root.google.cloud.ces.v1.AppVersion.verify(message.appVersion); - if (error) - return "appVersion." + error; - } - return null; - }; - - /** - * Creates a CreateAppVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.CreateAppVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.CreateAppVersionRequest} CreateAppVersionRequest - */ - CreateAppVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.CreateAppVersionRequest) - return object; - var message = new $root.google.cloud.ces.v1.CreateAppVersionRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.appVersionId != null) - message.appVersionId = String(object.appVersionId); - if (object.appVersion != null) { - if (typeof object.appVersion !== "object") - throw TypeError(".google.cloud.ces.v1.CreateAppVersionRequest.appVersion: object expected"); - message.appVersion = $root.google.cloud.ces.v1.AppVersion.fromObject(object.appVersion); - } - return message; - }; - - /** - * Creates a plain object from a CreateAppVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.CreateAppVersionRequest - * @static - * @param {google.cloud.ces.v1.CreateAppVersionRequest} message CreateAppVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateAppVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.appVersionId = ""; - object.appVersion = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.appVersionId != null && message.hasOwnProperty("appVersionId")) - object.appVersionId = message.appVersionId; - if (message.appVersion != null && message.hasOwnProperty("appVersion")) - object.appVersion = $root.google.cloud.ces.v1.AppVersion.toObject(message.appVersion, options); - return object; - }; - - /** - * Converts this CreateAppVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.CreateAppVersionRequest - * @instance - * @returns {Object.} JSON object - */ - CreateAppVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateAppVersionRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.CreateAppVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.CreateAppVersionRequest"; - }; - - return CreateAppVersionRequest; - })(); - - v1.RestoreAppVersionRequest = (function() { - - /** - * Properties of a RestoreAppVersionRequest. - * @memberof google.cloud.ces.v1 - * @interface IRestoreAppVersionRequest - * @property {string|null} [name] RestoreAppVersionRequest name - */ - - /** - * Constructs a new RestoreAppVersionRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a RestoreAppVersionRequest. - * @implements IRestoreAppVersionRequest - * @constructor - * @param {google.cloud.ces.v1.IRestoreAppVersionRequest=} [properties] Properties to set - */ - function RestoreAppVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreAppVersionRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.RestoreAppVersionRequest - * @instance - */ - RestoreAppVersionRequest.prototype.name = ""; - - /** - * Creates a new RestoreAppVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.RestoreAppVersionRequest - * @static - * @param {google.cloud.ces.v1.IRestoreAppVersionRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.RestoreAppVersionRequest} RestoreAppVersionRequest instance - */ - RestoreAppVersionRequest.create = function create(properties) { - return new RestoreAppVersionRequest(properties); - }; - - /** - * Encodes the specified RestoreAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1.RestoreAppVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.RestoreAppVersionRequest - * @static - * @param {google.cloud.ces.v1.IRestoreAppVersionRequest} message RestoreAppVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreAppVersionRequest.encode = function encode(message, writer) { - 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 RestoreAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RestoreAppVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.RestoreAppVersionRequest - * @static - * @param {google.cloud.ces.v1.IRestoreAppVersionRequest} message RestoreAppVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreAppVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.RestoreAppVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.RestoreAppVersionRequest} RestoreAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreAppVersionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RestoreAppVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreAppVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.RestoreAppVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.RestoreAppVersionRequest} RestoreAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreAppVersionRequest message. - * @function verify - * @memberof google.cloud.ces.v1.RestoreAppVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreAppVersionRequest.verify = function verify(message) { - if (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 RestoreAppVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.RestoreAppVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.RestoreAppVersionRequest} RestoreAppVersionRequest - */ - RestoreAppVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.RestoreAppVersionRequest) - return object; - var message = new $root.google.cloud.ces.v1.RestoreAppVersionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a RestoreAppVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.RestoreAppVersionRequest - * @static - * @param {google.cloud.ces.v1.RestoreAppVersionRequest} message RestoreAppVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreAppVersionRequest.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 RestoreAppVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.RestoreAppVersionRequest - * @instance - * @returns {Object.} JSON object - */ - RestoreAppVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreAppVersionRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.RestoreAppVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.RestoreAppVersionRequest"; - }; - - return RestoreAppVersionRequest; - })(); - - v1.RestoreAppVersionResponse = (function() { - - /** - * Properties of a RestoreAppVersionResponse. - * @memberof google.cloud.ces.v1 - * @interface IRestoreAppVersionResponse - */ - - /** - * Constructs a new RestoreAppVersionResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a RestoreAppVersionResponse. - * @implements IRestoreAppVersionResponse - * @constructor - * @param {google.cloud.ces.v1.IRestoreAppVersionResponse=} [properties] Properties to set - */ - function RestoreAppVersionResponse(properties) { - if (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 RestoreAppVersionResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.RestoreAppVersionResponse - * @static - * @param {google.cloud.ces.v1.IRestoreAppVersionResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.RestoreAppVersionResponse} RestoreAppVersionResponse instance - */ - RestoreAppVersionResponse.create = function create(properties) { - return new RestoreAppVersionResponse(properties); - }; - - /** - * Encodes the specified RestoreAppVersionResponse message. Does not implicitly {@link google.cloud.ces.v1.RestoreAppVersionResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.RestoreAppVersionResponse - * @static - * @param {google.cloud.ces.v1.IRestoreAppVersionResponse} message RestoreAppVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreAppVersionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified RestoreAppVersionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RestoreAppVersionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.RestoreAppVersionResponse - * @static - * @param {google.cloud.ces.v1.IRestoreAppVersionResponse} message RestoreAppVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreAppVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreAppVersionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.RestoreAppVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.RestoreAppVersionResponse} RestoreAppVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreAppVersionResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RestoreAppVersionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreAppVersionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.RestoreAppVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.RestoreAppVersionResponse} RestoreAppVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreAppVersionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreAppVersionResponse message. - * @function verify - * @memberof google.cloud.ces.v1.RestoreAppVersionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreAppVersionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a RestoreAppVersionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.RestoreAppVersionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.RestoreAppVersionResponse} RestoreAppVersionResponse - */ - RestoreAppVersionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.RestoreAppVersionResponse) - return object; - return new $root.google.cloud.ces.v1.RestoreAppVersionResponse(); - }; - - /** - * Creates a plain object from a RestoreAppVersionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.RestoreAppVersionResponse - * @static - * @param {google.cloud.ces.v1.RestoreAppVersionResponse} message RestoreAppVersionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreAppVersionResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this RestoreAppVersionResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.RestoreAppVersionResponse - * @instance - * @returns {Object.} JSON object - */ - RestoreAppVersionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreAppVersionResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.RestoreAppVersionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreAppVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.RestoreAppVersionResponse"; - }; - - return RestoreAppVersionResponse; - })(); - - v1.ListChangelogsRequest = (function() { - - /** - * Properties of a ListChangelogsRequest. - * @memberof google.cloud.ces.v1 - * @interface IListChangelogsRequest - * @property {string|null} [parent] ListChangelogsRequest parent - * @property {number|null} [pageSize] ListChangelogsRequest pageSize - * @property {string|null} [pageToken] ListChangelogsRequest pageToken - * @property {string|null} [filter] ListChangelogsRequest filter - * @property {string|null} [orderBy] ListChangelogsRequest orderBy - */ - - /** - * Constructs a new ListChangelogsRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListChangelogsRequest. - * @implements IListChangelogsRequest - * @constructor - * @param {google.cloud.ces.v1.IListChangelogsRequest=} [properties] Properties to set - */ - function ListChangelogsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListChangelogsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.ListChangelogsRequest - * @instance - */ - ListChangelogsRequest.prototype.parent = ""; - - /** - * ListChangelogsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1.ListChangelogsRequest - * @instance - */ - ListChangelogsRequest.prototype.pageSize = 0; - - /** - * ListChangelogsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1.ListChangelogsRequest - * @instance - */ - ListChangelogsRequest.prototype.pageToken = ""; - - /** - * ListChangelogsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1.ListChangelogsRequest - * @instance - */ - ListChangelogsRequest.prototype.filter = ""; - - /** - * ListChangelogsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1.ListChangelogsRequest - * @instance - */ - ListChangelogsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListChangelogsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListChangelogsRequest - * @static - * @param {google.cloud.ces.v1.IListChangelogsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListChangelogsRequest} ListChangelogsRequest instance - */ - ListChangelogsRequest.create = function create(properties) { - return new ListChangelogsRequest(properties); - }; - - /** - * Encodes the specified ListChangelogsRequest message. Does not implicitly {@link google.cloud.ces.v1.ListChangelogsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListChangelogsRequest - * @static - * @param {google.cloud.ces.v1.IListChangelogsRequest} message ListChangelogsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListChangelogsRequest.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 ListChangelogsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListChangelogsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListChangelogsRequest - * @static - * @param {google.cloud.ces.v1.IListChangelogsRequest} message ListChangelogsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListChangelogsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListChangelogsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListChangelogsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListChangelogsRequest} ListChangelogsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListChangelogsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListChangelogsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListChangelogsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListChangelogsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListChangelogsRequest} ListChangelogsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListChangelogsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListChangelogsRequest message. - * @function verify - * @memberof google.cloud.ces.v1.ListChangelogsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListChangelogsRequest.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 ListChangelogsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListChangelogsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListChangelogsRequest} ListChangelogsRequest - */ - ListChangelogsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListChangelogsRequest) - return object; - var message = new $root.google.cloud.ces.v1.ListChangelogsRequest(); - 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 ListChangelogsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListChangelogsRequest - * @static - * @param {google.cloud.ces.v1.ListChangelogsRequest} message ListChangelogsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListChangelogsRequest.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 ListChangelogsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListChangelogsRequest - * @instance - * @returns {Object.} JSON object - */ - ListChangelogsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListChangelogsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListChangelogsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListChangelogsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListChangelogsRequest"; - }; - - return ListChangelogsRequest; - })(); - - v1.ListChangelogsResponse = (function() { - - /** - * Properties of a ListChangelogsResponse. - * @memberof google.cloud.ces.v1 - * @interface IListChangelogsResponse - * @property {Array.|null} [changelogs] ListChangelogsResponse changelogs - * @property {string|null} [nextPageToken] ListChangelogsResponse nextPageToken - */ - - /** - * Constructs a new ListChangelogsResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ListChangelogsResponse. - * @implements IListChangelogsResponse - * @constructor - * @param {google.cloud.ces.v1.IListChangelogsResponse=} [properties] Properties to set - */ - function ListChangelogsResponse(properties) { - this.changelogs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListChangelogsResponse changelogs. - * @member {Array.} changelogs - * @memberof google.cloud.ces.v1.ListChangelogsResponse - * @instance - */ - ListChangelogsResponse.prototype.changelogs = $util.emptyArray; - - /** - * ListChangelogsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1.ListChangelogsResponse - * @instance - */ - ListChangelogsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListChangelogsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ListChangelogsResponse - * @static - * @param {google.cloud.ces.v1.IListChangelogsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ListChangelogsResponse} ListChangelogsResponse instance - */ - ListChangelogsResponse.create = function create(properties) { - return new ListChangelogsResponse(properties); - }; - - /** - * Encodes the specified ListChangelogsResponse message. Does not implicitly {@link google.cloud.ces.v1.ListChangelogsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ListChangelogsResponse - * @static - * @param {google.cloud.ces.v1.IListChangelogsResponse} message ListChangelogsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListChangelogsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.changelogs != null && message.changelogs.length) - for (var i = 0; i < message.changelogs.length; ++i) - $root.google.cloud.ces.v1.Changelog.encode(message.changelogs[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 ListChangelogsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ListChangelogsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ListChangelogsResponse - * @static - * @param {google.cloud.ces.v1.IListChangelogsResponse} message ListChangelogsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListChangelogsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListChangelogsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ListChangelogsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ListChangelogsResponse} ListChangelogsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListChangelogsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ListChangelogsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.changelogs && message.changelogs.length)) - message.changelogs = []; - message.changelogs.push($root.google.cloud.ces.v1.Changelog.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListChangelogsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ListChangelogsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ListChangelogsResponse} ListChangelogsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListChangelogsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListChangelogsResponse message. - * @function verify - * @memberof google.cloud.ces.v1.ListChangelogsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListChangelogsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.changelogs != null && message.hasOwnProperty("changelogs")) { - if (!Array.isArray(message.changelogs)) - return "changelogs: array expected"; - for (var i = 0; i < message.changelogs.length; ++i) { - var error = $root.google.cloud.ces.v1.Changelog.verify(message.changelogs[i]); - if (error) - return "changelogs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListChangelogsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ListChangelogsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ListChangelogsResponse} ListChangelogsResponse - */ - ListChangelogsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ListChangelogsResponse) - return object; - var message = new $root.google.cloud.ces.v1.ListChangelogsResponse(); - if (object.changelogs) { - if (!Array.isArray(object.changelogs)) - throw TypeError(".google.cloud.ces.v1.ListChangelogsResponse.changelogs: array expected"); - message.changelogs = []; - for (var i = 0; i < object.changelogs.length; ++i) { - if (typeof object.changelogs[i] !== "object") - throw TypeError(".google.cloud.ces.v1.ListChangelogsResponse.changelogs: object expected"); - message.changelogs[i] = $root.google.cloud.ces.v1.Changelog.fromObject(object.changelogs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListChangelogsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ListChangelogsResponse - * @static - * @param {google.cloud.ces.v1.ListChangelogsResponse} message ListChangelogsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListChangelogsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.changelogs = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.changelogs && message.changelogs.length) { - object.changelogs = []; - for (var j = 0; j < message.changelogs.length; ++j) - object.changelogs[j] = $root.google.cloud.ces.v1.Changelog.toObject(message.changelogs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListChangelogsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ListChangelogsResponse - * @instance - * @returns {Object.} JSON object - */ - ListChangelogsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListChangelogsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ListChangelogsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListChangelogsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ListChangelogsResponse"; - }; - - return ListChangelogsResponse; - })(); - - v1.GetChangelogRequest = (function() { - - /** - * Properties of a GetChangelogRequest. - * @memberof google.cloud.ces.v1 - * @interface IGetChangelogRequest - * @property {string|null} [name] GetChangelogRequest name - */ - - /** - * Constructs a new GetChangelogRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a GetChangelogRequest. - * @implements IGetChangelogRequest - * @constructor - * @param {google.cloud.ces.v1.IGetChangelogRequest=} [properties] Properties to set - */ - function GetChangelogRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetChangelogRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.GetChangelogRequest - * @instance - */ - GetChangelogRequest.prototype.name = ""; - - /** - * Creates a new GetChangelogRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.GetChangelogRequest - * @static - * @param {google.cloud.ces.v1.IGetChangelogRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.GetChangelogRequest} GetChangelogRequest instance - */ - GetChangelogRequest.create = function create(properties) { - return new GetChangelogRequest(properties); - }; - - /** - * Encodes the specified GetChangelogRequest message. Does not implicitly {@link google.cloud.ces.v1.GetChangelogRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.GetChangelogRequest - * @static - * @param {google.cloud.ces.v1.IGetChangelogRequest} message GetChangelogRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetChangelogRequest.encode = function encode(message, writer) { - 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 GetChangelogRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GetChangelogRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.GetChangelogRequest - * @static - * @param {google.cloud.ces.v1.IGetChangelogRequest} message GetChangelogRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetChangelogRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetChangelogRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.GetChangelogRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.GetChangelogRequest} GetChangelogRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetChangelogRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GetChangelogRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetChangelogRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.GetChangelogRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.GetChangelogRequest} GetChangelogRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetChangelogRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetChangelogRequest message. - * @function verify - * @memberof google.cloud.ces.v1.GetChangelogRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetChangelogRequest.verify = function verify(message) { - if (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 GetChangelogRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.GetChangelogRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.GetChangelogRequest} GetChangelogRequest - */ - GetChangelogRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.GetChangelogRequest) - return object; - var message = new $root.google.cloud.ces.v1.GetChangelogRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetChangelogRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.GetChangelogRequest - * @static - * @param {google.cloud.ces.v1.GetChangelogRequest} message GetChangelogRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetChangelogRequest.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 GetChangelogRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.GetChangelogRequest - * @instance - * @returns {Object.} JSON object - */ - GetChangelogRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetChangelogRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.GetChangelogRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetChangelogRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.GetChangelogRequest"; - }; - - return GetChangelogRequest; - })(); - - v1.App = (function() { - - /** - * Properties of an App. - * @memberof google.cloud.ces.v1 - * @interface IApp - * @property {string|null} [name] App name - * @property {string|null} [displayName] App displayName - * @property {string|null} [description] App description - * @property {boolean|null} [pinned] App pinned - * @property {string|null} [rootAgent] App rootAgent - * @property {google.cloud.ces.v1.ILanguageSettings|null} [languageSettings] App languageSettings - * @property {google.cloud.ces.v1.ITimeZoneSettings|null} [timeZoneSettings] App timeZoneSettings - * @property {google.cloud.ces.v1.IAudioProcessingConfig|null} [audioProcessingConfig] App audioProcessingConfig - * @property {google.cloud.ces.v1.ILoggingSettings|null} [loggingSettings] App loggingSettings - * @property {google.cloud.ces.v1.IModelSettings|null} [modelSettings] App modelSettings - * @property {google.cloud.ces.v1.App.ToolExecutionMode|null} [toolExecutionMode] App toolExecutionMode - * @property {google.cloud.ces.v1.IEvaluationMetricsThresholds|null} [evaluationMetricsThresholds] App evaluationMetricsThresholds - * @property {Array.|null} [variableDeclarations] App variableDeclarations - * @property {Array.|null} [predefinedVariableDeclarations] App predefinedVariableDeclarations - * @property {string|null} [globalInstruction] App globalInstruction - * @property {Array.|null} [guardrails] App guardrails - * @property {google.cloud.ces.v1.IDataStoreSettings|null} [dataStoreSettings] App dataStoreSettings - * @property {google.cloud.ces.v1.IChannelProfile|null} [defaultChannelProfile] App defaultChannelProfile - * @property {Object.|null} [metadata] App metadata - * @property {google.protobuf.ITimestamp|null} [createTime] App createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] App updateTime - * @property {string|null} [etag] App etag - * @property {number|null} [deploymentCount] App deploymentCount - * @property {google.cloud.ces.v1.IClientCertificateSettings|null} [clientCertificateSettings] App clientCertificateSettings - * @property {boolean|null} [locked] App locked - */ - - /** - * Constructs a new App. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an App. - * @implements IApp - * @constructor - * @param {google.cloud.ces.v1.IApp=} [properties] Properties to set - */ - function App(properties) { - this.variableDeclarations = []; - this.predefinedVariableDeclarations = []; - this.guardrails = []; - this.metadata = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * App name. - * @member {string} name - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.name = ""; - - /** - * App displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.displayName = ""; - - /** - * App description. - * @member {string} description - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.description = ""; - - /** - * App pinned. - * @member {boolean} pinned - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.pinned = false; - - /** - * App rootAgent. - * @member {string} rootAgent - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.rootAgent = ""; - - /** - * App languageSettings. - * @member {google.cloud.ces.v1.ILanguageSettings|null|undefined} languageSettings - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.languageSettings = null; - - /** - * App timeZoneSettings. - * @member {google.cloud.ces.v1.ITimeZoneSettings|null|undefined} timeZoneSettings - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.timeZoneSettings = null; - - /** - * App audioProcessingConfig. - * @member {google.cloud.ces.v1.IAudioProcessingConfig|null|undefined} audioProcessingConfig - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.audioProcessingConfig = null; - - /** - * App loggingSettings. - * @member {google.cloud.ces.v1.ILoggingSettings|null|undefined} loggingSettings - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.loggingSettings = null; - - /** - * App modelSettings. - * @member {google.cloud.ces.v1.IModelSettings|null|undefined} modelSettings - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.modelSettings = null; - - /** - * App toolExecutionMode. - * @member {google.cloud.ces.v1.App.ToolExecutionMode} toolExecutionMode - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.toolExecutionMode = 0; - - /** - * App evaluationMetricsThresholds. - * @member {google.cloud.ces.v1.IEvaluationMetricsThresholds|null|undefined} evaluationMetricsThresholds - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.evaluationMetricsThresholds = null; - - /** - * App variableDeclarations. - * @member {Array.} variableDeclarations - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.variableDeclarations = $util.emptyArray; - - /** - * App predefinedVariableDeclarations. - * @member {Array.} predefinedVariableDeclarations - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.predefinedVariableDeclarations = $util.emptyArray; - - /** - * App globalInstruction. - * @member {string} globalInstruction - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.globalInstruction = ""; - - /** - * App guardrails. - * @member {Array.} guardrails - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.guardrails = $util.emptyArray; - - /** - * App dataStoreSettings. - * @member {google.cloud.ces.v1.IDataStoreSettings|null|undefined} dataStoreSettings - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.dataStoreSettings = null; - - /** - * App defaultChannelProfile. - * @member {google.cloud.ces.v1.IChannelProfile|null|undefined} defaultChannelProfile - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.defaultChannelProfile = null; - - /** - * App metadata. - * @member {Object.} metadata - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.metadata = $util.emptyObject; - - /** - * App createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.createTime = null; - - /** - * App updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.updateTime = null; - - /** - * App etag. - * @member {string} etag - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.etag = ""; - - /** - * App deploymentCount. - * @member {number} deploymentCount - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.deploymentCount = 0; - - /** - * App clientCertificateSettings. - * @member {google.cloud.ces.v1.IClientCertificateSettings|null|undefined} clientCertificateSettings - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.clientCertificateSettings = null; - - /** - * App locked. - * @member {boolean} locked - * @memberof google.cloud.ces.v1.App - * @instance - */ - App.prototype.locked = false; - - /** - * Creates a new App instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.App - * @static - * @param {google.cloud.ces.v1.IApp=} [properties] Properties to set - * @returns {google.cloud.ces.v1.App} App instance - */ - App.create = function create(properties) { - return new App(properties); - }; - - /** - * Encodes the specified App message. Does not implicitly {@link google.cloud.ces.v1.App.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.App - * @static - * @param {google.cloud.ces.v1.IApp} message App message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - App.encode = function encode(message, writer) { - if (!writer) - 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.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.rootAgent != null && Object.hasOwnProperty.call(message, "rootAgent")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.rootAgent); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.audioProcessingConfig != null && Object.hasOwnProperty.call(message, "audioProcessingConfig")) - $root.google.cloud.ces.v1.AudioProcessingConfig.encode(message.audioProcessingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.loggingSettings != null && Object.hasOwnProperty.call(message, "loggingSettings")) - $root.google.cloud.ces.v1.LoggingSettings.encode(message.loggingSettings, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.guardrails != null && message.guardrails.length) - for (var i = 0; i < message.guardrails.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.guardrails[i]); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.etag); - if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) - $root.google.cloud.ces.v1.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.variableDeclarations != null && message.variableDeclarations.length) - for (var i = 0; i < message.variableDeclarations.length; ++i) - $root.google.cloud.ces.v1.App.VariableDeclaration.encode(message.variableDeclarations[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.dataStoreSettings != null && Object.hasOwnProperty.call(message, "dataStoreSettings")) - $root.google.cloud.ces.v1.DataStoreSettings.encode(message.dataStoreSettings, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.globalInstruction != null && Object.hasOwnProperty.call(message, "globalInstruction")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.globalInstruction); - if (message.languageSettings != null && Object.hasOwnProperty.call(message, "languageSettings")) - $root.google.cloud.ces.v1.LanguageSettings.encode(message.languageSettings, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.defaultChannelProfile != null && Object.hasOwnProperty.call(message, "defaultChannelProfile")) - $root.google.cloud.ces.v1.ChannelProfile.encode(message.defaultChannelProfile, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.deploymentCount != null && Object.hasOwnProperty.call(message, "deploymentCount")) - writer.uint32(/* id 23, wireType 0 =*/184).int32(message.deploymentCount); - if (message.evaluationMetricsThresholds != null && Object.hasOwnProperty.call(message, "evaluationMetricsThresholds")) - $root.google.cloud.ces.v1.EvaluationMetricsThresholds.encode(message.evaluationMetricsThresholds, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.clientCertificateSettings != null && Object.hasOwnProperty.call(message, "clientCertificateSettings")) - $root.google.cloud.ces.v1.ClientCertificateSettings.encode(message.clientCertificateSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.timeZoneSettings != null && Object.hasOwnProperty.call(message, "timeZoneSettings")) - $root.google.cloud.ces.v1.TimeZoneSettings.encode(message.timeZoneSettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.predefinedVariableDeclarations != null && message.predefinedVariableDeclarations.length) - for (var i = 0; i < message.predefinedVariableDeclarations.length; ++i) - $root.google.cloud.ces.v1.App.VariableDeclaration.encode(message.predefinedVariableDeclarations[i], writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) - writer.uint32(/* id 29, wireType 0 =*/232).bool(message.locked); - if (message.pinned != null && Object.hasOwnProperty.call(message, "pinned")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.pinned); - if (message.toolExecutionMode != null && Object.hasOwnProperty.call(message, "toolExecutionMode")) - writer.uint32(/* id 32, wireType 0 =*/256).int32(message.toolExecutionMode); - return writer; - }; - - /** - * Encodes the specified App message, length delimited. Does not implicitly {@link google.cloud.ces.v1.App.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.App - * @static - * @param {google.cloud.ces.v1.IApp} message App message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - App.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an App message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.App - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.App} App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - App.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.App(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 31: { - message.pinned = reader.bool(); - break; - } - case 4: { - message.rootAgent = reader.string(); - break; - } - case 18: { - message.languageSettings = $root.google.cloud.ces.v1.LanguageSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.timeZoneSettings = $root.google.cloud.ces.v1.TimeZoneSettings.decode(reader, reader.uint32()); - break; - } - case 7: { - message.audioProcessingConfig = $root.google.cloud.ces.v1.AudioProcessingConfig.decode(reader, reader.uint32()); - break; - } - case 8: { - message.loggingSettings = $root.google.cloud.ces.v1.LoggingSettings.decode(reader, reader.uint32()); - break; - } - case 13: { - message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.decode(reader, reader.uint32()); - break; - } - case 32: { - message.toolExecutionMode = reader.int32(); - break; - } - case 24: { - message.evaluationMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.decode(reader, reader.uint32()); - break; - } - case 14: { - if (!(message.variableDeclarations && message.variableDeclarations.length)) - message.variableDeclarations = []; - message.variableDeclarations.push($root.google.cloud.ces.v1.App.VariableDeclaration.decode(reader, reader.uint32())); - break; - } - case 28: { - if (!(message.predefinedVariableDeclarations && message.predefinedVariableDeclarations.length)) - message.predefinedVariableDeclarations = []; - message.predefinedVariableDeclarations.push($root.google.cloud.ces.v1.App.VariableDeclaration.decode(reader, reader.uint32())); - break; - } - case 17: { - message.globalInstruction = reader.string(); - break; - } - case 10: { - if (!(message.guardrails && message.guardrails.length)) - message.guardrails = []; - message.guardrails.push(reader.string()); - break; - } - case 15: { - message.dataStoreSettings = $root.google.cloud.ces.v1.DataStoreSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.defaultChannelProfile = $root.google.cloud.ces.v1.ChannelProfile.decode(reader, reader.uint32()); - break; - } - case 11: { - if (message.metadata === $util.emptyObject) - message.metadata = {}; - 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.metadata[key] = value; - break; - } - case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 12: { - message.etag = reader.string(); - break; - } - case 23: { - message.deploymentCount = reader.int32(); - break; - } - case 25: { - message.clientCertificateSettings = $root.google.cloud.ces.v1.ClientCertificateSettings.decode(reader, reader.uint32()); - break; - } - case 29: { - message.locked = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an App message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.App - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.App} App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - App.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an App message. - * @function verify - * @memberof google.cloud.ces.v1.App - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - App.verify = function verify(message) { - if (typeof message !== "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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.pinned != null && message.hasOwnProperty("pinned")) - if (typeof message.pinned !== "boolean") - return "pinned: boolean expected"; - if (message.rootAgent != null && message.hasOwnProperty("rootAgent")) - if (!$util.isString(message.rootAgent)) - return "rootAgent: string expected"; - if (message.languageSettings != null && message.hasOwnProperty("languageSettings")) { - var error = $root.google.cloud.ces.v1.LanguageSettings.verify(message.languageSettings); - if (error) - return "languageSettings." + error; - } - if (message.timeZoneSettings != null && message.hasOwnProperty("timeZoneSettings")) { - var error = $root.google.cloud.ces.v1.TimeZoneSettings.verify(message.timeZoneSettings); - if (error) - return "timeZoneSettings." + error; - } - if (message.audioProcessingConfig != null && message.hasOwnProperty("audioProcessingConfig")) { - var error = $root.google.cloud.ces.v1.AudioProcessingConfig.verify(message.audioProcessingConfig); - if (error) - return "audioProcessingConfig." + error; - } - if (message.loggingSettings != null && message.hasOwnProperty("loggingSettings")) { - var error = $root.google.cloud.ces.v1.LoggingSettings.verify(message.loggingSettings); - if (error) - return "loggingSettings." + error; - } - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { - var error = $root.google.cloud.ces.v1.ModelSettings.verify(message.modelSettings); - if (error) - return "modelSettings." + error; - } - if (message.toolExecutionMode != null && message.hasOwnProperty("toolExecutionMode")) - switch (message.toolExecutionMode) { - default: - return "toolExecutionMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.evaluationMetricsThresholds != null && message.hasOwnProperty("evaluationMetricsThresholds")) { - var error = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.verify(message.evaluationMetricsThresholds); - if (error) - return "evaluationMetricsThresholds." + error; - } - if (message.variableDeclarations != null && message.hasOwnProperty("variableDeclarations")) { - if (!Array.isArray(message.variableDeclarations)) - return "variableDeclarations: array expected"; - for (var i = 0; i < message.variableDeclarations.length; ++i) { - var error = $root.google.cloud.ces.v1.App.VariableDeclaration.verify(message.variableDeclarations[i]); - if (error) - return "variableDeclarations." + error; - } - } - if (message.predefinedVariableDeclarations != null && message.hasOwnProperty("predefinedVariableDeclarations")) { - if (!Array.isArray(message.predefinedVariableDeclarations)) - return "predefinedVariableDeclarations: array expected"; - for (var i = 0; i < message.predefinedVariableDeclarations.length; ++i) { - var error = $root.google.cloud.ces.v1.App.VariableDeclaration.verify(message.predefinedVariableDeclarations[i]); - if (error) - return "predefinedVariableDeclarations." + error; - } - } - if (message.globalInstruction != null && message.hasOwnProperty("globalInstruction")) - if (!$util.isString(message.globalInstruction)) - return "globalInstruction: string expected"; - if (message.guardrails != null && message.hasOwnProperty("guardrails")) { - if (!Array.isArray(message.guardrails)) - return "guardrails: array expected"; - for (var i = 0; i < message.guardrails.length; ++i) - if (!$util.isString(message.guardrails[i])) - return "guardrails: string[] expected"; - } - if (message.dataStoreSettings != null && message.hasOwnProperty("dataStoreSettings")) { - var error = $root.google.cloud.ces.v1.DataStoreSettings.verify(message.dataStoreSettings); - if (error) - return "dataStoreSettings." + error; - } - if (message.defaultChannelProfile != null && message.hasOwnProperty("defaultChannelProfile")) { - var error = $root.google.cloud.ces.v1.ChannelProfile.verify(message.defaultChannelProfile); - if (error) - return "defaultChannelProfile." + error; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - if (!$util.isObject(message.metadata)) - return "metadata: object expected"; - var key = Object.keys(message.metadata); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.metadata[key[i]])) - return "metadata: string{k: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.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.deploymentCount != null && message.hasOwnProperty("deploymentCount")) - if (!$util.isInteger(message.deploymentCount)) - return "deploymentCount: integer expected"; - if (message.clientCertificateSettings != null && message.hasOwnProperty("clientCertificateSettings")) { - var error = $root.google.cloud.ces.v1.ClientCertificateSettings.verify(message.clientCertificateSettings); - if (error) - return "clientCertificateSettings." + error; - } - if (message.locked != null && message.hasOwnProperty("locked")) - if (typeof message.locked !== "boolean") - return "locked: boolean expected"; - return null; - }; - - /** - * Creates an App message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.App - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.App} App - */ - App.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.App) - return object; - var message = new $root.google.cloud.ces.v1.App(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.pinned != null) - message.pinned = Boolean(object.pinned); - if (object.rootAgent != null) - message.rootAgent = String(object.rootAgent); - if (object.languageSettings != null) { - if (typeof object.languageSettings !== "object") - throw TypeError(".google.cloud.ces.v1.App.languageSettings: object expected"); - message.languageSettings = $root.google.cloud.ces.v1.LanguageSettings.fromObject(object.languageSettings); - } - if (object.timeZoneSettings != null) { - if (typeof object.timeZoneSettings !== "object") - throw TypeError(".google.cloud.ces.v1.App.timeZoneSettings: object expected"); - message.timeZoneSettings = $root.google.cloud.ces.v1.TimeZoneSettings.fromObject(object.timeZoneSettings); - } - if (object.audioProcessingConfig != null) { - if (typeof object.audioProcessingConfig !== "object") - throw TypeError(".google.cloud.ces.v1.App.audioProcessingConfig: object expected"); - message.audioProcessingConfig = $root.google.cloud.ces.v1.AudioProcessingConfig.fromObject(object.audioProcessingConfig); - } - if (object.loggingSettings != null) { - if (typeof object.loggingSettings !== "object") - throw TypeError(".google.cloud.ces.v1.App.loggingSettings: object expected"); - message.loggingSettings = $root.google.cloud.ces.v1.LoggingSettings.fromObject(object.loggingSettings); - } - if (object.modelSettings != null) { - if (typeof object.modelSettings !== "object") - throw TypeError(".google.cloud.ces.v1.App.modelSettings: object expected"); - message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.fromObject(object.modelSettings); - } - switch (object.toolExecutionMode) { - default: - if (typeof object.toolExecutionMode === "number") { - message.toolExecutionMode = object.toolExecutionMode; - break; - } - break; - case "TOOL_EXECUTION_MODE_UNSPECIFIED": - case 0: - message.toolExecutionMode = 0; - break; - case "PARALLEL": - case 1: - message.toolExecutionMode = 1; - break; - case "SEQUENTIAL": - case 2: - message.toolExecutionMode = 2; - break; - } - if (object.evaluationMetricsThresholds != null) { - if (typeof object.evaluationMetricsThresholds !== "object") - throw TypeError(".google.cloud.ces.v1.App.evaluationMetricsThresholds: object expected"); - message.evaluationMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.fromObject(object.evaluationMetricsThresholds); - } - if (object.variableDeclarations) { - if (!Array.isArray(object.variableDeclarations)) - throw TypeError(".google.cloud.ces.v1.App.variableDeclarations: array expected"); - message.variableDeclarations = []; - for (var i = 0; i < object.variableDeclarations.length; ++i) { - if (typeof object.variableDeclarations[i] !== "object") - throw TypeError(".google.cloud.ces.v1.App.variableDeclarations: object expected"); - message.variableDeclarations[i] = $root.google.cloud.ces.v1.App.VariableDeclaration.fromObject(object.variableDeclarations[i]); - } - } - if (object.predefinedVariableDeclarations) { - if (!Array.isArray(object.predefinedVariableDeclarations)) - throw TypeError(".google.cloud.ces.v1.App.predefinedVariableDeclarations: array expected"); - message.predefinedVariableDeclarations = []; - for (var i = 0; i < object.predefinedVariableDeclarations.length; ++i) { - if (typeof object.predefinedVariableDeclarations[i] !== "object") - throw TypeError(".google.cloud.ces.v1.App.predefinedVariableDeclarations: object expected"); - message.predefinedVariableDeclarations[i] = $root.google.cloud.ces.v1.App.VariableDeclaration.fromObject(object.predefinedVariableDeclarations[i]); - } - } - if (object.globalInstruction != null) - message.globalInstruction = String(object.globalInstruction); - if (object.guardrails) { - if (!Array.isArray(object.guardrails)) - throw TypeError(".google.cloud.ces.v1.App.guardrails: array expected"); - message.guardrails = []; - for (var i = 0; i < object.guardrails.length; ++i) - message.guardrails[i] = String(object.guardrails[i]); - } - if (object.dataStoreSettings != null) { - if (typeof object.dataStoreSettings !== "object") - throw TypeError(".google.cloud.ces.v1.App.dataStoreSettings: object expected"); - message.dataStoreSettings = $root.google.cloud.ces.v1.DataStoreSettings.fromObject(object.dataStoreSettings); - } - if (object.defaultChannelProfile != null) { - if (typeof object.defaultChannelProfile !== "object") - throw TypeError(".google.cloud.ces.v1.App.defaultChannelProfile: object expected"); - message.defaultChannelProfile = $root.google.cloud.ces.v1.ChannelProfile.fromObject(object.defaultChannelProfile); - } - if (object.metadata) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.ces.v1.App.metadata: object expected"); - message.metadata = {}; - for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) - message.metadata[keys[i]] = String(object.metadata[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1.App.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.ces.v1.App.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.deploymentCount != null) - message.deploymentCount = object.deploymentCount | 0; - if (object.clientCertificateSettings != null) { - if (typeof object.clientCertificateSettings !== "object") - throw TypeError(".google.cloud.ces.v1.App.clientCertificateSettings: object expected"); - message.clientCertificateSettings = $root.google.cloud.ces.v1.ClientCertificateSettings.fromObject(object.clientCertificateSettings); - } - if (object.locked != null) - message.locked = Boolean(object.locked); - return message; - }; - - /** - * Creates a plain object from an App message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.App - * @static - * @param {google.cloud.ces.v1.App} message App - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - App.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.guardrails = []; - object.variableDeclarations = []; - object.predefinedVariableDeclarations = []; - } - if (options.objects || options.defaults) - object.metadata = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.rootAgent = ""; - object.createTime = null; - object.updateTime = null; - object.audioProcessingConfig = null; - object.loggingSettings = null; - object.etag = ""; - object.modelSettings = null; - object.dataStoreSettings = null; - object.globalInstruction = ""; - object.languageSettings = null; - object.defaultChannelProfile = null; - object.deploymentCount = 0; - object.evaluationMetricsThresholds = null; - object.clientCertificateSettings = null; - object.timeZoneSettings = null; - object.locked = false; - object.pinned = false; - object.toolExecutionMode = options.enums === String ? "TOOL_EXECUTION_MODE_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.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.rootAgent != null && message.hasOwnProperty("rootAgent")) - object.rootAgent = message.rootAgent; - 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.audioProcessingConfig != null && message.hasOwnProperty("audioProcessingConfig")) - object.audioProcessingConfig = $root.google.cloud.ces.v1.AudioProcessingConfig.toObject(message.audioProcessingConfig, options); - if (message.loggingSettings != null && message.hasOwnProperty("loggingSettings")) - object.loggingSettings = $root.google.cloud.ces.v1.LoggingSettings.toObject(message.loggingSettings, options); - if (message.guardrails && message.guardrails.length) { - object.guardrails = []; - for (var j = 0; j < message.guardrails.length; ++j) - object.guardrails[j] = message.guardrails[j]; - } - var keys2; - if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { - object.metadata = {}; - for (var j = 0; j < keys2.length; ++j) - object.metadata[keys2[j]] = message.metadata[keys2[j]]; - } - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) - object.modelSettings = $root.google.cloud.ces.v1.ModelSettings.toObject(message.modelSettings, options); - if (message.variableDeclarations && message.variableDeclarations.length) { - object.variableDeclarations = []; - for (var j = 0; j < message.variableDeclarations.length; ++j) - object.variableDeclarations[j] = $root.google.cloud.ces.v1.App.VariableDeclaration.toObject(message.variableDeclarations[j], options); - } - if (message.dataStoreSettings != null && message.hasOwnProperty("dataStoreSettings")) - object.dataStoreSettings = $root.google.cloud.ces.v1.DataStoreSettings.toObject(message.dataStoreSettings, options); - if (message.globalInstruction != null && message.hasOwnProperty("globalInstruction")) - object.globalInstruction = message.globalInstruction; - if (message.languageSettings != null && message.hasOwnProperty("languageSettings")) - object.languageSettings = $root.google.cloud.ces.v1.LanguageSettings.toObject(message.languageSettings, options); - if (message.defaultChannelProfile != null && message.hasOwnProperty("defaultChannelProfile")) - object.defaultChannelProfile = $root.google.cloud.ces.v1.ChannelProfile.toObject(message.defaultChannelProfile, options); - if (message.deploymentCount != null && message.hasOwnProperty("deploymentCount")) - object.deploymentCount = message.deploymentCount; - if (message.evaluationMetricsThresholds != null && message.hasOwnProperty("evaluationMetricsThresholds")) - object.evaluationMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.toObject(message.evaluationMetricsThresholds, options); - if (message.clientCertificateSettings != null && message.hasOwnProperty("clientCertificateSettings")) - object.clientCertificateSettings = $root.google.cloud.ces.v1.ClientCertificateSettings.toObject(message.clientCertificateSettings, options); - if (message.timeZoneSettings != null && message.hasOwnProperty("timeZoneSettings")) - object.timeZoneSettings = $root.google.cloud.ces.v1.TimeZoneSettings.toObject(message.timeZoneSettings, options); - if (message.predefinedVariableDeclarations && message.predefinedVariableDeclarations.length) { - object.predefinedVariableDeclarations = []; - for (var j = 0; j < message.predefinedVariableDeclarations.length; ++j) - object.predefinedVariableDeclarations[j] = $root.google.cloud.ces.v1.App.VariableDeclaration.toObject(message.predefinedVariableDeclarations[j], options); - } - if (message.locked != null && message.hasOwnProperty("locked")) - object.locked = message.locked; - if (message.pinned != null && message.hasOwnProperty("pinned")) - object.pinned = message.pinned; - if (message.toolExecutionMode != null && message.hasOwnProperty("toolExecutionMode")) - object.toolExecutionMode = options.enums === String ? $root.google.cloud.ces.v1.App.ToolExecutionMode[message.toolExecutionMode] === undefined ? message.toolExecutionMode : $root.google.cloud.ces.v1.App.ToolExecutionMode[message.toolExecutionMode] : message.toolExecutionMode; - return object; - }; - - /** - * Converts this App to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.App - * @instance - * @returns {Object.} JSON object - */ - App.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for App - * @function getTypeUrl - * @memberof google.cloud.ces.v1.App - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - App.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.App"; - }; - - App.VariableDeclaration = (function() { - - /** - * Properties of a VariableDeclaration. - * @memberof google.cloud.ces.v1.App - * @interface IVariableDeclaration - * @property {string|null} [name] VariableDeclaration name - * @property {string|null} [description] VariableDeclaration description - * @property {google.cloud.ces.v1.ISchema|null} [schema] VariableDeclaration schema - */ - - /** - * Constructs a new VariableDeclaration. - * @memberof google.cloud.ces.v1.App - * @classdesc Represents a VariableDeclaration. - * @implements IVariableDeclaration - * @constructor - * @param {google.cloud.ces.v1.App.IVariableDeclaration=} [properties] Properties to set - */ - function VariableDeclaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VariableDeclaration name. - * @member {string} name - * @memberof google.cloud.ces.v1.App.VariableDeclaration - * @instance - */ - VariableDeclaration.prototype.name = ""; - - /** - * VariableDeclaration description. - * @member {string} description - * @memberof google.cloud.ces.v1.App.VariableDeclaration - * @instance - */ - VariableDeclaration.prototype.description = ""; - - /** - * VariableDeclaration schema. - * @member {google.cloud.ces.v1.ISchema|null|undefined} schema - * @memberof google.cloud.ces.v1.App.VariableDeclaration - * @instance - */ - VariableDeclaration.prototype.schema = null; - - /** - * Creates a new VariableDeclaration instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.App.VariableDeclaration - * @static - * @param {google.cloud.ces.v1.App.IVariableDeclaration=} [properties] Properties to set - * @returns {google.cloud.ces.v1.App.VariableDeclaration} VariableDeclaration instance - */ - VariableDeclaration.create = function create(properties) { - return new VariableDeclaration(properties); - }; - - /** - * Encodes the specified VariableDeclaration message. Does not implicitly {@link google.cloud.ces.v1.App.VariableDeclaration.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.App.VariableDeclaration - * @static - * @param {google.cloud.ces.v1.App.IVariableDeclaration} message VariableDeclaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VariableDeclaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) - $root.google.cloud.ces.v1.Schema.encode(message.schema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified VariableDeclaration message, length delimited. Does not implicitly {@link google.cloud.ces.v1.App.VariableDeclaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.App.VariableDeclaration - * @static - * @param {google.cloud.ces.v1.App.IVariableDeclaration} message VariableDeclaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VariableDeclaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VariableDeclaration message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.App.VariableDeclaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.App.VariableDeclaration} VariableDeclaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VariableDeclaration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.App.VariableDeclaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - message.schema = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VariableDeclaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.App.VariableDeclaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.App.VariableDeclaration} VariableDeclaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VariableDeclaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VariableDeclaration message. - * @function verify - * @memberof google.cloud.ces.v1.App.VariableDeclaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VariableDeclaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.schema != null && message.hasOwnProperty("schema")) { - var error = $root.google.cloud.ces.v1.Schema.verify(message.schema); - if (error) - return "schema." + error; - } - return null; - }; - - /** - * Creates a VariableDeclaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.App.VariableDeclaration - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.App.VariableDeclaration} VariableDeclaration - */ - VariableDeclaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.App.VariableDeclaration) - return object; - var message = new $root.google.cloud.ces.v1.App.VariableDeclaration(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.schema != null) { - if (typeof object.schema !== "object") - throw TypeError(".google.cloud.ces.v1.App.VariableDeclaration.schema: object expected"); - message.schema = $root.google.cloud.ces.v1.Schema.fromObject(object.schema); - } - return message; - }; - - /** - * Creates a plain object from a VariableDeclaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.App.VariableDeclaration - * @static - * @param {google.cloud.ces.v1.App.VariableDeclaration} message VariableDeclaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VariableDeclaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.schema = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.schema != null && message.hasOwnProperty("schema")) - object.schema = $root.google.cloud.ces.v1.Schema.toObject(message.schema, options); - return object; - }; - - /** - * Converts this VariableDeclaration to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.App.VariableDeclaration - * @instance - * @returns {Object.} JSON object - */ - VariableDeclaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for VariableDeclaration - * @function getTypeUrl - * @memberof google.cloud.ces.v1.App.VariableDeclaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - VariableDeclaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.App.VariableDeclaration"; - }; - - return VariableDeclaration; - })(); - - /** - * ToolExecutionMode enum. - * @name google.cloud.ces.v1.App.ToolExecutionMode - * @enum {number} - * @property {number} TOOL_EXECUTION_MODE_UNSPECIFIED=0 TOOL_EXECUTION_MODE_UNSPECIFIED value - * @property {number} PARALLEL=1 PARALLEL value - * @property {number} SEQUENTIAL=2 SEQUENTIAL value - */ - App.ToolExecutionMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TOOL_EXECUTION_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PARALLEL"] = 1; - values[valuesById[2] = "SEQUENTIAL"] = 2; - return values; - })(); - - return App; - })(); - - v1.TimeZoneSettings = (function() { - - /** - * Properties of a TimeZoneSettings. - * @memberof google.cloud.ces.v1 - * @interface ITimeZoneSettings - * @property {string|null} [timeZone] TimeZoneSettings timeZone - */ - - /** - * Constructs a new TimeZoneSettings. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a TimeZoneSettings. - * @implements ITimeZoneSettings - * @constructor - * @param {google.cloud.ces.v1.ITimeZoneSettings=} [properties] Properties to set - */ - function TimeZoneSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TimeZoneSettings timeZone. - * @member {string} timeZone - * @memberof google.cloud.ces.v1.TimeZoneSettings - * @instance - */ - TimeZoneSettings.prototype.timeZone = ""; - - /** - * Creates a new TimeZoneSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.TimeZoneSettings - * @static - * @param {google.cloud.ces.v1.ITimeZoneSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1.TimeZoneSettings} TimeZoneSettings instance - */ - TimeZoneSettings.create = function create(properties) { - return new TimeZoneSettings(properties); - }; - - /** - * Encodes the specified TimeZoneSettings message. Does not implicitly {@link google.cloud.ces.v1.TimeZoneSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.TimeZoneSettings - * @static - * @param {google.cloud.ces.v1.ITimeZoneSettings} message TimeZoneSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeZoneSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.timeZone); - return writer; - }; - - /** - * Encodes the specified TimeZoneSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.TimeZoneSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.TimeZoneSettings - * @static - * @param {google.cloud.ces.v1.ITimeZoneSettings} message TimeZoneSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeZoneSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TimeZoneSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.TimeZoneSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.TimeZoneSettings} TimeZoneSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeZoneSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.TimeZoneSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.timeZone = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TimeZoneSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.TimeZoneSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.TimeZoneSettings} TimeZoneSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeZoneSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TimeZoneSettings message. - * @function verify - * @memberof google.cloud.ces.v1.TimeZoneSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimeZoneSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - if (!$util.isString(message.timeZone)) - return "timeZone: string expected"; - return null; - }; - - /** - * Creates a TimeZoneSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.TimeZoneSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.TimeZoneSettings} TimeZoneSettings - */ - TimeZoneSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.TimeZoneSettings) - return object; - var message = new $root.google.cloud.ces.v1.TimeZoneSettings(); - if (object.timeZone != null) - message.timeZone = String(object.timeZone); - return message; - }; - - /** - * Creates a plain object from a TimeZoneSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.TimeZoneSettings - * @static - * @param {google.cloud.ces.v1.TimeZoneSettings} message TimeZoneSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimeZoneSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.timeZone = ""; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - object.timeZone = message.timeZone; - return object; - }; - - /** - * Converts this TimeZoneSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.TimeZoneSettings - * @instance - * @returns {Object.} JSON object - */ - TimeZoneSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TimeZoneSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1.TimeZoneSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TimeZoneSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.TimeZoneSettings"; - }; - - return TimeZoneSettings; - })(); - - v1.LanguageSettings = (function() { - - /** - * Properties of a LanguageSettings. - * @memberof google.cloud.ces.v1 - * @interface ILanguageSettings - * @property {string|null} [defaultLanguageCode] LanguageSettings defaultLanguageCode - * @property {Array.|null} [supportedLanguageCodes] LanguageSettings supportedLanguageCodes - * @property {boolean|null} [enableMultilingualSupport] LanguageSettings enableMultilingualSupport - * @property {string|null} [fallbackAction] LanguageSettings fallbackAction - */ - - /** - * Constructs a new LanguageSettings. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a LanguageSettings. - * @implements ILanguageSettings - * @constructor - * @param {google.cloud.ces.v1.ILanguageSettings=} [properties] Properties to set - */ - function LanguageSettings(properties) { - this.supportedLanguageCodes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LanguageSettings defaultLanguageCode. - * @member {string} defaultLanguageCode - * @memberof google.cloud.ces.v1.LanguageSettings - * @instance - */ - LanguageSettings.prototype.defaultLanguageCode = ""; - - /** - * LanguageSettings supportedLanguageCodes. - * @member {Array.} supportedLanguageCodes - * @memberof google.cloud.ces.v1.LanguageSettings - * @instance - */ - LanguageSettings.prototype.supportedLanguageCodes = $util.emptyArray; - - /** - * LanguageSettings enableMultilingualSupport. - * @member {boolean} enableMultilingualSupport - * @memberof google.cloud.ces.v1.LanguageSettings - * @instance - */ - LanguageSettings.prototype.enableMultilingualSupport = false; - - /** - * LanguageSettings fallbackAction. - * @member {string} fallbackAction - * @memberof google.cloud.ces.v1.LanguageSettings - * @instance - */ - LanguageSettings.prototype.fallbackAction = ""; - - /** - * Creates a new LanguageSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.LanguageSettings - * @static - * @param {google.cloud.ces.v1.ILanguageSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1.LanguageSettings} LanguageSettings instance - */ - LanguageSettings.create = function create(properties) { - return new LanguageSettings(properties); - }; - - /** - * Encodes the specified LanguageSettings message. Does not implicitly {@link google.cloud.ces.v1.LanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.LanguageSettings - * @static - * @param {google.cloud.ces.v1.ILanguageSettings} message LanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaultLanguageCode != null && Object.hasOwnProperty.call(message, "defaultLanguageCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.defaultLanguageCode); - if (message.supportedLanguageCodes != null && message.supportedLanguageCodes.length) - for (var i = 0; i < message.supportedLanguageCodes.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.supportedLanguageCodes[i]); - if (message.enableMultilingualSupport != null && Object.hasOwnProperty.call(message, "enableMultilingualSupport")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableMultilingualSupport); - if (message.fallbackAction != null && Object.hasOwnProperty.call(message, "fallbackAction")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.fallbackAction); - return writer; - }; - - /** - * Encodes the specified LanguageSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.LanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.LanguageSettings - * @static - * @param {google.cloud.ces.v1.ILanguageSettings} message LanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.LanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.LanguageSettings} LanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LanguageSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.LanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.defaultLanguageCode = reader.string(); - break; - } - case 2: { - if (!(message.supportedLanguageCodes && message.supportedLanguageCodes.length)) - message.supportedLanguageCodes = []; - message.supportedLanguageCodes.push(reader.string()); - break; - } - case 3: { - message.enableMultilingualSupport = reader.bool(); - break; - } - case 4: { - message.fallbackAction = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.LanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.LanguageSettings} LanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LanguageSettings message. - * @function verify - * @memberof google.cloud.ces.v1.LanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaultLanguageCode != null && message.hasOwnProperty("defaultLanguageCode")) - if (!$util.isString(message.defaultLanguageCode)) - return "defaultLanguageCode: string expected"; - if (message.supportedLanguageCodes != null && message.hasOwnProperty("supportedLanguageCodes")) { - if (!Array.isArray(message.supportedLanguageCodes)) - return "supportedLanguageCodes: array expected"; - for (var i = 0; i < message.supportedLanguageCodes.length; ++i) - if (!$util.isString(message.supportedLanguageCodes[i])) - return "supportedLanguageCodes: string[] expected"; - } - if (message.enableMultilingualSupport != null && message.hasOwnProperty("enableMultilingualSupport")) - if (typeof message.enableMultilingualSupport !== "boolean") - return "enableMultilingualSupport: boolean expected"; - if (message.fallbackAction != null && message.hasOwnProperty("fallbackAction")) - if (!$util.isString(message.fallbackAction)) - return "fallbackAction: string expected"; - return null; - }; - - /** - * Creates a LanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.LanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.LanguageSettings} LanguageSettings - */ - LanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.LanguageSettings) - return object; - var message = new $root.google.cloud.ces.v1.LanguageSettings(); - if (object.defaultLanguageCode != null) - message.defaultLanguageCode = String(object.defaultLanguageCode); - if (object.supportedLanguageCodes) { - if (!Array.isArray(object.supportedLanguageCodes)) - throw TypeError(".google.cloud.ces.v1.LanguageSettings.supportedLanguageCodes: array expected"); - message.supportedLanguageCodes = []; - for (var i = 0; i < object.supportedLanguageCodes.length; ++i) - message.supportedLanguageCodes[i] = String(object.supportedLanguageCodes[i]); - } - if (object.enableMultilingualSupport != null) - message.enableMultilingualSupport = Boolean(object.enableMultilingualSupport); - if (object.fallbackAction != null) - message.fallbackAction = String(object.fallbackAction); - return message; - }; - - /** - * Creates a plain object from a LanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.LanguageSettings - * @static - * @param {google.cloud.ces.v1.LanguageSettings} message LanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.supportedLanguageCodes = []; - if (options.defaults) { - object.defaultLanguageCode = ""; - object.enableMultilingualSupport = false; - object.fallbackAction = ""; - } - if (message.defaultLanguageCode != null && message.hasOwnProperty("defaultLanguageCode")) - object.defaultLanguageCode = message.defaultLanguageCode; - if (message.supportedLanguageCodes && message.supportedLanguageCodes.length) { - object.supportedLanguageCodes = []; - for (var j = 0; j < message.supportedLanguageCodes.length; ++j) - object.supportedLanguageCodes[j] = message.supportedLanguageCodes[j]; - } - if (message.enableMultilingualSupport != null && message.hasOwnProperty("enableMultilingualSupport")) - object.enableMultilingualSupport = message.enableMultilingualSupport; - if (message.fallbackAction != null && message.hasOwnProperty("fallbackAction")) - object.fallbackAction = message.fallbackAction; - return object; - }; - - /** - * Converts this LanguageSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.LanguageSettings - * @instance - * @returns {Object.} JSON object - */ - LanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LanguageSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1.LanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.LanguageSettings"; - }; - - return LanguageSettings; - })(); - - v1.AudioProcessingConfig = (function() { - - /** - * Properties of an AudioProcessingConfig. - * @memberof google.cloud.ces.v1 - * @interface IAudioProcessingConfig - * @property {Object.|null} [synthesizeSpeechConfigs] AudioProcessingConfig synthesizeSpeechConfigs - * @property {google.cloud.ces.v1.IBargeInConfig|null} [bargeInConfig] AudioProcessingConfig bargeInConfig - * @property {google.protobuf.IDuration|null} [inactivityTimeout] AudioProcessingConfig inactivityTimeout - * @property {google.cloud.ces.v1.IAmbientSoundConfig|null} [ambientSoundConfig] AudioProcessingConfig ambientSoundConfig - */ - - /** - * Constructs a new AudioProcessingConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an AudioProcessingConfig. - * @implements IAudioProcessingConfig - * @constructor - * @param {google.cloud.ces.v1.IAudioProcessingConfig=} [properties] Properties to set - */ - function AudioProcessingConfig(properties) { - this.synthesizeSpeechConfigs = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AudioProcessingConfig synthesizeSpeechConfigs. - * @member {Object.} synthesizeSpeechConfigs - * @memberof google.cloud.ces.v1.AudioProcessingConfig - * @instance - */ - AudioProcessingConfig.prototype.synthesizeSpeechConfigs = $util.emptyObject; - - /** - * AudioProcessingConfig bargeInConfig. - * @member {google.cloud.ces.v1.IBargeInConfig|null|undefined} bargeInConfig - * @memberof google.cloud.ces.v1.AudioProcessingConfig - * @instance - */ - AudioProcessingConfig.prototype.bargeInConfig = null; - - /** - * AudioProcessingConfig inactivityTimeout. - * @member {google.protobuf.IDuration|null|undefined} inactivityTimeout - * @memberof google.cloud.ces.v1.AudioProcessingConfig - * @instance - */ - AudioProcessingConfig.prototype.inactivityTimeout = null; - - /** - * AudioProcessingConfig ambientSoundConfig. - * @member {google.cloud.ces.v1.IAmbientSoundConfig|null|undefined} ambientSoundConfig - * @memberof google.cloud.ces.v1.AudioProcessingConfig - * @instance - */ - AudioProcessingConfig.prototype.ambientSoundConfig = null; - - /** - * Creates a new AudioProcessingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.AudioProcessingConfig - * @static - * @param {google.cloud.ces.v1.IAudioProcessingConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.AudioProcessingConfig} AudioProcessingConfig instance - */ - AudioProcessingConfig.create = function create(properties) { - return new AudioProcessingConfig(properties); - }; - - /** - * Encodes the specified AudioProcessingConfig message. Does not implicitly {@link google.cloud.ces.v1.AudioProcessingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.AudioProcessingConfig - * @static - * @param {google.cloud.ces.v1.IAudioProcessingConfig} message AudioProcessingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AudioProcessingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.synthesizeSpeechConfigs != null && Object.hasOwnProperty.call(message, "synthesizeSpeechConfigs")) - for (var keys = Object.keys(message.synthesizeSpeechConfigs), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.ces.v1.SynthesizeSpeechConfig.encode(message.synthesizeSpeechConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.bargeInConfig != null && Object.hasOwnProperty.call(message, "bargeInConfig")) - $root.google.cloud.ces.v1.BargeInConfig.encode(message.bargeInConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.inactivityTimeout != null && Object.hasOwnProperty.call(message, "inactivityTimeout")) - $root.google.protobuf.Duration.encode(message.inactivityTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.ambientSoundConfig != null && Object.hasOwnProperty.call(message, "ambientSoundConfig")) - $root.google.cloud.ces.v1.AmbientSoundConfig.encode(message.ambientSoundConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AudioProcessingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AudioProcessingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.AudioProcessingConfig - * @static - * @param {google.cloud.ces.v1.IAudioProcessingConfig} message AudioProcessingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AudioProcessingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AudioProcessingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.AudioProcessingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.AudioProcessingConfig} AudioProcessingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AudioProcessingConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.AudioProcessingConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.synthesizeSpeechConfigs === $util.emptyObject) - message.synthesizeSpeechConfigs = {}; - 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.ces.v1.SynthesizeSpeechConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.synthesizeSpeechConfigs[key] = value; - break; - } - case 3: { - message.bargeInConfig = $root.google.cloud.ces.v1.BargeInConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.inactivityTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.ambientSoundConfig = $root.google.cloud.ces.v1.AmbientSoundConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AudioProcessingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.AudioProcessingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.AudioProcessingConfig} AudioProcessingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AudioProcessingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AudioProcessingConfig message. - * @function verify - * @memberof google.cloud.ces.v1.AudioProcessingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AudioProcessingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.synthesizeSpeechConfigs != null && message.hasOwnProperty("synthesizeSpeechConfigs")) { - if (!$util.isObject(message.synthesizeSpeechConfigs)) - return "synthesizeSpeechConfigs: object expected"; - var key = Object.keys(message.synthesizeSpeechConfigs); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.ces.v1.SynthesizeSpeechConfig.verify(message.synthesizeSpeechConfigs[key[i]]); - if (error) - return "synthesizeSpeechConfigs." + error; - } - } - if (message.bargeInConfig != null && message.hasOwnProperty("bargeInConfig")) { - var error = $root.google.cloud.ces.v1.BargeInConfig.verify(message.bargeInConfig); - if (error) - return "bargeInConfig." + error; - } - if (message.inactivityTimeout != null && message.hasOwnProperty("inactivityTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.inactivityTimeout); - if (error) - return "inactivityTimeout." + error; - } - if (message.ambientSoundConfig != null && message.hasOwnProperty("ambientSoundConfig")) { - var error = $root.google.cloud.ces.v1.AmbientSoundConfig.verify(message.ambientSoundConfig); - if (error) - return "ambientSoundConfig." + error; - } - return null; - }; - - /** - * Creates an AudioProcessingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.AudioProcessingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.AudioProcessingConfig} AudioProcessingConfig - */ - AudioProcessingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.AudioProcessingConfig) - return object; - var message = new $root.google.cloud.ces.v1.AudioProcessingConfig(); - if (object.synthesizeSpeechConfigs) { - if (typeof object.synthesizeSpeechConfigs !== "object") - throw TypeError(".google.cloud.ces.v1.AudioProcessingConfig.synthesizeSpeechConfigs: object expected"); - message.synthesizeSpeechConfigs = {}; - for (var keys = Object.keys(object.synthesizeSpeechConfigs), i = 0; i < keys.length; ++i) { - if (typeof object.synthesizeSpeechConfigs[keys[i]] !== "object") - throw TypeError(".google.cloud.ces.v1.AudioProcessingConfig.synthesizeSpeechConfigs: object expected"); - message.synthesizeSpeechConfigs[keys[i]] = $root.google.cloud.ces.v1.SynthesizeSpeechConfig.fromObject(object.synthesizeSpeechConfigs[keys[i]]); - } - } - if (object.bargeInConfig != null) { - if (typeof object.bargeInConfig !== "object") - throw TypeError(".google.cloud.ces.v1.AudioProcessingConfig.bargeInConfig: object expected"); - message.bargeInConfig = $root.google.cloud.ces.v1.BargeInConfig.fromObject(object.bargeInConfig); - } - if (object.inactivityTimeout != null) { - if (typeof object.inactivityTimeout !== "object") - throw TypeError(".google.cloud.ces.v1.AudioProcessingConfig.inactivityTimeout: object expected"); - message.inactivityTimeout = $root.google.protobuf.Duration.fromObject(object.inactivityTimeout); - } - if (object.ambientSoundConfig != null) { - if (typeof object.ambientSoundConfig !== "object") - throw TypeError(".google.cloud.ces.v1.AudioProcessingConfig.ambientSoundConfig: object expected"); - message.ambientSoundConfig = $root.google.cloud.ces.v1.AmbientSoundConfig.fromObject(object.ambientSoundConfig); - } - return message; - }; - - /** - * Creates a plain object from an AudioProcessingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.AudioProcessingConfig - * @static - * @param {google.cloud.ces.v1.AudioProcessingConfig} message AudioProcessingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AudioProcessingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.synthesizeSpeechConfigs = {}; - if (options.defaults) { - object.bargeInConfig = null; - object.inactivityTimeout = null; - object.ambientSoundConfig = null; - } - var keys2; - if (message.synthesizeSpeechConfigs && (keys2 = Object.keys(message.synthesizeSpeechConfigs)).length) { - object.synthesizeSpeechConfigs = {}; - for (var j = 0; j < keys2.length; ++j) - object.synthesizeSpeechConfigs[keys2[j]] = $root.google.cloud.ces.v1.SynthesizeSpeechConfig.toObject(message.synthesizeSpeechConfigs[keys2[j]], options); - } - if (message.bargeInConfig != null && message.hasOwnProperty("bargeInConfig")) - object.bargeInConfig = $root.google.cloud.ces.v1.BargeInConfig.toObject(message.bargeInConfig, options); - if (message.inactivityTimeout != null && message.hasOwnProperty("inactivityTimeout")) - object.inactivityTimeout = $root.google.protobuf.Duration.toObject(message.inactivityTimeout, options); - if (message.ambientSoundConfig != null && message.hasOwnProperty("ambientSoundConfig")) - object.ambientSoundConfig = $root.google.cloud.ces.v1.AmbientSoundConfig.toObject(message.ambientSoundConfig, options); - return object; - }; - - /** - * Converts this AudioProcessingConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.AudioProcessingConfig - * @instance - * @returns {Object.} JSON object - */ - AudioProcessingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AudioProcessingConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.AudioProcessingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AudioProcessingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.AudioProcessingConfig"; - }; - - return AudioProcessingConfig; - })(); - - v1.AmbientSoundConfig = (function() { - - /** - * Properties of an AmbientSoundConfig. - * @memberof google.cloud.ces.v1 - * @interface IAmbientSoundConfig - * @property {google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise|null} [prebuiltAmbientNoise] AmbientSoundConfig prebuiltAmbientNoise - * @property {string|null} [gcsUri] AmbientSoundConfig gcsUri - * @property {string|null} [prebuiltAmbientSound] AmbientSoundConfig prebuiltAmbientSound - * @property {number|null} [volumeGainDb] AmbientSoundConfig volumeGainDb - */ - - /** - * Constructs a new AmbientSoundConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an AmbientSoundConfig. - * @implements IAmbientSoundConfig - * @constructor - * @param {google.cloud.ces.v1.IAmbientSoundConfig=} [properties] Properties to set - */ - function AmbientSoundConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AmbientSoundConfig prebuiltAmbientNoise. - * @member {google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise|null|undefined} prebuiltAmbientNoise - * @memberof google.cloud.ces.v1.AmbientSoundConfig - * @instance - */ - AmbientSoundConfig.prototype.prebuiltAmbientNoise = null; - - /** - * AmbientSoundConfig gcsUri. - * @member {string|null|undefined} gcsUri - * @memberof google.cloud.ces.v1.AmbientSoundConfig - * @instance - */ - AmbientSoundConfig.prototype.gcsUri = null; - - /** - * AmbientSoundConfig prebuiltAmbientSound. - * @member {string|null|undefined} prebuiltAmbientSound - * @memberof google.cloud.ces.v1.AmbientSoundConfig - * @instance - */ - AmbientSoundConfig.prototype.prebuiltAmbientSound = null; - - /** - * AmbientSoundConfig volumeGainDb. - * @member {number} volumeGainDb - * @memberof google.cloud.ces.v1.AmbientSoundConfig - * @instance - */ - AmbientSoundConfig.prototype.volumeGainDb = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AmbientSoundConfig source. - * @member {"prebuiltAmbientNoise"|"gcsUri"|"prebuiltAmbientSound"|undefined} source - * @memberof google.cloud.ces.v1.AmbientSoundConfig - * @instance - */ - Object.defineProperty(AmbientSoundConfig.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["prebuiltAmbientNoise", "gcsUri", "prebuiltAmbientSound"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AmbientSoundConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.AmbientSoundConfig - * @static - * @param {google.cloud.ces.v1.IAmbientSoundConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.AmbientSoundConfig} AmbientSoundConfig instance - */ - AmbientSoundConfig.create = function create(properties) { - return new AmbientSoundConfig(properties); - }; - - /** - * Encodes the specified AmbientSoundConfig message. Does not implicitly {@link google.cloud.ces.v1.AmbientSoundConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.AmbientSoundConfig - * @static - * @param {google.cloud.ces.v1.IAmbientSoundConfig} message AmbientSoundConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AmbientSoundConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.prebuiltAmbientNoise != null && Object.hasOwnProperty.call(message, "prebuiltAmbientNoise")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.prebuiltAmbientNoise); - if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsUri); - if (message.volumeGainDb != null && Object.hasOwnProperty.call(message, "volumeGainDb")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.volumeGainDb); - if (message.prebuiltAmbientSound != null && Object.hasOwnProperty.call(message, "prebuiltAmbientSound")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.prebuiltAmbientSound); - return writer; - }; - - /** - * Encodes the specified AmbientSoundConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AmbientSoundConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.AmbientSoundConfig - * @static - * @param {google.cloud.ces.v1.IAmbientSoundConfig} message AmbientSoundConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AmbientSoundConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AmbientSoundConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.AmbientSoundConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.AmbientSoundConfig} AmbientSoundConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AmbientSoundConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.AmbientSoundConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.prebuiltAmbientNoise = reader.int32(); - break; - } - case 2: { - message.gcsUri = reader.string(); - break; - } - case 4: { - message.prebuiltAmbientSound = reader.string(); - break; - } - case 3: { - message.volumeGainDb = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AmbientSoundConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.AmbientSoundConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.AmbientSoundConfig} AmbientSoundConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AmbientSoundConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AmbientSoundConfig message. - * @function verify - * @memberof google.cloud.ces.v1.AmbientSoundConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AmbientSoundConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.prebuiltAmbientNoise != null && message.hasOwnProperty("prebuiltAmbientNoise")) { - properties.source = 1; - switch (message.prebuiltAmbientNoise) { - default: - return "prebuiltAmbientNoise: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - if (!$util.isString(message.gcsUri)) - return "gcsUri: string expected"; - } - if (message.prebuiltAmbientSound != null && message.hasOwnProperty("prebuiltAmbientSound")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - if (!$util.isString(message.prebuiltAmbientSound)) - return "prebuiltAmbientSound: string expected"; - } - if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) - if (typeof message.volumeGainDb !== "number") - return "volumeGainDb: number expected"; - return null; - }; - - /** - * Creates an AmbientSoundConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.AmbientSoundConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.AmbientSoundConfig} AmbientSoundConfig - */ - AmbientSoundConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.AmbientSoundConfig) - return object; - var message = new $root.google.cloud.ces.v1.AmbientSoundConfig(); - switch (object.prebuiltAmbientNoise) { - default: - if (typeof object.prebuiltAmbientNoise === "number") { - message.prebuiltAmbientNoise = object.prebuiltAmbientNoise; - break; - } - break; - case "PREBUILT_AMBIENT_NOISE_UNSPECIFIED": - case 0: - message.prebuiltAmbientNoise = 0; - break; - case "RETAIL_STORE": - case 1: - message.prebuiltAmbientNoise = 1; - break; - case "CONVENTION_HALL": - case 2: - message.prebuiltAmbientNoise = 2; - break; - case "OUTDOOR": - case 3: - message.prebuiltAmbientNoise = 3; - break; - } - if (object.gcsUri != null) - message.gcsUri = String(object.gcsUri); - if (object.prebuiltAmbientSound != null) - message.prebuiltAmbientSound = String(object.prebuiltAmbientSound); - if (object.volumeGainDb != null) - message.volumeGainDb = Number(object.volumeGainDb); - return message; - }; - - /** - * Creates a plain object from an AmbientSoundConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.AmbientSoundConfig - * @static - * @param {google.cloud.ces.v1.AmbientSoundConfig} message AmbientSoundConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AmbientSoundConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.volumeGainDb = 0; - if (message.prebuiltAmbientNoise != null && message.hasOwnProperty("prebuiltAmbientNoise")) { - object.prebuiltAmbientNoise = options.enums === String ? $root.google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise[message.prebuiltAmbientNoise] === undefined ? message.prebuiltAmbientNoise : $root.google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise[message.prebuiltAmbientNoise] : message.prebuiltAmbientNoise; - if (options.oneofs) - object.source = "prebuiltAmbientNoise"; - } - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { - object.gcsUri = message.gcsUri; - if (options.oneofs) - object.source = "gcsUri"; - } - if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) - object.volumeGainDb = options.json && !isFinite(message.volumeGainDb) ? String(message.volumeGainDb) : message.volumeGainDb; - if (message.prebuiltAmbientSound != null && message.hasOwnProperty("prebuiltAmbientSound")) { - object.prebuiltAmbientSound = message.prebuiltAmbientSound; - if (options.oneofs) - object.source = "prebuiltAmbientSound"; - } - return object; - }; - - /** - * Converts this AmbientSoundConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.AmbientSoundConfig - * @instance - * @returns {Object.} JSON object - */ - AmbientSoundConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AmbientSoundConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.AmbientSoundConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AmbientSoundConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.AmbientSoundConfig"; - }; - - /** - * PrebuiltAmbientNoise enum. - * @name google.cloud.ces.v1.AmbientSoundConfig.PrebuiltAmbientNoise - * @enum {number} - * @property {number} PREBUILT_AMBIENT_NOISE_UNSPECIFIED=0 PREBUILT_AMBIENT_NOISE_UNSPECIFIED value - * @property {number} RETAIL_STORE=1 RETAIL_STORE value - * @property {number} CONVENTION_HALL=2 CONVENTION_HALL value - * @property {number} OUTDOOR=3 OUTDOOR value - */ - AmbientSoundConfig.PrebuiltAmbientNoise = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PREBUILT_AMBIENT_NOISE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RETAIL_STORE"] = 1; - values[valuesById[2] = "CONVENTION_HALL"] = 2; - values[valuesById[3] = "OUTDOOR"] = 3; - return values; - })(); - - return AmbientSoundConfig; - })(); - - v1.BargeInConfig = (function() { - - /** - * Properties of a BargeInConfig. - * @memberof google.cloud.ces.v1 - * @interface IBargeInConfig - * @property {boolean|null} [disableBargeIn] BargeInConfig disableBargeIn - * @property {boolean|null} [bargeInAwareness] BargeInConfig bargeInAwareness - */ - - /** - * Constructs a new BargeInConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a BargeInConfig. - * @implements IBargeInConfig - * @constructor - * @param {google.cloud.ces.v1.IBargeInConfig=} [properties] Properties to set - */ - function BargeInConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BargeInConfig disableBargeIn. - * @member {boolean} disableBargeIn - * @memberof google.cloud.ces.v1.BargeInConfig - * @instance - */ - BargeInConfig.prototype.disableBargeIn = false; - - /** - * BargeInConfig bargeInAwareness. - * @member {boolean} bargeInAwareness - * @memberof google.cloud.ces.v1.BargeInConfig - * @instance - */ - BargeInConfig.prototype.bargeInAwareness = false; - - /** - * Creates a new BargeInConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.BargeInConfig - * @static - * @param {google.cloud.ces.v1.IBargeInConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.BargeInConfig} BargeInConfig instance - */ - BargeInConfig.create = function create(properties) { - return new BargeInConfig(properties); - }; - - /** - * Encodes the specified BargeInConfig message. Does not implicitly {@link google.cloud.ces.v1.BargeInConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.BargeInConfig - * @static - * @param {google.cloud.ces.v1.IBargeInConfig} message BargeInConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BargeInConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.disableBargeIn != null && Object.hasOwnProperty.call(message, "disableBargeIn")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.disableBargeIn); - if (message.bargeInAwareness != null && Object.hasOwnProperty.call(message, "bargeInAwareness")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.bargeInAwareness); - return writer; - }; - - /** - * Encodes the specified BargeInConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BargeInConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.BargeInConfig - * @static - * @param {google.cloud.ces.v1.IBargeInConfig} message BargeInConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BargeInConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BargeInConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.BargeInConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.BargeInConfig} BargeInConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BargeInConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.BargeInConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.disableBargeIn = reader.bool(); - break; - } - case 2: { - message.bargeInAwareness = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BargeInConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.BargeInConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.BargeInConfig} BargeInConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BargeInConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BargeInConfig message. - * @function verify - * @memberof google.cloud.ces.v1.BargeInConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BargeInConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.disableBargeIn != null && message.hasOwnProperty("disableBargeIn")) - if (typeof message.disableBargeIn !== "boolean") - return "disableBargeIn: boolean expected"; - if (message.bargeInAwareness != null && message.hasOwnProperty("bargeInAwareness")) - if (typeof message.bargeInAwareness !== "boolean") - return "bargeInAwareness: boolean expected"; - return null; - }; - - /** - * Creates a BargeInConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.BargeInConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.BargeInConfig} BargeInConfig - */ - BargeInConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.BargeInConfig) - return object; - var message = new $root.google.cloud.ces.v1.BargeInConfig(); - if (object.disableBargeIn != null) - message.disableBargeIn = Boolean(object.disableBargeIn); - if (object.bargeInAwareness != null) - message.bargeInAwareness = Boolean(object.bargeInAwareness); - return message; - }; - - /** - * Creates a plain object from a BargeInConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.BargeInConfig - * @static - * @param {google.cloud.ces.v1.BargeInConfig} message BargeInConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BargeInConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.disableBargeIn = false; - object.bargeInAwareness = false; - } - if (message.disableBargeIn != null && message.hasOwnProperty("disableBargeIn")) - object.disableBargeIn = message.disableBargeIn; - if (message.bargeInAwareness != null && message.hasOwnProperty("bargeInAwareness")) - object.bargeInAwareness = message.bargeInAwareness; - return object; - }; - - /** - * Converts this BargeInConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.BargeInConfig - * @instance - * @returns {Object.} JSON object - */ - BargeInConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BargeInConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.BargeInConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BargeInConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.BargeInConfig"; - }; - - return BargeInConfig; - })(); - - v1.SynthesizeSpeechConfig = (function() { - - /** - * Properties of a SynthesizeSpeechConfig. - * @memberof google.cloud.ces.v1 - * @interface ISynthesizeSpeechConfig - * @property {string|null} [voice] SynthesizeSpeechConfig voice - * @property {number|null} [speakingRate] SynthesizeSpeechConfig speakingRate - */ - - /** - * Constructs a new SynthesizeSpeechConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a SynthesizeSpeechConfig. - * @implements ISynthesizeSpeechConfig - * @constructor - * @param {google.cloud.ces.v1.ISynthesizeSpeechConfig=} [properties] Properties to set - */ - function SynthesizeSpeechConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SynthesizeSpeechConfig voice. - * @member {string} voice - * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig - * @instance - */ - SynthesizeSpeechConfig.prototype.voice = ""; - - /** - * SynthesizeSpeechConfig speakingRate. - * @member {number} speakingRate - * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig - * @instance - */ - SynthesizeSpeechConfig.prototype.speakingRate = 0; - - /** - * Creates a new SynthesizeSpeechConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig - * @static - * @param {google.cloud.ces.v1.ISynthesizeSpeechConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.SynthesizeSpeechConfig} SynthesizeSpeechConfig instance - */ - SynthesizeSpeechConfig.create = function create(properties) { - return new SynthesizeSpeechConfig(properties); - }; - - /** - * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.ces.v1.SynthesizeSpeechConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig - * @static - * @param {google.cloud.ces.v1.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SynthesizeSpeechConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.voice != null && Object.hasOwnProperty.call(message, "voice")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.voice); - if (message.speakingRate != null && Object.hasOwnProperty.call(message, "speakingRate")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.speakingRate); - return writer; - }; - - /** - * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SynthesizeSpeechConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig - * @static - * @param {google.cloud.ces.v1.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SynthesizeSpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.SynthesizeSpeechConfig} SynthesizeSpeechConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SynthesizeSpeechConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.SynthesizeSpeechConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.voice = reader.string(); - break; - } - case 2: { - message.speakingRate = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.SynthesizeSpeechConfig} SynthesizeSpeechConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SynthesizeSpeechConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SynthesizeSpeechConfig message. - * @function verify - * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SynthesizeSpeechConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.voice != null && message.hasOwnProperty("voice")) - if (!$util.isString(message.voice)) - return "voice: string expected"; - if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) - if (typeof message.speakingRate !== "number") - return "speakingRate: number expected"; - return null; - }; - - /** - * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.SynthesizeSpeechConfig} SynthesizeSpeechConfig - */ - SynthesizeSpeechConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.SynthesizeSpeechConfig) - return object; - var message = new $root.google.cloud.ces.v1.SynthesizeSpeechConfig(); - if (object.voice != null) - message.voice = String(object.voice); - if (object.speakingRate != null) - message.speakingRate = Number(object.speakingRate); - return message; - }; - - /** - * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig - * @static - * @param {google.cloud.ces.v1.SynthesizeSpeechConfig} message SynthesizeSpeechConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SynthesizeSpeechConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.voice = ""; - object.speakingRate = 0; - } - if (message.voice != null && message.hasOwnProperty("voice")) - object.voice = message.voice; - if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) - object.speakingRate = options.json && !isFinite(message.speakingRate) ? String(message.speakingRate) : message.speakingRate; - return object; - }; - - /** - * Converts this SynthesizeSpeechConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig - * @instance - * @returns {Object.} JSON object - */ - SynthesizeSpeechConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SynthesizeSpeechConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.SynthesizeSpeechConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SynthesizeSpeechConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.SynthesizeSpeechConfig"; - }; - - return SynthesizeSpeechConfig; - })(); - - v1.MetricAnalysisSettings = (function() { - - /** - * Properties of a MetricAnalysisSettings. - * @memberof google.cloud.ces.v1 - * @interface IMetricAnalysisSettings - * @property {boolean|null} [llmMetricsOptedOut] MetricAnalysisSettings llmMetricsOptedOut - */ - - /** - * Constructs a new MetricAnalysisSettings. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a MetricAnalysisSettings. - * @implements IMetricAnalysisSettings - * @constructor - * @param {google.cloud.ces.v1.IMetricAnalysisSettings=} [properties] Properties to set - */ - function MetricAnalysisSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MetricAnalysisSettings llmMetricsOptedOut. - * @member {boolean} llmMetricsOptedOut - * @memberof google.cloud.ces.v1.MetricAnalysisSettings - * @instance - */ - MetricAnalysisSettings.prototype.llmMetricsOptedOut = false; - - /** - * Creates a new MetricAnalysisSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.MetricAnalysisSettings - * @static - * @param {google.cloud.ces.v1.IMetricAnalysisSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1.MetricAnalysisSettings} MetricAnalysisSettings instance - */ - MetricAnalysisSettings.create = function create(properties) { - return new MetricAnalysisSettings(properties); - }; - - /** - * Encodes the specified MetricAnalysisSettings message. Does not implicitly {@link google.cloud.ces.v1.MetricAnalysisSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.MetricAnalysisSettings - * @static - * @param {google.cloud.ces.v1.IMetricAnalysisSettings} message MetricAnalysisSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricAnalysisSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.llmMetricsOptedOut != null && Object.hasOwnProperty.call(message, "llmMetricsOptedOut")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.llmMetricsOptedOut); - return writer; - }; - - /** - * Encodes the specified MetricAnalysisSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.MetricAnalysisSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.MetricAnalysisSettings - * @static - * @param {google.cloud.ces.v1.IMetricAnalysisSettings} message MetricAnalysisSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricAnalysisSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MetricAnalysisSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.MetricAnalysisSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.MetricAnalysisSettings} MetricAnalysisSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricAnalysisSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.MetricAnalysisSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.llmMetricsOptedOut = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MetricAnalysisSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.MetricAnalysisSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.MetricAnalysisSettings} MetricAnalysisSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricAnalysisSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MetricAnalysisSettings message. - * @function verify - * @memberof google.cloud.ces.v1.MetricAnalysisSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MetricAnalysisSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.llmMetricsOptedOut != null && message.hasOwnProperty("llmMetricsOptedOut")) - if (typeof message.llmMetricsOptedOut !== "boolean") - return "llmMetricsOptedOut: boolean expected"; - return null; - }; - - /** - * Creates a MetricAnalysisSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.MetricAnalysisSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.MetricAnalysisSettings} MetricAnalysisSettings - */ - MetricAnalysisSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.MetricAnalysisSettings) - return object; - var message = new $root.google.cloud.ces.v1.MetricAnalysisSettings(); - if (object.llmMetricsOptedOut != null) - message.llmMetricsOptedOut = Boolean(object.llmMetricsOptedOut); - return message; - }; - - /** - * Creates a plain object from a MetricAnalysisSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.MetricAnalysisSettings - * @static - * @param {google.cloud.ces.v1.MetricAnalysisSettings} message MetricAnalysisSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MetricAnalysisSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.llmMetricsOptedOut = false; - if (message.llmMetricsOptedOut != null && message.hasOwnProperty("llmMetricsOptedOut")) - object.llmMetricsOptedOut = message.llmMetricsOptedOut; - return object; - }; - - /** - * Converts this MetricAnalysisSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.MetricAnalysisSettings - * @instance - * @returns {Object.} JSON object - */ - MetricAnalysisSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MetricAnalysisSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1.MetricAnalysisSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MetricAnalysisSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.MetricAnalysisSettings"; - }; - - return MetricAnalysisSettings; - })(); - - v1.LoggingSettings = (function() { - - /** - * Properties of a LoggingSettings. - * @memberof google.cloud.ces.v1 - * @interface ILoggingSettings - * @property {google.cloud.ces.v1.IRedactionConfig|null} [redactionConfig] LoggingSettings redactionConfig - * @property {google.cloud.ces.v1.IAudioRecordingConfig|null} [audioRecordingConfig] LoggingSettings audioRecordingConfig - * @property {google.cloud.ces.v1.IBigQueryExportSettings|null} [bigqueryExportSettings] LoggingSettings bigqueryExportSettings - * @property {google.cloud.ces.v1.ICloudLoggingSettings|null} [cloudLoggingSettings] LoggingSettings cloudLoggingSettings - * @property {google.cloud.ces.v1.IConversationLoggingSettings|null} [conversationLoggingSettings] LoggingSettings conversationLoggingSettings - * @property {google.cloud.ces.v1.IAudioRecordingConfig|null} [evaluationAudioRecordingConfig] LoggingSettings evaluationAudioRecordingConfig - * @property {google.cloud.ces.v1.IMetricAnalysisSettings|null} [metricAnalysisSettings] LoggingSettings metricAnalysisSettings - */ - - /** - * Constructs a new LoggingSettings. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a LoggingSettings. - * @implements ILoggingSettings - * @constructor - * @param {google.cloud.ces.v1.ILoggingSettings=} [properties] Properties to set - */ - function LoggingSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LoggingSettings redactionConfig. - * @member {google.cloud.ces.v1.IRedactionConfig|null|undefined} redactionConfig - * @memberof google.cloud.ces.v1.LoggingSettings - * @instance - */ - LoggingSettings.prototype.redactionConfig = null; - - /** - * LoggingSettings audioRecordingConfig. - * @member {google.cloud.ces.v1.IAudioRecordingConfig|null|undefined} audioRecordingConfig - * @memberof google.cloud.ces.v1.LoggingSettings - * @instance - */ - LoggingSettings.prototype.audioRecordingConfig = null; - - /** - * LoggingSettings bigqueryExportSettings. - * @member {google.cloud.ces.v1.IBigQueryExportSettings|null|undefined} bigqueryExportSettings - * @memberof google.cloud.ces.v1.LoggingSettings - * @instance - */ - LoggingSettings.prototype.bigqueryExportSettings = null; - - /** - * LoggingSettings cloudLoggingSettings. - * @member {google.cloud.ces.v1.ICloudLoggingSettings|null|undefined} cloudLoggingSettings - * @memberof google.cloud.ces.v1.LoggingSettings - * @instance - */ - LoggingSettings.prototype.cloudLoggingSettings = null; - - /** - * LoggingSettings conversationLoggingSettings. - * @member {google.cloud.ces.v1.IConversationLoggingSettings|null|undefined} conversationLoggingSettings - * @memberof google.cloud.ces.v1.LoggingSettings - * @instance - */ - LoggingSettings.prototype.conversationLoggingSettings = null; - - /** - * LoggingSettings evaluationAudioRecordingConfig. - * @member {google.cloud.ces.v1.IAudioRecordingConfig|null|undefined} evaluationAudioRecordingConfig - * @memberof google.cloud.ces.v1.LoggingSettings - * @instance - */ - LoggingSettings.prototype.evaluationAudioRecordingConfig = null; - - /** - * LoggingSettings metricAnalysisSettings. - * @member {google.cloud.ces.v1.IMetricAnalysisSettings|null|undefined} metricAnalysisSettings - * @memberof google.cloud.ces.v1.LoggingSettings - * @instance - */ - LoggingSettings.prototype.metricAnalysisSettings = null; - - /** - * Creates a new LoggingSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.LoggingSettings - * @static - * @param {google.cloud.ces.v1.ILoggingSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1.LoggingSettings} LoggingSettings instance - */ - LoggingSettings.create = function create(properties) { - return new LoggingSettings(properties); - }; - - /** - * Encodes the specified LoggingSettings message. Does not implicitly {@link google.cloud.ces.v1.LoggingSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.LoggingSettings - * @static - * @param {google.cloud.ces.v1.ILoggingSettings} message LoggingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LoggingSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.redactionConfig != null && Object.hasOwnProperty.call(message, "redactionConfig")) - $root.google.cloud.ces.v1.RedactionConfig.encode(message.redactionConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.audioRecordingConfig != null && Object.hasOwnProperty.call(message, "audioRecordingConfig")) - $root.google.cloud.ces.v1.AudioRecordingConfig.encode(message.audioRecordingConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.bigqueryExportSettings != null && Object.hasOwnProperty.call(message, "bigqueryExportSettings")) - $root.google.cloud.ces.v1.BigQueryExportSettings.encode(message.bigqueryExportSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.cloudLoggingSettings != null && Object.hasOwnProperty.call(message, "cloudLoggingSettings")) - $root.google.cloud.ces.v1.CloudLoggingSettings.encode(message.cloudLoggingSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.conversationLoggingSettings != null && Object.hasOwnProperty.call(message, "conversationLoggingSettings")) - $root.google.cloud.ces.v1.ConversationLoggingSettings.encode(message.conversationLoggingSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.evaluationAudioRecordingConfig != null && Object.hasOwnProperty.call(message, "evaluationAudioRecordingConfig")) - $root.google.cloud.ces.v1.AudioRecordingConfig.encode(message.evaluationAudioRecordingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.metricAnalysisSettings != null && Object.hasOwnProperty.call(message, "metricAnalysisSettings")) - $root.google.cloud.ces.v1.MetricAnalysisSettings.encode(message.metricAnalysisSettings, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.LoggingSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.LoggingSettings - * @static - * @param {google.cloud.ces.v1.ILoggingSettings} message LoggingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LoggingSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LoggingSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.LoggingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.LoggingSettings} LoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LoggingSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.LoggingSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.redactionConfig = $root.google.cloud.ces.v1.RedactionConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.audioRecordingConfig = $root.google.cloud.ces.v1.AudioRecordingConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.bigqueryExportSettings = $root.google.cloud.ces.v1.BigQueryExportSettings.decode(reader, reader.uint32()); - break; - } - case 4: { - message.cloudLoggingSettings = $root.google.cloud.ces.v1.CloudLoggingSettings.decode(reader, reader.uint32()); - break; - } - case 5: { - message.conversationLoggingSettings = $root.google.cloud.ces.v1.ConversationLoggingSettings.decode(reader, reader.uint32()); - break; - } - case 6: { - message.evaluationAudioRecordingConfig = $root.google.cloud.ces.v1.AudioRecordingConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.metricAnalysisSettings = $root.google.cloud.ces.v1.MetricAnalysisSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LoggingSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.LoggingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.LoggingSettings} LoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LoggingSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LoggingSettings message. - * @function verify - * @memberof google.cloud.ces.v1.LoggingSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LoggingSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.redactionConfig != null && message.hasOwnProperty("redactionConfig")) { - var error = $root.google.cloud.ces.v1.RedactionConfig.verify(message.redactionConfig); - if (error) - return "redactionConfig." + error; - } - if (message.audioRecordingConfig != null && message.hasOwnProperty("audioRecordingConfig")) { - var error = $root.google.cloud.ces.v1.AudioRecordingConfig.verify(message.audioRecordingConfig); - if (error) - return "audioRecordingConfig." + error; - } - if (message.bigqueryExportSettings != null && message.hasOwnProperty("bigqueryExportSettings")) { - var error = $root.google.cloud.ces.v1.BigQueryExportSettings.verify(message.bigqueryExportSettings); - if (error) - return "bigqueryExportSettings." + error; - } - if (message.cloudLoggingSettings != null && message.hasOwnProperty("cloudLoggingSettings")) { - var error = $root.google.cloud.ces.v1.CloudLoggingSettings.verify(message.cloudLoggingSettings); - if (error) - return "cloudLoggingSettings." + error; - } - if (message.conversationLoggingSettings != null && message.hasOwnProperty("conversationLoggingSettings")) { - var error = $root.google.cloud.ces.v1.ConversationLoggingSettings.verify(message.conversationLoggingSettings); - if (error) - return "conversationLoggingSettings." + error; - } - if (message.evaluationAudioRecordingConfig != null && message.hasOwnProperty("evaluationAudioRecordingConfig")) { - var error = $root.google.cloud.ces.v1.AudioRecordingConfig.verify(message.evaluationAudioRecordingConfig); - if (error) - return "evaluationAudioRecordingConfig." + error; - } - if (message.metricAnalysisSettings != null && message.hasOwnProperty("metricAnalysisSettings")) { - var error = $root.google.cloud.ces.v1.MetricAnalysisSettings.verify(message.metricAnalysisSettings); - if (error) - return "metricAnalysisSettings." + error; - } - return null; - }; - - /** - * Creates a LoggingSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.LoggingSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.LoggingSettings} LoggingSettings - */ - LoggingSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.LoggingSettings) - return object; - var message = new $root.google.cloud.ces.v1.LoggingSettings(); - if (object.redactionConfig != null) { - if (typeof object.redactionConfig !== "object") - throw TypeError(".google.cloud.ces.v1.LoggingSettings.redactionConfig: object expected"); - message.redactionConfig = $root.google.cloud.ces.v1.RedactionConfig.fromObject(object.redactionConfig); - } - if (object.audioRecordingConfig != null) { - if (typeof object.audioRecordingConfig !== "object") - throw TypeError(".google.cloud.ces.v1.LoggingSettings.audioRecordingConfig: object expected"); - message.audioRecordingConfig = $root.google.cloud.ces.v1.AudioRecordingConfig.fromObject(object.audioRecordingConfig); - } - if (object.bigqueryExportSettings != null) { - if (typeof object.bigqueryExportSettings !== "object") - throw TypeError(".google.cloud.ces.v1.LoggingSettings.bigqueryExportSettings: object expected"); - message.bigqueryExportSettings = $root.google.cloud.ces.v1.BigQueryExportSettings.fromObject(object.bigqueryExportSettings); - } - if (object.cloudLoggingSettings != null) { - if (typeof object.cloudLoggingSettings !== "object") - throw TypeError(".google.cloud.ces.v1.LoggingSettings.cloudLoggingSettings: object expected"); - message.cloudLoggingSettings = $root.google.cloud.ces.v1.CloudLoggingSettings.fromObject(object.cloudLoggingSettings); - } - if (object.conversationLoggingSettings != null) { - if (typeof object.conversationLoggingSettings !== "object") - throw TypeError(".google.cloud.ces.v1.LoggingSettings.conversationLoggingSettings: object expected"); - message.conversationLoggingSettings = $root.google.cloud.ces.v1.ConversationLoggingSettings.fromObject(object.conversationLoggingSettings); - } - if (object.evaluationAudioRecordingConfig != null) { - if (typeof object.evaluationAudioRecordingConfig !== "object") - throw TypeError(".google.cloud.ces.v1.LoggingSettings.evaluationAudioRecordingConfig: object expected"); - message.evaluationAudioRecordingConfig = $root.google.cloud.ces.v1.AudioRecordingConfig.fromObject(object.evaluationAudioRecordingConfig); - } - if (object.metricAnalysisSettings != null) { - if (typeof object.metricAnalysisSettings !== "object") - throw TypeError(".google.cloud.ces.v1.LoggingSettings.metricAnalysisSettings: object expected"); - message.metricAnalysisSettings = $root.google.cloud.ces.v1.MetricAnalysisSettings.fromObject(object.metricAnalysisSettings); - } - return message; - }; - - /** - * Creates a plain object from a LoggingSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.LoggingSettings - * @static - * @param {google.cloud.ces.v1.LoggingSettings} message LoggingSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LoggingSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.redactionConfig = null; - object.audioRecordingConfig = null; - object.bigqueryExportSettings = null; - object.cloudLoggingSettings = null; - object.conversationLoggingSettings = null; - object.evaluationAudioRecordingConfig = null; - object.metricAnalysisSettings = null; - } - if (message.redactionConfig != null && message.hasOwnProperty("redactionConfig")) - object.redactionConfig = $root.google.cloud.ces.v1.RedactionConfig.toObject(message.redactionConfig, options); - if (message.audioRecordingConfig != null && message.hasOwnProperty("audioRecordingConfig")) - object.audioRecordingConfig = $root.google.cloud.ces.v1.AudioRecordingConfig.toObject(message.audioRecordingConfig, options); - if (message.bigqueryExportSettings != null && message.hasOwnProperty("bigqueryExportSettings")) - object.bigqueryExportSettings = $root.google.cloud.ces.v1.BigQueryExportSettings.toObject(message.bigqueryExportSettings, options); - if (message.cloudLoggingSettings != null && message.hasOwnProperty("cloudLoggingSettings")) - object.cloudLoggingSettings = $root.google.cloud.ces.v1.CloudLoggingSettings.toObject(message.cloudLoggingSettings, options); - if (message.conversationLoggingSettings != null && message.hasOwnProperty("conversationLoggingSettings")) - object.conversationLoggingSettings = $root.google.cloud.ces.v1.ConversationLoggingSettings.toObject(message.conversationLoggingSettings, options); - if (message.evaluationAudioRecordingConfig != null && message.hasOwnProperty("evaluationAudioRecordingConfig")) - object.evaluationAudioRecordingConfig = $root.google.cloud.ces.v1.AudioRecordingConfig.toObject(message.evaluationAudioRecordingConfig, options); - if (message.metricAnalysisSettings != null && message.hasOwnProperty("metricAnalysisSettings")) - object.metricAnalysisSettings = $root.google.cloud.ces.v1.MetricAnalysisSettings.toObject(message.metricAnalysisSettings, options); - return object; - }; - - /** - * Converts this LoggingSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.LoggingSettings - * @instance - * @returns {Object.} JSON object - */ - LoggingSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LoggingSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1.LoggingSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LoggingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.LoggingSettings"; - }; - - return LoggingSettings; - })(); - - v1.EvaluationMetricsThresholds = (function() { - - /** - * Properties of an EvaluationMetricsThresholds. - * @memberof google.cloud.ces.v1 - * @interface IEvaluationMetricsThresholds - * @property {google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null} [goldenEvaluationMetricsThresholds] EvaluationMetricsThresholds goldenEvaluationMetricsThresholds - * @property {google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|null} [hallucinationMetricBehavior] EvaluationMetricsThresholds hallucinationMetricBehavior - * @property {google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|null} [goldenHallucinationMetricBehavior] EvaluationMetricsThresholds goldenHallucinationMetricBehavior - * @property {google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior|null} [scenarioHallucinationMetricBehavior] EvaluationMetricsThresholds scenarioHallucinationMetricBehavior - */ - - /** - * Constructs a new EvaluationMetricsThresholds. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an EvaluationMetricsThresholds. - * @implements IEvaluationMetricsThresholds - * @constructor - * @param {google.cloud.ces.v1.IEvaluationMetricsThresholds=} [properties] Properties to set - */ - function EvaluationMetricsThresholds(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluationMetricsThresholds goldenEvaluationMetricsThresholds. - * @member {google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null|undefined} goldenEvaluationMetricsThresholds - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds - * @instance - */ - EvaluationMetricsThresholds.prototype.goldenEvaluationMetricsThresholds = null; - - /** - * EvaluationMetricsThresholds hallucinationMetricBehavior. - * @member {google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior} hallucinationMetricBehavior - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds - * @instance - */ - EvaluationMetricsThresholds.prototype.hallucinationMetricBehavior = 0; - - /** - * EvaluationMetricsThresholds goldenHallucinationMetricBehavior. - * @member {google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior} goldenHallucinationMetricBehavior - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds - * @instance - */ - EvaluationMetricsThresholds.prototype.goldenHallucinationMetricBehavior = 0; - - /** - * EvaluationMetricsThresholds scenarioHallucinationMetricBehavior. - * @member {google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior} scenarioHallucinationMetricBehavior - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds - * @instance - */ - EvaluationMetricsThresholds.prototype.scenarioHallucinationMetricBehavior = 0; - - /** - * Creates a new EvaluationMetricsThresholds instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds - * @static - * @param {google.cloud.ces.v1.IEvaluationMetricsThresholds=} [properties] Properties to set - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds} EvaluationMetricsThresholds instance - */ - EvaluationMetricsThresholds.create = function create(properties) { - return new EvaluationMetricsThresholds(properties); - }; - - /** - * Encodes the specified EvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds - * @static - * @param {google.cloud.ces.v1.IEvaluationMetricsThresholds} message EvaluationMetricsThresholds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationMetricsThresholds.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.goldenEvaluationMetricsThresholds != null && Object.hasOwnProperty.call(message, "goldenEvaluationMetricsThresholds")) - $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.encode(message.goldenEvaluationMetricsThresholds, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.hallucinationMetricBehavior != null && Object.hasOwnProperty.call(message, "hallucinationMetricBehavior")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.hallucinationMetricBehavior); - if (message.scenarioHallucinationMetricBehavior != null && Object.hasOwnProperty.call(message, "scenarioHallucinationMetricBehavior")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.scenarioHallucinationMetricBehavior); - if (message.goldenHallucinationMetricBehavior != null && Object.hasOwnProperty.call(message, "goldenHallucinationMetricBehavior")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.goldenHallucinationMetricBehavior); - return writer; - }; - - /** - * Encodes the specified EvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds - * @static - * @param {google.cloud.ces.v1.IEvaluationMetricsThresholds} message EvaluationMetricsThresholds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds} EvaluationMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationMetricsThresholds.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.goldenEvaluationMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.decode(reader, reader.uint32()); - break; - } - case 3: { - message.hallucinationMetricBehavior = reader.int32(); - break; - } - case 5: { - message.goldenHallucinationMetricBehavior = reader.int32(); - break; - } - case 4: { - message.scenarioHallucinationMetricBehavior = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds} EvaluationMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluationMetricsThresholds message. - * @function verify - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluationMetricsThresholds.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.goldenEvaluationMetricsThresholds != null && message.hasOwnProperty("goldenEvaluationMetricsThresholds")) { - var error = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify(message.goldenEvaluationMetricsThresholds); - if (error) - return "goldenEvaluationMetricsThresholds." + error; - } - if (message.hallucinationMetricBehavior != null && message.hasOwnProperty("hallucinationMetricBehavior")) - switch (message.hallucinationMetricBehavior) { - default: - return "hallucinationMetricBehavior: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.goldenHallucinationMetricBehavior != null && message.hasOwnProperty("goldenHallucinationMetricBehavior")) - switch (message.goldenHallucinationMetricBehavior) { - default: - return "goldenHallucinationMetricBehavior: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.scenarioHallucinationMetricBehavior != null && message.hasOwnProperty("scenarioHallucinationMetricBehavior")) - switch (message.scenarioHallucinationMetricBehavior) { - default: - return "scenarioHallucinationMetricBehavior: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an EvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds} EvaluationMetricsThresholds - */ - EvaluationMetricsThresholds.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.EvaluationMetricsThresholds) - return object; - var message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds(); - if (object.goldenEvaluationMetricsThresholds != null) { - if (typeof object.goldenEvaluationMetricsThresholds !== "object") - throw TypeError(".google.cloud.ces.v1.EvaluationMetricsThresholds.goldenEvaluationMetricsThresholds: object expected"); - message.goldenEvaluationMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.fromObject(object.goldenEvaluationMetricsThresholds); - } - switch (object.hallucinationMetricBehavior) { - default: - if (typeof object.hallucinationMetricBehavior === "number") { - message.hallucinationMetricBehavior = object.hallucinationMetricBehavior; - break; - } - break; - case "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": - case 0: - message.hallucinationMetricBehavior = 0; - break; - case "DISABLED": - case 1: - message.hallucinationMetricBehavior = 1; - break; - case "ENABLED": - case 2: - message.hallucinationMetricBehavior = 2; - break; - } - switch (object.goldenHallucinationMetricBehavior) { - default: - if (typeof object.goldenHallucinationMetricBehavior === "number") { - message.goldenHallucinationMetricBehavior = object.goldenHallucinationMetricBehavior; - break; - } - break; - case "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": - case 0: - message.goldenHallucinationMetricBehavior = 0; - break; - case "DISABLED": - case 1: - message.goldenHallucinationMetricBehavior = 1; - break; - case "ENABLED": - case 2: - message.goldenHallucinationMetricBehavior = 2; - break; - } - switch (object.scenarioHallucinationMetricBehavior) { - default: - if (typeof object.scenarioHallucinationMetricBehavior === "number") { - message.scenarioHallucinationMetricBehavior = object.scenarioHallucinationMetricBehavior; - break; - } - break; - case "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": - case 0: - message.scenarioHallucinationMetricBehavior = 0; - break; - case "DISABLED": - case 1: - message.scenarioHallucinationMetricBehavior = 1; - break; - case "ENABLED": - case 2: - message.scenarioHallucinationMetricBehavior = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an EvaluationMetricsThresholds message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds - * @static - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds} message EvaluationMetricsThresholds - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluationMetricsThresholds.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.goldenEvaluationMetricsThresholds = null; - object.hallucinationMetricBehavior = options.enums === String ? "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" : 0; - object.scenarioHallucinationMetricBehavior = options.enums === String ? "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" : 0; - object.goldenHallucinationMetricBehavior = options.enums === String ? "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" : 0; - } - if (message.goldenEvaluationMetricsThresholds != null && message.hasOwnProperty("goldenEvaluationMetricsThresholds")) - object.goldenEvaluationMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.toObject(message.goldenEvaluationMetricsThresholds, options); - if (message.hallucinationMetricBehavior != null && message.hasOwnProperty("hallucinationMetricBehavior")) - object.hallucinationMetricBehavior = options.enums === String ? $root.google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.hallucinationMetricBehavior] === undefined ? message.hallucinationMetricBehavior : $root.google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.hallucinationMetricBehavior] : message.hallucinationMetricBehavior; - if (message.scenarioHallucinationMetricBehavior != null && message.hasOwnProperty("scenarioHallucinationMetricBehavior")) - object.scenarioHallucinationMetricBehavior = options.enums === String ? $root.google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.scenarioHallucinationMetricBehavior] === undefined ? message.scenarioHallucinationMetricBehavior : $root.google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.scenarioHallucinationMetricBehavior] : message.scenarioHallucinationMetricBehavior; - if (message.goldenHallucinationMetricBehavior != null && message.hasOwnProperty("goldenHallucinationMetricBehavior")) - object.goldenHallucinationMetricBehavior = options.enums === String ? $root.google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.goldenHallucinationMetricBehavior] === undefined ? message.goldenHallucinationMetricBehavior : $root.google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.goldenHallucinationMetricBehavior] : message.goldenHallucinationMetricBehavior; - return object; - }; - - /** - * Converts this EvaluationMetricsThresholds to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds - * @instance - * @returns {Object.} JSON object - */ - EvaluationMetricsThresholds.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluationMetricsThresholds - * @function getTypeUrl - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluationMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.EvaluationMetricsThresholds"; - }; - - EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds = (function() { - - /** - * Properties of a GoldenEvaluationMetricsThresholds. - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds - * @interface IGoldenEvaluationMetricsThresholds - * @property {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null} [turnLevelMetricsThresholds] GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds - * @property {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null} [expectationLevelMetricsThresholds] GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds - * @property {google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings|null} [toolMatchingSettings] GoldenEvaluationMetricsThresholds toolMatchingSettings - */ - - /** - * Constructs a new GoldenEvaluationMetricsThresholds. - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds - * @classdesc Represents a GoldenEvaluationMetricsThresholds. - * @implements IGoldenEvaluationMetricsThresholds - * @constructor - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds=} [properties] Properties to set - */ - function GoldenEvaluationMetricsThresholds(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds. - * @member {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null|undefined} turnLevelMetricsThresholds - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @instance - */ - GoldenEvaluationMetricsThresholds.prototype.turnLevelMetricsThresholds = null; - - /** - * GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds. - * @member {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null|undefined} expectationLevelMetricsThresholds - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @instance - */ - GoldenEvaluationMetricsThresholds.prototype.expectationLevelMetricsThresholds = null; - - /** - * GoldenEvaluationMetricsThresholds toolMatchingSettings. - * @member {google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings|null|undefined} toolMatchingSettings - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @instance - */ - GoldenEvaluationMetricsThresholds.prototype.toolMatchingSettings = null; - - /** - * Creates a new GoldenEvaluationMetricsThresholds instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @static - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds=} [properties] Properties to set - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds instance - */ - GoldenEvaluationMetricsThresholds.create = function create(properties) { - return new GoldenEvaluationMetricsThresholds(properties); - }; - - /** - * Encodes the specified GoldenEvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @static - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds} message GoldenEvaluationMetricsThresholds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoldenEvaluationMetricsThresholds.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.turnLevelMetricsThresholds != null && Object.hasOwnProperty.call(message, "turnLevelMetricsThresholds")) - $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.encode(message.turnLevelMetricsThresholds, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.expectationLevelMetricsThresholds != null && Object.hasOwnProperty.call(message, "expectationLevelMetricsThresholds")) - $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.encode(message.expectationLevelMetricsThresholds, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.toolMatchingSettings != null && Object.hasOwnProperty.call(message, "toolMatchingSettings")) - $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.encode(message.toolMatchingSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoldenEvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @static - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds} message GoldenEvaluationMetricsThresholds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoldenEvaluationMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoldenEvaluationMetricsThresholds.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.turnLevelMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.decode(reader, reader.uint32()); - break; - } - case 2: { - message.expectationLevelMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.decode(reader, reader.uint32()); - break; - } - case 3: { - message.toolMatchingSettings = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoldenEvaluationMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoldenEvaluationMetricsThresholds message. - * @function verify - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoldenEvaluationMetricsThresholds.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.turnLevelMetricsThresholds != null && message.hasOwnProperty("turnLevelMetricsThresholds")) { - var error = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify(message.turnLevelMetricsThresholds); - if (error) - return "turnLevelMetricsThresholds." + error; - } - if (message.expectationLevelMetricsThresholds != null && message.hasOwnProperty("expectationLevelMetricsThresholds")) { - var error = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify(message.expectationLevelMetricsThresholds); - if (error) - return "expectationLevelMetricsThresholds." + error; - } - if (message.toolMatchingSettings != null && message.hasOwnProperty("toolMatchingSettings")) { - var error = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.verify(message.toolMatchingSettings); - if (error) - return "toolMatchingSettings." + error; - } - return null; - }; - - /** - * Creates a GoldenEvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds - */ - GoldenEvaluationMetricsThresholds.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds) - return object; - var message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds(); - if (object.turnLevelMetricsThresholds != null) { - if (typeof object.turnLevelMetricsThresholds !== "object") - throw TypeError(".google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.turnLevelMetricsThresholds: object expected"); - message.turnLevelMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.fromObject(object.turnLevelMetricsThresholds); - } - if (object.expectationLevelMetricsThresholds != null) { - if (typeof object.expectationLevelMetricsThresholds !== "object") - throw TypeError(".google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.expectationLevelMetricsThresholds: object expected"); - message.expectationLevelMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.fromObject(object.expectationLevelMetricsThresholds); - } - if (object.toolMatchingSettings != null) { - if (typeof object.toolMatchingSettings !== "object") - throw TypeError(".google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.toolMatchingSettings: object expected"); - message.toolMatchingSettings = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.fromObject(object.toolMatchingSettings); - } - return message; - }; - - /** - * Creates a plain object from a GoldenEvaluationMetricsThresholds message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @static - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} message GoldenEvaluationMetricsThresholds - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoldenEvaluationMetricsThresholds.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.turnLevelMetricsThresholds = null; - object.expectationLevelMetricsThresholds = null; - object.toolMatchingSettings = null; - } - if (message.turnLevelMetricsThresholds != null && message.hasOwnProperty("turnLevelMetricsThresholds")) - object.turnLevelMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.toObject(message.turnLevelMetricsThresholds, options); - if (message.expectationLevelMetricsThresholds != null && message.hasOwnProperty("expectationLevelMetricsThresholds")) - object.expectationLevelMetricsThresholds = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.toObject(message.expectationLevelMetricsThresholds, options); - if (message.toolMatchingSettings != null && message.hasOwnProperty("toolMatchingSettings")) - object.toolMatchingSettings = $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.toObject(message.toolMatchingSettings, options); - return object; - }; - - /** - * Converts this GoldenEvaluationMetricsThresholds to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @instance - * @returns {Object.} JSON object - */ - GoldenEvaluationMetricsThresholds.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoldenEvaluationMetricsThresholds - * @function getTypeUrl - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoldenEvaluationMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds"; - }; - - GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds = (function() { - - /** - * Properties of a TurnLevelMetricsThresholds. - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @interface ITurnLevelMetricsThresholds - * @property {number|null} [semanticSimilaritySuccessThreshold] TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold - * @property {number|null} [overallToolInvocationCorrectnessThreshold] TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold - * @property {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|null} [semanticSimilarityChannel] TurnLevelMetricsThresholds semanticSimilarityChannel - */ - - /** - * Constructs a new TurnLevelMetricsThresholds. - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @classdesc Represents a TurnLevelMetricsThresholds. - * @implements ITurnLevelMetricsThresholds - * @constructor - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds=} [properties] Properties to set - */ - function TurnLevelMetricsThresholds(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold. - * @member {number|null|undefined} semanticSimilaritySuccessThreshold - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @instance - */ - TurnLevelMetricsThresholds.prototype.semanticSimilaritySuccessThreshold = null; - - /** - * TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold. - * @member {number|null|undefined} overallToolInvocationCorrectnessThreshold - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @instance - */ - TurnLevelMetricsThresholds.prototype.overallToolInvocationCorrectnessThreshold = null; - - /** - * TurnLevelMetricsThresholds semanticSimilarityChannel. - * @member {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel} semanticSimilarityChannel - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @instance - */ - TurnLevelMetricsThresholds.prototype.semanticSimilarityChannel = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(TurnLevelMetricsThresholds.prototype, "_semanticSimilaritySuccessThreshold", { - get: $util.oneOfGetter($oneOfFields = ["semanticSimilaritySuccessThreshold"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(TurnLevelMetricsThresholds.prototype, "_overallToolInvocationCorrectnessThreshold", { - get: $util.oneOfGetter($oneOfFields = ["overallToolInvocationCorrectnessThreshold"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TurnLevelMetricsThresholds instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @static - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds=} [properties] Properties to set - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds instance - */ - TurnLevelMetricsThresholds.create = function create(properties) { - return new TurnLevelMetricsThresholds(properties); - }; - - /** - * Encodes the specified TurnLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @static - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds} message TurnLevelMetricsThresholds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TurnLevelMetricsThresholds.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.semanticSimilaritySuccessThreshold != null && Object.hasOwnProperty.call(message, "semanticSimilaritySuccessThreshold")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.semanticSimilaritySuccessThreshold); - if (message.overallToolInvocationCorrectnessThreshold != null && Object.hasOwnProperty.call(message, "overallToolInvocationCorrectnessThreshold")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.overallToolInvocationCorrectnessThreshold); - if (message.semanticSimilarityChannel != null && Object.hasOwnProperty.call(message, "semanticSimilarityChannel")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.semanticSimilarityChannel); - return writer; - }; - - /** - * Encodes the specified TurnLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @static - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds} message TurnLevelMetricsThresholds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TurnLevelMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TurnLevelMetricsThresholds.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.semanticSimilaritySuccessThreshold = reader.int32(); - break; - } - case 2: { - message.overallToolInvocationCorrectnessThreshold = reader.float(); - break; - } - case 3: { - message.semanticSimilarityChannel = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TurnLevelMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TurnLevelMetricsThresholds message. - * @function verify - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TurnLevelMetricsThresholds.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.semanticSimilaritySuccessThreshold != null && message.hasOwnProperty("semanticSimilaritySuccessThreshold")) { - properties._semanticSimilaritySuccessThreshold = 1; - if (!$util.isInteger(message.semanticSimilaritySuccessThreshold)) - return "semanticSimilaritySuccessThreshold: integer expected"; - } - if (message.overallToolInvocationCorrectnessThreshold != null && message.hasOwnProperty("overallToolInvocationCorrectnessThreshold")) { - properties._overallToolInvocationCorrectnessThreshold = 1; - if (typeof message.overallToolInvocationCorrectnessThreshold !== "number") - return "overallToolInvocationCorrectnessThreshold: number expected"; - } - if (message.semanticSimilarityChannel != null && message.hasOwnProperty("semanticSimilarityChannel")) - switch (message.semanticSimilarityChannel) { - default: - return "semanticSimilarityChannel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a TurnLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds - */ - TurnLevelMetricsThresholds.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds) - return object; - var message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds(); - if (object.semanticSimilaritySuccessThreshold != null) - message.semanticSimilaritySuccessThreshold = object.semanticSimilaritySuccessThreshold | 0; - if (object.overallToolInvocationCorrectnessThreshold != null) - message.overallToolInvocationCorrectnessThreshold = Number(object.overallToolInvocationCorrectnessThreshold); - switch (object.semanticSimilarityChannel) { - default: - if (typeof object.semanticSimilarityChannel === "number") { - message.semanticSimilarityChannel = object.semanticSimilarityChannel; - break; - } - break; - case "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED": - case 0: - message.semanticSimilarityChannel = 0; - break; - case "TEXT": - case 1: - message.semanticSimilarityChannel = 1; - break; - case "AUDIO": - case 2: - message.semanticSimilarityChannel = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a TurnLevelMetricsThresholds message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @static - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} message TurnLevelMetricsThresholds - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TurnLevelMetricsThresholds.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.semanticSimilarityChannel = options.enums === String ? "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED" : 0; - if (message.semanticSimilaritySuccessThreshold != null && message.hasOwnProperty("semanticSimilaritySuccessThreshold")) { - object.semanticSimilaritySuccessThreshold = message.semanticSimilaritySuccessThreshold; - if (options.oneofs) - object._semanticSimilaritySuccessThreshold = "semanticSimilaritySuccessThreshold"; - } - if (message.overallToolInvocationCorrectnessThreshold != null && message.hasOwnProperty("overallToolInvocationCorrectnessThreshold")) { - object.overallToolInvocationCorrectnessThreshold = options.json && !isFinite(message.overallToolInvocationCorrectnessThreshold) ? String(message.overallToolInvocationCorrectnessThreshold) : message.overallToolInvocationCorrectnessThreshold; - if (options.oneofs) - object._overallToolInvocationCorrectnessThreshold = "overallToolInvocationCorrectnessThreshold"; - } - if (message.semanticSimilarityChannel != null && message.hasOwnProperty("semanticSimilarityChannel")) - object.semanticSimilarityChannel = options.enums === String ? $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel[message.semanticSimilarityChannel] === undefined ? message.semanticSimilarityChannel : $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel[message.semanticSimilarityChannel] : message.semanticSimilarityChannel; - return object; - }; - - /** - * Converts this TurnLevelMetricsThresholds to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @instance - * @returns {Object.} JSON object - */ - TurnLevelMetricsThresholds.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TurnLevelMetricsThresholds - * @function getTypeUrl - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TurnLevelMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds"; - }; - - /** - * SemanticSimilarityChannel enum. - * @name google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel - * @enum {number} - * @property {number} SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED=0 SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED value - * @property {number} TEXT=1 TEXT value - * @property {number} AUDIO=2 AUDIO value - */ - TurnLevelMetricsThresholds.SemanticSimilarityChannel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "TEXT"] = 1; - values[valuesById[2] = "AUDIO"] = 2; - return values; - })(); - - return TurnLevelMetricsThresholds; - })(); - - GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds = (function() { - - /** - * Properties of an ExpectationLevelMetricsThresholds. - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @interface IExpectationLevelMetricsThresholds - * @property {number|null} [toolInvocationParameterCorrectnessThreshold] ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold - */ - - /** - * Constructs a new ExpectationLevelMetricsThresholds. - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @classdesc Represents an ExpectationLevelMetricsThresholds. - * @implements IExpectationLevelMetricsThresholds - * @constructor - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds=} [properties] Properties to set - */ - function ExpectationLevelMetricsThresholds(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold. - * @member {number|null|undefined} toolInvocationParameterCorrectnessThreshold - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @instance - */ - ExpectationLevelMetricsThresholds.prototype.toolInvocationParameterCorrectnessThreshold = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ExpectationLevelMetricsThresholds.prototype, "_toolInvocationParameterCorrectnessThreshold", { - get: $util.oneOfGetter($oneOfFields = ["toolInvocationParameterCorrectnessThreshold"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExpectationLevelMetricsThresholds instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @static - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds=} [properties] Properties to set - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds instance - */ - ExpectationLevelMetricsThresholds.create = function create(properties) { - return new ExpectationLevelMetricsThresholds(properties); - }; - - /** - * Encodes the specified ExpectationLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @static - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds} message ExpectationLevelMetricsThresholds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExpectationLevelMetricsThresholds.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolInvocationParameterCorrectnessThreshold != null && Object.hasOwnProperty.call(message, "toolInvocationParameterCorrectnessThreshold")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.toolInvocationParameterCorrectnessThreshold); - return writer; - }; - - /** - * Encodes the specified ExpectationLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @static - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds} message ExpectationLevelMetricsThresholds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExpectationLevelMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExpectationLevelMetricsThresholds.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.toolInvocationParameterCorrectnessThreshold = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExpectationLevelMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExpectationLevelMetricsThresholds message. - * @function verify - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExpectationLevelMetricsThresholds.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.toolInvocationParameterCorrectnessThreshold != null && message.hasOwnProperty("toolInvocationParameterCorrectnessThreshold")) { - properties._toolInvocationParameterCorrectnessThreshold = 1; - if (typeof message.toolInvocationParameterCorrectnessThreshold !== "number") - return "toolInvocationParameterCorrectnessThreshold: number expected"; - } - return null; - }; - - /** - * Creates an ExpectationLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds - */ - ExpectationLevelMetricsThresholds.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds) - return object; - var message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds(); - if (object.toolInvocationParameterCorrectnessThreshold != null) - message.toolInvocationParameterCorrectnessThreshold = Number(object.toolInvocationParameterCorrectnessThreshold); - return message; - }; - - /** - * Creates a plain object from an ExpectationLevelMetricsThresholds message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @static - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} message ExpectationLevelMetricsThresholds - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExpectationLevelMetricsThresholds.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.toolInvocationParameterCorrectnessThreshold != null && message.hasOwnProperty("toolInvocationParameterCorrectnessThreshold")) { - object.toolInvocationParameterCorrectnessThreshold = options.json && !isFinite(message.toolInvocationParameterCorrectnessThreshold) ? String(message.toolInvocationParameterCorrectnessThreshold) : message.toolInvocationParameterCorrectnessThreshold; - if (options.oneofs) - object._toolInvocationParameterCorrectnessThreshold = "toolInvocationParameterCorrectnessThreshold"; - } - return object; - }; - - /** - * Converts this ExpectationLevelMetricsThresholds to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @instance - * @returns {Object.} JSON object - */ - ExpectationLevelMetricsThresholds.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExpectationLevelMetricsThresholds - * @function getTypeUrl - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExpectationLevelMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds"; - }; - - return ExpectationLevelMetricsThresholds; - })(); - - return GoldenEvaluationMetricsThresholds; - })(); - - EvaluationMetricsThresholds.ToolMatchingSettings = (function() { - - /** - * Properties of a ToolMatchingSettings. - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds - * @interface IToolMatchingSettings - * @property {google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|null} [extraToolCallBehavior] ToolMatchingSettings extraToolCallBehavior - */ - - /** - * Constructs a new ToolMatchingSettings. - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds - * @classdesc Represents a ToolMatchingSettings. - * @implements IToolMatchingSettings - * @constructor - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings=} [properties] Properties to set - */ - function ToolMatchingSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolMatchingSettings extraToolCallBehavior. - * @member {google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior} extraToolCallBehavior - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings - * @instance - */ - ToolMatchingSettings.prototype.extraToolCallBehavior = 0; - - /** - * Creates a new ToolMatchingSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings - * @static - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings instance - */ - ToolMatchingSettings.create = function create(properties) { - return new ToolMatchingSettings(properties); - }; - - /** - * Encodes the specified ToolMatchingSettings message. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings - * @static - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings} message ToolMatchingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolMatchingSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.extraToolCallBehavior != null && Object.hasOwnProperty.call(message, "extraToolCallBehavior")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.extraToolCallBehavior); - return writer; - }; - - /** - * Encodes the specified ToolMatchingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings - * @static - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.IToolMatchingSettings} message ToolMatchingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolMatchingSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolMatchingSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolMatchingSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.extraToolCallBehavior = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolMatchingSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolMatchingSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolMatchingSettings message. - * @function verify - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolMatchingSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.extraToolCallBehavior != null && message.hasOwnProperty("extraToolCallBehavior")) - switch (message.extraToolCallBehavior) { - default: - return "extraToolCallBehavior: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a ToolMatchingSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings - */ - ToolMatchingSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings) - return object; - var message = new $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings(); - switch (object.extraToolCallBehavior) { - default: - if (typeof object.extraToolCallBehavior === "number") { - message.extraToolCallBehavior = object.extraToolCallBehavior; - break; - } - break; - case "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED": - case 0: - message.extraToolCallBehavior = 0; - break; - case "FAIL": - case 1: - message.extraToolCallBehavior = 1; - break; - case "ALLOW": - case 2: - message.extraToolCallBehavior = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a ToolMatchingSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings - * @static - * @param {google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings} message ToolMatchingSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolMatchingSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.extraToolCallBehavior = options.enums === String ? "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED" : 0; - if (message.extraToolCallBehavior != null && message.hasOwnProperty("extraToolCallBehavior")) - object.extraToolCallBehavior = options.enums === String ? $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior[message.extraToolCallBehavior] === undefined ? message.extraToolCallBehavior : $root.google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior[message.extraToolCallBehavior] : message.extraToolCallBehavior; - return object; - }; - - /** - * Converts this ToolMatchingSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings - * @instance - * @returns {Object.} JSON object - */ - ToolMatchingSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolMatchingSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolMatchingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings"; - }; - - /** - * ExtraToolCallBehavior enum. - * @name google.cloud.ces.v1.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior - * @enum {number} - * @property {number} EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED=0 EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED value - * @property {number} FAIL=1 FAIL value - * @property {number} ALLOW=2 ALLOW value - */ - ToolMatchingSettings.ExtraToolCallBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "FAIL"] = 1; - values[valuesById[2] = "ALLOW"] = 2; - return values; - })(); - - return ToolMatchingSettings; - })(); - - /** - * HallucinationMetricBehavior enum. - * @name google.cloud.ces.v1.EvaluationMetricsThresholds.HallucinationMetricBehavior - * @enum {number} - * @property {number} HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED=0 HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED value - * @property {number} DISABLED=1 DISABLED value - * @property {number} ENABLED=2 ENABLED value - */ - EvaluationMetricsThresholds.HallucinationMetricBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "DISABLED"] = 1; - values[valuesById[2] = "ENABLED"] = 2; - return values; - })(); - - return EvaluationMetricsThresholds; - })(); - - v1.ClientCertificateSettings = (function() { - - /** - * Properties of a ClientCertificateSettings. - * @memberof google.cloud.ces.v1 - * @interface IClientCertificateSettings - * @property {string|null} [tlsCertificate] ClientCertificateSettings tlsCertificate - * @property {string|null} [privateKey] ClientCertificateSettings privateKey - * @property {string|null} [passphrase] ClientCertificateSettings passphrase - */ - - /** - * Constructs a new ClientCertificateSettings. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ClientCertificateSettings. - * @implements IClientCertificateSettings - * @constructor - * @param {google.cloud.ces.v1.IClientCertificateSettings=} [properties] Properties to set - */ - function ClientCertificateSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientCertificateSettings tlsCertificate. - * @member {string} tlsCertificate - * @memberof google.cloud.ces.v1.ClientCertificateSettings - * @instance - */ - ClientCertificateSettings.prototype.tlsCertificate = ""; - - /** - * ClientCertificateSettings privateKey. - * @member {string} privateKey - * @memberof google.cloud.ces.v1.ClientCertificateSettings - * @instance - */ - ClientCertificateSettings.prototype.privateKey = ""; - - /** - * ClientCertificateSettings passphrase. - * @member {string} passphrase - * @memberof google.cloud.ces.v1.ClientCertificateSettings - * @instance - */ - ClientCertificateSettings.prototype.passphrase = ""; - - /** - * Creates a new ClientCertificateSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ClientCertificateSettings - * @static - * @param {google.cloud.ces.v1.IClientCertificateSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ClientCertificateSettings} ClientCertificateSettings instance - */ - ClientCertificateSettings.create = function create(properties) { - return new ClientCertificateSettings(properties); - }; - - /** - * Encodes the specified ClientCertificateSettings message. Does not implicitly {@link google.cloud.ces.v1.ClientCertificateSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ClientCertificateSettings - * @static - * @param {google.cloud.ces.v1.IClientCertificateSettings} message ClientCertificateSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientCertificateSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tlsCertificate != null && Object.hasOwnProperty.call(message, "tlsCertificate")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tlsCertificate); - if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.privateKey); - if (message.passphrase != null && Object.hasOwnProperty.call(message, "passphrase")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.passphrase); - return writer; - }; - - /** - * Encodes the specified ClientCertificateSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ClientCertificateSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ClientCertificateSettings - * @static - * @param {google.cloud.ces.v1.IClientCertificateSettings} message ClientCertificateSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientCertificateSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientCertificateSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ClientCertificateSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ClientCertificateSettings} ClientCertificateSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientCertificateSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ClientCertificateSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tlsCertificate = reader.string(); - break; - } - case 2: { - message.privateKey = reader.string(); - break; - } - case 3: { - message.passphrase = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientCertificateSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ClientCertificateSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ClientCertificateSettings} ClientCertificateSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientCertificateSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientCertificateSettings message. - * @function verify - * @memberof google.cloud.ces.v1.ClientCertificateSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientCertificateSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tlsCertificate != null && message.hasOwnProperty("tlsCertificate")) - if (!$util.isString(message.tlsCertificate)) - return "tlsCertificate: string expected"; - if (message.privateKey != null && message.hasOwnProperty("privateKey")) - if (!$util.isString(message.privateKey)) - return "privateKey: string expected"; - if (message.passphrase != null && message.hasOwnProperty("passphrase")) - if (!$util.isString(message.passphrase)) - return "passphrase: string expected"; - return null; - }; - - /** - * Creates a ClientCertificateSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ClientCertificateSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ClientCertificateSettings} ClientCertificateSettings - */ - ClientCertificateSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ClientCertificateSettings) - return object; - var message = new $root.google.cloud.ces.v1.ClientCertificateSettings(); - if (object.tlsCertificate != null) - message.tlsCertificate = String(object.tlsCertificate); - if (object.privateKey != null) - message.privateKey = String(object.privateKey); - if (object.passphrase != null) - message.passphrase = String(object.passphrase); - return message; - }; - - /** - * Creates a plain object from a ClientCertificateSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ClientCertificateSettings - * @static - * @param {google.cloud.ces.v1.ClientCertificateSettings} message ClientCertificateSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientCertificateSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.tlsCertificate = ""; - object.privateKey = ""; - object.passphrase = ""; - } - if (message.tlsCertificate != null && message.hasOwnProperty("tlsCertificate")) - object.tlsCertificate = message.tlsCertificate; - if (message.privateKey != null && message.hasOwnProperty("privateKey")) - object.privateKey = message.privateKey; - if (message.passphrase != null && message.hasOwnProperty("passphrase")) - object.passphrase = message.passphrase; - return object; - }; - - /** - * Converts this ClientCertificateSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ClientCertificateSettings - * @instance - * @returns {Object.} JSON object - */ - ClientCertificateSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientCertificateSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ClientCertificateSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientCertificateSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ClientCertificateSettings"; - }; - - return ClientCertificateSettings; - })(); - - v1.ConversationLoggingSettings = (function() { - - /** - * Properties of a ConversationLoggingSettings. - * @memberof google.cloud.ces.v1 - * @interface IConversationLoggingSettings - * @property {boolean|null} [disableConversationLogging] ConversationLoggingSettings disableConversationLogging - */ - - /** - * Constructs a new ConversationLoggingSettings. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ConversationLoggingSettings. - * @implements IConversationLoggingSettings - * @constructor - * @param {google.cloud.ces.v1.IConversationLoggingSettings=} [properties] Properties to set - */ - function ConversationLoggingSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConversationLoggingSettings disableConversationLogging. - * @member {boolean} disableConversationLogging - * @memberof google.cloud.ces.v1.ConversationLoggingSettings - * @instance - */ - ConversationLoggingSettings.prototype.disableConversationLogging = false; - - /** - * Creates a new ConversationLoggingSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ConversationLoggingSettings - * @static - * @param {google.cloud.ces.v1.IConversationLoggingSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ConversationLoggingSettings} ConversationLoggingSettings instance - */ - ConversationLoggingSettings.create = function create(properties) { - return new ConversationLoggingSettings(properties); - }; - - /** - * Encodes the specified ConversationLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1.ConversationLoggingSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ConversationLoggingSettings - * @static - * @param {google.cloud.ces.v1.IConversationLoggingSettings} message ConversationLoggingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConversationLoggingSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.disableConversationLogging != null && Object.hasOwnProperty.call(message, "disableConversationLogging")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.disableConversationLogging); - return writer; - }; - - /** - * Encodes the specified ConversationLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ConversationLoggingSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ConversationLoggingSettings - * @static - * @param {google.cloud.ces.v1.IConversationLoggingSettings} message ConversationLoggingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConversationLoggingSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConversationLoggingSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ConversationLoggingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ConversationLoggingSettings} ConversationLoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConversationLoggingSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ConversationLoggingSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.disableConversationLogging = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConversationLoggingSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ConversationLoggingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ConversationLoggingSettings} ConversationLoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConversationLoggingSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConversationLoggingSettings message. - * @function verify - * @memberof google.cloud.ces.v1.ConversationLoggingSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConversationLoggingSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.disableConversationLogging != null && message.hasOwnProperty("disableConversationLogging")) - if (typeof message.disableConversationLogging !== "boolean") - return "disableConversationLogging: boolean expected"; - return null; - }; - - /** - * Creates a ConversationLoggingSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ConversationLoggingSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ConversationLoggingSettings} ConversationLoggingSettings - */ - ConversationLoggingSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ConversationLoggingSettings) - return object; - var message = new $root.google.cloud.ces.v1.ConversationLoggingSettings(); - if (object.disableConversationLogging != null) - message.disableConversationLogging = Boolean(object.disableConversationLogging); - return message; - }; - - /** - * Creates a plain object from a ConversationLoggingSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ConversationLoggingSettings - * @static - * @param {google.cloud.ces.v1.ConversationLoggingSettings} message ConversationLoggingSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConversationLoggingSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.disableConversationLogging = false; - if (message.disableConversationLogging != null && message.hasOwnProperty("disableConversationLogging")) - object.disableConversationLogging = message.disableConversationLogging; - return object; - }; - - /** - * Converts this ConversationLoggingSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ConversationLoggingSettings - * @instance - * @returns {Object.} JSON object - */ - ConversationLoggingSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConversationLoggingSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ConversationLoggingSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConversationLoggingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ConversationLoggingSettings"; - }; - - return ConversationLoggingSettings; - })(); - - v1.CloudLoggingSettings = (function() { - - /** - * Properties of a CloudLoggingSettings. - * @memberof google.cloud.ces.v1 - * @interface ICloudLoggingSettings - * @property {boolean|null} [enableCloudLogging] CloudLoggingSettings enableCloudLogging - */ - - /** - * Constructs a new CloudLoggingSettings. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a CloudLoggingSettings. - * @implements ICloudLoggingSettings - * @constructor - * @param {google.cloud.ces.v1.ICloudLoggingSettings=} [properties] Properties to set - */ - function CloudLoggingSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudLoggingSettings enableCloudLogging. - * @member {boolean} enableCloudLogging - * @memberof google.cloud.ces.v1.CloudLoggingSettings - * @instance - */ - CloudLoggingSettings.prototype.enableCloudLogging = false; - - /** - * Creates a new CloudLoggingSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.CloudLoggingSettings - * @static - * @param {google.cloud.ces.v1.ICloudLoggingSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1.CloudLoggingSettings} CloudLoggingSettings instance - */ - CloudLoggingSettings.create = function create(properties) { - return new CloudLoggingSettings(properties); - }; - - /** - * Encodes the specified CloudLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1.CloudLoggingSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.CloudLoggingSettings - * @static - * @param {google.cloud.ces.v1.ICloudLoggingSettings} message CloudLoggingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudLoggingSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enableCloudLogging != null && Object.hasOwnProperty.call(message, "enableCloudLogging")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableCloudLogging); - return writer; - }; - - /** - * Encodes the specified CloudLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CloudLoggingSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.CloudLoggingSettings - * @static - * @param {google.cloud.ces.v1.ICloudLoggingSettings} message CloudLoggingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudLoggingSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudLoggingSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.CloudLoggingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.CloudLoggingSettings} CloudLoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudLoggingSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CloudLoggingSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enableCloudLogging = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudLoggingSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.CloudLoggingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.CloudLoggingSettings} CloudLoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudLoggingSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudLoggingSettings message. - * @function verify - * @memberof google.cloud.ces.v1.CloudLoggingSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudLoggingSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enableCloudLogging != null && message.hasOwnProperty("enableCloudLogging")) - if (typeof message.enableCloudLogging !== "boolean") - return "enableCloudLogging: boolean expected"; - return null; - }; - - /** - * Creates a CloudLoggingSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.CloudLoggingSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.CloudLoggingSettings} CloudLoggingSettings - */ - CloudLoggingSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.CloudLoggingSettings) - return object; - var message = new $root.google.cloud.ces.v1.CloudLoggingSettings(); - if (object.enableCloudLogging != null) - message.enableCloudLogging = Boolean(object.enableCloudLogging); - return message; - }; - - /** - * Creates a plain object from a CloudLoggingSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.CloudLoggingSettings - * @static - * @param {google.cloud.ces.v1.CloudLoggingSettings} message CloudLoggingSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudLoggingSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.enableCloudLogging = false; - if (message.enableCloudLogging != null && message.hasOwnProperty("enableCloudLogging")) - object.enableCloudLogging = message.enableCloudLogging; - return object; - }; - - /** - * Converts this CloudLoggingSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.CloudLoggingSettings - * @instance - * @returns {Object.} JSON object - */ - CloudLoggingSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudLoggingSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1.CloudLoggingSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudLoggingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.CloudLoggingSettings"; - }; - - return CloudLoggingSettings; - })(); - - v1.AudioRecordingConfig = (function() { - - /** - * Properties of an AudioRecordingConfig. - * @memberof google.cloud.ces.v1 - * @interface IAudioRecordingConfig - * @property {string|null} [gcsBucket] AudioRecordingConfig gcsBucket - * @property {string|null} [gcsPathPrefix] AudioRecordingConfig gcsPathPrefix - */ - - /** - * Constructs a new AudioRecordingConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an AudioRecordingConfig. - * @implements IAudioRecordingConfig - * @constructor - * @param {google.cloud.ces.v1.IAudioRecordingConfig=} [properties] Properties to set - */ - function AudioRecordingConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AudioRecordingConfig gcsBucket. - * @member {string} gcsBucket - * @memberof google.cloud.ces.v1.AudioRecordingConfig - * @instance - */ - AudioRecordingConfig.prototype.gcsBucket = ""; - - /** - * AudioRecordingConfig gcsPathPrefix. - * @member {string} gcsPathPrefix - * @memberof google.cloud.ces.v1.AudioRecordingConfig - * @instance - */ - AudioRecordingConfig.prototype.gcsPathPrefix = ""; - - /** - * Creates a new AudioRecordingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.AudioRecordingConfig - * @static - * @param {google.cloud.ces.v1.IAudioRecordingConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.AudioRecordingConfig} AudioRecordingConfig instance - */ - AudioRecordingConfig.create = function create(properties) { - return new AudioRecordingConfig(properties); - }; - - /** - * Encodes the specified AudioRecordingConfig message. Does not implicitly {@link google.cloud.ces.v1.AudioRecordingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.AudioRecordingConfig - * @static - * @param {google.cloud.ces.v1.IAudioRecordingConfig} message AudioRecordingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AudioRecordingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsBucket != null && Object.hasOwnProperty.call(message, "gcsBucket")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsBucket); - if (message.gcsPathPrefix != null && Object.hasOwnProperty.call(message, "gcsPathPrefix")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsPathPrefix); - return writer; - }; - - /** - * Encodes the specified AudioRecordingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AudioRecordingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.AudioRecordingConfig - * @static - * @param {google.cloud.ces.v1.IAudioRecordingConfig} message AudioRecordingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AudioRecordingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AudioRecordingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.AudioRecordingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.AudioRecordingConfig} AudioRecordingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AudioRecordingConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.AudioRecordingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsBucket = reader.string(); - break; - } - case 2: { - message.gcsPathPrefix = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AudioRecordingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.AudioRecordingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.AudioRecordingConfig} AudioRecordingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AudioRecordingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AudioRecordingConfig message. - * @function verify - * @memberof google.cloud.ces.v1.AudioRecordingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AudioRecordingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) - if (!$util.isString(message.gcsBucket)) - return "gcsBucket: string expected"; - if (message.gcsPathPrefix != null && message.hasOwnProperty("gcsPathPrefix")) - if (!$util.isString(message.gcsPathPrefix)) - return "gcsPathPrefix: string expected"; - return null; - }; - - /** - * Creates an AudioRecordingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.AudioRecordingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.AudioRecordingConfig} AudioRecordingConfig - */ - AudioRecordingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.AudioRecordingConfig) - return object; - var message = new $root.google.cloud.ces.v1.AudioRecordingConfig(); - if (object.gcsBucket != null) - message.gcsBucket = String(object.gcsBucket); - if (object.gcsPathPrefix != null) - message.gcsPathPrefix = String(object.gcsPathPrefix); - return message; - }; - - /** - * Creates a plain object from an AudioRecordingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.AudioRecordingConfig - * @static - * @param {google.cloud.ces.v1.AudioRecordingConfig} message AudioRecordingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AudioRecordingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.gcsBucket = ""; - object.gcsPathPrefix = ""; - } - if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) - object.gcsBucket = message.gcsBucket; - if (message.gcsPathPrefix != null && message.hasOwnProperty("gcsPathPrefix")) - object.gcsPathPrefix = message.gcsPathPrefix; - return object; - }; - - /** - * Converts this AudioRecordingConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.AudioRecordingConfig - * @instance - * @returns {Object.} JSON object - */ - AudioRecordingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AudioRecordingConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.AudioRecordingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AudioRecordingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.AudioRecordingConfig"; - }; - - return AudioRecordingConfig; - })(); - - v1.RedactionConfig = (function() { - - /** - * Properties of a RedactionConfig. - * @memberof google.cloud.ces.v1 - * @interface IRedactionConfig - * @property {boolean|null} [enableRedaction] RedactionConfig enableRedaction - * @property {string|null} [inspectTemplate] RedactionConfig inspectTemplate - * @property {string|null} [deidentifyTemplate] RedactionConfig deidentifyTemplate - */ - - /** - * Constructs a new RedactionConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a RedactionConfig. - * @implements IRedactionConfig - * @constructor - * @param {google.cloud.ces.v1.IRedactionConfig=} [properties] Properties to set - */ - function RedactionConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RedactionConfig enableRedaction. - * @member {boolean} enableRedaction - * @memberof google.cloud.ces.v1.RedactionConfig - * @instance - */ - RedactionConfig.prototype.enableRedaction = false; - - /** - * RedactionConfig inspectTemplate. - * @member {string} inspectTemplate - * @memberof google.cloud.ces.v1.RedactionConfig - * @instance - */ - RedactionConfig.prototype.inspectTemplate = ""; - - /** - * RedactionConfig deidentifyTemplate. - * @member {string} deidentifyTemplate - * @memberof google.cloud.ces.v1.RedactionConfig - * @instance - */ - RedactionConfig.prototype.deidentifyTemplate = ""; - - /** - * Creates a new RedactionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.RedactionConfig - * @static - * @param {google.cloud.ces.v1.IRedactionConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.RedactionConfig} RedactionConfig instance - */ - RedactionConfig.create = function create(properties) { - return new RedactionConfig(properties); - }; - - /** - * Encodes the specified RedactionConfig message. Does not implicitly {@link google.cloud.ces.v1.RedactionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.RedactionConfig - * @static - * @param {google.cloud.ces.v1.IRedactionConfig} message RedactionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RedactionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enableRedaction != null && Object.hasOwnProperty.call(message, "enableRedaction")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableRedaction); - if (message.inspectTemplate != null && Object.hasOwnProperty.call(message, "inspectTemplate")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inspectTemplate); - if (message.deidentifyTemplate != null && Object.hasOwnProperty.call(message, "deidentifyTemplate")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.deidentifyTemplate); - return writer; - }; - - /** - * Encodes the specified RedactionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RedactionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.RedactionConfig - * @static - * @param {google.cloud.ces.v1.IRedactionConfig} message RedactionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RedactionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RedactionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.RedactionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.RedactionConfig} RedactionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RedactionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RedactionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enableRedaction = reader.bool(); - break; - } - case 2: { - message.inspectTemplate = reader.string(); - break; - } - case 3: { - message.deidentifyTemplate = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RedactionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.RedactionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.RedactionConfig} RedactionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RedactionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RedactionConfig message. - * @function verify - * @memberof google.cloud.ces.v1.RedactionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RedactionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enableRedaction != null && message.hasOwnProperty("enableRedaction")) - if (typeof message.enableRedaction !== "boolean") - return "enableRedaction: boolean expected"; - if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) - if (!$util.isString(message.inspectTemplate)) - return "inspectTemplate: string expected"; - if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) - if (!$util.isString(message.deidentifyTemplate)) - return "deidentifyTemplate: string expected"; - return null; - }; - - /** - * Creates a RedactionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.RedactionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.RedactionConfig} RedactionConfig - */ - RedactionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.RedactionConfig) - return object; - var message = new $root.google.cloud.ces.v1.RedactionConfig(); - if (object.enableRedaction != null) - message.enableRedaction = Boolean(object.enableRedaction); - if (object.inspectTemplate != null) - message.inspectTemplate = String(object.inspectTemplate); - if (object.deidentifyTemplate != null) - message.deidentifyTemplate = String(object.deidentifyTemplate); - return message; - }; - - /** - * Creates a plain object from a RedactionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.RedactionConfig - * @static - * @param {google.cloud.ces.v1.RedactionConfig} message RedactionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RedactionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.enableRedaction = false; - object.inspectTemplate = ""; - object.deidentifyTemplate = ""; - } - if (message.enableRedaction != null && message.hasOwnProperty("enableRedaction")) - object.enableRedaction = message.enableRedaction; - if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) - object.inspectTemplate = message.inspectTemplate; - if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) - object.deidentifyTemplate = message.deidentifyTemplate; - return object; - }; - - /** - * Converts this RedactionConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.RedactionConfig - * @instance - * @returns {Object.} JSON object - */ - RedactionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RedactionConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.RedactionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RedactionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.RedactionConfig"; - }; - - return RedactionConfig; - })(); - - v1.DataStoreSettings = (function() { - - /** - * Properties of a DataStoreSettings. - * @memberof google.cloud.ces.v1 - * @interface IDataStoreSettings - * @property {Array.|null} [engines] DataStoreSettings engines - */ - - /** - * Constructs a new DataStoreSettings. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a DataStoreSettings. - * @implements IDataStoreSettings - * @constructor - * @param {google.cloud.ces.v1.IDataStoreSettings=} [properties] Properties to set - */ - function DataStoreSettings(properties) { - this.engines = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataStoreSettings engines. - * @member {Array.} engines - * @memberof google.cloud.ces.v1.DataStoreSettings - * @instance - */ - DataStoreSettings.prototype.engines = $util.emptyArray; - - /** - * Creates a new DataStoreSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DataStoreSettings - * @static - * @param {google.cloud.ces.v1.IDataStoreSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DataStoreSettings} DataStoreSettings instance - */ - DataStoreSettings.create = function create(properties) { - return new DataStoreSettings(properties); - }; - - /** - * Encodes the specified DataStoreSettings message. Does not implicitly {@link google.cloud.ces.v1.DataStoreSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DataStoreSettings - * @static - * @param {google.cloud.ces.v1.IDataStoreSettings} message DataStoreSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataStoreSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.engines != null && message.engines.length) - for (var i = 0; i < message.engines.length; ++i) - $root.google.cloud.ces.v1.DataStoreSettings.Engine.encode(message.engines[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataStoreSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DataStoreSettings - * @static - * @param {google.cloud.ces.v1.IDataStoreSettings} message DataStoreSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataStoreSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataStoreSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DataStoreSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DataStoreSettings} DataStoreSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataStoreSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - if (!(message.engines && message.engines.length)) - message.engines = []; - message.engines.push($root.google.cloud.ces.v1.DataStoreSettings.Engine.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataStoreSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DataStoreSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DataStoreSettings} DataStoreSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataStoreSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataStoreSettings message. - * @function verify - * @memberof google.cloud.ces.v1.DataStoreSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataStoreSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.engines != null && message.hasOwnProperty("engines")) { - if (!Array.isArray(message.engines)) - return "engines: array expected"; - for (var i = 0; i < message.engines.length; ++i) { - var error = $root.google.cloud.ces.v1.DataStoreSettings.Engine.verify(message.engines[i]); - if (error) - return "engines." + error; - } - } - return null; - }; - - /** - * Creates a DataStoreSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DataStoreSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DataStoreSettings} DataStoreSettings - */ - DataStoreSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DataStoreSettings) - return object; - var message = new $root.google.cloud.ces.v1.DataStoreSettings(); - if (object.engines) { - if (!Array.isArray(object.engines)) - throw TypeError(".google.cloud.ces.v1.DataStoreSettings.engines: array expected"); - message.engines = []; - for (var i = 0; i < object.engines.length; ++i) { - if (typeof object.engines[i] !== "object") - throw TypeError(".google.cloud.ces.v1.DataStoreSettings.engines: object expected"); - message.engines[i] = $root.google.cloud.ces.v1.DataStoreSettings.Engine.fromObject(object.engines[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a DataStoreSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DataStoreSettings - * @static - * @param {google.cloud.ces.v1.DataStoreSettings} message DataStoreSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataStoreSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.engines = []; - if (message.engines && message.engines.length) { - object.engines = []; - for (var j = 0; j < message.engines.length; ++j) - object.engines[j] = $root.google.cloud.ces.v1.DataStoreSettings.Engine.toObject(message.engines[j], options); - } - return object; - }; - - /** - * Converts this DataStoreSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DataStoreSettings - * @instance - * @returns {Object.} JSON object - */ - DataStoreSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataStoreSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DataStoreSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataStoreSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreSettings"; - }; - - DataStoreSettings.Engine = (function() { - - /** - * Properties of an Engine. - * @memberof google.cloud.ces.v1.DataStoreSettings - * @interface IEngine - * @property {string|null} [name] Engine name - * @property {google.cloud.ces.v1.DataStoreSettings.Engine.Type|null} [type] Engine type - */ - - /** - * Constructs a new Engine. - * @memberof google.cloud.ces.v1.DataStoreSettings - * @classdesc Represents an Engine. - * @implements IEngine - * @constructor - * @param {google.cloud.ces.v1.DataStoreSettings.IEngine=} [properties] Properties to set - */ - function Engine(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Engine name. - * @member {string} name - * @memberof google.cloud.ces.v1.DataStoreSettings.Engine - * @instance - */ - Engine.prototype.name = ""; - - /** - * Engine type. - * @member {google.cloud.ces.v1.DataStoreSettings.Engine.Type} type - * @memberof google.cloud.ces.v1.DataStoreSettings.Engine - * @instance - */ - Engine.prototype.type = 0; - - /** - * Creates a new Engine instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DataStoreSettings.Engine - * @static - * @param {google.cloud.ces.v1.DataStoreSettings.IEngine=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DataStoreSettings.Engine} Engine instance - */ - Engine.create = function create(properties) { - return new Engine(properties); - }; - - /** - * Encodes the specified Engine message. Does not implicitly {@link google.cloud.ces.v1.DataStoreSettings.Engine.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DataStoreSettings.Engine - * @static - * @param {google.cloud.ces.v1.DataStoreSettings.IEngine} message Engine message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Engine.encode = function encode(message, writer) { - if (!writer) - 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 0 =*/16).int32(message.type); - return writer; - }; - - /** - * Encodes the specified Engine message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreSettings.Engine.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DataStoreSettings.Engine - * @static - * @param {google.cloud.ces.v1.DataStoreSettings.IEngine} message Engine message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Engine.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Engine message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DataStoreSettings.Engine - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DataStoreSettings.Engine} Engine - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Engine.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreSettings.Engine(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.type = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Engine message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DataStoreSettings.Engine - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DataStoreSettings.Engine} Engine - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Engine.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Engine message. - * @function verify - * @memberof google.cloud.ces.v1.DataStoreSettings.Engine - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Engine.verify = function verify(message) { - if (typeof message !== "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")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Engine message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DataStoreSettings.Engine - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DataStoreSettings.Engine} Engine - */ - Engine.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DataStoreSettings.Engine) - return object; - var message = new $root.google.cloud.ces.v1.DataStoreSettings.Engine(); - if (object.name != null) - message.name = String(object.name); - 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 "ENGINE_TYPE_SEARCH": - case 1: - message.type = 1; - break; - case "ENGINE_TYPE_CHAT": - case 2: - message.type = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Engine message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DataStoreSettings.Engine - * @static - * @param {google.cloud.ces.v1.DataStoreSettings.Engine} message Engine - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Engine.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.ces.v1.DataStoreSettings.Engine.Type[message.type] === undefined ? message.type : $root.google.cloud.ces.v1.DataStoreSettings.Engine.Type[message.type] : message.type; - return object; - }; - - /** - * Converts this Engine to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DataStoreSettings.Engine - * @instance - * @returns {Object.} JSON object - */ - Engine.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Engine - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DataStoreSettings.Engine - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Engine.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreSettings.Engine"; - }; - - /** - * Type enum. - * @name google.cloud.ces.v1.DataStoreSettings.Engine.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} ENGINE_TYPE_SEARCH=1 ENGINE_TYPE_SEARCH value - * @property {number} ENGINE_TYPE_CHAT=2 ENGINE_TYPE_CHAT value - */ - Engine.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENGINE_TYPE_SEARCH"] = 1; - values[valuesById[2] = "ENGINE_TYPE_CHAT"] = 2; - return values; - })(); - - return Engine; - })(); - - return DataStoreSettings; - })(); - - v1.BigQueryExportSettings = (function() { - - /** - * Properties of a BigQueryExportSettings. - * @memberof google.cloud.ces.v1 - * @interface IBigQueryExportSettings - * @property {boolean|null} [enabled] BigQueryExportSettings enabled - * @property {string|null} [project] BigQueryExportSettings project - * @property {string|null} [dataset] BigQueryExportSettings dataset - */ - - /** - * Constructs a new BigQueryExportSettings. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a BigQueryExportSettings. - * @implements IBigQueryExportSettings - * @constructor - * @param {google.cloud.ces.v1.IBigQueryExportSettings=} [properties] Properties to set - */ - function BigQueryExportSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BigQueryExportSettings enabled. - * @member {boolean} enabled - * @memberof google.cloud.ces.v1.BigQueryExportSettings - * @instance - */ - BigQueryExportSettings.prototype.enabled = false; - - /** - * BigQueryExportSettings project. - * @member {string} project - * @memberof google.cloud.ces.v1.BigQueryExportSettings - * @instance - */ - BigQueryExportSettings.prototype.project = ""; - - /** - * BigQueryExportSettings dataset. - * @member {string} dataset - * @memberof google.cloud.ces.v1.BigQueryExportSettings - * @instance - */ - BigQueryExportSettings.prototype.dataset = ""; - - /** - * Creates a new BigQueryExportSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.BigQueryExportSettings - * @static - * @param {google.cloud.ces.v1.IBigQueryExportSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1.BigQueryExportSettings} BigQueryExportSettings instance - */ - BigQueryExportSettings.create = function create(properties) { - return new BigQueryExportSettings(properties); - }; - - /** - * Encodes the specified BigQueryExportSettings message. Does not implicitly {@link google.cloud.ces.v1.BigQueryExportSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.BigQueryExportSettings - * @static - * @param {google.cloud.ces.v1.IBigQueryExportSettings} message BigQueryExportSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BigQueryExportSettings.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.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); - if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dataset); - return writer; - }; - - /** - * Encodes the specified BigQueryExportSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BigQueryExportSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.BigQueryExportSettings - * @static - * @param {google.cloud.ces.v1.IBigQueryExportSettings} message BigQueryExportSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BigQueryExportSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BigQueryExportSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.BigQueryExportSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.BigQueryExportSettings} BigQueryExportSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BigQueryExportSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.BigQueryExportSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enabled = reader.bool(); - break; - } - case 2: { - message.project = reader.string(); - break; - } - case 3: { - message.dataset = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BigQueryExportSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.BigQueryExportSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.BigQueryExportSettings} BigQueryExportSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BigQueryExportSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BigQueryExportSettings message. - * @function verify - * @memberof google.cloud.ces.v1.BigQueryExportSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BigQueryExportSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enabled != null && message.hasOwnProperty("enabled")) - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) - if (!$util.isString(message.dataset)) - return "dataset: string expected"; - return null; - }; - - /** - * Creates a BigQueryExportSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.BigQueryExportSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.BigQueryExportSettings} BigQueryExportSettings - */ - BigQueryExportSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.BigQueryExportSettings) - return object; - var message = new $root.google.cloud.ces.v1.BigQueryExportSettings(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.project != null) - message.project = String(object.project); - if (object.dataset != null) - message.dataset = String(object.dataset); - return message; - }; - - /** - * Creates a plain object from a BigQueryExportSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.BigQueryExportSettings - * @static - * @param {google.cloud.ces.v1.BigQueryExportSettings} message BigQueryExportSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BigQueryExportSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.enabled = false; - object.project = ""; - object.dataset = ""; - } - if (message.enabled != null && message.hasOwnProperty("enabled")) - object.enabled = message.enabled; - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = message.dataset; - return object; - }; - - /** - * Converts this BigQueryExportSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.BigQueryExportSettings - * @instance - * @returns {Object.} JSON object - */ - BigQueryExportSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BigQueryExportSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1.BigQueryExportSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BigQueryExportSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.BigQueryExportSettings"; - }; - - return BigQueryExportSettings; - })(); - - v1.Schema = (function() { - - /** - * Properties of a Schema. - * @memberof google.cloud.ces.v1 - * @interface ISchema - * @property {google.cloud.ces.v1.Schema.Type|null} [type] Schema type - * @property {Object.|null} [properties] Schema properties - * @property {Array.|null} [required] Schema required - * @property {string|null} [description] Schema description - * @property {google.cloud.ces.v1.ISchema|null} [items] Schema items - * @property {boolean|null} [nullable] Schema nullable - * @property {boolean|null} [uniqueItems] Schema uniqueItems - * @property {Array.|null} [prefixItems] Schema prefixItems - * @property {google.cloud.ces.v1.ISchema|null} [additionalProperties] Schema additionalProperties - * @property {Array.|null} [anyOf] Schema anyOf - * @property {Array.|null} ["enum"] Schema enum - * @property {google.protobuf.IValue|null} ["default"] Schema default - * @property {string|null} [ref] Schema ref - * @property {Object.|null} [defs] Schema defs - * @property {string|null} [title] Schema title - * @property {number|Long|null} [minItems] Schema minItems - * @property {number|Long|null} [maxItems] Schema maxItems - * @property {number|null} [minimum] Schema minimum - * @property {number|null} [maximum] Schema maximum - */ - - /** - * Constructs a new Schema. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a Schema. - * @implements ISchema - * @constructor - * @param {google.cloud.ces.v1.ISchema=} [properties] Properties to set - */ - function Schema(properties) { - this.properties = {}; - this.required = []; - this.prefixItems = []; - this.anyOf = []; - this["enum"] = []; - this.defs = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Schema type. - * @member {google.cloud.ces.v1.Schema.Type} type - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype.type = 0; - - /** - * Schema properties. - * @member {Object.} properties - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype.properties = $util.emptyObject; - - /** - * Schema required. - * @member {Array.} required - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype.required = $util.emptyArray; - - /** - * Schema description. - * @member {string} description - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype.description = ""; - - /** - * Schema items. - * @member {google.cloud.ces.v1.ISchema|null|undefined} items - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype.items = null; - - /** - * Schema nullable. - * @member {boolean} nullable - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype.nullable = false; - - /** - * Schema uniqueItems. - * @member {boolean} uniqueItems - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype.uniqueItems = false; - - /** - * Schema prefixItems. - * @member {Array.} prefixItems - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype.prefixItems = $util.emptyArray; - - /** - * Schema additionalProperties. - * @member {google.cloud.ces.v1.ISchema|null|undefined} additionalProperties - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype.additionalProperties = null; - - /** - * Schema anyOf. - * @member {Array.} anyOf - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype.anyOf = $util.emptyArray; - - /** - * Schema enum. - * @member {Array.} enum - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype["enum"] = $util.emptyArray; - - /** - * Schema default. - * @member {google.protobuf.IValue|null|undefined} default - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype["default"] = null; - - /** - * Schema ref. - * @member {string} ref - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype.ref = ""; - - /** - * Schema defs. - * @member {Object.} defs - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype.defs = $util.emptyObject; - - /** - * Schema title. - * @member {string} title - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype.title = ""; - - /** - * Schema minItems. - * @member {number|Long} minItems - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype.minItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Schema maxItems. - * @member {number|Long} maxItems - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype.maxItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Schema minimum. - * @member {number|null|undefined} minimum - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype.minimum = null; - - /** - * Schema maximum. - * @member {number|null|undefined} maximum - * @memberof google.cloud.ces.v1.Schema - * @instance - */ - Schema.prototype.maximum = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Schema.prototype, "_minimum", { - get: $util.oneOfGetter($oneOfFields = ["minimum"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Schema.prototype, "_maximum", { - get: $util.oneOfGetter($oneOfFields = ["maximum"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Schema instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Schema - * @static - * @param {google.cloud.ces.v1.ISchema=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Schema} Schema instance - */ - Schema.create = function create(properties) { - return new Schema(properties); - }; - - /** - * Encodes the specified Schema message. Does not implicitly {@link google.cloud.ces.v1.Schema.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Schema - * @static - * @param {google.cloud.ces.v1.ISchema} message Schema message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Schema.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), 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.ces.v1.Schema.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.required != null && message.required.length) - for (var i = 0; i < message.required.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.required[i]); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); - if (message.items != null && Object.hasOwnProperty.call(message, "items")) - $root.google.cloud.ces.v1.Schema.encode(message.items, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.nullable != null && Object.hasOwnProperty.call(message, "nullable")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.nullable); - if (message.uniqueItems != null && Object.hasOwnProperty.call(message, "uniqueItems")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.uniqueItems); - if (message.prefixItems != null && message.prefixItems.length) - for (var i = 0; i < message.prefixItems.length; ++i) - $root.google.cloud.ces.v1.Schema.encode(message.prefixItems[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalProperties != null && Object.hasOwnProperty.call(message, "additionalProperties")) - $root.google.cloud.ces.v1.Schema.encode(message.additionalProperties, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.anyOf != null && message.anyOf.length) - for (var i = 0; i < message.anyOf.length; ++i) - $root.google.cloud.ces.v1.Schema.encode(message.anyOf[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message["enum"] != null && message["enum"].length) - for (var i = 0; i < message["enum"].length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).string(message["enum"][i]); - if (message["default"] != null && Object.hasOwnProperty.call(message, "default")) - $root.google.protobuf.Value.encode(message["default"], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.ref != null && Object.hasOwnProperty.call(message, "ref")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.ref); - if (message.defs != null && Object.hasOwnProperty.call(message, "defs")) - for (var keys = Object.keys(message.defs), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.ces.v1.Schema.encode(message.defs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.title); - if (message.minItems != null && Object.hasOwnProperty.call(message, "minItems")) - writer.uint32(/* id 16, wireType 0 =*/128).int64(message.minItems); - if (message.maxItems != null && Object.hasOwnProperty.call(message, "maxItems")) - writer.uint32(/* id 17, wireType 0 =*/136).int64(message.maxItems); - if (message.minimum != null && Object.hasOwnProperty.call(message, "minimum")) - writer.uint32(/* id 18, wireType 1 =*/145).double(message.minimum); - if (message.maximum != null && Object.hasOwnProperty.call(message, "maximum")) - writer.uint32(/* id 19, wireType 1 =*/153).double(message.maximum); - return writer; - }; - - /** - * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Schema.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Schema - * @static - * @param {google.cloud.ces.v1.ISchema} message Schema message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Schema.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Schema message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Schema - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Schema} Schema - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Schema.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Schema(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - if (message.properties === $util.emptyObject) - message.properties = {}; - 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.ces.v1.Schema.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.properties[key] = value; - break; - } - case 3: { - if (!(message.required && message.required.length)) - message.required = []; - message.required.push(reader.string()); - break; - } - case 4: { - message.description = reader.string(); - break; - } - case 5: { - message.items = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); - break; - } - case 6: { - message.nullable = reader.bool(); - break; - } - case 7: { - message.uniqueItems = reader.bool(); - break; - } - case 8: { - if (!(message.prefixItems && message.prefixItems.length)) - message.prefixItems = []; - message.prefixItems.push($root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32())); - break; - } - case 9: { - message.additionalProperties = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); - break; - } - case 10: { - if (!(message.anyOf && message.anyOf.length)) - message.anyOf = []; - message.anyOf.push($root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32())); - break; - } - case 11: { - if (!(message["enum"] && message["enum"].length)) - message["enum"] = []; - message["enum"].push(reader.string()); - break; - } - case 12: { - message["default"] = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - } - case 13: { - message.ref = reader.string(); - break; - } - case 14: { - if (message.defs === $util.emptyObject) - message.defs = {}; - 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.ces.v1.Schema.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.defs[key] = value; - break; - } - case 15: { - message.title = reader.string(); - break; - } - case 16: { - message.minItems = reader.int64(); - break; - } - case 17: { - message.maxItems = reader.int64(); - break; - } - case 18: { - message.minimum = reader.double(); - break; - } - case 19: { - message.maximum = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Schema message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Schema - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Schema} Schema - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Schema.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Schema message. - * @function verify - * @memberof google.cloud.ces.v1.Schema - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Schema.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.ces.v1.Schema.verify(message.properties[key[i]]); - if (error) - return "properties." + error; - } - } - if (message.required != null && message.hasOwnProperty("required")) { - if (!Array.isArray(message.required)) - return "required: array expected"; - for (var i = 0; i < message.required.length; ++i) - if (!$util.isString(message.required[i])) - return "required: string[] expected"; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.items != null && message.hasOwnProperty("items")) { - var error = $root.google.cloud.ces.v1.Schema.verify(message.items); - if (error) - return "items." + error; - } - if (message.nullable != null && message.hasOwnProperty("nullable")) - if (typeof message.nullable !== "boolean") - return "nullable: boolean expected"; - if (message.uniqueItems != null && message.hasOwnProperty("uniqueItems")) - if (typeof message.uniqueItems !== "boolean") - return "uniqueItems: boolean expected"; - if (message.prefixItems != null && message.hasOwnProperty("prefixItems")) { - if (!Array.isArray(message.prefixItems)) - return "prefixItems: array expected"; - for (var i = 0; i < message.prefixItems.length; ++i) { - var error = $root.google.cloud.ces.v1.Schema.verify(message.prefixItems[i]); - if (error) - return "prefixItems." + error; - } - } - if (message.additionalProperties != null && message.hasOwnProperty("additionalProperties")) { - var error = $root.google.cloud.ces.v1.Schema.verify(message.additionalProperties); - if (error) - return "additionalProperties." + error; - } - if (message.anyOf != null && message.hasOwnProperty("anyOf")) { - if (!Array.isArray(message.anyOf)) - return "anyOf: array expected"; - for (var i = 0; i < message.anyOf.length; ++i) { - var error = $root.google.cloud.ces.v1.Schema.verify(message.anyOf[i]); - if (error) - return "anyOf." + error; - } - } - if (message["enum"] != null && message.hasOwnProperty("enum")) { - if (!Array.isArray(message["enum"])) - return "enum: array expected"; - for (var i = 0; i < message["enum"].length; ++i) - if (!$util.isString(message["enum"][i])) - return "enum: string[] expected"; - } - if (message["default"] != null && message.hasOwnProperty("default")) { - var error = $root.google.protobuf.Value.verify(message["default"]); - if (error) - return "default." + error; - } - if (message.ref != null && message.hasOwnProperty("ref")) - if (!$util.isString(message.ref)) - return "ref: string expected"; - if (message.defs != null && message.hasOwnProperty("defs")) { - if (!$util.isObject(message.defs)) - return "defs: object expected"; - var key = Object.keys(message.defs); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.ces.v1.Schema.verify(message.defs[key[i]]); - if (error) - return "defs." + error; - } - } - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.minItems != null && message.hasOwnProperty("minItems")) - if (!$util.isInteger(message.minItems) && !(message.minItems && $util.isInteger(message.minItems.low) && $util.isInteger(message.minItems.high))) - return "minItems: integer|Long expected"; - if (message.maxItems != null && message.hasOwnProperty("maxItems")) - if (!$util.isInteger(message.maxItems) && !(message.maxItems && $util.isInteger(message.maxItems.low) && $util.isInteger(message.maxItems.high))) - return "maxItems: integer|Long expected"; - if (message.minimum != null && message.hasOwnProperty("minimum")) { - properties._minimum = 1; - if (typeof message.minimum !== "number") - return "minimum: number expected"; - } - if (message.maximum != null && message.hasOwnProperty("maximum")) { - properties._maximum = 1; - if (typeof message.maximum !== "number") - return "maximum: number expected"; - } - return null; - }; - - /** - * Creates a Schema message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Schema - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Schema} Schema - */ - Schema.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Schema) - return object; - var message = new $root.google.cloud.ces.v1.Schema(); - 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 "STRING": - case 1: - message.type = 1; - break; - case "INTEGER": - case 2: - message.type = 2; - break; - case "NUMBER": - case 3: - message.type = 3; - break; - case "BOOLEAN": - case 4: - message.type = 4; - break; - case "OBJECT": - case 5: - message.type = 5; - break; - case "ARRAY": - case 6: - message.type = 6; - break; - } - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.ces.v1.Schema.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { - if (typeof object.properties[keys[i]] !== "object") - throw TypeError(".google.cloud.ces.v1.Schema.properties: object expected"); - message.properties[keys[i]] = $root.google.cloud.ces.v1.Schema.fromObject(object.properties[keys[i]]); - } - } - if (object.required) { - if (!Array.isArray(object.required)) - throw TypeError(".google.cloud.ces.v1.Schema.required: array expected"); - message.required = []; - for (var i = 0; i < object.required.length; ++i) - message.required[i] = String(object.required[i]); - } - if (object.description != null) - message.description = String(object.description); - if (object.items != null) { - if (typeof object.items !== "object") - throw TypeError(".google.cloud.ces.v1.Schema.items: object expected"); - message.items = $root.google.cloud.ces.v1.Schema.fromObject(object.items); - } - if (object.nullable != null) - message.nullable = Boolean(object.nullable); - if (object.uniqueItems != null) - message.uniqueItems = Boolean(object.uniqueItems); - if (object.prefixItems) { - if (!Array.isArray(object.prefixItems)) - throw TypeError(".google.cloud.ces.v1.Schema.prefixItems: array expected"); - message.prefixItems = []; - for (var i = 0; i < object.prefixItems.length; ++i) { - if (typeof object.prefixItems[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Schema.prefixItems: object expected"); - message.prefixItems[i] = $root.google.cloud.ces.v1.Schema.fromObject(object.prefixItems[i]); - } - } - if (object.additionalProperties != null) { - if (typeof object.additionalProperties !== "object") - throw TypeError(".google.cloud.ces.v1.Schema.additionalProperties: object expected"); - message.additionalProperties = $root.google.cloud.ces.v1.Schema.fromObject(object.additionalProperties); - } - if (object.anyOf) { - if (!Array.isArray(object.anyOf)) - throw TypeError(".google.cloud.ces.v1.Schema.anyOf: array expected"); - message.anyOf = []; - for (var i = 0; i < object.anyOf.length; ++i) { - if (typeof object.anyOf[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Schema.anyOf: object expected"); - message.anyOf[i] = $root.google.cloud.ces.v1.Schema.fromObject(object.anyOf[i]); - } - } - if (object["enum"]) { - if (!Array.isArray(object["enum"])) - throw TypeError(".google.cloud.ces.v1.Schema.enum: array expected"); - message["enum"] = []; - for (var i = 0; i < object["enum"].length; ++i) - message["enum"][i] = String(object["enum"][i]); - } - if (object["default"] != null) { - if (typeof object["default"] !== "object") - throw TypeError(".google.cloud.ces.v1.Schema.default: object expected"); - message["default"] = $root.google.protobuf.Value.fromObject(object["default"]); - } - if (object.ref != null) - message.ref = String(object.ref); - if (object.defs) { - if (typeof object.defs !== "object") - throw TypeError(".google.cloud.ces.v1.Schema.defs: object expected"); - message.defs = {}; - for (var keys = Object.keys(object.defs), i = 0; i < keys.length; ++i) { - if (typeof object.defs[keys[i]] !== "object") - throw TypeError(".google.cloud.ces.v1.Schema.defs: object expected"); - message.defs[keys[i]] = $root.google.cloud.ces.v1.Schema.fromObject(object.defs[keys[i]]); - } - } - if (object.title != null) - message.title = String(object.title); - if (object.minItems != null) - if ($util.Long) - (message.minItems = $util.Long.fromValue(object.minItems)).unsigned = false; - else if (typeof object.minItems === "string") - message.minItems = parseInt(object.minItems, 10); - else if (typeof object.minItems === "number") - message.minItems = object.minItems; - else if (typeof object.minItems === "object") - message.minItems = new $util.LongBits(object.minItems.low >>> 0, object.minItems.high >>> 0).toNumber(); - if (object.maxItems != null) - if ($util.Long) - (message.maxItems = $util.Long.fromValue(object.maxItems)).unsigned = false; - else if (typeof object.maxItems === "string") - message.maxItems = parseInt(object.maxItems, 10); - else if (typeof object.maxItems === "number") - message.maxItems = object.maxItems; - else if (typeof object.maxItems === "object") - message.maxItems = new $util.LongBits(object.maxItems.low >>> 0, object.maxItems.high >>> 0).toNumber(); - if (object.minimum != null) - message.minimum = Number(object.minimum); - if (object.maximum != null) - message.maximum = Number(object.maximum); - return message; - }; - - /** - * Creates a plain object from a Schema message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Schema - * @static - * @param {google.cloud.ces.v1.Schema} message Schema - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Schema.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.required = []; - object.prefixItems = []; - object.anyOf = []; - object["enum"] = []; - } - if (options.objects || options.defaults) { - object.properties = {}; - object.defs = {}; - } - if (options.defaults) { - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.description = ""; - object.items = null; - object.nullable = false; - object.uniqueItems = false; - object.additionalProperties = null; - object["default"] = null; - object.ref = ""; - object.title = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.minItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.minItems = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.maxItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxItems = options.longs === String ? "0" : 0; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.ces.v1.Schema.Type[message.type] === undefined ? message.type : $root.google.cloud.ces.v1.Schema.Type[message.type] : message.type; - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = $root.google.cloud.ces.v1.Schema.toObject(message.properties[keys2[j]], options); - } - if (message.required && message.required.length) { - object.required = []; - for (var j = 0; j < message.required.length; ++j) - object.required[j] = message.required[j]; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.items != null && message.hasOwnProperty("items")) - object.items = $root.google.cloud.ces.v1.Schema.toObject(message.items, options); - if (message.nullable != null && message.hasOwnProperty("nullable")) - object.nullable = message.nullable; - if (message.uniqueItems != null && message.hasOwnProperty("uniqueItems")) - object.uniqueItems = message.uniqueItems; - if (message.prefixItems && message.prefixItems.length) { - object.prefixItems = []; - for (var j = 0; j < message.prefixItems.length; ++j) - object.prefixItems[j] = $root.google.cloud.ces.v1.Schema.toObject(message.prefixItems[j], options); - } - if (message.additionalProperties != null && message.hasOwnProperty("additionalProperties")) - object.additionalProperties = $root.google.cloud.ces.v1.Schema.toObject(message.additionalProperties, options); - if (message.anyOf && message.anyOf.length) { - object.anyOf = []; - for (var j = 0; j < message.anyOf.length; ++j) - object.anyOf[j] = $root.google.cloud.ces.v1.Schema.toObject(message.anyOf[j], options); - } - if (message["enum"] && message["enum"].length) { - object["enum"] = []; - for (var j = 0; j < message["enum"].length; ++j) - object["enum"][j] = message["enum"][j]; - } - if (message["default"] != null && message.hasOwnProperty("default")) - object["default"] = $root.google.protobuf.Value.toObject(message["default"], options); - if (message.ref != null && message.hasOwnProperty("ref")) - object.ref = message.ref; - if (message.defs && (keys2 = Object.keys(message.defs)).length) { - object.defs = {}; - for (var j = 0; j < keys2.length; ++j) - object.defs[keys2[j]] = $root.google.cloud.ces.v1.Schema.toObject(message.defs[keys2[j]], options); - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.minItems != null && message.hasOwnProperty("minItems")) - if (typeof message.minItems === "number") - object.minItems = options.longs === String ? String(message.minItems) : message.minItems; - else - object.minItems = options.longs === String ? $util.Long.prototype.toString.call(message.minItems) : options.longs === Number ? new $util.LongBits(message.minItems.low >>> 0, message.minItems.high >>> 0).toNumber() : message.minItems; - if (message.maxItems != null && message.hasOwnProperty("maxItems")) - if (typeof message.maxItems === "number") - object.maxItems = options.longs === String ? String(message.maxItems) : message.maxItems; - else - object.maxItems = options.longs === String ? $util.Long.prototype.toString.call(message.maxItems) : options.longs === Number ? new $util.LongBits(message.maxItems.low >>> 0, message.maxItems.high >>> 0).toNumber() : message.maxItems; - if (message.minimum != null && message.hasOwnProperty("minimum")) { - object.minimum = options.json && !isFinite(message.minimum) ? String(message.minimum) : message.minimum; - if (options.oneofs) - object._minimum = "minimum"; - } - if (message.maximum != null && message.hasOwnProperty("maximum")) { - object.maximum = options.json && !isFinite(message.maximum) ? String(message.maximum) : message.maximum; - if (options.oneofs) - object._maximum = "maximum"; - } - return object; - }; - - /** - * Converts this Schema to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Schema - * @instance - * @returns {Object.} JSON object - */ - Schema.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Schema - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Schema - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Schema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Schema"; - }; - - /** - * Type enum. - * @name google.cloud.ces.v1.Schema.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} STRING=1 STRING value - * @property {number} INTEGER=2 INTEGER value - * @property {number} NUMBER=3 NUMBER value - * @property {number} BOOLEAN=4 BOOLEAN value - * @property {number} OBJECT=5 OBJECT value - * @property {number} ARRAY=6 ARRAY value - */ - Schema.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STRING"] = 1; - values[valuesById[2] = "INTEGER"] = 2; - values[valuesById[3] = "NUMBER"] = 3; - values[valuesById[4] = "BOOLEAN"] = 4; - values[valuesById[5] = "OBJECT"] = 5; - values[valuesById[6] = "ARRAY"] = 6; - return values; - })(); - - return Schema; - })(); - - v1.AppSnapshot = (function() { - - /** - * Properties of an AppSnapshot. - * @memberof google.cloud.ces.v1 - * @interface IAppSnapshot - * @property {google.cloud.ces.v1.IApp|null} [app] AppSnapshot app - * @property {Array.|null} [agents] AppSnapshot agents - * @property {Array.|null} [tools] AppSnapshot tools - * @property {Array.|null} [examples] AppSnapshot examples - * @property {Array.|null} [guardrails] AppSnapshot guardrails - * @property {Array.|null} [toolsets] AppSnapshot toolsets - */ - - /** - * Constructs a new AppSnapshot. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an AppSnapshot. - * @implements IAppSnapshot - * @constructor - * @param {google.cloud.ces.v1.IAppSnapshot=} [properties] Properties to set - */ - function AppSnapshot(properties) { - this.agents = []; - this.tools = []; - this.examples = []; - this.guardrails = []; - this.toolsets = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AppSnapshot app. - * @member {google.cloud.ces.v1.IApp|null|undefined} app - * @memberof google.cloud.ces.v1.AppSnapshot - * @instance - */ - AppSnapshot.prototype.app = null; - - /** - * AppSnapshot agents. - * @member {Array.} agents - * @memberof google.cloud.ces.v1.AppSnapshot - * @instance - */ - AppSnapshot.prototype.agents = $util.emptyArray; - - /** - * AppSnapshot tools. - * @member {Array.} tools - * @memberof google.cloud.ces.v1.AppSnapshot - * @instance - */ - AppSnapshot.prototype.tools = $util.emptyArray; - - /** - * AppSnapshot examples. - * @member {Array.} examples - * @memberof google.cloud.ces.v1.AppSnapshot - * @instance - */ - AppSnapshot.prototype.examples = $util.emptyArray; - - /** - * AppSnapshot guardrails. - * @member {Array.} guardrails - * @memberof google.cloud.ces.v1.AppSnapshot - * @instance - */ - AppSnapshot.prototype.guardrails = $util.emptyArray; - - /** - * AppSnapshot toolsets. - * @member {Array.} toolsets - * @memberof google.cloud.ces.v1.AppSnapshot - * @instance - */ - AppSnapshot.prototype.toolsets = $util.emptyArray; - - /** - * Creates a new AppSnapshot instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.AppSnapshot - * @static - * @param {google.cloud.ces.v1.IAppSnapshot=} [properties] Properties to set - * @returns {google.cloud.ces.v1.AppSnapshot} AppSnapshot instance - */ - AppSnapshot.create = function create(properties) { - return new AppSnapshot(properties); - }; - - /** - * Encodes the specified AppSnapshot message. Does not implicitly {@link google.cloud.ces.v1.AppSnapshot.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.AppSnapshot - * @static - * @param {google.cloud.ces.v1.IAppSnapshot} message AppSnapshot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppSnapshot.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.app != null && Object.hasOwnProperty.call(message, "app")) - $root.google.cloud.ces.v1.App.encode(message.app, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.agents != null && message.agents.length) - for (var i = 0; i < message.agents.length; ++i) - $root.google.cloud.ces.v1.Agent.encode(message.agents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.tools != null && message.tools.length) - for (var i = 0; i < message.tools.length; ++i) - $root.google.cloud.ces.v1.Tool.encode(message.tools[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.examples != null && message.examples.length) - for (var i = 0; i < message.examples.length; ++i) - $root.google.cloud.ces.v1.Example.encode(message.examples[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.guardrails != null && message.guardrails.length) - for (var i = 0; i < message.guardrails.length; ++i) - $root.google.cloud.ces.v1.Guardrail.encode(message.guardrails[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.toolsets != null && message.toolsets.length) - for (var i = 0; i < message.toolsets.length; ++i) - $root.google.cloud.ces.v1.Toolset.encode(message.toolsets[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AppSnapshot message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AppSnapshot.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.AppSnapshot - * @static - * @param {google.cloud.ces.v1.IAppSnapshot} message AppSnapshot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppSnapshot.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AppSnapshot message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.AppSnapshot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.AppSnapshot} AppSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppSnapshot.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.AppSnapshot(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.app = $root.google.cloud.ces.v1.App.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.agents && message.agents.length)) - message.agents = []; - message.agents.push($root.google.cloud.ces.v1.Agent.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.tools && message.tools.length)) - message.tools = []; - message.tools.push($root.google.cloud.ces.v1.Tool.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.examples && message.examples.length)) - message.examples = []; - message.examples.push($root.google.cloud.ces.v1.Example.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.guardrails && message.guardrails.length)) - message.guardrails = []; - message.guardrails.push($root.google.cloud.ces.v1.Guardrail.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.toolsets && message.toolsets.length)) - message.toolsets = []; - message.toolsets.push($root.google.cloud.ces.v1.Toolset.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AppSnapshot message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.AppSnapshot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.AppSnapshot} AppSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppSnapshot.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AppSnapshot message. - * @function verify - * @memberof google.cloud.ces.v1.AppSnapshot - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AppSnapshot.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.app != null && message.hasOwnProperty("app")) { - var error = $root.google.cloud.ces.v1.App.verify(message.app); - if (error) - return "app." + error; - } - if (message.agents != null && message.hasOwnProperty("agents")) { - if (!Array.isArray(message.agents)) - return "agents: array expected"; - for (var i = 0; i < message.agents.length; ++i) { - var error = $root.google.cloud.ces.v1.Agent.verify(message.agents[i]); - if (error) - return "agents." + error; - } - } - if (message.tools != null && message.hasOwnProperty("tools")) { - if (!Array.isArray(message.tools)) - return "tools: array expected"; - for (var i = 0; i < message.tools.length; ++i) { - var error = $root.google.cloud.ces.v1.Tool.verify(message.tools[i]); - if (error) - return "tools." + error; - } - } - if (message.examples != null && message.hasOwnProperty("examples")) { - if (!Array.isArray(message.examples)) - return "examples: array expected"; - for (var i = 0; i < message.examples.length; ++i) { - var error = $root.google.cloud.ces.v1.Example.verify(message.examples[i]); - if (error) - return "examples." + error; - } - } - if (message.guardrails != null && message.hasOwnProperty("guardrails")) { - if (!Array.isArray(message.guardrails)) - return "guardrails: array expected"; - for (var i = 0; i < message.guardrails.length; ++i) { - var error = $root.google.cloud.ces.v1.Guardrail.verify(message.guardrails[i]); - if (error) - return "guardrails." + error; - } - } - if (message.toolsets != null && message.hasOwnProperty("toolsets")) { - if (!Array.isArray(message.toolsets)) - return "toolsets: array expected"; - for (var i = 0; i < message.toolsets.length; ++i) { - var error = $root.google.cloud.ces.v1.Toolset.verify(message.toolsets[i]); - if (error) - return "toolsets." + error; - } - } - return null; - }; - - /** - * Creates an AppSnapshot message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.AppSnapshot - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.AppSnapshot} AppSnapshot - */ - AppSnapshot.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.AppSnapshot) - return object; - var message = new $root.google.cloud.ces.v1.AppSnapshot(); - if (object.app != null) { - if (typeof object.app !== "object") - throw TypeError(".google.cloud.ces.v1.AppSnapshot.app: object expected"); - message.app = $root.google.cloud.ces.v1.App.fromObject(object.app); - } - if (object.agents) { - if (!Array.isArray(object.agents)) - throw TypeError(".google.cloud.ces.v1.AppSnapshot.agents: array expected"); - message.agents = []; - for (var i = 0; i < object.agents.length; ++i) { - if (typeof object.agents[i] !== "object") - throw TypeError(".google.cloud.ces.v1.AppSnapshot.agents: object expected"); - message.agents[i] = $root.google.cloud.ces.v1.Agent.fromObject(object.agents[i]); - } - } - if (object.tools) { - if (!Array.isArray(object.tools)) - throw TypeError(".google.cloud.ces.v1.AppSnapshot.tools: array expected"); - message.tools = []; - for (var i = 0; i < object.tools.length; ++i) { - if (typeof object.tools[i] !== "object") - throw TypeError(".google.cloud.ces.v1.AppSnapshot.tools: object expected"); - message.tools[i] = $root.google.cloud.ces.v1.Tool.fromObject(object.tools[i]); - } - } - if (object.examples) { - if (!Array.isArray(object.examples)) - throw TypeError(".google.cloud.ces.v1.AppSnapshot.examples: array expected"); - message.examples = []; - for (var i = 0; i < object.examples.length; ++i) { - if (typeof object.examples[i] !== "object") - throw TypeError(".google.cloud.ces.v1.AppSnapshot.examples: object expected"); - message.examples[i] = $root.google.cloud.ces.v1.Example.fromObject(object.examples[i]); - } - } - if (object.guardrails) { - if (!Array.isArray(object.guardrails)) - throw TypeError(".google.cloud.ces.v1.AppSnapshot.guardrails: array expected"); - message.guardrails = []; - for (var i = 0; i < object.guardrails.length; ++i) { - if (typeof object.guardrails[i] !== "object") - throw TypeError(".google.cloud.ces.v1.AppSnapshot.guardrails: object expected"); - message.guardrails[i] = $root.google.cloud.ces.v1.Guardrail.fromObject(object.guardrails[i]); - } - } - if (object.toolsets) { - if (!Array.isArray(object.toolsets)) - throw TypeError(".google.cloud.ces.v1.AppSnapshot.toolsets: array expected"); - message.toolsets = []; - for (var i = 0; i < object.toolsets.length; ++i) { - if (typeof object.toolsets[i] !== "object") - throw TypeError(".google.cloud.ces.v1.AppSnapshot.toolsets: object expected"); - message.toolsets[i] = $root.google.cloud.ces.v1.Toolset.fromObject(object.toolsets[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AppSnapshot message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.AppSnapshot - * @static - * @param {google.cloud.ces.v1.AppSnapshot} message AppSnapshot - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AppSnapshot.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.agents = []; - object.tools = []; - object.examples = []; - object.guardrails = []; - object.toolsets = []; - } - if (options.defaults) - object.app = null; - if (message.app != null && message.hasOwnProperty("app")) - object.app = $root.google.cloud.ces.v1.App.toObject(message.app, options); - if (message.agents && message.agents.length) { - object.agents = []; - for (var j = 0; j < message.agents.length; ++j) - object.agents[j] = $root.google.cloud.ces.v1.Agent.toObject(message.agents[j], options); - } - if (message.tools && message.tools.length) { - object.tools = []; - for (var j = 0; j < message.tools.length; ++j) - object.tools[j] = $root.google.cloud.ces.v1.Tool.toObject(message.tools[j], options); - } - if (message.examples && message.examples.length) { - object.examples = []; - for (var j = 0; j < message.examples.length; ++j) - object.examples[j] = $root.google.cloud.ces.v1.Example.toObject(message.examples[j], options); - } - if (message.guardrails && message.guardrails.length) { - object.guardrails = []; - for (var j = 0; j < message.guardrails.length; ++j) - object.guardrails[j] = $root.google.cloud.ces.v1.Guardrail.toObject(message.guardrails[j], options); - } - if (message.toolsets && message.toolsets.length) { - object.toolsets = []; - for (var j = 0; j < message.toolsets.length; ++j) - object.toolsets[j] = $root.google.cloud.ces.v1.Toolset.toObject(message.toolsets[j], options); - } - return object; - }; - - /** - * Converts this AppSnapshot to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.AppSnapshot - * @instance - * @returns {Object.} JSON object - */ - AppSnapshot.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AppSnapshot - * @function getTypeUrl - * @memberof google.cloud.ces.v1.AppSnapshot - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AppSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.AppSnapshot"; - }; - - return AppSnapshot; - })(); - - v1.AppVersion = (function() { - - /** - * Properties of an AppVersion. - * @memberof google.cloud.ces.v1 - * @interface IAppVersion - * @property {string|null} [name] AppVersion name - * @property {string|null} [displayName] AppVersion displayName - * @property {string|null} [description] AppVersion description - * @property {string|null} [creator] AppVersion creator - * @property {google.protobuf.ITimestamp|null} [createTime] AppVersion createTime - * @property {google.cloud.ces.v1.IAppSnapshot|null} [snapshot] AppVersion snapshot - * @property {string|null} [etag] AppVersion etag - */ - - /** - * Constructs a new AppVersion. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an AppVersion. - * @implements IAppVersion - * @constructor - * @param {google.cloud.ces.v1.IAppVersion=} [properties] Properties to set - */ - function AppVersion(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AppVersion name. - * @member {string} name - * @memberof google.cloud.ces.v1.AppVersion - * @instance - */ - AppVersion.prototype.name = ""; - - /** - * AppVersion displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1.AppVersion - * @instance - */ - AppVersion.prototype.displayName = ""; - - /** - * AppVersion description. - * @member {string} description - * @memberof google.cloud.ces.v1.AppVersion - * @instance - */ - AppVersion.prototype.description = ""; - - /** - * AppVersion creator. - * @member {string} creator - * @memberof google.cloud.ces.v1.AppVersion - * @instance - */ - AppVersion.prototype.creator = ""; - - /** - * AppVersion createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1.AppVersion - * @instance - */ - AppVersion.prototype.createTime = null; - - /** - * AppVersion snapshot. - * @member {google.cloud.ces.v1.IAppSnapshot|null|undefined} snapshot - * @memberof google.cloud.ces.v1.AppVersion - * @instance - */ - AppVersion.prototype.snapshot = null; - - /** - * AppVersion etag. - * @member {string} etag - * @memberof google.cloud.ces.v1.AppVersion - * @instance - */ - AppVersion.prototype.etag = ""; - - /** - * Creates a new AppVersion instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.AppVersion - * @static - * @param {google.cloud.ces.v1.IAppVersion=} [properties] Properties to set - * @returns {google.cloud.ces.v1.AppVersion} AppVersion instance - */ - AppVersion.create = function create(properties) { - return new AppVersion(properties); - }; - - /** - * Encodes the specified AppVersion message. Does not implicitly {@link google.cloud.ces.v1.AppVersion.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.AppVersion - * @static - * @param {google.cloud.ces.v1.IAppVersion} message AppVersion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppVersion.encode = function encode(message, writer) { - if (!writer) - 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.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.creator); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); - if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) - $root.google.cloud.ces.v1.AppSnapshot.encode(message.snapshot, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AppVersion message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AppVersion.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.AppVersion - * @static - * @param {google.cloud.ces.v1.IAppVersion} message AppVersion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppVersion.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AppVersion message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.AppVersion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.AppVersion} AppVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppVersion.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.AppVersion(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.creator = reader.string(); - break; - } - case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.snapshot = $root.google.cloud.ces.v1.AppSnapshot.decode(reader, reader.uint32()); - break; - } - case 7: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AppVersion message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.AppVersion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.AppVersion} AppVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppVersion.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AppVersion message. - * @function verify - * @memberof google.cloud.ces.v1.AppVersion - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AppVersion.verify = function verify(message) { - if (typeof message !== "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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: 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.snapshot != null && message.hasOwnProperty("snapshot")) { - var error = $root.google.cloud.ces.v1.AppSnapshot.verify(message.snapshot); - if (error) - return "snapshot." + error; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates an AppVersion message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.AppVersion - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.AppVersion} AppVersion - */ - AppVersion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.AppVersion) - return object; - var message = new $root.google.cloud.ces.v1.AppVersion(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.creator != null) - message.creator = String(object.creator); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1.AppVersion.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.snapshot != null) { - if (typeof object.snapshot !== "object") - throw TypeError(".google.cloud.ces.v1.AppVersion.snapshot: object expected"); - message.snapshot = $root.google.cloud.ces.v1.AppSnapshot.fromObject(object.snapshot); - } - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from an AppVersion message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.AppVersion - * @static - * @param {google.cloud.ces.v1.AppVersion} message AppVersion - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AppVersion.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.creator = ""; - object.createTime = null; - object.etag = ""; - object.snapshot = 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.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.snapshot != null && message.hasOwnProperty("snapshot")) - object.snapshot = $root.google.cloud.ces.v1.AppSnapshot.toObject(message.snapshot, options); - return object; - }; - - /** - * Converts this AppVersion to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.AppVersion - * @instance - * @returns {Object.} JSON object - */ - AppVersion.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AppVersion - * @function getTypeUrl - * @memberof google.cloud.ces.v1.AppVersion - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AppVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.AppVersion"; - }; - - return AppVersion; - })(); - - v1.Example = (function() { - - /** - * Properties of an Example. - * @memberof google.cloud.ces.v1 - * @interface IExample - * @property {string|null} [name] Example name - * @property {string|null} [displayName] Example displayName - * @property {string|null} [description] Example description - * @property {string|null} [entryAgent] Example entryAgent - * @property {Array.|null} [messages] Example messages - * @property {google.protobuf.ITimestamp|null} [createTime] Example createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Example updateTime - * @property {boolean|null} [invalid] Example invalid - * @property {string|null} [etag] Example etag - */ - - /** - * Constructs a new Example. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an Example. - * @implements IExample - * @constructor - * @param {google.cloud.ces.v1.IExample=} [properties] Properties to set - */ - function Example(properties) { - this.messages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Example name. - * @member {string} name - * @memberof google.cloud.ces.v1.Example - * @instance - */ - Example.prototype.name = ""; - - /** - * Example displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1.Example - * @instance - */ - Example.prototype.displayName = ""; - - /** - * Example description. - * @member {string} description - * @memberof google.cloud.ces.v1.Example - * @instance - */ - Example.prototype.description = ""; - - /** - * Example entryAgent. - * @member {string} entryAgent - * @memberof google.cloud.ces.v1.Example - * @instance - */ - Example.prototype.entryAgent = ""; - - /** - * Example messages. - * @member {Array.} messages - * @memberof google.cloud.ces.v1.Example - * @instance - */ - Example.prototype.messages = $util.emptyArray; - - /** - * Example createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1.Example - * @instance - */ - Example.prototype.createTime = null; - - /** - * Example updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1.Example - * @instance - */ - Example.prototype.updateTime = null; - - /** - * Example invalid. - * @member {boolean} invalid - * @memberof google.cloud.ces.v1.Example - * @instance - */ - Example.prototype.invalid = false; - - /** - * Example etag. - * @member {string} etag - * @memberof google.cloud.ces.v1.Example - * @instance - */ - Example.prototype.etag = ""; - - /** - * Creates a new Example instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Example - * @static - * @param {google.cloud.ces.v1.IExample=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Example} Example instance - */ - Example.create = function create(properties) { - return new Example(properties); - }; - - /** - * Encodes the specified Example message. Does not implicitly {@link google.cloud.ces.v1.Example.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Example - * @static - * @param {google.cloud.ces.v1.IExample} message Example message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Example.encode = function encode(message, writer) { - if (!writer) - 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.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.entryAgent != null && Object.hasOwnProperty.call(message, "entryAgent")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.entryAgent); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.google.cloud.ces.v1.Message.encode(message.messages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.invalid != null && Object.hasOwnProperty.call(message, "invalid")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.invalid); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); - return writer; - }; - - /** - * Encodes the specified Example message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Example.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Example - * @static - * @param {google.cloud.ces.v1.IExample} message Example message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Example.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Example message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Example - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Example} Example - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Example.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Example(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.entryAgent = reader.string(); - break; - } - case 5: { - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.google.cloud.ces.v1.Message.decode(reader, reader.uint32())); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.invalid = reader.bool(); - break; - } - case 9: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Example message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Example - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Example} Example - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Example.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Example message. - * @function verify - * @memberof google.cloud.ces.v1.Example - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Example.verify = function verify(message) { - if (typeof message !== "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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) - if (!$util.isString(message.entryAgent)) - return "entryAgent: string expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.cloud.ces.v1.Message.verify(message.messages[i]); - if (error) - return "messages." + error; - } - } - 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.invalid != null && message.hasOwnProperty("invalid")) - if (typeof message.invalid !== "boolean") - return "invalid: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates an Example message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Example - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Example} Example - */ - Example.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Example) - return object; - var message = new $root.google.cloud.ces.v1.Example(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.entryAgent != null) - message.entryAgent = String(object.entryAgent); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".google.cloud.ces.v1.Example.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Example.messages: object expected"); - message.messages[i] = $root.google.cloud.ces.v1.Message.fromObject(object.messages[i]); - } - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1.Example.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.ces.v1.Example.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.invalid != null) - message.invalid = Boolean(object.invalid); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from an Example message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Example - * @static - * @param {google.cloud.ces.v1.Example} message Example - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Example.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.messages = []; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.entryAgent = ""; - object.createTime = null; - object.updateTime = null; - object.invalid = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) - object.entryAgent = message.entryAgent; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.cloud.ces.v1.Message.toObject(message.messages[j], options); - } - 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.invalid != null && message.hasOwnProperty("invalid")) - object.invalid = message.invalid; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this Example to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Example - * @instance - * @returns {Object.} JSON object - */ - Example.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Example - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Example - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Example.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Example"; - }; - - return Example; - })(); - - v1.Message = (function() { - - /** - * Properties of a Message. - * @memberof google.cloud.ces.v1 - * @interface IMessage - * @property {string|null} [role] Message role - * @property {Array.|null} [chunks] Message chunks - * @property {google.protobuf.ITimestamp|null} [eventTime] Message eventTime - */ - - /** - * Constructs a new Message. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a Message. - * @implements IMessage - * @constructor - * @param {google.cloud.ces.v1.IMessage=} [properties] Properties to set - */ - function Message(properties) { - this.chunks = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Message role. - * @member {string} role - * @memberof google.cloud.ces.v1.Message - * @instance - */ - Message.prototype.role = ""; - - /** - * Message chunks. - * @member {Array.} chunks - * @memberof google.cloud.ces.v1.Message - * @instance - */ - Message.prototype.chunks = $util.emptyArray; - - /** - * Message eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.ces.v1.Message - * @instance - */ - Message.prototype.eventTime = null; - - /** - * Creates a new Message instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Message - * @static - * @param {google.cloud.ces.v1.IMessage=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Message} Message instance - */ - Message.create = function create(properties) { - return new Message(properties); - }; - - /** - * Encodes the specified Message message. Does not implicitly {@link google.cloud.ces.v1.Message.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Message - * @static - * @param {google.cloud.ces.v1.IMessage} message Message message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Message.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); - if (message.chunks != null && message.chunks.length) - for (var i = 0; i < message.chunks.length; ++i) - $root.google.cloud.ces.v1.Chunk.encode(message.chunks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Message.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Message - * @static - * @param {google.cloud.ces.v1.IMessage} message Message message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Message.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Message message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Message - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Message} Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Message.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Message(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.role = reader.string(); - break; - } - case 2: { - if (!(message.chunks && message.chunks.length)) - message.chunks = []; - message.chunks.push($root.google.cloud.ces.v1.Chunk.decode(reader, reader.uint32())); - break; - } - case 4: { - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Message message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Message - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Message} Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Message.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Message message. - * @function verify - * @memberof google.cloud.ces.v1.Message - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Message.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.chunks != null && message.hasOwnProperty("chunks")) { - if (!Array.isArray(message.chunks)) - return "chunks: array expected"; - for (var i = 0; i < message.chunks.length; ++i) { - var error = $root.google.cloud.ces.v1.Chunk.verify(message.chunks[i]); - if (error) - return "chunks." + error; - } - } - if (message.eventTime != null && message.hasOwnProperty("eventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventTime); - if (error) - return "eventTime." + error; - } - return null; - }; - - /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Message - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Message} Message - */ - Message.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Message) - return object; - var message = new $root.google.cloud.ces.v1.Message(); - if (object.role != null) - message.role = String(object.role); - if (object.chunks) { - if (!Array.isArray(object.chunks)) - throw TypeError(".google.cloud.ces.v1.Message.chunks: array expected"); - message.chunks = []; - for (var i = 0; i < object.chunks.length; ++i) { - if (typeof object.chunks[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Message.chunks: object expected"); - message.chunks[i] = $root.google.cloud.ces.v1.Chunk.fromObject(object.chunks[i]); - } - } - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.ces.v1.Message.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); - } - return message; - }; - - /** - * Creates a plain object from a Message message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Message - * @static - * @param {google.cloud.ces.v1.Message} message Message - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Message.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.chunks = []; - if (options.defaults) { - object.role = ""; - object.eventTime = null; - } - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.chunks && message.chunks.length) { - object.chunks = []; - for (var j = 0; j < message.chunks.length; ++j) - object.chunks[j] = $root.google.cloud.ces.v1.Chunk.toObject(message.chunks[j], options); - } - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); - return object; - }; - - /** - * Converts this Message to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Message - * @instance - * @returns {Object.} JSON object - */ - Message.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Message - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Message - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Message"; - }; - - return Message; - })(); - - v1.Chunk = (function() { - - /** - * Properties of a Chunk. - * @memberof google.cloud.ces.v1 - * @interface IChunk - * @property {string|null} [text] Chunk text - * @property {string|null} [transcript] Chunk transcript - * @property {google.protobuf.IStruct|null} [payload] Chunk payload - * @property {google.cloud.ces.v1.IImage|null} [image] Chunk image - * @property {google.cloud.ces.v1.IToolCall|null} [toolCall] Chunk toolCall - * @property {google.cloud.ces.v1.IToolResponse|null} [toolResponse] Chunk toolResponse - * @property {google.cloud.ces.v1.IAgentTransfer|null} [agentTransfer] Chunk agentTransfer - * @property {google.protobuf.IStruct|null} [updatedVariables] Chunk updatedVariables - * @property {google.protobuf.IStruct|null} [defaultVariables] Chunk defaultVariables - */ - - /** - * Constructs a new Chunk. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a Chunk. - * @implements IChunk - * @constructor - * @param {google.cloud.ces.v1.IChunk=} [properties] Properties to set - */ - function Chunk(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Chunk text. - * @member {string|null|undefined} text - * @memberof google.cloud.ces.v1.Chunk - * @instance - */ - Chunk.prototype.text = null; - - /** - * Chunk transcript. - * @member {string|null|undefined} transcript - * @memberof google.cloud.ces.v1.Chunk - * @instance - */ - Chunk.prototype.transcript = null; - - /** - * Chunk payload. - * @member {google.protobuf.IStruct|null|undefined} payload - * @memberof google.cloud.ces.v1.Chunk - * @instance - */ - Chunk.prototype.payload = null; - - /** - * Chunk image. - * @member {google.cloud.ces.v1.IImage|null|undefined} image - * @memberof google.cloud.ces.v1.Chunk - * @instance - */ - Chunk.prototype.image = null; - - /** - * Chunk toolCall. - * @member {google.cloud.ces.v1.IToolCall|null|undefined} toolCall - * @memberof google.cloud.ces.v1.Chunk - * @instance - */ - Chunk.prototype.toolCall = null; - - /** - * Chunk toolResponse. - * @member {google.cloud.ces.v1.IToolResponse|null|undefined} toolResponse - * @memberof google.cloud.ces.v1.Chunk - * @instance - */ - Chunk.prototype.toolResponse = null; - - /** - * Chunk agentTransfer. - * @member {google.cloud.ces.v1.IAgentTransfer|null|undefined} agentTransfer - * @memberof google.cloud.ces.v1.Chunk - * @instance - */ - Chunk.prototype.agentTransfer = null; - - /** - * Chunk updatedVariables. - * @member {google.protobuf.IStruct|null|undefined} updatedVariables - * @memberof google.cloud.ces.v1.Chunk - * @instance - */ - Chunk.prototype.updatedVariables = null; - - /** - * Chunk defaultVariables. - * @member {google.protobuf.IStruct|null|undefined} defaultVariables - * @memberof google.cloud.ces.v1.Chunk - * @instance - */ - Chunk.prototype.defaultVariables = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Chunk data. - * @member {"text"|"transcript"|"payload"|"image"|"toolCall"|"toolResponse"|"agentTransfer"|"updatedVariables"|"defaultVariables"|undefined} data - * @memberof google.cloud.ces.v1.Chunk - * @instance - */ - Object.defineProperty(Chunk.prototype, "data", { - get: $util.oneOfGetter($oneOfFields = ["text", "transcript", "payload", "image", "toolCall", "toolResponse", "agentTransfer", "updatedVariables", "defaultVariables"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Chunk instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Chunk - * @static - * @param {google.cloud.ces.v1.IChunk=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Chunk} Chunk instance - */ - Chunk.create = function create(properties) { - return new Chunk(properties); - }; - - /** - * Encodes the specified Chunk message. Does not implicitly {@link google.cloud.ces.v1.Chunk.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Chunk - * @static - * @param {google.cloud.ces.v1.IChunk} message Chunk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Chunk.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.toolCall != null && Object.hasOwnProperty.call(message, "toolCall")) - $root.google.cloud.ces.v1.ToolCall.encode(message.toolCall, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.toolResponse != null && Object.hasOwnProperty.call(message, "toolResponse")) - $root.google.cloud.ces.v1.ToolResponse.encode(message.toolResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.agentTransfer != null && Object.hasOwnProperty.call(message, "agentTransfer")) - $root.google.cloud.ces.v1.AgentTransfer.encode(message.agentTransfer, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - $root.google.cloud.ces.v1.Image.encode(message.image, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.updatedVariables != null && Object.hasOwnProperty.call(message, "updatedVariables")) - $root.google.protobuf.Struct.encode(message.updatedVariables, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.transcript); - if (message.defaultVariables != null && Object.hasOwnProperty.call(message, "defaultVariables")) - $root.google.protobuf.Struct.encode(message.defaultVariables, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Chunk.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Chunk - * @static - * @param {google.cloud.ces.v1.IChunk} message Chunk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Chunk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Chunk message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Chunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Chunk} Chunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Chunk.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Chunk(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.text = reader.string(); - break; - } - case 9: { - message.transcript = reader.string(); - break; - } - case 11: { - message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 5: { - message.image = $root.google.cloud.ces.v1.Image.decode(reader, reader.uint32()); - break; - } - case 2: { - message.toolCall = $root.google.cloud.ces.v1.ToolCall.decode(reader, reader.uint32()); - break; - } - case 3: { - message.toolResponse = $root.google.cloud.ces.v1.ToolResponse.decode(reader, reader.uint32()); - break; - } - case 4: { - message.agentTransfer = $root.google.cloud.ces.v1.AgentTransfer.decode(reader, reader.uint32()); - break; - } - case 8: { - message.updatedVariables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 10: { - message.defaultVariables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Chunk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Chunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Chunk} Chunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Chunk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Chunk message. - * @function verify - * @memberof google.cloud.ces.v1.Chunk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Chunk.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.text != null && message.hasOwnProperty("text")) { - properties.data = 1; - if (!$util.isString(message.text)) - return "text: string expected"; - } - if (message.transcript != null && message.hasOwnProperty("transcript")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - if (!$util.isString(message.transcript)) - return "transcript: string expected"; - } - if (message.payload != null && message.hasOwnProperty("payload")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.protobuf.Struct.verify(message.payload); - if (error) - return "payload." + error; - } - } - if (message.image != null && message.hasOwnProperty("image")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.cloud.ces.v1.Image.verify(message.image); - if (error) - return "image." + error; - } - } - if (message.toolCall != null && message.hasOwnProperty("toolCall")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.cloud.ces.v1.ToolCall.verify(message.toolCall); - if (error) - return "toolCall." + error; - } - } - if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.cloud.ces.v1.ToolResponse.verify(message.toolResponse); - if (error) - return "toolResponse." + error; - } - } - if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.cloud.ces.v1.AgentTransfer.verify(message.agentTransfer); - if (error) - return "agentTransfer." + error; - } - } - if (message.updatedVariables != null && message.hasOwnProperty("updatedVariables")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.protobuf.Struct.verify(message.updatedVariables); - if (error) - return "updatedVariables." + error; - } - } - if (message.defaultVariables != null && message.hasOwnProperty("defaultVariables")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.protobuf.Struct.verify(message.defaultVariables); - if (error) - return "defaultVariables." + error; - } - } - return null; - }; - - /** - * Creates a Chunk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Chunk - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Chunk} Chunk - */ - Chunk.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Chunk) - return object; - var message = new $root.google.cloud.ces.v1.Chunk(); - if (object.text != null) - message.text = String(object.text); - if (object.transcript != null) - message.transcript = String(object.transcript); - if (object.payload != null) { - if (typeof object.payload !== "object") - throw TypeError(".google.cloud.ces.v1.Chunk.payload: object expected"); - message.payload = $root.google.protobuf.Struct.fromObject(object.payload); - } - if (object.image != null) { - if (typeof object.image !== "object") - throw TypeError(".google.cloud.ces.v1.Chunk.image: object expected"); - message.image = $root.google.cloud.ces.v1.Image.fromObject(object.image); - } - if (object.toolCall != null) { - if (typeof object.toolCall !== "object") - throw TypeError(".google.cloud.ces.v1.Chunk.toolCall: object expected"); - message.toolCall = $root.google.cloud.ces.v1.ToolCall.fromObject(object.toolCall); - } - if (object.toolResponse != null) { - if (typeof object.toolResponse !== "object") - throw TypeError(".google.cloud.ces.v1.Chunk.toolResponse: object expected"); - message.toolResponse = $root.google.cloud.ces.v1.ToolResponse.fromObject(object.toolResponse); - } - if (object.agentTransfer != null) { - if (typeof object.agentTransfer !== "object") - throw TypeError(".google.cloud.ces.v1.Chunk.agentTransfer: object expected"); - message.agentTransfer = $root.google.cloud.ces.v1.AgentTransfer.fromObject(object.agentTransfer); - } - if (object.updatedVariables != null) { - if (typeof object.updatedVariables !== "object") - throw TypeError(".google.cloud.ces.v1.Chunk.updatedVariables: object expected"); - message.updatedVariables = $root.google.protobuf.Struct.fromObject(object.updatedVariables); - } - if (object.defaultVariables != null) { - if (typeof object.defaultVariables !== "object") - throw TypeError(".google.cloud.ces.v1.Chunk.defaultVariables: object expected"); - message.defaultVariables = $root.google.protobuf.Struct.fromObject(object.defaultVariables); - } - return message; - }; - - /** - * Creates a plain object from a Chunk message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Chunk - * @static - * @param {google.cloud.ces.v1.Chunk} message Chunk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Chunk.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.text != null && message.hasOwnProperty("text")) { - object.text = message.text; - if (options.oneofs) - object.data = "text"; - } - if (message.toolCall != null && message.hasOwnProperty("toolCall")) { - object.toolCall = $root.google.cloud.ces.v1.ToolCall.toObject(message.toolCall, options); - if (options.oneofs) - object.data = "toolCall"; - } - if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { - object.toolResponse = $root.google.cloud.ces.v1.ToolResponse.toObject(message.toolResponse, options); - if (options.oneofs) - object.data = "toolResponse"; - } - if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { - object.agentTransfer = $root.google.cloud.ces.v1.AgentTransfer.toObject(message.agentTransfer, options); - if (options.oneofs) - object.data = "agentTransfer"; - } - if (message.image != null && message.hasOwnProperty("image")) { - object.image = $root.google.cloud.ces.v1.Image.toObject(message.image, options); - if (options.oneofs) - object.data = "image"; - } - if (message.updatedVariables != null && message.hasOwnProperty("updatedVariables")) { - object.updatedVariables = $root.google.protobuf.Struct.toObject(message.updatedVariables, options); - if (options.oneofs) - object.data = "updatedVariables"; - } - if (message.transcript != null && message.hasOwnProperty("transcript")) { - object.transcript = message.transcript; - if (options.oneofs) - object.data = "transcript"; - } - if (message.defaultVariables != null && message.hasOwnProperty("defaultVariables")) { - object.defaultVariables = $root.google.protobuf.Struct.toObject(message.defaultVariables, options); - if (options.oneofs) - object.data = "defaultVariables"; - } - if (message.payload != null && message.hasOwnProperty("payload")) { - object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); - if (options.oneofs) - object.data = "payload"; - } - return object; - }; - - /** - * Converts this Chunk to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Chunk - * @instance - * @returns {Object.} JSON object - */ - Chunk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Chunk - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Chunk - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Chunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Chunk"; - }; - - return Chunk; - })(); - - v1.Blob = (function() { - - /** - * Properties of a Blob. - * @memberof google.cloud.ces.v1 - * @interface IBlob - * @property {string|null} [mimeType] Blob mimeType - * @property {Uint8Array|null} [data] Blob data - */ - - /** - * Constructs a new Blob. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a Blob. - * @implements IBlob - * @constructor - * @param {google.cloud.ces.v1.IBlob=} [properties] Properties to set - */ - function Blob(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Blob mimeType. - * @member {string} mimeType - * @memberof google.cloud.ces.v1.Blob - * @instance - */ - Blob.prototype.mimeType = ""; - - /** - * Blob data. - * @member {Uint8Array} data - * @memberof google.cloud.ces.v1.Blob - * @instance - */ - Blob.prototype.data = $util.newBuffer([]); - - /** - * Creates a new Blob instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Blob - * @static - * @param {google.cloud.ces.v1.IBlob=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Blob} Blob instance - */ - Blob.create = function create(properties) { - return new Blob(properties); - }; - - /** - * Encodes the specified Blob message. Does not implicitly {@link google.cloud.ces.v1.Blob.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Blob - * @static - * @param {google.cloud.ces.v1.IBlob} message Blob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Blob.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); - return writer; - }; - - /** - * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Blob.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Blob - * @static - * @param {google.cloud.ces.v1.IBlob} message Blob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Blob.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Blob message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Blob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Blob} Blob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Blob.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Blob(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mimeType = reader.string(); - break; - } - case 2: { - message.data = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Blob message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Blob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Blob} Blob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Blob.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Blob message. - * @function verify - * @memberof google.cloud.ces.v1.Blob - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Blob.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; - - /** - * Creates a Blob message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Blob - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Blob} Blob - */ - Blob.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Blob) - return object; - var message = new $root.google.cloud.ces.v1.Blob(); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length >= 0) - message.data = object.data; - return message; - }; - - /** - * Creates a plain object from a Blob message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Blob - * @static - * @param {google.cloud.ces.v1.Blob} message Blob - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Blob.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.mimeType = ""; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - } - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; - - /** - * Converts this Blob to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Blob - * @instance - * @returns {Object.} JSON object - */ - Blob.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Blob - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Blob - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Blob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Blob"; - }; - - return Blob; - })(); - - v1.Image = (function() { - - /** - * Properties of an Image. - * @memberof google.cloud.ces.v1 - * @interface IImage - * @property {string|null} [mimeType] Image mimeType - * @property {Uint8Array|null} [data] Image data - */ - - /** - * Constructs a new Image. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an Image. - * @implements IImage - * @constructor - * @param {google.cloud.ces.v1.IImage=} [properties] Properties to set - */ - function Image(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Image mimeType. - * @member {string} mimeType - * @memberof google.cloud.ces.v1.Image - * @instance - */ - Image.prototype.mimeType = ""; - - /** - * Image data. - * @member {Uint8Array} data - * @memberof google.cloud.ces.v1.Image - * @instance - */ - Image.prototype.data = $util.newBuffer([]); - - /** - * Creates a new Image instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Image - * @static - * @param {google.cloud.ces.v1.IImage=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Image} Image instance - */ - Image.create = function create(properties) { - return new Image(properties); - }; - - /** - * Encodes the specified Image message. Does not implicitly {@link google.cloud.ces.v1.Image.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Image - * @static - * @param {google.cloud.ces.v1.IImage} message Image message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Image.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); - return writer; - }; - - /** - * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Image.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Image - * @static - * @param {google.cloud.ces.v1.IImage} message Image message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Image.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Image message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Image - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Image} Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Image.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Image(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mimeType = reader.string(); - break; - } - case 2: { - message.data = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Image message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Image - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Image} Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Image.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Image message. - * @function verify - * @memberof google.cloud.ces.v1.Image - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Image.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; - - /** - * Creates an Image message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Image - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Image} Image - */ - Image.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Image) - return object; - var message = new $root.google.cloud.ces.v1.Image(); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length >= 0) - message.data = object.data; - return message; - }; - - /** - * Creates a plain object from an Image message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Image - * @static - * @param {google.cloud.ces.v1.Image} message Image - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Image.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.mimeType = ""; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - } - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; - - /** - * Converts this Image to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Image - * @instance - * @returns {Object.} JSON object - */ - Image.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Image - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Image - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Image.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Image"; - }; - - return Image; - })(); - - v1.ToolCall = (function() { - - /** - * Properties of a ToolCall. - * @memberof google.cloud.ces.v1 - * @interface IToolCall - * @property {string|null} [tool] ToolCall tool - * @property {google.cloud.ces.v1.IToolsetTool|null} [toolsetTool] ToolCall toolsetTool - * @property {string|null} [id] ToolCall id - * @property {string|null} [displayName] ToolCall displayName - * @property {google.protobuf.IStruct|null} [args] ToolCall args - */ - - /** - * Constructs a new ToolCall. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ToolCall. - * @implements IToolCall - * @constructor - * @param {google.cloud.ces.v1.IToolCall=} [properties] Properties to set - */ - function ToolCall(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolCall tool. - * @member {string|null|undefined} tool - * @memberof google.cloud.ces.v1.ToolCall - * @instance - */ - ToolCall.prototype.tool = null; - - /** - * ToolCall toolsetTool. - * @member {google.cloud.ces.v1.IToolsetTool|null|undefined} toolsetTool - * @memberof google.cloud.ces.v1.ToolCall - * @instance - */ - ToolCall.prototype.toolsetTool = null; - - /** - * ToolCall id. - * @member {string} id - * @memberof google.cloud.ces.v1.ToolCall - * @instance - */ - ToolCall.prototype.id = ""; - - /** - * ToolCall displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1.ToolCall - * @instance - */ - ToolCall.prototype.displayName = ""; - - /** - * ToolCall args. - * @member {google.protobuf.IStruct|null|undefined} args - * @memberof google.cloud.ces.v1.ToolCall - * @instance - */ - ToolCall.prototype.args = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ToolCall toolIdentifier. - * @member {"tool"|"toolsetTool"|undefined} toolIdentifier - * @memberof google.cloud.ces.v1.ToolCall - * @instance - */ - Object.defineProperty(ToolCall.prototype, "toolIdentifier", { - get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ToolCall instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ToolCall - * @static - * @param {google.cloud.ces.v1.IToolCall=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ToolCall} ToolCall instance - */ - ToolCall.create = function create(properties) { - return new ToolCall(properties); - }; - - /** - * Encodes the specified ToolCall message. Does not implicitly {@link google.cloud.ces.v1.ToolCall.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ToolCall - * @static - * @param {google.cloud.ces.v1.IToolCall} message ToolCall message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolCall.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.tool); - if (message.args != null && Object.hasOwnProperty.call(message, "args")) - $root.google.protobuf.Struct.encode(message.args, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); - if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) - $root.google.cloud.ces.v1.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ToolCall message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolCall.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ToolCall - * @static - * @param {google.cloud.ces.v1.IToolCall} message ToolCall message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolCall.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolCall message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ToolCall - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ToolCall} ToolCall - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolCall.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ToolCall(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.tool = reader.string(); - break; - } - case 5: { - message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.decode(reader, reader.uint32()); - break; - } - case 1: { - message.id = reader.string(); - break; - } - case 4: { - message.displayName = reader.string(); - break; - } - case 3: { - message.args = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolCall message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ToolCall - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ToolCall} ToolCall - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolCall.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolCall message. - * @function verify - * @memberof google.cloud.ces.v1.ToolCall - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolCall.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tool != null && message.hasOwnProperty("tool")) { - properties.toolIdentifier = 1; - if (!$util.isString(message.tool)) - return "tool: string expected"; - } - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - if (properties.toolIdentifier === 1) - return "toolIdentifier: multiple values"; - properties.toolIdentifier = 1; - { - var error = $root.google.cloud.ces.v1.ToolsetTool.verify(message.toolsetTool); - if (error) - return "toolsetTool." + error; - } - } - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.args != null && message.hasOwnProperty("args")) { - var error = $root.google.protobuf.Struct.verify(message.args); - if (error) - return "args." + error; - } - return null; - }; - - /** - * Creates a ToolCall message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ToolCall - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ToolCall} ToolCall - */ - ToolCall.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ToolCall) - return object; - var message = new $root.google.cloud.ces.v1.ToolCall(); - if (object.tool != null) - message.tool = String(object.tool); - if (object.toolsetTool != null) { - if (typeof object.toolsetTool !== "object") - throw TypeError(".google.cloud.ces.v1.ToolCall.toolsetTool: object expected"); - message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.fromObject(object.toolsetTool); - } - if (object.id != null) - message.id = String(object.id); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.args != null) { - if (typeof object.args !== "object") - throw TypeError(".google.cloud.ces.v1.ToolCall.args: object expected"); - message.args = $root.google.protobuf.Struct.fromObject(object.args); - } - return message; - }; - - /** - * Creates a plain object from a ToolCall message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ToolCall - * @static - * @param {google.cloud.ces.v1.ToolCall} message ToolCall - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolCall.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.args = null; - object.displayName = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.tool != null && message.hasOwnProperty("tool")) { - object.tool = message.tool; - if (options.oneofs) - object.toolIdentifier = "tool"; - } - if (message.args != null && message.hasOwnProperty("args")) - object.args = $root.google.protobuf.Struct.toObject(message.args, options); - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - object.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.toObject(message.toolsetTool, options); - if (options.oneofs) - object.toolIdentifier = "toolsetTool"; - } - return object; - }; - - /** - * Converts this ToolCall to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ToolCall - * @instance - * @returns {Object.} JSON object - */ - ToolCall.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolCall - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ToolCall - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ToolCall"; - }; - - return ToolCall; - })(); - - v1.ToolResponse = (function() { - - /** - * Properties of a ToolResponse. - * @memberof google.cloud.ces.v1 - * @interface IToolResponse - * @property {string|null} [tool] ToolResponse tool - * @property {google.cloud.ces.v1.IToolsetTool|null} [toolsetTool] ToolResponse toolsetTool - * @property {string|null} [id] ToolResponse id - * @property {string|null} [displayName] ToolResponse displayName - * @property {google.protobuf.IStruct|null} [response] ToolResponse response - */ - - /** - * Constructs a new ToolResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ToolResponse. - * @implements IToolResponse - * @constructor - * @param {google.cloud.ces.v1.IToolResponse=} [properties] Properties to set - */ - function ToolResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolResponse tool. - * @member {string|null|undefined} tool - * @memberof google.cloud.ces.v1.ToolResponse - * @instance - */ - ToolResponse.prototype.tool = null; - - /** - * ToolResponse toolsetTool. - * @member {google.cloud.ces.v1.IToolsetTool|null|undefined} toolsetTool - * @memberof google.cloud.ces.v1.ToolResponse - * @instance - */ - ToolResponse.prototype.toolsetTool = null; - - /** - * ToolResponse id. - * @member {string} id - * @memberof google.cloud.ces.v1.ToolResponse - * @instance - */ - ToolResponse.prototype.id = ""; - - /** - * ToolResponse displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1.ToolResponse - * @instance - */ - ToolResponse.prototype.displayName = ""; - - /** - * ToolResponse response. - * @member {google.protobuf.IStruct|null|undefined} response - * @memberof google.cloud.ces.v1.ToolResponse - * @instance - */ - ToolResponse.prototype.response = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ToolResponse toolIdentifier. - * @member {"tool"|"toolsetTool"|undefined} toolIdentifier - * @memberof google.cloud.ces.v1.ToolResponse - * @instance - */ - Object.defineProperty(ToolResponse.prototype, "toolIdentifier", { - get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ToolResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ToolResponse - * @static - * @param {google.cloud.ces.v1.IToolResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ToolResponse} ToolResponse instance - */ - ToolResponse.create = function create(properties) { - return new ToolResponse(properties); - }; - - /** - * Encodes the specified ToolResponse message. Does not implicitly {@link google.cloud.ces.v1.ToolResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ToolResponse - * @static - * @param {google.cloud.ces.v1.IToolResponse} message ToolResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.tool); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Struct.encode(message.response, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); - if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) - $root.google.cloud.ces.v1.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ToolResponse - * @static - * @param {google.cloud.ces.v1.IToolResponse} message ToolResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ToolResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ToolResponse} ToolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ToolResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.tool = reader.string(); - break; - } - case 5: { - message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.decode(reader, reader.uint32()); - break; - } - case 1: { - message.id = reader.string(); - break; - } - case 4: { - message.displayName = reader.string(); - break; - } - case 3: { - message.response = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ToolResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ToolResponse} ToolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolResponse message. - * @function verify - * @memberof google.cloud.ces.v1.ToolResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tool != null && message.hasOwnProperty("tool")) { - properties.toolIdentifier = 1; - if (!$util.isString(message.tool)) - return "tool: string expected"; - } - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - if (properties.toolIdentifier === 1) - return "toolIdentifier: multiple values"; - properties.toolIdentifier = 1; - { - var error = $root.google.cloud.ces.v1.ToolsetTool.verify(message.toolsetTool); - if (error) - return "toolsetTool." + error; - } - } - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.response != null && message.hasOwnProperty("response")) { - var error = $root.google.protobuf.Struct.verify(message.response); - if (error) - return "response." + error; - } - return null; - }; - - /** - * Creates a ToolResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ToolResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ToolResponse} ToolResponse - */ - ToolResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ToolResponse) - return object; - var message = new $root.google.cloud.ces.v1.ToolResponse(); - if (object.tool != null) - message.tool = String(object.tool); - if (object.toolsetTool != null) { - if (typeof object.toolsetTool !== "object") - throw TypeError(".google.cloud.ces.v1.ToolResponse.toolsetTool: object expected"); - message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.fromObject(object.toolsetTool); - } - if (object.id != null) - message.id = String(object.id); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.cloud.ces.v1.ToolResponse.response: object expected"); - message.response = $root.google.protobuf.Struct.fromObject(object.response); - } - return message; - }; - - /** - * Creates a plain object from a ToolResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ToolResponse - * @static - * @param {google.cloud.ces.v1.ToolResponse} message ToolResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.response = null; - object.displayName = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.tool != null && message.hasOwnProperty("tool")) { - object.tool = message.tool; - if (options.oneofs) - object.toolIdentifier = "tool"; - } - if (message.response != null && message.hasOwnProperty("response")) - object.response = $root.google.protobuf.Struct.toObject(message.response, options); - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - object.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.toObject(message.toolsetTool, options); - if (options.oneofs) - object.toolIdentifier = "toolsetTool"; - } - return object; - }; - - /** - * Converts this ToolResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ToolResponse - * @instance - * @returns {Object.} JSON object - */ - ToolResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ToolResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ToolResponse"; - }; - - return ToolResponse; - })(); - - v1.AgentTransfer = (function() { - - /** - * Properties of an AgentTransfer. - * @memberof google.cloud.ces.v1 - * @interface IAgentTransfer - * @property {string|null} [targetAgent] AgentTransfer targetAgent - * @property {string|null} [displayName] AgentTransfer displayName - */ - - /** - * Constructs a new AgentTransfer. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an AgentTransfer. - * @implements IAgentTransfer - * @constructor - * @param {google.cloud.ces.v1.IAgentTransfer=} [properties] Properties to set - */ - function AgentTransfer(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AgentTransfer targetAgent. - * @member {string} targetAgent - * @memberof google.cloud.ces.v1.AgentTransfer - * @instance - */ - AgentTransfer.prototype.targetAgent = ""; - - /** - * AgentTransfer displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1.AgentTransfer - * @instance - */ - AgentTransfer.prototype.displayName = ""; - - /** - * Creates a new AgentTransfer instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.AgentTransfer - * @static - * @param {google.cloud.ces.v1.IAgentTransfer=} [properties] Properties to set - * @returns {google.cloud.ces.v1.AgentTransfer} AgentTransfer instance - */ - AgentTransfer.create = function create(properties) { - return new AgentTransfer(properties); - }; - - /** - * Encodes the specified AgentTransfer message. Does not implicitly {@link google.cloud.ces.v1.AgentTransfer.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.AgentTransfer - * @static - * @param {google.cloud.ces.v1.IAgentTransfer} message AgentTransfer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AgentTransfer.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.targetAgent != null && Object.hasOwnProperty.call(message, "targetAgent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetAgent); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified AgentTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1.AgentTransfer.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.AgentTransfer - * @static - * @param {google.cloud.ces.v1.IAgentTransfer} message AgentTransfer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AgentTransfer.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AgentTransfer message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.AgentTransfer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.AgentTransfer} AgentTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AgentTransfer.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.AgentTransfer(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.targetAgent = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AgentTransfer message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.AgentTransfer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.AgentTransfer} AgentTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AgentTransfer.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AgentTransfer message. - * @function verify - * @memberof google.cloud.ces.v1.AgentTransfer - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AgentTransfer.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.targetAgent != null && message.hasOwnProperty("targetAgent")) - if (!$util.isString(message.targetAgent)) - return "targetAgent: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; - - /** - * Creates an AgentTransfer message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.AgentTransfer - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.AgentTransfer} AgentTransfer - */ - AgentTransfer.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.AgentTransfer) - return object; - var message = new $root.google.cloud.ces.v1.AgentTransfer(); - if (object.targetAgent != null) - message.targetAgent = String(object.targetAgent); - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from an AgentTransfer message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.AgentTransfer - * @static - * @param {google.cloud.ces.v1.AgentTransfer} message AgentTransfer - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AgentTransfer.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.targetAgent = ""; - object.displayName = ""; - } - if (message.targetAgent != null && message.hasOwnProperty("targetAgent")) - object.targetAgent = message.targetAgent; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this AgentTransfer to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.AgentTransfer - * @instance - * @returns {Object.} JSON object - */ - AgentTransfer.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AgentTransfer - * @function getTypeUrl - * @memberof google.cloud.ces.v1.AgentTransfer - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AgentTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.AgentTransfer"; - }; - - return AgentTransfer; - })(); - - v1.ToolsetTool = (function() { - - /** - * Properties of a ToolsetTool. - * @memberof google.cloud.ces.v1 - * @interface IToolsetTool - * @property {string|null} [toolset] ToolsetTool toolset - * @property {string|null} [toolId] ToolsetTool toolId - */ - - /** - * Constructs a new ToolsetTool. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ToolsetTool. - * @implements IToolsetTool - * @constructor - * @param {google.cloud.ces.v1.IToolsetTool=} [properties] Properties to set - */ - function ToolsetTool(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolsetTool toolset. - * @member {string} toolset - * @memberof google.cloud.ces.v1.ToolsetTool - * @instance - */ - ToolsetTool.prototype.toolset = ""; - - /** - * ToolsetTool toolId. - * @member {string} toolId - * @memberof google.cloud.ces.v1.ToolsetTool - * @instance - */ - ToolsetTool.prototype.toolId = ""; - - /** - * Creates a new ToolsetTool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ToolsetTool - * @static - * @param {google.cloud.ces.v1.IToolsetTool=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ToolsetTool} ToolsetTool instance - */ - ToolsetTool.create = function create(properties) { - return new ToolsetTool(properties); - }; - - /** - * Encodes the specified ToolsetTool message. Does not implicitly {@link google.cloud.ces.v1.ToolsetTool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ToolsetTool - * @static - * @param {google.cloud.ces.v1.IToolsetTool} message ToolsetTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolsetTool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.toolset); - if (message.toolId != null && Object.hasOwnProperty.call(message, "toolId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.toolId); - return writer; - }; - - /** - * Encodes the specified ToolsetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolsetTool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ToolsetTool - * @static - * @param {google.cloud.ces.v1.IToolsetTool} message ToolsetTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolsetTool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolsetTool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ToolsetTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ToolsetTool} ToolsetTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolsetTool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ToolsetTool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.toolset = reader.string(); - break; - } - case 3: { - message.toolId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolsetTool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ToolsetTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ToolsetTool} ToolsetTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolsetTool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolsetTool message. - * @function verify - * @memberof google.cloud.ces.v1.ToolsetTool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolsetTool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.toolset != null && message.hasOwnProperty("toolset")) - if (!$util.isString(message.toolset)) - return "toolset: string expected"; - if (message.toolId != null && message.hasOwnProperty("toolId")) - if (!$util.isString(message.toolId)) - return "toolId: string expected"; - return null; - }; - - /** - * Creates a ToolsetTool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ToolsetTool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ToolsetTool} ToolsetTool - */ - ToolsetTool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ToolsetTool) - return object; - var message = new $root.google.cloud.ces.v1.ToolsetTool(); - if (object.toolset != null) - message.toolset = String(object.toolset); - if (object.toolId != null) - message.toolId = String(object.toolId); - return message; - }; - - /** - * Creates a plain object from a ToolsetTool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ToolsetTool - * @static - * @param {google.cloud.ces.v1.ToolsetTool} message ToolsetTool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolsetTool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.toolset = ""; - object.toolId = ""; - } - if (message.toolset != null && message.hasOwnProperty("toolset")) - object.toolset = message.toolset; - if (message.toolId != null && message.hasOwnProperty("toolId")) - object.toolId = message.toolId; - return object; - }; - - /** - * Converts this ToolsetTool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ToolsetTool - * @instance - * @returns {Object.} JSON object - */ - ToolsetTool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolsetTool - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ToolsetTool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolsetTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ToolsetTool"; - }; - - return ToolsetTool; - })(); - - v1.Guardrail = (function() { - - /** - * Properties of a Guardrail. - * @memberof google.cloud.ces.v1 - * @interface IGuardrail - * @property {google.cloud.ces.v1.Guardrail.IContentFilter|null} [contentFilter] Guardrail contentFilter - * @property {google.cloud.ces.v1.Guardrail.ILlmPromptSecurity|null} [llmPromptSecurity] Guardrail llmPromptSecurity - * @property {google.cloud.ces.v1.Guardrail.ILlmPolicy|null} [llmPolicy] Guardrail llmPolicy - * @property {google.cloud.ces.v1.Guardrail.IModelSafety|null} [modelSafety] Guardrail modelSafety - * @property {google.cloud.ces.v1.Guardrail.ICodeCallback|null} [codeCallback] Guardrail codeCallback - * @property {string|null} [name] Guardrail name - * @property {string|null} [displayName] Guardrail displayName - * @property {string|null} [description] Guardrail description - * @property {boolean|null} [enabled] Guardrail enabled - * @property {google.cloud.ces.v1.ITriggerAction|null} [action] Guardrail action - * @property {google.protobuf.ITimestamp|null} [createTime] Guardrail createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Guardrail updateTime - * @property {string|null} [etag] Guardrail etag - */ - - /** - * Constructs a new Guardrail. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a Guardrail. - * @implements IGuardrail - * @constructor - * @param {google.cloud.ces.v1.IGuardrail=} [properties] Properties to set - */ - function Guardrail(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Guardrail contentFilter. - * @member {google.cloud.ces.v1.Guardrail.IContentFilter|null|undefined} contentFilter - * @memberof google.cloud.ces.v1.Guardrail - * @instance - */ - Guardrail.prototype.contentFilter = null; - - /** - * Guardrail llmPromptSecurity. - * @member {google.cloud.ces.v1.Guardrail.ILlmPromptSecurity|null|undefined} llmPromptSecurity - * @memberof google.cloud.ces.v1.Guardrail - * @instance - */ - Guardrail.prototype.llmPromptSecurity = null; - - /** - * Guardrail llmPolicy. - * @member {google.cloud.ces.v1.Guardrail.ILlmPolicy|null|undefined} llmPolicy - * @memberof google.cloud.ces.v1.Guardrail - * @instance - */ - Guardrail.prototype.llmPolicy = null; - - /** - * Guardrail modelSafety. - * @member {google.cloud.ces.v1.Guardrail.IModelSafety|null|undefined} modelSafety - * @memberof google.cloud.ces.v1.Guardrail - * @instance - */ - Guardrail.prototype.modelSafety = null; - - /** - * Guardrail codeCallback. - * @member {google.cloud.ces.v1.Guardrail.ICodeCallback|null|undefined} codeCallback - * @memberof google.cloud.ces.v1.Guardrail - * @instance - */ - Guardrail.prototype.codeCallback = null; - - /** - * Guardrail name. - * @member {string} name - * @memberof google.cloud.ces.v1.Guardrail - * @instance - */ - Guardrail.prototype.name = ""; - - /** - * Guardrail displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1.Guardrail - * @instance - */ - Guardrail.prototype.displayName = ""; - - /** - * Guardrail description. - * @member {string} description - * @memberof google.cloud.ces.v1.Guardrail - * @instance - */ - Guardrail.prototype.description = ""; - - /** - * Guardrail enabled. - * @member {boolean} enabled - * @memberof google.cloud.ces.v1.Guardrail - * @instance - */ - Guardrail.prototype.enabled = false; - - /** - * Guardrail action. - * @member {google.cloud.ces.v1.ITriggerAction|null|undefined} action - * @memberof google.cloud.ces.v1.Guardrail - * @instance - */ - Guardrail.prototype.action = null; - - /** - * Guardrail createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1.Guardrail - * @instance - */ - Guardrail.prototype.createTime = null; - - /** - * Guardrail updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1.Guardrail - * @instance - */ - Guardrail.prototype.updateTime = null; - - /** - * Guardrail etag. - * @member {string} etag - * @memberof google.cloud.ces.v1.Guardrail - * @instance - */ - Guardrail.prototype.etag = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Guardrail guardrailType. - * @member {"contentFilter"|"llmPromptSecurity"|"llmPolicy"|"modelSafety"|"codeCallback"|undefined} guardrailType - * @memberof google.cloud.ces.v1.Guardrail - * @instance - */ - Object.defineProperty(Guardrail.prototype, "guardrailType", { - get: $util.oneOfGetter($oneOfFields = ["contentFilter", "llmPromptSecurity", "llmPolicy", "modelSafety", "codeCallback"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Guardrail instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Guardrail - * @static - * @param {google.cloud.ces.v1.IGuardrail=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Guardrail} Guardrail instance - */ - Guardrail.create = function create(properties) { - return new Guardrail(properties); - }; - - /** - * Encodes the specified Guardrail message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Guardrail - * @static - * @param {google.cloud.ces.v1.IGuardrail} message Guardrail message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Guardrail.encode = function encode(message, writer) { - if (!writer) - 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.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enabled); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - $root.google.cloud.ces.v1.TriggerAction.encode(message.action, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.contentFilter != null && Object.hasOwnProperty.call(message, "contentFilter")) - $root.google.cloud.ces.v1.Guardrail.ContentFilter.encode(message.contentFilter, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.llmPromptSecurity != null && Object.hasOwnProperty.call(message, "llmPromptSecurity")) - $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.encode(message.llmPromptSecurity, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.llmPolicy != null && Object.hasOwnProperty.call(message, "llmPolicy")) - $root.google.cloud.ces.v1.Guardrail.LlmPolicy.encode(message.llmPolicy, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); - if (message.modelSafety != null && Object.hasOwnProperty.call(message, "modelSafety")) - $root.google.cloud.ces.v1.Guardrail.ModelSafety.encode(message.modelSafety, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.codeCallback != null && Object.hasOwnProperty.call(message, "codeCallback")) - $root.google.cloud.ces.v1.Guardrail.CodeCallback.encode(message.codeCallback, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Guardrail message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Guardrail - * @static - * @param {google.cloud.ces.v1.IGuardrail} message Guardrail message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Guardrail.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Guardrail message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Guardrail - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Guardrail} Guardrail - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Guardrail.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Guardrail(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 8: { - message.contentFilter = $root.google.cloud.ces.v1.Guardrail.ContentFilter.decode(reader, reader.uint32()); - break; - } - case 9: { - message.llmPromptSecurity = $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.decode(reader, reader.uint32()); - break; - } - case 10: { - message.llmPolicy = $root.google.cloud.ces.v1.Guardrail.LlmPolicy.decode(reader, reader.uint32()); - break; - } - case 13: { - message.modelSafety = $root.google.cloud.ces.v1.Guardrail.ModelSafety.decode(reader, reader.uint32()); - break; - } - case 14: { - message.codeCallback = $root.google.cloud.ces.v1.Guardrail.CodeCallback.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.enabled = reader.bool(); - break; - } - case 5: { - message.action = $root.google.cloud.ces.v1.TriggerAction.decode(reader, reader.uint32()); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Guardrail message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Guardrail - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Guardrail} Guardrail - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Guardrail.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Guardrail message. - * @function verify - * @memberof google.cloud.ces.v1.Guardrail - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Guardrail.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.contentFilter != null && message.hasOwnProperty("contentFilter")) { - properties.guardrailType = 1; - { - var error = $root.google.cloud.ces.v1.Guardrail.ContentFilter.verify(message.contentFilter); - if (error) - return "contentFilter." + error; - } - } - if (message.llmPromptSecurity != null && message.hasOwnProperty("llmPromptSecurity")) { - if (properties.guardrailType === 1) - return "guardrailType: multiple values"; - properties.guardrailType = 1; - { - var error = $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.verify(message.llmPromptSecurity); - if (error) - return "llmPromptSecurity." + error; - } - } - if (message.llmPolicy != null && message.hasOwnProperty("llmPolicy")) { - if (properties.guardrailType === 1) - return "guardrailType: multiple values"; - properties.guardrailType = 1; - { - var error = $root.google.cloud.ces.v1.Guardrail.LlmPolicy.verify(message.llmPolicy); - if (error) - return "llmPolicy." + error; - } - } - if (message.modelSafety != null && message.hasOwnProperty("modelSafety")) { - if (properties.guardrailType === 1) - return "guardrailType: multiple values"; - properties.guardrailType = 1; - { - var error = $root.google.cloud.ces.v1.Guardrail.ModelSafety.verify(message.modelSafety); - if (error) - return "modelSafety." + error; - } - } - if (message.codeCallback != null && message.hasOwnProperty("codeCallback")) { - if (properties.guardrailType === 1) - return "guardrailType: multiple values"; - properties.guardrailType = 1; - { - var error = $root.google.cloud.ces.v1.Guardrail.CodeCallback.verify(message.codeCallback); - if (error) - return "codeCallback." + 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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.enabled != null && message.hasOwnProperty("enabled")) - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - if (message.action != null && message.hasOwnProperty("action")) { - var error = $root.google.cloud.ces.v1.TriggerAction.verify(message.action); - if (error) - return "action." + error; - } - 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.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a Guardrail message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Guardrail - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Guardrail} Guardrail - */ - Guardrail.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Guardrail) - return object; - var message = new $root.google.cloud.ces.v1.Guardrail(); - if (object.contentFilter != null) { - if (typeof object.contentFilter !== "object") - throw TypeError(".google.cloud.ces.v1.Guardrail.contentFilter: object expected"); - message.contentFilter = $root.google.cloud.ces.v1.Guardrail.ContentFilter.fromObject(object.contentFilter); - } - if (object.llmPromptSecurity != null) { - if (typeof object.llmPromptSecurity !== "object") - throw TypeError(".google.cloud.ces.v1.Guardrail.llmPromptSecurity: object expected"); - message.llmPromptSecurity = $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.fromObject(object.llmPromptSecurity); - } - if (object.llmPolicy != null) { - if (typeof object.llmPolicy !== "object") - throw TypeError(".google.cloud.ces.v1.Guardrail.llmPolicy: object expected"); - message.llmPolicy = $root.google.cloud.ces.v1.Guardrail.LlmPolicy.fromObject(object.llmPolicy); - } - if (object.modelSafety != null) { - if (typeof object.modelSafety !== "object") - throw TypeError(".google.cloud.ces.v1.Guardrail.modelSafety: object expected"); - message.modelSafety = $root.google.cloud.ces.v1.Guardrail.ModelSafety.fromObject(object.modelSafety); - } - if (object.codeCallback != null) { - if (typeof object.codeCallback !== "object") - throw TypeError(".google.cloud.ces.v1.Guardrail.codeCallback: object expected"); - message.codeCallback = $root.google.cloud.ces.v1.Guardrail.CodeCallback.fromObject(object.codeCallback); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.action != null) { - if (typeof object.action !== "object") - throw TypeError(".google.cloud.ces.v1.Guardrail.action: object expected"); - message.action = $root.google.cloud.ces.v1.TriggerAction.fromObject(object.action); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1.Guardrail.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.ces.v1.Guardrail.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a Guardrail message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Guardrail - * @static - * @param {google.cloud.ces.v1.Guardrail} message Guardrail - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Guardrail.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.enabled = false; - object.action = null; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.enabled != null && message.hasOwnProperty("enabled")) - object.enabled = message.enabled; - if (message.action != null && message.hasOwnProperty("action")) - object.action = $root.google.cloud.ces.v1.TriggerAction.toObject(message.action, options); - 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.contentFilter != null && message.hasOwnProperty("contentFilter")) { - object.contentFilter = $root.google.cloud.ces.v1.Guardrail.ContentFilter.toObject(message.contentFilter, options); - if (options.oneofs) - object.guardrailType = "contentFilter"; - } - if (message.llmPromptSecurity != null && message.hasOwnProperty("llmPromptSecurity")) { - object.llmPromptSecurity = $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.toObject(message.llmPromptSecurity, options); - if (options.oneofs) - object.guardrailType = "llmPromptSecurity"; - } - if (message.llmPolicy != null && message.hasOwnProperty("llmPolicy")) { - object.llmPolicy = $root.google.cloud.ces.v1.Guardrail.LlmPolicy.toObject(message.llmPolicy, options); - if (options.oneofs) - object.guardrailType = "llmPolicy"; - } - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.modelSafety != null && message.hasOwnProperty("modelSafety")) { - object.modelSafety = $root.google.cloud.ces.v1.Guardrail.ModelSafety.toObject(message.modelSafety, options); - if (options.oneofs) - object.guardrailType = "modelSafety"; - } - if (message.codeCallback != null && message.hasOwnProperty("codeCallback")) { - object.codeCallback = $root.google.cloud.ces.v1.Guardrail.CodeCallback.toObject(message.codeCallback, options); - if (options.oneofs) - object.guardrailType = "codeCallback"; - } - return object; - }; - - /** - * Converts this Guardrail to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Guardrail - * @instance - * @returns {Object.} JSON object - */ - Guardrail.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Guardrail - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Guardrail - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Guardrail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Guardrail"; - }; - - Guardrail.ContentFilter = (function() { - - /** - * Properties of a ContentFilter. - * @memberof google.cloud.ces.v1.Guardrail - * @interface IContentFilter - * @property {Array.|null} [bannedContents] ContentFilter bannedContents - * @property {Array.|null} [bannedContentsInUserInput] ContentFilter bannedContentsInUserInput - * @property {Array.|null} [bannedContentsInAgentResponse] ContentFilter bannedContentsInAgentResponse - * @property {google.cloud.ces.v1.Guardrail.ContentFilter.MatchType|null} [matchType] ContentFilter matchType - * @property {boolean|null} [disregardDiacritics] ContentFilter disregardDiacritics - */ - - /** - * Constructs a new ContentFilter. - * @memberof google.cloud.ces.v1.Guardrail - * @classdesc Represents a ContentFilter. - * @implements IContentFilter - * @constructor - * @param {google.cloud.ces.v1.Guardrail.IContentFilter=} [properties] Properties to set - */ - function ContentFilter(properties) { - this.bannedContents = []; - this.bannedContentsInUserInput = []; - this.bannedContentsInAgentResponse = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContentFilter bannedContents. - * @member {Array.} bannedContents - * @memberof google.cloud.ces.v1.Guardrail.ContentFilter - * @instance - */ - ContentFilter.prototype.bannedContents = $util.emptyArray; - - /** - * ContentFilter bannedContentsInUserInput. - * @member {Array.} bannedContentsInUserInput - * @memberof google.cloud.ces.v1.Guardrail.ContentFilter - * @instance - */ - ContentFilter.prototype.bannedContentsInUserInput = $util.emptyArray; - - /** - * ContentFilter bannedContentsInAgentResponse. - * @member {Array.} bannedContentsInAgentResponse - * @memberof google.cloud.ces.v1.Guardrail.ContentFilter - * @instance - */ - ContentFilter.prototype.bannedContentsInAgentResponse = $util.emptyArray; - - /** - * ContentFilter matchType. - * @member {google.cloud.ces.v1.Guardrail.ContentFilter.MatchType} matchType - * @memberof google.cloud.ces.v1.Guardrail.ContentFilter - * @instance - */ - ContentFilter.prototype.matchType = 0; - - /** - * ContentFilter disregardDiacritics. - * @member {boolean} disregardDiacritics - * @memberof google.cloud.ces.v1.Guardrail.ContentFilter - * @instance - */ - ContentFilter.prototype.disregardDiacritics = false; - - /** - * Creates a new ContentFilter instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Guardrail.ContentFilter - * @static - * @param {google.cloud.ces.v1.Guardrail.IContentFilter=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Guardrail.ContentFilter} ContentFilter instance - */ - ContentFilter.create = function create(properties) { - return new ContentFilter(properties); - }; - - /** - * Encodes the specified ContentFilter message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ContentFilter.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Guardrail.ContentFilter - * @static - * @param {google.cloud.ces.v1.Guardrail.IContentFilter} message ContentFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContentFilter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bannedContents != null && message.bannedContents.length) - for (var i = 0; i < message.bannedContents.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.bannedContents[i]); - if (message.bannedContentsInUserInput != null && message.bannedContentsInUserInput.length) - for (var i = 0; i < message.bannedContentsInUserInput.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.bannedContentsInUserInput[i]); - if (message.bannedContentsInAgentResponse != null && message.bannedContentsInAgentResponse.length) - for (var i = 0; i < message.bannedContentsInAgentResponse.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.bannedContentsInAgentResponse[i]); - if (message.matchType != null && Object.hasOwnProperty.call(message, "matchType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.matchType); - if (message.disregardDiacritics != null && Object.hasOwnProperty.call(message, "disregardDiacritics")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disregardDiacritics); - return writer; - }; - - /** - * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ContentFilter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Guardrail.ContentFilter - * @static - * @param {google.cloud.ces.v1.Guardrail.IContentFilter} message ContentFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContentFilter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContentFilter message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Guardrail.ContentFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Guardrail.ContentFilter} ContentFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContentFilter.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Guardrail.ContentFilter(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.bannedContents && message.bannedContents.length)) - message.bannedContents = []; - message.bannedContents.push(reader.string()); - break; - } - case 2: { - if (!(message.bannedContentsInUserInput && message.bannedContentsInUserInput.length)) - message.bannedContentsInUserInput = []; - message.bannedContentsInUserInput.push(reader.string()); - break; - } - case 3: { - if (!(message.bannedContentsInAgentResponse && message.bannedContentsInAgentResponse.length)) - message.bannedContentsInAgentResponse = []; - message.bannedContentsInAgentResponse.push(reader.string()); - break; - } - case 4: { - message.matchType = reader.int32(); - break; - } - case 5: { - message.disregardDiacritics = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContentFilter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Guardrail.ContentFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Guardrail.ContentFilter} ContentFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContentFilter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContentFilter message. - * @function verify - * @memberof google.cloud.ces.v1.Guardrail.ContentFilter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContentFilter.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bannedContents != null && message.hasOwnProperty("bannedContents")) { - if (!Array.isArray(message.bannedContents)) - return "bannedContents: array expected"; - for (var i = 0; i < message.bannedContents.length; ++i) - if (!$util.isString(message.bannedContents[i])) - return "bannedContents: string[] expected"; - } - if (message.bannedContentsInUserInput != null && message.hasOwnProperty("bannedContentsInUserInput")) { - if (!Array.isArray(message.bannedContentsInUserInput)) - return "bannedContentsInUserInput: array expected"; - for (var i = 0; i < message.bannedContentsInUserInput.length; ++i) - if (!$util.isString(message.bannedContentsInUserInput[i])) - return "bannedContentsInUserInput: string[] expected"; - } - if (message.bannedContentsInAgentResponse != null && message.hasOwnProperty("bannedContentsInAgentResponse")) { - if (!Array.isArray(message.bannedContentsInAgentResponse)) - return "bannedContentsInAgentResponse: array expected"; - for (var i = 0; i < message.bannedContentsInAgentResponse.length; ++i) - if (!$util.isString(message.bannedContentsInAgentResponse[i])) - return "bannedContentsInAgentResponse: string[] expected"; - } - if (message.matchType != null && message.hasOwnProperty("matchType")) - switch (message.matchType) { - default: - return "matchType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.disregardDiacritics != null && message.hasOwnProperty("disregardDiacritics")) - if (typeof message.disregardDiacritics !== "boolean") - return "disregardDiacritics: boolean expected"; - return null; - }; - - /** - * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Guardrail.ContentFilter - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Guardrail.ContentFilter} ContentFilter - */ - ContentFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Guardrail.ContentFilter) - return object; - var message = new $root.google.cloud.ces.v1.Guardrail.ContentFilter(); - if (object.bannedContents) { - if (!Array.isArray(object.bannedContents)) - throw TypeError(".google.cloud.ces.v1.Guardrail.ContentFilter.bannedContents: array expected"); - message.bannedContents = []; - for (var i = 0; i < object.bannedContents.length; ++i) - message.bannedContents[i] = String(object.bannedContents[i]); - } - if (object.bannedContentsInUserInput) { - if (!Array.isArray(object.bannedContentsInUserInput)) - throw TypeError(".google.cloud.ces.v1.Guardrail.ContentFilter.bannedContentsInUserInput: array expected"); - message.bannedContentsInUserInput = []; - for (var i = 0; i < object.bannedContentsInUserInput.length; ++i) - message.bannedContentsInUserInput[i] = String(object.bannedContentsInUserInput[i]); - } - if (object.bannedContentsInAgentResponse) { - if (!Array.isArray(object.bannedContentsInAgentResponse)) - throw TypeError(".google.cloud.ces.v1.Guardrail.ContentFilter.bannedContentsInAgentResponse: array expected"); - message.bannedContentsInAgentResponse = []; - for (var i = 0; i < object.bannedContentsInAgentResponse.length; ++i) - message.bannedContentsInAgentResponse[i] = String(object.bannedContentsInAgentResponse[i]); - } - switch (object.matchType) { - default: - if (typeof object.matchType === "number") { - message.matchType = object.matchType; - break; - } - break; - case "MATCH_TYPE_UNSPECIFIED": - case 0: - message.matchType = 0; - break; - case "SIMPLE_STRING_MATCH": - case 1: - message.matchType = 1; - break; - case "WORD_BOUNDARY_STRING_MATCH": - case 2: - message.matchType = 2; - break; - case "REGEXP_MATCH": - case 3: - message.matchType = 3; - break; - } - if (object.disregardDiacritics != null) - message.disregardDiacritics = Boolean(object.disregardDiacritics); - return message; - }; - - /** - * Creates a plain object from a ContentFilter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Guardrail.ContentFilter - * @static - * @param {google.cloud.ces.v1.Guardrail.ContentFilter} message ContentFilter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContentFilter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bannedContents = []; - object.bannedContentsInUserInput = []; - object.bannedContentsInAgentResponse = []; - } - if (options.defaults) { - object.matchType = options.enums === String ? "MATCH_TYPE_UNSPECIFIED" : 0; - object.disregardDiacritics = false; - } - if (message.bannedContents && message.bannedContents.length) { - object.bannedContents = []; - for (var j = 0; j < message.bannedContents.length; ++j) - object.bannedContents[j] = message.bannedContents[j]; - } - if (message.bannedContentsInUserInput && message.bannedContentsInUserInput.length) { - object.bannedContentsInUserInput = []; - for (var j = 0; j < message.bannedContentsInUserInput.length; ++j) - object.bannedContentsInUserInput[j] = message.bannedContentsInUserInput[j]; - } - if (message.bannedContentsInAgentResponse && message.bannedContentsInAgentResponse.length) { - object.bannedContentsInAgentResponse = []; - for (var j = 0; j < message.bannedContentsInAgentResponse.length; ++j) - object.bannedContentsInAgentResponse[j] = message.bannedContentsInAgentResponse[j]; - } - if (message.matchType != null && message.hasOwnProperty("matchType")) - object.matchType = options.enums === String ? $root.google.cloud.ces.v1.Guardrail.ContentFilter.MatchType[message.matchType] === undefined ? message.matchType : $root.google.cloud.ces.v1.Guardrail.ContentFilter.MatchType[message.matchType] : message.matchType; - if (message.disregardDiacritics != null && message.hasOwnProperty("disregardDiacritics")) - object.disregardDiacritics = message.disregardDiacritics; - return object; - }; - - /** - * Converts this ContentFilter to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Guardrail.ContentFilter - * @instance - * @returns {Object.} JSON object - */ - ContentFilter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContentFilter - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Guardrail.ContentFilter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ContentFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Guardrail.ContentFilter"; - }; - - /** - * MatchType enum. - * @name google.cloud.ces.v1.Guardrail.ContentFilter.MatchType - * @enum {number} - * @property {number} MATCH_TYPE_UNSPECIFIED=0 MATCH_TYPE_UNSPECIFIED value - * @property {number} SIMPLE_STRING_MATCH=1 SIMPLE_STRING_MATCH value - * @property {number} WORD_BOUNDARY_STRING_MATCH=2 WORD_BOUNDARY_STRING_MATCH value - * @property {number} REGEXP_MATCH=3 REGEXP_MATCH value - */ - ContentFilter.MatchType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MATCH_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SIMPLE_STRING_MATCH"] = 1; - values[valuesById[2] = "WORD_BOUNDARY_STRING_MATCH"] = 2; - values[valuesById[3] = "REGEXP_MATCH"] = 3; - return values; - })(); - - return ContentFilter; - })(); - - Guardrail.LlmPromptSecurity = (function() { - - /** - * Properties of a LlmPromptSecurity. - * @memberof google.cloud.ces.v1.Guardrail - * @interface ILlmPromptSecurity - * @property {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null} [defaultSettings] LlmPromptSecurity defaultSettings - * @property {google.cloud.ces.v1.Guardrail.ILlmPolicy|null} [customPolicy] LlmPromptSecurity customPolicy - * @property {boolean|null} [failOpen] LlmPromptSecurity failOpen - */ - - /** - * Constructs a new LlmPromptSecurity. - * @memberof google.cloud.ces.v1.Guardrail - * @classdesc Represents a LlmPromptSecurity. - * @implements ILlmPromptSecurity - * @constructor - * @param {google.cloud.ces.v1.Guardrail.ILlmPromptSecurity=} [properties] Properties to set - */ - function LlmPromptSecurity(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LlmPromptSecurity defaultSettings. - * @member {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null|undefined} defaultSettings - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity - * @instance - */ - LlmPromptSecurity.prototype.defaultSettings = null; - - /** - * LlmPromptSecurity customPolicy. - * @member {google.cloud.ces.v1.Guardrail.ILlmPolicy|null|undefined} customPolicy - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity - * @instance - */ - LlmPromptSecurity.prototype.customPolicy = null; - - /** - * LlmPromptSecurity failOpen. - * @member {boolean} failOpen - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity - * @instance - */ - LlmPromptSecurity.prototype.failOpen = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * LlmPromptSecurity securityConfig. - * @member {"defaultSettings"|"customPolicy"|undefined} securityConfig - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity - * @instance - */ - Object.defineProperty(LlmPromptSecurity.prototype, "securityConfig", { - get: $util.oneOfGetter($oneOfFields = ["defaultSettings", "customPolicy"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new LlmPromptSecurity instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity - * @static - * @param {google.cloud.ces.v1.Guardrail.ILlmPromptSecurity=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Guardrail.LlmPromptSecurity} LlmPromptSecurity instance - */ - LlmPromptSecurity.create = function create(properties) { - return new LlmPromptSecurity(properties); - }; - - /** - * Encodes the specified LlmPromptSecurity message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPromptSecurity.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity - * @static - * @param {google.cloud.ces.v1.Guardrail.ILlmPromptSecurity} message LlmPromptSecurity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LlmPromptSecurity.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaultSettings != null && Object.hasOwnProperty.call(message, "defaultSettings")) - $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.encode(message.defaultSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.customPolicy != null && Object.hasOwnProperty.call(message, "customPolicy")) - $root.google.cloud.ces.v1.Guardrail.LlmPolicy.encode(message.customPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.failOpen != null && Object.hasOwnProperty.call(message, "failOpen")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.failOpen); - return writer; - }; - - /** - * Encodes the specified LlmPromptSecurity message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPromptSecurity.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity - * @static - * @param {google.cloud.ces.v1.Guardrail.ILlmPromptSecurity} message LlmPromptSecurity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LlmPromptSecurity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LlmPromptSecurity message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Guardrail.LlmPromptSecurity} LlmPromptSecurity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LlmPromptSecurity.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.defaultSettings = $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.decode(reader, reader.uint32()); - break; - } - case 2: { - message.customPolicy = $root.google.cloud.ces.v1.Guardrail.LlmPolicy.decode(reader, reader.uint32()); - break; - } - case 3: { - message.failOpen = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LlmPromptSecurity message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Guardrail.LlmPromptSecurity} LlmPromptSecurity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LlmPromptSecurity.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LlmPromptSecurity message. - * @function verify - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LlmPromptSecurity.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.defaultSettings != null && message.hasOwnProperty("defaultSettings")) { - properties.securityConfig = 1; - { - var error = $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify(message.defaultSettings); - if (error) - return "defaultSettings." + error; - } - } - if (message.customPolicy != null && message.hasOwnProperty("customPolicy")) { - if (properties.securityConfig === 1) - return "securityConfig: multiple values"; - properties.securityConfig = 1; - { - var error = $root.google.cloud.ces.v1.Guardrail.LlmPolicy.verify(message.customPolicy); - if (error) - return "customPolicy." + error; - } - } - if (message.failOpen != null && message.hasOwnProperty("failOpen")) - if (typeof message.failOpen !== "boolean") - return "failOpen: boolean expected"; - return null; - }; - - /** - * Creates a LlmPromptSecurity message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Guardrail.LlmPromptSecurity} LlmPromptSecurity - */ - LlmPromptSecurity.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity) - return object; - var message = new $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity(); - if (object.defaultSettings != null) { - if (typeof object.defaultSettings !== "object") - throw TypeError(".google.cloud.ces.v1.Guardrail.LlmPromptSecurity.defaultSettings: object expected"); - message.defaultSettings = $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.fromObject(object.defaultSettings); - } - if (object.customPolicy != null) { - if (typeof object.customPolicy !== "object") - throw TypeError(".google.cloud.ces.v1.Guardrail.LlmPromptSecurity.customPolicy: object expected"); - message.customPolicy = $root.google.cloud.ces.v1.Guardrail.LlmPolicy.fromObject(object.customPolicy); - } - if (object.failOpen != null) - message.failOpen = Boolean(object.failOpen); - return message; - }; - - /** - * Creates a plain object from a LlmPromptSecurity message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity - * @static - * @param {google.cloud.ces.v1.Guardrail.LlmPromptSecurity} message LlmPromptSecurity - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LlmPromptSecurity.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.failOpen = false; - if (message.defaultSettings != null && message.hasOwnProperty("defaultSettings")) { - object.defaultSettings = $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.toObject(message.defaultSettings, options); - if (options.oneofs) - object.securityConfig = "defaultSettings"; - } - if (message.customPolicy != null && message.hasOwnProperty("customPolicy")) { - object.customPolicy = $root.google.cloud.ces.v1.Guardrail.LlmPolicy.toObject(message.customPolicy, options); - if (options.oneofs) - object.securityConfig = "customPolicy"; - } - if (message.failOpen != null && message.hasOwnProperty("failOpen")) - object.failOpen = message.failOpen; - return object; - }; - - /** - * Converts this LlmPromptSecurity to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity - * @instance - * @returns {Object.} JSON object - */ - LlmPromptSecurity.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LlmPromptSecurity - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LlmPromptSecurity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Guardrail.LlmPromptSecurity"; - }; - - LlmPromptSecurity.DefaultSecuritySettings = (function() { - - /** - * Properties of a DefaultSecuritySettings. - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity - * @interface IDefaultSecuritySettings - * @property {string|null} [defaultPromptTemplate] DefaultSecuritySettings defaultPromptTemplate - */ - - /** - * Constructs a new DefaultSecuritySettings. - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity - * @classdesc Represents a DefaultSecuritySettings. - * @implements IDefaultSecuritySettings - * @constructor - * @param {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings=} [properties] Properties to set - */ - function DefaultSecuritySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DefaultSecuritySettings defaultPromptTemplate. - * @member {string} defaultPromptTemplate - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @instance - */ - DefaultSecuritySettings.prototype.defaultPromptTemplate = ""; - - /** - * Creates a new DefaultSecuritySettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @static - * @param {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings instance - */ - DefaultSecuritySettings.create = function create(properties) { - return new DefaultSecuritySettings(properties); - }; - - /** - * Encodes the specified DefaultSecuritySettings message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @static - * @param {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings} message DefaultSecuritySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DefaultSecuritySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaultPromptTemplate != null && Object.hasOwnProperty.call(message, "defaultPromptTemplate")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.defaultPromptTemplate); - return writer; - }; - - /** - * Encodes the specified DefaultSecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @static - * @param {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings} message DefaultSecuritySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DefaultSecuritySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DefaultSecuritySettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DefaultSecuritySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.defaultPromptTemplate = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DefaultSecuritySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DefaultSecuritySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DefaultSecuritySettings message. - * @function verify - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DefaultSecuritySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaultPromptTemplate != null && message.hasOwnProperty("defaultPromptTemplate")) - if (!$util.isString(message.defaultPromptTemplate)) - return "defaultPromptTemplate: string expected"; - return null; - }; - - /** - * Creates a DefaultSecuritySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings - */ - DefaultSecuritySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings) - return object; - var message = new $root.google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings(); - if (object.defaultPromptTemplate != null) - message.defaultPromptTemplate = String(object.defaultPromptTemplate); - return message; - }; - - /** - * Creates a plain object from a DefaultSecuritySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @static - * @param {google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} message DefaultSecuritySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DefaultSecuritySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.defaultPromptTemplate = ""; - if (message.defaultPromptTemplate != null && message.hasOwnProperty("defaultPromptTemplate")) - object.defaultPromptTemplate = message.defaultPromptTemplate; - return object; - }; - - /** - * Converts this DefaultSecuritySettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @instance - * @returns {Object.} JSON object - */ - DefaultSecuritySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DefaultSecuritySettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DefaultSecuritySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Guardrail.LlmPromptSecurity.DefaultSecuritySettings"; - }; - - return DefaultSecuritySettings; - })(); - - return LlmPromptSecurity; - })(); - - Guardrail.LlmPolicy = (function() { - - /** - * Properties of a LlmPolicy. - * @memberof google.cloud.ces.v1.Guardrail - * @interface ILlmPolicy - * @property {number|null} [maxConversationMessages] LlmPolicy maxConversationMessages - * @property {google.cloud.ces.v1.IModelSettings|null} [modelSettings] LlmPolicy modelSettings - * @property {string|null} [prompt] LlmPolicy prompt - * @property {google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope|null} [policyScope] LlmPolicy policyScope - * @property {boolean|null} [failOpen] LlmPolicy failOpen - * @property {boolean|null} [allowShortUtterance] LlmPolicy allowShortUtterance - */ - - /** - * Constructs a new LlmPolicy. - * @memberof google.cloud.ces.v1.Guardrail - * @classdesc Represents a LlmPolicy. - * @implements ILlmPolicy - * @constructor - * @param {google.cloud.ces.v1.Guardrail.ILlmPolicy=} [properties] Properties to set - */ - function LlmPolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LlmPolicy maxConversationMessages. - * @member {number} maxConversationMessages - * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy - * @instance - */ - LlmPolicy.prototype.maxConversationMessages = 0; - - /** - * LlmPolicy modelSettings. - * @member {google.cloud.ces.v1.IModelSettings|null|undefined} modelSettings - * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy - * @instance - */ - LlmPolicy.prototype.modelSettings = null; - - /** - * LlmPolicy prompt. - * @member {string} prompt - * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy - * @instance - */ - LlmPolicy.prototype.prompt = ""; - - /** - * LlmPolicy policyScope. - * @member {google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope} policyScope - * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy - * @instance - */ - LlmPolicy.prototype.policyScope = 0; - - /** - * LlmPolicy failOpen. - * @member {boolean} failOpen - * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy - * @instance - */ - LlmPolicy.prototype.failOpen = false; - - /** - * LlmPolicy allowShortUtterance. - * @member {boolean} allowShortUtterance - * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy - * @instance - */ - LlmPolicy.prototype.allowShortUtterance = false; - - /** - * Creates a new LlmPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy - * @static - * @param {google.cloud.ces.v1.Guardrail.ILlmPolicy=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Guardrail.LlmPolicy} LlmPolicy instance - */ - LlmPolicy.create = function create(properties) { - return new LlmPolicy(properties); - }; - - /** - * Encodes the specified LlmPolicy message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy - * @static - * @param {google.cloud.ces.v1.Guardrail.ILlmPolicy} message LlmPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LlmPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.maxConversationMessages != null && Object.hasOwnProperty.call(message, "maxConversationMessages")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxConversationMessages); - if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) - $root.google.cloud.ces.v1.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.prompt); - if (message.policyScope != null && Object.hasOwnProperty.call(message, "policyScope")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.policyScope); - if (message.failOpen != null && Object.hasOwnProperty.call(message, "failOpen")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.failOpen); - if (message.allowShortUtterance != null && Object.hasOwnProperty.call(message, "allowShortUtterance")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowShortUtterance); - return writer; - }; - - /** - * Encodes the specified LlmPolicy message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.LlmPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy - * @static - * @param {google.cloud.ces.v1.Guardrail.ILlmPolicy} message LlmPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LlmPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LlmPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Guardrail.LlmPolicy} LlmPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LlmPolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Guardrail.LlmPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.maxConversationMessages = reader.int32(); - break; - } - case 2: { - message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.decode(reader, reader.uint32()); - break; - } - case 3: { - message.prompt = reader.string(); - break; - } - case 4: { - message.policyScope = reader.int32(); - break; - } - case 5: { - message.failOpen = reader.bool(); - break; - } - case 6: { - message.allowShortUtterance = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LlmPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Guardrail.LlmPolicy} LlmPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LlmPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LlmPolicy message. - * @function verify - * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LlmPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.maxConversationMessages != null && message.hasOwnProperty("maxConversationMessages")) - if (!$util.isInteger(message.maxConversationMessages)) - return "maxConversationMessages: integer expected"; - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { - var error = $root.google.cloud.ces.v1.ModelSettings.verify(message.modelSettings); - if (error) - return "modelSettings." + error; - } - if (message.prompt != null && message.hasOwnProperty("prompt")) - if (!$util.isString(message.prompt)) - return "prompt: string expected"; - if (message.policyScope != null && message.hasOwnProperty("policyScope")) - switch (message.policyScope) { - default: - return "policyScope: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.failOpen != null && message.hasOwnProperty("failOpen")) - if (typeof message.failOpen !== "boolean") - return "failOpen: boolean expected"; - if (message.allowShortUtterance != null && message.hasOwnProperty("allowShortUtterance")) - if (typeof message.allowShortUtterance !== "boolean") - return "allowShortUtterance: boolean expected"; - return null; - }; - - /** - * Creates a LlmPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Guardrail.LlmPolicy} LlmPolicy - */ - LlmPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Guardrail.LlmPolicy) - return object; - var message = new $root.google.cloud.ces.v1.Guardrail.LlmPolicy(); - if (object.maxConversationMessages != null) - message.maxConversationMessages = object.maxConversationMessages | 0; - if (object.modelSettings != null) { - if (typeof object.modelSettings !== "object") - throw TypeError(".google.cloud.ces.v1.Guardrail.LlmPolicy.modelSettings: object expected"); - message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.fromObject(object.modelSettings); - } - if (object.prompt != null) - message.prompt = String(object.prompt); - switch (object.policyScope) { - default: - if (typeof object.policyScope === "number") { - message.policyScope = object.policyScope; - break; - } - break; - case "POLICY_SCOPE_UNSPECIFIED": - case 0: - message.policyScope = 0; - break; - case "USER_QUERY": - case 1: - message.policyScope = 1; - break; - case "AGENT_RESPONSE": - case 2: - message.policyScope = 2; - break; - case "USER_QUERY_AND_AGENT_RESPONSE": - case 3: - message.policyScope = 3; - break; - } - if (object.failOpen != null) - message.failOpen = Boolean(object.failOpen); - if (object.allowShortUtterance != null) - message.allowShortUtterance = Boolean(object.allowShortUtterance); - return message; - }; - - /** - * Creates a plain object from a LlmPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy - * @static - * @param {google.cloud.ces.v1.Guardrail.LlmPolicy} message LlmPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LlmPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.maxConversationMessages = 0; - object.modelSettings = null; - object.prompt = ""; - object.policyScope = options.enums === String ? "POLICY_SCOPE_UNSPECIFIED" : 0; - object.failOpen = false; - object.allowShortUtterance = false; - } - if (message.maxConversationMessages != null && message.hasOwnProperty("maxConversationMessages")) - object.maxConversationMessages = message.maxConversationMessages; - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) - object.modelSettings = $root.google.cloud.ces.v1.ModelSettings.toObject(message.modelSettings, options); - if (message.prompt != null && message.hasOwnProperty("prompt")) - object.prompt = message.prompt; - if (message.policyScope != null && message.hasOwnProperty("policyScope")) - object.policyScope = options.enums === String ? $root.google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope[message.policyScope] === undefined ? message.policyScope : $root.google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope[message.policyScope] : message.policyScope; - if (message.failOpen != null && message.hasOwnProperty("failOpen")) - object.failOpen = message.failOpen; - if (message.allowShortUtterance != null && message.hasOwnProperty("allowShortUtterance")) - object.allowShortUtterance = message.allowShortUtterance; - return object; - }; - - /** - * Converts this LlmPolicy to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy - * @instance - * @returns {Object.} JSON object - */ - LlmPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LlmPolicy - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Guardrail.LlmPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LlmPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Guardrail.LlmPolicy"; - }; - - /** - * PolicyScope enum. - * @name google.cloud.ces.v1.Guardrail.LlmPolicy.PolicyScope - * @enum {number} - * @property {number} POLICY_SCOPE_UNSPECIFIED=0 POLICY_SCOPE_UNSPECIFIED value - * @property {number} USER_QUERY=1 USER_QUERY value - * @property {number} AGENT_RESPONSE=2 AGENT_RESPONSE value - * @property {number} USER_QUERY_AND_AGENT_RESPONSE=3 USER_QUERY_AND_AGENT_RESPONSE value - */ - LlmPolicy.PolicyScope = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "POLICY_SCOPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "USER_QUERY"] = 1; - values[valuesById[2] = "AGENT_RESPONSE"] = 2; - values[valuesById[3] = "USER_QUERY_AND_AGENT_RESPONSE"] = 3; - return values; - })(); - - return LlmPolicy; - })(); - - Guardrail.ModelSafety = (function() { - - /** - * Properties of a ModelSafety. - * @memberof google.cloud.ces.v1.Guardrail - * @interface IModelSafety - * @property {Array.|null} [safetySettings] ModelSafety safetySettings - */ - - /** - * Constructs a new ModelSafety. - * @memberof google.cloud.ces.v1.Guardrail - * @classdesc Represents a ModelSafety. - * @implements IModelSafety - * @constructor - * @param {google.cloud.ces.v1.Guardrail.IModelSafety=} [properties] Properties to set - */ - function ModelSafety(properties) { - this.safetySettings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ModelSafety safetySettings. - * @member {Array.} safetySettings - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety - * @instance - */ - ModelSafety.prototype.safetySettings = $util.emptyArray; - - /** - * Creates a new ModelSafety instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety - * @static - * @param {google.cloud.ces.v1.Guardrail.IModelSafety=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Guardrail.ModelSafety} ModelSafety instance - */ - ModelSafety.create = function create(properties) { - return new ModelSafety(properties); - }; - - /** - * Encodes the specified ModelSafety message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ModelSafety.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety - * @static - * @param {google.cloud.ces.v1.Guardrail.IModelSafety} message ModelSafety message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModelSafety.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.safetySettings != null && message.safetySettings.length) - for (var i = 0; i < message.safetySettings.length; ++i) - $root.google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ModelSafety message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ModelSafety.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety - * @static - * @param {google.cloud.ces.v1.Guardrail.IModelSafety} message ModelSafety message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModelSafety.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ModelSafety message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Guardrail.ModelSafety} ModelSafety - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModelSafety.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Guardrail.ModelSafety(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.safetySettings && message.safetySettings.length)) - message.safetySettings = []; - message.safetySettings.push($root.google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ModelSafety message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Guardrail.ModelSafety} ModelSafety - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModelSafety.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ModelSafety message. - * @function verify - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ModelSafety.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.safetySettings != null && message.hasOwnProperty("safetySettings")) { - if (!Array.isArray(message.safetySettings)) - return "safetySettings: array expected"; - for (var i = 0; i < message.safetySettings.length; ++i) { - var error = $root.google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting.verify(message.safetySettings[i]); - if (error) - return "safetySettings." + error; - } - } - return null; - }; - - /** - * Creates a ModelSafety message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Guardrail.ModelSafety} ModelSafety - */ - ModelSafety.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Guardrail.ModelSafety) - return object; - var message = new $root.google.cloud.ces.v1.Guardrail.ModelSafety(); - if (object.safetySettings) { - if (!Array.isArray(object.safetySettings)) - throw TypeError(".google.cloud.ces.v1.Guardrail.ModelSafety.safetySettings: array expected"); - message.safetySettings = []; - for (var i = 0; i < object.safetySettings.length; ++i) { - if (typeof object.safetySettings[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Guardrail.ModelSafety.safetySettings: object expected"); - message.safetySettings[i] = $root.google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting.fromObject(object.safetySettings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ModelSafety message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety - * @static - * @param {google.cloud.ces.v1.Guardrail.ModelSafety} message ModelSafety - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ModelSafety.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.safetySettings = []; - if (message.safetySettings && message.safetySettings.length) { - object.safetySettings = []; - for (var j = 0; j < message.safetySettings.length; ++j) - object.safetySettings[j] = $root.google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting.toObject(message.safetySettings[j], options); - } - return object; - }; - - /** - * Converts this ModelSafety to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety - * @instance - * @returns {Object.} JSON object - */ - ModelSafety.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ModelSafety - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ModelSafety.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Guardrail.ModelSafety"; - }; - - ModelSafety.SafetySetting = (function() { - - /** - * Properties of a SafetySetting. - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety - * @interface ISafetySetting - * @property {google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory|null} [category] SafetySetting category - * @property {google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold|null} [threshold] SafetySetting threshold - */ - - /** - * Constructs a new SafetySetting. - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety - * @classdesc Represents a SafetySetting. - * @implements ISafetySetting - * @constructor - * @param {google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting=} [properties] Properties to set - */ - function SafetySetting(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SafetySetting category. - * @member {google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory} category - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting - * @instance - */ - SafetySetting.prototype.category = 0; - - /** - * SafetySetting threshold. - * @member {google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold} threshold - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting - * @instance - */ - SafetySetting.prototype.threshold = 0; - - /** - * Creates a new SafetySetting instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting - * @static - * @param {google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting} SafetySetting instance - */ - SafetySetting.create = function create(properties) { - return new SafetySetting(properties); - }; - - /** - * Encodes the specified SafetySetting message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting - * @static - * @param {google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting} message SafetySetting message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SafetySetting.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.category != null && Object.hasOwnProperty.call(message, "category")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.category); - if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.threshold); - return writer; - }; - - /** - * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting - * @static - * @param {google.cloud.ces.v1.Guardrail.ModelSafety.ISafetySetting} message SafetySetting message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SafetySetting.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SafetySetting message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting} SafetySetting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SafetySetting.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.category = reader.int32(); - break; - } - case 2: { - message.threshold = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SafetySetting message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting} SafetySetting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SafetySetting.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SafetySetting message. - * @function verify - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SafetySetting.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.category != null && message.hasOwnProperty("category")) - switch (message.category) { - default: - return "category: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.threshold != null && message.hasOwnProperty("threshold")) - switch (message.threshold) { - default: - return "threshold: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - return null; - }; - - /** - * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting} SafetySetting - */ - SafetySetting.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting) - return object; - var message = new $root.google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting(); - switch (object.category) { - default: - if (typeof object.category === "number") { - message.category = object.category; - break; - } - break; - case "HARM_CATEGORY_UNSPECIFIED": - case 0: - message.category = 0; - break; - case "HARM_CATEGORY_HATE_SPEECH": - case 1: - message.category = 1; - break; - case "HARM_CATEGORY_DANGEROUS_CONTENT": - case 2: - message.category = 2; - break; - case "HARM_CATEGORY_HARASSMENT": - case 3: - message.category = 3; - break; - case "HARM_CATEGORY_SEXUALLY_EXPLICIT": - case 4: - message.category = 4; - break; - } - switch (object.threshold) { - default: - if (typeof object.threshold === "number") { - message.threshold = object.threshold; - break; - } - break; - case "HARM_BLOCK_THRESHOLD_UNSPECIFIED": - case 0: - message.threshold = 0; - break; - case "BLOCK_LOW_AND_ABOVE": - case 1: - message.threshold = 1; - break; - case "BLOCK_MEDIUM_AND_ABOVE": - case 2: - message.threshold = 2; - break; - case "BLOCK_ONLY_HIGH": - case 3: - message.threshold = 3; - break; - case "BLOCK_NONE": - case 4: - message.threshold = 4; - break; - case "OFF": - case 5: - message.threshold = 5; - break; - } - return message; - }; - - /** - * Creates a plain object from a SafetySetting message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting - * @static - * @param {google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting} message SafetySetting - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SafetySetting.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0; - object.threshold = options.enums === String ? "HARM_BLOCK_THRESHOLD_UNSPECIFIED" : 0; - } - if (message.category != null && message.hasOwnProperty("category")) - object.category = options.enums === String ? $root.google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory[message.category] === undefined ? message.category : $root.google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory[message.category] : message.category; - if (message.threshold != null && message.hasOwnProperty("threshold")) - object.threshold = options.enums === String ? $root.google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold[message.threshold] === undefined ? message.threshold : $root.google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold[message.threshold] : message.threshold; - return object; - }; - - /** - * Converts this SafetySetting to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting - * @instance - * @returns {Object.} JSON object - */ - SafetySetting.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SafetySetting - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SafetySetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting"; - }; - - return SafetySetting; - })(); - - /** - * HarmCategory enum. - * @name google.cloud.ces.v1.Guardrail.ModelSafety.HarmCategory - * @enum {number} - * @property {number} HARM_CATEGORY_UNSPECIFIED=0 HARM_CATEGORY_UNSPECIFIED value - * @property {number} HARM_CATEGORY_HATE_SPEECH=1 HARM_CATEGORY_HATE_SPEECH value - * @property {number} HARM_CATEGORY_DANGEROUS_CONTENT=2 HARM_CATEGORY_DANGEROUS_CONTENT value - * @property {number} HARM_CATEGORY_HARASSMENT=3 HARM_CATEGORY_HARASSMENT value - * @property {number} HARM_CATEGORY_SEXUALLY_EXPLICIT=4 HARM_CATEGORY_SEXUALLY_EXPLICIT value - */ - ModelSafety.HarmCategory = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HARM_CATEGORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "HARM_CATEGORY_HATE_SPEECH"] = 1; - values[valuesById[2] = "HARM_CATEGORY_DANGEROUS_CONTENT"] = 2; - values[valuesById[3] = "HARM_CATEGORY_HARASSMENT"] = 3; - values[valuesById[4] = "HARM_CATEGORY_SEXUALLY_EXPLICIT"] = 4; - return values; - })(); - - /** - * HarmBlockThreshold enum. - * @name google.cloud.ces.v1.Guardrail.ModelSafety.HarmBlockThreshold - * @enum {number} - * @property {number} HARM_BLOCK_THRESHOLD_UNSPECIFIED=0 HARM_BLOCK_THRESHOLD_UNSPECIFIED value - * @property {number} BLOCK_LOW_AND_ABOVE=1 BLOCK_LOW_AND_ABOVE value - * @property {number} BLOCK_MEDIUM_AND_ABOVE=2 BLOCK_MEDIUM_AND_ABOVE value - * @property {number} BLOCK_ONLY_HIGH=3 BLOCK_ONLY_HIGH value - * @property {number} BLOCK_NONE=4 BLOCK_NONE value - * @property {number} OFF=5 OFF value - */ - ModelSafety.HarmBlockThreshold = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED"] = 0; - values[valuesById[1] = "BLOCK_LOW_AND_ABOVE"] = 1; - values[valuesById[2] = "BLOCK_MEDIUM_AND_ABOVE"] = 2; - values[valuesById[3] = "BLOCK_ONLY_HIGH"] = 3; - values[valuesById[4] = "BLOCK_NONE"] = 4; - values[valuesById[5] = "OFF"] = 5; - return values; - })(); - - return ModelSafety; - })(); - - Guardrail.CodeCallback = (function() { - - /** - * Properties of a CodeCallback. - * @memberof google.cloud.ces.v1.Guardrail - * @interface ICodeCallback - * @property {google.cloud.ces.v1.ICallback|null} [beforeAgentCallback] CodeCallback beforeAgentCallback - * @property {google.cloud.ces.v1.ICallback|null} [afterAgentCallback] CodeCallback afterAgentCallback - * @property {google.cloud.ces.v1.ICallback|null} [beforeModelCallback] CodeCallback beforeModelCallback - * @property {google.cloud.ces.v1.ICallback|null} [afterModelCallback] CodeCallback afterModelCallback - */ - - /** - * Constructs a new CodeCallback. - * @memberof google.cloud.ces.v1.Guardrail - * @classdesc Represents a CodeCallback. - * @implements ICodeCallback - * @constructor - * @param {google.cloud.ces.v1.Guardrail.ICodeCallback=} [properties] Properties to set - */ - function CodeCallback(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CodeCallback beforeAgentCallback. - * @member {google.cloud.ces.v1.ICallback|null|undefined} beforeAgentCallback - * @memberof google.cloud.ces.v1.Guardrail.CodeCallback - * @instance - */ - CodeCallback.prototype.beforeAgentCallback = null; - - /** - * CodeCallback afterAgentCallback. - * @member {google.cloud.ces.v1.ICallback|null|undefined} afterAgentCallback - * @memberof google.cloud.ces.v1.Guardrail.CodeCallback - * @instance - */ - CodeCallback.prototype.afterAgentCallback = null; - - /** - * CodeCallback beforeModelCallback. - * @member {google.cloud.ces.v1.ICallback|null|undefined} beforeModelCallback - * @memberof google.cloud.ces.v1.Guardrail.CodeCallback - * @instance - */ - CodeCallback.prototype.beforeModelCallback = null; - - /** - * CodeCallback afterModelCallback. - * @member {google.cloud.ces.v1.ICallback|null|undefined} afterModelCallback - * @memberof google.cloud.ces.v1.Guardrail.CodeCallback - * @instance - */ - CodeCallback.prototype.afterModelCallback = null; - - /** - * Creates a new CodeCallback instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Guardrail.CodeCallback - * @static - * @param {google.cloud.ces.v1.Guardrail.ICodeCallback=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Guardrail.CodeCallback} CodeCallback instance - */ - CodeCallback.create = function create(properties) { - return new CodeCallback(properties); - }; - - /** - * Encodes the specified CodeCallback message. Does not implicitly {@link google.cloud.ces.v1.Guardrail.CodeCallback.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Guardrail.CodeCallback - * @static - * @param {google.cloud.ces.v1.Guardrail.ICodeCallback} message CodeCallback message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CodeCallback.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.beforeAgentCallback != null && Object.hasOwnProperty.call(message, "beforeAgentCallback")) - $root.google.cloud.ces.v1.Callback.encode(message.beforeAgentCallback, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.afterAgentCallback != null && Object.hasOwnProperty.call(message, "afterAgentCallback")) - $root.google.cloud.ces.v1.Callback.encode(message.afterAgentCallback, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.beforeModelCallback != null && Object.hasOwnProperty.call(message, "beforeModelCallback")) - $root.google.cloud.ces.v1.Callback.encode(message.beforeModelCallback, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.afterModelCallback != null && Object.hasOwnProperty.call(message, "afterModelCallback")) - $root.google.cloud.ces.v1.Callback.encode(message.afterModelCallback, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CodeCallback message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Guardrail.CodeCallback.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Guardrail.CodeCallback - * @static - * @param {google.cloud.ces.v1.Guardrail.ICodeCallback} message CodeCallback message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CodeCallback.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CodeCallback message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Guardrail.CodeCallback - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Guardrail.CodeCallback} CodeCallback - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CodeCallback.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Guardrail.CodeCallback(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.beforeAgentCallback = $root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32()); - break; - } - case 2: { - message.afterAgentCallback = $root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32()); - break; - } - case 3: { - message.beforeModelCallback = $root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32()); - break; - } - case 4: { - message.afterModelCallback = $root.google.cloud.ces.v1.Callback.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CodeCallback message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Guardrail.CodeCallback - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Guardrail.CodeCallback} CodeCallback - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CodeCallback.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CodeCallback message. - * @function verify - * @memberof google.cloud.ces.v1.Guardrail.CodeCallback - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CodeCallback.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.beforeAgentCallback != null && message.hasOwnProperty("beforeAgentCallback")) { - var error = $root.google.cloud.ces.v1.Callback.verify(message.beforeAgentCallback); - if (error) - return "beforeAgentCallback." + error; - } - if (message.afterAgentCallback != null && message.hasOwnProperty("afterAgentCallback")) { - var error = $root.google.cloud.ces.v1.Callback.verify(message.afterAgentCallback); - if (error) - return "afterAgentCallback." + error; - } - if (message.beforeModelCallback != null && message.hasOwnProperty("beforeModelCallback")) { - var error = $root.google.cloud.ces.v1.Callback.verify(message.beforeModelCallback); - if (error) - return "beforeModelCallback." + error; - } - if (message.afterModelCallback != null && message.hasOwnProperty("afterModelCallback")) { - var error = $root.google.cloud.ces.v1.Callback.verify(message.afterModelCallback); - if (error) - return "afterModelCallback." + error; - } - return null; - }; - - /** - * Creates a CodeCallback message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Guardrail.CodeCallback - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Guardrail.CodeCallback} CodeCallback - */ - CodeCallback.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Guardrail.CodeCallback) - return object; - var message = new $root.google.cloud.ces.v1.Guardrail.CodeCallback(); - if (object.beforeAgentCallback != null) { - if (typeof object.beforeAgentCallback !== "object") - throw TypeError(".google.cloud.ces.v1.Guardrail.CodeCallback.beforeAgentCallback: object expected"); - message.beforeAgentCallback = $root.google.cloud.ces.v1.Callback.fromObject(object.beforeAgentCallback); - } - if (object.afterAgentCallback != null) { - if (typeof object.afterAgentCallback !== "object") - throw TypeError(".google.cloud.ces.v1.Guardrail.CodeCallback.afterAgentCallback: object expected"); - message.afterAgentCallback = $root.google.cloud.ces.v1.Callback.fromObject(object.afterAgentCallback); - } - if (object.beforeModelCallback != null) { - if (typeof object.beforeModelCallback !== "object") - throw TypeError(".google.cloud.ces.v1.Guardrail.CodeCallback.beforeModelCallback: object expected"); - message.beforeModelCallback = $root.google.cloud.ces.v1.Callback.fromObject(object.beforeModelCallback); - } - if (object.afterModelCallback != null) { - if (typeof object.afterModelCallback !== "object") - throw TypeError(".google.cloud.ces.v1.Guardrail.CodeCallback.afterModelCallback: object expected"); - message.afterModelCallback = $root.google.cloud.ces.v1.Callback.fromObject(object.afterModelCallback); - } - return message; - }; - - /** - * Creates a plain object from a CodeCallback message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Guardrail.CodeCallback - * @static - * @param {google.cloud.ces.v1.Guardrail.CodeCallback} message CodeCallback - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CodeCallback.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.beforeAgentCallback = null; - object.afterAgentCallback = null; - object.beforeModelCallback = null; - object.afterModelCallback = null; - } - if (message.beforeAgentCallback != null && message.hasOwnProperty("beforeAgentCallback")) - object.beforeAgentCallback = $root.google.cloud.ces.v1.Callback.toObject(message.beforeAgentCallback, options); - if (message.afterAgentCallback != null && message.hasOwnProperty("afterAgentCallback")) - object.afterAgentCallback = $root.google.cloud.ces.v1.Callback.toObject(message.afterAgentCallback, options); - if (message.beforeModelCallback != null && message.hasOwnProperty("beforeModelCallback")) - object.beforeModelCallback = $root.google.cloud.ces.v1.Callback.toObject(message.beforeModelCallback, options); - if (message.afterModelCallback != null && message.hasOwnProperty("afterModelCallback")) - object.afterModelCallback = $root.google.cloud.ces.v1.Callback.toObject(message.afterModelCallback, options); - return object; - }; - - /** - * Converts this CodeCallback to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Guardrail.CodeCallback - * @instance - * @returns {Object.} JSON object - */ - CodeCallback.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CodeCallback - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Guardrail.CodeCallback - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CodeCallback.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Guardrail.CodeCallback"; - }; - - return CodeCallback; - })(); - - return Guardrail; - })(); - - v1.Tool = (function() { - - /** - * Properties of a Tool. - * @memberof google.cloud.ces.v1 - * @interface ITool - * @property {google.cloud.ces.v1.IClientFunction|null} [clientFunction] Tool clientFunction - * @property {google.cloud.ces.v1.IOpenApiTool|null} [openApiTool] Tool openApiTool - * @property {google.cloud.ces.v1.IGoogleSearchTool|null} [googleSearchTool] Tool googleSearchTool - * @property {google.cloud.ces.v1.IConnectorTool|null} [connectorTool] Tool connectorTool - * @property {google.cloud.ces.v1.IDataStoreTool|null} [dataStoreTool] Tool dataStoreTool - * @property {google.cloud.ces.v1.IPythonFunction|null} [pythonFunction] Tool pythonFunction - * @property {google.cloud.ces.v1.IMcpTool|null} [mcpTool] Tool mcpTool - * @property {google.cloud.ces.v1.IFileSearchTool|null} [fileSearchTool] Tool fileSearchTool - * @property {google.cloud.ces.v1.ISystemTool|null} [systemTool] Tool systemTool - * @property {google.cloud.ces.v1.IWidgetTool|null} [widgetTool] Tool widgetTool - * @property {string|null} [name] Tool name - * @property {string|null} [displayName] Tool displayName - * @property {google.cloud.ces.v1.ExecutionType|null} [executionType] Tool executionType - * @property {google.protobuf.ITimestamp|null} [createTime] Tool createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Tool updateTime - * @property {string|null} [etag] Tool etag - * @property {string|null} [generatedSummary] Tool generatedSummary - * @property {google.cloud.ces.v1.IToolFakeConfig|null} [toolFakeConfig] Tool toolFakeConfig - */ - - /** - * Constructs a new Tool. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a Tool. - * @implements ITool - * @constructor - * @param {google.cloud.ces.v1.ITool=} [properties] Properties to set - */ - function Tool(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Tool clientFunction. - * @member {google.cloud.ces.v1.IClientFunction|null|undefined} clientFunction - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Tool.prototype.clientFunction = null; - - /** - * Tool openApiTool. - * @member {google.cloud.ces.v1.IOpenApiTool|null|undefined} openApiTool - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Tool.prototype.openApiTool = null; - - /** - * Tool googleSearchTool. - * @member {google.cloud.ces.v1.IGoogleSearchTool|null|undefined} googleSearchTool - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Tool.prototype.googleSearchTool = null; - - /** - * Tool connectorTool. - * @member {google.cloud.ces.v1.IConnectorTool|null|undefined} connectorTool - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Tool.prototype.connectorTool = null; - - /** - * Tool dataStoreTool. - * @member {google.cloud.ces.v1.IDataStoreTool|null|undefined} dataStoreTool - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Tool.prototype.dataStoreTool = null; - - /** - * Tool pythonFunction. - * @member {google.cloud.ces.v1.IPythonFunction|null|undefined} pythonFunction - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Tool.prototype.pythonFunction = null; - - /** - * Tool mcpTool. - * @member {google.cloud.ces.v1.IMcpTool|null|undefined} mcpTool - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Tool.prototype.mcpTool = null; - - /** - * Tool fileSearchTool. - * @member {google.cloud.ces.v1.IFileSearchTool|null|undefined} fileSearchTool - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Tool.prototype.fileSearchTool = null; - - /** - * Tool systemTool. - * @member {google.cloud.ces.v1.ISystemTool|null|undefined} systemTool - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Tool.prototype.systemTool = null; - - /** - * Tool widgetTool. - * @member {google.cloud.ces.v1.IWidgetTool|null|undefined} widgetTool - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Tool.prototype.widgetTool = null; - - /** - * Tool name. - * @member {string} name - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Tool.prototype.name = ""; - - /** - * Tool displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Tool.prototype.displayName = ""; - - /** - * Tool executionType. - * @member {google.cloud.ces.v1.ExecutionType} executionType - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Tool.prototype.executionType = 0; - - /** - * Tool createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Tool.prototype.createTime = null; - - /** - * Tool updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Tool.prototype.updateTime = null; - - /** - * Tool etag. - * @member {string} etag - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Tool.prototype.etag = ""; - - /** - * Tool generatedSummary. - * @member {string} generatedSummary - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Tool.prototype.generatedSummary = ""; - - /** - * Tool toolFakeConfig. - * @member {google.cloud.ces.v1.IToolFakeConfig|null|undefined} toolFakeConfig - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Tool.prototype.toolFakeConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Tool toolType. - * @member {"clientFunction"|"openApiTool"|"googleSearchTool"|"connectorTool"|"dataStoreTool"|"pythonFunction"|"mcpTool"|"fileSearchTool"|"systemTool"|"widgetTool"|undefined} toolType - * @memberof google.cloud.ces.v1.Tool - * @instance - */ - Object.defineProperty(Tool.prototype, "toolType", { - get: $util.oneOfGetter($oneOfFields = ["clientFunction", "openApiTool", "googleSearchTool", "connectorTool", "dataStoreTool", "pythonFunction", "mcpTool", "fileSearchTool", "systemTool", "widgetTool"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Tool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Tool - * @static - * @param {google.cloud.ces.v1.ITool=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Tool} Tool instance - */ - Tool.create = function create(properties) { - return new Tool(properties); - }; - - /** - * Encodes the specified Tool message. Does not implicitly {@link google.cloud.ces.v1.Tool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Tool - * @static - * @param {google.cloud.ces.v1.ITool} message Tool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Tool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.clientFunction != null && Object.hasOwnProperty.call(message, "clientFunction")) - $root.google.cloud.ces.v1.ClientFunction.encode(message.clientFunction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.openApiTool != null && Object.hasOwnProperty.call(message, "openApiTool")) - $root.google.cloud.ces.v1.OpenApiTool.encode(message.openApiTool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.googleSearchTool != null && Object.hasOwnProperty.call(message, "googleSearchTool")) - $root.google.cloud.ces.v1.GoogleSearchTool.encode(message.googleSearchTool, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.connectorTool != null && Object.hasOwnProperty.call(message, "connectorTool")) - $root.google.cloud.ces.v1.ConnectorTool.encode(message.connectorTool, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.dataStoreTool != null && Object.hasOwnProperty.call(message, "dataStoreTool")) - $root.google.cloud.ces.v1.DataStoreTool.encode(message.dataStoreTool, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.pythonFunction != null && Object.hasOwnProperty.call(message, "pythonFunction")) - $root.google.cloud.ces.v1.PythonFunction.encode(message.pythonFunction, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.executionType != null && Object.hasOwnProperty.call(message, "executionType")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.executionType); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.displayName); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); - if (message.generatedSummary != null && Object.hasOwnProperty.call(message, "generatedSummary")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.generatedSummary); - if (message.mcpTool != null && Object.hasOwnProperty.call(message, "mcpTool")) - $root.google.cloud.ces.v1.McpTool.encode(message.mcpTool, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.fileSearchTool != null && Object.hasOwnProperty.call(message, "fileSearchTool")) - $root.google.cloud.ces.v1.FileSearchTool.encode(message.fileSearchTool, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.systemTool != null && Object.hasOwnProperty.call(message, "systemTool")) - $root.google.cloud.ces.v1.SystemTool.encode(message.systemTool, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.toolFakeConfig != null && Object.hasOwnProperty.call(message, "toolFakeConfig")) - $root.google.cloud.ces.v1.ToolFakeConfig.encode(message.toolFakeConfig, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.widgetTool != null && Object.hasOwnProperty.call(message, "widgetTool")) - $root.google.cloud.ces.v1.WidgetTool.encode(message.widgetTool, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Tool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Tool - * @static - * @param {google.cloud.ces.v1.ITool} message Tool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Tool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Tool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Tool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Tool} Tool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Tool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Tool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.clientFunction = $root.google.cloud.ces.v1.ClientFunction.decode(reader, reader.uint32()); - break; - } - case 3: { - message.openApiTool = $root.google.cloud.ces.v1.OpenApiTool.decode(reader, reader.uint32()); - break; - } - case 5: { - message.googleSearchTool = $root.google.cloud.ces.v1.GoogleSearchTool.decode(reader, reader.uint32()); - break; - } - case 8: { - message.connectorTool = $root.google.cloud.ces.v1.ConnectorTool.decode(reader, reader.uint32()); - break; - } - case 10: { - message.dataStoreTool = $root.google.cloud.ces.v1.DataStoreTool.decode(reader, reader.uint32()); - break; - } - case 11: { - message.pythonFunction = $root.google.cloud.ces.v1.PythonFunction.decode(reader, reader.uint32()); - break; - } - case 16: { - message.mcpTool = $root.google.cloud.ces.v1.McpTool.decode(reader, reader.uint32()); - break; - } - case 17: { - message.fileSearchTool = $root.google.cloud.ces.v1.FileSearchTool.decode(reader, reader.uint32()); - break; - } - case 18: { - message.systemTool = $root.google.cloud.ces.v1.SystemTool.decode(reader, reader.uint32()); - break; - } - case 24: { - message.widgetTool = $root.google.cloud.ces.v1.WidgetTool.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 13: { - message.displayName = reader.string(); - break; - } - case 12: { - message.executionType = reader.int32(); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 14: { - message.etag = reader.string(); - break; - } - case 15: { - message.generatedSummary = reader.string(); - break; - } - case 20: { - message.toolFakeConfig = $root.google.cloud.ces.v1.ToolFakeConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Tool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Tool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Tool} Tool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Tool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Tool message. - * @function verify - * @memberof google.cloud.ces.v1.Tool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Tool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.clientFunction != null && message.hasOwnProperty("clientFunction")) { - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1.ClientFunction.verify(message.clientFunction); - if (error) - return "clientFunction." + error; - } - } - if (message.openApiTool != null && message.hasOwnProperty("openApiTool")) { - if (properties.toolType === 1) - return "toolType: multiple values"; - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1.OpenApiTool.verify(message.openApiTool); - if (error) - return "openApiTool." + error; - } - } - if (message.googleSearchTool != null && message.hasOwnProperty("googleSearchTool")) { - if (properties.toolType === 1) - return "toolType: multiple values"; - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1.GoogleSearchTool.verify(message.googleSearchTool); - if (error) - return "googleSearchTool." + error; - } - } - if (message.connectorTool != null && message.hasOwnProperty("connectorTool")) { - if (properties.toolType === 1) - return "toolType: multiple values"; - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1.ConnectorTool.verify(message.connectorTool); - if (error) - return "connectorTool." + error; - } - } - if (message.dataStoreTool != null && message.hasOwnProperty("dataStoreTool")) { - if (properties.toolType === 1) - return "toolType: multiple values"; - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1.DataStoreTool.verify(message.dataStoreTool); - if (error) - return "dataStoreTool." + error; - } - } - if (message.pythonFunction != null && message.hasOwnProperty("pythonFunction")) { - if (properties.toolType === 1) - return "toolType: multiple values"; - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1.PythonFunction.verify(message.pythonFunction); - if (error) - return "pythonFunction." + error; - } - } - if (message.mcpTool != null && message.hasOwnProperty("mcpTool")) { - if (properties.toolType === 1) - return "toolType: multiple values"; - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1.McpTool.verify(message.mcpTool); - if (error) - return "mcpTool." + error; - } - } - if (message.fileSearchTool != null && message.hasOwnProperty("fileSearchTool")) { - if (properties.toolType === 1) - return "toolType: multiple values"; - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1.FileSearchTool.verify(message.fileSearchTool); - if (error) - return "fileSearchTool." + error; - } - } - if (message.systemTool != null && message.hasOwnProperty("systemTool")) { - if (properties.toolType === 1) - return "toolType: multiple values"; - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1.SystemTool.verify(message.systemTool); - if (error) - return "systemTool." + error; - } - } - if (message.widgetTool != null && message.hasOwnProperty("widgetTool")) { - if (properties.toolType === 1) - return "toolType: multiple values"; - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1.WidgetTool.verify(message.widgetTool); - if (error) - return "widgetTool." + 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.executionType != null && message.hasOwnProperty("executionType")) - switch (message.executionType) { - default: - return "executionType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - 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.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) - if (!$util.isString(message.generatedSummary)) - return "generatedSummary: string expected"; - if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) { - var error = $root.google.cloud.ces.v1.ToolFakeConfig.verify(message.toolFakeConfig); - if (error) - return "toolFakeConfig." + error; - } - return null; - }; - - /** - * Creates a Tool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Tool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Tool} Tool - */ - Tool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Tool) - return object; - var message = new $root.google.cloud.ces.v1.Tool(); - if (object.clientFunction != null) { - if (typeof object.clientFunction !== "object") - throw TypeError(".google.cloud.ces.v1.Tool.clientFunction: object expected"); - message.clientFunction = $root.google.cloud.ces.v1.ClientFunction.fromObject(object.clientFunction); - } - if (object.openApiTool != null) { - if (typeof object.openApiTool !== "object") - throw TypeError(".google.cloud.ces.v1.Tool.openApiTool: object expected"); - message.openApiTool = $root.google.cloud.ces.v1.OpenApiTool.fromObject(object.openApiTool); - } - if (object.googleSearchTool != null) { - if (typeof object.googleSearchTool !== "object") - throw TypeError(".google.cloud.ces.v1.Tool.googleSearchTool: object expected"); - message.googleSearchTool = $root.google.cloud.ces.v1.GoogleSearchTool.fromObject(object.googleSearchTool); - } - if (object.connectorTool != null) { - if (typeof object.connectorTool !== "object") - throw TypeError(".google.cloud.ces.v1.Tool.connectorTool: object expected"); - message.connectorTool = $root.google.cloud.ces.v1.ConnectorTool.fromObject(object.connectorTool); - } - if (object.dataStoreTool != null) { - if (typeof object.dataStoreTool !== "object") - throw TypeError(".google.cloud.ces.v1.Tool.dataStoreTool: object expected"); - message.dataStoreTool = $root.google.cloud.ces.v1.DataStoreTool.fromObject(object.dataStoreTool); - } - if (object.pythonFunction != null) { - if (typeof object.pythonFunction !== "object") - throw TypeError(".google.cloud.ces.v1.Tool.pythonFunction: object expected"); - message.pythonFunction = $root.google.cloud.ces.v1.PythonFunction.fromObject(object.pythonFunction); - } - if (object.mcpTool != null) { - if (typeof object.mcpTool !== "object") - throw TypeError(".google.cloud.ces.v1.Tool.mcpTool: object expected"); - message.mcpTool = $root.google.cloud.ces.v1.McpTool.fromObject(object.mcpTool); - } - if (object.fileSearchTool != null) { - if (typeof object.fileSearchTool !== "object") - throw TypeError(".google.cloud.ces.v1.Tool.fileSearchTool: object expected"); - message.fileSearchTool = $root.google.cloud.ces.v1.FileSearchTool.fromObject(object.fileSearchTool); - } - if (object.systemTool != null) { - if (typeof object.systemTool !== "object") - throw TypeError(".google.cloud.ces.v1.Tool.systemTool: object expected"); - message.systemTool = $root.google.cloud.ces.v1.SystemTool.fromObject(object.systemTool); - } - if (object.widgetTool != null) { - if (typeof object.widgetTool !== "object") - throw TypeError(".google.cloud.ces.v1.Tool.widgetTool: object expected"); - message.widgetTool = $root.google.cloud.ces.v1.WidgetTool.fromObject(object.widgetTool); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - switch (object.executionType) { - default: - if (typeof object.executionType === "number") { - message.executionType = object.executionType; - break; - } - break; - case "EXECUTION_TYPE_UNSPECIFIED": - case 0: - message.executionType = 0; - break; - case "SYNCHRONOUS": - case 1: - message.executionType = 1; - break; - case "ASYNCHRONOUS": - case 2: - message.executionType = 2; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1.Tool.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.ces.v1.Tool.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.generatedSummary != null) - message.generatedSummary = String(object.generatedSummary); - if (object.toolFakeConfig != null) { - if (typeof object.toolFakeConfig !== "object") - throw TypeError(".google.cloud.ces.v1.Tool.toolFakeConfig: object expected"); - message.toolFakeConfig = $root.google.cloud.ces.v1.ToolFakeConfig.fromObject(object.toolFakeConfig); - } - return message; - }; - - /** - * Creates a plain object from a Tool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Tool - * @static - * @param {google.cloud.ces.v1.Tool} message Tool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Tool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.updateTime = null; - object.executionType = options.enums === String ? "EXECUTION_TYPE_UNSPECIFIED" : 0; - object.displayName = ""; - object.etag = ""; - object.generatedSummary = ""; - object.toolFakeConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.clientFunction != null && message.hasOwnProperty("clientFunction")) { - object.clientFunction = $root.google.cloud.ces.v1.ClientFunction.toObject(message.clientFunction, options); - if (options.oneofs) - object.toolType = "clientFunction"; - } - if (message.openApiTool != null && message.hasOwnProperty("openApiTool")) { - object.openApiTool = $root.google.cloud.ces.v1.OpenApiTool.toObject(message.openApiTool, options); - if (options.oneofs) - object.toolType = "openApiTool"; - } - if (message.googleSearchTool != null && message.hasOwnProperty("googleSearchTool")) { - object.googleSearchTool = $root.google.cloud.ces.v1.GoogleSearchTool.toObject(message.googleSearchTool, options); - if (options.oneofs) - object.toolType = "googleSearchTool"; - } - 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.connectorTool != null && message.hasOwnProperty("connectorTool")) { - object.connectorTool = $root.google.cloud.ces.v1.ConnectorTool.toObject(message.connectorTool, options); - if (options.oneofs) - object.toolType = "connectorTool"; - } - if (message.dataStoreTool != null && message.hasOwnProperty("dataStoreTool")) { - object.dataStoreTool = $root.google.cloud.ces.v1.DataStoreTool.toObject(message.dataStoreTool, options); - if (options.oneofs) - object.toolType = "dataStoreTool"; - } - if (message.pythonFunction != null && message.hasOwnProperty("pythonFunction")) { - object.pythonFunction = $root.google.cloud.ces.v1.PythonFunction.toObject(message.pythonFunction, options); - if (options.oneofs) - object.toolType = "pythonFunction"; - } - if (message.executionType != null && message.hasOwnProperty("executionType")) - object.executionType = options.enums === String ? $root.google.cloud.ces.v1.ExecutionType[message.executionType] === undefined ? message.executionType : $root.google.cloud.ces.v1.ExecutionType[message.executionType] : message.executionType; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) - object.generatedSummary = message.generatedSummary; - if (message.mcpTool != null && message.hasOwnProperty("mcpTool")) { - object.mcpTool = $root.google.cloud.ces.v1.McpTool.toObject(message.mcpTool, options); - if (options.oneofs) - object.toolType = "mcpTool"; - } - if (message.fileSearchTool != null && message.hasOwnProperty("fileSearchTool")) { - object.fileSearchTool = $root.google.cloud.ces.v1.FileSearchTool.toObject(message.fileSearchTool, options); - if (options.oneofs) - object.toolType = "fileSearchTool"; - } - if (message.systemTool != null && message.hasOwnProperty("systemTool")) { - object.systemTool = $root.google.cloud.ces.v1.SystemTool.toObject(message.systemTool, options); - if (options.oneofs) - object.toolType = "systemTool"; - } - if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) - object.toolFakeConfig = $root.google.cloud.ces.v1.ToolFakeConfig.toObject(message.toolFakeConfig, options); - if (message.widgetTool != null && message.hasOwnProperty("widgetTool")) { - object.widgetTool = $root.google.cloud.ces.v1.WidgetTool.toObject(message.widgetTool, options); - if (options.oneofs) - object.toolType = "widgetTool"; - } - return object; - }; - - /** - * Converts this Tool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Tool - * @instance - * @returns {Object.} JSON object - */ - Tool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Tool - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Tool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Tool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Tool"; - }; - - return Tool; - })(); - - v1.ClientFunction = (function() { - - /** - * Properties of a ClientFunction. - * @memberof google.cloud.ces.v1 - * @interface IClientFunction - * @property {string|null} [name] ClientFunction name - * @property {string|null} [description] ClientFunction description - * @property {google.cloud.ces.v1.ISchema|null} [parameters] ClientFunction parameters - * @property {google.cloud.ces.v1.ISchema|null} [response] ClientFunction response - */ - - /** - * Constructs a new ClientFunction. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ClientFunction. - * @implements IClientFunction - * @constructor - * @param {google.cloud.ces.v1.IClientFunction=} [properties] Properties to set - */ - function ClientFunction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientFunction name. - * @member {string} name - * @memberof google.cloud.ces.v1.ClientFunction - * @instance - */ - ClientFunction.prototype.name = ""; - - /** - * ClientFunction description. - * @member {string} description - * @memberof google.cloud.ces.v1.ClientFunction - * @instance - */ - ClientFunction.prototype.description = ""; - - /** - * ClientFunction parameters. - * @member {google.cloud.ces.v1.ISchema|null|undefined} parameters - * @memberof google.cloud.ces.v1.ClientFunction - * @instance - */ - ClientFunction.prototype.parameters = null; - - /** - * ClientFunction response. - * @member {google.cloud.ces.v1.ISchema|null|undefined} response - * @memberof google.cloud.ces.v1.ClientFunction - * @instance - */ - ClientFunction.prototype.response = null; - - /** - * Creates a new ClientFunction instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ClientFunction - * @static - * @param {google.cloud.ces.v1.IClientFunction=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ClientFunction} ClientFunction instance - */ - ClientFunction.create = function create(properties) { - return new ClientFunction(properties); - }; - - /** - * Encodes the specified ClientFunction message. Does not implicitly {@link google.cloud.ces.v1.ClientFunction.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ClientFunction - * @static - * @param {google.cloud.ces.v1.IClientFunction} message ClientFunction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientFunction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) - $root.google.cloud.ces.v1.Schema.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.cloud.ces.v1.Schema.encode(message.response, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ClientFunction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ClientFunction - * @static - * @param {google.cloud.ces.v1.IClientFunction} message ClientFunction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientFunction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientFunction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ClientFunction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ClientFunction} ClientFunction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientFunction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ClientFunction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - message.parameters = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); - break; - } - case 4: { - message.response = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientFunction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ClientFunction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ClientFunction} ClientFunction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientFunction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientFunction message. - * @function verify - * @memberof google.cloud.ces.v1.ClientFunction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientFunction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.parameters != null && message.hasOwnProperty("parameters")) { - var error = $root.google.cloud.ces.v1.Schema.verify(message.parameters); - if (error) - return "parameters." + error; - } - if (message.response != null && message.hasOwnProperty("response")) { - var error = $root.google.cloud.ces.v1.Schema.verify(message.response); - if (error) - return "response." + error; - } - return null; - }; - - /** - * Creates a ClientFunction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ClientFunction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ClientFunction} ClientFunction - */ - ClientFunction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ClientFunction) - return object; - var message = new $root.google.cloud.ces.v1.ClientFunction(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.parameters != null) { - if (typeof object.parameters !== "object") - throw TypeError(".google.cloud.ces.v1.ClientFunction.parameters: object expected"); - message.parameters = $root.google.cloud.ces.v1.Schema.fromObject(object.parameters); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.cloud.ces.v1.ClientFunction.response: object expected"); - message.response = $root.google.cloud.ces.v1.Schema.fromObject(object.response); - } - return message; - }; - - /** - * Creates a plain object from a ClientFunction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ClientFunction - * @static - * @param {google.cloud.ces.v1.ClientFunction} message ClientFunction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientFunction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.parameters = null; - object.response = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.parameters != null && message.hasOwnProperty("parameters")) - object.parameters = $root.google.cloud.ces.v1.Schema.toObject(message.parameters, options); - if (message.response != null && message.hasOwnProperty("response")) - object.response = $root.google.cloud.ces.v1.Schema.toObject(message.response, options); - return object; - }; - - /** - * Converts this ClientFunction to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ClientFunction - * @instance - * @returns {Object.} JSON object - */ - ClientFunction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientFunction - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ClientFunction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientFunction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ClientFunction"; - }; - - return ClientFunction; - })(); - - v1.Action = (function() { - - /** - * Properties of an Action. - * @memberof google.cloud.ces.v1 - * @interface IAction - * @property {string|null} [connectionActionId] Action connectionActionId - * @property {google.cloud.ces.v1.Action.IEntityOperation|null} [entityOperation] Action entityOperation - * @property {Array.|null} [inputFields] Action inputFields - * @property {Array.|null} [outputFields] Action outputFields - */ - - /** - * Constructs a new Action. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an Action. - * @implements IAction - * @constructor - * @param {google.cloud.ces.v1.IAction=} [properties] Properties to set - */ - function Action(properties) { - this.inputFields = []; - this.outputFields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Action connectionActionId. - * @member {string|null|undefined} connectionActionId - * @memberof google.cloud.ces.v1.Action - * @instance - */ - Action.prototype.connectionActionId = null; - - /** - * Action entityOperation. - * @member {google.cloud.ces.v1.Action.IEntityOperation|null|undefined} entityOperation - * @memberof google.cloud.ces.v1.Action - * @instance - */ - Action.prototype.entityOperation = null; - - /** - * Action inputFields. - * @member {Array.} inputFields - * @memberof google.cloud.ces.v1.Action - * @instance - */ - Action.prototype.inputFields = $util.emptyArray; - - /** - * Action outputFields. - * @member {Array.} outputFields - * @memberof google.cloud.ces.v1.Action - * @instance - */ - Action.prototype.outputFields = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Action actionSpec. - * @member {"connectionActionId"|"entityOperation"|undefined} actionSpec - * @memberof google.cloud.ces.v1.Action - * @instance - */ - Object.defineProperty(Action.prototype, "actionSpec", { - get: $util.oneOfGetter($oneOfFields = ["connectionActionId", "entityOperation"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Action instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Action - * @static - * @param {google.cloud.ces.v1.IAction=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Action} Action instance - */ - Action.create = function create(properties) { - return new Action(properties); - }; - - /** - * Encodes the specified Action message. Does not implicitly {@link google.cloud.ces.v1.Action.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Action - * @static - * @param {google.cloud.ces.v1.IAction} message Action message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Action.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputFields != null && message.inputFields.length) - for (var i = 0; i < message.inputFields.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputFields[i]); - if (message.outputFields != null && message.outputFields.length) - for (var i = 0; i < message.outputFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputFields[i]); - if (message.connectionActionId != null && Object.hasOwnProperty.call(message, "connectionActionId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.connectionActionId); - if (message.entityOperation != null && Object.hasOwnProperty.call(message, "entityOperation")) - $root.google.cloud.ces.v1.Action.EntityOperation.encode(message.entityOperation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Action.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Action - * @static - * @param {google.cloud.ces.v1.IAction} message Action message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Action.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Action message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Action - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Action} Action - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Action.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Action(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.connectionActionId = reader.string(); - break; - } - case 5: { - message.entityOperation = $root.google.cloud.ces.v1.Action.EntityOperation.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.inputFields && message.inputFields.length)) - message.inputFields = []; - message.inputFields.push(reader.string()); - break; - } - case 3: { - if (!(message.outputFields && message.outputFields.length)) - message.outputFields = []; - message.outputFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Action message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Action - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Action} Action - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Action.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Action message. - * @function verify - * @memberof google.cloud.ces.v1.Action - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Action.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.connectionActionId != null && message.hasOwnProperty("connectionActionId")) { - properties.actionSpec = 1; - if (!$util.isString(message.connectionActionId)) - return "connectionActionId: string expected"; - } - if (message.entityOperation != null && message.hasOwnProperty("entityOperation")) { - if (properties.actionSpec === 1) - return "actionSpec: multiple values"; - properties.actionSpec = 1; - { - var error = $root.google.cloud.ces.v1.Action.EntityOperation.verify(message.entityOperation); - if (error) - return "entityOperation." + error; - } - } - if (message.inputFields != null && message.hasOwnProperty("inputFields")) { - if (!Array.isArray(message.inputFields)) - return "inputFields: array expected"; - for (var i = 0; i < message.inputFields.length; ++i) - if (!$util.isString(message.inputFields[i])) - return "inputFields: string[] expected"; - } - if (message.outputFields != null && message.hasOwnProperty("outputFields")) { - if (!Array.isArray(message.outputFields)) - return "outputFields: array expected"; - for (var i = 0; i < message.outputFields.length; ++i) - if (!$util.isString(message.outputFields[i])) - return "outputFields: string[] expected"; - } - return null; - }; - - /** - * Creates an Action message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Action - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Action} Action - */ - Action.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Action) - return object; - var message = new $root.google.cloud.ces.v1.Action(); - if (object.connectionActionId != null) - message.connectionActionId = String(object.connectionActionId); - if (object.entityOperation != null) { - if (typeof object.entityOperation !== "object") - throw TypeError(".google.cloud.ces.v1.Action.entityOperation: object expected"); - message.entityOperation = $root.google.cloud.ces.v1.Action.EntityOperation.fromObject(object.entityOperation); - } - if (object.inputFields) { - if (!Array.isArray(object.inputFields)) - throw TypeError(".google.cloud.ces.v1.Action.inputFields: array expected"); - message.inputFields = []; - for (var i = 0; i < object.inputFields.length; ++i) - message.inputFields[i] = String(object.inputFields[i]); - } - if (object.outputFields) { - if (!Array.isArray(object.outputFields)) - throw TypeError(".google.cloud.ces.v1.Action.outputFields: array expected"); - message.outputFields = []; - for (var i = 0; i < object.outputFields.length; ++i) - message.outputFields[i] = String(object.outputFields[i]); - } - return message; - }; - - /** - * Creates a plain object from an Action message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Action - * @static - * @param {google.cloud.ces.v1.Action} message Action - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Action.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.inputFields = []; - object.outputFields = []; - } - if (message.inputFields && message.inputFields.length) { - object.inputFields = []; - for (var j = 0; j < message.inputFields.length; ++j) - object.inputFields[j] = message.inputFields[j]; - } - if (message.outputFields && message.outputFields.length) { - object.outputFields = []; - for (var j = 0; j < message.outputFields.length; ++j) - object.outputFields[j] = message.outputFields[j]; - } - if (message.connectionActionId != null && message.hasOwnProperty("connectionActionId")) { - object.connectionActionId = message.connectionActionId; - if (options.oneofs) - object.actionSpec = "connectionActionId"; - } - if (message.entityOperation != null && message.hasOwnProperty("entityOperation")) { - object.entityOperation = $root.google.cloud.ces.v1.Action.EntityOperation.toObject(message.entityOperation, options); - if (options.oneofs) - object.actionSpec = "entityOperation"; - } - return object; - }; - - /** - * Converts this Action to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Action - * @instance - * @returns {Object.} JSON object - */ - Action.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Action - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Action - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Action.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Action"; - }; - - Action.EntityOperation = (function() { - - /** - * Properties of an EntityOperation. - * @memberof google.cloud.ces.v1.Action - * @interface IEntityOperation - * @property {string|null} [entityId] EntityOperation entityId - * @property {google.cloud.ces.v1.Action.EntityOperation.OperationType|null} [operation] EntityOperation operation - */ - - /** - * Constructs a new EntityOperation. - * @memberof google.cloud.ces.v1.Action - * @classdesc Represents an EntityOperation. - * @implements IEntityOperation - * @constructor - * @param {google.cloud.ces.v1.Action.IEntityOperation=} [properties] Properties to set - */ - function EntityOperation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EntityOperation entityId. - * @member {string} entityId - * @memberof google.cloud.ces.v1.Action.EntityOperation - * @instance - */ - EntityOperation.prototype.entityId = ""; - - /** - * EntityOperation operation. - * @member {google.cloud.ces.v1.Action.EntityOperation.OperationType} operation - * @memberof google.cloud.ces.v1.Action.EntityOperation - * @instance - */ - EntityOperation.prototype.operation = 0; - - /** - * Creates a new EntityOperation instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Action.EntityOperation - * @static - * @param {google.cloud.ces.v1.Action.IEntityOperation=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Action.EntityOperation} EntityOperation instance - */ - EntityOperation.create = function create(properties) { - return new EntityOperation(properties); - }; - - /** - * Encodes the specified EntityOperation message. Does not implicitly {@link google.cloud.ces.v1.Action.EntityOperation.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Action.EntityOperation - * @static - * @param {google.cloud.ces.v1.Action.IEntityOperation} message EntityOperation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityOperation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityId); - if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.operation); - return writer; - }; - - /** - * Encodes the specified EntityOperation message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Action.EntityOperation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Action.EntityOperation - * @static - * @param {google.cloud.ces.v1.Action.IEntityOperation} message EntityOperation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityOperation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EntityOperation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Action.EntityOperation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Action.EntityOperation} EntityOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityOperation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Action.EntityOperation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.entityId = reader.string(); - break; - } - case 2: { - message.operation = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EntityOperation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Action.EntityOperation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Action.EntityOperation} EntityOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityOperation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EntityOperation message. - * @function verify - * @memberof google.cloud.ces.v1.Action.EntityOperation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EntityOperation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.entityId != null && message.hasOwnProperty("entityId")) - if (!$util.isString(message.entityId)) - return "entityId: string expected"; - if (message.operation != null && message.hasOwnProperty("operation")) - switch (message.operation) { - default: - return "operation: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - return null; - }; - - /** - * Creates an EntityOperation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Action.EntityOperation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Action.EntityOperation} EntityOperation - */ - EntityOperation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Action.EntityOperation) - return object; - var message = new $root.google.cloud.ces.v1.Action.EntityOperation(); - if (object.entityId != null) - message.entityId = String(object.entityId); - switch (object.operation) { - default: - if (typeof object.operation === "number") { - message.operation = object.operation; - break; - } - break; - case "OPERATION_TYPE_UNSPECIFIED": - case 0: - message.operation = 0; - break; - case "LIST": - case 1: - message.operation = 1; - break; - case "GET": - case 2: - message.operation = 2; - break; - case "CREATE": - case 3: - message.operation = 3; - break; - case "UPDATE": - case 4: - message.operation = 4; - break; - case "DELETE": - case 5: - message.operation = 5; - break; - } - return message; - }; - - /** - * Creates a plain object from an EntityOperation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Action.EntityOperation - * @static - * @param {google.cloud.ces.v1.Action.EntityOperation} message EntityOperation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EntityOperation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.entityId = ""; - object.operation = options.enums === String ? "OPERATION_TYPE_UNSPECIFIED" : 0; - } - if (message.entityId != null && message.hasOwnProperty("entityId")) - object.entityId = message.entityId; - if (message.operation != null && message.hasOwnProperty("operation")) - object.operation = options.enums === String ? $root.google.cloud.ces.v1.Action.EntityOperation.OperationType[message.operation] === undefined ? message.operation : $root.google.cloud.ces.v1.Action.EntityOperation.OperationType[message.operation] : message.operation; - return object; - }; - - /** - * Converts this EntityOperation to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Action.EntityOperation - * @instance - * @returns {Object.} JSON object - */ - EntityOperation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EntityOperation - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Action.EntityOperation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EntityOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Action.EntityOperation"; - }; - - /** - * OperationType enum. - * @name google.cloud.ces.v1.Action.EntityOperation.OperationType - * @enum {number} - * @property {number} OPERATION_TYPE_UNSPECIFIED=0 OPERATION_TYPE_UNSPECIFIED value - * @property {number} LIST=1 LIST value - * @property {number} GET=2 GET value - * @property {number} CREATE=3 CREATE value - * @property {number} UPDATE=4 UPDATE value - * @property {number} DELETE=5 DELETE value - */ - EntityOperation.OperationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OPERATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "LIST"] = 1; - values[valuesById[2] = "GET"] = 2; - values[valuesById[3] = "CREATE"] = 3; - values[valuesById[4] = "UPDATE"] = 4; - values[valuesById[5] = "DELETE"] = 5; - return values; - })(); - - return EntityOperation; - })(); - - return Action; - })(); - - v1.ConnectorTool = (function() { - - /** - * Properties of a ConnectorTool. - * @memberof google.cloud.ces.v1 - * @interface IConnectorTool - * @property {string|null} [connection] ConnectorTool connection - * @property {google.cloud.ces.v1.IAction|null} [action] ConnectorTool action - * @property {google.cloud.ces.v1.IEndUserAuthConfig|null} [authConfig] ConnectorTool authConfig - * @property {string|null} [name] ConnectorTool name - * @property {string|null} [description] ConnectorTool description - */ - - /** - * Constructs a new ConnectorTool. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ConnectorTool. - * @implements IConnectorTool - * @constructor - * @param {google.cloud.ces.v1.IConnectorTool=} [properties] Properties to set - */ - function ConnectorTool(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectorTool connection. - * @member {string} connection - * @memberof google.cloud.ces.v1.ConnectorTool - * @instance - */ - ConnectorTool.prototype.connection = ""; - - /** - * ConnectorTool action. - * @member {google.cloud.ces.v1.IAction|null|undefined} action - * @memberof google.cloud.ces.v1.ConnectorTool - * @instance - */ - ConnectorTool.prototype.action = null; - - /** - * ConnectorTool authConfig. - * @member {google.cloud.ces.v1.IEndUserAuthConfig|null|undefined} authConfig - * @memberof google.cloud.ces.v1.ConnectorTool - * @instance - */ - ConnectorTool.prototype.authConfig = null; - - /** - * ConnectorTool name. - * @member {string} name - * @memberof google.cloud.ces.v1.ConnectorTool - * @instance - */ - ConnectorTool.prototype.name = ""; - - /** - * ConnectorTool description. - * @member {string} description - * @memberof google.cloud.ces.v1.ConnectorTool - * @instance - */ - ConnectorTool.prototype.description = ""; - - /** - * Creates a new ConnectorTool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ConnectorTool - * @static - * @param {google.cloud.ces.v1.IConnectorTool=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ConnectorTool} ConnectorTool instance - */ - ConnectorTool.create = function create(properties) { - return new ConnectorTool(properties); - }; - - /** - * Encodes the specified ConnectorTool message. Does not implicitly {@link google.cloud.ces.v1.ConnectorTool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ConnectorTool - * @static - * @param {google.cloud.ces.v1.IConnectorTool} message ConnectorTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectorTool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - $root.google.cloud.ces.v1.Action.encode(message.action, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.authConfig != null && Object.hasOwnProperty.call(message, "authConfig")) - $root.google.cloud.ces.v1.EndUserAuthConfig.encode(message.authConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); - return writer; - }; - - /** - * Encodes the specified ConnectorTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ConnectorTool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ConnectorTool - * @static - * @param {google.cloud.ces.v1.IConnectorTool} message ConnectorTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectorTool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectorTool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ConnectorTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ConnectorTool} ConnectorTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectorTool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ConnectorTool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.connection = reader.string(); - break; - } - case 2: { - message.action = $root.google.cloud.ces.v1.Action.decode(reader, reader.uint32()); - break; - } - case 3: { - message.authConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.name = reader.string(); - break; - } - case 5: { - message.description = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectorTool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ConnectorTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ConnectorTool} ConnectorTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectorTool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectorTool message. - * @function verify - * @memberof google.cloud.ces.v1.ConnectorTool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectorTool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection != null && message.hasOwnProperty("connection")) - if (!$util.isString(message.connection)) - return "connection: string expected"; - if (message.action != null && message.hasOwnProperty("action")) { - var error = $root.google.cloud.ces.v1.Action.verify(message.action); - if (error) - return "action." + error; - } - if (message.authConfig != null && message.hasOwnProperty("authConfig")) { - var error = $root.google.cloud.ces.v1.EndUserAuthConfig.verify(message.authConfig); - if (error) - return "authConfig." + error; - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates a ConnectorTool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ConnectorTool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ConnectorTool} ConnectorTool - */ - ConnectorTool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ConnectorTool) - return object; - var message = new $root.google.cloud.ces.v1.ConnectorTool(); - if (object.connection != null) - message.connection = String(object.connection); - if (object.action != null) { - if (typeof object.action !== "object") - throw TypeError(".google.cloud.ces.v1.ConnectorTool.action: object expected"); - message.action = $root.google.cloud.ces.v1.Action.fromObject(object.action); - } - if (object.authConfig != null) { - if (typeof object.authConfig !== "object") - throw TypeError(".google.cloud.ces.v1.ConnectorTool.authConfig: object expected"); - message.authConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.fromObject(object.authConfig); - } - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from a ConnectorTool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ConnectorTool - * @static - * @param {google.cloud.ces.v1.ConnectorTool} message ConnectorTool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectorTool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.connection = ""; - object.action = null; - object.authConfig = null; - object.name = ""; - object.description = ""; - } - if (message.connection != null && message.hasOwnProperty("connection")) - object.connection = message.connection; - if (message.action != null && message.hasOwnProperty("action")) - object.action = $root.google.cloud.ces.v1.Action.toObject(message.action, options); - if (message.authConfig != null && message.hasOwnProperty("authConfig")) - object.authConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.toObject(message.authConfig, options); - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this ConnectorTool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ConnectorTool - * @instance - * @returns {Object.} JSON object - */ - ConnectorTool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConnectorTool - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ConnectorTool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConnectorTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ConnectorTool"; - }; - - return ConnectorTool; - })(); - - v1.ApiKeyConfig = (function() { - - /** - * Properties of an ApiKeyConfig. - * @memberof google.cloud.ces.v1 - * @interface IApiKeyConfig - * @property {string|null} [keyName] ApiKeyConfig keyName - * @property {string|null} [apiKeySecretVersion] ApiKeyConfig apiKeySecretVersion - * @property {google.cloud.ces.v1.ApiKeyConfig.RequestLocation|null} [requestLocation] ApiKeyConfig requestLocation - */ - - /** - * Constructs a new ApiKeyConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an ApiKeyConfig. - * @implements IApiKeyConfig - * @constructor - * @param {google.cloud.ces.v1.IApiKeyConfig=} [properties] Properties to set - */ - function ApiKeyConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ApiKeyConfig keyName. - * @member {string} keyName - * @memberof google.cloud.ces.v1.ApiKeyConfig - * @instance - */ - ApiKeyConfig.prototype.keyName = ""; - - /** - * ApiKeyConfig apiKeySecretVersion. - * @member {string} apiKeySecretVersion - * @memberof google.cloud.ces.v1.ApiKeyConfig - * @instance - */ - ApiKeyConfig.prototype.apiKeySecretVersion = ""; - - /** - * ApiKeyConfig requestLocation. - * @member {google.cloud.ces.v1.ApiKeyConfig.RequestLocation} requestLocation - * @memberof google.cloud.ces.v1.ApiKeyConfig - * @instance - */ - ApiKeyConfig.prototype.requestLocation = 0; - - /** - * Creates a new ApiKeyConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ApiKeyConfig - * @static - * @param {google.cloud.ces.v1.IApiKeyConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ApiKeyConfig} ApiKeyConfig instance - */ - ApiKeyConfig.create = function create(properties) { - return new ApiKeyConfig(properties); - }; - - /** - * Encodes the specified ApiKeyConfig message. Does not implicitly {@link google.cloud.ces.v1.ApiKeyConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ApiKeyConfig - * @static - * @param {google.cloud.ces.v1.IApiKeyConfig} message ApiKeyConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ApiKeyConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keyName != null && Object.hasOwnProperty.call(message, "keyName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyName); - if (message.apiKeySecretVersion != null && Object.hasOwnProperty.call(message, "apiKeySecretVersion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.apiKeySecretVersion); - if (message.requestLocation != null && Object.hasOwnProperty.call(message, "requestLocation")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.requestLocation); - return writer; - }; - - /** - * Encodes the specified ApiKeyConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ApiKeyConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ApiKeyConfig - * @static - * @param {google.cloud.ces.v1.IApiKeyConfig} message ApiKeyConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ApiKeyConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ApiKeyConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ApiKeyConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ApiKeyConfig} ApiKeyConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ApiKeyConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ApiKeyConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.keyName = reader.string(); - break; - } - case 2: { - message.apiKeySecretVersion = reader.string(); - break; - } - case 3: { - message.requestLocation = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ApiKeyConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ApiKeyConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ApiKeyConfig} ApiKeyConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ApiKeyConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ApiKeyConfig message. - * @function verify - * @memberof google.cloud.ces.v1.ApiKeyConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ApiKeyConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keyName != null && message.hasOwnProperty("keyName")) - if (!$util.isString(message.keyName)) - return "keyName: string expected"; - if (message.apiKeySecretVersion != null && message.hasOwnProperty("apiKeySecretVersion")) - if (!$util.isString(message.apiKeySecretVersion)) - return "apiKeySecretVersion: string expected"; - if (message.requestLocation != null && message.hasOwnProperty("requestLocation")) - switch (message.requestLocation) { - default: - return "requestLocation: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an ApiKeyConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ApiKeyConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ApiKeyConfig} ApiKeyConfig - */ - ApiKeyConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ApiKeyConfig) - return object; - var message = new $root.google.cloud.ces.v1.ApiKeyConfig(); - if (object.keyName != null) - message.keyName = String(object.keyName); - if (object.apiKeySecretVersion != null) - message.apiKeySecretVersion = String(object.apiKeySecretVersion); - switch (object.requestLocation) { - default: - if (typeof object.requestLocation === "number") { - message.requestLocation = object.requestLocation; - break; - } - break; - case "REQUEST_LOCATION_UNSPECIFIED": - case 0: - message.requestLocation = 0; - break; - case "HEADER": - case 1: - message.requestLocation = 1; - break; - case "QUERY_STRING": - case 2: - message.requestLocation = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an ApiKeyConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ApiKeyConfig - * @static - * @param {google.cloud.ces.v1.ApiKeyConfig} message ApiKeyConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ApiKeyConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.keyName = ""; - object.apiKeySecretVersion = ""; - object.requestLocation = options.enums === String ? "REQUEST_LOCATION_UNSPECIFIED" : 0; - } - if (message.keyName != null && message.hasOwnProperty("keyName")) - object.keyName = message.keyName; - if (message.apiKeySecretVersion != null && message.hasOwnProperty("apiKeySecretVersion")) - object.apiKeySecretVersion = message.apiKeySecretVersion; - if (message.requestLocation != null && message.hasOwnProperty("requestLocation")) - object.requestLocation = options.enums === String ? $root.google.cloud.ces.v1.ApiKeyConfig.RequestLocation[message.requestLocation] === undefined ? message.requestLocation : $root.google.cloud.ces.v1.ApiKeyConfig.RequestLocation[message.requestLocation] : message.requestLocation; - return object; - }; - - /** - * Converts this ApiKeyConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ApiKeyConfig - * @instance - * @returns {Object.} JSON object - */ - ApiKeyConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ApiKeyConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ApiKeyConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ApiKeyConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ApiKeyConfig"; - }; - - /** - * RequestLocation enum. - * @name google.cloud.ces.v1.ApiKeyConfig.RequestLocation - * @enum {number} - * @property {number} REQUEST_LOCATION_UNSPECIFIED=0 REQUEST_LOCATION_UNSPECIFIED value - * @property {number} HEADER=1 HEADER value - * @property {number} QUERY_STRING=2 QUERY_STRING value - */ - ApiKeyConfig.RequestLocation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REQUEST_LOCATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "HEADER"] = 1; - values[valuesById[2] = "QUERY_STRING"] = 2; - return values; - })(); - - return ApiKeyConfig; - })(); - - v1.OAuthConfig = (function() { - - /** - * Properties of a OAuthConfig. - * @memberof google.cloud.ces.v1 - * @interface IOAuthConfig - * @property {google.cloud.ces.v1.OAuthConfig.OauthGrantType|null} [oauthGrantType] OAuthConfig oauthGrantType - * @property {string|null} [clientId] OAuthConfig clientId - * @property {string|null} [clientSecretVersion] OAuthConfig clientSecretVersion - * @property {string|null} [tokenEndpoint] OAuthConfig tokenEndpoint - * @property {Array.|null} [scopes] OAuthConfig scopes - */ - - /** - * Constructs a new OAuthConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a OAuthConfig. - * @implements IOAuthConfig - * @constructor - * @param {google.cloud.ces.v1.IOAuthConfig=} [properties] Properties to set - */ - function OAuthConfig(properties) { - this.scopes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OAuthConfig oauthGrantType. - * @member {google.cloud.ces.v1.OAuthConfig.OauthGrantType} oauthGrantType - * @memberof google.cloud.ces.v1.OAuthConfig - * @instance - */ - OAuthConfig.prototype.oauthGrantType = 0; - - /** - * OAuthConfig clientId. - * @member {string} clientId - * @memberof google.cloud.ces.v1.OAuthConfig - * @instance - */ - OAuthConfig.prototype.clientId = ""; - - /** - * OAuthConfig clientSecretVersion. - * @member {string} clientSecretVersion - * @memberof google.cloud.ces.v1.OAuthConfig - * @instance - */ - OAuthConfig.prototype.clientSecretVersion = ""; - - /** - * OAuthConfig tokenEndpoint. - * @member {string} tokenEndpoint - * @memberof google.cloud.ces.v1.OAuthConfig - * @instance - */ - OAuthConfig.prototype.tokenEndpoint = ""; - - /** - * OAuthConfig scopes. - * @member {Array.} scopes - * @memberof google.cloud.ces.v1.OAuthConfig - * @instance - */ - OAuthConfig.prototype.scopes = $util.emptyArray; - - /** - * Creates a new OAuthConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.OAuthConfig - * @static - * @param {google.cloud.ces.v1.IOAuthConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.OAuthConfig} OAuthConfig instance - */ - OAuthConfig.create = function create(properties) { - return new OAuthConfig(properties); - }; - - /** - * Encodes the specified OAuthConfig message. Does not implicitly {@link google.cloud.ces.v1.OAuthConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.OAuthConfig - * @static - * @param {google.cloud.ces.v1.IOAuthConfig} message OAuthConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OAuthConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.oauthGrantType != null && Object.hasOwnProperty.call(message, "oauthGrantType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.oauthGrantType); - if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientId); - if (message.clientSecretVersion != null && Object.hasOwnProperty.call(message, "clientSecretVersion")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientSecretVersion); - if (message.tokenEndpoint != null && Object.hasOwnProperty.call(message, "tokenEndpoint")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.tokenEndpoint); - if (message.scopes != null && message.scopes.length) - for (var i = 0; i < message.scopes.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.scopes[i]); - return writer; - }; - - /** - * Encodes the specified OAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OAuthConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.OAuthConfig - * @static - * @param {google.cloud.ces.v1.IOAuthConfig} message OAuthConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a OAuthConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.OAuthConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.OAuthConfig} OAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OAuthConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OAuthConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.oauthGrantType = reader.int32(); - break; - } - case 2: { - message.clientId = reader.string(); - break; - } - case 3: { - message.clientSecretVersion = reader.string(); - break; - } - case 4: { - message.tokenEndpoint = reader.string(); - break; - } - case 5: { - if (!(message.scopes && message.scopes.length)) - message.scopes = []; - message.scopes.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a OAuthConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.OAuthConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.OAuthConfig} OAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OAuthConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a OAuthConfig message. - * @function verify - * @memberof google.cloud.ces.v1.OAuthConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OAuthConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.oauthGrantType != null && message.hasOwnProperty("oauthGrantType")) - switch (message.oauthGrantType) { - default: - return "oauthGrantType: enum value expected"; - case 0: - case 1: - break; - } - if (message.clientId != null && message.hasOwnProperty("clientId")) - if (!$util.isString(message.clientId)) - return "clientId: string expected"; - if (message.clientSecretVersion != null && message.hasOwnProperty("clientSecretVersion")) - if (!$util.isString(message.clientSecretVersion)) - return "clientSecretVersion: string expected"; - if (message.tokenEndpoint != null && message.hasOwnProperty("tokenEndpoint")) - if (!$util.isString(message.tokenEndpoint)) - return "tokenEndpoint: string expected"; - if (message.scopes != null && message.hasOwnProperty("scopes")) { - if (!Array.isArray(message.scopes)) - return "scopes: array expected"; - for (var i = 0; i < message.scopes.length; ++i) - if (!$util.isString(message.scopes[i])) - return "scopes: string[] expected"; - } - return null; - }; - - /** - * Creates a OAuthConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.OAuthConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.OAuthConfig} OAuthConfig - */ - OAuthConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.OAuthConfig) - return object; - var message = new $root.google.cloud.ces.v1.OAuthConfig(); - switch (object.oauthGrantType) { - default: - if (typeof object.oauthGrantType === "number") { - message.oauthGrantType = object.oauthGrantType; - break; - } - break; - case "OAUTH_GRANT_TYPE_UNSPECIFIED": - case 0: - message.oauthGrantType = 0; - break; - case "CLIENT_CREDENTIAL": - case 1: - message.oauthGrantType = 1; - break; - } - if (object.clientId != null) - message.clientId = String(object.clientId); - if (object.clientSecretVersion != null) - message.clientSecretVersion = String(object.clientSecretVersion); - if (object.tokenEndpoint != null) - message.tokenEndpoint = String(object.tokenEndpoint); - if (object.scopes) { - if (!Array.isArray(object.scopes)) - throw TypeError(".google.cloud.ces.v1.OAuthConfig.scopes: array expected"); - message.scopes = []; - for (var i = 0; i < object.scopes.length; ++i) - message.scopes[i] = String(object.scopes[i]); - } - return message; - }; - - /** - * Creates a plain object from a OAuthConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.OAuthConfig - * @static - * @param {google.cloud.ces.v1.OAuthConfig} message OAuthConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OAuthConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.scopes = []; - if (options.defaults) { - object.oauthGrantType = options.enums === String ? "OAUTH_GRANT_TYPE_UNSPECIFIED" : 0; - object.clientId = ""; - object.clientSecretVersion = ""; - object.tokenEndpoint = ""; - } - if (message.oauthGrantType != null && message.hasOwnProperty("oauthGrantType")) - object.oauthGrantType = options.enums === String ? $root.google.cloud.ces.v1.OAuthConfig.OauthGrantType[message.oauthGrantType] === undefined ? message.oauthGrantType : $root.google.cloud.ces.v1.OAuthConfig.OauthGrantType[message.oauthGrantType] : message.oauthGrantType; - if (message.clientId != null && message.hasOwnProperty("clientId")) - object.clientId = message.clientId; - if (message.clientSecretVersion != null && message.hasOwnProperty("clientSecretVersion")) - object.clientSecretVersion = message.clientSecretVersion; - if (message.tokenEndpoint != null && message.hasOwnProperty("tokenEndpoint")) - object.tokenEndpoint = message.tokenEndpoint; - if (message.scopes && message.scopes.length) { - object.scopes = []; - for (var j = 0; j < message.scopes.length; ++j) - object.scopes[j] = message.scopes[j]; - } - return object; - }; - - /** - * Converts this OAuthConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.OAuthConfig - * @instance - * @returns {Object.} JSON object - */ - OAuthConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OAuthConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.OAuthConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.OAuthConfig"; - }; - - /** - * OauthGrantType enum. - * @name google.cloud.ces.v1.OAuthConfig.OauthGrantType - * @enum {number} - * @property {number} OAUTH_GRANT_TYPE_UNSPECIFIED=0 OAUTH_GRANT_TYPE_UNSPECIFIED value - * @property {number} CLIENT_CREDENTIAL=1 CLIENT_CREDENTIAL value - */ - OAuthConfig.OauthGrantType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OAUTH_GRANT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLIENT_CREDENTIAL"] = 1; - return values; - })(); - - return OAuthConfig; - })(); - - v1.ServiceAgentIdTokenAuthConfig = (function() { - - /** - * Properties of a ServiceAgentIdTokenAuthConfig. - * @memberof google.cloud.ces.v1 - * @interface IServiceAgentIdTokenAuthConfig - */ - - /** - * Constructs a new ServiceAgentIdTokenAuthConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ServiceAgentIdTokenAuthConfig. - * @implements IServiceAgentIdTokenAuthConfig - * @constructor - * @param {google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig=} [properties] Properties to set - */ - function ServiceAgentIdTokenAuthConfig(properties) { - if (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 ServiceAgentIdTokenAuthConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig - * @static - * @param {google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig instance - */ - ServiceAgentIdTokenAuthConfig.create = function create(properties) { - return new ServiceAgentIdTokenAuthConfig(properties); - }; - - /** - * Encodes the specified ServiceAgentIdTokenAuthConfig message. Does not implicitly {@link google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig - * @static - * @param {google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig} message ServiceAgentIdTokenAuthConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceAgentIdTokenAuthConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified ServiceAgentIdTokenAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig - * @static - * @param {google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig} message ServiceAgentIdTokenAuthConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceAgentIdTokenAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceAgentIdTokenAuthConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceAgentIdTokenAuthConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceAgentIdTokenAuthConfig message. - * @function verify - * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceAgentIdTokenAuthConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a ServiceAgentIdTokenAuthConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig - */ - ServiceAgentIdTokenAuthConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig) - return object; - return new $root.google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig(); - }; - - /** - * Creates a plain object from a ServiceAgentIdTokenAuthConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig - * @static - * @param {google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig} message ServiceAgentIdTokenAuthConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceAgentIdTokenAuthConfig.toObject = function toObject() { - return {}; - }; - - /** - * Converts this ServiceAgentIdTokenAuthConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig - * @instance - * @returns {Object.} JSON object - */ - ServiceAgentIdTokenAuthConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceAgentIdTokenAuthConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceAgentIdTokenAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig"; - }; - - return ServiceAgentIdTokenAuthConfig; - })(); - - v1.ServiceAccountAuthConfig = (function() { - - /** - * Properties of a ServiceAccountAuthConfig. - * @memberof google.cloud.ces.v1 - * @interface IServiceAccountAuthConfig - * @property {string|null} [serviceAccount] ServiceAccountAuthConfig serviceAccount - * @property {Array.|null} [scopes] ServiceAccountAuthConfig scopes - */ - - /** - * Constructs a new ServiceAccountAuthConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ServiceAccountAuthConfig. - * @implements IServiceAccountAuthConfig - * @constructor - * @param {google.cloud.ces.v1.IServiceAccountAuthConfig=} [properties] Properties to set - */ - function ServiceAccountAuthConfig(properties) { - this.scopes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceAccountAuthConfig serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig - * @instance - */ - ServiceAccountAuthConfig.prototype.serviceAccount = ""; - - /** - * ServiceAccountAuthConfig scopes. - * @member {Array.} scopes - * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig - * @instance - */ - ServiceAccountAuthConfig.prototype.scopes = $util.emptyArray; - - /** - * Creates a new ServiceAccountAuthConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig - * @static - * @param {google.cloud.ces.v1.IServiceAccountAuthConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ServiceAccountAuthConfig} ServiceAccountAuthConfig instance - */ - ServiceAccountAuthConfig.create = function create(properties) { - return new ServiceAccountAuthConfig(properties); - }; - - /** - * Encodes the specified ServiceAccountAuthConfig message. Does not implicitly {@link google.cloud.ces.v1.ServiceAccountAuthConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig - * @static - * @param {google.cloud.ces.v1.IServiceAccountAuthConfig} message ServiceAccountAuthConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceAccountAuthConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccount); - if (message.scopes != null && message.scopes.length) - for (var i = 0; i < message.scopes.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); - return writer; - }; - - /** - * Encodes the specified ServiceAccountAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ServiceAccountAuthConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig - * @static - * @param {google.cloud.ces.v1.IServiceAccountAuthConfig} message ServiceAccountAuthConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceAccountAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ServiceAccountAuthConfig} ServiceAccountAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceAccountAuthConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ServiceAccountAuthConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.serviceAccount = reader.string(); - break; - } - case 2: { - if (!(message.scopes && message.scopes.length)) - message.scopes = []; - message.scopes.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ServiceAccountAuthConfig} ServiceAccountAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceAccountAuthConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceAccountAuthConfig message. - * @function verify - * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceAccountAuthConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.scopes != null && message.hasOwnProperty("scopes")) { - if (!Array.isArray(message.scopes)) - return "scopes: array expected"; - for (var i = 0; i < message.scopes.length; ++i) - if (!$util.isString(message.scopes[i])) - return "scopes: string[] expected"; - } - return null; - }; - - /** - * Creates a ServiceAccountAuthConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ServiceAccountAuthConfig} ServiceAccountAuthConfig - */ - ServiceAccountAuthConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ServiceAccountAuthConfig) - return object; - var message = new $root.google.cloud.ces.v1.ServiceAccountAuthConfig(); - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.scopes) { - if (!Array.isArray(object.scopes)) - throw TypeError(".google.cloud.ces.v1.ServiceAccountAuthConfig.scopes: array expected"); - message.scopes = []; - for (var i = 0; i < object.scopes.length; ++i) - message.scopes[i] = String(object.scopes[i]); - } - return message; - }; - - /** - * Creates a plain object from a ServiceAccountAuthConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig - * @static - * @param {google.cloud.ces.v1.ServiceAccountAuthConfig} message ServiceAccountAuthConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceAccountAuthConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.scopes = []; - if (options.defaults) - object.serviceAccount = ""; - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.scopes && message.scopes.length) { - object.scopes = []; - for (var j = 0; j < message.scopes.length; ++j) - object.scopes[j] = message.scopes[j]; - } - return object; - }; - - /** - * Converts this ServiceAccountAuthConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig - * @instance - * @returns {Object.} JSON object - */ - ServiceAccountAuthConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceAccountAuthConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ServiceAccountAuthConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceAccountAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ServiceAccountAuthConfig"; - }; - - return ServiceAccountAuthConfig; - })(); - - v1.BearerTokenConfig = (function() { - - /** - * Properties of a BearerTokenConfig. - * @memberof google.cloud.ces.v1 - * @interface IBearerTokenConfig - * @property {string|null} [token] BearerTokenConfig token - */ - - /** - * Constructs a new BearerTokenConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a BearerTokenConfig. - * @implements IBearerTokenConfig - * @constructor - * @param {google.cloud.ces.v1.IBearerTokenConfig=} [properties] Properties to set - */ - function BearerTokenConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BearerTokenConfig token. - * @member {string} token - * @memberof google.cloud.ces.v1.BearerTokenConfig - * @instance - */ - BearerTokenConfig.prototype.token = ""; - - /** - * Creates a new BearerTokenConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.BearerTokenConfig - * @static - * @param {google.cloud.ces.v1.IBearerTokenConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.BearerTokenConfig} BearerTokenConfig instance - */ - BearerTokenConfig.create = function create(properties) { - return new BearerTokenConfig(properties); - }; - - /** - * Encodes the specified BearerTokenConfig message. Does not implicitly {@link google.cloud.ces.v1.BearerTokenConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.BearerTokenConfig - * @static - * @param {google.cloud.ces.v1.IBearerTokenConfig} message BearerTokenConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BearerTokenConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.token != null && Object.hasOwnProperty.call(message, "token")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); - return writer; - }; - - /** - * Encodes the specified BearerTokenConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BearerTokenConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.BearerTokenConfig - * @static - * @param {google.cloud.ces.v1.IBearerTokenConfig} message BearerTokenConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BearerTokenConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BearerTokenConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.BearerTokenConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.BearerTokenConfig} BearerTokenConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BearerTokenConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.BearerTokenConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.token = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BearerTokenConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.BearerTokenConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.BearerTokenConfig} BearerTokenConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BearerTokenConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BearerTokenConfig message. - * @function verify - * @memberof google.cloud.ces.v1.BearerTokenConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BearerTokenConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.token != null && message.hasOwnProperty("token")) - if (!$util.isString(message.token)) - return "token: string expected"; - return null; - }; - - /** - * Creates a BearerTokenConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.BearerTokenConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.BearerTokenConfig} BearerTokenConfig - */ - BearerTokenConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.BearerTokenConfig) - return object; - var message = new $root.google.cloud.ces.v1.BearerTokenConfig(); - if (object.token != null) - message.token = String(object.token); - return message; - }; - - /** - * Creates a plain object from a BearerTokenConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.BearerTokenConfig - * @static - * @param {google.cloud.ces.v1.BearerTokenConfig} message BearerTokenConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BearerTokenConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.token = ""; - if (message.token != null && message.hasOwnProperty("token")) - object.token = message.token; - return object; - }; - - /** - * Converts this BearerTokenConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.BearerTokenConfig - * @instance - * @returns {Object.} JSON object - */ - BearerTokenConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BearerTokenConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.BearerTokenConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BearerTokenConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.BearerTokenConfig"; - }; - - return BearerTokenConfig; - })(); - - v1.EndUserAuthConfig = (function() { - - /** - * Properties of an EndUserAuthConfig. - * @memberof google.cloud.ces.v1 - * @interface IEndUserAuthConfig - * @property {google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig|null} [oauth2AuthCodeConfig] EndUserAuthConfig oauth2AuthCodeConfig - * @property {google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig|null} [oauth2JwtBearerConfig] EndUserAuthConfig oauth2JwtBearerConfig - */ - - /** - * Constructs a new EndUserAuthConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an EndUserAuthConfig. - * @implements IEndUserAuthConfig - * @constructor - * @param {google.cloud.ces.v1.IEndUserAuthConfig=} [properties] Properties to set - */ - function EndUserAuthConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EndUserAuthConfig oauth2AuthCodeConfig. - * @member {google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig|null|undefined} oauth2AuthCodeConfig - * @memberof google.cloud.ces.v1.EndUserAuthConfig - * @instance - */ - EndUserAuthConfig.prototype.oauth2AuthCodeConfig = null; - - /** - * EndUserAuthConfig oauth2JwtBearerConfig. - * @member {google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig|null|undefined} oauth2JwtBearerConfig - * @memberof google.cloud.ces.v1.EndUserAuthConfig - * @instance - */ - EndUserAuthConfig.prototype.oauth2JwtBearerConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * EndUserAuthConfig authConfig. - * @member {"oauth2AuthCodeConfig"|"oauth2JwtBearerConfig"|undefined} authConfig - * @memberof google.cloud.ces.v1.EndUserAuthConfig - * @instance - */ - Object.defineProperty(EndUserAuthConfig.prototype, "authConfig", { - get: $util.oneOfGetter($oneOfFields = ["oauth2AuthCodeConfig", "oauth2JwtBearerConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new EndUserAuthConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.EndUserAuthConfig - * @static - * @param {google.cloud.ces.v1.IEndUserAuthConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.EndUserAuthConfig} EndUserAuthConfig instance - */ - EndUserAuthConfig.create = function create(properties) { - return new EndUserAuthConfig(properties); - }; - - /** - * Encodes the specified EndUserAuthConfig message. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.EndUserAuthConfig - * @static - * @param {google.cloud.ces.v1.IEndUserAuthConfig} message EndUserAuthConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EndUserAuthConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.oauth2AuthCodeConfig != null && Object.hasOwnProperty.call(message, "oauth2AuthCodeConfig")) - $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig.encode(message.oauth2AuthCodeConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.oauth2JwtBearerConfig != null && Object.hasOwnProperty.call(message, "oauth2JwtBearerConfig")) - $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig.encode(message.oauth2JwtBearerConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EndUserAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.EndUserAuthConfig - * @static - * @param {google.cloud.ces.v1.IEndUserAuthConfig} message EndUserAuthConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EndUserAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EndUserAuthConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.EndUserAuthConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.EndUserAuthConfig} EndUserAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EndUserAuthConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.EndUserAuthConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.oauth2AuthCodeConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.oauth2JwtBearerConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EndUserAuthConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.EndUserAuthConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.EndUserAuthConfig} EndUserAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EndUserAuthConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EndUserAuthConfig message. - * @function verify - * @memberof google.cloud.ces.v1.EndUserAuthConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EndUserAuthConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.oauth2AuthCodeConfig != null && message.hasOwnProperty("oauth2AuthCodeConfig")) { - properties.authConfig = 1; - { - var error = $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig.verify(message.oauth2AuthCodeConfig); - if (error) - return "oauth2AuthCodeConfig." + error; - } - } - if (message.oauth2JwtBearerConfig != null && message.hasOwnProperty("oauth2JwtBearerConfig")) { - if (properties.authConfig === 1) - return "authConfig: multiple values"; - properties.authConfig = 1; - { - var error = $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig.verify(message.oauth2JwtBearerConfig); - if (error) - return "oauth2JwtBearerConfig." + error; - } - } - return null; - }; - - /** - * Creates an EndUserAuthConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.EndUserAuthConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.EndUserAuthConfig} EndUserAuthConfig - */ - EndUserAuthConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.EndUserAuthConfig) - return object; - var message = new $root.google.cloud.ces.v1.EndUserAuthConfig(); - if (object.oauth2AuthCodeConfig != null) { - if (typeof object.oauth2AuthCodeConfig !== "object") - throw TypeError(".google.cloud.ces.v1.EndUserAuthConfig.oauth2AuthCodeConfig: object expected"); - message.oauth2AuthCodeConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig.fromObject(object.oauth2AuthCodeConfig); - } - if (object.oauth2JwtBearerConfig != null) { - if (typeof object.oauth2JwtBearerConfig !== "object") - throw TypeError(".google.cloud.ces.v1.EndUserAuthConfig.oauth2JwtBearerConfig: object expected"); - message.oauth2JwtBearerConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig.fromObject(object.oauth2JwtBearerConfig); - } - return message; - }; - - /** - * Creates a plain object from an EndUserAuthConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.EndUserAuthConfig - * @static - * @param {google.cloud.ces.v1.EndUserAuthConfig} message EndUserAuthConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EndUserAuthConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.oauth2AuthCodeConfig != null && message.hasOwnProperty("oauth2AuthCodeConfig")) { - object.oauth2AuthCodeConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig.toObject(message.oauth2AuthCodeConfig, options); - if (options.oneofs) - object.authConfig = "oauth2AuthCodeConfig"; - } - if (message.oauth2JwtBearerConfig != null && message.hasOwnProperty("oauth2JwtBearerConfig")) { - object.oauth2JwtBearerConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig.toObject(message.oauth2JwtBearerConfig, options); - if (options.oneofs) - object.authConfig = "oauth2JwtBearerConfig"; - } - return object; - }; - - /** - * Converts this EndUserAuthConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.EndUserAuthConfig - * @instance - * @returns {Object.} JSON object - */ - EndUserAuthConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EndUserAuthConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.EndUserAuthConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EndUserAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.EndUserAuthConfig"; - }; - - EndUserAuthConfig.Oauth2AuthCodeConfig = (function() { - - /** - * Properties of an Oauth2AuthCodeConfig. - * @memberof google.cloud.ces.v1.EndUserAuthConfig - * @interface IOauth2AuthCodeConfig - * @property {string|null} [oauthToken] Oauth2AuthCodeConfig oauthToken - */ - - /** - * Constructs a new Oauth2AuthCodeConfig. - * @memberof google.cloud.ces.v1.EndUserAuthConfig - * @classdesc Represents an Oauth2AuthCodeConfig. - * @implements IOauth2AuthCodeConfig - * @constructor - * @param {google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig=} [properties] Properties to set - */ - function Oauth2AuthCodeConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Oauth2AuthCodeConfig oauthToken. - * @member {string} oauthToken - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig - * @instance - */ - Oauth2AuthCodeConfig.prototype.oauthToken = ""; - - /** - * Creates a new Oauth2AuthCodeConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig - * @static - * @param {google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig instance - */ - Oauth2AuthCodeConfig.create = function create(properties) { - return new Oauth2AuthCodeConfig(properties); - }; - - /** - * Encodes the specified Oauth2AuthCodeConfig message. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig - * @static - * @param {google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig} message Oauth2AuthCodeConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Oauth2AuthCodeConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.oauthToken != null && Object.hasOwnProperty.call(message, "oauthToken")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.oauthToken); - return writer; - }; - - /** - * Encodes the specified Oauth2AuthCodeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig - * @static - * @param {google.cloud.ces.v1.EndUserAuthConfig.IOauth2AuthCodeConfig} message Oauth2AuthCodeConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Oauth2AuthCodeConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Oauth2AuthCodeConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.oauthToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Oauth2AuthCodeConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Oauth2AuthCodeConfig message. - * @function verify - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Oauth2AuthCodeConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.oauthToken != null && message.hasOwnProperty("oauthToken")) - if (!$util.isString(message.oauthToken)) - return "oauthToken: string expected"; - return null; - }; - - /** - * Creates an Oauth2AuthCodeConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig - */ - Oauth2AuthCodeConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig) - return object; - var message = new $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig(); - if (object.oauthToken != null) - message.oauthToken = String(object.oauthToken); - return message; - }; - - /** - * Creates a plain object from an Oauth2AuthCodeConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig - * @static - * @param {google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig} message Oauth2AuthCodeConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Oauth2AuthCodeConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.oauthToken = ""; - if (message.oauthToken != null && message.hasOwnProperty("oauthToken")) - object.oauthToken = message.oauthToken; - return object; - }; - - /** - * Converts this Oauth2AuthCodeConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig - * @instance - * @returns {Object.} JSON object - */ - Oauth2AuthCodeConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Oauth2AuthCodeConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Oauth2AuthCodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.EndUserAuthConfig.Oauth2AuthCodeConfig"; - }; - - return Oauth2AuthCodeConfig; - })(); - - EndUserAuthConfig.Oauth2JwtBearerConfig = (function() { - - /** - * Properties of an Oauth2JwtBearerConfig. - * @memberof google.cloud.ces.v1.EndUserAuthConfig - * @interface IOauth2JwtBearerConfig - * @property {string|null} [issuer] Oauth2JwtBearerConfig issuer - * @property {string|null} [subject] Oauth2JwtBearerConfig subject - * @property {string|null} [clientKey] Oauth2JwtBearerConfig clientKey - */ - - /** - * Constructs a new Oauth2JwtBearerConfig. - * @memberof google.cloud.ces.v1.EndUserAuthConfig - * @classdesc Represents an Oauth2JwtBearerConfig. - * @implements IOauth2JwtBearerConfig - * @constructor - * @param {google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig=} [properties] Properties to set - */ - function Oauth2JwtBearerConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Oauth2JwtBearerConfig issuer. - * @member {string} issuer - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig - * @instance - */ - Oauth2JwtBearerConfig.prototype.issuer = ""; - - /** - * Oauth2JwtBearerConfig subject. - * @member {string} subject - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig - * @instance - */ - Oauth2JwtBearerConfig.prototype.subject = ""; - - /** - * Oauth2JwtBearerConfig clientKey. - * @member {string} clientKey - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig - * @instance - */ - Oauth2JwtBearerConfig.prototype.clientKey = ""; - - /** - * Creates a new Oauth2JwtBearerConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig - * @static - * @param {google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig instance - */ - Oauth2JwtBearerConfig.create = function create(properties) { - return new Oauth2JwtBearerConfig(properties); - }; - - /** - * Encodes the specified Oauth2JwtBearerConfig message. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig - * @static - * @param {google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig} message Oauth2JwtBearerConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Oauth2JwtBearerConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.issuer != null && Object.hasOwnProperty.call(message, "issuer")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.issuer); - if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subject); - if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientKey); - return writer; - }; - - /** - * Encodes the specified Oauth2JwtBearerConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig - * @static - * @param {google.cloud.ces.v1.EndUserAuthConfig.IOauth2JwtBearerConfig} message Oauth2JwtBearerConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Oauth2JwtBearerConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Oauth2JwtBearerConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.issuer = reader.string(); - break; - } - case 2: { - message.subject = reader.string(); - break; - } - case 3: { - message.clientKey = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Oauth2JwtBearerConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Oauth2JwtBearerConfig message. - * @function verify - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Oauth2JwtBearerConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.issuer != null && message.hasOwnProperty("issuer")) - if (!$util.isString(message.issuer)) - return "issuer: string expected"; - if (message.subject != null && message.hasOwnProperty("subject")) - if (!$util.isString(message.subject)) - return "subject: string expected"; - if (message.clientKey != null && message.hasOwnProperty("clientKey")) - if (!$util.isString(message.clientKey)) - return "clientKey: string expected"; - return null; - }; - - /** - * Creates an Oauth2JwtBearerConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig - */ - Oauth2JwtBearerConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig) - return object; - var message = new $root.google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig(); - if (object.issuer != null) - message.issuer = String(object.issuer); - if (object.subject != null) - message.subject = String(object.subject); - if (object.clientKey != null) - message.clientKey = String(object.clientKey); - return message; - }; - - /** - * Creates a plain object from an Oauth2JwtBearerConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig - * @static - * @param {google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig} message Oauth2JwtBearerConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Oauth2JwtBearerConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.issuer = ""; - object.subject = ""; - object.clientKey = ""; - } - if (message.issuer != null && message.hasOwnProperty("issuer")) - object.issuer = message.issuer; - if (message.subject != null && message.hasOwnProperty("subject")) - object.subject = message.subject; - if (message.clientKey != null && message.hasOwnProperty("clientKey")) - object.clientKey = message.clientKey; - return object; - }; - - /** - * Converts this Oauth2JwtBearerConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig - * @instance - * @returns {Object.} JSON object - */ - Oauth2JwtBearerConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Oauth2JwtBearerConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Oauth2JwtBearerConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.EndUserAuthConfig.Oauth2JwtBearerConfig"; - }; - - return Oauth2JwtBearerConfig; - })(); - - return EndUserAuthConfig; - })(); - - v1.ApiAuthentication = (function() { - - /** - * Properties of an ApiAuthentication. - * @memberof google.cloud.ces.v1 - * @interface IApiAuthentication - * @property {google.cloud.ces.v1.IApiKeyConfig|null} [apiKeyConfig] ApiAuthentication apiKeyConfig - * @property {google.cloud.ces.v1.IOAuthConfig|null} [oauthConfig] ApiAuthentication oauthConfig - * @property {google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig|null} [serviceAgentIdTokenAuthConfig] ApiAuthentication serviceAgentIdTokenAuthConfig - * @property {google.cloud.ces.v1.IServiceAccountAuthConfig|null} [serviceAccountAuthConfig] ApiAuthentication serviceAccountAuthConfig - * @property {google.cloud.ces.v1.IBearerTokenConfig|null} [bearerTokenConfig] ApiAuthentication bearerTokenConfig - */ - - /** - * Constructs a new ApiAuthentication. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an ApiAuthentication. - * @implements IApiAuthentication - * @constructor - * @param {google.cloud.ces.v1.IApiAuthentication=} [properties] Properties to set - */ - function ApiAuthentication(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ApiAuthentication apiKeyConfig. - * @member {google.cloud.ces.v1.IApiKeyConfig|null|undefined} apiKeyConfig - * @memberof google.cloud.ces.v1.ApiAuthentication - * @instance - */ - ApiAuthentication.prototype.apiKeyConfig = null; - - /** - * ApiAuthentication oauthConfig. - * @member {google.cloud.ces.v1.IOAuthConfig|null|undefined} oauthConfig - * @memberof google.cloud.ces.v1.ApiAuthentication - * @instance - */ - ApiAuthentication.prototype.oauthConfig = null; - - /** - * ApiAuthentication serviceAgentIdTokenAuthConfig. - * @member {google.cloud.ces.v1.IServiceAgentIdTokenAuthConfig|null|undefined} serviceAgentIdTokenAuthConfig - * @memberof google.cloud.ces.v1.ApiAuthentication - * @instance - */ - ApiAuthentication.prototype.serviceAgentIdTokenAuthConfig = null; - - /** - * ApiAuthentication serviceAccountAuthConfig. - * @member {google.cloud.ces.v1.IServiceAccountAuthConfig|null|undefined} serviceAccountAuthConfig - * @memberof google.cloud.ces.v1.ApiAuthentication - * @instance - */ - ApiAuthentication.prototype.serviceAccountAuthConfig = null; - - /** - * ApiAuthentication bearerTokenConfig. - * @member {google.cloud.ces.v1.IBearerTokenConfig|null|undefined} bearerTokenConfig - * @memberof google.cloud.ces.v1.ApiAuthentication - * @instance - */ - ApiAuthentication.prototype.bearerTokenConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ApiAuthentication authConfig. - * @member {"apiKeyConfig"|"oauthConfig"|"serviceAgentIdTokenAuthConfig"|"serviceAccountAuthConfig"|"bearerTokenConfig"|undefined} authConfig - * @memberof google.cloud.ces.v1.ApiAuthentication - * @instance - */ - Object.defineProperty(ApiAuthentication.prototype, "authConfig", { - get: $util.oneOfGetter($oneOfFields = ["apiKeyConfig", "oauthConfig", "serviceAgentIdTokenAuthConfig", "serviceAccountAuthConfig", "bearerTokenConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ApiAuthentication instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ApiAuthentication - * @static - * @param {google.cloud.ces.v1.IApiAuthentication=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ApiAuthentication} ApiAuthentication instance - */ - ApiAuthentication.create = function create(properties) { - return new ApiAuthentication(properties); - }; - - /** - * Encodes the specified ApiAuthentication message. Does not implicitly {@link google.cloud.ces.v1.ApiAuthentication.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ApiAuthentication - * @static - * @param {google.cloud.ces.v1.IApiAuthentication} message ApiAuthentication message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ApiAuthentication.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.apiKeyConfig != null && Object.hasOwnProperty.call(message, "apiKeyConfig")) - $root.google.cloud.ces.v1.ApiKeyConfig.encode(message.apiKeyConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.oauthConfig != null && Object.hasOwnProperty.call(message, "oauthConfig")) - $root.google.cloud.ces.v1.OAuthConfig.encode(message.oauthConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.serviceAgentIdTokenAuthConfig != null && Object.hasOwnProperty.call(message, "serviceAgentIdTokenAuthConfig")) - $root.google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig.encode(message.serviceAgentIdTokenAuthConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.serviceAccountAuthConfig != null && Object.hasOwnProperty.call(message, "serviceAccountAuthConfig")) - $root.google.cloud.ces.v1.ServiceAccountAuthConfig.encode(message.serviceAccountAuthConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.bearerTokenConfig != null && Object.hasOwnProperty.call(message, "bearerTokenConfig")) - $root.google.cloud.ces.v1.BearerTokenConfig.encode(message.bearerTokenConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ApiAuthentication message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ApiAuthentication.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ApiAuthentication - * @static - * @param {google.cloud.ces.v1.IApiAuthentication} message ApiAuthentication message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ApiAuthentication.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ApiAuthentication message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ApiAuthentication - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ApiAuthentication} ApiAuthentication - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ApiAuthentication.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ApiAuthentication(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.apiKeyConfig = $root.google.cloud.ces.v1.ApiKeyConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.oauthConfig = $root.google.cloud.ces.v1.OAuthConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.serviceAgentIdTokenAuthConfig = $root.google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.serviceAccountAuthConfig = $root.google.cloud.ces.v1.ServiceAccountAuthConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - message.bearerTokenConfig = $root.google.cloud.ces.v1.BearerTokenConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ApiAuthentication message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ApiAuthentication - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ApiAuthentication} ApiAuthentication - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ApiAuthentication.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ApiAuthentication message. - * @function verify - * @memberof google.cloud.ces.v1.ApiAuthentication - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ApiAuthentication.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) { - properties.authConfig = 1; - { - var error = $root.google.cloud.ces.v1.ApiKeyConfig.verify(message.apiKeyConfig); - if (error) - return "apiKeyConfig." + error; - } - } - if (message.oauthConfig != null && message.hasOwnProperty("oauthConfig")) { - if (properties.authConfig === 1) - return "authConfig: multiple values"; - properties.authConfig = 1; - { - var error = $root.google.cloud.ces.v1.OAuthConfig.verify(message.oauthConfig); - if (error) - return "oauthConfig." + error; - } - } - if (message.serviceAgentIdTokenAuthConfig != null && message.hasOwnProperty("serviceAgentIdTokenAuthConfig")) { - if (properties.authConfig === 1) - return "authConfig: multiple values"; - properties.authConfig = 1; - { - var error = $root.google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig.verify(message.serviceAgentIdTokenAuthConfig); - if (error) - return "serviceAgentIdTokenAuthConfig." + error; - } - } - if (message.serviceAccountAuthConfig != null && message.hasOwnProperty("serviceAccountAuthConfig")) { - if (properties.authConfig === 1) - return "authConfig: multiple values"; - properties.authConfig = 1; - { - var error = $root.google.cloud.ces.v1.ServiceAccountAuthConfig.verify(message.serviceAccountAuthConfig); - if (error) - return "serviceAccountAuthConfig." + error; - } - } - if (message.bearerTokenConfig != null && message.hasOwnProperty("bearerTokenConfig")) { - if (properties.authConfig === 1) - return "authConfig: multiple values"; - properties.authConfig = 1; - { - var error = $root.google.cloud.ces.v1.BearerTokenConfig.verify(message.bearerTokenConfig); - if (error) - return "bearerTokenConfig." + error; - } - } - return null; - }; - - /** - * Creates an ApiAuthentication message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ApiAuthentication - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ApiAuthentication} ApiAuthentication - */ - ApiAuthentication.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ApiAuthentication) - return object; - var message = new $root.google.cloud.ces.v1.ApiAuthentication(); - if (object.apiKeyConfig != null) { - if (typeof object.apiKeyConfig !== "object") - throw TypeError(".google.cloud.ces.v1.ApiAuthentication.apiKeyConfig: object expected"); - message.apiKeyConfig = $root.google.cloud.ces.v1.ApiKeyConfig.fromObject(object.apiKeyConfig); - } - if (object.oauthConfig != null) { - if (typeof object.oauthConfig !== "object") - throw TypeError(".google.cloud.ces.v1.ApiAuthentication.oauthConfig: object expected"); - message.oauthConfig = $root.google.cloud.ces.v1.OAuthConfig.fromObject(object.oauthConfig); - } - if (object.serviceAgentIdTokenAuthConfig != null) { - if (typeof object.serviceAgentIdTokenAuthConfig !== "object") - throw TypeError(".google.cloud.ces.v1.ApiAuthentication.serviceAgentIdTokenAuthConfig: object expected"); - message.serviceAgentIdTokenAuthConfig = $root.google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig.fromObject(object.serviceAgentIdTokenAuthConfig); - } - if (object.serviceAccountAuthConfig != null) { - if (typeof object.serviceAccountAuthConfig !== "object") - throw TypeError(".google.cloud.ces.v1.ApiAuthentication.serviceAccountAuthConfig: object expected"); - message.serviceAccountAuthConfig = $root.google.cloud.ces.v1.ServiceAccountAuthConfig.fromObject(object.serviceAccountAuthConfig); - } - if (object.bearerTokenConfig != null) { - if (typeof object.bearerTokenConfig !== "object") - throw TypeError(".google.cloud.ces.v1.ApiAuthentication.bearerTokenConfig: object expected"); - message.bearerTokenConfig = $root.google.cloud.ces.v1.BearerTokenConfig.fromObject(object.bearerTokenConfig); - } - return message; - }; - - /** - * Creates a plain object from an ApiAuthentication message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ApiAuthentication - * @static - * @param {google.cloud.ces.v1.ApiAuthentication} message ApiAuthentication - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ApiAuthentication.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) { - object.apiKeyConfig = $root.google.cloud.ces.v1.ApiKeyConfig.toObject(message.apiKeyConfig, options); - if (options.oneofs) - object.authConfig = "apiKeyConfig"; - } - if (message.oauthConfig != null && message.hasOwnProperty("oauthConfig")) { - object.oauthConfig = $root.google.cloud.ces.v1.OAuthConfig.toObject(message.oauthConfig, options); - if (options.oneofs) - object.authConfig = "oauthConfig"; - } - if (message.serviceAgentIdTokenAuthConfig != null && message.hasOwnProperty("serviceAgentIdTokenAuthConfig")) { - object.serviceAgentIdTokenAuthConfig = $root.google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig.toObject(message.serviceAgentIdTokenAuthConfig, options); - if (options.oneofs) - object.authConfig = "serviceAgentIdTokenAuthConfig"; - } - if (message.serviceAccountAuthConfig != null && message.hasOwnProperty("serviceAccountAuthConfig")) { - object.serviceAccountAuthConfig = $root.google.cloud.ces.v1.ServiceAccountAuthConfig.toObject(message.serviceAccountAuthConfig, options); - if (options.oneofs) - object.authConfig = "serviceAccountAuthConfig"; - } - if (message.bearerTokenConfig != null && message.hasOwnProperty("bearerTokenConfig")) { - object.bearerTokenConfig = $root.google.cloud.ces.v1.BearerTokenConfig.toObject(message.bearerTokenConfig, options); - if (options.oneofs) - object.authConfig = "bearerTokenConfig"; - } - return object; - }; - - /** - * Converts this ApiAuthentication to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ApiAuthentication - * @instance - * @returns {Object.} JSON object - */ - ApiAuthentication.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ApiAuthentication - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ApiAuthentication - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ApiAuthentication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ApiAuthentication"; - }; - - return ApiAuthentication; - })(); - - v1.DataStoreTool = (function() { - - /** - * Properties of a DataStoreTool. - * @memberof google.cloud.ces.v1 - * @interface IDataStoreTool - * @property {google.cloud.ces.v1.DataStoreTool.IDataStoreSource|null} [dataStoreSource] DataStoreTool dataStoreSource - * @property {google.cloud.ces.v1.DataStoreTool.IEngineSource|null} [engineSource] DataStoreTool engineSource - * @property {string|null} [name] DataStoreTool name - * @property {string|null} [description] DataStoreTool description - * @property {Array.|null} [boostSpecs] DataStoreTool boostSpecs - * @property {Array.|null} [modalityConfigs] DataStoreTool modalityConfigs - * @property {google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior|null} [filterParameterBehavior] DataStoreTool filterParameterBehavior - */ - - /** - * Constructs a new DataStoreTool. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a DataStoreTool. - * @implements IDataStoreTool - * @constructor - * @param {google.cloud.ces.v1.IDataStoreTool=} [properties] Properties to set - */ - function DataStoreTool(properties) { - this.boostSpecs = []; - this.modalityConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataStoreTool dataStoreSource. - * @member {google.cloud.ces.v1.DataStoreTool.IDataStoreSource|null|undefined} dataStoreSource - * @memberof google.cloud.ces.v1.DataStoreTool - * @instance - */ - DataStoreTool.prototype.dataStoreSource = null; - - /** - * DataStoreTool engineSource. - * @member {google.cloud.ces.v1.DataStoreTool.IEngineSource|null|undefined} engineSource - * @memberof google.cloud.ces.v1.DataStoreTool - * @instance - */ - DataStoreTool.prototype.engineSource = null; - - /** - * DataStoreTool name. - * @member {string} name - * @memberof google.cloud.ces.v1.DataStoreTool - * @instance - */ - DataStoreTool.prototype.name = ""; - - /** - * DataStoreTool description. - * @member {string} description - * @memberof google.cloud.ces.v1.DataStoreTool - * @instance - */ - DataStoreTool.prototype.description = ""; - - /** - * DataStoreTool boostSpecs. - * @member {Array.} boostSpecs - * @memberof google.cloud.ces.v1.DataStoreTool - * @instance - */ - DataStoreTool.prototype.boostSpecs = $util.emptyArray; - - /** - * DataStoreTool modalityConfigs. - * @member {Array.} modalityConfigs - * @memberof google.cloud.ces.v1.DataStoreTool - * @instance - */ - DataStoreTool.prototype.modalityConfigs = $util.emptyArray; - - /** - * DataStoreTool filterParameterBehavior. - * @member {google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior} filterParameterBehavior - * @memberof google.cloud.ces.v1.DataStoreTool - * @instance - */ - DataStoreTool.prototype.filterParameterBehavior = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * DataStoreTool searchSource. - * @member {"dataStoreSource"|"engineSource"|undefined} searchSource - * @memberof google.cloud.ces.v1.DataStoreTool - * @instance - */ - Object.defineProperty(DataStoreTool.prototype, "searchSource", { - get: $util.oneOfGetter($oneOfFields = ["dataStoreSource", "engineSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DataStoreTool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DataStoreTool - * @static - * @param {google.cloud.ces.v1.IDataStoreTool=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DataStoreTool} DataStoreTool instance - */ - DataStoreTool.create = function create(properties) { - return new DataStoreTool(properties); - }; - - /** - * Encodes the specified DataStoreTool message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DataStoreTool - * @static - * @param {google.cloud.ces.v1.IDataStoreTool} message DataStoreTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataStoreTool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.dataStoreSource != null && Object.hasOwnProperty.call(message, "dataStoreSource")) - $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.encode(message.dataStoreSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.engineSource != null && Object.hasOwnProperty.call(message, "engineSource")) - $root.google.cloud.ces.v1.DataStoreTool.EngineSource.encode(message.engineSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.boostSpecs != null && message.boostSpecs.length) - for (var i = 0; i < message.boostSpecs.length; ++i) - $root.google.cloud.ces.v1.DataStoreTool.BoostSpecs.encode(message.boostSpecs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.modalityConfigs != null && message.modalityConfigs.length) - for (var i = 0; i < message.modalityConfigs.length; ++i) - $root.google.cloud.ces.v1.DataStoreTool.ModalityConfig.encode(message.modalityConfigs[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.filterParameterBehavior != null && Object.hasOwnProperty.call(message, "filterParameterBehavior")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.filterParameterBehavior); - return writer; - }; - - /** - * Encodes the specified DataStoreTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool - * @static - * @param {google.cloud.ces.v1.IDataStoreTool} message DataStoreTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataStoreTool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataStoreTool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DataStoreTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DataStoreTool} DataStoreTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataStoreTool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.dataStoreSource = $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.decode(reader, reader.uint32()); - break; - } - case 4: { - message.engineSource = $root.google.cloud.ces.v1.DataStoreTool.EngineSource.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 8: { - if (!(message.boostSpecs && message.boostSpecs.length)) - message.boostSpecs = []; - message.boostSpecs.push($root.google.cloud.ces.v1.DataStoreTool.BoostSpecs.decode(reader, reader.uint32())); - break; - } - case 9: { - if (!(message.modalityConfigs && message.modalityConfigs.length)) - message.modalityConfigs = []; - message.modalityConfigs.push($root.google.cloud.ces.v1.DataStoreTool.ModalityConfig.decode(reader, reader.uint32())); - break; - } - case 10: { - message.filterParameterBehavior = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataStoreTool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DataStoreTool} DataStoreTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataStoreTool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataStoreTool message. - * @function verify - * @memberof google.cloud.ces.v1.DataStoreTool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataStoreTool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.dataStoreSource != null && message.hasOwnProperty("dataStoreSource")) { - properties.searchSource = 1; - { - var error = $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.verify(message.dataStoreSource); - if (error) - return "dataStoreSource." + error; - } - } - if (message.engineSource != null && message.hasOwnProperty("engineSource")) { - if (properties.searchSource === 1) - return "searchSource: multiple values"; - properties.searchSource = 1; - { - var error = $root.google.cloud.ces.v1.DataStoreTool.EngineSource.verify(message.engineSource); - if (error) - return "engineSource." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.boostSpecs != null && message.hasOwnProperty("boostSpecs")) { - if (!Array.isArray(message.boostSpecs)) - return "boostSpecs: array expected"; - for (var i = 0; i < message.boostSpecs.length; ++i) { - var error = $root.google.cloud.ces.v1.DataStoreTool.BoostSpecs.verify(message.boostSpecs[i]); - if (error) - return "boostSpecs." + error; - } - } - if (message.modalityConfigs != null && message.hasOwnProperty("modalityConfigs")) { - if (!Array.isArray(message.modalityConfigs)) - return "modalityConfigs: array expected"; - for (var i = 0; i < message.modalityConfigs.length; ++i) { - var error = $root.google.cloud.ces.v1.DataStoreTool.ModalityConfig.verify(message.modalityConfigs[i]); - if (error) - return "modalityConfigs." + error; - } - } - if (message.filterParameterBehavior != null && message.hasOwnProperty("filterParameterBehavior")) - switch (message.filterParameterBehavior) { - default: - return "filterParameterBehavior: enum value expected"; - case 0: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a DataStoreTool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DataStoreTool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DataStoreTool} DataStoreTool - */ - DataStoreTool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DataStoreTool) - return object; - var message = new $root.google.cloud.ces.v1.DataStoreTool(); - if (object.dataStoreSource != null) { - if (typeof object.dataStoreSource !== "object") - throw TypeError(".google.cloud.ces.v1.DataStoreTool.dataStoreSource: object expected"); - message.dataStoreSource = $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.fromObject(object.dataStoreSource); - } - if (object.engineSource != null) { - if (typeof object.engineSource !== "object") - throw TypeError(".google.cloud.ces.v1.DataStoreTool.engineSource: object expected"); - message.engineSource = $root.google.cloud.ces.v1.DataStoreTool.EngineSource.fromObject(object.engineSource); - } - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.boostSpecs) { - if (!Array.isArray(object.boostSpecs)) - throw TypeError(".google.cloud.ces.v1.DataStoreTool.boostSpecs: array expected"); - message.boostSpecs = []; - for (var i = 0; i < object.boostSpecs.length; ++i) { - if (typeof object.boostSpecs[i] !== "object") - throw TypeError(".google.cloud.ces.v1.DataStoreTool.boostSpecs: object expected"); - message.boostSpecs[i] = $root.google.cloud.ces.v1.DataStoreTool.BoostSpecs.fromObject(object.boostSpecs[i]); - } - } - if (object.modalityConfigs) { - if (!Array.isArray(object.modalityConfigs)) - throw TypeError(".google.cloud.ces.v1.DataStoreTool.modalityConfigs: array expected"); - message.modalityConfigs = []; - for (var i = 0; i < object.modalityConfigs.length; ++i) { - if (typeof object.modalityConfigs[i] !== "object") - throw TypeError(".google.cloud.ces.v1.DataStoreTool.modalityConfigs: object expected"); - message.modalityConfigs[i] = $root.google.cloud.ces.v1.DataStoreTool.ModalityConfig.fromObject(object.modalityConfigs[i]); - } - } - switch (object.filterParameterBehavior) { - default: - if (typeof object.filterParameterBehavior === "number") { - message.filterParameterBehavior = object.filterParameterBehavior; - break; - } - break; - case "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED": - case 0: - message.filterParameterBehavior = 0; - break; - case "ALWAYS_INCLUDE": - case 2: - message.filterParameterBehavior = 2; - break; - case "NEVER_INCLUDE": - case 3: - message.filterParameterBehavior = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a DataStoreTool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DataStoreTool - * @static - * @param {google.cloud.ces.v1.DataStoreTool} message DataStoreTool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataStoreTool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.boostSpecs = []; - object.modalityConfigs = []; - } - if (options.defaults) { - object.name = ""; - object.description = ""; - object.filterParameterBehavior = options.enums === String ? "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.dataStoreSource != null && message.hasOwnProperty("dataStoreSource")) { - object.dataStoreSource = $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.toObject(message.dataStoreSource, options); - if (options.oneofs) - object.searchSource = "dataStoreSource"; - } - if (message.engineSource != null && message.hasOwnProperty("engineSource")) { - object.engineSource = $root.google.cloud.ces.v1.DataStoreTool.EngineSource.toObject(message.engineSource, options); - if (options.oneofs) - object.searchSource = "engineSource"; - } - if (message.boostSpecs && message.boostSpecs.length) { - object.boostSpecs = []; - for (var j = 0; j < message.boostSpecs.length; ++j) - object.boostSpecs[j] = $root.google.cloud.ces.v1.DataStoreTool.BoostSpecs.toObject(message.boostSpecs[j], options); - } - if (message.modalityConfigs && message.modalityConfigs.length) { - object.modalityConfigs = []; - for (var j = 0; j < message.modalityConfigs.length; ++j) - object.modalityConfigs[j] = $root.google.cloud.ces.v1.DataStoreTool.ModalityConfig.toObject(message.modalityConfigs[j], options); - } - if (message.filterParameterBehavior != null && message.hasOwnProperty("filterParameterBehavior")) - object.filterParameterBehavior = options.enums === String ? $root.google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior[message.filterParameterBehavior] === undefined ? message.filterParameterBehavior : $root.google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior[message.filterParameterBehavior] : message.filterParameterBehavior; - return object; - }; - - /** - * Converts this DataStoreTool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DataStoreTool - * @instance - * @returns {Object.} JSON object - */ - DataStoreTool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataStoreTool - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DataStoreTool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataStoreTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool"; - }; - - DataStoreTool.RewriterConfig = (function() { - - /** - * Properties of a RewriterConfig. - * @memberof google.cloud.ces.v1.DataStoreTool - * @interface IRewriterConfig - * @property {google.cloud.ces.v1.IModelSettings|null} [modelSettings] RewriterConfig modelSettings - * @property {string|null} [prompt] RewriterConfig prompt - * @property {boolean|null} [disabled] RewriterConfig disabled - */ - - /** - * Constructs a new RewriterConfig. - * @memberof google.cloud.ces.v1.DataStoreTool - * @classdesc Represents a RewriterConfig. - * @implements IRewriterConfig - * @constructor - * @param {google.cloud.ces.v1.DataStoreTool.IRewriterConfig=} [properties] Properties to set - */ - function RewriterConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RewriterConfig modelSettings. - * @member {google.cloud.ces.v1.IModelSettings|null|undefined} modelSettings - * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig - * @instance - */ - RewriterConfig.prototype.modelSettings = null; - - /** - * RewriterConfig prompt. - * @member {string} prompt - * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig - * @instance - */ - RewriterConfig.prototype.prompt = ""; - - /** - * RewriterConfig disabled. - * @member {boolean} disabled - * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig - * @instance - */ - RewriterConfig.prototype.disabled = false; - - /** - * Creates a new RewriterConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IRewriterConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DataStoreTool.RewriterConfig} RewriterConfig instance - */ - RewriterConfig.create = function create(properties) { - return new RewriterConfig(properties); - }; - - /** - * Encodes the specified RewriterConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.RewriterConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IRewriterConfig} message RewriterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RewriterConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) - $root.google.cloud.ces.v1.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.prompt); - if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.disabled); - return writer; - }; - - /** - * Encodes the specified RewriterConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.RewriterConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IRewriterConfig} message RewriterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RewriterConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RewriterConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DataStoreTool.RewriterConfig} RewriterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RewriterConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.RewriterConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - message.prompt = reader.string(); - break; - } - case 3: { - message.disabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RewriterConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DataStoreTool.RewriterConfig} RewriterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RewriterConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RewriterConfig message. - * @function verify - * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RewriterConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { - var error = $root.google.cloud.ces.v1.ModelSettings.verify(message.modelSettings); - if (error) - return "modelSettings." + error; - } - if (message.prompt != null && message.hasOwnProperty("prompt")) - if (!$util.isString(message.prompt)) - return "prompt: string expected"; - if (message.disabled != null && message.hasOwnProperty("disabled")) - if (typeof message.disabled !== "boolean") - return "disabled: boolean expected"; - return null; - }; - - /** - * Creates a RewriterConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DataStoreTool.RewriterConfig} RewriterConfig - */ - RewriterConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.RewriterConfig) - return object; - var message = new $root.google.cloud.ces.v1.DataStoreTool.RewriterConfig(); - if (object.modelSettings != null) { - if (typeof object.modelSettings !== "object") - throw TypeError(".google.cloud.ces.v1.DataStoreTool.RewriterConfig.modelSettings: object expected"); - message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.fromObject(object.modelSettings); - } - if (object.prompt != null) - message.prompt = String(object.prompt); - if (object.disabled != null) - message.disabled = Boolean(object.disabled); - return message; - }; - - /** - * Creates a plain object from a RewriterConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig - * @static - * @param {google.cloud.ces.v1.DataStoreTool.RewriterConfig} message RewriterConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RewriterConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.modelSettings = null; - object.prompt = ""; - object.disabled = false; - } - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) - object.modelSettings = $root.google.cloud.ces.v1.ModelSettings.toObject(message.modelSettings, options); - if (message.prompt != null && message.hasOwnProperty("prompt")) - object.prompt = message.prompt; - if (message.disabled != null && message.hasOwnProperty("disabled")) - object.disabled = message.disabled; - return object; - }; - - /** - * Converts this RewriterConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig - * @instance - * @returns {Object.} JSON object - */ - RewriterConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RewriterConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DataStoreTool.RewriterConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RewriterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.RewriterConfig"; - }; - - return RewriterConfig; - })(); - - DataStoreTool.SummarizationConfig = (function() { - - /** - * Properties of a SummarizationConfig. - * @memberof google.cloud.ces.v1.DataStoreTool - * @interface ISummarizationConfig - * @property {google.cloud.ces.v1.IModelSettings|null} [modelSettings] SummarizationConfig modelSettings - * @property {string|null} [prompt] SummarizationConfig prompt - * @property {boolean|null} [disabled] SummarizationConfig disabled - */ - - /** - * Constructs a new SummarizationConfig. - * @memberof google.cloud.ces.v1.DataStoreTool - * @classdesc Represents a SummarizationConfig. - * @implements ISummarizationConfig - * @constructor - * @param {google.cloud.ces.v1.DataStoreTool.ISummarizationConfig=} [properties] Properties to set - */ - function SummarizationConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SummarizationConfig modelSettings. - * @member {google.cloud.ces.v1.IModelSettings|null|undefined} modelSettings - * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig - * @instance - */ - SummarizationConfig.prototype.modelSettings = null; - - /** - * SummarizationConfig prompt. - * @member {string} prompt - * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig - * @instance - */ - SummarizationConfig.prototype.prompt = ""; - - /** - * SummarizationConfig disabled. - * @member {boolean} disabled - * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig - * @instance - */ - SummarizationConfig.prototype.disabled = false; - - /** - * Creates a new SummarizationConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig - * @static - * @param {google.cloud.ces.v1.DataStoreTool.ISummarizationConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DataStoreTool.SummarizationConfig} SummarizationConfig instance - */ - SummarizationConfig.create = function create(properties) { - return new SummarizationConfig(properties); - }; - - /** - * Encodes the specified SummarizationConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.SummarizationConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig - * @static - * @param {google.cloud.ces.v1.DataStoreTool.ISummarizationConfig} message SummarizationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SummarizationConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) - $root.google.cloud.ces.v1.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.prompt); - if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.disabled); - return writer; - }; - - /** - * Encodes the specified SummarizationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.SummarizationConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig - * @static - * @param {google.cloud.ces.v1.DataStoreTool.ISummarizationConfig} message SummarizationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SummarizationConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SummarizationConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DataStoreTool.SummarizationConfig} SummarizationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SummarizationConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.SummarizationConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - message.prompt = reader.string(); - break; - } - case 3: { - message.disabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SummarizationConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DataStoreTool.SummarizationConfig} SummarizationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SummarizationConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SummarizationConfig message. - * @function verify - * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SummarizationConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { - var error = $root.google.cloud.ces.v1.ModelSettings.verify(message.modelSettings); - if (error) - return "modelSettings." + error; - } - if (message.prompt != null && message.hasOwnProperty("prompt")) - if (!$util.isString(message.prompt)) - return "prompt: string expected"; - if (message.disabled != null && message.hasOwnProperty("disabled")) - if (typeof message.disabled !== "boolean") - return "disabled: boolean expected"; - return null; - }; - - /** - * Creates a SummarizationConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DataStoreTool.SummarizationConfig} SummarizationConfig - */ - SummarizationConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.SummarizationConfig) - return object; - var message = new $root.google.cloud.ces.v1.DataStoreTool.SummarizationConfig(); - if (object.modelSettings != null) { - if (typeof object.modelSettings !== "object") - throw TypeError(".google.cloud.ces.v1.DataStoreTool.SummarizationConfig.modelSettings: object expected"); - message.modelSettings = $root.google.cloud.ces.v1.ModelSettings.fromObject(object.modelSettings); - } - if (object.prompt != null) - message.prompt = String(object.prompt); - if (object.disabled != null) - message.disabled = Boolean(object.disabled); - return message; - }; - - /** - * Creates a plain object from a SummarizationConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig - * @static - * @param {google.cloud.ces.v1.DataStoreTool.SummarizationConfig} message SummarizationConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SummarizationConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.modelSettings = null; - object.prompt = ""; - object.disabled = false; - } - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) - object.modelSettings = $root.google.cloud.ces.v1.ModelSettings.toObject(message.modelSettings, options); - if (message.prompt != null && message.hasOwnProperty("prompt")) - object.prompt = message.prompt; - if (message.disabled != null && message.hasOwnProperty("disabled")) - object.disabled = message.disabled; - return object; - }; - - /** - * Converts this SummarizationConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig - * @instance - * @returns {Object.} JSON object - */ - SummarizationConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SummarizationConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DataStoreTool.SummarizationConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SummarizationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.SummarizationConfig"; - }; - - return SummarizationConfig; - })(); - - DataStoreTool.GroundingConfig = (function() { - - /** - * Properties of a GroundingConfig. - * @memberof google.cloud.ces.v1.DataStoreTool - * @interface IGroundingConfig - * @property {number|null} [groundingLevel] GroundingConfig groundingLevel - * @property {boolean|null} [disabled] GroundingConfig disabled - */ - - /** - * Constructs a new GroundingConfig. - * @memberof google.cloud.ces.v1.DataStoreTool - * @classdesc Represents a GroundingConfig. - * @implements IGroundingConfig - * @constructor - * @param {google.cloud.ces.v1.DataStoreTool.IGroundingConfig=} [properties] Properties to set - */ - function GroundingConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroundingConfig groundingLevel. - * @member {number} groundingLevel - * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig - * @instance - */ - GroundingConfig.prototype.groundingLevel = 0; - - /** - * GroundingConfig disabled. - * @member {boolean} disabled - * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig - * @instance - */ - GroundingConfig.prototype.disabled = false; - - /** - * Creates a new GroundingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IGroundingConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DataStoreTool.GroundingConfig} GroundingConfig instance - */ - GroundingConfig.create = function create(properties) { - return new GroundingConfig(properties); - }; - - /** - * Encodes the specified GroundingConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.GroundingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IGroundingConfig} message GroundingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroundingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groundingLevel != null && Object.hasOwnProperty.call(message, "groundingLevel")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.groundingLevel); - if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.disabled); - return writer; - }; - - /** - * Encodes the specified GroundingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.GroundingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IGroundingConfig} message GroundingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroundingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroundingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DataStoreTool.GroundingConfig} GroundingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroundingConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.GroundingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.groundingLevel = reader.float(); - break; - } - case 2: { - message.disabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroundingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DataStoreTool.GroundingConfig} GroundingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroundingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroundingConfig message. - * @function verify - * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroundingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.groundingLevel != null && message.hasOwnProperty("groundingLevel")) - if (typeof message.groundingLevel !== "number") - return "groundingLevel: number expected"; - if (message.disabled != null && message.hasOwnProperty("disabled")) - if (typeof message.disabled !== "boolean") - return "disabled: boolean expected"; - return null; - }; - - /** - * Creates a GroundingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DataStoreTool.GroundingConfig} GroundingConfig - */ - GroundingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.GroundingConfig) - return object; - var message = new $root.google.cloud.ces.v1.DataStoreTool.GroundingConfig(); - if (object.groundingLevel != null) - message.groundingLevel = Number(object.groundingLevel); - if (object.disabled != null) - message.disabled = Boolean(object.disabled); - return message; - }; - - /** - * Creates a plain object from a GroundingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig - * @static - * @param {google.cloud.ces.v1.DataStoreTool.GroundingConfig} message GroundingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroundingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.groundingLevel = 0; - object.disabled = false; - } - if (message.groundingLevel != null && message.hasOwnProperty("groundingLevel")) - object.groundingLevel = options.json && !isFinite(message.groundingLevel) ? String(message.groundingLevel) : message.groundingLevel; - if (message.disabled != null && message.hasOwnProperty("disabled")) - object.disabled = message.disabled; - return object; - }; - - /** - * Converts this GroundingConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig - * @instance - * @returns {Object.} JSON object - */ - GroundingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GroundingConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DataStoreTool.GroundingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GroundingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.GroundingConfig"; - }; - - return GroundingConfig; - })(); - - DataStoreTool.DataStoreSource = (function() { - - /** - * Properties of a DataStoreSource. - * @memberof google.cloud.ces.v1.DataStoreTool - * @interface IDataStoreSource - * @property {string|null} [filter] DataStoreSource filter - * @property {google.cloud.ces.v1.IDataStore|null} [dataStore] DataStoreSource dataStore - */ - - /** - * Constructs a new DataStoreSource. - * @memberof google.cloud.ces.v1.DataStoreTool - * @classdesc Represents a DataStoreSource. - * @implements IDataStoreSource - * @constructor - * @param {google.cloud.ces.v1.DataStoreTool.IDataStoreSource=} [properties] Properties to set - */ - function DataStoreSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataStoreSource filter. - * @member {string} filter - * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource - * @instance - */ - DataStoreSource.prototype.filter = ""; - - /** - * DataStoreSource dataStore. - * @member {google.cloud.ces.v1.IDataStore|null|undefined} dataStore - * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource - * @instance - */ - DataStoreSource.prototype.dataStore = null; - - /** - * Creates a new DataStoreSource instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IDataStoreSource=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DataStoreTool.DataStoreSource} DataStoreSource instance - */ - DataStoreSource.create = function create(properties) { - return new DataStoreSource(properties); - }; - - /** - * Encodes the specified DataStoreSource message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.DataStoreSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IDataStoreSource} message DataStoreSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataStoreSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.dataStore != null && Object.hasOwnProperty.call(message, "dataStore")) - $root.google.cloud.ces.v1.DataStore.encode(message.dataStore, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataStoreSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.DataStoreSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IDataStoreSource} message DataStoreSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataStoreSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataStoreSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DataStoreTool.DataStoreSource} DataStoreSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataStoreSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.filter = reader.string(); - break; - } - case 4: { - message.dataStore = $root.google.cloud.ces.v1.DataStore.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataStoreSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DataStoreTool.DataStoreSource} DataStoreSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataStoreSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataStoreSource message. - * @function verify - * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataStoreSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.dataStore != null && message.hasOwnProperty("dataStore")) { - var error = $root.google.cloud.ces.v1.DataStore.verify(message.dataStore); - if (error) - return "dataStore." + error; - } - return null; - }; - - /** - * Creates a DataStoreSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DataStoreTool.DataStoreSource} DataStoreSource - */ - DataStoreSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource) - return object; - var message = new $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource(); - if (object.filter != null) - message.filter = String(object.filter); - if (object.dataStore != null) { - if (typeof object.dataStore !== "object") - throw TypeError(".google.cloud.ces.v1.DataStoreTool.DataStoreSource.dataStore: object expected"); - message.dataStore = $root.google.cloud.ces.v1.DataStore.fromObject(object.dataStore); - } - return message; - }; - - /** - * Creates a plain object from a DataStoreSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource - * @static - * @param {google.cloud.ces.v1.DataStoreTool.DataStoreSource} message DataStoreSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataStoreSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.filter = ""; - object.dataStore = null; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.dataStore != null && message.hasOwnProperty("dataStore")) - object.dataStore = $root.google.cloud.ces.v1.DataStore.toObject(message.dataStore, options); - return object; - }; - - /** - * Converts this DataStoreSource to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource - * @instance - * @returns {Object.} JSON object - */ - DataStoreSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataStoreSource - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DataStoreTool.DataStoreSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataStoreSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.DataStoreSource"; - }; - - return DataStoreSource; - })(); - - DataStoreTool.EngineSource = (function() { - - /** - * Properties of an EngineSource. - * @memberof google.cloud.ces.v1.DataStoreTool - * @interface IEngineSource - * @property {string|null} [engine] EngineSource engine - * @property {Array.|null} [dataStoreSources] EngineSource dataStoreSources - * @property {string|null} [filter] EngineSource filter - */ - - /** - * Constructs a new EngineSource. - * @memberof google.cloud.ces.v1.DataStoreTool - * @classdesc Represents an EngineSource. - * @implements IEngineSource - * @constructor - * @param {google.cloud.ces.v1.DataStoreTool.IEngineSource=} [properties] Properties to set - */ - function EngineSource(properties) { - this.dataStoreSources = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EngineSource engine. - * @member {string} engine - * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource - * @instance - */ - EngineSource.prototype.engine = ""; - - /** - * EngineSource dataStoreSources. - * @member {Array.} dataStoreSources - * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource - * @instance - */ - EngineSource.prototype.dataStoreSources = $util.emptyArray; - - /** - * EngineSource filter. - * @member {string} filter - * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource - * @instance - */ - EngineSource.prototype.filter = ""; - - /** - * Creates a new EngineSource instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IEngineSource=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DataStoreTool.EngineSource} EngineSource instance - */ - EngineSource.create = function create(properties) { - return new EngineSource(properties); - }; - - /** - * Encodes the specified EngineSource message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.EngineSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IEngineSource} message EngineSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EngineSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.engine != null && Object.hasOwnProperty.call(message, "engine")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.engine); - if (message.dataStoreSources != null && message.dataStoreSources.length) - for (var i = 0; i < message.dataStoreSources.length; ++i) - $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.encode(message.dataStoreSources[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); - return writer; - }; - - /** - * Encodes the specified EngineSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.EngineSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IEngineSource} message EngineSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EngineSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EngineSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DataStoreTool.EngineSource} EngineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EngineSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.EngineSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.engine = reader.string(); - break; - } - case 2: { - if (!(message.dataStoreSources && message.dataStoreSources.length)) - message.dataStoreSources = []; - message.dataStoreSources.push($root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.decode(reader, reader.uint32())); - break; - } - case 3: { - message.filter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EngineSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DataStoreTool.EngineSource} EngineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EngineSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EngineSource message. - * @function verify - * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EngineSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.engine != null && message.hasOwnProperty("engine")) - if (!$util.isString(message.engine)) - return "engine: string expected"; - if (message.dataStoreSources != null && message.hasOwnProperty("dataStoreSources")) { - if (!Array.isArray(message.dataStoreSources)) - return "dataStoreSources: array expected"; - for (var i = 0; i < message.dataStoreSources.length; ++i) { - var error = $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.verify(message.dataStoreSources[i]); - if (error) - return "dataStoreSources." + error; - } - } - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - return null; - }; - - /** - * Creates an EngineSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DataStoreTool.EngineSource} EngineSource - */ - EngineSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.EngineSource) - return object; - var message = new $root.google.cloud.ces.v1.DataStoreTool.EngineSource(); - if (object.engine != null) - message.engine = String(object.engine); - if (object.dataStoreSources) { - if (!Array.isArray(object.dataStoreSources)) - throw TypeError(".google.cloud.ces.v1.DataStoreTool.EngineSource.dataStoreSources: array expected"); - message.dataStoreSources = []; - for (var i = 0; i < object.dataStoreSources.length; ++i) { - if (typeof object.dataStoreSources[i] !== "object") - throw TypeError(".google.cloud.ces.v1.DataStoreTool.EngineSource.dataStoreSources: object expected"); - message.dataStoreSources[i] = $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.fromObject(object.dataStoreSources[i]); - } - } - if (object.filter != null) - message.filter = String(object.filter); - return message; - }; - - /** - * Creates a plain object from an EngineSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource - * @static - * @param {google.cloud.ces.v1.DataStoreTool.EngineSource} message EngineSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EngineSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.dataStoreSources = []; - if (options.defaults) { - object.engine = ""; - object.filter = ""; - } - if (message.engine != null && message.hasOwnProperty("engine")) - object.engine = message.engine; - if (message.dataStoreSources && message.dataStoreSources.length) { - object.dataStoreSources = []; - for (var j = 0; j < message.dataStoreSources.length; ++j) - object.dataStoreSources[j] = $root.google.cloud.ces.v1.DataStoreTool.DataStoreSource.toObject(message.dataStoreSources[j], options); - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - return object; - }; - - /** - * Converts this EngineSource to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource - * @instance - * @returns {Object.} JSON object - */ - EngineSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EngineSource - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DataStoreTool.EngineSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EngineSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.EngineSource"; - }; - - return EngineSource; - })(); - - DataStoreTool.BoostSpecs = (function() { - - /** - * Properties of a BoostSpecs. - * @memberof google.cloud.ces.v1.DataStoreTool - * @interface IBoostSpecs - * @property {Array.|null} [dataStores] BoostSpecs dataStores - * @property {Array.|null} [spec] BoostSpecs spec - */ - - /** - * Constructs a new BoostSpecs. - * @memberof google.cloud.ces.v1.DataStoreTool - * @classdesc Represents a BoostSpecs. - * @implements IBoostSpecs - * @constructor - * @param {google.cloud.ces.v1.DataStoreTool.IBoostSpecs=} [properties] Properties to set - */ - function BoostSpecs(properties) { - this.dataStores = []; - this.spec = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BoostSpecs dataStores. - * @member {Array.} dataStores - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs - * @instance - */ - BoostSpecs.prototype.dataStores = $util.emptyArray; - - /** - * BoostSpecs spec. - * @member {Array.} spec - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs - * @instance - */ - BoostSpecs.prototype.spec = $util.emptyArray; - - /** - * Creates a new BoostSpecs instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IBoostSpecs=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpecs} BoostSpecs instance - */ - BoostSpecs.create = function create(properties) { - return new BoostSpecs(properties); - }; - - /** - * Encodes the specified BoostSpecs message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpecs.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IBoostSpecs} message BoostSpecs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostSpecs.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataStores != null && message.dataStores.length) - for (var i = 0; i < message.dataStores.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataStores[i]); - if (message.spec != null && message.spec.length) - for (var i = 0; i < message.spec.length; ++i) - $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.encode(message.spec[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BoostSpecs message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpecs.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IBoostSpecs} message BoostSpecs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostSpecs.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BoostSpecs message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpecs} BoostSpecs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostSpecs.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpecs(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.dataStores && message.dataStores.length)) - message.dataStores = []; - message.dataStores.push(reader.string()); - break; - } - case 2: { - if (!(message.spec && message.spec.length)) - message.spec = []; - message.spec.push($root.google.cloud.ces.v1.DataStoreTool.BoostSpec.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BoostSpecs message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpecs} BoostSpecs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostSpecs.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BoostSpecs message. - * @function verify - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoostSpecs.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataStores != null && message.hasOwnProperty("dataStores")) { - if (!Array.isArray(message.dataStores)) - return "dataStores: array expected"; - for (var i = 0; i < message.dataStores.length; ++i) - if (!$util.isString(message.dataStores[i])) - return "dataStores: string[] expected"; - } - if (message.spec != null && message.hasOwnProperty("spec")) { - if (!Array.isArray(message.spec)) - return "spec: array expected"; - for (var i = 0; i < message.spec.length; ++i) { - var error = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.verify(message.spec[i]); - if (error) - return "spec." + error; - } - } - return null; - }; - - /** - * Creates a BoostSpecs message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpecs} BoostSpecs - */ - BoostSpecs.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.BoostSpecs) - return object; - var message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpecs(); - if (object.dataStores) { - if (!Array.isArray(object.dataStores)) - throw TypeError(".google.cloud.ces.v1.DataStoreTool.BoostSpecs.dataStores: array expected"); - message.dataStores = []; - for (var i = 0; i < object.dataStores.length; ++i) - message.dataStores[i] = String(object.dataStores[i]); - } - if (object.spec) { - if (!Array.isArray(object.spec)) - throw TypeError(".google.cloud.ces.v1.DataStoreTool.BoostSpecs.spec: array expected"); - message.spec = []; - for (var i = 0; i < object.spec.length; ++i) { - if (typeof object.spec[i] !== "object") - throw TypeError(".google.cloud.ces.v1.DataStoreTool.BoostSpecs.spec: object expected"); - message.spec[i] = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.fromObject(object.spec[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BoostSpecs message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs - * @static - * @param {google.cloud.ces.v1.DataStoreTool.BoostSpecs} message BoostSpecs - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoostSpecs.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dataStores = []; - object.spec = []; - } - if (message.dataStores && message.dataStores.length) { - object.dataStores = []; - for (var j = 0; j < message.dataStores.length; ++j) - object.dataStores[j] = message.dataStores[j]; - } - if (message.spec && message.spec.length) { - object.spec = []; - for (var j = 0; j < message.spec.length; ++j) - object.spec[j] = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.toObject(message.spec[j], options); - } - return object; - }; - - /** - * Converts this BoostSpecs to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs - * @instance - * @returns {Object.} JSON object - */ - BoostSpecs.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BoostSpecs - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpecs - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BoostSpecs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.BoostSpecs"; - }; - - return BoostSpecs; - })(); - - DataStoreTool.BoostSpec = (function() { - - /** - * Properties of a BoostSpec. - * @memberof google.cloud.ces.v1.DataStoreTool - * @interface IBoostSpec - * @property {Array.|null} [conditionBoostSpecs] BoostSpec conditionBoostSpecs - */ - - /** - * Constructs a new BoostSpec. - * @memberof google.cloud.ces.v1.DataStoreTool - * @classdesc Represents a BoostSpec. - * @implements IBoostSpec - * @constructor - * @param {google.cloud.ces.v1.DataStoreTool.IBoostSpec=} [properties] Properties to set - */ - function BoostSpec(properties) { - this.conditionBoostSpecs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BoostSpec conditionBoostSpecs. - * @member {Array.} conditionBoostSpecs - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec - * @instance - */ - BoostSpec.prototype.conditionBoostSpecs = $util.emptyArray; - - /** - * Creates a new BoostSpec instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IBoostSpec=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec} BoostSpec instance - */ - BoostSpec.create = function create(properties) { - return new BoostSpec(properties); - }; - - /** - * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IBoostSpec} message BoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.conditionBoostSpecs != null && message.conditionBoostSpecs.length) - for (var i = 0; i < message.conditionBoostSpecs.length; ++i) - $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.encode(message.conditionBoostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IBoostSpec} message BoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BoostSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec} BoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostSpec.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.conditionBoostSpecs && message.conditionBoostSpecs.length)) - message.conditionBoostSpecs = []; - message.conditionBoostSpecs.push($root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BoostSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec} BoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BoostSpec message. - * @function verify - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoostSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.conditionBoostSpecs != null && message.hasOwnProperty("conditionBoostSpecs")) { - if (!Array.isArray(message.conditionBoostSpecs)) - return "conditionBoostSpecs: array expected"; - for (var i = 0; i < message.conditionBoostSpecs.length; ++i) { - var error = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.verify(message.conditionBoostSpecs[i]); - if (error) - return "conditionBoostSpecs." + error; - } - } - return null; - }; - - /** - * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec} BoostSpec - */ - BoostSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.BoostSpec) - return object; - var message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpec(); - if (object.conditionBoostSpecs) { - if (!Array.isArray(object.conditionBoostSpecs)) - throw TypeError(".google.cloud.ces.v1.DataStoreTool.BoostSpec.conditionBoostSpecs: array expected"); - message.conditionBoostSpecs = []; - for (var i = 0; i < object.conditionBoostSpecs.length; ++i) { - if (typeof object.conditionBoostSpecs[i] !== "object") - throw TypeError(".google.cloud.ces.v1.DataStoreTool.BoostSpec.conditionBoostSpecs: object expected"); - message.conditionBoostSpecs[i] = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.fromObject(object.conditionBoostSpecs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec - * @static - * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec} message BoostSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoostSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.conditionBoostSpecs = []; - if (message.conditionBoostSpecs && message.conditionBoostSpecs.length) { - object.conditionBoostSpecs = []; - for (var j = 0; j < message.conditionBoostSpecs.length; ++j) - object.conditionBoostSpecs[j] = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.toObject(message.conditionBoostSpecs[j], options); - } - return object; - }; - - /** - * Converts this BoostSpec to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec - * @instance - * @returns {Object.} JSON object - */ - BoostSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BoostSpec - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.BoostSpec"; - }; - - BoostSpec.ConditionBoostSpec = (function() { - - /** - * Properties of a ConditionBoostSpec. - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec - * @interface IConditionBoostSpec - * @property {string|null} [condition] ConditionBoostSpec condition - * @property {number|null} [boost] ConditionBoostSpec boost - * @property {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null} [boostControlSpec] ConditionBoostSpec boostControlSpec - */ - - /** - * Constructs a new ConditionBoostSpec. - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec - * @classdesc Represents a ConditionBoostSpec. - * @implements IConditionBoostSpec - * @constructor - * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec=} [properties] Properties to set - */ - function ConditionBoostSpec(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConditionBoostSpec condition. - * @member {string} condition - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec - * @instance - */ - ConditionBoostSpec.prototype.condition = ""; - - /** - * ConditionBoostSpec boost. - * @member {number} boost - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec - * @instance - */ - ConditionBoostSpec.prototype.boost = 0; - - /** - * ConditionBoostSpec boostControlSpec. - * @member {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null|undefined} boostControlSpec - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec - * @instance - */ - ConditionBoostSpec.prototype.boostControlSpec = null; - - /** - * Creates a new ConditionBoostSpec instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec instance - */ - ConditionBoostSpec.create = function create(properties) { - return new ConditionBoostSpec(properties); - }; - - /** - * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConditionBoostSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); - if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); - if (message.boostControlSpec != null && Object.hasOwnProperty.call(message, "boostControlSpec")) - $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.encode(message.boostControlSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConditionBoostSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConditionBoostSpec.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.condition = reader.string(); - break; - } - case 2: { - message.boost = reader.float(); - break; - } - case 4: { - message.boostControlSpec = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConditionBoostSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConditionBoostSpec message. - * @function verify - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConditionBoostSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.condition != null && message.hasOwnProperty("condition")) - if (!$util.isString(message.condition)) - return "condition: string expected"; - if (message.boost != null && message.hasOwnProperty("boost")) - if (typeof message.boost !== "number") - return "boost: number expected"; - if (message.boostControlSpec != null && message.hasOwnProperty("boostControlSpec")) { - var error = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify(message.boostControlSpec); - if (error) - return "boostControlSpec." + error; - } - return null; - }; - - /** - * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec - */ - ConditionBoostSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec) - return object; - var message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec(); - if (object.condition != null) - message.condition = String(object.condition); - if (object.boost != null) - message.boost = Number(object.boost); - if (object.boostControlSpec != null) { - if (typeof object.boostControlSpec !== "object") - throw TypeError(".google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.boostControlSpec: object expected"); - message.boostControlSpec = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.fromObject(object.boostControlSpec); - } - return message; - }; - - /** - * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec} message ConditionBoostSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConditionBoostSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.condition = ""; - object.boost = 0; - object.boostControlSpec = null; - } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = message.condition; - if (message.boost != null && message.hasOwnProperty("boost")) - object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; - if (message.boostControlSpec != null && message.hasOwnProperty("boostControlSpec")) - object.boostControlSpec = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.toObject(message.boostControlSpec, options); - return object; - }; - - /** - * Converts this ConditionBoostSpec to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec - * @instance - * @returns {Object.} JSON object - */ - ConditionBoostSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConditionBoostSpec - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConditionBoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec"; - }; - - ConditionBoostSpec.BoostControlSpec = (function() { - - /** - * Properties of a BoostControlSpec. - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec - * @interface IBoostControlSpec - * @property {string|null} [fieldName] BoostControlSpec fieldName - * @property {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|null} [attributeType] BoostControlSpec attributeType - * @property {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|null} [interpolationType] BoostControlSpec interpolationType - * @property {Array.|null} [controlPoints] BoostControlSpec controlPoints - */ - - /** - * Constructs a new BoostControlSpec. - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec - * @classdesc Represents a BoostControlSpec. - * @implements IBoostControlSpec - * @constructor - * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec=} [properties] Properties to set - */ - function BoostControlSpec(properties) { - this.controlPoints = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BoostControlSpec fieldName. - * @member {string} fieldName - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @instance - */ - BoostControlSpec.prototype.fieldName = ""; - - /** - * BoostControlSpec attributeType. - * @member {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType} attributeType - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @instance - */ - BoostControlSpec.prototype.attributeType = 0; - - /** - * BoostControlSpec interpolationType. - * @member {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType} interpolationType - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @instance - */ - BoostControlSpec.prototype.interpolationType = 0; - - /** - * BoostControlSpec controlPoints. - * @member {Array.} controlPoints - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @instance - */ - BoostControlSpec.prototype.controlPoints = $util.emptyArray; - - /** - * Creates a new BoostControlSpec instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @static - * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec instance - */ - BoostControlSpec.create = function create(properties) { - return new BoostControlSpec(properties); - }; - - /** - * Encodes the specified BoostControlSpec message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @static - * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec} message BoostControlSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostControlSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldName); - if (message.attributeType != null && Object.hasOwnProperty.call(message, "attributeType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.attributeType); - if (message.interpolationType != null && Object.hasOwnProperty.call(message, "interpolationType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.interpolationType); - if (message.controlPoints != null && message.controlPoints.length) - for (var i = 0; i < message.controlPoints.length; ++i) - $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.encode(message.controlPoints[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BoostControlSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @static - * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec} message BoostControlSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostControlSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BoostControlSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostControlSpec.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fieldName = reader.string(); - break; - } - case 2: { - message.attributeType = reader.int32(); - break; - } - case 3: { - message.interpolationType = reader.int32(); - break; - } - case 4: { - if (!(message.controlPoints && message.controlPoints.length)) - message.controlPoints = []; - message.controlPoints.push($root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BoostControlSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostControlSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BoostControlSpec message. - * @function verify - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoostControlSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldName != null && message.hasOwnProperty("fieldName")) - if (!$util.isString(message.fieldName)) - return "fieldName: string expected"; - if (message.attributeType != null && message.hasOwnProperty("attributeType")) - switch (message.attributeType) { - default: - return "attributeType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.interpolationType != null && message.hasOwnProperty("interpolationType")) - switch (message.interpolationType) { - default: - return "interpolationType: enum value expected"; - case 0: - case 1: - break; - } - if (message.controlPoints != null && message.hasOwnProperty("controlPoints")) { - if (!Array.isArray(message.controlPoints)) - return "controlPoints: array expected"; - for (var i = 0; i < message.controlPoints.length; ++i) { - var error = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify(message.controlPoints[i]); - if (error) - return "controlPoints." + error; - } - } - return null; - }; - - /** - * Creates a BoostControlSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec - */ - BoostControlSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec) - return object; - var message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec(); - if (object.fieldName != null) - message.fieldName = String(object.fieldName); - switch (object.attributeType) { - default: - if (typeof object.attributeType === "number") { - message.attributeType = object.attributeType; - break; - } - break; - case "ATTRIBUTE_TYPE_UNSPECIFIED": - case 0: - message.attributeType = 0; - break; - case "NUMERICAL": - case 1: - message.attributeType = 1; - break; - case "FRESHNESS": - case 2: - message.attributeType = 2; - break; - } - switch (object.interpolationType) { - default: - if (typeof object.interpolationType === "number") { - message.interpolationType = object.interpolationType; - break; - } - break; - case "INTERPOLATION_TYPE_UNSPECIFIED": - case 0: - message.interpolationType = 0; - break; - case "LINEAR": - case 1: - message.interpolationType = 1; - break; - } - if (object.controlPoints) { - if (!Array.isArray(object.controlPoints)) - throw TypeError(".google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.controlPoints: array expected"); - message.controlPoints = []; - for (var i = 0; i < object.controlPoints.length; ++i) { - if (typeof object.controlPoints[i] !== "object") - throw TypeError(".google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.controlPoints: object expected"); - message.controlPoints[i] = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.fromObject(object.controlPoints[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BoostControlSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @static - * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} message BoostControlSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoostControlSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.controlPoints = []; - if (options.defaults) { - object.fieldName = ""; - object.attributeType = options.enums === String ? "ATTRIBUTE_TYPE_UNSPECIFIED" : 0; - object.interpolationType = options.enums === String ? "INTERPOLATION_TYPE_UNSPECIFIED" : 0; - } - if (message.fieldName != null && message.hasOwnProperty("fieldName")) - object.fieldName = message.fieldName; - if (message.attributeType != null && message.hasOwnProperty("attributeType")) - object.attributeType = options.enums === String ? $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType[message.attributeType] === undefined ? message.attributeType : $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType[message.attributeType] : message.attributeType; - if (message.interpolationType != null && message.hasOwnProperty("interpolationType")) - object.interpolationType = options.enums === String ? $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType[message.interpolationType] === undefined ? message.interpolationType : $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType[message.interpolationType] : message.interpolationType; - if (message.controlPoints && message.controlPoints.length) { - object.controlPoints = []; - for (var j = 0; j < message.controlPoints.length; ++j) - object.controlPoints[j] = $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.toObject(message.controlPoints[j], options); - } - return object; - }; - - /** - * Converts this BoostControlSpec to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @instance - * @returns {Object.} JSON object - */ - BoostControlSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BoostControlSpec - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BoostControlSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec"; - }; - - BoostControlSpec.ControlPoint = (function() { - - /** - * Properties of a ControlPoint. - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @interface IControlPoint - * @property {string|null} [attributeValue] ControlPoint attributeValue - * @property {number|null} [boostAmount] ControlPoint boostAmount - */ - - /** - * Constructs a new ControlPoint. - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @classdesc Represents a ControlPoint. - * @implements IControlPoint - * @constructor - * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint=} [properties] Properties to set - */ - function ControlPoint(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ControlPoint attributeValue. - * @member {string} attributeValue - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @instance - */ - ControlPoint.prototype.attributeValue = ""; - - /** - * ControlPoint boostAmount. - * @member {number} boostAmount - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @instance - */ - ControlPoint.prototype.boostAmount = 0; - - /** - * Creates a new ControlPoint instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @static - * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint instance - */ - ControlPoint.create = function create(properties) { - return new ControlPoint(properties); - }; - - /** - * Encodes the specified ControlPoint message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @static - * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint} message ControlPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ControlPoint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.attributeValue != null && Object.hasOwnProperty.call(message, "attributeValue")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributeValue); - if (message.boostAmount != null && Object.hasOwnProperty.call(message, "boostAmount")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.boostAmount); - return writer; - }; - - /** - * Encodes the specified ControlPoint message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @static - * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint} message ControlPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ControlPoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ControlPoint message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ControlPoint.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.attributeValue = reader.string(); - break; - } - case 2: { - message.boostAmount = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ControlPoint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ControlPoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ControlPoint message. - * @function verify - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ControlPoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.attributeValue != null && message.hasOwnProperty("attributeValue")) - if (!$util.isString(message.attributeValue)) - return "attributeValue: string expected"; - if (message.boostAmount != null && message.hasOwnProperty("boostAmount")) - if (typeof message.boostAmount !== "number") - return "boostAmount: number expected"; - return null; - }; - - /** - * Creates a ControlPoint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint - */ - ControlPoint.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint) - return object; - var message = new $root.google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint(); - if (object.attributeValue != null) - message.attributeValue = String(object.attributeValue); - if (object.boostAmount != null) - message.boostAmount = Number(object.boostAmount); - return message; - }; - - /** - * Creates a plain object from a ControlPoint message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @static - * @param {google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} message ControlPoint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ControlPoint.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.attributeValue = ""; - object.boostAmount = 0; - } - if (message.attributeValue != null && message.hasOwnProperty("attributeValue")) - object.attributeValue = message.attributeValue; - if (message.boostAmount != null && message.hasOwnProperty("boostAmount")) - object.boostAmount = options.json && !isFinite(message.boostAmount) ? String(message.boostAmount) : message.boostAmount; - return object; - }; - - /** - * Converts this ControlPoint to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @instance - * @returns {Object.} JSON object - */ - ControlPoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ControlPoint - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ControlPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint"; - }; - - return ControlPoint; - })(); - - /** - * AttributeType enum. - * @name google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType - * @enum {number} - * @property {number} ATTRIBUTE_TYPE_UNSPECIFIED=0 ATTRIBUTE_TYPE_UNSPECIFIED value - * @property {number} NUMERICAL=1 NUMERICAL value - * @property {number} FRESHNESS=2 FRESHNESS value - */ - BoostControlSpec.AttributeType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ATTRIBUTE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NUMERICAL"] = 1; - values[valuesById[2] = "FRESHNESS"] = 2; - return values; - })(); - - /** - * InterpolationType enum. - * @name google.cloud.ces.v1.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType - * @enum {number} - * @property {number} INTERPOLATION_TYPE_UNSPECIFIED=0 INTERPOLATION_TYPE_UNSPECIFIED value - * @property {number} LINEAR=1 LINEAR value - */ - BoostControlSpec.InterpolationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INTERPOLATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "LINEAR"] = 1; - return values; - })(); - - return BoostControlSpec; - })(); - - return ConditionBoostSpec; - })(); - - return BoostSpec; - })(); - - DataStoreTool.ModalityConfig = (function() { - - /** - * Properties of a ModalityConfig. - * @memberof google.cloud.ces.v1.DataStoreTool - * @interface IModalityConfig - * @property {google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType|null} [modalityType] ModalityConfig modalityType - * @property {google.cloud.ces.v1.DataStoreTool.IRewriterConfig|null} [rewriterConfig] ModalityConfig rewriterConfig - * @property {google.cloud.ces.v1.DataStoreTool.ISummarizationConfig|null} [summarizationConfig] ModalityConfig summarizationConfig - * @property {google.cloud.ces.v1.DataStoreTool.IGroundingConfig|null} [groundingConfig] ModalityConfig groundingConfig - */ - - /** - * Constructs a new ModalityConfig. - * @memberof google.cloud.ces.v1.DataStoreTool - * @classdesc Represents a ModalityConfig. - * @implements IModalityConfig - * @constructor - * @param {google.cloud.ces.v1.DataStoreTool.IModalityConfig=} [properties] Properties to set - */ - function ModalityConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ModalityConfig modalityType. - * @member {google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType} modalityType - * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig - * @instance - */ - ModalityConfig.prototype.modalityType = 0; - - /** - * ModalityConfig rewriterConfig. - * @member {google.cloud.ces.v1.DataStoreTool.IRewriterConfig|null|undefined} rewriterConfig - * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig - * @instance - */ - ModalityConfig.prototype.rewriterConfig = null; - - /** - * ModalityConfig summarizationConfig. - * @member {google.cloud.ces.v1.DataStoreTool.ISummarizationConfig|null|undefined} summarizationConfig - * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig - * @instance - */ - ModalityConfig.prototype.summarizationConfig = null; - - /** - * ModalityConfig groundingConfig. - * @member {google.cloud.ces.v1.DataStoreTool.IGroundingConfig|null|undefined} groundingConfig - * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig - * @instance - */ - ModalityConfig.prototype.groundingConfig = null; - - /** - * Creates a new ModalityConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IModalityConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DataStoreTool.ModalityConfig} ModalityConfig instance - */ - ModalityConfig.create = function create(properties) { - return new ModalityConfig(properties); - }; - - /** - * Encodes the specified ModalityConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.ModalityConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IModalityConfig} message ModalityConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModalityConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.modalityType != null && Object.hasOwnProperty.call(message, "modalityType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modalityType); - if (message.rewriterConfig != null && Object.hasOwnProperty.call(message, "rewriterConfig")) - $root.google.cloud.ces.v1.DataStoreTool.RewriterConfig.encode(message.rewriterConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.summarizationConfig != null && Object.hasOwnProperty.call(message, "summarizationConfig")) - $root.google.cloud.ces.v1.DataStoreTool.SummarizationConfig.encode(message.summarizationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.groundingConfig != null && Object.hasOwnProperty.call(message, "groundingConfig")) - $root.google.cloud.ces.v1.DataStoreTool.GroundingConfig.encode(message.groundingConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ModalityConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStoreTool.ModalityConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig - * @static - * @param {google.cloud.ces.v1.DataStoreTool.IModalityConfig} message ModalityConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModalityConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ModalityConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DataStoreTool.ModalityConfig} ModalityConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModalityConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStoreTool.ModalityConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.modalityType = reader.int32(); - break; - } - case 2: { - message.rewriterConfig = $root.google.cloud.ces.v1.DataStoreTool.RewriterConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.summarizationConfig = $root.google.cloud.ces.v1.DataStoreTool.SummarizationConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.groundingConfig = $root.google.cloud.ces.v1.DataStoreTool.GroundingConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ModalityConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DataStoreTool.ModalityConfig} ModalityConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModalityConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ModalityConfig message. - * @function verify - * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ModalityConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.modalityType != null && message.hasOwnProperty("modalityType")) - switch (message.modalityType) { - default: - return "modalityType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.rewriterConfig != null && message.hasOwnProperty("rewriterConfig")) { - var error = $root.google.cloud.ces.v1.DataStoreTool.RewriterConfig.verify(message.rewriterConfig); - if (error) - return "rewriterConfig." + error; - } - if (message.summarizationConfig != null && message.hasOwnProperty("summarizationConfig")) { - var error = $root.google.cloud.ces.v1.DataStoreTool.SummarizationConfig.verify(message.summarizationConfig); - if (error) - return "summarizationConfig." + error; - } - if (message.groundingConfig != null && message.hasOwnProperty("groundingConfig")) { - var error = $root.google.cloud.ces.v1.DataStoreTool.GroundingConfig.verify(message.groundingConfig); - if (error) - return "groundingConfig." + error; - } - return null; - }; - - /** - * Creates a ModalityConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DataStoreTool.ModalityConfig} ModalityConfig - */ - ModalityConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DataStoreTool.ModalityConfig) - return object; - var message = new $root.google.cloud.ces.v1.DataStoreTool.ModalityConfig(); - switch (object.modalityType) { - default: - if (typeof object.modalityType === "number") { - message.modalityType = object.modalityType; - break; - } - break; - case "MODALITY_TYPE_UNSPECIFIED": - case 0: - message.modalityType = 0; - break; - case "TEXT": - case 1: - message.modalityType = 1; - break; - case "AUDIO": - case 2: - message.modalityType = 2; - break; - } - if (object.rewriterConfig != null) { - if (typeof object.rewriterConfig !== "object") - throw TypeError(".google.cloud.ces.v1.DataStoreTool.ModalityConfig.rewriterConfig: object expected"); - message.rewriterConfig = $root.google.cloud.ces.v1.DataStoreTool.RewriterConfig.fromObject(object.rewriterConfig); - } - if (object.summarizationConfig != null) { - if (typeof object.summarizationConfig !== "object") - throw TypeError(".google.cloud.ces.v1.DataStoreTool.ModalityConfig.summarizationConfig: object expected"); - message.summarizationConfig = $root.google.cloud.ces.v1.DataStoreTool.SummarizationConfig.fromObject(object.summarizationConfig); - } - if (object.groundingConfig != null) { - if (typeof object.groundingConfig !== "object") - throw TypeError(".google.cloud.ces.v1.DataStoreTool.ModalityConfig.groundingConfig: object expected"); - message.groundingConfig = $root.google.cloud.ces.v1.DataStoreTool.GroundingConfig.fromObject(object.groundingConfig); - } - return message; - }; - - /** - * Creates a plain object from a ModalityConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig - * @static - * @param {google.cloud.ces.v1.DataStoreTool.ModalityConfig} message ModalityConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ModalityConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.modalityType = options.enums === String ? "MODALITY_TYPE_UNSPECIFIED" : 0; - object.rewriterConfig = null; - object.summarizationConfig = null; - object.groundingConfig = null; - } - if (message.modalityType != null && message.hasOwnProperty("modalityType")) - object.modalityType = options.enums === String ? $root.google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType[message.modalityType] === undefined ? message.modalityType : $root.google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType[message.modalityType] : message.modalityType; - if (message.rewriterConfig != null && message.hasOwnProperty("rewriterConfig")) - object.rewriterConfig = $root.google.cloud.ces.v1.DataStoreTool.RewriterConfig.toObject(message.rewriterConfig, options); - if (message.summarizationConfig != null && message.hasOwnProperty("summarizationConfig")) - object.summarizationConfig = $root.google.cloud.ces.v1.DataStoreTool.SummarizationConfig.toObject(message.summarizationConfig, options); - if (message.groundingConfig != null && message.hasOwnProperty("groundingConfig")) - object.groundingConfig = $root.google.cloud.ces.v1.DataStoreTool.GroundingConfig.toObject(message.groundingConfig, options); - return object; - }; - - /** - * Converts this ModalityConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig - * @instance - * @returns {Object.} JSON object - */ - ModalityConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ModalityConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DataStoreTool.ModalityConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ModalityConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DataStoreTool.ModalityConfig"; - }; - - /** - * ModalityType enum. - * @name google.cloud.ces.v1.DataStoreTool.ModalityConfig.ModalityType - * @enum {number} - * @property {number} MODALITY_TYPE_UNSPECIFIED=0 MODALITY_TYPE_UNSPECIFIED value - * @property {number} TEXT=1 TEXT value - * @property {number} AUDIO=2 AUDIO value - */ - ModalityConfig.ModalityType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODALITY_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "TEXT"] = 1; - values[valuesById[2] = "AUDIO"] = 2; - return values; - })(); - - return ModalityConfig; - })(); - - /** - * FilterParameterBehavior enum. - * @name google.cloud.ces.v1.DataStoreTool.FilterParameterBehavior - * @enum {number} - * @property {number} FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED=0 FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED value - * @property {number} ALWAYS_INCLUDE=2 ALWAYS_INCLUDE value - * @property {number} NEVER_INCLUDE=3 NEVER_INCLUDE value - */ - DataStoreTool.FilterParameterBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[2] = "ALWAYS_INCLUDE"] = 2; - values[valuesById[3] = "NEVER_INCLUDE"] = 3; - return values; - })(); - - return DataStoreTool; - })(); - - v1.DataStore = (function() { - - /** - * Properties of a DataStore. - * @memberof google.cloud.ces.v1 - * @interface IDataStore - * @property {string|null} [name] DataStore name - * @property {google.cloud.ces.v1.DataStore.DataStoreType|null} [type] DataStore type - * @property {google.cloud.ces.v1.DataStore.DocumentProcessingMode|null} [documentProcessingMode] DataStore documentProcessingMode - * @property {string|null} [displayName] DataStore displayName - * @property {google.protobuf.ITimestamp|null} [createTime] DataStore createTime - * @property {google.cloud.ces.v1.DataStore.IConnectorConfig|null} [connectorConfig] DataStore connectorConfig - */ - - /** - * Constructs a new DataStore. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a DataStore. - * @implements IDataStore - * @constructor - * @param {google.cloud.ces.v1.IDataStore=} [properties] Properties to set - */ - function DataStore(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataStore name. - * @member {string} name - * @memberof google.cloud.ces.v1.DataStore - * @instance - */ - DataStore.prototype.name = ""; - - /** - * DataStore type. - * @member {google.cloud.ces.v1.DataStore.DataStoreType} type - * @memberof google.cloud.ces.v1.DataStore - * @instance - */ - DataStore.prototype.type = 0; - - /** - * DataStore documentProcessingMode. - * @member {google.cloud.ces.v1.DataStore.DocumentProcessingMode} documentProcessingMode - * @memberof google.cloud.ces.v1.DataStore - * @instance - */ - DataStore.prototype.documentProcessingMode = 0; - - /** - * DataStore displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1.DataStore - * @instance - */ - DataStore.prototype.displayName = ""; - - /** - * DataStore createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1.DataStore - * @instance - */ - DataStore.prototype.createTime = null; - - /** - * DataStore connectorConfig. - * @member {google.cloud.ces.v1.DataStore.IConnectorConfig|null|undefined} connectorConfig - * @memberof google.cloud.ces.v1.DataStore - * @instance - */ - DataStore.prototype.connectorConfig = null; - - /** - * Creates a new DataStore instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DataStore - * @static - * @param {google.cloud.ces.v1.IDataStore=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DataStore} DataStore instance - */ - DataStore.create = function create(properties) { - return new DataStore(properties); - }; - - /** - * Encodes the specified DataStore message. Does not implicitly {@link google.cloud.ces.v1.DataStore.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DataStore - * @static - * @param {google.cloud.ces.v1.IDataStore} message DataStore message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataStore.encode = function encode(message, writer) { - if (!writer) - 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 0 =*/16).int32(message.type); - if (message.documentProcessingMode != null && Object.hasOwnProperty.call(message, "documentProcessingMode")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.documentProcessingMode); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.connectorConfig != null && Object.hasOwnProperty.call(message, "connectorConfig")) - $root.google.cloud.ces.v1.DataStore.ConnectorConfig.encode(message.connectorConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataStore message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStore.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DataStore - * @static - * @param {google.cloud.ces.v1.IDataStore} message DataStore message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataStore.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataStore message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DataStore - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DataStore} DataStore - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataStore.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStore(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.type = reader.int32(); - break; - } - case 4: { - message.documentProcessingMode = reader.int32(); - break; - } - case 5: { - message.displayName = reader.string(); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.connectorConfig = $root.google.cloud.ces.v1.DataStore.ConnectorConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataStore message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DataStore - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DataStore} DataStore - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataStore.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataStore message. - * @function verify - * @memberof google.cloud.ces.v1.DataStore - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataStore.verify = function verify(message) { - if (typeof message !== "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")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.documentProcessingMode != null && message.hasOwnProperty("documentProcessingMode")) - switch (message.documentProcessingMode) { - default: - return "documentProcessingMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: 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.connectorConfig != null && message.hasOwnProperty("connectorConfig")) { - var error = $root.google.cloud.ces.v1.DataStore.ConnectorConfig.verify(message.connectorConfig); - if (error) - return "connectorConfig." + error; - } - return null; - }; - - /** - * Creates a DataStore message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DataStore - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DataStore} DataStore - */ - DataStore.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DataStore) - return object; - var message = new $root.google.cloud.ces.v1.DataStore(); - if (object.name != null) - message.name = String(object.name); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "DATA_STORE_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "PUBLIC_WEB": - case 1: - message.type = 1; - break; - case "UNSTRUCTURED": - case 2: - message.type = 2; - break; - case "FAQ": - case 3: - message.type = 3; - break; - case "CONNECTOR": - case 4: - message.type = 4; - break; - } - switch (object.documentProcessingMode) { - default: - if (typeof object.documentProcessingMode === "number") { - message.documentProcessingMode = object.documentProcessingMode; - break; - } - break; - case "DOCUMENT_PROCESSING_MODE_UNSPECIFIED": - case 0: - message.documentProcessingMode = 0; - break; - case "DOCUMENTS": - case 1: - message.documentProcessingMode = 1; - break; - case "CHUNKS": - case 2: - message.documentProcessingMode = 2; - break; - } - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1.DataStore.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.connectorConfig != null) { - if (typeof object.connectorConfig !== "object") - throw TypeError(".google.cloud.ces.v1.DataStore.connectorConfig: object expected"); - message.connectorConfig = $root.google.cloud.ces.v1.DataStore.ConnectorConfig.fromObject(object.connectorConfig); - } - return message; - }; - - /** - * Creates a plain object from a DataStore message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DataStore - * @static - * @param {google.cloud.ces.v1.DataStore} message DataStore - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataStore.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.type = options.enums === String ? "DATA_STORE_TYPE_UNSPECIFIED" : 0; - object.documentProcessingMode = options.enums === String ? "DOCUMENT_PROCESSING_MODE_UNSPECIFIED" : 0; - object.displayName = ""; - object.createTime = null; - object.connectorConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.ces.v1.DataStore.DataStoreType[message.type] === undefined ? message.type : $root.google.cloud.ces.v1.DataStore.DataStoreType[message.type] : message.type; - if (message.documentProcessingMode != null && message.hasOwnProperty("documentProcessingMode")) - object.documentProcessingMode = options.enums === String ? $root.google.cloud.ces.v1.DataStore.DocumentProcessingMode[message.documentProcessingMode] === undefined ? message.documentProcessingMode : $root.google.cloud.ces.v1.DataStore.DocumentProcessingMode[message.documentProcessingMode] : message.documentProcessingMode; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.connectorConfig != null && message.hasOwnProperty("connectorConfig")) - object.connectorConfig = $root.google.cloud.ces.v1.DataStore.ConnectorConfig.toObject(message.connectorConfig, options); - return object; - }; - - /** - * Converts this DataStore to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DataStore - * @instance - * @returns {Object.} JSON object - */ - DataStore.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataStore - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DataStore - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataStore.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DataStore"; - }; - - DataStore.ConnectorConfig = (function() { - - /** - * Properties of a ConnectorConfig. - * @memberof google.cloud.ces.v1.DataStore - * @interface IConnectorConfig - * @property {string|null} [collection] ConnectorConfig collection - * @property {string|null} [collectionDisplayName] ConnectorConfig collectionDisplayName - * @property {string|null} [dataSource] ConnectorConfig dataSource - */ - - /** - * Constructs a new ConnectorConfig. - * @memberof google.cloud.ces.v1.DataStore - * @classdesc Represents a ConnectorConfig. - * @implements IConnectorConfig - * @constructor - * @param {google.cloud.ces.v1.DataStore.IConnectorConfig=} [properties] Properties to set - */ - function ConnectorConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectorConfig collection. - * @member {string} collection - * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig - * @instance - */ - ConnectorConfig.prototype.collection = ""; - - /** - * ConnectorConfig collectionDisplayName. - * @member {string} collectionDisplayName - * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig - * @instance - */ - ConnectorConfig.prototype.collectionDisplayName = ""; - - /** - * ConnectorConfig dataSource. - * @member {string} dataSource - * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig - * @instance - */ - ConnectorConfig.prototype.dataSource = ""; - - /** - * Creates a new ConnectorConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig - * @static - * @param {google.cloud.ces.v1.DataStore.IConnectorConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.DataStore.ConnectorConfig} ConnectorConfig instance - */ - ConnectorConfig.create = function create(properties) { - return new ConnectorConfig(properties); - }; - - /** - * Encodes the specified ConnectorConfig message. Does not implicitly {@link google.cloud.ces.v1.DataStore.ConnectorConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig - * @static - * @param {google.cloud.ces.v1.DataStore.IConnectorConfig} message ConnectorConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectorConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.collection != null && Object.hasOwnProperty.call(message, "collection")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.collection); - if (message.collectionDisplayName != null && Object.hasOwnProperty.call(message, "collectionDisplayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.collectionDisplayName); - if (message.dataSource != null && Object.hasOwnProperty.call(message, "dataSource")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dataSource); - return writer; - }; - - /** - * Encodes the specified ConnectorConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.DataStore.ConnectorConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig - * @static - * @param {google.cloud.ces.v1.DataStore.IConnectorConfig} message ConnectorConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectorConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectorConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.DataStore.ConnectorConfig} ConnectorConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectorConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.DataStore.ConnectorConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.collection = reader.string(); - break; - } - case 2: { - message.collectionDisplayName = reader.string(); - break; - } - case 3: { - message.dataSource = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectorConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.DataStore.ConnectorConfig} ConnectorConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectorConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectorConfig message. - * @function verify - * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectorConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.collection != null && message.hasOwnProperty("collection")) - if (!$util.isString(message.collection)) - return "collection: string expected"; - if (message.collectionDisplayName != null && message.hasOwnProperty("collectionDisplayName")) - if (!$util.isString(message.collectionDisplayName)) - return "collectionDisplayName: string expected"; - if (message.dataSource != null && message.hasOwnProperty("dataSource")) - if (!$util.isString(message.dataSource)) - return "dataSource: string expected"; - return null; - }; - - /** - * Creates a ConnectorConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.DataStore.ConnectorConfig} ConnectorConfig - */ - ConnectorConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.DataStore.ConnectorConfig) - return object; - var message = new $root.google.cloud.ces.v1.DataStore.ConnectorConfig(); - if (object.collection != null) - message.collection = String(object.collection); - if (object.collectionDisplayName != null) - message.collectionDisplayName = String(object.collectionDisplayName); - if (object.dataSource != null) - message.dataSource = String(object.dataSource); - return message; - }; - - /** - * Creates a plain object from a ConnectorConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig - * @static - * @param {google.cloud.ces.v1.DataStore.ConnectorConfig} message ConnectorConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectorConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.collection = ""; - object.collectionDisplayName = ""; - object.dataSource = ""; - } - if (message.collection != null && message.hasOwnProperty("collection")) - object.collection = message.collection; - if (message.collectionDisplayName != null && message.hasOwnProperty("collectionDisplayName")) - object.collectionDisplayName = message.collectionDisplayName; - if (message.dataSource != null && message.hasOwnProperty("dataSource")) - object.dataSource = message.dataSource; - return object; - }; - - /** - * Converts this ConnectorConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig - * @instance - * @returns {Object.} JSON object - */ - ConnectorConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConnectorConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.DataStore.ConnectorConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConnectorConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.DataStore.ConnectorConfig"; - }; - - return ConnectorConfig; - })(); - - /** - * DataStoreType enum. - * @name google.cloud.ces.v1.DataStore.DataStoreType - * @enum {number} - * @property {number} DATA_STORE_TYPE_UNSPECIFIED=0 DATA_STORE_TYPE_UNSPECIFIED value - * @property {number} PUBLIC_WEB=1 PUBLIC_WEB value - * @property {number} UNSTRUCTURED=2 UNSTRUCTURED value - * @property {number} FAQ=3 FAQ value - * @property {number} CONNECTOR=4 CONNECTOR value - */ - DataStore.DataStoreType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATA_STORE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PUBLIC_WEB"] = 1; - values[valuesById[2] = "UNSTRUCTURED"] = 2; - values[valuesById[3] = "FAQ"] = 3; - values[valuesById[4] = "CONNECTOR"] = 4; - return values; - })(); - - /** - * DocumentProcessingMode enum. - * @name google.cloud.ces.v1.DataStore.DocumentProcessingMode - * @enum {number} - * @property {number} DOCUMENT_PROCESSING_MODE_UNSPECIFIED=0 DOCUMENT_PROCESSING_MODE_UNSPECIFIED value - * @property {number} DOCUMENTS=1 DOCUMENTS value - * @property {number} CHUNKS=2 CHUNKS value - */ - DataStore.DocumentProcessingMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DOCUMENT_PROCESSING_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DOCUMENTS"] = 1; - values[valuesById[2] = "CHUNKS"] = 2; - return values; - })(); - - return DataStore; - })(); - - v1.CodeBlock = (function() { - - /** - * Properties of a CodeBlock. - * @memberof google.cloud.ces.v1 - * @interface ICodeBlock - * @property {string|null} [pythonCode] CodeBlock pythonCode - */ - - /** - * Constructs a new CodeBlock. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a CodeBlock. - * @implements ICodeBlock - * @constructor - * @param {google.cloud.ces.v1.ICodeBlock=} [properties] Properties to set - */ - function CodeBlock(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CodeBlock pythonCode. - * @member {string} pythonCode - * @memberof google.cloud.ces.v1.CodeBlock - * @instance - */ - CodeBlock.prototype.pythonCode = ""; - - /** - * Creates a new CodeBlock instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.CodeBlock - * @static - * @param {google.cloud.ces.v1.ICodeBlock=} [properties] Properties to set - * @returns {google.cloud.ces.v1.CodeBlock} CodeBlock instance - */ - CodeBlock.create = function create(properties) { - return new CodeBlock(properties); - }; - - /** - * Encodes the specified CodeBlock message. Does not implicitly {@link google.cloud.ces.v1.CodeBlock.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.CodeBlock - * @static - * @param {google.cloud.ces.v1.ICodeBlock} message CodeBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CodeBlock.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pythonCode); - return writer; - }; - - /** - * Encodes the specified CodeBlock message, length delimited. Does not implicitly {@link google.cloud.ces.v1.CodeBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.CodeBlock - * @static - * @param {google.cloud.ces.v1.ICodeBlock} message CodeBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CodeBlock.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CodeBlock message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.CodeBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.CodeBlock} CodeBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CodeBlock.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.CodeBlock(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pythonCode = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CodeBlock message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.CodeBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.CodeBlock} CodeBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CodeBlock.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CodeBlock message. - * @function verify - * @memberof google.cloud.ces.v1.CodeBlock - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CodeBlock.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) - if (!$util.isString(message.pythonCode)) - return "pythonCode: string expected"; - return null; - }; - - /** - * Creates a CodeBlock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.CodeBlock - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.CodeBlock} CodeBlock - */ - CodeBlock.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.CodeBlock) - return object; - var message = new $root.google.cloud.ces.v1.CodeBlock(); - if (object.pythonCode != null) - message.pythonCode = String(object.pythonCode); - return message; - }; - - /** - * Creates a plain object from a CodeBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.CodeBlock - * @static - * @param {google.cloud.ces.v1.CodeBlock} message CodeBlock - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CodeBlock.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.pythonCode = ""; - if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) - object.pythonCode = message.pythonCode; - return object; - }; - - /** - * Converts this CodeBlock to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.CodeBlock - * @instance - * @returns {Object.} JSON object - */ - CodeBlock.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CodeBlock - * @function getTypeUrl - * @memberof google.cloud.ces.v1.CodeBlock - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CodeBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.CodeBlock"; - }; - - return CodeBlock; - })(); - - v1.ToolFakeConfig = (function() { - - /** - * Properties of a ToolFakeConfig. - * @memberof google.cloud.ces.v1 - * @interface IToolFakeConfig - * @property {google.cloud.ces.v1.ICodeBlock|null} [codeBlock] ToolFakeConfig codeBlock - * @property {boolean|null} [enableFakeMode] ToolFakeConfig enableFakeMode - */ - - /** - * Constructs a new ToolFakeConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ToolFakeConfig. - * @implements IToolFakeConfig - * @constructor - * @param {google.cloud.ces.v1.IToolFakeConfig=} [properties] Properties to set - */ - function ToolFakeConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolFakeConfig codeBlock. - * @member {google.cloud.ces.v1.ICodeBlock|null|undefined} codeBlock - * @memberof google.cloud.ces.v1.ToolFakeConfig - * @instance - */ - ToolFakeConfig.prototype.codeBlock = null; - - /** - * ToolFakeConfig enableFakeMode. - * @member {boolean} enableFakeMode - * @memberof google.cloud.ces.v1.ToolFakeConfig - * @instance - */ - ToolFakeConfig.prototype.enableFakeMode = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ToolFakeConfig toolResponse. - * @member {"codeBlock"|undefined} toolResponse - * @memberof google.cloud.ces.v1.ToolFakeConfig - * @instance - */ - Object.defineProperty(ToolFakeConfig.prototype, "toolResponse", { - get: $util.oneOfGetter($oneOfFields = ["codeBlock"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ToolFakeConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ToolFakeConfig - * @static - * @param {google.cloud.ces.v1.IToolFakeConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ToolFakeConfig} ToolFakeConfig instance - */ - ToolFakeConfig.create = function create(properties) { - return new ToolFakeConfig(properties); - }; - - /** - * Encodes the specified ToolFakeConfig message. Does not implicitly {@link google.cloud.ces.v1.ToolFakeConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ToolFakeConfig - * @static - * @param {google.cloud.ces.v1.IToolFakeConfig} message ToolFakeConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolFakeConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.codeBlock != null && Object.hasOwnProperty.call(message, "codeBlock")) - $root.google.cloud.ces.v1.CodeBlock.encode(message.codeBlock, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.enableFakeMode != null && Object.hasOwnProperty.call(message, "enableFakeMode")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableFakeMode); - return writer; - }; - - /** - * Encodes the specified ToolFakeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolFakeConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ToolFakeConfig - * @static - * @param {google.cloud.ces.v1.IToolFakeConfig} message ToolFakeConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolFakeConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolFakeConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ToolFakeConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ToolFakeConfig} ToolFakeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolFakeConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ToolFakeConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.codeBlock = $root.google.cloud.ces.v1.CodeBlock.decode(reader, reader.uint32()); - break; - } - case 2: { - message.enableFakeMode = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolFakeConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ToolFakeConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ToolFakeConfig} ToolFakeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolFakeConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolFakeConfig message. - * @function verify - * @memberof google.cloud.ces.v1.ToolFakeConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolFakeConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.codeBlock != null && message.hasOwnProperty("codeBlock")) { - properties.toolResponse = 1; - { - var error = $root.google.cloud.ces.v1.CodeBlock.verify(message.codeBlock); - if (error) - return "codeBlock." + error; - } - } - if (message.enableFakeMode != null && message.hasOwnProperty("enableFakeMode")) - if (typeof message.enableFakeMode !== "boolean") - return "enableFakeMode: boolean expected"; - return null; - }; - - /** - * Creates a ToolFakeConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ToolFakeConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ToolFakeConfig} ToolFakeConfig - */ - ToolFakeConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ToolFakeConfig) - return object; - var message = new $root.google.cloud.ces.v1.ToolFakeConfig(); - if (object.codeBlock != null) { - if (typeof object.codeBlock !== "object") - throw TypeError(".google.cloud.ces.v1.ToolFakeConfig.codeBlock: object expected"); - message.codeBlock = $root.google.cloud.ces.v1.CodeBlock.fromObject(object.codeBlock); - } - if (object.enableFakeMode != null) - message.enableFakeMode = Boolean(object.enableFakeMode); - return message; - }; - - /** - * Creates a plain object from a ToolFakeConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ToolFakeConfig - * @static - * @param {google.cloud.ces.v1.ToolFakeConfig} message ToolFakeConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolFakeConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.enableFakeMode = false; - if (message.codeBlock != null && message.hasOwnProperty("codeBlock")) { - object.codeBlock = $root.google.cloud.ces.v1.CodeBlock.toObject(message.codeBlock, options); - if (options.oneofs) - object.toolResponse = "codeBlock"; - } - if (message.enableFakeMode != null && message.hasOwnProperty("enableFakeMode")) - object.enableFakeMode = message.enableFakeMode; - return object; - }; - - /** - * Converts this ToolFakeConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ToolFakeConfig - * @instance - * @returns {Object.} JSON object - */ - ToolFakeConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolFakeConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ToolFakeConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolFakeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ToolFakeConfig"; - }; - - return ToolFakeConfig; - })(); - - v1.FileSearchTool = (function() { - - /** - * Properties of a FileSearchTool. - * @memberof google.cloud.ces.v1 - * @interface IFileSearchTool - * @property {google.cloud.ces.v1.FileSearchTool.CorpusType|null} [corpusType] FileSearchTool corpusType - * @property {string|null} [name] FileSearchTool name - * @property {string|null} [description] FileSearchTool description - * @property {string|null} [fileCorpus] FileSearchTool fileCorpus - */ - - /** - * Constructs a new FileSearchTool. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a FileSearchTool. - * @implements IFileSearchTool - * @constructor - * @param {google.cloud.ces.v1.IFileSearchTool=} [properties] Properties to set - */ - function FileSearchTool(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileSearchTool corpusType. - * @member {google.cloud.ces.v1.FileSearchTool.CorpusType} corpusType - * @memberof google.cloud.ces.v1.FileSearchTool - * @instance - */ - FileSearchTool.prototype.corpusType = 0; - - /** - * FileSearchTool name. - * @member {string} name - * @memberof google.cloud.ces.v1.FileSearchTool - * @instance - */ - FileSearchTool.prototype.name = ""; - - /** - * FileSearchTool description. - * @member {string} description - * @memberof google.cloud.ces.v1.FileSearchTool - * @instance - */ - FileSearchTool.prototype.description = ""; - - /** - * FileSearchTool fileCorpus. - * @member {string} fileCorpus - * @memberof google.cloud.ces.v1.FileSearchTool - * @instance - */ - FileSearchTool.prototype.fileCorpus = ""; - - /** - * Creates a new FileSearchTool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.FileSearchTool - * @static - * @param {google.cloud.ces.v1.IFileSearchTool=} [properties] Properties to set - * @returns {google.cloud.ces.v1.FileSearchTool} FileSearchTool instance - */ - FileSearchTool.create = function create(properties) { - return new FileSearchTool(properties); - }; - - /** - * Encodes the specified FileSearchTool message. Does not implicitly {@link google.cloud.ces.v1.FileSearchTool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.FileSearchTool - * @static - * @param {google.cloud.ces.v1.IFileSearchTool} message FileSearchTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileSearchTool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.corpusType != null && Object.hasOwnProperty.call(message, "corpusType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.corpusType); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); - if (message.fileCorpus != null && Object.hasOwnProperty.call(message, "fileCorpus")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.fileCorpus); - return writer; - }; - - /** - * Encodes the specified FileSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.FileSearchTool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.FileSearchTool - * @static - * @param {google.cloud.ces.v1.IFileSearchTool} message FileSearchTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileSearchTool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileSearchTool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.FileSearchTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.FileSearchTool} FileSearchTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileSearchTool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.FileSearchTool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.corpusType = reader.int32(); - break; - } - case 4: { - message.name = reader.string(); - break; - } - case 5: { - message.description = reader.string(); - break; - } - case 6: { - message.fileCorpus = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileSearchTool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.FileSearchTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.FileSearchTool} FileSearchTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileSearchTool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileSearchTool message. - * @function verify - * @memberof google.cloud.ces.v1.FileSearchTool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileSearchTool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.corpusType != null && message.hasOwnProperty("corpusType")) - switch (message.corpusType) { - default: - return "corpusType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.fileCorpus != null && message.hasOwnProperty("fileCorpus")) - if (!$util.isString(message.fileCorpus)) - return "fileCorpus: string expected"; - return null; - }; - - /** - * Creates a FileSearchTool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.FileSearchTool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.FileSearchTool} FileSearchTool - */ - FileSearchTool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.FileSearchTool) - return object; - var message = new $root.google.cloud.ces.v1.FileSearchTool(); - switch (object.corpusType) { - default: - if (typeof object.corpusType === "number") { - message.corpusType = object.corpusType; - break; - } - break; - case "CORPUS_TYPE_UNSPECIFIED": - case 0: - message.corpusType = 0; - break; - case "USER_OWNED": - case 1: - message.corpusType = 1; - break; - case "FULLY_MANAGED": - case 2: - message.corpusType = 2; - break; - } - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.fileCorpus != null) - message.fileCorpus = String(object.fileCorpus); - return message; - }; - - /** - * Creates a plain object from a FileSearchTool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.FileSearchTool - * @static - * @param {google.cloud.ces.v1.FileSearchTool} message FileSearchTool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileSearchTool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.corpusType = options.enums === String ? "CORPUS_TYPE_UNSPECIFIED" : 0; - object.name = ""; - object.description = ""; - object.fileCorpus = ""; - } - if (message.corpusType != null && message.hasOwnProperty("corpusType")) - object.corpusType = options.enums === String ? $root.google.cloud.ces.v1.FileSearchTool.CorpusType[message.corpusType] === undefined ? message.corpusType : $root.google.cloud.ces.v1.FileSearchTool.CorpusType[message.corpusType] : message.corpusType; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.fileCorpus != null && message.hasOwnProperty("fileCorpus")) - object.fileCorpus = message.fileCorpus; - return object; - }; - - /** - * Converts this FileSearchTool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.FileSearchTool - * @instance - * @returns {Object.} JSON object - */ - FileSearchTool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileSearchTool - * @function getTypeUrl - * @memberof google.cloud.ces.v1.FileSearchTool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileSearchTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.FileSearchTool"; - }; - - /** - * CorpusType enum. - * @name google.cloud.ces.v1.FileSearchTool.CorpusType - * @enum {number} - * @property {number} CORPUS_TYPE_UNSPECIFIED=0 CORPUS_TYPE_UNSPECIFIED value - * @property {number} USER_OWNED=1 USER_OWNED value - * @property {number} FULLY_MANAGED=2 FULLY_MANAGED value - */ - FileSearchTool.CorpusType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CORPUS_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "USER_OWNED"] = 1; - values[valuesById[2] = "FULLY_MANAGED"] = 2; - return values; - })(); - - return FileSearchTool; - })(); - - v1.GoogleSearchTool = (function() { - - /** - * Properties of a GoogleSearchTool. - * @memberof google.cloud.ces.v1 - * @interface IGoogleSearchTool - * @property {string|null} [name] GoogleSearchTool name - * @property {string|null} [description] GoogleSearchTool description - * @property {Array.|null} [contextUrls] GoogleSearchTool contextUrls - * @property {Array.|null} [preferredDomains] GoogleSearchTool preferredDomains - * @property {Array.|null} [excludeDomains] GoogleSearchTool excludeDomains - * @property {google.cloud.ces.v1.GoogleSearchTool.IPromptConfig|null} [promptConfig] GoogleSearchTool promptConfig - */ - - /** - * Constructs a new GoogleSearchTool. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a GoogleSearchTool. - * @implements IGoogleSearchTool - * @constructor - * @param {google.cloud.ces.v1.IGoogleSearchTool=} [properties] Properties to set - */ - function GoogleSearchTool(properties) { - this.contextUrls = []; - this.preferredDomains = []; - this.excludeDomains = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoogleSearchTool name. - * @member {string} name - * @memberof google.cloud.ces.v1.GoogleSearchTool - * @instance - */ - GoogleSearchTool.prototype.name = ""; - - /** - * GoogleSearchTool description. - * @member {string} description - * @memberof google.cloud.ces.v1.GoogleSearchTool - * @instance - */ - GoogleSearchTool.prototype.description = ""; - - /** - * GoogleSearchTool contextUrls. - * @member {Array.} contextUrls - * @memberof google.cloud.ces.v1.GoogleSearchTool - * @instance - */ - GoogleSearchTool.prototype.contextUrls = $util.emptyArray; - - /** - * GoogleSearchTool preferredDomains. - * @member {Array.} preferredDomains - * @memberof google.cloud.ces.v1.GoogleSearchTool - * @instance - */ - GoogleSearchTool.prototype.preferredDomains = $util.emptyArray; - - /** - * GoogleSearchTool excludeDomains. - * @member {Array.} excludeDomains - * @memberof google.cloud.ces.v1.GoogleSearchTool - * @instance - */ - GoogleSearchTool.prototype.excludeDomains = $util.emptyArray; - - /** - * GoogleSearchTool promptConfig. - * @member {google.cloud.ces.v1.GoogleSearchTool.IPromptConfig|null|undefined} promptConfig - * @memberof google.cloud.ces.v1.GoogleSearchTool - * @instance - */ - GoogleSearchTool.prototype.promptConfig = null; - - /** - * Creates a new GoogleSearchTool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.GoogleSearchTool - * @static - * @param {google.cloud.ces.v1.IGoogleSearchTool=} [properties] Properties to set - * @returns {google.cloud.ces.v1.GoogleSearchTool} GoogleSearchTool instance - */ - GoogleSearchTool.create = function create(properties) { - return new GoogleSearchTool(properties); - }; - - /** - * Encodes the specified GoogleSearchTool message. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchTool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.GoogleSearchTool - * @static - * @param {google.cloud.ces.v1.IGoogleSearchTool} message GoogleSearchTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoogleSearchTool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.contextUrls != null && message.contextUrls.length) - for (var i = 0; i < message.contextUrls.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.contextUrls[i]); - if (message.excludeDomains != null && message.excludeDomains.length) - for (var i = 0; i < message.excludeDomains.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.excludeDomains[i]); - if (message.promptConfig != null && Object.hasOwnProperty.call(message, "promptConfig")) - $root.google.cloud.ces.v1.GoogleSearchTool.PromptConfig.encode(message.promptConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.preferredDomains != null && message.preferredDomains.length) - for (var i = 0; i < message.preferredDomains.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.preferredDomains[i]); - return writer; - }; - - /** - * Encodes the specified GoogleSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchTool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.GoogleSearchTool - * @static - * @param {google.cloud.ces.v1.IGoogleSearchTool} message GoogleSearchTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoogleSearchTool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoogleSearchTool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.GoogleSearchTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.GoogleSearchTool} GoogleSearchTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoogleSearchTool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GoogleSearchTool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - if (!(message.contextUrls && message.contextUrls.length)) - message.contextUrls = []; - message.contextUrls.push(reader.string()); - break; - } - case 6: { - if (!(message.preferredDomains && message.preferredDomains.length)) - message.preferredDomains = []; - message.preferredDomains.push(reader.string()); - break; - } - case 4: { - if (!(message.excludeDomains && message.excludeDomains.length)) - message.excludeDomains = []; - message.excludeDomains.push(reader.string()); - break; - } - case 5: { - message.promptConfig = $root.google.cloud.ces.v1.GoogleSearchTool.PromptConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoogleSearchTool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.GoogleSearchTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.GoogleSearchTool} GoogleSearchTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoogleSearchTool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoogleSearchTool message. - * @function verify - * @memberof google.cloud.ces.v1.GoogleSearchTool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoogleSearchTool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.contextUrls != null && message.hasOwnProperty("contextUrls")) { - if (!Array.isArray(message.contextUrls)) - return "contextUrls: array expected"; - for (var i = 0; i < message.contextUrls.length; ++i) - if (!$util.isString(message.contextUrls[i])) - return "contextUrls: string[] expected"; - } - if (message.preferredDomains != null && message.hasOwnProperty("preferredDomains")) { - if (!Array.isArray(message.preferredDomains)) - return "preferredDomains: array expected"; - for (var i = 0; i < message.preferredDomains.length; ++i) - if (!$util.isString(message.preferredDomains[i])) - return "preferredDomains: string[] expected"; - } - if (message.excludeDomains != null && message.hasOwnProperty("excludeDomains")) { - if (!Array.isArray(message.excludeDomains)) - return "excludeDomains: array expected"; - for (var i = 0; i < message.excludeDomains.length; ++i) - if (!$util.isString(message.excludeDomains[i])) - return "excludeDomains: string[] expected"; - } - if (message.promptConfig != null && message.hasOwnProperty("promptConfig")) { - var error = $root.google.cloud.ces.v1.GoogleSearchTool.PromptConfig.verify(message.promptConfig); - if (error) - return "promptConfig." + error; - } - return null; - }; - - /** - * Creates a GoogleSearchTool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.GoogleSearchTool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.GoogleSearchTool} GoogleSearchTool - */ - GoogleSearchTool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.GoogleSearchTool) - return object; - var message = new $root.google.cloud.ces.v1.GoogleSearchTool(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.contextUrls) { - if (!Array.isArray(object.contextUrls)) - throw TypeError(".google.cloud.ces.v1.GoogleSearchTool.contextUrls: array expected"); - message.contextUrls = []; - for (var i = 0; i < object.contextUrls.length; ++i) - message.contextUrls[i] = String(object.contextUrls[i]); - } - if (object.preferredDomains) { - if (!Array.isArray(object.preferredDomains)) - throw TypeError(".google.cloud.ces.v1.GoogleSearchTool.preferredDomains: array expected"); - message.preferredDomains = []; - for (var i = 0; i < object.preferredDomains.length; ++i) - message.preferredDomains[i] = String(object.preferredDomains[i]); - } - if (object.excludeDomains) { - if (!Array.isArray(object.excludeDomains)) - throw TypeError(".google.cloud.ces.v1.GoogleSearchTool.excludeDomains: array expected"); - message.excludeDomains = []; - for (var i = 0; i < object.excludeDomains.length; ++i) - message.excludeDomains[i] = String(object.excludeDomains[i]); - } - if (object.promptConfig != null) { - if (typeof object.promptConfig !== "object") - throw TypeError(".google.cloud.ces.v1.GoogleSearchTool.promptConfig: object expected"); - message.promptConfig = $root.google.cloud.ces.v1.GoogleSearchTool.PromptConfig.fromObject(object.promptConfig); - } - return message; - }; - - /** - * Creates a plain object from a GoogleSearchTool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.GoogleSearchTool - * @static - * @param {google.cloud.ces.v1.GoogleSearchTool} message GoogleSearchTool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoogleSearchTool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.contextUrls = []; - object.excludeDomains = []; - object.preferredDomains = []; - } - if (options.defaults) { - object.name = ""; - object.description = ""; - object.promptConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.contextUrls && message.contextUrls.length) { - object.contextUrls = []; - for (var j = 0; j < message.contextUrls.length; ++j) - object.contextUrls[j] = message.contextUrls[j]; - } - if (message.excludeDomains && message.excludeDomains.length) { - object.excludeDomains = []; - for (var j = 0; j < message.excludeDomains.length; ++j) - object.excludeDomains[j] = message.excludeDomains[j]; - } - if (message.promptConfig != null && message.hasOwnProperty("promptConfig")) - object.promptConfig = $root.google.cloud.ces.v1.GoogleSearchTool.PromptConfig.toObject(message.promptConfig, options); - if (message.preferredDomains && message.preferredDomains.length) { - object.preferredDomains = []; - for (var j = 0; j < message.preferredDomains.length; ++j) - object.preferredDomains[j] = message.preferredDomains[j]; - } - return object; - }; - - /** - * Converts this GoogleSearchTool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.GoogleSearchTool - * @instance - * @returns {Object.} JSON object - */ - GoogleSearchTool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoogleSearchTool - * @function getTypeUrl - * @memberof google.cloud.ces.v1.GoogleSearchTool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoogleSearchTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.GoogleSearchTool"; - }; - - GoogleSearchTool.PromptConfig = (function() { - - /** - * Properties of a PromptConfig. - * @memberof google.cloud.ces.v1.GoogleSearchTool - * @interface IPromptConfig - * @property {string|null} [textPrompt] PromptConfig textPrompt - * @property {string|null} [voicePrompt] PromptConfig voicePrompt - */ - - /** - * Constructs a new PromptConfig. - * @memberof google.cloud.ces.v1.GoogleSearchTool - * @classdesc Represents a PromptConfig. - * @implements IPromptConfig - * @constructor - * @param {google.cloud.ces.v1.GoogleSearchTool.IPromptConfig=} [properties] Properties to set - */ - function PromptConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PromptConfig textPrompt. - * @member {string} textPrompt - * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig - * @instance - */ - PromptConfig.prototype.textPrompt = ""; - - /** - * PromptConfig voicePrompt. - * @member {string} voicePrompt - * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig - * @instance - */ - PromptConfig.prototype.voicePrompt = ""; - - /** - * Creates a new PromptConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig - * @static - * @param {google.cloud.ces.v1.GoogleSearchTool.IPromptConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.GoogleSearchTool.PromptConfig} PromptConfig instance - */ - PromptConfig.create = function create(properties) { - return new PromptConfig(properties); - }; - - /** - * Encodes the specified PromptConfig message. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchTool.PromptConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig - * @static - * @param {google.cloud.ces.v1.GoogleSearchTool.IPromptConfig} message PromptConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PromptConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.textPrompt != null && Object.hasOwnProperty.call(message, "textPrompt")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.textPrompt); - if (message.voicePrompt != null && Object.hasOwnProperty.call(message, "voicePrompt")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.voicePrompt); - return writer; - }; - - /** - * Encodes the specified PromptConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchTool.PromptConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig - * @static - * @param {google.cloud.ces.v1.GoogleSearchTool.IPromptConfig} message PromptConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PromptConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PromptConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.GoogleSearchTool.PromptConfig} PromptConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PromptConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GoogleSearchTool.PromptConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.textPrompt = reader.string(); - break; - } - case 2: { - message.voicePrompt = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PromptConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.GoogleSearchTool.PromptConfig} PromptConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PromptConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PromptConfig message. - * @function verify - * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PromptConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.textPrompt != null && message.hasOwnProperty("textPrompt")) - if (!$util.isString(message.textPrompt)) - return "textPrompt: string expected"; - if (message.voicePrompt != null && message.hasOwnProperty("voicePrompt")) - if (!$util.isString(message.voicePrompt)) - return "voicePrompt: string expected"; - return null; - }; - - /** - * Creates a PromptConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.GoogleSearchTool.PromptConfig} PromptConfig - */ - PromptConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.GoogleSearchTool.PromptConfig) - return object; - var message = new $root.google.cloud.ces.v1.GoogleSearchTool.PromptConfig(); - if (object.textPrompt != null) - message.textPrompt = String(object.textPrompt); - if (object.voicePrompt != null) - message.voicePrompt = String(object.voicePrompt); - return message; - }; - - /** - * Creates a plain object from a PromptConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig - * @static - * @param {google.cloud.ces.v1.GoogleSearchTool.PromptConfig} message PromptConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PromptConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.textPrompt = ""; - object.voicePrompt = ""; - } - if (message.textPrompt != null && message.hasOwnProperty("textPrompt")) - object.textPrompt = message.textPrompt; - if (message.voicePrompt != null && message.hasOwnProperty("voicePrompt")) - object.voicePrompt = message.voicePrompt; - return object; - }; - - /** - * Converts this PromptConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig - * @instance - * @returns {Object.} JSON object - */ - PromptConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PromptConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.GoogleSearchTool.PromptConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PromptConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.GoogleSearchTool.PromptConfig"; - }; - - return PromptConfig; - })(); - - return GoogleSearchTool; - })(); - - v1.McpTool = (function() { - - /** - * Properties of a McpTool. - * @memberof google.cloud.ces.v1 - * @interface IMcpTool - * @property {string|null} [name] McpTool name - * @property {string|null} [description] McpTool description - * @property {google.cloud.ces.v1.ISchema|null} [inputSchema] McpTool inputSchema - * @property {google.cloud.ces.v1.ISchema|null} [outputSchema] McpTool outputSchema - * @property {string|null} [serverAddress] McpTool serverAddress - * @property {google.cloud.ces.v1.IApiAuthentication|null} [apiAuthentication] McpTool apiAuthentication - * @property {google.cloud.ces.v1.ITlsConfig|null} [tlsConfig] McpTool tlsConfig - * @property {google.cloud.ces.v1.IServiceDirectoryConfig|null} [serviceDirectoryConfig] McpTool serviceDirectoryConfig - */ - - /** - * Constructs a new McpTool. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a McpTool. - * @implements IMcpTool - * @constructor - * @param {google.cloud.ces.v1.IMcpTool=} [properties] Properties to set - */ - function McpTool(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * McpTool name. - * @member {string} name - * @memberof google.cloud.ces.v1.McpTool - * @instance - */ - McpTool.prototype.name = ""; - - /** - * McpTool description. - * @member {string} description - * @memberof google.cloud.ces.v1.McpTool - * @instance - */ - McpTool.prototype.description = ""; - - /** - * McpTool inputSchema. - * @member {google.cloud.ces.v1.ISchema|null|undefined} inputSchema - * @memberof google.cloud.ces.v1.McpTool - * @instance - */ - McpTool.prototype.inputSchema = null; - - /** - * McpTool outputSchema. - * @member {google.cloud.ces.v1.ISchema|null|undefined} outputSchema - * @memberof google.cloud.ces.v1.McpTool - * @instance - */ - McpTool.prototype.outputSchema = null; - - /** - * McpTool serverAddress. - * @member {string} serverAddress - * @memberof google.cloud.ces.v1.McpTool - * @instance - */ - McpTool.prototype.serverAddress = ""; - - /** - * McpTool apiAuthentication. - * @member {google.cloud.ces.v1.IApiAuthentication|null|undefined} apiAuthentication - * @memberof google.cloud.ces.v1.McpTool - * @instance - */ - McpTool.prototype.apiAuthentication = null; - - /** - * McpTool tlsConfig. - * @member {google.cloud.ces.v1.ITlsConfig|null|undefined} tlsConfig - * @memberof google.cloud.ces.v1.McpTool - * @instance - */ - McpTool.prototype.tlsConfig = null; - - /** - * McpTool serviceDirectoryConfig. - * @member {google.cloud.ces.v1.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig - * @memberof google.cloud.ces.v1.McpTool - * @instance - */ - McpTool.prototype.serviceDirectoryConfig = null; - - /** - * Creates a new McpTool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.McpTool - * @static - * @param {google.cloud.ces.v1.IMcpTool=} [properties] Properties to set - * @returns {google.cloud.ces.v1.McpTool} McpTool instance - */ - McpTool.create = function create(properties) { - return new McpTool(properties); - }; - - /** - * Encodes the specified McpTool message. Does not implicitly {@link google.cloud.ces.v1.McpTool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.McpTool - * @static - * @param {google.cloud.ces.v1.IMcpTool} message McpTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - McpTool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.inputSchema != null && Object.hasOwnProperty.call(message, "inputSchema")) - $root.google.cloud.ces.v1.Schema.encode(message.inputSchema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.outputSchema != null && Object.hasOwnProperty.call(message, "outputSchema")) - $root.google.cloud.ces.v1.Schema.encode(message.outputSchema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.serverAddress != null && Object.hasOwnProperty.call(message, "serverAddress")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.serverAddress); - if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) - $root.google.cloud.ces.v1.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) - $root.google.cloud.ces.v1.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) - $root.google.cloud.ces.v1.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified McpTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.McpTool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.McpTool - * @static - * @param {google.cloud.ces.v1.IMcpTool} message McpTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - McpTool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a McpTool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.McpTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.McpTool} McpTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - McpTool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.McpTool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - message.inputSchema = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); - break; - } - case 4: { - message.outputSchema = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); - break; - } - case 5: { - message.serverAddress = reader.string(); - break; - } - case 6: { - message.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.decode(reader, reader.uint32()); - break; - } - case 7: { - message.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.decode(reader, reader.uint32()); - break; - } - case 8: { - message.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a McpTool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.McpTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.McpTool} McpTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - McpTool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a McpTool message. - * @function verify - * @memberof google.cloud.ces.v1.McpTool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - McpTool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) { - var error = $root.google.cloud.ces.v1.Schema.verify(message.inputSchema); - if (error) - return "inputSchema." + error; - } - if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) { - var error = $root.google.cloud.ces.v1.Schema.verify(message.outputSchema); - if (error) - return "outputSchema." + error; - } - if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) - if (!$util.isString(message.serverAddress)) - return "serverAddress: string expected"; - if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { - var error = $root.google.cloud.ces.v1.ApiAuthentication.verify(message.apiAuthentication); - if (error) - return "apiAuthentication." + error; - } - if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { - var error = $root.google.cloud.ces.v1.TlsConfig.verify(message.tlsConfig); - if (error) - return "tlsConfig." + error; - } - if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { - var error = $root.google.cloud.ces.v1.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); - if (error) - return "serviceDirectoryConfig." + error; - } - return null; - }; - - /** - * Creates a McpTool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.McpTool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.McpTool} McpTool - */ - McpTool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.McpTool) - return object; - var message = new $root.google.cloud.ces.v1.McpTool(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.inputSchema != null) { - if (typeof object.inputSchema !== "object") - throw TypeError(".google.cloud.ces.v1.McpTool.inputSchema: object expected"); - message.inputSchema = $root.google.cloud.ces.v1.Schema.fromObject(object.inputSchema); - } - if (object.outputSchema != null) { - if (typeof object.outputSchema !== "object") - throw TypeError(".google.cloud.ces.v1.McpTool.outputSchema: object expected"); - message.outputSchema = $root.google.cloud.ces.v1.Schema.fromObject(object.outputSchema); - } - if (object.serverAddress != null) - message.serverAddress = String(object.serverAddress); - if (object.apiAuthentication != null) { - if (typeof object.apiAuthentication !== "object") - throw TypeError(".google.cloud.ces.v1.McpTool.apiAuthentication: object expected"); - message.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.fromObject(object.apiAuthentication); - } - if (object.tlsConfig != null) { - if (typeof object.tlsConfig !== "object") - throw TypeError(".google.cloud.ces.v1.McpTool.tlsConfig: object expected"); - message.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.fromObject(object.tlsConfig); - } - if (object.serviceDirectoryConfig != null) { - if (typeof object.serviceDirectoryConfig !== "object") - throw TypeError(".google.cloud.ces.v1.McpTool.serviceDirectoryConfig: object expected"); - message.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); - } - return message; - }; - - /** - * Creates a plain object from a McpTool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.McpTool - * @static - * @param {google.cloud.ces.v1.McpTool} message McpTool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - McpTool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.inputSchema = null; - object.outputSchema = null; - object.serverAddress = ""; - object.apiAuthentication = null; - object.tlsConfig = null; - object.serviceDirectoryConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) - object.inputSchema = $root.google.cloud.ces.v1.Schema.toObject(message.inputSchema, options); - if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) - object.outputSchema = $root.google.cloud.ces.v1.Schema.toObject(message.outputSchema, options); - if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) - object.serverAddress = message.serverAddress; - if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) - object.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.toObject(message.apiAuthentication, options); - if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) - object.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.toObject(message.tlsConfig, options); - if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) - object.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); - return object; - }; - - /** - * Converts this McpTool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.McpTool - * @instance - * @returns {Object.} JSON object - */ - McpTool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for McpTool - * @function getTypeUrl - * @memberof google.cloud.ces.v1.McpTool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - McpTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.McpTool"; - }; - - return McpTool; - })(); - - v1.OpenApiTool = (function() { - - /** - * Properties of an OpenApiTool. - * @memberof google.cloud.ces.v1 - * @interface IOpenApiTool - * @property {string|null} [openApiSchema] OpenApiTool openApiSchema - * @property {string|null} [name] OpenApiTool name - * @property {string|null} [description] OpenApiTool description - * @property {google.cloud.ces.v1.IApiAuthentication|null} [apiAuthentication] OpenApiTool apiAuthentication - * @property {google.cloud.ces.v1.ITlsConfig|null} [tlsConfig] OpenApiTool tlsConfig - * @property {google.cloud.ces.v1.IServiceDirectoryConfig|null} [serviceDirectoryConfig] OpenApiTool serviceDirectoryConfig - * @property {boolean|null} [ignoreUnknownFields] OpenApiTool ignoreUnknownFields - * @property {string|null} [url] OpenApiTool url - */ - - /** - * Constructs a new OpenApiTool. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an OpenApiTool. - * @implements IOpenApiTool - * @constructor - * @param {google.cloud.ces.v1.IOpenApiTool=} [properties] Properties to set - */ - function OpenApiTool(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OpenApiTool openApiSchema. - * @member {string} openApiSchema - * @memberof google.cloud.ces.v1.OpenApiTool - * @instance - */ - OpenApiTool.prototype.openApiSchema = ""; - - /** - * OpenApiTool name. - * @member {string} name - * @memberof google.cloud.ces.v1.OpenApiTool - * @instance - */ - OpenApiTool.prototype.name = ""; - - /** - * OpenApiTool description. - * @member {string} description - * @memberof google.cloud.ces.v1.OpenApiTool - * @instance - */ - OpenApiTool.prototype.description = ""; - - /** - * OpenApiTool apiAuthentication. - * @member {google.cloud.ces.v1.IApiAuthentication|null|undefined} apiAuthentication - * @memberof google.cloud.ces.v1.OpenApiTool - * @instance - */ - OpenApiTool.prototype.apiAuthentication = null; - - /** - * OpenApiTool tlsConfig. - * @member {google.cloud.ces.v1.ITlsConfig|null|undefined} tlsConfig - * @memberof google.cloud.ces.v1.OpenApiTool - * @instance - */ - OpenApiTool.prototype.tlsConfig = null; - - /** - * OpenApiTool serviceDirectoryConfig. - * @member {google.cloud.ces.v1.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig - * @memberof google.cloud.ces.v1.OpenApiTool - * @instance - */ - OpenApiTool.prototype.serviceDirectoryConfig = null; - - /** - * OpenApiTool ignoreUnknownFields. - * @member {boolean} ignoreUnknownFields - * @memberof google.cloud.ces.v1.OpenApiTool - * @instance - */ - OpenApiTool.prototype.ignoreUnknownFields = false; - - /** - * OpenApiTool url. - * @member {string} url - * @memberof google.cloud.ces.v1.OpenApiTool - * @instance - */ - OpenApiTool.prototype.url = ""; - - /** - * Creates a new OpenApiTool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.OpenApiTool - * @static - * @param {google.cloud.ces.v1.IOpenApiTool=} [properties] Properties to set - * @returns {google.cloud.ces.v1.OpenApiTool} OpenApiTool instance - */ - OpenApiTool.create = function create(properties) { - return new OpenApiTool(properties); - }; - - /** - * Encodes the specified OpenApiTool message. Does not implicitly {@link google.cloud.ces.v1.OpenApiTool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.OpenApiTool - * @static - * @param {google.cloud.ces.v1.IOpenApiTool} message OpenApiTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OpenApiTool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.openApiSchema != null && Object.hasOwnProperty.call(message, "openApiSchema")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.openApiSchema); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) - $root.google.cloud.ces.v1.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) - $root.google.cloud.ces.v1.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) - $root.google.cloud.ces.v1.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.ignoreUnknownFields != null && Object.hasOwnProperty.call(message, "ignoreUnknownFields")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.ignoreUnknownFields); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.url); - return writer; - }; - - /** - * Encodes the specified OpenApiTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OpenApiTool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.OpenApiTool - * @static - * @param {google.cloud.ces.v1.IOpenApiTool} message OpenApiTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OpenApiTool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OpenApiTool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.OpenApiTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.OpenApiTool} OpenApiTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OpenApiTool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OpenApiTool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.openApiSchema = reader.string(); - break; - } - case 2: { - message.name = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.decode(reader, reader.uint32()); - break; - } - case 5: { - message.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.ignoreUnknownFields = reader.bool(); - break; - } - case 8: { - message.url = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OpenApiTool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.OpenApiTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.OpenApiTool} OpenApiTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OpenApiTool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OpenApiTool message. - * @function verify - * @memberof google.cloud.ces.v1.OpenApiTool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OpenApiTool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) - if (!$util.isString(message.openApiSchema)) - return "openApiSchema: string expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { - var error = $root.google.cloud.ces.v1.ApiAuthentication.verify(message.apiAuthentication); - if (error) - return "apiAuthentication." + error; - } - if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { - var error = $root.google.cloud.ces.v1.TlsConfig.verify(message.tlsConfig); - if (error) - return "tlsConfig." + error; - } - if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { - var error = $root.google.cloud.ces.v1.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); - if (error) - return "serviceDirectoryConfig." + error; - } - if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) - if (typeof message.ignoreUnknownFields !== "boolean") - return "ignoreUnknownFields: boolean expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - return null; - }; - - /** - * Creates an OpenApiTool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.OpenApiTool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.OpenApiTool} OpenApiTool - */ - OpenApiTool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.OpenApiTool) - return object; - var message = new $root.google.cloud.ces.v1.OpenApiTool(); - if (object.openApiSchema != null) - message.openApiSchema = String(object.openApiSchema); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.apiAuthentication != null) { - if (typeof object.apiAuthentication !== "object") - throw TypeError(".google.cloud.ces.v1.OpenApiTool.apiAuthentication: object expected"); - message.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.fromObject(object.apiAuthentication); - } - if (object.tlsConfig != null) { - if (typeof object.tlsConfig !== "object") - throw TypeError(".google.cloud.ces.v1.OpenApiTool.tlsConfig: object expected"); - message.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.fromObject(object.tlsConfig); - } - if (object.serviceDirectoryConfig != null) { - if (typeof object.serviceDirectoryConfig !== "object") - throw TypeError(".google.cloud.ces.v1.OpenApiTool.serviceDirectoryConfig: object expected"); - message.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); - } - if (object.ignoreUnknownFields != null) - message.ignoreUnknownFields = Boolean(object.ignoreUnknownFields); - if (object.url != null) - message.url = String(object.url); - return message; - }; - - /** - * Creates a plain object from an OpenApiTool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.OpenApiTool - * @static - * @param {google.cloud.ces.v1.OpenApiTool} message OpenApiTool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OpenApiTool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.openApiSchema = ""; - object.name = ""; - object.description = ""; - object.apiAuthentication = null; - object.tlsConfig = null; - object.serviceDirectoryConfig = null; - object.ignoreUnknownFields = false; - object.url = ""; - } - if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) - object.openApiSchema = message.openApiSchema; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) - object.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.toObject(message.apiAuthentication, options); - if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) - object.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.toObject(message.tlsConfig, options); - if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) - object.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); - if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) - object.ignoreUnknownFields = message.ignoreUnknownFields; - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - return object; - }; - - /** - * Converts this OpenApiTool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.OpenApiTool - * @instance - * @returns {Object.} JSON object - */ - OpenApiTool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OpenApiTool - * @function getTypeUrl - * @memberof google.cloud.ces.v1.OpenApiTool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OpenApiTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.OpenApiTool"; - }; - - return OpenApiTool; - })(); - - v1.PythonFunction = (function() { - - /** - * Properties of a PythonFunction. - * @memberof google.cloud.ces.v1 - * @interface IPythonFunction - * @property {string|null} [name] PythonFunction name - * @property {string|null} [pythonCode] PythonFunction pythonCode - * @property {string|null} [description] PythonFunction description - */ - - /** - * Constructs a new PythonFunction. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a PythonFunction. - * @implements IPythonFunction - * @constructor - * @param {google.cloud.ces.v1.IPythonFunction=} [properties] Properties to set - */ - function PythonFunction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonFunction name. - * @member {string} name - * @memberof google.cloud.ces.v1.PythonFunction - * @instance - */ - PythonFunction.prototype.name = ""; - - /** - * PythonFunction pythonCode. - * @member {string} pythonCode - * @memberof google.cloud.ces.v1.PythonFunction - * @instance - */ - PythonFunction.prototype.pythonCode = ""; - - /** - * PythonFunction description. - * @member {string} description - * @memberof google.cloud.ces.v1.PythonFunction - * @instance - */ - PythonFunction.prototype.description = ""; - - /** - * Creates a new PythonFunction instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.PythonFunction - * @static - * @param {google.cloud.ces.v1.IPythonFunction=} [properties] Properties to set - * @returns {google.cloud.ces.v1.PythonFunction} PythonFunction instance - */ - PythonFunction.create = function create(properties) { - return new PythonFunction(properties); - }; - - /** - * Encodes the specified PythonFunction message. Does not implicitly {@link google.cloud.ces.v1.PythonFunction.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.PythonFunction - * @static - * @param {google.cloud.ces.v1.IPythonFunction} message PythonFunction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonFunction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pythonCode); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - return writer; - }; - - /** - * Encodes the specified PythonFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1.PythonFunction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.PythonFunction - * @static - * @param {google.cloud.ces.v1.IPythonFunction} message PythonFunction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonFunction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonFunction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.PythonFunction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.PythonFunction} PythonFunction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonFunction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.PythonFunction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.pythonCode = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonFunction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.PythonFunction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.PythonFunction} PythonFunction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonFunction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonFunction message. - * @function verify - * @memberof google.cloud.ces.v1.PythonFunction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonFunction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) - if (!$util.isString(message.pythonCode)) - return "pythonCode: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates a PythonFunction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.PythonFunction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.PythonFunction} PythonFunction - */ - PythonFunction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.PythonFunction) - return object; - var message = new $root.google.cloud.ces.v1.PythonFunction(); - if (object.name != null) - message.name = String(object.name); - if (object.pythonCode != null) - message.pythonCode = String(object.pythonCode); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from a PythonFunction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.PythonFunction - * @static - * @param {google.cloud.ces.v1.PythonFunction} message PythonFunction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonFunction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.pythonCode = ""; - object.description = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) - object.pythonCode = message.pythonCode; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this PythonFunction to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.PythonFunction - * @instance - * @returns {Object.} JSON object - */ - PythonFunction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonFunction - * @function getTypeUrl - * @memberof google.cloud.ces.v1.PythonFunction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonFunction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.PythonFunction"; - }; - - return PythonFunction; - })(); - - v1.SystemTool = (function() { - - /** - * Properties of a SystemTool. - * @memberof google.cloud.ces.v1 - * @interface ISystemTool - * @property {string|null} [name] SystemTool name - * @property {string|null} [description] SystemTool description - */ - - /** - * Constructs a new SystemTool. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a SystemTool. - * @implements ISystemTool - * @constructor - * @param {google.cloud.ces.v1.ISystemTool=} [properties] Properties to set - */ - function SystemTool(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SystemTool name. - * @member {string} name - * @memberof google.cloud.ces.v1.SystemTool - * @instance - */ - SystemTool.prototype.name = ""; - - /** - * SystemTool description. - * @member {string} description - * @memberof google.cloud.ces.v1.SystemTool - * @instance - */ - SystemTool.prototype.description = ""; - - /** - * Creates a new SystemTool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.SystemTool - * @static - * @param {google.cloud.ces.v1.ISystemTool=} [properties] Properties to set - * @returns {google.cloud.ces.v1.SystemTool} SystemTool instance - */ - SystemTool.create = function create(properties) { - return new SystemTool(properties); - }; - - /** - * Encodes the specified SystemTool message. Does not implicitly {@link google.cloud.ces.v1.SystemTool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.SystemTool - * @static - * @param {google.cloud.ces.v1.ISystemTool} message SystemTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SystemTool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - return writer; - }; - - /** - * Encodes the specified SystemTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SystemTool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.SystemTool - * @static - * @param {google.cloud.ces.v1.ISystemTool} message SystemTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SystemTool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SystemTool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.SystemTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.SystemTool} SystemTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SystemTool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.SystemTool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SystemTool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.SystemTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.SystemTool} SystemTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SystemTool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SystemTool message. - * @function verify - * @memberof google.cloud.ces.v1.SystemTool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SystemTool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates a SystemTool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.SystemTool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.SystemTool} SystemTool - */ - SystemTool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.SystemTool) - return object; - var message = new $root.google.cloud.ces.v1.SystemTool(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from a SystemTool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.SystemTool - * @static - * @param {google.cloud.ces.v1.SystemTool} message SystemTool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SystemTool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this SystemTool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.SystemTool - * @instance - * @returns {Object.} JSON object - */ - SystemTool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SystemTool - * @function getTypeUrl - * @memberof google.cloud.ces.v1.SystemTool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SystemTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.SystemTool"; - }; - - return SystemTool; - })(); - - v1.WidgetTool = (function() { - - /** - * Properties of a WidgetTool. - * @memberof google.cloud.ces.v1 - * @interface IWidgetTool - * @property {google.cloud.ces.v1.ISchema|null} [parameters] WidgetTool parameters - * @property {string|null} [name] WidgetTool name - * @property {string|null} [description] WidgetTool description - * @property {google.cloud.ces.v1.WidgetTool.WidgetType|null} [widgetType] WidgetTool widgetType - */ - - /** - * Constructs a new WidgetTool. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a WidgetTool. - * @implements IWidgetTool - * @constructor - * @param {google.cloud.ces.v1.IWidgetTool=} [properties] Properties to set - */ - function WidgetTool(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WidgetTool parameters. - * @member {google.cloud.ces.v1.ISchema|null|undefined} parameters - * @memberof google.cloud.ces.v1.WidgetTool - * @instance - */ - WidgetTool.prototype.parameters = null; - - /** - * WidgetTool name. - * @member {string} name - * @memberof google.cloud.ces.v1.WidgetTool - * @instance - */ - WidgetTool.prototype.name = ""; - - /** - * WidgetTool description. - * @member {string} description - * @memberof google.cloud.ces.v1.WidgetTool - * @instance - */ - WidgetTool.prototype.description = ""; - - /** - * WidgetTool widgetType. - * @member {google.cloud.ces.v1.WidgetTool.WidgetType} widgetType - * @memberof google.cloud.ces.v1.WidgetTool - * @instance - */ - WidgetTool.prototype.widgetType = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * WidgetTool input. - * @member {"parameters"|undefined} input - * @memberof google.cloud.ces.v1.WidgetTool - * @instance - */ - Object.defineProperty(WidgetTool.prototype, "input", { - get: $util.oneOfGetter($oneOfFields = ["parameters"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new WidgetTool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.WidgetTool - * @static - * @param {google.cloud.ces.v1.IWidgetTool=} [properties] Properties to set - * @returns {google.cloud.ces.v1.WidgetTool} WidgetTool instance - */ - WidgetTool.create = function create(properties) { - return new WidgetTool(properties); - }; - - /** - * Encodes the specified WidgetTool message. Does not implicitly {@link google.cloud.ces.v1.WidgetTool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.WidgetTool - * @static - * @param {google.cloud.ces.v1.IWidgetTool} message WidgetTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WidgetTool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.widgetType != null && Object.hasOwnProperty.call(message, "widgetType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.widgetType); - if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) - $root.google.cloud.ces.v1.Schema.encode(message.parameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WidgetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1.WidgetTool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.WidgetTool - * @static - * @param {google.cloud.ces.v1.IWidgetTool} message WidgetTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WidgetTool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WidgetTool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.WidgetTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.WidgetTool} WidgetTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WidgetTool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.WidgetTool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.parameters = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - message.widgetType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WidgetTool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.WidgetTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.WidgetTool} WidgetTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WidgetTool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WidgetTool message. - * @function verify - * @memberof google.cloud.ces.v1.WidgetTool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WidgetTool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.parameters != null && message.hasOwnProperty("parameters")) { - properties.input = 1; - { - var error = $root.google.cloud.ces.v1.Schema.verify(message.parameters); - if (error) - return "parameters." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.widgetType != null && message.hasOwnProperty("widgetType")) - switch (message.widgetType) { - default: - return "widgetType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - break; - } - return null; - }; - - /** - * Creates a WidgetTool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.WidgetTool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.WidgetTool} WidgetTool - */ - WidgetTool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.WidgetTool) - return object; - var message = new $root.google.cloud.ces.v1.WidgetTool(); - if (object.parameters != null) { - if (typeof object.parameters !== "object") - throw TypeError(".google.cloud.ces.v1.WidgetTool.parameters: object expected"); - message.parameters = $root.google.cloud.ces.v1.Schema.fromObject(object.parameters); - } - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - switch (object.widgetType) { - default: - if (typeof object.widgetType === "number") { - message.widgetType = object.widgetType; - break; - } - break; - case "WIDGET_TYPE_UNSPECIFIED": - case 0: - message.widgetType = 0; - break; - case "CUSTOM": - case 1: - message.widgetType = 1; - break; - case "PRODUCT_CAROUSEL": - case 2: - message.widgetType = 2; - break; - case "PRODUCT_DETAILS": - case 3: - message.widgetType = 3; - break; - case "QUICK_ACTIONS": - case 4: - message.widgetType = 4; - break; - case "PRODUCT_COMPARISON": - case 5: - message.widgetType = 5; - break; - case "ADVANCED_PRODUCT_DETAILS": - case 6: - message.widgetType = 6; - break; - case "SHORT_FORM": - case 7: - message.widgetType = 7; - break; - case "OVERALL_SATISFACTION": - case 8: - message.widgetType = 8; - break; - case "ORDER_SUMMARY": - case 9: - message.widgetType = 9; - break; - case "APPOINTMENT_DETAILS": - case 10: - message.widgetType = 10; - break; - } - return message; - }; - - /** - * Creates a plain object from a WidgetTool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.WidgetTool - * @static - * @param {google.cloud.ces.v1.WidgetTool} message WidgetTool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WidgetTool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.widgetType = options.enums === String ? "WIDGET_TYPE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.widgetType != null && message.hasOwnProperty("widgetType")) - object.widgetType = options.enums === String ? $root.google.cloud.ces.v1.WidgetTool.WidgetType[message.widgetType] === undefined ? message.widgetType : $root.google.cloud.ces.v1.WidgetTool.WidgetType[message.widgetType] : message.widgetType; - if (message.parameters != null && message.hasOwnProperty("parameters")) { - object.parameters = $root.google.cloud.ces.v1.Schema.toObject(message.parameters, options); - if (options.oneofs) - object.input = "parameters"; - } - return object; - }; - - /** - * Converts this WidgetTool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.WidgetTool - * @instance - * @returns {Object.} JSON object - */ - WidgetTool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WidgetTool - * @function getTypeUrl - * @memberof google.cloud.ces.v1.WidgetTool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WidgetTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.WidgetTool"; - }; - - /** - * WidgetType enum. - * @name google.cloud.ces.v1.WidgetTool.WidgetType - * @enum {number} - * @property {number} WIDGET_TYPE_UNSPECIFIED=0 WIDGET_TYPE_UNSPECIFIED value - * @property {number} CUSTOM=1 CUSTOM value - * @property {number} PRODUCT_CAROUSEL=2 PRODUCT_CAROUSEL value - * @property {number} PRODUCT_DETAILS=3 PRODUCT_DETAILS value - * @property {number} QUICK_ACTIONS=4 QUICK_ACTIONS value - * @property {number} PRODUCT_COMPARISON=5 PRODUCT_COMPARISON value - * @property {number} ADVANCED_PRODUCT_DETAILS=6 ADVANCED_PRODUCT_DETAILS value - * @property {number} SHORT_FORM=7 SHORT_FORM value - * @property {number} OVERALL_SATISFACTION=8 OVERALL_SATISFACTION value - * @property {number} ORDER_SUMMARY=9 ORDER_SUMMARY value - * @property {number} APPOINTMENT_DETAILS=10 APPOINTMENT_DETAILS value - */ - WidgetTool.WidgetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "WIDGET_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CUSTOM"] = 1; - values[valuesById[2] = "PRODUCT_CAROUSEL"] = 2; - values[valuesById[3] = "PRODUCT_DETAILS"] = 3; - values[valuesById[4] = "QUICK_ACTIONS"] = 4; - values[valuesById[5] = "PRODUCT_COMPARISON"] = 5; - values[valuesById[6] = "ADVANCED_PRODUCT_DETAILS"] = 6; - values[valuesById[7] = "SHORT_FORM"] = 7; - values[valuesById[8] = "OVERALL_SATISFACTION"] = 8; - values[valuesById[9] = "ORDER_SUMMARY"] = 9; - values[valuesById[10] = "APPOINTMENT_DETAILS"] = 10; - return values; - })(); - - return WidgetTool; - })(); - - v1.Toolset = (function() { - - /** - * Properties of a Toolset. - * @memberof google.cloud.ces.v1 - * @interface IToolset - * @property {google.cloud.ces.v1.IMcpToolset|null} [mcpToolset] Toolset mcpToolset - * @property {google.cloud.ces.v1.IOpenApiToolset|null} [openApiToolset] Toolset openApiToolset - * @property {google.cloud.ces.v1.IConnectorToolset|null} [connectorToolset] Toolset connectorToolset - * @property {string|null} [name] Toolset name - * @property {string|null} [displayName] Toolset displayName - * @property {string|null} [description] Toolset description - * @property {google.protobuf.ITimestamp|null} [createTime] Toolset createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Toolset updateTime - * @property {string|null} [etag] Toolset etag - * @property {google.cloud.ces.v1.ExecutionType|null} [executionType] Toolset executionType - * @property {google.cloud.ces.v1.IToolFakeConfig|null} [toolFakeConfig] Toolset toolFakeConfig - */ - - /** - * Constructs a new Toolset. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a Toolset. - * @implements IToolset - * @constructor - * @param {google.cloud.ces.v1.IToolset=} [properties] Properties to set - */ - function Toolset(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Toolset mcpToolset. - * @member {google.cloud.ces.v1.IMcpToolset|null|undefined} mcpToolset - * @memberof google.cloud.ces.v1.Toolset - * @instance - */ - Toolset.prototype.mcpToolset = null; - - /** - * Toolset openApiToolset. - * @member {google.cloud.ces.v1.IOpenApiToolset|null|undefined} openApiToolset - * @memberof google.cloud.ces.v1.Toolset - * @instance - */ - Toolset.prototype.openApiToolset = null; - - /** - * Toolset connectorToolset. - * @member {google.cloud.ces.v1.IConnectorToolset|null|undefined} connectorToolset - * @memberof google.cloud.ces.v1.Toolset - * @instance - */ - Toolset.prototype.connectorToolset = null; - - /** - * Toolset name. - * @member {string} name - * @memberof google.cloud.ces.v1.Toolset - * @instance - */ - Toolset.prototype.name = ""; - - /** - * Toolset displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1.Toolset - * @instance - */ - Toolset.prototype.displayName = ""; - - /** - * Toolset description. - * @member {string} description - * @memberof google.cloud.ces.v1.Toolset - * @instance - */ - Toolset.prototype.description = ""; - - /** - * Toolset createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1.Toolset - * @instance - */ - Toolset.prototype.createTime = null; - - /** - * Toolset updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1.Toolset - * @instance - */ - Toolset.prototype.updateTime = null; - - /** - * Toolset etag. - * @member {string} etag - * @memberof google.cloud.ces.v1.Toolset - * @instance - */ - Toolset.prototype.etag = ""; - - /** - * Toolset executionType. - * @member {google.cloud.ces.v1.ExecutionType} executionType - * @memberof google.cloud.ces.v1.Toolset - * @instance - */ - Toolset.prototype.executionType = 0; - - /** - * Toolset toolFakeConfig. - * @member {google.cloud.ces.v1.IToolFakeConfig|null|undefined} toolFakeConfig - * @memberof google.cloud.ces.v1.Toolset - * @instance - */ - Toolset.prototype.toolFakeConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Toolset toolsetType. - * @member {"mcpToolset"|"openApiToolset"|"connectorToolset"|undefined} toolsetType - * @memberof google.cloud.ces.v1.Toolset - * @instance - */ - Object.defineProperty(Toolset.prototype, "toolsetType", { - get: $util.oneOfGetter($oneOfFields = ["mcpToolset", "openApiToolset", "connectorToolset"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Toolset instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Toolset - * @static - * @param {google.cloud.ces.v1.IToolset=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Toolset} Toolset instance - */ - Toolset.create = function create(properties) { - return new Toolset(properties); - }; - - /** - * Encodes the specified Toolset message. Does not implicitly {@link google.cloud.ces.v1.Toolset.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Toolset - * @static - * @param {google.cloud.ces.v1.IToolset} message Toolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Toolset.encode = function encode(message, writer) { - if (!writer) - 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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); - if (message.mcpToolset != null && Object.hasOwnProperty.call(message, "mcpToolset")) - $root.google.cloud.ces.v1.McpToolset.encode(message.mcpToolset, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.openApiToolset != null && Object.hasOwnProperty.call(message, "openApiToolset")) - $root.google.cloud.ces.v1.OpenApiToolset.encode(message.openApiToolset, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.connectorToolset != null && Object.hasOwnProperty.call(message, "connectorToolset")) - $root.google.cloud.ces.v1.ConnectorToolset.encode(message.connectorToolset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.executionType != null && Object.hasOwnProperty.call(message, "executionType")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.executionType); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.description); - if (message.toolFakeConfig != null && Object.hasOwnProperty.call(message, "toolFakeConfig")) - $root.google.cloud.ces.v1.ToolFakeConfig.encode(message.toolFakeConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Toolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Toolset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Toolset - * @static - * @param {google.cloud.ces.v1.IToolset} message Toolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Toolset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Toolset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Toolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Toolset} Toolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Toolset.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Toolset(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 6: { - message.mcpToolset = $root.google.cloud.ces.v1.McpToolset.decode(reader, reader.uint32()); - break; - } - case 7: { - message.openApiToolset = $root.google.cloud.ces.v1.OpenApiToolset.decode(reader, reader.uint32()); - break; - } - case 8: { - message.connectorToolset = $root.google.cloud.ces.v1.ConnectorToolset.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 10: { - message.description = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.etag = reader.string(); - break; - } - case 9: { - message.executionType = reader.int32(); - break; - } - case 11: { - message.toolFakeConfig = $root.google.cloud.ces.v1.ToolFakeConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Toolset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Toolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Toolset} Toolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Toolset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Toolset message. - * @function verify - * @memberof google.cloud.ces.v1.Toolset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Toolset.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.mcpToolset != null && message.hasOwnProperty("mcpToolset")) { - properties.toolsetType = 1; - { - var error = $root.google.cloud.ces.v1.McpToolset.verify(message.mcpToolset); - if (error) - return "mcpToolset." + error; - } - } - if (message.openApiToolset != null && message.hasOwnProperty("openApiToolset")) { - if (properties.toolsetType === 1) - return "toolsetType: multiple values"; - properties.toolsetType = 1; - { - var error = $root.google.cloud.ces.v1.OpenApiToolset.verify(message.openApiToolset); - if (error) - return "openApiToolset." + error; - } - } - if (message.connectorToolset != null && message.hasOwnProperty("connectorToolset")) { - if (properties.toolsetType === 1) - return "toolsetType: multiple values"; - properties.toolsetType = 1; - { - var error = $root.google.cloud.ces.v1.ConnectorToolset.verify(message.connectorToolset); - if (error) - return "connectorToolset." + 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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: 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.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.executionType != null && message.hasOwnProperty("executionType")) - switch (message.executionType) { - default: - return "executionType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) { - var error = $root.google.cloud.ces.v1.ToolFakeConfig.verify(message.toolFakeConfig); - if (error) - return "toolFakeConfig." + error; - } - return null; - }; - - /** - * Creates a Toolset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Toolset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Toolset} Toolset - */ - Toolset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Toolset) - return object; - var message = new $root.google.cloud.ces.v1.Toolset(); - if (object.mcpToolset != null) { - if (typeof object.mcpToolset !== "object") - throw TypeError(".google.cloud.ces.v1.Toolset.mcpToolset: object expected"); - message.mcpToolset = $root.google.cloud.ces.v1.McpToolset.fromObject(object.mcpToolset); - } - if (object.openApiToolset != null) { - if (typeof object.openApiToolset !== "object") - throw TypeError(".google.cloud.ces.v1.Toolset.openApiToolset: object expected"); - message.openApiToolset = $root.google.cloud.ces.v1.OpenApiToolset.fromObject(object.openApiToolset); - } - if (object.connectorToolset != null) { - if (typeof object.connectorToolset !== "object") - throw TypeError(".google.cloud.ces.v1.Toolset.connectorToolset: object expected"); - message.connectorToolset = $root.google.cloud.ces.v1.ConnectorToolset.fromObject(object.connectorToolset); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1.Toolset.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.ces.v1.Toolset.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.etag != null) - message.etag = String(object.etag); - switch (object.executionType) { - default: - if (typeof object.executionType === "number") { - message.executionType = object.executionType; - break; - } - break; - case "EXECUTION_TYPE_UNSPECIFIED": - case 0: - message.executionType = 0; - break; - case "SYNCHRONOUS": - case 1: - message.executionType = 1; - break; - case "ASYNCHRONOUS": - case 2: - message.executionType = 2; - break; - } - if (object.toolFakeConfig != null) { - if (typeof object.toolFakeConfig !== "object") - throw TypeError(".google.cloud.ces.v1.Toolset.toolFakeConfig: object expected"); - message.toolFakeConfig = $root.google.cloud.ces.v1.ToolFakeConfig.fromObject(object.toolFakeConfig); - } - return message; - }; - - /** - * Creates a plain object from a Toolset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Toolset - * @static - * @param {google.cloud.ces.v1.Toolset} message Toolset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Toolset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - object.executionType = options.enums === String ? "EXECUTION_TYPE_UNSPECIFIED" : 0; - object.description = ""; - object.toolFakeConfig = 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.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.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.mcpToolset != null && message.hasOwnProperty("mcpToolset")) { - object.mcpToolset = $root.google.cloud.ces.v1.McpToolset.toObject(message.mcpToolset, options); - if (options.oneofs) - object.toolsetType = "mcpToolset"; - } - if (message.openApiToolset != null && message.hasOwnProperty("openApiToolset")) { - object.openApiToolset = $root.google.cloud.ces.v1.OpenApiToolset.toObject(message.openApiToolset, options); - if (options.oneofs) - object.toolsetType = "openApiToolset"; - } - if (message.connectorToolset != null && message.hasOwnProperty("connectorToolset")) { - object.connectorToolset = $root.google.cloud.ces.v1.ConnectorToolset.toObject(message.connectorToolset, options); - if (options.oneofs) - object.toolsetType = "connectorToolset"; - } - if (message.executionType != null && message.hasOwnProperty("executionType")) - object.executionType = options.enums === String ? $root.google.cloud.ces.v1.ExecutionType[message.executionType] === undefined ? message.executionType : $root.google.cloud.ces.v1.ExecutionType[message.executionType] : message.executionType; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) - object.toolFakeConfig = $root.google.cloud.ces.v1.ToolFakeConfig.toObject(message.toolFakeConfig, options); - return object; - }; - - /** - * Converts this Toolset to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Toolset - * @instance - * @returns {Object.} JSON object - */ - Toolset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Toolset - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Toolset - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Toolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Toolset"; - }; - - return Toolset; - })(); - - v1.ConnectorToolset = (function() { - - /** - * Properties of a ConnectorToolset. - * @memberof google.cloud.ces.v1 - * @interface IConnectorToolset - * @property {string|null} [connection] ConnectorToolset connection - * @property {google.cloud.ces.v1.IEndUserAuthConfig|null} [authConfig] ConnectorToolset authConfig - * @property {Array.|null} [connectorActions] ConnectorToolset connectorActions - */ - - /** - * Constructs a new ConnectorToolset. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ConnectorToolset. - * @implements IConnectorToolset - * @constructor - * @param {google.cloud.ces.v1.IConnectorToolset=} [properties] Properties to set - */ - function ConnectorToolset(properties) { - this.connectorActions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectorToolset connection. - * @member {string} connection - * @memberof google.cloud.ces.v1.ConnectorToolset - * @instance - */ - ConnectorToolset.prototype.connection = ""; - - /** - * ConnectorToolset authConfig. - * @member {google.cloud.ces.v1.IEndUserAuthConfig|null|undefined} authConfig - * @memberof google.cloud.ces.v1.ConnectorToolset - * @instance - */ - ConnectorToolset.prototype.authConfig = null; - - /** - * ConnectorToolset connectorActions. - * @member {Array.} connectorActions - * @memberof google.cloud.ces.v1.ConnectorToolset - * @instance - */ - ConnectorToolset.prototype.connectorActions = $util.emptyArray; - - /** - * Creates a new ConnectorToolset instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ConnectorToolset - * @static - * @param {google.cloud.ces.v1.IConnectorToolset=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ConnectorToolset} ConnectorToolset instance - */ - ConnectorToolset.create = function create(properties) { - return new ConnectorToolset(properties); - }; - - /** - * Encodes the specified ConnectorToolset message. Does not implicitly {@link google.cloud.ces.v1.ConnectorToolset.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ConnectorToolset - * @static - * @param {google.cloud.ces.v1.IConnectorToolset} message ConnectorToolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectorToolset.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection); - if (message.authConfig != null && Object.hasOwnProperty.call(message, "authConfig")) - $root.google.cloud.ces.v1.EndUserAuthConfig.encode(message.authConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.connectorActions != null && message.connectorActions.length) - for (var i = 0; i < message.connectorActions.length; ++i) - $root.google.cloud.ces.v1.Action.encode(message.connectorActions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConnectorToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ConnectorToolset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ConnectorToolset - * @static - * @param {google.cloud.ces.v1.IConnectorToolset} message ConnectorToolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectorToolset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectorToolset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ConnectorToolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ConnectorToolset} ConnectorToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectorToolset.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ConnectorToolset(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.connection = reader.string(); - break; - } - case 2: { - message.authConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.connectorActions && message.connectorActions.length)) - message.connectorActions = []; - message.connectorActions.push($root.google.cloud.ces.v1.Action.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectorToolset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ConnectorToolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ConnectorToolset} ConnectorToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectorToolset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectorToolset message. - * @function verify - * @memberof google.cloud.ces.v1.ConnectorToolset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectorToolset.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection != null && message.hasOwnProperty("connection")) - if (!$util.isString(message.connection)) - return "connection: string expected"; - if (message.authConfig != null && message.hasOwnProperty("authConfig")) { - var error = $root.google.cloud.ces.v1.EndUserAuthConfig.verify(message.authConfig); - if (error) - return "authConfig." + error; - } - if (message.connectorActions != null && message.hasOwnProperty("connectorActions")) { - if (!Array.isArray(message.connectorActions)) - return "connectorActions: array expected"; - for (var i = 0; i < message.connectorActions.length; ++i) { - var error = $root.google.cloud.ces.v1.Action.verify(message.connectorActions[i]); - if (error) - return "connectorActions." + error; - } - } - return null; - }; - - /** - * Creates a ConnectorToolset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ConnectorToolset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ConnectorToolset} ConnectorToolset - */ - ConnectorToolset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ConnectorToolset) - return object; - var message = new $root.google.cloud.ces.v1.ConnectorToolset(); - if (object.connection != null) - message.connection = String(object.connection); - if (object.authConfig != null) { - if (typeof object.authConfig !== "object") - throw TypeError(".google.cloud.ces.v1.ConnectorToolset.authConfig: object expected"); - message.authConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.fromObject(object.authConfig); - } - if (object.connectorActions) { - if (!Array.isArray(object.connectorActions)) - throw TypeError(".google.cloud.ces.v1.ConnectorToolset.connectorActions: array expected"); - message.connectorActions = []; - for (var i = 0; i < object.connectorActions.length; ++i) { - if (typeof object.connectorActions[i] !== "object") - throw TypeError(".google.cloud.ces.v1.ConnectorToolset.connectorActions: object expected"); - message.connectorActions[i] = $root.google.cloud.ces.v1.Action.fromObject(object.connectorActions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ConnectorToolset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ConnectorToolset - * @static - * @param {google.cloud.ces.v1.ConnectorToolset} message ConnectorToolset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectorToolset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.connectorActions = []; - if (options.defaults) { - object.connection = ""; - object.authConfig = null; - } - if (message.connection != null && message.hasOwnProperty("connection")) - object.connection = message.connection; - if (message.authConfig != null && message.hasOwnProperty("authConfig")) - object.authConfig = $root.google.cloud.ces.v1.EndUserAuthConfig.toObject(message.authConfig, options); - if (message.connectorActions && message.connectorActions.length) { - object.connectorActions = []; - for (var j = 0; j < message.connectorActions.length; ++j) - object.connectorActions[j] = $root.google.cloud.ces.v1.Action.toObject(message.connectorActions[j], options); - } - return object; - }; - - /** - * Converts this ConnectorToolset to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ConnectorToolset - * @instance - * @returns {Object.} JSON object - */ - ConnectorToolset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConnectorToolset - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ConnectorToolset - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConnectorToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ConnectorToolset"; - }; - - return ConnectorToolset; - })(); - - v1.McpToolset = (function() { - - /** - * Properties of a McpToolset. - * @memberof google.cloud.ces.v1 - * @interface IMcpToolset - * @property {string|null} [serverAddress] McpToolset serverAddress - * @property {google.cloud.ces.v1.IApiAuthentication|null} [apiAuthentication] McpToolset apiAuthentication - * @property {google.cloud.ces.v1.IServiceDirectoryConfig|null} [serviceDirectoryConfig] McpToolset serviceDirectoryConfig - * @property {google.cloud.ces.v1.ITlsConfig|null} [tlsConfig] McpToolset tlsConfig - */ - - /** - * Constructs a new McpToolset. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a McpToolset. - * @implements IMcpToolset - * @constructor - * @param {google.cloud.ces.v1.IMcpToolset=} [properties] Properties to set - */ - function McpToolset(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * McpToolset serverAddress. - * @member {string} serverAddress - * @memberof google.cloud.ces.v1.McpToolset - * @instance - */ - McpToolset.prototype.serverAddress = ""; - - /** - * McpToolset apiAuthentication. - * @member {google.cloud.ces.v1.IApiAuthentication|null|undefined} apiAuthentication - * @memberof google.cloud.ces.v1.McpToolset - * @instance - */ - McpToolset.prototype.apiAuthentication = null; - - /** - * McpToolset serviceDirectoryConfig. - * @member {google.cloud.ces.v1.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig - * @memberof google.cloud.ces.v1.McpToolset - * @instance - */ - McpToolset.prototype.serviceDirectoryConfig = null; - - /** - * McpToolset tlsConfig. - * @member {google.cloud.ces.v1.ITlsConfig|null|undefined} tlsConfig - * @memberof google.cloud.ces.v1.McpToolset - * @instance - */ - McpToolset.prototype.tlsConfig = null; - - /** - * Creates a new McpToolset instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.McpToolset - * @static - * @param {google.cloud.ces.v1.IMcpToolset=} [properties] Properties to set - * @returns {google.cloud.ces.v1.McpToolset} McpToolset instance - */ - McpToolset.create = function create(properties) { - return new McpToolset(properties); - }; - - /** - * Encodes the specified McpToolset message. Does not implicitly {@link google.cloud.ces.v1.McpToolset.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.McpToolset - * @static - * @param {google.cloud.ces.v1.IMcpToolset} message McpToolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - McpToolset.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serverAddress != null && Object.hasOwnProperty.call(message, "serverAddress")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.serverAddress); - if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) - $root.google.cloud.ces.v1.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) - $root.google.cloud.ces.v1.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) - $root.google.cloud.ces.v1.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified McpToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.McpToolset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.McpToolset - * @static - * @param {google.cloud.ces.v1.IMcpToolset} message McpToolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - McpToolset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a McpToolset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.McpToolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.McpToolset} McpToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - McpToolset.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.McpToolset(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.serverAddress = reader.string(); - break; - } - case 2: { - message.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.decode(reader, reader.uint32()); - break; - } - case 3: { - message.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a McpToolset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.McpToolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.McpToolset} McpToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - McpToolset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a McpToolset message. - * @function verify - * @memberof google.cloud.ces.v1.McpToolset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - McpToolset.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) - if (!$util.isString(message.serverAddress)) - return "serverAddress: string expected"; - if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { - var error = $root.google.cloud.ces.v1.ApiAuthentication.verify(message.apiAuthentication); - if (error) - return "apiAuthentication." + error; - } - if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { - var error = $root.google.cloud.ces.v1.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); - if (error) - return "serviceDirectoryConfig." + error; - } - if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { - var error = $root.google.cloud.ces.v1.TlsConfig.verify(message.tlsConfig); - if (error) - return "tlsConfig." + error; - } - return null; - }; - - /** - * Creates a McpToolset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.McpToolset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.McpToolset} McpToolset - */ - McpToolset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.McpToolset) - return object; - var message = new $root.google.cloud.ces.v1.McpToolset(); - if (object.serverAddress != null) - message.serverAddress = String(object.serverAddress); - if (object.apiAuthentication != null) { - if (typeof object.apiAuthentication !== "object") - throw TypeError(".google.cloud.ces.v1.McpToolset.apiAuthentication: object expected"); - message.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.fromObject(object.apiAuthentication); - } - if (object.serviceDirectoryConfig != null) { - if (typeof object.serviceDirectoryConfig !== "object") - throw TypeError(".google.cloud.ces.v1.McpToolset.serviceDirectoryConfig: object expected"); - message.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); - } - if (object.tlsConfig != null) { - if (typeof object.tlsConfig !== "object") - throw TypeError(".google.cloud.ces.v1.McpToolset.tlsConfig: object expected"); - message.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.fromObject(object.tlsConfig); - } - return message; - }; - - /** - * Creates a plain object from a McpToolset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.McpToolset - * @static - * @param {google.cloud.ces.v1.McpToolset} message McpToolset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - McpToolset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.serverAddress = ""; - object.apiAuthentication = null; - object.serviceDirectoryConfig = null; - object.tlsConfig = null; - } - if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) - object.serverAddress = message.serverAddress; - if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) - object.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.toObject(message.apiAuthentication, options); - if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) - object.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); - if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) - object.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.toObject(message.tlsConfig, options); - return object; - }; - - /** - * Converts this McpToolset to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.McpToolset - * @instance - * @returns {Object.} JSON object - */ - McpToolset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for McpToolset - * @function getTypeUrl - * @memberof google.cloud.ces.v1.McpToolset - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - McpToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.McpToolset"; - }; - - return McpToolset; - })(); - - v1.OpenApiToolset = (function() { - - /** - * Properties of an OpenApiToolset. - * @memberof google.cloud.ces.v1 - * @interface IOpenApiToolset - * @property {string|null} [openApiSchema] OpenApiToolset openApiSchema - * @property {google.cloud.ces.v1.IApiAuthentication|null} [apiAuthentication] OpenApiToolset apiAuthentication - * @property {google.cloud.ces.v1.ITlsConfig|null} [tlsConfig] OpenApiToolset tlsConfig - * @property {google.cloud.ces.v1.IServiceDirectoryConfig|null} [serviceDirectoryConfig] OpenApiToolset serviceDirectoryConfig - * @property {boolean|null} [ignoreUnknownFields] OpenApiToolset ignoreUnknownFields - * @property {string|null} [url] OpenApiToolset url - */ - - /** - * Constructs a new OpenApiToolset. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an OpenApiToolset. - * @implements IOpenApiToolset - * @constructor - * @param {google.cloud.ces.v1.IOpenApiToolset=} [properties] Properties to set - */ - function OpenApiToolset(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OpenApiToolset openApiSchema. - * @member {string} openApiSchema - * @memberof google.cloud.ces.v1.OpenApiToolset - * @instance - */ - OpenApiToolset.prototype.openApiSchema = ""; - - /** - * OpenApiToolset apiAuthentication. - * @member {google.cloud.ces.v1.IApiAuthentication|null|undefined} apiAuthentication - * @memberof google.cloud.ces.v1.OpenApiToolset - * @instance - */ - OpenApiToolset.prototype.apiAuthentication = null; - - /** - * OpenApiToolset tlsConfig. - * @member {google.cloud.ces.v1.ITlsConfig|null|undefined} tlsConfig - * @memberof google.cloud.ces.v1.OpenApiToolset - * @instance - */ - OpenApiToolset.prototype.tlsConfig = null; - - /** - * OpenApiToolset serviceDirectoryConfig. - * @member {google.cloud.ces.v1.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig - * @memberof google.cloud.ces.v1.OpenApiToolset - * @instance - */ - OpenApiToolset.prototype.serviceDirectoryConfig = null; - - /** - * OpenApiToolset ignoreUnknownFields. - * @member {boolean} ignoreUnknownFields - * @memberof google.cloud.ces.v1.OpenApiToolset - * @instance - */ - OpenApiToolset.prototype.ignoreUnknownFields = false; - - /** - * OpenApiToolset url. - * @member {string} url - * @memberof google.cloud.ces.v1.OpenApiToolset - * @instance - */ - OpenApiToolset.prototype.url = ""; - - /** - * Creates a new OpenApiToolset instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.OpenApiToolset - * @static - * @param {google.cloud.ces.v1.IOpenApiToolset=} [properties] Properties to set - * @returns {google.cloud.ces.v1.OpenApiToolset} OpenApiToolset instance - */ - OpenApiToolset.create = function create(properties) { - return new OpenApiToolset(properties); - }; - - /** - * Encodes the specified OpenApiToolset message. Does not implicitly {@link google.cloud.ces.v1.OpenApiToolset.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.OpenApiToolset - * @static - * @param {google.cloud.ces.v1.IOpenApiToolset} message OpenApiToolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OpenApiToolset.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.openApiSchema != null && Object.hasOwnProperty.call(message, "openApiSchema")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.openApiSchema); - if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) - $root.google.cloud.ces.v1.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) - $root.google.cloud.ces.v1.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) - $root.google.cloud.ces.v1.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.ignoreUnknownFields != null && Object.hasOwnProperty.call(message, "ignoreUnknownFields")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.ignoreUnknownFields); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.url); - return writer; - }; - - /** - * Encodes the specified OpenApiToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OpenApiToolset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.OpenApiToolset - * @static - * @param {google.cloud.ces.v1.IOpenApiToolset} message OpenApiToolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OpenApiToolset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OpenApiToolset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.OpenApiToolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.OpenApiToolset} OpenApiToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OpenApiToolset.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OpenApiToolset(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.openApiSchema = reader.string(); - break; - } - case 2: { - message.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.decode(reader, reader.uint32()); - break; - } - case 3: { - message.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - message.ignoreUnknownFields = reader.bool(); - break; - } - case 6: { - message.url = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OpenApiToolset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.OpenApiToolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.OpenApiToolset} OpenApiToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OpenApiToolset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OpenApiToolset message. - * @function verify - * @memberof google.cloud.ces.v1.OpenApiToolset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OpenApiToolset.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) - if (!$util.isString(message.openApiSchema)) - return "openApiSchema: string expected"; - if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { - var error = $root.google.cloud.ces.v1.ApiAuthentication.verify(message.apiAuthentication); - if (error) - return "apiAuthentication." + error; - } - if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { - var error = $root.google.cloud.ces.v1.TlsConfig.verify(message.tlsConfig); - if (error) - return "tlsConfig." + error; - } - if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { - var error = $root.google.cloud.ces.v1.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); - if (error) - return "serviceDirectoryConfig." + error; - } - if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) - if (typeof message.ignoreUnknownFields !== "boolean") - return "ignoreUnknownFields: boolean expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - return null; - }; - - /** - * Creates an OpenApiToolset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.OpenApiToolset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.OpenApiToolset} OpenApiToolset - */ - OpenApiToolset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.OpenApiToolset) - return object; - var message = new $root.google.cloud.ces.v1.OpenApiToolset(); - if (object.openApiSchema != null) - message.openApiSchema = String(object.openApiSchema); - if (object.apiAuthentication != null) { - if (typeof object.apiAuthentication !== "object") - throw TypeError(".google.cloud.ces.v1.OpenApiToolset.apiAuthentication: object expected"); - message.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.fromObject(object.apiAuthentication); - } - if (object.tlsConfig != null) { - if (typeof object.tlsConfig !== "object") - throw TypeError(".google.cloud.ces.v1.OpenApiToolset.tlsConfig: object expected"); - message.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.fromObject(object.tlsConfig); - } - if (object.serviceDirectoryConfig != null) { - if (typeof object.serviceDirectoryConfig !== "object") - throw TypeError(".google.cloud.ces.v1.OpenApiToolset.serviceDirectoryConfig: object expected"); - message.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); - } - if (object.ignoreUnknownFields != null) - message.ignoreUnknownFields = Boolean(object.ignoreUnknownFields); - if (object.url != null) - message.url = String(object.url); - return message; - }; - - /** - * Creates a plain object from an OpenApiToolset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.OpenApiToolset - * @static - * @param {google.cloud.ces.v1.OpenApiToolset} message OpenApiToolset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OpenApiToolset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.openApiSchema = ""; - object.apiAuthentication = null; - object.tlsConfig = null; - object.serviceDirectoryConfig = null; - object.ignoreUnknownFields = false; - object.url = ""; - } - if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) - object.openApiSchema = message.openApiSchema; - if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) - object.apiAuthentication = $root.google.cloud.ces.v1.ApiAuthentication.toObject(message.apiAuthentication, options); - if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) - object.tlsConfig = $root.google.cloud.ces.v1.TlsConfig.toObject(message.tlsConfig, options); - if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) - object.serviceDirectoryConfig = $root.google.cloud.ces.v1.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); - if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) - object.ignoreUnknownFields = message.ignoreUnknownFields; - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - return object; - }; - - /** - * Converts this OpenApiToolset to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.OpenApiToolset - * @instance - * @returns {Object.} JSON object - */ - OpenApiToolset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OpenApiToolset - * @function getTypeUrl - * @memberof google.cloud.ces.v1.OpenApiToolset - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OpenApiToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.OpenApiToolset"; - }; - - return OpenApiToolset; - })(); - - v1.Changelog = (function() { - - /** - * Properties of a Changelog. - * @memberof google.cloud.ces.v1 - * @interface IChangelog - * @property {string|null} [name] Changelog name - * @property {string|null} [author] Changelog author - * @property {string|null} [displayName] Changelog displayName - * @property {string|null} [description] Changelog description - * @property {string|null} [resource] Changelog resource - * @property {string|null} [resourceType] Changelog resourceType - * @property {string|null} [action] Changelog action - * @property {google.protobuf.IStruct|null} [originalResource] Changelog originalResource - * @property {google.protobuf.IStruct|null} [newResource] Changelog newResource - * @property {Array.|null} [dependentResources] Changelog dependentResources - * @property {google.protobuf.ITimestamp|null} [createTime] Changelog createTime - * @property {number|Long|null} [sequenceNumber] Changelog sequenceNumber - */ - - /** - * Constructs a new Changelog. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a Changelog. - * @implements IChangelog - * @constructor - * @param {google.cloud.ces.v1.IChangelog=} [properties] Properties to set - */ - function Changelog(properties) { - this.dependentResources = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Changelog name. - * @member {string} name - * @memberof google.cloud.ces.v1.Changelog - * @instance - */ - Changelog.prototype.name = ""; - - /** - * Changelog author. - * @member {string} author - * @memberof google.cloud.ces.v1.Changelog - * @instance - */ - Changelog.prototype.author = ""; - - /** - * Changelog displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1.Changelog - * @instance - */ - Changelog.prototype.displayName = ""; - - /** - * Changelog description. - * @member {string} description - * @memberof google.cloud.ces.v1.Changelog - * @instance - */ - Changelog.prototype.description = ""; - - /** - * Changelog resource. - * @member {string} resource - * @memberof google.cloud.ces.v1.Changelog - * @instance - */ - Changelog.prototype.resource = ""; - - /** - * Changelog resourceType. - * @member {string} resourceType - * @memberof google.cloud.ces.v1.Changelog - * @instance - */ - Changelog.prototype.resourceType = ""; - - /** - * Changelog action. - * @member {string} action - * @memberof google.cloud.ces.v1.Changelog - * @instance - */ - Changelog.prototype.action = ""; - - /** - * Changelog originalResource. - * @member {google.protobuf.IStruct|null|undefined} originalResource - * @memberof google.cloud.ces.v1.Changelog - * @instance - */ - Changelog.prototype.originalResource = null; - - /** - * Changelog newResource. - * @member {google.protobuf.IStruct|null|undefined} newResource - * @memberof google.cloud.ces.v1.Changelog - * @instance - */ - Changelog.prototype.newResource = null; - - /** - * Changelog dependentResources. - * @member {Array.} dependentResources - * @memberof google.cloud.ces.v1.Changelog - * @instance - */ - Changelog.prototype.dependentResources = $util.emptyArray; - - /** - * Changelog createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1.Changelog - * @instance - */ - Changelog.prototype.createTime = null; - - /** - * Changelog sequenceNumber. - * @member {number|Long} sequenceNumber - * @memberof google.cloud.ces.v1.Changelog - * @instance - */ - Changelog.prototype.sequenceNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Changelog instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Changelog - * @static - * @param {google.cloud.ces.v1.IChangelog=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Changelog} Changelog instance - */ - Changelog.create = function create(properties) { - return new Changelog(properties); - }; - - /** - * Encodes the specified Changelog message. Does not implicitly {@link google.cloud.ces.v1.Changelog.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Changelog - * @static - * @param {google.cloud.ces.v1.IChangelog} message Changelog message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Changelog.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.author != null && Object.hasOwnProperty.call(message, "author")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.author); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resource); - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceType); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.action); - if (message.originalResource != null && Object.hasOwnProperty.call(message, "originalResource")) - $root.google.protobuf.Struct.encode(message.originalResource, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.newResource != null && Object.hasOwnProperty.call(message, "newResource")) - $root.google.protobuf.Struct.encode(message.newResource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.dependentResources != null && message.dependentResources.length) - for (var i = 0; i < message.dependentResources.length; ++i) - $root.google.protobuf.Struct.encode(message.dependentResources[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.description); - if (message.sequenceNumber != null && Object.hasOwnProperty.call(message, "sequenceNumber")) - writer.uint32(/* id 12, wireType 0 =*/96).int64(message.sequenceNumber); - return writer; - }; - - /** - * Encodes the specified Changelog message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Changelog.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Changelog - * @static - * @param {google.cloud.ces.v1.IChangelog} message Changelog message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Changelog.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Changelog message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Changelog - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Changelog} Changelog - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Changelog.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Changelog(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.author = reader.string(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - case 11: { - message.description = reader.string(); - break; - } - case 4: { - message.resource = reader.string(); - break; - } - case 5: { - message.resourceType = reader.string(); - break; - } - case 6: { - message.action = reader.string(); - break; - } - case 7: { - message.originalResource = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 8: { - message.newResource = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.dependentResources && message.dependentResources.length)) - message.dependentResources = []; - message.dependentResources.push($root.google.protobuf.Struct.decode(reader, reader.uint32())); - break; - } - case 10: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 12: { - message.sequenceNumber = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Changelog message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Changelog - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Changelog} Changelog - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Changelog.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Changelog message. - * @function verify - * @memberof google.cloud.ces.v1.Changelog - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Changelog.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.author != null && message.hasOwnProperty("author")) - if (!$util.isString(message.author)) - return "author: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: string expected"; - if (message.action != null && message.hasOwnProperty("action")) - if (!$util.isString(message.action)) - return "action: string expected"; - if (message.originalResource != null && message.hasOwnProperty("originalResource")) { - var error = $root.google.protobuf.Struct.verify(message.originalResource); - if (error) - return "originalResource." + error; - } - if (message.newResource != null && message.hasOwnProperty("newResource")) { - var error = $root.google.protobuf.Struct.verify(message.newResource); - if (error) - return "newResource." + error; - } - if (message.dependentResources != null && message.hasOwnProperty("dependentResources")) { - if (!Array.isArray(message.dependentResources)) - return "dependentResources: array expected"; - for (var i = 0; i < message.dependentResources.length; ++i) { - var error = $root.google.protobuf.Struct.verify(message.dependentResources[i]); - if (error) - return "dependentResources." + error; - } - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) - if (!$util.isInteger(message.sequenceNumber) && !(message.sequenceNumber && $util.isInteger(message.sequenceNumber.low) && $util.isInteger(message.sequenceNumber.high))) - return "sequenceNumber: integer|Long expected"; - return null; - }; - - /** - * Creates a Changelog message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Changelog - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Changelog} Changelog - */ - Changelog.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Changelog) - return object; - var message = new $root.google.cloud.ces.v1.Changelog(); - if (object.name != null) - message.name = String(object.name); - if (object.author != null) - message.author = String(object.author); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.resource != null) - message.resource = String(object.resource); - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - if (object.action != null) - message.action = String(object.action); - if (object.originalResource != null) { - if (typeof object.originalResource !== "object") - throw TypeError(".google.cloud.ces.v1.Changelog.originalResource: object expected"); - message.originalResource = $root.google.protobuf.Struct.fromObject(object.originalResource); - } - if (object.newResource != null) { - if (typeof object.newResource !== "object") - throw TypeError(".google.cloud.ces.v1.Changelog.newResource: object expected"); - message.newResource = $root.google.protobuf.Struct.fromObject(object.newResource); - } - if (object.dependentResources) { - if (!Array.isArray(object.dependentResources)) - throw TypeError(".google.cloud.ces.v1.Changelog.dependentResources: array expected"); - message.dependentResources = []; - for (var i = 0; i < object.dependentResources.length; ++i) { - if (typeof object.dependentResources[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Changelog.dependentResources: object expected"); - message.dependentResources[i] = $root.google.protobuf.Struct.fromObject(object.dependentResources[i]); - } - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1.Changelog.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.sequenceNumber != null) - if ($util.Long) - (message.sequenceNumber = $util.Long.fromValue(object.sequenceNumber)).unsigned = false; - else if (typeof object.sequenceNumber === "string") - message.sequenceNumber = parseInt(object.sequenceNumber, 10); - else if (typeof object.sequenceNumber === "number") - message.sequenceNumber = object.sequenceNumber; - else if (typeof object.sequenceNumber === "object") - message.sequenceNumber = new $util.LongBits(object.sequenceNumber.low >>> 0, object.sequenceNumber.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a Changelog message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Changelog - * @static - * @param {google.cloud.ces.v1.Changelog} message Changelog - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Changelog.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.dependentResources = []; - if (options.defaults) { - object.name = ""; - object.author = ""; - object.displayName = ""; - object.resource = ""; - object.resourceType = ""; - object.action = ""; - object.originalResource = null; - object.newResource = null; - object.createTime = null; - object.description = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sequenceNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequenceNumber = options.longs === String ? "0" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.author != null && message.hasOwnProperty("author")) - object.author = message.author; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - if (message.action != null && message.hasOwnProperty("action")) - object.action = message.action; - if (message.originalResource != null && message.hasOwnProperty("originalResource")) - object.originalResource = $root.google.protobuf.Struct.toObject(message.originalResource, options); - if (message.newResource != null && message.hasOwnProperty("newResource")) - object.newResource = $root.google.protobuf.Struct.toObject(message.newResource, options); - if (message.dependentResources && message.dependentResources.length) { - object.dependentResources = []; - for (var j = 0; j < message.dependentResources.length; ++j) - object.dependentResources[j] = $root.google.protobuf.Struct.toObject(message.dependentResources[j], options); - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) - if (typeof message.sequenceNumber === "number") - object.sequenceNumber = options.longs === String ? String(message.sequenceNumber) : message.sequenceNumber; - else - object.sequenceNumber = options.longs === String ? $util.Long.prototype.toString.call(message.sequenceNumber) : options.longs === Number ? new $util.LongBits(message.sequenceNumber.low >>> 0, message.sequenceNumber.high >>> 0).toNumber() : message.sequenceNumber; - return object; - }; - - /** - * Converts this Changelog to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Changelog - * @instance - * @returns {Object.} JSON object - */ - Changelog.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Changelog - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Changelog - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Changelog.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Changelog"; - }; - - return Changelog; - })(); - - v1.Conversation = (function() { - - /** - * Properties of a Conversation. - * @memberof google.cloud.ces.v1 - * @interface IConversation - * @property {string|null} [name] Conversation name - * @property {google.protobuf.ITimestamp|null} [startTime] Conversation startTime - * @property {google.protobuf.ITimestamp|null} [endTime] Conversation endTime - * @property {Array.|null} [turns] Conversation turns - * @property {number|null} [turnCount] Conversation turnCount - * @property {google.cloud.ces.v1.Conversation.ChannelType|null} [channelType] Conversation channelType - * @property {google.cloud.ces.v1.Conversation.Source|null} [source] Conversation source - * @property {Array.|null} [inputTypes] Conversation inputTypes - * @property {string|null} [entryAgent] Conversation entryAgent - * @property {string|null} [deployment] Conversation deployment - * @property {string|null} [appVersion] Conversation appVersion - * @property {string|null} [languageCode] Conversation languageCode - * @property {Array.|null} [messages] Conversation messages - */ - - /** - * Constructs a new Conversation. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a Conversation. - * @implements IConversation - * @constructor - * @param {google.cloud.ces.v1.IConversation=} [properties] Properties to set - */ - function Conversation(properties) { - this.turns = []; - this.inputTypes = []; - this.messages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Conversation name. - * @member {string} name - * @memberof google.cloud.ces.v1.Conversation - * @instance - */ - Conversation.prototype.name = ""; - - /** - * Conversation startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.ces.v1.Conversation - * @instance - */ - Conversation.prototype.startTime = null; - - /** - * Conversation endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.ces.v1.Conversation - * @instance - */ - Conversation.prototype.endTime = null; - - /** - * Conversation turns. - * @member {Array.} turns - * @memberof google.cloud.ces.v1.Conversation - * @instance - */ - Conversation.prototype.turns = $util.emptyArray; - - /** - * Conversation turnCount. - * @member {number} turnCount - * @memberof google.cloud.ces.v1.Conversation - * @instance - */ - Conversation.prototype.turnCount = 0; - - /** - * Conversation channelType. - * @member {google.cloud.ces.v1.Conversation.ChannelType} channelType - * @memberof google.cloud.ces.v1.Conversation - * @instance - */ - Conversation.prototype.channelType = 0; - - /** - * Conversation source. - * @member {google.cloud.ces.v1.Conversation.Source} source - * @memberof google.cloud.ces.v1.Conversation - * @instance - */ - Conversation.prototype.source = 0; - - /** - * Conversation inputTypes. - * @member {Array.} inputTypes - * @memberof google.cloud.ces.v1.Conversation - * @instance - */ - Conversation.prototype.inputTypes = $util.emptyArray; - - /** - * Conversation entryAgent. - * @member {string} entryAgent - * @memberof google.cloud.ces.v1.Conversation - * @instance - */ - Conversation.prototype.entryAgent = ""; - - /** - * Conversation deployment. - * @member {string} deployment - * @memberof google.cloud.ces.v1.Conversation - * @instance - */ - Conversation.prototype.deployment = ""; - - /** - * Conversation appVersion. - * @member {string} appVersion - * @memberof google.cloud.ces.v1.Conversation - * @instance - */ - Conversation.prototype.appVersion = ""; - - /** - * Conversation languageCode. - * @member {string} languageCode - * @memberof google.cloud.ces.v1.Conversation - * @instance - */ - Conversation.prototype.languageCode = ""; - - /** - * Conversation messages. - * @member {Array.} messages - * @memberof google.cloud.ces.v1.Conversation - * @instance - */ - Conversation.prototype.messages = $util.emptyArray; - - /** - * Creates a new Conversation instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Conversation - * @static - * @param {google.cloud.ces.v1.IConversation=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Conversation} Conversation instance - */ - Conversation.create = function create(properties) { - return new Conversation(properties); - }; - - /** - * Encodes the specified Conversation message. Does not implicitly {@link google.cloud.ces.v1.Conversation.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Conversation - * @static - * @param {google.cloud.ces.v1.IConversation} message Conversation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Conversation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.google.cloud.ces.v1.Message.encode(message.messages[i], 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 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.turns != null && message.turns.length) - for (var i = 0; i < message.turns.length; ++i) - $root.google.cloud.ces.v1.Conversation.Turn.encode(message.turns[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.turnCount != null && Object.hasOwnProperty.call(message, "turnCount")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.turnCount); - if (message.channelType != null && Object.hasOwnProperty.call(message, "channelType")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.channelType); - if (message.source != null && Object.hasOwnProperty.call(message, "source")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.source); - if (message.inputTypes != null && message.inputTypes.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.inputTypes.length; ++i) - writer.int32(message.inputTypes[i]); - writer.ldelim(); - } - if (message.entryAgent != null && Object.hasOwnProperty.call(message, "entryAgent")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.entryAgent); - if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.deployment); - if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.appVersion); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.languageCode); - return writer; - }; - - /** - * Encodes the specified Conversation message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Conversation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Conversation - * @static - * @param {google.cloud.ces.v1.IConversation} message Conversation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Conversation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Conversation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Conversation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Conversation} Conversation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Conversation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Conversation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - if (!(message.turns && message.turns.length)) - message.turns = []; - message.turns.push($root.google.cloud.ces.v1.Conversation.Turn.decode(reader, reader.uint32())); - break; - } - case 7: { - message.turnCount = reader.int32(); - break; - } - case 8: { - message.channelType = reader.int32(); - break; - } - case 9: { - message.source = reader.int32(); - break; - } - case 10: { - if (!(message.inputTypes && message.inputTypes.length)) - message.inputTypes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.inputTypes.push(reader.int32()); - } else - message.inputTypes.push(reader.int32()); - break; - } - case 11: { - message.entryAgent = reader.string(); - break; - } - case 12: { - message.deployment = reader.string(); - break; - } - case 13: { - message.appVersion = reader.string(); - break; - } - case 14: { - message.languageCode = reader.string(); - break; - } - case 2: { - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.google.cloud.ces.v1.Message.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Conversation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Conversation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Conversation} Conversation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Conversation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Conversation message. - * @function verify - * @memberof google.cloud.ces.v1.Conversation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Conversation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string 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.turns != null && message.hasOwnProperty("turns")) { - if (!Array.isArray(message.turns)) - return "turns: array expected"; - for (var i = 0; i < message.turns.length; ++i) { - var error = $root.google.cloud.ces.v1.Conversation.Turn.verify(message.turns[i]); - if (error) - return "turns." + error; - } - } - if (message.turnCount != null && message.hasOwnProperty("turnCount")) - if (!$util.isInteger(message.turnCount)) - return "turnCount: integer expected"; - if (message.channelType != null && message.hasOwnProperty("channelType")) - switch (message.channelType) { - default: - return "channelType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.source != null && message.hasOwnProperty("source")) - switch (message.source) { - default: - return "source: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.inputTypes != null && message.hasOwnProperty("inputTypes")) { - if (!Array.isArray(message.inputTypes)) - return "inputTypes: array expected"; - for (var i = 0; i < message.inputTypes.length; ++i) - switch (message.inputTypes[i]) { - default: - return "inputTypes: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - } - if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) - if (!$util.isString(message.entryAgent)) - return "entryAgent: string expected"; - if (message.deployment != null && message.hasOwnProperty("deployment")) - if (!$util.isString(message.deployment)) - return "deployment: string expected"; - if (message.appVersion != null && message.hasOwnProperty("appVersion")) - if (!$util.isString(message.appVersion)) - return "appVersion: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.cloud.ces.v1.Message.verify(message.messages[i]); - if (error) - return "messages." + error; - } - } - return null; - }; - - /** - * Creates a Conversation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Conversation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Conversation} Conversation - */ - Conversation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Conversation) - return object; - var message = new $root.google.cloud.ces.v1.Conversation(); - if (object.name != null) - message.name = String(object.name); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.ces.v1.Conversation.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.ces.v1.Conversation.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.turns) { - if (!Array.isArray(object.turns)) - throw TypeError(".google.cloud.ces.v1.Conversation.turns: array expected"); - message.turns = []; - for (var i = 0; i < object.turns.length; ++i) { - if (typeof object.turns[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Conversation.turns: object expected"); - message.turns[i] = $root.google.cloud.ces.v1.Conversation.Turn.fromObject(object.turns[i]); - } - } - if (object.turnCount != null) - message.turnCount = object.turnCount | 0; - switch (object.channelType) { - default: - if (typeof object.channelType === "number") { - message.channelType = object.channelType; - break; - } - break; - case "CHANNEL_TYPE_UNSPECIFIED": - case 0: - message.channelType = 0; - break; - case "TEXT": - case 1: - message.channelType = 1; - break; - case "AUDIO": - case 2: - message.channelType = 2; - break; - case "MULTIMODAL": - case 3: - message.channelType = 3; - break; - } - switch (object.source) { - default: - if (typeof object.source === "number") { - message.source = object.source; - break; - } - break; - case "SOURCE_UNSPECIFIED": - case 0: - message.source = 0; - break; - case "LIVE": - case 1: - message.source = 1; - break; - case "SIMULATOR": - case 2: - message.source = 2; - break; - case "EVAL": - case 3: - message.source = 3; - break; - } - if (object.inputTypes) { - if (!Array.isArray(object.inputTypes)) - throw TypeError(".google.cloud.ces.v1.Conversation.inputTypes: array expected"); - message.inputTypes = []; - for (var i = 0; i < object.inputTypes.length; ++i) - switch (object.inputTypes[i]) { - default: - if (typeof object.inputTypes[i] === "number") { - message.inputTypes[i] = object.inputTypes[i]; - break; - } - case "INPUT_TYPE_UNSPECIFIED": - case 0: - message.inputTypes[i] = 0; - break; - case "INPUT_TYPE_TEXT": - case 1: - message.inputTypes[i] = 1; - break; - case "INPUT_TYPE_AUDIO": - case 2: - message.inputTypes[i] = 2; - break; - case "INPUT_TYPE_IMAGE": - case 3: - message.inputTypes[i] = 3; - break; - case "INPUT_TYPE_BLOB": - case 4: - message.inputTypes[i] = 4; - break; - case "INPUT_TYPE_TOOL_RESPONSE": - case 5: - message.inputTypes[i] = 5; - break; - case "INPUT_TYPE_VARIABLES": - case 6: - message.inputTypes[i] = 6; - break; - } - } - if (object.entryAgent != null) - message.entryAgent = String(object.entryAgent); - if (object.deployment != null) - message.deployment = String(object.deployment); - if (object.appVersion != null) - message.appVersion = String(object.appVersion); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".google.cloud.ces.v1.Conversation.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Conversation.messages: object expected"); - message.messages[i] = $root.google.cloud.ces.v1.Message.fromObject(object.messages[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Conversation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Conversation - * @static - * @param {google.cloud.ces.v1.Conversation} message Conversation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Conversation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.messages = []; - object.turns = []; - object.inputTypes = []; - } - if (options.defaults) { - object.name = ""; - object.startTime = null; - object.endTime = null; - object.turnCount = 0; - object.channelType = options.enums === String ? "CHANNEL_TYPE_UNSPECIFIED" : 0; - object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; - object.entryAgent = ""; - object.deployment = ""; - object.appVersion = ""; - object.languageCode = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.cloud.ces.v1.Message.toObject(message.messages[j], options); - } - 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.turns && message.turns.length) { - object.turns = []; - for (var j = 0; j < message.turns.length; ++j) - object.turns[j] = $root.google.cloud.ces.v1.Conversation.Turn.toObject(message.turns[j], options); - } - if (message.turnCount != null && message.hasOwnProperty("turnCount")) - object.turnCount = message.turnCount; - if (message.channelType != null && message.hasOwnProperty("channelType")) - object.channelType = options.enums === String ? $root.google.cloud.ces.v1.Conversation.ChannelType[message.channelType] === undefined ? message.channelType : $root.google.cloud.ces.v1.Conversation.ChannelType[message.channelType] : message.channelType; - if (message.source != null && message.hasOwnProperty("source")) - object.source = options.enums === String ? $root.google.cloud.ces.v1.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1.Conversation.Source[message.source] : message.source; - if (message.inputTypes && message.inputTypes.length) { - object.inputTypes = []; - for (var j = 0; j < message.inputTypes.length; ++j) - object.inputTypes[j] = options.enums === String ? $root.google.cloud.ces.v1.Conversation.InputType[message.inputTypes[j]] === undefined ? message.inputTypes[j] : $root.google.cloud.ces.v1.Conversation.InputType[message.inputTypes[j]] : message.inputTypes[j]; - } - if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) - object.entryAgent = message.entryAgent; - if (message.deployment != null && message.hasOwnProperty("deployment")) - object.deployment = message.deployment; - if (message.appVersion != null && message.hasOwnProperty("appVersion")) - object.appVersion = message.appVersion; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - return object; - }; - - /** - * Converts this Conversation to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Conversation - * @instance - * @returns {Object.} JSON object - */ - Conversation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Conversation - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Conversation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Conversation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Conversation"; - }; - - Conversation.Turn = (function() { - - /** - * Properties of a Turn. - * @memberof google.cloud.ces.v1.Conversation - * @interface ITurn - * @property {Array.|null} [messages] Turn messages - * @property {google.cloud.ces.v1.ISpan|null} [rootSpan] Turn rootSpan - */ - - /** - * Constructs a new Turn. - * @memberof google.cloud.ces.v1.Conversation - * @classdesc Represents a Turn. - * @implements ITurn - * @constructor - * @param {google.cloud.ces.v1.Conversation.ITurn=} [properties] Properties to set - */ - function Turn(properties) { - this.messages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Turn messages. - * @member {Array.} messages - * @memberof google.cloud.ces.v1.Conversation.Turn - * @instance - */ - Turn.prototype.messages = $util.emptyArray; - - /** - * Turn rootSpan. - * @member {google.cloud.ces.v1.ISpan|null|undefined} rootSpan - * @memberof google.cloud.ces.v1.Conversation.Turn - * @instance - */ - Turn.prototype.rootSpan = null; - - /** - * Creates a new Turn instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Conversation.Turn - * @static - * @param {google.cloud.ces.v1.Conversation.ITurn=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Conversation.Turn} Turn instance - */ - Turn.create = function create(properties) { - return new Turn(properties); - }; - - /** - * Encodes the specified Turn message. Does not implicitly {@link google.cloud.ces.v1.Conversation.Turn.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Conversation.Turn - * @static - * @param {google.cloud.ces.v1.Conversation.ITurn} message Turn message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Turn.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.google.cloud.ces.v1.Message.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.rootSpan != null && Object.hasOwnProperty.call(message, "rootSpan")) - $root.google.cloud.ces.v1.Span.encode(message.rootSpan, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Turn message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Conversation.Turn.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Conversation.Turn - * @static - * @param {google.cloud.ces.v1.Conversation.ITurn} message Turn message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Turn.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Turn message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Conversation.Turn - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Conversation.Turn} Turn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Turn.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Conversation.Turn(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.google.cloud.ces.v1.Message.decode(reader, reader.uint32())); - break; - } - case 2: { - message.rootSpan = $root.google.cloud.ces.v1.Span.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Turn message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Conversation.Turn - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Conversation.Turn} Turn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Turn.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Turn message. - * @function verify - * @memberof google.cloud.ces.v1.Conversation.Turn - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Turn.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.cloud.ces.v1.Message.verify(message.messages[i]); - if (error) - return "messages." + error; - } - } - if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) { - var error = $root.google.cloud.ces.v1.Span.verify(message.rootSpan); - if (error) - return "rootSpan." + error; - } - return null; - }; - - /** - * Creates a Turn message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Conversation.Turn - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Conversation.Turn} Turn - */ - Turn.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Conversation.Turn) - return object; - var message = new $root.google.cloud.ces.v1.Conversation.Turn(); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".google.cloud.ces.v1.Conversation.Turn.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Conversation.Turn.messages: object expected"); - message.messages[i] = $root.google.cloud.ces.v1.Message.fromObject(object.messages[i]); - } - } - if (object.rootSpan != null) { - if (typeof object.rootSpan !== "object") - throw TypeError(".google.cloud.ces.v1.Conversation.Turn.rootSpan: object expected"); - message.rootSpan = $root.google.cloud.ces.v1.Span.fromObject(object.rootSpan); - } - return message; - }; - - /** - * Creates a plain object from a Turn message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Conversation.Turn - * @static - * @param {google.cloud.ces.v1.Conversation.Turn} message Turn - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Turn.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.messages = []; - if (options.defaults) - object.rootSpan = null; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.cloud.ces.v1.Message.toObject(message.messages[j], options); - } - if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) - object.rootSpan = $root.google.cloud.ces.v1.Span.toObject(message.rootSpan, options); - return object; - }; - - /** - * Converts this Turn to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Conversation.Turn - * @instance - * @returns {Object.} JSON object - */ - Turn.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Turn - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Conversation.Turn - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Turn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Conversation.Turn"; - }; - - return Turn; - })(); - - /** - * ChannelType enum. - * @name google.cloud.ces.v1.Conversation.ChannelType - * @enum {number} - * @property {number} CHANNEL_TYPE_UNSPECIFIED=0 CHANNEL_TYPE_UNSPECIFIED value - * @property {number} TEXT=1 TEXT value - * @property {number} AUDIO=2 AUDIO value - * @property {number} MULTIMODAL=3 MULTIMODAL value - */ - Conversation.ChannelType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CHANNEL_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "TEXT"] = 1; - values[valuesById[2] = "AUDIO"] = 2; - values[valuesById[3] = "MULTIMODAL"] = 3; - return values; - })(); - - /** - * Source enum. - * @name google.cloud.ces.v1.Conversation.Source - * @enum {number} - * @property {number} SOURCE_UNSPECIFIED=0 SOURCE_UNSPECIFIED value - * @property {number} LIVE=1 LIVE value - * @property {number} SIMULATOR=2 SIMULATOR value - * @property {number} EVAL=3 EVAL value - */ - Conversation.Source = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SOURCE_UNSPECIFIED"] = 0; - values[valuesById[1] = "LIVE"] = 1; - values[valuesById[2] = "SIMULATOR"] = 2; - values[valuesById[3] = "EVAL"] = 3; - return values; - })(); - - /** - * InputType enum. - * @name google.cloud.ces.v1.Conversation.InputType - * @enum {number} - * @property {number} INPUT_TYPE_UNSPECIFIED=0 INPUT_TYPE_UNSPECIFIED value - * @property {number} INPUT_TYPE_TEXT=1 INPUT_TYPE_TEXT value - * @property {number} INPUT_TYPE_AUDIO=2 INPUT_TYPE_AUDIO value - * @property {number} INPUT_TYPE_IMAGE=3 INPUT_TYPE_IMAGE value - * @property {number} INPUT_TYPE_BLOB=4 INPUT_TYPE_BLOB value - * @property {number} INPUT_TYPE_TOOL_RESPONSE=5 INPUT_TYPE_TOOL_RESPONSE value - * @property {number} INPUT_TYPE_VARIABLES=6 INPUT_TYPE_VARIABLES value - */ - Conversation.InputType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INPUT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INPUT_TYPE_TEXT"] = 1; - values[valuesById[2] = "INPUT_TYPE_AUDIO"] = 2; - values[valuesById[3] = "INPUT_TYPE_IMAGE"] = 3; - values[valuesById[4] = "INPUT_TYPE_BLOB"] = 4; - values[valuesById[5] = "INPUT_TYPE_TOOL_RESPONSE"] = 5; - values[valuesById[6] = "INPUT_TYPE_VARIABLES"] = 6; - return values; - })(); - - return Conversation; - })(); - - v1.Deployment = (function() { - - /** - * Properties of a Deployment. - * @memberof google.cloud.ces.v1 - * @interface IDeployment - * @property {string|null} [name] Deployment name - * @property {string|null} [displayName] Deployment displayName - * @property {string|null} [appVersion] Deployment appVersion - * @property {google.cloud.ces.v1.IChannelProfile|null} [channelProfile] Deployment channelProfile - * @property {google.protobuf.ITimestamp|null} [createTime] Deployment createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Deployment updateTime - * @property {string|null} [etag] Deployment etag - */ - - /** - * Constructs a new Deployment. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a Deployment. - * @implements IDeployment - * @constructor - * @param {google.cloud.ces.v1.IDeployment=} [properties] Properties to set - */ - function Deployment(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Deployment name. - * @member {string} name - * @memberof google.cloud.ces.v1.Deployment - * @instance - */ - Deployment.prototype.name = ""; - - /** - * Deployment displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1.Deployment - * @instance - */ - Deployment.prototype.displayName = ""; - - /** - * Deployment appVersion. - * @member {string} appVersion - * @memberof google.cloud.ces.v1.Deployment - * @instance - */ - Deployment.prototype.appVersion = ""; - - /** - * Deployment channelProfile. - * @member {google.cloud.ces.v1.IChannelProfile|null|undefined} channelProfile - * @memberof google.cloud.ces.v1.Deployment - * @instance - */ - Deployment.prototype.channelProfile = null; - - /** - * Deployment createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1.Deployment - * @instance - */ - Deployment.prototype.createTime = null; - - /** - * Deployment updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1.Deployment - * @instance - */ - Deployment.prototype.updateTime = null; - - /** - * Deployment etag. - * @member {string} etag - * @memberof google.cloud.ces.v1.Deployment - * @instance - */ - Deployment.prototype.etag = ""; - - /** - * Creates a new Deployment instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Deployment - * @static - * @param {google.cloud.ces.v1.IDeployment=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Deployment} Deployment instance - */ - Deployment.create = function create(properties) { - return new Deployment(properties); - }; - - /** - * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.ces.v1.Deployment.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Deployment - * @static - * @param {google.cloud.ces.v1.IDeployment} message Deployment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Deployment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.appVersion); - if (message.channelProfile != null && Object.hasOwnProperty.call(message, "channelProfile")) - $root.google.cloud.ces.v1.ChannelProfile.encode(message.channelProfile, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - 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.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Deployment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Deployment - * @static - * @param {google.cloud.ces.v1.IDeployment} message Deployment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Deployment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Deployment message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Deployment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Deployment} Deployment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Deployment.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Deployment(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 8: { - message.displayName = reader.string(); - break; - } - case 2: { - message.appVersion = reader.string(); - break; - } - case 3: { - message.channelProfile = $root.google.cloud.ces.v1.ChannelProfile.decode(reader, reader.uint32()); - 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 7: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Deployment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Deployment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Deployment} Deployment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Deployment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Deployment message. - * @function verify - * @memberof google.cloud.ces.v1.Deployment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Deployment.verify = function verify(message) { - if (typeof message !== "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.appVersion != null && message.hasOwnProperty("appVersion")) - if (!$util.isString(message.appVersion)) - return "appVersion: string expected"; - if (message.channelProfile != null && message.hasOwnProperty("channelProfile")) { - var error = $root.google.cloud.ces.v1.ChannelProfile.verify(message.channelProfile); - if (error) - return "channelProfile." + error; - } - 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.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a Deployment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Deployment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Deployment} Deployment - */ - Deployment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Deployment) - return object; - var message = new $root.google.cloud.ces.v1.Deployment(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.appVersion != null) - message.appVersion = String(object.appVersion); - if (object.channelProfile != null) { - if (typeof object.channelProfile !== "object") - throw TypeError(".google.cloud.ces.v1.Deployment.channelProfile: object expected"); - message.channelProfile = $root.google.cloud.ces.v1.ChannelProfile.fromObject(object.channelProfile); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1.Deployment.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.ces.v1.Deployment.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a Deployment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Deployment - * @static - * @param {google.cloud.ces.v1.Deployment} message Deployment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Deployment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.appVersion = ""; - object.channelProfile = null; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - object.displayName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.appVersion != null && message.hasOwnProperty("appVersion")) - object.appVersion = message.appVersion; - if (message.channelProfile != null && message.hasOwnProperty("channelProfile")) - object.channelProfile = $root.google.cloud.ces.v1.ChannelProfile.toObject(message.channelProfile, options); - 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.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this Deployment to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Deployment - * @instance - * @returns {Object.} JSON object - */ - Deployment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Deployment - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Deployment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Deployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Deployment"; - }; - - return Deployment; - })(); - - v1.Omnichannel = (function() { - - /** - * Properties of an Omnichannel. - * @memberof google.cloud.ces.v1 - * @interface IOmnichannel - * @property {string|null} [name] Omnichannel name - * @property {string|null} [displayName] Omnichannel displayName - * @property {string|null} [description] Omnichannel description - * @property {google.protobuf.ITimestamp|null} [createTime] Omnichannel createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Omnichannel updateTime - * @property {string|null} [etag] Omnichannel etag - * @property {google.cloud.ces.v1.IOmnichannelIntegrationConfig|null} [integrationConfig] Omnichannel integrationConfig - */ - - /** - * Constructs a new Omnichannel. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an Omnichannel. - * @implements IOmnichannel - * @constructor - * @param {google.cloud.ces.v1.IOmnichannel=} [properties] Properties to set - */ - function Omnichannel(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Omnichannel name. - * @member {string} name - * @memberof google.cloud.ces.v1.Omnichannel - * @instance - */ - Omnichannel.prototype.name = ""; - - /** - * Omnichannel displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1.Omnichannel - * @instance - */ - Omnichannel.prototype.displayName = ""; - - /** - * Omnichannel description. - * @member {string} description - * @memberof google.cloud.ces.v1.Omnichannel - * @instance - */ - Omnichannel.prototype.description = ""; - - /** - * Omnichannel createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1.Omnichannel - * @instance - */ - Omnichannel.prototype.createTime = null; - - /** - * Omnichannel updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1.Omnichannel - * @instance - */ - Omnichannel.prototype.updateTime = null; - - /** - * Omnichannel etag. - * @member {string} etag - * @memberof google.cloud.ces.v1.Omnichannel - * @instance - */ - Omnichannel.prototype.etag = ""; - - /** - * Omnichannel integrationConfig. - * @member {google.cloud.ces.v1.IOmnichannelIntegrationConfig|null|undefined} integrationConfig - * @memberof google.cloud.ces.v1.Omnichannel - * @instance - */ - Omnichannel.prototype.integrationConfig = null; - - /** - * Creates a new Omnichannel instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Omnichannel - * @static - * @param {google.cloud.ces.v1.IOmnichannel=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Omnichannel} Omnichannel instance - */ - Omnichannel.create = function create(properties) { - return new Omnichannel(properties); - }; - - /** - * Encodes the specified Omnichannel message. Does not implicitly {@link google.cloud.ces.v1.Omnichannel.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Omnichannel - * @static - * @param {google.cloud.ces.v1.IOmnichannel} message Omnichannel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Omnichannel.encode = function encode(message, writer) { - if (!writer) - 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.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - 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.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); - if (message.integrationConfig != null && Object.hasOwnProperty.call(message, "integrationConfig")) - $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.encode(message.integrationConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Omnichannel message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Omnichannel.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Omnichannel - * @static - * @param {google.cloud.ces.v1.IOmnichannel} message Omnichannel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Omnichannel.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Omnichannel message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Omnichannel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Omnichannel} Omnichannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Omnichannel.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Omnichannel(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = 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.etag = reader.string(); - break; - } - case 7: { - message.integrationConfig = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Omnichannel message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Omnichannel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Omnichannel} Omnichannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Omnichannel.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Omnichannel message. - * @function verify - * @memberof google.cloud.ces.v1.Omnichannel - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Omnichannel.verify = function verify(message) { - if (typeof message !== "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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: 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.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.integrationConfig != null && message.hasOwnProperty("integrationConfig")) { - var error = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.verify(message.integrationConfig); - if (error) - return "integrationConfig." + error; - } - return null; - }; - - /** - * Creates an Omnichannel message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Omnichannel - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Omnichannel} Omnichannel - */ - Omnichannel.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Omnichannel) - return object; - var message = new $root.google.cloud.ces.v1.Omnichannel(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1.Omnichannel.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.ces.v1.Omnichannel.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.integrationConfig != null) { - if (typeof object.integrationConfig !== "object") - throw TypeError(".google.cloud.ces.v1.Omnichannel.integrationConfig: object expected"); - message.integrationConfig = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.fromObject(object.integrationConfig); - } - return message; - }; - - /** - * Creates a plain object from an Omnichannel message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Omnichannel - * @static - * @param {google.cloud.ces.v1.Omnichannel} message Omnichannel - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Omnichannel.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - object.integrationConfig = 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.description != null && message.hasOwnProperty("description")) - object.description = message.description; - 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.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.integrationConfig != null && message.hasOwnProperty("integrationConfig")) - object.integrationConfig = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.toObject(message.integrationConfig, options); - return object; - }; - - /** - * Converts this Omnichannel to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Omnichannel - * @instance - * @returns {Object.} JSON object - */ - Omnichannel.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Omnichannel - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Omnichannel - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Omnichannel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Omnichannel"; - }; - - return Omnichannel; - })(); - - v1.OmnichannelIntegrationConfig = (function() { - - /** - * Properties of an OmnichannelIntegrationConfig. - * @memberof google.cloud.ces.v1 - * @interface IOmnichannelIntegrationConfig - * @property {Object.|null} [channelConfigs] OmnichannelIntegrationConfig channelConfigs - * @property {Object.|null} [subscriberConfigs] OmnichannelIntegrationConfig subscriberConfigs - * @property {Object.|null} [routingConfigs] OmnichannelIntegrationConfig routingConfigs - */ - - /** - * Constructs a new OmnichannelIntegrationConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an OmnichannelIntegrationConfig. - * @implements IOmnichannelIntegrationConfig - * @constructor - * @param {google.cloud.ces.v1.IOmnichannelIntegrationConfig=} [properties] Properties to set - */ - function OmnichannelIntegrationConfig(properties) { - this.channelConfigs = {}; - this.subscriberConfigs = {}; - this.routingConfigs = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OmnichannelIntegrationConfig channelConfigs. - * @member {Object.} channelConfigs - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @instance - */ - OmnichannelIntegrationConfig.prototype.channelConfigs = $util.emptyObject; - - /** - * OmnichannelIntegrationConfig subscriberConfigs. - * @member {Object.} subscriberConfigs - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @instance - */ - OmnichannelIntegrationConfig.prototype.subscriberConfigs = $util.emptyObject; - - /** - * OmnichannelIntegrationConfig routingConfigs. - * @member {Object.} routingConfigs - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @instance - */ - OmnichannelIntegrationConfig.prototype.routingConfigs = $util.emptyObject; - - /** - * Creates a new OmnichannelIntegrationConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @static - * @param {google.cloud.ces.v1.IOmnichannelIntegrationConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig instance - */ - OmnichannelIntegrationConfig.create = function create(properties) { - return new OmnichannelIntegrationConfig(properties); - }; - - /** - * Encodes the specified OmnichannelIntegrationConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @static - * @param {google.cloud.ces.v1.IOmnichannelIntegrationConfig} message OmnichannelIntegrationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OmnichannelIntegrationConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channelConfigs != null && Object.hasOwnProperty.call(message, "channelConfigs")) - for (var keys = Object.keys(message.channelConfigs), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.encode(message.channelConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.subscriberConfigs != null && Object.hasOwnProperty.call(message, "subscriberConfigs")) - for (var keys = Object.keys(message.subscriberConfigs), 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.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.encode(message.subscriberConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.routingConfigs != null && Object.hasOwnProperty.call(message, "routingConfigs")) - for (var keys = Object.keys(message.routingConfigs), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig.encode(message.routingConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified OmnichannelIntegrationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @static - * @param {google.cloud.ces.v1.IOmnichannelIntegrationConfig} message OmnichannelIntegrationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OmnichannelIntegrationConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OmnichannelIntegrationConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.channelConfigs === $util.emptyObject) - message.channelConfigs = {}; - 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.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.channelConfigs[key] = value; - break; - } - case 2: { - if (message.subscriberConfigs === $util.emptyObject) - message.subscriberConfigs = {}; - 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.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.subscriberConfigs[key] = value; - break; - } - case 3: { - if (message.routingConfigs === $util.emptyObject) - message.routingConfigs = {}; - 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.ces.v1.OmnichannelIntegrationConfig.RoutingConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.routingConfigs[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OmnichannelIntegrationConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OmnichannelIntegrationConfig message. - * @function verify - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OmnichannelIntegrationConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channelConfigs != null && message.hasOwnProperty("channelConfigs")) { - if (!$util.isObject(message.channelConfigs)) - return "channelConfigs: object expected"; - var key = Object.keys(message.channelConfigs); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.verify(message.channelConfigs[key[i]]); - if (error) - return "channelConfigs." + error; - } - } - if (message.subscriberConfigs != null && message.hasOwnProperty("subscriberConfigs")) { - if (!$util.isObject(message.subscriberConfigs)) - return "subscriberConfigs: object expected"; - var key = Object.keys(message.subscriberConfigs); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.verify(message.subscriberConfigs[key[i]]); - if (error) - return "subscriberConfigs." + error; - } - } - if (message.routingConfigs != null && message.hasOwnProperty("routingConfigs")) { - if (!$util.isObject(message.routingConfigs)) - return "routingConfigs: object expected"; - var key = Object.keys(message.routingConfigs); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig.verify(message.routingConfigs[key[i]]); - if (error) - return "routingConfigs." + error; - } - } - return null; - }; - - /** - * Creates an OmnichannelIntegrationConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig - */ - OmnichannelIntegrationConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.OmnichannelIntegrationConfig) - return object; - var message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig(); - if (object.channelConfigs) { - if (typeof object.channelConfigs !== "object") - throw TypeError(".google.cloud.ces.v1.OmnichannelIntegrationConfig.channelConfigs: object expected"); - message.channelConfigs = {}; - for (var keys = Object.keys(object.channelConfigs), i = 0; i < keys.length; ++i) { - if (typeof object.channelConfigs[keys[i]] !== "object") - throw TypeError(".google.cloud.ces.v1.OmnichannelIntegrationConfig.channelConfigs: object expected"); - message.channelConfigs[keys[i]] = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.fromObject(object.channelConfigs[keys[i]]); - } - } - if (object.subscriberConfigs) { - if (typeof object.subscriberConfigs !== "object") - throw TypeError(".google.cloud.ces.v1.OmnichannelIntegrationConfig.subscriberConfigs: object expected"); - message.subscriberConfigs = {}; - for (var keys = Object.keys(object.subscriberConfigs), i = 0; i < keys.length; ++i) { - if (typeof object.subscriberConfigs[keys[i]] !== "object") - throw TypeError(".google.cloud.ces.v1.OmnichannelIntegrationConfig.subscriberConfigs: object expected"); - message.subscriberConfigs[keys[i]] = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.fromObject(object.subscriberConfigs[keys[i]]); - } - } - if (object.routingConfigs) { - if (typeof object.routingConfigs !== "object") - throw TypeError(".google.cloud.ces.v1.OmnichannelIntegrationConfig.routingConfigs: object expected"); - message.routingConfigs = {}; - for (var keys = Object.keys(object.routingConfigs), i = 0; i < keys.length; ++i) { - if (typeof object.routingConfigs[keys[i]] !== "object") - throw TypeError(".google.cloud.ces.v1.OmnichannelIntegrationConfig.routingConfigs: object expected"); - message.routingConfigs[keys[i]] = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig.fromObject(object.routingConfigs[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from an OmnichannelIntegrationConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig} message OmnichannelIntegrationConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OmnichannelIntegrationConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.channelConfigs = {}; - object.subscriberConfigs = {}; - object.routingConfigs = {}; - } - var keys2; - if (message.channelConfigs && (keys2 = Object.keys(message.channelConfigs)).length) { - object.channelConfigs = {}; - for (var j = 0; j < keys2.length; ++j) - object.channelConfigs[keys2[j]] = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.toObject(message.channelConfigs[keys2[j]], options); - } - if (message.subscriberConfigs && (keys2 = Object.keys(message.subscriberConfigs)).length) { - object.subscriberConfigs = {}; - for (var j = 0; j < keys2.length; ++j) - object.subscriberConfigs[keys2[j]] = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.toObject(message.subscriberConfigs[keys2[j]], options); - } - if (message.routingConfigs && (keys2 = Object.keys(message.routingConfigs)).length) { - object.routingConfigs = {}; - for (var j = 0; j < keys2.length; ++j) - object.routingConfigs[keys2[j]] = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig.toObject(message.routingConfigs[keys2[j]], options); - } - return object; - }; - - /** - * Converts this OmnichannelIntegrationConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @instance - * @returns {Object.} JSON object - */ - OmnichannelIntegrationConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OmnichannelIntegrationConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OmnichannelIntegrationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.OmnichannelIntegrationConfig"; - }; - - OmnichannelIntegrationConfig.ChannelConfig = (function() { - - /** - * Properties of a ChannelConfig. - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @interface IChannelConfig - * @property {google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig|null} [whatsappConfig] ChannelConfig whatsappConfig - */ - - /** - * Constructs a new ChannelConfig. - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @classdesc Represents a ChannelConfig. - * @implements IChannelConfig - * @constructor - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig=} [properties] Properties to set - */ - function ChannelConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChannelConfig whatsappConfig. - * @member {google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig|null|undefined} whatsappConfig - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig - * @instance - */ - ChannelConfig.prototype.whatsappConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ChannelConfig channelConfig. - * @member {"whatsappConfig"|undefined} channelConfig - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig - * @instance - */ - Object.defineProperty(ChannelConfig.prototype, "channelConfig", { - get: $util.oneOfGetter($oneOfFields = ["whatsappConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ChannelConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig instance - */ - ChannelConfig.create = function create(properties) { - return new ChannelConfig(properties); - }; - - /** - * Encodes the specified ChannelConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig} message ChannelConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChannelConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.whatsappConfig != null && Object.hasOwnProperty.call(message, "whatsappConfig")) - $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig.encode(message.whatsappConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ChannelConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IChannelConfig} message ChannelConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChannelConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChannelConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChannelConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.whatsappConfig = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChannelConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChannelConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChannelConfig message. - * @function verify - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChannelConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.whatsappConfig != null && message.hasOwnProperty("whatsappConfig")) { - properties.channelConfig = 1; - { - var error = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig.verify(message.whatsappConfig); - if (error) - return "whatsappConfig." + error; - } - } - return null; - }; - - /** - * Creates a ChannelConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig - */ - ChannelConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig) - return object; - var message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig(); - if (object.whatsappConfig != null) { - if (typeof object.whatsappConfig !== "object") - throw TypeError(".google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig.whatsappConfig: object expected"); - message.whatsappConfig = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig.fromObject(object.whatsappConfig); - } - return message; - }; - - /** - * Creates a plain object from a ChannelConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig} message ChannelConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChannelConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.whatsappConfig != null && message.hasOwnProperty("whatsappConfig")) { - object.whatsappConfig = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig.toObject(message.whatsappConfig, options); - if (options.oneofs) - object.channelConfig = "whatsappConfig"; - } - return object; - }; - - /** - * Converts this ChannelConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig - * @instance - * @returns {Object.} JSON object - */ - ChannelConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ChannelConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ChannelConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.OmnichannelIntegrationConfig.ChannelConfig"; - }; - - return ChannelConfig; - })(); - - OmnichannelIntegrationConfig.WhatsappConfig = (function() { - - /** - * Properties of a WhatsappConfig. - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @interface IWhatsappConfig - * @property {string|null} [phoneNumberId] WhatsappConfig phoneNumberId - * @property {string|null} [phoneNumber] WhatsappConfig phoneNumber - * @property {string|null} [whatsappBusinessAccountId] WhatsappConfig whatsappBusinessAccountId - * @property {string|null} [webhookVerifyToken] WhatsappConfig webhookVerifyToken - * @property {string|null} [whatsappBusinessToken] WhatsappConfig whatsappBusinessToken - * @property {string|null} [metaBusinessPortfolioId] WhatsappConfig metaBusinessPortfolioId - */ - - /** - * Constructs a new WhatsappConfig. - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @classdesc Represents a WhatsappConfig. - * @implements IWhatsappConfig - * @constructor - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig=} [properties] Properties to set - */ - function WhatsappConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WhatsappConfig phoneNumberId. - * @member {string} phoneNumberId - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig - * @instance - */ - WhatsappConfig.prototype.phoneNumberId = ""; - - /** - * WhatsappConfig phoneNumber. - * @member {string} phoneNumber - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig - * @instance - */ - WhatsappConfig.prototype.phoneNumber = ""; - - /** - * WhatsappConfig whatsappBusinessAccountId. - * @member {string} whatsappBusinessAccountId - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig - * @instance - */ - WhatsappConfig.prototype.whatsappBusinessAccountId = ""; - - /** - * WhatsappConfig webhookVerifyToken. - * @member {string} webhookVerifyToken - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig - * @instance - */ - WhatsappConfig.prototype.webhookVerifyToken = ""; - - /** - * WhatsappConfig whatsappBusinessToken. - * @member {string} whatsappBusinessToken - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig - * @instance - */ - WhatsappConfig.prototype.whatsappBusinessToken = ""; - - /** - * WhatsappConfig metaBusinessPortfolioId. - * @member {string} metaBusinessPortfolioId - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig - * @instance - */ - WhatsappConfig.prototype.metaBusinessPortfolioId = ""; - - /** - * Creates a new WhatsappConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig instance - */ - WhatsappConfig.create = function create(properties) { - return new WhatsappConfig(properties); - }; - - /** - * Encodes the specified WhatsappConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig} message WhatsappConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WhatsappConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.phoneNumberId != null && Object.hasOwnProperty.call(message, "phoneNumberId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.phoneNumberId); - if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.phoneNumber); - if (message.whatsappBusinessAccountId != null && Object.hasOwnProperty.call(message, "whatsappBusinessAccountId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.whatsappBusinessAccountId); - if (message.webhookVerifyToken != null && Object.hasOwnProperty.call(message, "webhookVerifyToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.webhookVerifyToken); - if (message.whatsappBusinessToken != null && Object.hasOwnProperty.call(message, "whatsappBusinessToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.whatsappBusinessToken); - if (message.metaBusinessPortfolioId != null && Object.hasOwnProperty.call(message, "metaBusinessPortfolioId")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.metaBusinessPortfolioId); - return writer; - }; - - /** - * Encodes the specified WhatsappConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IWhatsappConfig} message WhatsappConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WhatsappConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WhatsappConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WhatsappConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.phoneNumberId = reader.string(); - break; - } - case 2: { - message.phoneNumber = reader.string(); - break; - } - case 3: { - message.whatsappBusinessAccountId = reader.string(); - break; - } - case 4: { - message.webhookVerifyToken = reader.string(); - break; - } - case 5: { - message.whatsappBusinessToken = reader.string(); - break; - } - case 6: { - message.metaBusinessPortfolioId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WhatsappConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WhatsappConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WhatsappConfig message. - * @function verify - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WhatsappConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.phoneNumberId != null && message.hasOwnProperty("phoneNumberId")) - if (!$util.isString(message.phoneNumberId)) - return "phoneNumberId: string expected"; - if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) - if (!$util.isString(message.phoneNumber)) - return "phoneNumber: string expected"; - if (message.whatsappBusinessAccountId != null && message.hasOwnProperty("whatsappBusinessAccountId")) - if (!$util.isString(message.whatsappBusinessAccountId)) - return "whatsappBusinessAccountId: string expected"; - if (message.webhookVerifyToken != null && message.hasOwnProperty("webhookVerifyToken")) - if (!$util.isString(message.webhookVerifyToken)) - return "webhookVerifyToken: string expected"; - if (message.whatsappBusinessToken != null && message.hasOwnProperty("whatsappBusinessToken")) - if (!$util.isString(message.whatsappBusinessToken)) - return "whatsappBusinessToken: string expected"; - if (message.metaBusinessPortfolioId != null && message.hasOwnProperty("metaBusinessPortfolioId")) - if (!$util.isString(message.metaBusinessPortfolioId)) - return "metaBusinessPortfolioId: string expected"; - return null; - }; - - /** - * Creates a WhatsappConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig - */ - WhatsappConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig) - return object; - var message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig(); - if (object.phoneNumberId != null) - message.phoneNumberId = String(object.phoneNumberId); - if (object.phoneNumber != null) - message.phoneNumber = String(object.phoneNumber); - if (object.whatsappBusinessAccountId != null) - message.whatsappBusinessAccountId = String(object.whatsappBusinessAccountId); - if (object.webhookVerifyToken != null) - message.webhookVerifyToken = String(object.webhookVerifyToken); - if (object.whatsappBusinessToken != null) - message.whatsappBusinessToken = String(object.whatsappBusinessToken); - if (object.metaBusinessPortfolioId != null) - message.metaBusinessPortfolioId = String(object.metaBusinessPortfolioId); - return message; - }; - - /** - * Creates a plain object from a WhatsappConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig} message WhatsappConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WhatsappConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.phoneNumberId = ""; - object.phoneNumber = ""; - object.whatsappBusinessAccountId = ""; - object.webhookVerifyToken = ""; - object.whatsappBusinessToken = ""; - object.metaBusinessPortfolioId = ""; - } - if (message.phoneNumberId != null && message.hasOwnProperty("phoneNumberId")) - object.phoneNumberId = message.phoneNumberId; - if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) - object.phoneNumber = message.phoneNumber; - if (message.whatsappBusinessAccountId != null && message.hasOwnProperty("whatsappBusinessAccountId")) - object.whatsappBusinessAccountId = message.whatsappBusinessAccountId; - if (message.webhookVerifyToken != null && message.hasOwnProperty("webhookVerifyToken")) - object.webhookVerifyToken = message.webhookVerifyToken; - if (message.whatsappBusinessToken != null && message.hasOwnProperty("whatsappBusinessToken")) - object.whatsappBusinessToken = message.whatsappBusinessToken; - if (message.metaBusinessPortfolioId != null && message.hasOwnProperty("metaBusinessPortfolioId")) - object.metaBusinessPortfolioId = message.metaBusinessPortfolioId; - return object; - }; - - /** - * Converts this WhatsappConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig - * @instance - * @returns {Object.} JSON object - */ - WhatsappConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WhatsappConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WhatsappConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.OmnichannelIntegrationConfig.WhatsappConfig"; - }; - - return WhatsappConfig; - })(); - - OmnichannelIntegrationConfig.SubscriberConfig = (function() { - - /** - * Properties of a SubscriberConfig. - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @interface ISubscriberConfig - * @property {google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig|null} [cesAppConfig] SubscriberConfig cesAppConfig - */ - - /** - * Constructs a new SubscriberConfig. - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @classdesc Represents a SubscriberConfig. - * @implements ISubscriberConfig - * @constructor - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig=} [properties] Properties to set - */ - function SubscriberConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SubscriberConfig cesAppConfig. - * @member {google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig|null|undefined} cesAppConfig - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig - * @instance - */ - SubscriberConfig.prototype.cesAppConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SubscriberConfig subscriberConfig. - * @member {"cesAppConfig"|undefined} subscriberConfig - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig - * @instance - */ - Object.defineProperty(SubscriberConfig.prototype, "subscriberConfig", { - get: $util.oneOfGetter($oneOfFields = ["cesAppConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SubscriberConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig instance - */ - SubscriberConfig.create = function create(properties) { - return new SubscriberConfig(properties); - }; - - /** - * Encodes the specified SubscriberConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig} message SubscriberConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubscriberConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cesAppConfig != null && Object.hasOwnProperty.call(message, "cesAppConfig")) - $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig.encode(message.cesAppConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SubscriberConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.ISubscriberConfig} message SubscriberConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubscriberConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SubscriberConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubscriberConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cesAppConfig = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SubscriberConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubscriberConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SubscriberConfig message. - * @function verify - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SubscriberConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.cesAppConfig != null && message.hasOwnProperty("cesAppConfig")) { - properties.subscriberConfig = 1; - { - var error = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig.verify(message.cesAppConfig); - if (error) - return "cesAppConfig." + error; - } - } - return null; - }; - - /** - * Creates a SubscriberConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig - */ - SubscriberConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig) - return object; - var message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig(); - if (object.cesAppConfig != null) { - if (typeof object.cesAppConfig !== "object") - throw TypeError(".google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig.cesAppConfig: object expected"); - message.cesAppConfig = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig.fromObject(object.cesAppConfig); - } - return message; - }; - - /** - * Creates a plain object from a SubscriberConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig} message SubscriberConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubscriberConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.cesAppConfig != null && message.hasOwnProperty("cesAppConfig")) { - object.cesAppConfig = $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig.toObject(message.cesAppConfig, options); - if (options.oneofs) - object.subscriberConfig = "cesAppConfig"; - } - return object; - }; - - /** - * Converts this SubscriberConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig - * @instance - * @returns {Object.} JSON object - */ - SubscriberConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubscriberConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubscriberConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.OmnichannelIntegrationConfig.SubscriberConfig"; - }; - - return SubscriberConfig; - })(); - - OmnichannelIntegrationConfig.CesAppConfig = (function() { - - /** - * Properties of a CesAppConfig. - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @interface ICesAppConfig - * @property {string|null} [app] CesAppConfig app - */ - - /** - * Constructs a new CesAppConfig. - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @classdesc Represents a CesAppConfig. - * @implements ICesAppConfig - * @constructor - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig=} [properties] Properties to set - */ - function CesAppConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CesAppConfig app. - * @member {string} app - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig - * @instance - */ - CesAppConfig.prototype.app = ""; - - /** - * Creates a new CesAppConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig instance - */ - CesAppConfig.create = function create(properties) { - return new CesAppConfig(properties); - }; - - /** - * Encodes the specified CesAppConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig} message CesAppConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CesAppConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.app != null && Object.hasOwnProperty.call(message, "app")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.app); - return writer; - }; - - /** - * Encodes the specified CesAppConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.ICesAppConfig} message CesAppConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CesAppConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CesAppConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CesAppConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.app = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CesAppConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CesAppConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CesAppConfig message. - * @function verify - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CesAppConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.app != null && message.hasOwnProperty("app")) - if (!$util.isString(message.app)) - return "app: string expected"; - return null; - }; - - /** - * Creates a CesAppConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig - */ - CesAppConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig) - return object; - var message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig(); - if (object.app != null) - message.app = String(object.app); - return message; - }; - - /** - * Creates a plain object from a CesAppConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig} message CesAppConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CesAppConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.app = ""; - if (message.app != null && message.hasOwnProperty("app")) - object.app = message.app; - return object; - }; - - /** - * Converts this CesAppConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig - * @instance - * @returns {Object.} JSON object - */ - CesAppConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CesAppConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CesAppConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.OmnichannelIntegrationConfig.CesAppConfig"; - }; - - return CesAppConfig; - })(); - - OmnichannelIntegrationConfig.RoutingConfig = (function() { - - /** - * Properties of a RoutingConfig. - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @interface IRoutingConfig - * @property {string|null} [subscriberKey] RoutingConfig subscriberKey - */ - - /** - * Constructs a new RoutingConfig. - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig - * @classdesc Represents a RoutingConfig. - * @implements IRoutingConfig - * @constructor - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig=} [properties] Properties to set - */ - function RoutingConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RoutingConfig subscriberKey. - * @member {string} subscriberKey - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig - * @instance - */ - RoutingConfig.prototype.subscriberKey = ""; - - /** - * Creates a new RoutingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig instance - */ - RoutingConfig.create = function create(properties) { - return new RoutingConfig(properties); - }; - - /** - * Encodes the specified RoutingConfig message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig} message RoutingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscriberKey != null && Object.hasOwnProperty.call(message, "subscriberKey")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscriberKey); - return writer; - }; - - /** - * Encodes the specified RoutingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.IRoutingConfig} message RoutingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RoutingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.subscriberKey = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RoutingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RoutingConfig message. - * @function verify - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RoutingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscriberKey != null && message.hasOwnProperty("subscriberKey")) - if (!$util.isString(message.subscriberKey)) - return "subscriberKey: string expected"; - return null; - }; - - /** - * Creates a RoutingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig - */ - RoutingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig) - return object; - var message = new $root.google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig(); - if (object.subscriberKey != null) - message.subscriberKey = String(object.subscriberKey); - return message; - }; - - /** - * Creates a plain object from a RoutingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig - * @static - * @param {google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig} message RoutingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RoutingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.subscriberKey = ""; - if (message.subscriberKey != null && message.hasOwnProperty("subscriberKey")) - object.subscriberKey = message.subscriberKey; - return object; - }; - - /** - * Converts this RoutingConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig - * @instance - * @returns {Object.} JSON object - */ - RoutingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RoutingConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RoutingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.OmnichannelIntegrationConfig.RoutingConfig"; - }; - - return RoutingConfig; - })(); - - return OmnichannelIntegrationConfig; - })(); - - v1.OmnichannelOperationMetadata = (function() { - - /** - * Properties of an OmnichannelOperationMetadata. - * @memberof google.cloud.ces.v1 - * @interface IOmnichannelOperationMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OmnichannelOperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OmnichannelOperationMetadata endTime - * @property {string|null} [statusMessage] OmnichannelOperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OmnichannelOperationMetadata requestedCancellation - */ - - /** - * Constructs a new OmnichannelOperationMetadata. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an OmnichannelOperationMetadata. - * @implements IOmnichannelOperationMetadata - * @constructor - * @param {google.cloud.ces.v1.IOmnichannelOperationMetadata=} [properties] Properties to set - */ - function OmnichannelOperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OmnichannelOperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata - * @instance - */ - OmnichannelOperationMetadata.prototype.createTime = null; - - /** - * OmnichannelOperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata - * @instance - */ - OmnichannelOperationMetadata.prototype.endTime = null; - - /** - * OmnichannelOperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata - * @instance - */ - OmnichannelOperationMetadata.prototype.statusMessage = ""; - - /** - * OmnichannelOperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata - * @instance - */ - OmnichannelOperationMetadata.prototype.requestedCancellation = false; - - /** - * Creates a new OmnichannelOperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata - * @static - * @param {google.cloud.ces.v1.IOmnichannelOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.ces.v1.OmnichannelOperationMetadata} OmnichannelOperationMetadata instance - */ - OmnichannelOperationMetadata.create = function create(properties) { - return new OmnichannelOperationMetadata(properties); - }; - - /** - * Encodes the specified OmnichannelOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1.OmnichannelOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata - * @static - * @param {google.cloud.ces.v1.IOmnichannelOperationMetadata} message OmnichannelOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OmnichannelOperationMetadata.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.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.requestedCancellation); - return writer; - }; - - /** - * Encodes the specified OmnichannelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OmnichannelOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata - * @static - * @param {google.cloud.ces.v1.IOmnichannelOperationMetadata} message OmnichannelOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OmnichannelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.OmnichannelOperationMetadata} OmnichannelOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OmnichannelOperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OmnichannelOperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - 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.statusMessage = reader.string(); - break; - } - case 4: { - message.requestedCancellation = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.OmnichannelOperationMetadata} OmnichannelOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OmnichannelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OmnichannelOperationMetadata message. - * @function verify - * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OmnichannelOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - 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.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"; - return null; - }; - - /** - * Creates an OmnichannelOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.OmnichannelOperationMetadata} OmnichannelOperationMetadata - */ - OmnichannelOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.OmnichannelOperationMetadata) - return object; - var message = new $root.google.cloud.ces.v1.OmnichannelOperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1.OmnichannelOperationMetadata.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.ces.v1.OmnichannelOperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - return message; - }; - - /** - * Creates a plain object from an OmnichannelOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata - * @static - * @param {google.cloud.ces.v1.OmnichannelOperationMetadata} message OmnichannelOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OmnichannelOperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.statusMessage = ""; - object.requestedCancellation = false; - } - 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.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - return object; - }; - - /** - * Converts this OmnichannelOperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata - * @instance - * @returns {Object.} JSON object - */ - OmnichannelOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OmnichannelOperationMetadata - * @function getTypeUrl - * @memberof google.cloud.ces.v1.OmnichannelOperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OmnichannelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.OmnichannelOperationMetadata"; - }; - - return OmnichannelOperationMetadata; - })(); - - v1.GoogleSearchSuggestions = (function() { - - /** - * Properties of a GoogleSearchSuggestions. - * @memberof google.cloud.ces.v1 - * @interface IGoogleSearchSuggestions - * @property {Array.|null} [htmls] GoogleSearchSuggestions htmls - * @property {Array.|null} [webSearchQueries] GoogleSearchSuggestions webSearchQueries - */ - - /** - * Constructs a new GoogleSearchSuggestions. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a GoogleSearchSuggestions. - * @implements IGoogleSearchSuggestions - * @constructor - * @param {google.cloud.ces.v1.IGoogleSearchSuggestions=} [properties] Properties to set - */ - function GoogleSearchSuggestions(properties) { - this.htmls = []; - this.webSearchQueries = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoogleSearchSuggestions htmls. - * @member {Array.} htmls - * @memberof google.cloud.ces.v1.GoogleSearchSuggestions - * @instance - */ - GoogleSearchSuggestions.prototype.htmls = $util.emptyArray; - - /** - * GoogleSearchSuggestions webSearchQueries. - * @member {Array.} webSearchQueries - * @memberof google.cloud.ces.v1.GoogleSearchSuggestions - * @instance - */ - GoogleSearchSuggestions.prototype.webSearchQueries = $util.emptyArray; - - /** - * Creates a new GoogleSearchSuggestions instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.GoogleSearchSuggestions - * @static - * @param {google.cloud.ces.v1.IGoogleSearchSuggestions=} [properties] Properties to set - * @returns {google.cloud.ces.v1.GoogleSearchSuggestions} GoogleSearchSuggestions instance - */ - GoogleSearchSuggestions.create = function create(properties) { - return new GoogleSearchSuggestions(properties); - }; - - /** - * Encodes the specified GoogleSearchSuggestions message. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchSuggestions.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.GoogleSearchSuggestions - * @static - * @param {google.cloud.ces.v1.IGoogleSearchSuggestions} message GoogleSearchSuggestions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoogleSearchSuggestions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.htmls != null && message.htmls.length) - for (var i = 0; i < message.htmls.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.htmls[i]); - if (message.webSearchQueries != null && message.webSearchQueries.length) - for (var i = 0; i < message.webSearchQueries.length; ++i) - $root.google.cloud.ces.v1.WebSearchQuery.encode(message.webSearchQueries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoogleSearchSuggestions message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GoogleSearchSuggestions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.GoogleSearchSuggestions - * @static - * @param {google.cloud.ces.v1.IGoogleSearchSuggestions} message GoogleSearchSuggestions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoogleSearchSuggestions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoogleSearchSuggestions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.GoogleSearchSuggestions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.GoogleSearchSuggestions} GoogleSearchSuggestions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoogleSearchSuggestions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GoogleSearchSuggestions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.htmls && message.htmls.length)) - message.htmls = []; - message.htmls.push(reader.string()); - break; - } - case 2: { - if (!(message.webSearchQueries && message.webSearchQueries.length)) - message.webSearchQueries = []; - message.webSearchQueries.push($root.google.cloud.ces.v1.WebSearchQuery.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoogleSearchSuggestions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.GoogleSearchSuggestions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.GoogleSearchSuggestions} GoogleSearchSuggestions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoogleSearchSuggestions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoogleSearchSuggestions message. - * @function verify - * @memberof google.cloud.ces.v1.GoogleSearchSuggestions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoogleSearchSuggestions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.htmls != null && message.hasOwnProperty("htmls")) { - if (!Array.isArray(message.htmls)) - return "htmls: array expected"; - for (var i = 0; i < message.htmls.length; ++i) - if (!$util.isString(message.htmls[i])) - return "htmls: string[] expected"; - } - if (message.webSearchQueries != null && message.hasOwnProperty("webSearchQueries")) { - if (!Array.isArray(message.webSearchQueries)) - return "webSearchQueries: array expected"; - for (var i = 0; i < message.webSearchQueries.length; ++i) { - var error = $root.google.cloud.ces.v1.WebSearchQuery.verify(message.webSearchQueries[i]); - if (error) - return "webSearchQueries." + error; - } - } - return null; - }; - - /** - * Creates a GoogleSearchSuggestions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.GoogleSearchSuggestions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.GoogleSearchSuggestions} GoogleSearchSuggestions - */ - GoogleSearchSuggestions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.GoogleSearchSuggestions) - return object; - var message = new $root.google.cloud.ces.v1.GoogleSearchSuggestions(); - if (object.htmls) { - if (!Array.isArray(object.htmls)) - throw TypeError(".google.cloud.ces.v1.GoogleSearchSuggestions.htmls: array expected"); - message.htmls = []; - for (var i = 0; i < object.htmls.length; ++i) - message.htmls[i] = String(object.htmls[i]); - } - if (object.webSearchQueries) { - if (!Array.isArray(object.webSearchQueries)) - throw TypeError(".google.cloud.ces.v1.GoogleSearchSuggestions.webSearchQueries: array expected"); - message.webSearchQueries = []; - for (var i = 0; i < object.webSearchQueries.length; ++i) { - if (typeof object.webSearchQueries[i] !== "object") - throw TypeError(".google.cloud.ces.v1.GoogleSearchSuggestions.webSearchQueries: object expected"); - message.webSearchQueries[i] = $root.google.cloud.ces.v1.WebSearchQuery.fromObject(object.webSearchQueries[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GoogleSearchSuggestions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.GoogleSearchSuggestions - * @static - * @param {google.cloud.ces.v1.GoogleSearchSuggestions} message GoogleSearchSuggestions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoogleSearchSuggestions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.htmls = []; - object.webSearchQueries = []; - } - if (message.htmls && message.htmls.length) { - object.htmls = []; - for (var j = 0; j < message.htmls.length; ++j) - object.htmls[j] = message.htmls[j]; - } - if (message.webSearchQueries && message.webSearchQueries.length) { - object.webSearchQueries = []; - for (var j = 0; j < message.webSearchQueries.length; ++j) - object.webSearchQueries[j] = $root.google.cloud.ces.v1.WebSearchQuery.toObject(message.webSearchQueries[j], options); - } - return object; - }; - - /** - * Converts this GoogleSearchSuggestions to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.GoogleSearchSuggestions - * @instance - * @returns {Object.} JSON object - */ - GoogleSearchSuggestions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoogleSearchSuggestions - * @function getTypeUrl - * @memberof google.cloud.ces.v1.GoogleSearchSuggestions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoogleSearchSuggestions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.GoogleSearchSuggestions"; - }; - - return GoogleSearchSuggestions; - })(); - - v1.WebSearchQuery = (function() { - - /** - * Properties of a WebSearchQuery. - * @memberof google.cloud.ces.v1 - * @interface IWebSearchQuery - * @property {string|null} [query] WebSearchQuery query - * @property {string|null} [uri] WebSearchQuery uri - */ - - /** - * Constructs a new WebSearchQuery. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a WebSearchQuery. - * @implements IWebSearchQuery - * @constructor - * @param {google.cloud.ces.v1.IWebSearchQuery=} [properties] Properties to set - */ - function WebSearchQuery(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WebSearchQuery query. - * @member {string} query - * @memberof google.cloud.ces.v1.WebSearchQuery - * @instance - */ - WebSearchQuery.prototype.query = ""; - - /** - * WebSearchQuery uri. - * @member {string} uri - * @memberof google.cloud.ces.v1.WebSearchQuery - * @instance - */ - WebSearchQuery.prototype.uri = ""; - - /** - * Creates a new WebSearchQuery instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.WebSearchQuery - * @static - * @param {google.cloud.ces.v1.IWebSearchQuery=} [properties] Properties to set - * @returns {google.cloud.ces.v1.WebSearchQuery} WebSearchQuery instance - */ - WebSearchQuery.create = function create(properties) { - return new WebSearchQuery(properties); - }; - - /** - * Encodes the specified WebSearchQuery message. Does not implicitly {@link google.cloud.ces.v1.WebSearchQuery.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.WebSearchQuery - * @static - * @param {google.cloud.ces.v1.IWebSearchQuery} message WebSearchQuery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebSearchQuery.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); - return writer; - }; - - /** - * Encodes the specified WebSearchQuery message, length delimited. Does not implicitly {@link google.cloud.ces.v1.WebSearchQuery.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.WebSearchQuery - * @static - * @param {google.cloud.ces.v1.IWebSearchQuery} message WebSearchQuery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebSearchQuery.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WebSearchQuery message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.WebSearchQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.WebSearchQuery} WebSearchQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebSearchQuery.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.WebSearchQuery(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.query = reader.string(); - break; - } - case 2: { - message.uri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WebSearchQuery message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.WebSearchQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.WebSearchQuery} WebSearchQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebSearchQuery.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WebSearchQuery message. - * @function verify - * @memberof google.cloud.ces.v1.WebSearchQuery - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WebSearchQuery.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: string expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - return null; - }; - - /** - * Creates a WebSearchQuery message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.WebSearchQuery - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.WebSearchQuery} WebSearchQuery - */ - WebSearchQuery.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.WebSearchQuery) - return object; - var message = new $root.google.cloud.ces.v1.WebSearchQuery(); - if (object.query != null) - message.query = String(object.query); - if (object.uri != null) - message.uri = String(object.uri); - return message; - }; - - /** - * Creates a plain object from a WebSearchQuery message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.WebSearchQuery - * @static - * @param {google.cloud.ces.v1.WebSearchQuery} message WebSearchQuery - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WebSearchQuery.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.query = ""; - object.uri = ""; - } - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - return object; - }; - - /** - * Converts this WebSearchQuery to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.WebSearchQuery - * @instance - * @returns {Object.} JSON object - */ - WebSearchQuery.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WebSearchQuery - * @function getTypeUrl - * @memberof google.cloud.ces.v1.WebSearchQuery - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WebSearchQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.WebSearchQuery"; - }; - - return WebSearchQuery; - })(); - - v1.SessionService = (function() { - - /** - * Constructs a new SessionService service. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a SessionService - * @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 SessionService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (SessionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SessionService; - - /** - * Creates new SessionService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.ces.v1.SessionService - * @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 {SessionService} RPC service. Useful where requests and/or responses are streamed. - */ - SessionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.ces.v1.SessionService|runSession}. - * @memberof google.cloud.ces.v1.SessionService - * @typedef RunSessionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.RunSessionResponse} [response] RunSessionResponse - */ - - /** - * Calls RunSession. - * @function runSession - * @memberof google.cloud.ces.v1.SessionService - * @instance - * @param {google.cloud.ces.v1.IRunSessionRequest} request RunSessionRequest message or plain object - * @param {google.cloud.ces.v1.SessionService.RunSessionCallback} callback Node-style callback called with the error, if any, and RunSessionResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionService.prototype.runSession = function runSession(request, callback) { - return this.rpcCall(runSession, $root.google.cloud.ces.v1.RunSessionRequest, $root.google.cloud.ces.v1.RunSessionResponse, request, callback); - }, "name", { value: "RunSession" }); - - /** - * Calls RunSession. - * @function runSession - * @memberof google.cloud.ces.v1.SessionService - * @instance - * @param {google.cloud.ces.v1.IRunSessionRequest} request RunSessionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.SessionService|bidiRunSession}. - * @memberof google.cloud.ces.v1.SessionService - * @typedef BidiRunSessionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.BidiSessionServerMessage} [response] BidiSessionServerMessage - */ - - /** - * Calls BidiRunSession. - * @function bidiRunSession - * @memberof google.cloud.ces.v1.SessionService - * @instance - * @param {google.cloud.ces.v1.IBidiSessionClientMessage} request BidiSessionClientMessage message or plain object - * @param {google.cloud.ces.v1.SessionService.BidiRunSessionCallback} callback Node-style callback called with the error, if any, and BidiSessionServerMessage - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionService.prototype.bidiRunSession = function bidiRunSession(request, callback) { - return this.rpcCall(bidiRunSession, $root.google.cloud.ces.v1.BidiSessionClientMessage, $root.google.cloud.ces.v1.BidiSessionServerMessage, request, callback); - }, "name", { value: "BidiRunSession" }); - - /** - * Calls BidiRunSession. - * @function bidiRunSession - * @memberof google.cloud.ces.v1.SessionService - * @instance - * @param {google.cloud.ces.v1.IBidiSessionClientMessage} request BidiSessionClientMessage message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return SessionService; - })(); - - /** - * AudioEncoding enum. - * @name google.cloud.ces.v1.AudioEncoding - * @enum {number} - * @property {number} AUDIO_ENCODING_UNSPECIFIED=0 AUDIO_ENCODING_UNSPECIFIED value - * @property {number} LINEAR16=1 LINEAR16 value - * @property {number} MULAW=2 MULAW value - * @property {number} ALAW=3 ALAW value - */ - v1.AudioEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AUDIO_ENCODING_UNSPECIFIED"] = 0; - values[valuesById[1] = "LINEAR16"] = 1; - values[valuesById[2] = "MULAW"] = 2; - values[valuesById[3] = "ALAW"] = 3; - return values; - })(); - - v1.InputAudioConfig = (function() { - - /** - * Properties of an InputAudioConfig. - * @memberof google.cloud.ces.v1 - * @interface IInputAudioConfig - * @property {google.cloud.ces.v1.AudioEncoding|null} [audioEncoding] InputAudioConfig audioEncoding - * @property {number|null} [sampleRateHertz] InputAudioConfig sampleRateHertz - * @property {string|null} [noiseSuppressionLevel] InputAudioConfig noiseSuppressionLevel - */ - - /** - * Constructs a new InputAudioConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an InputAudioConfig. - * @implements IInputAudioConfig - * @constructor - * @param {google.cloud.ces.v1.IInputAudioConfig=} [properties] Properties to set - */ - function InputAudioConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InputAudioConfig audioEncoding. - * @member {google.cloud.ces.v1.AudioEncoding} audioEncoding - * @memberof google.cloud.ces.v1.InputAudioConfig - * @instance - */ - InputAudioConfig.prototype.audioEncoding = 0; - - /** - * InputAudioConfig sampleRateHertz. - * @member {number} sampleRateHertz - * @memberof google.cloud.ces.v1.InputAudioConfig - * @instance - */ - InputAudioConfig.prototype.sampleRateHertz = 0; - - /** - * InputAudioConfig noiseSuppressionLevel. - * @member {string} noiseSuppressionLevel - * @memberof google.cloud.ces.v1.InputAudioConfig - * @instance - */ - InputAudioConfig.prototype.noiseSuppressionLevel = ""; - - /** - * Creates a new InputAudioConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.InputAudioConfig - * @static - * @param {google.cloud.ces.v1.IInputAudioConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.InputAudioConfig} InputAudioConfig instance - */ - InputAudioConfig.create = function create(properties) { - return new InputAudioConfig(properties); - }; - - /** - * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1.InputAudioConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.InputAudioConfig - * @static - * @param {google.cloud.ces.v1.IInputAudioConfig} message InputAudioConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InputAudioConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); - if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); - if (message.noiseSuppressionLevel != null && Object.hasOwnProperty.call(message, "noiseSuppressionLevel")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.noiseSuppressionLevel); - return writer; - }; - - /** - * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.InputAudioConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.InputAudioConfig - * @static - * @param {google.cloud.ces.v1.IInputAudioConfig} message InputAudioConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InputAudioConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.InputAudioConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.InputAudioConfig} InputAudioConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InputAudioConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.InputAudioConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.audioEncoding = reader.int32(); - break; - } - case 2: { - message.sampleRateHertz = reader.int32(); - break; - } - case 6: { - message.noiseSuppressionLevel = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.InputAudioConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.InputAudioConfig} InputAudioConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InputAudioConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InputAudioConfig message. - * @function verify - * @memberof google.cloud.ces.v1.InputAudioConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InputAudioConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) - switch (message.audioEncoding) { - default: - return "audioEncoding: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) - if (!$util.isInteger(message.sampleRateHertz)) - return "sampleRateHertz: integer expected"; - if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) - if (!$util.isString(message.noiseSuppressionLevel)) - return "noiseSuppressionLevel: string expected"; - return null; - }; - - /** - * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.InputAudioConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.InputAudioConfig} InputAudioConfig - */ - InputAudioConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.InputAudioConfig) - return object; - var message = new $root.google.cloud.ces.v1.InputAudioConfig(); - switch (object.audioEncoding) { - default: - if (typeof object.audioEncoding === "number") { - message.audioEncoding = object.audioEncoding; - break; - } - break; - case "AUDIO_ENCODING_UNSPECIFIED": - case 0: - message.audioEncoding = 0; - break; - case "LINEAR16": - case 1: - message.audioEncoding = 1; - break; - case "MULAW": - case 2: - message.audioEncoding = 2; - break; - case "ALAW": - case 3: - message.audioEncoding = 3; - break; - } - if (object.sampleRateHertz != null) - message.sampleRateHertz = object.sampleRateHertz | 0; - if (object.noiseSuppressionLevel != null) - message.noiseSuppressionLevel = String(object.noiseSuppressionLevel); - return message; - }; - - /** - * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.InputAudioConfig - * @static - * @param {google.cloud.ces.v1.InputAudioConfig} message InputAudioConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InputAudioConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.audioEncoding = options.enums === String ? "AUDIO_ENCODING_UNSPECIFIED" : 0; - object.sampleRateHertz = 0; - object.noiseSuppressionLevel = ""; - } - if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) - object.audioEncoding = options.enums === String ? $root.google.cloud.ces.v1.AudioEncoding[message.audioEncoding] === undefined ? message.audioEncoding : $root.google.cloud.ces.v1.AudioEncoding[message.audioEncoding] : message.audioEncoding; - if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) - object.sampleRateHertz = message.sampleRateHertz; - if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) - object.noiseSuppressionLevel = message.noiseSuppressionLevel; - return object; - }; - - /** - * Converts this InputAudioConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.InputAudioConfig - * @instance - * @returns {Object.} JSON object - */ - InputAudioConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InputAudioConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.InputAudioConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InputAudioConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.InputAudioConfig"; - }; - - return InputAudioConfig; - })(); - - v1.OutputAudioConfig = (function() { - - /** - * Properties of an OutputAudioConfig. - * @memberof google.cloud.ces.v1 - * @interface IOutputAudioConfig - * @property {google.cloud.ces.v1.AudioEncoding|null} [audioEncoding] OutputAudioConfig audioEncoding - * @property {number|null} [sampleRateHertz] OutputAudioConfig sampleRateHertz - */ - - /** - * Constructs a new OutputAudioConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an OutputAudioConfig. - * @implements IOutputAudioConfig - * @constructor - * @param {google.cloud.ces.v1.IOutputAudioConfig=} [properties] Properties to set - */ - function OutputAudioConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OutputAudioConfig audioEncoding. - * @member {google.cloud.ces.v1.AudioEncoding} audioEncoding - * @memberof google.cloud.ces.v1.OutputAudioConfig - * @instance - */ - OutputAudioConfig.prototype.audioEncoding = 0; - - /** - * OutputAudioConfig sampleRateHertz. - * @member {number} sampleRateHertz - * @memberof google.cloud.ces.v1.OutputAudioConfig - * @instance - */ - OutputAudioConfig.prototype.sampleRateHertz = 0; - - /** - * Creates a new OutputAudioConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.OutputAudioConfig - * @static - * @param {google.cloud.ces.v1.IOutputAudioConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.OutputAudioConfig} OutputAudioConfig instance - */ - OutputAudioConfig.create = function create(properties) { - return new OutputAudioConfig(properties); - }; - - /** - * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1.OutputAudioConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.OutputAudioConfig - * @static - * @param {google.cloud.ces.v1.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OutputAudioConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); - if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); - return writer; - }; - - /** - * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.OutputAudioConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.OutputAudioConfig - * @static - * @param {google.cloud.ces.v1.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OutputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OutputAudioConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.OutputAudioConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.OutputAudioConfig} OutputAudioConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OutputAudioConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.OutputAudioConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.audioEncoding = reader.int32(); - break; - } - case 2: { - message.sampleRateHertz = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.OutputAudioConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.OutputAudioConfig} OutputAudioConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OutputAudioConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OutputAudioConfig message. - * @function verify - * @memberof google.cloud.ces.v1.OutputAudioConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OutputAudioConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) - switch (message.audioEncoding) { - default: - return "audioEncoding: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) - if (!$util.isInteger(message.sampleRateHertz)) - return "sampleRateHertz: integer expected"; - return null; - }; - - /** - * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.OutputAudioConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.OutputAudioConfig} OutputAudioConfig - */ - OutputAudioConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.OutputAudioConfig) - return object; - var message = new $root.google.cloud.ces.v1.OutputAudioConfig(); - switch (object.audioEncoding) { - default: - if (typeof object.audioEncoding === "number") { - message.audioEncoding = object.audioEncoding; - break; - } - break; - case "AUDIO_ENCODING_UNSPECIFIED": - case 0: - message.audioEncoding = 0; - break; - case "LINEAR16": - case 1: - message.audioEncoding = 1; - break; - case "MULAW": - case 2: - message.audioEncoding = 2; - break; - case "ALAW": - case 3: - message.audioEncoding = 3; - break; - } - if (object.sampleRateHertz != null) - message.sampleRateHertz = object.sampleRateHertz | 0; - return message; - }; - - /** - * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.OutputAudioConfig - * @static - * @param {google.cloud.ces.v1.OutputAudioConfig} message OutputAudioConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OutputAudioConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.audioEncoding = options.enums === String ? "AUDIO_ENCODING_UNSPECIFIED" : 0; - object.sampleRateHertz = 0; - } - if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) - object.audioEncoding = options.enums === String ? $root.google.cloud.ces.v1.AudioEncoding[message.audioEncoding] === undefined ? message.audioEncoding : $root.google.cloud.ces.v1.AudioEncoding[message.audioEncoding] : message.audioEncoding; - if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) - object.sampleRateHertz = message.sampleRateHertz; - return object; - }; - - /** - * Converts this OutputAudioConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.OutputAudioConfig - * @instance - * @returns {Object.} JSON object - */ - OutputAudioConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OutputAudioConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.OutputAudioConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OutputAudioConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.OutputAudioConfig"; - }; - - return OutputAudioConfig; - })(); - - v1.SessionConfig = (function() { - - /** - * Properties of a SessionConfig. - * @memberof google.cloud.ces.v1 - * @interface ISessionConfig - * @property {string|null} [session] SessionConfig session - * @property {google.cloud.ces.v1.IInputAudioConfig|null} [inputAudioConfig] SessionConfig inputAudioConfig - * @property {google.cloud.ces.v1.IOutputAudioConfig|null} [outputAudioConfig] SessionConfig outputAudioConfig - * @property {Array.|null} [historicalContexts] SessionConfig historicalContexts - * @property {string|null} [entryAgent] SessionConfig entryAgent - * @property {string|null} [deployment] SessionConfig deployment - * @property {string|null} [timeZone] SessionConfig timeZone - * @property {google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters|null} [remoteDialogflowQueryParameters] SessionConfig remoteDialogflowQueryParameters - */ - - /** - * Constructs a new SessionConfig. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a SessionConfig. - * @implements ISessionConfig - * @constructor - * @param {google.cloud.ces.v1.ISessionConfig=} [properties] Properties to set - */ - function SessionConfig(properties) { - this.historicalContexts = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SessionConfig session. - * @member {string} session - * @memberof google.cloud.ces.v1.SessionConfig - * @instance - */ - SessionConfig.prototype.session = ""; - - /** - * SessionConfig inputAudioConfig. - * @member {google.cloud.ces.v1.IInputAudioConfig|null|undefined} inputAudioConfig - * @memberof google.cloud.ces.v1.SessionConfig - * @instance - */ - SessionConfig.prototype.inputAudioConfig = null; - - /** - * SessionConfig outputAudioConfig. - * @member {google.cloud.ces.v1.IOutputAudioConfig|null|undefined} outputAudioConfig - * @memberof google.cloud.ces.v1.SessionConfig - * @instance - */ - SessionConfig.prototype.outputAudioConfig = null; - - /** - * SessionConfig historicalContexts. - * @member {Array.} historicalContexts - * @memberof google.cloud.ces.v1.SessionConfig - * @instance - */ - SessionConfig.prototype.historicalContexts = $util.emptyArray; - - /** - * SessionConfig entryAgent. - * @member {string} entryAgent - * @memberof google.cloud.ces.v1.SessionConfig - * @instance - */ - SessionConfig.prototype.entryAgent = ""; - - /** - * SessionConfig deployment. - * @member {string} deployment - * @memberof google.cloud.ces.v1.SessionConfig - * @instance - */ - SessionConfig.prototype.deployment = ""; - - /** - * SessionConfig timeZone. - * @member {string} timeZone - * @memberof google.cloud.ces.v1.SessionConfig - * @instance - */ - SessionConfig.prototype.timeZone = ""; - - /** - * SessionConfig remoteDialogflowQueryParameters. - * @member {google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters|null|undefined} remoteDialogflowQueryParameters - * @memberof google.cloud.ces.v1.SessionConfig - * @instance - */ - SessionConfig.prototype.remoteDialogflowQueryParameters = null; - - /** - * Creates a new SessionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.SessionConfig - * @static - * @param {google.cloud.ces.v1.ISessionConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1.SessionConfig} SessionConfig instance - */ - SessionConfig.create = function create(properties) { - return new SessionConfig(properties); - }; - - /** - * Encodes the specified SessionConfig message. Does not implicitly {@link google.cloud.ces.v1.SessionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.SessionConfig - * @static - * @param {google.cloud.ces.v1.ISessionConfig} message SessionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.inputAudioConfig != null && Object.hasOwnProperty.call(message, "inputAudioConfig")) - $root.google.cloud.ces.v1.InputAudioConfig.encode(message.inputAudioConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) - $root.google.cloud.ces.v1.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.historicalContexts != null && message.historicalContexts.length) - for (var i = 0; i < message.historicalContexts.length; ++i) - $root.google.cloud.ces.v1.Message.encode(message.historicalContexts[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.deployment); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.timeZone); - if (message.entryAgent != null && Object.hasOwnProperty.call(message, "entryAgent")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.entryAgent); - if (message.remoteDialogflowQueryParameters != null && Object.hasOwnProperty.call(message, "remoteDialogflowQueryParameters")) - $root.google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.encode(message.remoteDialogflowQueryParameters, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SessionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.SessionConfig - * @static - * @param {google.cloud.ces.v1.ISessionConfig} message SessionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SessionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.SessionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.SessionConfig} SessionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.SessionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.inputAudioConfig = $root.google.cloud.ces.v1.InputAudioConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.outputAudioConfig = $root.google.cloud.ces.v1.OutputAudioConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - if (!(message.historicalContexts && message.historicalContexts.length)) - message.historicalContexts = []; - message.historicalContexts.push($root.google.cloud.ces.v1.Message.decode(reader, reader.uint32())); - break; - } - case 12: { - message.entryAgent = reader.string(); - break; - } - case 8: { - message.deployment = reader.string(); - break; - } - case 11: { - message.timeZone = reader.string(); - break; - } - case 15: { - message.remoteDialogflowQueryParameters = $root.google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SessionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.SessionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.SessionConfig} SessionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SessionConfig message. - * @function verify - * @memberof google.cloud.ces.v1.SessionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SessionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.inputAudioConfig != null && message.hasOwnProperty("inputAudioConfig")) { - var error = $root.google.cloud.ces.v1.InputAudioConfig.verify(message.inputAudioConfig); - if (error) - return "inputAudioConfig." + error; - } - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { - var error = $root.google.cloud.ces.v1.OutputAudioConfig.verify(message.outputAudioConfig); - if (error) - return "outputAudioConfig." + error; - } - if (message.historicalContexts != null && message.hasOwnProperty("historicalContexts")) { - if (!Array.isArray(message.historicalContexts)) - return "historicalContexts: array expected"; - for (var i = 0; i < message.historicalContexts.length; ++i) { - var error = $root.google.cloud.ces.v1.Message.verify(message.historicalContexts[i]); - if (error) - return "historicalContexts." + error; - } - } - if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) - if (!$util.isString(message.entryAgent)) - return "entryAgent: string expected"; - if (message.deployment != null && message.hasOwnProperty("deployment")) - if (!$util.isString(message.deployment)) - return "deployment: string expected"; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - if (!$util.isString(message.timeZone)) - return "timeZone: string expected"; - if (message.remoteDialogflowQueryParameters != null && message.hasOwnProperty("remoteDialogflowQueryParameters")) { - var error = $root.google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.verify(message.remoteDialogflowQueryParameters); - if (error) - return "remoteDialogflowQueryParameters." + error; - } - return null; - }; - - /** - * Creates a SessionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.SessionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.SessionConfig} SessionConfig - */ - SessionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.SessionConfig) - return object; - var message = new $root.google.cloud.ces.v1.SessionConfig(); - if (object.session != null) - message.session = String(object.session); - if (object.inputAudioConfig != null) { - if (typeof object.inputAudioConfig !== "object") - throw TypeError(".google.cloud.ces.v1.SessionConfig.inputAudioConfig: object expected"); - message.inputAudioConfig = $root.google.cloud.ces.v1.InputAudioConfig.fromObject(object.inputAudioConfig); - } - if (object.outputAudioConfig != null) { - if (typeof object.outputAudioConfig !== "object") - throw TypeError(".google.cloud.ces.v1.SessionConfig.outputAudioConfig: object expected"); - message.outputAudioConfig = $root.google.cloud.ces.v1.OutputAudioConfig.fromObject(object.outputAudioConfig); - } - if (object.historicalContexts) { - if (!Array.isArray(object.historicalContexts)) - throw TypeError(".google.cloud.ces.v1.SessionConfig.historicalContexts: array expected"); - message.historicalContexts = []; - for (var i = 0; i < object.historicalContexts.length; ++i) { - if (typeof object.historicalContexts[i] !== "object") - throw TypeError(".google.cloud.ces.v1.SessionConfig.historicalContexts: object expected"); - message.historicalContexts[i] = $root.google.cloud.ces.v1.Message.fromObject(object.historicalContexts[i]); - } - } - if (object.entryAgent != null) - message.entryAgent = String(object.entryAgent); - if (object.deployment != null) - message.deployment = String(object.deployment); - if (object.timeZone != null) - message.timeZone = String(object.timeZone); - if (object.remoteDialogflowQueryParameters != null) { - if (typeof object.remoteDialogflowQueryParameters !== "object") - throw TypeError(".google.cloud.ces.v1.SessionConfig.remoteDialogflowQueryParameters: object expected"); - message.remoteDialogflowQueryParameters = $root.google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.fromObject(object.remoteDialogflowQueryParameters); - } - return message; - }; - - /** - * Creates a plain object from a SessionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.SessionConfig - * @static - * @param {google.cloud.ces.v1.SessionConfig} message SessionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SessionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.historicalContexts = []; - if (options.defaults) { - object.session = ""; - object.inputAudioConfig = null; - object.outputAudioConfig = null; - object.deployment = ""; - object.timeZone = ""; - object.entryAgent = ""; - object.remoteDialogflowQueryParameters = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.inputAudioConfig != null && message.hasOwnProperty("inputAudioConfig")) - object.inputAudioConfig = $root.google.cloud.ces.v1.InputAudioConfig.toObject(message.inputAudioConfig, options); - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) - object.outputAudioConfig = $root.google.cloud.ces.v1.OutputAudioConfig.toObject(message.outputAudioConfig, options); - if (message.historicalContexts && message.historicalContexts.length) { - object.historicalContexts = []; - for (var j = 0; j < message.historicalContexts.length; ++j) - object.historicalContexts[j] = $root.google.cloud.ces.v1.Message.toObject(message.historicalContexts[j], options); - } - if (message.deployment != null && message.hasOwnProperty("deployment")) - object.deployment = message.deployment; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - object.timeZone = message.timeZone; - if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) - object.entryAgent = message.entryAgent; - if (message.remoteDialogflowQueryParameters != null && message.hasOwnProperty("remoteDialogflowQueryParameters")) - object.remoteDialogflowQueryParameters = $root.google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.toObject(message.remoteDialogflowQueryParameters, options); - return object; - }; - - /** - * Converts this SessionConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.SessionConfig - * @instance - * @returns {Object.} JSON object - */ - SessionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SessionConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1.SessionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SessionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.SessionConfig"; - }; - - SessionConfig.RemoteDialogflowQueryParameters = (function() { - - /** - * Properties of a RemoteDialogflowQueryParameters. - * @memberof google.cloud.ces.v1.SessionConfig - * @interface IRemoteDialogflowQueryParameters - * @property {Object.|null} [webhookHeaders] RemoteDialogflowQueryParameters webhookHeaders - * @property {google.protobuf.IStruct|null} [payload] RemoteDialogflowQueryParameters payload - * @property {google.protobuf.IStruct|null} [endUserMetadata] RemoteDialogflowQueryParameters endUserMetadata - */ - - /** - * Constructs a new RemoteDialogflowQueryParameters. - * @memberof google.cloud.ces.v1.SessionConfig - * @classdesc Represents a RemoteDialogflowQueryParameters. - * @implements IRemoteDialogflowQueryParameters - * @constructor - * @param {google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters=} [properties] Properties to set - */ - function RemoteDialogflowQueryParameters(properties) { - this.webhookHeaders = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RemoteDialogflowQueryParameters webhookHeaders. - * @member {Object.} webhookHeaders - * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters - * @instance - */ - RemoteDialogflowQueryParameters.prototype.webhookHeaders = $util.emptyObject; - - /** - * RemoteDialogflowQueryParameters payload. - * @member {google.protobuf.IStruct|null|undefined} payload - * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters - * @instance - */ - RemoteDialogflowQueryParameters.prototype.payload = null; - - /** - * RemoteDialogflowQueryParameters endUserMetadata. - * @member {google.protobuf.IStruct|null|undefined} endUserMetadata - * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters - * @instance - */ - RemoteDialogflowQueryParameters.prototype.endUserMetadata = null; - - /** - * Creates a new RemoteDialogflowQueryParameters instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters - * @static - * @param {google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters=} [properties] Properties to set - * @returns {google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters instance - */ - RemoteDialogflowQueryParameters.create = function create(properties) { - return new RemoteDialogflowQueryParameters(properties); - }; - - /** - * Encodes the specified RemoteDialogflowQueryParameters message. Does not implicitly {@link google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters - * @static - * @param {google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters} message RemoteDialogflowQueryParameters message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RemoteDialogflowQueryParameters.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.webhookHeaders != null && Object.hasOwnProperty.call(message, "webhookHeaders")) - for (var keys = Object.keys(message.webhookHeaders), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.webhookHeaders[keys[i]]).ldelim(); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endUserMetadata != null && Object.hasOwnProperty.call(message, "endUserMetadata")) - $root.google.protobuf.Struct.encode(message.endUserMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RemoteDialogflowQueryParameters message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters - * @static - * @param {google.cloud.ces.v1.SessionConfig.IRemoteDialogflowQueryParameters} message RemoteDialogflowQueryParameters message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RemoteDialogflowQueryParameters.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RemoteDialogflowQueryParameters.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.webhookHeaders === $util.emptyObject) - message.webhookHeaders = {}; - 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.webhookHeaders[key] = value; - break; - } - case 2: { - message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 3: { - message.endUserMetadata = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RemoteDialogflowQueryParameters.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RemoteDialogflowQueryParameters message. - * @function verify - * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RemoteDialogflowQueryParameters.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.webhookHeaders != null && message.hasOwnProperty("webhookHeaders")) { - if (!$util.isObject(message.webhookHeaders)) - return "webhookHeaders: object expected"; - var key = Object.keys(message.webhookHeaders); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.webhookHeaders[key[i]])) - return "webhookHeaders: string{k:string} expected"; - } - if (message.payload != null && message.hasOwnProperty("payload")) { - var error = $root.google.protobuf.Struct.verify(message.payload); - if (error) - return "payload." + error; - } - if (message.endUserMetadata != null && message.hasOwnProperty("endUserMetadata")) { - var error = $root.google.protobuf.Struct.verify(message.endUserMetadata); - if (error) - return "endUserMetadata." + error; - } - return null; - }; - - /** - * Creates a RemoteDialogflowQueryParameters message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters - */ - RemoteDialogflowQueryParameters.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters) - return object; - var message = new $root.google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters(); - if (object.webhookHeaders) { - if (typeof object.webhookHeaders !== "object") - throw TypeError(".google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.webhookHeaders: object expected"); - message.webhookHeaders = {}; - for (var keys = Object.keys(object.webhookHeaders), i = 0; i < keys.length; ++i) - message.webhookHeaders[keys[i]] = String(object.webhookHeaders[keys[i]]); - } - if (object.payload != null) { - if (typeof object.payload !== "object") - throw TypeError(".google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.payload: object expected"); - message.payload = $root.google.protobuf.Struct.fromObject(object.payload); - } - if (object.endUserMetadata != null) { - if (typeof object.endUserMetadata !== "object") - throw TypeError(".google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters.endUserMetadata: object expected"); - message.endUserMetadata = $root.google.protobuf.Struct.fromObject(object.endUserMetadata); - } - return message; - }; - - /** - * Creates a plain object from a RemoteDialogflowQueryParameters message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters - * @static - * @param {google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters} message RemoteDialogflowQueryParameters - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RemoteDialogflowQueryParameters.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.webhookHeaders = {}; - if (options.defaults) { - object.payload = null; - object.endUserMetadata = null; - } - var keys2; - if (message.webhookHeaders && (keys2 = Object.keys(message.webhookHeaders)).length) { - object.webhookHeaders = {}; - for (var j = 0; j < keys2.length; ++j) - object.webhookHeaders[keys2[j]] = message.webhookHeaders[keys2[j]]; - } - if (message.payload != null && message.hasOwnProperty("payload")) - object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); - if (message.endUserMetadata != null && message.hasOwnProperty("endUserMetadata")) - object.endUserMetadata = $root.google.protobuf.Struct.toObject(message.endUserMetadata, options); - return object; - }; - - /** - * Converts this RemoteDialogflowQueryParameters to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters - * @instance - * @returns {Object.} JSON object - */ - RemoteDialogflowQueryParameters.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RemoteDialogflowQueryParameters - * @function getTypeUrl - * @memberof google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RemoteDialogflowQueryParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.SessionConfig.RemoteDialogflowQueryParameters"; - }; - - return RemoteDialogflowQueryParameters; - })(); - - return SessionConfig; - })(); - - v1.ToolCalls = (function() { - - /** - * Properties of a ToolCalls. - * @memberof google.cloud.ces.v1 - * @interface IToolCalls - * @property {Array.|null} [toolCalls] ToolCalls toolCalls - */ - - /** - * Constructs a new ToolCalls. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ToolCalls. - * @implements IToolCalls - * @constructor - * @param {google.cloud.ces.v1.IToolCalls=} [properties] Properties to set - */ - function ToolCalls(properties) { - this.toolCalls = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolCalls toolCalls. - * @member {Array.} toolCalls - * @memberof google.cloud.ces.v1.ToolCalls - * @instance - */ - ToolCalls.prototype.toolCalls = $util.emptyArray; - - /** - * Creates a new ToolCalls instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ToolCalls - * @static - * @param {google.cloud.ces.v1.IToolCalls=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ToolCalls} ToolCalls instance - */ - ToolCalls.create = function create(properties) { - return new ToolCalls(properties); - }; - - /** - * Encodes the specified ToolCalls message. Does not implicitly {@link google.cloud.ces.v1.ToolCalls.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ToolCalls - * @static - * @param {google.cloud.ces.v1.IToolCalls} message ToolCalls message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolCalls.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolCalls != null && message.toolCalls.length) - for (var i = 0; i < message.toolCalls.length; ++i) - $root.google.cloud.ces.v1.ToolCall.encode(message.toolCalls[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ToolCalls message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolCalls.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ToolCalls - * @static - * @param {google.cloud.ces.v1.IToolCalls} message ToolCalls message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolCalls.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolCalls message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ToolCalls - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ToolCalls} ToolCalls - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolCalls.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ToolCalls(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.toolCalls && message.toolCalls.length)) - message.toolCalls = []; - message.toolCalls.push($root.google.cloud.ces.v1.ToolCall.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolCalls message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ToolCalls - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ToolCalls} ToolCalls - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolCalls.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolCalls message. - * @function verify - * @memberof google.cloud.ces.v1.ToolCalls - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolCalls.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.toolCalls != null && message.hasOwnProperty("toolCalls")) { - if (!Array.isArray(message.toolCalls)) - return "toolCalls: array expected"; - for (var i = 0; i < message.toolCalls.length; ++i) { - var error = $root.google.cloud.ces.v1.ToolCall.verify(message.toolCalls[i]); - if (error) - return "toolCalls." + error; - } - } - return null; - }; - - /** - * Creates a ToolCalls message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ToolCalls - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ToolCalls} ToolCalls - */ - ToolCalls.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ToolCalls) - return object; - var message = new $root.google.cloud.ces.v1.ToolCalls(); - if (object.toolCalls) { - if (!Array.isArray(object.toolCalls)) - throw TypeError(".google.cloud.ces.v1.ToolCalls.toolCalls: array expected"); - message.toolCalls = []; - for (var i = 0; i < object.toolCalls.length; ++i) { - if (typeof object.toolCalls[i] !== "object") - throw TypeError(".google.cloud.ces.v1.ToolCalls.toolCalls: object expected"); - message.toolCalls[i] = $root.google.cloud.ces.v1.ToolCall.fromObject(object.toolCalls[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ToolCalls message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ToolCalls - * @static - * @param {google.cloud.ces.v1.ToolCalls} message ToolCalls - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolCalls.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.toolCalls = []; - if (message.toolCalls && message.toolCalls.length) { - object.toolCalls = []; - for (var j = 0; j < message.toolCalls.length; ++j) - object.toolCalls[j] = $root.google.cloud.ces.v1.ToolCall.toObject(message.toolCalls[j], options); - } - return object; - }; - - /** - * Converts this ToolCalls to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ToolCalls - * @instance - * @returns {Object.} JSON object - */ - ToolCalls.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolCalls - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ToolCalls - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolCalls.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ToolCalls"; - }; - - return ToolCalls; - })(); - - v1.ToolResponses = (function() { - - /** - * Properties of a ToolResponses. - * @memberof google.cloud.ces.v1 - * @interface IToolResponses - * @property {Array.|null} [toolResponses] ToolResponses toolResponses - */ - - /** - * Constructs a new ToolResponses. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ToolResponses. - * @implements IToolResponses - * @constructor - * @param {google.cloud.ces.v1.IToolResponses=} [properties] Properties to set - */ - function ToolResponses(properties) { - this.toolResponses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolResponses toolResponses. - * @member {Array.} toolResponses - * @memberof google.cloud.ces.v1.ToolResponses - * @instance - */ - ToolResponses.prototype.toolResponses = $util.emptyArray; - - /** - * Creates a new ToolResponses instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ToolResponses - * @static - * @param {google.cloud.ces.v1.IToolResponses=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ToolResponses} ToolResponses instance - */ - ToolResponses.create = function create(properties) { - return new ToolResponses(properties); - }; - - /** - * Encodes the specified ToolResponses message. Does not implicitly {@link google.cloud.ces.v1.ToolResponses.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ToolResponses - * @static - * @param {google.cloud.ces.v1.IToolResponses} message ToolResponses message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolResponses.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolResponses != null && message.toolResponses.length) - for (var i = 0; i < message.toolResponses.length; ++i) - $root.google.cloud.ces.v1.ToolResponse.encode(message.toolResponses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ToolResponses message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ToolResponses.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ToolResponses - * @static - * @param {google.cloud.ces.v1.IToolResponses} message ToolResponses message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolResponses.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolResponses message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ToolResponses - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ToolResponses} ToolResponses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolResponses.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ToolResponses(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.toolResponses && message.toolResponses.length)) - message.toolResponses = []; - message.toolResponses.push($root.google.cloud.ces.v1.ToolResponse.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolResponses message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ToolResponses - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ToolResponses} ToolResponses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolResponses.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolResponses message. - * @function verify - * @memberof google.cloud.ces.v1.ToolResponses - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolResponses.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.toolResponses != null && message.hasOwnProperty("toolResponses")) { - if (!Array.isArray(message.toolResponses)) - return "toolResponses: array expected"; - for (var i = 0; i < message.toolResponses.length; ++i) { - var error = $root.google.cloud.ces.v1.ToolResponse.verify(message.toolResponses[i]); - if (error) - return "toolResponses." + error; - } - } - return null; - }; - - /** - * Creates a ToolResponses message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ToolResponses - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ToolResponses} ToolResponses - */ - ToolResponses.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ToolResponses) - return object; - var message = new $root.google.cloud.ces.v1.ToolResponses(); - if (object.toolResponses) { - if (!Array.isArray(object.toolResponses)) - throw TypeError(".google.cloud.ces.v1.ToolResponses.toolResponses: array expected"); - message.toolResponses = []; - for (var i = 0; i < object.toolResponses.length; ++i) { - if (typeof object.toolResponses[i] !== "object") - throw TypeError(".google.cloud.ces.v1.ToolResponses.toolResponses: object expected"); - message.toolResponses[i] = $root.google.cloud.ces.v1.ToolResponse.fromObject(object.toolResponses[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ToolResponses message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ToolResponses - * @static - * @param {google.cloud.ces.v1.ToolResponses} message ToolResponses - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolResponses.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.toolResponses = []; - if (message.toolResponses && message.toolResponses.length) { - object.toolResponses = []; - for (var j = 0; j < message.toolResponses.length; ++j) - object.toolResponses[j] = $root.google.cloud.ces.v1.ToolResponse.toObject(message.toolResponses[j], options); - } - return object; - }; - - /** - * Converts this ToolResponses to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ToolResponses - * @instance - * @returns {Object.} JSON object - */ - ToolResponses.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolResponses - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ToolResponses - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolResponses.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ToolResponses"; - }; - - return ToolResponses; - })(); - - v1.Citations = (function() { - - /** - * Properties of a Citations. - * @memberof google.cloud.ces.v1 - * @interface ICitations - * @property {Array.|null} [citedChunks] Citations citedChunks - */ - - /** - * Constructs a new Citations. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a Citations. - * @implements ICitations - * @constructor - * @param {google.cloud.ces.v1.ICitations=} [properties] Properties to set - */ - function Citations(properties) { - this.citedChunks = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Citations citedChunks. - * @member {Array.} citedChunks - * @memberof google.cloud.ces.v1.Citations - * @instance - */ - Citations.prototype.citedChunks = $util.emptyArray; - - /** - * Creates a new Citations instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Citations - * @static - * @param {google.cloud.ces.v1.ICitations=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Citations} Citations instance - */ - Citations.create = function create(properties) { - return new Citations(properties); - }; - - /** - * Encodes the specified Citations message. Does not implicitly {@link google.cloud.ces.v1.Citations.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Citations - * @static - * @param {google.cloud.ces.v1.ICitations} message Citations message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Citations.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.citedChunks != null && message.citedChunks.length) - for (var i = 0; i < message.citedChunks.length; ++i) - $root.google.cloud.ces.v1.Citations.CitedChunk.encode(message.citedChunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Citations message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Citations.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Citations - * @static - * @param {google.cloud.ces.v1.ICitations} message Citations message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Citations.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Citations message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Citations - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Citations} Citations - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Citations.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Citations(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.citedChunks && message.citedChunks.length)) - message.citedChunks = []; - message.citedChunks.push($root.google.cloud.ces.v1.Citations.CitedChunk.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Citations message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Citations - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Citations} Citations - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Citations.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Citations message. - * @function verify - * @memberof google.cloud.ces.v1.Citations - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Citations.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.citedChunks != null && message.hasOwnProperty("citedChunks")) { - if (!Array.isArray(message.citedChunks)) - return "citedChunks: array expected"; - for (var i = 0; i < message.citedChunks.length; ++i) { - var error = $root.google.cloud.ces.v1.Citations.CitedChunk.verify(message.citedChunks[i]); - if (error) - return "citedChunks." + error; - } - } - return null; - }; - - /** - * Creates a Citations message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Citations - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Citations} Citations - */ - Citations.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Citations) - return object; - var message = new $root.google.cloud.ces.v1.Citations(); - if (object.citedChunks) { - if (!Array.isArray(object.citedChunks)) - throw TypeError(".google.cloud.ces.v1.Citations.citedChunks: array expected"); - message.citedChunks = []; - for (var i = 0; i < object.citedChunks.length; ++i) { - if (typeof object.citedChunks[i] !== "object") - throw TypeError(".google.cloud.ces.v1.Citations.citedChunks: object expected"); - message.citedChunks[i] = $root.google.cloud.ces.v1.Citations.CitedChunk.fromObject(object.citedChunks[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Citations message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Citations - * @static - * @param {google.cloud.ces.v1.Citations} message Citations - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Citations.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.citedChunks = []; - if (message.citedChunks && message.citedChunks.length) { - object.citedChunks = []; - for (var j = 0; j < message.citedChunks.length; ++j) - object.citedChunks[j] = $root.google.cloud.ces.v1.Citations.CitedChunk.toObject(message.citedChunks[j], options); - } - return object; - }; - - /** - * Converts this Citations to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Citations - * @instance - * @returns {Object.} JSON object - */ - Citations.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Citations - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Citations - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Citations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Citations"; - }; - - Citations.CitedChunk = (function() { - - /** - * Properties of a CitedChunk. - * @memberof google.cloud.ces.v1.Citations - * @interface ICitedChunk - * @property {string|null} [uri] CitedChunk uri - * @property {string|null} [title] CitedChunk title - * @property {string|null} [text] CitedChunk text - */ - - /** - * Constructs a new CitedChunk. - * @memberof google.cloud.ces.v1.Citations - * @classdesc Represents a CitedChunk. - * @implements ICitedChunk - * @constructor - * @param {google.cloud.ces.v1.Citations.ICitedChunk=} [properties] Properties to set - */ - function CitedChunk(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CitedChunk uri. - * @member {string} uri - * @memberof google.cloud.ces.v1.Citations.CitedChunk - * @instance - */ - CitedChunk.prototype.uri = ""; - - /** - * CitedChunk title. - * @member {string} title - * @memberof google.cloud.ces.v1.Citations.CitedChunk - * @instance - */ - CitedChunk.prototype.title = ""; - - /** - * CitedChunk text. - * @member {string} text - * @memberof google.cloud.ces.v1.Citations.CitedChunk - * @instance - */ - CitedChunk.prototype.text = ""; - - /** - * Creates a new CitedChunk instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Citations.CitedChunk - * @static - * @param {google.cloud.ces.v1.Citations.ICitedChunk=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Citations.CitedChunk} CitedChunk instance - */ - CitedChunk.create = function create(properties) { - return new CitedChunk(properties); - }; - - /** - * Encodes the specified CitedChunk message. Does not implicitly {@link google.cloud.ces.v1.Citations.CitedChunk.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Citations.CitedChunk - * @static - * @param {google.cloud.ces.v1.Citations.ICitedChunk} message CitedChunk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CitedChunk.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.text); - return writer; - }; - - /** - * Encodes the specified CitedChunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Citations.CitedChunk.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Citations.CitedChunk - * @static - * @param {google.cloud.ces.v1.Citations.ICitedChunk} message CitedChunk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CitedChunk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CitedChunk message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Citations.CitedChunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Citations.CitedChunk} CitedChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CitedChunk.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Citations.CitedChunk(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.uri = reader.string(); - break; - } - case 2: { - message.title = reader.string(); - break; - } - case 3: { - message.text = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CitedChunk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Citations.CitedChunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Citations.CitedChunk} CitedChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CitedChunk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CitedChunk message. - * @function verify - * @memberof google.cloud.ces.v1.Citations.CitedChunk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CitedChunk.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - return null; - }; - - /** - * Creates a CitedChunk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Citations.CitedChunk - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Citations.CitedChunk} CitedChunk - */ - CitedChunk.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Citations.CitedChunk) - return object; - var message = new $root.google.cloud.ces.v1.Citations.CitedChunk(); - if (object.uri != null) - message.uri = String(object.uri); - if (object.title != null) - message.title = String(object.title); - if (object.text != null) - message.text = String(object.text); - return message; - }; - - /** - * Creates a plain object from a CitedChunk message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Citations.CitedChunk - * @static - * @param {google.cloud.ces.v1.Citations.CitedChunk} message CitedChunk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CitedChunk.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.uri = ""; - object.title = ""; - object.text = ""; - } - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - return object; - }; - - /** - * Converts this CitedChunk to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Citations.CitedChunk - * @instance - * @returns {Object.} JSON object - */ - CitedChunk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CitedChunk - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Citations.CitedChunk - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CitedChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Citations.CitedChunk"; - }; - - return CitedChunk; - })(); - - return Citations; - })(); - - v1.Event = (function() { - - /** - * Properties of an Event. - * @memberof google.cloud.ces.v1 - * @interface IEvent - * @property {string|null} [event] Event event - */ - - /** - * Constructs a new Event. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an Event. - * @implements IEvent - * @constructor - * @param {google.cloud.ces.v1.IEvent=} [properties] Properties to set - */ - function Event(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Event event. - * @member {string} event - * @memberof google.cloud.ces.v1.Event - * @instance - */ - Event.prototype.event = ""; - - /** - * Creates a new Event instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.Event - * @static - * @param {google.cloud.ces.v1.IEvent=} [properties] Properties to set - * @returns {google.cloud.ces.v1.Event} Event instance - */ - Event.create = function create(properties) { - return new Event(properties); - }; - - /** - * Encodes the specified Event message. Does not implicitly {@link google.cloud.ces.v1.Event.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.Event - * @static - * @param {google.cloud.ces.v1.IEvent} message Event message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Event.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.event != null && Object.hasOwnProperty.call(message, "event")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.event); - return writer; - }; - - /** - * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.ces.v1.Event.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.Event - * @static - * @param {google.cloud.ces.v1.IEvent} message Event message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Event.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Event message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.Event - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.Event} Event - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Event.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.Event(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.event = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Event message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.Event - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.Event} Event - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Event.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Event message. - * @function verify - * @memberof google.cloud.ces.v1.Event - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Event.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.event != null && message.hasOwnProperty("event")) - if (!$util.isString(message.event)) - return "event: string expected"; - return null; - }; - - /** - * Creates an Event message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.Event - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.Event} Event - */ - Event.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.Event) - return object; - var message = new $root.google.cloud.ces.v1.Event(); - if (object.event != null) - message.event = String(object.event); - return message; - }; - - /** - * Creates a plain object from an Event message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.Event - * @static - * @param {google.cloud.ces.v1.Event} message Event - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Event.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.event = ""; - if (message.event != null && message.hasOwnProperty("event")) - object.event = message.event; - return object; - }; - - /** - * Converts this Event to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.Event - * @instance - * @returns {Object.} JSON object - */ - Event.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Event - * @function getTypeUrl - * @memberof google.cloud.ces.v1.Event - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Event.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.Event"; - }; - - return Event; - })(); - - v1.SessionInput = (function() { - - /** - * Properties of a SessionInput. - * @memberof google.cloud.ces.v1 - * @interface ISessionInput - * @property {string|null} [text] SessionInput text - * @property {string|null} [dtmf] SessionInput dtmf - * @property {Uint8Array|null} [audio] SessionInput audio - * @property {google.cloud.ces.v1.IToolResponses|null} [toolResponses] SessionInput toolResponses - * @property {google.cloud.ces.v1.IImage|null} [image] SessionInput image - * @property {google.cloud.ces.v1.IBlob|null} [blob] SessionInput blob - * @property {google.protobuf.IStruct|null} [variables] SessionInput variables - * @property {google.cloud.ces.v1.IEvent|null} [event] SessionInput event - * @property {boolean|null} [willContinue] SessionInput willContinue - */ - - /** - * Constructs a new SessionInput. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a SessionInput. - * @implements ISessionInput - * @constructor - * @param {google.cloud.ces.v1.ISessionInput=} [properties] Properties to set - */ - function SessionInput(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SessionInput text. - * @member {string|null|undefined} text - * @memberof google.cloud.ces.v1.SessionInput - * @instance - */ - SessionInput.prototype.text = null; - - /** - * SessionInput dtmf. - * @member {string|null|undefined} dtmf - * @memberof google.cloud.ces.v1.SessionInput - * @instance - */ - SessionInput.prototype.dtmf = null; - - /** - * SessionInput audio. - * @member {Uint8Array|null|undefined} audio - * @memberof google.cloud.ces.v1.SessionInput - * @instance - */ - SessionInput.prototype.audio = null; - - /** - * SessionInput toolResponses. - * @member {google.cloud.ces.v1.IToolResponses|null|undefined} toolResponses - * @memberof google.cloud.ces.v1.SessionInput - * @instance - */ - SessionInput.prototype.toolResponses = null; - - /** - * SessionInput image. - * @member {google.cloud.ces.v1.IImage|null|undefined} image - * @memberof google.cloud.ces.v1.SessionInput - * @instance - */ - SessionInput.prototype.image = null; - - /** - * SessionInput blob. - * @member {google.cloud.ces.v1.IBlob|null|undefined} blob - * @memberof google.cloud.ces.v1.SessionInput - * @instance - */ - SessionInput.prototype.blob = null; - - /** - * SessionInput variables. - * @member {google.protobuf.IStruct|null|undefined} variables - * @memberof google.cloud.ces.v1.SessionInput - * @instance - */ - SessionInput.prototype.variables = null; - - /** - * SessionInput event. - * @member {google.cloud.ces.v1.IEvent|null|undefined} event - * @memberof google.cloud.ces.v1.SessionInput - * @instance - */ - SessionInput.prototype.event = null; - - /** - * SessionInput willContinue. - * @member {boolean} willContinue - * @memberof google.cloud.ces.v1.SessionInput - * @instance - */ - SessionInput.prototype.willContinue = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SessionInput inputType. - * @member {"text"|"dtmf"|"audio"|"toolResponses"|"image"|"blob"|"variables"|"event"|undefined} inputType - * @memberof google.cloud.ces.v1.SessionInput - * @instance - */ - Object.defineProperty(SessionInput.prototype, "inputType", { - get: $util.oneOfGetter($oneOfFields = ["text", "dtmf", "audio", "toolResponses", "image", "blob", "variables", "event"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SessionInput instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.SessionInput - * @static - * @param {google.cloud.ces.v1.ISessionInput=} [properties] Properties to set - * @returns {google.cloud.ces.v1.SessionInput} SessionInput instance - */ - SessionInput.create = function create(properties) { - return new SessionInput(properties); - }; - - /** - * Encodes the specified SessionInput message. Does not implicitly {@link google.cloud.ces.v1.SessionInput.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.SessionInput - * @static - * @param {google.cloud.ces.v1.ISessionInput} message SessionInput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionInput.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audio); - if (message.toolResponses != null && Object.hasOwnProperty.call(message, "toolResponses")) - $root.google.cloud.ces.v1.ToolResponses.encode(message.toolResponses, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - $root.google.cloud.ces.v1.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) - $root.google.protobuf.Struct.encode(message.variables, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.dtmf != null && Object.hasOwnProperty.call(message, "dtmf")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.dtmf); - if (message.blob != null && Object.hasOwnProperty.call(message, "blob")) - $root.google.cloud.ces.v1.Blob.encode(message.blob, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.willContinue != null && Object.hasOwnProperty.call(message, "willContinue")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.willContinue); - if (message.event != null && Object.hasOwnProperty.call(message, "event")) - $root.google.cloud.ces.v1.Event.encode(message.event, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SessionInput message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionInput.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.SessionInput - * @static - * @param {google.cloud.ces.v1.ISessionInput} message SessionInput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionInput.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SessionInput message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.SessionInput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.SessionInput} SessionInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionInput.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.SessionInput(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.text = reader.string(); - break; - } - case 6: { - message.dtmf = reader.string(); - break; - } - case 2: { - message.audio = reader.bytes(); - break; - } - case 3: { - message.toolResponses = $root.google.cloud.ces.v1.ToolResponses.decode(reader, reader.uint32()); - break; - } - case 4: { - message.image = $root.google.cloud.ces.v1.Image.decode(reader, reader.uint32()); - break; - } - case 7: { - message.blob = $root.google.cloud.ces.v1.Blob.decode(reader, reader.uint32()); - break; - } - case 5: { - message.variables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 9: { - message.event = $root.google.cloud.ces.v1.Event.decode(reader, reader.uint32()); - break; - } - case 8: { - message.willContinue = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SessionInput message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.SessionInput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.SessionInput} SessionInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionInput.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SessionInput message. - * @function verify - * @memberof google.cloud.ces.v1.SessionInput - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SessionInput.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.text != null && message.hasOwnProperty("text")) { - properties.inputType = 1; - if (!$util.isString(message.text)) - return "text: string expected"; - } - if (message.dtmf != null && message.hasOwnProperty("dtmf")) { - if (properties.inputType === 1) - return "inputType: multiple values"; - properties.inputType = 1; - if (!$util.isString(message.dtmf)) - return "dtmf: string expected"; - } - if (message.audio != null && message.hasOwnProperty("audio")) { - if (properties.inputType === 1) - return "inputType: multiple values"; - properties.inputType = 1; - if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) - return "audio: buffer expected"; - } - if (message.toolResponses != null && message.hasOwnProperty("toolResponses")) { - if (properties.inputType === 1) - return "inputType: multiple values"; - properties.inputType = 1; - { - var error = $root.google.cloud.ces.v1.ToolResponses.verify(message.toolResponses); - if (error) - return "toolResponses." + error; - } - } - if (message.image != null && message.hasOwnProperty("image")) { - if (properties.inputType === 1) - return "inputType: multiple values"; - properties.inputType = 1; - { - var error = $root.google.cloud.ces.v1.Image.verify(message.image); - if (error) - return "image." + error; - } - } - if (message.blob != null && message.hasOwnProperty("blob")) { - if (properties.inputType === 1) - return "inputType: multiple values"; - properties.inputType = 1; - { - var error = $root.google.cloud.ces.v1.Blob.verify(message.blob); - if (error) - return "blob." + error; - } - } - if (message.variables != null && message.hasOwnProperty("variables")) { - if (properties.inputType === 1) - return "inputType: multiple values"; - properties.inputType = 1; - { - var error = $root.google.protobuf.Struct.verify(message.variables); - if (error) - return "variables." + error; - } - } - if (message.event != null && message.hasOwnProperty("event")) { - if (properties.inputType === 1) - return "inputType: multiple values"; - properties.inputType = 1; - { - var error = $root.google.cloud.ces.v1.Event.verify(message.event); - if (error) - return "event." + error; - } - } - if (message.willContinue != null && message.hasOwnProperty("willContinue")) - if (typeof message.willContinue !== "boolean") - return "willContinue: boolean expected"; - return null; - }; - - /** - * Creates a SessionInput message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.SessionInput - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.SessionInput} SessionInput - */ - SessionInput.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.SessionInput) - return object; - var message = new $root.google.cloud.ces.v1.SessionInput(); - if (object.text != null) - message.text = String(object.text); - if (object.dtmf != null) - message.dtmf = String(object.dtmf); - if (object.audio != null) - if (typeof object.audio === "string") - $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); - else if (object.audio.length >= 0) - message.audio = object.audio; - if (object.toolResponses != null) { - if (typeof object.toolResponses !== "object") - throw TypeError(".google.cloud.ces.v1.SessionInput.toolResponses: object expected"); - message.toolResponses = $root.google.cloud.ces.v1.ToolResponses.fromObject(object.toolResponses); - } - if (object.image != null) { - if (typeof object.image !== "object") - throw TypeError(".google.cloud.ces.v1.SessionInput.image: object expected"); - message.image = $root.google.cloud.ces.v1.Image.fromObject(object.image); - } - if (object.blob != null) { - if (typeof object.blob !== "object") - throw TypeError(".google.cloud.ces.v1.SessionInput.blob: object expected"); - message.blob = $root.google.cloud.ces.v1.Blob.fromObject(object.blob); - } - if (object.variables != null) { - if (typeof object.variables !== "object") - throw TypeError(".google.cloud.ces.v1.SessionInput.variables: object expected"); - message.variables = $root.google.protobuf.Struct.fromObject(object.variables); - } - if (object.event != null) { - if (typeof object.event !== "object") - throw TypeError(".google.cloud.ces.v1.SessionInput.event: object expected"); - message.event = $root.google.cloud.ces.v1.Event.fromObject(object.event); - } - if (object.willContinue != null) - message.willContinue = Boolean(object.willContinue); - return message; - }; - - /** - * Creates a plain object from a SessionInput message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.SessionInput - * @static - * @param {google.cloud.ces.v1.SessionInput} message SessionInput - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SessionInput.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.willContinue = false; - if (message.text != null && message.hasOwnProperty("text")) { - object.text = message.text; - if (options.oneofs) - object.inputType = "text"; - } - if (message.audio != null && message.hasOwnProperty("audio")) { - object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; - if (options.oneofs) - object.inputType = "audio"; - } - if (message.toolResponses != null && message.hasOwnProperty("toolResponses")) { - object.toolResponses = $root.google.cloud.ces.v1.ToolResponses.toObject(message.toolResponses, options); - if (options.oneofs) - object.inputType = "toolResponses"; - } - if (message.image != null && message.hasOwnProperty("image")) { - object.image = $root.google.cloud.ces.v1.Image.toObject(message.image, options); - if (options.oneofs) - object.inputType = "image"; - } - if (message.variables != null && message.hasOwnProperty("variables")) { - object.variables = $root.google.protobuf.Struct.toObject(message.variables, options); - if (options.oneofs) - object.inputType = "variables"; - } - if (message.dtmf != null && message.hasOwnProperty("dtmf")) { - object.dtmf = message.dtmf; - if (options.oneofs) - object.inputType = "dtmf"; - } - if (message.blob != null && message.hasOwnProperty("blob")) { - object.blob = $root.google.cloud.ces.v1.Blob.toObject(message.blob, options); - if (options.oneofs) - object.inputType = "blob"; - } - if (message.willContinue != null && message.hasOwnProperty("willContinue")) - object.willContinue = message.willContinue; - if (message.event != null && message.hasOwnProperty("event")) { - object.event = $root.google.cloud.ces.v1.Event.toObject(message.event, options); - if (options.oneofs) - object.inputType = "event"; - } - return object; - }; - - /** - * Converts this SessionInput to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.SessionInput - * @instance - * @returns {Object.} JSON object - */ - SessionInput.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SessionInput - * @function getTypeUrl - * @memberof google.cloud.ces.v1.SessionInput - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SessionInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.SessionInput"; - }; - - return SessionInput; - })(); - - v1.SessionOutput = (function() { - - /** - * Properties of a SessionOutput. - * @memberof google.cloud.ces.v1 - * @interface ISessionOutput - * @property {string|null} [text] SessionOutput text - * @property {Uint8Array|null} [audio] SessionOutput audio - * @property {google.cloud.ces.v1.IToolCalls|null} [toolCalls] SessionOutput toolCalls - * @property {google.cloud.ces.v1.ICitations|null} [citations] SessionOutput citations - * @property {google.cloud.ces.v1.IGoogleSearchSuggestions|null} [googleSearchSuggestions] SessionOutput googleSearchSuggestions - * @property {google.cloud.ces.v1.IEndSession|null} [endSession] SessionOutput endSession - * @property {google.protobuf.IStruct|null} [payload] SessionOutput payload - * @property {number|null} [turnIndex] SessionOutput turnIndex - * @property {boolean|null} [turnCompleted] SessionOutput turnCompleted - * @property {google.cloud.ces.v1.SessionOutput.IDiagnosticInfo|null} [diagnosticInfo] SessionOutput diagnosticInfo - */ - - /** - * Constructs a new SessionOutput. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a SessionOutput. - * @implements ISessionOutput - * @constructor - * @param {google.cloud.ces.v1.ISessionOutput=} [properties] Properties to set - */ - function SessionOutput(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SessionOutput text. - * @member {string|null|undefined} text - * @memberof google.cloud.ces.v1.SessionOutput - * @instance - */ - SessionOutput.prototype.text = null; - - /** - * SessionOutput audio. - * @member {Uint8Array|null|undefined} audio - * @memberof google.cloud.ces.v1.SessionOutput - * @instance - */ - SessionOutput.prototype.audio = null; - - /** - * SessionOutput toolCalls. - * @member {google.cloud.ces.v1.IToolCalls|null|undefined} toolCalls - * @memberof google.cloud.ces.v1.SessionOutput - * @instance - */ - SessionOutput.prototype.toolCalls = null; - - /** - * SessionOutput citations. - * @member {google.cloud.ces.v1.ICitations|null|undefined} citations - * @memberof google.cloud.ces.v1.SessionOutput - * @instance - */ - SessionOutput.prototype.citations = null; - - /** - * SessionOutput googleSearchSuggestions. - * @member {google.cloud.ces.v1.IGoogleSearchSuggestions|null|undefined} googleSearchSuggestions - * @memberof google.cloud.ces.v1.SessionOutput - * @instance - */ - SessionOutput.prototype.googleSearchSuggestions = null; - - /** - * SessionOutput endSession. - * @member {google.cloud.ces.v1.IEndSession|null|undefined} endSession - * @memberof google.cloud.ces.v1.SessionOutput - * @instance - */ - SessionOutput.prototype.endSession = null; - - /** - * SessionOutput payload. - * @member {google.protobuf.IStruct|null|undefined} payload - * @memberof google.cloud.ces.v1.SessionOutput - * @instance - */ - SessionOutput.prototype.payload = null; - - /** - * SessionOutput turnIndex. - * @member {number} turnIndex - * @memberof google.cloud.ces.v1.SessionOutput - * @instance - */ - SessionOutput.prototype.turnIndex = 0; - - /** - * SessionOutput turnCompleted. - * @member {boolean} turnCompleted - * @memberof google.cloud.ces.v1.SessionOutput - * @instance - */ - SessionOutput.prototype.turnCompleted = false; - - /** - * SessionOutput diagnosticInfo. - * @member {google.cloud.ces.v1.SessionOutput.IDiagnosticInfo|null|undefined} diagnosticInfo - * @memberof google.cloud.ces.v1.SessionOutput - * @instance - */ - SessionOutput.prototype.diagnosticInfo = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SessionOutput outputType. - * @member {"text"|"audio"|"toolCalls"|"citations"|"googleSearchSuggestions"|"endSession"|"payload"|undefined} outputType - * @memberof google.cloud.ces.v1.SessionOutput - * @instance - */ - Object.defineProperty(SessionOutput.prototype, "outputType", { - get: $util.oneOfGetter($oneOfFields = ["text", "audio", "toolCalls", "citations", "googleSearchSuggestions", "endSession", "payload"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SessionOutput instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.SessionOutput - * @static - * @param {google.cloud.ces.v1.ISessionOutput=} [properties] Properties to set - * @returns {google.cloud.ces.v1.SessionOutput} SessionOutput instance - */ - SessionOutput.create = function create(properties) { - return new SessionOutput(properties); - }; - - /** - * Encodes the specified SessionOutput message. Does not implicitly {@link google.cloud.ces.v1.SessionOutput.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.SessionOutput - * @static - * @param {google.cloud.ces.v1.ISessionOutput} message SessionOutput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionOutput.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audio); - if (message.toolCalls != null && Object.hasOwnProperty.call(message, "toolCalls")) - $root.google.cloud.ces.v1.ToolCalls.encode(message.toolCalls, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.turnCompleted != null && Object.hasOwnProperty.call(message, "turnCompleted")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.turnCompleted); - if (message.turnIndex != null && Object.hasOwnProperty.call(message, "turnIndex")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.turnIndex); - if (message.diagnosticInfo != null && Object.hasOwnProperty.call(message, "diagnosticInfo")) - $root.google.cloud.ces.v1.SessionOutput.DiagnosticInfo.encode(message.diagnosticInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.citations != null && Object.hasOwnProperty.call(message, "citations")) - $root.google.cloud.ces.v1.Citations.encode(message.citations, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.endSession != null && Object.hasOwnProperty.call(message, "endSession")) - $root.google.cloud.ces.v1.EndSession.encode(message.endSession, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.googleSearchSuggestions != null && Object.hasOwnProperty.call(message, "googleSearchSuggestions")) - $root.google.cloud.ces.v1.GoogleSearchSuggestions.encode(message.googleSearchSuggestions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SessionOutput message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionOutput.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.SessionOutput - * @static - * @param {google.cloud.ces.v1.ISessionOutput} message SessionOutput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionOutput.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SessionOutput message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.SessionOutput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.SessionOutput} SessionOutput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionOutput.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.SessionOutput(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.text = reader.string(); - break; - } - case 2: { - message.audio = reader.bytes(); - break; - } - case 3: { - message.toolCalls = $root.google.cloud.ces.v1.ToolCalls.decode(reader, reader.uint32()); - break; - } - case 8: { - message.citations = $root.google.cloud.ces.v1.Citations.decode(reader, reader.uint32()); - break; - } - case 10: { - message.googleSearchSuggestions = $root.google.cloud.ces.v1.GoogleSearchSuggestions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.endSession = $root.google.cloud.ces.v1.EndSession.decode(reader, reader.uint32()); - break; - } - case 11: { - message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 6: { - message.turnIndex = reader.int32(); - break; - } - case 4: { - message.turnCompleted = reader.bool(); - break; - } - case 7: { - message.diagnosticInfo = $root.google.cloud.ces.v1.SessionOutput.DiagnosticInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SessionOutput message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.SessionOutput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.SessionOutput} SessionOutput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionOutput.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SessionOutput message. - * @function verify - * @memberof google.cloud.ces.v1.SessionOutput - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SessionOutput.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.text != null && message.hasOwnProperty("text")) { - properties.outputType = 1; - if (!$util.isString(message.text)) - return "text: string expected"; - } - if (message.audio != null && message.hasOwnProperty("audio")) { - if (properties.outputType === 1) - return "outputType: multiple values"; - properties.outputType = 1; - if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) - return "audio: buffer expected"; - } - if (message.toolCalls != null && message.hasOwnProperty("toolCalls")) { - if (properties.outputType === 1) - return "outputType: multiple values"; - properties.outputType = 1; - { - var error = $root.google.cloud.ces.v1.ToolCalls.verify(message.toolCalls); - if (error) - return "toolCalls." + error; - } - } - if (message.citations != null && message.hasOwnProperty("citations")) { - if (properties.outputType === 1) - return "outputType: multiple values"; - properties.outputType = 1; - { - var error = $root.google.cloud.ces.v1.Citations.verify(message.citations); - if (error) - return "citations." + error; - } - } - if (message.googleSearchSuggestions != null && message.hasOwnProperty("googleSearchSuggestions")) { - if (properties.outputType === 1) - return "outputType: multiple values"; - properties.outputType = 1; - { - var error = $root.google.cloud.ces.v1.GoogleSearchSuggestions.verify(message.googleSearchSuggestions); - if (error) - return "googleSearchSuggestions." + error; - } - } - if (message.endSession != null && message.hasOwnProperty("endSession")) { - if (properties.outputType === 1) - return "outputType: multiple values"; - properties.outputType = 1; - { - var error = $root.google.cloud.ces.v1.EndSession.verify(message.endSession); - if (error) - return "endSession." + error; - } - } - if (message.payload != null && message.hasOwnProperty("payload")) { - if (properties.outputType === 1) - return "outputType: multiple values"; - properties.outputType = 1; - { - var error = $root.google.protobuf.Struct.verify(message.payload); - if (error) - return "payload." + error; - } - } - if (message.turnIndex != null && message.hasOwnProperty("turnIndex")) - if (!$util.isInteger(message.turnIndex)) - return "turnIndex: integer expected"; - if (message.turnCompleted != null && message.hasOwnProperty("turnCompleted")) - if (typeof message.turnCompleted !== "boolean") - return "turnCompleted: boolean expected"; - if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) { - var error = $root.google.cloud.ces.v1.SessionOutput.DiagnosticInfo.verify(message.diagnosticInfo); - if (error) - return "diagnosticInfo." + error; - } - return null; - }; - - /** - * Creates a SessionOutput message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.SessionOutput - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.SessionOutput} SessionOutput - */ - SessionOutput.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.SessionOutput) - return object; - var message = new $root.google.cloud.ces.v1.SessionOutput(); - if (object.text != null) - message.text = String(object.text); - if (object.audio != null) - if (typeof object.audio === "string") - $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); - else if (object.audio.length >= 0) - message.audio = object.audio; - if (object.toolCalls != null) { - if (typeof object.toolCalls !== "object") - throw TypeError(".google.cloud.ces.v1.SessionOutput.toolCalls: object expected"); - message.toolCalls = $root.google.cloud.ces.v1.ToolCalls.fromObject(object.toolCalls); - } - if (object.citations != null) { - if (typeof object.citations !== "object") - throw TypeError(".google.cloud.ces.v1.SessionOutput.citations: object expected"); - message.citations = $root.google.cloud.ces.v1.Citations.fromObject(object.citations); - } - if (object.googleSearchSuggestions != null) { - if (typeof object.googleSearchSuggestions !== "object") - throw TypeError(".google.cloud.ces.v1.SessionOutput.googleSearchSuggestions: object expected"); - message.googleSearchSuggestions = $root.google.cloud.ces.v1.GoogleSearchSuggestions.fromObject(object.googleSearchSuggestions); - } - if (object.endSession != null) { - if (typeof object.endSession !== "object") - throw TypeError(".google.cloud.ces.v1.SessionOutput.endSession: object expected"); - message.endSession = $root.google.cloud.ces.v1.EndSession.fromObject(object.endSession); - } - if (object.payload != null) { - if (typeof object.payload !== "object") - throw TypeError(".google.cloud.ces.v1.SessionOutput.payload: object expected"); - message.payload = $root.google.protobuf.Struct.fromObject(object.payload); - } - if (object.turnIndex != null) - message.turnIndex = object.turnIndex | 0; - if (object.turnCompleted != null) - message.turnCompleted = Boolean(object.turnCompleted); - if (object.diagnosticInfo != null) { - if (typeof object.diagnosticInfo !== "object") - throw TypeError(".google.cloud.ces.v1.SessionOutput.diagnosticInfo: object expected"); - message.diagnosticInfo = $root.google.cloud.ces.v1.SessionOutput.DiagnosticInfo.fromObject(object.diagnosticInfo); - } - return message; - }; - - /** - * Creates a plain object from a SessionOutput message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.SessionOutput - * @static - * @param {google.cloud.ces.v1.SessionOutput} message SessionOutput - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SessionOutput.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.turnCompleted = false; - object.turnIndex = 0; - object.diagnosticInfo = null; - } - if (message.text != null && message.hasOwnProperty("text")) { - object.text = message.text; - if (options.oneofs) - object.outputType = "text"; - } - if (message.audio != null && message.hasOwnProperty("audio")) { - object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; - if (options.oneofs) - object.outputType = "audio"; - } - if (message.toolCalls != null && message.hasOwnProperty("toolCalls")) { - object.toolCalls = $root.google.cloud.ces.v1.ToolCalls.toObject(message.toolCalls, options); - if (options.oneofs) - object.outputType = "toolCalls"; - } - if (message.turnCompleted != null && message.hasOwnProperty("turnCompleted")) - object.turnCompleted = message.turnCompleted; - if (message.turnIndex != null && message.hasOwnProperty("turnIndex")) - object.turnIndex = message.turnIndex; - if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) - object.diagnosticInfo = $root.google.cloud.ces.v1.SessionOutput.DiagnosticInfo.toObject(message.diagnosticInfo, options); - if (message.citations != null && message.hasOwnProperty("citations")) { - object.citations = $root.google.cloud.ces.v1.Citations.toObject(message.citations, options); - if (options.oneofs) - object.outputType = "citations"; - } - if (message.endSession != null && message.hasOwnProperty("endSession")) { - object.endSession = $root.google.cloud.ces.v1.EndSession.toObject(message.endSession, options); - if (options.oneofs) - object.outputType = "endSession"; - } - if (message.googleSearchSuggestions != null && message.hasOwnProperty("googleSearchSuggestions")) { - object.googleSearchSuggestions = $root.google.cloud.ces.v1.GoogleSearchSuggestions.toObject(message.googleSearchSuggestions, options); - if (options.oneofs) - object.outputType = "googleSearchSuggestions"; - } - if (message.payload != null && message.hasOwnProperty("payload")) { - object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); - if (options.oneofs) - object.outputType = "payload"; - } - return object; - }; - - /** - * Converts this SessionOutput to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.SessionOutput - * @instance - * @returns {Object.} JSON object - */ - SessionOutput.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SessionOutput - * @function getTypeUrl - * @memberof google.cloud.ces.v1.SessionOutput - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SessionOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.SessionOutput"; - }; - - SessionOutput.DiagnosticInfo = (function() { - - /** - * Properties of a DiagnosticInfo. - * @memberof google.cloud.ces.v1.SessionOutput - * @interface IDiagnosticInfo - * @property {Array.|null} [messages] DiagnosticInfo messages - * @property {google.cloud.ces.v1.ISpan|null} [rootSpan] DiagnosticInfo rootSpan - */ - - /** - * Constructs a new DiagnosticInfo. - * @memberof google.cloud.ces.v1.SessionOutput - * @classdesc Represents a DiagnosticInfo. - * @implements IDiagnosticInfo - * @constructor - * @param {google.cloud.ces.v1.SessionOutput.IDiagnosticInfo=} [properties] Properties to set - */ - function DiagnosticInfo(properties) { - this.messages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DiagnosticInfo messages. - * @member {Array.} messages - * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo - * @instance - */ - DiagnosticInfo.prototype.messages = $util.emptyArray; - - /** - * DiagnosticInfo rootSpan. - * @member {google.cloud.ces.v1.ISpan|null|undefined} rootSpan - * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo - * @instance - */ - DiagnosticInfo.prototype.rootSpan = null; - - /** - * Creates a new DiagnosticInfo instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo - * @static - * @param {google.cloud.ces.v1.SessionOutput.IDiagnosticInfo=} [properties] Properties to set - * @returns {google.cloud.ces.v1.SessionOutput.DiagnosticInfo} DiagnosticInfo instance - */ - DiagnosticInfo.create = function create(properties) { - return new DiagnosticInfo(properties); - }; - - /** - * Encodes the specified DiagnosticInfo message. Does not implicitly {@link google.cloud.ces.v1.SessionOutput.DiagnosticInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo - * @static - * @param {google.cloud.ces.v1.SessionOutput.IDiagnosticInfo} message DiagnosticInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiagnosticInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.google.cloud.ces.v1.Message.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.rootSpan != null && Object.hasOwnProperty.call(message, "rootSpan")) - $root.google.cloud.ces.v1.Span.encode(message.rootSpan, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DiagnosticInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1.SessionOutput.DiagnosticInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo - * @static - * @param {google.cloud.ces.v1.SessionOutput.IDiagnosticInfo} message DiagnosticInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiagnosticInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DiagnosticInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.SessionOutput.DiagnosticInfo} DiagnosticInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiagnosticInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.SessionOutput.DiagnosticInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.google.cloud.ces.v1.Message.decode(reader, reader.uint32())); - break; - } - case 3: { - message.rootSpan = $root.google.cloud.ces.v1.Span.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DiagnosticInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.SessionOutput.DiagnosticInfo} DiagnosticInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiagnosticInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DiagnosticInfo message. - * @function verify - * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DiagnosticInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.cloud.ces.v1.Message.verify(message.messages[i]); - if (error) - return "messages." + error; - } - } - if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) { - var error = $root.google.cloud.ces.v1.Span.verify(message.rootSpan); - if (error) - return "rootSpan." + error; - } - return null; - }; - - /** - * Creates a DiagnosticInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.SessionOutput.DiagnosticInfo} DiagnosticInfo - */ - DiagnosticInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.SessionOutput.DiagnosticInfo) - return object; - var message = new $root.google.cloud.ces.v1.SessionOutput.DiagnosticInfo(); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".google.cloud.ces.v1.SessionOutput.DiagnosticInfo.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".google.cloud.ces.v1.SessionOutput.DiagnosticInfo.messages: object expected"); - message.messages[i] = $root.google.cloud.ces.v1.Message.fromObject(object.messages[i]); - } - } - if (object.rootSpan != null) { - if (typeof object.rootSpan !== "object") - throw TypeError(".google.cloud.ces.v1.SessionOutput.DiagnosticInfo.rootSpan: object expected"); - message.rootSpan = $root.google.cloud.ces.v1.Span.fromObject(object.rootSpan); - } - return message; - }; - - /** - * Creates a plain object from a DiagnosticInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo - * @static - * @param {google.cloud.ces.v1.SessionOutput.DiagnosticInfo} message DiagnosticInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DiagnosticInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.messages = []; - if (options.defaults) - object.rootSpan = null; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.cloud.ces.v1.Message.toObject(message.messages[j], options); - } - if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) - object.rootSpan = $root.google.cloud.ces.v1.Span.toObject(message.rootSpan, options); - return object; - }; - - /** - * Converts this DiagnosticInfo to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo - * @instance - * @returns {Object.} JSON object - */ - DiagnosticInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DiagnosticInfo - * @function getTypeUrl - * @memberof google.cloud.ces.v1.SessionOutput.DiagnosticInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DiagnosticInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.SessionOutput.DiagnosticInfo"; - }; - - return DiagnosticInfo; - })(); - - return SessionOutput; - })(); - - v1.RecognitionResult = (function() { - - /** - * Properties of a RecognitionResult. - * @memberof google.cloud.ces.v1 - * @interface IRecognitionResult - * @property {string|null} [transcript] RecognitionResult transcript - */ - - /** - * Constructs a new RecognitionResult. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a RecognitionResult. - * @implements IRecognitionResult - * @constructor - * @param {google.cloud.ces.v1.IRecognitionResult=} [properties] Properties to set - */ - function RecognitionResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RecognitionResult transcript. - * @member {string} transcript - * @memberof google.cloud.ces.v1.RecognitionResult - * @instance - */ - RecognitionResult.prototype.transcript = ""; - - /** - * Creates a new RecognitionResult instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.RecognitionResult - * @static - * @param {google.cloud.ces.v1.IRecognitionResult=} [properties] Properties to set - * @returns {google.cloud.ces.v1.RecognitionResult} RecognitionResult instance - */ - RecognitionResult.create = function create(properties) { - return new RecognitionResult(properties); - }; - - /** - * Encodes the specified RecognitionResult message. Does not implicitly {@link google.cloud.ces.v1.RecognitionResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.RecognitionResult - * @static - * @param {google.cloud.ces.v1.IRecognitionResult} message RecognitionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RecognitionResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.transcript); - return writer; - }; - - /** - * Encodes the specified RecognitionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RecognitionResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.RecognitionResult - * @static - * @param {google.cloud.ces.v1.IRecognitionResult} message RecognitionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RecognitionResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.RecognitionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.RecognitionResult} RecognitionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RecognitionResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RecognitionResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.transcript = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RecognitionResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.RecognitionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.RecognitionResult} RecognitionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RecognitionResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RecognitionResult message. - * @function verify - * @memberof google.cloud.ces.v1.RecognitionResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RecognitionResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.transcript != null && message.hasOwnProperty("transcript")) - if (!$util.isString(message.transcript)) - return "transcript: string expected"; - return null; - }; - - /** - * Creates a RecognitionResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.RecognitionResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.RecognitionResult} RecognitionResult - */ - RecognitionResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.RecognitionResult) - return object; - var message = new $root.google.cloud.ces.v1.RecognitionResult(); - if (object.transcript != null) - message.transcript = String(object.transcript); - return message; - }; - - /** - * Creates a plain object from a RecognitionResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.RecognitionResult - * @static - * @param {google.cloud.ces.v1.RecognitionResult} message RecognitionResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RecognitionResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.transcript = ""; - if (message.transcript != null && message.hasOwnProperty("transcript")) - object.transcript = message.transcript; - return object; - }; - - /** - * Converts this RecognitionResult to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.RecognitionResult - * @instance - * @returns {Object.} JSON object - */ - RecognitionResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RecognitionResult - * @function getTypeUrl - * @memberof google.cloud.ces.v1.RecognitionResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RecognitionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.RecognitionResult"; - }; - - return RecognitionResult; - })(); - - v1.InterruptionSignal = (function() { - - /** - * Properties of an InterruptionSignal. - * @memberof google.cloud.ces.v1 - * @interface IInterruptionSignal - * @property {boolean|null} [bargeIn] InterruptionSignal bargeIn - */ - - /** - * Constructs a new InterruptionSignal. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an InterruptionSignal. - * @implements IInterruptionSignal - * @constructor - * @param {google.cloud.ces.v1.IInterruptionSignal=} [properties] Properties to set - */ - function InterruptionSignal(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InterruptionSignal bargeIn. - * @member {boolean} bargeIn - * @memberof google.cloud.ces.v1.InterruptionSignal - * @instance - */ - InterruptionSignal.prototype.bargeIn = false; - - /** - * Creates a new InterruptionSignal instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.InterruptionSignal - * @static - * @param {google.cloud.ces.v1.IInterruptionSignal=} [properties] Properties to set - * @returns {google.cloud.ces.v1.InterruptionSignal} InterruptionSignal instance - */ - InterruptionSignal.create = function create(properties) { - return new InterruptionSignal(properties); - }; - - /** - * Encodes the specified InterruptionSignal message. Does not implicitly {@link google.cloud.ces.v1.InterruptionSignal.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.InterruptionSignal - * @static - * @param {google.cloud.ces.v1.IInterruptionSignal} message InterruptionSignal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InterruptionSignal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bargeIn != null && Object.hasOwnProperty.call(message, "bargeIn")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.bargeIn); - return writer; - }; - - /** - * Encodes the specified InterruptionSignal message, length delimited. Does not implicitly {@link google.cloud.ces.v1.InterruptionSignal.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.InterruptionSignal - * @static - * @param {google.cloud.ces.v1.IInterruptionSignal} message InterruptionSignal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InterruptionSignal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InterruptionSignal message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.InterruptionSignal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.InterruptionSignal} InterruptionSignal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InterruptionSignal.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.InterruptionSignal(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.bargeIn = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InterruptionSignal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.InterruptionSignal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.InterruptionSignal} InterruptionSignal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InterruptionSignal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InterruptionSignal message. - * @function verify - * @memberof google.cloud.ces.v1.InterruptionSignal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InterruptionSignal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bargeIn != null && message.hasOwnProperty("bargeIn")) - if (typeof message.bargeIn !== "boolean") - return "bargeIn: boolean expected"; - return null; - }; - - /** - * Creates an InterruptionSignal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.InterruptionSignal - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.InterruptionSignal} InterruptionSignal - */ - InterruptionSignal.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.InterruptionSignal) - return object; - var message = new $root.google.cloud.ces.v1.InterruptionSignal(); - if (object.bargeIn != null) - message.bargeIn = Boolean(object.bargeIn); - return message; - }; - - /** - * Creates a plain object from an InterruptionSignal message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.InterruptionSignal - * @static - * @param {google.cloud.ces.v1.InterruptionSignal} message InterruptionSignal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InterruptionSignal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.bargeIn = false; - if (message.bargeIn != null && message.hasOwnProperty("bargeIn")) - object.bargeIn = message.bargeIn; - return object; - }; - - /** - * Converts this InterruptionSignal to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.InterruptionSignal - * @instance - * @returns {Object.} JSON object - */ - InterruptionSignal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InterruptionSignal - * @function getTypeUrl - * @memberof google.cloud.ces.v1.InterruptionSignal - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InterruptionSignal.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.InterruptionSignal"; - }; - - return InterruptionSignal; - })(); - - v1.EndSession = (function() { - - /** - * Properties of an EndSession. - * @memberof google.cloud.ces.v1 - * @interface IEndSession - * @property {google.protobuf.IStruct|null} [metadata] EndSession metadata - */ - - /** - * Constructs a new EndSession. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an EndSession. - * @implements IEndSession - * @constructor - * @param {google.cloud.ces.v1.IEndSession=} [properties] Properties to set - */ - function EndSession(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EndSession metadata. - * @member {google.protobuf.IStruct|null|undefined} metadata - * @memberof google.cloud.ces.v1.EndSession - * @instance - */ - EndSession.prototype.metadata = null; - - /** - * Creates a new EndSession instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.EndSession - * @static - * @param {google.cloud.ces.v1.IEndSession=} [properties] Properties to set - * @returns {google.cloud.ces.v1.EndSession} EndSession instance - */ - EndSession.create = function create(properties) { - return new EndSession(properties); - }; - - /** - * Encodes the specified EndSession message. Does not implicitly {@link google.cloud.ces.v1.EndSession.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.EndSession - * @static - * @param {google.cloud.ces.v1.IEndSession} message EndSession message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EndSession.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EndSession message, length delimited. Does not implicitly {@link google.cloud.ces.v1.EndSession.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.EndSession - * @static - * @param {google.cloud.ces.v1.IEndSession} message EndSession message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EndSession.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EndSession message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.EndSession - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.EndSession} EndSession - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EndSession.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.EndSession(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EndSession message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.EndSession - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.EndSession} EndSession - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EndSession.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EndSession message. - * @function verify - * @memberof google.cloud.ces.v1.EndSession - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EndSession.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Struct.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates an EndSession message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.EndSession - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.EndSession} EndSession - */ - EndSession.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.EndSession) - return object; - var message = new $root.google.cloud.ces.v1.EndSession(); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.ces.v1.EndSession.metadata: object expected"); - message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from an EndSession message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.EndSession - * @static - * @param {google.cloud.ces.v1.EndSession} message EndSession - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EndSession.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this EndSession to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.EndSession - * @instance - * @returns {Object.} JSON object - */ - EndSession.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EndSession - * @function getTypeUrl - * @memberof google.cloud.ces.v1.EndSession - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EndSession.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.EndSession"; - }; - - return EndSession; - })(); - - v1.GoAway = (function() { - - /** - * Properties of a GoAway. - * @memberof google.cloud.ces.v1 - * @interface IGoAway - */ - - /** - * Constructs a new GoAway. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a GoAway. - * @implements IGoAway - * @constructor - * @param {google.cloud.ces.v1.IGoAway=} [properties] Properties to set - */ - function GoAway(properties) { - if (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 GoAway instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.GoAway - * @static - * @param {google.cloud.ces.v1.IGoAway=} [properties] Properties to set - * @returns {google.cloud.ces.v1.GoAway} GoAway instance - */ - GoAway.create = function create(properties) { - return new GoAway(properties); - }; - - /** - * Encodes the specified GoAway message. Does not implicitly {@link google.cloud.ces.v1.GoAway.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.GoAway - * @static - * @param {google.cloud.ces.v1.IGoAway} message GoAway message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoAway.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified GoAway message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GoAway.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.GoAway - * @static - * @param {google.cloud.ces.v1.IGoAway} message GoAway message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoAway.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoAway message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.GoAway - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.GoAway} GoAway - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoAway.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GoAway(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoAway message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.GoAway - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.GoAway} GoAway - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoAway.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoAway message. - * @function verify - * @memberof google.cloud.ces.v1.GoAway - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoAway.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a GoAway message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.GoAway - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.GoAway} GoAway - */ - GoAway.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.GoAway) - return object; - return new $root.google.cloud.ces.v1.GoAway(); - }; - - /** - * Creates a plain object from a GoAway message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.GoAway - * @static - * @param {google.cloud.ces.v1.GoAway} message GoAway - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoAway.toObject = function toObject() { - return {}; - }; - - /** - * Converts this GoAway to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.GoAway - * @instance - * @returns {Object.} JSON object - */ - GoAway.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoAway - * @function getTypeUrl - * @memberof google.cloud.ces.v1.GoAway - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoAway.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.GoAway"; - }; - - return GoAway; - })(); - - v1.RunSessionRequest = (function() { - - /** - * Properties of a RunSessionRequest. - * @memberof google.cloud.ces.v1 - * @interface IRunSessionRequest - * @property {google.cloud.ces.v1.ISessionConfig|null} [config] RunSessionRequest config - * @property {Array.|null} [inputs] RunSessionRequest inputs - */ - - /** - * Constructs a new RunSessionRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a RunSessionRequest. - * @implements IRunSessionRequest - * @constructor - * @param {google.cloud.ces.v1.IRunSessionRequest=} [properties] Properties to set - */ - function RunSessionRequest(properties) { - this.inputs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RunSessionRequest config. - * @member {google.cloud.ces.v1.ISessionConfig|null|undefined} config - * @memberof google.cloud.ces.v1.RunSessionRequest - * @instance - */ - RunSessionRequest.prototype.config = null; - - /** - * RunSessionRequest inputs. - * @member {Array.} inputs - * @memberof google.cloud.ces.v1.RunSessionRequest - * @instance - */ - RunSessionRequest.prototype.inputs = $util.emptyArray; - - /** - * Creates a new RunSessionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.RunSessionRequest - * @static - * @param {google.cloud.ces.v1.IRunSessionRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.RunSessionRequest} RunSessionRequest instance - */ - RunSessionRequest.create = function create(properties) { - return new RunSessionRequest(properties); - }; - - /** - * Encodes the specified RunSessionRequest message. Does not implicitly {@link google.cloud.ces.v1.RunSessionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.RunSessionRequest - * @static - * @param {google.cloud.ces.v1.IRunSessionRequest} message RunSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunSessionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.cloud.ces.v1.SessionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.inputs != null && message.inputs.length) - for (var i = 0; i < message.inputs.length; ++i) - $root.google.cloud.ces.v1.SessionInput.encode(message.inputs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RunSessionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RunSessionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.RunSessionRequest - * @static - * @param {google.cloud.ces.v1.IRunSessionRequest} message RunSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RunSessionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.RunSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.RunSessionRequest} RunSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunSessionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RunSessionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.config = $root.google.cloud.ces.v1.SessionConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.inputs && message.inputs.length)) - message.inputs = []; - message.inputs.push($root.google.cloud.ces.v1.SessionInput.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RunSessionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.RunSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.RunSessionRequest} RunSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunSessionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RunSessionRequest message. - * @function verify - * @memberof google.cloud.ces.v1.RunSessionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunSessionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.config != null && message.hasOwnProperty("config")) { - var error = $root.google.cloud.ces.v1.SessionConfig.verify(message.config); - if (error) - return "config." + error; - } - if (message.inputs != null && message.hasOwnProperty("inputs")) { - if (!Array.isArray(message.inputs)) - return "inputs: array expected"; - for (var i = 0; i < message.inputs.length; ++i) { - var error = $root.google.cloud.ces.v1.SessionInput.verify(message.inputs[i]); - if (error) - return "inputs." + error; - } - } - return null; - }; - - /** - * Creates a RunSessionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.RunSessionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.RunSessionRequest} RunSessionRequest - */ - RunSessionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.RunSessionRequest) - return object; - var message = new $root.google.cloud.ces.v1.RunSessionRequest(); - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.ces.v1.RunSessionRequest.config: object expected"); - message.config = $root.google.cloud.ces.v1.SessionConfig.fromObject(object.config); - } - if (object.inputs) { - if (!Array.isArray(object.inputs)) - throw TypeError(".google.cloud.ces.v1.RunSessionRequest.inputs: array expected"); - message.inputs = []; - for (var i = 0; i < object.inputs.length; ++i) { - if (typeof object.inputs[i] !== "object") - throw TypeError(".google.cloud.ces.v1.RunSessionRequest.inputs: object expected"); - message.inputs[i] = $root.google.cloud.ces.v1.SessionInput.fromObject(object.inputs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RunSessionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.RunSessionRequest - * @static - * @param {google.cloud.ces.v1.RunSessionRequest} message RunSessionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunSessionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.inputs = []; - if (options.defaults) - object.config = null; - if (message.config != null && message.hasOwnProperty("config")) - object.config = $root.google.cloud.ces.v1.SessionConfig.toObject(message.config, options); - if (message.inputs && message.inputs.length) { - object.inputs = []; - for (var j = 0; j < message.inputs.length; ++j) - object.inputs[j] = $root.google.cloud.ces.v1.SessionInput.toObject(message.inputs[j], options); - } - return object; - }; - - /** - * Converts this RunSessionRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.RunSessionRequest - * @instance - * @returns {Object.} JSON object - */ - RunSessionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RunSessionRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.RunSessionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.RunSessionRequest"; - }; - - return RunSessionRequest; - })(); - - v1.RunSessionResponse = (function() { - - /** - * Properties of a RunSessionResponse. - * @memberof google.cloud.ces.v1 - * @interface IRunSessionResponse - * @property {Array.|null} [outputs] RunSessionResponse outputs - */ - - /** - * Constructs a new RunSessionResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a RunSessionResponse. - * @implements IRunSessionResponse - * @constructor - * @param {google.cloud.ces.v1.IRunSessionResponse=} [properties] Properties to set - */ - function RunSessionResponse(properties) { - this.outputs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RunSessionResponse outputs. - * @member {Array.} outputs - * @memberof google.cloud.ces.v1.RunSessionResponse - * @instance - */ - RunSessionResponse.prototype.outputs = $util.emptyArray; - - /** - * Creates a new RunSessionResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.RunSessionResponse - * @static - * @param {google.cloud.ces.v1.IRunSessionResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.RunSessionResponse} RunSessionResponse instance - */ - RunSessionResponse.create = function create(properties) { - return new RunSessionResponse(properties); - }; - - /** - * Encodes the specified RunSessionResponse message. Does not implicitly {@link google.cloud.ces.v1.RunSessionResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.RunSessionResponse - * @static - * @param {google.cloud.ces.v1.IRunSessionResponse} message RunSessionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunSessionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.outputs != null && message.outputs.length) - for (var i = 0; i < message.outputs.length; ++i) - $root.google.cloud.ces.v1.SessionOutput.encode(message.outputs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RunSessionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RunSessionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.RunSessionResponse - * @static - * @param {google.cloud.ces.v1.IRunSessionResponse} message RunSessionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunSessionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RunSessionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.RunSessionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.RunSessionResponse} RunSessionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunSessionResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RunSessionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.outputs && message.outputs.length)) - message.outputs = []; - message.outputs.push($root.google.cloud.ces.v1.SessionOutput.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RunSessionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.RunSessionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.RunSessionResponse} RunSessionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunSessionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RunSessionResponse message. - * @function verify - * @memberof google.cloud.ces.v1.RunSessionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunSessionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.outputs != null && message.hasOwnProperty("outputs")) { - if (!Array.isArray(message.outputs)) - return "outputs: array expected"; - for (var i = 0; i < message.outputs.length; ++i) { - var error = $root.google.cloud.ces.v1.SessionOutput.verify(message.outputs[i]); - if (error) - return "outputs." + error; - } - } - return null; - }; - - /** - * Creates a RunSessionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.RunSessionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.RunSessionResponse} RunSessionResponse - */ - RunSessionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.RunSessionResponse) - return object; - var message = new $root.google.cloud.ces.v1.RunSessionResponse(); - if (object.outputs) { - if (!Array.isArray(object.outputs)) - throw TypeError(".google.cloud.ces.v1.RunSessionResponse.outputs: array expected"); - message.outputs = []; - for (var i = 0; i < object.outputs.length; ++i) { - if (typeof object.outputs[i] !== "object") - throw TypeError(".google.cloud.ces.v1.RunSessionResponse.outputs: object expected"); - message.outputs[i] = $root.google.cloud.ces.v1.SessionOutput.fromObject(object.outputs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RunSessionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.RunSessionResponse - * @static - * @param {google.cloud.ces.v1.RunSessionResponse} message RunSessionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunSessionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.outputs = []; - if (message.outputs && message.outputs.length) { - object.outputs = []; - for (var j = 0; j < message.outputs.length; ++j) - object.outputs[j] = $root.google.cloud.ces.v1.SessionOutput.toObject(message.outputs[j], options); - } - return object; - }; - - /** - * Converts this RunSessionResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.RunSessionResponse - * @instance - * @returns {Object.} JSON object - */ - RunSessionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RunSessionResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.RunSessionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunSessionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.RunSessionResponse"; - }; - - return RunSessionResponse; - })(); - - v1.BidiSessionClientMessage = (function() { - - /** - * Properties of a BidiSessionClientMessage. - * @memberof google.cloud.ces.v1 - * @interface IBidiSessionClientMessage - * @property {google.cloud.ces.v1.ISessionConfig|null} [config] BidiSessionClientMessage config - * @property {google.cloud.ces.v1.ISessionInput|null} [realtimeInput] BidiSessionClientMessage realtimeInput - */ - - /** - * Constructs a new BidiSessionClientMessage. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a BidiSessionClientMessage. - * @implements IBidiSessionClientMessage - * @constructor - * @param {google.cloud.ces.v1.IBidiSessionClientMessage=} [properties] Properties to set - */ - function BidiSessionClientMessage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BidiSessionClientMessage config. - * @member {google.cloud.ces.v1.ISessionConfig|null|undefined} config - * @memberof google.cloud.ces.v1.BidiSessionClientMessage - * @instance - */ - BidiSessionClientMessage.prototype.config = null; - - /** - * BidiSessionClientMessage realtimeInput. - * @member {google.cloud.ces.v1.ISessionInput|null|undefined} realtimeInput - * @memberof google.cloud.ces.v1.BidiSessionClientMessage - * @instance - */ - BidiSessionClientMessage.prototype.realtimeInput = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BidiSessionClientMessage messageType. - * @member {"config"|"realtimeInput"|undefined} messageType - * @memberof google.cloud.ces.v1.BidiSessionClientMessage - * @instance - */ - Object.defineProperty(BidiSessionClientMessage.prototype, "messageType", { - get: $util.oneOfGetter($oneOfFields = ["config", "realtimeInput"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BidiSessionClientMessage instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.BidiSessionClientMessage - * @static - * @param {google.cloud.ces.v1.IBidiSessionClientMessage=} [properties] Properties to set - * @returns {google.cloud.ces.v1.BidiSessionClientMessage} BidiSessionClientMessage instance - */ - BidiSessionClientMessage.create = function create(properties) { - return new BidiSessionClientMessage(properties); - }; - - /** - * Encodes the specified BidiSessionClientMessage message. Does not implicitly {@link google.cloud.ces.v1.BidiSessionClientMessage.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.BidiSessionClientMessage - * @static - * @param {google.cloud.ces.v1.IBidiSessionClientMessage} message BidiSessionClientMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BidiSessionClientMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.cloud.ces.v1.SessionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.realtimeInput != null && Object.hasOwnProperty.call(message, "realtimeInput")) - $root.google.cloud.ces.v1.SessionInput.encode(message.realtimeInput, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BidiSessionClientMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BidiSessionClientMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.BidiSessionClientMessage - * @static - * @param {google.cloud.ces.v1.IBidiSessionClientMessage} message BidiSessionClientMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BidiSessionClientMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BidiSessionClientMessage message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.BidiSessionClientMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.BidiSessionClientMessage} BidiSessionClientMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BidiSessionClientMessage.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.BidiSessionClientMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.config = $root.google.cloud.ces.v1.SessionConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.realtimeInput = $root.google.cloud.ces.v1.SessionInput.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BidiSessionClientMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.BidiSessionClientMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.BidiSessionClientMessage} BidiSessionClientMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BidiSessionClientMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BidiSessionClientMessage message. - * @function verify - * @memberof google.cloud.ces.v1.BidiSessionClientMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BidiSessionClientMessage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.config != null && message.hasOwnProperty("config")) { - properties.messageType = 1; - { - var error = $root.google.cloud.ces.v1.SessionConfig.verify(message.config); - if (error) - return "config." + error; - } - } - if (message.realtimeInput != null && message.hasOwnProperty("realtimeInput")) { - if (properties.messageType === 1) - return "messageType: multiple values"; - properties.messageType = 1; - { - var error = $root.google.cloud.ces.v1.SessionInput.verify(message.realtimeInput); - if (error) - return "realtimeInput." + error; - } - } - return null; - }; - - /** - * Creates a BidiSessionClientMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.BidiSessionClientMessage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.BidiSessionClientMessage} BidiSessionClientMessage - */ - BidiSessionClientMessage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.BidiSessionClientMessage) - return object; - var message = new $root.google.cloud.ces.v1.BidiSessionClientMessage(); - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.ces.v1.BidiSessionClientMessage.config: object expected"); - message.config = $root.google.cloud.ces.v1.SessionConfig.fromObject(object.config); - } - if (object.realtimeInput != null) { - if (typeof object.realtimeInput !== "object") - throw TypeError(".google.cloud.ces.v1.BidiSessionClientMessage.realtimeInput: object expected"); - message.realtimeInput = $root.google.cloud.ces.v1.SessionInput.fromObject(object.realtimeInput); - } - return message; - }; - - /** - * Creates a plain object from a BidiSessionClientMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.BidiSessionClientMessage - * @static - * @param {google.cloud.ces.v1.BidiSessionClientMessage} message BidiSessionClientMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BidiSessionClientMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.config != null && message.hasOwnProperty("config")) { - object.config = $root.google.cloud.ces.v1.SessionConfig.toObject(message.config, options); - if (options.oneofs) - object.messageType = "config"; - } - if (message.realtimeInput != null && message.hasOwnProperty("realtimeInput")) { - object.realtimeInput = $root.google.cloud.ces.v1.SessionInput.toObject(message.realtimeInput, options); - if (options.oneofs) - object.messageType = "realtimeInput"; - } - return object; - }; - - /** - * Converts this BidiSessionClientMessage to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.BidiSessionClientMessage - * @instance - * @returns {Object.} JSON object - */ - BidiSessionClientMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BidiSessionClientMessage - * @function getTypeUrl - * @memberof google.cloud.ces.v1.BidiSessionClientMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BidiSessionClientMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.BidiSessionClientMessage"; - }; - - return BidiSessionClientMessage; - })(); - - v1.BidiSessionServerMessage = (function() { - - /** - * Properties of a BidiSessionServerMessage. - * @memberof google.cloud.ces.v1 - * @interface IBidiSessionServerMessage - * @property {google.cloud.ces.v1.ISessionOutput|null} [sessionOutput] BidiSessionServerMessage sessionOutput - * @property {google.cloud.ces.v1.IRecognitionResult|null} [recognitionResult] BidiSessionServerMessage recognitionResult - * @property {google.cloud.ces.v1.IInterruptionSignal|null} [interruptionSignal] BidiSessionServerMessage interruptionSignal - * @property {google.cloud.ces.v1.IEndSession|null} [endSession] BidiSessionServerMessage endSession - * @property {google.cloud.ces.v1.IGoAway|null} [goAway] BidiSessionServerMessage goAway - */ - - /** - * Constructs a new BidiSessionServerMessage. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a BidiSessionServerMessage. - * @implements IBidiSessionServerMessage - * @constructor - * @param {google.cloud.ces.v1.IBidiSessionServerMessage=} [properties] Properties to set - */ - function BidiSessionServerMessage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BidiSessionServerMessage sessionOutput. - * @member {google.cloud.ces.v1.ISessionOutput|null|undefined} sessionOutput - * @memberof google.cloud.ces.v1.BidiSessionServerMessage - * @instance - */ - BidiSessionServerMessage.prototype.sessionOutput = null; - - /** - * BidiSessionServerMessage recognitionResult. - * @member {google.cloud.ces.v1.IRecognitionResult|null|undefined} recognitionResult - * @memberof google.cloud.ces.v1.BidiSessionServerMessage - * @instance - */ - BidiSessionServerMessage.prototype.recognitionResult = null; - - /** - * BidiSessionServerMessage interruptionSignal. - * @member {google.cloud.ces.v1.IInterruptionSignal|null|undefined} interruptionSignal - * @memberof google.cloud.ces.v1.BidiSessionServerMessage - * @instance - */ - BidiSessionServerMessage.prototype.interruptionSignal = null; - - /** - * BidiSessionServerMessage endSession. - * @member {google.cloud.ces.v1.IEndSession|null|undefined} endSession - * @memberof google.cloud.ces.v1.BidiSessionServerMessage - * @instance - */ - BidiSessionServerMessage.prototype.endSession = null; - - /** - * BidiSessionServerMessage goAway. - * @member {google.cloud.ces.v1.IGoAway|null|undefined} goAway - * @memberof google.cloud.ces.v1.BidiSessionServerMessage - * @instance - */ - BidiSessionServerMessage.prototype.goAway = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BidiSessionServerMessage messageType. - * @member {"sessionOutput"|"recognitionResult"|"interruptionSignal"|"endSession"|"goAway"|undefined} messageType - * @memberof google.cloud.ces.v1.BidiSessionServerMessage - * @instance - */ - Object.defineProperty(BidiSessionServerMessage.prototype, "messageType", { - get: $util.oneOfGetter($oneOfFields = ["sessionOutput", "recognitionResult", "interruptionSignal", "endSession", "goAway"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BidiSessionServerMessage instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.BidiSessionServerMessage - * @static - * @param {google.cloud.ces.v1.IBidiSessionServerMessage=} [properties] Properties to set - * @returns {google.cloud.ces.v1.BidiSessionServerMessage} BidiSessionServerMessage instance - */ - BidiSessionServerMessage.create = function create(properties) { - return new BidiSessionServerMessage(properties); - }; - - /** - * Encodes the specified BidiSessionServerMessage message. Does not implicitly {@link google.cloud.ces.v1.BidiSessionServerMessage.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.BidiSessionServerMessage - * @static - * @param {google.cloud.ces.v1.IBidiSessionServerMessage} message BidiSessionServerMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BidiSessionServerMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sessionOutput != null && Object.hasOwnProperty.call(message, "sessionOutput")) - $root.google.cloud.ces.v1.SessionOutput.encode(message.sessionOutput, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.recognitionResult != null && Object.hasOwnProperty.call(message, "recognitionResult")) - $root.google.cloud.ces.v1.RecognitionResult.encode(message.recognitionResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.interruptionSignal != null && Object.hasOwnProperty.call(message, "interruptionSignal")) - $root.google.cloud.ces.v1.InterruptionSignal.encode(message.interruptionSignal, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endSession != null && Object.hasOwnProperty.call(message, "endSession")) - $root.google.cloud.ces.v1.EndSession.encode(message.endSession, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.goAway != null && Object.hasOwnProperty.call(message, "goAway")) - $root.google.cloud.ces.v1.GoAway.encode(message.goAway, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BidiSessionServerMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1.BidiSessionServerMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.BidiSessionServerMessage - * @static - * @param {google.cloud.ces.v1.IBidiSessionServerMessage} message BidiSessionServerMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BidiSessionServerMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BidiSessionServerMessage message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.BidiSessionServerMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.BidiSessionServerMessage} BidiSessionServerMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BidiSessionServerMessage.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.BidiSessionServerMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.sessionOutput = $root.google.cloud.ces.v1.SessionOutput.decode(reader, reader.uint32()); - break; - } - case 2: { - message.recognitionResult = $root.google.cloud.ces.v1.RecognitionResult.decode(reader, reader.uint32()); - break; - } - case 3: { - message.interruptionSignal = $root.google.cloud.ces.v1.InterruptionSignal.decode(reader, reader.uint32()); - break; - } - case 5: { - message.endSession = $root.google.cloud.ces.v1.EndSession.decode(reader, reader.uint32()); - break; - } - case 6: { - message.goAway = $root.google.cloud.ces.v1.GoAway.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BidiSessionServerMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.BidiSessionServerMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.BidiSessionServerMessage} BidiSessionServerMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BidiSessionServerMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BidiSessionServerMessage message. - * @function verify - * @memberof google.cloud.ces.v1.BidiSessionServerMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BidiSessionServerMessage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.sessionOutput != null && message.hasOwnProperty("sessionOutput")) { - properties.messageType = 1; - { - var error = $root.google.cloud.ces.v1.SessionOutput.verify(message.sessionOutput); - if (error) - return "sessionOutput." + error; - } - } - if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { - if (properties.messageType === 1) - return "messageType: multiple values"; - properties.messageType = 1; - { - var error = $root.google.cloud.ces.v1.RecognitionResult.verify(message.recognitionResult); - if (error) - return "recognitionResult." + error; - } - } - if (message.interruptionSignal != null && message.hasOwnProperty("interruptionSignal")) { - if (properties.messageType === 1) - return "messageType: multiple values"; - properties.messageType = 1; - { - var error = $root.google.cloud.ces.v1.InterruptionSignal.verify(message.interruptionSignal); - if (error) - return "interruptionSignal." + error; - } - } - if (message.endSession != null && message.hasOwnProperty("endSession")) { - if (properties.messageType === 1) - return "messageType: multiple values"; - properties.messageType = 1; - { - var error = $root.google.cloud.ces.v1.EndSession.verify(message.endSession); - if (error) - return "endSession." + error; - } - } - if (message.goAway != null && message.hasOwnProperty("goAway")) { - if (properties.messageType === 1) - return "messageType: multiple values"; - properties.messageType = 1; - { - var error = $root.google.cloud.ces.v1.GoAway.verify(message.goAway); - if (error) - return "goAway." + error; - } - } - return null; - }; - - /** - * Creates a BidiSessionServerMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.BidiSessionServerMessage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.BidiSessionServerMessage} BidiSessionServerMessage - */ - BidiSessionServerMessage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.BidiSessionServerMessage) - return object; - var message = new $root.google.cloud.ces.v1.BidiSessionServerMessage(); - if (object.sessionOutput != null) { - if (typeof object.sessionOutput !== "object") - throw TypeError(".google.cloud.ces.v1.BidiSessionServerMessage.sessionOutput: object expected"); - message.sessionOutput = $root.google.cloud.ces.v1.SessionOutput.fromObject(object.sessionOutput); - } - if (object.recognitionResult != null) { - if (typeof object.recognitionResult !== "object") - throw TypeError(".google.cloud.ces.v1.BidiSessionServerMessage.recognitionResult: object expected"); - message.recognitionResult = $root.google.cloud.ces.v1.RecognitionResult.fromObject(object.recognitionResult); - } - if (object.interruptionSignal != null) { - if (typeof object.interruptionSignal !== "object") - throw TypeError(".google.cloud.ces.v1.BidiSessionServerMessage.interruptionSignal: object expected"); - message.interruptionSignal = $root.google.cloud.ces.v1.InterruptionSignal.fromObject(object.interruptionSignal); - } - if (object.endSession != null) { - if (typeof object.endSession !== "object") - throw TypeError(".google.cloud.ces.v1.BidiSessionServerMessage.endSession: object expected"); - message.endSession = $root.google.cloud.ces.v1.EndSession.fromObject(object.endSession); - } - if (object.goAway != null) { - if (typeof object.goAway !== "object") - throw TypeError(".google.cloud.ces.v1.BidiSessionServerMessage.goAway: object expected"); - message.goAway = $root.google.cloud.ces.v1.GoAway.fromObject(object.goAway); - } - return message; - }; - - /** - * Creates a plain object from a BidiSessionServerMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.BidiSessionServerMessage - * @static - * @param {google.cloud.ces.v1.BidiSessionServerMessage} message BidiSessionServerMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BidiSessionServerMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.sessionOutput != null && message.hasOwnProperty("sessionOutput")) { - object.sessionOutput = $root.google.cloud.ces.v1.SessionOutput.toObject(message.sessionOutput, options); - if (options.oneofs) - object.messageType = "sessionOutput"; - } - if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { - object.recognitionResult = $root.google.cloud.ces.v1.RecognitionResult.toObject(message.recognitionResult, options); - if (options.oneofs) - object.messageType = "recognitionResult"; - } - if (message.interruptionSignal != null && message.hasOwnProperty("interruptionSignal")) { - object.interruptionSignal = $root.google.cloud.ces.v1.InterruptionSignal.toObject(message.interruptionSignal, options); - if (options.oneofs) - object.messageType = "interruptionSignal"; - } - if (message.endSession != null && message.hasOwnProperty("endSession")) { - object.endSession = $root.google.cloud.ces.v1.EndSession.toObject(message.endSession, options); - if (options.oneofs) - object.messageType = "endSession"; - } - if (message.goAway != null && message.hasOwnProperty("goAway")) { - object.goAway = $root.google.cloud.ces.v1.GoAway.toObject(message.goAway, options); - if (options.oneofs) - object.messageType = "goAway"; - } - return object; - }; - - /** - * Converts this BidiSessionServerMessage to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.BidiSessionServerMessage - * @instance - * @returns {Object.} JSON object - */ - BidiSessionServerMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BidiSessionServerMessage - * @function getTypeUrl - * @memberof google.cloud.ces.v1.BidiSessionServerMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BidiSessionServerMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.BidiSessionServerMessage"; - }; - - return BidiSessionServerMessage; - })(); - - v1.ToolService = (function() { - - /** - * Constructs a new ToolService service. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a ToolService - * @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 ToolService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (ToolService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ToolService; - - /** - * Creates new ToolService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.ces.v1.ToolService - * @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 {ToolService} RPC service. Useful where requests and/or responses are streamed. - */ - ToolService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.ces.v1.ToolService|executeTool}. - * @memberof google.cloud.ces.v1.ToolService - * @typedef ExecuteToolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.ExecuteToolResponse} [response] ExecuteToolResponse - */ - - /** - * Calls ExecuteTool. - * @function executeTool - * @memberof google.cloud.ces.v1.ToolService - * @instance - * @param {google.cloud.ces.v1.IExecuteToolRequest} request ExecuteToolRequest message or plain object - * @param {google.cloud.ces.v1.ToolService.ExecuteToolCallback} callback Node-style callback called with the error, if any, and ExecuteToolResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ToolService.prototype.executeTool = function executeTool(request, callback) { - return this.rpcCall(executeTool, $root.google.cloud.ces.v1.ExecuteToolRequest, $root.google.cloud.ces.v1.ExecuteToolResponse, request, callback); - }, "name", { value: "ExecuteTool" }); - - /** - * Calls ExecuteTool. - * @function executeTool - * @memberof google.cloud.ces.v1.ToolService - * @instance - * @param {google.cloud.ces.v1.IExecuteToolRequest} request ExecuteToolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.ToolService|retrieveToolSchema}. - * @memberof google.cloud.ces.v1.ToolService - * @typedef RetrieveToolSchemaCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.RetrieveToolSchemaResponse} [response] RetrieveToolSchemaResponse - */ - - /** - * Calls RetrieveToolSchema. - * @function retrieveToolSchema - * @memberof google.cloud.ces.v1.ToolService - * @instance - * @param {google.cloud.ces.v1.IRetrieveToolSchemaRequest} request RetrieveToolSchemaRequest message or plain object - * @param {google.cloud.ces.v1.ToolService.RetrieveToolSchemaCallback} callback Node-style callback called with the error, if any, and RetrieveToolSchemaResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ToolService.prototype.retrieveToolSchema = function retrieveToolSchema(request, callback) { - return this.rpcCall(retrieveToolSchema, $root.google.cloud.ces.v1.RetrieveToolSchemaRequest, $root.google.cloud.ces.v1.RetrieveToolSchemaResponse, request, callback); - }, "name", { value: "RetrieveToolSchema" }); - - /** - * Calls RetrieveToolSchema. - * @function retrieveToolSchema - * @memberof google.cloud.ces.v1.ToolService - * @instance - * @param {google.cloud.ces.v1.IRetrieveToolSchemaRequest} request RetrieveToolSchemaRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1.ToolService|retrieveTools}. - * @memberof google.cloud.ces.v1.ToolService - * @typedef RetrieveToolsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.RetrieveToolsResponse} [response] RetrieveToolsResponse - */ - - /** - * Calls RetrieveTools. - * @function retrieveTools - * @memberof google.cloud.ces.v1.ToolService - * @instance - * @param {google.cloud.ces.v1.IRetrieveToolsRequest} request RetrieveToolsRequest message or plain object - * @param {google.cloud.ces.v1.ToolService.RetrieveToolsCallback} callback Node-style callback called with the error, if any, and RetrieveToolsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ToolService.prototype.retrieveTools = function retrieveTools(request, callback) { - return this.rpcCall(retrieveTools, $root.google.cloud.ces.v1.RetrieveToolsRequest, $root.google.cloud.ces.v1.RetrieveToolsResponse, request, callback); - }, "name", { value: "RetrieveTools" }); - - /** - * Calls RetrieveTools. - * @function retrieveTools - * @memberof google.cloud.ces.v1.ToolService - * @instance - * @param {google.cloud.ces.v1.IRetrieveToolsRequest} request RetrieveToolsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return ToolService; - })(); - - v1.ExecuteToolRequest = (function() { - - /** - * Properties of an ExecuteToolRequest. - * @memberof google.cloud.ces.v1 - * @interface IExecuteToolRequest - * @property {string|null} [tool] ExecuteToolRequest tool - * @property {google.cloud.ces.v1.IToolsetTool|null} [toolsetTool] ExecuteToolRequest toolsetTool - * @property {string|null} [parent] ExecuteToolRequest parent - * @property {google.protobuf.IStruct|null} [args] ExecuteToolRequest args - */ - - /** - * Constructs a new ExecuteToolRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an ExecuteToolRequest. - * @implements IExecuteToolRequest - * @constructor - * @param {google.cloud.ces.v1.IExecuteToolRequest=} [properties] Properties to set - */ - function ExecuteToolRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteToolRequest tool. - * @member {string|null|undefined} tool - * @memberof google.cloud.ces.v1.ExecuteToolRequest - * @instance - */ - ExecuteToolRequest.prototype.tool = null; - - /** - * ExecuteToolRequest toolsetTool. - * @member {google.cloud.ces.v1.IToolsetTool|null|undefined} toolsetTool - * @memberof google.cloud.ces.v1.ExecuteToolRequest - * @instance - */ - ExecuteToolRequest.prototype.toolsetTool = null; - - /** - * ExecuteToolRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.ExecuteToolRequest - * @instance - */ - ExecuteToolRequest.prototype.parent = ""; - - /** - * ExecuteToolRequest args. - * @member {google.protobuf.IStruct|null|undefined} args - * @memberof google.cloud.ces.v1.ExecuteToolRequest - * @instance - */ - ExecuteToolRequest.prototype.args = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ExecuteToolRequest toolIdentifier. - * @member {"tool"|"toolsetTool"|undefined} toolIdentifier - * @memberof google.cloud.ces.v1.ExecuteToolRequest - * @instance - */ - Object.defineProperty(ExecuteToolRequest.prototype, "toolIdentifier", { - get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExecuteToolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ExecuteToolRequest - * @static - * @param {google.cloud.ces.v1.IExecuteToolRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ExecuteToolRequest} ExecuteToolRequest instance - */ - ExecuteToolRequest.create = function create(properties) { - return new ExecuteToolRequest(properties); - }; - - /** - * Encodes the specified ExecuteToolRequest message. Does not implicitly {@link google.cloud.ces.v1.ExecuteToolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ExecuteToolRequest - * @static - * @param {google.cloud.ces.v1.IExecuteToolRequest} message ExecuteToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteToolRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); - if (message.args != null && Object.hasOwnProperty.call(message, "args")) - $root.google.protobuf.Struct.encode(message.args, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) - $root.google.cloud.ces.v1.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); - return writer; - }; - - /** - * Encodes the specified ExecuteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExecuteToolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ExecuteToolRequest - * @static - * @param {google.cloud.ces.v1.IExecuteToolRequest} message ExecuteToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteToolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteToolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ExecuteToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ExecuteToolRequest} ExecuteToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteToolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ExecuteToolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tool = reader.string(); - break; - } - case 3: { - message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.decode(reader, reader.uint32()); - break; - } - case 4: { - message.parent = reader.string(); - break; - } - case 2: { - message.args = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteToolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ExecuteToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ExecuteToolRequest} ExecuteToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteToolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteToolRequest message. - * @function verify - * @memberof google.cloud.ces.v1.ExecuteToolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteToolRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tool != null && message.hasOwnProperty("tool")) { - properties.toolIdentifier = 1; - if (!$util.isString(message.tool)) - return "tool: string expected"; - } - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - if (properties.toolIdentifier === 1) - return "toolIdentifier: multiple values"; - properties.toolIdentifier = 1; - { - var error = $root.google.cloud.ces.v1.ToolsetTool.verify(message.toolsetTool); - if (error) - return "toolsetTool." + error; - } - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.args != null && message.hasOwnProperty("args")) { - var error = $root.google.protobuf.Struct.verify(message.args); - if (error) - return "args." + error; - } - return null; - }; - - /** - * Creates an ExecuteToolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ExecuteToolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ExecuteToolRequest} ExecuteToolRequest - */ - ExecuteToolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ExecuteToolRequest) - return object; - var message = new $root.google.cloud.ces.v1.ExecuteToolRequest(); - if (object.tool != null) - message.tool = String(object.tool); - if (object.toolsetTool != null) { - if (typeof object.toolsetTool !== "object") - throw TypeError(".google.cloud.ces.v1.ExecuteToolRequest.toolsetTool: object expected"); - message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.fromObject(object.toolsetTool); - } - if (object.parent != null) - message.parent = String(object.parent); - if (object.args != null) { - if (typeof object.args !== "object") - throw TypeError(".google.cloud.ces.v1.ExecuteToolRequest.args: object expected"); - message.args = $root.google.protobuf.Struct.fromObject(object.args); - } - return message; - }; - - /** - * Creates a plain object from an ExecuteToolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ExecuteToolRequest - * @static - * @param {google.cloud.ces.v1.ExecuteToolRequest} message ExecuteToolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteToolRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.args = null; - object.parent = ""; - } - if (message.tool != null && message.hasOwnProperty("tool")) { - object.tool = message.tool; - if (options.oneofs) - object.toolIdentifier = "tool"; - } - if (message.args != null && message.hasOwnProperty("args")) - object.args = $root.google.protobuf.Struct.toObject(message.args, options); - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - object.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.toObject(message.toolsetTool, options); - if (options.oneofs) - object.toolIdentifier = "toolsetTool"; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - return object; - }; - - /** - * Converts this ExecuteToolRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ExecuteToolRequest - * @instance - * @returns {Object.} JSON object - */ - ExecuteToolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteToolRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ExecuteToolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ExecuteToolRequest"; - }; - - return ExecuteToolRequest; - })(); - - v1.ExecuteToolResponse = (function() { - - /** - * Properties of an ExecuteToolResponse. - * @memberof google.cloud.ces.v1 - * @interface IExecuteToolResponse - * @property {string|null} [tool] ExecuteToolResponse tool - * @property {google.cloud.ces.v1.IToolsetTool|null} [toolsetTool] ExecuteToolResponse toolsetTool - * @property {google.protobuf.IStruct|null} [response] ExecuteToolResponse response - */ - - /** - * Constructs a new ExecuteToolResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents an ExecuteToolResponse. - * @implements IExecuteToolResponse - * @constructor - * @param {google.cloud.ces.v1.IExecuteToolResponse=} [properties] Properties to set - */ - function ExecuteToolResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteToolResponse tool. - * @member {string|null|undefined} tool - * @memberof google.cloud.ces.v1.ExecuteToolResponse - * @instance - */ - ExecuteToolResponse.prototype.tool = null; - - /** - * ExecuteToolResponse toolsetTool. - * @member {google.cloud.ces.v1.IToolsetTool|null|undefined} toolsetTool - * @memberof google.cloud.ces.v1.ExecuteToolResponse - * @instance - */ - ExecuteToolResponse.prototype.toolsetTool = null; - - /** - * ExecuteToolResponse response. - * @member {google.protobuf.IStruct|null|undefined} response - * @memberof google.cloud.ces.v1.ExecuteToolResponse - * @instance - */ - ExecuteToolResponse.prototype.response = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ExecuteToolResponse toolIdentifier. - * @member {"tool"|"toolsetTool"|undefined} toolIdentifier - * @memberof google.cloud.ces.v1.ExecuteToolResponse - * @instance - */ - Object.defineProperty(ExecuteToolResponse.prototype, "toolIdentifier", { - get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExecuteToolResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.ExecuteToolResponse - * @static - * @param {google.cloud.ces.v1.IExecuteToolResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.ExecuteToolResponse} ExecuteToolResponse instance - */ - ExecuteToolResponse.create = function create(properties) { - return new ExecuteToolResponse(properties); - }; - - /** - * Encodes the specified ExecuteToolResponse message. Does not implicitly {@link google.cloud.ces.v1.ExecuteToolResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.ExecuteToolResponse - * @static - * @param {google.cloud.ces.v1.IExecuteToolResponse} message ExecuteToolResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteToolResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Struct.encode(message.response, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) - $root.google.cloud.ces.v1.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExecuteToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.ExecuteToolResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.ExecuteToolResponse - * @static - * @param {google.cloud.ces.v1.IExecuteToolResponse} message ExecuteToolResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteToolResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteToolResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.ExecuteToolResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.ExecuteToolResponse} ExecuteToolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteToolResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.ExecuteToolResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tool = reader.string(); - break; - } - case 3: { - message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.decode(reader, reader.uint32()); - break; - } - case 2: { - message.response = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteToolResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.ExecuteToolResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.ExecuteToolResponse} ExecuteToolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteToolResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteToolResponse message. - * @function verify - * @memberof google.cloud.ces.v1.ExecuteToolResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteToolResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tool != null && message.hasOwnProperty("tool")) { - properties.toolIdentifier = 1; - if (!$util.isString(message.tool)) - return "tool: string expected"; - } - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - if (properties.toolIdentifier === 1) - return "toolIdentifier: multiple values"; - properties.toolIdentifier = 1; - { - var error = $root.google.cloud.ces.v1.ToolsetTool.verify(message.toolsetTool); - if (error) - return "toolsetTool." + error; - } - } - if (message.response != null && message.hasOwnProperty("response")) { - var error = $root.google.protobuf.Struct.verify(message.response); - if (error) - return "response." + error; - } - return null; - }; - - /** - * Creates an ExecuteToolResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.ExecuteToolResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.ExecuteToolResponse} ExecuteToolResponse - */ - ExecuteToolResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.ExecuteToolResponse) - return object; - var message = new $root.google.cloud.ces.v1.ExecuteToolResponse(); - if (object.tool != null) - message.tool = String(object.tool); - if (object.toolsetTool != null) { - if (typeof object.toolsetTool !== "object") - throw TypeError(".google.cloud.ces.v1.ExecuteToolResponse.toolsetTool: object expected"); - message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.fromObject(object.toolsetTool); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.cloud.ces.v1.ExecuteToolResponse.response: object expected"); - message.response = $root.google.protobuf.Struct.fromObject(object.response); - } - return message; - }; - - /** - * Creates a plain object from an ExecuteToolResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.ExecuteToolResponse - * @static - * @param {google.cloud.ces.v1.ExecuteToolResponse} message ExecuteToolResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteToolResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.response = null; - if (message.tool != null && message.hasOwnProperty("tool")) { - object.tool = message.tool; - if (options.oneofs) - object.toolIdentifier = "tool"; - } - if (message.response != null && message.hasOwnProperty("response")) - object.response = $root.google.protobuf.Struct.toObject(message.response, options); - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - object.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.toObject(message.toolsetTool, options); - if (options.oneofs) - object.toolIdentifier = "toolsetTool"; - } - return object; - }; - - /** - * Converts this ExecuteToolResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.ExecuteToolResponse - * @instance - * @returns {Object.} JSON object - */ - ExecuteToolResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteToolResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.ExecuteToolResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteToolResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.ExecuteToolResponse"; - }; - - return ExecuteToolResponse; - })(); - - v1.RetrieveToolSchemaRequest = (function() { - - /** - * Properties of a RetrieveToolSchemaRequest. - * @memberof google.cloud.ces.v1 - * @interface IRetrieveToolSchemaRequest - * @property {string|null} [tool] RetrieveToolSchemaRequest tool - * @property {google.cloud.ces.v1.IToolsetTool|null} [toolsetTool] RetrieveToolSchemaRequest toolsetTool - * @property {string|null} [parent] RetrieveToolSchemaRequest parent - */ - - /** - * Constructs a new RetrieveToolSchemaRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a RetrieveToolSchemaRequest. - * @implements IRetrieveToolSchemaRequest - * @constructor - * @param {google.cloud.ces.v1.IRetrieveToolSchemaRequest=} [properties] Properties to set - */ - function RetrieveToolSchemaRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RetrieveToolSchemaRequest tool. - * @member {string|null|undefined} tool - * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest - * @instance - */ - RetrieveToolSchemaRequest.prototype.tool = null; - - /** - * RetrieveToolSchemaRequest toolsetTool. - * @member {google.cloud.ces.v1.IToolsetTool|null|undefined} toolsetTool - * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest - * @instance - */ - RetrieveToolSchemaRequest.prototype.toolsetTool = null; - - /** - * RetrieveToolSchemaRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest - * @instance - */ - RetrieveToolSchemaRequest.prototype.parent = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RetrieveToolSchemaRequest toolIdentifier. - * @member {"tool"|"toolsetTool"|undefined} toolIdentifier - * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest - * @instance - */ - Object.defineProperty(RetrieveToolSchemaRequest.prototype, "toolIdentifier", { - get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RetrieveToolSchemaRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest - * @static - * @param {google.cloud.ces.v1.IRetrieveToolSchemaRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest instance - */ - RetrieveToolSchemaRequest.create = function create(properties) { - return new RetrieveToolSchemaRequest(properties); - }; - - /** - * Encodes the specified RetrieveToolSchemaRequest message. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolSchemaRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest - * @static - * @param {google.cloud.ces.v1.IRetrieveToolSchemaRequest} message RetrieveToolSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveToolSchemaRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); - if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) - $root.google.cloud.ces.v1.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); - return writer; - }; - - /** - * Encodes the specified RetrieveToolSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolSchemaRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest - * @static - * @param {google.cloud.ces.v1.IRetrieveToolSchemaRequest} message RetrieveToolSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveToolSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveToolSchemaRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RetrieveToolSchemaRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tool = reader.string(); - break; - } - case 2: { - message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.decode(reader, reader.uint32()); - break; - } - case 3: { - message.parent = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveToolSchemaRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RetrieveToolSchemaRequest message. - * @function verify - * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RetrieveToolSchemaRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tool != null && message.hasOwnProperty("tool")) { - properties.toolIdentifier = 1; - if (!$util.isString(message.tool)) - return "tool: string expected"; - } - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - if (properties.toolIdentifier === 1) - return "toolIdentifier: multiple values"; - properties.toolIdentifier = 1; - { - var error = $root.google.cloud.ces.v1.ToolsetTool.verify(message.toolsetTool); - if (error) - return "toolsetTool." + error; - } - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - return null; - }; - - /** - * Creates a RetrieveToolSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest - */ - RetrieveToolSchemaRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.RetrieveToolSchemaRequest) - return object; - var message = new $root.google.cloud.ces.v1.RetrieveToolSchemaRequest(); - if (object.tool != null) - message.tool = String(object.tool); - if (object.toolsetTool != null) { - if (typeof object.toolsetTool !== "object") - throw TypeError(".google.cloud.ces.v1.RetrieveToolSchemaRequest.toolsetTool: object expected"); - message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.fromObject(object.toolsetTool); - } - if (object.parent != null) - message.parent = String(object.parent); - return message; - }; - - /** - * Creates a plain object from a RetrieveToolSchemaRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest - * @static - * @param {google.cloud.ces.v1.RetrieveToolSchemaRequest} message RetrieveToolSchemaRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RetrieveToolSchemaRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.parent = ""; - if (message.tool != null && message.hasOwnProperty("tool")) { - object.tool = message.tool; - if (options.oneofs) - object.toolIdentifier = "tool"; - } - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - object.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.toObject(message.toolsetTool, options); - if (options.oneofs) - object.toolIdentifier = "toolsetTool"; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - return object; - }; - - /** - * Converts this RetrieveToolSchemaRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest - * @instance - * @returns {Object.} JSON object - */ - RetrieveToolSchemaRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RetrieveToolSchemaRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.RetrieveToolSchemaRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RetrieveToolSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.RetrieveToolSchemaRequest"; - }; - - return RetrieveToolSchemaRequest; - })(); - - v1.RetrieveToolSchemaResponse = (function() { - - /** - * Properties of a RetrieveToolSchemaResponse. - * @memberof google.cloud.ces.v1 - * @interface IRetrieveToolSchemaResponse - * @property {string|null} [tool] RetrieveToolSchemaResponse tool - * @property {google.cloud.ces.v1.IToolsetTool|null} [toolsetTool] RetrieveToolSchemaResponse toolsetTool - * @property {google.cloud.ces.v1.ISchema|null} [inputSchema] RetrieveToolSchemaResponse inputSchema - * @property {google.cloud.ces.v1.ISchema|null} [outputSchema] RetrieveToolSchemaResponse outputSchema - */ - - /** - * Constructs a new RetrieveToolSchemaResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a RetrieveToolSchemaResponse. - * @implements IRetrieveToolSchemaResponse - * @constructor - * @param {google.cloud.ces.v1.IRetrieveToolSchemaResponse=} [properties] Properties to set - */ - function RetrieveToolSchemaResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RetrieveToolSchemaResponse tool. - * @member {string|null|undefined} tool - * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse - * @instance - */ - RetrieveToolSchemaResponse.prototype.tool = null; - - /** - * RetrieveToolSchemaResponse toolsetTool. - * @member {google.cloud.ces.v1.IToolsetTool|null|undefined} toolsetTool - * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse - * @instance - */ - RetrieveToolSchemaResponse.prototype.toolsetTool = null; - - /** - * RetrieveToolSchemaResponse inputSchema. - * @member {google.cloud.ces.v1.ISchema|null|undefined} inputSchema - * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse - * @instance - */ - RetrieveToolSchemaResponse.prototype.inputSchema = null; - - /** - * RetrieveToolSchemaResponse outputSchema. - * @member {google.cloud.ces.v1.ISchema|null|undefined} outputSchema - * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse - * @instance - */ - RetrieveToolSchemaResponse.prototype.outputSchema = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RetrieveToolSchemaResponse toolIdentifier. - * @member {"tool"|"toolsetTool"|undefined} toolIdentifier - * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse - * @instance - */ - Object.defineProperty(RetrieveToolSchemaResponse.prototype, "toolIdentifier", { - get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RetrieveToolSchemaResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse - * @static - * @param {google.cloud.ces.v1.IRetrieveToolSchemaResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse instance - */ - RetrieveToolSchemaResponse.create = function create(properties) { - return new RetrieveToolSchemaResponse(properties); - }; - - /** - * Encodes the specified RetrieveToolSchemaResponse message. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolSchemaResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse - * @static - * @param {google.cloud.ces.v1.IRetrieveToolSchemaResponse} message RetrieveToolSchemaResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveToolSchemaResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); - if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) - $root.google.cloud.ces.v1.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.inputSchema != null && Object.hasOwnProperty.call(message, "inputSchema")) - $root.google.cloud.ces.v1.Schema.encode(message.inputSchema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.outputSchema != null && Object.hasOwnProperty.call(message, "outputSchema")) - $root.google.cloud.ces.v1.Schema.encode(message.outputSchema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RetrieveToolSchemaResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolSchemaResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse - * @static - * @param {google.cloud.ces.v1.IRetrieveToolSchemaResponse} message RetrieveToolSchemaResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveToolSchemaResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveToolSchemaResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RetrieveToolSchemaResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tool = reader.string(); - break; - } - case 2: { - message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.decode(reader, reader.uint32()); - break; - } - case 3: { - message.inputSchema = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); - break; - } - case 4: { - message.outputSchema = $root.google.cloud.ces.v1.Schema.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveToolSchemaResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RetrieveToolSchemaResponse message. - * @function verify - * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RetrieveToolSchemaResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tool != null && message.hasOwnProperty("tool")) { - properties.toolIdentifier = 1; - if (!$util.isString(message.tool)) - return "tool: string expected"; - } - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - if (properties.toolIdentifier === 1) - return "toolIdentifier: multiple values"; - properties.toolIdentifier = 1; - { - var error = $root.google.cloud.ces.v1.ToolsetTool.verify(message.toolsetTool); - if (error) - return "toolsetTool." + error; - } - } - if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) { - var error = $root.google.cloud.ces.v1.Schema.verify(message.inputSchema); - if (error) - return "inputSchema." + error; - } - if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) { - var error = $root.google.cloud.ces.v1.Schema.verify(message.outputSchema); - if (error) - return "outputSchema." + error; - } - return null; - }; - - /** - * Creates a RetrieveToolSchemaResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse - */ - RetrieveToolSchemaResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.RetrieveToolSchemaResponse) - return object; - var message = new $root.google.cloud.ces.v1.RetrieveToolSchemaResponse(); - if (object.tool != null) - message.tool = String(object.tool); - if (object.toolsetTool != null) { - if (typeof object.toolsetTool !== "object") - throw TypeError(".google.cloud.ces.v1.RetrieveToolSchemaResponse.toolsetTool: object expected"); - message.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.fromObject(object.toolsetTool); - } - if (object.inputSchema != null) { - if (typeof object.inputSchema !== "object") - throw TypeError(".google.cloud.ces.v1.RetrieveToolSchemaResponse.inputSchema: object expected"); - message.inputSchema = $root.google.cloud.ces.v1.Schema.fromObject(object.inputSchema); - } - if (object.outputSchema != null) { - if (typeof object.outputSchema !== "object") - throw TypeError(".google.cloud.ces.v1.RetrieveToolSchemaResponse.outputSchema: object expected"); - message.outputSchema = $root.google.cloud.ces.v1.Schema.fromObject(object.outputSchema); - } - return message; - }; - - /** - * Creates a plain object from a RetrieveToolSchemaResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse - * @static - * @param {google.cloud.ces.v1.RetrieveToolSchemaResponse} message RetrieveToolSchemaResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RetrieveToolSchemaResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.inputSchema = null; - object.outputSchema = null; - } - if (message.tool != null && message.hasOwnProperty("tool")) { - object.tool = message.tool; - if (options.oneofs) - object.toolIdentifier = "tool"; - } - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - object.toolsetTool = $root.google.cloud.ces.v1.ToolsetTool.toObject(message.toolsetTool, options); - if (options.oneofs) - object.toolIdentifier = "toolsetTool"; - } - if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) - object.inputSchema = $root.google.cloud.ces.v1.Schema.toObject(message.inputSchema, options); - if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) - object.outputSchema = $root.google.cloud.ces.v1.Schema.toObject(message.outputSchema, options); - return object; - }; - - /** - * Converts this RetrieveToolSchemaResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse - * @instance - * @returns {Object.} JSON object - */ - RetrieveToolSchemaResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RetrieveToolSchemaResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.RetrieveToolSchemaResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RetrieveToolSchemaResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.RetrieveToolSchemaResponse"; - }; - - return RetrieveToolSchemaResponse; - })(); - - v1.RetrieveToolsRequest = (function() { - - /** - * Properties of a RetrieveToolsRequest. - * @memberof google.cloud.ces.v1 - * @interface IRetrieveToolsRequest - * @property {string|null} [toolset] RetrieveToolsRequest toolset - * @property {Array.|null} [toolIds] RetrieveToolsRequest toolIds - */ - - /** - * Constructs a new RetrieveToolsRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a RetrieveToolsRequest. - * @implements IRetrieveToolsRequest - * @constructor - * @param {google.cloud.ces.v1.IRetrieveToolsRequest=} [properties] Properties to set - */ - function RetrieveToolsRequest(properties) { - this.toolIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RetrieveToolsRequest toolset. - * @member {string} toolset - * @memberof google.cloud.ces.v1.RetrieveToolsRequest - * @instance - */ - RetrieveToolsRequest.prototype.toolset = ""; - - /** - * RetrieveToolsRequest toolIds. - * @member {Array.} toolIds - * @memberof google.cloud.ces.v1.RetrieveToolsRequest - * @instance - */ - RetrieveToolsRequest.prototype.toolIds = $util.emptyArray; - - /** - * Creates a new RetrieveToolsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.RetrieveToolsRequest - * @static - * @param {google.cloud.ces.v1.IRetrieveToolsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.RetrieveToolsRequest} RetrieveToolsRequest instance - */ - RetrieveToolsRequest.create = function create(properties) { - return new RetrieveToolsRequest(properties); - }; - - /** - * Encodes the specified RetrieveToolsRequest message. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.RetrieveToolsRequest - * @static - * @param {google.cloud.ces.v1.IRetrieveToolsRequest} message RetrieveToolsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveToolsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.toolset); - if (message.toolIds != null && message.toolIds.length) - for (var i = 0; i < message.toolIds.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.toolIds[i]); - return writer; - }; - - /** - * Encodes the specified RetrieveToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.RetrieveToolsRequest - * @static - * @param {google.cloud.ces.v1.IRetrieveToolsRequest} message RetrieveToolsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveToolsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RetrieveToolsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.RetrieveToolsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.RetrieveToolsRequest} RetrieveToolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveToolsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RetrieveToolsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.toolset = reader.string(); - break; - } - case 3: { - if (!(message.toolIds && message.toolIds.length)) - message.toolIds = []; - message.toolIds.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RetrieveToolsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.RetrieveToolsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.RetrieveToolsRequest} RetrieveToolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveToolsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RetrieveToolsRequest message. - * @function verify - * @memberof google.cloud.ces.v1.RetrieveToolsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RetrieveToolsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.toolset != null && message.hasOwnProperty("toolset")) - if (!$util.isString(message.toolset)) - return "toolset: string expected"; - if (message.toolIds != null && message.hasOwnProperty("toolIds")) { - if (!Array.isArray(message.toolIds)) - return "toolIds: array expected"; - for (var i = 0; i < message.toolIds.length; ++i) - if (!$util.isString(message.toolIds[i])) - return "toolIds: string[] expected"; - } - return null; - }; - - /** - * Creates a RetrieveToolsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.RetrieveToolsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.RetrieveToolsRequest} RetrieveToolsRequest - */ - RetrieveToolsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.RetrieveToolsRequest) - return object; - var message = new $root.google.cloud.ces.v1.RetrieveToolsRequest(); - if (object.toolset != null) - message.toolset = String(object.toolset); - if (object.toolIds) { - if (!Array.isArray(object.toolIds)) - throw TypeError(".google.cloud.ces.v1.RetrieveToolsRequest.toolIds: array expected"); - message.toolIds = []; - for (var i = 0; i < object.toolIds.length; ++i) - message.toolIds[i] = String(object.toolIds[i]); - } - return message; - }; - - /** - * Creates a plain object from a RetrieveToolsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.RetrieveToolsRequest - * @static - * @param {google.cloud.ces.v1.RetrieveToolsRequest} message RetrieveToolsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RetrieveToolsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.toolIds = []; - if (options.defaults) - object.toolset = ""; - if (message.toolset != null && message.hasOwnProperty("toolset")) - object.toolset = message.toolset; - if (message.toolIds && message.toolIds.length) { - object.toolIds = []; - for (var j = 0; j < message.toolIds.length; ++j) - object.toolIds[j] = message.toolIds[j]; - } - return object; - }; - - /** - * Converts this RetrieveToolsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.RetrieveToolsRequest - * @instance - * @returns {Object.} JSON object - */ - RetrieveToolsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RetrieveToolsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.RetrieveToolsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RetrieveToolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.RetrieveToolsRequest"; - }; - - return RetrieveToolsRequest; - })(); - - v1.RetrieveToolsResponse = (function() { - - /** - * Properties of a RetrieveToolsResponse. - * @memberof google.cloud.ces.v1 - * @interface IRetrieveToolsResponse - * @property {Array.|null} [tools] RetrieveToolsResponse tools - */ - - /** - * Constructs a new RetrieveToolsResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a RetrieveToolsResponse. - * @implements IRetrieveToolsResponse - * @constructor - * @param {google.cloud.ces.v1.IRetrieveToolsResponse=} [properties] Properties to set - */ - function RetrieveToolsResponse(properties) { - this.tools = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RetrieveToolsResponse tools. - * @member {Array.} tools - * @memberof google.cloud.ces.v1.RetrieveToolsResponse - * @instance - */ - RetrieveToolsResponse.prototype.tools = $util.emptyArray; - - /** - * Creates a new RetrieveToolsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.RetrieveToolsResponse - * @static - * @param {google.cloud.ces.v1.IRetrieveToolsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.RetrieveToolsResponse} RetrieveToolsResponse instance - */ - RetrieveToolsResponse.create = function create(properties) { - return new RetrieveToolsResponse(properties); - }; - - /** - * Encodes the specified RetrieveToolsResponse message. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.RetrieveToolsResponse - * @static - * @param {google.cloud.ces.v1.IRetrieveToolsResponse} message RetrieveToolsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveToolsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tools != null && message.tools.length) - for (var i = 0; i < message.tools.length; ++i) - $root.google.cloud.ces.v1.Tool.encode(message.tools[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RetrieveToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.RetrieveToolsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.RetrieveToolsResponse - * @static - * @param {google.cloud.ces.v1.IRetrieveToolsResponse} message RetrieveToolsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveToolsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RetrieveToolsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.RetrieveToolsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.RetrieveToolsResponse} RetrieveToolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveToolsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.RetrieveToolsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.tools && message.tools.length)) - message.tools = []; - message.tools.push($root.google.cloud.ces.v1.Tool.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RetrieveToolsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.RetrieveToolsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.RetrieveToolsResponse} RetrieveToolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveToolsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RetrieveToolsResponse message. - * @function verify - * @memberof google.cloud.ces.v1.RetrieveToolsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RetrieveToolsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tools != null && message.hasOwnProperty("tools")) { - if (!Array.isArray(message.tools)) - return "tools: array expected"; - for (var i = 0; i < message.tools.length; ++i) { - var error = $root.google.cloud.ces.v1.Tool.verify(message.tools[i]); - if (error) - return "tools." + error; - } - } - return null; - }; - - /** - * Creates a RetrieveToolsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.RetrieveToolsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.RetrieveToolsResponse} RetrieveToolsResponse - */ - RetrieveToolsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.RetrieveToolsResponse) - return object; - var message = new $root.google.cloud.ces.v1.RetrieveToolsResponse(); - if (object.tools) { - if (!Array.isArray(object.tools)) - throw TypeError(".google.cloud.ces.v1.RetrieveToolsResponse.tools: array expected"); - message.tools = []; - for (var i = 0; i < object.tools.length; ++i) { - if (typeof object.tools[i] !== "object") - throw TypeError(".google.cloud.ces.v1.RetrieveToolsResponse.tools: object expected"); - message.tools[i] = $root.google.cloud.ces.v1.Tool.fromObject(object.tools[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RetrieveToolsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.RetrieveToolsResponse - * @static - * @param {google.cloud.ces.v1.RetrieveToolsResponse} message RetrieveToolsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RetrieveToolsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tools = []; - if (message.tools && message.tools.length) { - object.tools = []; - for (var j = 0; j < message.tools.length; ++j) - object.tools[j] = $root.google.cloud.ces.v1.Tool.toObject(message.tools[j], options); - } - return object; - }; - - /** - * Converts this RetrieveToolsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.RetrieveToolsResponse - * @instance - * @returns {Object.} JSON object - */ - RetrieveToolsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RetrieveToolsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.RetrieveToolsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RetrieveToolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.RetrieveToolsResponse"; - }; - - return RetrieveToolsResponse; - })(); - - v1.WidgetService = (function() { - - /** - * Constructs a new WidgetService service. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a WidgetService - * @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 WidgetService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (WidgetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WidgetService; - - /** - * Creates new WidgetService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.ces.v1.WidgetService - * @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 {WidgetService} RPC service. Useful where requests and/or responses are streamed. - */ - WidgetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.ces.v1.WidgetService|generateChatToken}. - * @memberof google.cloud.ces.v1.WidgetService - * @typedef GenerateChatTokenCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1.GenerateChatTokenResponse} [response] GenerateChatTokenResponse - */ - - /** - * Calls GenerateChatToken. - * @function generateChatToken - * @memberof google.cloud.ces.v1.WidgetService - * @instance - * @param {google.cloud.ces.v1.IGenerateChatTokenRequest} request GenerateChatTokenRequest message or plain object - * @param {google.cloud.ces.v1.WidgetService.GenerateChatTokenCallback} callback Node-style callback called with the error, if any, and GenerateChatTokenResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WidgetService.prototype.generateChatToken = function generateChatToken(request, callback) { - return this.rpcCall(generateChatToken, $root.google.cloud.ces.v1.GenerateChatTokenRequest, $root.google.cloud.ces.v1.GenerateChatTokenResponse, request, callback); - }, "name", { value: "GenerateChatToken" }); - - /** - * Calls GenerateChatToken. - * @function generateChatToken - * @memberof google.cloud.ces.v1.WidgetService - * @instance - * @param {google.cloud.ces.v1.IGenerateChatTokenRequest} request GenerateChatTokenRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return WidgetService; - })(); - - v1.GenerateChatTokenRequest = (function() { - - /** - * Properties of a GenerateChatTokenRequest. - * @memberof google.cloud.ces.v1 - * @interface IGenerateChatTokenRequest - * @property {string|null} [name] GenerateChatTokenRequest name - * @property {string|null} [deployment] GenerateChatTokenRequest deployment - * @property {string|null} [recaptchaToken] GenerateChatTokenRequest recaptchaToken - */ - - /** - * Constructs a new GenerateChatTokenRequest. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a GenerateChatTokenRequest. - * @implements IGenerateChatTokenRequest - * @constructor - * @param {google.cloud.ces.v1.IGenerateChatTokenRequest=} [properties] Properties to set - */ - function GenerateChatTokenRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenerateChatTokenRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1.GenerateChatTokenRequest - * @instance - */ - GenerateChatTokenRequest.prototype.name = ""; - - /** - * GenerateChatTokenRequest deployment. - * @member {string} deployment - * @memberof google.cloud.ces.v1.GenerateChatTokenRequest - * @instance - */ - GenerateChatTokenRequest.prototype.deployment = ""; - - /** - * GenerateChatTokenRequest recaptchaToken. - * @member {string} recaptchaToken - * @memberof google.cloud.ces.v1.GenerateChatTokenRequest - * @instance - */ - GenerateChatTokenRequest.prototype.recaptchaToken = ""; - - /** - * Creates a new GenerateChatTokenRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.GenerateChatTokenRequest - * @static - * @param {google.cloud.ces.v1.IGenerateChatTokenRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1.GenerateChatTokenRequest} GenerateChatTokenRequest instance - */ - GenerateChatTokenRequest.create = function create(properties) { - return new GenerateChatTokenRequest(properties); - }; - - /** - * Encodes the specified GenerateChatTokenRequest message. Does not implicitly {@link google.cloud.ces.v1.GenerateChatTokenRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.GenerateChatTokenRequest - * @static - * @param {google.cloud.ces.v1.IGenerateChatTokenRequest} message GenerateChatTokenRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateChatTokenRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.deployment); - if (message.recaptchaToken != null && Object.hasOwnProperty.call(message, "recaptchaToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.recaptchaToken); - return writer; - }; - - /** - * Encodes the specified GenerateChatTokenRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GenerateChatTokenRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.GenerateChatTokenRequest - * @static - * @param {google.cloud.ces.v1.IGenerateChatTokenRequest} message GenerateChatTokenRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateChatTokenRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenerateChatTokenRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.GenerateChatTokenRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.GenerateChatTokenRequest} GenerateChatTokenRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateChatTokenRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GenerateChatTokenRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.deployment = reader.string(); - break; - } - case 3: { - message.recaptchaToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenerateChatTokenRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.GenerateChatTokenRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.GenerateChatTokenRequest} GenerateChatTokenRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateChatTokenRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenerateChatTokenRequest message. - * @function verify - * @memberof google.cloud.ces.v1.GenerateChatTokenRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenerateChatTokenRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.deployment != null && message.hasOwnProperty("deployment")) - if (!$util.isString(message.deployment)) - return "deployment: string expected"; - if (message.recaptchaToken != null && message.hasOwnProperty("recaptchaToken")) - if (!$util.isString(message.recaptchaToken)) - return "recaptchaToken: string expected"; - return null; - }; - - /** - * Creates a GenerateChatTokenRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.GenerateChatTokenRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.GenerateChatTokenRequest} GenerateChatTokenRequest - */ - GenerateChatTokenRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.GenerateChatTokenRequest) - return object; - var message = new $root.google.cloud.ces.v1.GenerateChatTokenRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.deployment != null) - message.deployment = String(object.deployment); - if (object.recaptchaToken != null) - message.recaptchaToken = String(object.recaptchaToken); - return message; - }; - - /** - * Creates a plain object from a GenerateChatTokenRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.GenerateChatTokenRequest - * @static - * @param {google.cloud.ces.v1.GenerateChatTokenRequest} message GenerateChatTokenRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenerateChatTokenRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.deployment = ""; - object.recaptchaToken = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.deployment != null && message.hasOwnProperty("deployment")) - object.deployment = message.deployment; - if (message.recaptchaToken != null && message.hasOwnProperty("recaptchaToken")) - object.recaptchaToken = message.recaptchaToken; - return object; - }; - - /** - * Converts this GenerateChatTokenRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.GenerateChatTokenRequest - * @instance - * @returns {Object.} JSON object - */ - GenerateChatTokenRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenerateChatTokenRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1.GenerateChatTokenRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenerateChatTokenRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.GenerateChatTokenRequest"; - }; - - return GenerateChatTokenRequest; - })(); - - v1.GenerateChatTokenResponse = (function() { - - /** - * Properties of a GenerateChatTokenResponse. - * @memberof google.cloud.ces.v1 - * @interface IGenerateChatTokenResponse - * @property {string|null} [chatToken] GenerateChatTokenResponse chatToken - * @property {google.protobuf.ITimestamp|null} [expireTime] GenerateChatTokenResponse expireTime - */ - - /** - * Constructs a new GenerateChatTokenResponse. - * @memberof google.cloud.ces.v1 - * @classdesc Represents a GenerateChatTokenResponse. - * @implements IGenerateChatTokenResponse - * @constructor - * @param {google.cloud.ces.v1.IGenerateChatTokenResponse=} [properties] Properties to set - */ - function GenerateChatTokenResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenerateChatTokenResponse chatToken. - * @member {string} chatToken - * @memberof google.cloud.ces.v1.GenerateChatTokenResponse - * @instance - */ - GenerateChatTokenResponse.prototype.chatToken = ""; - - /** - * GenerateChatTokenResponse expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.ces.v1.GenerateChatTokenResponse - * @instance - */ - GenerateChatTokenResponse.prototype.expireTime = null; - - /** - * Creates a new GenerateChatTokenResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1.GenerateChatTokenResponse - * @static - * @param {google.cloud.ces.v1.IGenerateChatTokenResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1.GenerateChatTokenResponse} GenerateChatTokenResponse instance - */ - GenerateChatTokenResponse.create = function create(properties) { - return new GenerateChatTokenResponse(properties); - }; - - /** - * Encodes the specified GenerateChatTokenResponse message. Does not implicitly {@link google.cloud.ces.v1.GenerateChatTokenResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1.GenerateChatTokenResponse - * @static - * @param {google.cloud.ces.v1.IGenerateChatTokenResponse} message GenerateChatTokenResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateChatTokenResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.chatToken != null && Object.hasOwnProperty.call(message, "chatToken")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.chatToken); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenerateChatTokenResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1.GenerateChatTokenResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1.GenerateChatTokenResponse - * @static - * @param {google.cloud.ces.v1.IGenerateChatTokenResponse} message GenerateChatTokenResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateChatTokenResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenerateChatTokenResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1.GenerateChatTokenResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1.GenerateChatTokenResponse} GenerateChatTokenResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateChatTokenResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1.GenerateChatTokenResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.chatToken = reader.string(); - break; - } - case 2: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenerateChatTokenResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1.GenerateChatTokenResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1.GenerateChatTokenResponse} GenerateChatTokenResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateChatTokenResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenerateChatTokenResponse message. - * @function verify - * @memberof google.cloud.ces.v1.GenerateChatTokenResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenerateChatTokenResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.chatToken != null && message.hasOwnProperty("chatToken")) - if (!$util.isString(message.chatToken)) - return "chatToken: string expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - return null; - }; - - /** - * Creates a GenerateChatTokenResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1.GenerateChatTokenResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1.GenerateChatTokenResponse} GenerateChatTokenResponse - */ - GenerateChatTokenResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1.GenerateChatTokenResponse) - return object; - var message = new $root.google.cloud.ces.v1.GenerateChatTokenResponse(); - if (object.chatToken != null) - message.chatToken = String(object.chatToken); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.ces.v1.GenerateChatTokenResponse.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - return message; - }; - - /** - * Creates a plain object from a GenerateChatTokenResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1.GenerateChatTokenResponse - * @static - * @param {google.cloud.ces.v1.GenerateChatTokenResponse} message GenerateChatTokenResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenerateChatTokenResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.chatToken = ""; - object.expireTime = null; - } - if (message.chatToken != null && message.hasOwnProperty("chatToken")) - object.chatToken = message.chatToken; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - return object; - }; - - /** - * Converts this GenerateChatTokenResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1.GenerateChatTokenResponse - * @instance - * @returns {Object.} JSON object - */ - GenerateChatTokenResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenerateChatTokenResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1.GenerateChatTokenResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenerateChatTokenResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1.GenerateChatTokenResponse"; - }; - - return GenerateChatTokenResponse; - })(); - - return v1; - })(); - - ces.v1beta = (function() { - - /** - * Namespace v1beta. - * @memberof google.cloud.ces - * @namespace - */ - var v1beta = {}; - - v1beta.Agent = (function() { - - /** - * Properties of an Agent. - * @memberof google.cloud.ces.v1beta - * @interface IAgent - * @property {google.cloud.ces.v1beta.Agent.ILlmAgent|null} [llmAgent] Agent llmAgent - * @property {google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent|null} [remoteDialogflowAgent] Agent remoteDialogflowAgent - * @property {string|null} [name] Agent name - * @property {string|null} [displayName] Agent displayName - * @property {string|null} [description] Agent description - * @property {google.cloud.ces.v1beta.IModelSettings|null} [modelSettings] Agent modelSettings - * @property {string|null} [instruction] Agent instruction - * @property {Array.|null} [tools] Agent tools - * @property {Array.|null} [childAgents] Agent childAgents - * @property {Array.|null} [beforeAgentCallbacks] Agent beforeAgentCallbacks - * @property {Array.|null} [afterAgentCallbacks] Agent afterAgentCallbacks - * @property {Array.|null} [beforeModelCallbacks] Agent beforeModelCallbacks - * @property {Array.|null} [afterModelCallbacks] Agent afterModelCallbacks - * @property {Array.|null} [beforeToolCallbacks] Agent beforeToolCallbacks - * @property {Array.|null} [afterToolCallbacks] Agent afterToolCallbacks - * @property {google.protobuf.ITimestamp|null} [createTime] Agent createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Agent updateTime - * @property {Array.|null} [guardrails] Agent guardrails - * @property {string|null} [etag] Agent etag - * @property {Array.|null} [toolsets] Agent toolsets - * @property {string|null} [generatedSummary] Agent generatedSummary - * @property {Array.|null} [transferRules] Agent transferRules - */ - - /** - * Constructs a new Agent. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an Agent. - * @implements IAgent - * @constructor - * @param {google.cloud.ces.v1beta.IAgent=} [properties] Properties to set - */ - function Agent(properties) { - this.tools = []; - this.childAgents = []; - this.beforeAgentCallbacks = []; - this.afterAgentCallbacks = []; - this.beforeModelCallbacks = []; - this.afterModelCallbacks = []; - this.beforeToolCallbacks = []; - this.afterToolCallbacks = []; - this.guardrails = []; - this.toolsets = []; - this.transferRules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Agent llmAgent. - * @member {google.cloud.ces.v1beta.Agent.ILlmAgent|null|undefined} llmAgent - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.llmAgent = null; - - /** - * Agent remoteDialogflowAgent. - * @member {google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent|null|undefined} remoteDialogflowAgent - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.remoteDialogflowAgent = null; - - /** - * Agent name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.name = ""; - - /** - * Agent displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.displayName = ""; - - /** - * Agent description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.description = ""; - - /** - * Agent modelSettings. - * @member {google.cloud.ces.v1beta.IModelSettings|null|undefined} modelSettings - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.modelSettings = null; - - /** - * Agent instruction. - * @member {string} instruction - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.instruction = ""; - - /** - * Agent tools. - * @member {Array.} tools - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.tools = $util.emptyArray; - - /** - * Agent childAgents. - * @member {Array.} childAgents - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.childAgents = $util.emptyArray; - - /** - * Agent beforeAgentCallbacks. - * @member {Array.} beforeAgentCallbacks - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.beforeAgentCallbacks = $util.emptyArray; - - /** - * Agent afterAgentCallbacks. - * @member {Array.} afterAgentCallbacks - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.afterAgentCallbacks = $util.emptyArray; - - /** - * Agent beforeModelCallbacks. - * @member {Array.} beforeModelCallbacks - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.beforeModelCallbacks = $util.emptyArray; - - /** - * Agent afterModelCallbacks. - * @member {Array.} afterModelCallbacks - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.afterModelCallbacks = $util.emptyArray; - - /** - * Agent beforeToolCallbacks. - * @member {Array.} beforeToolCallbacks - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.beforeToolCallbacks = $util.emptyArray; - - /** - * Agent afterToolCallbacks. - * @member {Array.} afterToolCallbacks - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.afterToolCallbacks = $util.emptyArray; - - /** - * Agent createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.createTime = null; - - /** - * Agent updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.updateTime = null; - - /** - * Agent guardrails. - * @member {Array.} guardrails - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.guardrails = $util.emptyArray; - - /** - * Agent etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.etag = ""; - - /** - * Agent toolsets. - * @member {Array.} toolsets - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.toolsets = $util.emptyArray; - - /** - * Agent generatedSummary. - * @member {string} generatedSummary - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.generatedSummary = ""; - - /** - * Agent transferRules. - * @member {Array.} transferRules - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Agent.prototype.transferRules = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Agent agentType. - * @member {"llmAgent"|"remoteDialogflowAgent"|undefined} agentType - * @memberof google.cloud.ces.v1beta.Agent - * @instance - */ - Object.defineProperty(Agent.prototype, "agentType", { - get: $util.oneOfGetter($oneOfFields = ["llmAgent", "remoteDialogflowAgent"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Agent instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Agent - * @static - * @param {google.cloud.ces.v1beta.IAgent=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Agent} Agent instance - */ - Agent.create = function create(properties) { - return new Agent(properties); - }; - - /** - * Encodes the specified Agent message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Agent - * @static - * @param {google.cloud.ces.v1beta.IAgent} message Agent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Agent.encode = function encode(message, writer) { - if (!writer) - 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.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) - $root.google.cloud.ces.v1beta.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.instruction != null && Object.hasOwnProperty.call(message, "instruction")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.instruction); - if (message.tools != null && message.tools.length) - for (var i = 0; i < message.tools.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.tools[i]); - if (message.childAgents != null && message.childAgents.length) - for (var i = 0; i < message.childAgents.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.childAgents[i]); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.guardrails != null && message.guardrails.length) - for (var i = 0; i < message.guardrails.length; ++i) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.guardrails[i]); - if (message.beforeAgentCallbacks != null && message.beforeAgentCallbacks.length) - for (var i = 0; i < message.beforeAgentCallbacks.length; ++i) - $root.google.cloud.ces.v1beta.Callback.encode(message.beforeAgentCallbacks[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.afterAgentCallbacks != null && message.afterAgentCallbacks.length) - for (var i = 0; i < message.afterAgentCallbacks.length; ++i) - $root.google.cloud.ces.v1beta.Callback.encode(message.afterAgentCallbacks[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.beforeModelCallbacks != null && message.beforeModelCallbacks.length) - for (var i = 0; i < message.beforeModelCallbacks.length; ++i) - $root.google.cloud.ces.v1beta.Callback.encode(message.beforeModelCallbacks[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.afterModelCallbacks != null && message.afterModelCallbacks.length) - for (var i = 0; i < message.afterModelCallbacks.length; ++i) - $root.google.cloud.ces.v1beta.Callback.encode(message.afterModelCallbacks[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.beforeToolCallbacks != null && message.beforeToolCallbacks.length) - for (var i = 0; i < message.beforeToolCallbacks.length; ++i) - $root.google.cloud.ces.v1beta.Callback.encode(message.beforeToolCallbacks[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.afterToolCallbacks != null && message.afterToolCallbacks.length) - for (var i = 0; i < message.afterToolCallbacks.length; ++i) - $root.google.cloud.ces.v1beta.Callback.encode(message.afterToolCallbacks[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 24, wireType 2 =*/194).string(message.etag); - if (message.llmAgent != null && Object.hasOwnProperty.call(message, "llmAgent")) - $root.google.cloud.ces.v1beta.Agent.LlmAgent.encode(message.llmAgent, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.remoteDialogflowAgent != null && Object.hasOwnProperty.call(message, "remoteDialogflowAgent")) - $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.encode(message.remoteDialogflowAgent, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.toolsets != null && message.toolsets.length) - for (var i = 0; i < message.toolsets.length; ++i) - $root.google.cloud.ces.v1beta.Agent.AgentToolset.encode(message.toolsets[i], writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - if (message.generatedSummary != null && Object.hasOwnProperty.call(message, "generatedSummary")) - writer.uint32(/* id 29, wireType 2 =*/234).string(message.generatedSummary); - if (message.transferRules != null && message.transferRules.length) - for (var i = 0; i < message.transferRules.length; ++i) - $root.google.cloud.ces.v1beta.TransferRule.encode(message.transferRules[i], writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Agent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Agent - * @static - * @param {google.cloud.ces.v1beta.IAgent} message Agent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Agent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Agent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Agent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Agent} Agent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Agent.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Agent(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 26: { - message.llmAgent = $root.google.cloud.ces.v1beta.Agent.LlmAgent.decode(reader, reader.uint32()); - break; - } - case 27: { - message.remoteDialogflowAgent = $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.decode(reader, reader.uint32()); - break; - } - case 6: { - message.instruction = reader.string(); - break; - } - case 7: { - if (!(message.tools && message.tools.length)) - message.tools = []; - message.tools.push(reader.string()); - break; - } - case 8: { - if (!(message.childAgents && message.childAgents.length)) - message.childAgents = []; - message.childAgents.push(reader.string()); - break; - } - case 18: { - if (!(message.beforeAgentCallbacks && message.beforeAgentCallbacks.length)) - message.beforeAgentCallbacks = []; - message.beforeAgentCallbacks.push($root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32())); - break; - } - case 19: { - if (!(message.afterAgentCallbacks && message.afterAgentCallbacks.length)) - message.afterAgentCallbacks = []; - message.afterAgentCallbacks.push($root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32())); - break; - } - case 20: { - if (!(message.beforeModelCallbacks && message.beforeModelCallbacks.length)) - message.beforeModelCallbacks = []; - message.beforeModelCallbacks.push($root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32())); - break; - } - case 21: { - if (!(message.afterModelCallbacks && message.afterModelCallbacks.length)) - message.afterModelCallbacks = []; - message.afterModelCallbacks.push($root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32())); - break; - } - case 22: { - if (!(message.beforeToolCallbacks && message.beforeToolCallbacks.length)) - message.beforeToolCallbacks = []; - message.beforeToolCallbacks.push($root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32())); - break; - } - case 23: { - if (!(message.afterToolCallbacks && message.afterToolCallbacks.length)) - message.afterToolCallbacks = []; - message.afterToolCallbacks.push($root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32())); - break; - } - case 15: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 16: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 17: { - if (!(message.guardrails && message.guardrails.length)) - message.guardrails = []; - message.guardrails.push(reader.string()); - break; - } - case 24: { - message.etag = reader.string(); - break; - } - case 28: { - if (!(message.toolsets && message.toolsets.length)) - message.toolsets = []; - message.toolsets.push($root.google.cloud.ces.v1beta.Agent.AgentToolset.decode(reader, reader.uint32())); - break; - } - case 29: { - message.generatedSummary = reader.string(); - break; - } - case 30: { - if (!(message.transferRules && message.transferRules.length)) - message.transferRules = []; - message.transferRules.push($root.google.cloud.ces.v1beta.TransferRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Agent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Agent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Agent} Agent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Agent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Agent message. - * @function verify - * @memberof google.cloud.ces.v1beta.Agent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Agent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.llmAgent != null && message.hasOwnProperty("llmAgent")) { - properties.agentType = 1; - { - var error = $root.google.cloud.ces.v1beta.Agent.LlmAgent.verify(message.llmAgent); - if (error) - return "llmAgent." + error; - } - } - if (message.remoteDialogflowAgent != null && message.hasOwnProperty("remoteDialogflowAgent")) { - if (properties.agentType === 1) - return "agentType: multiple values"; - properties.agentType = 1; - { - var error = $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.verify(message.remoteDialogflowAgent); - if (error) - return "remoteDialogflowAgent." + 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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { - var error = $root.google.cloud.ces.v1beta.ModelSettings.verify(message.modelSettings); - if (error) - return "modelSettings." + error; - } - if (message.instruction != null && message.hasOwnProperty("instruction")) - if (!$util.isString(message.instruction)) - return "instruction: string expected"; - if (message.tools != null && message.hasOwnProperty("tools")) { - if (!Array.isArray(message.tools)) - return "tools: array expected"; - for (var i = 0; i < message.tools.length; ++i) - if (!$util.isString(message.tools[i])) - return "tools: string[] expected"; - } - if (message.childAgents != null && message.hasOwnProperty("childAgents")) { - if (!Array.isArray(message.childAgents)) - return "childAgents: array expected"; - for (var i = 0; i < message.childAgents.length; ++i) - if (!$util.isString(message.childAgents[i])) - return "childAgents: string[] expected"; - } - if (message.beforeAgentCallbacks != null && message.hasOwnProperty("beforeAgentCallbacks")) { - if (!Array.isArray(message.beforeAgentCallbacks)) - return "beforeAgentCallbacks: array expected"; - for (var i = 0; i < message.beforeAgentCallbacks.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Callback.verify(message.beforeAgentCallbacks[i]); - if (error) - return "beforeAgentCallbacks." + error; - } - } - if (message.afterAgentCallbacks != null && message.hasOwnProperty("afterAgentCallbacks")) { - if (!Array.isArray(message.afterAgentCallbacks)) - return "afterAgentCallbacks: array expected"; - for (var i = 0; i < message.afterAgentCallbacks.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Callback.verify(message.afterAgentCallbacks[i]); - if (error) - return "afterAgentCallbacks." + error; - } - } - if (message.beforeModelCallbacks != null && message.hasOwnProperty("beforeModelCallbacks")) { - if (!Array.isArray(message.beforeModelCallbacks)) - return "beforeModelCallbacks: array expected"; - for (var i = 0; i < message.beforeModelCallbacks.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Callback.verify(message.beforeModelCallbacks[i]); - if (error) - return "beforeModelCallbacks." + error; - } - } - if (message.afterModelCallbacks != null && message.hasOwnProperty("afterModelCallbacks")) { - if (!Array.isArray(message.afterModelCallbacks)) - return "afterModelCallbacks: array expected"; - for (var i = 0; i < message.afterModelCallbacks.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Callback.verify(message.afterModelCallbacks[i]); - if (error) - return "afterModelCallbacks." + error; - } - } - if (message.beforeToolCallbacks != null && message.hasOwnProperty("beforeToolCallbacks")) { - if (!Array.isArray(message.beforeToolCallbacks)) - return "beforeToolCallbacks: array expected"; - for (var i = 0; i < message.beforeToolCallbacks.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Callback.verify(message.beforeToolCallbacks[i]); - if (error) - return "beforeToolCallbacks." + error; - } - } - if (message.afterToolCallbacks != null && message.hasOwnProperty("afterToolCallbacks")) { - if (!Array.isArray(message.afterToolCallbacks)) - return "afterToolCallbacks: array expected"; - for (var i = 0; i < message.afterToolCallbacks.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Callback.verify(message.afterToolCallbacks[i]); - if (error) - return "afterToolCallbacks." + error; - } - } - 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.guardrails != null && message.hasOwnProperty("guardrails")) { - if (!Array.isArray(message.guardrails)) - return "guardrails: array expected"; - for (var i = 0; i < message.guardrails.length; ++i) - if (!$util.isString(message.guardrails[i])) - return "guardrails: string[] expected"; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.toolsets != null && message.hasOwnProperty("toolsets")) { - if (!Array.isArray(message.toolsets)) - return "toolsets: array expected"; - for (var i = 0; i < message.toolsets.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Agent.AgentToolset.verify(message.toolsets[i]); - if (error) - return "toolsets." + error; - } - } - if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) - if (!$util.isString(message.generatedSummary)) - return "generatedSummary: string expected"; - if (message.transferRules != null && message.hasOwnProperty("transferRules")) { - if (!Array.isArray(message.transferRules)) - return "transferRules: array expected"; - for (var i = 0; i < message.transferRules.length; ++i) { - var error = $root.google.cloud.ces.v1beta.TransferRule.verify(message.transferRules[i]); - if (error) - return "transferRules." + error; - } - } - return null; - }; - - /** - * Creates an Agent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Agent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Agent} Agent - */ - Agent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Agent) - return object; - var message = new $root.google.cloud.ces.v1beta.Agent(); - if (object.llmAgent != null) { - if (typeof object.llmAgent !== "object") - throw TypeError(".google.cloud.ces.v1beta.Agent.llmAgent: object expected"); - message.llmAgent = $root.google.cloud.ces.v1beta.Agent.LlmAgent.fromObject(object.llmAgent); - } - if (object.remoteDialogflowAgent != null) { - if (typeof object.remoteDialogflowAgent !== "object") - throw TypeError(".google.cloud.ces.v1beta.Agent.remoteDialogflowAgent: object expected"); - message.remoteDialogflowAgent = $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.fromObject(object.remoteDialogflowAgent); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.modelSettings != null) { - if (typeof object.modelSettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.Agent.modelSettings: object expected"); - message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.fromObject(object.modelSettings); - } - if (object.instruction != null) - message.instruction = String(object.instruction); - if (object.tools) { - if (!Array.isArray(object.tools)) - throw TypeError(".google.cloud.ces.v1beta.Agent.tools: array expected"); - message.tools = []; - for (var i = 0; i < object.tools.length; ++i) - message.tools[i] = String(object.tools[i]); - } - if (object.childAgents) { - if (!Array.isArray(object.childAgents)) - throw TypeError(".google.cloud.ces.v1beta.Agent.childAgents: array expected"); - message.childAgents = []; - for (var i = 0; i < object.childAgents.length; ++i) - message.childAgents[i] = String(object.childAgents[i]); - } - if (object.beforeAgentCallbacks) { - if (!Array.isArray(object.beforeAgentCallbacks)) - throw TypeError(".google.cloud.ces.v1beta.Agent.beforeAgentCallbacks: array expected"); - message.beforeAgentCallbacks = []; - for (var i = 0; i < object.beforeAgentCallbacks.length; ++i) { - if (typeof object.beforeAgentCallbacks[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Agent.beforeAgentCallbacks: object expected"); - message.beforeAgentCallbacks[i] = $root.google.cloud.ces.v1beta.Callback.fromObject(object.beforeAgentCallbacks[i]); - } - } - if (object.afterAgentCallbacks) { - if (!Array.isArray(object.afterAgentCallbacks)) - throw TypeError(".google.cloud.ces.v1beta.Agent.afterAgentCallbacks: array expected"); - message.afterAgentCallbacks = []; - for (var i = 0; i < object.afterAgentCallbacks.length; ++i) { - if (typeof object.afterAgentCallbacks[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Agent.afterAgentCallbacks: object expected"); - message.afterAgentCallbacks[i] = $root.google.cloud.ces.v1beta.Callback.fromObject(object.afterAgentCallbacks[i]); - } - } - if (object.beforeModelCallbacks) { - if (!Array.isArray(object.beforeModelCallbacks)) - throw TypeError(".google.cloud.ces.v1beta.Agent.beforeModelCallbacks: array expected"); - message.beforeModelCallbacks = []; - for (var i = 0; i < object.beforeModelCallbacks.length; ++i) { - if (typeof object.beforeModelCallbacks[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Agent.beforeModelCallbacks: object expected"); - message.beforeModelCallbacks[i] = $root.google.cloud.ces.v1beta.Callback.fromObject(object.beforeModelCallbacks[i]); - } - } - if (object.afterModelCallbacks) { - if (!Array.isArray(object.afterModelCallbacks)) - throw TypeError(".google.cloud.ces.v1beta.Agent.afterModelCallbacks: array expected"); - message.afterModelCallbacks = []; - for (var i = 0; i < object.afterModelCallbacks.length; ++i) { - if (typeof object.afterModelCallbacks[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Agent.afterModelCallbacks: object expected"); - message.afterModelCallbacks[i] = $root.google.cloud.ces.v1beta.Callback.fromObject(object.afterModelCallbacks[i]); - } - } - if (object.beforeToolCallbacks) { - if (!Array.isArray(object.beforeToolCallbacks)) - throw TypeError(".google.cloud.ces.v1beta.Agent.beforeToolCallbacks: array expected"); - message.beforeToolCallbacks = []; - for (var i = 0; i < object.beforeToolCallbacks.length; ++i) { - if (typeof object.beforeToolCallbacks[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Agent.beforeToolCallbacks: object expected"); - message.beforeToolCallbacks[i] = $root.google.cloud.ces.v1beta.Callback.fromObject(object.beforeToolCallbacks[i]); - } - } - if (object.afterToolCallbacks) { - if (!Array.isArray(object.afterToolCallbacks)) - throw TypeError(".google.cloud.ces.v1beta.Agent.afterToolCallbacks: array expected"); - message.afterToolCallbacks = []; - for (var i = 0; i < object.afterToolCallbacks.length; ++i) { - if (typeof object.afterToolCallbacks[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Agent.afterToolCallbacks: object expected"); - message.afterToolCallbacks[i] = $root.google.cloud.ces.v1beta.Callback.fromObject(object.afterToolCallbacks[i]); - } - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.Agent.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.ces.v1beta.Agent.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.guardrails) { - if (!Array.isArray(object.guardrails)) - throw TypeError(".google.cloud.ces.v1beta.Agent.guardrails: array expected"); - message.guardrails = []; - for (var i = 0; i < object.guardrails.length; ++i) - message.guardrails[i] = String(object.guardrails[i]); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.toolsets) { - if (!Array.isArray(object.toolsets)) - throw TypeError(".google.cloud.ces.v1beta.Agent.toolsets: array expected"); - message.toolsets = []; - for (var i = 0; i < object.toolsets.length; ++i) { - if (typeof object.toolsets[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Agent.toolsets: object expected"); - message.toolsets[i] = $root.google.cloud.ces.v1beta.Agent.AgentToolset.fromObject(object.toolsets[i]); - } - } - if (object.generatedSummary != null) - message.generatedSummary = String(object.generatedSummary); - if (object.transferRules) { - if (!Array.isArray(object.transferRules)) - throw TypeError(".google.cloud.ces.v1beta.Agent.transferRules: array expected"); - message.transferRules = []; - for (var i = 0; i < object.transferRules.length; ++i) { - if (typeof object.transferRules[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Agent.transferRules: object expected"); - message.transferRules[i] = $root.google.cloud.ces.v1beta.TransferRule.fromObject(object.transferRules[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an Agent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Agent - * @static - * @param {google.cloud.ces.v1beta.Agent} message Agent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Agent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.tools = []; - object.childAgents = []; - object.guardrails = []; - object.beforeAgentCallbacks = []; - object.afterAgentCallbacks = []; - object.beforeModelCallbacks = []; - object.afterModelCallbacks = []; - object.beforeToolCallbacks = []; - object.afterToolCallbacks = []; - object.toolsets = []; - object.transferRules = []; - } - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.modelSettings = null; - object.instruction = ""; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - object.generatedSummary = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) - object.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.toObject(message.modelSettings, options); - if (message.instruction != null && message.hasOwnProperty("instruction")) - object.instruction = message.instruction; - if (message.tools && message.tools.length) { - object.tools = []; - for (var j = 0; j < message.tools.length; ++j) - object.tools[j] = message.tools[j]; - } - if (message.childAgents && message.childAgents.length) { - object.childAgents = []; - for (var j = 0; j < message.childAgents.length; ++j) - object.childAgents[j] = message.childAgents[j]; - } - 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.guardrails && message.guardrails.length) { - object.guardrails = []; - for (var j = 0; j < message.guardrails.length; ++j) - object.guardrails[j] = message.guardrails[j]; - } - if (message.beforeAgentCallbacks && message.beforeAgentCallbacks.length) { - object.beforeAgentCallbacks = []; - for (var j = 0; j < message.beforeAgentCallbacks.length; ++j) - object.beforeAgentCallbacks[j] = $root.google.cloud.ces.v1beta.Callback.toObject(message.beforeAgentCallbacks[j], options); - } - if (message.afterAgentCallbacks && message.afterAgentCallbacks.length) { - object.afterAgentCallbacks = []; - for (var j = 0; j < message.afterAgentCallbacks.length; ++j) - object.afterAgentCallbacks[j] = $root.google.cloud.ces.v1beta.Callback.toObject(message.afterAgentCallbacks[j], options); - } - if (message.beforeModelCallbacks && message.beforeModelCallbacks.length) { - object.beforeModelCallbacks = []; - for (var j = 0; j < message.beforeModelCallbacks.length; ++j) - object.beforeModelCallbacks[j] = $root.google.cloud.ces.v1beta.Callback.toObject(message.beforeModelCallbacks[j], options); - } - if (message.afterModelCallbacks && message.afterModelCallbacks.length) { - object.afterModelCallbacks = []; - for (var j = 0; j < message.afterModelCallbacks.length; ++j) - object.afterModelCallbacks[j] = $root.google.cloud.ces.v1beta.Callback.toObject(message.afterModelCallbacks[j], options); - } - if (message.beforeToolCallbacks && message.beforeToolCallbacks.length) { - object.beforeToolCallbacks = []; - for (var j = 0; j < message.beforeToolCallbacks.length; ++j) - object.beforeToolCallbacks[j] = $root.google.cloud.ces.v1beta.Callback.toObject(message.beforeToolCallbacks[j], options); - } - if (message.afterToolCallbacks && message.afterToolCallbacks.length) { - object.afterToolCallbacks = []; - for (var j = 0; j < message.afterToolCallbacks.length; ++j) - object.afterToolCallbacks[j] = $root.google.cloud.ces.v1beta.Callback.toObject(message.afterToolCallbacks[j], options); - } - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.llmAgent != null && message.hasOwnProperty("llmAgent")) { - object.llmAgent = $root.google.cloud.ces.v1beta.Agent.LlmAgent.toObject(message.llmAgent, options); - if (options.oneofs) - object.agentType = "llmAgent"; - } - if (message.remoteDialogflowAgent != null && message.hasOwnProperty("remoteDialogflowAgent")) { - object.remoteDialogflowAgent = $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.toObject(message.remoteDialogflowAgent, options); - if (options.oneofs) - object.agentType = "remoteDialogflowAgent"; - } - if (message.toolsets && message.toolsets.length) { - object.toolsets = []; - for (var j = 0; j < message.toolsets.length; ++j) - object.toolsets[j] = $root.google.cloud.ces.v1beta.Agent.AgentToolset.toObject(message.toolsets[j], options); - } - if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) - object.generatedSummary = message.generatedSummary; - if (message.transferRules && message.transferRules.length) { - object.transferRules = []; - for (var j = 0; j < message.transferRules.length; ++j) - object.transferRules[j] = $root.google.cloud.ces.v1beta.TransferRule.toObject(message.transferRules[j], options); - } - return object; - }; - - /** - * Converts this Agent to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Agent - * @instance - * @returns {Object.} JSON object - */ - Agent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Agent - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Agent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Agent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Agent"; - }; - - Agent.LlmAgent = (function() { - - /** - * Properties of a LlmAgent. - * @memberof google.cloud.ces.v1beta.Agent - * @interface ILlmAgent - */ - - /** - * Constructs a new LlmAgent. - * @memberof google.cloud.ces.v1beta.Agent - * @classdesc Represents a LlmAgent. - * @implements ILlmAgent - * @constructor - * @param {google.cloud.ces.v1beta.Agent.ILlmAgent=} [properties] Properties to set - */ - function LlmAgent(properties) { - if (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 LlmAgent instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Agent.LlmAgent - * @static - * @param {google.cloud.ces.v1beta.Agent.ILlmAgent=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Agent.LlmAgent} LlmAgent instance - */ - LlmAgent.create = function create(properties) { - return new LlmAgent(properties); - }; - - /** - * Encodes the specified LlmAgent message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.LlmAgent.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Agent.LlmAgent - * @static - * @param {google.cloud.ces.v1beta.Agent.ILlmAgent} message LlmAgent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LlmAgent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified LlmAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.LlmAgent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Agent.LlmAgent - * @static - * @param {google.cloud.ces.v1beta.Agent.ILlmAgent} message LlmAgent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LlmAgent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LlmAgent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Agent.LlmAgent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Agent.LlmAgent} LlmAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LlmAgent.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Agent.LlmAgent(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LlmAgent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Agent.LlmAgent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Agent.LlmAgent} LlmAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LlmAgent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LlmAgent message. - * @function verify - * @memberof google.cloud.ces.v1beta.Agent.LlmAgent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LlmAgent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a LlmAgent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Agent.LlmAgent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Agent.LlmAgent} LlmAgent - */ - LlmAgent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Agent.LlmAgent) - return object; - return new $root.google.cloud.ces.v1beta.Agent.LlmAgent(); - }; - - /** - * Creates a plain object from a LlmAgent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Agent.LlmAgent - * @static - * @param {google.cloud.ces.v1beta.Agent.LlmAgent} message LlmAgent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LlmAgent.toObject = function toObject() { - return {}; - }; - - /** - * Converts this LlmAgent to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Agent.LlmAgent - * @instance - * @returns {Object.} JSON object - */ - LlmAgent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LlmAgent - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Agent.LlmAgent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LlmAgent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Agent.LlmAgent"; - }; - - return LlmAgent; - })(); - - Agent.RemoteDialogflowAgent = (function() { - - /** - * Properties of a RemoteDialogflowAgent. - * @memberof google.cloud.ces.v1beta.Agent - * @interface IRemoteDialogflowAgent - * @property {string|null} [agent] RemoteDialogflowAgent agent - * @property {string|null} [flowId] RemoteDialogflowAgent flowId - * @property {string|null} [environmentId] RemoteDialogflowAgent environmentId - * @property {Object.|null} [inputVariableMapping] RemoteDialogflowAgent inputVariableMapping - * @property {Object.|null} [outputVariableMapping] RemoteDialogflowAgent outputVariableMapping - * @property {boolean|null} [respectResponseInterruptionSettings] RemoteDialogflowAgent respectResponseInterruptionSettings - */ - - /** - * Constructs a new RemoteDialogflowAgent. - * @memberof google.cloud.ces.v1beta.Agent - * @classdesc Represents a RemoteDialogflowAgent. - * @implements IRemoteDialogflowAgent - * @constructor - * @param {google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent=} [properties] Properties to set - */ - function RemoteDialogflowAgent(properties) { - this.inputVariableMapping = {}; - this.outputVariableMapping = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RemoteDialogflowAgent agent. - * @member {string} agent - * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent - * @instance - */ - RemoteDialogflowAgent.prototype.agent = ""; - - /** - * RemoteDialogflowAgent flowId. - * @member {string} flowId - * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent - * @instance - */ - RemoteDialogflowAgent.prototype.flowId = ""; - - /** - * RemoteDialogflowAgent environmentId. - * @member {string} environmentId - * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent - * @instance - */ - RemoteDialogflowAgent.prototype.environmentId = ""; - - /** - * RemoteDialogflowAgent inputVariableMapping. - * @member {Object.} inputVariableMapping - * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent - * @instance - */ - RemoteDialogflowAgent.prototype.inputVariableMapping = $util.emptyObject; - - /** - * RemoteDialogflowAgent outputVariableMapping. - * @member {Object.} outputVariableMapping - * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent - * @instance - */ - RemoteDialogflowAgent.prototype.outputVariableMapping = $util.emptyObject; - - /** - * RemoteDialogflowAgent respectResponseInterruptionSettings. - * @member {boolean} respectResponseInterruptionSettings - * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent - * @instance - */ - RemoteDialogflowAgent.prototype.respectResponseInterruptionSettings = false; - - /** - * Creates a new RemoteDialogflowAgent instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent - * @static - * @param {google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent instance - */ - RemoteDialogflowAgent.create = function create(properties) { - return new RemoteDialogflowAgent(properties); - }; - - /** - * Encodes the specified RemoteDialogflowAgent message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent - * @static - * @param {google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent} message RemoteDialogflowAgent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RemoteDialogflowAgent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.agent); - if (message.flowId != null && Object.hasOwnProperty.call(message, "flowId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.flowId); - if (message.environmentId != null && Object.hasOwnProperty.call(message, "environmentId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.environmentId); - if (message.inputVariableMapping != null && Object.hasOwnProperty.call(message, "inputVariableMapping")) - for (var keys = Object.keys(message.inputVariableMapping), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.inputVariableMapping[keys[i]]).ldelim(); - if (message.outputVariableMapping != null && Object.hasOwnProperty.call(message, "outputVariableMapping")) - for (var keys = Object.keys(message.outputVariableMapping), i = 0; i < keys.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.outputVariableMapping[keys[i]]).ldelim(); - if (message.respectResponseInterruptionSettings != null && Object.hasOwnProperty.call(message, "respectResponseInterruptionSettings")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.respectResponseInterruptionSettings); - return writer; - }; - - /** - * Encodes the specified RemoteDialogflowAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent - * @static - * @param {google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent} message RemoteDialogflowAgent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RemoteDialogflowAgent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RemoteDialogflowAgent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RemoteDialogflowAgent.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.agent = reader.string(); - break; - } - case 2: { - message.flowId = reader.string(); - break; - } - case 3: { - message.environmentId = reader.string(); - break; - } - case 4: { - if (message.inputVariableMapping === $util.emptyObject) - message.inputVariableMapping = {}; - 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.inputVariableMapping[key] = value; - break; - } - case 5: { - if (message.outputVariableMapping === $util.emptyObject) - message.outputVariableMapping = {}; - 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.outputVariableMapping[key] = value; - break; - } - case 6: { - message.respectResponseInterruptionSettings = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RemoteDialogflowAgent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RemoteDialogflowAgent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RemoteDialogflowAgent message. - * @function verify - * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RemoteDialogflowAgent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.agent != null && message.hasOwnProperty("agent")) - if (!$util.isString(message.agent)) - return "agent: string expected"; - if (message.flowId != null && message.hasOwnProperty("flowId")) - if (!$util.isString(message.flowId)) - return "flowId: string expected"; - if (message.environmentId != null && message.hasOwnProperty("environmentId")) - if (!$util.isString(message.environmentId)) - return "environmentId: string expected"; - if (message.inputVariableMapping != null && message.hasOwnProperty("inputVariableMapping")) { - if (!$util.isObject(message.inputVariableMapping)) - return "inputVariableMapping: object expected"; - var key = Object.keys(message.inputVariableMapping); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.inputVariableMapping[key[i]])) - return "inputVariableMapping: string{k:string} expected"; - } - if (message.outputVariableMapping != null && message.hasOwnProperty("outputVariableMapping")) { - if (!$util.isObject(message.outputVariableMapping)) - return "outputVariableMapping: object expected"; - var key = Object.keys(message.outputVariableMapping); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.outputVariableMapping[key[i]])) - return "outputVariableMapping: string{k:string} expected"; - } - if (message.respectResponseInterruptionSettings != null && message.hasOwnProperty("respectResponseInterruptionSettings")) - if (typeof message.respectResponseInterruptionSettings !== "boolean") - return "respectResponseInterruptionSettings: boolean expected"; - return null; - }; - - /** - * Creates a RemoteDialogflowAgent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent - */ - RemoteDialogflowAgent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent) - return object; - var message = new $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent(); - if (object.agent != null) - message.agent = String(object.agent); - if (object.flowId != null) - message.flowId = String(object.flowId); - if (object.environmentId != null) - message.environmentId = String(object.environmentId); - if (object.inputVariableMapping) { - if (typeof object.inputVariableMapping !== "object") - throw TypeError(".google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.inputVariableMapping: object expected"); - message.inputVariableMapping = {}; - for (var keys = Object.keys(object.inputVariableMapping), i = 0; i < keys.length; ++i) - message.inputVariableMapping[keys[i]] = String(object.inputVariableMapping[keys[i]]); - } - if (object.outputVariableMapping) { - if (typeof object.outputVariableMapping !== "object") - throw TypeError(".google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.outputVariableMapping: object expected"); - message.outputVariableMapping = {}; - for (var keys = Object.keys(object.outputVariableMapping), i = 0; i < keys.length; ++i) - message.outputVariableMapping[keys[i]] = String(object.outputVariableMapping[keys[i]]); - } - if (object.respectResponseInterruptionSettings != null) - message.respectResponseInterruptionSettings = Boolean(object.respectResponseInterruptionSettings); - return message; - }; - - /** - * Creates a plain object from a RemoteDialogflowAgent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent - * @static - * @param {google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent} message RemoteDialogflowAgent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RemoteDialogflowAgent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.inputVariableMapping = {}; - object.outputVariableMapping = {}; - } - if (options.defaults) { - object.agent = ""; - object.flowId = ""; - object.environmentId = ""; - object.respectResponseInterruptionSettings = false; - } - if (message.agent != null && message.hasOwnProperty("agent")) - object.agent = message.agent; - if (message.flowId != null && message.hasOwnProperty("flowId")) - object.flowId = message.flowId; - if (message.environmentId != null && message.hasOwnProperty("environmentId")) - object.environmentId = message.environmentId; - var keys2; - if (message.inputVariableMapping && (keys2 = Object.keys(message.inputVariableMapping)).length) { - object.inputVariableMapping = {}; - for (var j = 0; j < keys2.length; ++j) - object.inputVariableMapping[keys2[j]] = message.inputVariableMapping[keys2[j]]; - } - if (message.outputVariableMapping && (keys2 = Object.keys(message.outputVariableMapping)).length) { - object.outputVariableMapping = {}; - for (var j = 0; j < keys2.length; ++j) - object.outputVariableMapping[keys2[j]] = message.outputVariableMapping[keys2[j]]; - } - if (message.respectResponseInterruptionSettings != null && message.hasOwnProperty("respectResponseInterruptionSettings")) - object.respectResponseInterruptionSettings = message.respectResponseInterruptionSettings; - return object; - }; - - /** - * Converts this RemoteDialogflowAgent to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent - * @instance - * @returns {Object.} JSON object - */ - RemoteDialogflowAgent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RemoteDialogflowAgent - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RemoteDialogflowAgent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent"; - }; - - return RemoteDialogflowAgent; - })(); - - Agent.AgentToolset = (function() { - - /** - * Properties of an AgentToolset. - * @memberof google.cloud.ces.v1beta.Agent - * @interface IAgentToolset - * @property {string|null} [toolset] AgentToolset toolset - * @property {Array.|null} [toolIds] AgentToolset toolIds - */ - - /** - * Constructs a new AgentToolset. - * @memberof google.cloud.ces.v1beta.Agent - * @classdesc Represents an AgentToolset. - * @implements IAgentToolset - * @constructor - * @param {google.cloud.ces.v1beta.Agent.IAgentToolset=} [properties] Properties to set - */ - function AgentToolset(properties) { - this.toolIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AgentToolset toolset. - * @member {string} toolset - * @memberof google.cloud.ces.v1beta.Agent.AgentToolset - * @instance - */ - AgentToolset.prototype.toolset = ""; - - /** - * AgentToolset toolIds. - * @member {Array.} toolIds - * @memberof google.cloud.ces.v1beta.Agent.AgentToolset - * @instance - */ - AgentToolset.prototype.toolIds = $util.emptyArray; - - /** - * Creates a new AgentToolset instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Agent.AgentToolset - * @static - * @param {google.cloud.ces.v1beta.Agent.IAgentToolset=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Agent.AgentToolset} AgentToolset instance - */ - AgentToolset.create = function create(properties) { - return new AgentToolset(properties); - }; - - /** - * Encodes the specified AgentToolset message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.AgentToolset.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Agent.AgentToolset - * @static - * @param {google.cloud.ces.v1beta.Agent.IAgentToolset} message AgentToolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AgentToolset.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.toolset); - if (message.toolIds != null && message.toolIds.length) - for (var i = 0; i < message.toolIds.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.toolIds[i]); - return writer; - }; - - /** - * Encodes the specified AgentToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.AgentToolset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Agent.AgentToolset - * @static - * @param {google.cloud.ces.v1beta.Agent.IAgentToolset} message AgentToolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AgentToolset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AgentToolset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Agent.AgentToolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Agent.AgentToolset} AgentToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AgentToolset.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Agent.AgentToolset(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.toolset = reader.string(); - break; - } - case 4: { - if (!(message.toolIds && message.toolIds.length)) - message.toolIds = []; - message.toolIds.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AgentToolset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Agent.AgentToolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Agent.AgentToolset} AgentToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AgentToolset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AgentToolset message. - * @function verify - * @memberof google.cloud.ces.v1beta.Agent.AgentToolset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AgentToolset.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.toolset != null && message.hasOwnProperty("toolset")) - if (!$util.isString(message.toolset)) - return "toolset: string expected"; - if (message.toolIds != null && message.hasOwnProperty("toolIds")) { - if (!Array.isArray(message.toolIds)) - return "toolIds: array expected"; - for (var i = 0; i < message.toolIds.length; ++i) - if (!$util.isString(message.toolIds[i])) - return "toolIds: string[] expected"; - } - return null; - }; - - /** - * Creates an AgentToolset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Agent.AgentToolset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Agent.AgentToolset} AgentToolset - */ - AgentToolset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Agent.AgentToolset) - return object; - var message = new $root.google.cloud.ces.v1beta.Agent.AgentToolset(); - if (object.toolset != null) - message.toolset = String(object.toolset); - if (object.toolIds) { - if (!Array.isArray(object.toolIds)) - throw TypeError(".google.cloud.ces.v1beta.Agent.AgentToolset.toolIds: array expected"); - message.toolIds = []; - for (var i = 0; i < object.toolIds.length; ++i) - message.toolIds[i] = String(object.toolIds[i]); - } - return message; - }; - - /** - * Creates a plain object from an AgentToolset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Agent.AgentToolset - * @static - * @param {google.cloud.ces.v1beta.Agent.AgentToolset} message AgentToolset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AgentToolset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.toolIds = []; - if (options.defaults) - object.toolset = ""; - if (message.toolset != null && message.hasOwnProperty("toolset")) - object.toolset = message.toolset; - if (message.toolIds && message.toolIds.length) { - object.toolIds = []; - for (var j = 0; j < message.toolIds.length; ++j) - object.toolIds[j] = message.toolIds[j]; - } - return object; - }; - - /** - * Converts this AgentToolset to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Agent.AgentToolset - * @instance - * @returns {Object.} JSON object - */ - AgentToolset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AgentToolset - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Agent.AgentToolset - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AgentToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Agent.AgentToolset"; - }; - - return AgentToolset; - })(); - - return Agent; - })(); - - v1beta.ExpressionCondition = (function() { - - /** - * Properties of an ExpressionCondition. - * @memberof google.cloud.ces.v1beta - * @interface IExpressionCondition - * @property {string|null} [expression] ExpressionCondition expression - */ - - /** - * Constructs a new ExpressionCondition. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an ExpressionCondition. - * @implements IExpressionCondition - * @constructor - * @param {google.cloud.ces.v1beta.IExpressionCondition=} [properties] Properties to set - */ - function ExpressionCondition(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExpressionCondition expression. - * @member {string} expression - * @memberof google.cloud.ces.v1beta.ExpressionCondition - * @instance - */ - ExpressionCondition.prototype.expression = ""; - - /** - * Creates a new ExpressionCondition instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ExpressionCondition - * @static - * @param {google.cloud.ces.v1beta.IExpressionCondition=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ExpressionCondition} ExpressionCondition instance - */ - ExpressionCondition.create = function create(properties) { - return new ExpressionCondition(properties); - }; - - /** - * Encodes the specified ExpressionCondition message. Does not implicitly {@link google.cloud.ces.v1beta.ExpressionCondition.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ExpressionCondition - * @static - * @param {google.cloud.ces.v1beta.IExpressionCondition} message ExpressionCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExpressionCondition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); - return writer; - }; - - /** - * Encodes the specified ExpressionCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExpressionCondition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ExpressionCondition - * @static - * @param {google.cloud.ces.v1beta.IExpressionCondition} message ExpressionCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExpressionCondition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExpressionCondition message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ExpressionCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ExpressionCondition} ExpressionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExpressionCondition.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ExpressionCondition(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.expression = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExpressionCondition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ExpressionCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ExpressionCondition} ExpressionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExpressionCondition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExpressionCondition message. - * @function verify - * @memberof google.cloud.ces.v1beta.ExpressionCondition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExpressionCondition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expression != null && message.hasOwnProperty("expression")) - if (!$util.isString(message.expression)) - return "expression: string expected"; - return null; - }; - - /** - * Creates an ExpressionCondition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ExpressionCondition - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ExpressionCondition} ExpressionCondition - */ - ExpressionCondition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ExpressionCondition) - return object; - var message = new $root.google.cloud.ces.v1beta.ExpressionCondition(); - if (object.expression != null) - message.expression = String(object.expression); - return message; - }; - - /** - * Creates a plain object from an ExpressionCondition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ExpressionCondition - * @static - * @param {google.cloud.ces.v1beta.ExpressionCondition} message ExpressionCondition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExpressionCondition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.expression = ""; - if (message.expression != null && message.hasOwnProperty("expression")) - object.expression = message.expression; - return object; - }; - - /** - * Converts this ExpressionCondition to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ExpressionCondition - * @instance - * @returns {Object.} JSON object - */ - ExpressionCondition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExpressionCondition - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ExpressionCondition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExpressionCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ExpressionCondition"; - }; - - return ExpressionCondition; - })(); - - v1beta.PythonCodeCondition = (function() { - - /** - * Properties of a PythonCodeCondition. - * @memberof google.cloud.ces.v1beta - * @interface IPythonCodeCondition - * @property {string|null} [pythonCode] PythonCodeCondition pythonCode - */ - - /** - * Constructs a new PythonCodeCondition. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a PythonCodeCondition. - * @implements IPythonCodeCondition - * @constructor - * @param {google.cloud.ces.v1beta.IPythonCodeCondition=} [properties] Properties to set - */ - function PythonCodeCondition(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonCodeCondition pythonCode. - * @member {string} pythonCode - * @memberof google.cloud.ces.v1beta.PythonCodeCondition - * @instance - */ - PythonCodeCondition.prototype.pythonCode = ""; - - /** - * Creates a new PythonCodeCondition instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.PythonCodeCondition - * @static - * @param {google.cloud.ces.v1beta.IPythonCodeCondition=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.PythonCodeCondition} PythonCodeCondition instance - */ - PythonCodeCondition.create = function create(properties) { - return new PythonCodeCondition(properties); - }; - - /** - * Encodes the specified PythonCodeCondition message. Does not implicitly {@link google.cloud.ces.v1beta.PythonCodeCondition.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.PythonCodeCondition - * @static - * @param {google.cloud.ces.v1beta.IPythonCodeCondition} message PythonCodeCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonCodeCondition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pythonCode); - return writer; - }; - - /** - * Encodes the specified PythonCodeCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.PythonCodeCondition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.PythonCodeCondition - * @static - * @param {google.cloud.ces.v1beta.IPythonCodeCondition} message PythonCodeCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonCodeCondition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonCodeCondition message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.PythonCodeCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.PythonCodeCondition} PythonCodeCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonCodeCondition.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.PythonCodeCondition(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pythonCode = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonCodeCondition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.PythonCodeCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.PythonCodeCondition} PythonCodeCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonCodeCondition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonCodeCondition message. - * @function verify - * @memberof google.cloud.ces.v1beta.PythonCodeCondition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonCodeCondition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) - if (!$util.isString(message.pythonCode)) - return "pythonCode: string expected"; - return null; - }; - - /** - * Creates a PythonCodeCondition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.PythonCodeCondition - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.PythonCodeCondition} PythonCodeCondition - */ - PythonCodeCondition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.PythonCodeCondition) - return object; - var message = new $root.google.cloud.ces.v1beta.PythonCodeCondition(); - if (object.pythonCode != null) - message.pythonCode = String(object.pythonCode); - return message; - }; - - /** - * Creates a plain object from a PythonCodeCondition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.PythonCodeCondition - * @static - * @param {google.cloud.ces.v1beta.PythonCodeCondition} message PythonCodeCondition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonCodeCondition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.pythonCode = ""; - if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) - object.pythonCode = message.pythonCode; - return object; - }; - - /** - * Converts this PythonCodeCondition to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.PythonCodeCondition - * @instance - * @returns {Object.} JSON object - */ - PythonCodeCondition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonCodeCondition - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.PythonCodeCondition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonCodeCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.PythonCodeCondition"; - }; - - return PythonCodeCondition; - })(); - - v1beta.TransferRule = (function() { - - /** - * Properties of a TransferRule. - * @memberof google.cloud.ces.v1beta - * @interface ITransferRule - * @property {google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer|null} [deterministicTransfer] TransferRule deterministicTransfer - * @property {google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer|null} [disablePlannerTransfer] TransferRule disablePlannerTransfer - * @property {string|null} [childAgent] TransferRule childAgent - * @property {google.cloud.ces.v1beta.TransferRule.Direction|null} [direction] TransferRule direction - */ - - /** - * Constructs a new TransferRule. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a TransferRule. - * @implements ITransferRule - * @constructor - * @param {google.cloud.ces.v1beta.ITransferRule=} [properties] Properties to set - */ - function TransferRule(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TransferRule deterministicTransfer. - * @member {google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer|null|undefined} deterministicTransfer - * @memberof google.cloud.ces.v1beta.TransferRule - * @instance - */ - TransferRule.prototype.deterministicTransfer = null; - - /** - * TransferRule disablePlannerTransfer. - * @member {google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer|null|undefined} disablePlannerTransfer - * @memberof google.cloud.ces.v1beta.TransferRule - * @instance - */ - TransferRule.prototype.disablePlannerTransfer = null; - - /** - * TransferRule childAgent. - * @member {string} childAgent - * @memberof google.cloud.ces.v1beta.TransferRule - * @instance - */ - TransferRule.prototype.childAgent = ""; - - /** - * TransferRule direction. - * @member {google.cloud.ces.v1beta.TransferRule.Direction} direction - * @memberof google.cloud.ces.v1beta.TransferRule - * @instance - */ - TransferRule.prototype.direction = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TransferRule ruleType. - * @member {"deterministicTransfer"|"disablePlannerTransfer"|undefined} ruleType - * @memberof google.cloud.ces.v1beta.TransferRule - * @instance - */ - Object.defineProperty(TransferRule.prototype, "ruleType", { - get: $util.oneOfGetter($oneOfFields = ["deterministicTransfer", "disablePlannerTransfer"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TransferRule instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.TransferRule - * @static - * @param {google.cloud.ces.v1beta.ITransferRule=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.TransferRule} TransferRule instance - */ - TransferRule.create = function create(properties) { - return new TransferRule(properties); - }; - - /** - * Encodes the specified TransferRule message. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.TransferRule - * @static - * @param {google.cloud.ces.v1beta.ITransferRule} message TransferRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransferRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.childAgent != null && Object.hasOwnProperty.call(message, "childAgent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.childAgent); - if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.direction); - if (message.deterministicTransfer != null && Object.hasOwnProperty.call(message, "deterministicTransfer")) - $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.encode(message.deterministicTransfer, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.disablePlannerTransfer != null && Object.hasOwnProperty.call(message, "disablePlannerTransfer")) - $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.encode(message.disablePlannerTransfer, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TransferRule message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.TransferRule - * @static - * @param {google.cloud.ces.v1beta.ITransferRule} message TransferRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransferRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransferRule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.TransferRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.TransferRule} TransferRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransferRule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TransferRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.deterministicTransfer = $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.decode(reader, reader.uint32()); - break; - } - case 4: { - message.disablePlannerTransfer = $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.decode(reader, reader.uint32()); - break; - } - case 1: { - message.childAgent = reader.string(); - break; - } - case 2: { - message.direction = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransferRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.TransferRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.TransferRule} TransferRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransferRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransferRule message. - * @function verify - * @memberof google.cloud.ces.v1beta.TransferRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransferRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.deterministicTransfer != null && message.hasOwnProperty("deterministicTransfer")) { - properties.ruleType = 1; - { - var error = $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.verify(message.deterministicTransfer); - if (error) - return "deterministicTransfer." + error; - } - } - if (message.disablePlannerTransfer != null && message.hasOwnProperty("disablePlannerTransfer")) { - if (properties.ruleType === 1) - return "ruleType: multiple values"; - properties.ruleType = 1; - { - var error = $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.verify(message.disablePlannerTransfer); - if (error) - return "disablePlannerTransfer." + error; - } - } - if (message.childAgent != null && message.hasOwnProperty("childAgent")) - if (!$util.isString(message.childAgent)) - return "childAgent: string expected"; - if (message.direction != null && message.hasOwnProperty("direction")) - switch (message.direction) { - default: - return "direction: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a TransferRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.TransferRule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.TransferRule} TransferRule - */ - TransferRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.TransferRule) - return object; - var message = new $root.google.cloud.ces.v1beta.TransferRule(); - if (object.deterministicTransfer != null) { - if (typeof object.deterministicTransfer !== "object") - throw TypeError(".google.cloud.ces.v1beta.TransferRule.deterministicTransfer: object expected"); - message.deterministicTransfer = $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.fromObject(object.deterministicTransfer); - } - if (object.disablePlannerTransfer != null) { - if (typeof object.disablePlannerTransfer !== "object") - throw TypeError(".google.cloud.ces.v1beta.TransferRule.disablePlannerTransfer: object expected"); - message.disablePlannerTransfer = $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.fromObject(object.disablePlannerTransfer); - } - if (object.childAgent != null) - message.childAgent = String(object.childAgent); - switch (object.direction) { - default: - if (typeof object.direction === "number") { - message.direction = object.direction; - break; - } - break; - case "DIRECTION_UNSPECIFIED": - case 0: - message.direction = 0; - break; - case "PARENT_TO_CHILD": - case 1: - message.direction = 1; - break; - case "CHILD_TO_PARENT": - case 2: - message.direction = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a TransferRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.TransferRule - * @static - * @param {google.cloud.ces.v1beta.TransferRule} message TransferRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransferRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.childAgent = ""; - object.direction = options.enums === String ? "DIRECTION_UNSPECIFIED" : 0; - } - if (message.childAgent != null && message.hasOwnProperty("childAgent")) - object.childAgent = message.childAgent; - if (message.direction != null && message.hasOwnProperty("direction")) - object.direction = options.enums === String ? $root.google.cloud.ces.v1beta.TransferRule.Direction[message.direction] === undefined ? message.direction : $root.google.cloud.ces.v1beta.TransferRule.Direction[message.direction] : message.direction; - if (message.deterministicTransfer != null && message.hasOwnProperty("deterministicTransfer")) { - object.deterministicTransfer = $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.toObject(message.deterministicTransfer, options); - if (options.oneofs) - object.ruleType = "deterministicTransfer"; - } - if (message.disablePlannerTransfer != null && message.hasOwnProperty("disablePlannerTransfer")) { - object.disablePlannerTransfer = $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.toObject(message.disablePlannerTransfer, options); - if (options.oneofs) - object.ruleType = "disablePlannerTransfer"; - } - return object; - }; - - /** - * Converts this TransferRule to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.TransferRule - * @instance - * @returns {Object.} JSON object - */ - TransferRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransferRule - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.TransferRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransferRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.TransferRule"; - }; - - TransferRule.DeterministicTransfer = (function() { - - /** - * Properties of a DeterministicTransfer. - * @memberof google.cloud.ces.v1beta.TransferRule - * @interface IDeterministicTransfer - * @property {google.cloud.ces.v1beta.IExpressionCondition|null} [expressionCondition] DeterministicTransfer expressionCondition - * @property {google.cloud.ces.v1beta.IPythonCodeCondition|null} [pythonCodeCondition] DeterministicTransfer pythonCodeCondition - */ - - /** - * Constructs a new DeterministicTransfer. - * @memberof google.cloud.ces.v1beta.TransferRule - * @classdesc Represents a DeterministicTransfer. - * @implements IDeterministicTransfer - * @constructor - * @param {google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer=} [properties] Properties to set - */ - function DeterministicTransfer(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeterministicTransfer expressionCondition. - * @member {google.cloud.ces.v1beta.IExpressionCondition|null|undefined} expressionCondition - * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer - * @instance - */ - DeterministicTransfer.prototype.expressionCondition = null; - - /** - * DeterministicTransfer pythonCodeCondition. - * @member {google.cloud.ces.v1beta.IPythonCodeCondition|null|undefined} pythonCodeCondition - * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer - * @instance - */ - DeterministicTransfer.prototype.pythonCodeCondition = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * DeterministicTransfer conditionType. - * @member {"expressionCondition"|"pythonCodeCondition"|undefined} conditionType - * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer - * @instance - */ - Object.defineProperty(DeterministicTransfer.prototype, "conditionType", { - get: $util.oneOfGetter($oneOfFields = ["expressionCondition", "pythonCodeCondition"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DeterministicTransfer instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer - * @static - * @param {google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.TransferRule.DeterministicTransfer} DeterministicTransfer instance - */ - DeterministicTransfer.create = function create(properties) { - return new DeterministicTransfer(properties); - }; - - /** - * Encodes the specified DeterministicTransfer message. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer - * @static - * @param {google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer} message DeterministicTransfer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeterministicTransfer.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expressionCondition != null && Object.hasOwnProperty.call(message, "expressionCondition")) - $root.google.cloud.ces.v1beta.ExpressionCondition.encode(message.expressionCondition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pythonCodeCondition != null && Object.hasOwnProperty.call(message, "pythonCodeCondition")) - $root.google.cloud.ces.v1beta.PythonCodeCondition.encode(message.pythonCodeCondition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DeterministicTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer - * @static - * @param {google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer} message DeterministicTransfer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeterministicTransfer.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeterministicTransfer message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.TransferRule.DeterministicTransfer} DeterministicTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeterministicTransfer.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.expressionCondition = $root.google.cloud.ces.v1beta.ExpressionCondition.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pythonCodeCondition = $root.google.cloud.ces.v1beta.PythonCodeCondition.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeterministicTransfer message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.TransferRule.DeterministicTransfer} DeterministicTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeterministicTransfer.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeterministicTransfer message. - * @function verify - * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeterministicTransfer.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) { - properties.conditionType = 1; - { - var error = $root.google.cloud.ces.v1beta.ExpressionCondition.verify(message.expressionCondition); - if (error) - return "expressionCondition." + error; - } - } - if (message.pythonCodeCondition != null && message.hasOwnProperty("pythonCodeCondition")) { - if (properties.conditionType === 1) - return "conditionType: multiple values"; - properties.conditionType = 1; - { - var error = $root.google.cloud.ces.v1beta.PythonCodeCondition.verify(message.pythonCodeCondition); - if (error) - return "pythonCodeCondition." + error; - } - } - return null; - }; - - /** - * Creates a DeterministicTransfer message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.TransferRule.DeterministicTransfer} DeterministicTransfer - */ - DeterministicTransfer.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer) - return object; - var message = new $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer(); - if (object.expressionCondition != null) { - if (typeof object.expressionCondition !== "object") - throw TypeError(".google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.expressionCondition: object expected"); - message.expressionCondition = $root.google.cloud.ces.v1beta.ExpressionCondition.fromObject(object.expressionCondition); - } - if (object.pythonCodeCondition != null) { - if (typeof object.pythonCodeCondition !== "object") - throw TypeError(".google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.pythonCodeCondition: object expected"); - message.pythonCodeCondition = $root.google.cloud.ces.v1beta.PythonCodeCondition.fromObject(object.pythonCodeCondition); - } - return message; - }; - - /** - * Creates a plain object from a DeterministicTransfer message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer - * @static - * @param {google.cloud.ces.v1beta.TransferRule.DeterministicTransfer} message DeterministicTransfer - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeterministicTransfer.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) { - object.expressionCondition = $root.google.cloud.ces.v1beta.ExpressionCondition.toObject(message.expressionCondition, options); - if (options.oneofs) - object.conditionType = "expressionCondition"; - } - if (message.pythonCodeCondition != null && message.hasOwnProperty("pythonCodeCondition")) { - object.pythonCodeCondition = $root.google.cloud.ces.v1beta.PythonCodeCondition.toObject(message.pythonCodeCondition, options); - if (options.oneofs) - object.conditionType = "pythonCodeCondition"; - } - return object; - }; - - /** - * Converts this DeterministicTransfer to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer - * @instance - * @returns {Object.} JSON object - */ - DeterministicTransfer.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeterministicTransfer - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeterministicTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.TransferRule.DeterministicTransfer"; - }; - - return DeterministicTransfer; - })(); - - TransferRule.DisablePlannerTransfer = (function() { - - /** - * Properties of a DisablePlannerTransfer. - * @memberof google.cloud.ces.v1beta.TransferRule - * @interface IDisablePlannerTransfer - * @property {google.cloud.ces.v1beta.IExpressionCondition|null} [expressionCondition] DisablePlannerTransfer expressionCondition - */ - - /** - * Constructs a new DisablePlannerTransfer. - * @memberof google.cloud.ces.v1beta.TransferRule - * @classdesc Represents a DisablePlannerTransfer. - * @implements IDisablePlannerTransfer - * @constructor - * @param {google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer=} [properties] Properties to set - */ - function DisablePlannerTransfer(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DisablePlannerTransfer expressionCondition. - * @member {google.cloud.ces.v1beta.IExpressionCondition|null|undefined} expressionCondition - * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer - * @instance - */ - DisablePlannerTransfer.prototype.expressionCondition = null; - - /** - * Creates a new DisablePlannerTransfer instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer - * @static - * @param {google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer instance - */ - DisablePlannerTransfer.create = function create(properties) { - return new DisablePlannerTransfer(properties); - }; - - /** - * Encodes the specified DisablePlannerTransfer message. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer - * @static - * @param {google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer} message DisablePlannerTransfer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisablePlannerTransfer.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expressionCondition != null && Object.hasOwnProperty.call(message, "expressionCondition")) - $root.google.cloud.ces.v1beta.ExpressionCondition.encode(message.expressionCondition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DisablePlannerTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer - * @static - * @param {google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer} message DisablePlannerTransfer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisablePlannerTransfer.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DisablePlannerTransfer message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisablePlannerTransfer.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.expressionCondition = $root.google.cloud.ces.v1beta.ExpressionCondition.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DisablePlannerTransfer message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisablePlannerTransfer.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DisablePlannerTransfer message. - * @function verify - * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DisablePlannerTransfer.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) { - var error = $root.google.cloud.ces.v1beta.ExpressionCondition.verify(message.expressionCondition); - if (error) - return "expressionCondition." + error; - } - return null; - }; - - /** - * Creates a DisablePlannerTransfer message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer - */ - DisablePlannerTransfer.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer) - return object; - var message = new $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer(); - if (object.expressionCondition != null) { - if (typeof object.expressionCondition !== "object") - throw TypeError(".google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.expressionCondition: object expected"); - message.expressionCondition = $root.google.cloud.ces.v1beta.ExpressionCondition.fromObject(object.expressionCondition); - } - return message; - }; - - /** - * Creates a plain object from a DisablePlannerTransfer message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer - * @static - * @param {google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer} message DisablePlannerTransfer - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DisablePlannerTransfer.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.expressionCondition = null; - if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) - object.expressionCondition = $root.google.cloud.ces.v1beta.ExpressionCondition.toObject(message.expressionCondition, options); - return object; - }; - - /** - * Converts this DisablePlannerTransfer to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer - * @instance - * @returns {Object.} JSON object - */ - DisablePlannerTransfer.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DisablePlannerTransfer - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DisablePlannerTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer"; - }; - - return DisablePlannerTransfer; - })(); - - /** - * Direction enum. - * @name google.cloud.ces.v1beta.TransferRule.Direction - * @enum {number} - * @property {number} DIRECTION_UNSPECIFIED=0 DIRECTION_UNSPECIFIED value - * @property {number} PARENT_TO_CHILD=1 PARENT_TO_CHILD value - * @property {number} CHILD_TO_PARENT=2 CHILD_TO_PARENT value - */ - TransferRule.Direction = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "PARENT_TO_CHILD"] = 1; - values[valuesById[2] = "CHILD_TO_PARENT"] = 2; - return values; - })(); - - return TransferRule; - })(); - - /** - * ExecutionType enum. - * @name google.cloud.ces.v1beta.ExecutionType - * @enum {number} - * @property {number} EXECUTION_TYPE_UNSPECIFIED=0 EXECUTION_TYPE_UNSPECIFIED value - * @property {number} SYNCHRONOUS=1 SYNCHRONOUS value - * @property {number} ASYNCHRONOUS=2 ASYNCHRONOUS value - */ - v1beta.ExecutionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EXECUTION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SYNCHRONOUS"] = 1; - values[valuesById[2] = "ASYNCHRONOUS"] = 2; - return values; - })(); - - v1beta.Callback = (function() { - - /** - * Properties of a Callback. - * @memberof google.cloud.ces.v1beta - * @interface ICallback - * @property {string|null} [pythonCode] Callback pythonCode - * @property {string|null} [description] Callback description - * @property {boolean|null} [disabled] Callback disabled - * @property {boolean|null} [proactiveExecutionEnabled] Callback proactiveExecutionEnabled - */ - - /** - * Constructs a new Callback. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a Callback. - * @implements ICallback - * @constructor - * @param {google.cloud.ces.v1beta.ICallback=} [properties] Properties to set - */ - function Callback(properties) { - if (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 pythonCode. - * @member {string|null|undefined} pythonCode - * @memberof google.cloud.ces.v1beta.Callback - * @instance - */ - Callback.prototype.pythonCode = null; - - /** - * Callback description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.Callback - * @instance - */ - Callback.prototype.description = ""; - - /** - * Callback disabled. - * @member {boolean} disabled - * @memberof google.cloud.ces.v1beta.Callback - * @instance - */ - Callback.prototype.disabled = false; - - /** - * Callback proactiveExecutionEnabled. - * @member {boolean} proactiveExecutionEnabled - * @memberof google.cloud.ces.v1beta.Callback - * @instance - */ - Callback.prototype.proactiveExecutionEnabled = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Callback callback. - * @member {"pythonCode"|undefined} callback - * @memberof google.cloud.ces.v1beta.Callback - * @instance - */ - Object.defineProperty(Callback.prototype, "callback", { - get: $util.oneOfGetter($oneOfFields = ["pythonCode"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Callback instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Callback - * @static - * @param {google.cloud.ces.v1beta.ICallback=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Callback} Callback instance - */ - Callback.create = function create(properties) { - return new Callback(properties); - }; - - /** - * Encodes the specified Callback message. Does not implicitly {@link google.cloud.ces.v1beta.Callback.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Callback - * @static - * @param {google.cloud.ces.v1beta.ICallback} message Callback message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Callback.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pythonCode); - if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.disabled); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.proactiveExecutionEnabled != null && Object.hasOwnProperty.call(message, "proactiveExecutionEnabled")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.proactiveExecutionEnabled); - return writer; - }; - - /** - * Encodes the specified Callback message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Callback.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Callback - * @static - * @param {google.cloud.ces.v1beta.ICallback} message Callback message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Callback.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Callback message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Callback - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Callback} Callback - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Callback.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Callback(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pythonCode = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 2: { - message.disabled = reader.bool(); - break; - } - case 4: { - message.proactiveExecutionEnabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Callback message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Callback - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Callback} Callback - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Callback.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Callback message. - * @function verify - * @memberof google.cloud.ces.v1beta.Callback - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Callback.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) { - properties.callback = 1; - if (!$util.isString(message.pythonCode)) - return "pythonCode: string expected"; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.disabled != null && message.hasOwnProperty("disabled")) - if (typeof message.disabled !== "boolean") - return "disabled: boolean expected"; - if (message.proactiveExecutionEnabled != null && message.hasOwnProperty("proactiveExecutionEnabled")) - if (typeof message.proactiveExecutionEnabled !== "boolean") - return "proactiveExecutionEnabled: boolean expected"; - return null; - }; - - /** - * Creates a Callback message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Callback - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Callback} Callback - */ - Callback.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Callback) - return object; - var message = new $root.google.cloud.ces.v1beta.Callback(); - if (object.pythonCode != null) - message.pythonCode = String(object.pythonCode); - if (object.description != null) - message.description = String(object.description); - if (object.disabled != null) - message.disabled = Boolean(object.disabled); - if (object.proactiveExecutionEnabled != null) - message.proactiveExecutionEnabled = Boolean(object.proactiveExecutionEnabled); - return message; - }; - - /** - * Creates a plain object from a Callback message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Callback - * @static - * @param {google.cloud.ces.v1beta.Callback} message Callback - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Callback.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.disabled = false; - object.description = ""; - object.proactiveExecutionEnabled = false; - } - if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) { - object.pythonCode = message.pythonCode; - if (options.oneofs) - object.callback = "pythonCode"; - } - if (message.disabled != null && message.hasOwnProperty("disabled")) - object.disabled = message.disabled; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.proactiveExecutionEnabled != null && message.hasOwnProperty("proactiveExecutionEnabled")) - object.proactiveExecutionEnabled = message.proactiveExecutionEnabled; - return object; - }; - - /** - * Converts this Callback to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Callback - * @instance - * @returns {Object.} JSON object - */ - Callback.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Callback - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Callback - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Callback.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Callback"; - }; - - return Callback; - })(); - - v1beta.ModelSettings = (function() { - - /** - * Properties of a ModelSettings. - * @memberof google.cloud.ces.v1beta - * @interface IModelSettings - * @property {string|null} [model] ModelSettings model - * @property {number|null} [temperature] ModelSettings temperature - */ - - /** - * Constructs a new ModelSettings. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ModelSettings. - * @implements IModelSettings - * @constructor - * @param {google.cloud.ces.v1beta.IModelSettings=} [properties] Properties to set - */ - function ModelSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ModelSettings model. - * @member {string} model - * @memberof google.cloud.ces.v1beta.ModelSettings - * @instance - */ - ModelSettings.prototype.model = ""; - - /** - * ModelSettings temperature. - * @member {number|null|undefined} temperature - * @memberof google.cloud.ces.v1beta.ModelSettings - * @instance - */ - ModelSettings.prototype.temperature = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ModelSettings.prototype, "_temperature", { - get: $util.oneOfGetter($oneOfFields = ["temperature"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ModelSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ModelSettings - * @static - * @param {google.cloud.ces.v1beta.IModelSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ModelSettings} ModelSettings instance - */ - ModelSettings.create = function create(properties) { - return new ModelSettings(properties); - }; - - /** - * Encodes the specified ModelSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ModelSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ModelSettings - * @static - * @param {google.cloud.ces.v1beta.IModelSettings} message ModelSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModelSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); - if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.temperature); - return writer; - }; - - /** - * Encodes the specified ModelSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ModelSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ModelSettings - * @static - * @param {google.cloud.ces.v1beta.IModelSettings} message ModelSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModelSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ModelSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ModelSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ModelSettings} ModelSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModelSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ModelSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.model = reader.string(); - break; - } - case 2: { - message.temperature = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ModelSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ModelSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ModelSettings} ModelSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModelSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ModelSettings message. - * @function verify - * @memberof google.cloud.ces.v1beta.ModelSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ModelSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.model != null && message.hasOwnProperty("model")) - if (!$util.isString(message.model)) - return "model: string expected"; - if (message.temperature != null && message.hasOwnProperty("temperature")) { - properties._temperature = 1; - if (typeof message.temperature !== "number") - return "temperature: number expected"; - } - return null; - }; - - /** - * Creates a ModelSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ModelSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ModelSettings} ModelSettings - */ - ModelSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ModelSettings) - return object; - var message = new $root.google.cloud.ces.v1beta.ModelSettings(); - if (object.model != null) - message.model = String(object.model); - if (object.temperature != null) - message.temperature = Number(object.temperature); - return message; - }; - - /** - * Creates a plain object from a ModelSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ModelSettings - * @static - * @param {google.cloud.ces.v1beta.ModelSettings} message ModelSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ModelSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.model = ""; - if (message.model != null && message.hasOwnProperty("model")) - object.model = message.model; - if (message.temperature != null && message.hasOwnProperty("temperature")) { - object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; - if (options.oneofs) - object._temperature = "temperature"; - } - return object; - }; - - /** - * Converts this ModelSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ModelSettings - * @instance - * @returns {Object.} JSON object - */ - ModelSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ModelSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ModelSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ModelSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ModelSettings"; - }; - - return ModelSettings; - })(); - - v1beta.TriggerAction = (function() { - - /** - * Properties of a TriggerAction. - * @memberof google.cloud.ces.v1beta - * @interface ITriggerAction - * @property {google.cloud.ces.v1beta.TriggerAction.IRespondImmediately|null} [respondImmediately] TriggerAction respondImmediately - * @property {google.cloud.ces.v1beta.TriggerAction.ITransferAgent|null} [transferAgent] TriggerAction transferAgent - * @property {google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer|null} [generativeAnswer] TriggerAction generativeAnswer - */ - - /** - * Constructs a new TriggerAction. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a TriggerAction. - * @implements ITriggerAction - * @constructor - * @param {google.cloud.ces.v1beta.ITriggerAction=} [properties] Properties to set - */ - function TriggerAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TriggerAction respondImmediately. - * @member {google.cloud.ces.v1beta.TriggerAction.IRespondImmediately|null|undefined} respondImmediately - * @memberof google.cloud.ces.v1beta.TriggerAction - * @instance - */ - TriggerAction.prototype.respondImmediately = null; - - /** - * TriggerAction transferAgent. - * @member {google.cloud.ces.v1beta.TriggerAction.ITransferAgent|null|undefined} transferAgent - * @memberof google.cloud.ces.v1beta.TriggerAction - * @instance - */ - TriggerAction.prototype.transferAgent = null; - - /** - * TriggerAction generativeAnswer. - * @member {google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer|null|undefined} generativeAnswer - * @memberof google.cloud.ces.v1beta.TriggerAction - * @instance - */ - TriggerAction.prototype.generativeAnswer = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TriggerAction action. - * @member {"respondImmediately"|"transferAgent"|"generativeAnswer"|undefined} action - * @memberof google.cloud.ces.v1beta.TriggerAction - * @instance - */ - Object.defineProperty(TriggerAction.prototype, "action", { - get: $util.oneOfGetter($oneOfFields = ["respondImmediately", "transferAgent", "generativeAnswer"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TriggerAction instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.TriggerAction - * @static - * @param {google.cloud.ces.v1beta.ITriggerAction=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.TriggerAction} TriggerAction instance - */ - TriggerAction.create = function create(properties) { - return new TriggerAction(properties); - }; - - /** - * Encodes the specified TriggerAction message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.TriggerAction - * @static - * @param {google.cloud.ces.v1beta.ITriggerAction} message TriggerAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TriggerAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.respondImmediately != null && Object.hasOwnProperty.call(message, "respondImmediately")) - $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately.encode(message.respondImmediately, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.transferAgent != null && Object.hasOwnProperty.call(message, "transferAgent")) - $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent.encode(message.transferAgent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.generativeAnswer != null && Object.hasOwnProperty.call(message, "generativeAnswer")) - $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.encode(message.generativeAnswer, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TriggerAction message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.TriggerAction - * @static - * @param {google.cloud.ces.v1beta.ITriggerAction} message TriggerAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TriggerAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TriggerAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.TriggerAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.TriggerAction} TriggerAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TriggerAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TriggerAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.respondImmediately = $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately.decode(reader, reader.uint32()); - break; - } - case 2: { - message.transferAgent = $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent.decode(reader, reader.uint32()); - break; - } - case 3: { - message.generativeAnswer = $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TriggerAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.TriggerAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.TriggerAction} TriggerAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TriggerAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TriggerAction message. - * @function verify - * @memberof google.cloud.ces.v1beta.TriggerAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TriggerAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.respondImmediately != null && message.hasOwnProperty("respondImmediately")) { - properties.action = 1; - { - var error = $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately.verify(message.respondImmediately); - if (error) - return "respondImmediately." + error; - } - } - if (message.transferAgent != null && message.hasOwnProperty("transferAgent")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent.verify(message.transferAgent); - if (error) - return "transferAgent." + error; - } - } - if (message.generativeAnswer != null && message.hasOwnProperty("generativeAnswer")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.verify(message.generativeAnswer); - if (error) - return "generativeAnswer." + error; - } - } - return null; - }; - - /** - * Creates a TriggerAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.TriggerAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.TriggerAction} TriggerAction - */ - TriggerAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.TriggerAction) - return object; - var message = new $root.google.cloud.ces.v1beta.TriggerAction(); - if (object.respondImmediately != null) { - if (typeof object.respondImmediately !== "object") - throw TypeError(".google.cloud.ces.v1beta.TriggerAction.respondImmediately: object expected"); - message.respondImmediately = $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately.fromObject(object.respondImmediately); - } - if (object.transferAgent != null) { - if (typeof object.transferAgent !== "object") - throw TypeError(".google.cloud.ces.v1beta.TriggerAction.transferAgent: object expected"); - message.transferAgent = $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent.fromObject(object.transferAgent); - } - if (object.generativeAnswer != null) { - if (typeof object.generativeAnswer !== "object") - throw TypeError(".google.cloud.ces.v1beta.TriggerAction.generativeAnswer: object expected"); - message.generativeAnswer = $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.fromObject(object.generativeAnswer); - } - return message; - }; - - /** - * Creates a plain object from a TriggerAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.TriggerAction - * @static - * @param {google.cloud.ces.v1beta.TriggerAction} message TriggerAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TriggerAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.respondImmediately != null && message.hasOwnProperty("respondImmediately")) { - object.respondImmediately = $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately.toObject(message.respondImmediately, options); - if (options.oneofs) - object.action = "respondImmediately"; - } - if (message.transferAgent != null && message.hasOwnProperty("transferAgent")) { - object.transferAgent = $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent.toObject(message.transferAgent, options); - if (options.oneofs) - object.action = "transferAgent"; - } - if (message.generativeAnswer != null && message.hasOwnProperty("generativeAnswer")) { - object.generativeAnswer = $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.toObject(message.generativeAnswer, options); - if (options.oneofs) - object.action = "generativeAnswer"; - } - return object; - }; - - /** - * Converts this TriggerAction to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.TriggerAction - * @instance - * @returns {Object.} JSON object - */ - TriggerAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TriggerAction - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.TriggerAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TriggerAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.TriggerAction"; - }; - - TriggerAction.Response = (function() { - - /** - * Properties of a Response. - * @memberof google.cloud.ces.v1beta.TriggerAction - * @interface IResponse - * @property {string|null} [text] Response text - * @property {boolean|null} [disabled] Response disabled - */ - - /** - * Constructs a new Response. - * @memberof google.cloud.ces.v1beta.TriggerAction - * @classdesc Represents a Response. - * @implements IResponse - * @constructor - * @param {google.cloud.ces.v1beta.TriggerAction.IResponse=} [properties] Properties to set - */ - function Response(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Response text. - * @member {string} text - * @memberof google.cloud.ces.v1beta.TriggerAction.Response - * @instance - */ - Response.prototype.text = ""; - - /** - * Response disabled. - * @member {boolean} disabled - * @memberof google.cloud.ces.v1beta.TriggerAction.Response - * @instance - */ - Response.prototype.disabled = false; - - /** - * Creates a new Response instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.TriggerAction.Response - * @static - * @param {google.cloud.ces.v1beta.TriggerAction.IResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.TriggerAction.Response} Response instance - */ - Response.create = function create(properties) { - return new Response(properties); - }; - - /** - * Encodes the specified Response message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.Response.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.TriggerAction.Response - * @static - * @param {google.cloud.ces.v1beta.TriggerAction.IResponse} message Response message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Response.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.disabled); - return writer; - }; - - /** - * Encodes the specified Response message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.Response.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.TriggerAction.Response - * @static - * @param {google.cloud.ces.v1beta.TriggerAction.IResponse} message Response message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Response.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Response message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.TriggerAction.Response - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.TriggerAction.Response} Response - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Response.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TriggerAction.Response(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.text = reader.string(); - break; - } - case 2: { - message.disabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Response message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.TriggerAction.Response - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.TriggerAction.Response} Response - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Response.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Response message. - * @function verify - * @memberof google.cloud.ces.v1beta.TriggerAction.Response - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Response.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.disabled != null && message.hasOwnProperty("disabled")) - if (typeof message.disabled !== "boolean") - return "disabled: boolean expected"; - return null; - }; - - /** - * Creates a Response message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.TriggerAction.Response - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.TriggerAction.Response} Response - */ - Response.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.TriggerAction.Response) - return object; - var message = new $root.google.cloud.ces.v1beta.TriggerAction.Response(); - if (object.text != null) - message.text = String(object.text); - if (object.disabled != null) - message.disabled = Boolean(object.disabled); - return message; - }; - - /** - * Creates a plain object from a Response message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.TriggerAction.Response - * @static - * @param {google.cloud.ces.v1beta.TriggerAction.Response} message Response - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Response.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.text = ""; - object.disabled = false; - } - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.disabled != null && message.hasOwnProperty("disabled")) - object.disabled = message.disabled; - return object; - }; - - /** - * Converts this Response to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.TriggerAction.Response - * @instance - * @returns {Object.} JSON object - */ - Response.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Response - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.TriggerAction.Response - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Response.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.TriggerAction.Response"; - }; - - return Response; - })(); - - TriggerAction.RespondImmediately = (function() { - - /** - * Properties of a RespondImmediately. - * @memberof google.cloud.ces.v1beta.TriggerAction - * @interface IRespondImmediately - * @property {Array.|null} [responses] RespondImmediately responses - */ - - /** - * Constructs a new RespondImmediately. - * @memberof google.cloud.ces.v1beta.TriggerAction - * @classdesc Represents a RespondImmediately. - * @implements IRespondImmediately - * @constructor - * @param {google.cloud.ces.v1beta.TriggerAction.IRespondImmediately=} [properties] Properties to set - */ - function RespondImmediately(properties) { - this.responses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RespondImmediately responses. - * @member {Array.} responses - * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately - * @instance - */ - RespondImmediately.prototype.responses = $util.emptyArray; - - /** - * Creates a new RespondImmediately instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately - * @static - * @param {google.cloud.ces.v1beta.TriggerAction.IRespondImmediately=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.TriggerAction.RespondImmediately} RespondImmediately instance - */ - RespondImmediately.create = function create(properties) { - return new RespondImmediately(properties); - }; - - /** - * Encodes the specified RespondImmediately message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.RespondImmediately.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately - * @static - * @param {google.cloud.ces.v1beta.TriggerAction.IRespondImmediately} message RespondImmediately message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RespondImmediately.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responses != null && message.responses.length) - for (var i = 0; i < message.responses.length; ++i) - $root.google.cloud.ces.v1beta.TriggerAction.Response.encode(message.responses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RespondImmediately message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.RespondImmediately.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately - * @static - * @param {google.cloud.ces.v1beta.TriggerAction.IRespondImmediately} message RespondImmediately message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RespondImmediately.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RespondImmediately message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.TriggerAction.RespondImmediately} RespondImmediately - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RespondImmediately.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.responses && message.responses.length)) - message.responses = []; - message.responses.push($root.google.cloud.ces.v1beta.TriggerAction.Response.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RespondImmediately message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.TriggerAction.RespondImmediately} RespondImmediately - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RespondImmediately.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RespondImmediately message. - * @function verify - * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RespondImmediately.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responses != null && message.hasOwnProperty("responses")) { - if (!Array.isArray(message.responses)) - return "responses: array expected"; - for (var i = 0; i < message.responses.length; ++i) { - var error = $root.google.cloud.ces.v1beta.TriggerAction.Response.verify(message.responses[i]); - if (error) - return "responses." + error; - } - } - return null; - }; - - /** - * Creates a RespondImmediately message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.TriggerAction.RespondImmediately} RespondImmediately - */ - RespondImmediately.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately) - return object; - var message = new $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately(); - if (object.responses) { - if (!Array.isArray(object.responses)) - throw TypeError(".google.cloud.ces.v1beta.TriggerAction.RespondImmediately.responses: array expected"); - message.responses = []; - for (var i = 0; i < object.responses.length; ++i) { - if (typeof object.responses[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.TriggerAction.RespondImmediately.responses: object expected"); - message.responses[i] = $root.google.cloud.ces.v1beta.TriggerAction.Response.fromObject(object.responses[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RespondImmediately message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately - * @static - * @param {google.cloud.ces.v1beta.TriggerAction.RespondImmediately} message RespondImmediately - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RespondImmediately.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.responses = []; - if (message.responses && message.responses.length) { - object.responses = []; - for (var j = 0; j < message.responses.length; ++j) - object.responses[j] = $root.google.cloud.ces.v1beta.TriggerAction.Response.toObject(message.responses[j], options); - } - return object; - }; - - /** - * Converts this RespondImmediately to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately - * @instance - * @returns {Object.} JSON object - */ - RespondImmediately.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RespondImmediately - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RespondImmediately.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.TriggerAction.RespondImmediately"; - }; - - return RespondImmediately; - })(); - - TriggerAction.GenerativeAnswer = (function() { - - /** - * Properties of a GenerativeAnswer. - * @memberof google.cloud.ces.v1beta.TriggerAction - * @interface IGenerativeAnswer - * @property {string|null} [prompt] GenerativeAnswer prompt - */ - - /** - * Constructs a new GenerativeAnswer. - * @memberof google.cloud.ces.v1beta.TriggerAction - * @classdesc Represents a GenerativeAnswer. - * @implements IGenerativeAnswer - * @constructor - * @param {google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer=} [properties] Properties to set - */ - function GenerativeAnswer(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenerativeAnswer prompt. - * @member {string} prompt - * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer - * @instance - */ - GenerativeAnswer.prototype.prompt = ""; - - /** - * Creates a new GenerativeAnswer instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer - * @static - * @param {google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer} GenerativeAnswer instance - */ - GenerativeAnswer.create = function create(properties) { - return new GenerativeAnswer(properties); - }; - - /** - * Encodes the specified GenerativeAnswer message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer - * @static - * @param {google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer} message GenerativeAnswer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerativeAnswer.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.prompt); - return writer; - }; - - /** - * Encodes the specified GenerativeAnswer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer - * @static - * @param {google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer} message GenerativeAnswer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerativeAnswer.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenerativeAnswer message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer} GenerativeAnswer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerativeAnswer.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.prompt = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenerativeAnswer message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer} GenerativeAnswer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerativeAnswer.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenerativeAnswer message. - * @function verify - * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenerativeAnswer.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.prompt != null && message.hasOwnProperty("prompt")) - if (!$util.isString(message.prompt)) - return "prompt: string expected"; - return null; - }; - - /** - * Creates a GenerativeAnswer message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer} GenerativeAnswer - */ - GenerativeAnswer.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer) - return object; - var message = new $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer(); - if (object.prompt != null) - message.prompt = String(object.prompt); - return message; - }; - - /** - * Creates a plain object from a GenerativeAnswer message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer - * @static - * @param {google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer} message GenerativeAnswer - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenerativeAnswer.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.prompt = ""; - if (message.prompt != null && message.hasOwnProperty("prompt")) - object.prompt = message.prompt; - return object; - }; - - /** - * Converts this GenerativeAnswer to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer - * @instance - * @returns {Object.} JSON object - */ - GenerativeAnswer.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenerativeAnswer - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenerativeAnswer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer"; - }; - - return GenerativeAnswer; - })(); - - TriggerAction.TransferAgent = (function() { - - /** - * Properties of a TransferAgent. - * @memberof google.cloud.ces.v1beta.TriggerAction - * @interface ITransferAgent - * @property {string|null} [agent] TransferAgent agent - */ - - /** - * Constructs a new TransferAgent. - * @memberof google.cloud.ces.v1beta.TriggerAction - * @classdesc Represents a TransferAgent. - * @implements ITransferAgent - * @constructor - * @param {google.cloud.ces.v1beta.TriggerAction.ITransferAgent=} [properties] Properties to set - */ - function TransferAgent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TransferAgent agent. - * @member {string} agent - * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent - * @instance - */ - TransferAgent.prototype.agent = ""; - - /** - * Creates a new TransferAgent instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent - * @static - * @param {google.cloud.ces.v1beta.TriggerAction.ITransferAgent=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.TriggerAction.TransferAgent} TransferAgent instance - */ - TransferAgent.create = function create(properties) { - return new TransferAgent(properties); - }; - - /** - * Encodes the specified TransferAgent message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.TransferAgent.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent - * @static - * @param {google.cloud.ces.v1beta.TriggerAction.ITransferAgent} message TransferAgent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransferAgent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.agent); - return writer; - }; - - /** - * Encodes the specified TransferAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.TransferAgent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent - * @static - * @param {google.cloud.ces.v1beta.TriggerAction.ITransferAgent} message TransferAgent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransferAgent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransferAgent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.TriggerAction.TransferAgent} TransferAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransferAgent.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.agent = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransferAgent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.TriggerAction.TransferAgent} TransferAgent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransferAgent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransferAgent message. - * @function verify - * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransferAgent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.agent != null && message.hasOwnProperty("agent")) - if (!$util.isString(message.agent)) - return "agent: string expected"; - return null; - }; - - /** - * Creates a TransferAgent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.TriggerAction.TransferAgent} TransferAgent - */ - TransferAgent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent) - return object; - var message = new $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent(); - if (object.agent != null) - message.agent = String(object.agent); - return message; - }; - - /** - * Creates a plain object from a TransferAgent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent - * @static - * @param {google.cloud.ces.v1beta.TriggerAction.TransferAgent} message TransferAgent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransferAgent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.agent = ""; - if (message.agent != null && message.hasOwnProperty("agent")) - object.agent = message.agent; - return object; - }; - - /** - * Converts this TransferAgent to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent - * @instance - * @returns {Object.} JSON object - */ - TransferAgent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransferAgent - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransferAgent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.TriggerAction.TransferAgent"; - }; - - return TransferAgent; - })(); - - return TriggerAction; - })(); - - v1beta.TlsConfig = (function() { - - /** - * Properties of a TlsConfig. - * @memberof google.cloud.ces.v1beta - * @interface ITlsConfig - * @property {Array.|null} [caCerts] TlsConfig caCerts - */ - - /** - * Constructs a new TlsConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a TlsConfig. - * @implements ITlsConfig - * @constructor - * @param {google.cloud.ces.v1beta.ITlsConfig=} [properties] Properties to set - */ - function TlsConfig(properties) { - this.caCerts = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TlsConfig caCerts. - * @member {Array.} caCerts - * @memberof google.cloud.ces.v1beta.TlsConfig - * @instance - */ - TlsConfig.prototype.caCerts = $util.emptyArray; - - /** - * Creates a new TlsConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.TlsConfig - * @static - * @param {google.cloud.ces.v1beta.ITlsConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.TlsConfig} TlsConfig instance - */ - TlsConfig.create = function create(properties) { - return new TlsConfig(properties); - }; - - /** - * Encodes the specified TlsConfig message. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.TlsConfig - * @static - * @param {google.cloud.ces.v1beta.ITlsConfig} message TlsConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TlsConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.caCerts != null && message.caCerts.length) - for (var i = 0; i < message.caCerts.length; ++i) - $root.google.cloud.ces.v1beta.TlsConfig.CaCert.encode(message.caCerts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TlsConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.TlsConfig - * @static - * @param {google.cloud.ces.v1beta.ITlsConfig} message TlsConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TlsConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TlsConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.TlsConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.TlsConfig} TlsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TlsConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TlsConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.caCerts && message.caCerts.length)) - message.caCerts = []; - message.caCerts.push($root.google.cloud.ces.v1beta.TlsConfig.CaCert.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TlsConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.TlsConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.TlsConfig} TlsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TlsConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TlsConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.TlsConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TlsConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.caCerts != null && message.hasOwnProperty("caCerts")) { - if (!Array.isArray(message.caCerts)) - return "caCerts: array expected"; - for (var i = 0; i < message.caCerts.length; ++i) { - var error = $root.google.cloud.ces.v1beta.TlsConfig.CaCert.verify(message.caCerts[i]); - if (error) - return "caCerts." + error; - } - } - return null; - }; - - /** - * Creates a TlsConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.TlsConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.TlsConfig} TlsConfig - */ - TlsConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.TlsConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.TlsConfig(); - if (object.caCerts) { - if (!Array.isArray(object.caCerts)) - throw TypeError(".google.cloud.ces.v1beta.TlsConfig.caCerts: array expected"); - message.caCerts = []; - for (var i = 0; i < object.caCerts.length; ++i) { - if (typeof object.caCerts[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.TlsConfig.caCerts: object expected"); - message.caCerts[i] = $root.google.cloud.ces.v1beta.TlsConfig.CaCert.fromObject(object.caCerts[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TlsConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.TlsConfig - * @static - * @param {google.cloud.ces.v1beta.TlsConfig} message TlsConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TlsConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.caCerts = []; - if (message.caCerts && message.caCerts.length) { - object.caCerts = []; - for (var j = 0; j < message.caCerts.length; ++j) - object.caCerts[j] = $root.google.cloud.ces.v1beta.TlsConfig.CaCert.toObject(message.caCerts[j], options); - } - return object; - }; - - /** - * Converts this TlsConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.TlsConfig - * @instance - * @returns {Object.} JSON object - */ - TlsConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TlsConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.TlsConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TlsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.TlsConfig"; - }; - - TlsConfig.CaCert = (function() { - - /** - * Properties of a CaCert. - * @memberof google.cloud.ces.v1beta.TlsConfig - * @interface ICaCert - * @property {string|null} [displayName] CaCert displayName - * @property {Uint8Array|null} [cert] CaCert cert - */ - - /** - * Constructs a new CaCert. - * @memberof google.cloud.ces.v1beta.TlsConfig - * @classdesc Represents a CaCert. - * @implements ICaCert - * @constructor - * @param {google.cloud.ces.v1beta.TlsConfig.ICaCert=} [properties] Properties to set - */ - function CaCert(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CaCert displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert - * @instance - */ - CaCert.prototype.displayName = ""; - - /** - * CaCert cert. - * @member {Uint8Array} cert - * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert - * @instance - */ - CaCert.prototype.cert = $util.newBuffer([]); - - /** - * Creates a new CaCert instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert - * @static - * @param {google.cloud.ces.v1beta.TlsConfig.ICaCert=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.TlsConfig.CaCert} CaCert instance - */ - CaCert.create = function create(properties) { - return new CaCert(properties); - }; - - /** - * Encodes the specified CaCert message. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.CaCert.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert - * @static - * @param {google.cloud.ces.v1beta.TlsConfig.ICaCert} message CaCert message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CaCert.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); - if (message.cert != null && Object.hasOwnProperty.call(message, "cert")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.cert); - return writer; - }; - - /** - * Encodes the specified CaCert message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.CaCert.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert - * @static - * @param {google.cloud.ces.v1beta.TlsConfig.ICaCert} message CaCert message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CaCert.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CaCert message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.TlsConfig.CaCert} CaCert - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CaCert.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TlsConfig.CaCert(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.displayName = reader.string(); - break; - } - case 2: { - message.cert = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CaCert message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.TlsConfig.CaCert} CaCert - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CaCert.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CaCert message. - * @function verify - * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CaCert.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.cert != null && message.hasOwnProperty("cert")) - if (!(message.cert && typeof message.cert.length === "number" || $util.isString(message.cert))) - return "cert: buffer expected"; - return null; - }; - - /** - * Creates a CaCert message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.TlsConfig.CaCert} CaCert - */ - CaCert.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.TlsConfig.CaCert) - return object; - var message = new $root.google.cloud.ces.v1beta.TlsConfig.CaCert(); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.cert != null) - if (typeof object.cert === "string") - $util.base64.decode(object.cert, message.cert = $util.newBuffer($util.base64.length(object.cert)), 0); - else if (object.cert.length >= 0) - message.cert = object.cert; - return message; - }; - - /** - * Creates a plain object from a CaCert message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert - * @static - * @param {google.cloud.ces.v1beta.TlsConfig.CaCert} message CaCert - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CaCert.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.displayName = ""; - if (options.bytes === String) - object.cert = ""; - else { - object.cert = []; - if (options.bytes !== Array) - object.cert = $util.newBuffer(object.cert); - } - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.cert != null && message.hasOwnProperty("cert")) - object.cert = options.bytes === String ? $util.base64.encode(message.cert, 0, message.cert.length) : options.bytes === Array ? Array.prototype.slice.call(message.cert) : message.cert; - return object; - }; - - /** - * Converts this CaCert to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert - * @instance - * @returns {Object.} JSON object - */ - CaCert.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CaCert - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CaCert.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.TlsConfig.CaCert"; - }; - - return CaCert; - })(); - - return TlsConfig; - })(); - - v1beta.ServiceDirectoryConfig = (function() { - - /** - * Properties of a ServiceDirectoryConfig. - * @memberof google.cloud.ces.v1beta - * @interface IServiceDirectoryConfig - * @property {string|null} [service] ServiceDirectoryConfig service - */ - - /** - * Constructs a new ServiceDirectoryConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ServiceDirectoryConfig. - * @implements IServiceDirectoryConfig - * @constructor - * @param {google.cloud.ces.v1beta.IServiceDirectoryConfig=} [properties] Properties to set - */ - function ServiceDirectoryConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDirectoryConfig service. - * @member {string} service - * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig - * @instance - */ - ServiceDirectoryConfig.prototype.service = ""; - - /** - * Creates a new ServiceDirectoryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig - * @static - * @param {google.cloud.ces.v1beta.IServiceDirectoryConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ServiceDirectoryConfig} ServiceDirectoryConfig instance - */ - ServiceDirectoryConfig.create = function create(properties) { - return new ServiceDirectoryConfig(properties); - }; - - /** - * Encodes the specified ServiceDirectoryConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ServiceDirectoryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig - * @static - * @param {google.cloud.ces.v1beta.IServiceDirectoryConfig} message ServiceDirectoryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDirectoryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); - return writer; - }; - - /** - * Encodes the specified ServiceDirectoryConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ServiceDirectoryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig - * @static - * @param {google.cloud.ces.v1beta.IServiceDirectoryConfig} message ServiceDirectoryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDirectoryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDirectoryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ServiceDirectoryConfig} ServiceDirectoryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDirectoryConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ServiceDirectoryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.service = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDirectoryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ServiceDirectoryConfig} ServiceDirectoryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDirectoryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDirectoryConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDirectoryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - return null; - }; - - /** - * Creates a ServiceDirectoryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ServiceDirectoryConfig} ServiceDirectoryConfig - */ - ServiceDirectoryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ServiceDirectoryConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.ServiceDirectoryConfig(); - if (object.service != null) - message.service = String(object.service); - return message; - }; - - /** - * Creates a plain object from a ServiceDirectoryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig - * @static - * @param {google.cloud.ces.v1beta.ServiceDirectoryConfig} message ServiceDirectoryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDirectoryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.service = ""; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - return object; - }; - - /** - * Converts this ServiceDirectoryConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig - * @instance - * @returns {Object.} JSON object - */ - ServiceDirectoryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDirectoryConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDirectoryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ServiceDirectoryConfig"; - }; - - return ServiceDirectoryConfig; - })(); - - v1beta.ChannelProfile = (function() { - - /** - * Properties of a ChannelProfile. - * @memberof google.cloud.ces.v1beta - * @interface IChannelProfile - * @property {string|null} [profileId] ChannelProfile profileId - * @property {google.cloud.ces.v1beta.ChannelProfile.ChannelType|null} [channelType] ChannelProfile channelType - * @property {google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty|null} [personaProperty] ChannelProfile personaProperty - * @property {boolean|null} [disableDtmf] ChannelProfile disableDtmf - * @property {boolean|null} [disableBargeInControl] ChannelProfile disableBargeInControl - * @property {google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig|null} [webWidgetConfig] ChannelProfile webWidgetConfig - * @property {string|null} [noiseSuppressionLevel] ChannelProfile noiseSuppressionLevel - */ - - /** - * Constructs a new ChannelProfile. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ChannelProfile. - * @implements IChannelProfile - * @constructor - * @param {google.cloud.ces.v1beta.IChannelProfile=} [properties] Properties to set - */ - function ChannelProfile(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChannelProfile profileId. - * @member {string} profileId - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @instance - */ - ChannelProfile.prototype.profileId = ""; - - /** - * ChannelProfile channelType. - * @member {google.cloud.ces.v1beta.ChannelProfile.ChannelType} channelType - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @instance - */ - ChannelProfile.prototype.channelType = 0; - - /** - * ChannelProfile personaProperty. - * @member {google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty|null|undefined} personaProperty - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @instance - */ - ChannelProfile.prototype.personaProperty = null; - - /** - * ChannelProfile disableDtmf. - * @member {boolean} disableDtmf - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @instance - */ - ChannelProfile.prototype.disableDtmf = false; - - /** - * ChannelProfile disableBargeInControl. - * @member {boolean} disableBargeInControl - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @instance - */ - ChannelProfile.prototype.disableBargeInControl = false; - - /** - * ChannelProfile webWidgetConfig. - * @member {google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig|null|undefined} webWidgetConfig - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @instance - */ - ChannelProfile.prototype.webWidgetConfig = null; - - /** - * ChannelProfile noiseSuppressionLevel. - * @member {string} noiseSuppressionLevel - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @instance - */ - ChannelProfile.prototype.noiseSuppressionLevel = ""; - - /** - * Creates a new ChannelProfile instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @static - * @param {google.cloud.ces.v1beta.IChannelProfile=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ChannelProfile} ChannelProfile instance - */ - ChannelProfile.create = function create(properties) { - return new ChannelProfile(properties); - }; - - /** - * Encodes the specified ChannelProfile message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @static - * @param {google.cloud.ces.v1beta.IChannelProfile} message ChannelProfile message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChannelProfile.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.profileId != null && Object.hasOwnProperty.call(message, "profileId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.profileId); - if (message.personaProperty != null && Object.hasOwnProperty.call(message, "personaProperty")) - $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.encode(message.personaProperty, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.channelType != null && Object.hasOwnProperty.call(message, "channelType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.channelType); - if (message.disableDtmf != null && Object.hasOwnProperty.call(message, "disableDtmf")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.disableDtmf); - if (message.disableBargeInControl != null && Object.hasOwnProperty.call(message, "disableBargeInControl")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disableBargeInControl); - if (message.webWidgetConfig != null && Object.hasOwnProperty.call(message, "webWidgetConfig")) - $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.encode(message.webWidgetConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.noiseSuppressionLevel != null && Object.hasOwnProperty.call(message, "noiseSuppressionLevel")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.noiseSuppressionLevel); - return writer; - }; - - /** - * Encodes the specified ChannelProfile message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @static - * @param {google.cloud.ces.v1beta.IChannelProfile} message ChannelProfile message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChannelProfile.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChannelProfile message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ChannelProfile} ChannelProfile - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChannelProfile.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ChannelProfile(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.profileId = reader.string(); - break; - } - case 3: { - message.channelType = reader.int32(); - break; - } - case 2: { - message.personaProperty = $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.decode(reader, reader.uint32()); - break; - } - case 4: { - message.disableDtmf = reader.bool(); - break; - } - case 5: { - message.disableBargeInControl = reader.bool(); - break; - } - case 7: { - message.webWidgetConfig = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.decode(reader, reader.uint32()); - break; - } - case 8: { - message.noiseSuppressionLevel = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChannelProfile message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ChannelProfile} ChannelProfile - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChannelProfile.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChannelProfile message. - * @function verify - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChannelProfile.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.profileId != null && message.hasOwnProperty("profileId")) - if (!$util.isString(message.profileId)) - return "profileId: string expected"; - if (message.channelType != null && message.hasOwnProperty("channelType")) - switch (message.channelType) { - default: - return "channelType: enum value expected"; - case 0: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - if (message.personaProperty != null && message.hasOwnProperty("personaProperty")) { - var error = $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.verify(message.personaProperty); - if (error) - return "personaProperty." + error; - } - if (message.disableDtmf != null && message.hasOwnProperty("disableDtmf")) - if (typeof message.disableDtmf !== "boolean") - return "disableDtmf: boolean expected"; - if (message.disableBargeInControl != null && message.hasOwnProperty("disableBargeInControl")) - if (typeof message.disableBargeInControl !== "boolean") - return "disableBargeInControl: boolean expected"; - if (message.webWidgetConfig != null && message.hasOwnProperty("webWidgetConfig")) { - var error = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.verify(message.webWidgetConfig); - if (error) - return "webWidgetConfig." + error; - } - if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) - if (!$util.isString(message.noiseSuppressionLevel)) - return "noiseSuppressionLevel: string expected"; - return null; - }; - - /** - * Creates a ChannelProfile message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ChannelProfile} ChannelProfile - */ - ChannelProfile.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ChannelProfile) - return object; - var message = new $root.google.cloud.ces.v1beta.ChannelProfile(); - if (object.profileId != null) - message.profileId = String(object.profileId); - switch (object.channelType) { - default: - if (typeof object.channelType === "number") { - message.channelType = object.channelType; - break; - } - break; - case "UNKNOWN": - case 0: - message.channelType = 0; - break; - case "WEB_UI": - case 2: - message.channelType = 2; - break; - case "API": - case 3: - message.channelType = 3; - break; - case "TWILIO": - case 4: - message.channelType = 4; - break; - case "GOOGLE_TELEPHONY_PLATFORM": - case 5: - message.channelType = 5; - break; - case "CONTACT_CENTER_AS_A_SERVICE": - case 6: - message.channelType = 6; - break; - case "FIVE9": - case 7: - message.channelType = 7; - break; - case "CONTACT_CENTER_INTEGRATION": - case 8: - message.channelType = 8; - break; - } - if (object.personaProperty != null) { - if (typeof object.personaProperty !== "object") - throw TypeError(".google.cloud.ces.v1beta.ChannelProfile.personaProperty: object expected"); - message.personaProperty = $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.fromObject(object.personaProperty); - } - if (object.disableDtmf != null) - message.disableDtmf = Boolean(object.disableDtmf); - if (object.disableBargeInControl != null) - message.disableBargeInControl = Boolean(object.disableBargeInControl); - if (object.webWidgetConfig != null) { - if (typeof object.webWidgetConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.ChannelProfile.webWidgetConfig: object expected"); - message.webWidgetConfig = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.fromObject(object.webWidgetConfig); - } - if (object.noiseSuppressionLevel != null) - message.noiseSuppressionLevel = String(object.noiseSuppressionLevel); - return message; - }; - - /** - * Creates a plain object from a ChannelProfile message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @static - * @param {google.cloud.ces.v1beta.ChannelProfile} message ChannelProfile - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChannelProfile.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.profileId = ""; - object.personaProperty = null; - object.channelType = options.enums === String ? "UNKNOWN" : 0; - object.disableDtmf = false; - object.disableBargeInControl = false; - object.webWidgetConfig = null; - object.noiseSuppressionLevel = ""; - } - if (message.profileId != null && message.hasOwnProperty("profileId")) - object.profileId = message.profileId; - if (message.personaProperty != null && message.hasOwnProperty("personaProperty")) - object.personaProperty = $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.toObject(message.personaProperty, options); - if (message.channelType != null && message.hasOwnProperty("channelType")) - object.channelType = options.enums === String ? $root.google.cloud.ces.v1beta.ChannelProfile.ChannelType[message.channelType] === undefined ? message.channelType : $root.google.cloud.ces.v1beta.ChannelProfile.ChannelType[message.channelType] : message.channelType; - if (message.disableDtmf != null && message.hasOwnProperty("disableDtmf")) - object.disableDtmf = message.disableDtmf; - if (message.disableBargeInControl != null && message.hasOwnProperty("disableBargeInControl")) - object.disableBargeInControl = message.disableBargeInControl; - if (message.webWidgetConfig != null && message.hasOwnProperty("webWidgetConfig")) - object.webWidgetConfig = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.toObject(message.webWidgetConfig, options); - if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) - object.noiseSuppressionLevel = message.noiseSuppressionLevel; - return object; - }; - - /** - * Converts this ChannelProfile to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @instance - * @returns {Object.} JSON object - */ - ChannelProfile.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ChannelProfile - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ChannelProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ChannelProfile"; - }; - - ChannelProfile.PersonaProperty = (function() { - - /** - * Properties of a PersonaProperty. - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @interface IPersonaProperty - * @property {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona|null} [persona] PersonaProperty persona - */ - - /** - * Constructs a new PersonaProperty. - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @classdesc Represents a PersonaProperty. - * @implements IPersonaProperty - * @constructor - * @param {google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty=} [properties] Properties to set - */ - function PersonaProperty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PersonaProperty persona. - * @member {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona} persona - * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty - * @instance - */ - PersonaProperty.prototype.persona = 0; - - /** - * Creates a new PersonaProperty instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty - * @static - * @param {google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty} PersonaProperty instance - */ - PersonaProperty.create = function create(properties) { - return new PersonaProperty(properties); - }; - - /** - * Encodes the specified PersonaProperty message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty - * @static - * @param {google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty} message PersonaProperty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PersonaProperty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.persona != null && Object.hasOwnProperty.call(message, "persona")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.persona); - return writer; - }; - - /** - * Encodes the specified PersonaProperty message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty - * @static - * @param {google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty} message PersonaProperty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PersonaProperty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PersonaProperty message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty} PersonaProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PersonaProperty.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.persona = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PersonaProperty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty} PersonaProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PersonaProperty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PersonaProperty message. - * @function verify - * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PersonaProperty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.persona != null && message.hasOwnProperty("persona")) - switch (message.persona) { - default: - return "persona: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a PersonaProperty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty} PersonaProperty - */ - PersonaProperty.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty) - return object; - var message = new $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty(); - switch (object.persona) { - default: - if (typeof object.persona === "number") { - message.persona = object.persona; - break; - } - break; - case "UNKNOWN": - case 0: - message.persona = 0; - break; - case "CONCISE": - case 1: - message.persona = 1; - break; - case "CHATTY": - case 2: - message.persona = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a PersonaProperty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty - * @static - * @param {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty} message PersonaProperty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PersonaProperty.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.persona = options.enums === String ? "UNKNOWN" : 0; - if (message.persona != null && message.hasOwnProperty("persona")) - object.persona = options.enums === String ? $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona[message.persona] === undefined ? message.persona : $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona[message.persona] : message.persona; - return object; - }; - - /** - * Converts this PersonaProperty to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty - * @instance - * @returns {Object.} JSON object - */ - PersonaProperty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PersonaProperty - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PersonaProperty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ChannelProfile.PersonaProperty"; - }; - - /** - * Persona enum. - * @name google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} CONCISE=1 CONCISE value - * @property {number} CHATTY=2 CHATTY value - */ - PersonaProperty.Persona = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "CONCISE"] = 1; - values[valuesById[2] = "CHATTY"] = 2; - return values; - })(); - - return PersonaProperty; - })(); - - ChannelProfile.WebWidgetConfig = (function() { - - /** - * Properties of a WebWidgetConfig. - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @interface IWebWidgetConfig - * @property {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality|null} [modality] WebWidgetConfig modality - * @property {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme|null} [theme] WebWidgetConfig theme - * @property {string|null} [webWidgetTitle] WebWidgetConfig webWidgetTitle - * @property {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings|null} [securitySettings] WebWidgetConfig securitySettings - */ - - /** - * Constructs a new WebWidgetConfig. - * @memberof google.cloud.ces.v1beta.ChannelProfile - * @classdesc Represents a WebWidgetConfig. - * @implements IWebWidgetConfig - * @constructor - * @param {google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig=} [properties] Properties to set - */ - function WebWidgetConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WebWidgetConfig modality. - * @member {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality} modality - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig - * @instance - */ - WebWidgetConfig.prototype.modality = 0; - - /** - * WebWidgetConfig theme. - * @member {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme} theme - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig - * @instance - */ - WebWidgetConfig.prototype.theme = 0; - - /** - * WebWidgetConfig webWidgetTitle. - * @member {string} webWidgetTitle - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig - * @instance - */ - WebWidgetConfig.prototype.webWidgetTitle = ""; - - /** - * WebWidgetConfig securitySettings. - * @member {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings|null|undefined} securitySettings - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig - * @instance - */ - WebWidgetConfig.prototype.securitySettings = null; - - /** - * Creates a new WebWidgetConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig - * @static - * @param {google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig} WebWidgetConfig instance - */ - WebWidgetConfig.create = function create(properties) { - return new WebWidgetConfig(properties); - }; - - /** - * Encodes the specified WebWidgetConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig - * @static - * @param {google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig} message WebWidgetConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebWidgetConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.modality != null && Object.hasOwnProperty.call(message, "modality")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modality); - if (message.theme != null && Object.hasOwnProperty.call(message, "theme")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.theme); - if (message.webWidgetTitle != null && Object.hasOwnProperty.call(message, "webWidgetTitle")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.webWidgetTitle); - if (message.securitySettings != null && Object.hasOwnProperty.call(message, "securitySettings")) - $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.encode(message.securitySettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WebWidgetConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig - * @static - * @param {google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig} message WebWidgetConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebWidgetConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WebWidgetConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig} WebWidgetConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebWidgetConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.modality = reader.int32(); - break; - } - case 2: { - message.theme = reader.int32(); - break; - } - case 3: { - message.webWidgetTitle = reader.string(); - break; - } - case 4: { - message.securitySettings = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WebWidgetConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig} WebWidgetConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebWidgetConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WebWidgetConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WebWidgetConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.modality != null && message.hasOwnProperty("modality")) - switch (message.modality) { - default: - return "modality: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.theme != null && message.hasOwnProperty("theme")) - switch (message.theme) { - default: - return "theme: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.webWidgetTitle != null && message.hasOwnProperty("webWidgetTitle")) - if (!$util.isString(message.webWidgetTitle)) - return "webWidgetTitle: string expected"; - if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) { - var error = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.verify(message.securitySettings); - if (error) - return "securitySettings." + error; - } - return null; - }; - - /** - * Creates a WebWidgetConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig} WebWidgetConfig - */ - WebWidgetConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig(); - switch (object.modality) { - default: - if (typeof object.modality === "number") { - message.modality = object.modality; - break; - } - break; - case "MODALITY_UNSPECIFIED": - case 0: - message.modality = 0; - break; - case "CHAT_AND_VOICE": - case 1: - message.modality = 1; - break; - case "VOICE_ONLY": - case 2: - message.modality = 2; - break; - case "CHAT_ONLY": - case 3: - message.modality = 3; - break; - } - switch (object.theme) { - default: - if (typeof object.theme === "number") { - message.theme = object.theme; - break; - } - break; - case "THEME_UNSPECIFIED": - case 0: - message.theme = 0; - break; - case "LIGHT": - case 1: - message.theme = 1; - break; - case "DARK": - case 2: - message.theme = 2; - break; - } - if (object.webWidgetTitle != null) - message.webWidgetTitle = String(object.webWidgetTitle); - if (object.securitySettings != null) { - if (typeof object.securitySettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.securitySettings: object expected"); - message.securitySettings = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.fromObject(object.securitySettings); - } - return message; - }; - - /** - * Creates a plain object from a WebWidgetConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig - * @static - * @param {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig} message WebWidgetConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WebWidgetConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.modality = options.enums === String ? "MODALITY_UNSPECIFIED" : 0; - object.theme = options.enums === String ? "THEME_UNSPECIFIED" : 0; - object.webWidgetTitle = ""; - object.securitySettings = null; - } - if (message.modality != null && message.hasOwnProperty("modality")) - object.modality = options.enums === String ? $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality[message.modality] === undefined ? message.modality : $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality[message.modality] : message.modality; - if (message.theme != null && message.hasOwnProperty("theme")) - object.theme = options.enums === String ? $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme[message.theme] === undefined ? message.theme : $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme[message.theme] : message.theme; - if (message.webWidgetTitle != null && message.hasOwnProperty("webWidgetTitle")) - object.webWidgetTitle = message.webWidgetTitle; - if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) - object.securitySettings = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.toObject(message.securitySettings, options); - return object; - }; - - /** - * Converts this WebWidgetConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig - * @instance - * @returns {Object.} JSON object - */ - WebWidgetConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WebWidgetConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WebWidgetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig"; - }; - - WebWidgetConfig.SecuritySettings = (function() { - - /** - * Properties of a SecuritySettings. - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig - * @interface ISecuritySettings - * @property {boolean|null} [enablePublicAccess] SecuritySettings enablePublicAccess - * @property {boolean|null} [enableOriginCheck] SecuritySettings enableOriginCheck - * @property {Array.|null} [allowedOrigins] SecuritySettings allowedOrigins - * @property {boolean|null} [enableRecaptcha] SecuritySettings enableRecaptcha - */ - - /** - * Constructs a new SecuritySettings. - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig - * @classdesc Represents a SecuritySettings. - * @implements ISecuritySettings - * @constructor - * @param {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings=} [properties] Properties to set - */ - function SecuritySettings(properties) { - this.allowedOrigins = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SecuritySettings enablePublicAccess. - * @member {boolean} enablePublicAccess - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings - * @instance - */ - SecuritySettings.prototype.enablePublicAccess = false; - - /** - * SecuritySettings enableOriginCheck. - * @member {boolean} enableOriginCheck - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings - * @instance - */ - SecuritySettings.prototype.enableOriginCheck = false; - - /** - * SecuritySettings allowedOrigins. - * @member {Array.} allowedOrigins - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings - * @instance - */ - SecuritySettings.prototype.allowedOrigins = $util.emptyArray; - - /** - * SecuritySettings enableRecaptcha. - * @member {boolean} enableRecaptcha - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings - * @instance - */ - SecuritySettings.prototype.enableRecaptcha = false; - - /** - * Creates a new SecuritySettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings - * @static - * @param {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings instance - */ - SecuritySettings.create = function create(properties) { - return new SecuritySettings(properties); - }; - - /** - * Encodes the specified SecuritySettings message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings - * @static - * @param {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings} message SecuritySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecuritySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enablePublicAccess != null && Object.hasOwnProperty.call(message, "enablePublicAccess")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePublicAccess); - if (message.allowedOrigins != null && message.allowedOrigins.length) - for (var i = 0; i < message.allowedOrigins.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedOrigins[i]); - if (message.enableRecaptcha != null && Object.hasOwnProperty.call(message, "enableRecaptcha")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableRecaptcha); - if (message.enableOriginCheck != null && Object.hasOwnProperty.call(message, "enableOriginCheck")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableOriginCheck); - return writer; - }; - - /** - * Encodes the specified SecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings - * @static - * @param {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings} message SecuritySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecuritySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecuritySettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecuritySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enablePublicAccess = reader.bool(); - break; - } - case 4: { - message.enableOriginCheck = reader.bool(); - break; - } - case 2: { - if (!(message.allowedOrigins && message.allowedOrigins.length)) - message.allowedOrigins = []; - message.allowedOrigins.push(reader.string()); - break; - } - case 3: { - message.enableRecaptcha = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecuritySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecuritySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecuritySettings message. - * @function verify - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecuritySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enablePublicAccess != null && message.hasOwnProperty("enablePublicAccess")) - if (typeof message.enablePublicAccess !== "boolean") - return "enablePublicAccess: boolean expected"; - if (message.enableOriginCheck != null && message.hasOwnProperty("enableOriginCheck")) - if (typeof message.enableOriginCheck !== "boolean") - return "enableOriginCheck: boolean expected"; - if (message.allowedOrigins != null && message.hasOwnProperty("allowedOrigins")) { - if (!Array.isArray(message.allowedOrigins)) - return "allowedOrigins: array expected"; - for (var i = 0; i < message.allowedOrigins.length; ++i) - if (!$util.isString(message.allowedOrigins[i])) - return "allowedOrigins: string[] expected"; - } - if (message.enableRecaptcha != null && message.hasOwnProperty("enableRecaptcha")) - if (typeof message.enableRecaptcha !== "boolean") - return "enableRecaptcha: boolean expected"; - return null; - }; - - /** - * Creates a SecuritySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings - */ - SecuritySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings) - return object; - var message = new $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings(); - if (object.enablePublicAccess != null) - message.enablePublicAccess = Boolean(object.enablePublicAccess); - if (object.enableOriginCheck != null) - message.enableOriginCheck = Boolean(object.enableOriginCheck); - if (object.allowedOrigins) { - if (!Array.isArray(object.allowedOrigins)) - throw TypeError(".google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.allowedOrigins: array expected"); - message.allowedOrigins = []; - for (var i = 0; i < object.allowedOrigins.length; ++i) - message.allowedOrigins[i] = String(object.allowedOrigins[i]); - } - if (object.enableRecaptcha != null) - message.enableRecaptcha = Boolean(object.enableRecaptcha); - return message; - }; - - /** - * Creates a plain object from a SecuritySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings - * @static - * @param {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings} message SecuritySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecuritySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedOrigins = []; - if (options.defaults) { - object.enablePublicAccess = false; - object.enableRecaptcha = false; - object.enableOriginCheck = false; - } - if (message.enablePublicAccess != null && message.hasOwnProperty("enablePublicAccess")) - object.enablePublicAccess = message.enablePublicAccess; - if (message.allowedOrigins && message.allowedOrigins.length) { - object.allowedOrigins = []; - for (var j = 0; j < message.allowedOrigins.length; ++j) - object.allowedOrigins[j] = message.allowedOrigins[j]; - } - if (message.enableRecaptcha != null && message.hasOwnProperty("enableRecaptcha")) - object.enableRecaptcha = message.enableRecaptcha; - if (message.enableOriginCheck != null && message.hasOwnProperty("enableOriginCheck")) - object.enableOriginCheck = message.enableOriginCheck; - return object; - }; - - /** - * Converts this SecuritySettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings - * @instance - * @returns {Object.} JSON object - */ - SecuritySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SecuritySettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecuritySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings"; - }; - - return SecuritySettings; - })(); - - /** - * Modality enum. - * @name google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality - * @enum {number} - * @property {number} MODALITY_UNSPECIFIED=0 MODALITY_UNSPECIFIED value - * @property {number} CHAT_AND_VOICE=1 CHAT_AND_VOICE value - * @property {number} VOICE_ONLY=2 VOICE_ONLY value - * @property {number} CHAT_ONLY=3 CHAT_ONLY value - */ - WebWidgetConfig.Modality = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODALITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "CHAT_AND_VOICE"] = 1; - values[valuesById[2] = "VOICE_ONLY"] = 2; - values[valuesById[3] = "CHAT_ONLY"] = 3; - return values; - })(); - - /** - * Theme enum. - * @name google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme - * @enum {number} - * @property {number} THEME_UNSPECIFIED=0 THEME_UNSPECIFIED value - * @property {number} LIGHT=1 LIGHT value - * @property {number} DARK=2 DARK value - */ - WebWidgetConfig.Theme = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "THEME_UNSPECIFIED"] = 0; - values[valuesById[1] = "LIGHT"] = 1; - values[valuesById[2] = "DARK"] = 2; - return values; - })(); - - return WebWidgetConfig; - })(); - - /** - * ChannelType enum. - * @name google.cloud.ces.v1beta.ChannelProfile.ChannelType - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} WEB_UI=2 WEB_UI value - * @property {number} API=3 API value - * @property {number} TWILIO=4 TWILIO value - * @property {number} GOOGLE_TELEPHONY_PLATFORM=5 GOOGLE_TELEPHONY_PLATFORM value - * @property {number} CONTACT_CENTER_AS_A_SERVICE=6 CONTACT_CENTER_AS_A_SERVICE value - * @property {number} FIVE9=7 FIVE9 value - * @property {number} CONTACT_CENTER_INTEGRATION=8 CONTACT_CENTER_INTEGRATION value - */ - ChannelProfile.ChannelType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[2] = "WEB_UI"] = 2; - values[valuesById[3] = "API"] = 3; - values[valuesById[4] = "TWILIO"] = 4; - values[valuesById[5] = "GOOGLE_TELEPHONY_PLATFORM"] = 5; - values[valuesById[6] = "CONTACT_CENTER_AS_A_SERVICE"] = 6; - values[valuesById[7] = "FIVE9"] = 7; - values[valuesById[8] = "CONTACT_CENTER_INTEGRATION"] = 8; - return values; - })(); - - return ChannelProfile; - })(); - - v1beta.Span = (function() { - - /** - * Properties of a Span. - * @memberof google.cloud.ces.v1beta - * @interface ISpan - * @property {string|null} [name] Span name - * @property {google.protobuf.ITimestamp|null} [startTime] Span startTime - * @property {google.protobuf.ITimestamp|null} [endTime] Span endTime - * @property {google.protobuf.IDuration|null} [duration] Span duration - * @property {google.protobuf.IStruct|null} [attributes] Span attributes - * @property {Array.|null} [childSpans] Span childSpans - */ - - /** - * Constructs a new Span. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a Span. - * @implements ISpan - * @constructor - * @param {google.cloud.ces.v1beta.ISpan=} [properties] Properties to set - */ - function Span(properties) { - this.childSpans = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Span name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.Span - * @instance - */ - Span.prototype.name = ""; - - /** - * Span startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.ces.v1beta.Span - * @instance - */ - Span.prototype.startTime = null; - - /** - * Span endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.ces.v1beta.Span - * @instance - */ - Span.prototype.endTime = null; - - /** - * Span duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.cloud.ces.v1beta.Span - * @instance - */ - Span.prototype.duration = null; - - /** - * Span attributes. - * @member {google.protobuf.IStruct|null|undefined} attributes - * @memberof google.cloud.ces.v1beta.Span - * @instance - */ - Span.prototype.attributes = null; - - /** - * Span childSpans. - * @member {Array.} childSpans - * @memberof google.cloud.ces.v1beta.Span - * @instance - */ - Span.prototype.childSpans = $util.emptyArray; - - /** - * Creates a new Span instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Span - * @static - * @param {google.cloud.ces.v1beta.ISpan=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Span} Span instance - */ - Span.create = function create(properties) { - return new Span(properties); - }; - - /** - * Encodes the specified Span message. Does not implicitly {@link google.cloud.ces.v1beta.Span.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Span - * @static - * @param {google.cloud.ces.v1beta.ISpan} message Span message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Span.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - $root.google.protobuf.Struct.encode(message.attributes, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.childSpans != null && message.childSpans.length) - for (var i = 0; i < message.childSpans.length; ++i) - $root.google.cloud.ces.v1beta.Span.encode(message.childSpans[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Span message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Span.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Span - * @static - * @param {google.cloud.ces.v1beta.ISpan} message Span message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Span.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Span message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Span - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Span} Span - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Span.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Span(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.attributes = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 5: { - if (!(message.childSpans && message.childSpans.length)) - message.childSpans = []; - message.childSpans.push($root.google.cloud.ces.v1beta.Span.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Span message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Span - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Span} Span - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Span.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Span message. - * @function verify - * @memberof google.cloud.ces.v1beta.Span - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Span.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string 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.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.protobuf.Duration.verify(message.duration); - if (error) - return "duration." + error; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - var error = $root.google.protobuf.Struct.verify(message.attributes); - if (error) - return "attributes." + error; - } - if (message.childSpans != null && message.hasOwnProperty("childSpans")) { - if (!Array.isArray(message.childSpans)) - return "childSpans: array expected"; - for (var i = 0; i < message.childSpans.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Span.verify(message.childSpans[i]); - if (error) - return "childSpans." + error; - } - } - return null; - }; - - /** - * Creates a Span message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Span - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Span} Span - */ - Span.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Span) - return object; - var message = new $root.google.cloud.ces.v1beta.Span(); - if (object.name != null) - message.name = String(object.name); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.Span.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.ces.v1beta.Span.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.cloud.ces.v1beta.Span.duration: object expected"); - message.duration = $root.google.protobuf.Duration.fromObject(object.duration); - } - if (object.attributes != null) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.ces.v1beta.Span.attributes: object expected"); - message.attributes = $root.google.protobuf.Struct.fromObject(object.attributes); - } - if (object.childSpans) { - if (!Array.isArray(object.childSpans)) - throw TypeError(".google.cloud.ces.v1beta.Span.childSpans: array expected"); - message.childSpans = []; - for (var i = 0; i < object.childSpans.length; ++i) { - if (typeof object.childSpans[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Span.childSpans: object expected"); - message.childSpans[i] = $root.google.cloud.ces.v1beta.Span.fromObject(object.childSpans[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Span message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Span - * @static - * @param {google.cloud.ces.v1beta.Span} message Span - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Span.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.childSpans = []; - if (options.defaults) { - object.name = ""; - object.startTime = null; - object.endTime = null; - object.attributes = null; - object.duration = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - 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.attributes != null && message.hasOwnProperty("attributes")) - object.attributes = $root.google.protobuf.Struct.toObject(message.attributes, options); - if (message.childSpans && message.childSpans.length) { - object.childSpans = []; - for (var j = 0; j < message.childSpans.length; ++j) - object.childSpans[j] = $root.google.cloud.ces.v1beta.Span.toObject(message.childSpans[j], options); - } - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); - return object; - }; - - /** - * Converts this Span to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Span - * @instance - * @returns {Object.} JSON object - */ - Span.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Span - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Span - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Span.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Span"; - }; - - return Span; - })(); - - v1beta.AgentService = (function() { - - /** - * Constructs a new AgentService service. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an AgentService - * @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 AgentService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AgentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AgentService; - - /** - * Creates new AgentService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.ces.v1beta.AgentService - * @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 {AgentService} RPC service. Useful where requests and/or responses are streamed. - */ - AgentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listApps}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef ListAppsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ListAppsResponse} [response] ListAppsResponse - */ - - /** - * Calls ListApps. - * @function listApps - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListAppsRequest} request ListAppsRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.ListAppsCallback} callback Node-style callback called with the error, if any, and ListAppsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listApps = function listApps(request, callback) { - return this.rpcCall(listApps, $root.google.cloud.ces.v1beta.ListAppsRequest, $root.google.cloud.ces.v1beta.ListAppsResponse, request, callback); - }, "name", { value: "ListApps" }); - - /** - * Calls ListApps. - * @function listApps - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListAppsRequest} request ListAppsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getApp}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef GetAppCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.App} [response] App - */ - - /** - * Calls GetApp. - * @function getApp - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetAppRequest} request GetAppRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.GetAppCallback} callback Node-style callback called with the error, if any, and App - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getApp = function getApp(request, callback) { - return this.rpcCall(getApp, $root.google.cloud.ces.v1beta.GetAppRequest, $root.google.cloud.ces.v1beta.App, request, callback); - }, "name", { value: "GetApp" }); - - /** - * Calls GetApp. - * @function getApp - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetAppRequest} request GetAppRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createApp}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef CreateAppCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateApp. - * @function createApp - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.ICreateAppRequest} request CreateAppRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.CreateAppCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.createApp = function createApp(request, callback) { - return this.rpcCall(createApp, $root.google.cloud.ces.v1beta.CreateAppRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateApp" }); - - /** - * Calls CreateApp. - * @function createApp - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.ICreateAppRequest} request CreateAppRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateApp}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef UpdateAppCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.App} [response] App - */ - - /** - * Calls UpdateApp. - * @function updateApp - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateAppRequest} request UpdateAppRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.UpdateAppCallback} callback Node-style callback called with the error, if any, and App - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.updateApp = function updateApp(request, callback) { - return this.rpcCall(updateApp, $root.google.cloud.ces.v1beta.UpdateAppRequest, $root.google.cloud.ces.v1beta.App, request, callback); - }, "name", { value: "UpdateApp" }); - - /** - * Calls UpdateApp. - * @function updateApp - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateAppRequest} request UpdateAppRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteApp}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef DeleteAppCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteApp. - * @function deleteApp - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteAppRequest} request DeleteAppRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.DeleteAppCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.deleteApp = function deleteApp(request, callback) { - return this.rpcCall(deleteApp, $root.google.cloud.ces.v1beta.DeleteAppRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteApp" }); - - /** - * Calls DeleteApp. - * @function deleteApp - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteAppRequest} request DeleteAppRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|exportApp}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef ExportAppCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ExportApp. - * @function exportApp - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IExportAppRequest} request ExportAppRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.ExportAppCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.exportApp = function exportApp(request, callback) { - return this.rpcCall(exportApp, $root.google.cloud.ces.v1beta.ExportAppRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ExportApp" }); - - /** - * Calls ExportApp. - * @function exportApp - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IExportAppRequest} request ExportAppRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|importApp}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef ImportAppCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ImportApp. - * @function importApp - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IImportAppRequest} request ImportAppRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.ImportAppCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.importApp = function importApp(request, callback) { - return this.rpcCall(importApp, $root.google.cloud.ces.v1beta.ImportAppRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportApp" }); - - /** - * Calls ImportApp. - * @function importApp - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IImportAppRequest} request ImportAppRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listAgents}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef ListAgentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ListAgentsResponse} [response] ListAgentsResponse - */ - - /** - * Calls ListAgents. - * @function listAgents - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListAgentsRequest} request ListAgentsRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.ListAgentsCallback} callback Node-style callback called with the error, if any, and ListAgentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listAgents = function listAgents(request, callback) { - return this.rpcCall(listAgents, $root.google.cloud.ces.v1beta.ListAgentsRequest, $root.google.cloud.ces.v1beta.ListAgentsResponse, request, callback); - }, "name", { value: "ListAgents" }); - - /** - * Calls ListAgents. - * @function listAgents - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListAgentsRequest} request ListAgentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getAgent}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef GetAgentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Agent} [response] Agent - */ - - /** - * Calls GetAgent. - * @function getAgent - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetAgentRequest} request GetAgentRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.GetAgentCallback} callback Node-style callback called with the error, if any, and Agent - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getAgent = function getAgent(request, callback) { - return this.rpcCall(getAgent, $root.google.cloud.ces.v1beta.GetAgentRequest, $root.google.cloud.ces.v1beta.Agent, request, callback); - }, "name", { value: "GetAgent" }); - - /** - * Calls GetAgent. - * @function getAgent - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetAgentRequest} request GetAgentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createAgent}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef CreateAgentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Agent} [response] Agent - */ - - /** - * Calls CreateAgent. - * @function createAgent - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.ICreateAgentRequest} request CreateAgentRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.CreateAgentCallback} callback Node-style callback called with the error, if any, and Agent - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.createAgent = function createAgent(request, callback) { - return this.rpcCall(createAgent, $root.google.cloud.ces.v1beta.CreateAgentRequest, $root.google.cloud.ces.v1beta.Agent, request, callback); - }, "name", { value: "CreateAgent" }); - - /** - * Calls CreateAgent. - * @function createAgent - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.ICreateAgentRequest} request CreateAgentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateAgent}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef UpdateAgentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Agent} [response] Agent - */ - - /** - * Calls UpdateAgent. - * @function updateAgent - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateAgentRequest} request UpdateAgentRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.UpdateAgentCallback} callback Node-style callback called with the error, if any, and Agent - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.updateAgent = function updateAgent(request, callback) { - return this.rpcCall(updateAgent, $root.google.cloud.ces.v1beta.UpdateAgentRequest, $root.google.cloud.ces.v1beta.Agent, request, callback); - }, "name", { value: "UpdateAgent" }); - - /** - * Calls UpdateAgent. - * @function updateAgent - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateAgentRequest} request UpdateAgentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteAgent}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef DeleteAgentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteAgent. - * @function deleteAgent - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteAgentRequest} request DeleteAgentRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.DeleteAgentCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.deleteAgent = function deleteAgent(request, callback) { - return this.rpcCall(deleteAgent, $root.google.cloud.ces.v1beta.DeleteAgentRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteAgent" }); - - /** - * Calls DeleteAgent. - * @function deleteAgent - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteAgentRequest} request DeleteAgentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listExamples}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef ListExamplesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ListExamplesResponse} [response] ListExamplesResponse - */ - - /** - * Calls ListExamples. - * @function listExamples - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListExamplesRequest} request ListExamplesRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.ListExamplesCallback} callback Node-style callback called with the error, if any, and ListExamplesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listExamples = function listExamples(request, callback) { - return this.rpcCall(listExamples, $root.google.cloud.ces.v1beta.ListExamplesRequest, $root.google.cloud.ces.v1beta.ListExamplesResponse, request, callback); - }, "name", { value: "ListExamples" }); - - /** - * Calls ListExamples. - * @function listExamples - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListExamplesRequest} request ListExamplesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getExample}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef GetExampleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Example} [response] Example - */ - - /** - * Calls GetExample. - * @function getExample - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetExampleRequest} request GetExampleRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.GetExampleCallback} callback Node-style callback called with the error, if any, and Example - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getExample = function getExample(request, callback) { - return this.rpcCall(getExample, $root.google.cloud.ces.v1beta.GetExampleRequest, $root.google.cloud.ces.v1beta.Example, request, callback); - }, "name", { value: "GetExample" }); - - /** - * Calls GetExample. - * @function getExample - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetExampleRequest} request GetExampleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createExample}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef CreateExampleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Example} [response] Example - */ - - /** - * Calls CreateExample. - * @function createExample - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.ICreateExampleRequest} request CreateExampleRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.CreateExampleCallback} callback Node-style callback called with the error, if any, and Example - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.createExample = function createExample(request, callback) { - return this.rpcCall(createExample, $root.google.cloud.ces.v1beta.CreateExampleRequest, $root.google.cloud.ces.v1beta.Example, request, callback); - }, "name", { value: "CreateExample" }); - - /** - * Calls CreateExample. - * @function createExample - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.ICreateExampleRequest} request CreateExampleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateExample}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef UpdateExampleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Example} [response] Example - */ - - /** - * Calls UpdateExample. - * @function updateExample - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateExampleRequest} request UpdateExampleRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.UpdateExampleCallback} callback Node-style callback called with the error, if any, and Example - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.updateExample = function updateExample(request, callback) { - return this.rpcCall(updateExample, $root.google.cloud.ces.v1beta.UpdateExampleRequest, $root.google.cloud.ces.v1beta.Example, request, callback); - }, "name", { value: "UpdateExample" }); - - /** - * Calls UpdateExample. - * @function updateExample - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateExampleRequest} request UpdateExampleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteExample}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef DeleteExampleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteExample. - * @function deleteExample - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteExampleRequest} request DeleteExampleRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.DeleteExampleCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.deleteExample = function deleteExample(request, callback) { - return this.rpcCall(deleteExample, $root.google.cloud.ces.v1beta.DeleteExampleRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteExample" }); - - /** - * Calls DeleteExample. - * @function deleteExample - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteExampleRequest} request DeleteExampleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listTools}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef ListToolsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ListToolsResponse} [response] ListToolsResponse - */ - - /** - * Calls ListTools. - * @function listTools - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListToolsRequest} request ListToolsRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.ListToolsCallback} callback Node-style callback called with the error, if any, and ListToolsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listTools = function listTools(request, callback) { - return this.rpcCall(listTools, $root.google.cloud.ces.v1beta.ListToolsRequest, $root.google.cloud.ces.v1beta.ListToolsResponse, request, callback); - }, "name", { value: "ListTools" }); - - /** - * Calls ListTools. - * @function listTools - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListToolsRequest} request ListToolsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getTool}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef GetToolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Tool} [response] Tool - */ - - /** - * Calls GetTool. - * @function getTool - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetToolRequest} request GetToolRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.GetToolCallback} callback Node-style callback called with the error, if any, and Tool - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getTool = function getTool(request, callback) { - return this.rpcCall(getTool, $root.google.cloud.ces.v1beta.GetToolRequest, $root.google.cloud.ces.v1beta.Tool, request, callback); - }, "name", { value: "GetTool" }); - - /** - * Calls GetTool. - * @function getTool - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetToolRequest} request GetToolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listConversations}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef ListConversationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ListConversationsResponse} [response] ListConversationsResponse - */ - - /** - * Calls ListConversations. - * @function listConversations - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListConversationsRequest} request ListConversationsRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.ListConversationsCallback} callback Node-style callback called with the error, if any, and ListConversationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listConversations = function listConversations(request, callback) { - return this.rpcCall(listConversations, $root.google.cloud.ces.v1beta.ListConversationsRequest, $root.google.cloud.ces.v1beta.ListConversationsResponse, request, callback); - }, "name", { value: "ListConversations" }); - - /** - * Calls ListConversations. - * @function listConversations - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListConversationsRequest} request ListConversationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getConversation}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef GetConversationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Conversation} [response] Conversation - */ - - /** - * Calls GetConversation. - * @function getConversation - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetConversationRequest} request GetConversationRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.GetConversationCallback} callback Node-style callback called with the error, if any, and Conversation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getConversation = function getConversation(request, callback) { - return this.rpcCall(getConversation, $root.google.cloud.ces.v1beta.GetConversationRequest, $root.google.cloud.ces.v1beta.Conversation, request, callback); - }, "name", { value: "GetConversation" }); - - /** - * Calls GetConversation. - * @function getConversation - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetConversationRequest} request GetConversationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteConversation}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef DeleteConversationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteConversation. - * @function deleteConversation - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteConversationRequest} request DeleteConversationRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.DeleteConversationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.deleteConversation = function deleteConversation(request, callback) { - return this.rpcCall(deleteConversation, $root.google.cloud.ces.v1beta.DeleteConversationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteConversation" }); - - /** - * Calls DeleteConversation. - * @function deleteConversation - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteConversationRequest} request DeleteConversationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|batchDeleteConversations}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef BatchDeleteConversationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls BatchDeleteConversations. - * @function batchDeleteConversations - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsRequest} request BatchDeleteConversationsRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.BatchDeleteConversationsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.batchDeleteConversations = function batchDeleteConversations(request, callback) { - return this.rpcCall(batchDeleteConversations, $root.google.cloud.ces.v1beta.BatchDeleteConversationsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchDeleteConversations" }); - - /** - * Calls BatchDeleteConversations. - * @function batchDeleteConversations - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsRequest} request BatchDeleteConversationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createTool}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef CreateToolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Tool} [response] Tool - */ - - /** - * Calls CreateTool. - * @function createTool - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.ICreateToolRequest} request CreateToolRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.CreateToolCallback} callback Node-style callback called with the error, if any, and Tool - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.createTool = function createTool(request, callback) { - return this.rpcCall(createTool, $root.google.cloud.ces.v1beta.CreateToolRequest, $root.google.cloud.ces.v1beta.Tool, request, callback); - }, "name", { value: "CreateTool" }); - - /** - * Calls CreateTool. - * @function createTool - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.ICreateToolRequest} request CreateToolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateTool}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef UpdateToolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Tool} [response] Tool - */ - - /** - * Calls UpdateTool. - * @function updateTool - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateToolRequest} request UpdateToolRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.UpdateToolCallback} callback Node-style callback called with the error, if any, and Tool - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.updateTool = function updateTool(request, callback) { - return this.rpcCall(updateTool, $root.google.cloud.ces.v1beta.UpdateToolRequest, $root.google.cloud.ces.v1beta.Tool, request, callback); - }, "name", { value: "UpdateTool" }); - - /** - * Calls UpdateTool. - * @function updateTool - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateToolRequest} request UpdateToolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteTool}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef DeleteToolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteTool. - * @function deleteTool - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteToolRequest} request DeleteToolRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.DeleteToolCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.deleteTool = function deleteTool(request, callback) { - return this.rpcCall(deleteTool, $root.google.cloud.ces.v1beta.DeleteToolRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteTool" }); - - /** - * Calls DeleteTool. - * @function deleteTool - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteToolRequest} request DeleteToolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listGuardrails}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef ListGuardrailsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ListGuardrailsResponse} [response] ListGuardrailsResponse - */ - - /** - * Calls ListGuardrails. - * @function listGuardrails - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListGuardrailsRequest} request ListGuardrailsRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.ListGuardrailsCallback} callback Node-style callback called with the error, if any, and ListGuardrailsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listGuardrails = function listGuardrails(request, callback) { - return this.rpcCall(listGuardrails, $root.google.cloud.ces.v1beta.ListGuardrailsRequest, $root.google.cloud.ces.v1beta.ListGuardrailsResponse, request, callback); - }, "name", { value: "ListGuardrails" }); - - /** - * Calls ListGuardrails. - * @function listGuardrails - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListGuardrailsRequest} request ListGuardrailsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getGuardrail}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef GetGuardrailCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Guardrail} [response] Guardrail - */ - - /** - * Calls GetGuardrail. - * @function getGuardrail - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetGuardrailRequest} request GetGuardrailRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.GetGuardrailCallback} callback Node-style callback called with the error, if any, and Guardrail - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getGuardrail = function getGuardrail(request, callback) { - return this.rpcCall(getGuardrail, $root.google.cloud.ces.v1beta.GetGuardrailRequest, $root.google.cloud.ces.v1beta.Guardrail, request, callback); - }, "name", { value: "GetGuardrail" }); - - /** - * Calls GetGuardrail. - * @function getGuardrail - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetGuardrailRequest} request GetGuardrailRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createGuardrail}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef CreateGuardrailCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Guardrail} [response] Guardrail - */ - - /** - * Calls CreateGuardrail. - * @function createGuardrail - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.ICreateGuardrailRequest} request CreateGuardrailRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.CreateGuardrailCallback} callback Node-style callback called with the error, if any, and Guardrail - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.createGuardrail = function createGuardrail(request, callback) { - return this.rpcCall(createGuardrail, $root.google.cloud.ces.v1beta.CreateGuardrailRequest, $root.google.cloud.ces.v1beta.Guardrail, request, callback); - }, "name", { value: "CreateGuardrail" }); - - /** - * Calls CreateGuardrail. - * @function createGuardrail - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.ICreateGuardrailRequest} request CreateGuardrailRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateGuardrail}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef UpdateGuardrailCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Guardrail} [response] Guardrail - */ - - /** - * Calls UpdateGuardrail. - * @function updateGuardrail - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateGuardrailRequest} request UpdateGuardrailRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.UpdateGuardrailCallback} callback Node-style callback called with the error, if any, and Guardrail - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.updateGuardrail = function updateGuardrail(request, callback) { - return this.rpcCall(updateGuardrail, $root.google.cloud.ces.v1beta.UpdateGuardrailRequest, $root.google.cloud.ces.v1beta.Guardrail, request, callback); - }, "name", { value: "UpdateGuardrail" }); - - /** - * Calls UpdateGuardrail. - * @function updateGuardrail - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateGuardrailRequest} request UpdateGuardrailRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteGuardrail}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef DeleteGuardrailCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteGuardrail. - * @function deleteGuardrail - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteGuardrailRequest} request DeleteGuardrailRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.DeleteGuardrailCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.deleteGuardrail = function deleteGuardrail(request, callback) { - return this.rpcCall(deleteGuardrail, $root.google.cloud.ces.v1beta.DeleteGuardrailRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteGuardrail" }); - - /** - * Calls DeleteGuardrail. - * @function deleteGuardrail - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteGuardrailRequest} request DeleteGuardrailRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listDeployments}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef ListDeploymentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ListDeploymentsResponse} [response] ListDeploymentsResponse - */ - - /** - * Calls ListDeployments. - * @function listDeployments - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.ListDeploymentsCallback} callback Node-style callback called with the error, if any, and ListDeploymentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listDeployments = function listDeployments(request, callback) { - return this.rpcCall(listDeployments, $root.google.cloud.ces.v1beta.ListDeploymentsRequest, $root.google.cloud.ces.v1beta.ListDeploymentsResponse, request, callback); - }, "name", { value: "ListDeployments" }); - - /** - * Calls ListDeployments. - * @function listDeployments - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getDeployment}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef GetDeploymentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Deployment} [response] Deployment - */ - - /** - * Calls GetDeployment. - * @function getDeployment - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetDeploymentRequest} request GetDeploymentRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.GetDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getDeployment = function getDeployment(request, callback) { - return this.rpcCall(getDeployment, $root.google.cloud.ces.v1beta.GetDeploymentRequest, $root.google.cloud.ces.v1beta.Deployment, request, callback); - }, "name", { value: "GetDeployment" }); - - /** - * Calls GetDeployment. - * @function getDeployment - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetDeploymentRequest} request GetDeploymentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createDeployment}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef CreateDeploymentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Deployment} [response] Deployment - */ - - /** - * Calls CreateDeployment. - * @function createDeployment - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.ICreateDeploymentRequest} request CreateDeploymentRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.CreateDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.createDeployment = function createDeployment(request, callback) { - return this.rpcCall(createDeployment, $root.google.cloud.ces.v1beta.CreateDeploymentRequest, $root.google.cloud.ces.v1beta.Deployment, request, callback); - }, "name", { value: "CreateDeployment" }); - - /** - * Calls CreateDeployment. - * @function createDeployment - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.ICreateDeploymentRequest} request CreateDeploymentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateDeployment}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef UpdateDeploymentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Deployment} [response] Deployment - */ - - /** - * Calls UpdateDeployment. - * @function updateDeployment - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateDeploymentRequest} request UpdateDeploymentRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.UpdateDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.updateDeployment = function updateDeployment(request, callback) { - return this.rpcCall(updateDeployment, $root.google.cloud.ces.v1beta.UpdateDeploymentRequest, $root.google.cloud.ces.v1beta.Deployment, request, callback); - }, "name", { value: "UpdateDeployment" }); - - /** - * Calls UpdateDeployment. - * @function updateDeployment - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateDeploymentRequest} request UpdateDeploymentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteDeployment}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef DeleteDeploymentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteDeployment. - * @function deleteDeployment - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteDeploymentRequest} request DeleteDeploymentRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.DeleteDeploymentCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.deleteDeployment = function deleteDeployment(request, callback) { - return this.rpcCall(deleteDeployment, $root.google.cloud.ces.v1beta.DeleteDeploymentRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteDeployment" }); - - /** - * Calls DeleteDeployment. - * @function deleteDeployment - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteDeploymentRequest} request DeleteDeploymentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listToolsets}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef ListToolsetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ListToolsetsResponse} [response] ListToolsetsResponse - */ - - /** - * Calls ListToolsets. - * @function listToolsets - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListToolsetsRequest} request ListToolsetsRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.ListToolsetsCallback} callback Node-style callback called with the error, if any, and ListToolsetsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listToolsets = function listToolsets(request, callback) { - return this.rpcCall(listToolsets, $root.google.cloud.ces.v1beta.ListToolsetsRequest, $root.google.cloud.ces.v1beta.ListToolsetsResponse, request, callback); - }, "name", { value: "ListToolsets" }); - - /** - * Calls ListToolsets. - * @function listToolsets - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListToolsetsRequest} request ListToolsetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getToolset}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef GetToolsetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Toolset} [response] Toolset - */ - - /** - * Calls GetToolset. - * @function getToolset - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetToolsetRequest} request GetToolsetRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.GetToolsetCallback} callback Node-style callback called with the error, if any, and Toolset - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getToolset = function getToolset(request, callback) { - return this.rpcCall(getToolset, $root.google.cloud.ces.v1beta.GetToolsetRequest, $root.google.cloud.ces.v1beta.Toolset, request, callback); - }, "name", { value: "GetToolset" }); - - /** - * Calls GetToolset. - * @function getToolset - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetToolsetRequest} request GetToolsetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createToolset}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef CreateToolsetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Toolset} [response] Toolset - */ - - /** - * Calls CreateToolset. - * @function createToolset - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.ICreateToolsetRequest} request CreateToolsetRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.CreateToolsetCallback} callback Node-style callback called with the error, if any, and Toolset - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.createToolset = function createToolset(request, callback) { - return this.rpcCall(createToolset, $root.google.cloud.ces.v1beta.CreateToolsetRequest, $root.google.cloud.ces.v1beta.Toolset, request, callback); - }, "name", { value: "CreateToolset" }); - - /** - * Calls CreateToolset. - * @function createToolset - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.ICreateToolsetRequest} request CreateToolsetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateToolset}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef UpdateToolsetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Toolset} [response] Toolset - */ - - /** - * Calls UpdateToolset. - * @function updateToolset - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateToolsetRequest} request UpdateToolsetRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.UpdateToolsetCallback} callback Node-style callback called with the error, if any, and Toolset - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.updateToolset = function updateToolset(request, callback) { - return this.rpcCall(updateToolset, $root.google.cloud.ces.v1beta.UpdateToolsetRequest, $root.google.cloud.ces.v1beta.Toolset, request, callback); - }, "name", { value: "UpdateToolset" }); - - /** - * Calls UpdateToolset. - * @function updateToolset - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateToolsetRequest} request UpdateToolsetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteToolset}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef DeleteToolsetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteToolset. - * @function deleteToolset - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteToolsetRequest} request DeleteToolsetRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.DeleteToolsetCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.deleteToolset = function deleteToolset(request, callback) { - return this.rpcCall(deleteToolset, $root.google.cloud.ces.v1beta.DeleteToolsetRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteToolset" }); - - /** - * Calls DeleteToolset. - * @function deleteToolset - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteToolsetRequest} request DeleteToolsetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listAppVersions}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef ListAppVersionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ListAppVersionsResponse} [response] ListAppVersionsResponse - */ - - /** - * Calls ListAppVersions. - * @function listAppVersions - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListAppVersionsRequest} request ListAppVersionsRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.ListAppVersionsCallback} callback Node-style callback called with the error, if any, and ListAppVersionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listAppVersions = function listAppVersions(request, callback) { - return this.rpcCall(listAppVersions, $root.google.cloud.ces.v1beta.ListAppVersionsRequest, $root.google.cloud.ces.v1beta.ListAppVersionsResponse, request, callback); - }, "name", { value: "ListAppVersions" }); - - /** - * Calls ListAppVersions. - * @function listAppVersions - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListAppVersionsRequest} request ListAppVersionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getAppVersion}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef GetAppVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.AppVersion} [response] AppVersion - */ - - /** - * Calls GetAppVersion. - * @function getAppVersion - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetAppVersionRequest} request GetAppVersionRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.GetAppVersionCallback} callback Node-style callback called with the error, if any, and AppVersion - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getAppVersion = function getAppVersion(request, callback) { - return this.rpcCall(getAppVersion, $root.google.cloud.ces.v1beta.GetAppVersionRequest, $root.google.cloud.ces.v1beta.AppVersion, request, callback); - }, "name", { value: "GetAppVersion" }); - - /** - * Calls GetAppVersion. - * @function getAppVersion - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetAppVersionRequest} request GetAppVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createAppVersion}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef CreateAppVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.AppVersion} [response] AppVersion - */ - - /** - * Calls CreateAppVersion. - * @function createAppVersion - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.ICreateAppVersionRequest} request CreateAppVersionRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.CreateAppVersionCallback} callback Node-style callback called with the error, if any, and AppVersion - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.createAppVersion = function createAppVersion(request, callback) { - return this.rpcCall(createAppVersion, $root.google.cloud.ces.v1beta.CreateAppVersionRequest, $root.google.cloud.ces.v1beta.AppVersion, request, callback); - }, "name", { value: "CreateAppVersion" }); - - /** - * Calls CreateAppVersion. - * @function createAppVersion - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.ICreateAppVersionRequest} request CreateAppVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteAppVersion}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef DeleteAppVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteAppVersion. - * @function deleteAppVersion - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteAppVersionRequest} request DeleteAppVersionRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.DeleteAppVersionCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.deleteAppVersion = function deleteAppVersion(request, callback) { - return this.rpcCall(deleteAppVersion, $root.google.cloud.ces.v1beta.DeleteAppVersionRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteAppVersion" }); - - /** - * Calls DeleteAppVersion. - * @function deleteAppVersion - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteAppVersionRequest} request DeleteAppVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|restoreAppVersion}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef RestoreAppVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RestoreAppVersion. - * @function restoreAppVersion - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IRestoreAppVersionRequest} request RestoreAppVersionRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.RestoreAppVersionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.restoreAppVersion = function restoreAppVersion(request, callback) { - return this.rpcCall(restoreAppVersion, $root.google.cloud.ces.v1beta.RestoreAppVersionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestoreAppVersion" }); - - /** - * Calls RestoreAppVersion. - * @function restoreAppVersion - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IRestoreAppVersionRequest} request RestoreAppVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listChangelogs}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef ListChangelogsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ListChangelogsResponse} [response] ListChangelogsResponse - */ - - /** - * Calls ListChangelogs. - * @function listChangelogs - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListChangelogsRequest} request ListChangelogsRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.ListChangelogsCallback} callback Node-style callback called with the error, if any, and ListChangelogsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.listChangelogs = function listChangelogs(request, callback) { - return this.rpcCall(listChangelogs, $root.google.cloud.ces.v1beta.ListChangelogsRequest, $root.google.cloud.ces.v1beta.ListChangelogsResponse, request, callback); - }, "name", { value: "ListChangelogs" }); - - /** - * Calls ListChangelogs. - * @function listChangelogs - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IListChangelogsRequest} request ListChangelogsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getChangelog}. - * @memberof google.cloud.ces.v1beta.AgentService - * @typedef GetChangelogCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Changelog} [response] Changelog - */ - - /** - * Calls GetChangelog. - * @function getChangelog - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetChangelogRequest} request GetChangelogRequest message or plain object - * @param {google.cloud.ces.v1beta.AgentService.GetChangelogCallback} callback Node-style callback called with the error, if any, and Changelog - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AgentService.prototype.getChangelog = function getChangelog(request, callback) { - return this.rpcCall(getChangelog, $root.google.cloud.ces.v1beta.GetChangelogRequest, $root.google.cloud.ces.v1beta.Changelog, request, callback); - }, "name", { value: "GetChangelog" }); - - /** - * Calls GetChangelog. - * @function getChangelog - * @memberof google.cloud.ces.v1beta.AgentService - * @instance - * @param {google.cloud.ces.v1beta.IGetChangelogRequest} request GetChangelogRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return AgentService; - })(); - - v1beta.ListAppsRequest = (function() { - - /** - * Properties of a ListAppsRequest. - * @memberof google.cloud.ces.v1beta - * @interface IListAppsRequest - * @property {string|null} [parent] ListAppsRequest parent - * @property {number|null} [pageSize] ListAppsRequest pageSize - * @property {string|null} [pageToken] ListAppsRequest pageToken - * @property {string|null} [filter] ListAppsRequest filter - * @property {string|null} [orderBy] ListAppsRequest orderBy - */ - - /** - * Constructs a new ListAppsRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListAppsRequest. - * @implements IListAppsRequest - * @constructor - * @param {google.cloud.ces.v1beta.IListAppsRequest=} [properties] Properties to set - */ - function ListAppsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAppsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ListAppsRequest - * @instance - */ - ListAppsRequest.prototype.parent = ""; - - /** - * ListAppsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1beta.ListAppsRequest - * @instance - */ - ListAppsRequest.prototype.pageSize = 0; - - /** - * ListAppsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1beta.ListAppsRequest - * @instance - */ - ListAppsRequest.prototype.pageToken = ""; - - /** - * ListAppsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1beta.ListAppsRequest - * @instance - */ - ListAppsRequest.prototype.filter = ""; - - /** - * ListAppsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1beta.ListAppsRequest - * @instance - */ - ListAppsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListAppsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListAppsRequest - * @static - * @param {google.cloud.ces.v1beta.IListAppsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListAppsRequest} ListAppsRequest instance - */ - ListAppsRequest.create = function create(properties) { - return new ListAppsRequest(properties); - }; - - /** - * Encodes the specified ListAppsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListAppsRequest - * @static - * @param {google.cloud.ces.v1beta.IListAppsRequest} message ListAppsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAppsRequest.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 ListAppsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListAppsRequest - * @static - * @param {google.cloud.ces.v1beta.IListAppsRequest} message ListAppsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAppsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAppsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListAppsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListAppsRequest} ListAppsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAppsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListAppsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAppsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListAppsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListAppsRequest} ListAppsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAppsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAppsRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListAppsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAppsRequest.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 ListAppsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListAppsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListAppsRequest} ListAppsRequest - */ - ListAppsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListAppsRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ListAppsRequest(); - 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 ListAppsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListAppsRequest - * @static - * @param {google.cloud.ces.v1beta.ListAppsRequest} message ListAppsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAppsRequest.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 ListAppsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListAppsRequest - * @instance - * @returns {Object.} JSON object - */ - ListAppsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAppsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListAppsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAppsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListAppsRequest"; - }; - - return ListAppsRequest; - })(); - - v1beta.ListAppsResponse = (function() { - - /** - * Properties of a ListAppsResponse. - * @memberof google.cloud.ces.v1beta - * @interface IListAppsResponse - * @property {Array.|null} [apps] ListAppsResponse apps - * @property {string|null} [nextPageToken] ListAppsResponse nextPageToken - * @property {Array.|null} [unreachable] ListAppsResponse unreachable - */ - - /** - * Constructs a new ListAppsResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListAppsResponse. - * @implements IListAppsResponse - * @constructor - * @param {google.cloud.ces.v1beta.IListAppsResponse=} [properties] Properties to set - */ - function ListAppsResponse(properties) { - this.apps = []; - 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]]; - } - - /** - * ListAppsResponse apps. - * @member {Array.} apps - * @memberof google.cloud.ces.v1beta.ListAppsResponse - * @instance - */ - ListAppsResponse.prototype.apps = $util.emptyArray; - - /** - * ListAppsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1beta.ListAppsResponse - * @instance - */ - ListAppsResponse.prototype.nextPageToken = ""; - - /** - * ListAppsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.ces.v1beta.ListAppsResponse - * @instance - */ - ListAppsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListAppsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListAppsResponse - * @static - * @param {google.cloud.ces.v1beta.IListAppsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListAppsResponse} ListAppsResponse instance - */ - ListAppsResponse.create = function create(properties) { - return new ListAppsResponse(properties); - }; - - /** - * Encodes the specified ListAppsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListAppsResponse - * @static - * @param {google.cloud.ces.v1beta.IListAppsResponse} message ListAppsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAppsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.apps != null && message.apps.length) - for (var i = 0; i < message.apps.length; ++i) - $root.google.cloud.ces.v1beta.App.encode(message.apps[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 ListAppsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListAppsResponse - * @static - * @param {google.cloud.ces.v1beta.IListAppsResponse} message ListAppsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAppsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAppsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListAppsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListAppsResponse} ListAppsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAppsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListAppsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.apps && message.apps.length)) - message.apps = []; - message.apps.push($root.google.cloud.ces.v1beta.App.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 ListAppsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListAppsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListAppsResponse} ListAppsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAppsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAppsResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListAppsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAppsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.apps != null && message.hasOwnProperty("apps")) { - if (!Array.isArray(message.apps)) - return "apps: array expected"; - for (var i = 0; i < message.apps.length; ++i) { - var error = $root.google.cloud.ces.v1beta.App.verify(message.apps[i]); - if (error) - return "apps." + 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 ListAppsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListAppsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListAppsResponse} ListAppsResponse - */ - ListAppsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListAppsResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ListAppsResponse(); - if (object.apps) { - if (!Array.isArray(object.apps)) - throw TypeError(".google.cloud.ces.v1beta.ListAppsResponse.apps: array expected"); - message.apps = []; - for (var i = 0; i < object.apps.length; ++i) { - if (typeof object.apps[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ListAppsResponse.apps: object expected"); - message.apps[i] = $root.google.cloud.ces.v1beta.App.fromObject(object.apps[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.ces.v1beta.ListAppsResponse.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 ListAppsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListAppsResponse - * @static - * @param {google.cloud.ces.v1beta.ListAppsResponse} message ListAppsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAppsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.apps = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.apps && message.apps.length) { - object.apps = []; - for (var j = 0; j < message.apps.length; ++j) - object.apps[j] = $root.google.cloud.ces.v1beta.App.toObject(message.apps[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 ListAppsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListAppsResponse - * @instance - * @returns {Object.} JSON object - */ - ListAppsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAppsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListAppsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAppsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListAppsResponse"; - }; - - return ListAppsResponse; - })(); - - v1beta.GetAppRequest = (function() { - - /** - * Properties of a GetAppRequest. - * @memberof google.cloud.ces.v1beta - * @interface IGetAppRequest - * @property {string|null} [name] GetAppRequest name - */ - - /** - * Constructs a new GetAppRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GetAppRequest. - * @implements IGetAppRequest - * @constructor - * @param {google.cloud.ces.v1beta.IGetAppRequest=} [properties] Properties to set - */ - function GetAppRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetAppRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.GetAppRequest - * @instance - */ - GetAppRequest.prototype.name = ""; - - /** - * Creates a new GetAppRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GetAppRequest - * @static - * @param {google.cloud.ces.v1beta.IGetAppRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GetAppRequest} GetAppRequest instance - */ - GetAppRequest.create = function create(properties) { - return new GetAppRequest(properties); - }; - - /** - * Encodes the specified GetAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetAppRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GetAppRequest - * @static - * @param {google.cloud.ces.v1beta.IGetAppRequest} message GetAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAppRequest.encode = function encode(message, writer) { - 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 GetAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetAppRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GetAppRequest - * @static - * @param {google.cloud.ces.v1beta.IGetAppRequest} message GetAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAppRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetAppRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GetAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GetAppRequest} GetAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAppRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetAppRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetAppRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GetAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GetAppRequest} GetAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAppRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetAppRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.GetAppRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetAppRequest.verify = function verify(message) { - if (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 GetAppRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GetAppRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GetAppRequest} GetAppRequest - */ - GetAppRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GetAppRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.GetAppRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetAppRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GetAppRequest - * @static - * @param {google.cloud.ces.v1beta.GetAppRequest} message GetAppRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetAppRequest.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 GetAppRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GetAppRequest - * @instance - * @returns {Object.} JSON object - */ - GetAppRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetAppRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GetAppRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GetAppRequest"; - }; - - return GetAppRequest; - })(); - - v1beta.CreateAppRequest = (function() { - - /** - * Properties of a CreateAppRequest. - * @memberof google.cloud.ces.v1beta - * @interface ICreateAppRequest - * @property {string|null} [parent] CreateAppRequest parent - * @property {string|null} [appId] CreateAppRequest appId - * @property {google.cloud.ces.v1beta.IApp|null} [app] CreateAppRequest app - */ - - /** - * Constructs a new CreateAppRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a CreateAppRequest. - * @implements ICreateAppRequest - * @constructor - * @param {google.cloud.ces.v1beta.ICreateAppRequest=} [properties] Properties to set - */ - function CreateAppRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateAppRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.CreateAppRequest - * @instance - */ - CreateAppRequest.prototype.parent = ""; - - /** - * CreateAppRequest appId. - * @member {string} appId - * @memberof google.cloud.ces.v1beta.CreateAppRequest - * @instance - */ - CreateAppRequest.prototype.appId = ""; - - /** - * CreateAppRequest app. - * @member {google.cloud.ces.v1beta.IApp|null|undefined} app - * @memberof google.cloud.ces.v1beta.CreateAppRequest - * @instance - */ - CreateAppRequest.prototype.app = null; - - /** - * Creates a new CreateAppRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.CreateAppRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateAppRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.CreateAppRequest} CreateAppRequest instance - */ - CreateAppRequest.create = function create(properties) { - return new CreateAppRequest(properties); - }; - - /** - * Encodes the specified CreateAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.CreateAppRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateAppRequest} message CreateAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAppRequest.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.appId != null && Object.hasOwnProperty.call(message, "appId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.appId); - if (message.app != null && Object.hasOwnProperty.call(message, "app")) - $root.google.cloud.ces.v1beta.App.encode(message.app, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.CreateAppRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateAppRequest} message CreateAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAppRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateAppRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.CreateAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.CreateAppRequest} CreateAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAppRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateAppRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.appId = reader.string(); - break; - } - case 3: { - message.app = $root.google.cloud.ces.v1beta.App.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateAppRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.CreateAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.CreateAppRequest} CreateAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAppRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateAppRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.CreateAppRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateAppRequest.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.appId != null && message.hasOwnProperty("appId")) - if (!$util.isString(message.appId)) - return "appId: string expected"; - if (message.app != null && message.hasOwnProperty("app")) { - var error = $root.google.cloud.ces.v1beta.App.verify(message.app); - if (error) - return "app." + error; - } - return null; - }; - - /** - * Creates a CreateAppRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.CreateAppRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.CreateAppRequest} CreateAppRequest - */ - CreateAppRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.CreateAppRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.CreateAppRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.appId != null) - message.appId = String(object.appId); - if (object.app != null) { - if (typeof object.app !== "object") - throw TypeError(".google.cloud.ces.v1beta.CreateAppRequest.app: object expected"); - message.app = $root.google.cloud.ces.v1beta.App.fromObject(object.app); - } - return message; - }; - - /** - * Creates a plain object from a CreateAppRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.CreateAppRequest - * @static - * @param {google.cloud.ces.v1beta.CreateAppRequest} message CreateAppRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateAppRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.appId = ""; - object.app = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.appId != null && message.hasOwnProperty("appId")) - object.appId = message.appId; - if (message.app != null && message.hasOwnProperty("app")) - object.app = $root.google.cloud.ces.v1beta.App.toObject(message.app, options); - return object; - }; - - /** - * Converts this CreateAppRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.CreateAppRequest - * @instance - * @returns {Object.} JSON object - */ - CreateAppRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateAppRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.CreateAppRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateAppRequest"; - }; - - return CreateAppRequest; - })(); - - v1beta.UpdateAppRequest = (function() { - - /** - * Properties of an UpdateAppRequest. - * @memberof google.cloud.ces.v1beta - * @interface IUpdateAppRequest - * @property {google.cloud.ces.v1beta.IApp|null} [app] UpdateAppRequest app - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAppRequest updateMask - */ - - /** - * Constructs a new UpdateAppRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an UpdateAppRequest. - * @implements IUpdateAppRequest - * @constructor - * @param {google.cloud.ces.v1beta.IUpdateAppRequest=} [properties] Properties to set - */ - function UpdateAppRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateAppRequest app. - * @member {google.cloud.ces.v1beta.IApp|null|undefined} app - * @memberof google.cloud.ces.v1beta.UpdateAppRequest - * @instance - */ - UpdateAppRequest.prototype.app = null; - - /** - * UpdateAppRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.ces.v1beta.UpdateAppRequest - * @instance - */ - UpdateAppRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateAppRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.UpdateAppRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateAppRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.UpdateAppRequest} UpdateAppRequest instance - */ - UpdateAppRequest.create = function create(properties) { - return new UpdateAppRequest(properties); - }; - - /** - * Encodes the specified UpdateAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAppRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.UpdateAppRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateAppRequest} message UpdateAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateAppRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.app != null && Object.hasOwnProperty.call(message, "app")) - $root.google.cloud.ces.v1beta.App.encode(message.app, 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 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAppRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateAppRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateAppRequest} message UpdateAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateAppRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateAppRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.UpdateAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.UpdateAppRequest} UpdateAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateAppRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateAppRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.app = $root.google.cloud.ces.v1beta.App.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateAppRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.UpdateAppRequest} UpdateAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateAppRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateAppRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.UpdateAppRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateAppRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.app != null && message.hasOwnProperty("app")) { - var error = $root.google.cloud.ces.v1beta.App.verify(message.app); - if (error) - return "app." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateAppRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.UpdateAppRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.UpdateAppRequest} UpdateAppRequest - */ - UpdateAppRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.UpdateAppRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.UpdateAppRequest(); - if (object.app != null) { - if (typeof object.app !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateAppRequest.app: object expected"); - message.app = $root.google.cloud.ces.v1beta.App.fromObject(object.app); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateAppRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateAppRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.UpdateAppRequest - * @static - * @param {google.cloud.ces.v1beta.UpdateAppRequest} message UpdateAppRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateAppRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.app = null; - object.updateMask = null; - } - if (message.app != null && message.hasOwnProperty("app")) - object.app = $root.google.cloud.ces.v1beta.App.toObject(message.app, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateAppRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.UpdateAppRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateAppRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateAppRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.UpdateAppRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateAppRequest"; - }; - - return UpdateAppRequest; - })(); - - v1beta.DeleteAppRequest = (function() { - - /** - * Properties of a DeleteAppRequest. - * @memberof google.cloud.ces.v1beta - * @interface IDeleteAppRequest - * @property {string|null} [name] DeleteAppRequest name - * @property {string|null} [etag] DeleteAppRequest etag - */ - - /** - * Constructs a new DeleteAppRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DeleteAppRequest. - * @implements IDeleteAppRequest - * @constructor - * @param {google.cloud.ces.v1beta.IDeleteAppRequest=} [properties] Properties to set - */ - function DeleteAppRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteAppRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.DeleteAppRequest - * @instance - */ - DeleteAppRequest.prototype.name = ""; - - /** - * DeleteAppRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.DeleteAppRequest - * @instance - */ - DeleteAppRequest.prototype.etag = ""; - - /** - * Creates a new DeleteAppRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DeleteAppRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteAppRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DeleteAppRequest} DeleteAppRequest instance - */ - DeleteAppRequest.create = function create(properties) { - return new DeleteAppRequest(properties); - }; - - /** - * Encodes the specified DeleteAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DeleteAppRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteAppRequest} message DeleteAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAppRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteAppRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteAppRequest} message DeleteAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAppRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteAppRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DeleteAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DeleteAppRequest} DeleteAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAppRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteAppRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteAppRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DeleteAppRequest} DeleteAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAppRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteAppRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.DeleteAppRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteAppRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteAppRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DeleteAppRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DeleteAppRequest} DeleteAppRequest - */ - DeleteAppRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DeleteAppRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.DeleteAppRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteAppRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DeleteAppRequest - * @static - * @param {google.cloud.ces.v1beta.DeleteAppRequest} message DeleteAppRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteAppRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteAppRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DeleteAppRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteAppRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteAppRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DeleteAppRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteAppRequest"; - }; - - return DeleteAppRequest; - })(); - - v1beta.ExportAppRequest = (function() { - - /** - * Properties of an ExportAppRequest. - * @memberof google.cloud.ces.v1beta - * @interface IExportAppRequest - * @property {string|null} [name] ExportAppRequest name - * @property {google.cloud.ces.v1beta.ExportAppRequest.ExportFormat|null} [exportFormat] ExportAppRequest exportFormat - * @property {string|null} [gcsUri] ExportAppRequest gcsUri - */ - - /** - * Constructs a new ExportAppRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an ExportAppRequest. - * @implements IExportAppRequest - * @constructor - * @param {google.cloud.ces.v1beta.IExportAppRequest=} [properties] Properties to set - */ - function ExportAppRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExportAppRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.ExportAppRequest - * @instance - */ - ExportAppRequest.prototype.name = ""; - - /** - * ExportAppRequest exportFormat. - * @member {google.cloud.ces.v1beta.ExportAppRequest.ExportFormat} exportFormat - * @memberof google.cloud.ces.v1beta.ExportAppRequest - * @instance - */ - ExportAppRequest.prototype.exportFormat = 0; - - /** - * ExportAppRequest gcsUri. - * @member {string} gcsUri - * @memberof google.cloud.ces.v1beta.ExportAppRequest - * @instance - */ - ExportAppRequest.prototype.gcsUri = ""; - - /** - * Creates a new ExportAppRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ExportAppRequest - * @static - * @param {google.cloud.ces.v1beta.IExportAppRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ExportAppRequest} ExportAppRequest instance - */ - ExportAppRequest.create = function create(properties) { - return new ExportAppRequest(properties); - }; - - /** - * Encodes the specified ExportAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ExportAppRequest - * @static - * @param {google.cloud.ces.v1beta.IExportAppRequest} message ExportAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportAppRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.exportFormat != null && Object.hasOwnProperty.call(message, "exportFormat")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.exportFormat); - if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsUri); - return writer; - }; - - /** - * Encodes the specified ExportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ExportAppRequest - * @static - * @param {google.cloud.ces.v1beta.IExportAppRequest} message ExportAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportAppRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportAppRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ExportAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ExportAppRequest} ExportAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportAppRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ExportAppRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.exportFormat = reader.int32(); - break; - } - case 3: { - message.gcsUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExportAppRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ExportAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ExportAppRequest} ExportAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportAppRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExportAppRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ExportAppRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportAppRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.exportFormat != null && message.hasOwnProperty("exportFormat")) - switch (message.exportFormat) { - default: - return "exportFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - if (!$util.isString(message.gcsUri)) - return "gcsUri: string expected"; - return null; - }; - - /** - * Creates an ExportAppRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ExportAppRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ExportAppRequest} ExportAppRequest - */ - ExportAppRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ExportAppRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ExportAppRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.exportFormat) { - default: - if (typeof object.exportFormat === "number") { - message.exportFormat = object.exportFormat; - break; - } - break; - case "EXPORT_FORMAT_UNSPECIFIED": - case 0: - message.exportFormat = 0; - break; - case "JSON": - case 1: - message.exportFormat = 1; - break; - case "YAML": - case 2: - message.exportFormat = 2; - break; - } - if (object.gcsUri != null) - message.gcsUri = String(object.gcsUri); - return message; - }; - - /** - * Creates a plain object from an ExportAppRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ExportAppRequest - * @static - * @param {google.cloud.ces.v1beta.ExportAppRequest} message ExportAppRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportAppRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.exportFormat = options.enums === String ? "EXPORT_FORMAT_UNSPECIFIED" : 0; - object.gcsUri = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.exportFormat != null && message.hasOwnProperty("exportFormat")) - object.exportFormat = options.enums === String ? $root.google.cloud.ces.v1beta.ExportAppRequest.ExportFormat[message.exportFormat] === undefined ? message.exportFormat : $root.google.cloud.ces.v1beta.ExportAppRequest.ExportFormat[message.exportFormat] : message.exportFormat; - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - object.gcsUri = message.gcsUri; - return object; - }; - - /** - * Converts this ExportAppRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ExportAppRequest - * @instance - * @returns {Object.} JSON object - */ - ExportAppRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExportAppRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ExportAppRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ExportAppRequest"; - }; - - /** - * ExportFormat enum. - * @name google.cloud.ces.v1beta.ExportAppRequest.ExportFormat - * @enum {number} - * @property {number} EXPORT_FORMAT_UNSPECIFIED=0 EXPORT_FORMAT_UNSPECIFIED value - * @property {number} JSON=1 JSON value - * @property {number} YAML=2 YAML value - */ - ExportAppRequest.ExportFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EXPORT_FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "JSON"] = 1; - values[valuesById[2] = "YAML"] = 2; - return values; - })(); - - return ExportAppRequest; - })(); - - v1beta.ExportAppResponse = (function() { - - /** - * Properties of an ExportAppResponse. - * @memberof google.cloud.ces.v1beta - * @interface IExportAppResponse - * @property {Uint8Array|null} [appContent] ExportAppResponse appContent - * @property {string|null} [appUri] ExportAppResponse appUri - */ - - /** - * Constructs a new ExportAppResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an ExportAppResponse. - * @implements IExportAppResponse - * @constructor - * @param {google.cloud.ces.v1beta.IExportAppResponse=} [properties] Properties to set - */ - function ExportAppResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExportAppResponse appContent. - * @member {Uint8Array|null|undefined} appContent - * @memberof google.cloud.ces.v1beta.ExportAppResponse - * @instance - */ - ExportAppResponse.prototype.appContent = null; - - /** - * ExportAppResponse appUri. - * @member {string|null|undefined} appUri - * @memberof google.cloud.ces.v1beta.ExportAppResponse - * @instance - */ - ExportAppResponse.prototype.appUri = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ExportAppResponse app. - * @member {"appContent"|"appUri"|undefined} app - * @memberof google.cloud.ces.v1beta.ExportAppResponse - * @instance - */ - Object.defineProperty(ExportAppResponse.prototype, "app", { - get: $util.oneOfGetter($oneOfFields = ["appContent", "appUri"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExportAppResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ExportAppResponse - * @static - * @param {google.cloud.ces.v1beta.IExportAppResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ExportAppResponse} ExportAppResponse instance - */ - ExportAppResponse.create = function create(properties) { - return new ExportAppResponse(properties); - }; - - /** - * Encodes the specified ExportAppResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ExportAppResponse - * @static - * @param {google.cloud.ces.v1beta.IExportAppResponse} message ExportAppResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportAppResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.appContent != null && Object.hasOwnProperty.call(message, "appContent")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.appContent); - if (message.appUri != null && Object.hasOwnProperty.call(message, "appUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.appUri); - return writer; - }; - - /** - * Encodes the specified ExportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ExportAppResponse - * @static - * @param {google.cloud.ces.v1beta.IExportAppResponse} message ExportAppResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportAppResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportAppResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ExportAppResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ExportAppResponse} ExportAppResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportAppResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ExportAppResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.appContent = reader.bytes(); - break; - } - case 2: { - message.appUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExportAppResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ExportAppResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ExportAppResponse} ExportAppResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportAppResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExportAppResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ExportAppResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportAppResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.appContent != null && message.hasOwnProperty("appContent")) { - properties.app = 1; - if (!(message.appContent && typeof message.appContent.length === "number" || $util.isString(message.appContent))) - return "appContent: buffer expected"; - } - if (message.appUri != null && message.hasOwnProperty("appUri")) { - if (properties.app === 1) - return "app: multiple values"; - properties.app = 1; - if (!$util.isString(message.appUri)) - return "appUri: string expected"; - } - return null; - }; - - /** - * Creates an ExportAppResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ExportAppResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ExportAppResponse} ExportAppResponse - */ - ExportAppResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ExportAppResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ExportAppResponse(); - if (object.appContent != null) - if (typeof object.appContent === "string") - $util.base64.decode(object.appContent, message.appContent = $util.newBuffer($util.base64.length(object.appContent)), 0); - else if (object.appContent.length >= 0) - message.appContent = object.appContent; - if (object.appUri != null) - message.appUri = String(object.appUri); - return message; - }; - - /** - * Creates a plain object from an ExportAppResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ExportAppResponse - * @static - * @param {google.cloud.ces.v1beta.ExportAppResponse} message ExportAppResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportAppResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.appContent != null && message.hasOwnProperty("appContent")) { - object.appContent = options.bytes === String ? $util.base64.encode(message.appContent, 0, message.appContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.appContent) : message.appContent; - if (options.oneofs) - object.app = "appContent"; - } - if (message.appUri != null && message.hasOwnProperty("appUri")) { - object.appUri = message.appUri; - if (options.oneofs) - object.app = "appUri"; - } - return object; - }; - - /** - * Converts this ExportAppResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ExportAppResponse - * @instance - * @returns {Object.} JSON object - */ - ExportAppResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExportAppResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ExportAppResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportAppResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ExportAppResponse"; - }; - - return ExportAppResponse; - })(); - - v1beta.ImportAppRequest = (function() { - - /** - * Properties of an ImportAppRequest. - * @memberof google.cloud.ces.v1beta - * @interface IImportAppRequest - * @property {string|null} [gcsUri] ImportAppRequest gcsUri - * @property {Uint8Array|null} [appContent] ImportAppRequest appContent - * @property {string|null} [parent] ImportAppRequest parent - * @property {string|null} [displayName] ImportAppRequest displayName - * @property {string|null} [appId] ImportAppRequest appId - * @property {google.cloud.ces.v1beta.ImportAppRequest.IImportOptions|null} [importOptions] ImportAppRequest importOptions - * @property {boolean|null} [ignoreAppLock] ImportAppRequest ignoreAppLock - */ - - /** - * Constructs a new ImportAppRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an ImportAppRequest. - * @implements IImportAppRequest - * @constructor - * @param {google.cloud.ces.v1beta.IImportAppRequest=} [properties] Properties to set - */ - function ImportAppRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportAppRequest gcsUri. - * @member {string|null|undefined} gcsUri - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @instance - */ - ImportAppRequest.prototype.gcsUri = null; - - /** - * ImportAppRequest appContent. - * @member {Uint8Array|null|undefined} appContent - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @instance - */ - ImportAppRequest.prototype.appContent = null; - - /** - * ImportAppRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @instance - */ - ImportAppRequest.prototype.parent = ""; - - /** - * ImportAppRequest displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @instance - */ - ImportAppRequest.prototype.displayName = ""; - - /** - * ImportAppRequest appId. - * @member {string} appId - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @instance - */ - ImportAppRequest.prototype.appId = ""; - - /** - * ImportAppRequest importOptions. - * @member {google.cloud.ces.v1beta.ImportAppRequest.IImportOptions|null|undefined} importOptions - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @instance - */ - ImportAppRequest.prototype.importOptions = null; - - /** - * ImportAppRequest ignoreAppLock. - * @member {boolean} ignoreAppLock - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @instance - */ - ImportAppRequest.prototype.ignoreAppLock = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ImportAppRequest app. - * @member {"gcsUri"|"appContent"|undefined} app - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @instance - */ - Object.defineProperty(ImportAppRequest.prototype, "app", { - get: $util.oneOfGetter($oneOfFields = ["gcsUri", "appContent"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ImportAppRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @static - * @param {google.cloud.ces.v1beta.IImportAppRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ImportAppRequest} ImportAppRequest instance - */ - ImportAppRequest.create = function create(properties) { - return new ImportAppRequest(properties); - }; - - /** - * Encodes the specified ImportAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @static - * @param {google.cloud.ces.v1beta.IImportAppRequest} message ImportAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportAppRequest.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.appId != null && Object.hasOwnProperty.call(message, "appId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.appId); - if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.gcsUri); - if (message.appContent != null && Object.hasOwnProperty.call(message, "appContent")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.appContent); - if (message.importOptions != null && Object.hasOwnProperty.call(message, "importOptions")) - $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.encode(message.importOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.ignoreAppLock != null && Object.hasOwnProperty.call(message, "ignoreAppLock")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.ignoreAppLock); - return writer; - }; - - /** - * Encodes the specified ImportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @static - * @param {google.cloud.ces.v1beta.IImportAppRequest} message ImportAppRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportAppRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportAppRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ImportAppRequest} ImportAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportAppRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportAppRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.gcsUri = reader.string(); - break; - } - case 5: { - message.appContent = reader.bytes(); - break; - } - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.appId = reader.string(); - break; - } - case 6: { - message.importOptions = $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.decode(reader, reader.uint32()); - break; - } - case 7: { - message.ignoreAppLock = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportAppRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ImportAppRequest} ImportAppRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportAppRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportAppRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportAppRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { - properties.app = 1; - if (!$util.isString(message.gcsUri)) - return "gcsUri: string expected"; - } - if (message.appContent != null && message.hasOwnProperty("appContent")) { - if (properties.app === 1) - return "app: multiple values"; - properties.app = 1; - if (!(message.appContent && typeof message.appContent.length === "number" || $util.isString(message.appContent))) - return "appContent: buffer expected"; - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.appId != null && message.hasOwnProperty("appId")) - if (!$util.isString(message.appId)) - return "appId: string expected"; - if (message.importOptions != null && message.hasOwnProperty("importOptions")) { - var error = $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.verify(message.importOptions); - if (error) - return "importOptions." + error; - } - if (message.ignoreAppLock != null && message.hasOwnProperty("ignoreAppLock")) - if (typeof message.ignoreAppLock !== "boolean") - return "ignoreAppLock: boolean expected"; - return null; - }; - - /** - * Creates an ImportAppRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ImportAppRequest} ImportAppRequest - */ - ImportAppRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ImportAppRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ImportAppRequest(); - if (object.gcsUri != null) - message.gcsUri = String(object.gcsUri); - if (object.appContent != null) - if (typeof object.appContent === "string") - $util.base64.decode(object.appContent, message.appContent = $util.newBuffer($util.base64.length(object.appContent)), 0); - else if (object.appContent.length >= 0) - message.appContent = object.appContent; - if (object.parent != null) - message.parent = String(object.parent); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.appId != null) - message.appId = String(object.appId); - if (object.importOptions != null) { - if (typeof object.importOptions !== "object") - throw TypeError(".google.cloud.ces.v1beta.ImportAppRequest.importOptions: object expected"); - message.importOptions = $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.fromObject(object.importOptions); - } - if (object.ignoreAppLock != null) - message.ignoreAppLock = Boolean(object.ignoreAppLock); - return message; - }; - - /** - * Creates a plain object from an ImportAppRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @static - * @param {google.cloud.ces.v1beta.ImportAppRequest} message ImportAppRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportAppRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.displayName = ""; - object.appId = ""; - object.importOptions = null; - object.ignoreAppLock = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.appId != null && message.hasOwnProperty("appId")) - object.appId = message.appId; - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { - object.gcsUri = message.gcsUri; - if (options.oneofs) - object.app = "gcsUri"; - } - if (message.appContent != null && message.hasOwnProperty("appContent")) { - object.appContent = options.bytes === String ? $util.base64.encode(message.appContent, 0, message.appContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.appContent) : message.appContent; - if (options.oneofs) - object.app = "appContent"; - } - if (message.importOptions != null && message.hasOwnProperty("importOptions")) - object.importOptions = $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.toObject(message.importOptions, options); - if (message.ignoreAppLock != null && message.hasOwnProperty("ignoreAppLock")) - object.ignoreAppLock = message.ignoreAppLock; - return object; - }; - - /** - * Converts this ImportAppRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @instance - * @returns {Object.} JSON object - */ - ImportAppRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportAppRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportAppRequest"; - }; - - ImportAppRequest.ImportOptions = (function() { - - /** - * Properties of an ImportOptions. - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @interface IImportOptions - * @property {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|null} [conflictResolutionStrategy] ImportOptions conflictResolutionStrategy - */ - - /** - * Constructs a new ImportOptions. - * @memberof google.cloud.ces.v1beta.ImportAppRequest - * @classdesc Represents an ImportOptions. - * @implements IImportOptions - * @constructor - * @param {google.cloud.ces.v1beta.ImportAppRequest.IImportOptions=} [properties] Properties to set - */ - function ImportOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportOptions conflictResolutionStrategy. - * @member {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy} conflictResolutionStrategy - * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions - * @instance - */ - ImportOptions.prototype.conflictResolutionStrategy = 0; - - /** - * Creates a new ImportOptions instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions - * @static - * @param {google.cloud.ces.v1beta.ImportAppRequest.IImportOptions=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions} ImportOptions instance - */ - ImportOptions.create = function create(properties) { - return new ImportOptions(properties); - }; - - /** - * Encodes the specified ImportOptions message. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions - * @static - * @param {google.cloud.ces.v1beta.ImportAppRequest.IImportOptions} message ImportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.conflictResolutionStrategy != null && Object.hasOwnProperty.call(message, "conflictResolutionStrategy")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.conflictResolutionStrategy); - return writer; - }; - - /** - * Encodes the specified ImportOptions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions - * @static - * @param {google.cloud.ces.v1beta.ImportAppRequest.IImportOptions} message ImportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions} ImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.conflictResolutionStrategy = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions} ImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportOptions message. - * @function verify - * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.conflictResolutionStrategy != null && message.hasOwnProperty("conflictResolutionStrategy")) - switch (message.conflictResolutionStrategy) { - default: - return "conflictResolutionStrategy: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an ImportOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions} ImportOptions - */ - ImportOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions) - return object; - var message = new $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions(); - switch (object.conflictResolutionStrategy) { - default: - if (typeof object.conflictResolutionStrategy === "number") { - message.conflictResolutionStrategy = object.conflictResolutionStrategy; - break; - } - break; - case "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED": - case 0: - message.conflictResolutionStrategy = 0; - break; - case "REPLACE": - case 1: - message.conflictResolutionStrategy = 1; - break; - case "OVERWRITE": - case 2: - message.conflictResolutionStrategy = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an ImportOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions - * @static - * @param {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions} message ImportOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.conflictResolutionStrategy = options.enums === String ? "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED" : 0; - if (message.conflictResolutionStrategy != null && message.hasOwnProperty("conflictResolutionStrategy")) - object.conflictResolutionStrategy = options.enums === String ? $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy[message.conflictResolutionStrategy] === undefined ? message.conflictResolutionStrategy : $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy[message.conflictResolutionStrategy] : message.conflictResolutionStrategy; - return object; - }; - - /** - * Converts this ImportOptions to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions - * @instance - * @returns {Object.} JSON object - */ - ImportOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportOptions - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportAppRequest.ImportOptions"; - }; - - /** - * ConflictResolutionStrategy enum. - * @name google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy - * @enum {number} - * @property {number} CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED=0 CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED value - * @property {number} REPLACE=1 REPLACE value - * @property {number} OVERWRITE=2 OVERWRITE value - */ - ImportOptions.ConflictResolutionStrategy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED"] = 0; - values[valuesById[1] = "REPLACE"] = 1; - values[valuesById[2] = "OVERWRITE"] = 2; - return values; - })(); - - return ImportOptions; - })(); - - return ImportAppRequest; - })(); - - v1beta.ImportAppResponse = (function() { - - /** - * Properties of an ImportAppResponse. - * @memberof google.cloud.ces.v1beta - * @interface IImportAppResponse - * @property {string|null} [name] ImportAppResponse name - * @property {Array.|null} [warnings] ImportAppResponse warnings - */ - - /** - * Constructs a new ImportAppResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an ImportAppResponse. - * @implements IImportAppResponse - * @constructor - * @param {google.cloud.ces.v1beta.IImportAppResponse=} [properties] Properties to set - */ - function ImportAppResponse(properties) { - this.warnings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportAppResponse name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.ImportAppResponse - * @instance - */ - ImportAppResponse.prototype.name = ""; - - /** - * ImportAppResponse warnings. - * @member {Array.} warnings - * @memberof google.cloud.ces.v1beta.ImportAppResponse - * @instance - */ - ImportAppResponse.prototype.warnings = $util.emptyArray; - - /** - * Creates a new ImportAppResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ImportAppResponse - * @static - * @param {google.cloud.ces.v1beta.IImportAppResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ImportAppResponse} ImportAppResponse instance - */ - ImportAppResponse.create = function create(properties) { - return new ImportAppResponse(properties); - }; - - /** - * Encodes the specified ImportAppResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ImportAppResponse - * @static - * @param {google.cloud.ces.v1beta.IImportAppResponse} message ImportAppResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportAppResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.warnings != null && message.warnings.length) - for (var i = 0; i < message.warnings.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.warnings[i]); - return writer; - }; - - /** - * Encodes the specified ImportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ImportAppResponse - * @static - * @param {google.cloud.ces.v1beta.IImportAppResponse} message ImportAppResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportAppResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportAppResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ImportAppResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ImportAppResponse} ImportAppResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportAppResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportAppResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.warnings && message.warnings.length)) - message.warnings = []; - message.warnings.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportAppResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ImportAppResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ImportAppResponse} ImportAppResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportAppResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportAppResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ImportAppResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportAppResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.warnings != null && message.hasOwnProperty("warnings")) { - if (!Array.isArray(message.warnings)) - return "warnings: array expected"; - for (var i = 0; i < message.warnings.length; ++i) - if (!$util.isString(message.warnings[i])) - return "warnings: string[] expected"; - } - return null; - }; - - /** - * Creates an ImportAppResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ImportAppResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ImportAppResponse} ImportAppResponse - */ - ImportAppResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ImportAppResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ImportAppResponse(); - if (object.name != null) - message.name = String(object.name); - if (object.warnings) { - if (!Array.isArray(object.warnings)) - throw TypeError(".google.cloud.ces.v1beta.ImportAppResponse.warnings: array expected"); - message.warnings = []; - for (var i = 0; i < object.warnings.length; ++i) - message.warnings[i] = String(object.warnings[i]); - } - return message; - }; - - /** - * Creates a plain object from an ImportAppResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ImportAppResponse - * @static - * @param {google.cloud.ces.v1beta.ImportAppResponse} message ImportAppResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportAppResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.warnings = []; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.warnings && message.warnings.length) { - object.warnings = []; - for (var j = 0; j < message.warnings.length; ++j) - object.warnings[j] = message.warnings[j]; - } - return object; - }; - - /** - * Converts this ImportAppResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ImportAppResponse - * @instance - * @returns {Object.} JSON object - */ - ImportAppResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportAppResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ImportAppResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportAppResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportAppResponse"; - }; - - return ImportAppResponse; - })(); - - v1beta.ListAgentsRequest = (function() { - - /** - * Properties of a ListAgentsRequest. - * @memberof google.cloud.ces.v1beta - * @interface IListAgentsRequest - * @property {string|null} [parent] ListAgentsRequest parent - * @property {number|null} [pageSize] ListAgentsRequest pageSize - * @property {string|null} [pageToken] ListAgentsRequest pageToken - * @property {string|null} [filter] ListAgentsRequest filter - * @property {string|null} [orderBy] ListAgentsRequest orderBy - */ - - /** - * Constructs a new ListAgentsRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListAgentsRequest. - * @implements IListAgentsRequest - * @constructor - * @param {google.cloud.ces.v1beta.IListAgentsRequest=} [properties] Properties to set - */ - function ListAgentsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAgentsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ListAgentsRequest - * @instance - */ - ListAgentsRequest.prototype.parent = ""; - - /** - * ListAgentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1beta.ListAgentsRequest - * @instance - */ - ListAgentsRequest.prototype.pageSize = 0; - - /** - * ListAgentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1beta.ListAgentsRequest - * @instance - */ - ListAgentsRequest.prototype.pageToken = ""; - - /** - * ListAgentsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1beta.ListAgentsRequest - * @instance - */ - ListAgentsRequest.prototype.filter = ""; - - /** - * ListAgentsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1beta.ListAgentsRequest - * @instance - */ - ListAgentsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListAgentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListAgentsRequest - * @static - * @param {google.cloud.ces.v1beta.IListAgentsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListAgentsRequest} ListAgentsRequest instance - */ - ListAgentsRequest.create = function create(properties) { - return new ListAgentsRequest(properties); - }; - - /** - * Encodes the specified ListAgentsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListAgentsRequest - * @static - * @param {google.cloud.ces.v1beta.IListAgentsRequest} message ListAgentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAgentsRequest.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 ListAgentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListAgentsRequest - * @static - * @param {google.cloud.ces.v1beta.IListAgentsRequest} message ListAgentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAgentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAgentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListAgentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListAgentsRequest} ListAgentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAgentsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListAgentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAgentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListAgentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListAgentsRequest} ListAgentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAgentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAgentsRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListAgentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAgentsRequest.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 ListAgentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListAgentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListAgentsRequest} ListAgentsRequest - */ - ListAgentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListAgentsRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ListAgentsRequest(); - 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 ListAgentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListAgentsRequest - * @static - * @param {google.cloud.ces.v1beta.ListAgentsRequest} message ListAgentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAgentsRequest.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 ListAgentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListAgentsRequest - * @instance - * @returns {Object.} JSON object - */ - ListAgentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAgentsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListAgentsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAgentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListAgentsRequest"; - }; - - return ListAgentsRequest; - })(); - - v1beta.ListAgentsResponse = (function() { - - /** - * Properties of a ListAgentsResponse. - * @memberof google.cloud.ces.v1beta - * @interface IListAgentsResponse - * @property {Array.|null} [agents] ListAgentsResponse agents - * @property {string|null} [nextPageToken] ListAgentsResponse nextPageToken - */ - - /** - * Constructs a new ListAgentsResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListAgentsResponse. - * @implements IListAgentsResponse - * @constructor - * @param {google.cloud.ces.v1beta.IListAgentsResponse=} [properties] Properties to set - */ - function ListAgentsResponse(properties) { - this.agents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAgentsResponse agents. - * @member {Array.} agents - * @memberof google.cloud.ces.v1beta.ListAgentsResponse - * @instance - */ - ListAgentsResponse.prototype.agents = $util.emptyArray; - - /** - * ListAgentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1beta.ListAgentsResponse - * @instance - */ - ListAgentsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListAgentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListAgentsResponse - * @static - * @param {google.cloud.ces.v1beta.IListAgentsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListAgentsResponse} ListAgentsResponse instance - */ - ListAgentsResponse.create = function create(properties) { - return new ListAgentsResponse(properties); - }; - - /** - * Encodes the specified ListAgentsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListAgentsResponse - * @static - * @param {google.cloud.ces.v1beta.IListAgentsResponse} message ListAgentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAgentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.agents != null && message.agents.length) - for (var i = 0; i < message.agents.length; ++i) - $root.google.cloud.ces.v1beta.Agent.encode(message.agents[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 ListAgentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListAgentsResponse - * @static - * @param {google.cloud.ces.v1beta.IListAgentsResponse} message ListAgentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAgentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAgentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListAgentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListAgentsResponse} ListAgentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAgentsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListAgentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.agents && message.agents.length)) - message.agents = []; - message.agents.push($root.google.cloud.ces.v1beta.Agent.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAgentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListAgentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListAgentsResponse} ListAgentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAgentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAgentsResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListAgentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAgentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.agents != null && message.hasOwnProperty("agents")) { - if (!Array.isArray(message.agents)) - return "agents: array expected"; - for (var i = 0; i < message.agents.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Agent.verify(message.agents[i]); - if (error) - return "agents." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListAgentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListAgentsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListAgentsResponse} ListAgentsResponse - */ - ListAgentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListAgentsResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ListAgentsResponse(); - if (object.agents) { - if (!Array.isArray(object.agents)) - throw TypeError(".google.cloud.ces.v1beta.ListAgentsResponse.agents: array expected"); - message.agents = []; - for (var i = 0; i < object.agents.length; ++i) { - if (typeof object.agents[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ListAgentsResponse.agents: object expected"); - message.agents[i] = $root.google.cloud.ces.v1beta.Agent.fromObject(object.agents[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListAgentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListAgentsResponse - * @static - * @param {google.cloud.ces.v1beta.ListAgentsResponse} message ListAgentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAgentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.agents = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.agents && message.agents.length) { - object.agents = []; - for (var j = 0; j < message.agents.length; ++j) - object.agents[j] = $root.google.cloud.ces.v1beta.Agent.toObject(message.agents[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListAgentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListAgentsResponse - * @instance - * @returns {Object.} JSON object - */ - ListAgentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAgentsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListAgentsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAgentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListAgentsResponse"; - }; - - return ListAgentsResponse; - })(); - - v1beta.GetAgentRequest = (function() { - - /** - * Properties of a GetAgentRequest. - * @memberof google.cloud.ces.v1beta - * @interface IGetAgentRequest - * @property {string|null} [name] GetAgentRequest name - */ - - /** - * Constructs a new GetAgentRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GetAgentRequest. - * @implements IGetAgentRequest - * @constructor - * @param {google.cloud.ces.v1beta.IGetAgentRequest=} [properties] Properties to set - */ - function GetAgentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetAgentRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.GetAgentRequest - * @instance - */ - GetAgentRequest.prototype.name = ""; - - /** - * Creates a new GetAgentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GetAgentRequest - * @static - * @param {google.cloud.ces.v1beta.IGetAgentRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GetAgentRequest} GetAgentRequest instance - */ - GetAgentRequest.create = function create(properties) { - return new GetAgentRequest(properties); - }; - - /** - * Encodes the specified GetAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetAgentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GetAgentRequest - * @static - * @param {google.cloud.ces.v1beta.IGetAgentRequest} message GetAgentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAgentRequest.encode = function encode(message, writer) { - 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 GetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetAgentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GetAgentRequest - * @static - * @param {google.cloud.ces.v1beta.IGetAgentRequest} message GetAgentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetAgentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GetAgentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GetAgentRequest} GetAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAgentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetAgentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetAgentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GetAgentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GetAgentRequest} GetAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAgentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetAgentRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.GetAgentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetAgentRequest.verify = function verify(message) { - if (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 GetAgentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GetAgentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GetAgentRequest} GetAgentRequest - */ - GetAgentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GetAgentRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.GetAgentRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetAgentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GetAgentRequest - * @static - * @param {google.cloud.ces.v1beta.GetAgentRequest} message GetAgentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetAgentRequest.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 GetAgentRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GetAgentRequest - * @instance - * @returns {Object.} JSON object - */ - GetAgentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetAgentRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GetAgentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GetAgentRequest"; - }; - - return GetAgentRequest; - })(); - - v1beta.CreateAgentRequest = (function() { - - /** - * Properties of a CreateAgentRequest. - * @memberof google.cloud.ces.v1beta - * @interface ICreateAgentRequest - * @property {string|null} [parent] CreateAgentRequest parent - * @property {string|null} [agentId] CreateAgentRequest agentId - * @property {google.cloud.ces.v1beta.IAgent|null} [agent] CreateAgentRequest agent - */ - - /** - * Constructs a new CreateAgentRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a CreateAgentRequest. - * @implements ICreateAgentRequest - * @constructor - * @param {google.cloud.ces.v1beta.ICreateAgentRequest=} [properties] Properties to set - */ - function CreateAgentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateAgentRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.CreateAgentRequest - * @instance - */ - CreateAgentRequest.prototype.parent = ""; - - /** - * CreateAgentRequest agentId. - * @member {string} agentId - * @memberof google.cloud.ces.v1beta.CreateAgentRequest - * @instance - */ - CreateAgentRequest.prototype.agentId = ""; - - /** - * CreateAgentRequest agent. - * @member {google.cloud.ces.v1beta.IAgent|null|undefined} agent - * @memberof google.cloud.ces.v1beta.CreateAgentRequest - * @instance - */ - CreateAgentRequest.prototype.agent = null; - - /** - * Creates a new CreateAgentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.CreateAgentRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateAgentRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.CreateAgentRequest} CreateAgentRequest instance - */ - CreateAgentRequest.create = function create(properties) { - return new CreateAgentRequest(properties); - }; - - /** - * Encodes the specified CreateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateAgentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.CreateAgentRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateAgentRequest} message CreateAgentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAgentRequest.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.agentId != null && Object.hasOwnProperty.call(message, "agentId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.agentId); - if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) - $root.google.cloud.ces.v1beta.Agent.encode(message.agent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateAgentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.CreateAgentRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateAgentRequest} message CreateAgentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateAgentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.CreateAgentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.CreateAgentRequest} CreateAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAgentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateAgentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.agentId = reader.string(); - break; - } - case 3: { - message.agent = $root.google.cloud.ces.v1beta.Agent.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateAgentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.CreateAgentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.CreateAgentRequest} CreateAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAgentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateAgentRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.CreateAgentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateAgentRequest.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.agentId != null && message.hasOwnProperty("agentId")) - if (!$util.isString(message.agentId)) - return "agentId: string expected"; - if (message.agent != null && message.hasOwnProperty("agent")) { - var error = $root.google.cloud.ces.v1beta.Agent.verify(message.agent); - if (error) - return "agent." + error; - } - return null; - }; - - /** - * Creates a CreateAgentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.CreateAgentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.CreateAgentRequest} CreateAgentRequest - */ - CreateAgentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.CreateAgentRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.CreateAgentRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.agentId != null) - message.agentId = String(object.agentId); - if (object.agent != null) { - if (typeof object.agent !== "object") - throw TypeError(".google.cloud.ces.v1beta.CreateAgentRequest.agent: object expected"); - message.agent = $root.google.cloud.ces.v1beta.Agent.fromObject(object.agent); - } - return message; - }; - - /** - * Creates a plain object from a CreateAgentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.CreateAgentRequest - * @static - * @param {google.cloud.ces.v1beta.CreateAgentRequest} message CreateAgentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateAgentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.agentId = ""; - object.agent = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.agentId != null && message.hasOwnProperty("agentId")) - object.agentId = message.agentId; - if (message.agent != null && message.hasOwnProperty("agent")) - object.agent = $root.google.cloud.ces.v1beta.Agent.toObject(message.agent, options); - return object; - }; - - /** - * Converts this CreateAgentRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.CreateAgentRequest - * @instance - * @returns {Object.} JSON object - */ - CreateAgentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateAgentRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.CreateAgentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateAgentRequest"; - }; - - return CreateAgentRequest; - })(); - - v1beta.UpdateAgentRequest = (function() { - - /** - * Properties of an UpdateAgentRequest. - * @memberof google.cloud.ces.v1beta - * @interface IUpdateAgentRequest - * @property {google.cloud.ces.v1beta.IAgent|null} [agent] UpdateAgentRequest agent - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAgentRequest updateMask - */ - - /** - * Constructs a new UpdateAgentRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an UpdateAgentRequest. - * @implements IUpdateAgentRequest - * @constructor - * @param {google.cloud.ces.v1beta.IUpdateAgentRequest=} [properties] Properties to set - */ - function UpdateAgentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateAgentRequest agent. - * @member {google.cloud.ces.v1beta.IAgent|null|undefined} agent - * @memberof google.cloud.ces.v1beta.UpdateAgentRequest - * @instance - */ - UpdateAgentRequest.prototype.agent = null; - - /** - * UpdateAgentRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.ces.v1beta.UpdateAgentRequest - * @instance - */ - UpdateAgentRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateAgentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.UpdateAgentRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateAgentRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.UpdateAgentRequest} UpdateAgentRequest instance - */ - UpdateAgentRequest.create = function create(properties) { - return new UpdateAgentRequest(properties); - }; - - /** - * Encodes the specified UpdateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAgentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.UpdateAgentRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateAgentRequest} message UpdateAgentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateAgentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) - $root.google.cloud.ces.v1beta.Agent.encode(message.agent, 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 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAgentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateAgentRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateAgentRequest} message UpdateAgentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateAgentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.UpdateAgentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.UpdateAgentRequest} UpdateAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateAgentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateAgentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.agent = $root.google.cloud.ces.v1beta.Agent.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateAgentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateAgentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.UpdateAgentRequest} UpdateAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateAgentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateAgentRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.UpdateAgentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateAgentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.agent != null && message.hasOwnProperty("agent")) { - var error = $root.google.cloud.ces.v1beta.Agent.verify(message.agent); - if (error) - return "agent." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateAgentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.UpdateAgentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.UpdateAgentRequest} UpdateAgentRequest - */ - UpdateAgentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.UpdateAgentRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.UpdateAgentRequest(); - if (object.agent != null) { - if (typeof object.agent !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateAgentRequest.agent: object expected"); - message.agent = $root.google.cloud.ces.v1beta.Agent.fromObject(object.agent); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateAgentRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateAgentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.UpdateAgentRequest - * @static - * @param {google.cloud.ces.v1beta.UpdateAgentRequest} message UpdateAgentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateAgentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.agent = null; - object.updateMask = null; - } - if (message.agent != null && message.hasOwnProperty("agent")) - object.agent = $root.google.cloud.ces.v1beta.Agent.toObject(message.agent, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateAgentRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.UpdateAgentRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateAgentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateAgentRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.UpdateAgentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateAgentRequest"; - }; - - return UpdateAgentRequest; - })(); - - v1beta.DeleteAgentRequest = (function() { - - /** - * Properties of a DeleteAgentRequest. - * @memberof google.cloud.ces.v1beta - * @interface IDeleteAgentRequest - * @property {string|null} [name] DeleteAgentRequest name - * @property {boolean|null} [force] DeleteAgentRequest force - * @property {string|null} [etag] DeleteAgentRequest etag - */ - - /** - * Constructs a new DeleteAgentRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DeleteAgentRequest. - * @implements IDeleteAgentRequest - * @constructor - * @param {google.cloud.ces.v1beta.IDeleteAgentRequest=} [properties] Properties to set - */ - function DeleteAgentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteAgentRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.DeleteAgentRequest - * @instance - */ - DeleteAgentRequest.prototype.name = ""; - - /** - * DeleteAgentRequest force. - * @member {boolean} force - * @memberof google.cloud.ces.v1beta.DeleteAgentRequest - * @instance - */ - DeleteAgentRequest.prototype.force = false; - - /** - * DeleteAgentRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.DeleteAgentRequest - * @instance - */ - DeleteAgentRequest.prototype.etag = ""; - - /** - * Creates a new DeleteAgentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DeleteAgentRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteAgentRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DeleteAgentRequest} DeleteAgentRequest instance - */ - DeleteAgentRequest.create = function create(properties) { - return new DeleteAgentRequest(properties); - }; - - /** - * Encodes the specified DeleteAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAgentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DeleteAgentRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteAgentRequest} message DeleteAgentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAgentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAgentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteAgentRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteAgentRequest} message DeleteAgentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteAgentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DeleteAgentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DeleteAgentRequest} DeleteAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAgentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteAgentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.force = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteAgentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteAgentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DeleteAgentRequest} DeleteAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAgentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteAgentRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.DeleteAgentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteAgentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteAgentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DeleteAgentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DeleteAgentRequest} DeleteAgentRequest - */ - DeleteAgentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DeleteAgentRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.DeleteAgentRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.force != null) - message.force = Boolean(object.force); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteAgentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DeleteAgentRequest - * @static - * @param {google.cloud.ces.v1beta.DeleteAgentRequest} message DeleteAgentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteAgentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.force = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteAgentRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DeleteAgentRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteAgentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteAgentRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DeleteAgentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteAgentRequest"; - }; - - return DeleteAgentRequest; - })(); - - v1beta.OperationMetadata = (function() { - - /** - * Properties of an OperationMetadata. - * @memberof google.cloud.ces.v1beta - * @interface IOperationMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [statusMessage] OperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - */ - - /** - * Constructs a new OperationMetadata. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata - * @constructor - * @param {google.cloud.ces.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 createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.ces.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.endTime = null; - - /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.ces.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.statusMessage = ""; - - /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.ces.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.requestedCancellation = false; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.OperationMetadata - * @static - * @param {google.cloud.ces.v1beta.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.OperationMetadata} OperationMetadata instance - */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); - }; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.OperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.OperationMetadata - * @static - * @param {google.cloud.ces.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.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.requestedCancellation); - return writer; - }; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.OperationMetadata - * @static - * @param {google.cloud.ces.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.ces.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.ces.v1beta.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - 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.statusMessage = reader.string(); - break; - } - case 4: { - message.requestedCancellation = reader.bool(); - 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.ces.v1beta.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.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.ces.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"; - 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.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"; - return null; - }; - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.OperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.OperationMetadata} OperationMetadata - */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.OperationMetadata) - return object; - var message = new $root.google.cloud.ces.v1beta.OperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.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.ces.v1beta.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - return message; - }; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.OperationMetadata - * @static - * @param {google.cloud.ces.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.statusMessage = ""; - object.requestedCancellation = false; - } - 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.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - return object; - }; - - /** - * Converts this OperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.ces.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.ces.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.ces.v1beta.OperationMetadata"; - }; - - return OperationMetadata; - })(); - - v1beta.ListExamplesRequest = (function() { - - /** - * Properties of a ListExamplesRequest. - * @memberof google.cloud.ces.v1beta - * @interface IListExamplesRequest - * @property {string|null} [parent] ListExamplesRequest parent - * @property {number|null} [pageSize] ListExamplesRequest pageSize - * @property {string|null} [pageToken] ListExamplesRequest pageToken - * @property {string|null} [filter] ListExamplesRequest filter - * @property {string|null} [orderBy] ListExamplesRequest orderBy - */ - - /** - * Constructs a new ListExamplesRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListExamplesRequest. - * @implements IListExamplesRequest - * @constructor - * @param {google.cloud.ces.v1beta.IListExamplesRequest=} [properties] Properties to set - */ - function ListExamplesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListExamplesRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ListExamplesRequest - * @instance - */ - ListExamplesRequest.prototype.parent = ""; - - /** - * ListExamplesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1beta.ListExamplesRequest - * @instance - */ - ListExamplesRequest.prototype.pageSize = 0; - - /** - * ListExamplesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1beta.ListExamplesRequest - * @instance - */ - ListExamplesRequest.prototype.pageToken = ""; - - /** - * ListExamplesRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1beta.ListExamplesRequest - * @instance - */ - ListExamplesRequest.prototype.filter = ""; - - /** - * ListExamplesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1beta.ListExamplesRequest - * @instance - */ - ListExamplesRequest.prototype.orderBy = ""; - - /** - * Creates a new ListExamplesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListExamplesRequest - * @static - * @param {google.cloud.ces.v1beta.IListExamplesRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListExamplesRequest} ListExamplesRequest instance - */ - ListExamplesRequest.create = function create(properties) { - return new ListExamplesRequest(properties); - }; - - /** - * Encodes the specified ListExamplesRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListExamplesRequest - * @static - * @param {google.cloud.ces.v1beta.IListExamplesRequest} message ListExamplesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExamplesRequest.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 ListExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListExamplesRequest - * @static - * @param {google.cloud.ces.v1beta.IListExamplesRequest} message ListExamplesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExamplesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListExamplesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListExamplesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListExamplesRequest} ListExamplesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExamplesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListExamplesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListExamplesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListExamplesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListExamplesRequest} ListExamplesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExamplesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListExamplesRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListExamplesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListExamplesRequest.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 ListExamplesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListExamplesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListExamplesRequest} ListExamplesRequest - */ - ListExamplesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListExamplesRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ListExamplesRequest(); - 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 ListExamplesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListExamplesRequest - * @static - * @param {google.cloud.ces.v1beta.ListExamplesRequest} message ListExamplesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListExamplesRequest.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 ListExamplesRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListExamplesRequest - * @instance - * @returns {Object.} JSON object - */ - ListExamplesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListExamplesRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListExamplesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListExamplesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListExamplesRequest"; - }; - - return ListExamplesRequest; - })(); - - v1beta.ListExamplesResponse = (function() { - - /** - * Properties of a ListExamplesResponse. - * @memberof google.cloud.ces.v1beta - * @interface IListExamplesResponse - * @property {Array.|null} [examples] ListExamplesResponse examples - * @property {string|null} [nextPageToken] ListExamplesResponse nextPageToken - */ - - /** - * Constructs a new ListExamplesResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListExamplesResponse. - * @implements IListExamplesResponse - * @constructor - * @param {google.cloud.ces.v1beta.IListExamplesResponse=} [properties] Properties to set - */ - function ListExamplesResponse(properties) { - this.examples = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListExamplesResponse examples. - * @member {Array.} examples - * @memberof google.cloud.ces.v1beta.ListExamplesResponse - * @instance - */ - ListExamplesResponse.prototype.examples = $util.emptyArray; - - /** - * ListExamplesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1beta.ListExamplesResponse - * @instance - */ - ListExamplesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListExamplesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListExamplesResponse - * @static - * @param {google.cloud.ces.v1beta.IListExamplesResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListExamplesResponse} ListExamplesResponse instance - */ - ListExamplesResponse.create = function create(properties) { - return new ListExamplesResponse(properties); - }; - - /** - * Encodes the specified ListExamplesResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListExamplesResponse - * @static - * @param {google.cloud.ces.v1beta.IListExamplesResponse} message ListExamplesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExamplesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.examples != null && message.examples.length) - for (var i = 0; i < message.examples.length; ++i) - $root.google.cloud.ces.v1beta.Example.encode(message.examples[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 ListExamplesResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListExamplesResponse - * @static - * @param {google.cloud.ces.v1beta.IListExamplesResponse} message ListExamplesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExamplesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListExamplesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListExamplesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListExamplesResponse} ListExamplesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExamplesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListExamplesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.examples && message.examples.length)) - message.examples = []; - message.examples.push($root.google.cloud.ces.v1beta.Example.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListExamplesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListExamplesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListExamplesResponse} ListExamplesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExamplesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListExamplesResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListExamplesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListExamplesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.examples != null && message.hasOwnProperty("examples")) { - if (!Array.isArray(message.examples)) - return "examples: array expected"; - for (var i = 0; i < message.examples.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Example.verify(message.examples[i]); - if (error) - return "examples." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListExamplesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListExamplesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListExamplesResponse} ListExamplesResponse - */ - ListExamplesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListExamplesResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ListExamplesResponse(); - if (object.examples) { - if (!Array.isArray(object.examples)) - throw TypeError(".google.cloud.ces.v1beta.ListExamplesResponse.examples: array expected"); - message.examples = []; - for (var i = 0; i < object.examples.length; ++i) { - if (typeof object.examples[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ListExamplesResponse.examples: object expected"); - message.examples[i] = $root.google.cloud.ces.v1beta.Example.fromObject(object.examples[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListExamplesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListExamplesResponse - * @static - * @param {google.cloud.ces.v1beta.ListExamplesResponse} message ListExamplesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListExamplesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.examples = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.examples && message.examples.length) { - object.examples = []; - for (var j = 0; j < message.examples.length; ++j) - object.examples[j] = $root.google.cloud.ces.v1beta.Example.toObject(message.examples[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListExamplesResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListExamplesResponse - * @instance - * @returns {Object.} JSON object - */ - ListExamplesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListExamplesResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListExamplesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListExamplesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListExamplesResponse"; - }; - - return ListExamplesResponse; - })(); - - v1beta.GetExampleRequest = (function() { - - /** - * Properties of a GetExampleRequest. - * @memberof google.cloud.ces.v1beta - * @interface IGetExampleRequest - * @property {string|null} [name] GetExampleRequest name - */ - - /** - * Constructs a new GetExampleRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GetExampleRequest. - * @implements IGetExampleRequest - * @constructor - * @param {google.cloud.ces.v1beta.IGetExampleRequest=} [properties] Properties to set - */ - function GetExampleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetExampleRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.GetExampleRequest - * @instance - */ - GetExampleRequest.prototype.name = ""; - - /** - * Creates a new GetExampleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GetExampleRequest - * @static - * @param {google.cloud.ces.v1beta.IGetExampleRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GetExampleRequest} GetExampleRequest instance - */ - GetExampleRequest.create = function create(properties) { - return new GetExampleRequest(properties); - }; - - /** - * Encodes the specified GetExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetExampleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GetExampleRequest - * @static - * @param {google.cloud.ces.v1beta.IGetExampleRequest} message GetExampleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetExampleRequest.encode = function encode(message, writer) { - 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 GetExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetExampleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GetExampleRequest - * @static - * @param {google.cloud.ces.v1beta.IGetExampleRequest} message GetExampleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetExampleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GetExampleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GetExampleRequest} GetExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetExampleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetExampleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetExampleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GetExampleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GetExampleRequest} GetExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetExampleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetExampleRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.GetExampleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetExampleRequest.verify = function verify(message) { - if (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 GetExampleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GetExampleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GetExampleRequest} GetExampleRequest - */ - GetExampleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GetExampleRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.GetExampleRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetExampleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GetExampleRequest - * @static - * @param {google.cloud.ces.v1beta.GetExampleRequest} message GetExampleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetExampleRequest.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 GetExampleRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GetExampleRequest - * @instance - * @returns {Object.} JSON object - */ - GetExampleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetExampleRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GetExampleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GetExampleRequest"; - }; - - return GetExampleRequest; - })(); - - v1beta.CreateExampleRequest = (function() { - - /** - * Properties of a CreateExampleRequest. - * @memberof google.cloud.ces.v1beta - * @interface ICreateExampleRequest - * @property {string|null} [parent] CreateExampleRequest parent - * @property {string|null} [exampleId] CreateExampleRequest exampleId - * @property {google.cloud.ces.v1beta.IExample|null} [example] CreateExampleRequest example - */ - - /** - * Constructs a new CreateExampleRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a CreateExampleRequest. - * @implements ICreateExampleRequest - * @constructor - * @param {google.cloud.ces.v1beta.ICreateExampleRequest=} [properties] Properties to set - */ - function CreateExampleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateExampleRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.CreateExampleRequest - * @instance - */ - CreateExampleRequest.prototype.parent = ""; - - /** - * CreateExampleRequest exampleId. - * @member {string} exampleId - * @memberof google.cloud.ces.v1beta.CreateExampleRequest - * @instance - */ - CreateExampleRequest.prototype.exampleId = ""; - - /** - * CreateExampleRequest example. - * @member {google.cloud.ces.v1beta.IExample|null|undefined} example - * @memberof google.cloud.ces.v1beta.CreateExampleRequest - * @instance - */ - CreateExampleRequest.prototype.example = null; - - /** - * Creates a new CreateExampleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.CreateExampleRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateExampleRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.CreateExampleRequest} CreateExampleRequest instance - */ - CreateExampleRequest.create = function create(properties) { - return new CreateExampleRequest(properties); - }; - - /** - * Encodes the specified CreateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateExampleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.CreateExampleRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateExampleRequest} message CreateExampleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateExampleRequest.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.exampleId != null && Object.hasOwnProperty.call(message, "exampleId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.exampleId); - if (message.example != null && Object.hasOwnProperty.call(message, "example")) - $root.google.cloud.ces.v1beta.Example.encode(message.example, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateExampleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.CreateExampleRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateExampleRequest} message CreateExampleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateExampleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.CreateExampleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.CreateExampleRequest} CreateExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateExampleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateExampleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.exampleId = reader.string(); - break; - } - case 3: { - message.example = $root.google.cloud.ces.v1beta.Example.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateExampleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.CreateExampleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.CreateExampleRequest} CreateExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateExampleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateExampleRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.CreateExampleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateExampleRequest.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.exampleId != null && message.hasOwnProperty("exampleId")) - if (!$util.isString(message.exampleId)) - return "exampleId: string expected"; - if (message.example != null && message.hasOwnProperty("example")) { - var error = $root.google.cloud.ces.v1beta.Example.verify(message.example); - if (error) - return "example." + error; - } - return null; - }; - - /** - * Creates a CreateExampleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.CreateExampleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.CreateExampleRequest} CreateExampleRequest - */ - CreateExampleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.CreateExampleRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.CreateExampleRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.exampleId != null) - message.exampleId = String(object.exampleId); - if (object.example != null) { - if (typeof object.example !== "object") - throw TypeError(".google.cloud.ces.v1beta.CreateExampleRequest.example: object expected"); - message.example = $root.google.cloud.ces.v1beta.Example.fromObject(object.example); - } - return message; - }; - - /** - * Creates a plain object from a CreateExampleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.CreateExampleRequest - * @static - * @param {google.cloud.ces.v1beta.CreateExampleRequest} message CreateExampleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateExampleRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.exampleId = ""; - object.example = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.exampleId != null && message.hasOwnProperty("exampleId")) - object.exampleId = message.exampleId; - if (message.example != null && message.hasOwnProperty("example")) - object.example = $root.google.cloud.ces.v1beta.Example.toObject(message.example, options); - return object; - }; - - /** - * Converts this CreateExampleRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.CreateExampleRequest - * @instance - * @returns {Object.} JSON object - */ - CreateExampleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateExampleRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.CreateExampleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateExampleRequest"; - }; - - return CreateExampleRequest; - })(); - - v1beta.UpdateExampleRequest = (function() { - - /** - * Properties of an UpdateExampleRequest. - * @memberof google.cloud.ces.v1beta - * @interface IUpdateExampleRequest - * @property {google.cloud.ces.v1beta.IExample|null} [example] UpdateExampleRequest example - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateExampleRequest updateMask - */ - - /** - * Constructs a new UpdateExampleRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an UpdateExampleRequest. - * @implements IUpdateExampleRequest - * @constructor - * @param {google.cloud.ces.v1beta.IUpdateExampleRequest=} [properties] Properties to set - */ - function UpdateExampleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateExampleRequest example. - * @member {google.cloud.ces.v1beta.IExample|null|undefined} example - * @memberof google.cloud.ces.v1beta.UpdateExampleRequest - * @instance - */ - UpdateExampleRequest.prototype.example = null; - - /** - * UpdateExampleRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.ces.v1beta.UpdateExampleRequest - * @instance - */ - UpdateExampleRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateExampleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.UpdateExampleRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateExampleRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.UpdateExampleRequest} UpdateExampleRequest instance - */ - UpdateExampleRequest.create = function create(properties) { - return new UpdateExampleRequest(properties); - }; - - /** - * Encodes the specified UpdateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateExampleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.UpdateExampleRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateExampleRequest} message UpdateExampleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateExampleRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.example != null && Object.hasOwnProperty.call(message, "example")) - $root.google.cloud.ces.v1beta.Example.encode(message.example, 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 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateExampleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateExampleRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateExampleRequest} message UpdateExampleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateExampleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.UpdateExampleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.UpdateExampleRequest} UpdateExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateExampleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateExampleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.example = $root.google.cloud.ces.v1beta.Example.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateExampleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateExampleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.UpdateExampleRequest} UpdateExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateExampleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateExampleRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.UpdateExampleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateExampleRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.example != null && message.hasOwnProperty("example")) { - var error = $root.google.cloud.ces.v1beta.Example.verify(message.example); - if (error) - return "example." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateExampleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.UpdateExampleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.UpdateExampleRequest} UpdateExampleRequest - */ - UpdateExampleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.UpdateExampleRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.UpdateExampleRequest(); - if (object.example != null) { - if (typeof object.example !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateExampleRequest.example: object expected"); - message.example = $root.google.cloud.ces.v1beta.Example.fromObject(object.example); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateExampleRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateExampleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.UpdateExampleRequest - * @static - * @param {google.cloud.ces.v1beta.UpdateExampleRequest} message UpdateExampleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateExampleRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.example = null; - object.updateMask = null; - } - if (message.example != null && message.hasOwnProperty("example")) - object.example = $root.google.cloud.ces.v1beta.Example.toObject(message.example, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateExampleRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.UpdateExampleRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateExampleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateExampleRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.UpdateExampleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateExampleRequest"; - }; - - return UpdateExampleRequest; - })(); - - v1beta.DeleteExampleRequest = (function() { - - /** - * Properties of a DeleteExampleRequest. - * @memberof google.cloud.ces.v1beta - * @interface IDeleteExampleRequest - * @property {string|null} [name] DeleteExampleRequest name - * @property {string|null} [etag] DeleteExampleRequest etag - */ - - /** - * Constructs a new DeleteExampleRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DeleteExampleRequest. - * @implements IDeleteExampleRequest - * @constructor - * @param {google.cloud.ces.v1beta.IDeleteExampleRequest=} [properties] Properties to set - */ - function DeleteExampleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteExampleRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.DeleteExampleRequest - * @instance - */ - DeleteExampleRequest.prototype.name = ""; - - /** - * DeleteExampleRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.DeleteExampleRequest - * @instance - */ - DeleteExampleRequest.prototype.etag = ""; - - /** - * Creates a new DeleteExampleRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DeleteExampleRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteExampleRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DeleteExampleRequest} DeleteExampleRequest instance - */ - DeleteExampleRequest.create = function create(properties) { - return new DeleteExampleRequest(properties); - }; - - /** - * Encodes the specified DeleteExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteExampleRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DeleteExampleRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteExampleRequest} message DeleteExampleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteExampleRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteExampleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteExampleRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteExampleRequest} message DeleteExampleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteExampleRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DeleteExampleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DeleteExampleRequest} DeleteExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteExampleRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteExampleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteExampleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteExampleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DeleteExampleRequest} DeleteExampleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteExampleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteExampleRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.DeleteExampleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteExampleRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteExampleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DeleteExampleRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DeleteExampleRequest} DeleteExampleRequest - */ - DeleteExampleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DeleteExampleRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.DeleteExampleRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteExampleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DeleteExampleRequest - * @static - * @param {google.cloud.ces.v1beta.DeleteExampleRequest} message DeleteExampleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteExampleRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteExampleRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DeleteExampleRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteExampleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteExampleRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DeleteExampleRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteExampleRequest"; - }; - - return DeleteExampleRequest; - })(); - - v1beta.ListToolsRequest = (function() { - - /** - * Properties of a ListToolsRequest. - * @memberof google.cloud.ces.v1beta - * @interface IListToolsRequest - * @property {string|null} [parent] ListToolsRequest parent - * @property {number|null} [pageSize] ListToolsRequest pageSize - * @property {string|null} [pageToken] ListToolsRequest pageToken - * @property {string|null} [filter] ListToolsRequest filter - * @property {string|null} [orderBy] ListToolsRequest orderBy - */ - - /** - * Constructs a new ListToolsRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListToolsRequest. - * @implements IListToolsRequest - * @constructor - * @param {google.cloud.ces.v1beta.IListToolsRequest=} [properties] Properties to set - */ - function ListToolsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListToolsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ListToolsRequest - * @instance - */ - ListToolsRequest.prototype.parent = ""; - - /** - * ListToolsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1beta.ListToolsRequest - * @instance - */ - ListToolsRequest.prototype.pageSize = 0; - - /** - * ListToolsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1beta.ListToolsRequest - * @instance - */ - ListToolsRequest.prototype.pageToken = ""; - - /** - * ListToolsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1beta.ListToolsRequest - * @instance - */ - ListToolsRequest.prototype.filter = ""; - - /** - * ListToolsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1beta.ListToolsRequest - * @instance - */ - ListToolsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListToolsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListToolsRequest - * @static - * @param {google.cloud.ces.v1beta.IListToolsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListToolsRequest} ListToolsRequest instance - */ - ListToolsRequest.create = function create(properties) { - return new ListToolsRequest(properties); - }; - - /** - * Encodes the specified ListToolsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListToolsRequest - * @static - * @param {google.cloud.ces.v1beta.IListToolsRequest} message ListToolsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListToolsRequest.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 ListToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListToolsRequest - * @static - * @param {google.cloud.ces.v1beta.IListToolsRequest} message ListToolsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListToolsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListToolsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListToolsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListToolsRequest} ListToolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListToolsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListToolsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListToolsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListToolsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListToolsRequest} ListToolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListToolsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListToolsRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListToolsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListToolsRequest.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 ListToolsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListToolsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListToolsRequest} ListToolsRequest - */ - ListToolsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListToolsRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ListToolsRequest(); - 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 ListToolsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListToolsRequest - * @static - * @param {google.cloud.ces.v1beta.ListToolsRequest} message ListToolsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListToolsRequest.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 ListToolsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListToolsRequest - * @instance - * @returns {Object.} JSON object - */ - ListToolsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListToolsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListToolsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListToolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListToolsRequest"; - }; - - return ListToolsRequest; - })(); - - v1beta.ListToolsResponse = (function() { - - /** - * Properties of a ListToolsResponse. - * @memberof google.cloud.ces.v1beta - * @interface IListToolsResponse - * @property {Array.|null} [tools] ListToolsResponse tools - * @property {string|null} [nextPageToken] ListToolsResponse nextPageToken - */ - - /** - * Constructs a new ListToolsResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListToolsResponse. - * @implements IListToolsResponse - * @constructor - * @param {google.cloud.ces.v1beta.IListToolsResponse=} [properties] Properties to set - */ - function ListToolsResponse(properties) { - this.tools = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListToolsResponse tools. - * @member {Array.} tools - * @memberof google.cloud.ces.v1beta.ListToolsResponse - * @instance - */ - ListToolsResponse.prototype.tools = $util.emptyArray; - - /** - * ListToolsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1beta.ListToolsResponse - * @instance - */ - ListToolsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListToolsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListToolsResponse - * @static - * @param {google.cloud.ces.v1beta.IListToolsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListToolsResponse} ListToolsResponse instance - */ - ListToolsResponse.create = function create(properties) { - return new ListToolsResponse(properties); - }; - - /** - * Encodes the specified ListToolsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListToolsResponse - * @static - * @param {google.cloud.ces.v1beta.IListToolsResponse} message ListToolsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListToolsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tools != null && message.tools.length) - for (var i = 0; i < message.tools.length; ++i) - $root.google.cloud.ces.v1beta.Tool.encode(message.tools[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 ListToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListToolsResponse - * @static - * @param {google.cloud.ces.v1beta.IListToolsResponse} message ListToolsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListToolsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListToolsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListToolsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListToolsResponse} ListToolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListToolsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListToolsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.tools && message.tools.length)) - message.tools = []; - message.tools.push($root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListToolsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListToolsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListToolsResponse} ListToolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListToolsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListToolsResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListToolsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListToolsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tools != null && message.hasOwnProperty("tools")) { - if (!Array.isArray(message.tools)) - return "tools: array expected"; - for (var i = 0; i < message.tools.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tools[i]); - if (error) - return "tools." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListToolsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListToolsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListToolsResponse} ListToolsResponse - */ - ListToolsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListToolsResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ListToolsResponse(); - if (object.tools) { - if (!Array.isArray(object.tools)) - throw TypeError(".google.cloud.ces.v1beta.ListToolsResponse.tools: array expected"); - message.tools = []; - for (var i = 0; i < object.tools.length; ++i) { - if (typeof object.tools[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ListToolsResponse.tools: object expected"); - message.tools[i] = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tools[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListToolsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListToolsResponse - * @static - * @param {google.cloud.ces.v1beta.ListToolsResponse} message ListToolsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListToolsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tools = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.tools && message.tools.length) { - object.tools = []; - for (var j = 0; j < message.tools.length; ++j) - object.tools[j] = $root.google.cloud.ces.v1beta.Tool.toObject(message.tools[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListToolsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListToolsResponse - * @instance - * @returns {Object.} JSON object - */ - ListToolsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListToolsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListToolsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListToolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListToolsResponse"; - }; - - return ListToolsResponse; - })(); - - v1beta.GetToolRequest = (function() { - - /** - * Properties of a GetToolRequest. - * @memberof google.cloud.ces.v1beta - * @interface IGetToolRequest - * @property {string|null} [name] GetToolRequest name - */ - - /** - * Constructs a new GetToolRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GetToolRequest. - * @implements IGetToolRequest - * @constructor - * @param {google.cloud.ces.v1beta.IGetToolRequest=} [properties] Properties to set - */ - function GetToolRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetToolRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.GetToolRequest - * @instance - */ - GetToolRequest.prototype.name = ""; - - /** - * Creates a new GetToolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GetToolRequest - * @static - * @param {google.cloud.ces.v1beta.IGetToolRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GetToolRequest} GetToolRequest instance - */ - GetToolRequest.create = function create(properties) { - return new GetToolRequest(properties); - }; - - /** - * Encodes the specified GetToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetToolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GetToolRequest - * @static - * @param {google.cloud.ces.v1beta.IGetToolRequest} message GetToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetToolRequest.encode = function encode(message, writer) { - 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 GetToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetToolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GetToolRequest - * @static - * @param {google.cloud.ces.v1beta.IGetToolRequest} message GetToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetToolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetToolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GetToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GetToolRequest} GetToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetToolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetToolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetToolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GetToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GetToolRequest} GetToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetToolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetToolRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.GetToolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetToolRequest.verify = function verify(message) { - if (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 GetToolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GetToolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GetToolRequest} GetToolRequest - */ - GetToolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GetToolRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.GetToolRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetToolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GetToolRequest - * @static - * @param {google.cloud.ces.v1beta.GetToolRequest} message GetToolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetToolRequest.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 GetToolRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GetToolRequest - * @instance - * @returns {Object.} JSON object - */ - GetToolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetToolRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GetToolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GetToolRequest"; - }; - - return GetToolRequest; - })(); - - v1beta.CreateToolRequest = (function() { - - /** - * Properties of a CreateToolRequest. - * @memberof google.cloud.ces.v1beta - * @interface ICreateToolRequest - * @property {string|null} [parent] CreateToolRequest parent - * @property {string|null} [toolId] CreateToolRequest toolId - * @property {google.cloud.ces.v1beta.ITool|null} [tool] CreateToolRequest tool - */ - - /** - * Constructs a new CreateToolRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a CreateToolRequest. - * @implements ICreateToolRequest - * @constructor - * @param {google.cloud.ces.v1beta.ICreateToolRequest=} [properties] Properties to set - */ - function CreateToolRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateToolRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.CreateToolRequest - * @instance - */ - CreateToolRequest.prototype.parent = ""; - - /** - * CreateToolRequest toolId. - * @member {string} toolId - * @memberof google.cloud.ces.v1beta.CreateToolRequest - * @instance - */ - CreateToolRequest.prototype.toolId = ""; - - /** - * CreateToolRequest tool. - * @member {google.cloud.ces.v1beta.ITool|null|undefined} tool - * @memberof google.cloud.ces.v1beta.CreateToolRequest - * @instance - */ - CreateToolRequest.prototype.tool = null; - - /** - * Creates a new CreateToolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.CreateToolRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateToolRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.CreateToolRequest} CreateToolRequest instance - */ - CreateToolRequest.create = function create(properties) { - return new CreateToolRequest(properties); - }; - - /** - * Encodes the specified CreateToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.CreateToolRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateToolRequest} message CreateToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateToolRequest.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.toolId != null && Object.hasOwnProperty.call(message, "toolId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.toolId); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - $root.google.cloud.ces.v1beta.Tool.encode(message.tool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.CreateToolRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateToolRequest} message CreateToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateToolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateToolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.CreateToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.CreateToolRequest} CreateToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateToolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateToolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.toolId = reader.string(); - break; - } - case 3: { - message.tool = $root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateToolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.CreateToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.CreateToolRequest} CreateToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateToolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateToolRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.CreateToolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateToolRequest.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.toolId != null && message.hasOwnProperty("toolId")) - if (!$util.isString(message.toolId)) - return "toolId: string expected"; - if (message.tool != null && message.hasOwnProperty("tool")) { - var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tool); - if (error) - return "tool." + error; - } - return null; - }; - - /** - * Creates a CreateToolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.CreateToolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.CreateToolRequest} CreateToolRequest - */ - CreateToolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.CreateToolRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.CreateToolRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.toolId != null) - message.toolId = String(object.toolId); - if (object.tool != null) { - if (typeof object.tool !== "object") - throw TypeError(".google.cloud.ces.v1beta.CreateToolRequest.tool: object expected"); - message.tool = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tool); - } - return message; - }; - - /** - * Creates a plain object from a CreateToolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.CreateToolRequest - * @static - * @param {google.cloud.ces.v1beta.CreateToolRequest} message CreateToolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateToolRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.toolId = ""; - object.tool = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.toolId != null && message.hasOwnProperty("toolId")) - object.toolId = message.toolId; - if (message.tool != null && message.hasOwnProperty("tool")) - object.tool = $root.google.cloud.ces.v1beta.Tool.toObject(message.tool, options); - return object; - }; - - /** - * Converts this CreateToolRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.CreateToolRequest - * @instance - * @returns {Object.} JSON object - */ - CreateToolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateToolRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.CreateToolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateToolRequest"; - }; - - return CreateToolRequest; - })(); - - v1beta.UpdateToolRequest = (function() { - - /** - * Properties of an UpdateToolRequest. - * @memberof google.cloud.ces.v1beta - * @interface IUpdateToolRequest - * @property {google.cloud.ces.v1beta.ITool|null} [tool] UpdateToolRequest tool - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateToolRequest updateMask - */ - - /** - * Constructs a new UpdateToolRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an UpdateToolRequest. - * @implements IUpdateToolRequest - * @constructor - * @param {google.cloud.ces.v1beta.IUpdateToolRequest=} [properties] Properties to set - */ - function UpdateToolRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateToolRequest tool. - * @member {google.cloud.ces.v1beta.ITool|null|undefined} tool - * @memberof google.cloud.ces.v1beta.UpdateToolRequest - * @instance - */ - UpdateToolRequest.prototype.tool = null; - - /** - * UpdateToolRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.ces.v1beta.UpdateToolRequest - * @instance - */ - UpdateToolRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateToolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.UpdateToolRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateToolRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.UpdateToolRequest} UpdateToolRequest instance - */ - UpdateToolRequest.create = function create(properties) { - return new UpdateToolRequest(properties); - }; - - /** - * Encodes the specified UpdateToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.UpdateToolRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateToolRequest} message UpdateToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateToolRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - $root.google.cloud.ces.v1beta.Tool.encode(message.tool, 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 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateToolRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateToolRequest} message UpdateToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateToolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateToolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.UpdateToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.UpdateToolRequest} UpdateToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateToolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateToolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tool = $root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateToolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.UpdateToolRequest} UpdateToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateToolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateToolRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.UpdateToolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateToolRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tool != null && message.hasOwnProperty("tool")) { - var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tool); - if (error) - return "tool." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateToolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.UpdateToolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.UpdateToolRequest} UpdateToolRequest - */ - UpdateToolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.UpdateToolRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.UpdateToolRequest(); - if (object.tool != null) { - if (typeof object.tool !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateToolRequest.tool: object expected"); - message.tool = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tool); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateToolRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateToolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.UpdateToolRequest - * @static - * @param {google.cloud.ces.v1beta.UpdateToolRequest} message UpdateToolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateToolRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.tool = null; - object.updateMask = null; - } - if (message.tool != null && message.hasOwnProperty("tool")) - object.tool = $root.google.cloud.ces.v1beta.Tool.toObject(message.tool, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateToolRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.UpdateToolRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateToolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateToolRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.UpdateToolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateToolRequest"; - }; - - return UpdateToolRequest; - })(); - - v1beta.DeleteToolRequest = (function() { - - /** - * Properties of a DeleteToolRequest. - * @memberof google.cloud.ces.v1beta - * @interface IDeleteToolRequest - * @property {string|null} [name] DeleteToolRequest name - * @property {boolean|null} [force] DeleteToolRequest force - * @property {string|null} [etag] DeleteToolRequest etag - */ - - /** - * Constructs a new DeleteToolRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DeleteToolRequest. - * @implements IDeleteToolRequest - * @constructor - * @param {google.cloud.ces.v1beta.IDeleteToolRequest=} [properties] Properties to set - */ - function DeleteToolRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteToolRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.DeleteToolRequest - * @instance - */ - DeleteToolRequest.prototype.name = ""; - - /** - * DeleteToolRequest force. - * @member {boolean} force - * @memberof google.cloud.ces.v1beta.DeleteToolRequest - * @instance - */ - DeleteToolRequest.prototype.force = false; - - /** - * DeleteToolRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.DeleteToolRequest - * @instance - */ - DeleteToolRequest.prototype.etag = ""; - - /** - * Creates a new DeleteToolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DeleteToolRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteToolRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DeleteToolRequest} DeleteToolRequest instance - */ - DeleteToolRequest.create = function create(properties) { - return new DeleteToolRequest(properties); - }; - - /** - * Encodes the specified DeleteToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DeleteToolRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteToolRequest} message DeleteToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteToolRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteToolRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteToolRequest} message DeleteToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteToolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteToolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DeleteToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DeleteToolRequest} DeleteToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteToolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteToolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.force = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteToolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DeleteToolRequest} DeleteToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteToolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteToolRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.DeleteToolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteToolRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteToolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DeleteToolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DeleteToolRequest} DeleteToolRequest - */ - DeleteToolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DeleteToolRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.DeleteToolRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.force != null) - message.force = Boolean(object.force); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteToolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DeleteToolRequest - * @static - * @param {google.cloud.ces.v1beta.DeleteToolRequest} message DeleteToolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteToolRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.force = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteToolRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DeleteToolRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteToolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteToolRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DeleteToolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteToolRequest"; - }; - - return DeleteToolRequest; - })(); - - v1beta.ListConversationsRequest = (function() { - - /** - * Properties of a ListConversationsRequest. - * @memberof google.cloud.ces.v1beta - * @interface IListConversationsRequest - * @property {string|null} [parent] ListConversationsRequest parent - * @property {number|null} [pageSize] ListConversationsRequest pageSize - * @property {string|null} [pageToken] ListConversationsRequest pageToken - * @property {string|null} [filter] ListConversationsRequest filter - * @property {google.cloud.ces.v1beta.Conversation.Source|null} [source] ListConversationsRequest source - * @property {Array.|null} [sources] ListConversationsRequest sources - */ - - /** - * Constructs a new ListConversationsRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListConversationsRequest. - * @implements IListConversationsRequest - * @constructor - * @param {google.cloud.ces.v1beta.IListConversationsRequest=} [properties] Properties to set - */ - function ListConversationsRequest(properties) { - this.sources = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListConversationsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ListConversationsRequest - * @instance - */ - ListConversationsRequest.prototype.parent = ""; - - /** - * ListConversationsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1beta.ListConversationsRequest - * @instance - */ - ListConversationsRequest.prototype.pageSize = 0; - - /** - * ListConversationsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1beta.ListConversationsRequest - * @instance - */ - ListConversationsRequest.prototype.pageToken = ""; - - /** - * ListConversationsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1beta.ListConversationsRequest - * @instance - */ - ListConversationsRequest.prototype.filter = ""; - - /** - * ListConversationsRequest source. - * @member {google.cloud.ces.v1beta.Conversation.Source} source - * @memberof google.cloud.ces.v1beta.ListConversationsRequest - * @instance - */ - ListConversationsRequest.prototype.source = 0; - - /** - * ListConversationsRequest sources. - * @member {Array.} sources - * @memberof google.cloud.ces.v1beta.ListConversationsRequest - * @instance - */ - ListConversationsRequest.prototype.sources = $util.emptyArray; - - /** - * Creates a new ListConversationsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListConversationsRequest - * @static - * @param {google.cloud.ces.v1beta.IListConversationsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListConversationsRequest} ListConversationsRequest instance - */ - ListConversationsRequest.create = function create(properties) { - return new ListConversationsRequest(properties); - }; - - /** - * Encodes the specified ListConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListConversationsRequest - * @static - * @param {google.cloud.ces.v1beta.IListConversationsRequest} message ListConversationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListConversationsRequest.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.source != null && Object.hasOwnProperty.call(message, "source")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.source); - if (message.sources != null && message.sources.length) { - writer.uint32(/* id 6, wireType 2 =*/50).fork(); - for (var i = 0; i < message.sources.length; ++i) - writer.int32(message.sources[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ListConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListConversationsRequest - * @static - * @param {google.cloud.ces.v1beta.IListConversationsRequest} message ListConversationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListConversationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListConversationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListConversationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListConversationsRequest} ListConversationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListConversationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListConversationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.source = reader.int32(); - break; - } - case 6: { - if (!(message.sources && message.sources.length)) - message.sources = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.sources.push(reader.int32()); - } else - message.sources.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListConversationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListConversationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListConversationsRequest} ListConversationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListConversationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListConversationsRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListConversationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListConversationsRequest.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.source != null && message.hasOwnProperty("source")) - switch (message.source) { - default: - return "source: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.sources != null && message.hasOwnProperty("sources")) { - if (!Array.isArray(message.sources)) - return "sources: array expected"; - for (var i = 0; i < message.sources.length; ++i) - switch (message.sources[i]) { - default: - return "sources: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - return null; - }; - - /** - * Creates a ListConversationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListConversationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListConversationsRequest} ListConversationsRequest - */ - ListConversationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListConversationsRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ListConversationsRequest(); - 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); - switch (object.source) { - default: - if (typeof object.source === "number") { - message.source = object.source; - break; - } - break; - case "SOURCE_UNSPECIFIED": - case 0: - message.source = 0; - break; - case "LIVE": - case 1: - message.source = 1; - break; - case "SIMULATOR": - case 2: - message.source = 2; - break; - case "EVAL": - case 3: - message.source = 3; - break; - } - if (object.sources) { - if (!Array.isArray(object.sources)) - throw TypeError(".google.cloud.ces.v1beta.ListConversationsRequest.sources: array expected"); - message.sources = []; - for (var i = 0; i < object.sources.length; ++i) - switch (object.sources[i]) { - default: - if (typeof object.sources[i] === "number") { - message.sources[i] = object.sources[i]; - break; - } - case "SOURCE_UNSPECIFIED": - case 0: - message.sources[i] = 0; - break; - case "LIVE": - case 1: - message.sources[i] = 1; - break; - case "SIMULATOR": - case 2: - message.sources[i] = 2; - break; - case "EVAL": - case 3: - message.sources[i] = 3; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a ListConversationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListConversationsRequest - * @static - * @param {google.cloud.ces.v1beta.ListConversationsRequest} message ListConversationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListConversationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.sources = []; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.source != null && message.hasOwnProperty("source")) - object.source = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1beta.Conversation.Source[message.source] : message.source; - if (message.sources && message.sources.length) { - object.sources = []; - for (var j = 0; j < message.sources.length; ++j) - object.sources[j] = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.Source[message.sources[j]] === undefined ? message.sources[j] : $root.google.cloud.ces.v1beta.Conversation.Source[message.sources[j]] : message.sources[j]; - } - return object; - }; - - /** - * Converts this ListConversationsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListConversationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListConversationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListConversationsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListConversationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListConversationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListConversationsRequest"; - }; - - return ListConversationsRequest; - })(); - - v1beta.ListConversationsResponse = (function() { - - /** - * Properties of a ListConversationsResponse. - * @memberof google.cloud.ces.v1beta - * @interface IListConversationsResponse - * @property {Array.|null} [conversations] ListConversationsResponse conversations - * @property {string|null} [nextPageToken] ListConversationsResponse nextPageToken - */ - - /** - * Constructs a new ListConversationsResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListConversationsResponse. - * @implements IListConversationsResponse - * @constructor - * @param {google.cloud.ces.v1beta.IListConversationsResponse=} [properties] Properties to set - */ - function ListConversationsResponse(properties) { - this.conversations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListConversationsResponse conversations. - * @member {Array.} conversations - * @memberof google.cloud.ces.v1beta.ListConversationsResponse - * @instance - */ - ListConversationsResponse.prototype.conversations = $util.emptyArray; - - /** - * ListConversationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1beta.ListConversationsResponse - * @instance - */ - ListConversationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListConversationsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListConversationsResponse - * @static - * @param {google.cloud.ces.v1beta.IListConversationsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListConversationsResponse} ListConversationsResponse instance - */ - ListConversationsResponse.create = function create(properties) { - return new ListConversationsResponse(properties); - }; - - /** - * Encodes the specified ListConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListConversationsResponse - * @static - * @param {google.cloud.ces.v1beta.IListConversationsResponse} message ListConversationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListConversationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.conversations != null && message.conversations.length) - for (var i = 0; i < message.conversations.length; ++i) - $root.google.cloud.ces.v1beta.Conversation.encode(message.conversations[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 ListConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListConversationsResponse - * @static - * @param {google.cloud.ces.v1beta.IListConversationsResponse} message ListConversationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListConversationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListConversationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListConversationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListConversationsResponse} ListConversationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListConversationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListConversationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.conversations && message.conversations.length)) - message.conversations = []; - message.conversations.push($root.google.cloud.ces.v1beta.Conversation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListConversationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListConversationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListConversationsResponse} ListConversationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListConversationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListConversationsResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListConversationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListConversationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.conversations != null && message.hasOwnProperty("conversations")) { - if (!Array.isArray(message.conversations)) - return "conversations: array expected"; - for (var i = 0; i < message.conversations.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Conversation.verify(message.conversations[i]); - if (error) - return "conversations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListConversationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListConversationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListConversationsResponse} ListConversationsResponse - */ - ListConversationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListConversationsResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ListConversationsResponse(); - if (object.conversations) { - if (!Array.isArray(object.conversations)) - throw TypeError(".google.cloud.ces.v1beta.ListConversationsResponse.conversations: array expected"); - message.conversations = []; - for (var i = 0; i < object.conversations.length; ++i) { - if (typeof object.conversations[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ListConversationsResponse.conversations: object expected"); - message.conversations[i] = $root.google.cloud.ces.v1beta.Conversation.fromObject(object.conversations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListConversationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListConversationsResponse - * @static - * @param {google.cloud.ces.v1beta.ListConversationsResponse} message ListConversationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListConversationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.conversations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.conversations && message.conversations.length) { - object.conversations = []; - for (var j = 0; j < message.conversations.length; ++j) - object.conversations[j] = $root.google.cloud.ces.v1beta.Conversation.toObject(message.conversations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListConversationsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListConversationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListConversationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListConversationsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListConversationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListConversationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListConversationsResponse"; - }; - - return ListConversationsResponse; - })(); - - v1beta.GetConversationRequest = (function() { - - /** - * Properties of a GetConversationRequest. - * @memberof google.cloud.ces.v1beta - * @interface IGetConversationRequest - * @property {string|null} [name] GetConversationRequest name - * @property {google.cloud.ces.v1beta.Conversation.Source|null} [source] GetConversationRequest source - */ - - /** - * Constructs a new GetConversationRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GetConversationRequest. - * @implements IGetConversationRequest - * @constructor - * @param {google.cloud.ces.v1beta.IGetConversationRequest=} [properties] Properties to set - */ - function GetConversationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetConversationRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.GetConversationRequest - * @instance - */ - GetConversationRequest.prototype.name = ""; - - /** - * GetConversationRequest source. - * @member {google.cloud.ces.v1beta.Conversation.Source} source - * @memberof google.cloud.ces.v1beta.GetConversationRequest - * @instance - */ - GetConversationRequest.prototype.source = 0; - - /** - * Creates a new GetConversationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GetConversationRequest - * @static - * @param {google.cloud.ces.v1beta.IGetConversationRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GetConversationRequest} GetConversationRequest instance - */ - GetConversationRequest.create = function create(properties) { - return new GetConversationRequest(properties); - }; - - /** - * Encodes the specified GetConversationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetConversationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GetConversationRequest - * @static - * @param {google.cloud.ces.v1beta.IGetConversationRequest} message GetConversationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConversationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.source != null && Object.hasOwnProperty.call(message, "source")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.source); - return writer; - }; - - /** - * Encodes the specified GetConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetConversationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GetConversationRequest - * @static - * @param {google.cloud.ces.v1beta.IGetConversationRequest} message GetConversationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConversationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetConversationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GetConversationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GetConversationRequest} GetConversationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConversationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetConversationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.source = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetConversationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GetConversationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GetConversationRequest} GetConversationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConversationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetConversationRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.GetConversationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetConversationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.source != null && message.hasOwnProperty("source")) - switch (message.source) { - default: - return "source: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a GetConversationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GetConversationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GetConversationRequest} GetConversationRequest - */ - GetConversationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GetConversationRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.GetConversationRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.source) { - default: - if (typeof object.source === "number") { - message.source = object.source; - break; - } - break; - case "SOURCE_UNSPECIFIED": - case 0: - message.source = 0; - break; - case "LIVE": - case 1: - message.source = 1; - break; - case "SIMULATOR": - case 2: - message.source = 2; - break; - case "EVAL": - case 3: - message.source = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a GetConversationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GetConversationRequest - * @static - * @param {google.cloud.ces.v1beta.GetConversationRequest} message GetConversationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetConversationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.source != null && message.hasOwnProperty("source")) - object.source = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1beta.Conversation.Source[message.source] : message.source; - return object; - }; - - /** - * Converts this GetConversationRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GetConversationRequest - * @instance - * @returns {Object.} JSON object - */ - GetConversationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetConversationRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GetConversationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetConversationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GetConversationRequest"; - }; - - return GetConversationRequest; - })(); - - v1beta.DeleteConversationRequest = (function() { - - /** - * Properties of a DeleteConversationRequest. - * @memberof google.cloud.ces.v1beta - * @interface IDeleteConversationRequest - * @property {string|null} [name] DeleteConversationRequest name - * @property {google.cloud.ces.v1beta.Conversation.Source|null} [source] DeleteConversationRequest source - */ - - /** - * Constructs a new DeleteConversationRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DeleteConversationRequest. - * @implements IDeleteConversationRequest - * @constructor - * @param {google.cloud.ces.v1beta.IDeleteConversationRequest=} [properties] Properties to set - */ - function DeleteConversationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteConversationRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.DeleteConversationRequest - * @instance - */ - DeleteConversationRequest.prototype.name = ""; - - /** - * DeleteConversationRequest source. - * @member {google.cloud.ces.v1beta.Conversation.Source} source - * @memberof google.cloud.ces.v1beta.DeleteConversationRequest - * @instance - */ - DeleteConversationRequest.prototype.source = 0; - - /** - * Creates a new DeleteConversationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DeleteConversationRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteConversationRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DeleteConversationRequest} DeleteConversationRequest instance - */ - DeleteConversationRequest.create = function create(properties) { - return new DeleteConversationRequest(properties); - }; - - /** - * Encodes the specified DeleteConversationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteConversationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DeleteConversationRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteConversationRequest} message DeleteConversationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteConversationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.source != null && Object.hasOwnProperty.call(message, "source")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.source); - return writer; - }; - - /** - * Encodes the specified DeleteConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteConversationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteConversationRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteConversationRequest} message DeleteConversationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteConversationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteConversationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DeleteConversationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DeleteConversationRequest} DeleteConversationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteConversationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteConversationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.source = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteConversationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteConversationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DeleteConversationRequest} DeleteConversationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteConversationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteConversationRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.DeleteConversationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteConversationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.source != null && message.hasOwnProperty("source")) - switch (message.source) { - default: - return "source: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a DeleteConversationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DeleteConversationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DeleteConversationRequest} DeleteConversationRequest - */ - DeleteConversationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DeleteConversationRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.DeleteConversationRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.source) { - default: - if (typeof object.source === "number") { - message.source = object.source; - break; - } - break; - case "SOURCE_UNSPECIFIED": - case 0: - message.source = 0; - break; - case "LIVE": - case 1: - message.source = 1; - break; - case "SIMULATOR": - case 2: - message.source = 2; - break; - case "EVAL": - case 3: - message.source = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a DeleteConversationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DeleteConversationRequest - * @static - * @param {google.cloud.ces.v1beta.DeleteConversationRequest} message DeleteConversationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteConversationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.source != null && message.hasOwnProperty("source")) - object.source = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1beta.Conversation.Source[message.source] : message.source; - return object; - }; - - /** - * Converts this DeleteConversationRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DeleteConversationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteConversationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteConversationRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DeleteConversationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteConversationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteConversationRequest"; - }; - - return DeleteConversationRequest; - })(); - - v1beta.BatchDeleteConversationsRequest = (function() { - - /** - * Properties of a BatchDeleteConversationsRequest. - * @memberof google.cloud.ces.v1beta - * @interface IBatchDeleteConversationsRequest - * @property {string|null} [parent] BatchDeleteConversationsRequest parent - * @property {Array.|null} [conversations] BatchDeleteConversationsRequest conversations - */ - - /** - * Constructs a new BatchDeleteConversationsRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a BatchDeleteConversationsRequest. - * @implements IBatchDeleteConversationsRequest - * @constructor - * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsRequest=} [properties] Properties to set - */ - function BatchDeleteConversationsRequest(properties) { - this.conversations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchDeleteConversationsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest - * @instance - */ - BatchDeleteConversationsRequest.prototype.parent = ""; - - /** - * BatchDeleteConversationsRequest conversations. - * @member {Array.} conversations - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest - * @instance - */ - BatchDeleteConversationsRequest.prototype.conversations = $util.emptyArray; - - /** - * Creates a new BatchDeleteConversationsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest - * @static - * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest instance - */ - BatchDeleteConversationsRequest.create = function create(properties) { - return new BatchDeleteConversationsRequest(properties); - }; - - /** - * Encodes the specified BatchDeleteConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest - * @static - * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsRequest} message BatchDeleteConversationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteConversationsRequest.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.conversations != null && message.conversations.length) - for (var i = 0; i < message.conversations.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.conversations[i]); - return writer; - }; - - /** - * Encodes the specified BatchDeleteConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest - * @static - * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsRequest} message BatchDeleteConversationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteConversationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteConversationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BatchDeleteConversationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - if (!(message.conversations && message.conversations.length)) - message.conversations = []; - message.conversations.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteConversationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchDeleteConversationsRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchDeleteConversationsRequest.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.conversations != null && message.hasOwnProperty("conversations")) { - if (!Array.isArray(message.conversations)) - return "conversations: array expected"; - for (var i = 0; i < message.conversations.length; ++i) - if (!$util.isString(message.conversations[i])) - return "conversations: string[] expected"; - } - return null; - }; - - /** - * Creates a BatchDeleteConversationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest - */ - BatchDeleteConversationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.BatchDeleteConversationsRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.BatchDeleteConversationsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.conversations) { - if (!Array.isArray(object.conversations)) - throw TypeError(".google.cloud.ces.v1beta.BatchDeleteConversationsRequest.conversations: array expected"); - message.conversations = []; - for (var i = 0; i < object.conversations.length; ++i) - message.conversations[i] = String(object.conversations[i]); - } - return message; - }; - - /** - * Creates a plain object from a BatchDeleteConversationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest - * @static - * @param {google.cloud.ces.v1beta.BatchDeleteConversationsRequest} message BatchDeleteConversationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchDeleteConversationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.conversations = []; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.conversations && message.conversations.length) { - object.conversations = []; - for (var j = 0; j < message.conversations.length; ++j) - object.conversations[j] = message.conversations[j]; - } - return object; - }; - - /** - * Converts this BatchDeleteConversationsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest - * @instance - * @returns {Object.} JSON object - */ - BatchDeleteConversationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchDeleteConversationsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchDeleteConversationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.BatchDeleteConversationsRequest"; - }; - - return BatchDeleteConversationsRequest; - })(); - - v1beta.BatchDeleteConversationsResponse = (function() { - - /** - * Properties of a BatchDeleteConversationsResponse. - * @memberof google.cloud.ces.v1beta - * @interface IBatchDeleteConversationsResponse - * @property {Array.|null} [deletedConversations] BatchDeleteConversationsResponse deletedConversations - * @property {Array.|null} [failedConversations] BatchDeleteConversationsResponse failedConversations - * @property {Array.|null} [errorMessages] BatchDeleteConversationsResponse errorMessages - */ - - /** - * Constructs a new BatchDeleteConversationsResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a BatchDeleteConversationsResponse. - * @implements IBatchDeleteConversationsResponse - * @constructor - * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsResponse=} [properties] Properties to set - */ - function BatchDeleteConversationsResponse(properties) { - this.deletedConversations = []; - this.failedConversations = []; - this.errorMessages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchDeleteConversationsResponse deletedConversations. - * @member {Array.} deletedConversations - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse - * @instance - */ - BatchDeleteConversationsResponse.prototype.deletedConversations = $util.emptyArray; - - /** - * BatchDeleteConversationsResponse failedConversations. - * @member {Array.} failedConversations - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse - * @instance - */ - BatchDeleteConversationsResponse.prototype.failedConversations = $util.emptyArray; - - /** - * BatchDeleteConversationsResponse errorMessages. - * @member {Array.} errorMessages - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse - * @instance - */ - BatchDeleteConversationsResponse.prototype.errorMessages = $util.emptyArray; - - /** - * Creates a new BatchDeleteConversationsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse - * @static - * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse instance - */ - BatchDeleteConversationsResponse.create = function create(properties) { - return new BatchDeleteConversationsResponse(properties); - }; - - /** - * Encodes the specified BatchDeleteConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse - * @static - * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsResponse} message BatchDeleteConversationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteConversationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deletedConversations != null && message.deletedConversations.length) - for (var i = 0; i < message.deletedConversations.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.deletedConversations[i]); - if (message.failedConversations != null && message.failedConversations.length) - for (var i = 0; i < message.failedConversations.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.failedConversations[i]); - if (message.errorMessages != null && message.errorMessages.length) - for (var i = 0; i < message.errorMessages.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorMessages[i]); - return writer; - }; - - /** - * Encodes the specified BatchDeleteConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse - * @static - * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsResponse} message BatchDeleteConversationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteConversationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteConversationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BatchDeleteConversationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.deletedConversations && message.deletedConversations.length)) - message.deletedConversations = []; - message.deletedConversations.push(reader.string()); - break; - } - case 2: { - if (!(message.failedConversations && message.failedConversations.length)) - message.failedConversations = []; - message.failedConversations.push(reader.string()); - break; - } - case 3: { - if (!(message.errorMessages && message.errorMessages.length)) - message.errorMessages = []; - message.errorMessages.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteConversationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchDeleteConversationsResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchDeleteConversationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deletedConversations != null && message.hasOwnProperty("deletedConversations")) { - if (!Array.isArray(message.deletedConversations)) - return "deletedConversations: array expected"; - for (var i = 0; i < message.deletedConversations.length; ++i) - if (!$util.isString(message.deletedConversations[i])) - return "deletedConversations: string[] expected"; - } - if (message.failedConversations != null && message.hasOwnProperty("failedConversations")) { - if (!Array.isArray(message.failedConversations)) - return "failedConversations: array expected"; - for (var i = 0; i < message.failedConversations.length; ++i) - if (!$util.isString(message.failedConversations[i])) - return "failedConversations: string[] expected"; - } - if (message.errorMessages != null && message.hasOwnProperty("errorMessages")) { - if (!Array.isArray(message.errorMessages)) - return "errorMessages: array expected"; - for (var i = 0; i < message.errorMessages.length; ++i) - if (!$util.isString(message.errorMessages[i])) - return "errorMessages: string[] expected"; - } - return null; - }; - - /** - * Creates a BatchDeleteConversationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse - */ - BatchDeleteConversationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.BatchDeleteConversationsResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.BatchDeleteConversationsResponse(); - if (object.deletedConversations) { - if (!Array.isArray(object.deletedConversations)) - throw TypeError(".google.cloud.ces.v1beta.BatchDeleteConversationsResponse.deletedConversations: array expected"); - message.deletedConversations = []; - for (var i = 0; i < object.deletedConversations.length; ++i) - message.deletedConversations[i] = String(object.deletedConversations[i]); - } - if (object.failedConversations) { - if (!Array.isArray(object.failedConversations)) - throw TypeError(".google.cloud.ces.v1beta.BatchDeleteConversationsResponse.failedConversations: array expected"); - message.failedConversations = []; - for (var i = 0; i < object.failedConversations.length; ++i) - message.failedConversations[i] = String(object.failedConversations[i]); - } - if (object.errorMessages) { - if (!Array.isArray(object.errorMessages)) - throw TypeError(".google.cloud.ces.v1beta.BatchDeleteConversationsResponse.errorMessages: array expected"); - message.errorMessages = []; - for (var i = 0; i < object.errorMessages.length; ++i) - message.errorMessages[i] = String(object.errorMessages[i]); - } - return message; - }; - - /** - * Creates a plain object from a BatchDeleteConversationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse - * @static - * @param {google.cloud.ces.v1beta.BatchDeleteConversationsResponse} message BatchDeleteConversationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchDeleteConversationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.deletedConversations = []; - object.failedConversations = []; - object.errorMessages = []; - } - if (message.deletedConversations && message.deletedConversations.length) { - object.deletedConversations = []; - for (var j = 0; j < message.deletedConversations.length; ++j) - object.deletedConversations[j] = message.deletedConversations[j]; - } - if (message.failedConversations && message.failedConversations.length) { - object.failedConversations = []; - for (var j = 0; j < message.failedConversations.length; ++j) - object.failedConversations[j] = message.failedConversations[j]; - } - if (message.errorMessages && message.errorMessages.length) { - object.errorMessages = []; - for (var j = 0; j < message.errorMessages.length; ++j) - object.errorMessages[j] = message.errorMessages[j]; - } - return object; - }; - - /** - * Converts this BatchDeleteConversationsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse - * @instance - * @returns {Object.} JSON object - */ - BatchDeleteConversationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchDeleteConversationsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchDeleteConversationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.BatchDeleteConversationsResponse"; - }; - - return BatchDeleteConversationsResponse; - })(); - - v1beta.ListGuardrailsRequest = (function() { - - /** - * Properties of a ListGuardrailsRequest. - * @memberof google.cloud.ces.v1beta - * @interface IListGuardrailsRequest - * @property {string|null} [parent] ListGuardrailsRequest parent - * @property {number|null} [pageSize] ListGuardrailsRequest pageSize - * @property {string|null} [pageToken] ListGuardrailsRequest pageToken - * @property {string|null} [filter] ListGuardrailsRequest filter - * @property {string|null} [orderBy] ListGuardrailsRequest orderBy - */ - - /** - * Constructs a new ListGuardrailsRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListGuardrailsRequest. - * @implements IListGuardrailsRequest - * @constructor - * @param {google.cloud.ces.v1beta.IListGuardrailsRequest=} [properties] Properties to set - */ - function ListGuardrailsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListGuardrailsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest - * @instance - */ - ListGuardrailsRequest.prototype.parent = ""; - - /** - * ListGuardrailsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest - * @instance - */ - ListGuardrailsRequest.prototype.pageSize = 0; - - /** - * ListGuardrailsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest - * @instance - */ - ListGuardrailsRequest.prototype.pageToken = ""; - - /** - * ListGuardrailsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest - * @instance - */ - ListGuardrailsRequest.prototype.filter = ""; - - /** - * ListGuardrailsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest - * @instance - */ - ListGuardrailsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListGuardrailsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest - * @static - * @param {google.cloud.ces.v1beta.IListGuardrailsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListGuardrailsRequest} ListGuardrailsRequest instance - */ - ListGuardrailsRequest.create = function create(properties) { - return new ListGuardrailsRequest(properties); - }; - - /** - * Encodes the specified ListGuardrailsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest - * @static - * @param {google.cloud.ces.v1beta.IListGuardrailsRequest} message ListGuardrailsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListGuardrailsRequest.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 ListGuardrailsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest - * @static - * @param {google.cloud.ces.v1beta.IListGuardrailsRequest} message ListGuardrailsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListGuardrailsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListGuardrailsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListGuardrailsRequest} ListGuardrailsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListGuardrailsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListGuardrailsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListGuardrailsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListGuardrailsRequest} ListGuardrailsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListGuardrailsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListGuardrailsRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListGuardrailsRequest.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 ListGuardrailsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListGuardrailsRequest} ListGuardrailsRequest - */ - ListGuardrailsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListGuardrailsRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ListGuardrailsRequest(); - 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 ListGuardrailsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest - * @static - * @param {google.cloud.ces.v1beta.ListGuardrailsRequest} message ListGuardrailsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListGuardrailsRequest.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 ListGuardrailsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest - * @instance - * @returns {Object.} JSON object - */ - ListGuardrailsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListGuardrailsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListGuardrailsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListGuardrailsRequest"; - }; - - return ListGuardrailsRequest; - })(); - - v1beta.ListGuardrailsResponse = (function() { - - /** - * Properties of a ListGuardrailsResponse. - * @memberof google.cloud.ces.v1beta - * @interface IListGuardrailsResponse - * @property {Array.|null} [guardrails] ListGuardrailsResponse guardrails - * @property {string|null} [nextPageToken] ListGuardrailsResponse nextPageToken - */ - - /** - * Constructs a new ListGuardrailsResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListGuardrailsResponse. - * @implements IListGuardrailsResponse - * @constructor - * @param {google.cloud.ces.v1beta.IListGuardrailsResponse=} [properties] Properties to set - */ - function ListGuardrailsResponse(properties) { - this.guardrails = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListGuardrailsResponse guardrails. - * @member {Array.} guardrails - * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse - * @instance - */ - ListGuardrailsResponse.prototype.guardrails = $util.emptyArray; - - /** - * ListGuardrailsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse - * @instance - */ - ListGuardrailsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListGuardrailsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse - * @static - * @param {google.cloud.ces.v1beta.IListGuardrailsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListGuardrailsResponse} ListGuardrailsResponse instance - */ - ListGuardrailsResponse.create = function create(properties) { - return new ListGuardrailsResponse(properties); - }; - - /** - * Encodes the specified ListGuardrailsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse - * @static - * @param {google.cloud.ces.v1beta.IListGuardrailsResponse} message ListGuardrailsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListGuardrailsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.guardrails != null && message.guardrails.length) - for (var i = 0; i < message.guardrails.length; ++i) - $root.google.cloud.ces.v1beta.Guardrail.encode(message.guardrails[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 ListGuardrailsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse - * @static - * @param {google.cloud.ces.v1beta.IListGuardrailsResponse} message ListGuardrailsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListGuardrailsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListGuardrailsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListGuardrailsResponse} ListGuardrailsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListGuardrailsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListGuardrailsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.guardrails && message.guardrails.length)) - message.guardrails = []; - message.guardrails.push($root.google.cloud.ces.v1beta.Guardrail.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListGuardrailsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListGuardrailsResponse} ListGuardrailsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListGuardrailsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListGuardrailsResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListGuardrailsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.guardrails != null && message.hasOwnProperty("guardrails")) { - if (!Array.isArray(message.guardrails)) - return "guardrails: array expected"; - for (var i = 0; i < message.guardrails.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Guardrail.verify(message.guardrails[i]); - if (error) - return "guardrails." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListGuardrailsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListGuardrailsResponse} ListGuardrailsResponse - */ - ListGuardrailsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListGuardrailsResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ListGuardrailsResponse(); - if (object.guardrails) { - if (!Array.isArray(object.guardrails)) - throw TypeError(".google.cloud.ces.v1beta.ListGuardrailsResponse.guardrails: array expected"); - message.guardrails = []; - for (var i = 0; i < object.guardrails.length; ++i) { - if (typeof object.guardrails[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ListGuardrailsResponse.guardrails: object expected"); - message.guardrails[i] = $root.google.cloud.ces.v1beta.Guardrail.fromObject(object.guardrails[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListGuardrailsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse - * @static - * @param {google.cloud.ces.v1beta.ListGuardrailsResponse} message ListGuardrailsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListGuardrailsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.guardrails = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.guardrails && message.guardrails.length) { - object.guardrails = []; - for (var j = 0; j < message.guardrails.length; ++j) - object.guardrails[j] = $root.google.cloud.ces.v1beta.Guardrail.toObject(message.guardrails[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListGuardrailsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse - * @instance - * @returns {Object.} JSON object - */ - ListGuardrailsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListGuardrailsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListGuardrailsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListGuardrailsResponse"; - }; - - return ListGuardrailsResponse; - })(); - - v1beta.GetGuardrailRequest = (function() { - - /** - * Properties of a GetGuardrailRequest. - * @memberof google.cloud.ces.v1beta - * @interface IGetGuardrailRequest - * @property {string|null} [name] GetGuardrailRequest name - */ - - /** - * Constructs a new GetGuardrailRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GetGuardrailRequest. - * @implements IGetGuardrailRequest - * @constructor - * @param {google.cloud.ces.v1beta.IGetGuardrailRequest=} [properties] Properties to set - */ - function GetGuardrailRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGuardrailRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.GetGuardrailRequest - * @instance - */ - GetGuardrailRequest.prototype.name = ""; - - /** - * Creates a new GetGuardrailRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GetGuardrailRequest - * @static - * @param {google.cloud.ces.v1beta.IGetGuardrailRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GetGuardrailRequest} GetGuardrailRequest instance - */ - GetGuardrailRequest.create = function create(properties) { - return new GetGuardrailRequest(properties); - }; - - /** - * Encodes the specified GetGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetGuardrailRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GetGuardrailRequest - * @static - * @param {google.cloud.ces.v1beta.IGetGuardrailRequest} message GetGuardrailRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGuardrailRequest.encode = function encode(message, writer) { - 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 GetGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetGuardrailRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GetGuardrailRequest - * @static - * @param {google.cloud.ces.v1beta.IGetGuardrailRequest} message GetGuardrailRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGuardrailRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GetGuardrailRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GetGuardrailRequest} GetGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGuardrailRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetGuardrailRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGuardrailRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GetGuardrailRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GetGuardrailRequest} GetGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGuardrailRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.GetGuardrailRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGuardrailRequest.verify = function verify(message) { - if (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 GetGuardrailRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GetGuardrailRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GetGuardrailRequest} GetGuardrailRequest - */ - GetGuardrailRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GetGuardrailRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.GetGuardrailRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetGuardrailRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GetGuardrailRequest - * @static - * @param {google.cloud.ces.v1beta.GetGuardrailRequest} message GetGuardrailRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGuardrailRequest.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 GetGuardrailRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GetGuardrailRequest - * @instance - * @returns {Object.} JSON object - */ - GetGuardrailRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetGuardrailRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GetGuardrailRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GetGuardrailRequest"; - }; - - return GetGuardrailRequest; - })(); - - v1beta.CreateGuardrailRequest = (function() { - - /** - * Properties of a CreateGuardrailRequest. - * @memberof google.cloud.ces.v1beta - * @interface ICreateGuardrailRequest - * @property {string|null} [parent] CreateGuardrailRequest parent - * @property {string|null} [guardrailId] CreateGuardrailRequest guardrailId - * @property {google.cloud.ces.v1beta.IGuardrail|null} [guardrail] CreateGuardrailRequest guardrail - */ - - /** - * Constructs a new CreateGuardrailRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a CreateGuardrailRequest. - * @implements ICreateGuardrailRequest - * @constructor - * @param {google.cloud.ces.v1beta.ICreateGuardrailRequest=} [properties] Properties to set - */ - function CreateGuardrailRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateGuardrailRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest - * @instance - */ - CreateGuardrailRequest.prototype.parent = ""; - - /** - * CreateGuardrailRequest guardrailId. - * @member {string} guardrailId - * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest - * @instance - */ - CreateGuardrailRequest.prototype.guardrailId = ""; - - /** - * CreateGuardrailRequest guardrail. - * @member {google.cloud.ces.v1beta.IGuardrail|null|undefined} guardrail - * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest - * @instance - */ - CreateGuardrailRequest.prototype.guardrail = null; - - /** - * Creates a new CreateGuardrailRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateGuardrailRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.CreateGuardrailRequest} CreateGuardrailRequest instance - */ - CreateGuardrailRequest.create = function create(properties) { - return new CreateGuardrailRequest(properties); - }; - - /** - * Encodes the specified CreateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateGuardrailRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateGuardrailRequest} message CreateGuardrailRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateGuardrailRequest.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.guardrailId != null && Object.hasOwnProperty.call(message, "guardrailId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.guardrailId); - if (message.guardrail != null && Object.hasOwnProperty.call(message, "guardrail")) - $root.google.cloud.ces.v1beta.Guardrail.encode(message.guardrail, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateGuardrailRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateGuardrailRequest} message CreateGuardrailRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateGuardrailRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.CreateGuardrailRequest} CreateGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateGuardrailRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateGuardrailRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.guardrailId = reader.string(); - break; - } - case 3: { - message.guardrail = $root.google.cloud.ces.v1beta.Guardrail.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateGuardrailRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.CreateGuardrailRequest} CreateGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateGuardrailRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateGuardrailRequest.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.guardrailId != null && message.hasOwnProperty("guardrailId")) - if (!$util.isString(message.guardrailId)) - return "guardrailId: string expected"; - if (message.guardrail != null && message.hasOwnProperty("guardrail")) { - var error = $root.google.cloud.ces.v1beta.Guardrail.verify(message.guardrail); - if (error) - return "guardrail." + error; - } - return null; - }; - - /** - * Creates a CreateGuardrailRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.CreateGuardrailRequest} CreateGuardrailRequest - */ - CreateGuardrailRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.CreateGuardrailRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.CreateGuardrailRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.guardrailId != null) - message.guardrailId = String(object.guardrailId); - if (object.guardrail != null) { - if (typeof object.guardrail !== "object") - throw TypeError(".google.cloud.ces.v1beta.CreateGuardrailRequest.guardrail: object expected"); - message.guardrail = $root.google.cloud.ces.v1beta.Guardrail.fromObject(object.guardrail); - } - return message; - }; - - /** - * Creates a plain object from a CreateGuardrailRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest - * @static - * @param {google.cloud.ces.v1beta.CreateGuardrailRequest} message CreateGuardrailRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateGuardrailRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.guardrailId = ""; - object.guardrail = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.guardrailId != null && message.hasOwnProperty("guardrailId")) - object.guardrailId = message.guardrailId; - if (message.guardrail != null && message.hasOwnProperty("guardrail")) - object.guardrail = $root.google.cloud.ces.v1beta.Guardrail.toObject(message.guardrail, options); - return object; - }; - - /** - * Converts this CreateGuardrailRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest - * @instance - * @returns {Object.} JSON object - */ - CreateGuardrailRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateGuardrailRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateGuardrailRequest"; - }; - - return CreateGuardrailRequest; - })(); - - v1beta.UpdateGuardrailRequest = (function() { - - /** - * Properties of an UpdateGuardrailRequest. - * @memberof google.cloud.ces.v1beta - * @interface IUpdateGuardrailRequest - * @property {google.cloud.ces.v1beta.IGuardrail|null} [guardrail] UpdateGuardrailRequest guardrail - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGuardrailRequest updateMask - */ - - /** - * Constructs a new UpdateGuardrailRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an UpdateGuardrailRequest. - * @implements IUpdateGuardrailRequest - * @constructor - * @param {google.cloud.ces.v1beta.IUpdateGuardrailRequest=} [properties] Properties to set - */ - function UpdateGuardrailRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateGuardrailRequest guardrail. - * @member {google.cloud.ces.v1beta.IGuardrail|null|undefined} guardrail - * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest - * @instance - */ - UpdateGuardrailRequest.prototype.guardrail = null; - - /** - * UpdateGuardrailRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest - * @instance - */ - UpdateGuardrailRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateGuardrailRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateGuardrailRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.UpdateGuardrailRequest} UpdateGuardrailRequest instance - */ - UpdateGuardrailRequest.create = function create(properties) { - return new UpdateGuardrailRequest(properties); - }; - - /** - * Encodes the specified UpdateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateGuardrailRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateGuardrailRequest} message UpdateGuardrailRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateGuardrailRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.guardrail != null && Object.hasOwnProperty.call(message, "guardrail")) - $root.google.cloud.ces.v1beta.Guardrail.encode(message.guardrail, 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 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateGuardrailRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateGuardrailRequest} message UpdateGuardrailRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateGuardrailRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.UpdateGuardrailRequest} UpdateGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateGuardrailRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateGuardrailRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.guardrail = $root.google.cloud.ces.v1beta.Guardrail.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateGuardrailRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.UpdateGuardrailRequest} UpdateGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateGuardrailRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateGuardrailRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.guardrail != null && message.hasOwnProperty("guardrail")) { - var error = $root.google.cloud.ces.v1beta.Guardrail.verify(message.guardrail); - if (error) - return "guardrail." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateGuardrailRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.UpdateGuardrailRequest} UpdateGuardrailRequest - */ - UpdateGuardrailRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.UpdateGuardrailRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.UpdateGuardrailRequest(); - if (object.guardrail != null) { - if (typeof object.guardrail !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateGuardrailRequest.guardrail: object expected"); - message.guardrail = $root.google.cloud.ces.v1beta.Guardrail.fromObject(object.guardrail); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateGuardrailRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateGuardrailRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest - * @static - * @param {google.cloud.ces.v1beta.UpdateGuardrailRequest} message UpdateGuardrailRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateGuardrailRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.guardrail = null; - object.updateMask = null; - } - if (message.guardrail != null && message.hasOwnProperty("guardrail")) - object.guardrail = $root.google.cloud.ces.v1beta.Guardrail.toObject(message.guardrail, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateGuardrailRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateGuardrailRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateGuardrailRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateGuardrailRequest"; - }; - - return UpdateGuardrailRequest; - })(); - - v1beta.DeleteGuardrailRequest = (function() { - - /** - * Properties of a DeleteGuardrailRequest. - * @memberof google.cloud.ces.v1beta - * @interface IDeleteGuardrailRequest - * @property {string|null} [name] DeleteGuardrailRequest name - * @property {boolean|null} [force] DeleteGuardrailRequest force - * @property {string|null} [etag] DeleteGuardrailRequest etag - */ - - /** - * Constructs a new DeleteGuardrailRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DeleteGuardrailRequest. - * @implements IDeleteGuardrailRequest - * @constructor - * @param {google.cloud.ces.v1beta.IDeleteGuardrailRequest=} [properties] Properties to set - */ - function DeleteGuardrailRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteGuardrailRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest - * @instance - */ - DeleteGuardrailRequest.prototype.name = ""; - - /** - * DeleteGuardrailRequest force. - * @member {boolean} force - * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest - * @instance - */ - DeleteGuardrailRequest.prototype.force = false; - - /** - * DeleteGuardrailRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest - * @instance - */ - DeleteGuardrailRequest.prototype.etag = ""; - - /** - * Creates a new DeleteGuardrailRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteGuardrailRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DeleteGuardrailRequest} DeleteGuardrailRequest instance - */ - DeleteGuardrailRequest.create = function create(properties) { - return new DeleteGuardrailRequest(properties); - }; - - /** - * Encodes the specified DeleteGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteGuardrailRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteGuardrailRequest} message DeleteGuardrailRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteGuardrailRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteGuardrailRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteGuardrailRequest} message DeleteGuardrailRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteGuardrailRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DeleteGuardrailRequest} DeleteGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteGuardrailRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteGuardrailRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.force = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteGuardrailRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DeleteGuardrailRequest} DeleteGuardrailRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteGuardrailRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteGuardrailRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteGuardrailRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DeleteGuardrailRequest} DeleteGuardrailRequest - */ - DeleteGuardrailRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DeleteGuardrailRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.DeleteGuardrailRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.force != null) - message.force = Boolean(object.force); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteGuardrailRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest - * @static - * @param {google.cloud.ces.v1beta.DeleteGuardrailRequest} message DeleteGuardrailRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteGuardrailRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.force = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteGuardrailRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteGuardrailRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteGuardrailRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteGuardrailRequest"; - }; - - return DeleteGuardrailRequest; - })(); - - v1beta.ListDeploymentsRequest = (function() { - - /** - * Properties of a ListDeploymentsRequest. - * @memberof google.cloud.ces.v1beta - * @interface IListDeploymentsRequest - * @property {string|null} [parent] ListDeploymentsRequest parent - * @property {number|null} [pageSize] ListDeploymentsRequest pageSize - * @property {string|null} [pageToken] ListDeploymentsRequest pageToken - * @property {string|null} [orderBy] ListDeploymentsRequest orderBy - */ - - /** - * Constructs a new ListDeploymentsRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListDeploymentsRequest. - * @implements IListDeploymentsRequest - * @constructor - * @param {google.cloud.ces.v1beta.IListDeploymentsRequest=} [properties] Properties to set - */ - function ListDeploymentsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDeploymentsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest - * @instance - */ - ListDeploymentsRequest.prototype.parent = ""; - - /** - * ListDeploymentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest - * @instance - */ - ListDeploymentsRequest.prototype.pageSize = 0; - - /** - * ListDeploymentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest - * @instance - */ - ListDeploymentsRequest.prototype.pageToken = ""; - - /** - * ListDeploymentsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest - * @instance - */ - ListDeploymentsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListDeploymentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest - * @static - * @param {google.cloud.ces.v1beta.IListDeploymentsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListDeploymentsRequest} ListDeploymentsRequest instance - */ - ListDeploymentsRequest.create = function create(properties) { - return new ListDeploymentsRequest(properties); - }; - - /** - * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest - * @static - * @param {google.cloud.ces.v1beta.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDeploymentsRequest.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest - * @static - * @param {google.cloud.ces.v1beta.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDeploymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDeploymentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListDeploymentsRequest} ListDeploymentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDeploymentsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListDeploymentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListDeploymentsRequest} ListDeploymentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDeploymentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDeploymentsRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDeploymentsRequest.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.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; - - /** - * Creates a ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListDeploymentsRequest} ListDeploymentsRequest - */ - ListDeploymentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListDeploymentsRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ListDeploymentsRequest(); - 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.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListDeploymentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest - * @static - * @param {google.cloud.ces.v1beta.ListDeploymentsRequest} message ListDeploymentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDeploymentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - 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.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListDeploymentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest - * @instance - * @returns {Object.} JSON object - */ - ListDeploymentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDeploymentsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDeploymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListDeploymentsRequest"; - }; - - return ListDeploymentsRequest; - })(); - - v1beta.ListDeploymentsResponse = (function() { - - /** - * Properties of a ListDeploymentsResponse. - * @memberof google.cloud.ces.v1beta - * @interface IListDeploymentsResponse - * @property {Array.|null} [deployments] ListDeploymentsResponse deployments - * @property {string|null} [nextPageToken] ListDeploymentsResponse nextPageToken - */ - - /** - * Constructs a new ListDeploymentsResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListDeploymentsResponse. - * @implements IListDeploymentsResponse - * @constructor - * @param {google.cloud.ces.v1beta.IListDeploymentsResponse=} [properties] Properties to set - */ - function ListDeploymentsResponse(properties) { - this.deployments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDeploymentsResponse deployments. - * @member {Array.} deployments - * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse - * @instance - */ - ListDeploymentsResponse.prototype.deployments = $util.emptyArray; - - /** - * ListDeploymentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse - * @instance - */ - ListDeploymentsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListDeploymentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse - * @static - * @param {google.cloud.ces.v1beta.IListDeploymentsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListDeploymentsResponse} ListDeploymentsResponse instance - */ - ListDeploymentsResponse.create = function create(properties) { - return new ListDeploymentsResponse(properties); - }; - - /** - * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse - * @static - * @param {google.cloud.ces.v1beta.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDeploymentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deployments != null && message.deployments.length) - for (var i = 0; i < message.deployments.length; ++i) - $root.google.cloud.ces.v1beta.Deployment.encode(message.deployments[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 ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse - * @static - * @param {google.cloud.ces.v1beta.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDeploymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDeploymentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListDeploymentsResponse} ListDeploymentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDeploymentsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListDeploymentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.deployments && message.deployments.length)) - message.deployments = []; - message.deployments.push($root.google.cloud.ces.v1beta.Deployment.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListDeploymentsResponse} ListDeploymentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDeploymentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDeploymentsResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDeploymentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deployments != null && message.hasOwnProperty("deployments")) { - if (!Array.isArray(message.deployments)) - return "deployments: array expected"; - for (var i = 0; i < message.deployments.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Deployment.verify(message.deployments[i]); - if (error) - return "deployments." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListDeploymentsResponse} ListDeploymentsResponse - */ - ListDeploymentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListDeploymentsResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ListDeploymentsResponse(); - if (object.deployments) { - if (!Array.isArray(object.deployments)) - throw TypeError(".google.cloud.ces.v1beta.ListDeploymentsResponse.deployments: array expected"); - message.deployments = []; - for (var i = 0; i < object.deployments.length; ++i) { - if (typeof object.deployments[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ListDeploymentsResponse.deployments: object expected"); - message.deployments[i] = $root.google.cloud.ces.v1beta.Deployment.fromObject(object.deployments[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse - * @static - * @param {google.cloud.ces.v1beta.ListDeploymentsResponse} message ListDeploymentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDeploymentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.deployments = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.deployments && message.deployments.length) { - object.deployments = []; - for (var j = 0; j < message.deployments.length; ++j) - object.deployments[j] = $root.google.cloud.ces.v1beta.Deployment.toObject(message.deployments[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListDeploymentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse - * @instance - * @returns {Object.} JSON object - */ - ListDeploymentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDeploymentsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDeploymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListDeploymentsResponse"; - }; - - return ListDeploymentsResponse; - })(); - - v1beta.GetDeploymentRequest = (function() { - - /** - * Properties of a GetDeploymentRequest. - * @memberof google.cloud.ces.v1beta - * @interface IGetDeploymentRequest - * @property {string|null} [name] GetDeploymentRequest name - */ - - /** - * Constructs a new GetDeploymentRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GetDeploymentRequest. - * @implements IGetDeploymentRequest - * @constructor - * @param {google.cloud.ces.v1beta.IGetDeploymentRequest=} [properties] Properties to set - */ - function GetDeploymentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDeploymentRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.GetDeploymentRequest - * @instance - */ - GetDeploymentRequest.prototype.name = ""; - - /** - * Creates a new GetDeploymentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GetDeploymentRequest - * @static - * @param {google.cloud.ces.v1beta.IGetDeploymentRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GetDeploymentRequest} GetDeploymentRequest instance - */ - GetDeploymentRequest.create = function create(properties) { - return new GetDeploymentRequest(properties); - }; - - /** - * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetDeploymentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GetDeploymentRequest - * @static - * @param {google.cloud.ces.v1beta.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDeploymentRequest.encode = function encode(message, writer) { - 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 GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetDeploymentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GetDeploymentRequest - * @static - * @param {google.cloud.ces.v1beta.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDeploymentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GetDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GetDeploymentRequest} GetDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDeploymentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetDeploymentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDeploymentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GetDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GetDeploymentRequest} GetDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDeploymentRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.GetDeploymentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDeploymentRequest.verify = function verify(message) { - if (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 GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GetDeploymentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GetDeploymentRequest} GetDeploymentRequest - */ - GetDeploymentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GetDeploymentRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.GetDeploymentRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GetDeploymentRequest - * @static - * @param {google.cloud.ces.v1beta.GetDeploymentRequest} message GetDeploymentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDeploymentRequest.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 GetDeploymentRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GetDeploymentRequest - * @instance - * @returns {Object.} JSON object - */ - GetDeploymentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetDeploymentRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GetDeploymentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GetDeploymentRequest"; - }; - - return GetDeploymentRequest; - })(); - - v1beta.CreateDeploymentRequest = (function() { - - /** - * Properties of a CreateDeploymentRequest. - * @memberof google.cloud.ces.v1beta - * @interface ICreateDeploymentRequest - * @property {string|null} [parent] CreateDeploymentRequest parent - * @property {string|null} [deploymentId] CreateDeploymentRequest deploymentId - * @property {google.cloud.ces.v1beta.IDeployment|null} [deployment] CreateDeploymentRequest deployment - */ - - /** - * Constructs a new CreateDeploymentRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a CreateDeploymentRequest. - * @implements ICreateDeploymentRequest - * @constructor - * @param {google.cloud.ces.v1beta.ICreateDeploymentRequest=} [properties] Properties to set - */ - function CreateDeploymentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateDeploymentRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest - * @instance - */ - CreateDeploymentRequest.prototype.parent = ""; - - /** - * CreateDeploymentRequest deploymentId. - * @member {string} deploymentId - * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest - * @instance - */ - CreateDeploymentRequest.prototype.deploymentId = ""; - - /** - * CreateDeploymentRequest deployment. - * @member {google.cloud.ces.v1beta.IDeployment|null|undefined} deployment - * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest - * @instance - */ - CreateDeploymentRequest.prototype.deployment = null; - - /** - * Creates a new CreateDeploymentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateDeploymentRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.CreateDeploymentRequest} CreateDeploymentRequest instance - */ - CreateDeploymentRequest.create = function create(properties) { - return new CreateDeploymentRequest(properties); - }; - - /** - * Encodes the specified CreateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateDeploymentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateDeploymentRequest} message CreateDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDeploymentRequest.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.deployment != null && Object.hasOwnProperty.call(message, "deployment")) - $root.google.cloud.ces.v1beta.Deployment.encode(message.deployment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.deploymentId != null && Object.hasOwnProperty.call(message, "deploymentId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.deploymentId); - return writer; - }; - - /** - * Encodes the specified CreateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateDeploymentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateDeploymentRequest} message CreateDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateDeploymentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.CreateDeploymentRequest} CreateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDeploymentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateDeploymentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 3: { - message.deploymentId = reader.string(); - break; - } - case 2: { - message.deployment = $root.google.cloud.ces.v1beta.Deployment.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateDeploymentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.CreateDeploymentRequest} CreateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateDeploymentRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateDeploymentRequest.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.deploymentId != null && message.hasOwnProperty("deploymentId")) - if (!$util.isString(message.deploymentId)) - return "deploymentId: string expected"; - if (message.deployment != null && message.hasOwnProperty("deployment")) { - var error = $root.google.cloud.ces.v1beta.Deployment.verify(message.deployment); - if (error) - return "deployment." + error; - } - return null; - }; - - /** - * Creates a CreateDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.CreateDeploymentRequest} CreateDeploymentRequest - */ - CreateDeploymentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.CreateDeploymentRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.CreateDeploymentRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.deploymentId != null) - message.deploymentId = String(object.deploymentId); - if (object.deployment != null) { - if (typeof object.deployment !== "object") - throw TypeError(".google.cloud.ces.v1beta.CreateDeploymentRequest.deployment: object expected"); - message.deployment = $root.google.cloud.ces.v1beta.Deployment.fromObject(object.deployment); - } - return message; - }; - - /** - * Creates a plain object from a CreateDeploymentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest - * @static - * @param {google.cloud.ces.v1beta.CreateDeploymentRequest} message CreateDeploymentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateDeploymentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.deployment = null; - object.deploymentId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.deployment != null && message.hasOwnProperty("deployment")) - object.deployment = $root.google.cloud.ces.v1beta.Deployment.toObject(message.deployment, options); - if (message.deploymentId != null && message.hasOwnProperty("deploymentId")) - object.deploymentId = message.deploymentId; - return object; - }; - - /** - * Converts this CreateDeploymentRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest - * @instance - * @returns {Object.} JSON object - */ - CreateDeploymentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateDeploymentRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateDeploymentRequest"; - }; - - return CreateDeploymentRequest; - })(); - - v1beta.UpdateDeploymentRequest = (function() { - - /** - * Properties of an UpdateDeploymentRequest. - * @memberof google.cloud.ces.v1beta - * @interface IUpdateDeploymentRequest - * @property {google.cloud.ces.v1beta.IDeployment|null} [deployment] UpdateDeploymentRequest deployment - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDeploymentRequest updateMask - */ - - /** - * Constructs a new UpdateDeploymentRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an UpdateDeploymentRequest. - * @implements IUpdateDeploymentRequest - * @constructor - * @param {google.cloud.ces.v1beta.IUpdateDeploymentRequest=} [properties] Properties to set - */ - function UpdateDeploymentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateDeploymentRequest deployment. - * @member {google.cloud.ces.v1beta.IDeployment|null|undefined} deployment - * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest - * @instance - */ - UpdateDeploymentRequest.prototype.deployment = null; - - /** - * UpdateDeploymentRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest - * @instance - */ - UpdateDeploymentRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateDeploymentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateDeploymentRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.UpdateDeploymentRequest} UpdateDeploymentRequest instance - */ - UpdateDeploymentRequest.create = function create(properties) { - return new UpdateDeploymentRequest(properties); - }; - - /** - * Encodes the specified UpdateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateDeploymentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateDeploymentRequest} message UpdateDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDeploymentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) - $root.google.cloud.ces.v1beta.Deployment.encode(message.deployment, 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 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateDeploymentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateDeploymentRequest} message UpdateDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDeploymentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.UpdateDeploymentRequest} UpdateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDeploymentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateDeploymentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.deployment = $root.google.cloud.ces.v1beta.Deployment.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDeploymentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.UpdateDeploymentRequest} UpdateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDeploymentRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDeploymentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deployment != null && message.hasOwnProperty("deployment")) { - var error = $root.google.cloud.ces.v1beta.Deployment.verify(message.deployment); - if (error) - return "deployment." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.UpdateDeploymentRequest} UpdateDeploymentRequest - */ - UpdateDeploymentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.UpdateDeploymentRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.UpdateDeploymentRequest(); - if (object.deployment != null) { - if (typeof object.deployment !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateDeploymentRequest.deployment: object expected"); - message.deployment = $root.google.cloud.ces.v1beta.Deployment.fromObject(object.deployment); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateDeploymentRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateDeploymentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest - * @static - * @param {google.cloud.ces.v1beta.UpdateDeploymentRequest} message UpdateDeploymentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDeploymentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.deployment = null; - object.updateMask = null; - } - if (message.deployment != null && message.hasOwnProperty("deployment")) - object.deployment = $root.google.cloud.ces.v1beta.Deployment.toObject(message.deployment, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateDeploymentRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateDeploymentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDeploymentRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateDeploymentRequest"; - }; - - return UpdateDeploymentRequest; - })(); - - v1beta.DeleteDeploymentRequest = (function() { - - /** - * Properties of a DeleteDeploymentRequest. - * @memberof google.cloud.ces.v1beta - * @interface IDeleteDeploymentRequest - * @property {string|null} [name] DeleteDeploymentRequest name - * @property {string|null} [etag] DeleteDeploymentRequest etag - */ - - /** - * Constructs a new DeleteDeploymentRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DeleteDeploymentRequest. - * @implements IDeleteDeploymentRequest - * @constructor - * @param {google.cloud.ces.v1beta.IDeleteDeploymentRequest=} [properties] Properties to set - */ - function DeleteDeploymentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteDeploymentRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest - * @instance - */ - DeleteDeploymentRequest.prototype.name = ""; - - /** - * DeleteDeploymentRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest - * @instance - */ - DeleteDeploymentRequest.prototype.etag = ""; - - /** - * Creates a new DeleteDeploymentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteDeploymentRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DeleteDeploymentRequest} DeleteDeploymentRequest instance - */ - DeleteDeploymentRequest.create = function create(properties) { - return new DeleteDeploymentRequest(properties); - }; - - /** - * Encodes the specified DeleteDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteDeploymentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteDeploymentRequest} message DeleteDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteDeploymentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteDeploymentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteDeploymentRequest} message DeleteDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteDeploymentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DeleteDeploymentRequest} DeleteDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteDeploymentRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteDeploymentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteDeploymentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DeleteDeploymentRequest} DeleteDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteDeploymentRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteDeploymentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DeleteDeploymentRequest} DeleteDeploymentRequest - */ - DeleteDeploymentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DeleteDeploymentRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.DeleteDeploymentRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteDeploymentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest - * @static - * @param {google.cloud.ces.v1beta.DeleteDeploymentRequest} message DeleteDeploymentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteDeploymentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteDeploymentRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteDeploymentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteDeploymentRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteDeploymentRequest"; - }; - - return DeleteDeploymentRequest; - })(); - - v1beta.ListToolsetsRequest = (function() { - - /** - * Properties of a ListToolsetsRequest. - * @memberof google.cloud.ces.v1beta - * @interface IListToolsetsRequest - * @property {string|null} [parent] ListToolsetsRequest parent - * @property {number|null} [pageSize] ListToolsetsRequest pageSize - * @property {string|null} [pageToken] ListToolsetsRequest pageToken - * @property {string|null} [filter] ListToolsetsRequest filter - * @property {string|null} [orderBy] ListToolsetsRequest orderBy - */ - - /** - * Constructs a new ListToolsetsRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListToolsetsRequest. - * @implements IListToolsetsRequest - * @constructor - * @param {google.cloud.ces.v1beta.IListToolsetsRequest=} [properties] Properties to set - */ - function ListToolsetsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListToolsetsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ListToolsetsRequest - * @instance - */ - ListToolsetsRequest.prototype.parent = ""; - - /** - * ListToolsetsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1beta.ListToolsetsRequest - * @instance - */ - ListToolsetsRequest.prototype.pageSize = 0; - - /** - * ListToolsetsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1beta.ListToolsetsRequest - * @instance - */ - ListToolsetsRequest.prototype.pageToken = ""; - - /** - * ListToolsetsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1beta.ListToolsetsRequest - * @instance - */ - ListToolsetsRequest.prototype.filter = ""; - - /** - * ListToolsetsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1beta.ListToolsetsRequest - * @instance - */ - ListToolsetsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListToolsetsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListToolsetsRequest - * @static - * @param {google.cloud.ces.v1beta.IListToolsetsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListToolsetsRequest} ListToolsetsRequest instance - */ - ListToolsetsRequest.create = function create(properties) { - return new ListToolsetsRequest(properties); - }; - - /** - * Encodes the specified ListToolsetsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListToolsetsRequest - * @static - * @param {google.cloud.ces.v1beta.IListToolsetsRequest} message ListToolsetsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListToolsetsRequest.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 ListToolsetsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListToolsetsRequest - * @static - * @param {google.cloud.ces.v1beta.IListToolsetsRequest} message ListToolsetsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListToolsetsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListToolsetsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListToolsetsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListToolsetsRequest} ListToolsetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListToolsetsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListToolsetsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListToolsetsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListToolsetsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListToolsetsRequest} ListToolsetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListToolsetsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListToolsetsRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListToolsetsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListToolsetsRequest.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 ListToolsetsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListToolsetsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListToolsetsRequest} ListToolsetsRequest - */ - ListToolsetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListToolsetsRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ListToolsetsRequest(); - 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 ListToolsetsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListToolsetsRequest - * @static - * @param {google.cloud.ces.v1beta.ListToolsetsRequest} message ListToolsetsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListToolsetsRequest.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 ListToolsetsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListToolsetsRequest - * @instance - * @returns {Object.} JSON object - */ - ListToolsetsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListToolsetsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListToolsetsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListToolsetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListToolsetsRequest"; - }; - - return ListToolsetsRequest; - })(); - - v1beta.ListToolsetsResponse = (function() { - - /** - * Properties of a ListToolsetsResponse. - * @memberof google.cloud.ces.v1beta - * @interface IListToolsetsResponse - * @property {Array.|null} [toolsets] ListToolsetsResponse toolsets - * @property {string|null} [nextPageToken] ListToolsetsResponse nextPageToken - */ - - /** - * Constructs a new ListToolsetsResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListToolsetsResponse. - * @implements IListToolsetsResponse - * @constructor - * @param {google.cloud.ces.v1beta.IListToolsetsResponse=} [properties] Properties to set - */ - function ListToolsetsResponse(properties) { - this.toolsets = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListToolsetsResponse toolsets. - * @member {Array.} toolsets - * @memberof google.cloud.ces.v1beta.ListToolsetsResponse - * @instance - */ - ListToolsetsResponse.prototype.toolsets = $util.emptyArray; - - /** - * ListToolsetsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1beta.ListToolsetsResponse - * @instance - */ - ListToolsetsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListToolsetsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListToolsetsResponse - * @static - * @param {google.cloud.ces.v1beta.IListToolsetsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListToolsetsResponse} ListToolsetsResponse instance - */ - ListToolsetsResponse.create = function create(properties) { - return new ListToolsetsResponse(properties); - }; - - /** - * Encodes the specified ListToolsetsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListToolsetsResponse - * @static - * @param {google.cloud.ces.v1beta.IListToolsetsResponse} message ListToolsetsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListToolsetsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolsets != null && message.toolsets.length) - for (var i = 0; i < message.toolsets.length; ++i) - $root.google.cloud.ces.v1beta.Toolset.encode(message.toolsets[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 ListToolsetsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListToolsetsResponse - * @static - * @param {google.cloud.ces.v1beta.IListToolsetsResponse} message ListToolsetsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListToolsetsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListToolsetsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListToolsetsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListToolsetsResponse} ListToolsetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListToolsetsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListToolsetsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.toolsets && message.toolsets.length)) - message.toolsets = []; - message.toolsets.push($root.google.cloud.ces.v1beta.Toolset.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListToolsetsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListToolsetsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListToolsetsResponse} ListToolsetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListToolsetsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListToolsetsResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListToolsetsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListToolsetsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.toolsets != null && message.hasOwnProperty("toolsets")) { - if (!Array.isArray(message.toolsets)) - return "toolsets: array expected"; - for (var i = 0; i < message.toolsets.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Toolset.verify(message.toolsets[i]); - if (error) - return "toolsets." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListToolsetsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListToolsetsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListToolsetsResponse} ListToolsetsResponse - */ - ListToolsetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListToolsetsResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ListToolsetsResponse(); - if (object.toolsets) { - if (!Array.isArray(object.toolsets)) - throw TypeError(".google.cloud.ces.v1beta.ListToolsetsResponse.toolsets: array expected"); - message.toolsets = []; - for (var i = 0; i < object.toolsets.length; ++i) { - if (typeof object.toolsets[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ListToolsetsResponse.toolsets: object expected"); - message.toolsets[i] = $root.google.cloud.ces.v1beta.Toolset.fromObject(object.toolsets[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListToolsetsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListToolsetsResponse - * @static - * @param {google.cloud.ces.v1beta.ListToolsetsResponse} message ListToolsetsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListToolsetsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.toolsets = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.toolsets && message.toolsets.length) { - object.toolsets = []; - for (var j = 0; j < message.toolsets.length; ++j) - object.toolsets[j] = $root.google.cloud.ces.v1beta.Toolset.toObject(message.toolsets[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListToolsetsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListToolsetsResponse - * @instance - * @returns {Object.} JSON object - */ - ListToolsetsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListToolsetsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListToolsetsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListToolsetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListToolsetsResponse"; - }; - - return ListToolsetsResponse; - })(); - - v1beta.GetToolsetRequest = (function() { - - /** - * Properties of a GetToolsetRequest. - * @memberof google.cloud.ces.v1beta - * @interface IGetToolsetRequest - * @property {string|null} [name] GetToolsetRequest name - */ - - /** - * Constructs a new GetToolsetRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GetToolsetRequest. - * @implements IGetToolsetRequest - * @constructor - * @param {google.cloud.ces.v1beta.IGetToolsetRequest=} [properties] Properties to set - */ - function GetToolsetRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetToolsetRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.GetToolsetRequest - * @instance - */ - GetToolsetRequest.prototype.name = ""; - - /** - * Creates a new GetToolsetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GetToolsetRequest - * @static - * @param {google.cloud.ces.v1beta.IGetToolsetRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GetToolsetRequest} GetToolsetRequest instance - */ - GetToolsetRequest.create = function create(properties) { - return new GetToolsetRequest(properties); - }; - - /** - * Encodes the specified GetToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetToolsetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GetToolsetRequest - * @static - * @param {google.cloud.ces.v1beta.IGetToolsetRequest} message GetToolsetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetToolsetRequest.encode = function encode(message, writer) { - 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 GetToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetToolsetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GetToolsetRequest - * @static - * @param {google.cloud.ces.v1beta.IGetToolsetRequest} message GetToolsetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetToolsetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GetToolsetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GetToolsetRequest} GetToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetToolsetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetToolsetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetToolsetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GetToolsetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GetToolsetRequest} GetToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetToolsetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetToolsetRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.GetToolsetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetToolsetRequest.verify = function verify(message) { - if (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 GetToolsetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GetToolsetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GetToolsetRequest} GetToolsetRequest - */ - GetToolsetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GetToolsetRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.GetToolsetRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetToolsetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GetToolsetRequest - * @static - * @param {google.cloud.ces.v1beta.GetToolsetRequest} message GetToolsetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetToolsetRequest.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 GetToolsetRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GetToolsetRequest - * @instance - * @returns {Object.} JSON object - */ - GetToolsetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetToolsetRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GetToolsetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GetToolsetRequest"; - }; - - return GetToolsetRequest; - })(); - - v1beta.CreateToolsetRequest = (function() { - - /** - * Properties of a CreateToolsetRequest. - * @memberof google.cloud.ces.v1beta - * @interface ICreateToolsetRequest - * @property {string|null} [parent] CreateToolsetRequest parent - * @property {string|null} [toolsetId] CreateToolsetRequest toolsetId - * @property {google.cloud.ces.v1beta.IToolset|null} [toolset] CreateToolsetRequest toolset - */ - - /** - * Constructs a new CreateToolsetRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a CreateToolsetRequest. - * @implements ICreateToolsetRequest - * @constructor - * @param {google.cloud.ces.v1beta.ICreateToolsetRequest=} [properties] Properties to set - */ - function CreateToolsetRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateToolsetRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.CreateToolsetRequest - * @instance - */ - CreateToolsetRequest.prototype.parent = ""; - - /** - * CreateToolsetRequest toolsetId. - * @member {string} toolsetId - * @memberof google.cloud.ces.v1beta.CreateToolsetRequest - * @instance - */ - CreateToolsetRequest.prototype.toolsetId = ""; - - /** - * CreateToolsetRequest toolset. - * @member {google.cloud.ces.v1beta.IToolset|null|undefined} toolset - * @memberof google.cloud.ces.v1beta.CreateToolsetRequest - * @instance - */ - CreateToolsetRequest.prototype.toolset = null; - - /** - * Creates a new CreateToolsetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.CreateToolsetRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateToolsetRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.CreateToolsetRequest} CreateToolsetRequest instance - */ - CreateToolsetRequest.create = function create(properties) { - return new CreateToolsetRequest(properties); - }; - - /** - * Encodes the specified CreateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolsetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.CreateToolsetRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateToolsetRequest} message CreateToolsetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateToolsetRequest.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.toolsetId != null && Object.hasOwnProperty.call(message, "toolsetId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.toolsetId); - if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) - $root.google.cloud.ces.v1beta.Toolset.encode(message.toolset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolsetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.CreateToolsetRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateToolsetRequest} message CreateToolsetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateToolsetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.CreateToolsetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.CreateToolsetRequest} CreateToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateToolsetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateToolsetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.toolsetId = reader.string(); - break; - } - case 3: { - message.toolset = $root.google.cloud.ces.v1beta.Toolset.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateToolsetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.CreateToolsetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.CreateToolsetRequest} CreateToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateToolsetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateToolsetRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.CreateToolsetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateToolsetRequest.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.toolsetId != null && message.hasOwnProperty("toolsetId")) - if (!$util.isString(message.toolsetId)) - return "toolsetId: string expected"; - if (message.toolset != null && message.hasOwnProperty("toolset")) { - var error = $root.google.cloud.ces.v1beta.Toolset.verify(message.toolset); - if (error) - return "toolset." + error; - } - return null; - }; - - /** - * Creates a CreateToolsetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.CreateToolsetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.CreateToolsetRequest} CreateToolsetRequest - */ - CreateToolsetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.CreateToolsetRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.CreateToolsetRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.toolsetId != null) - message.toolsetId = String(object.toolsetId); - if (object.toolset != null) { - if (typeof object.toolset !== "object") - throw TypeError(".google.cloud.ces.v1beta.CreateToolsetRequest.toolset: object expected"); - message.toolset = $root.google.cloud.ces.v1beta.Toolset.fromObject(object.toolset); - } - return message; - }; - - /** - * Creates a plain object from a CreateToolsetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.CreateToolsetRequest - * @static - * @param {google.cloud.ces.v1beta.CreateToolsetRequest} message CreateToolsetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateToolsetRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.toolsetId = ""; - object.toolset = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.toolsetId != null && message.hasOwnProperty("toolsetId")) - object.toolsetId = message.toolsetId; - if (message.toolset != null && message.hasOwnProperty("toolset")) - object.toolset = $root.google.cloud.ces.v1beta.Toolset.toObject(message.toolset, options); - return object; - }; - - /** - * Converts this CreateToolsetRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.CreateToolsetRequest - * @instance - * @returns {Object.} JSON object - */ - CreateToolsetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateToolsetRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.CreateToolsetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateToolsetRequest"; - }; - - return CreateToolsetRequest; - })(); - - v1beta.UpdateToolsetRequest = (function() { - - /** - * Properties of an UpdateToolsetRequest. - * @memberof google.cloud.ces.v1beta - * @interface IUpdateToolsetRequest - * @property {google.cloud.ces.v1beta.IToolset|null} [toolset] UpdateToolsetRequest toolset - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateToolsetRequest updateMask - */ - - /** - * Constructs a new UpdateToolsetRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an UpdateToolsetRequest. - * @implements IUpdateToolsetRequest - * @constructor - * @param {google.cloud.ces.v1beta.IUpdateToolsetRequest=} [properties] Properties to set - */ - function UpdateToolsetRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateToolsetRequest toolset. - * @member {google.cloud.ces.v1beta.IToolset|null|undefined} toolset - * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest - * @instance - */ - UpdateToolsetRequest.prototype.toolset = null; - - /** - * UpdateToolsetRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest - * @instance - */ - UpdateToolsetRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateToolsetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateToolsetRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.UpdateToolsetRequest} UpdateToolsetRequest instance - */ - UpdateToolsetRequest.create = function create(properties) { - return new UpdateToolsetRequest(properties); - }; - - /** - * Encodes the specified UpdateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolsetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateToolsetRequest} message UpdateToolsetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateToolsetRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) - $root.google.cloud.ces.v1beta.Toolset.encode(message.toolset, 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 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolsetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateToolsetRequest} message UpdateToolsetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateToolsetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.UpdateToolsetRequest} UpdateToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateToolsetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateToolsetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.toolset = $root.google.cloud.ces.v1beta.Toolset.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateToolsetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.UpdateToolsetRequest} UpdateToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateToolsetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateToolsetRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateToolsetRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.toolset != null && message.hasOwnProperty("toolset")) { - var error = $root.google.cloud.ces.v1beta.Toolset.verify(message.toolset); - if (error) - return "toolset." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateToolsetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.UpdateToolsetRequest} UpdateToolsetRequest - */ - UpdateToolsetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.UpdateToolsetRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.UpdateToolsetRequest(); - if (object.toolset != null) { - if (typeof object.toolset !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateToolsetRequest.toolset: object expected"); - message.toolset = $root.google.cloud.ces.v1beta.Toolset.fromObject(object.toolset); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateToolsetRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateToolsetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest - * @static - * @param {google.cloud.ces.v1beta.UpdateToolsetRequest} message UpdateToolsetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateToolsetRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.toolset = null; - object.updateMask = null; - } - if (message.toolset != null && message.hasOwnProperty("toolset")) - object.toolset = $root.google.cloud.ces.v1beta.Toolset.toObject(message.toolset, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateToolsetRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateToolsetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateToolsetRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateToolsetRequest"; - }; - - return UpdateToolsetRequest; - })(); - - v1beta.DeleteToolsetRequest = (function() { - - /** - * Properties of a DeleteToolsetRequest. - * @memberof google.cloud.ces.v1beta - * @interface IDeleteToolsetRequest - * @property {string|null} [name] DeleteToolsetRequest name - * @property {boolean|null} [force] DeleteToolsetRequest force - * @property {string|null} [etag] DeleteToolsetRequest etag - */ - - /** - * Constructs a new DeleteToolsetRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DeleteToolsetRequest. - * @implements IDeleteToolsetRequest - * @constructor - * @param {google.cloud.ces.v1beta.IDeleteToolsetRequest=} [properties] Properties to set - */ - function DeleteToolsetRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteToolsetRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest - * @instance - */ - DeleteToolsetRequest.prototype.name = ""; - - /** - * DeleteToolsetRequest force. - * @member {boolean} force - * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest - * @instance - */ - DeleteToolsetRequest.prototype.force = false; - - /** - * DeleteToolsetRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest - * @instance - */ - DeleteToolsetRequest.prototype.etag = ""; - - /** - * Creates a new DeleteToolsetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteToolsetRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DeleteToolsetRequest} DeleteToolsetRequest instance - */ - DeleteToolsetRequest.create = function create(properties) { - return new DeleteToolsetRequest(properties); - }; - - /** - * Encodes the specified DeleteToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolsetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteToolsetRequest} message DeleteToolsetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteToolsetRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolsetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteToolsetRequest} message DeleteToolsetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteToolsetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DeleteToolsetRequest} DeleteToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteToolsetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteToolsetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.force = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteToolsetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DeleteToolsetRequest} DeleteToolsetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteToolsetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteToolsetRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteToolsetRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteToolsetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DeleteToolsetRequest} DeleteToolsetRequest - */ - DeleteToolsetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DeleteToolsetRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.DeleteToolsetRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.force != null) - message.force = Boolean(object.force); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteToolsetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest - * @static - * @param {google.cloud.ces.v1beta.DeleteToolsetRequest} message DeleteToolsetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteToolsetRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.force = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteToolsetRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteToolsetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteToolsetRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteToolsetRequest"; - }; - - return DeleteToolsetRequest; - })(); - - v1beta.ListAppVersionsRequest = (function() { - - /** - * Properties of a ListAppVersionsRequest. - * @memberof google.cloud.ces.v1beta - * @interface IListAppVersionsRequest - * @property {string|null} [parent] ListAppVersionsRequest parent - * @property {number|null} [pageSize] ListAppVersionsRequest pageSize - * @property {string|null} [pageToken] ListAppVersionsRequest pageToken - * @property {string|null} [filter] ListAppVersionsRequest filter - * @property {string|null} [orderBy] ListAppVersionsRequest orderBy - */ - - /** - * Constructs a new ListAppVersionsRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListAppVersionsRequest. - * @implements IListAppVersionsRequest - * @constructor - * @param {google.cloud.ces.v1beta.IListAppVersionsRequest=} [properties] Properties to set - */ - function ListAppVersionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAppVersionsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest - * @instance - */ - ListAppVersionsRequest.prototype.parent = ""; - - /** - * ListAppVersionsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest - * @instance - */ - ListAppVersionsRequest.prototype.pageSize = 0; - - /** - * ListAppVersionsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest - * @instance - */ - ListAppVersionsRequest.prototype.pageToken = ""; - - /** - * ListAppVersionsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest - * @instance - */ - ListAppVersionsRequest.prototype.filter = ""; - - /** - * ListAppVersionsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest - * @instance - */ - ListAppVersionsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListAppVersionsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest - * @static - * @param {google.cloud.ces.v1beta.IListAppVersionsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListAppVersionsRequest} ListAppVersionsRequest instance - */ - ListAppVersionsRequest.create = function create(properties) { - return new ListAppVersionsRequest(properties); - }; - - /** - * Encodes the specified ListAppVersionsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest - * @static - * @param {google.cloud.ces.v1beta.IListAppVersionsRequest} message ListAppVersionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAppVersionsRequest.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 ListAppVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest - * @static - * @param {google.cloud.ces.v1beta.IListAppVersionsRequest} message ListAppVersionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAppVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAppVersionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListAppVersionsRequest} ListAppVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAppVersionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListAppVersionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAppVersionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListAppVersionsRequest} ListAppVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAppVersionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAppVersionsRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAppVersionsRequest.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 ListAppVersionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListAppVersionsRequest} ListAppVersionsRequest - */ - ListAppVersionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListAppVersionsRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ListAppVersionsRequest(); - 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 ListAppVersionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest - * @static - * @param {google.cloud.ces.v1beta.ListAppVersionsRequest} message ListAppVersionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAppVersionsRequest.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 ListAppVersionsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListAppVersionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAppVersionsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAppVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListAppVersionsRequest"; - }; - - return ListAppVersionsRequest; - })(); - - v1beta.ListAppVersionsResponse = (function() { - - /** - * Properties of a ListAppVersionsResponse. - * @memberof google.cloud.ces.v1beta - * @interface IListAppVersionsResponse - * @property {Array.|null} [appVersions] ListAppVersionsResponse appVersions - * @property {string|null} [nextPageToken] ListAppVersionsResponse nextPageToken - */ - - /** - * Constructs a new ListAppVersionsResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListAppVersionsResponse. - * @implements IListAppVersionsResponse - * @constructor - * @param {google.cloud.ces.v1beta.IListAppVersionsResponse=} [properties] Properties to set - */ - function ListAppVersionsResponse(properties) { - this.appVersions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAppVersionsResponse appVersions. - * @member {Array.} appVersions - * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse - * @instance - */ - ListAppVersionsResponse.prototype.appVersions = $util.emptyArray; - - /** - * ListAppVersionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse - * @instance - */ - ListAppVersionsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListAppVersionsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse - * @static - * @param {google.cloud.ces.v1beta.IListAppVersionsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListAppVersionsResponse} ListAppVersionsResponse instance - */ - ListAppVersionsResponse.create = function create(properties) { - return new ListAppVersionsResponse(properties); - }; - - /** - * Encodes the specified ListAppVersionsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse - * @static - * @param {google.cloud.ces.v1beta.IListAppVersionsResponse} message ListAppVersionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAppVersionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.appVersions != null && message.appVersions.length) - for (var i = 0; i < message.appVersions.length; ++i) - $root.google.cloud.ces.v1beta.AppVersion.encode(message.appVersions[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 ListAppVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse - * @static - * @param {google.cloud.ces.v1beta.IListAppVersionsResponse} message ListAppVersionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAppVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAppVersionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListAppVersionsResponse} ListAppVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAppVersionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListAppVersionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.appVersions && message.appVersions.length)) - message.appVersions = []; - message.appVersions.push($root.google.cloud.ces.v1beta.AppVersion.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAppVersionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListAppVersionsResponse} ListAppVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAppVersionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAppVersionsResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAppVersionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.appVersions != null && message.hasOwnProperty("appVersions")) { - if (!Array.isArray(message.appVersions)) - return "appVersions: array expected"; - for (var i = 0; i < message.appVersions.length; ++i) { - var error = $root.google.cloud.ces.v1beta.AppVersion.verify(message.appVersions[i]); - if (error) - return "appVersions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListAppVersionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListAppVersionsResponse} ListAppVersionsResponse - */ - ListAppVersionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListAppVersionsResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ListAppVersionsResponse(); - if (object.appVersions) { - if (!Array.isArray(object.appVersions)) - throw TypeError(".google.cloud.ces.v1beta.ListAppVersionsResponse.appVersions: array expected"); - message.appVersions = []; - for (var i = 0; i < object.appVersions.length; ++i) { - if (typeof object.appVersions[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ListAppVersionsResponse.appVersions: object expected"); - message.appVersions[i] = $root.google.cloud.ces.v1beta.AppVersion.fromObject(object.appVersions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListAppVersionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse - * @static - * @param {google.cloud.ces.v1beta.ListAppVersionsResponse} message ListAppVersionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAppVersionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.appVersions = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.appVersions && message.appVersions.length) { - object.appVersions = []; - for (var j = 0; j < message.appVersions.length; ++j) - object.appVersions[j] = $root.google.cloud.ces.v1beta.AppVersion.toObject(message.appVersions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListAppVersionsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListAppVersionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAppVersionsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAppVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListAppVersionsResponse"; - }; - - return ListAppVersionsResponse; - })(); - - v1beta.GetAppVersionRequest = (function() { - - /** - * Properties of a GetAppVersionRequest. - * @memberof google.cloud.ces.v1beta - * @interface IGetAppVersionRequest - * @property {string|null} [name] GetAppVersionRequest name - */ - - /** - * Constructs a new GetAppVersionRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GetAppVersionRequest. - * @implements IGetAppVersionRequest - * @constructor - * @param {google.cloud.ces.v1beta.IGetAppVersionRequest=} [properties] Properties to set - */ - function GetAppVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetAppVersionRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.GetAppVersionRequest - * @instance - */ - GetAppVersionRequest.prototype.name = ""; - - /** - * Creates a new GetAppVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GetAppVersionRequest - * @static - * @param {google.cloud.ces.v1beta.IGetAppVersionRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GetAppVersionRequest} GetAppVersionRequest instance - */ - GetAppVersionRequest.create = function create(properties) { - return new GetAppVersionRequest(properties); - }; - - /** - * Encodes the specified GetAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetAppVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GetAppVersionRequest - * @static - * @param {google.cloud.ces.v1beta.IGetAppVersionRequest} message GetAppVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAppVersionRequest.encode = function encode(message, writer) { - 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 GetAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetAppVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GetAppVersionRequest - * @static - * @param {google.cloud.ces.v1beta.IGetAppVersionRequest} message GetAppVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetAppVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GetAppVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GetAppVersionRequest} GetAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAppVersionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetAppVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetAppVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GetAppVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GetAppVersionRequest} GetAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetAppVersionRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.GetAppVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetAppVersionRequest.verify = function verify(message) { - if (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 GetAppVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GetAppVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GetAppVersionRequest} GetAppVersionRequest - */ - GetAppVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GetAppVersionRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.GetAppVersionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetAppVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GetAppVersionRequest - * @static - * @param {google.cloud.ces.v1beta.GetAppVersionRequest} message GetAppVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetAppVersionRequest.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 GetAppVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GetAppVersionRequest - * @instance - * @returns {Object.} JSON object - */ - GetAppVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetAppVersionRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GetAppVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GetAppVersionRequest"; - }; - - return GetAppVersionRequest; - })(); - - v1beta.DeleteAppVersionRequest = (function() { - - /** - * Properties of a DeleteAppVersionRequest. - * @memberof google.cloud.ces.v1beta - * @interface IDeleteAppVersionRequest - * @property {string|null} [name] DeleteAppVersionRequest name - * @property {string|null} [etag] DeleteAppVersionRequest etag - */ - - /** - * Constructs a new DeleteAppVersionRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DeleteAppVersionRequest. - * @implements IDeleteAppVersionRequest - * @constructor - * @param {google.cloud.ces.v1beta.IDeleteAppVersionRequest=} [properties] Properties to set - */ - function DeleteAppVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteAppVersionRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest - * @instance - */ - DeleteAppVersionRequest.prototype.name = ""; - - /** - * DeleteAppVersionRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest - * @instance - */ - DeleteAppVersionRequest.prototype.etag = ""; - - /** - * Creates a new DeleteAppVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteAppVersionRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DeleteAppVersionRequest} DeleteAppVersionRequest instance - */ - DeleteAppVersionRequest.create = function create(properties) { - return new DeleteAppVersionRequest(properties); - }; - - /** - * Encodes the specified DeleteAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteAppVersionRequest} message DeleteAppVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAppVersionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteAppVersionRequest} message DeleteAppVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteAppVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DeleteAppVersionRequest} DeleteAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAppVersionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteAppVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteAppVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DeleteAppVersionRequest} DeleteAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteAppVersionRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteAppVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteAppVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DeleteAppVersionRequest} DeleteAppVersionRequest - */ - DeleteAppVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DeleteAppVersionRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.DeleteAppVersionRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteAppVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest - * @static - * @param {google.cloud.ces.v1beta.DeleteAppVersionRequest} message DeleteAppVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteAppVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteAppVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteAppVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteAppVersionRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteAppVersionRequest"; - }; - - return DeleteAppVersionRequest; - })(); - - v1beta.CreateAppVersionRequest = (function() { - - /** - * Properties of a CreateAppVersionRequest. - * @memberof google.cloud.ces.v1beta - * @interface ICreateAppVersionRequest - * @property {string|null} [parent] CreateAppVersionRequest parent - * @property {string|null} [appVersionId] CreateAppVersionRequest appVersionId - * @property {google.cloud.ces.v1beta.IAppVersion|null} [appVersion] CreateAppVersionRequest appVersion - */ - - /** - * Constructs a new CreateAppVersionRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a CreateAppVersionRequest. - * @implements ICreateAppVersionRequest - * @constructor - * @param {google.cloud.ces.v1beta.ICreateAppVersionRequest=} [properties] Properties to set - */ - function CreateAppVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateAppVersionRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest - * @instance - */ - CreateAppVersionRequest.prototype.parent = ""; - - /** - * CreateAppVersionRequest appVersionId. - * @member {string} appVersionId - * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest - * @instance - */ - CreateAppVersionRequest.prototype.appVersionId = ""; - - /** - * CreateAppVersionRequest appVersion. - * @member {google.cloud.ces.v1beta.IAppVersion|null|undefined} appVersion - * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest - * @instance - */ - CreateAppVersionRequest.prototype.appVersion = null; - - /** - * Creates a new CreateAppVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateAppVersionRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.CreateAppVersionRequest} CreateAppVersionRequest instance - */ - CreateAppVersionRequest.create = function create(properties) { - return new CreateAppVersionRequest(properties); - }; - - /** - * Encodes the specified CreateAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateAppVersionRequest} message CreateAppVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAppVersionRequest.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.appVersionId != null && Object.hasOwnProperty.call(message, "appVersionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.appVersionId); - if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) - $root.google.cloud.ces.v1beta.AppVersion.encode(message.appVersion, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateAppVersionRequest} message CreateAppVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateAppVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.CreateAppVersionRequest} CreateAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAppVersionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateAppVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.appVersionId = reader.string(); - break; - } - case 3: { - message.appVersion = $root.google.cloud.ces.v1beta.AppVersion.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateAppVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.CreateAppVersionRequest} CreateAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateAppVersionRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateAppVersionRequest.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.appVersionId != null && message.hasOwnProperty("appVersionId")) - if (!$util.isString(message.appVersionId)) - return "appVersionId: string expected"; - if (message.appVersion != null && message.hasOwnProperty("appVersion")) { - var error = $root.google.cloud.ces.v1beta.AppVersion.verify(message.appVersion); - if (error) - return "appVersion." + error; - } - return null; - }; - - /** - * Creates a CreateAppVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.CreateAppVersionRequest} CreateAppVersionRequest - */ - CreateAppVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.CreateAppVersionRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.CreateAppVersionRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.appVersionId != null) - message.appVersionId = String(object.appVersionId); - if (object.appVersion != null) { - if (typeof object.appVersion !== "object") - throw TypeError(".google.cloud.ces.v1beta.CreateAppVersionRequest.appVersion: object expected"); - message.appVersion = $root.google.cloud.ces.v1beta.AppVersion.fromObject(object.appVersion); - } - return message; - }; - - /** - * Creates a plain object from a CreateAppVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest - * @static - * @param {google.cloud.ces.v1beta.CreateAppVersionRequest} message CreateAppVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateAppVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.appVersionId = ""; - object.appVersion = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.appVersionId != null && message.hasOwnProperty("appVersionId")) - object.appVersionId = message.appVersionId; - if (message.appVersion != null && message.hasOwnProperty("appVersion")) - object.appVersion = $root.google.cloud.ces.v1beta.AppVersion.toObject(message.appVersion, options); - return object; - }; - - /** - * Converts this CreateAppVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest - * @instance - * @returns {Object.} JSON object - */ - CreateAppVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateAppVersionRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateAppVersionRequest"; - }; - - return CreateAppVersionRequest; - })(); - - v1beta.RestoreAppVersionRequest = (function() { - - /** - * Properties of a RestoreAppVersionRequest. - * @memberof google.cloud.ces.v1beta - * @interface IRestoreAppVersionRequest - * @property {string|null} [name] RestoreAppVersionRequest name - */ - - /** - * Constructs a new RestoreAppVersionRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a RestoreAppVersionRequest. - * @implements IRestoreAppVersionRequest - * @constructor - * @param {google.cloud.ces.v1beta.IRestoreAppVersionRequest=} [properties] Properties to set - */ - function RestoreAppVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreAppVersionRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest - * @instance - */ - RestoreAppVersionRequest.prototype.name = ""; - - /** - * Creates a new RestoreAppVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest - * @static - * @param {google.cloud.ces.v1beta.IRestoreAppVersionRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.RestoreAppVersionRequest} RestoreAppVersionRequest instance - */ - RestoreAppVersionRequest.create = function create(properties) { - return new RestoreAppVersionRequest(properties); - }; - - /** - * Encodes the specified RestoreAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest - * @static - * @param {google.cloud.ces.v1beta.IRestoreAppVersionRequest} message RestoreAppVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreAppVersionRequest.encode = function encode(message, writer) { - 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 RestoreAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest - * @static - * @param {google.cloud.ces.v1beta.IRestoreAppVersionRequest} message RestoreAppVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreAppVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.RestoreAppVersionRequest} RestoreAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreAppVersionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RestoreAppVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreAppVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.RestoreAppVersionRequest} RestoreAppVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreAppVersionRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreAppVersionRequest.verify = function verify(message) { - if (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 RestoreAppVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.RestoreAppVersionRequest} RestoreAppVersionRequest - */ - RestoreAppVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.RestoreAppVersionRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.RestoreAppVersionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a RestoreAppVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest - * @static - * @param {google.cloud.ces.v1beta.RestoreAppVersionRequest} message RestoreAppVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreAppVersionRequest.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 RestoreAppVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest - * @instance - * @returns {Object.} JSON object - */ - RestoreAppVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreAppVersionRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.RestoreAppVersionRequest"; - }; - - return RestoreAppVersionRequest; - })(); - - v1beta.RestoreAppVersionResponse = (function() { - - /** - * Properties of a RestoreAppVersionResponse. - * @memberof google.cloud.ces.v1beta - * @interface IRestoreAppVersionResponse - */ - - /** - * Constructs a new RestoreAppVersionResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a RestoreAppVersionResponse. - * @implements IRestoreAppVersionResponse - * @constructor - * @param {google.cloud.ces.v1beta.IRestoreAppVersionResponse=} [properties] Properties to set - */ - function RestoreAppVersionResponse(properties) { - if (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 RestoreAppVersionResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse - * @static - * @param {google.cloud.ces.v1beta.IRestoreAppVersionResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.RestoreAppVersionResponse} RestoreAppVersionResponse instance - */ - RestoreAppVersionResponse.create = function create(properties) { - return new RestoreAppVersionResponse(properties); - }; - - /** - * Encodes the specified RestoreAppVersionResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse - * @static - * @param {google.cloud.ces.v1beta.IRestoreAppVersionResponse} message RestoreAppVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreAppVersionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified RestoreAppVersionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse - * @static - * @param {google.cloud.ces.v1beta.IRestoreAppVersionResponse} message RestoreAppVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreAppVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreAppVersionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.RestoreAppVersionResponse} RestoreAppVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreAppVersionResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RestoreAppVersionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreAppVersionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.RestoreAppVersionResponse} RestoreAppVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreAppVersionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreAppVersionResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreAppVersionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a RestoreAppVersionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.RestoreAppVersionResponse} RestoreAppVersionResponse - */ - RestoreAppVersionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.RestoreAppVersionResponse) - return object; - return new $root.google.cloud.ces.v1beta.RestoreAppVersionResponse(); - }; - - /** - * Creates a plain object from a RestoreAppVersionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse - * @static - * @param {google.cloud.ces.v1beta.RestoreAppVersionResponse} message RestoreAppVersionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreAppVersionResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this RestoreAppVersionResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse - * @instance - * @returns {Object.} JSON object - */ - RestoreAppVersionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreAppVersionResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreAppVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.RestoreAppVersionResponse"; - }; - - return RestoreAppVersionResponse; - })(); - - v1beta.GenerateAppResourceResponse = (function() { - - /** - * Properties of a GenerateAppResourceResponse. - * @memberof google.cloud.ces.v1beta - * @interface IGenerateAppResourceResponse - * @property {google.cloud.ces.v1beta.IAgent|null} [agent] GenerateAppResourceResponse agent - * @property {google.cloud.ces.v1beta.IToolset|null} [toolset] GenerateAppResourceResponse toolset - * @property {google.cloud.ces.v1beta.IAppSnapshot|null} [appSnapshot] GenerateAppResourceResponse appSnapshot - * @property {google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools|null} [tools] GenerateAppResourceResponse tools - * @property {google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations|null} [evaluations] GenerateAppResourceResponse evaluations - * @property {google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources|null} [appResources] GenerateAppResourceResponse appResources - * @property {google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo|null} [generateResultInfo] GenerateAppResourceResponse generateResultInfo - */ - - /** - * Constructs a new GenerateAppResourceResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GenerateAppResourceResponse. - * @implements IGenerateAppResourceResponse - * @constructor - * @param {google.cloud.ces.v1beta.IGenerateAppResourceResponse=} [properties] Properties to set - */ - function GenerateAppResourceResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenerateAppResourceResponse agent. - * @member {google.cloud.ces.v1beta.IAgent|null|undefined} agent - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @instance - */ - GenerateAppResourceResponse.prototype.agent = null; - - /** - * GenerateAppResourceResponse toolset. - * @member {google.cloud.ces.v1beta.IToolset|null|undefined} toolset - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @instance - */ - GenerateAppResourceResponse.prototype.toolset = null; - - /** - * GenerateAppResourceResponse appSnapshot. - * @member {google.cloud.ces.v1beta.IAppSnapshot|null|undefined} appSnapshot - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @instance - */ - GenerateAppResourceResponse.prototype.appSnapshot = null; - - /** - * GenerateAppResourceResponse tools. - * @member {google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools|null|undefined} tools - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @instance - */ - GenerateAppResourceResponse.prototype.tools = null; - - /** - * GenerateAppResourceResponse evaluations. - * @member {google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations|null|undefined} evaluations - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @instance - */ - GenerateAppResourceResponse.prototype.evaluations = null; - - /** - * GenerateAppResourceResponse appResources. - * @member {google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources|null|undefined} appResources - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @instance - */ - GenerateAppResourceResponse.prototype.appResources = null; - - /** - * GenerateAppResourceResponse generateResultInfo. - * @member {google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo|null|undefined} generateResultInfo - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @instance - */ - GenerateAppResourceResponse.prototype.generateResultInfo = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GenerateAppResourceResponse generatedResource. - * @member {"agent"|"toolset"|"appSnapshot"|"tools"|"evaluations"|"appResources"|undefined} generatedResource - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @instance - */ - Object.defineProperty(GenerateAppResourceResponse.prototype, "generatedResource", { - get: $util.oneOfGetter($oneOfFields = ["agent", "toolset", "appSnapshot", "tools", "evaluations", "appResources"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GenerateAppResourceResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @static - * @param {google.cloud.ces.v1beta.IGenerateAppResourceResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse} GenerateAppResourceResponse instance - */ - GenerateAppResourceResponse.create = function create(properties) { - return new GenerateAppResourceResponse(properties); - }; - - /** - * Encodes the specified GenerateAppResourceResponse message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @static - * @param {google.cloud.ces.v1beta.IGenerateAppResourceResponse} message GenerateAppResourceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateAppResourceResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) - $root.google.cloud.ces.v1beta.Agent.encode(message.agent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.generateResultInfo != null && Object.hasOwnProperty.call(message, "generateResultInfo")) - $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.encode(message.generateResultInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) - $root.google.cloud.ces.v1beta.Toolset.encode(message.toolset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.appSnapshot != null && Object.hasOwnProperty.call(message, "appSnapshot")) - $root.google.cloud.ces.v1beta.AppSnapshot.encode(message.appSnapshot, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.tools != null && Object.hasOwnProperty.call(message, "tools")) - $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.encode(message.tools, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.evaluations != null && Object.hasOwnProperty.call(message, "evaluations")) - $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.encode(message.evaluations, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.appResources != null && Object.hasOwnProperty.call(message, "appResources")) - $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.encode(message.appResources, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenerateAppResourceResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @static - * @param {google.cloud.ces.v1beta.IGenerateAppResourceResponse} message GenerateAppResourceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateAppResourceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenerateAppResourceResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse} GenerateAppResourceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateAppResourceResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.agent = $root.google.cloud.ces.v1beta.Agent.decode(reader, reader.uint32()); - break; - } - case 3: { - message.toolset = $root.google.cloud.ces.v1beta.Toolset.decode(reader, reader.uint32()); - break; - } - case 4: { - message.appSnapshot = $root.google.cloud.ces.v1beta.AppSnapshot.decode(reader, reader.uint32()); - break; - } - case 5: { - message.tools = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.decode(reader, reader.uint32()); - break; - } - case 6: { - message.evaluations = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.decode(reader, reader.uint32()); - break; - } - case 7: { - message.appResources = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.decode(reader, reader.uint32()); - break; - } - case 2: { - message.generateResultInfo = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenerateAppResourceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse} GenerateAppResourceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateAppResourceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenerateAppResourceResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenerateAppResourceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.agent != null && message.hasOwnProperty("agent")) { - properties.generatedResource = 1; - { - var error = $root.google.cloud.ces.v1beta.Agent.verify(message.agent); - if (error) - return "agent." + error; - } - } - if (message.toolset != null && message.hasOwnProperty("toolset")) { - if (properties.generatedResource === 1) - return "generatedResource: multiple values"; - properties.generatedResource = 1; - { - var error = $root.google.cloud.ces.v1beta.Toolset.verify(message.toolset); - if (error) - return "toolset." + error; - } - } - if (message.appSnapshot != null && message.hasOwnProperty("appSnapshot")) { - if (properties.generatedResource === 1) - return "generatedResource: multiple values"; - properties.generatedResource = 1; - { - var error = $root.google.cloud.ces.v1beta.AppSnapshot.verify(message.appSnapshot); - if (error) - return "appSnapshot." + error; - } - } - if (message.tools != null && message.hasOwnProperty("tools")) { - if (properties.generatedResource === 1) - return "generatedResource: multiple values"; - properties.generatedResource = 1; - { - var error = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.verify(message.tools); - if (error) - return "tools." + error; - } - } - if (message.evaluations != null && message.hasOwnProperty("evaluations")) { - if (properties.generatedResource === 1) - return "generatedResource: multiple values"; - properties.generatedResource = 1; - { - var error = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.verify(message.evaluations); - if (error) - return "evaluations." + error; - } - } - if (message.appResources != null && message.hasOwnProperty("appResources")) { - if (properties.generatedResource === 1) - return "generatedResource: multiple values"; - properties.generatedResource = 1; - { - var error = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.verify(message.appResources); - if (error) - return "appResources." + error; - } - } - if (message.generateResultInfo != null && message.hasOwnProperty("generateResultInfo")) { - var error = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.verify(message.generateResultInfo); - if (error) - return "generateResultInfo." + error; - } - return null; - }; - - /** - * Creates a GenerateAppResourceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse} GenerateAppResourceResponse - */ - GenerateAppResourceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse(); - if (object.agent != null) { - if (typeof object.agent !== "object") - throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.agent: object expected"); - message.agent = $root.google.cloud.ces.v1beta.Agent.fromObject(object.agent); - } - if (object.toolset != null) { - if (typeof object.toolset !== "object") - throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.toolset: object expected"); - message.toolset = $root.google.cloud.ces.v1beta.Toolset.fromObject(object.toolset); - } - if (object.appSnapshot != null) { - if (typeof object.appSnapshot !== "object") - throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.appSnapshot: object expected"); - message.appSnapshot = $root.google.cloud.ces.v1beta.AppSnapshot.fromObject(object.appSnapshot); - } - if (object.tools != null) { - if (typeof object.tools !== "object") - throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.tools: object expected"); - message.tools = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.fromObject(object.tools); - } - if (object.evaluations != null) { - if (typeof object.evaluations !== "object") - throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.evaluations: object expected"); - message.evaluations = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.fromObject(object.evaluations); - } - if (object.appResources != null) { - if (typeof object.appResources !== "object") - throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.appResources: object expected"); - message.appResources = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.fromObject(object.appResources); - } - if (object.generateResultInfo != null) { - if (typeof object.generateResultInfo !== "object") - throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.generateResultInfo: object expected"); - message.generateResultInfo = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.fromObject(object.generateResultInfo); - } - return message; - }; - - /** - * Creates a plain object from a GenerateAppResourceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @static - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse} message GenerateAppResourceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenerateAppResourceResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.generateResultInfo = null; - if (message.agent != null && message.hasOwnProperty("agent")) { - object.agent = $root.google.cloud.ces.v1beta.Agent.toObject(message.agent, options); - if (options.oneofs) - object.generatedResource = "agent"; - } - if (message.generateResultInfo != null && message.hasOwnProperty("generateResultInfo")) - object.generateResultInfo = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.toObject(message.generateResultInfo, options); - if (message.toolset != null && message.hasOwnProperty("toolset")) { - object.toolset = $root.google.cloud.ces.v1beta.Toolset.toObject(message.toolset, options); - if (options.oneofs) - object.generatedResource = "toolset"; - } - if (message.appSnapshot != null && message.hasOwnProperty("appSnapshot")) { - object.appSnapshot = $root.google.cloud.ces.v1beta.AppSnapshot.toObject(message.appSnapshot, options); - if (options.oneofs) - object.generatedResource = "appSnapshot"; - } - if (message.tools != null && message.hasOwnProperty("tools")) { - object.tools = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.toObject(message.tools, options); - if (options.oneofs) - object.generatedResource = "tools"; - } - if (message.evaluations != null && message.hasOwnProperty("evaluations")) { - object.evaluations = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.toObject(message.evaluations, options); - if (options.oneofs) - object.generatedResource = "evaluations"; - } - if (message.appResources != null && message.hasOwnProperty("appResources")) { - object.appResources = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.toObject(message.appResources, options); - if (options.oneofs) - object.generatedResource = "appResources"; - } - return object; - }; - - /** - * Converts this GenerateAppResourceResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @instance - * @returns {Object.} JSON object - */ - GenerateAppResourceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenerateAppResourceResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenerateAppResourceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceResponse"; - }; - - GenerateAppResourceResponse.Evaluations = (function() { - - /** - * Properties of an Evaluations. - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @interface IEvaluations - * @property {Array.|null} [evaluations] Evaluations evaluations - */ - - /** - * Constructs a new Evaluations. - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @classdesc Represents an Evaluations. - * @implements IEvaluations - * @constructor - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations=} [properties] Properties to set - */ - function Evaluations(properties) { - this.evaluations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Evaluations evaluations. - * @member {Array.} evaluations - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations - * @instance - */ - Evaluations.prototype.evaluations = $util.emptyArray; - - /** - * Creates a new Evaluations instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations - * @static - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations} Evaluations instance - */ - Evaluations.create = function create(properties) { - return new Evaluations(properties); - }; - - /** - * Encodes the specified Evaluations message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations - * @static - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations} message Evaluations message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Evaluations.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evaluations != null && message.evaluations.length) - for (var i = 0; i < message.evaluations.length; ++i) - $root.google.cloud.ces.v1beta.Evaluation.encode(message.evaluations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Evaluations message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations - * @static - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations} message Evaluations message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Evaluations.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Evaluations message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations} Evaluations - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Evaluations.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.evaluations && message.evaluations.length)) - message.evaluations = []; - message.evaluations.push($root.google.cloud.ces.v1beta.Evaluation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Evaluations message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations} Evaluations - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Evaluations.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Evaluations message. - * @function verify - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Evaluations.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evaluations != null && message.hasOwnProperty("evaluations")) { - if (!Array.isArray(message.evaluations)) - return "evaluations: array expected"; - for (var i = 0; i < message.evaluations.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Evaluation.verify(message.evaluations[i]); - if (error) - return "evaluations." + error; - } - } - return null; - }; - - /** - * Creates an Evaluations message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations} Evaluations - */ - Evaluations.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations) - return object; - var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations(); - if (object.evaluations) { - if (!Array.isArray(object.evaluations)) - throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.evaluations: array expected"); - message.evaluations = []; - for (var i = 0; i < object.evaluations.length; ++i) { - if (typeof object.evaluations[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.evaluations: object expected"); - message.evaluations[i] = $root.google.cloud.ces.v1beta.Evaluation.fromObject(object.evaluations[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an Evaluations message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations - * @static - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations} message Evaluations - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Evaluations.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.evaluations = []; - if (message.evaluations && message.evaluations.length) { - object.evaluations = []; - for (var j = 0; j < message.evaluations.length; ++j) - object.evaluations[j] = $root.google.cloud.ces.v1beta.Evaluation.toObject(message.evaluations[j], options); - } - return object; - }; - - /** - * Converts this Evaluations to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations - * @instance - * @returns {Object.} JSON object - */ - Evaluations.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Evaluations - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Evaluations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations"; - }; - - return Evaluations; - })(); - - GenerateAppResourceResponse.Tools = (function() { - - /** - * Properties of a Tools. - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @interface ITools - * @property {Array.|null} [tools] Tools tools - */ - - /** - * Constructs a new Tools. - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @classdesc Represents a Tools. - * @implements ITools - * @constructor - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools=} [properties] Properties to set - */ - function Tools(properties) { - this.tools = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Tools tools. - * @member {Array.} tools - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools - * @instance - */ - Tools.prototype.tools = $util.emptyArray; - - /** - * Creates a new Tools instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools - * @static - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools} Tools instance - */ - Tools.create = function create(properties) { - return new Tools(properties); - }; - - /** - * Encodes the specified Tools message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools - * @static - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools} message Tools message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Tools.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tools != null && message.tools.length) - for (var i = 0; i < message.tools.length; ++i) - $root.google.cloud.ces.v1beta.Tool.encode(message.tools[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Tools message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools - * @static - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools} message Tools message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Tools.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Tools message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools} Tools - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Tools.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.tools && message.tools.length)) - message.tools = []; - message.tools.push($root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Tools message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools} Tools - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Tools.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Tools message. - * @function verify - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Tools.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tools != null && message.hasOwnProperty("tools")) { - if (!Array.isArray(message.tools)) - return "tools: array expected"; - for (var i = 0; i < message.tools.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tools[i]); - if (error) - return "tools." + error; - } - } - return null; - }; - - /** - * Creates a Tools message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools} Tools - */ - Tools.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools) - return object; - var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools(); - if (object.tools) { - if (!Array.isArray(object.tools)) - throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.tools: array expected"); - message.tools = []; - for (var i = 0; i < object.tools.length; ++i) { - if (typeof object.tools[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.tools: object expected"); - message.tools[i] = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tools[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Tools message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools - * @static - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools} message Tools - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Tools.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tools = []; - if (message.tools && message.tools.length) { - object.tools = []; - for (var j = 0; j < message.tools.length; ++j) - object.tools[j] = $root.google.cloud.ces.v1beta.Tool.toObject(message.tools[j], options); - } - return object; - }; - - /** - * Converts this Tools to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools - * @instance - * @returns {Object.} JSON object - */ - Tools.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Tools - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Tools.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools"; - }; - - return Tools; - })(); - - GenerateAppResourceResponse.AppResources = (function() { - - /** - * Properties of an AppResources. - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @interface IAppResources - * @property {google.cloud.ces.v1beta.IAppSnapshot|null} [appSnapshot] AppResources appSnapshot - * @property {Array.|null} [evaluations] AppResources evaluations - */ - - /** - * Constructs a new AppResources. - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @classdesc Represents an AppResources. - * @implements IAppResources - * @constructor - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources=} [properties] Properties to set - */ - function AppResources(properties) { - this.evaluations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AppResources appSnapshot. - * @member {google.cloud.ces.v1beta.IAppSnapshot|null|undefined} appSnapshot - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources - * @instance - */ - AppResources.prototype.appSnapshot = null; - - /** - * AppResources evaluations. - * @member {Array.} evaluations - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources - * @instance - */ - AppResources.prototype.evaluations = $util.emptyArray; - - /** - * Creates a new AppResources instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources - * @static - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources} AppResources instance - */ - AppResources.create = function create(properties) { - return new AppResources(properties); - }; - - /** - * Encodes the specified AppResources message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources - * @static - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources} message AppResources message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppResources.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.appSnapshot != null && Object.hasOwnProperty.call(message, "appSnapshot")) - $root.google.cloud.ces.v1beta.AppSnapshot.encode(message.appSnapshot, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.evaluations != null && message.evaluations.length) - for (var i = 0; i < message.evaluations.length; ++i) - $root.google.cloud.ces.v1beta.Evaluation.encode(message.evaluations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AppResources message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources - * @static - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources} message AppResources message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppResources.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AppResources message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources} AppResources - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppResources.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.appSnapshot = $root.google.cloud.ces.v1beta.AppSnapshot.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.evaluations && message.evaluations.length)) - message.evaluations = []; - message.evaluations.push($root.google.cloud.ces.v1beta.Evaluation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AppResources message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources} AppResources - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppResources.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AppResources message. - * @function verify - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AppResources.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.appSnapshot != null && message.hasOwnProperty("appSnapshot")) { - var error = $root.google.cloud.ces.v1beta.AppSnapshot.verify(message.appSnapshot); - if (error) - return "appSnapshot." + error; - } - if (message.evaluations != null && message.hasOwnProperty("evaluations")) { - if (!Array.isArray(message.evaluations)) - return "evaluations: array expected"; - for (var i = 0; i < message.evaluations.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Evaluation.verify(message.evaluations[i]); - if (error) - return "evaluations." + error; - } - } - return null; - }; - - /** - * Creates an AppResources message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources} AppResources - */ - AppResources.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources) - return object; - var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources(); - if (object.appSnapshot != null) { - if (typeof object.appSnapshot !== "object") - throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.appSnapshot: object expected"); - message.appSnapshot = $root.google.cloud.ces.v1beta.AppSnapshot.fromObject(object.appSnapshot); - } - if (object.evaluations) { - if (!Array.isArray(object.evaluations)) - throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.evaluations: array expected"); - message.evaluations = []; - for (var i = 0; i < object.evaluations.length; ++i) { - if (typeof object.evaluations[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.evaluations: object expected"); - message.evaluations[i] = $root.google.cloud.ces.v1beta.Evaluation.fromObject(object.evaluations[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AppResources message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources - * @static - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources} message AppResources - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AppResources.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.evaluations = []; - if (options.defaults) - object.appSnapshot = null; - if (message.appSnapshot != null && message.hasOwnProperty("appSnapshot")) - object.appSnapshot = $root.google.cloud.ces.v1beta.AppSnapshot.toObject(message.appSnapshot, options); - if (message.evaluations && message.evaluations.length) { - object.evaluations = []; - for (var j = 0; j < message.evaluations.length; ++j) - object.evaluations[j] = $root.google.cloud.ces.v1beta.Evaluation.toObject(message.evaluations[j], options); - } - return object; - }; - - /** - * Converts this AppResources to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources - * @instance - * @returns {Object.} JSON object - */ - AppResources.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AppResources - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AppResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources"; - }; - - return AppResources; - })(); - - GenerateAppResourceResponse.GenerateResultInfo = (function() { - - /** - * Properties of a GenerateResultInfo. - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @interface IGenerateResultInfo - * @property {string|null} [explanation] GenerateResultInfo explanation - */ - - /** - * Constructs a new GenerateResultInfo. - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse - * @classdesc Represents a GenerateResultInfo. - * @implements IGenerateResultInfo - * @constructor - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo=} [properties] Properties to set - */ - function GenerateResultInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenerateResultInfo explanation. - * @member {string} explanation - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo - * @instance - */ - GenerateResultInfo.prototype.explanation = ""; - - /** - * Creates a new GenerateResultInfo instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo - * @static - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo} GenerateResultInfo instance - */ - GenerateResultInfo.create = function create(properties) { - return new GenerateResultInfo(properties); - }; - - /** - * Encodes the specified GenerateResultInfo message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo - * @static - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo} message GenerateResultInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateResultInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.explanation); - return writer; - }; - - /** - * Encodes the specified GenerateResultInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo - * @static - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo} message GenerateResultInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateResultInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenerateResultInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo} GenerateResultInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateResultInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.explanation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenerateResultInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo} GenerateResultInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateResultInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenerateResultInfo message. - * @function verify - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenerateResultInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.explanation != null && message.hasOwnProperty("explanation")) - if (!$util.isString(message.explanation)) - return "explanation: string expected"; - return null; - }; - - /** - * Creates a GenerateResultInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo} GenerateResultInfo - */ - GenerateResultInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo) - return object; - var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo(); - if (object.explanation != null) - message.explanation = String(object.explanation); - return message; - }; - - /** - * Creates a plain object from a GenerateResultInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo - * @static - * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo} message GenerateResultInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenerateResultInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.explanation = ""; - if (message.explanation != null && message.hasOwnProperty("explanation")) - object.explanation = message.explanation; - return object; - }; - - /** - * Converts this GenerateResultInfo to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo - * @instance - * @returns {Object.} JSON object - */ - GenerateResultInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenerateResultInfo - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenerateResultInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo"; - }; - - return GenerateResultInfo; - })(); - - return GenerateAppResourceResponse; - })(); - - v1beta.ListChangelogsRequest = (function() { - - /** - * Properties of a ListChangelogsRequest. - * @memberof google.cloud.ces.v1beta - * @interface IListChangelogsRequest - * @property {string|null} [parent] ListChangelogsRequest parent - * @property {number|null} [pageSize] ListChangelogsRequest pageSize - * @property {string|null} [pageToken] ListChangelogsRequest pageToken - * @property {string|null} [filter] ListChangelogsRequest filter - * @property {string|null} [orderBy] ListChangelogsRequest orderBy - */ - - /** - * Constructs a new ListChangelogsRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListChangelogsRequest. - * @implements IListChangelogsRequest - * @constructor - * @param {google.cloud.ces.v1beta.IListChangelogsRequest=} [properties] Properties to set - */ - function ListChangelogsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListChangelogsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ListChangelogsRequest - * @instance - */ - ListChangelogsRequest.prototype.parent = ""; - - /** - * ListChangelogsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1beta.ListChangelogsRequest - * @instance - */ - ListChangelogsRequest.prototype.pageSize = 0; - - /** - * ListChangelogsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1beta.ListChangelogsRequest - * @instance - */ - ListChangelogsRequest.prototype.pageToken = ""; - - /** - * ListChangelogsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1beta.ListChangelogsRequest - * @instance - */ - ListChangelogsRequest.prototype.filter = ""; - - /** - * ListChangelogsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1beta.ListChangelogsRequest - * @instance - */ - ListChangelogsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListChangelogsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListChangelogsRequest - * @static - * @param {google.cloud.ces.v1beta.IListChangelogsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListChangelogsRequest} ListChangelogsRequest instance - */ - ListChangelogsRequest.create = function create(properties) { - return new ListChangelogsRequest(properties); - }; - - /** - * Encodes the specified ListChangelogsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListChangelogsRequest - * @static - * @param {google.cloud.ces.v1beta.IListChangelogsRequest} message ListChangelogsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListChangelogsRequest.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 ListChangelogsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListChangelogsRequest - * @static - * @param {google.cloud.ces.v1beta.IListChangelogsRequest} message ListChangelogsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListChangelogsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListChangelogsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListChangelogsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListChangelogsRequest} ListChangelogsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListChangelogsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListChangelogsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListChangelogsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListChangelogsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListChangelogsRequest} ListChangelogsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListChangelogsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListChangelogsRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListChangelogsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListChangelogsRequest.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 ListChangelogsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListChangelogsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListChangelogsRequest} ListChangelogsRequest - */ - ListChangelogsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListChangelogsRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ListChangelogsRequest(); - 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 ListChangelogsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListChangelogsRequest - * @static - * @param {google.cloud.ces.v1beta.ListChangelogsRequest} message ListChangelogsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListChangelogsRequest.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 ListChangelogsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListChangelogsRequest - * @instance - * @returns {Object.} JSON object - */ - ListChangelogsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListChangelogsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListChangelogsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListChangelogsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListChangelogsRequest"; - }; - - return ListChangelogsRequest; - })(); - - v1beta.ListChangelogsResponse = (function() { - - /** - * Properties of a ListChangelogsResponse. - * @memberof google.cloud.ces.v1beta - * @interface IListChangelogsResponse - * @property {Array.|null} [changelogs] ListChangelogsResponse changelogs - * @property {string|null} [nextPageToken] ListChangelogsResponse nextPageToken - */ - - /** - * Constructs a new ListChangelogsResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListChangelogsResponse. - * @implements IListChangelogsResponse - * @constructor - * @param {google.cloud.ces.v1beta.IListChangelogsResponse=} [properties] Properties to set - */ - function ListChangelogsResponse(properties) { - this.changelogs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListChangelogsResponse changelogs. - * @member {Array.} changelogs - * @memberof google.cloud.ces.v1beta.ListChangelogsResponse - * @instance - */ - ListChangelogsResponse.prototype.changelogs = $util.emptyArray; - - /** - * ListChangelogsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1beta.ListChangelogsResponse - * @instance - */ - ListChangelogsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListChangelogsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListChangelogsResponse - * @static - * @param {google.cloud.ces.v1beta.IListChangelogsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListChangelogsResponse} ListChangelogsResponse instance - */ - ListChangelogsResponse.create = function create(properties) { - return new ListChangelogsResponse(properties); - }; - - /** - * Encodes the specified ListChangelogsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListChangelogsResponse - * @static - * @param {google.cloud.ces.v1beta.IListChangelogsResponse} message ListChangelogsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListChangelogsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.changelogs != null && message.changelogs.length) - for (var i = 0; i < message.changelogs.length; ++i) - $root.google.cloud.ces.v1beta.Changelog.encode(message.changelogs[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 ListChangelogsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListChangelogsResponse - * @static - * @param {google.cloud.ces.v1beta.IListChangelogsResponse} message ListChangelogsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListChangelogsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListChangelogsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListChangelogsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListChangelogsResponse} ListChangelogsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListChangelogsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListChangelogsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.changelogs && message.changelogs.length)) - message.changelogs = []; - message.changelogs.push($root.google.cloud.ces.v1beta.Changelog.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListChangelogsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListChangelogsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListChangelogsResponse} ListChangelogsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListChangelogsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListChangelogsResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListChangelogsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListChangelogsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.changelogs != null && message.hasOwnProperty("changelogs")) { - if (!Array.isArray(message.changelogs)) - return "changelogs: array expected"; - for (var i = 0; i < message.changelogs.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Changelog.verify(message.changelogs[i]); - if (error) - return "changelogs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListChangelogsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListChangelogsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListChangelogsResponse} ListChangelogsResponse - */ - ListChangelogsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListChangelogsResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ListChangelogsResponse(); - if (object.changelogs) { - if (!Array.isArray(object.changelogs)) - throw TypeError(".google.cloud.ces.v1beta.ListChangelogsResponse.changelogs: array expected"); - message.changelogs = []; - for (var i = 0; i < object.changelogs.length; ++i) { - if (typeof object.changelogs[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ListChangelogsResponse.changelogs: object expected"); - message.changelogs[i] = $root.google.cloud.ces.v1beta.Changelog.fromObject(object.changelogs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListChangelogsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListChangelogsResponse - * @static - * @param {google.cloud.ces.v1beta.ListChangelogsResponse} message ListChangelogsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListChangelogsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.changelogs = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.changelogs && message.changelogs.length) { - object.changelogs = []; - for (var j = 0; j < message.changelogs.length; ++j) - object.changelogs[j] = $root.google.cloud.ces.v1beta.Changelog.toObject(message.changelogs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListChangelogsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListChangelogsResponse - * @instance - * @returns {Object.} JSON object - */ - ListChangelogsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListChangelogsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListChangelogsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListChangelogsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListChangelogsResponse"; - }; - - return ListChangelogsResponse; - })(); - - v1beta.GetChangelogRequest = (function() { - - /** - * Properties of a GetChangelogRequest. - * @memberof google.cloud.ces.v1beta - * @interface IGetChangelogRequest - * @property {string|null} [name] GetChangelogRequest name - */ - - /** - * Constructs a new GetChangelogRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GetChangelogRequest. - * @implements IGetChangelogRequest - * @constructor - * @param {google.cloud.ces.v1beta.IGetChangelogRequest=} [properties] Properties to set - */ - function GetChangelogRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetChangelogRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.GetChangelogRequest - * @instance - */ - GetChangelogRequest.prototype.name = ""; - - /** - * Creates a new GetChangelogRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GetChangelogRequest - * @static - * @param {google.cloud.ces.v1beta.IGetChangelogRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GetChangelogRequest} GetChangelogRequest instance - */ - GetChangelogRequest.create = function create(properties) { - return new GetChangelogRequest(properties); - }; - - /** - * Encodes the specified GetChangelogRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetChangelogRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GetChangelogRequest - * @static - * @param {google.cloud.ces.v1beta.IGetChangelogRequest} message GetChangelogRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetChangelogRequest.encode = function encode(message, writer) { - 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 GetChangelogRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetChangelogRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GetChangelogRequest - * @static - * @param {google.cloud.ces.v1beta.IGetChangelogRequest} message GetChangelogRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetChangelogRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetChangelogRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GetChangelogRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GetChangelogRequest} GetChangelogRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetChangelogRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetChangelogRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetChangelogRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GetChangelogRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GetChangelogRequest} GetChangelogRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetChangelogRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetChangelogRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.GetChangelogRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetChangelogRequest.verify = function verify(message) { - if (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 GetChangelogRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GetChangelogRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GetChangelogRequest} GetChangelogRequest - */ - GetChangelogRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GetChangelogRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.GetChangelogRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetChangelogRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GetChangelogRequest - * @static - * @param {google.cloud.ces.v1beta.GetChangelogRequest} message GetChangelogRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetChangelogRequest.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 GetChangelogRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GetChangelogRequest - * @instance - * @returns {Object.} JSON object - */ - GetChangelogRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetChangelogRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GetChangelogRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetChangelogRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GetChangelogRequest"; - }; - - return GetChangelogRequest; - })(); - - v1beta.App = (function() { - - /** - * Properties of an App. - * @memberof google.cloud.ces.v1beta - * @interface IApp - * @property {string|null} [name] App name - * @property {string|null} [displayName] App displayName - * @property {string|null} [description] App description - * @property {boolean|null} [pinned] App pinned - * @property {string|null} [rootAgent] App rootAgent - * @property {google.cloud.ces.v1beta.ILanguageSettings|null} [languageSettings] App languageSettings - * @property {google.cloud.ces.v1beta.ITimeZoneSettings|null} [timeZoneSettings] App timeZoneSettings - * @property {google.cloud.ces.v1beta.IAudioProcessingConfig|null} [audioProcessingConfig] App audioProcessingConfig - * @property {google.cloud.ces.v1beta.ILoggingSettings|null} [loggingSettings] App loggingSettings - * @property {google.cloud.ces.v1beta.IErrorHandlingSettings|null} [errorHandlingSettings] App errorHandlingSettings - * @property {google.cloud.ces.v1beta.IModelSettings|null} [modelSettings] App modelSettings - * @property {google.cloud.ces.v1beta.App.ToolExecutionMode|null} [toolExecutionMode] App toolExecutionMode - * @property {google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null} [evaluationMetricsThresholds] App evaluationMetricsThresholds - * @property {Array.|null} [variableDeclarations] App variableDeclarations - * @property {Array.|null} [predefinedVariableDeclarations] App predefinedVariableDeclarations - * @property {string|null} [globalInstruction] App globalInstruction - * @property {Array.|null} [guardrails] App guardrails - * @property {google.cloud.ces.v1beta.IDataStoreSettings|null} [dataStoreSettings] App dataStoreSettings - * @property {google.cloud.ces.v1beta.IChannelProfile|null} [defaultChannelProfile] App defaultChannelProfile - * @property {Object.|null} [metadata] App metadata - * @property {google.protobuf.ITimestamp|null} [createTime] App createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] App updateTime - * @property {string|null} [etag] App etag - * @property {number|null} [deploymentCount] App deploymentCount - * @property {google.cloud.ces.v1beta.IClientCertificateSettings|null} [clientCertificateSettings] App clientCertificateSettings - * @property {boolean|null} [locked] App locked - * @property {Array.|null} [evaluationPersonas] App evaluationPersonas - * @property {google.cloud.ces.v1beta.IEvaluationSettings|null} [evaluationSettings] App evaluationSettings - */ - - /** - * Constructs a new App. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an App. - * @implements IApp - * @constructor - * @param {google.cloud.ces.v1beta.IApp=} [properties] Properties to set - */ - function App(properties) { - this.variableDeclarations = []; - this.predefinedVariableDeclarations = []; - this.guardrails = []; - this.metadata = {}; - this.evaluationPersonas = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * App name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.name = ""; - - /** - * App displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.displayName = ""; - - /** - * App description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.description = ""; - - /** - * App pinned. - * @member {boolean} pinned - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.pinned = false; - - /** - * App rootAgent. - * @member {string} rootAgent - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.rootAgent = ""; - - /** - * App languageSettings. - * @member {google.cloud.ces.v1beta.ILanguageSettings|null|undefined} languageSettings - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.languageSettings = null; - - /** - * App timeZoneSettings. - * @member {google.cloud.ces.v1beta.ITimeZoneSettings|null|undefined} timeZoneSettings - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.timeZoneSettings = null; - - /** - * App audioProcessingConfig. - * @member {google.cloud.ces.v1beta.IAudioProcessingConfig|null|undefined} audioProcessingConfig - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.audioProcessingConfig = null; - - /** - * App loggingSettings. - * @member {google.cloud.ces.v1beta.ILoggingSettings|null|undefined} loggingSettings - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.loggingSettings = null; - - /** - * App errorHandlingSettings. - * @member {google.cloud.ces.v1beta.IErrorHandlingSettings|null|undefined} errorHandlingSettings - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.errorHandlingSettings = null; - - /** - * App modelSettings. - * @member {google.cloud.ces.v1beta.IModelSettings|null|undefined} modelSettings - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.modelSettings = null; - - /** - * App toolExecutionMode. - * @member {google.cloud.ces.v1beta.App.ToolExecutionMode} toolExecutionMode - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.toolExecutionMode = 0; - - /** - * App evaluationMetricsThresholds. - * @member {google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null|undefined} evaluationMetricsThresholds - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.evaluationMetricsThresholds = null; - - /** - * App variableDeclarations. - * @member {Array.} variableDeclarations - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.variableDeclarations = $util.emptyArray; - - /** - * App predefinedVariableDeclarations. - * @member {Array.} predefinedVariableDeclarations - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.predefinedVariableDeclarations = $util.emptyArray; - - /** - * App globalInstruction. - * @member {string} globalInstruction - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.globalInstruction = ""; - - /** - * App guardrails. - * @member {Array.} guardrails - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.guardrails = $util.emptyArray; - - /** - * App dataStoreSettings. - * @member {google.cloud.ces.v1beta.IDataStoreSettings|null|undefined} dataStoreSettings - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.dataStoreSettings = null; - - /** - * App defaultChannelProfile. - * @member {google.cloud.ces.v1beta.IChannelProfile|null|undefined} defaultChannelProfile - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.defaultChannelProfile = null; - - /** - * App metadata. - * @member {Object.} metadata - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.metadata = $util.emptyObject; - - /** - * App createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.createTime = null; - - /** - * App updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.updateTime = null; - - /** - * App etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.etag = ""; - - /** - * App deploymentCount. - * @member {number} deploymentCount - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.deploymentCount = 0; - - /** - * App clientCertificateSettings. - * @member {google.cloud.ces.v1beta.IClientCertificateSettings|null|undefined} clientCertificateSettings - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.clientCertificateSettings = null; - - /** - * App locked. - * @member {boolean} locked - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.locked = false; - - /** - * App evaluationPersonas. - * @member {Array.} evaluationPersonas - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.evaluationPersonas = $util.emptyArray; - - /** - * App evaluationSettings. - * @member {google.cloud.ces.v1beta.IEvaluationSettings|null|undefined} evaluationSettings - * @memberof google.cloud.ces.v1beta.App - * @instance - */ - App.prototype.evaluationSettings = null; - - /** - * Creates a new App instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.App - * @static - * @param {google.cloud.ces.v1beta.IApp=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.App} App instance - */ - App.create = function create(properties) { - return new App(properties); - }; - - /** - * Encodes the specified App message. Does not implicitly {@link google.cloud.ces.v1beta.App.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.App - * @static - * @param {google.cloud.ces.v1beta.IApp} message App message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - App.encode = function encode(message, writer) { - if (!writer) - 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.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.rootAgent != null && Object.hasOwnProperty.call(message, "rootAgent")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.rootAgent); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.audioProcessingConfig != null && Object.hasOwnProperty.call(message, "audioProcessingConfig")) - $root.google.cloud.ces.v1beta.AudioProcessingConfig.encode(message.audioProcessingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.loggingSettings != null && Object.hasOwnProperty.call(message, "loggingSettings")) - $root.google.cloud.ces.v1beta.LoggingSettings.encode(message.loggingSettings, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.guardrails != null && message.guardrails.length) - for (var i = 0; i < message.guardrails.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.guardrails[i]); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.etag); - if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) - $root.google.cloud.ces.v1beta.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.variableDeclarations != null && message.variableDeclarations.length) - for (var i = 0; i < message.variableDeclarations.length; ++i) - $root.google.cloud.ces.v1beta.App.VariableDeclaration.encode(message.variableDeclarations[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.dataStoreSettings != null && Object.hasOwnProperty.call(message, "dataStoreSettings")) - $root.google.cloud.ces.v1beta.DataStoreSettings.encode(message.dataStoreSettings, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.globalInstruction != null && Object.hasOwnProperty.call(message, "globalInstruction")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.globalInstruction); - if (message.languageSettings != null && Object.hasOwnProperty.call(message, "languageSettings")) - $root.google.cloud.ces.v1beta.LanguageSettings.encode(message.languageSettings, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.defaultChannelProfile != null && Object.hasOwnProperty.call(message, "defaultChannelProfile")) - $root.google.cloud.ces.v1beta.ChannelProfile.encode(message.defaultChannelProfile, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.deploymentCount != null && Object.hasOwnProperty.call(message, "deploymentCount")) - writer.uint32(/* id 23, wireType 0 =*/184).int32(message.deploymentCount); - if (message.evaluationMetricsThresholds != null && Object.hasOwnProperty.call(message, "evaluationMetricsThresholds")) - $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.encode(message.evaluationMetricsThresholds, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.clientCertificateSettings != null && Object.hasOwnProperty.call(message, "clientCertificateSettings")) - $root.google.cloud.ces.v1beta.ClientCertificateSettings.encode(message.clientCertificateSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.timeZoneSettings != null && Object.hasOwnProperty.call(message, "timeZoneSettings")) - $root.google.cloud.ces.v1beta.TimeZoneSettings.encode(message.timeZoneSettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.predefinedVariableDeclarations != null && message.predefinedVariableDeclarations.length) - for (var i = 0; i < message.predefinedVariableDeclarations.length; ++i) - $root.google.cloud.ces.v1beta.App.VariableDeclaration.encode(message.predefinedVariableDeclarations[i], writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) - writer.uint32(/* id 29, wireType 0 =*/232).bool(message.locked); - if (message.evaluationPersonas != null && message.evaluationPersonas.length) - for (var i = 0; i < message.evaluationPersonas.length; ++i) - $root.google.cloud.ces.v1beta.EvaluationPersona.encode(message.evaluationPersonas[i], writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); - if (message.pinned != null && Object.hasOwnProperty.call(message, "pinned")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.pinned); - if (message.toolExecutionMode != null && Object.hasOwnProperty.call(message, "toolExecutionMode")) - writer.uint32(/* id 32, wireType 0 =*/256).int32(message.toolExecutionMode); - if (message.evaluationSettings != null && Object.hasOwnProperty.call(message, "evaluationSettings")) - $root.google.cloud.ces.v1beta.EvaluationSettings.encode(message.evaluationSettings, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); - if (message.errorHandlingSettings != null && Object.hasOwnProperty.call(message, "errorHandlingSettings")) - $root.google.cloud.ces.v1beta.ErrorHandlingSettings.encode(message.errorHandlingSettings, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified App message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.App.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.App - * @static - * @param {google.cloud.ces.v1beta.IApp} message App message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - App.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an App message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.App - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.App} App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - App.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.App(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 31: { - message.pinned = reader.bool(); - break; - } - case 4: { - message.rootAgent = reader.string(); - break; - } - case 18: { - message.languageSettings = $root.google.cloud.ces.v1beta.LanguageSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.timeZoneSettings = $root.google.cloud.ces.v1beta.TimeZoneSettings.decode(reader, reader.uint32()); - break; - } - case 7: { - message.audioProcessingConfig = $root.google.cloud.ces.v1beta.AudioProcessingConfig.decode(reader, reader.uint32()); - break; - } - case 8: { - message.loggingSettings = $root.google.cloud.ces.v1beta.LoggingSettings.decode(reader, reader.uint32()); - break; - } - case 34: { - message.errorHandlingSettings = $root.google.cloud.ces.v1beta.ErrorHandlingSettings.decode(reader, reader.uint32()); - break; - } - case 13: { - message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.decode(reader, reader.uint32()); - break; - } - case 32: { - message.toolExecutionMode = reader.int32(); - break; - } - case 24: { - message.evaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.decode(reader, reader.uint32()); - break; - } - case 14: { - if (!(message.variableDeclarations && message.variableDeclarations.length)) - message.variableDeclarations = []; - message.variableDeclarations.push($root.google.cloud.ces.v1beta.App.VariableDeclaration.decode(reader, reader.uint32())); - break; - } - case 28: { - if (!(message.predefinedVariableDeclarations && message.predefinedVariableDeclarations.length)) - message.predefinedVariableDeclarations = []; - message.predefinedVariableDeclarations.push($root.google.cloud.ces.v1beta.App.VariableDeclaration.decode(reader, reader.uint32())); - break; - } - case 17: { - message.globalInstruction = reader.string(); - break; - } - case 10: { - if (!(message.guardrails && message.guardrails.length)) - message.guardrails = []; - message.guardrails.push(reader.string()); - break; - } - case 15: { - message.dataStoreSettings = $root.google.cloud.ces.v1beta.DataStoreSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.defaultChannelProfile = $root.google.cloud.ces.v1beta.ChannelProfile.decode(reader, reader.uint32()); - break; - } - case 11: { - if (message.metadata === $util.emptyObject) - message.metadata = {}; - 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.metadata[key] = value; - break; - } - case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 12: { - message.etag = reader.string(); - break; - } - case 23: { - message.deploymentCount = reader.int32(); - break; - } - case 25: { - message.clientCertificateSettings = $root.google.cloud.ces.v1beta.ClientCertificateSettings.decode(reader, reader.uint32()); - break; - } - case 29: { - message.locked = reader.bool(); - break; - } - case 30: { - if (!(message.evaluationPersonas && message.evaluationPersonas.length)) - message.evaluationPersonas = []; - message.evaluationPersonas.push($root.google.cloud.ces.v1beta.EvaluationPersona.decode(reader, reader.uint32())); - break; - } - case 33: { - message.evaluationSettings = $root.google.cloud.ces.v1beta.EvaluationSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an App message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.App - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.App} App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - App.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an App message. - * @function verify - * @memberof google.cloud.ces.v1beta.App - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - App.verify = function verify(message) { - if (typeof message !== "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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.pinned != null && message.hasOwnProperty("pinned")) - if (typeof message.pinned !== "boolean") - return "pinned: boolean expected"; - if (message.rootAgent != null && message.hasOwnProperty("rootAgent")) - if (!$util.isString(message.rootAgent)) - return "rootAgent: string expected"; - if (message.languageSettings != null && message.hasOwnProperty("languageSettings")) { - var error = $root.google.cloud.ces.v1beta.LanguageSettings.verify(message.languageSettings); - if (error) - return "languageSettings." + error; - } - if (message.timeZoneSettings != null && message.hasOwnProperty("timeZoneSettings")) { - var error = $root.google.cloud.ces.v1beta.TimeZoneSettings.verify(message.timeZoneSettings); - if (error) - return "timeZoneSettings." + error; - } - if (message.audioProcessingConfig != null && message.hasOwnProperty("audioProcessingConfig")) { - var error = $root.google.cloud.ces.v1beta.AudioProcessingConfig.verify(message.audioProcessingConfig); - if (error) - return "audioProcessingConfig." + error; - } - if (message.loggingSettings != null && message.hasOwnProperty("loggingSettings")) { - var error = $root.google.cloud.ces.v1beta.LoggingSettings.verify(message.loggingSettings); - if (error) - return "loggingSettings." + error; - } - if (message.errorHandlingSettings != null && message.hasOwnProperty("errorHandlingSettings")) { - var error = $root.google.cloud.ces.v1beta.ErrorHandlingSettings.verify(message.errorHandlingSettings); - if (error) - return "errorHandlingSettings." + error; - } - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { - var error = $root.google.cloud.ces.v1beta.ModelSettings.verify(message.modelSettings); - if (error) - return "modelSettings." + error; - } - if (message.toolExecutionMode != null && message.hasOwnProperty("toolExecutionMode")) - switch (message.toolExecutionMode) { - default: - return "toolExecutionMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.evaluationMetricsThresholds != null && message.hasOwnProperty("evaluationMetricsThresholds")) { - var error = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.verify(message.evaluationMetricsThresholds); - if (error) - return "evaluationMetricsThresholds." + error; - } - if (message.variableDeclarations != null && message.hasOwnProperty("variableDeclarations")) { - if (!Array.isArray(message.variableDeclarations)) - return "variableDeclarations: array expected"; - for (var i = 0; i < message.variableDeclarations.length; ++i) { - var error = $root.google.cloud.ces.v1beta.App.VariableDeclaration.verify(message.variableDeclarations[i]); - if (error) - return "variableDeclarations." + error; - } - } - if (message.predefinedVariableDeclarations != null && message.hasOwnProperty("predefinedVariableDeclarations")) { - if (!Array.isArray(message.predefinedVariableDeclarations)) - return "predefinedVariableDeclarations: array expected"; - for (var i = 0; i < message.predefinedVariableDeclarations.length; ++i) { - var error = $root.google.cloud.ces.v1beta.App.VariableDeclaration.verify(message.predefinedVariableDeclarations[i]); - if (error) - return "predefinedVariableDeclarations." + error; - } - } - if (message.globalInstruction != null && message.hasOwnProperty("globalInstruction")) - if (!$util.isString(message.globalInstruction)) - return "globalInstruction: string expected"; - if (message.guardrails != null && message.hasOwnProperty("guardrails")) { - if (!Array.isArray(message.guardrails)) - return "guardrails: array expected"; - for (var i = 0; i < message.guardrails.length; ++i) - if (!$util.isString(message.guardrails[i])) - return "guardrails: string[] expected"; - } - if (message.dataStoreSettings != null && message.hasOwnProperty("dataStoreSettings")) { - var error = $root.google.cloud.ces.v1beta.DataStoreSettings.verify(message.dataStoreSettings); - if (error) - return "dataStoreSettings." + error; - } - if (message.defaultChannelProfile != null && message.hasOwnProperty("defaultChannelProfile")) { - var error = $root.google.cloud.ces.v1beta.ChannelProfile.verify(message.defaultChannelProfile); - if (error) - return "defaultChannelProfile." + error; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - if (!$util.isObject(message.metadata)) - return "metadata: object expected"; - var key = Object.keys(message.metadata); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.metadata[key[i]])) - return "metadata: string{k: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.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.deploymentCount != null && message.hasOwnProperty("deploymentCount")) - if (!$util.isInteger(message.deploymentCount)) - return "deploymentCount: integer expected"; - if (message.clientCertificateSettings != null && message.hasOwnProperty("clientCertificateSettings")) { - var error = $root.google.cloud.ces.v1beta.ClientCertificateSettings.verify(message.clientCertificateSettings); - if (error) - return "clientCertificateSettings." + error; - } - if (message.locked != null && message.hasOwnProperty("locked")) - if (typeof message.locked !== "boolean") - return "locked: boolean expected"; - if (message.evaluationPersonas != null && message.hasOwnProperty("evaluationPersonas")) { - if (!Array.isArray(message.evaluationPersonas)) - return "evaluationPersonas: array expected"; - for (var i = 0; i < message.evaluationPersonas.length; ++i) { - var error = $root.google.cloud.ces.v1beta.EvaluationPersona.verify(message.evaluationPersonas[i]); - if (error) - return "evaluationPersonas." + error; - } - } - if (message.evaluationSettings != null && message.hasOwnProperty("evaluationSettings")) { - var error = $root.google.cloud.ces.v1beta.EvaluationSettings.verify(message.evaluationSettings); - if (error) - return "evaluationSettings." + error; - } - return null; - }; - - /** - * Creates an App message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.App - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.App} App - */ - App.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.App) - return object; - var message = new $root.google.cloud.ces.v1beta.App(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.pinned != null) - message.pinned = Boolean(object.pinned); - if (object.rootAgent != null) - message.rootAgent = String(object.rootAgent); - if (object.languageSettings != null) { - if (typeof object.languageSettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.App.languageSettings: object expected"); - message.languageSettings = $root.google.cloud.ces.v1beta.LanguageSettings.fromObject(object.languageSettings); - } - if (object.timeZoneSettings != null) { - if (typeof object.timeZoneSettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.App.timeZoneSettings: object expected"); - message.timeZoneSettings = $root.google.cloud.ces.v1beta.TimeZoneSettings.fromObject(object.timeZoneSettings); - } - if (object.audioProcessingConfig != null) { - if (typeof object.audioProcessingConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.App.audioProcessingConfig: object expected"); - message.audioProcessingConfig = $root.google.cloud.ces.v1beta.AudioProcessingConfig.fromObject(object.audioProcessingConfig); - } - if (object.loggingSettings != null) { - if (typeof object.loggingSettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.App.loggingSettings: object expected"); - message.loggingSettings = $root.google.cloud.ces.v1beta.LoggingSettings.fromObject(object.loggingSettings); - } - if (object.errorHandlingSettings != null) { - if (typeof object.errorHandlingSettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.App.errorHandlingSettings: object expected"); - message.errorHandlingSettings = $root.google.cloud.ces.v1beta.ErrorHandlingSettings.fromObject(object.errorHandlingSettings); - } - if (object.modelSettings != null) { - if (typeof object.modelSettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.App.modelSettings: object expected"); - message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.fromObject(object.modelSettings); - } - switch (object.toolExecutionMode) { - default: - if (typeof object.toolExecutionMode === "number") { - message.toolExecutionMode = object.toolExecutionMode; - break; - } - break; - case "TOOL_EXECUTION_MODE_UNSPECIFIED": - case 0: - message.toolExecutionMode = 0; - break; - case "PARALLEL": - case 1: - message.toolExecutionMode = 1; - break; - case "SEQUENTIAL": - case 2: - message.toolExecutionMode = 2; - break; - } - if (object.evaluationMetricsThresholds != null) { - if (typeof object.evaluationMetricsThresholds !== "object") - throw TypeError(".google.cloud.ces.v1beta.App.evaluationMetricsThresholds: object expected"); - message.evaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.fromObject(object.evaluationMetricsThresholds); - } - if (object.variableDeclarations) { - if (!Array.isArray(object.variableDeclarations)) - throw TypeError(".google.cloud.ces.v1beta.App.variableDeclarations: array expected"); - message.variableDeclarations = []; - for (var i = 0; i < object.variableDeclarations.length; ++i) { - if (typeof object.variableDeclarations[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.App.variableDeclarations: object expected"); - message.variableDeclarations[i] = $root.google.cloud.ces.v1beta.App.VariableDeclaration.fromObject(object.variableDeclarations[i]); - } - } - if (object.predefinedVariableDeclarations) { - if (!Array.isArray(object.predefinedVariableDeclarations)) - throw TypeError(".google.cloud.ces.v1beta.App.predefinedVariableDeclarations: array expected"); - message.predefinedVariableDeclarations = []; - for (var i = 0; i < object.predefinedVariableDeclarations.length; ++i) { - if (typeof object.predefinedVariableDeclarations[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.App.predefinedVariableDeclarations: object expected"); - message.predefinedVariableDeclarations[i] = $root.google.cloud.ces.v1beta.App.VariableDeclaration.fromObject(object.predefinedVariableDeclarations[i]); - } - } - if (object.globalInstruction != null) - message.globalInstruction = String(object.globalInstruction); - if (object.guardrails) { - if (!Array.isArray(object.guardrails)) - throw TypeError(".google.cloud.ces.v1beta.App.guardrails: array expected"); - message.guardrails = []; - for (var i = 0; i < object.guardrails.length; ++i) - message.guardrails[i] = String(object.guardrails[i]); - } - if (object.dataStoreSettings != null) { - if (typeof object.dataStoreSettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.App.dataStoreSettings: object expected"); - message.dataStoreSettings = $root.google.cloud.ces.v1beta.DataStoreSettings.fromObject(object.dataStoreSettings); - } - if (object.defaultChannelProfile != null) { - if (typeof object.defaultChannelProfile !== "object") - throw TypeError(".google.cloud.ces.v1beta.App.defaultChannelProfile: object expected"); - message.defaultChannelProfile = $root.google.cloud.ces.v1beta.ChannelProfile.fromObject(object.defaultChannelProfile); - } - if (object.metadata) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.ces.v1beta.App.metadata: object expected"); - message.metadata = {}; - for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) - message.metadata[keys[i]] = String(object.metadata[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.App.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.ces.v1beta.App.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.deploymentCount != null) - message.deploymentCount = object.deploymentCount | 0; - if (object.clientCertificateSettings != null) { - if (typeof object.clientCertificateSettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.App.clientCertificateSettings: object expected"); - message.clientCertificateSettings = $root.google.cloud.ces.v1beta.ClientCertificateSettings.fromObject(object.clientCertificateSettings); - } - if (object.locked != null) - message.locked = Boolean(object.locked); - if (object.evaluationPersonas) { - if (!Array.isArray(object.evaluationPersonas)) - throw TypeError(".google.cloud.ces.v1beta.App.evaluationPersonas: array expected"); - message.evaluationPersonas = []; - for (var i = 0; i < object.evaluationPersonas.length; ++i) { - if (typeof object.evaluationPersonas[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.App.evaluationPersonas: object expected"); - message.evaluationPersonas[i] = $root.google.cloud.ces.v1beta.EvaluationPersona.fromObject(object.evaluationPersonas[i]); - } - } - if (object.evaluationSettings != null) { - if (typeof object.evaluationSettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.App.evaluationSettings: object expected"); - message.evaluationSettings = $root.google.cloud.ces.v1beta.EvaluationSettings.fromObject(object.evaluationSettings); - } - return message; - }; - - /** - * Creates a plain object from an App message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.App - * @static - * @param {google.cloud.ces.v1beta.App} message App - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - App.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.guardrails = []; - object.variableDeclarations = []; - object.predefinedVariableDeclarations = []; - object.evaluationPersonas = []; - } - if (options.objects || options.defaults) - object.metadata = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.rootAgent = ""; - object.createTime = null; - object.updateTime = null; - object.audioProcessingConfig = null; - object.loggingSettings = null; - object.etag = ""; - object.modelSettings = null; - object.dataStoreSettings = null; - object.globalInstruction = ""; - object.languageSettings = null; - object.defaultChannelProfile = null; - object.deploymentCount = 0; - object.evaluationMetricsThresholds = null; - object.clientCertificateSettings = null; - object.timeZoneSettings = null; - object.locked = false; - object.pinned = false; - object.toolExecutionMode = options.enums === String ? "TOOL_EXECUTION_MODE_UNSPECIFIED" : 0; - object.evaluationSettings = null; - object.errorHandlingSettings = 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.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.rootAgent != null && message.hasOwnProperty("rootAgent")) - object.rootAgent = message.rootAgent; - 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.audioProcessingConfig != null && message.hasOwnProperty("audioProcessingConfig")) - object.audioProcessingConfig = $root.google.cloud.ces.v1beta.AudioProcessingConfig.toObject(message.audioProcessingConfig, options); - if (message.loggingSettings != null && message.hasOwnProperty("loggingSettings")) - object.loggingSettings = $root.google.cloud.ces.v1beta.LoggingSettings.toObject(message.loggingSettings, options); - if (message.guardrails && message.guardrails.length) { - object.guardrails = []; - for (var j = 0; j < message.guardrails.length; ++j) - object.guardrails[j] = message.guardrails[j]; - } - var keys2; - if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { - object.metadata = {}; - for (var j = 0; j < keys2.length; ++j) - object.metadata[keys2[j]] = message.metadata[keys2[j]]; - } - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) - object.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.toObject(message.modelSettings, options); - if (message.variableDeclarations && message.variableDeclarations.length) { - object.variableDeclarations = []; - for (var j = 0; j < message.variableDeclarations.length; ++j) - object.variableDeclarations[j] = $root.google.cloud.ces.v1beta.App.VariableDeclaration.toObject(message.variableDeclarations[j], options); - } - if (message.dataStoreSettings != null && message.hasOwnProperty("dataStoreSettings")) - object.dataStoreSettings = $root.google.cloud.ces.v1beta.DataStoreSettings.toObject(message.dataStoreSettings, options); - if (message.globalInstruction != null && message.hasOwnProperty("globalInstruction")) - object.globalInstruction = message.globalInstruction; - if (message.languageSettings != null && message.hasOwnProperty("languageSettings")) - object.languageSettings = $root.google.cloud.ces.v1beta.LanguageSettings.toObject(message.languageSettings, options); - if (message.defaultChannelProfile != null && message.hasOwnProperty("defaultChannelProfile")) - object.defaultChannelProfile = $root.google.cloud.ces.v1beta.ChannelProfile.toObject(message.defaultChannelProfile, options); - if (message.deploymentCount != null && message.hasOwnProperty("deploymentCount")) - object.deploymentCount = message.deploymentCount; - if (message.evaluationMetricsThresholds != null && message.hasOwnProperty("evaluationMetricsThresholds")) - object.evaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.toObject(message.evaluationMetricsThresholds, options); - if (message.clientCertificateSettings != null && message.hasOwnProperty("clientCertificateSettings")) - object.clientCertificateSettings = $root.google.cloud.ces.v1beta.ClientCertificateSettings.toObject(message.clientCertificateSettings, options); - if (message.timeZoneSettings != null && message.hasOwnProperty("timeZoneSettings")) - object.timeZoneSettings = $root.google.cloud.ces.v1beta.TimeZoneSettings.toObject(message.timeZoneSettings, options); - if (message.predefinedVariableDeclarations && message.predefinedVariableDeclarations.length) { - object.predefinedVariableDeclarations = []; - for (var j = 0; j < message.predefinedVariableDeclarations.length; ++j) - object.predefinedVariableDeclarations[j] = $root.google.cloud.ces.v1beta.App.VariableDeclaration.toObject(message.predefinedVariableDeclarations[j], options); - } - if (message.locked != null && message.hasOwnProperty("locked")) - object.locked = message.locked; - if (message.evaluationPersonas && message.evaluationPersonas.length) { - object.evaluationPersonas = []; - for (var j = 0; j < message.evaluationPersonas.length; ++j) - object.evaluationPersonas[j] = $root.google.cloud.ces.v1beta.EvaluationPersona.toObject(message.evaluationPersonas[j], options); - } - if (message.pinned != null && message.hasOwnProperty("pinned")) - object.pinned = message.pinned; - if (message.toolExecutionMode != null && message.hasOwnProperty("toolExecutionMode")) - object.toolExecutionMode = options.enums === String ? $root.google.cloud.ces.v1beta.App.ToolExecutionMode[message.toolExecutionMode] === undefined ? message.toolExecutionMode : $root.google.cloud.ces.v1beta.App.ToolExecutionMode[message.toolExecutionMode] : message.toolExecutionMode; - if (message.evaluationSettings != null && message.hasOwnProperty("evaluationSettings")) - object.evaluationSettings = $root.google.cloud.ces.v1beta.EvaluationSettings.toObject(message.evaluationSettings, options); - if (message.errorHandlingSettings != null && message.hasOwnProperty("errorHandlingSettings")) - object.errorHandlingSettings = $root.google.cloud.ces.v1beta.ErrorHandlingSettings.toObject(message.errorHandlingSettings, options); - return object; - }; - - /** - * Converts this App to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.App - * @instance - * @returns {Object.} JSON object - */ - App.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for App - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.App - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - App.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.App"; - }; - - App.VariableDeclaration = (function() { - - /** - * Properties of a VariableDeclaration. - * @memberof google.cloud.ces.v1beta.App - * @interface IVariableDeclaration - * @property {string|null} [name] VariableDeclaration name - * @property {string|null} [description] VariableDeclaration description - * @property {google.cloud.ces.v1beta.ISchema|null} [schema] VariableDeclaration schema - */ - - /** - * Constructs a new VariableDeclaration. - * @memberof google.cloud.ces.v1beta.App - * @classdesc Represents a VariableDeclaration. - * @implements IVariableDeclaration - * @constructor - * @param {google.cloud.ces.v1beta.App.IVariableDeclaration=} [properties] Properties to set - */ - function VariableDeclaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VariableDeclaration name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.App.VariableDeclaration - * @instance - */ - VariableDeclaration.prototype.name = ""; - - /** - * VariableDeclaration description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.App.VariableDeclaration - * @instance - */ - VariableDeclaration.prototype.description = ""; - - /** - * VariableDeclaration schema. - * @member {google.cloud.ces.v1beta.ISchema|null|undefined} schema - * @memberof google.cloud.ces.v1beta.App.VariableDeclaration - * @instance - */ - VariableDeclaration.prototype.schema = null; - - /** - * Creates a new VariableDeclaration instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.App.VariableDeclaration - * @static - * @param {google.cloud.ces.v1beta.App.IVariableDeclaration=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.App.VariableDeclaration} VariableDeclaration instance - */ - VariableDeclaration.create = function create(properties) { - return new VariableDeclaration(properties); - }; - - /** - * Encodes the specified VariableDeclaration message. Does not implicitly {@link google.cloud.ces.v1beta.App.VariableDeclaration.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.App.VariableDeclaration - * @static - * @param {google.cloud.ces.v1beta.App.IVariableDeclaration} message VariableDeclaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VariableDeclaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) - $root.google.cloud.ces.v1beta.Schema.encode(message.schema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified VariableDeclaration message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.App.VariableDeclaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.App.VariableDeclaration - * @static - * @param {google.cloud.ces.v1beta.App.IVariableDeclaration} message VariableDeclaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VariableDeclaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VariableDeclaration message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.App.VariableDeclaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.App.VariableDeclaration} VariableDeclaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VariableDeclaration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.App.VariableDeclaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - message.schema = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VariableDeclaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.App.VariableDeclaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.App.VariableDeclaration} VariableDeclaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VariableDeclaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VariableDeclaration message. - * @function verify - * @memberof google.cloud.ces.v1beta.App.VariableDeclaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VariableDeclaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.schema != null && message.hasOwnProperty("schema")) { - var error = $root.google.cloud.ces.v1beta.Schema.verify(message.schema); - if (error) - return "schema." + error; - } - return null; - }; - - /** - * Creates a VariableDeclaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.App.VariableDeclaration - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.App.VariableDeclaration} VariableDeclaration - */ - VariableDeclaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.App.VariableDeclaration) - return object; - var message = new $root.google.cloud.ces.v1beta.App.VariableDeclaration(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.schema != null) { - if (typeof object.schema !== "object") - throw TypeError(".google.cloud.ces.v1beta.App.VariableDeclaration.schema: object expected"); - message.schema = $root.google.cloud.ces.v1beta.Schema.fromObject(object.schema); - } - return message; - }; - - /** - * Creates a plain object from a VariableDeclaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.App.VariableDeclaration - * @static - * @param {google.cloud.ces.v1beta.App.VariableDeclaration} message VariableDeclaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VariableDeclaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.schema = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.schema != null && message.hasOwnProperty("schema")) - object.schema = $root.google.cloud.ces.v1beta.Schema.toObject(message.schema, options); - return object; - }; - - /** - * Converts this VariableDeclaration to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.App.VariableDeclaration - * @instance - * @returns {Object.} JSON object - */ - VariableDeclaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for VariableDeclaration - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.App.VariableDeclaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - VariableDeclaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.App.VariableDeclaration"; - }; - - return VariableDeclaration; - })(); - - /** - * ToolExecutionMode enum. - * @name google.cloud.ces.v1beta.App.ToolExecutionMode - * @enum {number} - * @property {number} TOOL_EXECUTION_MODE_UNSPECIFIED=0 TOOL_EXECUTION_MODE_UNSPECIFIED value - * @property {number} PARALLEL=1 PARALLEL value - * @property {number} SEQUENTIAL=2 SEQUENTIAL value - */ - App.ToolExecutionMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TOOL_EXECUTION_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PARALLEL"] = 1; - values[valuesById[2] = "SEQUENTIAL"] = 2; - return values; - })(); - - return App; - })(); - - v1beta.TimeZoneSettings = (function() { - - /** - * Properties of a TimeZoneSettings. - * @memberof google.cloud.ces.v1beta - * @interface ITimeZoneSettings - * @property {string|null} [timeZone] TimeZoneSettings timeZone - */ - - /** - * Constructs a new TimeZoneSettings. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a TimeZoneSettings. - * @implements ITimeZoneSettings - * @constructor - * @param {google.cloud.ces.v1beta.ITimeZoneSettings=} [properties] Properties to set - */ - function TimeZoneSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TimeZoneSettings timeZone. - * @member {string} timeZone - * @memberof google.cloud.ces.v1beta.TimeZoneSettings - * @instance - */ - TimeZoneSettings.prototype.timeZone = ""; - - /** - * Creates a new TimeZoneSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.TimeZoneSettings - * @static - * @param {google.cloud.ces.v1beta.ITimeZoneSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.TimeZoneSettings} TimeZoneSettings instance - */ - TimeZoneSettings.create = function create(properties) { - return new TimeZoneSettings(properties); - }; - - /** - * Encodes the specified TimeZoneSettings message. Does not implicitly {@link google.cloud.ces.v1beta.TimeZoneSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.TimeZoneSettings - * @static - * @param {google.cloud.ces.v1beta.ITimeZoneSettings} message TimeZoneSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeZoneSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.timeZone); - return writer; - }; - - /** - * Encodes the specified TimeZoneSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TimeZoneSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.TimeZoneSettings - * @static - * @param {google.cloud.ces.v1beta.ITimeZoneSettings} message TimeZoneSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeZoneSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TimeZoneSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.TimeZoneSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.TimeZoneSettings} TimeZoneSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeZoneSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TimeZoneSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.timeZone = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TimeZoneSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.TimeZoneSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.TimeZoneSettings} TimeZoneSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeZoneSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TimeZoneSettings message. - * @function verify - * @memberof google.cloud.ces.v1beta.TimeZoneSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimeZoneSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - if (!$util.isString(message.timeZone)) - return "timeZone: string expected"; - return null; - }; - - /** - * Creates a TimeZoneSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.TimeZoneSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.TimeZoneSettings} TimeZoneSettings - */ - TimeZoneSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.TimeZoneSettings) - return object; - var message = new $root.google.cloud.ces.v1beta.TimeZoneSettings(); - if (object.timeZone != null) - message.timeZone = String(object.timeZone); - return message; - }; - - /** - * Creates a plain object from a TimeZoneSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.TimeZoneSettings - * @static - * @param {google.cloud.ces.v1beta.TimeZoneSettings} message TimeZoneSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimeZoneSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.timeZone = ""; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - object.timeZone = message.timeZone; - return object; - }; - - /** - * Converts this TimeZoneSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.TimeZoneSettings - * @instance - * @returns {Object.} JSON object - */ - TimeZoneSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TimeZoneSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.TimeZoneSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TimeZoneSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.TimeZoneSettings"; - }; - - return TimeZoneSettings; - })(); - - v1beta.LanguageSettings = (function() { - - /** - * Properties of a LanguageSettings. - * @memberof google.cloud.ces.v1beta - * @interface ILanguageSettings - * @property {string|null} [defaultLanguageCode] LanguageSettings defaultLanguageCode - * @property {Array.|null} [supportedLanguageCodes] LanguageSettings supportedLanguageCodes - * @property {boolean|null} [enableMultilingualSupport] LanguageSettings enableMultilingualSupport - * @property {string|null} [fallbackAction] LanguageSettings fallbackAction - */ - - /** - * Constructs a new LanguageSettings. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a LanguageSettings. - * @implements ILanguageSettings - * @constructor - * @param {google.cloud.ces.v1beta.ILanguageSettings=} [properties] Properties to set - */ - function LanguageSettings(properties) { - this.supportedLanguageCodes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LanguageSettings defaultLanguageCode. - * @member {string} defaultLanguageCode - * @memberof google.cloud.ces.v1beta.LanguageSettings - * @instance - */ - LanguageSettings.prototype.defaultLanguageCode = ""; - - /** - * LanguageSettings supportedLanguageCodes. - * @member {Array.} supportedLanguageCodes - * @memberof google.cloud.ces.v1beta.LanguageSettings - * @instance - */ - LanguageSettings.prototype.supportedLanguageCodes = $util.emptyArray; - - /** - * LanguageSettings enableMultilingualSupport. - * @member {boolean} enableMultilingualSupport - * @memberof google.cloud.ces.v1beta.LanguageSettings - * @instance - */ - LanguageSettings.prototype.enableMultilingualSupport = false; - - /** - * LanguageSettings fallbackAction. - * @member {string} fallbackAction - * @memberof google.cloud.ces.v1beta.LanguageSettings - * @instance - */ - LanguageSettings.prototype.fallbackAction = ""; - - /** - * Creates a new LanguageSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.LanguageSettings - * @static - * @param {google.cloud.ces.v1beta.ILanguageSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.LanguageSettings} LanguageSettings instance - */ - LanguageSettings.create = function create(properties) { - return new LanguageSettings(properties); - }; - - /** - * Encodes the specified LanguageSettings message. Does not implicitly {@link google.cloud.ces.v1beta.LanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.LanguageSettings - * @static - * @param {google.cloud.ces.v1beta.ILanguageSettings} message LanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaultLanguageCode != null && Object.hasOwnProperty.call(message, "defaultLanguageCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.defaultLanguageCode); - if (message.supportedLanguageCodes != null && message.supportedLanguageCodes.length) - for (var i = 0; i < message.supportedLanguageCodes.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.supportedLanguageCodes[i]); - if (message.enableMultilingualSupport != null && Object.hasOwnProperty.call(message, "enableMultilingualSupport")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableMultilingualSupport); - if (message.fallbackAction != null && Object.hasOwnProperty.call(message, "fallbackAction")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.fallbackAction); - return writer; - }; - - /** - * Encodes the specified LanguageSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.LanguageSettings - * @static - * @param {google.cloud.ces.v1beta.ILanguageSettings} message LanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.LanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.LanguageSettings} LanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LanguageSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.defaultLanguageCode = reader.string(); - break; - } - case 2: { - if (!(message.supportedLanguageCodes && message.supportedLanguageCodes.length)) - message.supportedLanguageCodes = []; - message.supportedLanguageCodes.push(reader.string()); - break; - } - case 3: { - message.enableMultilingualSupport = reader.bool(); - break; - } - case 4: { - message.fallbackAction = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.LanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.LanguageSettings} LanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LanguageSettings message. - * @function verify - * @memberof google.cloud.ces.v1beta.LanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaultLanguageCode != null && message.hasOwnProperty("defaultLanguageCode")) - if (!$util.isString(message.defaultLanguageCode)) - return "defaultLanguageCode: string expected"; - if (message.supportedLanguageCodes != null && message.hasOwnProperty("supportedLanguageCodes")) { - if (!Array.isArray(message.supportedLanguageCodes)) - return "supportedLanguageCodes: array expected"; - for (var i = 0; i < message.supportedLanguageCodes.length; ++i) - if (!$util.isString(message.supportedLanguageCodes[i])) - return "supportedLanguageCodes: string[] expected"; - } - if (message.enableMultilingualSupport != null && message.hasOwnProperty("enableMultilingualSupport")) - if (typeof message.enableMultilingualSupport !== "boolean") - return "enableMultilingualSupport: boolean expected"; - if (message.fallbackAction != null && message.hasOwnProperty("fallbackAction")) - if (!$util.isString(message.fallbackAction)) - return "fallbackAction: string expected"; - return null; - }; - - /** - * Creates a LanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.LanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.LanguageSettings} LanguageSettings - */ - LanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.LanguageSettings) - return object; - var message = new $root.google.cloud.ces.v1beta.LanguageSettings(); - if (object.defaultLanguageCode != null) - message.defaultLanguageCode = String(object.defaultLanguageCode); - if (object.supportedLanguageCodes) { - if (!Array.isArray(object.supportedLanguageCodes)) - throw TypeError(".google.cloud.ces.v1beta.LanguageSettings.supportedLanguageCodes: array expected"); - message.supportedLanguageCodes = []; - for (var i = 0; i < object.supportedLanguageCodes.length; ++i) - message.supportedLanguageCodes[i] = String(object.supportedLanguageCodes[i]); - } - if (object.enableMultilingualSupport != null) - message.enableMultilingualSupport = Boolean(object.enableMultilingualSupport); - if (object.fallbackAction != null) - message.fallbackAction = String(object.fallbackAction); - return message; - }; - - /** - * Creates a plain object from a LanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.LanguageSettings - * @static - * @param {google.cloud.ces.v1beta.LanguageSettings} message LanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.supportedLanguageCodes = []; - if (options.defaults) { - object.defaultLanguageCode = ""; - object.enableMultilingualSupport = false; - object.fallbackAction = ""; - } - if (message.defaultLanguageCode != null && message.hasOwnProperty("defaultLanguageCode")) - object.defaultLanguageCode = message.defaultLanguageCode; - if (message.supportedLanguageCodes && message.supportedLanguageCodes.length) { - object.supportedLanguageCodes = []; - for (var j = 0; j < message.supportedLanguageCodes.length; ++j) - object.supportedLanguageCodes[j] = message.supportedLanguageCodes[j]; - } - if (message.enableMultilingualSupport != null && message.hasOwnProperty("enableMultilingualSupport")) - object.enableMultilingualSupport = message.enableMultilingualSupport; - if (message.fallbackAction != null && message.hasOwnProperty("fallbackAction")) - object.fallbackAction = message.fallbackAction; - return object; - }; - - /** - * Converts this LanguageSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.LanguageSettings - * @instance - * @returns {Object.} JSON object - */ - LanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LanguageSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.LanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.LanguageSettings"; - }; - - return LanguageSettings; - })(); - - v1beta.AudioProcessingConfig = (function() { - - /** - * Properties of an AudioProcessingConfig. - * @memberof google.cloud.ces.v1beta - * @interface IAudioProcessingConfig - * @property {Object.|null} [synthesizeSpeechConfigs] AudioProcessingConfig synthesizeSpeechConfigs - * @property {google.cloud.ces.v1beta.IBargeInConfig|null} [bargeInConfig] AudioProcessingConfig bargeInConfig - * @property {google.protobuf.IDuration|null} [inactivityTimeout] AudioProcessingConfig inactivityTimeout - * @property {google.cloud.ces.v1beta.IAmbientSoundConfig|null} [ambientSoundConfig] AudioProcessingConfig ambientSoundConfig - */ - - /** - * Constructs a new AudioProcessingConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an AudioProcessingConfig. - * @implements IAudioProcessingConfig - * @constructor - * @param {google.cloud.ces.v1beta.IAudioProcessingConfig=} [properties] Properties to set - */ - function AudioProcessingConfig(properties) { - this.synthesizeSpeechConfigs = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AudioProcessingConfig synthesizeSpeechConfigs. - * @member {Object.} synthesizeSpeechConfigs - * @memberof google.cloud.ces.v1beta.AudioProcessingConfig - * @instance - */ - AudioProcessingConfig.prototype.synthesizeSpeechConfigs = $util.emptyObject; - - /** - * AudioProcessingConfig bargeInConfig. - * @member {google.cloud.ces.v1beta.IBargeInConfig|null|undefined} bargeInConfig - * @memberof google.cloud.ces.v1beta.AudioProcessingConfig - * @instance - */ - AudioProcessingConfig.prototype.bargeInConfig = null; - - /** - * AudioProcessingConfig inactivityTimeout. - * @member {google.protobuf.IDuration|null|undefined} inactivityTimeout - * @memberof google.cloud.ces.v1beta.AudioProcessingConfig - * @instance - */ - AudioProcessingConfig.prototype.inactivityTimeout = null; - - /** - * AudioProcessingConfig ambientSoundConfig. - * @member {google.cloud.ces.v1beta.IAmbientSoundConfig|null|undefined} ambientSoundConfig - * @memberof google.cloud.ces.v1beta.AudioProcessingConfig - * @instance - */ - AudioProcessingConfig.prototype.ambientSoundConfig = null; - - /** - * Creates a new AudioProcessingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.AudioProcessingConfig - * @static - * @param {google.cloud.ces.v1beta.IAudioProcessingConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.AudioProcessingConfig} AudioProcessingConfig instance - */ - AudioProcessingConfig.create = function create(properties) { - return new AudioProcessingConfig(properties); - }; - - /** - * Encodes the specified AudioProcessingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.AudioProcessingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.AudioProcessingConfig - * @static - * @param {google.cloud.ces.v1beta.IAudioProcessingConfig} message AudioProcessingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AudioProcessingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.synthesizeSpeechConfigs != null && Object.hasOwnProperty.call(message, "synthesizeSpeechConfigs")) - for (var keys = Object.keys(message.synthesizeSpeechConfigs), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig.encode(message.synthesizeSpeechConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.bargeInConfig != null && Object.hasOwnProperty.call(message, "bargeInConfig")) - $root.google.cloud.ces.v1beta.BargeInConfig.encode(message.bargeInConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.inactivityTimeout != null && Object.hasOwnProperty.call(message, "inactivityTimeout")) - $root.google.protobuf.Duration.encode(message.inactivityTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.ambientSoundConfig != null && Object.hasOwnProperty.call(message, "ambientSoundConfig")) - $root.google.cloud.ces.v1beta.AmbientSoundConfig.encode(message.ambientSoundConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AudioProcessingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AudioProcessingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.AudioProcessingConfig - * @static - * @param {google.cloud.ces.v1beta.IAudioProcessingConfig} message AudioProcessingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AudioProcessingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AudioProcessingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.AudioProcessingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.AudioProcessingConfig} AudioProcessingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AudioProcessingConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AudioProcessingConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.synthesizeSpeechConfigs === $util.emptyObject) - message.synthesizeSpeechConfigs = {}; - 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.ces.v1beta.SynthesizeSpeechConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.synthesizeSpeechConfigs[key] = value; - break; - } - case 3: { - message.bargeInConfig = $root.google.cloud.ces.v1beta.BargeInConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.inactivityTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.ambientSoundConfig = $root.google.cloud.ces.v1beta.AmbientSoundConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AudioProcessingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.AudioProcessingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.AudioProcessingConfig} AudioProcessingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AudioProcessingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AudioProcessingConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.AudioProcessingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AudioProcessingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.synthesizeSpeechConfigs != null && message.hasOwnProperty("synthesizeSpeechConfigs")) { - if (!$util.isObject(message.synthesizeSpeechConfigs)) - return "synthesizeSpeechConfigs: object expected"; - var key = Object.keys(message.synthesizeSpeechConfigs); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig.verify(message.synthesizeSpeechConfigs[key[i]]); - if (error) - return "synthesizeSpeechConfigs." + error; - } - } - if (message.bargeInConfig != null && message.hasOwnProperty("bargeInConfig")) { - var error = $root.google.cloud.ces.v1beta.BargeInConfig.verify(message.bargeInConfig); - if (error) - return "bargeInConfig." + error; - } - if (message.inactivityTimeout != null && message.hasOwnProperty("inactivityTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.inactivityTimeout); - if (error) - return "inactivityTimeout." + error; - } - if (message.ambientSoundConfig != null && message.hasOwnProperty("ambientSoundConfig")) { - var error = $root.google.cloud.ces.v1beta.AmbientSoundConfig.verify(message.ambientSoundConfig); - if (error) - return "ambientSoundConfig." + error; - } - return null; - }; - - /** - * Creates an AudioProcessingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.AudioProcessingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.AudioProcessingConfig} AudioProcessingConfig - */ - AudioProcessingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.AudioProcessingConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.AudioProcessingConfig(); - if (object.synthesizeSpeechConfigs) { - if (typeof object.synthesizeSpeechConfigs !== "object") - throw TypeError(".google.cloud.ces.v1beta.AudioProcessingConfig.synthesizeSpeechConfigs: object expected"); - message.synthesizeSpeechConfigs = {}; - for (var keys = Object.keys(object.synthesizeSpeechConfigs), i = 0; i < keys.length; ++i) { - if (typeof object.synthesizeSpeechConfigs[keys[i]] !== "object") - throw TypeError(".google.cloud.ces.v1beta.AudioProcessingConfig.synthesizeSpeechConfigs: object expected"); - message.synthesizeSpeechConfigs[keys[i]] = $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig.fromObject(object.synthesizeSpeechConfigs[keys[i]]); - } - } - if (object.bargeInConfig != null) { - if (typeof object.bargeInConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.AudioProcessingConfig.bargeInConfig: object expected"); - message.bargeInConfig = $root.google.cloud.ces.v1beta.BargeInConfig.fromObject(object.bargeInConfig); - } - if (object.inactivityTimeout != null) { - if (typeof object.inactivityTimeout !== "object") - throw TypeError(".google.cloud.ces.v1beta.AudioProcessingConfig.inactivityTimeout: object expected"); - message.inactivityTimeout = $root.google.protobuf.Duration.fromObject(object.inactivityTimeout); - } - if (object.ambientSoundConfig != null) { - if (typeof object.ambientSoundConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.AudioProcessingConfig.ambientSoundConfig: object expected"); - message.ambientSoundConfig = $root.google.cloud.ces.v1beta.AmbientSoundConfig.fromObject(object.ambientSoundConfig); - } - return message; - }; - - /** - * Creates a plain object from an AudioProcessingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.AudioProcessingConfig - * @static - * @param {google.cloud.ces.v1beta.AudioProcessingConfig} message AudioProcessingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AudioProcessingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.synthesizeSpeechConfigs = {}; - if (options.defaults) { - object.bargeInConfig = null; - object.inactivityTimeout = null; - object.ambientSoundConfig = null; - } - var keys2; - if (message.synthesizeSpeechConfigs && (keys2 = Object.keys(message.synthesizeSpeechConfigs)).length) { - object.synthesizeSpeechConfigs = {}; - for (var j = 0; j < keys2.length; ++j) - object.synthesizeSpeechConfigs[keys2[j]] = $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig.toObject(message.synthesizeSpeechConfigs[keys2[j]], options); - } - if (message.bargeInConfig != null && message.hasOwnProperty("bargeInConfig")) - object.bargeInConfig = $root.google.cloud.ces.v1beta.BargeInConfig.toObject(message.bargeInConfig, options); - if (message.inactivityTimeout != null && message.hasOwnProperty("inactivityTimeout")) - object.inactivityTimeout = $root.google.protobuf.Duration.toObject(message.inactivityTimeout, options); - if (message.ambientSoundConfig != null && message.hasOwnProperty("ambientSoundConfig")) - object.ambientSoundConfig = $root.google.cloud.ces.v1beta.AmbientSoundConfig.toObject(message.ambientSoundConfig, options); - return object; - }; - - /** - * Converts this AudioProcessingConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.AudioProcessingConfig - * @instance - * @returns {Object.} JSON object - */ - AudioProcessingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AudioProcessingConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.AudioProcessingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AudioProcessingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.AudioProcessingConfig"; - }; - - return AudioProcessingConfig; - })(); - - v1beta.AmbientSoundConfig = (function() { - - /** - * Properties of an AmbientSoundConfig. - * @memberof google.cloud.ces.v1beta - * @interface IAmbientSoundConfig - * @property {google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise|null} [prebuiltAmbientNoise] AmbientSoundConfig prebuiltAmbientNoise - * @property {string|null} [gcsUri] AmbientSoundConfig gcsUri - * @property {string|null} [prebuiltAmbientSound] AmbientSoundConfig prebuiltAmbientSound - * @property {number|null} [volumeGainDb] AmbientSoundConfig volumeGainDb - */ - - /** - * Constructs a new AmbientSoundConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an AmbientSoundConfig. - * @implements IAmbientSoundConfig - * @constructor - * @param {google.cloud.ces.v1beta.IAmbientSoundConfig=} [properties] Properties to set - */ - function AmbientSoundConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AmbientSoundConfig prebuiltAmbientNoise. - * @member {google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise|null|undefined} prebuiltAmbientNoise - * @memberof google.cloud.ces.v1beta.AmbientSoundConfig - * @instance - */ - AmbientSoundConfig.prototype.prebuiltAmbientNoise = null; - - /** - * AmbientSoundConfig gcsUri. - * @member {string|null|undefined} gcsUri - * @memberof google.cloud.ces.v1beta.AmbientSoundConfig - * @instance - */ - AmbientSoundConfig.prototype.gcsUri = null; - - /** - * AmbientSoundConfig prebuiltAmbientSound. - * @member {string|null|undefined} prebuiltAmbientSound - * @memberof google.cloud.ces.v1beta.AmbientSoundConfig - * @instance - */ - AmbientSoundConfig.prototype.prebuiltAmbientSound = null; - - /** - * AmbientSoundConfig volumeGainDb. - * @member {number} volumeGainDb - * @memberof google.cloud.ces.v1beta.AmbientSoundConfig - * @instance - */ - AmbientSoundConfig.prototype.volumeGainDb = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AmbientSoundConfig source. - * @member {"prebuiltAmbientNoise"|"gcsUri"|"prebuiltAmbientSound"|undefined} source - * @memberof google.cloud.ces.v1beta.AmbientSoundConfig - * @instance - */ - Object.defineProperty(AmbientSoundConfig.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["prebuiltAmbientNoise", "gcsUri", "prebuiltAmbientSound"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AmbientSoundConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.AmbientSoundConfig - * @static - * @param {google.cloud.ces.v1beta.IAmbientSoundConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.AmbientSoundConfig} AmbientSoundConfig instance - */ - AmbientSoundConfig.create = function create(properties) { - return new AmbientSoundConfig(properties); - }; - - /** - * Encodes the specified AmbientSoundConfig message. Does not implicitly {@link google.cloud.ces.v1beta.AmbientSoundConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.AmbientSoundConfig - * @static - * @param {google.cloud.ces.v1beta.IAmbientSoundConfig} message AmbientSoundConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AmbientSoundConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.prebuiltAmbientNoise != null && Object.hasOwnProperty.call(message, "prebuiltAmbientNoise")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.prebuiltAmbientNoise); - if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsUri); - if (message.volumeGainDb != null && Object.hasOwnProperty.call(message, "volumeGainDb")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.volumeGainDb); - if (message.prebuiltAmbientSound != null && Object.hasOwnProperty.call(message, "prebuiltAmbientSound")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.prebuiltAmbientSound); - return writer; - }; - - /** - * Encodes the specified AmbientSoundConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AmbientSoundConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.AmbientSoundConfig - * @static - * @param {google.cloud.ces.v1beta.IAmbientSoundConfig} message AmbientSoundConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AmbientSoundConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AmbientSoundConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.AmbientSoundConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.AmbientSoundConfig} AmbientSoundConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AmbientSoundConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AmbientSoundConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.prebuiltAmbientNoise = reader.int32(); - break; - } - case 2: { - message.gcsUri = reader.string(); - break; - } - case 4: { - message.prebuiltAmbientSound = reader.string(); - break; - } - case 3: { - message.volumeGainDb = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AmbientSoundConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.AmbientSoundConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.AmbientSoundConfig} AmbientSoundConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AmbientSoundConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AmbientSoundConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.AmbientSoundConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AmbientSoundConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.prebuiltAmbientNoise != null && message.hasOwnProperty("prebuiltAmbientNoise")) { - properties.source = 1; - switch (message.prebuiltAmbientNoise) { - default: - return "prebuiltAmbientNoise: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - if (!$util.isString(message.gcsUri)) - return "gcsUri: string expected"; - } - if (message.prebuiltAmbientSound != null && message.hasOwnProperty("prebuiltAmbientSound")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - if (!$util.isString(message.prebuiltAmbientSound)) - return "prebuiltAmbientSound: string expected"; - } - if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) - if (typeof message.volumeGainDb !== "number") - return "volumeGainDb: number expected"; - return null; - }; - - /** - * Creates an AmbientSoundConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.AmbientSoundConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.AmbientSoundConfig} AmbientSoundConfig - */ - AmbientSoundConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.AmbientSoundConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.AmbientSoundConfig(); - switch (object.prebuiltAmbientNoise) { - default: - if (typeof object.prebuiltAmbientNoise === "number") { - message.prebuiltAmbientNoise = object.prebuiltAmbientNoise; - break; - } - break; - case "PREBUILT_AMBIENT_NOISE_UNSPECIFIED": - case 0: - message.prebuiltAmbientNoise = 0; - break; - case "RETAIL_STORE": - case 1: - message.prebuiltAmbientNoise = 1; - break; - case "CONVENTION_HALL": - case 2: - message.prebuiltAmbientNoise = 2; - break; - case "OUTDOOR": - case 3: - message.prebuiltAmbientNoise = 3; - break; - } - if (object.gcsUri != null) - message.gcsUri = String(object.gcsUri); - if (object.prebuiltAmbientSound != null) - message.prebuiltAmbientSound = String(object.prebuiltAmbientSound); - if (object.volumeGainDb != null) - message.volumeGainDb = Number(object.volumeGainDb); - return message; - }; - - /** - * Creates a plain object from an AmbientSoundConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.AmbientSoundConfig - * @static - * @param {google.cloud.ces.v1beta.AmbientSoundConfig} message AmbientSoundConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AmbientSoundConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.volumeGainDb = 0; - if (message.prebuiltAmbientNoise != null && message.hasOwnProperty("prebuiltAmbientNoise")) { - object.prebuiltAmbientNoise = options.enums === String ? $root.google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise[message.prebuiltAmbientNoise] === undefined ? message.prebuiltAmbientNoise : $root.google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise[message.prebuiltAmbientNoise] : message.prebuiltAmbientNoise; - if (options.oneofs) - object.source = "prebuiltAmbientNoise"; - } - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { - object.gcsUri = message.gcsUri; - if (options.oneofs) - object.source = "gcsUri"; - } - if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) - object.volumeGainDb = options.json && !isFinite(message.volumeGainDb) ? String(message.volumeGainDb) : message.volumeGainDb; - if (message.prebuiltAmbientSound != null && message.hasOwnProperty("prebuiltAmbientSound")) { - object.prebuiltAmbientSound = message.prebuiltAmbientSound; - if (options.oneofs) - object.source = "prebuiltAmbientSound"; - } - return object; - }; - - /** - * Converts this AmbientSoundConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.AmbientSoundConfig - * @instance - * @returns {Object.} JSON object - */ - AmbientSoundConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AmbientSoundConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.AmbientSoundConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AmbientSoundConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.AmbientSoundConfig"; - }; - - /** - * PrebuiltAmbientNoise enum. - * @name google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise - * @enum {number} - * @property {number} PREBUILT_AMBIENT_NOISE_UNSPECIFIED=0 PREBUILT_AMBIENT_NOISE_UNSPECIFIED value - * @property {number} RETAIL_STORE=1 RETAIL_STORE value - * @property {number} CONVENTION_HALL=2 CONVENTION_HALL value - * @property {number} OUTDOOR=3 OUTDOOR value - */ - AmbientSoundConfig.PrebuiltAmbientNoise = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PREBUILT_AMBIENT_NOISE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RETAIL_STORE"] = 1; - values[valuesById[2] = "CONVENTION_HALL"] = 2; - values[valuesById[3] = "OUTDOOR"] = 3; - return values; - })(); - - return AmbientSoundConfig; - })(); - - v1beta.BargeInConfig = (function() { - - /** - * Properties of a BargeInConfig. - * @memberof google.cloud.ces.v1beta - * @interface IBargeInConfig - * @property {boolean|null} [disableBargeIn] BargeInConfig disableBargeIn - * @property {boolean|null} [bargeInAwareness] BargeInConfig bargeInAwareness - */ - - /** - * Constructs a new BargeInConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a BargeInConfig. - * @implements IBargeInConfig - * @constructor - * @param {google.cloud.ces.v1beta.IBargeInConfig=} [properties] Properties to set - */ - function BargeInConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BargeInConfig disableBargeIn. - * @member {boolean} disableBargeIn - * @memberof google.cloud.ces.v1beta.BargeInConfig - * @instance - */ - BargeInConfig.prototype.disableBargeIn = false; - - /** - * BargeInConfig bargeInAwareness. - * @member {boolean} bargeInAwareness - * @memberof google.cloud.ces.v1beta.BargeInConfig - * @instance - */ - BargeInConfig.prototype.bargeInAwareness = false; - - /** - * Creates a new BargeInConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.BargeInConfig - * @static - * @param {google.cloud.ces.v1beta.IBargeInConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.BargeInConfig} BargeInConfig instance - */ - BargeInConfig.create = function create(properties) { - return new BargeInConfig(properties); - }; - - /** - * Encodes the specified BargeInConfig message. Does not implicitly {@link google.cloud.ces.v1beta.BargeInConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.BargeInConfig - * @static - * @param {google.cloud.ces.v1beta.IBargeInConfig} message BargeInConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BargeInConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.disableBargeIn != null && Object.hasOwnProperty.call(message, "disableBargeIn")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.disableBargeIn); - if (message.bargeInAwareness != null && Object.hasOwnProperty.call(message, "bargeInAwareness")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.bargeInAwareness); - return writer; - }; - - /** - * Encodes the specified BargeInConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BargeInConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.BargeInConfig - * @static - * @param {google.cloud.ces.v1beta.IBargeInConfig} message BargeInConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BargeInConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BargeInConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.BargeInConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.BargeInConfig} BargeInConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BargeInConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BargeInConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.disableBargeIn = reader.bool(); - break; - } - case 2: { - message.bargeInAwareness = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BargeInConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.BargeInConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.BargeInConfig} BargeInConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BargeInConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BargeInConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.BargeInConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BargeInConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.disableBargeIn != null && message.hasOwnProperty("disableBargeIn")) - if (typeof message.disableBargeIn !== "boolean") - return "disableBargeIn: boolean expected"; - if (message.bargeInAwareness != null && message.hasOwnProperty("bargeInAwareness")) - if (typeof message.bargeInAwareness !== "boolean") - return "bargeInAwareness: boolean expected"; - return null; - }; - - /** - * Creates a BargeInConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.BargeInConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.BargeInConfig} BargeInConfig - */ - BargeInConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.BargeInConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.BargeInConfig(); - if (object.disableBargeIn != null) - message.disableBargeIn = Boolean(object.disableBargeIn); - if (object.bargeInAwareness != null) - message.bargeInAwareness = Boolean(object.bargeInAwareness); - return message; - }; - - /** - * Creates a plain object from a BargeInConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.BargeInConfig - * @static - * @param {google.cloud.ces.v1beta.BargeInConfig} message BargeInConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BargeInConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.disableBargeIn = false; - object.bargeInAwareness = false; - } - if (message.disableBargeIn != null && message.hasOwnProperty("disableBargeIn")) - object.disableBargeIn = message.disableBargeIn; - if (message.bargeInAwareness != null && message.hasOwnProperty("bargeInAwareness")) - object.bargeInAwareness = message.bargeInAwareness; - return object; - }; - - /** - * Converts this BargeInConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.BargeInConfig - * @instance - * @returns {Object.} JSON object - */ - BargeInConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BargeInConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.BargeInConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BargeInConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.BargeInConfig"; - }; - - return BargeInConfig; - })(); - - v1beta.SynthesizeSpeechConfig = (function() { - - /** - * Properties of a SynthesizeSpeechConfig. - * @memberof google.cloud.ces.v1beta - * @interface ISynthesizeSpeechConfig - * @property {string|null} [voice] SynthesizeSpeechConfig voice - * @property {number|null} [speakingRate] SynthesizeSpeechConfig speakingRate - */ - - /** - * Constructs a new SynthesizeSpeechConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a SynthesizeSpeechConfig. - * @implements ISynthesizeSpeechConfig - * @constructor - * @param {google.cloud.ces.v1beta.ISynthesizeSpeechConfig=} [properties] Properties to set - */ - function SynthesizeSpeechConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SynthesizeSpeechConfig voice. - * @member {string} voice - * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig - * @instance - */ - SynthesizeSpeechConfig.prototype.voice = ""; - - /** - * SynthesizeSpeechConfig speakingRate. - * @member {number} speakingRate - * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig - * @instance - */ - SynthesizeSpeechConfig.prototype.speakingRate = 0; - - /** - * Creates a new SynthesizeSpeechConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig - * @static - * @param {google.cloud.ces.v1beta.ISynthesizeSpeechConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.SynthesizeSpeechConfig} SynthesizeSpeechConfig instance - */ - SynthesizeSpeechConfig.create = function create(properties) { - return new SynthesizeSpeechConfig(properties); - }; - - /** - * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.ces.v1beta.SynthesizeSpeechConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig - * @static - * @param {google.cloud.ces.v1beta.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SynthesizeSpeechConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.voice != null && Object.hasOwnProperty.call(message, "voice")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.voice); - if (message.speakingRate != null && Object.hasOwnProperty.call(message, "speakingRate")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.speakingRate); - return writer; - }; - - /** - * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SynthesizeSpeechConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig - * @static - * @param {google.cloud.ces.v1beta.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SynthesizeSpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.SynthesizeSpeechConfig} SynthesizeSpeechConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SynthesizeSpeechConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.voice = reader.string(); - break; - } - case 2: { - message.speakingRate = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.SynthesizeSpeechConfig} SynthesizeSpeechConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SynthesizeSpeechConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SynthesizeSpeechConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SynthesizeSpeechConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.voice != null && message.hasOwnProperty("voice")) - if (!$util.isString(message.voice)) - return "voice: string expected"; - if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) - if (typeof message.speakingRate !== "number") - return "speakingRate: number expected"; - return null; - }; - - /** - * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.SynthesizeSpeechConfig} SynthesizeSpeechConfig - */ - SynthesizeSpeechConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig(); - if (object.voice != null) - message.voice = String(object.voice); - if (object.speakingRate != null) - message.speakingRate = Number(object.speakingRate); - return message; - }; - - /** - * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig - * @static - * @param {google.cloud.ces.v1beta.SynthesizeSpeechConfig} message SynthesizeSpeechConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SynthesizeSpeechConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.voice = ""; - object.speakingRate = 0; - } - if (message.voice != null && message.hasOwnProperty("voice")) - object.voice = message.voice; - if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) - object.speakingRate = options.json && !isFinite(message.speakingRate) ? String(message.speakingRate) : message.speakingRate; - return object; - }; - - /** - * Converts this SynthesizeSpeechConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig - * @instance - * @returns {Object.} JSON object - */ - SynthesizeSpeechConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SynthesizeSpeechConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SynthesizeSpeechConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.SynthesizeSpeechConfig"; - }; - - return SynthesizeSpeechConfig; - })(); - - v1beta.MetricAnalysisSettings = (function() { - - /** - * Properties of a MetricAnalysisSettings. - * @memberof google.cloud.ces.v1beta - * @interface IMetricAnalysisSettings - * @property {boolean|null} [llmMetricsOptedOut] MetricAnalysisSettings llmMetricsOptedOut - */ - - /** - * Constructs a new MetricAnalysisSettings. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a MetricAnalysisSettings. - * @implements IMetricAnalysisSettings - * @constructor - * @param {google.cloud.ces.v1beta.IMetricAnalysisSettings=} [properties] Properties to set - */ - function MetricAnalysisSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MetricAnalysisSettings llmMetricsOptedOut. - * @member {boolean} llmMetricsOptedOut - * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings - * @instance - */ - MetricAnalysisSettings.prototype.llmMetricsOptedOut = false; - - /** - * Creates a new MetricAnalysisSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings - * @static - * @param {google.cloud.ces.v1beta.IMetricAnalysisSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.MetricAnalysisSettings} MetricAnalysisSettings instance - */ - MetricAnalysisSettings.create = function create(properties) { - return new MetricAnalysisSettings(properties); - }; - - /** - * Encodes the specified MetricAnalysisSettings message. Does not implicitly {@link google.cloud.ces.v1beta.MetricAnalysisSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings - * @static - * @param {google.cloud.ces.v1beta.IMetricAnalysisSettings} message MetricAnalysisSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricAnalysisSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.llmMetricsOptedOut != null && Object.hasOwnProperty.call(message, "llmMetricsOptedOut")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.llmMetricsOptedOut); - return writer; - }; - - /** - * Encodes the specified MetricAnalysisSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.MetricAnalysisSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings - * @static - * @param {google.cloud.ces.v1beta.IMetricAnalysisSettings} message MetricAnalysisSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricAnalysisSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MetricAnalysisSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.MetricAnalysisSettings} MetricAnalysisSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricAnalysisSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.MetricAnalysisSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.llmMetricsOptedOut = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MetricAnalysisSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.MetricAnalysisSettings} MetricAnalysisSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricAnalysisSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MetricAnalysisSettings message. - * @function verify - * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MetricAnalysisSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.llmMetricsOptedOut != null && message.hasOwnProperty("llmMetricsOptedOut")) - if (typeof message.llmMetricsOptedOut !== "boolean") - return "llmMetricsOptedOut: boolean expected"; - return null; - }; - - /** - * Creates a MetricAnalysisSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.MetricAnalysisSettings} MetricAnalysisSettings - */ - MetricAnalysisSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.MetricAnalysisSettings) - return object; - var message = new $root.google.cloud.ces.v1beta.MetricAnalysisSettings(); - if (object.llmMetricsOptedOut != null) - message.llmMetricsOptedOut = Boolean(object.llmMetricsOptedOut); - return message; - }; - - /** - * Creates a plain object from a MetricAnalysisSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings - * @static - * @param {google.cloud.ces.v1beta.MetricAnalysisSettings} message MetricAnalysisSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MetricAnalysisSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.llmMetricsOptedOut = false; - if (message.llmMetricsOptedOut != null && message.hasOwnProperty("llmMetricsOptedOut")) - object.llmMetricsOptedOut = message.llmMetricsOptedOut; - return object; - }; - - /** - * Converts this MetricAnalysisSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings - * @instance - * @returns {Object.} JSON object - */ - MetricAnalysisSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MetricAnalysisSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MetricAnalysisSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.MetricAnalysisSettings"; - }; - - return MetricAnalysisSettings; - })(); - - v1beta.LoggingSettings = (function() { - - /** - * Properties of a LoggingSettings. - * @memberof google.cloud.ces.v1beta - * @interface ILoggingSettings - * @property {google.cloud.ces.v1beta.IRedactionConfig|null} [redactionConfig] LoggingSettings redactionConfig - * @property {google.cloud.ces.v1beta.IAudioRecordingConfig|null} [audioRecordingConfig] LoggingSettings audioRecordingConfig - * @property {google.cloud.ces.v1beta.IBigQueryExportSettings|null} [bigqueryExportSettings] LoggingSettings bigqueryExportSettings - * @property {google.cloud.ces.v1beta.ICloudLoggingSettings|null} [cloudLoggingSettings] LoggingSettings cloudLoggingSettings - * @property {google.cloud.ces.v1beta.IConversationLoggingSettings|null} [conversationLoggingSettings] LoggingSettings conversationLoggingSettings - * @property {google.cloud.ces.v1beta.IAudioRecordingConfig|null} [evaluationAudioRecordingConfig] LoggingSettings evaluationAudioRecordingConfig - * @property {google.cloud.ces.v1beta.IMetricAnalysisSettings|null} [metricAnalysisSettings] LoggingSettings metricAnalysisSettings - */ - - /** - * Constructs a new LoggingSettings. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a LoggingSettings. - * @implements ILoggingSettings - * @constructor - * @param {google.cloud.ces.v1beta.ILoggingSettings=} [properties] Properties to set - */ - function LoggingSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LoggingSettings redactionConfig. - * @member {google.cloud.ces.v1beta.IRedactionConfig|null|undefined} redactionConfig - * @memberof google.cloud.ces.v1beta.LoggingSettings - * @instance - */ - LoggingSettings.prototype.redactionConfig = null; - - /** - * LoggingSettings audioRecordingConfig. - * @member {google.cloud.ces.v1beta.IAudioRecordingConfig|null|undefined} audioRecordingConfig - * @memberof google.cloud.ces.v1beta.LoggingSettings - * @instance - */ - LoggingSettings.prototype.audioRecordingConfig = null; - - /** - * LoggingSettings bigqueryExportSettings. - * @member {google.cloud.ces.v1beta.IBigQueryExportSettings|null|undefined} bigqueryExportSettings - * @memberof google.cloud.ces.v1beta.LoggingSettings - * @instance - */ - LoggingSettings.prototype.bigqueryExportSettings = null; - - /** - * LoggingSettings cloudLoggingSettings. - * @member {google.cloud.ces.v1beta.ICloudLoggingSettings|null|undefined} cloudLoggingSettings - * @memberof google.cloud.ces.v1beta.LoggingSettings - * @instance - */ - LoggingSettings.prototype.cloudLoggingSettings = null; - - /** - * LoggingSettings conversationLoggingSettings. - * @member {google.cloud.ces.v1beta.IConversationLoggingSettings|null|undefined} conversationLoggingSettings - * @memberof google.cloud.ces.v1beta.LoggingSettings - * @instance - */ - LoggingSettings.prototype.conversationLoggingSettings = null; - - /** - * LoggingSettings evaluationAudioRecordingConfig. - * @member {google.cloud.ces.v1beta.IAudioRecordingConfig|null|undefined} evaluationAudioRecordingConfig - * @memberof google.cloud.ces.v1beta.LoggingSettings - * @instance - */ - LoggingSettings.prototype.evaluationAudioRecordingConfig = null; - - /** - * LoggingSettings metricAnalysisSettings. - * @member {google.cloud.ces.v1beta.IMetricAnalysisSettings|null|undefined} metricAnalysisSettings - * @memberof google.cloud.ces.v1beta.LoggingSettings - * @instance - */ - LoggingSettings.prototype.metricAnalysisSettings = null; - - /** - * Creates a new LoggingSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.LoggingSettings - * @static - * @param {google.cloud.ces.v1beta.ILoggingSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.LoggingSettings} LoggingSettings instance - */ - LoggingSettings.create = function create(properties) { - return new LoggingSettings(properties); - }; - - /** - * Encodes the specified LoggingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.LoggingSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.LoggingSettings - * @static - * @param {google.cloud.ces.v1beta.ILoggingSettings} message LoggingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LoggingSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.redactionConfig != null && Object.hasOwnProperty.call(message, "redactionConfig")) - $root.google.cloud.ces.v1beta.RedactionConfig.encode(message.redactionConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.audioRecordingConfig != null && Object.hasOwnProperty.call(message, "audioRecordingConfig")) - $root.google.cloud.ces.v1beta.AudioRecordingConfig.encode(message.audioRecordingConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.bigqueryExportSettings != null && Object.hasOwnProperty.call(message, "bigqueryExportSettings")) - $root.google.cloud.ces.v1beta.BigQueryExportSettings.encode(message.bigqueryExportSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.cloudLoggingSettings != null && Object.hasOwnProperty.call(message, "cloudLoggingSettings")) - $root.google.cloud.ces.v1beta.CloudLoggingSettings.encode(message.cloudLoggingSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.conversationLoggingSettings != null && Object.hasOwnProperty.call(message, "conversationLoggingSettings")) - $root.google.cloud.ces.v1beta.ConversationLoggingSettings.encode(message.conversationLoggingSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.evaluationAudioRecordingConfig != null && Object.hasOwnProperty.call(message, "evaluationAudioRecordingConfig")) - $root.google.cloud.ces.v1beta.AudioRecordingConfig.encode(message.evaluationAudioRecordingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.metricAnalysisSettings != null && Object.hasOwnProperty.call(message, "metricAnalysisSettings")) - $root.google.cloud.ces.v1beta.MetricAnalysisSettings.encode(message.metricAnalysisSettings, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LoggingSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.LoggingSettings - * @static - * @param {google.cloud.ces.v1beta.ILoggingSettings} message LoggingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LoggingSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LoggingSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.LoggingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.LoggingSettings} LoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LoggingSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LoggingSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.redactionConfig = $root.google.cloud.ces.v1beta.RedactionConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.audioRecordingConfig = $root.google.cloud.ces.v1beta.AudioRecordingConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.bigqueryExportSettings = $root.google.cloud.ces.v1beta.BigQueryExportSettings.decode(reader, reader.uint32()); - break; - } - case 4: { - message.cloudLoggingSettings = $root.google.cloud.ces.v1beta.CloudLoggingSettings.decode(reader, reader.uint32()); - break; - } - case 5: { - message.conversationLoggingSettings = $root.google.cloud.ces.v1beta.ConversationLoggingSettings.decode(reader, reader.uint32()); - break; - } - case 6: { - message.evaluationAudioRecordingConfig = $root.google.cloud.ces.v1beta.AudioRecordingConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.metricAnalysisSettings = $root.google.cloud.ces.v1beta.MetricAnalysisSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LoggingSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.LoggingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.LoggingSettings} LoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LoggingSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LoggingSettings message. - * @function verify - * @memberof google.cloud.ces.v1beta.LoggingSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LoggingSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.redactionConfig != null && message.hasOwnProperty("redactionConfig")) { - var error = $root.google.cloud.ces.v1beta.RedactionConfig.verify(message.redactionConfig); - if (error) - return "redactionConfig." + error; - } - if (message.audioRecordingConfig != null && message.hasOwnProperty("audioRecordingConfig")) { - var error = $root.google.cloud.ces.v1beta.AudioRecordingConfig.verify(message.audioRecordingConfig); - if (error) - return "audioRecordingConfig." + error; - } - if (message.bigqueryExportSettings != null && message.hasOwnProperty("bigqueryExportSettings")) { - var error = $root.google.cloud.ces.v1beta.BigQueryExportSettings.verify(message.bigqueryExportSettings); - if (error) - return "bigqueryExportSettings." + error; - } - if (message.cloudLoggingSettings != null && message.hasOwnProperty("cloudLoggingSettings")) { - var error = $root.google.cloud.ces.v1beta.CloudLoggingSettings.verify(message.cloudLoggingSettings); - if (error) - return "cloudLoggingSettings." + error; - } - if (message.conversationLoggingSettings != null && message.hasOwnProperty("conversationLoggingSettings")) { - var error = $root.google.cloud.ces.v1beta.ConversationLoggingSettings.verify(message.conversationLoggingSettings); - if (error) - return "conversationLoggingSettings." + error; - } - if (message.evaluationAudioRecordingConfig != null && message.hasOwnProperty("evaluationAudioRecordingConfig")) { - var error = $root.google.cloud.ces.v1beta.AudioRecordingConfig.verify(message.evaluationAudioRecordingConfig); - if (error) - return "evaluationAudioRecordingConfig." + error; - } - if (message.metricAnalysisSettings != null && message.hasOwnProperty("metricAnalysisSettings")) { - var error = $root.google.cloud.ces.v1beta.MetricAnalysisSettings.verify(message.metricAnalysisSettings); - if (error) - return "metricAnalysisSettings." + error; - } - return null; - }; - - /** - * Creates a LoggingSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.LoggingSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.LoggingSettings} LoggingSettings - */ - LoggingSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.LoggingSettings) - return object; - var message = new $root.google.cloud.ces.v1beta.LoggingSettings(); - if (object.redactionConfig != null) { - if (typeof object.redactionConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.redactionConfig: object expected"); - message.redactionConfig = $root.google.cloud.ces.v1beta.RedactionConfig.fromObject(object.redactionConfig); - } - if (object.audioRecordingConfig != null) { - if (typeof object.audioRecordingConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.audioRecordingConfig: object expected"); - message.audioRecordingConfig = $root.google.cloud.ces.v1beta.AudioRecordingConfig.fromObject(object.audioRecordingConfig); - } - if (object.bigqueryExportSettings != null) { - if (typeof object.bigqueryExportSettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.bigqueryExportSettings: object expected"); - message.bigqueryExportSettings = $root.google.cloud.ces.v1beta.BigQueryExportSettings.fromObject(object.bigqueryExportSettings); - } - if (object.cloudLoggingSettings != null) { - if (typeof object.cloudLoggingSettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.cloudLoggingSettings: object expected"); - message.cloudLoggingSettings = $root.google.cloud.ces.v1beta.CloudLoggingSettings.fromObject(object.cloudLoggingSettings); - } - if (object.conversationLoggingSettings != null) { - if (typeof object.conversationLoggingSettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.conversationLoggingSettings: object expected"); - message.conversationLoggingSettings = $root.google.cloud.ces.v1beta.ConversationLoggingSettings.fromObject(object.conversationLoggingSettings); - } - if (object.evaluationAudioRecordingConfig != null) { - if (typeof object.evaluationAudioRecordingConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.evaluationAudioRecordingConfig: object expected"); - message.evaluationAudioRecordingConfig = $root.google.cloud.ces.v1beta.AudioRecordingConfig.fromObject(object.evaluationAudioRecordingConfig); - } - if (object.metricAnalysisSettings != null) { - if (typeof object.metricAnalysisSettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.metricAnalysisSettings: object expected"); - message.metricAnalysisSettings = $root.google.cloud.ces.v1beta.MetricAnalysisSettings.fromObject(object.metricAnalysisSettings); - } - return message; - }; - - /** - * Creates a plain object from a LoggingSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.LoggingSettings - * @static - * @param {google.cloud.ces.v1beta.LoggingSettings} message LoggingSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LoggingSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.redactionConfig = null; - object.audioRecordingConfig = null; - object.bigqueryExportSettings = null; - object.cloudLoggingSettings = null; - object.conversationLoggingSettings = null; - object.evaluationAudioRecordingConfig = null; - object.metricAnalysisSettings = null; - } - if (message.redactionConfig != null && message.hasOwnProperty("redactionConfig")) - object.redactionConfig = $root.google.cloud.ces.v1beta.RedactionConfig.toObject(message.redactionConfig, options); - if (message.audioRecordingConfig != null && message.hasOwnProperty("audioRecordingConfig")) - object.audioRecordingConfig = $root.google.cloud.ces.v1beta.AudioRecordingConfig.toObject(message.audioRecordingConfig, options); - if (message.bigqueryExportSettings != null && message.hasOwnProperty("bigqueryExportSettings")) - object.bigqueryExportSettings = $root.google.cloud.ces.v1beta.BigQueryExportSettings.toObject(message.bigqueryExportSettings, options); - if (message.cloudLoggingSettings != null && message.hasOwnProperty("cloudLoggingSettings")) - object.cloudLoggingSettings = $root.google.cloud.ces.v1beta.CloudLoggingSettings.toObject(message.cloudLoggingSettings, options); - if (message.conversationLoggingSettings != null && message.hasOwnProperty("conversationLoggingSettings")) - object.conversationLoggingSettings = $root.google.cloud.ces.v1beta.ConversationLoggingSettings.toObject(message.conversationLoggingSettings, options); - if (message.evaluationAudioRecordingConfig != null && message.hasOwnProperty("evaluationAudioRecordingConfig")) - object.evaluationAudioRecordingConfig = $root.google.cloud.ces.v1beta.AudioRecordingConfig.toObject(message.evaluationAudioRecordingConfig, options); - if (message.metricAnalysisSettings != null && message.hasOwnProperty("metricAnalysisSettings")) - object.metricAnalysisSettings = $root.google.cloud.ces.v1beta.MetricAnalysisSettings.toObject(message.metricAnalysisSettings, options); - return object; - }; - - /** - * Converts this LoggingSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.LoggingSettings - * @instance - * @returns {Object.} JSON object - */ - LoggingSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LoggingSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.LoggingSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LoggingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.LoggingSettings"; - }; - - return LoggingSettings; - })(); - - v1beta.ErrorHandlingSettings = (function() { - - /** - * Properties of an ErrorHandlingSettings. - * @memberof google.cloud.ces.v1beta - * @interface IErrorHandlingSettings - * @property {google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy|null} [errorHandlingStrategy] ErrorHandlingSettings errorHandlingStrategy - */ - - /** - * Constructs a new ErrorHandlingSettings. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an ErrorHandlingSettings. - * @implements IErrorHandlingSettings - * @constructor - * @param {google.cloud.ces.v1beta.IErrorHandlingSettings=} [properties] Properties to set - */ - function ErrorHandlingSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ErrorHandlingSettings errorHandlingStrategy. - * @member {google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy} errorHandlingStrategy - * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings - * @instance - */ - ErrorHandlingSettings.prototype.errorHandlingStrategy = 0; - - /** - * Creates a new ErrorHandlingSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings - * @static - * @param {google.cloud.ces.v1beta.IErrorHandlingSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ErrorHandlingSettings} ErrorHandlingSettings instance - */ - ErrorHandlingSettings.create = function create(properties) { - return new ErrorHandlingSettings(properties); - }; - - /** - * Encodes the specified ErrorHandlingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ErrorHandlingSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings - * @static - * @param {google.cloud.ces.v1beta.IErrorHandlingSettings} message ErrorHandlingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ErrorHandlingSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.errorHandlingStrategy != null && Object.hasOwnProperty.call(message, "errorHandlingStrategy")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.errorHandlingStrategy); - return writer; - }; - - /** - * Encodes the specified ErrorHandlingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ErrorHandlingSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings - * @static - * @param {google.cloud.ces.v1beta.IErrorHandlingSettings} message ErrorHandlingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ErrorHandlingSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ErrorHandlingSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ErrorHandlingSettings} ErrorHandlingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ErrorHandlingSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ErrorHandlingSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.errorHandlingStrategy = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ErrorHandlingSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ErrorHandlingSettings} ErrorHandlingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ErrorHandlingSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ErrorHandlingSettings message. - * @function verify - * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ErrorHandlingSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.errorHandlingStrategy != null && message.hasOwnProperty("errorHandlingStrategy")) - switch (message.errorHandlingStrategy) { - default: - return "errorHandlingStrategy: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an ErrorHandlingSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ErrorHandlingSettings} ErrorHandlingSettings - */ - ErrorHandlingSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ErrorHandlingSettings) - return object; - var message = new $root.google.cloud.ces.v1beta.ErrorHandlingSettings(); - switch (object.errorHandlingStrategy) { - default: - if (typeof object.errorHandlingStrategy === "number") { - message.errorHandlingStrategy = object.errorHandlingStrategy; - break; - } - break; - case "ERROR_HANDLING_STRATEGY_UNSPECIFIED": - case 0: - message.errorHandlingStrategy = 0; - break; - case "NONE": - case 1: - message.errorHandlingStrategy = 1; - break; - case "FALLBACK_RESPONSE": - case 2: - message.errorHandlingStrategy = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an ErrorHandlingSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings - * @static - * @param {google.cloud.ces.v1beta.ErrorHandlingSettings} message ErrorHandlingSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ErrorHandlingSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.errorHandlingStrategy = options.enums === String ? "ERROR_HANDLING_STRATEGY_UNSPECIFIED" : 0; - if (message.errorHandlingStrategy != null && message.hasOwnProperty("errorHandlingStrategy")) - object.errorHandlingStrategy = options.enums === String ? $root.google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy[message.errorHandlingStrategy] === undefined ? message.errorHandlingStrategy : $root.google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy[message.errorHandlingStrategy] : message.errorHandlingStrategy; - return object; - }; - - /** - * Converts this ErrorHandlingSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings - * @instance - * @returns {Object.} JSON object - */ - ErrorHandlingSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ErrorHandlingSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ErrorHandlingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ErrorHandlingSettings"; - }; - - /** - * ErrorHandlingStrategy enum. - * @name google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy - * @enum {number} - * @property {number} ERROR_HANDLING_STRATEGY_UNSPECIFIED=0 ERROR_HANDLING_STRATEGY_UNSPECIFIED value - * @property {number} NONE=1 NONE value - * @property {number} FALLBACK_RESPONSE=2 FALLBACK_RESPONSE value - */ - ErrorHandlingSettings.ErrorHandlingStrategy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ERROR_HANDLING_STRATEGY_UNSPECIFIED"] = 0; - values[valuesById[1] = "NONE"] = 1; - values[valuesById[2] = "FALLBACK_RESPONSE"] = 2; - return values; - })(); - - return ErrorHandlingSettings; - })(); - - v1beta.EvaluationMetricsThresholds = (function() { - - /** - * Properties of an EvaluationMetricsThresholds. - * @memberof google.cloud.ces.v1beta - * @interface IEvaluationMetricsThresholds - * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null} [goldenEvaluationMetricsThresholds] EvaluationMetricsThresholds goldenEvaluationMetricsThresholds - * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|null} [hallucinationMetricBehavior] EvaluationMetricsThresholds hallucinationMetricBehavior - * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|null} [goldenHallucinationMetricBehavior] EvaluationMetricsThresholds goldenHallucinationMetricBehavior - * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|null} [scenarioHallucinationMetricBehavior] EvaluationMetricsThresholds scenarioHallucinationMetricBehavior - */ - - /** - * Constructs a new EvaluationMetricsThresholds. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an EvaluationMetricsThresholds. - * @implements IEvaluationMetricsThresholds - * @constructor - * @param {google.cloud.ces.v1beta.IEvaluationMetricsThresholds=} [properties] Properties to set - */ - function EvaluationMetricsThresholds(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluationMetricsThresholds goldenEvaluationMetricsThresholds. - * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null|undefined} goldenEvaluationMetricsThresholds - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds - * @instance - */ - EvaluationMetricsThresholds.prototype.goldenEvaluationMetricsThresholds = null; - - /** - * EvaluationMetricsThresholds hallucinationMetricBehavior. - * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior} hallucinationMetricBehavior - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds - * @instance - */ - EvaluationMetricsThresholds.prototype.hallucinationMetricBehavior = 0; - - /** - * EvaluationMetricsThresholds goldenHallucinationMetricBehavior. - * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior} goldenHallucinationMetricBehavior - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds - * @instance - */ - EvaluationMetricsThresholds.prototype.goldenHallucinationMetricBehavior = 0; - - /** - * EvaluationMetricsThresholds scenarioHallucinationMetricBehavior. - * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior} scenarioHallucinationMetricBehavior - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds - * @instance - */ - EvaluationMetricsThresholds.prototype.scenarioHallucinationMetricBehavior = 0; - - /** - * Creates a new EvaluationMetricsThresholds instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds - * @static - * @param {google.cloud.ces.v1beta.IEvaluationMetricsThresholds=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds} EvaluationMetricsThresholds instance - */ - EvaluationMetricsThresholds.create = function create(properties) { - return new EvaluationMetricsThresholds(properties); - }; - - /** - * Encodes the specified EvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds - * @static - * @param {google.cloud.ces.v1beta.IEvaluationMetricsThresholds} message EvaluationMetricsThresholds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationMetricsThresholds.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.goldenEvaluationMetricsThresholds != null && Object.hasOwnProperty.call(message, "goldenEvaluationMetricsThresholds")) - $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.encode(message.goldenEvaluationMetricsThresholds, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.hallucinationMetricBehavior != null && Object.hasOwnProperty.call(message, "hallucinationMetricBehavior")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.hallucinationMetricBehavior); - if (message.scenarioHallucinationMetricBehavior != null && Object.hasOwnProperty.call(message, "scenarioHallucinationMetricBehavior")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.scenarioHallucinationMetricBehavior); - if (message.goldenHallucinationMetricBehavior != null && Object.hasOwnProperty.call(message, "goldenHallucinationMetricBehavior")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.goldenHallucinationMetricBehavior); - return writer; - }; - - /** - * Encodes the specified EvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds - * @static - * @param {google.cloud.ces.v1beta.IEvaluationMetricsThresholds} message EvaluationMetricsThresholds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds} EvaluationMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationMetricsThresholds.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.goldenEvaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.decode(reader, reader.uint32()); - break; - } - case 3: { - message.hallucinationMetricBehavior = reader.int32(); - break; - } - case 5: { - message.goldenHallucinationMetricBehavior = reader.int32(); - break; - } - case 4: { - message.scenarioHallucinationMetricBehavior = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds} EvaluationMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluationMetricsThresholds message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluationMetricsThresholds.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.goldenEvaluationMetricsThresholds != null && message.hasOwnProperty("goldenEvaluationMetricsThresholds")) { - var error = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify(message.goldenEvaluationMetricsThresholds); - if (error) - return "goldenEvaluationMetricsThresholds." + error; - } - if (message.hallucinationMetricBehavior != null && message.hasOwnProperty("hallucinationMetricBehavior")) - switch (message.hallucinationMetricBehavior) { - default: - return "hallucinationMetricBehavior: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.goldenHallucinationMetricBehavior != null && message.hasOwnProperty("goldenHallucinationMetricBehavior")) - switch (message.goldenHallucinationMetricBehavior) { - default: - return "goldenHallucinationMetricBehavior: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.scenarioHallucinationMetricBehavior != null && message.hasOwnProperty("scenarioHallucinationMetricBehavior")) - switch (message.scenarioHallucinationMetricBehavior) { - default: - return "scenarioHallucinationMetricBehavior: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an EvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds} EvaluationMetricsThresholds - */ - EvaluationMetricsThresholds.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds(); - if (object.goldenEvaluationMetricsThresholds != null) { - if (typeof object.goldenEvaluationMetricsThresholds !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationMetricsThresholds.goldenEvaluationMetricsThresholds: object expected"); - message.goldenEvaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.fromObject(object.goldenEvaluationMetricsThresholds); - } - switch (object.hallucinationMetricBehavior) { - default: - if (typeof object.hallucinationMetricBehavior === "number") { - message.hallucinationMetricBehavior = object.hallucinationMetricBehavior; - break; - } - break; - case "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": - case 0: - message.hallucinationMetricBehavior = 0; - break; - case "DISABLED": - case 1: - message.hallucinationMetricBehavior = 1; - break; - case "ENABLED": - case 2: - message.hallucinationMetricBehavior = 2; - break; - } - switch (object.goldenHallucinationMetricBehavior) { - default: - if (typeof object.goldenHallucinationMetricBehavior === "number") { - message.goldenHallucinationMetricBehavior = object.goldenHallucinationMetricBehavior; - break; - } - break; - case "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": - case 0: - message.goldenHallucinationMetricBehavior = 0; - break; - case "DISABLED": - case 1: - message.goldenHallucinationMetricBehavior = 1; - break; - case "ENABLED": - case 2: - message.goldenHallucinationMetricBehavior = 2; - break; - } - switch (object.scenarioHallucinationMetricBehavior) { - default: - if (typeof object.scenarioHallucinationMetricBehavior === "number") { - message.scenarioHallucinationMetricBehavior = object.scenarioHallucinationMetricBehavior; - break; - } - break; - case "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": - case 0: - message.scenarioHallucinationMetricBehavior = 0; - break; - case "DISABLED": - case 1: - message.scenarioHallucinationMetricBehavior = 1; - break; - case "ENABLED": - case 2: - message.scenarioHallucinationMetricBehavior = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an EvaluationMetricsThresholds message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds - * @static - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds} message EvaluationMetricsThresholds - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluationMetricsThresholds.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.goldenEvaluationMetricsThresholds = null; - object.hallucinationMetricBehavior = options.enums === String ? "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" : 0; - object.scenarioHallucinationMetricBehavior = options.enums === String ? "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" : 0; - object.goldenHallucinationMetricBehavior = options.enums === String ? "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" : 0; - } - if (message.goldenEvaluationMetricsThresholds != null && message.hasOwnProperty("goldenEvaluationMetricsThresholds")) - object.goldenEvaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.toObject(message.goldenEvaluationMetricsThresholds, options); - if (message.hallucinationMetricBehavior != null && message.hasOwnProperty("hallucinationMetricBehavior")) - object.hallucinationMetricBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.hallucinationMetricBehavior] === undefined ? message.hallucinationMetricBehavior : $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.hallucinationMetricBehavior] : message.hallucinationMetricBehavior; - if (message.scenarioHallucinationMetricBehavior != null && message.hasOwnProperty("scenarioHallucinationMetricBehavior")) - object.scenarioHallucinationMetricBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.scenarioHallucinationMetricBehavior] === undefined ? message.scenarioHallucinationMetricBehavior : $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.scenarioHallucinationMetricBehavior] : message.scenarioHallucinationMetricBehavior; - if (message.goldenHallucinationMetricBehavior != null && message.hasOwnProperty("goldenHallucinationMetricBehavior")) - object.goldenHallucinationMetricBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.goldenHallucinationMetricBehavior] === undefined ? message.goldenHallucinationMetricBehavior : $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.goldenHallucinationMetricBehavior] : message.goldenHallucinationMetricBehavior; - return object; - }; - - /** - * Converts this EvaluationMetricsThresholds to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds - * @instance - * @returns {Object.} JSON object - */ - EvaluationMetricsThresholds.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluationMetricsThresholds - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluationMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationMetricsThresholds"; - }; - - EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds = (function() { - - /** - * Properties of a GoldenEvaluationMetricsThresholds. - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds - * @interface IGoldenEvaluationMetricsThresholds - * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null} [turnLevelMetricsThresholds] GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds - * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null} [expectationLevelMetricsThresholds] GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds - * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings|null} [toolMatchingSettings] GoldenEvaluationMetricsThresholds toolMatchingSettings - */ - - /** - * Constructs a new GoldenEvaluationMetricsThresholds. - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds - * @classdesc Represents a GoldenEvaluationMetricsThresholds. - * @implements IGoldenEvaluationMetricsThresholds - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds=} [properties] Properties to set - */ - function GoldenEvaluationMetricsThresholds(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds. - * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null|undefined} turnLevelMetricsThresholds - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @instance - */ - GoldenEvaluationMetricsThresholds.prototype.turnLevelMetricsThresholds = null; - - /** - * GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds. - * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null|undefined} expectationLevelMetricsThresholds - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @instance - */ - GoldenEvaluationMetricsThresholds.prototype.expectationLevelMetricsThresholds = null; - - /** - * GoldenEvaluationMetricsThresholds toolMatchingSettings. - * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings|null|undefined} toolMatchingSettings - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @instance - */ - GoldenEvaluationMetricsThresholds.prototype.toolMatchingSettings = null; - - /** - * Creates a new GoldenEvaluationMetricsThresholds instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @static - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds instance - */ - GoldenEvaluationMetricsThresholds.create = function create(properties) { - return new GoldenEvaluationMetricsThresholds(properties); - }; - - /** - * Encodes the specified GoldenEvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @static - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds} message GoldenEvaluationMetricsThresholds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoldenEvaluationMetricsThresholds.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.turnLevelMetricsThresholds != null && Object.hasOwnProperty.call(message, "turnLevelMetricsThresholds")) - $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.encode(message.turnLevelMetricsThresholds, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.expectationLevelMetricsThresholds != null && Object.hasOwnProperty.call(message, "expectationLevelMetricsThresholds")) - $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.encode(message.expectationLevelMetricsThresholds, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.toolMatchingSettings != null && Object.hasOwnProperty.call(message, "toolMatchingSettings")) - $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.encode(message.toolMatchingSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoldenEvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @static - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds} message GoldenEvaluationMetricsThresholds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoldenEvaluationMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoldenEvaluationMetricsThresholds.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.turnLevelMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.decode(reader, reader.uint32()); - break; - } - case 2: { - message.expectationLevelMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.decode(reader, reader.uint32()); - break; - } - case 3: { - message.toolMatchingSettings = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoldenEvaluationMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoldenEvaluationMetricsThresholds message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoldenEvaluationMetricsThresholds.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.turnLevelMetricsThresholds != null && message.hasOwnProperty("turnLevelMetricsThresholds")) { - var error = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify(message.turnLevelMetricsThresholds); - if (error) - return "turnLevelMetricsThresholds." + error; - } - if (message.expectationLevelMetricsThresholds != null && message.hasOwnProperty("expectationLevelMetricsThresholds")) { - var error = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify(message.expectationLevelMetricsThresholds); - if (error) - return "expectationLevelMetricsThresholds." + error; - } - if (message.toolMatchingSettings != null && message.hasOwnProperty("toolMatchingSettings")) { - var error = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.verify(message.toolMatchingSettings); - if (error) - return "toolMatchingSettings." + error; - } - return null; - }; - - /** - * Creates a GoldenEvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds - */ - GoldenEvaluationMetricsThresholds.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds(); - if (object.turnLevelMetricsThresholds != null) { - if (typeof object.turnLevelMetricsThresholds !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.turnLevelMetricsThresholds: object expected"); - message.turnLevelMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.fromObject(object.turnLevelMetricsThresholds); - } - if (object.expectationLevelMetricsThresholds != null) { - if (typeof object.expectationLevelMetricsThresholds !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.expectationLevelMetricsThresholds: object expected"); - message.expectationLevelMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.fromObject(object.expectationLevelMetricsThresholds); - } - if (object.toolMatchingSettings != null) { - if (typeof object.toolMatchingSettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.toolMatchingSettings: object expected"); - message.toolMatchingSettings = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.fromObject(object.toolMatchingSettings); - } - return message; - }; - - /** - * Creates a plain object from a GoldenEvaluationMetricsThresholds message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @static - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} message GoldenEvaluationMetricsThresholds - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoldenEvaluationMetricsThresholds.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.turnLevelMetricsThresholds = null; - object.expectationLevelMetricsThresholds = null; - object.toolMatchingSettings = null; - } - if (message.turnLevelMetricsThresholds != null && message.hasOwnProperty("turnLevelMetricsThresholds")) - object.turnLevelMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.toObject(message.turnLevelMetricsThresholds, options); - if (message.expectationLevelMetricsThresholds != null && message.hasOwnProperty("expectationLevelMetricsThresholds")) - object.expectationLevelMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.toObject(message.expectationLevelMetricsThresholds, options); - if (message.toolMatchingSettings != null && message.hasOwnProperty("toolMatchingSettings")) - object.toolMatchingSettings = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.toObject(message.toolMatchingSettings, options); - return object; - }; - - /** - * Converts this GoldenEvaluationMetricsThresholds to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @instance - * @returns {Object.} JSON object - */ - GoldenEvaluationMetricsThresholds.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoldenEvaluationMetricsThresholds - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoldenEvaluationMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds"; - }; - - GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds = (function() { - - /** - * Properties of a TurnLevelMetricsThresholds. - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @interface ITurnLevelMetricsThresholds - * @property {number|null} [semanticSimilaritySuccessThreshold] TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold - * @property {number|null} [overallToolInvocationCorrectnessThreshold] TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold - * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|null} [semanticSimilarityChannel] TurnLevelMetricsThresholds semanticSimilarityChannel - */ - - /** - * Constructs a new TurnLevelMetricsThresholds. - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @classdesc Represents a TurnLevelMetricsThresholds. - * @implements ITurnLevelMetricsThresholds - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds=} [properties] Properties to set - */ - function TurnLevelMetricsThresholds(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold. - * @member {number|null|undefined} semanticSimilaritySuccessThreshold - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @instance - */ - TurnLevelMetricsThresholds.prototype.semanticSimilaritySuccessThreshold = null; - - /** - * TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold. - * @member {number|null|undefined} overallToolInvocationCorrectnessThreshold - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @instance - */ - TurnLevelMetricsThresholds.prototype.overallToolInvocationCorrectnessThreshold = null; - - /** - * TurnLevelMetricsThresholds semanticSimilarityChannel. - * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel} semanticSimilarityChannel - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @instance - */ - TurnLevelMetricsThresholds.prototype.semanticSimilarityChannel = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(TurnLevelMetricsThresholds.prototype, "_semanticSimilaritySuccessThreshold", { - get: $util.oneOfGetter($oneOfFields = ["semanticSimilaritySuccessThreshold"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(TurnLevelMetricsThresholds.prototype, "_overallToolInvocationCorrectnessThreshold", { - get: $util.oneOfGetter($oneOfFields = ["overallToolInvocationCorrectnessThreshold"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TurnLevelMetricsThresholds instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @static - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds instance - */ - TurnLevelMetricsThresholds.create = function create(properties) { - return new TurnLevelMetricsThresholds(properties); - }; - - /** - * Encodes the specified TurnLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @static - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds} message TurnLevelMetricsThresholds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TurnLevelMetricsThresholds.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.semanticSimilaritySuccessThreshold != null && Object.hasOwnProperty.call(message, "semanticSimilaritySuccessThreshold")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.semanticSimilaritySuccessThreshold); - if (message.overallToolInvocationCorrectnessThreshold != null && Object.hasOwnProperty.call(message, "overallToolInvocationCorrectnessThreshold")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.overallToolInvocationCorrectnessThreshold); - if (message.semanticSimilarityChannel != null && Object.hasOwnProperty.call(message, "semanticSimilarityChannel")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.semanticSimilarityChannel); - return writer; - }; - - /** - * Encodes the specified TurnLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @static - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds} message TurnLevelMetricsThresholds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TurnLevelMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TurnLevelMetricsThresholds.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.semanticSimilaritySuccessThreshold = reader.int32(); - break; - } - case 2: { - message.overallToolInvocationCorrectnessThreshold = reader.float(); - break; - } - case 3: { - message.semanticSimilarityChannel = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TurnLevelMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TurnLevelMetricsThresholds message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TurnLevelMetricsThresholds.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.semanticSimilaritySuccessThreshold != null && message.hasOwnProperty("semanticSimilaritySuccessThreshold")) { - properties._semanticSimilaritySuccessThreshold = 1; - if (!$util.isInteger(message.semanticSimilaritySuccessThreshold)) - return "semanticSimilaritySuccessThreshold: integer expected"; - } - if (message.overallToolInvocationCorrectnessThreshold != null && message.hasOwnProperty("overallToolInvocationCorrectnessThreshold")) { - properties._overallToolInvocationCorrectnessThreshold = 1; - if (typeof message.overallToolInvocationCorrectnessThreshold !== "number") - return "overallToolInvocationCorrectnessThreshold: number expected"; - } - if (message.semanticSimilarityChannel != null && message.hasOwnProperty("semanticSimilarityChannel")) - switch (message.semanticSimilarityChannel) { - default: - return "semanticSimilarityChannel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a TurnLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds - */ - TurnLevelMetricsThresholds.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds(); - if (object.semanticSimilaritySuccessThreshold != null) - message.semanticSimilaritySuccessThreshold = object.semanticSimilaritySuccessThreshold | 0; - if (object.overallToolInvocationCorrectnessThreshold != null) - message.overallToolInvocationCorrectnessThreshold = Number(object.overallToolInvocationCorrectnessThreshold); - switch (object.semanticSimilarityChannel) { - default: - if (typeof object.semanticSimilarityChannel === "number") { - message.semanticSimilarityChannel = object.semanticSimilarityChannel; - break; - } - break; - case "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED": - case 0: - message.semanticSimilarityChannel = 0; - break; - case "TEXT": - case 1: - message.semanticSimilarityChannel = 1; - break; - case "AUDIO": - case 2: - message.semanticSimilarityChannel = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a TurnLevelMetricsThresholds message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @static - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} message TurnLevelMetricsThresholds - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TurnLevelMetricsThresholds.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.semanticSimilarityChannel = options.enums === String ? "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED" : 0; - if (message.semanticSimilaritySuccessThreshold != null && message.hasOwnProperty("semanticSimilaritySuccessThreshold")) { - object.semanticSimilaritySuccessThreshold = message.semanticSimilaritySuccessThreshold; - if (options.oneofs) - object._semanticSimilaritySuccessThreshold = "semanticSimilaritySuccessThreshold"; - } - if (message.overallToolInvocationCorrectnessThreshold != null && message.hasOwnProperty("overallToolInvocationCorrectnessThreshold")) { - object.overallToolInvocationCorrectnessThreshold = options.json && !isFinite(message.overallToolInvocationCorrectnessThreshold) ? String(message.overallToolInvocationCorrectnessThreshold) : message.overallToolInvocationCorrectnessThreshold; - if (options.oneofs) - object._overallToolInvocationCorrectnessThreshold = "overallToolInvocationCorrectnessThreshold"; - } - if (message.semanticSimilarityChannel != null && message.hasOwnProperty("semanticSimilarityChannel")) - object.semanticSimilarityChannel = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel[message.semanticSimilarityChannel] === undefined ? message.semanticSimilarityChannel : $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel[message.semanticSimilarityChannel] : message.semanticSimilarityChannel; - return object; - }; - - /** - * Converts this TurnLevelMetricsThresholds to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @instance - * @returns {Object.} JSON object - */ - TurnLevelMetricsThresholds.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TurnLevelMetricsThresholds - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TurnLevelMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds"; - }; - - /** - * SemanticSimilarityChannel enum. - * @name google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel - * @enum {number} - * @property {number} SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED=0 SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED value - * @property {number} TEXT=1 TEXT value - * @property {number} AUDIO=2 AUDIO value - */ - TurnLevelMetricsThresholds.SemanticSimilarityChannel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "TEXT"] = 1; - values[valuesById[2] = "AUDIO"] = 2; - return values; - })(); - - return TurnLevelMetricsThresholds; - })(); - - GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds = (function() { - - /** - * Properties of an ExpectationLevelMetricsThresholds. - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @interface IExpectationLevelMetricsThresholds - * @property {number|null} [toolInvocationParameterCorrectnessThreshold] ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold - */ - - /** - * Constructs a new ExpectationLevelMetricsThresholds. - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds - * @classdesc Represents an ExpectationLevelMetricsThresholds. - * @implements IExpectationLevelMetricsThresholds - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds=} [properties] Properties to set - */ - function ExpectationLevelMetricsThresholds(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold. - * @member {number|null|undefined} toolInvocationParameterCorrectnessThreshold - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @instance - */ - ExpectationLevelMetricsThresholds.prototype.toolInvocationParameterCorrectnessThreshold = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ExpectationLevelMetricsThresholds.prototype, "_toolInvocationParameterCorrectnessThreshold", { - get: $util.oneOfGetter($oneOfFields = ["toolInvocationParameterCorrectnessThreshold"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExpectationLevelMetricsThresholds instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @static - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds instance - */ - ExpectationLevelMetricsThresholds.create = function create(properties) { - return new ExpectationLevelMetricsThresholds(properties); - }; - - /** - * Encodes the specified ExpectationLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @static - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds} message ExpectationLevelMetricsThresholds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExpectationLevelMetricsThresholds.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolInvocationParameterCorrectnessThreshold != null && Object.hasOwnProperty.call(message, "toolInvocationParameterCorrectnessThreshold")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.toolInvocationParameterCorrectnessThreshold); - return writer; - }; - - /** - * Encodes the specified ExpectationLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @static - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds} message ExpectationLevelMetricsThresholds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExpectationLevelMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExpectationLevelMetricsThresholds.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.toolInvocationParameterCorrectnessThreshold = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExpectationLevelMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExpectationLevelMetricsThresholds message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExpectationLevelMetricsThresholds.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.toolInvocationParameterCorrectnessThreshold != null && message.hasOwnProperty("toolInvocationParameterCorrectnessThreshold")) { - properties._toolInvocationParameterCorrectnessThreshold = 1; - if (typeof message.toolInvocationParameterCorrectnessThreshold !== "number") - return "toolInvocationParameterCorrectnessThreshold: number expected"; - } - return null; - }; - - /** - * Creates an ExpectationLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds - */ - ExpectationLevelMetricsThresholds.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds(); - if (object.toolInvocationParameterCorrectnessThreshold != null) - message.toolInvocationParameterCorrectnessThreshold = Number(object.toolInvocationParameterCorrectnessThreshold); - return message; - }; - - /** - * Creates a plain object from an ExpectationLevelMetricsThresholds message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @static - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} message ExpectationLevelMetricsThresholds - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExpectationLevelMetricsThresholds.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.toolInvocationParameterCorrectnessThreshold != null && message.hasOwnProperty("toolInvocationParameterCorrectnessThreshold")) { - object.toolInvocationParameterCorrectnessThreshold = options.json && !isFinite(message.toolInvocationParameterCorrectnessThreshold) ? String(message.toolInvocationParameterCorrectnessThreshold) : message.toolInvocationParameterCorrectnessThreshold; - if (options.oneofs) - object._toolInvocationParameterCorrectnessThreshold = "toolInvocationParameterCorrectnessThreshold"; - } - return object; - }; - - /** - * Converts this ExpectationLevelMetricsThresholds to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @instance - * @returns {Object.} JSON object - */ - ExpectationLevelMetricsThresholds.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExpectationLevelMetricsThresholds - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExpectationLevelMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds"; - }; - - return ExpectationLevelMetricsThresholds; - })(); - - return GoldenEvaluationMetricsThresholds; - })(); - - EvaluationMetricsThresholds.ToolMatchingSettings = (function() { - - /** - * Properties of a ToolMatchingSettings. - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds - * @interface IToolMatchingSettings - * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|null} [extraToolCallBehavior] ToolMatchingSettings extraToolCallBehavior - */ - - /** - * Constructs a new ToolMatchingSettings. - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds - * @classdesc Represents a ToolMatchingSettings. - * @implements IToolMatchingSettings - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings=} [properties] Properties to set - */ - function ToolMatchingSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolMatchingSettings extraToolCallBehavior. - * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior} extraToolCallBehavior - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings - * @instance - */ - ToolMatchingSettings.prototype.extraToolCallBehavior = 0; - - /** - * Creates a new ToolMatchingSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings - * @static - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings instance - */ - ToolMatchingSettings.create = function create(properties) { - return new ToolMatchingSettings(properties); - }; - - /** - * Encodes the specified ToolMatchingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings - * @static - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings} message ToolMatchingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolMatchingSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.extraToolCallBehavior != null && Object.hasOwnProperty.call(message, "extraToolCallBehavior")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.extraToolCallBehavior); - return writer; - }; - - /** - * Encodes the specified ToolMatchingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings - * @static - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings} message ToolMatchingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolMatchingSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolMatchingSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolMatchingSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.extraToolCallBehavior = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolMatchingSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolMatchingSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolMatchingSettings message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolMatchingSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.extraToolCallBehavior != null && message.hasOwnProperty("extraToolCallBehavior")) - switch (message.extraToolCallBehavior) { - default: - return "extraToolCallBehavior: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a ToolMatchingSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings - */ - ToolMatchingSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings(); - switch (object.extraToolCallBehavior) { - default: - if (typeof object.extraToolCallBehavior === "number") { - message.extraToolCallBehavior = object.extraToolCallBehavior; - break; - } - break; - case "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED": - case 0: - message.extraToolCallBehavior = 0; - break; - case "FAIL": - case 1: - message.extraToolCallBehavior = 1; - break; - case "ALLOW": - case 2: - message.extraToolCallBehavior = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a ToolMatchingSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings - * @static - * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings} message ToolMatchingSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolMatchingSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.extraToolCallBehavior = options.enums === String ? "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED" : 0; - if (message.extraToolCallBehavior != null && message.hasOwnProperty("extraToolCallBehavior")) - object.extraToolCallBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior[message.extraToolCallBehavior] === undefined ? message.extraToolCallBehavior : $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior[message.extraToolCallBehavior] : message.extraToolCallBehavior; - return object; - }; - - /** - * Converts this ToolMatchingSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings - * @instance - * @returns {Object.} JSON object - */ - ToolMatchingSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolMatchingSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolMatchingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings"; - }; - - /** - * ExtraToolCallBehavior enum. - * @name google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior - * @enum {number} - * @property {number} EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED=0 EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED value - * @property {number} FAIL=1 FAIL value - * @property {number} ALLOW=2 ALLOW value - */ - ToolMatchingSettings.ExtraToolCallBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "FAIL"] = 1; - values[valuesById[2] = "ALLOW"] = 2; - return values; - })(); - - return ToolMatchingSettings; - })(); - - /** - * HallucinationMetricBehavior enum. - * @name google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior - * @enum {number} - * @property {number} HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED=0 HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED value - * @property {number} DISABLED=1 DISABLED value - * @property {number} ENABLED=2 ENABLED value - */ - EvaluationMetricsThresholds.HallucinationMetricBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "DISABLED"] = 1; - values[valuesById[2] = "ENABLED"] = 2; - return values; - })(); - - return EvaluationMetricsThresholds; - })(); - - v1beta.EvaluationSettings = (function() { - - /** - * Properties of an EvaluationSettings. - * @memberof google.cloud.ces.v1beta - * @interface IEvaluationSettings - * @property {google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator|null} [scenarioConversationInitiator] EvaluationSettings scenarioConversationInitiator - * @property {google.cloud.ces.v1beta.GoldenRunMethod|null} [goldenRunMethod] EvaluationSettings goldenRunMethod - * @property {google.cloud.ces.v1beta.EvaluationToolCallBehaviour|null} [goldenEvaluationToolCallBehaviour] EvaluationSettings goldenEvaluationToolCallBehaviour - * @property {google.cloud.ces.v1beta.EvaluationToolCallBehaviour|null} [scenarioEvaluationToolCallBehaviour] EvaluationSettings scenarioEvaluationToolCallBehaviour - */ - - /** - * Constructs a new EvaluationSettings. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an EvaluationSettings. - * @implements IEvaluationSettings - * @constructor - * @param {google.cloud.ces.v1beta.IEvaluationSettings=} [properties] Properties to set - */ - function EvaluationSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluationSettings scenarioConversationInitiator. - * @member {google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator} scenarioConversationInitiator - * @memberof google.cloud.ces.v1beta.EvaluationSettings - * @instance - */ - EvaluationSettings.prototype.scenarioConversationInitiator = 0; - - /** - * EvaluationSettings goldenRunMethod. - * @member {google.cloud.ces.v1beta.GoldenRunMethod} goldenRunMethod - * @memberof google.cloud.ces.v1beta.EvaluationSettings - * @instance - */ - EvaluationSettings.prototype.goldenRunMethod = 0; - - /** - * EvaluationSettings goldenEvaluationToolCallBehaviour. - * @member {google.cloud.ces.v1beta.EvaluationToolCallBehaviour} goldenEvaluationToolCallBehaviour - * @memberof google.cloud.ces.v1beta.EvaluationSettings - * @instance - */ - EvaluationSettings.prototype.goldenEvaluationToolCallBehaviour = 0; - - /** - * EvaluationSettings scenarioEvaluationToolCallBehaviour. - * @member {google.cloud.ces.v1beta.EvaluationToolCallBehaviour} scenarioEvaluationToolCallBehaviour - * @memberof google.cloud.ces.v1beta.EvaluationSettings - * @instance - */ - EvaluationSettings.prototype.scenarioEvaluationToolCallBehaviour = 0; - - /** - * Creates a new EvaluationSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationSettings - * @static - * @param {google.cloud.ces.v1beta.IEvaluationSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationSettings} EvaluationSettings instance - */ - EvaluationSettings.create = function create(properties) { - return new EvaluationSettings(properties); - }; - - /** - * Encodes the specified EvaluationSettings message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationSettings - * @static - * @param {google.cloud.ces.v1beta.IEvaluationSettings} message EvaluationSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.scenarioConversationInitiator != null && Object.hasOwnProperty.call(message, "scenarioConversationInitiator")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.scenarioConversationInitiator); - if (message.goldenEvaluationToolCallBehaviour != null && Object.hasOwnProperty.call(message, "goldenEvaluationToolCallBehaviour")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.goldenEvaluationToolCallBehaviour); - if (message.scenarioEvaluationToolCallBehaviour != null && Object.hasOwnProperty.call(message, "scenarioEvaluationToolCallBehaviour")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.scenarioEvaluationToolCallBehaviour); - if (message.goldenRunMethod != null && Object.hasOwnProperty.call(message, "goldenRunMethod")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.goldenRunMethod); - return writer; - }; - - /** - * Encodes the specified EvaluationSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationSettings - * @static - * @param {google.cloud.ces.v1beta.IEvaluationSettings} message EvaluationSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluationSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationSettings} EvaluationSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.scenarioConversationInitiator = reader.int32(); - break; - } - case 4: { - message.goldenRunMethod = reader.int32(); - break; - } - case 2: { - message.goldenEvaluationToolCallBehaviour = reader.int32(); - break; - } - case 3: { - message.scenarioEvaluationToolCallBehaviour = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluationSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationSettings} EvaluationSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluationSettings message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluationSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.scenarioConversationInitiator != null && message.hasOwnProperty("scenarioConversationInitiator")) - switch (message.scenarioConversationInitiator) { - default: - return "scenarioConversationInitiator: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) - switch (message.goldenRunMethod) { - default: - return "goldenRunMethod: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.goldenEvaluationToolCallBehaviour != null && message.hasOwnProperty("goldenEvaluationToolCallBehaviour")) - switch (message.goldenEvaluationToolCallBehaviour) { - default: - return "goldenEvaluationToolCallBehaviour: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.scenarioEvaluationToolCallBehaviour != null && message.hasOwnProperty("scenarioEvaluationToolCallBehaviour")) - switch (message.scenarioEvaluationToolCallBehaviour) { - default: - return "scenarioEvaluationToolCallBehaviour: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an EvaluationSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationSettings} EvaluationSettings - */ - EvaluationSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationSettings) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationSettings(); - switch (object.scenarioConversationInitiator) { - default: - if (typeof object.scenarioConversationInitiator === "number") { - message.scenarioConversationInitiator = object.scenarioConversationInitiator; - break; - } - break; - case "SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED": - case 0: - message.scenarioConversationInitiator = 0; - break; - case "USER": - case 1: - message.scenarioConversationInitiator = 1; - break; - case "AGENT": - case 2: - message.scenarioConversationInitiator = 2; - break; - } - switch (object.goldenRunMethod) { - default: - if (typeof object.goldenRunMethod === "number") { - message.goldenRunMethod = object.goldenRunMethod; - break; - } - break; - case "GOLDEN_RUN_METHOD_UNSPECIFIED": - case 0: - message.goldenRunMethod = 0; - break; - case "STABLE": - case 1: - message.goldenRunMethod = 1; - break; - case "NAIVE": - case 2: - message.goldenRunMethod = 2; - break; - } - switch (object.goldenEvaluationToolCallBehaviour) { - default: - if (typeof object.goldenEvaluationToolCallBehaviour === "number") { - message.goldenEvaluationToolCallBehaviour = object.goldenEvaluationToolCallBehaviour; - break; - } - break; - case "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED": - case 0: - message.goldenEvaluationToolCallBehaviour = 0; - break; - case "REAL": - case 1: - message.goldenEvaluationToolCallBehaviour = 1; - break; - case "FAKE": - case 2: - message.goldenEvaluationToolCallBehaviour = 2; - break; - } - switch (object.scenarioEvaluationToolCallBehaviour) { - default: - if (typeof object.scenarioEvaluationToolCallBehaviour === "number") { - message.scenarioEvaluationToolCallBehaviour = object.scenarioEvaluationToolCallBehaviour; - break; - } - break; - case "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED": - case 0: - message.scenarioEvaluationToolCallBehaviour = 0; - break; - case "REAL": - case 1: - message.scenarioEvaluationToolCallBehaviour = 1; - break; - case "FAKE": - case 2: - message.scenarioEvaluationToolCallBehaviour = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an EvaluationSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationSettings - * @static - * @param {google.cloud.ces.v1beta.EvaluationSettings} message EvaluationSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluationSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.scenarioConversationInitiator = options.enums === String ? "SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED" : 0; - object.goldenEvaluationToolCallBehaviour = options.enums === String ? "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED" : 0; - object.scenarioEvaluationToolCallBehaviour = options.enums === String ? "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED" : 0; - object.goldenRunMethod = options.enums === String ? "GOLDEN_RUN_METHOD_UNSPECIFIED" : 0; - } - if (message.scenarioConversationInitiator != null && message.hasOwnProperty("scenarioConversationInitiator")) - object.scenarioConversationInitiator = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator[message.scenarioConversationInitiator] === undefined ? message.scenarioConversationInitiator : $root.google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator[message.scenarioConversationInitiator] : message.scenarioConversationInitiator; - if (message.goldenEvaluationToolCallBehaviour != null && message.hasOwnProperty("goldenEvaluationToolCallBehaviour")) - object.goldenEvaluationToolCallBehaviour = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationToolCallBehaviour[message.goldenEvaluationToolCallBehaviour] === undefined ? message.goldenEvaluationToolCallBehaviour : $root.google.cloud.ces.v1beta.EvaluationToolCallBehaviour[message.goldenEvaluationToolCallBehaviour] : message.goldenEvaluationToolCallBehaviour; - if (message.scenarioEvaluationToolCallBehaviour != null && message.hasOwnProperty("scenarioEvaluationToolCallBehaviour")) - object.scenarioEvaluationToolCallBehaviour = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationToolCallBehaviour[message.scenarioEvaluationToolCallBehaviour] === undefined ? message.scenarioEvaluationToolCallBehaviour : $root.google.cloud.ces.v1beta.EvaluationToolCallBehaviour[message.scenarioEvaluationToolCallBehaviour] : message.scenarioEvaluationToolCallBehaviour; - if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) - object.goldenRunMethod = options.enums === String ? $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] === undefined ? message.goldenRunMethod : $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] : message.goldenRunMethod; - return object; - }; - - /** - * Converts this EvaluationSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationSettings - * @instance - * @returns {Object.} JSON object - */ - EvaluationSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluationSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluationSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationSettings"; - }; - - /** - * ScenarioConversationInitiator enum. - * @name google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator - * @enum {number} - * @property {number} SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED=0 SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED value - * @property {number} USER=1 USER value - * @property {number} AGENT=2 AGENT value - */ - EvaluationSettings.ScenarioConversationInitiator = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "USER"] = 1; - values[valuesById[2] = "AGENT"] = 2; - return values; - })(); - - return EvaluationSettings; - })(); - - v1beta.ClientCertificateSettings = (function() { - - /** - * Properties of a ClientCertificateSettings. - * @memberof google.cloud.ces.v1beta - * @interface IClientCertificateSettings - * @property {string|null} [tlsCertificate] ClientCertificateSettings tlsCertificate - * @property {string|null} [privateKey] ClientCertificateSettings privateKey - * @property {string|null} [passphrase] ClientCertificateSettings passphrase - */ - - /** - * Constructs a new ClientCertificateSettings. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ClientCertificateSettings. - * @implements IClientCertificateSettings - * @constructor - * @param {google.cloud.ces.v1beta.IClientCertificateSettings=} [properties] Properties to set - */ - function ClientCertificateSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientCertificateSettings tlsCertificate. - * @member {string} tlsCertificate - * @memberof google.cloud.ces.v1beta.ClientCertificateSettings - * @instance - */ - ClientCertificateSettings.prototype.tlsCertificate = ""; - - /** - * ClientCertificateSettings privateKey. - * @member {string} privateKey - * @memberof google.cloud.ces.v1beta.ClientCertificateSettings - * @instance - */ - ClientCertificateSettings.prototype.privateKey = ""; - - /** - * ClientCertificateSettings passphrase. - * @member {string} passphrase - * @memberof google.cloud.ces.v1beta.ClientCertificateSettings - * @instance - */ - ClientCertificateSettings.prototype.passphrase = ""; - - /** - * Creates a new ClientCertificateSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ClientCertificateSettings - * @static - * @param {google.cloud.ces.v1beta.IClientCertificateSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ClientCertificateSettings} ClientCertificateSettings instance - */ - ClientCertificateSettings.create = function create(properties) { - return new ClientCertificateSettings(properties); - }; - - /** - * Encodes the specified ClientCertificateSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ClientCertificateSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ClientCertificateSettings - * @static - * @param {google.cloud.ces.v1beta.IClientCertificateSettings} message ClientCertificateSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientCertificateSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tlsCertificate != null && Object.hasOwnProperty.call(message, "tlsCertificate")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tlsCertificate); - if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.privateKey); - if (message.passphrase != null && Object.hasOwnProperty.call(message, "passphrase")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.passphrase); - return writer; - }; - - /** - * Encodes the specified ClientCertificateSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ClientCertificateSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ClientCertificateSettings - * @static - * @param {google.cloud.ces.v1beta.IClientCertificateSettings} message ClientCertificateSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientCertificateSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientCertificateSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ClientCertificateSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ClientCertificateSettings} ClientCertificateSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientCertificateSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ClientCertificateSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tlsCertificate = reader.string(); - break; - } - case 2: { - message.privateKey = reader.string(); - break; - } - case 3: { - message.passphrase = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientCertificateSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ClientCertificateSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ClientCertificateSettings} ClientCertificateSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientCertificateSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientCertificateSettings message. - * @function verify - * @memberof google.cloud.ces.v1beta.ClientCertificateSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientCertificateSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tlsCertificate != null && message.hasOwnProperty("tlsCertificate")) - if (!$util.isString(message.tlsCertificate)) - return "tlsCertificate: string expected"; - if (message.privateKey != null && message.hasOwnProperty("privateKey")) - if (!$util.isString(message.privateKey)) - return "privateKey: string expected"; - if (message.passphrase != null && message.hasOwnProperty("passphrase")) - if (!$util.isString(message.passphrase)) - return "passphrase: string expected"; - return null; - }; - - /** - * Creates a ClientCertificateSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ClientCertificateSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ClientCertificateSettings} ClientCertificateSettings - */ - ClientCertificateSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ClientCertificateSettings) - return object; - var message = new $root.google.cloud.ces.v1beta.ClientCertificateSettings(); - if (object.tlsCertificate != null) - message.tlsCertificate = String(object.tlsCertificate); - if (object.privateKey != null) - message.privateKey = String(object.privateKey); - if (object.passphrase != null) - message.passphrase = String(object.passphrase); - return message; - }; - - /** - * Creates a plain object from a ClientCertificateSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ClientCertificateSettings - * @static - * @param {google.cloud.ces.v1beta.ClientCertificateSettings} message ClientCertificateSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientCertificateSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.tlsCertificate = ""; - object.privateKey = ""; - object.passphrase = ""; - } - if (message.tlsCertificate != null && message.hasOwnProperty("tlsCertificate")) - object.tlsCertificate = message.tlsCertificate; - if (message.privateKey != null && message.hasOwnProperty("privateKey")) - object.privateKey = message.privateKey; - if (message.passphrase != null && message.hasOwnProperty("passphrase")) - object.passphrase = message.passphrase; - return object; - }; - - /** - * Converts this ClientCertificateSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ClientCertificateSettings - * @instance - * @returns {Object.} JSON object - */ - ClientCertificateSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientCertificateSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ClientCertificateSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientCertificateSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ClientCertificateSettings"; - }; - - return ClientCertificateSettings; - })(); - - v1beta.ConversationLoggingSettings = (function() { - - /** - * Properties of a ConversationLoggingSettings. - * @memberof google.cloud.ces.v1beta - * @interface IConversationLoggingSettings - * @property {boolean|null} [disableConversationLogging] ConversationLoggingSettings disableConversationLogging - */ - - /** - * Constructs a new ConversationLoggingSettings. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ConversationLoggingSettings. - * @implements IConversationLoggingSettings - * @constructor - * @param {google.cloud.ces.v1beta.IConversationLoggingSettings=} [properties] Properties to set - */ - function ConversationLoggingSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConversationLoggingSettings disableConversationLogging. - * @member {boolean} disableConversationLogging - * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings - * @instance - */ - ConversationLoggingSettings.prototype.disableConversationLogging = false; - - /** - * Creates a new ConversationLoggingSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings - * @static - * @param {google.cloud.ces.v1beta.IConversationLoggingSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ConversationLoggingSettings} ConversationLoggingSettings instance - */ - ConversationLoggingSettings.create = function create(properties) { - return new ConversationLoggingSettings(properties); - }; - - /** - * Encodes the specified ConversationLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ConversationLoggingSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings - * @static - * @param {google.cloud.ces.v1beta.IConversationLoggingSettings} message ConversationLoggingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConversationLoggingSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.disableConversationLogging != null && Object.hasOwnProperty.call(message, "disableConversationLogging")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.disableConversationLogging); - return writer; - }; - - /** - * Encodes the specified ConversationLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ConversationLoggingSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings - * @static - * @param {google.cloud.ces.v1beta.IConversationLoggingSettings} message ConversationLoggingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConversationLoggingSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConversationLoggingSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ConversationLoggingSettings} ConversationLoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConversationLoggingSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ConversationLoggingSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.disableConversationLogging = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConversationLoggingSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ConversationLoggingSettings} ConversationLoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConversationLoggingSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConversationLoggingSettings message. - * @function verify - * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConversationLoggingSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.disableConversationLogging != null && message.hasOwnProperty("disableConversationLogging")) - if (typeof message.disableConversationLogging !== "boolean") - return "disableConversationLogging: boolean expected"; - return null; - }; - - /** - * Creates a ConversationLoggingSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ConversationLoggingSettings} ConversationLoggingSettings - */ - ConversationLoggingSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ConversationLoggingSettings) - return object; - var message = new $root.google.cloud.ces.v1beta.ConversationLoggingSettings(); - if (object.disableConversationLogging != null) - message.disableConversationLogging = Boolean(object.disableConversationLogging); - return message; - }; - - /** - * Creates a plain object from a ConversationLoggingSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings - * @static - * @param {google.cloud.ces.v1beta.ConversationLoggingSettings} message ConversationLoggingSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConversationLoggingSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.disableConversationLogging = false; - if (message.disableConversationLogging != null && message.hasOwnProperty("disableConversationLogging")) - object.disableConversationLogging = message.disableConversationLogging; - return object; - }; - - /** - * Converts this ConversationLoggingSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings - * @instance - * @returns {Object.} JSON object - */ - ConversationLoggingSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConversationLoggingSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConversationLoggingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ConversationLoggingSettings"; - }; - - return ConversationLoggingSettings; - })(); - - v1beta.CloudLoggingSettings = (function() { - - /** - * Properties of a CloudLoggingSettings. - * @memberof google.cloud.ces.v1beta - * @interface ICloudLoggingSettings - * @property {boolean|null} [enableCloudLogging] CloudLoggingSettings enableCloudLogging - */ - - /** - * Constructs a new CloudLoggingSettings. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a CloudLoggingSettings. - * @implements ICloudLoggingSettings - * @constructor - * @param {google.cloud.ces.v1beta.ICloudLoggingSettings=} [properties] Properties to set - */ - function CloudLoggingSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudLoggingSettings enableCloudLogging. - * @member {boolean} enableCloudLogging - * @memberof google.cloud.ces.v1beta.CloudLoggingSettings - * @instance - */ - CloudLoggingSettings.prototype.enableCloudLogging = false; - - /** - * Creates a new CloudLoggingSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.CloudLoggingSettings - * @static - * @param {google.cloud.ces.v1beta.ICloudLoggingSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.CloudLoggingSettings} CloudLoggingSettings instance - */ - CloudLoggingSettings.create = function create(properties) { - return new CloudLoggingSettings(properties); - }; - - /** - * Encodes the specified CloudLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.CloudLoggingSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.CloudLoggingSettings - * @static - * @param {google.cloud.ces.v1beta.ICloudLoggingSettings} message CloudLoggingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudLoggingSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enableCloudLogging != null && Object.hasOwnProperty.call(message, "enableCloudLogging")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableCloudLogging); - return writer; - }; - - /** - * Encodes the specified CloudLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CloudLoggingSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.CloudLoggingSettings - * @static - * @param {google.cloud.ces.v1beta.ICloudLoggingSettings} message CloudLoggingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudLoggingSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudLoggingSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.CloudLoggingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.CloudLoggingSettings} CloudLoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudLoggingSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CloudLoggingSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enableCloudLogging = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudLoggingSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.CloudLoggingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.CloudLoggingSettings} CloudLoggingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudLoggingSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudLoggingSettings message. - * @function verify - * @memberof google.cloud.ces.v1beta.CloudLoggingSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudLoggingSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enableCloudLogging != null && message.hasOwnProperty("enableCloudLogging")) - if (typeof message.enableCloudLogging !== "boolean") - return "enableCloudLogging: boolean expected"; - return null; - }; - - /** - * Creates a CloudLoggingSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.CloudLoggingSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.CloudLoggingSettings} CloudLoggingSettings - */ - CloudLoggingSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.CloudLoggingSettings) - return object; - var message = new $root.google.cloud.ces.v1beta.CloudLoggingSettings(); - if (object.enableCloudLogging != null) - message.enableCloudLogging = Boolean(object.enableCloudLogging); - return message; - }; - - /** - * Creates a plain object from a CloudLoggingSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.CloudLoggingSettings - * @static - * @param {google.cloud.ces.v1beta.CloudLoggingSettings} message CloudLoggingSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudLoggingSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.enableCloudLogging = false; - if (message.enableCloudLogging != null && message.hasOwnProperty("enableCloudLogging")) - object.enableCloudLogging = message.enableCloudLogging; - return object; - }; - - /** - * Converts this CloudLoggingSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.CloudLoggingSettings - * @instance - * @returns {Object.} JSON object - */ - CloudLoggingSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudLoggingSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.CloudLoggingSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudLoggingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.CloudLoggingSettings"; - }; - - return CloudLoggingSettings; - })(); - - v1beta.AudioRecordingConfig = (function() { - - /** - * Properties of an AudioRecordingConfig. - * @memberof google.cloud.ces.v1beta - * @interface IAudioRecordingConfig - * @property {string|null} [gcsBucket] AudioRecordingConfig gcsBucket - * @property {string|null} [gcsPathPrefix] AudioRecordingConfig gcsPathPrefix - */ - - /** - * Constructs a new AudioRecordingConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an AudioRecordingConfig. - * @implements IAudioRecordingConfig - * @constructor - * @param {google.cloud.ces.v1beta.IAudioRecordingConfig=} [properties] Properties to set - */ - function AudioRecordingConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AudioRecordingConfig gcsBucket. - * @member {string} gcsBucket - * @memberof google.cloud.ces.v1beta.AudioRecordingConfig - * @instance - */ - AudioRecordingConfig.prototype.gcsBucket = ""; - - /** - * AudioRecordingConfig gcsPathPrefix. - * @member {string} gcsPathPrefix - * @memberof google.cloud.ces.v1beta.AudioRecordingConfig - * @instance - */ - AudioRecordingConfig.prototype.gcsPathPrefix = ""; - - /** - * Creates a new AudioRecordingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.AudioRecordingConfig - * @static - * @param {google.cloud.ces.v1beta.IAudioRecordingConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.AudioRecordingConfig} AudioRecordingConfig instance - */ - AudioRecordingConfig.create = function create(properties) { - return new AudioRecordingConfig(properties); - }; - - /** - * Encodes the specified AudioRecordingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.AudioRecordingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.AudioRecordingConfig - * @static - * @param {google.cloud.ces.v1beta.IAudioRecordingConfig} message AudioRecordingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AudioRecordingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsBucket != null && Object.hasOwnProperty.call(message, "gcsBucket")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsBucket); - if (message.gcsPathPrefix != null && Object.hasOwnProperty.call(message, "gcsPathPrefix")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsPathPrefix); - return writer; - }; - - /** - * Encodes the specified AudioRecordingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AudioRecordingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.AudioRecordingConfig - * @static - * @param {google.cloud.ces.v1beta.IAudioRecordingConfig} message AudioRecordingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AudioRecordingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AudioRecordingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.AudioRecordingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.AudioRecordingConfig} AudioRecordingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AudioRecordingConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AudioRecordingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsBucket = reader.string(); - break; - } - case 2: { - message.gcsPathPrefix = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AudioRecordingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.AudioRecordingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.AudioRecordingConfig} AudioRecordingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AudioRecordingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AudioRecordingConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.AudioRecordingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AudioRecordingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) - if (!$util.isString(message.gcsBucket)) - return "gcsBucket: string expected"; - if (message.gcsPathPrefix != null && message.hasOwnProperty("gcsPathPrefix")) - if (!$util.isString(message.gcsPathPrefix)) - return "gcsPathPrefix: string expected"; - return null; - }; - - /** - * Creates an AudioRecordingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.AudioRecordingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.AudioRecordingConfig} AudioRecordingConfig - */ - AudioRecordingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.AudioRecordingConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.AudioRecordingConfig(); - if (object.gcsBucket != null) - message.gcsBucket = String(object.gcsBucket); - if (object.gcsPathPrefix != null) - message.gcsPathPrefix = String(object.gcsPathPrefix); - return message; - }; - - /** - * Creates a plain object from an AudioRecordingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.AudioRecordingConfig - * @static - * @param {google.cloud.ces.v1beta.AudioRecordingConfig} message AudioRecordingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AudioRecordingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.gcsBucket = ""; - object.gcsPathPrefix = ""; - } - if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) - object.gcsBucket = message.gcsBucket; - if (message.gcsPathPrefix != null && message.hasOwnProperty("gcsPathPrefix")) - object.gcsPathPrefix = message.gcsPathPrefix; - return object; - }; - - /** - * Converts this AudioRecordingConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.AudioRecordingConfig - * @instance - * @returns {Object.} JSON object - */ - AudioRecordingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AudioRecordingConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.AudioRecordingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AudioRecordingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.AudioRecordingConfig"; - }; - - return AudioRecordingConfig; - })(); - - v1beta.RedactionConfig = (function() { - - /** - * Properties of a RedactionConfig. - * @memberof google.cloud.ces.v1beta - * @interface IRedactionConfig - * @property {boolean|null} [enableRedaction] RedactionConfig enableRedaction - * @property {string|null} [inspectTemplate] RedactionConfig inspectTemplate - * @property {string|null} [deidentifyTemplate] RedactionConfig deidentifyTemplate - */ - - /** - * Constructs a new RedactionConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a RedactionConfig. - * @implements IRedactionConfig - * @constructor - * @param {google.cloud.ces.v1beta.IRedactionConfig=} [properties] Properties to set - */ - function RedactionConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RedactionConfig enableRedaction. - * @member {boolean} enableRedaction - * @memberof google.cloud.ces.v1beta.RedactionConfig - * @instance - */ - RedactionConfig.prototype.enableRedaction = false; - - /** - * RedactionConfig inspectTemplate. - * @member {string} inspectTemplate - * @memberof google.cloud.ces.v1beta.RedactionConfig - * @instance - */ - RedactionConfig.prototype.inspectTemplate = ""; - - /** - * RedactionConfig deidentifyTemplate. - * @member {string} deidentifyTemplate - * @memberof google.cloud.ces.v1beta.RedactionConfig - * @instance - */ - RedactionConfig.prototype.deidentifyTemplate = ""; - - /** - * Creates a new RedactionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.RedactionConfig - * @static - * @param {google.cloud.ces.v1beta.IRedactionConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.RedactionConfig} RedactionConfig instance - */ - RedactionConfig.create = function create(properties) { - return new RedactionConfig(properties); - }; - - /** - * Encodes the specified RedactionConfig message. Does not implicitly {@link google.cloud.ces.v1beta.RedactionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.RedactionConfig - * @static - * @param {google.cloud.ces.v1beta.IRedactionConfig} message RedactionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RedactionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enableRedaction != null && Object.hasOwnProperty.call(message, "enableRedaction")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableRedaction); - if (message.inspectTemplate != null && Object.hasOwnProperty.call(message, "inspectTemplate")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inspectTemplate); - if (message.deidentifyTemplate != null && Object.hasOwnProperty.call(message, "deidentifyTemplate")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.deidentifyTemplate); - return writer; - }; - - /** - * Encodes the specified RedactionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RedactionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.RedactionConfig - * @static - * @param {google.cloud.ces.v1beta.IRedactionConfig} message RedactionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RedactionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RedactionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.RedactionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.RedactionConfig} RedactionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RedactionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RedactionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enableRedaction = reader.bool(); - break; - } - case 2: { - message.inspectTemplate = reader.string(); - break; - } - case 3: { - message.deidentifyTemplate = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RedactionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.RedactionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.RedactionConfig} RedactionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RedactionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RedactionConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.RedactionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RedactionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enableRedaction != null && message.hasOwnProperty("enableRedaction")) - if (typeof message.enableRedaction !== "boolean") - return "enableRedaction: boolean expected"; - if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) - if (!$util.isString(message.inspectTemplate)) - return "inspectTemplate: string expected"; - if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) - if (!$util.isString(message.deidentifyTemplate)) - return "deidentifyTemplate: string expected"; - return null; - }; - - /** - * Creates a RedactionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.RedactionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.RedactionConfig} RedactionConfig - */ - RedactionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.RedactionConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.RedactionConfig(); - if (object.enableRedaction != null) - message.enableRedaction = Boolean(object.enableRedaction); - if (object.inspectTemplate != null) - message.inspectTemplate = String(object.inspectTemplate); - if (object.deidentifyTemplate != null) - message.deidentifyTemplate = String(object.deidentifyTemplate); - return message; - }; - - /** - * Creates a plain object from a RedactionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.RedactionConfig - * @static - * @param {google.cloud.ces.v1beta.RedactionConfig} message RedactionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RedactionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.enableRedaction = false; - object.inspectTemplate = ""; - object.deidentifyTemplate = ""; - } - if (message.enableRedaction != null && message.hasOwnProperty("enableRedaction")) - object.enableRedaction = message.enableRedaction; - if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) - object.inspectTemplate = message.inspectTemplate; - if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) - object.deidentifyTemplate = message.deidentifyTemplate; - return object; - }; - - /** - * Converts this RedactionConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.RedactionConfig - * @instance - * @returns {Object.} JSON object - */ - RedactionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RedactionConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.RedactionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RedactionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.RedactionConfig"; - }; - - return RedactionConfig; - })(); - - v1beta.DataStoreSettings = (function() { - - /** - * Properties of a DataStoreSettings. - * @memberof google.cloud.ces.v1beta - * @interface IDataStoreSettings - * @property {Array.|null} [engines] DataStoreSettings engines - */ - - /** - * Constructs a new DataStoreSettings. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DataStoreSettings. - * @implements IDataStoreSettings - * @constructor - * @param {google.cloud.ces.v1beta.IDataStoreSettings=} [properties] Properties to set - */ - function DataStoreSettings(properties) { - this.engines = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataStoreSettings engines. - * @member {Array.} engines - * @memberof google.cloud.ces.v1beta.DataStoreSettings - * @instance - */ - DataStoreSettings.prototype.engines = $util.emptyArray; - - /** - * Creates a new DataStoreSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DataStoreSettings - * @static - * @param {google.cloud.ces.v1beta.IDataStoreSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DataStoreSettings} DataStoreSettings instance - */ - DataStoreSettings.create = function create(properties) { - return new DataStoreSettings(properties); - }; - - /** - * Encodes the specified DataStoreSettings message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DataStoreSettings - * @static - * @param {google.cloud.ces.v1beta.IDataStoreSettings} message DataStoreSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataStoreSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.engines != null && message.engines.length) - for (var i = 0; i < message.engines.length; ++i) - $root.google.cloud.ces.v1beta.DataStoreSettings.Engine.encode(message.engines[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataStoreSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreSettings - * @static - * @param {google.cloud.ces.v1beta.IDataStoreSettings} message DataStoreSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataStoreSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataStoreSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DataStoreSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DataStoreSettings} DataStoreSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataStoreSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - if (!(message.engines && message.engines.length)) - message.engines = []; - message.engines.push($root.google.cloud.ces.v1beta.DataStoreSettings.Engine.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataStoreSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DataStoreSettings} DataStoreSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataStoreSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataStoreSettings message. - * @function verify - * @memberof google.cloud.ces.v1beta.DataStoreSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataStoreSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.engines != null && message.hasOwnProperty("engines")) { - if (!Array.isArray(message.engines)) - return "engines: array expected"; - for (var i = 0; i < message.engines.length; ++i) { - var error = $root.google.cloud.ces.v1beta.DataStoreSettings.Engine.verify(message.engines[i]); - if (error) - return "engines." + error; - } - } - return null; - }; - - /** - * Creates a DataStoreSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DataStoreSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DataStoreSettings} DataStoreSettings - */ - DataStoreSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DataStoreSettings) - return object; - var message = new $root.google.cloud.ces.v1beta.DataStoreSettings(); - if (object.engines) { - if (!Array.isArray(object.engines)) - throw TypeError(".google.cloud.ces.v1beta.DataStoreSettings.engines: array expected"); - message.engines = []; - for (var i = 0; i < object.engines.length; ++i) { - if (typeof object.engines[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.DataStoreSettings.engines: object expected"); - message.engines[i] = $root.google.cloud.ces.v1beta.DataStoreSettings.Engine.fromObject(object.engines[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a DataStoreSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DataStoreSettings - * @static - * @param {google.cloud.ces.v1beta.DataStoreSettings} message DataStoreSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataStoreSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.engines = []; - if (message.engines && message.engines.length) { - object.engines = []; - for (var j = 0; j < message.engines.length; ++j) - object.engines[j] = $root.google.cloud.ces.v1beta.DataStoreSettings.Engine.toObject(message.engines[j], options); - } - return object; - }; - - /** - * Converts this DataStoreSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DataStoreSettings - * @instance - * @returns {Object.} JSON object - */ - DataStoreSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataStoreSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DataStoreSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataStoreSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreSettings"; - }; - - DataStoreSettings.Engine = (function() { - - /** - * Properties of an Engine. - * @memberof google.cloud.ces.v1beta.DataStoreSettings - * @interface IEngine - * @property {string|null} [name] Engine name - * @property {google.cloud.ces.v1beta.DataStoreSettings.Engine.Type|null} [type] Engine type - */ - - /** - * Constructs a new Engine. - * @memberof google.cloud.ces.v1beta.DataStoreSettings - * @classdesc Represents an Engine. - * @implements IEngine - * @constructor - * @param {google.cloud.ces.v1beta.DataStoreSettings.IEngine=} [properties] Properties to set - */ - function Engine(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Engine name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine - * @instance - */ - Engine.prototype.name = ""; - - /** - * Engine type. - * @member {google.cloud.ces.v1beta.DataStoreSettings.Engine.Type} type - * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine - * @instance - */ - Engine.prototype.type = 0; - - /** - * Creates a new Engine instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine - * @static - * @param {google.cloud.ces.v1beta.DataStoreSettings.IEngine=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DataStoreSettings.Engine} Engine instance - */ - Engine.create = function create(properties) { - return new Engine(properties); - }; - - /** - * Encodes the specified Engine message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.Engine.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine - * @static - * @param {google.cloud.ces.v1beta.DataStoreSettings.IEngine} message Engine message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Engine.encode = function encode(message, writer) { - if (!writer) - 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 0 =*/16).int32(message.type); - return writer; - }; - - /** - * Encodes the specified Engine message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.Engine.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine - * @static - * @param {google.cloud.ces.v1beta.DataStoreSettings.IEngine} message Engine message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Engine.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Engine message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DataStoreSettings.Engine} Engine - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Engine.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreSettings.Engine(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.type = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Engine message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DataStoreSettings.Engine} Engine - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Engine.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Engine message. - * @function verify - * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Engine.verify = function verify(message) { - if (typeof message !== "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")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Engine message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DataStoreSettings.Engine} Engine - */ - Engine.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DataStoreSettings.Engine) - return object; - var message = new $root.google.cloud.ces.v1beta.DataStoreSettings.Engine(); - if (object.name != null) - message.name = String(object.name); - 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 "ENGINE_TYPE_SEARCH": - case 1: - message.type = 1; - break; - case "ENGINE_TYPE_CHAT": - case 2: - message.type = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Engine message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine - * @static - * @param {google.cloud.ces.v1beta.DataStoreSettings.Engine} message Engine - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Engine.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.ces.v1beta.DataStoreSettings.Engine.Type[message.type] === undefined ? message.type : $root.google.cloud.ces.v1beta.DataStoreSettings.Engine.Type[message.type] : message.type; - return object; - }; - - /** - * Converts this Engine to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine - * @instance - * @returns {Object.} JSON object - */ - Engine.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Engine - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Engine.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreSettings.Engine"; - }; - - /** - * Type enum. - * @name google.cloud.ces.v1beta.DataStoreSettings.Engine.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} ENGINE_TYPE_SEARCH=1 ENGINE_TYPE_SEARCH value - * @property {number} ENGINE_TYPE_CHAT=2 ENGINE_TYPE_CHAT value - */ - Engine.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENGINE_TYPE_SEARCH"] = 1; - values[valuesById[2] = "ENGINE_TYPE_CHAT"] = 2; - return values; - })(); - - return Engine; - })(); - - return DataStoreSettings; - })(); - - v1beta.EvaluationPersona = (function() { - - /** - * Properties of an EvaluationPersona. - * @memberof google.cloud.ces.v1beta - * @interface IEvaluationPersona - * @property {string|null} [name] EvaluationPersona name - * @property {string|null} [description] EvaluationPersona description - * @property {string|null} [displayName] EvaluationPersona displayName - * @property {string|null} [personality] EvaluationPersona personality - * @property {google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig|null} [speechConfig] EvaluationPersona speechConfig - */ - - /** - * Constructs a new EvaluationPersona. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an EvaluationPersona. - * @implements IEvaluationPersona - * @constructor - * @param {google.cloud.ces.v1beta.IEvaluationPersona=} [properties] Properties to set - */ - function EvaluationPersona(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluationPersona name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.EvaluationPersona - * @instance - */ - EvaluationPersona.prototype.name = ""; - - /** - * EvaluationPersona description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.EvaluationPersona - * @instance - */ - EvaluationPersona.prototype.description = ""; - - /** - * EvaluationPersona displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.EvaluationPersona - * @instance - */ - EvaluationPersona.prototype.displayName = ""; - - /** - * EvaluationPersona personality. - * @member {string} personality - * @memberof google.cloud.ces.v1beta.EvaluationPersona - * @instance - */ - EvaluationPersona.prototype.personality = ""; - - /** - * EvaluationPersona speechConfig. - * @member {google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig|null|undefined} speechConfig - * @memberof google.cloud.ces.v1beta.EvaluationPersona - * @instance - */ - EvaluationPersona.prototype.speechConfig = null; - - /** - * Creates a new EvaluationPersona instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationPersona - * @static - * @param {google.cloud.ces.v1beta.IEvaluationPersona=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationPersona} EvaluationPersona instance - */ - EvaluationPersona.create = function create(properties) { - return new EvaluationPersona(properties); - }; - - /** - * Encodes the specified EvaluationPersona message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationPersona - * @static - * @param {google.cloud.ces.v1beta.IEvaluationPersona} message EvaluationPersona message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationPersona.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.personality != null && Object.hasOwnProperty.call(message, "personality")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.personality); - if (message.speechConfig != null && Object.hasOwnProperty.call(message, "speechConfig")) - $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.encode(message.speechConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EvaluationPersona message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationPersona - * @static - * @param {google.cloud.ces.v1beta.IEvaluationPersona} message EvaluationPersona message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationPersona.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluationPersona message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationPersona - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationPersona} EvaluationPersona - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationPersona.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationPersona(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - case 4: { - message.personality = reader.string(); - break; - } - case 5: { - message.speechConfig = $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluationPersona message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationPersona - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationPersona} EvaluationPersona - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationPersona.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluationPersona message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationPersona - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluationPersona.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.personality != null && message.hasOwnProperty("personality")) - if (!$util.isString(message.personality)) - return "personality: string expected"; - if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) { - var error = $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.verify(message.speechConfig); - if (error) - return "speechConfig." + error; - } - return null; - }; - - /** - * Creates an EvaluationPersona message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationPersona - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationPersona} EvaluationPersona - */ - EvaluationPersona.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationPersona) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationPersona(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.personality != null) - message.personality = String(object.personality); - if (object.speechConfig != null) { - if (typeof object.speechConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationPersona.speechConfig: object expected"); - message.speechConfig = $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.fromObject(object.speechConfig); - } - return message; - }; - - /** - * Creates a plain object from an EvaluationPersona message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationPersona - * @static - * @param {google.cloud.ces.v1beta.EvaluationPersona} message EvaluationPersona - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluationPersona.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.displayName = ""; - object.personality = ""; - object.speechConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.personality != null && message.hasOwnProperty("personality")) - object.personality = message.personality; - if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) - object.speechConfig = $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.toObject(message.speechConfig, options); - return object; - }; - - /** - * Converts this EvaluationPersona to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationPersona - * @instance - * @returns {Object.} JSON object - */ - EvaluationPersona.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluationPersona - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationPersona - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluationPersona.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationPersona"; - }; - - EvaluationPersona.SpeechConfig = (function() { - - /** - * Properties of a SpeechConfig. - * @memberof google.cloud.ces.v1beta.EvaluationPersona - * @interface ISpeechConfig - * @property {number|null} [speakingRate] SpeechConfig speakingRate - * @property {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment|null} [environment] SpeechConfig environment - * @property {string|null} [voiceId] SpeechConfig voiceId - */ - - /** - * Constructs a new SpeechConfig. - * @memberof google.cloud.ces.v1beta.EvaluationPersona - * @classdesc Represents a SpeechConfig. - * @implements ISpeechConfig - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig=} [properties] Properties to set - */ - function SpeechConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SpeechConfig speakingRate. - * @member {number} speakingRate - * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig - * @instance - */ - SpeechConfig.prototype.speakingRate = 0; - - /** - * SpeechConfig environment. - * @member {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment} environment - * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig - * @instance - */ - SpeechConfig.prototype.environment = 0; - - /** - * SpeechConfig voiceId. - * @member {string} voiceId - * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig - * @instance - */ - SpeechConfig.prototype.voiceId = ""; - - /** - * Creates a new SpeechConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig - * @static - * @param {google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig} SpeechConfig instance - */ - SpeechConfig.create = function create(properties) { - return new SpeechConfig(properties); - }; - - /** - * Encodes the specified SpeechConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig - * @static - * @param {google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig} message SpeechConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpeechConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.speakingRate != null && Object.hasOwnProperty.call(message, "speakingRate")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.speakingRate); - if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.environment); - if (message.voiceId != null && Object.hasOwnProperty.call(message, "voiceId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.voiceId); - return writer; - }; - - /** - * Encodes the specified SpeechConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig - * @static - * @param {google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig} message SpeechConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SpeechConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig} SpeechConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpeechConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.speakingRate = reader.double(); - break; - } - case 2: { - message.environment = reader.int32(); - break; - } - case 3: { - message.voiceId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SpeechConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig} SpeechConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpeechConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SpeechConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SpeechConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) - if (typeof message.speakingRate !== "number") - return "speakingRate: number expected"; - if (message.environment != null && message.hasOwnProperty("environment")) - switch (message.environment) { - default: - return "environment: enum value expected"; - case 0: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.voiceId != null && message.hasOwnProperty("voiceId")) - if (!$util.isString(message.voiceId)) - return "voiceId: string expected"; - return null; - }; - - /** - * Creates a SpeechConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig} SpeechConfig - */ - SpeechConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig(); - if (object.speakingRate != null) - message.speakingRate = Number(object.speakingRate); - switch (object.environment) { - default: - if (typeof object.environment === "number") { - message.environment = object.environment; - break; - } - break; - case "BACKGROUND_ENVIRONMENT_UNSPECIFIED": - case 0: - message.environment = 0; - break; - case "CALL_CENTER": - case 3: - message.environment = 3; - break; - case "TRAFFIC": - case 4: - message.environment = 4; - break; - case "KIDS_NOISE": - case 5: - message.environment = 5; - break; - case "CAFE": - case 6: - message.environment = 6; - break; - } - if (object.voiceId != null) - message.voiceId = String(object.voiceId); - return message; - }; - - /** - * Creates a plain object from a SpeechConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig - * @static - * @param {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig} message SpeechConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SpeechConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.speakingRate = 0; - object.environment = options.enums === String ? "BACKGROUND_ENVIRONMENT_UNSPECIFIED" : 0; - object.voiceId = ""; - } - if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) - object.speakingRate = options.json && !isFinite(message.speakingRate) ? String(message.speakingRate) : message.speakingRate; - if (message.environment != null && message.hasOwnProperty("environment")) - object.environment = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment[message.environment] === undefined ? message.environment : $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment[message.environment] : message.environment; - if (message.voiceId != null && message.hasOwnProperty("voiceId")) - object.voiceId = message.voiceId; - return object; - }; - - /** - * Converts this SpeechConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig - * @instance - * @returns {Object.} JSON object - */ - SpeechConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SpeechConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SpeechConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig"; - }; - - /** - * BackgroundEnvironment enum. - * @name google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment - * @enum {number} - * @property {number} BACKGROUND_ENVIRONMENT_UNSPECIFIED=0 BACKGROUND_ENVIRONMENT_UNSPECIFIED value - * @property {number} CALL_CENTER=3 CALL_CENTER value - * @property {number} TRAFFIC=4 TRAFFIC value - * @property {number} KIDS_NOISE=5 KIDS_NOISE value - * @property {number} CAFE=6 CAFE value - */ - SpeechConfig.BackgroundEnvironment = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "BACKGROUND_ENVIRONMENT_UNSPECIFIED"] = 0; - values[valuesById[3] = "CALL_CENTER"] = 3; - values[valuesById[4] = "TRAFFIC"] = 4; - values[valuesById[5] = "KIDS_NOISE"] = 5; - values[valuesById[6] = "CAFE"] = 6; - return values; - })(); - - return SpeechConfig; - })(); - - return EvaluationPersona; - })(); - - v1beta.BigQueryExportSettings = (function() { - - /** - * Properties of a BigQueryExportSettings. - * @memberof google.cloud.ces.v1beta - * @interface IBigQueryExportSettings - * @property {boolean|null} [enabled] BigQueryExportSettings enabled - * @property {string|null} [project] BigQueryExportSettings project - * @property {string|null} [dataset] BigQueryExportSettings dataset - */ - - /** - * Constructs a new BigQueryExportSettings. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a BigQueryExportSettings. - * @implements IBigQueryExportSettings - * @constructor - * @param {google.cloud.ces.v1beta.IBigQueryExportSettings=} [properties] Properties to set - */ - function BigQueryExportSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BigQueryExportSettings enabled. - * @member {boolean} enabled - * @memberof google.cloud.ces.v1beta.BigQueryExportSettings - * @instance - */ - BigQueryExportSettings.prototype.enabled = false; - - /** - * BigQueryExportSettings project. - * @member {string} project - * @memberof google.cloud.ces.v1beta.BigQueryExportSettings - * @instance - */ - BigQueryExportSettings.prototype.project = ""; - - /** - * BigQueryExportSettings dataset. - * @member {string} dataset - * @memberof google.cloud.ces.v1beta.BigQueryExportSettings - * @instance - */ - BigQueryExportSettings.prototype.dataset = ""; - - /** - * Creates a new BigQueryExportSettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.BigQueryExportSettings - * @static - * @param {google.cloud.ces.v1beta.IBigQueryExportSettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.BigQueryExportSettings} BigQueryExportSettings instance - */ - BigQueryExportSettings.create = function create(properties) { - return new BigQueryExportSettings(properties); - }; - - /** - * Encodes the specified BigQueryExportSettings message. Does not implicitly {@link google.cloud.ces.v1beta.BigQueryExportSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.BigQueryExportSettings - * @static - * @param {google.cloud.ces.v1beta.IBigQueryExportSettings} message BigQueryExportSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BigQueryExportSettings.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.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); - if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dataset); - return writer; - }; - - /** - * Encodes the specified BigQueryExportSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BigQueryExportSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.BigQueryExportSettings - * @static - * @param {google.cloud.ces.v1beta.IBigQueryExportSettings} message BigQueryExportSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BigQueryExportSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BigQueryExportSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.BigQueryExportSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.BigQueryExportSettings} BigQueryExportSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BigQueryExportSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BigQueryExportSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enabled = reader.bool(); - break; - } - case 2: { - message.project = reader.string(); - break; - } - case 3: { - message.dataset = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BigQueryExportSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.BigQueryExportSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.BigQueryExportSettings} BigQueryExportSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BigQueryExportSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BigQueryExportSettings message. - * @function verify - * @memberof google.cloud.ces.v1beta.BigQueryExportSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BigQueryExportSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enabled != null && message.hasOwnProperty("enabled")) - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) - if (!$util.isString(message.dataset)) - return "dataset: string expected"; - return null; - }; - - /** - * Creates a BigQueryExportSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.BigQueryExportSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.BigQueryExportSettings} BigQueryExportSettings - */ - BigQueryExportSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.BigQueryExportSettings) - return object; - var message = new $root.google.cloud.ces.v1beta.BigQueryExportSettings(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.project != null) - message.project = String(object.project); - if (object.dataset != null) - message.dataset = String(object.dataset); - return message; - }; - - /** - * Creates a plain object from a BigQueryExportSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.BigQueryExportSettings - * @static - * @param {google.cloud.ces.v1beta.BigQueryExportSettings} message BigQueryExportSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BigQueryExportSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.enabled = false; - object.project = ""; - object.dataset = ""; - } - if (message.enabled != null && message.hasOwnProperty("enabled")) - object.enabled = message.enabled; - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = message.dataset; - return object; - }; - - /** - * Converts this BigQueryExportSettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.BigQueryExportSettings - * @instance - * @returns {Object.} JSON object - */ - BigQueryExportSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BigQueryExportSettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.BigQueryExportSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BigQueryExportSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.BigQueryExportSettings"; - }; - - return BigQueryExportSettings; - })(); - - /** - * EvaluationToolCallBehaviour enum. - * @name google.cloud.ces.v1beta.EvaluationToolCallBehaviour - * @enum {number} - * @property {number} EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED=0 EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED value - * @property {number} REAL=1 REAL value - * @property {number} FAKE=2 FAKE value - */ - v1beta.EvaluationToolCallBehaviour = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED"] = 0; - values[valuesById[1] = "REAL"] = 1; - values[valuesById[2] = "FAKE"] = 2; - return values; - })(); - - v1beta.CodeBlock = (function() { - - /** - * Properties of a CodeBlock. - * @memberof google.cloud.ces.v1beta - * @interface ICodeBlock - * @property {string|null} [pythonCode] CodeBlock pythonCode - */ - - /** - * Constructs a new CodeBlock. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a CodeBlock. - * @implements ICodeBlock - * @constructor - * @param {google.cloud.ces.v1beta.ICodeBlock=} [properties] Properties to set - */ - function CodeBlock(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CodeBlock pythonCode. - * @member {string} pythonCode - * @memberof google.cloud.ces.v1beta.CodeBlock - * @instance - */ - CodeBlock.prototype.pythonCode = ""; - - /** - * Creates a new CodeBlock instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.CodeBlock - * @static - * @param {google.cloud.ces.v1beta.ICodeBlock=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.CodeBlock} CodeBlock instance - */ - CodeBlock.create = function create(properties) { - return new CodeBlock(properties); - }; - - /** - * Encodes the specified CodeBlock message. Does not implicitly {@link google.cloud.ces.v1beta.CodeBlock.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.CodeBlock - * @static - * @param {google.cloud.ces.v1beta.ICodeBlock} message CodeBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CodeBlock.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pythonCode); - return writer; - }; - - /** - * Encodes the specified CodeBlock message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CodeBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.CodeBlock - * @static - * @param {google.cloud.ces.v1beta.ICodeBlock} message CodeBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CodeBlock.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CodeBlock message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.CodeBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.CodeBlock} CodeBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CodeBlock.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CodeBlock(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pythonCode = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CodeBlock message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.CodeBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.CodeBlock} CodeBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CodeBlock.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CodeBlock message. - * @function verify - * @memberof google.cloud.ces.v1beta.CodeBlock - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CodeBlock.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) - if (!$util.isString(message.pythonCode)) - return "pythonCode: string expected"; - return null; - }; - - /** - * Creates a CodeBlock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.CodeBlock - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.CodeBlock} CodeBlock - */ - CodeBlock.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.CodeBlock) - return object; - var message = new $root.google.cloud.ces.v1beta.CodeBlock(); - if (object.pythonCode != null) - message.pythonCode = String(object.pythonCode); - return message; - }; - - /** - * Creates a plain object from a CodeBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.CodeBlock - * @static - * @param {google.cloud.ces.v1beta.CodeBlock} message CodeBlock - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CodeBlock.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.pythonCode = ""; - if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) - object.pythonCode = message.pythonCode; - return object; - }; - - /** - * Converts this CodeBlock to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.CodeBlock - * @instance - * @returns {Object.} JSON object - */ - CodeBlock.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CodeBlock - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.CodeBlock - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CodeBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.CodeBlock"; - }; - - return CodeBlock; - })(); - - v1beta.ToolFakeConfig = (function() { - - /** - * Properties of a ToolFakeConfig. - * @memberof google.cloud.ces.v1beta - * @interface IToolFakeConfig - * @property {google.cloud.ces.v1beta.ICodeBlock|null} [codeBlock] ToolFakeConfig codeBlock - * @property {boolean|null} [enableFakeMode] ToolFakeConfig enableFakeMode - */ - - /** - * Constructs a new ToolFakeConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ToolFakeConfig. - * @implements IToolFakeConfig - * @constructor - * @param {google.cloud.ces.v1beta.IToolFakeConfig=} [properties] Properties to set - */ - function ToolFakeConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolFakeConfig codeBlock. - * @member {google.cloud.ces.v1beta.ICodeBlock|null|undefined} codeBlock - * @memberof google.cloud.ces.v1beta.ToolFakeConfig - * @instance - */ - ToolFakeConfig.prototype.codeBlock = null; - - /** - * ToolFakeConfig enableFakeMode. - * @member {boolean} enableFakeMode - * @memberof google.cloud.ces.v1beta.ToolFakeConfig - * @instance - */ - ToolFakeConfig.prototype.enableFakeMode = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ToolFakeConfig toolResponse. - * @member {"codeBlock"|undefined} toolResponse - * @memberof google.cloud.ces.v1beta.ToolFakeConfig - * @instance - */ - Object.defineProperty(ToolFakeConfig.prototype, "toolResponse", { - get: $util.oneOfGetter($oneOfFields = ["codeBlock"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ToolFakeConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ToolFakeConfig - * @static - * @param {google.cloud.ces.v1beta.IToolFakeConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ToolFakeConfig} ToolFakeConfig instance - */ - ToolFakeConfig.create = function create(properties) { - return new ToolFakeConfig(properties); - }; - - /** - * Encodes the specified ToolFakeConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ToolFakeConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ToolFakeConfig - * @static - * @param {google.cloud.ces.v1beta.IToolFakeConfig} message ToolFakeConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolFakeConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.codeBlock != null && Object.hasOwnProperty.call(message, "codeBlock")) - $root.google.cloud.ces.v1beta.CodeBlock.encode(message.codeBlock, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.enableFakeMode != null && Object.hasOwnProperty.call(message, "enableFakeMode")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableFakeMode); - return writer; - }; - - /** - * Encodes the specified ToolFakeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolFakeConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ToolFakeConfig - * @static - * @param {google.cloud.ces.v1beta.IToolFakeConfig} message ToolFakeConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolFakeConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolFakeConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ToolFakeConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ToolFakeConfig} ToolFakeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolFakeConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ToolFakeConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.codeBlock = $root.google.cloud.ces.v1beta.CodeBlock.decode(reader, reader.uint32()); - break; - } - case 2: { - message.enableFakeMode = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolFakeConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ToolFakeConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ToolFakeConfig} ToolFakeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolFakeConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolFakeConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.ToolFakeConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolFakeConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.codeBlock != null && message.hasOwnProperty("codeBlock")) { - properties.toolResponse = 1; - { - var error = $root.google.cloud.ces.v1beta.CodeBlock.verify(message.codeBlock); - if (error) - return "codeBlock." + error; - } - } - if (message.enableFakeMode != null && message.hasOwnProperty("enableFakeMode")) - if (typeof message.enableFakeMode !== "boolean") - return "enableFakeMode: boolean expected"; - return null; - }; - - /** - * Creates a ToolFakeConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ToolFakeConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ToolFakeConfig} ToolFakeConfig - */ - ToolFakeConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ToolFakeConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.ToolFakeConfig(); - if (object.codeBlock != null) { - if (typeof object.codeBlock !== "object") - throw TypeError(".google.cloud.ces.v1beta.ToolFakeConfig.codeBlock: object expected"); - message.codeBlock = $root.google.cloud.ces.v1beta.CodeBlock.fromObject(object.codeBlock); - } - if (object.enableFakeMode != null) - message.enableFakeMode = Boolean(object.enableFakeMode); - return message; - }; - - /** - * Creates a plain object from a ToolFakeConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ToolFakeConfig - * @static - * @param {google.cloud.ces.v1beta.ToolFakeConfig} message ToolFakeConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolFakeConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.enableFakeMode = false; - if (message.codeBlock != null && message.hasOwnProperty("codeBlock")) { - object.codeBlock = $root.google.cloud.ces.v1beta.CodeBlock.toObject(message.codeBlock, options); - if (options.oneofs) - object.toolResponse = "codeBlock"; - } - if (message.enableFakeMode != null && message.hasOwnProperty("enableFakeMode")) - object.enableFakeMode = message.enableFakeMode; - return object; - }; - - /** - * Converts this ToolFakeConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ToolFakeConfig - * @instance - * @returns {Object.} JSON object - */ - ToolFakeConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolFakeConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ToolFakeConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolFakeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ToolFakeConfig"; - }; - - return ToolFakeConfig; - })(); - - /** - * GoldenRunMethod enum. - * @name google.cloud.ces.v1beta.GoldenRunMethod - * @enum {number} - * @property {number} GOLDEN_RUN_METHOD_UNSPECIFIED=0 GOLDEN_RUN_METHOD_UNSPECIFIED value - * @property {number} STABLE=1 STABLE value - * @property {number} NAIVE=2 NAIVE value - */ - v1beta.GoldenRunMethod = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "GOLDEN_RUN_METHOD_UNSPECIFIED"] = 0; - values[valuesById[1] = "STABLE"] = 1; - values[valuesById[2] = "NAIVE"] = 2; - return values; - })(); - - v1beta.Schema = (function() { - - /** - * Properties of a Schema. - * @memberof google.cloud.ces.v1beta - * @interface ISchema - * @property {google.cloud.ces.v1beta.Schema.Type|null} [type] Schema type - * @property {Object.|null} [properties] Schema properties - * @property {Array.|null} [required] Schema required - * @property {string|null} [description] Schema description - * @property {google.cloud.ces.v1beta.ISchema|null} [items] Schema items - * @property {boolean|null} [nullable] Schema nullable - * @property {boolean|null} [uniqueItems] Schema uniqueItems - * @property {Array.|null} [prefixItems] Schema prefixItems - * @property {google.cloud.ces.v1beta.ISchema|null} [additionalProperties] Schema additionalProperties - * @property {Array.|null} [anyOf] Schema anyOf - * @property {Array.|null} ["enum"] Schema enum - * @property {google.protobuf.IValue|null} ["default"] Schema default - * @property {string|null} [ref] Schema ref - * @property {Object.|null} [defs] Schema defs - * @property {string|null} [title] Schema title - * @property {number|Long|null} [minItems] Schema minItems - * @property {number|Long|null} [maxItems] Schema maxItems - * @property {number|null} [minimum] Schema minimum - * @property {number|null} [maximum] Schema maximum - */ - - /** - * Constructs a new Schema. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a Schema. - * @implements ISchema - * @constructor - * @param {google.cloud.ces.v1beta.ISchema=} [properties] Properties to set - */ - function Schema(properties) { - this.properties = {}; - this.required = []; - this.prefixItems = []; - this.anyOf = []; - this["enum"] = []; - this.defs = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Schema type. - * @member {google.cloud.ces.v1beta.Schema.Type} type - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype.type = 0; - - /** - * Schema properties. - * @member {Object.} properties - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype.properties = $util.emptyObject; - - /** - * Schema required. - * @member {Array.} required - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype.required = $util.emptyArray; - - /** - * Schema description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype.description = ""; - - /** - * Schema items. - * @member {google.cloud.ces.v1beta.ISchema|null|undefined} items - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype.items = null; - - /** - * Schema nullable. - * @member {boolean} nullable - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype.nullable = false; - - /** - * Schema uniqueItems. - * @member {boolean} uniqueItems - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype.uniqueItems = false; - - /** - * Schema prefixItems. - * @member {Array.} prefixItems - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype.prefixItems = $util.emptyArray; - - /** - * Schema additionalProperties. - * @member {google.cloud.ces.v1beta.ISchema|null|undefined} additionalProperties - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype.additionalProperties = null; - - /** - * Schema anyOf. - * @member {Array.} anyOf - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype.anyOf = $util.emptyArray; - - /** - * Schema enum. - * @member {Array.} enum - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype["enum"] = $util.emptyArray; - - /** - * Schema default. - * @member {google.protobuf.IValue|null|undefined} default - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype["default"] = null; - - /** - * Schema ref. - * @member {string} ref - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype.ref = ""; - - /** - * Schema defs. - * @member {Object.} defs - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype.defs = $util.emptyObject; - - /** - * Schema title. - * @member {string} title - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype.title = ""; - - /** - * Schema minItems. - * @member {number|Long} minItems - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype.minItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Schema maxItems. - * @member {number|Long} maxItems - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype.maxItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Schema minimum. - * @member {number|null|undefined} minimum - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype.minimum = null; - - /** - * Schema maximum. - * @member {number|null|undefined} maximum - * @memberof google.cloud.ces.v1beta.Schema - * @instance - */ - Schema.prototype.maximum = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Schema.prototype, "_minimum", { - get: $util.oneOfGetter($oneOfFields = ["minimum"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Schema.prototype, "_maximum", { - get: $util.oneOfGetter($oneOfFields = ["maximum"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Schema instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Schema - * @static - * @param {google.cloud.ces.v1beta.ISchema=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Schema} Schema instance - */ - Schema.create = function create(properties) { - return new Schema(properties); - }; - - /** - * Encodes the specified Schema message. Does not implicitly {@link google.cloud.ces.v1beta.Schema.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Schema - * @static - * @param {google.cloud.ces.v1beta.ISchema} message Schema message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Schema.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), 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.ces.v1beta.Schema.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.required != null && message.required.length) - for (var i = 0; i < message.required.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.required[i]); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); - if (message.items != null && Object.hasOwnProperty.call(message, "items")) - $root.google.cloud.ces.v1beta.Schema.encode(message.items, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.nullable != null && Object.hasOwnProperty.call(message, "nullable")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.nullable); - if (message.uniqueItems != null && Object.hasOwnProperty.call(message, "uniqueItems")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.uniqueItems); - if (message.prefixItems != null && message.prefixItems.length) - for (var i = 0; i < message.prefixItems.length; ++i) - $root.google.cloud.ces.v1beta.Schema.encode(message.prefixItems[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalProperties != null && Object.hasOwnProperty.call(message, "additionalProperties")) - $root.google.cloud.ces.v1beta.Schema.encode(message.additionalProperties, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.anyOf != null && message.anyOf.length) - for (var i = 0; i < message.anyOf.length; ++i) - $root.google.cloud.ces.v1beta.Schema.encode(message.anyOf[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message["enum"] != null && message["enum"].length) - for (var i = 0; i < message["enum"].length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).string(message["enum"][i]); - if (message["default"] != null && Object.hasOwnProperty.call(message, "default")) - $root.google.protobuf.Value.encode(message["default"], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.ref != null && Object.hasOwnProperty.call(message, "ref")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.ref); - if (message.defs != null && Object.hasOwnProperty.call(message, "defs")) - for (var keys = Object.keys(message.defs), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.ces.v1beta.Schema.encode(message.defs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.title); - if (message.minItems != null && Object.hasOwnProperty.call(message, "minItems")) - writer.uint32(/* id 16, wireType 0 =*/128).int64(message.minItems); - if (message.maxItems != null && Object.hasOwnProperty.call(message, "maxItems")) - writer.uint32(/* id 17, wireType 0 =*/136).int64(message.maxItems); - if (message.minimum != null && Object.hasOwnProperty.call(message, "minimum")) - writer.uint32(/* id 18, wireType 1 =*/145).double(message.minimum); - if (message.maximum != null && Object.hasOwnProperty.call(message, "maximum")) - writer.uint32(/* id 19, wireType 1 =*/153).double(message.maximum); - return writer; - }; - - /** - * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Schema.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Schema - * @static - * @param {google.cloud.ces.v1beta.ISchema} message Schema message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Schema.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Schema message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Schema - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Schema} Schema - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Schema.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Schema(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - if (message.properties === $util.emptyObject) - message.properties = {}; - 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.ces.v1beta.Schema.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.properties[key] = value; - break; - } - case 3: { - if (!(message.required && message.required.length)) - message.required = []; - message.required.push(reader.string()); - break; - } - case 4: { - message.description = reader.string(); - break; - } - case 5: { - message.items = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); - break; - } - case 6: { - message.nullable = reader.bool(); - break; - } - case 7: { - message.uniqueItems = reader.bool(); - break; - } - case 8: { - if (!(message.prefixItems && message.prefixItems.length)) - message.prefixItems = []; - message.prefixItems.push($root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32())); - break; - } - case 9: { - message.additionalProperties = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); - break; - } - case 10: { - if (!(message.anyOf && message.anyOf.length)) - message.anyOf = []; - message.anyOf.push($root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32())); - break; - } - case 11: { - if (!(message["enum"] && message["enum"].length)) - message["enum"] = []; - message["enum"].push(reader.string()); - break; - } - case 12: { - message["default"] = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - } - case 13: { - message.ref = reader.string(); - break; - } - case 14: { - if (message.defs === $util.emptyObject) - message.defs = {}; - 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.ces.v1beta.Schema.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.defs[key] = value; - break; - } - case 15: { - message.title = reader.string(); - break; - } - case 16: { - message.minItems = reader.int64(); - break; - } - case 17: { - message.maxItems = reader.int64(); - break; - } - case 18: { - message.minimum = reader.double(); - break; - } - case 19: { - message.maximum = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Schema message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Schema - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Schema} Schema - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Schema.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Schema message. - * @function verify - * @memberof google.cloud.ces.v1beta.Schema - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Schema.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Schema.verify(message.properties[key[i]]); - if (error) - return "properties." + error; - } - } - if (message.required != null && message.hasOwnProperty("required")) { - if (!Array.isArray(message.required)) - return "required: array expected"; - for (var i = 0; i < message.required.length; ++i) - if (!$util.isString(message.required[i])) - return "required: string[] expected"; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.items != null && message.hasOwnProperty("items")) { - var error = $root.google.cloud.ces.v1beta.Schema.verify(message.items); - if (error) - return "items." + error; - } - if (message.nullable != null && message.hasOwnProperty("nullable")) - if (typeof message.nullable !== "boolean") - return "nullable: boolean expected"; - if (message.uniqueItems != null && message.hasOwnProperty("uniqueItems")) - if (typeof message.uniqueItems !== "boolean") - return "uniqueItems: boolean expected"; - if (message.prefixItems != null && message.hasOwnProperty("prefixItems")) { - if (!Array.isArray(message.prefixItems)) - return "prefixItems: array expected"; - for (var i = 0; i < message.prefixItems.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Schema.verify(message.prefixItems[i]); - if (error) - return "prefixItems." + error; - } - } - if (message.additionalProperties != null && message.hasOwnProperty("additionalProperties")) { - var error = $root.google.cloud.ces.v1beta.Schema.verify(message.additionalProperties); - if (error) - return "additionalProperties." + error; - } - if (message.anyOf != null && message.hasOwnProperty("anyOf")) { - if (!Array.isArray(message.anyOf)) - return "anyOf: array expected"; - for (var i = 0; i < message.anyOf.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Schema.verify(message.anyOf[i]); - if (error) - return "anyOf." + error; - } - } - if (message["enum"] != null && message.hasOwnProperty("enum")) { - if (!Array.isArray(message["enum"])) - return "enum: array expected"; - for (var i = 0; i < message["enum"].length; ++i) - if (!$util.isString(message["enum"][i])) - return "enum: string[] expected"; - } - if (message["default"] != null && message.hasOwnProperty("default")) { - var error = $root.google.protobuf.Value.verify(message["default"]); - if (error) - return "default." + error; - } - if (message.ref != null && message.hasOwnProperty("ref")) - if (!$util.isString(message.ref)) - return "ref: string expected"; - if (message.defs != null && message.hasOwnProperty("defs")) { - if (!$util.isObject(message.defs)) - return "defs: object expected"; - var key = Object.keys(message.defs); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Schema.verify(message.defs[key[i]]); - if (error) - return "defs." + error; - } - } - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.minItems != null && message.hasOwnProperty("minItems")) - if (!$util.isInteger(message.minItems) && !(message.minItems && $util.isInteger(message.minItems.low) && $util.isInteger(message.minItems.high))) - return "minItems: integer|Long expected"; - if (message.maxItems != null && message.hasOwnProperty("maxItems")) - if (!$util.isInteger(message.maxItems) && !(message.maxItems && $util.isInteger(message.maxItems.low) && $util.isInteger(message.maxItems.high))) - return "maxItems: integer|Long expected"; - if (message.minimum != null && message.hasOwnProperty("minimum")) { - properties._minimum = 1; - if (typeof message.minimum !== "number") - return "minimum: number expected"; - } - if (message.maximum != null && message.hasOwnProperty("maximum")) { - properties._maximum = 1; - if (typeof message.maximum !== "number") - return "maximum: number expected"; - } - return null; - }; - - /** - * Creates a Schema message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Schema - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Schema} Schema - */ - Schema.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Schema) - return object; - var message = new $root.google.cloud.ces.v1beta.Schema(); - 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 "STRING": - case 1: - message.type = 1; - break; - case "INTEGER": - case 2: - message.type = 2; - break; - case "NUMBER": - case 3: - message.type = 3; - break; - case "BOOLEAN": - case 4: - message.type = 4; - break; - case "OBJECT": - case 5: - message.type = 5; - break; - case "ARRAY": - case 6: - message.type = 6; - break; - } - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.ces.v1beta.Schema.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { - if (typeof object.properties[keys[i]] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Schema.properties: object expected"); - message.properties[keys[i]] = $root.google.cloud.ces.v1beta.Schema.fromObject(object.properties[keys[i]]); - } - } - if (object.required) { - if (!Array.isArray(object.required)) - throw TypeError(".google.cloud.ces.v1beta.Schema.required: array expected"); - message.required = []; - for (var i = 0; i < object.required.length; ++i) - message.required[i] = String(object.required[i]); - } - if (object.description != null) - message.description = String(object.description); - if (object.items != null) { - if (typeof object.items !== "object") - throw TypeError(".google.cloud.ces.v1beta.Schema.items: object expected"); - message.items = $root.google.cloud.ces.v1beta.Schema.fromObject(object.items); - } - if (object.nullable != null) - message.nullable = Boolean(object.nullable); - if (object.uniqueItems != null) - message.uniqueItems = Boolean(object.uniqueItems); - if (object.prefixItems) { - if (!Array.isArray(object.prefixItems)) - throw TypeError(".google.cloud.ces.v1beta.Schema.prefixItems: array expected"); - message.prefixItems = []; - for (var i = 0; i < object.prefixItems.length; ++i) { - if (typeof object.prefixItems[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Schema.prefixItems: object expected"); - message.prefixItems[i] = $root.google.cloud.ces.v1beta.Schema.fromObject(object.prefixItems[i]); - } - } - if (object.additionalProperties != null) { - if (typeof object.additionalProperties !== "object") - throw TypeError(".google.cloud.ces.v1beta.Schema.additionalProperties: object expected"); - message.additionalProperties = $root.google.cloud.ces.v1beta.Schema.fromObject(object.additionalProperties); - } - if (object.anyOf) { - if (!Array.isArray(object.anyOf)) - throw TypeError(".google.cloud.ces.v1beta.Schema.anyOf: array expected"); - message.anyOf = []; - for (var i = 0; i < object.anyOf.length; ++i) { - if (typeof object.anyOf[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Schema.anyOf: object expected"); - message.anyOf[i] = $root.google.cloud.ces.v1beta.Schema.fromObject(object.anyOf[i]); - } - } - if (object["enum"]) { - if (!Array.isArray(object["enum"])) - throw TypeError(".google.cloud.ces.v1beta.Schema.enum: array expected"); - message["enum"] = []; - for (var i = 0; i < object["enum"].length; ++i) - message["enum"][i] = String(object["enum"][i]); - } - if (object["default"] != null) { - if (typeof object["default"] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Schema.default: object expected"); - message["default"] = $root.google.protobuf.Value.fromObject(object["default"]); - } - if (object.ref != null) - message.ref = String(object.ref); - if (object.defs) { - if (typeof object.defs !== "object") - throw TypeError(".google.cloud.ces.v1beta.Schema.defs: object expected"); - message.defs = {}; - for (var keys = Object.keys(object.defs), i = 0; i < keys.length; ++i) { - if (typeof object.defs[keys[i]] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Schema.defs: object expected"); - message.defs[keys[i]] = $root.google.cloud.ces.v1beta.Schema.fromObject(object.defs[keys[i]]); - } - } - if (object.title != null) - message.title = String(object.title); - if (object.minItems != null) - if ($util.Long) - (message.minItems = $util.Long.fromValue(object.minItems)).unsigned = false; - else if (typeof object.minItems === "string") - message.minItems = parseInt(object.minItems, 10); - else if (typeof object.minItems === "number") - message.minItems = object.minItems; - else if (typeof object.minItems === "object") - message.minItems = new $util.LongBits(object.minItems.low >>> 0, object.minItems.high >>> 0).toNumber(); - if (object.maxItems != null) - if ($util.Long) - (message.maxItems = $util.Long.fromValue(object.maxItems)).unsigned = false; - else if (typeof object.maxItems === "string") - message.maxItems = parseInt(object.maxItems, 10); - else if (typeof object.maxItems === "number") - message.maxItems = object.maxItems; - else if (typeof object.maxItems === "object") - message.maxItems = new $util.LongBits(object.maxItems.low >>> 0, object.maxItems.high >>> 0).toNumber(); - if (object.minimum != null) - message.minimum = Number(object.minimum); - if (object.maximum != null) - message.maximum = Number(object.maximum); - return message; - }; - - /** - * Creates a plain object from a Schema message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Schema - * @static - * @param {google.cloud.ces.v1beta.Schema} message Schema - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Schema.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.required = []; - object.prefixItems = []; - object.anyOf = []; - object["enum"] = []; - } - if (options.objects || options.defaults) { - object.properties = {}; - object.defs = {}; - } - if (options.defaults) { - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.description = ""; - object.items = null; - object.nullable = false; - object.uniqueItems = false; - object.additionalProperties = null; - object["default"] = null; - object.ref = ""; - object.title = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.minItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.minItems = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.maxItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxItems = options.longs === String ? "0" : 0; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.ces.v1beta.Schema.Type[message.type] === undefined ? message.type : $root.google.cloud.ces.v1beta.Schema.Type[message.type] : message.type; - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = $root.google.cloud.ces.v1beta.Schema.toObject(message.properties[keys2[j]], options); - } - if (message.required && message.required.length) { - object.required = []; - for (var j = 0; j < message.required.length; ++j) - object.required[j] = message.required[j]; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.items != null && message.hasOwnProperty("items")) - object.items = $root.google.cloud.ces.v1beta.Schema.toObject(message.items, options); - if (message.nullable != null && message.hasOwnProperty("nullable")) - object.nullable = message.nullable; - if (message.uniqueItems != null && message.hasOwnProperty("uniqueItems")) - object.uniqueItems = message.uniqueItems; - if (message.prefixItems && message.prefixItems.length) { - object.prefixItems = []; - for (var j = 0; j < message.prefixItems.length; ++j) - object.prefixItems[j] = $root.google.cloud.ces.v1beta.Schema.toObject(message.prefixItems[j], options); - } - if (message.additionalProperties != null && message.hasOwnProperty("additionalProperties")) - object.additionalProperties = $root.google.cloud.ces.v1beta.Schema.toObject(message.additionalProperties, options); - if (message.anyOf && message.anyOf.length) { - object.anyOf = []; - for (var j = 0; j < message.anyOf.length; ++j) - object.anyOf[j] = $root.google.cloud.ces.v1beta.Schema.toObject(message.anyOf[j], options); - } - if (message["enum"] && message["enum"].length) { - object["enum"] = []; - for (var j = 0; j < message["enum"].length; ++j) - object["enum"][j] = message["enum"][j]; - } - if (message["default"] != null && message.hasOwnProperty("default")) - object["default"] = $root.google.protobuf.Value.toObject(message["default"], options); - if (message.ref != null && message.hasOwnProperty("ref")) - object.ref = message.ref; - if (message.defs && (keys2 = Object.keys(message.defs)).length) { - object.defs = {}; - for (var j = 0; j < keys2.length; ++j) - object.defs[keys2[j]] = $root.google.cloud.ces.v1beta.Schema.toObject(message.defs[keys2[j]], options); - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.minItems != null && message.hasOwnProperty("minItems")) - if (typeof message.minItems === "number") - object.minItems = options.longs === String ? String(message.minItems) : message.minItems; - else - object.minItems = options.longs === String ? $util.Long.prototype.toString.call(message.minItems) : options.longs === Number ? new $util.LongBits(message.minItems.low >>> 0, message.minItems.high >>> 0).toNumber() : message.minItems; - if (message.maxItems != null && message.hasOwnProperty("maxItems")) - if (typeof message.maxItems === "number") - object.maxItems = options.longs === String ? String(message.maxItems) : message.maxItems; - else - object.maxItems = options.longs === String ? $util.Long.prototype.toString.call(message.maxItems) : options.longs === Number ? new $util.LongBits(message.maxItems.low >>> 0, message.maxItems.high >>> 0).toNumber() : message.maxItems; - if (message.minimum != null && message.hasOwnProperty("minimum")) { - object.minimum = options.json && !isFinite(message.minimum) ? String(message.minimum) : message.minimum; - if (options.oneofs) - object._minimum = "minimum"; - } - if (message.maximum != null && message.hasOwnProperty("maximum")) { - object.maximum = options.json && !isFinite(message.maximum) ? String(message.maximum) : message.maximum; - if (options.oneofs) - object._maximum = "maximum"; - } - return object; - }; - - /** - * Converts this Schema to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Schema - * @instance - * @returns {Object.} JSON object - */ - Schema.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Schema - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Schema - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Schema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Schema"; - }; - - /** - * Type enum. - * @name google.cloud.ces.v1beta.Schema.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} STRING=1 STRING value - * @property {number} INTEGER=2 INTEGER value - * @property {number} NUMBER=3 NUMBER value - * @property {number} BOOLEAN=4 BOOLEAN value - * @property {number} OBJECT=5 OBJECT value - * @property {number} ARRAY=6 ARRAY value - */ - Schema.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STRING"] = 1; - values[valuesById[2] = "INTEGER"] = 2; - values[valuesById[3] = "NUMBER"] = 3; - values[valuesById[4] = "BOOLEAN"] = 4; - values[valuesById[5] = "OBJECT"] = 5; - values[valuesById[6] = "ARRAY"] = 6; - return values; - })(); - - return Schema; - })(); - - v1beta.AppSnapshot = (function() { - - /** - * Properties of an AppSnapshot. - * @memberof google.cloud.ces.v1beta - * @interface IAppSnapshot - * @property {google.cloud.ces.v1beta.IApp|null} [app] AppSnapshot app - * @property {Array.|null} [agents] AppSnapshot agents - * @property {Array.|null} [tools] AppSnapshot tools - * @property {Array.|null} [examples] AppSnapshot examples - * @property {Array.|null} [guardrails] AppSnapshot guardrails - * @property {Array.|null} [toolsets] AppSnapshot toolsets - */ - - /** - * Constructs a new AppSnapshot. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an AppSnapshot. - * @implements IAppSnapshot - * @constructor - * @param {google.cloud.ces.v1beta.IAppSnapshot=} [properties] Properties to set - */ - function AppSnapshot(properties) { - this.agents = []; - this.tools = []; - this.examples = []; - this.guardrails = []; - this.toolsets = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AppSnapshot app. - * @member {google.cloud.ces.v1beta.IApp|null|undefined} app - * @memberof google.cloud.ces.v1beta.AppSnapshot - * @instance - */ - AppSnapshot.prototype.app = null; - - /** - * AppSnapshot agents. - * @member {Array.} agents - * @memberof google.cloud.ces.v1beta.AppSnapshot - * @instance - */ - AppSnapshot.prototype.agents = $util.emptyArray; - - /** - * AppSnapshot tools. - * @member {Array.} tools - * @memberof google.cloud.ces.v1beta.AppSnapshot - * @instance - */ - AppSnapshot.prototype.tools = $util.emptyArray; - - /** - * AppSnapshot examples. - * @member {Array.} examples - * @memberof google.cloud.ces.v1beta.AppSnapshot - * @instance - */ - AppSnapshot.prototype.examples = $util.emptyArray; - - /** - * AppSnapshot guardrails. - * @member {Array.} guardrails - * @memberof google.cloud.ces.v1beta.AppSnapshot - * @instance - */ - AppSnapshot.prototype.guardrails = $util.emptyArray; - - /** - * AppSnapshot toolsets. - * @member {Array.} toolsets - * @memberof google.cloud.ces.v1beta.AppSnapshot - * @instance - */ - AppSnapshot.prototype.toolsets = $util.emptyArray; - - /** - * Creates a new AppSnapshot instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.AppSnapshot - * @static - * @param {google.cloud.ces.v1beta.IAppSnapshot=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.AppSnapshot} AppSnapshot instance - */ - AppSnapshot.create = function create(properties) { - return new AppSnapshot(properties); - }; - - /** - * Encodes the specified AppSnapshot message. Does not implicitly {@link google.cloud.ces.v1beta.AppSnapshot.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.AppSnapshot - * @static - * @param {google.cloud.ces.v1beta.IAppSnapshot} message AppSnapshot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppSnapshot.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.app != null && Object.hasOwnProperty.call(message, "app")) - $root.google.cloud.ces.v1beta.App.encode(message.app, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.agents != null && message.agents.length) - for (var i = 0; i < message.agents.length; ++i) - $root.google.cloud.ces.v1beta.Agent.encode(message.agents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.tools != null && message.tools.length) - for (var i = 0; i < message.tools.length; ++i) - $root.google.cloud.ces.v1beta.Tool.encode(message.tools[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.examples != null && message.examples.length) - for (var i = 0; i < message.examples.length; ++i) - $root.google.cloud.ces.v1beta.Example.encode(message.examples[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.guardrails != null && message.guardrails.length) - for (var i = 0; i < message.guardrails.length; ++i) - $root.google.cloud.ces.v1beta.Guardrail.encode(message.guardrails[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.toolsets != null && message.toolsets.length) - for (var i = 0; i < message.toolsets.length; ++i) - $root.google.cloud.ces.v1beta.Toolset.encode(message.toolsets[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AppSnapshot message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AppSnapshot.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.AppSnapshot - * @static - * @param {google.cloud.ces.v1beta.IAppSnapshot} message AppSnapshot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppSnapshot.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AppSnapshot message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.AppSnapshot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.AppSnapshot} AppSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppSnapshot.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AppSnapshot(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.app = $root.google.cloud.ces.v1beta.App.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.agents && message.agents.length)) - message.agents = []; - message.agents.push($root.google.cloud.ces.v1beta.Agent.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.tools && message.tools.length)) - message.tools = []; - message.tools.push($root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.examples && message.examples.length)) - message.examples = []; - message.examples.push($root.google.cloud.ces.v1beta.Example.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.guardrails && message.guardrails.length)) - message.guardrails = []; - message.guardrails.push($root.google.cloud.ces.v1beta.Guardrail.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.toolsets && message.toolsets.length)) - message.toolsets = []; - message.toolsets.push($root.google.cloud.ces.v1beta.Toolset.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AppSnapshot message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.AppSnapshot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.AppSnapshot} AppSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppSnapshot.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AppSnapshot message. - * @function verify - * @memberof google.cloud.ces.v1beta.AppSnapshot - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AppSnapshot.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.app != null && message.hasOwnProperty("app")) { - var error = $root.google.cloud.ces.v1beta.App.verify(message.app); - if (error) - return "app." + error; - } - if (message.agents != null && message.hasOwnProperty("agents")) { - if (!Array.isArray(message.agents)) - return "agents: array expected"; - for (var i = 0; i < message.agents.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Agent.verify(message.agents[i]); - if (error) - return "agents." + error; - } - } - if (message.tools != null && message.hasOwnProperty("tools")) { - if (!Array.isArray(message.tools)) - return "tools: array expected"; - for (var i = 0; i < message.tools.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tools[i]); - if (error) - return "tools." + error; - } - } - if (message.examples != null && message.hasOwnProperty("examples")) { - if (!Array.isArray(message.examples)) - return "examples: array expected"; - for (var i = 0; i < message.examples.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Example.verify(message.examples[i]); - if (error) - return "examples." + error; - } - } - if (message.guardrails != null && message.hasOwnProperty("guardrails")) { - if (!Array.isArray(message.guardrails)) - return "guardrails: array expected"; - for (var i = 0; i < message.guardrails.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Guardrail.verify(message.guardrails[i]); - if (error) - return "guardrails." + error; - } - } - if (message.toolsets != null && message.hasOwnProperty("toolsets")) { - if (!Array.isArray(message.toolsets)) - return "toolsets: array expected"; - for (var i = 0; i < message.toolsets.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Toolset.verify(message.toolsets[i]); - if (error) - return "toolsets." + error; - } - } - return null; - }; - - /** - * Creates an AppSnapshot message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.AppSnapshot - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.AppSnapshot} AppSnapshot - */ - AppSnapshot.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.AppSnapshot) - return object; - var message = new $root.google.cloud.ces.v1beta.AppSnapshot(); - if (object.app != null) { - if (typeof object.app !== "object") - throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.app: object expected"); - message.app = $root.google.cloud.ces.v1beta.App.fromObject(object.app); - } - if (object.agents) { - if (!Array.isArray(object.agents)) - throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.agents: array expected"); - message.agents = []; - for (var i = 0; i < object.agents.length; ++i) { - if (typeof object.agents[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.agents: object expected"); - message.agents[i] = $root.google.cloud.ces.v1beta.Agent.fromObject(object.agents[i]); - } - } - if (object.tools) { - if (!Array.isArray(object.tools)) - throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.tools: array expected"); - message.tools = []; - for (var i = 0; i < object.tools.length; ++i) { - if (typeof object.tools[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.tools: object expected"); - message.tools[i] = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tools[i]); - } - } - if (object.examples) { - if (!Array.isArray(object.examples)) - throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.examples: array expected"); - message.examples = []; - for (var i = 0; i < object.examples.length; ++i) { - if (typeof object.examples[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.examples: object expected"); - message.examples[i] = $root.google.cloud.ces.v1beta.Example.fromObject(object.examples[i]); - } - } - if (object.guardrails) { - if (!Array.isArray(object.guardrails)) - throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.guardrails: array expected"); - message.guardrails = []; - for (var i = 0; i < object.guardrails.length; ++i) { - if (typeof object.guardrails[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.guardrails: object expected"); - message.guardrails[i] = $root.google.cloud.ces.v1beta.Guardrail.fromObject(object.guardrails[i]); - } - } - if (object.toolsets) { - if (!Array.isArray(object.toolsets)) - throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.toolsets: array expected"); - message.toolsets = []; - for (var i = 0; i < object.toolsets.length; ++i) { - if (typeof object.toolsets[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.toolsets: object expected"); - message.toolsets[i] = $root.google.cloud.ces.v1beta.Toolset.fromObject(object.toolsets[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AppSnapshot message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.AppSnapshot - * @static - * @param {google.cloud.ces.v1beta.AppSnapshot} message AppSnapshot - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AppSnapshot.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.agents = []; - object.tools = []; - object.examples = []; - object.guardrails = []; - object.toolsets = []; - } - if (options.defaults) - object.app = null; - if (message.app != null && message.hasOwnProperty("app")) - object.app = $root.google.cloud.ces.v1beta.App.toObject(message.app, options); - if (message.agents && message.agents.length) { - object.agents = []; - for (var j = 0; j < message.agents.length; ++j) - object.agents[j] = $root.google.cloud.ces.v1beta.Agent.toObject(message.agents[j], options); - } - if (message.tools && message.tools.length) { - object.tools = []; - for (var j = 0; j < message.tools.length; ++j) - object.tools[j] = $root.google.cloud.ces.v1beta.Tool.toObject(message.tools[j], options); - } - if (message.examples && message.examples.length) { - object.examples = []; - for (var j = 0; j < message.examples.length; ++j) - object.examples[j] = $root.google.cloud.ces.v1beta.Example.toObject(message.examples[j], options); - } - if (message.guardrails && message.guardrails.length) { - object.guardrails = []; - for (var j = 0; j < message.guardrails.length; ++j) - object.guardrails[j] = $root.google.cloud.ces.v1beta.Guardrail.toObject(message.guardrails[j], options); - } - if (message.toolsets && message.toolsets.length) { - object.toolsets = []; - for (var j = 0; j < message.toolsets.length; ++j) - object.toolsets[j] = $root.google.cloud.ces.v1beta.Toolset.toObject(message.toolsets[j], options); - } - return object; - }; - - /** - * Converts this AppSnapshot to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.AppSnapshot - * @instance - * @returns {Object.} JSON object - */ - AppSnapshot.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AppSnapshot - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.AppSnapshot - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AppSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.AppSnapshot"; - }; - - return AppSnapshot; - })(); - - v1beta.AppVersion = (function() { - - /** - * Properties of an AppVersion. - * @memberof google.cloud.ces.v1beta - * @interface IAppVersion - * @property {string|null} [name] AppVersion name - * @property {string|null} [displayName] AppVersion displayName - * @property {string|null} [description] AppVersion description - * @property {string|null} [creator] AppVersion creator - * @property {google.protobuf.ITimestamp|null} [createTime] AppVersion createTime - * @property {google.cloud.ces.v1beta.IAppSnapshot|null} [snapshot] AppVersion snapshot - * @property {string|null} [etag] AppVersion etag - */ - - /** - * Constructs a new AppVersion. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an AppVersion. - * @implements IAppVersion - * @constructor - * @param {google.cloud.ces.v1beta.IAppVersion=} [properties] Properties to set - */ - function AppVersion(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AppVersion name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.AppVersion - * @instance - */ - AppVersion.prototype.name = ""; - - /** - * AppVersion displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.AppVersion - * @instance - */ - AppVersion.prototype.displayName = ""; - - /** - * AppVersion description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.AppVersion - * @instance - */ - AppVersion.prototype.description = ""; - - /** - * AppVersion creator. - * @member {string} creator - * @memberof google.cloud.ces.v1beta.AppVersion - * @instance - */ - AppVersion.prototype.creator = ""; - - /** - * AppVersion createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.AppVersion - * @instance - */ - AppVersion.prototype.createTime = null; - - /** - * AppVersion snapshot. - * @member {google.cloud.ces.v1beta.IAppSnapshot|null|undefined} snapshot - * @memberof google.cloud.ces.v1beta.AppVersion - * @instance - */ - AppVersion.prototype.snapshot = null; - - /** - * AppVersion etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.AppVersion - * @instance - */ - AppVersion.prototype.etag = ""; - - /** - * Creates a new AppVersion instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.AppVersion - * @static - * @param {google.cloud.ces.v1beta.IAppVersion=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.AppVersion} AppVersion instance - */ - AppVersion.create = function create(properties) { - return new AppVersion(properties); - }; - - /** - * Encodes the specified AppVersion message. Does not implicitly {@link google.cloud.ces.v1beta.AppVersion.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.AppVersion - * @static - * @param {google.cloud.ces.v1beta.IAppVersion} message AppVersion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppVersion.encode = function encode(message, writer) { - if (!writer) - 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.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.creator); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); - if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) - $root.google.cloud.ces.v1beta.AppSnapshot.encode(message.snapshot, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AppVersion message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AppVersion.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.AppVersion - * @static - * @param {google.cloud.ces.v1beta.IAppVersion} message AppVersion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppVersion.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AppVersion message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.AppVersion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.AppVersion} AppVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppVersion.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AppVersion(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.creator = reader.string(); - break; - } - case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.snapshot = $root.google.cloud.ces.v1beta.AppSnapshot.decode(reader, reader.uint32()); - break; - } - case 7: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AppVersion message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.AppVersion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.AppVersion} AppVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppVersion.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AppVersion message. - * @function verify - * @memberof google.cloud.ces.v1beta.AppVersion - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AppVersion.verify = function verify(message) { - if (typeof message !== "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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: 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.snapshot != null && message.hasOwnProperty("snapshot")) { - var error = $root.google.cloud.ces.v1beta.AppSnapshot.verify(message.snapshot); - if (error) - return "snapshot." + error; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates an AppVersion message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.AppVersion - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.AppVersion} AppVersion - */ - AppVersion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.AppVersion) - return object; - var message = new $root.google.cloud.ces.v1beta.AppVersion(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.creator != null) - message.creator = String(object.creator); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.AppVersion.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.snapshot != null) { - if (typeof object.snapshot !== "object") - throw TypeError(".google.cloud.ces.v1beta.AppVersion.snapshot: object expected"); - message.snapshot = $root.google.cloud.ces.v1beta.AppSnapshot.fromObject(object.snapshot); - } - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from an AppVersion message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.AppVersion - * @static - * @param {google.cloud.ces.v1beta.AppVersion} message AppVersion - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AppVersion.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.creator = ""; - object.createTime = null; - object.etag = ""; - object.snapshot = 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.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.snapshot != null && message.hasOwnProperty("snapshot")) - object.snapshot = $root.google.cloud.ces.v1beta.AppSnapshot.toObject(message.snapshot, options); - return object; - }; - - /** - * Converts this AppVersion to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.AppVersion - * @instance - * @returns {Object.} JSON object - */ - AppVersion.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AppVersion - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.AppVersion - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AppVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.AppVersion"; - }; - - return AppVersion; - })(); - - v1beta.Example = (function() { - - /** - * Properties of an Example. - * @memberof google.cloud.ces.v1beta - * @interface IExample - * @property {string|null} [name] Example name - * @property {string|null} [displayName] Example displayName - * @property {string|null} [description] Example description - * @property {string|null} [entryAgent] Example entryAgent - * @property {Array.|null} [messages] Example messages - * @property {google.protobuf.ITimestamp|null} [createTime] Example createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Example updateTime - * @property {boolean|null} [invalid] Example invalid - * @property {string|null} [etag] Example etag - */ - - /** - * Constructs a new Example. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an Example. - * @implements IExample - * @constructor - * @param {google.cloud.ces.v1beta.IExample=} [properties] Properties to set - */ - function Example(properties) { - this.messages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Example name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.Example - * @instance - */ - Example.prototype.name = ""; - - /** - * Example displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.Example - * @instance - */ - Example.prototype.displayName = ""; - - /** - * Example description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.Example - * @instance - */ - Example.prototype.description = ""; - - /** - * Example entryAgent. - * @member {string} entryAgent - * @memberof google.cloud.ces.v1beta.Example - * @instance - */ - Example.prototype.entryAgent = ""; - - /** - * Example messages. - * @member {Array.} messages - * @memberof google.cloud.ces.v1beta.Example - * @instance - */ - Example.prototype.messages = $util.emptyArray; - - /** - * Example createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.Example - * @instance - */ - Example.prototype.createTime = null; - - /** - * Example updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1beta.Example - * @instance - */ - Example.prototype.updateTime = null; - - /** - * Example invalid. - * @member {boolean} invalid - * @memberof google.cloud.ces.v1beta.Example - * @instance - */ - Example.prototype.invalid = false; - - /** - * Example etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.Example - * @instance - */ - Example.prototype.etag = ""; - - /** - * Creates a new Example instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Example - * @static - * @param {google.cloud.ces.v1beta.IExample=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Example} Example instance - */ - Example.create = function create(properties) { - return new Example(properties); - }; - - /** - * Encodes the specified Example message. Does not implicitly {@link google.cloud.ces.v1beta.Example.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Example - * @static - * @param {google.cloud.ces.v1beta.IExample} message Example message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Example.encode = function encode(message, writer) { - if (!writer) - 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.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.entryAgent != null && Object.hasOwnProperty.call(message, "entryAgent")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.entryAgent); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.google.cloud.ces.v1beta.Message.encode(message.messages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.invalid != null && Object.hasOwnProperty.call(message, "invalid")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.invalid); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); - return writer; - }; - - /** - * Encodes the specified Example message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Example.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Example - * @static - * @param {google.cloud.ces.v1beta.IExample} message Example message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Example.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Example message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Example - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Example} Example - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Example.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Example(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.entryAgent = reader.string(); - break; - } - case 5: { - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32())); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.invalid = reader.bool(); - break; - } - case 9: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Example message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Example - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Example} Example - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Example.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Example message. - * @function verify - * @memberof google.cloud.ces.v1beta.Example - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Example.verify = function verify(message) { - if (typeof message !== "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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) - if (!$util.isString(message.entryAgent)) - return "entryAgent: string expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Message.verify(message.messages[i]); - if (error) - return "messages." + error; - } - } - 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.invalid != null && message.hasOwnProperty("invalid")) - if (typeof message.invalid !== "boolean") - return "invalid: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates an Example message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Example - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Example} Example - */ - Example.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Example) - return object; - var message = new $root.google.cloud.ces.v1beta.Example(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.entryAgent != null) - message.entryAgent = String(object.entryAgent); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".google.cloud.ces.v1beta.Example.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Example.messages: object expected"); - message.messages[i] = $root.google.cloud.ces.v1beta.Message.fromObject(object.messages[i]); - } - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.Example.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.ces.v1beta.Example.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.invalid != null) - message.invalid = Boolean(object.invalid); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from an Example message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Example - * @static - * @param {google.cloud.ces.v1beta.Example} message Example - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Example.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.messages = []; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.entryAgent = ""; - object.createTime = null; - object.updateTime = null; - object.invalid = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) - object.entryAgent = message.entryAgent; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.cloud.ces.v1beta.Message.toObject(message.messages[j], options); - } - 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.invalid != null && message.hasOwnProperty("invalid")) - object.invalid = message.invalid; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this Example to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Example - * @instance - * @returns {Object.} JSON object - */ - Example.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Example - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Example - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Example.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Example"; - }; - - return Example; - })(); - - v1beta.Message = (function() { - - /** - * Properties of a Message. - * @memberof google.cloud.ces.v1beta - * @interface IMessage - * @property {string|null} [role] Message role - * @property {Array.|null} [chunks] Message chunks - * @property {google.protobuf.ITimestamp|null} [eventTime] Message eventTime - */ - - /** - * Constructs a new Message. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a Message. - * @implements IMessage - * @constructor - * @param {google.cloud.ces.v1beta.IMessage=} [properties] Properties to set - */ - function Message(properties) { - this.chunks = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Message role. - * @member {string} role - * @memberof google.cloud.ces.v1beta.Message - * @instance - */ - Message.prototype.role = ""; - - /** - * Message chunks. - * @member {Array.} chunks - * @memberof google.cloud.ces.v1beta.Message - * @instance - */ - Message.prototype.chunks = $util.emptyArray; - - /** - * Message eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.ces.v1beta.Message - * @instance - */ - Message.prototype.eventTime = null; - - /** - * Creates a new Message instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Message - * @static - * @param {google.cloud.ces.v1beta.IMessage=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Message} Message instance - */ - Message.create = function create(properties) { - return new Message(properties); - }; - - /** - * Encodes the specified Message message. Does not implicitly {@link google.cloud.ces.v1beta.Message.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Message - * @static - * @param {google.cloud.ces.v1beta.IMessage} message Message message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Message.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); - if (message.chunks != null && message.chunks.length) - for (var i = 0; i < message.chunks.length; ++i) - $root.google.cloud.ces.v1beta.Chunk.encode(message.chunks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Message.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Message - * @static - * @param {google.cloud.ces.v1beta.IMessage} message Message message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Message.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Message message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Message - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Message} Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Message.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Message(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.role = reader.string(); - break; - } - case 2: { - if (!(message.chunks && message.chunks.length)) - message.chunks = []; - message.chunks.push($root.google.cloud.ces.v1beta.Chunk.decode(reader, reader.uint32())); - break; - } - case 4: { - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Message message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Message - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Message} Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Message.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Message message. - * @function verify - * @memberof google.cloud.ces.v1beta.Message - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Message.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.chunks != null && message.hasOwnProperty("chunks")) { - if (!Array.isArray(message.chunks)) - return "chunks: array expected"; - for (var i = 0; i < message.chunks.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Chunk.verify(message.chunks[i]); - if (error) - return "chunks." + error; - } - } - if (message.eventTime != null && message.hasOwnProperty("eventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventTime); - if (error) - return "eventTime." + error; - } - return null; - }; - - /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Message - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Message} Message - */ - Message.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Message) - return object; - var message = new $root.google.cloud.ces.v1beta.Message(); - if (object.role != null) - message.role = String(object.role); - if (object.chunks) { - if (!Array.isArray(object.chunks)) - throw TypeError(".google.cloud.ces.v1beta.Message.chunks: array expected"); - message.chunks = []; - for (var i = 0; i < object.chunks.length; ++i) { - if (typeof object.chunks[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Message.chunks: object expected"); - message.chunks[i] = $root.google.cloud.ces.v1beta.Chunk.fromObject(object.chunks[i]); - } - } - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.Message.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); - } - return message; - }; - - /** - * Creates a plain object from a Message message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Message - * @static - * @param {google.cloud.ces.v1beta.Message} message Message - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Message.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.chunks = []; - if (options.defaults) { - object.role = ""; - object.eventTime = null; - } - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.chunks && message.chunks.length) { - object.chunks = []; - for (var j = 0; j < message.chunks.length; ++j) - object.chunks[j] = $root.google.cloud.ces.v1beta.Chunk.toObject(message.chunks[j], options); - } - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); - return object; - }; - - /** - * Converts this Message to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Message - * @instance - * @returns {Object.} JSON object - */ - Message.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Message - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Message - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Message"; - }; - - return Message; - })(); - - v1beta.Chunk = (function() { - - /** - * Properties of a Chunk. - * @memberof google.cloud.ces.v1beta - * @interface IChunk - * @property {string|null} [text] Chunk text - * @property {string|null} [transcript] Chunk transcript - * @property {google.cloud.ces.v1beta.IBlob|null} [blob] Chunk blob - * @property {google.protobuf.IStruct|null} [payload] Chunk payload - * @property {google.cloud.ces.v1beta.IImage|null} [image] Chunk image - * @property {google.cloud.ces.v1beta.IToolCall|null} [toolCall] Chunk toolCall - * @property {google.cloud.ces.v1beta.IToolResponse|null} [toolResponse] Chunk toolResponse - * @property {google.cloud.ces.v1beta.IAgentTransfer|null} [agentTransfer] Chunk agentTransfer - * @property {google.protobuf.IStruct|null} [updatedVariables] Chunk updatedVariables - * @property {google.protobuf.IStruct|null} [defaultVariables] Chunk defaultVariables - */ - - /** - * Constructs a new Chunk. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a Chunk. - * @implements IChunk - * @constructor - * @param {google.cloud.ces.v1beta.IChunk=} [properties] Properties to set - */ - function Chunk(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Chunk text. - * @member {string|null|undefined} text - * @memberof google.cloud.ces.v1beta.Chunk - * @instance - */ - Chunk.prototype.text = null; - - /** - * Chunk transcript. - * @member {string|null|undefined} transcript - * @memberof google.cloud.ces.v1beta.Chunk - * @instance - */ - Chunk.prototype.transcript = null; - - /** - * Chunk blob. - * @member {google.cloud.ces.v1beta.IBlob|null|undefined} blob - * @memberof google.cloud.ces.v1beta.Chunk - * @instance - */ - Chunk.prototype.blob = null; - - /** - * Chunk payload. - * @member {google.protobuf.IStruct|null|undefined} payload - * @memberof google.cloud.ces.v1beta.Chunk - * @instance - */ - Chunk.prototype.payload = null; - - /** - * Chunk image. - * @member {google.cloud.ces.v1beta.IImage|null|undefined} image - * @memberof google.cloud.ces.v1beta.Chunk - * @instance - */ - Chunk.prototype.image = null; - - /** - * Chunk toolCall. - * @member {google.cloud.ces.v1beta.IToolCall|null|undefined} toolCall - * @memberof google.cloud.ces.v1beta.Chunk - * @instance - */ - Chunk.prototype.toolCall = null; - - /** - * Chunk toolResponse. - * @member {google.cloud.ces.v1beta.IToolResponse|null|undefined} toolResponse - * @memberof google.cloud.ces.v1beta.Chunk - * @instance - */ - Chunk.prototype.toolResponse = null; - - /** - * Chunk agentTransfer. - * @member {google.cloud.ces.v1beta.IAgentTransfer|null|undefined} agentTransfer - * @memberof google.cloud.ces.v1beta.Chunk - * @instance - */ - Chunk.prototype.agentTransfer = null; - - /** - * Chunk updatedVariables. - * @member {google.protobuf.IStruct|null|undefined} updatedVariables - * @memberof google.cloud.ces.v1beta.Chunk - * @instance - */ - Chunk.prototype.updatedVariables = null; - - /** - * Chunk defaultVariables. - * @member {google.protobuf.IStruct|null|undefined} defaultVariables - * @memberof google.cloud.ces.v1beta.Chunk - * @instance - */ - Chunk.prototype.defaultVariables = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Chunk data. - * @member {"text"|"transcript"|"blob"|"payload"|"image"|"toolCall"|"toolResponse"|"agentTransfer"|"updatedVariables"|"defaultVariables"|undefined} data - * @memberof google.cloud.ces.v1beta.Chunk - * @instance - */ - Object.defineProperty(Chunk.prototype, "data", { - get: $util.oneOfGetter($oneOfFields = ["text", "transcript", "blob", "payload", "image", "toolCall", "toolResponse", "agentTransfer", "updatedVariables", "defaultVariables"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Chunk instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Chunk - * @static - * @param {google.cloud.ces.v1beta.IChunk=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Chunk} Chunk instance - */ - Chunk.create = function create(properties) { - return new Chunk(properties); - }; - - /** - * Encodes the specified Chunk message. Does not implicitly {@link google.cloud.ces.v1beta.Chunk.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Chunk - * @static - * @param {google.cloud.ces.v1beta.IChunk} message Chunk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Chunk.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.toolCall != null && Object.hasOwnProperty.call(message, "toolCall")) - $root.google.cloud.ces.v1beta.ToolCall.encode(message.toolCall, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.toolResponse != null && Object.hasOwnProperty.call(message, "toolResponse")) - $root.google.cloud.ces.v1beta.ToolResponse.encode(message.toolResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.agentTransfer != null && Object.hasOwnProperty.call(message, "agentTransfer")) - $root.google.cloud.ces.v1beta.AgentTransfer.encode(message.agentTransfer, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - $root.google.cloud.ces.v1beta.Image.encode(message.image, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.blob != null && Object.hasOwnProperty.call(message, "blob")) - $root.google.cloud.ces.v1beta.Blob.encode(message.blob, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.updatedVariables != null && Object.hasOwnProperty.call(message, "updatedVariables")) - $root.google.protobuf.Struct.encode(message.updatedVariables, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.transcript); - if (message.defaultVariables != null && Object.hasOwnProperty.call(message, "defaultVariables")) - $root.google.protobuf.Struct.encode(message.defaultVariables, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Chunk.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Chunk - * @static - * @param {google.cloud.ces.v1beta.IChunk} message Chunk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Chunk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Chunk message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Chunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Chunk} Chunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Chunk.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Chunk(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.text = reader.string(); - break; - } - case 9: { - message.transcript = reader.string(); - break; - } - case 7: { - message.blob = $root.google.cloud.ces.v1beta.Blob.decode(reader, reader.uint32()); - break; - } - case 11: { - message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 5: { - message.image = $root.google.cloud.ces.v1beta.Image.decode(reader, reader.uint32()); - break; - } - case 2: { - message.toolCall = $root.google.cloud.ces.v1beta.ToolCall.decode(reader, reader.uint32()); - break; - } - case 3: { - message.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32()); - break; - } - case 4: { - message.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.decode(reader, reader.uint32()); - break; - } - case 8: { - message.updatedVariables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 10: { - message.defaultVariables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Chunk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Chunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Chunk} Chunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Chunk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Chunk message. - * @function verify - * @memberof google.cloud.ces.v1beta.Chunk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Chunk.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.text != null && message.hasOwnProperty("text")) { - properties.data = 1; - if (!$util.isString(message.text)) - return "text: string expected"; - } - if (message.transcript != null && message.hasOwnProperty("transcript")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - if (!$util.isString(message.transcript)) - return "transcript: string expected"; - } - if (message.blob != null && message.hasOwnProperty("blob")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.cloud.ces.v1beta.Blob.verify(message.blob); - if (error) - return "blob." + error; - } - } - if (message.payload != null && message.hasOwnProperty("payload")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.protobuf.Struct.verify(message.payload); - if (error) - return "payload." + error; - } - } - if (message.image != null && message.hasOwnProperty("image")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.cloud.ces.v1beta.Image.verify(message.image); - if (error) - return "image." + error; - } - } - if (message.toolCall != null && message.hasOwnProperty("toolCall")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.cloud.ces.v1beta.ToolCall.verify(message.toolCall); - if (error) - return "toolCall." + error; - } - } - if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.toolResponse); - if (error) - return "toolResponse." + error; - } - } - if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.cloud.ces.v1beta.AgentTransfer.verify(message.agentTransfer); - if (error) - return "agentTransfer." + error; - } - } - if (message.updatedVariables != null && message.hasOwnProperty("updatedVariables")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.protobuf.Struct.verify(message.updatedVariables); - if (error) - return "updatedVariables." + error; - } - } - if (message.defaultVariables != null && message.hasOwnProperty("defaultVariables")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.protobuf.Struct.verify(message.defaultVariables); - if (error) - return "defaultVariables." + error; - } - } - return null; - }; - - /** - * Creates a Chunk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Chunk - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Chunk} Chunk - */ - Chunk.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Chunk) - return object; - var message = new $root.google.cloud.ces.v1beta.Chunk(); - if (object.text != null) - message.text = String(object.text); - if (object.transcript != null) - message.transcript = String(object.transcript); - if (object.blob != null) { - if (typeof object.blob !== "object") - throw TypeError(".google.cloud.ces.v1beta.Chunk.blob: object expected"); - message.blob = $root.google.cloud.ces.v1beta.Blob.fromObject(object.blob); - } - if (object.payload != null) { - if (typeof object.payload !== "object") - throw TypeError(".google.cloud.ces.v1beta.Chunk.payload: object expected"); - message.payload = $root.google.protobuf.Struct.fromObject(object.payload); - } - if (object.image != null) { - if (typeof object.image !== "object") - throw TypeError(".google.cloud.ces.v1beta.Chunk.image: object expected"); - message.image = $root.google.cloud.ces.v1beta.Image.fromObject(object.image); - } - if (object.toolCall != null) { - if (typeof object.toolCall !== "object") - throw TypeError(".google.cloud.ces.v1beta.Chunk.toolCall: object expected"); - message.toolCall = $root.google.cloud.ces.v1beta.ToolCall.fromObject(object.toolCall); - } - if (object.toolResponse != null) { - if (typeof object.toolResponse !== "object") - throw TypeError(".google.cloud.ces.v1beta.Chunk.toolResponse: object expected"); - message.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.toolResponse); - } - if (object.agentTransfer != null) { - if (typeof object.agentTransfer !== "object") - throw TypeError(".google.cloud.ces.v1beta.Chunk.agentTransfer: object expected"); - message.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.fromObject(object.agentTransfer); - } - if (object.updatedVariables != null) { - if (typeof object.updatedVariables !== "object") - throw TypeError(".google.cloud.ces.v1beta.Chunk.updatedVariables: object expected"); - message.updatedVariables = $root.google.protobuf.Struct.fromObject(object.updatedVariables); - } - if (object.defaultVariables != null) { - if (typeof object.defaultVariables !== "object") - throw TypeError(".google.cloud.ces.v1beta.Chunk.defaultVariables: object expected"); - message.defaultVariables = $root.google.protobuf.Struct.fromObject(object.defaultVariables); - } - return message; - }; - - /** - * Creates a plain object from a Chunk message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Chunk - * @static - * @param {google.cloud.ces.v1beta.Chunk} message Chunk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Chunk.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.text != null && message.hasOwnProperty("text")) { - object.text = message.text; - if (options.oneofs) - object.data = "text"; - } - if (message.toolCall != null && message.hasOwnProperty("toolCall")) { - object.toolCall = $root.google.cloud.ces.v1beta.ToolCall.toObject(message.toolCall, options); - if (options.oneofs) - object.data = "toolCall"; - } - if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { - object.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.toolResponse, options); - if (options.oneofs) - object.data = "toolResponse"; - } - if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { - object.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.toObject(message.agentTransfer, options); - if (options.oneofs) - object.data = "agentTransfer"; - } - if (message.image != null && message.hasOwnProperty("image")) { - object.image = $root.google.cloud.ces.v1beta.Image.toObject(message.image, options); - if (options.oneofs) - object.data = "image"; - } - if (message.blob != null && message.hasOwnProperty("blob")) { - object.blob = $root.google.cloud.ces.v1beta.Blob.toObject(message.blob, options); - if (options.oneofs) - object.data = "blob"; - } - if (message.updatedVariables != null && message.hasOwnProperty("updatedVariables")) { - object.updatedVariables = $root.google.protobuf.Struct.toObject(message.updatedVariables, options); - if (options.oneofs) - object.data = "updatedVariables"; - } - if (message.transcript != null && message.hasOwnProperty("transcript")) { - object.transcript = message.transcript; - if (options.oneofs) - object.data = "transcript"; - } - if (message.defaultVariables != null && message.hasOwnProperty("defaultVariables")) { - object.defaultVariables = $root.google.protobuf.Struct.toObject(message.defaultVariables, options); - if (options.oneofs) - object.data = "defaultVariables"; - } - if (message.payload != null && message.hasOwnProperty("payload")) { - object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); - if (options.oneofs) - object.data = "payload"; - } - return object; - }; - - /** - * Converts this Chunk to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Chunk - * @instance - * @returns {Object.} JSON object - */ - Chunk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Chunk - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Chunk - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Chunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Chunk"; - }; - - return Chunk; - })(); - - v1beta.Blob = (function() { - - /** - * Properties of a Blob. - * @memberof google.cloud.ces.v1beta - * @interface IBlob - * @property {string|null} [mimeType] Blob mimeType - * @property {Uint8Array|null} [data] Blob data - */ - - /** - * Constructs a new Blob. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a Blob. - * @implements IBlob - * @constructor - * @param {google.cloud.ces.v1beta.IBlob=} [properties] Properties to set - */ - function Blob(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Blob mimeType. - * @member {string} mimeType - * @memberof google.cloud.ces.v1beta.Blob - * @instance - */ - Blob.prototype.mimeType = ""; - - /** - * Blob data. - * @member {Uint8Array} data - * @memberof google.cloud.ces.v1beta.Blob - * @instance - */ - Blob.prototype.data = $util.newBuffer([]); - - /** - * Creates a new Blob instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Blob - * @static - * @param {google.cloud.ces.v1beta.IBlob=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Blob} Blob instance - */ - Blob.create = function create(properties) { - return new Blob(properties); - }; - - /** - * Encodes the specified Blob message. Does not implicitly {@link google.cloud.ces.v1beta.Blob.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Blob - * @static - * @param {google.cloud.ces.v1beta.IBlob} message Blob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Blob.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); - return writer; - }; - - /** - * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Blob.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Blob - * @static - * @param {google.cloud.ces.v1beta.IBlob} message Blob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Blob.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Blob message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Blob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Blob} Blob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Blob.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Blob(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mimeType = reader.string(); - break; - } - case 2: { - message.data = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Blob message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Blob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Blob} Blob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Blob.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Blob message. - * @function verify - * @memberof google.cloud.ces.v1beta.Blob - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Blob.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; - - /** - * Creates a Blob message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Blob - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Blob} Blob - */ - Blob.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Blob) - return object; - var message = new $root.google.cloud.ces.v1beta.Blob(); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length >= 0) - message.data = object.data; - return message; - }; - - /** - * Creates a plain object from a Blob message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Blob - * @static - * @param {google.cloud.ces.v1beta.Blob} message Blob - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Blob.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.mimeType = ""; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - } - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; - - /** - * Converts this Blob to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Blob - * @instance - * @returns {Object.} JSON object - */ - Blob.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Blob - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Blob - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Blob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Blob"; - }; - - return Blob; - })(); - - v1beta.Image = (function() { - - /** - * Properties of an Image. - * @memberof google.cloud.ces.v1beta - * @interface IImage - * @property {string|null} [mimeType] Image mimeType - * @property {Uint8Array|null} [data] Image data - */ - - /** - * Constructs a new Image. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an Image. - * @implements IImage - * @constructor - * @param {google.cloud.ces.v1beta.IImage=} [properties] Properties to set - */ - function Image(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Image mimeType. - * @member {string} mimeType - * @memberof google.cloud.ces.v1beta.Image - * @instance - */ - Image.prototype.mimeType = ""; - - /** - * Image data. - * @member {Uint8Array} data - * @memberof google.cloud.ces.v1beta.Image - * @instance - */ - Image.prototype.data = $util.newBuffer([]); - - /** - * Creates a new Image instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Image - * @static - * @param {google.cloud.ces.v1beta.IImage=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Image} Image instance - */ - Image.create = function create(properties) { - return new Image(properties); - }; - - /** - * Encodes the specified Image message. Does not implicitly {@link google.cloud.ces.v1beta.Image.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Image - * @static - * @param {google.cloud.ces.v1beta.IImage} message Image message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Image.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); - return writer; - }; - - /** - * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Image.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Image - * @static - * @param {google.cloud.ces.v1beta.IImage} message Image message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Image.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Image message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Image - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Image} Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Image.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Image(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mimeType = reader.string(); - break; - } - case 2: { - message.data = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Image message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Image - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Image} Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Image.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Image message. - * @function verify - * @memberof google.cloud.ces.v1beta.Image - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Image.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; - - /** - * Creates an Image message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Image - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Image} Image - */ - Image.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Image) - return object; - var message = new $root.google.cloud.ces.v1beta.Image(); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length >= 0) - message.data = object.data; - return message; - }; - - /** - * Creates a plain object from an Image message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Image - * @static - * @param {google.cloud.ces.v1beta.Image} message Image - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Image.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.mimeType = ""; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - } - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; - - /** - * Converts this Image to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Image - * @instance - * @returns {Object.} JSON object - */ - Image.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Image - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Image - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Image.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Image"; - }; - - return Image; - })(); - - v1beta.ToolCall = (function() { - - /** - * Properties of a ToolCall. - * @memberof google.cloud.ces.v1beta - * @interface IToolCall - * @property {string|null} [tool] ToolCall tool - * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] ToolCall toolsetTool - * @property {string|null} [id] ToolCall id - * @property {string|null} [displayName] ToolCall displayName - * @property {google.protobuf.IStruct|null} [args] ToolCall args - */ - - /** - * Constructs a new ToolCall. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ToolCall. - * @implements IToolCall - * @constructor - * @param {google.cloud.ces.v1beta.IToolCall=} [properties] Properties to set - */ - function ToolCall(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolCall tool. - * @member {string|null|undefined} tool - * @memberof google.cloud.ces.v1beta.ToolCall - * @instance - */ - ToolCall.prototype.tool = null; - - /** - * ToolCall toolsetTool. - * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool - * @memberof google.cloud.ces.v1beta.ToolCall - * @instance - */ - ToolCall.prototype.toolsetTool = null; - - /** - * ToolCall id. - * @member {string} id - * @memberof google.cloud.ces.v1beta.ToolCall - * @instance - */ - ToolCall.prototype.id = ""; - - /** - * ToolCall displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.ToolCall - * @instance - */ - ToolCall.prototype.displayName = ""; - - /** - * ToolCall args. - * @member {google.protobuf.IStruct|null|undefined} args - * @memberof google.cloud.ces.v1beta.ToolCall - * @instance - */ - ToolCall.prototype.args = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ToolCall toolIdentifier. - * @member {"tool"|"toolsetTool"|undefined} toolIdentifier - * @memberof google.cloud.ces.v1beta.ToolCall - * @instance - */ - Object.defineProperty(ToolCall.prototype, "toolIdentifier", { - get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ToolCall instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ToolCall - * @static - * @param {google.cloud.ces.v1beta.IToolCall=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ToolCall} ToolCall instance - */ - ToolCall.create = function create(properties) { - return new ToolCall(properties); - }; - - /** - * Encodes the specified ToolCall message. Does not implicitly {@link google.cloud.ces.v1beta.ToolCall.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ToolCall - * @static - * @param {google.cloud.ces.v1beta.IToolCall} message ToolCall message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolCall.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.tool); - if (message.args != null && Object.hasOwnProperty.call(message, "args")) - $root.google.protobuf.Struct.encode(message.args, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); - if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) - $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ToolCall message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolCall.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ToolCall - * @static - * @param {google.cloud.ces.v1beta.IToolCall} message ToolCall message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolCall.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolCall message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ToolCall - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ToolCall} ToolCall - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolCall.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ToolCall(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.tool = reader.string(); - break; - } - case 5: { - message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); - break; - } - case 1: { - message.id = reader.string(); - break; - } - case 4: { - message.displayName = reader.string(); - break; - } - case 3: { - message.args = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolCall message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ToolCall - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ToolCall} ToolCall - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolCall.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolCall message. - * @function verify - * @memberof google.cloud.ces.v1beta.ToolCall - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolCall.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tool != null && message.hasOwnProperty("tool")) { - properties.toolIdentifier = 1; - if (!$util.isString(message.tool)) - return "tool: string expected"; - } - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - if (properties.toolIdentifier === 1) - return "toolIdentifier: multiple values"; - properties.toolIdentifier = 1; - { - var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); - if (error) - return "toolsetTool." + error; - } - } - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.args != null && message.hasOwnProperty("args")) { - var error = $root.google.protobuf.Struct.verify(message.args); - if (error) - return "args." + error; - } - return null; - }; - - /** - * Creates a ToolCall message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ToolCall - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ToolCall} ToolCall - */ - ToolCall.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ToolCall) - return object; - var message = new $root.google.cloud.ces.v1beta.ToolCall(); - if (object.tool != null) - message.tool = String(object.tool); - if (object.toolsetTool != null) { - if (typeof object.toolsetTool !== "object") - throw TypeError(".google.cloud.ces.v1beta.ToolCall.toolsetTool: object expected"); - message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); - } - if (object.id != null) - message.id = String(object.id); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.args != null) { - if (typeof object.args !== "object") - throw TypeError(".google.cloud.ces.v1beta.ToolCall.args: object expected"); - message.args = $root.google.protobuf.Struct.fromObject(object.args); - } - return message; - }; - - /** - * Creates a plain object from a ToolCall message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ToolCall - * @static - * @param {google.cloud.ces.v1beta.ToolCall} message ToolCall - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolCall.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.args = null; - object.displayName = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.tool != null && message.hasOwnProperty("tool")) { - object.tool = message.tool; - if (options.oneofs) - object.toolIdentifier = "tool"; - } - if (message.args != null && message.hasOwnProperty("args")) - object.args = $root.google.protobuf.Struct.toObject(message.args, options); - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); - if (options.oneofs) - object.toolIdentifier = "toolsetTool"; - } - return object; - }; - - /** - * Converts this ToolCall to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ToolCall - * @instance - * @returns {Object.} JSON object - */ - ToolCall.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolCall - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ToolCall - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ToolCall"; - }; - - return ToolCall; - })(); - - v1beta.ToolResponse = (function() { - - /** - * Properties of a ToolResponse. - * @memberof google.cloud.ces.v1beta - * @interface IToolResponse - * @property {string|null} [tool] ToolResponse tool - * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] ToolResponse toolsetTool - * @property {string|null} [id] ToolResponse id - * @property {string|null} [displayName] ToolResponse displayName - * @property {google.protobuf.IStruct|null} [response] ToolResponse response - */ - - /** - * Constructs a new ToolResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ToolResponse. - * @implements IToolResponse - * @constructor - * @param {google.cloud.ces.v1beta.IToolResponse=} [properties] Properties to set - */ - function ToolResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolResponse tool. - * @member {string|null|undefined} tool - * @memberof google.cloud.ces.v1beta.ToolResponse - * @instance - */ - ToolResponse.prototype.tool = null; - - /** - * ToolResponse toolsetTool. - * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool - * @memberof google.cloud.ces.v1beta.ToolResponse - * @instance - */ - ToolResponse.prototype.toolsetTool = null; - - /** - * ToolResponse id. - * @member {string} id - * @memberof google.cloud.ces.v1beta.ToolResponse - * @instance - */ - ToolResponse.prototype.id = ""; - - /** - * ToolResponse displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.ToolResponse - * @instance - */ - ToolResponse.prototype.displayName = ""; - - /** - * ToolResponse response. - * @member {google.protobuf.IStruct|null|undefined} response - * @memberof google.cloud.ces.v1beta.ToolResponse - * @instance - */ - ToolResponse.prototype.response = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ToolResponse toolIdentifier. - * @member {"tool"|"toolsetTool"|undefined} toolIdentifier - * @memberof google.cloud.ces.v1beta.ToolResponse - * @instance - */ - Object.defineProperty(ToolResponse.prototype, "toolIdentifier", { - get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ToolResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ToolResponse - * @static - * @param {google.cloud.ces.v1beta.IToolResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ToolResponse} ToolResponse instance - */ - ToolResponse.create = function create(properties) { - return new ToolResponse(properties); - }; - - /** - * Encodes the specified ToolResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ToolResponse - * @static - * @param {google.cloud.ces.v1beta.IToolResponse} message ToolResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.tool); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Struct.encode(message.response, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); - if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) - $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ToolResponse - * @static - * @param {google.cloud.ces.v1beta.IToolResponse} message ToolResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ToolResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ToolResponse} ToolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ToolResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.tool = reader.string(); - break; - } - case 5: { - message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); - break; - } - case 1: { - message.id = reader.string(); - break; - } - case 4: { - message.displayName = reader.string(); - break; - } - case 3: { - message.response = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ToolResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ToolResponse} ToolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ToolResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tool != null && message.hasOwnProperty("tool")) { - properties.toolIdentifier = 1; - if (!$util.isString(message.tool)) - return "tool: string expected"; - } - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - if (properties.toolIdentifier === 1) - return "toolIdentifier: multiple values"; - properties.toolIdentifier = 1; - { - var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); - if (error) - return "toolsetTool." + error; - } - } - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.response != null && message.hasOwnProperty("response")) { - var error = $root.google.protobuf.Struct.verify(message.response); - if (error) - return "response." + error; - } - return null; - }; - - /** - * Creates a ToolResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ToolResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ToolResponse} ToolResponse - */ - ToolResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ToolResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ToolResponse(); - if (object.tool != null) - message.tool = String(object.tool); - if (object.toolsetTool != null) { - if (typeof object.toolsetTool !== "object") - throw TypeError(".google.cloud.ces.v1beta.ToolResponse.toolsetTool: object expected"); - message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); - } - if (object.id != null) - message.id = String(object.id); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.cloud.ces.v1beta.ToolResponse.response: object expected"); - message.response = $root.google.protobuf.Struct.fromObject(object.response); - } - return message; - }; - - /** - * Creates a plain object from a ToolResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ToolResponse - * @static - * @param {google.cloud.ces.v1beta.ToolResponse} message ToolResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.response = null; - object.displayName = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.tool != null && message.hasOwnProperty("tool")) { - object.tool = message.tool; - if (options.oneofs) - object.toolIdentifier = "tool"; - } - if (message.response != null && message.hasOwnProperty("response")) - object.response = $root.google.protobuf.Struct.toObject(message.response, options); - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); - if (options.oneofs) - object.toolIdentifier = "toolsetTool"; - } - return object; - }; - - /** - * Converts this ToolResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ToolResponse - * @instance - * @returns {Object.} JSON object - */ - ToolResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ToolResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ToolResponse"; - }; - - return ToolResponse; - })(); - - v1beta.AgentTransfer = (function() { - - /** - * Properties of an AgentTransfer. - * @memberof google.cloud.ces.v1beta - * @interface IAgentTransfer - * @property {string|null} [targetAgent] AgentTransfer targetAgent - * @property {string|null} [displayName] AgentTransfer displayName - */ - - /** - * Constructs a new AgentTransfer. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an AgentTransfer. - * @implements IAgentTransfer - * @constructor - * @param {google.cloud.ces.v1beta.IAgentTransfer=} [properties] Properties to set - */ - function AgentTransfer(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AgentTransfer targetAgent. - * @member {string} targetAgent - * @memberof google.cloud.ces.v1beta.AgentTransfer - * @instance - */ - AgentTransfer.prototype.targetAgent = ""; - - /** - * AgentTransfer displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.AgentTransfer - * @instance - */ - AgentTransfer.prototype.displayName = ""; - - /** - * Creates a new AgentTransfer instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.AgentTransfer - * @static - * @param {google.cloud.ces.v1beta.IAgentTransfer=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.AgentTransfer} AgentTransfer instance - */ - AgentTransfer.create = function create(properties) { - return new AgentTransfer(properties); - }; - - /** - * Encodes the specified AgentTransfer message. Does not implicitly {@link google.cloud.ces.v1beta.AgentTransfer.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.AgentTransfer - * @static - * @param {google.cloud.ces.v1beta.IAgentTransfer} message AgentTransfer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AgentTransfer.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.targetAgent != null && Object.hasOwnProperty.call(message, "targetAgent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetAgent); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified AgentTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AgentTransfer.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.AgentTransfer - * @static - * @param {google.cloud.ces.v1beta.IAgentTransfer} message AgentTransfer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AgentTransfer.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AgentTransfer message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.AgentTransfer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.AgentTransfer} AgentTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AgentTransfer.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AgentTransfer(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.targetAgent = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AgentTransfer message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.AgentTransfer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.AgentTransfer} AgentTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AgentTransfer.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AgentTransfer message. - * @function verify - * @memberof google.cloud.ces.v1beta.AgentTransfer - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AgentTransfer.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.targetAgent != null && message.hasOwnProperty("targetAgent")) - if (!$util.isString(message.targetAgent)) - return "targetAgent: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; - - /** - * Creates an AgentTransfer message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.AgentTransfer - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.AgentTransfer} AgentTransfer - */ - AgentTransfer.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.AgentTransfer) - return object; - var message = new $root.google.cloud.ces.v1beta.AgentTransfer(); - if (object.targetAgent != null) - message.targetAgent = String(object.targetAgent); - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from an AgentTransfer message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.AgentTransfer - * @static - * @param {google.cloud.ces.v1beta.AgentTransfer} message AgentTransfer - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AgentTransfer.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.targetAgent = ""; - object.displayName = ""; - } - if (message.targetAgent != null && message.hasOwnProperty("targetAgent")) - object.targetAgent = message.targetAgent; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this AgentTransfer to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.AgentTransfer - * @instance - * @returns {Object.} JSON object - */ - AgentTransfer.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AgentTransfer - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.AgentTransfer - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AgentTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.AgentTransfer"; - }; - - return AgentTransfer; - })(); - - v1beta.ToolsetTool = (function() { - - /** - * Properties of a ToolsetTool. - * @memberof google.cloud.ces.v1beta - * @interface IToolsetTool - * @property {string|null} [toolset] ToolsetTool toolset - * @property {string|null} [toolId] ToolsetTool toolId - */ - - /** - * Constructs a new ToolsetTool. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ToolsetTool. - * @implements IToolsetTool - * @constructor - * @param {google.cloud.ces.v1beta.IToolsetTool=} [properties] Properties to set - */ - function ToolsetTool(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolsetTool toolset. - * @member {string} toolset - * @memberof google.cloud.ces.v1beta.ToolsetTool - * @instance - */ - ToolsetTool.prototype.toolset = ""; - - /** - * ToolsetTool toolId. - * @member {string} toolId - * @memberof google.cloud.ces.v1beta.ToolsetTool - * @instance - */ - ToolsetTool.prototype.toolId = ""; - - /** - * Creates a new ToolsetTool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ToolsetTool - * @static - * @param {google.cloud.ces.v1beta.IToolsetTool=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ToolsetTool} ToolsetTool instance - */ - ToolsetTool.create = function create(properties) { - return new ToolsetTool(properties); - }; - - /** - * Encodes the specified ToolsetTool message. Does not implicitly {@link google.cloud.ces.v1beta.ToolsetTool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ToolsetTool - * @static - * @param {google.cloud.ces.v1beta.IToolsetTool} message ToolsetTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolsetTool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.toolset); - if (message.toolId != null && Object.hasOwnProperty.call(message, "toolId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.toolId); - return writer; - }; - - /** - * Encodes the specified ToolsetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolsetTool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ToolsetTool - * @static - * @param {google.cloud.ces.v1beta.IToolsetTool} message ToolsetTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolsetTool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolsetTool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ToolsetTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ToolsetTool} ToolsetTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolsetTool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ToolsetTool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.toolset = reader.string(); - break; - } - case 3: { - message.toolId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolsetTool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ToolsetTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ToolsetTool} ToolsetTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolsetTool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolsetTool message. - * @function verify - * @memberof google.cloud.ces.v1beta.ToolsetTool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolsetTool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.toolset != null && message.hasOwnProperty("toolset")) - if (!$util.isString(message.toolset)) - return "toolset: string expected"; - if (message.toolId != null && message.hasOwnProperty("toolId")) - if (!$util.isString(message.toolId)) - return "toolId: string expected"; - return null; - }; - - /** - * Creates a ToolsetTool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ToolsetTool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ToolsetTool} ToolsetTool - */ - ToolsetTool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ToolsetTool) - return object; - var message = new $root.google.cloud.ces.v1beta.ToolsetTool(); - if (object.toolset != null) - message.toolset = String(object.toolset); - if (object.toolId != null) - message.toolId = String(object.toolId); - return message; - }; - - /** - * Creates a plain object from a ToolsetTool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ToolsetTool - * @static - * @param {google.cloud.ces.v1beta.ToolsetTool} message ToolsetTool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolsetTool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.toolset = ""; - object.toolId = ""; - } - if (message.toolset != null && message.hasOwnProperty("toolset")) - object.toolset = message.toolset; - if (message.toolId != null && message.hasOwnProperty("toolId")) - object.toolId = message.toolId; - return object; - }; - - /** - * Converts this ToolsetTool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ToolsetTool - * @instance - * @returns {Object.} JSON object - */ - ToolsetTool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolsetTool - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ToolsetTool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolsetTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ToolsetTool"; - }; - - return ToolsetTool; - })(); - - v1beta.Guardrail = (function() { - - /** - * Properties of a Guardrail. - * @memberof google.cloud.ces.v1beta - * @interface IGuardrail - * @property {google.cloud.ces.v1beta.Guardrail.IContentFilter|null} [contentFilter] Guardrail contentFilter - * @property {google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity|null} [llmPromptSecurity] Guardrail llmPromptSecurity - * @property {google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null} [llmPolicy] Guardrail llmPolicy - * @property {google.cloud.ces.v1beta.Guardrail.IModelSafety|null} [modelSafety] Guardrail modelSafety - * @property {google.cloud.ces.v1beta.Guardrail.ICodeCallback|null} [codeCallback] Guardrail codeCallback - * @property {string|null} [name] Guardrail name - * @property {string|null} [displayName] Guardrail displayName - * @property {string|null} [description] Guardrail description - * @property {boolean|null} [enabled] Guardrail enabled - * @property {google.cloud.ces.v1beta.ITriggerAction|null} [action] Guardrail action - * @property {google.protobuf.ITimestamp|null} [createTime] Guardrail createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Guardrail updateTime - * @property {string|null} [etag] Guardrail etag - */ - - /** - * Constructs a new Guardrail. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a Guardrail. - * @implements IGuardrail - * @constructor - * @param {google.cloud.ces.v1beta.IGuardrail=} [properties] Properties to set - */ - function Guardrail(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Guardrail contentFilter. - * @member {google.cloud.ces.v1beta.Guardrail.IContentFilter|null|undefined} contentFilter - * @memberof google.cloud.ces.v1beta.Guardrail - * @instance - */ - Guardrail.prototype.contentFilter = null; - - /** - * Guardrail llmPromptSecurity. - * @member {google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity|null|undefined} llmPromptSecurity - * @memberof google.cloud.ces.v1beta.Guardrail - * @instance - */ - Guardrail.prototype.llmPromptSecurity = null; - - /** - * Guardrail llmPolicy. - * @member {google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null|undefined} llmPolicy - * @memberof google.cloud.ces.v1beta.Guardrail - * @instance - */ - Guardrail.prototype.llmPolicy = null; - - /** - * Guardrail modelSafety. - * @member {google.cloud.ces.v1beta.Guardrail.IModelSafety|null|undefined} modelSafety - * @memberof google.cloud.ces.v1beta.Guardrail - * @instance - */ - Guardrail.prototype.modelSafety = null; - - /** - * Guardrail codeCallback. - * @member {google.cloud.ces.v1beta.Guardrail.ICodeCallback|null|undefined} codeCallback - * @memberof google.cloud.ces.v1beta.Guardrail - * @instance - */ - Guardrail.prototype.codeCallback = null; - - /** - * Guardrail name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.Guardrail - * @instance - */ - Guardrail.prototype.name = ""; - - /** - * Guardrail displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.Guardrail - * @instance - */ - Guardrail.prototype.displayName = ""; - - /** - * Guardrail description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.Guardrail - * @instance - */ - Guardrail.prototype.description = ""; - - /** - * Guardrail enabled. - * @member {boolean} enabled - * @memberof google.cloud.ces.v1beta.Guardrail - * @instance - */ - Guardrail.prototype.enabled = false; - - /** - * Guardrail action. - * @member {google.cloud.ces.v1beta.ITriggerAction|null|undefined} action - * @memberof google.cloud.ces.v1beta.Guardrail - * @instance - */ - Guardrail.prototype.action = null; - - /** - * Guardrail createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.Guardrail - * @instance - */ - Guardrail.prototype.createTime = null; - - /** - * Guardrail updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1beta.Guardrail - * @instance - */ - Guardrail.prototype.updateTime = null; - - /** - * Guardrail etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.Guardrail - * @instance - */ - Guardrail.prototype.etag = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Guardrail guardrailType. - * @member {"contentFilter"|"llmPromptSecurity"|"llmPolicy"|"modelSafety"|"codeCallback"|undefined} guardrailType - * @memberof google.cloud.ces.v1beta.Guardrail - * @instance - */ - Object.defineProperty(Guardrail.prototype, "guardrailType", { - get: $util.oneOfGetter($oneOfFields = ["contentFilter", "llmPromptSecurity", "llmPolicy", "modelSafety", "codeCallback"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Guardrail instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Guardrail - * @static - * @param {google.cloud.ces.v1beta.IGuardrail=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Guardrail} Guardrail instance - */ - Guardrail.create = function create(properties) { - return new Guardrail(properties); - }; - - /** - * Encodes the specified Guardrail message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Guardrail - * @static - * @param {google.cloud.ces.v1beta.IGuardrail} message Guardrail message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Guardrail.encode = function encode(message, writer) { - if (!writer) - 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.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enabled); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - $root.google.cloud.ces.v1beta.TriggerAction.encode(message.action, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.contentFilter != null && Object.hasOwnProperty.call(message, "contentFilter")) - $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.encode(message.contentFilter, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.llmPromptSecurity != null && Object.hasOwnProperty.call(message, "llmPromptSecurity")) - $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.encode(message.llmPromptSecurity, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.llmPolicy != null && Object.hasOwnProperty.call(message, "llmPolicy")) - $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.encode(message.llmPolicy, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); - if (message.modelSafety != null && Object.hasOwnProperty.call(message, "modelSafety")) - $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.encode(message.modelSafety, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.codeCallback != null && Object.hasOwnProperty.call(message, "codeCallback")) - $root.google.cloud.ces.v1beta.Guardrail.CodeCallback.encode(message.codeCallback, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Guardrail message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Guardrail - * @static - * @param {google.cloud.ces.v1beta.IGuardrail} message Guardrail message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Guardrail.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Guardrail message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Guardrail - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Guardrail} Guardrail - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Guardrail.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 8: { - message.contentFilter = $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.decode(reader, reader.uint32()); - break; - } - case 9: { - message.llmPromptSecurity = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.decode(reader, reader.uint32()); - break; - } - case 10: { - message.llmPolicy = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.decode(reader, reader.uint32()); - break; - } - case 13: { - message.modelSafety = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.decode(reader, reader.uint32()); - break; - } - case 14: { - message.codeCallback = $root.google.cloud.ces.v1beta.Guardrail.CodeCallback.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.enabled = reader.bool(); - break; - } - case 5: { - message.action = $root.google.cloud.ces.v1beta.TriggerAction.decode(reader, reader.uint32()); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Guardrail message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Guardrail - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Guardrail} Guardrail - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Guardrail.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Guardrail message. - * @function verify - * @memberof google.cloud.ces.v1beta.Guardrail - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Guardrail.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.contentFilter != null && message.hasOwnProperty("contentFilter")) { - properties.guardrailType = 1; - { - var error = $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.verify(message.contentFilter); - if (error) - return "contentFilter." + error; - } - } - if (message.llmPromptSecurity != null && message.hasOwnProperty("llmPromptSecurity")) { - if (properties.guardrailType === 1) - return "guardrailType: multiple values"; - properties.guardrailType = 1; - { - var error = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.verify(message.llmPromptSecurity); - if (error) - return "llmPromptSecurity." + error; - } - } - if (message.llmPolicy != null && message.hasOwnProperty("llmPolicy")) { - if (properties.guardrailType === 1) - return "guardrailType: multiple values"; - properties.guardrailType = 1; - { - var error = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.verify(message.llmPolicy); - if (error) - return "llmPolicy." + error; - } - } - if (message.modelSafety != null && message.hasOwnProperty("modelSafety")) { - if (properties.guardrailType === 1) - return "guardrailType: multiple values"; - properties.guardrailType = 1; - { - var error = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.verify(message.modelSafety); - if (error) - return "modelSafety." + error; - } - } - if (message.codeCallback != null && message.hasOwnProperty("codeCallback")) { - if (properties.guardrailType === 1) - return "guardrailType: multiple values"; - properties.guardrailType = 1; - { - var error = $root.google.cloud.ces.v1beta.Guardrail.CodeCallback.verify(message.codeCallback); - if (error) - return "codeCallback." + 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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.enabled != null && message.hasOwnProperty("enabled")) - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - if (message.action != null && message.hasOwnProperty("action")) { - var error = $root.google.cloud.ces.v1beta.TriggerAction.verify(message.action); - if (error) - return "action." + error; - } - 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.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a Guardrail message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Guardrail - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Guardrail} Guardrail - */ - Guardrail.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Guardrail) - return object; - var message = new $root.google.cloud.ces.v1beta.Guardrail(); - if (object.contentFilter != null) { - if (typeof object.contentFilter !== "object") - throw TypeError(".google.cloud.ces.v1beta.Guardrail.contentFilter: object expected"); - message.contentFilter = $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.fromObject(object.contentFilter); - } - if (object.llmPromptSecurity != null) { - if (typeof object.llmPromptSecurity !== "object") - throw TypeError(".google.cloud.ces.v1beta.Guardrail.llmPromptSecurity: object expected"); - message.llmPromptSecurity = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.fromObject(object.llmPromptSecurity); - } - if (object.llmPolicy != null) { - if (typeof object.llmPolicy !== "object") - throw TypeError(".google.cloud.ces.v1beta.Guardrail.llmPolicy: object expected"); - message.llmPolicy = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.fromObject(object.llmPolicy); - } - if (object.modelSafety != null) { - if (typeof object.modelSafety !== "object") - throw TypeError(".google.cloud.ces.v1beta.Guardrail.modelSafety: object expected"); - message.modelSafety = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.fromObject(object.modelSafety); - } - if (object.codeCallback != null) { - if (typeof object.codeCallback !== "object") - throw TypeError(".google.cloud.ces.v1beta.Guardrail.codeCallback: object expected"); - message.codeCallback = $root.google.cloud.ces.v1beta.Guardrail.CodeCallback.fromObject(object.codeCallback); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.action != null) { - if (typeof object.action !== "object") - throw TypeError(".google.cloud.ces.v1beta.Guardrail.action: object expected"); - message.action = $root.google.cloud.ces.v1beta.TriggerAction.fromObject(object.action); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.Guardrail.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.ces.v1beta.Guardrail.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a Guardrail message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Guardrail - * @static - * @param {google.cloud.ces.v1beta.Guardrail} message Guardrail - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Guardrail.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.enabled = false; - object.action = null; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.enabled != null && message.hasOwnProperty("enabled")) - object.enabled = message.enabled; - if (message.action != null && message.hasOwnProperty("action")) - object.action = $root.google.cloud.ces.v1beta.TriggerAction.toObject(message.action, options); - 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.contentFilter != null && message.hasOwnProperty("contentFilter")) { - object.contentFilter = $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.toObject(message.contentFilter, options); - if (options.oneofs) - object.guardrailType = "contentFilter"; - } - if (message.llmPromptSecurity != null && message.hasOwnProperty("llmPromptSecurity")) { - object.llmPromptSecurity = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.toObject(message.llmPromptSecurity, options); - if (options.oneofs) - object.guardrailType = "llmPromptSecurity"; - } - if (message.llmPolicy != null && message.hasOwnProperty("llmPolicy")) { - object.llmPolicy = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.toObject(message.llmPolicy, options); - if (options.oneofs) - object.guardrailType = "llmPolicy"; - } - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.modelSafety != null && message.hasOwnProperty("modelSafety")) { - object.modelSafety = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.toObject(message.modelSafety, options); - if (options.oneofs) - object.guardrailType = "modelSafety"; - } - if (message.codeCallback != null && message.hasOwnProperty("codeCallback")) { - object.codeCallback = $root.google.cloud.ces.v1beta.Guardrail.CodeCallback.toObject(message.codeCallback, options); - if (options.oneofs) - object.guardrailType = "codeCallback"; - } - return object; - }; - - /** - * Converts this Guardrail to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Guardrail - * @instance - * @returns {Object.} JSON object - */ - Guardrail.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Guardrail - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Guardrail - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Guardrail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail"; - }; - - Guardrail.ContentFilter = (function() { - - /** - * Properties of a ContentFilter. - * @memberof google.cloud.ces.v1beta.Guardrail - * @interface IContentFilter - * @property {Array.|null} [bannedContents] ContentFilter bannedContents - * @property {Array.|null} [bannedContentsInUserInput] ContentFilter bannedContentsInUserInput - * @property {Array.|null} [bannedContentsInAgentResponse] ContentFilter bannedContentsInAgentResponse - * @property {google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType|null} [matchType] ContentFilter matchType - * @property {boolean|null} [disregardDiacritics] ContentFilter disregardDiacritics - */ - - /** - * Constructs a new ContentFilter. - * @memberof google.cloud.ces.v1beta.Guardrail - * @classdesc Represents a ContentFilter. - * @implements IContentFilter - * @constructor - * @param {google.cloud.ces.v1beta.Guardrail.IContentFilter=} [properties] Properties to set - */ - function ContentFilter(properties) { - this.bannedContents = []; - this.bannedContentsInUserInput = []; - this.bannedContentsInAgentResponse = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContentFilter bannedContents. - * @member {Array.} bannedContents - * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter - * @instance - */ - ContentFilter.prototype.bannedContents = $util.emptyArray; - - /** - * ContentFilter bannedContentsInUserInput. - * @member {Array.} bannedContentsInUserInput - * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter - * @instance - */ - ContentFilter.prototype.bannedContentsInUserInput = $util.emptyArray; - - /** - * ContentFilter bannedContentsInAgentResponse. - * @member {Array.} bannedContentsInAgentResponse - * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter - * @instance - */ - ContentFilter.prototype.bannedContentsInAgentResponse = $util.emptyArray; - - /** - * ContentFilter matchType. - * @member {google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType} matchType - * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter - * @instance - */ - ContentFilter.prototype.matchType = 0; - - /** - * ContentFilter disregardDiacritics. - * @member {boolean} disregardDiacritics - * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter - * @instance - */ - ContentFilter.prototype.disregardDiacritics = false; - - /** - * Creates a new ContentFilter instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter - * @static - * @param {google.cloud.ces.v1beta.Guardrail.IContentFilter=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Guardrail.ContentFilter} ContentFilter instance - */ - ContentFilter.create = function create(properties) { - return new ContentFilter(properties); - }; - - /** - * Encodes the specified ContentFilter message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ContentFilter.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter - * @static - * @param {google.cloud.ces.v1beta.Guardrail.IContentFilter} message ContentFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContentFilter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bannedContents != null && message.bannedContents.length) - for (var i = 0; i < message.bannedContents.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.bannedContents[i]); - if (message.bannedContentsInUserInput != null && message.bannedContentsInUserInput.length) - for (var i = 0; i < message.bannedContentsInUserInput.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.bannedContentsInUserInput[i]); - if (message.bannedContentsInAgentResponse != null && message.bannedContentsInAgentResponse.length) - for (var i = 0; i < message.bannedContentsInAgentResponse.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.bannedContentsInAgentResponse[i]); - if (message.matchType != null && Object.hasOwnProperty.call(message, "matchType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.matchType); - if (message.disregardDiacritics != null && Object.hasOwnProperty.call(message, "disregardDiacritics")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disregardDiacritics); - return writer; - }; - - /** - * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ContentFilter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter - * @static - * @param {google.cloud.ces.v1beta.Guardrail.IContentFilter} message ContentFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContentFilter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContentFilter message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Guardrail.ContentFilter} ContentFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContentFilter.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.ContentFilter(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.bannedContents && message.bannedContents.length)) - message.bannedContents = []; - message.bannedContents.push(reader.string()); - break; - } - case 2: { - if (!(message.bannedContentsInUserInput && message.bannedContentsInUserInput.length)) - message.bannedContentsInUserInput = []; - message.bannedContentsInUserInput.push(reader.string()); - break; - } - case 3: { - if (!(message.bannedContentsInAgentResponse && message.bannedContentsInAgentResponse.length)) - message.bannedContentsInAgentResponse = []; - message.bannedContentsInAgentResponse.push(reader.string()); - break; - } - case 4: { - message.matchType = reader.int32(); - break; - } - case 5: { - message.disregardDiacritics = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContentFilter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Guardrail.ContentFilter} ContentFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContentFilter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContentFilter message. - * @function verify - * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContentFilter.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bannedContents != null && message.hasOwnProperty("bannedContents")) { - if (!Array.isArray(message.bannedContents)) - return "bannedContents: array expected"; - for (var i = 0; i < message.bannedContents.length; ++i) - if (!$util.isString(message.bannedContents[i])) - return "bannedContents: string[] expected"; - } - if (message.bannedContentsInUserInput != null && message.hasOwnProperty("bannedContentsInUserInput")) { - if (!Array.isArray(message.bannedContentsInUserInput)) - return "bannedContentsInUserInput: array expected"; - for (var i = 0; i < message.bannedContentsInUserInput.length; ++i) - if (!$util.isString(message.bannedContentsInUserInput[i])) - return "bannedContentsInUserInput: string[] expected"; - } - if (message.bannedContentsInAgentResponse != null && message.hasOwnProperty("bannedContentsInAgentResponse")) { - if (!Array.isArray(message.bannedContentsInAgentResponse)) - return "bannedContentsInAgentResponse: array expected"; - for (var i = 0; i < message.bannedContentsInAgentResponse.length; ++i) - if (!$util.isString(message.bannedContentsInAgentResponse[i])) - return "bannedContentsInAgentResponse: string[] expected"; - } - if (message.matchType != null && message.hasOwnProperty("matchType")) - switch (message.matchType) { - default: - return "matchType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.disregardDiacritics != null && message.hasOwnProperty("disregardDiacritics")) - if (typeof message.disregardDiacritics !== "boolean") - return "disregardDiacritics: boolean expected"; - return null; - }; - - /** - * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Guardrail.ContentFilter} ContentFilter - */ - ContentFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.ContentFilter) - return object; - var message = new $root.google.cloud.ces.v1beta.Guardrail.ContentFilter(); - if (object.bannedContents) { - if (!Array.isArray(object.bannedContents)) - throw TypeError(".google.cloud.ces.v1beta.Guardrail.ContentFilter.bannedContents: array expected"); - message.bannedContents = []; - for (var i = 0; i < object.bannedContents.length; ++i) - message.bannedContents[i] = String(object.bannedContents[i]); - } - if (object.bannedContentsInUserInput) { - if (!Array.isArray(object.bannedContentsInUserInput)) - throw TypeError(".google.cloud.ces.v1beta.Guardrail.ContentFilter.bannedContentsInUserInput: array expected"); - message.bannedContentsInUserInput = []; - for (var i = 0; i < object.bannedContentsInUserInput.length; ++i) - message.bannedContentsInUserInput[i] = String(object.bannedContentsInUserInput[i]); - } - if (object.bannedContentsInAgentResponse) { - if (!Array.isArray(object.bannedContentsInAgentResponse)) - throw TypeError(".google.cloud.ces.v1beta.Guardrail.ContentFilter.bannedContentsInAgentResponse: array expected"); - message.bannedContentsInAgentResponse = []; - for (var i = 0; i < object.bannedContentsInAgentResponse.length; ++i) - message.bannedContentsInAgentResponse[i] = String(object.bannedContentsInAgentResponse[i]); - } - switch (object.matchType) { - default: - if (typeof object.matchType === "number") { - message.matchType = object.matchType; - break; - } - break; - case "MATCH_TYPE_UNSPECIFIED": - case 0: - message.matchType = 0; - break; - case "SIMPLE_STRING_MATCH": - case 1: - message.matchType = 1; - break; - case "WORD_BOUNDARY_STRING_MATCH": - case 2: - message.matchType = 2; - break; - case "REGEXP_MATCH": - case 3: - message.matchType = 3; - break; - } - if (object.disregardDiacritics != null) - message.disregardDiacritics = Boolean(object.disregardDiacritics); - return message; - }; - - /** - * Creates a plain object from a ContentFilter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter - * @static - * @param {google.cloud.ces.v1beta.Guardrail.ContentFilter} message ContentFilter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContentFilter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bannedContents = []; - object.bannedContentsInUserInput = []; - object.bannedContentsInAgentResponse = []; - } - if (options.defaults) { - object.matchType = options.enums === String ? "MATCH_TYPE_UNSPECIFIED" : 0; - object.disregardDiacritics = false; - } - if (message.bannedContents && message.bannedContents.length) { - object.bannedContents = []; - for (var j = 0; j < message.bannedContents.length; ++j) - object.bannedContents[j] = message.bannedContents[j]; - } - if (message.bannedContentsInUserInput && message.bannedContentsInUserInput.length) { - object.bannedContentsInUserInput = []; - for (var j = 0; j < message.bannedContentsInUserInput.length; ++j) - object.bannedContentsInUserInput[j] = message.bannedContentsInUserInput[j]; - } - if (message.bannedContentsInAgentResponse && message.bannedContentsInAgentResponse.length) { - object.bannedContentsInAgentResponse = []; - for (var j = 0; j < message.bannedContentsInAgentResponse.length; ++j) - object.bannedContentsInAgentResponse[j] = message.bannedContentsInAgentResponse[j]; - } - if (message.matchType != null && message.hasOwnProperty("matchType")) - object.matchType = options.enums === String ? $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType[message.matchType] === undefined ? message.matchType : $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType[message.matchType] : message.matchType; - if (message.disregardDiacritics != null && message.hasOwnProperty("disregardDiacritics")) - object.disregardDiacritics = message.disregardDiacritics; - return object; - }; - - /** - * Converts this ContentFilter to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter - * @instance - * @returns {Object.} JSON object - */ - ContentFilter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContentFilter - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ContentFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.ContentFilter"; - }; - - /** - * MatchType enum. - * @name google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType - * @enum {number} - * @property {number} MATCH_TYPE_UNSPECIFIED=0 MATCH_TYPE_UNSPECIFIED value - * @property {number} SIMPLE_STRING_MATCH=1 SIMPLE_STRING_MATCH value - * @property {number} WORD_BOUNDARY_STRING_MATCH=2 WORD_BOUNDARY_STRING_MATCH value - * @property {number} REGEXP_MATCH=3 REGEXP_MATCH value - */ - ContentFilter.MatchType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MATCH_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SIMPLE_STRING_MATCH"] = 1; - values[valuesById[2] = "WORD_BOUNDARY_STRING_MATCH"] = 2; - values[valuesById[3] = "REGEXP_MATCH"] = 3; - return values; - })(); - - return ContentFilter; - })(); - - Guardrail.LlmPromptSecurity = (function() { - - /** - * Properties of a LlmPromptSecurity. - * @memberof google.cloud.ces.v1beta.Guardrail - * @interface ILlmPromptSecurity - * @property {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null} [defaultSettings] LlmPromptSecurity defaultSettings - * @property {google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null} [customPolicy] LlmPromptSecurity customPolicy - * @property {boolean|null} [failOpen] LlmPromptSecurity failOpen - */ - - /** - * Constructs a new LlmPromptSecurity. - * @memberof google.cloud.ces.v1beta.Guardrail - * @classdesc Represents a LlmPromptSecurity. - * @implements ILlmPromptSecurity - * @constructor - * @param {google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity=} [properties] Properties to set - */ - function LlmPromptSecurity(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LlmPromptSecurity defaultSettings. - * @member {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null|undefined} defaultSettings - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity - * @instance - */ - LlmPromptSecurity.prototype.defaultSettings = null; - - /** - * LlmPromptSecurity customPolicy. - * @member {google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null|undefined} customPolicy - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity - * @instance - */ - LlmPromptSecurity.prototype.customPolicy = null; - - /** - * LlmPromptSecurity failOpen. - * @member {boolean} failOpen - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity - * @instance - */ - LlmPromptSecurity.prototype.failOpen = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * LlmPromptSecurity securityConfig. - * @member {"defaultSettings"|"customPolicy"|undefined} securityConfig - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity - * @instance - */ - Object.defineProperty(LlmPromptSecurity.prototype, "securityConfig", { - get: $util.oneOfGetter($oneOfFields = ["defaultSettings", "customPolicy"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new LlmPromptSecurity instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity - * @static - * @param {google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity} LlmPromptSecurity instance - */ - LlmPromptSecurity.create = function create(properties) { - return new LlmPromptSecurity(properties); - }; - - /** - * Encodes the specified LlmPromptSecurity message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity - * @static - * @param {google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity} message LlmPromptSecurity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LlmPromptSecurity.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaultSettings != null && Object.hasOwnProperty.call(message, "defaultSettings")) - $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.encode(message.defaultSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.customPolicy != null && Object.hasOwnProperty.call(message, "customPolicy")) - $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.encode(message.customPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.failOpen != null && Object.hasOwnProperty.call(message, "failOpen")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.failOpen); - return writer; - }; - - /** - * Encodes the specified LlmPromptSecurity message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity - * @static - * @param {google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity} message LlmPromptSecurity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LlmPromptSecurity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LlmPromptSecurity message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity} LlmPromptSecurity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LlmPromptSecurity.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.defaultSettings = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.decode(reader, reader.uint32()); - break; - } - case 2: { - message.customPolicy = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.decode(reader, reader.uint32()); - break; - } - case 3: { - message.failOpen = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LlmPromptSecurity message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity} LlmPromptSecurity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LlmPromptSecurity.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LlmPromptSecurity message. - * @function verify - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LlmPromptSecurity.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.defaultSettings != null && message.hasOwnProperty("defaultSettings")) { - properties.securityConfig = 1; - { - var error = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify(message.defaultSettings); - if (error) - return "defaultSettings." + error; - } - } - if (message.customPolicy != null && message.hasOwnProperty("customPolicy")) { - if (properties.securityConfig === 1) - return "securityConfig: multiple values"; - properties.securityConfig = 1; - { - var error = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.verify(message.customPolicy); - if (error) - return "customPolicy." + error; - } - } - if (message.failOpen != null && message.hasOwnProperty("failOpen")) - if (typeof message.failOpen !== "boolean") - return "failOpen: boolean expected"; - return null; - }; - - /** - * Creates a LlmPromptSecurity message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity} LlmPromptSecurity - */ - LlmPromptSecurity.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity) - return object; - var message = new $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity(); - if (object.defaultSettings != null) { - if (typeof object.defaultSettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.defaultSettings: object expected"); - message.defaultSettings = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.fromObject(object.defaultSettings); - } - if (object.customPolicy != null) { - if (typeof object.customPolicy !== "object") - throw TypeError(".google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.customPolicy: object expected"); - message.customPolicy = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.fromObject(object.customPolicy); - } - if (object.failOpen != null) - message.failOpen = Boolean(object.failOpen); - return message; - }; - - /** - * Creates a plain object from a LlmPromptSecurity message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity - * @static - * @param {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity} message LlmPromptSecurity - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LlmPromptSecurity.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.failOpen = false; - if (message.defaultSettings != null && message.hasOwnProperty("defaultSettings")) { - object.defaultSettings = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.toObject(message.defaultSettings, options); - if (options.oneofs) - object.securityConfig = "defaultSettings"; - } - if (message.customPolicy != null && message.hasOwnProperty("customPolicy")) { - object.customPolicy = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.toObject(message.customPolicy, options); - if (options.oneofs) - object.securityConfig = "customPolicy"; - } - if (message.failOpen != null && message.hasOwnProperty("failOpen")) - object.failOpen = message.failOpen; - return object; - }; - - /** - * Converts this LlmPromptSecurity to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity - * @instance - * @returns {Object.} JSON object - */ - LlmPromptSecurity.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LlmPromptSecurity - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LlmPromptSecurity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity"; - }; - - LlmPromptSecurity.DefaultSecuritySettings = (function() { - - /** - * Properties of a DefaultSecuritySettings. - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity - * @interface IDefaultSecuritySettings - * @property {string|null} [defaultPromptTemplate] DefaultSecuritySettings defaultPromptTemplate - */ - - /** - * Constructs a new DefaultSecuritySettings. - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity - * @classdesc Represents a DefaultSecuritySettings. - * @implements IDefaultSecuritySettings - * @constructor - * @param {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings=} [properties] Properties to set - */ - function DefaultSecuritySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DefaultSecuritySettings defaultPromptTemplate. - * @member {string} defaultPromptTemplate - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @instance - */ - DefaultSecuritySettings.prototype.defaultPromptTemplate = ""; - - /** - * Creates a new DefaultSecuritySettings instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @static - * @param {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings instance - */ - DefaultSecuritySettings.create = function create(properties) { - return new DefaultSecuritySettings(properties); - }; - - /** - * Encodes the specified DefaultSecuritySettings message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @static - * @param {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings} message DefaultSecuritySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DefaultSecuritySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaultPromptTemplate != null && Object.hasOwnProperty.call(message, "defaultPromptTemplate")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.defaultPromptTemplate); - return writer; - }; - - /** - * Encodes the specified DefaultSecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @static - * @param {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings} message DefaultSecuritySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DefaultSecuritySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DefaultSecuritySettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DefaultSecuritySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.defaultPromptTemplate = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DefaultSecuritySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DefaultSecuritySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DefaultSecuritySettings message. - * @function verify - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DefaultSecuritySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaultPromptTemplate != null && message.hasOwnProperty("defaultPromptTemplate")) - if (!$util.isString(message.defaultPromptTemplate)) - return "defaultPromptTemplate: string expected"; - return null; - }; - - /** - * Creates a DefaultSecuritySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings - */ - DefaultSecuritySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings) - return object; - var message = new $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings(); - if (object.defaultPromptTemplate != null) - message.defaultPromptTemplate = String(object.defaultPromptTemplate); - return message; - }; - - /** - * Creates a plain object from a DefaultSecuritySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @static - * @param {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} message DefaultSecuritySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DefaultSecuritySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.defaultPromptTemplate = ""; - if (message.defaultPromptTemplate != null && message.hasOwnProperty("defaultPromptTemplate")) - object.defaultPromptTemplate = message.defaultPromptTemplate; - return object; - }; - - /** - * Converts this DefaultSecuritySettings to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @instance - * @returns {Object.} JSON object - */ - DefaultSecuritySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DefaultSecuritySettings - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DefaultSecuritySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings"; - }; - - return DefaultSecuritySettings; - })(); - - return LlmPromptSecurity; - })(); - - Guardrail.LlmPolicy = (function() { - - /** - * Properties of a LlmPolicy. - * @memberof google.cloud.ces.v1beta.Guardrail - * @interface ILlmPolicy - * @property {number|null} [maxConversationMessages] LlmPolicy maxConversationMessages - * @property {google.cloud.ces.v1beta.IModelSettings|null} [modelSettings] LlmPolicy modelSettings - * @property {string|null} [prompt] LlmPolicy prompt - * @property {google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope|null} [policyScope] LlmPolicy policyScope - * @property {boolean|null} [failOpen] LlmPolicy failOpen - * @property {boolean|null} [allowShortUtterance] LlmPolicy allowShortUtterance - */ - - /** - * Constructs a new LlmPolicy. - * @memberof google.cloud.ces.v1beta.Guardrail - * @classdesc Represents a LlmPolicy. - * @implements ILlmPolicy - * @constructor - * @param {google.cloud.ces.v1beta.Guardrail.ILlmPolicy=} [properties] Properties to set - */ - function LlmPolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LlmPolicy maxConversationMessages. - * @member {number} maxConversationMessages - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy - * @instance - */ - LlmPolicy.prototype.maxConversationMessages = 0; - - /** - * LlmPolicy modelSettings. - * @member {google.cloud.ces.v1beta.IModelSettings|null|undefined} modelSettings - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy - * @instance - */ - LlmPolicy.prototype.modelSettings = null; - - /** - * LlmPolicy prompt. - * @member {string} prompt - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy - * @instance - */ - LlmPolicy.prototype.prompt = ""; - - /** - * LlmPolicy policyScope. - * @member {google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope} policyScope - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy - * @instance - */ - LlmPolicy.prototype.policyScope = 0; - - /** - * LlmPolicy failOpen. - * @member {boolean} failOpen - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy - * @instance - */ - LlmPolicy.prototype.failOpen = false; - - /** - * LlmPolicy allowShortUtterance. - * @member {boolean} allowShortUtterance - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy - * @instance - */ - LlmPolicy.prototype.allowShortUtterance = false; - - /** - * Creates a new LlmPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy - * @static - * @param {google.cloud.ces.v1beta.Guardrail.ILlmPolicy=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Guardrail.LlmPolicy} LlmPolicy instance - */ - LlmPolicy.create = function create(properties) { - return new LlmPolicy(properties); - }; - - /** - * Encodes the specified LlmPolicy message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy - * @static - * @param {google.cloud.ces.v1beta.Guardrail.ILlmPolicy} message LlmPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LlmPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.maxConversationMessages != null && Object.hasOwnProperty.call(message, "maxConversationMessages")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxConversationMessages); - if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) - $root.google.cloud.ces.v1beta.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.prompt); - if (message.policyScope != null && Object.hasOwnProperty.call(message, "policyScope")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.policyScope); - if (message.failOpen != null && Object.hasOwnProperty.call(message, "failOpen")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.failOpen); - if (message.allowShortUtterance != null && Object.hasOwnProperty.call(message, "allowShortUtterance")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowShortUtterance); - return writer; - }; - - /** - * Encodes the specified LlmPolicy message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy - * @static - * @param {google.cloud.ces.v1beta.Guardrail.ILlmPolicy} message LlmPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LlmPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LlmPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Guardrail.LlmPolicy} LlmPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LlmPolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.maxConversationMessages = reader.int32(); - break; - } - case 2: { - message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.decode(reader, reader.uint32()); - break; - } - case 3: { - message.prompt = reader.string(); - break; - } - case 4: { - message.policyScope = reader.int32(); - break; - } - case 5: { - message.failOpen = reader.bool(); - break; - } - case 6: { - message.allowShortUtterance = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LlmPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Guardrail.LlmPolicy} LlmPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LlmPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LlmPolicy message. - * @function verify - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LlmPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.maxConversationMessages != null && message.hasOwnProperty("maxConversationMessages")) - if (!$util.isInteger(message.maxConversationMessages)) - return "maxConversationMessages: integer expected"; - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { - var error = $root.google.cloud.ces.v1beta.ModelSettings.verify(message.modelSettings); - if (error) - return "modelSettings." + error; - } - if (message.prompt != null && message.hasOwnProperty("prompt")) - if (!$util.isString(message.prompt)) - return "prompt: string expected"; - if (message.policyScope != null && message.hasOwnProperty("policyScope")) - switch (message.policyScope) { - default: - return "policyScope: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.failOpen != null && message.hasOwnProperty("failOpen")) - if (typeof message.failOpen !== "boolean") - return "failOpen: boolean expected"; - if (message.allowShortUtterance != null && message.hasOwnProperty("allowShortUtterance")) - if (typeof message.allowShortUtterance !== "boolean") - return "allowShortUtterance: boolean expected"; - return null; - }; - - /** - * Creates a LlmPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Guardrail.LlmPolicy} LlmPolicy - */ - LlmPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy) - return object; - var message = new $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy(); - if (object.maxConversationMessages != null) - message.maxConversationMessages = object.maxConversationMessages | 0; - if (object.modelSettings != null) { - if (typeof object.modelSettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.Guardrail.LlmPolicy.modelSettings: object expected"); - message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.fromObject(object.modelSettings); - } - if (object.prompt != null) - message.prompt = String(object.prompt); - switch (object.policyScope) { - default: - if (typeof object.policyScope === "number") { - message.policyScope = object.policyScope; - break; - } - break; - case "POLICY_SCOPE_UNSPECIFIED": - case 0: - message.policyScope = 0; - break; - case "USER_QUERY": - case 1: - message.policyScope = 1; - break; - case "AGENT_RESPONSE": - case 2: - message.policyScope = 2; - break; - case "USER_QUERY_AND_AGENT_RESPONSE": - case 3: - message.policyScope = 3; - break; - } - if (object.failOpen != null) - message.failOpen = Boolean(object.failOpen); - if (object.allowShortUtterance != null) - message.allowShortUtterance = Boolean(object.allowShortUtterance); - return message; - }; - - /** - * Creates a plain object from a LlmPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy - * @static - * @param {google.cloud.ces.v1beta.Guardrail.LlmPolicy} message LlmPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LlmPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.maxConversationMessages = 0; - object.modelSettings = null; - object.prompt = ""; - object.policyScope = options.enums === String ? "POLICY_SCOPE_UNSPECIFIED" : 0; - object.failOpen = false; - object.allowShortUtterance = false; - } - if (message.maxConversationMessages != null && message.hasOwnProperty("maxConversationMessages")) - object.maxConversationMessages = message.maxConversationMessages; - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) - object.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.toObject(message.modelSettings, options); - if (message.prompt != null && message.hasOwnProperty("prompt")) - object.prompt = message.prompt; - if (message.policyScope != null && message.hasOwnProperty("policyScope")) - object.policyScope = options.enums === String ? $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope[message.policyScope] === undefined ? message.policyScope : $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope[message.policyScope] : message.policyScope; - if (message.failOpen != null && message.hasOwnProperty("failOpen")) - object.failOpen = message.failOpen; - if (message.allowShortUtterance != null && message.hasOwnProperty("allowShortUtterance")) - object.allowShortUtterance = message.allowShortUtterance; - return object; - }; - - /** - * Converts this LlmPolicy to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy - * @instance - * @returns {Object.} JSON object - */ - LlmPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LlmPolicy - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LlmPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.LlmPolicy"; - }; - - /** - * PolicyScope enum. - * @name google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope - * @enum {number} - * @property {number} POLICY_SCOPE_UNSPECIFIED=0 POLICY_SCOPE_UNSPECIFIED value - * @property {number} USER_QUERY=1 USER_QUERY value - * @property {number} AGENT_RESPONSE=2 AGENT_RESPONSE value - * @property {number} USER_QUERY_AND_AGENT_RESPONSE=3 USER_QUERY_AND_AGENT_RESPONSE value - */ - LlmPolicy.PolicyScope = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "POLICY_SCOPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "USER_QUERY"] = 1; - values[valuesById[2] = "AGENT_RESPONSE"] = 2; - values[valuesById[3] = "USER_QUERY_AND_AGENT_RESPONSE"] = 3; - return values; - })(); - - return LlmPolicy; - })(); - - Guardrail.ModelSafety = (function() { - - /** - * Properties of a ModelSafety. - * @memberof google.cloud.ces.v1beta.Guardrail - * @interface IModelSafety - * @property {Array.|null} [safetySettings] ModelSafety safetySettings - */ - - /** - * Constructs a new ModelSafety. - * @memberof google.cloud.ces.v1beta.Guardrail - * @classdesc Represents a ModelSafety. - * @implements IModelSafety - * @constructor - * @param {google.cloud.ces.v1beta.Guardrail.IModelSafety=} [properties] Properties to set - */ - function ModelSafety(properties) { - this.safetySettings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ModelSafety safetySettings. - * @member {Array.} safetySettings - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety - * @instance - */ - ModelSafety.prototype.safetySettings = $util.emptyArray; - - /** - * Creates a new ModelSafety instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety - * @static - * @param {google.cloud.ces.v1beta.Guardrail.IModelSafety=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety} ModelSafety instance - */ - ModelSafety.create = function create(properties) { - return new ModelSafety(properties); - }; - - /** - * Encodes the specified ModelSafety message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety - * @static - * @param {google.cloud.ces.v1beta.Guardrail.IModelSafety} message ModelSafety message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModelSafety.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.safetySettings != null && message.safetySettings.length) - for (var i = 0; i < message.safetySettings.length; ++i) - $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ModelSafety message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety - * @static - * @param {google.cloud.ces.v1beta.Guardrail.IModelSafety} message ModelSafety message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModelSafety.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ModelSafety message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety} ModelSafety - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModelSafety.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.ModelSafety(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.safetySettings && message.safetySettings.length)) - message.safetySettings = []; - message.safetySettings.push($root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ModelSafety message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety} ModelSafety - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModelSafety.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ModelSafety message. - * @function verify - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ModelSafety.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.safetySettings != null && message.hasOwnProperty("safetySettings")) { - if (!Array.isArray(message.safetySettings)) - return "safetySettings: array expected"; - for (var i = 0; i < message.safetySettings.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.verify(message.safetySettings[i]); - if (error) - return "safetySettings." + error; - } - } - return null; - }; - - /** - * Creates a ModelSafety message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety} ModelSafety - */ - ModelSafety.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.ModelSafety) - return object; - var message = new $root.google.cloud.ces.v1beta.Guardrail.ModelSafety(); - if (object.safetySettings) { - if (!Array.isArray(object.safetySettings)) - throw TypeError(".google.cloud.ces.v1beta.Guardrail.ModelSafety.safetySettings: array expected"); - message.safetySettings = []; - for (var i = 0; i < object.safetySettings.length; ++i) { - if (typeof object.safetySettings[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Guardrail.ModelSafety.safetySettings: object expected"); - message.safetySettings[i] = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.fromObject(object.safetySettings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ModelSafety message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety - * @static - * @param {google.cloud.ces.v1beta.Guardrail.ModelSafety} message ModelSafety - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ModelSafety.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.safetySettings = []; - if (message.safetySettings && message.safetySettings.length) { - object.safetySettings = []; - for (var j = 0; j < message.safetySettings.length; ++j) - object.safetySettings[j] = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.toObject(message.safetySettings[j], options); - } - return object; - }; - - /** - * Converts this ModelSafety to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety - * @instance - * @returns {Object.} JSON object - */ - ModelSafety.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ModelSafety - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ModelSafety.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.ModelSafety"; - }; - - ModelSafety.SafetySetting = (function() { - - /** - * Properties of a SafetySetting. - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety - * @interface ISafetySetting - * @property {google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory|null} [category] SafetySetting category - * @property {google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold|null} [threshold] SafetySetting threshold - */ - - /** - * Constructs a new SafetySetting. - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety - * @classdesc Represents a SafetySetting. - * @implements ISafetySetting - * @constructor - * @param {google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting=} [properties] Properties to set - */ - function SafetySetting(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SafetySetting category. - * @member {google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory} category - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting - * @instance - */ - SafetySetting.prototype.category = 0; - - /** - * SafetySetting threshold. - * @member {google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold} threshold - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting - * @instance - */ - SafetySetting.prototype.threshold = 0; - - /** - * Creates a new SafetySetting instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting - * @static - * @param {google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting} SafetySetting instance - */ - SafetySetting.create = function create(properties) { - return new SafetySetting(properties); - }; - - /** - * Encodes the specified SafetySetting message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting - * @static - * @param {google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting} message SafetySetting message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SafetySetting.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.category != null && Object.hasOwnProperty.call(message, "category")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.category); - if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.threshold); - return writer; - }; - - /** - * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting - * @static - * @param {google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting} message SafetySetting message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SafetySetting.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SafetySetting message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting} SafetySetting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SafetySetting.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.category = reader.int32(); - break; - } - case 2: { - message.threshold = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SafetySetting message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting} SafetySetting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SafetySetting.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SafetySetting message. - * @function verify - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SafetySetting.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.category != null && message.hasOwnProperty("category")) - switch (message.category) { - default: - return "category: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.threshold != null && message.hasOwnProperty("threshold")) - switch (message.threshold) { - default: - return "threshold: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - return null; - }; - - /** - * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting} SafetySetting - */ - SafetySetting.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting) - return object; - var message = new $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting(); - switch (object.category) { - default: - if (typeof object.category === "number") { - message.category = object.category; - break; - } - break; - case "HARM_CATEGORY_UNSPECIFIED": - case 0: - message.category = 0; - break; - case "HARM_CATEGORY_HATE_SPEECH": - case 1: - message.category = 1; - break; - case "HARM_CATEGORY_DANGEROUS_CONTENT": - case 2: - message.category = 2; - break; - case "HARM_CATEGORY_HARASSMENT": - case 3: - message.category = 3; - break; - case "HARM_CATEGORY_SEXUALLY_EXPLICIT": - case 4: - message.category = 4; - break; - } - switch (object.threshold) { - default: - if (typeof object.threshold === "number") { - message.threshold = object.threshold; - break; - } - break; - case "HARM_BLOCK_THRESHOLD_UNSPECIFIED": - case 0: - message.threshold = 0; - break; - case "BLOCK_LOW_AND_ABOVE": - case 1: - message.threshold = 1; - break; - case "BLOCK_MEDIUM_AND_ABOVE": - case 2: - message.threshold = 2; - break; - case "BLOCK_ONLY_HIGH": - case 3: - message.threshold = 3; - break; - case "BLOCK_NONE": - case 4: - message.threshold = 4; - break; - case "OFF": - case 5: - message.threshold = 5; - break; - } - return message; - }; - - /** - * Creates a plain object from a SafetySetting message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting - * @static - * @param {google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting} message SafetySetting - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SafetySetting.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0; - object.threshold = options.enums === String ? "HARM_BLOCK_THRESHOLD_UNSPECIFIED" : 0; - } - if (message.category != null && message.hasOwnProperty("category")) - object.category = options.enums === String ? $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory[message.category] === undefined ? message.category : $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory[message.category] : message.category; - if (message.threshold != null && message.hasOwnProperty("threshold")) - object.threshold = options.enums === String ? $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold[message.threshold] === undefined ? message.threshold : $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold[message.threshold] : message.threshold; - return object; - }; - - /** - * Converts this SafetySetting to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting - * @instance - * @returns {Object.} JSON object - */ - SafetySetting.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SafetySetting - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SafetySetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting"; - }; - - return SafetySetting; - })(); - - /** - * HarmCategory enum. - * @name google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory - * @enum {number} - * @property {number} HARM_CATEGORY_UNSPECIFIED=0 HARM_CATEGORY_UNSPECIFIED value - * @property {number} HARM_CATEGORY_HATE_SPEECH=1 HARM_CATEGORY_HATE_SPEECH value - * @property {number} HARM_CATEGORY_DANGEROUS_CONTENT=2 HARM_CATEGORY_DANGEROUS_CONTENT value - * @property {number} HARM_CATEGORY_HARASSMENT=3 HARM_CATEGORY_HARASSMENT value - * @property {number} HARM_CATEGORY_SEXUALLY_EXPLICIT=4 HARM_CATEGORY_SEXUALLY_EXPLICIT value - */ - ModelSafety.HarmCategory = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HARM_CATEGORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "HARM_CATEGORY_HATE_SPEECH"] = 1; - values[valuesById[2] = "HARM_CATEGORY_DANGEROUS_CONTENT"] = 2; - values[valuesById[3] = "HARM_CATEGORY_HARASSMENT"] = 3; - values[valuesById[4] = "HARM_CATEGORY_SEXUALLY_EXPLICIT"] = 4; - return values; - })(); - - /** - * HarmBlockThreshold enum. - * @name google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold - * @enum {number} - * @property {number} HARM_BLOCK_THRESHOLD_UNSPECIFIED=0 HARM_BLOCK_THRESHOLD_UNSPECIFIED value - * @property {number} BLOCK_LOW_AND_ABOVE=1 BLOCK_LOW_AND_ABOVE value - * @property {number} BLOCK_MEDIUM_AND_ABOVE=2 BLOCK_MEDIUM_AND_ABOVE value - * @property {number} BLOCK_ONLY_HIGH=3 BLOCK_ONLY_HIGH value - * @property {number} BLOCK_NONE=4 BLOCK_NONE value - * @property {number} OFF=5 OFF value - */ - ModelSafety.HarmBlockThreshold = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED"] = 0; - values[valuesById[1] = "BLOCK_LOW_AND_ABOVE"] = 1; - values[valuesById[2] = "BLOCK_MEDIUM_AND_ABOVE"] = 2; - values[valuesById[3] = "BLOCK_ONLY_HIGH"] = 3; - values[valuesById[4] = "BLOCK_NONE"] = 4; - values[valuesById[5] = "OFF"] = 5; - return values; - })(); - - return ModelSafety; - })(); - - Guardrail.CodeCallback = (function() { - - /** - * Properties of a CodeCallback. - * @memberof google.cloud.ces.v1beta.Guardrail - * @interface ICodeCallback - * @property {google.cloud.ces.v1beta.ICallback|null} [beforeAgentCallback] CodeCallback beforeAgentCallback - * @property {google.cloud.ces.v1beta.ICallback|null} [afterAgentCallback] CodeCallback afterAgentCallback - * @property {google.cloud.ces.v1beta.ICallback|null} [beforeModelCallback] CodeCallback beforeModelCallback - * @property {google.cloud.ces.v1beta.ICallback|null} [afterModelCallback] CodeCallback afterModelCallback - */ - - /** - * Constructs a new CodeCallback. - * @memberof google.cloud.ces.v1beta.Guardrail - * @classdesc Represents a CodeCallback. - * @implements ICodeCallback - * @constructor - * @param {google.cloud.ces.v1beta.Guardrail.ICodeCallback=} [properties] Properties to set - */ - function CodeCallback(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CodeCallback beforeAgentCallback. - * @member {google.cloud.ces.v1beta.ICallback|null|undefined} beforeAgentCallback - * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback - * @instance - */ - CodeCallback.prototype.beforeAgentCallback = null; - - /** - * CodeCallback afterAgentCallback. - * @member {google.cloud.ces.v1beta.ICallback|null|undefined} afterAgentCallback - * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback - * @instance - */ - CodeCallback.prototype.afterAgentCallback = null; - - /** - * CodeCallback beforeModelCallback. - * @member {google.cloud.ces.v1beta.ICallback|null|undefined} beforeModelCallback - * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback - * @instance - */ - CodeCallback.prototype.beforeModelCallback = null; - - /** - * CodeCallback afterModelCallback. - * @member {google.cloud.ces.v1beta.ICallback|null|undefined} afterModelCallback - * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback - * @instance - */ - CodeCallback.prototype.afterModelCallback = null; - - /** - * Creates a new CodeCallback instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback - * @static - * @param {google.cloud.ces.v1beta.Guardrail.ICodeCallback=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Guardrail.CodeCallback} CodeCallback instance - */ - CodeCallback.create = function create(properties) { - return new CodeCallback(properties); - }; - - /** - * Encodes the specified CodeCallback message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.CodeCallback.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback - * @static - * @param {google.cloud.ces.v1beta.Guardrail.ICodeCallback} message CodeCallback message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CodeCallback.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.beforeAgentCallback != null && Object.hasOwnProperty.call(message, "beforeAgentCallback")) - $root.google.cloud.ces.v1beta.Callback.encode(message.beforeAgentCallback, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.afterAgentCallback != null && Object.hasOwnProperty.call(message, "afterAgentCallback")) - $root.google.cloud.ces.v1beta.Callback.encode(message.afterAgentCallback, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.beforeModelCallback != null && Object.hasOwnProperty.call(message, "beforeModelCallback")) - $root.google.cloud.ces.v1beta.Callback.encode(message.beforeModelCallback, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.afterModelCallback != null && Object.hasOwnProperty.call(message, "afterModelCallback")) - $root.google.cloud.ces.v1beta.Callback.encode(message.afterModelCallback, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CodeCallback message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.CodeCallback.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback - * @static - * @param {google.cloud.ces.v1beta.Guardrail.ICodeCallback} message CodeCallback message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CodeCallback.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CodeCallback message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Guardrail.CodeCallback} CodeCallback - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CodeCallback.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.CodeCallback(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.beforeAgentCallback = $root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32()); - break; - } - case 2: { - message.afterAgentCallback = $root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32()); - break; - } - case 3: { - message.beforeModelCallback = $root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32()); - break; - } - case 4: { - message.afterModelCallback = $root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CodeCallback message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Guardrail.CodeCallback} CodeCallback - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CodeCallback.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CodeCallback message. - * @function verify - * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CodeCallback.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.beforeAgentCallback != null && message.hasOwnProperty("beforeAgentCallback")) { - var error = $root.google.cloud.ces.v1beta.Callback.verify(message.beforeAgentCallback); - if (error) - return "beforeAgentCallback." + error; - } - if (message.afterAgentCallback != null && message.hasOwnProperty("afterAgentCallback")) { - var error = $root.google.cloud.ces.v1beta.Callback.verify(message.afterAgentCallback); - if (error) - return "afterAgentCallback." + error; - } - if (message.beforeModelCallback != null && message.hasOwnProperty("beforeModelCallback")) { - var error = $root.google.cloud.ces.v1beta.Callback.verify(message.beforeModelCallback); - if (error) - return "beforeModelCallback." + error; - } - if (message.afterModelCallback != null && message.hasOwnProperty("afterModelCallback")) { - var error = $root.google.cloud.ces.v1beta.Callback.verify(message.afterModelCallback); - if (error) - return "afterModelCallback." + error; - } - return null; - }; - - /** - * Creates a CodeCallback message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Guardrail.CodeCallback} CodeCallback - */ - CodeCallback.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.CodeCallback) - return object; - var message = new $root.google.cloud.ces.v1beta.Guardrail.CodeCallback(); - if (object.beforeAgentCallback != null) { - if (typeof object.beforeAgentCallback !== "object") - throw TypeError(".google.cloud.ces.v1beta.Guardrail.CodeCallback.beforeAgentCallback: object expected"); - message.beforeAgentCallback = $root.google.cloud.ces.v1beta.Callback.fromObject(object.beforeAgentCallback); - } - if (object.afterAgentCallback != null) { - if (typeof object.afterAgentCallback !== "object") - throw TypeError(".google.cloud.ces.v1beta.Guardrail.CodeCallback.afterAgentCallback: object expected"); - message.afterAgentCallback = $root.google.cloud.ces.v1beta.Callback.fromObject(object.afterAgentCallback); - } - if (object.beforeModelCallback != null) { - if (typeof object.beforeModelCallback !== "object") - throw TypeError(".google.cloud.ces.v1beta.Guardrail.CodeCallback.beforeModelCallback: object expected"); - message.beforeModelCallback = $root.google.cloud.ces.v1beta.Callback.fromObject(object.beforeModelCallback); - } - if (object.afterModelCallback != null) { - if (typeof object.afterModelCallback !== "object") - throw TypeError(".google.cloud.ces.v1beta.Guardrail.CodeCallback.afterModelCallback: object expected"); - message.afterModelCallback = $root.google.cloud.ces.v1beta.Callback.fromObject(object.afterModelCallback); - } - return message; - }; - - /** - * Creates a plain object from a CodeCallback message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback - * @static - * @param {google.cloud.ces.v1beta.Guardrail.CodeCallback} message CodeCallback - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CodeCallback.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.beforeAgentCallback = null; - object.afterAgentCallback = null; - object.beforeModelCallback = null; - object.afterModelCallback = null; - } - if (message.beforeAgentCallback != null && message.hasOwnProperty("beforeAgentCallback")) - object.beforeAgentCallback = $root.google.cloud.ces.v1beta.Callback.toObject(message.beforeAgentCallback, options); - if (message.afterAgentCallback != null && message.hasOwnProperty("afterAgentCallback")) - object.afterAgentCallback = $root.google.cloud.ces.v1beta.Callback.toObject(message.afterAgentCallback, options); - if (message.beforeModelCallback != null && message.hasOwnProperty("beforeModelCallback")) - object.beforeModelCallback = $root.google.cloud.ces.v1beta.Callback.toObject(message.beforeModelCallback, options); - if (message.afterModelCallback != null && message.hasOwnProperty("afterModelCallback")) - object.afterModelCallback = $root.google.cloud.ces.v1beta.Callback.toObject(message.afterModelCallback, options); - return object; - }; - - /** - * Converts this CodeCallback to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback - * @instance - * @returns {Object.} JSON object - */ - CodeCallback.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CodeCallback - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CodeCallback.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.CodeCallback"; - }; - - return CodeCallback; - })(); - - return Guardrail; - })(); - - v1beta.Tool = (function() { - - /** - * Properties of a Tool. - * @memberof google.cloud.ces.v1beta - * @interface ITool - * @property {google.cloud.ces.v1beta.IClientFunction|null} [clientFunction] Tool clientFunction - * @property {google.cloud.ces.v1beta.IOpenApiTool|null} [openApiTool] Tool openApiTool - * @property {google.cloud.ces.v1beta.IGoogleSearchTool|null} [googleSearchTool] Tool googleSearchTool - * @property {google.cloud.ces.v1beta.IConnectorTool|null} [connectorTool] Tool connectorTool - * @property {google.cloud.ces.v1beta.IDataStoreTool|null} [dataStoreTool] Tool dataStoreTool - * @property {google.cloud.ces.v1beta.IPythonFunction|null} [pythonFunction] Tool pythonFunction - * @property {google.cloud.ces.v1beta.IMcpTool|null} [mcpTool] Tool mcpTool - * @property {google.cloud.ces.v1beta.IFileSearchTool|null} [fileSearchTool] Tool fileSearchTool - * @property {google.cloud.ces.v1beta.ISystemTool|null} [systemTool] Tool systemTool - * @property {google.cloud.ces.v1beta.IWidgetTool|null} [widgetTool] Tool widgetTool - * @property {string|null} [name] Tool name - * @property {string|null} [displayName] Tool displayName - * @property {google.cloud.ces.v1beta.ExecutionType|null} [executionType] Tool executionType - * @property {google.protobuf.ITimestamp|null} [createTime] Tool createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Tool updateTime - * @property {string|null} [etag] Tool etag - * @property {string|null} [generatedSummary] Tool generatedSummary - * @property {google.cloud.ces.v1beta.IToolFakeConfig|null} [toolFakeConfig] Tool toolFakeConfig - */ - - /** - * Constructs a new Tool. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a Tool. - * @implements ITool - * @constructor - * @param {google.cloud.ces.v1beta.ITool=} [properties] Properties to set - */ - function Tool(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Tool clientFunction. - * @member {google.cloud.ces.v1beta.IClientFunction|null|undefined} clientFunction - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Tool.prototype.clientFunction = null; - - /** - * Tool openApiTool. - * @member {google.cloud.ces.v1beta.IOpenApiTool|null|undefined} openApiTool - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Tool.prototype.openApiTool = null; - - /** - * Tool googleSearchTool. - * @member {google.cloud.ces.v1beta.IGoogleSearchTool|null|undefined} googleSearchTool - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Tool.prototype.googleSearchTool = null; - - /** - * Tool connectorTool. - * @member {google.cloud.ces.v1beta.IConnectorTool|null|undefined} connectorTool - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Tool.prototype.connectorTool = null; - - /** - * Tool dataStoreTool. - * @member {google.cloud.ces.v1beta.IDataStoreTool|null|undefined} dataStoreTool - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Tool.prototype.dataStoreTool = null; - - /** - * Tool pythonFunction. - * @member {google.cloud.ces.v1beta.IPythonFunction|null|undefined} pythonFunction - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Tool.prototype.pythonFunction = null; - - /** - * Tool mcpTool. - * @member {google.cloud.ces.v1beta.IMcpTool|null|undefined} mcpTool - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Tool.prototype.mcpTool = null; - - /** - * Tool fileSearchTool. - * @member {google.cloud.ces.v1beta.IFileSearchTool|null|undefined} fileSearchTool - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Tool.prototype.fileSearchTool = null; - - /** - * Tool systemTool. - * @member {google.cloud.ces.v1beta.ISystemTool|null|undefined} systemTool - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Tool.prototype.systemTool = null; - - /** - * Tool widgetTool. - * @member {google.cloud.ces.v1beta.IWidgetTool|null|undefined} widgetTool - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Tool.prototype.widgetTool = null; - - /** - * Tool name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Tool.prototype.name = ""; - - /** - * Tool displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Tool.prototype.displayName = ""; - - /** - * Tool executionType. - * @member {google.cloud.ces.v1beta.ExecutionType} executionType - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Tool.prototype.executionType = 0; - - /** - * Tool createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Tool.prototype.createTime = null; - - /** - * Tool updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Tool.prototype.updateTime = null; - - /** - * Tool etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Tool.prototype.etag = ""; - - /** - * Tool generatedSummary. - * @member {string} generatedSummary - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Tool.prototype.generatedSummary = ""; - - /** - * Tool toolFakeConfig. - * @member {google.cloud.ces.v1beta.IToolFakeConfig|null|undefined} toolFakeConfig - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Tool.prototype.toolFakeConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Tool toolType. - * @member {"clientFunction"|"openApiTool"|"googleSearchTool"|"connectorTool"|"dataStoreTool"|"pythonFunction"|"mcpTool"|"fileSearchTool"|"systemTool"|"widgetTool"|undefined} toolType - * @memberof google.cloud.ces.v1beta.Tool - * @instance - */ - Object.defineProperty(Tool.prototype, "toolType", { - get: $util.oneOfGetter($oneOfFields = ["clientFunction", "openApiTool", "googleSearchTool", "connectorTool", "dataStoreTool", "pythonFunction", "mcpTool", "fileSearchTool", "systemTool", "widgetTool"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Tool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Tool - * @static - * @param {google.cloud.ces.v1beta.ITool=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Tool} Tool instance - */ - Tool.create = function create(properties) { - return new Tool(properties); - }; - - /** - * Encodes the specified Tool message. Does not implicitly {@link google.cloud.ces.v1beta.Tool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Tool - * @static - * @param {google.cloud.ces.v1beta.ITool} message Tool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Tool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.clientFunction != null && Object.hasOwnProperty.call(message, "clientFunction")) - $root.google.cloud.ces.v1beta.ClientFunction.encode(message.clientFunction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.openApiTool != null && Object.hasOwnProperty.call(message, "openApiTool")) - $root.google.cloud.ces.v1beta.OpenApiTool.encode(message.openApiTool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.googleSearchTool != null && Object.hasOwnProperty.call(message, "googleSearchTool")) - $root.google.cloud.ces.v1beta.GoogleSearchTool.encode(message.googleSearchTool, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.connectorTool != null && Object.hasOwnProperty.call(message, "connectorTool")) - $root.google.cloud.ces.v1beta.ConnectorTool.encode(message.connectorTool, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.dataStoreTool != null && Object.hasOwnProperty.call(message, "dataStoreTool")) - $root.google.cloud.ces.v1beta.DataStoreTool.encode(message.dataStoreTool, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.pythonFunction != null && Object.hasOwnProperty.call(message, "pythonFunction")) - $root.google.cloud.ces.v1beta.PythonFunction.encode(message.pythonFunction, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.executionType != null && Object.hasOwnProperty.call(message, "executionType")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.executionType); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.displayName); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); - if (message.generatedSummary != null && Object.hasOwnProperty.call(message, "generatedSummary")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.generatedSummary); - if (message.mcpTool != null && Object.hasOwnProperty.call(message, "mcpTool")) - $root.google.cloud.ces.v1beta.McpTool.encode(message.mcpTool, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.fileSearchTool != null && Object.hasOwnProperty.call(message, "fileSearchTool")) - $root.google.cloud.ces.v1beta.FileSearchTool.encode(message.fileSearchTool, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.systemTool != null && Object.hasOwnProperty.call(message, "systemTool")) - $root.google.cloud.ces.v1beta.SystemTool.encode(message.systemTool, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.toolFakeConfig != null && Object.hasOwnProperty.call(message, "toolFakeConfig")) - $root.google.cloud.ces.v1beta.ToolFakeConfig.encode(message.toolFakeConfig, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.widgetTool != null && Object.hasOwnProperty.call(message, "widgetTool")) - $root.google.cloud.ces.v1beta.WidgetTool.encode(message.widgetTool, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Tool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Tool - * @static - * @param {google.cloud.ces.v1beta.ITool} message Tool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Tool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Tool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Tool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Tool} Tool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Tool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Tool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.clientFunction = $root.google.cloud.ces.v1beta.ClientFunction.decode(reader, reader.uint32()); - break; - } - case 3: { - message.openApiTool = $root.google.cloud.ces.v1beta.OpenApiTool.decode(reader, reader.uint32()); - break; - } - case 5: { - message.googleSearchTool = $root.google.cloud.ces.v1beta.GoogleSearchTool.decode(reader, reader.uint32()); - break; - } - case 8: { - message.connectorTool = $root.google.cloud.ces.v1beta.ConnectorTool.decode(reader, reader.uint32()); - break; - } - case 10: { - message.dataStoreTool = $root.google.cloud.ces.v1beta.DataStoreTool.decode(reader, reader.uint32()); - break; - } - case 11: { - message.pythonFunction = $root.google.cloud.ces.v1beta.PythonFunction.decode(reader, reader.uint32()); - break; - } - case 16: { - message.mcpTool = $root.google.cloud.ces.v1beta.McpTool.decode(reader, reader.uint32()); - break; - } - case 17: { - message.fileSearchTool = $root.google.cloud.ces.v1beta.FileSearchTool.decode(reader, reader.uint32()); - break; - } - case 18: { - message.systemTool = $root.google.cloud.ces.v1beta.SystemTool.decode(reader, reader.uint32()); - break; - } - case 24: { - message.widgetTool = $root.google.cloud.ces.v1beta.WidgetTool.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 13: { - message.displayName = reader.string(); - break; - } - case 12: { - message.executionType = reader.int32(); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 14: { - message.etag = reader.string(); - break; - } - case 15: { - message.generatedSummary = reader.string(); - break; - } - case 20: { - message.toolFakeConfig = $root.google.cloud.ces.v1beta.ToolFakeConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Tool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Tool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Tool} Tool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Tool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Tool message. - * @function verify - * @memberof google.cloud.ces.v1beta.Tool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Tool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.clientFunction != null && message.hasOwnProperty("clientFunction")) { - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1beta.ClientFunction.verify(message.clientFunction); - if (error) - return "clientFunction." + error; - } - } - if (message.openApiTool != null && message.hasOwnProperty("openApiTool")) { - if (properties.toolType === 1) - return "toolType: multiple values"; - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1beta.OpenApiTool.verify(message.openApiTool); - if (error) - return "openApiTool." + error; - } - } - if (message.googleSearchTool != null && message.hasOwnProperty("googleSearchTool")) { - if (properties.toolType === 1) - return "toolType: multiple values"; - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1beta.GoogleSearchTool.verify(message.googleSearchTool); - if (error) - return "googleSearchTool." + error; - } - } - if (message.connectorTool != null && message.hasOwnProperty("connectorTool")) { - if (properties.toolType === 1) - return "toolType: multiple values"; - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1beta.ConnectorTool.verify(message.connectorTool); - if (error) - return "connectorTool." + error; - } - } - if (message.dataStoreTool != null && message.hasOwnProperty("dataStoreTool")) { - if (properties.toolType === 1) - return "toolType: multiple values"; - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1beta.DataStoreTool.verify(message.dataStoreTool); - if (error) - return "dataStoreTool." + error; - } - } - if (message.pythonFunction != null && message.hasOwnProperty("pythonFunction")) { - if (properties.toolType === 1) - return "toolType: multiple values"; - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1beta.PythonFunction.verify(message.pythonFunction); - if (error) - return "pythonFunction." + error; - } - } - if (message.mcpTool != null && message.hasOwnProperty("mcpTool")) { - if (properties.toolType === 1) - return "toolType: multiple values"; - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1beta.McpTool.verify(message.mcpTool); - if (error) - return "mcpTool." + error; - } - } - if (message.fileSearchTool != null && message.hasOwnProperty("fileSearchTool")) { - if (properties.toolType === 1) - return "toolType: multiple values"; - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1beta.FileSearchTool.verify(message.fileSearchTool); - if (error) - return "fileSearchTool." + error; - } - } - if (message.systemTool != null && message.hasOwnProperty("systemTool")) { - if (properties.toolType === 1) - return "toolType: multiple values"; - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1beta.SystemTool.verify(message.systemTool); - if (error) - return "systemTool." + error; - } - } - if (message.widgetTool != null && message.hasOwnProperty("widgetTool")) { - if (properties.toolType === 1) - return "toolType: multiple values"; - properties.toolType = 1; - { - var error = $root.google.cloud.ces.v1beta.WidgetTool.verify(message.widgetTool); - if (error) - return "widgetTool." + 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.executionType != null && message.hasOwnProperty("executionType")) - switch (message.executionType) { - default: - return "executionType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - 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.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) - if (!$util.isString(message.generatedSummary)) - return "generatedSummary: string expected"; - if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) { - var error = $root.google.cloud.ces.v1beta.ToolFakeConfig.verify(message.toolFakeConfig); - if (error) - return "toolFakeConfig." + error; - } - return null; - }; - - /** - * Creates a Tool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Tool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Tool} Tool - */ - Tool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Tool) - return object; - var message = new $root.google.cloud.ces.v1beta.Tool(); - if (object.clientFunction != null) { - if (typeof object.clientFunction !== "object") - throw TypeError(".google.cloud.ces.v1beta.Tool.clientFunction: object expected"); - message.clientFunction = $root.google.cloud.ces.v1beta.ClientFunction.fromObject(object.clientFunction); - } - if (object.openApiTool != null) { - if (typeof object.openApiTool !== "object") - throw TypeError(".google.cloud.ces.v1beta.Tool.openApiTool: object expected"); - message.openApiTool = $root.google.cloud.ces.v1beta.OpenApiTool.fromObject(object.openApiTool); - } - if (object.googleSearchTool != null) { - if (typeof object.googleSearchTool !== "object") - throw TypeError(".google.cloud.ces.v1beta.Tool.googleSearchTool: object expected"); - message.googleSearchTool = $root.google.cloud.ces.v1beta.GoogleSearchTool.fromObject(object.googleSearchTool); - } - if (object.connectorTool != null) { - if (typeof object.connectorTool !== "object") - throw TypeError(".google.cloud.ces.v1beta.Tool.connectorTool: object expected"); - message.connectorTool = $root.google.cloud.ces.v1beta.ConnectorTool.fromObject(object.connectorTool); - } - if (object.dataStoreTool != null) { - if (typeof object.dataStoreTool !== "object") - throw TypeError(".google.cloud.ces.v1beta.Tool.dataStoreTool: object expected"); - message.dataStoreTool = $root.google.cloud.ces.v1beta.DataStoreTool.fromObject(object.dataStoreTool); - } - if (object.pythonFunction != null) { - if (typeof object.pythonFunction !== "object") - throw TypeError(".google.cloud.ces.v1beta.Tool.pythonFunction: object expected"); - message.pythonFunction = $root.google.cloud.ces.v1beta.PythonFunction.fromObject(object.pythonFunction); - } - if (object.mcpTool != null) { - if (typeof object.mcpTool !== "object") - throw TypeError(".google.cloud.ces.v1beta.Tool.mcpTool: object expected"); - message.mcpTool = $root.google.cloud.ces.v1beta.McpTool.fromObject(object.mcpTool); - } - if (object.fileSearchTool != null) { - if (typeof object.fileSearchTool !== "object") - throw TypeError(".google.cloud.ces.v1beta.Tool.fileSearchTool: object expected"); - message.fileSearchTool = $root.google.cloud.ces.v1beta.FileSearchTool.fromObject(object.fileSearchTool); - } - if (object.systemTool != null) { - if (typeof object.systemTool !== "object") - throw TypeError(".google.cloud.ces.v1beta.Tool.systemTool: object expected"); - message.systemTool = $root.google.cloud.ces.v1beta.SystemTool.fromObject(object.systemTool); - } - if (object.widgetTool != null) { - if (typeof object.widgetTool !== "object") - throw TypeError(".google.cloud.ces.v1beta.Tool.widgetTool: object expected"); - message.widgetTool = $root.google.cloud.ces.v1beta.WidgetTool.fromObject(object.widgetTool); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - switch (object.executionType) { - default: - if (typeof object.executionType === "number") { - message.executionType = object.executionType; - break; - } - break; - case "EXECUTION_TYPE_UNSPECIFIED": - case 0: - message.executionType = 0; - break; - case "SYNCHRONOUS": - case 1: - message.executionType = 1; - break; - case "ASYNCHRONOUS": - case 2: - message.executionType = 2; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.Tool.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.ces.v1beta.Tool.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.generatedSummary != null) - message.generatedSummary = String(object.generatedSummary); - if (object.toolFakeConfig != null) { - if (typeof object.toolFakeConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.Tool.toolFakeConfig: object expected"); - message.toolFakeConfig = $root.google.cloud.ces.v1beta.ToolFakeConfig.fromObject(object.toolFakeConfig); - } - return message; - }; - - /** - * Creates a plain object from a Tool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Tool - * @static - * @param {google.cloud.ces.v1beta.Tool} message Tool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Tool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.updateTime = null; - object.executionType = options.enums === String ? "EXECUTION_TYPE_UNSPECIFIED" : 0; - object.displayName = ""; - object.etag = ""; - object.generatedSummary = ""; - object.toolFakeConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.clientFunction != null && message.hasOwnProperty("clientFunction")) { - object.clientFunction = $root.google.cloud.ces.v1beta.ClientFunction.toObject(message.clientFunction, options); - if (options.oneofs) - object.toolType = "clientFunction"; - } - if (message.openApiTool != null && message.hasOwnProperty("openApiTool")) { - object.openApiTool = $root.google.cloud.ces.v1beta.OpenApiTool.toObject(message.openApiTool, options); - if (options.oneofs) - object.toolType = "openApiTool"; - } - if (message.googleSearchTool != null && message.hasOwnProperty("googleSearchTool")) { - object.googleSearchTool = $root.google.cloud.ces.v1beta.GoogleSearchTool.toObject(message.googleSearchTool, options); - if (options.oneofs) - object.toolType = "googleSearchTool"; - } - 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.connectorTool != null && message.hasOwnProperty("connectorTool")) { - object.connectorTool = $root.google.cloud.ces.v1beta.ConnectorTool.toObject(message.connectorTool, options); - if (options.oneofs) - object.toolType = "connectorTool"; - } - if (message.dataStoreTool != null && message.hasOwnProperty("dataStoreTool")) { - object.dataStoreTool = $root.google.cloud.ces.v1beta.DataStoreTool.toObject(message.dataStoreTool, options); - if (options.oneofs) - object.toolType = "dataStoreTool"; - } - if (message.pythonFunction != null && message.hasOwnProperty("pythonFunction")) { - object.pythonFunction = $root.google.cloud.ces.v1beta.PythonFunction.toObject(message.pythonFunction, options); - if (options.oneofs) - object.toolType = "pythonFunction"; - } - if (message.executionType != null && message.hasOwnProperty("executionType")) - object.executionType = options.enums === String ? $root.google.cloud.ces.v1beta.ExecutionType[message.executionType] === undefined ? message.executionType : $root.google.cloud.ces.v1beta.ExecutionType[message.executionType] : message.executionType; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) - object.generatedSummary = message.generatedSummary; - if (message.mcpTool != null && message.hasOwnProperty("mcpTool")) { - object.mcpTool = $root.google.cloud.ces.v1beta.McpTool.toObject(message.mcpTool, options); - if (options.oneofs) - object.toolType = "mcpTool"; - } - if (message.fileSearchTool != null && message.hasOwnProperty("fileSearchTool")) { - object.fileSearchTool = $root.google.cloud.ces.v1beta.FileSearchTool.toObject(message.fileSearchTool, options); - if (options.oneofs) - object.toolType = "fileSearchTool"; - } - if (message.systemTool != null && message.hasOwnProperty("systemTool")) { - object.systemTool = $root.google.cloud.ces.v1beta.SystemTool.toObject(message.systemTool, options); - if (options.oneofs) - object.toolType = "systemTool"; - } - if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) - object.toolFakeConfig = $root.google.cloud.ces.v1beta.ToolFakeConfig.toObject(message.toolFakeConfig, options); - if (message.widgetTool != null && message.hasOwnProperty("widgetTool")) { - object.widgetTool = $root.google.cloud.ces.v1beta.WidgetTool.toObject(message.widgetTool, options); - if (options.oneofs) - object.toolType = "widgetTool"; - } - return object; - }; - - /** - * Converts this Tool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Tool - * @instance - * @returns {Object.} JSON object - */ - Tool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Tool - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Tool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Tool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Tool"; - }; - - return Tool; - })(); - - v1beta.ClientFunction = (function() { - - /** - * Properties of a ClientFunction. - * @memberof google.cloud.ces.v1beta - * @interface IClientFunction - * @property {string|null} [name] ClientFunction name - * @property {string|null} [description] ClientFunction description - * @property {google.cloud.ces.v1beta.ISchema|null} [parameters] ClientFunction parameters - * @property {google.cloud.ces.v1beta.ISchema|null} [response] ClientFunction response - */ - - /** - * Constructs a new ClientFunction. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ClientFunction. - * @implements IClientFunction - * @constructor - * @param {google.cloud.ces.v1beta.IClientFunction=} [properties] Properties to set - */ - function ClientFunction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientFunction name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.ClientFunction - * @instance - */ - ClientFunction.prototype.name = ""; - - /** - * ClientFunction description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.ClientFunction - * @instance - */ - ClientFunction.prototype.description = ""; - - /** - * ClientFunction parameters. - * @member {google.cloud.ces.v1beta.ISchema|null|undefined} parameters - * @memberof google.cloud.ces.v1beta.ClientFunction - * @instance - */ - ClientFunction.prototype.parameters = null; - - /** - * ClientFunction response. - * @member {google.cloud.ces.v1beta.ISchema|null|undefined} response - * @memberof google.cloud.ces.v1beta.ClientFunction - * @instance - */ - ClientFunction.prototype.response = null; - - /** - * Creates a new ClientFunction instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ClientFunction - * @static - * @param {google.cloud.ces.v1beta.IClientFunction=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ClientFunction} ClientFunction instance - */ - ClientFunction.create = function create(properties) { - return new ClientFunction(properties); - }; - - /** - * Encodes the specified ClientFunction message. Does not implicitly {@link google.cloud.ces.v1beta.ClientFunction.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ClientFunction - * @static - * @param {google.cloud.ces.v1beta.IClientFunction} message ClientFunction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientFunction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) - $root.google.cloud.ces.v1beta.Schema.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.cloud.ces.v1beta.Schema.encode(message.response, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ClientFunction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ClientFunction - * @static - * @param {google.cloud.ces.v1beta.IClientFunction} message ClientFunction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientFunction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientFunction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ClientFunction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ClientFunction} ClientFunction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientFunction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ClientFunction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - message.parameters = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); - break; - } - case 4: { - message.response = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientFunction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ClientFunction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ClientFunction} ClientFunction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientFunction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientFunction message. - * @function verify - * @memberof google.cloud.ces.v1beta.ClientFunction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientFunction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.parameters != null && message.hasOwnProperty("parameters")) { - var error = $root.google.cloud.ces.v1beta.Schema.verify(message.parameters); - if (error) - return "parameters." + error; - } - if (message.response != null && message.hasOwnProperty("response")) { - var error = $root.google.cloud.ces.v1beta.Schema.verify(message.response); - if (error) - return "response." + error; - } - return null; - }; - - /** - * Creates a ClientFunction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ClientFunction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ClientFunction} ClientFunction - */ - ClientFunction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ClientFunction) - return object; - var message = new $root.google.cloud.ces.v1beta.ClientFunction(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.parameters != null) { - if (typeof object.parameters !== "object") - throw TypeError(".google.cloud.ces.v1beta.ClientFunction.parameters: object expected"); - message.parameters = $root.google.cloud.ces.v1beta.Schema.fromObject(object.parameters); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.cloud.ces.v1beta.ClientFunction.response: object expected"); - message.response = $root.google.cloud.ces.v1beta.Schema.fromObject(object.response); - } - return message; - }; - - /** - * Creates a plain object from a ClientFunction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ClientFunction - * @static - * @param {google.cloud.ces.v1beta.ClientFunction} message ClientFunction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientFunction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.parameters = null; - object.response = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.parameters != null && message.hasOwnProperty("parameters")) - object.parameters = $root.google.cloud.ces.v1beta.Schema.toObject(message.parameters, options); - if (message.response != null && message.hasOwnProperty("response")) - object.response = $root.google.cloud.ces.v1beta.Schema.toObject(message.response, options); - return object; - }; - - /** - * Converts this ClientFunction to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ClientFunction - * @instance - * @returns {Object.} JSON object - */ - ClientFunction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientFunction - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ClientFunction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientFunction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ClientFunction"; - }; - - return ClientFunction; - })(); - - v1beta.Action = (function() { - - /** - * Properties of an Action. - * @memberof google.cloud.ces.v1beta - * @interface IAction - * @property {string|null} [connectionActionId] Action connectionActionId - * @property {google.cloud.ces.v1beta.Action.IEntityOperation|null} [entityOperation] Action entityOperation - * @property {Array.|null} [inputFields] Action inputFields - * @property {Array.|null} [outputFields] Action outputFields - */ - - /** - * Constructs a new Action. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an Action. - * @implements IAction - * @constructor - * @param {google.cloud.ces.v1beta.IAction=} [properties] Properties to set - */ - function Action(properties) { - this.inputFields = []; - this.outputFields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Action connectionActionId. - * @member {string|null|undefined} connectionActionId - * @memberof google.cloud.ces.v1beta.Action - * @instance - */ - Action.prototype.connectionActionId = null; - - /** - * Action entityOperation. - * @member {google.cloud.ces.v1beta.Action.IEntityOperation|null|undefined} entityOperation - * @memberof google.cloud.ces.v1beta.Action - * @instance - */ - Action.prototype.entityOperation = null; - - /** - * Action inputFields. - * @member {Array.} inputFields - * @memberof google.cloud.ces.v1beta.Action - * @instance - */ - Action.prototype.inputFields = $util.emptyArray; - - /** - * Action outputFields. - * @member {Array.} outputFields - * @memberof google.cloud.ces.v1beta.Action - * @instance - */ - Action.prototype.outputFields = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Action actionSpec. - * @member {"connectionActionId"|"entityOperation"|undefined} actionSpec - * @memberof google.cloud.ces.v1beta.Action - * @instance - */ - Object.defineProperty(Action.prototype, "actionSpec", { - get: $util.oneOfGetter($oneOfFields = ["connectionActionId", "entityOperation"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Action instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Action - * @static - * @param {google.cloud.ces.v1beta.IAction=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Action} Action instance - */ - Action.create = function create(properties) { - return new Action(properties); - }; - - /** - * Encodes the specified Action message. Does not implicitly {@link google.cloud.ces.v1beta.Action.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Action - * @static - * @param {google.cloud.ces.v1beta.IAction} message Action message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Action.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputFields != null && message.inputFields.length) - for (var i = 0; i < message.inputFields.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputFields[i]); - if (message.outputFields != null && message.outputFields.length) - for (var i = 0; i < message.outputFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputFields[i]); - if (message.connectionActionId != null && Object.hasOwnProperty.call(message, "connectionActionId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.connectionActionId); - if (message.entityOperation != null && Object.hasOwnProperty.call(message, "entityOperation")) - $root.google.cloud.ces.v1beta.Action.EntityOperation.encode(message.entityOperation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Action.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Action - * @static - * @param {google.cloud.ces.v1beta.IAction} message Action message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Action.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Action message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Action - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Action} Action - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Action.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Action(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.connectionActionId = reader.string(); - break; - } - case 5: { - message.entityOperation = $root.google.cloud.ces.v1beta.Action.EntityOperation.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.inputFields && message.inputFields.length)) - message.inputFields = []; - message.inputFields.push(reader.string()); - break; - } - case 3: { - if (!(message.outputFields && message.outputFields.length)) - message.outputFields = []; - message.outputFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Action message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Action - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Action} Action - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Action.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Action message. - * @function verify - * @memberof google.cloud.ces.v1beta.Action - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Action.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.connectionActionId != null && message.hasOwnProperty("connectionActionId")) { - properties.actionSpec = 1; - if (!$util.isString(message.connectionActionId)) - return "connectionActionId: string expected"; - } - if (message.entityOperation != null && message.hasOwnProperty("entityOperation")) { - if (properties.actionSpec === 1) - return "actionSpec: multiple values"; - properties.actionSpec = 1; - { - var error = $root.google.cloud.ces.v1beta.Action.EntityOperation.verify(message.entityOperation); - if (error) - return "entityOperation." + error; - } - } - if (message.inputFields != null && message.hasOwnProperty("inputFields")) { - if (!Array.isArray(message.inputFields)) - return "inputFields: array expected"; - for (var i = 0; i < message.inputFields.length; ++i) - if (!$util.isString(message.inputFields[i])) - return "inputFields: string[] expected"; - } - if (message.outputFields != null && message.hasOwnProperty("outputFields")) { - if (!Array.isArray(message.outputFields)) - return "outputFields: array expected"; - for (var i = 0; i < message.outputFields.length; ++i) - if (!$util.isString(message.outputFields[i])) - return "outputFields: string[] expected"; - } - return null; - }; - - /** - * Creates an Action message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Action - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Action} Action - */ - Action.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Action) - return object; - var message = new $root.google.cloud.ces.v1beta.Action(); - if (object.connectionActionId != null) - message.connectionActionId = String(object.connectionActionId); - if (object.entityOperation != null) { - if (typeof object.entityOperation !== "object") - throw TypeError(".google.cloud.ces.v1beta.Action.entityOperation: object expected"); - message.entityOperation = $root.google.cloud.ces.v1beta.Action.EntityOperation.fromObject(object.entityOperation); - } - if (object.inputFields) { - if (!Array.isArray(object.inputFields)) - throw TypeError(".google.cloud.ces.v1beta.Action.inputFields: array expected"); - message.inputFields = []; - for (var i = 0; i < object.inputFields.length; ++i) - message.inputFields[i] = String(object.inputFields[i]); - } - if (object.outputFields) { - if (!Array.isArray(object.outputFields)) - throw TypeError(".google.cloud.ces.v1beta.Action.outputFields: array expected"); - message.outputFields = []; - for (var i = 0; i < object.outputFields.length; ++i) - message.outputFields[i] = String(object.outputFields[i]); - } - return message; - }; - - /** - * Creates a plain object from an Action message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Action - * @static - * @param {google.cloud.ces.v1beta.Action} message Action - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Action.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.inputFields = []; - object.outputFields = []; - } - if (message.inputFields && message.inputFields.length) { - object.inputFields = []; - for (var j = 0; j < message.inputFields.length; ++j) - object.inputFields[j] = message.inputFields[j]; - } - if (message.outputFields && message.outputFields.length) { - object.outputFields = []; - for (var j = 0; j < message.outputFields.length; ++j) - object.outputFields[j] = message.outputFields[j]; - } - if (message.connectionActionId != null && message.hasOwnProperty("connectionActionId")) { - object.connectionActionId = message.connectionActionId; - if (options.oneofs) - object.actionSpec = "connectionActionId"; - } - if (message.entityOperation != null && message.hasOwnProperty("entityOperation")) { - object.entityOperation = $root.google.cloud.ces.v1beta.Action.EntityOperation.toObject(message.entityOperation, options); - if (options.oneofs) - object.actionSpec = "entityOperation"; - } - return object; - }; - - /** - * Converts this Action to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Action - * @instance - * @returns {Object.} JSON object - */ - Action.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Action - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Action - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Action.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Action"; - }; - - Action.EntityOperation = (function() { - - /** - * Properties of an EntityOperation. - * @memberof google.cloud.ces.v1beta.Action - * @interface IEntityOperation - * @property {string|null} [entityId] EntityOperation entityId - * @property {google.cloud.ces.v1beta.Action.EntityOperation.OperationType|null} [operation] EntityOperation operation - */ - - /** - * Constructs a new EntityOperation. - * @memberof google.cloud.ces.v1beta.Action - * @classdesc Represents an EntityOperation. - * @implements IEntityOperation - * @constructor - * @param {google.cloud.ces.v1beta.Action.IEntityOperation=} [properties] Properties to set - */ - function EntityOperation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EntityOperation entityId. - * @member {string} entityId - * @memberof google.cloud.ces.v1beta.Action.EntityOperation - * @instance - */ - EntityOperation.prototype.entityId = ""; - - /** - * EntityOperation operation. - * @member {google.cloud.ces.v1beta.Action.EntityOperation.OperationType} operation - * @memberof google.cloud.ces.v1beta.Action.EntityOperation - * @instance - */ - EntityOperation.prototype.operation = 0; - - /** - * Creates a new EntityOperation instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Action.EntityOperation - * @static - * @param {google.cloud.ces.v1beta.Action.IEntityOperation=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Action.EntityOperation} EntityOperation instance - */ - EntityOperation.create = function create(properties) { - return new EntityOperation(properties); - }; - - /** - * Encodes the specified EntityOperation message. Does not implicitly {@link google.cloud.ces.v1beta.Action.EntityOperation.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Action.EntityOperation - * @static - * @param {google.cloud.ces.v1beta.Action.IEntityOperation} message EntityOperation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityOperation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityId); - if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.operation); - return writer; - }; - - /** - * Encodes the specified EntityOperation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Action.EntityOperation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Action.EntityOperation - * @static - * @param {google.cloud.ces.v1beta.Action.IEntityOperation} message EntityOperation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityOperation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EntityOperation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Action.EntityOperation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Action.EntityOperation} EntityOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityOperation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Action.EntityOperation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.entityId = reader.string(); - break; - } - case 2: { - message.operation = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EntityOperation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Action.EntityOperation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Action.EntityOperation} EntityOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityOperation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EntityOperation message. - * @function verify - * @memberof google.cloud.ces.v1beta.Action.EntityOperation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EntityOperation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.entityId != null && message.hasOwnProperty("entityId")) - if (!$util.isString(message.entityId)) - return "entityId: string expected"; - if (message.operation != null && message.hasOwnProperty("operation")) - switch (message.operation) { - default: - return "operation: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - return null; - }; - - /** - * Creates an EntityOperation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Action.EntityOperation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Action.EntityOperation} EntityOperation - */ - EntityOperation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Action.EntityOperation) - return object; - var message = new $root.google.cloud.ces.v1beta.Action.EntityOperation(); - if (object.entityId != null) - message.entityId = String(object.entityId); - switch (object.operation) { - default: - if (typeof object.operation === "number") { - message.operation = object.operation; - break; - } - break; - case "OPERATION_TYPE_UNSPECIFIED": - case 0: - message.operation = 0; - break; - case "LIST": - case 1: - message.operation = 1; - break; - case "GET": - case 2: - message.operation = 2; - break; - case "CREATE": - case 3: - message.operation = 3; - break; - case "UPDATE": - case 4: - message.operation = 4; - break; - case "DELETE": - case 5: - message.operation = 5; - break; - } - return message; - }; - - /** - * Creates a plain object from an EntityOperation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Action.EntityOperation - * @static - * @param {google.cloud.ces.v1beta.Action.EntityOperation} message EntityOperation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EntityOperation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.entityId = ""; - object.operation = options.enums === String ? "OPERATION_TYPE_UNSPECIFIED" : 0; - } - if (message.entityId != null && message.hasOwnProperty("entityId")) - object.entityId = message.entityId; - if (message.operation != null && message.hasOwnProperty("operation")) - object.operation = options.enums === String ? $root.google.cloud.ces.v1beta.Action.EntityOperation.OperationType[message.operation] === undefined ? message.operation : $root.google.cloud.ces.v1beta.Action.EntityOperation.OperationType[message.operation] : message.operation; - return object; - }; - - /** - * Converts this EntityOperation to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Action.EntityOperation - * @instance - * @returns {Object.} JSON object - */ - EntityOperation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EntityOperation - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Action.EntityOperation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EntityOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Action.EntityOperation"; - }; - - /** - * OperationType enum. - * @name google.cloud.ces.v1beta.Action.EntityOperation.OperationType - * @enum {number} - * @property {number} OPERATION_TYPE_UNSPECIFIED=0 OPERATION_TYPE_UNSPECIFIED value - * @property {number} LIST=1 LIST value - * @property {number} GET=2 GET value - * @property {number} CREATE=3 CREATE value - * @property {number} UPDATE=4 UPDATE value - * @property {number} DELETE=5 DELETE value - */ - EntityOperation.OperationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OPERATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "LIST"] = 1; - values[valuesById[2] = "GET"] = 2; - values[valuesById[3] = "CREATE"] = 3; - values[valuesById[4] = "UPDATE"] = 4; - values[valuesById[5] = "DELETE"] = 5; - return values; - })(); - - return EntityOperation; - })(); - - return Action; - })(); - - v1beta.ConnectorTool = (function() { - - /** - * Properties of a ConnectorTool. - * @memberof google.cloud.ces.v1beta - * @interface IConnectorTool - * @property {string|null} [connection] ConnectorTool connection - * @property {google.cloud.ces.v1beta.IAction|null} [action] ConnectorTool action - * @property {google.cloud.ces.v1beta.IEndUserAuthConfig|null} [authConfig] ConnectorTool authConfig - * @property {string|null} [name] ConnectorTool name - * @property {string|null} [description] ConnectorTool description - */ - - /** - * Constructs a new ConnectorTool. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ConnectorTool. - * @implements IConnectorTool - * @constructor - * @param {google.cloud.ces.v1beta.IConnectorTool=} [properties] Properties to set - */ - function ConnectorTool(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectorTool connection. - * @member {string} connection - * @memberof google.cloud.ces.v1beta.ConnectorTool - * @instance - */ - ConnectorTool.prototype.connection = ""; - - /** - * ConnectorTool action. - * @member {google.cloud.ces.v1beta.IAction|null|undefined} action - * @memberof google.cloud.ces.v1beta.ConnectorTool - * @instance - */ - ConnectorTool.prototype.action = null; - - /** - * ConnectorTool authConfig. - * @member {google.cloud.ces.v1beta.IEndUserAuthConfig|null|undefined} authConfig - * @memberof google.cloud.ces.v1beta.ConnectorTool - * @instance - */ - ConnectorTool.prototype.authConfig = null; - - /** - * ConnectorTool name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.ConnectorTool - * @instance - */ - ConnectorTool.prototype.name = ""; - - /** - * ConnectorTool description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.ConnectorTool - * @instance - */ - ConnectorTool.prototype.description = ""; - - /** - * Creates a new ConnectorTool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ConnectorTool - * @static - * @param {google.cloud.ces.v1beta.IConnectorTool=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ConnectorTool} ConnectorTool instance - */ - ConnectorTool.create = function create(properties) { - return new ConnectorTool(properties); - }; - - /** - * Encodes the specified ConnectorTool message. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorTool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ConnectorTool - * @static - * @param {google.cloud.ces.v1beta.IConnectorTool} message ConnectorTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectorTool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - $root.google.cloud.ces.v1beta.Action.encode(message.action, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.authConfig != null && Object.hasOwnProperty.call(message, "authConfig")) - $root.google.cloud.ces.v1beta.EndUserAuthConfig.encode(message.authConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); - return writer; - }; - - /** - * Encodes the specified ConnectorTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorTool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ConnectorTool - * @static - * @param {google.cloud.ces.v1beta.IConnectorTool} message ConnectorTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectorTool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectorTool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ConnectorTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ConnectorTool} ConnectorTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectorTool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ConnectorTool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.connection = reader.string(); - break; - } - case 2: { - message.action = $root.google.cloud.ces.v1beta.Action.decode(reader, reader.uint32()); - break; - } - case 3: { - message.authConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.name = reader.string(); - break; - } - case 5: { - message.description = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectorTool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ConnectorTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ConnectorTool} ConnectorTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectorTool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectorTool message. - * @function verify - * @memberof google.cloud.ces.v1beta.ConnectorTool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectorTool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection != null && message.hasOwnProperty("connection")) - if (!$util.isString(message.connection)) - return "connection: string expected"; - if (message.action != null && message.hasOwnProperty("action")) { - var error = $root.google.cloud.ces.v1beta.Action.verify(message.action); - if (error) - return "action." + error; - } - if (message.authConfig != null && message.hasOwnProperty("authConfig")) { - var error = $root.google.cloud.ces.v1beta.EndUserAuthConfig.verify(message.authConfig); - if (error) - return "authConfig." + error; - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates a ConnectorTool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ConnectorTool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ConnectorTool} ConnectorTool - */ - ConnectorTool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ConnectorTool) - return object; - var message = new $root.google.cloud.ces.v1beta.ConnectorTool(); - if (object.connection != null) - message.connection = String(object.connection); - if (object.action != null) { - if (typeof object.action !== "object") - throw TypeError(".google.cloud.ces.v1beta.ConnectorTool.action: object expected"); - message.action = $root.google.cloud.ces.v1beta.Action.fromObject(object.action); - } - if (object.authConfig != null) { - if (typeof object.authConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.ConnectorTool.authConfig: object expected"); - message.authConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.fromObject(object.authConfig); - } - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from a ConnectorTool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ConnectorTool - * @static - * @param {google.cloud.ces.v1beta.ConnectorTool} message ConnectorTool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectorTool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.connection = ""; - object.action = null; - object.authConfig = null; - object.name = ""; - object.description = ""; - } - if (message.connection != null && message.hasOwnProperty("connection")) - object.connection = message.connection; - if (message.action != null && message.hasOwnProperty("action")) - object.action = $root.google.cloud.ces.v1beta.Action.toObject(message.action, options); - if (message.authConfig != null && message.hasOwnProperty("authConfig")) - object.authConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.toObject(message.authConfig, options); - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this ConnectorTool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ConnectorTool - * @instance - * @returns {Object.} JSON object - */ - ConnectorTool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConnectorTool - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ConnectorTool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConnectorTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ConnectorTool"; - }; - - return ConnectorTool; - })(); - - v1beta.ApiKeyConfig = (function() { - - /** - * Properties of an ApiKeyConfig. - * @memberof google.cloud.ces.v1beta - * @interface IApiKeyConfig - * @property {string|null} [keyName] ApiKeyConfig keyName - * @property {string|null} [apiKeySecretVersion] ApiKeyConfig apiKeySecretVersion - * @property {google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation|null} [requestLocation] ApiKeyConfig requestLocation - */ - - /** - * Constructs a new ApiKeyConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an ApiKeyConfig. - * @implements IApiKeyConfig - * @constructor - * @param {google.cloud.ces.v1beta.IApiKeyConfig=} [properties] Properties to set - */ - function ApiKeyConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ApiKeyConfig keyName. - * @member {string} keyName - * @memberof google.cloud.ces.v1beta.ApiKeyConfig - * @instance - */ - ApiKeyConfig.prototype.keyName = ""; - - /** - * ApiKeyConfig apiKeySecretVersion. - * @member {string} apiKeySecretVersion - * @memberof google.cloud.ces.v1beta.ApiKeyConfig - * @instance - */ - ApiKeyConfig.prototype.apiKeySecretVersion = ""; - - /** - * ApiKeyConfig requestLocation. - * @member {google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation} requestLocation - * @memberof google.cloud.ces.v1beta.ApiKeyConfig - * @instance - */ - ApiKeyConfig.prototype.requestLocation = 0; - - /** - * Creates a new ApiKeyConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ApiKeyConfig - * @static - * @param {google.cloud.ces.v1beta.IApiKeyConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ApiKeyConfig} ApiKeyConfig instance - */ - ApiKeyConfig.create = function create(properties) { - return new ApiKeyConfig(properties); - }; - - /** - * Encodes the specified ApiKeyConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ApiKeyConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ApiKeyConfig - * @static - * @param {google.cloud.ces.v1beta.IApiKeyConfig} message ApiKeyConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ApiKeyConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keyName != null && Object.hasOwnProperty.call(message, "keyName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyName); - if (message.apiKeySecretVersion != null && Object.hasOwnProperty.call(message, "apiKeySecretVersion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.apiKeySecretVersion); - if (message.requestLocation != null && Object.hasOwnProperty.call(message, "requestLocation")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.requestLocation); - return writer; - }; - - /** - * Encodes the specified ApiKeyConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ApiKeyConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ApiKeyConfig - * @static - * @param {google.cloud.ces.v1beta.IApiKeyConfig} message ApiKeyConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ApiKeyConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ApiKeyConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ApiKeyConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ApiKeyConfig} ApiKeyConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ApiKeyConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ApiKeyConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.keyName = reader.string(); - break; - } - case 2: { - message.apiKeySecretVersion = reader.string(); - break; - } - case 3: { - message.requestLocation = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ApiKeyConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ApiKeyConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ApiKeyConfig} ApiKeyConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ApiKeyConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ApiKeyConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.ApiKeyConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ApiKeyConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keyName != null && message.hasOwnProperty("keyName")) - if (!$util.isString(message.keyName)) - return "keyName: string expected"; - if (message.apiKeySecretVersion != null && message.hasOwnProperty("apiKeySecretVersion")) - if (!$util.isString(message.apiKeySecretVersion)) - return "apiKeySecretVersion: string expected"; - if (message.requestLocation != null && message.hasOwnProperty("requestLocation")) - switch (message.requestLocation) { - default: - return "requestLocation: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an ApiKeyConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ApiKeyConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ApiKeyConfig} ApiKeyConfig - */ - ApiKeyConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ApiKeyConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.ApiKeyConfig(); - if (object.keyName != null) - message.keyName = String(object.keyName); - if (object.apiKeySecretVersion != null) - message.apiKeySecretVersion = String(object.apiKeySecretVersion); - switch (object.requestLocation) { - default: - if (typeof object.requestLocation === "number") { - message.requestLocation = object.requestLocation; - break; - } - break; - case "REQUEST_LOCATION_UNSPECIFIED": - case 0: - message.requestLocation = 0; - break; - case "HEADER": - case 1: - message.requestLocation = 1; - break; - case "QUERY_STRING": - case 2: - message.requestLocation = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an ApiKeyConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ApiKeyConfig - * @static - * @param {google.cloud.ces.v1beta.ApiKeyConfig} message ApiKeyConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ApiKeyConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.keyName = ""; - object.apiKeySecretVersion = ""; - object.requestLocation = options.enums === String ? "REQUEST_LOCATION_UNSPECIFIED" : 0; - } - if (message.keyName != null && message.hasOwnProperty("keyName")) - object.keyName = message.keyName; - if (message.apiKeySecretVersion != null && message.hasOwnProperty("apiKeySecretVersion")) - object.apiKeySecretVersion = message.apiKeySecretVersion; - if (message.requestLocation != null && message.hasOwnProperty("requestLocation")) - object.requestLocation = options.enums === String ? $root.google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation[message.requestLocation] === undefined ? message.requestLocation : $root.google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation[message.requestLocation] : message.requestLocation; - return object; - }; - - /** - * Converts this ApiKeyConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ApiKeyConfig - * @instance - * @returns {Object.} JSON object - */ - ApiKeyConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ApiKeyConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ApiKeyConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ApiKeyConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ApiKeyConfig"; - }; - - /** - * RequestLocation enum. - * @name google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation - * @enum {number} - * @property {number} REQUEST_LOCATION_UNSPECIFIED=0 REQUEST_LOCATION_UNSPECIFIED value - * @property {number} HEADER=1 HEADER value - * @property {number} QUERY_STRING=2 QUERY_STRING value - */ - ApiKeyConfig.RequestLocation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REQUEST_LOCATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "HEADER"] = 1; - values[valuesById[2] = "QUERY_STRING"] = 2; - return values; - })(); - - return ApiKeyConfig; - })(); - - v1beta.OAuthConfig = (function() { - - /** - * Properties of a OAuthConfig. - * @memberof google.cloud.ces.v1beta - * @interface IOAuthConfig - * @property {google.cloud.ces.v1beta.OAuthConfig.OauthGrantType|null} [oauthGrantType] OAuthConfig oauthGrantType - * @property {string|null} [clientId] OAuthConfig clientId - * @property {string|null} [clientSecretVersion] OAuthConfig clientSecretVersion - * @property {string|null} [tokenEndpoint] OAuthConfig tokenEndpoint - * @property {Array.|null} [scopes] OAuthConfig scopes - */ - - /** - * Constructs a new OAuthConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a OAuthConfig. - * @implements IOAuthConfig - * @constructor - * @param {google.cloud.ces.v1beta.IOAuthConfig=} [properties] Properties to set - */ - function OAuthConfig(properties) { - this.scopes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OAuthConfig oauthGrantType. - * @member {google.cloud.ces.v1beta.OAuthConfig.OauthGrantType} oauthGrantType - * @memberof google.cloud.ces.v1beta.OAuthConfig - * @instance - */ - OAuthConfig.prototype.oauthGrantType = 0; - - /** - * OAuthConfig clientId. - * @member {string} clientId - * @memberof google.cloud.ces.v1beta.OAuthConfig - * @instance - */ - OAuthConfig.prototype.clientId = ""; - - /** - * OAuthConfig clientSecretVersion. - * @member {string} clientSecretVersion - * @memberof google.cloud.ces.v1beta.OAuthConfig - * @instance - */ - OAuthConfig.prototype.clientSecretVersion = ""; - - /** - * OAuthConfig tokenEndpoint. - * @member {string} tokenEndpoint - * @memberof google.cloud.ces.v1beta.OAuthConfig - * @instance - */ - OAuthConfig.prototype.tokenEndpoint = ""; - - /** - * OAuthConfig scopes. - * @member {Array.} scopes - * @memberof google.cloud.ces.v1beta.OAuthConfig - * @instance - */ - OAuthConfig.prototype.scopes = $util.emptyArray; - - /** - * Creates a new OAuthConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.OAuthConfig - * @static - * @param {google.cloud.ces.v1beta.IOAuthConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.OAuthConfig} OAuthConfig instance - */ - OAuthConfig.create = function create(properties) { - return new OAuthConfig(properties); - }; - - /** - * Encodes the specified OAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OAuthConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.OAuthConfig - * @static - * @param {google.cloud.ces.v1beta.IOAuthConfig} message OAuthConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OAuthConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.oauthGrantType != null && Object.hasOwnProperty.call(message, "oauthGrantType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.oauthGrantType); - if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientId); - if (message.clientSecretVersion != null && Object.hasOwnProperty.call(message, "clientSecretVersion")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientSecretVersion); - if (message.tokenEndpoint != null && Object.hasOwnProperty.call(message, "tokenEndpoint")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.tokenEndpoint); - if (message.scopes != null && message.scopes.length) - for (var i = 0; i < message.scopes.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.scopes[i]); - return writer; - }; - - /** - * Encodes the specified OAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OAuthConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.OAuthConfig - * @static - * @param {google.cloud.ces.v1beta.IOAuthConfig} message OAuthConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a OAuthConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.OAuthConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.OAuthConfig} OAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OAuthConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OAuthConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.oauthGrantType = reader.int32(); - break; - } - case 2: { - message.clientId = reader.string(); - break; - } - case 3: { - message.clientSecretVersion = reader.string(); - break; - } - case 4: { - message.tokenEndpoint = reader.string(); - break; - } - case 5: { - if (!(message.scopes && message.scopes.length)) - message.scopes = []; - message.scopes.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a OAuthConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.OAuthConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.OAuthConfig} OAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OAuthConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a OAuthConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.OAuthConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OAuthConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.oauthGrantType != null && message.hasOwnProperty("oauthGrantType")) - switch (message.oauthGrantType) { - default: - return "oauthGrantType: enum value expected"; - case 0: - case 1: - break; - } - if (message.clientId != null && message.hasOwnProperty("clientId")) - if (!$util.isString(message.clientId)) - return "clientId: string expected"; - if (message.clientSecretVersion != null && message.hasOwnProperty("clientSecretVersion")) - if (!$util.isString(message.clientSecretVersion)) - return "clientSecretVersion: string expected"; - if (message.tokenEndpoint != null && message.hasOwnProperty("tokenEndpoint")) - if (!$util.isString(message.tokenEndpoint)) - return "tokenEndpoint: string expected"; - if (message.scopes != null && message.hasOwnProperty("scopes")) { - if (!Array.isArray(message.scopes)) - return "scopes: array expected"; - for (var i = 0; i < message.scopes.length; ++i) - if (!$util.isString(message.scopes[i])) - return "scopes: string[] expected"; - } - return null; - }; - - /** - * Creates a OAuthConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.OAuthConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.OAuthConfig} OAuthConfig - */ - OAuthConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.OAuthConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.OAuthConfig(); - switch (object.oauthGrantType) { - default: - if (typeof object.oauthGrantType === "number") { - message.oauthGrantType = object.oauthGrantType; - break; - } - break; - case "OAUTH_GRANT_TYPE_UNSPECIFIED": - case 0: - message.oauthGrantType = 0; - break; - case "CLIENT_CREDENTIAL": - case 1: - message.oauthGrantType = 1; - break; - } - if (object.clientId != null) - message.clientId = String(object.clientId); - if (object.clientSecretVersion != null) - message.clientSecretVersion = String(object.clientSecretVersion); - if (object.tokenEndpoint != null) - message.tokenEndpoint = String(object.tokenEndpoint); - if (object.scopes) { - if (!Array.isArray(object.scopes)) - throw TypeError(".google.cloud.ces.v1beta.OAuthConfig.scopes: array expected"); - message.scopes = []; - for (var i = 0; i < object.scopes.length; ++i) - message.scopes[i] = String(object.scopes[i]); - } - return message; - }; - - /** - * Creates a plain object from a OAuthConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.OAuthConfig - * @static - * @param {google.cloud.ces.v1beta.OAuthConfig} message OAuthConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OAuthConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.scopes = []; - if (options.defaults) { - object.oauthGrantType = options.enums === String ? "OAUTH_GRANT_TYPE_UNSPECIFIED" : 0; - object.clientId = ""; - object.clientSecretVersion = ""; - object.tokenEndpoint = ""; - } - if (message.oauthGrantType != null && message.hasOwnProperty("oauthGrantType")) - object.oauthGrantType = options.enums === String ? $root.google.cloud.ces.v1beta.OAuthConfig.OauthGrantType[message.oauthGrantType] === undefined ? message.oauthGrantType : $root.google.cloud.ces.v1beta.OAuthConfig.OauthGrantType[message.oauthGrantType] : message.oauthGrantType; - if (message.clientId != null && message.hasOwnProperty("clientId")) - object.clientId = message.clientId; - if (message.clientSecretVersion != null && message.hasOwnProperty("clientSecretVersion")) - object.clientSecretVersion = message.clientSecretVersion; - if (message.tokenEndpoint != null && message.hasOwnProperty("tokenEndpoint")) - object.tokenEndpoint = message.tokenEndpoint; - if (message.scopes && message.scopes.length) { - object.scopes = []; - for (var j = 0; j < message.scopes.length; ++j) - object.scopes[j] = message.scopes[j]; - } - return object; - }; - - /** - * Converts this OAuthConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.OAuthConfig - * @instance - * @returns {Object.} JSON object - */ - OAuthConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OAuthConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.OAuthConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.OAuthConfig"; - }; - - /** - * OauthGrantType enum. - * @name google.cloud.ces.v1beta.OAuthConfig.OauthGrantType - * @enum {number} - * @property {number} OAUTH_GRANT_TYPE_UNSPECIFIED=0 OAUTH_GRANT_TYPE_UNSPECIFIED value - * @property {number} CLIENT_CREDENTIAL=1 CLIENT_CREDENTIAL value - */ - OAuthConfig.OauthGrantType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OAUTH_GRANT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLIENT_CREDENTIAL"] = 1; - return values; - })(); - - return OAuthConfig; - })(); - - v1beta.ServiceAgentIdTokenAuthConfig = (function() { - - /** - * Properties of a ServiceAgentIdTokenAuthConfig. - * @memberof google.cloud.ces.v1beta - * @interface IServiceAgentIdTokenAuthConfig - */ - - /** - * Constructs a new ServiceAgentIdTokenAuthConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ServiceAgentIdTokenAuthConfig. - * @implements IServiceAgentIdTokenAuthConfig - * @constructor - * @param {google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig=} [properties] Properties to set - */ - function ServiceAgentIdTokenAuthConfig(properties) { - if (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 ServiceAgentIdTokenAuthConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig - * @static - * @param {google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig instance - */ - ServiceAgentIdTokenAuthConfig.create = function create(properties) { - return new ServiceAgentIdTokenAuthConfig(properties); - }; - - /** - * Encodes the specified ServiceAgentIdTokenAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig - * @static - * @param {google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig} message ServiceAgentIdTokenAuthConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceAgentIdTokenAuthConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified ServiceAgentIdTokenAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig - * @static - * @param {google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig} message ServiceAgentIdTokenAuthConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceAgentIdTokenAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceAgentIdTokenAuthConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceAgentIdTokenAuthConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceAgentIdTokenAuthConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceAgentIdTokenAuthConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a ServiceAgentIdTokenAuthConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig - */ - ServiceAgentIdTokenAuthConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig) - return object; - return new $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig(); - }; - - /** - * Creates a plain object from a ServiceAgentIdTokenAuthConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig - * @static - * @param {google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig} message ServiceAgentIdTokenAuthConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceAgentIdTokenAuthConfig.toObject = function toObject() { - return {}; - }; - - /** - * Converts this ServiceAgentIdTokenAuthConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig - * @instance - * @returns {Object.} JSON object - */ - ServiceAgentIdTokenAuthConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceAgentIdTokenAuthConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceAgentIdTokenAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig"; - }; - - return ServiceAgentIdTokenAuthConfig; - })(); - - v1beta.ServiceAccountAuthConfig = (function() { - - /** - * Properties of a ServiceAccountAuthConfig. - * @memberof google.cloud.ces.v1beta - * @interface IServiceAccountAuthConfig - * @property {string|null} [serviceAccount] ServiceAccountAuthConfig serviceAccount - * @property {Array.|null} [scopes] ServiceAccountAuthConfig scopes - */ - - /** - * Constructs a new ServiceAccountAuthConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ServiceAccountAuthConfig. - * @implements IServiceAccountAuthConfig - * @constructor - * @param {google.cloud.ces.v1beta.IServiceAccountAuthConfig=} [properties] Properties to set - */ - function ServiceAccountAuthConfig(properties) { - this.scopes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceAccountAuthConfig serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig - * @instance - */ - ServiceAccountAuthConfig.prototype.serviceAccount = ""; - - /** - * ServiceAccountAuthConfig scopes. - * @member {Array.} scopes - * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig - * @instance - */ - ServiceAccountAuthConfig.prototype.scopes = $util.emptyArray; - - /** - * Creates a new ServiceAccountAuthConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig - * @static - * @param {google.cloud.ces.v1beta.IServiceAccountAuthConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ServiceAccountAuthConfig} ServiceAccountAuthConfig instance - */ - ServiceAccountAuthConfig.create = function create(properties) { - return new ServiceAccountAuthConfig(properties); - }; - - /** - * Encodes the specified ServiceAccountAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAccountAuthConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig - * @static - * @param {google.cloud.ces.v1beta.IServiceAccountAuthConfig} message ServiceAccountAuthConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceAccountAuthConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccount); - if (message.scopes != null && message.scopes.length) - for (var i = 0; i < message.scopes.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); - return writer; - }; - - /** - * Encodes the specified ServiceAccountAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAccountAuthConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig - * @static - * @param {google.cloud.ces.v1beta.IServiceAccountAuthConfig} message ServiceAccountAuthConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceAccountAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ServiceAccountAuthConfig} ServiceAccountAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceAccountAuthConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.serviceAccount = reader.string(); - break; - } - case 2: { - if (!(message.scopes && message.scopes.length)) - message.scopes = []; - message.scopes.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ServiceAccountAuthConfig} ServiceAccountAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceAccountAuthConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceAccountAuthConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceAccountAuthConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.scopes != null && message.hasOwnProperty("scopes")) { - if (!Array.isArray(message.scopes)) - return "scopes: array expected"; - for (var i = 0; i < message.scopes.length; ++i) - if (!$util.isString(message.scopes[i])) - return "scopes: string[] expected"; - } - return null; - }; - - /** - * Creates a ServiceAccountAuthConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ServiceAccountAuthConfig} ServiceAccountAuthConfig - */ - ServiceAccountAuthConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig(); - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.scopes) { - if (!Array.isArray(object.scopes)) - throw TypeError(".google.cloud.ces.v1beta.ServiceAccountAuthConfig.scopes: array expected"); - message.scopes = []; - for (var i = 0; i < object.scopes.length; ++i) - message.scopes[i] = String(object.scopes[i]); - } - return message; - }; - - /** - * Creates a plain object from a ServiceAccountAuthConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig - * @static - * @param {google.cloud.ces.v1beta.ServiceAccountAuthConfig} message ServiceAccountAuthConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceAccountAuthConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.scopes = []; - if (options.defaults) - object.serviceAccount = ""; - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.scopes && message.scopes.length) { - object.scopes = []; - for (var j = 0; j < message.scopes.length; ++j) - object.scopes[j] = message.scopes[j]; - } - return object; - }; - - /** - * Converts this ServiceAccountAuthConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig - * @instance - * @returns {Object.} JSON object - */ - ServiceAccountAuthConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceAccountAuthConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceAccountAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ServiceAccountAuthConfig"; - }; - - return ServiceAccountAuthConfig; - })(); - - v1beta.BearerTokenConfig = (function() { - - /** - * Properties of a BearerTokenConfig. - * @memberof google.cloud.ces.v1beta - * @interface IBearerTokenConfig - * @property {string|null} [token] BearerTokenConfig token - */ - - /** - * Constructs a new BearerTokenConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a BearerTokenConfig. - * @implements IBearerTokenConfig - * @constructor - * @param {google.cloud.ces.v1beta.IBearerTokenConfig=} [properties] Properties to set - */ - function BearerTokenConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BearerTokenConfig token. - * @member {string} token - * @memberof google.cloud.ces.v1beta.BearerTokenConfig - * @instance - */ - BearerTokenConfig.prototype.token = ""; - - /** - * Creates a new BearerTokenConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.BearerTokenConfig - * @static - * @param {google.cloud.ces.v1beta.IBearerTokenConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.BearerTokenConfig} BearerTokenConfig instance - */ - BearerTokenConfig.create = function create(properties) { - return new BearerTokenConfig(properties); - }; - - /** - * Encodes the specified BearerTokenConfig message. Does not implicitly {@link google.cloud.ces.v1beta.BearerTokenConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.BearerTokenConfig - * @static - * @param {google.cloud.ces.v1beta.IBearerTokenConfig} message BearerTokenConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BearerTokenConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.token != null && Object.hasOwnProperty.call(message, "token")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); - return writer; - }; - - /** - * Encodes the specified BearerTokenConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BearerTokenConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.BearerTokenConfig - * @static - * @param {google.cloud.ces.v1beta.IBearerTokenConfig} message BearerTokenConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BearerTokenConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BearerTokenConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.BearerTokenConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.BearerTokenConfig} BearerTokenConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BearerTokenConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BearerTokenConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.token = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BearerTokenConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.BearerTokenConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.BearerTokenConfig} BearerTokenConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BearerTokenConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BearerTokenConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.BearerTokenConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BearerTokenConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.token != null && message.hasOwnProperty("token")) - if (!$util.isString(message.token)) - return "token: string expected"; - return null; - }; - - /** - * Creates a BearerTokenConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.BearerTokenConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.BearerTokenConfig} BearerTokenConfig - */ - BearerTokenConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.BearerTokenConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.BearerTokenConfig(); - if (object.token != null) - message.token = String(object.token); - return message; - }; - - /** - * Creates a plain object from a BearerTokenConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.BearerTokenConfig - * @static - * @param {google.cloud.ces.v1beta.BearerTokenConfig} message BearerTokenConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BearerTokenConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.token = ""; - if (message.token != null && message.hasOwnProperty("token")) - object.token = message.token; - return object; - }; - - /** - * Converts this BearerTokenConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.BearerTokenConfig - * @instance - * @returns {Object.} JSON object - */ - BearerTokenConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BearerTokenConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.BearerTokenConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BearerTokenConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.BearerTokenConfig"; - }; - - return BearerTokenConfig; - })(); - - v1beta.EndUserAuthConfig = (function() { - - /** - * Properties of an EndUserAuthConfig. - * @memberof google.cloud.ces.v1beta - * @interface IEndUserAuthConfig - * @property {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig|null} [oauth2AuthCodeConfig] EndUserAuthConfig oauth2AuthCodeConfig - * @property {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig|null} [oauth2JwtBearerConfig] EndUserAuthConfig oauth2JwtBearerConfig - */ - - /** - * Constructs a new EndUserAuthConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an EndUserAuthConfig. - * @implements IEndUserAuthConfig - * @constructor - * @param {google.cloud.ces.v1beta.IEndUserAuthConfig=} [properties] Properties to set - */ - function EndUserAuthConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EndUserAuthConfig oauth2AuthCodeConfig. - * @member {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig|null|undefined} oauth2AuthCodeConfig - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig - * @instance - */ - EndUserAuthConfig.prototype.oauth2AuthCodeConfig = null; - - /** - * EndUserAuthConfig oauth2JwtBearerConfig. - * @member {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig|null|undefined} oauth2JwtBearerConfig - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig - * @instance - */ - EndUserAuthConfig.prototype.oauth2JwtBearerConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * EndUserAuthConfig authConfig. - * @member {"oauth2AuthCodeConfig"|"oauth2JwtBearerConfig"|undefined} authConfig - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig - * @instance - */ - Object.defineProperty(EndUserAuthConfig.prototype, "authConfig", { - get: $util.oneOfGetter($oneOfFields = ["oauth2AuthCodeConfig", "oauth2JwtBearerConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new EndUserAuthConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig - * @static - * @param {google.cloud.ces.v1beta.IEndUserAuthConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EndUserAuthConfig} EndUserAuthConfig instance - */ - EndUserAuthConfig.create = function create(properties) { - return new EndUserAuthConfig(properties); - }; - - /** - * Encodes the specified EndUserAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig - * @static - * @param {google.cloud.ces.v1beta.IEndUserAuthConfig} message EndUserAuthConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EndUserAuthConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.oauth2AuthCodeConfig != null && Object.hasOwnProperty.call(message, "oauth2AuthCodeConfig")) - $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.encode(message.oauth2AuthCodeConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.oauth2JwtBearerConfig != null && Object.hasOwnProperty.call(message, "oauth2JwtBearerConfig")) - $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.encode(message.oauth2JwtBearerConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EndUserAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig - * @static - * @param {google.cloud.ces.v1beta.IEndUserAuthConfig} message EndUserAuthConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EndUserAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EndUserAuthConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EndUserAuthConfig} EndUserAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EndUserAuthConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EndUserAuthConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.oauth2AuthCodeConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.oauth2JwtBearerConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EndUserAuthConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EndUserAuthConfig} EndUserAuthConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EndUserAuthConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EndUserAuthConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EndUserAuthConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.oauth2AuthCodeConfig != null && message.hasOwnProperty("oauth2AuthCodeConfig")) { - properties.authConfig = 1; - { - var error = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.verify(message.oauth2AuthCodeConfig); - if (error) - return "oauth2AuthCodeConfig." + error; - } - } - if (message.oauth2JwtBearerConfig != null && message.hasOwnProperty("oauth2JwtBearerConfig")) { - if (properties.authConfig === 1) - return "authConfig: multiple values"; - properties.authConfig = 1; - { - var error = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.verify(message.oauth2JwtBearerConfig); - if (error) - return "oauth2JwtBearerConfig." + error; - } - } - return null; - }; - - /** - * Creates an EndUserAuthConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EndUserAuthConfig} EndUserAuthConfig - */ - EndUserAuthConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EndUserAuthConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.EndUserAuthConfig(); - if (object.oauth2AuthCodeConfig != null) { - if (typeof object.oauth2AuthCodeConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.EndUserAuthConfig.oauth2AuthCodeConfig: object expected"); - message.oauth2AuthCodeConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.fromObject(object.oauth2AuthCodeConfig); - } - if (object.oauth2JwtBearerConfig != null) { - if (typeof object.oauth2JwtBearerConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.EndUserAuthConfig.oauth2JwtBearerConfig: object expected"); - message.oauth2JwtBearerConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.fromObject(object.oauth2JwtBearerConfig); - } - return message; - }; - - /** - * Creates a plain object from an EndUserAuthConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig - * @static - * @param {google.cloud.ces.v1beta.EndUserAuthConfig} message EndUserAuthConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EndUserAuthConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.oauth2AuthCodeConfig != null && message.hasOwnProperty("oauth2AuthCodeConfig")) { - object.oauth2AuthCodeConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.toObject(message.oauth2AuthCodeConfig, options); - if (options.oneofs) - object.authConfig = "oauth2AuthCodeConfig"; - } - if (message.oauth2JwtBearerConfig != null && message.hasOwnProperty("oauth2JwtBearerConfig")) { - object.oauth2JwtBearerConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.toObject(message.oauth2JwtBearerConfig, options); - if (options.oneofs) - object.authConfig = "oauth2JwtBearerConfig"; - } - return object; - }; - - /** - * Converts this EndUserAuthConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig - * @instance - * @returns {Object.} JSON object - */ - EndUserAuthConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EndUserAuthConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EndUserAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EndUserAuthConfig"; - }; - - EndUserAuthConfig.Oauth2AuthCodeConfig = (function() { - - /** - * Properties of an Oauth2AuthCodeConfig. - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig - * @interface IOauth2AuthCodeConfig - * @property {string|null} [oauthToken] Oauth2AuthCodeConfig oauthToken - */ - - /** - * Constructs a new Oauth2AuthCodeConfig. - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig - * @classdesc Represents an Oauth2AuthCodeConfig. - * @implements IOauth2AuthCodeConfig - * @constructor - * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig=} [properties] Properties to set - */ - function Oauth2AuthCodeConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Oauth2AuthCodeConfig oauthToken. - * @member {string} oauthToken - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig - * @instance - */ - Oauth2AuthCodeConfig.prototype.oauthToken = ""; - - /** - * Creates a new Oauth2AuthCodeConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig - * @static - * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig instance - */ - Oauth2AuthCodeConfig.create = function create(properties) { - return new Oauth2AuthCodeConfig(properties); - }; - - /** - * Encodes the specified Oauth2AuthCodeConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig - * @static - * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig} message Oauth2AuthCodeConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Oauth2AuthCodeConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.oauthToken != null && Object.hasOwnProperty.call(message, "oauthToken")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.oauthToken); - return writer; - }; - - /** - * Encodes the specified Oauth2AuthCodeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig - * @static - * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig} message Oauth2AuthCodeConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Oauth2AuthCodeConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Oauth2AuthCodeConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.oauthToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Oauth2AuthCodeConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Oauth2AuthCodeConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Oauth2AuthCodeConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.oauthToken != null && message.hasOwnProperty("oauthToken")) - if (!$util.isString(message.oauthToken)) - return "oauthToken: string expected"; - return null; - }; - - /** - * Creates an Oauth2AuthCodeConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig - */ - Oauth2AuthCodeConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig(); - if (object.oauthToken != null) - message.oauthToken = String(object.oauthToken); - return message; - }; - - /** - * Creates a plain object from an Oauth2AuthCodeConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig - * @static - * @param {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig} message Oauth2AuthCodeConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Oauth2AuthCodeConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.oauthToken = ""; - if (message.oauthToken != null && message.hasOwnProperty("oauthToken")) - object.oauthToken = message.oauthToken; - return object; - }; - - /** - * Converts this Oauth2AuthCodeConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig - * @instance - * @returns {Object.} JSON object - */ - Oauth2AuthCodeConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Oauth2AuthCodeConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Oauth2AuthCodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig"; - }; - - return Oauth2AuthCodeConfig; - })(); - - EndUserAuthConfig.Oauth2JwtBearerConfig = (function() { - - /** - * Properties of an Oauth2JwtBearerConfig. - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig - * @interface IOauth2JwtBearerConfig - * @property {string|null} [issuer] Oauth2JwtBearerConfig issuer - * @property {string|null} [subject] Oauth2JwtBearerConfig subject - * @property {string|null} [clientKey] Oauth2JwtBearerConfig clientKey - */ - - /** - * Constructs a new Oauth2JwtBearerConfig. - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig - * @classdesc Represents an Oauth2JwtBearerConfig. - * @implements IOauth2JwtBearerConfig - * @constructor - * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig=} [properties] Properties to set - */ - function Oauth2JwtBearerConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Oauth2JwtBearerConfig issuer. - * @member {string} issuer - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig - * @instance - */ - Oauth2JwtBearerConfig.prototype.issuer = ""; - - /** - * Oauth2JwtBearerConfig subject. - * @member {string} subject - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig - * @instance - */ - Oauth2JwtBearerConfig.prototype.subject = ""; - - /** - * Oauth2JwtBearerConfig clientKey. - * @member {string} clientKey - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig - * @instance - */ - Oauth2JwtBearerConfig.prototype.clientKey = ""; - - /** - * Creates a new Oauth2JwtBearerConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig - * @static - * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig instance - */ - Oauth2JwtBearerConfig.create = function create(properties) { - return new Oauth2JwtBearerConfig(properties); - }; - - /** - * Encodes the specified Oauth2JwtBearerConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig - * @static - * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig} message Oauth2JwtBearerConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Oauth2JwtBearerConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.issuer != null && Object.hasOwnProperty.call(message, "issuer")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.issuer); - if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subject); - if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientKey); - return writer; - }; - - /** - * Encodes the specified Oauth2JwtBearerConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig - * @static - * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig} message Oauth2JwtBearerConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Oauth2JwtBearerConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Oauth2JwtBearerConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.issuer = reader.string(); - break; - } - case 2: { - message.subject = reader.string(); - break; - } - case 3: { - message.clientKey = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Oauth2JwtBearerConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Oauth2JwtBearerConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Oauth2JwtBearerConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.issuer != null && message.hasOwnProperty("issuer")) - if (!$util.isString(message.issuer)) - return "issuer: string expected"; - if (message.subject != null && message.hasOwnProperty("subject")) - if (!$util.isString(message.subject)) - return "subject: string expected"; - if (message.clientKey != null && message.hasOwnProperty("clientKey")) - if (!$util.isString(message.clientKey)) - return "clientKey: string expected"; - return null; - }; - - /** - * Creates an Oauth2JwtBearerConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig - */ - Oauth2JwtBearerConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig(); - if (object.issuer != null) - message.issuer = String(object.issuer); - if (object.subject != null) - message.subject = String(object.subject); - if (object.clientKey != null) - message.clientKey = String(object.clientKey); - return message; - }; - - /** - * Creates a plain object from an Oauth2JwtBearerConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig - * @static - * @param {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig} message Oauth2JwtBearerConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Oauth2JwtBearerConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.issuer = ""; - object.subject = ""; - object.clientKey = ""; - } - if (message.issuer != null && message.hasOwnProperty("issuer")) - object.issuer = message.issuer; - if (message.subject != null && message.hasOwnProperty("subject")) - object.subject = message.subject; - if (message.clientKey != null && message.hasOwnProperty("clientKey")) - object.clientKey = message.clientKey; - return object; - }; - - /** - * Converts this Oauth2JwtBearerConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig - * @instance - * @returns {Object.} JSON object - */ - Oauth2JwtBearerConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Oauth2JwtBearerConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Oauth2JwtBearerConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig"; - }; - - return Oauth2JwtBearerConfig; - })(); - - return EndUserAuthConfig; - })(); - - v1beta.ApiAuthentication = (function() { - - /** - * Properties of an ApiAuthentication. - * @memberof google.cloud.ces.v1beta - * @interface IApiAuthentication - * @property {google.cloud.ces.v1beta.IApiKeyConfig|null} [apiKeyConfig] ApiAuthentication apiKeyConfig - * @property {google.cloud.ces.v1beta.IOAuthConfig|null} [oauthConfig] ApiAuthentication oauthConfig - * @property {google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig|null} [serviceAgentIdTokenAuthConfig] ApiAuthentication serviceAgentIdTokenAuthConfig - * @property {google.cloud.ces.v1beta.IServiceAccountAuthConfig|null} [serviceAccountAuthConfig] ApiAuthentication serviceAccountAuthConfig - * @property {google.cloud.ces.v1beta.IBearerTokenConfig|null} [bearerTokenConfig] ApiAuthentication bearerTokenConfig - */ - - /** - * Constructs a new ApiAuthentication. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an ApiAuthentication. - * @implements IApiAuthentication - * @constructor - * @param {google.cloud.ces.v1beta.IApiAuthentication=} [properties] Properties to set - */ - function ApiAuthentication(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ApiAuthentication apiKeyConfig. - * @member {google.cloud.ces.v1beta.IApiKeyConfig|null|undefined} apiKeyConfig - * @memberof google.cloud.ces.v1beta.ApiAuthentication - * @instance - */ - ApiAuthentication.prototype.apiKeyConfig = null; - - /** - * ApiAuthentication oauthConfig. - * @member {google.cloud.ces.v1beta.IOAuthConfig|null|undefined} oauthConfig - * @memberof google.cloud.ces.v1beta.ApiAuthentication - * @instance - */ - ApiAuthentication.prototype.oauthConfig = null; - - /** - * ApiAuthentication serviceAgentIdTokenAuthConfig. - * @member {google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig|null|undefined} serviceAgentIdTokenAuthConfig - * @memberof google.cloud.ces.v1beta.ApiAuthentication - * @instance - */ - ApiAuthentication.prototype.serviceAgentIdTokenAuthConfig = null; - - /** - * ApiAuthentication serviceAccountAuthConfig. - * @member {google.cloud.ces.v1beta.IServiceAccountAuthConfig|null|undefined} serviceAccountAuthConfig - * @memberof google.cloud.ces.v1beta.ApiAuthentication - * @instance - */ - ApiAuthentication.prototype.serviceAccountAuthConfig = null; - - /** - * ApiAuthentication bearerTokenConfig. - * @member {google.cloud.ces.v1beta.IBearerTokenConfig|null|undefined} bearerTokenConfig - * @memberof google.cloud.ces.v1beta.ApiAuthentication - * @instance - */ - ApiAuthentication.prototype.bearerTokenConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ApiAuthentication authConfig. - * @member {"apiKeyConfig"|"oauthConfig"|"serviceAgentIdTokenAuthConfig"|"serviceAccountAuthConfig"|"bearerTokenConfig"|undefined} authConfig - * @memberof google.cloud.ces.v1beta.ApiAuthentication - * @instance - */ - Object.defineProperty(ApiAuthentication.prototype, "authConfig", { - get: $util.oneOfGetter($oneOfFields = ["apiKeyConfig", "oauthConfig", "serviceAgentIdTokenAuthConfig", "serviceAccountAuthConfig", "bearerTokenConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ApiAuthentication instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ApiAuthentication - * @static - * @param {google.cloud.ces.v1beta.IApiAuthentication=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ApiAuthentication} ApiAuthentication instance - */ - ApiAuthentication.create = function create(properties) { - return new ApiAuthentication(properties); - }; - - /** - * Encodes the specified ApiAuthentication message. Does not implicitly {@link google.cloud.ces.v1beta.ApiAuthentication.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ApiAuthentication - * @static - * @param {google.cloud.ces.v1beta.IApiAuthentication} message ApiAuthentication message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ApiAuthentication.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.apiKeyConfig != null && Object.hasOwnProperty.call(message, "apiKeyConfig")) - $root.google.cloud.ces.v1beta.ApiKeyConfig.encode(message.apiKeyConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.oauthConfig != null && Object.hasOwnProperty.call(message, "oauthConfig")) - $root.google.cloud.ces.v1beta.OAuthConfig.encode(message.oauthConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.serviceAgentIdTokenAuthConfig != null && Object.hasOwnProperty.call(message, "serviceAgentIdTokenAuthConfig")) - $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.encode(message.serviceAgentIdTokenAuthConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.serviceAccountAuthConfig != null && Object.hasOwnProperty.call(message, "serviceAccountAuthConfig")) - $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig.encode(message.serviceAccountAuthConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.bearerTokenConfig != null && Object.hasOwnProperty.call(message, "bearerTokenConfig")) - $root.google.cloud.ces.v1beta.BearerTokenConfig.encode(message.bearerTokenConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ApiAuthentication message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ApiAuthentication.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ApiAuthentication - * @static - * @param {google.cloud.ces.v1beta.IApiAuthentication} message ApiAuthentication message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ApiAuthentication.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ApiAuthentication message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ApiAuthentication - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ApiAuthentication} ApiAuthentication - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ApiAuthentication.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ApiAuthentication(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.apiKeyConfig = $root.google.cloud.ces.v1beta.ApiKeyConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.oauthConfig = $root.google.cloud.ces.v1beta.OAuthConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.serviceAgentIdTokenAuthConfig = $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.serviceAccountAuthConfig = $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - message.bearerTokenConfig = $root.google.cloud.ces.v1beta.BearerTokenConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ApiAuthentication message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ApiAuthentication - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ApiAuthentication} ApiAuthentication - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ApiAuthentication.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ApiAuthentication message. - * @function verify - * @memberof google.cloud.ces.v1beta.ApiAuthentication - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ApiAuthentication.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) { - properties.authConfig = 1; - { - var error = $root.google.cloud.ces.v1beta.ApiKeyConfig.verify(message.apiKeyConfig); - if (error) - return "apiKeyConfig." + error; - } - } - if (message.oauthConfig != null && message.hasOwnProperty("oauthConfig")) { - if (properties.authConfig === 1) - return "authConfig: multiple values"; - properties.authConfig = 1; - { - var error = $root.google.cloud.ces.v1beta.OAuthConfig.verify(message.oauthConfig); - if (error) - return "oauthConfig." + error; - } - } - if (message.serviceAgentIdTokenAuthConfig != null && message.hasOwnProperty("serviceAgentIdTokenAuthConfig")) { - if (properties.authConfig === 1) - return "authConfig: multiple values"; - properties.authConfig = 1; - { - var error = $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.verify(message.serviceAgentIdTokenAuthConfig); - if (error) - return "serviceAgentIdTokenAuthConfig." + error; - } - } - if (message.serviceAccountAuthConfig != null && message.hasOwnProperty("serviceAccountAuthConfig")) { - if (properties.authConfig === 1) - return "authConfig: multiple values"; - properties.authConfig = 1; - { - var error = $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig.verify(message.serviceAccountAuthConfig); - if (error) - return "serviceAccountAuthConfig." + error; - } - } - if (message.bearerTokenConfig != null && message.hasOwnProperty("bearerTokenConfig")) { - if (properties.authConfig === 1) - return "authConfig: multiple values"; - properties.authConfig = 1; - { - var error = $root.google.cloud.ces.v1beta.BearerTokenConfig.verify(message.bearerTokenConfig); - if (error) - return "bearerTokenConfig." + error; - } - } - return null; - }; - - /** - * Creates an ApiAuthentication message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ApiAuthentication - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ApiAuthentication} ApiAuthentication - */ - ApiAuthentication.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ApiAuthentication) - return object; - var message = new $root.google.cloud.ces.v1beta.ApiAuthentication(); - if (object.apiKeyConfig != null) { - if (typeof object.apiKeyConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.ApiAuthentication.apiKeyConfig: object expected"); - message.apiKeyConfig = $root.google.cloud.ces.v1beta.ApiKeyConfig.fromObject(object.apiKeyConfig); - } - if (object.oauthConfig != null) { - if (typeof object.oauthConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.ApiAuthentication.oauthConfig: object expected"); - message.oauthConfig = $root.google.cloud.ces.v1beta.OAuthConfig.fromObject(object.oauthConfig); - } - if (object.serviceAgentIdTokenAuthConfig != null) { - if (typeof object.serviceAgentIdTokenAuthConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.ApiAuthentication.serviceAgentIdTokenAuthConfig: object expected"); - message.serviceAgentIdTokenAuthConfig = $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.fromObject(object.serviceAgentIdTokenAuthConfig); - } - if (object.serviceAccountAuthConfig != null) { - if (typeof object.serviceAccountAuthConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.ApiAuthentication.serviceAccountAuthConfig: object expected"); - message.serviceAccountAuthConfig = $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig.fromObject(object.serviceAccountAuthConfig); - } - if (object.bearerTokenConfig != null) { - if (typeof object.bearerTokenConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.ApiAuthentication.bearerTokenConfig: object expected"); - message.bearerTokenConfig = $root.google.cloud.ces.v1beta.BearerTokenConfig.fromObject(object.bearerTokenConfig); - } - return message; - }; - - /** - * Creates a plain object from an ApiAuthentication message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ApiAuthentication - * @static - * @param {google.cloud.ces.v1beta.ApiAuthentication} message ApiAuthentication - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ApiAuthentication.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) { - object.apiKeyConfig = $root.google.cloud.ces.v1beta.ApiKeyConfig.toObject(message.apiKeyConfig, options); - if (options.oneofs) - object.authConfig = "apiKeyConfig"; - } - if (message.oauthConfig != null && message.hasOwnProperty("oauthConfig")) { - object.oauthConfig = $root.google.cloud.ces.v1beta.OAuthConfig.toObject(message.oauthConfig, options); - if (options.oneofs) - object.authConfig = "oauthConfig"; - } - if (message.serviceAgentIdTokenAuthConfig != null && message.hasOwnProperty("serviceAgentIdTokenAuthConfig")) { - object.serviceAgentIdTokenAuthConfig = $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.toObject(message.serviceAgentIdTokenAuthConfig, options); - if (options.oneofs) - object.authConfig = "serviceAgentIdTokenAuthConfig"; - } - if (message.serviceAccountAuthConfig != null && message.hasOwnProperty("serviceAccountAuthConfig")) { - object.serviceAccountAuthConfig = $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig.toObject(message.serviceAccountAuthConfig, options); - if (options.oneofs) - object.authConfig = "serviceAccountAuthConfig"; - } - if (message.bearerTokenConfig != null && message.hasOwnProperty("bearerTokenConfig")) { - object.bearerTokenConfig = $root.google.cloud.ces.v1beta.BearerTokenConfig.toObject(message.bearerTokenConfig, options); - if (options.oneofs) - object.authConfig = "bearerTokenConfig"; - } - return object; - }; - - /** - * Converts this ApiAuthentication to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ApiAuthentication - * @instance - * @returns {Object.} JSON object - */ - ApiAuthentication.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ApiAuthentication - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ApiAuthentication - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ApiAuthentication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ApiAuthentication"; - }; - - return ApiAuthentication; - })(); - - v1beta.DataStoreTool = (function() { - - /** - * Properties of a DataStoreTool. - * @memberof google.cloud.ces.v1beta - * @interface IDataStoreTool - * @property {google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource|null} [dataStoreSource] DataStoreTool dataStoreSource - * @property {google.cloud.ces.v1beta.DataStoreTool.IEngineSource|null} [engineSource] DataStoreTool engineSource - * @property {string|null} [name] DataStoreTool name - * @property {string|null} [description] DataStoreTool description - * @property {Array.|null} [boostSpecs] DataStoreTool boostSpecs - * @property {Array.|null} [modalityConfigs] DataStoreTool modalityConfigs - * @property {google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior|null} [filterParameterBehavior] DataStoreTool filterParameterBehavior - */ - - /** - * Constructs a new DataStoreTool. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DataStoreTool. - * @implements IDataStoreTool - * @constructor - * @param {google.cloud.ces.v1beta.IDataStoreTool=} [properties] Properties to set - */ - function DataStoreTool(properties) { - this.boostSpecs = []; - this.modalityConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataStoreTool dataStoreSource. - * @member {google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource|null|undefined} dataStoreSource - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @instance - */ - DataStoreTool.prototype.dataStoreSource = null; - - /** - * DataStoreTool engineSource. - * @member {google.cloud.ces.v1beta.DataStoreTool.IEngineSource|null|undefined} engineSource - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @instance - */ - DataStoreTool.prototype.engineSource = null; - - /** - * DataStoreTool name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @instance - */ - DataStoreTool.prototype.name = ""; - - /** - * DataStoreTool description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @instance - */ - DataStoreTool.prototype.description = ""; - - /** - * DataStoreTool boostSpecs. - * @member {Array.} boostSpecs - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @instance - */ - DataStoreTool.prototype.boostSpecs = $util.emptyArray; - - /** - * DataStoreTool modalityConfigs. - * @member {Array.} modalityConfigs - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @instance - */ - DataStoreTool.prototype.modalityConfigs = $util.emptyArray; - - /** - * DataStoreTool filterParameterBehavior. - * @member {google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior} filterParameterBehavior - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @instance - */ - DataStoreTool.prototype.filterParameterBehavior = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * DataStoreTool searchSource. - * @member {"dataStoreSource"|"engineSource"|undefined} searchSource - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @instance - */ - Object.defineProperty(DataStoreTool.prototype, "searchSource", { - get: $util.oneOfGetter($oneOfFields = ["dataStoreSource", "engineSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DataStoreTool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @static - * @param {google.cloud.ces.v1beta.IDataStoreTool=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DataStoreTool} DataStoreTool instance - */ - DataStoreTool.create = function create(properties) { - return new DataStoreTool(properties); - }; - - /** - * Encodes the specified DataStoreTool message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @static - * @param {google.cloud.ces.v1beta.IDataStoreTool} message DataStoreTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataStoreTool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.dataStoreSource != null && Object.hasOwnProperty.call(message, "dataStoreSource")) - $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.encode(message.dataStoreSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.engineSource != null && Object.hasOwnProperty.call(message, "engineSource")) - $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource.encode(message.engineSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.boostSpecs != null && message.boostSpecs.length) - for (var i = 0; i < message.boostSpecs.length; ++i) - $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.encode(message.boostSpecs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.modalityConfigs != null && message.modalityConfigs.length) - for (var i = 0; i < message.modalityConfigs.length; ++i) - $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.encode(message.modalityConfigs[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.filterParameterBehavior != null && Object.hasOwnProperty.call(message, "filterParameterBehavior")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.filterParameterBehavior); - return writer; - }; - - /** - * Encodes the specified DataStoreTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @static - * @param {google.cloud.ces.v1beta.IDataStoreTool} message DataStoreTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataStoreTool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataStoreTool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DataStoreTool} DataStoreTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataStoreTool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.dataStoreSource = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.decode(reader, reader.uint32()); - break; - } - case 4: { - message.engineSource = $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 8: { - if (!(message.boostSpecs && message.boostSpecs.length)) - message.boostSpecs = []; - message.boostSpecs.push($root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.decode(reader, reader.uint32())); - break; - } - case 9: { - if (!(message.modalityConfigs && message.modalityConfigs.length)) - message.modalityConfigs = []; - message.modalityConfigs.push($root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.decode(reader, reader.uint32())); - break; - } - case 10: { - message.filterParameterBehavior = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataStoreTool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DataStoreTool} DataStoreTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataStoreTool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataStoreTool message. - * @function verify - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataStoreTool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.dataStoreSource != null && message.hasOwnProperty("dataStoreSource")) { - properties.searchSource = 1; - { - var error = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.verify(message.dataStoreSource); - if (error) - return "dataStoreSource." + error; - } - } - if (message.engineSource != null && message.hasOwnProperty("engineSource")) { - if (properties.searchSource === 1) - return "searchSource: multiple values"; - properties.searchSource = 1; - { - var error = $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource.verify(message.engineSource); - if (error) - return "engineSource." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.boostSpecs != null && message.hasOwnProperty("boostSpecs")) { - if (!Array.isArray(message.boostSpecs)) - return "boostSpecs: array expected"; - for (var i = 0; i < message.boostSpecs.length; ++i) { - var error = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.verify(message.boostSpecs[i]); - if (error) - return "boostSpecs." + error; - } - } - if (message.modalityConfigs != null && message.hasOwnProperty("modalityConfigs")) { - if (!Array.isArray(message.modalityConfigs)) - return "modalityConfigs: array expected"; - for (var i = 0; i < message.modalityConfigs.length; ++i) { - var error = $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.verify(message.modalityConfigs[i]); - if (error) - return "modalityConfigs." + error; - } - } - if (message.filterParameterBehavior != null && message.hasOwnProperty("filterParameterBehavior")) - switch (message.filterParameterBehavior) { - default: - return "filterParameterBehavior: enum value expected"; - case 0: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a DataStoreTool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DataStoreTool} DataStoreTool - */ - DataStoreTool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool) - return object; - var message = new $root.google.cloud.ces.v1beta.DataStoreTool(); - if (object.dataStoreSource != null) { - if (typeof object.dataStoreSource !== "object") - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.dataStoreSource: object expected"); - message.dataStoreSource = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.fromObject(object.dataStoreSource); - } - if (object.engineSource != null) { - if (typeof object.engineSource !== "object") - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.engineSource: object expected"); - message.engineSource = $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource.fromObject(object.engineSource); - } - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.boostSpecs) { - if (!Array.isArray(object.boostSpecs)) - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.boostSpecs: array expected"); - message.boostSpecs = []; - for (var i = 0; i < object.boostSpecs.length; ++i) { - if (typeof object.boostSpecs[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.boostSpecs: object expected"); - message.boostSpecs[i] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.fromObject(object.boostSpecs[i]); - } - } - if (object.modalityConfigs) { - if (!Array.isArray(object.modalityConfigs)) - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.modalityConfigs: array expected"); - message.modalityConfigs = []; - for (var i = 0; i < object.modalityConfigs.length; ++i) { - if (typeof object.modalityConfigs[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.modalityConfigs: object expected"); - message.modalityConfigs[i] = $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.fromObject(object.modalityConfigs[i]); - } - } - switch (object.filterParameterBehavior) { - default: - if (typeof object.filterParameterBehavior === "number") { - message.filterParameterBehavior = object.filterParameterBehavior; - break; - } - break; - case "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED": - case 0: - message.filterParameterBehavior = 0; - break; - case "ALWAYS_INCLUDE": - case 2: - message.filterParameterBehavior = 2; - break; - case "NEVER_INCLUDE": - case 3: - message.filterParameterBehavior = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a DataStoreTool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool} message DataStoreTool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataStoreTool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.boostSpecs = []; - object.modalityConfigs = []; - } - if (options.defaults) { - object.name = ""; - object.description = ""; - object.filterParameterBehavior = options.enums === String ? "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.dataStoreSource != null && message.hasOwnProperty("dataStoreSource")) { - object.dataStoreSource = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.toObject(message.dataStoreSource, options); - if (options.oneofs) - object.searchSource = "dataStoreSource"; - } - if (message.engineSource != null && message.hasOwnProperty("engineSource")) { - object.engineSource = $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource.toObject(message.engineSource, options); - if (options.oneofs) - object.searchSource = "engineSource"; - } - if (message.boostSpecs && message.boostSpecs.length) { - object.boostSpecs = []; - for (var j = 0; j < message.boostSpecs.length; ++j) - object.boostSpecs[j] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.toObject(message.boostSpecs[j], options); - } - if (message.modalityConfigs && message.modalityConfigs.length) { - object.modalityConfigs = []; - for (var j = 0; j < message.modalityConfigs.length; ++j) - object.modalityConfigs[j] = $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.toObject(message.modalityConfigs[j], options); - } - if (message.filterParameterBehavior != null && message.hasOwnProperty("filterParameterBehavior")) - object.filterParameterBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior[message.filterParameterBehavior] === undefined ? message.filterParameterBehavior : $root.google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior[message.filterParameterBehavior] : message.filterParameterBehavior; - return object; - }; - - /** - * Converts this DataStoreTool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @instance - * @returns {Object.} JSON object - */ - DataStoreTool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataStoreTool - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataStoreTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool"; - }; - - DataStoreTool.RewriterConfig = (function() { - - /** - * Properties of a RewriterConfig. - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @interface IRewriterConfig - * @property {google.cloud.ces.v1beta.IModelSettings|null} [modelSettings] RewriterConfig modelSettings - * @property {string|null} [prompt] RewriterConfig prompt - * @property {boolean|null} [disabled] RewriterConfig disabled - */ - - /** - * Constructs a new RewriterConfig. - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @classdesc Represents a RewriterConfig. - * @implements IRewriterConfig - * @constructor - * @param {google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig=} [properties] Properties to set - */ - function RewriterConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RewriterConfig modelSettings. - * @member {google.cloud.ces.v1beta.IModelSettings|null|undefined} modelSettings - * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig - * @instance - */ - RewriterConfig.prototype.modelSettings = null; - - /** - * RewriterConfig prompt. - * @member {string} prompt - * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig - * @instance - */ - RewriterConfig.prototype.prompt = ""; - - /** - * RewriterConfig disabled. - * @member {boolean} disabled - * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig - * @instance - */ - RewriterConfig.prototype.disabled = false; - - /** - * Creates a new RewriterConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DataStoreTool.RewriterConfig} RewriterConfig instance - */ - RewriterConfig.create = function create(properties) { - return new RewriterConfig(properties); - }; - - /** - * Encodes the specified RewriterConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig} message RewriterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RewriterConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) - $root.google.cloud.ces.v1beta.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.prompt); - if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.disabled); - return writer; - }; - - /** - * Encodes the specified RewriterConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig} message RewriterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RewriterConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RewriterConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DataStoreTool.RewriterConfig} RewriterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RewriterConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - message.prompt = reader.string(); - break; - } - case 3: { - message.disabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RewriterConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DataStoreTool.RewriterConfig} RewriterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RewriterConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RewriterConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RewriterConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { - var error = $root.google.cloud.ces.v1beta.ModelSettings.verify(message.modelSettings); - if (error) - return "modelSettings." + error; - } - if (message.prompt != null && message.hasOwnProperty("prompt")) - if (!$util.isString(message.prompt)) - return "prompt: string expected"; - if (message.disabled != null && message.hasOwnProperty("disabled")) - if (typeof message.disabled !== "boolean") - return "disabled: boolean expected"; - return null; - }; - - /** - * Creates a RewriterConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DataStoreTool.RewriterConfig} RewriterConfig - */ - RewriterConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig(); - if (object.modelSettings != null) { - if (typeof object.modelSettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.modelSettings: object expected"); - message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.fromObject(object.modelSettings); - } - if (object.prompt != null) - message.prompt = String(object.prompt); - if (object.disabled != null) - message.disabled = Boolean(object.disabled); - return message; - }; - - /** - * Creates a plain object from a RewriterConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.RewriterConfig} message RewriterConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RewriterConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.modelSettings = null; - object.prompt = ""; - object.disabled = false; - } - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) - object.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.toObject(message.modelSettings, options); - if (message.prompt != null && message.hasOwnProperty("prompt")) - object.prompt = message.prompt; - if (message.disabled != null && message.hasOwnProperty("disabled")) - object.disabled = message.disabled; - return object; - }; - - /** - * Converts this RewriterConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig - * @instance - * @returns {Object.} JSON object - */ - RewriterConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RewriterConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RewriterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.RewriterConfig"; - }; - - return RewriterConfig; - })(); - - DataStoreTool.SummarizationConfig = (function() { - - /** - * Properties of a SummarizationConfig. - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @interface ISummarizationConfig - * @property {google.cloud.ces.v1beta.IModelSettings|null} [modelSettings] SummarizationConfig modelSettings - * @property {string|null} [prompt] SummarizationConfig prompt - * @property {boolean|null} [disabled] SummarizationConfig disabled - */ - - /** - * Constructs a new SummarizationConfig. - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @classdesc Represents a SummarizationConfig. - * @implements ISummarizationConfig - * @constructor - * @param {google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig=} [properties] Properties to set - */ - function SummarizationConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SummarizationConfig modelSettings. - * @member {google.cloud.ces.v1beta.IModelSettings|null|undefined} modelSettings - * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig - * @instance - */ - SummarizationConfig.prototype.modelSettings = null; - - /** - * SummarizationConfig prompt. - * @member {string} prompt - * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig - * @instance - */ - SummarizationConfig.prototype.prompt = ""; - - /** - * SummarizationConfig disabled. - * @member {boolean} disabled - * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig - * @instance - */ - SummarizationConfig.prototype.disabled = false; - - /** - * Creates a new SummarizationConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig} SummarizationConfig instance - */ - SummarizationConfig.create = function create(properties) { - return new SummarizationConfig(properties); - }; - - /** - * Encodes the specified SummarizationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig} message SummarizationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SummarizationConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) - $root.google.cloud.ces.v1beta.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.prompt); - if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.disabled); - return writer; - }; - - /** - * Encodes the specified SummarizationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig} message SummarizationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SummarizationConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SummarizationConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig} SummarizationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SummarizationConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - message.prompt = reader.string(); - break; - } - case 3: { - message.disabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SummarizationConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig} SummarizationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SummarizationConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SummarizationConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SummarizationConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { - var error = $root.google.cloud.ces.v1beta.ModelSettings.verify(message.modelSettings); - if (error) - return "modelSettings." + error; - } - if (message.prompt != null && message.hasOwnProperty("prompt")) - if (!$util.isString(message.prompt)) - return "prompt: string expected"; - if (message.disabled != null && message.hasOwnProperty("disabled")) - if (typeof message.disabled !== "boolean") - return "disabled: boolean expected"; - return null; - }; - - /** - * Creates a SummarizationConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig} SummarizationConfig - */ - SummarizationConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig(); - if (object.modelSettings != null) { - if (typeof object.modelSettings !== "object") - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.modelSettings: object expected"); - message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.fromObject(object.modelSettings); - } - if (object.prompt != null) - message.prompt = String(object.prompt); - if (object.disabled != null) - message.disabled = Boolean(object.disabled); - return message; - }; - - /** - * Creates a plain object from a SummarizationConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig} message SummarizationConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SummarizationConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.modelSettings = null; - object.prompt = ""; - object.disabled = false; - } - if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) - object.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.toObject(message.modelSettings, options); - if (message.prompt != null && message.hasOwnProperty("prompt")) - object.prompt = message.prompt; - if (message.disabled != null && message.hasOwnProperty("disabled")) - object.disabled = message.disabled; - return object; - }; - - /** - * Converts this SummarizationConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig - * @instance - * @returns {Object.} JSON object - */ - SummarizationConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SummarizationConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SummarizationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig"; - }; - - return SummarizationConfig; - })(); - - DataStoreTool.GroundingConfig = (function() { - - /** - * Properties of a GroundingConfig. - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @interface IGroundingConfig - * @property {number|null} [groundingLevel] GroundingConfig groundingLevel - * @property {boolean|null} [disabled] GroundingConfig disabled - */ - - /** - * Constructs a new GroundingConfig. - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @classdesc Represents a GroundingConfig. - * @implements IGroundingConfig - * @constructor - * @param {google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig=} [properties] Properties to set - */ - function GroundingConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroundingConfig groundingLevel. - * @member {number} groundingLevel - * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig - * @instance - */ - GroundingConfig.prototype.groundingLevel = 0; - - /** - * GroundingConfig disabled. - * @member {boolean} disabled - * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig - * @instance - */ - GroundingConfig.prototype.disabled = false; - - /** - * Creates a new GroundingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DataStoreTool.GroundingConfig} GroundingConfig instance - */ - GroundingConfig.create = function create(properties) { - return new GroundingConfig(properties); - }; - - /** - * Encodes the specified GroundingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig} message GroundingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroundingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groundingLevel != null && Object.hasOwnProperty.call(message, "groundingLevel")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.groundingLevel); - if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.disabled); - return writer; - }; - - /** - * Encodes the specified GroundingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig} message GroundingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroundingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroundingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DataStoreTool.GroundingConfig} GroundingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroundingConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.groundingLevel = reader.float(); - break; - } - case 2: { - message.disabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroundingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DataStoreTool.GroundingConfig} GroundingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroundingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroundingConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroundingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.groundingLevel != null && message.hasOwnProperty("groundingLevel")) - if (typeof message.groundingLevel !== "number") - return "groundingLevel: number expected"; - if (message.disabled != null && message.hasOwnProperty("disabled")) - if (typeof message.disabled !== "boolean") - return "disabled: boolean expected"; - return null; - }; - - /** - * Creates a GroundingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DataStoreTool.GroundingConfig} GroundingConfig - */ - GroundingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig(); - if (object.groundingLevel != null) - message.groundingLevel = Number(object.groundingLevel); - if (object.disabled != null) - message.disabled = Boolean(object.disabled); - return message; - }; - - /** - * Creates a plain object from a GroundingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.GroundingConfig} message GroundingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroundingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.groundingLevel = 0; - object.disabled = false; - } - if (message.groundingLevel != null && message.hasOwnProperty("groundingLevel")) - object.groundingLevel = options.json && !isFinite(message.groundingLevel) ? String(message.groundingLevel) : message.groundingLevel; - if (message.disabled != null && message.hasOwnProperty("disabled")) - object.disabled = message.disabled; - return object; - }; - - /** - * Converts this GroundingConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig - * @instance - * @returns {Object.} JSON object - */ - GroundingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GroundingConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GroundingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.GroundingConfig"; - }; - - return GroundingConfig; - })(); - - DataStoreTool.DataStoreSource = (function() { - - /** - * Properties of a DataStoreSource. - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @interface IDataStoreSource - * @property {string|null} [filter] DataStoreSource filter - * @property {google.cloud.ces.v1beta.IDataStore|null} [dataStore] DataStoreSource dataStore - */ - - /** - * Constructs a new DataStoreSource. - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @classdesc Represents a DataStoreSource. - * @implements IDataStoreSource - * @constructor - * @param {google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource=} [properties] Properties to set - */ - function DataStoreSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataStoreSource filter. - * @member {string} filter - * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource - * @instance - */ - DataStoreSource.prototype.filter = ""; - - /** - * DataStoreSource dataStore. - * @member {google.cloud.ces.v1beta.IDataStore|null|undefined} dataStore - * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource - * @instance - */ - DataStoreSource.prototype.dataStore = null; - - /** - * Creates a new DataStoreSource instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DataStoreTool.DataStoreSource} DataStoreSource instance - */ - DataStoreSource.create = function create(properties) { - return new DataStoreSource(properties); - }; - - /** - * Encodes the specified DataStoreSource message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource} message DataStoreSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataStoreSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.dataStore != null && Object.hasOwnProperty.call(message, "dataStore")) - $root.google.cloud.ces.v1beta.DataStore.encode(message.dataStore, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataStoreSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource} message DataStoreSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataStoreSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataStoreSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DataStoreTool.DataStoreSource} DataStoreSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataStoreSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.filter = reader.string(); - break; - } - case 4: { - message.dataStore = $root.google.cloud.ces.v1beta.DataStore.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataStoreSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DataStoreTool.DataStoreSource} DataStoreSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataStoreSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataStoreSource message. - * @function verify - * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataStoreSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.dataStore != null && message.hasOwnProperty("dataStore")) { - var error = $root.google.cloud.ces.v1beta.DataStore.verify(message.dataStore); - if (error) - return "dataStore." + error; - } - return null; - }; - - /** - * Creates a DataStoreSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DataStoreTool.DataStoreSource} DataStoreSource - */ - DataStoreSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource) - return object; - var message = new $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource(); - if (object.filter != null) - message.filter = String(object.filter); - if (object.dataStore != null) { - if (typeof object.dataStore !== "object") - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.dataStore: object expected"); - message.dataStore = $root.google.cloud.ces.v1beta.DataStore.fromObject(object.dataStore); - } - return message; - }; - - /** - * Creates a plain object from a DataStoreSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.DataStoreSource} message DataStoreSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataStoreSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.filter = ""; - object.dataStore = null; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.dataStore != null && message.hasOwnProperty("dataStore")) - object.dataStore = $root.google.cloud.ces.v1beta.DataStore.toObject(message.dataStore, options); - return object; - }; - - /** - * Converts this DataStoreSource to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource - * @instance - * @returns {Object.} JSON object - */ - DataStoreSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataStoreSource - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataStoreSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.DataStoreSource"; - }; - - return DataStoreSource; - })(); - - DataStoreTool.EngineSource = (function() { - - /** - * Properties of an EngineSource. - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @interface IEngineSource - * @property {string|null} [engine] EngineSource engine - * @property {Array.|null} [dataStoreSources] EngineSource dataStoreSources - * @property {string|null} [filter] EngineSource filter - */ - - /** - * Constructs a new EngineSource. - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @classdesc Represents an EngineSource. - * @implements IEngineSource - * @constructor - * @param {google.cloud.ces.v1beta.DataStoreTool.IEngineSource=} [properties] Properties to set - */ - function EngineSource(properties) { - this.dataStoreSources = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EngineSource engine. - * @member {string} engine - * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource - * @instance - */ - EngineSource.prototype.engine = ""; - - /** - * EngineSource dataStoreSources. - * @member {Array.} dataStoreSources - * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource - * @instance - */ - EngineSource.prototype.dataStoreSources = $util.emptyArray; - - /** - * EngineSource filter. - * @member {string} filter - * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource - * @instance - */ - EngineSource.prototype.filter = ""; - - /** - * Creates a new EngineSource instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IEngineSource=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DataStoreTool.EngineSource} EngineSource instance - */ - EngineSource.create = function create(properties) { - return new EngineSource(properties); - }; - - /** - * Encodes the specified EngineSource message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.EngineSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IEngineSource} message EngineSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EngineSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.engine != null && Object.hasOwnProperty.call(message, "engine")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.engine); - if (message.dataStoreSources != null && message.dataStoreSources.length) - for (var i = 0; i < message.dataStoreSources.length; ++i) - $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.encode(message.dataStoreSources[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); - return writer; - }; - - /** - * Encodes the specified EngineSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.EngineSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IEngineSource} message EngineSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EngineSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EngineSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DataStoreTool.EngineSource} EngineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EngineSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.engine = reader.string(); - break; - } - case 2: { - if (!(message.dataStoreSources && message.dataStoreSources.length)) - message.dataStoreSources = []; - message.dataStoreSources.push($root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.decode(reader, reader.uint32())); - break; - } - case 3: { - message.filter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EngineSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DataStoreTool.EngineSource} EngineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EngineSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EngineSource message. - * @function verify - * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EngineSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.engine != null && message.hasOwnProperty("engine")) - if (!$util.isString(message.engine)) - return "engine: string expected"; - if (message.dataStoreSources != null && message.hasOwnProperty("dataStoreSources")) { - if (!Array.isArray(message.dataStoreSources)) - return "dataStoreSources: array expected"; - for (var i = 0; i < message.dataStoreSources.length; ++i) { - var error = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.verify(message.dataStoreSources[i]); - if (error) - return "dataStoreSources." + error; - } - } - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - return null; - }; - - /** - * Creates an EngineSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DataStoreTool.EngineSource} EngineSource - */ - EngineSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource) - return object; - var message = new $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource(); - if (object.engine != null) - message.engine = String(object.engine); - if (object.dataStoreSources) { - if (!Array.isArray(object.dataStoreSources)) - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.EngineSource.dataStoreSources: array expected"); - message.dataStoreSources = []; - for (var i = 0; i < object.dataStoreSources.length; ++i) { - if (typeof object.dataStoreSources[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.EngineSource.dataStoreSources: object expected"); - message.dataStoreSources[i] = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.fromObject(object.dataStoreSources[i]); - } - } - if (object.filter != null) - message.filter = String(object.filter); - return message; - }; - - /** - * Creates a plain object from an EngineSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.EngineSource} message EngineSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EngineSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.dataStoreSources = []; - if (options.defaults) { - object.engine = ""; - object.filter = ""; - } - if (message.engine != null && message.hasOwnProperty("engine")) - object.engine = message.engine; - if (message.dataStoreSources && message.dataStoreSources.length) { - object.dataStoreSources = []; - for (var j = 0; j < message.dataStoreSources.length; ++j) - object.dataStoreSources[j] = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.toObject(message.dataStoreSources[j], options); - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - return object; - }; - - /** - * Converts this EngineSource to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource - * @instance - * @returns {Object.} JSON object - */ - EngineSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EngineSource - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EngineSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.EngineSource"; - }; - - return EngineSource; - })(); - - DataStoreTool.BoostSpecs = (function() { - - /** - * Properties of a BoostSpecs. - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @interface IBoostSpecs - * @property {Array.|null} [dataStores] BoostSpecs dataStores - * @property {Array.|null} [spec] BoostSpecs spec - */ - - /** - * Constructs a new BoostSpecs. - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @classdesc Represents a BoostSpecs. - * @implements IBoostSpecs - * @constructor - * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs=} [properties] Properties to set - */ - function BoostSpecs(properties) { - this.dataStores = []; - this.spec = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BoostSpecs dataStores. - * @member {Array.} dataStores - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs - * @instance - */ - BoostSpecs.prototype.dataStores = $util.emptyArray; - - /** - * BoostSpecs spec. - * @member {Array.} spec - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs - * @instance - */ - BoostSpecs.prototype.spec = $util.emptyArray; - - /** - * Creates a new BoostSpecs instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpecs} BoostSpecs instance - */ - BoostSpecs.create = function create(properties) { - return new BoostSpecs(properties); - }; - - /** - * Encodes the specified BoostSpecs message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs} message BoostSpecs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostSpecs.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataStores != null && message.dataStores.length) - for (var i = 0; i < message.dataStores.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataStores[i]); - if (message.spec != null && message.spec.length) - for (var i = 0; i < message.spec.length; ++i) - $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.encode(message.spec[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BoostSpecs message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs} message BoostSpecs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostSpecs.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BoostSpecs message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpecs} BoostSpecs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostSpecs.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.dataStores && message.dataStores.length)) - message.dataStores = []; - message.dataStores.push(reader.string()); - break; - } - case 2: { - if (!(message.spec && message.spec.length)) - message.spec = []; - message.spec.push($root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BoostSpecs message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpecs} BoostSpecs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostSpecs.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BoostSpecs message. - * @function verify - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoostSpecs.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataStores != null && message.hasOwnProperty("dataStores")) { - if (!Array.isArray(message.dataStores)) - return "dataStores: array expected"; - for (var i = 0; i < message.dataStores.length; ++i) - if (!$util.isString(message.dataStores[i])) - return "dataStores: string[] expected"; - } - if (message.spec != null && message.hasOwnProperty("spec")) { - if (!Array.isArray(message.spec)) - return "spec: array expected"; - for (var i = 0; i < message.spec.length; ++i) { - var error = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.verify(message.spec[i]); - if (error) - return "spec." + error; - } - } - return null; - }; - - /** - * Creates a BoostSpecs message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpecs} BoostSpecs - */ - BoostSpecs.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs) - return object; - var message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs(); - if (object.dataStores) { - if (!Array.isArray(object.dataStores)) - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.dataStores: array expected"); - message.dataStores = []; - for (var i = 0; i < object.dataStores.length; ++i) - message.dataStores[i] = String(object.dataStores[i]); - } - if (object.spec) { - if (!Array.isArray(object.spec)) - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.spec: array expected"); - message.spec = []; - for (var i = 0; i < object.spec.length; ++i) { - if (typeof object.spec[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.spec: object expected"); - message.spec[i] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.fromObject(object.spec[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BoostSpecs message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpecs} message BoostSpecs - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoostSpecs.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dataStores = []; - object.spec = []; - } - if (message.dataStores && message.dataStores.length) { - object.dataStores = []; - for (var j = 0; j < message.dataStores.length; ++j) - object.dataStores[j] = message.dataStores[j]; - } - if (message.spec && message.spec.length) { - object.spec = []; - for (var j = 0; j < message.spec.length; ++j) - object.spec[j] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.toObject(message.spec[j], options); - } - return object; - }; - - /** - * Converts this BoostSpecs to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs - * @instance - * @returns {Object.} JSON object - */ - BoostSpecs.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BoostSpecs - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BoostSpecs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.BoostSpecs"; - }; - - return BoostSpecs; - })(); - - DataStoreTool.BoostSpec = (function() { - - /** - * Properties of a BoostSpec. - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @interface IBoostSpec - * @property {Array.|null} [conditionBoostSpecs] BoostSpec conditionBoostSpecs - */ - - /** - * Constructs a new BoostSpec. - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @classdesc Represents a BoostSpec. - * @implements IBoostSpec - * @constructor - * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpec=} [properties] Properties to set - */ - function BoostSpec(properties) { - this.conditionBoostSpecs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BoostSpec conditionBoostSpecs. - * @member {Array.} conditionBoostSpecs - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec - * @instance - */ - BoostSpec.prototype.conditionBoostSpecs = $util.emptyArray; - - /** - * Creates a new BoostSpec instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpec=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec} BoostSpec instance - */ - BoostSpec.create = function create(properties) { - return new BoostSpec(properties); - }; - - /** - * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpec} message BoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.conditionBoostSpecs != null && message.conditionBoostSpecs.length) - for (var i = 0; i < message.conditionBoostSpecs.length; ++i) - $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.encode(message.conditionBoostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpec} message BoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BoostSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec} BoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostSpec.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.conditionBoostSpecs && message.conditionBoostSpecs.length)) - message.conditionBoostSpecs = []; - message.conditionBoostSpecs.push($root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BoostSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec} BoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BoostSpec message. - * @function verify - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoostSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.conditionBoostSpecs != null && message.hasOwnProperty("conditionBoostSpecs")) { - if (!Array.isArray(message.conditionBoostSpecs)) - return "conditionBoostSpecs: array expected"; - for (var i = 0; i < message.conditionBoostSpecs.length; ++i) { - var error = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.verify(message.conditionBoostSpecs[i]); - if (error) - return "conditionBoostSpecs." + error; - } - } - return null; - }; - - /** - * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec} BoostSpec - */ - BoostSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec) - return object; - var message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec(); - if (object.conditionBoostSpecs) { - if (!Array.isArray(object.conditionBoostSpecs)) - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpec.conditionBoostSpecs: array expected"); - message.conditionBoostSpecs = []; - for (var i = 0; i < object.conditionBoostSpecs.length; ++i) { - if (typeof object.conditionBoostSpecs[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpec.conditionBoostSpecs: object expected"); - message.conditionBoostSpecs[i] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.fromObject(object.conditionBoostSpecs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec} message BoostSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoostSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.conditionBoostSpecs = []; - if (message.conditionBoostSpecs && message.conditionBoostSpecs.length) { - object.conditionBoostSpecs = []; - for (var j = 0; j < message.conditionBoostSpecs.length; ++j) - object.conditionBoostSpecs[j] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.toObject(message.conditionBoostSpecs[j], options); - } - return object; - }; - - /** - * Converts this BoostSpec to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec - * @instance - * @returns {Object.} JSON object - */ - BoostSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BoostSpec - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.BoostSpec"; - }; - - BoostSpec.ConditionBoostSpec = (function() { - - /** - * Properties of a ConditionBoostSpec. - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec - * @interface IConditionBoostSpec - * @property {string|null} [condition] ConditionBoostSpec condition - * @property {number|null} [boost] ConditionBoostSpec boost - * @property {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null} [boostControlSpec] ConditionBoostSpec boostControlSpec - */ - - /** - * Constructs a new ConditionBoostSpec. - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec - * @classdesc Represents a ConditionBoostSpec. - * @implements IConditionBoostSpec - * @constructor - * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec=} [properties] Properties to set - */ - function ConditionBoostSpec(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConditionBoostSpec condition. - * @member {string} condition - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec - * @instance - */ - ConditionBoostSpec.prototype.condition = ""; - - /** - * ConditionBoostSpec boost. - * @member {number} boost - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec - * @instance - */ - ConditionBoostSpec.prototype.boost = 0; - - /** - * ConditionBoostSpec boostControlSpec. - * @member {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null|undefined} boostControlSpec - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec - * @instance - */ - ConditionBoostSpec.prototype.boostControlSpec = null; - - /** - * Creates a new ConditionBoostSpec instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec instance - */ - ConditionBoostSpec.create = function create(properties) { - return new ConditionBoostSpec(properties); - }; - - /** - * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConditionBoostSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); - if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); - if (message.boostControlSpec != null && Object.hasOwnProperty.call(message, "boostControlSpec")) - $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.encode(message.boostControlSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConditionBoostSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConditionBoostSpec.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.condition = reader.string(); - break; - } - case 2: { - message.boost = reader.float(); - break; - } - case 4: { - message.boostControlSpec = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConditionBoostSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConditionBoostSpec message. - * @function verify - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConditionBoostSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.condition != null && message.hasOwnProperty("condition")) - if (!$util.isString(message.condition)) - return "condition: string expected"; - if (message.boost != null && message.hasOwnProperty("boost")) - if (typeof message.boost !== "number") - return "boost: number expected"; - if (message.boostControlSpec != null && message.hasOwnProperty("boostControlSpec")) { - var error = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify(message.boostControlSpec); - if (error) - return "boostControlSpec." + error; - } - return null; - }; - - /** - * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec - */ - ConditionBoostSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec) - return object; - var message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec(); - if (object.condition != null) - message.condition = String(object.condition); - if (object.boost != null) - message.boost = Number(object.boost); - if (object.boostControlSpec != null) { - if (typeof object.boostControlSpec !== "object") - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.boostControlSpec: object expected"); - message.boostControlSpec = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.fromObject(object.boostControlSpec); - } - return message; - }; - - /** - * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec} message ConditionBoostSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConditionBoostSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.condition = ""; - object.boost = 0; - object.boostControlSpec = null; - } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = message.condition; - if (message.boost != null && message.hasOwnProperty("boost")) - object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; - if (message.boostControlSpec != null && message.hasOwnProperty("boostControlSpec")) - object.boostControlSpec = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.toObject(message.boostControlSpec, options); - return object; - }; - - /** - * Converts this ConditionBoostSpec to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec - * @instance - * @returns {Object.} JSON object - */ - ConditionBoostSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConditionBoostSpec - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConditionBoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec"; - }; - - ConditionBoostSpec.BoostControlSpec = (function() { - - /** - * Properties of a BoostControlSpec. - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec - * @interface IBoostControlSpec - * @property {string|null} [fieldName] BoostControlSpec fieldName - * @property {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|null} [attributeType] BoostControlSpec attributeType - * @property {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|null} [interpolationType] BoostControlSpec interpolationType - * @property {Array.|null} [controlPoints] BoostControlSpec controlPoints - */ - - /** - * Constructs a new BoostControlSpec. - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec - * @classdesc Represents a BoostControlSpec. - * @implements IBoostControlSpec - * @constructor - * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec=} [properties] Properties to set - */ - function BoostControlSpec(properties) { - this.controlPoints = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BoostControlSpec fieldName. - * @member {string} fieldName - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @instance - */ - BoostControlSpec.prototype.fieldName = ""; - - /** - * BoostControlSpec attributeType. - * @member {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType} attributeType - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @instance - */ - BoostControlSpec.prototype.attributeType = 0; - - /** - * BoostControlSpec interpolationType. - * @member {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType} interpolationType - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @instance - */ - BoostControlSpec.prototype.interpolationType = 0; - - /** - * BoostControlSpec controlPoints. - * @member {Array.} controlPoints - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @instance - */ - BoostControlSpec.prototype.controlPoints = $util.emptyArray; - - /** - * Creates a new BoostControlSpec instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec instance - */ - BoostControlSpec.create = function create(properties) { - return new BoostControlSpec(properties); - }; - - /** - * Encodes the specified BoostControlSpec message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec} message BoostControlSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostControlSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldName); - if (message.attributeType != null && Object.hasOwnProperty.call(message, "attributeType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.attributeType); - if (message.interpolationType != null && Object.hasOwnProperty.call(message, "interpolationType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.interpolationType); - if (message.controlPoints != null && message.controlPoints.length) - for (var i = 0; i < message.controlPoints.length; ++i) - $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.encode(message.controlPoints[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BoostControlSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec} message BoostControlSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoostControlSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BoostControlSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostControlSpec.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fieldName = reader.string(); - break; - } - case 2: { - message.attributeType = reader.int32(); - break; - } - case 3: { - message.interpolationType = reader.int32(); - break; - } - case 4: { - if (!(message.controlPoints && message.controlPoints.length)) - message.controlPoints = []; - message.controlPoints.push($root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BoostControlSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoostControlSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BoostControlSpec message. - * @function verify - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoostControlSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldName != null && message.hasOwnProperty("fieldName")) - if (!$util.isString(message.fieldName)) - return "fieldName: string expected"; - if (message.attributeType != null && message.hasOwnProperty("attributeType")) - switch (message.attributeType) { - default: - return "attributeType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.interpolationType != null && message.hasOwnProperty("interpolationType")) - switch (message.interpolationType) { - default: - return "interpolationType: enum value expected"; - case 0: - case 1: - break; - } - if (message.controlPoints != null && message.hasOwnProperty("controlPoints")) { - if (!Array.isArray(message.controlPoints)) - return "controlPoints: array expected"; - for (var i = 0; i < message.controlPoints.length; ++i) { - var error = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify(message.controlPoints[i]); - if (error) - return "controlPoints." + error; - } - } - return null; - }; - - /** - * Creates a BoostControlSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec - */ - BoostControlSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec) - return object; - var message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec(); - if (object.fieldName != null) - message.fieldName = String(object.fieldName); - switch (object.attributeType) { - default: - if (typeof object.attributeType === "number") { - message.attributeType = object.attributeType; - break; - } - break; - case "ATTRIBUTE_TYPE_UNSPECIFIED": - case 0: - message.attributeType = 0; - break; - case "NUMERICAL": - case 1: - message.attributeType = 1; - break; - case "FRESHNESS": - case 2: - message.attributeType = 2; - break; - } - switch (object.interpolationType) { - default: - if (typeof object.interpolationType === "number") { - message.interpolationType = object.interpolationType; - break; - } - break; - case "INTERPOLATION_TYPE_UNSPECIFIED": - case 0: - message.interpolationType = 0; - break; - case "LINEAR": - case 1: - message.interpolationType = 1; - break; - } - if (object.controlPoints) { - if (!Array.isArray(object.controlPoints)) - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.controlPoints: array expected"); - message.controlPoints = []; - for (var i = 0; i < object.controlPoints.length; ++i) { - if (typeof object.controlPoints[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.controlPoints: object expected"); - message.controlPoints[i] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.fromObject(object.controlPoints[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BoostControlSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} message BoostControlSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoostControlSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.controlPoints = []; - if (options.defaults) { - object.fieldName = ""; - object.attributeType = options.enums === String ? "ATTRIBUTE_TYPE_UNSPECIFIED" : 0; - object.interpolationType = options.enums === String ? "INTERPOLATION_TYPE_UNSPECIFIED" : 0; - } - if (message.fieldName != null && message.hasOwnProperty("fieldName")) - object.fieldName = message.fieldName; - if (message.attributeType != null && message.hasOwnProperty("attributeType")) - object.attributeType = options.enums === String ? $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType[message.attributeType] === undefined ? message.attributeType : $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType[message.attributeType] : message.attributeType; - if (message.interpolationType != null && message.hasOwnProperty("interpolationType")) - object.interpolationType = options.enums === String ? $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType[message.interpolationType] === undefined ? message.interpolationType : $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType[message.interpolationType] : message.interpolationType; - if (message.controlPoints && message.controlPoints.length) { - object.controlPoints = []; - for (var j = 0; j < message.controlPoints.length; ++j) - object.controlPoints[j] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.toObject(message.controlPoints[j], options); - } - return object; - }; - - /** - * Converts this BoostControlSpec to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @instance - * @returns {Object.} JSON object - */ - BoostControlSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BoostControlSpec - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BoostControlSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec"; - }; - - BoostControlSpec.ControlPoint = (function() { - - /** - * Properties of a ControlPoint. - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @interface IControlPoint - * @property {string|null} [attributeValue] ControlPoint attributeValue - * @property {number|null} [boostAmount] ControlPoint boostAmount - */ - - /** - * Constructs a new ControlPoint. - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec - * @classdesc Represents a ControlPoint. - * @implements IControlPoint - * @constructor - * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint=} [properties] Properties to set - */ - function ControlPoint(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ControlPoint attributeValue. - * @member {string} attributeValue - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @instance - */ - ControlPoint.prototype.attributeValue = ""; - - /** - * ControlPoint boostAmount. - * @member {number} boostAmount - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @instance - */ - ControlPoint.prototype.boostAmount = 0; - - /** - * Creates a new ControlPoint instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint instance - */ - ControlPoint.create = function create(properties) { - return new ControlPoint(properties); - }; - - /** - * Encodes the specified ControlPoint message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint} message ControlPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ControlPoint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.attributeValue != null && Object.hasOwnProperty.call(message, "attributeValue")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributeValue); - if (message.boostAmount != null && Object.hasOwnProperty.call(message, "boostAmount")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.boostAmount); - return writer; - }; - - /** - * Encodes the specified ControlPoint message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint} message ControlPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ControlPoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ControlPoint message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ControlPoint.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.attributeValue = reader.string(); - break; - } - case 2: { - message.boostAmount = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ControlPoint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ControlPoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ControlPoint message. - * @function verify - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ControlPoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.attributeValue != null && message.hasOwnProperty("attributeValue")) - if (!$util.isString(message.attributeValue)) - return "attributeValue: string expected"; - if (message.boostAmount != null && message.hasOwnProperty("boostAmount")) - if (typeof message.boostAmount !== "number") - return "boostAmount: number expected"; - return null; - }; - - /** - * Creates a ControlPoint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint - */ - ControlPoint.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint) - return object; - var message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint(); - if (object.attributeValue != null) - message.attributeValue = String(object.attributeValue); - if (object.boostAmount != null) - message.boostAmount = Number(object.boostAmount); - return message; - }; - - /** - * Creates a plain object from a ControlPoint message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} message ControlPoint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ControlPoint.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.attributeValue = ""; - object.boostAmount = 0; - } - if (message.attributeValue != null && message.hasOwnProperty("attributeValue")) - object.attributeValue = message.attributeValue; - if (message.boostAmount != null && message.hasOwnProperty("boostAmount")) - object.boostAmount = options.json && !isFinite(message.boostAmount) ? String(message.boostAmount) : message.boostAmount; - return object; - }; - - /** - * Converts this ControlPoint to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @instance - * @returns {Object.} JSON object - */ - ControlPoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ControlPoint - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ControlPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint"; - }; - - return ControlPoint; - })(); - - /** - * AttributeType enum. - * @name google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType - * @enum {number} - * @property {number} ATTRIBUTE_TYPE_UNSPECIFIED=0 ATTRIBUTE_TYPE_UNSPECIFIED value - * @property {number} NUMERICAL=1 NUMERICAL value - * @property {number} FRESHNESS=2 FRESHNESS value - */ - BoostControlSpec.AttributeType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ATTRIBUTE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NUMERICAL"] = 1; - values[valuesById[2] = "FRESHNESS"] = 2; - return values; - })(); - - /** - * InterpolationType enum. - * @name google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType - * @enum {number} - * @property {number} INTERPOLATION_TYPE_UNSPECIFIED=0 INTERPOLATION_TYPE_UNSPECIFIED value - * @property {number} LINEAR=1 LINEAR value - */ - BoostControlSpec.InterpolationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INTERPOLATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "LINEAR"] = 1; - return values; - })(); - - return BoostControlSpec; - })(); - - return ConditionBoostSpec; - })(); - - return BoostSpec; - })(); - - DataStoreTool.ModalityConfig = (function() { - - /** - * Properties of a ModalityConfig. - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @interface IModalityConfig - * @property {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType|null} [modalityType] ModalityConfig modalityType - * @property {google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig|null} [rewriterConfig] ModalityConfig rewriterConfig - * @property {google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig|null} [summarizationConfig] ModalityConfig summarizationConfig - * @property {google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig|null} [groundingConfig] ModalityConfig groundingConfig - */ - - /** - * Constructs a new ModalityConfig. - * @memberof google.cloud.ces.v1beta.DataStoreTool - * @classdesc Represents a ModalityConfig. - * @implements IModalityConfig - * @constructor - * @param {google.cloud.ces.v1beta.DataStoreTool.IModalityConfig=} [properties] Properties to set - */ - function ModalityConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ModalityConfig modalityType. - * @member {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType} modalityType - * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig - * @instance - */ - ModalityConfig.prototype.modalityType = 0; - - /** - * ModalityConfig rewriterConfig. - * @member {google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig|null|undefined} rewriterConfig - * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig - * @instance - */ - ModalityConfig.prototype.rewriterConfig = null; - - /** - * ModalityConfig summarizationConfig. - * @member {google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig|null|undefined} summarizationConfig - * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig - * @instance - */ - ModalityConfig.prototype.summarizationConfig = null; - - /** - * ModalityConfig groundingConfig. - * @member {google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig|null|undefined} groundingConfig - * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig - * @instance - */ - ModalityConfig.prototype.groundingConfig = null; - - /** - * Creates a new ModalityConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IModalityConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig} ModalityConfig instance - */ - ModalityConfig.create = function create(properties) { - return new ModalityConfig(properties); - }; - - /** - * Encodes the specified ModalityConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IModalityConfig} message ModalityConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModalityConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.modalityType != null && Object.hasOwnProperty.call(message, "modalityType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modalityType); - if (message.rewriterConfig != null && Object.hasOwnProperty.call(message, "rewriterConfig")) - $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.encode(message.rewriterConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.summarizationConfig != null && Object.hasOwnProperty.call(message, "summarizationConfig")) - $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.encode(message.summarizationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.groundingConfig != null && Object.hasOwnProperty.call(message, "groundingConfig")) - $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.encode(message.groundingConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ModalityConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.IModalityConfig} message ModalityConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModalityConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ModalityConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig} ModalityConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModalityConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.modalityType = reader.int32(); - break; - } - case 2: { - message.rewriterConfig = $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.summarizationConfig = $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.groundingConfig = $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ModalityConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig} ModalityConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModalityConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ModalityConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ModalityConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.modalityType != null && message.hasOwnProperty("modalityType")) - switch (message.modalityType) { - default: - return "modalityType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.rewriterConfig != null && message.hasOwnProperty("rewriterConfig")) { - var error = $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.verify(message.rewriterConfig); - if (error) - return "rewriterConfig." + error; - } - if (message.summarizationConfig != null && message.hasOwnProperty("summarizationConfig")) { - var error = $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.verify(message.summarizationConfig); - if (error) - return "summarizationConfig." + error; - } - if (message.groundingConfig != null && message.hasOwnProperty("groundingConfig")) { - var error = $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.verify(message.groundingConfig); - if (error) - return "groundingConfig." + error; - } - return null; - }; - - /** - * Creates a ModalityConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig} ModalityConfig - */ - ModalityConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig(); - switch (object.modalityType) { - default: - if (typeof object.modalityType === "number") { - message.modalityType = object.modalityType; - break; - } - break; - case "MODALITY_TYPE_UNSPECIFIED": - case 0: - message.modalityType = 0; - break; - case "TEXT": - case 1: - message.modalityType = 1; - break; - case "AUDIO": - case 2: - message.modalityType = 2; - break; - } - if (object.rewriterConfig != null) { - if (typeof object.rewriterConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.rewriterConfig: object expected"); - message.rewriterConfig = $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.fromObject(object.rewriterConfig); - } - if (object.summarizationConfig != null) { - if (typeof object.summarizationConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.summarizationConfig: object expected"); - message.summarizationConfig = $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.fromObject(object.summarizationConfig); - } - if (object.groundingConfig != null) { - if (typeof object.groundingConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.groundingConfig: object expected"); - message.groundingConfig = $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.fromObject(object.groundingConfig); - } - return message; - }; - - /** - * Creates a plain object from a ModalityConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig - * @static - * @param {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig} message ModalityConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ModalityConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.modalityType = options.enums === String ? "MODALITY_TYPE_UNSPECIFIED" : 0; - object.rewriterConfig = null; - object.summarizationConfig = null; - object.groundingConfig = null; - } - if (message.modalityType != null && message.hasOwnProperty("modalityType")) - object.modalityType = options.enums === String ? $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType[message.modalityType] === undefined ? message.modalityType : $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType[message.modalityType] : message.modalityType; - if (message.rewriterConfig != null && message.hasOwnProperty("rewriterConfig")) - object.rewriterConfig = $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.toObject(message.rewriterConfig, options); - if (message.summarizationConfig != null && message.hasOwnProperty("summarizationConfig")) - object.summarizationConfig = $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.toObject(message.summarizationConfig, options); - if (message.groundingConfig != null && message.hasOwnProperty("groundingConfig")) - object.groundingConfig = $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.toObject(message.groundingConfig, options); - return object; - }; - - /** - * Converts this ModalityConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig - * @instance - * @returns {Object.} JSON object - */ - ModalityConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ModalityConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ModalityConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.ModalityConfig"; - }; - - /** - * ModalityType enum. - * @name google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType - * @enum {number} - * @property {number} MODALITY_TYPE_UNSPECIFIED=0 MODALITY_TYPE_UNSPECIFIED value - * @property {number} TEXT=1 TEXT value - * @property {number} AUDIO=2 AUDIO value - */ - ModalityConfig.ModalityType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODALITY_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "TEXT"] = 1; - values[valuesById[2] = "AUDIO"] = 2; - return values; - })(); - - return ModalityConfig; - })(); - - /** - * FilterParameterBehavior enum. - * @name google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior - * @enum {number} - * @property {number} FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED=0 FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED value - * @property {number} ALWAYS_INCLUDE=2 ALWAYS_INCLUDE value - * @property {number} NEVER_INCLUDE=3 NEVER_INCLUDE value - */ - DataStoreTool.FilterParameterBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[2] = "ALWAYS_INCLUDE"] = 2; - values[valuesById[3] = "NEVER_INCLUDE"] = 3; - return values; - })(); - - return DataStoreTool; - })(); - - v1beta.DataStore = (function() { - - /** - * Properties of a DataStore. - * @memberof google.cloud.ces.v1beta - * @interface IDataStore - * @property {string|null} [name] DataStore name - * @property {google.cloud.ces.v1beta.DataStore.DataStoreType|null} [type] DataStore type - * @property {google.cloud.ces.v1beta.DataStore.DocumentProcessingMode|null} [documentProcessingMode] DataStore documentProcessingMode - * @property {string|null} [displayName] DataStore displayName - * @property {google.protobuf.ITimestamp|null} [createTime] DataStore createTime - * @property {google.cloud.ces.v1beta.DataStore.IConnectorConfig|null} [connectorConfig] DataStore connectorConfig - */ - - /** - * Constructs a new DataStore. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DataStore. - * @implements IDataStore - * @constructor - * @param {google.cloud.ces.v1beta.IDataStore=} [properties] Properties to set - */ - function DataStore(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataStore name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.DataStore - * @instance - */ - DataStore.prototype.name = ""; - - /** - * DataStore type. - * @member {google.cloud.ces.v1beta.DataStore.DataStoreType} type - * @memberof google.cloud.ces.v1beta.DataStore - * @instance - */ - DataStore.prototype.type = 0; - - /** - * DataStore documentProcessingMode. - * @member {google.cloud.ces.v1beta.DataStore.DocumentProcessingMode} documentProcessingMode - * @memberof google.cloud.ces.v1beta.DataStore - * @instance - */ - DataStore.prototype.documentProcessingMode = 0; - - /** - * DataStore displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.DataStore - * @instance - */ - DataStore.prototype.displayName = ""; - - /** - * DataStore createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.DataStore - * @instance - */ - DataStore.prototype.createTime = null; - - /** - * DataStore connectorConfig. - * @member {google.cloud.ces.v1beta.DataStore.IConnectorConfig|null|undefined} connectorConfig - * @memberof google.cloud.ces.v1beta.DataStore - * @instance - */ - DataStore.prototype.connectorConfig = null; - - /** - * Creates a new DataStore instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DataStore - * @static - * @param {google.cloud.ces.v1beta.IDataStore=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DataStore} DataStore instance - */ - DataStore.create = function create(properties) { - return new DataStore(properties); - }; - - /** - * Encodes the specified DataStore message. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DataStore - * @static - * @param {google.cloud.ces.v1beta.IDataStore} message DataStore message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataStore.encode = function encode(message, writer) { - if (!writer) - 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 0 =*/16).int32(message.type); - if (message.documentProcessingMode != null && Object.hasOwnProperty.call(message, "documentProcessingMode")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.documentProcessingMode); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.connectorConfig != null && Object.hasOwnProperty.call(message, "connectorConfig")) - $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig.encode(message.connectorConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataStore message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DataStore - * @static - * @param {google.cloud.ces.v1beta.IDataStore} message DataStore message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataStore.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataStore message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DataStore - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DataStore} DataStore - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataStore.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStore(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.type = reader.int32(); - break; - } - case 4: { - message.documentProcessingMode = reader.int32(); - break; - } - case 5: { - message.displayName = reader.string(); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.connectorConfig = $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataStore message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DataStore - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DataStore} DataStore - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataStore.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataStore message. - * @function verify - * @memberof google.cloud.ces.v1beta.DataStore - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataStore.verify = function verify(message) { - if (typeof message !== "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")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.documentProcessingMode != null && message.hasOwnProperty("documentProcessingMode")) - switch (message.documentProcessingMode) { - default: - return "documentProcessingMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: 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.connectorConfig != null && message.hasOwnProperty("connectorConfig")) { - var error = $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig.verify(message.connectorConfig); - if (error) - return "connectorConfig." + error; - } - return null; - }; - - /** - * Creates a DataStore message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DataStore - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DataStore} DataStore - */ - DataStore.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DataStore) - return object; - var message = new $root.google.cloud.ces.v1beta.DataStore(); - if (object.name != null) - message.name = String(object.name); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "DATA_STORE_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "PUBLIC_WEB": - case 1: - message.type = 1; - break; - case "UNSTRUCTURED": - case 2: - message.type = 2; - break; - case "FAQ": - case 3: - message.type = 3; - break; - case "CONNECTOR": - case 4: - message.type = 4; - break; - } - switch (object.documentProcessingMode) { - default: - if (typeof object.documentProcessingMode === "number") { - message.documentProcessingMode = object.documentProcessingMode; - break; - } - break; - case "DOCUMENT_PROCESSING_MODE_UNSPECIFIED": - case 0: - message.documentProcessingMode = 0; - break; - case "DOCUMENTS": - case 1: - message.documentProcessingMode = 1; - break; - case "CHUNKS": - case 2: - message.documentProcessingMode = 2; - break; - } - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.DataStore.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.connectorConfig != null) { - if (typeof object.connectorConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.DataStore.connectorConfig: object expected"); - message.connectorConfig = $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig.fromObject(object.connectorConfig); - } - return message; - }; - - /** - * Creates a plain object from a DataStore message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DataStore - * @static - * @param {google.cloud.ces.v1beta.DataStore} message DataStore - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataStore.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.type = options.enums === String ? "DATA_STORE_TYPE_UNSPECIFIED" : 0; - object.documentProcessingMode = options.enums === String ? "DOCUMENT_PROCESSING_MODE_UNSPECIFIED" : 0; - object.displayName = ""; - object.createTime = null; - object.connectorConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.ces.v1beta.DataStore.DataStoreType[message.type] === undefined ? message.type : $root.google.cloud.ces.v1beta.DataStore.DataStoreType[message.type] : message.type; - if (message.documentProcessingMode != null && message.hasOwnProperty("documentProcessingMode")) - object.documentProcessingMode = options.enums === String ? $root.google.cloud.ces.v1beta.DataStore.DocumentProcessingMode[message.documentProcessingMode] === undefined ? message.documentProcessingMode : $root.google.cloud.ces.v1beta.DataStore.DocumentProcessingMode[message.documentProcessingMode] : message.documentProcessingMode; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.connectorConfig != null && message.hasOwnProperty("connectorConfig")) - object.connectorConfig = $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig.toObject(message.connectorConfig, options); - return object; - }; - - /** - * Converts this DataStore to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DataStore - * @instance - * @returns {Object.} JSON object - */ - DataStore.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataStore - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DataStore - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataStore.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStore"; - }; - - DataStore.ConnectorConfig = (function() { - - /** - * Properties of a ConnectorConfig. - * @memberof google.cloud.ces.v1beta.DataStore - * @interface IConnectorConfig - * @property {string|null} [collection] ConnectorConfig collection - * @property {string|null} [collectionDisplayName] ConnectorConfig collectionDisplayName - * @property {string|null} [dataSource] ConnectorConfig dataSource - */ - - /** - * Constructs a new ConnectorConfig. - * @memberof google.cloud.ces.v1beta.DataStore - * @classdesc Represents a ConnectorConfig. - * @implements IConnectorConfig - * @constructor - * @param {google.cloud.ces.v1beta.DataStore.IConnectorConfig=} [properties] Properties to set - */ - function ConnectorConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectorConfig collection. - * @member {string} collection - * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig - * @instance - */ - ConnectorConfig.prototype.collection = ""; - - /** - * ConnectorConfig collectionDisplayName. - * @member {string} collectionDisplayName - * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig - * @instance - */ - ConnectorConfig.prototype.collectionDisplayName = ""; - - /** - * ConnectorConfig dataSource. - * @member {string} dataSource - * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig - * @instance - */ - ConnectorConfig.prototype.dataSource = ""; - - /** - * Creates a new ConnectorConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig - * @static - * @param {google.cloud.ces.v1beta.DataStore.IConnectorConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DataStore.ConnectorConfig} ConnectorConfig instance - */ - ConnectorConfig.create = function create(properties) { - return new ConnectorConfig(properties); - }; - - /** - * Encodes the specified ConnectorConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.ConnectorConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig - * @static - * @param {google.cloud.ces.v1beta.DataStore.IConnectorConfig} message ConnectorConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectorConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.collection != null && Object.hasOwnProperty.call(message, "collection")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.collection); - if (message.collectionDisplayName != null && Object.hasOwnProperty.call(message, "collectionDisplayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.collectionDisplayName); - if (message.dataSource != null && Object.hasOwnProperty.call(message, "dataSource")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dataSource); - return writer; - }; - - /** - * Encodes the specified ConnectorConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.ConnectorConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig - * @static - * @param {google.cloud.ces.v1beta.DataStore.IConnectorConfig} message ConnectorConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectorConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectorConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DataStore.ConnectorConfig} ConnectorConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectorConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.collection = reader.string(); - break; - } - case 2: { - message.collectionDisplayName = reader.string(); - break; - } - case 3: { - message.dataSource = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectorConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DataStore.ConnectorConfig} ConnectorConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectorConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectorConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectorConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.collection != null && message.hasOwnProperty("collection")) - if (!$util.isString(message.collection)) - return "collection: string expected"; - if (message.collectionDisplayName != null && message.hasOwnProperty("collectionDisplayName")) - if (!$util.isString(message.collectionDisplayName)) - return "collectionDisplayName: string expected"; - if (message.dataSource != null && message.hasOwnProperty("dataSource")) - if (!$util.isString(message.dataSource)) - return "dataSource: string expected"; - return null; - }; - - /** - * Creates a ConnectorConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DataStore.ConnectorConfig} ConnectorConfig - */ - ConnectorConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig(); - if (object.collection != null) - message.collection = String(object.collection); - if (object.collectionDisplayName != null) - message.collectionDisplayName = String(object.collectionDisplayName); - if (object.dataSource != null) - message.dataSource = String(object.dataSource); - return message; - }; - - /** - * Creates a plain object from a ConnectorConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig - * @static - * @param {google.cloud.ces.v1beta.DataStore.ConnectorConfig} message ConnectorConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectorConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.collection = ""; - object.collectionDisplayName = ""; - object.dataSource = ""; - } - if (message.collection != null && message.hasOwnProperty("collection")) - object.collection = message.collection; - if (message.collectionDisplayName != null && message.hasOwnProperty("collectionDisplayName")) - object.collectionDisplayName = message.collectionDisplayName; - if (message.dataSource != null && message.hasOwnProperty("dataSource")) - object.dataSource = message.dataSource; - return object; - }; - - /** - * Converts this ConnectorConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig - * @instance - * @returns {Object.} JSON object - */ - ConnectorConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConnectorConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConnectorConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStore.ConnectorConfig"; - }; - - return ConnectorConfig; - })(); - - /** - * DataStoreType enum. - * @name google.cloud.ces.v1beta.DataStore.DataStoreType - * @enum {number} - * @property {number} DATA_STORE_TYPE_UNSPECIFIED=0 DATA_STORE_TYPE_UNSPECIFIED value - * @property {number} PUBLIC_WEB=1 PUBLIC_WEB value - * @property {number} UNSTRUCTURED=2 UNSTRUCTURED value - * @property {number} FAQ=3 FAQ value - * @property {number} CONNECTOR=4 CONNECTOR value - */ - DataStore.DataStoreType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATA_STORE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PUBLIC_WEB"] = 1; - values[valuesById[2] = "UNSTRUCTURED"] = 2; - values[valuesById[3] = "FAQ"] = 3; - values[valuesById[4] = "CONNECTOR"] = 4; - return values; - })(); - - /** - * DocumentProcessingMode enum. - * @name google.cloud.ces.v1beta.DataStore.DocumentProcessingMode - * @enum {number} - * @property {number} DOCUMENT_PROCESSING_MODE_UNSPECIFIED=0 DOCUMENT_PROCESSING_MODE_UNSPECIFIED value - * @property {number} DOCUMENTS=1 DOCUMENTS value - * @property {number} CHUNKS=2 CHUNKS value - */ - DataStore.DocumentProcessingMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DOCUMENT_PROCESSING_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DOCUMENTS"] = 1; - values[valuesById[2] = "CHUNKS"] = 2; - return values; - })(); - - return DataStore; - })(); - - v1beta.FileSearchTool = (function() { - - /** - * Properties of a FileSearchTool. - * @memberof google.cloud.ces.v1beta - * @interface IFileSearchTool - * @property {google.cloud.ces.v1beta.FileSearchTool.CorpusType|null} [corpusType] FileSearchTool corpusType - * @property {string|null} [name] FileSearchTool name - * @property {string|null} [description] FileSearchTool description - * @property {string|null} [fileCorpus] FileSearchTool fileCorpus - */ - - /** - * Constructs a new FileSearchTool. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a FileSearchTool. - * @implements IFileSearchTool - * @constructor - * @param {google.cloud.ces.v1beta.IFileSearchTool=} [properties] Properties to set - */ - function FileSearchTool(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileSearchTool corpusType. - * @member {google.cloud.ces.v1beta.FileSearchTool.CorpusType} corpusType - * @memberof google.cloud.ces.v1beta.FileSearchTool - * @instance - */ - FileSearchTool.prototype.corpusType = 0; - - /** - * FileSearchTool name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.FileSearchTool - * @instance - */ - FileSearchTool.prototype.name = ""; - - /** - * FileSearchTool description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.FileSearchTool - * @instance - */ - FileSearchTool.prototype.description = ""; - - /** - * FileSearchTool fileCorpus. - * @member {string} fileCorpus - * @memberof google.cloud.ces.v1beta.FileSearchTool - * @instance - */ - FileSearchTool.prototype.fileCorpus = ""; - - /** - * Creates a new FileSearchTool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.FileSearchTool - * @static - * @param {google.cloud.ces.v1beta.IFileSearchTool=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.FileSearchTool} FileSearchTool instance - */ - FileSearchTool.create = function create(properties) { - return new FileSearchTool(properties); - }; - - /** - * Encodes the specified FileSearchTool message. Does not implicitly {@link google.cloud.ces.v1beta.FileSearchTool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.FileSearchTool - * @static - * @param {google.cloud.ces.v1beta.IFileSearchTool} message FileSearchTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileSearchTool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.corpusType != null && Object.hasOwnProperty.call(message, "corpusType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.corpusType); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); - if (message.fileCorpus != null && Object.hasOwnProperty.call(message, "fileCorpus")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.fileCorpus); - return writer; - }; - - /** - * Encodes the specified FileSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.FileSearchTool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.FileSearchTool - * @static - * @param {google.cloud.ces.v1beta.IFileSearchTool} message FileSearchTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileSearchTool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileSearchTool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.FileSearchTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.FileSearchTool} FileSearchTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileSearchTool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.FileSearchTool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.corpusType = reader.int32(); - break; - } - case 4: { - message.name = reader.string(); - break; - } - case 5: { - message.description = reader.string(); - break; - } - case 6: { - message.fileCorpus = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileSearchTool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.FileSearchTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.FileSearchTool} FileSearchTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileSearchTool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileSearchTool message. - * @function verify - * @memberof google.cloud.ces.v1beta.FileSearchTool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileSearchTool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.corpusType != null && message.hasOwnProperty("corpusType")) - switch (message.corpusType) { - default: - return "corpusType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.fileCorpus != null && message.hasOwnProperty("fileCorpus")) - if (!$util.isString(message.fileCorpus)) - return "fileCorpus: string expected"; - return null; - }; - - /** - * Creates a FileSearchTool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.FileSearchTool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.FileSearchTool} FileSearchTool - */ - FileSearchTool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.FileSearchTool) - return object; - var message = new $root.google.cloud.ces.v1beta.FileSearchTool(); - switch (object.corpusType) { - default: - if (typeof object.corpusType === "number") { - message.corpusType = object.corpusType; - break; - } - break; - case "CORPUS_TYPE_UNSPECIFIED": - case 0: - message.corpusType = 0; - break; - case "USER_OWNED": - case 1: - message.corpusType = 1; - break; - case "FULLY_MANAGED": - case 2: - message.corpusType = 2; - break; - } - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.fileCorpus != null) - message.fileCorpus = String(object.fileCorpus); - return message; - }; - - /** - * Creates a plain object from a FileSearchTool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.FileSearchTool - * @static - * @param {google.cloud.ces.v1beta.FileSearchTool} message FileSearchTool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileSearchTool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.corpusType = options.enums === String ? "CORPUS_TYPE_UNSPECIFIED" : 0; - object.name = ""; - object.description = ""; - object.fileCorpus = ""; - } - if (message.corpusType != null && message.hasOwnProperty("corpusType")) - object.corpusType = options.enums === String ? $root.google.cloud.ces.v1beta.FileSearchTool.CorpusType[message.corpusType] === undefined ? message.corpusType : $root.google.cloud.ces.v1beta.FileSearchTool.CorpusType[message.corpusType] : message.corpusType; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.fileCorpus != null && message.hasOwnProperty("fileCorpus")) - object.fileCorpus = message.fileCorpus; - return object; - }; - - /** - * Converts this FileSearchTool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.FileSearchTool - * @instance - * @returns {Object.} JSON object - */ - FileSearchTool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileSearchTool - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.FileSearchTool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileSearchTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.FileSearchTool"; - }; - - /** - * CorpusType enum. - * @name google.cloud.ces.v1beta.FileSearchTool.CorpusType - * @enum {number} - * @property {number} CORPUS_TYPE_UNSPECIFIED=0 CORPUS_TYPE_UNSPECIFIED value - * @property {number} USER_OWNED=1 USER_OWNED value - * @property {number} FULLY_MANAGED=2 FULLY_MANAGED value - */ - FileSearchTool.CorpusType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CORPUS_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "USER_OWNED"] = 1; - values[valuesById[2] = "FULLY_MANAGED"] = 2; - return values; - })(); - - return FileSearchTool; - })(); - - v1beta.GoogleSearchTool = (function() { - - /** - * Properties of a GoogleSearchTool. - * @memberof google.cloud.ces.v1beta - * @interface IGoogleSearchTool - * @property {string|null} [name] GoogleSearchTool name - * @property {string|null} [description] GoogleSearchTool description - * @property {Array.|null} [contextUrls] GoogleSearchTool contextUrls - * @property {Array.|null} [preferredDomains] GoogleSearchTool preferredDomains - * @property {Array.|null} [excludeDomains] GoogleSearchTool excludeDomains - * @property {google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig|null} [promptConfig] GoogleSearchTool promptConfig - */ - - /** - * Constructs a new GoogleSearchTool. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GoogleSearchTool. - * @implements IGoogleSearchTool - * @constructor - * @param {google.cloud.ces.v1beta.IGoogleSearchTool=} [properties] Properties to set - */ - function GoogleSearchTool(properties) { - this.contextUrls = []; - this.preferredDomains = []; - this.excludeDomains = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoogleSearchTool name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.GoogleSearchTool - * @instance - */ - GoogleSearchTool.prototype.name = ""; - - /** - * GoogleSearchTool description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.GoogleSearchTool - * @instance - */ - GoogleSearchTool.prototype.description = ""; - - /** - * GoogleSearchTool contextUrls. - * @member {Array.} contextUrls - * @memberof google.cloud.ces.v1beta.GoogleSearchTool - * @instance - */ - GoogleSearchTool.prototype.contextUrls = $util.emptyArray; - - /** - * GoogleSearchTool preferredDomains. - * @member {Array.} preferredDomains - * @memberof google.cloud.ces.v1beta.GoogleSearchTool - * @instance - */ - GoogleSearchTool.prototype.preferredDomains = $util.emptyArray; - - /** - * GoogleSearchTool excludeDomains. - * @member {Array.} excludeDomains - * @memberof google.cloud.ces.v1beta.GoogleSearchTool - * @instance - */ - GoogleSearchTool.prototype.excludeDomains = $util.emptyArray; - - /** - * GoogleSearchTool promptConfig. - * @member {google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig|null|undefined} promptConfig - * @memberof google.cloud.ces.v1beta.GoogleSearchTool - * @instance - */ - GoogleSearchTool.prototype.promptConfig = null; - - /** - * Creates a new GoogleSearchTool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GoogleSearchTool - * @static - * @param {google.cloud.ces.v1beta.IGoogleSearchTool=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GoogleSearchTool} GoogleSearchTool instance - */ - GoogleSearchTool.create = function create(properties) { - return new GoogleSearchTool(properties); - }; - - /** - * Encodes the specified GoogleSearchTool message. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GoogleSearchTool - * @static - * @param {google.cloud.ces.v1beta.IGoogleSearchTool} message GoogleSearchTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoogleSearchTool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.contextUrls != null && message.contextUrls.length) - for (var i = 0; i < message.contextUrls.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.contextUrls[i]); - if (message.excludeDomains != null && message.excludeDomains.length) - for (var i = 0; i < message.excludeDomains.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.excludeDomains[i]); - if (message.promptConfig != null && Object.hasOwnProperty.call(message, "promptConfig")) - $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.encode(message.promptConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.preferredDomains != null && message.preferredDomains.length) - for (var i = 0; i < message.preferredDomains.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.preferredDomains[i]); - return writer; - }; - - /** - * Encodes the specified GoogleSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GoogleSearchTool - * @static - * @param {google.cloud.ces.v1beta.IGoogleSearchTool} message GoogleSearchTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoogleSearchTool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoogleSearchTool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GoogleSearchTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GoogleSearchTool} GoogleSearchTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoogleSearchTool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GoogleSearchTool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - if (!(message.contextUrls && message.contextUrls.length)) - message.contextUrls = []; - message.contextUrls.push(reader.string()); - break; - } - case 6: { - if (!(message.preferredDomains && message.preferredDomains.length)) - message.preferredDomains = []; - message.preferredDomains.push(reader.string()); - break; - } - case 4: { - if (!(message.excludeDomains && message.excludeDomains.length)) - message.excludeDomains = []; - message.excludeDomains.push(reader.string()); - break; - } - case 5: { - message.promptConfig = $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoogleSearchTool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GoogleSearchTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GoogleSearchTool} GoogleSearchTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoogleSearchTool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoogleSearchTool message. - * @function verify - * @memberof google.cloud.ces.v1beta.GoogleSearchTool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoogleSearchTool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.contextUrls != null && message.hasOwnProperty("contextUrls")) { - if (!Array.isArray(message.contextUrls)) - return "contextUrls: array expected"; - for (var i = 0; i < message.contextUrls.length; ++i) - if (!$util.isString(message.contextUrls[i])) - return "contextUrls: string[] expected"; - } - if (message.preferredDomains != null && message.hasOwnProperty("preferredDomains")) { - if (!Array.isArray(message.preferredDomains)) - return "preferredDomains: array expected"; - for (var i = 0; i < message.preferredDomains.length; ++i) - if (!$util.isString(message.preferredDomains[i])) - return "preferredDomains: string[] expected"; - } - if (message.excludeDomains != null && message.hasOwnProperty("excludeDomains")) { - if (!Array.isArray(message.excludeDomains)) - return "excludeDomains: array expected"; - for (var i = 0; i < message.excludeDomains.length; ++i) - if (!$util.isString(message.excludeDomains[i])) - return "excludeDomains: string[] expected"; - } - if (message.promptConfig != null && message.hasOwnProperty("promptConfig")) { - var error = $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.verify(message.promptConfig); - if (error) - return "promptConfig." + error; - } - return null; - }; - - /** - * Creates a GoogleSearchTool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GoogleSearchTool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GoogleSearchTool} GoogleSearchTool - */ - GoogleSearchTool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GoogleSearchTool) - return object; - var message = new $root.google.cloud.ces.v1beta.GoogleSearchTool(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.contextUrls) { - if (!Array.isArray(object.contextUrls)) - throw TypeError(".google.cloud.ces.v1beta.GoogleSearchTool.contextUrls: array expected"); - message.contextUrls = []; - for (var i = 0; i < object.contextUrls.length; ++i) - message.contextUrls[i] = String(object.contextUrls[i]); - } - if (object.preferredDomains) { - if (!Array.isArray(object.preferredDomains)) - throw TypeError(".google.cloud.ces.v1beta.GoogleSearchTool.preferredDomains: array expected"); - message.preferredDomains = []; - for (var i = 0; i < object.preferredDomains.length; ++i) - message.preferredDomains[i] = String(object.preferredDomains[i]); - } - if (object.excludeDomains) { - if (!Array.isArray(object.excludeDomains)) - throw TypeError(".google.cloud.ces.v1beta.GoogleSearchTool.excludeDomains: array expected"); - message.excludeDomains = []; - for (var i = 0; i < object.excludeDomains.length; ++i) - message.excludeDomains[i] = String(object.excludeDomains[i]); - } - if (object.promptConfig != null) { - if (typeof object.promptConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.GoogleSearchTool.promptConfig: object expected"); - message.promptConfig = $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.fromObject(object.promptConfig); - } - return message; - }; - - /** - * Creates a plain object from a GoogleSearchTool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GoogleSearchTool - * @static - * @param {google.cloud.ces.v1beta.GoogleSearchTool} message GoogleSearchTool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoogleSearchTool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.contextUrls = []; - object.excludeDomains = []; - object.preferredDomains = []; - } - if (options.defaults) { - object.name = ""; - object.description = ""; - object.promptConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.contextUrls && message.contextUrls.length) { - object.contextUrls = []; - for (var j = 0; j < message.contextUrls.length; ++j) - object.contextUrls[j] = message.contextUrls[j]; - } - if (message.excludeDomains && message.excludeDomains.length) { - object.excludeDomains = []; - for (var j = 0; j < message.excludeDomains.length; ++j) - object.excludeDomains[j] = message.excludeDomains[j]; - } - if (message.promptConfig != null && message.hasOwnProperty("promptConfig")) - object.promptConfig = $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.toObject(message.promptConfig, options); - if (message.preferredDomains && message.preferredDomains.length) { - object.preferredDomains = []; - for (var j = 0; j < message.preferredDomains.length; ++j) - object.preferredDomains[j] = message.preferredDomains[j]; - } - return object; - }; - - /** - * Converts this GoogleSearchTool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GoogleSearchTool - * @instance - * @returns {Object.} JSON object - */ - GoogleSearchTool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoogleSearchTool - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GoogleSearchTool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoogleSearchTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GoogleSearchTool"; - }; - - GoogleSearchTool.PromptConfig = (function() { - - /** - * Properties of a PromptConfig. - * @memberof google.cloud.ces.v1beta.GoogleSearchTool - * @interface IPromptConfig - * @property {string|null} [textPrompt] PromptConfig textPrompt - * @property {string|null} [voicePrompt] PromptConfig voicePrompt - */ - - /** - * Constructs a new PromptConfig. - * @memberof google.cloud.ces.v1beta.GoogleSearchTool - * @classdesc Represents a PromptConfig. - * @implements IPromptConfig - * @constructor - * @param {google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig=} [properties] Properties to set - */ - function PromptConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PromptConfig textPrompt. - * @member {string} textPrompt - * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig - * @instance - */ - PromptConfig.prototype.textPrompt = ""; - - /** - * PromptConfig voicePrompt. - * @member {string} voicePrompt - * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig - * @instance - */ - PromptConfig.prototype.voicePrompt = ""; - - /** - * Creates a new PromptConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig - * @static - * @param {google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig} PromptConfig instance - */ - PromptConfig.create = function create(properties) { - return new PromptConfig(properties); - }; - - /** - * Encodes the specified PromptConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig - * @static - * @param {google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig} message PromptConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PromptConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.textPrompt != null && Object.hasOwnProperty.call(message, "textPrompt")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.textPrompt); - if (message.voicePrompt != null && Object.hasOwnProperty.call(message, "voicePrompt")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.voicePrompt); - return writer; - }; - - /** - * Encodes the specified PromptConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig - * @static - * @param {google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig} message PromptConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PromptConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PromptConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig} PromptConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PromptConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.textPrompt = reader.string(); - break; - } - case 2: { - message.voicePrompt = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PromptConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig} PromptConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PromptConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PromptConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PromptConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.textPrompt != null && message.hasOwnProperty("textPrompt")) - if (!$util.isString(message.textPrompt)) - return "textPrompt: string expected"; - if (message.voicePrompt != null && message.hasOwnProperty("voicePrompt")) - if (!$util.isString(message.voicePrompt)) - return "voicePrompt: string expected"; - return null; - }; - - /** - * Creates a PromptConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig} PromptConfig - */ - PromptConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig(); - if (object.textPrompt != null) - message.textPrompt = String(object.textPrompt); - if (object.voicePrompt != null) - message.voicePrompt = String(object.voicePrompt); - return message; - }; - - /** - * Creates a plain object from a PromptConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig - * @static - * @param {google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig} message PromptConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PromptConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.textPrompt = ""; - object.voicePrompt = ""; - } - if (message.textPrompt != null && message.hasOwnProperty("textPrompt")) - object.textPrompt = message.textPrompt; - if (message.voicePrompt != null && message.hasOwnProperty("voicePrompt")) - object.voicePrompt = message.voicePrompt; - return object; - }; - - /** - * Converts this PromptConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig - * @instance - * @returns {Object.} JSON object - */ - PromptConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PromptConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PromptConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig"; - }; - - return PromptConfig; - })(); - - return GoogleSearchTool; - })(); - - v1beta.McpTool = (function() { - - /** - * Properties of a McpTool. - * @memberof google.cloud.ces.v1beta - * @interface IMcpTool - * @property {string|null} [name] McpTool name - * @property {string|null} [description] McpTool description - * @property {google.cloud.ces.v1beta.ISchema|null} [inputSchema] McpTool inputSchema - * @property {google.cloud.ces.v1beta.ISchema|null} [outputSchema] McpTool outputSchema - * @property {string|null} [serverAddress] McpTool serverAddress - * @property {google.cloud.ces.v1beta.IApiAuthentication|null} [apiAuthentication] McpTool apiAuthentication - * @property {google.cloud.ces.v1beta.ITlsConfig|null} [tlsConfig] McpTool tlsConfig - * @property {google.cloud.ces.v1beta.IServiceDirectoryConfig|null} [serviceDirectoryConfig] McpTool serviceDirectoryConfig - */ - - /** - * Constructs a new McpTool. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a McpTool. - * @implements IMcpTool - * @constructor - * @param {google.cloud.ces.v1beta.IMcpTool=} [properties] Properties to set - */ - function McpTool(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * McpTool name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.McpTool - * @instance - */ - McpTool.prototype.name = ""; - - /** - * McpTool description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.McpTool - * @instance - */ - McpTool.prototype.description = ""; - - /** - * McpTool inputSchema. - * @member {google.cloud.ces.v1beta.ISchema|null|undefined} inputSchema - * @memberof google.cloud.ces.v1beta.McpTool - * @instance - */ - McpTool.prototype.inputSchema = null; - - /** - * McpTool outputSchema. - * @member {google.cloud.ces.v1beta.ISchema|null|undefined} outputSchema - * @memberof google.cloud.ces.v1beta.McpTool - * @instance - */ - McpTool.prototype.outputSchema = null; - - /** - * McpTool serverAddress. - * @member {string} serverAddress - * @memberof google.cloud.ces.v1beta.McpTool - * @instance - */ - McpTool.prototype.serverAddress = ""; - - /** - * McpTool apiAuthentication. - * @member {google.cloud.ces.v1beta.IApiAuthentication|null|undefined} apiAuthentication - * @memberof google.cloud.ces.v1beta.McpTool - * @instance - */ - McpTool.prototype.apiAuthentication = null; - - /** - * McpTool tlsConfig. - * @member {google.cloud.ces.v1beta.ITlsConfig|null|undefined} tlsConfig - * @memberof google.cloud.ces.v1beta.McpTool - * @instance - */ - McpTool.prototype.tlsConfig = null; - - /** - * McpTool serviceDirectoryConfig. - * @member {google.cloud.ces.v1beta.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig - * @memberof google.cloud.ces.v1beta.McpTool - * @instance - */ - McpTool.prototype.serviceDirectoryConfig = null; - - /** - * Creates a new McpTool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.McpTool - * @static - * @param {google.cloud.ces.v1beta.IMcpTool=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.McpTool} McpTool instance - */ - McpTool.create = function create(properties) { - return new McpTool(properties); - }; - - /** - * Encodes the specified McpTool message. Does not implicitly {@link google.cloud.ces.v1beta.McpTool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.McpTool - * @static - * @param {google.cloud.ces.v1beta.IMcpTool} message McpTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - McpTool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.inputSchema != null && Object.hasOwnProperty.call(message, "inputSchema")) - $root.google.cloud.ces.v1beta.Schema.encode(message.inputSchema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.outputSchema != null && Object.hasOwnProperty.call(message, "outputSchema")) - $root.google.cloud.ces.v1beta.Schema.encode(message.outputSchema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.serverAddress != null && Object.hasOwnProperty.call(message, "serverAddress")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.serverAddress); - if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) - $root.google.cloud.ces.v1beta.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) - $root.google.cloud.ces.v1beta.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) - $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified McpTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.McpTool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.McpTool - * @static - * @param {google.cloud.ces.v1beta.IMcpTool} message McpTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - McpTool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a McpTool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.McpTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.McpTool} McpTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - McpTool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.McpTool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - message.inputSchema = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); - break; - } - case 4: { - message.outputSchema = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); - break; - } - case 5: { - message.serverAddress = reader.string(); - break; - } - case 6: { - message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.decode(reader, reader.uint32()); - break; - } - case 7: { - message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.decode(reader, reader.uint32()); - break; - } - case 8: { - message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a McpTool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.McpTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.McpTool} McpTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - McpTool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a McpTool message. - * @function verify - * @memberof google.cloud.ces.v1beta.McpTool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - McpTool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) { - var error = $root.google.cloud.ces.v1beta.Schema.verify(message.inputSchema); - if (error) - return "inputSchema." + error; - } - if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) { - var error = $root.google.cloud.ces.v1beta.Schema.verify(message.outputSchema); - if (error) - return "outputSchema." + error; - } - if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) - if (!$util.isString(message.serverAddress)) - return "serverAddress: string expected"; - if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { - var error = $root.google.cloud.ces.v1beta.ApiAuthentication.verify(message.apiAuthentication); - if (error) - return "apiAuthentication." + error; - } - if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { - var error = $root.google.cloud.ces.v1beta.TlsConfig.verify(message.tlsConfig); - if (error) - return "tlsConfig." + error; - } - if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { - var error = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); - if (error) - return "serviceDirectoryConfig." + error; - } - return null; - }; - - /** - * Creates a McpTool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.McpTool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.McpTool} McpTool - */ - McpTool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.McpTool) - return object; - var message = new $root.google.cloud.ces.v1beta.McpTool(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.inputSchema != null) { - if (typeof object.inputSchema !== "object") - throw TypeError(".google.cloud.ces.v1beta.McpTool.inputSchema: object expected"); - message.inputSchema = $root.google.cloud.ces.v1beta.Schema.fromObject(object.inputSchema); - } - if (object.outputSchema != null) { - if (typeof object.outputSchema !== "object") - throw TypeError(".google.cloud.ces.v1beta.McpTool.outputSchema: object expected"); - message.outputSchema = $root.google.cloud.ces.v1beta.Schema.fromObject(object.outputSchema); - } - if (object.serverAddress != null) - message.serverAddress = String(object.serverAddress); - if (object.apiAuthentication != null) { - if (typeof object.apiAuthentication !== "object") - throw TypeError(".google.cloud.ces.v1beta.McpTool.apiAuthentication: object expected"); - message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.fromObject(object.apiAuthentication); - } - if (object.tlsConfig != null) { - if (typeof object.tlsConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.McpTool.tlsConfig: object expected"); - message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.fromObject(object.tlsConfig); - } - if (object.serviceDirectoryConfig != null) { - if (typeof object.serviceDirectoryConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.McpTool.serviceDirectoryConfig: object expected"); - message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); - } - return message; - }; - - /** - * Creates a plain object from a McpTool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.McpTool - * @static - * @param {google.cloud.ces.v1beta.McpTool} message McpTool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - McpTool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.inputSchema = null; - object.outputSchema = null; - object.serverAddress = ""; - object.apiAuthentication = null; - object.tlsConfig = null; - object.serviceDirectoryConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) - object.inputSchema = $root.google.cloud.ces.v1beta.Schema.toObject(message.inputSchema, options); - if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) - object.outputSchema = $root.google.cloud.ces.v1beta.Schema.toObject(message.outputSchema, options); - if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) - object.serverAddress = message.serverAddress; - if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) - object.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.toObject(message.apiAuthentication, options); - if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) - object.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.toObject(message.tlsConfig, options); - if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) - object.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); - return object; - }; - - /** - * Converts this McpTool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.McpTool - * @instance - * @returns {Object.} JSON object - */ - McpTool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for McpTool - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.McpTool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - McpTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.McpTool"; - }; - - return McpTool; - })(); - - v1beta.OpenApiTool = (function() { - - /** - * Properties of an OpenApiTool. - * @memberof google.cloud.ces.v1beta - * @interface IOpenApiTool - * @property {string|null} [openApiSchema] OpenApiTool openApiSchema - * @property {string|null} [name] OpenApiTool name - * @property {string|null} [description] OpenApiTool description - * @property {google.cloud.ces.v1beta.IApiAuthentication|null} [apiAuthentication] OpenApiTool apiAuthentication - * @property {google.cloud.ces.v1beta.ITlsConfig|null} [tlsConfig] OpenApiTool tlsConfig - * @property {google.cloud.ces.v1beta.IServiceDirectoryConfig|null} [serviceDirectoryConfig] OpenApiTool serviceDirectoryConfig - * @property {boolean|null} [ignoreUnknownFields] OpenApiTool ignoreUnknownFields - * @property {string|null} [url] OpenApiTool url - */ - - /** - * Constructs a new OpenApiTool. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an OpenApiTool. - * @implements IOpenApiTool - * @constructor - * @param {google.cloud.ces.v1beta.IOpenApiTool=} [properties] Properties to set - */ - function OpenApiTool(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OpenApiTool openApiSchema. - * @member {string} openApiSchema - * @memberof google.cloud.ces.v1beta.OpenApiTool - * @instance - */ - OpenApiTool.prototype.openApiSchema = ""; - - /** - * OpenApiTool name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.OpenApiTool - * @instance - */ - OpenApiTool.prototype.name = ""; - - /** - * OpenApiTool description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.OpenApiTool - * @instance - */ - OpenApiTool.prototype.description = ""; - - /** - * OpenApiTool apiAuthentication. - * @member {google.cloud.ces.v1beta.IApiAuthentication|null|undefined} apiAuthentication - * @memberof google.cloud.ces.v1beta.OpenApiTool - * @instance - */ - OpenApiTool.prototype.apiAuthentication = null; - - /** - * OpenApiTool tlsConfig. - * @member {google.cloud.ces.v1beta.ITlsConfig|null|undefined} tlsConfig - * @memberof google.cloud.ces.v1beta.OpenApiTool - * @instance - */ - OpenApiTool.prototype.tlsConfig = null; - - /** - * OpenApiTool serviceDirectoryConfig. - * @member {google.cloud.ces.v1beta.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig - * @memberof google.cloud.ces.v1beta.OpenApiTool - * @instance - */ - OpenApiTool.prototype.serviceDirectoryConfig = null; - - /** - * OpenApiTool ignoreUnknownFields. - * @member {boolean} ignoreUnknownFields - * @memberof google.cloud.ces.v1beta.OpenApiTool - * @instance - */ - OpenApiTool.prototype.ignoreUnknownFields = false; - - /** - * OpenApiTool url. - * @member {string} url - * @memberof google.cloud.ces.v1beta.OpenApiTool - * @instance - */ - OpenApiTool.prototype.url = ""; - - /** - * Creates a new OpenApiTool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.OpenApiTool - * @static - * @param {google.cloud.ces.v1beta.IOpenApiTool=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.OpenApiTool} OpenApiTool instance - */ - OpenApiTool.create = function create(properties) { - return new OpenApiTool(properties); - }; - - /** - * Encodes the specified OpenApiTool message. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiTool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.OpenApiTool - * @static - * @param {google.cloud.ces.v1beta.IOpenApiTool} message OpenApiTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OpenApiTool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.openApiSchema != null && Object.hasOwnProperty.call(message, "openApiSchema")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.openApiSchema); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) - $root.google.cloud.ces.v1beta.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) - $root.google.cloud.ces.v1beta.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) - $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.ignoreUnknownFields != null && Object.hasOwnProperty.call(message, "ignoreUnknownFields")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.ignoreUnknownFields); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.url); - return writer; - }; - - /** - * Encodes the specified OpenApiTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiTool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.OpenApiTool - * @static - * @param {google.cloud.ces.v1beta.IOpenApiTool} message OpenApiTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OpenApiTool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OpenApiTool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.OpenApiTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.OpenApiTool} OpenApiTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OpenApiTool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OpenApiTool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.openApiSchema = reader.string(); - break; - } - case 2: { - message.name = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.decode(reader, reader.uint32()); - break; - } - case 5: { - message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.ignoreUnknownFields = reader.bool(); - break; - } - case 8: { - message.url = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OpenApiTool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.OpenApiTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.OpenApiTool} OpenApiTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OpenApiTool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OpenApiTool message. - * @function verify - * @memberof google.cloud.ces.v1beta.OpenApiTool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OpenApiTool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) - if (!$util.isString(message.openApiSchema)) - return "openApiSchema: string expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { - var error = $root.google.cloud.ces.v1beta.ApiAuthentication.verify(message.apiAuthentication); - if (error) - return "apiAuthentication." + error; - } - if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { - var error = $root.google.cloud.ces.v1beta.TlsConfig.verify(message.tlsConfig); - if (error) - return "tlsConfig." + error; - } - if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { - var error = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); - if (error) - return "serviceDirectoryConfig." + error; - } - if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) - if (typeof message.ignoreUnknownFields !== "boolean") - return "ignoreUnknownFields: boolean expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - return null; - }; - - /** - * Creates an OpenApiTool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.OpenApiTool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.OpenApiTool} OpenApiTool - */ - OpenApiTool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.OpenApiTool) - return object; - var message = new $root.google.cloud.ces.v1beta.OpenApiTool(); - if (object.openApiSchema != null) - message.openApiSchema = String(object.openApiSchema); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.apiAuthentication != null) { - if (typeof object.apiAuthentication !== "object") - throw TypeError(".google.cloud.ces.v1beta.OpenApiTool.apiAuthentication: object expected"); - message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.fromObject(object.apiAuthentication); - } - if (object.tlsConfig != null) { - if (typeof object.tlsConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.OpenApiTool.tlsConfig: object expected"); - message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.fromObject(object.tlsConfig); - } - if (object.serviceDirectoryConfig != null) { - if (typeof object.serviceDirectoryConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.OpenApiTool.serviceDirectoryConfig: object expected"); - message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); - } - if (object.ignoreUnknownFields != null) - message.ignoreUnknownFields = Boolean(object.ignoreUnknownFields); - if (object.url != null) - message.url = String(object.url); - return message; - }; - - /** - * Creates a plain object from an OpenApiTool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.OpenApiTool - * @static - * @param {google.cloud.ces.v1beta.OpenApiTool} message OpenApiTool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OpenApiTool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.openApiSchema = ""; - object.name = ""; - object.description = ""; - object.apiAuthentication = null; - object.tlsConfig = null; - object.serviceDirectoryConfig = null; - object.ignoreUnknownFields = false; - object.url = ""; - } - if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) - object.openApiSchema = message.openApiSchema; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) - object.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.toObject(message.apiAuthentication, options); - if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) - object.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.toObject(message.tlsConfig, options); - if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) - object.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); - if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) - object.ignoreUnknownFields = message.ignoreUnknownFields; - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - return object; - }; - - /** - * Converts this OpenApiTool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.OpenApiTool - * @instance - * @returns {Object.} JSON object - */ - OpenApiTool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OpenApiTool - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.OpenApiTool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OpenApiTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.OpenApiTool"; - }; - - return OpenApiTool; - })(); - - v1beta.PythonFunction = (function() { - - /** - * Properties of a PythonFunction. - * @memberof google.cloud.ces.v1beta - * @interface IPythonFunction - * @property {string|null} [name] PythonFunction name - * @property {string|null} [pythonCode] PythonFunction pythonCode - * @property {string|null} [description] PythonFunction description - */ - - /** - * Constructs a new PythonFunction. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a PythonFunction. - * @implements IPythonFunction - * @constructor - * @param {google.cloud.ces.v1beta.IPythonFunction=} [properties] Properties to set - */ - function PythonFunction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonFunction name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.PythonFunction - * @instance - */ - PythonFunction.prototype.name = ""; - - /** - * PythonFunction pythonCode. - * @member {string} pythonCode - * @memberof google.cloud.ces.v1beta.PythonFunction - * @instance - */ - PythonFunction.prototype.pythonCode = ""; - - /** - * PythonFunction description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.PythonFunction - * @instance - */ - PythonFunction.prototype.description = ""; - - /** - * Creates a new PythonFunction instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.PythonFunction - * @static - * @param {google.cloud.ces.v1beta.IPythonFunction=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.PythonFunction} PythonFunction instance - */ - PythonFunction.create = function create(properties) { - return new PythonFunction(properties); - }; - - /** - * Encodes the specified PythonFunction message. Does not implicitly {@link google.cloud.ces.v1beta.PythonFunction.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.PythonFunction - * @static - * @param {google.cloud.ces.v1beta.IPythonFunction} message PythonFunction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonFunction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pythonCode); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - return writer; - }; - - /** - * Encodes the specified PythonFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.PythonFunction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.PythonFunction - * @static - * @param {google.cloud.ces.v1beta.IPythonFunction} message PythonFunction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonFunction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonFunction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.PythonFunction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.PythonFunction} PythonFunction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonFunction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.PythonFunction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.pythonCode = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonFunction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.PythonFunction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.PythonFunction} PythonFunction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonFunction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonFunction message. - * @function verify - * @memberof google.cloud.ces.v1beta.PythonFunction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonFunction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) - if (!$util.isString(message.pythonCode)) - return "pythonCode: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates a PythonFunction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.PythonFunction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.PythonFunction} PythonFunction - */ - PythonFunction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.PythonFunction) - return object; - var message = new $root.google.cloud.ces.v1beta.PythonFunction(); - if (object.name != null) - message.name = String(object.name); - if (object.pythonCode != null) - message.pythonCode = String(object.pythonCode); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from a PythonFunction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.PythonFunction - * @static - * @param {google.cloud.ces.v1beta.PythonFunction} message PythonFunction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonFunction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.pythonCode = ""; - object.description = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) - object.pythonCode = message.pythonCode; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this PythonFunction to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.PythonFunction - * @instance - * @returns {Object.} JSON object - */ - PythonFunction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonFunction - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.PythonFunction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonFunction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.PythonFunction"; - }; - - return PythonFunction; - })(); - - v1beta.SystemTool = (function() { - - /** - * Properties of a SystemTool. - * @memberof google.cloud.ces.v1beta - * @interface ISystemTool - * @property {string|null} [name] SystemTool name - * @property {string|null} [description] SystemTool description - */ - - /** - * Constructs a new SystemTool. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a SystemTool. - * @implements ISystemTool - * @constructor - * @param {google.cloud.ces.v1beta.ISystemTool=} [properties] Properties to set - */ - function SystemTool(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SystemTool name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.SystemTool - * @instance - */ - SystemTool.prototype.name = ""; - - /** - * SystemTool description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.SystemTool - * @instance - */ - SystemTool.prototype.description = ""; - - /** - * Creates a new SystemTool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.SystemTool - * @static - * @param {google.cloud.ces.v1beta.ISystemTool=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.SystemTool} SystemTool instance - */ - SystemTool.create = function create(properties) { - return new SystemTool(properties); - }; - - /** - * Encodes the specified SystemTool message. Does not implicitly {@link google.cloud.ces.v1beta.SystemTool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.SystemTool - * @static - * @param {google.cloud.ces.v1beta.ISystemTool} message SystemTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SystemTool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - return writer; - }; - - /** - * Encodes the specified SystemTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SystemTool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.SystemTool - * @static - * @param {google.cloud.ces.v1beta.ISystemTool} message SystemTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SystemTool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SystemTool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.SystemTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.SystemTool} SystemTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SystemTool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SystemTool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SystemTool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.SystemTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.SystemTool} SystemTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SystemTool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SystemTool message. - * @function verify - * @memberof google.cloud.ces.v1beta.SystemTool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SystemTool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates a SystemTool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.SystemTool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.SystemTool} SystemTool - */ - SystemTool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.SystemTool) - return object; - var message = new $root.google.cloud.ces.v1beta.SystemTool(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from a SystemTool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.SystemTool - * @static - * @param {google.cloud.ces.v1beta.SystemTool} message SystemTool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SystemTool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this SystemTool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.SystemTool - * @instance - * @returns {Object.} JSON object - */ - SystemTool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SystemTool - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.SystemTool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SystemTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.SystemTool"; - }; - - return SystemTool; - })(); - - v1beta.WidgetTool = (function() { - - /** - * Properties of a WidgetTool. - * @memberof google.cloud.ces.v1beta - * @interface IWidgetTool - * @property {google.cloud.ces.v1beta.ISchema|null} [parameters] WidgetTool parameters - * @property {string|null} [name] WidgetTool name - * @property {string|null} [description] WidgetTool description - * @property {google.cloud.ces.v1beta.WidgetTool.WidgetType|null} [widgetType] WidgetTool widgetType - */ - - /** - * Constructs a new WidgetTool. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a WidgetTool. - * @implements IWidgetTool - * @constructor - * @param {google.cloud.ces.v1beta.IWidgetTool=} [properties] Properties to set - */ - function WidgetTool(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WidgetTool parameters. - * @member {google.cloud.ces.v1beta.ISchema|null|undefined} parameters - * @memberof google.cloud.ces.v1beta.WidgetTool - * @instance - */ - WidgetTool.prototype.parameters = null; - - /** - * WidgetTool name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.WidgetTool - * @instance - */ - WidgetTool.prototype.name = ""; - - /** - * WidgetTool description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.WidgetTool - * @instance - */ - WidgetTool.prototype.description = ""; - - /** - * WidgetTool widgetType. - * @member {google.cloud.ces.v1beta.WidgetTool.WidgetType} widgetType - * @memberof google.cloud.ces.v1beta.WidgetTool - * @instance - */ - WidgetTool.prototype.widgetType = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * WidgetTool input. - * @member {"parameters"|undefined} input - * @memberof google.cloud.ces.v1beta.WidgetTool - * @instance - */ - Object.defineProperty(WidgetTool.prototype, "input", { - get: $util.oneOfGetter($oneOfFields = ["parameters"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new WidgetTool instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.WidgetTool - * @static - * @param {google.cloud.ces.v1beta.IWidgetTool=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.WidgetTool} WidgetTool instance - */ - WidgetTool.create = function create(properties) { - return new WidgetTool(properties); - }; - - /** - * Encodes the specified WidgetTool message. Does not implicitly {@link google.cloud.ces.v1beta.WidgetTool.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.WidgetTool - * @static - * @param {google.cloud.ces.v1beta.IWidgetTool} message WidgetTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WidgetTool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.widgetType != null && Object.hasOwnProperty.call(message, "widgetType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.widgetType); - if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) - $root.google.cloud.ces.v1beta.Schema.encode(message.parameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WidgetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.WidgetTool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.WidgetTool - * @static - * @param {google.cloud.ces.v1beta.IWidgetTool} message WidgetTool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WidgetTool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WidgetTool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.WidgetTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.WidgetTool} WidgetTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WidgetTool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.WidgetTool(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.parameters = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - message.widgetType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WidgetTool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.WidgetTool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.WidgetTool} WidgetTool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WidgetTool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WidgetTool message. - * @function verify - * @memberof google.cloud.ces.v1beta.WidgetTool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WidgetTool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.parameters != null && message.hasOwnProperty("parameters")) { - properties.input = 1; - { - var error = $root.google.cloud.ces.v1beta.Schema.verify(message.parameters); - if (error) - return "parameters." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.widgetType != null && message.hasOwnProperty("widgetType")) - switch (message.widgetType) { - default: - return "widgetType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - break; - } - return null; - }; - - /** - * Creates a WidgetTool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.WidgetTool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.WidgetTool} WidgetTool - */ - WidgetTool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.WidgetTool) - return object; - var message = new $root.google.cloud.ces.v1beta.WidgetTool(); - if (object.parameters != null) { - if (typeof object.parameters !== "object") - throw TypeError(".google.cloud.ces.v1beta.WidgetTool.parameters: object expected"); - message.parameters = $root.google.cloud.ces.v1beta.Schema.fromObject(object.parameters); - } - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - switch (object.widgetType) { - default: - if (typeof object.widgetType === "number") { - message.widgetType = object.widgetType; - break; - } - break; - case "WIDGET_TYPE_UNSPECIFIED": - case 0: - message.widgetType = 0; - break; - case "CUSTOM": - case 1: - message.widgetType = 1; - break; - case "PRODUCT_CAROUSEL": - case 2: - message.widgetType = 2; - break; - case "PRODUCT_DETAILS": - case 3: - message.widgetType = 3; - break; - case "QUICK_ACTIONS": - case 4: - message.widgetType = 4; - break; - case "PRODUCT_COMPARISON": - case 5: - message.widgetType = 5; - break; - case "ADVANCED_PRODUCT_DETAILS": - case 6: - message.widgetType = 6; - break; - case "SHORT_FORM": - case 7: - message.widgetType = 7; - break; - case "OVERALL_SATISFACTION": - case 8: - message.widgetType = 8; - break; - case "ORDER_SUMMARY": - case 9: - message.widgetType = 9; - break; - case "APPOINTMENT_DETAILS": - case 10: - message.widgetType = 10; - break; - case "APPOINTMENT_SCHEDULER": - case 11: - message.widgetType = 11; - break; - case "CONTACT_FORM": - case 12: - message.widgetType = 12; - break; - } - return message; - }; - - /** - * Creates a plain object from a WidgetTool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.WidgetTool - * @static - * @param {google.cloud.ces.v1beta.WidgetTool} message WidgetTool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WidgetTool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.widgetType = options.enums === String ? "WIDGET_TYPE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.widgetType != null && message.hasOwnProperty("widgetType")) - object.widgetType = options.enums === String ? $root.google.cloud.ces.v1beta.WidgetTool.WidgetType[message.widgetType] === undefined ? message.widgetType : $root.google.cloud.ces.v1beta.WidgetTool.WidgetType[message.widgetType] : message.widgetType; - if (message.parameters != null && message.hasOwnProperty("parameters")) { - object.parameters = $root.google.cloud.ces.v1beta.Schema.toObject(message.parameters, options); - if (options.oneofs) - object.input = "parameters"; - } - return object; - }; - - /** - * Converts this WidgetTool to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.WidgetTool - * @instance - * @returns {Object.} JSON object - */ - WidgetTool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WidgetTool - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.WidgetTool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WidgetTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.WidgetTool"; - }; - - /** - * WidgetType enum. - * @name google.cloud.ces.v1beta.WidgetTool.WidgetType - * @enum {number} - * @property {number} WIDGET_TYPE_UNSPECIFIED=0 WIDGET_TYPE_UNSPECIFIED value - * @property {number} CUSTOM=1 CUSTOM value - * @property {number} PRODUCT_CAROUSEL=2 PRODUCT_CAROUSEL value - * @property {number} PRODUCT_DETAILS=3 PRODUCT_DETAILS value - * @property {number} QUICK_ACTIONS=4 QUICK_ACTIONS value - * @property {number} PRODUCT_COMPARISON=5 PRODUCT_COMPARISON value - * @property {number} ADVANCED_PRODUCT_DETAILS=6 ADVANCED_PRODUCT_DETAILS value - * @property {number} SHORT_FORM=7 SHORT_FORM value - * @property {number} OVERALL_SATISFACTION=8 OVERALL_SATISFACTION value - * @property {number} ORDER_SUMMARY=9 ORDER_SUMMARY value - * @property {number} APPOINTMENT_DETAILS=10 APPOINTMENT_DETAILS value - * @property {number} APPOINTMENT_SCHEDULER=11 APPOINTMENT_SCHEDULER value - * @property {number} CONTACT_FORM=12 CONTACT_FORM value - */ - WidgetTool.WidgetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "WIDGET_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CUSTOM"] = 1; - values[valuesById[2] = "PRODUCT_CAROUSEL"] = 2; - values[valuesById[3] = "PRODUCT_DETAILS"] = 3; - values[valuesById[4] = "QUICK_ACTIONS"] = 4; - values[valuesById[5] = "PRODUCT_COMPARISON"] = 5; - values[valuesById[6] = "ADVANCED_PRODUCT_DETAILS"] = 6; - values[valuesById[7] = "SHORT_FORM"] = 7; - values[valuesById[8] = "OVERALL_SATISFACTION"] = 8; - values[valuesById[9] = "ORDER_SUMMARY"] = 9; - values[valuesById[10] = "APPOINTMENT_DETAILS"] = 10; - values[valuesById[11] = "APPOINTMENT_SCHEDULER"] = 11; - values[valuesById[12] = "CONTACT_FORM"] = 12; - return values; - })(); - - return WidgetTool; - })(); - - v1beta.Toolset = (function() { - - /** - * Properties of a Toolset. - * @memberof google.cloud.ces.v1beta - * @interface IToolset - * @property {google.cloud.ces.v1beta.IMcpToolset|null} [mcpToolset] Toolset mcpToolset - * @property {google.cloud.ces.v1beta.IOpenApiToolset|null} [openApiToolset] Toolset openApiToolset - * @property {google.cloud.ces.v1beta.IConnectorToolset|null} [connectorToolset] Toolset connectorToolset - * @property {string|null} [name] Toolset name - * @property {string|null} [displayName] Toolset displayName - * @property {string|null} [description] Toolset description - * @property {google.protobuf.ITimestamp|null} [createTime] Toolset createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Toolset updateTime - * @property {string|null} [etag] Toolset etag - * @property {google.cloud.ces.v1beta.ExecutionType|null} [executionType] Toolset executionType - * @property {google.cloud.ces.v1beta.IToolFakeConfig|null} [toolFakeConfig] Toolset toolFakeConfig - */ - - /** - * Constructs a new Toolset. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a Toolset. - * @implements IToolset - * @constructor - * @param {google.cloud.ces.v1beta.IToolset=} [properties] Properties to set - */ - function Toolset(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Toolset mcpToolset. - * @member {google.cloud.ces.v1beta.IMcpToolset|null|undefined} mcpToolset - * @memberof google.cloud.ces.v1beta.Toolset - * @instance - */ - Toolset.prototype.mcpToolset = null; - - /** - * Toolset openApiToolset. - * @member {google.cloud.ces.v1beta.IOpenApiToolset|null|undefined} openApiToolset - * @memberof google.cloud.ces.v1beta.Toolset - * @instance - */ - Toolset.prototype.openApiToolset = null; - - /** - * Toolset connectorToolset. - * @member {google.cloud.ces.v1beta.IConnectorToolset|null|undefined} connectorToolset - * @memberof google.cloud.ces.v1beta.Toolset - * @instance - */ - Toolset.prototype.connectorToolset = null; - - /** - * Toolset name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.Toolset - * @instance - */ - Toolset.prototype.name = ""; - - /** - * Toolset displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.Toolset - * @instance - */ - Toolset.prototype.displayName = ""; - - /** - * Toolset description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.Toolset - * @instance - */ - Toolset.prototype.description = ""; - - /** - * Toolset createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.Toolset - * @instance - */ - Toolset.prototype.createTime = null; - - /** - * Toolset updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1beta.Toolset - * @instance - */ - Toolset.prototype.updateTime = null; - - /** - * Toolset etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.Toolset - * @instance - */ - Toolset.prototype.etag = ""; - - /** - * Toolset executionType. - * @member {google.cloud.ces.v1beta.ExecutionType} executionType - * @memberof google.cloud.ces.v1beta.Toolset - * @instance - */ - Toolset.prototype.executionType = 0; - - /** - * Toolset toolFakeConfig. - * @member {google.cloud.ces.v1beta.IToolFakeConfig|null|undefined} toolFakeConfig - * @memberof google.cloud.ces.v1beta.Toolset - * @instance - */ - Toolset.prototype.toolFakeConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Toolset toolsetType. - * @member {"mcpToolset"|"openApiToolset"|"connectorToolset"|undefined} toolsetType - * @memberof google.cloud.ces.v1beta.Toolset - * @instance - */ - Object.defineProperty(Toolset.prototype, "toolsetType", { - get: $util.oneOfGetter($oneOfFields = ["mcpToolset", "openApiToolset", "connectorToolset"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Toolset instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Toolset - * @static - * @param {google.cloud.ces.v1beta.IToolset=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Toolset} Toolset instance - */ - Toolset.create = function create(properties) { - return new Toolset(properties); - }; - - /** - * Encodes the specified Toolset message. Does not implicitly {@link google.cloud.ces.v1beta.Toolset.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Toolset - * @static - * @param {google.cloud.ces.v1beta.IToolset} message Toolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Toolset.encode = function encode(message, writer) { - if (!writer) - 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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); - if (message.mcpToolset != null && Object.hasOwnProperty.call(message, "mcpToolset")) - $root.google.cloud.ces.v1beta.McpToolset.encode(message.mcpToolset, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.openApiToolset != null && Object.hasOwnProperty.call(message, "openApiToolset")) - $root.google.cloud.ces.v1beta.OpenApiToolset.encode(message.openApiToolset, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.connectorToolset != null && Object.hasOwnProperty.call(message, "connectorToolset")) - $root.google.cloud.ces.v1beta.ConnectorToolset.encode(message.connectorToolset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.executionType != null && Object.hasOwnProperty.call(message, "executionType")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.executionType); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.description); - if (message.toolFakeConfig != null && Object.hasOwnProperty.call(message, "toolFakeConfig")) - $root.google.cloud.ces.v1beta.ToolFakeConfig.encode(message.toolFakeConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Toolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Toolset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Toolset - * @static - * @param {google.cloud.ces.v1beta.IToolset} message Toolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Toolset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Toolset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Toolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Toolset} Toolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Toolset.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Toolset(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 6: { - message.mcpToolset = $root.google.cloud.ces.v1beta.McpToolset.decode(reader, reader.uint32()); - break; - } - case 7: { - message.openApiToolset = $root.google.cloud.ces.v1beta.OpenApiToolset.decode(reader, reader.uint32()); - break; - } - case 8: { - message.connectorToolset = $root.google.cloud.ces.v1beta.ConnectorToolset.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 10: { - message.description = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.etag = reader.string(); - break; - } - case 9: { - message.executionType = reader.int32(); - break; - } - case 11: { - message.toolFakeConfig = $root.google.cloud.ces.v1beta.ToolFakeConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Toolset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Toolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Toolset} Toolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Toolset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Toolset message. - * @function verify - * @memberof google.cloud.ces.v1beta.Toolset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Toolset.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.mcpToolset != null && message.hasOwnProperty("mcpToolset")) { - properties.toolsetType = 1; - { - var error = $root.google.cloud.ces.v1beta.McpToolset.verify(message.mcpToolset); - if (error) - return "mcpToolset." + error; - } - } - if (message.openApiToolset != null && message.hasOwnProperty("openApiToolset")) { - if (properties.toolsetType === 1) - return "toolsetType: multiple values"; - properties.toolsetType = 1; - { - var error = $root.google.cloud.ces.v1beta.OpenApiToolset.verify(message.openApiToolset); - if (error) - return "openApiToolset." + error; - } - } - if (message.connectorToolset != null && message.hasOwnProperty("connectorToolset")) { - if (properties.toolsetType === 1) - return "toolsetType: multiple values"; - properties.toolsetType = 1; - { - var error = $root.google.cloud.ces.v1beta.ConnectorToolset.verify(message.connectorToolset); - if (error) - return "connectorToolset." + 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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: 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.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.executionType != null && message.hasOwnProperty("executionType")) - switch (message.executionType) { - default: - return "executionType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) { - var error = $root.google.cloud.ces.v1beta.ToolFakeConfig.verify(message.toolFakeConfig); - if (error) - return "toolFakeConfig." + error; - } - return null; - }; - - /** - * Creates a Toolset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Toolset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Toolset} Toolset - */ - Toolset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Toolset) - return object; - var message = new $root.google.cloud.ces.v1beta.Toolset(); - if (object.mcpToolset != null) { - if (typeof object.mcpToolset !== "object") - throw TypeError(".google.cloud.ces.v1beta.Toolset.mcpToolset: object expected"); - message.mcpToolset = $root.google.cloud.ces.v1beta.McpToolset.fromObject(object.mcpToolset); - } - if (object.openApiToolset != null) { - if (typeof object.openApiToolset !== "object") - throw TypeError(".google.cloud.ces.v1beta.Toolset.openApiToolset: object expected"); - message.openApiToolset = $root.google.cloud.ces.v1beta.OpenApiToolset.fromObject(object.openApiToolset); - } - if (object.connectorToolset != null) { - if (typeof object.connectorToolset !== "object") - throw TypeError(".google.cloud.ces.v1beta.Toolset.connectorToolset: object expected"); - message.connectorToolset = $root.google.cloud.ces.v1beta.ConnectorToolset.fromObject(object.connectorToolset); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.Toolset.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.ces.v1beta.Toolset.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.etag != null) - message.etag = String(object.etag); - switch (object.executionType) { - default: - if (typeof object.executionType === "number") { - message.executionType = object.executionType; - break; - } - break; - case "EXECUTION_TYPE_UNSPECIFIED": - case 0: - message.executionType = 0; - break; - case "SYNCHRONOUS": - case 1: - message.executionType = 1; - break; - case "ASYNCHRONOUS": - case 2: - message.executionType = 2; - break; - } - if (object.toolFakeConfig != null) { - if (typeof object.toolFakeConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.Toolset.toolFakeConfig: object expected"); - message.toolFakeConfig = $root.google.cloud.ces.v1beta.ToolFakeConfig.fromObject(object.toolFakeConfig); - } - return message; - }; - - /** - * Creates a plain object from a Toolset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Toolset - * @static - * @param {google.cloud.ces.v1beta.Toolset} message Toolset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Toolset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - object.executionType = options.enums === String ? "EXECUTION_TYPE_UNSPECIFIED" : 0; - object.description = ""; - object.toolFakeConfig = 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.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.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.mcpToolset != null && message.hasOwnProperty("mcpToolset")) { - object.mcpToolset = $root.google.cloud.ces.v1beta.McpToolset.toObject(message.mcpToolset, options); - if (options.oneofs) - object.toolsetType = "mcpToolset"; - } - if (message.openApiToolset != null && message.hasOwnProperty("openApiToolset")) { - object.openApiToolset = $root.google.cloud.ces.v1beta.OpenApiToolset.toObject(message.openApiToolset, options); - if (options.oneofs) - object.toolsetType = "openApiToolset"; - } - if (message.connectorToolset != null && message.hasOwnProperty("connectorToolset")) { - object.connectorToolset = $root.google.cloud.ces.v1beta.ConnectorToolset.toObject(message.connectorToolset, options); - if (options.oneofs) - object.toolsetType = "connectorToolset"; - } - if (message.executionType != null && message.hasOwnProperty("executionType")) - object.executionType = options.enums === String ? $root.google.cloud.ces.v1beta.ExecutionType[message.executionType] === undefined ? message.executionType : $root.google.cloud.ces.v1beta.ExecutionType[message.executionType] : message.executionType; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) - object.toolFakeConfig = $root.google.cloud.ces.v1beta.ToolFakeConfig.toObject(message.toolFakeConfig, options); - return object; - }; - - /** - * Converts this Toolset to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Toolset - * @instance - * @returns {Object.} JSON object - */ - Toolset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Toolset - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Toolset - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Toolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Toolset"; - }; - - return Toolset; - })(); - - v1beta.ConnectorToolset = (function() { - - /** - * Properties of a ConnectorToolset. - * @memberof google.cloud.ces.v1beta - * @interface IConnectorToolset - * @property {string|null} [connection] ConnectorToolset connection - * @property {google.cloud.ces.v1beta.IEndUserAuthConfig|null} [authConfig] ConnectorToolset authConfig - * @property {Array.|null} [connectorActions] ConnectorToolset connectorActions - */ - - /** - * Constructs a new ConnectorToolset. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ConnectorToolset. - * @implements IConnectorToolset - * @constructor - * @param {google.cloud.ces.v1beta.IConnectorToolset=} [properties] Properties to set - */ - function ConnectorToolset(properties) { - this.connectorActions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectorToolset connection. - * @member {string} connection - * @memberof google.cloud.ces.v1beta.ConnectorToolset - * @instance - */ - ConnectorToolset.prototype.connection = ""; - - /** - * ConnectorToolset authConfig. - * @member {google.cloud.ces.v1beta.IEndUserAuthConfig|null|undefined} authConfig - * @memberof google.cloud.ces.v1beta.ConnectorToolset - * @instance - */ - ConnectorToolset.prototype.authConfig = null; - - /** - * ConnectorToolset connectorActions. - * @member {Array.} connectorActions - * @memberof google.cloud.ces.v1beta.ConnectorToolset - * @instance - */ - ConnectorToolset.prototype.connectorActions = $util.emptyArray; - - /** - * Creates a new ConnectorToolset instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ConnectorToolset - * @static - * @param {google.cloud.ces.v1beta.IConnectorToolset=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ConnectorToolset} ConnectorToolset instance - */ - ConnectorToolset.create = function create(properties) { - return new ConnectorToolset(properties); - }; - - /** - * Encodes the specified ConnectorToolset message. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorToolset.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ConnectorToolset - * @static - * @param {google.cloud.ces.v1beta.IConnectorToolset} message ConnectorToolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectorToolset.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection); - if (message.authConfig != null && Object.hasOwnProperty.call(message, "authConfig")) - $root.google.cloud.ces.v1beta.EndUserAuthConfig.encode(message.authConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.connectorActions != null && message.connectorActions.length) - for (var i = 0; i < message.connectorActions.length; ++i) - $root.google.cloud.ces.v1beta.Action.encode(message.connectorActions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConnectorToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorToolset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ConnectorToolset - * @static - * @param {google.cloud.ces.v1beta.IConnectorToolset} message ConnectorToolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectorToolset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectorToolset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ConnectorToolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ConnectorToolset} ConnectorToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectorToolset.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ConnectorToolset(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.connection = reader.string(); - break; - } - case 2: { - message.authConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.connectorActions && message.connectorActions.length)) - message.connectorActions = []; - message.connectorActions.push($root.google.cloud.ces.v1beta.Action.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectorToolset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ConnectorToolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ConnectorToolset} ConnectorToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectorToolset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectorToolset message. - * @function verify - * @memberof google.cloud.ces.v1beta.ConnectorToolset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectorToolset.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection != null && message.hasOwnProperty("connection")) - if (!$util.isString(message.connection)) - return "connection: string expected"; - if (message.authConfig != null && message.hasOwnProperty("authConfig")) { - var error = $root.google.cloud.ces.v1beta.EndUserAuthConfig.verify(message.authConfig); - if (error) - return "authConfig." + error; - } - if (message.connectorActions != null && message.hasOwnProperty("connectorActions")) { - if (!Array.isArray(message.connectorActions)) - return "connectorActions: array expected"; - for (var i = 0; i < message.connectorActions.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Action.verify(message.connectorActions[i]); - if (error) - return "connectorActions." + error; - } - } - return null; - }; - - /** - * Creates a ConnectorToolset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ConnectorToolset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ConnectorToolset} ConnectorToolset - */ - ConnectorToolset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ConnectorToolset) - return object; - var message = new $root.google.cloud.ces.v1beta.ConnectorToolset(); - if (object.connection != null) - message.connection = String(object.connection); - if (object.authConfig != null) { - if (typeof object.authConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.ConnectorToolset.authConfig: object expected"); - message.authConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.fromObject(object.authConfig); - } - if (object.connectorActions) { - if (!Array.isArray(object.connectorActions)) - throw TypeError(".google.cloud.ces.v1beta.ConnectorToolset.connectorActions: array expected"); - message.connectorActions = []; - for (var i = 0; i < object.connectorActions.length; ++i) { - if (typeof object.connectorActions[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ConnectorToolset.connectorActions: object expected"); - message.connectorActions[i] = $root.google.cloud.ces.v1beta.Action.fromObject(object.connectorActions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ConnectorToolset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ConnectorToolset - * @static - * @param {google.cloud.ces.v1beta.ConnectorToolset} message ConnectorToolset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectorToolset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.connectorActions = []; - if (options.defaults) { - object.connection = ""; - object.authConfig = null; - } - if (message.connection != null && message.hasOwnProperty("connection")) - object.connection = message.connection; - if (message.authConfig != null && message.hasOwnProperty("authConfig")) - object.authConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.toObject(message.authConfig, options); - if (message.connectorActions && message.connectorActions.length) { - object.connectorActions = []; - for (var j = 0; j < message.connectorActions.length; ++j) - object.connectorActions[j] = $root.google.cloud.ces.v1beta.Action.toObject(message.connectorActions[j], options); - } - return object; - }; - - /** - * Converts this ConnectorToolset to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ConnectorToolset - * @instance - * @returns {Object.} JSON object - */ - ConnectorToolset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConnectorToolset - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ConnectorToolset - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConnectorToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ConnectorToolset"; - }; - - return ConnectorToolset; - })(); - - v1beta.McpToolset = (function() { - - /** - * Properties of a McpToolset. - * @memberof google.cloud.ces.v1beta - * @interface IMcpToolset - * @property {string|null} [serverAddress] McpToolset serverAddress - * @property {google.cloud.ces.v1beta.IApiAuthentication|null} [apiAuthentication] McpToolset apiAuthentication - * @property {google.cloud.ces.v1beta.IServiceDirectoryConfig|null} [serviceDirectoryConfig] McpToolset serviceDirectoryConfig - * @property {google.cloud.ces.v1beta.ITlsConfig|null} [tlsConfig] McpToolset tlsConfig - */ - - /** - * Constructs a new McpToolset. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a McpToolset. - * @implements IMcpToolset - * @constructor - * @param {google.cloud.ces.v1beta.IMcpToolset=} [properties] Properties to set - */ - function McpToolset(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * McpToolset serverAddress. - * @member {string} serverAddress - * @memberof google.cloud.ces.v1beta.McpToolset - * @instance - */ - McpToolset.prototype.serverAddress = ""; - - /** - * McpToolset apiAuthentication. - * @member {google.cloud.ces.v1beta.IApiAuthentication|null|undefined} apiAuthentication - * @memberof google.cloud.ces.v1beta.McpToolset - * @instance - */ - McpToolset.prototype.apiAuthentication = null; - - /** - * McpToolset serviceDirectoryConfig. - * @member {google.cloud.ces.v1beta.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig - * @memberof google.cloud.ces.v1beta.McpToolset - * @instance - */ - McpToolset.prototype.serviceDirectoryConfig = null; - - /** - * McpToolset tlsConfig. - * @member {google.cloud.ces.v1beta.ITlsConfig|null|undefined} tlsConfig - * @memberof google.cloud.ces.v1beta.McpToolset - * @instance - */ - McpToolset.prototype.tlsConfig = null; - - /** - * Creates a new McpToolset instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.McpToolset - * @static - * @param {google.cloud.ces.v1beta.IMcpToolset=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.McpToolset} McpToolset instance - */ - McpToolset.create = function create(properties) { - return new McpToolset(properties); - }; - - /** - * Encodes the specified McpToolset message. Does not implicitly {@link google.cloud.ces.v1beta.McpToolset.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.McpToolset - * @static - * @param {google.cloud.ces.v1beta.IMcpToolset} message McpToolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - McpToolset.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serverAddress != null && Object.hasOwnProperty.call(message, "serverAddress")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.serverAddress); - if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) - $root.google.cloud.ces.v1beta.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) - $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) - $root.google.cloud.ces.v1beta.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified McpToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.McpToolset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.McpToolset - * @static - * @param {google.cloud.ces.v1beta.IMcpToolset} message McpToolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - McpToolset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a McpToolset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.McpToolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.McpToolset} McpToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - McpToolset.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.McpToolset(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.serverAddress = reader.string(); - break; - } - case 2: { - message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.decode(reader, reader.uint32()); - break; - } - case 3: { - message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a McpToolset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.McpToolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.McpToolset} McpToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - McpToolset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a McpToolset message. - * @function verify - * @memberof google.cloud.ces.v1beta.McpToolset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - McpToolset.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) - if (!$util.isString(message.serverAddress)) - return "serverAddress: string expected"; - if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { - var error = $root.google.cloud.ces.v1beta.ApiAuthentication.verify(message.apiAuthentication); - if (error) - return "apiAuthentication." + error; - } - if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { - var error = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); - if (error) - return "serviceDirectoryConfig." + error; - } - if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { - var error = $root.google.cloud.ces.v1beta.TlsConfig.verify(message.tlsConfig); - if (error) - return "tlsConfig." + error; - } - return null; - }; - - /** - * Creates a McpToolset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.McpToolset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.McpToolset} McpToolset - */ - McpToolset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.McpToolset) - return object; - var message = new $root.google.cloud.ces.v1beta.McpToolset(); - if (object.serverAddress != null) - message.serverAddress = String(object.serverAddress); - if (object.apiAuthentication != null) { - if (typeof object.apiAuthentication !== "object") - throw TypeError(".google.cloud.ces.v1beta.McpToolset.apiAuthentication: object expected"); - message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.fromObject(object.apiAuthentication); - } - if (object.serviceDirectoryConfig != null) { - if (typeof object.serviceDirectoryConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.McpToolset.serviceDirectoryConfig: object expected"); - message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); - } - if (object.tlsConfig != null) { - if (typeof object.tlsConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.McpToolset.tlsConfig: object expected"); - message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.fromObject(object.tlsConfig); - } - return message; - }; - - /** - * Creates a plain object from a McpToolset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.McpToolset - * @static - * @param {google.cloud.ces.v1beta.McpToolset} message McpToolset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - McpToolset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.serverAddress = ""; - object.apiAuthentication = null; - object.serviceDirectoryConfig = null; - object.tlsConfig = null; - } - if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) - object.serverAddress = message.serverAddress; - if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) - object.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.toObject(message.apiAuthentication, options); - if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) - object.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); - if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) - object.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.toObject(message.tlsConfig, options); - return object; - }; - - /** - * Converts this McpToolset to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.McpToolset - * @instance - * @returns {Object.} JSON object - */ - McpToolset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for McpToolset - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.McpToolset - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - McpToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.McpToolset"; - }; - - return McpToolset; - })(); - - v1beta.OpenApiToolset = (function() { - - /** - * Properties of an OpenApiToolset. - * @memberof google.cloud.ces.v1beta - * @interface IOpenApiToolset - * @property {string|null} [openApiSchema] OpenApiToolset openApiSchema - * @property {google.cloud.ces.v1beta.IApiAuthentication|null} [apiAuthentication] OpenApiToolset apiAuthentication - * @property {google.cloud.ces.v1beta.ITlsConfig|null} [tlsConfig] OpenApiToolset tlsConfig - * @property {google.cloud.ces.v1beta.IServiceDirectoryConfig|null} [serviceDirectoryConfig] OpenApiToolset serviceDirectoryConfig - * @property {boolean|null} [ignoreUnknownFields] OpenApiToolset ignoreUnknownFields - * @property {string|null} [url] OpenApiToolset url - */ - - /** - * Constructs a new OpenApiToolset. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an OpenApiToolset. - * @implements IOpenApiToolset - * @constructor - * @param {google.cloud.ces.v1beta.IOpenApiToolset=} [properties] Properties to set - */ - function OpenApiToolset(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OpenApiToolset openApiSchema. - * @member {string} openApiSchema - * @memberof google.cloud.ces.v1beta.OpenApiToolset - * @instance - */ - OpenApiToolset.prototype.openApiSchema = ""; - - /** - * OpenApiToolset apiAuthentication. - * @member {google.cloud.ces.v1beta.IApiAuthentication|null|undefined} apiAuthentication - * @memberof google.cloud.ces.v1beta.OpenApiToolset - * @instance - */ - OpenApiToolset.prototype.apiAuthentication = null; - - /** - * OpenApiToolset tlsConfig. - * @member {google.cloud.ces.v1beta.ITlsConfig|null|undefined} tlsConfig - * @memberof google.cloud.ces.v1beta.OpenApiToolset - * @instance - */ - OpenApiToolset.prototype.tlsConfig = null; - - /** - * OpenApiToolset serviceDirectoryConfig. - * @member {google.cloud.ces.v1beta.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig - * @memberof google.cloud.ces.v1beta.OpenApiToolset - * @instance - */ - OpenApiToolset.prototype.serviceDirectoryConfig = null; - - /** - * OpenApiToolset ignoreUnknownFields. - * @member {boolean} ignoreUnknownFields - * @memberof google.cloud.ces.v1beta.OpenApiToolset - * @instance - */ - OpenApiToolset.prototype.ignoreUnknownFields = false; - - /** - * OpenApiToolset url. - * @member {string} url - * @memberof google.cloud.ces.v1beta.OpenApiToolset - * @instance - */ - OpenApiToolset.prototype.url = ""; - - /** - * Creates a new OpenApiToolset instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.OpenApiToolset - * @static - * @param {google.cloud.ces.v1beta.IOpenApiToolset=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.OpenApiToolset} OpenApiToolset instance - */ - OpenApiToolset.create = function create(properties) { - return new OpenApiToolset(properties); - }; - - /** - * Encodes the specified OpenApiToolset message. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiToolset.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.OpenApiToolset - * @static - * @param {google.cloud.ces.v1beta.IOpenApiToolset} message OpenApiToolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OpenApiToolset.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.openApiSchema != null && Object.hasOwnProperty.call(message, "openApiSchema")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.openApiSchema); - if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) - $root.google.cloud.ces.v1beta.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) - $root.google.cloud.ces.v1beta.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) - $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.ignoreUnknownFields != null && Object.hasOwnProperty.call(message, "ignoreUnknownFields")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.ignoreUnknownFields); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.url); - return writer; - }; - - /** - * Encodes the specified OpenApiToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiToolset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.OpenApiToolset - * @static - * @param {google.cloud.ces.v1beta.IOpenApiToolset} message OpenApiToolset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OpenApiToolset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OpenApiToolset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.OpenApiToolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.OpenApiToolset} OpenApiToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OpenApiToolset.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OpenApiToolset(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.openApiSchema = reader.string(); - break; - } - case 2: { - message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.decode(reader, reader.uint32()); - break; - } - case 3: { - message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - message.ignoreUnknownFields = reader.bool(); - break; - } - case 6: { - message.url = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OpenApiToolset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.OpenApiToolset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.OpenApiToolset} OpenApiToolset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OpenApiToolset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OpenApiToolset message. - * @function verify - * @memberof google.cloud.ces.v1beta.OpenApiToolset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OpenApiToolset.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) - if (!$util.isString(message.openApiSchema)) - return "openApiSchema: string expected"; - if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { - var error = $root.google.cloud.ces.v1beta.ApiAuthentication.verify(message.apiAuthentication); - if (error) - return "apiAuthentication." + error; - } - if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { - var error = $root.google.cloud.ces.v1beta.TlsConfig.verify(message.tlsConfig); - if (error) - return "tlsConfig." + error; - } - if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { - var error = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); - if (error) - return "serviceDirectoryConfig." + error; - } - if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) - if (typeof message.ignoreUnknownFields !== "boolean") - return "ignoreUnknownFields: boolean expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - return null; - }; - - /** - * Creates an OpenApiToolset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.OpenApiToolset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.OpenApiToolset} OpenApiToolset - */ - OpenApiToolset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.OpenApiToolset) - return object; - var message = new $root.google.cloud.ces.v1beta.OpenApiToolset(); - if (object.openApiSchema != null) - message.openApiSchema = String(object.openApiSchema); - if (object.apiAuthentication != null) { - if (typeof object.apiAuthentication !== "object") - throw TypeError(".google.cloud.ces.v1beta.OpenApiToolset.apiAuthentication: object expected"); - message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.fromObject(object.apiAuthentication); - } - if (object.tlsConfig != null) { - if (typeof object.tlsConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.OpenApiToolset.tlsConfig: object expected"); - message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.fromObject(object.tlsConfig); - } - if (object.serviceDirectoryConfig != null) { - if (typeof object.serviceDirectoryConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.OpenApiToolset.serviceDirectoryConfig: object expected"); - message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); - } - if (object.ignoreUnknownFields != null) - message.ignoreUnknownFields = Boolean(object.ignoreUnknownFields); - if (object.url != null) - message.url = String(object.url); - return message; - }; - - /** - * Creates a plain object from an OpenApiToolset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.OpenApiToolset - * @static - * @param {google.cloud.ces.v1beta.OpenApiToolset} message OpenApiToolset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OpenApiToolset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.openApiSchema = ""; - object.apiAuthentication = null; - object.tlsConfig = null; - object.serviceDirectoryConfig = null; - object.ignoreUnknownFields = false; - object.url = ""; - } - if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) - object.openApiSchema = message.openApiSchema; - if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) - object.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.toObject(message.apiAuthentication, options); - if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) - object.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.toObject(message.tlsConfig, options); - if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) - object.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); - if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) - object.ignoreUnknownFields = message.ignoreUnknownFields; - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - return object; - }; - - /** - * Converts this OpenApiToolset to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.OpenApiToolset - * @instance - * @returns {Object.} JSON object - */ - OpenApiToolset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OpenApiToolset - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.OpenApiToolset - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OpenApiToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.OpenApiToolset"; - }; - - return OpenApiToolset; - })(); - - v1beta.Changelog = (function() { - - /** - * Properties of a Changelog. - * @memberof google.cloud.ces.v1beta - * @interface IChangelog - * @property {string|null} [name] Changelog name - * @property {string|null} [author] Changelog author - * @property {string|null} [displayName] Changelog displayName - * @property {string|null} [description] Changelog description - * @property {string|null} [resource] Changelog resource - * @property {string|null} [resourceType] Changelog resourceType - * @property {string|null} [action] Changelog action - * @property {google.protobuf.IStruct|null} [originalResource] Changelog originalResource - * @property {google.protobuf.IStruct|null} [newResource] Changelog newResource - * @property {Array.|null} [dependentResources] Changelog dependentResources - * @property {google.protobuf.ITimestamp|null} [createTime] Changelog createTime - * @property {number|Long|null} [sequenceNumber] Changelog sequenceNumber - */ - - /** - * Constructs a new Changelog. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a Changelog. - * @implements IChangelog - * @constructor - * @param {google.cloud.ces.v1beta.IChangelog=} [properties] Properties to set - */ - function Changelog(properties) { - this.dependentResources = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Changelog name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.Changelog - * @instance - */ - Changelog.prototype.name = ""; - - /** - * Changelog author. - * @member {string} author - * @memberof google.cloud.ces.v1beta.Changelog - * @instance - */ - Changelog.prototype.author = ""; - - /** - * Changelog displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.Changelog - * @instance - */ - Changelog.prototype.displayName = ""; - - /** - * Changelog description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.Changelog - * @instance - */ - Changelog.prototype.description = ""; - - /** - * Changelog resource. - * @member {string} resource - * @memberof google.cloud.ces.v1beta.Changelog - * @instance - */ - Changelog.prototype.resource = ""; - - /** - * Changelog resourceType. - * @member {string} resourceType - * @memberof google.cloud.ces.v1beta.Changelog - * @instance - */ - Changelog.prototype.resourceType = ""; - - /** - * Changelog action. - * @member {string} action - * @memberof google.cloud.ces.v1beta.Changelog - * @instance - */ - Changelog.prototype.action = ""; - - /** - * Changelog originalResource. - * @member {google.protobuf.IStruct|null|undefined} originalResource - * @memberof google.cloud.ces.v1beta.Changelog - * @instance - */ - Changelog.prototype.originalResource = null; - - /** - * Changelog newResource. - * @member {google.protobuf.IStruct|null|undefined} newResource - * @memberof google.cloud.ces.v1beta.Changelog - * @instance - */ - Changelog.prototype.newResource = null; - - /** - * Changelog dependentResources. - * @member {Array.} dependentResources - * @memberof google.cloud.ces.v1beta.Changelog - * @instance - */ - Changelog.prototype.dependentResources = $util.emptyArray; - - /** - * Changelog createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.Changelog - * @instance - */ - Changelog.prototype.createTime = null; - - /** - * Changelog sequenceNumber. - * @member {number|Long} sequenceNumber - * @memberof google.cloud.ces.v1beta.Changelog - * @instance - */ - Changelog.prototype.sequenceNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Changelog instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Changelog - * @static - * @param {google.cloud.ces.v1beta.IChangelog=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Changelog} Changelog instance - */ - Changelog.create = function create(properties) { - return new Changelog(properties); - }; - - /** - * Encodes the specified Changelog message. Does not implicitly {@link google.cloud.ces.v1beta.Changelog.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Changelog - * @static - * @param {google.cloud.ces.v1beta.IChangelog} message Changelog message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Changelog.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.author != null && Object.hasOwnProperty.call(message, "author")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.author); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resource); - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceType); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.action); - if (message.originalResource != null && Object.hasOwnProperty.call(message, "originalResource")) - $root.google.protobuf.Struct.encode(message.originalResource, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.newResource != null && Object.hasOwnProperty.call(message, "newResource")) - $root.google.protobuf.Struct.encode(message.newResource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.dependentResources != null && message.dependentResources.length) - for (var i = 0; i < message.dependentResources.length; ++i) - $root.google.protobuf.Struct.encode(message.dependentResources[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.description); - if (message.sequenceNumber != null && Object.hasOwnProperty.call(message, "sequenceNumber")) - writer.uint32(/* id 12, wireType 0 =*/96).int64(message.sequenceNumber); - return writer; - }; - - /** - * Encodes the specified Changelog message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Changelog.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Changelog - * @static - * @param {google.cloud.ces.v1beta.IChangelog} message Changelog message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Changelog.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Changelog message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Changelog - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Changelog} Changelog - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Changelog.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Changelog(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.author = reader.string(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - case 11: { - message.description = reader.string(); - break; - } - case 4: { - message.resource = reader.string(); - break; - } - case 5: { - message.resourceType = reader.string(); - break; - } - case 6: { - message.action = reader.string(); - break; - } - case 7: { - message.originalResource = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 8: { - message.newResource = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.dependentResources && message.dependentResources.length)) - message.dependentResources = []; - message.dependentResources.push($root.google.protobuf.Struct.decode(reader, reader.uint32())); - break; - } - case 10: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 12: { - message.sequenceNumber = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Changelog message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Changelog - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Changelog} Changelog - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Changelog.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Changelog message. - * @function verify - * @memberof google.cloud.ces.v1beta.Changelog - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Changelog.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.author != null && message.hasOwnProperty("author")) - if (!$util.isString(message.author)) - return "author: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: string expected"; - if (message.action != null && message.hasOwnProperty("action")) - if (!$util.isString(message.action)) - return "action: string expected"; - if (message.originalResource != null && message.hasOwnProperty("originalResource")) { - var error = $root.google.protobuf.Struct.verify(message.originalResource); - if (error) - return "originalResource." + error; - } - if (message.newResource != null && message.hasOwnProperty("newResource")) { - var error = $root.google.protobuf.Struct.verify(message.newResource); - if (error) - return "newResource." + error; - } - if (message.dependentResources != null && message.hasOwnProperty("dependentResources")) { - if (!Array.isArray(message.dependentResources)) - return "dependentResources: array expected"; - for (var i = 0; i < message.dependentResources.length; ++i) { - var error = $root.google.protobuf.Struct.verify(message.dependentResources[i]); - if (error) - return "dependentResources." + error; - } - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) - if (!$util.isInteger(message.sequenceNumber) && !(message.sequenceNumber && $util.isInteger(message.sequenceNumber.low) && $util.isInteger(message.sequenceNumber.high))) - return "sequenceNumber: integer|Long expected"; - return null; - }; - - /** - * Creates a Changelog message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Changelog - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Changelog} Changelog - */ - Changelog.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Changelog) - return object; - var message = new $root.google.cloud.ces.v1beta.Changelog(); - if (object.name != null) - message.name = String(object.name); - if (object.author != null) - message.author = String(object.author); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.resource != null) - message.resource = String(object.resource); - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - if (object.action != null) - message.action = String(object.action); - if (object.originalResource != null) { - if (typeof object.originalResource !== "object") - throw TypeError(".google.cloud.ces.v1beta.Changelog.originalResource: object expected"); - message.originalResource = $root.google.protobuf.Struct.fromObject(object.originalResource); - } - if (object.newResource != null) { - if (typeof object.newResource !== "object") - throw TypeError(".google.cloud.ces.v1beta.Changelog.newResource: object expected"); - message.newResource = $root.google.protobuf.Struct.fromObject(object.newResource); - } - if (object.dependentResources) { - if (!Array.isArray(object.dependentResources)) - throw TypeError(".google.cloud.ces.v1beta.Changelog.dependentResources: array expected"); - message.dependentResources = []; - for (var i = 0; i < object.dependentResources.length; ++i) { - if (typeof object.dependentResources[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Changelog.dependentResources: object expected"); - message.dependentResources[i] = $root.google.protobuf.Struct.fromObject(object.dependentResources[i]); - } - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.Changelog.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.sequenceNumber != null) - if ($util.Long) - (message.sequenceNumber = $util.Long.fromValue(object.sequenceNumber)).unsigned = false; - else if (typeof object.sequenceNumber === "string") - message.sequenceNumber = parseInt(object.sequenceNumber, 10); - else if (typeof object.sequenceNumber === "number") - message.sequenceNumber = object.sequenceNumber; - else if (typeof object.sequenceNumber === "object") - message.sequenceNumber = new $util.LongBits(object.sequenceNumber.low >>> 0, object.sequenceNumber.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a Changelog message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Changelog - * @static - * @param {google.cloud.ces.v1beta.Changelog} message Changelog - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Changelog.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.dependentResources = []; - if (options.defaults) { - object.name = ""; - object.author = ""; - object.displayName = ""; - object.resource = ""; - object.resourceType = ""; - object.action = ""; - object.originalResource = null; - object.newResource = null; - object.createTime = null; - object.description = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sequenceNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequenceNumber = options.longs === String ? "0" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.author != null && message.hasOwnProperty("author")) - object.author = message.author; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - if (message.action != null && message.hasOwnProperty("action")) - object.action = message.action; - if (message.originalResource != null && message.hasOwnProperty("originalResource")) - object.originalResource = $root.google.protobuf.Struct.toObject(message.originalResource, options); - if (message.newResource != null && message.hasOwnProperty("newResource")) - object.newResource = $root.google.protobuf.Struct.toObject(message.newResource, options); - if (message.dependentResources && message.dependentResources.length) { - object.dependentResources = []; - for (var j = 0; j < message.dependentResources.length; ++j) - object.dependentResources[j] = $root.google.protobuf.Struct.toObject(message.dependentResources[j], options); - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) - if (typeof message.sequenceNumber === "number") - object.sequenceNumber = options.longs === String ? String(message.sequenceNumber) : message.sequenceNumber; - else - object.sequenceNumber = options.longs === String ? $util.Long.prototype.toString.call(message.sequenceNumber) : options.longs === Number ? new $util.LongBits(message.sequenceNumber.low >>> 0, message.sequenceNumber.high >>> 0).toNumber() : message.sequenceNumber; - return object; - }; - - /** - * Converts this Changelog to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Changelog - * @instance - * @returns {Object.} JSON object - */ - Changelog.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Changelog - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Changelog - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Changelog.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Changelog"; - }; - - return Changelog; - })(); - - v1beta.Conversation = (function() { - - /** - * Properties of a Conversation. - * @memberof google.cloud.ces.v1beta - * @interface IConversation - * @property {string|null} [name] Conversation name - * @property {google.protobuf.ITimestamp|null} [startTime] Conversation startTime - * @property {google.protobuf.ITimestamp|null} [endTime] Conversation endTime - * @property {Array.|null} [turns] Conversation turns - * @property {number|null} [turnCount] Conversation turnCount - * @property {google.cloud.ces.v1beta.Conversation.ChannelType|null} [channelType] Conversation channelType - * @property {google.cloud.ces.v1beta.Conversation.Source|null} [source] Conversation source - * @property {Array.|null} [inputTypes] Conversation inputTypes - * @property {string|null} [entryAgent] Conversation entryAgent - * @property {string|null} [deployment] Conversation deployment - * @property {string|null} [appVersion] Conversation appVersion - * @property {string|null} [languageCode] Conversation languageCode - * @property {Array.|null} [messages] Conversation messages - */ - - /** - * Constructs a new Conversation. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a Conversation. - * @implements IConversation - * @constructor - * @param {google.cloud.ces.v1beta.IConversation=} [properties] Properties to set - */ - function Conversation(properties) { - this.turns = []; - this.inputTypes = []; - this.messages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Conversation name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.Conversation - * @instance - */ - Conversation.prototype.name = ""; - - /** - * Conversation startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.ces.v1beta.Conversation - * @instance - */ - Conversation.prototype.startTime = null; - - /** - * Conversation endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.ces.v1beta.Conversation - * @instance - */ - Conversation.prototype.endTime = null; - - /** - * Conversation turns. - * @member {Array.} turns - * @memberof google.cloud.ces.v1beta.Conversation - * @instance - */ - Conversation.prototype.turns = $util.emptyArray; - - /** - * Conversation turnCount. - * @member {number} turnCount - * @memberof google.cloud.ces.v1beta.Conversation - * @instance - */ - Conversation.prototype.turnCount = 0; - - /** - * Conversation channelType. - * @member {google.cloud.ces.v1beta.Conversation.ChannelType} channelType - * @memberof google.cloud.ces.v1beta.Conversation - * @instance - */ - Conversation.prototype.channelType = 0; - - /** - * Conversation source. - * @member {google.cloud.ces.v1beta.Conversation.Source} source - * @memberof google.cloud.ces.v1beta.Conversation - * @instance - */ - Conversation.prototype.source = 0; - - /** - * Conversation inputTypes. - * @member {Array.} inputTypes - * @memberof google.cloud.ces.v1beta.Conversation - * @instance - */ - Conversation.prototype.inputTypes = $util.emptyArray; - - /** - * Conversation entryAgent. - * @member {string} entryAgent - * @memberof google.cloud.ces.v1beta.Conversation - * @instance - */ - Conversation.prototype.entryAgent = ""; - - /** - * Conversation deployment. - * @member {string} deployment - * @memberof google.cloud.ces.v1beta.Conversation - * @instance - */ - Conversation.prototype.deployment = ""; - - /** - * Conversation appVersion. - * @member {string} appVersion - * @memberof google.cloud.ces.v1beta.Conversation - * @instance - */ - Conversation.prototype.appVersion = ""; - - /** - * Conversation languageCode. - * @member {string} languageCode - * @memberof google.cloud.ces.v1beta.Conversation - * @instance - */ - Conversation.prototype.languageCode = ""; - - /** - * Conversation messages. - * @member {Array.} messages - * @memberof google.cloud.ces.v1beta.Conversation - * @instance - */ - Conversation.prototype.messages = $util.emptyArray; - - /** - * Creates a new Conversation instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Conversation - * @static - * @param {google.cloud.ces.v1beta.IConversation=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Conversation} Conversation instance - */ - Conversation.create = function create(properties) { - return new Conversation(properties); - }; - - /** - * Encodes the specified Conversation message. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Conversation - * @static - * @param {google.cloud.ces.v1beta.IConversation} message Conversation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Conversation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.google.cloud.ces.v1beta.Message.encode(message.messages[i], 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 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.turns != null && message.turns.length) - for (var i = 0; i < message.turns.length; ++i) - $root.google.cloud.ces.v1beta.Conversation.Turn.encode(message.turns[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.turnCount != null && Object.hasOwnProperty.call(message, "turnCount")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.turnCount); - if (message.channelType != null && Object.hasOwnProperty.call(message, "channelType")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.channelType); - if (message.source != null && Object.hasOwnProperty.call(message, "source")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.source); - if (message.inputTypes != null && message.inputTypes.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.inputTypes.length; ++i) - writer.int32(message.inputTypes[i]); - writer.ldelim(); - } - if (message.entryAgent != null && Object.hasOwnProperty.call(message, "entryAgent")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.entryAgent); - if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.deployment); - if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.appVersion); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.languageCode); - return writer; - }; - - /** - * Encodes the specified Conversation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Conversation - * @static - * @param {google.cloud.ces.v1beta.IConversation} message Conversation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Conversation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Conversation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Conversation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Conversation} Conversation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Conversation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Conversation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - if (!(message.turns && message.turns.length)) - message.turns = []; - message.turns.push($root.google.cloud.ces.v1beta.Conversation.Turn.decode(reader, reader.uint32())); - break; - } - case 7: { - message.turnCount = reader.int32(); - break; - } - case 8: { - message.channelType = reader.int32(); - break; - } - case 9: { - message.source = reader.int32(); - break; - } - case 10: { - if (!(message.inputTypes && message.inputTypes.length)) - message.inputTypes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.inputTypes.push(reader.int32()); - } else - message.inputTypes.push(reader.int32()); - break; - } - case 11: { - message.entryAgent = reader.string(); - break; - } - case 12: { - message.deployment = reader.string(); - break; - } - case 13: { - message.appVersion = reader.string(); - break; - } - case 14: { - message.languageCode = reader.string(); - break; - } - case 2: { - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Conversation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Conversation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Conversation} Conversation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Conversation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Conversation message. - * @function verify - * @memberof google.cloud.ces.v1beta.Conversation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Conversation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string 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.turns != null && message.hasOwnProperty("turns")) { - if (!Array.isArray(message.turns)) - return "turns: array expected"; - for (var i = 0; i < message.turns.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Conversation.Turn.verify(message.turns[i]); - if (error) - return "turns." + error; - } - } - if (message.turnCount != null && message.hasOwnProperty("turnCount")) - if (!$util.isInteger(message.turnCount)) - return "turnCount: integer expected"; - if (message.channelType != null && message.hasOwnProperty("channelType")) - switch (message.channelType) { - default: - return "channelType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.source != null && message.hasOwnProperty("source")) - switch (message.source) { - default: - return "source: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.inputTypes != null && message.hasOwnProperty("inputTypes")) { - if (!Array.isArray(message.inputTypes)) - return "inputTypes: array expected"; - for (var i = 0; i < message.inputTypes.length; ++i) - switch (message.inputTypes[i]) { - default: - return "inputTypes: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - } - if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) - if (!$util.isString(message.entryAgent)) - return "entryAgent: string expected"; - if (message.deployment != null && message.hasOwnProperty("deployment")) - if (!$util.isString(message.deployment)) - return "deployment: string expected"; - if (message.appVersion != null && message.hasOwnProperty("appVersion")) - if (!$util.isString(message.appVersion)) - return "appVersion: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Message.verify(message.messages[i]); - if (error) - return "messages." + error; - } - } - return null; - }; - - /** - * Creates a Conversation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Conversation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Conversation} Conversation - */ - Conversation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Conversation) - return object; - var message = new $root.google.cloud.ces.v1beta.Conversation(); - if (object.name != null) - message.name = String(object.name); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.Conversation.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.ces.v1beta.Conversation.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.turns) { - if (!Array.isArray(object.turns)) - throw TypeError(".google.cloud.ces.v1beta.Conversation.turns: array expected"); - message.turns = []; - for (var i = 0; i < object.turns.length; ++i) { - if (typeof object.turns[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Conversation.turns: object expected"); - message.turns[i] = $root.google.cloud.ces.v1beta.Conversation.Turn.fromObject(object.turns[i]); - } - } - if (object.turnCount != null) - message.turnCount = object.turnCount | 0; - switch (object.channelType) { - default: - if (typeof object.channelType === "number") { - message.channelType = object.channelType; - break; - } - break; - case "CHANNEL_TYPE_UNSPECIFIED": - case 0: - message.channelType = 0; - break; - case "TEXT": - case 1: - message.channelType = 1; - break; - case "AUDIO": - case 2: - message.channelType = 2; - break; - case "MULTIMODAL": - case 3: - message.channelType = 3; - break; - } - switch (object.source) { - default: - if (typeof object.source === "number") { - message.source = object.source; - break; - } - break; - case "SOURCE_UNSPECIFIED": - case 0: - message.source = 0; - break; - case "LIVE": - case 1: - message.source = 1; - break; - case "SIMULATOR": - case 2: - message.source = 2; - break; - case "EVAL": - case 3: - message.source = 3; - break; - } - if (object.inputTypes) { - if (!Array.isArray(object.inputTypes)) - throw TypeError(".google.cloud.ces.v1beta.Conversation.inputTypes: array expected"); - message.inputTypes = []; - for (var i = 0; i < object.inputTypes.length; ++i) - switch (object.inputTypes[i]) { - default: - if (typeof object.inputTypes[i] === "number") { - message.inputTypes[i] = object.inputTypes[i]; - break; - } - case "INPUT_TYPE_UNSPECIFIED": - case 0: - message.inputTypes[i] = 0; - break; - case "INPUT_TYPE_TEXT": - case 1: - message.inputTypes[i] = 1; - break; - case "INPUT_TYPE_AUDIO": - case 2: - message.inputTypes[i] = 2; - break; - case "INPUT_TYPE_IMAGE": - case 3: - message.inputTypes[i] = 3; - break; - case "INPUT_TYPE_BLOB": - case 4: - message.inputTypes[i] = 4; - break; - case "INPUT_TYPE_TOOL_RESPONSE": - case 5: - message.inputTypes[i] = 5; - break; - case "INPUT_TYPE_VARIABLES": - case 6: - message.inputTypes[i] = 6; - break; - } - } - if (object.entryAgent != null) - message.entryAgent = String(object.entryAgent); - if (object.deployment != null) - message.deployment = String(object.deployment); - if (object.appVersion != null) - message.appVersion = String(object.appVersion); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".google.cloud.ces.v1beta.Conversation.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Conversation.messages: object expected"); - message.messages[i] = $root.google.cloud.ces.v1beta.Message.fromObject(object.messages[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Conversation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Conversation - * @static - * @param {google.cloud.ces.v1beta.Conversation} message Conversation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Conversation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.messages = []; - object.turns = []; - object.inputTypes = []; - } - if (options.defaults) { - object.name = ""; - object.startTime = null; - object.endTime = null; - object.turnCount = 0; - object.channelType = options.enums === String ? "CHANNEL_TYPE_UNSPECIFIED" : 0; - object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; - object.entryAgent = ""; - object.deployment = ""; - object.appVersion = ""; - object.languageCode = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.cloud.ces.v1beta.Message.toObject(message.messages[j], options); - } - 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.turns && message.turns.length) { - object.turns = []; - for (var j = 0; j < message.turns.length; ++j) - object.turns[j] = $root.google.cloud.ces.v1beta.Conversation.Turn.toObject(message.turns[j], options); - } - if (message.turnCount != null && message.hasOwnProperty("turnCount")) - object.turnCount = message.turnCount; - if (message.channelType != null && message.hasOwnProperty("channelType")) - object.channelType = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.ChannelType[message.channelType] === undefined ? message.channelType : $root.google.cloud.ces.v1beta.Conversation.ChannelType[message.channelType] : message.channelType; - if (message.source != null && message.hasOwnProperty("source")) - object.source = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1beta.Conversation.Source[message.source] : message.source; - if (message.inputTypes && message.inputTypes.length) { - object.inputTypes = []; - for (var j = 0; j < message.inputTypes.length; ++j) - object.inputTypes[j] = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.InputType[message.inputTypes[j]] === undefined ? message.inputTypes[j] : $root.google.cloud.ces.v1beta.Conversation.InputType[message.inputTypes[j]] : message.inputTypes[j]; - } - if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) - object.entryAgent = message.entryAgent; - if (message.deployment != null && message.hasOwnProperty("deployment")) - object.deployment = message.deployment; - if (message.appVersion != null && message.hasOwnProperty("appVersion")) - object.appVersion = message.appVersion; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - return object; - }; - - /** - * Converts this Conversation to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Conversation - * @instance - * @returns {Object.} JSON object - */ - Conversation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Conversation - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Conversation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Conversation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Conversation"; - }; - - Conversation.Turn = (function() { - - /** - * Properties of a Turn. - * @memberof google.cloud.ces.v1beta.Conversation - * @interface ITurn - * @property {Array.|null} [messages] Turn messages - * @property {google.cloud.ces.v1beta.ISpan|null} [rootSpan] Turn rootSpan - */ - - /** - * Constructs a new Turn. - * @memberof google.cloud.ces.v1beta.Conversation - * @classdesc Represents a Turn. - * @implements ITurn - * @constructor - * @param {google.cloud.ces.v1beta.Conversation.ITurn=} [properties] Properties to set - */ - function Turn(properties) { - this.messages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Turn messages. - * @member {Array.} messages - * @memberof google.cloud.ces.v1beta.Conversation.Turn - * @instance - */ - Turn.prototype.messages = $util.emptyArray; - - /** - * Turn rootSpan. - * @member {google.cloud.ces.v1beta.ISpan|null|undefined} rootSpan - * @memberof google.cloud.ces.v1beta.Conversation.Turn - * @instance - */ - Turn.prototype.rootSpan = null; - - /** - * Creates a new Turn instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Conversation.Turn - * @static - * @param {google.cloud.ces.v1beta.Conversation.ITurn=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Conversation.Turn} Turn instance - */ - Turn.create = function create(properties) { - return new Turn(properties); - }; - - /** - * Encodes the specified Turn message. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.Turn.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Conversation.Turn - * @static - * @param {google.cloud.ces.v1beta.Conversation.ITurn} message Turn message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Turn.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.google.cloud.ces.v1beta.Message.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.rootSpan != null && Object.hasOwnProperty.call(message, "rootSpan")) - $root.google.cloud.ces.v1beta.Span.encode(message.rootSpan, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Turn message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.Turn.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Conversation.Turn - * @static - * @param {google.cloud.ces.v1beta.Conversation.ITurn} message Turn message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Turn.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Turn message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Conversation.Turn - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Conversation.Turn} Turn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Turn.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Conversation.Turn(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32())); - break; - } - case 2: { - message.rootSpan = $root.google.cloud.ces.v1beta.Span.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Turn message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Conversation.Turn - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Conversation.Turn} Turn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Turn.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Turn message. - * @function verify - * @memberof google.cloud.ces.v1beta.Conversation.Turn - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Turn.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Message.verify(message.messages[i]); - if (error) - return "messages." + error; - } - } - if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) { - var error = $root.google.cloud.ces.v1beta.Span.verify(message.rootSpan); - if (error) - return "rootSpan." + error; - } - return null; - }; - - /** - * Creates a Turn message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Conversation.Turn - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Conversation.Turn} Turn - */ - Turn.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Conversation.Turn) - return object; - var message = new $root.google.cloud.ces.v1beta.Conversation.Turn(); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".google.cloud.ces.v1beta.Conversation.Turn.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Conversation.Turn.messages: object expected"); - message.messages[i] = $root.google.cloud.ces.v1beta.Message.fromObject(object.messages[i]); - } - } - if (object.rootSpan != null) { - if (typeof object.rootSpan !== "object") - throw TypeError(".google.cloud.ces.v1beta.Conversation.Turn.rootSpan: object expected"); - message.rootSpan = $root.google.cloud.ces.v1beta.Span.fromObject(object.rootSpan); - } - return message; - }; - - /** - * Creates a plain object from a Turn message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Conversation.Turn - * @static - * @param {google.cloud.ces.v1beta.Conversation.Turn} message Turn - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Turn.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.messages = []; - if (options.defaults) - object.rootSpan = null; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.cloud.ces.v1beta.Message.toObject(message.messages[j], options); - } - if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) - object.rootSpan = $root.google.cloud.ces.v1beta.Span.toObject(message.rootSpan, options); - return object; - }; - - /** - * Converts this Turn to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Conversation.Turn - * @instance - * @returns {Object.} JSON object - */ - Turn.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Turn - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Conversation.Turn - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Turn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Conversation.Turn"; - }; - - return Turn; - })(); - - /** - * ChannelType enum. - * @name google.cloud.ces.v1beta.Conversation.ChannelType - * @enum {number} - * @property {number} CHANNEL_TYPE_UNSPECIFIED=0 CHANNEL_TYPE_UNSPECIFIED value - * @property {number} TEXT=1 TEXT value - * @property {number} AUDIO=2 AUDIO value - * @property {number} MULTIMODAL=3 MULTIMODAL value - */ - Conversation.ChannelType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CHANNEL_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "TEXT"] = 1; - values[valuesById[2] = "AUDIO"] = 2; - values[valuesById[3] = "MULTIMODAL"] = 3; - return values; - })(); - - /** - * Source enum. - * @name google.cloud.ces.v1beta.Conversation.Source - * @enum {number} - * @property {number} SOURCE_UNSPECIFIED=0 SOURCE_UNSPECIFIED value - * @property {number} LIVE=1 LIVE value - * @property {number} SIMULATOR=2 SIMULATOR value - * @property {number} EVAL=3 EVAL value - */ - Conversation.Source = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SOURCE_UNSPECIFIED"] = 0; - values[valuesById[1] = "LIVE"] = 1; - values[valuesById[2] = "SIMULATOR"] = 2; - values[valuesById[3] = "EVAL"] = 3; - return values; - })(); - - /** - * InputType enum. - * @name google.cloud.ces.v1beta.Conversation.InputType - * @enum {number} - * @property {number} INPUT_TYPE_UNSPECIFIED=0 INPUT_TYPE_UNSPECIFIED value - * @property {number} INPUT_TYPE_TEXT=1 INPUT_TYPE_TEXT value - * @property {number} INPUT_TYPE_AUDIO=2 INPUT_TYPE_AUDIO value - * @property {number} INPUT_TYPE_IMAGE=3 INPUT_TYPE_IMAGE value - * @property {number} INPUT_TYPE_BLOB=4 INPUT_TYPE_BLOB value - * @property {number} INPUT_TYPE_TOOL_RESPONSE=5 INPUT_TYPE_TOOL_RESPONSE value - * @property {number} INPUT_TYPE_VARIABLES=6 INPUT_TYPE_VARIABLES value - */ - Conversation.InputType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INPUT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INPUT_TYPE_TEXT"] = 1; - values[valuesById[2] = "INPUT_TYPE_AUDIO"] = 2; - values[valuesById[3] = "INPUT_TYPE_IMAGE"] = 3; - values[valuesById[4] = "INPUT_TYPE_BLOB"] = 4; - values[valuesById[5] = "INPUT_TYPE_TOOL_RESPONSE"] = 5; - values[valuesById[6] = "INPUT_TYPE_VARIABLES"] = 6; - return values; - })(); - - return Conversation; - })(); - - v1beta.Deployment = (function() { - - /** - * Properties of a Deployment. - * @memberof google.cloud.ces.v1beta - * @interface IDeployment - * @property {string|null} [name] Deployment name - * @property {string|null} [displayName] Deployment displayName - * @property {string|null} [appVersion] Deployment appVersion - * @property {google.cloud.ces.v1beta.IChannelProfile|null} [channelProfile] Deployment channelProfile - * @property {google.protobuf.ITimestamp|null} [createTime] Deployment createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Deployment updateTime - * @property {string|null} [etag] Deployment etag - */ - - /** - * Constructs a new Deployment. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a Deployment. - * @implements IDeployment - * @constructor - * @param {google.cloud.ces.v1beta.IDeployment=} [properties] Properties to set - */ - function Deployment(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Deployment name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.Deployment - * @instance - */ - Deployment.prototype.name = ""; - - /** - * Deployment displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.Deployment - * @instance - */ - Deployment.prototype.displayName = ""; - - /** - * Deployment appVersion. - * @member {string} appVersion - * @memberof google.cloud.ces.v1beta.Deployment - * @instance - */ - Deployment.prototype.appVersion = ""; - - /** - * Deployment channelProfile. - * @member {google.cloud.ces.v1beta.IChannelProfile|null|undefined} channelProfile - * @memberof google.cloud.ces.v1beta.Deployment - * @instance - */ - Deployment.prototype.channelProfile = null; - - /** - * Deployment createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.Deployment - * @instance - */ - Deployment.prototype.createTime = null; - - /** - * Deployment updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1beta.Deployment - * @instance - */ - Deployment.prototype.updateTime = null; - - /** - * Deployment etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.Deployment - * @instance - */ - Deployment.prototype.etag = ""; - - /** - * Creates a new Deployment instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Deployment - * @static - * @param {google.cloud.ces.v1beta.IDeployment=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Deployment} Deployment instance - */ - Deployment.create = function create(properties) { - return new Deployment(properties); - }; - - /** - * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.ces.v1beta.Deployment.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Deployment - * @static - * @param {google.cloud.ces.v1beta.IDeployment} message Deployment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Deployment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.appVersion); - if (message.channelProfile != null && Object.hasOwnProperty.call(message, "channelProfile")) - $root.google.cloud.ces.v1beta.ChannelProfile.encode(message.channelProfile, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - 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.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Deployment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Deployment - * @static - * @param {google.cloud.ces.v1beta.IDeployment} message Deployment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Deployment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Deployment message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Deployment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Deployment} Deployment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Deployment.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Deployment(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 8: { - message.displayName = reader.string(); - break; - } - case 2: { - message.appVersion = reader.string(); - break; - } - case 3: { - message.channelProfile = $root.google.cloud.ces.v1beta.ChannelProfile.decode(reader, reader.uint32()); - 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 7: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Deployment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Deployment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Deployment} Deployment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Deployment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Deployment message. - * @function verify - * @memberof google.cloud.ces.v1beta.Deployment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Deployment.verify = function verify(message) { - if (typeof message !== "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.appVersion != null && message.hasOwnProperty("appVersion")) - if (!$util.isString(message.appVersion)) - return "appVersion: string expected"; - if (message.channelProfile != null && message.hasOwnProperty("channelProfile")) { - var error = $root.google.cloud.ces.v1beta.ChannelProfile.verify(message.channelProfile); - if (error) - return "channelProfile." + error; - } - 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.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a Deployment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Deployment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Deployment} Deployment - */ - Deployment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Deployment) - return object; - var message = new $root.google.cloud.ces.v1beta.Deployment(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.appVersion != null) - message.appVersion = String(object.appVersion); - if (object.channelProfile != null) { - if (typeof object.channelProfile !== "object") - throw TypeError(".google.cloud.ces.v1beta.Deployment.channelProfile: object expected"); - message.channelProfile = $root.google.cloud.ces.v1beta.ChannelProfile.fromObject(object.channelProfile); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.Deployment.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.ces.v1beta.Deployment.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a Deployment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Deployment - * @static - * @param {google.cloud.ces.v1beta.Deployment} message Deployment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Deployment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.appVersion = ""; - object.channelProfile = null; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - object.displayName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.appVersion != null && message.hasOwnProperty("appVersion")) - object.appVersion = message.appVersion; - if (message.channelProfile != null && message.hasOwnProperty("channelProfile")) - object.channelProfile = $root.google.cloud.ces.v1beta.ChannelProfile.toObject(message.channelProfile, options); - 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.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this Deployment to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Deployment - * @instance - * @returns {Object.} JSON object - */ - Deployment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Deployment - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Deployment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Deployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Deployment"; - }; - - return Deployment; - })(); - - v1beta.AggregatedMetrics = (function() { - - /** - * Properties of an AggregatedMetrics. - * @memberof google.cloud.ces.v1beta - * @interface IAggregatedMetrics - * @property {Array.|null} [metricsByAppVersion] AggregatedMetrics metricsByAppVersion - */ - - /** - * Constructs a new AggregatedMetrics. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an AggregatedMetrics. - * @implements IAggregatedMetrics - * @constructor - * @param {google.cloud.ces.v1beta.IAggregatedMetrics=} [properties] Properties to set - */ - function AggregatedMetrics(properties) { - this.metricsByAppVersion = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AggregatedMetrics metricsByAppVersion. - * @member {Array.} metricsByAppVersion - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @instance - */ - AggregatedMetrics.prototype.metricsByAppVersion = $util.emptyArray; - - /** - * Creates a new AggregatedMetrics instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @static - * @param {google.cloud.ces.v1beta.IAggregatedMetrics=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.AggregatedMetrics} AggregatedMetrics instance - */ - AggregatedMetrics.create = function create(properties) { - return new AggregatedMetrics(properties); - }; - - /** - * Encodes the specified AggregatedMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @static - * @param {google.cloud.ces.v1beta.IAggregatedMetrics} message AggregatedMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AggregatedMetrics.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.metricsByAppVersion != null && message.metricsByAppVersion.length) - for (var i = 0; i < message.metricsByAppVersion.length; ++i) - $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.encode(message.metricsByAppVersion[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AggregatedMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @static - * @param {google.cloud.ces.v1beta.IAggregatedMetrics} message AggregatedMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AggregatedMetrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AggregatedMetrics message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.AggregatedMetrics} AggregatedMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AggregatedMetrics.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - if (!(message.metricsByAppVersion && message.metricsByAppVersion.length)) - message.metricsByAppVersion = []; - message.metricsByAppVersion.push($root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AggregatedMetrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.AggregatedMetrics} AggregatedMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AggregatedMetrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AggregatedMetrics message. - * @function verify - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AggregatedMetrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.metricsByAppVersion != null && message.hasOwnProperty("metricsByAppVersion")) { - if (!Array.isArray(message.metricsByAppVersion)) - return "metricsByAppVersion: array expected"; - for (var i = 0; i < message.metricsByAppVersion.length; ++i) { - var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.verify(message.metricsByAppVersion[i]); - if (error) - return "metricsByAppVersion." + error; - } - } - return null; - }; - - /** - * Creates an AggregatedMetrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.AggregatedMetrics} AggregatedMetrics - */ - AggregatedMetrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics) - return object; - var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics(); - if (object.metricsByAppVersion) { - if (!Array.isArray(object.metricsByAppVersion)) - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.metricsByAppVersion: array expected"); - message.metricsByAppVersion = []; - for (var i = 0; i < object.metricsByAppVersion.length; ++i) { - if (typeof object.metricsByAppVersion[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.metricsByAppVersion: object expected"); - message.metricsByAppVersion[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.fromObject(object.metricsByAppVersion[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AggregatedMetrics message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics} message AggregatedMetrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AggregatedMetrics.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.metricsByAppVersion = []; - if (message.metricsByAppVersion && message.metricsByAppVersion.length) { - object.metricsByAppVersion = []; - for (var j = 0; j < message.metricsByAppVersion.length; ++j) - object.metricsByAppVersion[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.toObject(message.metricsByAppVersion[j], options); - } - return object; - }; - - /** - * Converts this AggregatedMetrics to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @instance - * @returns {Object.} JSON object - */ - AggregatedMetrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AggregatedMetrics - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AggregatedMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics"; - }; - - AggregatedMetrics.ToolMetrics = (function() { - - /** - * Properties of a ToolMetrics. - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @interface IToolMetrics - * @property {string|null} [tool] ToolMetrics tool - * @property {number|null} [passCount] ToolMetrics passCount - * @property {number|null} [failCount] ToolMetrics failCount - */ - - /** - * Constructs a new ToolMetrics. - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @classdesc Represents a ToolMetrics. - * @implements IToolMetrics - * @constructor - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics=} [properties] Properties to set - */ - function ToolMetrics(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolMetrics tool. - * @member {string} tool - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics - * @instance - */ - ToolMetrics.prototype.tool = ""; - - /** - * ToolMetrics passCount. - * @member {number} passCount - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics - * @instance - */ - ToolMetrics.prototype.passCount = 0; - - /** - * ToolMetrics failCount. - * @member {number} failCount - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics - * @instance - */ - ToolMetrics.prototype.failCount = 0; - - /** - * Creates a new ToolMetrics instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics} ToolMetrics instance - */ - ToolMetrics.create = function create(properties) { - return new ToolMetrics(properties); - }; - - /** - * Encodes the specified ToolMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics} message ToolMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolMetrics.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); - if (message.passCount != null && Object.hasOwnProperty.call(message, "passCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.passCount); - if (message.failCount != null && Object.hasOwnProperty.call(message, "failCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.failCount); - return writer; - }; - - /** - * Encodes the specified ToolMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics} message ToolMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolMetrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolMetrics message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics} ToolMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolMetrics.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tool = reader.string(); - break; - } - case 2: { - message.passCount = reader.int32(); - break; - } - case 3: { - message.failCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolMetrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics} ToolMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolMetrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolMetrics message. - * @function verify - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolMetrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tool != null && message.hasOwnProperty("tool")) - if (!$util.isString(message.tool)) - return "tool: string expected"; - if (message.passCount != null && message.hasOwnProperty("passCount")) - if (!$util.isInteger(message.passCount)) - return "passCount: integer expected"; - if (message.failCount != null && message.hasOwnProperty("failCount")) - if (!$util.isInteger(message.failCount)) - return "failCount: integer expected"; - return null; - }; - - /** - * Creates a ToolMetrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics} ToolMetrics - */ - ToolMetrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics) - return object; - var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics(); - if (object.tool != null) - message.tool = String(object.tool); - if (object.passCount != null) - message.passCount = object.passCount | 0; - if (object.failCount != null) - message.failCount = object.failCount | 0; - return message; - }; - - /** - * Creates a plain object from a ToolMetrics message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics} message ToolMetrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolMetrics.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.tool = ""; - object.passCount = 0; - object.failCount = 0; - } - if (message.tool != null && message.hasOwnProperty("tool")) - object.tool = message.tool; - if (message.passCount != null && message.hasOwnProperty("passCount")) - object.passCount = message.passCount; - if (message.failCount != null && message.hasOwnProperty("failCount")) - object.failCount = message.failCount; - return object; - }; - - /** - * Converts this ToolMetrics to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics - * @instance - * @returns {Object.} JSON object - */ - ToolMetrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolMetrics - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics"; - }; - - return ToolMetrics; - })(); - - AggregatedMetrics.TurnLatencyMetrics = (function() { - - /** - * Properties of a TurnLatencyMetrics. - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @interface ITurnLatencyMetrics - * @property {google.protobuf.IDuration|null} [averageLatency] TurnLatencyMetrics averageLatency - */ - - /** - * Constructs a new TurnLatencyMetrics. - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @classdesc Represents a TurnLatencyMetrics. - * @implements ITurnLatencyMetrics - * @constructor - * @param {google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics=} [properties] Properties to set - */ - function TurnLatencyMetrics(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TurnLatencyMetrics averageLatency. - * @member {google.protobuf.IDuration|null|undefined} averageLatency - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics - * @instance - */ - TurnLatencyMetrics.prototype.averageLatency = null; - - /** - * Creates a new TurnLatencyMetrics instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics} TurnLatencyMetrics instance - */ - TurnLatencyMetrics.create = function create(properties) { - return new TurnLatencyMetrics(properties); - }; - - /** - * Encodes the specified TurnLatencyMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics} message TurnLatencyMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TurnLatencyMetrics.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.averageLatency != null && Object.hasOwnProperty.call(message, "averageLatency")) - $root.google.protobuf.Duration.encode(message.averageLatency, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TurnLatencyMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics} message TurnLatencyMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TurnLatencyMetrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TurnLatencyMetrics message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics} TurnLatencyMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TurnLatencyMetrics.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.averageLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TurnLatencyMetrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics} TurnLatencyMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TurnLatencyMetrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TurnLatencyMetrics message. - * @function verify - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TurnLatencyMetrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.averageLatency != null && message.hasOwnProperty("averageLatency")) { - var error = $root.google.protobuf.Duration.verify(message.averageLatency); - if (error) - return "averageLatency." + error; - } - return null; - }; - - /** - * Creates a TurnLatencyMetrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics} TurnLatencyMetrics - */ - TurnLatencyMetrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics) - return object; - var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics(); - if (object.averageLatency != null) { - if (typeof object.averageLatency !== "object") - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.averageLatency: object expected"); - message.averageLatency = $root.google.protobuf.Duration.fromObject(object.averageLatency); - } - return message; - }; - - /** - * Creates a plain object from a TurnLatencyMetrics message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics} message TurnLatencyMetrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TurnLatencyMetrics.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.averageLatency = null; - if (message.averageLatency != null && message.hasOwnProperty("averageLatency")) - object.averageLatency = $root.google.protobuf.Duration.toObject(message.averageLatency, options); - return object; - }; - - /** - * Converts this TurnLatencyMetrics to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics - * @instance - * @returns {Object.} JSON object - */ - TurnLatencyMetrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TurnLatencyMetrics - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TurnLatencyMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics"; - }; - - return TurnLatencyMetrics; - })(); - - AggregatedMetrics.ToolCallLatencyMetrics = (function() { - - /** - * Properties of a ToolCallLatencyMetrics. - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @interface IToolCallLatencyMetrics - * @property {string|null} [tool] ToolCallLatencyMetrics tool - * @property {google.protobuf.IDuration|null} [averageLatency] ToolCallLatencyMetrics averageLatency - */ - - /** - * Constructs a new ToolCallLatencyMetrics. - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @classdesc Represents a ToolCallLatencyMetrics. - * @implements IToolCallLatencyMetrics - * @constructor - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics=} [properties] Properties to set - */ - function ToolCallLatencyMetrics(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolCallLatencyMetrics tool. - * @member {string} tool - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics - * @instance - */ - ToolCallLatencyMetrics.prototype.tool = ""; - - /** - * ToolCallLatencyMetrics averageLatency. - * @member {google.protobuf.IDuration|null|undefined} averageLatency - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics - * @instance - */ - ToolCallLatencyMetrics.prototype.averageLatency = null; - - /** - * Creates a new ToolCallLatencyMetrics instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics} ToolCallLatencyMetrics instance - */ - ToolCallLatencyMetrics.create = function create(properties) { - return new ToolCallLatencyMetrics(properties); - }; - - /** - * Encodes the specified ToolCallLatencyMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics} message ToolCallLatencyMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolCallLatencyMetrics.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); - if (message.averageLatency != null && Object.hasOwnProperty.call(message, "averageLatency")) - $root.google.protobuf.Duration.encode(message.averageLatency, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ToolCallLatencyMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics} message ToolCallLatencyMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolCallLatencyMetrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolCallLatencyMetrics message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics} ToolCallLatencyMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolCallLatencyMetrics.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tool = reader.string(); - break; - } - case 2: { - message.averageLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolCallLatencyMetrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics} ToolCallLatencyMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolCallLatencyMetrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolCallLatencyMetrics message. - * @function verify - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolCallLatencyMetrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tool != null && message.hasOwnProperty("tool")) - if (!$util.isString(message.tool)) - return "tool: string expected"; - if (message.averageLatency != null && message.hasOwnProperty("averageLatency")) { - var error = $root.google.protobuf.Duration.verify(message.averageLatency); - if (error) - return "averageLatency." + error; - } - return null; - }; - - /** - * Creates a ToolCallLatencyMetrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics} ToolCallLatencyMetrics - */ - ToolCallLatencyMetrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics) - return object; - var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics(); - if (object.tool != null) - message.tool = String(object.tool); - if (object.averageLatency != null) { - if (typeof object.averageLatency !== "object") - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.averageLatency: object expected"); - message.averageLatency = $root.google.protobuf.Duration.fromObject(object.averageLatency); - } - return message; - }; - - /** - * Creates a plain object from a ToolCallLatencyMetrics message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics} message ToolCallLatencyMetrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolCallLatencyMetrics.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.tool = ""; - object.averageLatency = null; - } - if (message.tool != null && message.hasOwnProperty("tool")) - object.tool = message.tool; - if (message.averageLatency != null && message.hasOwnProperty("averageLatency")) - object.averageLatency = $root.google.protobuf.Duration.toObject(message.averageLatency, options); - return object; - }; - - /** - * Converts this ToolCallLatencyMetrics to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics - * @instance - * @returns {Object.} JSON object - */ - ToolCallLatencyMetrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolCallLatencyMetrics - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolCallLatencyMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics"; - }; - - return ToolCallLatencyMetrics; - })(); - - AggregatedMetrics.SemanticSimilarityMetrics = (function() { - - /** - * Properties of a SemanticSimilarityMetrics. - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @interface ISemanticSimilarityMetrics - * @property {number|null} [score] SemanticSimilarityMetrics score - */ - - /** - * Constructs a new SemanticSimilarityMetrics. - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @classdesc Represents a SemanticSimilarityMetrics. - * @implements ISemanticSimilarityMetrics - * @constructor - * @param {google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics=} [properties] Properties to set - */ - function SemanticSimilarityMetrics(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SemanticSimilarityMetrics score. - * @member {number} score - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics - * @instance - */ - SemanticSimilarityMetrics.prototype.score = 0; - - /** - * Creates a new SemanticSimilarityMetrics instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics} SemanticSimilarityMetrics instance - */ - SemanticSimilarityMetrics.create = function create(properties) { - return new SemanticSimilarityMetrics(properties); - }; - - /** - * Encodes the specified SemanticSimilarityMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics} message SemanticSimilarityMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SemanticSimilarityMetrics.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); - return writer; - }; - - /** - * Encodes the specified SemanticSimilarityMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics} message SemanticSimilarityMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SemanticSimilarityMetrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SemanticSimilarityMetrics message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics} SemanticSimilarityMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SemanticSimilarityMetrics.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.score = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SemanticSimilarityMetrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics} SemanticSimilarityMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SemanticSimilarityMetrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SemanticSimilarityMetrics message. - * @function verify - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SemanticSimilarityMetrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.score != null && message.hasOwnProperty("score")) - if (typeof message.score !== "number") - return "score: number expected"; - return null; - }; - - /** - * Creates a SemanticSimilarityMetrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics} SemanticSimilarityMetrics - */ - SemanticSimilarityMetrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics) - return object; - var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics(); - if (object.score != null) - message.score = Number(object.score); - return message; - }; - - /** - * Creates a plain object from a SemanticSimilarityMetrics message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics} message SemanticSimilarityMetrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SemanticSimilarityMetrics.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.score = 0; - if (message.score != null && message.hasOwnProperty("score")) - object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; - return object; - }; - - /** - * Converts this SemanticSimilarityMetrics to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics - * @instance - * @returns {Object.} JSON object - */ - SemanticSimilarityMetrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SemanticSimilarityMetrics - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SemanticSimilarityMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics"; - }; - - return SemanticSimilarityMetrics; - })(); - - AggregatedMetrics.HallucinationMetrics = (function() { - - /** - * Properties of a HallucinationMetrics. - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @interface IHallucinationMetrics - * @property {number|null} [score] HallucinationMetrics score - */ - - /** - * Constructs a new HallucinationMetrics. - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @classdesc Represents a HallucinationMetrics. - * @implements IHallucinationMetrics - * @constructor - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics=} [properties] Properties to set - */ - function HallucinationMetrics(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HallucinationMetrics score. - * @member {number} score - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics - * @instance - */ - HallucinationMetrics.prototype.score = 0; - - /** - * Creates a new HallucinationMetrics instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics} HallucinationMetrics instance - */ - HallucinationMetrics.create = function create(properties) { - return new HallucinationMetrics(properties); - }; - - /** - * Encodes the specified HallucinationMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics} message HallucinationMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HallucinationMetrics.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); - return writer; - }; - - /** - * Encodes the specified HallucinationMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics} message HallucinationMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HallucinationMetrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HallucinationMetrics message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics} HallucinationMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HallucinationMetrics.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.score = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HallucinationMetrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics} HallucinationMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HallucinationMetrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HallucinationMetrics message. - * @function verify - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HallucinationMetrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.score != null && message.hasOwnProperty("score")) - if (typeof message.score !== "number") - return "score: number expected"; - return null; - }; - - /** - * Creates a HallucinationMetrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics} HallucinationMetrics - */ - HallucinationMetrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics) - return object; - var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics(); - if (object.score != null) - message.score = Number(object.score); - return message; - }; - - /** - * Creates a plain object from a HallucinationMetrics message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics} message HallucinationMetrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HallucinationMetrics.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.score = 0; - if (message.score != null && message.hasOwnProperty("score")) - object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; - return object; - }; - - /** - * Converts this HallucinationMetrics to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics - * @instance - * @returns {Object.} JSON object - */ - HallucinationMetrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HallucinationMetrics - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HallucinationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics"; - }; - - return HallucinationMetrics; - })(); - - AggregatedMetrics.MetricsByAppVersion = (function() { - - /** - * Properties of a MetricsByAppVersion. - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @interface IMetricsByAppVersion - * @property {string|null} [appVersionId] MetricsByAppVersion appVersionId - * @property {Array.|null} [toolMetrics] MetricsByAppVersion toolMetrics - * @property {Array.|null} [semanticSimilarityMetrics] MetricsByAppVersion semanticSimilarityMetrics - * @property {Array.|null} [hallucinationMetrics] MetricsByAppVersion hallucinationMetrics - * @property {Array.|null} [toolCallLatencyMetrics] MetricsByAppVersion toolCallLatencyMetrics - * @property {Array.|null} [turnLatencyMetrics] MetricsByAppVersion turnLatencyMetrics - * @property {number|null} [passCount] MetricsByAppVersion passCount - * @property {number|null} [failCount] MetricsByAppVersion failCount - * @property {Array.|null} [metricsByTurn] MetricsByAppVersion metricsByTurn - */ - - /** - * Constructs a new MetricsByAppVersion. - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @classdesc Represents a MetricsByAppVersion. - * @implements IMetricsByAppVersion - * @constructor - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion=} [properties] Properties to set - */ - function MetricsByAppVersion(properties) { - this.toolMetrics = []; - this.semanticSimilarityMetrics = []; - this.hallucinationMetrics = []; - this.toolCallLatencyMetrics = []; - this.turnLatencyMetrics = []; - this.metricsByTurn = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MetricsByAppVersion appVersionId. - * @member {string} appVersionId - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @instance - */ - MetricsByAppVersion.prototype.appVersionId = ""; - - /** - * MetricsByAppVersion toolMetrics. - * @member {Array.} toolMetrics - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @instance - */ - MetricsByAppVersion.prototype.toolMetrics = $util.emptyArray; - - /** - * MetricsByAppVersion semanticSimilarityMetrics. - * @member {Array.} semanticSimilarityMetrics - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @instance - */ - MetricsByAppVersion.prototype.semanticSimilarityMetrics = $util.emptyArray; - - /** - * MetricsByAppVersion hallucinationMetrics. - * @member {Array.} hallucinationMetrics - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @instance - */ - MetricsByAppVersion.prototype.hallucinationMetrics = $util.emptyArray; - - /** - * MetricsByAppVersion toolCallLatencyMetrics. - * @member {Array.} toolCallLatencyMetrics - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @instance - */ - MetricsByAppVersion.prototype.toolCallLatencyMetrics = $util.emptyArray; - - /** - * MetricsByAppVersion turnLatencyMetrics. - * @member {Array.} turnLatencyMetrics - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @instance - */ - MetricsByAppVersion.prototype.turnLatencyMetrics = $util.emptyArray; - - /** - * MetricsByAppVersion passCount. - * @member {number} passCount - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @instance - */ - MetricsByAppVersion.prototype.passCount = 0; - - /** - * MetricsByAppVersion failCount. - * @member {number} failCount - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @instance - */ - MetricsByAppVersion.prototype.failCount = 0; - - /** - * MetricsByAppVersion metricsByTurn. - * @member {Array.} metricsByTurn - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @instance - */ - MetricsByAppVersion.prototype.metricsByTurn = $util.emptyArray; - - /** - * Creates a new MetricsByAppVersion instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion} MetricsByAppVersion instance - */ - MetricsByAppVersion.create = function create(properties) { - return new MetricsByAppVersion(properties); - }; - - /** - * Encodes the specified MetricsByAppVersion message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion} message MetricsByAppVersion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricsByAppVersion.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.appVersionId != null && Object.hasOwnProperty.call(message, "appVersionId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.appVersionId); - if (message.toolMetrics != null && message.toolMetrics.length) - for (var i = 0; i < message.toolMetrics.length; ++i) - $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.encode(message.toolMetrics[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.semanticSimilarityMetrics != null && message.semanticSimilarityMetrics.length) - for (var i = 0; i < message.semanticSimilarityMetrics.length; ++i) - $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.encode(message.semanticSimilarityMetrics[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.metricsByTurn != null && message.metricsByTurn.length) - for (var i = 0; i < message.metricsByTurn.length; ++i) - $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.encode(message.metricsByTurn[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.hallucinationMetrics != null && message.hallucinationMetrics.length) - for (var i = 0; i < message.hallucinationMetrics.length; ++i) - $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.encode(message.hallucinationMetrics[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.toolCallLatencyMetrics != null && message.toolCallLatencyMetrics.length) - for (var i = 0; i < message.toolCallLatencyMetrics.length; ++i) - $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.encode(message.toolCallLatencyMetrics[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.turnLatencyMetrics != null && message.turnLatencyMetrics.length) - for (var i = 0; i < message.turnLatencyMetrics.length; ++i) - $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.encode(message.turnLatencyMetrics[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.passCount != null && Object.hasOwnProperty.call(message, "passCount")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.passCount); - if (message.failCount != null && Object.hasOwnProperty.call(message, "failCount")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.failCount); - return writer; - }; - - /** - * Encodes the specified MetricsByAppVersion message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion} message MetricsByAppVersion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricsByAppVersion.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MetricsByAppVersion message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion} MetricsByAppVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricsByAppVersion.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.appVersionId = reader.string(); - break; - } - case 2: { - if (!(message.toolMetrics && message.toolMetrics.length)) - message.toolMetrics = []; - message.toolMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.semanticSimilarityMetrics && message.semanticSimilarityMetrics.length)) - message.semanticSimilarityMetrics = []; - message.semanticSimilarityMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.hallucinationMetrics && message.hallucinationMetrics.length)) - message.hallucinationMetrics = []; - message.hallucinationMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.toolCallLatencyMetrics && message.toolCallLatencyMetrics.length)) - message.toolCallLatencyMetrics = []; - message.toolCallLatencyMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.turnLatencyMetrics && message.turnLatencyMetrics.length)) - message.turnLatencyMetrics = []; - message.turnLatencyMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.decode(reader, reader.uint32())); - break; - } - case 8: { - message.passCount = reader.int32(); - break; - } - case 9: { - message.failCount = reader.int32(); - break; - } - case 4: { - if (!(message.metricsByTurn && message.metricsByTurn.length)) - message.metricsByTurn = []; - message.metricsByTurn.push($root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MetricsByAppVersion message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion} MetricsByAppVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricsByAppVersion.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MetricsByAppVersion message. - * @function verify - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MetricsByAppVersion.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.appVersionId != null && message.hasOwnProperty("appVersionId")) - if (!$util.isString(message.appVersionId)) - return "appVersionId: string expected"; - if (message.toolMetrics != null && message.hasOwnProperty("toolMetrics")) { - if (!Array.isArray(message.toolMetrics)) - return "toolMetrics: array expected"; - for (var i = 0; i < message.toolMetrics.length; ++i) { - var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.verify(message.toolMetrics[i]); - if (error) - return "toolMetrics." + error; - } - } - if (message.semanticSimilarityMetrics != null && message.hasOwnProperty("semanticSimilarityMetrics")) { - if (!Array.isArray(message.semanticSimilarityMetrics)) - return "semanticSimilarityMetrics: array expected"; - for (var i = 0; i < message.semanticSimilarityMetrics.length; ++i) { - var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.verify(message.semanticSimilarityMetrics[i]); - if (error) - return "semanticSimilarityMetrics." + error; - } - } - if (message.hallucinationMetrics != null && message.hasOwnProperty("hallucinationMetrics")) { - if (!Array.isArray(message.hallucinationMetrics)) - return "hallucinationMetrics: array expected"; - for (var i = 0; i < message.hallucinationMetrics.length; ++i) { - var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.verify(message.hallucinationMetrics[i]); - if (error) - return "hallucinationMetrics." + error; - } - } - if (message.toolCallLatencyMetrics != null && message.hasOwnProperty("toolCallLatencyMetrics")) { - if (!Array.isArray(message.toolCallLatencyMetrics)) - return "toolCallLatencyMetrics: array expected"; - for (var i = 0; i < message.toolCallLatencyMetrics.length; ++i) { - var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.verify(message.toolCallLatencyMetrics[i]); - if (error) - return "toolCallLatencyMetrics." + error; - } - } - if (message.turnLatencyMetrics != null && message.hasOwnProperty("turnLatencyMetrics")) { - if (!Array.isArray(message.turnLatencyMetrics)) - return "turnLatencyMetrics: array expected"; - for (var i = 0; i < message.turnLatencyMetrics.length; ++i) { - var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.verify(message.turnLatencyMetrics[i]); - if (error) - return "turnLatencyMetrics." + error; - } - } - if (message.passCount != null && message.hasOwnProperty("passCount")) - if (!$util.isInteger(message.passCount)) - return "passCount: integer expected"; - if (message.failCount != null && message.hasOwnProperty("failCount")) - if (!$util.isInteger(message.failCount)) - return "failCount: integer expected"; - if (message.metricsByTurn != null && message.hasOwnProperty("metricsByTurn")) { - if (!Array.isArray(message.metricsByTurn)) - return "metricsByTurn: array expected"; - for (var i = 0; i < message.metricsByTurn.length; ++i) { - var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.verify(message.metricsByTurn[i]); - if (error) - return "metricsByTurn." + error; - } - } - return null; - }; - - /** - * Creates a MetricsByAppVersion message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion} MetricsByAppVersion - */ - MetricsByAppVersion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion) - return object; - var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion(); - if (object.appVersionId != null) - message.appVersionId = String(object.appVersionId); - if (object.toolMetrics) { - if (!Array.isArray(object.toolMetrics)) - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.toolMetrics: array expected"); - message.toolMetrics = []; - for (var i = 0; i < object.toolMetrics.length; ++i) { - if (typeof object.toolMetrics[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.toolMetrics: object expected"); - message.toolMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.fromObject(object.toolMetrics[i]); - } - } - if (object.semanticSimilarityMetrics) { - if (!Array.isArray(object.semanticSimilarityMetrics)) - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.semanticSimilarityMetrics: array expected"); - message.semanticSimilarityMetrics = []; - for (var i = 0; i < object.semanticSimilarityMetrics.length; ++i) { - if (typeof object.semanticSimilarityMetrics[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.semanticSimilarityMetrics: object expected"); - message.semanticSimilarityMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.fromObject(object.semanticSimilarityMetrics[i]); - } - } - if (object.hallucinationMetrics) { - if (!Array.isArray(object.hallucinationMetrics)) - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.hallucinationMetrics: array expected"); - message.hallucinationMetrics = []; - for (var i = 0; i < object.hallucinationMetrics.length; ++i) { - if (typeof object.hallucinationMetrics[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.hallucinationMetrics: object expected"); - message.hallucinationMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.fromObject(object.hallucinationMetrics[i]); - } - } - if (object.toolCallLatencyMetrics) { - if (!Array.isArray(object.toolCallLatencyMetrics)) - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.toolCallLatencyMetrics: array expected"); - message.toolCallLatencyMetrics = []; - for (var i = 0; i < object.toolCallLatencyMetrics.length; ++i) { - if (typeof object.toolCallLatencyMetrics[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.toolCallLatencyMetrics: object expected"); - message.toolCallLatencyMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.fromObject(object.toolCallLatencyMetrics[i]); - } - } - if (object.turnLatencyMetrics) { - if (!Array.isArray(object.turnLatencyMetrics)) - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.turnLatencyMetrics: array expected"); - message.turnLatencyMetrics = []; - for (var i = 0; i < object.turnLatencyMetrics.length; ++i) { - if (typeof object.turnLatencyMetrics[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.turnLatencyMetrics: object expected"); - message.turnLatencyMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.fromObject(object.turnLatencyMetrics[i]); - } - } - if (object.passCount != null) - message.passCount = object.passCount | 0; - if (object.failCount != null) - message.failCount = object.failCount | 0; - if (object.metricsByTurn) { - if (!Array.isArray(object.metricsByTurn)) - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.metricsByTurn: array expected"); - message.metricsByTurn = []; - for (var i = 0; i < object.metricsByTurn.length; ++i) { - if (typeof object.metricsByTurn[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.metricsByTurn: object expected"); - message.metricsByTurn[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.fromObject(object.metricsByTurn[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a MetricsByAppVersion message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion} message MetricsByAppVersion - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MetricsByAppVersion.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.toolMetrics = []; - object.semanticSimilarityMetrics = []; - object.metricsByTurn = []; - object.hallucinationMetrics = []; - object.toolCallLatencyMetrics = []; - object.turnLatencyMetrics = []; - } - if (options.defaults) { - object.appVersionId = ""; - object.passCount = 0; - object.failCount = 0; - } - if (message.appVersionId != null && message.hasOwnProperty("appVersionId")) - object.appVersionId = message.appVersionId; - if (message.toolMetrics && message.toolMetrics.length) { - object.toolMetrics = []; - for (var j = 0; j < message.toolMetrics.length; ++j) - object.toolMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.toObject(message.toolMetrics[j], options); - } - if (message.semanticSimilarityMetrics && message.semanticSimilarityMetrics.length) { - object.semanticSimilarityMetrics = []; - for (var j = 0; j < message.semanticSimilarityMetrics.length; ++j) - object.semanticSimilarityMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.toObject(message.semanticSimilarityMetrics[j], options); - } - if (message.metricsByTurn && message.metricsByTurn.length) { - object.metricsByTurn = []; - for (var j = 0; j < message.metricsByTurn.length; ++j) - object.metricsByTurn[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.toObject(message.metricsByTurn[j], options); - } - if (message.hallucinationMetrics && message.hallucinationMetrics.length) { - object.hallucinationMetrics = []; - for (var j = 0; j < message.hallucinationMetrics.length; ++j) - object.hallucinationMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.toObject(message.hallucinationMetrics[j], options); - } - if (message.toolCallLatencyMetrics && message.toolCallLatencyMetrics.length) { - object.toolCallLatencyMetrics = []; - for (var j = 0; j < message.toolCallLatencyMetrics.length; ++j) - object.toolCallLatencyMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.toObject(message.toolCallLatencyMetrics[j], options); - } - if (message.turnLatencyMetrics && message.turnLatencyMetrics.length) { - object.turnLatencyMetrics = []; - for (var j = 0; j < message.turnLatencyMetrics.length; ++j) - object.turnLatencyMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.toObject(message.turnLatencyMetrics[j], options); - } - if (message.passCount != null && message.hasOwnProperty("passCount")) - object.passCount = message.passCount; - if (message.failCount != null && message.hasOwnProperty("failCount")) - object.failCount = message.failCount; - return object; - }; - - /** - * Converts this MetricsByAppVersion to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @instance - * @returns {Object.} JSON object - */ - MetricsByAppVersion.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MetricsByAppVersion - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MetricsByAppVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion"; - }; - - return MetricsByAppVersion; - })(); - - AggregatedMetrics.MetricsByTurn = (function() { - - /** - * Properties of a MetricsByTurn. - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @interface IMetricsByTurn - * @property {number|null} [turnIndex] MetricsByTurn turnIndex - * @property {Array.|null} [toolMetrics] MetricsByTurn toolMetrics - * @property {Array.|null} [semanticSimilarityMetrics] MetricsByTurn semanticSimilarityMetrics - * @property {Array.|null} [hallucinationMetrics] MetricsByTurn hallucinationMetrics - * @property {Array.|null} [toolCallLatencyMetrics] MetricsByTurn toolCallLatencyMetrics - * @property {Array.|null} [turnLatencyMetrics] MetricsByTurn turnLatencyMetrics - */ - - /** - * Constructs a new MetricsByTurn. - * @memberof google.cloud.ces.v1beta.AggregatedMetrics - * @classdesc Represents a MetricsByTurn. - * @implements IMetricsByTurn - * @constructor - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn=} [properties] Properties to set - */ - function MetricsByTurn(properties) { - this.toolMetrics = []; - this.semanticSimilarityMetrics = []; - this.hallucinationMetrics = []; - this.toolCallLatencyMetrics = []; - this.turnLatencyMetrics = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MetricsByTurn turnIndex. - * @member {number} turnIndex - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn - * @instance - */ - MetricsByTurn.prototype.turnIndex = 0; - - /** - * MetricsByTurn toolMetrics. - * @member {Array.} toolMetrics - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn - * @instance - */ - MetricsByTurn.prototype.toolMetrics = $util.emptyArray; - - /** - * MetricsByTurn semanticSimilarityMetrics. - * @member {Array.} semanticSimilarityMetrics - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn - * @instance - */ - MetricsByTurn.prototype.semanticSimilarityMetrics = $util.emptyArray; - - /** - * MetricsByTurn hallucinationMetrics. - * @member {Array.} hallucinationMetrics - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn - * @instance - */ - MetricsByTurn.prototype.hallucinationMetrics = $util.emptyArray; - - /** - * MetricsByTurn toolCallLatencyMetrics. - * @member {Array.} toolCallLatencyMetrics - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn - * @instance - */ - MetricsByTurn.prototype.toolCallLatencyMetrics = $util.emptyArray; - - /** - * MetricsByTurn turnLatencyMetrics. - * @member {Array.} turnLatencyMetrics - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn - * @instance - */ - MetricsByTurn.prototype.turnLatencyMetrics = $util.emptyArray; - - /** - * Creates a new MetricsByTurn instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn} MetricsByTurn instance - */ - MetricsByTurn.create = function create(properties) { - return new MetricsByTurn(properties); - }; - - /** - * Encodes the specified MetricsByTurn message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn} message MetricsByTurn message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricsByTurn.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.turnIndex != null && Object.hasOwnProperty.call(message, "turnIndex")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.turnIndex); - if (message.toolMetrics != null && message.toolMetrics.length) - for (var i = 0; i < message.toolMetrics.length; ++i) - $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.encode(message.toolMetrics[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.semanticSimilarityMetrics != null && message.semanticSimilarityMetrics.length) - for (var i = 0; i < message.semanticSimilarityMetrics.length; ++i) - $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.encode(message.semanticSimilarityMetrics[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.hallucinationMetrics != null && message.hallucinationMetrics.length) - for (var i = 0; i < message.hallucinationMetrics.length; ++i) - $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.encode(message.hallucinationMetrics[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.toolCallLatencyMetrics != null && message.toolCallLatencyMetrics.length) - for (var i = 0; i < message.toolCallLatencyMetrics.length; ++i) - $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.encode(message.toolCallLatencyMetrics[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.turnLatencyMetrics != null && message.turnLatencyMetrics.length) - for (var i = 0; i < message.turnLatencyMetrics.length; ++i) - $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.encode(message.turnLatencyMetrics[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MetricsByTurn message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn} message MetricsByTurn message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricsByTurn.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MetricsByTurn message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn} MetricsByTurn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricsByTurn.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.turnIndex = reader.int32(); - break; - } - case 2: { - if (!(message.toolMetrics && message.toolMetrics.length)) - message.toolMetrics = []; - message.toolMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.semanticSimilarityMetrics && message.semanticSimilarityMetrics.length)) - message.semanticSimilarityMetrics = []; - message.semanticSimilarityMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.hallucinationMetrics && message.hallucinationMetrics.length)) - message.hallucinationMetrics = []; - message.hallucinationMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.toolCallLatencyMetrics && message.toolCallLatencyMetrics.length)) - message.toolCallLatencyMetrics = []; - message.toolCallLatencyMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.turnLatencyMetrics && message.turnLatencyMetrics.length)) - message.turnLatencyMetrics = []; - message.turnLatencyMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MetricsByTurn message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn} MetricsByTurn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricsByTurn.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MetricsByTurn message. - * @function verify - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MetricsByTurn.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.turnIndex != null && message.hasOwnProperty("turnIndex")) - if (!$util.isInteger(message.turnIndex)) - return "turnIndex: integer expected"; - if (message.toolMetrics != null && message.hasOwnProperty("toolMetrics")) { - if (!Array.isArray(message.toolMetrics)) - return "toolMetrics: array expected"; - for (var i = 0; i < message.toolMetrics.length; ++i) { - var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.verify(message.toolMetrics[i]); - if (error) - return "toolMetrics." + error; - } - } - if (message.semanticSimilarityMetrics != null && message.hasOwnProperty("semanticSimilarityMetrics")) { - if (!Array.isArray(message.semanticSimilarityMetrics)) - return "semanticSimilarityMetrics: array expected"; - for (var i = 0; i < message.semanticSimilarityMetrics.length; ++i) { - var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.verify(message.semanticSimilarityMetrics[i]); - if (error) - return "semanticSimilarityMetrics." + error; - } - } - if (message.hallucinationMetrics != null && message.hasOwnProperty("hallucinationMetrics")) { - if (!Array.isArray(message.hallucinationMetrics)) - return "hallucinationMetrics: array expected"; - for (var i = 0; i < message.hallucinationMetrics.length; ++i) { - var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.verify(message.hallucinationMetrics[i]); - if (error) - return "hallucinationMetrics." + error; - } - } - if (message.toolCallLatencyMetrics != null && message.hasOwnProperty("toolCallLatencyMetrics")) { - if (!Array.isArray(message.toolCallLatencyMetrics)) - return "toolCallLatencyMetrics: array expected"; - for (var i = 0; i < message.toolCallLatencyMetrics.length; ++i) { - var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.verify(message.toolCallLatencyMetrics[i]); - if (error) - return "toolCallLatencyMetrics." + error; - } - } - if (message.turnLatencyMetrics != null && message.hasOwnProperty("turnLatencyMetrics")) { - if (!Array.isArray(message.turnLatencyMetrics)) - return "turnLatencyMetrics: array expected"; - for (var i = 0; i < message.turnLatencyMetrics.length; ++i) { - var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.verify(message.turnLatencyMetrics[i]); - if (error) - return "turnLatencyMetrics." + error; - } - } - return null; - }; - - /** - * Creates a MetricsByTurn message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn} MetricsByTurn - */ - MetricsByTurn.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn) - return object; - var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn(); - if (object.turnIndex != null) - message.turnIndex = object.turnIndex | 0; - if (object.toolMetrics) { - if (!Array.isArray(object.toolMetrics)) - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.toolMetrics: array expected"); - message.toolMetrics = []; - for (var i = 0; i < object.toolMetrics.length; ++i) { - if (typeof object.toolMetrics[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.toolMetrics: object expected"); - message.toolMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.fromObject(object.toolMetrics[i]); - } - } - if (object.semanticSimilarityMetrics) { - if (!Array.isArray(object.semanticSimilarityMetrics)) - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.semanticSimilarityMetrics: array expected"); - message.semanticSimilarityMetrics = []; - for (var i = 0; i < object.semanticSimilarityMetrics.length; ++i) { - if (typeof object.semanticSimilarityMetrics[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.semanticSimilarityMetrics: object expected"); - message.semanticSimilarityMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.fromObject(object.semanticSimilarityMetrics[i]); - } - } - if (object.hallucinationMetrics) { - if (!Array.isArray(object.hallucinationMetrics)) - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.hallucinationMetrics: array expected"); - message.hallucinationMetrics = []; - for (var i = 0; i < object.hallucinationMetrics.length; ++i) { - if (typeof object.hallucinationMetrics[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.hallucinationMetrics: object expected"); - message.hallucinationMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.fromObject(object.hallucinationMetrics[i]); - } - } - if (object.toolCallLatencyMetrics) { - if (!Array.isArray(object.toolCallLatencyMetrics)) - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.toolCallLatencyMetrics: array expected"); - message.toolCallLatencyMetrics = []; - for (var i = 0; i < object.toolCallLatencyMetrics.length; ++i) { - if (typeof object.toolCallLatencyMetrics[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.toolCallLatencyMetrics: object expected"); - message.toolCallLatencyMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.fromObject(object.toolCallLatencyMetrics[i]); - } - } - if (object.turnLatencyMetrics) { - if (!Array.isArray(object.turnLatencyMetrics)) - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.turnLatencyMetrics: array expected"); - message.turnLatencyMetrics = []; - for (var i = 0; i < object.turnLatencyMetrics.length; ++i) { - if (typeof object.turnLatencyMetrics[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.turnLatencyMetrics: object expected"); - message.turnLatencyMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.fromObject(object.turnLatencyMetrics[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a MetricsByTurn message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn - * @static - * @param {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn} message MetricsByTurn - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MetricsByTurn.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.toolMetrics = []; - object.semanticSimilarityMetrics = []; - object.hallucinationMetrics = []; - object.toolCallLatencyMetrics = []; - object.turnLatencyMetrics = []; - } - if (options.defaults) - object.turnIndex = 0; - if (message.turnIndex != null && message.hasOwnProperty("turnIndex")) - object.turnIndex = message.turnIndex; - if (message.toolMetrics && message.toolMetrics.length) { - object.toolMetrics = []; - for (var j = 0; j < message.toolMetrics.length; ++j) - object.toolMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.toObject(message.toolMetrics[j], options); - } - if (message.semanticSimilarityMetrics && message.semanticSimilarityMetrics.length) { - object.semanticSimilarityMetrics = []; - for (var j = 0; j < message.semanticSimilarityMetrics.length; ++j) - object.semanticSimilarityMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.toObject(message.semanticSimilarityMetrics[j], options); - } - if (message.hallucinationMetrics && message.hallucinationMetrics.length) { - object.hallucinationMetrics = []; - for (var j = 0; j < message.hallucinationMetrics.length; ++j) - object.hallucinationMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.toObject(message.hallucinationMetrics[j], options); - } - if (message.toolCallLatencyMetrics && message.toolCallLatencyMetrics.length) { - object.toolCallLatencyMetrics = []; - for (var j = 0; j < message.toolCallLatencyMetrics.length; ++j) - object.toolCallLatencyMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.toObject(message.toolCallLatencyMetrics[j], options); - } - if (message.turnLatencyMetrics && message.turnLatencyMetrics.length) { - object.turnLatencyMetrics = []; - for (var j = 0; j < message.turnLatencyMetrics.length; ++j) - object.turnLatencyMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.toObject(message.turnLatencyMetrics[j], options); - } - return object; - }; - - /** - * Converts this MetricsByTurn to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn - * @instance - * @returns {Object.} JSON object - */ - MetricsByTurn.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MetricsByTurn - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MetricsByTurn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn"; - }; - - return MetricsByTurn; - })(); - - return AggregatedMetrics; - })(); - - v1beta.Evaluation = (function() { - - /** - * Properties of an Evaluation. - * @memberof google.cloud.ces.v1beta - * @interface IEvaluation - * @property {google.cloud.ces.v1beta.Evaluation.IGolden|null} [golden] Evaluation golden - * @property {google.cloud.ces.v1beta.Evaluation.IScenario|null} [scenario] Evaluation scenario - * @property {string|null} [name] Evaluation name - * @property {string|null} [displayName] Evaluation displayName - * @property {string|null} [description] Evaluation description - * @property {Array.|null} [tags] Evaluation tags - * @property {Array.|null} [evaluationDatasets] Evaluation evaluationDatasets - * @property {google.protobuf.ITimestamp|null} [createTime] Evaluation createTime - * @property {string|null} [createdBy] Evaluation createdBy - * @property {google.protobuf.ITimestamp|null} [updateTime] Evaluation updateTime - * @property {string|null} [lastUpdatedBy] Evaluation lastUpdatedBy - * @property {Array.|null} [evaluationRuns] Evaluation evaluationRuns - * @property {string|null} [etag] Evaluation etag - * @property {google.cloud.ces.v1beta.IAggregatedMetrics|null} [aggregatedMetrics] Evaluation aggregatedMetrics - * @property {google.cloud.ces.v1beta.IEvaluationResult|null} [lastCompletedResult] Evaluation lastCompletedResult - * @property {boolean|null} [invalid] Evaluation invalid - * @property {Array.|null} [lastTenResults] Evaluation lastTenResults - */ - - /** - * Constructs a new Evaluation. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an Evaluation. - * @implements IEvaluation - * @constructor - * @param {google.cloud.ces.v1beta.IEvaluation=} [properties] Properties to set - */ - function Evaluation(properties) { - this.tags = []; - this.evaluationDatasets = []; - this.evaluationRuns = []; - this.lastTenResults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Evaluation golden. - * @member {google.cloud.ces.v1beta.Evaluation.IGolden|null|undefined} golden - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - */ - Evaluation.prototype.golden = null; - - /** - * Evaluation scenario. - * @member {google.cloud.ces.v1beta.Evaluation.IScenario|null|undefined} scenario - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - */ - Evaluation.prototype.scenario = null; - - /** - * Evaluation name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - */ - Evaluation.prototype.name = ""; - - /** - * Evaluation displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - */ - Evaluation.prototype.displayName = ""; - - /** - * Evaluation description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - */ - Evaluation.prototype.description = ""; - - /** - * Evaluation tags. - * @member {Array.} tags - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - */ - Evaluation.prototype.tags = $util.emptyArray; - - /** - * Evaluation evaluationDatasets. - * @member {Array.} evaluationDatasets - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - */ - Evaluation.prototype.evaluationDatasets = $util.emptyArray; - - /** - * Evaluation createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - */ - Evaluation.prototype.createTime = null; - - /** - * Evaluation createdBy. - * @member {string} createdBy - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - */ - Evaluation.prototype.createdBy = ""; - - /** - * Evaluation updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - */ - Evaluation.prototype.updateTime = null; - - /** - * Evaluation lastUpdatedBy. - * @member {string} lastUpdatedBy - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - */ - Evaluation.prototype.lastUpdatedBy = ""; - - /** - * Evaluation evaluationRuns. - * @member {Array.} evaluationRuns - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - */ - Evaluation.prototype.evaluationRuns = $util.emptyArray; - - /** - * Evaluation etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - */ - Evaluation.prototype.etag = ""; - - /** - * Evaluation aggregatedMetrics. - * @member {google.cloud.ces.v1beta.IAggregatedMetrics|null|undefined} aggregatedMetrics - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - */ - Evaluation.prototype.aggregatedMetrics = null; - - /** - * Evaluation lastCompletedResult. - * @member {google.cloud.ces.v1beta.IEvaluationResult|null|undefined} lastCompletedResult - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - */ - Evaluation.prototype.lastCompletedResult = null; - - /** - * Evaluation invalid. - * @member {boolean} invalid - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - */ - Evaluation.prototype.invalid = false; - - /** - * Evaluation lastTenResults. - * @member {Array.} lastTenResults - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - */ - Evaluation.prototype.lastTenResults = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Evaluation inputs. - * @member {"golden"|"scenario"|undefined} inputs - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - */ - Object.defineProperty(Evaluation.prototype, "inputs", { - get: $util.oneOfGetter($oneOfFields = ["golden", "scenario"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Evaluation instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Evaluation - * @static - * @param {google.cloud.ces.v1beta.IEvaluation=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Evaluation} Evaluation instance - */ - Evaluation.create = function create(properties) { - return new Evaluation(properties); - }; - - /** - * Encodes the specified Evaluation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Evaluation - * @static - * @param {google.cloud.ces.v1beta.IEvaluation} message Evaluation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Evaluation.encode = function encode(message, writer) { - if (!writer) - 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.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.tags != null && message.tags.length) - for (var i = 0; i < message.tags.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.tags[i]); - if (message.evaluationDatasets != null && message.evaluationDatasets.length) - for (var i = 0; i < message.evaluationDatasets.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.evaluationDatasets[i]); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.etag); - if (message.golden != null && Object.hasOwnProperty.call(message, "golden")) - $root.google.cloud.ces.v1beta.Evaluation.Golden.encode(message.golden, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.scenario != null && Object.hasOwnProperty.call(message, "scenario")) - $root.google.cloud.ces.v1beta.Evaluation.Scenario.encode(message.scenario, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.createdBy != null && Object.hasOwnProperty.call(message, "createdBy")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.createdBy); - if (message.lastUpdatedBy != null && Object.hasOwnProperty.call(message, "lastUpdatedBy")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.lastUpdatedBy); - if (message.evaluationRuns != null && message.evaluationRuns.length) - for (var i = 0; i < message.evaluationRuns.length; ++i) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.evaluationRuns[i]); - if (message.aggregatedMetrics != null && Object.hasOwnProperty.call(message, "aggregatedMetrics")) - $root.google.cloud.ces.v1beta.AggregatedMetrics.encode(message.aggregatedMetrics, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.lastCompletedResult != null && Object.hasOwnProperty.call(message, "lastCompletedResult")) - $root.google.cloud.ces.v1beta.EvaluationResult.encode(message.lastCompletedResult, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.invalid != null && Object.hasOwnProperty.call(message, "invalid")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.invalid); - if (message.lastTenResults != null && message.lastTenResults.length) - for (var i = 0; i < message.lastTenResults.length; ++i) - $root.google.cloud.ces.v1beta.EvaluationResult.encode(message.lastTenResults[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Evaluation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Evaluation - * @static - * @param {google.cloud.ces.v1beta.IEvaluation} message Evaluation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Evaluation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Evaluation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Evaluation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Evaluation} Evaluation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Evaluation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 11: { - message.golden = $root.google.cloud.ces.v1beta.Evaluation.Golden.decode(reader, reader.uint32()); - break; - } - case 12: { - message.scenario = $root.google.cloud.ces.v1beta.Evaluation.Scenario.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - if (!(message.tags && message.tags.length)) - message.tags = []; - message.tags.push(reader.string()); - break; - } - case 5: { - if (!(message.evaluationDatasets && message.evaluationDatasets.length)) - message.evaluationDatasets = []; - message.evaluationDatasets.push(reader.string()); - break; - } - case 8: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 13: { - message.createdBy = reader.string(); - break; - } - case 9: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 14: { - message.lastUpdatedBy = reader.string(); - break; - } - case 15: { - if (!(message.evaluationRuns && message.evaluationRuns.length)) - message.evaluationRuns = []; - message.evaluationRuns.push(reader.string()); - break; - } - case 10: { - message.etag = reader.string(); - break; - } - case 16: { - message.aggregatedMetrics = $root.google.cloud.ces.v1beta.AggregatedMetrics.decode(reader, reader.uint32()); - break; - } - case 17: { - message.lastCompletedResult = $root.google.cloud.ces.v1beta.EvaluationResult.decode(reader, reader.uint32()); - break; - } - case 18: { - message.invalid = reader.bool(); - break; - } - case 19: { - if (!(message.lastTenResults && message.lastTenResults.length)) - message.lastTenResults = []; - message.lastTenResults.push($root.google.cloud.ces.v1beta.EvaluationResult.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Evaluation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Evaluation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Evaluation} Evaluation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Evaluation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Evaluation message. - * @function verify - * @memberof google.cloud.ces.v1beta.Evaluation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Evaluation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.golden != null && message.hasOwnProperty("golden")) { - properties.inputs = 1; - { - var error = $root.google.cloud.ces.v1beta.Evaluation.Golden.verify(message.golden); - if (error) - return "golden." + error; - } - } - if (message.scenario != null && message.hasOwnProperty("scenario")) { - if (properties.inputs === 1) - return "inputs: multiple values"; - properties.inputs = 1; - { - var error = $root.google.cloud.ces.v1beta.Evaluation.Scenario.verify(message.scenario); - if (error) - return "scenario." + 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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.tags != null && message.hasOwnProperty("tags")) { - if (!Array.isArray(message.tags)) - return "tags: array expected"; - for (var i = 0; i < message.tags.length; ++i) - if (!$util.isString(message.tags[i])) - return "tags: string[] expected"; - } - if (message.evaluationDatasets != null && message.hasOwnProperty("evaluationDatasets")) { - if (!Array.isArray(message.evaluationDatasets)) - return "evaluationDatasets: array expected"; - for (var i = 0; i < message.evaluationDatasets.length; ++i) - if (!$util.isString(message.evaluationDatasets[i])) - return "evaluationDatasets: 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.createdBy != null && message.hasOwnProperty("createdBy")) - if (!$util.isString(message.createdBy)) - return "createdBy: string expected"; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.lastUpdatedBy != null && message.hasOwnProperty("lastUpdatedBy")) - if (!$util.isString(message.lastUpdatedBy)) - return "lastUpdatedBy: string expected"; - if (message.evaluationRuns != null && message.hasOwnProperty("evaluationRuns")) { - if (!Array.isArray(message.evaluationRuns)) - return "evaluationRuns: array expected"; - for (var i = 0; i < message.evaluationRuns.length; ++i) - if (!$util.isString(message.evaluationRuns[i])) - return "evaluationRuns: string[] expected"; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.aggregatedMetrics != null && message.hasOwnProperty("aggregatedMetrics")) { - var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.verify(message.aggregatedMetrics); - if (error) - return "aggregatedMetrics." + error; - } - if (message.lastCompletedResult != null && message.hasOwnProperty("lastCompletedResult")) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.verify(message.lastCompletedResult); - if (error) - return "lastCompletedResult." + error; - } - if (message.invalid != null && message.hasOwnProperty("invalid")) - if (typeof message.invalid !== "boolean") - return "invalid: boolean expected"; - if (message.lastTenResults != null && message.hasOwnProperty("lastTenResults")) { - if (!Array.isArray(message.lastTenResults)) - return "lastTenResults: array expected"; - for (var i = 0; i < message.lastTenResults.length; ++i) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.verify(message.lastTenResults[i]); - if (error) - return "lastTenResults." + error; - } - } - return null; - }; - - /** - * Creates an Evaluation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Evaluation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Evaluation} Evaluation - */ - Evaluation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Evaluation) - return object; - var message = new $root.google.cloud.ces.v1beta.Evaluation(); - if (object.golden != null) { - if (typeof object.golden !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.golden: object expected"); - message.golden = $root.google.cloud.ces.v1beta.Evaluation.Golden.fromObject(object.golden); - } - if (object.scenario != null) { - if (typeof object.scenario !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.scenario: object expected"); - message.scenario = $root.google.cloud.ces.v1beta.Evaluation.Scenario.fromObject(object.scenario); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.tags) { - if (!Array.isArray(object.tags)) - throw TypeError(".google.cloud.ces.v1beta.Evaluation.tags: array expected"); - message.tags = []; - for (var i = 0; i < object.tags.length; ++i) - message.tags[i] = String(object.tags[i]); - } - if (object.evaluationDatasets) { - if (!Array.isArray(object.evaluationDatasets)) - throw TypeError(".google.cloud.ces.v1beta.Evaluation.evaluationDatasets: array expected"); - message.evaluationDatasets = []; - for (var i = 0; i < object.evaluationDatasets.length; ++i) - message.evaluationDatasets[i] = String(object.evaluationDatasets[i]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.createdBy != null) - message.createdBy = String(object.createdBy); - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.lastUpdatedBy != null) - message.lastUpdatedBy = String(object.lastUpdatedBy); - if (object.evaluationRuns) { - if (!Array.isArray(object.evaluationRuns)) - throw TypeError(".google.cloud.ces.v1beta.Evaluation.evaluationRuns: array expected"); - message.evaluationRuns = []; - for (var i = 0; i < object.evaluationRuns.length; ++i) - message.evaluationRuns[i] = String(object.evaluationRuns[i]); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.aggregatedMetrics != null) { - if (typeof object.aggregatedMetrics !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.aggregatedMetrics: object expected"); - message.aggregatedMetrics = $root.google.cloud.ces.v1beta.AggregatedMetrics.fromObject(object.aggregatedMetrics); - } - if (object.lastCompletedResult != null) { - if (typeof object.lastCompletedResult !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.lastCompletedResult: object expected"); - message.lastCompletedResult = $root.google.cloud.ces.v1beta.EvaluationResult.fromObject(object.lastCompletedResult); - } - if (object.invalid != null) - message.invalid = Boolean(object.invalid); - if (object.lastTenResults) { - if (!Array.isArray(object.lastTenResults)) - throw TypeError(".google.cloud.ces.v1beta.Evaluation.lastTenResults: array expected"); - message.lastTenResults = []; - for (var i = 0; i < object.lastTenResults.length; ++i) { - if (typeof object.lastTenResults[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.lastTenResults: object expected"); - message.lastTenResults[i] = $root.google.cloud.ces.v1beta.EvaluationResult.fromObject(object.lastTenResults[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an Evaluation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Evaluation - * @static - * @param {google.cloud.ces.v1beta.Evaluation} message Evaluation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Evaluation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.tags = []; - object.evaluationDatasets = []; - object.evaluationRuns = []; - object.lastTenResults = []; - } - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - object.createdBy = ""; - object.lastUpdatedBy = ""; - object.aggregatedMetrics = null; - object.lastCompletedResult = null; - object.invalid = 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.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.tags && message.tags.length) { - object.tags = []; - for (var j = 0; j < message.tags.length; ++j) - object.tags[j] = message.tags[j]; - } - if (message.evaluationDatasets && message.evaluationDatasets.length) { - object.evaluationDatasets = []; - for (var j = 0; j < message.evaluationDatasets.length; ++j) - object.evaluationDatasets[j] = message.evaluationDatasets[j]; - } - 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.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.golden != null && message.hasOwnProperty("golden")) { - object.golden = $root.google.cloud.ces.v1beta.Evaluation.Golden.toObject(message.golden, options); - if (options.oneofs) - object.inputs = "golden"; - } - if (message.scenario != null && message.hasOwnProperty("scenario")) { - object.scenario = $root.google.cloud.ces.v1beta.Evaluation.Scenario.toObject(message.scenario, options); - if (options.oneofs) - object.inputs = "scenario"; - } - if (message.createdBy != null && message.hasOwnProperty("createdBy")) - object.createdBy = message.createdBy; - if (message.lastUpdatedBy != null && message.hasOwnProperty("lastUpdatedBy")) - object.lastUpdatedBy = message.lastUpdatedBy; - if (message.evaluationRuns && message.evaluationRuns.length) { - object.evaluationRuns = []; - for (var j = 0; j < message.evaluationRuns.length; ++j) - object.evaluationRuns[j] = message.evaluationRuns[j]; - } - if (message.aggregatedMetrics != null && message.hasOwnProperty("aggregatedMetrics")) - object.aggregatedMetrics = $root.google.cloud.ces.v1beta.AggregatedMetrics.toObject(message.aggregatedMetrics, options); - if (message.lastCompletedResult != null && message.hasOwnProperty("lastCompletedResult")) - object.lastCompletedResult = $root.google.cloud.ces.v1beta.EvaluationResult.toObject(message.lastCompletedResult, options); - if (message.invalid != null && message.hasOwnProperty("invalid")) - object.invalid = message.invalid; - if (message.lastTenResults && message.lastTenResults.length) { - object.lastTenResults = []; - for (var j = 0; j < message.lastTenResults.length; ++j) - object.lastTenResults[j] = $root.google.cloud.ces.v1beta.EvaluationResult.toObject(message.lastTenResults[j], options); - } - return object; - }; - - /** - * Converts this Evaluation to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Evaluation - * @instance - * @returns {Object.} JSON object - */ - Evaluation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Evaluation - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Evaluation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Evaluation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation"; - }; - - Evaluation.GoldenExpectation = (function() { - - /** - * Properties of a GoldenExpectation. - * @memberof google.cloud.ces.v1beta.Evaluation - * @interface IGoldenExpectation - * @property {google.cloud.ces.v1beta.IToolCall|null} [toolCall] GoldenExpectation toolCall - * @property {google.cloud.ces.v1beta.IToolResponse|null} [toolResponse] GoldenExpectation toolResponse - * @property {google.cloud.ces.v1beta.IMessage|null} [agentResponse] GoldenExpectation agentResponse - * @property {google.cloud.ces.v1beta.IAgentTransfer|null} [agentTransfer] GoldenExpectation agentTransfer - * @property {google.protobuf.IStruct|null} [updatedVariables] GoldenExpectation updatedVariables - * @property {google.cloud.ces.v1beta.IToolResponse|null} [mockToolResponse] GoldenExpectation mockToolResponse - * @property {string|null} [note] GoldenExpectation note - */ - - /** - * Constructs a new GoldenExpectation. - * @memberof google.cloud.ces.v1beta.Evaluation - * @classdesc Represents a GoldenExpectation. - * @implements IGoldenExpectation - * @constructor - * @param {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation=} [properties] Properties to set - */ - function GoldenExpectation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoldenExpectation toolCall. - * @member {google.cloud.ces.v1beta.IToolCall|null|undefined} toolCall - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation - * @instance - */ - GoldenExpectation.prototype.toolCall = null; - - /** - * GoldenExpectation toolResponse. - * @member {google.cloud.ces.v1beta.IToolResponse|null|undefined} toolResponse - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation - * @instance - */ - GoldenExpectation.prototype.toolResponse = null; - - /** - * GoldenExpectation agentResponse. - * @member {google.cloud.ces.v1beta.IMessage|null|undefined} agentResponse - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation - * @instance - */ - GoldenExpectation.prototype.agentResponse = null; - - /** - * GoldenExpectation agentTransfer. - * @member {google.cloud.ces.v1beta.IAgentTransfer|null|undefined} agentTransfer - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation - * @instance - */ - GoldenExpectation.prototype.agentTransfer = null; - - /** - * GoldenExpectation updatedVariables. - * @member {google.protobuf.IStruct|null|undefined} updatedVariables - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation - * @instance - */ - GoldenExpectation.prototype.updatedVariables = null; - - /** - * GoldenExpectation mockToolResponse. - * @member {google.cloud.ces.v1beta.IToolResponse|null|undefined} mockToolResponse - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation - * @instance - */ - GoldenExpectation.prototype.mockToolResponse = null; - - /** - * GoldenExpectation note. - * @member {string} note - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation - * @instance - */ - GoldenExpectation.prototype.note = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GoldenExpectation condition. - * @member {"toolCall"|"toolResponse"|"agentResponse"|"agentTransfer"|"updatedVariables"|"mockToolResponse"|undefined} condition - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation - * @instance - */ - Object.defineProperty(GoldenExpectation.prototype, "condition", { - get: $util.oneOfGetter($oneOfFields = ["toolCall", "toolResponse", "agentResponse", "agentTransfer", "updatedVariables", "mockToolResponse"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GoldenExpectation instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation - * @static - * @param {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Evaluation.GoldenExpectation} GoldenExpectation instance - */ - GoldenExpectation.create = function create(properties) { - return new GoldenExpectation(properties); - }; - - /** - * Encodes the specified GoldenExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenExpectation.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation - * @static - * @param {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation} message GoldenExpectation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoldenExpectation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.note != null && Object.hasOwnProperty.call(message, "note")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.note); - if (message.toolCall != null && Object.hasOwnProperty.call(message, "toolCall")) - $root.google.cloud.ces.v1beta.ToolCall.encode(message.toolCall, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.toolResponse != null && Object.hasOwnProperty.call(message, "toolResponse")) - $root.google.cloud.ces.v1beta.ToolResponse.encode(message.toolResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.agentResponse != null && Object.hasOwnProperty.call(message, "agentResponse")) - $root.google.cloud.ces.v1beta.Message.encode(message.agentResponse, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.agentTransfer != null && Object.hasOwnProperty.call(message, "agentTransfer")) - $root.google.cloud.ces.v1beta.AgentTransfer.encode(message.agentTransfer, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.updatedVariables != null && Object.hasOwnProperty.call(message, "updatedVariables")) - $root.google.protobuf.Struct.encode(message.updatedVariables, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.mockToolResponse != null && Object.hasOwnProperty.call(message, "mockToolResponse")) - $root.google.cloud.ces.v1beta.ToolResponse.encode(message.mockToolResponse, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoldenExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenExpectation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation - * @static - * @param {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation} message GoldenExpectation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoldenExpectation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoldenExpectation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Evaluation.GoldenExpectation} GoldenExpectation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoldenExpectation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.toolCall = $root.google.cloud.ces.v1beta.ToolCall.decode(reader, reader.uint32()); - break; - } - case 3: { - message.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32()); - break; - } - case 4: { - message.agentResponse = $root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32()); - break; - } - case 5: { - message.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.decode(reader, reader.uint32()); - break; - } - case 6: { - message.updatedVariables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 7: { - message.mockToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32()); - break; - } - case 1: { - message.note = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoldenExpectation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Evaluation.GoldenExpectation} GoldenExpectation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoldenExpectation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoldenExpectation message. - * @function verify - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoldenExpectation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.toolCall != null && message.hasOwnProperty("toolCall")) { - properties.condition = 1; - { - var error = $root.google.cloud.ces.v1beta.ToolCall.verify(message.toolCall); - if (error) - return "toolCall." + error; - } - } - if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { - if (properties.condition === 1) - return "condition: multiple values"; - properties.condition = 1; - { - var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.toolResponse); - if (error) - return "toolResponse." + error; - } - } - if (message.agentResponse != null && message.hasOwnProperty("agentResponse")) { - if (properties.condition === 1) - return "condition: multiple values"; - properties.condition = 1; - { - var error = $root.google.cloud.ces.v1beta.Message.verify(message.agentResponse); - if (error) - return "agentResponse." + error; - } - } - if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { - if (properties.condition === 1) - return "condition: multiple values"; - properties.condition = 1; - { - var error = $root.google.cloud.ces.v1beta.AgentTransfer.verify(message.agentTransfer); - if (error) - return "agentTransfer." + error; - } - } - if (message.updatedVariables != null && message.hasOwnProperty("updatedVariables")) { - if (properties.condition === 1) - return "condition: multiple values"; - properties.condition = 1; - { - var error = $root.google.protobuf.Struct.verify(message.updatedVariables); - if (error) - return "updatedVariables." + error; - } - } - if (message.mockToolResponse != null && message.hasOwnProperty("mockToolResponse")) { - if (properties.condition === 1) - return "condition: multiple values"; - properties.condition = 1; - { - var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.mockToolResponse); - if (error) - return "mockToolResponse." + error; - } - } - if (message.note != null && message.hasOwnProperty("note")) - if (!$util.isString(message.note)) - return "note: string expected"; - return null; - }; - - /** - * Creates a GoldenExpectation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Evaluation.GoldenExpectation} GoldenExpectation - */ - GoldenExpectation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation) - return object; - var message = new $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation(); - if (object.toolCall != null) { - if (typeof object.toolCall !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenExpectation.toolCall: object expected"); - message.toolCall = $root.google.cloud.ces.v1beta.ToolCall.fromObject(object.toolCall); - } - if (object.toolResponse != null) { - if (typeof object.toolResponse !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenExpectation.toolResponse: object expected"); - message.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.toolResponse); - } - if (object.agentResponse != null) { - if (typeof object.agentResponse !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenExpectation.agentResponse: object expected"); - message.agentResponse = $root.google.cloud.ces.v1beta.Message.fromObject(object.agentResponse); - } - if (object.agentTransfer != null) { - if (typeof object.agentTransfer !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenExpectation.agentTransfer: object expected"); - message.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.fromObject(object.agentTransfer); - } - if (object.updatedVariables != null) { - if (typeof object.updatedVariables !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenExpectation.updatedVariables: object expected"); - message.updatedVariables = $root.google.protobuf.Struct.fromObject(object.updatedVariables); - } - if (object.mockToolResponse != null) { - if (typeof object.mockToolResponse !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenExpectation.mockToolResponse: object expected"); - message.mockToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.mockToolResponse); - } - if (object.note != null) - message.note = String(object.note); - return message; - }; - - /** - * Creates a plain object from a GoldenExpectation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation - * @static - * @param {google.cloud.ces.v1beta.Evaluation.GoldenExpectation} message GoldenExpectation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoldenExpectation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.note = ""; - if (message.note != null && message.hasOwnProperty("note")) - object.note = message.note; - if (message.toolCall != null && message.hasOwnProperty("toolCall")) { - object.toolCall = $root.google.cloud.ces.v1beta.ToolCall.toObject(message.toolCall, options); - if (options.oneofs) - object.condition = "toolCall"; - } - if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { - object.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.toolResponse, options); - if (options.oneofs) - object.condition = "toolResponse"; - } - if (message.agentResponse != null && message.hasOwnProperty("agentResponse")) { - object.agentResponse = $root.google.cloud.ces.v1beta.Message.toObject(message.agentResponse, options); - if (options.oneofs) - object.condition = "agentResponse"; - } - if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { - object.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.toObject(message.agentTransfer, options); - if (options.oneofs) - object.condition = "agentTransfer"; - } - if (message.updatedVariables != null && message.hasOwnProperty("updatedVariables")) { - object.updatedVariables = $root.google.protobuf.Struct.toObject(message.updatedVariables, options); - if (options.oneofs) - object.condition = "updatedVariables"; - } - if (message.mockToolResponse != null && message.hasOwnProperty("mockToolResponse")) { - object.mockToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.mockToolResponse, options); - if (options.oneofs) - object.condition = "mockToolResponse"; - } - return object; - }; - - /** - * Converts this GoldenExpectation to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation - * @instance - * @returns {Object.} JSON object - */ - GoldenExpectation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoldenExpectation - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoldenExpectation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.GoldenExpectation"; - }; - - return GoldenExpectation; - })(); - - Evaluation.Step = (function() { - - /** - * Properties of a Step. - * @memberof google.cloud.ces.v1beta.Evaluation - * @interface IStep - * @property {google.cloud.ces.v1beta.ISessionInput|null} [userInput] Step userInput - * @property {google.cloud.ces.v1beta.IAgentTransfer|null} [agentTransfer] Step agentTransfer - * @property {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null} [expectation] Step expectation - */ - - /** - * Constructs a new Step. - * @memberof google.cloud.ces.v1beta.Evaluation - * @classdesc Represents a Step. - * @implements IStep - * @constructor - * @param {google.cloud.ces.v1beta.Evaluation.IStep=} [properties] Properties to set - */ - function Step(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Step userInput. - * @member {google.cloud.ces.v1beta.ISessionInput|null|undefined} userInput - * @memberof google.cloud.ces.v1beta.Evaluation.Step - * @instance - */ - Step.prototype.userInput = null; - - /** - * Step agentTransfer. - * @member {google.cloud.ces.v1beta.IAgentTransfer|null|undefined} agentTransfer - * @memberof google.cloud.ces.v1beta.Evaluation.Step - * @instance - */ - Step.prototype.agentTransfer = null; - - /** - * Step expectation. - * @member {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null|undefined} expectation - * @memberof google.cloud.ces.v1beta.Evaluation.Step - * @instance - */ - Step.prototype.expectation = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Step step. - * @member {"userInput"|"agentTransfer"|"expectation"|undefined} step - * @memberof google.cloud.ces.v1beta.Evaluation.Step - * @instance - */ - Object.defineProperty(Step.prototype, "step", { - get: $util.oneOfGetter($oneOfFields = ["userInput", "agentTransfer", "expectation"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Step instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Evaluation.Step - * @static - * @param {google.cloud.ces.v1beta.Evaluation.IStep=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Evaluation.Step} Step instance - */ - Step.create = function create(properties) { - return new Step(properties); - }; - - /** - * Encodes the specified Step message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Step.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Evaluation.Step - * @static - * @param {google.cloud.ces.v1beta.Evaluation.IStep} message Step message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Step.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.userInput != null && Object.hasOwnProperty.call(message, "userInput")) - $root.google.cloud.ces.v1beta.SessionInput.encode(message.userInput, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.agentTransfer != null && Object.hasOwnProperty.call(message, "agentTransfer")) - $root.google.cloud.ces.v1beta.AgentTransfer.encode(message.agentTransfer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.expectation != null && Object.hasOwnProperty.call(message, "expectation")) - $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.encode(message.expectation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Step message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Step.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Evaluation.Step - * @static - * @param {google.cloud.ces.v1beta.Evaluation.IStep} message Step message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Step.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Step message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Evaluation.Step - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Evaluation.Step} Step - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Step.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.Step(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.userInput = $root.google.cloud.ces.v1beta.SessionInput.decode(reader, reader.uint32()); - break; - } - case 2: { - message.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.decode(reader, reader.uint32()); - break; - } - case 3: { - message.expectation = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Step message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Evaluation.Step - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Evaluation.Step} Step - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Step.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Step message. - * @function verify - * @memberof google.cloud.ces.v1beta.Evaluation.Step - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Step.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.userInput != null && message.hasOwnProperty("userInput")) { - properties.step = 1; - { - var error = $root.google.cloud.ces.v1beta.SessionInput.verify(message.userInput); - if (error) - return "userInput." + error; - } - } - if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { - if (properties.step === 1) - return "step: multiple values"; - properties.step = 1; - { - var error = $root.google.cloud.ces.v1beta.AgentTransfer.verify(message.agentTransfer); - if (error) - return "agentTransfer." + error; - } - } - if (message.expectation != null && message.hasOwnProperty("expectation")) { - if (properties.step === 1) - return "step: multiple values"; - properties.step = 1; - { - var error = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.verify(message.expectation); - if (error) - return "expectation." + error; - } - } - return null; - }; - - /** - * Creates a Step message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Evaluation.Step - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Evaluation.Step} Step - */ - Step.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.Step) - return object; - var message = new $root.google.cloud.ces.v1beta.Evaluation.Step(); - if (object.userInput != null) { - if (typeof object.userInput !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.Step.userInput: object expected"); - message.userInput = $root.google.cloud.ces.v1beta.SessionInput.fromObject(object.userInput); - } - if (object.agentTransfer != null) { - if (typeof object.agentTransfer !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.Step.agentTransfer: object expected"); - message.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.fromObject(object.agentTransfer); - } - if (object.expectation != null) { - if (typeof object.expectation !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.Step.expectation: object expected"); - message.expectation = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.fromObject(object.expectation); - } - return message; - }; - - /** - * Creates a plain object from a Step message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Evaluation.Step - * @static - * @param {google.cloud.ces.v1beta.Evaluation.Step} message Step - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Step.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.userInput != null && message.hasOwnProperty("userInput")) { - object.userInput = $root.google.cloud.ces.v1beta.SessionInput.toObject(message.userInput, options); - if (options.oneofs) - object.step = "userInput"; - } - if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { - object.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.toObject(message.agentTransfer, options); - if (options.oneofs) - object.step = "agentTransfer"; - } - if (message.expectation != null && message.hasOwnProperty("expectation")) { - object.expectation = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.toObject(message.expectation, options); - if (options.oneofs) - object.step = "expectation"; - } - return object; - }; - - /** - * Converts this Step to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Evaluation.Step - * @instance - * @returns {Object.} JSON object - */ - Step.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Step - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Evaluation.Step - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Step.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.Step"; - }; - - return Step; - })(); - - Evaluation.GoldenTurn = (function() { - - /** - * Properties of a GoldenTurn. - * @memberof google.cloud.ces.v1beta.Evaluation - * @interface IGoldenTurn - * @property {Array.|null} [steps] GoldenTurn steps - * @property {google.cloud.ces.v1beta.ISpan|null} [rootSpan] GoldenTurn rootSpan - */ - - /** - * Constructs a new GoldenTurn. - * @memberof google.cloud.ces.v1beta.Evaluation - * @classdesc Represents a GoldenTurn. - * @implements IGoldenTurn - * @constructor - * @param {google.cloud.ces.v1beta.Evaluation.IGoldenTurn=} [properties] Properties to set - */ - function GoldenTurn(properties) { - this.steps = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoldenTurn steps. - * @member {Array.} steps - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn - * @instance - */ - GoldenTurn.prototype.steps = $util.emptyArray; - - /** - * GoldenTurn rootSpan. - * @member {google.cloud.ces.v1beta.ISpan|null|undefined} rootSpan - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn - * @instance - */ - GoldenTurn.prototype.rootSpan = null; - - /** - * Creates a new GoldenTurn instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn - * @static - * @param {google.cloud.ces.v1beta.Evaluation.IGoldenTurn=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Evaluation.GoldenTurn} GoldenTurn instance - */ - GoldenTurn.create = function create(properties) { - return new GoldenTurn(properties); - }; - - /** - * Encodes the specified GoldenTurn message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenTurn.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn - * @static - * @param {google.cloud.ces.v1beta.Evaluation.IGoldenTurn} message GoldenTurn message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoldenTurn.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.steps != null && message.steps.length) - for (var i = 0; i < message.steps.length; ++i) - $root.google.cloud.ces.v1beta.Evaluation.Step.encode(message.steps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.rootSpan != null && Object.hasOwnProperty.call(message, "rootSpan")) - $root.google.cloud.ces.v1beta.Span.encode(message.rootSpan, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoldenTurn message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenTurn.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn - * @static - * @param {google.cloud.ces.v1beta.Evaluation.IGoldenTurn} message GoldenTurn message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoldenTurn.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoldenTurn message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Evaluation.GoldenTurn} GoldenTurn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoldenTurn.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.steps && message.steps.length)) - message.steps = []; - message.steps.push($root.google.cloud.ces.v1beta.Evaluation.Step.decode(reader, reader.uint32())); - break; - } - case 2: { - message.rootSpan = $root.google.cloud.ces.v1beta.Span.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoldenTurn message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Evaluation.GoldenTurn} GoldenTurn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoldenTurn.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoldenTurn message. - * @function verify - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoldenTurn.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.steps != null && message.hasOwnProperty("steps")) { - if (!Array.isArray(message.steps)) - return "steps: array expected"; - for (var i = 0; i < message.steps.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Evaluation.Step.verify(message.steps[i]); - if (error) - return "steps." + error; - } - } - if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) { - var error = $root.google.cloud.ces.v1beta.Span.verify(message.rootSpan); - if (error) - return "rootSpan." + error; - } - return null; - }; - - /** - * Creates a GoldenTurn message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Evaluation.GoldenTurn} GoldenTurn - */ - GoldenTurn.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn) - return object; - var message = new $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn(); - if (object.steps) { - if (!Array.isArray(object.steps)) - throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenTurn.steps: array expected"); - message.steps = []; - for (var i = 0; i < object.steps.length; ++i) { - if (typeof object.steps[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenTurn.steps: object expected"); - message.steps[i] = $root.google.cloud.ces.v1beta.Evaluation.Step.fromObject(object.steps[i]); - } - } - if (object.rootSpan != null) { - if (typeof object.rootSpan !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenTurn.rootSpan: object expected"); - message.rootSpan = $root.google.cloud.ces.v1beta.Span.fromObject(object.rootSpan); - } - return message; - }; - - /** - * Creates a plain object from a GoldenTurn message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn - * @static - * @param {google.cloud.ces.v1beta.Evaluation.GoldenTurn} message GoldenTurn - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoldenTurn.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.steps = []; - if (options.defaults) - object.rootSpan = null; - if (message.steps && message.steps.length) { - object.steps = []; - for (var j = 0; j < message.steps.length; ++j) - object.steps[j] = $root.google.cloud.ces.v1beta.Evaluation.Step.toObject(message.steps[j], options); - } - if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) - object.rootSpan = $root.google.cloud.ces.v1beta.Span.toObject(message.rootSpan, options); - return object; - }; - - /** - * Converts this GoldenTurn to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn - * @instance - * @returns {Object.} JSON object - */ - GoldenTurn.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoldenTurn - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoldenTurn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.GoldenTurn"; - }; - - return GoldenTurn; - })(); - - Evaluation.Golden = (function() { - - /** - * Properties of a Golden. - * @memberof google.cloud.ces.v1beta.Evaluation - * @interface IGolden - * @property {Array.|null} [turns] Golden turns - * @property {Array.|null} [evaluationExpectations] Golden evaluationExpectations - */ - - /** - * Constructs a new Golden. - * @memberof google.cloud.ces.v1beta.Evaluation - * @classdesc Represents a Golden. - * @implements IGolden - * @constructor - * @param {google.cloud.ces.v1beta.Evaluation.IGolden=} [properties] Properties to set - */ - function Golden(properties) { - this.turns = []; - this.evaluationExpectations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Golden turns. - * @member {Array.} turns - * @memberof google.cloud.ces.v1beta.Evaluation.Golden - * @instance - */ - Golden.prototype.turns = $util.emptyArray; - - /** - * Golden evaluationExpectations. - * @member {Array.} evaluationExpectations - * @memberof google.cloud.ces.v1beta.Evaluation.Golden - * @instance - */ - Golden.prototype.evaluationExpectations = $util.emptyArray; - - /** - * Creates a new Golden instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Evaluation.Golden - * @static - * @param {google.cloud.ces.v1beta.Evaluation.IGolden=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Evaluation.Golden} Golden instance - */ - Golden.create = function create(properties) { - return new Golden(properties); - }; - - /** - * Encodes the specified Golden message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Golden.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Evaluation.Golden - * @static - * @param {google.cloud.ces.v1beta.Evaluation.IGolden} message Golden message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Golden.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.turns != null && message.turns.length) - for (var i = 0; i < message.turns.length; ++i) - $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn.encode(message.turns[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.evaluationExpectations != null && message.evaluationExpectations.length) - for (var i = 0; i < message.evaluationExpectations.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.evaluationExpectations[i]); - return writer; - }; - - /** - * Encodes the specified Golden message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Golden.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Evaluation.Golden - * @static - * @param {google.cloud.ces.v1beta.Evaluation.IGolden} message Golden message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Golden.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Golden message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Evaluation.Golden - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Evaluation.Golden} Golden - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Golden.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.Golden(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.turns && message.turns.length)) - message.turns = []; - message.turns.push($root.google.cloud.ces.v1beta.Evaluation.GoldenTurn.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.evaluationExpectations && message.evaluationExpectations.length)) - message.evaluationExpectations = []; - message.evaluationExpectations.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Golden message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Evaluation.Golden - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Evaluation.Golden} Golden - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Golden.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Golden message. - * @function verify - * @memberof google.cloud.ces.v1beta.Evaluation.Golden - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Golden.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.turns != null && message.hasOwnProperty("turns")) { - if (!Array.isArray(message.turns)) - return "turns: array expected"; - for (var i = 0; i < message.turns.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn.verify(message.turns[i]); - if (error) - return "turns." + error; - } - } - if (message.evaluationExpectations != null && message.hasOwnProperty("evaluationExpectations")) { - if (!Array.isArray(message.evaluationExpectations)) - return "evaluationExpectations: array expected"; - for (var i = 0; i < message.evaluationExpectations.length; ++i) - if (!$util.isString(message.evaluationExpectations[i])) - return "evaluationExpectations: string[] expected"; - } - return null; - }; - - /** - * Creates a Golden message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Evaluation.Golden - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Evaluation.Golden} Golden - */ - Golden.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.Golden) - return object; - var message = new $root.google.cloud.ces.v1beta.Evaluation.Golden(); - if (object.turns) { - if (!Array.isArray(object.turns)) - throw TypeError(".google.cloud.ces.v1beta.Evaluation.Golden.turns: array expected"); - message.turns = []; - for (var i = 0; i < object.turns.length; ++i) { - if (typeof object.turns[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.Golden.turns: object expected"); - message.turns[i] = $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn.fromObject(object.turns[i]); - } - } - if (object.evaluationExpectations) { - if (!Array.isArray(object.evaluationExpectations)) - throw TypeError(".google.cloud.ces.v1beta.Evaluation.Golden.evaluationExpectations: array expected"); - message.evaluationExpectations = []; - for (var i = 0; i < object.evaluationExpectations.length; ++i) - message.evaluationExpectations[i] = String(object.evaluationExpectations[i]); - } - return message; - }; - - /** - * Creates a plain object from a Golden message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Evaluation.Golden - * @static - * @param {google.cloud.ces.v1beta.Evaluation.Golden} message Golden - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Golden.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.turns = []; - object.evaluationExpectations = []; - } - if (message.turns && message.turns.length) { - object.turns = []; - for (var j = 0; j < message.turns.length; ++j) - object.turns[j] = $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn.toObject(message.turns[j], options); - } - if (message.evaluationExpectations && message.evaluationExpectations.length) { - object.evaluationExpectations = []; - for (var j = 0; j < message.evaluationExpectations.length; ++j) - object.evaluationExpectations[j] = message.evaluationExpectations[j]; - } - return object; - }; - - /** - * Converts this Golden to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Evaluation.Golden - * @instance - * @returns {Object.} JSON object - */ - Golden.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Golden - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Evaluation.Golden - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Golden.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.Golden"; - }; - - return Golden; - })(); - - Evaluation.ScenarioExpectation = (function() { - - /** - * Properties of a ScenarioExpectation. - * @memberof google.cloud.ces.v1beta.Evaluation - * @interface IScenarioExpectation - * @property {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation|null} [toolExpectation] ScenarioExpectation toolExpectation - * @property {google.cloud.ces.v1beta.IMessage|null} [agentResponse] ScenarioExpectation agentResponse - */ - - /** - * Constructs a new ScenarioExpectation. - * @memberof google.cloud.ces.v1beta.Evaluation - * @classdesc Represents a ScenarioExpectation. - * @implements IScenarioExpectation - * @constructor - * @param {google.cloud.ces.v1beta.Evaluation.IScenarioExpectation=} [properties] Properties to set - */ - function ScenarioExpectation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ScenarioExpectation toolExpectation. - * @member {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation|null|undefined} toolExpectation - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation - * @instance - */ - ScenarioExpectation.prototype.toolExpectation = null; - - /** - * ScenarioExpectation agentResponse. - * @member {google.cloud.ces.v1beta.IMessage|null|undefined} agentResponse - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation - * @instance - */ - ScenarioExpectation.prototype.agentResponse = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ScenarioExpectation expectation. - * @member {"toolExpectation"|"agentResponse"|undefined} expectation - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation - * @instance - */ - Object.defineProperty(ScenarioExpectation.prototype, "expectation", { - get: $util.oneOfGetter($oneOfFields = ["toolExpectation", "agentResponse"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ScenarioExpectation instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation - * @static - * @param {google.cloud.ces.v1beta.Evaluation.IScenarioExpectation=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation} ScenarioExpectation instance - */ - ScenarioExpectation.create = function create(properties) { - return new ScenarioExpectation(properties); - }; - - /** - * Encodes the specified ScenarioExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation - * @static - * @param {google.cloud.ces.v1beta.Evaluation.IScenarioExpectation} message ScenarioExpectation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScenarioExpectation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolExpectation != null && Object.hasOwnProperty.call(message, "toolExpectation")) - $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.encode(message.toolExpectation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.agentResponse != null && Object.hasOwnProperty.call(message, "agentResponse")) - $root.google.cloud.ces.v1beta.Message.encode(message.agentResponse, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ScenarioExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation - * @static - * @param {google.cloud.ces.v1beta.Evaluation.IScenarioExpectation} message ScenarioExpectation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScenarioExpectation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ScenarioExpectation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation} ScenarioExpectation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScenarioExpectation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.toolExpectation = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.decode(reader, reader.uint32()); - break; - } - case 2: { - message.agentResponse = $root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ScenarioExpectation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation} ScenarioExpectation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScenarioExpectation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ScenarioExpectation message. - * @function verify - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ScenarioExpectation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.toolExpectation != null && message.hasOwnProperty("toolExpectation")) { - properties.expectation = 1; - { - var error = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.verify(message.toolExpectation); - if (error) - return "toolExpectation." + error; - } - } - if (message.agentResponse != null && message.hasOwnProperty("agentResponse")) { - if (properties.expectation === 1) - return "expectation: multiple values"; - properties.expectation = 1; - { - var error = $root.google.cloud.ces.v1beta.Message.verify(message.agentResponse); - if (error) - return "agentResponse." + error; - } - } - return null; - }; - - /** - * Creates a ScenarioExpectation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation} ScenarioExpectation - */ - ScenarioExpectation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation) - return object; - var message = new $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation(); - if (object.toolExpectation != null) { - if (typeof object.toolExpectation !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.toolExpectation: object expected"); - message.toolExpectation = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.fromObject(object.toolExpectation); - } - if (object.agentResponse != null) { - if (typeof object.agentResponse !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.agentResponse: object expected"); - message.agentResponse = $root.google.cloud.ces.v1beta.Message.fromObject(object.agentResponse); - } - return message; - }; - - /** - * Creates a plain object from a ScenarioExpectation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation - * @static - * @param {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation} message ScenarioExpectation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ScenarioExpectation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.toolExpectation != null && message.hasOwnProperty("toolExpectation")) { - object.toolExpectation = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.toObject(message.toolExpectation, options); - if (options.oneofs) - object.expectation = "toolExpectation"; - } - if (message.agentResponse != null && message.hasOwnProperty("agentResponse")) { - object.agentResponse = $root.google.cloud.ces.v1beta.Message.toObject(message.agentResponse, options); - if (options.oneofs) - object.expectation = "agentResponse"; - } - return object; - }; - - /** - * Converts this ScenarioExpectation to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation - * @instance - * @returns {Object.} JSON object - */ - ScenarioExpectation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ScenarioExpectation - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ScenarioExpectation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.ScenarioExpectation"; - }; - - ScenarioExpectation.ToolExpectation = (function() { - - /** - * Properties of a ToolExpectation. - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation - * @interface IToolExpectation - * @property {google.cloud.ces.v1beta.IToolCall|null} [expectedToolCall] ToolExpectation expectedToolCall - * @property {google.cloud.ces.v1beta.IToolResponse|null} [mockToolResponse] ToolExpectation mockToolResponse - */ - - /** - * Constructs a new ToolExpectation. - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation - * @classdesc Represents a ToolExpectation. - * @implements IToolExpectation - * @constructor - * @param {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation=} [properties] Properties to set - */ - function ToolExpectation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolExpectation expectedToolCall. - * @member {google.cloud.ces.v1beta.IToolCall|null|undefined} expectedToolCall - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation - * @instance - */ - ToolExpectation.prototype.expectedToolCall = null; - - /** - * ToolExpectation mockToolResponse. - * @member {google.cloud.ces.v1beta.IToolResponse|null|undefined} mockToolResponse - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation - * @instance - */ - ToolExpectation.prototype.mockToolResponse = null; - - /** - * Creates a new ToolExpectation instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation - * @static - * @param {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation} ToolExpectation instance - */ - ToolExpectation.create = function create(properties) { - return new ToolExpectation(properties); - }; - - /** - * Encodes the specified ToolExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation - * @static - * @param {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation} message ToolExpectation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolExpectation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expectedToolCall != null && Object.hasOwnProperty.call(message, "expectedToolCall")) - $root.google.cloud.ces.v1beta.ToolCall.encode(message.expectedToolCall, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.mockToolResponse != null && Object.hasOwnProperty.call(message, "mockToolResponse")) - $root.google.cloud.ces.v1beta.ToolResponse.encode(message.mockToolResponse, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ToolExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation - * @static - * @param {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation} message ToolExpectation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolExpectation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolExpectation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation} ToolExpectation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolExpectation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.expectedToolCall = $root.google.cloud.ces.v1beta.ToolCall.decode(reader, reader.uint32()); - break; - } - case 2: { - message.mockToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolExpectation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation} ToolExpectation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolExpectation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolExpectation message. - * @function verify - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolExpectation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expectedToolCall != null && message.hasOwnProperty("expectedToolCall")) { - var error = $root.google.cloud.ces.v1beta.ToolCall.verify(message.expectedToolCall); - if (error) - return "expectedToolCall." + error; - } - if (message.mockToolResponse != null && message.hasOwnProperty("mockToolResponse")) { - var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.mockToolResponse); - if (error) - return "mockToolResponse." + error; - } - return null; - }; - - /** - * Creates a ToolExpectation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation} ToolExpectation - */ - ToolExpectation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation) - return object; - var message = new $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation(); - if (object.expectedToolCall != null) { - if (typeof object.expectedToolCall !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.expectedToolCall: object expected"); - message.expectedToolCall = $root.google.cloud.ces.v1beta.ToolCall.fromObject(object.expectedToolCall); - } - if (object.mockToolResponse != null) { - if (typeof object.mockToolResponse !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.mockToolResponse: object expected"); - message.mockToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.mockToolResponse); - } - return message; - }; - - /** - * Creates a plain object from a ToolExpectation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation - * @static - * @param {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation} message ToolExpectation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolExpectation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expectedToolCall = null; - object.mockToolResponse = null; - } - if (message.expectedToolCall != null && message.hasOwnProperty("expectedToolCall")) - object.expectedToolCall = $root.google.cloud.ces.v1beta.ToolCall.toObject(message.expectedToolCall, options); - if (message.mockToolResponse != null && message.hasOwnProperty("mockToolResponse")) - object.mockToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.mockToolResponse, options); - return object; - }; - - /** - * Converts this ToolExpectation to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation - * @instance - * @returns {Object.} JSON object - */ - ToolExpectation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolExpectation - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolExpectation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation"; - }; - - return ToolExpectation; - })(); - - return ScenarioExpectation; - })(); - - Evaluation.Scenario = (function() { - - /** - * Properties of a Scenario. - * @memberof google.cloud.ces.v1beta.Evaluation - * @interface IScenario - * @property {string|null} [task] Scenario task - * @property {Array.|null} [userFacts] Scenario userFacts - * @property {number|null} [maxTurns] Scenario maxTurns - * @property {Array.|null} [rubrics] Scenario rubrics - * @property {Array.|null} [scenarioExpectations] Scenario scenarioExpectations - * @property {google.protobuf.IStruct|null} [variableOverrides] Scenario variableOverrides - * @property {google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior|null} [taskCompletionBehavior] Scenario taskCompletionBehavior - * @property {google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior|null} [userGoalBehavior] Scenario userGoalBehavior - * @property {Array.|null} [evaluationExpectations] Scenario evaluationExpectations - */ - - /** - * Constructs a new Scenario. - * @memberof google.cloud.ces.v1beta.Evaluation - * @classdesc Represents a Scenario. - * @implements IScenario - * @constructor - * @param {google.cloud.ces.v1beta.Evaluation.IScenario=} [properties] Properties to set - */ - function Scenario(properties) { - this.userFacts = []; - this.rubrics = []; - this.scenarioExpectations = []; - this.evaluationExpectations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Scenario task. - * @member {string} task - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @instance - */ - Scenario.prototype.task = ""; - - /** - * Scenario userFacts. - * @member {Array.} userFacts - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @instance - */ - Scenario.prototype.userFacts = $util.emptyArray; - - /** - * Scenario maxTurns. - * @member {number} maxTurns - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @instance - */ - Scenario.prototype.maxTurns = 0; - - /** - * Scenario rubrics. - * @member {Array.} rubrics - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @instance - */ - Scenario.prototype.rubrics = $util.emptyArray; - - /** - * Scenario scenarioExpectations. - * @member {Array.} scenarioExpectations - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @instance - */ - Scenario.prototype.scenarioExpectations = $util.emptyArray; - - /** - * Scenario variableOverrides. - * @member {google.protobuf.IStruct|null|undefined} variableOverrides - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @instance - */ - Scenario.prototype.variableOverrides = null; - - /** - * Scenario taskCompletionBehavior. - * @member {google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior} taskCompletionBehavior - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @instance - */ - Scenario.prototype.taskCompletionBehavior = 0; - - /** - * Scenario userGoalBehavior. - * @member {google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior} userGoalBehavior - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @instance - */ - Scenario.prototype.userGoalBehavior = 0; - - /** - * Scenario evaluationExpectations. - * @member {Array.} evaluationExpectations - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @instance - */ - Scenario.prototype.evaluationExpectations = $util.emptyArray; - - /** - * Creates a new Scenario instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @static - * @param {google.cloud.ces.v1beta.Evaluation.IScenario=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Evaluation.Scenario} Scenario instance - */ - Scenario.create = function create(properties) { - return new Scenario(properties); - }; - - /** - * Encodes the specified Scenario message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @static - * @param {google.cloud.ces.v1beta.Evaluation.IScenario} message Scenario message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Scenario.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.task != null && Object.hasOwnProperty.call(message, "task")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.task); - if (message.rubrics != null && message.rubrics.length) - for (var i = 0; i < message.rubrics.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.rubrics[i]); - if (message.scenarioExpectations != null && message.scenarioExpectations.length) - for (var i = 0; i < message.scenarioExpectations.length; ++i) - $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.encode(message.scenarioExpectations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.userFacts != null && message.userFacts.length) - for (var i = 0; i < message.userFacts.length; ++i) - $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.encode(message.userFacts[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.maxTurns != null && Object.hasOwnProperty.call(message, "maxTurns")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxTurns); - if (message.variableOverrides != null && Object.hasOwnProperty.call(message, "variableOverrides")) - $root.google.protobuf.Struct.encode(message.variableOverrides, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.taskCompletionBehavior != null && Object.hasOwnProperty.call(message, "taskCompletionBehavior")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.taskCompletionBehavior); - if (message.userGoalBehavior != null && Object.hasOwnProperty.call(message, "userGoalBehavior")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.userGoalBehavior); - if (message.evaluationExpectations != null && message.evaluationExpectations.length) - for (var i = 0; i < message.evaluationExpectations.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.evaluationExpectations[i]); - return writer; - }; - - /** - * Encodes the specified Scenario message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @static - * @param {google.cloud.ces.v1beta.Evaluation.IScenario} message Scenario message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Scenario.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Scenario message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Evaluation.Scenario} Scenario - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Scenario.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.Scenario(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.task = reader.string(); - break; - } - case 4: { - if (!(message.userFacts && message.userFacts.length)) - message.userFacts = []; - message.userFacts.push($root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.decode(reader, reader.uint32())); - break; - } - case 5: { - message.maxTurns = reader.int32(); - break; - } - case 2: { - if (!(message.rubrics && message.rubrics.length)) - message.rubrics = []; - message.rubrics.push(reader.string()); - break; - } - case 3: { - if (!(message.scenarioExpectations && message.scenarioExpectations.length)) - message.scenarioExpectations = []; - message.scenarioExpectations.push($root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.decode(reader, reader.uint32())); - break; - } - case 6: { - message.variableOverrides = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 7: { - message.taskCompletionBehavior = reader.int32(); - break; - } - case 8: { - message.userGoalBehavior = reader.int32(); - break; - } - case 10: { - if (!(message.evaluationExpectations && message.evaluationExpectations.length)) - message.evaluationExpectations = []; - message.evaluationExpectations.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Scenario message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Evaluation.Scenario} Scenario - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Scenario.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Scenario message. - * @function verify - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Scenario.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.task != null && message.hasOwnProperty("task")) - if (!$util.isString(message.task)) - return "task: string expected"; - if (message.userFacts != null && message.hasOwnProperty("userFacts")) { - if (!Array.isArray(message.userFacts)) - return "userFacts: array expected"; - for (var i = 0; i < message.userFacts.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.verify(message.userFacts[i]); - if (error) - return "userFacts." + error; - } - } - if (message.maxTurns != null && message.hasOwnProperty("maxTurns")) - if (!$util.isInteger(message.maxTurns)) - return "maxTurns: integer expected"; - if (message.rubrics != null && message.hasOwnProperty("rubrics")) { - if (!Array.isArray(message.rubrics)) - return "rubrics: array expected"; - for (var i = 0; i < message.rubrics.length; ++i) - if (!$util.isString(message.rubrics[i])) - return "rubrics: string[] expected"; - } - if (message.scenarioExpectations != null && message.hasOwnProperty("scenarioExpectations")) { - if (!Array.isArray(message.scenarioExpectations)) - return "scenarioExpectations: array expected"; - for (var i = 0; i < message.scenarioExpectations.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.verify(message.scenarioExpectations[i]); - if (error) - return "scenarioExpectations." + error; - } - } - if (message.variableOverrides != null && message.hasOwnProperty("variableOverrides")) { - var error = $root.google.protobuf.Struct.verify(message.variableOverrides); - if (error) - return "variableOverrides." + error; - } - if (message.taskCompletionBehavior != null && message.hasOwnProperty("taskCompletionBehavior")) - switch (message.taskCompletionBehavior) { - default: - return "taskCompletionBehavior: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.userGoalBehavior != null && message.hasOwnProperty("userGoalBehavior")) - switch (message.userGoalBehavior) { - default: - return "userGoalBehavior: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.evaluationExpectations != null && message.hasOwnProperty("evaluationExpectations")) { - if (!Array.isArray(message.evaluationExpectations)) - return "evaluationExpectations: array expected"; - for (var i = 0; i < message.evaluationExpectations.length; ++i) - if (!$util.isString(message.evaluationExpectations[i])) - return "evaluationExpectations: string[] expected"; - } - return null; - }; - - /** - * Creates a Scenario message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Evaluation.Scenario} Scenario - */ - Scenario.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.Scenario) - return object; - var message = new $root.google.cloud.ces.v1beta.Evaluation.Scenario(); - if (object.task != null) - message.task = String(object.task); - if (object.userFacts) { - if (!Array.isArray(object.userFacts)) - throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.userFacts: array expected"); - message.userFacts = []; - for (var i = 0; i < object.userFacts.length; ++i) { - if (typeof object.userFacts[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.userFacts: object expected"); - message.userFacts[i] = $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.fromObject(object.userFacts[i]); - } - } - if (object.maxTurns != null) - message.maxTurns = object.maxTurns | 0; - if (object.rubrics) { - if (!Array.isArray(object.rubrics)) - throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.rubrics: array expected"); - message.rubrics = []; - for (var i = 0; i < object.rubrics.length; ++i) - message.rubrics[i] = String(object.rubrics[i]); - } - if (object.scenarioExpectations) { - if (!Array.isArray(object.scenarioExpectations)) - throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.scenarioExpectations: array expected"); - message.scenarioExpectations = []; - for (var i = 0; i < object.scenarioExpectations.length; ++i) { - if (typeof object.scenarioExpectations[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.scenarioExpectations: object expected"); - message.scenarioExpectations[i] = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.fromObject(object.scenarioExpectations[i]); - } - } - if (object.variableOverrides != null) { - if (typeof object.variableOverrides !== "object") - throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.variableOverrides: object expected"); - message.variableOverrides = $root.google.protobuf.Struct.fromObject(object.variableOverrides); - } - switch (object.taskCompletionBehavior) { - default: - if (typeof object.taskCompletionBehavior === "number") { - message.taskCompletionBehavior = object.taskCompletionBehavior; - break; - } - break; - case "TASK_COMPLETION_BEHAVIOR_UNSPECIFIED": - case 0: - message.taskCompletionBehavior = 0; - break; - case "TASK_SATISFIED": - case 1: - message.taskCompletionBehavior = 1; - break; - case "TASK_REJECTED": - case 2: - message.taskCompletionBehavior = 2; - break; - } - switch (object.userGoalBehavior) { - default: - if (typeof object.userGoalBehavior === "number") { - message.userGoalBehavior = object.userGoalBehavior; - break; - } - break; - case "USER_GOAL_BEHAVIOR_UNSPECIFIED": - case 0: - message.userGoalBehavior = 0; - break; - case "USER_GOAL_SATISFIED": - case 1: - message.userGoalBehavior = 1; - break; - case "USER_GOAL_REJECTED": - case 2: - message.userGoalBehavior = 2; - break; - case "USER_GOAL_IGNORED": - case 3: - message.userGoalBehavior = 3; - break; - } - if (object.evaluationExpectations) { - if (!Array.isArray(object.evaluationExpectations)) - throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.evaluationExpectations: array expected"); - message.evaluationExpectations = []; - for (var i = 0; i < object.evaluationExpectations.length; ++i) - message.evaluationExpectations[i] = String(object.evaluationExpectations[i]); - } - return message; - }; - - /** - * Creates a plain object from a Scenario message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @static - * @param {google.cloud.ces.v1beta.Evaluation.Scenario} message Scenario - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Scenario.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.rubrics = []; - object.scenarioExpectations = []; - object.userFacts = []; - object.evaluationExpectations = []; - } - if (options.defaults) { - object.task = ""; - object.maxTurns = 0; - object.variableOverrides = null; - object.taskCompletionBehavior = options.enums === String ? "TASK_COMPLETION_BEHAVIOR_UNSPECIFIED" : 0; - object.userGoalBehavior = options.enums === String ? "USER_GOAL_BEHAVIOR_UNSPECIFIED" : 0; - } - if (message.task != null && message.hasOwnProperty("task")) - object.task = message.task; - if (message.rubrics && message.rubrics.length) { - object.rubrics = []; - for (var j = 0; j < message.rubrics.length; ++j) - object.rubrics[j] = message.rubrics[j]; - } - if (message.scenarioExpectations && message.scenarioExpectations.length) { - object.scenarioExpectations = []; - for (var j = 0; j < message.scenarioExpectations.length; ++j) - object.scenarioExpectations[j] = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.toObject(message.scenarioExpectations[j], options); - } - if (message.userFacts && message.userFacts.length) { - object.userFacts = []; - for (var j = 0; j < message.userFacts.length; ++j) - object.userFacts[j] = $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.toObject(message.userFacts[j], options); - } - if (message.maxTurns != null && message.hasOwnProperty("maxTurns")) - object.maxTurns = message.maxTurns; - if (message.variableOverrides != null && message.hasOwnProperty("variableOverrides")) - object.variableOverrides = $root.google.protobuf.Struct.toObject(message.variableOverrides, options); - if (message.taskCompletionBehavior != null && message.hasOwnProperty("taskCompletionBehavior")) - object.taskCompletionBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior[message.taskCompletionBehavior] === undefined ? message.taskCompletionBehavior : $root.google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior[message.taskCompletionBehavior] : message.taskCompletionBehavior; - if (message.userGoalBehavior != null && message.hasOwnProperty("userGoalBehavior")) - object.userGoalBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior[message.userGoalBehavior] === undefined ? message.userGoalBehavior : $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior[message.userGoalBehavior] : message.userGoalBehavior; - if (message.evaluationExpectations && message.evaluationExpectations.length) { - object.evaluationExpectations = []; - for (var j = 0; j < message.evaluationExpectations.length; ++j) - object.evaluationExpectations[j] = message.evaluationExpectations[j]; - } - return object; - }; - - /** - * Converts this Scenario to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @instance - * @returns {Object.} JSON object - */ - Scenario.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Scenario - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Scenario.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.Scenario"; - }; - - Scenario.UserFact = (function() { - - /** - * Properties of a UserFact. - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @interface IUserFact - * @property {string|null} [name] UserFact name - * @property {string|null} [value] UserFact value - */ - - /** - * Constructs a new UserFact. - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario - * @classdesc Represents a UserFact. - * @implements IUserFact - * @constructor - * @param {google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact=} [properties] Properties to set - */ - function UserFact(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UserFact name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact - * @instance - */ - UserFact.prototype.name = ""; - - /** - * UserFact value. - * @member {string} value - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact - * @instance - */ - UserFact.prototype.value = ""; - - /** - * Creates a new UserFact instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact - * @static - * @param {google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Evaluation.Scenario.UserFact} UserFact instance - */ - UserFact.create = function create(properties) { - return new UserFact(properties); - }; - - /** - * Encodes the specified UserFact message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact - * @static - * @param {google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact} message UserFact message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UserFact.encode = function encode(message, writer) { - if (!writer) - 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 && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - return writer; - }; - - /** - * Encodes the specified UserFact message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact - * @static - * @param {google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact} message UserFact message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UserFact.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UserFact message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Evaluation.Scenario.UserFact} UserFact - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UserFact.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UserFact message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Evaluation.Scenario.UserFact} UserFact - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UserFact.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UserFact message. - * @function verify - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UserFact.verify = function verify(message) { - if (typeof message !== "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 (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates a UserFact message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Evaluation.Scenario.UserFact} UserFact - */ - UserFact.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact) - return object; - var message = new $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact(); - if (object.name != null) - message.name = String(object.name); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from a UserFact message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact - * @static - * @param {google.cloud.ces.v1beta.Evaluation.Scenario.UserFact} message UserFact - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UserFact.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.value = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this UserFact to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact - * @instance - * @returns {Object.} JSON object - */ - UserFact.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UserFact - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UserFact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.Scenario.UserFact"; - }; - - return UserFact; - })(); - - /** - * TaskCompletionBehavior enum. - * @name google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior - * @enum {number} - * @property {number} TASK_COMPLETION_BEHAVIOR_UNSPECIFIED=0 TASK_COMPLETION_BEHAVIOR_UNSPECIFIED value - * @property {number} TASK_SATISFIED=1 TASK_SATISFIED value - * @property {number} TASK_REJECTED=2 TASK_REJECTED value - */ - Scenario.TaskCompletionBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TASK_COMPLETION_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "TASK_SATISFIED"] = 1; - values[valuesById[2] = "TASK_REJECTED"] = 2; - return values; - })(); - - /** - * UserGoalBehavior enum. - * @name google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior - * @enum {number} - * @property {number} USER_GOAL_BEHAVIOR_UNSPECIFIED=0 USER_GOAL_BEHAVIOR_UNSPECIFIED value - * @property {number} USER_GOAL_SATISFIED=1 USER_GOAL_SATISFIED value - * @property {number} USER_GOAL_REJECTED=2 USER_GOAL_REJECTED value - * @property {number} USER_GOAL_IGNORED=3 USER_GOAL_IGNORED value - */ - Scenario.UserGoalBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "USER_GOAL_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "USER_GOAL_SATISFIED"] = 1; - values[valuesById[2] = "USER_GOAL_REJECTED"] = 2; - values[valuesById[3] = "USER_GOAL_IGNORED"] = 3; - return values; - })(); - - return Scenario; - })(); - - return Evaluation; - })(); - - v1beta.EvaluationDataset = (function() { - - /** - * Properties of an EvaluationDataset. - * @memberof google.cloud.ces.v1beta - * @interface IEvaluationDataset - * @property {string|null} [name] EvaluationDataset name - * @property {string|null} [displayName] EvaluationDataset displayName - * @property {Array.|null} [evaluations] EvaluationDataset evaluations - * @property {google.protobuf.ITimestamp|null} [createTime] EvaluationDataset createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] EvaluationDataset updateTime - * @property {string|null} [etag] EvaluationDataset etag - * @property {string|null} [createdBy] EvaluationDataset createdBy - * @property {string|null} [lastUpdatedBy] EvaluationDataset lastUpdatedBy - * @property {google.cloud.ces.v1beta.IAggregatedMetrics|null} [aggregatedMetrics] EvaluationDataset aggregatedMetrics - */ - - /** - * Constructs a new EvaluationDataset. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an EvaluationDataset. - * @implements IEvaluationDataset - * @constructor - * @param {google.cloud.ces.v1beta.IEvaluationDataset=} [properties] Properties to set - */ - function EvaluationDataset(properties) { - this.evaluations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluationDataset name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @instance - */ - EvaluationDataset.prototype.name = ""; - - /** - * EvaluationDataset displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @instance - */ - EvaluationDataset.prototype.displayName = ""; - - /** - * EvaluationDataset evaluations. - * @member {Array.} evaluations - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @instance - */ - EvaluationDataset.prototype.evaluations = $util.emptyArray; - - /** - * EvaluationDataset createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @instance - */ - EvaluationDataset.prototype.createTime = null; - - /** - * EvaluationDataset updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @instance - */ - EvaluationDataset.prototype.updateTime = null; - - /** - * EvaluationDataset etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @instance - */ - EvaluationDataset.prototype.etag = ""; - - /** - * EvaluationDataset createdBy. - * @member {string} createdBy - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @instance - */ - EvaluationDataset.prototype.createdBy = ""; - - /** - * EvaluationDataset lastUpdatedBy. - * @member {string} lastUpdatedBy - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @instance - */ - EvaluationDataset.prototype.lastUpdatedBy = ""; - - /** - * EvaluationDataset aggregatedMetrics. - * @member {google.cloud.ces.v1beta.IAggregatedMetrics|null|undefined} aggregatedMetrics - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @instance - */ - EvaluationDataset.prototype.aggregatedMetrics = null; - - /** - * Creates a new EvaluationDataset instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @static - * @param {google.cloud.ces.v1beta.IEvaluationDataset=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationDataset} EvaluationDataset instance - */ - EvaluationDataset.create = function create(properties) { - return new EvaluationDataset(properties); - }; - - /** - * Encodes the specified EvaluationDataset message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationDataset.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @static - * @param {google.cloud.ces.v1beta.IEvaluationDataset} message EvaluationDataset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationDataset.encode = function encode(message, writer) { - if (!writer) - 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.evaluations != null && message.evaluations.length) - for (var i = 0; i < message.evaluations.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.evaluations[i]); - 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.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); - if (message.createdBy != null && Object.hasOwnProperty.call(message, "createdBy")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.createdBy); - if (message.lastUpdatedBy != null && Object.hasOwnProperty.call(message, "lastUpdatedBy")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.lastUpdatedBy); - if (message.aggregatedMetrics != null && Object.hasOwnProperty.call(message, "aggregatedMetrics")) - $root.google.cloud.ces.v1beta.AggregatedMetrics.encode(message.aggregatedMetrics, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EvaluationDataset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationDataset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @static - * @param {google.cloud.ces.v1beta.IEvaluationDataset} message EvaluationDataset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationDataset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluationDataset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationDataset} EvaluationDataset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationDataset.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationDataset(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - if (!(message.evaluations && message.evaluations.length)) - message.evaluations = []; - message.evaluations.push(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.etag = reader.string(); - break; - } - case 7: { - message.createdBy = reader.string(); - break; - } - case 8: { - message.lastUpdatedBy = reader.string(); - break; - } - case 9: { - message.aggregatedMetrics = $root.google.cloud.ces.v1beta.AggregatedMetrics.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluationDataset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationDataset} EvaluationDataset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationDataset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluationDataset message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluationDataset.verify = function verify(message) { - if (typeof message !== "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.evaluations != null && message.hasOwnProperty("evaluations")) { - if (!Array.isArray(message.evaluations)) - return "evaluations: array expected"; - for (var i = 0; i < message.evaluations.length; ++i) - if (!$util.isString(message.evaluations[i])) - return "evaluations: 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.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.createdBy != null && message.hasOwnProperty("createdBy")) - if (!$util.isString(message.createdBy)) - return "createdBy: string expected"; - if (message.lastUpdatedBy != null && message.hasOwnProperty("lastUpdatedBy")) - if (!$util.isString(message.lastUpdatedBy)) - return "lastUpdatedBy: string expected"; - if (message.aggregatedMetrics != null && message.hasOwnProperty("aggregatedMetrics")) { - var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.verify(message.aggregatedMetrics); - if (error) - return "aggregatedMetrics." + error; - } - return null; - }; - - /** - * Creates an EvaluationDataset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationDataset} EvaluationDataset - */ - EvaluationDataset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationDataset) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationDataset(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.evaluations) { - if (!Array.isArray(object.evaluations)) - throw TypeError(".google.cloud.ces.v1beta.EvaluationDataset.evaluations: array expected"); - message.evaluations = []; - for (var i = 0; i < object.evaluations.length; ++i) - message.evaluations[i] = String(object.evaluations[i]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationDataset.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.ces.v1beta.EvaluationDataset.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.createdBy != null) - message.createdBy = String(object.createdBy); - if (object.lastUpdatedBy != null) - message.lastUpdatedBy = String(object.lastUpdatedBy); - if (object.aggregatedMetrics != null) { - if (typeof object.aggregatedMetrics !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationDataset.aggregatedMetrics: object expected"); - message.aggregatedMetrics = $root.google.cloud.ces.v1beta.AggregatedMetrics.fromObject(object.aggregatedMetrics); - } - return message; - }; - - /** - * Creates a plain object from an EvaluationDataset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @static - * @param {google.cloud.ces.v1beta.EvaluationDataset} message EvaluationDataset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluationDataset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.evaluations = []; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - object.createdBy = ""; - object.lastUpdatedBy = ""; - object.aggregatedMetrics = 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.evaluations && message.evaluations.length) { - object.evaluations = []; - for (var j = 0; j < message.evaluations.length; ++j) - object.evaluations[j] = message.evaluations[j]; - } - 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.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.createdBy != null && message.hasOwnProperty("createdBy")) - object.createdBy = message.createdBy; - if (message.lastUpdatedBy != null && message.hasOwnProperty("lastUpdatedBy")) - object.lastUpdatedBy = message.lastUpdatedBy; - if (message.aggregatedMetrics != null && message.hasOwnProperty("aggregatedMetrics")) - object.aggregatedMetrics = $root.google.cloud.ces.v1beta.AggregatedMetrics.toObject(message.aggregatedMetrics, options); - return object; - }; - - /** - * Converts this EvaluationDataset to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @instance - * @returns {Object.} JSON object - */ - EvaluationDataset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluationDataset - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationDataset - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluationDataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationDataset"; - }; - - return EvaluationDataset; - })(); - - v1beta.EvaluationResult = (function() { - - /** - * Properties of an EvaluationResult. - * @memberof google.cloud.ces.v1beta - * @interface IEvaluationResult - * @property {google.cloud.ces.v1beta.EvaluationResult.IGoldenResult|null} [goldenResult] EvaluationResult goldenResult - * @property {google.cloud.ces.v1beta.EvaluationResult.IScenarioResult|null} [scenarioResult] EvaluationResult scenarioResult - * @property {string|null} [name] EvaluationResult name - * @property {string|null} [displayName] EvaluationResult displayName - * @property {google.protobuf.ITimestamp|null} [createTime] EvaluationResult createTime - * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [evaluationStatus] EvaluationResult evaluationStatus - * @property {string|null} [evaluationRun] EvaluationResult evaluationRun - * @property {google.cloud.ces.v1beta.IEvaluationPersona|null} [persona] EvaluationResult persona - * @property {google.cloud.ces.v1beta.IEvaluationErrorInfo|null} [errorInfo] EvaluationResult errorInfo - * @property {google.rpc.IStatus|null} [error] EvaluationResult error - * @property {string|null} [initiatedBy] EvaluationResult initiatedBy - * @property {string|null} [appVersion] EvaluationResult appVersion - * @property {string|null} [appVersionDisplayName] EvaluationResult appVersionDisplayName - * @property {string|null} [changelog] EvaluationResult changelog - * @property {google.protobuf.ITimestamp|null} [changelogCreateTime] EvaluationResult changelogCreateTime - * @property {google.cloud.ces.v1beta.EvaluationResult.ExecutionState|null} [executionState] EvaluationResult executionState - * @property {google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null} [evaluationMetricsThresholds] EvaluationResult evaluationMetricsThresholds - * @property {google.cloud.ces.v1beta.IEvaluationConfig|null} [config] EvaluationResult config - * @property {google.cloud.ces.v1beta.GoldenRunMethod|null} [goldenRunMethod] EvaluationResult goldenRunMethod - */ - - /** - * Constructs a new EvaluationResult. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an EvaluationResult. - * @implements IEvaluationResult - * @constructor - * @param {google.cloud.ces.v1beta.IEvaluationResult=} [properties] Properties to set - */ - function EvaluationResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluationResult goldenResult. - * @member {google.cloud.ces.v1beta.EvaluationResult.IGoldenResult|null|undefined} goldenResult - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.goldenResult = null; - - /** - * EvaluationResult scenarioResult. - * @member {google.cloud.ces.v1beta.EvaluationResult.IScenarioResult|null|undefined} scenarioResult - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.scenarioResult = null; - - /** - * EvaluationResult name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.name = ""; - - /** - * EvaluationResult displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.displayName = ""; - - /** - * EvaluationResult createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.createTime = null; - - /** - * EvaluationResult evaluationStatus. - * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} evaluationStatus - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.evaluationStatus = 0; - - /** - * EvaluationResult evaluationRun. - * @member {string} evaluationRun - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.evaluationRun = ""; - - /** - * EvaluationResult persona. - * @member {google.cloud.ces.v1beta.IEvaluationPersona|null|undefined} persona - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.persona = null; - - /** - * EvaluationResult errorInfo. - * @member {google.cloud.ces.v1beta.IEvaluationErrorInfo|null|undefined} errorInfo - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.errorInfo = null; - - /** - * EvaluationResult error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.error = null; - - /** - * EvaluationResult initiatedBy. - * @member {string} initiatedBy - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.initiatedBy = ""; - - /** - * EvaluationResult appVersion. - * @member {string} appVersion - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.appVersion = ""; - - /** - * EvaluationResult appVersionDisplayName. - * @member {string} appVersionDisplayName - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.appVersionDisplayName = ""; - - /** - * EvaluationResult changelog. - * @member {string} changelog - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.changelog = ""; - - /** - * EvaluationResult changelogCreateTime. - * @member {google.protobuf.ITimestamp|null|undefined} changelogCreateTime - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.changelogCreateTime = null; - - /** - * EvaluationResult executionState. - * @member {google.cloud.ces.v1beta.EvaluationResult.ExecutionState} executionState - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.executionState = 0; - - /** - * EvaluationResult evaluationMetricsThresholds. - * @member {google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null|undefined} evaluationMetricsThresholds - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.evaluationMetricsThresholds = null; - - /** - * EvaluationResult config. - * @member {google.cloud.ces.v1beta.IEvaluationConfig|null|undefined} config - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.config = null; - - /** - * EvaluationResult goldenRunMethod. - * @member {google.cloud.ces.v1beta.GoldenRunMethod} goldenRunMethod - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - EvaluationResult.prototype.goldenRunMethod = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * EvaluationResult result. - * @member {"goldenResult"|"scenarioResult"|undefined} result - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - */ - Object.defineProperty(EvaluationResult.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["goldenResult", "scenarioResult"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new EvaluationResult instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @static - * @param {google.cloud.ces.v1beta.IEvaluationResult=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationResult} EvaluationResult instance - */ - EvaluationResult.create = function create(properties) { - return new EvaluationResult(properties); - }; - - /** - * Encodes the specified EvaluationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @static - * @param {google.cloud.ces.v1beta.IEvaluationResult} message EvaluationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationResult.encode = function encode(message, writer) { - if (!writer) - 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.evaluationStatus != null && Object.hasOwnProperty.call(message, "evaluationStatus")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.evaluationStatus); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.evaluationRun != null && Object.hasOwnProperty.call(message, "evaluationRun")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.evaluationRun); - if (message.goldenResult != null && Object.hasOwnProperty.call(message, "goldenResult")) - $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.encode(message.goldenResult, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.scenarioResult != null && Object.hasOwnProperty.call(message, "scenarioResult")) - $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.encode(message.scenarioResult, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.initiatedBy != null && Object.hasOwnProperty.call(message, "initiatedBy")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.initiatedBy); - if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.appVersion); - if (message.executionState != null && Object.hasOwnProperty.call(message, "executionState")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.executionState); - if (message.evaluationMetricsThresholds != null && Object.hasOwnProperty.call(message, "evaluationMetricsThresholds")) - $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.encode(message.evaluationMetricsThresholds, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.appVersionDisplayName != null && Object.hasOwnProperty.call(message, "appVersionDisplayName")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.appVersionDisplayName); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.errorInfo != null && Object.hasOwnProperty.call(message, "errorInfo")) - $root.google.cloud.ces.v1beta.EvaluationErrorInfo.encode(message.errorInfo, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.persona != null && Object.hasOwnProperty.call(message, "persona")) - $root.google.cloud.ces.v1beta.EvaluationPersona.encode(message.persona, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.cloud.ces.v1beta.EvaluationConfig.encode(message.config, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.goldenRunMethod != null && Object.hasOwnProperty.call(message, "goldenRunMethod")) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.goldenRunMethod); - if (message.changelog != null && Object.hasOwnProperty.call(message, "changelog")) - writer.uint32(/* id 21, wireType 2 =*/170).string(message.changelog); - if (message.changelogCreateTime != null && Object.hasOwnProperty.call(message, "changelogCreateTime")) - $root.google.protobuf.Timestamp.encode(message.changelogCreateTime, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EvaluationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @static - * @param {google.cloud.ces.v1beta.IEvaluationResult} message EvaluationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluationResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationResult} EvaluationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 7: { - message.goldenResult = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.decode(reader, reader.uint32()); - break; - } - case 8: { - message.scenarioResult = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.evaluationStatus = reader.int32(); - break; - } - case 6: { - message.evaluationRun = reader.string(); - break; - } - case 17: { - message.persona = $root.google.cloud.ces.v1beta.EvaluationPersona.decode(reader, reader.uint32()); - break; - } - case 15: { - message.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.decode(reader, reader.uint32()); - break; - } - case 14: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 9: { - message.initiatedBy = reader.string(); - break; - } - case 10: { - message.appVersion = reader.string(); - break; - } - case 13: { - message.appVersionDisplayName = reader.string(); - break; - } - case 21: { - message.changelog = reader.string(); - break; - } - case 22: { - message.changelogCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.executionState = reader.int32(); - break; - } - case 12: { - message.evaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.decode(reader, reader.uint32()); - break; - } - case 18: { - message.config = $root.google.cloud.ces.v1beta.EvaluationConfig.decode(reader, reader.uint32()); - break; - } - case 19: { - message.goldenRunMethod = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluationResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationResult} EvaluationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluationResult message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluationResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.goldenResult != null && message.hasOwnProperty("goldenResult")) { - properties.result = 1; - { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.verify(message.goldenResult); - if (error) - return "goldenResult." + error; - } - } - if (message.scenarioResult != null && message.hasOwnProperty("scenarioResult")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.verify(message.scenarioResult); - if (error) - return "scenarioResult." + 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.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.evaluationStatus != null && message.hasOwnProperty("evaluationStatus")) - switch (message.evaluationStatus) { - default: - return "evaluationStatus: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) - if (!$util.isString(message.evaluationRun)) - return "evaluationRun: string expected"; - if (message.persona != null && message.hasOwnProperty("persona")) { - var error = $root.google.cloud.ces.v1beta.EvaluationPersona.verify(message.persona); - if (error) - return "persona." + error; - } - if (message.errorInfo != null && message.hasOwnProperty("errorInfo")) { - var error = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.verify(message.errorInfo); - if (error) - return "errorInfo." + error; - } - if (message.error != null && message.hasOwnProperty("error")) { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - if (message.initiatedBy != null && message.hasOwnProperty("initiatedBy")) - if (!$util.isString(message.initiatedBy)) - return "initiatedBy: string expected"; - if (message.appVersion != null && message.hasOwnProperty("appVersion")) - if (!$util.isString(message.appVersion)) - return "appVersion: string expected"; - if (message.appVersionDisplayName != null && message.hasOwnProperty("appVersionDisplayName")) - if (!$util.isString(message.appVersionDisplayName)) - return "appVersionDisplayName: string expected"; - if (message.changelog != null && message.hasOwnProperty("changelog")) - if (!$util.isString(message.changelog)) - return "changelog: string expected"; - if (message.changelogCreateTime != null && message.hasOwnProperty("changelogCreateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.changelogCreateTime); - if (error) - return "changelogCreateTime." + error; - } - if (message.executionState != null && message.hasOwnProperty("executionState")) - switch (message.executionState) { - default: - return "executionState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.evaluationMetricsThresholds != null && message.hasOwnProperty("evaluationMetricsThresholds")) { - var error = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.verify(message.evaluationMetricsThresholds); - if (error) - return "evaluationMetricsThresholds." + error; - } - if (message.config != null && message.hasOwnProperty("config")) { - var error = $root.google.cloud.ces.v1beta.EvaluationConfig.verify(message.config); - if (error) - return "config." + error; - } - if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) - switch (message.goldenRunMethod) { - default: - return "goldenRunMethod: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an EvaluationResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationResult} EvaluationResult - */ - EvaluationResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationResult(); - if (object.goldenResult != null) { - if (typeof object.goldenResult !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.goldenResult: object expected"); - message.goldenResult = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.fromObject(object.goldenResult); - } - if (object.scenarioResult != null) { - if (typeof object.scenarioResult !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.scenarioResult: object expected"); - message.scenarioResult = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.fromObject(object.scenarioResult); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - switch (object.evaluationStatus) { - default: - if (typeof object.evaluationStatus === "number") { - message.evaluationStatus = object.evaluationStatus; - break; - } - break; - case "OUTCOME_UNSPECIFIED": - case 0: - message.evaluationStatus = 0; - break; - case "PASS": - case 1: - message.evaluationStatus = 1; - break; - case "FAIL": - case 2: - message.evaluationStatus = 2; - break; - } - if (object.evaluationRun != null) - message.evaluationRun = String(object.evaluationRun); - if (object.persona != null) { - if (typeof object.persona !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.persona: object expected"); - message.persona = $root.google.cloud.ces.v1beta.EvaluationPersona.fromObject(object.persona); - } - if (object.errorInfo != null) { - if (typeof object.errorInfo !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.errorInfo: object expected"); - message.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.fromObject(object.errorInfo); - } - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.initiatedBy != null) - message.initiatedBy = String(object.initiatedBy); - if (object.appVersion != null) - message.appVersion = String(object.appVersion); - if (object.appVersionDisplayName != null) - message.appVersionDisplayName = String(object.appVersionDisplayName); - if (object.changelog != null) - message.changelog = String(object.changelog); - if (object.changelogCreateTime != null) { - if (typeof object.changelogCreateTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.changelogCreateTime: object expected"); - message.changelogCreateTime = $root.google.protobuf.Timestamp.fromObject(object.changelogCreateTime); - } - switch (object.executionState) { - default: - if (typeof object.executionState === "number") { - message.executionState = object.executionState; - break; - } - break; - case "EXECUTION_STATE_UNSPECIFIED": - case 0: - message.executionState = 0; - break; - case "RUNNING": - case 1: - message.executionState = 1; - break; - case "COMPLETED": - case 2: - message.executionState = 2; - break; - case "ERROR": - case 3: - message.executionState = 3; - break; - } - if (object.evaluationMetricsThresholds != null) { - if (typeof object.evaluationMetricsThresholds !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.evaluationMetricsThresholds: object expected"); - message.evaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.fromObject(object.evaluationMetricsThresholds); - } - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.config: object expected"); - message.config = $root.google.cloud.ces.v1beta.EvaluationConfig.fromObject(object.config); - } - switch (object.goldenRunMethod) { - default: - if (typeof object.goldenRunMethod === "number") { - message.goldenRunMethod = object.goldenRunMethod; - break; - } - break; - case "GOLDEN_RUN_METHOD_UNSPECIFIED": - case 0: - message.goldenRunMethod = 0; - break; - case "STABLE": - case 1: - message.goldenRunMethod = 1; - break; - case "NAIVE": - case 2: - message.goldenRunMethod = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an EvaluationResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult} message EvaluationResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluationResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.evaluationStatus = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; - object.createTime = null; - object.evaluationRun = ""; - object.initiatedBy = ""; - object.appVersion = ""; - object.executionState = options.enums === String ? "EXECUTION_STATE_UNSPECIFIED" : 0; - object.evaluationMetricsThresholds = null; - object.appVersionDisplayName = ""; - object.error = null; - object.errorInfo = null; - object.persona = null; - object.config = null; - object.goldenRunMethod = options.enums === String ? "GOLDEN_RUN_METHOD_UNSPECIFIED" : 0; - object.changelog = ""; - object.changelogCreateTime = 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.evaluationStatus != null && message.hasOwnProperty("evaluationStatus")) - object.evaluationStatus = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.evaluationStatus] === undefined ? message.evaluationStatus : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.evaluationStatus] : message.evaluationStatus; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) - object.evaluationRun = message.evaluationRun; - if (message.goldenResult != null && message.hasOwnProperty("goldenResult")) { - object.goldenResult = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.toObject(message.goldenResult, options); - if (options.oneofs) - object.result = "goldenResult"; - } - if (message.scenarioResult != null && message.hasOwnProperty("scenarioResult")) { - object.scenarioResult = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.toObject(message.scenarioResult, options); - if (options.oneofs) - object.result = "scenarioResult"; - } - if (message.initiatedBy != null && message.hasOwnProperty("initiatedBy")) - object.initiatedBy = message.initiatedBy; - if (message.appVersion != null && message.hasOwnProperty("appVersion")) - object.appVersion = message.appVersion; - if (message.executionState != null && message.hasOwnProperty("executionState")) - object.executionState = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.ExecutionState[message.executionState] === undefined ? message.executionState : $root.google.cloud.ces.v1beta.EvaluationResult.ExecutionState[message.executionState] : message.executionState; - if (message.evaluationMetricsThresholds != null && message.hasOwnProperty("evaluationMetricsThresholds")) - object.evaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.toObject(message.evaluationMetricsThresholds, options); - if (message.appVersionDisplayName != null && message.hasOwnProperty("appVersionDisplayName")) - object.appVersionDisplayName = message.appVersionDisplayName; - if (message.error != null && message.hasOwnProperty("error")) - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (message.errorInfo != null && message.hasOwnProperty("errorInfo")) - object.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.toObject(message.errorInfo, options); - if (message.persona != null && message.hasOwnProperty("persona")) - object.persona = $root.google.cloud.ces.v1beta.EvaluationPersona.toObject(message.persona, options); - if (message.config != null && message.hasOwnProperty("config")) - object.config = $root.google.cloud.ces.v1beta.EvaluationConfig.toObject(message.config, options); - if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) - object.goldenRunMethod = options.enums === String ? $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] === undefined ? message.goldenRunMethod : $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] : message.goldenRunMethod; - if (message.changelog != null && message.hasOwnProperty("changelog")) - object.changelog = message.changelog; - if (message.changelogCreateTime != null && message.hasOwnProperty("changelogCreateTime")) - object.changelogCreateTime = $root.google.protobuf.Timestamp.toObject(message.changelogCreateTime, options); - return object; - }; - - /** - * Converts this EvaluationResult to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @instance - * @returns {Object.} JSON object - */ - EvaluationResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluationResult - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult"; - }; - - EvaluationResult.GoldenExpectationOutcome = (function() { - - /** - * Properties of a GoldenExpectationOutcome. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @interface IGoldenExpectationOutcome - * @property {google.cloud.ces.v1beta.IToolCall|null} [observedToolCall] GoldenExpectationOutcome observedToolCall - * @property {google.cloud.ces.v1beta.IToolResponse|null} [observedToolResponse] GoldenExpectationOutcome observedToolResponse - * @property {google.cloud.ces.v1beta.IMessage|null} [observedAgentResponse] GoldenExpectationOutcome observedAgentResponse - * @property {google.cloud.ces.v1beta.IAgentTransfer|null} [observedAgentTransfer] GoldenExpectationOutcome observedAgentTransfer - * @property {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null} [expectation] GoldenExpectationOutcome expectation - * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [outcome] GoldenExpectationOutcome outcome - * @property {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null} [semanticSimilarityResult] GoldenExpectationOutcome semanticSimilarityResult - * @property {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult|null} [toolInvocationResult] GoldenExpectationOutcome toolInvocationResult - */ - - /** - * Constructs a new GoldenExpectationOutcome. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @classdesc Represents a GoldenExpectationOutcome. - * @implements IGoldenExpectationOutcome - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome=} [properties] Properties to set - */ - function GoldenExpectationOutcome(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoldenExpectationOutcome observedToolCall. - * @member {google.cloud.ces.v1beta.IToolCall|null|undefined} observedToolCall - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @instance - */ - GoldenExpectationOutcome.prototype.observedToolCall = null; - - /** - * GoldenExpectationOutcome observedToolResponse. - * @member {google.cloud.ces.v1beta.IToolResponse|null|undefined} observedToolResponse - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @instance - */ - GoldenExpectationOutcome.prototype.observedToolResponse = null; - - /** - * GoldenExpectationOutcome observedAgentResponse. - * @member {google.cloud.ces.v1beta.IMessage|null|undefined} observedAgentResponse - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @instance - */ - GoldenExpectationOutcome.prototype.observedAgentResponse = null; - - /** - * GoldenExpectationOutcome observedAgentTransfer. - * @member {google.cloud.ces.v1beta.IAgentTransfer|null|undefined} observedAgentTransfer - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @instance - */ - GoldenExpectationOutcome.prototype.observedAgentTransfer = null; - - /** - * GoldenExpectationOutcome expectation. - * @member {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null|undefined} expectation - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @instance - */ - GoldenExpectationOutcome.prototype.expectation = null; - - /** - * GoldenExpectationOutcome outcome. - * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} outcome - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @instance - */ - GoldenExpectationOutcome.prototype.outcome = 0; - - /** - * GoldenExpectationOutcome semanticSimilarityResult. - * @member {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null|undefined} semanticSimilarityResult - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @instance - */ - GoldenExpectationOutcome.prototype.semanticSimilarityResult = null; - - /** - * GoldenExpectationOutcome toolInvocationResult. - * @member {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult|null|undefined} toolInvocationResult - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @instance - */ - GoldenExpectationOutcome.prototype.toolInvocationResult = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GoldenExpectationOutcome result. - * @member {"observedToolCall"|"observedToolResponse"|"observedAgentResponse"|"observedAgentTransfer"|undefined} result - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @instance - */ - Object.defineProperty(GoldenExpectationOutcome.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["observedToolCall", "observedToolResponse", "observedAgentResponse", "observedAgentTransfer"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GoldenExpectationOutcome instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome} GoldenExpectationOutcome instance - */ - GoldenExpectationOutcome.create = function create(properties) { - return new GoldenExpectationOutcome(properties); - }; - - /** - * Encodes the specified GoldenExpectationOutcome message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome} message GoldenExpectationOutcome message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoldenExpectationOutcome.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expectation != null && Object.hasOwnProperty.call(message, "expectation")) - $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.encode(message.expectation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.observedToolCall != null && Object.hasOwnProperty.call(message, "observedToolCall")) - $root.google.cloud.ces.v1beta.ToolCall.encode(message.observedToolCall, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.observedToolResponse != null && Object.hasOwnProperty.call(message, "observedToolResponse")) - $root.google.cloud.ces.v1beta.ToolResponse.encode(message.observedToolResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.observedAgentResponse != null && Object.hasOwnProperty.call(message, "observedAgentResponse")) - $root.google.cloud.ces.v1beta.Message.encode(message.observedAgentResponse, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.observedAgentTransfer != null && Object.hasOwnProperty.call(message, "observedAgentTransfer")) - $root.google.cloud.ces.v1beta.AgentTransfer.encode(message.observedAgentTransfer, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.outcome); - if (message.semanticSimilarityResult != null && Object.hasOwnProperty.call(message, "semanticSimilarityResult")) - $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.encode(message.semanticSimilarityResult, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.toolInvocationResult != null && Object.hasOwnProperty.call(message, "toolInvocationResult")) - $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.encode(message.toolInvocationResult, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoldenExpectationOutcome message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome} message GoldenExpectationOutcome message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoldenExpectationOutcome.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoldenExpectationOutcome message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome} GoldenExpectationOutcome - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoldenExpectationOutcome.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.observedToolCall = $root.google.cloud.ces.v1beta.ToolCall.decode(reader, reader.uint32()); - break; - } - case 3: { - message.observedToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32()); - break; - } - case 4: { - message.observedAgentResponse = $root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32()); - break; - } - case 5: { - message.observedAgentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.decode(reader, reader.uint32()); - break; - } - case 1: { - message.expectation = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.decode(reader, reader.uint32()); - break; - } - case 6: { - message.outcome = reader.int32(); - break; - } - case 7: { - message.semanticSimilarityResult = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.decode(reader, reader.uint32()); - break; - } - case 8: { - message.toolInvocationResult = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoldenExpectationOutcome message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome} GoldenExpectationOutcome - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoldenExpectationOutcome.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoldenExpectationOutcome message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoldenExpectationOutcome.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.observedToolCall != null && message.hasOwnProperty("observedToolCall")) { - properties.result = 1; - { - var error = $root.google.cloud.ces.v1beta.ToolCall.verify(message.observedToolCall); - if (error) - return "observedToolCall." + error; - } - } - if (message.observedToolResponse != null && message.hasOwnProperty("observedToolResponse")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.observedToolResponse); - if (error) - return "observedToolResponse." + error; - } - } - if (message.observedAgentResponse != null && message.hasOwnProperty("observedAgentResponse")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.cloud.ces.v1beta.Message.verify(message.observedAgentResponse); - if (error) - return "observedAgentResponse." + error; - } - } - if (message.observedAgentTransfer != null && message.hasOwnProperty("observedAgentTransfer")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.cloud.ces.v1beta.AgentTransfer.verify(message.observedAgentTransfer); - if (error) - return "observedAgentTransfer." + error; - } - } - if (message.expectation != null && message.hasOwnProperty("expectation")) { - var error = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.verify(message.expectation); - if (error) - return "expectation." + error; - } - if (message.outcome != null && message.hasOwnProperty("outcome")) - switch (message.outcome) { - default: - return "outcome: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.semanticSimilarityResult != null && message.hasOwnProperty("semanticSimilarityResult")) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.verify(message.semanticSimilarityResult); - if (error) - return "semanticSimilarityResult." + error; - } - if (message.toolInvocationResult != null && message.hasOwnProperty("toolInvocationResult")) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.verify(message.toolInvocationResult); - if (error) - return "toolInvocationResult." + error; - } - return null; - }; - - /** - * Creates a GoldenExpectationOutcome message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome} GoldenExpectationOutcome - */ - GoldenExpectationOutcome.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome(); - if (object.observedToolCall != null) { - if (typeof object.observedToolCall !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.observedToolCall: object expected"); - message.observedToolCall = $root.google.cloud.ces.v1beta.ToolCall.fromObject(object.observedToolCall); - } - if (object.observedToolResponse != null) { - if (typeof object.observedToolResponse !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.observedToolResponse: object expected"); - message.observedToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.observedToolResponse); - } - if (object.observedAgentResponse != null) { - if (typeof object.observedAgentResponse !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.observedAgentResponse: object expected"); - message.observedAgentResponse = $root.google.cloud.ces.v1beta.Message.fromObject(object.observedAgentResponse); - } - if (object.observedAgentTransfer != null) { - if (typeof object.observedAgentTransfer !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.observedAgentTransfer: object expected"); - message.observedAgentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.fromObject(object.observedAgentTransfer); - } - if (object.expectation != null) { - if (typeof object.expectation !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.expectation: object expected"); - message.expectation = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.fromObject(object.expectation); - } - switch (object.outcome) { - default: - if (typeof object.outcome === "number") { - message.outcome = object.outcome; - break; - } - break; - case "OUTCOME_UNSPECIFIED": - case 0: - message.outcome = 0; - break; - case "PASS": - case 1: - message.outcome = 1; - break; - case "FAIL": - case 2: - message.outcome = 2; - break; - } - if (object.semanticSimilarityResult != null) { - if (typeof object.semanticSimilarityResult !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.semanticSimilarityResult: object expected"); - message.semanticSimilarityResult = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.fromObject(object.semanticSimilarityResult); - } - if (object.toolInvocationResult != null) { - if (typeof object.toolInvocationResult !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.toolInvocationResult: object expected"); - message.toolInvocationResult = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.fromObject(object.toolInvocationResult); - } - return message; - }; - - /** - * Creates a plain object from a GoldenExpectationOutcome message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome} message GoldenExpectationOutcome - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoldenExpectationOutcome.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expectation = null; - object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; - object.semanticSimilarityResult = null; - object.toolInvocationResult = null; - } - if (message.expectation != null && message.hasOwnProperty("expectation")) - object.expectation = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.toObject(message.expectation, options); - if (message.observedToolCall != null && message.hasOwnProperty("observedToolCall")) { - object.observedToolCall = $root.google.cloud.ces.v1beta.ToolCall.toObject(message.observedToolCall, options); - if (options.oneofs) - object.result = "observedToolCall"; - } - if (message.observedToolResponse != null && message.hasOwnProperty("observedToolResponse")) { - object.observedToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.observedToolResponse, options); - if (options.oneofs) - object.result = "observedToolResponse"; - } - if (message.observedAgentResponse != null && message.hasOwnProperty("observedAgentResponse")) { - object.observedAgentResponse = $root.google.cloud.ces.v1beta.Message.toObject(message.observedAgentResponse, options); - if (options.oneofs) - object.result = "observedAgentResponse"; - } - if (message.observedAgentTransfer != null && message.hasOwnProperty("observedAgentTransfer")) { - object.observedAgentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.toObject(message.observedAgentTransfer, options); - if (options.oneofs) - object.result = "observedAgentTransfer"; - } - if (message.outcome != null && message.hasOwnProperty("outcome")) - object.outcome = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] : message.outcome; - if (message.semanticSimilarityResult != null && message.hasOwnProperty("semanticSimilarityResult")) - object.semanticSimilarityResult = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.toObject(message.semanticSimilarityResult, options); - if (message.toolInvocationResult != null && message.hasOwnProperty("toolInvocationResult")) - object.toolInvocationResult = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.toObject(message.toolInvocationResult, options); - return object; - }; - - /** - * Converts this GoldenExpectationOutcome to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @instance - * @returns {Object.} JSON object - */ - GoldenExpectationOutcome.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoldenExpectationOutcome - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoldenExpectationOutcome.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome"; - }; - - GoldenExpectationOutcome.ToolInvocationResult = (function() { - - /** - * Properties of a ToolInvocationResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @interface IToolInvocationResult - * @property {number|null} [parameterCorrectnessScore] ToolInvocationResult parameterCorrectnessScore - * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [outcome] ToolInvocationResult outcome - * @property {string|null} [explanation] ToolInvocationResult explanation - */ - - /** - * Constructs a new ToolInvocationResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome - * @classdesc Represents a ToolInvocationResult. - * @implements IToolInvocationResult - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult=} [properties] Properties to set - */ - function ToolInvocationResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolInvocationResult parameterCorrectnessScore. - * @member {number|null|undefined} parameterCorrectnessScore - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult - * @instance - */ - ToolInvocationResult.prototype.parameterCorrectnessScore = null; - - /** - * ToolInvocationResult outcome. - * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} outcome - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult - * @instance - */ - ToolInvocationResult.prototype.outcome = 0; - - /** - * ToolInvocationResult explanation. - * @member {string} explanation - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult - * @instance - */ - ToolInvocationResult.prototype.explanation = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ToolInvocationResult.prototype, "_parameterCorrectnessScore", { - get: $util.oneOfGetter($oneOfFields = ["parameterCorrectnessScore"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ToolInvocationResult instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult} ToolInvocationResult instance - */ - ToolInvocationResult.create = function create(properties) { - return new ToolInvocationResult(properties); - }; - - /** - * Encodes the specified ToolInvocationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult} message ToolInvocationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolInvocationResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parameterCorrectnessScore != null && Object.hasOwnProperty.call(message, "parameterCorrectnessScore")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.parameterCorrectnessScore); - if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.outcome); - if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.explanation); - return writer; - }; - - /** - * Encodes the specified ToolInvocationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult} message ToolInvocationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolInvocationResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolInvocationResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult} ToolInvocationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolInvocationResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parameterCorrectnessScore = reader.float(); - break; - } - case 2: { - message.outcome = reader.int32(); - break; - } - case 3: { - message.explanation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolInvocationResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult} ToolInvocationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolInvocationResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolInvocationResult message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolInvocationResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.parameterCorrectnessScore != null && message.hasOwnProperty("parameterCorrectnessScore")) { - properties._parameterCorrectnessScore = 1; - if (typeof message.parameterCorrectnessScore !== "number") - return "parameterCorrectnessScore: number expected"; - } - if (message.outcome != null && message.hasOwnProperty("outcome")) - switch (message.outcome) { - default: - return "outcome: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.explanation != null && message.hasOwnProperty("explanation")) - if (!$util.isString(message.explanation)) - return "explanation: string expected"; - return null; - }; - - /** - * Creates a ToolInvocationResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult} ToolInvocationResult - */ - ToolInvocationResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult(); - if (object.parameterCorrectnessScore != null) - message.parameterCorrectnessScore = Number(object.parameterCorrectnessScore); - switch (object.outcome) { - default: - if (typeof object.outcome === "number") { - message.outcome = object.outcome; - break; - } - break; - case "OUTCOME_UNSPECIFIED": - case 0: - message.outcome = 0; - break; - case "PASS": - case 1: - message.outcome = 1; - break; - case "FAIL": - case 2: - message.outcome = 2; - break; - } - if (object.explanation != null) - message.explanation = String(object.explanation); - return message; - }; - - /** - * Creates a plain object from a ToolInvocationResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult} message ToolInvocationResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolInvocationResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; - object.explanation = ""; - } - if (message.parameterCorrectnessScore != null && message.hasOwnProperty("parameterCorrectnessScore")) { - object.parameterCorrectnessScore = options.json && !isFinite(message.parameterCorrectnessScore) ? String(message.parameterCorrectnessScore) : message.parameterCorrectnessScore; - if (options.oneofs) - object._parameterCorrectnessScore = "parameterCorrectnessScore"; - } - if (message.outcome != null && message.hasOwnProperty("outcome")) - object.outcome = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] : message.outcome; - if (message.explanation != null && message.hasOwnProperty("explanation")) - object.explanation = message.explanation; - return object; - }; - - /** - * Converts this ToolInvocationResult to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult - * @instance - * @returns {Object.} JSON object - */ - ToolInvocationResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolInvocationResult - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolInvocationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult"; - }; - - return ToolInvocationResult; - })(); - - return GoldenExpectationOutcome; - })(); - - EvaluationResult.EvaluationExpectationResult = (function() { - - /** - * Properties of an EvaluationExpectationResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @interface IEvaluationExpectationResult - * @property {string|null} [evaluationExpectation] EvaluationExpectationResult evaluationExpectation - * @property {string|null} [prompt] EvaluationExpectationResult prompt - * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [outcome] EvaluationExpectationResult outcome - * @property {string|null} [explanation] EvaluationExpectationResult explanation - */ - - /** - * Constructs a new EvaluationExpectationResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @classdesc Represents an EvaluationExpectationResult. - * @implements IEvaluationExpectationResult - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult=} [properties] Properties to set - */ - function EvaluationExpectationResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluationExpectationResult evaluationExpectation. - * @member {string} evaluationExpectation - * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult - * @instance - */ - EvaluationExpectationResult.prototype.evaluationExpectation = ""; - - /** - * EvaluationExpectationResult prompt. - * @member {string} prompt - * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult - * @instance - */ - EvaluationExpectationResult.prototype.prompt = ""; - - /** - * EvaluationExpectationResult outcome. - * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} outcome - * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult - * @instance - */ - EvaluationExpectationResult.prototype.outcome = 0; - - /** - * EvaluationExpectationResult explanation. - * @member {string} explanation - * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult - * @instance - */ - EvaluationExpectationResult.prototype.explanation = ""; - - /** - * Creates a new EvaluationExpectationResult instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult} EvaluationExpectationResult instance - */ - EvaluationExpectationResult.create = function create(properties) { - return new EvaluationExpectationResult(properties); - }; - - /** - * Encodes the specified EvaluationExpectationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult} message EvaluationExpectationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationExpectationResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evaluationExpectation != null && Object.hasOwnProperty.call(message, "evaluationExpectation")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.evaluationExpectation); - if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.prompt); - if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.outcome); - if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.explanation); - return writer; - }; - - /** - * Encodes the specified EvaluationExpectationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult} message EvaluationExpectationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationExpectationResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluationExpectationResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult} EvaluationExpectationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationExpectationResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.evaluationExpectation = reader.string(); - break; - } - case 2: { - message.prompt = reader.string(); - break; - } - case 3: { - message.outcome = reader.int32(); - break; - } - case 4: { - message.explanation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluationExpectationResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult} EvaluationExpectationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationExpectationResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluationExpectationResult message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluationExpectationResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evaluationExpectation != null && message.hasOwnProperty("evaluationExpectation")) - if (!$util.isString(message.evaluationExpectation)) - return "evaluationExpectation: string expected"; - if (message.prompt != null && message.hasOwnProperty("prompt")) - if (!$util.isString(message.prompt)) - return "prompt: string expected"; - if (message.outcome != null && message.hasOwnProperty("outcome")) - switch (message.outcome) { - default: - return "outcome: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.explanation != null && message.hasOwnProperty("explanation")) - if (!$util.isString(message.explanation)) - return "explanation: string expected"; - return null; - }; - - /** - * Creates an EvaluationExpectationResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult} EvaluationExpectationResult - */ - EvaluationExpectationResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult(); - if (object.evaluationExpectation != null) - message.evaluationExpectation = String(object.evaluationExpectation); - if (object.prompt != null) - message.prompt = String(object.prompt); - switch (object.outcome) { - default: - if (typeof object.outcome === "number") { - message.outcome = object.outcome; - break; - } - break; - case "OUTCOME_UNSPECIFIED": - case 0: - message.outcome = 0; - break; - case "PASS": - case 1: - message.outcome = 1; - break; - case "FAIL": - case 2: - message.outcome = 2; - break; - } - if (object.explanation != null) - message.explanation = String(object.explanation); - return message; - }; - - /** - * Creates a plain object from an EvaluationExpectationResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult} message EvaluationExpectationResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluationExpectationResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.evaluationExpectation = ""; - object.prompt = ""; - object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; - object.explanation = ""; - } - if (message.evaluationExpectation != null && message.hasOwnProperty("evaluationExpectation")) - object.evaluationExpectation = message.evaluationExpectation; - if (message.prompt != null && message.hasOwnProperty("prompt")) - object.prompt = message.prompt; - if (message.outcome != null && message.hasOwnProperty("outcome")) - object.outcome = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] : message.outcome; - if (message.explanation != null && message.hasOwnProperty("explanation")) - object.explanation = message.explanation; - return object; - }; - - /** - * Converts this EvaluationExpectationResult to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult - * @instance - * @returns {Object.} JSON object - */ - EvaluationExpectationResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluationExpectationResult - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluationExpectationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult"; - }; - - return EvaluationExpectationResult; - })(); - - EvaluationResult.GoldenResult = (function() { - - /** - * Properties of a GoldenResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @interface IGoldenResult - * @property {Array.|null} [turnReplayResults] GoldenResult turnReplayResults - * @property {Array.|null} [evaluationExpectationResults] GoldenResult evaluationExpectationResults - */ - - /** - * Constructs a new GoldenResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @classdesc Represents a GoldenResult. - * @implements IGoldenResult - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenResult=} [properties] Properties to set - */ - function GoldenResult(properties) { - this.turnReplayResults = []; - this.evaluationExpectationResults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoldenResult turnReplayResults. - * @member {Array.} turnReplayResults - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult - * @instance - */ - GoldenResult.prototype.turnReplayResults = $util.emptyArray; - - /** - * GoldenResult evaluationExpectationResults. - * @member {Array.} evaluationExpectationResults - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult - * @instance - */ - GoldenResult.prototype.evaluationExpectationResults = $util.emptyArray; - - /** - * Creates a new GoldenResult instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenResult=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult} GoldenResult instance - */ - GoldenResult.create = function create(properties) { - return new GoldenResult(properties); - }; - - /** - * Encodes the specified GoldenResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenResult} message GoldenResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoldenResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.turnReplayResults != null && message.turnReplayResults.length) - for (var i = 0; i < message.turnReplayResults.length; ++i) - $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.encode(message.turnReplayResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.evaluationExpectationResults != null && message.evaluationExpectationResults.length) - for (var i = 0; i < message.evaluationExpectationResults.length; ++i) - $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.encode(message.evaluationExpectationResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoldenResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenResult} message GoldenResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoldenResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoldenResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult} GoldenResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoldenResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.turnReplayResults && message.turnReplayResults.length)) - message.turnReplayResults = []; - message.turnReplayResults.push($root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.evaluationExpectationResults && message.evaluationExpectationResults.length)) - message.evaluationExpectationResults = []; - message.evaluationExpectationResults.push($root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoldenResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult} GoldenResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoldenResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoldenResult message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoldenResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.turnReplayResults != null && message.hasOwnProperty("turnReplayResults")) { - if (!Array.isArray(message.turnReplayResults)) - return "turnReplayResults: array expected"; - for (var i = 0; i < message.turnReplayResults.length; ++i) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.verify(message.turnReplayResults[i]); - if (error) - return "turnReplayResults." + error; - } - } - if (message.evaluationExpectationResults != null && message.hasOwnProperty("evaluationExpectationResults")) { - if (!Array.isArray(message.evaluationExpectationResults)) - return "evaluationExpectationResults: array expected"; - for (var i = 0; i < message.evaluationExpectationResults.length; ++i) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.verify(message.evaluationExpectationResults[i]); - if (error) - return "evaluationExpectationResults." + error; - } - } - return null; - }; - - /** - * Creates a GoldenResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult} GoldenResult - */ - GoldenResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult(); - if (object.turnReplayResults) { - if (!Array.isArray(object.turnReplayResults)) - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.turnReplayResults: array expected"); - message.turnReplayResults = []; - for (var i = 0; i < object.turnReplayResults.length; ++i) { - if (typeof object.turnReplayResults[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.turnReplayResults: object expected"); - message.turnReplayResults[i] = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.fromObject(object.turnReplayResults[i]); - } - } - if (object.evaluationExpectationResults) { - if (!Array.isArray(object.evaluationExpectationResults)) - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.evaluationExpectationResults: array expected"); - message.evaluationExpectationResults = []; - for (var i = 0; i < object.evaluationExpectationResults.length; ++i) { - if (typeof object.evaluationExpectationResults[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.evaluationExpectationResults: object expected"); - message.evaluationExpectationResults[i] = $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.fromObject(object.evaluationExpectationResults[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GoldenResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenResult} message GoldenResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoldenResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.turnReplayResults = []; - object.evaluationExpectationResults = []; - } - if (message.turnReplayResults && message.turnReplayResults.length) { - object.turnReplayResults = []; - for (var j = 0; j < message.turnReplayResults.length; ++j) - object.turnReplayResults[j] = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.toObject(message.turnReplayResults[j], options); - } - if (message.evaluationExpectationResults && message.evaluationExpectationResults.length) { - object.evaluationExpectationResults = []; - for (var j = 0; j < message.evaluationExpectationResults.length; ++j) - object.evaluationExpectationResults[j] = $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.toObject(message.evaluationExpectationResults[j], options); - } - return object; - }; - - /** - * Converts this GoldenResult to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult - * @instance - * @returns {Object.} JSON object - */ - GoldenResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoldenResult - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoldenResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.GoldenResult"; - }; - - GoldenResult.TurnReplayResult = (function() { - - /** - * Properties of a TurnReplayResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult - * @interface ITurnReplayResult - * @property {string|null} [conversation] TurnReplayResult conversation - * @property {Array.|null} [expectationOutcome] TurnReplayResult expectationOutcome - * @property {google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult|null} [hallucinationResult] TurnReplayResult hallucinationResult - * @property {number|null} [toolInvocationScore] TurnReplayResult toolInvocationScore - * @property {number|null} [toolOrderedInvocationScore] TurnReplayResult toolOrderedInvocationScore - * @property {google.protobuf.IDuration|null} [turnLatency] TurnReplayResult turnLatency - * @property {Array.|null} [toolCallLatencies] TurnReplayResult toolCallLatencies - * @property {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null} [semanticSimilarityResult] TurnReplayResult semanticSimilarityResult - * @property {google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult|null} [overallToolInvocationResult] TurnReplayResult overallToolInvocationResult - * @property {google.cloud.ces.v1beta.IEvaluationErrorInfo|null} [errorInfo] TurnReplayResult errorInfo - * @property {Array.|null} [spanLatencies] TurnReplayResult spanLatencies - */ - - /** - * Constructs a new TurnReplayResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult - * @classdesc Represents a TurnReplayResult. - * @implements ITurnReplayResult - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult=} [properties] Properties to set - */ - function TurnReplayResult(properties) { - this.expectationOutcome = []; - this.toolCallLatencies = []; - this.spanLatencies = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TurnReplayResult conversation. - * @member {string} conversation - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @instance - */ - TurnReplayResult.prototype.conversation = ""; - - /** - * TurnReplayResult expectationOutcome. - * @member {Array.} expectationOutcome - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @instance - */ - TurnReplayResult.prototype.expectationOutcome = $util.emptyArray; - - /** - * TurnReplayResult hallucinationResult. - * @member {google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult|null|undefined} hallucinationResult - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @instance - */ - TurnReplayResult.prototype.hallucinationResult = null; - - /** - * TurnReplayResult toolInvocationScore. - * @member {number} toolInvocationScore - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @instance - */ - TurnReplayResult.prototype.toolInvocationScore = 0; - - /** - * TurnReplayResult toolOrderedInvocationScore. - * @member {number|null|undefined} toolOrderedInvocationScore - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @instance - */ - TurnReplayResult.prototype.toolOrderedInvocationScore = null; - - /** - * TurnReplayResult turnLatency. - * @member {google.protobuf.IDuration|null|undefined} turnLatency - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @instance - */ - TurnReplayResult.prototype.turnLatency = null; - - /** - * TurnReplayResult toolCallLatencies. - * @member {Array.} toolCallLatencies - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @instance - */ - TurnReplayResult.prototype.toolCallLatencies = $util.emptyArray; - - /** - * TurnReplayResult semanticSimilarityResult. - * @member {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null|undefined} semanticSimilarityResult - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @instance - */ - TurnReplayResult.prototype.semanticSimilarityResult = null; - - /** - * TurnReplayResult overallToolInvocationResult. - * @member {google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult|null|undefined} overallToolInvocationResult - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @instance - */ - TurnReplayResult.prototype.overallToolInvocationResult = null; - - /** - * TurnReplayResult errorInfo. - * @member {google.cloud.ces.v1beta.IEvaluationErrorInfo|null|undefined} errorInfo - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @instance - */ - TurnReplayResult.prototype.errorInfo = null; - - /** - * TurnReplayResult spanLatencies. - * @member {Array.} spanLatencies - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @instance - */ - TurnReplayResult.prototype.spanLatencies = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(TurnReplayResult.prototype, "_toolOrderedInvocationScore", { - get: $util.oneOfGetter($oneOfFields = ["toolOrderedInvocationScore"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TurnReplayResult instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult} TurnReplayResult instance - */ - TurnReplayResult.create = function create(properties) { - return new TurnReplayResult(properties); - }; - - /** - * Encodes the specified TurnReplayResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult} message TurnReplayResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TurnReplayResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversation); - if (message.expectationOutcome != null && message.expectationOutcome.length) - for (var i = 0; i < message.expectationOutcome.length; ++i) - $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.encode(message.expectationOutcome[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.hallucinationResult != null && Object.hasOwnProperty.call(message, "hallucinationResult")) - $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.encode(message.hallucinationResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.toolInvocationScore != null && Object.hasOwnProperty.call(message, "toolInvocationScore")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.toolInvocationScore); - if (message.toolOrderedInvocationScore != null && Object.hasOwnProperty.call(message, "toolOrderedInvocationScore")) - writer.uint32(/* id 5, wireType 5 =*/45).float(message.toolOrderedInvocationScore); - if (message.turnLatency != null && Object.hasOwnProperty.call(message, "turnLatency")) - $root.google.protobuf.Duration.encode(message.turnLatency, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.toolCallLatencies != null && message.toolCallLatencies.length) - for (var i = 0; i < message.toolCallLatencies.length; ++i) - $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.encode(message.toolCallLatencies[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.semanticSimilarityResult != null && Object.hasOwnProperty.call(message, "semanticSimilarityResult")) - $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.encode(message.semanticSimilarityResult, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.overallToolInvocationResult != null && Object.hasOwnProperty.call(message, "overallToolInvocationResult")) - $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.encode(message.overallToolInvocationResult, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.errorInfo != null && Object.hasOwnProperty.call(message, "errorInfo")) - $root.google.cloud.ces.v1beta.EvaluationErrorInfo.encode(message.errorInfo, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.spanLatencies != null && message.spanLatencies.length) - for (var i = 0; i < message.spanLatencies.length; ++i) - $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.encode(message.spanLatencies[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TurnReplayResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult} message TurnReplayResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TurnReplayResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TurnReplayResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult} TurnReplayResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TurnReplayResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.conversation = reader.string(); - break; - } - case 2: { - if (!(message.expectationOutcome && message.expectationOutcome.length)) - message.expectationOutcome = []; - message.expectationOutcome.push($root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.decode(reader, reader.uint32())); - break; - } - case 3: { - message.hallucinationResult = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.decode(reader, reader.uint32()); - break; - } - case 4: { - message.toolInvocationScore = reader.float(); - break; - } - case 5: { - message.toolOrderedInvocationScore = reader.float(); - break; - } - case 6: { - message.turnLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 7: { - if (!(message.toolCallLatencies && message.toolCallLatencies.length)) - message.toolCallLatencies = []; - message.toolCallLatencies.push($root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.decode(reader, reader.uint32())); - break; - } - case 8: { - message.semanticSimilarityResult = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.decode(reader, reader.uint32()); - break; - } - case 9: { - message.overallToolInvocationResult = $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.decode(reader, reader.uint32()); - break; - } - case 10: { - message.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.decode(reader, reader.uint32()); - break; - } - case 11: { - if (!(message.spanLatencies && message.spanLatencies.length)) - message.spanLatencies = []; - message.spanLatencies.push($root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TurnReplayResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult} TurnReplayResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TurnReplayResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TurnReplayResult message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TurnReplayResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.conversation != null && message.hasOwnProperty("conversation")) - if (!$util.isString(message.conversation)) - return "conversation: string expected"; - if (message.expectationOutcome != null && message.hasOwnProperty("expectationOutcome")) { - if (!Array.isArray(message.expectationOutcome)) - return "expectationOutcome: array expected"; - for (var i = 0; i < message.expectationOutcome.length; ++i) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.verify(message.expectationOutcome[i]); - if (error) - return "expectationOutcome." + error; - } - } - if (message.hallucinationResult != null && message.hasOwnProperty("hallucinationResult")) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.verify(message.hallucinationResult); - if (error) - return "hallucinationResult." + error; - } - if (message.toolInvocationScore != null && message.hasOwnProperty("toolInvocationScore")) - if (typeof message.toolInvocationScore !== "number") - return "toolInvocationScore: number expected"; - if (message.toolOrderedInvocationScore != null && message.hasOwnProperty("toolOrderedInvocationScore")) { - properties._toolOrderedInvocationScore = 1; - if (typeof message.toolOrderedInvocationScore !== "number") - return "toolOrderedInvocationScore: number expected"; - } - if (message.turnLatency != null && message.hasOwnProperty("turnLatency")) { - var error = $root.google.protobuf.Duration.verify(message.turnLatency); - if (error) - return "turnLatency." + error; - } - if (message.toolCallLatencies != null && message.hasOwnProperty("toolCallLatencies")) { - if (!Array.isArray(message.toolCallLatencies)) - return "toolCallLatencies: array expected"; - for (var i = 0; i < message.toolCallLatencies.length; ++i) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.verify(message.toolCallLatencies[i]); - if (error) - return "toolCallLatencies." + error; - } - } - if (message.semanticSimilarityResult != null && message.hasOwnProperty("semanticSimilarityResult")) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.verify(message.semanticSimilarityResult); - if (error) - return "semanticSimilarityResult." + error; - } - if (message.overallToolInvocationResult != null && message.hasOwnProperty("overallToolInvocationResult")) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.verify(message.overallToolInvocationResult); - if (error) - return "overallToolInvocationResult." + error; - } - if (message.errorInfo != null && message.hasOwnProperty("errorInfo")) { - var error = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.verify(message.errorInfo); - if (error) - return "errorInfo." + error; - } - if (message.spanLatencies != null && message.hasOwnProperty("spanLatencies")) { - if (!Array.isArray(message.spanLatencies)) - return "spanLatencies: array expected"; - for (var i = 0; i < message.spanLatencies.length; ++i) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.verify(message.spanLatencies[i]); - if (error) - return "spanLatencies." + error; - } - } - return null; - }; - - /** - * Creates a TurnReplayResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult} TurnReplayResult - */ - TurnReplayResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult(); - if (object.conversation != null) - message.conversation = String(object.conversation); - if (object.expectationOutcome) { - if (!Array.isArray(object.expectationOutcome)) - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.expectationOutcome: array expected"); - message.expectationOutcome = []; - for (var i = 0; i < object.expectationOutcome.length; ++i) { - if (typeof object.expectationOutcome[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.expectationOutcome: object expected"); - message.expectationOutcome[i] = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.fromObject(object.expectationOutcome[i]); - } - } - if (object.hallucinationResult != null) { - if (typeof object.hallucinationResult !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.hallucinationResult: object expected"); - message.hallucinationResult = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.fromObject(object.hallucinationResult); - } - if (object.toolInvocationScore != null) - message.toolInvocationScore = Number(object.toolInvocationScore); - if (object.toolOrderedInvocationScore != null) - message.toolOrderedInvocationScore = Number(object.toolOrderedInvocationScore); - if (object.turnLatency != null) { - if (typeof object.turnLatency !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.turnLatency: object expected"); - message.turnLatency = $root.google.protobuf.Duration.fromObject(object.turnLatency); - } - if (object.toolCallLatencies) { - if (!Array.isArray(object.toolCallLatencies)) - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.toolCallLatencies: array expected"); - message.toolCallLatencies = []; - for (var i = 0; i < object.toolCallLatencies.length; ++i) { - if (typeof object.toolCallLatencies[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.toolCallLatencies: object expected"); - message.toolCallLatencies[i] = $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.fromObject(object.toolCallLatencies[i]); - } - } - if (object.semanticSimilarityResult != null) { - if (typeof object.semanticSimilarityResult !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.semanticSimilarityResult: object expected"); - message.semanticSimilarityResult = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.fromObject(object.semanticSimilarityResult); - } - if (object.overallToolInvocationResult != null) { - if (typeof object.overallToolInvocationResult !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.overallToolInvocationResult: object expected"); - message.overallToolInvocationResult = $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.fromObject(object.overallToolInvocationResult); - } - if (object.errorInfo != null) { - if (typeof object.errorInfo !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.errorInfo: object expected"); - message.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.fromObject(object.errorInfo); - } - if (object.spanLatencies) { - if (!Array.isArray(object.spanLatencies)) - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.spanLatencies: array expected"); - message.spanLatencies = []; - for (var i = 0; i < object.spanLatencies.length; ++i) { - if (typeof object.spanLatencies[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.spanLatencies: object expected"); - message.spanLatencies[i] = $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.fromObject(object.spanLatencies[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TurnReplayResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult} message TurnReplayResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TurnReplayResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.expectationOutcome = []; - object.toolCallLatencies = []; - object.spanLatencies = []; - } - if (options.defaults) { - object.conversation = ""; - object.hallucinationResult = null; - object.toolInvocationScore = 0; - object.turnLatency = null; - object.semanticSimilarityResult = null; - object.overallToolInvocationResult = null; - object.errorInfo = null; - } - if (message.conversation != null && message.hasOwnProperty("conversation")) - object.conversation = message.conversation; - if (message.expectationOutcome && message.expectationOutcome.length) { - object.expectationOutcome = []; - for (var j = 0; j < message.expectationOutcome.length; ++j) - object.expectationOutcome[j] = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.toObject(message.expectationOutcome[j], options); - } - if (message.hallucinationResult != null && message.hasOwnProperty("hallucinationResult")) - object.hallucinationResult = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.toObject(message.hallucinationResult, options); - if (message.toolInvocationScore != null && message.hasOwnProperty("toolInvocationScore")) - object.toolInvocationScore = options.json && !isFinite(message.toolInvocationScore) ? String(message.toolInvocationScore) : message.toolInvocationScore; - if (message.toolOrderedInvocationScore != null && message.hasOwnProperty("toolOrderedInvocationScore")) { - object.toolOrderedInvocationScore = options.json && !isFinite(message.toolOrderedInvocationScore) ? String(message.toolOrderedInvocationScore) : message.toolOrderedInvocationScore; - if (options.oneofs) - object._toolOrderedInvocationScore = "toolOrderedInvocationScore"; - } - if (message.turnLatency != null && message.hasOwnProperty("turnLatency")) - object.turnLatency = $root.google.protobuf.Duration.toObject(message.turnLatency, options); - if (message.toolCallLatencies && message.toolCallLatencies.length) { - object.toolCallLatencies = []; - for (var j = 0; j < message.toolCallLatencies.length; ++j) - object.toolCallLatencies[j] = $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.toObject(message.toolCallLatencies[j], options); - } - if (message.semanticSimilarityResult != null && message.hasOwnProperty("semanticSimilarityResult")) - object.semanticSimilarityResult = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.toObject(message.semanticSimilarityResult, options); - if (message.overallToolInvocationResult != null && message.hasOwnProperty("overallToolInvocationResult")) - object.overallToolInvocationResult = $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.toObject(message.overallToolInvocationResult, options); - if (message.errorInfo != null && message.hasOwnProperty("errorInfo")) - object.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.toObject(message.errorInfo, options); - if (message.spanLatencies && message.spanLatencies.length) { - object.spanLatencies = []; - for (var j = 0; j < message.spanLatencies.length; ++j) - object.spanLatencies[j] = $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.toObject(message.spanLatencies[j], options); - } - return object; - }; - - /** - * Converts this TurnReplayResult to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @instance - * @returns {Object.} JSON object - */ - TurnReplayResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TurnReplayResult - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TurnReplayResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult"; - }; - - return TurnReplayResult; - })(); - - return GoldenResult; - })(); - - EvaluationResult.ScenarioRubricOutcome = (function() { - - /** - * Properties of a ScenarioRubricOutcome. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @interface IScenarioRubricOutcome - * @property {string|null} [rubric] ScenarioRubricOutcome rubric - * @property {number|null} [score] ScenarioRubricOutcome score - * @property {string|null} [scoreExplanation] ScenarioRubricOutcome scoreExplanation - */ - - /** - * Constructs a new ScenarioRubricOutcome. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @classdesc Represents a ScenarioRubricOutcome. - * @implements IScenarioRubricOutcome - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome=} [properties] Properties to set - */ - function ScenarioRubricOutcome(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ScenarioRubricOutcome rubric. - * @member {string} rubric - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome - * @instance - */ - ScenarioRubricOutcome.prototype.rubric = ""; - - /** - * ScenarioRubricOutcome score. - * @member {number|null|undefined} score - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome - * @instance - */ - ScenarioRubricOutcome.prototype.score = null; - - /** - * ScenarioRubricOutcome scoreExplanation. - * @member {string} scoreExplanation - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome - * @instance - */ - ScenarioRubricOutcome.prototype.scoreExplanation = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ScenarioRubricOutcome.prototype, "_score", { - get: $util.oneOfGetter($oneOfFields = ["score"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ScenarioRubricOutcome instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome} ScenarioRubricOutcome instance - */ - ScenarioRubricOutcome.create = function create(properties) { - return new ScenarioRubricOutcome(properties); - }; - - /** - * Encodes the specified ScenarioRubricOutcome message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome} message ScenarioRubricOutcome message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScenarioRubricOutcome.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rubric != null && Object.hasOwnProperty.call(message, "rubric")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.rubric); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); - if (message.scoreExplanation != null && Object.hasOwnProperty.call(message, "scoreExplanation")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.scoreExplanation); - return writer; - }; - - /** - * Encodes the specified ScenarioRubricOutcome message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome} message ScenarioRubricOutcome message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScenarioRubricOutcome.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ScenarioRubricOutcome message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome} ScenarioRubricOutcome - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScenarioRubricOutcome.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.rubric = reader.string(); - break; - } - case 2: { - message.score = reader.float(); - break; - } - case 3: { - message.scoreExplanation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ScenarioRubricOutcome message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome} ScenarioRubricOutcome - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScenarioRubricOutcome.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ScenarioRubricOutcome message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ScenarioRubricOutcome.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.rubric != null && message.hasOwnProperty("rubric")) - if (!$util.isString(message.rubric)) - return "rubric: string expected"; - if (message.score != null && message.hasOwnProperty("score")) { - properties._score = 1; - if (typeof message.score !== "number") - return "score: number expected"; - } - if (message.scoreExplanation != null && message.hasOwnProperty("scoreExplanation")) - if (!$util.isString(message.scoreExplanation)) - return "scoreExplanation: string expected"; - return null; - }; - - /** - * Creates a ScenarioRubricOutcome message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome} ScenarioRubricOutcome - */ - ScenarioRubricOutcome.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome(); - if (object.rubric != null) - message.rubric = String(object.rubric); - if (object.score != null) - message.score = Number(object.score); - if (object.scoreExplanation != null) - message.scoreExplanation = String(object.scoreExplanation); - return message; - }; - - /** - * Creates a plain object from a ScenarioRubricOutcome message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome} message ScenarioRubricOutcome - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ScenarioRubricOutcome.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.rubric = ""; - object.scoreExplanation = ""; - } - if (message.rubric != null && message.hasOwnProperty("rubric")) - object.rubric = message.rubric; - if (message.score != null && message.hasOwnProperty("score")) { - object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; - if (options.oneofs) - object._score = "score"; - } - if (message.scoreExplanation != null && message.hasOwnProperty("scoreExplanation")) - object.scoreExplanation = message.scoreExplanation; - return object; - }; - - /** - * Converts this ScenarioRubricOutcome to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome - * @instance - * @returns {Object.} JSON object - */ - ScenarioRubricOutcome.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ScenarioRubricOutcome - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ScenarioRubricOutcome.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome"; - }; - - return ScenarioRubricOutcome; - })(); - - EvaluationResult.ScenarioExpectationOutcome = (function() { - - /** - * Properties of a ScenarioExpectationOutcome. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @interface IScenarioExpectationOutcome - * @property {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall|null} [observedToolCall] ScenarioExpectationOutcome observedToolCall - * @property {google.cloud.ces.v1beta.IMessage|null} [observedAgentResponse] ScenarioExpectationOutcome observedAgentResponse - * @property {google.cloud.ces.v1beta.Evaluation.IScenarioExpectation|null} [expectation] ScenarioExpectationOutcome expectation - * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [outcome] ScenarioExpectationOutcome outcome - */ - - /** - * Constructs a new ScenarioExpectationOutcome. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @classdesc Represents a ScenarioExpectationOutcome. - * @implements IScenarioExpectationOutcome - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome=} [properties] Properties to set - */ - function ScenarioExpectationOutcome(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ScenarioExpectationOutcome observedToolCall. - * @member {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall|null|undefined} observedToolCall - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome - * @instance - */ - ScenarioExpectationOutcome.prototype.observedToolCall = null; - - /** - * ScenarioExpectationOutcome observedAgentResponse. - * @member {google.cloud.ces.v1beta.IMessage|null|undefined} observedAgentResponse - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome - * @instance - */ - ScenarioExpectationOutcome.prototype.observedAgentResponse = null; - - /** - * ScenarioExpectationOutcome expectation. - * @member {google.cloud.ces.v1beta.Evaluation.IScenarioExpectation|null|undefined} expectation - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome - * @instance - */ - ScenarioExpectationOutcome.prototype.expectation = null; - - /** - * ScenarioExpectationOutcome outcome. - * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} outcome - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome - * @instance - */ - ScenarioExpectationOutcome.prototype.outcome = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ScenarioExpectationOutcome result. - * @member {"observedToolCall"|"observedAgentResponse"|undefined} result - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome - * @instance - */ - Object.defineProperty(ScenarioExpectationOutcome.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["observedToolCall", "observedAgentResponse"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ScenarioExpectationOutcome instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome} ScenarioExpectationOutcome instance - */ - ScenarioExpectationOutcome.create = function create(properties) { - return new ScenarioExpectationOutcome(properties); - }; - - /** - * Encodes the specified ScenarioExpectationOutcome message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome} message ScenarioExpectationOutcome message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScenarioExpectationOutcome.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expectation != null && Object.hasOwnProperty.call(message, "expectation")) - $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.encode(message.expectation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.observedToolCall != null && Object.hasOwnProperty.call(message, "observedToolCall")) - $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.encode(message.observedToolCall, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.observedAgentResponse != null && Object.hasOwnProperty.call(message, "observedAgentResponse")) - $root.google.cloud.ces.v1beta.Message.encode(message.observedAgentResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.outcome); - return writer; - }; - - /** - * Encodes the specified ScenarioExpectationOutcome message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome} message ScenarioExpectationOutcome message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScenarioExpectationOutcome.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ScenarioExpectationOutcome message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome} ScenarioExpectationOutcome - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScenarioExpectationOutcome.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.observedToolCall = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.decode(reader, reader.uint32()); - break; - } - case 3: { - message.observedAgentResponse = $root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32()); - break; - } - case 1: { - message.expectation = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.decode(reader, reader.uint32()); - break; - } - case 4: { - message.outcome = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ScenarioExpectationOutcome message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome} ScenarioExpectationOutcome - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScenarioExpectationOutcome.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ScenarioExpectationOutcome message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ScenarioExpectationOutcome.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.observedToolCall != null && message.hasOwnProperty("observedToolCall")) { - properties.result = 1; - { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.verify(message.observedToolCall); - if (error) - return "observedToolCall." + error; - } - } - if (message.observedAgentResponse != null && message.hasOwnProperty("observedAgentResponse")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.cloud.ces.v1beta.Message.verify(message.observedAgentResponse); - if (error) - return "observedAgentResponse." + error; - } - } - if (message.expectation != null && message.hasOwnProperty("expectation")) { - var error = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.verify(message.expectation); - if (error) - return "expectation." + error; - } - if (message.outcome != null && message.hasOwnProperty("outcome")) - switch (message.outcome) { - default: - return "outcome: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a ScenarioExpectationOutcome message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome} ScenarioExpectationOutcome - */ - ScenarioExpectationOutcome.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome(); - if (object.observedToolCall != null) { - if (typeof object.observedToolCall !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.observedToolCall: object expected"); - message.observedToolCall = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.fromObject(object.observedToolCall); - } - if (object.observedAgentResponse != null) { - if (typeof object.observedAgentResponse !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.observedAgentResponse: object expected"); - message.observedAgentResponse = $root.google.cloud.ces.v1beta.Message.fromObject(object.observedAgentResponse); - } - if (object.expectation != null) { - if (typeof object.expectation !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.expectation: object expected"); - message.expectation = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.fromObject(object.expectation); - } - switch (object.outcome) { - default: - if (typeof object.outcome === "number") { - message.outcome = object.outcome; - break; - } - break; - case "OUTCOME_UNSPECIFIED": - case 0: - message.outcome = 0; - break; - case "PASS": - case 1: - message.outcome = 1; - break; - case "FAIL": - case 2: - message.outcome = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a ScenarioExpectationOutcome message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome} message ScenarioExpectationOutcome - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ScenarioExpectationOutcome.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expectation = null; - object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; - } - if (message.expectation != null && message.hasOwnProperty("expectation")) - object.expectation = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.toObject(message.expectation, options); - if (message.observedToolCall != null && message.hasOwnProperty("observedToolCall")) { - object.observedToolCall = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.toObject(message.observedToolCall, options); - if (options.oneofs) - object.result = "observedToolCall"; - } - if (message.observedAgentResponse != null && message.hasOwnProperty("observedAgentResponse")) { - object.observedAgentResponse = $root.google.cloud.ces.v1beta.Message.toObject(message.observedAgentResponse, options); - if (options.oneofs) - object.result = "observedAgentResponse"; - } - if (message.outcome != null && message.hasOwnProperty("outcome")) - object.outcome = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] : message.outcome; - return object; - }; - - /** - * Converts this ScenarioExpectationOutcome to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome - * @instance - * @returns {Object.} JSON object - */ - ScenarioExpectationOutcome.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ScenarioExpectationOutcome - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ScenarioExpectationOutcome.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome"; - }; - - ScenarioExpectationOutcome.ObservedToolCall = (function() { - - /** - * Properties of an ObservedToolCall. - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome - * @interface IObservedToolCall - * @property {google.cloud.ces.v1beta.IToolCall|null} [toolCall] ObservedToolCall toolCall - * @property {google.cloud.ces.v1beta.IToolResponse|null} [toolResponse] ObservedToolCall toolResponse - */ - - /** - * Constructs a new ObservedToolCall. - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome - * @classdesc Represents an ObservedToolCall. - * @implements IObservedToolCall - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall=} [properties] Properties to set - */ - function ObservedToolCall(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ObservedToolCall toolCall. - * @member {google.cloud.ces.v1beta.IToolCall|null|undefined} toolCall - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall - * @instance - */ - ObservedToolCall.prototype.toolCall = null; - - /** - * ObservedToolCall toolResponse. - * @member {google.cloud.ces.v1beta.IToolResponse|null|undefined} toolResponse - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall - * @instance - */ - ObservedToolCall.prototype.toolResponse = null; - - /** - * Creates a new ObservedToolCall instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall} ObservedToolCall instance - */ - ObservedToolCall.create = function create(properties) { - return new ObservedToolCall(properties); - }; - - /** - * Encodes the specified ObservedToolCall message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall} message ObservedToolCall message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ObservedToolCall.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolCall != null && Object.hasOwnProperty.call(message, "toolCall")) - $root.google.cloud.ces.v1beta.ToolCall.encode(message.toolCall, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.toolResponse != null && Object.hasOwnProperty.call(message, "toolResponse")) - $root.google.cloud.ces.v1beta.ToolResponse.encode(message.toolResponse, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ObservedToolCall message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall} message ObservedToolCall message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ObservedToolCall.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ObservedToolCall message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall} ObservedToolCall - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ObservedToolCall.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.toolCall = $root.google.cloud.ces.v1beta.ToolCall.decode(reader, reader.uint32()); - break; - } - case 2: { - message.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ObservedToolCall message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall} ObservedToolCall - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ObservedToolCall.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ObservedToolCall message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ObservedToolCall.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.toolCall != null && message.hasOwnProperty("toolCall")) { - var error = $root.google.cloud.ces.v1beta.ToolCall.verify(message.toolCall); - if (error) - return "toolCall." + error; - } - if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { - var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.toolResponse); - if (error) - return "toolResponse." + error; - } - return null; - }; - - /** - * Creates an ObservedToolCall message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall} ObservedToolCall - */ - ObservedToolCall.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall(); - if (object.toolCall != null) { - if (typeof object.toolCall !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.toolCall: object expected"); - message.toolCall = $root.google.cloud.ces.v1beta.ToolCall.fromObject(object.toolCall); - } - if (object.toolResponse != null) { - if (typeof object.toolResponse !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.toolResponse: object expected"); - message.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.toolResponse); - } - return message; - }; - - /** - * Creates a plain object from an ObservedToolCall message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall} message ObservedToolCall - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ObservedToolCall.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.toolCall = null; - object.toolResponse = null; - } - if (message.toolCall != null && message.hasOwnProperty("toolCall")) - object.toolCall = $root.google.cloud.ces.v1beta.ToolCall.toObject(message.toolCall, options); - if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) - object.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.toolResponse, options); - return object; - }; - - /** - * Converts this ObservedToolCall to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall - * @instance - * @returns {Object.} JSON object - */ - ObservedToolCall.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ObservedToolCall - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ObservedToolCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall"; - }; - - return ObservedToolCall; - })(); - - return ScenarioExpectationOutcome; - })(); - - EvaluationResult.ScenarioResult = (function() { - - /** - * Properties of a ScenarioResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @interface IScenarioResult - * @property {string|null} [conversation] ScenarioResult conversation - * @property {string|null} [task] ScenarioResult task - * @property {Array.|null} [userFacts] ScenarioResult userFacts - * @property {Array.|null} [expectationOutcomes] ScenarioResult expectationOutcomes - * @property {Array.|null} [rubricOutcomes] ScenarioResult rubricOutcomes - * @property {Array.|null} [hallucinationResult] ScenarioResult hallucinationResult - * @property {google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult|null} [taskCompletionResult] ScenarioResult taskCompletionResult - * @property {Array.|null} [toolCallLatencies] ScenarioResult toolCallLatencies - * @property {google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult|null} [userGoalSatisfactionResult] ScenarioResult userGoalSatisfactionResult - * @property {boolean|null} [allExpectationsSatisfied] ScenarioResult allExpectationsSatisfied - * @property {boolean|null} [taskCompleted] ScenarioResult taskCompleted - * @property {Array.|null} [spanLatencies] ScenarioResult spanLatencies - * @property {Array.|null} [evaluationExpectationResults] ScenarioResult evaluationExpectationResults - */ - - /** - * Constructs a new ScenarioResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @classdesc Represents a ScenarioResult. - * @implements IScenarioResult - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioResult=} [properties] Properties to set - */ - function ScenarioResult(properties) { - this.userFacts = []; - this.expectationOutcomes = []; - this.rubricOutcomes = []; - this.hallucinationResult = []; - this.toolCallLatencies = []; - this.spanLatencies = []; - this.evaluationExpectationResults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ScenarioResult conversation. - * @member {string} conversation - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @instance - */ - ScenarioResult.prototype.conversation = ""; - - /** - * ScenarioResult task. - * @member {string} task - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @instance - */ - ScenarioResult.prototype.task = ""; - - /** - * ScenarioResult userFacts. - * @member {Array.} userFacts - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @instance - */ - ScenarioResult.prototype.userFacts = $util.emptyArray; - - /** - * ScenarioResult expectationOutcomes. - * @member {Array.} expectationOutcomes - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @instance - */ - ScenarioResult.prototype.expectationOutcomes = $util.emptyArray; - - /** - * ScenarioResult rubricOutcomes. - * @member {Array.} rubricOutcomes - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @instance - */ - ScenarioResult.prototype.rubricOutcomes = $util.emptyArray; - - /** - * ScenarioResult hallucinationResult. - * @member {Array.} hallucinationResult - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @instance - */ - ScenarioResult.prototype.hallucinationResult = $util.emptyArray; - - /** - * ScenarioResult taskCompletionResult. - * @member {google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult|null|undefined} taskCompletionResult - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @instance - */ - ScenarioResult.prototype.taskCompletionResult = null; - - /** - * ScenarioResult toolCallLatencies. - * @member {Array.} toolCallLatencies - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @instance - */ - ScenarioResult.prototype.toolCallLatencies = $util.emptyArray; - - /** - * ScenarioResult userGoalSatisfactionResult. - * @member {google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult|null|undefined} userGoalSatisfactionResult - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @instance - */ - ScenarioResult.prototype.userGoalSatisfactionResult = null; - - /** - * ScenarioResult allExpectationsSatisfied. - * @member {boolean|null|undefined} allExpectationsSatisfied - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @instance - */ - ScenarioResult.prototype.allExpectationsSatisfied = null; - - /** - * ScenarioResult taskCompleted. - * @member {boolean|null|undefined} taskCompleted - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @instance - */ - ScenarioResult.prototype.taskCompleted = null; - - /** - * ScenarioResult spanLatencies. - * @member {Array.} spanLatencies - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @instance - */ - ScenarioResult.prototype.spanLatencies = $util.emptyArray; - - /** - * ScenarioResult evaluationExpectationResults. - * @member {Array.} evaluationExpectationResults - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @instance - */ - ScenarioResult.prototype.evaluationExpectationResults = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ScenarioResult.prototype, "_allExpectationsSatisfied", { - get: $util.oneOfGetter($oneOfFields = ["allExpectationsSatisfied"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ScenarioResult.prototype, "_taskCompleted", { - get: $util.oneOfGetter($oneOfFields = ["taskCompleted"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ScenarioResult instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioResult=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioResult} ScenarioResult instance - */ - ScenarioResult.create = function create(properties) { - return new ScenarioResult(properties); - }; - - /** - * Encodes the specified ScenarioResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioResult} message ScenarioResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScenarioResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversation); - if (message.expectationOutcomes != null && message.expectationOutcomes.length) - for (var i = 0; i < message.expectationOutcomes.length; ++i) - $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.encode(message.expectationOutcomes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.rubricOutcomes != null && message.rubricOutcomes.length) - for (var i = 0; i < message.rubricOutcomes.length; ++i) - $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.encode(message.rubricOutcomes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.hallucinationResult != null && message.hallucinationResult.length) - for (var i = 0; i < message.hallucinationResult.length; ++i) - $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.encode(message.hallucinationResult[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.taskCompletionResult != null && Object.hasOwnProperty.call(message, "taskCompletionResult")) - $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.encode(message.taskCompletionResult, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.toolCallLatencies != null && message.toolCallLatencies.length) - for (var i = 0; i < message.toolCallLatencies.length; ++i) - $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.encode(message.toolCallLatencies[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.userGoalSatisfactionResult != null && Object.hasOwnProperty.call(message, "userGoalSatisfactionResult")) - $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.encode(message.userGoalSatisfactionResult, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.allExpectationsSatisfied != null && Object.hasOwnProperty.call(message, "allExpectationsSatisfied")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.allExpectationsSatisfied); - if (message.taskCompleted != null && Object.hasOwnProperty.call(message, "taskCompleted")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.taskCompleted); - if (message.task != null && Object.hasOwnProperty.call(message, "task")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.task); - if (message.userFacts != null && message.userFacts.length) - for (var i = 0; i < message.userFacts.length; ++i) - $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.encode(message.userFacts[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.spanLatencies != null && message.spanLatencies.length) - for (var i = 0; i < message.spanLatencies.length; ++i) - $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.encode(message.spanLatencies[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.evaluationExpectationResults != null && message.evaluationExpectationResults.length) - for (var i = 0; i < message.evaluationExpectationResults.length; ++i) - $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.encode(message.evaluationExpectationResults[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ScenarioResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioResult} message ScenarioResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScenarioResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ScenarioResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioResult} ScenarioResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScenarioResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.conversation = reader.string(); - break; - } - case 10: { - message.task = reader.string(); - break; - } - case 11: { - if (!(message.userFacts && message.userFacts.length)) - message.userFacts = []; - message.userFacts.push($root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.expectationOutcomes && message.expectationOutcomes.length)) - message.expectationOutcomes = []; - message.expectationOutcomes.push($root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.rubricOutcomes && message.rubricOutcomes.length)) - message.rubricOutcomes = []; - message.rubricOutcomes.push($root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.hallucinationResult && message.hallucinationResult.length)) - message.hallucinationResult = []; - message.hallucinationResult.push($root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.decode(reader, reader.uint32())); - break; - } - case 5: { - message.taskCompletionResult = $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.decode(reader, reader.uint32()); - break; - } - case 6: { - if (!(message.toolCallLatencies && message.toolCallLatencies.length)) - message.toolCallLatencies = []; - message.toolCallLatencies.push($root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.decode(reader, reader.uint32())); - break; - } - case 7: { - message.userGoalSatisfactionResult = $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.decode(reader, reader.uint32()); - break; - } - case 8: { - message.allExpectationsSatisfied = reader.bool(); - break; - } - case 9: { - message.taskCompleted = reader.bool(); - break; - } - case 12: { - if (!(message.spanLatencies && message.spanLatencies.length)) - message.spanLatencies = []; - message.spanLatencies.push($root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.decode(reader, reader.uint32())); - break; - } - case 13: { - if (!(message.evaluationExpectationResults && message.evaluationExpectationResults.length)) - message.evaluationExpectationResults = []; - message.evaluationExpectationResults.push($root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ScenarioResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioResult} ScenarioResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScenarioResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ScenarioResult message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ScenarioResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.conversation != null && message.hasOwnProperty("conversation")) - if (!$util.isString(message.conversation)) - return "conversation: string expected"; - if (message.task != null && message.hasOwnProperty("task")) - if (!$util.isString(message.task)) - return "task: string expected"; - if (message.userFacts != null && message.hasOwnProperty("userFacts")) { - if (!Array.isArray(message.userFacts)) - return "userFacts: array expected"; - for (var i = 0; i < message.userFacts.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.verify(message.userFacts[i]); - if (error) - return "userFacts." + error; - } - } - if (message.expectationOutcomes != null && message.hasOwnProperty("expectationOutcomes")) { - if (!Array.isArray(message.expectationOutcomes)) - return "expectationOutcomes: array expected"; - for (var i = 0; i < message.expectationOutcomes.length; ++i) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.verify(message.expectationOutcomes[i]); - if (error) - return "expectationOutcomes." + error; - } - } - if (message.rubricOutcomes != null && message.hasOwnProperty("rubricOutcomes")) { - if (!Array.isArray(message.rubricOutcomes)) - return "rubricOutcomes: array expected"; - for (var i = 0; i < message.rubricOutcomes.length; ++i) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.verify(message.rubricOutcomes[i]); - if (error) - return "rubricOutcomes." + error; - } - } - if (message.hallucinationResult != null && message.hasOwnProperty("hallucinationResult")) { - if (!Array.isArray(message.hallucinationResult)) - return "hallucinationResult: array expected"; - for (var i = 0; i < message.hallucinationResult.length; ++i) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.verify(message.hallucinationResult[i]); - if (error) - return "hallucinationResult." + error; - } - } - if (message.taskCompletionResult != null && message.hasOwnProperty("taskCompletionResult")) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.verify(message.taskCompletionResult); - if (error) - return "taskCompletionResult." + error; - } - if (message.toolCallLatencies != null && message.hasOwnProperty("toolCallLatencies")) { - if (!Array.isArray(message.toolCallLatencies)) - return "toolCallLatencies: array expected"; - for (var i = 0; i < message.toolCallLatencies.length; ++i) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.verify(message.toolCallLatencies[i]); - if (error) - return "toolCallLatencies." + error; - } - } - if (message.userGoalSatisfactionResult != null && message.hasOwnProperty("userGoalSatisfactionResult")) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.verify(message.userGoalSatisfactionResult); - if (error) - return "userGoalSatisfactionResult." + error; - } - if (message.allExpectationsSatisfied != null && message.hasOwnProperty("allExpectationsSatisfied")) { - properties._allExpectationsSatisfied = 1; - if (typeof message.allExpectationsSatisfied !== "boolean") - return "allExpectationsSatisfied: boolean expected"; - } - if (message.taskCompleted != null && message.hasOwnProperty("taskCompleted")) { - properties._taskCompleted = 1; - if (typeof message.taskCompleted !== "boolean") - return "taskCompleted: boolean expected"; - } - if (message.spanLatencies != null && message.hasOwnProperty("spanLatencies")) { - if (!Array.isArray(message.spanLatencies)) - return "spanLatencies: array expected"; - for (var i = 0; i < message.spanLatencies.length; ++i) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.verify(message.spanLatencies[i]); - if (error) - return "spanLatencies." + error; - } - } - if (message.evaluationExpectationResults != null && message.hasOwnProperty("evaluationExpectationResults")) { - if (!Array.isArray(message.evaluationExpectationResults)) - return "evaluationExpectationResults: array expected"; - for (var i = 0; i < message.evaluationExpectationResults.length; ++i) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.verify(message.evaluationExpectationResults[i]); - if (error) - return "evaluationExpectationResults." + error; - } - } - return null; - }; - - /** - * Creates a ScenarioResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioResult} ScenarioResult - */ - ScenarioResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult(); - if (object.conversation != null) - message.conversation = String(object.conversation); - if (object.task != null) - message.task = String(object.task); - if (object.userFacts) { - if (!Array.isArray(object.userFacts)) - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.userFacts: array expected"); - message.userFacts = []; - for (var i = 0; i < object.userFacts.length; ++i) { - if (typeof object.userFacts[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.userFacts: object expected"); - message.userFacts[i] = $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.fromObject(object.userFacts[i]); - } - } - if (object.expectationOutcomes) { - if (!Array.isArray(object.expectationOutcomes)) - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.expectationOutcomes: array expected"); - message.expectationOutcomes = []; - for (var i = 0; i < object.expectationOutcomes.length; ++i) { - if (typeof object.expectationOutcomes[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.expectationOutcomes: object expected"); - message.expectationOutcomes[i] = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.fromObject(object.expectationOutcomes[i]); - } - } - if (object.rubricOutcomes) { - if (!Array.isArray(object.rubricOutcomes)) - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.rubricOutcomes: array expected"); - message.rubricOutcomes = []; - for (var i = 0; i < object.rubricOutcomes.length; ++i) { - if (typeof object.rubricOutcomes[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.rubricOutcomes: object expected"); - message.rubricOutcomes[i] = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.fromObject(object.rubricOutcomes[i]); - } - } - if (object.hallucinationResult) { - if (!Array.isArray(object.hallucinationResult)) - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.hallucinationResult: array expected"); - message.hallucinationResult = []; - for (var i = 0; i < object.hallucinationResult.length; ++i) { - if (typeof object.hallucinationResult[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.hallucinationResult: object expected"); - message.hallucinationResult[i] = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.fromObject(object.hallucinationResult[i]); - } - } - if (object.taskCompletionResult != null) { - if (typeof object.taskCompletionResult !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.taskCompletionResult: object expected"); - message.taskCompletionResult = $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.fromObject(object.taskCompletionResult); - } - if (object.toolCallLatencies) { - if (!Array.isArray(object.toolCallLatencies)) - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.toolCallLatencies: array expected"); - message.toolCallLatencies = []; - for (var i = 0; i < object.toolCallLatencies.length; ++i) { - if (typeof object.toolCallLatencies[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.toolCallLatencies: object expected"); - message.toolCallLatencies[i] = $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.fromObject(object.toolCallLatencies[i]); - } - } - if (object.userGoalSatisfactionResult != null) { - if (typeof object.userGoalSatisfactionResult !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.userGoalSatisfactionResult: object expected"); - message.userGoalSatisfactionResult = $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.fromObject(object.userGoalSatisfactionResult); - } - if (object.allExpectationsSatisfied != null) - message.allExpectationsSatisfied = Boolean(object.allExpectationsSatisfied); - if (object.taskCompleted != null) - message.taskCompleted = Boolean(object.taskCompleted); - if (object.spanLatencies) { - if (!Array.isArray(object.spanLatencies)) - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.spanLatencies: array expected"); - message.spanLatencies = []; - for (var i = 0; i < object.spanLatencies.length; ++i) { - if (typeof object.spanLatencies[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.spanLatencies: object expected"); - message.spanLatencies[i] = $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.fromObject(object.spanLatencies[i]); - } - } - if (object.evaluationExpectationResults) { - if (!Array.isArray(object.evaluationExpectationResults)) - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.evaluationExpectationResults: array expected"); - message.evaluationExpectationResults = []; - for (var i = 0; i < object.evaluationExpectationResults.length; ++i) { - if (typeof object.evaluationExpectationResults[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.evaluationExpectationResults: object expected"); - message.evaluationExpectationResults[i] = $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.fromObject(object.evaluationExpectationResults[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ScenarioResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioResult} message ScenarioResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ScenarioResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.expectationOutcomes = []; - object.rubricOutcomes = []; - object.hallucinationResult = []; - object.toolCallLatencies = []; - object.userFacts = []; - object.spanLatencies = []; - object.evaluationExpectationResults = []; - } - if (options.defaults) { - object.conversation = ""; - object.taskCompletionResult = null; - object.userGoalSatisfactionResult = null; - object.task = ""; - } - if (message.conversation != null && message.hasOwnProperty("conversation")) - object.conversation = message.conversation; - if (message.expectationOutcomes && message.expectationOutcomes.length) { - object.expectationOutcomes = []; - for (var j = 0; j < message.expectationOutcomes.length; ++j) - object.expectationOutcomes[j] = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.toObject(message.expectationOutcomes[j], options); - } - if (message.rubricOutcomes && message.rubricOutcomes.length) { - object.rubricOutcomes = []; - for (var j = 0; j < message.rubricOutcomes.length; ++j) - object.rubricOutcomes[j] = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.toObject(message.rubricOutcomes[j], options); - } - if (message.hallucinationResult && message.hallucinationResult.length) { - object.hallucinationResult = []; - for (var j = 0; j < message.hallucinationResult.length; ++j) - object.hallucinationResult[j] = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.toObject(message.hallucinationResult[j], options); - } - if (message.taskCompletionResult != null && message.hasOwnProperty("taskCompletionResult")) - object.taskCompletionResult = $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.toObject(message.taskCompletionResult, options); - if (message.toolCallLatencies && message.toolCallLatencies.length) { - object.toolCallLatencies = []; - for (var j = 0; j < message.toolCallLatencies.length; ++j) - object.toolCallLatencies[j] = $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.toObject(message.toolCallLatencies[j], options); - } - if (message.userGoalSatisfactionResult != null && message.hasOwnProperty("userGoalSatisfactionResult")) - object.userGoalSatisfactionResult = $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.toObject(message.userGoalSatisfactionResult, options); - if (message.allExpectationsSatisfied != null && message.hasOwnProperty("allExpectationsSatisfied")) { - object.allExpectationsSatisfied = message.allExpectationsSatisfied; - if (options.oneofs) - object._allExpectationsSatisfied = "allExpectationsSatisfied"; - } - if (message.taskCompleted != null && message.hasOwnProperty("taskCompleted")) { - object.taskCompleted = message.taskCompleted; - if (options.oneofs) - object._taskCompleted = "taskCompleted"; - } - if (message.task != null && message.hasOwnProperty("task")) - object.task = message.task; - if (message.userFacts && message.userFacts.length) { - object.userFacts = []; - for (var j = 0; j < message.userFacts.length; ++j) - object.userFacts[j] = $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.toObject(message.userFacts[j], options); - } - if (message.spanLatencies && message.spanLatencies.length) { - object.spanLatencies = []; - for (var j = 0; j < message.spanLatencies.length; ++j) - object.spanLatencies[j] = $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.toObject(message.spanLatencies[j], options); - } - if (message.evaluationExpectationResults && message.evaluationExpectationResults.length) { - object.evaluationExpectationResults = []; - for (var j = 0; j < message.evaluationExpectationResults.length; ++j) - object.evaluationExpectationResults[j] = $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.toObject(message.evaluationExpectationResults[j], options); - } - return object; - }; - - /** - * Converts this ScenarioResult to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @instance - * @returns {Object.} JSON object - */ - ScenarioResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ScenarioResult - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ScenarioResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.ScenarioResult"; - }; - - return ScenarioResult; - })(); - - EvaluationResult.SpanLatency = (function() { - - /** - * Properties of a SpanLatency. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @interface ISpanLatency - * @property {string|null} [resource] SpanLatency resource - * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolset] SpanLatency toolset - * @property {string|null} [model] SpanLatency model - * @property {string|null} [callback] SpanLatency callback - * @property {google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type|null} [type] SpanLatency type - * @property {string|null} [displayName] SpanLatency displayName - * @property {google.protobuf.ITimestamp|null} [startTime] SpanLatency startTime - * @property {google.protobuf.ITimestamp|null} [endTime] SpanLatency endTime - * @property {google.protobuf.IDuration|null} [executionLatency] SpanLatency executionLatency - */ - - /** - * Constructs a new SpanLatency. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @classdesc Represents a SpanLatency. - * @implements ISpanLatency - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationResult.ISpanLatency=} [properties] Properties to set - */ - function SpanLatency(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SpanLatency resource. - * @member {string|null|undefined} resource - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @instance - */ - SpanLatency.prototype.resource = null; - - /** - * SpanLatency toolset. - * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolset - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @instance - */ - SpanLatency.prototype.toolset = null; - - /** - * SpanLatency model. - * @member {string|null|undefined} model - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @instance - */ - SpanLatency.prototype.model = null; - - /** - * SpanLatency callback. - * @member {string|null|undefined} callback - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @instance - */ - SpanLatency.prototype.callback = null; - - /** - * SpanLatency type. - * @member {google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type} type - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @instance - */ - SpanLatency.prototype.type = 0; - - /** - * SpanLatency displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @instance - */ - SpanLatency.prototype.displayName = ""; - - /** - * SpanLatency startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @instance - */ - SpanLatency.prototype.startTime = null; - - /** - * SpanLatency endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @instance - */ - SpanLatency.prototype.endTime = null; - - /** - * SpanLatency executionLatency. - * @member {google.protobuf.IDuration|null|undefined} executionLatency - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @instance - */ - SpanLatency.prototype.executionLatency = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SpanLatency identifier. - * @member {"resource"|"toolset"|"model"|"callback"|undefined} identifier - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @instance - */ - Object.defineProperty(SpanLatency.prototype, "identifier", { - get: $util.oneOfGetter($oneOfFields = ["resource", "toolset", "model", "callback"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SpanLatency instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.ISpanLatency=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationResult.SpanLatency} SpanLatency instance - */ - SpanLatency.create = function create(properties) { - return new SpanLatency(properties); - }; - - /** - * Encodes the specified SpanLatency message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SpanLatency.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.ISpanLatency} message SpanLatency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpanLatency.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resource); - if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) - $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.model); - if (message.callback != null && Object.hasOwnProperty.call(message, "callback")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.callback); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.executionLatency != null && Object.hasOwnProperty.call(message, "executionLatency")) - $root.google.protobuf.Duration.encode(message.executionLatency, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified SpanLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SpanLatency.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.ISpanLatency} message SpanLatency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpanLatency.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SpanLatency message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationResult.SpanLatency} SpanLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpanLatency.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.resource = reader.string(); - break; - } - case 3: { - message.toolset = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); - break; - } - case 4: { - message.model = reader.string(); - break; - } - case 5: { - message.callback = reader.string(); - break; - } - case 1: { - message.type = reader.int32(); - break; - } - case 9: { - message.displayName = reader.string(); - break; - } - case 6: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.executionLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SpanLatency message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationResult.SpanLatency} SpanLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpanLatency.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SpanLatency message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SpanLatency.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.resource != null && message.hasOwnProperty("resource")) { - properties.identifier = 1; - if (!$util.isString(message.resource)) - return "resource: string expected"; - } - if (message.toolset != null && message.hasOwnProperty("toolset")) { - if (properties.identifier === 1) - return "identifier: multiple values"; - properties.identifier = 1; - { - var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolset); - if (error) - return "toolset." + error; - } - } - if (message.model != null && message.hasOwnProperty("model")) { - if (properties.identifier === 1) - return "identifier: multiple values"; - properties.identifier = 1; - if (!$util.isString(message.model)) - return "model: string expected"; - } - if (message.callback != null && message.hasOwnProperty("callback")) { - if (properties.identifier === 1) - return "identifier: multiple values"; - properties.identifier = 1; - if (!$util.isString(message.callback)) - return "callback: 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: - case 4: - break; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string 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.executionLatency != null && message.hasOwnProperty("executionLatency")) { - var error = $root.google.protobuf.Duration.verify(message.executionLatency); - if (error) - return "executionLatency." + error; - } - return null; - }; - - /** - * Creates a SpanLatency message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationResult.SpanLatency} SpanLatency - */ - SpanLatency.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.toolset != null) { - if (typeof object.toolset !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.SpanLatency.toolset: object expected"); - message.toolset = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolset); - } - if (object.model != null) - message.model = String(object.model); - if (object.callback != null) - message.callback = String(object.callback); - 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 "TOOL": - case 1: - message.type = 1; - break; - case "USER_CALLBACK": - case 2: - message.type = 2; - break; - case "GUARDRAIL": - case 3: - message.type = 3; - break; - case "LLM": - case 4: - message.type = 4; - break; - } - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.SpanLatency.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.ces.v1beta.EvaluationResult.SpanLatency.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.executionLatency != null) { - if (typeof object.executionLatency !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.SpanLatency.executionLatency: object expected"); - message.executionLatency = $root.google.protobuf.Duration.fromObject(object.executionLatency); - } - return message; - }; - - /** - * Creates a plain object from a SpanLatency message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.SpanLatency} message SpanLatency - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SpanLatency.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.startTime = null; - object.endTime = null; - object.executionLatency = null; - object.displayName = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type[message.type] === undefined ? message.type : $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type[message.type] : message.type; - if (message.resource != null && message.hasOwnProperty("resource")) { - object.resource = message.resource; - if (options.oneofs) - object.identifier = "resource"; - } - if (message.toolset != null && message.hasOwnProperty("toolset")) { - object.toolset = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolset, options); - if (options.oneofs) - object.identifier = "toolset"; - } - if (message.model != null && message.hasOwnProperty("model")) { - object.model = message.model; - if (options.oneofs) - object.identifier = "model"; - } - if (message.callback != null && message.hasOwnProperty("callback")) { - object.callback = message.callback; - if (options.oneofs) - object.identifier = "callback"; - } - 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.executionLatency != null && message.hasOwnProperty("executionLatency")) - object.executionLatency = $root.google.protobuf.Duration.toObject(message.executionLatency, options); - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this SpanLatency to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @instance - * @returns {Object.} JSON object - */ - SpanLatency.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SpanLatency - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SpanLatency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.SpanLatency"; - }; - - /** - * Type enum. - * @name google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} TOOL=1 TOOL value - * @property {number} USER_CALLBACK=2 USER_CALLBACK value - * @property {number} GUARDRAIL=3 GUARDRAIL value - * @property {number} LLM=4 LLM value - */ - SpanLatency.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "TOOL"] = 1; - values[valuesById[2] = "USER_CALLBACK"] = 2; - values[valuesById[3] = "GUARDRAIL"] = 3; - values[valuesById[4] = "LLM"] = 4; - return values; - })(); - - return SpanLatency; - })(); - - EvaluationResult.ToolCallLatency = (function() { - - /** - * Properties of a ToolCallLatency. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @interface IToolCallLatency - * @property {string|null} [tool] ToolCallLatency tool - * @property {string|null} [displayName] ToolCallLatency displayName - * @property {google.protobuf.ITimestamp|null} [startTime] ToolCallLatency startTime - * @property {google.protobuf.ITimestamp|null} [endTime] ToolCallLatency endTime - * @property {google.protobuf.IDuration|null} [executionLatency] ToolCallLatency executionLatency - */ - - /** - * Constructs a new ToolCallLatency. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @classdesc Represents a ToolCallLatency. - * @implements IToolCallLatency - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency=} [properties] Properties to set - */ - function ToolCallLatency(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolCallLatency tool. - * @member {string} tool - * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency - * @instance - */ - ToolCallLatency.prototype.tool = ""; - - /** - * ToolCallLatency displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency - * @instance - */ - ToolCallLatency.prototype.displayName = ""; - - /** - * ToolCallLatency startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency - * @instance - */ - ToolCallLatency.prototype.startTime = null; - - /** - * ToolCallLatency endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency - * @instance - */ - ToolCallLatency.prototype.endTime = null; - - /** - * ToolCallLatency executionLatency. - * @member {google.protobuf.IDuration|null|undefined} executionLatency - * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency - * @instance - */ - ToolCallLatency.prototype.executionLatency = null; - - /** - * Creates a new ToolCallLatency instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency} ToolCallLatency instance - */ - ToolCallLatency.create = function create(properties) { - return new ToolCallLatency(properties); - }; - - /** - * Encodes the specified ToolCallLatency message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency} message ToolCallLatency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolCallLatency.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.executionLatency != null && Object.hasOwnProperty.call(message, "executionLatency")) - $root.google.protobuf.Duration.encode(message.executionLatency, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ToolCallLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency} message ToolCallLatency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolCallLatency.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolCallLatency message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency} ToolCallLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolCallLatency.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tool = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.executionLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolCallLatency message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency} ToolCallLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolCallLatency.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolCallLatency message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolCallLatency.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tool != null && message.hasOwnProperty("tool")) - if (!$util.isString(message.tool)) - return "tool: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string 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.executionLatency != null && message.hasOwnProperty("executionLatency")) { - var error = $root.google.protobuf.Duration.verify(message.executionLatency); - if (error) - return "executionLatency." + error; - } - return null; - }; - - /** - * Creates a ToolCallLatency message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency} ToolCallLatency - */ - ToolCallLatency.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency(); - if (object.tool != null) - message.tool = String(object.tool); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.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.ces.v1beta.EvaluationResult.ToolCallLatency.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.executionLatency != null) { - if (typeof object.executionLatency !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.executionLatency: object expected"); - message.executionLatency = $root.google.protobuf.Duration.fromObject(object.executionLatency); - } - return message; - }; - - /** - * Creates a plain object from a ToolCallLatency message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency} message ToolCallLatency - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolCallLatency.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.tool = ""; - object.displayName = ""; - object.startTime = null; - object.endTime = null; - object.executionLatency = null; - } - if (message.tool != null && message.hasOwnProperty("tool")) - object.tool = message.tool; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - 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.executionLatency != null && message.hasOwnProperty("executionLatency")) - object.executionLatency = $root.google.protobuf.Duration.toObject(message.executionLatency, options); - return object; - }; - - /** - * Converts this ToolCallLatency to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency - * @instance - * @returns {Object.} JSON object - */ - ToolCallLatency.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolCallLatency - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolCallLatency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency"; - }; - - return ToolCallLatency; - })(); - - EvaluationResult.HallucinationResult = (function() { - - /** - * Properties of a HallucinationResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @interface IHallucinationResult - * @property {number|null} [score] HallucinationResult score - * @property {string|null} [label] HallucinationResult label - * @property {string|null} [explanation] HallucinationResult explanation - */ - - /** - * Constructs a new HallucinationResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @classdesc Represents a HallucinationResult. - * @implements IHallucinationResult - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult=} [properties] Properties to set - */ - function HallucinationResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HallucinationResult score. - * @member {number|null|undefined} score - * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult - * @instance - */ - HallucinationResult.prototype.score = null; - - /** - * HallucinationResult label. - * @member {string} label - * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult - * @instance - */ - HallucinationResult.prototype.label = ""; - - /** - * HallucinationResult explanation. - * @member {string} explanation - * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult - * @instance - */ - HallucinationResult.prototype.explanation = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(HallucinationResult.prototype, "_score", { - get: $util.oneOfGetter($oneOfFields = ["score"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HallucinationResult instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationResult.HallucinationResult} HallucinationResult instance - */ - HallucinationResult.create = function create(properties) { - return new HallucinationResult(properties); - }; - - /** - * Encodes the specified HallucinationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult} message HallucinationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HallucinationResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.score); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); - if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.explanation); - return writer; - }; - - /** - * Encodes the specified HallucinationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult} message HallucinationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HallucinationResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HallucinationResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationResult.HallucinationResult} HallucinationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HallucinationResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.score = reader.int32(); - break; - } - case 2: { - message.label = reader.string(); - break; - } - case 3: { - message.explanation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HallucinationResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationResult.HallucinationResult} HallucinationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HallucinationResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HallucinationResult message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HallucinationResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.score != null && message.hasOwnProperty("score")) { - properties._score = 1; - if (!$util.isInteger(message.score)) - return "score: integer expected"; - } - if (message.label != null && message.hasOwnProperty("label")) - if (!$util.isString(message.label)) - return "label: string expected"; - if (message.explanation != null && message.hasOwnProperty("explanation")) - if (!$util.isString(message.explanation)) - return "explanation: string expected"; - return null; - }; - - /** - * Creates a HallucinationResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationResult.HallucinationResult} HallucinationResult - */ - HallucinationResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult(); - if (object.score != null) - message.score = object.score | 0; - if (object.label != null) - message.label = String(object.label); - if (object.explanation != null) - message.explanation = String(object.explanation); - return message; - }; - - /** - * Creates a plain object from a HallucinationResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.HallucinationResult} message HallucinationResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HallucinationResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.label = ""; - object.explanation = ""; - } - if (message.score != null && message.hasOwnProperty("score")) { - object.score = message.score; - if (options.oneofs) - object._score = "score"; - } - if (message.label != null && message.hasOwnProperty("label")) - object.label = message.label; - if (message.explanation != null && message.hasOwnProperty("explanation")) - object.explanation = message.explanation; - return object; - }; - - /** - * Converts this HallucinationResult to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult - * @instance - * @returns {Object.} JSON object - */ - HallucinationResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HallucinationResult - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HallucinationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.HallucinationResult"; - }; - - return HallucinationResult; - })(); - - EvaluationResult.UserGoalSatisfactionResult = (function() { - - /** - * Properties of a UserGoalSatisfactionResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @interface IUserGoalSatisfactionResult - * @property {number|null} [score] UserGoalSatisfactionResult score - * @property {string|null} [label] UserGoalSatisfactionResult label - * @property {string|null} [explanation] UserGoalSatisfactionResult explanation - */ - - /** - * Constructs a new UserGoalSatisfactionResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @classdesc Represents a UserGoalSatisfactionResult. - * @implements IUserGoalSatisfactionResult - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult=} [properties] Properties to set - */ - function UserGoalSatisfactionResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UserGoalSatisfactionResult score. - * @member {number|null|undefined} score - * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult - * @instance - */ - UserGoalSatisfactionResult.prototype.score = null; - - /** - * UserGoalSatisfactionResult label. - * @member {string} label - * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult - * @instance - */ - UserGoalSatisfactionResult.prototype.label = ""; - - /** - * UserGoalSatisfactionResult explanation. - * @member {string} explanation - * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult - * @instance - */ - UserGoalSatisfactionResult.prototype.explanation = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(UserGoalSatisfactionResult.prototype, "_score", { - get: $util.oneOfGetter($oneOfFields = ["score"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new UserGoalSatisfactionResult instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult} UserGoalSatisfactionResult instance - */ - UserGoalSatisfactionResult.create = function create(properties) { - return new UserGoalSatisfactionResult(properties); - }; - - /** - * Encodes the specified UserGoalSatisfactionResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult} message UserGoalSatisfactionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UserGoalSatisfactionResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.score); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); - if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.explanation); - return writer; - }; - - /** - * Encodes the specified UserGoalSatisfactionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult} message UserGoalSatisfactionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UserGoalSatisfactionResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UserGoalSatisfactionResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult} UserGoalSatisfactionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UserGoalSatisfactionResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.score = reader.int32(); - break; - } - case 2: { - message.label = reader.string(); - break; - } - case 3: { - message.explanation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UserGoalSatisfactionResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult} UserGoalSatisfactionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UserGoalSatisfactionResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UserGoalSatisfactionResult message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UserGoalSatisfactionResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.score != null && message.hasOwnProperty("score")) { - properties._score = 1; - if (!$util.isInteger(message.score)) - return "score: integer expected"; - } - if (message.label != null && message.hasOwnProperty("label")) - if (!$util.isString(message.label)) - return "label: string expected"; - if (message.explanation != null && message.hasOwnProperty("explanation")) - if (!$util.isString(message.explanation)) - return "explanation: string expected"; - return null; - }; - - /** - * Creates a UserGoalSatisfactionResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult} UserGoalSatisfactionResult - */ - UserGoalSatisfactionResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult(); - if (object.score != null) - message.score = object.score | 0; - if (object.label != null) - message.label = String(object.label); - if (object.explanation != null) - message.explanation = String(object.explanation); - return message; - }; - - /** - * Creates a plain object from a UserGoalSatisfactionResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult} message UserGoalSatisfactionResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UserGoalSatisfactionResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.label = ""; - object.explanation = ""; - } - if (message.score != null && message.hasOwnProperty("score")) { - object.score = message.score; - if (options.oneofs) - object._score = "score"; - } - if (message.label != null && message.hasOwnProperty("label")) - object.label = message.label; - if (message.explanation != null && message.hasOwnProperty("explanation")) - object.explanation = message.explanation; - return object; - }; - - /** - * Converts this UserGoalSatisfactionResult to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult - * @instance - * @returns {Object.} JSON object - */ - UserGoalSatisfactionResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UserGoalSatisfactionResult - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UserGoalSatisfactionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult"; - }; - - return UserGoalSatisfactionResult; - })(); - - EvaluationResult.SemanticSimilarityResult = (function() { - - /** - * Properties of a SemanticSimilarityResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @interface ISemanticSimilarityResult - * @property {number|null} [score] SemanticSimilarityResult score - * @property {string|null} [label] SemanticSimilarityResult label - * @property {string|null} [explanation] SemanticSimilarityResult explanation - * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [outcome] SemanticSimilarityResult outcome - */ - - /** - * Constructs a new SemanticSimilarityResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @classdesc Represents a SemanticSimilarityResult. - * @implements ISemanticSimilarityResult - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult=} [properties] Properties to set - */ - function SemanticSimilarityResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SemanticSimilarityResult score. - * @member {number|null|undefined} score - * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult - * @instance - */ - SemanticSimilarityResult.prototype.score = null; - - /** - * SemanticSimilarityResult label. - * @member {string} label - * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult - * @instance - */ - SemanticSimilarityResult.prototype.label = ""; - - /** - * SemanticSimilarityResult explanation. - * @member {string} explanation - * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult - * @instance - */ - SemanticSimilarityResult.prototype.explanation = ""; - - /** - * SemanticSimilarityResult outcome. - * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} outcome - * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult - * @instance - */ - SemanticSimilarityResult.prototype.outcome = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SemanticSimilarityResult.prototype, "_score", { - get: $util.oneOfGetter($oneOfFields = ["score"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SemanticSimilarityResult instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult} SemanticSimilarityResult instance - */ - SemanticSimilarityResult.create = function create(properties) { - return new SemanticSimilarityResult(properties); - }; - - /** - * Encodes the specified SemanticSimilarityResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult} message SemanticSimilarityResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SemanticSimilarityResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.score); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); - if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.explanation); - if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.outcome); - return writer; - }; - - /** - * Encodes the specified SemanticSimilarityResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult} message SemanticSimilarityResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SemanticSimilarityResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SemanticSimilarityResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult} SemanticSimilarityResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SemanticSimilarityResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.score = reader.int32(); - break; - } - case 2: { - message.label = reader.string(); - break; - } - case 3: { - message.explanation = reader.string(); - break; - } - case 4: { - message.outcome = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SemanticSimilarityResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult} SemanticSimilarityResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SemanticSimilarityResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SemanticSimilarityResult message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SemanticSimilarityResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.score != null && message.hasOwnProperty("score")) { - properties._score = 1; - if (!$util.isInteger(message.score)) - return "score: integer expected"; - } - if (message.label != null && message.hasOwnProperty("label")) - if (!$util.isString(message.label)) - return "label: string expected"; - if (message.explanation != null && message.hasOwnProperty("explanation")) - if (!$util.isString(message.explanation)) - return "explanation: string expected"; - if (message.outcome != null && message.hasOwnProperty("outcome")) - switch (message.outcome) { - default: - return "outcome: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a SemanticSimilarityResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult} SemanticSimilarityResult - */ - SemanticSimilarityResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult(); - if (object.score != null) - message.score = object.score | 0; - if (object.label != null) - message.label = String(object.label); - if (object.explanation != null) - message.explanation = String(object.explanation); - switch (object.outcome) { - default: - if (typeof object.outcome === "number") { - message.outcome = object.outcome; - break; - } - break; - case "OUTCOME_UNSPECIFIED": - case 0: - message.outcome = 0; - break; - case "PASS": - case 1: - message.outcome = 1; - break; - case "FAIL": - case 2: - message.outcome = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a SemanticSimilarityResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult} message SemanticSimilarityResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SemanticSimilarityResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.label = ""; - object.explanation = ""; - object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; - } - if (message.score != null && message.hasOwnProperty("score")) { - object.score = message.score; - if (options.oneofs) - object._score = "score"; - } - if (message.label != null && message.hasOwnProperty("label")) - object.label = message.label; - if (message.explanation != null && message.hasOwnProperty("explanation")) - object.explanation = message.explanation; - if (message.outcome != null && message.hasOwnProperty("outcome")) - object.outcome = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] : message.outcome; - return object; - }; - - /** - * Converts this SemanticSimilarityResult to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult - * @instance - * @returns {Object.} JSON object - */ - SemanticSimilarityResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SemanticSimilarityResult - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SemanticSimilarityResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult"; - }; - - return SemanticSimilarityResult; - })(); - - EvaluationResult.OverallToolInvocationResult = (function() { - - /** - * Properties of an OverallToolInvocationResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @interface IOverallToolInvocationResult - * @property {number|null} [toolInvocationScore] OverallToolInvocationResult toolInvocationScore - * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [outcome] OverallToolInvocationResult outcome - */ - - /** - * Constructs a new OverallToolInvocationResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @classdesc Represents an OverallToolInvocationResult. - * @implements IOverallToolInvocationResult - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult=} [properties] Properties to set - */ - function OverallToolInvocationResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OverallToolInvocationResult toolInvocationScore. - * @member {number|null|undefined} toolInvocationScore - * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult - * @instance - */ - OverallToolInvocationResult.prototype.toolInvocationScore = null; - - /** - * OverallToolInvocationResult outcome. - * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} outcome - * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult - * @instance - */ - OverallToolInvocationResult.prototype.outcome = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(OverallToolInvocationResult.prototype, "_toolInvocationScore", { - get: $util.oneOfGetter($oneOfFields = ["toolInvocationScore"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new OverallToolInvocationResult instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult} OverallToolInvocationResult instance - */ - OverallToolInvocationResult.create = function create(properties) { - return new OverallToolInvocationResult(properties); - }; - - /** - * Encodes the specified OverallToolInvocationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult} message OverallToolInvocationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OverallToolInvocationResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolInvocationScore != null && Object.hasOwnProperty.call(message, "toolInvocationScore")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.toolInvocationScore); - if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.outcome); - return writer; - }; - - /** - * Encodes the specified OverallToolInvocationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult} message OverallToolInvocationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OverallToolInvocationResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OverallToolInvocationResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult} OverallToolInvocationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OverallToolInvocationResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.toolInvocationScore = reader.float(); - break; - } - case 2: { - message.outcome = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OverallToolInvocationResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult} OverallToolInvocationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OverallToolInvocationResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OverallToolInvocationResult message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OverallToolInvocationResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.toolInvocationScore != null && message.hasOwnProperty("toolInvocationScore")) { - properties._toolInvocationScore = 1; - if (typeof message.toolInvocationScore !== "number") - return "toolInvocationScore: number expected"; - } - if (message.outcome != null && message.hasOwnProperty("outcome")) - switch (message.outcome) { - default: - return "outcome: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an OverallToolInvocationResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult} OverallToolInvocationResult - */ - OverallToolInvocationResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult(); - if (object.toolInvocationScore != null) - message.toolInvocationScore = Number(object.toolInvocationScore); - switch (object.outcome) { - default: - if (typeof object.outcome === "number") { - message.outcome = object.outcome; - break; - } - break; - case "OUTCOME_UNSPECIFIED": - case 0: - message.outcome = 0; - break; - case "PASS": - case 1: - message.outcome = 1; - break; - case "FAIL": - case 2: - message.outcome = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an OverallToolInvocationResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult} message OverallToolInvocationResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OverallToolInvocationResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; - if (message.toolInvocationScore != null && message.hasOwnProperty("toolInvocationScore")) { - object.toolInvocationScore = options.json && !isFinite(message.toolInvocationScore) ? String(message.toolInvocationScore) : message.toolInvocationScore; - if (options.oneofs) - object._toolInvocationScore = "toolInvocationScore"; - } - if (message.outcome != null && message.hasOwnProperty("outcome")) - object.outcome = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] : message.outcome; - return object; - }; - - /** - * Converts this OverallToolInvocationResult to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult - * @instance - * @returns {Object.} JSON object - */ - OverallToolInvocationResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OverallToolInvocationResult - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OverallToolInvocationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult"; - }; - - return OverallToolInvocationResult; - })(); - - EvaluationResult.TaskCompletionResult = (function() { - - /** - * Properties of a TaskCompletionResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @interface ITaskCompletionResult - * @property {number|null} [score] TaskCompletionResult score - * @property {string|null} [label] TaskCompletionResult label - * @property {string|null} [explanation] TaskCompletionResult explanation - */ - - /** - * Constructs a new TaskCompletionResult. - * @memberof google.cloud.ces.v1beta.EvaluationResult - * @classdesc Represents a TaskCompletionResult. - * @implements ITaskCompletionResult - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult=} [properties] Properties to set - */ - function TaskCompletionResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskCompletionResult score. - * @member {number|null|undefined} score - * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult - * @instance - */ - TaskCompletionResult.prototype.score = null; - - /** - * TaskCompletionResult label. - * @member {string} label - * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult - * @instance - */ - TaskCompletionResult.prototype.label = ""; - - /** - * TaskCompletionResult explanation. - * @member {string} explanation - * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult - * @instance - */ - TaskCompletionResult.prototype.explanation = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(TaskCompletionResult.prototype, "_score", { - get: $util.oneOfGetter($oneOfFields = ["score"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TaskCompletionResult instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult} TaskCompletionResult instance - */ - TaskCompletionResult.create = function create(properties) { - return new TaskCompletionResult(properties); - }; - - /** - * Encodes the specified TaskCompletionResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult} message TaskCompletionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskCompletionResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.score); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); - if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.explanation); - return writer; - }; - - /** - * Encodes the specified TaskCompletionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult} message TaskCompletionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskCompletionResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskCompletionResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult} TaskCompletionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskCompletionResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.score = reader.int32(); - break; - } - case 2: { - message.label = reader.string(); - break; - } - case 3: { - message.explanation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskCompletionResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult} TaskCompletionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskCompletionResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskCompletionResult message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskCompletionResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.score != null && message.hasOwnProperty("score")) { - properties._score = 1; - if (!$util.isInteger(message.score)) - return "score: integer expected"; - } - if (message.label != null && message.hasOwnProperty("label")) - if (!$util.isString(message.label)) - return "label: string expected"; - if (message.explanation != null && message.hasOwnProperty("explanation")) - if (!$util.isString(message.explanation)) - return "explanation: string expected"; - return null; - }; - - /** - * Creates a TaskCompletionResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult} TaskCompletionResult - */ - TaskCompletionResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult(); - if (object.score != null) - message.score = object.score | 0; - if (object.label != null) - message.label = String(object.label); - if (object.explanation != null) - message.explanation = String(object.explanation); - return message; - }; - - /** - * Creates a plain object from a TaskCompletionResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult - * @static - * @param {google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult} message TaskCompletionResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskCompletionResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.label = ""; - object.explanation = ""; - } - if (message.score != null && message.hasOwnProperty("score")) { - object.score = message.score; - if (options.oneofs) - object._score = "score"; - } - if (message.label != null && message.hasOwnProperty("label")) - object.label = message.label; - if (message.explanation != null && message.hasOwnProperty("explanation")) - object.explanation = message.explanation; - return object; - }; - - /** - * Converts this TaskCompletionResult to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult - * @instance - * @returns {Object.} JSON object - */ - TaskCompletionResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskCompletionResult - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskCompletionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult"; - }; - - return TaskCompletionResult; - })(); - - /** - * Outcome enum. - * @name google.cloud.ces.v1beta.EvaluationResult.Outcome - * @enum {number} - * @property {number} OUTCOME_UNSPECIFIED=0 OUTCOME_UNSPECIFIED value - * @property {number} PASS=1 PASS value - * @property {number} FAIL=2 FAIL value - */ - EvaluationResult.Outcome = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OUTCOME_UNSPECIFIED"] = 0; - values[valuesById[1] = "PASS"] = 1; - values[valuesById[2] = "FAIL"] = 2; - return values; - })(); - - /** - * ExecutionState enum. - * @name google.cloud.ces.v1beta.EvaluationResult.ExecutionState - * @enum {number} - * @property {number} EXECUTION_STATE_UNSPECIFIED=0 EXECUTION_STATE_UNSPECIFIED value - * @property {number} RUNNING=1 RUNNING value - * @property {number} COMPLETED=2 COMPLETED value - * @property {number} ERROR=3 ERROR value - */ - EvaluationResult.ExecutionState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EXECUTION_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RUNNING"] = 1; - values[valuesById[2] = "COMPLETED"] = 2; - values[valuesById[3] = "ERROR"] = 3; - return values; - })(); - - return EvaluationResult; - })(); - - v1beta.EvaluationRun = (function() { - - /** - * Properties of an EvaluationRun. - * @memberof google.cloud.ces.v1beta - * @interface IEvaluationRun - * @property {string|null} [name] EvaluationRun name - * @property {string|null} [displayName] EvaluationRun displayName - * @property {Array.|null} [evaluationResults] EvaluationRun evaluationResults - * @property {google.protobuf.ITimestamp|null} [createTime] EvaluationRun createTime - * @property {string|null} [initiatedBy] EvaluationRun initiatedBy - * @property {string|null} [appVersion] EvaluationRun appVersion - * @property {string|null} [appVersionDisplayName] EvaluationRun appVersionDisplayName - * @property {string|null} [changelog] EvaluationRun changelog - * @property {google.protobuf.ITimestamp|null} [changelogCreateTime] EvaluationRun changelogCreateTime - * @property {Array.|null} [evaluations] EvaluationRun evaluations - * @property {string|null} [evaluationDataset] EvaluationRun evaluationDataset - * @property {google.cloud.ces.v1beta.EvaluationRun.EvaluationType|null} [evaluationType] EvaluationRun evaluationType - * @property {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState|null} [state] EvaluationRun state - * @property {google.cloud.ces.v1beta.EvaluationRun.IProgress|null} [progress] EvaluationRun progress - * @property {google.cloud.ces.v1beta.IEvaluationConfig|null} [config] EvaluationRun config - * @property {google.rpc.IStatus|null} [error] EvaluationRun error - * @property {google.cloud.ces.v1beta.IEvaluationErrorInfo|null} [errorInfo] EvaluationRun errorInfo - * @property {Object.|null} [evaluationRunSummaries] EvaluationRun evaluationRunSummaries - * @property {google.cloud.ces.v1beta.ILatencyReport|null} [latencyReport] EvaluationRun latencyReport - * @property {number|null} [runCount] EvaluationRun runCount - * @property {Array.|null} [personaRunConfigs] EvaluationRun personaRunConfigs - * @property {google.cloud.ces.v1beta.IOptimizationConfig|null} [optimizationConfig] EvaluationRun optimizationConfig - * @property {string|null} [scheduledEvaluationRun] EvaluationRun scheduledEvaluationRun - * @property {google.cloud.ces.v1beta.GoldenRunMethod|null} [goldenRunMethod] EvaluationRun goldenRunMethod - */ - - /** - * Constructs a new EvaluationRun. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an EvaluationRun. - * @implements IEvaluationRun - * @constructor - * @param {google.cloud.ces.v1beta.IEvaluationRun=} [properties] Properties to set - */ - function EvaluationRun(properties) { - this.evaluationResults = []; - this.evaluations = []; - this.evaluationRunSummaries = {}; - this.personaRunConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluationRun name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.name = ""; - - /** - * EvaluationRun displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.displayName = ""; - - /** - * EvaluationRun evaluationResults. - * @member {Array.} evaluationResults - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.evaluationResults = $util.emptyArray; - - /** - * EvaluationRun createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.createTime = null; - - /** - * EvaluationRun initiatedBy. - * @member {string} initiatedBy - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.initiatedBy = ""; - - /** - * EvaluationRun appVersion. - * @member {string} appVersion - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.appVersion = ""; - - /** - * EvaluationRun appVersionDisplayName. - * @member {string} appVersionDisplayName - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.appVersionDisplayName = ""; - - /** - * EvaluationRun changelog. - * @member {string} changelog - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.changelog = ""; - - /** - * EvaluationRun changelogCreateTime. - * @member {google.protobuf.ITimestamp|null|undefined} changelogCreateTime - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.changelogCreateTime = null; - - /** - * EvaluationRun evaluations. - * @member {Array.} evaluations - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.evaluations = $util.emptyArray; - - /** - * EvaluationRun evaluationDataset. - * @member {string} evaluationDataset - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.evaluationDataset = ""; - - /** - * EvaluationRun evaluationType. - * @member {google.cloud.ces.v1beta.EvaluationRun.EvaluationType} evaluationType - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.evaluationType = 0; - - /** - * EvaluationRun state. - * @member {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState} state - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.state = 0; - - /** - * EvaluationRun progress. - * @member {google.cloud.ces.v1beta.EvaluationRun.IProgress|null|undefined} progress - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.progress = null; - - /** - * EvaluationRun config. - * @member {google.cloud.ces.v1beta.IEvaluationConfig|null|undefined} config - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.config = null; - - /** - * EvaluationRun error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.error = null; - - /** - * EvaluationRun errorInfo. - * @member {google.cloud.ces.v1beta.IEvaluationErrorInfo|null|undefined} errorInfo - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.errorInfo = null; - - /** - * EvaluationRun evaluationRunSummaries. - * @member {Object.} evaluationRunSummaries - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.evaluationRunSummaries = $util.emptyObject; - - /** - * EvaluationRun latencyReport. - * @member {google.cloud.ces.v1beta.ILatencyReport|null|undefined} latencyReport - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.latencyReport = null; - - /** - * EvaluationRun runCount. - * @member {number} runCount - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.runCount = 0; - - /** - * EvaluationRun personaRunConfigs. - * @member {Array.} personaRunConfigs - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.personaRunConfigs = $util.emptyArray; - - /** - * EvaluationRun optimizationConfig. - * @member {google.cloud.ces.v1beta.IOptimizationConfig|null|undefined} optimizationConfig - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.optimizationConfig = null; - - /** - * EvaluationRun scheduledEvaluationRun. - * @member {string} scheduledEvaluationRun - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.scheduledEvaluationRun = ""; - - /** - * EvaluationRun goldenRunMethod. - * @member {google.cloud.ces.v1beta.GoldenRunMethod} goldenRunMethod - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - */ - EvaluationRun.prototype.goldenRunMethod = 0; - - /** - * Creates a new EvaluationRun instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @static - * @param {google.cloud.ces.v1beta.IEvaluationRun=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationRun} EvaluationRun instance - */ - EvaluationRun.create = function create(properties) { - return new EvaluationRun(properties); - }; - - /** - * Encodes the specified EvaluationRun message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @static - * @param {google.cloud.ces.v1beta.IEvaluationRun} message EvaluationRun message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationRun.encode = function encode(message, writer) { - if (!writer) - 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.evaluationResults != null && message.evaluationResults.length) - for (var i = 0; i < message.evaluationResults.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.evaluationResults[i]); - 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.initiatedBy != null && Object.hasOwnProperty.call(message, "initiatedBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.initiatedBy); - if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.appVersion); - if (message.evaluations != null && message.evaluations.length) - for (var i = 0; i < message.evaluations.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.evaluations[i]); - if (message.evaluationDataset != null && Object.hasOwnProperty.call(message, "evaluationDataset")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.evaluationDataset); - if (message.evaluationType != null && Object.hasOwnProperty.call(message, "evaluationType")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.evaluationType); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.cloud.ces.v1beta.EvaluationRun.Progress.encode(message.progress, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.cloud.ces.v1beta.EvaluationConfig.encode(message.config, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.appVersionDisplayName != null && Object.hasOwnProperty.call(message, "appVersionDisplayName")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.appVersionDisplayName); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.evaluationRunSummaries != null && Object.hasOwnProperty.call(message, "evaluationRunSummaries")) - for (var keys = Object.keys(message.evaluationRunSummaries), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 15, wireType 2 =*/122).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.encode(message.evaluationRunSummaries[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.runCount != null && Object.hasOwnProperty.call(message, "runCount")) - writer.uint32(/* id 16, wireType 0 =*/128).int32(message.runCount); - if (message.errorInfo != null && Object.hasOwnProperty.call(message, "errorInfo")) - $root.google.cloud.ces.v1beta.EvaluationErrorInfo.encode(message.errorInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.personaRunConfigs != null && message.personaRunConfigs.length) - for (var i = 0; i < message.personaRunConfigs.length; ++i) - $root.google.cloud.ces.v1beta.PersonaRunConfig.encode(message.personaRunConfigs[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.optimizationConfig != null && Object.hasOwnProperty.call(message, "optimizationConfig")) - $root.google.cloud.ces.v1beta.OptimizationConfig.encode(message.optimizationConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.scheduledEvaluationRun != null && Object.hasOwnProperty.call(message, "scheduledEvaluationRun")) - writer.uint32(/* id 20, wireType 2 =*/162).string(message.scheduledEvaluationRun); - if (message.goldenRunMethod != null && Object.hasOwnProperty.call(message, "goldenRunMethod")) - writer.uint32(/* id 21, wireType 0 =*/168).int32(message.goldenRunMethod); - if (message.changelog != null && Object.hasOwnProperty.call(message, "changelog")) - writer.uint32(/* id 22, wireType 2 =*/178).string(message.changelog); - if (message.changelogCreateTime != null && Object.hasOwnProperty.call(message, "changelogCreateTime")) - $root.google.protobuf.Timestamp.encode(message.changelogCreateTime, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.latencyReport != null && Object.hasOwnProperty.call(message, "latencyReport")) - $root.google.cloud.ces.v1beta.LatencyReport.encode(message.latencyReport, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EvaluationRun message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @static - * @param {google.cloud.ces.v1beta.IEvaluationRun} message EvaluationRun message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationRun.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluationRun message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationRun} EvaluationRun - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationRun.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationRun(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - if (!(message.evaluationResults && message.evaluationResults.length)) - message.evaluationResults = []; - message.evaluationResults.push(reader.string()); - break; - } - case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.initiatedBy = reader.string(); - break; - } - case 6: { - message.appVersion = reader.string(); - break; - } - case 13: { - message.appVersionDisplayName = reader.string(); - break; - } - case 22: { - message.changelog = reader.string(); - break; - } - case 23: { - message.changelogCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - if (!(message.evaluations && message.evaluations.length)) - message.evaluations = []; - message.evaluations.push(reader.string()); - break; - } - case 8: { - message.evaluationDataset = reader.string(); - break; - } - case 9: { - message.evaluationType = reader.int32(); - break; - } - case 10: { - message.state = reader.int32(); - break; - } - case 11: { - message.progress = $root.google.cloud.ces.v1beta.EvaluationRun.Progress.decode(reader, reader.uint32()); - break; - } - case 12: { - message.config = $root.google.cloud.ces.v1beta.EvaluationConfig.decode(reader, reader.uint32()); - break; - } - case 14: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 17: { - message.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.decode(reader, reader.uint32()); - break; - } - case 15: { - if (message.evaluationRunSummaries === $util.emptyObject) - message.evaluationRunSummaries = {}; - 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.ces.v1beta.EvaluationRun.EvaluationRunSummary.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.evaluationRunSummaries[key] = value; - break; - } - case 25: { - message.latencyReport = $root.google.cloud.ces.v1beta.LatencyReport.decode(reader, reader.uint32()); - break; - } - case 16: { - message.runCount = reader.int32(); - break; - } - case 18: { - if (!(message.personaRunConfigs && message.personaRunConfigs.length)) - message.personaRunConfigs = []; - message.personaRunConfigs.push($root.google.cloud.ces.v1beta.PersonaRunConfig.decode(reader, reader.uint32())); - break; - } - case 19: { - message.optimizationConfig = $root.google.cloud.ces.v1beta.OptimizationConfig.decode(reader, reader.uint32()); - break; - } - case 20: { - message.scheduledEvaluationRun = reader.string(); - break; - } - case 21: { - message.goldenRunMethod = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluationRun message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationRun} EvaluationRun - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationRun.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluationRun message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluationRun.verify = function verify(message) { - if (typeof message !== "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.evaluationResults != null && message.hasOwnProperty("evaluationResults")) { - if (!Array.isArray(message.evaluationResults)) - return "evaluationResults: array expected"; - for (var i = 0; i < message.evaluationResults.length; ++i) - if (!$util.isString(message.evaluationResults[i])) - return "evaluationResults: 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.initiatedBy != null && message.hasOwnProperty("initiatedBy")) - if (!$util.isString(message.initiatedBy)) - return "initiatedBy: string expected"; - if (message.appVersion != null && message.hasOwnProperty("appVersion")) - if (!$util.isString(message.appVersion)) - return "appVersion: string expected"; - if (message.appVersionDisplayName != null && message.hasOwnProperty("appVersionDisplayName")) - if (!$util.isString(message.appVersionDisplayName)) - return "appVersionDisplayName: string expected"; - if (message.changelog != null && message.hasOwnProperty("changelog")) - if (!$util.isString(message.changelog)) - return "changelog: string expected"; - if (message.changelogCreateTime != null && message.hasOwnProperty("changelogCreateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.changelogCreateTime); - if (error) - return "changelogCreateTime." + error; - } - if (message.evaluations != null && message.hasOwnProperty("evaluations")) { - if (!Array.isArray(message.evaluations)) - return "evaluations: array expected"; - for (var i = 0; i < message.evaluations.length; ++i) - if (!$util.isString(message.evaluations[i])) - return "evaluations: string[] expected"; - } - if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) - if (!$util.isString(message.evaluationDataset)) - return "evaluationDataset: string expected"; - if (message.evaluationType != null && message.hasOwnProperty("evaluationType")) - switch (message.evaluationType) { - default: - return "evaluationType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.progress != null && message.hasOwnProperty("progress")) { - var error = $root.google.cloud.ces.v1beta.EvaluationRun.Progress.verify(message.progress); - if (error) - return "progress." + error; - } - if (message.config != null && message.hasOwnProperty("config")) { - var error = $root.google.cloud.ces.v1beta.EvaluationConfig.verify(message.config); - if (error) - return "config." + error; - } - if (message.error != null && message.hasOwnProperty("error")) { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - if (message.errorInfo != null && message.hasOwnProperty("errorInfo")) { - var error = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.verify(message.errorInfo); - if (error) - return "errorInfo." + error; - } - if (message.evaluationRunSummaries != null && message.hasOwnProperty("evaluationRunSummaries")) { - if (!$util.isObject(message.evaluationRunSummaries)) - return "evaluationRunSummaries: object expected"; - var key = Object.keys(message.evaluationRunSummaries); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.verify(message.evaluationRunSummaries[key[i]]); - if (error) - return "evaluationRunSummaries." + error; - } - } - if (message.latencyReport != null && message.hasOwnProperty("latencyReport")) { - var error = $root.google.cloud.ces.v1beta.LatencyReport.verify(message.latencyReport); - if (error) - return "latencyReport." + error; - } - if (message.runCount != null && message.hasOwnProperty("runCount")) - if (!$util.isInteger(message.runCount)) - return "runCount: integer expected"; - if (message.personaRunConfigs != null && message.hasOwnProperty("personaRunConfigs")) { - if (!Array.isArray(message.personaRunConfigs)) - return "personaRunConfigs: array expected"; - for (var i = 0; i < message.personaRunConfigs.length; ++i) { - var error = $root.google.cloud.ces.v1beta.PersonaRunConfig.verify(message.personaRunConfigs[i]); - if (error) - return "personaRunConfigs." + error; - } - } - if (message.optimizationConfig != null && message.hasOwnProperty("optimizationConfig")) { - var error = $root.google.cloud.ces.v1beta.OptimizationConfig.verify(message.optimizationConfig); - if (error) - return "optimizationConfig." + error; - } - if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) - if (!$util.isString(message.scheduledEvaluationRun)) - return "scheduledEvaluationRun: string expected"; - if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) - switch (message.goldenRunMethod) { - default: - return "goldenRunMethod: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an EvaluationRun message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationRun} EvaluationRun - */ - EvaluationRun.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationRun) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationRun(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.evaluationResults) { - if (!Array.isArray(object.evaluationResults)) - throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.evaluationResults: array expected"); - message.evaluationResults = []; - for (var i = 0; i < object.evaluationResults.length; ++i) - message.evaluationResults[i] = String(object.evaluationResults[i]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.initiatedBy != null) - message.initiatedBy = String(object.initiatedBy); - if (object.appVersion != null) - message.appVersion = String(object.appVersion); - if (object.appVersionDisplayName != null) - message.appVersionDisplayName = String(object.appVersionDisplayName); - if (object.changelog != null) - message.changelog = String(object.changelog); - if (object.changelogCreateTime != null) { - if (typeof object.changelogCreateTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.changelogCreateTime: object expected"); - message.changelogCreateTime = $root.google.protobuf.Timestamp.fromObject(object.changelogCreateTime); - } - if (object.evaluations) { - if (!Array.isArray(object.evaluations)) - throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.evaluations: array expected"); - message.evaluations = []; - for (var i = 0; i < object.evaluations.length; ++i) - message.evaluations[i] = String(object.evaluations[i]); - } - if (object.evaluationDataset != null) - message.evaluationDataset = String(object.evaluationDataset); - switch (object.evaluationType) { - default: - if (typeof object.evaluationType === "number") { - message.evaluationType = object.evaluationType; - break; - } - break; - case "EVALUATION_TYPE_UNSPECIFIED": - case 0: - message.evaluationType = 0; - break; - case "GOLDEN": - case 1: - message.evaluationType = 1; - break; - case "SCENARIO": - case 2: - message.evaluationType = 2; - break; - case "MIXED": - case 3: - message.evaluationType = 3; - break; - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "EVALUATION_RUN_STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "RUNNING": - case 1: - message.state = 1; - break; - case "COMPLETED": - case 2: - message.state = 2; - break; - case "ERROR": - case 3: - message.state = 3; - break; - } - if (object.progress != null) { - if (typeof object.progress !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.progress: object expected"); - message.progress = $root.google.cloud.ces.v1beta.EvaluationRun.Progress.fromObject(object.progress); - } - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.config: object expected"); - message.config = $root.google.cloud.ces.v1beta.EvaluationConfig.fromObject(object.config); - } - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.errorInfo != null) { - if (typeof object.errorInfo !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.errorInfo: object expected"); - message.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.fromObject(object.errorInfo); - } - if (object.evaluationRunSummaries) { - if (typeof object.evaluationRunSummaries !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.evaluationRunSummaries: object expected"); - message.evaluationRunSummaries = {}; - for (var keys = Object.keys(object.evaluationRunSummaries), i = 0; i < keys.length; ++i) { - if (typeof object.evaluationRunSummaries[keys[i]] !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.evaluationRunSummaries: object expected"); - message.evaluationRunSummaries[keys[i]] = $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.fromObject(object.evaluationRunSummaries[keys[i]]); - } - } - if (object.latencyReport != null) { - if (typeof object.latencyReport !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.latencyReport: object expected"); - message.latencyReport = $root.google.cloud.ces.v1beta.LatencyReport.fromObject(object.latencyReport); - } - if (object.runCount != null) - message.runCount = object.runCount | 0; - if (object.personaRunConfigs) { - if (!Array.isArray(object.personaRunConfigs)) - throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.personaRunConfigs: array expected"); - message.personaRunConfigs = []; - for (var i = 0; i < object.personaRunConfigs.length; ++i) { - if (typeof object.personaRunConfigs[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.personaRunConfigs: object expected"); - message.personaRunConfigs[i] = $root.google.cloud.ces.v1beta.PersonaRunConfig.fromObject(object.personaRunConfigs[i]); - } - } - if (object.optimizationConfig != null) { - if (typeof object.optimizationConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.optimizationConfig: object expected"); - message.optimizationConfig = $root.google.cloud.ces.v1beta.OptimizationConfig.fromObject(object.optimizationConfig); - } - if (object.scheduledEvaluationRun != null) - message.scheduledEvaluationRun = String(object.scheduledEvaluationRun); - switch (object.goldenRunMethod) { - default: - if (typeof object.goldenRunMethod === "number") { - message.goldenRunMethod = object.goldenRunMethod; - break; - } - break; - case "GOLDEN_RUN_METHOD_UNSPECIFIED": - case 0: - message.goldenRunMethod = 0; - break; - case "STABLE": - case 1: - message.goldenRunMethod = 1; - break; - case "NAIVE": - case 2: - message.goldenRunMethod = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an EvaluationRun message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @static - * @param {google.cloud.ces.v1beta.EvaluationRun} message EvaluationRun - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluationRun.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.evaluationResults = []; - object.evaluations = []; - object.personaRunConfigs = []; - } - if (options.objects || options.defaults) - object.evaluationRunSummaries = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.createTime = null; - object.initiatedBy = ""; - object.appVersion = ""; - object.evaluationDataset = ""; - object.evaluationType = options.enums === String ? "EVALUATION_TYPE_UNSPECIFIED" : 0; - object.state = options.enums === String ? "EVALUATION_RUN_STATE_UNSPECIFIED" : 0; - object.progress = null; - object.config = null; - object.appVersionDisplayName = ""; - object.error = null; - object.runCount = 0; - object.errorInfo = null; - object.optimizationConfig = null; - object.scheduledEvaluationRun = ""; - object.goldenRunMethod = options.enums === String ? "GOLDEN_RUN_METHOD_UNSPECIFIED" : 0; - object.changelog = ""; - object.changelogCreateTime = null; - object.latencyReport = 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.evaluationResults && message.evaluationResults.length) { - object.evaluationResults = []; - for (var j = 0; j < message.evaluationResults.length; ++j) - object.evaluationResults[j] = message.evaluationResults[j]; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.initiatedBy != null && message.hasOwnProperty("initiatedBy")) - object.initiatedBy = message.initiatedBy; - if (message.appVersion != null && message.hasOwnProperty("appVersion")) - object.appVersion = message.appVersion; - if (message.evaluations && message.evaluations.length) { - object.evaluations = []; - for (var j = 0; j < message.evaluations.length; ++j) - object.evaluations[j] = message.evaluations[j]; - } - if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) - object.evaluationDataset = message.evaluationDataset; - if (message.evaluationType != null && message.hasOwnProperty("evaluationType")) - object.evaluationType = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationType[message.evaluationType] === undefined ? message.evaluationType : $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationType[message.evaluationType] : message.evaluationType; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState[message.state] === undefined ? message.state : $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState[message.state] : message.state; - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.cloud.ces.v1beta.EvaluationRun.Progress.toObject(message.progress, options); - if (message.config != null && message.hasOwnProperty("config")) - object.config = $root.google.cloud.ces.v1beta.EvaluationConfig.toObject(message.config, options); - if (message.appVersionDisplayName != null && message.hasOwnProperty("appVersionDisplayName")) - object.appVersionDisplayName = message.appVersionDisplayName; - if (message.error != null && message.hasOwnProperty("error")) - object.error = $root.google.rpc.Status.toObject(message.error, options); - var keys2; - if (message.evaluationRunSummaries && (keys2 = Object.keys(message.evaluationRunSummaries)).length) { - object.evaluationRunSummaries = {}; - for (var j = 0; j < keys2.length; ++j) - object.evaluationRunSummaries[keys2[j]] = $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.toObject(message.evaluationRunSummaries[keys2[j]], options); - } - if (message.runCount != null && message.hasOwnProperty("runCount")) - object.runCount = message.runCount; - if (message.errorInfo != null && message.hasOwnProperty("errorInfo")) - object.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.toObject(message.errorInfo, options); - if (message.personaRunConfigs && message.personaRunConfigs.length) { - object.personaRunConfigs = []; - for (var j = 0; j < message.personaRunConfigs.length; ++j) - object.personaRunConfigs[j] = $root.google.cloud.ces.v1beta.PersonaRunConfig.toObject(message.personaRunConfigs[j], options); - } - if (message.optimizationConfig != null && message.hasOwnProperty("optimizationConfig")) - object.optimizationConfig = $root.google.cloud.ces.v1beta.OptimizationConfig.toObject(message.optimizationConfig, options); - if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) - object.scheduledEvaluationRun = message.scheduledEvaluationRun; - if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) - object.goldenRunMethod = options.enums === String ? $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] === undefined ? message.goldenRunMethod : $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] : message.goldenRunMethod; - if (message.changelog != null && message.hasOwnProperty("changelog")) - object.changelog = message.changelog; - if (message.changelogCreateTime != null && message.hasOwnProperty("changelogCreateTime")) - object.changelogCreateTime = $root.google.protobuf.Timestamp.toObject(message.changelogCreateTime, options); - if (message.latencyReport != null && message.hasOwnProperty("latencyReport")) - object.latencyReport = $root.google.cloud.ces.v1beta.LatencyReport.toObject(message.latencyReport, options); - return object; - }; - - /** - * Converts this EvaluationRun to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @instance - * @returns {Object.} JSON object - */ - EvaluationRun.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluationRun - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluationRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationRun"; - }; - - EvaluationRun.Progress = (function() { - - /** - * Properties of a Progress. - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @interface IProgress - * @property {number|null} [totalCount] Progress totalCount - * @property {number|null} [failedCount] Progress failedCount - * @property {number|null} [errorCount] Progress errorCount - * @property {number|null} [completedCount] Progress completedCount - * @property {number|null} [passedCount] Progress passedCount - */ - - /** - * Constructs a new Progress. - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @classdesc Represents a Progress. - * @implements IProgress - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationRun.IProgress=} [properties] Properties to set - */ - function Progress(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Progress totalCount. - * @member {number} totalCount - * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress - * @instance - */ - Progress.prototype.totalCount = 0; - - /** - * Progress failedCount. - * @member {number} failedCount - * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress - * @instance - */ - Progress.prototype.failedCount = 0; - - /** - * Progress errorCount. - * @member {number} errorCount - * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress - * @instance - */ - Progress.prototype.errorCount = 0; - - /** - * Progress completedCount. - * @member {number} completedCount - * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress - * @instance - */ - Progress.prototype.completedCount = 0; - - /** - * Progress passedCount. - * @member {number} passedCount - * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress - * @instance - */ - Progress.prototype.passedCount = 0; - - /** - * Creates a new Progress instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress - * @static - * @param {google.cloud.ces.v1beta.EvaluationRun.IProgress=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationRun.Progress} Progress instance - */ - Progress.create = function create(properties) { - return new Progress(properties); - }; - - /** - * Encodes the specified Progress message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.Progress.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress - * @static - * @param {google.cloud.ces.v1beta.EvaluationRun.IProgress} message Progress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Progress.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.totalCount != null && Object.hasOwnProperty.call(message, "totalCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalCount); - if (message.failedCount != null && Object.hasOwnProperty.call(message, "failedCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.failedCount); - if (message.errorCount != null && Object.hasOwnProperty.call(message, "errorCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.errorCount); - if (message.completedCount != null && Object.hasOwnProperty.call(message, "completedCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.completedCount); - if (message.passedCount != null && Object.hasOwnProperty.call(message, "passedCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.passedCount); - return writer; - }; - - /** - * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.Progress.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress - * @static - * @param {google.cloud.ces.v1beta.EvaluationRun.IProgress} message Progress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Progress.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Progress message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationRun.Progress} Progress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Progress.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationRun.Progress(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.totalCount = reader.int32(); - break; - } - case 2: { - message.failedCount = reader.int32(); - break; - } - case 3: { - message.errorCount = reader.int32(); - break; - } - case 4: { - message.completedCount = reader.int32(); - break; - } - case 5: { - message.passedCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Progress message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationRun.Progress} Progress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Progress.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Progress message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Progress.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.totalCount != null && message.hasOwnProperty("totalCount")) - if (!$util.isInteger(message.totalCount)) - return "totalCount: integer expected"; - if (message.failedCount != null && message.hasOwnProperty("failedCount")) - if (!$util.isInteger(message.failedCount)) - return "failedCount: integer expected"; - if (message.errorCount != null && message.hasOwnProperty("errorCount")) - if (!$util.isInteger(message.errorCount)) - return "errorCount: integer expected"; - if (message.completedCount != null && message.hasOwnProperty("completedCount")) - if (!$util.isInteger(message.completedCount)) - return "completedCount: integer expected"; - if (message.passedCount != null && message.hasOwnProperty("passedCount")) - if (!$util.isInteger(message.passedCount)) - return "passedCount: integer expected"; - return null; - }; - - /** - * Creates a Progress message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationRun.Progress} Progress - */ - Progress.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationRun.Progress) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationRun.Progress(); - if (object.totalCount != null) - message.totalCount = object.totalCount | 0; - if (object.failedCount != null) - message.failedCount = object.failedCount | 0; - if (object.errorCount != null) - message.errorCount = object.errorCount | 0; - if (object.completedCount != null) - message.completedCount = object.completedCount | 0; - if (object.passedCount != null) - message.passedCount = object.passedCount | 0; - return message; - }; - - /** - * Creates a plain object from a Progress message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress - * @static - * @param {google.cloud.ces.v1beta.EvaluationRun.Progress} message Progress - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Progress.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.totalCount = 0; - object.failedCount = 0; - object.errorCount = 0; - object.completedCount = 0; - object.passedCount = 0; - } - if (message.totalCount != null && message.hasOwnProperty("totalCount")) - object.totalCount = message.totalCount; - if (message.failedCount != null && message.hasOwnProperty("failedCount")) - object.failedCount = message.failedCount; - if (message.errorCount != null && message.hasOwnProperty("errorCount")) - object.errorCount = message.errorCount; - if (message.completedCount != null && message.hasOwnProperty("completedCount")) - object.completedCount = message.completedCount; - if (message.passedCount != null && message.hasOwnProperty("passedCount")) - object.passedCount = message.passedCount; - return object; - }; - - /** - * Converts this Progress to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress - * @instance - * @returns {Object.} JSON object - */ - Progress.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Progress - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Progress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationRun.Progress"; - }; - - return Progress; - })(); - - EvaluationRun.EvaluationRunSummary = (function() { - - /** - * Properties of an EvaluationRunSummary. - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @interface IEvaluationRunSummary - * @property {number|null} [passedCount] EvaluationRunSummary passedCount - * @property {number|null} [failedCount] EvaluationRunSummary failedCount - * @property {number|null} [errorCount] EvaluationRunSummary errorCount - */ - - /** - * Constructs a new EvaluationRunSummary. - * @memberof google.cloud.ces.v1beta.EvaluationRun - * @classdesc Represents an EvaluationRunSummary. - * @implements IEvaluationRunSummary - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary=} [properties] Properties to set - */ - function EvaluationRunSummary(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluationRunSummary passedCount. - * @member {number} passedCount - * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary - * @instance - */ - EvaluationRunSummary.prototype.passedCount = 0; - - /** - * EvaluationRunSummary failedCount. - * @member {number} failedCount - * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary - * @instance - */ - EvaluationRunSummary.prototype.failedCount = 0; - - /** - * EvaluationRunSummary errorCount. - * @member {number} errorCount - * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary - * @instance - */ - EvaluationRunSummary.prototype.errorCount = 0; - - /** - * Creates a new EvaluationRunSummary instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary - * @static - * @param {google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary} EvaluationRunSummary instance - */ - EvaluationRunSummary.create = function create(properties) { - return new EvaluationRunSummary(properties); - }; - - /** - * Encodes the specified EvaluationRunSummary message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary - * @static - * @param {google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary} message EvaluationRunSummary message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationRunSummary.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.passedCount != null && Object.hasOwnProperty.call(message, "passedCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.passedCount); - if (message.failedCount != null && Object.hasOwnProperty.call(message, "failedCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.failedCount); - if (message.errorCount != null && Object.hasOwnProperty.call(message, "errorCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.errorCount); - return writer; - }; - - /** - * Encodes the specified EvaluationRunSummary message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary - * @static - * @param {google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary} message EvaluationRunSummary message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationRunSummary.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluationRunSummary message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary} EvaluationRunSummary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationRunSummary.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.passedCount = reader.int32(); - break; - } - case 2: { - message.failedCount = reader.int32(); - break; - } - case 3: { - message.errorCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluationRunSummary message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary} EvaluationRunSummary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationRunSummary.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluationRunSummary message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluationRunSummary.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.passedCount != null && message.hasOwnProperty("passedCount")) - if (!$util.isInteger(message.passedCount)) - return "passedCount: integer expected"; - if (message.failedCount != null && message.hasOwnProperty("failedCount")) - if (!$util.isInteger(message.failedCount)) - return "failedCount: integer expected"; - if (message.errorCount != null && message.hasOwnProperty("errorCount")) - if (!$util.isInteger(message.errorCount)) - return "errorCount: integer expected"; - return null; - }; - - /** - * Creates an EvaluationRunSummary message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary} EvaluationRunSummary - */ - EvaluationRunSummary.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary(); - if (object.passedCount != null) - message.passedCount = object.passedCount | 0; - if (object.failedCount != null) - message.failedCount = object.failedCount | 0; - if (object.errorCount != null) - message.errorCount = object.errorCount | 0; - return message; - }; - - /** - * Creates a plain object from an EvaluationRunSummary message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary - * @static - * @param {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary} message EvaluationRunSummary - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluationRunSummary.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.passedCount = 0; - object.failedCount = 0; - object.errorCount = 0; - } - if (message.passedCount != null && message.hasOwnProperty("passedCount")) - object.passedCount = message.passedCount; - if (message.failedCount != null && message.hasOwnProperty("failedCount")) - object.failedCount = message.failedCount; - if (message.errorCount != null && message.hasOwnProperty("errorCount")) - object.errorCount = message.errorCount; - return object; - }; - - /** - * Converts this EvaluationRunSummary to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary - * @instance - * @returns {Object.} JSON object - */ - EvaluationRunSummary.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluationRunSummary - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluationRunSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary"; - }; - - return EvaluationRunSummary; - })(); - - /** - * EvaluationType enum. - * @name google.cloud.ces.v1beta.EvaluationRun.EvaluationType - * @enum {number} - * @property {number} EVALUATION_TYPE_UNSPECIFIED=0 EVALUATION_TYPE_UNSPECIFIED value - * @property {number} GOLDEN=1 GOLDEN value - * @property {number} SCENARIO=2 SCENARIO value - * @property {number} MIXED=3 MIXED value - */ - EvaluationRun.EvaluationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EVALUATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "GOLDEN"] = 1; - values[valuesById[2] = "SCENARIO"] = 2; - values[valuesById[3] = "MIXED"] = 3; - return values; - })(); - - /** - * EvaluationRunState enum. - * @name google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState - * @enum {number} - * @property {number} EVALUATION_RUN_STATE_UNSPECIFIED=0 EVALUATION_RUN_STATE_UNSPECIFIED value - * @property {number} RUNNING=1 RUNNING value - * @property {number} COMPLETED=2 COMPLETED value - * @property {number} ERROR=3 ERROR value - */ - EvaluationRun.EvaluationRunState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EVALUATION_RUN_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RUNNING"] = 1; - values[valuesById[2] = "COMPLETED"] = 2; - values[valuesById[3] = "ERROR"] = 3; - return values; - })(); - - return EvaluationRun; - })(); - - v1beta.LatencyReport = (function() { - - /** - * Properties of a LatencyReport. - * @memberof google.cloud.ces.v1beta - * @interface ILatencyReport - * @property {Array.|null} [toolLatencies] LatencyReport toolLatencies - * @property {Array.|null} [callbackLatencies] LatencyReport callbackLatencies - * @property {Array.|null} [guardrailLatencies] LatencyReport guardrailLatencies - * @property {Array.|null} [llmCallLatencies] LatencyReport llmCallLatencies - * @property {number|null} [sessionCount] LatencyReport sessionCount - */ - - /** - * Constructs a new LatencyReport. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a LatencyReport. - * @implements ILatencyReport - * @constructor - * @param {google.cloud.ces.v1beta.ILatencyReport=} [properties] Properties to set - */ - function LatencyReport(properties) { - this.toolLatencies = []; - this.callbackLatencies = []; - this.guardrailLatencies = []; - this.llmCallLatencies = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LatencyReport toolLatencies. - * @member {Array.} toolLatencies - * @memberof google.cloud.ces.v1beta.LatencyReport - * @instance - */ - LatencyReport.prototype.toolLatencies = $util.emptyArray; - - /** - * LatencyReport callbackLatencies. - * @member {Array.} callbackLatencies - * @memberof google.cloud.ces.v1beta.LatencyReport - * @instance - */ - LatencyReport.prototype.callbackLatencies = $util.emptyArray; - - /** - * LatencyReport guardrailLatencies. - * @member {Array.} guardrailLatencies - * @memberof google.cloud.ces.v1beta.LatencyReport - * @instance - */ - LatencyReport.prototype.guardrailLatencies = $util.emptyArray; - - /** - * LatencyReport llmCallLatencies. - * @member {Array.} llmCallLatencies - * @memberof google.cloud.ces.v1beta.LatencyReport - * @instance - */ - LatencyReport.prototype.llmCallLatencies = $util.emptyArray; - - /** - * LatencyReport sessionCount. - * @member {number} sessionCount - * @memberof google.cloud.ces.v1beta.LatencyReport - * @instance - */ - LatencyReport.prototype.sessionCount = 0; - - /** - * Creates a new LatencyReport instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.LatencyReport - * @static - * @param {google.cloud.ces.v1beta.ILatencyReport=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.LatencyReport} LatencyReport instance - */ - LatencyReport.create = function create(properties) { - return new LatencyReport(properties); - }; - - /** - * Encodes the specified LatencyReport message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.LatencyReport - * @static - * @param {google.cloud.ces.v1beta.ILatencyReport} message LatencyReport message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LatencyReport.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolLatencies != null && message.toolLatencies.length) - for (var i = 0; i < message.toolLatencies.length; ++i) - $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency.encode(message.toolLatencies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.callbackLatencies != null && message.callbackLatencies.length) - for (var i = 0; i < message.callbackLatencies.length; ++i) - $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency.encode(message.callbackLatencies[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.guardrailLatencies != null && message.guardrailLatencies.length) - for (var i = 0; i < message.guardrailLatencies.length; ++i) - $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.encode(message.guardrailLatencies[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.llmCallLatencies != null && message.llmCallLatencies.length) - for (var i = 0; i < message.llmCallLatencies.length; ++i) - $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.encode(message.llmCallLatencies[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.sessionCount != null && Object.hasOwnProperty.call(message, "sessionCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.sessionCount); - return writer; - }; - - /** - * Encodes the specified LatencyReport message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.LatencyReport - * @static - * @param {google.cloud.ces.v1beta.ILatencyReport} message LatencyReport message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LatencyReport.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LatencyReport message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.LatencyReport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.LatencyReport} LatencyReport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LatencyReport.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LatencyReport(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.toolLatencies && message.toolLatencies.length)) - message.toolLatencies = []; - message.toolLatencies.push($root.google.cloud.ces.v1beta.LatencyReport.ToolLatency.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.callbackLatencies && message.callbackLatencies.length)) - message.callbackLatencies = []; - message.callbackLatencies.push($root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.guardrailLatencies && message.guardrailLatencies.length)) - message.guardrailLatencies = []; - message.guardrailLatencies.push($root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.llmCallLatencies && message.llmCallLatencies.length)) - message.llmCallLatencies = []; - message.llmCallLatencies.push($root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.decode(reader, reader.uint32())); - break; - } - case 5: { - message.sessionCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LatencyReport message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.LatencyReport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.LatencyReport} LatencyReport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LatencyReport.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LatencyReport message. - * @function verify - * @memberof google.cloud.ces.v1beta.LatencyReport - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LatencyReport.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.toolLatencies != null && message.hasOwnProperty("toolLatencies")) { - if (!Array.isArray(message.toolLatencies)) - return "toolLatencies: array expected"; - for (var i = 0; i < message.toolLatencies.length; ++i) { - var error = $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency.verify(message.toolLatencies[i]); - if (error) - return "toolLatencies." + error; - } - } - if (message.callbackLatencies != null && message.hasOwnProperty("callbackLatencies")) { - if (!Array.isArray(message.callbackLatencies)) - return "callbackLatencies: array expected"; - for (var i = 0; i < message.callbackLatencies.length; ++i) { - var error = $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency.verify(message.callbackLatencies[i]); - if (error) - return "callbackLatencies." + error; - } - } - if (message.guardrailLatencies != null && message.hasOwnProperty("guardrailLatencies")) { - if (!Array.isArray(message.guardrailLatencies)) - return "guardrailLatencies: array expected"; - for (var i = 0; i < message.guardrailLatencies.length; ++i) { - var error = $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.verify(message.guardrailLatencies[i]); - if (error) - return "guardrailLatencies." + error; - } - } - if (message.llmCallLatencies != null && message.hasOwnProperty("llmCallLatencies")) { - if (!Array.isArray(message.llmCallLatencies)) - return "llmCallLatencies: array expected"; - for (var i = 0; i < message.llmCallLatencies.length; ++i) { - var error = $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.verify(message.llmCallLatencies[i]); - if (error) - return "llmCallLatencies." + error; - } - } - if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) - if (!$util.isInteger(message.sessionCount)) - return "sessionCount: integer expected"; - return null; - }; - - /** - * Creates a LatencyReport message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.LatencyReport - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.LatencyReport} LatencyReport - */ - LatencyReport.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.LatencyReport) - return object; - var message = new $root.google.cloud.ces.v1beta.LatencyReport(); - if (object.toolLatencies) { - if (!Array.isArray(object.toolLatencies)) - throw TypeError(".google.cloud.ces.v1beta.LatencyReport.toolLatencies: array expected"); - message.toolLatencies = []; - for (var i = 0; i < object.toolLatencies.length; ++i) { - if (typeof object.toolLatencies[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.LatencyReport.toolLatencies: object expected"); - message.toolLatencies[i] = $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency.fromObject(object.toolLatencies[i]); - } - } - if (object.callbackLatencies) { - if (!Array.isArray(object.callbackLatencies)) - throw TypeError(".google.cloud.ces.v1beta.LatencyReport.callbackLatencies: array expected"); - message.callbackLatencies = []; - for (var i = 0; i < object.callbackLatencies.length; ++i) { - if (typeof object.callbackLatencies[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.LatencyReport.callbackLatencies: object expected"); - message.callbackLatencies[i] = $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency.fromObject(object.callbackLatencies[i]); - } - } - if (object.guardrailLatencies) { - if (!Array.isArray(object.guardrailLatencies)) - throw TypeError(".google.cloud.ces.v1beta.LatencyReport.guardrailLatencies: array expected"); - message.guardrailLatencies = []; - for (var i = 0; i < object.guardrailLatencies.length; ++i) { - if (typeof object.guardrailLatencies[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.LatencyReport.guardrailLatencies: object expected"); - message.guardrailLatencies[i] = $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.fromObject(object.guardrailLatencies[i]); - } - } - if (object.llmCallLatencies) { - if (!Array.isArray(object.llmCallLatencies)) - throw TypeError(".google.cloud.ces.v1beta.LatencyReport.llmCallLatencies: array expected"); - message.llmCallLatencies = []; - for (var i = 0; i < object.llmCallLatencies.length; ++i) { - if (typeof object.llmCallLatencies[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.LatencyReport.llmCallLatencies: object expected"); - message.llmCallLatencies[i] = $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.fromObject(object.llmCallLatencies[i]); - } - } - if (object.sessionCount != null) - message.sessionCount = object.sessionCount | 0; - return message; - }; - - /** - * Creates a plain object from a LatencyReport message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.LatencyReport - * @static - * @param {google.cloud.ces.v1beta.LatencyReport} message LatencyReport - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LatencyReport.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.toolLatencies = []; - object.callbackLatencies = []; - object.guardrailLatencies = []; - object.llmCallLatencies = []; - } - if (options.defaults) - object.sessionCount = 0; - if (message.toolLatencies && message.toolLatencies.length) { - object.toolLatencies = []; - for (var j = 0; j < message.toolLatencies.length; ++j) - object.toolLatencies[j] = $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency.toObject(message.toolLatencies[j], options); - } - if (message.callbackLatencies && message.callbackLatencies.length) { - object.callbackLatencies = []; - for (var j = 0; j < message.callbackLatencies.length; ++j) - object.callbackLatencies[j] = $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency.toObject(message.callbackLatencies[j], options); - } - if (message.guardrailLatencies && message.guardrailLatencies.length) { - object.guardrailLatencies = []; - for (var j = 0; j < message.guardrailLatencies.length; ++j) - object.guardrailLatencies[j] = $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.toObject(message.guardrailLatencies[j], options); - } - if (message.llmCallLatencies && message.llmCallLatencies.length) { - object.llmCallLatencies = []; - for (var j = 0; j < message.llmCallLatencies.length; ++j) - object.llmCallLatencies[j] = $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.toObject(message.llmCallLatencies[j], options); - } - if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) - object.sessionCount = message.sessionCount; - return object; - }; - - /** - * Converts this LatencyReport to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.LatencyReport - * @instance - * @returns {Object.} JSON object - */ - LatencyReport.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LatencyReport - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.LatencyReport - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LatencyReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.LatencyReport"; - }; - - LatencyReport.LatencyMetrics = (function() { - - /** - * Properties of a LatencyMetrics. - * @memberof google.cloud.ces.v1beta.LatencyReport - * @interface ILatencyMetrics - * @property {google.protobuf.IDuration|null} [p50Latency] LatencyMetrics p50Latency - * @property {google.protobuf.IDuration|null} [p90Latency] LatencyMetrics p90Latency - * @property {google.protobuf.IDuration|null} [p99Latency] LatencyMetrics p99Latency - * @property {number|null} [callCount] LatencyMetrics callCount - */ - - /** - * Constructs a new LatencyMetrics. - * @memberof google.cloud.ces.v1beta.LatencyReport - * @classdesc Represents a LatencyMetrics. - * @implements ILatencyMetrics - * @constructor - * @param {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics=} [properties] Properties to set - */ - function LatencyMetrics(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LatencyMetrics p50Latency. - * @member {google.protobuf.IDuration|null|undefined} p50Latency - * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics - * @instance - */ - LatencyMetrics.prototype.p50Latency = null; - - /** - * LatencyMetrics p90Latency. - * @member {google.protobuf.IDuration|null|undefined} p90Latency - * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics - * @instance - */ - LatencyMetrics.prototype.p90Latency = null; - - /** - * LatencyMetrics p99Latency. - * @member {google.protobuf.IDuration|null|undefined} p99Latency - * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics - * @instance - */ - LatencyMetrics.prototype.p99Latency = null; - - /** - * LatencyMetrics callCount. - * @member {number} callCount - * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics - * @instance - */ - LatencyMetrics.prototype.callCount = 0; - - /** - * Creates a new LatencyMetrics instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.LatencyReport.LatencyMetrics} LatencyMetrics instance - */ - LatencyMetrics.create = function create(properties) { - return new LatencyMetrics(properties); - }; - - /** - * Encodes the specified LatencyMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics} message LatencyMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LatencyMetrics.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.p50Latency != null && Object.hasOwnProperty.call(message, "p50Latency")) - $root.google.protobuf.Duration.encode(message.p50Latency, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.p90Latency != null && Object.hasOwnProperty.call(message, "p90Latency")) - $root.google.protobuf.Duration.encode(message.p90Latency, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.p99Latency != null && Object.hasOwnProperty.call(message, "p99Latency")) - $root.google.protobuf.Duration.encode(message.p99Latency, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.callCount != null && Object.hasOwnProperty.call(message, "callCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.callCount); - return writer; - }; - - /** - * Encodes the specified LatencyMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics} message LatencyMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LatencyMetrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LatencyMetrics message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.LatencyReport.LatencyMetrics} LatencyMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LatencyMetrics.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.p50Latency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.p90Latency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 3: { - message.p99Latency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.callCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LatencyMetrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.LatencyReport.LatencyMetrics} LatencyMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LatencyMetrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LatencyMetrics message. - * @function verify - * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LatencyMetrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.p50Latency != null && message.hasOwnProperty("p50Latency")) { - var error = $root.google.protobuf.Duration.verify(message.p50Latency); - if (error) - return "p50Latency." + error; - } - if (message.p90Latency != null && message.hasOwnProperty("p90Latency")) { - var error = $root.google.protobuf.Duration.verify(message.p90Latency); - if (error) - return "p90Latency." + error; - } - if (message.p99Latency != null && message.hasOwnProperty("p99Latency")) { - var error = $root.google.protobuf.Duration.verify(message.p99Latency); - if (error) - return "p99Latency." + error; - } - if (message.callCount != null && message.hasOwnProperty("callCount")) - if (!$util.isInteger(message.callCount)) - return "callCount: integer expected"; - return null; - }; - - /** - * Creates a LatencyMetrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.LatencyReport.LatencyMetrics} LatencyMetrics - */ - LatencyMetrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics) - return object; - var message = new $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics(); - if (object.p50Latency != null) { - if (typeof object.p50Latency !== "object") - throw TypeError(".google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.p50Latency: object expected"); - message.p50Latency = $root.google.protobuf.Duration.fromObject(object.p50Latency); - } - if (object.p90Latency != null) { - if (typeof object.p90Latency !== "object") - throw TypeError(".google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.p90Latency: object expected"); - message.p90Latency = $root.google.protobuf.Duration.fromObject(object.p90Latency); - } - if (object.p99Latency != null) { - if (typeof object.p99Latency !== "object") - throw TypeError(".google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.p99Latency: object expected"); - message.p99Latency = $root.google.protobuf.Duration.fromObject(object.p99Latency); - } - if (object.callCount != null) - message.callCount = object.callCount | 0; - return message; - }; - - /** - * Creates a plain object from a LatencyMetrics message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.LatencyMetrics} message LatencyMetrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LatencyMetrics.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.p50Latency = null; - object.p90Latency = null; - object.p99Latency = null; - object.callCount = 0; - } - if (message.p50Latency != null && message.hasOwnProperty("p50Latency")) - object.p50Latency = $root.google.protobuf.Duration.toObject(message.p50Latency, options); - if (message.p90Latency != null && message.hasOwnProperty("p90Latency")) - object.p90Latency = $root.google.protobuf.Duration.toObject(message.p90Latency, options); - if (message.p99Latency != null && message.hasOwnProperty("p99Latency")) - object.p99Latency = $root.google.protobuf.Duration.toObject(message.p99Latency, options); - if (message.callCount != null && message.hasOwnProperty("callCount")) - object.callCount = message.callCount; - return object; - }; - - /** - * Converts this LatencyMetrics to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics - * @instance - * @returns {Object.} JSON object - */ - LatencyMetrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LatencyMetrics - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LatencyMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.LatencyReport.LatencyMetrics"; - }; - - return LatencyMetrics; - })(); - - LatencyReport.ToolLatency = (function() { - - /** - * Properties of a ToolLatency. - * @memberof google.cloud.ces.v1beta.LatencyReport - * @interface IToolLatency - * @property {string|null} [tool] ToolLatency tool - * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] ToolLatency toolsetTool - * @property {string|null} [toolDisplayName] ToolLatency toolDisplayName - * @property {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null} [latencyMetrics] ToolLatency latencyMetrics - */ - - /** - * Constructs a new ToolLatency. - * @memberof google.cloud.ces.v1beta.LatencyReport - * @classdesc Represents a ToolLatency. - * @implements IToolLatency - * @constructor - * @param {google.cloud.ces.v1beta.LatencyReport.IToolLatency=} [properties] Properties to set - */ - function ToolLatency(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolLatency tool. - * @member {string|null|undefined} tool - * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency - * @instance - */ - ToolLatency.prototype.tool = null; - - /** - * ToolLatency toolsetTool. - * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool - * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency - * @instance - */ - ToolLatency.prototype.toolsetTool = null; - - /** - * ToolLatency toolDisplayName. - * @member {string} toolDisplayName - * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency - * @instance - */ - ToolLatency.prototype.toolDisplayName = ""; - - /** - * ToolLatency latencyMetrics. - * @member {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null|undefined} latencyMetrics - * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency - * @instance - */ - ToolLatency.prototype.latencyMetrics = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ToolLatency toolIdentifier. - * @member {"tool"|"toolsetTool"|undefined} toolIdentifier - * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency - * @instance - */ - Object.defineProperty(ToolLatency.prototype, "toolIdentifier", { - get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ToolLatency instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.IToolLatency=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.LatencyReport.ToolLatency} ToolLatency instance - */ - ToolLatency.create = function create(properties) { - return new ToolLatency(properties); - }; - - /** - * Encodes the specified ToolLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.ToolLatency.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.IToolLatency} message ToolLatency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolLatency.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); - if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) - $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.toolDisplayName != null && Object.hasOwnProperty.call(message, "toolDisplayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.toolDisplayName); - if (message.latencyMetrics != null && Object.hasOwnProperty.call(message, "latencyMetrics")) - $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.encode(message.latencyMetrics, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ToolLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.ToolLatency.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.IToolLatency} message ToolLatency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolLatency.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolLatency message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.LatencyReport.ToolLatency} ToolLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolLatency.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tool = reader.string(); - break; - } - case 2: { - message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); - break; - } - case 3: { - message.toolDisplayName = reader.string(); - break; - } - case 4: { - message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolLatency message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.LatencyReport.ToolLatency} ToolLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolLatency.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolLatency message. - * @function verify - * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolLatency.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tool != null && message.hasOwnProperty("tool")) { - properties.toolIdentifier = 1; - if (!$util.isString(message.tool)) - return "tool: string expected"; - } - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - if (properties.toolIdentifier === 1) - return "toolIdentifier: multiple values"; - properties.toolIdentifier = 1; - { - var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); - if (error) - return "toolsetTool." + error; - } - } - if (message.toolDisplayName != null && message.hasOwnProperty("toolDisplayName")) - if (!$util.isString(message.toolDisplayName)) - return "toolDisplayName: string expected"; - if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) { - var error = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify(message.latencyMetrics); - if (error) - return "latencyMetrics." + error; - } - return null; - }; - - /** - * Creates a ToolLatency message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.LatencyReport.ToolLatency} ToolLatency - */ - ToolLatency.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency) - return object; - var message = new $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency(); - if (object.tool != null) - message.tool = String(object.tool); - if (object.toolsetTool != null) { - if (typeof object.toolsetTool !== "object") - throw TypeError(".google.cloud.ces.v1beta.LatencyReport.ToolLatency.toolsetTool: object expected"); - message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); - } - if (object.toolDisplayName != null) - message.toolDisplayName = String(object.toolDisplayName); - if (object.latencyMetrics != null) { - if (typeof object.latencyMetrics !== "object") - throw TypeError(".google.cloud.ces.v1beta.LatencyReport.ToolLatency.latencyMetrics: object expected"); - message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.fromObject(object.latencyMetrics); - } - return message; - }; - - /** - * Creates a plain object from a ToolLatency message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.ToolLatency} message ToolLatency - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolLatency.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.toolDisplayName = ""; - object.latencyMetrics = null; - } - if (message.tool != null && message.hasOwnProperty("tool")) { - object.tool = message.tool; - if (options.oneofs) - object.toolIdentifier = "tool"; - } - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); - if (options.oneofs) - object.toolIdentifier = "toolsetTool"; - } - if (message.toolDisplayName != null && message.hasOwnProperty("toolDisplayName")) - object.toolDisplayName = message.toolDisplayName; - if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) - object.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.toObject(message.latencyMetrics, options); - return object; - }; - - /** - * Converts this ToolLatency to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency - * @instance - * @returns {Object.} JSON object - */ - ToolLatency.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolLatency - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolLatency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.LatencyReport.ToolLatency"; - }; - - return ToolLatency; - })(); - - LatencyReport.CallbackLatency = (function() { - - /** - * Properties of a CallbackLatency. - * @memberof google.cloud.ces.v1beta.LatencyReport - * @interface ICallbackLatency - * @property {string|null} [stage] CallbackLatency stage - * @property {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null} [latencyMetrics] CallbackLatency latencyMetrics - */ - - /** - * Constructs a new CallbackLatency. - * @memberof google.cloud.ces.v1beta.LatencyReport - * @classdesc Represents a CallbackLatency. - * @implements ICallbackLatency - * @constructor - * @param {google.cloud.ces.v1beta.LatencyReport.ICallbackLatency=} [properties] Properties to set - */ - function CallbackLatency(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CallbackLatency stage. - * @member {string} stage - * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency - * @instance - */ - CallbackLatency.prototype.stage = ""; - - /** - * CallbackLatency latencyMetrics. - * @member {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null|undefined} latencyMetrics - * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency - * @instance - */ - CallbackLatency.prototype.latencyMetrics = null; - - /** - * Creates a new CallbackLatency instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.ICallbackLatency=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.LatencyReport.CallbackLatency} CallbackLatency instance - */ - CallbackLatency.create = function create(properties) { - return new CallbackLatency(properties); - }; - - /** - * Encodes the specified CallbackLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.CallbackLatency.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.ICallbackLatency} message CallbackLatency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CallbackLatency.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stage != null && Object.hasOwnProperty.call(message, "stage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.stage); - if (message.latencyMetrics != null && Object.hasOwnProperty.call(message, "latencyMetrics")) - $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.encode(message.latencyMetrics, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CallbackLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.CallbackLatency.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.ICallbackLatency} message CallbackLatency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CallbackLatency.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CallbackLatency message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.LatencyReport.CallbackLatency} CallbackLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CallbackLatency.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.stage = reader.string(); - break; - } - case 2: { - message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CallbackLatency message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.LatencyReport.CallbackLatency} CallbackLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CallbackLatency.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CallbackLatency message. - * @function verify - * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CallbackLatency.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.stage != null && message.hasOwnProperty("stage")) - if (!$util.isString(message.stage)) - return "stage: string expected"; - if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) { - var error = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify(message.latencyMetrics); - if (error) - return "latencyMetrics." + error; - } - return null; - }; - - /** - * Creates a CallbackLatency message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.LatencyReport.CallbackLatency} CallbackLatency - */ - CallbackLatency.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency) - return object; - var message = new $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency(); - if (object.stage != null) - message.stage = String(object.stage); - if (object.latencyMetrics != null) { - if (typeof object.latencyMetrics !== "object") - throw TypeError(".google.cloud.ces.v1beta.LatencyReport.CallbackLatency.latencyMetrics: object expected"); - message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.fromObject(object.latencyMetrics); - } - return message; - }; - - /** - * Creates a plain object from a CallbackLatency message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.CallbackLatency} message CallbackLatency - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CallbackLatency.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.stage = ""; - object.latencyMetrics = null; - } - if (message.stage != null && message.hasOwnProperty("stage")) - object.stage = message.stage; - if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) - object.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.toObject(message.latencyMetrics, options); - return object; - }; - - /** - * Converts this CallbackLatency to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency - * @instance - * @returns {Object.} JSON object - */ - CallbackLatency.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CallbackLatency - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CallbackLatency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.LatencyReport.CallbackLatency"; - }; - - return CallbackLatency; - })(); - - LatencyReport.GuardrailLatency = (function() { - - /** - * Properties of a GuardrailLatency. - * @memberof google.cloud.ces.v1beta.LatencyReport - * @interface IGuardrailLatency - * @property {string|null} [guardrail] GuardrailLatency guardrail - * @property {string|null} [guardrailDisplayName] GuardrailLatency guardrailDisplayName - * @property {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null} [latencyMetrics] GuardrailLatency latencyMetrics - */ - - /** - * Constructs a new GuardrailLatency. - * @memberof google.cloud.ces.v1beta.LatencyReport - * @classdesc Represents a GuardrailLatency. - * @implements IGuardrailLatency - * @constructor - * @param {google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency=} [properties] Properties to set - */ - function GuardrailLatency(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GuardrailLatency guardrail. - * @member {string} guardrail - * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency - * @instance - */ - GuardrailLatency.prototype.guardrail = ""; - - /** - * GuardrailLatency guardrailDisplayName. - * @member {string} guardrailDisplayName - * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency - * @instance - */ - GuardrailLatency.prototype.guardrailDisplayName = ""; - - /** - * GuardrailLatency latencyMetrics. - * @member {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null|undefined} latencyMetrics - * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency - * @instance - */ - GuardrailLatency.prototype.latencyMetrics = null; - - /** - * Creates a new GuardrailLatency instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.LatencyReport.GuardrailLatency} GuardrailLatency instance - */ - GuardrailLatency.create = function create(properties) { - return new GuardrailLatency(properties); - }; - - /** - * Encodes the specified GuardrailLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency} message GuardrailLatency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GuardrailLatency.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.guardrail != null && Object.hasOwnProperty.call(message, "guardrail")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.guardrail); - if (message.guardrailDisplayName != null && Object.hasOwnProperty.call(message, "guardrailDisplayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.guardrailDisplayName); - if (message.latencyMetrics != null && Object.hasOwnProperty.call(message, "latencyMetrics")) - $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.encode(message.latencyMetrics, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GuardrailLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency} message GuardrailLatency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GuardrailLatency.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GuardrailLatency message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.LatencyReport.GuardrailLatency} GuardrailLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GuardrailLatency.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.guardrail = reader.string(); - break; - } - case 2: { - message.guardrailDisplayName = reader.string(); - break; - } - case 3: { - message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GuardrailLatency message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.LatencyReport.GuardrailLatency} GuardrailLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GuardrailLatency.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GuardrailLatency message. - * @function verify - * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GuardrailLatency.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.guardrail != null && message.hasOwnProperty("guardrail")) - if (!$util.isString(message.guardrail)) - return "guardrail: string expected"; - if (message.guardrailDisplayName != null && message.hasOwnProperty("guardrailDisplayName")) - if (!$util.isString(message.guardrailDisplayName)) - return "guardrailDisplayName: string expected"; - if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) { - var error = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify(message.latencyMetrics); - if (error) - return "latencyMetrics." + error; - } - return null; - }; - - /** - * Creates a GuardrailLatency message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.LatencyReport.GuardrailLatency} GuardrailLatency - */ - GuardrailLatency.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency) - return object; - var message = new $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency(); - if (object.guardrail != null) - message.guardrail = String(object.guardrail); - if (object.guardrailDisplayName != null) - message.guardrailDisplayName = String(object.guardrailDisplayName); - if (object.latencyMetrics != null) { - if (typeof object.latencyMetrics !== "object") - throw TypeError(".google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.latencyMetrics: object expected"); - message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.fromObject(object.latencyMetrics); - } - return message; - }; - - /** - * Creates a plain object from a GuardrailLatency message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.GuardrailLatency} message GuardrailLatency - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GuardrailLatency.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.guardrail = ""; - object.guardrailDisplayName = ""; - object.latencyMetrics = null; - } - if (message.guardrail != null && message.hasOwnProperty("guardrail")) - object.guardrail = message.guardrail; - if (message.guardrailDisplayName != null && message.hasOwnProperty("guardrailDisplayName")) - object.guardrailDisplayName = message.guardrailDisplayName; - if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) - object.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.toObject(message.latencyMetrics, options); - return object; - }; - - /** - * Converts this GuardrailLatency to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency - * @instance - * @returns {Object.} JSON object - */ - GuardrailLatency.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GuardrailLatency - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GuardrailLatency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.LatencyReport.GuardrailLatency"; - }; - - return GuardrailLatency; - })(); - - LatencyReport.LlmCallLatency = (function() { - - /** - * Properties of a LlmCallLatency. - * @memberof google.cloud.ces.v1beta.LatencyReport - * @interface ILlmCallLatency - * @property {string|null} [model] LlmCallLatency model - * @property {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null} [latencyMetrics] LlmCallLatency latencyMetrics - */ - - /** - * Constructs a new LlmCallLatency. - * @memberof google.cloud.ces.v1beta.LatencyReport - * @classdesc Represents a LlmCallLatency. - * @implements ILlmCallLatency - * @constructor - * @param {google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency=} [properties] Properties to set - */ - function LlmCallLatency(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LlmCallLatency model. - * @member {string} model - * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency - * @instance - */ - LlmCallLatency.prototype.model = ""; - - /** - * LlmCallLatency latencyMetrics. - * @member {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null|undefined} latencyMetrics - * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency - * @instance - */ - LlmCallLatency.prototype.latencyMetrics = null; - - /** - * Creates a new LlmCallLatency instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.LatencyReport.LlmCallLatency} LlmCallLatency instance - */ - LlmCallLatency.create = function create(properties) { - return new LlmCallLatency(properties); - }; - - /** - * Encodes the specified LlmCallLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency} message LlmCallLatency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LlmCallLatency.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); - if (message.latencyMetrics != null && Object.hasOwnProperty.call(message, "latencyMetrics")) - $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.encode(message.latencyMetrics, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LlmCallLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency} message LlmCallLatency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LlmCallLatency.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LlmCallLatency message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.LatencyReport.LlmCallLatency} LlmCallLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LlmCallLatency.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.model = reader.string(); - break; - } - case 2: { - message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LlmCallLatency message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.LatencyReport.LlmCallLatency} LlmCallLatency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LlmCallLatency.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LlmCallLatency message. - * @function verify - * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LlmCallLatency.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.model != null && message.hasOwnProperty("model")) - if (!$util.isString(message.model)) - return "model: string expected"; - if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) { - var error = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify(message.latencyMetrics); - if (error) - return "latencyMetrics." + error; - } - return null; - }; - - /** - * Creates a LlmCallLatency message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.LatencyReport.LlmCallLatency} LlmCallLatency - */ - LlmCallLatency.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency) - return object; - var message = new $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency(); - if (object.model != null) - message.model = String(object.model); - if (object.latencyMetrics != null) { - if (typeof object.latencyMetrics !== "object") - throw TypeError(".google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.latencyMetrics: object expected"); - message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.fromObject(object.latencyMetrics); - } - return message; - }; - - /** - * Creates a plain object from a LlmCallLatency message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency - * @static - * @param {google.cloud.ces.v1beta.LatencyReport.LlmCallLatency} message LlmCallLatency - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LlmCallLatency.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.model = ""; - object.latencyMetrics = null; - } - if (message.model != null && message.hasOwnProperty("model")) - object.model = message.model; - if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) - object.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.toObject(message.latencyMetrics, options); - return object; - }; - - /** - * Converts this LlmCallLatency to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency - * @instance - * @returns {Object.} JSON object - */ - LlmCallLatency.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LlmCallLatency - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LlmCallLatency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.LatencyReport.LlmCallLatency"; - }; - - return LlmCallLatency; - })(); - - return LatencyReport; - })(); - - v1beta.EvaluationExpectation = (function() { - - /** - * Properties of an EvaluationExpectation. - * @memberof google.cloud.ces.v1beta - * @interface IEvaluationExpectation - * @property {google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria|null} [llmCriteria] EvaluationExpectation llmCriteria - * @property {string|null} [name] EvaluationExpectation name - * @property {string|null} [displayName] EvaluationExpectation displayName - * @property {Array.|null} [tags] EvaluationExpectation tags - * @property {google.protobuf.ITimestamp|null} [createTime] EvaluationExpectation createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] EvaluationExpectation updateTime - * @property {string|null} [etag] EvaluationExpectation etag - */ - - /** - * Constructs a new EvaluationExpectation. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an EvaluationExpectation. - * @implements IEvaluationExpectation - * @constructor - * @param {google.cloud.ces.v1beta.IEvaluationExpectation=} [properties] Properties to set - */ - function EvaluationExpectation(properties) { - 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]]; - } - - /** - * EvaluationExpectation llmCriteria. - * @member {google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria|null|undefined} llmCriteria - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @instance - */ - EvaluationExpectation.prototype.llmCriteria = null; - - /** - * EvaluationExpectation name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @instance - */ - EvaluationExpectation.prototype.name = ""; - - /** - * EvaluationExpectation displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @instance - */ - EvaluationExpectation.prototype.displayName = ""; - - /** - * EvaluationExpectation tags. - * @member {Array.} tags - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @instance - */ - EvaluationExpectation.prototype.tags = $util.emptyArray; - - /** - * EvaluationExpectation createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @instance - */ - EvaluationExpectation.prototype.createTime = null; - - /** - * EvaluationExpectation updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @instance - */ - EvaluationExpectation.prototype.updateTime = null; - - /** - * EvaluationExpectation etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @instance - */ - EvaluationExpectation.prototype.etag = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * EvaluationExpectation criteria. - * @member {"llmCriteria"|undefined} criteria - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @instance - */ - Object.defineProperty(EvaluationExpectation.prototype, "criteria", { - get: $util.oneOfGetter($oneOfFields = ["llmCriteria"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new EvaluationExpectation instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @static - * @param {google.cloud.ces.v1beta.IEvaluationExpectation=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationExpectation} EvaluationExpectation instance - */ - EvaluationExpectation.create = function create(properties) { - return new EvaluationExpectation(properties); - }; - - /** - * Encodes the specified EvaluationExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @static - * @param {google.cloud.ces.v1beta.IEvaluationExpectation} message EvaluationExpectation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationExpectation.encode = function encode(message, writer) { - if (!writer) - 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.llmCriteria != null && Object.hasOwnProperty.call(message, "llmCriteria")) - $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.encode(message.llmCriteria, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - 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.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); - if (message.tags != null && message.tags.length) - for (var i = 0; i < message.tags.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.tags[i]); - return writer; - }; - - /** - * Encodes the specified EvaluationExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @static - * @param {google.cloud.ces.v1beta.IEvaluationExpectation} message EvaluationExpectation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationExpectation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluationExpectation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationExpectation} EvaluationExpectation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationExpectation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationExpectation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.llmCriteria = $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 8: { - if (!(message.tags && message.tags.length)) - message.tags = []; - message.tags.push(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.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluationExpectation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationExpectation} EvaluationExpectation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationExpectation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluationExpectation message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluationExpectation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.llmCriteria != null && message.hasOwnProperty("llmCriteria")) { - properties.criteria = 1; - { - var error = $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.verify(message.llmCriteria); - if (error) - return "llmCriteria." + 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.tags != null && message.hasOwnProperty("tags")) { - if (!Array.isArray(message.tags)) - return "tags: array expected"; - for (var i = 0; i < message.tags.length; ++i) - if (!$util.isString(message.tags[i])) - return "tags: 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.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates an EvaluationExpectation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationExpectation} EvaluationExpectation - */ - EvaluationExpectation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationExpectation) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationExpectation(); - if (object.llmCriteria != null) { - if (typeof object.llmCriteria !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationExpectation.llmCriteria: object expected"); - message.llmCriteria = $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.fromObject(object.llmCriteria); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.tags) { - if (!Array.isArray(object.tags)) - throw TypeError(".google.cloud.ces.v1beta.EvaluationExpectation.tags: array expected"); - message.tags = []; - for (var i = 0; i < object.tags.length; ++i) - message.tags[i] = String(object.tags[i]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationExpectation.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.ces.v1beta.EvaluationExpectation.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from an EvaluationExpectation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @static - * @param {google.cloud.ces.v1beta.EvaluationExpectation} message EvaluationExpectation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluationExpectation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tags = []; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.llmCriteria != null && message.hasOwnProperty("llmCriteria")) { - object.llmCriteria = $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.toObject(message.llmCriteria, options); - if (options.oneofs) - object.criteria = "llmCriteria"; - } - 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.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.tags && message.tags.length) { - object.tags = []; - for (var j = 0; j < message.tags.length; ++j) - object.tags[j] = message.tags[j]; - } - return object; - }; - - /** - * Converts this EvaluationExpectation to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @instance - * @returns {Object.} JSON object - */ - EvaluationExpectation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluationExpectation - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluationExpectation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationExpectation"; - }; - - EvaluationExpectation.LlmCriteria = (function() { - - /** - * Properties of a LlmCriteria. - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @interface ILlmCriteria - * @property {string|null} [prompt] LlmCriteria prompt - */ - - /** - * Constructs a new LlmCriteria. - * @memberof google.cloud.ces.v1beta.EvaluationExpectation - * @classdesc Represents a LlmCriteria. - * @implements ILlmCriteria - * @constructor - * @param {google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria=} [properties] Properties to set - */ - function LlmCriteria(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LlmCriteria prompt. - * @member {string} prompt - * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria - * @instance - */ - LlmCriteria.prototype.prompt = ""; - - /** - * Creates a new LlmCriteria instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria - * @static - * @param {google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria} LlmCriteria instance - */ - LlmCriteria.create = function create(properties) { - return new LlmCriteria(properties); - }; - - /** - * Encodes the specified LlmCriteria message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria - * @static - * @param {google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria} message LlmCriteria message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LlmCriteria.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.prompt); - return writer; - }; - - /** - * Encodes the specified LlmCriteria message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria - * @static - * @param {google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria} message LlmCriteria message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LlmCriteria.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LlmCriteria message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria} LlmCriteria - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LlmCriteria.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.prompt = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LlmCriteria message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria} LlmCriteria - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LlmCriteria.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LlmCriteria message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LlmCriteria.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.prompt != null && message.hasOwnProperty("prompt")) - if (!$util.isString(message.prompt)) - return "prompt: string expected"; - return null; - }; - - /** - * Creates a LlmCriteria message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria} LlmCriteria - */ - LlmCriteria.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria(); - if (object.prompt != null) - message.prompt = String(object.prompt); - return message; - }; - - /** - * Creates a plain object from a LlmCriteria message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria - * @static - * @param {google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria} message LlmCriteria - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LlmCriteria.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.prompt = ""; - if (message.prompt != null && message.hasOwnProperty("prompt")) - object.prompt = message.prompt; - return object; - }; - - /** - * Converts this LlmCriteria to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria - * @instance - * @returns {Object.} JSON object - */ - LlmCriteria.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LlmCriteria - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LlmCriteria.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria"; - }; - - return LlmCriteria; - })(); - - return EvaluationExpectation; - })(); - - v1beta.EvaluationConfig = (function() { - - /** - * Properties of an EvaluationConfig. - * @memberof google.cloud.ces.v1beta - * @interface IEvaluationConfig - * @property {google.cloud.ces.v1beta.IInputAudioConfig|null} [inputAudioConfig] EvaluationConfig inputAudioConfig - * @property {google.cloud.ces.v1beta.IOutputAudioConfig|null} [outputAudioConfig] EvaluationConfig outputAudioConfig - * @property {google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel|null} [evaluationChannel] EvaluationConfig evaluationChannel - * @property {google.cloud.ces.v1beta.EvaluationToolCallBehaviour|null} [toolCallBehaviour] EvaluationConfig toolCallBehaviour - */ - - /** - * Constructs a new EvaluationConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an EvaluationConfig. - * @implements IEvaluationConfig - * @constructor - * @param {google.cloud.ces.v1beta.IEvaluationConfig=} [properties] Properties to set - */ - function EvaluationConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluationConfig inputAudioConfig. - * @member {google.cloud.ces.v1beta.IInputAudioConfig|null|undefined} inputAudioConfig - * @memberof google.cloud.ces.v1beta.EvaluationConfig - * @instance - */ - EvaluationConfig.prototype.inputAudioConfig = null; - - /** - * EvaluationConfig outputAudioConfig. - * @member {google.cloud.ces.v1beta.IOutputAudioConfig|null|undefined} outputAudioConfig - * @memberof google.cloud.ces.v1beta.EvaluationConfig - * @instance - */ - EvaluationConfig.prototype.outputAudioConfig = null; - - /** - * EvaluationConfig evaluationChannel. - * @member {google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel} evaluationChannel - * @memberof google.cloud.ces.v1beta.EvaluationConfig - * @instance - */ - EvaluationConfig.prototype.evaluationChannel = 0; - - /** - * EvaluationConfig toolCallBehaviour. - * @member {google.cloud.ces.v1beta.EvaluationToolCallBehaviour} toolCallBehaviour - * @memberof google.cloud.ces.v1beta.EvaluationConfig - * @instance - */ - EvaluationConfig.prototype.toolCallBehaviour = 0; - - /** - * Creates a new EvaluationConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationConfig - * @static - * @param {google.cloud.ces.v1beta.IEvaluationConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationConfig} EvaluationConfig instance - */ - EvaluationConfig.create = function create(properties) { - return new EvaluationConfig(properties); - }; - - /** - * Encodes the specified EvaluationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationConfig - * @static - * @param {google.cloud.ces.v1beta.IEvaluationConfig} message EvaluationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputAudioConfig != null && Object.hasOwnProperty.call(message, "inputAudioConfig")) - $root.google.cloud.ces.v1beta.InputAudioConfig.encode(message.inputAudioConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) - $root.google.cloud.ces.v1beta.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.evaluationChannel != null && Object.hasOwnProperty.call(message, "evaluationChannel")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.evaluationChannel); - if (message.toolCallBehaviour != null && Object.hasOwnProperty.call(message, "toolCallBehaviour")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.toolCallBehaviour); - return writer; - }; - - /** - * Encodes the specified EvaluationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationConfig - * @static - * @param {google.cloud.ces.v1beta.IEvaluationConfig} message EvaluationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluationConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationConfig} EvaluationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.inputAudioConfig = $root.google.cloud.ces.v1beta.InputAudioConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.outputAudioConfig = $root.google.cloud.ces.v1beta.OutputAudioConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.evaluationChannel = reader.int32(); - break; - } - case 4: { - message.toolCallBehaviour = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluationConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationConfig} EvaluationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluationConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluationConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inputAudioConfig != null && message.hasOwnProperty("inputAudioConfig")) { - var error = $root.google.cloud.ces.v1beta.InputAudioConfig.verify(message.inputAudioConfig); - if (error) - return "inputAudioConfig." + error; - } - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { - var error = $root.google.cloud.ces.v1beta.OutputAudioConfig.verify(message.outputAudioConfig); - if (error) - return "outputAudioConfig." + error; - } - if (message.evaluationChannel != null && message.hasOwnProperty("evaluationChannel")) - switch (message.evaluationChannel) { - default: - return "evaluationChannel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.toolCallBehaviour != null && message.hasOwnProperty("toolCallBehaviour")) - switch (message.toolCallBehaviour) { - default: - return "toolCallBehaviour: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an EvaluationConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationConfig} EvaluationConfig - */ - EvaluationConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationConfig(); - if (object.inputAudioConfig != null) { - if (typeof object.inputAudioConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationConfig.inputAudioConfig: object expected"); - message.inputAudioConfig = $root.google.cloud.ces.v1beta.InputAudioConfig.fromObject(object.inputAudioConfig); - } - if (object.outputAudioConfig != null) { - if (typeof object.outputAudioConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.EvaluationConfig.outputAudioConfig: object expected"); - message.outputAudioConfig = $root.google.cloud.ces.v1beta.OutputAudioConfig.fromObject(object.outputAudioConfig); - } - switch (object.evaluationChannel) { - default: - if (typeof object.evaluationChannel === "number") { - message.evaluationChannel = object.evaluationChannel; - break; - } - break; - case "EVALUATION_CHANNEL_UNSPECIFIED": - case 0: - message.evaluationChannel = 0; - break; - case "TEXT": - case 1: - message.evaluationChannel = 1; - break; - case "AUDIO": - case 2: - message.evaluationChannel = 2; - break; - } - switch (object.toolCallBehaviour) { - default: - if (typeof object.toolCallBehaviour === "number") { - message.toolCallBehaviour = object.toolCallBehaviour; - break; - } - break; - case "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED": - case 0: - message.toolCallBehaviour = 0; - break; - case "REAL": - case 1: - message.toolCallBehaviour = 1; - break; - case "FAKE": - case 2: - message.toolCallBehaviour = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an EvaluationConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationConfig - * @static - * @param {google.cloud.ces.v1beta.EvaluationConfig} message EvaluationConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluationConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.inputAudioConfig = null; - object.outputAudioConfig = null; - object.evaluationChannel = options.enums === String ? "EVALUATION_CHANNEL_UNSPECIFIED" : 0; - object.toolCallBehaviour = options.enums === String ? "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED" : 0; - } - if (message.inputAudioConfig != null && message.hasOwnProperty("inputAudioConfig")) - object.inputAudioConfig = $root.google.cloud.ces.v1beta.InputAudioConfig.toObject(message.inputAudioConfig, options); - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) - object.outputAudioConfig = $root.google.cloud.ces.v1beta.OutputAudioConfig.toObject(message.outputAudioConfig, options); - if (message.evaluationChannel != null && message.hasOwnProperty("evaluationChannel")) - object.evaluationChannel = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel[message.evaluationChannel] === undefined ? message.evaluationChannel : $root.google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel[message.evaluationChannel] : message.evaluationChannel; - if (message.toolCallBehaviour != null && message.hasOwnProperty("toolCallBehaviour")) - object.toolCallBehaviour = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationToolCallBehaviour[message.toolCallBehaviour] === undefined ? message.toolCallBehaviour : $root.google.cloud.ces.v1beta.EvaluationToolCallBehaviour[message.toolCallBehaviour] : message.toolCallBehaviour; - return object; - }; - - /** - * Converts this EvaluationConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationConfig - * @instance - * @returns {Object.} JSON object - */ - EvaluationConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluationConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationConfig"; - }; - - /** - * EvaluationChannel enum. - * @name google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel - * @enum {number} - * @property {number} EVALUATION_CHANNEL_UNSPECIFIED=0 EVALUATION_CHANNEL_UNSPECIFIED value - * @property {number} TEXT=1 TEXT value - * @property {number} AUDIO=2 AUDIO value - */ - EvaluationConfig.EvaluationChannel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EVALUATION_CHANNEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "TEXT"] = 1; - values[valuesById[2] = "AUDIO"] = 2; - return values; - })(); - - return EvaluationConfig; - })(); - - v1beta.EvaluationErrorInfo = (function() { - - /** - * Properties of an EvaluationErrorInfo. - * @memberof google.cloud.ces.v1beta - * @interface IEvaluationErrorInfo - * @property {google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType|null} [errorType] EvaluationErrorInfo errorType - * @property {string|null} [errorMessage] EvaluationErrorInfo errorMessage - * @property {string|null} [sessionId] EvaluationErrorInfo sessionId - */ - - /** - * Constructs a new EvaluationErrorInfo. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an EvaluationErrorInfo. - * @implements IEvaluationErrorInfo - * @constructor - * @param {google.cloud.ces.v1beta.IEvaluationErrorInfo=} [properties] Properties to set - */ - function EvaluationErrorInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluationErrorInfo errorType. - * @member {google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType} errorType - * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo - * @instance - */ - EvaluationErrorInfo.prototype.errorType = 0; - - /** - * EvaluationErrorInfo errorMessage. - * @member {string} errorMessage - * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo - * @instance - */ - EvaluationErrorInfo.prototype.errorMessage = ""; - - /** - * EvaluationErrorInfo sessionId. - * @member {string} sessionId - * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo - * @instance - */ - EvaluationErrorInfo.prototype.sessionId = ""; - - /** - * Creates a new EvaluationErrorInfo instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo - * @static - * @param {google.cloud.ces.v1beta.IEvaluationErrorInfo=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EvaluationErrorInfo} EvaluationErrorInfo instance - */ - EvaluationErrorInfo.create = function create(properties) { - return new EvaluationErrorInfo(properties); - }; - - /** - * Encodes the specified EvaluationErrorInfo message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationErrorInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo - * @static - * @param {google.cloud.ces.v1beta.IEvaluationErrorInfo} message EvaluationErrorInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationErrorInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.errorType != null && Object.hasOwnProperty.call(message, "errorType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.errorType); - if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessage); - if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.sessionId); - return writer; - }; - - /** - * Encodes the specified EvaluationErrorInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationErrorInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo - * @static - * @param {google.cloud.ces.v1beta.IEvaluationErrorInfo} message EvaluationErrorInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationErrorInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluationErrorInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EvaluationErrorInfo} EvaluationErrorInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationErrorInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationErrorInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.errorType = reader.int32(); - break; - } - case 2: { - message.errorMessage = reader.string(); - break; - } - case 3: { - message.sessionId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluationErrorInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EvaluationErrorInfo} EvaluationErrorInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationErrorInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluationErrorInfo message. - * @function verify - * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluationErrorInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.errorType != null && message.hasOwnProperty("errorType")) - switch (message.errorType) { - default: - return "errorType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) - if (!$util.isString(message.errorMessage)) - return "errorMessage: string expected"; - if (message.sessionId != null && message.hasOwnProperty("sessionId")) - if (!$util.isString(message.sessionId)) - return "sessionId: string expected"; - return null; - }; - - /** - * Creates an EvaluationErrorInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EvaluationErrorInfo} EvaluationErrorInfo - */ - EvaluationErrorInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EvaluationErrorInfo) - return object; - var message = new $root.google.cloud.ces.v1beta.EvaluationErrorInfo(); - switch (object.errorType) { - default: - if (typeof object.errorType === "number") { - message.errorType = object.errorType; - break; - } - break; - case "ERROR_TYPE_UNSPECIFIED": - case 0: - message.errorType = 0; - break; - case "RUNTIME_FAILURE": - case 1: - message.errorType = 1; - break; - case "CONVERSATION_RETRIEVAL_FAILURE": - case 2: - message.errorType = 2; - break; - case "METRIC_CALCULATION_FAILURE": - case 3: - message.errorType = 3; - break; - case "EVALUATION_UPDATE_FAILURE": - case 4: - message.errorType = 4; - break; - case "QUOTA_EXHAUSTED": - case 5: - message.errorType = 5; - break; - case "USER_SIMULATION_FAILURE": - case 6: - message.errorType = 6; - break; - } - if (object.errorMessage != null) - message.errorMessage = String(object.errorMessage); - if (object.sessionId != null) - message.sessionId = String(object.sessionId); - return message; - }; - - /** - * Creates a plain object from an EvaluationErrorInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo - * @static - * @param {google.cloud.ces.v1beta.EvaluationErrorInfo} message EvaluationErrorInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluationErrorInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.errorType = options.enums === String ? "ERROR_TYPE_UNSPECIFIED" : 0; - object.errorMessage = ""; - object.sessionId = ""; - } - if (message.errorType != null && message.hasOwnProperty("errorType")) - object.errorType = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType[message.errorType] === undefined ? message.errorType : $root.google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType[message.errorType] : message.errorType; - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) - object.errorMessage = message.errorMessage; - if (message.sessionId != null && message.hasOwnProperty("sessionId")) - object.sessionId = message.sessionId; - return object; - }; - - /** - * Converts this EvaluationErrorInfo to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo - * @instance - * @returns {Object.} JSON object - */ - EvaluationErrorInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluationErrorInfo - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluationErrorInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationErrorInfo"; - }; - - /** - * ErrorType enum. - * @name google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType - * @enum {number} - * @property {number} ERROR_TYPE_UNSPECIFIED=0 ERROR_TYPE_UNSPECIFIED value - * @property {number} RUNTIME_FAILURE=1 RUNTIME_FAILURE value - * @property {number} CONVERSATION_RETRIEVAL_FAILURE=2 CONVERSATION_RETRIEVAL_FAILURE value - * @property {number} METRIC_CALCULATION_FAILURE=3 METRIC_CALCULATION_FAILURE value - * @property {number} EVALUATION_UPDATE_FAILURE=4 EVALUATION_UPDATE_FAILURE value - * @property {number} QUOTA_EXHAUSTED=5 QUOTA_EXHAUSTED value - * @property {number} USER_SIMULATION_FAILURE=6 USER_SIMULATION_FAILURE value - */ - EvaluationErrorInfo.ErrorType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ERROR_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RUNTIME_FAILURE"] = 1; - values[valuesById[2] = "CONVERSATION_RETRIEVAL_FAILURE"] = 2; - values[valuesById[3] = "METRIC_CALCULATION_FAILURE"] = 3; - values[valuesById[4] = "EVALUATION_UPDATE_FAILURE"] = 4; - values[valuesById[5] = "QUOTA_EXHAUSTED"] = 5; - values[valuesById[6] = "USER_SIMULATION_FAILURE"] = 6; - return values; - })(); - - return EvaluationErrorInfo; - })(); - - v1beta.RunEvaluationRequest = (function() { - - /** - * Properties of a RunEvaluationRequest. - * @memberof google.cloud.ces.v1beta - * @interface IRunEvaluationRequest - * @property {string|null} [app] RunEvaluationRequest app - * @property {Array.|null} [evaluations] RunEvaluationRequest evaluations - * @property {string|null} [evaluationDataset] RunEvaluationRequest evaluationDataset - * @property {string|null} [displayName] RunEvaluationRequest displayName - * @property {string|null} [appVersion] RunEvaluationRequest appVersion - * @property {google.cloud.ces.v1beta.IEvaluationConfig|null} [config] RunEvaluationRequest config - * @property {number|null} [runCount] RunEvaluationRequest runCount - * @property {Array.|null} [personaRunConfigs] RunEvaluationRequest personaRunConfigs - * @property {google.cloud.ces.v1beta.IOptimizationConfig|null} [optimizationConfig] RunEvaluationRequest optimizationConfig - * @property {string|null} [scheduledEvaluationRun] RunEvaluationRequest scheduledEvaluationRun - * @property {google.cloud.ces.v1beta.GoldenRunMethod|null} [goldenRunMethod] RunEvaluationRequest goldenRunMethod - * @property {boolean|null} [generateLatencyReport] RunEvaluationRequest generateLatencyReport - */ - - /** - * Constructs a new RunEvaluationRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a RunEvaluationRequest. - * @implements IRunEvaluationRequest - * @constructor - * @param {google.cloud.ces.v1beta.IRunEvaluationRequest=} [properties] Properties to set - */ - function RunEvaluationRequest(properties) { - this.evaluations = []; - this.personaRunConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RunEvaluationRequest app. - * @member {string} app - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @instance - */ - RunEvaluationRequest.prototype.app = ""; - - /** - * RunEvaluationRequest evaluations. - * @member {Array.} evaluations - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @instance - */ - RunEvaluationRequest.prototype.evaluations = $util.emptyArray; - - /** - * RunEvaluationRequest evaluationDataset. - * @member {string} evaluationDataset - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @instance - */ - RunEvaluationRequest.prototype.evaluationDataset = ""; - - /** - * RunEvaluationRequest displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @instance - */ - RunEvaluationRequest.prototype.displayName = ""; - - /** - * RunEvaluationRequest appVersion. - * @member {string} appVersion - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @instance - */ - RunEvaluationRequest.prototype.appVersion = ""; - - /** - * RunEvaluationRequest config. - * @member {google.cloud.ces.v1beta.IEvaluationConfig|null|undefined} config - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @instance - */ - RunEvaluationRequest.prototype.config = null; - - /** - * RunEvaluationRequest runCount. - * @member {number|null|undefined} runCount - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @instance - */ - RunEvaluationRequest.prototype.runCount = null; - - /** - * RunEvaluationRequest personaRunConfigs. - * @member {Array.} personaRunConfigs - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @instance - */ - RunEvaluationRequest.prototype.personaRunConfigs = $util.emptyArray; - - /** - * RunEvaluationRequest optimizationConfig. - * @member {google.cloud.ces.v1beta.IOptimizationConfig|null|undefined} optimizationConfig - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @instance - */ - RunEvaluationRequest.prototype.optimizationConfig = null; - - /** - * RunEvaluationRequest scheduledEvaluationRun. - * @member {string} scheduledEvaluationRun - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @instance - */ - RunEvaluationRequest.prototype.scheduledEvaluationRun = ""; - - /** - * RunEvaluationRequest goldenRunMethod. - * @member {google.cloud.ces.v1beta.GoldenRunMethod} goldenRunMethod - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @instance - */ - RunEvaluationRequest.prototype.goldenRunMethod = 0; - - /** - * RunEvaluationRequest generateLatencyReport. - * @member {boolean} generateLatencyReport - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @instance - */ - RunEvaluationRequest.prototype.generateLatencyReport = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(RunEvaluationRequest.prototype, "_runCount", { - get: $util.oneOfGetter($oneOfFields = ["runCount"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RunEvaluationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.IRunEvaluationRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.RunEvaluationRequest} RunEvaluationRequest instance - */ - RunEvaluationRequest.create = function create(properties) { - return new RunEvaluationRequest(properties); - }; - - /** - * Encodes the specified RunEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.IRunEvaluationRequest} message RunEvaluationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunEvaluationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.app != null && Object.hasOwnProperty.call(message, "app")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.app); - if (message.evaluations != null && message.evaluations.length) - for (var i = 0; i < message.evaluations.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluations[i]); - if (message.evaluationDataset != null && Object.hasOwnProperty.call(message, "evaluationDataset")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.evaluationDataset); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); - if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.appVersion); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.cloud.ces.v1beta.EvaluationConfig.encode(message.config, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.runCount != null && Object.hasOwnProperty.call(message, "runCount")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.runCount); - if (message.personaRunConfigs != null && message.personaRunConfigs.length) - for (var i = 0; i < message.personaRunConfigs.length; ++i) - $root.google.cloud.ces.v1beta.PersonaRunConfig.encode(message.personaRunConfigs[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.optimizationConfig != null && Object.hasOwnProperty.call(message, "optimizationConfig")) - $root.google.cloud.ces.v1beta.OptimizationConfig.encode(message.optimizationConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.scheduledEvaluationRun != null && Object.hasOwnProperty.call(message, "scheduledEvaluationRun")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.scheduledEvaluationRun); - if (message.goldenRunMethod != null && Object.hasOwnProperty.call(message, "goldenRunMethod")) - writer.uint32(/* id 13, wireType 0 =*/104).int32(message.goldenRunMethod); - if (message.generateLatencyReport != null && Object.hasOwnProperty.call(message, "generateLatencyReport")) - writer.uint32(/* id 14, wireType 0 =*/112).bool(message.generateLatencyReport); - return writer; - }; - - /** - * Encodes the specified RunEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.IRunEvaluationRequest} message RunEvaluationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RunEvaluationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.RunEvaluationRequest} RunEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunEvaluationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RunEvaluationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.app = reader.string(); - break; - } - case 2: { - if (!(message.evaluations && message.evaluations.length)) - message.evaluations = []; - message.evaluations.push(reader.string()); - break; - } - case 3: { - message.evaluationDataset = reader.string(); - break; - } - case 4: { - message.displayName = reader.string(); - break; - } - case 6: { - message.appVersion = reader.string(); - break; - } - case 8: { - message.config = $root.google.cloud.ces.v1beta.EvaluationConfig.decode(reader, reader.uint32()); - break; - } - case 9: { - message.runCount = reader.int32(); - break; - } - case 10: { - if (!(message.personaRunConfigs && message.personaRunConfigs.length)) - message.personaRunConfigs = []; - message.personaRunConfigs.push($root.google.cloud.ces.v1beta.PersonaRunConfig.decode(reader, reader.uint32())); - break; - } - case 11: { - message.optimizationConfig = $root.google.cloud.ces.v1beta.OptimizationConfig.decode(reader, reader.uint32()); - break; - } - case 12: { - message.scheduledEvaluationRun = reader.string(); - break; - } - case 13: { - message.goldenRunMethod = reader.int32(); - break; - } - case 14: { - message.generateLatencyReport = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RunEvaluationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.RunEvaluationRequest} RunEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RunEvaluationRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunEvaluationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.app != null && message.hasOwnProperty("app")) - if (!$util.isString(message.app)) - return "app: string expected"; - if (message.evaluations != null && message.hasOwnProperty("evaluations")) { - if (!Array.isArray(message.evaluations)) - return "evaluations: array expected"; - for (var i = 0; i < message.evaluations.length; ++i) - if (!$util.isString(message.evaluations[i])) - return "evaluations: string[] expected"; - } - if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) - if (!$util.isString(message.evaluationDataset)) - return "evaluationDataset: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.appVersion != null && message.hasOwnProperty("appVersion")) - if (!$util.isString(message.appVersion)) - return "appVersion: string expected"; - if (message.config != null && message.hasOwnProperty("config")) { - var error = $root.google.cloud.ces.v1beta.EvaluationConfig.verify(message.config); - if (error) - return "config." + error; - } - if (message.runCount != null && message.hasOwnProperty("runCount")) { - properties._runCount = 1; - if (!$util.isInteger(message.runCount)) - return "runCount: integer expected"; - } - if (message.personaRunConfigs != null && message.hasOwnProperty("personaRunConfigs")) { - if (!Array.isArray(message.personaRunConfigs)) - return "personaRunConfigs: array expected"; - for (var i = 0; i < message.personaRunConfigs.length; ++i) { - var error = $root.google.cloud.ces.v1beta.PersonaRunConfig.verify(message.personaRunConfigs[i]); - if (error) - return "personaRunConfigs." + error; - } - } - if (message.optimizationConfig != null && message.hasOwnProperty("optimizationConfig")) { - var error = $root.google.cloud.ces.v1beta.OptimizationConfig.verify(message.optimizationConfig); - if (error) - return "optimizationConfig." + error; - } - if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) - if (!$util.isString(message.scheduledEvaluationRun)) - return "scheduledEvaluationRun: string expected"; - if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) - switch (message.goldenRunMethod) { - default: - return "goldenRunMethod: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.generateLatencyReport != null && message.hasOwnProperty("generateLatencyReport")) - if (typeof message.generateLatencyReport !== "boolean") - return "generateLatencyReport: boolean expected"; - return null; - }; - - /** - * Creates a RunEvaluationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.RunEvaluationRequest} RunEvaluationRequest - */ - RunEvaluationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.RunEvaluationRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.RunEvaluationRequest(); - if (object.app != null) - message.app = String(object.app); - if (object.evaluations) { - if (!Array.isArray(object.evaluations)) - throw TypeError(".google.cloud.ces.v1beta.RunEvaluationRequest.evaluations: array expected"); - message.evaluations = []; - for (var i = 0; i < object.evaluations.length; ++i) - message.evaluations[i] = String(object.evaluations[i]); - } - if (object.evaluationDataset != null) - message.evaluationDataset = String(object.evaluationDataset); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.appVersion != null) - message.appVersion = String(object.appVersion); - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.ces.v1beta.RunEvaluationRequest.config: object expected"); - message.config = $root.google.cloud.ces.v1beta.EvaluationConfig.fromObject(object.config); - } - if (object.runCount != null) - message.runCount = object.runCount | 0; - if (object.personaRunConfigs) { - if (!Array.isArray(object.personaRunConfigs)) - throw TypeError(".google.cloud.ces.v1beta.RunEvaluationRequest.personaRunConfigs: array expected"); - message.personaRunConfigs = []; - for (var i = 0; i < object.personaRunConfigs.length; ++i) { - if (typeof object.personaRunConfigs[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.RunEvaluationRequest.personaRunConfigs: object expected"); - message.personaRunConfigs[i] = $root.google.cloud.ces.v1beta.PersonaRunConfig.fromObject(object.personaRunConfigs[i]); - } - } - if (object.optimizationConfig != null) { - if (typeof object.optimizationConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.RunEvaluationRequest.optimizationConfig: object expected"); - message.optimizationConfig = $root.google.cloud.ces.v1beta.OptimizationConfig.fromObject(object.optimizationConfig); - } - if (object.scheduledEvaluationRun != null) - message.scheduledEvaluationRun = String(object.scheduledEvaluationRun); - switch (object.goldenRunMethod) { - default: - if (typeof object.goldenRunMethod === "number") { - message.goldenRunMethod = object.goldenRunMethod; - break; - } - break; - case "GOLDEN_RUN_METHOD_UNSPECIFIED": - case 0: - message.goldenRunMethod = 0; - break; - case "STABLE": - case 1: - message.goldenRunMethod = 1; - break; - case "NAIVE": - case 2: - message.goldenRunMethod = 2; - break; - } - if (object.generateLatencyReport != null) - message.generateLatencyReport = Boolean(object.generateLatencyReport); - return message; - }; - - /** - * Creates a plain object from a RunEvaluationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.RunEvaluationRequest} message RunEvaluationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunEvaluationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.evaluations = []; - object.personaRunConfigs = []; - } - if (options.defaults) { - object.app = ""; - object.evaluationDataset = ""; - object.displayName = ""; - object.appVersion = ""; - object.config = null; - object.optimizationConfig = null; - object.scheduledEvaluationRun = ""; - object.goldenRunMethod = options.enums === String ? "GOLDEN_RUN_METHOD_UNSPECIFIED" : 0; - object.generateLatencyReport = false; - } - if (message.app != null && message.hasOwnProperty("app")) - object.app = message.app; - if (message.evaluations && message.evaluations.length) { - object.evaluations = []; - for (var j = 0; j < message.evaluations.length; ++j) - object.evaluations[j] = message.evaluations[j]; - } - if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) - object.evaluationDataset = message.evaluationDataset; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.appVersion != null && message.hasOwnProperty("appVersion")) - object.appVersion = message.appVersion; - if (message.config != null && message.hasOwnProperty("config")) - object.config = $root.google.cloud.ces.v1beta.EvaluationConfig.toObject(message.config, options); - if (message.runCount != null && message.hasOwnProperty("runCount")) { - object.runCount = message.runCount; - if (options.oneofs) - object._runCount = "runCount"; - } - if (message.personaRunConfigs && message.personaRunConfigs.length) { - object.personaRunConfigs = []; - for (var j = 0; j < message.personaRunConfigs.length; ++j) - object.personaRunConfigs[j] = $root.google.cloud.ces.v1beta.PersonaRunConfig.toObject(message.personaRunConfigs[j], options); - } - if (message.optimizationConfig != null && message.hasOwnProperty("optimizationConfig")) - object.optimizationConfig = $root.google.cloud.ces.v1beta.OptimizationConfig.toObject(message.optimizationConfig, options); - if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) - object.scheduledEvaluationRun = message.scheduledEvaluationRun; - if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) - object.goldenRunMethod = options.enums === String ? $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] === undefined ? message.goldenRunMethod : $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] : message.goldenRunMethod; - if (message.generateLatencyReport != null && message.hasOwnProperty("generateLatencyReport")) - object.generateLatencyReport = message.generateLatencyReport; - return object; - }; - - /** - * Converts this RunEvaluationRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @instance - * @returns {Object.} JSON object - */ - RunEvaluationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RunEvaluationRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.RunEvaluationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.RunEvaluationRequest"; - }; - - return RunEvaluationRequest; - })(); - - v1beta.ScheduledEvaluationRun = (function() { - - /** - * Properties of a ScheduledEvaluationRun. - * @memberof google.cloud.ces.v1beta - * @interface IScheduledEvaluationRun - * @property {string|null} [name] ScheduledEvaluationRun name - * @property {string|null} [displayName] ScheduledEvaluationRun displayName - * @property {google.cloud.ces.v1beta.IRunEvaluationRequest|null} [request] ScheduledEvaluationRun request - * @property {string|null} [description] ScheduledEvaluationRun description - * @property {google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig|null} [schedulingConfig] ScheduledEvaluationRun schedulingConfig - * @property {boolean|null} [active] ScheduledEvaluationRun active - * @property {string|null} [lastCompletedRun] ScheduledEvaluationRun lastCompletedRun - * @property {number|null} [totalExecutions] ScheduledEvaluationRun totalExecutions - * @property {google.protobuf.ITimestamp|null} [nextScheduledExecutionTime] ScheduledEvaluationRun nextScheduledExecutionTime - * @property {google.protobuf.ITimestamp|null} [createTime] ScheduledEvaluationRun createTime - * @property {string|null} [createdBy] ScheduledEvaluationRun createdBy - * @property {google.protobuf.ITimestamp|null} [updateTime] ScheduledEvaluationRun updateTime - * @property {string|null} [lastUpdatedBy] ScheduledEvaluationRun lastUpdatedBy - * @property {string|null} [etag] ScheduledEvaluationRun etag - */ - - /** - * Constructs a new ScheduledEvaluationRun. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ScheduledEvaluationRun. - * @implements IScheduledEvaluationRun - * @constructor - * @param {google.cloud.ces.v1beta.IScheduledEvaluationRun=} [properties] Properties to set - */ - function ScheduledEvaluationRun(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ScheduledEvaluationRun name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @instance - */ - ScheduledEvaluationRun.prototype.name = ""; - - /** - * ScheduledEvaluationRun displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @instance - */ - ScheduledEvaluationRun.prototype.displayName = ""; - - /** - * ScheduledEvaluationRun request. - * @member {google.cloud.ces.v1beta.IRunEvaluationRequest|null|undefined} request - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @instance - */ - ScheduledEvaluationRun.prototype.request = null; - - /** - * ScheduledEvaluationRun description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @instance - */ - ScheduledEvaluationRun.prototype.description = ""; - - /** - * ScheduledEvaluationRun schedulingConfig. - * @member {google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig|null|undefined} schedulingConfig - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @instance - */ - ScheduledEvaluationRun.prototype.schedulingConfig = null; - - /** - * ScheduledEvaluationRun active. - * @member {boolean} active - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @instance - */ - ScheduledEvaluationRun.prototype.active = false; - - /** - * ScheduledEvaluationRun lastCompletedRun. - * @member {string} lastCompletedRun - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @instance - */ - ScheduledEvaluationRun.prototype.lastCompletedRun = ""; - - /** - * ScheduledEvaluationRun totalExecutions. - * @member {number} totalExecutions - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @instance - */ - ScheduledEvaluationRun.prototype.totalExecutions = 0; - - /** - * ScheduledEvaluationRun nextScheduledExecutionTime. - * @member {google.protobuf.ITimestamp|null|undefined} nextScheduledExecutionTime - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @instance - */ - ScheduledEvaluationRun.prototype.nextScheduledExecutionTime = null; - - /** - * ScheduledEvaluationRun createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @instance - */ - ScheduledEvaluationRun.prototype.createTime = null; - - /** - * ScheduledEvaluationRun createdBy. - * @member {string} createdBy - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @instance - */ - ScheduledEvaluationRun.prototype.createdBy = ""; - - /** - * ScheduledEvaluationRun updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @instance - */ - ScheduledEvaluationRun.prototype.updateTime = null; - - /** - * ScheduledEvaluationRun lastUpdatedBy. - * @member {string} lastUpdatedBy - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @instance - */ - ScheduledEvaluationRun.prototype.lastUpdatedBy = ""; - - /** - * ScheduledEvaluationRun etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @instance - */ - ScheduledEvaluationRun.prototype.etag = ""; - - /** - * Creates a new ScheduledEvaluationRun instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @static - * @param {google.cloud.ces.v1beta.IScheduledEvaluationRun=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun} ScheduledEvaluationRun instance - */ - ScheduledEvaluationRun.create = function create(properties) { - return new ScheduledEvaluationRun(properties); - }; - - /** - * Encodes the specified ScheduledEvaluationRun message. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @static - * @param {google.cloud.ces.v1beta.IScheduledEvaluationRun} message ScheduledEvaluationRun message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScheduledEvaluationRun.encode = function encode(message, writer) { - if (!writer) - 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.request != null && Object.hasOwnProperty.call(message, "request")) - $root.google.cloud.ces.v1beta.RunEvaluationRequest.encode(message.request, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); - if (message.schedulingConfig != null && Object.hasOwnProperty.call(message, "schedulingConfig")) - $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.encode(message.schedulingConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.active != null && Object.hasOwnProperty.call(message, "active")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.active); - if (message.lastCompletedRun != null && Object.hasOwnProperty.call(message, "lastCompletedRun")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.lastCompletedRun); - if (message.totalExecutions != null && Object.hasOwnProperty.call(message, "totalExecutions")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.totalExecutions); - if (message.nextScheduledExecutionTime != null && Object.hasOwnProperty.call(message, "nextScheduledExecutionTime")) - $root.google.protobuf.Timestamp.encode(message.nextScheduledExecutionTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.createdBy != null && Object.hasOwnProperty.call(message, "createdBy")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.createdBy); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.lastUpdatedBy != null && Object.hasOwnProperty.call(message, "lastUpdatedBy")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.lastUpdatedBy); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); - return writer; - }; - - /** - * Encodes the specified ScheduledEvaluationRun message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @static - * @param {google.cloud.ces.v1beta.IScheduledEvaluationRun} message ScheduledEvaluationRun message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScheduledEvaluationRun.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ScheduledEvaluationRun message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun} ScheduledEvaluationRun - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScheduledEvaluationRun.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ScheduledEvaluationRun(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.request = $root.google.cloud.ces.v1beta.RunEvaluationRequest.decode(reader, reader.uint32()); - break; - } - case 4: { - message.description = reader.string(); - break; - } - case 5: { - message.schedulingConfig = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.active = reader.bool(); - break; - } - case 7: { - message.lastCompletedRun = reader.string(); - break; - } - case 8: { - message.totalExecutions = reader.int32(); - break; - } - case 9: { - message.nextScheduledExecutionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.createdBy = reader.string(); - break; - } - case 12: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 13: { - message.lastUpdatedBy = reader.string(); - break; - } - case 14: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ScheduledEvaluationRun message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun} ScheduledEvaluationRun - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScheduledEvaluationRun.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ScheduledEvaluationRun message. - * @function verify - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ScheduledEvaluationRun.verify = function verify(message) { - if (typeof message !== "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.request != null && message.hasOwnProperty("request")) { - var error = $root.google.cloud.ces.v1beta.RunEvaluationRequest.verify(message.request); - if (error) - return "request." + error; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.schedulingConfig != null && message.hasOwnProperty("schedulingConfig")) { - var error = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.verify(message.schedulingConfig); - if (error) - return "schedulingConfig." + error; - } - if (message.active != null && message.hasOwnProperty("active")) - if (typeof message.active !== "boolean") - return "active: boolean expected"; - if (message.lastCompletedRun != null && message.hasOwnProperty("lastCompletedRun")) - if (!$util.isString(message.lastCompletedRun)) - return "lastCompletedRun: string expected"; - if (message.totalExecutions != null && message.hasOwnProperty("totalExecutions")) - if (!$util.isInteger(message.totalExecutions)) - return "totalExecutions: integer expected"; - if (message.nextScheduledExecutionTime != null && message.hasOwnProperty("nextScheduledExecutionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.nextScheduledExecutionTime); - if (error) - return "nextScheduledExecutionTime." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.createdBy != null && message.hasOwnProperty("createdBy")) - if (!$util.isString(message.createdBy)) - return "createdBy: string expected"; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.lastUpdatedBy != null && message.hasOwnProperty("lastUpdatedBy")) - if (!$util.isString(message.lastUpdatedBy)) - return "lastUpdatedBy: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a ScheduledEvaluationRun message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun} ScheduledEvaluationRun - */ - ScheduledEvaluationRun.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ScheduledEvaluationRun) - return object; - var message = new $root.google.cloud.ces.v1beta.ScheduledEvaluationRun(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.request != null) { - if (typeof object.request !== "object") - throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.request: object expected"); - message.request = $root.google.cloud.ces.v1beta.RunEvaluationRequest.fromObject(object.request); - } - if (object.description != null) - message.description = String(object.description); - if (object.schedulingConfig != null) { - if (typeof object.schedulingConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.schedulingConfig: object expected"); - message.schedulingConfig = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.fromObject(object.schedulingConfig); - } - if (object.active != null) - message.active = Boolean(object.active); - if (object.lastCompletedRun != null) - message.lastCompletedRun = String(object.lastCompletedRun); - if (object.totalExecutions != null) - message.totalExecutions = object.totalExecutions | 0; - if (object.nextScheduledExecutionTime != null) { - if (typeof object.nextScheduledExecutionTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.nextScheduledExecutionTime: object expected"); - message.nextScheduledExecutionTime = $root.google.protobuf.Timestamp.fromObject(object.nextScheduledExecutionTime); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.createdBy != null) - message.createdBy = String(object.createdBy); - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.lastUpdatedBy != null) - message.lastUpdatedBy = String(object.lastUpdatedBy); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a ScheduledEvaluationRun message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @static - * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun} message ScheduledEvaluationRun - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ScheduledEvaluationRun.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.request = null; - object.description = ""; - object.schedulingConfig = null; - object.active = false; - object.lastCompletedRun = ""; - object.totalExecutions = 0; - object.nextScheduledExecutionTime = null; - object.createTime = null; - object.createdBy = ""; - object.updateTime = null; - object.lastUpdatedBy = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.request != null && message.hasOwnProperty("request")) - object.request = $root.google.cloud.ces.v1beta.RunEvaluationRequest.toObject(message.request, options); - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.schedulingConfig != null && message.hasOwnProperty("schedulingConfig")) - object.schedulingConfig = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.toObject(message.schedulingConfig, options); - if (message.active != null && message.hasOwnProperty("active")) - object.active = message.active; - if (message.lastCompletedRun != null && message.hasOwnProperty("lastCompletedRun")) - object.lastCompletedRun = message.lastCompletedRun; - if (message.totalExecutions != null && message.hasOwnProperty("totalExecutions")) - object.totalExecutions = message.totalExecutions; - if (message.nextScheduledExecutionTime != null && message.hasOwnProperty("nextScheduledExecutionTime")) - object.nextScheduledExecutionTime = $root.google.protobuf.Timestamp.toObject(message.nextScheduledExecutionTime, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.createdBy != null && message.hasOwnProperty("createdBy")) - object.createdBy = message.createdBy; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.lastUpdatedBy != null && message.hasOwnProperty("lastUpdatedBy")) - object.lastUpdatedBy = message.lastUpdatedBy; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this ScheduledEvaluationRun to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @instance - * @returns {Object.} JSON object - */ - ScheduledEvaluationRun.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ScheduledEvaluationRun - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ScheduledEvaluationRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ScheduledEvaluationRun"; - }; - - ScheduledEvaluationRun.SchedulingConfig = (function() { - - /** - * Properties of a SchedulingConfig. - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @interface ISchedulingConfig - * @property {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency|null} [frequency] SchedulingConfig frequency - * @property {google.protobuf.ITimestamp|null} [startTime] SchedulingConfig startTime - * @property {Array.|null} [daysOfWeek] SchedulingConfig daysOfWeek - */ - - /** - * Constructs a new SchedulingConfig. - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun - * @classdesc Represents a SchedulingConfig. - * @implements ISchedulingConfig - * @constructor - * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig=} [properties] Properties to set - */ - function SchedulingConfig(properties) { - 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]]; - } - - /** - * SchedulingConfig frequency. - * @member {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency} frequency - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig - * @instance - */ - SchedulingConfig.prototype.frequency = 0; - - /** - * SchedulingConfig startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig - * @instance - */ - SchedulingConfig.prototype.startTime = null; - - /** - * SchedulingConfig daysOfWeek. - * @member {Array.} daysOfWeek - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig - * @instance - */ - SchedulingConfig.prototype.daysOfWeek = $util.emptyArray; - - /** - * Creates a new SchedulingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig - * @static - * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig} SchedulingConfig instance - */ - SchedulingConfig.create = function create(properties) { - return new SchedulingConfig(properties); - }; - - /** - * Encodes the specified SchedulingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig - * @static - * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig} message SchedulingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SchedulingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.frequency != null && Object.hasOwnProperty.call(message, "frequency")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.frequency); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.daysOfWeek != null && message.daysOfWeek.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.daysOfWeek.length; ++i) - writer.int32(message.daysOfWeek[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified SchedulingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig - * @static - * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig} message SchedulingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SchedulingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SchedulingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig} SchedulingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SchedulingConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.frequency = reader.int32(); - break; - } - case 2: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - 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 SchedulingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig} SchedulingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SchedulingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SchedulingConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SchedulingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.frequency != null && message.hasOwnProperty("frequency")) - switch (message.frequency) { - default: - return "frequency: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + 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) - if (!$util.isInteger(message.daysOfWeek[i])) - return "daysOfWeek: integer[] expected"; - } - return null; - }; - - /** - * Creates a SchedulingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig} SchedulingConfig - */ - SchedulingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig(); - switch (object.frequency) { - default: - if (typeof object.frequency === "number") { - message.frequency = object.frequency; - break; - } - break; - case "FREQUENCY_UNSPECIFIED": - case 0: - message.frequency = 0; - break; - case "NONE": - case 1: - message.frequency = 1; - break; - case "DAILY": - case 2: - message.frequency = 2; - break; - case "WEEKLY": - case 3: - message.frequency = 3; - break; - case "BIWEEKLY": - case 4: - message.frequency = 4; - break; - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.daysOfWeek) { - if (!Array.isArray(object.daysOfWeek)) - throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.daysOfWeek: array expected"); - message.daysOfWeek = []; - for (var i = 0; i < object.daysOfWeek.length; ++i) - message.daysOfWeek[i] = object.daysOfWeek[i] | 0; - } - return message; - }; - - /** - * Creates a plain object from a SchedulingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig - * @static - * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig} message SchedulingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SchedulingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.daysOfWeek = []; - if (options.defaults) { - object.frequency = options.enums === String ? "FREQUENCY_UNSPECIFIED" : 0; - object.startTime = null; - } - if (message.frequency != null && message.hasOwnProperty("frequency")) - object.frequency = options.enums === String ? $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency[message.frequency] === undefined ? message.frequency : $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency[message.frequency] : message.frequency; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.daysOfWeek && message.daysOfWeek.length) { - object.daysOfWeek = []; - for (var j = 0; j < message.daysOfWeek.length; ++j) - object.daysOfWeek[j] = message.daysOfWeek[j]; - } - return object; - }; - - /** - * Converts this SchedulingConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig - * @instance - * @returns {Object.} JSON object - */ - SchedulingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SchedulingConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SchedulingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig"; - }; - - /** - * Frequency enum. - * @name google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency - * @enum {number} - * @property {number} FREQUENCY_UNSPECIFIED=0 FREQUENCY_UNSPECIFIED value - * @property {number} NONE=1 NONE value - * @property {number} DAILY=2 DAILY value - * @property {number} WEEKLY=3 WEEKLY value - * @property {number} BIWEEKLY=4 BIWEEKLY value - */ - SchedulingConfig.Frequency = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FREQUENCY_UNSPECIFIED"] = 0; - values[valuesById[1] = "NONE"] = 1; - values[valuesById[2] = "DAILY"] = 2; - values[valuesById[3] = "WEEKLY"] = 3; - values[valuesById[4] = "BIWEEKLY"] = 4; - return values; - })(); - - return SchedulingConfig; - })(); - - return ScheduledEvaluationRun; - })(); - - v1beta.PersonaRunConfig = (function() { - - /** - * Properties of a PersonaRunConfig. - * @memberof google.cloud.ces.v1beta - * @interface IPersonaRunConfig - * @property {string|null} [persona] PersonaRunConfig persona - * @property {number|null} [taskCount] PersonaRunConfig taskCount - */ - - /** - * Constructs a new PersonaRunConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a PersonaRunConfig. - * @implements IPersonaRunConfig - * @constructor - * @param {google.cloud.ces.v1beta.IPersonaRunConfig=} [properties] Properties to set - */ - function PersonaRunConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PersonaRunConfig persona. - * @member {string} persona - * @memberof google.cloud.ces.v1beta.PersonaRunConfig - * @instance - */ - PersonaRunConfig.prototype.persona = ""; - - /** - * PersonaRunConfig taskCount. - * @member {number} taskCount - * @memberof google.cloud.ces.v1beta.PersonaRunConfig - * @instance - */ - PersonaRunConfig.prototype.taskCount = 0; - - /** - * Creates a new PersonaRunConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.PersonaRunConfig - * @static - * @param {google.cloud.ces.v1beta.IPersonaRunConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.PersonaRunConfig} PersonaRunConfig instance - */ - PersonaRunConfig.create = function create(properties) { - return new PersonaRunConfig(properties); - }; - - /** - * Encodes the specified PersonaRunConfig message. Does not implicitly {@link google.cloud.ces.v1beta.PersonaRunConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.PersonaRunConfig - * @static - * @param {google.cloud.ces.v1beta.IPersonaRunConfig} message PersonaRunConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PersonaRunConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.persona != null && Object.hasOwnProperty.call(message, "persona")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.persona); - if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.taskCount); - return writer; - }; - - /** - * Encodes the specified PersonaRunConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.PersonaRunConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.PersonaRunConfig - * @static - * @param {google.cloud.ces.v1beta.IPersonaRunConfig} message PersonaRunConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PersonaRunConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PersonaRunConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.PersonaRunConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.PersonaRunConfig} PersonaRunConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PersonaRunConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.PersonaRunConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.persona = reader.string(); - break; - } - case 2: { - message.taskCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PersonaRunConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.PersonaRunConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.PersonaRunConfig} PersonaRunConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PersonaRunConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PersonaRunConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.PersonaRunConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PersonaRunConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.persona != null && message.hasOwnProperty("persona")) - if (!$util.isString(message.persona)) - return "persona: string expected"; - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - if (!$util.isInteger(message.taskCount)) - return "taskCount: integer expected"; - return null; - }; - - /** - * Creates a PersonaRunConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.PersonaRunConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.PersonaRunConfig} PersonaRunConfig - */ - PersonaRunConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.PersonaRunConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.PersonaRunConfig(); - if (object.persona != null) - message.persona = String(object.persona); - if (object.taskCount != null) - message.taskCount = object.taskCount | 0; - return message; - }; - - /** - * Creates a plain object from a PersonaRunConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.PersonaRunConfig - * @static - * @param {google.cloud.ces.v1beta.PersonaRunConfig} message PersonaRunConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PersonaRunConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.persona = ""; - object.taskCount = 0; - } - if (message.persona != null && message.hasOwnProperty("persona")) - object.persona = message.persona; - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - object.taskCount = message.taskCount; - return object; - }; - - /** - * Converts this PersonaRunConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.PersonaRunConfig - * @instance - * @returns {Object.} JSON object - */ - PersonaRunConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PersonaRunConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.PersonaRunConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PersonaRunConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.PersonaRunConfig"; - }; - - return PersonaRunConfig; - })(); - - v1beta.OptimizationConfig = (function() { - - /** - * Properties of an OptimizationConfig. - * @memberof google.cloud.ces.v1beta - * @interface IOptimizationConfig - * @property {boolean|null} [generateLossReport] OptimizationConfig generateLossReport - * @property {string|null} [assistantSession] OptimizationConfig assistantSession - * @property {string|null} [reportSummary] OptimizationConfig reportSummary - * @property {boolean|null} [shouldSuggestFix] OptimizationConfig shouldSuggestFix - * @property {google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus|null} [status] OptimizationConfig status - * @property {string|null} [errorMessage] OptimizationConfig errorMessage - * @property {google.protobuf.IStruct|null} [lossReport] OptimizationConfig lossReport - */ - - /** - * Constructs a new OptimizationConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an OptimizationConfig. - * @implements IOptimizationConfig - * @constructor - * @param {google.cloud.ces.v1beta.IOptimizationConfig=} [properties] Properties to set - */ - function OptimizationConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OptimizationConfig generateLossReport. - * @member {boolean} generateLossReport - * @memberof google.cloud.ces.v1beta.OptimizationConfig - * @instance - */ - OptimizationConfig.prototype.generateLossReport = false; - - /** - * OptimizationConfig assistantSession. - * @member {string} assistantSession - * @memberof google.cloud.ces.v1beta.OptimizationConfig - * @instance - */ - OptimizationConfig.prototype.assistantSession = ""; - - /** - * OptimizationConfig reportSummary. - * @member {string} reportSummary - * @memberof google.cloud.ces.v1beta.OptimizationConfig - * @instance - */ - OptimizationConfig.prototype.reportSummary = ""; - - /** - * OptimizationConfig shouldSuggestFix. - * @member {boolean} shouldSuggestFix - * @memberof google.cloud.ces.v1beta.OptimizationConfig - * @instance - */ - OptimizationConfig.prototype.shouldSuggestFix = false; - - /** - * OptimizationConfig status. - * @member {google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus} status - * @memberof google.cloud.ces.v1beta.OptimizationConfig - * @instance - */ - OptimizationConfig.prototype.status = 0; - - /** - * OptimizationConfig errorMessage. - * @member {string} errorMessage - * @memberof google.cloud.ces.v1beta.OptimizationConfig - * @instance - */ - OptimizationConfig.prototype.errorMessage = ""; - - /** - * OptimizationConfig lossReport. - * @member {google.protobuf.IStruct|null|undefined} lossReport - * @memberof google.cloud.ces.v1beta.OptimizationConfig - * @instance - */ - OptimizationConfig.prototype.lossReport = null; - - /** - * Creates a new OptimizationConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.OptimizationConfig - * @static - * @param {google.cloud.ces.v1beta.IOptimizationConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.OptimizationConfig} OptimizationConfig instance - */ - OptimizationConfig.create = function create(properties) { - return new OptimizationConfig(properties); - }; - - /** - * Encodes the specified OptimizationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OptimizationConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.OptimizationConfig - * @static - * @param {google.cloud.ces.v1beta.IOptimizationConfig} message OptimizationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OptimizationConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.generateLossReport != null && Object.hasOwnProperty.call(message, "generateLossReport")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.generateLossReport); - if (message.assistantSession != null && Object.hasOwnProperty.call(message, "assistantSession")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assistantSession); - if (message.reportSummary != null && Object.hasOwnProperty.call(message, "reportSummary")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.reportSummary); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); - if (message.shouldSuggestFix != null && Object.hasOwnProperty.call(message, "shouldSuggestFix")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.shouldSuggestFix); - if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.errorMessage); - if (message.lossReport != null && Object.hasOwnProperty.call(message, "lossReport")) - $root.google.protobuf.Struct.encode(message.lossReport, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OptimizationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OptimizationConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.OptimizationConfig - * @static - * @param {google.cloud.ces.v1beta.IOptimizationConfig} message OptimizationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OptimizationConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OptimizationConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.OptimizationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.OptimizationConfig} OptimizationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OptimizationConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OptimizationConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.generateLossReport = reader.bool(); - break; - } - case 2: { - message.assistantSession = reader.string(); - break; - } - case 3: { - message.reportSummary = reader.string(); - break; - } - case 5: { - message.shouldSuggestFix = reader.bool(); - break; - } - case 4: { - message.status = reader.int32(); - break; - } - case 6: { - message.errorMessage = reader.string(); - break; - } - case 7: { - message.lossReport = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OptimizationConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.OptimizationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.OptimizationConfig} OptimizationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OptimizationConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OptimizationConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.OptimizationConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OptimizationConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.generateLossReport != null && message.hasOwnProperty("generateLossReport")) - if (typeof message.generateLossReport !== "boolean") - return "generateLossReport: boolean expected"; - if (message.assistantSession != null && message.hasOwnProperty("assistantSession")) - if (!$util.isString(message.assistantSession)) - return "assistantSession: string expected"; - if (message.reportSummary != null && message.hasOwnProperty("reportSummary")) - if (!$util.isString(message.reportSummary)) - return "reportSummary: string expected"; - if (message.shouldSuggestFix != null && message.hasOwnProperty("shouldSuggestFix")) - if (typeof message.shouldSuggestFix !== "boolean") - return "shouldSuggestFix: boolean expected"; - 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; - } - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) - if (!$util.isString(message.errorMessage)) - return "errorMessage: string expected"; - if (message.lossReport != null && message.hasOwnProperty("lossReport")) { - var error = $root.google.protobuf.Struct.verify(message.lossReport); - if (error) - return "lossReport." + error; - } - return null; - }; - - /** - * Creates an OptimizationConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.OptimizationConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.OptimizationConfig} OptimizationConfig - */ - OptimizationConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.OptimizationConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.OptimizationConfig(); - if (object.generateLossReport != null) - message.generateLossReport = Boolean(object.generateLossReport); - if (object.assistantSession != null) - message.assistantSession = String(object.assistantSession); - if (object.reportSummary != null) - message.reportSummary = String(object.reportSummary); - if (object.shouldSuggestFix != null) - message.shouldSuggestFix = Boolean(object.shouldSuggestFix); - switch (object.status) { - default: - if (typeof object.status === "number") { - message.status = object.status; - break; - } - break; - case "OPTIMIZATION_STATUS_UNSPECIFIED": - case 0: - message.status = 0; - break; - case "RUNNING": - case 1: - message.status = 1; - break; - case "COMPLETED": - case 2: - message.status = 2; - break; - case "ERROR": - case 3: - message.status = 3; - break; - } - if (object.errorMessage != null) - message.errorMessage = String(object.errorMessage); - if (object.lossReport != null) { - if (typeof object.lossReport !== "object") - throw TypeError(".google.cloud.ces.v1beta.OptimizationConfig.lossReport: object expected"); - message.lossReport = $root.google.protobuf.Struct.fromObject(object.lossReport); - } - return message; - }; - - /** - * Creates a plain object from an OptimizationConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.OptimizationConfig - * @static - * @param {google.cloud.ces.v1beta.OptimizationConfig} message OptimizationConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OptimizationConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.generateLossReport = false; - object.assistantSession = ""; - object.reportSummary = ""; - object.status = options.enums === String ? "OPTIMIZATION_STATUS_UNSPECIFIED" : 0; - object.shouldSuggestFix = false; - object.errorMessage = ""; - object.lossReport = null; - } - if (message.generateLossReport != null && message.hasOwnProperty("generateLossReport")) - object.generateLossReport = message.generateLossReport; - if (message.assistantSession != null && message.hasOwnProperty("assistantSession")) - object.assistantSession = message.assistantSession; - if (message.reportSummary != null && message.hasOwnProperty("reportSummary")) - object.reportSummary = message.reportSummary; - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus[message.status] === undefined ? message.status : $root.google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus[message.status] : message.status; - if (message.shouldSuggestFix != null && message.hasOwnProperty("shouldSuggestFix")) - object.shouldSuggestFix = message.shouldSuggestFix; - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) - object.errorMessage = message.errorMessage; - if (message.lossReport != null && message.hasOwnProperty("lossReport")) - object.lossReport = $root.google.protobuf.Struct.toObject(message.lossReport, options); - return object; - }; - - /** - * Converts this OptimizationConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.OptimizationConfig - * @instance - * @returns {Object.} JSON object - */ - OptimizationConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OptimizationConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.OptimizationConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OptimizationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.OptimizationConfig"; - }; - - /** - * OptimizationStatus enum. - * @name google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus - * @enum {number} - * @property {number} OPTIMIZATION_STATUS_UNSPECIFIED=0 OPTIMIZATION_STATUS_UNSPECIFIED value - * @property {number} RUNNING=1 RUNNING value - * @property {number} COMPLETED=2 COMPLETED value - * @property {number} ERROR=3 ERROR value - */ - OptimizationConfig.OptimizationStatus = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OPTIMIZATION_STATUS_UNSPECIFIED"] = 0; - values[valuesById[1] = "RUNNING"] = 1; - values[valuesById[2] = "COMPLETED"] = 2; - values[valuesById[3] = "ERROR"] = 3; - return values; - })(); - - return OptimizationConfig; - })(); - - v1beta.SessionService = (function() { - - /** - * Constructs a new SessionService service. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a SessionService - * @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 SessionService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (SessionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SessionService; - - /** - * Creates new SessionService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.ces.v1beta.SessionService - * @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 {SessionService} RPC service. Useful where requests and/or responses are streamed. - */ - SessionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.SessionService|runSession}. - * @memberof google.cloud.ces.v1beta.SessionService - * @typedef RunSessionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.RunSessionResponse} [response] RunSessionResponse - */ - - /** - * Calls RunSession. - * @function runSession - * @memberof google.cloud.ces.v1beta.SessionService - * @instance - * @param {google.cloud.ces.v1beta.IRunSessionRequest} request RunSessionRequest message or plain object - * @param {google.cloud.ces.v1beta.SessionService.RunSessionCallback} callback Node-style callback called with the error, if any, and RunSessionResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionService.prototype.runSession = function runSession(request, callback) { - return this.rpcCall(runSession, $root.google.cloud.ces.v1beta.RunSessionRequest, $root.google.cloud.ces.v1beta.RunSessionResponse, request, callback); - }, "name", { value: "RunSession" }); - - /** - * Calls RunSession. - * @function runSession - * @memberof google.cloud.ces.v1beta.SessionService - * @instance - * @param {google.cloud.ces.v1beta.IRunSessionRequest} request RunSessionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.SessionService|bidiRunSession}. - * @memberof google.cloud.ces.v1beta.SessionService - * @typedef BidiRunSessionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.BidiSessionServerMessage} [response] BidiSessionServerMessage - */ - - /** - * Calls BidiRunSession. - * @function bidiRunSession - * @memberof google.cloud.ces.v1beta.SessionService - * @instance - * @param {google.cloud.ces.v1beta.IBidiSessionClientMessage} request BidiSessionClientMessage message or plain object - * @param {google.cloud.ces.v1beta.SessionService.BidiRunSessionCallback} callback Node-style callback called with the error, if any, and BidiSessionServerMessage - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionService.prototype.bidiRunSession = function bidiRunSession(request, callback) { - return this.rpcCall(bidiRunSession, $root.google.cloud.ces.v1beta.BidiSessionClientMessage, $root.google.cloud.ces.v1beta.BidiSessionServerMessage, request, callback); - }, "name", { value: "BidiRunSession" }); - - /** - * Calls BidiRunSession. - * @function bidiRunSession - * @memberof google.cloud.ces.v1beta.SessionService - * @instance - * @param {google.cloud.ces.v1beta.IBidiSessionClientMessage} request BidiSessionClientMessage message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return SessionService; - })(); - - /** - * AudioEncoding enum. - * @name google.cloud.ces.v1beta.AudioEncoding - * @enum {number} - * @property {number} AUDIO_ENCODING_UNSPECIFIED=0 AUDIO_ENCODING_UNSPECIFIED value - * @property {number} LINEAR16=1 LINEAR16 value - * @property {number} MULAW=2 MULAW value - * @property {number} ALAW=3 ALAW value - */ - v1beta.AudioEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AUDIO_ENCODING_UNSPECIFIED"] = 0; - values[valuesById[1] = "LINEAR16"] = 1; - values[valuesById[2] = "MULAW"] = 2; - values[valuesById[3] = "ALAW"] = 3; - return values; - })(); - - v1beta.InputAudioConfig = (function() { - - /** - * Properties of an InputAudioConfig. - * @memberof google.cloud.ces.v1beta - * @interface IInputAudioConfig - * @property {google.cloud.ces.v1beta.AudioEncoding|null} [audioEncoding] InputAudioConfig audioEncoding - * @property {number|null} [sampleRateHertz] InputAudioConfig sampleRateHertz - * @property {string|null} [noiseSuppressionLevel] InputAudioConfig noiseSuppressionLevel - */ - - /** - * Constructs a new InputAudioConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an InputAudioConfig. - * @implements IInputAudioConfig - * @constructor - * @param {google.cloud.ces.v1beta.IInputAudioConfig=} [properties] Properties to set - */ - function InputAudioConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InputAudioConfig audioEncoding. - * @member {google.cloud.ces.v1beta.AudioEncoding} audioEncoding - * @memberof google.cloud.ces.v1beta.InputAudioConfig - * @instance - */ - InputAudioConfig.prototype.audioEncoding = 0; - - /** - * InputAudioConfig sampleRateHertz. - * @member {number} sampleRateHertz - * @memberof google.cloud.ces.v1beta.InputAudioConfig - * @instance - */ - InputAudioConfig.prototype.sampleRateHertz = 0; - - /** - * InputAudioConfig noiseSuppressionLevel. - * @member {string} noiseSuppressionLevel - * @memberof google.cloud.ces.v1beta.InputAudioConfig - * @instance - */ - InputAudioConfig.prototype.noiseSuppressionLevel = ""; - - /** - * Creates a new InputAudioConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.InputAudioConfig - * @static - * @param {google.cloud.ces.v1beta.IInputAudioConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.InputAudioConfig} InputAudioConfig instance - */ - InputAudioConfig.create = function create(properties) { - return new InputAudioConfig(properties); - }; - - /** - * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1beta.InputAudioConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.InputAudioConfig - * @static - * @param {google.cloud.ces.v1beta.IInputAudioConfig} message InputAudioConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InputAudioConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); - if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); - if (message.noiseSuppressionLevel != null && Object.hasOwnProperty.call(message, "noiseSuppressionLevel")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.noiseSuppressionLevel); - return writer; - }; - - /** - * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.InputAudioConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.InputAudioConfig - * @static - * @param {google.cloud.ces.v1beta.IInputAudioConfig} message InputAudioConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InputAudioConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.InputAudioConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.InputAudioConfig} InputAudioConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InputAudioConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.InputAudioConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.audioEncoding = reader.int32(); - break; - } - case 2: { - message.sampleRateHertz = reader.int32(); - break; - } - case 6: { - message.noiseSuppressionLevel = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.InputAudioConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.InputAudioConfig} InputAudioConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InputAudioConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InputAudioConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.InputAudioConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InputAudioConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) - switch (message.audioEncoding) { - default: - return "audioEncoding: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) - if (!$util.isInteger(message.sampleRateHertz)) - return "sampleRateHertz: integer expected"; - if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) - if (!$util.isString(message.noiseSuppressionLevel)) - return "noiseSuppressionLevel: string expected"; - return null; - }; - - /** - * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.InputAudioConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.InputAudioConfig} InputAudioConfig - */ - InputAudioConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.InputAudioConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.InputAudioConfig(); - switch (object.audioEncoding) { - default: - if (typeof object.audioEncoding === "number") { - message.audioEncoding = object.audioEncoding; - break; - } - break; - case "AUDIO_ENCODING_UNSPECIFIED": - case 0: - message.audioEncoding = 0; - break; - case "LINEAR16": - case 1: - message.audioEncoding = 1; - break; - case "MULAW": - case 2: - message.audioEncoding = 2; - break; - case "ALAW": - case 3: - message.audioEncoding = 3; - break; - } - if (object.sampleRateHertz != null) - message.sampleRateHertz = object.sampleRateHertz | 0; - if (object.noiseSuppressionLevel != null) - message.noiseSuppressionLevel = String(object.noiseSuppressionLevel); - return message; - }; - - /** - * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.InputAudioConfig - * @static - * @param {google.cloud.ces.v1beta.InputAudioConfig} message InputAudioConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InputAudioConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.audioEncoding = options.enums === String ? "AUDIO_ENCODING_UNSPECIFIED" : 0; - object.sampleRateHertz = 0; - object.noiseSuppressionLevel = ""; - } - if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) - object.audioEncoding = options.enums === String ? $root.google.cloud.ces.v1beta.AudioEncoding[message.audioEncoding] === undefined ? message.audioEncoding : $root.google.cloud.ces.v1beta.AudioEncoding[message.audioEncoding] : message.audioEncoding; - if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) - object.sampleRateHertz = message.sampleRateHertz; - if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) - object.noiseSuppressionLevel = message.noiseSuppressionLevel; - return object; - }; - - /** - * Converts this InputAudioConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.InputAudioConfig - * @instance - * @returns {Object.} JSON object - */ - InputAudioConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InputAudioConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.InputAudioConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InputAudioConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.InputAudioConfig"; - }; - - return InputAudioConfig; - })(); - - v1beta.OutputAudioConfig = (function() { - - /** - * Properties of an OutputAudioConfig. - * @memberof google.cloud.ces.v1beta - * @interface IOutputAudioConfig - * @property {google.cloud.ces.v1beta.AudioEncoding|null} [audioEncoding] OutputAudioConfig audioEncoding - * @property {number|null} [sampleRateHertz] OutputAudioConfig sampleRateHertz - */ - - /** - * Constructs a new OutputAudioConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an OutputAudioConfig. - * @implements IOutputAudioConfig - * @constructor - * @param {google.cloud.ces.v1beta.IOutputAudioConfig=} [properties] Properties to set - */ - function OutputAudioConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OutputAudioConfig audioEncoding. - * @member {google.cloud.ces.v1beta.AudioEncoding} audioEncoding - * @memberof google.cloud.ces.v1beta.OutputAudioConfig - * @instance - */ - OutputAudioConfig.prototype.audioEncoding = 0; - - /** - * OutputAudioConfig sampleRateHertz. - * @member {number} sampleRateHertz - * @memberof google.cloud.ces.v1beta.OutputAudioConfig - * @instance - */ - OutputAudioConfig.prototype.sampleRateHertz = 0; - - /** - * Creates a new OutputAudioConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.OutputAudioConfig - * @static - * @param {google.cloud.ces.v1beta.IOutputAudioConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.OutputAudioConfig} OutputAudioConfig instance - */ - OutputAudioConfig.create = function create(properties) { - return new OutputAudioConfig(properties); - }; - - /** - * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OutputAudioConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.OutputAudioConfig - * @static - * @param {google.cloud.ces.v1beta.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OutputAudioConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); - if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); - return writer; - }; - - /** - * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OutputAudioConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.OutputAudioConfig - * @static - * @param {google.cloud.ces.v1beta.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OutputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OutputAudioConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.OutputAudioConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.OutputAudioConfig} OutputAudioConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OutputAudioConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OutputAudioConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.audioEncoding = reader.int32(); - break; - } - case 2: { - message.sampleRateHertz = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.OutputAudioConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.OutputAudioConfig} OutputAudioConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OutputAudioConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OutputAudioConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.OutputAudioConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OutputAudioConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) - switch (message.audioEncoding) { - default: - return "audioEncoding: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) - if (!$util.isInteger(message.sampleRateHertz)) - return "sampleRateHertz: integer expected"; - return null; - }; - - /** - * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.OutputAudioConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.OutputAudioConfig} OutputAudioConfig - */ - OutputAudioConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.OutputAudioConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.OutputAudioConfig(); - switch (object.audioEncoding) { - default: - if (typeof object.audioEncoding === "number") { - message.audioEncoding = object.audioEncoding; - break; - } - break; - case "AUDIO_ENCODING_UNSPECIFIED": - case 0: - message.audioEncoding = 0; - break; - case "LINEAR16": - case 1: - message.audioEncoding = 1; - break; - case "MULAW": - case 2: - message.audioEncoding = 2; - break; - case "ALAW": - case 3: - message.audioEncoding = 3; - break; - } - if (object.sampleRateHertz != null) - message.sampleRateHertz = object.sampleRateHertz | 0; - return message; - }; - - /** - * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.OutputAudioConfig - * @static - * @param {google.cloud.ces.v1beta.OutputAudioConfig} message OutputAudioConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OutputAudioConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.audioEncoding = options.enums === String ? "AUDIO_ENCODING_UNSPECIFIED" : 0; - object.sampleRateHertz = 0; - } - if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) - object.audioEncoding = options.enums === String ? $root.google.cloud.ces.v1beta.AudioEncoding[message.audioEncoding] === undefined ? message.audioEncoding : $root.google.cloud.ces.v1beta.AudioEncoding[message.audioEncoding] : message.audioEncoding; - if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) - object.sampleRateHertz = message.sampleRateHertz; - return object; - }; - - /** - * Converts this OutputAudioConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.OutputAudioConfig - * @instance - * @returns {Object.} JSON object - */ - OutputAudioConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OutputAudioConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.OutputAudioConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OutputAudioConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.OutputAudioConfig"; - }; - - return OutputAudioConfig; - })(); - - v1beta.SessionConfig = (function() { - - /** - * Properties of a SessionConfig. - * @memberof google.cloud.ces.v1beta - * @interface ISessionConfig - * @property {string|null} [session] SessionConfig session - * @property {google.cloud.ces.v1beta.IInputAudioConfig|null} [inputAudioConfig] SessionConfig inputAudioConfig - * @property {google.cloud.ces.v1beta.IOutputAudioConfig|null} [outputAudioConfig] SessionConfig outputAudioConfig - * @property {Array.|null} [historicalContexts] SessionConfig historicalContexts - * @property {string|null} [entryAgent] SessionConfig entryAgent - * @property {string|null} [deployment] SessionConfig deployment - * @property {string|null} [timeZone] SessionConfig timeZone - * @property {google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters|null} [remoteDialogflowQueryParameters] SessionConfig remoteDialogflowQueryParameters - */ - - /** - * Constructs a new SessionConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a SessionConfig. - * @implements ISessionConfig - * @constructor - * @param {google.cloud.ces.v1beta.ISessionConfig=} [properties] Properties to set - */ - function SessionConfig(properties) { - this.historicalContexts = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SessionConfig session. - * @member {string} session - * @memberof google.cloud.ces.v1beta.SessionConfig - * @instance - */ - SessionConfig.prototype.session = ""; - - /** - * SessionConfig inputAudioConfig. - * @member {google.cloud.ces.v1beta.IInputAudioConfig|null|undefined} inputAudioConfig - * @memberof google.cloud.ces.v1beta.SessionConfig - * @instance - */ - SessionConfig.prototype.inputAudioConfig = null; - - /** - * SessionConfig outputAudioConfig. - * @member {google.cloud.ces.v1beta.IOutputAudioConfig|null|undefined} outputAudioConfig - * @memberof google.cloud.ces.v1beta.SessionConfig - * @instance - */ - SessionConfig.prototype.outputAudioConfig = null; - - /** - * SessionConfig historicalContexts. - * @member {Array.} historicalContexts - * @memberof google.cloud.ces.v1beta.SessionConfig - * @instance - */ - SessionConfig.prototype.historicalContexts = $util.emptyArray; - - /** - * SessionConfig entryAgent. - * @member {string} entryAgent - * @memberof google.cloud.ces.v1beta.SessionConfig - * @instance - */ - SessionConfig.prototype.entryAgent = ""; - - /** - * SessionConfig deployment. - * @member {string} deployment - * @memberof google.cloud.ces.v1beta.SessionConfig - * @instance - */ - SessionConfig.prototype.deployment = ""; - - /** - * SessionConfig timeZone. - * @member {string} timeZone - * @memberof google.cloud.ces.v1beta.SessionConfig - * @instance - */ - SessionConfig.prototype.timeZone = ""; - - /** - * SessionConfig remoteDialogflowQueryParameters. - * @member {google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters|null|undefined} remoteDialogflowQueryParameters - * @memberof google.cloud.ces.v1beta.SessionConfig - * @instance - */ - SessionConfig.prototype.remoteDialogflowQueryParameters = null; - - /** - * Creates a new SessionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.SessionConfig - * @static - * @param {google.cloud.ces.v1beta.ISessionConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.SessionConfig} SessionConfig instance - */ - SessionConfig.create = function create(properties) { - return new SessionConfig(properties); - }; - - /** - * Encodes the specified SessionConfig message. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.SessionConfig - * @static - * @param {google.cloud.ces.v1beta.ISessionConfig} message SessionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.inputAudioConfig != null && Object.hasOwnProperty.call(message, "inputAudioConfig")) - $root.google.cloud.ces.v1beta.InputAudioConfig.encode(message.inputAudioConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) - $root.google.cloud.ces.v1beta.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.historicalContexts != null && message.historicalContexts.length) - for (var i = 0; i < message.historicalContexts.length; ++i) - $root.google.cloud.ces.v1beta.Message.encode(message.historicalContexts[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.deployment); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.timeZone); - if (message.entryAgent != null && Object.hasOwnProperty.call(message, "entryAgent")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.entryAgent); - if (message.remoteDialogflowQueryParameters != null && Object.hasOwnProperty.call(message, "remoteDialogflowQueryParameters")) - $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.encode(message.remoteDialogflowQueryParameters, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SessionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.SessionConfig - * @static - * @param {google.cloud.ces.v1beta.ISessionConfig} message SessionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SessionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.SessionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.SessionConfig} SessionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SessionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.inputAudioConfig = $root.google.cloud.ces.v1beta.InputAudioConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.outputAudioConfig = $root.google.cloud.ces.v1beta.OutputAudioConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - if (!(message.historicalContexts && message.historicalContexts.length)) - message.historicalContexts = []; - message.historicalContexts.push($root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32())); - break; - } - case 12: { - message.entryAgent = reader.string(); - break; - } - case 8: { - message.deployment = reader.string(); - break; - } - case 11: { - message.timeZone = reader.string(); - break; - } - case 15: { - message.remoteDialogflowQueryParameters = $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SessionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.SessionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.SessionConfig} SessionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SessionConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.SessionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SessionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.inputAudioConfig != null && message.hasOwnProperty("inputAudioConfig")) { - var error = $root.google.cloud.ces.v1beta.InputAudioConfig.verify(message.inputAudioConfig); - if (error) - return "inputAudioConfig." + error; - } - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { - var error = $root.google.cloud.ces.v1beta.OutputAudioConfig.verify(message.outputAudioConfig); - if (error) - return "outputAudioConfig." + error; - } - if (message.historicalContexts != null && message.hasOwnProperty("historicalContexts")) { - if (!Array.isArray(message.historicalContexts)) - return "historicalContexts: array expected"; - for (var i = 0; i < message.historicalContexts.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Message.verify(message.historicalContexts[i]); - if (error) - return "historicalContexts." + error; - } - } - if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) - if (!$util.isString(message.entryAgent)) - return "entryAgent: string expected"; - if (message.deployment != null && message.hasOwnProperty("deployment")) - if (!$util.isString(message.deployment)) - return "deployment: string expected"; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - if (!$util.isString(message.timeZone)) - return "timeZone: string expected"; - if (message.remoteDialogflowQueryParameters != null && message.hasOwnProperty("remoteDialogflowQueryParameters")) { - var error = $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.verify(message.remoteDialogflowQueryParameters); - if (error) - return "remoteDialogflowQueryParameters." + error; - } - return null; - }; - - /** - * Creates a SessionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.SessionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.SessionConfig} SessionConfig - */ - SessionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.SessionConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.SessionConfig(); - if (object.session != null) - message.session = String(object.session); - if (object.inputAudioConfig != null) { - if (typeof object.inputAudioConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionConfig.inputAudioConfig: object expected"); - message.inputAudioConfig = $root.google.cloud.ces.v1beta.InputAudioConfig.fromObject(object.inputAudioConfig); - } - if (object.outputAudioConfig != null) { - if (typeof object.outputAudioConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionConfig.outputAudioConfig: object expected"); - message.outputAudioConfig = $root.google.cloud.ces.v1beta.OutputAudioConfig.fromObject(object.outputAudioConfig); - } - if (object.historicalContexts) { - if (!Array.isArray(object.historicalContexts)) - throw TypeError(".google.cloud.ces.v1beta.SessionConfig.historicalContexts: array expected"); - message.historicalContexts = []; - for (var i = 0; i < object.historicalContexts.length; ++i) { - if (typeof object.historicalContexts[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionConfig.historicalContexts: object expected"); - message.historicalContexts[i] = $root.google.cloud.ces.v1beta.Message.fromObject(object.historicalContexts[i]); - } - } - if (object.entryAgent != null) - message.entryAgent = String(object.entryAgent); - if (object.deployment != null) - message.deployment = String(object.deployment); - if (object.timeZone != null) - message.timeZone = String(object.timeZone); - if (object.remoteDialogflowQueryParameters != null) { - if (typeof object.remoteDialogflowQueryParameters !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionConfig.remoteDialogflowQueryParameters: object expected"); - message.remoteDialogflowQueryParameters = $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.fromObject(object.remoteDialogflowQueryParameters); - } - return message; - }; - - /** - * Creates a plain object from a SessionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.SessionConfig - * @static - * @param {google.cloud.ces.v1beta.SessionConfig} message SessionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SessionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.historicalContexts = []; - if (options.defaults) { - object.session = ""; - object.inputAudioConfig = null; - object.outputAudioConfig = null; - object.deployment = ""; - object.timeZone = ""; - object.entryAgent = ""; - object.remoteDialogflowQueryParameters = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.inputAudioConfig != null && message.hasOwnProperty("inputAudioConfig")) - object.inputAudioConfig = $root.google.cloud.ces.v1beta.InputAudioConfig.toObject(message.inputAudioConfig, options); - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) - object.outputAudioConfig = $root.google.cloud.ces.v1beta.OutputAudioConfig.toObject(message.outputAudioConfig, options); - if (message.historicalContexts && message.historicalContexts.length) { - object.historicalContexts = []; - for (var j = 0; j < message.historicalContexts.length; ++j) - object.historicalContexts[j] = $root.google.cloud.ces.v1beta.Message.toObject(message.historicalContexts[j], options); - } - if (message.deployment != null && message.hasOwnProperty("deployment")) - object.deployment = message.deployment; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - object.timeZone = message.timeZone; - if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) - object.entryAgent = message.entryAgent; - if (message.remoteDialogflowQueryParameters != null && message.hasOwnProperty("remoteDialogflowQueryParameters")) - object.remoteDialogflowQueryParameters = $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.toObject(message.remoteDialogflowQueryParameters, options); - return object; - }; - - /** - * Converts this SessionConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.SessionConfig - * @instance - * @returns {Object.} JSON object - */ - SessionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SessionConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.SessionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SessionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.SessionConfig"; - }; - - SessionConfig.RemoteDialogflowQueryParameters = (function() { - - /** - * Properties of a RemoteDialogflowQueryParameters. - * @memberof google.cloud.ces.v1beta.SessionConfig - * @interface IRemoteDialogflowQueryParameters - * @property {Object.|null} [webhookHeaders] RemoteDialogflowQueryParameters webhookHeaders - * @property {google.protobuf.IStruct|null} [payload] RemoteDialogflowQueryParameters payload - * @property {google.protobuf.IStruct|null} [endUserMetadata] RemoteDialogflowQueryParameters endUserMetadata - */ - - /** - * Constructs a new RemoteDialogflowQueryParameters. - * @memberof google.cloud.ces.v1beta.SessionConfig - * @classdesc Represents a RemoteDialogflowQueryParameters. - * @implements IRemoteDialogflowQueryParameters - * @constructor - * @param {google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters=} [properties] Properties to set - */ - function RemoteDialogflowQueryParameters(properties) { - this.webhookHeaders = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RemoteDialogflowQueryParameters webhookHeaders. - * @member {Object.} webhookHeaders - * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters - * @instance - */ - RemoteDialogflowQueryParameters.prototype.webhookHeaders = $util.emptyObject; - - /** - * RemoteDialogflowQueryParameters payload. - * @member {google.protobuf.IStruct|null|undefined} payload - * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters - * @instance - */ - RemoteDialogflowQueryParameters.prototype.payload = null; - - /** - * RemoteDialogflowQueryParameters endUserMetadata. - * @member {google.protobuf.IStruct|null|undefined} endUserMetadata - * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters - * @instance - */ - RemoteDialogflowQueryParameters.prototype.endUserMetadata = null; - - /** - * Creates a new RemoteDialogflowQueryParameters instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters - * @static - * @param {google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters instance - */ - RemoteDialogflowQueryParameters.create = function create(properties) { - return new RemoteDialogflowQueryParameters(properties); - }; - - /** - * Encodes the specified RemoteDialogflowQueryParameters message. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters - * @static - * @param {google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters} message RemoteDialogflowQueryParameters message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RemoteDialogflowQueryParameters.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.webhookHeaders != null && Object.hasOwnProperty.call(message, "webhookHeaders")) - for (var keys = Object.keys(message.webhookHeaders), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.webhookHeaders[keys[i]]).ldelim(); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endUserMetadata != null && Object.hasOwnProperty.call(message, "endUserMetadata")) - $root.google.protobuf.Struct.encode(message.endUserMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RemoteDialogflowQueryParameters message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters - * @static - * @param {google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters} message RemoteDialogflowQueryParameters message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RemoteDialogflowQueryParameters.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RemoteDialogflowQueryParameters.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.webhookHeaders === $util.emptyObject) - message.webhookHeaders = {}; - 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.webhookHeaders[key] = value; - break; - } - case 2: { - message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 3: { - message.endUserMetadata = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RemoteDialogflowQueryParameters.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RemoteDialogflowQueryParameters message. - * @function verify - * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RemoteDialogflowQueryParameters.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.webhookHeaders != null && message.hasOwnProperty("webhookHeaders")) { - if (!$util.isObject(message.webhookHeaders)) - return "webhookHeaders: object expected"; - var key = Object.keys(message.webhookHeaders); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.webhookHeaders[key[i]])) - return "webhookHeaders: string{k:string} expected"; - } - if (message.payload != null && message.hasOwnProperty("payload")) { - var error = $root.google.protobuf.Struct.verify(message.payload); - if (error) - return "payload." + error; - } - if (message.endUserMetadata != null && message.hasOwnProperty("endUserMetadata")) { - var error = $root.google.protobuf.Struct.verify(message.endUserMetadata); - if (error) - return "endUserMetadata." + error; - } - return null; - }; - - /** - * Creates a RemoteDialogflowQueryParameters message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters - */ - RemoteDialogflowQueryParameters.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters) - return object; - var message = new $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters(); - if (object.webhookHeaders) { - if (typeof object.webhookHeaders !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.webhookHeaders: object expected"); - message.webhookHeaders = {}; - for (var keys = Object.keys(object.webhookHeaders), i = 0; i < keys.length; ++i) - message.webhookHeaders[keys[i]] = String(object.webhookHeaders[keys[i]]); - } - if (object.payload != null) { - if (typeof object.payload !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.payload: object expected"); - message.payload = $root.google.protobuf.Struct.fromObject(object.payload); - } - if (object.endUserMetadata != null) { - if (typeof object.endUserMetadata !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.endUserMetadata: object expected"); - message.endUserMetadata = $root.google.protobuf.Struct.fromObject(object.endUserMetadata); - } - return message; - }; - - /** - * Creates a plain object from a RemoteDialogflowQueryParameters message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters - * @static - * @param {google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters} message RemoteDialogflowQueryParameters - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RemoteDialogflowQueryParameters.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.webhookHeaders = {}; - if (options.defaults) { - object.payload = null; - object.endUserMetadata = null; - } - var keys2; - if (message.webhookHeaders && (keys2 = Object.keys(message.webhookHeaders)).length) { - object.webhookHeaders = {}; - for (var j = 0; j < keys2.length; ++j) - object.webhookHeaders[keys2[j]] = message.webhookHeaders[keys2[j]]; - } - if (message.payload != null && message.hasOwnProperty("payload")) - object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); - if (message.endUserMetadata != null && message.hasOwnProperty("endUserMetadata")) - object.endUserMetadata = $root.google.protobuf.Struct.toObject(message.endUserMetadata, options); - return object; - }; - - /** - * Converts this RemoteDialogflowQueryParameters to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters - * @instance - * @returns {Object.} JSON object - */ - RemoteDialogflowQueryParameters.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RemoteDialogflowQueryParameters - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RemoteDialogflowQueryParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters"; - }; - - return RemoteDialogflowQueryParameters; - })(); - - return SessionConfig; - })(); - - v1beta.ToolCalls = (function() { - - /** - * Properties of a ToolCalls. - * @memberof google.cloud.ces.v1beta - * @interface IToolCalls - * @property {Array.|null} [toolCalls] ToolCalls toolCalls - */ - - /** - * Constructs a new ToolCalls. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ToolCalls. - * @implements IToolCalls - * @constructor - * @param {google.cloud.ces.v1beta.IToolCalls=} [properties] Properties to set - */ - function ToolCalls(properties) { - this.toolCalls = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolCalls toolCalls. - * @member {Array.} toolCalls - * @memberof google.cloud.ces.v1beta.ToolCalls - * @instance - */ - ToolCalls.prototype.toolCalls = $util.emptyArray; - - /** - * Creates a new ToolCalls instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ToolCalls - * @static - * @param {google.cloud.ces.v1beta.IToolCalls=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ToolCalls} ToolCalls instance - */ - ToolCalls.create = function create(properties) { - return new ToolCalls(properties); - }; - - /** - * Encodes the specified ToolCalls message. Does not implicitly {@link google.cloud.ces.v1beta.ToolCalls.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ToolCalls - * @static - * @param {google.cloud.ces.v1beta.IToolCalls} message ToolCalls message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolCalls.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolCalls != null && message.toolCalls.length) - for (var i = 0; i < message.toolCalls.length; ++i) - $root.google.cloud.ces.v1beta.ToolCall.encode(message.toolCalls[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ToolCalls message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolCalls.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ToolCalls - * @static - * @param {google.cloud.ces.v1beta.IToolCalls} message ToolCalls message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolCalls.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolCalls message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ToolCalls - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ToolCalls} ToolCalls - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolCalls.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ToolCalls(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.toolCalls && message.toolCalls.length)) - message.toolCalls = []; - message.toolCalls.push($root.google.cloud.ces.v1beta.ToolCall.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolCalls message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ToolCalls - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ToolCalls} ToolCalls - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolCalls.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolCalls message. - * @function verify - * @memberof google.cloud.ces.v1beta.ToolCalls - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolCalls.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.toolCalls != null && message.hasOwnProperty("toolCalls")) { - if (!Array.isArray(message.toolCalls)) - return "toolCalls: array expected"; - for (var i = 0; i < message.toolCalls.length; ++i) { - var error = $root.google.cloud.ces.v1beta.ToolCall.verify(message.toolCalls[i]); - if (error) - return "toolCalls." + error; - } - } - return null; - }; - - /** - * Creates a ToolCalls message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ToolCalls - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ToolCalls} ToolCalls - */ - ToolCalls.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ToolCalls) - return object; - var message = new $root.google.cloud.ces.v1beta.ToolCalls(); - if (object.toolCalls) { - if (!Array.isArray(object.toolCalls)) - throw TypeError(".google.cloud.ces.v1beta.ToolCalls.toolCalls: array expected"); - message.toolCalls = []; - for (var i = 0; i < object.toolCalls.length; ++i) { - if (typeof object.toolCalls[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ToolCalls.toolCalls: object expected"); - message.toolCalls[i] = $root.google.cloud.ces.v1beta.ToolCall.fromObject(object.toolCalls[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ToolCalls message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ToolCalls - * @static - * @param {google.cloud.ces.v1beta.ToolCalls} message ToolCalls - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolCalls.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.toolCalls = []; - if (message.toolCalls && message.toolCalls.length) { - object.toolCalls = []; - for (var j = 0; j < message.toolCalls.length; ++j) - object.toolCalls[j] = $root.google.cloud.ces.v1beta.ToolCall.toObject(message.toolCalls[j], options); - } - return object; - }; - - /** - * Converts this ToolCalls to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ToolCalls - * @instance - * @returns {Object.} JSON object - */ - ToolCalls.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolCalls - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ToolCalls - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolCalls.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ToolCalls"; - }; - - return ToolCalls; - })(); - - v1beta.ToolResponses = (function() { - - /** - * Properties of a ToolResponses. - * @memberof google.cloud.ces.v1beta - * @interface IToolResponses - * @property {Array.|null} [toolResponses] ToolResponses toolResponses - */ - - /** - * Constructs a new ToolResponses. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ToolResponses. - * @implements IToolResponses - * @constructor - * @param {google.cloud.ces.v1beta.IToolResponses=} [properties] Properties to set - */ - function ToolResponses(properties) { - this.toolResponses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolResponses toolResponses. - * @member {Array.} toolResponses - * @memberof google.cloud.ces.v1beta.ToolResponses - * @instance - */ - ToolResponses.prototype.toolResponses = $util.emptyArray; - - /** - * Creates a new ToolResponses instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ToolResponses - * @static - * @param {google.cloud.ces.v1beta.IToolResponses=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ToolResponses} ToolResponses instance - */ - ToolResponses.create = function create(properties) { - return new ToolResponses(properties); - }; - - /** - * Encodes the specified ToolResponses message. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponses.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ToolResponses - * @static - * @param {google.cloud.ces.v1beta.IToolResponses} message ToolResponses message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolResponses.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolResponses != null && message.toolResponses.length) - for (var i = 0; i < message.toolResponses.length; ++i) - $root.google.cloud.ces.v1beta.ToolResponse.encode(message.toolResponses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ToolResponses message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponses.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ToolResponses - * @static - * @param {google.cloud.ces.v1beta.IToolResponses} message ToolResponses message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolResponses.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolResponses message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ToolResponses - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ToolResponses} ToolResponses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolResponses.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ToolResponses(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.toolResponses && message.toolResponses.length)) - message.toolResponses = []; - message.toolResponses.push($root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolResponses message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ToolResponses - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ToolResponses} ToolResponses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolResponses.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolResponses message. - * @function verify - * @memberof google.cloud.ces.v1beta.ToolResponses - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolResponses.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.toolResponses != null && message.hasOwnProperty("toolResponses")) { - if (!Array.isArray(message.toolResponses)) - return "toolResponses: array expected"; - for (var i = 0; i < message.toolResponses.length; ++i) { - var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.toolResponses[i]); - if (error) - return "toolResponses." + error; - } - } - return null; - }; - - /** - * Creates a ToolResponses message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ToolResponses - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ToolResponses} ToolResponses - */ - ToolResponses.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ToolResponses) - return object; - var message = new $root.google.cloud.ces.v1beta.ToolResponses(); - if (object.toolResponses) { - if (!Array.isArray(object.toolResponses)) - throw TypeError(".google.cloud.ces.v1beta.ToolResponses.toolResponses: array expected"); - message.toolResponses = []; - for (var i = 0; i < object.toolResponses.length; ++i) { - if (typeof object.toolResponses[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ToolResponses.toolResponses: object expected"); - message.toolResponses[i] = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.toolResponses[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ToolResponses message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ToolResponses - * @static - * @param {google.cloud.ces.v1beta.ToolResponses} message ToolResponses - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ToolResponses.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.toolResponses = []; - if (message.toolResponses && message.toolResponses.length) { - object.toolResponses = []; - for (var j = 0; j < message.toolResponses.length; ++j) - object.toolResponses[j] = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.toolResponses[j], options); - } - return object; - }; - - /** - * Converts this ToolResponses to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ToolResponses - * @instance - * @returns {Object.} JSON object - */ - ToolResponses.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ToolResponses - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ToolResponses - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ToolResponses.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ToolResponses"; - }; - - return ToolResponses; - })(); - - v1beta.Citations = (function() { - - /** - * Properties of a Citations. - * @memberof google.cloud.ces.v1beta - * @interface ICitations - * @property {Array.|null} [citedChunks] Citations citedChunks - */ - - /** - * Constructs a new Citations. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a Citations. - * @implements ICitations - * @constructor - * @param {google.cloud.ces.v1beta.ICitations=} [properties] Properties to set - */ - function Citations(properties) { - this.citedChunks = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Citations citedChunks. - * @member {Array.} citedChunks - * @memberof google.cloud.ces.v1beta.Citations - * @instance - */ - Citations.prototype.citedChunks = $util.emptyArray; - - /** - * Creates a new Citations instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Citations - * @static - * @param {google.cloud.ces.v1beta.ICitations=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Citations} Citations instance - */ - Citations.create = function create(properties) { - return new Citations(properties); - }; - - /** - * Encodes the specified Citations message. Does not implicitly {@link google.cloud.ces.v1beta.Citations.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Citations - * @static - * @param {google.cloud.ces.v1beta.ICitations} message Citations message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Citations.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.citedChunks != null && message.citedChunks.length) - for (var i = 0; i < message.citedChunks.length; ++i) - $root.google.cloud.ces.v1beta.Citations.CitedChunk.encode(message.citedChunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Citations message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Citations.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Citations - * @static - * @param {google.cloud.ces.v1beta.ICitations} message Citations message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Citations.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Citations message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Citations - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Citations} Citations - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Citations.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Citations(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.citedChunks && message.citedChunks.length)) - message.citedChunks = []; - message.citedChunks.push($root.google.cloud.ces.v1beta.Citations.CitedChunk.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Citations message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Citations - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Citations} Citations - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Citations.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Citations message. - * @function verify - * @memberof google.cloud.ces.v1beta.Citations - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Citations.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.citedChunks != null && message.hasOwnProperty("citedChunks")) { - if (!Array.isArray(message.citedChunks)) - return "citedChunks: array expected"; - for (var i = 0; i < message.citedChunks.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Citations.CitedChunk.verify(message.citedChunks[i]); - if (error) - return "citedChunks." + error; - } - } - return null; - }; - - /** - * Creates a Citations message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Citations - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Citations} Citations - */ - Citations.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Citations) - return object; - var message = new $root.google.cloud.ces.v1beta.Citations(); - if (object.citedChunks) { - if (!Array.isArray(object.citedChunks)) - throw TypeError(".google.cloud.ces.v1beta.Citations.citedChunks: array expected"); - message.citedChunks = []; - for (var i = 0; i < object.citedChunks.length; ++i) { - if (typeof object.citedChunks[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.Citations.citedChunks: object expected"); - message.citedChunks[i] = $root.google.cloud.ces.v1beta.Citations.CitedChunk.fromObject(object.citedChunks[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Citations message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Citations - * @static - * @param {google.cloud.ces.v1beta.Citations} message Citations - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Citations.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.citedChunks = []; - if (message.citedChunks && message.citedChunks.length) { - object.citedChunks = []; - for (var j = 0; j < message.citedChunks.length; ++j) - object.citedChunks[j] = $root.google.cloud.ces.v1beta.Citations.CitedChunk.toObject(message.citedChunks[j], options); - } - return object; - }; - - /** - * Converts this Citations to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Citations - * @instance - * @returns {Object.} JSON object - */ - Citations.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Citations - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Citations - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Citations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Citations"; - }; - - Citations.CitedChunk = (function() { - - /** - * Properties of a CitedChunk. - * @memberof google.cloud.ces.v1beta.Citations - * @interface ICitedChunk - * @property {string|null} [uri] CitedChunk uri - * @property {string|null} [title] CitedChunk title - * @property {string|null} [text] CitedChunk text - */ - - /** - * Constructs a new CitedChunk. - * @memberof google.cloud.ces.v1beta.Citations - * @classdesc Represents a CitedChunk. - * @implements ICitedChunk - * @constructor - * @param {google.cloud.ces.v1beta.Citations.ICitedChunk=} [properties] Properties to set - */ - function CitedChunk(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CitedChunk uri. - * @member {string} uri - * @memberof google.cloud.ces.v1beta.Citations.CitedChunk - * @instance - */ - CitedChunk.prototype.uri = ""; - - /** - * CitedChunk title. - * @member {string} title - * @memberof google.cloud.ces.v1beta.Citations.CitedChunk - * @instance - */ - CitedChunk.prototype.title = ""; - - /** - * CitedChunk text. - * @member {string} text - * @memberof google.cloud.ces.v1beta.Citations.CitedChunk - * @instance - */ - CitedChunk.prototype.text = ""; - - /** - * Creates a new CitedChunk instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Citations.CitedChunk - * @static - * @param {google.cloud.ces.v1beta.Citations.ICitedChunk=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Citations.CitedChunk} CitedChunk instance - */ - CitedChunk.create = function create(properties) { - return new CitedChunk(properties); - }; - - /** - * Encodes the specified CitedChunk message. Does not implicitly {@link google.cloud.ces.v1beta.Citations.CitedChunk.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Citations.CitedChunk - * @static - * @param {google.cloud.ces.v1beta.Citations.ICitedChunk} message CitedChunk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CitedChunk.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.text); - return writer; - }; - - /** - * Encodes the specified CitedChunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Citations.CitedChunk.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Citations.CitedChunk - * @static - * @param {google.cloud.ces.v1beta.Citations.ICitedChunk} message CitedChunk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CitedChunk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CitedChunk message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Citations.CitedChunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Citations.CitedChunk} CitedChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CitedChunk.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Citations.CitedChunk(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.uri = reader.string(); - break; - } - case 2: { - message.title = reader.string(); - break; - } - case 3: { - message.text = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CitedChunk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Citations.CitedChunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Citations.CitedChunk} CitedChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CitedChunk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CitedChunk message. - * @function verify - * @memberof google.cloud.ces.v1beta.Citations.CitedChunk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CitedChunk.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - return null; - }; - - /** - * Creates a CitedChunk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Citations.CitedChunk - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Citations.CitedChunk} CitedChunk - */ - CitedChunk.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Citations.CitedChunk) - return object; - var message = new $root.google.cloud.ces.v1beta.Citations.CitedChunk(); - if (object.uri != null) - message.uri = String(object.uri); - if (object.title != null) - message.title = String(object.title); - if (object.text != null) - message.text = String(object.text); - return message; - }; - - /** - * Creates a plain object from a CitedChunk message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Citations.CitedChunk - * @static - * @param {google.cloud.ces.v1beta.Citations.CitedChunk} message CitedChunk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CitedChunk.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.uri = ""; - object.title = ""; - object.text = ""; - } - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - return object; - }; - - /** - * Converts this CitedChunk to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Citations.CitedChunk - * @instance - * @returns {Object.} JSON object - */ - CitedChunk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CitedChunk - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Citations.CitedChunk - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CitedChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Citations.CitedChunk"; - }; - - return CitedChunk; - })(); - - return Citations; - })(); - - v1beta.Event = (function() { - - /** - * Properties of an Event. - * @memberof google.cloud.ces.v1beta - * @interface IEvent - * @property {string|null} [event] Event event - */ - - /** - * Constructs a new Event. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an Event. - * @implements IEvent - * @constructor - * @param {google.cloud.ces.v1beta.IEvent=} [properties] Properties to set - */ - function Event(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Event event. - * @member {string} event - * @memberof google.cloud.ces.v1beta.Event - * @instance - */ - Event.prototype.event = ""; - - /** - * Creates a new Event instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Event - * @static - * @param {google.cloud.ces.v1beta.IEvent=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Event} Event instance - */ - Event.create = function create(properties) { - return new Event(properties); - }; - - /** - * Encodes the specified Event message. Does not implicitly {@link google.cloud.ces.v1beta.Event.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Event - * @static - * @param {google.cloud.ces.v1beta.IEvent} message Event message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Event.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.event != null && Object.hasOwnProperty.call(message, "event")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.event); - return writer; - }; - - /** - * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Event.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Event - * @static - * @param {google.cloud.ces.v1beta.IEvent} message Event message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Event.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Event message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Event - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Event} Event - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Event.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Event(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.event = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Event message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Event - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Event} Event - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Event.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Event message. - * @function verify - * @memberof google.cloud.ces.v1beta.Event - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Event.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.event != null && message.hasOwnProperty("event")) - if (!$util.isString(message.event)) - return "event: string expected"; - return null; - }; - - /** - * Creates an Event message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Event - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Event} Event - */ - Event.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Event) - return object; - var message = new $root.google.cloud.ces.v1beta.Event(); - if (object.event != null) - message.event = String(object.event); - return message; - }; - - /** - * Creates a plain object from an Event message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Event - * @static - * @param {google.cloud.ces.v1beta.Event} message Event - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Event.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.event = ""; - if (message.event != null && message.hasOwnProperty("event")) - object.event = message.event; - return object; - }; - - /** - * Converts this Event to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Event - * @instance - * @returns {Object.} JSON object - */ - Event.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Event - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Event - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Event.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Event"; - }; - - return Event; - })(); - - v1beta.SessionInput = (function() { - - /** - * Properties of a SessionInput. - * @memberof google.cloud.ces.v1beta - * @interface ISessionInput - * @property {string|null} [text] SessionInput text - * @property {string|null} [dtmf] SessionInput dtmf - * @property {Uint8Array|null} [audio] SessionInput audio - * @property {google.cloud.ces.v1beta.IToolResponses|null} [toolResponses] SessionInput toolResponses - * @property {google.cloud.ces.v1beta.IImage|null} [image] SessionInput image - * @property {google.cloud.ces.v1beta.IBlob|null} [blob] SessionInput blob - * @property {google.protobuf.IStruct|null} [variables] SessionInput variables - * @property {google.cloud.ces.v1beta.IEvent|null} [event] SessionInput event - * @property {boolean|null} [willContinue] SessionInput willContinue - */ - - /** - * Constructs a new SessionInput. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a SessionInput. - * @implements ISessionInput - * @constructor - * @param {google.cloud.ces.v1beta.ISessionInput=} [properties] Properties to set - */ - function SessionInput(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SessionInput text. - * @member {string|null|undefined} text - * @memberof google.cloud.ces.v1beta.SessionInput - * @instance - */ - SessionInput.prototype.text = null; - - /** - * SessionInput dtmf. - * @member {string|null|undefined} dtmf - * @memberof google.cloud.ces.v1beta.SessionInput - * @instance - */ - SessionInput.prototype.dtmf = null; - - /** - * SessionInput audio. - * @member {Uint8Array|null|undefined} audio - * @memberof google.cloud.ces.v1beta.SessionInput - * @instance - */ - SessionInput.prototype.audio = null; - - /** - * SessionInput toolResponses. - * @member {google.cloud.ces.v1beta.IToolResponses|null|undefined} toolResponses - * @memberof google.cloud.ces.v1beta.SessionInput - * @instance - */ - SessionInput.prototype.toolResponses = null; - - /** - * SessionInput image. - * @member {google.cloud.ces.v1beta.IImage|null|undefined} image - * @memberof google.cloud.ces.v1beta.SessionInput - * @instance - */ - SessionInput.prototype.image = null; - - /** - * SessionInput blob. - * @member {google.cloud.ces.v1beta.IBlob|null|undefined} blob - * @memberof google.cloud.ces.v1beta.SessionInput - * @instance - */ - SessionInput.prototype.blob = null; - - /** - * SessionInput variables. - * @member {google.protobuf.IStruct|null|undefined} variables - * @memberof google.cloud.ces.v1beta.SessionInput - * @instance - */ - SessionInput.prototype.variables = null; - - /** - * SessionInput event. - * @member {google.cloud.ces.v1beta.IEvent|null|undefined} event - * @memberof google.cloud.ces.v1beta.SessionInput - * @instance - */ - SessionInput.prototype.event = null; - - /** - * SessionInput willContinue. - * @member {boolean} willContinue - * @memberof google.cloud.ces.v1beta.SessionInput - * @instance - */ - SessionInput.prototype.willContinue = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SessionInput inputType. - * @member {"text"|"dtmf"|"audio"|"toolResponses"|"image"|"blob"|"variables"|"event"|undefined} inputType - * @memberof google.cloud.ces.v1beta.SessionInput - * @instance - */ - Object.defineProperty(SessionInput.prototype, "inputType", { - get: $util.oneOfGetter($oneOfFields = ["text", "dtmf", "audio", "toolResponses", "image", "blob", "variables", "event"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SessionInput instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.SessionInput - * @static - * @param {google.cloud.ces.v1beta.ISessionInput=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.SessionInput} SessionInput instance - */ - SessionInput.create = function create(properties) { - return new SessionInput(properties); - }; - - /** - * Encodes the specified SessionInput message. Does not implicitly {@link google.cloud.ces.v1beta.SessionInput.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.SessionInput - * @static - * @param {google.cloud.ces.v1beta.ISessionInput} message SessionInput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionInput.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audio); - if (message.toolResponses != null && Object.hasOwnProperty.call(message, "toolResponses")) - $root.google.cloud.ces.v1beta.ToolResponses.encode(message.toolResponses, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - $root.google.cloud.ces.v1beta.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) - $root.google.protobuf.Struct.encode(message.variables, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.dtmf != null && Object.hasOwnProperty.call(message, "dtmf")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.dtmf); - if (message.blob != null && Object.hasOwnProperty.call(message, "blob")) - $root.google.cloud.ces.v1beta.Blob.encode(message.blob, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.willContinue != null && Object.hasOwnProperty.call(message, "willContinue")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.willContinue); - if (message.event != null && Object.hasOwnProperty.call(message, "event")) - $root.google.cloud.ces.v1beta.Event.encode(message.event, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SessionInput message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionInput.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.SessionInput - * @static - * @param {google.cloud.ces.v1beta.ISessionInput} message SessionInput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionInput.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SessionInput message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.SessionInput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.SessionInput} SessionInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionInput.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SessionInput(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.text = reader.string(); - break; - } - case 6: { - message.dtmf = reader.string(); - break; - } - case 2: { - message.audio = reader.bytes(); - break; - } - case 3: { - message.toolResponses = $root.google.cloud.ces.v1beta.ToolResponses.decode(reader, reader.uint32()); - break; - } - case 4: { - message.image = $root.google.cloud.ces.v1beta.Image.decode(reader, reader.uint32()); - break; - } - case 7: { - message.blob = $root.google.cloud.ces.v1beta.Blob.decode(reader, reader.uint32()); - break; - } - case 5: { - message.variables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 9: { - message.event = $root.google.cloud.ces.v1beta.Event.decode(reader, reader.uint32()); - break; - } - case 8: { - message.willContinue = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SessionInput message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.SessionInput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.SessionInput} SessionInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionInput.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SessionInput message. - * @function verify - * @memberof google.cloud.ces.v1beta.SessionInput - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SessionInput.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.text != null && message.hasOwnProperty("text")) { - properties.inputType = 1; - if (!$util.isString(message.text)) - return "text: string expected"; - } - if (message.dtmf != null && message.hasOwnProperty("dtmf")) { - if (properties.inputType === 1) - return "inputType: multiple values"; - properties.inputType = 1; - if (!$util.isString(message.dtmf)) - return "dtmf: string expected"; - } - if (message.audio != null && message.hasOwnProperty("audio")) { - if (properties.inputType === 1) - return "inputType: multiple values"; - properties.inputType = 1; - if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) - return "audio: buffer expected"; - } - if (message.toolResponses != null && message.hasOwnProperty("toolResponses")) { - if (properties.inputType === 1) - return "inputType: multiple values"; - properties.inputType = 1; - { - var error = $root.google.cloud.ces.v1beta.ToolResponses.verify(message.toolResponses); - if (error) - return "toolResponses." + error; - } - } - if (message.image != null && message.hasOwnProperty("image")) { - if (properties.inputType === 1) - return "inputType: multiple values"; - properties.inputType = 1; - { - var error = $root.google.cloud.ces.v1beta.Image.verify(message.image); - if (error) - return "image." + error; - } - } - if (message.blob != null && message.hasOwnProperty("blob")) { - if (properties.inputType === 1) - return "inputType: multiple values"; - properties.inputType = 1; - { - var error = $root.google.cloud.ces.v1beta.Blob.verify(message.blob); - if (error) - return "blob." + error; - } - } - if (message.variables != null && message.hasOwnProperty("variables")) { - if (properties.inputType === 1) - return "inputType: multiple values"; - properties.inputType = 1; - { - var error = $root.google.protobuf.Struct.verify(message.variables); - if (error) - return "variables." + error; - } - } - if (message.event != null && message.hasOwnProperty("event")) { - if (properties.inputType === 1) - return "inputType: multiple values"; - properties.inputType = 1; - { - var error = $root.google.cloud.ces.v1beta.Event.verify(message.event); - if (error) - return "event." + error; - } - } - if (message.willContinue != null && message.hasOwnProperty("willContinue")) - if (typeof message.willContinue !== "boolean") - return "willContinue: boolean expected"; - return null; - }; - - /** - * Creates a SessionInput message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.SessionInput - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.SessionInput} SessionInput - */ - SessionInput.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.SessionInput) - return object; - var message = new $root.google.cloud.ces.v1beta.SessionInput(); - if (object.text != null) - message.text = String(object.text); - if (object.dtmf != null) - message.dtmf = String(object.dtmf); - if (object.audio != null) - if (typeof object.audio === "string") - $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); - else if (object.audio.length >= 0) - message.audio = object.audio; - if (object.toolResponses != null) { - if (typeof object.toolResponses !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionInput.toolResponses: object expected"); - message.toolResponses = $root.google.cloud.ces.v1beta.ToolResponses.fromObject(object.toolResponses); - } - if (object.image != null) { - if (typeof object.image !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionInput.image: object expected"); - message.image = $root.google.cloud.ces.v1beta.Image.fromObject(object.image); - } - if (object.blob != null) { - if (typeof object.blob !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionInput.blob: object expected"); - message.blob = $root.google.cloud.ces.v1beta.Blob.fromObject(object.blob); - } - if (object.variables != null) { - if (typeof object.variables !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionInput.variables: object expected"); - message.variables = $root.google.protobuf.Struct.fromObject(object.variables); - } - if (object.event != null) { - if (typeof object.event !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionInput.event: object expected"); - message.event = $root.google.cloud.ces.v1beta.Event.fromObject(object.event); - } - if (object.willContinue != null) - message.willContinue = Boolean(object.willContinue); - return message; - }; - - /** - * Creates a plain object from a SessionInput message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.SessionInput - * @static - * @param {google.cloud.ces.v1beta.SessionInput} message SessionInput - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SessionInput.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.willContinue = false; - if (message.text != null && message.hasOwnProperty("text")) { - object.text = message.text; - if (options.oneofs) - object.inputType = "text"; - } - if (message.audio != null && message.hasOwnProperty("audio")) { - object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; - if (options.oneofs) - object.inputType = "audio"; - } - if (message.toolResponses != null && message.hasOwnProperty("toolResponses")) { - object.toolResponses = $root.google.cloud.ces.v1beta.ToolResponses.toObject(message.toolResponses, options); - if (options.oneofs) - object.inputType = "toolResponses"; - } - if (message.image != null && message.hasOwnProperty("image")) { - object.image = $root.google.cloud.ces.v1beta.Image.toObject(message.image, options); - if (options.oneofs) - object.inputType = "image"; - } - if (message.variables != null && message.hasOwnProperty("variables")) { - object.variables = $root.google.protobuf.Struct.toObject(message.variables, options); - if (options.oneofs) - object.inputType = "variables"; - } - if (message.dtmf != null && message.hasOwnProperty("dtmf")) { - object.dtmf = message.dtmf; - if (options.oneofs) - object.inputType = "dtmf"; - } - if (message.blob != null && message.hasOwnProperty("blob")) { - object.blob = $root.google.cloud.ces.v1beta.Blob.toObject(message.blob, options); - if (options.oneofs) - object.inputType = "blob"; - } - if (message.willContinue != null && message.hasOwnProperty("willContinue")) - object.willContinue = message.willContinue; - if (message.event != null && message.hasOwnProperty("event")) { - object.event = $root.google.cloud.ces.v1beta.Event.toObject(message.event, options); - if (options.oneofs) - object.inputType = "event"; - } - return object; - }; - - /** - * Converts this SessionInput to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.SessionInput - * @instance - * @returns {Object.} JSON object - */ - SessionInput.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SessionInput - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.SessionInput - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SessionInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.SessionInput"; - }; - - return SessionInput; - })(); - - v1beta.SessionOutput = (function() { - - /** - * Properties of a SessionOutput. - * @memberof google.cloud.ces.v1beta - * @interface ISessionOutput - * @property {string|null} [text] SessionOutput text - * @property {Uint8Array|null} [audio] SessionOutput audio - * @property {google.cloud.ces.v1beta.IToolCalls|null} [toolCalls] SessionOutput toolCalls - * @property {google.cloud.ces.v1beta.ICitations|null} [citations] SessionOutput citations - * @property {google.cloud.ces.v1beta.IGoogleSearchSuggestions|null} [googleSearchSuggestions] SessionOutput googleSearchSuggestions - * @property {google.cloud.ces.v1beta.IEndSession|null} [endSession] SessionOutput endSession - * @property {google.protobuf.IStruct|null} [payload] SessionOutput payload - * @property {number|null} [turnIndex] SessionOutput turnIndex - * @property {boolean|null} [turnCompleted] SessionOutput turnCompleted - * @property {google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo|null} [diagnosticInfo] SessionOutput diagnosticInfo - */ - - /** - * Constructs a new SessionOutput. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a SessionOutput. - * @implements ISessionOutput - * @constructor - * @param {google.cloud.ces.v1beta.ISessionOutput=} [properties] Properties to set - */ - function SessionOutput(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SessionOutput text. - * @member {string|null|undefined} text - * @memberof google.cloud.ces.v1beta.SessionOutput - * @instance - */ - SessionOutput.prototype.text = null; - - /** - * SessionOutput audio. - * @member {Uint8Array|null|undefined} audio - * @memberof google.cloud.ces.v1beta.SessionOutput - * @instance - */ - SessionOutput.prototype.audio = null; - - /** - * SessionOutput toolCalls. - * @member {google.cloud.ces.v1beta.IToolCalls|null|undefined} toolCalls - * @memberof google.cloud.ces.v1beta.SessionOutput - * @instance - */ - SessionOutput.prototype.toolCalls = null; - - /** - * SessionOutput citations. - * @member {google.cloud.ces.v1beta.ICitations|null|undefined} citations - * @memberof google.cloud.ces.v1beta.SessionOutput - * @instance - */ - SessionOutput.prototype.citations = null; - - /** - * SessionOutput googleSearchSuggestions. - * @member {google.cloud.ces.v1beta.IGoogleSearchSuggestions|null|undefined} googleSearchSuggestions - * @memberof google.cloud.ces.v1beta.SessionOutput - * @instance - */ - SessionOutput.prototype.googleSearchSuggestions = null; - - /** - * SessionOutput endSession. - * @member {google.cloud.ces.v1beta.IEndSession|null|undefined} endSession - * @memberof google.cloud.ces.v1beta.SessionOutput - * @instance - */ - SessionOutput.prototype.endSession = null; - - /** - * SessionOutput payload. - * @member {google.protobuf.IStruct|null|undefined} payload - * @memberof google.cloud.ces.v1beta.SessionOutput - * @instance - */ - SessionOutput.prototype.payload = null; - - /** - * SessionOutput turnIndex. - * @member {number} turnIndex - * @memberof google.cloud.ces.v1beta.SessionOutput - * @instance - */ - SessionOutput.prototype.turnIndex = 0; - - /** - * SessionOutput turnCompleted. - * @member {boolean} turnCompleted - * @memberof google.cloud.ces.v1beta.SessionOutput - * @instance - */ - SessionOutput.prototype.turnCompleted = false; - - /** - * SessionOutput diagnosticInfo. - * @member {google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo|null|undefined} diagnosticInfo - * @memberof google.cloud.ces.v1beta.SessionOutput - * @instance - */ - SessionOutput.prototype.diagnosticInfo = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SessionOutput outputType. - * @member {"text"|"audio"|"toolCalls"|"citations"|"googleSearchSuggestions"|"endSession"|"payload"|undefined} outputType - * @memberof google.cloud.ces.v1beta.SessionOutput - * @instance - */ - Object.defineProperty(SessionOutput.prototype, "outputType", { - get: $util.oneOfGetter($oneOfFields = ["text", "audio", "toolCalls", "citations", "googleSearchSuggestions", "endSession", "payload"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SessionOutput instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.SessionOutput - * @static - * @param {google.cloud.ces.v1beta.ISessionOutput=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.SessionOutput} SessionOutput instance - */ - SessionOutput.create = function create(properties) { - return new SessionOutput(properties); - }; - - /** - * Encodes the specified SessionOutput message. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.SessionOutput - * @static - * @param {google.cloud.ces.v1beta.ISessionOutput} message SessionOutput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionOutput.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audio); - if (message.toolCalls != null && Object.hasOwnProperty.call(message, "toolCalls")) - $root.google.cloud.ces.v1beta.ToolCalls.encode(message.toolCalls, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.turnCompleted != null && Object.hasOwnProperty.call(message, "turnCompleted")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.turnCompleted); - if (message.turnIndex != null && Object.hasOwnProperty.call(message, "turnIndex")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.turnIndex); - if (message.diagnosticInfo != null && Object.hasOwnProperty.call(message, "diagnosticInfo")) - $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.encode(message.diagnosticInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.citations != null && Object.hasOwnProperty.call(message, "citations")) - $root.google.cloud.ces.v1beta.Citations.encode(message.citations, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.endSession != null && Object.hasOwnProperty.call(message, "endSession")) - $root.google.cloud.ces.v1beta.EndSession.encode(message.endSession, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.googleSearchSuggestions != null && Object.hasOwnProperty.call(message, "googleSearchSuggestions")) - $root.google.cloud.ces.v1beta.GoogleSearchSuggestions.encode(message.googleSearchSuggestions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SessionOutput message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.SessionOutput - * @static - * @param {google.cloud.ces.v1beta.ISessionOutput} message SessionOutput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionOutput.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SessionOutput message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.SessionOutput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.SessionOutput} SessionOutput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionOutput.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SessionOutput(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.text = reader.string(); - break; - } - case 2: { - message.audio = reader.bytes(); - break; - } - case 3: { - message.toolCalls = $root.google.cloud.ces.v1beta.ToolCalls.decode(reader, reader.uint32()); - break; - } - case 8: { - message.citations = $root.google.cloud.ces.v1beta.Citations.decode(reader, reader.uint32()); - break; - } - case 10: { - message.googleSearchSuggestions = $root.google.cloud.ces.v1beta.GoogleSearchSuggestions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.endSession = $root.google.cloud.ces.v1beta.EndSession.decode(reader, reader.uint32()); - break; - } - case 11: { - message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 6: { - message.turnIndex = reader.int32(); - break; - } - case 4: { - message.turnCompleted = reader.bool(); - break; - } - case 7: { - message.diagnosticInfo = $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SessionOutput message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.SessionOutput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.SessionOutput} SessionOutput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionOutput.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SessionOutput message. - * @function verify - * @memberof google.cloud.ces.v1beta.SessionOutput - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SessionOutput.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.text != null && message.hasOwnProperty("text")) { - properties.outputType = 1; - if (!$util.isString(message.text)) - return "text: string expected"; - } - if (message.audio != null && message.hasOwnProperty("audio")) { - if (properties.outputType === 1) - return "outputType: multiple values"; - properties.outputType = 1; - if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) - return "audio: buffer expected"; - } - if (message.toolCalls != null && message.hasOwnProperty("toolCalls")) { - if (properties.outputType === 1) - return "outputType: multiple values"; - properties.outputType = 1; - { - var error = $root.google.cloud.ces.v1beta.ToolCalls.verify(message.toolCalls); - if (error) - return "toolCalls." + error; - } - } - if (message.citations != null && message.hasOwnProperty("citations")) { - if (properties.outputType === 1) - return "outputType: multiple values"; - properties.outputType = 1; - { - var error = $root.google.cloud.ces.v1beta.Citations.verify(message.citations); - if (error) - return "citations." + error; - } - } - if (message.googleSearchSuggestions != null && message.hasOwnProperty("googleSearchSuggestions")) { - if (properties.outputType === 1) - return "outputType: multiple values"; - properties.outputType = 1; - { - var error = $root.google.cloud.ces.v1beta.GoogleSearchSuggestions.verify(message.googleSearchSuggestions); - if (error) - return "googleSearchSuggestions." + error; - } - } - if (message.endSession != null && message.hasOwnProperty("endSession")) { - if (properties.outputType === 1) - return "outputType: multiple values"; - properties.outputType = 1; - { - var error = $root.google.cloud.ces.v1beta.EndSession.verify(message.endSession); - if (error) - return "endSession." + error; - } - } - if (message.payload != null && message.hasOwnProperty("payload")) { - if (properties.outputType === 1) - return "outputType: multiple values"; - properties.outputType = 1; - { - var error = $root.google.protobuf.Struct.verify(message.payload); - if (error) - return "payload." + error; - } - } - if (message.turnIndex != null && message.hasOwnProperty("turnIndex")) - if (!$util.isInteger(message.turnIndex)) - return "turnIndex: integer expected"; - if (message.turnCompleted != null && message.hasOwnProperty("turnCompleted")) - if (typeof message.turnCompleted !== "boolean") - return "turnCompleted: boolean expected"; - if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) { - var error = $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.verify(message.diagnosticInfo); - if (error) - return "diagnosticInfo." + error; - } - return null; - }; - - /** - * Creates a SessionOutput message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.SessionOutput - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.SessionOutput} SessionOutput - */ - SessionOutput.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.SessionOutput) - return object; - var message = new $root.google.cloud.ces.v1beta.SessionOutput(); - if (object.text != null) - message.text = String(object.text); - if (object.audio != null) - if (typeof object.audio === "string") - $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); - else if (object.audio.length >= 0) - message.audio = object.audio; - if (object.toolCalls != null) { - if (typeof object.toolCalls !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionOutput.toolCalls: object expected"); - message.toolCalls = $root.google.cloud.ces.v1beta.ToolCalls.fromObject(object.toolCalls); - } - if (object.citations != null) { - if (typeof object.citations !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionOutput.citations: object expected"); - message.citations = $root.google.cloud.ces.v1beta.Citations.fromObject(object.citations); - } - if (object.googleSearchSuggestions != null) { - if (typeof object.googleSearchSuggestions !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionOutput.googleSearchSuggestions: object expected"); - message.googleSearchSuggestions = $root.google.cloud.ces.v1beta.GoogleSearchSuggestions.fromObject(object.googleSearchSuggestions); - } - if (object.endSession != null) { - if (typeof object.endSession !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionOutput.endSession: object expected"); - message.endSession = $root.google.cloud.ces.v1beta.EndSession.fromObject(object.endSession); - } - if (object.payload != null) { - if (typeof object.payload !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionOutput.payload: object expected"); - message.payload = $root.google.protobuf.Struct.fromObject(object.payload); - } - if (object.turnIndex != null) - message.turnIndex = object.turnIndex | 0; - if (object.turnCompleted != null) - message.turnCompleted = Boolean(object.turnCompleted); - if (object.diagnosticInfo != null) { - if (typeof object.diagnosticInfo !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionOutput.diagnosticInfo: object expected"); - message.diagnosticInfo = $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.fromObject(object.diagnosticInfo); - } - return message; - }; - - /** - * Creates a plain object from a SessionOutput message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.SessionOutput - * @static - * @param {google.cloud.ces.v1beta.SessionOutput} message SessionOutput - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SessionOutput.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.turnCompleted = false; - object.turnIndex = 0; - object.diagnosticInfo = null; - } - if (message.text != null && message.hasOwnProperty("text")) { - object.text = message.text; - if (options.oneofs) - object.outputType = "text"; - } - if (message.audio != null && message.hasOwnProperty("audio")) { - object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; - if (options.oneofs) - object.outputType = "audio"; - } - if (message.toolCalls != null && message.hasOwnProperty("toolCalls")) { - object.toolCalls = $root.google.cloud.ces.v1beta.ToolCalls.toObject(message.toolCalls, options); - if (options.oneofs) - object.outputType = "toolCalls"; - } - if (message.turnCompleted != null && message.hasOwnProperty("turnCompleted")) - object.turnCompleted = message.turnCompleted; - if (message.turnIndex != null && message.hasOwnProperty("turnIndex")) - object.turnIndex = message.turnIndex; - if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) - object.diagnosticInfo = $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.toObject(message.diagnosticInfo, options); - if (message.citations != null && message.hasOwnProperty("citations")) { - object.citations = $root.google.cloud.ces.v1beta.Citations.toObject(message.citations, options); - if (options.oneofs) - object.outputType = "citations"; - } - if (message.endSession != null && message.hasOwnProperty("endSession")) { - object.endSession = $root.google.cloud.ces.v1beta.EndSession.toObject(message.endSession, options); - if (options.oneofs) - object.outputType = "endSession"; - } - if (message.googleSearchSuggestions != null && message.hasOwnProperty("googleSearchSuggestions")) { - object.googleSearchSuggestions = $root.google.cloud.ces.v1beta.GoogleSearchSuggestions.toObject(message.googleSearchSuggestions, options); - if (options.oneofs) - object.outputType = "googleSearchSuggestions"; - } - if (message.payload != null && message.hasOwnProperty("payload")) { - object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); - if (options.oneofs) - object.outputType = "payload"; - } - return object; - }; - - /** - * Converts this SessionOutput to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.SessionOutput - * @instance - * @returns {Object.} JSON object - */ - SessionOutput.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SessionOutput - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.SessionOutput - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SessionOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.SessionOutput"; - }; - - SessionOutput.DiagnosticInfo = (function() { - - /** - * Properties of a DiagnosticInfo. - * @memberof google.cloud.ces.v1beta.SessionOutput - * @interface IDiagnosticInfo - * @property {Array.|null} [messages] DiagnosticInfo messages - * @property {google.cloud.ces.v1beta.ISpan|null} [rootSpan] DiagnosticInfo rootSpan - */ - - /** - * Constructs a new DiagnosticInfo. - * @memberof google.cloud.ces.v1beta.SessionOutput - * @classdesc Represents a DiagnosticInfo. - * @implements IDiagnosticInfo - * @constructor - * @param {google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo=} [properties] Properties to set - */ - function DiagnosticInfo(properties) { - this.messages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DiagnosticInfo messages. - * @member {Array.} messages - * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo - * @instance - */ - DiagnosticInfo.prototype.messages = $util.emptyArray; - - /** - * DiagnosticInfo rootSpan. - * @member {google.cloud.ces.v1beta.ISpan|null|undefined} rootSpan - * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo - * @instance - */ - DiagnosticInfo.prototype.rootSpan = null; - - /** - * Creates a new DiagnosticInfo instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo - * @static - * @param {google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo} DiagnosticInfo instance - */ - DiagnosticInfo.create = function create(properties) { - return new DiagnosticInfo(properties); - }; - - /** - * Encodes the specified DiagnosticInfo message. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo - * @static - * @param {google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo} message DiagnosticInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiagnosticInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.google.cloud.ces.v1beta.Message.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.rootSpan != null && Object.hasOwnProperty.call(message, "rootSpan")) - $root.google.cloud.ces.v1beta.Span.encode(message.rootSpan, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DiagnosticInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo - * @static - * @param {google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo} message DiagnosticInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiagnosticInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DiagnosticInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo} DiagnosticInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiagnosticInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32())); - break; - } - case 3: { - message.rootSpan = $root.google.cloud.ces.v1beta.Span.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DiagnosticInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo} DiagnosticInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiagnosticInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DiagnosticInfo message. - * @function verify - * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DiagnosticInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Message.verify(message.messages[i]); - if (error) - return "messages." + error; - } - } - if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) { - var error = $root.google.cloud.ces.v1beta.Span.verify(message.rootSpan); - if (error) - return "rootSpan." + error; - } - return null; - }; - - /** - * Creates a DiagnosticInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo} DiagnosticInfo - */ - DiagnosticInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo) - return object; - var message = new $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo(); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.messages: object expected"); - message.messages[i] = $root.google.cloud.ces.v1beta.Message.fromObject(object.messages[i]); - } - } - if (object.rootSpan != null) { - if (typeof object.rootSpan !== "object") - throw TypeError(".google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.rootSpan: object expected"); - message.rootSpan = $root.google.cloud.ces.v1beta.Span.fromObject(object.rootSpan); - } - return message; - }; - - /** - * Creates a plain object from a DiagnosticInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo - * @static - * @param {google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo} message DiagnosticInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DiagnosticInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.messages = []; - if (options.defaults) - object.rootSpan = null; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.cloud.ces.v1beta.Message.toObject(message.messages[j], options); - } - if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) - object.rootSpan = $root.google.cloud.ces.v1beta.Span.toObject(message.rootSpan, options); - return object; - }; - - /** - * Converts this DiagnosticInfo to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo - * @instance - * @returns {Object.} JSON object - */ - DiagnosticInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DiagnosticInfo - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DiagnosticInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo"; - }; - - return DiagnosticInfo; - })(); - - return SessionOutput; - })(); - - v1beta.RecognitionResult = (function() { - - /** - * Properties of a RecognitionResult. - * @memberof google.cloud.ces.v1beta - * @interface IRecognitionResult - * @property {string|null} [transcript] RecognitionResult transcript - */ - - /** - * Constructs a new RecognitionResult. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a RecognitionResult. - * @implements IRecognitionResult - * @constructor - * @param {google.cloud.ces.v1beta.IRecognitionResult=} [properties] Properties to set - */ - function RecognitionResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RecognitionResult transcript. - * @member {string} transcript - * @memberof google.cloud.ces.v1beta.RecognitionResult - * @instance - */ - RecognitionResult.prototype.transcript = ""; - - /** - * Creates a new RecognitionResult instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.RecognitionResult - * @static - * @param {google.cloud.ces.v1beta.IRecognitionResult=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.RecognitionResult} RecognitionResult instance - */ - RecognitionResult.create = function create(properties) { - return new RecognitionResult(properties); - }; - - /** - * Encodes the specified RecognitionResult message. Does not implicitly {@link google.cloud.ces.v1beta.RecognitionResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.RecognitionResult - * @static - * @param {google.cloud.ces.v1beta.IRecognitionResult} message RecognitionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RecognitionResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.transcript); - return writer; - }; - - /** - * Encodes the specified RecognitionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RecognitionResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.RecognitionResult - * @static - * @param {google.cloud.ces.v1beta.IRecognitionResult} message RecognitionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RecognitionResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.RecognitionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.RecognitionResult} RecognitionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RecognitionResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RecognitionResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.transcript = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RecognitionResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.RecognitionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.RecognitionResult} RecognitionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RecognitionResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RecognitionResult message. - * @function verify - * @memberof google.cloud.ces.v1beta.RecognitionResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RecognitionResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.transcript != null && message.hasOwnProperty("transcript")) - if (!$util.isString(message.transcript)) - return "transcript: string expected"; - return null; - }; - - /** - * Creates a RecognitionResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.RecognitionResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.RecognitionResult} RecognitionResult - */ - RecognitionResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.RecognitionResult) - return object; - var message = new $root.google.cloud.ces.v1beta.RecognitionResult(); - if (object.transcript != null) - message.transcript = String(object.transcript); - return message; - }; - - /** - * Creates a plain object from a RecognitionResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.RecognitionResult - * @static - * @param {google.cloud.ces.v1beta.RecognitionResult} message RecognitionResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RecognitionResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.transcript = ""; - if (message.transcript != null && message.hasOwnProperty("transcript")) - object.transcript = message.transcript; - return object; - }; - - /** - * Converts this RecognitionResult to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.RecognitionResult - * @instance - * @returns {Object.} JSON object - */ - RecognitionResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RecognitionResult - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.RecognitionResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RecognitionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.RecognitionResult"; - }; - - return RecognitionResult; - })(); - - v1beta.InterruptionSignal = (function() { - - /** - * Properties of an InterruptionSignal. - * @memberof google.cloud.ces.v1beta - * @interface IInterruptionSignal - * @property {boolean|null} [bargeIn] InterruptionSignal bargeIn - */ - - /** - * Constructs a new InterruptionSignal. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an InterruptionSignal. - * @implements IInterruptionSignal - * @constructor - * @param {google.cloud.ces.v1beta.IInterruptionSignal=} [properties] Properties to set - */ - function InterruptionSignal(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InterruptionSignal bargeIn. - * @member {boolean} bargeIn - * @memberof google.cloud.ces.v1beta.InterruptionSignal - * @instance - */ - InterruptionSignal.prototype.bargeIn = false; - - /** - * Creates a new InterruptionSignal instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.InterruptionSignal - * @static - * @param {google.cloud.ces.v1beta.IInterruptionSignal=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.InterruptionSignal} InterruptionSignal instance - */ - InterruptionSignal.create = function create(properties) { - return new InterruptionSignal(properties); - }; - - /** - * Encodes the specified InterruptionSignal message. Does not implicitly {@link google.cloud.ces.v1beta.InterruptionSignal.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.InterruptionSignal - * @static - * @param {google.cloud.ces.v1beta.IInterruptionSignal} message InterruptionSignal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InterruptionSignal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bargeIn != null && Object.hasOwnProperty.call(message, "bargeIn")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.bargeIn); - return writer; - }; - - /** - * Encodes the specified InterruptionSignal message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.InterruptionSignal.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.InterruptionSignal - * @static - * @param {google.cloud.ces.v1beta.IInterruptionSignal} message InterruptionSignal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InterruptionSignal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InterruptionSignal message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.InterruptionSignal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.InterruptionSignal} InterruptionSignal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InterruptionSignal.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.InterruptionSignal(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.bargeIn = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InterruptionSignal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.InterruptionSignal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.InterruptionSignal} InterruptionSignal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InterruptionSignal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InterruptionSignal message. - * @function verify - * @memberof google.cloud.ces.v1beta.InterruptionSignal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InterruptionSignal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bargeIn != null && message.hasOwnProperty("bargeIn")) - if (typeof message.bargeIn !== "boolean") - return "bargeIn: boolean expected"; - return null; - }; - - /** - * Creates an InterruptionSignal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.InterruptionSignal - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.InterruptionSignal} InterruptionSignal - */ - InterruptionSignal.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.InterruptionSignal) - return object; - var message = new $root.google.cloud.ces.v1beta.InterruptionSignal(); - if (object.bargeIn != null) - message.bargeIn = Boolean(object.bargeIn); - return message; - }; - - /** - * Creates a plain object from an InterruptionSignal message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.InterruptionSignal - * @static - * @param {google.cloud.ces.v1beta.InterruptionSignal} message InterruptionSignal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InterruptionSignal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.bargeIn = false; - if (message.bargeIn != null && message.hasOwnProperty("bargeIn")) - object.bargeIn = message.bargeIn; - return object; - }; - - /** - * Converts this InterruptionSignal to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.InterruptionSignal - * @instance - * @returns {Object.} JSON object - */ - InterruptionSignal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InterruptionSignal - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.InterruptionSignal - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InterruptionSignal.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.InterruptionSignal"; - }; - - return InterruptionSignal; - })(); - - v1beta.EndSession = (function() { - - /** - * Properties of an EndSession. - * @memberof google.cloud.ces.v1beta - * @interface IEndSession - * @property {google.protobuf.IStruct|null} [metadata] EndSession metadata - */ - - /** - * Constructs a new EndSession. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an EndSession. - * @implements IEndSession - * @constructor - * @param {google.cloud.ces.v1beta.IEndSession=} [properties] Properties to set - */ - function EndSession(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EndSession metadata. - * @member {google.protobuf.IStruct|null|undefined} metadata - * @memberof google.cloud.ces.v1beta.EndSession - * @instance - */ - EndSession.prototype.metadata = null; - - /** - * Creates a new EndSession instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.EndSession - * @static - * @param {google.cloud.ces.v1beta.IEndSession=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.EndSession} EndSession instance - */ - EndSession.create = function create(properties) { - return new EndSession(properties); - }; - - /** - * Encodes the specified EndSession message. Does not implicitly {@link google.cloud.ces.v1beta.EndSession.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.EndSession - * @static - * @param {google.cloud.ces.v1beta.IEndSession} message EndSession message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EndSession.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EndSession message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndSession.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.EndSession - * @static - * @param {google.cloud.ces.v1beta.IEndSession} message EndSession message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EndSession.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EndSession message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.EndSession - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.EndSession} EndSession - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EndSession.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EndSession(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EndSession message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.EndSession - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.EndSession} EndSession - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EndSession.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EndSession message. - * @function verify - * @memberof google.cloud.ces.v1beta.EndSession - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EndSession.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Struct.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates an EndSession message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.EndSession - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.EndSession} EndSession - */ - EndSession.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.EndSession) - return object; - var message = new $root.google.cloud.ces.v1beta.EndSession(); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.ces.v1beta.EndSession.metadata: object expected"); - message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from an EndSession message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.EndSession - * @static - * @param {google.cloud.ces.v1beta.EndSession} message EndSession - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EndSession.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this EndSession to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.EndSession - * @instance - * @returns {Object.} JSON object - */ - EndSession.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EndSession - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.EndSession - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EndSession.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.EndSession"; - }; - - return EndSession; - })(); - - v1beta.GoAway = (function() { - - /** - * Properties of a GoAway. - * @memberof google.cloud.ces.v1beta - * @interface IGoAway - */ - - /** - * Constructs a new GoAway. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GoAway. - * @implements IGoAway - * @constructor - * @param {google.cloud.ces.v1beta.IGoAway=} [properties] Properties to set - */ - function GoAway(properties) { - if (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 GoAway instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GoAway - * @static - * @param {google.cloud.ces.v1beta.IGoAway=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GoAway} GoAway instance - */ - GoAway.create = function create(properties) { - return new GoAway(properties); - }; - - /** - * Encodes the specified GoAway message. Does not implicitly {@link google.cloud.ces.v1beta.GoAway.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GoAway - * @static - * @param {google.cloud.ces.v1beta.IGoAway} message GoAway message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoAway.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified GoAway message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoAway.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GoAway - * @static - * @param {google.cloud.ces.v1beta.IGoAway} message GoAway message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoAway.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoAway message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GoAway - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GoAway} GoAway - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoAway.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GoAway(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoAway message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GoAway - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GoAway} GoAway - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoAway.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoAway message. - * @function verify - * @memberof google.cloud.ces.v1beta.GoAway - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoAway.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a GoAway message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GoAway - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GoAway} GoAway - */ - GoAway.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GoAway) - return object; - return new $root.google.cloud.ces.v1beta.GoAway(); - }; - - /** - * Creates a plain object from a GoAway message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GoAway - * @static - * @param {google.cloud.ces.v1beta.GoAway} message GoAway - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoAway.toObject = function toObject() { - return {}; - }; - - /** - * Converts this GoAway to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GoAway - * @instance - * @returns {Object.} JSON object - */ - GoAway.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoAway - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GoAway - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoAway.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GoAway"; - }; - - return GoAway; - })(); - - v1beta.RunSessionRequest = (function() { - - /** - * Properties of a RunSessionRequest. - * @memberof google.cloud.ces.v1beta - * @interface IRunSessionRequest - * @property {google.cloud.ces.v1beta.ISessionConfig|null} [config] RunSessionRequest config - * @property {Array.|null} [inputs] RunSessionRequest inputs - */ - - /** - * Constructs a new RunSessionRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a RunSessionRequest. - * @implements IRunSessionRequest - * @constructor - * @param {google.cloud.ces.v1beta.IRunSessionRequest=} [properties] Properties to set - */ - function RunSessionRequest(properties) { - this.inputs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RunSessionRequest config. - * @member {google.cloud.ces.v1beta.ISessionConfig|null|undefined} config - * @memberof google.cloud.ces.v1beta.RunSessionRequest - * @instance - */ - RunSessionRequest.prototype.config = null; - - /** - * RunSessionRequest inputs. - * @member {Array.} inputs - * @memberof google.cloud.ces.v1beta.RunSessionRequest - * @instance - */ - RunSessionRequest.prototype.inputs = $util.emptyArray; - - /** - * Creates a new RunSessionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.RunSessionRequest - * @static - * @param {google.cloud.ces.v1beta.IRunSessionRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.RunSessionRequest} RunSessionRequest instance - */ - RunSessionRequest.create = function create(properties) { - return new RunSessionRequest(properties); - }; - - /** - * Encodes the specified RunSessionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.RunSessionRequest - * @static - * @param {google.cloud.ces.v1beta.IRunSessionRequest} message RunSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunSessionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.cloud.ces.v1beta.SessionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.inputs != null && message.inputs.length) - for (var i = 0; i < message.inputs.length; ++i) - $root.google.cloud.ces.v1beta.SessionInput.encode(message.inputs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RunSessionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.RunSessionRequest - * @static - * @param {google.cloud.ces.v1beta.IRunSessionRequest} message RunSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RunSessionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.RunSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.RunSessionRequest} RunSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunSessionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RunSessionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.config = $root.google.cloud.ces.v1beta.SessionConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.inputs && message.inputs.length)) - message.inputs = []; - message.inputs.push($root.google.cloud.ces.v1beta.SessionInput.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RunSessionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.RunSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.RunSessionRequest} RunSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunSessionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RunSessionRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.RunSessionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunSessionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.config != null && message.hasOwnProperty("config")) { - var error = $root.google.cloud.ces.v1beta.SessionConfig.verify(message.config); - if (error) - return "config." + error; - } - if (message.inputs != null && message.hasOwnProperty("inputs")) { - if (!Array.isArray(message.inputs)) - return "inputs: array expected"; - for (var i = 0; i < message.inputs.length; ++i) { - var error = $root.google.cloud.ces.v1beta.SessionInput.verify(message.inputs[i]); - if (error) - return "inputs." + error; - } - } - return null; - }; - - /** - * Creates a RunSessionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.RunSessionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.RunSessionRequest} RunSessionRequest - */ - RunSessionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.RunSessionRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.RunSessionRequest(); - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.ces.v1beta.RunSessionRequest.config: object expected"); - message.config = $root.google.cloud.ces.v1beta.SessionConfig.fromObject(object.config); - } - if (object.inputs) { - if (!Array.isArray(object.inputs)) - throw TypeError(".google.cloud.ces.v1beta.RunSessionRequest.inputs: array expected"); - message.inputs = []; - for (var i = 0; i < object.inputs.length; ++i) { - if (typeof object.inputs[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.RunSessionRequest.inputs: object expected"); - message.inputs[i] = $root.google.cloud.ces.v1beta.SessionInput.fromObject(object.inputs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RunSessionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.RunSessionRequest - * @static - * @param {google.cloud.ces.v1beta.RunSessionRequest} message RunSessionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunSessionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.inputs = []; - if (options.defaults) - object.config = null; - if (message.config != null && message.hasOwnProperty("config")) - object.config = $root.google.cloud.ces.v1beta.SessionConfig.toObject(message.config, options); - if (message.inputs && message.inputs.length) { - object.inputs = []; - for (var j = 0; j < message.inputs.length; ++j) - object.inputs[j] = $root.google.cloud.ces.v1beta.SessionInput.toObject(message.inputs[j], options); - } - return object; - }; - - /** - * Converts this RunSessionRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.RunSessionRequest - * @instance - * @returns {Object.} JSON object - */ - RunSessionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RunSessionRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.RunSessionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.RunSessionRequest"; - }; - - return RunSessionRequest; - })(); - - v1beta.RunSessionResponse = (function() { - - /** - * Properties of a RunSessionResponse. - * @memberof google.cloud.ces.v1beta - * @interface IRunSessionResponse - * @property {Array.|null} [outputs] RunSessionResponse outputs - */ - - /** - * Constructs a new RunSessionResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a RunSessionResponse. - * @implements IRunSessionResponse - * @constructor - * @param {google.cloud.ces.v1beta.IRunSessionResponse=} [properties] Properties to set - */ - function RunSessionResponse(properties) { - this.outputs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RunSessionResponse outputs. - * @member {Array.} outputs - * @memberof google.cloud.ces.v1beta.RunSessionResponse - * @instance - */ - RunSessionResponse.prototype.outputs = $util.emptyArray; - - /** - * Creates a new RunSessionResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.RunSessionResponse - * @static - * @param {google.cloud.ces.v1beta.IRunSessionResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.RunSessionResponse} RunSessionResponse instance - */ - RunSessionResponse.create = function create(properties) { - return new RunSessionResponse(properties); - }; - - /** - * Encodes the specified RunSessionResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.RunSessionResponse - * @static - * @param {google.cloud.ces.v1beta.IRunSessionResponse} message RunSessionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunSessionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.outputs != null && message.outputs.length) - for (var i = 0; i < message.outputs.length; ++i) - $root.google.cloud.ces.v1beta.SessionOutput.encode(message.outputs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RunSessionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.RunSessionResponse - * @static - * @param {google.cloud.ces.v1beta.IRunSessionResponse} message RunSessionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunSessionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RunSessionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.RunSessionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.RunSessionResponse} RunSessionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunSessionResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RunSessionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.outputs && message.outputs.length)) - message.outputs = []; - message.outputs.push($root.google.cloud.ces.v1beta.SessionOutput.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RunSessionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.RunSessionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.RunSessionResponse} RunSessionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunSessionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RunSessionResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.RunSessionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunSessionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.outputs != null && message.hasOwnProperty("outputs")) { - if (!Array.isArray(message.outputs)) - return "outputs: array expected"; - for (var i = 0; i < message.outputs.length; ++i) { - var error = $root.google.cloud.ces.v1beta.SessionOutput.verify(message.outputs[i]); - if (error) - return "outputs." + error; - } - } - return null; - }; - - /** - * Creates a RunSessionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.RunSessionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.RunSessionResponse} RunSessionResponse - */ - RunSessionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.RunSessionResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.RunSessionResponse(); - if (object.outputs) { - if (!Array.isArray(object.outputs)) - throw TypeError(".google.cloud.ces.v1beta.RunSessionResponse.outputs: array expected"); - message.outputs = []; - for (var i = 0; i < object.outputs.length; ++i) { - if (typeof object.outputs[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.RunSessionResponse.outputs: object expected"); - message.outputs[i] = $root.google.cloud.ces.v1beta.SessionOutput.fromObject(object.outputs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RunSessionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.RunSessionResponse - * @static - * @param {google.cloud.ces.v1beta.RunSessionResponse} message RunSessionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunSessionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.outputs = []; - if (message.outputs && message.outputs.length) { - object.outputs = []; - for (var j = 0; j < message.outputs.length; ++j) - object.outputs[j] = $root.google.cloud.ces.v1beta.SessionOutput.toObject(message.outputs[j], options); - } - return object; - }; - - /** - * Converts this RunSessionResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.RunSessionResponse - * @instance - * @returns {Object.} JSON object - */ - RunSessionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RunSessionResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.RunSessionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunSessionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.RunSessionResponse"; - }; - - return RunSessionResponse; - })(); - - v1beta.BidiSessionClientMessage = (function() { - - /** - * Properties of a BidiSessionClientMessage. - * @memberof google.cloud.ces.v1beta - * @interface IBidiSessionClientMessage - * @property {google.cloud.ces.v1beta.ISessionConfig|null} [config] BidiSessionClientMessage config - * @property {google.cloud.ces.v1beta.ISessionInput|null} [realtimeInput] BidiSessionClientMessage realtimeInput - */ - - /** - * Constructs a new BidiSessionClientMessage. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a BidiSessionClientMessage. - * @implements IBidiSessionClientMessage - * @constructor - * @param {google.cloud.ces.v1beta.IBidiSessionClientMessage=} [properties] Properties to set - */ - function BidiSessionClientMessage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BidiSessionClientMessage config. - * @member {google.cloud.ces.v1beta.ISessionConfig|null|undefined} config - * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage - * @instance - */ - BidiSessionClientMessage.prototype.config = null; - - /** - * BidiSessionClientMessage realtimeInput. - * @member {google.cloud.ces.v1beta.ISessionInput|null|undefined} realtimeInput - * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage - * @instance - */ - BidiSessionClientMessage.prototype.realtimeInput = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BidiSessionClientMessage messageType. - * @member {"config"|"realtimeInput"|undefined} messageType - * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage - * @instance - */ - Object.defineProperty(BidiSessionClientMessage.prototype, "messageType", { - get: $util.oneOfGetter($oneOfFields = ["config", "realtimeInput"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BidiSessionClientMessage instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage - * @static - * @param {google.cloud.ces.v1beta.IBidiSessionClientMessage=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.BidiSessionClientMessage} BidiSessionClientMessage instance - */ - BidiSessionClientMessage.create = function create(properties) { - return new BidiSessionClientMessage(properties); - }; - - /** - * Encodes the specified BidiSessionClientMessage message. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionClientMessage.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage - * @static - * @param {google.cloud.ces.v1beta.IBidiSessionClientMessage} message BidiSessionClientMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BidiSessionClientMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.cloud.ces.v1beta.SessionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.realtimeInput != null && Object.hasOwnProperty.call(message, "realtimeInput")) - $root.google.cloud.ces.v1beta.SessionInput.encode(message.realtimeInput, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BidiSessionClientMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionClientMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage - * @static - * @param {google.cloud.ces.v1beta.IBidiSessionClientMessage} message BidiSessionClientMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BidiSessionClientMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BidiSessionClientMessage message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.BidiSessionClientMessage} BidiSessionClientMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BidiSessionClientMessage.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BidiSessionClientMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.config = $root.google.cloud.ces.v1beta.SessionConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.realtimeInput = $root.google.cloud.ces.v1beta.SessionInput.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BidiSessionClientMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.BidiSessionClientMessage} BidiSessionClientMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BidiSessionClientMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BidiSessionClientMessage message. - * @function verify - * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BidiSessionClientMessage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.config != null && message.hasOwnProperty("config")) { - properties.messageType = 1; - { - var error = $root.google.cloud.ces.v1beta.SessionConfig.verify(message.config); - if (error) - return "config." + error; - } - } - if (message.realtimeInput != null && message.hasOwnProperty("realtimeInput")) { - if (properties.messageType === 1) - return "messageType: multiple values"; - properties.messageType = 1; - { - var error = $root.google.cloud.ces.v1beta.SessionInput.verify(message.realtimeInput); - if (error) - return "realtimeInput." + error; - } - } - return null; - }; - - /** - * Creates a BidiSessionClientMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.BidiSessionClientMessage} BidiSessionClientMessage - */ - BidiSessionClientMessage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.BidiSessionClientMessage) - return object; - var message = new $root.google.cloud.ces.v1beta.BidiSessionClientMessage(); - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.ces.v1beta.BidiSessionClientMessage.config: object expected"); - message.config = $root.google.cloud.ces.v1beta.SessionConfig.fromObject(object.config); - } - if (object.realtimeInput != null) { - if (typeof object.realtimeInput !== "object") - throw TypeError(".google.cloud.ces.v1beta.BidiSessionClientMessage.realtimeInput: object expected"); - message.realtimeInput = $root.google.cloud.ces.v1beta.SessionInput.fromObject(object.realtimeInput); - } - return message; - }; - - /** - * Creates a plain object from a BidiSessionClientMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage - * @static - * @param {google.cloud.ces.v1beta.BidiSessionClientMessage} message BidiSessionClientMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BidiSessionClientMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.config != null && message.hasOwnProperty("config")) { - object.config = $root.google.cloud.ces.v1beta.SessionConfig.toObject(message.config, options); - if (options.oneofs) - object.messageType = "config"; - } - if (message.realtimeInput != null && message.hasOwnProperty("realtimeInput")) { - object.realtimeInput = $root.google.cloud.ces.v1beta.SessionInput.toObject(message.realtimeInput, options); - if (options.oneofs) - object.messageType = "realtimeInput"; - } - return object; - }; - - /** - * Converts this BidiSessionClientMessage to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage - * @instance - * @returns {Object.} JSON object - */ - BidiSessionClientMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BidiSessionClientMessage - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BidiSessionClientMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.BidiSessionClientMessage"; - }; - - return BidiSessionClientMessage; - })(); - - v1beta.BidiSessionServerMessage = (function() { - - /** - * Properties of a BidiSessionServerMessage. - * @memberof google.cloud.ces.v1beta - * @interface IBidiSessionServerMessage - * @property {google.cloud.ces.v1beta.ISessionOutput|null} [sessionOutput] BidiSessionServerMessage sessionOutput - * @property {google.cloud.ces.v1beta.IRecognitionResult|null} [recognitionResult] BidiSessionServerMessage recognitionResult - * @property {google.cloud.ces.v1beta.IInterruptionSignal|null} [interruptionSignal] BidiSessionServerMessage interruptionSignal - * @property {google.cloud.ces.v1beta.IEndSession|null} [endSession] BidiSessionServerMessage endSession - * @property {google.cloud.ces.v1beta.IGoAway|null} [goAway] BidiSessionServerMessage goAway - */ - - /** - * Constructs a new BidiSessionServerMessage. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a BidiSessionServerMessage. - * @implements IBidiSessionServerMessage - * @constructor - * @param {google.cloud.ces.v1beta.IBidiSessionServerMessage=} [properties] Properties to set - */ - function BidiSessionServerMessage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BidiSessionServerMessage sessionOutput. - * @member {google.cloud.ces.v1beta.ISessionOutput|null|undefined} sessionOutput - * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage - * @instance - */ - BidiSessionServerMessage.prototype.sessionOutput = null; - - /** - * BidiSessionServerMessage recognitionResult. - * @member {google.cloud.ces.v1beta.IRecognitionResult|null|undefined} recognitionResult - * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage - * @instance - */ - BidiSessionServerMessage.prototype.recognitionResult = null; - - /** - * BidiSessionServerMessage interruptionSignal. - * @member {google.cloud.ces.v1beta.IInterruptionSignal|null|undefined} interruptionSignal - * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage - * @instance - */ - BidiSessionServerMessage.prototype.interruptionSignal = null; - - /** - * BidiSessionServerMessage endSession. - * @member {google.cloud.ces.v1beta.IEndSession|null|undefined} endSession - * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage - * @instance - */ - BidiSessionServerMessage.prototype.endSession = null; - - /** - * BidiSessionServerMessage goAway. - * @member {google.cloud.ces.v1beta.IGoAway|null|undefined} goAway - * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage - * @instance - */ - BidiSessionServerMessage.prototype.goAway = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BidiSessionServerMessage messageType. - * @member {"sessionOutput"|"recognitionResult"|"interruptionSignal"|"endSession"|"goAway"|undefined} messageType - * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage - * @instance - */ - Object.defineProperty(BidiSessionServerMessage.prototype, "messageType", { - get: $util.oneOfGetter($oneOfFields = ["sessionOutput", "recognitionResult", "interruptionSignal", "endSession", "goAway"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BidiSessionServerMessage instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage - * @static - * @param {google.cloud.ces.v1beta.IBidiSessionServerMessage=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.BidiSessionServerMessage} BidiSessionServerMessage instance - */ - BidiSessionServerMessage.create = function create(properties) { - return new BidiSessionServerMessage(properties); - }; - - /** - * Encodes the specified BidiSessionServerMessage message. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionServerMessage.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage - * @static - * @param {google.cloud.ces.v1beta.IBidiSessionServerMessage} message BidiSessionServerMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BidiSessionServerMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sessionOutput != null && Object.hasOwnProperty.call(message, "sessionOutput")) - $root.google.cloud.ces.v1beta.SessionOutput.encode(message.sessionOutput, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.recognitionResult != null && Object.hasOwnProperty.call(message, "recognitionResult")) - $root.google.cloud.ces.v1beta.RecognitionResult.encode(message.recognitionResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.interruptionSignal != null && Object.hasOwnProperty.call(message, "interruptionSignal")) - $root.google.cloud.ces.v1beta.InterruptionSignal.encode(message.interruptionSignal, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endSession != null && Object.hasOwnProperty.call(message, "endSession")) - $root.google.cloud.ces.v1beta.EndSession.encode(message.endSession, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.goAway != null && Object.hasOwnProperty.call(message, "goAway")) - $root.google.cloud.ces.v1beta.GoAway.encode(message.goAway, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BidiSessionServerMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionServerMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage - * @static - * @param {google.cloud.ces.v1beta.IBidiSessionServerMessage} message BidiSessionServerMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BidiSessionServerMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BidiSessionServerMessage message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.BidiSessionServerMessage} BidiSessionServerMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BidiSessionServerMessage.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BidiSessionServerMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.sessionOutput = $root.google.cloud.ces.v1beta.SessionOutput.decode(reader, reader.uint32()); - break; - } - case 2: { - message.recognitionResult = $root.google.cloud.ces.v1beta.RecognitionResult.decode(reader, reader.uint32()); - break; - } - case 3: { - message.interruptionSignal = $root.google.cloud.ces.v1beta.InterruptionSignal.decode(reader, reader.uint32()); - break; - } - case 5: { - message.endSession = $root.google.cloud.ces.v1beta.EndSession.decode(reader, reader.uint32()); - break; - } - case 6: { - message.goAway = $root.google.cloud.ces.v1beta.GoAway.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BidiSessionServerMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.BidiSessionServerMessage} BidiSessionServerMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BidiSessionServerMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BidiSessionServerMessage message. - * @function verify - * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BidiSessionServerMessage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.sessionOutput != null && message.hasOwnProperty("sessionOutput")) { - properties.messageType = 1; - { - var error = $root.google.cloud.ces.v1beta.SessionOutput.verify(message.sessionOutput); - if (error) - return "sessionOutput." + error; - } - } - if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { - if (properties.messageType === 1) - return "messageType: multiple values"; - properties.messageType = 1; - { - var error = $root.google.cloud.ces.v1beta.RecognitionResult.verify(message.recognitionResult); - if (error) - return "recognitionResult." + error; - } - } - if (message.interruptionSignal != null && message.hasOwnProperty("interruptionSignal")) { - if (properties.messageType === 1) - return "messageType: multiple values"; - properties.messageType = 1; - { - var error = $root.google.cloud.ces.v1beta.InterruptionSignal.verify(message.interruptionSignal); - if (error) - return "interruptionSignal." + error; - } - } - if (message.endSession != null && message.hasOwnProperty("endSession")) { - if (properties.messageType === 1) - return "messageType: multiple values"; - properties.messageType = 1; - { - var error = $root.google.cloud.ces.v1beta.EndSession.verify(message.endSession); - if (error) - return "endSession." + error; - } - } - if (message.goAway != null && message.hasOwnProperty("goAway")) { - if (properties.messageType === 1) - return "messageType: multiple values"; - properties.messageType = 1; - { - var error = $root.google.cloud.ces.v1beta.GoAway.verify(message.goAway); - if (error) - return "goAway." + error; - } - } - return null; - }; - - /** - * Creates a BidiSessionServerMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.BidiSessionServerMessage} BidiSessionServerMessage - */ - BidiSessionServerMessage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.BidiSessionServerMessage) - return object; - var message = new $root.google.cloud.ces.v1beta.BidiSessionServerMessage(); - if (object.sessionOutput != null) { - if (typeof object.sessionOutput !== "object") - throw TypeError(".google.cloud.ces.v1beta.BidiSessionServerMessage.sessionOutput: object expected"); - message.sessionOutput = $root.google.cloud.ces.v1beta.SessionOutput.fromObject(object.sessionOutput); - } - if (object.recognitionResult != null) { - if (typeof object.recognitionResult !== "object") - throw TypeError(".google.cloud.ces.v1beta.BidiSessionServerMessage.recognitionResult: object expected"); - message.recognitionResult = $root.google.cloud.ces.v1beta.RecognitionResult.fromObject(object.recognitionResult); - } - if (object.interruptionSignal != null) { - if (typeof object.interruptionSignal !== "object") - throw TypeError(".google.cloud.ces.v1beta.BidiSessionServerMessage.interruptionSignal: object expected"); - message.interruptionSignal = $root.google.cloud.ces.v1beta.InterruptionSignal.fromObject(object.interruptionSignal); - } - if (object.endSession != null) { - if (typeof object.endSession !== "object") - throw TypeError(".google.cloud.ces.v1beta.BidiSessionServerMessage.endSession: object expected"); - message.endSession = $root.google.cloud.ces.v1beta.EndSession.fromObject(object.endSession); - } - if (object.goAway != null) { - if (typeof object.goAway !== "object") - throw TypeError(".google.cloud.ces.v1beta.BidiSessionServerMessage.goAway: object expected"); - message.goAway = $root.google.cloud.ces.v1beta.GoAway.fromObject(object.goAway); - } - return message; - }; - - /** - * Creates a plain object from a BidiSessionServerMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage - * @static - * @param {google.cloud.ces.v1beta.BidiSessionServerMessage} message BidiSessionServerMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BidiSessionServerMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.sessionOutput != null && message.hasOwnProperty("sessionOutput")) { - object.sessionOutput = $root.google.cloud.ces.v1beta.SessionOutput.toObject(message.sessionOutput, options); - if (options.oneofs) - object.messageType = "sessionOutput"; - } - if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { - object.recognitionResult = $root.google.cloud.ces.v1beta.RecognitionResult.toObject(message.recognitionResult, options); - if (options.oneofs) - object.messageType = "recognitionResult"; - } - if (message.interruptionSignal != null && message.hasOwnProperty("interruptionSignal")) { - object.interruptionSignal = $root.google.cloud.ces.v1beta.InterruptionSignal.toObject(message.interruptionSignal, options); - if (options.oneofs) - object.messageType = "interruptionSignal"; - } - if (message.endSession != null && message.hasOwnProperty("endSession")) { - object.endSession = $root.google.cloud.ces.v1beta.EndSession.toObject(message.endSession, options); - if (options.oneofs) - object.messageType = "endSession"; - } - if (message.goAway != null && message.hasOwnProperty("goAway")) { - object.goAway = $root.google.cloud.ces.v1beta.GoAway.toObject(message.goAway, options); - if (options.oneofs) - object.messageType = "goAway"; - } - return object; - }; - - /** - * Converts this BidiSessionServerMessage to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage - * @instance - * @returns {Object.} JSON object - */ - BidiSessionServerMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BidiSessionServerMessage - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BidiSessionServerMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.BidiSessionServerMessage"; - }; - - return BidiSessionServerMessage; - })(); - - v1beta.GoogleSearchSuggestions = (function() { - - /** - * Properties of a GoogleSearchSuggestions. - * @memberof google.cloud.ces.v1beta - * @interface IGoogleSearchSuggestions - * @property {Array.|null} [htmls] GoogleSearchSuggestions htmls - * @property {Array.|null} [webSearchQueries] GoogleSearchSuggestions webSearchQueries - */ - - /** - * Constructs a new GoogleSearchSuggestions. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GoogleSearchSuggestions. - * @implements IGoogleSearchSuggestions - * @constructor - * @param {google.cloud.ces.v1beta.IGoogleSearchSuggestions=} [properties] Properties to set - */ - function GoogleSearchSuggestions(properties) { - this.htmls = []; - this.webSearchQueries = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoogleSearchSuggestions htmls. - * @member {Array.} htmls - * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions - * @instance - */ - GoogleSearchSuggestions.prototype.htmls = $util.emptyArray; - - /** - * GoogleSearchSuggestions webSearchQueries. - * @member {Array.} webSearchQueries - * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions - * @instance - */ - GoogleSearchSuggestions.prototype.webSearchQueries = $util.emptyArray; - - /** - * Creates a new GoogleSearchSuggestions instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions - * @static - * @param {google.cloud.ces.v1beta.IGoogleSearchSuggestions=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GoogleSearchSuggestions} GoogleSearchSuggestions instance - */ - GoogleSearchSuggestions.create = function create(properties) { - return new GoogleSearchSuggestions(properties); - }; - - /** - * Encodes the specified GoogleSearchSuggestions message. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchSuggestions.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions - * @static - * @param {google.cloud.ces.v1beta.IGoogleSearchSuggestions} message GoogleSearchSuggestions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoogleSearchSuggestions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.htmls != null && message.htmls.length) - for (var i = 0; i < message.htmls.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.htmls[i]); - if (message.webSearchQueries != null && message.webSearchQueries.length) - for (var i = 0; i < message.webSearchQueries.length; ++i) - $root.google.cloud.ces.v1beta.WebSearchQuery.encode(message.webSearchQueries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoogleSearchSuggestions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchSuggestions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions - * @static - * @param {google.cloud.ces.v1beta.IGoogleSearchSuggestions} message GoogleSearchSuggestions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoogleSearchSuggestions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoogleSearchSuggestions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GoogleSearchSuggestions} GoogleSearchSuggestions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoogleSearchSuggestions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GoogleSearchSuggestions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.htmls && message.htmls.length)) - message.htmls = []; - message.htmls.push(reader.string()); - break; - } - case 2: { - if (!(message.webSearchQueries && message.webSearchQueries.length)) - message.webSearchQueries = []; - message.webSearchQueries.push($root.google.cloud.ces.v1beta.WebSearchQuery.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoogleSearchSuggestions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GoogleSearchSuggestions} GoogleSearchSuggestions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoogleSearchSuggestions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoogleSearchSuggestions message. - * @function verify - * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoogleSearchSuggestions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.htmls != null && message.hasOwnProperty("htmls")) { - if (!Array.isArray(message.htmls)) - return "htmls: array expected"; - for (var i = 0; i < message.htmls.length; ++i) - if (!$util.isString(message.htmls[i])) - return "htmls: string[] expected"; - } - if (message.webSearchQueries != null && message.hasOwnProperty("webSearchQueries")) { - if (!Array.isArray(message.webSearchQueries)) - return "webSearchQueries: array expected"; - for (var i = 0; i < message.webSearchQueries.length; ++i) { - var error = $root.google.cloud.ces.v1beta.WebSearchQuery.verify(message.webSearchQueries[i]); - if (error) - return "webSearchQueries." + error; - } - } - return null; - }; - - /** - * Creates a GoogleSearchSuggestions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GoogleSearchSuggestions} GoogleSearchSuggestions - */ - GoogleSearchSuggestions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GoogleSearchSuggestions) - return object; - var message = new $root.google.cloud.ces.v1beta.GoogleSearchSuggestions(); - if (object.htmls) { - if (!Array.isArray(object.htmls)) - throw TypeError(".google.cloud.ces.v1beta.GoogleSearchSuggestions.htmls: array expected"); - message.htmls = []; - for (var i = 0; i < object.htmls.length; ++i) - message.htmls[i] = String(object.htmls[i]); - } - if (object.webSearchQueries) { - if (!Array.isArray(object.webSearchQueries)) - throw TypeError(".google.cloud.ces.v1beta.GoogleSearchSuggestions.webSearchQueries: array expected"); - message.webSearchQueries = []; - for (var i = 0; i < object.webSearchQueries.length; ++i) { - if (typeof object.webSearchQueries[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.GoogleSearchSuggestions.webSearchQueries: object expected"); - message.webSearchQueries[i] = $root.google.cloud.ces.v1beta.WebSearchQuery.fromObject(object.webSearchQueries[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GoogleSearchSuggestions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions - * @static - * @param {google.cloud.ces.v1beta.GoogleSearchSuggestions} message GoogleSearchSuggestions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoogleSearchSuggestions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.htmls = []; - object.webSearchQueries = []; - } - if (message.htmls && message.htmls.length) { - object.htmls = []; - for (var j = 0; j < message.htmls.length; ++j) - object.htmls[j] = message.htmls[j]; - } - if (message.webSearchQueries && message.webSearchQueries.length) { - object.webSearchQueries = []; - for (var j = 0; j < message.webSearchQueries.length; ++j) - object.webSearchQueries[j] = $root.google.cloud.ces.v1beta.WebSearchQuery.toObject(message.webSearchQueries[j], options); - } - return object; - }; - - /** - * Converts this GoogleSearchSuggestions to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions - * @instance - * @returns {Object.} JSON object - */ - GoogleSearchSuggestions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoogleSearchSuggestions - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoogleSearchSuggestions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GoogleSearchSuggestions"; - }; - - return GoogleSearchSuggestions; - })(); - - v1beta.WebSearchQuery = (function() { - - /** - * Properties of a WebSearchQuery. - * @memberof google.cloud.ces.v1beta - * @interface IWebSearchQuery - * @property {string|null} [query] WebSearchQuery query - * @property {string|null} [uri] WebSearchQuery uri - */ - - /** - * Constructs a new WebSearchQuery. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a WebSearchQuery. - * @implements IWebSearchQuery - * @constructor - * @param {google.cloud.ces.v1beta.IWebSearchQuery=} [properties] Properties to set - */ - function WebSearchQuery(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WebSearchQuery query. - * @member {string} query - * @memberof google.cloud.ces.v1beta.WebSearchQuery - * @instance - */ - WebSearchQuery.prototype.query = ""; - - /** - * WebSearchQuery uri. - * @member {string} uri - * @memberof google.cloud.ces.v1beta.WebSearchQuery - * @instance - */ - WebSearchQuery.prototype.uri = ""; - - /** - * Creates a new WebSearchQuery instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.WebSearchQuery - * @static - * @param {google.cloud.ces.v1beta.IWebSearchQuery=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.WebSearchQuery} WebSearchQuery instance - */ - WebSearchQuery.create = function create(properties) { - return new WebSearchQuery(properties); - }; - - /** - * Encodes the specified WebSearchQuery message. Does not implicitly {@link google.cloud.ces.v1beta.WebSearchQuery.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.WebSearchQuery - * @static - * @param {google.cloud.ces.v1beta.IWebSearchQuery} message WebSearchQuery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebSearchQuery.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); - return writer; - }; - - /** - * Encodes the specified WebSearchQuery message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.WebSearchQuery.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.WebSearchQuery - * @static - * @param {google.cloud.ces.v1beta.IWebSearchQuery} message WebSearchQuery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebSearchQuery.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WebSearchQuery message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.WebSearchQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.WebSearchQuery} WebSearchQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebSearchQuery.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.WebSearchQuery(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.query = reader.string(); - break; - } - case 2: { - message.uri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WebSearchQuery message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.WebSearchQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.WebSearchQuery} WebSearchQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebSearchQuery.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WebSearchQuery message. - * @function verify - * @memberof google.cloud.ces.v1beta.WebSearchQuery - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WebSearchQuery.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: string expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - return null; - }; - - /** - * Creates a WebSearchQuery message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.WebSearchQuery - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.WebSearchQuery} WebSearchQuery - */ - WebSearchQuery.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.WebSearchQuery) - return object; - var message = new $root.google.cloud.ces.v1beta.WebSearchQuery(); - if (object.query != null) - message.query = String(object.query); - if (object.uri != null) - message.uri = String(object.uri); - return message; - }; - - /** - * Creates a plain object from a WebSearchQuery message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.WebSearchQuery - * @static - * @param {google.cloud.ces.v1beta.WebSearchQuery} message WebSearchQuery - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WebSearchQuery.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.query = ""; - object.uri = ""; - } - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - return object; - }; - - /** - * Converts this WebSearchQuery to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.WebSearchQuery - * @instance - * @returns {Object.} JSON object - */ - WebSearchQuery.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WebSearchQuery - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.WebSearchQuery - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WebSearchQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.WebSearchQuery"; - }; - - return WebSearchQuery; - })(); - - v1beta.EvaluationService = (function() { - - /** - * Constructs a new EvaluationService service. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an EvaluationService - * @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 EvaluationService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (EvaluationService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EvaluationService; - - /** - * Creates new EvaluationService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.ces.v1beta.EvaluationService - * @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 {EvaluationService} RPC service. Useful where requests and/or responses are streamed. - */ - EvaluationService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|runEvaluation}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef RunEvaluationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RunEvaluation. - * @function runEvaluation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IRunEvaluationRequest} request RunEvaluationRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.RunEvaluationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.runEvaluation = function runEvaluation(request, callback) { - return this.rpcCall(runEvaluation, $root.google.cloud.ces.v1beta.RunEvaluationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RunEvaluation" }); - - /** - * Calls RunEvaluation. - * @function runEvaluation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IRunEvaluationRequest} request RunEvaluationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|uploadEvaluationAudio}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef UploadEvaluationAudioCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.UploadEvaluationAudioResponse} [response] UploadEvaluationAudioResponse - */ - - /** - * Calls UploadEvaluationAudio. - * @function uploadEvaluationAudio - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioRequest} request UploadEvaluationAudioRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.UploadEvaluationAudioCallback} callback Node-style callback called with the error, if any, and UploadEvaluationAudioResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.uploadEvaluationAudio = function uploadEvaluationAudio(request, callback) { - return this.rpcCall(uploadEvaluationAudio, $root.google.cloud.ces.v1beta.UploadEvaluationAudioRequest, $root.google.cloud.ces.v1beta.UploadEvaluationAudioResponse, request, callback); - }, "name", { value: "UploadEvaluationAudio" }); - - /** - * Calls UploadEvaluationAudio. - * @function uploadEvaluationAudio - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioRequest} request UploadEvaluationAudioRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createEvaluation}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef CreateEvaluationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Evaluation} [response] Evaluation - */ - - /** - * Calls CreateEvaluation. - * @function createEvaluation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.ICreateEvaluationRequest} request CreateEvaluationRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.CreateEvaluationCallback} callback Node-style callback called with the error, if any, and Evaluation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.createEvaluation = function createEvaluation(request, callback) { - return this.rpcCall(createEvaluation, $root.google.cloud.ces.v1beta.CreateEvaluationRequest, $root.google.cloud.ces.v1beta.Evaluation, request, callback); - }, "name", { value: "CreateEvaluation" }); - - /** - * Calls CreateEvaluation. - * @function createEvaluation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.ICreateEvaluationRequest} request CreateEvaluationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|generateEvaluation}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef GenerateEvaluationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls GenerateEvaluation. - * @function generateEvaluation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IGenerateEvaluationRequest} request GenerateEvaluationRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.GenerateEvaluationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.generateEvaluation = function generateEvaluation(request, callback) { - return this.rpcCall(generateEvaluation, $root.google.cloud.ces.v1beta.GenerateEvaluationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "GenerateEvaluation" }); - - /** - * Calls GenerateEvaluation. - * @function generateEvaluation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IGenerateEvaluationRequest} request GenerateEvaluationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|importEvaluations}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef ImportEvaluationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ImportEvaluations. - * @function importEvaluations - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IImportEvaluationsRequest} request ImportEvaluationsRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.ImportEvaluationsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.importEvaluations = function importEvaluations(request, callback) { - return this.rpcCall(importEvaluations, $root.google.cloud.ces.v1beta.ImportEvaluationsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportEvaluations" }); - - /** - * Calls ImportEvaluations. - * @function importEvaluations - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IImportEvaluationsRequest} request ImportEvaluationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createEvaluationDataset}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef CreateEvaluationDatasetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.EvaluationDataset} [response] EvaluationDataset - */ - - /** - * Calls CreateEvaluationDataset. - * @function createEvaluationDataset - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest} request CreateEvaluationDatasetRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.CreateEvaluationDatasetCallback} callback Node-style callback called with the error, if any, and EvaluationDataset - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.createEvaluationDataset = function createEvaluationDataset(request, callback) { - return this.rpcCall(createEvaluationDataset, $root.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest, $root.google.cloud.ces.v1beta.EvaluationDataset, request, callback); - }, "name", { value: "CreateEvaluationDataset" }); - - /** - * Calls CreateEvaluationDataset. - * @function createEvaluationDataset - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest} request CreateEvaluationDatasetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateEvaluation}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef UpdateEvaluationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Evaluation} [response] Evaluation - */ - - /** - * Calls UpdateEvaluation. - * @function updateEvaluation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateEvaluationRequest} request UpdateEvaluationRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationCallback} callback Node-style callback called with the error, if any, and Evaluation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.updateEvaluation = function updateEvaluation(request, callback) { - return this.rpcCall(updateEvaluation, $root.google.cloud.ces.v1beta.UpdateEvaluationRequest, $root.google.cloud.ces.v1beta.Evaluation, request, callback); - }, "name", { value: "UpdateEvaluation" }); - - /** - * Calls UpdateEvaluation. - * @function updateEvaluation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateEvaluationRequest} request UpdateEvaluationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateEvaluationDataset}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef UpdateEvaluationDatasetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.EvaluationDataset} [response] EvaluationDataset - */ - - /** - * Calls UpdateEvaluationDataset. - * @function updateEvaluationDataset - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest} request UpdateEvaluationDatasetRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationDatasetCallback} callback Node-style callback called with the error, if any, and EvaluationDataset - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.updateEvaluationDataset = function updateEvaluationDataset(request, callback) { - return this.rpcCall(updateEvaluationDataset, $root.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest, $root.google.cloud.ces.v1beta.EvaluationDataset, request, callback); - }, "name", { value: "UpdateEvaluationDataset" }); - - /** - * Calls UpdateEvaluationDataset. - * @function updateEvaluationDataset - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest} request UpdateEvaluationDatasetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluation}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef DeleteEvaluationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteEvaluation. - * @function deleteEvaluation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteEvaluationRequest} request DeleteEvaluationRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.deleteEvaluation = function deleteEvaluation(request, callback) { - return this.rpcCall(deleteEvaluation, $root.google.cloud.ces.v1beta.DeleteEvaluationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteEvaluation" }); - - /** - * Calls DeleteEvaluation. - * @function deleteEvaluation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteEvaluationRequest} request DeleteEvaluationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationResult}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef DeleteEvaluationResultCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteEvaluationResult. - * @function deleteEvaluationResult - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteEvaluationResultRequest} request DeleteEvaluationResultRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationResultCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.deleteEvaluationResult = function deleteEvaluationResult(request, callback) { - return this.rpcCall(deleteEvaluationResult, $root.google.cloud.ces.v1beta.DeleteEvaluationResultRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteEvaluationResult" }); - - /** - * Calls DeleteEvaluationResult. - * @function deleteEvaluationResult - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteEvaluationResultRequest} request DeleteEvaluationResultRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationDataset}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef DeleteEvaluationDatasetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteEvaluationDataset. - * @function deleteEvaluationDataset - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest} request DeleteEvaluationDatasetRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationDatasetCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.deleteEvaluationDataset = function deleteEvaluationDataset(request, callback) { - return this.rpcCall(deleteEvaluationDataset, $root.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteEvaluationDataset" }); - - /** - * Calls DeleteEvaluationDataset. - * @function deleteEvaluationDataset - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest} request DeleteEvaluationDatasetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationRun}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef DeleteEvaluationRunCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteEvaluationRun. - * @function deleteEvaluationRun - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunRequest} request DeleteEvaluationRunRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationRunCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.deleteEvaluationRun = function deleteEvaluationRun(request, callback) { - return this.rpcCall(deleteEvaluationRun, $root.google.cloud.ces.v1beta.DeleteEvaluationRunRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteEvaluationRun" }); - - /** - * Calls DeleteEvaluationRun. - * @function deleteEvaluationRun - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunRequest} request DeleteEvaluationRunRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluation}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef GetEvaluationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.Evaluation} [response] Evaluation - */ - - /** - * Calls GetEvaluation. - * @function getEvaluation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IGetEvaluationRequest} request GetEvaluationRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.GetEvaluationCallback} callback Node-style callback called with the error, if any, and Evaluation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.getEvaluation = function getEvaluation(request, callback) { - return this.rpcCall(getEvaluation, $root.google.cloud.ces.v1beta.GetEvaluationRequest, $root.google.cloud.ces.v1beta.Evaluation, request, callback); - }, "name", { value: "GetEvaluation" }); - - /** - * Calls GetEvaluation. - * @function getEvaluation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IGetEvaluationRequest} request GetEvaluationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationResult}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef GetEvaluationResultCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.EvaluationResult} [response] EvaluationResult - */ - - /** - * Calls GetEvaluationResult. - * @function getEvaluationResult - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IGetEvaluationResultRequest} request GetEvaluationResultRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.GetEvaluationResultCallback} callback Node-style callback called with the error, if any, and EvaluationResult - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.getEvaluationResult = function getEvaluationResult(request, callback) { - return this.rpcCall(getEvaluationResult, $root.google.cloud.ces.v1beta.GetEvaluationResultRequest, $root.google.cloud.ces.v1beta.EvaluationResult, request, callback); - }, "name", { value: "GetEvaluationResult" }); - - /** - * Calls GetEvaluationResult. - * @function getEvaluationResult - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IGetEvaluationResultRequest} request GetEvaluationResultRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationDataset}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef GetEvaluationDatasetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.EvaluationDataset} [response] EvaluationDataset - */ - - /** - * Calls GetEvaluationDataset. - * @function getEvaluationDataset - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IGetEvaluationDatasetRequest} request GetEvaluationDatasetRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.GetEvaluationDatasetCallback} callback Node-style callback called with the error, if any, and EvaluationDataset - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.getEvaluationDataset = function getEvaluationDataset(request, callback) { - return this.rpcCall(getEvaluationDataset, $root.google.cloud.ces.v1beta.GetEvaluationDatasetRequest, $root.google.cloud.ces.v1beta.EvaluationDataset, request, callback); - }, "name", { value: "GetEvaluationDataset" }); - - /** - * Calls GetEvaluationDataset. - * @function getEvaluationDataset - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IGetEvaluationDatasetRequest} request GetEvaluationDatasetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationRun}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef GetEvaluationRunCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.EvaluationRun} [response] EvaluationRun - */ - - /** - * Calls GetEvaluationRun. - * @function getEvaluationRun - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IGetEvaluationRunRequest} request GetEvaluationRunRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.GetEvaluationRunCallback} callback Node-style callback called with the error, if any, and EvaluationRun - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.getEvaluationRun = function getEvaluationRun(request, callback) { - return this.rpcCall(getEvaluationRun, $root.google.cloud.ces.v1beta.GetEvaluationRunRequest, $root.google.cloud.ces.v1beta.EvaluationRun, request, callback); - }, "name", { value: "GetEvaluationRun" }); - - /** - * Calls GetEvaluationRun. - * @function getEvaluationRun - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IGetEvaluationRunRequest} request GetEvaluationRunRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluations}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef ListEvaluationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ListEvaluationsResponse} [response] ListEvaluationsResponse - */ - - /** - * Calls ListEvaluations. - * @function listEvaluations - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IListEvaluationsRequest} request ListEvaluationsRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.ListEvaluationsCallback} callback Node-style callback called with the error, if any, and ListEvaluationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.listEvaluations = function listEvaluations(request, callback) { - return this.rpcCall(listEvaluations, $root.google.cloud.ces.v1beta.ListEvaluationsRequest, $root.google.cloud.ces.v1beta.ListEvaluationsResponse, request, callback); - }, "name", { value: "ListEvaluations" }); - - /** - * Calls ListEvaluations. - * @function listEvaluations - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IListEvaluationsRequest} request ListEvaluationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationResults}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef ListEvaluationResultsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ListEvaluationResultsResponse} [response] ListEvaluationResultsResponse - */ - - /** - * Calls ListEvaluationResults. - * @function listEvaluationResults - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IListEvaluationResultsRequest} request ListEvaluationResultsRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.ListEvaluationResultsCallback} callback Node-style callback called with the error, if any, and ListEvaluationResultsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.listEvaluationResults = function listEvaluationResults(request, callback) { - return this.rpcCall(listEvaluationResults, $root.google.cloud.ces.v1beta.ListEvaluationResultsRequest, $root.google.cloud.ces.v1beta.ListEvaluationResultsResponse, request, callback); - }, "name", { value: "ListEvaluationResults" }); - - /** - * Calls ListEvaluationResults. - * @function listEvaluationResults - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IListEvaluationResultsRequest} request ListEvaluationResultsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationDatasets}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef ListEvaluationDatasetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ListEvaluationDatasetsResponse} [response] ListEvaluationDatasetsResponse - */ - - /** - * Calls ListEvaluationDatasets. - * @function listEvaluationDatasets - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsRequest} request ListEvaluationDatasetsRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.ListEvaluationDatasetsCallback} callback Node-style callback called with the error, if any, and ListEvaluationDatasetsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.listEvaluationDatasets = function listEvaluationDatasets(request, callback) { - return this.rpcCall(listEvaluationDatasets, $root.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest, $root.google.cloud.ces.v1beta.ListEvaluationDatasetsResponse, request, callback); - }, "name", { value: "ListEvaluationDatasets" }); - - /** - * Calls ListEvaluationDatasets. - * @function listEvaluationDatasets - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsRequest} request ListEvaluationDatasetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationRuns}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef ListEvaluationRunsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ListEvaluationRunsResponse} [response] ListEvaluationRunsResponse - */ - - /** - * Calls ListEvaluationRuns. - * @function listEvaluationRuns - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IListEvaluationRunsRequest} request ListEvaluationRunsRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.ListEvaluationRunsCallback} callback Node-style callback called with the error, if any, and ListEvaluationRunsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.listEvaluationRuns = function listEvaluationRuns(request, callback) { - return this.rpcCall(listEvaluationRuns, $root.google.cloud.ces.v1beta.ListEvaluationRunsRequest, $root.google.cloud.ces.v1beta.ListEvaluationRunsResponse, request, callback); - }, "name", { value: "ListEvaluationRuns" }); - - /** - * Calls ListEvaluationRuns. - * @function listEvaluationRuns - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IListEvaluationRunsRequest} request ListEvaluationRunsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationExpectations}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef ListEvaluationExpectationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ListEvaluationExpectationsResponse} [response] ListEvaluationExpectationsResponse - */ - - /** - * Calls ListEvaluationExpectations. - * @function listEvaluationExpectations - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsRequest} request ListEvaluationExpectationsRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.ListEvaluationExpectationsCallback} callback Node-style callback called with the error, if any, and ListEvaluationExpectationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.listEvaluationExpectations = function listEvaluationExpectations(request, callback) { - return this.rpcCall(listEvaluationExpectations, $root.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest, $root.google.cloud.ces.v1beta.ListEvaluationExpectationsResponse, request, callback); - }, "name", { value: "ListEvaluationExpectations" }); - - /** - * Calls ListEvaluationExpectations. - * @function listEvaluationExpectations - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsRequest} request ListEvaluationExpectationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationExpectation}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef GetEvaluationExpectationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.EvaluationExpectation} [response] EvaluationExpectation - */ - - /** - * Calls GetEvaluationExpectation. - * @function getEvaluationExpectation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IGetEvaluationExpectationRequest} request GetEvaluationExpectationRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.GetEvaluationExpectationCallback} callback Node-style callback called with the error, if any, and EvaluationExpectation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.getEvaluationExpectation = function getEvaluationExpectation(request, callback) { - return this.rpcCall(getEvaluationExpectation, $root.google.cloud.ces.v1beta.GetEvaluationExpectationRequest, $root.google.cloud.ces.v1beta.EvaluationExpectation, request, callback); - }, "name", { value: "GetEvaluationExpectation" }); - - /** - * Calls GetEvaluationExpectation. - * @function getEvaluationExpectation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IGetEvaluationExpectationRequest} request GetEvaluationExpectationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createEvaluationExpectation}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef CreateEvaluationExpectationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.EvaluationExpectation} [response] EvaluationExpectation - */ - - /** - * Calls CreateEvaluationExpectation. - * @function createEvaluationExpectation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest} request CreateEvaluationExpectationRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.CreateEvaluationExpectationCallback} callback Node-style callback called with the error, if any, and EvaluationExpectation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.createEvaluationExpectation = function createEvaluationExpectation(request, callback) { - return this.rpcCall(createEvaluationExpectation, $root.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest, $root.google.cloud.ces.v1beta.EvaluationExpectation, request, callback); - }, "name", { value: "CreateEvaluationExpectation" }); - - /** - * Calls CreateEvaluationExpectation. - * @function createEvaluationExpectation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest} request CreateEvaluationExpectationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateEvaluationExpectation}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef UpdateEvaluationExpectationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.EvaluationExpectation} [response] EvaluationExpectation - */ - - /** - * Calls UpdateEvaluationExpectation. - * @function updateEvaluationExpectation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest} request UpdateEvaluationExpectationRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationExpectationCallback} callback Node-style callback called with the error, if any, and EvaluationExpectation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.updateEvaluationExpectation = function updateEvaluationExpectation(request, callback) { - return this.rpcCall(updateEvaluationExpectation, $root.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest, $root.google.cloud.ces.v1beta.EvaluationExpectation, request, callback); - }, "name", { value: "UpdateEvaluationExpectation" }); - - /** - * Calls UpdateEvaluationExpectation. - * @function updateEvaluationExpectation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest} request UpdateEvaluationExpectationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationExpectation}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef DeleteEvaluationExpectationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteEvaluationExpectation. - * @function deleteEvaluationExpectation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest} request DeleteEvaluationExpectationRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationExpectationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.deleteEvaluationExpectation = function deleteEvaluationExpectation(request, callback) { - return this.rpcCall(deleteEvaluationExpectation, $root.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteEvaluationExpectation" }); - - /** - * Calls DeleteEvaluationExpectation. - * @function deleteEvaluationExpectation - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest} request DeleteEvaluationExpectationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createScheduledEvaluationRun}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef CreateScheduledEvaluationRunCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun} [response] ScheduledEvaluationRun - */ - - /** - * Calls CreateScheduledEvaluationRun. - * @function createScheduledEvaluationRun - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest} request CreateScheduledEvaluationRunRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.CreateScheduledEvaluationRunCallback} callback Node-style callback called with the error, if any, and ScheduledEvaluationRun - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.createScheduledEvaluationRun = function createScheduledEvaluationRun(request, callback) { - return this.rpcCall(createScheduledEvaluationRun, $root.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest, $root.google.cloud.ces.v1beta.ScheduledEvaluationRun, request, callback); - }, "name", { value: "CreateScheduledEvaluationRun" }); - - /** - * Calls CreateScheduledEvaluationRun. - * @function createScheduledEvaluationRun - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest} request CreateScheduledEvaluationRunRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getScheduledEvaluationRun}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef GetScheduledEvaluationRunCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun} [response] ScheduledEvaluationRun - */ - - /** - * Calls GetScheduledEvaluationRun. - * @function getScheduledEvaluationRun - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest} request GetScheduledEvaluationRunRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.GetScheduledEvaluationRunCallback} callback Node-style callback called with the error, if any, and ScheduledEvaluationRun - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.getScheduledEvaluationRun = function getScheduledEvaluationRun(request, callback) { - return this.rpcCall(getScheduledEvaluationRun, $root.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest, $root.google.cloud.ces.v1beta.ScheduledEvaluationRun, request, callback); - }, "name", { value: "GetScheduledEvaluationRun" }); - - /** - * Calls GetScheduledEvaluationRun. - * @function getScheduledEvaluationRun - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest} request GetScheduledEvaluationRunRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listScheduledEvaluationRuns}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef ListScheduledEvaluationRunsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse} [response] ListScheduledEvaluationRunsResponse - */ - - /** - * Calls ListScheduledEvaluationRuns. - * @function listScheduledEvaluationRuns - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest} request ListScheduledEvaluationRunsRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.ListScheduledEvaluationRunsCallback} callback Node-style callback called with the error, if any, and ListScheduledEvaluationRunsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.listScheduledEvaluationRuns = function listScheduledEvaluationRuns(request, callback) { - return this.rpcCall(listScheduledEvaluationRuns, $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest, $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse, request, callback); - }, "name", { value: "ListScheduledEvaluationRuns" }); - - /** - * Calls ListScheduledEvaluationRuns. - * @function listScheduledEvaluationRuns - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest} request ListScheduledEvaluationRunsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateScheduledEvaluationRun}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef UpdateScheduledEvaluationRunCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun} [response] ScheduledEvaluationRun - */ - - /** - * Calls UpdateScheduledEvaluationRun. - * @function updateScheduledEvaluationRun - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest} request UpdateScheduledEvaluationRunRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.UpdateScheduledEvaluationRunCallback} callback Node-style callback called with the error, if any, and ScheduledEvaluationRun - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.updateScheduledEvaluationRun = function updateScheduledEvaluationRun(request, callback) { - return this.rpcCall(updateScheduledEvaluationRun, $root.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest, $root.google.cloud.ces.v1beta.ScheduledEvaluationRun, request, callback); - }, "name", { value: "UpdateScheduledEvaluationRun" }); - - /** - * Calls UpdateScheduledEvaluationRun. - * @function updateScheduledEvaluationRun - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest} request UpdateScheduledEvaluationRunRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteScheduledEvaluationRun}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef DeleteScheduledEvaluationRunCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteScheduledEvaluationRun. - * @function deleteScheduledEvaluationRun - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest} request DeleteScheduledEvaluationRunRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.DeleteScheduledEvaluationRunCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.deleteScheduledEvaluationRun = function deleteScheduledEvaluationRun(request, callback) { - return this.rpcCall(deleteScheduledEvaluationRun, $root.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteScheduledEvaluationRun" }); - - /** - * Calls DeleteScheduledEvaluationRun. - * @function deleteScheduledEvaluationRun - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest} request DeleteScheduledEvaluationRunRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|testPersonaVoice}. - * @memberof google.cloud.ces.v1beta.EvaluationService - * @typedef TestPersonaVoiceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.TestPersonaVoiceResponse} [response] TestPersonaVoiceResponse - */ - - /** - * Calls TestPersonaVoice. - * @function testPersonaVoice - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.ITestPersonaVoiceRequest} request TestPersonaVoiceRequest message or plain object - * @param {google.cloud.ces.v1beta.EvaluationService.TestPersonaVoiceCallback} callback Node-style callback called with the error, if any, and TestPersonaVoiceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EvaluationService.prototype.testPersonaVoice = function testPersonaVoice(request, callback) { - return this.rpcCall(testPersonaVoice, $root.google.cloud.ces.v1beta.TestPersonaVoiceRequest, $root.google.cloud.ces.v1beta.TestPersonaVoiceResponse, request, callback); - }, "name", { value: "TestPersonaVoice" }); - - /** - * Calls TestPersonaVoice. - * @function testPersonaVoice - * @memberof google.cloud.ces.v1beta.EvaluationService - * @instance - * @param {google.cloud.ces.v1beta.ITestPersonaVoiceRequest} request TestPersonaVoiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return EvaluationService; - })(); - - v1beta.RunEvaluationResponse = (function() { - - /** - * Properties of a RunEvaluationResponse. - * @memberof google.cloud.ces.v1beta - * @interface IRunEvaluationResponse - * @property {string|null} [evaluationRun] RunEvaluationResponse evaluationRun - */ - - /** - * Constructs a new RunEvaluationResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a RunEvaluationResponse. - * @implements IRunEvaluationResponse - * @constructor - * @param {google.cloud.ces.v1beta.IRunEvaluationResponse=} [properties] Properties to set - */ - function RunEvaluationResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RunEvaluationResponse evaluationRun. - * @member {string} evaluationRun - * @memberof google.cloud.ces.v1beta.RunEvaluationResponse - * @instance - */ - RunEvaluationResponse.prototype.evaluationRun = ""; - - /** - * Creates a new RunEvaluationResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.RunEvaluationResponse - * @static - * @param {google.cloud.ces.v1beta.IRunEvaluationResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.RunEvaluationResponse} RunEvaluationResponse instance - */ - RunEvaluationResponse.create = function create(properties) { - return new RunEvaluationResponse(properties); - }; - - /** - * Encodes the specified RunEvaluationResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.RunEvaluationResponse - * @static - * @param {google.cloud.ces.v1beta.IRunEvaluationResponse} message RunEvaluationResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunEvaluationResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evaluationRun != null && Object.hasOwnProperty.call(message, "evaluationRun")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.evaluationRun); - return writer; - }; - - /** - * Encodes the specified RunEvaluationResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.RunEvaluationResponse - * @static - * @param {google.cloud.ces.v1beta.IRunEvaluationResponse} message RunEvaluationResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunEvaluationResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RunEvaluationResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.RunEvaluationResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.RunEvaluationResponse} RunEvaluationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunEvaluationResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RunEvaluationResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.evaluationRun = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RunEvaluationResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.RunEvaluationResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.RunEvaluationResponse} RunEvaluationResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunEvaluationResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RunEvaluationResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.RunEvaluationResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunEvaluationResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) - if (!$util.isString(message.evaluationRun)) - return "evaluationRun: string expected"; - return null; - }; - - /** - * Creates a RunEvaluationResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.RunEvaluationResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.RunEvaluationResponse} RunEvaluationResponse - */ - RunEvaluationResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.RunEvaluationResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.RunEvaluationResponse(); - if (object.evaluationRun != null) - message.evaluationRun = String(object.evaluationRun); - return message; - }; - - /** - * Creates a plain object from a RunEvaluationResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.RunEvaluationResponse - * @static - * @param {google.cloud.ces.v1beta.RunEvaluationResponse} message RunEvaluationResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunEvaluationResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.evaluationRun = ""; - if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) - object.evaluationRun = message.evaluationRun; - return object; - }; - - /** - * Converts this RunEvaluationResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.RunEvaluationResponse - * @instance - * @returns {Object.} JSON object - */ - RunEvaluationResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RunEvaluationResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.RunEvaluationResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunEvaluationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.RunEvaluationResponse"; - }; - - return RunEvaluationResponse; - })(); - - v1beta.RunEvaluationOperationMetadata = (function() { - - /** - * Properties of a RunEvaluationOperationMetadata. - * @memberof google.cloud.ces.v1beta - * @interface IRunEvaluationOperationMetadata - * @property {Array.|null} [evaluations] RunEvaluationOperationMetadata evaluations - * @property {string|null} [evaluationRun] RunEvaluationOperationMetadata evaluationRun - * @property {google.protobuf.ITimestamp|null} [createTime] RunEvaluationOperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] RunEvaluationOperationMetadata endTime - * @property {string|null} [verb] RunEvaluationOperationMetadata verb - * @property {boolean|null} [cancelRequested] RunEvaluationOperationMetadata cancelRequested - */ - - /** - * Constructs a new RunEvaluationOperationMetadata. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a RunEvaluationOperationMetadata. - * @implements IRunEvaluationOperationMetadata - * @constructor - * @param {google.cloud.ces.v1beta.IRunEvaluationOperationMetadata=} [properties] Properties to set - */ - function RunEvaluationOperationMetadata(properties) { - this.evaluations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RunEvaluationOperationMetadata evaluations. - * @member {Array.} evaluations - * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata - * @instance - */ - RunEvaluationOperationMetadata.prototype.evaluations = $util.emptyArray; - - /** - * RunEvaluationOperationMetadata evaluationRun. - * @member {string} evaluationRun - * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata - * @instance - */ - RunEvaluationOperationMetadata.prototype.evaluationRun = ""; - - /** - * RunEvaluationOperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata - * @instance - */ - RunEvaluationOperationMetadata.prototype.createTime = null; - - /** - * RunEvaluationOperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata - * @instance - */ - RunEvaluationOperationMetadata.prototype.endTime = null; - - /** - * RunEvaluationOperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata - * @instance - */ - RunEvaluationOperationMetadata.prototype.verb = ""; - - /** - * RunEvaluationOperationMetadata cancelRequested. - * @member {boolean} cancelRequested - * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata - * @instance - */ - RunEvaluationOperationMetadata.prototype.cancelRequested = false; - - /** - * Creates a new RunEvaluationOperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.IRunEvaluationOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.RunEvaluationOperationMetadata} RunEvaluationOperationMetadata instance - */ - RunEvaluationOperationMetadata.create = function create(properties) { - return new RunEvaluationOperationMetadata(properties); - }; - - /** - * Encodes the specified RunEvaluationOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.IRunEvaluationOperationMetadata} message RunEvaluationOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunEvaluationOperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evaluations != null && message.evaluations.length) - for (var i = 0; i < message.evaluations.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.evaluations[i]); - if (message.evaluationRun != null && Object.hasOwnProperty.call(message, "evaluationRun")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluationRun); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.verb); - if (message.cancelRequested != null && Object.hasOwnProperty.call(message, "cancelRequested")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.cancelRequested); - return writer; - }; - - /** - * Encodes the specified RunEvaluationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.IRunEvaluationOperationMetadata} message RunEvaluationOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunEvaluationOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RunEvaluationOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.RunEvaluationOperationMetadata} RunEvaluationOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunEvaluationOperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RunEvaluationOperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.evaluations && message.evaluations.length)) - message.evaluations = []; - message.evaluations.push(reader.string()); - break; - } - case 2: { - message.evaluationRun = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.verb = reader.string(); - break; - } - case 6: { - message.cancelRequested = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RunEvaluationOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.RunEvaluationOperationMetadata} RunEvaluationOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunEvaluationOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RunEvaluationOperationMetadata message. - * @function verify - * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunEvaluationOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evaluations != null && message.hasOwnProperty("evaluations")) { - if (!Array.isArray(message.evaluations)) - return "evaluations: array expected"; - for (var i = 0; i < message.evaluations.length; ++i) - if (!$util.isString(message.evaluations[i])) - return "evaluations: string[] expected"; - } - if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) - if (!$util.isString(message.evaluationRun)) - return "evaluationRun: 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.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.cancelRequested != null && message.hasOwnProperty("cancelRequested")) - if (typeof message.cancelRequested !== "boolean") - return "cancelRequested: boolean expected"; - return null; - }; - - /** - * Creates a RunEvaluationOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.RunEvaluationOperationMetadata} RunEvaluationOperationMetadata - */ - RunEvaluationOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.RunEvaluationOperationMetadata) - return object; - var message = new $root.google.cloud.ces.v1beta.RunEvaluationOperationMetadata(); - if (object.evaluations) { - if (!Array.isArray(object.evaluations)) - throw TypeError(".google.cloud.ces.v1beta.RunEvaluationOperationMetadata.evaluations: array expected"); - message.evaluations = []; - for (var i = 0; i < object.evaluations.length; ++i) - message.evaluations[i] = String(object.evaluations[i]); - } - if (object.evaluationRun != null) - message.evaluationRun = String(object.evaluationRun); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.RunEvaluationOperationMetadata.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.ces.v1beta.RunEvaluationOperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.verb != null) - message.verb = String(object.verb); - if (object.cancelRequested != null) - message.cancelRequested = Boolean(object.cancelRequested); - return message; - }; - - /** - * Creates a plain object from a RunEvaluationOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.RunEvaluationOperationMetadata} message RunEvaluationOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunEvaluationOperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.evaluations = []; - if (options.defaults) { - object.evaluationRun = ""; - object.createTime = null; - object.endTime = null; - object.verb = ""; - object.cancelRequested = false; - } - if (message.evaluations && message.evaluations.length) { - object.evaluations = []; - for (var j = 0; j < message.evaluations.length; ++j) - object.evaluations[j] = message.evaluations[j]; - } - if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) - object.evaluationRun = message.evaluationRun; - 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.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.cancelRequested != null && message.hasOwnProperty("cancelRequested")) - object.cancelRequested = message.cancelRequested; - return object; - }; - - /** - * Converts this RunEvaluationOperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata - * @instance - * @returns {Object.} JSON object - */ - RunEvaluationOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RunEvaluationOperationMetadata - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunEvaluationOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.RunEvaluationOperationMetadata"; - }; - - return RunEvaluationOperationMetadata; - })(); - - v1beta.GenerateEvaluationOperationMetadata = (function() { - - /** - * Properties of a GenerateEvaluationOperationMetadata. - * @memberof google.cloud.ces.v1beta - * @interface IGenerateEvaluationOperationMetadata - */ - - /** - * Constructs a new GenerateEvaluationOperationMetadata. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GenerateEvaluationOperationMetadata. - * @implements IGenerateEvaluationOperationMetadata - * @constructor - * @param {google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata=} [properties] Properties to set - */ - function GenerateEvaluationOperationMetadata(properties) { - if (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 GenerateEvaluationOperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata} GenerateEvaluationOperationMetadata instance - */ - GenerateEvaluationOperationMetadata.create = function create(properties) { - return new GenerateEvaluationOperationMetadata(properties); - }; - - /** - * Encodes the specified GenerateEvaluationOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata} message GenerateEvaluationOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateEvaluationOperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified GenerateEvaluationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata} message GenerateEvaluationOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateEvaluationOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenerateEvaluationOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata} GenerateEvaluationOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateEvaluationOperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenerateEvaluationOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata} GenerateEvaluationOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateEvaluationOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenerateEvaluationOperationMetadata message. - * @function verify - * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenerateEvaluationOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a GenerateEvaluationOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata} GenerateEvaluationOperationMetadata - */ - GenerateEvaluationOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata) - return object; - return new $root.google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata(); - }; - - /** - * Creates a plain object from a GenerateEvaluationOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata} message GenerateEvaluationOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenerateEvaluationOperationMetadata.toObject = function toObject() { - return {}; - }; - - /** - * Converts this GenerateEvaluationOperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata - * @instance - * @returns {Object.} JSON object - */ - GenerateEvaluationOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenerateEvaluationOperationMetadata - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenerateEvaluationOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata"; - }; - - return GenerateEvaluationOperationMetadata; - })(); - - v1beta.DeleteEvaluationRunOperationMetadata = (function() { - - /** - * Properties of a DeleteEvaluationRunOperationMetadata. - * @memberof google.cloud.ces.v1beta - * @interface IDeleteEvaluationRunOperationMetadata - */ - - /** - * Constructs a new DeleteEvaluationRunOperationMetadata. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DeleteEvaluationRunOperationMetadata. - * @implements IDeleteEvaluationRunOperationMetadata - * @constructor - * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata=} [properties] Properties to set - */ - function DeleteEvaluationRunOperationMetadata(properties) { - if (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 DeleteEvaluationRunOperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata} DeleteEvaluationRunOperationMetadata instance - */ - DeleteEvaluationRunOperationMetadata.create = function create(properties) { - return new DeleteEvaluationRunOperationMetadata(properties); - }; - - /** - * Encodes the specified DeleteEvaluationRunOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata} message DeleteEvaluationRunOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteEvaluationRunOperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified DeleteEvaluationRunOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata} message DeleteEvaluationRunOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteEvaluationRunOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteEvaluationRunOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata} DeleteEvaluationRunOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteEvaluationRunOperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteEvaluationRunOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata} DeleteEvaluationRunOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteEvaluationRunOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteEvaluationRunOperationMetadata message. - * @function verify - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteEvaluationRunOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a DeleteEvaluationRunOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata} DeleteEvaluationRunOperationMetadata - */ - DeleteEvaluationRunOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata) - return object; - return new $root.google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata(); - }; - - /** - * Creates a plain object from a DeleteEvaluationRunOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata} message DeleteEvaluationRunOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteEvaluationRunOperationMetadata.toObject = function toObject() { - return {}; - }; - - /** - * Converts this DeleteEvaluationRunOperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata - * @instance - * @returns {Object.} JSON object - */ - DeleteEvaluationRunOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteEvaluationRunOperationMetadata - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteEvaluationRunOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata"; - }; - - return DeleteEvaluationRunOperationMetadata; - })(); - - v1beta.CreateEvaluationRequest = (function() { - - /** - * Properties of a CreateEvaluationRequest. - * @memberof google.cloud.ces.v1beta - * @interface ICreateEvaluationRequest - * @property {string|null} [parent] CreateEvaluationRequest parent - * @property {string|null} [evaluationId] CreateEvaluationRequest evaluationId - * @property {google.cloud.ces.v1beta.IEvaluation|null} [evaluation] CreateEvaluationRequest evaluation - */ - - /** - * Constructs a new CreateEvaluationRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a CreateEvaluationRequest. - * @implements ICreateEvaluationRequest - * @constructor - * @param {google.cloud.ces.v1beta.ICreateEvaluationRequest=} [properties] Properties to set - */ - function CreateEvaluationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateEvaluationRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest - * @instance - */ - CreateEvaluationRequest.prototype.parent = ""; - - /** - * CreateEvaluationRequest evaluationId. - * @member {string} evaluationId - * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest - * @instance - */ - CreateEvaluationRequest.prototype.evaluationId = ""; - - /** - * CreateEvaluationRequest evaluation. - * @member {google.cloud.ces.v1beta.IEvaluation|null|undefined} evaluation - * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest - * @instance - */ - CreateEvaluationRequest.prototype.evaluation = null; - - /** - * Creates a new CreateEvaluationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateEvaluationRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.CreateEvaluationRequest} CreateEvaluationRequest instance - */ - CreateEvaluationRequest.create = function create(properties) { - return new CreateEvaluationRequest(properties); - }; - - /** - * Encodes the specified CreateEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateEvaluationRequest} message CreateEvaluationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateEvaluationRequest.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.evaluationId != null && Object.hasOwnProperty.call(message, "evaluationId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluationId); - if (message.evaluation != null && Object.hasOwnProperty.call(message, "evaluation")) - $root.google.cloud.ces.v1beta.Evaluation.encode(message.evaluation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateEvaluationRequest} message CreateEvaluationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateEvaluationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.CreateEvaluationRequest} CreateEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateEvaluationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateEvaluationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.evaluationId = reader.string(); - break; - } - case 3: { - message.evaluation = $root.google.cloud.ces.v1beta.Evaluation.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateEvaluationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.CreateEvaluationRequest} CreateEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateEvaluationRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateEvaluationRequest.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.evaluationId != null && message.hasOwnProperty("evaluationId")) - if (!$util.isString(message.evaluationId)) - return "evaluationId: string expected"; - if (message.evaluation != null && message.hasOwnProperty("evaluation")) { - var error = $root.google.cloud.ces.v1beta.Evaluation.verify(message.evaluation); - if (error) - return "evaluation." + error; - } - return null; - }; - - /** - * Creates a CreateEvaluationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.CreateEvaluationRequest} CreateEvaluationRequest - */ - CreateEvaluationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.CreateEvaluationRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.CreateEvaluationRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.evaluationId != null) - message.evaluationId = String(object.evaluationId); - if (object.evaluation != null) { - if (typeof object.evaluation !== "object") - throw TypeError(".google.cloud.ces.v1beta.CreateEvaluationRequest.evaluation: object expected"); - message.evaluation = $root.google.cloud.ces.v1beta.Evaluation.fromObject(object.evaluation); - } - return message; - }; - - /** - * Creates a plain object from a CreateEvaluationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.CreateEvaluationRequest} message CreateEvaluationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateEvaluationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.evaluationId = ""; - object.evaluation = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.evaluationId != null && message.hasOwnProperty("evaluationId")) - object.evaluationId = message.evaluationId; - if (message.evaluation != null && message.hasOwnProperty("evaluation")) - object.evaluation = $root.google.cloud.ces.v1beta.Evaluation.toObject(message.evaluation, options); - return object; - }; - - /** - * Converts this CreateEvaluationRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest - * @instance - * @returns {Object.} JSON object - */ - CreateEvaluationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateEvaluationRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateEvaluationRequest"; - }; - - return CreateEvaluationRequest; - })(); - - v1beta.GenerateEvaluationRequest = (function() { - - /** - * Properties of a GenerateEvaluationRequest. - * @memberof google.cloud.ces.v1beta - * @interface IGenerateEvaluationRequest - * @property {string|null} [conversation] GenerateEvaluationRequest conversation - * @property {google.cloud.ces.v1beta.Conversation.Source|null} [source] GenerateEvaluationRequest source - */ - - /** - * Constructs a new GenerateEvaluationRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GenerateEvaluationRequest. - * @implements IGenerateEvaluationRequest - * @constructor - * @param {google.cloud.ces.v1beta.IGenerateEvaluationRequest=} [properties] Properties to set - */ - function GenerateEvaluationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenerateEvaluationRequest conversation. - * @member {string} conversation - * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest - * @instance - */ - GenerateEvaluationRequest.prototype.conversation = ""; - - /** - * GenerateEvaluationRequest source. - * @member {google.cloud.ces.v1beta.Conversation.Source} source - * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest - * @instance - */ - GenerateEvaluationRequest.prototype.source = 0; - - /** - * Creates a new GenerateEvaluationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.IGenerateEvaluationRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GenerateEvaluationRequest} GenerateEvaluationRequest instance - */ - GenerateEvaluationRequest.create = function create(properties) { - return new GenerateEvaluationRequest(properties); - }; - - /** - * Encodes the specified GenerateEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.IGenerateEvaluationRequest} message GenerateEvaluationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateEvaluationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversation); - if (message.source != null && Object.hasOwnProperty.call(message, "source")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.source); - return writer; - }; - - /** - * Encodes the specified GenerateEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.IGenerateEvaluationRequest} message GenerateEvaluationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenerateEvaluationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GenerateEvaluationRequest} GenerateEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateEvaluationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateEvaluationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.conversation = reader.string(); - break; - } - case 2: { - message.source = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenerateEvaluationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GenerateEvaluationRequest} GenerateEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenerateEvaluationRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenerateEvaluationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.conversation != null && message.hasOwnProperty("conversation")) - if (!$util.isString(message.conversation)) - return "conversation: string expected"; - if (message.source != null && message.hasOwnProperty("source")) - switch (message.source) { - default: - return "source: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a GenerateEvaluationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GenerateEvaluationRequest} GenerateEvaluationRequest - */ - GenerateEvaluationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GenerateEvaluationRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.GenerateEvaluationRequest(); - if (object.conversation != null) - message.conversation = String(object.conversation); - switch (object.source) { - default: - if (typeof object.source === "number") { - message.source = object.source; - break; - } - break; - case "SOURCE_UNSPECIFIED": - case 0: - message.source = 0; - break; - case "LIVE": - case 1: - message.source = 1; - break; - case "SIMULATOR": - case 2: - message.source = 2; - break; - case "EVAL": - case 3: - message.source = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a GenerateEvaluationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.GenerateEvaluationRequest} message GenerateEvaluationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenerateEvaluationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.conversation = ""; - object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; - } - if (message.conversation != null && message.hasOwnProperty("conversation")) - object.conversation = message.conversation; - if (message.source != null && message.hasOwnProperty("source")) - object.source = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1beta.Conversation.Source[message.source] : message.source; - return object; - }; - - /** - * Converts this GenerateEvaluationRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest - * @instance - * @returns {Object.} JSON object - */ - GenerateEvaluationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenerateEvaluationRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenerateEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateEvaluationRequest"; - }; - - return GenerateEvaluationRequest; - })(); - - v1beta.ImportEvaluationsRequest = (function() { - - /** - * Properties of an ImportEvaluationsRequest. - * @memberof google.cloud.ces.v1beta - * @interface IImportEvaluationsRequest - * @property {google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList|null} [conversationList] ImportEvaluationsRequest conversationList - * @property {string|null} [gcsUri] ImportEvaluationsRequest gcsUri - * @property {Uint8Array|null} [csvContent] ImportEvaluationsRequest csvContent - * @property {string|null} [parent] ImportEvaluationsRequest parent - * @property {google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions|null} [importOptions] ImportEvaluationsRequest importOptions - */ - - /** - * Constructs a new ImportEvaluationsRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an ImportEvaluationsRequest. - * @implements IImportEvaluationsRequest - * @constructor - * @param {google.cloud.ces.v1beta.IImportEvaluationsRequest=} [properties] Properties to set - */ - function ImportEvaluationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportEvaluationsRequest conversationList. - * @member {google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList|null|undefined} conversationList - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @instance - */ - ImportEvaluationsRequest.prototype.conversationList = null; - - /** - * ImportEvaluationsRequest gcsUri. - * @member {string|null|undefined} gcsUri - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @instance - */ - ImportEvaluationsRequest.prototype.gcsUri = null; - - /** - * ImportEvaluationsRequest csvContent. - * @member {Uint8Array|null|undefined} csvContent - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @instance - */ - ImportEvaluationsRequest.prototype.csvContent = null; - - /** - * ImportEvaluationsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @instance - */ - ImportEvaluationsRequest.prototype.parent = ""; - - /** - * ImportEvaluationsRequest importOptions. - * @member {google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions|null|undefined} importOptions - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @instance - */ - ImportEvaluationsRequest.prototype.importOptions = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ImportEvaluationsRequest source. - * @member {"conversationList"|"gcsUri"|"csvContent"|undefined} source - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @instance - */ - Object.defineProperty(ImportEvaluationsRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["conversationList", "gcsUri", "csvContent"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ImportEvaluationsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @static - * @param {google.cloud.ces.v1beta.IImportEvaluationsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest} ImportEvaluationsRequest instance - */ - ImportEvaluationsRequest.create = function create(properties) { - return new ImportEvaluationsRequest(properties); - }; - - /** - * Encodes the specified ImportEvaluationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @static - * @param {google.cloud.ces.v1beta.IImportEvaluationsRequest} message ImportEvaluationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportEvaluationsRequest.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.conversationList != null && Object.hasOwnProperty.call(message, "conversationList")) - $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.encode(message.conversationList, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsUri); - if (message.csvContent != null && Object.hasOwnProperty.call(message, "csvContent")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.csvContent); - if (message.importOptions != null && Object.hasOwnProperty.call(message, "importOptions")) - $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.encode(message.importOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ImportEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @static - * @param {google.cloud.ces.v1beta.IImportEvaluationsRequest} message ImportEvaluationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportEvaluationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportEvaluationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest} ImportEvaluationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportEvaluationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportEvaluationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.conversationList = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.decode(reader, reader.uint32()); - break; - } - case 3: { - message.gcsUri = reader.string(); - break; - } - case 4: { - message.csvContent = reader.bytes(); - break; - } - case 1: { - message.parent = reader.string(); - break; - } - case 5: { - message.importOptions = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportEvaluationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest} ImportEvaluationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportEvaluationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportEvaluationsRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportEvaluationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.conversationList != null && message.hasOwnProperty("conversationList")) { - properties.source = 1; - { - var error = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.verify(message.conversationList); - if (error) - return "conversationList." + error; - } - } - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - if (!$util.isString(message.gcsUri)) - return "gcsUri: string expected"; - } - if (message.csvContent != null && message.hasOwnProperty("csvContent")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - if (!(message.csvContent && typeof message.csvContent.length === "number" || $util.isString(message.csvContent))) - return "csvContent: buffer expected"; - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.importOptions != null && message.hasOwnProperty("importOptions")) { - var error = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.verify(message.importOptions); - if (error) - return "importOptions." + error; - } - return null; - }; - - /** - * Creates an ImportEvaluationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest} ImportEvaluationsRequest - */ - ImportEvaluationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ImportEvaluationsRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ImportEvaluationsRequest(); - if (object.conversationList != null) { - if (typeof object.conversationList !== "object") - throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsRequest.conversationList: object expected"); - message.conversationList = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.fromObject(object.conversationList); - } - if (object.gcsUri != null) - message.gcsUri = String(object.gcsUri); - if (object.csvContent != null) - if (typeof object.csvContent === "string") - $util.base64.decode(object.csvContent, message.csvContent = $util.newBuffer($util.base64.length(object.csvContent)), 0); - else if (object.csvContent.length >= 0) - message.csvContent = object.csvContent; - if (object.parent != null) - message.parent = String(object.parent); - if (object.importOptions != null) { - if (typeof object.importOptions !== "object") - throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsRequest.importOptions: object expected"); - message.importOptions = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.fromObject(object.importOptions); - } - return message; - }; - - /** - * Creates a plain object from an ImportEvaluationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @static - * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest} message ImportEvaluationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportEvaluationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.importOptions = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.conversationList != null && message.hasOwnProperty("conversationList")) { - object.conversationList = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.toObject(message.conversationList, options); - if (options.oneofs) - object.source = "conversationList"; - } - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { - object.gcsUri = message.gcsUri; - if (options.oneofs) - object.source = "gcsUri"; - } - if (message.csvContent != null && message.hasOwnProperty("csvContent")) { - object.csvContent = options.bytes === String ? $util.base64.encode(message.csvContent, 0, message.csvContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.csvContent) : message.csvContent; - if (options.oneofs) - object.source = "csvContent"; - } - if (message.importOptions != null && message.hasOwnProperty("importOptions")) - object.importOptions = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.toObject(message.importOptions, options); - return object; - }; - - /** - * Converts this ImportEvaluationsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @instance - * @returns {Object.} JSON object - */ - ImportEvaluationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportEvaluationsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportEvaluationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportEvaluationsRequest"; - }; - - ImportEvaluationsRequest.ConversationList = (function() { - - /** - * Properties of a ConversationList. - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @interface IConversationList - * @property {Array.|null} [conversations] ConversationList conversations - */ - - /** - * Constructs a new ConversationList. - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @classdesc Represents a ConversationList. - * @implements IConversationList - * @constructor - * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList=} [properties] Properties to set - */ - function ConversationList(properties) { - this.conversations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConversationList conversations. - * @member {Array.} conversations - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList - * @instance - */ - ConversationList.prototype.conversations = $util.emptyArray; - - /** - * Creates a new ConversationList instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList - * @static - * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList} ConversationList instance - */ - ConversationList.create = function create(properties) { - return new ConversationList(properties); - }; - - /** - * Encodes the specified ConversationList message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList - * @static - * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList} message ConversationList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConversationList.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.conversations != null && message.conversations.length) - for (var i = 0; i < message.conversations.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversations[i]); - return writer; - }; - - /** - * Encodes the specified ConversationList message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList - * @static - * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList} message ConversationList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConversationList.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConversationList message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList} ConversationList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConversationList.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.conversations && message.conversations.length)) - message.conversations = []; - message.conversations.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConversationList message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList} ConversationList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConversationList.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConversationList message. - * @function verify - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConversationList.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.conversations != null && message.hasOwnProperty("conversations")) { - if (!Array.isArray(message.conversations)) - return "conversations: array expected"; - for (var i = 0; i < message.conversations.length; ++i) - if (!$util.isString(message.conversations[i])) - return "conversations: string[] expected"; - } - return null; - }; - - /** - * Creates a ConversationList message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList} ConversationList - */ - ConversationList.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList) - return object; - var message = new $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList(); - if (object.conversations) { - if (!Array.isArray(object.conversations)) - throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.conversations: array expected"); - message.conversations = []; - for (var i = 0; i < object.conversations.length; ++i) - message.conversations[i] = String(object.conversations[i]); - } - return message; - }; - - /** - * Creates a plain object from a ConversationList message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList - * @static - * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList} message ConversationList - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConversationList.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.conversations = []; - if (message.conversations && message.conversations.length) { - object.conversations = []; - for (var j = 0; j < message.conversations.length; ++j) - object.conversations[j] = message.conversations[j]; - } - return object; - }; - - /** - * Converts this ConversationList to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList - * @instance - * @returns {Object.} JSON object - */ - ConversationList.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConversationList - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConversationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList"; - }; - - return ConversationList; - })(); - - ImportEvaluationsRequest.ImportOptions = (function() { - - /** - * Properties of an ImportOptions. - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @interface IImportOptions - * @property {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy|null} [conflictResolutionStrategy] ImportOptions conflictResolutionStrategy - */ - - /** - * Constructs a new ImportOptions. - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest - * @classdesc Represents an ImportOptions. - * @implements IImportOptions - * @constructor - * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions=} [properties] Properties to set - */ - function ImportOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportOptions conflictResolutionStrategy. - * @member {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy} conflictResolutionStrategy - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions - * @instance - */ - ImportOptions.prototype.conflictResolutionStrategy = 0; - - /** - * Creates a new ImportOptions instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions - * @static - * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions} ImportOptions instance - */ - ImportOptions.create = function create(properties) { - return new ImportOptions(properties); - }; - - /** - * Encodes the specified ImportOptions message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions - * @static - * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions} message ImportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.conflictResolutionStrategy != null && Object.hasOwnProperty.call(message, "conflictResolutionStrategy")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.conflictResolutionStrategy); - return writer; - }; - - /** - * Encodes the specified ImportOptions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions - * @static - * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions} message ImportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions} ImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.conflictResolutionStrategy = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions} ImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportOptions message. - * @function verify - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.conflictResolutionStrategy != null && message.hasOwnProperty("conflictResolutionStrategy")) - switch (message.conflictResolutionStrategy) { - default: - return "conflictResolutionStrategy: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates an ImportOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions} ImportOptions - */ - ImportOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions) - return object; - var message = new $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions(); - switch (object.conflictResolutionStrategy) { - default: - if (typeof object.conflictResolutionStrategy === "number") { - message.conflictResolutionStrategy = object.conflictResolutionStrategy; - break; - } - break; - case "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED": - case 0: - message.conflictResolutionStrategy = 0; - break; - case "OVERWRITE": - case 1: - message.conflictResolutionStrategy = 1; - break; - case "SKIP": - case 2: - message.conflictResolutionStrategy = 2; - break; - case "DUPLICATE": - case 3: - message.conflictResolutionStrategy = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from an ImportOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions - * @static - * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions} message ImportOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.conflictResolutionStrategy = options.enums === String ? "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED" : 0; - if (message.conflictResolutionStrategy != null && message.hasOwnProperty("conflictResolutionStrategy")) - object.conflictResolutionStrategy = options.enums === String ? $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy[message.conflictResolutionStrategy] === undefined ? message.conflictResolutionStrategy : $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy[message.conflictResolutionStrategy] : message.conflictResolutionStrategy; - return object; - }; - - /** - * Converts this ImportOptions to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions - * @instance - * @returns {Object.} JSON object - */ - ImportOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportOptions - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions"; - }; - - /** - * ConflictResolutionStrategy enum. - * @name google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy - * @enum {number} - * @property {number} CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED=0 CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED value - * @property {number} OVERWRITE=1 OVERWRITE value - * @property {number} SKIP=2 SKIP value - * @property {number} DUPLICATE=3 DUPLICATE value - */ - ImportOptions.ConflictResolutionStrategy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED"] = 0; - values[valuesById[1] = "OVERWRITE"] = 1; - values[valuesById[2] = "SKIP"] = 2; - values[valuesById[3] = "DUPLICATE"] = 3; - return values; - })(); - - return ImportOptions; - })(); - - return ImportEvaluationsRequest; - })(); - - v1beta.ImportEvaluationsResponse = (function() { - - /** - * Properties of an ImportEvaluationsResponse. - * @memberof google.cloud.ces.v1beta - * @interface IImportEvaluationsResponse - * @property {Array.|null} [evaluations] ImportEvaluationsResponse evaluations - * @property {Array.|null} [errorMessages] ImportEvaluationsResponse errorMessages - * @property {number|null} [importFailureCount] ImportEvaluationsResponse importFailureCount - */ - - /** - * Constructs a new ImportEvaluationsResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an ImportEvaluationsResponse. - * @implements IImportEvaluationsResponse - * @constructor - * @param {google.cloud.ces.v1beta.IImportEvaluationsResponse=} [properties] Properties to set - */ - function ImportEvaluationsResponse(properties) { - this.evaluations = []; - this.errorMessages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportEvaluationsResponse evaluations. - * @member {Array.} evaluations - * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse - * @instance - */ - ImportEvaluationsResponse.prototype.evaluations = $util.emptyArray; - - /** - * ImportEvaluationsResponse errorMessages. - * @member {Array.} errorMessages - * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse - * @instance - */ - ImportEvaluationsResponse.prototype.errorMessages = $util.emptyArray; - - /** - * ImportEvaluationsResponse importFailureCount. - * @member {number} importFailureCount - * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse - * @instance - */ - ImportEvaluationsResponse.prototype.importFailureCount = 0; - - /** - * Creates a new ImportEvaluationsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse - * @static - * @param {google.cloud.ces.v1beta.IImportEvaluationsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ImportEvaluationsResponse} ImportEvaluationsResponse instance - */ - ImportEvaluationsResponse.create = function create(properties) { - return new ImportEvaluationsResponse(properties); - }; - - /** - * Encodes the specified ImportEvaluationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse - * @static - * @param {google.cloud.ces.v1beta.IImportEvaluationsResponse} message ImportEvaluationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportEvaluationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evaluations != null && message.evaluations.length) - for (var i = 0; i < message.evaluations.length; ++i) - $root.google.cloud.ces.v1beta.Evaluation.encode(message.evaluations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.errorMessages != null && message.errorMessages.length) - for (var i = 0; i < message.errorMessages.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessages[i]); - if (message.importFailureCount != null && Object.hasOwnProperty.call(message, "importFailureCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.importFailureCount); - return writer; - }; - - /** - * Encodes the specified ImportEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse - * @static - * @param {google.cloud.ces.v1beta.IImportEvaluationsResponse} message ImportEvaluationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportEvaluationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportEvaluationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ImportEvaluationsResponse} ImportEvaluationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportEvaluationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportEvaluationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.evaluations && message.evaluations.length)) - message.evaluations = []; - message.evaluations.push($root.google.cloud.ces.v1beta.Evaluation.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.errorMessages && message.errorMessages.length)) - message.errorMessages = []; - message.errorMessages.push(reader.string()); - break; - } - case 3: { - message.importFailureCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportEvaluationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ImportEvaluationsResponse} ImportEvaluationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportEvaluationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportEvaluationsResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportEvaluationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evaluations != null && message.hasOwnProperty("evaluations")) { - if (!Array.isArray(message.evaluations)) - return "evaluations: array expected"; - for (var i = 0; i < message.evaluations.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Evaluation.verify(message.evaluations[i]); - if (error) - return "evaluations." + error; - } - } - if (message.errorMessages != null && message.hasOwnProperty("errorMessages")) { - if (!Array.isArray(message.errorMessages)) - return "errorMessages: array expected"; - for (var i = 0; i < message.errorMessages.length; ++i) - if (!$util.isString(message.errorMessages[i])) - return "errorMessages: string[] expected"; - } - if (message.importFailureCount != null && message.hasOwnProperty("importFailureCount")) - if (!$util.isInteger(message.importFailureCount)) - return "importFailureCount: integer expected"; - return null; - }; - - /** - * Creates an ImportEvaluationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ImportEvaluationsResponse} ImportEvaluationsResponse - */ - ImportEvaluationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ImportEvaluationsResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ImportEvaluationsResponse(); - if (object.evaluations) { - if (!Array.isArray(object.evaluations)) - throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsResponse.evaluations: array expected"); - message.evaluations = []; - for (var i = 0; i < object.evaluations.length; ++i) { - if (typeof object.evaluations[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsResponse.evaluations: object expected"); - message.evaluations[i] = $root.google.cloud.ces.v1beta.Evaluation.fromObject(object.evaluations[i]); - } - } - if (object.errorMessages) { - if (!Array.isArray(object.errorMessages)) - throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsResponse.errorMessages: array expected"); - message.errorMessages = []; - for (var i = 0; i < object.errorMessages.length; ++i) - message.errorMessages[i] = String(object.errorMessages[i]); - } - if (object.importFailureCount != null) - message.importFailureCount = object.importFailureCount | 0; - return message; - }; - - /** - * Creates a plain object from an ImportEvaluationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse - * @static - * @param {google.cloud.ces.v1beta.ImportEvaluationsResponse} message ImportEvaluationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportEvaluationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.evaluations = []; - object.errorMessages = []; - } - if (options.defaults) - object.importFailureCount = 0; - if (message.evaluations && message.evaluations.length) { - object.evaluations = []; - for (var j = 0; j < message.evaluations.length; ++j) - object.evaluations[j] = $root.google.cloud.ces.v1beta.Evaluation.toObject(message.evaluations[j], options); - } - if (message.errorMessages && message.errorMessages.length) { - object.errorMessages = []; - for (var j = 0; j < message.errorMessages.length; ++j) - object.errorMessages[j] = message.errorMessages[j]; - } - if (message.importFailureCount != null && message.hasOwnProperty("importFailureCount")) - object.importFailureCount = message.importFailureCount; - return object; - }; - - /** - * Converts this ImportEvaluationsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse - * @instance - * @returns {Object.} JSON object - */ - ImportEvaluationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportEvaluationsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportEvaluationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportEvaluationsResponse"; - }; - - return ImportEvaluationsResponse; - })(); - - v1beta.ImportEvaluationsOperationMetadata = (function() { - - /** - * Properties of an ImportEvaluationsOperationMetadata. - * @memberof google.cloud.ces.v1beta - * @interface IImportEvaluationsOperationMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] ImportEvaluationsOperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] ImportEvaluationsOperationMetadata endTime - * @property {string|null} [statusMessage] ImportEvaluationsOperationMetadata statusMessage - */ - - /** - * Constructs a new ImportEvaluationsOperationMetadata. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an ImportEvaluationsOperationMetadata. - * @implements IImportEvaluationsOperationMetadata - * @constructor - * @param {google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata=} [properties] Properties to set - */ - function ImportEvaluationsOperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportEvaluationsOperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata - * @instance - */ - ImportEvaluationsOperationMetadata.prototype.createTime = null; - - /** - * ImportEvaluationsOperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata - * @instance - */ - ImportEvaluationsOperationMetadata.prototype.endTime = null; - - /** - * ImportEvaluationsOperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata - * @instance - */ - ImportEvaluationsOperationMetadata.prototype.statusMessage = ""; - - /** - * Creates a new ImportEvaluationsOperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata} ImportEvaluationsOperationMetadata instance - */ - ImportEvaluationsOperationMetadata.create = function create(properties) { - return new ImportEvaluationsOperationMetadata(properties); - }; - - /** - * Encodes the specified ImportEvaluationsOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata} message ImportEvaluationsOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportEvaluationsOperationMetadata.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.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.statusMessage); - return writer; - }; - - /** - * Encodes the specified ImportEvaluationsOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata} message ImportEvaluationsOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportEvaluationsOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportEvaluationsOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata} ImportEvaluationsOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportEvaluationsOperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - 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.statusMessage = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportEvaluationsOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata} ImportEvaluationsOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportEvaluationsOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportEvaluationsOperationMetadata message. - * @function verify - * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportEvaluationsOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - 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.statusMessage != null && message.hasOwnProperty("statusMessage")) - if (!$util.isString(message.statusMessage)) - return "statusMessage: string expected"; - return null; - }; - - /** - * Creates an ImportEvaluationsOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata} ImportEvaluationsOperationMetadata - */ - ImportEvaluationsOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata) - return object; - var message = new $root.google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata.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.ces.v1beta.ImportEvaluationsOperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - return message; - }; - - /** - * Creates a plain object from an ImportEvaluationsOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata} message ImportEvaluationsOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportEvaluationsOperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.statusMessage = ""; - } - 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.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - return object; - }; - - /** - * Converts this ImportEvaluationsOperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata - * @instance - * @returns {Object.} JSON object - */ - ImportEvaluationsOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportEvaluationsOperationMetadata - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportEvaluationsOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata"; - }; - - return ImportEvaluationsOperationMetadata; - })(); - - v1beta.CreateEvaluationDatasetRequest = (function() { - - /** - * Properties of a CreateEvaluationDatasetRequest. - * @memberof google.cloud.ces.v1beta - * @interface ICreateEvaluationDatasetRequest - * @property {string|null} [parent] CreateEvaluationDatasetRequest parent - * @property {string|null} [evaluationDatasetId] CreateEvaluationDatasetRequest evaluationDatasetId - * @property {google.cloud.ces.v1beta.IEvaluationDataset|null} [evaluationDataset] CreateEvaluationDatasetRequest evaluationDataset - */ - - /** - * Constructs a new CreateEvaluationDatasetRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a CreateEvaluationDatasetRequest. - * @implements ICreateEvaluationDatasetRequest - * @constructor - * @param {google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest=} [properties] Properties to set - */ - function CreateEvaluationDatasetRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateEvaluationDatasetRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest - * @instance - */ - CreateEvaluationDatasetRequest.prototype.parent = ""; - - /** - * CreateEvaluationDatasetRequest evaluationDatasetId. - * @member {string} evaluationDatasetId - * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest - * @instance - */ - CreateEvaluationDatasetRequest.prototype.evaluationDatasetId = ""; - - /** - * CreateEvaluationDatasetRequest evaluationDataset. - * @member {google.cloud.ces.v1beta.IEvaluationDataset|null|undefined} evaluationDataset - * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest - * @instance - */ - CreateEvaluationDatasetRequest.prototype.evaluationDataset = null; - - /** - * Creates a new CreateEvaluationDatasetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.CreateEvaluationDatasetRequest} CreateEvaluationDatasetRequest instance - */ - CreateEvaluationDatasetRequest.create = function create(properties) { - return new CreateEvaluationDatasetRequest(properties); - }; - - /** - * Encodes the specified CreateEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationDatasetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest} message CreateEvaluationDatasetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateEvaluationDatasetRequest.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.evaluationDatasetId != null && Object.hasOwnProperty.call(message, "evaluationDatasetId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluationDatasetId); - if (message.evaluationDataset != null && Object.hasOwnProperty.call(message, "evaluationDataset")) - $root.google.cloud.ces.v1beta.EvaluationDataset.encode(message.evaluationDataset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationDatasetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest} message CreateEvaluationDatasetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateEvaluationDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateEvaluationDatasetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.CreateEvaluationDatasetRequest} CreateEvaluationDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateEvaluationDatasetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.evaluationDatasetId = reader.string(); - break; - } - case 3: { - message.evaluationDataset = $root.google.cloud.ces.v1beta.EvaluationDataset.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateEvaluationDatasetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.CreateEvaluationDatasetRequest} CreateEvaluationDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateEvaluationDatasetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateEvaluationDatasetRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateEvaluationDatasetRequest.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.evaluationDatasetId != null && message.hasOwnProperty("evaluationDatasetId")) - if (!$util.isString(message.evaluationDatasetId)) - return "evaluationDatasetId: string expected"; - if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) { - var error = $root.google.cloud.ces.v1beta.EvaluationDataset.verify(message.evaluationDataset); - if (error) - return "evaluationDataset." + error; - } - return null; - }; - - /** - * Creates a CreateEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.CreateEvaluationDatasetRequest} CreateEvaluationDatasetRequest - */ - CreateEvaluationDatasetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.evaluationDatasetId != null) - message.evaluationDatasetId = String(object.evaluationDatasetId); - if (object.evaluationDataset != null) { - if (typeof object.evaluationDataset !== "object") - throw TypeError(".google.cloud.ces.v1beta.CreateEvaluationDatasetRequest.evaluationDataset: object expected"); - message.evaluationDataset = $root.google.cloud.ces.v1beta.EvaluationDataset.fromObject(object.evaluationDataset); - } - return message; - }; - - /** - * Creates a plain object from a CreateEvaluationDatasetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest - * @static - * @param {google.cloud.ces.v1beta.CreateEvaluationDatasetRequest} message CreateEvaluationDatasetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateEvaluationDatasetRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.evaluationDatasetId = ""; - object.evaluationDataset = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.evaluationDatasetId != null && message.hasOwnProperty("evaluationDatasetId")) - object.evaluationDatasetId = message.evaluationDatasetId; - if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) - object.evaluationDataset = $root.google.cloud.ces.v1beta.EvaluationDataset.toObject(message.evaluationDataset, options); - return object; - }; - - /** - * Converts this CreateEvaluationDatasetRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest - * @instance - * @returns {Object.} JSON object - */ - CreateEvaluationDatasetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateEvaluationDatasetRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateEvaluationDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateEvaluationDatasetRequest"; - }; - - return CreateEvaluationDatasetRequest; - })(); - - v1beta.UpdateEvaluationRequest = (function() { - - /** - * Properties of an UpdateEvaluationRequest. - * @memberof google.cloud.ces.v1beta - * @interface IUpdateEvaluationRequest - * @property {google.cloud.ces.v1beta.IEvaluation|null} [evaluation] UpdateEvaluationRequest evaluation - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEvaluationRequest updateMask - */ - - /** - * Constructs a new UpdateEvaluationRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an UpdateEvaluationRequest. - * @implements IUpdateEvaluationRequest - * @constructor - * @param {google.cloud.ces.v1beta.IUpdateEvaluationRequest=} [properties] Properties to set - */ - function UpdateEvaluationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateEvaluationRequest evaluation. - * @member {google.cloud.ces.v1beta.IEvaluation|null|undefined} evaluation - * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest - * @instance - */ - UpdateEvaluationRequest.prototype.evaluation = null; - - /** - * UpdateEvaluationRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest - * @instance - */ - UpdateEvaluationRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateEvaluationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateEvaluationRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.UpdateEvaluationRequest} UpdateEvaluationRequest instance - */ - UpdateEvaluationRequest.create = function create(properties) { - return new UpdateEvaluationRequest(properties); - }; - - /** - * Encodes the specified UpdateEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateEvaluationRequest} message UpdateEvaluationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateEvaluationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evaluation != null && Object.hasOwnProperty.call(message, "evaluation")) - $root.google.cloud.ces.v1beta.Evaluation.encode(message.evaluation, 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 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateEvaluationRequest} message UpdateEvaluationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateEvaluationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.UpdateEvaluationRequest} UpdateEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateEvaluationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateEvaluationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.evaluation = $root.google.cloud.ces.v1beta.Evaluation.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateEvaluationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.UpdateEvaluationRequest} UpdateEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateEvaluationRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateEvaluationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evaluation != null && message.hasOwnProperty("evaluation")) { - var error = $root.google.cloud.ces.v1beta.Evaluation.verify(message.evaluation); - if (error) - return "evaluation." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateEvaluationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.UpdateEvaluationRequest} UpdateEvaluationRequest - */ - UpdateEvaluationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.UpdateEvaluationRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.UpdateEvaluationRequest(); - if (object.evaluation != null) { - if (typeof object.evaluation !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateEvaluationRequest.evaluation: object expected"); - message.evaluation = $root.google.cloud.ces.v1beta.Evaluation.fromObject(object.evaluation); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateEvaluationRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateEvaluationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.UpdateEvaluationRequest} message UpdateEvaluationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateEvaluationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.evaluation = null; - object.updateMask = null; - } - if (message.evaluation != null && message.hasOwnProperty("evaluation")) - object.evaluation = $root.google.cloud.ces.v1beta.Evaluation.toObject(message.evaluation, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateEvaluationRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateEvaluationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateEvaluationRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateEvaluationRequest"; - }; - - return UpdateEvaluationRequest; - })(); - - v1beta.UpdateEvaluationDatasetRequest = (function() { - - /** - * Properties of an UpdateEvaluationDatasetRequest. - * @memberof google.cloud.ces.v1beta - * @interface IUpdateEvaluationDatasetRequest - * @property {google.cloud.ces.v1beta.IEvaluationDataset|null} [evaluationDataset] UpdateEvaluationDatasetRequest evaluationDataset - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEvaluationDatasetRequest updateMask - */ - - /** - * Constructs a new UpdateEvaluationDatasetRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an UpdateEvaluationDatasetRequest. - * @implements IUpdateEvaluationDatasetRequest - * @constructor - * @param {google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest=} [properties] Properties to set - */ - function UpdateEvaluationDatasetRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateEvaluationDatasetRequest evaluationDataset. - * @member {google.cloud.ces.v1beta.IEvaluationDataset|null|undefined} evaluationDataset - * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest - * @instance - */ - UpdateEvaluationDatasetRequest.prototype.evaluationDataset = null; - - /** - * UpdateEvaluationDatasetRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest - * @instance - */ - UpdateEvaluationDatasetRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateEvaluationDatasetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest} UpdateEvaluationDatasetRequest instance - */ - UpdateEvaluationDatasetRequest.create = function create(properties) { - return new UpdateEvaluationDatasetRequest(properties); - }; - - /** - * Encodes the specified UpdateEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest} message UpdateEvaluationDatasetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateEvaluationDatasetRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evaluationDataset != null && Object.hasOwnProperty.call(message, "evaluationDataset")) - $root.google.cloud.ces.v1beta.EvaluationDataset.encode(message.evaluationDataset, 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 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest} message UpdateEvaluationDatasetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateEvaluationDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateEvaluationDatasetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest} UpdateEvaluationDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateEvaluationDatasetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.evaluationDataset = $root.google.cloud.ces.v1beta.EvaluationDataset.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateEvaluationDatasetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest} UpdateEvaluationDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateEvaluationDatasetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateEvaluationDatasetRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateEvaluationDatasetRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) { - var error = $root.google.cloud.ces.v1beta.EvaluationDataset.verify(message.evaluationDataset); - if (error) - return "evaluationDataset." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest} UpdateEvaluationDatasetRequest - */ - UpdateEvaluationDatasetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest(); - if (object.evaluationDataset != null) { - if (typeof object.evaluationDataset !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest.evaluationDataset: object expected"); - message.evaluationDataset = $root.google.cloud.ces.v1beta.EvaluationDataset.fromObject(object.evaluationDataset); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateEvaluationDatasetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest - * @static - * @param {google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest} message UpdateEvaluationDatasetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateEvaluationDatasetRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.evaluationDataset = null; - object.updateMask = null; - } - if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) - object.evaluationDataset = $root.google.cloud.ces.v1beta.EvaluationDataset.toObject(message.evaluationDataset, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateEvaluationDatasetRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateEvaluationDatasetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateEvaluationDatasetRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateEvaluationDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest"; - }; - - return UpdateEvaluationDatasetRequest; - })(); - - v1beta.DeleteEvaluationRequest = (function() { - - /** - * Properties of a DeleteEvaluationRequest. - * @memberof google.cloud.ces.v1beta - * @interface IDeleteEvaluationRequest - * @property {string|null} [name] DeleteEvaluationRequest name - * @property {boolean|null} [force] DeleteEvaluationRequest force - * @property {string|null} [etag] DeleteEvaluationRequest etag - */ - - /** - * Constructs a new DeleteEvaluationRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DeleteEvaluationRequest. - * @implements IDeleteEvaluationRequest - * @constructor - * @param {google.cloud.ces.v1beta.IDeleteEvaluationRequest=} [properties] Properties to set - */ - function DeleteEvaluationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteEvaluationRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest - * @instance - */ - DeleteEvaluationRequest.prototype.name = ""; - - /** - * DeleteEvaluationRequest force. - * @member {boolean} force - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest - * @instance - */ - DeleteEvaluationRequest.prototype.force = false; - - /** - * DeleteEvaluationRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest - * @instance - */ - DeleteEvaluationRequest.prototype.etag = ""; - - /** - * Creates a new DeleteEvaluationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteEvaluationRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DeleteEvaluationRequest} DeleteEvaluationRequest instance - */ - DeleteEvaluationRequest.create = function create(properties) { - return new DeleteEvaluationRequest(properties); - }; - - /** - * Encodes the specified DeleteEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteEvaluationRequest} message DeleteEvaluationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteEvaluationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteEvaluationRequest} message DeleteEvaluationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteEvaluationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DeleteEvaluationRequest} DeleteEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteEvaluationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteEvaluationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.force = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteEvaluationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DeleteEvaluationRequest} DeleteEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteEvaluationRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteEvaluationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteEvaluationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DeleteEvaluationRequest} DeleteEvaluationRequest - */ - DeleteEvaluationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DeleteEvaluationRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.DeleteEvaluationRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.force != null) - message.force = Boolean(object.force); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteEvaluationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.DeleteEvaluationRequest} message DeleteEvaluationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteEvaluationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.force = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteEvaluationRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteEvaluationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteEvaluationRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteEvaluationRequest"; - }; - - return DeleteEvaluationRequest; - })(); - - v1beta.DeleteEvaluationResultRequest = (function() { - - /** - * Properties of a DeleteEvaluationResultRequest. - * @memberof google.cloud.ces.v1beta - * @interface IDeleteEvaluationResultRequest - * @property {string|null} [name] DeleteEvaluationResultRequest name - */ - - /** - * Constructs a new DeleteEvaluationResultRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DeleteEvaluationResultRequest. - * @implements IDeleteEvaluationResultRequest - * @constructor - * @param {google.cloud.ces.v1beta.IDeleteEvaluationResultRequest=} [properties] Properties to set - */ - function DeleteEvaluationResultRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteEvaluationResultRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest - * @instance - */ - DeleteEvaluationResultRequest.prototype.name = ""; - - /** - * Creates a new DeleteEvaluationResultRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteEvaluationResultRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DeleteEvaluationResultRequest} DeleteEvaluationResultRequest instance - */ - DeleteEvaluationResultRequest.create = function create(properties) { - return new DeleteEvaluationResultRequest(properties); - }; - - /** - * Encodes the specified DeleteEvaluationResultRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationResultRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteEvaluationResultRequest} message DeleteEvaluationResultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteEvaluationResultRequest.encode = function encode(message, writer) { - 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 DeleteEvaluationResultRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationResultRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteEvaluationResultRequest} message DeleteEvaluationResultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteEvaluationResultRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteEvaluationResultRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DeleteEvaluationResultRequest} DeleteEvaluationResultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteEvaluationResultRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteEvaluationResultRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteEvaluationResultRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DeleteEvaluationResultRequest} DeleteEvaluationResultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteEvaluationResultRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteEvaluationResultRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteEvaluationResultRequest.verify = function verify(message) { - if (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 DeleteEvaluationResultRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DeleteEvaluationResultRequest} DeleteEvaluationResultRequest - */ - DeleteEvaluationResultRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DeleteEvaluationResultRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.DeleteEvaluationResultRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteEvaluationResultRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest - * @static - * @param {google.cloud.ces.v1beta.DeleteEvaluationResultRequest} message DeleteEvaluationResultRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteEvaluationResultRequest.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 DeleteEvaluationResultRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteEvaluationResultRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteEvaluationResultRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteEvaluationResultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteEvaluationResultRequest"; - }; - - return DeleteEvaluationResultRequest; - })(); - - v1beta.DeleteEvaluationDatasetRequest = (function() { - - /** - * Properties of a DeleteEvaluationDatasetRequest. - * @memberof google.cloud.ces.v1beta - * @interface IDeleteEvaluationDatasetRequest - * @property {string|null} [name] DeleteEvaluationDatasetRequest name - * @property {string|null} [etag] DeleteEvaluationDatasetRequest etag - */ - - /** - * Constructs a new DeleteEvaluationDatasetRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DeleteEvaluationDatasetRequest. - * @implements IDeleteEvaluationDatasetRequest - * @constructor - * @param {google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest=} [properties] Properties to set - */ - function DeleteEvaluationDatasetRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteEvaluationDatasetRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest - * @instance - */ - DeleteEvaluationDatasetRequest.prototype.name = ""; - - /** - * DeleteEvaluationDatasetRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest - * @instance - */ - DeleteEvaluationDatasetRequest.prototype.etag = ""; - - /** - * Creates a new DeleteEvaluationDatasetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest} DeleteEvaluationDatasetRequest instance - */ - DeleteEvaluationDatasetRequest.create = function create(properties) { - return new DeleteEvaluationDatasetRequest(properties); - }; - - /** - * Encodes the specified DeleteEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest} message DeleteEvaluationDatasetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteEvaluationDatasetRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest} message DeleteEvaluationDatasetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteEvaluationDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteEvaluationDatasetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest} DeleteEvaluationDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteEvaluationDatasetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteEvaluationDatasetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest} DeleteEvaluationDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteEvaluationDatasetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteEvaluationDatasetRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteEvaluationDatasetRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest} DeleteEvaluationDatasetRequest - */ - DeleteEvaluationDatasetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteEvaluationDatasetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest - * @static - * @param {google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest} message DeleteEvaluationDatasetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteEvaluationDatasetRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteEvaluationDatasetRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteEvaluationDatasetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteEvaluationDatasetRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteEvaluationDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest"; - }; - - return DeleteEvaluationDatasetRequest; - })(); - - v1beta.DeleteEvaluationRunRequest = (function() { - - /** - * Properties of a DeleteEvaluationRunRequest. - * @memberof google.cloud.ces.v1beta - * @interface IDeleteEvaluationRunRequest - * @property {string|null} [name] DeleteEvaluationRunRequest name - */ - - /** - * Constructs a new DeleteEvaluationRunRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DeleteEvaluationRunRequest. - * @implements IDeleteEvaluationRunRequest - * @constructor - * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunRequest=} [properties] Properties to set - */ - function DeleteEvaluationRunRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteEvaluationRunRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest - * @instance - */ - DeleteEvaluationRunRequest.prototype.name = ""; - - /** - * Creates a new DeleteEvaluationRunRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunRequest} DeleteEvaluationRunRequest instance - */ - DeleteEvaluationRunRequest.create = function create(properties) { - return new DeleteEvaluationRunRequest(properties); - }; - - /** - * Encodes the specified DeleteEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunRequest} message DeleteEvaluationRunRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteEvaluationRunRequest.encode = function encode(message, writer) { - 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 DeleteEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunRequest} message DeleteEvaluationRunRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteEvaluationRunRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteEvaluationRunRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunRequest} DeleteEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteEvaluationRunRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteEvaluationRunRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteEvaluationRunRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunRequest} DeleteEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteEvaluationRunRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteEvaluationRunRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteEvaluationRunRequest.verify = function verify(message) { - if (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 DeleteEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunRequest} DeleteEvaluationRunRequest - */ - DeleteEvaluationRunRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DeleteEvaluationRunRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.DeleteEvaluationRunRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteEvaluationRunRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.DeleteEvaluationRunRequest} message DeleteEvaluationRunRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteEvaluationRunRequest.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 DeleteEvaluationRunRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteEvaluationRunRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteEvaluationRunRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteEvaluationRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteEvaluationRunRequest"; - }; - - return DeleteEvaluationRunRequest; - })(); - - v1beta.GetEvaluationRequest = (function() { - - /** - * Properties of a GetEvaluationRequest. - * @memberof google.cloud.ces.v1beta - * @interface IGetEvaluationRequest - * @property {string|null} [name] GetEvaluationRequest name - */ - - /** - * Constructs a new GetEvaluationRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GetEvaluationRequest. - * @implements IGetEvaluationRequest - * @constructor - * @param {google.cloud.ces.v1beta.IGetEvaluationRequest=} [properties] Properties to set - */ - function GetEvaluationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvaluationRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.GetEvaluationRequest - * @instance - */ - GetEvaluationRequest.prototype.name = ""; - - /** - * Creates a new GetEvaluationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GetEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.IGetEvaluationRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GetEvaluationRequest} GetEvaluationRequest instance - */ - GetEvaluationRequest.create = function create(properties) { - return new GetEvaluationRequest(properties); - }; - - /** - * Encodes the specified GetEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GetEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.IGetEvaluationRequest} message GetEvaluationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvaluationRequest.encode = function encode(message, writer) { - 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 GetEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GetEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.IGetEvaluationRequest} message GetEvaluationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvaluationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GetEvaluationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GetEvaluationRequest} GetEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvaluationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetEvaluationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEvaluationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GetEvaluationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GetEvaluationRequest} GetEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvaluationRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.GetEvaluationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvaluationRequest.verify = function verify(message) { - if (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 GetEvaluationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GetEvaluationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GetEvaluationRequest} GetEvaluationRequest - */ - GetEvaluationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GetEvaluationRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.GetEvaluationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetEvaluationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GetEvaluationRequest - * @static - * @param {google.cloud.ces.v1beta.GetEvaluationRequest} message GetEvaluationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvaluationRequest.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 GetEvaluationRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GetEvaluationRequest - * @instance - * @returns {Object.} JSON object - */ - GetEvaluationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetEvaluationRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GetEvaluationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GetEvaluationRequest"; - }; - - return GetEvaluationRequest; - })(); - - v1beta.GetEvaluationResultRequest = (function() { - - /** - * Properties of a GetEvaluationResultRequest. - * @memberof google.cloud.ces.v1beta - * @interface IGetEvaluationResultRequest - * @property {string|null} [name] GetEvaluationResultRequest name - */ - - /** - * Constructs a new GetEvaluationResultRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GetEvaluationResultRequest. - * @implements IGetEvaluationResultRequest - * @constructor - * @param {google.cloud.ces.v1beta.IGetEvaluationResultRequest=} [properties] Properties to set - */ - function GetEvaluationResultRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvaluationResultRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest - * @instance - */ - GetEvaluationResultRequest.prototype.name = ""; - - /** - * Creates a new GetEvaluationResultRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest - * @static - * @param {google.cloud.ces.v1beta.IGetEvaluationResultRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GetEvaluationResultRequest} GetEvaluationResultRequest instance - */ - GetEvaluationResultRequest.create = function create(properties) { - return new GetEvaluationResultRequest(properties); - }; - - /** - * Encodes the specified GetEvaluationResultRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationResultRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest - * @static - * @param {google.cloud.ces.v1beta.IGetEvaluationResultRequest} message GetEvaluationResultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvaluationResultRequest.encode = function encode(message, writer) { - 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 GetEvaluationResultRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationResultRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest - * @static - * @param {google.cloud.ces.v1beta.IGetEvaluationResultRequest} message GetEvaluationResultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvaluationResultRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvaluationResultRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GetEvaluationResultRequest} GetEvaluationResultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvaluationResultRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetEvaluationResultRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEvaluationResultRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GetEvaluationResultRequest} GetEvaluationResultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvaluationResultRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvaluationResultRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvaluationResultRequest.verify = function verify(message) { - if (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 GetEvaluationResultRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GetEvaluationResultRequest} GetEvaluationResultRequest - */ - GetEvaluationResultRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GetEvaluationResultRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.GetEvaluationResultRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetEvaluationResultRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest - * @static - * @param {google.cloud.ces.v1beta.GetEvaluationResultRequest} message GetEvaluationResultRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvaluationResultRequest.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 GetEvaluationResultRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest - * @instance - * @returns {Object.} JSON object - */ - GetEvaluationResultRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetEvaluationResultRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetEvaluationResultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GetEvaluationResultRequest"; - }; - - return GetEvaluationResultRequest; - })(); - - v1beta.GetEvaluationDatasetRequest = (function() { - - /** - * Properties of a GetEvaluationDatasetRequest. - * @memberof google.cloud.ces.v1beta - * @interface IGetEvaluationDatasetRequest - * @property {string|null} [name] GetEvaluationDatasetRequest name - */ - - /** - * Constructs a new GetEvaluationDatasetRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GetEvaluationDatasetRequest. - * @implements IGetEvaluationDatasetRequest - * @constructor - * @param {google.cloud.ces.v1beta.IGetEvaluationDatasetRequest=} [properties] Properties to set - */ - function GetEvaluationDatasetRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvaluationDatasetRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest - * @instance - */ - GetEvaluationDatasetRequest.prototype.name = ""; - - /** - * Creates a new GetEvaluationDatasetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest - * @static - * @param {google.cloud.ces.v1beta.IGetEvaluationDatasetRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GetEvaluationDatasetRequest} GetEvaluationDatasetRequest instance - */ - GetEvaluationDatasetRequest.create = function create(properties) { - return new GetEvaluationDatasetRequest(properties); - }; - - /** - * Encodes the specified GetEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationDatasetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest - * @static - * @param {google.cloud.ces.v1beta.IGetEvaluationDatasetRequest} message GetEvaluationDatasetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvaluationDatasetRequest.encode = function encode(message, writer) { - 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 GetEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationDatasetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest - * @static - * @param {google.cloud.ces.v1beta.IGetEvaluationDatasetRequest} message GetEvaluationDatasetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvaluationDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvaluationDatasetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GetEvaluationDatasetRequest} GetEvaluationDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvaluationDatasetRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetEvaluationDatasetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEvaluationDatasetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GetEvaluationDatasetRequest} GetEvaluationDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvaluationDatasetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvaluationDatasetRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvaluationDatasetRequest.verify = function verify(message) { - if (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 GetEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GetEvaluationDatasetRequest} GetEvaluationDatasetRequest - */ - GetEvaluationDatasetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GetEvaluationDatasetRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.GetEvaluationDatasetRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetEvaluationDatasetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest - * @static - * @param {google.cloud.ces.v1beta.GetEvaluationDatasetRequest} message GetEvaluationDatasetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvaluationDatasetRequest.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 GetEvaluationDatasetRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest - * @instance - * @returns {Object.} JSON object - */ - GetEvaluationDatasetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetEvaluationDatasetRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetEvaluationDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GetEvaluationDatasetRequest"; - }; - - return GetEvaluationDatasetRequest; - })(); - - v1beta.GetEvaluationRunRequest = (function() { - - /** - * Properties of a GetEvaluationRunRequest. - * @memberof google.cloud.ces.v1beta - * @interface IGetEvaluationRunRequest - * @property {string|null} [name] GetEvaluationRunRequest name - */ - - /** - * Constructs a new GetEvaluationRunRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GetEvaluationRunRequest. - * @implements IGetEvaluationRunRequest - * @constructor - * @param {google.cloud.ces.v1beta.IGetEvaluationRunRequest=} [properties] Properties to set - */ - function GetEvaluationRunRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvaluationRunRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest - * @instance - */ - GetEvaluationRunRequest.prototype.name = ""; - - /** - * Creates a new GetEvaluationRunRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.IGetEvaluationRunRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GetEvaluationRunRequest} GetEvaluationRunRequest instance - */ - GetEvaluationRunRequest.create = function create(properties) { - return new GetEvaluationRunRequest(properties); - }; - - /** - * Encodes the specified GetEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRunRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.IGetEvaluationRunRequest} message GetEvaluationRunRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvaluationRunRequest.encode = function encode(message, writer) { - 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 GetEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRunRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.IGetEvaluationRunRequest} message GetEvaluationRunRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvaluationRunRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvaluationRunRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GetEvaluationRunRequest} GetEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvaluationRunRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetEvaluationRunRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEvaluationRunRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GetEvaluationRunRequest} GetEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvaluationRunRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvaluationRunRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvaluationRunRequest.verify = function verify(message) { - if (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 GetEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GetEvaluationRunRequest} GetEvaluationRunRequest - */ - GetEvaluationRunRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GetEvaluationRunRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.GetEvaluationRunRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetEvaluationRunRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.GetEvaluationRunRequest} message GetEvaluationRunRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvaluationRunRequest.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 GetEvaluationRunRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest - * @instance - * @returns {Object.} JSON object - */ - GetEvaluationRunRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetEvaluationRunRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetEvaluationRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GetEvaluationRunRequest"; - }; - - return GetEvaluationRunRequest; - })(); - - v1beta.ListEvaluationsRequest = (function() { - - /** - * Properties of a ListEvaluationsRequest. - * @memberof google.cloud.ces.v1beta - * @interface IListEvaluationsRequest - * @property {string|null} [parent] ListEvaluationsRequest parent - * @property {number|null} [pageSize] ListEvaluationsRequest pageSize - * @property {string|null} [pageToken] ListEvaluationsRequest pageToken - * @property {string|null} [filter] ListEvaluationsRequest filter - * @property {string|null} [evaluationFilter] ListEvaluationsRequest evaluationFilter - * @property {string|null} [evaluationRunFilter] ListEvaluationsRequest evaluationRunFilter - * @property {string|null} [orderBy] ListEvaluationsRequest orderBy - * @property {boolean|null} [lastTenResults] ListEvaluationsRequest lastTenResults - */ - - /** - * Constructs a new ListEvaluationsRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListEvaluationsRequest. - * @implements IListEvaluationsRequest - * @constructor - * @param {google.cloud.ces.v1beta.IListEvaluationsRequest=} [properties] Properties to set - */ - function ListEvaluationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEvaluationsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest - * @instance - */ - ListEvaluationsRequest.prototype.parent = ""; - - /** - * ListEvaluationsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest - * @instance - */ - ListEvaluationsRequest.prototype.pageSize = 0; - - /** - * ListEvaluationsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest - * @instance - */ - ListEvaluationsRequest.prototype.pageToken = ""; - - /** - * ListEvaluationsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest - * @instance - */ - ListEvaluationsRequest.prototype.filter = ""; - - /** - * ListEvaluationsRequest evaluationFilter. - * @member {string} evaluationFilter - * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest - * @instance - */ - ListEvaluationsRequest.prototype.evaluationFilter = ""; - - /** - * ListEvaluationsRequest evaluationRunFilter. - * @member {string} evaluationRunFilter - * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest - * @instance - */ - ListEvaluationsRequest.prototype.evaluationRunFilter = ""; - - /** - * ListEvaluationsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest - * @instance - */ - ListEvaluationsRequest.prototype.orderBy = ""; - - /** - * ListEvaluationsRequest lastTenResults. - * @member {boolean} lastTenResults - * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest - * @instance - */ - ListEvaluationsRequest.prototype.lastTenResults = false; - - /** - * Creates a new ListEvaluationsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListEvaluationsRequest} ListEvaluationsRequest instance - */ - ListEvaluationsRequest.create = function create(properties) { - return new ListEvaluationsRequest(properties); - }; - - /** - * Encodes the specified ListEvaluationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationsRequest} message ListEvaluationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationsRequest.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.lastTenResults != null && Object.hasOwnProperty.call(message, "lastTenResults")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.lastTenResults); - if (message.evaluationFilter != null && Object.hasOwnProperty.call(message, "evaluationFilter")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.evaluationFilter); - if (message.evaluationRunFilter != null && Object.hasOwnProperty.call(message, "evaluationRunFilter")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.evaluationRunFilter); - return writer; - }; - - /** - * Encodes the specified ListEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationsRequest} message ListEvaluationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEvaluationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListEvaluationsRequest} ListEvaluationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 7: { - message.evaluationFilter = reader.string(); - break; - } - case 8: { - message.evaluationRunFilter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - case 6: { - message.lastTenResults = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListEvaluationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListEvaluationsRequest} ListEvaluationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEvaluationsRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEvaluationsRequest.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.evaluationFilter != null && message.hasOwnProperty("evaluationFilter")) - if (!$util.isString(message.evaluationFilter)) - return "evaluationFilter: string expected"; - if (message.evaluationRunFilter != null && message.hasOwnProperty("evaluationRunFilter")) - if (!$util.isString(message.evaluationRunFilter)) - return "evaluationRunFilter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.lastTenResults != null && message.hasOwnProperty("lastTenResults")) - if (typeof message.lastTenResults !== "boolean") - return "lastTenResults: boolean expected"; - return null; - }; - - /** - * Creates a ListEvaluationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListEvaluationsRequest} ListEvaluationsRequest - */ - ListEvaluationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationsRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ListEvaluationsRequest(); - 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.evaluationFilter != null) - message.evaluationFilter = String(object.evaluationFilter); - if (object.evaluationRunFilter != null) - message.evaluationRunFilter = String(object.evaluationRunFilter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.lastTenResults != null) - message.lastTenResults = Boolean(object.lastTenResults); - return message; - }; - - /** - * Creates a plain object from a ListEvaluationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest - * @static - * @param {google.cloud.ces.v1beta.ListEvaluationsRequest} message ListEvaluationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEvaluationsRequest.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.lastTenResults = false; - object.evaluationFilter = ""; - object.evaluationRunFilter = ""; - } - 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.lastTenResults != null && message.hasOwnProperty("lastTenResults")) - object.lastTenResults = message.lastTenResults; - if (message.evaluationFilter != null && message.hasOwnProperty("evaluationFilter")) - object.evaluationFilter = message.evaluationFilter; - if (message.evaluationRunFilter != null && message.hasOwnProperty("evaluationRunFilter")) - object.evaluationRunFilter = message.evaluationRunFilter; - return object; - }; - - /** - * Converts this ListEvaluationsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListEvaluationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEvaluationsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEvaluationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationsRequest"; - }; - - return ListEvaluationsRequest; - })(); - - v1beta.ListEvaluationResultsRequest = (function() { - - /** - * Properties of a ListEvaluationResultsRequest. - * @memberof google.cloud.ces.v1beta - * @interface IListEvaluationResultsRequest - * @property {string|null} [parent] ListEvaluationResultsRequest parent - * @property {number|null} [pageSize] ListEvaluationResultsRequest pageSize - * @property {string|null} [pageToken] ListEvaluationResultsRequest pageToken - * @property {string|null} [filter] ListEvaluationResultsRequest filter - * @property {string|null} [orderBy] ListEvaluationResultsRequest orderBy - */ - - /** - * Constructs a new ListEvaluationResultsRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListEvaluationResultsRequest. - * @implements IListEvaluationResultsRequest - * @constructor - * @param {google.cloud.ces.v1beta.IListEvaluationResultsRequest=} [properties] Properties to set - */ - function ListEvaluationResultsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEvaluationResultsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest - * @instance - */ - ListEvaluationResultsRequest.prototype.parent = ""; - - /** - * ListEvaluationResultsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest - * @instance - */ - ListEvaluationResultsRequest.prototype.pageSize = 0; - - /** - * ListEvaluationResultsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest - * @instance - */ - ListEvaluationResultsRequest.prototype.pageToken = ""; - - /** - * ListEvaluationResultsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest - * @instance - */ - ListEvaluationResultsRequest.prototype.filter = ""; - - /** - * ListEvaluationResultsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest - * @instance - */ - ListEvaluationResultsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListEvaluationResultsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationResultsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListEvaluationResultsRequest} ListEvaluationResultsRequest instance - */ - ListEvaluationResultsRequest.create = function create(properties) { - return new ListEvaluationResultsRequest(properties); - }; - - /** - * Encodes the specified ListEvaluationResultsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationResultsRequest} message ListEvaluationResultsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationResultsRequest.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 ListEvaluationResultsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationResultsRequest} message ListEvaluationResultsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationResultsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEvaluationResultsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListEvaluationResultsRequest} ListEvaluationResultsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationResultsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationResultsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListEvaluationResultsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListEvaluationResultsRequest} ListEvaluationResultsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationResultsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEvaluationResultsRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEvaluationResultsRequest.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 ListEvaluationResultsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListEvaluationResultsRequest} ListEvaluationResultsRequest - */ - ListEvaluationResultsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationResultsRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ListEvaluationResultsRequest(); - 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 ListEvaluationResultsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest - * @static - * @param {google.cloud.ces.v1beta.ListEvaluationResultsRequest} message ListEvaluationResultsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEvaluationResultsRequest.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 ListEvaluationResultsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest - * @instance - * @returns {Object.} JSON object - */ - ListEvaluationResultsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEvaluationResultsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEvaluationResultsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationResultsRequest"; - }; - - return ListEvaluationResultsRequest; - })(); - - v1beta.ListEvaluationDatasetsRequest = (function() { - - /** - * Properties of a ListEvaluationDatasetsRequest. - * @memberof google.cloud.ces.v1beta - * @interface IListEvaluationDatasetsRequest - * @property {string|null} [parent] ListEvaluationDatasetsRequest parent - * @property {number|null} [pageSize] ListEvaluationDatasetsRequest pageSize - * @property {string|null} [pageToken] ListEvaluationDatasetsRequest pageToken - * @property {string|null} [filter] ListEvaluationDatasetsRequest filter - * @property {string|null} [orderBy] ListEvaluationDatasetsRequest orderBy - */ - - /** - * Constructs a new ListEvaluationDatasetsRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListEvaluationDatasetsRequest. - * @implements IListEvaluationDatasetsRequest - * @constructor - * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsRequest=} [properties] Properties to set - */ - function ListEvaluationDatasetsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEvaluationDatasetsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest - * @instance - */ - ListEvaluationDatasetsRequest.prototype.parent = ""; - - /** - * ListEvaluationDatasetsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest - * @instance - */ - ListEvaluationDatasetsRequest.prototype.pageSize = 0; - - /** - * ListEvaluationDatasetsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest - * @instance - */ - ListEvaluationDatasetsRequest.prototype.pageToken = ""; - - /** - * ListEvaluationDatasetsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest - * @instance - */ - ListEvaluationDatasetsRequest.prototype.filter = ""; - - /** - * ListEvaluationDatasetsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest - * @instance - */ - ListEvaluationDatasetsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListEvaluationDatasetsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsRequest} ListEvaluationDatasetsRequest instance - */ - ListEvaluationDatasetsRequest.create = function create(properties) { - return new ListEvaluationDatasetsRequest(properties); - }; - - /** - * Encodes the specified ListEvaluationDatasetsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsRequest} message ListEvaluationDatasetsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationDatasetsRequest.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 ListEvaluationDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsRequest} message ListEvaluationDatasetsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationDatasetsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEvaluationDatasetsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsRequest} ListEvaluationDatasetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationDatasetsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListEvaluationDatasetsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsRequest} ListEvaluationDatasetsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationDatasetsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEvaluationDatasetsRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEvaluationDatasetsRequest.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 ListEvaluationDatasetsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsRequest} ListEvaluationDatasetsRequest - */ - ListEvaluationDatasetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest(); - 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 ListEvaluationDatasetsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest - * @static - * @param {google.cloud.ces.v1beta.ListEvaluationDatasetsRequest} message ListEvaluationDatasetsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEvaluationDatasetsRequest.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 ListEvaluationDatasetsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest - * @instance - * @returns {Object.} JSON object - */ - ListEvaluationDatasetsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEvaluationDatasetsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEvaluationDatasetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationDatasetsRequest"; - }; - - return ListEvaluationDatasetsRequest; - })(); - - v1beta.ListEvaluationRunsRequest = (function() { - - /** - * Properties of a ListEvaluationRunsRequest. - * @memberof google.cloud.ces.v1beta - * @interface IListEvaluationRunsRequest - * @property {string|null} [parent] ListEvaluationRunsRequest parent - * @property {number|null} [pageSize] ListEvaluationRunsRequest pageSize - * @property {string|null} [pageToken] ListEvaluationRunsRequest pageToken - * @property {string|null} [filter] ListEvaluationRunsRequest filter - * @property {string|null} [orderBy] ListEvaluationRunsRequest orderBy - */ - - /** - * Constructs a new ListEvaluationRunsRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListEvaluationRunsRequest. - * @implements IListEvaluationRunsRequest - * @constructor - * @param {google.cloud.ces.v1beta.IListEvaluationRunsRequest=} [properties] Properties to set - */ - function ListEvaluationRunsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEvaluationRunsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest - * @instance - */ - ListEvaluationRunsRequest.prototype.parent = ""; - - /** - * ListEvaluationRunsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest - * @instance - */ - ListEvaluationRunsRequest.prototype.pageSize = 0; - - /** - * ListEvaluationRunsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest - * @instance - */ - ListEvaluationRunsRequest.prototype.pageToken = ""; - - /** - * ListEvaluationRunsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest - * @instance - */ - ListEvaluationRunsRequest.prototype.filter = ""; - - /** - * ListEvaluationRunsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest - * @instance - */ - ListEvaluationRunsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListEvaluationRunsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationRunsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListEvaluationRunsRequest} ListEvaluationRunsRequest instance - */ - ListEvaluationRunsRequest.create = function create(properties) { - return new ListEvaluationRunsRequest(properties); - }; - - /** - * Encodes the specified ListEvaluationRunsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationRunsRequest} message ListEvaluationRunsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationRunsRequest.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 ListEvaluationRunsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationRunsRequest} message ListEvaluationRunsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEvaluationRunsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListEvaluationRunsRequest} ListEvaluationRunsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationRunsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationRunsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListEvaluationRunsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListEvaluationRunsRequest} ListEvaluationRunsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationRunsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEvaluationRunsRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEvaluationRunsRequest.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 ListEvaluationRunsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListEvaluationRunsRequest} ListEvaluationRunsRequest - */ - ListEvaluationRunsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationRunsRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ListEvaluationRunsRequest(); - 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 ListEvaluationRunsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest - * @static - * @param {google.cloud.ces.v1beta.ListEvaluationRunsRequest} message ListEvaluationRunsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEvaluationRunsRequest.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 ListEvaluationRunsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest - * @instance - * @returns {Object.} JSON object - */ - ListEvaluationRunsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEvaluationRunsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEvaluationRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationRunsRequest"; - }; - - return ListEvaluationRunsRequest; - })(); - - v1beta.ListEvaluationsResponse = (function() { - - /** - * Properties of a ListEvaluationsResponse. - * @memberof google.cloud.ces.v1beta - * @interface IListEvaluationsResponse - * @property {Array.|null} [evaluations] ListEvaluationsResponse evaluations - * @property {string|null} [nextPageToken] ListEvaluationsResponse nextPageToken - */ - - /** - * Constructs a new ListEvaluationsResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListEvaluationsResponse. - * @implements IListEvaluationsResponse - * @constructor - * @param {google.cloud.ces.v1beta.IListEvaluationsResponse=} [properties] Properties to set - */ - function ListEvaluationsResponse(properties) { - this.evaluations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEvaluationsResponse evaluations. - * @member {Array.} evaluations - * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse - * @instance - */ - ListEvaluationsResponse.prototype.evaluations = $util.emptyArray; - - /** - * ListEvaluationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse - * @instance - */ - ListEvaluationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListEvaluationsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListEvaluationsResponse} ListEvaluationsResponse instance - */ - ListEvaluationsResponse.create = function create(properties) { - return new ListEvaluationsResponse(properties); - }; - - /** - * Encodes the specified ListEvaluationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationsResponse} message ListEvaluationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evaluations != null && message.evaluations.length) - for (var i = 0; i < message.evaluations.length; ++i) - $root.google.cloud.ces.v1beta.Evaluation.encode(message.evaluations[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 ListEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationsResponse} message ListEvaluationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEvaluationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListEvaluationsResponse} ListEvaluationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.evaluations && message.evaluations.length)) - message.evaluations = []; - message.evaluations.push($root.google.cloud.ces.v1beta.Evaluation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListEvaluationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListEvaluationsResponse} ListEvaluationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEvaluationsResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEvaluationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evaluations != null && message.hasOwnProperty("evaluations")) { - if (!Array.isArray(message.evaluations)) - return "evaluations: array expected"; - for (var i = 0; i < message.evaluations.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Evaluation.verify(message.evaluations[i]); - if (error) - return "evaluations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListEvaluationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListEvaluationsResponse} ListEvaluationsResponse - */ - ListEvaluationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationsResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ListEvaluationsResponse(); - if (object.evaluations) { - if (!Array.isArray(object.evaluations)) - throw TypeError(".google.cloud.ces.v1beta.ListEvaluationsResponse.evaluations: array expected"); - message.evaluations = []; - for (var i = 0; i < object.evaluations.length; ++i) { - if (typeof object.evaluations[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ListEvaluationsResponse.evaluations: object expected"); - message.evaluations[i] = $root.google.cloud.ces.v1beta.Evaluation.fromObject(object.evaluations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListEvaluationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse - * @static - * @param {google.cloud.ces.v1beta.ListEvaluationsResponse} message ListEvaluationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEvaluationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.evaluations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.evaluations && message.evaluations.length) { - object.evaluations = []; - for (var j = 0; j < message.evaluations.length; ++j) - object.evaluations[j] = $root.google.cloud.ces.v1beta.Evaluation.toObject(message.evaluations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListEvaluationsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListEvaluationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEvaluationsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEvaluationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationsResponse"; - }; - - return ListEvaluationsResponse; - })(); - - v1beta.ListEvaluationResultsResponse = (function() { - - /** - * Properties of a ListEvaluationResultsResponse. - * @memberof google.cloud.ces.v1beta - * @interface IListEvaluationResultsResponse - * @property {Array.|null} [evaluationResults] ListEvaluationResultsResponse evaluationResults - * @property {string|null} [nextPageToken] ListEvaluationResultsResponse nextPageToken - */ - - /** - * Constructs a new ListEvaluationResultsResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListEvaluationResultsResponse. - * @implements IListEvaluationResultsResponse - * @constructor - * @param {google.cloud.ces.v1beta.IListEvaluationResultsResponse=} [properties] Properties to set - */ - function ListEvaluationResultsResponse(properties) { - this.evaluationResults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEvaluationResultsResponse evaluationResults. - * @member {Array.} evaluationResults - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse - * @instance - */ - ListEvaluationResultsResponse.prototype.evaluationResults = $util.emptyArray; - - /** - * ListEvaluationResultsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse - * @instance - */ - ListEvaluationResultsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListEvaluationResultsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationResultsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListEvaluationResultsResponse} ListEvaluationResultsResponse instance - */ - ListEvaluationResultsResponse.create = function create(properties) { - return new ListEvaluationResultsResponse(properties); - }; - - /** - * Encodes the specified ListEvaluationResultsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationResultsResponse} message ListEvaluationResultsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationResultsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evaluationResults != null && message.evaluationResults.length) - for (var i = 0; i < message.evaluationResults.length; ++i) - $root.google.cloud.ces.v1beta.EvaluationResult.encode(message.evaluationResults[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 ListEvaluationResultsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationResultsResponse} message ListEvaluationResultsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationResultsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEvaluationResultsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListEvaluationResultsResponse} ListEvaluationResultsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationResultsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationResultsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.evaluationResults && message.evaluationResults.length)) - message.evaluationResults = []; - message.evaluationResults.push($root.google.cloud.ces.v1beta.EvaluationResult.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListEvaluationResultsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListEvaluationResultsResponse} ListEvaluationResultsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationResultsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEvaluationResultsResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEvaluationResultsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evaluationResults != null && message.hasOwnProperty("evaluationResults")) { - if (!Array.isArray(message.evaluationResults)) - return "evaluationResults: array expected"; - for (var i = 0; i < message.evaluationResults.length; ++i) { - var error = $root.google.cloud.ces.v1beta.EvaluationResult.verify(message.evaluationResults[i]); - if (error) - return "evaluationResults." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListEvaluationResultsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListEvaluationResultsResponse} ListEvaluationResultsResponse - */ - ListEvaluationResultsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationResultsResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ListEvaluationResultsResponse(); - if (object.evaluationResults) { - if (!Array.isArray(object.evaluationResults)) - throw TypeError(".google.cloud.ces.v1beta.ListEvaluationResultsResponse.evaluationResults: array expected"); - message.evaluationResults = []; - for (var i = 0; i < object.evaluationResults.length; ++i) { - if (typeof object.evaluationResults[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ListEvaluationResultsResponse.evaluationResults: object expected"); - message.evaluationResults[i] = $root.google.cloud.ces.v1beta.EvaluationResult.fromObject(object.evaluationResults[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListEvaluationResultsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse - * @static - * @param {google.cloud.ces.v1beta.ListEvaluationResultsResponse} message ListEvaluationResultsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEvaluationResultsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.evaluationResults = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.evaluationResults && message.evaluationResults.length) { - object.evaluationResults = []; - for (var j = 0; j < message.evaluationResults.length; ++j) - object.evaluationResults[j] = $root.google.cloud.ces.v1beta.EvaluationResult.toObject(message.evaluationResults[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListEvaluationResultsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse - * @instance - * @returns {Object.} JSON object - */ - ListEvaluationResultsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEvaluationResultsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEvaluationResultsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationResultsResponse"; - }; - - return ListEvaluationResultsResponse; - })(); - - v1beta.ListEvaluationDatasetsResponse = (function() { - - /** - * Properties of a ListEvaluationDatasetsResponse. - * @memberof google.cloud.ces.v1beta - * @interface IListEvaluationDatasetsResponse - * @property {Array.|null} [evaluationDatasets] ListEvaluationDatasetsResponse evaluationDatasets - * @property {string|null} [nextPageToken] ListEvaluationDatasetsResponse nextPageToken - */ - - /** - * Constructs a new ListEvaluationDatasetsResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListEvaluationDatasetsResponse. - * @implements IListEvaluationDatasetsResponse - * @constructor - * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsResponse=} [properties] Properties to set - */ - function ListEvaluationDatasetsResponse(properties) { - this.evaluationDatasets = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEvaluationDatasetsResponse evaluationDatasets. - * @member {Array.} evaluationDatasets - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse - * @instance - */ - ListEvaluationDatasetsResponse.prototype.evaluationDatasets = $util.emptyArray; - - /** - * ListEvaluationDatasetsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse - * @instance - */ - ListEvaluationDatasetsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListEvaluationDatasetsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsResponse} ListEvaluationDatasetsResponse instance - */ - ListEvaluationDatasetsResponse.create = function create(properties) { - return new ListEvaluationDatasetsResponse(properties); - }; - - /** - * Encodes the specified ListEvaluationDatasetsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsResponse} message ListEvaluationDatasetsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationDatasetsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evaluationDatasets != null && message.evaluationDatasets.length) - for (var i = 0; i < message.evaluationDatasets.length; ++i) - $root.google.cloud.ces.v1beta.EvaluationDataset.encode(message.evaluationDatasets[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 ListEvaluationDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsResponse} message ListEvaluationDatasetsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationDatasetsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEvaluationDatasetsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsResponse} ListEvaluationDatasetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationDatasetsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationDatasetsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.evaluationDatasets && message.evaluationDatasets.length)) - message.evaluationDatasets = []; - message.evaluationDatasets.push($root.google.cloud.ces.v1beta.EvaluationDataset.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListEvaluationDatasetsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsResponse} ListEvaluationDatasetsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationDatasetsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEvaluationDatasetsResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEvaluationDatasetsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evaluationDatasets != null && message.hasOwnProperty("evaluationDatasets")) { - if (!Array.isArray(message.evaluationDatasets)) - return "evaluationDatasets: array expected"; - for (var i = 0; i < message.evaluationDatasets.length; ++i) { - var error = $root.google.cloud.ces.v1beta.EvaluationDataset.verify(message.evaluationDatasets[i]); - if (error) - return "evaluationDatasets." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListEvaluationDatasetsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsResponse} ListEvaluationDatasetsResponse - */ - ListEvaluationDatasetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationDatasetsResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ListEvaluationDatasetsResponse(); - if (object.evaluationDatasets) { - if (!Array.isArray(object.evaluationDatasets)) - throw TypeError(".google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.evaluationDatasets: array expected"); - message.evaluationDatasets = []; - for (var i = 0; i < object.evaluationDatasets.length; ++i) { - if (typeof object.evaluationDatasets[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.evaluationDatasets: object expected"); - message.evaluationDatasets[i] = $root.google.cloud.ces.v1beta.EvaluationDataset.fromObject(object.evaluationDatasets[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListEvaluationDatasetsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse - * @static - * @param {google.cloud.ces.v1beta.ListEvaluationDatasetsResponse} message ListEvaluationDatasetsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEvaluationDatasetsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.evaluationDatasets = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.evaluationDatasets && message.evaluationDatasets.length) { - object.evaluationDatasets = []; - for (var j = 0; j < message.evaluationDatasets.length; ++j) - object.evaluationDatasets[j] = $root.google.cloud.ces.v1beta.EvaluationDataset.toObject(message.evaluationDatasets[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListEvaluationDatasetsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse - * @instance - * @returns {Object.} JSON object - */ - ListEvaluationDatasetsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEvaluationDatasetsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEvaluationDatasetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationDatasetsResponse"; - }; - - return ListEvaluationDatasetsResponse; - })(); - - v1beta.ListEvaluationRunsResponse = (function() { - - /** - * Properties of a ListEvaluationRunsResponse. - * @memberof google.cloud.ces.v1beta - * @interface IListEvaluationRunsResponse - * @property {Array.|null} [evaluationRuns] ListEvaluationRunsResponse evaluationRuns - * @property {string|null} [nextPageToken] ListEvaluationRunsResponse nextPageToken - */ - - /** - * Constructs a new ListEvaluationRunsResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListEvaluationRunsResponse. - * @implements IListEvaluationRunsResponse - * @constructor - * @param {google.cloud.ces.v1beta.IListEvaluationRunsResponse=} [properties] Properties to set - */ - function ListEvaluationRunsResponse(properties) { - this.evaluationRuns = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEvaluationRunsResponse evaluationRuns. - * @member {Array.} evaluationRuns - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse - * @instance - */ - ListEvaluationRunsResponse.prototype.evaluationRuns = $util.emptyArray; - - /** - * ListEvaluationRunsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse - * @instance - */ - ListEvaluationRunsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListEvaluationRunsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationRunsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListEvaluationRunsResponse} ListEvaluationRunsResponse instance - */ - ListEvaluationRunsResponse.create = function create(properties) { - return new ListEvaluationRunsResponse(properties); - }; - - /** - * Encodes the specified ListEvaluationRunsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationRunsResponse} message ListEvaluationRunsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationRunsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evaluationRuns != null && message.evaluationRuns.length) - for (var i = 0; i < message.evaluationRuns.length; ++i) - $root.google.cloud.ces.v1beta.EvaluationRun.encode(message.evaluationRuns[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 ListEvaluationRunsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationRunsResponse} message ListEvaluationRunsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEvaluationRunsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListEvaluationRunsResponse} ListEvaluationRunsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationRunsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationRunsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.evaluationRuns && message.evaluationRuns.length)) - message.evaluationRuns = []; - message.evaluationRuns.push($root.google.cloud.ces.v1beta.EvaluationRun.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListEvaluationRunsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListEvaluationRunsResponse} ListEvaluationRunsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationRunsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEvaluationRunsResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEvaluationRunsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evaluationRuns != null && message.hasOwnProperty("evaluationRuns")) { - if (!Array.isArray(message.evaluationRuns)) - return "evaluationRuns: array expected"; - for (var i = 0; i < message.evaluationRuns.length; ++i) { - var error = $root.google.cloud.ces.v1beta.EvaluationRun.verify(message.evaluationRuns[i]); - if (error) - return "evaluationRuns." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListEvaluationRunsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListEvaluationRunsResponse} ListEvaluationRunsResponse - */ - ListEvaluationRunsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationRunsResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ListEvaluationRunsResponse(); - if (object.evaluationRuns) { - if (!Array.isArray(object.evaluationRuns)) - throw TypeError(".google.cloud.ces.v1beta.ListEvaluationRunsResponse.evaluationRuns: array expected"); - message.evaluationRuns = []; - for (var i = 0; i < object.evaluationRuns.length; ++i) { - if (typeof object.evaluationRuns[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ListEvaluationRunsResponse.evaluationRuns: object expected"); - message.evaluationRuns[i] = $root.google.cloud.ces.v1beta.EvaluationRun.fromObject(object.evaluationRuns[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListEvaluationRunsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse - * @static - * @param {google.cloud.ces.v1beta.ListEvaluationRunsResponse} message ListEvaluationRunsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEvaluationRunsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.evaluationRuns = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.evaluationRuns && message.evaluationRuns.length) { - object.evaluationRuns = []; - for (var j = 0; j < message.evaluationRuns.length; ++j) - object.evaluationRuns[j] = $root.google.cloud.ces.v1beta.EvaluationRun.toObject(message.evaluationRuns[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListEvaluationRunsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse - * @instance - * @returns {Object.} JSON object - */ - ListEvaluationRunsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEvaluationRunsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEvaluationRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationRunsResponse"; - }; - - return ListEvaluationRunsResponse; - })(); - - v1beta.CreateScheduledEvaluationRunRequest = (function() { - - /** - * Properties of a CreateScheduledEvaluationRunRequest. - * @memberof google.cloud.ces.v1beta - * @interface ICreateScheduledEvaluationRunRequest - * @property {string|null} [parent] CreateScheduledEvaluationRunRequest parent - * @property {string|null} [scheduledEvaluationRunId] CreateScheduledEvaluationRunRequest scheduledEvaluationRunId - * @property {google.cloud.ces.v1beta.IScheduledEvaluationRun|null} [scheduledEvaluationRun] CreateScheduledEvaluationRunRequest scheduledEvaluationRun - */ - - /** - * Constructs a new CreateScheduledEvaluationRunRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a CreateScheduledEvaluationRunRequest. - * @implements ICreateScheduledEvaluationRunRequest - * @constructor - * @param {google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest=} [properties] Properties to set - */ - function CreateScheduledEvaluationRunRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateScheduledEvaluationRunRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest - * @instance - */ - CreateScheduledEvaluationRunRequest.prototype.parent = ""; - - /** - * CreateScheduledEvaluationRunRequest scheduledEvaluationRunId. - * @member {string} scheduledEvaluationRunId - * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest - * @instance - */ - CreateScheduledEvaluationRunRequest.prototype.scheduledEvaluationRunId = ""; - - /** - * CreateScheduledEvaluationRunRequest scheduledEvaluationRun. - * @member {google.cloud.ces.v1beta.IScheduledEvaluationRun|null|undefined} scheduledEvaluationRun - * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest - * @instance - */ - CreateScheduledEvaluationRunRequest.prototype.scheduledEvaluationRun = null; - - /** - * Creates a new CreateScheduledEvaluationRunRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest} CreateScheduledEvaluationRunRequest instance - */ - CreateScheduledEvaluationRunRequest.create = function create(properties) { - return new CreateScheduledEvaluationRunRequest(properties); - }; - - /** - * Encodes the specified CreateScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest} message CreateScheduledEvaluationRunRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateScheduledEvaluationRunRequest.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.scheduledEvaluationRunId != null && Object.hasOwnProperty.call(message, "scheduledEvaluationRunId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.scheduledEvaluationRunId); - if (message.scheduledEvaluationRun != null && Object.hasOwnProperty.call(message, "scheduledEvaluationRun")) - $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.encode(message.scheduledEvaluationRun, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest} message CreateScheduledEvaluationRunRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateScheduledEvaluationRunRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateScheduledEvaluationRunRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest} CreateScheduledEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateScheduledEvaluationRunRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.scheduledEvaluationRunId = reader.string(); - break; - } - case 3: { - message.scheduledEvaluationRun = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest} CreateScheduledEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateScheduledEvaluationRunRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateScheduledEvaluationRunRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateScheduledEvaluationRunRequest.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.scheduledEvaluationRunId != null && message.hasOwnProperty("scheduledEvaluationRunId")) - if (!$util.isString(message.scheduledEvaluationRunId)) - return "scheduledEvaluationRunId: string expected"; - if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) { - var error = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.verify(message.scheduledEvaluationRun); - if (error) - return "scheduledEvaluationRun." + error; - } - return null; - }; - - /** - * Creates a CreateScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest} CreateScheduledEvaluationRunRequest - */ - CreateScheduledEvaluationRunRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.scheduledEvaluationRunId != null) - message.scheduledEvaluationRunId = String(object.scheduledEvaluationRunId); - if (object.scheduledEvaluationRun != null) { - if (typeof object.scheduledEvaluationRun !== "object") - throw TypeError(".google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest.scheduledEvaluationRun: object expected"); - message.scheduledEvaluationRun = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.fromObject(object.scheduledEvaluationRun); - } - return message; - }; - - /** - * Creates a plain object from a CreateScheduledEvaluationRunRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest} message CreateScheduledEvaluationRunRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateScheduledEvaluationRunRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.scheduledEvaluationRunId = ""; - object.scheduledEvaluationRun = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.scheduledEvaluationRunId != null && message.hasOwnProperty("scheduledEvaluationRunId")) - object.scheduledEvaluationRunId = message.scheduledEvaluationRunId; - if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) - object.scheduledEvaluationRun = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.toObject(message.scheduledEvaluationRun, options); - return object; - }; - - /** - * Converts this CreateScheduledEvaluationRunRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest - * @instance - * @returns {Object.} JSON object - */ - CreateScheduledEvaluationRunRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateScheduledEvaluationRunRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateScheduledEvaluationRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest"; - }; - - return CreateScheduledEvaluationRunRequest; - })(); - - v1beta.GetScheduledEvaluationRunRequest = (function() { - - /** - * Properties of a GetScheduledEvaluationRunRequest. - * @memberof google.cloud.ces.v1beta - * @interface IGetScheduledEvaluationRunRequest - * @property {string|null} [name] GetScheduledEvaluationRunRequest name - */ - - /** - * Constructs a new GetScheduledEvaluationRunRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GetScheduledEvaluationRunRequest. - * @implements IGetScheduledEvaluationRunRequest - * @constructor - * @param {google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest=} [properties] Properties to set - */ - function GetScheduledEvaluationRunRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetScheduledEvaluationRunRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest - * @instance - */ - GetScheduledEvaluationRunRequest.prototype.name = ""; - - /** - * Creates a new GetScheduledEvaluationRunRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest} GetScheduledEvaluationRunRequest instance - */ - GetScheduledEvaluationRunRequest.create = function create(properties) { - return new GetScheduledEvaluationRunRequest(properties); - }; - - /** - * Encodes the specified GetScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest} message GetScheduledEvaluationRunRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetScheduledEvaluationRunRequest.encode = function encode(message, writer) { - 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 GetScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest} message GetScheduledEvaluationRunRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetScheduledEvaluationRunRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetScheduledEvaluationRunRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest} GetScheduledEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetScheduledEvaluationRunRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest} GetScheduledEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetScheduledEvaluationRunRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetScheduledEvaluationRunRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetScheduledEvaluationRunRequest.verify = function verify(message) { - if (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 GetScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest} GetScheduledEvaluationRunRequest - */ - GetScheduledEvaluationRunRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetScheduledEvaluationRunRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest} message GetScheduledEvaluationRunRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetScheduledEvaluationRunRequest.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 GetScheduledEvaluationRunRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest - * @instance - * @returns {Object.} JSON object - */ - GetScheduledEvaluationRunRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetScheduledEvaluationRunRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetScheduledEvaluationRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest"; - }; - - return GetScheduledEvaluationRunRequest; - })(); - - v1beta.ListScheduledEvaluationRunsRequest = (function() { - - /** - * Properties of a ListScheduledEvaluationRunsRequest. - * @memberof google.cloud.ces.v1beta - * @interface IListScheduledEvaluationRunsRequest - * @property {string|null} [parent] ListScheduledEvaluationRunsRequest parent - * @property {number|null} [pageSize] ListScheduledEvaluationRunsRequest pageSize - * @property {string|null} [pageToken] ListScheduledEvaluationRunsRequest pageToken - * @property {string|null} [filter] ListScheduledEvaluationRunsRequest filter - * @property {string|null} [orderBy] ListScheduledEvaluationRunsRequest orderBy - */ - - /** - * Constructs a new ListScheduledEvaluationRunsRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListScheduledEvaluationRunsRequest. - * @implements IListScheduledEvaluationRunsRequest - * @constructor - * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest=} [properties] Properties to set - */ - function ListScheduledEvaluationRunsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListScheduledEvaluationRunsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest - * @instance - */ - ListScheduledEvaluationRunsRequest.prototype.parent = ""; - - /** - * ListScheduledEvaluationRunsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest - * @instance - */ - ListScheduledEvaluationRunsRequest.prototype.pageSize = 0; - - /** - * ListScheduledEvaluationRunsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest - * @instance - */ - ListScheduledEvaluationRunsRequest.prototype.pageToken = ""; - - /** - * ListScheduledEvaluationRunsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest - * @instance - */ - ListScheduledEvaluationRunsRequest.prototype.filter = ""; - - /** - * ListScheduledEvaluationRunsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest - * @instance - */ - ListScheduledEvaluationRunsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListScheduledEvaluationRunsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest - * @static - * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest} ListScheduledEvaluationRunsRequest instance - */ - ListScheduledEvaluationRunsRequest.create = function create(properties) { - return new ListScheduledEvaluationRunsRequest(properties); - }; - - /** - * Encodes the specified ListScheduledEvaluationRunsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest - * @static - * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest} message ListScheduledEvaluationRunsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListScheduledEvaluationRunsRequest.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 ListScheduledEvaluationRunsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest - * @static - * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest} message ListScheduledEvaluationRunsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListScheduledEvaluationRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListScheduledEvaluationRunsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest} ListScheduledEvaluationRunsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListScheduledEvaluationRunsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListScheduledEvaluationRunsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest} ListScheduledEvaluationRunsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListScheduledEvaluationRunsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListScheduledEvaluationRunsRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListScheduledEvaluationRunsRequest.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 ListScheduledEvaluationRunsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest} ListScheduledEvaluationRunsRequest - */ - ListScheduledEvaluationRunsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest(); - 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 ListScheduledEvaluationRunsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest - * @static - * @param {google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest} message ListScheduledEvaluationRunsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListScheduledEvaluationRunsRequest.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 ListScheduledEvaluationRunsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest - * @instance - * @returns {Object.} JSON object - */ - ListScheduledEvaluationRunsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListScheduledEvaluationRunsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListScheduledEvaluationRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest"; - }; - - return ListScheduledEvaluationRunsRequest; - })(); - - v1beta.ListScheduledEvaluationRunsResponse = (function() { - - /** - * Properties of a ListScheduledEvaluationRunsResponse. - * @memberof google.cloud.ces.v1beta - * @interface IListScheduledEvaluationRunsResponse - * @property {Array.|null} [scheduledEvaluationRuns] ListScheduledEvaluationRunsResponse scheduledEvaluationRuns - * @property {string|null} [nextPageToken] ListScheduledEvaluationRunsResponse nextPageToken - */ - - /** - * Constructs a new ListScheduledEvaluationRunsResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListScheduledEvaluationRunsResponse. - * @implements IListScheduledEvaluationRunsResponse - * @constructor - * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse=} [properties] Properties to set - */ - function ListScheduledEvaluationRunsResponse(properties) { - this.scheduledEvaluationRuns = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListScheduledEvaluationRunsResponse scheduledEvaluationRuns. - * @member {Array.} scheduledEvaluationRuns - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse - * @instance - */ - ListScheduledEvaluationRunsResponse.prototype.scheduledEvaluationRuns = $util.emptyArray; - - /** - * ListScheduledEvaluationRunsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse - * @instance - */ - ListScheduledEvaluationRunsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListScheduledEvaluationRunsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse - * @static - * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse} ListScheduledEvaluationRunsResponse instance - */ - ListScheduledEvaluationRunsResponse.create = function create(properties) { - return new ListScheduledEvaluationRunsResponse(properties); - }; - - /** - * Encodes the specified ListScheduledEvaluationRunsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse - * @static - * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse} message ListScheduledEvaluationRunsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListScheduledEvaluationRunsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.scheduledEvaluationRuns != null && message.scheduledEvaluationRuns.length) - for (var i = 0; i < message.scheduledEvaluationRuns.length; ++i) - $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.encode(message.scheduledEvaluationRuns[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 ListScheduledEvaluationRunsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse - * @static - * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse} message ListScheduledEvaluationRunsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListScheduledEvaluationRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListScheduledEvaluationRunsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse} ListScheduledEvaluationRunsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListScheduledEvaluationRunsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.scheduledEvaluationRuns && message.scheduledEvaluationRuns.length)) - message.scheduledEvaluationRuns = []; - message.scheduledEvaluationRuns.push($root.google.cloud.ces.v1beta.ScheduledEvaluationRun.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListScheduledEvaluationRunsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse} ListScheduledEvaluationRunsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListScheduledEvaluationRunsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListScheduledEvaluationRunsResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListScheduledEvaluationRunsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.scheduledEvaluationRuns != null && message.hasOwnProperty("scheduledEvaluationRuns")) { - if (!Array.isArray(message.scheduledEvaluationRuns)) - return "scheduledEvaluationRuns: array expected"; - for (var i = 0; i < message.scheduledEvaluationRuns.length; ++i) { - var error = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.verify(message.scheduledEvaluationRuns[i]); - if (error) - return "scheduledEvaluationRuns." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListScheduledEvaluationRunsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse} ListScheduledEvaluationRunsResponse - */ - ListScheduledEvaluationRunsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse(); - if (object.scheduledEvaluationRuns) { - if (!Array.isArray(object.scheduledEvaluationRuns)) - throw TypeError(".google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.scheduledEvaluationRuns: array expected"); - message.scheduledEvaluationRuns = []; - for (var i = 0; i < object.scheduledEvaluationRuns.length; ++i) { - if (typeof object.scheduledEvaluationRuns[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.scheduledEvaluationRuns: object expected"); - message.scheduledEvaluationRuns[i] = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.fromObject(object.scheduledEvaluationRuns[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListScheduledEvaluationRunsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse - * @static - * @param {google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse} message ListScheduledEvaluationRunsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListScheduledEvaluationRunsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.scheduledEvaluationRuns = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.scheduledEvaluationRuns && message.scheduledEvaluationRuns.length) { - object.scheduledEvaluationRuns = []; - for (var j = 0; j < message.scheduledEvaluationRuns.length; ++j) - object.scheduledEvaluationRuns[j] = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.toObject(message.scheduledEvaluationRuns[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListScheduledEvaluationRunsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse - * @instance - * @returns {Object.} JSON object - */ - ListScheduledEvaluationRunsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListScheduledEvaluationRunsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListScheduledEvaluationRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse"; - }; - - return ListScheduledEvaluationRunsResponse; - })(); - - v1beta.UpdateScheduledEvaluationRunRequest = (function() { - - /** - * Properties of an UpdateScheduledEvaluationRunRequest. - * @memberof google.cloud.ces.v1beta - * @interface IUpdateScheduledEvaluationRunRequest - * @property {google.cloud.ces.v1beta.IScheduledEvaluationRun|null} [scheduledEvaluationRun] UpdateScheduledEvaluationRunRequest scheduledEvaluationRun - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateScheduledEvaluationRunRequest updateMask - */ - - /** - * Constructs a new UpdateScheduledEvaluationRunRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an UpdateScheduledEvaluationRunRequest. - * @implements IUpdateScheduledEvaluationRunRequest - * @constructor - * @param {google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest=} [properties] Properties to set - */ - function UpdateScheduledEvaluationRunRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateScheduledEvaluationRunRequest scheduledEvaluationRun. - * @member {google.cloud.ces.v1beta.IScheduledEvaluationRun|null|undefined} scheduledEvaluationRun - * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest - * @instance - */ - UpdateScheduledEvaluationRunRequest.prototype.scheduledEvaluationRun = null; - - /** - * UpdateScheduledEvaluationRunRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest - * @instance - */ - UpdateScheduledEvaluationRunRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateScheduledEvaluationRunRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest} UpdateScheduledEvaluationRunRequest instance - */ - UpdateScheduledEvaluationRunRequest.create = function create(properties) { - return new UpdateScheduledEvaluationRunRequest(properties); - }; - - /** - * Encodes the specified UpdateScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest} message UpdateScheduledEvaluationRunRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateScheduledEvaluationRunRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.scheduledEvaluationRun != null && Object.hasOwnProperty.call(message, "scheduledEvaluationRun")) - $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.encode(message.scheduledEvaluationRun, 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 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest} message UpdateScheduledEvaluationRunRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateScheduledEvaluationRunRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateScheduledEvaluationRunRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest} UpdateScheduledEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateScheduledEvaluationRunRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.scheduledEvaluationRun = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest} UpdateScheduledEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateScheduledEvaluationRunRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateScheduledEvaluationRunRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateScheduledEvaluationRunRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) { - var error = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.verify(message.scheduledEvaluationRun); - if (error) - return "scheduledEvaluationRun." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest} UpdateScheduledEvaluationRunRequest - */ - UpdateScheduledEvaluationRunRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest(); - if (object.scheduledEvaluationRun != null) { - if (typeof object.scheduledEvaluationRun !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest.scheduledEvaluationRun: object expected"); - message.scheduledEvaluationRun = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.fromObject(object.scheduledEvaluationRun); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateScheduledEvaluationRunRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest} message UpdateScheduledEvaluationRunRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateScheduledEvaluationRunRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.scheduledEvaluationRun = null; - object.updateMask = null; - } - if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) - object.scheduledEvaluationRun = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.toObject(message.scheduledEvaluationRun, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateScheduledEvaluationRunRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateScheduledEvaluationRunRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateScheduledEvaluationRunRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateScheduledEvaluationRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest"; - }; - - return UpdateScheduledEvaluationRunRequest; - })(); - - v1beta.DeleteScheduledEvaluationRunRequest = (function() { - - /** - * Properties of a DeleteScheduledEvaluationRunRequest. - * @memberof google.cloud.ces.v1beta - * @interface IDeleteScheduledEvaluationRunRequest - * @property {string|null} [name] DeleteScheduledEvaluationRunRequest name - * @property {string|null} [etag] DeleteScheduledEvaluationRunRequest etag - */ - - /** - * Constructs a new DeleteScheduledEvaluationRunRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DeleteScheduledEvaluationRunRequest. - * @implements IDeleteScheduledEvaluationRunRequest - * @constructor - * @param {google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest=} [properties] Properties to set - */ - function DeleteScheduledEvaluationRunRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteScheduledEvaluationRunRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest - * @instance - */ - DeleteScheduledEvaluationRunRequest.prototype.name = ""; - - /** - * DeleteScheduledEvaluationRunRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest - * @instance - */ - DeleteScheduledEvaluationRunRequest.prototype.etag = ""; - - /** - * Creates a new DeleteScheduledEvaluationRunRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest} DeleteScheduledEvaluationRunRequest instance - */ - DeleteScheduledEvaluationRunRequest.create = function create(properties) { - return new DeleteScheduledEvaluationRunRequest(properties); - }; - - /** - * Encodes the specified DeleteScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest} message DeleteScheduledEvaluationRunRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteScheduledEvaluationRunRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest} message DeleteScheduledEvaluationRunRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteScheduledEvaluationRunRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteScheduledEvaluationRunRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest} DeleteScheduledEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteScheduledEvaluationRunRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest} DeleteScheduledEvaluationRunRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteScheduledEvaluationRunRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteScheduledEvaluationRunRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteScheduledEvaluationRunRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest} DeleteScheduledEvaluationRunRequest - */ - DeleteScheduledEvaluationRunRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteScheduledEvaluationRunRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest - * @static - * @param {google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest} message DeleteScheduledEvaluationRunRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteScheduledEvaluationRunRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteScheduledEvaluationRunRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteScheduledEvaluationRunRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteScheduledEvaluationRunRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteScheduledEvaluationRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest"; - }; - - return DeleteScheduledEvaluationRunRequest; - })(); - - v1beta.TestPersonaVoiceRequest = (function() { - - /** - * Properties of a TestPersonaVoiceRequest. - * @memberof google.cloud.ces.v1beta - * @interface ITestPersonaVoiceRequest - * @property {string|null} [app] TestPersonaVoiceRequest app - * @property {string|null} [personaId] TestPersonaVoiceRequest personaId - * @property {string|null} [text] TestPersonaVoiceRequest text - */ - - /** - * Constructs a new TestPersonaVoiceRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a TestPersonaVoiceRequest. - * @implements ITestPersonaVoiceRequest - * @constructor - * @param {google.cloud.ces.v1beta.ITestPersonaVoiceRequest=} [properties] Properties to set - */ - function TestPersonaVoiceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TestPersonaVoiceRequest app. - * @member {string} app - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest - * @instance - */ - TestPersonaVoiceRequest.prototype.app = ""; - - /** - * TestPersonaVoiceRequest personaId. - * @member {string} personaId - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest - * @instance - */ - TestPersonaVoiceRequest.prototype.personaId = ""; - - /** - * TestPersonaVoiceRequest text. - * @member {string} text - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest - * @instance - */ - TestPersonaVoiceRequest.prototype.text = ""; - - /** - * Creates a new TestPersonaVoiceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest - * @static - * @param {google.cloud.ces.v1beta.ITestPersonaVoiceRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.TestPersonaVoiceRequest} TestPersonaVoiceRequest instance - */ - TestPersonaVoiceRequest.create = function create(properties) { - return new TestPersonaVoiceRequest(properties); - }; - - /** - * Encodes the specified TestPersonaVoiceRequest message. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest - * @static - * @param {google.cloud.ces.v1beta.ITestPersonaVoiceRequest} message TestPersonaVoiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestPersonaVoiceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.app != null && Object.hasOwnProperty.call(message, "app")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.app); - if (message.personaId != null && Object.hasOwnProperty.call(message, "personaId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.personaId); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.text); - return writer; - }; - - /** - * Encodes the specified TestPersonaVoiceRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest - * @static - * @param {google.cloud.ces.v1beta.ITestPersonaVoiceRequest} message TestPersonaVoiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestPersonaVoiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TestPersonaVoiceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.TestPersonaVoiceRequest} TestPersonaVoiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestPersonaVoiceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TestPersonaVoiceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.app = reader.string(); - break; - } - case 2: { - message.personaId = reader.string(); - break; - } - case 3: { - message.text = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TestPersonaVoiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.TestPersonaVoiceRequest} TestPersonaVoiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestPersonaVoiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TestPersonaVoiceRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TestPersonaVoiceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.app != null && message.hasOwnProperty("app")) - if (!$util.isString(message.app)) - return "app: string expected"; - if (message.personaId != null && message.hasOwnProperty("personaId")) - if (!$util.isString(message.personaId)) - return "personaId: string expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - return null; - }; - - /** - * Creates a TestPersonaVoiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.TestPersonaVoiceRequest} TestPersonaVoiceRequest - */ - TestPersonaVoiceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.TestPersonaVoiceRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.TestPersonaVoiceRequest(); - if (object.app != null) - message.app = String(object.app); - if (object.personaId != null) - message.personaId = String(object.personaId); - if (object.text != null) - message.text = String(object.text); - return message; - }; - - /** - * Creates a plain object from a TestPersonaVoiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest - * @static - * @param {google.cloud.ces.v1beta.TestPersonaVoiceRequest} message TestPersonaVoiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TestPersonaVoiceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.app = ""; - object.personaId = ""; - object.text = ""; - } - if (message.app != null && message.hasOwnProperty("app")) - object.app = message.app; - if (message.personaId != null && message.hasOwnProperty("personaId")) - object.personaId = message.personaId; - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - return object; - }; - - /** - * Converts this TestPersonaVoiceRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest - * @instance - * @returns {Object.} JSON object - */ - TestPersonaVoiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TestPersonaVoiceRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TestPersonaVoiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.TestPersonaVoiceRequest"; - }; - - return TestPersonaVoiceRequest; - })(); - - v1beta.UploadEvaluationAudioRequest = (function() { - - /** - * Properties of an UploadEvaluationAudioRequest. - * @memberof google.cloud.ces.v1beta - * @interface IUploadEvaluationAudioRequest - * @property {string|null} [app] UploadEvaluationAudioRequest app - * @property {Uint8Array|null} [audioContent] UploadEvaluationAudioRequest audioContent - */ - - /** - * Constructs a new UploadEvaluationAudioRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an UploadEvaluationAudioRequest. - * @implements IUploadEvaluationAudioRequest - * @constructor - * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioRequest=} [properties] Properties to set - */ - function UploadEvaluationAudioRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UploadEvaluationAudioRequest app. - * @member {string} app - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest - * @instance - */ - UploadEvaluationAudioRequest.prototype.app = ""; - - /** - * UploadEvaluationAudioRequest audioContent. - * @member {Uint8Array} audioContent - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest - * @instance - */ - UploadEvaluationAudioRequest.prototype.audioContent = $util.newBuffer([]); - - /** - * Creates a new UploadEvaluationAudioRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest - * @static - * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioRequest} UploadEvaluationAudioRequest instance - */ - UploadEvaluationAudioRequest.create = function create(properties) { - return new UploadEvaluationAudioRequest(properties); - }; - - /** - * Encodes the specified UploadEvaluationAudioRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest - * @static - * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioRequest} message UploadEvaluationAudioRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UploadEvaluationAudioRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.app != null && Object.hasOwnProperty.call(message, "app")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.app); - if (message.audioContent != null && Object.hasOwnProperty.call(message, "audioContent")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audioContent); - return writer; - }; - - /** - * Encodes the specified UploadEvaluationAudioRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest - * @static - * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioRequest} message UploadEvaluationAudioRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UploadEvaluationAudioRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UploadEvaluationAudioRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioRequest} UploadEvaluationAudioRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UploadEvaluationAudioRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UploadEvaluationAudioRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.app = reader.string(); - break; - } - case 2: { - message.audioContent = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UploadEvaluationAudioRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioRequest} UploadEvaluationAudioRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UploadEvaluationAudioRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UploadEvaluationAudioRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UploadEvaluationAudioRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.app != null && message.hasOwnProperty("app")) - if (!$util.isString(message.app)) - return "app: string expected"; - if (message.audioContent != null && message.hasOwnProperty("audioContent")) - if (!(message.audioContent && typeof message.audioContent.length === "number" || $util.isString(message.audioContent))) - return "audioContent: buffer expected"; - return null; - }; - - /** - * Creates an UploadEvaluationAudioRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioRequest} UploadEvaluationAudioRequest - */ - UploadEvaluationAudioRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.UploadEvaluationAudioRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.UploadEvaluationAudioRequest(); - if (object.app != null) - message.app = String(object.app); - if (object.audioContent != null) - if (typeof object.audioContent === "string") - $util.base64.decode(object.audioContent, message.audioContent = $util.newBuffer($util.base64.length(object.audioContent)), 0); - else if (object.audioContent.length >= 0) - message.audioContent = object.audioContent; - return message; - }; - - /** - * Creates a plain object from an UploadEvaluationAudioRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest - * @static - * @param {google.cloud.ces.v1beta.UploadEvaluationAudioRequest} message UploadEvaluationAudioRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UploadEvaluationAudioRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.app = ""; - if (options.bytes === String) - object.audioContent = ""; - else { - object.audioContent = []; - if (options.bytes !== Array) - object.audioContent = $util.newBuffer(object.audioContent); - } - } - if (message.app != null && message.hasOwnProperty("app")) - object.app = message.app; - if (message.audioContent != null && message.hasOwnProperty("audioContent")) - object.audioContent = options.bytes === String ? $util.base64.encode(message.audioContent, 0, message.audioContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.audioContent) : message.audioContent; - return object; - }; - - /** - * Converts this UploadEvaluationAudioRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest - * @instance - * @returns {Object.} JSON object - */ - UploadEvaluationAudioRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UploadEvaluationAudioRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UploadEvaluationAudioRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.UploadEvaluationAudioRequest"; - }; - - return UploadEvaluationAudioRequest; - })(); - - v1beta.UploadEvaluationAudioResponse = (function() { - - /** - * Properties of an UploadEvaluationAudioResponse. - * @memberof google.cloud.ces.v1beta - * @interface IUploadEvaluationAudioResponse - * @property {string|null} [audioGcsUri] UploadEvaluationAudioResponse audioGcsUri - * @property {string|null} [audioTranscript] UploadEvaluationAudioResponse audioTranscript - * @property {google.protobuf.IDuration|null} [audioDuration] UploadEvaluationAudioResponse audioDuration - */ - - /** - * Constructs a new UploadEvaluationAudioResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an UploadEvaluationAudioResponse. - * @implements IUploadEvaluationAudioResponse - * @constructor - * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioResponse=} [properties] Properties to set - */ - function UploadEvaluationAudioResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UploadEvaluationAudioResponse audioGcsUri. - * @member {string} audioGcsUri - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse - * @instance - */ - UploadEvaluationAudioResponse.prototype.audioGcsUri = ""; - - /** - * UploadEvaluationAudioResponse audioTranscript. - * @member {string} audioTranscript - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse - * @instance - */ - UploadEvaluationAudioResponse.prototype.audioTranscript = ""; - - /** - * UploadEvaluationAudioResponse audioDuration. - * @member {google.protobuf.IDuration|null|undefined} audioDuration - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse - * @instance - */ - UploadEvaluationAudioResponse.prototype.audioDuration = null; - - /** - * Creates a new UploadEvaluationAudioResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse - * @static - * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioResponse} UploadEvaluationAudioResponse instance - */ - UploadEvaluationAudioResponse.create = function create(properties) { - return new UploadEvaluationAudioResponse(properties); - }; - - /** - * Encodes the specified UploadEvaluationAudioResponse message. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse - * @static - * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioResponse} message UploadEvaluationAudioResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UploadEvaluationAudioResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.audioGcsUri != null && Object.hasOwnProperty.call(message, "audioGcsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.audioGcsUri); - if (message.audioTranscript != null && Object.hasOwnProperty.call(message, "audioTranscript")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.audioTranscript); - if (message.audioDuration != null && Object.hasOwnProperty.call(message, "audioDuration")) - $root.google.protobuf.Duration.encode(message.audioDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UploadEvaluationAudioResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse - * @static - * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioResponse} message UploadEvaluationAudioResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UploadEvaluationAudioResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UploadEvaluationAudioResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioResponse} UploadEvaluationAudioResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UploadEvaluationAudioResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UploadEvaluationAudioResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.audioGcsUri = reader.string(); - break; - } - case 2: { - message.audioTranscript = reader.string(); - break; - } - case 3: { - message.audioDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UploadEvaluationAudioResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioResponse} UploadEvaluationAudioResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UploadEvaluationAudioResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UploadEvaluationAudioResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UploadEvaluationAudioResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.audioGcsUri != null && message.hasOwnProperty("audioGcsUri")) - if (!$util.isString(message.audioGcsUri)) - return "audioGcsUri: string expected"; - if (message.audioTranscript != null && message.hasOwnProperty("audioTranscript")) - if (!$util.isString(message.audioTranscript)) - return "audioTranscript: string expected"; - if (message.audioDuration != null && message.hasOwnProperty("audioDuration")) { - var error = $root.google.protobuf.Duration.verify(message.audioDuration); - if (error) - return "audioDuration." + error; - } - return null; - }; - - /** - * Creates an UploadEvaluationAudioResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioResponse} UploadEvaluationAudioResponse - */ - UploadEvaluationAudioResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.UploadEvaluationAudioResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.UploadEvaluationAudioResponse(); - if (object.audioGcsUri != null) - message.audioGcsUri = String(object.audioGcsUri); - if (object.audioTranscript != null) - message.audioTranscript = String(object.audioTranscript); - if (object.audioDuration != null) { - if (typeof object.audioDuration !== "object") - throw TypeError(".google.cloud.ces.v1beta.UploadEvaluationAudioResponse.audioDuration: object expected"); - message.audioDuration = $root.google.protobuf.Duration.fromObject(object.audioDuration); - } - return message; - }; - - /** - * Creates a plain object from an UploadEvaluationAudioResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse - * @static - * @param {google.cloud.ces.v1beta.UploadEvaluationAudioResponse} message UploadEvaluationAudioResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UploadEvaluationAudioResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.audioGcsUri = ""; - object.audioTranscript = ""; - object.audioDuration = null; - } - if (message.audioGcsUri != null && message.hasOwnProperty("audioGcsUri")) - object.audioGcsUri = message.audioGcsUri; - if (message.audioTranscript != null && message.hasOwnProperty("audioTranscript")) - object.audioTranscript = message.audioTranscript; - if (message.audioDuration != null && message.hasOwnProperty("audioDuration")) - object.audioDuration = $root.google.protobuf.Duration.toObject(message.audioDuration, options); - return object; - }; - - /** - * Converts this UploadEvaluationAudioResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse - * @instance - * @returns {Object.} JSON object - */ - UploadEvaluationAudioResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UploadEvaluationAudioResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UploadEvaluationAudioResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.UploadEvaluationAudioResponse"; - }; - - return UploadEvaluationAudioResponse; - })(); - - v1beta.TestPersonaVoiceResponse = (function() { - - /** - * Properties of a TestPersonaVoiceResponse. - * @memberof google.cloud.ces.v1beta - * @interface ITestPersonaVoiceResponse - * @property {Uint8Array|null} [audio] TestPersonaVoiceResponse audio - */ - - /** - * Constructs a new TestPersonaVoiceResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a TestPersonaVoiceResponse. - * @implements ITestPersonaVoiceResponse - * @constructor - * @param {google.cloud.ces.v1beta.ITestPersonaVoiceResponse=} [properties] Properties to set - */ - function TestPersonaVoiceResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TestPersonaVoiceResponse audio. - * @member {Uint8Array} audio - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse - * @instance - */ - TestPersonaVoiceResponse.prototype.audio = $util.newBuffer([]); - - /** - * Creates a new TestPersonaVoiceResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse - * @static - * @param {google.cloud.ces.v1beta.ITestPersonaVoiceResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.TestPersonaVoiceResponse} TestPersonaVoiceResponse instance - */ - TestPersonaVoiceResponse.create = function create(properties) { - return new TestPersonaVoiceResponse(properties); - }; - - /** - * Encodes the specified TestPersonaVoiceResponse message. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse - * @static - * @param {google.cloud.ces.v1beta.ITestPersonaVoiceResponse} message TestPersonaVoiceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestPersonaVoiceResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.audio); - return writer; - }; - - /** - * Encodes the specified TestPersonaVoiceResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse - * @static - * @param {google.cloud.ces.v1beta.ITestPersonaVoiceResponse} message TestPersonaVoiceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestPersonaVoiceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TestPersonaVoiceResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.TestPersonaVoiceResponse} TestPersonaVoiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestPersonaVoiceResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TestPersonaVoiceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.audio = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TestPersonaVoiceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.TestPersonaVoiceResponse} TestPersonaVoiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestPersonaVoiceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TestPersonaVoiceResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TestPersonaVoiceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.audio != null && message.hasOwnProperty("audio")) - if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) - return "audio: buffer expected"; - return null; - }; - - /** - * Creates a TestPersonaVoiceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.TestPersonaVoiceResponse} TestPersonaVoiceResponse - */ - TestPersonaVoiceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.TestPersonaVoiceResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.TestPersonaVoiceResponse(); - if (object.audio != null) - if (typeof object.audio === "string") - $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); - else if (object.audio.length >= 0) - message.audio = object.audio; - return message; - }; - - /** - * Creates a plain object from a TestPersonaVoiceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse - * @static - * @param {google.cloud.ces.v1beta.TestPersonaVoiceResponse} message TestPersonaVoiceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TestPersonaVoiceResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.audio = ""; - else { - object.audio = []; - if (options.bytes !== Array) - object.audio = $util.newBuffer(object.audio); - } - if (message.audio != null && message.hasOwnProperty("audio")) - object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; - return object; - }; - - /** - * Converts this TestPersonaVoiceResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse - * @instance - * @returns {Object.} JSON object - */ - TestPersonaVoiceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TestPersonaVoiceResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TestPersonaVoiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.TestPersonaVoiceResponse"; - }; - - return TestPersonaVoiceResponse; - })(); - - v1beta.CreateEvaluationExpectationRequest = (function() { - - /** - * Properties of a CreateEvaluationExpectationRequest. - * @memberof google.cloud.ces.v1beta - * @interface ICreateEvaluationExpectationRequest - * @property {string|null} [parent] CreateEvaluationExpectationRequest parent - * @property {string|null} [evaluationExpectationId] CreateEvaluationExpectationRequest evaluationExpectationId - * @property {google.cloud.ces.v1beta.IEvaluationExpectation|null} [evaluationExpectation] CreateEvaluationExpectationRequest evaluationExpectation - */ - - /** - * Constructs a new CreateEvaluationExpectationRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a CreateEvaluationExpectationRequest. - * @implements ICreateEvaluationExpectationRequest - * @constructor - * @param {google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest=} [properties] Properties to set - */ - function CreateEvaluationExpectationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateEvaluationExpectationRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest - * @instance - */ - CreateEvaluationExpectationRequest.prototype.parent = ""; - - /** - * CreateEvaluationExpectationRequest evaluationExpectationId. - * @member {string} evaluationExpectationId - * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest - * @instance - */ - CreateEvaluationExpectationRequest.prototype.evaluationExpectationId = ""; - - /** - * CreateEvaluationExpectationRequest evaluationExpectation. - * @member {google.cloud.ces.v1beta.IEvaluationExpectation|null|undefined} evaluationExpectation - * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest - * @instance - */ - CreateEvaluationExpectationRequest.prototype.evaluationExpectation = null; - - /** - * Creates a new CreateEvaluationExpectationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.CreateEvaluationExpectationRequest} CreateEvaluationExpectationRequest instance - */ - CreateEvaluationExpectationRequest.create = function create(properties) { - return new CreateEvaluationExpectationRequest(properties); - }; - - /** - * Encodes the specified CreateEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationExpectationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest} message CreateEvaluationExpectationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateEvaluationExpectationRequest.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.evaluationExpectationId != null && Object.hasOwnProperty.call(message, "evaluationExpectationId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluationExpectationId); - if (message.evaluationExpectation != null && Object.hasOwnProperty.call(message, "evaluationExpectation")) - $root.google.cloud.ces.v1beta.EvaluationExpectation.encode(message.evaluationExpectation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationExpectationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest - * @static - * @param {google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest} message CreateEvaluationExpectationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateEvaluationExpectationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateEvaluationExpectationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.CreateEvaluationExpectationRequest} CreateEvaluationExpectationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateEvaluationExpectationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.evaluationExpectationId = reader.string(); - break; - } - case 3: { - message.evaluationExpectation = $root.google.cloud.ces.v1beta.EvaluationExpectation.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateEvaluationExpectationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.CreateEvaluationExpectationRequest} CreateEvaluationExpectationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateEvaluationExpectationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateEvaluationExpectationRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateEvaluationExpectationRequest.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.evaluationExpectationId != null && message.hasOwnProperty("evaluationExpectationId")) - if (!$util.isString(message.evaluationExpectationId)) - return "evaluationExpectationId: string expected"; - if (message.evaluationExpectation != null && message.hasOwnProperty("evaluationExpectation")) { - var error = $root.google.cloud.ces.v1beta.EvaluationExpectation.verify(message.evaluationExpectation); - if (error) - return "evaluationExpectation." + error; - } - return null; - }; - - /** - * Creates a CreateEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.CreateEvaluationExpectationRequest} CreateEvaluationExpectationRequest - */ - CreateEvaluationExpectationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.evaluationExpectationId != null) - message.evaluationExpectationId = String(object.evaluationExpectationId); - if (object.evaluationExpectation != null) { - if (typeof object.evaluationExpectation !== "object") - throw TypeError(".google.cloud.ces.v1beta.CreateEvaluationExpectationRequest.evaluationExpectation: object expected"); - message.evaluationExpectation = $root.google.cloud.ces.v1beta.EvaluationExpectation.fromObject(object.evaluationExpectation); - } - return message; - }; - - /** - * Creates a plain object from a CreateEvaluationExpectationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest - * @static - * @param {google.cloud.ces.v1beta.CreateEvaluationExpectationRequest} message CreateEvaluationExpectationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateEvaluationExpectationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.evaluationExpectationId = ""; - object.evaluationExpectation = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.evaluationExpectationId != null && message.hasOwnProperty("evaluationExpectationId")) - object.evaluationExpectationId = message.evaluationExpectationId; - if (message.evaluationExpectation != null && message.hasOwnProperty("evaluationExpectation")) - object.evaluationExpectation = $root.google.cloud.ces.v1beta.EvaluationExpectation.toObject(message.evaluationExpectation, options); - return object; - }; - - /** - * Converts this CreateEvaluationExpectationRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest - * @instance - * @returns {Object.} JSON object - */ - CreateEvaluationExpectationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateEvaluationExpectationRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateEvaluationExpectationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateEvaluationExpectationRequest"; - }; - - return CreateEvaluationExpectationRequest; - })(); - - v1beta.UpdateEvaluationExpectationRequest = (function() { - - /** - * Properties of an UpdateEvaluationExpectationRequest. - * @memberof google.cloud.ces.v1beta - * @interface IUpdateEvaluationExpectationRequest - * @property {google.cloud.ces.v1beta.IEvaluationExpectation|null} [evaluationExpectation] UpdateEvaluationExpectationRequest evaluationExpectation - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEvaluationExpectationRequest updateMask - */ - - /** - * Constructs a new UpdateEvaluationExpectationRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an UpdateEvaluationExpectationRequest. - * @implements IUpdateEvaluationExpectationRequest - * @constructor - * @param {google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest=} [properties] Properties to set - */ - function UpdateEvaluationExpectationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateEvaluationExpectationRequest evaluationExpectation. - * @member {google.cloud.ces.v1beta.IEvaluationExpectation|null|undefined} evaluationExpectation - * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest - * @instance - */ - UpdateEvaluationExpectationRequest.prototype.evaluationExpectation = null; - - /** - * UpdateEvaluationExpectationRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest - * @instance - */ - UpdateEvaluationExpectationRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateEvaluationExpectationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest} UpdateEvaluationExpectationRequest instance - */ - UpdateEvaluationExpectationRequest.create = function create(properties) { - return new UpdateEvaluationExpectationRequest(properties); - }; - - /** - * Encodes the specified UpdateEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest} message UpdateEvaluationExpectationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateEvaluationExpectationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evaluationExpectation != null && Object.hasOwnProperty.call(message, "evaluationExpectation")) - $root.google.cloud.ces.v1beta.EvaluationExpectation.encode(message.evaluationExpectation, 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 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest - * @static - * @param {google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest} message UpdateEvaluationExpectationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateEvaluationExpectationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateEvaluationExpectationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest} UpdateEvaluationExpectationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateEvaluationExpectationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.evaluationExpectation = $root.google.cloud.ces.v1beta.EvaluationExpectation.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateEvaluationExpectationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest} UpdateEvaluationExpectationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateEvaluationExpectationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateEvaluationExpectationRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateEvaluationExpectationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evaluationExpectation != null && message.hasOwnProperty("evaluationExpectation")) { - var error = $root.google.cloud.ces.v1beta.EvaluationExpectation.verify(message.evaluationExpectation); - if (error) - return "evaluationExpectation." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest} UpdateEvaluationExpectationRequest - */ - UpdateEvaluationExpectationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest(); - if (object.evaluationExpectation != null) { - if (typeof object.evaluationExpectation !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest.evaluationExpectation: object expected"); - message.evaluationExpectation = $root.google.cloud.ces.v1beta.EvaluationExpectation.fromObject(object.evaluationExpectation); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateEvaluationExpectationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest - * @static - * @param {google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest} message UpdateEvaluationExpectationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateEvaluationExpectationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.evaluationExpectation = null; - object.updateMask = null; - } - if (message.evaluationExpectation != null && message.hasOwnProperty("evaluationExpectation")) - object.evaluationExpectation = $root.google.cloud.ces.v1beta.EvaluationExpectation.toObject(message.evaluationExpectation, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateEvaluationExpectationRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateEvaluationExpectationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateEvaluationExpectationRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateEvaluationExpectationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest"; - }; - - return UpdateEvaluationExpectationRequest; - })(); - - v1beta.DeleteEvaluationExpectationRequest = (function() { - - /** - * Properties of a DeleteEvaluationExpectationRequest. - * @memberof google.cloud.ces.v1beta - * @interface IDeleteEvaluationExpectationRequest - * @property {string|null} [name] DeleteEvaluationExpectationRequest name - * @property {string|null} [etag] DeleteEvaluationExpectationRequest etag - */ - - /** - * Constructs a new DeleteEvaluationExpectationRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a DeleteEvaluationExpectationRequest. - * @implements IDeleteEvaluationExpectationRequest - * @constructor - * @param {google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest=} [properties] Properties to set - */ - function DeleteEvaluationExpectationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteEvaluationExpectationRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest - * @instance - */ - DeleteEvaluationExpectationRequest.prototype.name = ""; - - /** - * DeleteEvaluationExpectationRequest etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest - * @instance - */ - DeleteEvaluationExpectationRequest.prototype.etag = ""; - - /** - * Creates a new DeleteEvaluationExpectationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest} DeleteEvaluationExpectationRequest instance - */ - DeleteEvaluationExpectationRequest.create = function create(properties) { - return new DeleteEvaluationExpectationRequest(properties); - }; - - /** - * Encodes the specified DeleteEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest} message DeleteEvaluationExpectationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteEvaluationExpectationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest - * @static - * @param {google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest} message DeleteEvaluationExpectationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteEvaluationExpectationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteEvaluationExpectationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest} DeleteEvaluationExpectationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteEvaluationExpectationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteEvaluationExpectationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest} DeleteEvaluationExpectationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteEvaluationExpectationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteEvaluationExpectationRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteEvaluationExpectationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest} DeleteEvaluationExpectationRequest - */ - DeleteEvaluationExpectationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteEvaluationExpectationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest - * @static - * @param {google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest} message DeleteEvaluationExpectationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteEvaluationExpectationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteEvaluationExpectationRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteEvaluationExpectationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteEvaluationExpectationRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteEvaluationExpectationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest"; - }; - - return DeleteEvaluationExpectationRequest; - })(); - - v1beta.GetEvaluationExpectationRequest = (function() { - - /** - * Properties of a GetEvaluationExpectationRequest. - * @memberof google.cloud.ces.v1beta - * @interface IGetEvaluationExpectationRequest - * @property {string|null} [name] GetEvaluationExpectationRequest name - */ - - /** - * Constructs a new GetEvaluationExpectationRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GetEvaluationExpectationRequest. - * @implements IGetEvaluationExpectationRequest - * @constructor - * @param {google.cloud.ces.v1beta.IGetEvaluationExpectationRequest=} [properties] Properties to set - */ - function GetEvaluationExpectationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvaluationExpectationRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest - * @instance - */ - GetEvaluationExpectationRequest.prototype.name = ""; - - /** - * Creates a new GetEvaluationExpectationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest - * @static - * @param {google.cloud.ces.v1beta.IGetEvaluationExpectationRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GetEvaluationExpectationRequest} GetEvaluationExpectationRequest instance - */ - GetEvaluationExpectationRequest.create = function create(properties) { - return new GetEvaluationExpectationRequest(properties); - }; - - /** - * Encodes the specified GetEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationExpectationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest - * @static - * @param {google.cloud.ces.v1beta.IGetEvaluationExpectationRequest} message GetEvaluationExpectationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvaluationExpectationRequest.encode = function encode(message, writer) { - 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 GetEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationExpectationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest - * @static - * @param {google.cloud.ces.v1beta.IGetEvaluationExpectationRequest} message GetEvaluationExpectationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvaluationExpectationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvaluationExpectationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GetEvaluationExpectationRequest} GetEvaluationExpectationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvaluationExpectationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetEvaluationExpectationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEvaluationExpectationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GetEvaluationExpectationRequest} GetEvaluationExpectationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvaluationExpectationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvaluationExpectationRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvaluationExpectationRequest.verify = function verify(message) { - if (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 GetEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GetEvaluationExpectationRequest} GetEvaluationExpectationRequest - */ - GetEvaluationExpectationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GetEvaluationExpectationRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.GetEvaluationExpectationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetEvaluationExpectationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest - * @static - * @param {google.cloud.ces.v1beta.GetEvaluationExpectationRequest} message GetEvaluationExpectationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvaluationExpectationRequest.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 GetEvaluationExpectationRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest - * @instance - * @returns {Object.} JSON object - */ - GetEvaluationExpectationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetEvaluationExpectationRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetEvaluationExpectationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GetEvaluationExpectationRequest"; - }; - - return GetEvaluationExpectationRequest; - })(); - - v1beta.ListEvaluationExpectationsRequest = (function() { - - /** - * Properties of a ListEvaluationExpectationsRequest. - * @memberof google.cloud.ces.v1beta - * @interface IListEvaluationExpectationsRequest - * @property {string|null} [parent] ListEvaluationExpectationsRequest parent - * @property {number|null} [pageSize] ListEvaluationExpectationsRequest pageSize - * @property {string|null} [pageToken] ListEvaluationExpectationsRequest pageToken - * @property {string|null} [filter] ListEvaluationExpectationsRequest filter - * @property {string|null} [orderBy] ListEvaluationExpectationsRequest orderBy - */ - - /** - * Constructs a new ListEvaluationExpectationsRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListEvaluationExpectationsRequest. - * @implements IListEvaluationExpectationsRequest - * @constructor - * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsRequest=} [properties] Properties to set - */ - function ListEvaluationExpectationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEvaluationExpectationsRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest - * @instance - */ - ListEvaluationExpectationsRequest.prototype.parent = ""; - - /** - * ListEvaluationExpectationsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest - * @instance - */ - ListEvaluationExpectationsRequest.prototype.pageSize = 0; - - /** - * ListEvaluationExpectationsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest - * @instance - */ - ListEvaluationExpectationsRequest.prototype.pageToken = ""; - - /** - * ListEvaluationExpectationsRequest filter. - * @member {string} filter - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest - * @instance - */ - ListEvaluationExpectationsRequest.prototype.filter = ""; - - /** - * ListEvaluationExpectationsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest - * @instance - */ - ListEvaluationExpectationsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListEvaluationExpectationsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsRequest} ListEvaluationExpectationsRequest instance - */ - ListEvaluationExpectationsRequest.create = function create(properties) { - return new ListEvaluationExpectationsRequest(properties); - }; - - /** - * Encodes the specified ListEvaluationExpectationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsRequest} message ListEvaluationExpectationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationExpectationsRequest.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 ListEvaluationExpectationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsRequest} message ListEvaluationExpectationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationExpectationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEvaluationExpectationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsRequest} ListEvaluationExpectationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationExpectationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListEvaluationExpectationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsRequest} ListEvaluationExpectationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationExpectationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEvaluationExpectationsRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEvaluationExpectationsRequest.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 ListEvaluationExpectationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsRequest} ListEvaluationExpectationsRequest - */ - ListEvaluationExpectationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest(); - 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 ListEvaluationExpectationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest - * @static - * @param {google.cloud.ces.v1beta.ListEvaluationExpectationsRequest} message ListEvaluationExpectationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEvaluationExpectationsRequest.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 ListEvaluationExpectationsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListEvaluationExpectationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEvaluationExpectationsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEvaluationExpectationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationExpectationsRequest"; - }; - - return ListEvaluationExpectationsRequest; - })(); - - v1beta.ListEvaluationExpectationsResponse = (function() { - - /** - * Properties of a ListEvaluationExpectationsResponse. - * @memberof google.cloud.ces.v1beta - * @interface IListEvaluationExpectationsResponse - * @property {Array.|null} [evaluationExpectations] ListEvaluationExpectationsResponse evaluationExpectations - * @property {string|null} [nextPageToken] ListEvaluationExpectationsResponse nextPageToken - */ - - /** - * Constructs a new ListEvaluationExpectationsResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ListEvaluationExpectationsResponse. - * @implements IListEvaluationExpectationsResponse - * @constructor - * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsResponse=} [properties] Properties to set - */ - function ListEvaluationExpectationsResponse(properties) { - this.evaluationExpectations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEvaluationExpectationsResponse evaluationExpectations. - * @member {Array.} evaluationExpectations - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse - * @instance - */ - ListEvaluationExpectationsResponse.prototype.evaluationExpectations = $util.emptyArray; - - /** - * ListEvaluationExpectationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse - * @instance - */ - ListEvaluationExpectationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListEvaluationExpectationsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsResponse} ListEvaluationExpectationsResponse instance - */ - ListEvaluationExpectationsResponse.create = function create(properties) { - return new ListEvaluationExpectationsResponse(properties); - }; - - /** - * Encodes the specified ListEvaluationExpectationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsResponse} message ListEvaluationExpectationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationExpectationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evaluationExpectations != null && message.evaluationExpectations.length) - for (var i = 0; i < message.evaluationExpectations.length; ++i) - $root.google.cloud.ces.v1beta.EvaluationExpectation.encode(message.evaluationExpectations[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 ListEvaluationExpectationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse - * @static - * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsResponse} message ListEvaluationExpectationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationExpectationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEvaluationExpectationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsResponse} ListEvaluationExpectationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationExpectationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationExpectationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.evaluationExpectations && message.evaluationExpectations.length)) - message.evaluationExpectations = []; - message.evaluationExpectations.push($root.google.cloud.ces.v1beta.EvaluationExpectation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListEvaluationExpectationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsResponse} ListEvaluationExpectationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationExpectationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEvaluationExpectationsResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEvaluationExpectationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evaluationExpectations != null && message.hasOwnProperty("evaluationExpectations")) { - if (!Array.isArray(message.evaluationExpectations)) - return "evaluationExpectations: array expected"; - for (var i = 0; i < message.evaluationExpectations.length; ++i) { - var error = $root.google.cloud.ces.v1beta.EvaluationExpectation.verify(message.evaluationExpectations[i]); - if (error) - return "evaluationExpectations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListEvaluationExpectationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsResponse} ListEvaluationExpectationsResponse - */ - ListEvaluationExpectationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationExpectationsResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ListEvaluationExpectationsResponse(); - if (object.evaluationExpectations) { - if (!Array.isArray(object.evaluationExpectations)) - throw TypeError(".google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.evaluationExpectations: array expected"); - message.evaluationExpectations = []; - for (var i = 0; i < object.evaluationExpectations.length; ++i) { - if (typeof object.evaluationExpectations[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.evaluationExpectations: object expected"); - message.evaluationExpectations[i] = $root.google.cloud.ces.v1beta.EvaluationExpectation.fromObject(object.evaluationExpectations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListEvaluationExpectationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse - * @static - * @param {google.cloud.ces.v1beta.ListEvaluationExpectationsResponse} message ListEvaluationExpectationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEvaluationExpectationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.evaluationExpectations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.evaluationExpectations && message.evaluationExpectations.length) { - object.evaluationExpectations = []; - for (var j = 0; j < message.evaluationExpectations.length; ++j) - object.evaluationExpectations[j] = $root.google.cloud.ces.v1beta.EvaluationExpectation.toObject(message.evaluationExpectations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListEvaluationExpectationsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListEvaluationExpectationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEvaluationExpectationsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEvaluationExpectationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationExpectationsResponse"; - }; - - return ListEvaluationExpectationsResponse; - })(); - - v1beta.Omnichannel = (function() { - - /** - * Properties of an Omnichannel. - * @memberof google.cloud.ces.v1beta - * @interface IOmnichannel - * @property {string|null} [name] Omnichannel name - * @property {string|null} [displayName] Omnichannel displayName - * @property {string|null} [description] Omnichannel description - * @property {google.protobuf.ITimestamp|null} [createTime] Omnichannel createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Omnichannel updateTime - * @property {string|null} [etag] Omnichannel etag - * @property {google.cloud.ces.v1beta.IOmnichannelIntegrationConfig|null} [integrationConfig] Omnichannel integrationConfig - */ - - /** - * Constructs a new Omnichannel. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an Omnichannel. - * @implements IOmnichannel - * @constructor - * @param {google.cloud.ces.v1beta.IOmnichannel=} [properties] Properties to set - */ - function Omnichannel(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Omnichannel name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.Omnichannel - * @instance - */ - Omnichannel.prototype.name = ""; - - /** - * Omnichannel displayName. - * @member {string} displayName - * @memberof google.cloud.ces.v1beta.Omnichannel - * @instance - */ - Omnichannel.prototype.displayName = ""; - - /** - * Omnichannel description. - * @member {string} description - * @memberof google.cloud.ces.v1beta.Omnichannel - * @instance - */ - Omnichannel.prototype.description = ""; - - /** - * Omnichannel createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.Omnichannel - * @instance - */ - Omnichannel.prototype.createTime = null; - - /** - * Omnichannel updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.ces.v1beta.Omnichannel - * @instance - */ - Omnichannel.prototype.updateTime = null; - - /** - * Omnichannel etag. - * @member {string} etag - * @memberof google.cloud.ces.v1beta.Omnichannel - * @instance - */ - Omnichannel.prototype.etag = ""; - - /** - * Omnichannel integrationConfig. - * @member {google.cloud.ces.v1beta.IOmnichannelIntegrationConfig|null|undefined} integrationConfig - * @memberof google.cloud.ces.v1beta.Omnichannel - * @instance - */ - Omnichannel.prototype.integrationConfig = null; - - /** - * Creates a new Omnichannel instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.Omnichannel - * @static - * @param {google.cloud.ces.v1beta.IOmnichannel=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.Omnichannel} Omnichannel instance - */ - Omnichannel.create = function create(properties) { - return new Omnichannel(properties); - }; - - /** - * Encodes the specified Omnichannel message. Does not implicitly {@link google.cloud.ces.v1beta.Omnichannel.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.Omnichannel - * @static - * @param {google.cloud.ces.v1beta.IOmnichannel} message Omnichannel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Omnichannel.encode = function encode(message, writer) { - if (!writer) - 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.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - 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.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); - if (message.integrationConfig != null && Object.hasOwnProperty.call(message, "integrationConfig")) - $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.encode(message.integrationConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Omnichannel message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Omnichannel.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.Omnichannel - * @static - * @param {google.cloud.ces.v1beta.IOmnichannel} message Omnichannel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Omnichannel.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Omnichannel message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.Omnichannel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.Omnichannel} Omnichannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Omnichannel.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Omnichannel(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = 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.etag = reader.string(); - break; - } - case 7: { - message.integrationConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Omnichannel message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.Omnichannel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.Omnichannel} Omnichannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Omnichannel.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Omnichannel message. - * @function verify - * @memberof google.cloud.ces.v1beta.Omnichannel - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Omnichannel.verify = function verify(message) { - if (typeof message !== "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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: 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.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.integrationConfig != null && message.hasOwnProperty("integrationConfig")) { - var error = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.verify(message.integrationConfig); - if (error) - return "integrationConfig." + error; - } - return null; - }; - - /** - * Creates an Omnichannel message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.Omnichannel - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.Omnichannel} Omnichannel - */ - Omnichannel.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.Omnichannel) - return object; - var message = new $root.google.cloud.ces.v1beta.Omnichannel(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.Omnichannel.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.ces.v1beta.Omnichannel.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.integrationConfig != null) { - if (typeof object.integrationConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.Omnichannel.integrationConfig: object expected"); - message.integrationConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.fromObject(object.integrationConfig); - } - return message; - }; - - /** - * Creates a plain object from an Omnichannel message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.Omnichannel - * @static - * @param {google.cloud.ces.v1beta.Omnichannel} message Omnichannel - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Omnichannel.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - object.integrationConfig = 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.description != null && message.hasOwnProperty("description")) - object.description = message.description; - 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.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.integrationConfig != null && message.hasOwnProperty("integrationConfig")) - object.integrationConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.toObject(message.integrationConfig, options); - return object; - }; - - /** - * Converts this Omnichannel to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.Omnichannel - * @instance - * @returns {Object.} JSON object - */ - Omnichannel.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Omnichannel - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.Omnichannel - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Omnichannel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.Omnichannel"; - }; - - return Omnichannel; - })(); - - v1beta.OmnichannelIntegrationConfig = (function() { - - /** - * Properties of an OmnichannelIntegrationConfig. - * @memberof google.cloud.ces.v1beta - * @interface IOmnichannelIntegrationConfig - * @property {Object.|null} [channelConfigs] OmnichannelIntegrationConfig channelConfigs - * @property {Object.|null} [subscriberConfigs] OmnichannelIntegrationConfig subscriberConfigs - * @property {Object.|null} [routingConfigs] OmnichannelIntegrationConfig routingConfigs - */ - - /** - * Constructs a new OmnichannelIntegrationConfig. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an OmnichannelIntegrationConfig. - * @implements IOmnichannelIntegrationConfig - * @constructor - * @param {google.cloud.ces.v1beta.IOmnichannelIntegrationConfig=} [properties] Properties to set - */ - function OmnichannelIntegrationConfig(properties) { - this.channelConfigs = {}; - this.subscriberConfigs = {}; - this.routingConfigs = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OmnichannelIntegrationConfig channelConfigs. - * @member {Object.} channelConfigs - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @instance - */ - OmnichannelIntegrationConfig.prototype.channelConfigs = $util.emptyObject; - - /** - * OmnichannelIntegrationConfig subscriberConfigs. - * @member {Object.} subscriberConfigs - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @instance - */ - OmnichannelIntegrationConfig.prototype.subscriberConfigs = $util.emptyObject; - - /** - * OmnichannelIntegrationConfig routingConfigs. - * @member {Object.} routingConfigs - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @instance - */ - OmnichannelIntegrationConfig.prototype.routingConfigs = $util.emptyObject; - - /** - * Creates a new OmnichannelIntegrationConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @static - * @param {google.cloud.ces.v1beta.IOmnichannelIntegrationConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig instance - */ - OmnichannelIntegrationConfig.create = function create(properties) { - return new OmnichannelIntegrationConfig(properties); - }; - - /** - * Encodes the specified OmnichannelIntegrationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @static - * @param {google.cloud.ces.v1beta.IOmnichannelIntegrationConfig} message OmnichannelIntegrationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OmnichannelIntegrationConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channelConfigs != null && Object.hasOwnProperty.call(message, "channelConfigs")) - for (var keys = Object.keys(message.channelConfigs), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.encode(message.channelConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.subscriberConfigs != null && Object.hasOwnProperty.call(message, "subscriberConfigs")) - for (var keys = Object.keys(message.subscriberConfigs), 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.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.encode(message.subscriberConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.routingConfigs != null && Object.hasOwnProperty.call(message, "routingConfigs")) - for (var keys = Object.keys(message.routingConfigs), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.encode(message.routingConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified OmnichannelIntegrationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @static - * @param {google.cloud.ces.v1beta.IOmnichannelIntegrationConfig} message OmnichannelIntegrationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OmnichannelIntegrationConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OmnichannelIntegrationConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.channelConfigs === $util.emptyObject) - message.channelConfigs = {}; - 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.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.channelConfigs[key] = value; - break; - } - case 2: { - if (message.subscriberConfigs === $util.emptyObject) - message.subscriberConfigs = {}; - 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.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.subscriberConfigs[key] = value; - break; - } - case 3: { - if (message.routingConfigs === $util.emptyObject) - message.routingConfigs = {}; - 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.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.routingConfigs[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OmnichannelIntegrationConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OmnichannelIntegrationConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OmnichannelIntegrationConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channelConfigs != null && message.hasOwnProperty("channelConfigs")) { - if (!$util.isObject(message.channelConfigs)) - return "channelConfigs: object expected"; - var key = Object.keys(message.channelConfigs); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.verify(message.channelConfigs[key[i]]); - if (error) - return "channelConfigs." + error; - } - } - if (message.subscriberConfigs != null && message.hasOwnProperty("subscriberConfigs")) { - if (!$util.isObject(message.subscriberConfigs)) - return "subscriberConfigs: object expected"; - var key = Object.keys(message.subscriberConfigs); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.verify(message.subscriberConfigs[key[i]]); - if (error) - return "subscriberConfigs." + error; - } - } - if (message.routingConfigs != null && message.hasOwnProperty("routingConfigs")) { - if (!$util.isObject(message.routingConfigs)) - return "routingConfigs: object expected"; - var key = Object.keys(message.routingConfigs); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.verify(message.routingConfigs[key[i]]); - if (error) - return "routingConfigs." + error; - } - } - return null; - }; - - /** - * Creates an OmnichannelIntegrationConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig - */ - OmnichannelIntegrationConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig(); - if (object.channelConfigs) { - if (typeof object.channelConfigs !== "object") - throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.channelConfigs: object expected"); - message.channelConfigs = {}; - for (var keys = Object.keys(object.channelConfigs), i = 0; i < keys.length; ++i) { - if (typeof object.channelConfigs[keys[i]] !== "object") - throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.channelConfigs: object expected"); - message.channelConfigs[keys[i]] = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.fromObject(object.channelConfigs[keys[i]]); - } - } - if (object.subscriberConfigs) { - if (typeof object.subscriberConfigs !== "object") - throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.subscriberConfigs: object expected"); - message.subscriberConfigs = {}; - for (var keys = Object.keys(object.subscriberConfigs), i = 0; i < keys.length; ++i) { - if (typeof object.subscriberConfigs[keys[i]] !== "object") - throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.subscriberConfigs: object expected"); - message.subscriberConfigs[keys[i]] = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.fromObject(object.subscriberConfigs[keys[i]]); - } - } - if (object.routingConfigs) { - if (typeof object.routingConfigs !== "object") - throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.routingConfigs: object expected"); - message.routingConfigs = {}; - for (var keys = Object.keys(object.routingConfigs), i = 0; i < keys.length; ++i) { - if (typeof object.routingConfigs[keys[i]] !== "object") - throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.routingConfigs: object expected"); - message.routingConfigs[keys[i]] = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.fromObject(object.routingConfigs[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from an OmnichannelIntegrationConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig} message OmnichannelIntegrationConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OmnichannelIntegrationConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.channelConfigs = {}; - object.subscriberConfigs = {}; - object.routingConfigs = {}; - } - var keys2; - if (message.channelConfigs && (keys2 = Object.keys(message.channelConfigs)).length) { - object.channelConfigs = {}; - for (var j = 0; j < keys2.length; ++j) - object.channelConfigs[keys2[j]] = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.toObject(message.channelConfigs[keys2[j]], options); - } - if (message.subscriberConfigs && (keys2 = Object.keys(message.subscriberConfigs)).length) { - object.subscriberConfigs = {}; - for (var j = 0; j < keys2.length; ++j) - object.subscriberConfigs[keys2[j]] = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.toObject(message.subscriberConfigs[keys2[j]], options); - } - if (message.routingConfigs && (keys2 = Object.keys(message.routingConfigs)).length) { - object.routingConfigs = {}; - for (var j = 0; j < keys2.length; ++j) - object.routingConfigs[keys2[j]] = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.toObject(message.routingConfigs[keys2[j]], options); - } - return object; - }; - - /** - * Converts this OmnichannelIntegrationConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @instance - * @returns {Object.} JSON object - */ - OmnichannelIntegrationConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OmnichannelIntegrationConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OmnichannelIntegrationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelIntegrationConfig"; - }; - - OmnichannelIntegrationConfig.ChannelConfig = (function() { - - /** - * Properties of a ChannelConfig. - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @interface IChannelConfig - * @property {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig|null} [whatsappConfig] ChannelConfig whatsappConfig - */ - - /** - * Constructs a new ChannelConfig. - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @classdesc Represents a ChannelConfig. - * @implements IChannelConfig - * @constructor - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig=} [properties] Properties to set - */ - function ChannelConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChannelConfig whatsappConfig. - * @member {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig|null|undefined} whatsappConfig - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig - * @instance - */ - ChannelConfig.prototype.whatsappConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ChannelConfig channelConfig. - * @member {"whatsappConfig"|undefined} channelConfig - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig - * @instance - */ - Object.defineProperty(ChannelConfig.prototype, "channelConfig", { - get: $util.oneOfGetter($oneOfFields = ["whatsappConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ChannelConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig instance - */ - ChannelConfig.create = function create(properties) { - return new ChannelConfig(properties); - }; - - /** - * Encodes the specified ChannelConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig} message ChannelConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChannelConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.whatsappConfig != null && Object.hasOwnProperty.call(message, "whatsappConfig")) - $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.encode(message.whatsappConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ChannelConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig} message ChannelConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChannelConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChannelConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChannelConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.whatsappConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChannelConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChannelConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChannelConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChannelConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.whatsappConfig != null && message.hasOwnProperty("whatsappConfig")) { - properties.channelConfig = 1; - { - var error = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.verify(message.whatsappConfig); - if (error) - return "whatsappConfig." + error; - } - } - return null; - }; - - /** - * Creates a ChannelConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig - */ - ChannelConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig(); - if (object.whatsappConfig != null) { - if (typeof object.whatsappConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.whatsappConfig: object expected"); - message.whatsappConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.fromObject(object.whatsappConfig); - } - return message; - }; - - /** - * Creates a plain object from a ChannelConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig} message ChannelConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChannelConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.whatsappConfig != null && message.hasOwnProperty("whatsappConfig")) { - object.whatsappConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.toObject(message.whatsappConfig, options); - if (options.oneofs) - object.channelConfig = "whatsappConfig"; - } - return object; - }; - - /** - * Converts this ChannelConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig - * @instance - * @returns {Object.} JSON object - */ - ChannelConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ChannelConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ChannelConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig"; - }; - - return ChannelConfig; - })(); - - OmnichannelIntegrationConfig.WhatsappConfig = (function() { - - /** - * Properties of a WhatsappConfig. - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @interface IWhatsappConfig - * @property {string|null} [phoneNumberId] WhatsappConfig phoneNumberId - * @property {string|null} [phoneNumber] WhatsappConfig phoneNumber - * @property {string|null} [whatsappBusinessAccountId] WhatsappConfig whatsappBusinessAccountId - * @property {string|null} [webhookVerifyToken] WhatsappConfig webhookVerifyToken - * @property {string|null} [whatsappBusinessToken] WhatsappConfig whatsappBusinessToken - * @property {string|null} [metaBusinessPortfolioId] WhatsappConfig metaBusinessPortfolioId - */ - - /** - * Constructs a new WhatsappConfig. - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @classdesc Represents a WhatsappConfig. - * @implements IWhatsappConfig - * @constructor - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig=} [properties] Properties to set - */ - function WhatsappConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WhatsappConfig phoneNumberId. - * @member {string} phoneNumberId - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig - * @instance - */ - WhatsappConfig.prototype.phoneNumberId = ""; - - /** - * WhatsappConfig phoneNumber. - * @member {string} phoneNumber - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig - * @instance - */ - WhatsappConfig.prototype.phoneNumber = ""; - - /** - * WhatsappConfig whatsappBusinessAccountId. - * @member {string} whatsappBusinessAccountId - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig - * @instance - */ - WhatsappConfig.prototype.whatsappBusinessAccountId = ""; - - /** - * WhatsappConfig webhookVerifyToken. - * @member {string} webhookVerifyToken - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig - * @instance - */ - WhatsappConfig.prototype.webhookVerifyToken = ""; - - /** - * WhatsappConfig whatsappBusinessToken. - * @member {string} whatsappBusinessToken - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig - * @instance - */ - WhatsappConfig.prototype.whatsappBusinessToken = ""; - - /** - * WhatsappConfig metaBusinessPortfolioId. - * @member {string} metaBusinessPortfolioId - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig - * @instance - */ - WhatsappConfig.prototype.metaBusinessPortfolioId = ""; - - /** - * Creates a new WhatsappConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig instance - */ - WhatsappConfig.create = function create(properties) { - return new WhatsappConfig(properties); - }; - - /** - * Encodes the specified WhatsappConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig} message WhatsappConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WhatsappConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.phoneNumberId != null && Object.hasOwnProperty.call(message, "phoneNumberId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.phoneNumberId); - if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.phoneNumber); - if (message.whatsappBusinessAccountId != null && Object.hasOwnProperty.call(message, "whatsappBusinessAccountId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.whatsappBusinessAccountId); - if (message.webhookVerifyToken != null && Object.hasOwnProperty.call(message, "webhookVerifyToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.webhookVerifyToken); - if (message.whatsappBusinessToken != null && Object.hasOwnProperty.call(message, "whatsappBusinessToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.whatsappBusinessToken); - if (message.metaBusinessPortfolioId != null && Object.hasOwnProperty.call(message, "metaBusinessPortfolioId")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.metaBusinessPortfolioId); - return writer; - }; - - /** - * Encodes the specified WhatsappConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig} message WhatsappConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WhatsappConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WhatsappConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WhatsappConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.phoneNumberId = reader.string(); - break; - } - case 2: { - message.phoneNumber = reader.string(); - break; - } - case 3: { - message.whatsappBusinessAccountId = reader.string(); - break; - } - case 4: { - message.webhookVerifyToken = reader.string(); - break; - } - case 5: { - message.whatsappBusinessToken = reader.string(); - break; - } - case 6: { - message.metaBusinessPortfolioId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WhatsappConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WhatsappConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WhatsappConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WhatsappConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.phoneNumberId != null && message.hasOwnProperty("phoneNumberId")) - if (!$util.isString(message.phoneNumberId)) - return "phoneNumberId: string expected"; - if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) - if (!$util.isString(message.phoneNumber)) - return "phoneNumber: string expected"; - if (message.whatsappBusinessAccountId != null && message.hasOwnProperty("whatsappBusinessAccountId")) - if (!$util.isString(message.whatsappBusinessAccountId)) - return "whatsappBusinessAccountId: string expected"; - if (message.webhookVerifyToken != null && message.hasOwnProperty("webhookVerifyToken")) - if (!$util.isString(message.webhookVerifyToken)) - return "webhookVerifyToken: string expected"; - if (message.whatsappBusinessToken != null && message.hasOwnProperty("whatsappBusinessToken")) - if (!$util.isString(message.whatsappBusinessToken)) - return "whatsappBusinessToken: string expected"; - if (message.metaBusinessPortfolioId != null && message.hasOwnProperty("metaBusinessPortfolioId")) - if (!$util.isString(message.metaBusinessPortfolioId)) - return "metaBusinessPortfolioId: string expected"; - return null; - }; - - /** - * Creates a WhatsappConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig - */ - WhatsappConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig(); - if (object.phoneNumberId != null) - message.phoneNumberId = String(object.phoneNumberId); - if (object.phoneNumber != null) - message.phoneNumber = String(object.phoneNumber); - if (object.whatsappBusinessAccountId != null) - message.whatsappBusinessAccountId = String(object.whatsappBusinessAccountId); - if (object.webhookVerifyToken != null) - message.webhookVerifyToken = String(object.webhookVerifyToken); - if (object.whatsappBusinessToken != null) - message.whatsappBusinessToken = String(object.whatsappBusinessToken); - if (object.metaBusinessPortfolioId != null) - message.metaBusinessPortfolioId = String(object.metaBusinessPortfolioId); - return message; - }; - - /** - * Creates a plain object from a WhatsappConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig} message WhatsappConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WhatsappConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.phoneNumberId = ""; - object.phoneNumber = ""; - object.whatsappBusinessAccountId = ""; - object.webhookVerifyToken = ""; - object.whatsappBusinessToken = ""; - object.metaBusinessPortfolioId = ""; - } - if (message.phoneNumberId != null && message.hasOwnProperty("phoneNumberId")) - object.phoneNumberId = message.phoneNumberId; - if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) - object.phoneNumber = message.phoneNumber; - if (message.whatsappBusinessAccountId != null && message.hasOwnProperty("whatsappBusinessAccountId")) - object.whatsappBusinessAccountId = message.whatsappBusinessAccountId; - if (message.webhookVerifyToken != null && message.hasOwnProperty("webhookVerifyToken")) - object.webhookVerifyToken = message.webhookVerifyToken; - if (message.whatsappBusinessToken != null && message.hasOwnProperty("whatsappBusinessToken")) - object.whatsappBusinessToken = message.whatsappBusinessToken; - if (message.metaBusinessPortfolioId != null && message.hasOwnProperty("metaBusinessPortfolioId")) - object.metaBusinessPortfolioId = message.metaBusinessPortfolioId; - return object; - }; - - /** - * Converts this WhatsappConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig - * @instance - * @returns {Object.} JSON object - */ - WhatsappConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WhatsappConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WhatsappConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig"; - }; - - return WhatsappConfig; - })(); - - OmnichannelIntegrationConfig.SubscriberConfig = (function() { - - /** - * Properties of a SubscriberConfig. - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @interface ISubscriberConfig - * @property {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig|null} [cesAppConfig] SubscriberConfig cesAppConfig - */ - - /** - * Constructs a new SubscriberConfig. - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @classdesc Represents a SubscriberConfig. - * @implements ISubscriberConfig - * @constructor - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig=} [properties] Properties to set - */ - function SubscriberConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SubscriberConfig cesAppConfig. - * @member {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig|null|undefined} cesAppConfig - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig - * @instance - */ - SubscriberConfig.prototype.cesAppConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SubscriberConfig subscriberConfig. - * @member {"cesAppConfig"|undefined} subscriberConfig - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig - * @instance - */ - Object.defineProperty(SubscriberConfig.prototype, "subscriberConfig", { - get: $util.oneOfGetter($oneOfFields = ["cesAppConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SubscriberConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig instance - */ - SubscriberConfig.create = function create(properties) { - return new SubscriberConfig(properties); - }; - - /** - * Encodes the specified SubscriberConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig} message SubscriberConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubscriberConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cesAppConfig != null && Object.hasOwnProperty.call(message, "cesAppConfig")) - $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.encode(message.cesAppConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SubscriberConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig} message SubscriberConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubscriberConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SubscriberConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubscriberConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cesAppConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SubscriberConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubscriberConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SubscriberConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SubscriberConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.cesAppConfig != null && message.hasOwnProperty("cesAppConfig")) { - properties.subscriberConfig = 1; - { - var error = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.verify(message.cesAppConfig); - if (error) - return "cesAppConfig." + error; - } - } - return null; - }; - - /** - * Creates a SubscriberConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig - */ - SubscriberConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig(); - if (object.cesAppConfig != null) { - if (typeof object.cesAppConfig !== "object") - throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.cesAppConfig: object expected"); - message.cesAppConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.fromObject(object.cesAppConfig); - } - return message; - }; - - /** - * Creates a plain object from a SubscriberConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig} message SubscriberConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubscriberConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.cesAppConfig != null && message.hasOwnProperty("cesAppConfig")) { - object.cesAppConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.toObject(message.cesAppConfig, options); - if (options.oneofs) - object.subscriberConfig = "cesAppConfig"; - } - return object; - }; - - /** - * Converts this SubscriberConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig - * @instance - * @returns {Object.} JSON object - */ - SubscriberConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubscriberConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubscriberConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig"; - }; - - return SubscriberConfig; - })(); - - OmnichannelIntegrationConfig.CesAppConfig = (function() { - - /** - * Properties of a CesAppConfig. - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @interface ICesAppConfig - * @property {string|null} [app] CesAppConfig app - */ - - /** - * Constructs a new CesAppConfig. - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @classdesc Represents a CesAppConfig. - * @implements ICesAppConfig - * @constructor - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig=} [properties] Properties to set - */ - function CesAppConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CesAppConfig app. - * @member {string} app - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig - * @instance - */ - CesAppConfig.prototype.app = ""; - - /** - * Creates a new CesAppConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig instance - */ - CesAppConfig.create = function create(properties) { - return new CesAppConfig(properties); - }; - - /** - * Encodes the specified CesAppConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig} message CesAppConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CesAppConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.app != null && Object.hasOwnProperty.call(message, "app")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.app); - return writer; - }; - - /** - * Encodes the specified CesAppConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig} message CesAppConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CesAppConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CesAppConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CesAppConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.app = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CesAppConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CesAppConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CesAppConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CesAppConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.app != null && message.hasOwnProperty("app")) - if (!$util.isString(message.app)) - return "app: string expected"; - return null; - }; - - /** - * Creates a CesAppConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig - */ - CesAppConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig(); - if (object.app != null) - message.app = String(object.app); - return message; - }; - - /** - * Creates a plain object from a CesAppConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig} message CesAppConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CesAppConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.app = ""; - if (message.app != null && message.hasOwnProperty("app")) - object.app = message.app; - return object; - }; - - /** - * Converts this CesAppConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig - * @instance - * @returns {Object.} JSON object - */ - CesAppConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CesAppConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CesAppConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig"; - }; - - return CesAppConfig; - })(); - - OmnichannelIntegrationConfig.RoutingConfig = (function() { - - /** - * Properties of a RoutingConfig. - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @interface IRoutingConfig - * @property {string|null} [subscriberKey] RoutingConfig subscriberKey - */ - - /** - * Constructs a new RoutingConfig. - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig - * @classdesc Represents a RoutingConfig. - * @implements IRoutingConfig - * @constructor - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig=} [properties] Properties to set - */ - function RoutingConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RoutingConfig subscriberKey. - * @member {string} subscriberKey - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig - * @instance - */ - RoutingConfig.prototype.subscriberKey = ""; - - /** - * Creates a new RoutingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig instance - */ - RoutingConfig.create = function create(properties) { - return new RoutingConfig(properties); - }; - - /** - * Encodes the specified RoutingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig} message RoutingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscriberKey != null && Object.hasOwnProperty.call(message, "subscriberKey")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscriberKey); - return writer; - }; - - /** - * Encodes the specified RoutingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig} message RoutingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RoutingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.subscriberKey = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RoutingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RoutingConfig message. - * @function verify - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RoutingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscriberKey != null && message.hasOwnProperty("subscriberKey")) - if (!$util.isString(message.subscriberKey)) - return "subscriberKey: string expected"; - return null; - }; - - /** - * Creates a RoutingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig - */ - RoutingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig) - return object; - var message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig(); - if (object.subscriberKey != null) - message.subscriberKey = String(object.subscriberKey); - return message; - }; - - /** - * Creates a plain object from a RoutingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig - * @static - * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig} message RoutingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RoutingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.subscriberKey = ""; - if (message.subscriberKey != null && message.hasOwnProperty("subscriberKey")) - object.subscriberKey = message.subscriberKey; - return object; - }; - - /** - * Converts this RoutingConfig to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig - * @instance - * @returns {Object.} JSON object - */ - RoutingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RoutingConfig - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RoutingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig"; - }; - - return RoutingConfig; - })(); - - return OmnichannelIntegrationConfig; - })(); - - v1beta.OmnichannelOperationMetadata = (function() { - - /** - * Properties of an OmnichannelOperationMetadata. - * @memberof google.cloud.ces.v1beta - * @interface IOmnichannelOperationMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OmnichannelOperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OmnichannelOperationMetadata endTime - * @property {string|null} [statusMessage] OmnichannelOperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OmnichannelOperationMetadata requestedCancellation - */ - - /** - * Constructs a new OmnichannelOperationMetadata. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an OmnichannelOperationMetadata. - * @implements IOmnichannelOperationMetadata - * @constructor - * @param {google.cloud.ces.v1beta.IOmnichannelOperationMetadata=} [properties] Properties to set - */ - function OmnichannelOperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OmnichannelOperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata - * @instance - */ - OmnichannelOperationMetadata.prototype.createTime = null; - - /** - * OmnichannelOperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata - * @instance - */ - OmnichannelOperationMetadata.prototype.endTime = null; - - /** - * OmnichannelOperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata - * @instance - */ - OmnichannelOperationMetadata.prototype.statusMessage = ""; - - /** - * OmnichannelOperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata - * @instance - */ - OmnichannelOperationMetadata.prototype.requestedCancellation = false; - - /** - * Creates a new OmnichannelOperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.IOmnichannelOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.OmnichannelOperationMetadata} OmnichannelOperationMetadata instance - */ - OmnichannelOperationMetadata.create = function create(properties) { - return new OmnichannelOperationMetadata(properties); - }; - - /** - * Encodes the specified OmnichannelOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.IOmnichannelOperationMetadata} message OmnichannelOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OmnichannelOperationMetadata.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.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.requestedCancellation); - return writer; - }; - - /** - * Encodes the specified OmnichannelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.IOmnichannelOperationMetadata} message OmnichannelOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OmnichannelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.OmnichannelOperationMetadata} OmnichannelOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OmnichannelOperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelOperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - 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.statusMessage = reader.string(); - break; - } - case 4: { - message.requestedCancellation = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.OmnichannelOperationMetadata} OmnichannelOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OmnichannelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OmnichannelOperationMetadata message. - * @function verify - * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OmnichannelOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - 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.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"; - return null; - }; - - /** - * Creates an OmnichannelOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.OmnichannelOperationMetadata} OmnichannelOperationMetadata - */ - OmnichannelOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelOperationMetadata) - return object; - var message = new $root.google.cloud.ces.v1beta.OmnichannelOperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.OmnichannelOperationMetadata.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.ces.v1beta.OmnichannelOperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - return message; - }; - - /** - * Creates a plain object from an OmnichannelOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata - * @static - * @param {google.cloud.ces.v1beta.OmnichannelOperationMetadata} message OmnichannelOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OmnichannelOperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.statusMessage = ""; - object.requestedCancellation = false; - } - 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.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - return object; - }; - - /** - * Converts this OmnichannelOperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata - * @instance - * @returns {Object.} JSON object - */ - OmnichannelOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OmnichannelOperationMetadata - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OmnichannelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelOperationMetadata"; - }; - - return OmnichannelOperationMetadata; - })(); - - v1beta.ToolService = (function() { - - /** - * Constructs a new ToolService service. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a ToolService - * @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 ToolService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (ToolService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ToolService; - - /** - * Creates new ToolService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.ces.v1beta.ToolService - * @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 {ToolService} RPC service. Useful where requests and/or responses are streamed. - */ - ToolService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.ToolService|executeTool}. - * @memberof google.cloud.ces.v1beta.ToolService - * @typedef ExecuteToolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.ExecuteToolResponse} [response] ExecuteToolResponse - */ - - /** - * Calls ExecuteTool. - * @function executeTool - * @memberof google.cloud.ces.v1beta.ToolService - * @instance - * @param {google.cloud.ces.v1beta.IExecuteToolRequest} request ExecuteToolRequest message or plain object - * @param {google.cloud.ces.v1beta.ToolService.ExecuteToolCallback} callback Node-style callback called with the error, if any, and ExecuteToolResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ToolService.prototype.executeTool = function executeTool(request, callback) { - return this.rpcCall(executeTool, $root.google.cloud.ces.v1beta.ExecuteToolRequest, $root.google.cloud.ces.v1beta.ExecuteToolResponse, request, callback); - }, "name", { value: "ExecuteTool" }); - - /** - * Calls ExecuteTool. - * @function executeTool - * @memberof google.cloud.ces.v1beta.ToolService - * @instance - * @param {google.cloud.ces.v1beta.IExecuteToolRequest} request ExecuteToolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.ToolService|retrieveToolSchema}. - * @memberof google.cloud.ces.v1beta.ToolService - * @typedef RetrieveToolSchemaCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.RetrieveToolSchemaResponse} [response] RetrieveToolSchemaResponse - */ - - /** - * Calls RetrieveToolSchema. - * @function retrieveToolSchema - * @memberof google.cloud.ces.v1beta.ToolService - * @instance - * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaRequest} request RetrieveToolSchemaRequest message or plain object - * @param {google.cloud.ces.v1beta.ToolService.RetrieveToolSchemaCallback} callback Node-style callback called with the error, if any, and RetrieveToolSchemaResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ToolService.prototype.retrieveToolSchema = function retrieveToolSchema(request, callback) { - return this.rpcCall(retrieveToolSchema, $root.google.cloud.ces.v1beta.RetrieveToolSchemaRequest, $root.google.cloud.ces.v1beta.RetrieveToolSchemaResponse, request, callback); - }, "name", { value: "RetrieveToolSchema" }); - - /** - * Calls RetrieveToolSchema. - * @function retrieveToolSchema - * @memberof google.cloud.ces.v1beta.ToolService - * @instance - * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaRequest} request RetrieveToolSchemaRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.ces.v1beta.ToolService|retrieveTools}. - * @memberof google.cloud.ces.v1beta.ToolService - * @typedef RetrieveToolsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.RetrieveToolsResponse} [response] RetrieveToolsResponse - */ - - /** - * Calls RetrieveTools. - * @function retrieveTools - * @memberof google.cloud.ces.v1beta.ToolService - * @instance - * @param {google.cloud.ces.v1beta.IRetrieveToolsRequest} request RetrieveToolsRequest message or plain object - * @param {google.cloud.ces.v1beta.ToolService.RetrieveToolsCallback} callback Node-style callback called with the error, if any, and RetrieveToolsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ToolService.prototype.retrieveTools = function retrieveTools(request, callback) { - return this.rpcCall(retrieveTools, $root.google.cloud.ces.v1beta.RetrieveToolsRequest, $root.google.cloud.ces.v1beta.RetrieveToolsResponse, request, callback); - }, "name", { value: "RetrieveTools" }); - - /** - * Calls RetrieveTools. - * @function retrieveTools - * @memberof google.cloud.ces.v1beta.ToolService - * @instance - * @param {google.cloud.ces.v1beta.IRetrieveToolsRequest} request RetrieveToolsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return ToolService; - })(); - - v1beta.ExecuteToolRequest = (function() { - - /** - * Properties of an ExecuteToolRequest. - * @memberof google.cloud.ces.v1beta - * @interface IExecuteToolRequest - * @property {string|null} [tool] ExecuteToolRequest tool - * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] ExecuteToolRequest toolsetTool - * @property {string|null} [parent] ExecuteToolRequest parent - * @property {google.protobuf.IStruct|null} [args] ExecuteToolRequest args - * @property {google.protobuf.IStruct|null} [variables] ExecuteToolRequest variables - */ - - /** - * Constructs a new ExecuteToolRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an ExecuteToolRequest. - * @implements IExecuteToolRequest - * @constructor - * @param {google.cloud.ces.v1beta.IExecuteToolRequest=} [properties] Properties to set - */ - function ExecuteToolRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteToolRequest tool. - * @member {string|null|undefined} tool - * @memberof google.cloud.ces.v1beta.ExecuteToolRequest - * @instance - */ - ExecuteToolRequest.prototype.tool = null; - - /** - * ExecuteToolRequest toolsetTool. - * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool - * @memberof google.cloud.ces.v1beta.ExecuteToolRequest - * @instance - */ - ExecuteToolRequest.prototype.toolsetTool = null; - - /** - * ExecuteToolRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.ExecuteToolRequest - * @instance - */ - ExecuteToolRequest.prototype.parent = ""; - - /** - * ExecuteToolRequest args. - * @member {google.protobuf.IStruct|null|undefined} args - * @memberof google.cloud.ces.v1beta.ExecuteToolRequest - * @instance - */ - ExecuteToolRequest.prototype.args = null; - - /** - * ExecuteToolRequest variables. - * @member {google.protobuf.IStruct|null|undefined} variables - * @memberof google.cloud.ces.v1beta.ExecuteToolRequest - * @instance - */ - ExecuteToolRequest.prototype.variables = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ExecuteToolRequest toolIdentifier. - * @member {"tool"|"toolsetTool"|undefined} toolIdentifier - * @memberof google.cloud.ces.v1beta.ExecuteToolRequest - * @instance - */ - Object.defineProperty(ExecuteToolRequest.prototype, "toolIdentifier", { - get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExecuteToolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ExecuteToolRequest - * @static - * @param {google.cloud.ces.v1beta.IExecuteToolRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ExecuteToolRequest} ExecuteToolRequest instance - */ - ExecuteToolRequest.create = function create(properties) { - return new ExecuteToolRequest(properties); - }; - - /** - * Encodes the specified ExecuteToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ExecuteToolRequest - * @static - * @param {google.cloud.ces.v1beta.IExecuteToolRequest} message ExecuteToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteToolRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); - if (message.args != null && Object.hasOwnProperty.call(message, "args")) - $root.google.protobuf.Struct.encode(message.args, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) - $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); - if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) - $root.google.protobuf.Struct.encode(message.variables, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExecuteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ExecuteToolRequest - * @static - * @param {google.cloud.ces.v1beta.IExecuteToolRequest} message ExecuteToolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteToolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteToolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ExecuteToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ExecuteToolRequest} ExecuteToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteToolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ExecuteToolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tool = reader.string(); - break; - } - case 3: { - message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); - break; - } - case 4: { - message.parent = reader.string(); - break; - } - case 2: { - message.args = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 5: { - message.variables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteToolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ExecuteToolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ExecuteToolRequest} ExecuteToolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteToolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteToolRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.ExecuteToolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteToolRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tool != null && message.hasOwnProperty("tool")) { - properties.toolIdentifier = 1; - if (!$util.isString(message.tool)) - return "tool: string expected"; - } - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - if (properties.toolIdentifier === 1) - return "toolIdentifier: multiple values"; - properties.toolIdentifier = 1; - { - var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); - if (error) - return "toolsetTool." + error; - } - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.args != null && message.hasOwnProperty("args")) { - var error = $root.google.protobuf.Struct.verify(message.args); - if (error) - return "args." + error; - } - if (message.variables != null && message.hasOwnProperty("variables")) { - var error = $root.google.protobuf.Struct.verify(message.variables); - if (error) - return "variables." + error; - } - return null; - }; - - /** - * Creates an ExecuteToolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ExecuteToolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ExecuteToolRequest} ExecuteToolRequest - */ - ExecuteToolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ExecuteToolRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.ExecuteToolRequest(); - if (object.tool != null) - message.tool = String(object.tool); - if (object.toolsetTool != null) { - if (typeof object.toolsetTool !== "object") - throw TypeError(".google.cloud.ces.v1beta.ExecuteToolRequest.toolsetTool: object expected"); - message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); - } - if (object.parent != null) - message.parent = String(object.parent); - if (object.args != null) { - if (typeof object.args !== "object") - throw TypeError(".google.cloud.ces.v1beta.ExecuteToolRequest.args: object expected"); - message.args = $root.google.protobuf.Struct.fromObject(object.args); - } - if (object.variables != null) { - if (typeof object.variables !== "object") - throw TypeError(".google.cloud.ces.v1beta.ExecuteToolRequest.variables: object expected"); - message.variables = $root.google.protobuf.Struct.fromObject(object.variables); - } - return message; - }; - - /** - * Creates a plain object from an ExecuteToolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ExecuteToolRequest - * @static - * @param {google.cloud.ces.v1beta.ExecuteToolRequest} message ExecuteToolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteToolRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.args = null; - object.parent = ""; - object.variables = null; - } - if (message.tool != null && message.hasOwnProperty("tool")) { - object.tool = message.tool; - if (options.oneofs) - object.toolIdentifier = "tool"; - } - if (message.args != null && message.hasOwnProperty("args")) - object.args = $root.google.protobuf.Struct.toObject(message.args, options); - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); - if (options.oneofs) - object.toolIdentifier = "toolsetTool"; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.variables != null && message.hasOwnProperty("variables")) - object.variables = $root.google.protobuf.Struct.toObject(message.variables, options); - return object; - }; - - /** - * Converts this ExecuteToolRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ExecuteToolRequest - * @instance - * @returns {Object.} JSON object - */ - ExecuteToolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteToolRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ExecuteToolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ExecuteToolRequest"; - }; - - return ExecuteToolRequest; - })(); - - v1beta.ExecuteToolResponse = (function() { - - /** - * Properties of an ExecuteToolResponse. - * @memberof google.cloud.ces.v1beta - * @interface IExecuteToolResponse - * @property {string|null} [tool] ExecuteToolResponse tool - * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] ExecuteToolResponse toolsetTool - * @property {google.protobuf.IStruct|null} [response] ExecuteToolResponse response - * @property {google.protobuf.IStruct|null} [variables] ExecuteToolResponse variables - */ - - /** - * Constructs a new ExecuteToolResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents an ExecuteToolResponse. - * @implements IExecuteToolResponse - * @constructor - * @param {google.cloud.ces.v1beta.IExecuteToolResponse=} [properties] Properties to set - */ - function ExecuteToolResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteToolResponse tool. - * @member {string|null|undefined} tool - * @memberof google.cloud.ces.v1beta.ExecuteToolResponse - * @instance - */ - ExecuteToolResponse.prototype.tool = null; - - /** - * ExecuteToolResponse toolsetTool. - * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool - * @memberof google.cloud.ces.v1beta.ExecuteToolResponse - * @instance - */ - ExecuteToolResponse.prototype.toolsetTool = null; - - /** - * ExecuteToolResponse response. - * @member {google.protobuf.IStruct|null|undefined} response - * @memberof google.cloud.ces.v1beta.ExecuteToolResponse - * @instance - */ - ExecuteToolResponse.prototype.response = null; - - /** - * ExecuteToolResponse variables. - * @member {google.protobuf.IStruct|null|undefined} variables - * @memberof google.cloud.ces.v1beta.ExecuteToolResponse - * @instance - */ - ExecuteToolResponse.prototype.variables = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ExecuteToolResponse toolIdentifier. - * @member {"tool"|"toolsetTool"|undefined} toolIdentifier - * @memberof google.cloud.ces.v1beta.ExecuteToolResponse - * @instance - */ - Object.defineProperty(ExecuteToolResponse.prototype, "toolIdentifier", { - get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExecuteToolResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.ExecuteToolResponse - * @static - * @param {google.cloud.ces.v1beta.IExecuteToolResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.ExecuteToolResponse} ExecuteToolResponse instance - */ - ExecuteToolResponse.create = function create(properties) { - return new ExecuteToolResponse(properties); - }; - - /** - * Encodes the specified ExecuteToolResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.ExecuteToolResponse - * @static - * @param {google.cloud.ces.v1beta.IExecuteToolResponse} message ExecuteToolResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteToolResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Struct.encode(message.response, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) - $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) - $root.google.protobuf.Struct.encode(message.variables, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExecuteToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.ExecuteToolResponse - * @static - * @param {google.cloud.ces.v1beta.IExecuteToolResponse} message ExecuteToolResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteToolResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteToolResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.ExecuteToolResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.ExecuteToolResponse} ExecuteToolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteToolResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ExecuteToolResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tool = reader.string(); - break; - } - case 3: { - message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); - break; - } - case 2: { - message.response = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 4: { - message.variables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteToolResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.ExecuteToolResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.ExecuteToolResponse} ExecuteToolResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteToolResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteToolResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.ExecuteToolResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteToolResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tool != null && message.hasOwnProperty("tool")) { - properties.toolIdentifier = 1; - if (!$util.isString(message.tool)) - return "tool: string expected"; - } - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - if (properties.toolIdentifier === 1) - return "toolIdentifier: multiple values"; - properties.toolIdentifier = 1; - { - var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); - if (error) - return "toolsetTool." + error; - } - } - if (message.response != null && message.hasOwnProperty("response")) { - var error = $root.google.protobuf.Struct.verify(message.response); - if (error) - return "response." + error; - } - if (message.variables != null && message.hasOwnProperty("variables")) { - var error = $root.google.protobuf.Struct.verify(message.variables); - if (error) - return "variables." + error; - } - return null; - }; - - /** - * Creates an ExecuteToolResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.ExecuteToolResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.ExecuteToolResponse} ExecuteToolResponse - */ - ExecuteToolResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.ExecuteToolResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.ExecuteToolResponse(); - if (object.tool != null) - message.tool = String(object.tool); - if (object.toolsetTool != null) { - if (typeof object.toolsetTool !== "object") - throw TypeError(".google.cloud.ces.v1beta.ExecuteToolResponse.toolsetTool: object expected"); - message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.cloud.ces.v1beta.ExecuteToolResponse.response: object expected"); - message.response = $root.google.protobuf.Struct.fromObject(object.response); - } - if (object.variables != null) { - if (typeof object.variables !== "object") - throw TypeError(".google.cloud.ces.v1beta.ExecuteToolResponse.variables: object expected"); - message.variables = $root.google.protobuf.Struct.fromObject(object.variables); - } - return message; - }; - - /** - * Creates a plain object from an ExecuteToolResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.ExecuteToolResponse - * @static - * @param {google.cloud.ces.v1beta.ExecuteToolResponse} message ExecuteToolResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteToolResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.response = null; - object.variables = null; - } - if (message.tool != null && message.hasOwnProperty("tool")) { - object.tool = message.tool; - if (options.oneofs) - object.toolIdentifier = "tool"; - } - if (message.response != null && message.hasOwnProperty("response")) - object.response = $root.google.protobuf.Struct.toObject(message.response, options); - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); - if (options.oneofs) - object.toolIdentifier = "toolsetTool"; - } - if (message.variables != null && message.hasOwnProperty("variables")) - object.variables = $root.google.protobuf.Struct.toObject(message.variables, options); - return object; - }; - - /** - * Converts this ExecuteToolResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.ExecuteToolResponse - * @instance - * @returns {Object.} JSON object - */ - ExecuteToolResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteToolResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.ExecuteToolResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteToolResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.ExecuteToolResponse"; - }; - - return ExecuteToolResponse; - })(); - - v1beta.RetrieveToolSchemaRequest = (function() { - - /** - * Properties of a RetrieveToolSchemaRequest. - * @memberof google.cloud.ces.v1beta - * @interface IRetrieveToolSchemaRequest - * @property {string|null} [tool] RetrieveToolSchemaRequest tool - * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] RetrieveToolSchemaRequest toolsetTool - * @property {string|null} [parent] RetrieveToolSchemaRequest parent - */ - - /** - * Constructs a new RetrieveToolSchemaRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a RetrieveToolSchemaRequest. - * @implements IRetrieveToolSchemaRequest - * @constructor - * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaRequest=} [properties] Properties to set - */ - function RetrieveToolSchemaRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RetrieveToolSchemaRequest tool. - * @member {string|null|undefined} tool - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest - * @instance - */ - RetrieveToolSchemaRequest.prototype.tool = null; - - /** - * RetrieveToolSchemaRequest toolsetTool. - * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest - * @instance - */ - RetrieveToolSchemaRequest.prototype.toolsetTool = null; - - /** - * RetrieveToolSchemaRequest parent. - * @member {string} parent - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest - * @instance - */ - RetrieveToolSchemaRequest.prototype.parent = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RetrieveToolSchemaRequest toolIdentifier. - * @member {"tool"|"toolsetTool"|undefined} toolIdentifier - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest - * @instance - */ - Object.defineProperty(RetrieveToolSchemaRequest.prototype, "toolIdentifier", { - get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RetrieveToolSchemaRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest - * @static - * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest instance - */ - RetrieveToolSchemaRequest.create = function create(properties) { - return new RetrieveToolSchemaRequest(properties); - }; - - /** - * Encodes the specified RetrieveToolSchemaRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest - * @static - * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaRequest} message RetrieveToolSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveToolSchemaRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); - if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) - $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); - return writer; - }; - - /** - * Encodes the specified RetrieveToolSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest - * @static - * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaRequest} message RetrieveToolSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveToolSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveToolSchemaRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RetrieveToolSchemaRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tool = reader.string(); - break; - } - case 2: { - message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); - break; - } - case 3: { - message.parent = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveToolSchemaRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RetrieveToolSchemaRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RetrieveToolSchemaRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tool != null && message.hasOwnProperty("tool")) { - properties.toolIdentifier = 1; - if (!$util.isString(message.tool)) - return "tool: string expected"; - } - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - if (properties.toolIdentifier === 1) - return "toolIdentifier: multiple values"; - properties.toolIdentifier = 1; - { - var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); - if (error) - return "toolsetTool." + error; - } - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - return null; - }; - - /** - * Creates a RetrieveToolSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest - */ - RetrieveToolSchemaRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.RetrieveToolSchemaRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.RetrieveToolSchemaRequest(); - if (object.tool != null) - message.tool = String(object.tool); - if (object.toolsetTool != null) { - if (typeof object.toolsetTool !== "object") - throw TypeError(".google.cloud.ces.v1beta.RetrieveToolSchemaRequest.toolsetTool: object expected"); - message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); - } - if (object.parent != null) - message.parent = String(object.parent); - return message; - }; - - /** - * Creates a plain object from a RetrieveToolSchemaRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest - * @static - * @param {google.cloud.ces.v1beta.RetrieveToolSchemaRequest} message RetrieveToolSchemaRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RetrieveToolSchemaRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.parent = ""; - if (message.tool != null && message.hasOwnProperty("tool")) { - object.tool = message.tool; - if (options.oneofs) - object.toolIdentifier = "tool"; - } - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); - if (options.oneofs) - object.toolIdentifier = "toolsetTool"; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - return object; - }; - - /** - * Converts this RetrieveToolSchemaRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest - * @instance - * @returns {Object.} JSON object - */ - RetrieveToolSchemaRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RetrieveToolSchemaRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RetrieveToolSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.RetrieveToolSchemaRequest"; - }; - - return RetrieveToolSchemaRequest; - })(); - - v1beta.RetrieveToolSchemaResponse = (function() { - - /** - * Properties of a RetrieveToolSchemaResponse. - * @memberof google.cloud.ces.v1beta - * @interface IRetrieveToolSchemaResponse - * @property {string|null} [tool] RetrieveToolSchemaResponse tool - * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] RetrieveToolSchemaResponse toolsetTool - * @property {google.cloud.ces.v1beta.ISchema|null} [inputSchema] RetrieveToolSchemaResponse inputSchema - * @property {google.cloud.ces.v1beta.ISchema|null} [outputSchema] RetrieveToolSchemaResponse outputSchema - */ - - /** - * Constructs a new RetrieveToolSchemaResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a RetrieveToolSchemaResponse. - * @implements IRetrieveToolSchemaResponse - * @constructor - * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaResponse=} [properties] Properties to set - */ - function RetrieveToolSchemaResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RetrieveToolSchemaResponse tool. - * @member {string|null|undefined} tool - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse - * @instance - */ - RetrieveToolSchemaResponse.prototype.tool = null; - - /** - * RetrieveToolSchemaResponse toolsetTool. - * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse - * @instance - */ - RetrieveToolSchemaResponse.prototype.toolsetTool = null; - - /** - * RetrieveToolSchemaResponse inputSchema. - * @member {google.cloud.ces.v1beta.ISchema|null|undefined} inputSchema - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse - * @instance - */ - RetrieveToolSchemaResponse.prototype.inputSchema = null; - - /** - * RetrieveToolSchemaResponse outputSchema. - * @member {google.cloud.ces.v1beta.ISchema|null|undefined} outputSchema - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse - * @instance - */ - RetrieveToolSchemaResponse.prototype.outputSchema = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RetrieveToolSchemaResponse toolIdentifier. - * @member {"tool"|"toolsetTool"|undefined} toolIdentifier - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse - * @instance - */ - Object.defineProperty(RetrieveToolSchemaResponse.prototype, "toolIdentifier", { - get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RetrieveToolSchemaResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse - * @static - * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse instance - */ - RetrieveToolSchemaResponse.create = function create(properties) { - return new RetrieveToolSchemaResponse(properties); - }; - - /** - * Encodes the specified RetrieveToolSchemaResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse - * @static - * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaResponse} message RetrieveToolSchemaResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveToolSchemaResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); - if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) - $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.inputSchema != null && Object.hasOwnProperty.call(message, "inputSchema")) - $root.google.cloud.ces.v1beta.Schema.encode(message.inputSchema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.outputSchema != null && Object.hasOwnProperty.call(message, "outputSchema")) - $root.google.cloud.ces.v1beta.Schema.encode(message.outputSchema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RetrieveToolSchemaResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse - * @static - * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaResponse} message RetrieveToolSchemaResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveToolSchemaResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveToolSchemaResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RetrieveToolSchemaResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.tool = reader.string(); - break; - } - case 2: { - message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); - break; - } - case 3: { - message.inputSchema = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); - break; - } - case 4: { - message.outputSchema = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveToolSchemaResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RetrieveToolSchemaResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RetrieveToolSchemaResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tool != null && message.hasOwnProperty("tool")) { - properties.toolIdentifier = 1; - if (!$util.isString(message.tool)) - return "tool: string expected"; - } - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - if (properties.toolIdentifier === 1) - return "toolIdentifier: multiple values"; - properties.toolIdentifier = 1; - { - var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); - if (error) - return "toolsetTool." + error; - } - } - if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) { - var error = $root.google.cloud.ces.v1beta.Schema.verify(message.inputSchema); - if (error) - return "inputSchema." + error; - } - if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) { - var error = $root.google.cloud.ces.v1beta.Schema.verify(message.outputSchema); - if (error) - return "outputSchema." + error; - } - return null; - }; - - /** - * Creates a RetrieveToolSchemaResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse - */ - RetrieveToolSchemaResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.RetrieveToolSchemaResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.RetrieveToolSchemaResponse(); - if (object.tool != null) - message.tool = String(object.tool); - if (object.toolsetTool != null) { - if (typeof object.toolsetTool !== "object") - throw TypeError(".google.cloud.ces.v1beta.RetrieveToolSchemaResponse.toolsetTool: object expected"); - message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); - } - if (object.inputSchema != null) { - if (typeof object.inputSchema !== "object") - throw TypeError(".google.cloud.ces.v1beta.RetrieveToolSchemaResponse.inputSchema: object expected"); - message.inputSchema = $root.google.cloud.ces.v1beta.Schema.fromObject(object.inputSchema); - } - if (object.outputSchema != null) { - if (typeof object.outputSchema !== "object") - throw TypeError(".google.cloud.ces.v1beta.RetrieveToolSchemaResponse.outputSchema: object expected"); - message.outputSchema = $root.google.cloud.ces.v1beta.Schema.fromObject(object.outputSchema); - } - return message; - }; - - /** - * Creates a plain object from a RetrieveToolSchemaResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse - * @static - * @param {google.cloud.ces.v1beta.RetrieveToolSchemaResponse} message RetrieveToolSchemaResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RetrieveToolSchemaResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.inputSchema = null; - object.outputSchema = null; - } - if (message.tool != null && message.hasOwnProperty("tool")) { - object.tool = message.tool; - if (options.oneofs) - object.toolIdentifier = "tool"; - } - if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { - object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); - if (options.oneofs) - object.toolIdentifier = "toolsetTool"; - } - if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) - object.inputSchema = $root.google.cloud.ces.v1beta.Schema.toObject(message.inputSchema, options); - if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) - object.outputSchema = $root.google.cloud.ces.v1beta.Schema.toObject(message.outputSchema, options); - return object; - }; - - /** - * Converts this RetrieveToolSchemaResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse - * @instance - * @returns {Object.} JSON object - */ - RetrieveToolSchemaResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RetrieveToolSchemaResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RetrieveToolSchemaResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.RetrieveToolSchemaResponse"; - }; - - return RetrieveToolSchemaResponse; - })(); - - v1beta.RetrieveToolsRequest = (function() { - - /** - * Properties of a RetrieveToolsRequest. - * @memberof google.cloud.ces.v1beta - * @interface IRetrieveToolsRequest - * @property {string|null} [toolset] RetrieveToolsRequest toolset - * @property {Array.|null} [toolIds] RetrieveToolsRequest toolIds - */ - - /** - * Constructs a new RetrieveToolsRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a RetrieveToolsRequest. - * @implements IRetrieveToolsRequest - * @constructor - * @param {google.cloud.ces.v1beta.IRetrieveToolsRequest=} [properties] Properties to set - */ - function RetrieveToolsRequest(properties) { - this.toolIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RetrieveToolsRequest toolset. - * @member {string} toolset - * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest - * @instance - */ - RetrieveToolsRequest.prototype.toolset = ""; - - /** - * RetrieveToolsRequest toolIds. - * @member {Array.} toolIds - * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest - * @instance - */ - RetrieveToolsRequest.prototype.toolIds = $util.emptyArray; - - /** - * Creates a new RetrieveToolsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest - * @static - * @param {google.cloud.ces.v1beta.IRetrieveToolsRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.RetrieveToolsRequest} RetrieveToolsRequest instance - */ - RetrieveToolsRequest.create = function create(properties) { - return new RetrieveToolsRequest(properties); - }; - - /** - * Encodes the specified RetrieveToolsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest - * @static - * @param {google.cloud.ces.v1beta.IRetrieveToolsRequest} message RetrieveToolsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveToolsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.toolset); - if (message.toolIds != null && message.toolIds.length) - for (var i = 0; i < message.toolIds.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.toolIds[i]); - return writer; - }; - - /** - * Encodes the specified RetrieveToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest - * @static - * @param {google.cloud.ces.v1beta.IRetrieveToolsRequest} message RetrieveToolsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveToolsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RetrieveToolsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.RetrieveToolsRequest} RetrieveToolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveToolsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RetrieveToolsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.toolset = reader.string(); - break; - } - case 3: { - if (!(message.toolIds && message.toolIds.length)) - message.toolIds = []; - message.toolIds.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RetrieveToolsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.RetrieveToolsRequest} RetrieveToolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveToolsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RetrieveToolsRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RetrieveToolsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.toolset != null && message.hasOwnProperty("toolset")) - if (!$util.isString(message.toolset)) - return "toolset: string expected"; - if (message.toolIds != null && message.hasOwnProperty("toolIds")) { - if (!Array.isArray(message.toolIds)) - return "toolIds: array expected"; - for (var i = 0; i < message.toolIds.length; ++i) - if (!$util.isString(message.toolIds[i])) - return "toolIds: string[] expected"; - } - return null; - }; - - /** - * Creates a RetrieveToolsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.RetrieveToolsRequest} RetrieveToolsRequest - */ - RetrieveToolsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.RetrieveToolsRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.RetrieveToolsRequest(); - if (object.toolset != null) - message.toolset = String(object.toolset); - if (object.toolIds) { - if (!Array.isArray(object.toolIds)) - throw TypeError(".google.cloud.ces.v1beta.RetrieveToolsRequest.toolIds: array expected"); - message.toolIds = []; - for (var i = 0; i < object.toolIds.length; ++i) - message.toolIds[i] = String(object.toolIds[i]); - } - return message; - }; - - /** - * Creates a plain object from a RetrieveToolsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest - * @static - * @param {google.cloud.ces.v1beta.RetrieveToolsRequest} message RetrieveToolsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RetrieveToolsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.toolIds = []; - if (options.defaults) - object.toolset = ""; - if (message.toolset != null && message.hasOwnProperty("toolset")) - object.toolset = message.toolset; - if (message.toolIds && message.toolIds.length) { - object.toolIds = []; - for (var j = 0; j < message.toolIds.length; ++j) - object.toolIds[j] = message.toolIds[j]; - } - return object; - }; - - /** - * Converts this RetrieveToolsRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest - * @instance - * @returns {Object.} JSON object - */ - RetrieveToolsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RetrieveToolsRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RetrieveToolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.RetrieveToolsRequest"; - }; - - return RetrieveToolsRequest; - })(); - - v1beta.RetrieveToolsResponse = (function() { - - /** - * Properties of a RetrieveToolsResponse. - * @memberof google.cloud.ces.v1beta - * @interface IRetrieveToolsResponse - * @property {Array.|null} [tools] RetrieveToolsResponse tools - */ - - /** - * Constructs a new RetrieveToolsResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a RetrieveToolsResponse. - * @implements IRetrieveToolsResponse - * @constructor - * @param {google.cloud.ces.v1beta.IRetrieveToolsResponse=} [properties] Properties to set - */ - function RetrieveToolsResponse(properties) { - this.tools = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RetrieveToolsResponse tools. - * @member {Array.} tools - * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse - * @instance - */ - RetrieveToolsResponse.prototype.tools = $util.emptyArray; - - /** - * Creates a new RetrieveToolsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse - * @static - * @param {google.cloud.ces.v1beta.IRetrieveToolsResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.RetrieveToolsResponse} RetrieveToolsResponse instance - */ - RetrieveToolsResponse.create = function create(properties) { - return new RetrieveToolsResponse(properties); - }; - - /** - * Encodes the specified RetrieveToolsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse - * @static - * @param {google.cloud.ces.v1beta.IRetrieveToolsResponse} message RetrieveToolsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveToolsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tools != null && message.tools.length) - for (var i = 0; i < message.tools.length; ++i) - $root.google.cloud.ces.v1beta.Tool.encode(message.tools[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RetrieveToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse - * @static - * @param {google.cloud.ces.v1beta.IRetrieveToolsResponse} message RetrieveToolsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveToolsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RetrieveToolsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.RetrieveToolsResponse} RetrieveToolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveToolsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RetrieveToolsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.tools && message.tools.length)) - message.tools = []; - message.tools.push($root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RetrieveToolsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.RetrieveToolsResponse} RetrieveToolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveToolsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RetrieveToolsResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RetrieveToolsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tools != null && message.hasOwnProperty("tools")) { - if (!Array.isArray(message.tools)) - return "tools: array expected"; - for (var i = 0; i < message.tools.length; ++i) { - var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tools[i]); - if (error) - return "tools." + error; - } - } - return null; - }; - - /** - * Creates a RetrieveToolsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.RetrieveToolsResponse} RetrieveToolsResponse - */ - RetrieveToolsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.RetrieveToolsResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.RetrieveToolsResponse(); - if (object.tools) { - if (!Array.isArray(object.tools)) - throw TypeError(".google.cloud.ces.v1beta.RetrieveToolsResponse.tools: array expected"); - message.tools = []; - for (var i = 0; i < object.tools.length; ++i) { - if (typeof object.tools[i] !== "object") - throw TypeError(".google.cloud.ces.v1beta.RetrieveToolsResponse.tools: object expected"); - message.tools[i] = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tools[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RetrieveToolsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse - * @static - * @param {google.cloud.ces.v1beta.RetrieveToolsResponse} message RetrieveToolsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RetrieveToolsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tools = []; - if (message.tools && message.tools.length) { - object.tools = []; - for (var j = 0; j < message.tools.length; ++j) - object.tools[j] = $root.google.cloud.ces.v1beta.Tool.toObject(message.tools[j], options); - } - return object; - }; - - /** - * Converts this RetrieveToolsResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse - * @instance - * @returns {Object.} JSON object - */ - RetrieveToolsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RetrieveToolsResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RetrieveToolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.RetrieveToolsResponse"; - }; - - return RetrieveToolsResponse; - })(); - - v1beta.WidgetService = (function() { - - /** - * Constructs a new WidgetService service. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a WidgetService - * @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 WidgetService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (WidgetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WidgetService; - - /** - * Creates new WidgetService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.ces.v1beta.WidgetService - * @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 {WidgetService} RPC service. Useful where requests and/or responses are streamed. - */ - WidgetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.ces.v1beta.WidgetService|generateChatToken}. - * @memberof google.cloud.ces.v1beta.WidgetService - * @typedef GenerateChatTokenCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.ces.v1beta.GenerateChatTokenResponse} [response] GenerateChatTokenResponse - */ - - /** - * Calls GenerateChatToken. - * @function generateChatToken - * @memberof google.cloud.ces.v1beta.WidgetService - * @instance - * @param {google.cloud.ces.v1beta.IGenerateChatTokenRequest} request GenerateChatTokenRequest message or plain object - * @param {google.cloud.ces.v1beta.WidgetService.GenerateChatTokenCallback} callback Node-style callback called with the error, if any, and GenerateChatTokenResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WidgetService.prototype.generateChatToken = function generateChatToken(request, callback) { - return this.rpcCall(generateChatToken, $root.google.cloud.ces.v1beta.GenerateChatTokenRequest, $root.google.cloud.ces.v1beta.GenerateChatTokenResponse, request, callback); - }, "name", { value: "GenerateChatToken" }); - - /** - * Calls GenerateChatToken. - * @function generateChatToken - * @memberof google.cloud.ces.v1beta.WidgetService - * @instance - * @param {google.cloud.ces.v1beta.IGenerateChatTokenRequest} request GenerateChatTokenRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return WidgetService; - })(); - - v1beta.GenerateChatTokenRequest = (function() { - - /** - * Properties of a GenerateChatTokenRequest. - * @memberof google.cloud.ces.v1beta - * @interface IGenerateChatTokenRequest - * @property {string|null} [name] GenerateChatTokenRequest name - * @property {string|null} [deployment] GenerateChatTokenRequest deployment - * @property {string|null} [recaptchaToken] GenerateChatTokenRequest recaptchaToken - */ - - /** - * Constructs a new GenerateChatTokenRequest. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GenerateChatTokenRequest. - * @implements IGenerateChatTokenRequest - * @constructor - * @param {google.cloud.ces.v1beta.IGenerateChatTokenRequest=} [properties] Properties to set - */ - function GenerateChatTokenRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenerateChatTokenRequest name. - * @member {string} name - * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest - * @instance - */ - GenerateChatTokenRequest.prototype.name = ""; - - /** - * GenerateChatTokenRequest deployment. - * @member {string} deployment - * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest - * @instance - */ - GenerateChatTokenRequest.prototype.deployment = ""; - - /** - * GenerateChatTokenRequest recaptchaToken. - * @member {string} recaptchaToken - * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest - * @instance - */ - GenerateChatTokenRequest.prototype.recaptchaToken = ""; - - /** - * Creates a new GenerateChatTokenRequest instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest - * @static - * @param {google.cloud.ces.v1beta.IGenerateChatTokenRequest=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GenerateChatTokenRequest} GenerateChatTokenRequest instance - */ - GenerateChatTokenRequest.create = function create(properties) { - return new GenerateChatTokenRequest(properties); - }; - - /** - * Encodes the specified GenerateChatTokenRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest - * @static - * @param {google.cloud.ces.v1beta.IGenerateChatTokenRequest} message GenerateChatTokenRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateChatTokenRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.deployment); - if (message.recaptchaToken != null && Object.hasOwnProperty.call(message, "recaptchaToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.recaptchaToken); - return writer; - }; - - /** - * Encodes the specified GenerateChatTokenRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest - * @static - * @param {google.cloud.ces.v1beta.IGenerateChatTokenRequest} message GenerateChatTokenRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateChatTokenRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenerateChatTokenRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GenerateChatTokenRequest} GenerateChatTokenRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateChatTokenRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateChatTokenRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.deployment = reader.string(); - break; - } - case 3: { - message.recaptchaToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenerateChatTokenRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GenerateChatTokenRequest} GenerateChatTokenRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateChatTokenRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenerateChatTokenRequest message. - * @function verify - * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenerateChatTokenRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.deployment != null && message.hasOwnProperty("deployment")) - if (!$util.isString(message.deployment)) - return "deployment: string expected"; - if (message.recaptchaToken != null && message.hasOwnProperty("recaptchaToken")) - if (!$util.isString(message.recaptchaToken)) - return "recaptchaToken: string expected"; - return null; - }; - - /** - * Creates a GenerateChatTokenRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GenerateChatTokenRequest} GenerateChatTokenRequest - */ - GenerateChatTokenRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GenerateChatTokenRequest) - return object; - var message = new $root.google.cloud.ces.v1beta.GenerateChatTokenRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.deployment != null) - message.deployment = String(object.deployment); - if (object.recaptchaToken != null) - message.recaptchaToken = String(object.recaptchaToken); - return message; - }; - - /** - * Creates a plain object from a GenerateChatTokenRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest - * @static - * @param {google.cloud.ces.v1beta.GenerateChatTokenRequest} message GenerateChatTokenRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenerateChatTokenRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.deployment = ""; - object.recaptchaToken = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.deployment != null && message.hasOwnProperty("deployment")) - object.deployment = message.deployment; - if (message.recaptchaToken != null && message.hasOwnProperty("recaptchaToken")) - object.recaptchaToken = message.recaptchaToken; - return object; - }; - - /** - * Converts this GenerateChatTokenRequest to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest - * @instance - * @returns {Object.} JSON object - */ - GenerateChatTokenRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenerateChatTokenRequest - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenerateChatTokenRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateChatTokenRequest"; - }; - - return GenerateChatTokenRequest; - })(); - - v1beta.GenerateChatTokenResponse = (function() { - - /** - * Properties of a GenerateChatTokenResponse. - * @memberof google.cloud.ces.v1beta - * @interface IGenerateChatTokenResponse - * @property {string|null} [chatToken] GenerateChatTokenResponse chatToken - * @property {google.protobuf.ITimestamp|null} [expireTime] GenerateChatTokenResponse expireTime - */ - - /** - * Constructs a new GenerateChatTokenResponse. - * @memberof google.cloud.ces.v1beta - * @classdesc Represents a GenerateChatTokenResponse. - * @implements IGenerateChatTokenResponse - * @constructor - * @param {google.cloud.ces.v1beta.IGenerateChatTokenResponse=} [properties] Properties to set - */ - function GenerateChatTokenResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenerateChatTokenResponse chatToken. - * @member {string} chatToken - * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse - * @instance - */ - GenerateChatTokenResponse.prototype.chatToken = ""; - - /** - * GenerateChatTokenResponse expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse - * @instance - */ - GenerateChatTokenResponse.prototype.expireTime = null; - - /** - * Creates a new GenerateChatTokenResponse instance using the specified properties. - * @function create - * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse - * @static - * @param {google.cloud.ces.v1beta.IGenerateChatTokenResponse=} [properties] Properties to set - * @returns {google.cloud.ces.v1beta.GenerateChatTokenResponse} GenerateChatTokenResponse instance - */ - GenerateChatTokenResponse.create = function create(properties) { - return new GenerateChatTokenResponse(properties); - }; - - /** - * Encodes the specified GenerateChatTokenResponse message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse - * @static - * @param {google.cloud.ces.v1beta.IGenerateChatTokenResponse} message GenerateChatTokenResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateChatTokenResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.chatToken != null && Object.hasOwnProperty.call(message, "chatToken")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.chatToken); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenerateChatTokenResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse - * @static - * @param {google.cloud.ces.v1beta.IGenerateChatTokenResponse} message GenerateChatTokenResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateChatTokenResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenerateChatTokenResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.ces.v1beta.GenerateChatTokenResponse} GenerateChatTokenResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateChatTokenResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateChatTokenResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.chatToken = reader.string(); - break; - } - case 2: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenerateChatTokenResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.ces.v1beta.GenerateChatTokenResponse} GenerateChatTokenResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateChatTokenResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenerateChatTokenResponse message. - * @function verify - * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenerateChatTokenResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.chatToken != null && message.hasOwnProperty("chatToken")) - if (!$util.isString(message.chatToken)) - return "chatToken: string expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - return null; - }; - - /** - * Creates a GenerateChatTokenResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.ces.v1beta.GenerateChatTokenResponse} GenerateChatTokenResponse - */ - GenerateChatTokenResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.ces.v1beta.GenerateChatTokenResponse) - return object; - var message = new $root.google.cloud.ces.v1beta.GenerateChatTokenResponse(); - if (object.chatToken != null) - message.chatToken = String(object.chatToken); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.ces.v1beta.GenerateChatTokenResponse.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - return message; - }; - - /** - * Creates a plain object from a GenerateChatTokenResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse - * @static - * @param {google.cloud.ces.v1beta.GenerateChatTokenResponse} message GenerateChatTokenResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenerateChatTokenResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.chatToken = ""; - object.expireTime = null; - } - if (message.chatToken != null && message.hasOwnProperty("chatToken")) - object.chatToken = message.chatToken; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - return object; - }; - - /** - * Converts this GenerateChatTokenResponse to JSON. - * @function toJSON - * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse - * @instance - * @returns {Object.} JSON object - */ - GenerateChatTokenResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenerateChatTokenResponse - * @function getTypeUrl - * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenerateChatTokenResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateChatTokenResponse"; - }; - - return GenerateChatTokenResponse; - })(); - - return v1beta; - })(); - - return ces; - })(); - - 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.ResourceDescriptor = (function() { - - /** - * Properties of a ResourceDescriptor. - * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style - */ - - /** - * Constructs a new ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor - * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; - - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; - - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; - - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; - - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @function create - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance - */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); - }; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - } - case 3: { - message.nameField = reader.string(); - break; - } - case 4: { - message.history = reader.int32(); - break; - } - case 5: { - message.plural = reader.string(); - break; - } - case 6: { - message.singular = reader.string(); - break; - } - case 10: { - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceDescriptor message. - * @function verify - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - if (message.style != null && message.hasOwnProperty("style")) { - if (!Array.isArray(message.style)) - return "style: array expected"; - for (var i = 0; i < message.style.length; ++i) - switch (message.style[i]) { - default: - return "style: enum value[] expected"; - case 0: - case 1: - break; - } - } - return null; - }; - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) - return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - default: - if (typeof object.history === "number") { - message.history = object.history; - break; - } - break; - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - if (typeof object.style[i] === "number") { - message.style[i] = object.style[i]; - break; - } - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; - } - return object; - }; - - /** - * Converts this ResourceDescriptor to JSON. - * @function toJSON - * @memberof google.api.ResourceDescriptor - * @instance - * @returns {Object.} JSON object - */ - ResourceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceDescriptor - * @function getTypeUrl - * @memberof google.api.ResourceDescriptor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; - }; - - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {number} - * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value - * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); - - return ResourceDescriptor; - })(); - - api.ResourceReference = (function() { - - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ - - /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set - */ - function ResourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; - - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @function create - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance - */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); - }; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); - return writer; - }; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.childType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceReference message. - * @function verify - * @memberof google.api.ResourceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; - return null; - }; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference - */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) - return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); - return message; - }; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceReference - * @static - * @param {google.api.ResourceReference} message ResourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; - return object; - }; - - /** - * Converts this ResourceReference to JSON. - * @function toJSON - * @memberof google.api.ResourceReference - * @instance - * @returns {Object.} JSON object - */ - ResourceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceReference - * @function getTypeUrl - * @memberof google.api.ResourceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceReference"; - }; - - return ResourceReference; - })(); - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; - - /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance - */ - Http.create = function create(properties) { - return new Http(properties); - }; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.get = reader.string(); - break; - } - case 3: { - message.put = reader.string(); - break; - } - case 4: { - message.post = reader.string(); - break; - } - case 5: { - message["delete"] = reader.string(); - break; - } - case 6: { - message.patch = reader.string(); - break; - } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - } - case 7: { - message.body = reader.string(); - break; - } - case 12: { - message.responseBody = reader.string(); - break; - } - case 11: { - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kind = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - function CommonLanguageSettings(properties) { - this.destinations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @function create - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance - */ - CommonLanguageSettings.create = function create(properties) { - return new CommonLanguageSettings(properties); - }; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); - if (message.destinations != null && message.destinations.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.destinations.length; ++i) - writer.int32(message.destinations[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.referenceDocsUri = reader.string(); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.destinations.push(reader.int32()); - } else - message.destinations.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonLanguageSettings message. - * @function verify - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonLanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - if (!$util.isString(message.referenceDocsUri)) - return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - switch (message.destinations[i]) { - default: - return "destinations: enum value[] expected"; - case 0: - case 10: - case 20: - break; - } - } - return null; - }; - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - CommonLanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) - object.referenceDocsUri = ""; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; - } - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; - - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - ClientLibrarySettings.create = function create(properties) { - return new ClientLibrarySettings(properties); - }; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.string(); - break; - } - case 2: { - message.launchStage = reader.int32(); - break; - } - case 3: { - message.restNumericEnums = reader.bool(); - break; - } - case 21: { - message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); - break; - } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); - break; - } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); - break; - } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); - break; - } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); - break; - } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientLibrarySettings message. - * @function verify - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientLibrarySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - if (typeof message.restNumericEnums !== "boolean") - return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { - var error = $root.google.api.JavaSettings.verify(message.javaSettings); - if (error) - return "javaSettings." + error; - } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { - var error = $root.google.api.CppSettings.verify(message.cppSettings); - if (error) - return "cppSettings." + error; - } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { - var error = $root.google.api.PhpSettings.verify(message.phpSettings); - if (error) - return "phpSettings." + error; - } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { - var error = $root.google.api.PythonSettings.verify(message.pythonSettings); - if (error) - return "pythonSettings." + error; - } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { - var error = $root.google.api.NodeSettings.verify(message.nodeSettings); - if (error) - return "nodeSettings." + error; - } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { - var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); - if (error) - return "dotnetSettings." + error; - } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { - var error = $root.google.api.RubySettings.verify(message.rubySettings); - if (error) - return "rubySettings." + error; - } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { - var error = $root.google.api.GoSettings.verify(message.goSettings); - if (error) - return "goSettings." + error; - } - return null; - }; - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - */ - ClientLibrarySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ClientLibrarySettings) - return object; - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); - } - return message; - }; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientLibrarySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); - return object; - }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; - - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; - - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; - - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; - - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; - - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; - - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - Publishing.create = function create(properties) { - return new Publishing(properties); - }; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encode - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methodSettings != null && message.methodSettings.length) - for (var i = 0; i < message.methodSettings.length; ++i) - $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) - writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) - writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) - writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); - if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); - if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) - writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); - if (message.librarySettings != null && message.librarySettings.length) - for (var i = 0; i < message.librarySettings.length; ++i) - $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - return writer; - }; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @function decode - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.methodSettings && message.methodSettings.length)) - message.methodSettings = []; - message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); - break; - } - case 101: { - message.newIssueUri = reader.string(); - break; - } - case 102: { - message.documentationUri = reader.string(); - break; - } - case 103: { - message.apiShortName = reader.string(); - break; - } - case 104: { - message.githubLabel = reader.string(); - break; - } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; - } - case 106: { - message.docTagPrefix = reader.string(); - break; - } - case 107: { - message.organization = reader.int32(); - break; - } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); - break; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Publishing.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { - if (!Array.isArray(message.methodSettings)) - return "methodSettings: array expected"; - for (var i = 0; i < message.methodSettings.length; ++i) { - var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); - if (error) - return "methodSettings." + error; - } - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - if (!$util.isString(message.newIssueUri)) - return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - if (!$util.isString(message.apiShortName)) - return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - if (!$util.isString(message.githubLabel)) - return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { - if (!Array.isArray(message.codeownerGithubTeams)) - return "codeownerGithubTeams: array expected"; - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - if (!$util.isString(message.codeownerGithubTeams[i])) - return "codeownerGithubTeams: string[] expected"; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - if (!$util.isString(message.docTagPrefix)) - return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - switch (message.organization) { - default: - return "organization: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { - if (!Array.isArray(message.librarySettings)) - return "librarySettings: array expected"; - for (var i = 0; i < message.librarySettings.length; ++i) { - var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); - if (error) - return "librarySettings." + error; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - Publishing.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Publishing) - return object; - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - - /** - * Creates a new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encode - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) - for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; - } - case 2: { - if (message.serviceClassNames === $util.emptyObject) - message.serviceClassNames = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.serviceClassNames[key] = value; - break; - } - case 3: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JavaSettings message. - * @function verify - * @memberof google.api.JavaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JavaSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - if (!$util.isString(message.libraryPackage)) - return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { - if (!$util.isObject(message.serviceClassNames)) - return "serviceClassNames: object expected"; - var key = Object.keys(message.serviceClassNames); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.serviceClassNames[key[i]])) - return "serviceClassNames: string{k:string} expected"; - } - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.JavaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings - */ - JavaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.JavaSettings) - return object; - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); - } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.JavaSettings - * @static - * @param {google.api.JavaSettings} message JavaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JavaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; - if (options.defaults) { - object.libraryPackage = ""; - object.common = null; - } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a new CppSettings instance using the specified properties. - * @function create - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings=} [properties] Properties to set - * @returns {google.api.CppSettings} CppSettings instance - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CppSettings message. - * @function verify - * @memberof google.api.CppSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CppSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CppSettings) - return object; - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - function PhpSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * Creates a new PhpSettings instance using the specified properties. - * @function create - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings=} [properties] Properties to set - * @returns {google.api.PhpSettings} PhpSettings instance - */ - PhpSettings.create = function create(properties) { - return new PhpSettings(properties); - }; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhpSettings message. - * @function verify - * @memberof google.api.PhpSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhpSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - PhpSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PhpSettings) - return object; - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - */ - - /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set - */ - function PythonSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * Creates a new PythonSettings instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings=} [properties] Properties to set - * @returns {google.api.PythonSettings} PythonSettings instance - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonSettings message. - * @function verify - * @memberof google.api.PythonSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) - return object; - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - function NodeSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * Creates a new NodeSettings instance using the specified properties. - * @function create - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings=} [properties] Properties to set - * @returns {google.api.NodeSettings} NodeSettings instance - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encode - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSettings message. - * @function verify - * @memberof google.api.NodeSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) - return object; - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @function create - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings=} [properties] Properties to set - * @returns {google.api.DotnetSettings} DotnetSettings instance - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encode - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - return writer; - }; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DotnetSettings message. - * @function verify - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DotnetSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - return null; - }; - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - DotnetSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - return object; - }; - - /** - * Converts this DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - function RubySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; - - /** - * Creates a new RubySettings instance using the specified properties. - * @function create - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings=} [properties] Properties to set - * @returns {google.api.RubySettings} RubySettings instance - */ - RubySettings.create = function create(properties) { - return new RubySettings(properties); - }; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encode - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RubySettings message. - * @function verify - * @memberof google.api.RubySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RubySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - RubySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RubySettings) - return object; - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - - /** - * Creates a new GoSettings instance using the specified properties. - * @function create - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings=} [properties] Properties to set - * @returns {google.api.GoSettings} GoSettings instance - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encode - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoSettings message. - * @function verify - * @memberof google.api.GoSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) - return object; - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - api.MethodSettings = (function() { - - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * Constructs a new MethodSettings. - * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings - * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set - */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings=} [properties] Properties to set - * @returns {google.api.MethodSettings} MethodSettings instance - */ - MethodSettings.create = function create(properties) { - return new MethodSettings(properties); - }; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - return writer; - }; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodSettings message. - * @function verify - * @memberof google.api.MethodSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { - var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); - if (error) - return "longRunning." + error; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - MethodSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings) - return object; - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a new LongRunning instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - * @returns {google.api.MethodSettings.LongRunning} LongRunning instance - */ - LongRunning.create = function create(properties) { - return new LongRunning(properties); - }; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) - $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pollDelayMultiplier = reader.float(); - break; - } - case 3: { - message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LongRunning message. - * @function verify - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LongRunning.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); - if (error) - return "initialPollDelay." + error; - } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - if (typeof message.pollDelayMultiplier !== "number") - return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); - if (error) - return "maxPollDelay." + error; - } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); - if (error) - return "totalPollTimeout." + error; - } - return null; - }; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {number} - * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} ADS=2 ADS value - * @property {number} PHOTOS=3 PHOTOS value - * @property {number} STREET_VIEW=4 STREET_VIEW value - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "ADS"] = 2; - values[valuesById[3] = "PHOTOS"] = 3; - values[valuesById[4] = "STREET_VIEW"] = 4; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {number} - * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {number} GITHUB=10 GITHUB value - * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[10] = "GITHUB"] = 10; - values[valuesById[20] = "PACKAGE_MANAGER"] = 20; - return values; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; - })(); - - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance - */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message["package"] = reader.string(); - break; - } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - } - case 10: { - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - } - case 11: { - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - } - case 12: { - message.syntax = reader.string(); - break; - } - case 14: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - this.declaration = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); - break; - } - case 6: { - message.typeName = reader.string(); - break; - } - case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); - break; - } - case 9: { - message.oneofIndex = reader.int32(); - break; - } - case 10: { - message.jsonName = reader.string(); - break; - } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 3: - case 2: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.number = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.javaPackage = reader.string(); - break; - } - case 8: { - message.javaOuterClassname = reader.string(); - break; - } - case 10: { - message.javaMultipleFiles = reader.bool(); - break; - } - case 20: { - message.javaGenerateEqualsAndHash = reader.bool(); - break; - } - case 27: { - message.javaStringCheckUtf8 = reader.bool(); - break; - } - case 9: { - message.optimizeFor = reader.int32(); - break; - } - case 11: { - message.goPackage = reader.string(); - break; - } - case 16: { - message.ccGenericServices = reader.bool(); - break; - } - case 17: { - message.javaGenericServices = reader.bool(); - break; - } - case 18: { - message.pyGenericServices = reader.bool(); - break; - } - case 23: { - message.deprecated = reader.bool(); - break; - } - case 31: { - message.ccEnableArenas = reader.bool(); - break; - } - case 36: { - message.objcClassPrefix = reader.string(); - break; - } - case 37: { - message.csharpNamespace = reader.string(); - break; - } - case 39: { - message.swiftPrefix = reader.string(); - break; - } - case 40: { - message.phpClassPrefix = reader.string(); - break; - } - case 41: { - message.phpNamespace = reader.string(); - break; - } - case 44: { - message.phpMetadataNamespace = reader.string(); - break; - } - case 45: { - message.rubyPackage = reader.string(); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.messageSetWireFormat = reader.bool(); - break; - } - case 2: { - message.noStandardDescriptorAccessor = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 7: { - message.mapEntry = reader.bool(); - break; - } - case 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.targets = []; - this.editionDefaults = []; - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - - /** - * 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(); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1052: { - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - break; - } - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - 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; - } - 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); - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object.debugRedact = false; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 33: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); - break; - } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); - break; - } - case 525000001: { - message[".google.api.apiVersion"] = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; - - /** - * MethodOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.features = null; - - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - - /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance - */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); - }; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) - $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - } - case 1049: { - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { - var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); - if (error) - return ".google.longrunning.operationInfo." + error; - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MethodOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - if (object[".google.longrunning.operationInfo"] != null) { - if (typeof object[".google.longrunning.operationInfo"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object.features = null; - object[".google.longrunning.operationInfo"] = null; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.features = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - } - case 3: { - message.leadingComments = reader.string(); - break; - } - case 4: { - message.trailingComments = reader.string(); - break; - } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.Struct = (function() { - - /** - * Properties of a Struct. - * @memberof google.protobuf - * @interface IStruct - * @property {Object.|null} [fields] Struct fields - */ - - /** - * Constructs a new Struct. - * @memberof google.protobuf - * @classdesc Represents a Struct. - * @implements IStruct - * @constructor - * @param {google.protobuf.IStruct=} [properties] Properties to set - */ - function Struct(properties) { - this.fields = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Struct fields. - * @member {Object.} fields - * @memberof google.protobuf.Struct - * @instance - */ - Struct.prototype.fields = $util.emptyObject; - - /** - * Creates a new Struct instance using the specified properties. - * @function create - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct=} [properties] Properties to set - * @returns {google.protobuf.Struct} Struct instance - */ - Struct.create = function create(properties) { - return new Struct(properties); - }; - - /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Struct.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) - for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Struct.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Struct message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Struct - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Struct} Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Struct.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.fields === $util.emptyObject) - message.fields = {}; - 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.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.fields[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Struct message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Struct - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Struct} Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Struct.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Struct message. - * @function verify - * @memberof google.protobuf.Struct - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Struct.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fields != null && message.hasOwnProperty("fields")) { - if (!$util.isObject(message.fields)) - return "fields: object expected"; - var key = Object.keys(message.fields); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); - if (error) - return "fields." + error; - } - } - return null; - }; - - /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Struct - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Struct} Struct - */ - Struct.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Struct) - return object; - var message = new $root.google.protobuf.Struct(); - if (object.fields) { - if (typeof object.fields !== "object") - throw TypeError(".google.protobuf.Struct.fields: object expected"); - message.fields = {}; - for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { - if (typeof object.fields[keys[i]] !== "object") - throw TypeError(".google.protobuf.Struct.fields: object expected"); - message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.Struct} message Struct - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Struct.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.fields = {}; - var keys2; - if (message.fields && (keys2 = Object.keys(message.fields)).length) { - object.fields = {}; - for (var j = 0; j < keys2.length; ++j) - object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); - } - return object; - }; - - /** - * Converts this Struct to JSON. - * @function toJSON - * @memberof google.protobuf.Struct - * @instance - * @returns {Object.} JSON object - */ - Struct.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Struct - * @function getTypeUrl - * @memberof google.protobuf.Struct - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Struct"; - }; - - return Struct; - })(); - - protobuf.Value = (function() { - - /** - * Properties of a Value. - * @memberof google.protobuf - * @interface IValue - * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue - * @property {number|null} [numberValue] Value numberValue - * @property {string|null} [stringValue] Value stringValue - * @property {boolean|null} [boolValue] Value boolValue - * @property {google.protobuf.IStruct|null} [structValue] Value structValue - * @property {google.protobuf.IListValue|null} [listValue] Value listValue - */ - - /** - * Constructs a new Value. - * @memberof google.protobuf - * @classdesc Represents a Value. - * @implements IValue - * @constructor - * @param {google.protobuf.IValue=} [properties] Properties to set - */ - function Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Value nullValue. - * @member {google.protobuf.NullValue|null|undefined} nullValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.nullValue = null; - - /** - * Value numberValue. - * @member {number|null|undefined} numberValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.numberValue = null; - - /** - * Value stringValue. - * @member {string|null|undefined} stringValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.stringValue = null; - - /** - * Value boolValue. - * @member {boolean|null|undefined} boolValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.boolValue = null; - - /** - * Value structValue. - * @member {google.protobuf.IStruct|null|undefined} structValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.structValue = null; - - /** - * Value listValue. - * @member {google.protobuf.IListValue|null|undefined} listValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.listValue = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Value kind. - * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind - * @memberof google.protobuf.Value - * @instance - */ - Object.defineProperty(Value.prototype, "kind", { - get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue=} [properties] Properties to set - * @returns {google.protobuf.Value} Value instance - */ - Value.create = function create(properties) { - return new Value(properties); - }; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); - if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); - if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); - if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) - $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) - $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.nullValue = reader.int32(); - break; - } - case 2: { - message.numberValue = reader.double(); - break; - } - case 3: { - message.stringValue = reader.string(); - break; - } - case 4: { - message.boolValue = reader.bool(); - break; - } - case 5: { - message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 6: { - message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Value message. - * @function verify - * @memberof google.protobuf.Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - properties.kind = 1; - switch (message.nullValue) { - default: - return "nullValue: enum value expected"; - case 0: - break; - } - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.numberValue !== "number") - return "numberValue: number expected"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (!$util.isString(message.stringValue)) - return "stringValue: string expected"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.boolValue !== "boolean") - return "boolValue: boolean expected"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.Struct.verify(message.structValue); - if (error) - return "structValue." + error; - } - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.ListValue.verify(message.listValue); - if (error) - return "listValue." + error; - } - } - return null; - }; - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Value} Value - */ - Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Value) - return object; - var message = new $root.google.protobuf.Value(); - switch (object.nullValue) { - default: - if (typeof object.nullValue === "number") { - message.nullValue = object.nullValue; - break; - } - break; - case "NULL_VALUE": - case 0: - message.nullValue = 0; - break; - } - if (object.numberValue != null) - message.numberValue = Number(object.numberValue); - if (object.stringValue != null) - message.stringValue = String(object.stringValue); - if (object.boolValue != null) - message.boolValue = Boolean(object.boolValue); - if (object.structValue != null) { - if (typeof object.structValue !== "object") - throw TypeError(".google.protobuf.Value.structValue: object expected"); - message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); - } - if (object.listValue != null) { - if (typeof object.listValue !== "object") - throw TypeError(".google.protobuf.Value.listValue: object expected"); - message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); - } - return message; - }; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.Value} message Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; - if (options.oneofs) - object.kind = "nullValue"; - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; - if (options.oneofs) - object.kind = "numberValue"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object.stringValue = message.stringValue; - if (options.oneofs) - object.kind = "stringValue"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - object.boolValue = message.boolValue; - if (options.oneofs) - object.kind = "boolValue"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); - if (options.oneofs) - object.kind = "structValue"; - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); - if (options.oneofs) - object.kind = "listValue"; - } - return object; - }; - - /** - * Converts this Value to JSON. - * @function toJSON - * @memberof google.protobuf.Value - * @instance - * @returns {Object.} JSON object - */ - Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Value - * @function getTypeUrl - * @memberof google.protobuf.Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Value"; - }; - - return Value; - })(); - - /** - * NullValue enum. - * @name google.protobuf.NullValue - * @enum {number} - * @property {number} NULL_VALUE=0 NULL_VALUE value - */ - protobuf.NullValue = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NULL_VALUE"] = 0; - return values; - })(); - - protobuf.ListValue = (function() { - - /** - * Properties of a ListValue. - * @memberof google.protobuf - * @interface IListValue - * @property {Array.|null} [values] ListValue values - */ - - /** - * Constructs a new ListValue. - * @memberof google.protobuf - * @classdesc Represents a ListValue. - * @implements IListValue - * @constructor - * @param {google.protobuf.IListValue=} [properties] Properties to set - */ - function ListValue(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]]; - } - - /** - * ListValue values. - * @member {Array.} values - * @memberof google.protobuf.ListValue - * @instance - */ - ListValue.prototype.values = $util.emptyArray; - - /** - * Creates a new ListValue instance using the specified properties. - * @function create - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue=} [properties] Properties to set - * @returns {google.protobuf.ListValue} ListValue instance - */ - ListValue.create = function create(properties) { - return new ListValue(properties); - }; - - /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValue.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.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ListValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ListValue} ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ListValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ListValue} ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListValue message. - * @function verify - * @memberof google.protobuf.ListValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListValue.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.protobuf.Value.verify(message.values[i]); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates a ListValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ListValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ListValue} ListValue - */ - ListValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ListValue) - return object; - var message = new $root.google.protobuf.ListValue(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.protobuf.ListValue.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.protobuf.ListValue.values: object expected"); - message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.ListValue} message ListValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListValue.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.protobuf.Value.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this ListValue to JSON. - * @function toJSON - * @memberof google.protobuf.ListValue - * @instance - * @returns {Object.} JSON object - */ - ListValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListValue - * @function getTypeUrl - * @memberof google.protobuf.ListValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ListValue"; - }; - - return ListValue; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Creates a new Any instance using the specified properties. - * @function create - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance - */ - Any.create = function create(properties) { - return new Any(properties); - }; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type_url = reader.string(); - break; - } - case 2: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Any"; - }; - - return Any; - })(); - - protobuf.Empty = (function() { - - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ - - /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty - * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set - */ - function Empty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new Empty instance using the specified properties. - * @function create - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance - */ - Empty.create = function create(properties) { - return new Empty(properties); - }; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Empty message. - * @function verify - * @memberof google.protobuf.Empty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Empty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Empty - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty - */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) - return object; - return new $root.google.protobuf.Empty(); - }; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.Empty} message Empty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Empty.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Empty to JSON. - * @function toJSON - * @memberof google.protobuf.Empty - * @instance - * @returns {Object.} JSON object - */ - Empty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Empty - * @function getTypeUrl - * @memberof google.protobuf.Empty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Empty"; - }; - - return Empty; - })(); - - protobuf.FieldMask = (function() { - - /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths - */ - - /** - * Constructs a new FieldMask. - * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask - * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - */ - function FieldMask(properties) { - this.paths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; - - /** - * Creates a new FieldMask instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance - */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); - }; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldMask message. - * @function verify - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldMask.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask - */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) - return object; - var message = new $root.google.protobuf.FieldMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.protobuf.FieldMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.FieldMask} message FieldMask - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldMask.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; - }; - - /** - * Converts this FieldMask to JSON. - * @function toJSON - * @memberof google.protobuf.FieldMask - * @instance - * @returns {Object.} JSON object - */ - FieldMask.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldMask - * @function getTypeUrl - * @memberof google.protobuf.FieldMask - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldMask"; - }; - - return FieldMask; - })(); - - return protobuf; - })(); - - google.longrunning = (function() { - - /** - * Namespace longrunning. - * @memberof google - * @namespace - */ - var longrunning = {}; - - longrunning.Operations = (function() { - - /** - * Constructs a new Operations service. - * @memberof google.longrunning - * @classdesc Represents an Operations - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Operations(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; - - /** - * Creates new Operations service using the specified rpc implementation. - * @function create - * @memberof google.longrunning.Operations - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. - */ - Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @memberof google.longrunning.Operations - * @typedef ListOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse - */ - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { - return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); - }, "name", { value: "ListOperations" }); - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @memberof google.longrunning.Operations - * @typedef GetOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { - return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "GetOperation" }); - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @memberof google.longrunning.Operations - * @typedef DeleteOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { - return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteOperation" }); - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @memberof google.longrunning.Operations - * @typedef CancelOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { - return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "CancelOperation" }); - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @memberof google.longrunning.Operations - * @typedef WaitOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { - return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "WaitOperation" }); - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Operations; - })(); - - longrunning.Operation = (function() { - - /** - * Properties of an Operation. - * @memberof google.longrunning - * @interface IOperation - * @property {string|null} [name] Operation name - * @property {google.protobuf.IAny|null} [metadata] Operation metadata - * @property {boolean|null} [done] Operation done - * @property {google.rpc.IStatus|null} [error] Operation error - * @property {google.protobuf.IAny|null} [response] Operation response - */ - - /** - * Constructs a new Operation. - * @memberof google.longrunning - * @classdesc Represents an Operation. - * @implements IOperation - * @constructor - * @param {google.longrunning.IOperation=} [properties] Properties to set - */ - function Operation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Operation name. - * @member {string} name - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.name = ""; - - /** - * Operation metadata. - * @member {google.protobuf.IAny|null|undefined} metadata - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.metadata = null; - - /** - * Operation done. - * @member {boolean} done - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.done = false; - - /** - * Operation error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.error = null; - - /** - * Operation response. - * @member {google.protobuf.IAny|null|undefined} response - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.response = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Operation result. - * @member {"error"|"response"|undefined} result - * @memberof google.longrunning.Operation - * @instance - */ - Object.defineProperty(Operation.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "response"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Operation instance using the specified properties. - * @function create - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation=} [properties] Properties to set - * @returns {google.longrunning.Operation} Operation instance - */ - Operation.create = function create(properties) { - return new Operation(properties); - }; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encode - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.done != null && Object.hasOwnProperty.call(message, "done")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - case 3: { - message.done = reader.bool(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 5: { - message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Operation message. - * @function verify - * @memberof google.longrunning.Operation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Operation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Any.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.done != null && message.hasOwnProperty("done")) - if (typeof message.done !== "boolean") - return "done: boolean expected"; - if (message.error != null && message.hasOwnProperty("error")) { - properties.result = 1; - { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - } - if (message.response != null && message.hasOwnProperty("response")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.protobuf.Any.verify(message.response); - if (error) - return "response." + error; - } - } - return null; - }; - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.Operation - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.Operation} Operation - */ - Operation.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.Operation) - return object; - var message = new $root.google.longrunning.Operation(); - if (object.name != null) - message.name = String(object.name); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.longrunning.Operation.metadata: object expected"); - message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); - } - if (object.done != null) - message.done = Boolean(object.done); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.longrunning.Operation.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.longrunning.Operation.response: object expected"); - message.response = $root.google.protobuf.Any.fromObject(object.response); - } - return message; - }; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.Operation} message Operation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Operation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.metadata = null; - object.done = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); - if (message.done != null && message.hasOwnProperty("done")) - object.done = message.done; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; - } - if (message.response != null && message.hasOwnProperty("response")) { - object.response = $root.google.protobuf.Any.toObject(message.response, options); - if (options.oneofs) - object.result = "response"; - } - return object; - }; - - /** - * Converts this Operation to JSON. - * @function toJSON - * @memberof google.longrunning.Operation - * @instance - * @returns {Object.} JSON object - */ - Operation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Operation - * @function getTypeUrl - * @memberof google.longrunning.Operation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.Operation"; - }; - - return Operation; - })(); - - longrunning.GetOperationRequest = (function() { - - /** - * Properties of a GetOperationRequest. - * @memberof google.longrunning - * @interface IGetOperationRequest - * @property {string|null} [name] GetOperationRequest name - */ - - /** - * Constructs a new GetOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a GetOperationRequest. - * @implements IGetOperationRequest - * @constructor - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - */ - function GetOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetOperationRequest name. - * @member {string} name - * @memberof google.longrunning.GetOperationRequest - * @instance - */ - GetOperationRequest.prototype.name = ""; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance - */ - GetOperationRequest.create = function create(properties) { - return new GetOperationRequest(properties); - }; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetOperationRequest message. - * @function verify - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - */ - GetOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.GetOperationRequest) - return object; - var message = new $root.google.longrunning.GetOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.GetOperationRequest} message GetOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.GetOperationRequest - * @instance - * @returns {Object.} JSON object - */ - GetOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; - }; - - return GetOperationRequest; - })(); - - longrunning.ListOperationsRequest = (function() { - - /** - * Properties of a ListOperationsRequest. - * @memberof google.longrunning - * @interface IListOperationsRequest - * @property {string|null} [name] ListOperationsRequest name - * @property {string|null} [filter] ListOperationsRequest filter - * @property {number|null} [pageSize] ListOperationsRequest pageSize - * @property {string|null} [pageToken] ListOperationsRequest pageToken - */ - - /** - * Constructs a new ListOperationsRequest. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsRequest. - * @implements IListOperationsRequest - * @constructor - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - */ - function ListOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsRequest name. - * @member {string} name - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.name = ""; - - /** - * ListOperationsRequest filter. - * @member {string} filter - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.filter = ""; - - /** - * ListOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageSize = 0; - - /** - * ListOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance - */ - ListOperationsRequest.create = function create(properties) { - return new ListOperationsRequest(properties); - }; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - return writer; - }; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.name = reader.string(); - break; - } - case 1: { - message.filter = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsRequest message. - * @function verify - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - */ - ListOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsRequest) - return object; - var message = new $root.google.longrunning.ListOperationsRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.name = ""; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this ListOperationsRequest to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsRequest - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; - }; - - return ListOperationsRequest; - })(); - - longrunning.ListOperationsResponse = (function() { - - /** - * Properties of a ListOperationsResponse. - * @memberof google.longrunning - * @interface IListOperationsResponse - * @property {Array.|null} [operations] ListOperationsResponse operations - * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListOperationsResponse. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsResponse. - * @implements IListOperationsResponse - * @constructor - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - */ - function ListOperationsResponse(properties) { - this.operations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsResponse operations. - * @member {Array.} operations - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance - */ - ListOperationsResponse.create = function create(properties) { - return new ListOperationsResponse(properties); - }; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsResponse message. - * @function verify - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - */ - ListOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsResponse) - return object; - var message = new $root.google.longrunning.ListOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListOperationsResponse to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsResponse - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; - }; - - return ListOperationsResponse; - })(); - - longrunning.CancelOperationRequest = (function() { - - /** - * Properties of a CancelOperationRequest. - * @memberof google.longrunning - * @interface ICancelOperationRequest - * @property {string|null} [name] CancelOperationRequest name - */ - - /** - * Constructs a new CancelOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a CancelOperationRequest. - * @implements ICancelOperationRequest - * @constructor - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - */ - function CancelOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelOperationRequest name. - * @member {string} name - * @memberof google.longrunning.CancelOperationRequest - * @instance - */ - CancelOperationRequest.prototype.name = ""; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance - */ - CancelOperationRequest.create = function create(properties) { - return new CancelOperationRequest(properties); - }; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelOperationRequest message. - * @function verify - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - */ - CancelOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.CancelOperationRequest) - return object; - var message = new $root.google.longrunning.CancelOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this CancelOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.CancelOperationRequest - * @instance - * @returns {Object.} JSON object - */ - CancelOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; - }; - - return CancelOperationRequest; - })(); - - longrunning.DeleteOperationRequest = (function() { - - /** - * Properties of a DeleteOperationRequest. - * @memberof google.longrunning - * @interface IDeleteOperationRequest - * @property {string|null} [name] DeleteOperationRequest name - */ - - /** - * Constructs a new DeleteOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a DeleteOperationRequest. - * @implements IDeleteOperationRequest - * @constructor - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - */ - function DeleteOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteOperationRequest name. - * @member {string} name - * @memberof google.longrunning.DeleteOperationRequest - * @instance - */ - DeleteOperationRequest.prototype.name = ""; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance - */ - DeleteOperationRequest.create = function create(properties) { - return new DeleteOperationRequest(properties); - }; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteOperationRequest message. - * @function verify - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - */ - DeleteOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.DeleteOperationRequest) - return object; - var message = new $root.google.longrunning.DeleteOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.DeleteOperationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; - }; - - return DeleteOperationRequest; - })(); - - longrunning.WaitOperationRequest = (function() { - - /** - * Properties of a WaitOperationRequest. - * @memberof google.longrunning - * @interface IWaitOperationRequest - * @property {string|null} [name] WaitOperationRequest name - * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout - */ - - /** - * Constructs a new WaitOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a WaitOperationRequest. - * @implements IWaitOperationRequest - * @constructor - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - */ - function WaitOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitOperationRequest name. - * @member {string} name - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.name = ""; - - /** - * WaitOperationRequest timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.timeout = null; - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance - */ - WaitOperationRequest.create = function create(properties) { - return new WaitOperationRequest(properties); - }; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitOperationRequest message. - * @function verify - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - return null; - }; - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - */ - WaitOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.WaitOperationRequest) - return object; - var message = new $root.google.longrunning.WaitOperationRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - return message; - }; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.timeout = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - return object; - }; - - /** - * Converts this WaitOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.WaitOperationRequest - * @instance - * @returns {Object.} JSON object - */ - WaitOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WaitOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; - }; - - return WaitOperationRequest; - })(); - - longrunning.OperationInfo = (function() { - - /** - * Properties of an OperationInfo. - * @memberof google.longrunning - * @interface IOperationInfo - * @property {string|null} [responseType] OperationInfo responseType - * @property {string|null} [metadataType] OperationInfo metadataType - */ - - /** - * Constructs a new OperationInfo. - * @memberof google.longrunning - * @classdesc Represents an OperationInfo. - * @implements IOperationInfo - * @constructor - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - */ - function OperationInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationInfo responseType. - * @member {string} responseType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.responseType = ""; - - /** - * OperationInfo metadataType. - * @member {string} metadataType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.metadataType = ""; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @function create - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - * @returns {google.longrunning.OperationInfo} OperationInfo instance - */ - OperationInfo.create = function create(properties) { - return new OperationInfo(properties); - }; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encode - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); - return writer; - }; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.responseType = reader.string(); - break; - } - case 2: { - message.metadataType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationInfo message. - * @function verify - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responseType != null && message.hasOwnProperty("responseType")) - if (!$util.isString(message.responseType)) - return "responseType: string expected"; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - if (!$util.isString(message.metadataType)) - return "metadataType: string expected"; - return null; - }; - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.OperationInfo} OperationInfo - */ - OperationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.OperationInfo) - return object; - var message = new $root.google.longrunning.OperationInfo(); - if (object.responseType != null) - message.responseType = String(object.responseType); - if (object.metadataType != null) - message.metadataType = String(object.metadataType); - return message; - }; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.OperationInfo} message OperationInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.responseType = ""; - object.metadataType = ""; - } - if (message.responseType != null && message.hasOwnProperty("responseType")) - object.responseType = message.responseType; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - object.metadataType = message.metadataType; - return object; - }; - - /** - * Converts this OperationInfo to JSON. - * @function toJSON - * @memberof google.longrunning.OperationInfo - * @instance - * @returns {Object.} JSON object - */ - OperationInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationInfo - * @function getTypeUrl - * @memberof google.longrunning.OperationInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.OperationInfo"; - }; - - return OperationInfo; - })(); - - return longrunning; - })(); - - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - if (!Array.isArray(message.details)) - return "details: array expected"; - for (var i = 0; i < message.details.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.details[i]); - if (error) - return "details." + error; - } - } - return null; - }; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.rpc.Status - * @static - * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status - */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) - return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/google-cloud-ces/protos/protos.json b/owl-bot-staging/google-cloud-ces/protos/protos.json deleted file mode 100644 index 201e3b6d4d3..00000000000 --- a/owl-bot-staging/google-cloud-ces/protos/protos.json +++ /dev/null @@ -1,22318 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "ces": { - "nested": { - "v1": { - "options": { - "go_package": "cloud.google.com/go/ces/apiv1/cespb;cespb", - "java_multiple_files": true, - "java_outer_classname": "WidgetServiceProto", - "java_package": "com.google.cloud.ces.v1", - "(google.api.resource_definition).type": "ces.googleapis.com/Session", - "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/apps/{app}/sessions/{session}" - }, - "nested": { - "Agent": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Agent", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/agents/{agent}", - "(google.api.resource).plural": "agents", - "(google.api.resource).singular": "agent" - }, - "oneofs": { - "agentType": { - "oneof": [ - "llmAgent", - "remoteDialogflowAgent" - ] - } - }, - "fields": { - "llmAgent": { - "type": "LlmAgent", - "id": 26, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "remoteDialogflowAgent": { - "type": "RemoteDialogflowAgent", - "id": 27, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "modelSettings": { - "type": "ModelSettings", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "instruction": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tools": { - "rule": "repeated", - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "childAgents": { - "rule": "repeated", - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - }, - "beforeAgentCallbacks": { - "rule": "repeated", - "type": "Callback", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "afterAgentCallbacks": { - "rule": "repeated", - "type": "Callback", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "beforeModelCallbacks": { - "rule": "repeated", - "type": "Callback", - "id": 20, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "afterModelCallbacks": { - "rule": "repeated", - "type": "Callback", - "id": 21, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "beforeToolCallbacks": { - "rule": "repeated", - "type": "Callback", - "id": 22, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "afterToolCallbacks": { - "rule": "repeated", - "type": "Callback", - "id": 23, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "guardrails": { - "rule": "repeated", - "type": "string", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" - } - }, - "etag": { - "type": "string", - "id": 24 - }, - "toolsets": { - "rule": "repeated", - "type": "AgentToolset", - "id": 28, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "generatedSummary": { - "type": "string", - "id": 29, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "transferRules": { - "rule": "repeated", - "type": "TransferRule", - "id": 30, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "LlmAgent": { - "fields": {} - }, - "RemoteDialogflowAgent": { - "fields": { - "agent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/DialogflowAgent" - } - }, - "flowId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "environmentId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "inputVariableMapping": { - "keyType": "string", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "outputVariableMapping": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "respectResponseInterruptionSettings": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AgentToolset": { - "fields": { - "toolset": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" - } - }, - "toolIds": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "ExpressionCondition": { - "fields": { - "expression": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "PythonCodeCondition": { - "fields": { - "pythonCode": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "TransferRule": { - "oneofs": { - "ruleType": { - "oneof": [ - "deterministicTransfer", - "disablePlannerTransfer" - ] - } - }, - "fields": { - "deterministicTransfer": { - "type": "DeterministicTransfer", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "disablePlannerTransfer": { - "type": "DisablePlannerTransfer", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "childAgent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - }, - "direction": { - "type": "Direction", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "DeterministicTransfer": { - "oneofs": { - "conditionType": { - "oneof": [ - "expressionCondition", - "pythonCodeCondition" - ] - } - }, - "fields": { - "expressionCondition": { - "type": "ExpressionCondition", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pythonCodeCondition": { - "type": "PythonCodeCondition", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DisablePlannerTransfer": { - "fields": { - "expressionCondition": { - "type": "ExpressionCondition", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Direction": { - "values": { - "DIRECTION_UNSPECIFIED": 0, - "PARENT_TO_CHILD": 1, - "CHILD_TO_PARENT": 2 - } - } - } - }, - "ExecutionType": { - "values": { - "EXECUTION_TYPE_UNSPECIFIED": 0, - "SYNCHRONOUS": 1, - "ASYNCHRONOUS": 2 - } - }, - "Callback": { - "oneofs": { - "callback": { - "oneof": [ - "pythonCode" - ] - } - }, - "fields": { - "pythonCode": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "disabled": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "proactiveExecutionEnabled": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ModelSettings": { - "oneofs": { - "_temperature": { - "oneof": [ - "temperature" - ] - } - }, - "fields": { - "model": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "temperature": { - "type": "double", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "TriggerAction": { - "oneofs": { - "action": { - "oneof": [ - "respondImmediately", - "transferAgent", - "generativeAnswer" - ] - } - }, - "fields": { - "respondImmediately": { - "type": "RespondImmediately", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "transferAgent": { - "type": "TransferAgent", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "generativeAnswer": { - "type": "GenerativeAnswer", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Response": { - "fields": { - "text": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "disabled": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RespondImmediately": { - "fields": { - "responses": { - "rule": "repeated", - "type": "Response", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GenerativeAnswer": { - "fields": { - "prompt": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "TransferAgent": { - "fields": { - "agent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - } - } - } - } - }, - "TlsConfig": { - "fields": { - "caCerts": { - "rule": "repeated", - "type": "CaCert", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "CaCert": { - "fields": { - "displayName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cert": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "ServiceDirectoryConfig": { - "fields": { - "service": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "servicedirectory.googleapis.com/Service" - } - } - } - }, - "ChannelProfile": { - "fields": { - "profileId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "channelType": { - "type": "ChannelType", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "personaProperty": { - "type": "PersonaProperty", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "disableDtmf": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "disableBargeInControl": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "webWidgetConfig": { - "type": "WebWidgetConfig", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "noiseSuppressionLevel": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "PersonaProperty": { - "fields": { - "persona": { - "type": "Persona", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Persona": { - "values": { - "UNKNOWN": 0, - "CONCISE": 1, - "CHATTY": 2 - } - } - } - }, - "WebWidgetConfig": { - "fields": { - "modality": { - "type": "Modality", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "theme": { - "type": "Theme", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "webWidgetTitle": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "securitySettings": { - "type": "SecuritySettings", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "SecuritySettings": { - "fields": { - "enablePublicAccess": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableOriginCheck": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowedOrigins": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableRecaptcha": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Modality": { - "values": { - "MODALITY_UNSPECIFIED": 0, - "CHAT_AND_VOICE": 1, - "VOICE_ONLY": 2, - "CHAT_ONLY": 3 - } - }, - "Theme": { - "values": { - "THEME_UNSPECIFIED": 0, - "LIGHT": 1, - "DARK": 2 - } - } - } - }, - "ChannelType": { - "values": { - "UNKNOWN": 0, - "WEB_UI": 2, - "API": 3, - "TWILIO": 4, - "GOOGLE_TELEPHONY_PLATFORM": 5, - "CONTACT_CENTER_AS_A_SERVICE": 6, - "FIVE9": 7 - } - } - } - }, - "Span": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "duration": { - "type": "google.protobuf.Duration", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "attributes": { - "type": "google.protobuf.Struct", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "childSpans": { - "rule": "repeated", - "type": "Span", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "AgentService": { - "options": { - "(google.api.default_host)": "ces.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ListApps": { - "requestType": "ListAppsRequest", - "responseType": "ListAppsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/apps", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/apps" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetApp": { - "requestType": "GetAppRequest", - "responseType": "App", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/apps/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateApp": { - "requestType": "CreateAppRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/apps", - "(google.api.http).body": "app", - "(google.api.method_signature)": "parent,app", - "(google.longrunning.operation_info).response_type": "App", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/apps", - "body": "app" - } - }, - { - "(google.api.method_signature)": "parent,app,app_id" - }, - { - "(google.api.method_signature)": "parent,app" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "App", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpdateApp": { - "requestType": "UpdateAppRequest", - "responseType": "App", - "options": { - "(google.api.http).patch": "/v1/{app.name=projects/*/locations/*/apps/*}", - "(google.api.http).body": "app", - "(google.api.method_signature)": "app,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{app.name=projects/*/locations/*/apps/*}", - "body": "app" - } - }, - { - "(google.api.method_signature)": "app,update_mask" - } - ] - }, - "DeleteApp": { - "requestType": "DeleteAppRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apps/*}", - "(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/*/apps/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ExportApp": { - "requestType": "ExportAppRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/apps/*}:exportApp", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "ExportAppResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/apps/*}:exportApp", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "ExportAppResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ImportApp": { - "requestType": "ImportAppRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/apps:importApp", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,display_name,app_id", - "(google.longrunning.operation_info).response_type": "ImportAppResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/apps:importApp", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,display_name,app_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "ImportAppResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ListAgents": { - "requestType": "ListAgentsRequest", - "responseType": "ListAgentsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apps/*}/agents", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/apps/*}/agents" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetAgent": { - "requestType": "GetAgentRequest", - "responseType": "Agent", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*/agents/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/apps/*/agents/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateAgent": { - "requestType": "CreateAgentRequest", - "responseType": "Agent", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}/agents", - "(google.api.http).body": "agent", - "(google.api.method_signature)": "parent,agent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/apps/*}/agents", - "body": "agent" - } - }, - { - "(google.api.method_signature)": "parent,agent,agent_id" - }, - { - "(google.api.method_signature)": "parent,agent" - } - ] - }, - "UpdateAgent": { - "requestType": "UpdateAgentRequest", - "responseType": "Agent", - "options": { - "(google.api.http).patch": "/v1/{agent.name=projects/*/locations/*/apps/*/agents/*}", - "(google.api.http).body": "agent", - "(google.api.method_signature)": "agent,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{agent.name=projects/*/locations/*/apps/*/agents/*}", - "body": "agent" - } - }, - { - "(google.api.method_signature)": "agent,update_mask" - } - ] - }, - "DeleteAgent": { - "requestType": "DeleteAgentRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apps/*/agents/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/apps/*/agents/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListExamples": { - "requestType": "ListExamplesRequest", - "responseType": "ListExamplesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apps/*}/examples", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/apps/*}/examples" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetExample": { - "requestType": "GetExampleRequest", - "responseType": "Example", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*/examples/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/apps/*/examples/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateExample": { - "requestType": "CreateExampleRequest", - "responseType": "Example", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}/examples", - "(google.api.http).body": "example", - "(google.api.method_signature)": "parent,example" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/apps/*}/examples", - "body": "example" - } - }, - { - "(google.api.method_signature)": "parent,example,example_id" - }, - { - "(google.api.method_signature)": "parent,example" - } - ] - }, - "UpdateExample": { - "requestType": "UpdateExampleRequest", - "responseType": "Example", - "options": { - "(google.api.http).patch": "/v1/{example.name=projects/*/locations/*/apps/*/examples/*}", - "(google.api.http).body": "example", - "(google.api.method_signature)": "example,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{example.name=projects/*/locations/*/apps/*/examples/*}", - "body": "example" - } - }, - { - "(google.api.method_signature)": "example,update_mask" - } - ] - }, - "DeleteExample": { - "requestType": "DeleteExampleRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apps/*/examples/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/apps/*/examples/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListTools": { - "requestType": "ListToolsRequest", - "responseType": "ListToolsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apps/*}/tools", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/apps/*}/tools" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetTool": { - "requestType": "GetToolRequest", - "responseType": "Tool", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*/tools/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/apps/*/tools/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListConversations": { - "requestType": "ListConversationsRequest", - "responseType": "ListConversationsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apps/*}/conversations", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/apps/*}/conversations" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetConversation": { - "requestType": "GetConversationRequest", - "responseType": "Conversation", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*/conversations/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/apps/*/conversations/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteConversation": { - "requestType": "DeleteConversationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apps/*/conversations/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/apps/*/conversations/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "BatchDeleteConversations": { - "requestType": "BatchDeleteConversationsRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}/conversations:batchDelete", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent", - "(google.longrunning.operation_info).response_type": "BatchDeleteConversationsResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/apps/*}/conversations:batchDelete", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "BatchDeleteConversationsResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "CreateTool": { - "requestType": "CreateToolRequest", - "responseType": "Tool", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}/tools", - "(google.api.http).body": "tool", - "(google.api.method_signature)": "parent,tool" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/apps/*}/tools", - "body": "tool" - } - }, - { - "(google.api.method_signature)": "parent,tool,tool_id" - }, - { - "(google.api.method_signature)": "parent,tool" - } - ] - }, - "UpdateTool": { - "requestType": "UpdateToolRequest", - "responseType": "Tool", - "options": { - "(google.api.http).patch": "/v1/{tool.name=projects/*/locations/*/apps/*/tools/*}", - "(google.api.http).body": "tool", - "(google.api.method_signature)": "tool,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{tool.name=projects/*/locations/*/apps/*/tools/*}", - "body": "tool" - } - }, - { - "(google.api.method_signature)": "tool,update_mask" - } - ] - }, - "DeleteTool": { - "requestType": "DeleteToolRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apps/*/tools/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/apps/*/tools/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListGuardrails": { - "requestType": "ListGuardrailsRequest", - "responseType": "ListGuardrailsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apps/*}/guardrails", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/apps/*}/guardrails" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetGuardrail": { - "requestType": "GetGuardrailRequest", - "responseType": "Guardrail", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*/guardrails/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/apps/*/guardrails/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateGuardrail": { - "requestType": "CreateGuardrailRequest", - "responseType": "Guardrail", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}/guardrails", - "(google.api.http).body": "guardrail", - "(google.api.method_signature)": "parent,guardrail" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/apps/*}/guardrails", - "body": "guardrail" - } - }, - { - "(google.api.method_signature)": "parent,guardrail,guardrail_id" - }, - { - "(google.api.method_signature)": "parent,guardrail" - } - ] - }, - "UpdateGuardrail": { - "requestType": "UpdateGuardrailRequest", - "responseType": "Guardrail", - "options": { - "(google.api.http).patch": "/v1/{guardrail.name=projects/*/locations/*/apps/*/guardrails/*}", - "(google.api.http).body": "guardrail", - "(google.api.method_signature)": "guardrail,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{guardrail.name=projects/*/locations/*/apps/*/guardrails/*}", - "body": "guardrail" - } - }, - { - "(google.api.method_signature)": "guardrail,update_mask" - } - ] - }, - "DeleteGuardrail": { - "requestType": "DeleteGuardrailRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apps/*/guardrails/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/apps/*/guardrails/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListDeployments": { - "requestType": "ListDeploymentsRequest", - "responseType": "ListDeploymentsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apps/*}/deployments", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/apps/*}/deployments" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetDeployment": { - "requestType": "GetDeploymentRequest", - "responseType": "Deployment", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*/deployments/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/apps/*/deployments/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateDeployment": { - "requestType": "CreateDeploymentRequest", - "responseType": "Deployment", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}/deployments", - "(google.api.http).body": "deployment", - "(google.api.method_signature)": "parent,deployment" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/apps/*}/deployments", - "body": "deployment" - } - }, - { - "(google.api.method_signature)": "parent,deployment,deployment_id" - }, - { - "(google.api.method_signature)": "parent,deployment" - } - ] - }, - "UpdateDeployment": { - "requestType": "UpdateDeploymentRequest", - "responseType": "Deployment", - "options": { - "(google.api.http).patch": "/v1/{deployment.name=projects/*/locations/*/apps/*/deployments/*}", - "(google.api.http).body": "deployment", - "(google.api.method_signature)": "deployment,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{deployment.name=projects/*/locations/*/apps/*/deployments/*}", - "body": "deployment" - } - }, - { - "(google.api.method_signature)": "deployment,update_mask" - } - ] - }, - "DeleteDeployment": { - "requestType": "DeleteDeploymentRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apps/*/deployments/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/apps/*/deployments/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListToolsets": { - "requestType": "ListToolsetsRequest", - "responseType": "ListToolsetsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apps/*}/toolsets", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/apps/*}/toolsets" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetToolset": { - "requestType": "GetToolsetRequest", - "responseType": "Toolset", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*/toolsets/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/apps/*/toolsets/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateToolset": { - "requestType": "CreateToolsetRequest", - "responseType": "Toolset", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}/toolsets", - "(google.api.http).body": "toolset", - "(google.api.method_signature)": "parent,toolset" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/apps/*}/toolsets", - "body": "toolset" - } - }, - { - "(google.api.method_signature)": "parent,toolset,toolset_id" - }, - { - "(google.api.method_signature)": "parent,toolset" - } - ] - }, - "UpdateToolset": { - "requestType": "UpdateToolsetRequest", - "responseType": "Toolset", - "options": { - "(google.api.http).patch": "/v1/{toolset.name=projects/*/locations/*/apps/*/toolsets/*}", - "(google.api.http).body": "toolset", - "(google.api.method_signature)": "toolset,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{toolset.name=projects/*/locations/*/apps/*/toolsets/*}", - "body": "toolset" - } - }, - { - "(google.api.method_signature)": "toolset,update_mask" - } - ] - }, - "DeleteToolset": { - "requestType": "DeleteToolsetRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apps/*/toolsets/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/apps/*/toolsets/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListAppVersions": { - "requestType": "ListAppVersionsRequest", - "responseType": "ListAppVersionsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apps/*}/versions", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/apps/*}/versions" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetAppVersion": { - "requestType": "GetAppVersionRequest", - "responseType": "AppVersion", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*/versions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/apps/*/versions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateAppVersion": { - "requestType": "CreateAppVersionRequest", - "responseType": "AppVersion", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}/versions", - "(google.api.http).body": "app_version", - "(google.api.method_signature)": "parent,app_version" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/apps/*}/versions", - "body": "app_version" - } - }, - { - "(google.api.method_signature)": "parent,app_version,app_version_id" - }, - { - "(google.api.method_signature)": "parent,app_version" - } - ] - }, - "DeleteAppVersion": { - "requestType": "DeleteAppVersionRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apps/*/versions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/apps/*/versions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "RestoreAppVersion": { - "requestType": "RestoreAppVersionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/apps/*/versions/*}:restore", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "RestoreAppVersionResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/apps/*/versions/*}:restore", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "RestoreAppVersionResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ListChangelogs": { - "requestType": "ListChangelogsRequest", - "responseType": "ListChangelogsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apps/*}/changelogs", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/apps/*}/changelogs" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetChangelog": { - "requestType": "GetChangelogRequest", - "responseType": "Changelog", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/apps/*/changelogs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/apps/*/changelogs/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - } - } - }, - "ListAppsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/App" - } - }, - "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" - } - } - } - }, - "ListAppsResponse": { - "fields": { - "apps": { - "rule": "repeated", - "type": "App", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "UNORDERED_LIST" - } - } - } - }, - "GetAppRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - } - } - }, - "CreateAppRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/App" - } - }, - "appId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "app": { - "type": "App", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateAppRequest": { - "fields": { - "app": { - "type": "App", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteAppRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - }, - "etag": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ExportAppRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - }, - "exportFormat": { - "type": "ExportFormat", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "gcsUri": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ExportFormat": { - "values": { - "EXPORT_FORMAT_UNSPECIFIED": 0, - "JSON": 1, - "YAML": 2 - } - } - } - }, - "ExportAppResponse": { - "oneofs": { - "app": { - "oneof": [ - "appContent", - "appUri" - ] - } - }, - "fields": { - "appContent": { - "type": "bytes", - "id": 1 - }, - "appUri": { - "type": "string", - "id": 2 - } - } - }, - "ImportAppRequest": { - "oneofs": { - "app": { - "oneof": [ - "gcsUri", - "appContent" - ] - } - }, - "fields": { - "gcsUri": { - "type": "string", - "id": 4 - }, - "appContent": { - "type": "bytes", - "id": 5 - }, - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/App" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "appId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "importOptions": { - "type": "ImportOptions", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ignoreAppLock": { - "type": "bool", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ImportOptions": { - "fields": { - "conflictResolutionStrategy": { - "type": "ConflictResolutionStrategy", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ConflictResolutionStrategy": { - "values": { - "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED": 0, - "REPLACE": 1, - "OVERWRITE": 2 - } - } - } - } - } - }, - "ImportAppResponse": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - }, - "warnings": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "ListAgentsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Agent" - } - }, - "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" - } - } - } - }, - "ListAgentsResponse": { - "fields": { - "agents": { - "rule": "repeated", - "type": "Agent", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetAgentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - } - } - }, - "CreateAgentRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Agent" - } - }, - "agentId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "agent": { - "type": "Agent", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateAgentRequest": { - "fields": { - "agent": { - "type": "Agent", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteAgentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - }, - "force": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "OperationMetadata": { - "fields": { - "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" - } - }, - "statusMessage": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "requestedCancellation": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "ListExamplesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Example" - } - }, - "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" - } - } - } - }, - "ListExamplesResponse": { - "fields": { - "examples": { - "rule": "repeated", - "type": "Example", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetExampleRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Example" - } - } - } - }, - "CreateExampleRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Example" - } - }, - "exampleId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "example": { - "type": "Example", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateExampleRequest": { - "fields": { - "example": { - "type": "Example", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteExampleRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Example" - } - }, - "etag": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListToolsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Tool" - } - }, - "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" - } - } - } - }, - "ListToolsResponse": { - "fields": { - "tools": { - "rule": "repeated", - "type": "Tool", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetToolRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - } - } - }, - "CreateToolRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Tool" - } - }, - "toolId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tool": { - "type": "Tool", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateToolRequest": { - "fields": { - "tool": { - "type": "Tool", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteToolRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "force": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListConversationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Conversation" - } - }, - "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" - } - }, - "source": { - "type": "Conversation.Source", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sources": { - "rule": "repeated", - "type": "Conversation.Source", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListConversationsResponse": { - "fields": { - "conversations": { - "rule": "repeated", - "type": "Conversation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetConversationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" - } - }, - "source": { - "type": "Conversation.Source", - "id": 2, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteConversationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" - } - }, - "source": { - "type": "Conversation.Source", - "id": 2, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "BatchDeleteConversationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Conversation" - } - }, - "conversations": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" - } - } - } - }, - "BatchDeleteConversationsResponse": { - "fields": { - "deletedConversations": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "failedConversations": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "errorMessages": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListGuardrailsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Guardrail" - } - }, - "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" - } - } - } - }, - "ListGuardrailsResponse": { - "fields": { - "guardrails": { - "rule": "repeated", - "type": "Guardrail", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetGuardrailRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" - } - } - } - }, - "CreateGuardrailRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Guardrail" - } - }, - "guardrailId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "guardrail": { - "type": "Guardrail", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateGuardrailRequest": { - "fields": { - "guardrail": { - "type": "Guardrail", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteGuardrailRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" - } - }, - "force": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListDeploymentsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Deployment" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListDeploymentsResponse": { - "fields": { - "deployments": { - "rule": "repeated", - "type": "Deployment", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetDeploymentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" - } - } - } - }, - "CreateDeploymentRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Deployment" - } - }, - "deploymentId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "deployment": { - "type": "Deployment", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateDeploymentRequest": { - "fields": { - "deployment": { - "type": "Deployment", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteDeploymentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" - } - }, - "etag": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListToolsetsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Toolset" - } - }, - "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" - } - } - } - }, - "ListToolsetsResponse": { - "fields": { - "toolsets": { - "rule": "repeated", - "type": "Toolset", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetToolsetRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" - } - } - } - }, - "CreateToolsetRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Toolset" - } - }, - "toolsetId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "toolset": { - "type": "Toolset", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateToolsetRequest": { - "fields": { - "toolset": { - "type": "Toolset", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteToolsetRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" - } - }, - "force": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListAppVersionsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/AppVersion" - } - }, - "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" - } - } - } - }, - "ListAppVersionsResponse": { - "fields": { - "appVersions": { - "rule": "repeated", - "type": "AppVersion", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetAppVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" - } - } - } - }, - "DeleteAppVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" - } - }, - "etag": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateAppVersionRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/AppVersion" - } - }, - "appVersionId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "appVersion": { - "type": "AppVersion", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "RestoreAppVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" - } - } - } - }, - "RestoreAppVersionResponse": { - "fields": {} - }, - "ListChangelogsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Changelog" - } - }, - "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" - } - } - } - }, - "ListChangelogsResponse": { - "fields": { - "changelogs": { - "rule": "repeated", - "type": "Changelog", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetChangelogRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Changelog" - } - } - } - }, - "App": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/App", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}", - "(google.api.resource).plural": "apps", - "(google.api.resource).singular": "app" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pinned": { - "type": "bool", - "id": 31, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "rootAgent": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - }, - "languageSettings": { - "type": "LanguageSettings", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "timeZoneSettings": { - "type": "TimeZoneSettings", - "id": 27, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "audioProcessingConfig": { - "type": "AudioProcessingConfig", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "loggingSettings": { - "type": "LoggingSettings", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "modelSettings": { - "type": "ModelSettings", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "toolExecutionMode": { - "type": "ToolExecutionMode", - "id": 32, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "evaluationMetricsThresholds": { - "type": "EvaluationMetricsThresholds", - "id": 24, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "variableDeclarations": { - "rule": "repeated", - "type": "VariableDeclaration", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "predefinedVariableDeclarations": { - "rule": "repeated", - "type": "VariableDeclaration", - "id": 28, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "globalInstruction": { - "type": "string", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "guardrails": { - "rule": "repeated", - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" - } - }, - "dataStoreSettings": { - "type": "DataStoreSettings", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "defaultChannelProfile": { - "type": "ChannelProfile", - "id": 22, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "metadata": { - "keyType": "string", - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deploymentCount": { - "type": "int32", - "id": 23, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "clientCertificateSettings": { - "type": "ClientCertificateSettings", - "id": 25, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "locked": { - "type": "bool", - "id": 29, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "VariableDeclaration": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "schema": { - "type": "Schema", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ToolExecutionMode": { - "values": { - "TOOL_EXECUTION_MODE_UNSPECIFIED": 0, - "PARALLEL": 1, - "SEQUENTIAL": 2 - } - } - } - }, - "TimeZoneSettings": { - "fields": { - "timeZone": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "LanguageSettings": { - "fields": { - "defaultLanguageCode": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "supportedLanguageCodes": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableMultilingualSupport": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fallbackAction": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AudioProcessingConfig": { - "fields": { - "synthesizeSpeechConfigs": { - "keyType": "string", - "type": "SynthesizeSpeechConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "bargeInConfig": { - "type": "BargeInConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "inactivityTimeout": { - "type": "google.protobuf.Duration", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ambientSoundConfig": { - "type": "AmbientSoundConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AmbientSoundConfig": { - "oneofs": { - "source": { - "oneof": [ - "prebuiltAmbientNoise", - "gcsUri", - "prebuiltAmbientSound" - ] - } - }, - "fields": { - "prebuiltAmbientNoise": { - "type": "PrebuiltAmbientNoise", - "id": 1, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gcsUri": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "prebuiltAmbientSound": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "volumeGainDb": { - "type": "double", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "PrebuiltAmbientNoise": { - "values": { - "PREBUILT_AMBIENT_NOISE_UNSPECIFIED": 0, - "RETAIL_STORE": 1, - "CONVENTION_HALL": 2, - "OUTDOOR": 3 - } - } - } - }, - "BargeInConfig": { - "fields": { - "disableBargeIn": { - "type": "bool", - "id": 1, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "bargeInAwareness": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SynthesizeSpeechConfig": { - "fields": { - "voice": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "speakingRate": { - "type": "double", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "MetricAnalysisSettings": { - "fields": { - "llmMetricsOptedOut": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "LoggingSettings": { - "fields": { - "redactionConfig": { - "type": "RedactionConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "audioRecordingConfig": { - "type": "AudioRecordingConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "bigqueryExportSettings": { - "type": "BigQueryExportSettings", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "cloudLoggingSettings": { - "type": "CloudLoggingSettings", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "conversationLoggingSettings": { - "type": "ConversationLoggingSettings", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "evaluationAudioRecordingConfig": { - "type": "AudioRecordingConfig", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "metricAnalysisSettings": { - "type": "MetricAnalysisSettings", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "EvaluationMetricsThresholds": { - "fields": { - "goldenEvaluationMetricsThresholds": { - "type": "GoldenEvaluationMetricsThresholds", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "hallucinationMetricBehavior": { - "type": "HallucinationMetricBehavior", - "id": 3, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "goldenHallucinationMetricBehavior": { - "type": "HallucinationMetricBehavior", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scenarioHallucinationMetricBehavior": { - "type": "HallucinationMetricBehavior", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "GoldenEvaluationMetricsThresholds": { - "fields": { - "turnLevelMetricsThresholds": { - "type": "TurnLevelMetricsThresholds", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "expectationLevelMetricsThresholds": { - "type": "ExpectationLevelMetricsThresholds", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "toolMatchingSettings": { - "type": "ToolMatchingSettings", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "TurnLevelMetricsThresholds": { - "oneofs": { - "_semanticSimilaritySuccessThreshold": { - "oneof": [ - "semanticSimilaritySuccessThreshold" - ] - }, - "_overallToolInvocationCorrectnessThreshold": { - "oneof": [ - "overallToolInvocationCorrectnessThreshold" - ] - } - }, - "fields": { - "semanticSimilaritySuccessThreshold": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "overallToolInvocationCorrectnessThreshold": { - "type": "float", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "semanticSimilarityChannel": { - "type": "SemanticSimilarityChannel", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "SemanticSimilarityChannel": { - "values": { - "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED": 0, - "TEXT": 1, - "AUDIO": 2 - } - } - } - }, - "ExpectationLevelMetricsThresholds": { - "oneofs": { - "_toolInvocationParameterCorrectnessThreshold": { - "oneof": [ - "toolInvocationParameterCorrectnessThreshold" - ] - } - }, - "fields": { - "toolInvocationParameterCorrectnessThreshold": { - "type": "float", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - } - } - }, - "ToolMatchingSettings": { - "fields": { - "extraToolCallBehavior": { - "type": "ExtraToolCallBehavior", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ExtraToolCallBehavior": { - "values": { - "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED": 0, - "FAIL": 1, - "ALLOW": 2 - } - } - } - }, - "HallucinationMetricBehavior": { - "values": { - "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": 0, - "DISABLED": 1, - "ENABLED": 2 - } - } - } - }, - "ClientCertificateSettings": { - "fields": { - "tlsCertificate": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "privateKey": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" - } - }, - "passphrase": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ConversationLoggingSettings": { - "fields": { - "disableConversationLogging": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CloudLoggingSettings": { - "fields": { - "enableCloudLogging": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AudioRecordingConfig": { - "fields": { - "gcsBucket": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gcsPathPrefix": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RedactionConfig": { - "fields": { - "enableRedaction": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "inspectTemplate": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "dlp.googleapis.com/InspectTemplate" - } - }, - "deidentifyTemplate": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "dlp.googleapis.com/DeidentifyTemplate" - } - } - } - }, - "DataStoreSettings": { - "fields": { - "engines": { - "rule": "repeated", - "type": "Engine", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "Engine": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "discoveryengine.googleapis.com/Engine" - } - }, - "type": { - "type": "Type", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "ENGINE_TYPE_SEARCH": 1, - "ENGINE_TYPE_CHAT": 2 - } - } - } - } - } - }, - "BigQueryExportSettings": { - "fields": { - "enabled": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "project": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "dataset": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Schema": { - "oneofs": { - "_minimum": { - "oneof": [ - "minimum" - ] - }, - "_maximum": { - "oneof": [ - "maximum" - ] - } - }, - "fields": { - "type": { - "type": "Type", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "properties": { - "keyType": "string", - "type": "Schema", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "required": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "description": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "items": { - "type": "Schema", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "nullable": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "uniqueItems": { - "type": "bool", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "prefixItems": { - "rule": "repeated", - "type": "Schema", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "additionalProperties": { - "type": "Schema", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "anyOf": { - "rule": "repeated", - "type": "Schema", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enum": { - "rule": "repeated", - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "default": { - "type": "google.protobuf.Value", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ref": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "defs": { - "keyType": "string", - "type": "Schema", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "title": { - "type": "string", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "minItems": { - "type": "int64", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxItems": { - "type": "int64", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "minimum": { - "type": "double", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "maximum": { - "type": "double", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "STRING": 1, - "INTEGER": 2, - "NUMBER": 3, - "BOOLEAN": 4, - "OBJECT": 5, - "ARRAY": 6 - } - } - } - }, - "AppSnapshot": { - "fields": { - "app": { - "type": "App", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "agents": { - "rule": "repeated", - "type": "Agent", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tools": { - "rule": "repeated", - "type": "Tool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "examples": { - "rule": "repeated", - "type": "Example", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "guardrails": { - "rule": "repeated", - "type": "Guardrail", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "toolsets": { - "rule": "repeated", - "type": "Toolset", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AppVersion": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/AppVersion", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/versions/{version}", - "(google.api.resource).plural": "appVersions", - "(google.api.resource).singular": "appVersion" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "creator": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "snapshot": { - "type": "AppSnapshot", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Example": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Example", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/examples/{example}", - "(google.api.resource).plural": "examples", - "(google.api.resource).singular": "example" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "entryAgent": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - }, - "messages": { - "rule": "repeated", - "type": "Message", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "invalid": { - "type": "bool", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 9 - } - } - }, - "Message": { - "fields": { - "role": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "chunks": { - "rule": "repeated", - "type": "Chunk", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "eventTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Chunk": { - "oneofs": { - "data": { - "oneof": [ - "text", - "transcript", - "payload", - "image", - "toolCall", - "toolResponse", - "agentTransfer", - "updatedVariables", - "defaultVariables" - ] - } - }, - "fields": { - "text": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "transcript": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "payload": { - "type": "google.protobuf.Struct", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "image": { - "type": "Image", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "toolCall": { - "type": "ToolCall", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "toolResponse": { - "type": "ToolResponse", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "agentTransfer": { - "type": "AgentTransfer", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "updatedVariables": { - "type": "google.protobuf.Struct", - "id": 8 - }, - "defaultVariables": { - "type": "google.protobuf.Struct", - "id": 10 - } - } - }, - "Blob": { - "fields": { - "mimeType": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "data": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Image": { - "fields": { - "mimeType": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "data": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ToolCall": { - "oneofs": { - "toolIdentifier": { - "oneof": [ - "tool", - "toolsetTool" - ] - } - }, - "fields": { - "tool": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "toolsetTool": { - "type": "ToolsetTool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "id": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "displayName": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "args": { - "type": "google.protobuf.Struct", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ToolResponse": { - "oneofs": { - "toolIdentifier": { - "oneof": [ - "tool", - "toolsetTool" - ] - } - }, - "fields": { - "tool": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "toolsetTool": { - "type": "ToolsetTool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "id": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "displayName": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "response": { - "type": "google.protobuf.Struct", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "AgentTransfer": { - "fields": { - "targetAgent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "ToolsetTool": { - "fields": { - "toolset": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" - } - }, - "toolId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Guardrail": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Guardrail", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}", - "(google.api.resource).plural": "guardrails", - "(google.api.resource).singular": "guardrail" - }, - "oneofs": { - "guardrailType": { - "oneof": [ - "contentFilter", - "llmPromptSecurity", - "llmPolicy", - "modelSafety", - "codeCallback" - ] - } - }, - "fields": { - "contentFilter": { - "type": "ContentFilter", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "llmPromptSecurity": { - "type": "LlmPromptSecurity", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "llmPolicy": { - "type": "LlmPolicy", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "modelSafety": { - "type": "ModelSafety", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "codeCallback": { - "type": "CodeCallback", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enabled": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "action": { - "type": "TriggerAction", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 11 - } - }, - "nested": { - "ContentFilter": { - "fields": { - "bannedContents": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "bannedContentsInUserInput": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "bannedContentsInAgentResponse": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "matchType": { - "type": "MatchType", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "disregardDiacritics": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "MatchType": { - "values": { - "MATCH_TYPE_UNSPECIFIED": 0, - "SIMPLE_STRING_MATCH": 1, - "WORD_BOUNDARY_STRING_MATCH": 2, - "REGEXP_MATCH": 3 - } - } - } - }, - "LlmPromptSecurity": { - "oneofs": { - "securityConfig": { - "oneof": [ - "defaultSettings", - "customPolicy" - ] - } - }, - "fields": { - "defaultSettings": { - "type": "DefaultSecuritySettings", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "customPolicy": { - "type": "LlmPolicy", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "failOpen": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "DefaultSecuritySettings": { - "fields": { - "defaultPromptTemplate": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - } - } - }, - "LlmPolicy": { - "fields": { - "maxConversationMessages": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "modelSettings": { - "type": "ModelSettings", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "prompt": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "policyScope": { - "type": "PolicyScope", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "failOpen": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowShortUtterance": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "PolicyScope": { - "values": { - "POLICY_SCOPE_UNSPECIFIED": 0, - "USER_QUERY": 1, - "AGENT_RESPONSE": 2, - "USER_QUERY_AND_AGENT_RESPONSE": 3 - } - } - } - }, - "ModelSafety": { - "fields": { - "safetySettings": { - "rule": "repeated", - "type": "SafetySetting", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "SafetySetting": { - "fields": { - "category": { - "type": "HarmCategory", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "threshold": { - "type": "HarmBlockThreshold", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "HarmCategory": { - "values": { - "HARM_CATEGORY_UNSPECIFIED": 0, - "HARM_CATEGORY_HATE_SPEECH": 1, - "HARM_CATEGORY_DANGEROUS_CONTENT": 2, - "HARM_CATEGORY_HARASSMENT": 3, - "HARM_CATEGORY_SEXUALLY_EXPLICIT": 4 - } - }, - "HarmBlockThreshold": { - "values": { - "HARM_BLOCK_THRESHOLD_UNSPECIFIED": 0, - "BLOCK_LOW_AND_ABOVE": 1, - "BLOCK_MEDIUM_AND_ABOVE": 2, - "BLOCK_ONLY_HIGH": 3, - "BLOCK_NONE": 4, - "OFF": 5 - } - } - } - }, - "CodeCallback": { - "fields": { - "beforeAgentCallback": { - "type": "Callback", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "afterAgentCallback": { - "type": "Callback", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "beforeModelCallback": { - "type": "Callback", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "afterModelCallback": { - "type": "Callback", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "Tool": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Tool", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/tools/{tool}", - "(google.api.resource).plural": "tools", - "(google.api.resource).singular": "tool" - }, - "oneofs": { - "toolType": { - "oneof": [ - "clientFunction", - "openApiTool", - "googleSearchTool", - "connectorTool", - "dataStoreTool", - "pythonFunction", - "mcpTool", - "fileSearchTool", - "systemTool", - "widgetTool" - ] - } - }, - "fields": { - "clientFunction": { - "type": "ClientFunction", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "openApiTool": { - "type": "OpenApiTool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "googleSearchTool": { - "type": "GoogleSearchTool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "connectorTool": { - "type": "ConnectorTool", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "dataStoreTool": { - "type": "DataStoreTool", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pythonFunction": { - "type": "PythonFunction", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "mcpTool": { - "type": "McpTool", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fileSearchTool": { - "type": "FileSearchTool", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "systemTool": { - "type": "SystemTool", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "widgetTool": { - "type": "WidgetTool", - "id": 24, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "executionType": { - "type": "ExecutionType", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 14 - }, - "generatedSummary": { - "type": "string", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "toolFakeConfig": { - "type": "ToolFakeConfig", - "id": 20, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ClientFunction": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "parameters": { - "type": "Schema", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "response": { - "type": "Schema", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Action": { - "oneofs": { - "actionSpec": { - "oneof": [ - "connectionActionId", - "entityOperation" - ] - } - }, - "fields": { - "connectionActionId": { - "type": "string", - "id": 4 - }, - "entityOperation": { - "type": "EntityOperation", - "id": 5 - }, - "inputFields": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "outputFields": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "EntityOperation": { - "fields": { - "entityId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "operation": { - "type": "OperationType", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "OperationType": { - "values": { - "OPERATION_TYPE_UNSPECIFIED": 0, - "LIST": 1, - "GET": 2, - "CREATE": 3, - "UPDATE": 4, - "DELETE": 5 - } - } - } - } - } - }, - "ConnectorTool": { - "fields": { - "connection": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "action": { - "type": "Action", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "authConfig": { - "type": "EndUserAuthConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "description": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ApiKeyConfig": { - "fields": { - "keyName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "apiKeySecretVersion": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" - } - }, - "requestLocation": { - "type": "RequestLocation", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "RequestLocation": { - "values": { - "REQUEST_LOCATION_UNSPECIFIED": 0, - "HEADER": 1, - "QUERY_STRING": 2 - } - } - } - }, - "OAuthConfig": { - "fields": { - "oauthGrantType": { - "type": "OauthGrantType", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clientId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clientSecretVersion": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" - } - }, - "tokenEndpoint": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "scopes": { - "rule": "repeated", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "OauthGrantType": { - "values": { - "OAUTH_GRANT_TYPE_UNSPECIFIED": 0, - "CLIENT_CREDENTIAL": 1 - } - } - } - }, - "ServiceAgentIdTokenAuthConfig": { - "fields": {} - }, - "ServiceAccountAuthConfig": { - "fields": { - "serviceAccount": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "scopes": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "BearerTokenConfig": { - "fields": { - "token": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "EndUserAuthConfig": { - "oneofs": { - "authConfig": { - "oneof": [ - "oauth2AuthCodeConfig", - "oauth2JwtBearerConfig" - ] - } - }, - "fields": { - "oauth2AuthCodeConfig": { - "type": "Oauth2AuthCodeConfig", - "id": 2 - }, - "oauth2JwtBearerConfig": { - "type": "Oauth2JwtBearerConfig", - "id": 3 - } - }, - "nested": { - "Oauth2AuthCodeConfig": { - "fields": { - "oauthToken": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Oauth2JwtBearerConfig": { - "fields": { - "issuer": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "subject": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clientKey": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "ApiAuthentication": { - "oneofs": { - "authConfig": { - "oneof": [ - "apiKeyConfig", - "oauthConfig", - "serviceAgentIdTokenAuthConfig", - "serviceAccountAuthConfig", - "bearerTokenConfig" - ] - } - }, - "fields": { - "apiKeyConfig": { - "type": "ApiKeyConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "oauthConfig": { - "type": "OAuthConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAgentIdTokenAuthConfig": { - "type": "ServiceAgentIdTokenAuthConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccountAuthConfig": { - "type": "ServiceAccountAuthConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "bearerTokenConfig": { - "type": "BearerTokenConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DataStoreTool": { - "oneofs": { - "searchSource": { - "oneof": [ - "dataStoreSource", - "engineSource" - ] - } - }, - "fields": { - "dataStoreSource": { - "type": "DataStoreSource", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "engineSource": { - "type": "EngineSource", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "boostSpecs": { - "rule": "repeated", - "type": "BoostSpecs", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "modalityConfigs": { - "rule": "repeated", - "type": "ModalityConfig", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filterParameterBehavior": { - "type": "FilterParameterBehavior", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "RewriterConfig": { - "fields": { - "modelSettings": { - "type": "ModelSettings", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "prompt": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "disabled": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SummarizationConfig": { - "fields": { - "modelSettings": { - "type": "ModelSettings", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "prompt": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "disabled": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GroundingConfig": { - "fields": { - "groundingLevel": { - "type": "float", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "disabled": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DataStoreSource": { - "fields": { - "filter": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "dataStore": { - "type": "DataStore", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "EngineSource": { - "fields": { - "engine": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "dataStoreSources": { - "rule": "repeated", - "type": "DataStoreSource", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "BoostSpecs": { - "fields": { - "dataStores": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "spec": { - "rule": "repeated", - "type": "BoostSpec", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BoostSpec": { - "fields": { - "conditionBoostSpecs": { - "rule": "repeated", - "type": "ConditionBoostSpec", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "ConditionBoostSpec": { - "fields": { - "condition": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "boost": { - "type": "float", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "boostControlSpec": { - "type": "BoostControlSpec", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "BoostControlSpec": { - "fields": { - "fieldName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "attributeType": { - "type": "AttributeType", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "interpolationType": { - "type": "InterpolationType", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "controlPoints": { - "rule": "repeated", - "type": "ControlPoint", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ControlPoint": { - "fields": { - "attributeValue": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "boostAmount": { - "type": "float", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AttributeType": { - "values": { - "ATTRIBUTE_TYPE_UNSPECIFIED": 0, - "NUMERICAL": 1, - "FRESHNESS": 2 - } - }, - "InterpolationType": { - "values": { - "INTERPOLATION_TYPE_UNSPECIFIED": 0, - "LINEAR": 1 - } - } - } - } - } - } - } - }, - "ModalityConfig": { - "fields": { - "modalityType": { - "type": "ModalityType", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "rewriterConfig": { - "type": "RewriterConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "summarizationConfig": { - "type": "SummarizationConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "groundingConfig": { - "type": "GroundingConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ModalityType": { - "values": { - "MODALITY_TYPE_UNSPECIFIED": 0, - "TEXT": 1, - "AUDIO": 2 - } - } - } - }, - "FilterParameterBehavior": { - "values": { - "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED": 0, - "ALWAYS_INCLUDE": 2, - "NEVER_INCLUDE": 3 - } - } - } - }, - "DataStore": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "type": { - "type": "DataStoreType", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "documentProcessingMode": { - "type": "DocumentProcessingMode", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "displayName": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "connectorConfig": { - "type": "ConnectorConfig", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "ConnectorConfig": { - "fields": { - "collection": { - "type": "string", - "id": 1 - }, - "collectionDisplayName": { - "type": "string", - "id": 2 - }, - "dataSource": { - "type": "string", - "id": 3 - } - } - }, - "DataStoreType": { - "values": { - "DATA_STORE_TYPE_UNSPECIFIED": 0, - "PUBLIC_WEB": 1, - "UNSTRUCTURED": 2, - "FAQ": 3, - "CONNECTOR": 4 - } - }, - "DocumentProcessingMode": { - "values": { - "DOCUMENT_PROCESSING_MODE_UNSPECIFIED": 0, - "DOCUMENTS": 1, - "CHUNKS": 2 - } - } - } - }, - "CodeBlock": { - "fields": { - "pythonCode": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ToolFakeConfig": { - "oneofs": { - "toolResponse": { - "oneof": [ - "codeBlock" - ] - } - }, - "fields": { - "codeBlock": { - "type": "CodeBlock", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableFakeMode": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "FileSearchTool": { - "fields": { - "corpusType": { - "type": "CorpusType", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fileCorpus": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "CorpusType": { - "values": { - "CORPUS_TYPE_UNSPECIFIED": 0, - "USER_OWNED": 1, - "FULLY_MANAGED": 2 - } - } - } - }, - "GoogleSearchTool": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "contextUrls": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "preferredDomains": { - "rule": "repeated", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "excludeDomains": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "promptConfig": { - "type": "PromptConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "PromptConfig": { - "fields": { - "textPrompt": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "voicePrompt": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "McpTool": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "inputSchema": { - "type": "Schema", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "outputSchema": { - "type": "Schema", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serverAddress": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "apiAuthentication": { - "type": "ApiAuthentication", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tlsConfig": { - "type": "TlsConfig", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceDirectoryConfig": { - "type": "ServiceDirectoryConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "OpenApiTool": { - "fields": { - "openApiSchema": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "name": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "apiAuthentication": { - "type": "ApiAuthentication", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tlsConfig": { - "type": "TlsConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceDirectoryConfig": { - "type": "ServiceDirectoryConfig", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ignoreUnknownFields": { - "type": "bool", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "url": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PythonFunction": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pythonCode": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "SystemTool": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "WidgetTool": { - "oneofs": { - "input": { - "oneof": [ - "parameters" - ] - } - }, - "fields": { - "parameters": { - "type": "Schema", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "widgetType": { - "type": "WidgetType", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "WidgetType": { - "values": { - "WIDGET_TYPE_UNSPECIFIED": 0, - "CUSTOM": 1, - "PRODUCT_CAROUSEL": 2, - "PRODUCT_DETAILS": 3, - "QUICK_ACTIONS": 4, - "PRODUCT_COMPARISON": 5, - "ADVANCED_PRODUCT_DETAILS": 6, - "SHORT_FORM": 7, - "OVERALL_SATISFACTION": 8, - "ORDER_SUMMARY": 9, - "APPOINTMENT_DETAILS": 10 - } - } - } - }, - "Toolset": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Toolset", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}", - "(google.api.resource).plural": "toolsets", - "(google.api.resource).singular": "toolset" - }, - "oneofs": { - "toolsetType": { - "oneof": [ - "mcpToolset", - "openApiToolset", - "connectorToolset" - ] - } - }, - "fields": { - "mcpToolset": { - "type": "McpToolset", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "openApiToolset": { - "type": "OpenApiToolset", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "connectorToolset": { - "type": "ConnectorToolset", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "description": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 5 - }, - "executionType": { - "type": "ExecutionType", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "toolFakeConfig": { - "type": "ToolFakeConfig", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ConnectorToolset": { - "fields": { - "connection": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "authConfig": { - "type": "EndUserAuthConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "connectorActions": { - "rule": "repeated", - "type": "Action", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "McpToolset": { - "fields": { - "serverAddress": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "apiAuthentication": { - "type": "ApiAuthentication", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceDirectoryConfig": { - "type": "ServiceDirectoryConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tlsConfig": { - "type": "TlsConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "OpenApiToolset": { - "fields": { - "openApiSchema": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "apiAuthentication": { - "type": "ApiAuthentication", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tlsConfig": { - "type": "TlsConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceDirectoryConfig": { - "type": "ServiceDirectoryConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ignoreUnknownFields": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "url": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Changelog": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Changelog", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}", - "(google.api.resource).plural": "changelogs", - "(google.api.resource).singular": "changelog" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "author": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "displayName": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "description": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "resource": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "resourceType": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "action": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "originalResource": { - "type": "google.protobuf.Struct", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "newResource": { - "type": "google.protobuf.Struct", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "dependentResources": { - "rule": "repeated", - "type": "google.protobuf.Struct", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "sequenceNumber": { - "type": "int64", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Conversation": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Conversation", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}", - "(google.api.resource).plural": "conversations", - "(google.api.resource).singular": "conversation" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "turns": { - "rule": "repeated", - "type": "Turn", - "id": 6, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "turnCount": { - "type": "int32", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "channelType": { - "type": "ChannelType", - "id": 8, - "options": { - "deprecated": true - } - }, - "source": { - "type": "Source", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "inputTypes": { - "rule": "repeated", - "type": "InputType", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "entryAgent": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - }, - "deployment": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" - } - }, - "appVersion": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" - } - }, - "languageCode": { - "type": "string", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "messages": { - "rule": "repeated", - "type": "Message", - "id": 2, - "options": { - "deprecated": true - } - } - }, - "nested": { - "Turn": { - "fields": { - "messages": { - "rule": "repeated", - "type": "Message", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "rootSpan": { - "type": "Span", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ChannelType": { - "values": { - "CHANNEL_TYPE_UNSPECIFIED": 0, - "TEXT": 1, - "AUDIO": 2, - "MULTIMODAL": 3 - } - }, - "Source": { - "values": { - "SOURCE_UNSPECIFIED": 0, - "LIVE": 1, - "SIMULATOR": 2, - "EVAL": 3 - } - }, - "InputType": { - "values": { - "INPUT_TYPE_UNSPECIFIED": 0, - "INPUT_TYPE_TEXT": 1, - "INPUT_TYPE_AUDIO": 2, - "INPUT_TYPE_IMAGE": 3, - "INPUT_TYPE_BLOB": 4, - "INPUT_TYPE_TOOL_RESPONSE": 5, - "INPUT_TYPE_VARIABLES": 6 - } - } - } - }, - "Deployment": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Deployment", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}", - "(google.api.resource).plural": "deployments", - "(google.api.resource).singular": "deployment" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "appVersion": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" - } - }, - "channelProfile": { - "type": "ChannelProfile", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "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" - } - }, - "etag": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Omnichannel": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Omnichannel", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/omnichannels/{omnichannel}", - "(google.api.resource).plural": "omnichannels", - "(google.api.resource).singular": "omnichannel" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "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" - } - }, - "etag": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "integrationConfig": { - "type": "OmnichannelIntegrationConfig", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "OmnichannelIntegrationConfig": { - "fields": { - "channelConfigs": { - "keyType": "string", - "type": "ChannelConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "subscriberConfigs": { - "keyType": "string", - "type": "SubscriberConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "routingConfigs": { - "keyType": "string", - "type": "RoutingConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ChannelConfig": { - "oneofs": { - "channelConfig": { - "oneof": [ - "whatsappConfig" - ] - } - }, - "fields": { - "whatsappConfig": { - "type": "WhatsappConfig", - "id": 1 - } - } - }, - "WhatsappConfig": { - "fields": { - "phoneNumberId": { - "type": "string", - "id": 1 - }, - "phoneNumber": { - "type": "string", - "id": 2 - }, - "whatsappBusinessAccountId": { - "type": "string", - "id": 3 - }, - "webhookVerifyToken": { - "type": "string", - "id": 4 - }, - "whatsappBusinessToken": { - "type": "string", - "id": 5 - }, - "metaBusinessPortfolioId": { - "type": "string", - "id": 6 - } - } - }, - "SubscriberConfig": { - "oneofs": { - "subscriberConfig": { - "oneof": [ - "cesAppConfig" - ] - } - }, - "fields": { - "cesAppConfig": { - "type": "CesAppConfig", - "id": 1 - } - } - }, - "CesAppConfig": { - "fields": { - "app": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - } - } - }, - "RoutingConfig": { - "fields": { - "subscriberKey": { - "type": "string", - "id": 1 - } - } - } - } - }, - "OmnichannelOperationMetadata": { - "fields": { - "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" - } - }, - "statusMessage": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "requestedCancellation": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "GoogleSearchSuggestions": { - "fields": { - "htmls": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "webSearchQueries": { - "rule": "repeated", - "type": "WebSearchQuery", - "id": 2 - } - } - }, - "WebSearchQuery": { - "fields": { - "query": { - "type": "string", - "id": 1 - }, - "uri": { - "type": "string", - "id": 2 - } - } - }, - "SessionService": { - "options": { - "(google.api.default_host)": "ces.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "RunSession": { - "requestType": "RunSessionRequest", - "responseType": "RunSessionResponse", - "options": { - "(google.api.http).post": "/v1/{config.session=projects/*/locations/*/apps/*/sessions/*}:runSession", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{config.session=projects/*/locations/*/apps/*/sessions/*}:runSession", - "body": "*" - } - } - ] - }, - "BidiRunSession": { - "requestType": "BidiSessionClientMessage", - "requestStream": true, - "responseType": "BidiSessionServerMessage", - "responseStream": true - } - } - }, - "AudioEncoding": { - "values": { - "AUDIO_ENCODING_UNSPECIFIED": 0, - "LINEAR16": 1, - "MULAW": 2, - "ALAW": 3 - } - }, - "InputAudioConfig": { - "fields": { - "audioEncoding": { - "type": "AudioEncoding", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "sampleRateHertz": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "noiseSuppressionLevel": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "OutputAudioConfig": { - "fields": { - "audioEncoding": { - "type": "AudioEncoding", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "sampleRateHertz": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "SessionConfig": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Session" - } - }, - "inputAudioConfig": { - "type": "InputAudioConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "outputAudioConfig": { - "type": "OutputAudioConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "historicalContexts": { - "rule": "repeated", - "type": "Message", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "entryAgent": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - }, - "deployment": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "timeZone": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "remoteDialogflowQueryParameters": { - "type": "RemoteDialogflowQueryParameters", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "RemoteDialogflowQueryParameters": { - "fields": { - "webhookHeaders": { - "keyType": "string", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "payload": { - "type": "google.protobuf.Struct", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "endUserMetadata": { - "type": "google.protobuf.Struct", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "ToolCalls": { - "fields": { - "toolCalls": { - "rule": "repeated", - "type": "ToolCall", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ToolResponses": { - "fields": { - "toolResponses": { - "rule": "repeated", - "type": "ToolResponse", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Citations": { - "fields": { - "citedChunks": { - "rule": "repeated", - "type": "CitedChunk", - "id": 1 - } - }, - "nested": { - "CitedChunk": { - "fields": { - "uri": { - "type": "string", - "id": 1 - }, - "title": { - "type": "string", - "id": 2 - }, - "text": { - "type": "string", - "id": 3 - } - } - } - } - }, - "Event": { - "fields": { - "event": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "SessionInput": { - "oneofs": { - "inputType": { - "oneof": [ - "text", - "dtmf", - "audio", - "toolResponses", - "image", - "blob", - "variables", - "event" - ] - } - }, - "fields": { - "text": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "dtmf": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "audio": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "toolResponses": { - "type": "ToolResponses", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "image": { - "type": "Image", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "blob": { - "type": "Blob", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "variables": { - "type": "google.protobuf.Struct", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "event": { - "type": "Event", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "willContinue": { - "type": "bool", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SessionOutput": { - "oneofs": { - "outputType": { - "oneof": [ - "text", - "audio", - "toolCalls", - "citations", - "googleSearchSuggestions", - "endSession", - "payload" - ] - } - }, - "fields": { - "text": { - "type": "string", - "id": 1 - }, - "audio": { - "type": "bytes", - "id": 2 - }, - "toolCalls": { - "type": "ToolCalls", - "id": 3 - }, - "citations": { - "type": "Citations", - "id": 8 - }, - "googleSearchSuggestions": { - "type": "GoogleSearchSuggestions", - "id": 10 - }, - "endSession": { - "type": "EndSession", - "id": 9 - }, - "payload": { - "type": "google.protobuf.Struct", - "id": 11 - }, - "turnIndex": { - "type": "int32", - "id": 6 - }, - "turnCompleted": { - "type": "bool", - "id": 4 - }, - "diagnosticInfo": { - "type": "DiagnosticInfo", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "DiagnosticInfo": { - "fields": { - "messages": { - "rule": "repeated", - "type": "Message", - "id": 1 - }, - "rootSpan": { - "type": "Span", - "id": 3 - } - } - } - } - }, - "RecognitionResult": { - "fields": { - "transcript": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InterruptionSignal": { - "fields": { - "bargeIn": { - "type": "bool", - "id": 1 - } - } - }, - "EndSession": { - "fields": { - "metadata": { - "type": "google.protobuf.Struct", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GoAway": { - "fields": {} - }, - "RunSessionRequest": { - "fields": { - "config": { - "type": "SessionConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "inputs": { - "rule": "repeated", - "type": "SessionInput", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "RunSessionResponse": { - "fields": { - "outputs": { - "rule": "repeated", - "type": "SessionOutput", - "id": 1 - } - } - }, - "BidiSessionClientMessage": { - "oneofs": { - "messageType": { - "oneof": [ - "config", - "realtimeInput" - ] - } - }, - "fields": { - "config": { - "type": "SessionConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "realtimeInput": { - "type": "SessionInput", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "BidiSessionServerMessage": { - "oneofs": { - "messageType": { - "oneof": [ - "sessionOutput", - "recognitionResult", - "interruptionSignal", - "endSession", - "goAway" - ] - } - }, - "fields": { - "sessionOutput": { - "type": "SessionOutput", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "recognitionResult": { - "type": "RecognitionResult", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "interruptionSignal": { - "type": "InterruptionSignal", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "endSession": { - "type": "EndSession", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "goAway": { - "type": "GoAway", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ToolService": { - "options": { - "(google.api.default_host)": "ces.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ExecuteTool": { - "requestType": "ExecuteToolRequest", - "responseType": "ExecuteToolResponse", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}:executeTool", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/apps/*}:executeTool", - "body": "*" - } - } - ] - }, - "RetrieveToolSchema": { - "requestType": "RetrieveToolSchemaRequest", - "responseType": "RetrieveToolSchemaResponse", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apps/*}:retrieveToolSchema", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/apps/*}:retrieveToolSchema", - "body": "*" - } - } - ] - }, - "RetrieveTools": { - "requestType": "RetrieveToolsRequest", - "responseType": "RetrieveToolsResponse", - "options": { - "(google.api.http).post": "/v1/{toolset=projects/*/locations/*/apps/*/toolsets/*}:retrieveTools", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{toolset=projects/*/locations/*/apps/*/toolsets/*}:retrieveTools", - "body": "*" - } - } - ] - } - } - }, - "ExecuteToolRequest": { - "oneofs": { - "toolIdentifier": { - "oneof": [ - "tool", - "toolsetTool" - ] - } - }, - "fields": { - "tool": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "toolsetTool": { - "type": "ToolsetTool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "parent": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - }, - "args": { - "type": "google.protobuf.Struct", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ExecuteToolResponse": { - "oneofs": { - "toolIdentifier": { - "oneof": [ - "tool", - "toolsetTool" - ] - } - }, - "fields": { - "tool": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "toolsetTool": { - "type": "ToolsetTool", - "id": 3 - }, - "response": { - "type": "google.protobuf.Struct", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "RetrieveToolSchemaRequest": { - "oneofs": { - "toolIdentifier": { - "oneof": [ - "tool", - "toolsetTool" - ] - } - }, - "fields": { - "tool": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "toolsetTool": { - "type": "ToolsetTool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "parent": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - } - } - }, - "RetrieveToolSchemaResponse": { - "oneofs": { - "toolIdentifier": { - "oneof": [ - "tool", - "toolsetTool" - ] - } - }, - "fields": { - "tool": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "toolsetTool": { - "type": "ToolsetTool", - "id": 2 - }, - "inputSchema": { - "type": "Schema", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "outputSchema": { - "type": "Schema", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "RetrieveToolsRequest": { - "fields": { - "toolset": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" - } - }, - "toolIds": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RetrieveToolsResponse": { - "fields": { - "tools": { - "rule": "repeated", - "type": "Tool", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "WidgetService": { - "options": { - "(google.api.default_host)": "ces.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "GenerateChatToken": { - "requestType": "GenerateChatTokenRequest", - "responseType": "GenerateChatTokenResponse", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/apps/*/sessions/*}:generateChatToken", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/apps/*/sessions/*}:generateChatToken", - "body": "*" - } - } - ] - } - } - }, - "GenerateChatTokenRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Session" - } - }, - "deployment": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" - } - }, - "recaptchaToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GenerateChatTokenResponse": { - "fields": { - "chatToken": { - "type": "string", - "id": 1 - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - } - } - }, - "v1beta": { - "options": { - "go_package": "cloud.google.com/go/ces/apiv1beta/cespb;cespb", - "java_multiple_files": true, - "java_outer_classname": "WidgetServiceProto", - "java_package": "com.google.cloud.ces.v1beta", - "(google.api.resource_definition).type": "ces.googleapis.com/Session", - "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/apps/{app}/sessions/{session}" - }, - "nested": { - "Agent": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Agent", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/agents/{agent}", - "(google.api.resource).plural": "agents", - "(google.api.resource).singular": "agent" - }, - "oneofs": { - "agentType": { - "oneof": [ - "llmAgent", - "remoteDialogflowAgent" - ] - } - }, - "fields": { - "llmAgent": { - "type": "LlmAgent", - "id": 26, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "remoteDialogflowAgent": { - "type": "RemoteDialogflowAgent", - "id": 27, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "modelSettings": { - "type": "ModelSettings", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "instruction": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tools": { - "rule": "repeated", - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "childAgents": { - "rule": "repeated", - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - }, - "beforeAgentCallbacks": { - "rule": "repeated", - "type": "Callback", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "afterAgentCallbacks": { - "rule": "repeated", - "type": "Callback", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "beforeModelCallbacks": { - "rule": "repeated", - "type": "Callback", - "id": 20, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "afterModelCallbacks": { - "rule": "repeated", - "type": "Callback", - "id": 21, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "beforeToolCallbacks": { - "rule": "repeated", - "type": "Callback", - "id": 22, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "afterToolCallbacks": { - "rule": "repeated", - "type": "Callback", - "id": 23, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "guardrails": { - "rule": "repeated", - "type": "string", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" - } - }, - "etag": { - "type": "string", - "id": 24 - }, - "toolsets": { - "rule": "repeated", - "type": "AgentToolset", - "id": 28, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "generatedSummary": { - "type": "string", - "id": 29, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "transferRules": { - "rule": "repeated", - "type": "TransferRule", - "id": 30, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "LlmAgent": { - "fields": {} - }, - "RemoteDialogflowAgent": { - "fields": { - "agent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/DialogflowAgent" - } - }, - "flowId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "environmentId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "inputVariableMapping": { - "keyType": "string", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "outputVariableMapping": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "respectResponseInterruptionSettings": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AgentToolset": { - "fields": { - "toolset": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" - } - }, - "toolIds": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "ExpressionCondition": { - "fields": { - "expression": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "PythonCodeCondition": { - "fields": { - "pythonCode": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "TransferRule": { - "oneofs": { - "ruleType": { - "oneof": [ - "deterministicTransfer", - "disablePlannerTransfer" - ] - } - }, - "fields": { - "deterministicTransfer": { - "type": "DeterministicTransfer", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "disablePlannerTransfer": { - "type": "DisablePlannerTransfer", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "childAgent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - }, - "direction": { - "type": "Direction", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "DeterministicTransfer": { - "oneofs": { - "conditionType": { - "oneof": [ - "expressionCondition", - "pythonCodeCondition" - ] - } - }, - "fields": { - "expressionCondition": { - "type": "ExpressionCondition", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pythonCodeCondition": { - "type": "PythonCodeCondition", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DisablePlannerTransfer": { - "fields": { - "expressionCondition": { - "type": "ExpressionCondition", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Direction": { - "values": { - "DIRECTION_UNSPECIFIED": 0, - "PARENT_TO_CHILD": 1, - "CHILD_TO_PARENT": 2 - } - } - } - }, - "ExecutionType": { - "values": { - "EXECUTION_TYPE_UNSPECIFIED": 0, - "SYNCHRONOUS": 1, - "ASYNCHRONOUS": 2 - } - }, - "Callback": { - "oneofs": { - "callback": { - "oneof": [ - "pythonCode" - ] - } - }, - "fields": { - "pythonCode": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "disabled": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "proactiveExecutionEnabled": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ModelSettings": { - "oneofs": { - "_temperature": { - "oneof": [ - "temperature" - ] - } - }, - "fields": { - "model": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "temperature": { - "type": "double", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "TriggerAction": { - "oneofs": { - "action": { - "oneof": [ - "respondImmediately", - "transferAgent", - "generativeAnswer" - ] - } - }, - "fields": { - "respondImmediately": { - "type": "RespondImmediately", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "transferAgent": { - "type": "TransferAgent", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "generativeAnswer": { - "type": "GenerativeAnswer", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Response": { - "fields": { - "text": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "disabled": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RespondImmediately": { - "fields": { - "responses": { - "rule": "repeated", - "type": "Response", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GenerativeAnswer": { - "fields": { - "prompt": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "TransferAgent": { - "fields": { - "agent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - } - } - } - } - }, - "TlsConfig": { - "fields": { - "caCerts": { - "rule": "repeated", - "type": "CaCert", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "CaCert": { - "fields": { - "displayName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cert": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "ServiceDirectoryConfig": { - "fields": { - "service": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "servicedirectory.googleapis.com/Service" - } - } - } - }, - "ChannelProfile": { - "fields": { - "profileId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "channelType": { - "type": "ChannelType", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "personaProperty": { - "type": "PersonaProperty", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "disableDtmf": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "disableBargeInControl": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "webWidgetConfig": { - "type": "WebWidgetConfig", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "noiseSuppressionLevel": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "PersonaProperty": { - "fields": { - "persona": { - "type": "Persona", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Persona": { - "values": { - "UNKNOWN": 0, - "CONCISE": 1, - "CHATTY": 2 - } - } - } - }, - "WebWidgetConfig": { - "fields": { - "modality": { - "type": "Modality", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "theme": { - "type": "Theme", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "webWidgetTitle": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "securitySettings": { - "type": "SecuritySettings", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "SecuritySettings": { - "fields": { - "enablePublicAccess": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableOriginCheck": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowedOrigins": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableRecaptcha": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Modality": { - "values": { - "MODALITY_UNSPECIFIED": 0, - "CHAT_AND_VOICE": 1, - "VOICE_ONLY": 2, - "CHAT_ONLY": 3 - } - }, - "Theme": { - "values": { - "THEME_UNSPECIFIED": 0, - "LIGHT": 1, - "DARK": 2 - } - } - } - }, - "ChannelType": { - "values": { - "UNKNOWN": 0, - "WEB_UI": 2, - "API": 3, - "TWILIO": 4, - "GOOGLE_TELEPHONY_PLATFORM": 5, - "CONTACT_CENTER_AS_A_SERVICE": 6, - "FIVE9": 7, - "CONTACT_CENTER_INTEGRATION": 8 - } - } - } - }, - "Span": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "duration": { - "type": "google.protobuf.Duration", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "attributes": { - "type": "google.protobuf.Struct", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "childSpans": { - "rule": "repeated", - "type": "Span", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "AgentService": { - "options": { - "(google.api.default_host)": "ces.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ListApps": { - "requestType": "ListAppsRequest", - "responseType": "ListAppsResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*}/apps", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*}/apps" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetApp": { - "requestType": "GetAppRequest", - "responseType": "App", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/apps/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateApp": { - "requestType": "CreateAppRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/apps", - "(google.api.http).body": "app", - "(google.api.method_signature)": "parent,app", - "(google.longrunning.operation_info).response_type": "App", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*}/apps", - "body": "app" - } - }, - { - "(google.api.method_signature)": "parent,app,app_id" - }, - { - "(google.api.method_signature)": "parent,app" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "App", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpdateApp": { - "requestType": "UpdateAppRequest", - "responseType": "App", - "options": { - "(google.api.http).patch": "/v1beta/{app.name=projects/*/locations/*/apps/*}", - "(google.api.http).body": "app", - "(google.api.method_signature)": "app,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta/{app.name=projects/*/locations/*/apps/*}", - "body": "app" - } - }, - { - "(google.api.method_signature)": "app,update_mask" - } - ] - }, - "DeleteApp": { - "requestType": "DeleteAppRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*}", - "(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/*/apps/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ExportApp": { - "requestType": "ExportAppRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/apps/*}:exportApp", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "ExportAppResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{name=projects/*/locations/*/apps/*}:exportApp", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "ExportAppResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ImportApp": { - "requestType": "ImportAppRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/apps:importApp", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,display_name,app_id", - "(google.longrunning.operation_info).response_type": "ImportAppResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*}/apps:importApp", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,display_name,app_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "ImportAppResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ListAgents": { - "requestType": "ListAgentsRequest", - "responseType": "ListAgentsResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/agents", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/agents" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetAgent": { - "requestType": "GetAgentRequest", - "responseType": "Agent", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/agents/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/apps/*/agents/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateAgent": { - "requestType": "CreateAgentRequest", - "responseType": "Agent", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/agents", - "(google.api.http).body": "agent", - "(google.api.method_signature)": "parent,agent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/agents", - "body": "agent" - } - }, - { - "(google.api.method_signature)": "parent,agent,agent_id" - }, - { - "(google.api.method_signature)": "parent,agent" - } - ] - }, - "UpdateAgent": { - "requestType": "UpdateAgentRequest", - "responseType": "Agent", - "options": { - "(google.api.http).patch": "/v1beta/{agent.name=projects/*/locations/*/apps/*/agents/*}", - "(google.api.http).body": "agent", - "(google.api.method_signature)": "agent,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta/{agent.name=projects/*/locations/*/apps/*/agents/*}", - "body": "agent" - } - }, - { - "(google.api.method_signature)": "agent,update_mask" - } - ] - }, - "DeleteAgent": { - "requestType": "DeleteAgentRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/agents/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/apps/*/agents/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListExamples": { - "requestType": "ListExamplesRequest", - "responseType": "ListExamplesResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/examples", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/examples" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetExample": { - "requestType": "GetExampleRequest", - "responseType": "Example", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/examples/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/apps/*/examples/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateExample": { - "requestType": "CreateExampleRequest", - "responseType": "Example", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/examples", - "(google.api.http).body": "example", - "(google.api.method_signature)": "parent,example" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/examples", - "body": "example" - } - }, - { - "(google.api.method_signature)": "parent,example,example_id" - }, - { - "(google.api.method_signature)": "parent,example" - } - ] - }, - "UpdateExample": { - "requestType": "UpdateExampleRequest", - "responseType": "Example", - "options": { - "(google.api.http).patch": "/v1beta/{example.name=projects/*/locations/*/apps/*/examples/*}", - "(google.api.http).body": "example", - "(google.api.method_signature)": "example,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta/{example.name=projects/*/locations/*/apps/*/examples/*}", - "body": "example" - } - }, - { - "(google.api.method_signature)": "example,update_mask" - } - ] - }, - "DeleteExample": { - "requestType": "DeleteExampleRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/examples/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/apps/*/examples/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListTools": { - "requestType": "ListToolsRequest", - "responseType": "ListToolsResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/tools", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/tools" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetTool": { - "requestType": "GetToolRequest", - "responseType": "Tool", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/tools/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/apps/*/tools/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListConversations": { - "requestType": "ListConversationsRequest", - "responseType": "ListConversationsResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/conversations", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/conversations" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetConversation": { - "requestType": "GetConversationRequest", - "responseType": "Conversation", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/conversations/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/apps/*/conversations/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteConversation": { - "requestType": "DeleteConversationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/conversations/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/apps/*/conversations/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "BatchDeleteConversations": { - "requestType": "BatchDeleteConversationsRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/conversations:batchDelete", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent", - "(google.longrunning.operation_info).response_type": "BatchDeleteConversationsResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/conversations:batchDelete", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "BatchDeleteConversationsResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "CreateTool": { - "requestType": "CreateToolRequest", - "responseType": "Tool", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/tools", - "(google.api.http).body": "tool", - "(google.api.method_signature)": "parent,tool" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/tools", - "body": "tool" - } - }, - { - "(google.api.method_signature)": "parent,tool,tool_id" - }, - { - "(google.api.method_signature)": "parent,tool" - } - ] - }, - "UpdateTool": { - "requestType": "UpdateToolRequest", - "responseType": "Tool", - "options": { - "(google.api.http).patch": "/v1beta/{tool.name=projects/*/locations/*/apps/*/tools/*}", - "(google.api.http).body": "tool", - "(google.api.method_signature)": "tool,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta/{tool.name=projects/*/locations/*/apps/*/tools/*}", - "body": "tool" - } - }, - { - "(google.api.method_signature)": "tool,update_mask" - } - ] - }, - "DeleteTool": { - "requestType": "DeleteToolRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/tools/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/apps/*/tools/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListGuardrails": { - "requestType": "ListGuardrailsRequest", - "responseType": "ListGuardrailsResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/guardrails", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/guardrails" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetGuardrail": { - "requestType": "GetGuardrailRequest", - "responseType": "Guardrail", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/guardrails/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/apps/*/guardrails/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateGuardrail": { - "requestType": "CreateGuardrailRequest", - "responseType": "Guardrail", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/guardrails", - "(google.api.http).body": "guardrail", - "(google.api.method_signature)": "parent,guardrail" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/guardrails", - "body": "guardrail" - } - }, - { - "(google.api.method_signature)": "parent,guardrail,guardrail_id" - }, - { - "(google.api.method_signature)": "parent,guardrail" - } - ] - }, - "UpdateGuardrail": { - "requestType": "UpdateGuardrailRequest", - "responseType": "Guardrail", - "options": { - "(google.api.http).patch": "/v1beta/{guardrail.name=projects/*/locations/*/apps/*/guardrails/*}", - "(google.api.http).body": "guardrail", - "(google.api.method_signature)": "guardrail,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta/{guardrail.name=projects/*/locations/*/apps/*/guardrails/*}", - "body": "guardrail" - } - }, - { - "(google.api.method_signature)": "guardrail,update_mask" - } - ] - }, - "DeleteGuardrail": { - "requestType": "DeleteGuardrailRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/guardrails/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/apps/*/guardrails/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListDeployments": { - "requestType": "ListDeploymentsRequest", - "responseType": "ListDeploymentsResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/deployments", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/deployments" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetDeployment": { - "requestType": "GetDeploymentRequest", - "responseType": "Deployment", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/deployments/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/apps/*/deployments/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateDeployment": { - "requestType": "CreateDeploymentRequest", - "responseType": "Deployment", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/deployments", - "(google.api.http).body": "deployment", - "(google.api.method_signature)": "parent,deployment" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/deployments", - "body": "deployment" - } - }, - { - "(google.api.method_signature)": "parent,deployment,deployment_id" - }, - { - "(google.api.method_signature)": "parent,deployment" - } - ] - }, - "UpdateDeployment": { - "requestType": "UpdateDeploymentRequest", - "responseType": "Deployment", - "options": { - "(google.api.http).patch": "/v1beta/{deployment.name=projects/*/locations/*/apps/*/deployments/*}", - "(google.api.http).body": "deployment", - "(google.api.method_signature)": "deployment,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta/{deployment.name=projects/*/locations/*/apps/*/deployments/*}", - "body": "deployment" - } - }, - { - "(google.api.method_signature)": "deployment,update_mask" - } - ] - }, - "DeleteDeployment": { - "requestType": "DeleteDeploymentRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/deployments/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/apps/*/deployments/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListToolsets": { - "requestType": "ListToolsetsRequest", - "responseType": "ListToolsetsResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/toolsets", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/toolsets" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetToolset": { - "requestType": "GetToolsetRequest", - "responseType": "Toolset", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/toolsets/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/apps/*/toolsets/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateToolset": { - "requestType": "CreateToolsetRequest", - "responseType": "Toolset", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/toolsets", - "(google.api.http).body": "toolset", - "(google.api.method_signature)": "parent,toolset" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/toolsets", - "body": "toolset" - } - }, - { - "(google.api.method_signature)": "parent,toolset,toolset_id" - }, - { - "(google.api.method_signature)": "parent,toolset" - } - ] - }, - "UpdateToolset": { - "requestType": "UpdateToolsetRequest", - "responseType": "Toolset", - "options": { - "(google.api.http).patch": "/v1beta/{toolset.name=projects/*/locations/*/apps/*/toolsets/*}", - "(google.api.http).body": "toolset", - "(google.api.method_signature)": "toolset,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta/{toolset.name=projects/*/locations/*/apps/*/toolsets/*}", - "body": "toolset" - } - }, - { - "(google.api.method_signature)": "toolset,update_mask" - } - ] - }, - "DeleteToolset": { - "requestType": "DeleteToolsetRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/toolsets/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/apps/*/toolsets/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListAppVersions": { - "requestType": "ListAppVersionsRequest", - "responseType": "ListAppVersionsResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/versions", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/versions" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetAppVersion": { - "requestType": "GetAppVersionRequest", - "responseType": "AppVersion", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateAppVersion": { - "requestType": "CreateAppVersionRequest", - "responseType": "AppVersion", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/versions", - "(google.api.http).body": "app_version", - "(google.api.method_signature)": "parent,app_version" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/versions", - "body": "app_version" - } - }, - { - "(google.api.method_signature)": "parent,app_version,app_version_id" - }, - { - "(google.api.method_signature)": "parent,app_version" - } - ] - }, - "DeleteAppVersion": { - "requestType": "DeleteAppVersionRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "RestoreAppVersion": { - "requestType": "RestoreAppVersionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}:restore", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "RestoreAppVersionResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}:restore", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "RestoreAppVersionResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ListChangelogs": { - "requestType": "ListChangelogsRequest", - "responseType": "ListChangelogsResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/changelogs", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/changelogs" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetChangelog": { - "requestType": "GetChangelogRequest", - "responseType": "Changelog", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/changelogs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/apps/*/changelogs/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - } - } - }, - "ListAppsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/App" - } - }, - "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" - } - } - } - }, - "ListAppsResponse": { - "fields": { - "apps": { - "rule": "repeated", - "type": "App", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "UNORDERED_LIST" - } - } - } - }, - "GetAppRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - } - } - }, - "CreateAppRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/App" - } - }, - "appId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "app": { - "type": "App", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateAppRequest": { - "fields": { - "app": { - "type": "App", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteAppRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - }, - "etag": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ExportAppRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - }, - "exportFormat": { - "type": "ExportFormat", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "gcsUri": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ExportFormat": { - "values": { - "EXPORT_FORMAT_UNSPECIFIED": 0, - "JSON": 1, - "YAML": 2 - } - } - } - }, - "ExportAppResponse": { - "oneofs": { - "app": { - "oneof": [ - "appContent", - "appUri" - ] - } - }, - "fields": { - "appContent": { - "type": "bytes", - "id": 1 - }, - "appUri": { - "type": "string", - "id": 2 - } - } - }, - "ImportAppRequest": { - "oneofs": { - "app": { - "oneof": [ - "gcsUri", - "appContent" - ] - } - }, - "fields": { - "gcsUri": { - "type": "string", - "id": 4 - }, - "appContent": { - "type": "bytes", - "id": 5 - }, - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/App" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "appId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "importOptions": { - "type": "ImportOptions", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ignoreAppLock": { - "type": "bool", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ImportOptions": { - "fields": { - "conflictResolutionStrategy": { - "type": "ConflictResolutionStrategy", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ConflictResolutionStrategy": { - "values": { - "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED": 0, - "REPLACE": 1, - "OVERWRITE": 2 - } - } - } - } - } - }, - "ImportAppResponse": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - }, - "warnings": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "ListAgentsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Agent" - } - }, - "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" - } - } - } - }, - "ListAgentsResponse": { - "fields": { - "agents": { - "rule": "repeated", - "type": "Agent", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetAgentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - } - } - }, - "CreateAgentRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Agent" - } - }, - "agentId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "agent": { - "type": "Agent", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateAgentRequest": { - "fields": { - "agent": { - "type": "Agent", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteAgentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - }, - "force": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "OperationMetadata": { - "fields": { - "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" - } - }, - "statusMessage": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "requestedCancellation": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "ListExamplesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Example" - } - }, - "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" - } - } - } - }, - "ListExamplesResponse": { - "fields": { - "examples": { - "rule": "repeated", - "type": "Example", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetExampleRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Example" - } - } - } - }, - "CreateExampleRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Example" - } - }, - "exampleId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "example": { - "type": "Example", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateExampleRequest": { - "fields": { - "example": { - "type": "Example", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteExampleRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Example" - } - }, - "etag": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListToolsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Tool" - } - }, - "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" - } - } - } - }, - "ListToolsResponse": { - "fields": { - "tools": { - "rule": "repeated", - "type": "Tool", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetToolRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - } - } - }, - "CreateToolRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Tool" - } - }, - "toolId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tool": { - "type": "Tool", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateToolRequest": { - "fields": { - "tool": { - "type": "Tool", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteToolRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "force": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListConversationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Conversation" - } - }, - "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" - } - }, - "source": { - "type": "Conversation.Source", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sources": { - "rule": "repeated", - "type": "Conversation.Source", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListConversationsResponse": { - "fields": { - "conversations": { - "rule": "repeated", - "type": "Conversation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetConversationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" - } - }, - "source": { - "type": "Conversation.Source", - "id": 2, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteConversationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" - } - }, - "source": { - "type": "Conversation.Source", - "id": 2, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "BatchDeleteConversationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Conversation" - } - }, - "conversations": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" - } - } - } - }, - "BatchDeleteConversationsResponse": { - "fields": { - "deletedConversations": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "failedConversations": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "errorMessages": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListGuardrailsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Guardrail" - } - }, - "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" - } - } - } - }, - "ListGuardrailsResponse": { - "fields": { - "guardrails": { - "rule": "repeated", - "type": "Guardrail", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetGuardrailRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" - } - } - } - }, - "CreateGuardrailRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Guardrail" - } - }, - "guardrailId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "guardrail": { - "type": "Guardrail", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateGuardrailRequest": { - "fields": { - "guardrail": { - "type": "Guardrail", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteGuardrailRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" - } - }, - "force": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListDeploymentsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Deployment" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListDeploymentsResponse": { - "fields": { - "deployments": { - "rule": "repeated", - "type": "Deployment", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetDeploymentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" - } - } - } - }, - "CreateDeploymentRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Deployment" - } - }, - "deploymentId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "deployment": { - "type": "Deployment", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateDeploymentRequest": { - "fields": { - "deployment": { - "type": "Deployment", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteDeploymentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" - } - }, - "etag": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListToolsetsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Toolset" - } - }, - "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" - } - } - } - }, - "ListToolsetsResponse": { - "fields": { - "toolsets": { - "rule": "repeated", - "type": "Toolset", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetToolsetRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" - } - } - } - }, - "CreateToolsetRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Toolset" - } - }, - "toolsetId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "toolset": { - "type": "Toolset", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateToolsetRequest": { - "fields": { - "toolset": { - "type": "Toolset", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteToolsetRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" - } - }, - "force": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListAppVersionsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/AppVersion" - } - }, - "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" - } - } - } - }, - "ListAppVersionsResponse": { - "fields": { - "appVersions": { - "rule": "repeated", - "type": "AppVersion", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetAppVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" - } - } - } - }, - "DeleteAppVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" - } - }, - "etag": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateAppVersionRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/AppVersion" - } - }, - "appVersionId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "appVersion": { - "type": "AppVersion", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "RestoreAppVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" - } - } - } - }, - "RestoreAppVersionResponse": { - "fields": {} - }, - "GenerateAppResourceResponse": { - "oneofs": { - "generatedResource": { - "oneof": [ - "agent", - "toolset", - "appSnapshot", - "tools", - "evaluations", - "appResources" - ] - } - }, - "fields": { - "agent": { - "type": "Agent", - "id": 1 - }, - "toolset": { - "type": "Toolset", - "id": 3 - }, - "appSnapshot": { - "type": "AppSnapshot", - "id": 4 - }, - "tools": { - "type": "Tools", - "id": 5 - }, - "evaluations": { - "type": "Evaluations", - "id": 6 - }, - "appResources": { - "type": "AppResources", - "id": 7 - }, - "generateResultInfo": { - "type": "GenerateResultInfo", - "id": 2 - } - }, - "nested": { - "Evaluations": { - "fields": { - "evaluations": { - "rule": "repeated", - "type": "Evaluation", - "id": 1 - } - } - }, - "Tools": { - "fields": { - "tools": { - "rule": "repeated", - "type": "Tool", - "id": 1 - } - } - }, - "AppResources": { - "fields": { - "appSnapshot": { - "type": "AppSnapshot", - "id": 1 - }, - "evaluations": { - "rule": "repeated", - "type": "Evaluation", - "id": 2 - } - } - }, - "GenerateResultInfo": { - "fields": { - "explanation": { - "type": "string", - "id": 1 - } - } - } - } - }, - "ListChangelogsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Changelog" - } - }, - "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" - } - } - } - }, - "ListChangelogsResponse": { - "fields": { - "changelogs": { - "rule": "repeated", - "type": "Changelog", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetChangelogRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Changelog" - } - } - } - }, - "App": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/App", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}", - "(google.api.resource).plural": "apps", - "(google.api.resource).singular": "app" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pinned": { - "type": "bool", - "id": 31, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "rootAgent": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - }, - "languageSettings": { - "type": "LanguageSettings", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "timeZoneSettings": { - "type": "TimeZoneSettings", - "id": 27, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "audioProcessingConfig": { - "type": "AudioProcessingConfig", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "loggingSettings": { - "type": "LoggingSettings", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "errorHandlingSettings": { - "type": "ErrorHandlingSettings", - "id": 34, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "modelSettings": { - "type": "ModelSettings", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "toolExecutionMode": { - "type": "ToolExecutionMode", - "id": 32, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "evaluationMetricsThresholds": { - "type": "EvaluationMetricsThresholds", - "id": 24, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "variableDeclarations": { - "rule": "repeated", - "type": "VariableDeclaration", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "predefinedVariableDeclarations": { - "rule": "repeated", - "type": "VariableDeclaration", - "id": 28, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "globalInstruction": { - "type": "string", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "guardrails": { - "rule": "repeated", - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" - } - }, - "dataStoreSettings": { - "type": "DataStoreSettings", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "defaultChannelProfile": { - "type": "ChannelProfile", - "id": 22, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "metadata": { - "keyType": "string", - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deploymentCount": { - "type": "int32", - "id": 23, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "clientCertificateSettings": { - "type": "ClientCertificateSettings", - "id": 25, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "locked": { - "type": "bool", - "id": 29, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "evaluationPersonas": { - "rule": "repeated", - "type": "EvaluationPersona", - "id": 30, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "evaluationSettings": { - "type": "EvaluationSettings", - "id": 33, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "VariableDeclaration": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "schema": { - "type": "Schema", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ToolExecutionMode": { - "values": { - "TOOL_EXECUTION_MODE_UNSPECIFIED": 0, - "PARALLEL": 1, - "SEQUENTIAL": 2 - } - } - } - }, - "TimeZoneSettings": { - "fields": { - "timeZone": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "LanguageSettings": { - "fields": { - "defaultLanguageCode": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "supportedLanguageCodes": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableMultilingualSupport": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fallbackAction": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AudioProcessingConfig": { - "fields": { - "synthesizeSpeechConfigs": { - "keyType": "string", - "type": "SynthesizeSpeechConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "bargeInConfig": { - "type": "BargeInConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "inactivityTimeout": { - "type": "google.protobuf.Duration", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ambientSoundConfig": { - "type": "AmbientSoundConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AmbientSoundConfig": { - "oneofs": { - "source": { - "oneof": [ - "prebuiltAmbientNoise", - "gcsUri", - "prebuiltAmbientSound" - ] - } - }, - "fields": { - "prebuiltAmbientNoise": { - "type": "PrebuiltAmbientNoise", - "id": 1, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gcsUri": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "prebuiltAmbientSound": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "volumeGainDb": { - "type": "double", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "PrebuiltAmbientNoise": { - "values": { - "PREBUILT_AMBIENT_NOISE_UNSPECIFIED": 0, - "RETAIL_STORE": 1, - "CONVENTION_HALL": 2, - "OUTDOOR": 3 - } - } - } - }, - "BargeInConfig": { - "fields": { - "disableBargeIn": { - "type": "bool", - "id": 1, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "bargeInAwareness": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SynthesizeSpeechConfig": { - "fields": { - "voice": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "speakingRate": { - "type": "double", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "MetricAnalysisSettings": { - "fields": { - "llmMetricsOptedOut": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "LoggingSettings": { - "fields": { - "redactionConfig": { - "type": "RedactionConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "audioRecordingConfig": { - "type": "AudioRecordingConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "bigqueryExportSettings": { - "type": "BigQueryExportSettings", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "cloudLoggingSettings": { - "type": "CloudLoggingSettings", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "conversationLoggingSettings": { - "type": "ConversationLoggingSettings", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "evaluationAudioRecordingConfig": { - "type": "AudioRecordingConfig", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "metricAnalysisSettings": { - "type": "MetricAnalysisSettings", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ErrorHandlingSettings": { - "fields": { - "errorHandlingStrategy": { - "type": "ErrorHandlingStrategy", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ErrorHandlingStrategy": { - "values": { - "ERROR_HANDLING_STRATEGY_UNSPECIFIED": 0, - "NONE": 1, - "FALLBACK_RESPONSE": 2 - } - } - } - }, - "EvaluationMetricsThresholds": { - "fields": { - "goldenEvaluationMetricsThresholds": { - "type": "GoldenEvaluationMetricsThresholds", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "hallucinationMetricBehavior": { - "type": "HallucinationMetricBehavior", - "id": 3, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "goldenHallucinationMetricBehavior": { - "type": "HallucinationMetricBehavior", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scenarioHallucinationMetricBehavior": { - "type": "HallucinationMetricBehavior", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "GoldenEvaluationMetricsThresholds": { - "fields": { - "turnLevelMetricsThresholds": { - "type": "TurnLevelMetricsThresholds", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "expectationLevelMetricsThresholds": { - "type": "ExpectationLevelMetricsThresholds", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "toolMatchingSettings": { - "type": "ToolMatchingSettings", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "TurnLevelMetricsThresholds": { - "oneofs": { - "_semanticSimilaritySuccessThreshold": { - "oneof": [ - "semanticSimilaritySuccessThreshold" - ] - }, - "_overallToolInvocationCorrectnessThreshold": { - "oneof": [ - "overallToolInvocationCorrectnessThreshold" - ] - } - }, - "fields": { - "semanticSimilaritySuccessThreshold": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "overallToolInvocationCorrectnessThreshold": { - "type": "float", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "semanticSimilarityChannel": { - "type": "SemanticSimilarityChannel", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "SemanticSimilarityChannel": { - "values": { - "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED": 0, - "TEXT": 1, - "AUDIO": 2 - } - } - } - }, - "ExpectationLevelMetricsThresholds": { - "oneofs": { - "_toolInvocationParameterCorrectnessThreshold": { - "oneof": [ - "toolInvocationParameterCorrectnessThreshold" - ] - } - }, - "fields": { - "toolInvocationParameterCorrectnessThreshold": { - "type": "float", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - } - } - }, - "ToolMatchingSettings": { - "fields": { - "extraToolCallBehavior": { - "type": "ExtraToolCallBehavior", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ExtraToolCallBehavior": { - "values": { - "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED": 0, - "FAIL": 1, - "ALLOW": 2 - } - } - } - }, - "HallucinationMetricBehavior": { - "values": { - "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": 0, - "DISABLED": 1, - "ENABLED": 2 - } - } - } - }, - "EvaluationSettings": { - "fields": { - "scenarioConversationInitiator": { - "type": "ScenarioConversationInitiator", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "goldenRunMethod": { - "type": "GoldenRunMethod", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "goldenEvaluationToolCallBehaviour": { - "type": "EvaluationToolCallBehaviour", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scenarioEvaluationToolCallBehaviour": { - "type": "EvaluationToolCallBehaviour", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ScenarioConversationInitiator": { - "values": { - "SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED": 0, - "USER": 1, - "AGENT": 2 - } - } - } - }, - "ClientCertificateSettings": { - "fields": { - "tlsCertificate": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "privateKey": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" - } - }, - "passphrase": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ConversationLoggingSettings": { - "fields": { - "disableConversationLogging": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CloudLoggingSettings": { - "fields": { - "enableCloudLogging": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AudioRecordingConfig": { - "fields": { - "gcsBucket": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gcsPathPrefix": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RedactionConfig": { - "fields": { - "enableRedaction": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "inspectTemplate": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "dlp.googleapis.com/InspectTemplate" - } - }, - "deidentifyTemplate": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "dlp.googleapis.com/DeidentifyTemplate" - } - } - } - }, - "DataStoreSettings": { - "fields": { - "engines": { - "rule": "repeated", - "type": "Engine", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "Engine": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "discoveryengine.googleapis.com/Engine" - } - }, - "type": { - "type": "Type", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "ENGINE_TYPE_SEARCH": 1, - "ENGINE_TYPE_CHAT": 2 - } - } - } - } - } - }, - "EvaluationPersona": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "displayName": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "personality": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "speechConfig": { - "type": "SpeechConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "SpeechConfig": { - "fields": { - "speakingRate": { - "type": "double", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "environment": { - "type": "BackgroundEnvironment", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "voiceId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "BackgroundEnvironment": { - "values": { - "BACKGROUND_ENVIRONMENT_UNSPECIFIED": 0, - "CALL_CENTER": 3, - "TRAFFIC": 4, - "KIDS_NOISE": 5, - "CAFE": 6 - } - } - } - } - } - }, - "BigQueryExportSettings": { - "fields": { - "enabled": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "project": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "dataset": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "EvaluationToolCallBehaviour": { - "values": { - "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED": 0, - "REAL": 1, - "FAKE": 2 - } - }, - "CodeBlock": { - "fields": { - "pythonCode": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ToolFakeConfig": { - "oneofs": { - "toolResponse": { - "oneof": [ - "codeBlock" - ] - } - }, - "fields": { - "codeBlock": { - "type": "CodeBlock", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableFakeMode": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GoldenRunMethod": { - "values": { - "GOLDEN_RUN_METHOD_UNSPECIFIED": 0, - "STABLE": 1, - "NAIVE": 2 - } - }, - "Schema": { - "oneofs": { - "_minimum": { - "oneof": [ - "minimum" - ] - }, - "_maximum": { - "oneof": [ - "maximum" - ] - } - }, - "fields": { - "type": { - "type": "Type", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "properties": { - "keyType": "string", - "type": "Schema", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "required": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "description": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "items": { - "type": "Schema", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "nullable": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "uniqueItems": { - "type": "bool", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "prefixItems": { - "rule": "repeated", - "type": "Schema", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "additionalProperties": { - "type": "Schema", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "anyOf": { - "rule": "repeated", - "type": "Schema", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enum": { - "rule": "repeated", - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "default": { - "type": "google.protobuf.Value", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ref": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "defs": { - "keyType": "string", - "type": "Schema", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "title": { - "type": "string", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "minItems": { - "type": "int64", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxItems": { - "type": "int64", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "minimum": { - "type": "double", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "maximum": { - "type": "double", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "STRING": 1, - "INTEGER": 2, - "NUMBER": 3, - "BOOLEAN": 4, - "OBJECT": 5, - "ARRAY": 6 - } - } - } - }, - "AppSnapshot": { - "fields": { - "app": { - "type": "App", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "agents": { - "rule": "repeated", - "type": "Agent", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tools": { - "rule": "repeated", - "type": "Tool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "examples": { - "rule": "repeated", - "type": "Example", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "guardrails": { - "rule": "repeated", - "type": "Guardrail", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "toolsets": { - "rule": "repeated", - "type": "Toolset", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AppVersion": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/AppVersion", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/versions/{version}", - "(google.api.resource).plural": "appVersions", - "(google.api.resource).singular": "appVersion" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "creator": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "snapshot": { - "type": "AppSnapshot", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Example": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Example", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/examples/{example}", - "(google.api.resource).plural": "examples", - "(google.api.resource).singular": "example" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "entryAgent": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - }, - "messages": { - "rule": "repeated", - "type": "Message", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "invalid": { - "type": "bool", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 9 - } - } - }, - "Message": { - "fields": { - "role": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "chunks": { - "rule": "repeated", - "type": "Chunk", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "eventTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Chunk": { - "oneofs": { - "data": { - "oneof": [ - "text", - "transcript", - "blob", - "payload", - "image", - "toolCall", - "toolResponse", - "agentTransfer", - "updatedVariables", - "defaultVariables" - ] - } - }, - "fields": { - "text": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "transcript": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "blob": { - "type": "Blob", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "payload": { - "type": "google.protobuf.Struct", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "image": { - "type": "Image", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "toolCall": { - "type": "ToolCall", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "toolResponse": { - "type": "ToolResponse", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "agentTransfer": { - "type": "AgentTransfer", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "updatedVariables": { - "type": "google.protobuf.Struct", - "id": 8 - }, - "defaultVariables": { - "type": "google.protobuf.Struct", - "id": 10 - } - } - }, - "Blob": { - "fields": { - "mimeType": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "data": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Image": { - "fields": { - "mimeType": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "data": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ToolCall": { - "oneofs": { - "toolIdentifier": { - "oneof": [ - "tool", - "toolsetTool" - ] - } - }, - "fields": { - "tool": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "toolsetTool": { - "type": "ToolsetTool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "id": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "displayName": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "args": { - "type": "google.protobuf.Struct", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ToolResponse": { - "oneofs": { - "toolIdentifier": { - "oneof": [ - "tool", - "toolsetTool" - ] - } - }, - "fields": { - "tool": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "toolsetTool": { - "type": "ToolsetTool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "id": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "displayName": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "response": { - "type": "google.protobuf.Struct", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "AgentTransfer": { - "fields": { - "targetAgent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "ToolsetTool": { - "fields": { - "toolset": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" - } - }, - "toolId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Guardrail": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Guardrail", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}", - "(google.api.resource).plural": "guardrails", - "(google.api.resource).singular": "guardrail" - }, - "oneofs": { - "guardrailType": { - "oneof": [ - "contentFilter", - "llmPromptSecurity", - "llmPolicy", - "modelSafety", - "codeCallback" - ] - } - }, - "fields": { - "contentFilter": { - "type": "ContentFilter", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "llmPromptSecurity": { - "type": "LlmPromptSecurity", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "llmPolicy": { - "type": "LlmPolicy", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "modelSafety": { - "type": "ModelSafety", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "codeCallback": { - "type": "CodeCallback", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enabled": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "action": { - "type": "TriggerAction", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 11 - } - }, - "nested": { - "ContentFilter": { - "fields": { - "bannedContents": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "bannedContentsInUserInput": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "bannedContentsInAgentResponse": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "matchType": { - "type": "MatchType", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "disregardDiacritics": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "MatchType": { - "values": { - "MATCH_TYPE_UNSPECIFIED": 0, - "SIMPLE_STRING_MATCH": 1, - "WORD_BOUNDARY_STRING_MATCH": 2, - "REGEXP_MATCH": 3 - } - } - } - }, - "LlmPromptSecurity": { - "oneofs": { - "securityConfig": { - "oneof": [ - "defaultSettings", - "customPolicy" - ] - } - }, - "fields": { - "defaultSettings": { - "type": "DefaultSecuritySettings", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "customPolicy": { - "type": "LlmPolicy", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "failOpen": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "DefaultSecuritySettings": { - "fields": { - "defaultPromptTemplate": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - } - } - }, - "LlmPolicy": { - "fields": { - "maxConversationMessages": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "modelSettings": { - "type": "ModelSettings", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "prompt": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "policyScope": { - "type": "PolicyScope", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "failOpen": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowShortUtterance": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "PolicyScope": { - "values": { - "POLICY_SCOPE_UNSPECIFIED": 0, - "USER_QUERY": 1, - "AGENT_RESPONSE": 2, - "USER_QUERY_AND_AGENT_RESPONSE": 3 - } - } - } - }, - "ModelSafety": { - "fields": { - "safetySettings": { - "rule": "repeated", - "type": "SafetySetting", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "SafetySetting": { - "fields": { - "category": { - "type": "HarmCategory", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "threshold": { - "type": "HarmBlockThreshold", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "HarmCategory": { - "values": { - "HARM_CATEGORY_UNSPECIFIED": 0, - "HARM_CATEGORY_HATE_SPEECH": 1, - "HARM_CATEGORY_DANGEROUS_CONTENT": 2, - "HARM_CATEGORY_HARASSMENT": 3, - "HARM_CATEGORY_SEXUALLY_EXPLICIT": 4 - } - }, - "HarmBlockThreshold": { - "values": { - "HARM_BLOCK_THRESHOLD_UNSPECIFIED": 0, - "BLOCK_LOW_AND_ABOVE": 1, - "BLOCK_MEDIUM_AND_ABOVE": 2, - "BLOCK_ONLY_HIGH": 3, - "BLOCK_NONE": 4, - "OFF": 5 - } - } - } - }, - "CodeCallback": { - "fields": { - "beforeAgentCallback": { - "type": "Callback", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "afterAgentCallback": { - "type": "Callback", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "beforeModelCallback": { - "type": "Callback", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "afterModelCallback": { - "type": "Callback", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "Tool": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Tool", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/tools/{tool}", - "(google.api.resource).plural": "tools", - "(google.api.resource).singular": "tool" - }, - "oneofs": { - "toolType": { - "oneof": [ - "clientFunction", - "openApiTool", - "googleSearchTool", - "connectorTool", - "dataStoreTool", - "pythonFunction", - "mcpTool", - "fileSearchTool", - "systemTool", - "widgetTool" - ] - } - }, - "fields": { - "clientFunction": { - "type": "ClientFunction", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "openApiTool": { - "type": "OpenApiTool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "googleSearchTool": { - "type": "GoogleSearchTool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "connectorTool": { - "type": "ConnectorTool", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "dataStoreTool": { - "type": "DataStoreTool", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pythonFunction": { - "type": "PythonFunction", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "mcpTool": { - "type": "McpTool", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fileSearchTool": { - "type": "FileSearchTool", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "systemTool": { - "type": "SystemTool", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "widgetTool": { - "type": "WidgetTool", - "id": 24, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "executionType": { - "type": "ExecutionType", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 14 - }, - "generatedSummary": { - "type": "string", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "toolFakeConfig": { - "type": "ToolFakeConfig", - "id": 20, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ClientFunction": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "parameters": { - "type": "Schema", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "response": { - "type": "Schema", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Action": { - "oneofs": { - "actionSpec": { - "oneof": [ - "connectionActionId", - "entityOperation" - ] - } - }, - "fields": { - "connectionActionId": { - "type": "string", - "id": 4 - }, - "entityOperation": { - "type": "EntityOperation", - "id": 5 - }, - "inputFields": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "outputFields": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "EntityOperation": { - "fields": { - "entityId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "operation": { - "type": "OperationType", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "OperationType": { - "values": { - "OPERATION_TYPE_UNSPECIFIED": 0, - "LIST": 1, - "GET": 2, - "CREATE": 3, - "UPDATE": 4, - "DELETE": 5 - } - } - } - } - } - }, - "ConnectorTool": { - "fields": { - "connection": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "action": { - "type": "Action", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "authConfig": { - "type": "EndUserAuthConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "description": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ApiKeyConfig": { - "fields": { - "keyName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "apiKeySecretVersion": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" - } - }, - "requestLocation": { - "type": "RequestLocation", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "RequestLocation": { - "values": { - "REQUEST_LOCATION_UNSPECIFIED": 0, - "HEADER": 1, - "QUERY_STRING": 2 - } - } - } - }, - "OAuthConfig": { - "fields": { - "oauthGrantType": { - "type": "OauthGrantType", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clientId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clientSecretVersion": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" - } - }, - "tokenEndpoint": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "scopes": { - "rule": "repeated", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "OauthGrantType": { - "values": { - "OAUTH_GRANT_TYPE_UNSPECIFIED": 0, - "CLIENT_CREDENTIAL": 1 - } - } - } - }, - "ServiceAgentIdTokenAuthConfig": { - "fields": {} - }, - "ServiceAccountAuthConfig": { - "fields": { - "serviceAccount": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "scopes": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "BearerTokenConfig": { - "fields": { - "token": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "EndUserAuthConfig": { - "oneofs": { - "authConfig": { - "oneof": [ - "oauth2AuthCodeConfig", - "oauth2JwtBearerConfig" - ] - } - }, - "fields": { - "oauth2AuthCodeConfig": { - "type": "Oauth2AuthCodeConfig", - "id": 2 - }, - "oauth2JwtBearerConfig": { - "type": "Oauth2JwtBearerConfig", - "id": 3 - } - }, - "nested": { - "Oauth2AuthCodeConfig": { - "fields": { - "oauthToken": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Oauth2JwtBearerConfig": { - "fields": { - "issuer": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "subject": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clientKey": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "ApiAuthentication": { - "oneofs": { - "authConfig": { - "oneof": [ - "apiKeyConfig", - "oauthConfig", - "serviceAgentIdTokenAuthConfig", - "serviceAccountAuthConfig", - "bearerTokenConfig" - ] - } - }, - "fields": { - "apiKeyConfig": { - "type": "ApiKeyConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "oauthConfig": { - "type": "OAuthConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAgentIdTokenAuthConfig": { - "type": "ServiceAgentIdTokenAuthConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccountAuthConfig": { - "type": "ServiceAccountAuthConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "bearerTokenConfig": { - "type": "BearerTokenConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DataStoreTool": { - "oneofs": { - "searchSource": { - "oneof": [ - "dataStoreSource", - "engineSource" - ] - } - }, - "fields": { - "dataStoreSource": { - "type": "DataStoreSource", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "engineSource": { - "type": "EngineSource", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "boostSpecs": { - "rule": "repeated", - "type": "BoostSpecs", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "modalityConfigs": { - "rule": "repeated", - "type": "ModalityConfig", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filterParameterBehavior": { - "type": "FilterParameterBehavior", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "RewriterConfig": { - "fields": { - "modelSettings": { - "type": "ModelSettings", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "prompt": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "disabled": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SummarizationConfig": { - "fields": { - "modelSettings": { - "type": "ModelSettings", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "prompt": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "disabled": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GroundingConfig": { - "fields": { - "groundingLevel": { - "type": "float", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "disabled": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DataStoreSource": { - "fields": { - "filter": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "dataStore": { - "type": "DataStore", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "EngineSource": { - "fields": { - "engine": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "dataStoreSources": { - "rule": "repeated", - "type": "DataStoreSource", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "BoostSpecs": { - "fields": { - "dataStores": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "spec": { - "rule": "repeated", - "type": "BoostSpec", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BoostSpec": { - "fields": { - "conditionBoostSpecs": { - "rule": "repeated", - "type": "ConditionBoostSpec", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "ConditionBoostSpec": { - "fields": { - "condition": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "boost": { - "type": "float", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "boostControlSpec": { - "type": "BoostControlSpec", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "BoostControlSpec": { - "fields": { - "fieldName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "attributeType": { - "type": "AttributeType", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "interpolationType": { - "type": "InterpolationType", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "controlPoints": { - "rule": "repeated", - "type": "ControlPoint", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ControlPoint": { - "fields": { - "attributeValue": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "boostAmount": { - "type": "float", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AttributeType": { - "values": { - "ATTRIBUTE_TYPE_UNSPECIFIED": 0, - "NUMERICAL": 1, - "FRESHNESS": 2 - } - }, - "InterpolationType": { - "values": { - "INTERPOLATION_TYPE_UNSPECIFIED": 0, - "LINEAR": 1 - } - } - } - } - } - } - } - }, - "ModalityConfig": { - "fields": { - "modalityType": { - "type": "ModalityType", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "rewriterConfig": { - "type": "RewriterConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "summarizationConfig": { - "type": "SummarizationConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "groundingConfig": { - "type": "GroundingConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ModalityType": { - "values": { - "MODALITY_TYPE_UNSPECIFIED": 0, - "TEXT": 1, - "AUDIO": 2 - } - } - } - }, - "FilterParameterBehavior": { - "values": { - "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED": 0, - "ALWAYS_INCLUDE": 2, - "NEVER_INCLUDE": 3 - } - } - } - }, - "DataStore": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "type": { - "type": "DataStoreType", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "documentProcessingMode": { - "type": "DocumentProcessingMode", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "displayName": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "connectorConfig": { - "type": "ConnectorConfig", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "ConnectorConfig": { - "fields": { - "collection": { - "type": "string", - "id": 1 - }, - "collectionDisplayName": { - "type": "string", - "id": 2 - }, - "dataSource": { - "type": "string", - "id": 3 - } - } - }, - "DataStoreType": { - "values": { - "DATA_STORE_TYPE_UNSPECIFIED": 0, - "PUBLIC_WEB": 1, - "UNSTRUCTURED": 2, - "FAQ": 3, - "CONNECTOR": 4 - } - }, - "DocumentProcessingMode": { - "values": { - "DOCUMENT_PROCESSING_MODE_UNSPECIFIED": 0, - "DOCUMENTS": 1, - "CHUNKS": 2 - } - } - } - }, - "FileSearchTool": { - "fields": { - "corpusType": { - "type": "CorpusType", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fileCorpus": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "CorpusType": { - "values": { - "CORPUS_TYPE_UNSPECIFIED": 0, - "USER_OWNED": 1, - "FULLY_MANAGED": 2 - } - } - } - }, - "GoogleSearchTool": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "contextUrls": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "preferredDomains": { - "rule": "repeated", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "excludeDomains": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "promptConfig": { - "type": "PromptConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "PromptConfig": { - "fields": { - "textPrompt": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "voicePrompt": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "McpTool": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "inputSchema": { - "type": "Schema", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "outputSchema": { - "type": "Schema", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serverAddress": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "apiAuthentication": { - "type": "ApiAuthentication", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tlsConfig": { - "type": "TlsConfig", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceDirectoryConfig": { - "type": "ServiceDirectoryConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "OpenApiTool": { - "fields": { - "openApiSchema": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "name": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "apiAuthentication": { - "type": "ApiAuthentication", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tlsConfig": { - "type": "TlsConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceDirectoryConfig": { - "type": "ServiceDirectoryConfig", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ignoreUnknownFields": { - "type": "bool", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "url": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PythonFunction": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pythonCode": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "SystemTool": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "WidgetTool": { - "oneofs": { - "input": { - "oneof": [ - "parameters" - ] - } - }, - "fields": { - "parameters": { - "type": "Schema", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "widgetType": { - "type": "WidgetType", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "WidgetType": { - "values": { - "WIDGET_TYPE_UNSPECIFIED": 0, - "CUSTOM": 1, - "PRODUCT_CAROUSEL": 2, - "PRODUCT_DETAILS": 3, - "QUICK_ACTIONS": 4, - "PRODUCT_COMPARISON": 5, - "ADVANCED_PRODUCT_DETAILS": 6, - "SHORT_FORM": 7, - "OVERALL_SATISFACTION": 8, - "ORDER_SUMMARY": 9, - "APPOINTMENT_DETAILS": 10, - "APPOINTMENT_SCHEDULER": 11, - "CONTACT_FORM": 12 - } - } - } - }, - "Toolset": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Toolset", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}", - "(google.api.resource).plural": "toolsets", - "(google.api.resource).singular": "toolset" - }, - "oneofs": { - "toolsetType": { - "oneof": [ - "mcpToolset", - "openApiToolset", - "connectorToolset" - ] - } - }, - "fields": { - "mcpToolset": { - "type": "McpToolset", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "openApiToolset": { - "type": "OpenApiToolset", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "connectorToolset": { - "type": "ConnectorToolset", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "description": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 5 - }, - "executionType": { - "type": "ExecutionType", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "toolFakeConfig": { - "type": "ToolFakeConfig", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ConnectorToolset": { - "fields": { - "connection": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "authConfig": { - "type": "EndUserAuthConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "connectorActions": { - "rule": "repeated", - "type": "Action", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "McpToolset": { - "fields": { - "serverAddress": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "apiAuthentication": { - "type": "ApiAuthentication", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceDirectoryConfig": { - "type": "ServiceDirectoryConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tlsConfig": { - "type": "TlsConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "OpenApiToolset": { - "fields": { - "openApiSchema": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "apiAuthentication": { - "type": "ApiAuthentication", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tlsConfig": { - "type": "TlsConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceDirectoryConfig": { - "type": "ServiceDirectoryConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ignoreUnknownFields": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "url": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Changelog": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Changelog", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}", - "(google.api.resource).plural": "changelogs", - "(google.api.resource).singular": "changelog" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "author": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "displayName": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "description": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "resource": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "resourceType": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "action": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "originalResource": { - "type": "google.protobuf.Struct", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "newResource": { - "type": "google.protobuf.Struct", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "dependentResources": { - "rule": "repeated", - "type": "google.protobuf.Struct", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "sequenceNumber": { - "type": "int64", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Conversation": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Conversation", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}", - "(google.api.resource).plural": "conversations", - "(google.api.resource).singular": "conversation" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "turns": { - "rule": "repeated", - "type": "Turn", - "id": 6, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "turnCount": { - "type": "int32", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "channelType": { - "type": "ChannelType", - "id": 8, - "options": { - "deprecated": true - } - }, - "source": { - "type": "Source", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "inputTypes": { - "rule": "repeated", - "type": "InputType", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "entryAgent": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - }, - "deployment": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" - } - }, - "appVersion": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" - } - }, - "languageCode": { - "type": "string", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "messages": { - "rule": "repeated", - "type": "Message", - "id": 2, - "options": { - "deprecated": true - } - } - }, - "nested": { - "Turn": { - "fields": { - "messages": { - "rule": "repeated", - "type": "Message", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "rootSpan": { - "type": "Span", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ChannelType": { - "values": { - "CHANNEL_TYPE_UNSPECIFIED": 0, - "TEXT": 1, - "AUDIO": 2, - "MULTIMODAL": 3 - } - }, - "Source": { - "values": { - "SOURCE_UNSPECIFIED": 0, - "LIVE": 1, - "SIMULATOR": 2, - "EVAL": 3 - } - }, - "InputType": { - "values": { - "INPUT_TYPE_UNSPECIFIED": 0, - "INPUT_TYPE_TEXT": 1, - "INPUT_TYPE_AUDIO": 2, - "INPUT_TYPE_IMAGE": 3, - "INPUT_TYPE_BLOB": 4, - "INPUT_TYPE_TOOL_RESPONSE": 5, - "INPUT_TYPE_VARIABLES": 6 - } - } - } - }, - "Deployment": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Deployment", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}", - "(google.api.resource).plural": "deployments", - "(google.api.resource).singular": "deployment" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "appVersion": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" - } - }, - "channelProfile": { - "type": "ChannelProfile", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "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" - } - }, - "etag": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "AggregatedMetrics": { - "fields": { - "metricsByAppVersion": { - "rule": "repeated", - "type": "MetricsByAppVersion", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "ToolMetrics": { - "fields": { - "tool": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "passCount": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "failCount": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "TurnLatencyMetrics": { - "fields": { - "averageLatency": { - "type": "google.protobuf.Duration", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "ToolCallLatencyMetrics": { - "fields": { - "tool": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "averageLatency": { - "type": "google.protobuf.Duration", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "SemanticSimilarityMetrics": { - "fields": { - "score": { - "type": "float", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "HallucinationMetrics": { - "fields": { - "score": { - "type": "float", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "MetricsByAppVersion": { - "fields": { - "appVersionId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "toolMetrics": { - "rule": "repeated", - "type": "ToolMetrics", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "semanticSimilarityMetrics": { - "rule": "repeated", - "type": "SemanticSimilarityMetrics", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "hallucinationMetrics": { - "rule": "repeated", - "type": "HallucinationMetrics", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "toolCallLatencyMetrics": { - "rule": "repeated", - "type": "ToolCallLatencyMetrics", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "turnLatencyMetrics": { - "rule": "repeated", - "type": "TurnLatencyMetrics", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "passCount": { - "type": "int32", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "failCount": { - "type": "int32", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "metricsByTurn": { - "rule": "repeated", - "type": "MetricsByTurn", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "MetricsByTurn": { - "fields": { - "turnIndex": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "toolMetrics": { - "rule": "repeated", - "type": "ToolMetrics", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "semanticSimilarityMetrics": { - "rule": "repeated", - "type": "SemanticSimilarityMetrics", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "hallucinationMetrics": { - "rule": "repeated", - "type": "HallucinationMetrics", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "toolCallLatencyMetrics": { - "rule": "repeated", - "type": "ToolCallLatencyMetrics", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "turnLatencyMetrics": { - "rule": "repeated", - "type": "TurnLatencyMetrics", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - } - } - }, - "Evaluation": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Evaluation", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}", - "(google.api.resource).plural": "evaluations", - "(google.api.resource).singular": "evaluation" - }, - "oneofs": { - "inputs": { - "oneof": [ - "golden", - "scenario" - ] - } - }, - "fields": { - "golden": { - "type": "Golden", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scenario": { - "type": "Scenario", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tags": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "evaluationDatasets": { - "rule": "repeated", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationDataset" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createdBy": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastUpdatedBy": { - "type": "string", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "evaluationRuns": { - "rule": "repeated", - "type": "string", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" - } - }, - "etag": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "aggregatedMetrics": { - "type": "AggregatedMetrics", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastCompletedResult": { - "type": "EvaluationResult", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "invalid": { - "type": "bool", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastTenResults": { - "rule": "repeated", - "type": "EvaluationResult", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "GoldenExpectation": { - "oneofs": { - "condition": { - "oneof": [ - "toolCall", - "toolResponse", - "agentResponse", - "agentTransfer", - "updatedVariables", - "mockToolResponse" - ] - } - }, - "fields": { - "toolCall": { - "type": "ToolCall", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "toolResponse": { - "type": "ToolResponse", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "agentResponse": { - "type": "Message", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "agentTransfer": { - "type": "AgentTransfer", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "updatedVariables": { - "type": "google.protobuf.Struct", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "mockToolResponse": { - "type": "ToolResponse", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "note": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Step": { - "oneofs": { - "step": { - "oneof": [ - "userInput", - "agentTransfer", - "expectation" - ] - } - }, - "fields": { - "userInput": { - "type": "SessionInput", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "agentTransfer": { - "type": "AgentTransfer", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "expectation": { - "type": "GoldenExpectation", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GoldenTurn": { - "fields": { - "steps": { - "rule": "repeated", - "type": "Step", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "rootSpan": { - "type": "Span", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Golden": { - "fields": { - "turns": { - "rule": "repeated", - "type": "GoldenTurn", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "evaluationExpectations": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationExpectation" - } - } - } - }, - "ScenarioExpectation": { - "oneofs": { - "expectation": { - "oneof": [ - "toolExpectation", - "agentResponse" - ] - } - }, - "fields": { - "toolExpectation": { - "type": "ToolExpectation", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "agentResponse": { - "type": "Message", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ToolExpectation": { - "fields": { - "expectedToolCall": { - "type": "ToolCall", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "mockToolResponse": { - "type": "ToolResponse", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "Scenario": { - "fields": { - "task": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "userFacts": { - "rule": "repeated", - "type": "UserFact", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxTurns": { - "type": "int32", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "rubrics": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "scenarioExpectations": { - "rule": "repeated", - "type": "ScenarioExpectation", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "variableOverrides": { - "type": "google.protobuf.Struct", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "taskCompletionBehavior": { - "type": "TaskCompletionBehavior", - "id": 7, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "userGoalBehavior": { - "type": "UserGoalBehavior", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "evaluationExpectations": { - "rule": "repeated", - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationExpectation" - } - } - }, - "nested": { - "UserFact": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "value": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "TaskCompletionBehavior": { - "values": { - "TASK_COMPLETION_BEHAVIOR_UNSPECIFIED": 0, - "TASK_SATISFIED": 1, - "TASK_REJECTED": 2 - } - }, - "UserGoalBehavior": { - "values": { - "USER_GOAL_BEHAVIOR_UNSPECIFIED": 0, - "USER_GOAL_SATISFIED": 1, - "USER_GOAL_REJECTED": 2, - "USER_GOAL_IGNORED": 3 - } - } - } - } - } - }, - "EvaluationDataset": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/EvaluationDataset", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/evaluationDatasets/{evaluation_dataset}", - "(google.api.resource).plural": "evaluationDatasets", - "(google.api.resource).singular": "evaluationDataset" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "evaluations": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Evaluation" - } - }, - "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" - } - }, - "etag": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createdBy": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastUpdatedBy": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "aggregatedMetrics": { - "type": "AggregatedMetrics", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "EvaluationResult": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/EvaluationResult", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}/results/{evaluation_result}", - "(google.api.resource).plural": "evaluationResults", - "(google.api.resource).singular": "evaluationResult" - }, - "oneofs": { - "result": { - "oneof": [ - "goldenResult", - "scenarioResult" - ] - } - }, - "fields": { - "goldenResult": { - "type": "GoldenResult", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "scenarioResult": { - "type": "ScenarioResult", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "evaluationStatus": { - "type": "Outcome", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "evaluationRun": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" - } - }, - "persona": { - "type": "EvaluationPersona", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "errorInfo": { - "type": "EvaluationErrorInfo", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "error": { - "type": "google.rpc.Status", - "id": 14, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "initiatedBy": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "appVersion": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" - } - }, - "appVersionDisplayName": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "changelog": { - "type": "string", - "id": 21, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/Changelog" - } - }, - "changelogCreateTime": { - "type": "google.protobuf.Timestamp", - "id": 22, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "executionState": { - "type": "ExecutionState", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "evaluationMetricsThresholds": { - "type": "EvaluationMetricsThresholds", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "config": { - "type": "EvaluationConfig", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "goldenRunMethod": { - "type": "GoldenRunMethod", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "GoldenExpectationOutcome": { - "oneofs": { - "result": { - "oneof": [ - "observedToolCall", - "observedToolResponse", - "observedAgentResponse", - "observedAgentTransfer" - ] - } - }, - "fields": { - "observedToolCall": { - "type": "ToolCall", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "observedToolResponse": { - "type": "ToolResponse", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "observedAgentResponse": { - "type": "Message", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "observedAgentTransfer": { - "type": "AgentTransfer", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expectation": { - "type": "Evaluation.GoldenExpectation", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "outcome": { - "type": "Outcome", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "semanticSimilarityResult": { - "type": "SemanticSimilarityResult", - "id": 7, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "toolInvocationResult": { - "type": "ToolInvocationResult", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "ToolInvocationResult": { - "oneofs": { - "_parameterCorrectnessScore": { - "oneof": [ - "parameterCorrectnessScore" - ] - } - }, - "fields": { - "parameterCorrectnessScore": { - "type": "float", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "outcome": { - "type": "Outcome", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "explanation": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - } - } - }, - "EvaluationExpectationResult": { - "fields": { - "evaluationExpectation": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationExpectation" - } - }, - "prompt": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "outcome": { - "type": "Outcome", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "explanation": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "GoldenResult": { - "fields": { - "turnReplayResults": { - "rule": "repeated", - "type": "TurnReplayResult", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "evaluationExpectationResults": { - "rule": "repeated", - "type": "EvaluationExpectationResult", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "TurnReplayResult": { - "oneofs": { - "_toolOrderedInvocationScore": { - "oneof": [ - "toolOrderedInvocationScore" - ] - } - }, - "fields": { - "conversation": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" - } - }, - "expectationOutcome": { - "rule": "repeated", - "type": "GoldenExpectationOutcome", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "hallucinationResult": { - "type": "HallucinationResult", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "toolInvocationScore": { - "type": "float", - "id": 4, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "toolOrderedInvocationScore": { - "type": "float", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "turnLatency": { - "type": "google.protobuf.Duration", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "toolCallLatencies": { - "rule": "repeated", - "type": "ToolCallLatency", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "semanticSimilarityResult": { - "type": "SemanticSimilarityResult", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "overallToolInvocationResult": { - "type": "OverallToolInvocationResult", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "errorInfo": { - "type": "EvaluationErrorInfo", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "spanLatencies": { - "rule": "repeated", - "type": "SpanLatency", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - } - } - }, - "ScenarioRubricOutcome": { - "oneofs": { - "_score": { - "oneof": [ - "score" - ] - } - }, - "fields": { - "rubric": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "score": { - "type": "float", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "scoreExplanation": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "ScenarioExpectationOutcome": { - "oneofs": { - "result": { - "oneof": [ - "observedToolCall", - "observedAgentResponse" - ] - } - }, - "fields": { - "observedToolCall": { - "type": "ObservedToolCall", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "observedAgentResponse": { - "type": "Message", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expectation": { - "type": "Evaluation.ScenarioExpectation", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "outcome": { - "type": "Outcome", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "ObservedToolCall": { - "fields": { - "toolCall": { - "type": "ToolCall", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "toolResponse": { - "type": "ToolResponse", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - } - } - }, - "ScenarioResult": { - "oneofs": { - "_allExpectationsSatisfied": { - "oneof": [ - "allExpectationsSatisfied" - ] - }, - "_taskCompleted": { - "oneof": [ - "taskCompleted" - ] - } - }, - "fields": { - "conversation": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" - } - }, - "task": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "userFacts": { - "rule": "repeated", - "type": "Evaluation.Scenario.UserFact", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expectationOutcomes": { - "rule": "repeated", - "type": "ScenarioExpectationOutcome", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "rubricOutcomes": { - "rule": "repeated", - "type": "ScenarioRubricOutcome", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "hallucinationResult": { - "rule": "repeated", - "type": "HallucinationResult", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "taskCompletionResult": { - "type": "TaskCompletionResult", - "id": 5, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "toolCallLatencies": { - "rule": "repeated", - "type": "ToolCallLatency", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "userGoalSatisfactionResult": { - "type": "UserGoalSatisfactionResult", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "allExpectationsSatisfied": { - "type": "bool", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "taskCompleted": { - "type": "bool", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "spanLatencies": { - "rule": "repeated", - "type": "SpanLatency", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "evaluationExpectationResults": { - "rule": "repeated", - "type": "EvaluationExpectationResult", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "SpanLatency": { - "oneofs": { - "identifier": { - "oneof": [ - "resource", - "toolset", - "model", - "callback" - ] - } - }, - "fields": { - "resource": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "toolset": { - "type": "ToolsetTool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "model": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "callback": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "type": { - "type": "Type", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "displayName": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "executionLatency": { - "type": "google.protobuf.Duration", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "TOOL": 1, - "USER_CALLBACK": 2, - "GUARDRAIL": 3, - "LLM": 4 - } - } - } - }, - "ToolCallLatency": { - "fields": { - "tool": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "executionLatency": { - "type": "google.protobuf.Duration", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "HallucinationResult": { - "oneofs": { - "_score": { - "oneof": [ - "score" - ] - } - }, - "fields": { - "score": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "label": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "explanation": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "UserGoalSatisfactionResult": { - "oneofs": { - "_score": { - "oneof": [ - "score" - ] - } - }, - "fields": { - "score": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "label": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "explanation": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "SemanticSimilarityResult": { - "oneofs": { - "_score": { - "oneof": [ - "score" - ] - } - }, - "fields": { - "score": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "label": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "explanation": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "outcome": { - "type": "Outcome", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "OverallToolInvocationResult": { - "oneofs": { - "_toolInvocationScore": { - "oneof": [ - "toolInvocationScore" - ] - } - }, - "fields": { - "toolInvocationScore": { - "type": "float", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "outcome": { - "type": "Outcome", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "TaskCompletionResult": { - "oneofs": { - "_score": { - "oneof": [ - "score" - ] - } - }, - "fields": { - "score": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "label": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "explanation": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Outcome": { - "values": { - "OUTCOME_UNSPECIFIED": 0, - "PASS": 1, - "FAIL": 2 - } - }, - "ExecutionState": { - "values": { - "EXECUTION_STATE_UNSPECIFIED": 0, - "RUNNING": 1, - "COMPLETED": 2, - "ERROR": 3 - } - } - } - }, - "EvaluationRun": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/EvaluationRun", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/evaluationRuns/{evaluation_run}", - "(google.api.resource).plural": "evaluationRuns", - "(google.api.resource).singular": "evaluationRun" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "evaluationResults": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationResult" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "initiatedBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "appVersion": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" - } - }, - "appVersionDisplayName": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "changelog": { - "type": "string", - "id": 22, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/Changelog" - } - }, - "changelogCreateTime": { - "type": "google.protobuf.Timestamp", - "id": 23, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "evaluations": { - "rule": "repeated", - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/Evaluation" - } - }, - "evaluationDataset": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationDataset" - } - }, - "evaluationType": { - "type": "EvaluationType", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "EvaluationRunState", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "progress": { - "type": "Progress", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "config": { - "type": "EvaluationConfig", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "error": { - "type": "google.rpc.Status", - "id": 14, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "errorInfo": { - "type": "EvaluationErrorInfo", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "evaluationRunSummaries": { - "keyType": "string", - "type": "EvaluationRunSummary", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "latencyReport": { - "type": "LatencyReport", - "id": 25, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "runCount": { - "type": "int32", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "personaRunConfigs": { - "rule": "repeated", - "type": "PersonaRunConfig", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "optimizationConfig": { - "type": "OptimizationConfig", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scheduledEvaluationRun": { - "type": "string", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/ScheduledEvaluationRun" - } - }, - "goldenRunMethod": { - "type": "GoldenRunMethod", - "id": 21, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "Progress": { - "fields": { - "totalCount": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "failedCount": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "errorCount": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "completedCount": { - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "passedCount": { - "type": "int32", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "EvaluationRunSummary": { - "fields": { - "passedCount": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "failedCount": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "errorCount": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "EvaluationType": { - "values": { - "EVALUATION_TYPE_UNSPECIFIED": 0, - "GOLDEN": 1, - "SCENARIO": 2, - "MIXED": 3 - } - }, - "EvaluationRunState": { - "values": { - "EVALUATION_RUN_STATE_UNSPECIFIED": 0, - "RUNNING": 1, - "COMPLETED": 2, - "ERROR": 3 - } - } - } - }, - "LatencyReport": { - "fields": { - "toolLatencies": { - "rule": "repeated", - "type": "ToolLatency", - "id": 1, - "options": { - "(google.api.field_behavior)": "UNORDERED_LIST" - } - }, - "callbackLatencies": { - "rule": "repeated", - "type": "CallbackLatency", - "id": 2, - "options": { - "(google.api.field_behavior)": "UNORDERED_LIST" - } - }, - "guardrailLatencies": { - "rule": "repeated", - "type": "GuardrailLatency", - "id": 3, - "options": { - "(google.api.field_behavior)": "UNORDERED_LIST" - } - }, - "llmCallLatencies": { - "rule": "repeated", - "type": "LlmCallLatency", - "id": 4, - "options": { - "(google.api.field_behavior)": "UNORDERED_LIST" - } - }, - "sessionCount": { - "type": "int32", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "LatencyMetrics": { - "fields": { - "p50Latency": { - "type": "google.protobuf.Duration", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "p90Latency": { - "type": "google.protobuf.Duration", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "p99Latency": { - "type": "google.protobuf.Duration", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "callCount": { - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "ToolLatency": { - "oneofs": { - "toolIdentifier": { - "oneof": [ - "tool", - "toolsetTool" - ] - } - }, - "fields": { - "tool": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "toolsetTool": { - "type": "ToolsetTool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "toolDisplayName": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "latencyMetrics": { - "type": "LatencyMetrics", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "CallbackLatency": { - "fields": { - "stage": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "latencyMetrics": { - "type": "LatencyMetrics", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "GuardrailLatency": { - "fields": { - "guardrail": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" - } - }, - "guardrailDisplayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "latencyMetrics": { - "type": "LatencyMetrics", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "LlmCallLatency": { - "fields": { - "model": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "latencyMetrics": { - "type": "LatencyMetrics", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - } - } - }, - "EvaluationExpectation": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/EvaluationExpectation", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/evaluationExpectations/{evaluation_expectation}", - "(google.api.resource).plural": "evaluationExpectations", - "(google.api.resource).singular": "evaluationExpectation" - }, - "oneofs": { - "criteria": { - "oneof": [ - "llmCriteria" - ] - } - }, - "fields": { - "llmCriteria": { - "type": "LlmCriteria", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "tags": { - "rule": "repeated", - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "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" - } - }, - "etag": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "LlmCriteria": { - "fields": { - "prompt": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "EvaluationConfig": { - "fields": { - "inputAudioConfig": { - "type": "InputAudioConfig", - "id": 1, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "outputAudioConfig": { - "type": "OutputAudioConfig", - "id": 2, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "evaluationChannel": { - "type": "EvaluationChannel", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "toolCallBehaviour": { - "type": "EvaluationToolCallBehaviour", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "EvaluationChannel": { - "values": { - "EVALUATION_CHANNEL_UNSPECIFIED": 0, - "TEXT": 1, - "AUDIO": 2 - } - } - } - }, - "EvaluationErrorInfo": { - "fields": { - "errorType": { - "type": "ErrorType", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "errorMessage": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "sessionId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "ErrorType": { - "values": { - "ERROR_TYPE_UNSPECIFIED": 0, - "RUNTIME_FAILURE": 1, - "CONVERSATION_RETRIEVAL_FAILURE": 2, - "METRIC_CALCULATION_FAILURE": 3, - "EVALUATION_UPDATE_FAILURE": 4, - "QUOTA_EXHAUSTED": 5, - "USER_SIMULATION_FAILURE": 6 - } - } - } - }, - "RunEvaluationRequest": { - "oneofs": { - "_runCount": { - "oneof": [ - "runCount" - ] - } - }, - "fields": { - "app": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - }, - "evaluations": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Evaluation" - } - }, - "evaluationDataset": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationDataset" - } - }, - "displayName": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "appVersion": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" - } - }, - "config": { - "type": "EvaluationConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "runCount": { - "type": "int32", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "personaRunConfigs": { - "rule": "repeated", - "type": "PersonaRunConfig", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "optimizationConfig": { - "type": "OptimizationConfig", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scheduledEvaluationRun": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/ScheduledEvaluationRun" - } - }, - "goldenRunMethod": { - "type": "GoldenRunMethod", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "generateLatencyReport": { - "type": "bool", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ScheduledEvaluationRun": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/ScheduledEvaluationRun", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/scheduledEvaluationRuns/{scheduled_evaluation_run}", - "(google.api.resource).plural": "scheduledEvaluationRuns", - "(google.api.resource).singular": "scheduledEvaluationRun" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "request": { - "type": "RunEvaluationRequest", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "schedulingConfig": { - "type": "SchedulingConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "active": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "lastCompletedRun": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" - } - }, - "totalExecutions": { - "type": "int32", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "nextScheduledExecutionTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createdBy": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastUpdatedBy": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "SchedulingConfig": { - "fields": { - "frequency": { - "type": "Frequency", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "daysOfWeek": { - "rule": "repeated", - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Frequency": { - "values": { - "FREQUENCY_UNSPECIFIED": 0, - "NONE": 1, - "DAILY": 2, - "WEEKLY": 3, - "BIWEEKLY": 4 - } - } - } - } - } - }, - "PersonaRunConfig": { - "fields": { - "persona": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "taskCount": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "OptimizationConfig": { - "fields": { - "generateLossReport": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "assistantSession": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "reportSummary": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "shouldSuggestFix": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "status": { - "type": "OptimizationStatus", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "errorMessage": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lossReport": { - "type": "google.protobuf.Struct", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "OptimizationStatus": { - "values": { - "OPTIMIZATION_STATUS_UNSPECIFIED": 0, - "RUNNING": 1, - "COMPLETED": 2, - "ERROR": 3 - } - } - } - }, - "SessionService": { - "options": { - "(google.api.default_host)": "ces.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "RunSession": { - "requestType": "RunSessionRequest", - "responseType": "RunSessionResponse", - "options": { - "(google.api.http).post": "/v1beta/{config.session=projects/*/locations/*/apps/*/sessions/*}:runSession", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{config.session=projects/*/locations/*/apps/*/sessions/*}:runSession", - "body": "*" - } - } - ] - }, - "BidiRunSession": { - "requestType": "BidiSessionClientMessage", - "requestStream": true, - "responseType": "BidiSessionServerMessage", - "responseStream": true - } - } - }, - "AudioEncoding": { - "values": { - "AUDIO_ENCODING_UNSPECIFIED": 0, - "LINEAR16": 1, - "MULAW": 2, - "ALAW": 3 - } - }, - "InputAudioConfig": { - "fields": { - "audioEncoding": { - "type": "AudioEncoding", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "sampleRateHertz": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "noiseSuppressionLevel": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "OutputAudioConfig": { - "fields": { - "audioEncoding": { - "type": "AudioEncoding", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "sampleRateHertz": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "SessionConfig": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Session" - } - }, - "inputAudioConfig": { - "type": "InputAudioConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "outputAudioConfig": { - "type": "OutputAudioConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "historicalContexts": { - "rule": "repeated", - "type": "Message", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "entryAgent": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Agent" - } - }, - "deployment": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "timeZone": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "remoteDialogflowQueryParameters": { - "type": "RemoteDialogflowQueryParameters", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "RemoteDialogflowQueryParameters": { - "fields": { - "webhookHeaders": { - "keyType": "string", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "payload": { - "type": "google.protobuf.Struct", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "endUserMetadata": { - "type": "google.protobuf.Struct", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "ToolCalls": { - "fields": { - "toolCalls": { - "rule": "repeated", - "type": "ToolCall", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ToolResponses": { - "fields": { - "toolResponses": { - "rule": "repeated", - "type": "ToolResponse", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Citations": { - "fields": { - "citedChunks": { - "rule": "repeated", - "type": "CitedChunk", - "id": 1 - } - }, - "nested": { - "CitedChunk": { - "fields": { - "uri": { - "type": "string", - "id": 1 - }, - "title": { - "type": "string", - "id": 2 - }, - "text": { - "type": "string", - "id": 3 - } - } - } - } - }, - "Event": { - "fields": { - "event": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "SessionInput": { - "oneofs": { - "inputType": { - "oneof": [ - "text", - "dtmf", - "audio", - "toolResponses", - "image", - "blob", - "variables", - "event" - ] - } - }, - "fields": { - "text": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "dtmf": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "audio": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "toolResponses": { - "type": "ToolResponses", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "image": { - "type": "Image", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "blob": { - "type": "Blob", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "variables": { - "type": "google.protobuf.Struct", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "event": { - "type": "Event", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "willContinue": { - "type": "bool", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SessionOutput": { - "oneofs": { - "outputType": { - "oneof": [ - "text", - "audio", - "toolCalls", - "citations", - "googleSearchSuggestions", - "endSession", - "payload" - ] - } - }, - "fields": { - "text": { - "type": "string", - "id": 1 - }, - "audio": { - "type": "bytes", - "id": 2 - }, - "toolCalls": { - "type": "ToolCalls", - "id": 3 - }, - "citations": { - "type": "Citations", - "id": 8 - }, - "googleSearchSuggestions": { - "type": "GoogleSearchSuggestions", - "id": 10 - }, - "endSession": { - "type": "EndSession", - "id": 9 - }, - "payload": { - "type": "google.protobuf.Struct", - "id": 11 - }, - "turnIndex": { - "type": "int32", - "id": 6 - }, - "turnCompleted": { - "type": "bool", - "id": 4 - }, - "diagnosticInfo": { - "type": "DiagnosticInfo", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "DiagnosticInfo": { - "fields": { - "messages": { - "rule": "repeated", - "type": "Message", - "id": 1 - }, - "rootSpan": { - "type": "Span", - "id": 3 - } - } - } - } - }, - "RecognitionResult": { - "fields": { - "transcript": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InterruptionSignal": { - "fields": { - "bargeIn": { - "type": "bool", - "id": 1 - } - } - }, - "EndSession": { - "fields": { - "metadata": { - "type": "google.protobuf.Struct", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GoAway": { - "fields": {} - }, - "RunSessionRequest": { - "fields": { - "config": { - "type": "SessionConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "inputs": { - "rule": "repeated", - "type": "SessionInput", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "RunSessionResponse": { - "fields": { - "outputs": { - "rule": "repeated", - "type": "SessionOutput", - "id": 1 - } - } - }, - "BidiSessionClientMessage": { - "oneofs": { - "messageType": { - "oneof": [ - "config", - "realtimeInput" - ] - } - }, - "fields": { - "config": { - "type": "SessionConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "realtimeInput": { - "type": "SessionInput", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "BidiSessionServerMessage": { - "oneofs": { - "messageType": { - "oneof": [ - "sessionOutput", - "recognitionResult", - "interruptionSignal", - "endSession", - "goAway" - ] - } - }, - "fields": { - "sessionOutput": { - "type": "SessionOutput", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "recognitionResult": { - "type": "RecognitionResult", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "interruptionSignal": { - "type": "InterruptionSignal", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "endSession": { - "type": "EndSession", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "goAway": { - "type": "GoAway", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GoogleSearchSuggestions": { - "fields": { - "htmls": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "webSearchQueries": { - "rule": "repeated", - "type": "WebSearchQuery", - "id": 2 - } - } - }, - "WebSearchQuery": { - "fields": { - "query": { - "type": "string", - "id": 1 - }, - "uri": { - "type": "string", - "id": 2 - } - } - }, - "EvaluationService": { - "options": { - "(google.api.default_host)": "ces.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "RunEvaluation": { - "requestType": "RunEvaluationRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{app=projects/*/locations/*/apps/*}:runEvaluation", - "(google.api.http).body": "*", - "(google.api.method_signature)": "app", - "(google.longrunning.operation_info).response_type": "RunEvaluationResponse", - "(google.longrunning.operation_info).metadata_type": "RunEvaluationOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{app=projects/*/locations/*/apps/*}:runEvaluation", - "body": "*" - } - }, - { - "(google.api.method_signature)": "app" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "RunEvaluationResponse", - "metadata_type": "RunEvaluationOperationMetadata" - } - } - ] - }, - "UploadEvaluationAudio": { - "requestType": "UploadEvaluationAudioRequest", - "responseType": "UploadEvaluationAudioResponse", - "options": { - "(google.api.http).post": "/v1beta/{app=projects/*/locations/*/apps/*}:uploadEvaluationAudio", - "(google.api.http).body": "*", - "(google.api.method_signature)": "app,audio_content" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{app=projects/*/locations/*/apps/*}:uploadEvaluationAudio", - "body": "*" - } - }, - { - "(google.api.method_signature)": "app,audio_content" - } - ] - }, - "CreateEvaluation": { - "requestType": "CreateEvaluationRequest", - "responseType": "Evaluation", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluations", - "(google.api.http).body": "evaluation", - "(google.api.method_signature)": "parent,evaluation" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluations", - "body": "evaluation" - } - }, - { - "(google.api.method_signature)": "parent,evaluation,evaluation_id" - }, - { - "(google.api.method_signature)": "parent,evaluation" - } - ] - }, - "GenerateEvaluation": { - "requestType": "GenerateEvaluationRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{conversation=projects/*/locations/*/apps/*/conversations/*}:generateEvaluation", - "(google.api.http).body": "*", - "(google.api.method_signature)": "conversation", - "(google.longrunning.operation_info).response_type": "Evaluation", - "(google.longrunning.operation_info).metadata_type": "GenerateEvaluationOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{conversation=projects/*/locations/*/apps/*/conversations/*}:generateEvaluation", - "body": "*" - } - }, - { - "(google.api.method_signature)": "conversation" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Evaluation", - "metadata_type": "GenerateEvaluationOperationMetadata" - } - } - ] - }, - "ImportEvaluations": { - "requestType": "ImportEvaluationsRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}:importEvaluations", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent", - "(google.longrunning.operation_info).response_type": "ImportEvaluationsResponse", - "(google.longrunning.operation_info).metadata_type": "ImportEvaluationsOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/apps/*}:importEvaluations", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "ImportEvaluationsResponse", - "metadata_type": "ImportEvaluationsOperationMetadata" - } - } - ] - }, - "CreateEvaluationDataset": { - "requestType": "CreateEvaluationDatasetRequest", - "responseType": "EvaluationDataset", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationDatasets", - "(google.api.http).body": "evaluation_dataset", - "(google.api.method_signature)": "parent,evaluation_dataset" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationDatasets", - "body": "evaluation_dataset" - } - }, - { - "(google.api.method_signature)": "parent,evaluation_dataset,evaluation_dataset_id" - }, - { - "(google.api.method_signature)": "parent,evaluation_dataset" - } - ] - }, - "UpdateEvaluation": { - "requestType": "UpdateEvaluationRequest", - "responseType": "Evaluation", - "options": { - "(google.api.http).patch": "/v1beta/{evaluation.name=projects/*/locations/*/apps/*/evaluations/*}", - "(google.api.http).body": "evaluation", - "(google.api.method_signature)": "evaluation,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta/{evaluation.name=projects/*/locations/*/apps/*/evaluations/*}", - "body": "evaluation" - } - }, - { - "(google.api.method_signature)": "evaluation,update_mask" - } - ] - }, - "UpdateEvaluationDataset": { - "requestType": "UpdateEvaluationDatasetRequest", - "responseType": "EvaluationDataset", - "options": { - "(google.api.http).patch": "/v1beta/{evaluation_dataset.name=projects/*/locations/*/apps/*/evaluationDatasets/*}", - "(google.api.http).body": "evaluation_dataset", - "(google.api.method_signature)": "evaluation_dataset,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta/{evaluation_dataset.name=projects/*/locations/*/apps/*/evaluationDatasets/*}", - "body": "evaluation_dataset" - } - }, - { - "(google.api.method_signature)": "evaluation_dataset,update_mask" - } - ] - }, - "DeleteEvaluation": { - "requestType": "DeleteEvaluationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteEvaluationResult": { - "requestType": "DeleteEvaluationResultRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*/results/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*/results/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteEvaluationDataset": { - "requestType": "DeleteEvaluationDatasetRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationDatasets/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationDatasets/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteEvaluationRun": { - "requestType": "DeleteEvaluationRunRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationRuns/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "DeleteEvaluationRunOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationRuns/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "DeleteEvaluationRunOperationMetadata" - } - } - ] - }, - "GetEvaluation": { - "requestType": "GetEvaluationRequest", - "responseType": "Evaluation", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetEvaluationResult": { - "requestType": "GetEvaluationResultRequest", - "responseType": "EvaluationResult", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*/results/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*/results/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetEvaluationDataset": { - "requestType": "GetEvaluationDatasetRequest", - "responseType": "EvaluationDataset", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationDatasets/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationDatasets/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetEvaluationRun": { - "requestType": "GetEvaluationRunRequest", - "responseType": "EvaluationRun", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationRuns/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationRuns/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListEvaluations": { - "requestType": "ListEvaluationsRequest", - "responseType": "ListEvaluationsResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluations", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluations" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListEvaluationResults": { - "requestType": "ListEvaluationResultsRequest", - "responseType": "ListEvaluationResultsResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*/evaluations/*}/results", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/apps/*/evaluations/*}/results" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListEvaluationDatasets": { - "requestType": "ListEvaluationDatasetsRequest", - "responseType": "ListEvaluationDatasetsResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationDatasets", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationDatasets" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListEvaluationRuns": { - "requestType": "ListEvaluationRunsRequest", - "responseType": "ListEvaluationRunsResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationRuns", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationRuns" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListEvaluationExpectations": { - "requestType": "ListEvaluationExpectationsRequest", - "responseType": "ListEvaluationExpectationsResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationExpectations", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationExpectations" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetEvaluationExpectation": { - "requestType": "GetEvaluationExpectationRequest", - "responseType": "EvaluationExpectation", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationExpectations/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationExpectations/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateEvaluationExpectation": { - "requestType": "CreateEvaluationExpectationRequest", - "responseType": "EvaluationExpectation", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationExpectations", - "(google.api.http).body": "evaluation_expectation", - "(google.api.method_signature)": "parent,evaluation_expectation" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationExpectations", - "body": "evaluation_expectation" - } - }, - { - "(google.api.method_signature)": "parent,evaluation_expectation,evaluation_expectation_id" - }, - { - "(google.api.method_signature)": "parent,evaluation_expectation" - } - ] - }, - "UpdateEvaluationExpectation": { - "requestType": "UpdateEvaluationExpectationRequest", - "responseType": "EvaluationExpectation", - "options": { - "(google.api.http).patch": "/v1beta/{evaluation_expectation.name=projects/*/locations/*/apps/*/evaluationExpectations/*}", - "(google.api.http).body": "evaluation_expectation", - "(google.api.method_signature)": "evaluation_expectation,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta/{evaluation_expectation.name=projects/*/locations/*/apps/*/evaluationExpectations/*}", - "body": "evaluation_expectation" - } - }, - { - "(google.api.method_signature)": "evaluation_expectation,update_mask" - } - ] - }, - "DeleteEvaluationExpectation": { - "requestType": "DeleteEvaluationExpectationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationExpectations/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationExpectations/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateScheduledEvaluationRun": { - "requestType": "CreateScheduledEvaluationRunRequest", - "responseType": "ScheduledEvaluationRun", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/scheduledEvaluationRuns", - "(google.api.http).body": "scheduled_evaluation_run", - "(google.api.method_signature)": "parent,scheduled_evaluation_run" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/scheduledEvaluationRuns", - "body": "scheduled_evaluation_run" - } - }, - { - "(google.api.method_signature)": "parent,scheduled_evaluation_run,scheduled_evaluation_run_id" - }, - { - "(google.api.method_signature)": "parent,scheduled_evaluation_run" - } - ] - }, - "GetScheduledEvaluationRun": { - "requestType": "GetScheduledEvaluationRunRequest", - "responseType": "ScheduledEvaluationRun", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListScheduledEvaluationRuns": { - "requestType": "ListScheduledEvaluationRunsRequest", - "responseType": "ListScheduledEvaluationRunsResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/scheduledEvaluationRuns", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/scheduledEvaluationRuns" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateScheduledEvaluationRun": { - "requestType": "UpdateScheduledEvaluationRunRequest", - "responseType": "ScheduledEvaluationRun", - "options": { - "(google.api.http).patch": "/v1beta/{scheduled_evaluation_run.name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}", - "(google.api.http).body": "scheduled_evaluation_run", - "(google.api.method_signature)": "scheduled_evaluation_run,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta/{scheduled_evaluation_run.name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}", - "body": "scheduled_evaluation_run" - } - }, - { - "(google.api.method_signature)": "scheduled_evaluation_run,update_mask" - } - ] - }, - "DeleteScheduledEvaluationRun": { - "requestType": "DeleteScheduledEvaluationRunRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "TestPersonaVoice": { - "requestType": "TestPersonaVoiceRequest", - "responseType": "TestPersonaVoiceResponse", - "options": { - "(google.api.http).post": "/v1beta/{app=projects/*/locations/*/apps/*}:testPersonaVoice", - "(google.api.http).body": "*", - "(google.api.method_signature)": "app" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{app=projects/*/locations/*/apps/*}:testPersonaVoice", - "body": "*" - } - }, - { - "(google.api.method_signature)": "app" - } - ] - } - } - }, - "RunEvaluationResponse": { - "fields": { - "evaluationRun": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" - } - } - } - }, - "RunEvaluationOperationMetadata": { - "fields": { - "evaluations": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/Evaluation" - } - }, - "evaluationRun": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "verb": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "cancelRequested": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "GenerateEvaluationOperationMetadata": { - "fields": {} - }, - "DeleteEvaluationRunOperationMetadata": { - "fields": {} - }, - "CreateEvaluationRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - }, - "evaluationId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "evaluation": { - "type": "Evaluation", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GenerateEvaluationRequest": { - "fields": { - "conversation": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" - } - }, - "source": { - "type": "Conversation.Source", - "id": 2, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ImportEvaluationsRequest": { - "oneofs": { - "source": { - "oneof": [ - "conversationList", - "gcsUri", - "csvContent" - ] - } - }, - "fields": { - "conversationList": { - "type": "ConversationList", - "id": 2 - }, - "gcsUri": { - "type": "string", - "id": 3 - }, - "csvContent": { - "type": "bytes", - "id": 4 - }, - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - }, - "importOptions": { - "type": "ImportOptions", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ConversationList": { - "fields": { - "conversations": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ImportOptions": { - "fields": { - "conflictResolutionStrategy": { - "type": "ConflictResolutionStrategy", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ConflictResolutionStrategy": { - "values": { - "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED": 0, - "OVERWRITE": 1, - "SKIP": 2, - "DUPLICATE": 3 - } - } - } - } - } - }, - "ImportEvaluationsResponse": { - "fields": { - "evaluations": { - "rule": "repeated", - "type": "Evaluation", - "id": 1 - }, - "errorMessages": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "importFailureCount": { - "type": "int32", - "id": 3 - } - } - }, - "ImportEvaluationsOperationMetadata": { - "fields": { - "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" - } - }, - "statusMessage": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "CreateEvaluationDatasetRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - }, - "evaluationDatasetId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "evaluationDataset": { - "type": "EvaluationDataset", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateEvaluationRequest": { - "fields": { - "evaluation": { - "type": "Evaluation", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateEvaluationDatasetRequest": { - "fields": { - "evaluationDataset": { - "type": "EvaluationDataset", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteEvaluationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Evaluation" - } - }, - "force": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteEvaluationResultRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationResult" - } - } - } - }, - "DeleteEvaluationDatasetRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationDataset" - } - }, - "etag": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteEvaluationRunRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" - } - } - } - }, - "GetEvaluationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Evaluation" - } - } - } - }, - "GetEvaluationResultRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationResult" - } - } - } - }, - "GetEvaluationDatasetRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationDataset" - } - } - } - }, - "GetEvaluationRunRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" - } - } - } - }, - "ListEvaluationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/Evaluation" - } - }, - "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": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "evaluationFilter": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "evaluationRunFilter": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "lastTenResults": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListEvaluationResultsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/EvaluationResult" - } - }, - "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" - } - } - } - }, - "ListEvaluationDatasetsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/EvaluationDataset" - } - }, - "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" - } - } - } - }, - "ListEvaluationRunsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/EvaluationRun" - } - }, - "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" - } - } - } - }, - "ListEvaluationsResponse": { - "fields": { - "evaluations": { - "rule": "repeated", - "type": "Evaluation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListEvaluationResultsResponse": { - "fields": { - "evaluationResults": { - "rule": "repeated", - "type": "EvaluationResult", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListEvaluationDatasetsResponse": { - "fields": { - "evaluationDatasets": { - "rule": "repeated", - "type": "EvaluationDataset", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListEvaluationRunsResponse": { - "fields": { - "evaluationRuns": { - "rule": "repeated", - "type": "EvaluationRun", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CreateScheduledEvaluationRunRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - }, - "scheduledEvaluationRunId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scheduledEvaluationRun": { - "type": "ScheduledEvaluationRun", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetScheduledEvaluationRunRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/ScheduledEvaluationRun" - } - } - } - }, - "ListScheduledEvaluationRunsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/ScheduledEvaluationRun" - } - }, - "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" - } - } - } - }, - "ListScheduledEvaluationRunsResponse": { - "fields": { - "scheduledEvaluationRuns": { - "rule": "repeated", - "type": "ScheduledEvaluationRun", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "UpdateScheduledEvaluationRunRequest": { - "fields": { - "scheduledEvaluationRun": { - "type": "ScheduledEvaluationRun", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteScheduledEvaluationRunRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/ScheduledEvaluationRun" - } - }, - "etag": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "TestPersonaVoiceRequest": { - "fields": { - "app": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - }, - "personaId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "text": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UploadEvaluationAudioRequest": { - "fields": { - "app": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - }, - "audioContent": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UploadEvaluationAudioResponse": { - "fields": { - "audioGcsUri": { - "type": "string", - "id": 1 - }, - "audioTranscript": { - "type": "string", - "id": 2 - }, - "audioDuration": { - "type": "google.protobuf.Duration", - "id": 3 - } - } - }, - "TestPersonaVoiceResponse": { - "fields": { - "audio": { - "type": "bytes", - "id": 1 - } - } - }, - "CreateEvaluationExpectationRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - }, - "evaluationExpectationId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "evaluationExpectation": { - "type": "EvaluationExpectation", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateEvaluationExpectationRequest": { - "fields": { - "evaluationExpectation": { - "type": "EvaluationExpectation", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteEvaluationExpectationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationExpectation" - } - }, - "etag": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetEvaluationExpectationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationExpectation" - } - } - } - }, - "ListEvaluationExpectationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "ces.googleapis.com/EvaluationExpectation" - } - }, - "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" - } - } - } - }, - "ListEvaluationExpectationsResponse": { - "fields": { - "evaluationExpectations": { - "rule": "repeated", - "type": "EvaluationExpectation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "Omnichannel": { - "options": { - "(google.api.resource).type": "ces.googleapis.com/Omnichannel", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/omnichannels/{omnichannel}", - "(google.api.resource).plural": "omnichannels", - "(google.api.resource).singular": "omnichannel" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "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" - } - }, - "etag": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "integrationConfig": { - "type": "OmnichannelIntegrationConfig", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "OmnichannelIntegrationConfig": { - "fields": { - "channelConfigs": { - "keyType": "string", - "type": "ChannelConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "subscriberConfigs": { - "keyType": "string", - "type": "SubscriberConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "routingConfigs": { - "keyType": "string", - "type": "RoutingConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ChannelConfig": { - "oneofs": { - "channelConfig": { - "oneof": [ - "whatsappConfig" - ] - } - }, - "fields": { - "whatsappConfig": { - "type": "WhatsappConfig", - "id": 1 - } - } - }, - "WhatsappConfig": { - "fields": { - "phoneNumberId": { - "type": "string", - "id": 1 - }, - "phoneNumber": { - "type": "string", - "id": 2 - }, - "whatsappBusinessAccountId": { - "type": "string", - "id": 3 - }, - "webhookVerifyToken": { - "type": "string", - "id": 4 - }, - "whatsappBusinessToken": { - "type": "string", - "id": 5 - }, - "metaBusinessPortfolioId": { - "type": "string", - "id": 6 - } - } - }, - "SubscriberConfig": { - "oneofs": { - "subscriberConfig": { - "oneof": [ - "cesAppConfig" - ] - } - }, - "fields": { - "cesAppConfig": { - "type": "CesAppConfig", - "id": 1 - } - } - }, - "CesAppConfig": { - "fields": { - "app": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - } - } - }, - "RoutingConfig": { - "fields": { - "subscriberKey": { - "type": "string", - "id": 1 - } - } - } - } - }, - "OmnichannelOperationMetadata": { - "fields": { - "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" - } - }, - "statusMessage": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "requestedCancellation": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "ToolService": { - "options": { - "(google.api.default_host)": "ces.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ExecuteTool": { - "requestType": "ExecuteToolRequest", - "responseType": "ExecuteToolResponse", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}:executeTool", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/apps/*}:executeTool", - "body": "*" - } - } - ] - }, - "RetrieveToolSchema": { - "requestType": "RetrieveToolSchemaRequest", - "responseType": "RetrieveToolSchemaResponse", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}:retrieveToolSchema", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/apps/*}:retrieveToolSchema", - "body": "*" - } - } - ] - }, - "RetrieveTools": { - "requestType": "RetrieveToolsRequest", - "responseType": "RetrieveToolsResponse", - "options": { - "(google.api.http).post": "/v1beta/{toolset=projects/*/locations/*/apps/*/toolsets/*}:retrieveTools", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{toolset=projects/*/locations/*/apps/*/toolsets/*}:retrieveTools", - "body": "*" - } - } - ] - } - } - }, - "ExecuteToolRequest": { - "oneofs": { - "toolIdentifier": { - "oneof": [ - "tool", - "toolsetTool" - ] - } - }, - "fields": { - "tool": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "toolsetTool": { - "type": "ToolsetTool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "parent": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - }, - "args": { - "type": "google.protobuf.Struct", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "variables": { - "type": "google.protobuf.Struct", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ExecuteToolResponse": { - "oneofs": { - "toolIdentifier": { - "oneof": [ - "tool", - "toolsetTool" - ] - } - }, - "fields": { - "tool": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "toolsetTool": { - "type": "ToolsetTool", - "id": 3 - }, - "response": { - "type": "google.protobuf.Struct", - "id": 2 - }, - "variables": { - "type": "google.protobuf.Struct", - "id": 4 - } - } - }, - "RetrieveToolSchemaRequest": { - "oneofs": { - "toolIdentifier": { - "oneof": [ - "tool", - "toolsetTool" - ] - } - }, - "fields": { - "tool": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "toolsetTool": { - "type": "ToolsetTool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "parent": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/App" - } - } - } - }, - "RetrieveToolSchemaResponse": { - "oneofs": { - "toolIdentifier": { - "oneof": [ - "tool", - "toolsetTool" - ] - } - }, - "fields": { - "tool": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "ces.googleapis.com/Tool" - } - }, - "toolsetTool": { - "type": "ToolsetTool", - "id": 2 - }, - "inputSchema": { - "type": "Schema", - "id": 3 - }, - "outputSchema": { - "type": "Schema", - "id": 4 - } - } - }, - "RetrieveToolsRequest": { - "fields": { - "toolset": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" - } - }, - "toolIds": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RetrieveToolsResponse": { - "fields": { - "tools": { - "rule": "repeated", - "type": "Tool", - "id": 1 - } - } - }, - "WidgetService": { - "options": { - "(google.api.default_host)": "ces.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "GenerateChatToken": { - "requestType": "GenerateChatTokenRequest", - "responseType": "GenerateChatTokenResponse", - "options": { - "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/apps/*/sessions/*}:generateChatToken", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{name=projects/*/locations/*/apps/*/sessions/*}:generateChatToken", - "body": "*" - } - } - ] - } - } - }, - "GenerateChatTokenRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Session" - } - }, - "deployment": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" - } - }, - "recaptchaToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GenerateChatTokenResponse": { - "fields": { - "chatToken": { - "type": "string", - "id": 1 - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "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 - } - }, - "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": { - "edition": "proto2", - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "edition": "proto2", - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10 - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11 - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - }, - "edition": { - "type": "Edition", - "id": 14 - } - } - }, - "DescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "edition": "proto2", - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - }, - "declaration": { - "rule": "repeated", - "type": "Declaration", - "id": 2, - "options": { - "retention": "RETENTION_SOURCE" - } - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "verification": { - "type": "VerificationState", - "id": 3, - "options": { - "default": "UNVERIFIED", - "retention": "RETENTION_SOURCE" - } - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "Declaration": { - "fields": { - "number": { - "type": "int32", - "id": 1 - }, - "fullName": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "reserved": { - "type": "bool", - "id": 5 - }, - "repeated": { - "type": "bool", - "id": 6 - } - }, - "reserved": [ - [ - 4, - 4 - ] - ] - }, - "VerificationState": { - "values": { - "DECLARATION": 0, - "UNVERIFIED": 1 - } - } - } - }, - "FieldDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - }, - "proto3Optional": { - "type": "bool", - "id": 17 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Label": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REPEATED": 3, - "LABEL_REQUIRED": 2 - } - } - } - }, - "OneofDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", - "id": 2 - }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "serverStreaming": { - "type": "bool", - "id": 6, - "options": { - "default": false - } - } - } - }, - "FileOptions": { - "edition": "proto2", - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "edition": "proto2", - "fields": { - "messageSetWireFormat": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "noStandardDescriptorAccessor": { - "type": "bool", - "id": 2, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "mapEntry": { - "type": "bool", - "id": 7 - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 11, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 12 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] - }, - "FieldOptions": { - "edition": "proto2", - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19 - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - } - } - }, - "OneofOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "edition": "proto2", - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 6, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 34 - }, - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } - }, - "features": { - "type": "FeatureSet", - "id": 35 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 - } - } - } - }, - "UninterpretedOption": { - "edition": "proto2", - "fields": { - "name": { - "rule": "repeated", - "type": "NamePart", - "id": 2 - }, - "identifierValue": { - "type": "string", - "id": 3 - }, - "positiveIntValue": { - "type": "uint64", - "id": 4 - }, - "negativeIntValue": { - "type": "int64", - "id": 5 - }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 - }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "FeatureSet": { - "edition": "proto2", - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - } - }, - "extensions": [ - [ - 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - } - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - } - } - }, - "FeatureSetDefaults": { - "edition": "proto2", - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "features": { - "type": "FeatureSet", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "edition": "proto2", - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2, - "options": { - "packed": true - } - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "edition": "proto2", - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Struct": { - "fields": { - "fields": { - "keyType": "string", - "type": "Value", - "id": 1 - } - } - }, - "Value": { - "oneofs": { - "kind": { - "oneof": [ - "nullValue", - "numberValue", - "stringValue", - "boolValue", - "structValue", - "listValue" - ] - } - }, - "fields": { - "nullValue": { - "type": "NullValue", - "id": 1 - }, - "numberValue": { - "type": "double", - "id": 2 - }, - "stringValue": { - "type": "string", - "id": 3 - }, - "boolValue": { - "type": "bool", - "id": 4 - }, - "structValue": { - "type": "Struct", - "id": 5 - }, - "listValue": { - "type": "ListValue", - "id": 6 - } - } - }, - "NullValue": { - "values": { - "NULL_VALUE": 0 - } - }, - "ListValue": { - "fields": { - "values": { - "rule": "repeated", - "type": "Value", - "id": 1 - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - } - } - }, - "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-ces/samples/generated/v1/agent_service.batch_delete_conversations.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.batch_delete_conversations.js deleted file mode 100644 index 011d8c91463..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.batch_delete_conversations.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, conversations) { - // [START ces_v1_generated_AgentService_BatchDeleteConversations_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app to delete conversations from. - * Format: - * `projects/{project}/locations/{location}/apps/{app}` - */ - // const parent = 'abc123' - /** - * Required. The resource names of the conversations to delete. - */ - // const conversations = ['abc','def'] - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callBatchDeleteConversations() { - // Construct request - const request = { - parent, - conversations, - }; - - // Run request - const [operation] = await cesClient.batchDeleteConversations(request); - const [response] = await operation.promise(); - console.log(response); - } - - callBatchDeleteConversations(); - // [END ces_v1_generated_AgentService_BatchDeleteConversations_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_agent.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_agent.js deleted file mode 100644 index 21c3c1315cb..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_agent.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, agent) { - // [START ces_v1_generated_AgentService_CreateAgent_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app to create an agent in. - */ - // const parent = 'abc123' - /** - * Optional. The ID to use for the agent, which will become the final - * component of the agent's resource name. If not provided, a unique ID will - * be automatically assigned for the agent. - */ - // const agentId = 'abc123' - /** - * Required. The agent to create. - */ - // const agent = {} - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callCreateAgent() { - // Construct request - const request = { - parent, - agent, - }; - - // Run request - const response = await cesClient.createAgent(request); - console.log(response); - } - - callCreateAgent(); - // [END ces_v1_generated_AgentService_CreateAgent_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_app.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_app.js deleted file mode 100644 index 2614161d04f..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_app.js +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, app) { - // [START ces_v1_generated_AgentService_CreateApp_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the location to create an app in. - */ - // const parent = 'abc123' - /** - * Optional. The ID to use for the app, which will become the final component - * of the app's resource name. If not provided, a unique ID will be - * automatically assigned for the app. - */ - // const appId = 'abc123' - /** - * Required. The app to create. - */ - // const app = {} - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callCreateApp() { - // Construct request - const request = { - parent, - app, - }; - - // Run request - const [operation] = await cesClient.createApp(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateApp(); - // [END ces_v1_generated_AgentService_CreateApp_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_app_version.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_app_version.js deleted file mode 100644 index de9ec753d41..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_app_version.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, appVersion) { - // [START ces_v1_generated_AgentService_CreateAppVersion_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app to create an app version in. - */ - // const parent = 'abc123' - /** - * Optional. The ID to use for the app version, which will become the final - * component of the app version's resource name. If not provided, a unique ID - * will be automatically assigned for the app version. - */ - // const appVersionId = 'abc123' - /** - * Required. The app version to create. - */ - // const appVersion = {} - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callCreateAppVersion() { - // Construct request - const request = { - parent, - appVersion, - }; - - // Run request - const response = await cesClient.createAppVersion(request); - console.log(response); - } - - callCreateAppVersion(); - // [END ces_v1_generated_AgentService_CreateAppVersion_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_deployment.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_deployment.js deleted file mode 100644 index 5151ccda4a7..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_deployment.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, deployment) { - // [START ces_v1_generated_AgentService_CreateDeployment_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will 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 parent app. - * Format: - * `projects/{project}/locations/{location}/apps/{app}` - */ - // const parent = 'abc123' - /** - * Optional. The ID to use for the deployment, which will become the final - * component of the deployment's resource name. If not provided, a unique ID - * will be automatically assigned for the deployment. - */ - // const deploymentId = 'abc123' - /** - * Required. The deployment to create. - */ - // const deployment = {} - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callCreateDeployment() { - // Construct request - const request = { - parent, - deployment, - }; - - // Run request - const response = await cesClient.createDeployment(request); - console.log(response); - } - - callCreateDeployment(); - // [END ces_v1_generated_AgentService_CreateDeployment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_example.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_example.js deleted file mode 100644 index c093a8166ec..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_example.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, example) { - // [START ces_v1_generated_AgentService_CreateExample_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app to create an example in. - */ - // const parent = 'abc123' - /** - * Optional. The ID to use for the example, which will become the final - * component of the example's resource name. If not provided, a unique ID will - * be automatically assigned for the example. - */ - // const exampleId = 'abc123' - /** - * Required. The example to create. - */ - // const example = {} - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callCreateExample() { - // Construct request - const request = { - parent, - example, - }; - - // Run request - const response = await cesClient.createExample(request); - console.log(response); - } - - callCreateExample(); - // [END ces_v1_generated_AgentService_CreateExample_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_guardrail.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_guardrail.js deleted file mode 100644 index d5f598a9c8c..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_guardrail.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, guardrail) { - // [START ces_v1_generated_AgentService_CreateGuardrail_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app to create a guardrail in. - */ - // const parent = 'abc123' - /** - * Optional. The ID to use for the guardrail, which will become the final - * component of the guardrail's resource name. If not provided, a unique ID - * will be automatically assigned for the guardrail. - */ - // const guardrailId = 'abc123' - /** - * Required. The guardrail to create. - */ - // const guardrail = {} - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callCreateGuardrail() { - // Construct request - const request = { - parent, - guardrail, - }; - - // Run request - const response = await cesClient.createGuardrail(request); - console.log(response); - } - - callCreateGuardrail(); - // [END ces_v1_generated_AgentService_CreateGuardrail_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_tool.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_tool.js deleted file mode 100644 index 597d9ce5520..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_tool.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, tool) { - // [START ces_v1_generated_AgentService_CreateTool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app to create a tool in. - */ - // const parent = 'abc123' - /** - * Optional. The ID to use for the tool, which will become the final component - * of the tool's resource name. If not provided, a unique ID will be - * automatically assigned for the tool. - */ - // const toolId = 'abc123' - /** - * Required. The tool to create. - */ - // const tool = {} - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callCreateTool() { - // Construct request - const request = { - parent, - tool, - }; - - // Run request - const response = await cesClient.createTool(request); - console.log(response); - } - - callCreateTool(); - // [END ces_v1_generated_AgentService_CreateTool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_toolset.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_toolset.js deleted file mode 100644 index c1fe783e94c..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.create_toolset.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, toolset) { - // [START ces_v1_generated_AgentService_CreateToolset_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app to create a toolset in. - */ - // const parent = 'abc123' - /** - * Optional. The ID to use for the toolset, which will become the final - * component of the toolset's resource name. If not provided, a unique ID will - * be automatically assigned for the toolset. - */ - // const toolsetId = 'abc123' - /** - * Required. The toolset to create. - */ - // const toolset = {} - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callCreateToolset() { - // Construct request - const request = { - parent, - toolset, - }; - - // Run request - const response = await cesClient.createToolset(request); - console.log(response); - } - - callCreateToolset(); - // [END ces_v1_generated_AgentService_CreateToolset_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_agent.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_agent.js deleted file mode 100644 index 351174cd7df..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_agent.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_DeleteAgent_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the agent to delete. - */ - // const name = 'abc123' - /** - * Optional. Indicates whether to forcefully delete the agent, even if it is - * still referenced by other app/agents/examples. - * * If `force = false`, the deletion fails if other agents/examples - * reference it. - * * If `force = true`, delete the agent and remove it from all referencing - * apps/agents/examples. - */ - // const force = true - /** - * Optional. The current etag of the agent. If an etag is not provided, the - * deletion will overwrite any concurrent changes. If an etag is provided and - * does not match the current etag of the agent, deletion will be blocked and - * an ABORTED error will be returned. - */ - // const etag = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callDeleteAgent() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await cesClient.deleteAgent(request); - console.log(response); - } - - callDeleteAgent(); - // [END ces_v1_generated_AgentService_DeleteAgent_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_app.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_app.js deleted file mode 100644 index c92a148c87f..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_app.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_DeleteApp_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app to delete. - */ - // const name = 'abc123' - /** - * Optional. The current etag of the app. If an etag is not provided, the - * deletion will overwrite any concurrent changes. If an etag is provided and - * does not match the current etag of the app, deletion will be blocked and an - * ABORTED error will be returned. - */ - // const etag = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callDeleteApp() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await cesClient.deleteApp(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteApp(); - // [END ces_v1_generated_AgentService_DeleteApp_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_app_version.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_app_version.js deleted file mode 100644 index 3b9918adbbd..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_app_version.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_DeleteAppVersion_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app version to delete. - */ - // const name = 'abc123' - /** - * Optional. The current etag of the app version. If an etag is not provided, - * the deletion will overwrite any concurrent changes. If an etag is provided - * and does not match the current etag of the app version, deletion will be - * blocked and an ABORTED error will be returned. - */ - // const etag = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callDeleteAppVersion() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await cesClient.deleteAppVersion(request); - console.log(response); - } - - callDeleteAppVersion(); - // [END ces_v1_generated_AgentService_DeleteAppVersion_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_conversation.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_conversation.js deleted file mode 100644 index 827e993176b..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_conversation.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_DeleteConversation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the conversation to delete. - */ - // const name = 'abc123' - /** - * Optional. Indicate the source of the conversation. If not set, Source.Live - * will be applied by default. - */ - // const source = {} - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callDeleteConversation() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await cesClient.deleteConversation(request); - console.log(response); - } - - callDeleteConversation(); - // [END ces_v1_generated_AgentService_DeleteConversation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_deployment.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_deployment.js deleted file mode 100644 index 8c90895149b..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_deployment.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_DeleteDeployment_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will 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 deployment to delete. - * Format: - * `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` - */ - // const name = 'abc123' - /** - * Optional. The etag of the deployment. - * If an etag is provided and does not match the current etag of the - * deployment, deletion will be blocked and an ABORTED error will be returned. - */ - // const etag = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callDeleteDeployment() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await cesClient.deleteDeployment(request); - console.log(response); - } - - callDeleteDeployment(); - // [END ces_v1_generated_AgentService_DeleteDeployment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_example.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_example.js deleted file mode 100644 index 56d198130ab..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_example.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_DeleteExample_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the example to delete. - */ - // const name = 'abc123' - /** - * Optional. The current etag of the example. If an etag is not provided, the - * deletion will overwrite any concurrent changes. If an etag is provided and - * does not match the current etag of the example, deletion will be blocked - * and an ABORTED error will be returned. - */ - // const etag = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callDeleteExample() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await cesClient.deleteExample(request); - console.log(response); - } - - callDeleteExample(); - // [END ces_v1_generated_AgentService_DeleteExample_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_guardrail.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_guardrail.js deleted file mode 100644 index 5d36e33cc4e..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_guardrail.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_DeleteGuardrail_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the guardrail to delete. - */ - // const name = 'abc123' - /** - * Optional. Indicates whether to forcefully delete the guardrail, even if it - * is still referenced by app/agents. - * * If `force = false`, the deletion fails if any apps/agents still - * reference the guardrail. - * * If `force = true`, all existing references from apps/agents will be - * removed and the guardrail will be deleted. - */ - // const force = true - /** - * Optional. The current etag of the guardrail. If an etag is not provided, - * the deletion will overwrite any concurrent changes. If an etag is provided - * and does not match the current etag of the guardrail, deletion will be - * blocked and an ABORTED error will be returned. - */ - // const etag = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callDeleteGuardrail() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await cesClient.deleteGuardrail(request); - console.log(response); - } - - callDeleteGuardrail(); - // [END ces_v1_generated_AgentService_DeleteGuardrail_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_tool.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_tool.js deleted file mode 100644 index db738c047f4..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_tool.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_DeleteTool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the tool to delete. - */ - // const name = 'abc123' - /** - * Optional. Indicates whether to forcefully delete the tool, even if it is - * still referenced by agents/examples. - * * If `force = false`, the deletion will fail if any agents still - * reference the tool. - * * If `force = true`, all existing references from agents will be removed - * and the tool will be deleted. - */ - // const force = true - /** - * Optional. The current etag of the tool. If an etag is not provided, the - * deletion will overwrite any concurrent changes. If an etag is provided and - * does not match the current etag of the tool, deletion will be blocked and - * an ABORTED error will be returned. - */ - // const etag = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callDeleteTool() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await cesClient.deleteTool(request); - console.log(response); - } - - callDeleteTool(); - // [END ces_v1_generated_AgentService_DeleteTool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_toolset.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_toolset.js deleted file mode 100644 index 1204169576f..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.delete_toolset.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_DeleteToolset_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the toolset to delete. - */ - // const name = 'abc123' - /** - * Optional. Indicates whether to forcefully delete the toolset, even if it is - * still referenced by app/agents. - * * If `force = false`, the deletion fails if any agents still - * reference the toolset. - * * If `force = true`, all existing references from agents will be - * removed and the toolset will be deleted. - */ - // const force = true - /** - * Optional. The current etag of the toolset. If an etag is not provided, the - * deletion will overwrite any concurrent changes. If an etag is provided and - * does not match the current etag of the toolset, deletion will be blocked - * and an ABORTED error will be returned. - */ - // const etag = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callDeleteToolset() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await cesClient.deleteToolset(request); - console.log(response); - } - - callDeleteToolset(); - // [END ces_v1_generated_AgentService_DeleteToolset_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.export_app.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.export_app.js deleted file mode 100644 index 8a2db578f8c..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.export_app.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, exportFormat) { - // [START ces_v1_generated_AgentService_ExportApp_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app to export. - */ - // const name = 'abc123' - /** - * Required. The format to export the app in. - */ - // const exportFormat = {} - /** - * Optional. The Google Cloud - * Storage (https://cloud.google.com/storage/docs/) URI to which to export the - * app. The format of this URI must be `gs:///`. The - * exported app archive will be written directly to the specified GCS object. - */ - // const gcsUri = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callExportApp() { - // Construct request - const request = { - name, - exportFormat, - }; - - // Run request - const [operation] = await cesClient.exportApp(request); - const [response] = await operation.promise(); - console.log(response); - } - - callExportApp(); - // [END ces_v1_generated_AgentService_ExportApp_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_agent.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_agent.js deleted file mode 100644 index 87cc02d7d0a..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_agent.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_GetAgent_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the agent to retrieve. - */ - // const name = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callGetAgent() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await cesClient.getAgent(request); - console.log(response); - } - - callGetAgent(); - // [END ces_v1_generated_AgentService_GetAgent_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_app.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_app.js deleted file mode 100644 index 6767ac16059..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_app.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_GetApp_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app to retrieve. - */ - // const name = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callGetApp() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await cesClient.getApp(request); - console.log(response); - } - - callGetApp(); - // [END ces_v1_generated_AgentService_GetApp_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_app_version.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_app_version.js deleted file mode 100644 index 61170d3bb64..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_app_version.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_GetAppVersion_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app version to retrieve. - */ - // const name = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callGetAppVersion() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await cesClient.getAppVersion(request); - console.log(response); - } - - callGetAppVersion(); - // [END ces_v1_generated_AgentService_GetAppVersion_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_changelog.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_changelog.js deleted file mode 100644 index d38efa4eeff..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_changelog.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_GetChangelog_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the changelog to retrieve. - */ - // const name = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callGetChangelog() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await cesClient.getChangelog(request); - console.log(response); - } - - callGetChangelog(); - // [END ces_v1_generated_AgentService_GetChangelog_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_conversation.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_conversation.js deleted file mode 100644 index 8e502fa889e..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_conversation.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_GetConversation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the conversation to retrieve. - */ - // const name = 'abc123' - /** - * Optional. Indicate the source of the conversation. If not set, all source - * will be searched. - */ - // const source = {} - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callGetConversation() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await cesClient.getConversation(request); - console.log(response); - } - - callGetConversation(); - // [END ces_v1_generated_AgentService_GetConversation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_deployment.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_deployment.js deleted file mode 100644 index 9f993c7ce65..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_deployment.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_GetDeployment_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will 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 deployment. - * Format: - * `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` - */ - // const name = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callGetDeployment() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await cesClient.getDeployment(request); - console.log(response); - } - - callGetDeployment(); - // [END ces_v1_generated_AgentService_GetDeployment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_example.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_example.js deleted file mode 100644 index 1856898ef68..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_example.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_GetExample_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the example to retrieve. - */ - // const name = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callGetExample() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await cesClient.getExample(request); - console.log(response); - } - - callGetExample(); - // [END ces_v1_generated_AgentService_GetExample_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_guardrail.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_guardrail.js deleted file mode 100644 index b08309ea583..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_guardrail.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_GetGuardrail_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the guardrail to retrieve. - */ - // const name = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callGetGuardrail() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await cesClient.getGuardrail(request); - console.log(response); - } - - callGetGuardrail(); - // [END ces_v1_generated_AgentService_GetGuardrail_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_tool.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_tool.js deleted file mode 100644 index 80dc2f0c2c4..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_tool.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_GetTool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the tool to retrieve. - */ - // const name = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callGetTool() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await cesClient.getTool(request); - console.log(response); - } - - callGetTool(); - // [END ces_v1_generated_AgentService_GetTool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_toolset.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_toolset.js deleted file mode 100644 index 945c20b3838..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.get_toolset.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_GetToolset_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the toolset to retrieve. - */ - // const name = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callGetToolset() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await cesClient.getToolset(request); - console.log(response); - } - - callGetToolset(); - // [END ces_v1_generated_AgentService_GetToolset_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.import_app.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.import_app.js deleted file mode 100644 index 00bb31645ae..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.import_app.js +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START ces_v1_generated_AgentService_ImportApp_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The Google Cloud Storage (https://cloud.google.com/storage/docs/) URI - * from which to import app. The format of this URI must be - * `gs:///`. - */ - // const gcsUri = 'abc123' - /** - * Raw bytes representing the compressed zip file with the app folder - * structure. - */ - // const appContent = Buffer.from('string') - /** - * Required. The parent resource name with the location of the app to import. - */ - // const parent = 'abc123' - /** - * Optional. The display name of the app to import. - * * If the app is created on import, and the display name is specified, - * the imported app will use this display name. If a conflict is detected - * with an existing app, a timestamp will be appended to the display name - * to make it unique. - * * If the app is a reimport, this field should not be set. Providing a - * display name during reimport will result in an INVALID_ARGUMENT error. - */ - // const displayName = 'abc123' - /** - * Optional. The ID to use for the imported app. - * * If not specified, a unique ID will be automatically assigned for - * the app. - * * Otherwise, the imported app will use this ID as the final component of - * its resource name. If an app with the same ID already exists at the - * specified location in the project, the content of the existing app will be - * replaced. - */ - // const appId = 'abc123' - /** - * Optional. Options governing the import process for the app. - */ - // const importOptions = {} - /** - * Optional. Flag for overriding the app lock during import. - * If set to true, the import process will ignore the app lock. - */ - // const ignoreAppLock = true - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callImportApp() { - // Construct request - const request = { - parent, - }; - - // Run request - const [operation] = await cesClient.importApp(request); - const [response] = await operation.promise(); - console.log(response); - } - - callImportApp(); - // [END ces_v1_generated_AgentService_ImportApp_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_agents.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_agents.js deleted file mode 100644 index 631134f46cb..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_agents.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START ces_v1_generated_AgentService_ListAgents_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app to list agents from. - */ - // 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. The - * next_page_token google.cloud.ces.v1.ListAgentsResponse.next_page_token - * value returned from a previous list - * AgentService.ListAgents google.cloud.ces.v1.AgentService.ListAgents - * call. - */ - // const pageToken = 'abc123' - /** - * Optional. Filter to be applied when listing the agents. - * See https://google.aip.dev/160 for more details. - */ - // const filter = 'abc123' - /** - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - */ - // const orderBy = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callListAgents() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = cesClient.listAgentsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAgents(); - // [END ces_v1_generated_AgentService_ListAgents_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_app_versions.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_app_versions.js deleted file mode 100644 index 0ccdbab2955..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_app_versions.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START ces_v1_generated_AgentService_ListAppVersions_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app to list app versions from. - */ - // 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. The - * next_page_token google.cloud.ces.v1.ListAppVersionsResponse.next_page_token - * value returned from a previous list - * AgentService.ListAppVersions google.cloud.ces.v1.AgentService.ListAppVersions - * call. - */ - // const pageToken = 'abc123' - /** - * Optional. Filter to be applied when listing the app versions. - * See https://google.aip.dev/160 for more details. - */ - // const filter = 'abc123' - /** - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - */ - // const orderBy = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callListAppVersions() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = cesClient.listAppVersionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAppVersions(); - // [END ces_v1_generated_AgentService_ListAppVersions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_apps.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_apps.js deleted file mode 100644 index 33b3b60360c..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_apps.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START ces_v1_generated_AgentService_ListApps_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the location to list apps from. - */ - // 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. The - * next_page_token google.cloud.ces.v1.ListAppsResponse.next_page_token - * value returned from a previous list - * AgentService.ListApps google.cloud.ces.v1.AgentService.ListApps call. - */ - // const pageToken = 'abc123' - /** - * Optional. Filter to be applied when listing the apps. - * See https://google.aip.dev/160 for more details. - */ - // const filter = 'abc123' - /** - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - */ - // const orderBy = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callListApps() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = cesClient.listAppsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListApps(); - // [END ces_v1_generated_AgentService_ListApps_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_changelogs.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_changelogs.js deleted file mode 100644 index 311eab3ac25..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_changelogs.js +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START ces_v1_generated_AgentService_ListChangelogs_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app to list changelogs from. - */ - // 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. The - * next_page_token google.cloud.ces.v1.ListChangelogsResponse.next_page_token - * value returned from a previous list - * AgentService.ListChangelogs google.cloud.ces.v1.AgentService.ListChangelogs - * call. - */ - // const pageToken = 'abc123' - /** - * Optional. Filter to be applied when listing the changelogs. - * See https://google.aip.dev/160 for more details. - * The filter string can be used to filter by `action`, `resource_type`, - * `resource_name`, `author`, and `create_time`. - * The `:` comparator can be used for case-insensitive partial matching on - * string fields, while `=` performs an exact case-sensitive match. - * Examples: - * * `action:update` (case-insensitive partial match) - * * `action="Create"` (case-sensitive exact match) - * * `resource_type:agent` - * * `resource_name:my-agent` - * * `author:me@example.com` - * * `create_time > "2025-01-01T00:00:00Z"` - * * `create_time <= "2025-01-01T00:00:00Z" AND resource_type:tool` - */ - // const filter = 'abc123' - /** - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - */ - // const orderBy = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callListChangelogs() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = cesClient.listChangelogsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListChangelogs(); - // [END ces_v1_generated_AgentService_ListChangelogs_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_conversations.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_conversations.js deleted file mode 100644 index 9267c18b2c5..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_conversations.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START ces_v1_generated_AgentService_ListConversations_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app to list conversations from. - */ - // 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. The - * next_page_token google.cloud.ces.v1.ListConversationsResponse.next_page_token - * value returned from a previous list - * AgentService.ListConversations google.cloud.ces.v1.AgentService.ListConversations - * call. - */ - // const pageToken = 'abc123' - /** - * Optional. Filter to be applied when listing the conversations. - * See https://google.aip.dev/160 for more details. - */ - // const filter = 'abc123' - /** - * Optional. Indicate the source of the conversation. If not set, Source.Live - * will be applied by default. Will be deprecated in favor of `sources` field. - */ - // const source = {} - /** - * Optional. Indicate the sources of the conversations. If not set, all - * available sources will be applied by default. - */ - // const sources = [1,2,3,4] - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callListConversations() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = cesClient.listConversationsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListConversations(); - // [END ces_v1_generated_AgentService_ListConversations_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_deployments.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_deployments.js deleted file mode 100644 index bf9a075b0e8..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_deployments.js +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START ces_v1_generated_AgentService_ListDeployments_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will 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 parent app. - * Format: - * `projects/{project}/locations/{location}/apps/{app}` - */ - // const parent = 'abc123' - /** - * Optional. The maximum number of deployments to return. The service may - * return fewer than this value. If unspecified, at most 50 deployments will - * be returned. The maximum value is 1000; values above 1000 will be coerced - * to 1000. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous `ListDeployments` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListDeployments` must - * match the call that provided the page token. - */ - // const pageToken = 'abc123' - /** - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - */ - // const orderBy = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callListDeployments() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = cesClient.listDeploymentsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListDeployments(); - // [END ces_v1_generated_AgentService_ListDeployments_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_examples.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_examples.js deleted file mode 100644 index 4dee4c99462..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_examples.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START ces_v1_generated_AgentService_ListExamples_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app to list examples from. - */ - // 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. The - * next_page_token google.cloud.ces.v1.ListExamplesResponse.next_page_token - * value returned from a previous list - * AgentService.ListExamples google.cloud.ces.v1.AgentService.ListExamples - * call. - */ - // const pageToken = 'abc123' - /** - * Optional. Filter to be applied when listing the examples. - * See https://google.aip.dev/160 for more details. - */ - // const filter = 'abc123' - /** - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - */ - // const orderBy = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callListExamples() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = cesClient.listExamplesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListExamples(); - // [END ces_v1_generated_AgentService_ListExamples_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_guardrails.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_guardrails.js deleted file mode 100644 index a0d5bb9f4ba..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_guardrails.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START ces_v1_generated_AgentService_ListGuardrails_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app to list guardrails from. - */ - // 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. The - * next_page_token google.cloud.ces.v1.ListGuardrailsResponse.next_page_token - * value returned from a previous list - * AgentService.ListGuardrails google.cloud.ces.v1.AgentService.ListGuardrails - * call. - */ - // const pageToken = 'abc123' - /** - * Optional. Filter to be applied when listing the guardrails. - * See https://google.aip.dev/160 for more details. - */ - // const filter = 'abc123' - /** - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - */ - // const orderBy = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callListGuardrails() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = cesClient.listGuardrailsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListGuardrails(); - // [END ces_v1_generated_AgentService_ListGuardrails_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_tools.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_tools.js deleted file mode 100644 index 4198b671859..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_tools.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START ces_v1_generated_AgentService_ListTools_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app to list tools from. - */ - // 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. The - * next_page_token google.cloud.ces.v1.ListToolsResponse.next_page_token - * value returned from a previous list - * AgentService.ListTools google.cloud.ces.v1.AgentService.ListTools call. - */ - // const pageToken = 'abc123' - /** - * Optional. Filter to be applied when listing the tools. Use - * "include_system_tools=true" to include system tools in the response. See - * https://google.aip.dev/160 for more details. - */ - // const filter = 'abc123' - /** - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - */ - // const orderBy = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callListTools() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = cesClient.listToolsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListTools(); - // [END ces_v1_generated_AgentService_ListTools_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_toolsets.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_toolsets.js deleted file mode 100644 index 728f2117e93..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.list_toolsets.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START ces_v1_generated_AgentService_ListToolsets_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app to list toolsets from. - */ - // 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. The - * next_page_token google.cloud.ces.v1.ListToolsetsResponse.next_page_token - * value returned from a previous list - * AgentService.ListToolsets google.cloud.ces.v1.AgentService.ListToolsets - * call. - */ - // const pageToken = 'abc123' - /** - * Optional. Filter to be applied when listing the toolsets. - * See https://google.aip.dev/160 for more details. - */ - // const filter = 'abc123' - /** - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - */ - // const orderBy = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callListToolsets() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = cesClient.listToolsetsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListToolsets(); - // [END ces_v1_generated_AgentService_ListToolsets_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.restore_app_version.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.restore_app_version.js deleted file mode 100644 index 0f81205829a..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.restore_app_version.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START ces_v1_generated_AgentService_RestoreAppVersion_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the app version to restore. - */ - // const name = 'abc123' - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callRestoreAppVersion() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await cesClient.restoreAppVersion(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRestoreAppVersion(); - // [END ces_v1_generated_AgentService_RestoreAppVersion_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_agent.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_agent.js deleted file mode 100644 index f4c77701a8e..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_agent.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(agent) { - // [START ces_v1_generated_AgentService_UpdateAgent_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will 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 agent to update. - */ - // const agent = {} - /** - * Optional. Field mask is used to control which fields get updated. If the - * mask is not present, all fields will be updated. - */ - // const updateMask = {} - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callUpdateAgent() { - // Construct request - const request = { - agent, - }; - - // Run request - const response = await cesClient.updateAgent(request); - console.log(response); - } - - callUpdateAgent(); - // [END ces_v1_generated_AgentService_UpdateAgent_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_app.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_app.js deleted file mode 100644 index 9143030d6ed..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_app.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(app) { - // [START ces_v1_generated_AgentService_UpdateApp_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will 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 app to update. - */ - // const app = {} - /** - * Optional. Field mask is used to control which fields get updated. If the - * mask is not present, all fields will be updated. - */ - // const updateMask = {} - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callUpdateApp() { - // Construct request - const request = { - app, - }; - - // Run request - const response = await cesClient.updateApp(request); - console.log(response); - } - - callUpdateApp(); - // [END ces_v1_generated_AgentService_UpdateApp_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_deployment.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_deployment.js deleted file mode 100644 index b289fda2cf6..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_deployment.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(deployment) { - // [START ces_v1_generated_AgentService_UpdateDeployment_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will 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 deployment to update. - */ - // const deployment = {} - /** - * Optional. The list of fields to update. - */ - // const updateMask = {} - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callUpdateDeployment() { - // Construct request - const request = { - deployment, - }; - - // Run request - const response = await cesClient.updateDeployment(request); - console.log(response); - } - - callUpdateDeployment(); - // [END ces_v1_generated_AgentService_UpdateDeployment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_example.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_example.js deleted file mode 100644 index 4441122eaf4..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_example.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(example) { - // [START ces_v1_generated_AgentService_UpdateExample_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will 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 example to update. - */ - // const example = {} - /** - * Optional. Field mask is used to control which fields get updated. If the - * mask is not present, all fields will be updated. - */ - // const updateMask = {} - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callUpdateExample() { - // Construct request - const request = { - example, - }; - - // Run request - const response = await cesClient.updateExample(request); - console.log(response); - } - - callUpdateExample(); - // [END ces_v1_generated_AgentService_UpdateExample_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_guardrail.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_guardrail.js deleted file mode 100644 index 9d41d7d403d..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_guardrail.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(guardrail) { - // [START ces_v1_generated_AgentService_UpdateGuardrail_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will 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 guardrail to update. - */ - // const guardrail = {} - /** - * Optional. Field mask is used to control which fields get updated. If the - * mask is not present, all fields will be updated. - */ - // const updateMask = {} - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callUpdateGuardrail() { - // Construct request - const request = { - guardrail, - }; - - // Run request - const response = await cesClient.updateGuardrail(request); - console.log(response); - } - - callUpdateGuardrail(); - // [END ces_v1_generated_AgentService_UpdateGuardrail_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_tool.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_tool.js deleted file mode 100644 index 46152b20751..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_tool.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(tool) { - // [START ces_v1_generated_AgentService_UpdateTool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will 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 tool to update. - */ - // const tool = {} - /** - * Optional. Field mask is used to control which fields get updated. If the - * mask is not present, all fields will be updated. - */ - // const updateMask = {} - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callUpdateTool() { - // Construct request - const request = { - tool, - }; - - // Run request - const response = await cesClient.updateTool(request); - console.log(response); - } - - callUpdateTool(); - // [END ces_v1_generated_AgentService_UpdateTool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_toolset.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_toolset.js deleted file mode 100644 index b1dba2bbddd..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/agent_service.update_toolset.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(toolset) { - // [START ces_v1_generated_AgentService_UpdateToolset_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will 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 toolset to update. - */ - // const toolset = {} - /** - * Optional. Field mask is used to control which fields get updated. If the - * mask is not present, all fields will be updated. - */ - // const updateMask = {} - - // Imports the Ces library - const {AgentServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new AgentServiceClient(); - - async function callUpdateToolset() { - // Construct request - const request = { - toolset, - }; - - // Run request - const response = await cesClient.updateToolset(request); - console.log(response); - } - - callUpdateToolset(); - // [END ces_v1_generated_AgentService_UpdateToolset_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/session_service.bidi_run_session.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/session_service.bidi_run_session.js deleted file mode 100644 index 1c989079045..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/session_service.bidi_run_session.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START ces_v1_generated_SessionService_BidiRunSession_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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 initial config message for the session. - */ - // const config = {} - /** - * Optional. Realtime input for the session. - */ - // const realtimeInput = {} - - // Imports the Ces library - const {SessionServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new SessionServiceClient(); - - async function callBidiRunSession() { - // Construct request - const request = { - }; - - // Run request - const stream = await cesClient.bidiRunSession(); - stream.on('data', (response) => { console.log(response) }); - stream.on('error', (err) => { throw(err) }); - stream.on('end', () => { /* API call completed */ }); - stream.write(request); - stream.end(); - } - - callBidiRunSession(); - // [END ces_v1_generated_SessionService_BidiRunSession_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/session_service.run_session.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/session_service.run_session.js deleted file mode 100644 index ff2ec5894a4..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/session_service.run_session.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(config, inputs) { - // [START ces_v1_generated_SessionService_RunSession_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will 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 configuration for the session. - */ - // const config = {} - /** - * Required. Inputs for the session. - */ - // const inputs = [1,2,3,4] - - // Imports the Ces library - const {SessionServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new SessionServiceClient(); - - async function callRunSession() { - // Construct request - const request = { - config, - inputs, - }; - - // Run request - const response = await cesClient.runSession(request); - console.log(response); - } - - callRunSession(); - // [END ces_v1_generated_SessionService_RunSession_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/snippet_metadata_google.cloud.ces.v1.json b/owl-bot-staging/google-cloud-ces/samples/generated/v1/snippet_metadata_google.cloud.ces.v1.json deleted file mode 100644 index f42ad2854a7..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/snippet_metadata_google.cloud.ces.v1.json +++ /dev/null @@ -1,2559 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-ces", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.ces.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "ces_v1_generated_AgentService_ListApps_async", - "title": "AgentService listApps Sample", - "origin": "API_DEFINITION", - "description": " Lists apps in the given project and location.", - "canonical": true, - "file": "agent_service.list_apps.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListApps", - "fullName": "google.cloud.ces.v1.AgentService.ListApps", - "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.ces.v1.ListAppsResponse", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "ListApps", - "fullName": "google.cloud.ces.v1.AgentService.ListApps", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_GetApp_async", - "title": "AgentService getApp Sample", - "origin": "API_DEFINITION", - "description": " Gets details of the specified app.", - "canonical": true, - "file": "agent_service.get_app.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetApp", - "fullName": "google.cloud.ces.v1.AgentService.GetApp", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.ces.v1.App", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "GetApp", - "fullName": "google.cloud.ces.v1.AgentService.GetApp", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_CreateApp_async", - "title": "AgentService createApp Sample", - "origin": "API_DEFINITION", - "description": " Creates a new app in the given project and location.", - "canonical": true, - "file": "agent_service.create_app.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateApp", - "fullName": "google.cloud.ces.v1.AgentService.CreateApp", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "app_id", - "type": "TYPE_STRING" - }, - { - "name": "app", - "type": ".google.cloud.ces.v1.App" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "CreateApp", - "fullName": "google.cloud.ces.v1.AgentService.CreateApp", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_UpdateApp_async", - "title": "AgentService updateApp Sample", - "origin": "API_DEFINITION", - "description": " Updates the specified app.", - "canonical": true, - "file": "agent_service.update_app.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateApp", - "fullName": "google.cloud.ces.v1.AgentService.UpdateApp", - "async": true, - "parameters": [ - { - "name": "app", - "type": ".google.cloud.ces.v1.App" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.ces.v1.App", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "UpdateApp", - "fullName": "google.cloud.ces.v1.AgentService.UpdateApp", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_DeleteApp_async", - "title": "AgentService deleteApp Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified app.", - "canonical": true, - "file": "agent_service.delete_app.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteApp", - "fullName": "google.cloud.ces.v1.AgentService.DeleteApp", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "DeleteApp", - "fullName": "google.cloud.ces.v1.AgentService.DeleteApp", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_ExportApp_async", - "title": "AgentService exportApp Sample", - "origin": "API_DEFINITION", - "description": " Exports the specified app.", - "canonical": true, - "file": "agent_service.export_app.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ExportApp", - "fullName": "google.cloud.ces.v1.AgentService.ExportApp", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "export_format", - "type": ".google.cloud.ces.v1.ExportAppRequest.ExportFormat" - }, - { - "name": "gcs_uri", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "ExportApp", - "fullName": "google.cloud.ces.v1.AgentService.ExportApp", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_ImportApp_async", - "title": "AgentService importApp Sample", - "origin": "API_DEFINITION", - "description": " Imports the specified app.", - "canonical": true, - "file": "agent_service.import_app.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 94, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ImportApp", - "fullName": "google.cloud.ces.v1.AgentService.ImportApp", - "async": true, - "parameters": [ - { - "name": "gcs_uri", - "type": "TYPE_STRING" - }, - { - "name": "app_content", - "type": "TYPE_BYTES" - }, - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "display_name", - "type": "TYPE_STRING" - }, - { - "name": "app_id", - "type": "TYPE_STRING" - }, - { - "name": "import_options", - "type": ".google.cloud.ces.v1.ImportAppRequest.ImportOptions" - }, - { - "name": "ignore_app_lock", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "ImportApp", - "fullName": "google.cloud.ces.v1.AgentService.ImportApp", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_ListAgents_async", - "title": "AgentService listAgents Sample", - "origin": "API_DEFINITION", - "description": " Lists agents in the given app.", - "canonical": true, - "file": "agent_service.list_agents.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 78, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAgents", - "fullName": "google.cloud.ces.v1.AgentService.ListAgents", - "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.ces.v1.ListAgentsResponse", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "ListAgents", - "fullName": "google.cloud.ces.v1.AgentService.ListAgents", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_GetAgent_async", - "title": "AgentService getAgent Sample", - "origin": "API_DEFINITION", - "description": " Gets details of the specified agent.", - "canonical": true, - "file": "agent_service.get_agent.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetAgent", - "fullName": "google.cloud.ces.v1.AgentService.GetAgent", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.ces.v1.Agent", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "GetAgent", - "fullName": "google.cloud.ces.v1.AgentService.GetAgent", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_CreateAgent_async", - "title": "AgentService createAgent Sample", - "origin": "API_DEFINITION", - "description": " Creates a new agent in the given app.", - "canonical": true, - "file": "agent_service.create_agent.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateAgent", - "fullName": "google.cloud.ces.v1.AgentService.CreateAgent", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "agent_id", - "type": "TYPE_STRING" - }, - { - "name": "agent", - "type": ".google.cloud.ces.v1.Agent" - } - ], - "resultType": ".google.cloud.ces.v1.Agent", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "CreateAgent", - "fullName": "google.cloud.ces.v1.AgentService.CreateAgent", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_UpdateAgent_async", - "title": "AgentService updateAgent Sample", - "origin": "API_DEFINITION", - "description": " Updates the specified agent.", - "canonical": true, - "file": "agent_service.update_agent.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateAgent", - "fullName": "google.cloud.ces.v1.AgentService.UpdateAgent", - "async": true, - "parameters": [ - { - "name": "agent", - "type": ".google.cloud.ces.v1.Agent" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.ces.v1.Agent", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "UpdateAgent", - "fullName": "google.cloud.ces.v1.AgentService.UpdateAgent", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_DeleteAgent_async", - "title": "AgentService deleteAgent Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified agent.", - "canonical": true, - "file": "agent_service.delete_agent.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteAgent", - "fullName": "google.cloud.ces.v1.AgentService.DeleteAgent", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "DeleteAgent", - "fullName": "google.cloud.ces.v1.AgentService.DeleteAgent", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_ListExamples_async", - "title": "AgentService listExamples Sample", - "origin": "API_DEFINITION", - "description": " Lists examples in the given app.", - "canonical": true, - "file": "agent_service.list_examples.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 78, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListExamples", - "fullName": "google.cloud.ces.v1.AgentService.ListExamples", - "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.ces.v1.ListExamplesResponse", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "ListExamples", - "fullName": "google.cloud.ces.v1.AgentService.ListExamples", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_GetExample_async", - "title": "AgentService getExample Sample", - "origin": "API_DEFINITION", - "description": " Gets details of the specified example.", - "canonical": true, - "file": "agent_service.get_example.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetExample", - "fullName": "google.cloud.ces.v1.AgentService.GetExample", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.ces.v1.Example", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "GetExample", - "fullName": "google.cloud.ces.v1.AgentService.GetExample", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_CreateExample_async", - "title": "AgentService createExample Sample", - "origin": "API_DEFINITION", - "description": " Creates a new example in the given app.", - "canonical": true, - "file": "agent_service.create_example.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateExample", - "fullName": "google.cloud.ces.v1.AgentService.CreateExample", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "example_id", - "type": "TYPE_STRING" - }, - { - "name": "example", - "type": ".google.cloud.ces.v1.Example" - } - ], - "resultType": ".google.cloud.ces.v1.Example", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "CreateExample", - "fullName": "google.cloud.ces.v1.AgentService.CreateExample", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_UpdateExample_async", - "title": "AgentService updateExample Sample", - "origin": "API_DEFINITION", - "description": " Updates the specified example.", - "canonical": true, - "file": "agent_service.update_example.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateExample", - "fullName": "google.cloud.ces.v1.AgentService.UpdateExample", - "async": true, - "parameters": [ - { - "name": "example", - "type": ".google.cloud.ces.v1.Example" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.ces.v1.Example", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "UpdateExample", - "fullName": "google.cloud.ces.v1.AgentService.UpdateExample", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_DeleteExample_async", - "title": "AgentService deleteExample Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified example.", - "canonical": true, - "file": "agent_service.delete_example.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteExample", - "fullName": "google.cloud.ces.v1.AgentService.DeleteExample", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "DeleteExample", - "fullName": "google.cloud.ces.v1.AgentService.DeleteExample", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_ListTools_async", - "title": "AgentService listTools Sample", - "origin": "API_DEFINITION", - "description": " Lists tools in the given app.", - "canonical": true, - "file": "agent_service.list_tools.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 78, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListTools", - "fullName": "google.cloud.ces.v1.AgentService.ListTools", - "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.ces.v1.ListToolsResponse", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "ListTools", - "fullName": "google.cloud.ces.v1.AgentService.ListTools", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_GetTool_async", - "title": "AgentService getTool Sample", - "origin": "API_DEFINITION", - "description": " Gets details of the specified tool.", - "canonical": true, - "file": "agent_service.get_tool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetTool", - "fullName": "google.cloud.ces.v1.AgentService.GetTool", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.ces.v1.Tool", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "GetTool", - "fullName": "google.cloud.ces.v1.AgentService.GetTool", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_ListConversations_async", - "title": "AgentService listConversations Sample", - "origin": "API_DEFINITION", - "description": " Lists conversations in the given app.", - "canonical": true, - "file": "agent_service.list_conversations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListConversations", - "fullName": "google.cloud.ces.v1.AgentService.ListConversations", - "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": "source", - "type": ".google.cloud.ces.v1.Conversation.Source" - }, - { - "name": "sources", - "type": "TYPE_ENUM[]" - } - ], - "resultType": ".google.cloud.ces.v1.ListConversationsResponse", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "ListConversations", - "fullName": "google.cloud.ces.v1.AgentService.ListConversations", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_GetConversation_async", - "title": "AgentService getConversation Sample", - "origin": "API_DEFINITION", - "description": " Gets details of the specified conversation.", - "canonical": true, - "file": "agent_service.get_conversation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetConversation", - "fullName": "google.cloud.ces.v1.AgentService.GetConversation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "source", - "type": ".google.cloud.ces.v1.Conversation.Source" - } - ], - "resultType": ".google.cloud.ces.v1.Conversation", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "GetConversation", - "fullName": "google.cloud.ces.v1.AgentService.GetConversation", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_DeleteConversation_async", - "title": "AgentService deleteConversation Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified conversation.", - "canonical": true, - "file": "agent_service.delete_conversation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteConversation", - "fullName": "google.cloud.ces.v1.AgentService.DeleteConversation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "source", - "type": ".google.cloud.ces.v1.Conversation.Source" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "DeleteConversation", - "fullName": "google.cloud.ces.v1.AgentService.DeleteConversation", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_BatchDeleteConversations_async", - "title": "AgentService batchDeleteConversations Sample", - "origin": "API_DEFINITION", - "description": " Batch deletes the specified conversations.", - "canonical": true, - "file": "agent_service.batch_delete_conversations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchDeleteConversations", - "fullName": "google.cloud.ces.v1.AgentService.BatchDeleteConversations", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "conversations", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "BatchDeleteConversations", - "fullName": "google.cloud.ces.v1.AgentService.BatchDeleteConversations", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_CreateTool_async", - "title": "AgentService createTool Sample", - "origin": "API_DEFINITION", - "description": " Creates a new tool in the given app.", - "canonical": true, - "file": "agent_service.create_tool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateTool", - "fullName": "google.cloud.ces.v1.AgentService.CreateTool", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "tool_id", - "type": "TYPE_STRING" - }, - { - "name": "tool", - "type": ".google.cloud.ces.v1.Tool" - } - ], - "resultType": ".google.cloud.ces.v1.Tool", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "CreateTool", - "fullName": "google.cloud.ces.v1.AgentService.CreateTool", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_UpdateTool_async", - "title": "AgentService updateTool Sample", - "origin": "API_DEFINITION", - "description": " Updates the specified tool.", - "canonical": true, - "file": "agent_service.update_tool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateTool", - "fullName": "google.cloud.ces.v1.AgentService.UpdateTool", - "async": true, - "parameters": [ - { - "name": "tool", - "type": ".google.cloud.ces.v1.Tool" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.ces.v1.Tool", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "UpdateTool", - "fullName": "google.cloud.ces.v1.AgentService.UpdateTool", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_DeleteTool_async", - "title": "AgentService deleteTool Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified tool.", - "canonical": true, - "file": "agent_service.delete_tool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteTool", - "fullName": "google.cloud.ces.v1.AgentService.DeleteTool", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "DeleteTool", - "fullName": "google.cloud.ces.v1.AgentService.DeleteTool", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_ListGuardrails_async", - "title": "AgentService listGuardrails Sample", - "origin": "API_DEFINITION", - "description": " Lists guardrails in the given app.", - "canonical": true, - "file": "agent_service.list_guardrails.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 78, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListGuardrails", - "fullName": "google.cloud.ces.v1.AgentService.ListGuardrails", - "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.ces.v1.ListGuardrailsResponse", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "ListGuardrails", - "fullName": "google.cloud.ces.v1.AgentService.ListGuardrails", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_GetGuardrail_async", - "title": "AgentService getGuardrail Sample", - "origin": "API_DEFINITION", - "description": " Gets details of the specified guardrail.", - "canonical": true, - "file": "agent_service.get_guardrail.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetGuardrail", - "fullName": "google.cloud.ces.v1.AgentService.GetGuardrail", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.ces.v1.Guardrail", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "GetGuardrail", - "fullName": "google.cloud.ces.v1.AgentService.GetGuardrail", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_CreateGuardrail_async", - "title": "AgentService createGuardrail Sample", - "origin": "API_DEFINITION", - "description": " Creates a new guardrail in the given app.", - "canonical": true, - "file": "agent_service.create_guardrail.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateGuardrail", - "fullName": "google.cloud.ces.v1.AgentService.CreateGuardrail", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "guardrail_id", - "type": "TYPE_STRING" - }, - { - "name": "guardrail", - "type": ".google.cloud.ces.v1.Guardrail" - } - ], - "resultType": ".google.cloud.ces.v1.Guardrail", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "CreateGuardrail", - "fullName": "google.cloud.ces.v1.AgentService.CreateGuardrail", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_UpdateGuardrail_async", - "title": "AgentService updateGuardrail Sample", - "origin": "API_DEFINITION", - "description": " Updates the specified guardrail.", - "canonical": true, - "file": "agent_service.update_guardrail.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateGuardrail", - "fullName": "google.cloud.ces.v1.AgentService.UpdateGuardrail", - "async": true, - "parameters": [ - { - "name": "guardrail", - "type": ".google.cloud.ces.v1.Guardrail" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.ces.v1.Guardrail", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "UpdateGuardrail", - "fullName": "google.cloud.ces.v1.AgentService.UpdateGuardrail", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_DeleteGuardrail_async", - "title": "AgentService deleteGuardrail Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified guardrail.", - "canonical": true, - "file": "agent_service.delete_guardrail.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteGuardrail", - "fullName": "google.cloud.ces.v1.AgentService.DeleteGuardrail", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "DeleteGuardrail", - "fullName": "google.cloud.ces.v1.AgentService.DeleteGuardrail", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_ListDeployments_async", - "title": "AgentService listDeployments Sample", - "origin": "API_DEFINITION", - "description": " Lists deployments in the given app.", - "canonical": true, - "file": "agent_service.list_deployments.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 76, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDeployments", - "fullName": "google.cloud.ces.v1.AgentService.ListDeployments", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.ces.v1.ListDeploymentsResponse", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "ListDeployments", - "fullName": "google.cloud.ces.v1.AgentService.ListDeployments", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_GetDeployment_async", - "title": "AgentService getDeployment Sample", - "origin": "API_DEFINITION", - "description": " Gets details of the specified deployment.", - "canonical": true, - "file": "agent_service.get_deployment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDeployment", - "fullName": "google.cloud.ces.v1.AgentService.GetDeployment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.ces.v1.Deployment", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "GetDeployment", - "fullName": "google.cloud.ces.v1.AgentService.GetDeployment", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_CreateDeployment_async", - "title": "AgentService createDeployment Sample", - "origin": "API_DEFINITION", - "description": " Creates a new deployment in the given app.", - "canonical": true, - "file": "agent_service.create_deployment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateDeployment", - "fullName": "google.cloud.ces.v1.AgentService.CreateDeployment", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "deployment_id", - "type": "TYPE_STRING" - }, - { - "name": "deployment", - "type": ".google.cloud.ces.v1.Deployment" - } - ], - "resultType": ".google.cloud.ces.v1.Deployment", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "CreateDeployment", - "fullName": "google.cloud.ces.v1.AgentService.CreateDeployment", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_UpdateDeployment_async", - "title": "AgentService updateDeployment Sample", - "origin": "API_DEFINITION", - "description": " Updates the specified deployment.", - "canonical": true, - "file": "agent_service.update_deployment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateDeployment", - "fullName": "google.cloud.ces.v1.AgentService.UpdateDeployment", - "async": true, - "parameters": [ - { - "name": "deployment", - "type": ".google.cloud.ces.v1.Deployment" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.ces.v1.Deployment", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "UpdateDeployment", - "fullName": "google.cloud.ces.v1.AgentService.UpdateDeployment", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_DeleteDeployment_async", - "title": "AgentService deleteDeployment Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified deployment.", - "canonical": true, - "file": "agent_service.delete_deployment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteDeployment", - "fullName": "google.cloud.ces.v1.AgentService.DeleteDeployment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "DeleteDeployment", - "fullName": "google.cloud.ces.v1.AgentService.DeleteDeployment", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_ListToolsets_async", - "title": "AgentService listToolsets Sample", - "origin": "API_DEFINITION", - "description": " Lists toolsets in the given app.", - "canonical": true, - "file": "agent_service.list_toolsets.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 78, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListToolsets", - "fullName": "google.cloud.ces.v1.AgentService.ListToolsets", - "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.ces.v1.ListToolsetsResponse", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "ListToolsets", - "fullName": "google.cloud.ces.v1.AgentService.ListToolsets", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_GetToolset_async", - "title": "AgentService getToolset Sample", - "origin": "API_DEFINITION", - "description": " Gets details of the specified toolset.", - "canonical": true, - "file": "agent_service.get_toolset.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetToolset", - "fullName": "google.cloud.ces.v1.AgentService.GetToolset", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.ces.v1.Toolset", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "GetToolset", - "fullName": "google.cloud.ces.v1.AgentService.GetToolset", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_CreateToolset_async", - "title": "AgentService createToolset Sample", - "origin": "API_DEFINITION", - "description": " Creates a new toolset in the given app.", - "canonical": true, - "file": "agent_service.create_toolset.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateToolset", - "fullName": "google.cloud.ces.v1.AgentService.CreateToolset", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "toolset_id", - "type": "TYPE_STRING" - }, - { - "name": "toolset", - "type": ".google.cloud.ces.v1.Toolset" - } - ], - "resultType": ".google.cloud.ces.v1.Toolset", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "CreateToolset", - "fullName": "google.cloud.ces.v1.AgentService.CreateToolset", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_UpdateToolset_async", - "title": "AgentService updateToolset Sample", - "origin": "API_DEFINITION", - "description": " Updates the specified toolset.", - "canonical": true, - "file": "agent_service.update_toolset.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateToolset", - "fullName": "google.cloud.ces.v1.AgentService.UpdateToolset", - "async": true, - "parameters": [ - { - "name": "toolset", - "type": ".google.cloud.ces.v1.Toolset" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.ces.v1.Toolset", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "UpdateToolset", - "fullName": "google.cloud.ces.v1.AgentService.UpdateToolset", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_DeleteToolset_async", - "title": "AgentService deleteToolset Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified toolset.", - "canonical": true, - "file": "agent_service.delete_toolset.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteToolset", - "fullName": "google.cloud.ces.v1.AgentService.DeleteToolset", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "DeleteToolset", - "fullName": "google.cloud.ces.v1.AgentService.DeleteToolset", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_ListAppVersions_async", - "title": "AgentService listAppVersions Sample", - "origin": "API_DEFINITION", - "description": " Lists all app versions in the given app.", - "canonical": true, - "file": "agent_service.list_app_versions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 78, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAppVersions", - "fullName": "google.cloud.ces.v1.AgentService.ListAppVersions", - "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.ces.v1.ListAppVersionsResponse", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "ListAppVersions", - "fullName": "google.cloud.ces.v1.AgentService.ListAppVersions", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_GetAppVersion_async", - "title": "AgentService getAppVersion Sample", - "origin": "API_DEFINITION", - "description": " Gets details of the specified app version.", - "canonical": true, - "file": "agent_service.get_app_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetAppVersion", - "fullName": "google.cloud.ces.v1.AgentService.GetAppVersion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.ces.v1.AppVersion", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "GetAppVersion", - "fullName": "google.cloud.ces.v1.AgentService.GetAppVersion", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_CreateAppVersion_async", - "title": "AgentService createAppVersion Sample", - "origin": "API_DEFINITION", - "description": " Creates a new app version in the given app.", - "canonical": true, - "file": "agent_service.create_app_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateAppVersion", - "fullName": "google.cloud.ces.v1.AgentService.CreateAppVersion", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "app_version_id", - "type": "TYPE_STRING" - }, - { - "name": "app_version", - "type": ".google.cloud.ces.v1.AppVersion" - } - ], - "resultType": ".google.cloud.ces.v1.AppVersion", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "CreateAppVersion", - "fullName": "google.cloud.ces.v1.AgentService.CreateAppVersion", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_DeleteAppVersion_async", - "title": "AgentService deleteAppVersion Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified app version.", - "canonical": true, - "file": "agent_service.delete_app_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteAppVersion", - "fullName": "google.cloud.ces.v1.AgentService.DeleteAppVersion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "DeleteAppVersion", - "fullName": "google.cloud.ces.v1.AgentService.DeleteAppVersion", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_RestoreAppVersion_async", - "title": "AgentService restoreAppVersion Sample", - "origin": "API_DEFINITION", - "description": " Restores the specified app version. This will create a new app version from the current draft app and overwrite the current draft with the specified app version.", - "canonical": true, - "file": "agent_service.restore_app_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestoreAppVersion", - "fullName": "google.cloud.ces.v1.AgentService.RestoreAppVersion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "RestoreAppVersion", - "fullName": "google.cloud.ces.v1.AgentService.RestoreAppVersion", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_ListChangelogs_async", - "title": "AgentService listChangelogs Sample", - "origin": "API_DEFINITION", - "description": " Lists the changelogs of the specified app.", - "canonical": true, - "file": "agent_service.list_changelogs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 90, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListChangelogs", - "fullName": "google.cloud.ces.v1.AgentService.ListChangelogs", - "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.ces.v1.ListChangelogsResponse", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "ListChangelogs", - "fullName": "google.cloud.ces.v1.AgentService.ListChangelogs", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_AgentService_GetChangelog_async", - "title": "AgentService getChangelog Sample", - "origin": "API_DEFINITION", - "description": " Gets the specified changelog.", - "canonical": true, - "file": "agent_service.get_changelog.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetChangelog", - "fullName": "google.cloud.ces.v1.AgentService.GetChangelog", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.ces.v1.Changelog", - "client": { - "shortName": "AgentServiceClient", - "fullName": "google.cloud.ces.v1.AgentServiceClient" - }, - "method": { - "shortName": "GetChangelog", - "fullName": "google.cloud.ces.v1.AgentService.GetChangelog", - "service": { - "shortName": "AgentService", - "fullName": "google.cloud.ces.v1.AgentService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_SessionService_RunSession_async", - "title": "AgentService runSession Sample", - "origin": "API_DEFINITION", - "description": " Initiates a single turn interaction with the CES agent within a session.", - "canonical": true, - "file": "session_service.run_session.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunSession", - "fullName": "google.cloud.ces.v1.SessionService.RunSession", - "async": true, - "parameters": [ - { - "name": "config", - "type": ".google.cloud.ces.v1.SessionConfig" - }, - { - "name": "inputs", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.cloud.ces.v1.RunSessionResponse", - "client": { - "shortName": "SessionServiceClient", - "fullName": "google.cloud.ces.v1.SessionServiceClient" - }, - "method": { - "shortName": "RunSession", - "fullName": "google.cloud.ces.v1.SessionService.RunSession", - "service": { - "shortName": "SessionService", - "fullName": "google.cloud.ces.v1.SessionService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_SessionService_BidiRunSession_async", - "title": "AgentService bidiRunSession Sample", - "origin": "API_DEFINITION", - "description": " Establishes a bidirectional streaming connection with the CES agent. The agent processes continuous multimodal inputs (e.g., text, audio) and generates real-time multimodal output streams. --- Client Request Stream --- The client streams requests in the following order: 1. Initialization: The first message must contain [SessionConfig][google.cloud.ces.v1.BidiSessionClientMessage.config]. For audio sessions, this should also include [InputAudioConfig][google.cloud.ces.v1.SessionConfig.input_audio_config] and [OutputAudioConfig][google.cloud.ces.v1.SessionConfig.output_audio_config] to define audio processing and synthesis parameters. 2. Interaction: Subsequent messages stream [SessionInput][google.cloud.ces.v1.BidiSessionClientMessage.realtime_input] containing real-time user input data. 3. Termination: The client should half-close the stream when there is no more user input. It should also half-close upon receiving [EndSession][google.cloud.ces.v1.BidiSessionServerMessage.end_session] or [GoAway][google.cloud.ces.v1.BidiSessionServerMessage.go_away] from the agent. --- Server Response Stream --- For each interaction turn, the agent streams messages in the following sequence: 1. Speech Recognition (First N messages): Contains [RecognitionResult][google.cloud.ces.v1.BidiSessionServerMessage.recognition_result] representing the concatenated user speech segments captured so far. This is only populated for audio sessions. 2. Response (Next M messages): Contains [SessionOutput][google.cloud.ces.v1.BidiSessionServerMessage.session_output] delivering the agent's response in various modalities (e.g., text, audio). 3. Turn Completion (Final message of the turn): Contains [SessionOutput][google.cloud.ces.v1.BidiSessionServerMessage.session_output] with [turn_completed][google.cloud.ces.v1.SessionOutput.turn_completed] set to true. This signals the end of the current turn and includes [DiagnosticInfo][google.cloud.ces.v1.SessionOutput.diagnostic_info] with execution details. --- Audio Best Practices --- 1. Streaming: Stream [audio data][google.cloud.ces.v1.SessionInput.audio] **CONTINUOUSLY**, even during silence. Recommended chunk size: 40-120ms (balances latency vs. efficiency). 2. Playback & Interruption: Play [audio responses][google.cloud.ces.v1.SessionOutput.audio] upon receipt. Stop playback immediately if an [InterruptionSignal][google.cloud.ces.v1.BidiSessionServerMessage.interruption_signal] is received (e.g., user barge-in or new agent response).", - "canonical": true, - "file": "session_service.bidi_run_session.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BidiRunSession", - "fullName": "google.cloud.ces.v1.SessionService.BidiRunSession", - "async": true, - "parameters": [ - { - "name": "config", - "type": ".google.cloud.ces.v1.SessionConfig" - }, - { - "name": "realtime_input", - "type": ".google.cloud.ces.v1.SessionInput" - } - ], - "resultType": ".google.cloud.ces.v1.BidiSessionServerMessage", - "client": { - "shortName": "SessionServiceClient", - "fullName": "google.cloud.ces.v1.SessionServiceClient" - }, - "method": { - "shortName": "BidiRunSession", - "fullName": "google.cloud.ces.v1.SessionService.BidiRunSession", - "service": { - "shortName": "SessionService", - "fullName": "google.cloud.ces.v1.SessionService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_ToolService_ExecuteTool_async", - "title": "AgentService executeTool Sample", - "origin": "API_DEFINITION", - "description": " Executes the given tool with the given arguments.", - "canonical": true, - "file": "tool_service.execute_tool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ExecuteTool", - "fullName": "google.cloud.ces.v1.ToolService.ExecuteTool", - "async": true, - "parameters": [ - { - "name": "tool", - "type": "TYPE_STRING" - }, - { - "name": "toolset_tool", - "type": ".google.cloud.ces.v1.ToolsetTool" - }, - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "args", - "type": ".google.protobuf.Struct" - } - ], - "resultType": ".google.cloud.ces.v1.ExecuteToolResponse", - "client": { - "shortName": "ToolServiceClient", - "fullName": "google.cloud.ces.v1.ToolServiceClient" - }, - "method": { - "shortName": "ExecuteTool", - "fullName": "google.cloud.ces.v1.ToolService.ExecuteTool", - "service": { - "shortName": "ToolService", - "fullName": "google.cloud.ces.v1.ToolService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_ToolService_RetrieveToolSchema_async", - "title": "AgentService retrieveToolSchema Sample", - "origin": "API_DEFINITION", - "description": " Retrieve the schema of the given tool. The schema is computed on the fly for the given instance of the tool.", - "canonical": true, - "file": "tool_service.retrieve_tool_schema.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RetrieveToolSchema", - "fullName": "google.cloud.ces.v1.ToolService.RetrieveToolSchema", - "async": true, - "parameters": [ - { - "name": "tool", - "type": "TYPE_STRING" - }, - { - "name": "toolset_tool", - "type": ".google.cloud.ces.v1.ToolsetTool" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.ces.v1.RetrieveToolSchemaResponse", - "client": { - "shortName": "ToolServiceClient", - "fullName": "google.cloud.ces.v1.ToolServiceClient" - }, - "method": { - "shortName": "RetrieveToolSchema", - "fullName": "google.cloud.ces.v1.ToolService.RetrieveToolSchema", - "service": { - "shortName": "ToolService", - "fullName": "google.cloud.ces.v1.ToolService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_ToolService_RetrieveTools_async", - "title": "AgentService retrieveTools Sample", - "origin": "API_DEFINITION", - "description": " Retrieve the list of tools included in the specified toolset.", - "canonical": true, - "file": "tool_service.retrieve_tools.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RetrieveTools", - "fullName": "google.cloud.ces.v1.ToolService.RetrieveTools", - "async": true, - "parameters": [ - { - "name": "toolset", - "type": "TYPE_STRING" - }, - { - "name": "tool_ids", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.cloud.ces.v1.RetrieveToolsResponse", - "client": { - "shortName": "ToolServiceClient", - "fullName": "google.cloud.ces.v1.ToolServiceClient" - }, - "method": { - "shortName": "RetrieveTools", - "fullName": "google.cloud.ces.v1.ToolService.RetrieveTools", - "service": { - "shortName": "ToolService", - "fullName": "google.cloud.ces.v1.ToolService" - } - } - } - }, - { - "regionTag": "ces_v1_generated_WidgetService_GenerateChatToken_async", - "title": "AgentService generateChatToken Sample", - "origin": "API_DEFINITION", - "description": " Generates a session scoped token for chat widget to authenticate with Session APIs.", - "canonical": true, - "file": "widget_service.generate_chat_token.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GenerateChatToken", - "fullName": "google.cloud.ces.v1.WidgetService.GenerateChatToken", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "deployment", - "type": "TYPE_STRING" - }, - { - "name": "recaptcha_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.ces.v1.GenerateChatTokenResponse", - "client": { - "shortName": "WidgetServiceClient", - "fullName": "google.cloud.ces.v1.WidgetServiceClient" - }, - "method": { - "shortName": "GenerateChatToken", - "fullName": "google.cloud.ces.v1.WidgetService.GenerateChatToken", - "service": { - "shortName": "WidgetService", - "fullName": "google.cloud.ces.v1.WidgetService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.execute_tool.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.execute_tool.js deleted file mode 100644 index b5f6cb6c937..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.execute_tool.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START ces_v1_generated_ToolService_ExecuteTool_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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 name of the tool to execute. - * Format: - * projects/{project}/locations/{location}/apps/{app}/tools/{tool} - */ - // const tool = 'abc123' - /** - * Optional. The toolset tool to execute. Only one tool should match the - * predicate from the toolset. Otherwise, an error will be returned. - */ - // const toolsetTool = {} - /** - * Required. The resource name of the app which the tool/toolset belongs to. - * Format: `projects/{project}/locations/{location}/apps/{app}` - */ - // const parent = 'abc123' - /** - * Optional. The input parameters and values for the tool in JSON object - * format. - */ - // const args = {} - - // Imports the Ces library - const {ToolServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new ToolServiceClient(); - - async function callExecuteTool() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await cesClient.executeTool(request); - console.log(response); - } - - callExecuteTool(); - // [END ces_v1_generated_ToolService_ExecuteTool_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tool_schema.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tool_schema.js deleted file mode 100644 index d04df58e449..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tool_schema.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START ces_v1_generated_ToolService_RetrieveToolSchema_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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 name of the tool to retrieve the schema for. - * Format: - * projects/{project}/locations/{location}/apps/{app}/tools/{tool} - */ - // const tool = 'abc123' - /** - * Optional. The toolset tool to retrieve the schema for. Only one tool - * should match the predicate from the toolset. Otherwise, an error will be - * returned. - */ - // const toolsetTool = {} - /** - * Required. The resource name of the app which the tool/toolset belongs to. - * Format: `projects/{project}/locations/{location}/apps/{app}` - */ - // const parent = 'abc123' - - // Imports the Ces library - const {ToolServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new ToolServiceClient(); - - async function callRetrieveToolSchema() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await cesClient.retrieveToolSchema(request); - console.log(response); - } - - callRetrieveToolSchema(); - // [END ces_v1_generated_ToolService_RetrieveToolSchema_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tools.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tools.js deleted file mode 100644 index 517c77442a2..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tools.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(toolset) { - // [START ces_v1_generated_ToolService_RetrieveTools_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will 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 toolset to retrieve the tools for. - * Format: - * `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` - */ - // const toolset = 'abc123' - /** - * Optional. The identifiers of the tools to retrieve from the toolset. - * If empty, all tools in the toolset will be returned. - */ - // const toolIds = ['abc','def'] - - // Imports the Ces library - const {ToolServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new ToolServiceClient(); - - async function callRetrieveTools() { - // Construct request - const request = { - toolset, - }; - - // Run request - const response = await cesClient.retrieveTools(request); - console.log(response); - } - - callRetrieveTools(); - // [END ces_v1_generated_ToolService_RetrieveTools_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1/widget_service.generate_chat_token.js b/owl-bot-staging/google-cloud-ces/samples/generated/v1/widget_service.generate_chat_token.js deleted file mode 100644 index c17e0cba557..00000000000 --- a/owl-bot-staging/google-cloud-ces/samples/generated/v1/widget_service.generate_chat_token.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, deployment) { - // [START ces_v1_generated_WidgetService_GenerateChatToken_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will 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 session name to generate the chat token for. - * Format: - * projects/{project}/locations/{location}/apps/{app}/sessions/{session} - */ - // const name = 'abc123' - /** - * Required. The deployment of the app to use for the session. - * Format: - * projects/{project}/locations/{location}/apps/{app}/deployments/{deployment} - */ - // const deployment = 'abc123' - /** - * Optional. The reCAPTCHA token generated by the client-side chat widget. - */ - // const recaptchaToken = 'abc123' - - // Imports the Ces library - const {WidgetServiceClient} = require('@google-cloud/ces').v1; - - // Instantiates a client - const cesClient = new WidgetServiceClient(); - - async function callGenerateChatToken() { - // Construct request - const request = { - name, - deployment, - }; - - // Run request - const response = await cesClient.generateChatToken(request); - console.log(response); - } - - callGenerateChatToken(); - // [END ces_v1_generated_WidgetService_GenerateChatToken_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-ces/src/index.ts b/owl-bot-staging/google-cloud-ces/src/index.ts deleted file mode 100644 index d7aa3bc90a3..00000000000 --- a/owl-bot-staging/google-cloud-ces/src/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by synthtool. ** -// ** https://github.com/googleapis/synthtool ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -import * as v1beta from './v1beta'; - -const AgentServiceClient = v1.AgentServiceClient; -type AgentServiceClient = v1.AgentServiceClient; -const SessionServiceClient = v1.SessionServiceClient; -type SessionServiceClient = v1.SessionServiceClient; -const ToolServiceClient = v1.ToolServiceClient; -type ToolServiceClient = v1.ToolServiceClient; -const WidgetServiceClient = v1.WidgetServiceClient; -type WidgetServiceClient = v1.WidgetServiceClient; - -export {v1, v1beta, AgentServiceClient, SessionServiceClient, ToolServiceClient, WidgetServiceClient}; -export default {v1, v1beta, AgentServiceClient, SessionServiceClient, ToolServiceClient, WidgetServiceClient}; -import * as protos from '../protos/protos'; -export {protos}; diff --git a/owl-bot-staging/google-cloud-ces/src/v1/agent_service_client.ts b/owl-bot-staging/google-cloud-ces/src/v1/agent_service_client.ts deleted file mode 100644 index f5b4a1e68cd..00000000000 --- a/owl-bot-staging/google-cloud-ces/src/v1/agent_service_client.ts +++ /dev/null @@ -1,7641 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/agent_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './agent_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * The service that manages agent-related resources in Gemini Enterprise for - * Customer Engagement (CES). - * @class - * @memberof v1 - */ -export class AgentServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('ces'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - agentServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of AgentServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new AgentServiceClient({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 AgentServiceClient; - 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 = 'ces.' + 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.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 = { - agentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/agents/{agent}' - ), - appPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}' - ), - appVersionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/versions/{version}' - ), - changelogPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}' - ), - conversationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}' - ), - deploymentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}' - ), - examplePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/examples/{example}' - ), - guardrailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - omnichannelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/omnichannels/{omnichannel}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - toolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/tools/{tool}' - ), - toolsetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}' - ), - }; - - // 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 = { - listApps: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'apps'), - listAgents: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'agents'), - listExamples: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'examples'), - listTools: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tools'), - listConversations: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'conversations'), - listGuardrails: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'guardrails'), - listDeployments: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'deployments'), - listToolsets: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'toolsets'), - listAppVersions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'appVersions'), - listChangelogs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'changelogs') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createAppResponse = protoFilesRoot.lookup( - '.google.cloud.ces.v1.App') as gax.protobuf.Type; - const createAppMetadata = protoFilesRoot.lookup( - '.google.cloud.ces.v1.OperationMetadata') as gax.protobuf.Type; - const deleteAppResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteAppMetadata = protoFilesRoot.lookup( - '.google.cloud.ces.v1.OperationMetadata') as gax.protobuf.Type; - const exportAppResponse = protoFilesRoot.lookup( - '.google.cloud.ces.v1.ExportAppResponse') as gax.protobuf.Type; - const exportAppMetadata = protoFilesRoot.lookup( - '.google.cloud.ces.v1.OperationMetadata') as gax.protobuf.Type; - const importAppResponse = protoFilesRoot.lookup( - '.google.cloud.ces.v1.ImportAppResponse') as gax.protobuf.Type; - const importAppMetadata = protoFilesRoot.lookup( - '.google.cloud.ces.v1.OperationMetadata') as gax.protobuf.Type; - const batchDeleteConversationsResponse = protoFilesRoot.lookup( - '.google.cloud.ces.v1.BatchDeleteConversationsResponse') as gax.protobuf.Type; - const batchDeleteConversationsMetadata = protoFilesRoot.lookup( - '.google.cloud.ces.v1.OperationMetadata') as gax.protobuf.Type; - const restoreAppVersionResponse = protoFilesRoot.lookup( - '.google.cloud.ces.v1.RestoreAppVersionResponse') as gax.protobuf.Type; - const restoreAppVersionMetadata = protoFilesRoot.lookup( - '.google.cloud.ces.v1.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createApp: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createAppResponse.decode.bind(createAppResponse), - createAppMetadata.decode.bind(createAppMetadata)), - deleteApp: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteAppResponse.decode.bind(deleteAppResponse), - deleteAppMetadata.decode.bind(deleteAppMetadata)), - exportApp: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - exportAppResponse.decode.bind(exportAppResponse), - exportAppMetadata.decode.bind(exportAppMetadata)), - importApp: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - importAppResponse.decode.bind(importAppResponse), - importAppMetadata.decode.bind(importAppMetadata)), - batchDeleteConversations: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - batchDeleteConversationsResponse.decode.bind(batchDeleteConversationsResponse), - batchDeleteConversationsMetadata.decode.bind(batchDeleteConversationsMetadata)), - restoreAppVersion: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - restoreAppVersionResponse.decode.bind(restoreAppVersionResponse), - restoreAppVersionMetadata.decode.bind(restoreAppVersionMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.ces.v1.AgentService', 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.agentServiceStub) { - return this.agentServiceStub; - } - - // Put together the "service stub" for - // google.cloud.ces.v1.AgentService. - this.agentServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.ces.v1.AgentService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.ces.v1.AgentService, - 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 agentServiceStubMethods = - ['listApps', 'getApp', 'createApp', 'updateApp', 'deleteApp', 'exportApp', 'importApp', 'listAgents', 'getAgent', 'createAgent', 'updateAgent', 'deleteAgent', 'listExamples', 'getExample', 'createExample', 'updateExample', 'deleteExample', 'listTools', 'getTool', 'listConversations', 'getConversation', 'deleteConversation', 'batchDeleteConversations', 'createTool', 'updateTool', 'deleteTool', 'listGuardrails', 'getGuardrail', 'createGuardrail', 'updateGuardrail', 'deleteGuardrail', 'listDeployments', 'getDeployment', 'createDeployment', 'updateDeployment', 'deleteDeployment', 'listToolsets', 'getToolset', 'createToolset', 'updateToolset', 'deleteToolset', 'listAppVersions', 'getAppVersion', 'createAppVersion', 'deleteAppVersion', 'restoreAppVersion', 'listChangelogs', 'getChangelog']; - for (const methodName of agentServiceStubMethods) { - const callPromise = this.agentServiceStub.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.agentServiceStub; - } - - /** - * 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 'ces.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 'ces.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/ces', - '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 the specified app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the app to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.App|App}. - * 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/agent_service.get_app.js - * region_tag:ces_v1_generated_AgentService_GetApp_async - */ - getApp( - request?: protos.google.cloud.ces.v1.IGetAppRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IApp, - protos.google.cloud.ces.v1.IGetAppRequest|undefined, {}|undefined - ]>; - getApp( - request: protos.google.cloud.ces.v1.IGetAppRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IApp, - protos.google.cloud.ces.v1.IGetAppRequest|null|undefined, - {}|null|undefined>): void; - getApp( - request: protos.google.cloud.ces.v1.IGetAppRequest, - callback: Callback< - protos.google.cloud.ces.v1.IApp, - protos.google.cloud.ces.v1.IGetAppRequest|null|undefined, - {}|null|undefined>): void; - getApp( - request?: protos.google.cloud.ces.v1.IGetAppRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IApp, - protos.google.cloud.ces.v1.IGetAppRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IApp, - protos.google.cloud.ces.v1.IGetAppRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IApp, - protos.google.cloud.ces.v1.IGetAppRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getApp request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IApp, - protos.google.cloud.ces.v1.IGetAppRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getApp response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getApp(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IApp, - protos.google.cloud.ces.v1.IGetAppRequest|undefined, - {}|undefined - ]) => { - this._log.info('getApp response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates the specified app. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.ces.v1.App} request.app - * Required. The app to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. Field mask is used to control which fields get updated. If the - * mask is not present, all fields will be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.App|App}. - * 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/agent_service.update_app.js - * region_tag:ces_v1_generated_AgentService_UpdateApp_async - */ - updateApp( - request?: protos.google.cloud.ces.v1.IUpdateAppRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IApp, - protos.google.cloud.ces.v1.IUpdateAppRequest|undefined, {}|undefined - ]>; - updateApp( - request: protos.google.cloud.ces.v1.IUpdateAppRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IApp, - protos.google.cloud.ces.v1.IUpdateAppRequest|null|undefined, - {}|null|undefined>): void; - updateApp( - request: protos.google.cloud.ces.v1.IUpdateAppRequest, - callback: Callback< - protos.google.cloud.ces.v1.IApp, - protos.google.cloud.ces.v1.IUpdateAppRequest|null|undefined, - {}|null|undefined>): void; - updateApp( - request?: protos.google.cloud.ces.v1.IUpdateAppRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IApp, - protos.google.cloud.ces.v1.IUpdateAppRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IApp, - protos.google.cloud.ces.v1.IUpdateAppRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IApp, - protos.google.cloud.ces.v1.IUpdateAppRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'app.name': request.app!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateApp request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IApp, - protos.google.cloud.ces.v1.IUpdateAppRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateApp response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateApp(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IApp, - protos.google.cloud.ces.v1.IUpdateAppRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateApp response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets details of the specified agent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the agent to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Agent|Agent}. - * 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/agent_service.get_agent.js - * region_tag:ces_v1_generated_AgentService_GetAgent_async - */ - getAgent( - request?: protos.google.cloud.ces.v1.IGetAgentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.IGetAgentRequest|undefined, {}|undefined - ]>; - getAgent( - request: protos.google.cloud.ces.v1.IGetAgentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.IGetAgentRequest|null|undefined, - {}|null|undefined>): void; - getAgent( - request: protos.google.cloud.ces.v1.IGetAgentRequest, - callback: Callback< - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.IGetAgentRequest|null|undefined, - {}|null|undefined>): void; - getAgent( - request?: protos.google.cloud.ces.v1.IGetAgentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.IGetAgentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.IGetAgentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.IGetAgentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getAgent request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.IGetAgentRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getAgent response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getAgent(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.IGetAgentRequest|undefined, - {}|undefined - ]) => { - this._log.info('getAgent response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a new agent in the given app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to create an agent in. - * @param {string} [request.agentId] - * Optional. The ID to use for the agent, which will become the final - * component of the agent's resource name. If not provided, a unique ID will - * be automatically assigned for the agent. - * @param {google.cloud.ces.v1.Agent} request.agent - * Required. The agent to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Agent|Agent}. - * 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/agent_service.create_agent.js - * region_tag:ces_v1_generated_AgentService_CreateAgent_async - */ - createAgent( - request?: protos.google.cloud.ces.v1.ICreateAgentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.ICreateAgentRequest|undefined, {}|undefined - ]>; - createAgent( - request: protos.google.cloud.ces.v1.ICreateAgentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.ICreateAgentRequest|null|undefined, - {}|null|undefined>): void; - createAgent( - request: protos.google.cloud.ces.v1.ICreateAgentRequest, - callback: Callback< - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.ICreateAgentRequest|null|undefined, - {}|null|undefined>): void; - createAgent( - request?: protos.google.cloud.ces.v1.ICreateAgentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.ICreateAgentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.ICreateAgentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.ICreateAgentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createAgent request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.ICreateAgentRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createAgent response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createAgent(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.ICreateAgentRequest|undefined, - {}|undefined - ]) => { - this._log.info('createAgent response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates the specified agent. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.ces.v1.Agent} request.agent - * Required. The agent to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. Field mask is used to control which fields get updated. If the - * mask is not present, all fields will be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Agent|Agent}. - * 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/agent_service.update_agent.js - * region_tag:ces_v1_generated_AgentService_UpdateAgent_async - */ - updateAgent( - request?: protos.google.cloud.ces.v1.IUpdateAgentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.IUpdateAgentRequest|undefined, {}|undefined - ]>; - updateAgent( - request: protos.google.cloud.ces.v1.IUpdateAgentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.IUpdateAgentRequest|null|undefined, - {}|null|undefined>): void; - updateAgent( - request: protos.google.cloud.ces.v1.IUpdateAgentRequest, - callback: Callback< - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.IUpdateAgentRequest|null|undefined, - {}|null|undefined>): void; - updateAgent( - request?: protos.google.cloud.ces.v1.IUpdateAgentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.IUpdateAgentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.IUpdateAgentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.IUpdateAgentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'agent.name': request.agent!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateAgent request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.IUpdateAgentRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateAgent response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateAgent(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IAgent, - protos.google.cloud.ces.v1.IUpdateAgentRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateAgent response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes the specified agent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the agent to delete. - * @param {boolean} [request.force] - * Optional. Indicates whether to forcefully delete the agent, even if it is - * still referenced by other app/agents/examples. - * - * * If `force = false`, the deletion fails if other agents/examples - * reference it. - * * If `force = true`, delete the agent and remove it from all referencing - * apps/agents/examples. - * @param {string} [request.etag] - * Optional. The current etag of the agent. If an etag is not provided, the - * deletion will overwrite any concurrent changes. If an etag is provided and - * does not match the current etag of the agent, 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 {@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/agent_service.delete_agent.js - * region_tag:ces_v1_generated_AgentService_DeleteAgent_async - */ - deleteAgent( - request?: protos.google.cloud.ces.v1.IDeleteAgentRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteAgentRequest|undefined, {}|undefined - ]>; - deleteAgent( - request: protos.google.cloud.ces.v1.IDeleteAgentRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteAgentRequest|null|undefined, - {}|null|undefined>): void; - deleteAgent( - request: protos.google.cloud.ces.v1.IDeleteAgentRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteAgentRequest|null|undefined, - {}|null|undefined>): void; - deleteAgent( - request?: protos.google.cloud.ces.v1.IDeleteAgentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteAgentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteAgentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteAgentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteAgent request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteAgentRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteAgent response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteAgent(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteAgentRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteAgent response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets details of the specified example. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the example to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Example|Example}. - * 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/agent_service.get_example.js - * region_tag:ces_v1_generated_AgentService_GetExample_async - */ - getExample( - request?: protos.google.cloud.ces.v1.IGetExampleRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.IGetExampleRequest|undefined, {}|undefined - ]>; - getExample( - request: protos.google.cloud.ces.v1.IGetExampleRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.IGetExampleRequest|null|undefined, - {}|null|undefined>): void; - getExample( - request: protos.google.cloud.ces.v1.IGetExampleRequest, - callback: Callback< - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.IGetExampleRequest|null|undefined, - {}|null|undefined>): void; - getExample( - request?: protos.google.cloud.ces.v1.IGetExampleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.IGetExampleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.IGetExampleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.IGetExampleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getExample request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.IGetExampleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getExample response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getExample(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.IGetExampleRequest|undefined, - {}|undefined - ]) => { - this._log.info('getExample response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a new example in the given app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to create an example in. - * @param {string} [request.exampleId] - * Optional. The ID to use for the example, which will become the final - * component of the example's resource name. If not provided, a unique ID will - * be automatically assigned for the example. - * @param {google.cloud.ces.v1.Example} request.example - * Required. The example to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Example|Example}. - * 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/agent_service.create_example.js - * region_tag:ces_v1_generated_AgentService_CreateExample_async - */ - createExample( - request?: protos.google.cloud.ces.v1.ICreateExampleRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.ICreateExampleRequest|undefined, {}|undefined - ]>; - createExample( - request: protos.google.cloud.ces.v1.ICreateExampleRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.ICreateExampleRequest|null|undefined, - {}|null|undefined>): void; - createExample( - request: protos.google.cloud.ces.v1.ICreateExampleRequest, - callback: Callback< - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.ICreateExampleRequest|null|undefined, - {}|null|undefined>): void; - createExample( - request?: protos.google.cloud.ces.v1.ICreateExampleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.ICreateExampleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.ICreateExampleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.ICreateExampleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createExample request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.ICreateExampleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createExample response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createExample(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.ICreateExampleRequest|undefined, - {}|undefined - ]) => { - this._log.info('createExample response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates the specified example. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.ces.v1.Example} request.example - * Required. The example to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. Field mask is used to control which fields get updated. If the - * mask is not present, all fields will be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Example|Example}. - * 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/agent_service.update_example.js - * region_tag:ces_v1_generated_AgentService_UpdateExample_async - */ - updateExample( - request?: protos.google.cloud.ces.v1.IUpdateExampleRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.IUpdateExampleRequest|undefined, {}|undefined - ]>; - updateExample( - request: protos.google.cloud.ces.v1.IUpdateExampleRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.IUpdateExampleRequest|null|undefined, - {}|null|undefined>): void; - updateExample( - request: protos.google.cloud.ces.v1.IUpdateExampleRequest, - callback: Callback< - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.IUpdateExampleRequest|null|undefined, - {}|null|undefined>): void; - updateExample( - request?: protos.google.cloud.ces.v1.IUpdateExampleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.IUpdateExampleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.IUpdateExampleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.IUpdateExampleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'example.name': request.example!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateExample request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.IUpdateExampleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateExample response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateExample(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IExample, - protos.google.cloud.ces.v1.IUpdateExampleRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateExample response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes the specified example. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the example to delete. - * @param {string} [request.etag] - * Optional. The current etag of the example. If an etag is not provided, the - * deletion will overwrite any concurrent changes. If an etag is provided and - * does not match the current etag of the example, 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 {@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/agent_service.delete_example.js - * region_tag:ces_v1_generated_AgentService_DeleteExample_async - */ - deleteExample( - request?: protos.google.cloud.ces.v1.IDeleteExampleRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteExampleRequest|undefined, {}|undefined - ]>; - deleteExample( - request: protos.google.cloud.ces.v1.IDeleteExampleRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteExampleRequest|null|undefined, - {}|null|undefined>): void; - deleteExample( - request: protos.google.cloud.ces.v1.IDeleteExampleRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteExampleRequest|null|undefined, - {}|null|undefined>): void; - deleteExample( - request?: protos.google.cloud.ces.v1.IDeleteExampleRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteExampleRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteExampleRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteExampleRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteExample request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteExampleRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteExample response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteExample(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteExampleRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteExample response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets details of the specified tool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the tool to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Tool|Tool}. - * 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/agent_service.get_tool.js - * region_tag:ces_v1_generated_AgentService_GetTool_async - */ - getTool( - request?: protos.google.cloud.ces.v1.IGetToolRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.IGetToolRequest|undefined, {}|undefined - ]>; - getTool( - request: protos.google.cloud.ces.v1.IGetToolRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.IGetToolRequest|null|undefined, - {}|null|undefined>): void; - getTool( - request: protos.google.cloud.ces.v1.IGetToolRequest, - callback: Callback< - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.IGetToolRequest|null|undefined, - {}|null|undefined>): void; - getTool( - request?: protos.google.cloud.ces.v1.IGetToolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.IGetToolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.IGetToolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.IGetToolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getTool request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.IGetToolRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getTool response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getTool(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.IGetToolRequest|undefined, - {}|undefined - ]) => { - this._log.info('getTool response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets details of the specified conversation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the conversation to retrieve. - * @param {google.cloud.ces.v1.Conversation.Source} [request.source] - * Optional. Indicate the source of the conversation. If not set, all source - * will be searched. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Conversation|Conversation}. - * 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/agent_service.get_conversation.js - * region_tag:ces_v1_generated_AgentService_GetConversation_async - */ - getConversation( - request?: protos.google.cloud.ces.v1.IGetConversationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IConversation, - protos.google.cloud.ces.v1.IGetConversationRequest|undefined, {}|undefined - ]>; - getConversation( - request: protos.google.cloud.ces.v1.IGetConversationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IConversation, - protos.google.cloud.ces.v1.IGetConversationRequest|null|undefined, - {}|null|undefined>): void; - getConversation( - request: protos.google.cloud.ces.v1.IGetConversationRequest, - callback: Callback< - protos.google.cloud.ces.v1.IConversation, - protos.google.cloud.ces.v1.IGetConversationRequest|null|undefined, - {}|null|undefined>): void; - getConversation( - request?: protos.google.cloud.ces.v1.IGetConversationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IConversation, - protos.google.cloud.ces.v1.IGetConversationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IConversation, - protos.google.cloud.ces.v1.IGetConversationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IConversation, - protos.google.cloud.ces.v1.IGetConversationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getConversation request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IConversation, - protos.google.cloud.ces.v1.IGetConversationRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getConversation response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getConversation(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IConversation, - protos.google.cloud.ces.v1.IGetConversationRequest|undefined, - {}|undefined - ]) => { - this._log.info('getConversation response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes the specified conversation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the conversation to delete. - * @param {google.cloud.ces.v1.Conversation.Source} [request.source] - * Optional. Indicate the source of the conversation. If not set, Source.Live - * will be applied by default. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/agent_service.delete_conversation.js - * region_tag:ces_v1_generated_AgentService_DeleteConversation_async - */ - deleteConversation( - request?: protos.google.cloud.ces.v1.IDeleteConversationRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteConversationRequest|undefined, {}|undefined - ]>; - deleteConversation( - request: protos.google.cloud.ces.v1.IDeleteConversationRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteConversationRequest|null|undefined, - {}|null|undefined>): void; - deleteConversation( - request: protos.google.cloud.ces.v1.IDeleteConversationRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteConversationRequest|null|undefined, - {}|null|undefined>): void; - deleteConversation( - request?: protos.google.cloud.ces.v1.IDeleteConversationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteConversationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteConversationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteConversationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteConversation request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteConversationRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteConversation response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteConversation(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteConversationRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteConversation response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a new tool in the given app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to create a tool in. - * @param {string} [request.toolId] - * Optional. The ID to use for the tool, which will become the final component - * of the tool's resource name. If not provided, a unique ID will be - * automatically assigned for the tool. - * @param {google.cloud.ces.v1.Tool} request.tool - * Required. The tool to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Tool|Tool}. - * 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/agent_service.create_tool.js - * region_tag:ces_v1_generated_AgentService_CreateTool_async - */ - createTool( - request?: protos.google.cloud.ces.v1.ICreateToolRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.ICreateToolRequest|undefined, {}|undefined - ]>; - createTool( - request: protos.google.cloud.ces.v1.ICreateToolRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.ICreateToolRequest|null|undefined, - {}|null|undefined>): void; - createTool( - request: protos.google.cloud.ces.v1.ICreateToolRequest, - callback: Callback< - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.ICreateToolRequest|null|undefined, - {}|null|undefined>): void; - createTool( - request?: protos.google.cloud.ces.v1.ICreateToolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.ICreateToolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.ICreateToolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.ICreateToolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createTool request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.ICreateToolRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createTool response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createTool(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.ICreateToolRequest|undefined, - {}|undefined - ]) => { - this._log.info('createTool response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates the specified tool. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.ces.v1.Tool} request.tool - * Required. The tool to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. Field mask is used to control which fields get updated. If the - * mask is not present, all fields will be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Tool|Tool}. - * 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/agent_service.update_tool.js - * region_tag:ces_v1_generated_AgentService_UpdateTool_async - */ - updateTool( - request?: protos.google.cloud.ces.v1.IUpdateToolRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.IUpdateToolRequest|undefined, {}|undefined - ]>; - updateTool( - request: protos.google.cloud.ces.v1.IUpdateToolRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.IUpdateToolRequest|null|undefined, - {}|null|undefined>): void; - updateTool( - request: protos.google.cloud.ces.v1.IUpdateToolRequest, - callback: Callback< - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.IUpdateToolRequest|null|undefined, - {}|null|undefined>): void; - updateTool( - request?: protos.google.cloud.ces.v1.IUpdateToolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.IUpdateToolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.IUpdateToolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.IUpdateToolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'tool.name': request.tool!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateTool request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.IUpdateToolRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateTool response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateTool(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.ITool, - protos.google.cloud.ces.v1.IUpdateToolRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateTool response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes the specified tool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the tool to delete. - * @param {boolean} [request.force] - * Optional. Indicates whether to forcefully delete the tool, even if it is - * still referenced by agents/examples. - * - * * If `force = false`, the deletion will fail if any agents still - * reference the tool. - * * If `force = true`, all existing references from agents will be removed - * and the tool will be deleted. - * @param {string} [request.etag] - * Optional. The current etag of the tool. If an etag is not provided, the - * deletion will overwrite any concurrent changes. If an etag is provided and - * does not match the current etag of the tool, 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 {@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/agent_service.delete_tool.js - * region_tag:ces_v1_generated_AgentService_DeleteTool_async - */ - deleteTool( - request?: protos.google.cloud.ces.v1.IDeleteToolRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteToolRequest|undefined, {}|undefined - ]>; - deleteTool( - request: protos.google.cloud.ces.v1.IDeleteToolRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteToolRequest|null|undefined, - {}|null|undefined>): void; - deleteTool( - request: protos.google.cloud.ces.v1.IDeleteToolRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteToolRequest|null|undefined, - {}|null|undefined>): void; - deleteTool( - request?: protos.google.cloud.ces.v1.IDeleteToolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteToolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteToolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteToolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteTool request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteToolRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteTool response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteTool(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteToolRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteTool response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets details of the specified guardrail. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the guardrail to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Guardrail|Guardrail}. - * 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/agent_service.get_guardrail.js - * region_tag:ces_v1_generated_AgentService_GetGuardrail_async - */ - getGuardrail( - request?: protos.google.cloud.ces.v1.IGetGuardrailRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.IGetGuardrailRequest|undefined, {}|undefined - ]>; - getGuardrail( - request: protos.google.cloud.ces.v1.IGetGuardrailRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.IGetGuardrailRequest|null|undefined, - {}|null|undefined>): void; - getGuardrail( - request: protos.google.cloud.ces.v1.IGetGuardrailRequest, - callback: Callback< - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.IGetGuardrailRequest|null|undefined, - {}|null|undefined>): void; - getGuardrail( - request?: protos.google.cloud.ces.v1.IGetGuardrailRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.IGetGuardrailRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.IGetGuardrailRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.IGetGuardrailRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getGuardrail request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.IGetGuardrailRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getGuardrail response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getGuardrail(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.IGetGuardrailRequest|undefined, - {}|undefined - ]) => { - this._log.info('getGuardrail response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a new guardrail in the given app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to create a guardrail in. - * @param {string} [request.guardrailId] - * Optional. The ID to use for the guardrail, which will become the final - * component of the guardrail's resource name. If not provided, a unique ID - * will be automatically assigned for the guardrail. - * @param {google.cloud.ces.v1.Guardrail} request.guardrail - * Required. The guardrail to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Guardrail|Guardrail}. - * 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/agent_service.create_guardrail.js - * region_tag:ces_v1_generated_AgentService_CreateGuardrail_async - */ - createGuardrail( - request?: protos.google.cloud.ces.v1.ICreateGuardrailRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.ICreateGuardrailRequest|undefined, {}|undefined - ]>; - createGuardrail( - request: protos.google.cloud.ces.v1.ICreateGuardrailRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.ICreateGuardrailRequest|null|undefined, - {}|null|undefined>): void; - createGuardrail( - request: protos.google.cloud.ces.v1.ICreateGuardrailRequest, - callback: Callback< - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.ICreateGuardrailRequest|null|undefined, - {}|null|undefined>): void; - createGuardrail( - request?: protos.google.cloud.ces.v1.ICreateGuardrailRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.ICreateGuardrailRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.ICreateGuardrailRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.ICreateGuardrailRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createGuardrail request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.ICreateGuardrailRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createGuardrail response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createGuardrail(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.ICreateGuardrailRequest|undefined, - {}|undefined - ]) => { - this._log.info('createGuardrail response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates the specified guardrail. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.ces.v1.Guardrail} request.guardrail - * Required. The guardrail to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. Field mask is used to control which fields get updated. If the - * mask is not present, all fields will be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Guardrail|Guardrail}. - * 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/agent_service.update_guardrail.js - * region_tag:ces_v1_generated_AgentService_UpdateGuardrail_async - */ - updateGuardrail( - request?: protos.google.cloud.ces.v1.IUpdateGuardrailRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.IUpdateGuardrailRequest|undefined, {}|undefined - ]>; - updateGuardrail( - request: protos.google.cloud.ces.v1.IUpdateGuardrailRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.IUpdateGuardrailRequest|null|undefined, - {}|null|undefined>): void; - updateGuardrail( - request: protos.google.cloud.ces.v1.IUpdateGuardrailRequest, - callback: Callback< - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.IUpdateGuardrailRequest|null|undefined, - {}|null|undefined>): void; - updateGuardrail( - request?: protos.google.cloud.ces.v1.IUpdateGuardrailRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.IUpdateGuardrailRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.IUpdateGuardrailRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.IUpdateGuardrailRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'guardrail.name': request.guardrail!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateGuardrail request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.IUpdateGuardrailRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateGuardrail response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateGuardrail(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IGuardrail, - protos.google.cloud.ces.v1.IUpdateGuardrailRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateGuardrail response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes the specified guardrail. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the guardrail to delete. - * @param {boolean} [request.force] - * Optional. Indicates whether to forcefully delete the guardrail, even if it - * is still referenced by app/agents. - * - * * If `force = false`, the deletion fails if any apps/agents still - * reference the guardrail. - * * If `force = true`, all existing references from apps/agents will be - * removed and the guardrail will be deleted. - * @param {string} [request.etag] - * Optional. The current etag of the guardrail. If an etag is not provided, - * the deletion will overwrite any concurrent changes. If an etag is provided - * and does not match the current etag of the guardrail, 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 {@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/agent_service.delete_guardrail.js - * region_tag:ces_v1_generated_AgentService_DeleteGuardrail_async - */ - deleteGuardrail( - request?: protos.google.cloud.ces.v1.IDeleteGuardrailRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteGuardrailRequest|undefined, {}|undefined - ]>; - deleteGuardrail( - request: protos.google.cloud.ces.v1.IDeleteGuardrailRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteGuardrailRequest|null|undefined, - {}|null|undefined>): void; - deleteGuardrail( - request: protos.google.cloud.ces.v1.IDeleteGuardrailRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteGuardrailRequest|null|undefined, - {}|null|undefined>): void; - deleteGuardrail( - request?: protos.google.cloud.ces.v1.IDeleteGuardrailRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteGuardrailRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteGuardrailRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteGuardrailRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteGuardrail request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteGuardrailRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteGuardrail response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteGuardrail(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteGuardrailRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteGuardrail response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets details of the specified deployment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the deployment. - * Format: - * `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Deployment|Deployment}. - * 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/agent_service.get_deployment.js - * region_tag:ces_v1_generated_AgentService_GetDeployment_async - */ - getDeployment( - request?: protos.google.cloud.ces.v1.IGetDeploymentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.IGetDeploymentRequest|undefined, {}|undefined - ]>; - getDeployment( - request: protos.google.cloud.ces.v1.IGetDeploymentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.IGetDeploymentRequest|null|undefined, - {}|null|undefined>): void; - getDeployment( - request: protos.google.cloud.ces.v1.IGetDeploymentRequest, - callback: Callback< - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.IGetDeploymentRequest|null|undefined, - {}|null|undefined>): void; - getDeployment( - request?: protos.google.cloud.ces.v1.IGetDeploymentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.IGetDeploymentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.IGetDeploymentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.IGetDeploymentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getDeployment request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.IGetDeploymentRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getDeployment response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getDeployment(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.IGetDeploymentRequest|undefined, - {}|undefined - ]) => { - this._log.info('getDeployment response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a new deployment in the given app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent app. - * Format: - * `projects/{project}/locations/{location}/apps/{app}` - * @param {string} [request.deploymentId] - * Optional. The ID to use for the deployment, which will become the final - * component of the deployment's resource name. If not provided, a unique ID - * will be automatically assigned for the deployment. - * @param {google.cloud.ces.v1.Deployment} request.deployment - * Required. The deployment to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Deployment|Deployment}. - * 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/agent_service.create_deployment.js - * region_tag:ces_v1_generated_AgentService_CreateDeployment_async - */ - createDeployment( - request?: protos.google.cloud.ces.v1.ICreateDeploymentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.ICreateDeploymentRequest|undefined, {}|undefined - ]>; - createDeployment( - request: protos.google.cloud.ces.v1.ICreateDeploymentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.ICreateDeploymentRequest|null|undefined, - {}|null|undefined>): void; - createDeployment( - request: protos.google.cloud.ces.v1.ICreateDeploymentRequest, - callback: Callback< - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.ICreateDeploymentRequest|null|undefined, - {}|null|undefined>): void; - createDeployment( - request?: protos.google.cloud.ces.v1.ICreateDeploymentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.ICreateDeploymentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.ICreateDeploymentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.ICreateDeploymentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createDeployment request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.ICreateDeploymentRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createDeployment response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createDeployment(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.ICreateDeploymentRequest|undefined, - {}|undefined - ]) => { - this._log.info('createDeployment response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates the specified deployment. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.ces.v1.Deployment} request.deployment - * Required. The deployment to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The list of fields to update. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Deployment|Deployment}. - * 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/agent_service.update_deployment.js - * region_tag:ces_v1_generated_AgentService_UpdateDeployment_async - */ - updateDeployment( - request?: protos.google.cloud.ces.v1.IUpdateDeploymentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.IUpdateDeploymentRequest|undefined, {}|undefined - ]>; - updateDeployment( - request: protos.google.cloud.ces.v1.IUpdateDeploymentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.IUpdateDeploymentRequest|null|undefined, - {}|null|undefined>): void; - updateDeployment( - request: protos.google.cloud.ces.v1.IUpdateDeploymentRequest, - callback: Callback< - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.IUpdateDeploymentRequest|null|undefined, - {}|null|undefined>): void; - updateDeployment( - request?: protos.google.cloud.ces.v1.IUpdateDeploymentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.IUpdateDeploymentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.IUpdateDeploymentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.IUpdateDeploymentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'deployment.name': request.deployment!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateDeployment request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.IUpdateDeploymentRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateDeployment response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateDeployment(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IDeployment, - protos.google.cloud.ces.v1.IUpdateDeploymentRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateDeployment response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes the specified deployment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the deployment to delete. - * Format: - * `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` - * @param {string} [request.etag] - * Optional. The etag of the deployment. - * If an etag is provided and does not match the current etag of the - * deployment, 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 {@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/agent_service.delete_deployment.js - * region_tag:ces_v1_generated_AgentService_DeleteDeployment_async - */ - deleteDeployment( - request?: protos.google.cloud.ces.v1.IDeleteDeploymentRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteDeploymentRequest|undefined, {}|undefined - ]>; - deleteDeployment( - request: protos.google.cloud.ces.v1.IDeleteDeploymentRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteDeploymentRequest|null|undefined, - {}|null|undefined>): void; - deleteDeployment( - request: protos.google.cloud.ces.v1.IDeleteDeploymentRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteDeploymentRequest|null|undefined, - {}|null|undefined>): void; - deleteDeployment( - request?: protos.google.cloud.ces.v1.IDeleteDeploymentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteDeploymentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteDeploymentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteDeploymentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteDeployment request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteDeploymentRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteDeployment response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteDeployment(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteDeploymentRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteDeployment response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets details of the specified toolset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the toolset to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Toolset|Toolset}. - * 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/agent_service.get_toolset.js - * region_tag:ces_v1_generated_AgentService_GetToolset_async - */ - getToolset( - request?: protos.google.cloud.ces.v1.IGetToolsetRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.IGetToolsetRequest|undefined, {}|undefined - ]>; - getToolset( - request: protos.google.cloud.ces.v1.IGetToolsetRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.IGetToolsetRequest|null|undefined, - {}|null|undefined>): void; - getToolset( - request: protos.google.cloud.ces.v1.IGetToolsetRequest, - callback: Callback< - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.IGetToolsetRequest|null|undefined, - {}|null|undefined>): void; - getToolset( - request?: protos.google.cloud.ces.v1.IGetToolsetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.IGetToolsetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.IGetToolsetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.IGetToolsetRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getToolset request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.IGetToolsetRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getToolset response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getToolset(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.IGetToolsetRequest|undefined, - {}|undefined - ]) => { - this._log.info('getToolset response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a new toolset in the given app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to create a toolset in. - * @param {string} [request.toolsetId] - * Optional. The ID to use for the toolset, which will become the final - * component of the toolset's resource name. If not provided, a unique ID will - * be automatically assigned for the toolset. - * @param {google.cloud.ces.v1.Toolset} request.toolset - * Required. The toolset to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Toolset|Toolset}. - * 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/agent_service.create_toolset.js - * region_tag:ces_v1_generated_AgentService_CreateToolset_async - */ - createToolset( - request?: protos.google.cloud.ces.v1.ICreateToolsetRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.ICreateToolsetRequest|undefined, {}|undefined - ]>; - createToolset( - request: protos.google.cloud.ces.v1.ICreateToolsetRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.ICreateToolsetRequest|null|undefined, - {}|null|undefined>): void; - createToolset( - request: protos.google.cloud.ces.v1.ICreateToolsetRequest, - callback: Callback< - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.ICreateToolsetRequest|null|undefined, - {}|null|undefined>): void; - createToolset( - request?: protos.google.cloud.ces.v1.ICreateToolsetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.ICreateToolsetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.ICreateToolsetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.ICreateToolsetRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createToolset request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.ICreateToolsetRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createToolset response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createToolset(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.ICreateToolsetRequest|undefined, - {}|undefined - ]) => { - this._log.info('createToolset response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates the specified toolset. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.ces.v1.Toolset} request.toolset - * Required. The toolset to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. Field mask is used to control which fields get updated. If the - * mask is not present, all fields will be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Toolset|Toolset}. - * 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/agent_service.update_toolset.js - * region_tag:ces_v1_generated_AgentService_UpdateToolset_async - */ - updateToolset( - request?: protos.google.cloud.ces.v1.IUpdateToolsetRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.IUpdateToolsetRequest|undefined, {}|undefined - ]>; - updateToolset( - request: protos.google.cloud.ces.v1.IUpdateToolsetRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.IUpdateToolsetRequest|null|undefined, - {}|null|undefined>): void; - updateToolset( - request: protos.google.cloud.ces.v1.IUpdateToolsetRequest, - callback: Callback< - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.IUpdateToolsetRequest|null|undefined, - {}|null|undefined>): void; - updateToolset( - request?: protos.google.cloud.ces.v1.IUpdateToolsetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.IUpdateToolsetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.IUpdateToolsetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.IUpdateToolsetRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'toolset.name': request.toolset!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateToolset request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.IUpdateToolsetRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateToolset response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateToolset(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IToolset, - protos.google.cloud.ces.v1.IUpdateToolsetRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateToolset response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes the specified toolset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the toolset to delete. - * @param {boolean} [request.force] - * Optional. Indicates whether to forcefully delete the toolset, even if it is - * still referenced by app/agents. - * - * * If `force = false`, the deletion fails if any agents still - * reference the toolset. - * * If `force = true`, all existing references from agents will be - * removed and the toolset will be deleted. - * @param {string} [request.etag] - * Optional. The current etag of the toolset. If an etag is not provided, the - * deletion will overwrite any concurrent changes. If an etag is provided and - * does not match the current etag of the toolset, 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 {@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/agent_service.delete_toolset.js - * region_tag:ces_v1_generated_AgentService_DeleteToolset_async - */ - deleteToolset( - request?: protos.google.cloud.ces.v1.IDeleteToolsetRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteToolsetRequest|undefined, {}|undefined - ]>; - deleteToolset( - request: protos.google.cloud.ces.v1.IDeleteToolsetRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteToolsetRequest|null|undefined, - {}|null|undefined>): void; - deleteToolset( - request: protos.google.cloud.ces.v1.IDeleteToolsetRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteToolsetRequest|null|undefined, - {}|null|undefined>): void; - deleteToolset( - request?: protos.google.cloud.ces.v1.IDeleteToolsetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteToolsetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteToolsetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteToolsetRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteToolset request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteToolsetRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteToolset response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteToolset(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteToolsetRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteToolset response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets details of the specified app version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the app version to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.AppVersion|AppVersion}. - * 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/agent_service.get_app_version.js - * region_tag:ces_v1_generated_AgentService_GetAppVersion_async - */ - getAppVersion( - request?: protos.google.cloud.ces.v1.IGetAppVersionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IAppVersion, - protos.google.cloud.ces.v1.IGetAppVersionRequest|undefined, {}|undefined - ]>; - getAppVersion( - request: protos.google.cloud.ces.v1.IGetAppVersionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IAppVersion, - protos.google.cloud.ces.v1.IGetAppVersionRequest|null|undefined, - {}|null|undefined>): void; - getAppVersion( - request: protos.google.cloud.ces.v1.IGetAppVersionRequest, - callback: Callback< - protos.google.cloud.ces.v1.IAppVersion, - protos.google.cloud.ces.v1.IGetAppVersionRequest|null|undefined, - {}|null|undefined>): void; - getAppVersion( - request?: protos.google.cloud.ces.v1.IGetAppVersionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IAppVersion, - protos.google.cloud.ces.v1.IGetAppVersionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IAppVersion, - protos.google.cloud.ces.v1.IGetAppVersionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IAppVersion, - protos.google.cloud.ces.v1.IGetAppVersionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getAppVersion request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IAppVersion, - protos.google.cloud.ces.v1.IGetAppVersionRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getAppVersion response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getAppVersion(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IAppVersion, - protos.google.cloud.ces.v1.IGetAppVersionRequest|undefined, - {}|undefined - ]) => { - this._log.info('getAppVersion response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a new app version in the given app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to create an app version in. - * @param {string} [request.appVersionId] - * Optional. The ID to use for the app version, which will become the final - * component of the app version's resource name. If not provided, a unique ID - * will be automatically assigned for the app version. - * @param {google.cloud.ces.v1.AppVersion} request.appVersion - * Required. The app version to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.AppVersion|AppVersion}. - * 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/agent_service.create_app_version.js - * region_tag:ces_v1_generated_AgentService_CreateAppVersion_async - */ - createAppVersion( - request?: protos.google.cloud.ces.v1.ICreateAppVersionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IAppVersion, - protos.google.cloud.ces.v1.ICreateAppVersionRequest|undefined, {}|undefined - ]>; - createAppVersion( - request: protos.google.cloud.ces.v1.ICreateAppVersionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IAppVersion, - protos.google.cloud.ces.v1.ICreateAppVersionRequest|null|undefined, - {}|null|undefined>): void; - createAppVersion( - request: protos.google.cloud.ces.v1.ICreateAppVersionRequest, - callback: Callback< - protos.google.cloud.ces.v1.IAppVersion, - protos.google.cloud.ces.v1.ICreateAppVersionRequest|null|undefined, - {}|null|undefined>): void; - createAppVersion( - request?: protos.google.cloud.ces.v1.ICreateAppVersionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IAppVersion, - protos.google.cloud.ces.v1.ICreateAppVersionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IAppVersion, - protos.google.cloud.ces.v1.ICreateAppVersionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IAppVersion, - protos.google.cloud.ces.v1.ICreateAppVersionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createAppVersion request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IAppVersion, - protos.google.cloud.ces.v1.ICreateAppVersionRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createAppVersion response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createAppVersion(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IAppVersion, - protos.google.cloud.ces.v1.ICreateAppVersionRequest|undefined, - {}|undefined - ]) => { - this._log.info('createAppVersion response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes the specified app version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the app version to delete. - * @param {string} [request.etag] - * Optional. The current etag of the app version. If an etag is not provided, - * the deletion will overwrite any concurrent changes. If an etag is provided - * and does not match the current etag of the app version, 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 {@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/agent_service.delete_app_version.js - * region_tag:ces_v1_generated_AgentService_DeleteAppVersion_async - */ - deleteAppVersion( - request?: protos.google.cloud.ces.v1.IDeleteAppVersionRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteAppVersionRequest|undefined, {}|undefined - ]>; - deleteAppVersion( - request: protos.google.cloud.ces.v1.IDeleteAppVersionRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteAppVersionRequest|null|undefined, - {}|null|undefined>): void; - deleteAppVersion( - request: protos.google.cloud.ces.v1.IDeleteAppVersionRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteAppVersionRequest|null|undefined, - {}|null|undefined>): void; - deleteAppVersion( - request?: protos.google.cloud.ces.v1.IDeleteAppVersionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteAppVersionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteAppVersionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteAppVersionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteAppVersion request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteAppVersionRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteAppVersion response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteAppVersion(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.ces.v1.IDeleteAppVersionRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteAppVersion response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets the specified changelog. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the changelog to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.Changelog|Changelog}. - * 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/agent_service.get_changelog.js - * region_tag:ces_v1_generated_AgentService_GetChangelog_async - */ - getChangelog( - request?: protos.google.cloud.ces.v1.IGetChangelogRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IChangelog, - protos.google.cloud.ces.v1.IGetChangelogRequest|undefined, {}|undefined - ]>; - getChangelog( - request: protos.google.cloud.ces.v1.IGetChangelogRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IChangelog, - protos.google.cloud.ces.v1.IGetChangelogRequest|null|undefined, - {}|null|undefined>): void; - getChangelog( - request: protos.google.cloud.ces.v1.IGetChangelogRequest, - callback: Callback< - protos.google.cloud.ces.v1.IChangelog, - protos.google.cloud.ces.v1.IGetChangelogRequest|null|undefined, - {}|null|undefined>): void; - getChangelog( - request?: protos.google.cloud.ces.v1.IGetChangelogRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IChangelog, - protos.google.cloud.ces.v1.IGetChangelogRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IChangelog, - protos.google.cloud.ces.v1.IGetChangelogRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IChangelog, - protos.google.cloud.ces.v1.IGetChangelogRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getChangelog request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IChangelog, - protos.google.cloud.ces.v1.IGetChangelogRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getChangelog response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getChangelog(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IChangelog, - protos.google.cloud.ces.v1.IGetChangelogRequest|undefined, - {}|undefined - ]) => { - this._log.info('getChangelog response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Creates a new app in the given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location to create an app in. - * @param {string} [request.appId] - * Optional. The ID to use for the app, which will become the final component - * of the app's resource name. If not provided, a unique ID will be - * automatically assigned for the app. - * @param {google.cloud.ces.v1.App} request.app - * Required. The app to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/agent_service.create_app.js - * region_tag:ces_v1_generated_AgentService_CreateApp_async - */ - createApp( - request?: protos.google.cloud.ces.v1.ICreateAppRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createApp( - request: protos.google.cloud.ces.v1.ICreateAppRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createApp( - request: protos.google.cloud.ces.v1.ICreateAppRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createApp( - request?: protos.google.cloud.ces.v1.ICreateAppRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createApp response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createApp request %j', request); - return this.innerApiCalls.createApp(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createApp response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createApp()`. - * @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/agent_service.create_app.js - * region_tag:ces_v1_generated_AgentService_CreateApp_async - */ - async checkCreateAppProgress(name: string): Promise>{ - this._log.info('createApp long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createApp, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes the specified app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the app to delete. - * @param {string} [request.etag] - * Optional. The current etag of the app. If an etag is not provided, the - * deletion will overwrite any concurrent changes. If an etag is provided and - * does not match the current etag of the app, 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/agent_service.delete_app.js - * region_tag:ces_v1_generated_AgentService_DeleteApp_async - */ - deleteApp( - request?: protos.google.cloud.ces.v1.IDeleteAppRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteApp( - request: protos.google.cloud.ces.v1.IDeleteAppRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteApp( - request: protos.google.cloud.ces.v1.IDeleteAppRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteApp( - request?: protos.google.cloud.ces.v1.IDeleteAppRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteApp response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteApp request %j', request); - return this.innerApiCalls.deleteApp(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteApp response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteApp()`. - * @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/agent_service.delete_app.js - * region_tag:ces_v1_generated_AgentService_DeleteApp_async - */ - async checkDeleteAppProgress(name: string): Promise>{ - this._log.info('deleteApp long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteApp, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Exports the specified app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the app to export. - * @param {google.cloud.ces.v1.ExportAppRequest.ExportFormat} request.exportFormat - * Required. The format to export the app in. - * @param {string} [request.gcsUri] - * Optional. The [Google Cloud - * Storage](https://cloud.google.com/storage/docs/) URI to which to export the - * app. The format of this URI must be `gs:///`. The - * exported app archive will be written directly to the specified GCS object. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/agent_service.export_app.js - * region_tag:ces_v1_generated_AgentService_ExportApp_async - */ - exportApp( - request?: protos.google.cloud.ces.v1.IExportAppRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - exportApp( - request: protos.google.cloud.ces.v1.IExportAppRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportApp( - request: protos.google.cloud.ces.v1.IExportAppRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportApp( - request?: protos.google.cloud.ces.v1.IExportAppRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('exportApp response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('exportApp request %j', request); - return this.innerApiCalls.exportApp(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('exportApp response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `exportApp()`. - * @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/agent_service.export_app.js - * region_tag:ces_v1_generated_AgentService_ExportApp_async - */ - async checkExportAppProgress(name: string): Promise>{ - this._log.info('exportApp long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportApp, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Imports the specified app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.gcsUri - * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI - * from which to import app. The format of this URI must be - * `gs:///`. - * @param {Buffer} request.appContent - * Raw bytes representing the compressed zip file with the app folder - * structure. - * @param {string} request.parent - * Required. The parent resource name with the location of the app to import. - * @param {string} [request.displayName] - * Optional. The display name of the app to import. - * * If the app is created on import, and the display name is specified, - * the imported app will use this display name. If a conflict is detected - * with an existing app, a timestamp will be appended to the display name - * to make it unique. - * * If the app is a reimport, this field should not be set. Providing a - * display name during reimport will result in an INVALID_ARGUMENT error. - * @param {string} [request.appId] - * Optional. The ID to use for the imported app. - * * If not specified, a unique ID will be automatically assigned for - * the app. - * * Otherwise, the imported app will use this ID as the final component of - * its resource name. If an app with the same ID already exists at the - * specified location in the project, the content of the existing app will be - * replaced. - * @param {google.cloud.ces.v1.ImportAppRequest.ImportOptions} [request.importOptions] - * Optional. Options governing the import process for the app. - * @param {boolean} [request.ignoreAppLock] - * Optional. Flag for overriding the app lock during import. - * If set to true, the import process will ignore the app lock. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/agent_service.import_app.js - * region_tag:ces_v1_generated_AgentService_ImportApp_async - */ - importApp( - request?: protos.google.cloud.ces.v1.IImportAppRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - importApp( - request: protos.google.cloud.ces.v1.IImportAppRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importApp( - request: protos.google.cloud.ces.v1.IImportAppRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importApp( - request?: protos.google.cloud.ces.v1.IImportAppRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('importApp response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('importApp request %j', request); - return this.innerApiCalls.importApp(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('importApp response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `importApp()`. - * @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/agent_service.import_app.js - * region_tag:ces_v1_generated_AgentService_ImportApp_async - */ - async checkImportAppProgress(name: string): Promise>{ - this._log.info('importApp long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importApp, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Batch deletes the specified conversations. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to delete conversations from. - * Format: - * `projects/{project}/locations/{location}/apps/{app}` - * @param {string[]} request.conversations - * Required. The resource names of the conversations to 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/v1/agent_service.batch_delete_conversations.js - * region_tag:ces_v1_generated_AgentService_BatchDeleteConversations_async - */ - batchDeleteConversations( - request?: protos.google.cloud.ces.v1.IBatchDeleteConversationsRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - batchDeleteConversations( - request: protos.google.cloud.ces.v1.IBatchDeleteConversationsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchDeleteConversations( - request: protos.google.cloud.ces.v1.IBatchDeleteConversationsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchDeleteConversations( - request?: protos.google.cloud.ces.v1.IBatchDeleteConversationsRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('batchDeleteConversations response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('batchDeleteConversations request %j', request); - return this.innerApiCalls.batchDeleteConversations(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('batchDeleteConversations response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `batchDeleteConversations()`. - * @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/agent_service.batch_delete_conversations.js - * region_tag:ces_v1_generated_AgentService_BatchDeleteConversations_async - */ - async checkBatchDeleteConversationsProgress(name: string): Promise>{ - this._log.info('batchDeleteConversations long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchDeleteConversations, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Restores the specified app version. - * This will create a new app version from the current draft app and overwrite - * the current draft with the specified app version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the app version to restore. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/agent_service.restore_app_version.js - * region_tag:ces_v1_generated_AgentService_RestoreAppVersion_async - */ - restoreAppVersion( - request?: protos.google.cloud.ces.v1.IRestoreAppVersionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - restoreAppVersion( - request: protos.google.cloud.ces.v1.IRestoreAppVersionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreAppVersion( - request: protos.google.cloud.ces.v1.IRestoreAppVersionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreAppVersion( - request?: protos.google.cloud.ces.v1.IRestoreAppVersionRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('restoreAppVersion response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('restoreAppVersion request %j', request); - return this.innerApiCalls.restoreAppVersion(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('restoreAppVersion response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `restoreAppVersion()`. - * @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/agent_service.restore_app_version.js - * region_tag:ces_v1_generated_AgentService_RestoreAppVersion_async - */ - async checkRestoreAppVersionProgress(name: string): Promise>{ - this._log.info('restoreAppVersion long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreAppVersion, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists apps in the given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location to list apps from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListAppsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListApps|AgentService.ListApps} call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the apps. - * See https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.App|App}. - * 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 `listAppsAsync()` - * 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. - */ - listApps( - request?: protos.google.cloud.ces.v1.IListAppsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IApp[], - protos.google.cloud.ces.v1.IListAppsRequest|null, - protos.google.cloud.ces.v1.IListAppsResponse - ]>; - listApps( - request: protos.google.cloud.ces.v1.IListAppsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListAppsRequest, - protos.google.cloud.ces.v1.IListAppsResponse|null|undefined, - protos.google.cloud.ces.v1.IApp>): void; - listApps( - request: protos.google.cloud.ces.v1.IListAppsRequest, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListAppsRequest, - protos.google.cloud.ces.v1.IListAppsResponse|null|undefined, - protos.google.cloud.ces.v1.IApp>): void; - listApps( - request?: protos.google.cloud.ces.v1.IListAppsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.ces.v1.IListAppsRequest, - protos.google.cloud.ces.v1.IListAppsResponse|null|undefined, - protos.google.cloud.ces.v1.IApp>, - callback?: PaginationCallback< - protos.google.cloud.ces.v1.IListAppsRequest, - protos.google.cloud.ces.v1.IListAppsResponse|null|undefined, - protos.google.cloud.ces.v1.IApp>): - Promise<[ - protos.google.cloud.ces.v1.IApp[], - protos.google.cloud.ces.v1.IListAppsRequest|null, - protos.google.cloud.ces.v1.IListAppsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.ces.v1.IListAppsRequest, - protos.google.cloud.ces.v1.IListAppsResponse|null|undefined, - protos.google.cloud.ces.v1.IApp>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listApps values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listApps request %j', request); - return this.innerApiCalls - .listApps(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.ces.v1.IApp[], - protos.google.cloud.ces.v1.IListAppsRequest|null, - protos.google.cloud.ces.v1.IListAppsResponse - ]) => { - this._log.info('listApps values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listApps`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the location to list apps from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListAppsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListApps|AgentService.ListApps} call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the apps. - * See https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @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.ces.v1.App|App} 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 `listAppsAsync()` - * 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. - */ - listAppsStream( - request?: protos.google.cloud.ces.v1.IListAppsRequest, - 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['listApps']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listApps stream %j', request); - return this.descriptors.page.listApps.createStream( - this.innerApiCalls.listApps as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listApps`, 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 resource name of the location to list apps from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListAppsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListApps|AgentService.ListApps} call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the apps. - * See https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @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.ces.v1.App|App}. 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/agent_service.list_apps.js - * region_tag:ces_v1_generated_AgentService_ListApps_async - */ - listAppsAsync( - request?: protos.google.cloud.ces.v1.IListAppsRequest, - 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['listApps']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listApps iterate %j', request); - return this.descriptors.page.listApps.asyncIterate( - this.innerApiCalls['listApps'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists agents in the given app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to list agents from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListAgentsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListAgents|AgentService.ListAgents} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the agents. - * See https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.Agent|Agent}. - * 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 `listAgentsAsync()` - * 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. - */ - listAgents( - request?: protos.google.cloud.ces.v1.IListAgentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IAgent[], - protos.google.cloud.ces.v1.IListAgentsRequest|null, - protos.google.cloud.ces.v1.IListAgentsResponse - ]>; - listAgents( - request: protos.google.cloud.ces.v1.IListAgentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListAgentsRequest, - protos.google.cloud.ces.v1.IListAgentsResponse|null|undefined, - protos.google.cloud.ces.v1.IAgent>): void; - listAgents( - request: protos.google.cloud.ces.v1.IListAgentsRequest, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListAgentsRequest, - protos.google.cloud.ces.v1.IListAgentsResponse|null|undefined, - protos.google.cloud.ces.v1.IAgent>): void; - listAgents( - request?: protos.google.cloud.ces.v1.IListAgentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.ces.v1.IListAgentsRequest, - protos.google.cloud.ces.v1.IListAgentsResponse|null|undefined, - protos.google.cloud.ces.v1.IAgent>, - callback?: PaginationCallback< - protos.google.cloud.ces.v1.IListAgentsRequest, - protos.google.cloud.ces.v1.IListAgentsResponse|null|undefined, - protos.google.cloud.ces.v1.IAgent>): - Promise<[ - protos.google.cloud.ces.v1.IAgent[], - protos.google.cloud.ces.v1.IListAgentsRequest|null, - protos.google.cloud.ces.v1.IListAgentsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.ces.v1.IListAgentsRequest, - protos.google.cloud.ces.v1.IListAgentsResponse|null|undefined, - protos.google.cloud.ces.v1.IAgent>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listAgents values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listAgents request %j', request); - return this.innerApiCalls - .listAgents(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.ces.v1.IAgent[], - protos.google.cloud.ces.v1.IListAgentsRequest|null, - protos.google.cloud.ces.v1.IListAgentsResponse - ]) => { - this._log.info('listAgents values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listAgents`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to list agents from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListAgentsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListAgents|AgentService.ListAgents} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the agents. - * See https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @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.ces.v1.Agent|Agent} 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 `listAgentsAsync()` - * 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. - */ - listAgentsStream( - request?: protos.google.cloud.ces.v1.IListAgentsRequest, - 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['listAgents']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listAgents stream %j', request); - return this.descriptors.page.listAgents.createStream( - this.innerApiCalls.listAgents as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAgents`, 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 resource name of the app to list agents from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListAgentsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListAgents|AgentService.ListAgents} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the agents. - * See https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @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.ces.v1.Agent|Agent}. 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/agent_service.list_agents.js - * region_tag:ces_v1_generated_AgentService_ListAgents_async - */ - listAgentsAsync( - request?: protos.google.cloud.ces.v1.IListAgentsRequest, - 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['listAgents']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listAgents iterate %j', request); - return this.descriptors.page.listAgents.asyncIterate( - this.innerApiCalls['listAgents'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists examples in the given app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to list examples from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListExamplesResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListExamples|AgentService.ListExamples} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the examples. - * See https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.Example|Example}. - * 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 `listExamplesAsync()` - * 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. - */ - listExamples( - request?: protos.google.cloud.ces.v1.IListExamplesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IExample[], - protos.google.cloud.ces.v1.IListExamplesRequest|null, - protos.google.cloud.ces.v1.IListExamplesResponse - ]>; - listExamples( - request: protos.google.cloud.ces.v1.IListExamplesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListExamplesRequest, - protos.google.cloud.ces.v1.IListExamplesResponse|null|undefined, - protos.google.cloud.ces.v1.IExample>): void; - listExamples( - request: protos.google.cloud.ces.v1.IListExamplesRequest, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListExamplesRequest, - protos.google.cloud.ces.v1.IListExamplesResponse|null|undefined, - protos.google.cloud.ces.v1.IExample>): void; - listExamples( - request?: protos.google.cloud.ces.v1.IListExamplesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.ces.v1.IListExamplesRequest, - protos.google.cloud.ces.v1.IListExamplesResponse|null|undefined, - protos.google.cloud.ces.v1.IExample>, - callback?: PaginationCallback< - protos.google.cloud.ces.v1.IListExamplesRequest, - protos.google.cloud.ces.v1.IListExamplesResponse|null|undefined, - protos.google.cloud.ces.v1.IExample>): - Promise<[ - protos.google.cloud.ces.v1.IExample[], - protos.google.cloud.ces.v1.IListExamplesRequest|null, - protos.google.cloud.ces.v1.IListExamplesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.ces.v1.IListExamplesRequest, - protos.google.cloud.ces.v1.IListExamplesResponse|null|undefined, - protos.google.cloud.ces.v1.IExample>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listExamples values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listExamples request %j', request); - return this.innerApiCalls - .listExamples(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.ces.v1.IExample[], - protos.google.cloud.ces.v1.IListExamplesRequest|null, - protos.google.cloud.ces.v1.IListExamplesResponse - ]) => { - this._log.info('listExamples values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listExamples`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to list examples from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListExamplesResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListExamples|AgentService.ListExamples} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the examples. - * See https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @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.ces.v1.Example|Example} 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 `listExamplesAsync()` - * 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. - */ - listExamplesStream( - request?: protos.google.cloud.ces.v1.IListExamplesRequest, - 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['listExamples']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listExamples stream %j', request); - return this.descriptors.page.listExamples.createStream( - this.innerApiCalls.listExamples as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listExamples`, 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 resource name of the app to list examples from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListExamplesResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListExamples|AgentService.ListExamples} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the examples. - * See https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @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.ces.v1.Example|Example}. 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/agent_service.list_examples.js - * region_tag:ces_v1_generated_AgentService_ListExamples_async - */ - listExamplesAsync( - request?: protos.google.cloud.ces.v1.IListExamplesRequest, - 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['listExamples']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listExamples iterate %j', request); - return this.descriptors.page.listExamples.asyncIterate( - this.innerApiCalls['listExamples'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists tools in the given app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to list tools from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListToolsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListTools|AgentService.ListTools} call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the tools. Use - * "include_system_tools=true" to include system tools in the response. See - * https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.Tool|Tool}. - * 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 `listToolsAsync()` - * 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. - */ - listTools( - request?: protos.google.cloud.ces.v1.IListToolsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.ITool[], - protos.google.cloud.ces.v1.IListToolsRequest|null, - protos.google.cloud.ces.v1.IListToolsResponse - ]>; - listTools( - request: protos.google.cloud.ces.v1.IListToolsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListToolsRequest, - protos.google.cloud.ces.v1.IListToolsResponse|null|undefined, - protos.google.cloud.ces.v1.ITool>): void; - listTools( - request: protos.google.cloud.ces.v1.IListToolsRequest, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListToolsRequest, - protos.google.cloud.ces.v1.IListToolsResponse|null|undefined, - protos.google.cloud.ces.v1.ITool>): void; - listTools( - request?: protos.google.cloud.ces.v1.IListToolsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.ces.v1.IListToolsRequest, - protos.google.cloud.ces.v1.IListToolsResponse|null|undefined, - protos.google.cloud.ces.v1.ITool>, - callback?: PaginationCallback< - protos.google.cloud.ces.v1.IListToolsRequest, - protos.google.cloud.ces.v1.IListToolsResponse|null|undefined, - protos.google.cloud.ces.v1.ITool>): - Promise<[ - protos.google.cloud.ces.v1.ITool[], - protos.google.cloud.ces.v1.IListToolsRequest|null, - protos.google.cloud.ces.v1.IListToolsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.ces.v1.IListToolsRequest, - protos.google.cloud.ces.v1.IListToolsResponse|null|undefined, - protos.google.cloud.ces.v1.ITool>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listTools values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listTools request %j', request); - return this.innerApiCalls - .listTools(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.ces.v1.ITool[], - protos.google.cloud.ces.v1.IListToolsRequest|null, - protos.google.cloud.ces.v1.IListToolsResponse - ]) => { - this._log.info('listTools values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listTools`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to list tools from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListToolsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListTools|AgentService.ListTools} call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the tools. Use - * "include_system_tools=true" to include system tools in the response. See - * https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @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.ces.v1.Tool|Tool} 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 `listToolsAsync()` - * 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. - */ - listToolsStream( - request?: protos.google.cloud.ces.v1.IListToolsRequest, - 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['listTools']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listTools stream %j', request); - return this.descriptors.page.listTools.createStream( - this.innerApiCalls.listTools as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTools`, 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 resource name of the app to list tools from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListToolsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListTools|AgentService.ListTools} call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the tools. Use - * "include_system_tools=true" to include system tools in the response. See - * https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @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.ces.v1.Tool|Tool}. 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/agent_service.list_tools.js - * region_tag:ces_v1_generated_AgentService_ListTools_async - */ - listToolsAsync( - request?: protos.google.cloud.ces.v1.IListToolsRequest, - 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['listTools']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listTools iterate %j', request); - return this.descriptors.page.listTools.asyncIterate( - this.innerApiCalls['listTools'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists conversations in the given app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to list conversations from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListConversationsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListConversations|AgentService.ListConversations} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the conversations. - * See https://google.aip.dev/160 for more details. - * @param {google.cloud.ces.v1.Conversation.Source} [request.source] - * Optional. Indicate the source of the conversation. If not set, Source.Live - * will be applied by default. Will be deprecated in favor of `sources` field. - * @param {number[]} [request.sources] - * Optional. Indicate the sources of the conversations. If not set, all - * available sources will be applied by default. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.Conversation|Conversation}. - * 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 `listConversationsAsync()` - * 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. - */ - listConversations( - request?: protos.google.cloud.ces.v1.IListConversationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IConversation[], - protos.google.cloud.ces.v1.IListConversationsRequest|null, - protos.google.cloud.ces.v1.IListConversationsResponse - ]>; - listConversations( - request: protos.google.cloud.ces.v1.IListConversationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListConversationsRequest, - protos.google.cloud.ces.v1.IListConversationsResponse|null|undefined, - protos.google.cloud.ces.v1.IConversation>): void; - listConversations( - request: protos.google.cloud.ces.v1.IListConversationsRequest, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListConversationsRequest, - protos.google.cloud.ces.v1.IListConversationsResponse|null|undefined, - protos.google.cloud.ces.v1.IConversation>): void; - listConversations( - request?: protos.google.cloud.ces.v1.IListConversationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.ces.v1.IListConversationsRequest, - protos.google.cloud.ces.v1.IListConversationsResponse|null|undefined, - protos.google.cloud.ces.v1.IConversation>, - callback?: PaginationCallback< - protos.google.cloud.ces.v1.IListConversationsRequest, - protos.google.cloud.ces.v1.IListConversationsResponse|null|undefined, - protos.google.cloud.ces.v1.IConversation>): - Promise<[ - protos.google.cloud.ces.v1.IConversation[], - protos.google.cloud.ces.v1.IListConversationsRequest|null, - protos.google.cloud.ces.v1.IListConversationsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.ces.v1.IListConversationsRequest, - protos.google.cloud.ces.v1.IListConversationsResponse|null|undefined, - protos.google.cloud.ces.v1.IConversation>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listConversations values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listConversations request %j', request); - return this.innerApiCalls - .listConversations(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.ces.v1.IConversation[], - protos.google.cloud.ces.v1.IListConversationsRequest|null, - protos.google.cloud.ces.v1.IListConversationsResponse - ]) => { - this._log.info('listConversations values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listConversations`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to list conversations from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListConversationsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListConversations|AgentService.ListConversations} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the conversations. - * See https://google.aip.dev/160 for more details. - * @param {google.cloud.ces.v1.Conversation.Source} [request.source] - * Optional. Indicate the source of the conversation. If not set, Source.Live - * will be applied by default. Will be deprecated in favor of `sources` field. - * @param {number[]} [request.sources] - * Optional. Indicate the sources of the conversations. If not set, all - * available sources will be applied by default. - * @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.ces.v1.Conversation|Conversation} 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 `listConversationsAsync()` - * 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. - */ - listConversationsStream( - request?: protos.google.cloud.ces.v1.IListConversationsRequest, - 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['listConversations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listConversations stream %j', request); - return this.descriptors.page.listConversations.createStream( - this.innerApiCalls.listConversations as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listConversations`, 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 resource name of the app to list conversations from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListConversationsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListConversations|AgentService.ListConversations} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the conversations. - * See https://google.aip.dev/160 for more details. - * @param {google.cloud.ces.v1.Conversation.Source} [request.source] - * Optional. Indicate the source of the conversation. If not set, Source.Live - * will be applied by default. Will be deprecated in favor of `sources` field. - * @param {number[]} [request.sources] - * Optional. Indicate the sources of the conversations. If not set, all - * available sources will be applied by default. - * @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.ces.v1.Conversation|Conversation}. 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/agent_service.list_conversations.js - * region_tag:ces_v1_generated_AgentService_ListConversations_async - */ - listConversationsAsync( - request?: protos.google.cloud.ces.v1.IListConversationsRequest, - 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['listConversations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listConversations iterate %j', request); - return this.descriptors.page.listConversations.asyncIterate( - this.innerApiCalls['listConversations'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists guardrails in the given app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to list guardrails from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListGuardrailsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListGuardrails|AgentService.ListGuardrails} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the guardrails. - * See https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.Guardrail|Guardrail}. - * 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 `listGuardrailsAsync()` - * 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. - */ - listGuardrails( - request?: protos.google.cloud.ces.v1.IListGuardrailsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IGuardrail[], - protos.google.cloud.ces.v1.IListGuardrailsRequest|null, - protos.google.cloud.ces.v1.IListGuardrailsResponse - ]>; - listGuardrails( - request: protos.google.cloud.ces.v1.IListGuardrailsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListGuardrailsRequest, - protos.google.cloud.ces.v1.IListGuardrailsResponse|null|undefined, - protos.google.cloud.ces.v1.IGuardrail>): void; - listGuardrails( - request: protos.google.cloud.ces.v1.IListGuardrailsRequest, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListGuardrailsRequest, - protos.google.cloud.ces.v1.IListGuardrailsResponse|null|undefined, - protos.google.cloud.ces.v1.IGuardrail>): void; - listGuardrails( - request?: protos.google.cloud.ces.v1.IListGuardrailsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.ces.v1.IListGuardrailsRequest, - protos.google.cloud.ces.v1.IListGuardrailsResponse|null|undefined, - protos.google.cloud.ces.v1.IGuardrail>, - callback?: PaginationCallback< - protos.google.cloud.ces.v1.IListGuardrailsRequest, - protos.google.cloud.ces.v1.IListGuardrailsResponse|null|undefined, - protos.google.cloud.ces.v1.IGuardrail>): - Promise<[ - protos.google.cloud.ces.v1.IGuardrail[], - protos.google.cloud.ces.v1.IListGuardrailsRequest|null, - protos.google.cloud.ces.v1.IListGuardrailsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.ces.v1.IListGuardrailsRequest, - protos.google.cloud.ces.v1.IListGuardrailsResponse|null|undefined, - protos.google.cloud.ces.v1.IGuardrail>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listGuardrails values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listGuardrails request %j', request); - return this.innerApiCalls - .listGuardrails(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.ces.v1.IGuardrail[], - protos.google.cloud.ces.v1.IListGuardrailsRequest|null, - protos.google.cloud.ces.v1.IListGuardrailsResponse - ]) => { - this._log.info('listGuardrails values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listGuardrails`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to list guardrails from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListGuardrailsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListGuardrails|AgentService.ListGuardrails} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the guardrails. - * See https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @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.ces.v1.Guardrail|Guardrail} 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 `listGuardrailsAsync()` - * 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. - */ - listGuardrailsStream( - request?: protos.google.cloud.ces.v1.IListGuardrailsRequest, - 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['listGuardrails']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listGuardrails stream %j', request); - return this.descriptors.page.listGuardrails.createStream( - this.innerApiCalls.listGuardrails as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listGuardrails`, 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 resource name of the app to list guardrails from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListGuardrailsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListGuardrails|AgentService.ListGuardrails} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the guardrails. - * See https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @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.ces.v1.Guardrail|Guardrail}. 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/agent_service.list_guardrails.js - * region_tag:ces_v1_generated_AgentService_ListGuardrails_async - */ - listGuardrailsAsync( - request?: protos.google.cloud.ces.v1.IListGuardrailsRequest, - 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['listGuardrails']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listGuardrails iterate %j', request); - return this.descriptors.page.listGuardrails.asyncIterate( - this.innerApiCalls['listGuardrails'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists deployments in the given app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent app. - * Format: - * `projects/{project}/locations/{location}/apps/{app}` - * @param {number} [request.pageSize] - * Optional. The maximum number of deployments to return. The service may - * return fewer than this value. If unspecified, at most 50 deployments will - * be returned. The maximum value is 1000; values above 1000 will be coerced - * to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListDeployments` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListDeployments` must - * match the call that provided the page token. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.Deployment|Deployment}. - * 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 `listDeploymentsAsync()` - * 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. - */ - listDeployments( - request?: protos.google.cloud.ces.v1.IListDeploymentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IDeployment[], - protos.google.cloud.ces.v1.IListDeploymentsRequest|null, - protos.google.cloud.ces.v1.IListDeploymentsResponse - ]>; - listDeployments( - request: protos.google.cloud.ces.v1.IListDeploymentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListDeploymentsRequest, - protos.google.cloud.ces.v1.IListDeploymentsResponse|null|undefined, - protos.google.cloud.ces.v1.IDeployment>): void; - listDeployments( - request: protos.google.cloud.ces.v1.IListDeploymentsRequest, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListDeploymentsRequest, - protos.google.cloud.ces.v1.IListDeploymentsResponse|null|undefined, - protos.google.cloud.ces.v1.IDeployment>): void; - listDeployments( - request?: protos.google.cloud.ces.v1.IListDeploymentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.ces.v1.IListDeploymentsRequest, - protos.google.cloud.ces.v1.IListDeploymentsResponse|null|undefined, - protos.google.cloud.ces.v1.IDeployment>, - callback?: PaginationCallback< - protos.google.cloud.ces.v1.IListDeploymentsRequest, - protos.google.cloud.ces.v1.IListDeploymentsResponse|null|undefined, - protos.google.cloud.ces.v1.IDeployment>): - Promise<[ - protos.google.cloud.ces.v1.IDeployment[], - protos.google.cloud.ces.v1.IListDeploymentsRequest|null, - protos.google.cloud.ces.v1.IListDeploymentsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.ces.v1.IListDeploymentsRequest, - protos.google.cloud.ces.v1.IListDeploymentsResponse|null|undefined, - protos.google.cloud.ces.v1.IDeployment>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listDeployments values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listDeployments request %j', request); - return this.innerApiCalls - .listDeployments(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.ces.v1.IDeployment[], - protos.google.cloud.ces.v1.IListDeploymentsRequest|null, - protos.google.cloud.ces.v1.IListDeploymentsResponse - ]) => { - this._log.info('listDeployments values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listDeployments`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent app. - * Format: - * `projects/{project}/locations/{location}/apps/{app}` - * @param {number} [request.pageSize] - * Optional. The maximum number of deployments to return. The service may - * return fewer than this value. If unspecified, at most 50 deployments will - * be returned. The maximum value is 1000; values above 1000 will be coerced - * to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListDeployments` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListDeployments` must - * match the call that provided the page token. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @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.ces.v1.Deployment|Deployment} 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 `listDeploymentsAsync()` - * 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. - */ - listDeploymentsStream( - request?: protos.google.cloud.ces.v1.IListDeploymentsRequest, - 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['listDeployments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDeployments stream %j', request); - return this.descriptors.page.listDeployments.createStream( - this.innerApiCalls.listDeployments as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDeployments`, 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 parent app. - * Format: - * `projects/{project}/locations/{location}/apps/{app}` - * @param {number} [request.pageSize] - * Optional. The maximum number of deployments to return. The service may - * return fewer than this value. If unspecified, at most 50 deployments will - * be returned. The maximum value is 1000; values above 1000 will be coerced - * to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListDeployments` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListDeployments` must - * match the call that provided the page token. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @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.ces.v1.Deployment|Deployment}. 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/agent_service.list_deployments.js - * region_tag:ces_v1_generated_AgentService_ListDeployments_async - */ - listDeploymentsAsync( - request?: protos.google.cloud.ces.v1.IListDeploymentsRequest, - 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['listDeployments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDeployments iterate %j', request); - return this.descriptors.page.listDeployments.asyncIterate( - this.innerApiCalls['listDeployments'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists toolsets in the given app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to list toolsets from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListToolsetsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListToolsets|AgentService.ListToolsets} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the toolsets. - * See https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.Toolset|Toolset}. - * 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 `listToolsetsAsync()` - * 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. - */ - listToolsets( - request?: protos.google.cloud.ces.v1.IListToolsetsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IToolset[], - protos.google.cloud.ces.v1.IListToolsetsRequest|null, - protos.google.cloud.ces.v1.IListToolsetsResponse - ]>; - listToolsets( - request: protos.google.cloud.ces.v1.IListToolsetsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListToolsetsRequest, - protos.google.cloud.ces.v1.IListToolsetsResponse|null|undefined, - protos.google.cloud.ces.v1.IToolset>): void; - listToolsets( - request: protos.google.cloud.ces.v1.IListToolsetsRequest, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListToolsetsRequest, - protos.google.cloud.ces.v1.IListToolsetsResponse|null|undefined, - protos.google.cloud.ces.v1.IToolset>): void; - listToolsets( - request?: protos.google.cloud.ces.v1.IListToolsetsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.ces.v1.IListToolsetsRequest, - protos.google.cloud.ces.v1.IListToolsetsResponse|null|undefined, - protos.google.cloud.ces.v1.IToolset>, - callback?: PaginationCallback< - protos.google.cloud.ces.v1.IListToolsetsRequest, - protos.google.cloud.ces.v1.IListToolsetsResponse|null|undefined, - protos.google.cloud.ces.v1.IToolset>): - Promise<[ - protos.google.cloud.ces.v1.IToolset[], - protos.google.cloud.ces.v1.IListToolsetsRequest|null, - protos.google.cloud.ces.v1.IListToolsetsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.ces.v1.IListToolsetsRequest, - protos.google.cloud.ces.v1.IListToolsetsResponse|null|undefined, - protos.google.cloud.ces.v1.IToolset>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listToolsets values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listToolsets request %j', request); - return this.innerApiCalls - .listToolsets(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.ces.v1.IToolset[], - protos.google.cloud.ces.v1.IListToolsetsRequest|null, - protos.google.cloud.ces.v1.IListToolsetsResponse - ]) => { - this._log.info('listToolsets values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listToolsets`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to list toolsets from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListToolsetsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListToolsets|AgentService.ListToolsets} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the toolsets. - * See https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @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.ces.v1.Toolset|Toolset} 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 `listToolsetsAsync()` - * 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. - */ - listToolsetsStream( - request?: protos.google.cloud.ces.v1.IListToolsetsRequest, - 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['listToolsets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listToolsets stream %j', request); - return this.descriptors.page.listToolsets.createStream( - this.innerApiCalls.listToolsets as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listToolsets`, 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 resource name of the app to list toolsets from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListToolsetsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListToolsets|AgentService.ListToolsets} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the toolsets. - * See https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @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.ces.v1.Toolset|Toolset}. 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/agent_service.list_toolsets.js - * region_tag:ces_v1_generated_AgentService_ListToolsets_async - */ - listToolsetsAsync( - request?: protos.google.cloud.ces.v1.IListToolsetsRequest, - 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['listToolsets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listToolsets iterate %j', request); - return this.descriptors.page.listToolsets.asyncIterate( - this.innerApiCalls['listToolsets'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all app versions in the given app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to list app versions from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListAppVersionsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListAppVersions|AgentService.ListAppVersions} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the app versions. - * See https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.AppVersion|AppVersion}. - * 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 `listAppVersionsAsync()` - * 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. - */ - listAppVersions( - request?: protos.google.cloud.ces.v1.IListAppVersionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IAppVersion[], - protos.google.cloud.ces.v1.IListAppVersionsRequest|null, - protos.google.cloud.ces.v1.IListAppVersionsResponse - ]>; - listAppVersions( - request: protos.google.cloud.ces.v1.IListAppVersionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListAppVersionsRequest, - protos.google.cloud.ces.v1.IListAppVersionsResponse|null|undefined, - protos.google.cloud.ces.v1.IAppVersion>): void; - listAppVersions( - request: protos.google.cloud.ces.v1.IListAppVersionsRequest, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListAppVersionsRequest, - protos.google.cloud.ces.v1.IListAppVersionsResponse|null|undefined, - protos.google.cloud.ces.v1.IAppVersion>): void; - listAppVersions( - request?: protos.google.cloud.ces.v1.IListAppVersionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.ces.v1.IListAppVersionsRequest, - protos.google.cloud.ces.v1.IListAppVersionsResponse|null|undefined, - protos.google.cloud.ces.v1.IAppVersion>, - callback?: PaginationCallback< - protos.google.cloud.ces.v1.IListAppVersionsRequest, - protos.google.cloud.ces.v1.IListAppVersionsResponse|null|undefined, - protos.google.cloud.ces.v1.IAppVersion>): - Promise<[ - protos.google.cloud.ces.v1.IAppVersion[], - protos.google.cloud.ces.v1.IListAppVersionsRequest|null, - protos.google.cloud.ces.v1.IListAppVersionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.ces.v1.IListAppVersionsRequest, - protos.google.cloud.ces.v1.IListAppVersionsResponse|null|undefined, - protos.google.cloud.ces.v1.IAppVersion>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listAppVersions values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listAppVersions request %j', request); - return this.innerApiCalls - .listAppVersions(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.ces.v1.IAppVersion[], - protos.google.cloud.ces.v1.IListAppVersionsRequest|null, - protos.google.cloud.ces.v1.IListAppVersionsResponse - ]) => { - this._log.info('listAppVersions values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listAppVersions`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to list app versions from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListAppVersionsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListAppVersions|AgentService.ListAppVersions} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the app versions. - * See https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @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.ces.v1.AppVersion|AppVersion} 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 `listAppVersionsAsync()` - * 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. - */ - listAppVersionsStream( - request?: protos.google.cloud.ces.v1.IListAppVersionsRequest, - 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['listAppVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listAppVersions stream %j', request); - return this.descriptors.page.listAppVersions.createStream( - this.innerApiCalls.listAppVersions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAppVersions`, 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 resource name of the app to list app versions from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListAppVersionsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListAppVersions|AgentService.ListAppVersions} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the app versions. - * See https://google.aip.dev/160 for more details. - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @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.ces.v1.AppVersion|AppVersion}. 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/agent_service.list_app_versions.js - * region_tag:ces_v1_generated_AgentService_ListAppVersions_async - */ - listAppVersionsAsync( - request?: protos.google.cloud.ces.v1.IListAppVersionsRequest, - 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['listAppVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listAppVersions iterate %j', request); - return this.descriptors.page.listAppVersions.asyncIterate( - this.innerApiCalls['listAppVersions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists the changelogs of the specified app. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to list changelogs from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListChangelogsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListChangelogs|AgentService.ListChangelogs} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the changelogs. - * See https://google.aip.dev/160 for more details. - * - * The filter string can be used to filter by `action`, `resource_type`, - * `resource_name`, `author`, and `create_time`. - * The `:` comparator can be used for case-insensitive partial matching on - * string fields, while `=` performs an exact case-sensitive match. - * - * Examples: - * * `action:update` (case-insensitive partial match) - * * `action="Create"` (case-sensitive exact match) - * * `resource_type:agent` - * * `resource_name:my-agent` - * * `author:me@example.com` - * * `create_time > "2025-01-01T00:00:00Z"` - * * `create_time <= "2025-01-01T00:00:00Z" AND resource_type:tool` - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.ces.v1.Changelog|Changelog}. - * 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 `listChangelogsAsync()` - * 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. - */ - listChangelogs( - request?: protos.google.cloud.ces.v1.IListChangelogsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IChangelog[], - protos.google.cloud.ces.v1.IListChangelogsRequest|null, - protos.google.cloud.ces.v1.IListChangelogsResponse - ]>; - listChangelogs( - request: protos.google.cloud.ces.v1.IListChangelogsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListChangelogsRequest, - protos.google.cloud.ces.v1.IListChangelogsResponse|null|undefined, - protos.google.cloud.ces.v1.IChangelog>): void; - listChangelogs( - request: protos.google.cloud.ces.v1.IListChangelogsRequest, - callback: PaginationCallback< - protos.google.cloud.ces.v1.IListChangelogsRequest, - protos.google.cloud.ces.v1.IListChangelogsResponse|null|undefined, - protos.google.cloud.ces.v1.IChangelog>): void; - listChangelogs( - request?: protos.google.cloud.ces.v1.IListChangelogsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.ces.v1.IListChangelogsRequest, - protos.google.cloud.ces.v1.IListChangelogsResponse|null|undefined, - protos.google.cloud.ces.v1.IChangelog>, - callback?: PaginationCallback< - protos.google.cloud.ces.v1.IListChangelogsRequest, - protos.google.cloud.ces.v1.IListChangelogsResponse|null|undefined, - protos.google.cloud.ces.v1.IChangelog>): - Promise<[ - protos.google.cloud.ces.v1.IChangelog[], - protos.google.cloud.ces.v1.IListChangelogsRequest|null, - protos.google.cloud.ces.v1.IListChangelogsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.ces.v1.IListChangelogsRequest, - protos.google.cloud.ces.v1.IListChangelogsResponse|null|undefined, - protos.google.cloud.ces.v1.IChangelog>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listChangelogs values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listChangelogs request %j', request); - return this.innerApiCalls - .listChangelogs(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.ces.v1.IChangelog[], - protos.google.cloud.ces.v1.IListChangelogsRequest|null, - protos.google.cloud.ces.v1.IListChangelogsResponse - ]) => { - this._log.info('listChangelogs values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listChangelogs`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the app to list changelogs from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListChangelogsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListChangelogs|AgentService.ListChangelogs} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the changelogs. - * See https://google.aip.dev/160 for more details. - * - * The filter string can be used to filter by `action`, `resource_type`, - * `resource_name`, `author`, and `create_time`. - * The `:` comparator can be used for case-insensitive partial matching on - * string fields, while `=` performs an exact case-sensitive match. - * - * Examples: - * * `action:update` (case-insensitive partial match) - * * `action="Create"` (case-sensitive exact match) - * * `resource_type:agent` - * * `resource_name:my-agent` - * * `author:me@example.com` - * * `create_time > "2025-01-01T00:00:00Z"` - * * `create_time <= "2025-01-01T00:00:00Z" AND resource_type:tool` - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @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.ces.v1.Changelog|Changelog} 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 `listChangelogsAsync()` - * 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. - */ - listChangelogsStream( - request?: protos.google.cloud.ces.v1.IListChangelogsRequest, - 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['listChangelogs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listChangelogs stream %j', request); - return this.descriptors.page.listChangelogs.createStream( - this.innerApiCalls.listChangelogs as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listChangelogs`, 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 resource name of the app to list changelogs from. - * @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. The - * {@link protos.google.cloud.ces.v1.ListChangelogsResponse.next_page_token|next_page_token} - * value returned from a previous list - * {@link protos.google.cloud.ces.v1.AgentService.ListChangelogs|AgentService.ListChangelogs} - * call. - * @param {string} [request.filter] - * Optional. Filter to be applied when listing the changelogs. - * See https://google.aip.dev/160 for more details. - * - * The filter string can be used to filter by `action`, `resource_type`, - * `resource_name`, `author`, and `create_time`. - * The `:` comparator can be used for case-insensitive partial matching on - * string fields, while `=` performs an exact case-sensitive match. - * - * Examples: - * * `action:update` (case-insensitive partial match) - * * `action="Create"` (case-sensitive exact match) - * * `resource_type:agent` - * * `resource_name:my-agent` - * * `author:me@example.com` - * * `create_time > "2025-01-01T00:00:00Z"` - * * `create_time <= "2025-01-01T00:00:00Z" AND resource_type:tool` - * @param {string} [request.orderBy] - * Optional. Field to sort by. Only "name" and "create_time" is supported. - * See https://google.aip.dev/132#ordering for more details. - * @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.ces.v1.Changelog|Changelog}. 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/agent_service.list_changelogs.js - * region_tag:ces_v1_generated_AgentService_ListChangelogs_async - */ - listChangelogsAsync( - request?: protos.google.cloud.ces.v1.IListChangelogsRequest, - 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['listChangelogs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listChangelogs iterate %j', request); - return this.descriptors.page.listChangelogs.asyncIterate( - this.innerApiCalls['listChangelogs'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. Returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified agent resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} agent - * @returns {string} Resource name string. - */ - agentPath(project:string,location:string,app:string,agent:string) { - return this.pathTemplates.agentPathTemplate.render({ - project: project, - location: location, - app: app, - agent: agent, - }); - } - - /** - * Parse the project from Agent resource. - * - * @param {string} agentName - * A fully-qualified path representing Agent resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAgentName(agentName: string) { - return this.pathTemplates.agentPathTemplate.match(agentName).project; - } - - /** - * Parse the location from Agent resource. - * - * @param {string} agentName - * A fully-qualified path representing Agent resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAgentName(agentName: string) { - return this.pathTemplates.agentPathTemplate.match(agentName).location; - } - - /** - * Parse the app from Agent resource. - * - * @param {string} agentName - * A fully-qualified path representing Agent resource. - * @returns {string} A string representing the app. - */ - matchAppFromAgentName(agentName: string) { - return this.pathTemplates.agentPathTemplate.match(agentName).app; - } - - /** - * Parse the agent from Agent resource. - * - * @param {string} agentName - * A fully-qualified path representing Agent resource. - * @returns {string} A string representing the agent. - */ - matchAgentFromAgentName(agentName: string) { - return this.pathTemplates.agentPathTemplate.match(agentName).agent; - } - - /** - * Return a fully-qualified app resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @returns {string} Resource name string. - */ - appPath(project:string,location:string,app:string) { - return this.pathTemplates.appPathTemplate.render({ - project: project, - location: location, - app: app, - }); - } - - /** - * Parse the project from App resource. - * - * @param {string} appName - * A fully-qualified path representing App resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAppName(appName: string) { - return this.pathTemplates.appPathTemplate.match(appName).project; - } - - /** - * Parse the location from App resource. - * - * @param {string} appName - * A fully-qualified path representing App resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAppName(appName: string) { - return this.pathTemplates.appPathTemplate.match(appName).location; - } - - /** - * Parse the app from App resource. - * - * @param {string} appName - * A fully-qualified path representing App resource. - * @returns {string} A string representing the app. - */ - matchAppFromAppName(appName: string) { - return this.pathTemplates.appPathTemplate.match(appName).app; - } - - /** - * Return a fully-qualified appVersion resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} version - * @returns {string} Resource name string. - */ - appVersionPath(project:string,location:string,app:string,version:string) { - return this.pathTemplates.appVersionPathTemplate.render({ - project: project, - location: location, - app: app, - version: version, - }); - } - - /** - * Parse the project from AppVersion resource. - * - * @param {string} appVersionName - * A fully-qualified path representing AppVersion resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAppVersionName(appVersionName: string) { - return this.pathTemplates.appVersionPathTemplate.match(appVersionName).project; - } - - /** - * Parse the location from AppVersion resource. - * - * @param {string} appVersionName - * A fully-qualified path representing AppVersion resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAppVersionName(appVersionName: string) { - return this.pathTemplates.appVersionPathTemplate.match(appVersionName).location; - } - - /** - * Parse the app from AppVersion resource. - * - * @param {string} appVersionName - * A fully-qualified path representing AppVersion resource. - * @returns {string} A string representing the app. - */ - matchAppFromAppVersionName(appVersionName: string) { - return this.pathTemplates.appVersionPathTemplate.match(appVersionName).app; - } - - /** - * Parse the version from AppVersion resource. - * - * @param {string} appVersionName - * A fully-qualified path representing AppVersion resource. - * @returns {string} A string representing the version. - */ - matchVersionFromAppVersionName(appVersionName: string) { - return this.pathTemplates.appVersionPathTemplate.match(appVersionName).version; - } - - /** - * Return a fully-qualified changelog resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} changelog - * @returns {string} Resource name string. - */ - changelogPath(project:string,location:string,app:string,changelog:string) { - return this.pathTemplates.changelogPathTemplate.render({ - project: project, - location: location, - app: app, - changelog: changelog, - }); - } - - /** - * Parse the project from Changelog resource. - * - * @param {string} changelogName - * A fully-qualified path representing Changelog resource. - * @returns {string} A string representing the project. - */ - matchProjectFromChangelogName(changelogName: string) { - return this.pathTemplates.changelogPathTemplate.match(changelogName).project; - } - - /** - * Parse the location from Changelog resource. - * - * @param {string} changelogName - * A fully-qualified path representing Changelog resource. - * @returns {string} A string representing the location. - */ - matchLocationFromChangelogName(changelogName: string) { - return this.pathTemplates.changelogPathTemplate.match(changelogName).location; - } - - /** - * Parse the app from Changelog resource. - * - * @param {string} changelogName - * A fully-qualified path representing Changelog resource. - * @returns {string} A string representing the app. - */ - matchAppFromChangelogName(changelogName: string) { - return this.pathTemplates.changelogPathTemplate.match(changelogName).app; - } - - /** - * Parse the changelog from Changelog resource. - * - * @param {string} changelogName - * A fully-qualified path representing Changelog resource. - * @returns {string} A string representing the changelog. - */ - matchChangelogFromChangelogName(changelogName: string) { - return this.pathTemplates.changelogPathTemplate.match(changelogName).changelog; - } - - /** - * Return a fully-qualified conversation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} conversation - * @returns {string} Resource name string. - */ - conversationPath(project:string,location:string,app:string,conversation:string) { - return this.pathTemplates.conversationPathTemplate.render({ - project: project, - location: location, - app: app, - conversation: conversation, - }); - } - - /** - * Parse the project from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).project; - } - - /** - * Parse the location from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).location; - } - - /** - * Parse the app from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the app. - */ - matchAppFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).app; - } - - /** - * Parse the conversation from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the conversation. - */ - matchConversationFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).conversation; - } - - /** - * Return a fully-qualified deployment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} deployment - * @returns {string} Resource name string. - */ - deploymentPath(project:string,location:string,app:string,deployment:string) { - return this.pathTemplates.deploymentPathTemplate.render({ - project: project, - location: location, - app: app, - deployment: deployment, - }); - } - - /** - * Parse the project from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; - } - - /** - * Parse the location from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; - } - - /** - * Parse the app from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the app. - */ - matchAppFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).app; - } - - /** - * Parse the deployment from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the deployment. - */ - matchDeploymentFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; - } - - /** - * Return a fully-qualified example resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} example - * @returns {string} Resource name string. - */ - examplePath(project:string,location:string,app:string,example:string) { - return this.pathTemplates.examplePathTemplate.render({ - project: project, - location: location, - app: app, - example: example, - }); - } - - /** - * Parse the project from Example resource. - * - * @param {string} exampleName - * A fully-qualified path representing Example resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExampleName(exampleName: string) { - return this.pathTemplates.examplePathTemplate.match(exampleName).project; - } - - /** - * Parse the location from Example resource. - * - * @param {string} exampleName - * A fully-qualified path representing Example resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExampleName(exampleName: string) { - return this.pathTemplates.examplePathTemplate.match(exampleName).location; - } - - /** - * Parse the app from Example resource. - * - * @param {string} exampleName - * A fully-qualified path representing Example resource. - * @returns {string} A string representing the app. - */ - matchAppFromExampleName(exampleName: string) { - return this.pathTemplates.examplePathTemplate.match(exampleName).app; - } - - /** - * Parse the example from Example resource. - * - * @param {string} exampleName - * A fully-qualified path representing Example resource. - * @returns {string} A string representing the example. - */ - matchExampleFromExampleName(exampleName: string) { - return this.pathTemplates.examplePathTemplate.match(exampleName).example; - } - - /** - * Return a fully-qualified guardrail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} guardrail - * @returns {string} Resource name string. - */ - guardrailPath(project:string,location:string,app:string,guardrail:string) { - return this.pathTemplates.guardrailPathTemplate.render({ - project: project, - location: location, - app: app, - guardrail: guardrail, - }); - } - - /** - * Parse the project from Guardrail resource. - * - * @param {string} guardrailName - * A fully-qualified path representing Guardrail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromGuardrailName(guardrailName: string) { - return this.pathTemplates.guardrailPathTemplate.match(guardrailName).project; - } - - /** - * Parse the location from Guardrail resource. - * - * @param {string} guardrailName - * A fully-qualified path representing Guardrail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromGuardrailName(guardrailName: string) { - return this.pathTemplates.guardrailPathTemplate.match(guardrailName).location; - } - - /** - * Parse the app from Guardrail resource. - * - * @param {string} guardrailName - * A fully-qualified path representing Guardrail resource. - * @returns {string} A string representing the app. - */ - matchAppFromGuardrailName(guardrailName: string) { - return this.pathTemplates.guardrailPathTemplate.match(guardrailName).app; - } - - /** - * Parse the guardrail from Guardrail resource. - * - * @param {string} guardrailName - * A fully-qualified path representing Guardrail resource. - * @returns {string} A string representing the guardrail. - */ - matchGuardrailFromGuardrailName(guardrailName: string) { - return this.pathTemplates.guardrailPathTemplate.match(guardrailName).guardrail; - } - - /** - * 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 omnichannel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} omnichannel - * @returns {string} Resource name string. - */ - omnichannelPath(project:string,location:string,omnichannel:string) { - return this.pathTemplates.omnichannelPathTemplate.render({ - project: project, - location: location, - omnichannel: omnichannel, - }); - } - - /** - * Parse the project from Omnichannel resource. - * - * @param {string} omnichannelName - * A fully-qualified path representing Omnichannel resource. - * @returns {string} A string representing the project. - */ - matchProjectFromOmnichannelName(omnichannelName: string) { - return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).project; - } - - /** - * Parse the location from Omnichannel resource. - * - * @param {string} omnichannelName - * A fully-qualified path representing Omnichannel resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOmnichannelName(omnichannelName: string) { - return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).location; - } - - /** - * Parse the omnichannel from Omnichannel resource. - * - * @param {string} omnichannelName - * A fully-qualified path representing Omnichannel resource. - * @returns {string} A string representing the omnichannel. - */ - matchOmnichannelFromOmnichannelName(omnichannelName: string) { - return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).omnichannel; - } - - /** - * 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 tool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} tool - * @returns {string} Resource name string. - */ - toolPath(project:string,location:string,app:string,tool:string) { - return this.pathTemplates.toolPathTemplate.render({ - project: project, - location: location, - app: app, - tool: tool, - }); - } - - /** - * Parse the project from Tool resource. - * - * @param {string} toolName - * A fully-qualified path representing Tool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromToolName(toolName: string) { - return this.pathTemplates.toolPathTemplate.match(toolName).project; - } - - /** - * Parse the location from Tool resource. - * - * @param {string} toolName - * A fully-qualified path representing Tool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromToolName(toolName: string) { - return this.pathTemplates.toolPathTemplate.match(toolName).location; - } - - /** - * Parse the app from Tool resource. - * - * @param {string} toolName - * A fully-qualified path representing Tool resource. - * @returns {string} A string representing the app. - */ - matchAppFromToolName(toolName: string) { - return this.pathTemplates.toolPathTemplate.match(toolName).app; - } - - /** - * Parse the tool from Tool resource. - * - * @param {string} toolName - * A fully-qualified path representing Tool resource. - * @returns {string} A string representing the tool. - */ - matchToolFromToolName(toolName: string) { - return this.pathTemplates.toolPathTemplate.match(toolName).tool; - } - - /** - * Return a fully-qualified toolset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} toolset - * @returns {string} Resource name string. - */ - toolsetPath(project:string,location:string,app:string,toolset:string) { - return this.pathTemplates.toolsetPathTemplate.render({ - project: project, - location: location, - app: app, - toolset: toolset, - }); - } - - /** - * Parse the project from Toolset resource. - * - * @param {string} toolsetName - * A fully-qualified path representing Toolset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromToolsetName(toolsetName: string) { - return this.pathTemplates.toolsetPathTemplate.match(toolsetName).project; - } - - /** - * Parse the location from Toolset resource. - * - * @param {string} toolsetName - * A fully-qualified path representing Toolset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromToolsetName(toolsetName: string) { - return this.pathTemplates.toolsetPathTemplate.match(toolsetName).location; - } - - /** - * Parse the app from Toolset resource. - * - * @param {string} toolsetName - * A fully-qualified path representing Toolset resource. - * @returns {string} A string representing the app. - */ - matchAppFromToolsetName(toolsetName: string) { - return this.pathTemplates.toolsetPathTemplate.match(toolsetName).app; - } - - /** - * Parse the toolset from Toolset resource. - * - * @param {string} toolsetName - * A fully-qualified path representing Toolset resource. - * @returns {string} A string representing the toolset. - */ - matchToolsetFromToolsetName(toolsetName: string) { - return this.pathTemplates.toolsetPathTemplate.match(toolsetName).toolset; - } - - /** - * 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.agentServiceStub && !this._terminated) { - return this.agentServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/src/v1/agent_service_client_config.json b/owl-bot-staging/google-cloud-ces/src/v1/agent_service_client_config.json deleted file mode 100644 index 655c633e475..00000000000 --- a/owl-bot-staging/google-cloud-ces/src/v1/agent_service_client_config.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "interfaces": { - "google.cloud.ces.v1.AgentService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListApps": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetApp": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateApp": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "UpdateApp": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteApp": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ExportApp": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ImportApp": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListAgents": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetAgent": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateAgent": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "UpdateAgent": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteAgent": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListExamples": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetExample": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateExample": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "UpdateExample": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteExample": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListTools": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetTool": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListConversations": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetConversation": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteConversation": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "BatchDeleteConversations": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateTool": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "UpdateTool": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteTool": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListGuardrails": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetGuardrail": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateGuardrail": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "UpdateGuardrail": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteGuardrail": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListDeployments": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetDeployment": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateDeployment": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "UpdateDeployment": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteDeployment": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListToolsets": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetToolset": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateToolset": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "UpdateToolset": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteToolset": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListAppVersions": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetAppVersion": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateAppVersion": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteAppVersion": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "RestoreAppVersion": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListChangelogs": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetChangelog": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-ces/src/v1/agent_service_proto_list.json b/owl-bot-staging/google-cloud-ces/src/v1/agent_service_proto_list.json deleted file mode 100644 index 7f9a4c1d7f8..00000000000 --- a/owl-bot-staging/google-cloud-ces/src/v1/agent_service_proto_list.json +++ /dev/null @@ -1,40 +0,0 @@ -[ - "../../protos/google/cloud/ces/v1/agent.proto", - "../../protos/google/cloud/ces/v1/agent_service.proto", - "../../protos/google/cloud/ces/v1/agent_transfers.proto", - "../../protos/google/cloud/ces/v1/app.proto", - "../../protos/google/cloud/ces/v1/app_version.proto", - "../../protos/google/cloud/ces/v1/auth.proto", - "../../protos/google/cloud/ces/v1/bigquery_export.proto", - "../../protos/google/cloud/ces/v1/changelog.proto", - "../../protos/google/cloud/ces/v1/client_function.proto", - "../../protos/google/cloud/ces/v1/common.proto", - "../../protos/google/cloud/ces/v1/connector_tool.proto", - "../../protos/google/cloud/ces/v1/connector_toolset.proto", - "../../protos/google/cloud/ces/v1/conversation.proto", - "../../protos/google/cloud/ces/v1/data_store.proto", - "../../protos/google/cloud/ces/v1/data_store_tool.proto", - "../../protos/google/cloud/ces/v1/deployment.proto", - "../../protos/google/cloud/ces/v1/example.proto", - "../../protos/google/cloud/ces/v1/fakes.proto", - "../../protos/google/cloud/ces/v1/file_search_tool.proto", - "../../protos/google/cloud/ces/v1/google_search_tool.proto", - "../../protos/google/cloud/ces/v1/guardrail.proto", - "../../protos/google/cloud/ces/v1/mcp_tool.proto", - "../../protos/google/cloud/ces/v1/mcp_toolset.proto", - "../../protos/google/cloud/ces/v1/omnichannel.proto", - "../../protos/google/cloud/ces/v1/omnichannel_service.proto", - "../../protos/google/cloud/ces/v1/open_api_tool.proto", - "../../protos/google/cloud/ces/v1/open_api_toolset.proto", - "../../protos/google/cloud/ces/v1/python_function.proto", - "../../protos/google/cloud/ces/v1/schema.proto", - "../../protos/google/cloud/ces/v1/search_suggestions.proto", - "../../protos/google/cloud/ces/v1/session_service.proto", - "../../protos/google/cloud/ces/v1/system_tool.proto", - "../../protos/google/cloud/ces/v1/tool.proto", - "../../protos/google/cloud/ces/v1/tool_service.proto", - "../../protos/google/cloud/ces/v1/toolset.proto", - "../../protos/google/cloud/ces/v1/toolset_tool.proto", - "../../protos/google/cloud/ces/v1/widget_service.proto", - "../../protos/google/cloud/ces/v1/widget_tool.proto" -] diff --git a/owl-bot-staging/google-cloud-ces/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-ces/src/v1/gapic_metadata.json deleted file mode 100644 index 2dc1cdbae2e..00000000000 --- a/owl-bot-staging/google-cloud-ces/src/v1/gapic_metadata.json +++ /dev/null @@ -1,640 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.ces.v1", - "libraryPackage": "@google-cloud/ces", - "services": { - "AgentService": { - "clients": { - "grpc": { - "libraryClient": "AgentServiceClient", - "rpcs": { - "GetApp": { - "methods": [ - "getApp" - ] - }, - "UpdateApp": { - "methods": [ - "updateApp" - ] - }, - "GetAgent": { - "methods": [ - "getAgent" - ] - }, - "CreateAgent": { - "methods": [ - "createAgent" - ] - }, - "UpdateAgent": { - "methods": [ - "updateAgent" - ] - }, - "DeleteAgent": { - "methods": [ - "deleteAgent" - ] - }, - "GetExample": { - "methods": [ - "getExample" - ] - }, - "CreateExample": { - "methods": [ - "createExample" - ] - }, - "UpdateExample": { - "methods": [ - "updateExample" - ] - }, - "DeleteExample": { - "methods": [ - "deleteExample" - ] - }, - "GetTool": { - "methods": [ - "getTool" - ] - }, - "GetConversation": { - "methods": [ - "getConversation" - ] - }, - "DeleteConversation": { - "methods": [ - "deleteConversation" - ] - }, - "CreateTool": { - "methods": [ - "createTool" - ] - }, - "UpdateTool": { - "methods": [ - "updateTool" - ] - }, - "DeleteTool": { - "methods": [ - "deleteTool" - ] - }, - "GetGuardrail": { - "methods": [ - "getGuardrail" - ] - }, - "CreateGuardrail": { - "methods": [ - "createGuardrail" - ] - }, - "UpdateGuardrail": { - "methods": [ - "updateGuardrail" - ] - }, - "DeleteGuardrail": { - "methods": [ - "deleteGuardrail" - ] - }, - "GetDeployment": { - "methods": [ - "getDeployment" - ] - }, - "CreateDeployment": { - "methods": [ - "createDeployment" - ] - }, - "UpdateDeployment": { - "methods": [ - "updateDeployment" - ] - }, - "DeleteDeployment": { - "methods": [ - "deleteDeployment" - ] - }, - "GetToolset": { - "methods": [ - "getToolset" - ] - }, - "CreateToolset": { - "methods": [ - "createToolset" - ] - }, - "UpdateToolset": { - "methods": [ - "updateToolset" - ] - }, - "DeleteToolset": { - "methods": [ - "deleteToolset" - ] - }, - "GetAppVersion": { - "methods": [ - "getAppVersion" - ] - }, - "CreateAppVersion": { - "methods": [ - "createAppVersion" - ] - }, - "DeleteAppVersion": { - "methods": [ - "deleteAppVersion" - ] - }, - "GetChangelog": { - "methods": [ - "getChangelog" - ] - }, - "CreateApp": { - "methods": [ - "createApp" - ] - }, - "DeleteApp": { - "methods": [ - "deleteApp" - ] - }, - "ExportApp": { - "methods": [ - "exportApp" - ] - }, - "ImportApp": { - "methods": [ - "importApp" - ] - }, - "BatchDeleteConversations": { - "methods": [ - "batchDeleteConversations" - ] - }, - "RestoreAppVersion": { - "methods": [ - "restoreAppVersion" - ] - }, - "ListApps": { - "methods": [ - "listApps", - "listAppsStream", - "listAppsAsync" - ] - }, - "ListAgents": { - "methods": [ - "listAgents", - "listAgentsStream", - "listAgentsAsync" - ] - }, - "ListExamples": { - "methods": [ - "listExamples", - "listExamplesStream", - "listExamplesAsync" - ] - }, - "ListTools": { - "methods": [ - "listTools", - "listToolsStream", - "listToolsAsync" - ] - }, - "ListConversations": { - "methods": [ - "listConversations", - "listConversationsStream", - "listConversationsAsync" - ] - }, - "ListGuardrails": { - "methods": [ - "listGuardrails", - "listGuardrailsStream", - "listGuardrailsAsync" - ] - }, - "ListDeployments": { - "methods": [ - "listDeployments", - "listDeploymentsStream", - "listDeploymentsAsync" - ] - }, - "ListToolsets": { - "methods": [ - "listToolsets", - "listToolsetsStream", - "listToolsetsAsync" - ] - }, - "ListAppVersions": { - "methods": [ - "listAppVersions", - "listAppVersionsStream", - "listAppVersionsAsync" - ] - }, - "ListChangelogs": { - "methods": [ - "listChangelogs", - "listChangelogsStream", - "listChangelogsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "AgentServiceClient", - "rpcs": { - "GetApp": { - "methods": [ - "getApp" - ] - }, - "UpdateApp": { - "methods": [ - "updateApp" - ] - }, - "GetAgent": { - "methods": [ - "getAgent" - ] - }, - "CreateAgent": { - "methods": [ - "createAgent" - ] - }, - "UpdateAgent": { - "methods": [ - "updateAgent" - ] - }, - "DeleteAgent": { - "methods": [ - "deleteAgent" - ] - }, - "GetExample": { - "methods": [ - "getExample" - ] - }, - "CreateExample": { - "methods": [ - "createExample" - ] - }, - "UpdateExample": { - "methods": [ - "updateExample" - ] - }, - "DeleteExample": { - "methods": [ - "deleteExample" - ] - }, - "GetTool": { - "methods": [ - "getTool" - ] - }, - "GetConversation": { - "methods": [ - "getConversation" - ] - }, - "DeleteConversation": { - "methods": [ - "deleteConversation" - ] - }, - "CreateTool": { - "methods": [ - "createTool" - ] - }, - "UpdateTool": { - "methods": [ - "updateTool" - ] - }, - "DeleteTool": { - "methods": [ - "deleteTool" - ] - }, - "GetGuardrail": { - "methods": [ - "getGuardrail" - ] - }, - "CreateGuardrail": { - "methods": [ - "createGuardrail" - ] - }, - "UpdateGuardrail": { - "methods": [ - "updateGuardrail" - ] - }, - "DeleteGuardrail": { - "methods": [ - "deleteGuardrail" - ] - }, - "GetDeployment": { - "methods": [ - "getDeployment" - ] - }, - "CreateDeployment": { - "methods": [ - "createDeployment" - ] - }, - "UpdateDeployment": { - "methods": [ - "updateDeployment" - ] - }, - "DeleteDeployment": { - "methods": [ - "deleteDeployment" - ] - }, - "GetToolset": { - "methods": [ - "getToolset" - ] - }, - "CreateToolset": { - "methods": [ - "createToolset" - ] - }, - "UpdateToolset": { - "methods": [ - "updateToolset" - ] - }, - "DeleteToolset": { - "methods": [ - "deleteToolset" - ] - }, - "GetAppVersion": { - "methods": [ - "getAppVersion" - ] - }, - "CreateAppVersion": { - "methods": [ - "createAppVersion" - ] - }, - "DeleteAppVersion": { - "methods": [ - "deleteAppVersion" - ] - }, - "GetChangelog": { - "methods": [ - "getChangelog" - ] - }, - "CreateApp": { - "methods": [ - "createApp" - ] - }, - "DeleteApp": { - "methods": [ - "deleteApp" - ] - }, - "ExportApp": { - "methods": [ - "exportApp" - ] - }, - "ImportApp": { - "methods": [ - "importApp" - ] - }, - "BatchDeleteConversations": { - "methods": [ - "batchDeleteConversations" - ] - }, - "RestoreAppVersion": { - "methods": [ - "restoreAppVersion" - ] - }, - "ListApps": { - "methods": [ - "listApps", - "listAppsStream", - "listAppsAsync" - ] - }, - "ListAgents": { - "methods": [ - "listAgents", - "listAgentsStream", - "listAgentsAsync" - ] - }, - "ListExamples": { - "methods": [ - "listExamples", - "listExamplesStream", - "listExamplesAsync" - ] - }, - "ListTools": { - "methods": [ - "listTools", - "listToolsStream", - "listToolsAsync" - ] - }, - "ListConversations": { - "methods": [ - "listConversations", - "listConversationsStream", - "listConversationsAsync" - ] - }, - "ListGuardrails": { - "methods": [ - "listGuardrails", - "listGuardrailsStream", - "listGuardrailsAsync" - ] - }, - "ListDeployments": { - "methods": [ - "listDeployments", - "listDeploymentsStream", - "listDeploymentsAsync" - ] - }, - "ListToolsets": { - "methods": [ - "listToolsets", - "listToolsetsStream", - "listToolsetsAsync" - ] - }, - "ListAppVersions": { - "methods": [ - "listAppVersions", - "listAppVersionsStream", - "listAppVersionsAsync" - ] - }, - "ListChangelogs": { - "methods": [ - "listChangelogs", - "listChangelogsStream", - "listChangelogsAsync" - ] - } - } - } - } - }, - "SessionService": { - "clients": { - "grpc": { - "libraryClient": "SessionServiceClient", - "rpcs": { - "RunSession": { - "methods": [ - "runSession" - ] - }, - "BidiRunSession": { - "methods": [ - "bidiRunSession" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "SessionServiceClient", - "rpcs": { - "RunSession": { - "methods": [ - "runSession" - ] - } - } - } - } - }, - "ToolService": { - "clients": { - "grpc": { - "libraryClient": "ToolServiceClient", - "rpcs": { - "ExecuteTool": { - "methods": [ - "executeTool" - ] - }, - "RetrieveToolSchema": { - "methods": [ - "retrieveToolSchema" - ] - }, - "RetrieveTools": { - "methods": [ - "retrieveTools" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ToolServiceClient", - "rpcs": { - "ExecuteTool": { - "methods": [ - "executeTool" - ] - }, - "RetrieveToolSchema": { - "methods": [ - "retrieveToolSchema" - ] - }, - "RetrieveTools": { - "methods": [ - "retrieveTools" - ] - } - } - } - } - }, - "WidgetService": { - "clients": { - "grpc": { - "libraryClient": "WidgetServiceClient", - "rpcs": { - "GenerateChatToken": { - "methods": [ - "generateChatToken" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "WidgetServiceClient", - "rpcs": { - "GenerateChatToken": { - "methods": [ - "generateChatToken" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-ces/src/v1/index.ts b/owl-bot-staging/google-cloud-ces/src/v1/index.ts deleted file mode 100644 index c1a4da87b94..00000000000 --- a/owl-bot-staging/google-cloud-ces/src/v1/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {AgentServiceClient} from './agent_service_client'; -export {SessionServiceClient} from './session_service_client'; -export {ToolServiceClient} from './tool_service_client'; -export {WidgetServiceClient} from './widget_service_client'; diff --git a/owl-bot-staging/google-cloud-ces/src/v1/session_service_client.ts b/owl-bot-staging/google-cloud-ces/src/v1/session_service_client.ts deleted file mode 100644 index 11eec14af45..00000000000 --- a/owl-bot-staging/google-cloud-ces/src/v1/session_service_client.ts +++ /dev/null @@ -1,1383 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, LocationsClient, LocationProtos} from 'google-gax'; -import {PassThrough} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/session_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './session_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Session service provides APIs for interacting with CES agents. - * @class - * @memberof v1 - */ -export class SessionServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('ces'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - sessionServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of SessionServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new SessionServiceClient({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 SessionServiceClient; - 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 = 'ces.' + 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.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 = { - agentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/agents/{agent}' - ), - appPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}' - ), - appVersionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/versions/{version}' - ), - changelogPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}' - ), - conversationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}' - ), - deploymentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}' - ), - examplePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/examples/{example}' - ), - guardrailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}' - ), - omnichannelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/omnichannels/{omnichannel}' - ), - sessionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/sessions/{session}' - ), - toolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/tools/{tool}' - ), - toolsetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}' - ), - }; - - // Some of the methods on this service provide streaming responses. - // Provide descriptors for these. - this.descriptors.stream = { - bidiRunSession: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.ces.v1.SessionService', 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.sessionServiceStub) { - return this.sessionServiceStub; - } - - // Put together the "service stub" for - // google.cloud.ces.v1.SessionService. - this.sessionServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.ces.v1.SessionService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.ces.v1.SessionService, - 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 sessionServiceStubMethods = - ['runSession', 'bidiRunSession']; - for (const methodName of sessionServiceStubMethods) { - const callPromise = this.sessionServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - if (methodName in this.descriptors.stream) { - const stream = new PassThrough({objectMode: true}); - setImmediate(() => { - stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); - }); - return stream; - } - 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.stream[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.sessionServiceStub; - } - - /** - * 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 'ces.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 'ces.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/ces', - '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 -- - // ------------------- -/** - * Initiates a single turn interaction with the CES agent within a - * session. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.ces.v1.SessionConfig} request.config - * Required. The configuration for the session. - * @param {number[]} request.inputs - * Required. Inputs for the session. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.RunSessionResponse|RunSessionResponse}. - * 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/session_service.run_session.js - * region_tag:ces_v1_generated_SessionService_RunSession_async - */ - runSession( - request?: protos.google.cloud.ces.v1.IRunSessionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IRunSessionResponse, - protos.google.cloud.ces.v1.IRunSessionRequest|undefined, {}|undefined - ]>; - runSession( - request: protos.google.cloud.ces.v1.IRunSessionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IRunSessionResponse, - protos.google.cloud.ces.v1.IRunSessionRequest|null|undefined, - {}|null|undefined>): void; - runSession( - request: protos.google.cloud.ces.v1.IRunSessionRequest, - callback: Callback< - protos.google.cloud.ces.v1.IRunSessionResponse, - protos.google.cloud.ces.v1.IRunSessionRequest|null|undefined, - {}|null|undefined>): void; - runSession( - request?: protos.google.cloud.ces.v1.IRunSessionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IRunSessionResponse, - protos.google.cloud.ces.v1.IRunSessionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IRunSessionResponse, - protos.google.cloud.ces.v1.IRunSessionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IRunSessionResponse, - protos.google.cloud.ces.v1.IRunSessionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'config.session': request.config!.session ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('runSession request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IRunSessionResponse, - protos.google.cloud.ces.v1.IRunSessionRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('runSession response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.runSession(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IRunSessionResponse, - protos.google.cloud.ces.v1.IRunSessionRequest|undefined, - {}|undefined - ]) => { - this._log.info('runSession response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Establishes a bidirectional streaming connection with the CES agent. - * The agent processes continuous multimodal inputs (e.g., text, audio) and - * generates real-time multimodal output streams. - * - * --- Client Request Stream --- - * The client streams requests in the following order: - * - * 1. Initialization: - * The first message must contain - * {@link protos.google.cloud.ces.v1.BidiSessionClientMessage.config|SessionConfig}. - * For audio sessions, this should also include - * {@link protos.google.cloud.ces.v1.SessionConfig.input_audio_config|InputAudioConfig} - * and - * {@link protos.google.cloud.ces.v1.SessionConfig.output_audio_config|OutputAudioConfig} - * to define audio processing and synthesis parameters. - * - * 2. Interaction: - * Subsequent messages stream - * {@link protos.google.cloud.ces.v1.BidiSessionClientMessage.realtime_input|SessionInput} - * containing real-time user input data. - * - * 3. Termination: - * The client should half-close the stream when there is no more user - * input. It should also half-close upon receiving - * {@link protos.google.cloud.ces.v1.BidiSessionServerMessage.end_session|EndSession} - * or {@link protos.google.cloud.ces.v1.BidiSessionServerMessage.go_away|GoAway} from - * the agent. - * - * --- Server Response Stream --- - * For each interaction turn, the agent streams messages in the following - * sequence: - * - * 1. Speech Recognition (First N messages): - * Contains - * {@link protos.google.cloud.ces.v1.BidiSessionServerMessage.recognition_result|RecognitionResult} - * representing the concatenated user speech segments captured so far. - * This is only populated for audio sessions. - * - * 2. Response (Next M messages): - * Contains - * {@link protos.google.cloud.ces.v1.BidiSessionServerMessage.session_output|SessionOutput} - * delivering the agent's response in various modalities (e.g., text, - * audio). - * - * 3. Turn Completion (Final message of the turn): - * Contains - * {@link protos.google.cloud.ces.v1.BidiSessionServerMessage.session_output|SessionOutput} - * with {@link protos.google.cloud.ces.v1.SessionOutput.turn_completed|turn_completed} - * set to true. This signals the end of the current turn and includes - * {@link protos.google.cloud.ces.v1.SessionOutput.diagnostic_info|DiagnosticInfo} - * with execution details. - * - * --- Audio Best Practices --- - * 1. Streaming: - * Stream {@link protos.google.cloud.ces.v1.SessionInput.audio|audio data} - * **CONTINUOUSLY**, even during silence. Recommended chunk size: 40-120ms - * (balances latency vs. efficiency). - * - * 2. Playback & Interruption: - * Play {@link protos.google.cloud.ces.v1.SessionOutput.audio|audio responses} upon - * receipt. Stop playback immediately if an - * {@link protos.google.cloud.ces.v1.BidiSessionServerMessage.interruption_signal|InterruptionSignal} - * is received (e.g., user barge-in or new agent response). - * - * @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 is both readable and writable. It accepts objects - * representing {@link protos.google.cloud.ces.v1.BidiSessionClientMessage|BidiSessionClientMessage} for write() method, and - * will emit objects representing {@link protos.google.cloud.ces.v1.BidiSessionServerMessage|BidiSessionServerMessage} on 'data' event asynchronously. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } - * for more details and examples. - * @example include:samples/generated/v1/session_service.bidi_run_session.js - * region_tag:ces_v1_generated_SessionService_BidiRunSession_async - */ - bidiRunSession( - options?: CallOptions): - gax.CancellableStream { - this.initialize().catch(err => {throw err}); - this._log.info('bidiRunSession stream %j', options); - return this.innerApiCalls.bidiRunSession(null, options); - } - -/** - * 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); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified agent resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} agent - * @returns {string} Resource name string. - */ - agentPath(project:string,location:string,app:string,agent:string) { - return this.pathTemplates.agentPathTemplate.render({ - project: project, - location: location, - app: app, - agent: agent, - }); - } - - /** - * Parse the project from Agent resource. - * - * @param {string} agentName - * A fully-qualified path representing Agent resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAgentName(agentName: string) { - return this.pathTemplates.agentPathTemplate.match(agentName).project; - } - - /** - * Parse the location from Agent resource. - * - * @param {string} agentName - * A fully-qualified path representing Agent resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAgentName(agentName: string) { - return this.pathTemplates.agentPathTemplate.match(agentName).location; - } - - /** - * Parse the app from Agent resource. - * - * @param {string} agentName - * A fully-qualified path representing Agent resource. - * @returns {string} A string representing the app. - */ - matchAppFromAgentName(agentName: string) { - return this.pathTemplates.agentPathTemplate.match(agentName).app; - } - - /** - * Parse the agent from Agent resource. - * - * @param {string} agentName - * A fully-qualified path representing Agent resource. - * @returns {string} A string representing the agent. - */ - matchAgentFromAgentName(agentName: string) { - return this.pathTemplates.agentPathTemplate.match(agentName).agent; - } - - /** - * Return a fully-qualified app resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @returns {string} Resource name string. - */ - appPath(project:string,location:string,app:string) { - return this.pathTemplates.appPathTemplate.render({ - project: project, - location: location, - app: app, - }); - } - - /** - * Parse the project from App resource. - * - * @param {string} appName - * A fully-qualified path representing App resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAppName(appName: string) { - return this.pathTemplates.appPathTemplate.match(appName).project; - } - - /** - * Parse the location from App resource. - * - * @param {string} appName - * A fully-qualified path representing App resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAppName(appName: string) { - return this.pathTemplates.appPathTemplate.match(appName).location; - } - - /** - * Parse the app from App resource. - * - * @param {string} appName - * A fully-qualified path representing App resource. - * @returns {string} A string representing the app. - */ - matchAppFromAppName(appName: string) { - return this.pathTemplates.appPathTemplate.match(appName).app; - } - - /** - * Return a fully-qualified appVersion resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} version - * @returns {string} Resource name string. - */ - appVersionPath(project:string,location:string,app:string,version:string) { - return this.pathTemplates.appVersionPathTemplate.render({ - project: project, - location: location, - app: app, - version: version, - }); - } - - /** - * Parse the project from AppVersion resource. - * - * @param {string} appVersionName - * A fully-qualified path representing AppVersion resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAppVersionName(appVersionName: string) { - return this.pathTemplates.appVersionPathTemplate.match(appVersionName).project; - } - - /** - * Parse the location from AppVersion resource. - * - * @param {string} appVersionName - * A fully-qualified path representing AppVersion resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAppVersionName(appVersionName: string) { - return this.pathTemplates.appVersionPathTemplate.match(appVersionName).location; - } - - /** - * Parse the app from AppVersion resource. - * - * @param {string} appVersionName - * A fully-qualified path representing AppVersion resource. - * @returns {string} A string representing the app. - */ - matchAppFromAppVersionName(appVersionName: string) { - return this.pathTemplates.appVersionPathTemplate.match(appVersionName).app; - } - - /** - * Parse the version from AppVersion resource. - * - * @param {string} appVersionName - * A fully-qualified path representing AppVersion resource. - * @returns {string} A string representing the version. - */ - matchVersionFromAppVersionName(appVersionName: string) { - return this.pathTemplates.appVersionPathTemplate.match(appVersionName).version; - } - - /** - * Return a fully-qualified changelog resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} changelog - * @returns {string} Resource name string. - */ - changelogPath(project:string,location:string,app:string,changelog:string) { - return this.pathTemplates.changelogPathTemplate.render({ - project: project, - location: location, - app: app, - changelog: changelog, - }); - } - - /** - * Parse the project from Changelog resource. - * - * @param {string} changelogName - * A fully-qualified path representing Changelog resource. - * @returns {string} A string representing the project. - */ - matchProjectFromChangelogName(changelogName: string) { - return this.pathTemplates.changelogPathTemplate.match(changelogName).project; - } - - /** - * Parse the location from Changelog resource. - * - * @param {string} changelogName - * A fully-qualified path representing Changelog resource. - * @returns {string} A string representing the location. - */ - matchLocationFromChangelogName(changelogName: string) { - return this.pathTemplates.changelogPathTemplate.match(changelogName).location; - } - - /** - * Parse the app from Changelog resource. - * - * @param {string} changelogName - * A fully-qualified path representing Changelog resource. - * @returns {string} A string representing the app. - */ - matchAppFromChangelogName(changelogName: string) { - return this.pathTemplates.changelogPathTemplate.match(changelogName).app; - } - - /** - * Parse the changelog from Changelog resource. - * - * @param {string} changelogName - * A fully-qualified path representing Changelog resource. - * @returns {string} A string representing the changelog. - */ - matchChangelogFromChangelogName(changelogName: string) { - return this.pathTemplates.changelogPathTemplate.match(changelogName).changelog; - } - - /** - * Return a fully-qualified conversation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} conversation - * @returns {string} Resource name string. - */ - conversationPath(project:string,location:string,app:string,conversation:string) { - return this.pathTemplates.conversationPathTemplate.render({ - project: project, - location: location, - app: app, - conversation: conversation, - }); - } - - /** - * Parse the project from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).project; - } - - /** - * Parse the location from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).location; - } - - /** - * Parse the app from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the app. - */ - matchAppFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).app; - } - - /** - * Parse the conversation from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the conversation. - */ - matchConversationFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).conversation; - } - - /** - * Return a fully-qualified deployment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} deployment - * @returns {string} Resource name string. - */ - deploymentPath(project:string,location:string,app:string,deployment:string) { - return this.pathTemplates.deploymentPathTemplate.render({ - project: project, - location: location, - app: app, - deployment: deployment, - }); - } - - /** - * Parse the project from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; - } - - /** - * Parse the location from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; - } - - /** - * Parse the app from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the app. - */ - matchAppFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).app; - } - - /** - * Parse the deployment from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the deployment. - */ - matchDeploymentFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; - } - - /** - * Return a fully-qualified example resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} example - * @returns {string} Resource name string. - */ - examplePath(project:string,location:string,app:string,example:string) { - return this.pathTemplates.examplePathTemplate.render({ - project: project, - location: location, - app: app, - example: example, - }); - } - - /** - * Parse the project from Example resource. - * - * @param {string} exampleName - * A fully-qualified path representing Example resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExampleName(exampleName: string) { - return this.pathTemplates.examplePathTemplate.match(exampleName).project; - } - - /** - * Parse the location from Example resource. - * - * @param {string} exampleName - * A fully-qualified path representing Example resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExampleName(exampleName: string) { - return this.pathTemplates.examplePathTemplate.match(exampleName).location; - } - - /** - * Parse the app from Example resource. - * - * @param {string} exampleName - * A fully-qualified path representing Example resource. - * @returns {string} A string representing the app. - */ - matchAppFromExampleName(exampleName: string) { - return this.pathTemplates.examplePathTemplate.match(exampleName).app; - } - - /** - * Parse the example from Example resource. - * - * @param {string} exampleName - * A fully-qualified path representing Example resource. - * @returns {string} A string representing the example. - */ - matchExampleFromExampleName(exampleName: string) { - return this.pathTemplates.examplePathTemplate.match(exampleName).example; - } - - /** - * Return a fully-qualified guardrail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} guardrail - * @returns {string} Resource name string. - */ - guardrailPath(project:string,location:string,app:string,guardrail:string) { - return this.pathTemplates.guardrailPathTemplate.render({ - project: project, - location: location, - app: app, - guardrail: guardrail, - }); - } - - /** - * Parse the project from Guardrail resource. - * - * @param {string} guardrailName - * A fully-qualified path representing Guardrail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromGuardrailName(guardrailName: string) { - return this.pathTemplates.guardrailPathTemplate.match(guardrailName).project; - } - - /** - * Parse the location from Guardrail resource. - * - * @param {string} guardrailName - * A fully-qualified path representing Guardrail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromGuardrailName(guardrailName: string) { - return this.pathTemplates.guardrailPathTemplate.match(guardrailName).location; - } - - /** - * Parse the app from Guardrail resource. - * - * @param {string} guardrailName - * A fully-qualified path representing Guardrail resource. - * @returns {string} A string representing the app. - */ - matchAppFromGuardrailName(guardrailName: string) { - return this.pathTemplates.guardrailPathTemplate.match(guardrailName).app; - } - - /** - * Parse the guardrail from Guardrail resource. - * - * @param {string} guardrailName - * A fully-qualified path representing Guardrail resource. - * @returns {string} A string representing the guardrail. - */ - matchGuardrailFromGuardrailName(guardrailName: string) { - return this.pathTemplates.guardrailPathTemplate.match(guardrailName).guardrail; - } - - /** - * Return a fully-qualified omnichannel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} omnichannel - * @returns {string} Resource name string. - */ - omnichannelPath(project:string,location:string,omnichannel:string) { - return this.pathTemplates.omnichannelPathTemplate.render({ - project: project, - location: location, - omnichannel: omnichannel, - }); - } - - /** - * Parse the project from Omnichannel resource. - * - * @param {string} omnichannelName - * A fully-qualified path representing Omnichannel resource. - * @returns {string} A string representing the project. - */ - matchProjectFromOmnichannelName(omnichannelName: string) { - return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).project; - } - - /** - * Parse the location from Omnichannel resource. - * - * @param {string} omnichannelName - * A fully-qualified path representing Omnichannel resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOmnichannelName(omnichannelName: string) { - return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).location; - } - - /** - * Parse the omnichannel from Omnichannel resource. - * - * @param {string} omnichannelName - * A fully-qualified path representing Omnichannel resource. - * @returns {string} A string representing the omnichannel. - */ - matchOmnichannelFromOmnichannelName(omnichannelName: string) { - return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).omnichannel; - } - - /** - * Return a fully-qualified session resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} session - * @returns {string} Resource name string. - */ - sessionPath(project:string,location:string,app:string,session:string) { - return this.pathTemplates.sessionPathTemplate.render({ - project: project, - location: location, - app: app, - session: session, - }); - } - - /** - * Parse the project from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).project; - } - - /** - * Parse the location from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).location; - } - - /** - * Parse the app from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the app. - */ - matchAppFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).app; - } - - /** - * Parse the session from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the session. - */ - matchSessionFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).session; - } - - /** - * Return a fully-qualified tool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} tool - * @returns {string} Resource name string. - */ - toolPath(project:string,location:string,app:string,tool:string) { - return this.pathTemplates.toolPathTemplate.render({ - project: project, - location: location, - app: app, - tool: tool, - }); - } - - /** - * Parse the project from Tool resource. - * - * @param {string} toolName - * A fully-qualified path representing Tool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromToolName(toolName: string) { - return this.pathTemplates.toolPathTemplate.match(toolName).project; - } - - /** - * Parse the location from Tool resource. - * - * @param {string} toolName - * A fully-qualified path representing Tool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromToolName(toolName: string) { - return this.pathTemplates.toolPathTemplate.match(toolName).location; - } - - /** - * Parse the app from Tool resource. - * - * @param {string} toolName - * A fully-qualified path representing Tool resource. - * @returns {string} A string representing the app. - */ - matchAppFromToolName(toolName: string) { - return this.pathTemplates.toolPathTemplate.match(toolName).app; - } - - /** - * Parse the tool from Tool resource. - * - * @param {string} toolName - * A fully-qualified path representing Tool resource. - * @returns {string} A string representing the tool. - */ - matchToolFromToolName(toolName: string) { - return this.pathTemplates.toolPathTemplate.match(toolName).tool; - } - - /** - * Return a fully-qualified toolset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} toolset - * @returns {string} Resource name string. - */ - toolsetPath(project:string,location:string,app:string,toolset:string) { - return this.pathTemplates.toolsetPathTemplate.render({ - project: project, - location: location, - app: app, - toolset: toolset, - }); - } - - /** - * Parse the project from Toolset resource. - * - * @param {string} toolsetName - * A fully-qualified path representing Toolset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromToolsetName(toolsetName: string) { - return this.pathTemplates.toolsetPathTemplate.match(toolsetName).project; - } - - /** - * Parse the location from Toolset resource. - * - * @param {string} toolsetName - * A fully-qualified path representing Toolset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromToolsetName(toolsetName: string) { - return this.pathTemplates.toolsetPathTemplate.match(toolsetName).location; - } - - /** - * Parse the app from Toolset resource. - * - * @param {string} toolsetName - * A fully-qualified path representing Toolset resource. - * @returns {string} A string representing the app. - */ - matchAppFromToolsetName(toolsetName: string) { - return this.pathTemplates.toolsetPathTemplate.match(toolsetName).app; - } - - /** - * Parse the toolset from Toolset resource. - * - * @param {string} toolsetName - * A fully-qualified path representing Toolset resource. - * @returns {string} A string representing the toolset. - */ - matchToolsetFromToolsetName(toolsetName: string) { - return this.pathTemplates.toolsetPathTemplate.match(toolsetName).toolset; - } - - /** - * 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.sessionServiceStub && !this._terminated) { - return this.sessionServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/src/v1/session_service_client_config.json b/owl-bot-staging/google-cloud-ces/src/v1/session_service_client_config.json deleted file mode 100644 index a34904d9094..00000000000 --- a/owl-bot-staging/google-cloud-ces/src/v1/session_service_client_config.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "interfaces": { - "google.cloud.ces.v1.SessionService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "RunSession": { - "timeout_millis": 220000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BidiRunSession": { - "timeout_millis": 3600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-ces/src/v1/session_service_proto_list.json b/owl-bot-staging/google-cloud-ces/src/v1/session_service_proto_list.json deleted file mode 100644 index 7f9a4c1d7f8..00000000000 --- a/owl-bot-staging/google-cloud-ces/src/v1/session_service_proto_list.json +++ /dev/null @@ -1,40 +0,0 @@ -[ - "../../protos/google/cloud/ces/v1/agent.proto", - "../../protos/google/cloud/ces/v1/agent_service.proto", - "../../protos/google/cloud/ces/v1/agent_transfers.proto", - "../../protos/google/cloud/ces/v1/app.proto", - "../../protos/google/cloud/ces/v1/app_version.proto", - "../../protos/google/cloud/ces/v1/auth.proto", - "../../protos/google/cloud/ces/v1/bigquery_export.proto", - "../../protos/google/cloud/ces/v1/changelog.proto", - "../../protos/google/cloud/ces/v1/client_function.proto", - "../../protos/google/cloud/ces/v1/common.proto", - "../../protos/google/cloud/ces/v1/connector_tool.proto", - "../../protos/google/cloud/ces/v1/connector_toolset.proto", - "../../protos/google/cloud/ces/v1/conversation.proto", - "../../protos/google/cloud/ces/v1/data_store.proto", - "../../protos/google/cloud/ces/v1/data_store_tool.proto", - "../../protos/google/cloud/ces/v1/deployment.proto", - "../../protos/google/cloud/ces/v1/example.proto", - "../../protos/google/cloud/ces/v1/fakes.proto", - "../../protos/google/cloud/ces/v1/file_search_tool.proto", - "../../protos/google/cloud/ces/v1/google_search_tool.proto", - "../../protos/google/cloud/ces/v1/guardrail.proto", - "../../protos/google/cloud/ces/v1/mcp_tool.proto", - "../../protos/google/cloud/ces/v1/mcp_toolset.proto", - "../../protos/google/cloud/ces/v1/omnichannel.proto", - "../../protos/google/cloud/ces/v1/omnichannel_service.proto", - "../../protos/google/cloud/ces/v1/open_api_tool.proto", - "../../protos/google/cloud/ces/v1/open_api_toolset.proto", - "../../protos/google/cloud/ces/v1/python_function.proto", - "../../protos/google/cloud/ces/v1/schema.proto", - "../../protos/google/cloud/ces/v1/search_suggestions.proto", - "../../protos/google/cloud/ces/v1/session_service.proto", - "../../protos/google/cloud/ces/v1/system_tool.proto", - "../../protos/google/cloud/ces/v1/tool.proto", - "../../protos/google/cloud/ces/v1/tool_service.proto", - "../../protos/google/cloud/ces/v1/toolset.proto", - "../../protos/google/cloud/ces/v1/toolset_tool.proto", - "../../protos/google/cloud/ces/v1/widget_service.proto", - "../../protos/google/cloud/ces/v1/widget_tool.proto" -] diff --git a/owl-bot-staging/google-cloud-ces/src/v1/tool_service_client.ts b/owl-bot-staging/google-cloud-ces/src/v1/tool_service_client.ts deleted file mode 100644 index a3caf366aac..00000000000 --- a/owl-bot-staging/google-cloud-ces/src/v1/tool_service_client.ts +++ /dev/null @@ -1,1431 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, LocationsClient, LocationProtos} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/tool_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './tool_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Tool service provides APIs for interacting with CES tools. - * @class - * @memberof v1 - */ -export class ToolServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('ces'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - toolServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ToolServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ToolServiceClient({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 ToolServiceClient; - 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 = 'ces.' + 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.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 = { - agentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/agents/{agent}' - ), - appPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}' - ), - appVersionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/versions/{version}' - ), - changelogPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}' - ), - conversationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}' - ), - deploymentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}' - ), - examplePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/examples/{example}' - ), - guardrailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}' - ), - omnichannelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/omnichannels/{omnichannel}' - ), - toolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/tools/{tool}' - ), - toolsetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}' - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.ces.v1.ToolService', 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.toolServiceStub) { - return this.toolServiceStub; - } - - // Put together the "service stub" for - // google.cloud.ces.v1.ToolService. - this.toolServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.ces.v1.ToolService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.ces.v1.ToolService, - 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 toolServiceStubMethods = - ['executeTool', 'retrieveToolSchema', 'retrieveTools']; - for (const methodName of toolServiceStubMethods) { - const callPromise = this.toolServiceStub.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 = - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.toolServiceStub; - } - - /** - * 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 'ces.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 'ces.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/ces', - '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 -- - // ------------------- -/** - * Executes the given tool with the given arguments. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} [request.tool] - * Optional. The name of the tool to execute. - * Format: - * projects/{project}/locations/{location}/apps/{app}/tools/{tool} - * @param {google.cloud.ces.v1.ToolsetTool} [request.toolsetTool] - * Optional. The toolset tool to execute. Only one tool should match the - * predicate from the toolset. Otherwise, an error will be returned. - * @param {string} request.parent - * Required. The resource name of the app which the tool/toolset belongs to. - * Format: `projects/{project}/locations/{location}/apps/{app}` - * @param {google.protobuf.Struct} [request.args] - * Optional. The input parameters and values for the tool in JSON object - * format. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.ExecuteToolResponse|ExecuteToolResponse}. - * 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/tool_service.execute_tool.js - * region_tag:ces_v1_generated_ToolService_ExecuteTool_async - */ - executeTool( - request?: protos.google.cloud.ces.v1.IExecuteToolRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IExecuteToolResponse, - protos.google.cloud.ces.v1.IExecuteToolRequest|undefined, {}|undefined - ]>; - executeTool( - request: protos.google.cloud.ces.v1.IExecuteToolRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IExecuteToolResponse, - protos.google.cloud.ces.v1.IExecuteToolRequest|null|undefined, - {}|null|undefined>): void; - executeTool( - request: protos.google.cloud.ces.v1.IExecuteToolRequest, - callback: Callback< - protos.google.cloud.ces.v1.IExecuteToolResponse, - protos.google.cloud.ces.v1.IExecuteToolRequest|null|undefined, - {}|null|undefined>): void; - executeTool( - request?: protos.google.cloud.ces.v1.IExecuteToolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IExecuteToolResponse, - protos.google.cloud.ces.v1.IExecuteToolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IExecuteToolResponse, - protos.google.cloud.ces.v1.IExecuteToolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IExecuteToolResponse, - protos.google.cloud.ces.v1.IExecuteToolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('executeTool request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IExecuteToolResponse, - protos.google.cloud.ces.v1.IExecuteToolRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('executeTool response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.executeTool(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IExecuteToolResponse, - protos.google.cloud.ces.v1.IExecuteToolRequest|undefined, - {}|undefined - ]) => { - this._log.info('executeTool response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Retrieve the schema of the given tool. The schema is computed on the fly - * for the given instance of the tool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} [request.tool] - * Optional. The name of the tool to retrieve the schema for. - * Format: - * projects/{project}/locations/{location}/apps/{app}/tools/{tool} - * @param {google.cloud.ces.v1.ToolsetTool} [request.toolsetTool] - * Optional. The toolset tool to retrieve the schema for. Only one tool - * should match the predicate from the toolset. Otherwise, an error will be - * returned. - * @param {string} request.parent - * Required. The resource name of the app which the tool/toolset belongs to. - * Format: `projects/{project}/locations/{location}/apps/{app}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.RetrieveToolSchemaResponse|RetrieveToolSchemaResponse}. - * 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/tool_service.retrieve_tool_schema.js - * region_tag:ces_v1_generated_ToolService_RetrieveToolSchema_async - */ - retrieveToolSchema( - request?: protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IRetrieveToolSchemaResponse, - protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest|undefined, {}|undefined - ]>; - retrieveToolSchema( - request: protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IRetrieveToolSchemaResponse, - protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest|null|undefined, - {}|null|undefined>): void; - retrieveToolSchema( - request: protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest, - callback: Callback< - protos.google.cloud.ces.v1.IRetrieveToolSchemaResponse, - protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest|null|undefined, - {}|null|undefined>): void; - retrieveToolSchema( - request?: protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IRetrieveToolSchemaResponse, - protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IRetrieveToolSchemaResponse, - protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IRetrieveToolSchemaResponse, - protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('retrieveToolSchema request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IRetrieveToolSchemaResponse, - protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('retrieveToolSchema response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.retrieveToolSchema(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IRetrieveToolSchemaResponse, - protos.google.cloud.ces.v1.IRetrieveToolSchemaRequest|undefined, - {}|undefined - ]) => { - this._log.info('retrieveToolSchema response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Retrieve the list of tools included in the specified toolset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.toolset - * Required. The name of the toolset to retrieve the tools for. - * Format: - * `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` - * @param {string[]} [request.toolIds] - * Optional. The identifiers of the tools to retrieve from the toolset. - * If empty, all tools in the toolset 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 {@link protos.google.cloud.ces.v1.RetrieveToolsResponse|RetrieveToolsResponse}. - * 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/tool_service.retrieve_tools.js - * region_tag:ces_v1_generated_ToolService_RetrieveTools_async - */ - retrieveTools( - request?: protos.google.cloud.ces.v1.IRetrieveToolsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IRetrieveToolsResponse, - protos.google.cloud.ces.v1.IRetrieveToolsRequest|undefined, {}|undefined - ]>; - retrieveTools( - request: protos.google.cloud.ces.v1.IRetrieveToolsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IRetrieveToolsResponse, - protos.google.cloud.ces.v1.IRetrieveToolsRequest|null|undefined, - {}|null|undefined>): void; - retrieveTools( - request: protos.google.cloud.ces.v1.IRetrieveToolsRequest, - callback: Callback< - protos.google.cloud.ces.v1.IRetrieveToolsResponse, - protos.google.cloud.ces.v1.IRetrieveToolsRequest|null|undefined, - {}|null|undefined>): void; - retrieveTools( - request?: protos.google.cloud.ces.v1.IRetrieveToolsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IRetrieveToolsResponse, - protos.google.cloud.ces.v1.IRetrieveToolsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IRetrieveToolsResponse, - protos.google.cloud.ces.v1.IRetrieveToolsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IRetrieveToolsResponse, - protos.google.cloud.ces.v1.IRetrieveToolsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'toolset': request.toolset ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('retrieveTools request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IRetrieveToolsResponse, - protos.google.cloud.ces.v1.IRetrieveToolsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('retrieveTools response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.retrieveTools(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IRetrieveToolsResponse, - protos.google.cloud.ces.v1.IRetrieveToolsRequest|undefined, - {}|undefined - ]) => { - this._log.info('retrieveTools response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Gets 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); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified agent resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} agent - * @returns {string} Resource name string. - */ - agentPath(project:string,location:string,app:string,agent:string) { - return this.pathTemplates.agentPathTemplate.render({ - project: project, - location: location, - app: app, - agent: agent, - }); - } - - /** - * Parse the project from Agent resource. - * - * @param {string} agentName - * A fully-qualified path representing Agent resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAgentName(agentName: string) { - return this.pathTemplates.agentPathTemplate.match(agentName).project; - } - - /** - * Parse the location from Agent resource. - * - * @param {string} agentName - * A fully-qualified path representing Agent resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAgentName(agentName: string) { - return this.pathTemplates.agentPathTemplate.match(agentName).location; - } - - /** - * Parse the app from Agent resource. - * - * @param {string} agentName - * A fully-qualified path representing Agent resource. - * @returns {string} A string representing the app. - */ - matchAppFromAgentName(agentName: string) { - return this.pathTemplates.agentPathTemplate.match(agentName).app; - } - - /** - * Parse the agent from Agent resource. - * - * @param {string} agentName - * A fully-qualified path representing Agent resource. - * @returns {string} A string representing the agent. - */ - matchAgentFromAgentName(agentName: string) { - return this.pathTemplates.agentPathTemplate.match(agentName).agent; - } - - /** - * Return a fully-qualified app resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @returns {string} Resource name string. - */ - appPath(project:string,location:string,app:string) { - return this.pathTemplates.appPathTemplate.render({ - project: project, - location: location, - app: app, - }); - } - - /** - * Parse the project from App resource. - * - * @param {string} appName - * A fully-qualified path representing App resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAppName(appName: string) { - return this.pathTemplates.appPathTemplate.match(appName).project; - } - - /** - * Parse the location from App resource. - * - * @param {string} appName - * A fully-qualified path representing App resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAppName(appName: string) { - return this.pathTemplates.appPathTemplate.match(appName).location; - } - - /** - * Parse the app from App resource. - * - * @param {string} appName - * A fully-qualified path representing App resource. - * @returns {string} A string representing the app. - */ - matchAppFromAppName(appName: string) { - return this.pathTemplates.appPathTemplate.match(appName).app; - } - - /** - * Return a fully-qualified appVersion resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} version - * @returns {string} Resource name string. - */ - appVersionPath(project:string,location:string,app:string,version:string) { - return this.pathTemplates.appVersionPathTemplate.render({ - project: project, - location: location, - app: app, - version: version, - }); - } - - /** - * Parse the project from AppVersion resource. - * - * @param {string} appVersionName - * A fully-qualified path representing AppVersion resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAppVersionName(appVersionName: string) { - return this.pathTemplates.appVersionPathTemplate.match(appVersionName).project; - } - - /** - * Parse the location from AppVersion resource. - * - * @param {string} appVersionName - * A fully-qualified path representing AppVersion resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAppVersionName(appVersionName: string) { - return this.pathTemplates.appVersionPathTemplate.match(appVersionName).location; - } - - /** - * Parse the app from AppVersion resource. - * - * @param {string} appVersionName - * A fully-qualified path representing AppVersion resource. - * @returns {string} A string representing the app. - */ - matchAppFromAppVersionName(appVersionName: string) { - return this.pathTemplates.appVersionPathTemplate.match(appVersionName).app; - } - - /** - * Parse the version from AppVersion resource. - * - * @param {string} appVersionName - * A fully-qualified path representing AppVersion resource. - * @returns {string} A string representing the version. - */ - matchVersionFromAppVersionName(appVersionName: string) { - return this.pathTemplates.appVersionPathTemplate.match(appVersionName).version; - } - - /** - * Return a fully-qualified changelog resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} changelog - * @returns {string} Resource name string. - */ - changelogPath(project:string,location:string,app:string,changelog:string) { - return this.pathTemplates.changelogPathTemplate.render({ - project: project, - location: location, - app: app, - changelog: changelog, - }); - } - - /** - * Parse the project from Changelog resource. - * - * @param {string} changelogName - * A fully-qualified path representing Changelog resource. - * @returns {string} A string representing the project. - */ - matchProjectFromChangelogName(changelogName: string) { - return this.pathTemplates.changelogPathTemplate.match(changelogName).project; - } - - /** - * Parse the location from Changelog resource. - * - * @param {string} changelogName - * A fully-qualified path representing Changelog resource. - * @returns {string} A string representing the location. - */ - matchLocationFromChangelogName(changelogName: string) { - return this.pathTemplates.changelogPathTemplate.match(changelogName).location; - } - - /** - * Parse the app from Changelog resource. - * - * @param {string} changelogName - * A fully-qualified path representing Changelog resource. - * @returns {string} A string representing the app. - */ - matchAppFromChangelogName(changelogName: string) { - return this.pathTemplates.changelogPathTemplate.match(changelogName).app; - } - - /** - * Parse the changelog from Changelog resource. - * - * @param {string} changelogName - * A fully-qualified path representing Changelog resource. - * @returns {string} A string representing the changelog. - */ - matchChangelogFromChangelogName(changelogName: string) { - return this.pathTemplates.changelogPathTemplate.match(changelogName).changelog; - } - - /** - * Return a fully-qualified conversation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} conversation - * @returns {string} Resource name string. - */ - conversationPath(project:string,location:string,app:string,conversation:string) { - return this.pathTemplates.conversationPathTemplate.render({ - project: project, - location: location, - app: app, - conversation: conversation, - }); - } - - /** - * Parse the project from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).project; - } - - /** - * Parse the location from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).location; - } - - /** - * Parse the app from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the app. - */ - matchAppFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).app; - } - - /** - * Parse the conversation from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the conversation. - */ - matchConversationFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).conversation; - } - - /** - * Return a fully-qualified deployment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} deployment - * @returns {string} Resource name string. - */ - deploymentPath(project:string,location:string,app:string,deployment:string) { - return this.pathTemplates.deploymentPathTemplate.render({ - project: project, - location: location, - app: app, - deployment: deployment, - }); - } - - /** - * Parse the project from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; - } - - /** - * Parse the location from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; - } - - /** - * Parse the app from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the app. - */ - matchAppFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).app; - } - - /** - * Parse the deployment from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the deployment. - */ - matchDeploymentFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; - } - - /** - * Return a fully-qualified example resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} example - * @returns {string} Resource name string. - */ - examplePath(project:string,location:string,app:string,example:string) { - return this.pathTemplates.examplePathTemplate.render({ - project: project, - location: location, - app: app, - example: example, - }); - } - - /** - * Parse the project from Example resource. - * - * @param {string} exampleName - * A fully-qualified path representing Example resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExampleName(exampleName: string) { - return this.pathTemplates.examplePathTemplate.match(exampleName).project; - } - - /** - * Parse the location from Example resource. - * - * @param {string} exampleName - * A fully-qualified path representing Example resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExampleName(exampleName: string) { - return this.pathTemplates.examplePathTemplate.match(exampleName).location; - } - - /** - * Parse the app from Example resource. - * - * @param {string} exampleName - * A fully-qualified path representing Example resource. - * @returns {string} A string representing the app. - */ - matchAppFromExampleName(exampleName: string) { - return this.pathTemplates.examplePathTemplate.match(exampleName).app; - } - - /** - * Parse the example from Example resource. - * - * @param {string} exampleName - * A fully-qualified path representing Example resource. - * @returns {string} A string representing the example. - */ - matchExampleFromExampleName(exampleName: string) { - return this.pathTemplates.examplePathTemplate.match(exampleName).example; - } - - /** - * Return a fully-qualified guardrail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} guardrail - * @returns {string} Resource name string. - */ - guardrailPath(project:string,location:string,app:string,guardrail:string) { - return this.pathTemplates.guardrailPathTemplate.render({ - project: project, - location: location, - app: app, - guardrail: guardrail, - }); - } - - /** - * Parse the project from Guardrail resource. - * - * @param {string} guardrailName - * A fully-qualified path representing Guardrail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromGuardrailName(guardrailName: string) { - return this.pathTemplates.guardrailPathTemplate.match(guardrailName).project; - } - - /** - * Parse the location from Guardrail resource. - * - * @param {string} guardrailName - * A fully-qualified path representing Guardrail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromGuardrailName(guardrailName: string) { - return this.pathTemplates.guardrailPathTemplate.match(guardrailName).location; - } - - /** - * Parse the app from Guardrail resource. - * - * @param {string} guardrailName - * A fully-qualified path representing Guardrail resource. - * @returns {string} A string representing the app. - */ - matchAppFromGuardrailName(guardrailName: string) { - return this.pathTemplates.guardrailPathTemplate.match(guardrailName).app; - } - - /** - * Parse the guardrail from Guardrail resource. - * - * @param {string} guardrailName - * A fully-qualified path representing Guardrail resource. - * @returns {string} A string representing the guardrail. - */ - matchGuardrailFromGuardrailName(guardrailName: string) { - return this.pathTemplates.guardrailPathTemplate.match(guardrailName).guardrail; - } - - /** - * Return a fully-qualified omnichannel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} omnichannel - * @returns {string} Resource name string. - */ - omnichannelPath(project:string,location:string,omnichannel:string) { - return this.pathTemplates.omnichannelPathTemplate.render({ - project: project, - location: location, - omnichannel: omnichannel, - }); - } - - /** - * Parse the project from Omnichannel resource. - * - * @param {string} omnichannelName - * A fully-qualified path representing Omnichannel resource. - * @returns {string} A string representing the project. - */ - matchProjectFromOmnichannelName(omnichannelName: string) { - return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).project; - } - - /** - * Parse the location from Omnichannel resource. - * - * @param {string} omnichannelName - * A fully-qualified path representing Omnichannel resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOmnichannelName(omnichannelName: string) { - return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).location; - } - - /** - * Parse the omnichannel from Omnichannel resource. - * - * @param {string} omnichannelName - * A fully-qualified path representing Omnichannel resource. - * @returns {string} A string representing the omnichannel. - */ - matchOmnichannelFromOmnichannelName(omnichannelName: string) { - return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).omnichannel; - } - - /** - * Return a fully-qualified tool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} tool - * @returns {string} Resource name string. - */ - toolPath(project:string,location:string,app:string,tool:string) { - return this.pathTemplates.toolPathTemplate.render({ - project: project, - location: location, - app: app, - tool: tool, - }); - } - - /** - * Parse the project from Tool resource. - * - * @param {string} toolName - * A fully-qualified path representing Tool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromToolName(toolName: string) { - return this.pathTemplates.toolPathTemplate.match(toolName).project; - } - - /** - * Parse the location from Tool resource. - * - * @param {string} toolName - * A fully-qualified path representing Tool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromToolName(toolName: string) { - return this.pathTemplates.toolPathTemplate.match(toolName).location; - } - - /** - * Parse the app from Tool resource. - * - * @param {string} toolName - * A fully-qualified path representing Tool resource. - * @returns {string} A string representing the app. - */ - matchAppFromToolName(toolName: string) { - return this.pathTemplates.toolPathTemplate.match(toolName).app; - } - - /** - * Parse the tool from Tool resource. - * - * @param {string} toolName - * A fully-qualified path representing Tool resource. - * @returns {string} A string representing the tool. - */ - matchToolFromToolName(toolName: string) { - return this.pathTemplates.toolPathTemplate.match(toolName).tool; - } - - /** - * Return a fully-qualified toolset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} toolset - * @returns {string} Resource name string. - */ - toolsetPath(project:string,location:string,app:string,toolset:string) { - return this.pathTemplates.toolsetPathTemplate.render({ - project: project, - location: location, - app: app, - toolset: toolset, - }); - } - - /** - * Parse the project from Toolset resource. - * - * @param {string} toolsetName - * A fully-qualified path representing Toolset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromToolsetName(toolsetName: string) { - return this.pathTemplates.toolsetPathTemplate.match(toolsetName).project; - } - - /** - * Parse the location from Toolset resource. - * - * @param {string} toolsetName - * A fully-qualified path representing Toolset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromToolsetName(toolsetName: string) { - return this.pathTemplates.toolsetPathTemplate.match(toolsetName).location; - } - - /** - * Parse the app from Toolset resource. - * - * @param {string} toolsetName - * A fully-qualified path representing Toolset resource. - * @returns {string} A string representing the app. - */ - matchAppFromToolsetName(toolsetName: string) { - return this.pathTemplates.toolsetPathTemplate.match(toolsetName).app; - } - - /** - * Parse the toolset from Toolset resource. - * - * @param {string} toolsetName - * A fully-qualified path representing Toolset resource. - * @returns {string} A string representing the toolset. - */ - matchToolsetFromToolsetName(toolsetName: string) { - return this.pathTemplates.toolsetPathTemplate.match(toolsetName).toolset; - } - - /** - * 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.toolServiceStub && !this._terminated) { - return this.toolServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/src/v1/tool_service_client_config.json b/owl-bot-staging/google-cloud-ces/src/v1/tool_service_client_config.json deleted file mode 100644 index 313bee156d6..00000000000 --- a/owl-bot-staging/google-cloud-ces/src/v1/tool_service_client_config.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "interfaces": { - "google.cloud.ces.v1.ToolService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ExecuteTool": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "RetrieveToolSchema": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "RetrieveTools": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-ces/src/v1/tool_service_proto_list.json b/owl-bot-staging/google-cloud-ces/src/v1/tool_service_proto_list.json deleted file mode 100644 index 7f9a4c1d7f8..00000000000 --- a/owl-bot-staging/google-cloud-ces/src/v1/tool_service_proto_list.json +++ /dev/null @@ -1,40 +0,0 @@ -[ - "../../protos/google/cloud/ces/v1/agent.proto", - "../../protos/google/cloud/ces/v1/agent_service.proto", - "../../protos/google/cloud/ces/v1/agent_transfers.proto", - "../../protos/google/cloud/ces/v1/app.proto", - "../../protos/google/cloud/ces/v1/app_version.proto", - "../../protos/google/cloud/ces/v1/auth.proto", - "../../protos/google/cloud/ces/v1/bigquery_export.proto", - "../../protos/google/cloud/ces/v1/changelog.proto", - "../../protos/google/cloud/ces/v1/client_function.proto", - "../../protos/google/cloud/ces/v1/common.proto", - "../../protos/google/cloud/ces/v1/connector_tool.proto", - "../../protos/google/cloud/ces/v1/connector_toolset.proto", - "../../protos/google/cloud/ces/v1/conversation.proto", - "../../protos/google/cloud/ces/v1/data_store.proto", - "../../protos/google/cloud/ces/v1/data_store_tool.proto", - "../../protos/google/cloud/ces/v1/deployment.proto", - "../../protos/google/cloud/ces/v1/example.proto", - "../../protos/google/cloud/ces/v1/fakes.proto", - "../../protos/google/cloud/ces/v1/file_search_tool.proto", - "../../protos/google/cloud/ces/v1/google_search_tool.proto", - "../../protos/google/cloud/ces/v1/guardrail.proto", - "../../protos/google/cloud/ces/v1/mcp_tool.proto", - "../../protos/google/cloud/ces/v1/mcp_toolset.proto", - "../../protos/google/cloud/ces/v1/omnichannel.proto", - "../../protos/google/cloud/ces/v1/omnichannel_service.proto", - "../../protos/google/cloud/ces/v1/open_api_tool.proto", - "../../protos/google/cloud/ces/v1/open_api_toolset.proto", - "../../protos/google/cloud/ces/v1/python_function.proto", - "../../protos/google/cloud/ces/v1/schema.proto", - "../../protos/google/cloud/ces/v1/search_suggestions.proto", - "../../protos/google/cloud/ces/v1/session_service.proto", - "../../protos/google/cloud/ces/v1/system_tool.proto", - "../../protos/google/cloud/ces/v1/tool.proto", - "../../protos/google/cloud/ces/v1/tool_service.proto", - "../../protos/google/cloud/ces/v1/toolset.proto", - "../../protos/google/cloud/ces/v1/toolset_tool.proto", - "../../protos/google/cloud/ces/v1/widget_service.proto", - "../../protos/google/cloud/ces/v1/widget_tool.proto" -] diff --git a/owl-bot-staging/google-cloud-ces/src/v1/widget_service_client.ts b/owl-bot-staging/google-cloud-ces/src/v1/widget_service_client.ts deleted file mode 100644 index 4192fca5f6f..00000000000 --- a/owl-bot-staging/google-cloud-ces/src/v1/widget_service_client.ts +++ /dev/null @@ -1,1291 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, LocationsClient, LocationProtos} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/widget_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './widget_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Provides APIs for widgets to interact with CES APIs. - * @class - * @memberof v1 - */ -export class WidgetServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('ces'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - widgetServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of WidgetServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new WidgetServiceClient({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 WidgetServiceClient; - 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 = 'ces.' + 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.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 = { - agentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/agents/{agent}' - ), - appPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}' - ), - appVersionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/versions/{version}' - ), - changelogPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}' - ), - conversationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}' - ), - deploymentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}' - ), - examplePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/examples/{example}' - ), - guardrailPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}' - ), - omnichannelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/omnichannels/{omnichannel}' - ), - sessionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/sessions/{session}' - ), - toolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/tools/{tool}' - ), - toolsetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}' - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.ces.v1.WidgetService', 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.widgetServiceStub) { - return this.widgetServiceStub; - } - - // Put together the "service stub" for - // google.cloud.ces.v1.WidgetService. - this.widgetServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.ces.v1.WidgetService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.ces.v1.WidgetService, - 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 widgetServiceStubMethods = - ['generateChatToken']; - for (const methodName of widgetServiceStubMethods) { - const callPromise = this.widgetServiceStub.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 = - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.widgetServiceStub; - } - - /** - * 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 'ces.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 'ces.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/ces', - '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 -- - // ------------------- -/** - * Generates a session scoped token for chat widget to authenticate with - * Session APIs. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The session name to generate the chat token for. - * Format: - * projects/{project}/locations/{location}/apps/{app}/sessions/{session} - * @param {string} request.deployment - * Required. The deployment of the app to use for the session. - * Format: - * projects/{project}/locations/{location}/apps/{app}/deployments/{deployment} - * @param {string} [request.recaptchaToken] - * Optional. The reCAPTCHA token generated by the client-side chat widget. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.ces.v1.GenerateChatTokenResponse|GenerateChatTokenResponse}. - * 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/widget_service.generate_chat_token.js - * region_tag:ces_v1_generated_WidgetService_GenerateChatToken_async - */ - generateChatToken( - request?: protos.google.cloud.ces.v1.IGenerateChatTokenRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.ces.v1.IGenerateChatTokenResponse, - protos.google.cloud.ces.v1.IGenerateChatTokenRequest|undefined, {}|undefined - ]>; - generateChatToken( - request: protos.google.cloud.ces.v1.IGenerateChatTokenRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.ces.v1.IGenerateChatTokenResponse, - protos.google.cloud.ces.v1.IGenerateChatTokenRequest|null|undefined, - {}|null|undefined>): void; - generateChatToken( - request: protos.google.cloud.ces.v1.IGenerateChatTokenRequest, - callback: Callback< - protos.google.cloud.ces.v1.IGenerateChatTokenResponse, - protos.google.cloud.ces.v1.IGenerateChatTokenRequest|null|undefined, - {}|null|undefined>): void; - generateChatToken( - request?: protos.google.cloud.ces.v1.IGenerateChatTokenRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.ces.v1.IGenerateChatTokenResponse, - protos.google.cloud.ces.v1.IGenerateChatTokenRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.ces.v1.IGenerateChatTokenResponse, - protos.google.cloud.ces.v1.IGenerateChatTokenRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.ces.v1.IGenerateChatTokenResponse, - protos.google.cloud.ces.v1.IGenerateChatTokenRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('generateChatToken request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.ces.v1.IGenerateChatTokenResponse, - protos.google.cloud.ces.v1.IGenerateChatTokenRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('generateChatToken response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.generateChatToken(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.ces.v1.IGenerateChatTokenResponse, - protos.google.cloud.ces.v1.IGenerateChatTokenRequest|undefined, - {}|undefined - ]) => { - this._log.info('generateChatToken response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Gets 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); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified agent resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} agent - * @returns {string} Resource name string. - */ - agentPath(project:string,location:string,app:string,agent:string) { - return this.pathTemplates.agentPathTemplate.render({ - project: project, - location: location, - app: app, - agent: agent, - }); - } - - /** - * Parse the project from Agent resource. - * - * @param {string} agentName - * A fully-qualified path representing Agent resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAgentName(agentName: string) { - return this.pathTemplates.agentPathTemplate.match(agentName).project; - } - - /** - * Parse the location from Agent resource. - * - * @param {string} agentName - * A fully-qualified path representing Agent resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAgentName(agentName: string) { - return this.pathTemplates.agentPathTemplate.match(agentName).location; - } - - /** - * Parse the app from Agent resource. - * - * @param {string} agentName - * A fully-qualified path representing Agent resource. - * @returns {string} A string representing the app. - */ - matchAppFromAgentName(agentName: string) { - return this.pathTemplates.agentPathTemplate.match(agentName).app; - } - - /** - * Parse the agent from Agent resource. - * - * @param {string} agentName - * A fully-qualified path representing Agent resource. - * @returns {string} A string representing the agent. - */ - matchAgentFromAgentName(agentName: string) { - return this.pathTemplates.agentPathTemplate.match(agentName).agent; - } - - /** - * Return a fully-qualified app resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @returns {string} Resource name string. - */ - appPath(project:string,location:string,app:string) { - return this.pathTemplates.appPathTemplate.render({ - project: project, - location: location, - app: app, - }); - } - - /** - * Parse the project from App resource. - * - * @param {string} appName - * A fully-qualified path representing App resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAppName(appName: string) { - return this.pathTemplates.appPathTemplate.match(appName).project; - } - - /** - * Parse the location from App resource. - * - * @param {string} appName - * A fully-qualified path representing App resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAppName(appName: string) { - return this.pathTemplates.appPathTemplate.match(appName).location; - } - - /** - * Parse the app from App resource. - * - * @param {string} appName - * A fully-qualified path representing App resource. - * @returns {string} A string representing the app. - */ - matchAppFromAppName(appName: string) { - return this.pathTemplates.appPathTemplate.match(appName).app; - } - - /** - * Return a fully-qualified appVersion resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} version - * @returns {string} Resource name string. - */ - appVersionPath(project:string,location:string,app:string,version:string) { - return this.pathTemplates.appVersionPathTemplate.render({ - project: project, - location: location, - app: app, - version: version, - }); - } - - /** - * Parse the project from AppVersion resource. - * - * @param {string} appVersionName - * A fully-qualified path representing AppVersion resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAppVersionName(appVersionName: string) { - return this.pathTemplates.appVersionPathTemplate.match(appVersionName).project; - } - - /** - * Parse the location from AppVersion resource. - * - * @param {string} appVersionName - * A fully-qualified path representing AppVersion resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAppVersionName(appVersionName: string) { - return this.pathTemplates.appVersionPathTemplate.match(appVersionName).location; - } - - /** - * Parse the app from AppVersion resource. - * - * @param {string} appVersionName - * A fully-qualified path representing AppVersion resource. - * @returns {string} A string representing the app. - */ - matchAppFromAppVersionName(appVersionName: string) { - return this.pathTemplates.appVersionPathTemplate.match(appVersionName).app; - } - - /** - * Parse the version from AppVersion resource. - * - * @param {string} appVersionName - * A fully-qualified path representing AppVersion resource. - * @returns {string} A string representing the version. - */ - matchVersionFromAppVersionName(appVersionName: string) { - return this.pathTemplates.appVersionPathTemplate.match(appVersionName).version; - } - - /** - * Return a fully-qualified changelog resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} changelog - * @returns {string} Resource name string. - */ - changelogPath(project:string,location:string,app:string,changelog:string) { - return this.pathTemplates.changelogPathTemplate.render({ - project: project, - location: location, - app: app, - changelog: changelog, - }); - } - - /** - * Parse the project from Changelog resource. - * - * @param {string} changelogName - * A fully-qualified path representing Changelog resource. - * @returns {string} A string representing the project. - */ - matchProjectFromChangelogName(changelogName: string) { - return this.pathTemplates.changelogPathTemplate.match(changelogName).project; - } - - /** - * Parse the location from Changelog resource. - * - * @param {string} changelogName - * A fully-qualified path representing Changelog resource. - * @returns {string} A string representing the location. - */ - matchLocationFromChangelogName(changelogName: string) { - return this.pathTemplates.changelogPathTemplate.match(changelogName).location; - } - - /** - * Parse the app from Changelog resource. - * - * @param {string} changelogName - * A fully-qualified path representing Changelog resource. - * @returns {string} A string representing the app. - */ - matchAppFromChangelogName(changelogName: string) { - return this.pathTemplates.changelogPathTemplate.match(changelogName).app; - } - - /** - * Parse the changelog from Changelog resource. - * - * @param {string} changelogName - * A fully-qualified path representing Changelog resource. - * @returns {string} A string representing the changelog. - */ - matchChangelogFromChangelogName(changelogName: string) { - return this.pathTemplates.changelogPathTemplate.match(changelogName).changelog; - } - - /** - * Return a fully-qualified conversation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} conversation - * @returns {string} Resource name string. - */ - conversationPath(project:string,location:string,app:string,conversation:string) { - return this.pathTemplates.conversationPathTemplate.render({ - project: project, - location: location, - app: app, - conversation: conversation, - }); - } - - /** - * Parse the project from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).project; - } - - /** - * Parse the location from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).location; - } - - /** - * Parse the app from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the app. - */ - matchAppFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).app; - } - - /** - * Parse the conversation from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the conversation. - */ - matchConversationFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).conversation; - } - - /** - * Return a fully-qualified deployment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} deployment - * @returns {string} Resource name string. - */ - deploymentPath(project:string,location:string,app:string,deployment:string) { - return this.pathTemplates.deploymentPathTemplate.render({ - project: project, - location: location, - app: app, - deployment: deployment, - }); - } - - /** - * Parse the project from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; - } - - /** - * Parse the location from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; - } - - /** - * Parse the app from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the app. - */ - matchAppFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).app; - } - - /** - * Parse the deployment from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the deployment. - */ - matchDeploymentFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; - } - - /** - * Return a fully-qualified example resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} example - * @returns {string} Resource name string. - */ - examplePath(project:string,location:string,app:string,example:string) { - return this.pathTemplates.examplePathTemplate.render({ - project: project, - location: location, - app: app, - example: example, - }); - } - - /** - * Parse the project from Example resource. - * - * @param {string} exampleName - * A fully-qualified path representing Example resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExampleName(exampleName: string) { - return this.pathTemplates.examplePathTemplate.match(exampleName).project; - } - - /** - * Parse the location from Example resource. - * - * @param {string} exampleName - * A fully-qualified path representing Example resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExampleName(exampleName: string) { - return this.pathTemplates.examplePathTemplate.match(exampleName).location; - } - - /** - * Parse the app from Example resource. - * - * @param {string} exampleName - * A fully-qualified path representing Example resource. - * @returns {string} A string representing the app. - */ - matchAppFromExampleName(exampleName: string) { - return this.pathTemplates.examplePathTemplate.match(exampleName).app; - } - - /** - * Parse the example from Example resource. - * - * @param {string} exampleName - * A fully-qualified path representing Example resource. - * @returns {string} A string representing the example. - */ - matchExampleFromExampleName(exampleName: string) { - return this.pathTemplates.examplePathTemplate.match(exampleName).example; - } - - /** - * Return a fully-qualified guardrail resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} guardrail - * @returns {string} Resource name string. - */ - guardrailPath(project:string,location:string,app:string,guardrail:string) { - return this.pathTemplates.guardrailPathTemplate.render({ - project: project, - location: location, - app: app, - guardrail: guardrail, - }); - } - - /** - * Parse the project from Guardrail resource. - * - * @param {string} guardrailName - * A fully-qualified path representing Guardrail resource. - * @returns {string} A string representing the project. - */ - matchProjectFromGuardrailName(guardrailName: string) { - return this.pathTemplates.guardrailPathTemplate.match(guardrailName).project; - } - - /** - * Parse the location from Guardrail resource. - * - * @param {string} guardrailName - * A fully-qualified path representing Guardrail resource. - * @returns {string} A string representing the location. - */ - matchLocationFromGuardrailName(guardrailName: string) { - return this.pathTemplates.guardrailPathTemplate.match(guardrailName).location; - } - - /** - * Parse the app from Guardrail resource. - * - * @param {string} guardrailName - * A fully-qualified path representing Guardrail resource. - * @returns {string} A string representing the app. - */ - matchAppFromGuardrailName(guardrailName: string) { - return this.pathTemplates.guardrailPathTemplate.match(guardrailName).app; - } - - /** - * Parse the guardrail from Guardrail resource. - * - * @param {string} guardrailName - * A fully-qualified path representing Guardrail resource. - * @returns {string} A string representing the guardrail. - */ - matchGuardrailFromGuardrailName(guardrailName: string) { - return this.pathTemplates.guardrailPathTemplate.match(guardrailName).guardrail; - } - - /** - * Return a fully-qualified omnichannel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} omnichannel - * @returns {string} Resource name string. - */ - omnichannelPath(project:string,location:string,omnichannel:string) { - return this.pathTemplates.omnichannelPathTemplate.render({ - project: project, - location: location, - omnichannel: omnichannel, - }); - } - - /** - * Parse the project from Omnichannel resource. - * - * @param {string} omnichannelName - * A fully-qualified path representing Omnichannel resource. - * @returns {string} A string representing the project. - */ - matchProjectFromOmnichannelName(omnichannelName: string) { - return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).project; - } - - /** - * Parse the location from Omnichannel resource. - * - * @param {string} omnichannelName - * A fully-qualified path representing Omnichannel resource. - * @returns {string} A string representing the location. - */ - matchLocationFromOmnichannelName(omnichannelName: string) { - return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).location; - } - - /** - * Parse the omnichannel from Omnichannel resource. - * - * @param {string} omnichannelName - * A fully-qualified path representing Omnichannel resource. - * @returns {string} A string representing the omnichannel. - */ - matchOmnichannelFromOmnichannelName(omnichannelName: string) { - return this.pathTemplates.omnichannelPathTemplate.match(omnichannelName).omnichannel; - } - - /** - * Return a fully-qualified session resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} session - * @returns {string} Resource name string. - */ - sessionPath(project:string,location:string,app:string,session:string) { - return this.pathTemplates.sessionPathTemplate.render({ - project: project, - location: location, - app: app, - session: session, - }); - } - - /** - * Parse the project from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).project; - } - - /** - * Parse the location from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).location; - } - - /** - * Parse the app from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the app. - */ - matchAppFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).app; - } - - /** - * Parse the session from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the session. - */ - matchSessionFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).session; - } - - /** - * Return a fully-qualified tool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} tool - * @returns {string} Resource name string. - */ - toolPath(project:string,location:string,app:string,tool:string) { - return this.pathTemplates.toolPathTemplate.render({ - project: project, - location: location, - app: app, - tool: tool, - }); - } - - /** - * Parse the project from Tool resource. - * - * @param {string} toolName - * A fully-qualified path representing Tool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromToolName(toolName: string) { - return this.pathTemplates.toolPathTemplate.match(toolName).project; - } - - /** - * Parse the location from Tool resource. - * - * @param {string} toolName - * A fully-qualified path representing Tool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromToolName(toolName: string) { - return this.pathTemplates.toolPathTemplate.match(toolName).location; - } - - /** - * Parse the app from Tool resource. - * - * @param {string} toolName - * A fully-qualified path representing Tool resource. - * @returns {string} A string representing the app. - */ - matchAppFromToolName(toolName: string) { - return this.pathTemplates.toolPathTemplate.match(toolName).app; - } - - /** - * Parse the tool from Tool resource. - * - * @param {string} toolName - * A fully-qualified path representing Tool resource. - * @returns {string} A string representing the tool. - */ - matchToolFromToolName(toolName: string) { - return this.pathTemplates.toolPathTemplate.match(toolName).tool; - } - - /** - * Return a fully-qualified toolset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} app - * @param {string} toolset - * @returns {string} Resource name string. - */ - toolsetPath(project:string,location:string,app:string,toolset:string) { - return this.pathTemplates.toolsetPathTemplate.render({ - project: project, - location: location, - app: app, - toolset: toolset, - }); - } - - /** - * Parse the project from Toolset resource. - * - * @param {string} toolsetName - * A fully-qualified path representing Toolset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromToolsetName(toolsetName: string) { - return this.pathTemplates.toolsetPathTemplate.match(toolsetName).project; - } - - /** - * Parse the location from Toolset resource. - * - * @param {string} toolsetName - * A fully-qualified path representing Toolset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromToolsetName(toolsetName: string) { - return this.pathTemplates.toolsetPathTemplate.match(toolsetName).location; - } - - /** - * Parse the app from Toolset resource. - * - * @param {string} toolsetName - * A fully-qualified path representing Toolset resource. - * @returns {string} A string representing the app. - */ - matchAppFromToolsetName(toolsetName: string) { - return this.pathTemplates.toolsetPathTemplate.match(toolsetName).app; - } - - /** - * Parse the toolset from Toolset resource. - * - * @param {string} toolsetName - * A fully-qualified path representing Toolset resource. - * @returns {string} A string representing the toolset. - */ - matchToolsetFromToolsetName(toolsetName: string) { - return this.pathTemplates.toolsetPathTemplate.match(toolsetName).toolset; - } - - /** - * 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.widgetServiceStub && !this._terminated) { - return this.widgetServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-ces/src/v1/widget_service_client_config.json b/owl-bot-staging/google-cloud-ces/src/v1/widget_service_client_config.json deleted file mode 100644 index 562d960fe94..00000000000 --- a/owl-bot-staging/google-cloud-ces/src/v1/widget_service_client_config.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "interfaces": { - "google.cloud.ces.v1.WidgetService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "GenerateChatToken": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-ces/src/v1/widget_service_proto_list.json b/owl-bot-staging/google-cloud-ces/src/v1/widget_service_proto_list.json deleted file mode 100644 index 7f9a4c1d7f8..00000000000 --- a/owl-bot-staging/google-cloud-ces/src/v1/widget_service_proto_list.json +++ /dev/null @@ -1,40 +0,0 @@ -[ - "../../protos/google/cloud/ces/v1/agent.proto", - "../../protos/google/cloud/ces/v1/agent_service.proto", - "../../protos/google/cloud/ces/v1/agent_transfers.proto", - "../../protos/google/cloud/ces/v1/app.proto", - "../../protos/google/cloud/ces/v1/app_version.proto", - "../../protos/google/cloud/ces/v1/auth.proto", - "../../protos/google/cloud/ces/v1/bigquery_export.proto", - "../../protos/google/cloud/ces/v1/changelog.proto", - "../../protos/google/cloud/ces/v1/client_function.proto", - "../../protos/google/cloud/ces/v1/common.proto", - "../../protos/google/cloud/ces/v1/connector_tool.proto", - "../../protos/google/cloud/ces/v1/connector_toolset.proto", - "../../protos/google/cloud/ces/v1/conversation.proto", - "../../protos/google/cloud/ces/v1/data_store.proto", - "../../protos/google/cloud/ces/v1/data_store_tool.proto", - "../../protos/google/cloud/ces/v1/deployment.proto", - "../../protos/google/cloud/ces/v1/example.proto", - "../../protos/google/cloud/ces/v1/fakes.proto", - "../../protos/google/cloud/ces/v1/file_search_tool.proto", - "../../protos/google/cloud/ces/v1/google_search_tool.proto", - "../../protos/google/cloud/ces/v1/guardrail.proto", - "../../protos/google/cloud/ces/v1/mcp_tool.proto", - "../../protos/google/cloud/ces/v1/mcp_toolset.proto", - "../../protos/google/cloud/ces/v1/omnichannel.proto", - "../../protos/google/cloud/ces/v1/omnichannel_service.proto", - "../../protos/google/cloud/ces/v1/open_api_tool.proto", - "../../protos/google/cloud/ces/v1/open_api_toolset.proto", - "../../protos/google/cloud/ces/v1/python_function.proto", - "../../protos/google/cloud/ces/v1/schema.proto", - "../../protos/google/cloud/ces/v1/search_suggestions.proto", - "../../protos/google/cloud/ces/v1/session_service.proto", - "../../protos/google/cloud/ces/v1/system_tool.proto", - "../../protos/google/cloud/ces/v1/tool.proto", - "../../protos/google/cloud/ces/v1/tool_service.proto", - "../../protos/google/cloud/ces/v1/toolset.proto", - "../../protos/google/cloud/ces/v1/toolset_tool.proto", - "../../protos/google/cloud/ces/v1/widget_service.proto", - "../../protos/google/cloud/ces/v1/widget_tool.proto" -] diff --git a/owl-bot-staging/google-cloud-ces/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-ces/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 5b0de58aa1e..00000000000 --- a/owl-bot-staging/google-cloud-ces/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const ces = require('@google-cloud/ces'); - -function main() { - const agentServiceClient = new ces.AgentServiceClient(); - const sessionServiceClient = new ces.SessionServiceClient(); - const toolServiceClient = new ces.ToolServiceClient(); - const widgetServiceClient = new ces.WidgetServiceClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-ces/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-ces/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 7aa59cc5d63..00000000000 --- a/owl-bot-staging/google-cloud-ces/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {AgentServiceClient, SessionServiceClient, ToolServiceClient, WidgetServiceClient} from '@google-cloud/ces'; - -// check that the client class type name can be used -function doStuffWithAgentServiceClient(client: AgentServiceClient) { - client.close(); -} -function doStuffWithSessionServiceClient(client: SessionServiceClient) { - client.close(); -} -function doStuffWithToolServiceClient(client: ToolServiceClient) { - client.close(); -} -function doStuffWithWidgetServiceClient(client: WidgetServiceClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const agentServiceClient = new AgentServiceClient(); - doStuffWithAgentServiceClient(agentServiceClient); - // check that the client instance can be created - const sessionServiceClient = new SessionServiceClient(); - doStuffWithSessionServiceClient(sessionServiceClient); - // check that the client instance can be created - const toolServiceClient = new ToolServiceClient(); - doStuffWithToolServiceClient(toolServiceClient); - // check that the client instance can be created - const widgetServiceClient = new WidgetServiceClient(); - doStuffWithWidgetServiceClient(widgetServiceClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-ces/system-test/install.ts b/owl-bot-staging/google-cloud-ces/system-test/install.ts deleted file mode 100644 index 394f3362d20..00000000000 --- a/owl-bot-staging/google-cloud-ces/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-cloud-ces/test/gapic_agent_service_v1.ts b/owl-bot-staging/google-cloud-ces/test/gapic_agent_service_v1.ts deleted file mode 100644 index 5713676ea6d..00000000000 --- a/owl-bot-staging/google-cloud-ces/test/gapic_agent_service_v1.ts +++ /dev/null @@ -1,8205 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as agentserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, 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.AgentServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new agentserviceModule.v1.AgentServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new agentserviceModule.v1.AgentServiceClient(); - 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 = agentserviceModule.v1.AgentServiceClient.servicePath; - assert.strictEqual(servicePath, 'ces.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = agentserviceModule.v1.AgentServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new agentserviceModule.v1.AgentServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'ces.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new agentserviceModule.v1.AgentServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'ces.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 agentserviceModule.v1.AgentServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'ces.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 agentserviceModule.v1.AgentServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'ces.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 agentserviceModule.v1.AgentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = agentserviceModule.v1.AgentServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new agentserviceModule.v1.AgentServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.agentServiceStub, undefined); - await client.initialize(); - assert(client.agentServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.agentServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.agentServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new agentserviceModule.v1.AgentServiceClient({ - 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 agentserviceModule.v1.AgentServiceClient({ - 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('getApp', () => { - it('invokes getApp without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetAppRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.App() - ); - client.innerApiCalls.getApp = stubSimpleCall(expectedResponse); - const [response] = await client.getApp(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApp without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetAppRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.App() - ); - client.innerApiCalls.getApp = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getApp( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IApp|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApp with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetAppRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getApp = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getApp(request), expectedError); - const actualRequest = (client.innerApiCalls.getApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApp with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetAppRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getApp(request), expectedError); - }); - }); - - describe('updateApp', () => { - it('invokes updateApp without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateAppRequest() - ); - request.app ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateAppRequest', ['app', 'name']); - request.app.name = defaultValue1; - const expectedHeaderRequestParams = `app.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.App() - ); - client.innerApiCalls.updateApp = stubSimpleCall(expectedResponse); - const [response] = await client.updateApp(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApp without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateAppRequest() - ); - request.app ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateAppRequest', ['app', 'name']); - request.app.name = defaultValue1; - const expectedHeaderRequestParams = `app.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.App() - ); - client.innerApiCalls.updateApp = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateApp( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IApp|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApp with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateAppRequest() - ); - request.app ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateAppRequest', ['app', 'name']); - request.app.name = defaultValue1; - const expectedHeaderRequestParams = `app.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateApp = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateApp(request), expectedError); - const actualRequest = (client.innerApiCalls.updateApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApp with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateAppRequest() - ); - request.app ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateAppRequest', ['app', 'name']); - request.app.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateApp(request), expectedError); - }); - }); - - describe('getAgent', () => { - it('invokes getAgent without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetAgentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetAgentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Agent() - ); - client.innerApiCalls.getAgent = stubSimpleCall(expectedResponse); - const [response] = await client.getAgent(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAgent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAgent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAgent without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetAgentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetAgentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Agent() - ); - client.innerApiCalls.getAgent = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getAgent( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IAgent|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAgent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAgent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAgent with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetAgentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetAgentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getAgent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAgent(request), expectedError); - const actualRequest = (client.innerApiCalls.getAgent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAgent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAgent with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetAgentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetAgentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getAgent(request), expectedError); - }); - }); - - describe('createAgent', () => { - it('invokes createAgent without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateAgentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateAgentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Agent() - ); - client.innerApiCalls.createAgent = stubSimpleCall(expectedResponse); - const [response] = await client.createAgent(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAgent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAgent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAgent without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateAgentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateAgentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Agent() - ); - client.innerApiCalls.createAgent = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createAgent( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IAgent|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAgent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAgent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAgent with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateAgentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateAgentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createAgent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createAgent(request), expectedError); - const actualRequest = (client.innerApiCalls.createAgent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAgent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAgent with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateAgentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateAgentRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createAgent(request), expectedError); - }); - }); - - describe('updateAgent', () => { - it('invokes updateAgent without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateAgentRequest() - ); - request.agent ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateAgentRequest', ['agent', 'name']); - request.agent.name = defaultValue1; - const expectedHeaderRequestParams = `agent.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Agent() - ); - client.innerApiCalls.updateAgent = stubSimpleCall(expectedResponse); - const [response] = await client.updateAgent(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAgent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAgent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAgent without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateAgentRequest() - ); - request.agent ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateAgentRequest', ['agent', 'name']); - request.agent.name = defaultValue1; - const expectedHeaderRequestParams = `agent.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Agent() - ); - client.innerApiCalls.updateAgent = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateAgent( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IAgent|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAgent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAgent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAgent with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateAgentRequest() - ); - request.agent ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateAgentRequest', ['agent', 'name']); - request.agent.name = defaultValue1; - const expectedHeaderRequestParams = `agent.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateAgent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateAgent(request), expectedError); - const actualRequest = (client.innerApiCalls.updateAgent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAgent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAgent with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateAgentRequest() - ); - request.agent ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateAgentRequest', ['agent', 'name']); - request.agent.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateAgent(request), expectedError); - }); - }); - - describe('deleteAgent', () => { - it('invokes deleteAgent without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteAgentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteAgentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAgent = stubSimpleCall(expectedResponse); - const [response] = await client.deleteAgent(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAgent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAgent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAgent without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteAgentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteAgentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAgent = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteAgent( - 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.deleteAgent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAgent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAgent with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteAgentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteAgentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteAgent = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteAgent(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteAgent as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAgent as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAgent with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteAgentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteAgentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteAgent(request), expectedError); - }); - }); - - describe('getExample', () => { - it('invokes getExample without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetExampleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetExampleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Example() - ); - client.innerApiCalls.getExample = stubSimpleCall(expectedResponse); - const [response] = await client.getExample(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getExample as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExample as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getExample without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetExampleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetExampleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Example() - ); - client.innerApiCalls.getExample = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getExample( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IExample|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getExample as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExample as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getExample with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetExampleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetExampleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getExample = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getExample(request), expectedError); - const actualRequest = (client.innerApiCalls.getExample as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExample as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getExample with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetExampleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetExampleRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getExample(request), expectedError); - }); - }); - - describe('createExample', () => { - it('invokes createExample without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateExampleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateExampleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Example() - ); - client.innerApiCalls.createExample = stubSimpleCall(expectedResponse); - const [response] = await client.createExample(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createExample as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createExample as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createExample without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateExampleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateExampleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Example() - ); - client.innerApiCalls.createExample = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createExample( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IExample|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createExample as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createExample as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createExample with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateExampleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateExampleRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createExample = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createExample(request), expectedError); - const actualRequest = (client.innerApiCalls.createExample as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createExample as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createExample with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateExampleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateExampleRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createExample(request), expectedError); - }); - }); - - describe('updateExample', () => { - it('invokes updateExample without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateExampleRequest() - ); - request.example ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateExampleRequest', ['example', 'name']); - request.example.name = defaultValue1; - const expectedHeaderRequestParams = `example.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Example() - ); - client.innerApiCalls.updateExample = stubSimpleCall(expectedResponse); - const [response] = await client.updateExample(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateExample as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExample as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateExample without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateExampleRequest() - ); - request.example ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateExampleRequest', ['example', 'name']); - request.example.name = defaultValue1; - const expectedHeaderRequestParams = `example.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Example() - ); - client.innerApiCalls.updateExample = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateExample( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IExample|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateExample as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExample as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateExample with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateExampleRequest() - ); - request.example ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateExampleRequest', ['example', 'name']); - request.example.name = defaultValue1; - const expectedHeaderRequestParams = `example.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateExample = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateExample(request), expectedError); - const actualRequest = (client.innerApiCalls.updateExample as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExample as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateExample with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateExampleRequest() - ); - request.example ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateExampleRequest', ['example', 'name']); - request.example.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateExample(request), expectedError); - }); - }); - - describe('deleteExample', () => { - it('invokes deleteExample without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteExampleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteExampleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteExample = stubSimpleCall(expectedResponse); - const [response] = await client.deleteExample(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteExample as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExample as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteExample without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteExampleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteExampleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteExample = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteExample( - 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.deleteExample as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExample as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteExample with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteExampleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteExampleRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteExample = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteExample(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteExample as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExample as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteExample with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteExampleRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteExampleRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteExample(request), expectedError); - }); - }); - - describe('getTool', () => { - it('invokes getTool without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetToolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetToolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Tool() - ); - client.innerApiCalls.getTool = stubSimpleCall(expectedResponse); - const [response] = await client.getTool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTool without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetToolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetToolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Tool() - ); - client.innerApiCalls.getTool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTool( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.ITool|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTool with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetToolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetToolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTool(request), expectedError); - const actualRequest = (client.innerApiCalls.getTool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTool with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetToolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetToolRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getTool(request), expectedError); - }); - }); - - describe('getConversation', () => { - it('invokes getConversation without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetConversationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Conversation() - ); - client.innerApiCalls.getConversation = stubSimpleCall(expectedResponse); - const [response] = await client.getConversation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getConversation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConversation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConversation without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetConversationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Conversation() - ); - client.innerApiCalls.getConversation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getConversation( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IConversation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getConversation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConversation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConversation with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetConversationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getConversation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getConversation(request), expectedError); - const actualRequest = (client.innerApiCalls.getConversation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConversation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConversation with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetConversationRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getConversation(request), expectedError); - }); - }); - - describe('deleteConversation', () => { - it('invokes deleteConversation without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteConversationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteConversation = stubSimpleCall(expectedResponse); - const [response] = await client.deleteConversation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteConversation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConversation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteConversation without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteConversationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteConversation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteConversation( - 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.deleteConversation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConversation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteConversation with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteConversationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteConversation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteConversation(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteConversation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConversation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteConversation with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteConversationRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteConversation(request), expectedError); - }); - }); - - describe('createTool', () => { - it('invokes createTool without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateToolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateToolRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Tool() - ); - client.innerApiCalls.createTool = stubSimpleCall(expectedResponse); - const [response] = await client.createTool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createTool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTool without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateToolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateToolRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Tool() - ); - client.innerApiCalls.createTool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTool( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.ITool|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createTool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTool with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateToolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateToolRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTool(request), expectedError); - const actualRequest = (client.innerApiCalls.createTool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTool with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateToolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateToolRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createTool(request), expectedError); - }); - }); - - describe('updateTool', () => { - it('invokes updateTool without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateToolRequest() - ); - request.tool ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateToolRequest', ['tool', 'name']); - request.tool.name = defaultValue1; - const expectedHeaderRequestParams = `tool.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Tool() - ); - client.innerApiCalls.updateTool = stubSimpleCall(expectedResponse); - const [response] = await client.updateTool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateTool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateTool without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateToolRequest() - ); - request.tool ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateToolRequest', ['tool', 'name']); - request.tool.name = defaultValue1; - const expectedHeaderRequestParams = `tool.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Tool() - ); - client.innerApiCalls.updateTool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateTool( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.ITool|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateTool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateTool with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateToolRequest() - ); - request.tool ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateToolRequest', ['tool', 'name']); - request.tool.name = defaultValue1; - const expectedHeaderRequestParams = `tool.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateTool(request), expectedError); - const actualRequest = (client.innerApiCalls.updateTool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateTool with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateToolRequest() - ); - request.tool ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateToolRequest', ['tool', 'name']); - request.tool.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateTool(request), expectedError); - }); - }); - - describe('deleteTool', () => { - it('invokes deleteTool without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteToolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteToolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteTool = stubSimpleCall(expectedResponse); - const [response] = await client.deleteTool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteTool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTool without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteToolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteToolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteTool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTool( - 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.deleteTool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTool with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteToolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteToolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteTool(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteTool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTool with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteToolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteToolRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteTool(request), expectedError); - }); - }); - - describe('getGuardrail', () => { - it('invokes getGuardrail without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetGuardrailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetGuardrailRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Guardrail() - ); - client.innerApiCalls.getGuardrail = stubSimpleCall(expectedResponse); - const [response] = await client.getGuardrail(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getGuardrail as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getGuardrail as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getGuardrail without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetGuardrailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetGuardrailRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Guardrail() - ); - client.innerApiCalls.getGuardrail = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getGuardrail( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IGuardrail|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getGuardrail as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getGuardrail as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getGuardrail with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetGuardrailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetGuardrailRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getGuardrail = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getGuardrail(request), expectedError); - const actualRequest = (client.innerApiCalls.getGuardrail as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getGuardrail as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getGuardrail with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetGuardrailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetGuardrailRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getGuardrail(request), expectedError); - }); - }); - - describe('createGuardrail', () => { - it('invokes createGuardrail without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateGuardrailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateGuardrailRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Guardrail() - ); - client.innerApiCalls.createGuardrail = stubSimpleCall(expectedResponse); - const [response] = await client.createGuardrail(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createGuardrail as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createGuardrail as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createGuardrail without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateGuardrailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateGuardrailRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Guardrail() - ); - client.innerApiCalls.createGuardrail = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createGuardrail( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IGuardrail|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createGuardrail as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createGuardrail as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createGuardrail with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateGuardrailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateGuardrailRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createGuardrail = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createGuardrail(request), expectedError); - const actualRequest = (client.innerApiCalls.createGuardrail as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createGuardrail as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createGuardrail with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateGuardrailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateGuardrailRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createGuardrail(request), expectedError); - }); - }); - - describe('updateGuardrail', () => { - it('invokes updateGuardrail without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateGuardrailRequest() - ); - request.guardrail ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateGuardrailRequest', ['guardrail', 'name']); - request.guardrail.name = defaultValue1; - const expectedHeaderRequestParams = `guardrail.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Guardrail() - ); - client.innerApiCalls.updateGuardrail = stubSimpleCall(expectedResponse); - const [response] = await client.updateGuardrail(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateGuardrail as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateGuardrail as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateGuardrail without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateGuardrailRequest() - ); - request.guardrail ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateGuardrailRequest', ['guardrail', 'name']); - request.guardrail.name = defaultValue1; - const expectedHeaderRequestParams = `guardrail.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Guardrail() - ); - client.innerApiCalls.updateGuardrail = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateGuardrail( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IGuardrail|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateGuardrail as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateGuardrail as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateGuardrail with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateGuardrailRequest() - ); - request.guardrail ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateGuardrailRequest', ['guardrail', 'name']); - request.guardrail.name = defaultValue1; - const expectedHeaderRequestParams = `guardrail.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateGuardrail = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateGuardrail(request), expectedError); - const actualRequest = (client.innerApiCalls.updateGuardrail as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateGuardrail as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateGuardrail with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateGuardrailRequest() - ); - request.guardrail ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateGuardrailRequest', ['guardrail', 'name']); - request.guardrail.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateGuardrail(request), expectedError); - }); - }); - - describe('deleteGuardrail', () => { - it('invokes deleteGuardrail without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteGuardrailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteGuardrailRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteGuardrail = stubSimpleCall(expectedResponse); - const [response] = await client.deleteGuardrail(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteGuardrail as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteGuardrail as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteGuardrail without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteGuardrailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteGuardrailRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteGuardrail = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteGuardrail( - 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.deleteGuardrail as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteGuardrail as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteGuardrail with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteGuardrailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteGuardrailRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteGuardrail = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteGuardrail(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteGuardrail as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteGuardrail as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteGuardrail with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteGuardrailRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteGuardrailRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteGuardrail(request), expectedError); - }); - }); - - describe('getDeployment', () => { - it('invokes getDeployment without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Deployment() - ); - client.innerApiCalls.getDeployment = stubSimpleCall(expectedResponse); - const [response] = await client.getDeployment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDeployment without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Deployment() - ); - client.innerApiCalls.getDeployment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDeployment( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IDeployment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDeployment with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDeployment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDeployment(request), expectedError); - const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDeployment with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getDeployment(request), expectedError); - }); - }); - - describe('createDeployment', () => { - it('invokes createDeployment without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateDeploymentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Deployment() - ); - client.innerApiCalls.createDeployment = stubSimpleCall(expectedResponse); - const [response] = await client.createDeployment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDeployment without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateDeploymentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Deployment() - ); - client.innerApiCalls.createDeployment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDeployment( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IDeployment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDeployment with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateDeploymentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDeployment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDeployment(request), expectedError); - const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDeployment with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateDeploymentRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createDeployment(request), expectedError); - }); - }); - - describe('updateDeployment', () => { - it('invokes updateDeployment without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateDeploymentRequest() - ); - request.deployment ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateDeploymentRequest', ['deployment', 'name']); - request.deployment.name = defaultValue1; - const expectedHeaderRequestParams = `deployment.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Deployment() - ); - client.innerApiCalls.updateDeployment = stubSimpleCall(expectedResponse); - const [response] = await client.updateDeployment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDeployment without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateDeploymentRequest() - ); - request.deployment ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateDeploymentRequest', ['deployment', 'name']); - request.deployment.name = defaultValue1; - const expectedHeaderRequestParams = `deployment.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Deployment() - ); - client.innerApiCalls.updateDeployment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDeployment( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IDeployment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDeployment with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateDeploymentRequest() - ); - request.deployment ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateDeploymentRequest', ['deployment', 'name']); - request.deployment.name = defaultValue1; - const expectedHeaderRequestParams = `deployment.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDeployment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDeployment(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDeployment with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateDeploymentRequest() - ); - request.deployment ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateDeploymentRequest', ['deployment', 'name']); - request.deployment.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateDeployment(request), expectedError); - }); - }); - - describe('deleteDeployment', () => { - it('invokes deleteDeployment without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDeployment = stubSimpleCall(expectedResponse); - const [response] = await client.deleteDeployment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDeployment without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDeployment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteDeployment( - 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.deleteDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDeployment with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDeployment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteDeployment(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDeployment with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteDeployment(request), expectedError); - }); - }); - - describe('getToolset', () => { - it('invokes getToolset without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetToolsetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetToolsetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Toolset() - ); - client.innerApiCalls.getToolset = stubSimpleCall(expectedResponse); - const [response] = await client.getToolset(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getToolset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getToolset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getToolset without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetToolsetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetToolsetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Toolset() - ); - client.innerApiCalls.getToolset = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getToolset( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IToolset|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getToolset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getToolset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getToolset with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetToolsetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetToolsetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getToolset = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getToolset(request), expectedError); - const actualRequest = (client.innerApiCalls.getToolset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getToolset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getToolset with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetToolsetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetToolsetRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getToolset(request), expectedError); - }); - }); - - describe('createToolset', () => { - it('invokes createToolset without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateToolsetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateToolsetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Toolset() - ); - client.innerApiCalls.createToolset = stubSimpleCall(expectedResponse); - const [response] = await client.createToolset(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createToolset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createToolset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createToolset without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateToolsetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateToolsetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Toolset() - ); - client.innerApiCalls.createToolset = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createToolset( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IToolset|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createToolset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createToolset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createToolset with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateToolsetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateToolsetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createToolset = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createToolset(request), expectedError); - const actualRequest = (client.innerApiCalls.createToolset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createToolset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createToolset with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateToolsetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateToolsetRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createToolset(request), expectedError); - }); - }); - - describe('updateToolset', () => { - it('invokes updateToolset without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateToolsetRequest() - ); - request.toolset ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateToolsetRequest', ['toolset', 'name']); - request.toolset.name = defaultValue1; - const expectedHeaderRequestParams = `toolset.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Toolset() - ); - client.innerApiCalls.updateToolset = stubSimpleCall(expectedResponse); - const [response] = await client.updateToolset(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateToolset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateToolset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateToolset without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateToolsetRequest() - ); - request.toolset ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateToolsetRequest', ['toolset', 'name']); - request.toolset.name = defaultValue1; - const expectedHeaderRequestParams = `toolset.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Toolset() - ); - client.innerApiCalls.updateToolset = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateToolset( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IToolset|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateToolset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateToolset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateToolset with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateToolsetRequest() - ); - request.toolset ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateToolsetRequest', ['toolset', 'name']); - request.toolset.name = defaultValue1; - const expectedHeaderRequestParams = `toolset.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateToolset = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateToolset(request), expectedError); - const actualRequest = (client.innerApiCalls.updateToolset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateToolset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateToolset with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.UpdateToolsetRequest() - ); - request.toolset ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.UpdateToolsetRequest', ['toolset', 'name']); - request.toolset.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateToolset(request), expectedError); - }); - }); - - describe('deleteToolset', () => { - it('invokes deleteToolset without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteToolsetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteToolsetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteToolset = stubSimpleCall(expectedResponse); - const [response] = await client.deleteToolset(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteToolset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteToolset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteToolset without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteToolsetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteToolsetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteToolset = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteToolset( - 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.deleteToolset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteToolset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteToolset with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteToolsetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteToolsetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteToolset = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteToolset(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteToolset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteToolset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteToolset with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteToolsetRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteToolsetRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteToolset(request), expectedError); - }); - }); - - describe('getAppVersion', () => { - it('invokes getAppVersion without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetAppVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetAppVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.AppVersion() - ); - client.innerApiCalls.getAppVersion = stubSimpleCall(expectedResponse); - const [response] = await client.getAppVersion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAppVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAppVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAppVersion without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetAppVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetAppVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.AppVersion() - ); - client.innerApiCalls.getAppVersion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getAppVersion( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IAppVersion|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAppVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAppVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAppVersion with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetAppVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetAppVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getAppVersion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAppVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.getAppVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAppVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAppVersion with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetAppVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetAppVersionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getAppVersion(request), expectedError); - }); - }); - - describe('createAppVersion', () => { - it('invokes createAppVersion without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateAppVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateAppVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.AppVersion() - ); - client.innerApiCalls.createAppVersion = stubSimpleCall(expectedResponse); - const [response] = await client.createAppVersion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAppVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAppVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAppVersion without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateAppVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateAppVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.AppVersion() - ); - client.innerApiCalls.createAppVersion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createAppVersion( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IAppVersion|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAppVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAppVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAppVersion with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateAppVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateAppVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createAppVersion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createAppVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.createAppVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAppVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAppVersion with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateAppVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateAppVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createAppVersion(request), expectedError); - }); - }); - - describe('deleteAppVersion', () => { - it('invokes deleteAppVersion without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteAppVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteAppVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAppVersion = stubSimpleCall(expectedResponse); - const [response] = await client.deleteAppVersion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAppVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAppVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAppVersion without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteAppVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteAppVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAppVersion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteAppVersion( - 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.deleteAppVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAppVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAppVersion with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteAppVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteAppVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteAppVersion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteAppVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteAppVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAppVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAppVersion with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteAppVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteAppVersionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteAppVersion(request), expectedError); - }); - }); - - describe('getChangelog', () => { - it('invokes getChangelog without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetChangelogRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetChangelogRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Changelog() - ); - client.innerApiCalls.getChangelog = stubSimpleCall(expectedResponse); - const [response] = await client.getChangelog(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getChangelog as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getChangelog as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getChangelog without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetChangelogRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetChangelogRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.Changelog() - ); - client.innerApiCalls.getChangelog = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getChangelog( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IChangelog|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getChangelog as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getChangelog as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getChangelog with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetChangelogRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetChangelogRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getChangelog = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getChangelog(request), expectedError); - const actualRequest = (client.innerApiCalls.getChangelog as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getChangelog as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getChangelog with closed client', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GetChangelogRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GetChangelogRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getChangelog(request), expectedError); - }); - }); - - describe('createApp', () => { - it('invokes createApp without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateAppRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createApp = stubLongRunningCall(expectedResponse); - const [operation] = await client.createApp(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApp without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateAppRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createApp = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createApp( - 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.createApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApp with call error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateAppRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createApp = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createApp(request), expectedError); - const actualRequest = (client.innerApiCalls.createApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApp with LRO error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.CreateAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.CreateAppRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createApp = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createApp(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateAppProgress without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateAppProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateAppProgress with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateAppProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteApp', () => { - it('invokes deleteApp without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteAppRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteApp = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteApp(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApp without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteAppRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteApp = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteApp( - 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.deleteApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApp with call error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteAppRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteApp = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteApp(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApp with LRO error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.DeleteAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.DeleteAppRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteApp = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteApp(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteAppProgress without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteAppProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteAppProgress with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteAppProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('exportApp', () => { - it('invokes exportApp without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ExportAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ExportAppRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.exportApp = stubLongRunningCall(expectedResponse); - const [operation] = await client.exportApp(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.exportApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes exportApp without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ExportAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ExportAppRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.exportApp = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.exportApp( - 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.exportApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes exportApp with call error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ExportAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ExportAppRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportApp = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.exportApp(request), expectedError); - const actualRequest = (client.innerApiCalls.exportApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes exportApp with LRO error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ExportAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ExportAppRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportApp = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.exportApp(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.exportApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkExportAppProgress without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkExportAppProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkExportAppProgress with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkExportAppProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('importApp', () => { - it('invokes importApp without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ImportAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ImportAppRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.importApp = stubLongRunningCall(expectedResponse); - const [operation] = await client.importApp(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.importApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importApp without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ImportAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ImportAppRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.importApp = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.importApp( - 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.importApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importApp with call error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ImportAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ImportAppRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.importApp = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.importApp(request), expectedError); - const actualRequest = (client.innerApiCalls.importApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importApp with LRO error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ImportAppRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ImportAppRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.importApp = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.importApp(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.importApp as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importApp as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkImportAppProgress without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkImportAppProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkImportAppProgress with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkImportAppProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('batchDeleteConversations', () => { - it('invokes batchDeleteConversations without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.BatchDeleteConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.BatchDeleteConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchDeleteConversations = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchDeleteConversations(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchDeleteConversations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteConversations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchDeleteConversations without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.BatchDeleteConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.BatchDeleteConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchDeleteConversations = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchDeleteConversations( - 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.batchDeleteConversations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteConversations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchDeleteConversations with call error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.BatchDeleteConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.BatchDeleteConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchDeleteConversations = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchDeleteConversations(request), expectedError); - const actualRequest = (client.innerApiCalls.batchDeleteConversations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteConversations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchDeleteConversations with LRO error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.BatchDeleteConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.BatchDeleteConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchDeleteConversations = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchDeleteConversations(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.batchDeleteConversations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteConversations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkBatchDeleteConversationsProgress without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkBatchDeleteConversationsProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkBatchDeleteConversationsProgress with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkBatchDeleteConversationsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('restoreAppVersion', () => { - it('invokes restoreAppVersion without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.RestoreAppVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.RestoreAppVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreAppVersion = stubLongRunningCall(expectedResponse); - const [operation] = await client.restoreAppVersion(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restoreAppVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreAppVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreAppVersion without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.RestoreAppVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.RestoreAppVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreAppVersion = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restoreAppVersion( - 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.restoreAppVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreAppVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreAppVersion with call error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.RestoreAppVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.RestoreAppVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreAppVersion = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restoreAppVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.restoreAppVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreAppVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreAppVersion with LRO error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.RestoreAppVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.RestoreAppVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreAppVersion = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restoreAppVersion(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.restoreAppVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreAppVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRestoreAppVersionProgress without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRestoreAppVersionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRestoreAppVersionProgress with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkRestoreAppVersionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listApps', () => { - it('invokes listApps without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAppsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAppsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.App()), - generateSampleMessage(new protos.google.cloud.ces.v1.App()), - generateSampleMessage(new protos.google.cloud.ces.v1.App()), - ]; - client.innerApiCalls.listApps = stubSimpleCall(expectedResponse); - const [response] = await client.listApps(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApps as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApps as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApps without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAppsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAppsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.App()), - generateSampleMessage(new protos.google.cloud.ces.v1.App()), - generateSampleMessage(new protos.google.cloud.ces.v1.App()), - ]; - client.innerApiCalls.listApps = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listApps( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IApp[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApps as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApps as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApps with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAppsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAppsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listApps = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listApps(request), expectedError); - const actualRequest = (client.innerApiCalls.listApps as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApps as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAppsStream without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAppsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAppsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.App()), - generateSampleMessage(new protos.google.cloud.ces.v1.App()), - generateSampleMessage(new protos.google.cloud.ces.v1.App()), - ]; - client.descriptors.page.listApps.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAppsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.App[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.App) => { - 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.listApps.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApps, request)); - assert( - (client.descriptors.page.listApps.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAppsStream with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAppsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAppsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listApps.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAppsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.App[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.App) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listApps.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApps, request)); - assert( - (client.descriptors.page.listApps.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApps without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAppsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAppsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.App()), - generateSampleMessage(new protos.google.cloud.ces.v1.App()), - generateSampleMessage(new protos.google.cloud.ces.v1.App()), - ]; - client.descriptors.page.listApps.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.ces.v1.IApp[] = []; - const iterable = client.listAppsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listApps.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApps.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApps with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAppsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAppsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listApps.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAppsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.ces.v1.IApp[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listApps.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApps.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listAgents', () => { - it('invokes listAgents without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAgentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAgentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), - generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), - generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), - ]; - client.innerApiCalls.listAgents = stubSimpleCall(expectedResponse); - const [response] = await client.listAgents(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAgents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAgents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAgents without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAgentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAgentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), - generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), - generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), - ]; - client.innerApiCalls.listAgents = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAgents( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IAgent[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAgents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAgents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAgents with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAgentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAgentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listAgents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAgents(request), expectedError); - const actualRequest = (client.innerApiCalls.listAgents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAgents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAgentsStream without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAgentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAgentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), - generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), - generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), - ]; - client.descriptors.page.listAgents.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAgentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.Agent[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.Agent) => { - 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.listAgents.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAgents, request)); - assert( - (client.descriptors.page.listAgents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAgentsStream with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAgentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAgentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listAgents.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAgentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.Agent[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.Agent) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAgents.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAgents, request)); - assert( - (client.descriptors.page.listAgents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAgents without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAgentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAgentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), - generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), - generateSampleMessage(new protos.google.cloud.ces.v1.Agent()), - ]; - client.descriptors.page.listAgents.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.ces.v1.IAgent[] = []; - const iterable = client.listAgentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAgents.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAgents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAgents with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAgentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAgentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listAgents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAgentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.ces.v1.IAgent[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAgents.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAgents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listExamples', () => { - it('invokes listExamples without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListExamplesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListExamplesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Example()), - generateSampleMessage(new protos.google.cloud.ces.v1.Example()), - generateSampleMessage(new protos.google.cloud.ces.v1.Example()), - ]; - client.innerApiCalls.listExamples = stubSimpleCall(expectedResponse); - const [response] = await client.listExamples(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listExamples as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExamples as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listExamples without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListExamplesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListExamplesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Example()), - generateSampleMessage(new protos.google.cloud.ces.v1.Example()), - generateSampleMessage(new protos.google.cloud.ces.v1.Example()), - ]; - client.innerApiCalls.listExamples = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listExamples( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IExample[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listExamples as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExamples as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listExamples with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListExamplesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListExamplesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listExamples = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listExamples(request), expectedError); - const actualRequest = (client.innerApiCalls.listExamples as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExamples as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listExamplesStream without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListExamplesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListExamplesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Example()), - generateSampleMessage(new protos.google.cloud.ces.v1.Example()), - generateSampleMessage(new protos.google.cloud.ces.v1.Example()), - ]; - client.descriptors.page.listExamples.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listExamplesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.Example[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.Example) => { - 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.listExamples.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listExamples, request)); - assert( - (client.descriptors.page.listExamples.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listExamplesStream with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListExamplesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListExamplesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listExamples.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listExamplesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.Example[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.Example) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listExamples.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listExamples, request)); - assert( - (client.descriptors.page.listExamples.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listExamples without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListExamplesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListExamplesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Example()), - generateSampleMessage(new protos.google.cloud.ces.v1.Example()), - generateSampleMessage(new protos.google.cloud.ces.v1.Example()), - ]; - client.descriptors.page.listExamples.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.ces.v1.IExample[] = []; - const iterable = client.listExamplesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listExamples.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listExamples.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listExamples with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListExamplesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListExamplesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listExamples.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listExamplesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.ces.v1.IExample[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listExamples.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listExamples.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listTools', () => { - it('invokes listTools without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListToolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListToolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), - generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), - generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), - ]; - client.innerApiCalls.listTools = stubSimpleCall(expectedResponse); - const [response] = await client.listTools(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listTools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTools without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListToolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListToolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), - generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), - generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), - ]; - client.innerApiCalls.listTools = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTools( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.ITool[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listTools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTools with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListToolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListToolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTools = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTools(request), expectedError); - const actualRequest = (client.innerApiCalls.listTools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listToolsStream without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListToolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListToolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), - generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), - generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), - ]; - client.descriptors.page.listTools.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listToolsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.Tool[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.Tool) => { - 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.listTools.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTools, request)); - assert( - (client.descriptors.page.listTools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listToolsStream with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListToolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListToolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listTools.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listToolsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.Tool[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.Tool) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTools.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTools, request)); - assert( - (client.descriptors.page.listTools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTools without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListToolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListToolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), - generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), - generateSampleMessage(new protos.google.cloud.ces.v1.Tool()), - ]; - client.descriptors.page.listTools.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.ces.v1.ITool[] = []; - const iterable = client.listToolsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTools.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listTools.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTools with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListToolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListToolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listTools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listToolsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.ces.v1.ITool[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTools.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listTools.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listConversations', () => { - it('invokes listConversations without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), - generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), - generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), - ]; - client.innerApiCalls.listConversations = stubSimpleCall(expectedResponse); - const [response] = await client.listConversations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listConversations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listConversations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listConversations without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), - generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), - generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), - ]; - client.innerApiCalls.listConversations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listConversations( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IConversation[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listConversations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listConversations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listConversations with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listConversations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listConversations(request), expectedError); - const actualRequest = (client.innerApiCalls.listConversations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listConversations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listConversationsStream without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), - generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), - generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), - ]; - client.descriptors.page.listConversations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listConversationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.Conversation[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.Conversation) => { - 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.listConversations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listConversations, request)); - assert( - (client.descriptors.page.listConversations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listConversationsStream with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listConversations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listConversationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.Conversation[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.Conversation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listConversations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listConversations, request)); - assert( - (client.descriptors.page.listConversations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listConversations without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), - generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), - generateSampleMessage(new protos.google.cloud.ces.v1.Conversation()), - ]; - client.descriptors.page.listConversations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.ces.v1.IConversation[] = []; - const iterable = client.listConversationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listConversations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listConversations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listConversations with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listConversations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listConversationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.ces.v1.IConversation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listConversations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listConversations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listGuardrails', () => { - it('invokes listGuardrails without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListGuardrailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListGuardrailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), - generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), - generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), - ]; - client.innerApiCalls.listGuardrails = stubSimpleCall(expectedResponse); - const [response] = await client.listGuardrails(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listGuardrails as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listGuardrails as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listGuardrails without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListGuardrailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListGuardrailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), - generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), - generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), - ]; - client.innerApiCalls.listGuardrails = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listGuardrails( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IGuardrail[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listGuardrails as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listGuardrails as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listGuardrails with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListGuardrailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListGuardrailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listGuardrails = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listGuardrails(request), expectedError); - const actualRequest = (client.innerApiCalls.listGuardrails as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listGuardrails as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listGuardrailsStream without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListGuardrailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListGuardrailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), - generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), - generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), - ]; - client.descriptors.page.listGuardrails.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listGuardrailsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.Guardrail[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.Guardrail) => { - 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.listGuardrails.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listGuardrails, request)); - assert( - (client.descriptors.page.listGuardrails.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listGuardrailsStream with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListGuardrailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListGuardrailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listGuardrails.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listGuardrailsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.Guardrail[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.Guardrail) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listGuardrails.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listGuardrails, request)); - assert( - (client.descriptors.page.listGuardrails.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listGuardrails without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListGuardrailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListGuardrailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), - generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), - generateSampleMessage(new protos.google.cloud.ces.v1.Guardrail()), - ]; - client.descriptors.page.listGuardrails.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.ces.v1.IGuardrail[] = []; - const iterable = client.listGuardrailsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listGuardrails.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listGuardrails.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listGuardrails with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListGuardrailsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListGuardrailsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listGuardrails.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listGuardrailsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.ces.v1.IGuardrail[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listGuardrails.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listGuardrails.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listDeployments', () => { - it('invokes listDeployments without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), - ]; - client.innerApiCalls.listDeployments = stubSimpleCall(expectedResponse); - const [response] = await client.listDeployments(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDeployments without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), - ]; - client.innerApiCalls.listDeployments = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDeployments( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IDeployment[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDeployments with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDeployments = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDeployments(request), expectedError); - const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDeploymentsStream without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), - ]; - client.descriptors.page.listDeployments.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDeploymentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.Deployment[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.Deployment) => { - 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.listDeployments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDeployments, request)); - assert( - (client.descriptors.page.listDeployments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDeploymentsStream with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDeployments.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDeploymentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.Deployment[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.Deployment) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDeployments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDeployments, request)); - assert( - (client.descriptors.page.listDeployments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDeployments without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.ces.v1.Deployment()), - ]; - client.descriptors.page.listDeployments.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.ces.v1.IDeployment[] = []; - const iterable = client.listDeploymentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDeployments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDeployments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDeployments with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDeployments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDeploymentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.ces.v1.IDeployment[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDeployments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDeployments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listToolsets', () => { - it('invokes listToolsets without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListToolsetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListToolsetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), - generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), - generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), - ]; - client.innerApiCalls.listToolsets = stubSimpleCall(expectedResponse); - const [response] = await client.listToolsets(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listToolsets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listToolsets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listToolsets without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListToolsetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListToolsetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), - generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), - generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), - ]; - client.innerApiCalls.listToolsets = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listToolsets( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IToolset[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listToolsets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listToolsets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listToolsets with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListToolsetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListToolsetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listToolsets = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listToolsets(request), expectedError); - const actualRequest = (client.innerApiCalls.listToolsets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listToolsets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listToolsetsStream without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListToolsetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListToolsetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), - generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), - generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), - ]; - client.descriptors.page.listToolsets.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listToolsetsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.Toolset[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.Toolset) => { - 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.listToolsets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listToolsets, request)); - assert( - (client.descriptors.page.listToolsets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listToolsetsStream with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListToolsetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListToolsetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listToolsets.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listToolsetsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.Toolset[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.Toolset) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listToolsets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listToolsets, request)); - assert( - (client.descriptors.page.listToolsets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listToolsets without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListToolsetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListToolsetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), - generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), - generateSampleMessage(new protos.google.cloud.ces.v1.Toolset()), - ]; - client.descriptors.page.listToolsets.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.ces.v1.IToolset[] = []; - const iterable = client.listToolsetsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listToolsets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listToolsets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listToolsets with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListToolsetsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListToolsetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listToolsets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listToolsetsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.ces.v1.IToolset[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listToolsets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listToolsets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listAppVersions', () => { - it('invokes listAppVersions without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAppVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAppVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), - generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), - generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), - ]; - client.innerApiCalls.listAppVersions = stubSimpleCall(expectedResponse); - const [response] = await client.listAppVersions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAppVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAppVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAppVersions without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAppVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAppVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), - generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), - generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), - ]; - client.innerApiCalls.listAppVersions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAppVersions( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IAppVersion[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAppVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAppVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAppVersions with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAppVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAppVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listAppVersions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAppVersions(request), expectedError); - const actualRequest = (client.innerApiCalls.listAppVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAppVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAppVersionsStream without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAppVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAppVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), - generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), - generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), - ]; - client.descriptors.page.listAppVersions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAppVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.AppVersion[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.AppVersion) => { - 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.listAppVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAppVersions, request)); - assert( - (client.descriptors.page.listAppVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAppVersionsStream with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAppVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAppVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listAppVersions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAppVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.AppVersion[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.AppVersion) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAppVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAppVersions, request)); - assert( - (client.descriptors.page.listAppVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAppVersions without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAppVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAppVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), - generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), - generateSampleMessage(new protos.google.cloud.ces.v1.AppVersion()), - ]; - client.descriptors.page.listAppVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.ces.v1.IAppVersion[] = []; - const iterable = client.listAppVersionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAppVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAppVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAppVersions with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListAppVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListAppVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listAppVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAppVersionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.ces.v1.IAppVersion[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAppVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAppVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listChangelogs', () => { - it('invokes listChangelogs without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListChangelogsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListChangelogsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), - generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), - generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), - ]; - client.innerApiCalls.listChangelogs = stubSimpleCall(expectedResponse); - const [response] = await client.listChangelogs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listChangelogs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listChangelogs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listChangelogs without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListChangelogsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListChangelogsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), - generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), - generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), - ]; - client.innerApiCalls.listChangelogs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listChangelogs( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IChangelog[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listChangelogs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listChangelogs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listChangelogs with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListChangelogsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListChangelogsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listChangelogs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listChangelogs(request), expectedError); - const actualRequest = (client.innerApiCalls.listChangelogs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listChangelogs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listChangelogsStream without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListChangelogsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListChangelogsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), - generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), - generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), - ]; - client.descriptors.page.listChangelogs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listChangelogsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.Changelog[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.Changelog) => { - 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.listChangelogs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listChangelogs, request)); - assert( - (client.descriptors.page.listChangelogs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listChangelogsStream with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListChangelogsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListChangelogsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listChangelogs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listChangelogsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.ces.v1.Changelog[] = []; - stream.on('data', (response: protos.google.cloud.ces.v1.Changelog) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listChangelogs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listChangelogs, request)); - assert( - (client.descriptors.page.listChangelogs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listChangelogs without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListChangelogsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListChangelogsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), - generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), - generateSampleMessage(new protos.google.cloud.ces.v1.Changelog()), - ]; - client.descriptors.page.listChangelogs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.ces.v1.IChangelog[] = []; - const iterable = client.listChangelogsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listChangelogs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listChangelogs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listChangelogs with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ListChangelogsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ListChangelogsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listChangelogs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listChangelogsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.ces.v1.IChangelog[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listChangelogs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listChangelogs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - 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 agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - 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 agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - 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 agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('agent', async () => { - const fakePath = "/rendered/path/agent"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - agent: "agentValue", - }; - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.agentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.agentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('agentPath', () => { - const result = client.agentPath("projectValue", "locationValue", "appValue", "agentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.agentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAgentName', () => { - const result = client.matchProjectFromAgentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.agentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAgentName', () => { - const result = client.matchLocationFromAgentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.agentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromAgentName', () => { - const result = client.matchAppFromAgentName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.agentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAgentFromAgentName', () => { - const result = client.matchAgentFromAgentName(fakePath); - assert.strictEqual(result, "agentValue"); - assert((client.pathTemplates.agentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('app', async () => { - const fakePath = "/rendered/path/app"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - }; - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.appPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.appPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('appPath', () => { - const result = client.appPath("projectValue", "locationValue", "appValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.appPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAppName', () => { - const result = client.matchProjectFromAppName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.appPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAppName', () => { - const result = client.matchLocationFromAppName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.appPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromAppName', () => { - const result = client.matchAppFromAppName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.appPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('appVersion', async () => { - const fakePath = "/rendered/path/appVersion"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - version: "versionValue", - }; - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.appVersionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.appVersionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('appVersionPath', () => { - const result = client.appVersionPath("projectValue", "locationValue", "appValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.appVersionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAppVersionName', () => { - const result = client.matchProjectFromAppVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAppVersionName', () => { - const result = client.matchLocationFromAppVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromAppVersionName', () => { - const result = client.matchAppFromAppVersionName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromAppVersionName', () => { - const result = client.matchVersionFromAppVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('changelog', async () => { - const fakePath = "/rendered/path/changelog"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - changelog: "changelogValue", - }; - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.changelogPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.changelogPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('changelogPath', () => { - const result = client.changelogPath("projectValue", "locationValue", "appValue", "changelogValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.changelogPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromChangelogName', () => { - const result = client.matchProjectFromChangelogName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromChangelogName', () => { - const result = client.matchLocationFromChangelogName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromChangelogName', () => { - const result = client.matchAppFromChangelogName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchChangelogFromChangelogName', () => { - const result = client.matchChangelogFromChangelogName(fakePath); - assert.strictEqual(result, "changelogValue"); - assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('conversation', async () => { - const fakePath = "/rendered/path/conversation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - conversation: "conversationValue", - }; - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.conversationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.conversationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('conversationPath', () => { - const result = client.conversationPath("projectValue", "locationValue", "appValue", "conversationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.conversationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromConversationName', () => { - const result = client.matchProjectFromConversationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromConversationName', () => { - const result = client.matchLocationFromConversationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromConversationName', () => { - const result = client.matchAppFromConversationName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchConversationFromConversationName', () => { - const result = client.matchConversationFromConversationName(fakePath); - assert.strictEqual(result, "conversationValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('deployment', async () => { - const fakePath = "/rendered/path/deployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - deployment: "deploymentValue", - }; - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.deploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentPath', () => { - const result = client.deploymentPath("projectValue", "locationValue", "appValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentName', () => { - const result = client.matchProjectFromDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentName', () => { - const result = client.matchLocationFromDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromDeploymentName', () => { - const result = client.matchAppFromDeploymentName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromDeploymentName', () => { - const result = client.matchDeploymentFromDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('example', async () => { - const fakePath = "/rendered/path/example"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - example: "exampleValue", - }; - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.examplePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.examplePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('examplePath', () => { - const result = client.examplePath("projectValue", "locationValue", "appValue", "exampleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.examplePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExampleName', () => { - const result = client.matchProjectFromExampleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.examplePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExampleName', () => { - const result = client.matchLocationFromExampleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.examplePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromExampleName', () => { - const result = client.matchAppFromExampleName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.examplePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExampleFromExampleName', () => { - const result = client.matchExampleFromExampleName(fakePath); - assert.strictEqual(result, "exampleValue"); - assert((client.pathTemplates.examplePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('guardrail', async () => { - const fakePath = "/rendered/path/guardrail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - guardrail: "guardrailValue", - }; - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.guardrailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.guardrailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('guardrailPath', () => { - const result = client.guardrailPath("projectValue", "locationValue", "appValue", "guardrailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.guardrailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromGuardrailName', () => { - const result = client.matchProjectFromGuardrailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromGuardrailName', () => { - const result = client.matchLocationFromGuardrailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromGuardrailName', () => { - const result = client.matchAppFromGuardrailName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchGuardrailFromGuardrailName', () => { - const result = client.matchGuardrailFromGuardrailName(fakePath); - assert.strictEqual(result, "guardrailValue"); - assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('omnichannel', async () => { - const fakePath = "/rendered/path/omnichannel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - omnichannel: "omnichannelValue", - }; - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.omnichannelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.omnichannelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('omnichannelPath', () => { - const result = client.omnichannelPath("projectValue", "locationValue", "omnichannelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.omnichannelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromOmnichannelName', () => { - const result = client.matchProjectFromOmnichannelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOmnichannelName', () => { - const result = client.matchLocationFromOmnichannelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOmnichannelFromOmnichannelName', () => { - const result = client.matchOmnichannelFromOmnichannelName(fakePath); - assert.strictEqual(result, "omnichannelValue"); - assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tool', async () => { - const fakePath = "/rendered/path/tool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - tool: "toolValue", - }; - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.toolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.toolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('toolPath', () => { - const result = client.toolPath("projectValue", "locationValue", "appValue", "toolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.toolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromToolName', () => { - const result = client.matchProjectFromToolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.toolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromToolName', () => { - const result = client.matchLocationFromToolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.toolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromToolName', () => { - const result = client.matchAppFromToolName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.toolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchToolFromToolName', () => { - const result = client.matchToolFromToolName(fakePath); - assert.strictEqual(result, "toolValue"); - assert((client.pathTemplates.toolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('toolset', async () => { - const fakePath = "/rendered/path/toolset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - toolset: "toolsetValue", - }; - const client = new agentserviceModule.v1.AgentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.toolsetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.toolsetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('toolsetPath', () => { - const result = client.toolsetPath("projectValue", "locationValue", "appValue", "toolsetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.toolsetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromToolsetName', () => { - const result = client.matchProjectFromToolsetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromToolsetName', () => { - const result = client.matchLocationFromToolsetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromToolsetName', () => { - const result = client.matchAppFromToolsetName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchToolsetFromToolsetName', () => { - const result = client.matchToolsetFromToolsetName(fakePath); - assert.strictEqual(result, "toolsetValue"); - assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-ces/test/gapic_session_service_v1.ts b/owl-bot-staging/google-cloud-ces/test/gapic_session_service_v1.ts deleted file mode 100644 index 85e591e4c94..00000000000 --- a/owl-bot-staging/google-cloud-ces/test/gapic_session_service_v1.ts +++ /dev/null @@ -1,1222 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as sessionserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, 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 stubBidiStreamingCall(response?: ResponseType, error?: Error) { - const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - 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.SessionServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new sessionserviceModule.v1.SessionServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new sessionserviceModule.v1.SessionServiceClient(); - 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 = sessionserviceModule.v1.SessionServiceClient.servicePath; - assert.strictEqual(servicePath, 'ces.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = sessionserviceModule.v1.SessionServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new sessionserviceModule.v1.SessionServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'ces.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new sessionserviceModule.v1.SessionServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'ces.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 sessionserviceModule.v1.SessionServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'ces.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 sessionserviceModule.v1.SessionServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'ces.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 sessionserviceModule.v1.SessionServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = sessionserviceModule.v1.SessionServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new sessionserviceModule.v1.SessionServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new sessionserviceModule.v1.SessionServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.sessionServiceStub, undefined); - await client.initialize(); - assert(client.sessionServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.sessionServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.sessionServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new sessionserviceModule.v1.SessionServiceClient({ - 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 sessionserviceModule.v1.SessionServiceClient({ - 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('runSession', () => { - it('invokes runSession without error', async () => { - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.RunSessionRequest() - ); - request.config ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.RunSessionRequest', ['config', 'session']); - request.config.session = defaultValue1; - const expectedHeaderRequestParams = `config.session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.RunSessionResponse() - ); - client.innerApiCalls.runSession = stubSimpleCall(expectedResponse); - const [response] = await client.runSession(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.runSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runSession without error using callback', async () => { - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.RunSessionRequest() - ); - request.config ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.RunSessionRequest', ['config', 'session']); - request.config.session = defaultValue1; - const expectedHeaderRequestParams = `config.session=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.RunSessionResponse() - ); - client.innerApiCalls.runSession = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.runSession( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IRunSessionResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.runSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runSession with error', async () => { - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.RunSessionRequest() - ); - request.config ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.RunSessionRequest', ['config', 'session']); - request.config.session = defaultValue1; - const expectedHeaderRequestParams = `config.session=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.runSession = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.runSession(request), expectedError); - const actualRequest = (client.innerApiCalls.runSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runSession with closed client', async () => { - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.RunSessionRequest() - ); - request.config ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.RunSessionRequest', ['config', 'session']); - request.config.session = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.runSession(request), expectedError); - }); - }); - - describe('bidiRunSession', () => { - it('invokes bidiRunSession without error', async () => { - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.BidiSessionClientMessage() - ); - - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.BidiSessionServerMessage() - ); - client.innerApiCalls.bidiRunSession = stubBidiStreamingCall(expectedResponse); - const stream = client.bidiRunSession(); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.cloud.ces.v1.BidiSessionServerMessage) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - stream.write(request); - stream.end(); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.bidiRunSession as SinonStub) - .getCall(0).calledWith(null)); - assert.deepStrictEqual(((stream as unknown as PassThrough) - ._transform as SinonStub).getCall(0).args[0], request); - }); - - it('invokes bidiRunSession with error', async () => { - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.BidiSessionClientMessage() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.bidiRunSession = stubBidiStreamingCall(undefined, expectedError); - const stream = client.bidiRunSession(); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.cloud.ces.v1.BidiSessionServerMessage) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - stream.write(request); - stream.end(); - }); - await assert.rejects(promise, expectedError); - assert((client.innerApiCalls.bidiRunSession as SinonStub) - .getCall(0).calledWith(null)); - assert.deepStrictEqual(((stream as unknown as PassThrough) - ._transform as SinonStub).getCall(0).args[0], request); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('agent', async () => { - const fakePath = "/rendered/path/agent"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - agent: "agentValue", - }; - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.agentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.agentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('agentPath', () => { - const result = client.agentPath("projectValue", "locationValue", "appValue", "agentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.agentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAgentName', () => { - const result = client.matchProjectFromAgentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.agentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAgentName', () => { - const result = client.matchLocationFromAgentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.agentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromAgentName', () => { - const result = client.matchAppFromAgentName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.agentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAgentFromAgentName', () => { - const result = client.matchAgentFromAgentName(fakePath); - assert.strictEqual(result, "agentValue"); - assert((client.pathTemplates.agentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('app', async () => { - const fakePath = "/rendered/path/app"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - }; - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.appPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.appPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('appPath', () => { - const result = client.appPath("projectValue", "locationValue", "appValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.appPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAppName', () => { - const result = client.matchProjectFromAppName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.appPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAppName', () => { - const result = client.matchLocationFromAppName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.appPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromAppName', () => { - const result = client.matchAppFromAppName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.appPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('appVersion', async () => { - const fakePath = "/rendered/path/appVersion"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - version: "versionValue", - }; - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.appVersionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.appVersionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('appVersionPath', () => { - const result = client.appVersionPath("projectValue", "locationValue", "appValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.appVersionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAppVersionName', () => { - const result = client.matchProjectFromAppVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAppVersionName', () => { - const result = client.matchLocationFromAppVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromAppVersionName', () => { - const result = client.matchAppFromAppVersionName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromAppVersionName', () => { - const result = client.matchVersionFromAppVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('changelog', async () => { - const fakePath = "/rendered/path/changelog"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - changelog: "changelogValue", - }; - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.changelogPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.changelogPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('changelogPath', () => { - const result = client.changelogPath("projectValue", "locationValue", "appValue", "changelogValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.changelogPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromChangelogName', () => { - const result = client.matchProjectFromChangelogName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromChangelogName', () => { - const result = client.matchLocationFromChangelogName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromChangelogName', () => { - const result = client.matchAppFromChangelogName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchChangelogFromChangelogName', () => { - const result = client.matchChangelogFromChangelogName(fakePath); - assert.strictEqual(result, "changelogValue"); - assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('conversation', async () => { - const fakePath = "/rendered/path/conversation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - conversation: "conversationValue", - }; - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.conversationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.conversationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('conversationPath', () => { - const result = client.conversationPath("projectValue", "locationValue", "appValue", "conversationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.conversationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromConversationName', () => { - const result = client.matchProjectFromConversationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromConversationName', () => { - const result = client.matchLocationFromConversationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromConversationName', () => { - const result = client.matchAppFromConversationName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchConversationFromConversationName', () => { - const result = client.matchConversationFromConversationName(fakePath); - assert.strictEqual(result, "conversationValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('deployment', async () => { - const fakePath = "/rendered/path/deployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - deployment: "deploymentValue", - }; - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.deploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentPath', () => { - const result = client.deploymentPath("projectValue", "locationValue", "appValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentName', () => { - const result = client.matchProjectFromDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentName', () => { - const result = client.matchLocationFromDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromDeploymentName', () => { - const result = client.matchAppFromDeploymentName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromDeploymentName', () => { - const result = client.matchDeploymentFromDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('example', async () => { - const fakePath = "/rendered/path/example"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - example: "exampleValue", - }; - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.examplePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.examplePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('examplePath', () => { - const result = client.examplePath("projectValue", "locationValue", "appValue", "exampleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.examplePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExampleName', () => { - const result = client.matchProjectFromExampleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.examplePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExampleName', () => { - const result = client.matchLocationFromExampleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.examplePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromExampleName', () => { - const result = client.matchAppFromExampleName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.examplePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExampleFromExampleName', () => { - const result = client.matchExampleFromExampleName(fakePath); - assert.strictEqual(result, "exampleValue"); - assert((client.pathTemplates.examplePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('guardrail', async () => { - const fakePath = "/rendered/path/guardrail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - guardrail: "guardrailValue", - }; - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.guardrailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.guardrailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('guardrailPath', () => { - const result = client.guardrailPath("projectValue", "locationValue", "appValue", "guardrailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.guardrailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromGuardrailName', () => { - const result = client.matchProjectFromGuardrailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromGuardrailName', () => { - const result = client.matchLocationFromGuardrailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromGuardrailName', () => { - const result = client.matchAppFromGuardrailName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchGuardrailFromGuardrailName', () => { - const result = client.matchGuardrailFromGuardrailName(fakePath); - assert.strictEqual(result, "guardrailValue"); - assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('omnichannel', async () => { - const fakePath = "/rendered/path/omnichannel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - omnichannel: "omnichannelValue", - }; - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.omnichannelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.omnichannelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('omnichannelPath', () => { - const result = client.omnichannelPath("projectValue", "locationValue", "omnichannelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.omnichannelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromOmnichannelName', () => { - const result = client.matchProjectFromOmnichannelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOmnichannelName', () => { - const result = client.matchLocationFromOmnichannelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOmnichannelFromOmnichannelName', () => { - const result = client.matchOmnichannelFromOmnichannelName(fakePath); - assert.strictEqual(result, "omnichannelValue"); - assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('session', async () => { - const fakePath = "/rendered/path/session"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - session: "sessionValue", - }; - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionPath', () => { - const result = client.sessionPath("projectValue", "locationValue", "appValue", "sessionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionName', () => { - const result = client.matchProjectFromSessionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSessionName', () => { - const result = client.matchLocationFromSessionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromSessionName', () => { - const result = client.matchAppFromSessionName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSessionFromSessionName', () => { - const result = client.matchSessionFromSessionName(fakePath); - assert.strictEqual(result, "sessionValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tool', async () => { - const fakePath = "/rendered/path/tool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - tool: "toolValue", - }; - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.toolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.toolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('toolPath', () => { - const result = client.toolPath("projectValue", "locationValue", "appValue", "toolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.toolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromToolName', () => { - const result = client.matchProjectFromToolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.toolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromToolName', () => { - const result = client.matchLocationFromToolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.toolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromToolName', () => { - const result = client.matchAppFromToolName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.toolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchToolFromToolName', () => { - const result = client.matchToolFromToolName(fakePath); - assert.strictEqual(result, "toolValue"); - assert((client.pathTemplates.toolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('toolset', async () => { - const fakePath = "/rendered/path/toolset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - toolset: "toolsetValue", - }; - const client = new sessionserviceModule.v1.SessionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.toolsetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.toolsetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('toolsetPath', () => { - const result = client.toolsetPath("projectValue", "locationValue", "appValue", "toolsetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.toolsetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromToolsetName', () => { - const result = client.matchProjectFromToolsetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromToolsetName', () => { - const result = client.matchLocationFromToolsetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromToolsetName', () => { - const result = client.matchAppFromToolsetName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchToolsetFromToolsetName', () => { - const result = client.matchToolsetFromToolsetName(fakePath); - assert.strictEqual(result, "toolsetValue"); - assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-ces/test/gapic_tool_service_v1.ts b/owl-bot-staging/google-cloud-ces/test/gapic_tool_service_v1.ts deleted file mode 100644 index 588ddeeb222..00000000000 --- a/owl-bot-staging/google-cloud-ces/test/gapic_tool_service_v1.ts +++ /dev/null @@ -1,1305 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as toolserviceModule from '../src'; - -import {protobuf, 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 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.ToolServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new toolserviceModule.v1.ToolServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new toolserviceModule.v1.ToolServiceClient(); - 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 = toolserviceModule.v1.ToolServiceClient.servicePath; - assert.strictEqual(servicePath, 'ces.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = toolserviceModule.v1.ToolServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new toolserviceModule.v1.ToolServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'ces.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new toolserviceModule.v1.ToolServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'ces.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 toolserviceModule.v1.ToolServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'ces.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 toolserviceModule.v1.ToolServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'ces.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 toolserviceModule.v1.ToolServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = toolserviceModule.v1.ToolServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new toolserviceModule.v1.ToolServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.toolServiceStub, undefined); - await client.initialize(); - assert(client.toolServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.toolServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.toolServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new toolserviceModule.v1.ToolServiceClient({ - 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 toolserviceModule.v1.ToolServiceClient({ - 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('executeTool', () => { - it('invokes executeTool without error', async () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ExecuteToolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ExecuteToolRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.ExecuteToolResponse() - ); - client.innerApiCalls.executeTool = stubSimpleCall(expectedResponse); - const [response] = await client.executeTool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.executeTool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeTool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeTool without error using callback', async () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ExecuteToolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ExecuteToolRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.ExecuteToolResponse() - ); - client.innerApiCalls.executeTool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.executeTool( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IExecuteToolResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.executeTool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeTool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeTool with error', async () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ExecuteToolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ExecuteToolRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.executeTool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.executeTool(request), expectedError); - const actualRequest = (client.innerApiCalls.executeTool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeTool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeTool with closed client', async () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.ExecuteToolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.ExecuteToolRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.executeTool(request), expectedError); - }); - }); - - describe('retrieveToolSchema', () => { - it('invokes retrieveToolSchema without error', async () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.RetrieveToolSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.RetrieveToolSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.RetrieveToolSchemaResponse() - ); - client.innerApiCalls.retrieveToolSchema = stubSimpleCall(expectedResponse); - const [response] = await client.retrieveToolSchema(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.retrieveToolSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.retrieveToolSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes retrieveToolSchema without error using callback', async () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.RetrieveToolSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.RetrieveToolSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.RetrieveToolSchemaResponse() - ); - client.innerApiCalls.retrieveToolSchema = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.retrieveToolSchema( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IRetrieveToolSchemaResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.retrieveToolSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.retrieveToolSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes retrieveToolSchema with error', async () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.RetrieveToolSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.RetrieveToolSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.retrieveToolSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.retrieveToolSchema(request), expectedError); - const actualRequest = (client.innerApiCalls.retrieveToolSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.retrieveToolSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes retrieveToolSchema with closed client', async () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.RetrieveToolSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.RetrieveToolSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.retrieveToolSchema(request), expectedError); - }); - }); - - describe('retrieveTools', () => { - it('invokes retrieveTools without error', async () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.RetrieveToolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.RetrieveToolsRequest', ['toolset']); - request.toolset = defaultValue1; - const expectedHeaderRequestParams = `toolset=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.RetrieveToolsResponse() - ); - client.innerApiCalls.retrieveTools = stubSimpleCall(expectedResponse); - const [response] = await client.retrieveTools(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.retrieveTools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.retrieveTools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes retrieveTools without error using callback', async () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.RetrieveToolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.RetrieveToolsRequest', ['toolset']); - request.toolset = defaultValue1; - const expectedHeaderRequestParams = `toolset=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.RetrieveToolsResponse() - ); - client.innerApiCalls.retrieveTools = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.retrieveTools( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IRetrieveToolsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.retrieveTools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.retrieveTools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes retrieveTools with error', async () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.RetrieveToolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.RetrieveToolsRequest', ['toolset']); - request.toolset = defaultValue1; - const expectedHeaderRequestParams = `toolset=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.retrieveTools = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.retrieveTools(request), expectedError); - const actualRequest = (client.innerApiCalls.retrieveTools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.retrieveTools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes retrieveTools with closed client', async () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.RetrieveToolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.RetrieveToolsRequest', ['toolset']); - request.toolset = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.retrieveTools(request), expectedError); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('agent', async () => { - const fakePath = "/rendered/path/agent"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - agent: "agentValue", - }; - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.agentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.agentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('agentPath', () => { - const result = client.agentPath("projectValue", "locationValue", "appValue", "agentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.agentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAgentName', () => { - const result = client.matchProjectFromAgentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.agentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAgentName', () => { - const result = client.matchLocationFromAgentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.agentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromAgentName', () => { - const result = client.matchAppFromAgentName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.agentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAgentFromAgentName', () => { - const result = client.matchAgentFromAgentName(fakePath); - assert.strictEqual(result, "agentValue"); - assert((client.pathTemplates.agentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('app', async () => { - const fakePath = "/rendered/path/app"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - }; - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.appPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.appPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('appPath', () => { - const result = client.appPath("projectValue", "locationValue", "appValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.appPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAppName', () => { - const result = client.matchProjectFromAppName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.appPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAppName', () => { - const result = client.matchLocationFromAppName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.appPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromAppName', () => { - const result = client.matchAppFromAppName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.appPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('appVersion', async () => { - const fakePath = "/rendered/path/appVersion"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - version: "versionValue", - }; - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.appVersionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.appVersionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('appVersionPath', () => { - const result = client.appVersionPath("projectValue", "locationValue", "appValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.appVersionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAppVersionName', () => { - const result = client.matchProjectFromAppVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAppVersionName', () => { - const result = client.matchLocationFromAppVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromAppVersionName', () => { - const result = client.matchAppFromAppVersionName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromAppVersionName', () => { - const result = client.matchVersionFromAppVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('changelog', async () => { - const fakePath = "/rendered/path/changelog"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - changelog: "changelogValue", - }; - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.changelogPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.changelogPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('changelogPath', () => { - const result = client.changelogPath("projectValue", "locationValue", "appValue", "changelogValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.changelogPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromChangelogName', () => { - const result = client.matchProjectFromChangelogName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromChangelogName', () => { - const result = client.matchLocationFromChangelogName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromChangelogName', () => { - const result = client.matchAppFromChangelogName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchChangelogFromChangelogName', () => { - const result = client.matchChangelogFromChangelogName(fakePath); - assert.strictEqual(result, "changelogValue"); - assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('conversation', async () => { - const fakePath = "/rendered/path/conversation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - conversation: "conversationValue", - }; - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.conversationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.conversationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('conversationPath', () => { - const result = client.conversationPath("projectValue", "locationValue", "appValue", "conversationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.conversationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromConversationName', () => { - const result = client.matchProjectFromConversationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromConversationName', () => { - const result = client.matchLocationFromConversationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromConversationName', () => { - const result = client.matchAppFromConversationName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchConversationFromConversationName', () => { - const result = client.matchConversationFromConversationName(fakePath); - assert.strictEqual(result, "conversationValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('deployment', async () => { - const fakePath = "/rendered/path/deployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - deployment: "deploymentValue", - }; - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.deploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentPath', () => { - const result = client.deploymentPath("projectValue", "locationValue", "appValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentName', () => { - const result = client.matchProjectFromDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentName', () => { - const result = client.matchLocationFromDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromDeploymentName', () => { - const result = client.matchAppFromDeploymentName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromDeploymentName', () => { - const result = client.matchDeploymentFromDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('example', async () => { - const fakePath = "/rendered/path/example"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - example: "exampleValue", - }; - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.examplePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.examplePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('examplePath', () => { - const result = client.examplePath("projectValue", "locationValue", "appValue", "exampleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.examplePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExampleName', () => { - const result = client.matchProjectFromExampleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.examplePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExampleName', () => { - const result = client.matchLocationFromExampleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.examplePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromExampleName', () => { - const result = client.matchAppFromExampleName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.examplePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExampleFromExampleName', () => { - const result = client.matchExampleFromExampleName(fakePath); - assert.strictEqual(result, "exampleValue"); - assert((client.pathTemplates.examplePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('guardrail', async () => { - const fakePath = "/rendered/path/guardrail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - guardrail: "guardrailValue", - }; - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.guardrailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.guardrailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('guardrailPath', () => { - const result = client.guardrailPath("projectValue", "locationValue", "appValue", "guardrailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.guardrailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromGuardrailName', () => { - const result = client.matchProjectFromGuardrailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromGuardrailName', () => { - const result = client.matchLocationFromGuardrailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromGuardrailName', () => { - const result = client.matchAppFromGuardrailName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchGuardrailFromGuardrailName', () => { - const result = client.matchGuardrailFromGuardrailName(fakePath); - assert.strictEqual(result, "guardrailValue"); - assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('omnichannel', async () => { - const fakePath = "/rendered/path/omnichannel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - omnichannel: "omnichannelValue", - }; - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.omnichannelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.omnichannelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('omnichannelPath', () => { - const result = client.omnichannelPath("projectValue", "locationValue", "omnichannelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.omnichannelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromOmnichannelName', () => { - const result = client.matchProjectFromOmnichannelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOmnichannelName', () => { - const result = client.matchLocationFromOmnichannelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOmnichannelFromOmnichannelName', () => { - const result = client.matchOmnichannelFromOmnichannelName(fakePath); - assert.strictEqual(result, "omnichannelValue"); - assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tool', async () => { - const fakePath = "/rendered/path/tool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - tool: "toolValue", - }; - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.toolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.toolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('toolPath', () => { - const result = client.toolPath("projectValue", "locationValue", "appValue", "toolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.toolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromToolName', () => { - const result = client.matchProjectFromToolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.toolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromToolName', () => { - const result = client.matchLocationFromToolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.toolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromToolName', () => { - const result = client.matchAppFromToolName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.toolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchToolFromToolName', () => { - const result = client.matchToolFromToolName(fakePath); - assert.strictEqual(result, "toolValue"); - assert((client.pathTemplates.toolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('toolset', async () => { - const fakePath = "/rendered/path/toolset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - toolset: "toolsetValue", - }; - const client = new toolserviceModule.v1.ToolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.toolsetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.toolsetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('toolsetPath', () => { - const result = client.toolsetPath("projectValue", "locationValue", "appValue", "toolsetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.toolsetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromToolsetName', () => { - const result = client.matchProjectFromToolsetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromToolsetName', () => { - const result = client.matchLocationFromToolsetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromToolsetName', () => { - const result = client.matchAppFromToolsetName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchToolsetFromToolsetName', () => { - const result = client.matchToolsetFromToolsetName(fakePath); - assert.strictEqual(result, "toolsetValue"); - assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-ces/test/gapic_widget_service_v1.ts b/owl-bot-staging/google-cloud-ces/test/gapic_widget_service_v1.ts deleted file mode 100644 index eb75d8d4f4b..00000000000 --- a/owl-bot-staging/google-cloud-ces/test/gapic_widget_service_v1.ts +++ /dev/null @@ -1,1143 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as widgetserviceModule from '../src'; - -import {protobuf, 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 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.WidgetServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new widgetserviceModule.v1.WidgetServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new widgetserviceModule.v1.WidgetServiceClient(); - 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 = widgetserviceModule.v1.WidgetServiceClient.servicePath; - assert.strictEqual(servicePath, 'ces.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = widgetserviceModule.v1.WidgetServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'ces.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new widgetserviceModule.v1.WidgetServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'ces.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new widgetserviceModule.v1.WidgetServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'ces.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 widgetserviceModule.v1.WidgetServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'ces.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 widgetserviceModule.v1.WidgetServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'ces.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 widgetserviceModule.v1.WidgetServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = widgetserviceModule.v1.WidgetServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new widgetserviceModule.v1.WidgetServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new widgetserviceModule.v1.WidgetServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.widgetServiceStub, undefined); - await client.initialize(); - assert(client.widgetServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.widgetServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.widgetServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new widgetserviceModule.v1.WidgetServiceClient({ - 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 widgetserviceModule.v1.WidgetServiceClient({ - 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('generateChatToken', () => { - it('invokes generateChatToken without error', async () => { - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GenerateChatTokenRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GenerateChatTokenRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.GenerateChatTokenResponse() - ); - client.innerApiCalls.generateChatToken = stubSimpleCall(expectedResponse); - const [response] = await client.generateChatToken(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.generateChatToken as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateChatToken as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateChatToken without error using callback', async () => { - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GenerateChatTokenRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GenerateChatTokenRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.ces.v1.GenerateChatTokenResponse() - ); - client.innerApiCalls.generateChatToken = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.generateChatToken( - request, - (err?: Error|null, result?: protos.google.cloud.ces.v1.IGenerateChatTokenResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.generateChatToken as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateChatToken as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateChatToken with error', async () => { - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GenerateChatTokenRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GenerateChatTokenRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.generateChatToken = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.generateChatToken(request), expectedError); - const actualRequest = (client.innerApiCalls.generateChatToken as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateChatToken as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateChatToken with closed client', async () => { - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.ces.v1.GenerateChatTokenRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.ces.v1.GenerateChatTokenRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.generateChatToken(request), expectedError); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('agent', async () => { - const fakePath = "/rendered/path/agent"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - agent: "agentValue", - }; - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.agentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.agentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('agentPath', () => { - const result = client.agentPath("projectValue", "locationValue", "appValue", "agentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.agentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAgentName', () => { - const result = client.matchProjectFromAgentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.agentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAgentName', () => { - const result = client.matchLocationFromAgentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.agentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromAgentName', () => { - const result = client.matchAppFromAgentName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.agentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAgentFromAgentName', () => { - const result = client.matchAgentFromAgentName(fakePath); - assert.strictEqual(result, "agentValue"); - assert((client.pathTemplates.agentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('app', async () => { - const fakePath = "/rendered/path/app"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - }; - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.appPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.appPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('appPath', () => { - const result = client.appPath("projectValue", "locationValue", "appValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.appPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAppName', () => { - const result = client.matchProjectFromAppName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.appPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAppName', () => { - const result = client.matchLocationFromAppName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.appPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromAppName', () => { - const result = client.matchAppFromAppName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.appPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('appVersion', async () => { - const fakePath = "/rendered/path/appVersion"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - version: "versionValue", - }; - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.appVersionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.appVersionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('appVersionPath', () => { - const result = client.appVersionPath("projectValue", "locationValue", "appValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.appVersionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAppVersionName', () => { - const result = client.matchProjectFromAppVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAppVersionName', () => { - const result = client.matchLocationFromAppVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromAppVersionName', () => { - const result = client.matchAppFromAppVersionName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromAppVersionName', () => { - const result = client.matchVersionFromAppVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.appVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('changelog', async () => { - const fakePath = "/rendered/path/changelog"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - changelog: "changelogValue", - }; - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.changelogPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.changelogPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('changelogPath', () => { - const result = client.changelogPath("projectValue", "locationValue", "appValue", "changelogValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.changelogPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromChangelogName', () => { - const result = client.matchProjectFromChangelogName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromChangelogName', () => { - const result = client.matchLocationFromChangelogName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromChangelogName', () => { - const result = client.matchAppFromChangelogName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchChangelogFromChangelogName', () => { - const result = client.matchChangelogFromChangelogName(fakePath); - assert.strictEqual(result, "changelogValue"); - assert((client.pathTemplates.changelogPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('conversation', async () => { - const fakePath = "/rendered/path/conversation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - conversation: "conversationValue", - }; - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.conversationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.conversationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('conversationPath', () => { - const result = client.conversationPath("projectValue", "locationValue", "appValue", "conversationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.conversationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromConversationName', () => { - const result = client.matchProjectFromConversationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromConversationName', () => { - const result = client.matchLocationFromConversationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromConversationName', () => { - const result = client.matchAppFromConversationName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchConversationFromConversationName', () => { - const result = client.matchConversationFromConversationName(fakePath); - assert.strictEqual(result, "conversationValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('deployment', async () => { - const fakePath = "/rendered/path/deployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - deployment: "deploymentValue", - }; - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.deploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentPath', () => { - const result = client.deploymentPath("projectValue", "locationValue", "appValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentName', () => { - const result = client.matchProjectFromDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentName', () => { - const result = client.matchLocationFromDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromDeploymentName', () => { - const result = client.matchAppFromDeploymentName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromDeploymentName', () => { - const result = client.matchDeploymentFromDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('example', async () => { - const fakePath = "/rendered/path/example"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - example: "exampleValue", - }; - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.examplePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.examplePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('examplePath', () => { - const result = client.examplePath("projectValue", "locationValue", "appValue", "exampleValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.examplePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExampleName', () => { - const result = client.matchProjectFromExampleName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.examplePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExampleName', () => { - const result = client.matchLocationFromExampleName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.examplePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromExampleName', () => { - const result = client.matchAppFromExampleName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.examplePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExampleFromExampleName', () => { - const result = client.matchExampleFromExampleName(fakePath); - assert.strictEqual(result, "exampleValue"); - assert((client.pathTemplates.examplePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('guardrail', async () => { - const fakePath = "/rendered/path/guardrail"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - guardrail: "guardrailValue", - }; - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.guardrailPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.guardrailPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('guardrailPath', () => { - const result = client.guardrailPath("projectValue", "locationValue", "appValue", "guardrailValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.guardrailPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromGuardrailName', () => { - const result = client.matchProjectFromGuardrailName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromGuardrailName', () => { - const result = client.matchLocationFromGuardrailName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromGuardrailName', () => { - const result = client.matchAppFromGuardrailName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchGuardrailFromGuardrailName', () => { - const result = client.matchGuardrailFromGuardrailName(fakePath); - assert.strictEqual(result, "guardrailValue"); - assert((client.pathTemplates.guardrailPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('omnichannel', async () => { - const fakePath = "/rendered/path/omnichannel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - omnichannel: "omnichannelValue", - }; - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.omnichannelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.omnichannelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('omnichannelPath', () => { - const result = client.omnichannelPath("projectValue", "locationValue", "omnichannelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.omnichannelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromOmnichannelName', () => { - const result = client.matchProjectFromOmnichannelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromOmnichannelName', () => { - const result = client.matchLocationFromOmnichannelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOmnichannelFromOmnichannelName', () => { - const result = client.matchOmnichannelFromOmnichannelName(fakePath); - assert.strictEqual(result, "omnichannelValue"); - assert((client.pathTemplates.omnichannelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('session', async () => { - const fakePath = "/rendered/path/session"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - session: "sessionValue", - }; - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionPath', () => { - const result = client.sessionPath("projectValue", "locationValue", "appValue", "sessionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionName', () => { - const result = client.matchProjectFromSessionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSessionName', () => { - const result = client.matchLocationFromSessionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromSessionName', () => { - const result = client.matchAppFromSessionName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSessionFromSessionName', () => { - const result = client.matchSessionFromSessionName(fakePath); - assert.strictEqual(result, "sessionValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tool', async () => { - const fakePath = "/rendered/path/tool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - tool: "toolValue", - }; - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.toolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.toolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('toolPath', () => { - const result = client.toolPath("projectValue", "locationValue", "appValue", "toolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.toolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromToolName', () => { - const result = client.matchProjectFromToolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.toolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromToolName', () => { - const result = client.matchLocationFromToolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.toolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromToolName', () => { - const result = client.matchAppFromToolName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.toolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchToolFromToolName', () => { - const result = client.matchToolFromToolName(fakePath); - assert.strictEqual(result, "toolValue"); - assert((client.pathTemplates.toolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('toolset', async () => { - const fakePath = "/rendered/path/toolset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - app: "appValue", - toolset: "toolsetValue", - }; - const client = new widgetserviceModule.v1.WidgetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.toolsetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.toolsetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('toolsetPath', () => { - const result = client.toolsetPath("projectValue", "locationValue", "appValue", "toolsetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.toolsetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromToolsetName', () => { - const result = client.matchProjectFromToolsetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromToolsetName', () => { - const result = client.matchLocationFromToolsetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppFromToolsetName', () => { - const result = client.matchAppFromToolsetName(fakePath); - assert.strictEqual(result, "appValue"); - assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchToolsetFromToolsetName', () => { - const result = client.matchToolsetFromToolsetName(fakePath); - assert.strictEqual(result, "toolsetValue"); - assert((client.pathTemplates.toolsetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-ces/tsconfig.json b/owl-bot-staging/google-cloud-ces/tsconfig.json deleted file mode 100644 index ca73e7bfc82..00000000000 --- a/owl-bot-staging/google-cloud-ces/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2023", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts", - "src/**/*.json", - "samples/**/*.json", - "protos/protos.json" - ] -} diff --git a/owl-bot-staging/google-cloud-ces/webpack.config.js b/owl-bot-staging/google-cloud-ces/webpack.config.js deleted file mode 100644 index e4d0d078fe2..00000000000 --- a/owl-bot-staging/google-cloud-ces/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: 'AgentService', - filename: './agent-service.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-ces/README.md b/packages/google-cloud-ces/README.md index d4b9f872b34..42995b8cdeb 100644 --- a/packages/google-cloud-ces/README.md +++ b/packages/google-cloud-ces/README.md @@ -112,6 +112,92 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ | retrieve tool schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tool_schema.js) | | retrieve tools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/tool_service.retrieve_tools.js) | | generate chat token | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1/widget_service.generate_chat_token.js) | +| batch delete conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.batch_delete_conversations.js) | +| create agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_agent.js) | +| create app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_app.js) | +| create app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_app_version.js) | +| create deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_deployment.js) | +| create example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_example.js) | +| create guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_guardrail.js) | +| create tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_tool.js) | +| create toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_toolset.js) | +| delete agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_agent.js) | +| delete app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app.js) | +| delete app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app_version.js) | +| delete conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_conversation.js) | +| delete deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_deployment.js) | +| delete example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_example.js) | +| delete guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_guardrail.js) | +| delete tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_tool.js) | +| delete toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_toolset.js) | +| export app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.export_app.js) | +| get agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_agent.js) | +| get app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_app.js) | +| get app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_app_version.js) | +| get changelog | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_changelog.js) | +| get conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_conversation.js) | +| get deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_deployment.js) | +| get example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_example.js) | +| get guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_guardrail.js) | +| get tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_tool.js) | +| get toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_toolset.js) | +| import app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.import_app.js) | +| list agents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_agents.js) | +| list app versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_app_versions.js) | +| list apps | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_apps.js) | +| list changelogs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_changelogs.js) | +| list conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_conversations.js) | +| list deployments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_deployments.js) | +| list examples | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_examples.js) | +| list guardrails | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_guardrails.js) | +| list tools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_tools.js) | +| list toolsets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_toolsets.js) | +| restore app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.restore_app_version.js) | +| update agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_agent.js) | +| update app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_app.js) | +| update deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_deployment.js) | +| update example | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_example.js) | +| update guardrail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_guardrail.js) | +| update tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_tool.js) | +| update toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_toolset.js) | +| create evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation.js) | +| create evaluation dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_dataset.js) | +| create evaluation expectation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_expectation.js) | +| create scheduled evaluation run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_scheduled_evaluation_run.js) | +| delete evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation.js) | +| delete evaluation dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_dataset.js) | +| delete evaluation expectation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_expectation.js) | +| delete evaluation result | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_result.js) | +| delete evaluation run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_run.js) | +| delete scheduled evaluation run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_scheduled_evaluation_run.js) | +| generate evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.generate_evaluation.js) | +| get evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation.js) | +| get evaluation dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_dataset.js) | +| get evaluation expectation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_expectation.js) | +| get evaluation result | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_result.js) | +| get evaluation run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_run.js) | +| get scheduled evaluation run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_scheduled_evaluation_run.js) | +| import evaluations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.import_evaluations.js) | +| list evaluation datasets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_datasets.js) | +| list evaluation expectations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_expectations.js) | +| list evaluation results | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_results.js) | +| list evaluation runs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_runs.js) | +| list evaluations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluations.js) | +| list scheduled evaluation runs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_scheduled_evaluation_runs.js) | +| run evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.run_evaluation.js) | +| test persona voice | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.test_persona_voice.js) | +| update evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation.js) | +| update evaluation dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_dataset.js) | +| update evaluation expectation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_expectation.js) | +| update scheduled evaluation run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_scheduled_evaluation_run.js) | +| upload evaluation audio | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.upload_evaluation_audio.js) | +| bidi run session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/session_service.bidi_run_session.js) | +| run session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/session_service.run_session.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/snippet_metadata_google.cloud.ces.v1beta.json) | +| execute tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/tool_service.execute_tool.js) | +| retrieve tool schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tool_schema.js) | +| retrieve tools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tools.js) | +| generate chat token | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/widget_service.generate_chat_token.js) | ## Supported Node.js Versions diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/agent.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/agent.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/agent.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/agent.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_service.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_service.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_service.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_service.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_transfers.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_transfers.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_transfers.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_transfers.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/app.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/app.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/app.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/app.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/app_version.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/app_version.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/app_version.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/app_version.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/auth.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/auth.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/auth.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/auth.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/bigquery_export.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/bigquery_export.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/bigquery_export.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/bigquery_export.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/changelog.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/changelog.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/changelog.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/changelog.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/client_function.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/client_function.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/client_function.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/client_function.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/common.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/common.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/common.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/common.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/connector_tool.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/connector_tool.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/connector_tool.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/connector_tool.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/connector_toolset.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/connector_toolset.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/connector_toolset.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/connector_toolset.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/conversation.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/conversation.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/conversation.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/conversation.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/data_store.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/data_store.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/data_store.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/data_store.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/data_store_tool.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/data_store_tool.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/data_store_tool.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/data_store_tool.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/deployment.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/deployment.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/deployment.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/deployment.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/evaluation.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/evaluation.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/evaluation.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/evaluation.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/evaluation_service.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/evaluation_service.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/evaluation_service.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/evaluation_service.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/example.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/example.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/example.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/example.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/fakes.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/fakes.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/fakes.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/fakes.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/file_search_tool.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/file_search_tool.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/file_search_tool.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/file_search_tool.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/golden_run.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/golden_run.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/golden_run.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/golden_run.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/google_search_tool.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/google_search_tool.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/google_search_tool.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/google_search_tool.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/guardrail.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/guardrail.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/guardrail.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/guardrail.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/mcp_tool.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/mcp_tool.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/mcp_tool.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/mcp_tool.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/mcp_toolset.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/mcp_toolset.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/mcp_toolset.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/mcp_toolset.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/omnichannel.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/omnichannel.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/omnichannel.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/omnichannel.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/omnichannel_service.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/omnichannel_service.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/omnichannel_service.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/omnichannel_service.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/open_api_tool.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/open_api_tool.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/open_api_tool.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/open_api_tool.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/open_api_toolset.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/open_api_toolset.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/open_api_toolset.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/open_api_toolset.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/python_function.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/python_function.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/python_function.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/python_function.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/schema.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/schema.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/schema.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/schema.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/search_suggestions.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/search_suggestions.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/search_suggestions.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/search_suggestions.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/session_service.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/session_service.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/session_service.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/session_service.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/system_tool.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/system_tool.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/system_tool.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/system_tool.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/tool.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/tool.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/tool.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/tool.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/tool_service.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/tool_service.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/tool_service.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/tool_service.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/toolset.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/toolset.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/toolset.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/toolset.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/toolset_tool.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/toolset_tool.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/toolset_tool.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/toolset_tool.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/widget_service.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/widget_service.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/widget_service.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/widget_service.proto diff --git a/owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/widget_tool.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/widget_tool.proto similarity index 100% rename from owl-bot-staging/google-cloud-ces/protos/google/cloud/ces/v1beta/widget_tool.proto rename to packages/google-cloud-ces/protos/google/cloud/ces/v1beta/widget_tool.proto diff --git a/packages/google-cloud-ces/protos/protos.d.ts b/packages/google-cloud-ces/protos/protos.d.ts index 4febeee9b3f..c43519c0865 100644 --- a/packages/google-cloud-ces/protos/protos.d.ts +++ b/packages/google-cloud-ces/protos/protos.d.ts @@ -25744,6 +25744,39033 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } } + + /** Namespace v1beta. */ + namespace v1beta { + + /** Properties of an Agent. */ + interface IAgent { + + /** Agent llmAgent */ + llmAgent?: (google.cloud.ces.v1beta.Agent.ILlmAgent|null); + + /** Agent remoteDialogflowAgent */ + remoteDialogflowAgent?: (google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent|null); + + /** Agent name */ + name?: (string|null); + + /** Agent displayName */ + displayName?: (string|null); + + /** Agent description */ + description?: (string|null); + + /** Agent modelSettings */ + modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** Agent instruction */ + instruction?: (string|null); + + /** Agent tools */ + tools?: (string[]|null); + + /** Agent childAgents */ + childAgents?: (string[]|null); + + /** Agent beforeAgentCallbacks */ + beforeAgentCallbacks?: (google.cloud.ces.v1beta.ICallback[]|null); + + /** Agent afterAgentCallbacks */ + afterAgentCallbacks?: (google.cloud.ces.v1beta.ICallback[]|null); + + /** Agent beforeModelCallbacks */ + beforeModelCallbacks?: (google.cloud.ces.v1beta.ICallback[]|null); + + /** Agent afterModelCallbacks */ + afterModelCallbacks?: (google.cloud.ces.v1beta.ICallback[]|null); + + /** Agent beforeToolCallbacks */ + beforeToolCallbacks?: (google.cloud.ces.v1beta.ICallback[]|null); + + /** Agent afterToolCallbacks */ + afterToolCallbacks?: (google.cloud.ces.v1beta.ICallback[]|null); + + /** Agent createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Agent updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Agent guardrails */ + guardrails?: (string[]|null); + + /** Agent etag */ + etag?: (string|null); + + /** Agent toolsets */ + toolsets?: (google.cloud.ces.v1beta.Agent.IAgentToolset[]|null); + + /** Agent generatedSummary */ + generatedSummary?: (string|null); + + /** Agent transferRules */ + transferRules?: (google.cloud.ces.v1beta.ITransferRule[]|null); + } + + /** Represents an Agent. */ + class Agent implements IAgent { + + /** + * Constructs a new Agent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IAgent); + + /** Agent llmAgent. */ + public llmAgent?: (google.cloud.ces.v1beta.Agent.ILlmAgent|null); + + /** Agent remoteDialogflowAgent. */ + public remoteDialogflowAgent?: (google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent|null); + + /** Agent name. */ + public name: string; + + /** Agent displayName. */ + public displayName: string; + + /** Agent description. */ + public description: string; + + /** Agent modelSettings. */ + public modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** Agent instruction. */ + public instruction: string; + + /** Agent tools. */ + public tools: string[]; + + /** Agent childAgents. */ + public childAgents: string[]; + + /** Agent beforeAgentCallbacks. */ + public beforeAgentCallbacks: google.cloud.ces.v1beta.ICallback[]; + + /** Agent afterAgentCallbacks. */ + public afterAgentCallbacks: google.cloud.ces.v1beta.ICallback[]; + + /** Agent beforeModelCallbacks. */ + public beforeModelCallbacks: google.cloud.ces.v1beta.ICallback[]; + + /** Agent afterModelCallbacks. */ + public afterModelCallbacks: google.cloud.ces.v1beta.ICallback[]; + + /** Agent beforeToolCallbacks. */ + public beforeToolCallbacks: google.cloud.ces.v1beta.ICallback[]; + + /** Agent afterToolCallbacks. */ + public afterToolCallbacks: google.cloud.ces.v1beta.ICallback[]; + + /** Agent createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Agent updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Agent guardrails. */ + public guardrails: string[]; + + /** Agent etag. */ + public etag: string; + + /** Agent toolsets. */ + public toolsets: google.cloud.ces.v1beta.Agent.IAgentToolset[]; + + /** Agent generatedSummary. */ + public generatedSummary: string; + + /** Agent transferRules. */ + public transferRules: google.cloud.ces.v1beta.ITransferRule[]; + + /** Agent agentType. */ + public agentType?: ("llmAgent"|"remoteDialogflowAgent"); + + /** + * Creates a new Agent instance using the specified properties. + * @param [properties] Properties to set + * @returns Agent instance + */ + public static create(properties?: google.cloud.ces.v1beta.IAgent): google.cloud.ces.v1beta.Agent; + + /** + * Encodes the specified Agent message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.verify|verify} messages. + * @param message Agent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Agent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.verify|verify} messages. + * @param message Agent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Agent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Agent; + + /** + * Decodes an Agent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Agent; + + /** + * Verifies an Agent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Agent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Agent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Agent; + + /** + * Creates a plain object from an Agent message. Also converts values to other types if specified. + * @param message Agent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Agent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Agent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Agent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Agent { + + /** Properties of a LlmAgent. */ + interface ILlmAgent { + } + + /** Represents a LlmAgent. */ + class LlmAgent implements ILlmAgent { + + /** + * Constructs a new LlmAgent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Agent.ILlmAgent); + + /** + * Creates a new LlmAgent instance using the specified properties. + * @param [properties] Properties to set + * @returns LlmAgent instance + */ + public static create(properties?: google.cloud.ces.v1beta.Agent.ILlmAgent): google.cloud.ces.v1beta.Agent.LlmAgent; + + /** + * Encodes the specified LlmAgent message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.LlmAgent.verify|verify} messages. + * @param message LlmAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Agent.ILlmAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LlmAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.LlmAgent.verify|verify} messages. + * @param message LlmAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Agent.ILlmAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LlmAgent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LlmAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Agent.LlmAgent; + + /** + * Decodes a LlmAgent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LlmAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Agent.LlmAgent; + + /** + * Verifies a LlmAgent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LlmAgent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LlmAgent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Agent.LlmAgent; + + /** + * Creates a plain object from a LlmAgent message. Also converts values to other types if specified. + * @param message LlmAgent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Agent.LlmAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LlmAgent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LlmAgent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RemoteDialogflowAgent. */ + interface IRemoteDialogflowAgent { + + /** RemoteDialogflowAgent agent */ + agent?: (string|null); + + /** RemoteDialogflowAgent flowId */ + flowId?: (string|null); + + /** RemoteDialogflowAgent environmentId */ + environmentId?: (string|null); + + /** RemoteDialogflowAgent inputVariableMapping */ + inputVariableMapping?: ({ [k: string]: string }|null); + + /** RemoteDialogflowAgent outputVariableMapping */ + outputVariableMapping?: ({ [k: string]: string }|null); + + /** RemoteDialogflowAgent respectResponseInterruptionSettings */ + respectResponseInterruptionSettings?: (boolean|null); + } + + /** Represents a RemoteDialogflowAgent. */ + class RemoteDialogflowAgent implements IRemoteDialogflowAgent { + + /** + * Constructs a new RemoteDialogflowAgent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent); + + /** RemoteDialogflowAgent agent. */ + public agent: string; + + /** RemoteDialogflowAgent flowId. */ + public flowId: string; + + /** RemoteDialogflowAgent environmentId. */ + public environmentId: string; + + /** RemoteDialogflowAgent inputVariableMapping. */ + public inputVariableMapping: { [k: string]: string }; + + /** RemoteDialogflowAgent outputVariableMapping. */ + public outputVariableMapping: { [k: string]: string }; + + /** RemoteDialogflowAgent respectResponseInterruptionSettings. */ + public respectResponseInterruptionSettings: boolean; + + /** + * Creates a new RemoteDialogflowAgent instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoteDialogflowAgent instance + */ + public static create(properties?: google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent): google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent; + + /** + * Encodes the specified RemoteDialogflowAgent message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.verify|verify} messages. + * @param message RemoteDialogflowAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoteDialogflowAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.verify|verify} messages. + * @param message RemoteDialogflowAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoteDialogflowAgent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoteDialogflowAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent; + + /** + * Decodes a RemoteDialogflowAgent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoteDialogflowAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent; + + /** + * Verifies a RemoteDialogflowAgent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoteDialogflowAgent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoteDialogflowAgent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent; + + /** + * Creates a plain object from a RemoteDialogflowAgent message. Also converts values to other types if specified. + * @param message RemoteDialogflowAgent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoteDialogflowAgent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoteDialogflowAgent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AgentToolset. */ + interface IAgentToolset { + + /** AgentToolset toolset */ + toolset?: (string|null); + + /** AgentToolset toolIds */ + toolIds?: (string[]|null); + } + + /** Represents an AgentToolset. */ + class AgentToolset implements IAgentToolset { + + /** + * Constructs a new AgentToolset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Agent.IAgentToolset); + + /** AgentToolset toolset. */ + public toolset: string; + + /** AgentToolset toolIds. */ + public toolIds: string[]; + + /** + * Creates a new AgentToolset instance using the specified properties. + * @param [properties] Properties to set + * @returns AgentToolset instance + */ + public static create(properties?: google.cloud.ces.v1beta.Agent.IAgentToolset): google.cloud.ces.v1beta.Agent.AgentToolset; + + /** + * Encodes the specified AgentToolset message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.AgentToolset.verify|verify} messages. + * @param message AgentToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Agent.IAgentToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AgentToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.AgentToolset.verify|verify} messages. + * @param message AgentToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Agent.IAgentToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AgentToolset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AgentToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Agent.AgentToolset; + + /** + * Decodes an AgentToolset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AgentToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Agent.AgentToolset; + + /** + * Verifies an AgentToolset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AgentToolset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AgentToolset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Agent.AgentToolset; + + /** + * Creates a plain object from an AgentToolset message. Also converts values to other types if specified. + * @param message AgentToolset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Agent.AgentToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AgentToolset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AgentToolset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExpressionCondition. */ + interface IExpressionCondition { + + /** ExpressionCondition expression */ + expression?: (string|null); + } + + /** Represents an ExpressionCondition. */ + class ExpressionCondition implements IExpressionCondition { + + /** + * Constructs a new ExpressionCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IExpressionCondition); + + /** ExpressionCondition expression. */ + public expression: string; + + /** + * Creates a new ExpressionCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns ExpressionCondition instance + */ + public static create(properties?: google.cloud.ces.v1beta.IExpressionCondition): google.cloud.ces.v1beta.ExpressionCondition; + + /** + * Encodes the specified ExpressionCondition message. Does not implicitly {@link google.cloud.ces.v1beta.ExpressionCondition.verify|verify} messages. + * @param message ExpressionCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IExpressionCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExpressionCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExpressionCondition.verify|verify} messages. + * @param message ExpressionCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IExpressionCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExpressionCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExpressionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ExpressionCondition; + + /** + * Decodes an ExpressionCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExpressionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ExpressionCondition; + + /** + * Verifies an ExpressionCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExpressionCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExpressionCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ExpressionCondition; + + /** + * Creates a plain object from an ExpressionCondition message. Also converts values to other types if specified. + * @param message ExpressionCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ExpressionCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExpressionCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExpressionCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonCodeCondition. */ + interface IPythonCodeCondition { + + /** PythonCodeCondition pythonCode */ + pythonCode?: (string|null); + } + + /** Represents a PythonCodeCondition. */ + class PythonCodeCondition implements IPythonCodeCondition { + + /** + * Constructs a new PythonCodeCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IPythonCodeCondition); + + /** PythonCodeCondition pythonCode. */ + public pythonCode: string; + + /** + * Creates a new PythonCodeCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonCodeCondition instance + */ + public static create(properties?: google.cloud.ces.v1beta.IPythonCodeCondition): google.cloud.ces.v1beta.PythonCodeCondition; + + /** + * Encodes the specified PythonCodeCondition message. Does not implicitly {@link google.cloud.ces.v1beta.PythonCodeCondition.verify|verify} messages. + * @param message PythonCodeCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IPythonCodeCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonCodeCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.PythonCodeCondition.verify|verify} messages. + * @param message PythonCodeCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IPythonCodeCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonCodeCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonCodeCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.PythonCodeCondition; + + /** + * Decodes a PythonCodeCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonCodeCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.PythonCodeCondition; + + /** + * Verifies a PythonCodeCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonCodeCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonCodeCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.PythonCodeCondition; + + /** + * Creates a plain object from a PythonCodeCondition message. Also converts values to other types if specified. + * @param message PythonCodeCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.PythonCodeCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonCodeCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonCodeCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferRule. */ + interface ITransferRule { + + /** TransferRule deterministicTransfer */ + deterministicTransfer?: (google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer|null); + + /** TransferRule disablePlannerTransfer */ + disablePlannerTransfer?: (google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer|null); + + /** TransferRule childAgent */ + childAgent?: (string|null); + + /** TransferRule direction */ + direction?: (google.cloud.ces.v1beta.TransferRule.Direction|keyof typeof google.cloud.ces.v1beta.TransferRule.Direction|null); + } + + /** Represents a TransferRule. */ + class TransferRule implements ITransferRule { + + /** + * Constructs a new TransferRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ITransferRule); + + /** TransferRule deterministicTransfer. */ + public deterministicTransfer?: (google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer|null); + + /** TransferRule disablePlannerTransfer. */ + public disablePlannerTransfer?: (google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer|null); + + /** TransferRule childAgent. */ + public childAgent: string; + + /** TransferRule direction. */ + public direction: (google.cloud.ces.v1beta.TransferRule.Direction|keyof typeof google.cloud.ces.v1beta.TransferRule.Direction); + + /** TransferRule ruleType. */ + public ruleType?: ("deterministicTransfer"|"disablePlannerTransfer"); + + /** + * Creates a new TransferRule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferRule instance + */ + public static create(properties?: google.cloud.ces.v1beta.ITransferRule): google.cloud.ces.v1beta.TransferRule; + + /** + * Encodes the specified TransferRule message. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.verify|verify} messages. + * @param message TransferRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ITransferRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferRule message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.verify|verify} messages. + * @param message TransferRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ITransferRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TransferRule; + + /** + * Decodes a TransferRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TransferRule; + + /** + * Verifies a TransferRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TransferRule; + + /** + * Creates a plain object from a TransferRule message. Also converts values to other types if specified. + * @param message TransferRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TransferRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransferRule { + + /** Properties of a DeterministicTransfer. */ + interface IDeterministicTransfer { + + /** DeterministicTransfer expressionCondition */ + expressionCondition?: (google.cloud.ces.v1beta.IExpressionCondition|null); + + /** DeterministicTransfer pythonCodeCondition */ + pythonCodeCondition?: (google.cloud.ces.v1beta.IPythonCodeCondition|null); + } + + /** Represents a DeterministicTransfer. */ + class DeterministicTransfer implements IDeterministicTransfer { + + /** + * Constructs a new DeterministicTransfer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer); + + /** DeterministicTransfer expressionCondition. */ + public expressionCondition?: (google.cloud.ces.v1beta.IExpressionCondition|null); + + /** DeterministicTransfer pythonCodeCondition. */ + public pythonCodeCondition?: (google.cloud.ces.v1beta.IPythonCodeCondition|null); + + /** DeterministicTransfer conditionType. */ + public conditionType?: ("expressionCondition"|"pythonCodeCondition"); + + /** + * Creates a new DeterministicTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns DeterministicTransfer instance + */ + public static create(properties?: google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer): google.cloud.ces.v1beta.TransferRule.DeterministicTransfer; + + /** + * Encodes the specified DeterministicTransfer message. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.verify|verify} messages. + * @param message DeterministicTransfer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeterministicTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.verify|verify} messages. + * @param message DeterministicTransfer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeterministicTransfer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeterministicTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TransferRule.DeterministicTransfer; + + /** + * Decodes a DeterministicTransfer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeterministicTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TransferRule.DeterministicTransfer; + + /** + * Verifies a DeterministicTransfer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeterministicTransfer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeterministicTransfer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TransferRule.DeterministicTransfer; + + /** + * Creates a plain object from a DeterministicTransfer message. Also converts values to other types if specified. + * @param message DeterministicTransfer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TransferRule.DeterministicTransfer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeterministicTransfer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeterministicTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisablePlannerTransfer. */ + interface IDisablePlannerTransfer { + + /** DisablePlannerTransfer expressionCondition */ + expressionCondition?: (google.cloud.ces.v1beta.IExpressionCondition|null); + } + + /** Represents a DisablePlannerTransfer. */ + class DisablePlannerTransfer implements IDisablePlannerTransfer { + + /** + * Constructs a new DisablePlannerTransfer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer); + + /** DisablePlannerTransfer expressionCondition. */ + public expressionCondition?: (google.cloud.ces.v1beta.IExpressionCondition|null); + + /** + * Creates a new DisablePlannerTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns DisablePlannerTransfer instance + */ + public static create(properties?: google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer): google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer; + + /** + * Encodes the specified DisablePlannerTransfer message. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.verify|verify} messages. + * @param message DisablePlannerTransfer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisablePlannerTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.verify|verify} messages. + * @param message DisablePlannerTransfer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisablePlannerTransfer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisablePlannerTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer; + + /** + * Decodes a DisablePlannerTransfer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisablePlannerTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer; + + /** + * Verifies a DisablePlannerTransfer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisablePlannerTransfer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisablePlannerTransfer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer; + + /** + * Creates a plain object from a DisablePlannerTransfer message. Also converts values to other types if specified. + * @param message DisablePlannerTransfer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisablePlannerTransfer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisablePlannerTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Direction enum. */ + enum Direction { + DIRECTION_UNSPECIFIED = 0, + PARENT_TO_CHILD = 1, + CHILD_TO_PARENT = 2 + } + } + + /** ExecutionType enum. */ + enum ExecutionType { + EXECUTION_TYPE_UNSPECIFIED = 0, + SYNCHRONOUS = 1, + ASYNCHRONOUS = 2 + } + + /** Properties of a Callback. */ + interface ICallback { + + /** Callback pythonCode */ + pythonCode?: (string|null); + + /** Callback description */ + description?: (string|null); + + /** Callback disabled */ + disabled?: (boolean|null); + + /** Callback proactiveExecutionEnabled */ + proactiveExecutionEnabled?: (boolean|null); + } + + /** Represents a Callback. */ + class Callback implements ICallback { + + /** + * Constructs a new Callback. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICallback); + + /** Callback pythonCode. */ + public pythonCode?: (string|null); + + /** Callback description. */ + public description: string; + + /** Callback disabled. */ + public disabled: boolean; + + /** Callback proactiveExecutionEnabled. */ + public proactiveExecutionEnabled: boolean; + + /** Callback callback. */ + public callback?: "pythonCode"; + + /** + * Creates a new Callback instance using the specified properties. + * @param [properties] Properties to set + * @returns Callback instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICallback): google.cloud.ces.v1beta.Callback; + + /** + * Encodes the specified Callback message. Does not implicitly {@link google.cloud.ces.v1beta.Callback.verify|verify} messages. + * @param message Callback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICallback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Callback message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Callback.verify|verify} messages. + * @param message Callback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICallback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Callback message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Callback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Callback; + + /** + * Decodes a Callback message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Callback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Callback; + + /** + * Verifies a Callback message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Callback message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Callback + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Callback; + + /** + * Creates a plain object from a Callback message. Also converts values to other types if specified. + * @param message Callback + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Callback, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Callback to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Callback + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModelSettings. */ + interface IModelSettings { + + /** ModelSettings model */ + model?: (string|null); + + /** ModelSettings temperature */ + temperature?: (number|null); + } + + /** Represents a ModelSettings. */ + class ModelSettings implements IModelSettings { + + /** + * Constructs a new ModelSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IModelSettings); + + /** ModelSettings model. */ + public model: string; + + /** ModelSettings temperature. */ + public temperature?: (number|null); + + /** + * Creates a new ModelSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.IModelSettings): google.cloud.ces.v1beta.ModelSettings; + + /** + * Encodes the specified ModelSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ModelSettings.verify|verify} messages. + * @param message ModelSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IModelSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ModelSettings.verify|verify} messages. + * @param message ModelSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IModelSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ModelSettings; + + /** + * Decodes a ModelSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ModelSettings; + + /** + * Verifies a ModelSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ModelSettings; + + /** + * Creates a plain object from a ModelSettings message. Also converts values to other types if specified. + * @param message ModelSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ModelSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TriggerAction. */ + interface ITriggerAction { + + /** TriggerAction respondImmediately */ + respondImmediately?: (google.cloud.ces.v1beta.TriggerAction.IRespondImmediately|null); + + /** TriggerAction transferAgent */ + transferAgent?: (google.cloud.ces.v1beta.TriggerAction.ITransferAgent|null); + + /** TriggerAction generativeAnswer */ + generativeAnswer?: (google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer|null); + } + + /** Represents a TriggerAction. */ + class TriggerAction implements ITriggerAction { + + /** + * Constructs a new TriggerAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ITriggerAction); + + /** TriggerAction respondImmediately. */ + public respondImmediately?: (google.cloud.ces.v1beta.TriggerAction.IRespondImmediately|null); + + /** TriggerAction transferAgent. */ + public transferAgent?: (google.cloud.ces.v1beta.TriggerAction.ITransferAgent|null); + + /** TriggerAction generativeAnswer. */ + public generativeAnswer?: (google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer|null); + + /** TriggerAction action. */ + public action?: ("respondImmediately"|"transferAgent"|"generativeAnswer"); + + /** + * Creates a new TriggerAction instance using the specified properties. + * @param [properties] Properties to set + * @returns TriggerAction instance + */ + public static create(properties?: google.cloud.ces.v1beta.ITriggerAction): google.cloud.ces.v1beta.TriggerAction; + + /** + * Encodes the specified TriggerAction message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.verify|verify} messages. + * @param message TriggerAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ITriggerAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TriggerAction message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.verify|verify} messages. + * @param message TriggerAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ITriggerAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TriggerAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TriggerAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TriggerAction; + + /** + * Decodes a TriggerAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TriggerAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TriggerAction; + + /** + * Verifies a TriggerAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TriggerAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TriggerAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TriggerAction; + + /** + * Creates a plain object from a TriggerAction message. Also converts values to other types if specified. + * @param message TriggerAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TriggerAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TriggerAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TriggerAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TriggerAction { + + /** Properties of a Response. */ + interface IResponse { + + /** Response text */ + text?: (string|null); + + /** Response disabled */ + disabled?: (boolean|null); + } + + /** Represents a Response. */ + class Response implements IResponse { + + /** + * Constructs a new Response. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.TriggerAction.IResponse); + + /** Response text. */ + public text: string; + + /** Response disabled. */ + public disabled: boolean; + + /** + * Creates a new Response instance using the specified properties. + * @param [properties] Properties to set + * @returns Response instance + */ + public static create(properties?: google.cloud.ces.v1beta.TriggerAction.IResponse): google.cloud.ces.v1beta.TriggerAction.Response; + + /** + * Encodes the specified Response message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.Response.verify|verify} messages. + * @param message Response message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.TriggerAction.IResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Response message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.Response.verify|verify} messages. + * @param message Response message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.TriggerAction.IResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Response message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Response + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TriggerAction.Response; + + /** + * Decodes a Response message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Response + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TriggerAction.Response; + + /** + * Verifies a Response message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Response message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Response + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TriggerAction.Response; + + /** + * Creates a plain object from a Response message. Also converts values to other types if specified. + * @param message Response + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TriggerAction.Response, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Response to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Response + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RespondImmediately. */ + interface IRespondImmediately { + + /** RespondImmediately responses */ + responses?: (google.cloud.ces.v1beta.TriggerAction.IResponse[]|null); + } + + /** Represents a RespondImmediately. */ + class RespondImmediately implements IRespondImmediately { + + /** + * Constructs a new RespondImmediately. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.TriggerAction.IRespondImmediately); + + /** RespondImmediately responses. */ + public responses: google.cloud.ces.v1beta.TriggerAction.IResponse[]; + + /** + * Creates a new RespondImmediately instance using the specified properties. + * @param [properties] Properties to set + * @returns RespondImmediately instance + */ + public static create(properties?: google.cloud.ces.v1beta.TriggerAction.IRespondImmediately): google.cloud.ces.v1beta.TriggerAction.RespondImmediately; + + /** + * Encodes the specified RespondImmediately message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.RespondImmediately.verify|verify} messages. + * @param message RespondImmediately message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.TriggerAction.IRespondImmediately, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RespondImmediately message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.RespondImmediately.verify|verify} messages. + * @param message RespondImmediately message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.TriggerAction.IRespondImmediately, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RespondImmediately message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RespondImmediately + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TriggerAction.RespondImmediately; + + /** + * Decodes a RespondImmediately message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RespondImmediately + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TriggerAction.RespondImmediately; + + /** + * Verifies a RespondImmediately message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RespondImmediately message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RespondImmediately + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TriggerAction.RespondImmediately; + + /** + * Creates a plain object from a RespondImmediately message. Also converts values to other types if specified. + * @param message RespondImmediately + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TriggerAction.RespondImmediately, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RespondImmediately to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RespondImmediately + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerativeAnswer. */ + interface IGenerativeAnswer { + + /** GenerativeAnswer prompt */ + prompt?: (string|null); + } + + /** Represents a GenerativeAnswer. */ + class GenerativeAnswer implements IGenerativeAnswer { + + /** + * Constructs a new GenerativeAnswer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer); + + /** GenerativeAnswer prompt. */ + public prompt: string; + + /** + * Creates a new GenerativeAnswer instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerativeAnswer instance + */ + public static create(properties?: google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer): google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer; + + /** + * Encodes the specified GenerativeAnswer message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.verify|verify} messages. + * @param message GenerativeAnswer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerativeAnswer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.verify|verify} messages. + * @param message GenerativeAnswer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerativeAnswer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerativeAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer; + + /** + * Decodes a GenerativeAnswer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerativeAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer; + + /** + * Verifies a GenerativeAnswer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerativeAnswer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerativeAnswer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer; + + /** + * Creates a plain object from a GenerativeAnswer message. Also converts values to other types if specified. + * @param message GenerativeAnswer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerativeAnswer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerativeAnswer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferAgent. */ + interface ITransferAgent { + + /** TransferAgent agent */ + agent?: (string|null); + } + + /** Represents a TransferAgent. */ + class TransferAgent implements ITransferAgent { + + /** + * Constructs a new TransferAgent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.TriggerAction.ITransferAgent); + + /** TransferAgent agent. */ + public agent: string; + + /** + * Creates a new TransferAgent instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferAgent instance + */ + public static create(properties?: google.cloud.ces.v1beta.TriggerAction.ITransferAgent): google.cloud.ces.v1beta.TriggerAction.TransferAgent; + + /** + * Encodes the specified TransferAgent message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.TransferAgent.verify|verify} messages. + * @param message TransferAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.TriggerAction.ITransferAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.TransferAgent.verify|verify} messages. + * @param message TransferAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.TriggerAction.ITransferAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferAgent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TriggerAction.TransferAgent; + + /** + * Decodes a TransferAgent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TriggerAction.TransferAgent; + + /** + * Verifies a TransferAgent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferAgent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferAgent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TriggerAction.TransferAgent; + + /** + * Creates a plain object from a TransferAgent message. Also converts values to other types if specified. + * @param message TransferAgent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TriggerAction.TransferAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferAgent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferAgent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TlsConfig. */ + interface ITlsConfig { + + /** TlsConfig caCerts */ + caCerts?: (google.cloud.ces.v1beta.TlsConfig.ICaCert[]|null); + } + + /** Represents a TlsConfig. */ + class TlsConfig implements ITlsConfig { + + /** + * Constructs a new TlsConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ITlsConfig); + + /** TlsConfig caCerts. */ + public caCerts: google.cloud.ces.v1beta.TlsConfig.ICaCert[]; + + /** + * Creates a new TlsConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TlsConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.ITlsConfig): google.cloud.ces.v1beta.TlsConfig; + + /** + * Encodes the specified TlsConfig message. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.verify|verify} messages. + * @param message TlsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ITlsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TlsConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.verify|verify} messages. + * @param message TlsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ITlsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TlsConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TlsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TlsConfig; + + /** + * Decodes a TlsConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TlsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TlsConfig; + + /** + * Verifies a TlsConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TlsConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TlsConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TlsConfig; + + /** + * Creates a plain object from a TlsConfig message. Also converts values to other types if specified. + * @param message TlsConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TlsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TlsConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TlsConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TlsConfig { + + /** Properties of a CaCert. */ + interface ICaCert { + + /** CaCert displayName */ + displayName?: (string|null); + + /** CaCert cert */ + cert?: (Uint8Array|Buffer|string|null); + } + + /** Represents a CaCert. */ + class CaCert implements ICaCert { + + /** + * Constructs a new CaCert. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.TlsConfig.ICaCert); + + /** CaCert displayName. */ + public displayName: string; + + /** CaCert cert. */ + public cert: (Uint8Array|Buffer|string); + + /** + * Creates a new CaCert instance using the specified properties. + * @param [properties] Properties to set + * @returns CaCert instance + */ + public static create(properties?: google.cloud.ces.v1beta.TlsConfig.ICaCert): google.cloud.ces.v1beta.TlsConfig.CaCert; + + /** + * Encodes the specified CaCert message. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.CaCert.verify|verify} messages. + * @param message CaCert message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.TlsConfig.ICaCert, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CaCert message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.CaCert.verify|verify} messages. + * @param message CaCert message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.TlsConfig.ICaCert, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CaCert message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CaCert + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TlsConfig.CaCert; + + /** + * Decodes a CaCert message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CaCert + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TlsConfig.CaCert; + + /** + * Verifies a CaCert message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CaCert message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CaCert + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TlsConfig.CaCert; + + /** + * Creates a plain object from a CaCert message. Also converts values to other types if specified. + * @param message CaCert + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TlsConfig.CaCert, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CaCert to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CaCert + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ServiceDirectoryConfig. */ + interface IServiceDirectoryConfig { + + /** ServiceDirectoryConfig service */ + service?: (string|null); + } + + /** Represents a ServiceDirectoryConfig. */ + class ServiceDirectoryConfig implements IServiceDirectoryConfig { + + /** + * Constructs a new ServiceDirectoryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IServiceDirectoryConfig); + + /** ServiceDirectoryConfig service. */ + public service: string; + + /** + * Creates a new ServiceDirectoryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDirectoryConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IServiceDirectoryConfig): google.cloud.ces.v1beta.ServiceDirectoryConfig; + + /** + * Encodes the specified ServiceDirectoryConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ServiceDirectoryConfig.verify|verify} messages. + * @param message ServiceDirectoryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IServiceDirectoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDirectoryConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ServiceDirectoryConfig.verify|verify} messages. + * @param message ServiceDirectoryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IServiceDirectoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ServiceDirectoryConfig; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ServiceDirectoryConfig; + + /** + * Verifies a ServiceDirectoryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDirectoryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDirectoryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ServiceDirectoryConfig; + + /** + * Creates a plain object from a ServiceDirectoryConfig message. Also converts values to other types if specified. + * @param message ServiceDirectoryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ServiceDirectoryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDirectoryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDirectoryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChannelProfile. */ + interface IChannelProfile { + + /** ChannelProfile profileId */ + profileId?: (string|null); + + /** ChannelProfile channelType */ + channelType?: (google.cloud.ces.v1beta.ChannelProfile.ChannelType|keyof typeof google.cloud.ces.v1beta.ChannelProfile.ChannelType|null); + + /** ChannelProfile personaProperty */ + personaProperty?: (google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty|null); + + /** ChannelProfile disableDtmf */ + disableDtmf?: (boolean|null); + + /** ChannelProfile disableBargeInControl */ + disableBargeInControl?: (boolean|null); + + /** ChannelProfile webWidgetConfig */ + webWidgetConfig?: (google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig|null); + + /** ChannelProfile noiseSuppressionLevel */ + noiseSuppressionLevel?: (string|null); + } + + /** Represents a ChannelProfile. */ + class ChannelProfile implements IChannelProfile { + + /** + * Constructs a new ChannelProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IChannelProfile); + + /** ChannelProfile profileId. */ + public profileId: string; + + /** ChannelProfile channelType. */ + public channelType: (google.cloud.ces.v1beta.ChannelProfile.ChannelType|keyof typeof google.cloud.ces.v1beta.ChannelProfile.ChannelType); + + /** ChannelProfile personaProperty. */ + public personaProperty?: (google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty|null); + + /** ChannelProfile disableDtmf. */ + public disableDtmf: boolean; + + /** ChannelProfile disableBargeInControl. */ + public disableBargeInControl: boolean; + + /** ChannelProfile webWidgetConfig. */ + public webWidgetConfig?: (google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig|null); + + /** ChannelProfile noiseSuppressionLevel. */ + public noiseSuppressionLevel: string; + + /** + * Creates a new ChannelProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns ChannelProfile instance + */ + public static create(properties?: google.cloud.ces.v1beta.IChannelProfile): google.cloud.ces.v1beta.ChannelProfile; + + /** + * Encodes the specified ChannelProfile message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.verify|verify} messages. + * @param message ChannelProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IChannelProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChannelProfile message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.verify|verify} messages. + * @param message ChannelProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IChannelProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChannelProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChannelProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ChannelProfile; + + /** + * Decodes a ChannelProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChannelProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ChannelProfile; + + /** + * Verifies a ChannelProfile message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChannelProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChannelProfile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ChannelProfile; + + /** + * Creates a plain object from a ChannelProfile message. Also converts values to other types if specified. + * @param message ChannelProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ChannelProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChannelProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChannelProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ChannelProfile { + + /** Properties of a PersonaProperty. */ + interface IPersonaProperty { + + /** PersonaProperty persona */ + persona?: (google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona|keyof typeof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona|null); + } + + /** Represents a PersonaProperty. */ + class PersonaProperty implements IPersonaProperty { + + /** + * Constructs a new PersonaProperty. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty); + + /** PersonaProperty persona. */ + public persona: (google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona|keyof typeof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona); + + /** + * Creates a new PersonaProperty instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonaProperty instance + */ + public static create(properties?: google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty): google.cloud.ces.v1beta.ChannelProfile.PersonaProperty; + + /** + * Encodes the specified PersonaProperty message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.verify|verify} messages. + * @param message PersonaProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersonaProperty message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.verify|verify} messages. + * @param message PersonaProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersonaProperty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonaProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ChannelProfile.PersonaProperty; + + /** + * Decodes a PersonaProperty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonaProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ChannelProfile.PersonaProperty; + + /** + * Verifies a PersonaProperty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PersonaProperty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonaProperty + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ChannelProfile.PersonaProperty; + + /** + * Creates a plain object from a PersonaProperty message. Also converts values to other types if specified. + * @param message PersonaProperty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ChannelProfile.PersonaProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersonaProperty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PersonaProperty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PersonaProperty { + + /** Persona enum. */ + enum Persona { + UNKNOWN = 0, + CONCISE = 1, + CHATTY = 2 + } + } + + /** Properties of a WebWidgetConfig. */ + interface IWebWidgetConfig { + + /** WebWidgetConfig modality */ + modality?: (google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality|keyof typeof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality|null); + + /** WebWidgetConfig theme */ + theme?: (google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme|keyof typeof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme|null); + + /** WebWidgetConfig webWidgetTitle */ + webWidgetTitle?: (string|null); + + /** WebWidgetConfig securitySettings */ + securitySettings?: (google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings|null); + } + + /** Represents a WebWidgetConfig. */ + class WebWidgetConfig implements IWebWidgetConfig { + + /** + * Constructs a new WebWidgetConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig); + + /** WebWidgetConfig modality. */ + public modality: (google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality|keyof typeof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality); + + /** WebWidgetConfig theme. */ + public theme: (google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme|keyof typeof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme); + + /** WebWidgetConfig webWidgetTitle. */ + public webWidgetTitle: string; + + /** WebWidgetConfig securitySettings. */ + public securitySettings?: (google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings|null); + + /** + * Creates a new WebWidgetConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns WebWidgetConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig; + + /** + * Encodes the specified WebWidgetConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.verify|verify} messages. + * @param message WebWidgetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebWidgetConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.verify|verify} messages. + * @param message WebWidgetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebWidgetConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebWidgetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig; + + /** + * Decodes a WebWidgetConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebWidgetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig; + + /** + * Verifies a WebWidgetConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebWidgetConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebWidgetConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig; + + /** + * Creates a plain object from a WebWidgetConfig message. Also converts values to other types if specified. + * @param message WebWidgetConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebWidgetConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebWidgetConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WebWidgetConfig { + + /** Properties of a SecuritySettings. */ + interface ISecuritySettings { + + /** SecuritySettings enablePublicAccess */ + enablePublicAccess?: (boolean|null); + + /** SecuritySettings enableOriginCheck */ + enableOriginCheck?: (boolean|null); + + /** SecuritySettings allowedOrigins */ + allowedOrigins?: (string[]|null); + + /** SecuritySettings enableRecaptcha */ + enableRecaptcha?: (boolean|null); + } + + /** Represents a SecuritySettings. */ + class SecuritySettings implements ISecuritySettings { + + /** + * Constructs a new SecuritySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings); + + /** SecuritySettings enablePublicAccess. */ + public enablePublicAccess: boolean; + + /** SecuritySettings enableOriginCheck. */ + public enableOriginCheck: boolean; + + /** SecuritySettings allowedOrigins. */ + public allowedOrigins: string[]; + + /** SecuritySettings enableRecaptcha. */ + public enableRecaptcha: boolean; + + /** + * Creates a new SecuritySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SecuritySettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings; + + /** + * Encodes the specified SecuritySettings message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. + * @param message SecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. + * @param message SecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings; + + /** + * Verifies a SecuritySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecuritySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecuritySettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings; + + /** + * Creates a plain object from a SecuritySettings message. Also converts values to other types if specified. + * @param message SecuritySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecuritySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecuritySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Modality enum. */ + enum Modality { + MODALITY_UNSPECIFIED = 0, + CHAT_AND_VOICE = 1, + VOICE_ONLY = 2, + CHAT_ONLY = 3 + } + + /** Theme enum. */ + enum Theme { + THEME_UNSPECIFIED = 0, + LIGHT = 1, + DARK = 2 + } + } + + /** ChannelType enum. */ + enum ChannelType { + UNKNOWN = 0, + WEB_UI = 2, + API = 3, + TWILIO = 4, + GOOGLE_TELEPHONY_PLATFORM = 5, + CONTACT_CENTER_AS_A_SERVICE = 6, + FIVE9 = 7, + CONTACT_CENTER_INTEGRATION = 8 + } + } + + /** Properties of a Span. */ + interface ISpan { + + /** Span name */ + name?: (string|null); + + /** Span startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Span endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Span duration */ + duration?: (google.protobuf.IDuration|null); + + /** Span attributes */ + attributes?: (google.protobuf.IStruct|null); + + /** Span childSpans */ + childSpans?: (google.cloud.ces.v1beta.ISpan[]|null); + } + + /** Represents a Span. */ + class Span implements ISpan { + + /** + * Constructs a new Span. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ISpan); + + /** Span name. */ + public name: string; + + /** Span startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Span endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Span duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** Span attributes. */ + public attributes?: (google.protobuf.IStruct|null); + + /** Span childSpans. */ + public childSpans: google.cloud.ces.v1beta.ISpan[]; + + /** + * Creates a new Span instance using the specified properties. + * @param [properties] Properties to set + * @returns Span instance + */ + public static create(properties?: google.cloud.ces.v1beta.ISpan): google.cloud.ces.v1beta.Span; + + /** + * Encodes the specified Span message. Does not implicitly {@link google.cloud.ces.v1beta.Span.verify|verify} messages. + * @param message Span message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ISpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Span message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Span.verify|verify} messages. + * @param message Span message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ISpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Span message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Span + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Span; + + /** + * Decodes a Span message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Span + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Span; + + /** + * Verifies a Span message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Span message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Span + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Span; + + /** + * Creates a plain object from a Span message. Also converts values to other types if specified. + * @param message Span + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Span, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Span to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Span + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an AgentService */ + class AgentService extends $protobuf.rpc.Service { + + /** + * Constructs a new AgentService 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 AgentService 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): AgentService; + + /** + * Calls ListApps. + * @param request ListAppsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAppsResponse + */ + public listApps(request: google.cloud.ces.v1beta.IListAppsRequest, callback: google.cloud.ces.v1beta.AgentService.ListAppsCallback): void; + + /** + * Calls ListApps. + * @param request ListAppsRequest message or plain object + * @returns Promise + */ + public listApps(request: google.cloud.ces.v1beta.IListAppsRequest): Promise; + + /** + * Calls GetApp. + * @param request GetAppRequest message or plain object + * @param callback Node-style callback called with the error, if any, and App + */ + public getApp(request: google.cloud.ces.v1beta.IGetAppRequest, callback: google.cloud.ces.v1beta.AgentService.GetAppCallback): void; + + /** + * Calls GetApp. + * @param request GetAppRequest message or plain object + * @returns Promise + */ + public getApp(request: google.cloud.ces.v1beta.IGetAppRequest): Promise; + + /** + * Calls CreateApp. + * @param request CreateAppRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createApp(request: google.cloud.ces.v1beta.ICreateAppRequest, callback: google.cloud.ces.v1beta.AgentService.CreateAppCallback): void; + + /** + * Calls CreateApp. + * @param request CreateAppRequest message or plain object + * @returns Promise + */ + public createApp(request: google.cloud.ces.v1beta.ICreateAppRequest): Promise; + + /** + * Calls UpdateApp. + * @param request UpdateAppRequest message or plain object + * @param callback Node-style callback called with the error, if any, and App + */ + public updateApp(request: google.cloud.ces.v1beta.IUpdateAppRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateAppCallback): void; + + /** + * Calls UpdateApp. + * @param request UpdateAppRequest message or plain object + * @returns Promise + */ + public updateApp(request: google.cloud.ces.v1beta.IUpdateAppRequest): Promise; + + /** + * Calls DeleteApp. + * @param request DeleteAppRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteApp(request: google.cloud.ces.v1beta.IDeleteAppRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteAppCallback): void; + + /** + * Calls DeleteApp. + * @param request DeleteAppRequest message or plain object + * @returns Promise + */ + public deleteApp(request: google.cloud.ces.v1beta.IDeleteAppRequest): Promise; + + /** + * Calls ExportApp. + * @param request ExportAppRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportApp(request: google.cloud.ces.v1beta.IExportAppRequest, callback: google.cloud.ces.v1beta.AgentService.ExportAppCallback): void; + + /** + * Calls ExportApp. + * @param request ExportAppRequest message or plain object + * @returns Promise + */ + public exportApp(request: google.cloud.ces.v1beta.IExportAppRequest): Promise; + + /** + * Calls ImportApp. + * @param request ImportAppRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importApp(request: google.cloud.ces.v1beta.IImportAppRequest, callback: google.cloud.ces.v1beta.AgentService.ImportAppCallback): void; + + /** + * Calls ImportApp. + * @param request ImportAppRequest message or plain object + * @returns Promise + */ + public importApp(request: google.cloud.ces.v1beta.IImportAppRequest): Promise; + + /** + * Calls ListAgents. + * @param request ListAgentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAgentsResponse + */ + public listAgents(request: google.cloud.ces.v1beta.IListAgentsRequest, callback: google.cloud.ces.v1beta.AgentService.ListAgentsCallback): void; + + /** + * Calls ListAgents. + * @param request ListAgentsRequest message or plain object + * @returns Promise + */ + public listAgents(request: google.cloud.ces.v1beta.IListAgentsRequest): Promise; + + /** + * Calls GetAgent. + * @param request GetAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Agent + */ + public getAgent(request: google.cloud.ces.v1beta.IGetAgentRequest, callback: google.cloud.ces.v1beta.AgentService.GetAgentCallback): void; + + /** + * Calls GetAgent. + * @param request GetAgentRequest message or plain object + * @returns Promise + */ + public getAgent(request: google.cloud.ces.v1beta.IGetAgentRequest): Promise; + + /** + * Calls CreateAgent. + * @param request CreateAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Agent + */ + public createAgent(request: google.cloud.ces.v1beta.ICreateAgentRequest, callback: google.cloud.ces.v1beta.AgentService.CreateAgentCallback): void; + + /** + * Calls CreateAgent. + * @param request CreateAgentRequest message or plain object + * @returns Promise + */ + public createAgent(request: google.cloud.ces.v1beta.ICreateAgentRequest): Promise; + + /** + * Calls UpdateAgent. + * @param request UpdateAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Agent + */ + public updateAgent(request: google.cloud.ces.v1beta.IUpdateAgentRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateAgentCallback): void; + + /** + * Calls UpdateAgent. + * @param request UpdateAgentRequest message or plain object + * @returns Promise + */ + public updateAgent(request: google.cloud.ces.v1beta.IUpdateAgentRequest): Promise; + + /** + * Calls DeleteAgent. + * @param request DeleteAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAgent(request: google.cloud.ces.v1beta.IDeleteAgentRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteAgentCallback): void; + + /** + * Calls DeleteAgent. + * @param request DeleteAgentRequest message or plain object + * @returns Promise + */ + public deleteAgent(request: google.cloud.ces.v1beta.IDeleteAgentRequest): Promise; + + /** + * Calls ListExamples. + * @param request ListExamplesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListExamplesResponse + */ + public listExamples(request: google.cloud.ces.v1beta.IListExamplesRequest, callback: google.cloud.ces.v1beta.AgentService.ListExamplesCallback): void; + + /** + * Calls ListExamples. + * @param request ListExamplesRequest message or plain object + * @returns Promise + */ + public listExamples(request: google.cloud.ces.v1beta.IListExamplesRequest): Promise; + + /** + * Calls GetExample. + * @param request GetExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Example + */ + public getExample(request: google.cloud.ces.v1beta.IGetExampleRequest, callback: google.cloud.ces.v1beta.AgentService.GetExampleCallback): void; + + /** + * Calls GetExample. + * @param request GetExampleRequest message or plain object + * @returns Promise + */ + public getExample(request: google.cloud.ces.v1beta.IGetExampleRequest): Promise; + + /** + * Calls CreateExample. + * @param request CreateExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Example + */ + public createExample(request: google.cloud.ces.v1beta.ICreateExampleRequest, callback: google.cloud.ces.v1beta.AgentService.CreateExampleCallback): void; + + /** + * Calls CreateExample. + * @param request CreateExampleRequest message or plain object + * @returns Promise + */ + public createExample(request: google.cloud.ces.v1beta.ICreateExampleRequest): Promise; + + /** + * Calls UpdateExample. + * @param request UpdateExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Example + */ + public updateExample(request: google.cloud.ces.v1beta.IUpdateExampleRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateExampleCallback): void; + + /** + * Calls UpdateExample. + * @param request UpdateExampleRequest message or plain object + * @returns Promise + */ + public updateExample(request: google.cloud.ces.v1beta.IUpdateExampleRequest): Promise; + + /** + * Calls DeleteExample. + * @param request DeleteExampleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteExample(request: google.cloud.ces.v1beta.IDeleteExampleRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteExampleCallback): void; + + /** + * Calls DeleteExample. + * @param request DeleteExampleRequest message or plain object + * @returns Promise + */ + public deleteExample(request: google.cloud.ces.v1beta.IDeleteExampleRequest): Promise; + + /** + * Calls ListTools. + * @param request ListToolsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListToolsResponse + */ + public listTools(request: google.cloud.ces.v1beta.IListToolsRequest, callback: google.cloud.ces.v1beta.AgentService.ListToolsCallback): void; + + /** + * Calls ListTools. + * @param request ListToolsRequest message or plain object + * @returns Promise + */ + public listTools(request: google.cloud.ces.v1beta.IListToolsRequest): Promise; + + /** + * Calls GetTool. + * @param request GetToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tool + */ + public getTool(request: google.cloud.ces.v1beta.IGetToolRequest, callback: google.cloud.ces.v1beta.AgentService.GetToolCallback): void; + + /** + * Calls GetTool. + * @param request GetToolRequest message or plain object + * @returns Promise + */ + public getTool(request: google.cloud.ces.v1beta.IGetToolRequest): Promise; + + /** + * Calls ListConversations. + * @param request ListConversationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListConversationsResponse + */ + public listConversations(request: google.cloud.ces.v1beta.IListConversationsRequest, callback: google.cloud.ces.v1beta.AgentService.ListConversationsCallback): void; + + /** + * Calls ListConversations. + * @param request ListConversationsRequest message or plain object + * @returns Promise + */ + public listConversations(request: google.cloud.ces.v1beta.IListConversationsRequest): Promise; + + /** + * Calls GetConversation. + * @param request GetConversationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Conversation + */ + public getConversation(request: google.cloud.ces.v1beta.IGetConversationRequest, callback: google.cloud.ces.v1beta.AgentService.GetConversationCallback): void; + + /** + * Calls GetConversation. + * @param request GetConversationRequest message or plain object + * @returns Promise + */ + public getConversation(request: google.cloud.ces.v1beta.IGetConversationRequest): Promise; + + /** + * Calls DeleteConversation. + * @param request DeleteConversationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteConversation(request: google.cloud.ces.v1beta.IDeleteConversationRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteConversationCallback): void; + + /** + * Calls DeleteConversation. + * @param request DeleteConversationRequest message or plain object + * @returns Promise + */ + public deleteConversation(request: google.cloud.ces.v1beta.IDeleteConversationRequest): Promise; + + /** + * Calls BatchDeleteConversations. + * @param request BatchDeleteConversationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchDeleteConversations(request: google.cloud.ces.v1beta.IBatchDeleteConversationsRequest, callback: google.cloud.ces.v1beta.AgentService.BatchDeleteConversationsCallback): void; + + /** + * Calls BatchDeleteConversations. + * @param request BatchDeleteConversationsRequest message or plain object + * @returns Promise + */ + public batchDeleteConversations(request: google.cloud.ces.v1beta.IBatchDeleteConversationsRequest): Promise; + + /** + * Calls CreateTool. + * @param request CreateToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tool + */ + public createTool(request: google.cloud.ces.v1beta.ICreateToolRequest, callback: google.cloud.ces.v1beta.AgentService.CreateToolCallback): void; + + /** + * Calls CreateTool. + * @param request CreateToolRequest message or plain object + * @returns Promise + */ + public createTool(request: google.cloud.ces.v1beta.ICreateToolRequest): Promise; + + /** + * Calls UpdateTool. + * @param request UpdateToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tool + */ + public updateTool(request: google.cloud.ces.v1beta.IUpdateToolRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateToolCallback): void; + + /** + * Calls UpdateTool. + * @param request UpdateToolRequest message or plain object + * @returns Promise + */ + public updateTool(request: google.cloud.ces.v1beta.IUpdateToolRequest): Promise; + + /** + * Calls DeleteTool. + * @param request DeleteToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTool(request: google.cloud.ces.v1beta.IDeleteToolRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteToolCallback): void; + + /** + * Calls DeleteTool. + * @param request DeleteToolRequest message or plain object + * @returns Promise + */ + public deleteTool(request: google.cloud.ces.v1beta.IDeleteToolRequest): Promise; + + /** + * Calls ListGuardrails. + * @param request ListGuardrailsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGuardrailsResponse + */ + public listGuardrails(request: google.cloud.ces.v1beta.IListGuardrailsRequest, callback: google.cloud.ces.v1beta.AgentService.ListGuardrailsCallback): void; + + /** + * Calls ListGuardrails. + * @param request ListGuardrailsRequest message or plain object + * @returns Promise + */ + public listGuardrails(request: google.cloud.ces.v1beta.IListGuardrailsRequest): Promise; + + /** + * Calls GetGuardrail. + * @param request GetGuardrailRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Guardrail + */ + public getGuardrail(request: google.cloud.ces.v1beta.IGetGuardrailRequest, callback: google.cloud.ces.v1beta.AgentService.GetGuardrailCallback): void; + + /** + * Calls GetGuardrail. + * @param request GetGuardrailRequest message or plain object + * @returns Promise + */ + public getGuardrail(request: google.cloud.ces.v1beta.IGetGuardrailRequest): Promise; + + /** + * Calls CreateGuardrail. + * @param request CreateGuardrailRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Guardrail + */ + public createGuardrail(request: google.cloud.ces.v1beta.ICreateGuardrailRequest, callback: google.cloud.ces.v1beta.AgentService.CreateGuardrailCallback): void; + + /** + * Calls CreateGuardrail. + * @param request CreateGuardrailRequest message or plain object + * @returns Promise + */ + public createGuardrail(request: google.cloud.ces.v1beta.ICreateGuardrailRequest): Promise; + + /** + * Calls UpdateGuardrail. + * @param request UpdateGuardrailRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Guardrail + */ + public updateGuardrail(request: google.cloud.ces.v1beta.IUpdateGuardrailRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateGuardrailCallback): void; + + /** + * Calls UpdateGuardrail. + * @param request UpdateGuardrailRequest message or plain object + * @returns Promise + */ + public updateGuardrail(request: google.cloud.ces.v1beta.IUpdateGuardrailRequest): Promise; + + /** + * Calls DeleteGuardrail. + * @param request DeleteGuardrailRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteGuardrail(request: google.cloud.ces.v1beta.IDeleteGuardrailRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteGuardrailCallback): void; + + /** + * Calls DeleteGuardrail. + * @param request DeleteGuardrailRequest message or plain object + * @returns Promise + */ + public deleteGuardrail(request: google.cloud.ces.v1beta.IDeleteGuardrailRequest): Promise; + + /** + * Calls ListDeployments. + * @param request ListDeploymentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDeploymentsResponse + */ + public listDeployments(request: google.cloud.ces.v1beta.IListDeploymentsRequest, callback: google.cloud.ces.v1beta.AgentService.ListDeploymentsCallback): void; + + /** + * Calls ListDeployments. + * @param request ListDeploymentsRequest message or plain object + * @returns Promise + */ + public listDeployments(request: google.cloud.ces.v1beta.IListDeploymentsRequest): Promise; + + /** + * Calls GetDeployment. + * @param request GetDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Deployment + */ + public getDeployment(request: google.cloud.ces.v1beta.IGetDeploymentRequest, callback: google.cloud.ces.v1beta.AgentService.GetDeploymentCallback): void; + + /** + * Calls GetDeployment. + * @param request GetDeploymentRequest message or plain object + * @returns Promise + */ + public getDeployment(request: google.cloud.ces.v1beta.IGetDeploymentRequest): Promise; + + /** + * Calls CreateDeployment. + * @param request CreateDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Deployment + */ + public createDeployment(request: google.cloud.ces.v1beta.ICreateDeploymentRequest, callback: google.cloud.ces.v1beta.AgentService.CreateDeploymentCallback): void; + + /** + * Calls CreateDeployment. + * @param request CreateDeploymentRequest message or plain object + * @returns Promise + */ + public createDeployment(request: google.cloud.ces.v1beta.ICreateDeploymentRequest): Promise; + + /** + * Calls UpdateDeployment. + * @param request UpdateDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Deployment + */ + public updateDeployment(request: google.cloud.ces.v1beta.IUpdateDeploymentRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateDeploymentCallback): void; + + /** + * Calls UpdateDeployment. + * @param request UpdateDeploymentRequest message or plain object + * @returns Promise + */ + public updateDeployment(request: google.cloud.ces.v1beta.IUpdateDeploymentRequest): Promise; + + /** + * Calls DeleteDeployment. + * @param request DeleteDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDeployment(request: google.cloud.ces.v1beta.IDeleteDeploymentRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteDeploymentCallback): void; + + /** + * Calls DeleteDeployment. + * @param request DeleteDeploymentRequest message or plain object + * @returns Promise + */ + public deleteDeployment(request: google.cloud.ces.v1beta.IDeleteDeploymentRequest): Promise; + + /** + * Calls ListToolsets. + * @param request ListToolsetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListToolsetsResponse + */ + public listToolsets(request: google.cloud.ces.v1beta.IListToolsetsRequest, callback: google.cloud.ces.v1beta.AgentService.ListToolsetsCallback): void; + + /** + * Calls ListToolsets. + * @param request ListToolsetsRequest message or plain object + * @returns Promise + */ + public listToolsets(request: google.cloud.ces.v1beta.IListToolsetsRequest): Promise; + + /** + * Calls GetToolset. + * @param request GetToolsetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Toolset + */ + public getToolset(request: google.cloud.ces.v1beta.IGetToolsetRequest, callback: google.cloud.ces.v1beta.AgentService.GetToolsetCallback): void; + + /** + * Calls GetToolset. + * @param request GetToolsetRequest message or plain object + * @returns Promise + */ + public getToolset(request: google.cloud.ces.v1beta.IGetToolsetRequest): Promise; + + /** + * Calls CreateToolset. + * @param request CreateToolsetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Toolset + */ + public createToolset(request: google.cloud.ces.v1beta.ICreateToolsetRequest, callback: google.cloud.ces.v1beta.AgentService.CreateToolsetCallback): void; + + /** + * Calls CreateToolset. + * @param request CreateToolsetRequest message or plain object + * @returns Promise + */ + public createToolset(request: google.cloud.ces.v1beta.ICreateToolsetRequest): Promise; + + /** + * Calls UpdateToolset. + * @param request UpdateToolsetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Toolset + */ + public updateToolset(request: google.cloud.ces.v1beta.IUpdateToolsetRequest, callback: google.cloud.ces.v1beta.AgentService.UpdateToolsetCallback): void; + + /** + * Calls UpdateToolset. + * @param request UpdateToolsetRequest message or plain object + * @returns Promise + */ + public updateToolset(request: google.cloud.ces.v1beta.IUpdateToolsetRequest): Promise; + + /** + * Calls DeleteToolset. + * @param request DeleteToolsetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteToolset(request: google.cloud.ces.v1beta.IDeleteToolsetRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteToolsetCallback): void; + + /** + * Calls DeleteToolset. + * @param request DeleteToolsetRequest message or plain object + * @returns Promise + */ + public deleteToolset(request: google.cloud.ces.v1beta.IDeleteToolsetRequest): Promise; + + /** + * Calls ListAppVersions. + * @param request ListAppVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAppVersionsResponse + */ + public listAppVersions(request: google.cloud.ces.v1beta.IListAppVersionsRequest, callback: google.cloud.ces.v1beta.AgentService.ListAppVersionsCallback): void; + + /** + * Calls ListAppVersions. + * @param request ListAppVersionsRequest message or plain object + * @returns Promise + */ + public listAppVersions(request: google.cloud.ces.v1beta.IListAppVersionsRequest): Promise; + + /** + * Calls GetAppVersion. + * @param request GetAppVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AppVersion + */ + public getAppVersion(request: google.cloud.ces.v1beta.IGetAppVersionRequest, callback: google.cloud.ces.v1beta.AgentService.GetAppVersionCallback): void; + + /** + * Calls GetAppVersion. + * @param request GetAppVersionRequest message or plain object + * @returns Promise + */ + public getAppVersion(request: google.cloud.ces.v1beta.IGetAppVersionRequest): Promise; + + /** + * Calls CreateAppVersion. + * @param request CreateAppVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AppVersion + */ + public createAppVersion(request: google.cloud.ces.v1beta.ICreateAppVersionRequest, callback: google.cloud.ces.v1beta.AgentService.CreateAppVersionCallback): void; + + /** + * Calls CreateAppVersion. + * @param request CreateAppVersionRequest message or plain object + * @returns Promise + */ + public createAppVersion(request: google.cloud.ces.v1beta.ICreateAppVersionRequest): Promise; + + /** + * Calls DeleteAppVersion. + * @param request DeleteAppVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAppVersion(request: google.cloud.ces.v1beta.IDeleteAppVersionRequest, callback: google.cloud.ces.v1beta.AgentService.DeleteAppVersionCallback): void; + + /** + * Calls DeleteAppVersion. + * @param request DeleteAppVersionRequest message or plain object + * @returns Promise + */ + public deleteAppVersion(request: google.cloud.ces.v1beta.IDeleteAppVersionRequest): Promise; + + /** + * Calls RestoreAppVersion. + * @param request RestoreAppVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreAppVersion(request: google.cloud.ces.v1beta.IRestoreAppVersionRequest, callback: google.cloud.ces.v1beta.AgentService.RestoreAppVersionCallback): void; + + /** + * Calls RestoreAppVersion. + * @param request RestoreAppVersionRequest message or plain object + * @returns Promise + */ + public restoreAppVersion(request: google.cloud.ces.v1beta.IRestoreAppVersionRequest): Promise; + + /** + * Calls ListChangelogs. + * @param request ListChangelogsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListChangelogsResponse + */ + public listChangelogs(request: google.cloud.ces.v1beta.IListChangelogsRequest, callback: google.cloud.ces.v1beta.AgentService.ListChangelogsCallback): void; + + /** + * Calls ListChangelogs. + * @param request ListChangelogsRequest message or plain object + * @returns Promise + */ + public listChangelogs(request: google.cloud.ces.v1beta.IListChangelogsRequest): Promise; + + /** + * Calls GetChangelog. + * @param request GetChangelogRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Changelog + */ + public getChangelog(request: google.cloud.ces.v1beta.IGetChangelogRequest, callback: google.cloud.ces.v1beta.AgentService.GetChangelogCallback): void; + + /** + * Calls GetChangelog. + * @param request GetChangelogRequest message or plain object + * @returns Promise + */ + public getChangelog(request: google.cloud.ces.v1beta.IGetChangelogRequest): Promise; + } + + namespace AgentService { + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listApps}. + * @param error Error, if any + * @param [response] ListAppsResponse + */ + type ListAppsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListAppsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getApp}. + * @param error Error, if any + * @param [response] App + */ + type GetAppCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.App) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createApp}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateApp}. + * @param error Error, if any + * @param [response] App + */ + type UpdateAppCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.App) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteApp}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|exportApp}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|importApp}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportAppCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listAgents}. + * @param error Error, if any + * @param [response] ListAgentsResponse + */ + type ListAgentsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListAgentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getAgent}. + * @param error Error, if any + * @param [response] Agent + */ + type GetAgentCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Agent) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createAgent}. + * @param error Error, if any + * @param [response] Agent + */ + type CreateAgentCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Agent) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateAgent}. + * @param error Error, if any + * @param [response] Agent + */ + type UpdateAgentCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Agent) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteAgent}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAgentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listExamples}. + * @param error Error, if any + * @param [response] ListExamplesResponse + */ + type ListExamplesCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListExamplesResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getExample}. + * @param error Error, if any + * @param [response] Example + */ + type GetExampleCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Example) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createExample}. + * @param error Error, if any + * @param [response] Example + */ + type CreateExampleCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Example) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateExample}. + * @param error Error, if any + * @param [response] Example + */ + type UpdateExampleCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Example) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteExample}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteExampleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listTools}. + * @param error Error, if any + * @param [response] ListToolsResponse + */ + type ListToolsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListToolsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getTool}. + * @param error Error, if any + * @param [response] Tool + */ + type GetToolCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Tool) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listConversations}. + * @param error Error, if any + * @param [response] ListConversationsResponse + */ + type ListConversationsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListConversationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getConversation}. + * @param error Error, if any + * @param [response] Conversation + */ + type GetConversationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Conversation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteConversation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteConversationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|batchDeleteConversations}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchDeleteConversationsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createTool}. + * @param error Error, if any + * @param [response] Tool + */ + type CreateToolCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Tool) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateTool}. + * @param error Error, if any + * @param [response] Tool + */ + type UpdateToolCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Tool) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteTool}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteToolCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listGuardrails}. + * @param error Error, if any + * @param [response] ListGuardrailsResponse + */ + type ListGuardrailsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListGuardrailsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getGuardrail}. + * @param error Error, if any + * @param [response] Guardrail + */ + type GetGuardrailCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Guardrail) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createGuardrail}. + * @param error Error, if any + * @param [response] Guardrail + */ + type CreateGuardrailCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Guardrail) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateGuardrail}. + * @param error Error, if any + * @param [response] Guardrail + */ + type UpdateGuardrailCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Guardrail) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteGuardrail}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteGuardrailCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listDeployments}. + * @param error Error, if any + * @param [response] ListDeploymentsResponse + */ + type ListDeploymentsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListDeploymentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getDeployment}. + * @param error Error, if any + * @param [response] Deployment + */ + type GetDeploymentCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Deployment) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createDeployment}. + * @param error Error, if any + * @param [response] Deployment + */ + type CreateDeploymentCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Deployment) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateDeployment}. + * @param error Error, if any + * @param [response] Deployment + */ + type UpdateDeploymentCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Deployment) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteDeployment}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDeploymentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listToolsets}. + * @param error Error, if any + * @param [response] ListToolsetsResponse + */ + type ListToolsetsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListToolsetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getToolset}. + * @param error Error, if any + * @param [response] Toolset + */ + type GetToolsetCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Toolset) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createToolset}. + * @param error Error, if any + * @param [response] Toolset + */ + type CreateToolsetCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Toolset) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateToolset}. + * @param error Error, if any + * @param [response] Toolset + */ + type UpdateToolsetCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Toolset) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteToolset}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteToolsetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listAppVersions}. + * @param error Error, if any + * @param [response] ListAppVersionsResponse + */ + type ListAppVersionsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListAppVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getAppVersion}. + * @param error Error, if any + * @param [response] AppVersion + */ + type GetAppVersionCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.AppVersion) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createAppVersion}. + * @param error Error, if any + * @param [response] AppVersion + */ + type CreateAppVersionCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.AppVersion) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteAppVersion}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAppVersionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|restoreAppVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreAppVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listChangelogs}. + * @param error Error, if any + * @param [response] ListChangelogsResponse + */ + type ListChangelogsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListChangelogsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getChangelog}. + * @param error Error, if any + * @param [response] Changelog + */ + type GetChangelogCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Changelog) => void; + } + + /** Properties of a ListAppsRequest. */ + interface IListAppsRequest { + + /** ListAppsRequest parent */ + parent?: (string|null); + + /** ListAppsRequest pageSize */ + pageSize?: (number|null); + + /** ListAppsRequest pageToken */ + pageToken?: (string|null); + + /** ListAppsRequest filter */ + filter?: (string|null); + + /** ListAppsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListAppsRequest. */ + class ListAppsRequest implements IListAppsRequest { + + /** + * Constructs a new ListAppsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListAppsRequest); + + /** ListAppsRequest parent. */ + public parent: string; + + /** ListAppsRequest pageSize. */ + public pageSize: number; + + /** ListAppsRequest pageToken. */ + public pageToken: string; + + /** ListAppsRequest filter. */ + public filter: string; + + /** ListAppsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListAppsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAppsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListAppsRequest): google.cloud.ces.v1beta.ListAppsRequest; + + /** + * Encodes the specified ListAppsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsRequest.verify|verify} messages. + * @param message ListAppsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListAppsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAppsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsRequest.verify|verify} messages. + * @param message ListAppsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListAppsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAppsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAppsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListAppsRequest; + + /** + * Decodes a ListAppsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAppsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListAppsRequest; + + /** + * Verifies a ListAppsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAppsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAppsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListAppsRequest; + + /** + * Creates a plain object from a ListAppsRequest message. Also converts values to other types if specified. + * @param message ListAppsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListAppsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAppsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAppsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAppsResponse. */ + interface IListAppsResponse { + + /** ListAppsResponse apps */ + apps?: (google.cloud.ces.v1beta.IApp[]|null); + + /** ListAppsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListAppsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListAppsResponse. */ + class ListAppsResponse implements IListAppsResponse { + + /** + * Constructs a new ListAppsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListAppsResponse); + + /** ListAppsResponse apps. */ + public apps: google.cloud.ces.v1beta.IApp[]; + + /** ListAppsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListAppsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListAppsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAppsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListAppsResponse): google.cloud.ces.v1beta.ListAppsResponse; + + /** + * Encodes the specified ListAppsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsResponse.verify|verify} messages. + * @param message ListAppsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListAppsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAppsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsResponse.verify|verify} messages. + * @param message ListAppsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListAppsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAppsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAppsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListAppsResponse; + + /** + * Decodes a ListAppsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAppsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListAppsResponse; + + /** + * Verifies a ListAppsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAppsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAppsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListAppsResponse; + + /** + * Creates a plain object from a ListAppsResponse message. Also converts values to other types if specified. + * @param message ListAppsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListAppsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAppsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAppsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAppRequest. */ + interface IGetAppRequest { + + /** GetAppRequest name */ + name?: (string|null); + } + + /** Represents a GetAppRequest. */ + class GetAppRequest implements IGetAppRequest { + + /** + * Constructs a new GetAppRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetAppRequest); + + /** GetAppRequest name. */ + public name: string; + + /** + * Creates a new GetAppRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAppRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetAppRequest): google.cloud.ces.v1beta.GetAppRequest; + + /** + * Encodes the specified GetAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetAppRequest.verify|verify} messages. + * @param message GetAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetAppRequest.verify|verify} messages. + * @param message GetAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAppRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetAppRequest; + + /** + * Decodes a GetAppRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetAppRequest; + + /** + * Verifies a GetAppRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAppRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAppRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetAppRequest; + + /** + * Creates a plain object from a GetAppRequest message. Also converts values to other types if specified. + * @param message GetAppRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAppRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAppRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAppRequest. */ + interface ICreateAppRequest { + + /** CreateAppRequest parent */ + parent?: (string|null); + + /** CreateAppRequest appId */ + appId?: (string|null); + + /** CreateAppRequest app */ + app?: (google.cloud.ces.v1beta.IApp|null); + } + + /** Represents a CreateAppRequest. */ + class CreateAppRequest implements ICreateAppRequest { + + /** + * Constructs a new CreateAppRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateAppRequest); + + /** CreateAppRequest parent. */ + public parent: string; + + /** CreateAppRequest appId. */ + public appId: string; + + /** CreateAppRequest app. */ + public app?: (google.cloud.ces.v1beta.IApp|null); + + /** + * Creates a new CreateAppRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAppRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateAppRequest): google.cloud.ces.v1beta.CreateAppRequest; + + /** + * Encodes the specified CreateAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppRequest.verify|verify} messages. + * @param message CreateAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppRequest.verify|verify} messages. + * @param message CreateAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAppRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateAppRequest; + + /** + * Decodes a CreateAppRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateAppRequest; + + /** + * Verifies a CreateAppRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAppRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAppRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateAppRequest; + + /** + * Creates a plain object from a CreateAppRequest message. Also converts values to other types if specified. + * @param message CreateAppRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAppRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAppRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAppRequest. */ + interface IUpdateAppRequest { + + /** UpdateAppRequest app */ + app?: (google.cloud.ces.v1beta.IApp|null); + + /** UpdateAppRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAppRequest. */ + class UpdateAppRequest implements IUpdateAppRequest { + + /** + * Constructs a new UpdateAppRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateAppRequest); + + /** UpdateAppRequest app. */ + public app?: (google.cloud.ces.v1beta.IApp|null); + + /** UpdateAppRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAppRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAppRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateAppRequest): google.cloud.ces.v1beta.UpdateAppRequest; + + /** + * Encodes the specified UpdateAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAppRequest.verify|verify} messages. + * @param message UpdateAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAppRequest.verify|verify} messages. + * @param message UpdateAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAppRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateAppRequest; + + /** + * Decodes an UpdateAppRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateAppRequest; + + /** + * Verifies an UpdateAppRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAppRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAppRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateAppRequest; + + /** + * Creates a plain object from an UpdateAppRequest message. Also converts values to other types if specified. + * @param message UpdateAppRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAppRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAppRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAppRequest. */ + interface IDeleteAppRequest { + + /** DeleteAppRequest name */ + name?: (string|null); + + /** DeleteAppRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteAppRequest. */ + class DeleteAppRequest implements IDeleteAppRequest { + + /** + * Constructs a new DeleteAppRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteAppRequest); + + /** DeleteAppRequest name. */ + public name: string; + + /** DeleteAppRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteAppRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAppRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteAppRequest): google.cloud.ces.v1beta.DeleteAppRequest; + + /** + * Encodes the specified DeleteAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppRequest.verify|verify} messages. + * @param message DeleteAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppRequest.verify|verify} messages. + * @param message DeleteAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAppRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteAppRequest; + + /** + * Decodes a DeleteAppRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteAppRequest; + + /** + * Verifies a DeleteAppRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAppRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAppRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteAppRequest; + + /** + * Creates a plain object from a DeleteAppRequest message. Also converts values to other types if specified. + * @param message DeleteAppRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAppRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAppRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportAppRequest. */ + interface IExportAppRequest { + + /** ExportAppRequest name */ + name?: (string|null); + + /** ExportAppRequest exportFormat */ + exportFormat?: (google.cloud.ces.v1beta.ExportAppRequest.ExportFormat|keyof typeof google.cloud.ces.v1beta.ExportAppRequest.ExportFormat|null); + + /** ExportAppRequest gcsUri */ + gcsUri?: (string|null); + } + + /** Represents an ExportAppRequest. */ + class ExportAppRequest implements IExportAppRequest { + + /** + * Constructs a new ExportAppRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IExportAppRequest); + + /** ExportAppRequest name. */ + public name: string; + + /** ExportAppRequest exportFormat. */ + public exportFormat: (google.cloud.ces.v1beta.ExportAppRequest.ExportFormat|keyof typeof google.cloud.ces.v1beta.ExportAppRequest.ExportFormat); + + /** ExportAppRequest gcsUri. */ + public gcsUri: string; + + /** + * Creates a new ExportAppRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAppRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IExportAppRequest): google.cloud.ces.v1beta.ExportAppRequest; + + /** + * Encodes the specified ExportAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppRequest.verify|verify} messages. + * @param message ExportAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IExportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppRequest.verify|verify} messages. + * @param message ExportAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IExportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAppRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ExportAppRequest; + + /** + * Decodes an ExportAppRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ExportAppRequest; + + /** + * Verifies an ExportAppRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportAppRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAppRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ExportAppRequest; + + /** + * Creates a plain object from an ExportAppRequest message. Also converts values to other types if specified. + * @param message ExportAppRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ExportAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAppRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportAppRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportAppRequest { + + /** ExportFormat enum. */ + enum ExportFormat { + EXPORT_FORMAT_UNSPECIFIED = 0, + JSON = 1, + YAML = 2 + } + } + + /** Properties of an ExportAppResponse. */ + interface IExportAppResponse { + + /** ExportAppResponse appContent */ + appContent?: (Uint8Array|Buffer|string|null); + + /** ExportAppResponse appUri */ + appUri?: (string|null); + } + + /** Represents an ExportAppResponse. */ + class ExportAppResponse implements IExportAppResponse { + + /** + * Constructs a new ExportAppResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IExportAppResponse); + + /** ExportAppResponse appContent. */ + public appContent?: (Uint8Array|Buffer|string|null); + + /** ExportAppResponse appUri. */ + public appUri?: (string|null); + + /** ExportAppResponse app. */ + public app?: ("appContent"|"appUri"); + + /** + * Creates a new ExportAppResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAppResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IExportAppResponse): google.cloud.ces.v1beta.ExportAppResponse; + + /** + * Encodes the specified ExportAppResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppResponse.verify|verify} messages. + * @param message ExportAppResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IExportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppResponse.verify|verify} messages. + * @param message ExportAppResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IExportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAppResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ExportAppResponse; + + /** + * Decodes an ExportAppResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ExportAppResponse; + + /** + * Verifies an ExportAppResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportAppResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAppResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ExportAppResponse; + + /** + * Creates a plain object from an ExportAppResponse message. Also converts values to other types if specified. + * @param message ExportAppResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ExportAppResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAppResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportAppResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportAppRequest. */ + interface IImportAppRequest { + + /** ImportAppRequest gcsUri */ + gcsUri?: (string|null); + + /** ImportAppRequest appContent */ + appContent?: (Uint8Array|Buffer|string|null); + + /** ImportAppRequest parent */ + parent?: (string|null); + + /** ImportAppRequest displayName */ + displayName?: (string|null); + + /** ImportAppRequest appId */ + appId?: (string|null); + + /** ImportAppRequest importOptions */ + importOptions?: (google.cloud.ces.v1beta.ImportAppRequest.IImportOptions|null); + + /** ImportAppRequest ignoreAppLock */ + ignoreAppLock?: (boolean|null); + } + + /** Represents an ImportAppRequest. */ + class ImportAppRequest implements IImportAppRequest { + + /** + * Constructs a new ImportAppRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IImportAppRequest); + + /** ImportAppRequest gcsUri. */ + public gcsUri?: (string|null); + + /** ImportAppRequest appContent. */ + public appContent?: (Uint8Array|Buffer|string|null); + + /** ImportAppRequest parent. */ + public parent: string; + + /** ImportAppRequest displayName. */ + public displayName: string; + + /** ImportAppRequest appId. */ + public appId: string; + + /** ImportAppRequest importOptions. */ + public importOptions?: (google.cloud.ces.v1beta.ImportAppRequest.IImportOptions|null); + + /** ImportAppRequest ignoreAppLock. */ + public ignoreAppLock: boolean; + + /** ImportAppRequest app. */ + public app?: ("gcsUri"|"appContent"); + + /** + * Creates a new ImportAppRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportAppRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IImportAppRequest): google.cloud.ces.v1beta.ImportAppRequest; + + /** + * Encodes the specified ImportAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.verify|verify} messages. + * @param message ImportAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IImportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.verify|verify} messages. + * @param message ImportAppRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IImportAppRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportAppRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportAppRequest; + + /** + * Decodes an ImportAppRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportAppRequest; + + /** + * Verifies an ImportAppRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportAppRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportAppRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportAppRequest; + + /** + * Creates a plain object from an ImportAppRequest message. Also converts values to other types if specified. + * @param message ImportAppRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ImportAppRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportAppRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportAppRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportAppRequest { + + /** Properties of an ImportOptions. */ + interface IImportOptions { + + /** ImportOptions conflictResolutionStrategy */ + conflictResolutionStrategy?: (google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|keyof typeof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|null); + } + + /** Represents an ImportOptions. */ + class ImportOptions implements IImportOptions { + + /** + * Constructs a new ImportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ImportAppRequest.IImportOptions); + + /** ImportOptions conflictResolutionStrategy. */ + public conflictResolutionStrategy: (google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|keyof typeof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy); + + /** + * Creates a new ImportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportOptions instance + */ + public static create(properties?: google.cloud.ces.v1beta.ImportAppRequest.IImportOptions): google.cloud.ces.v1beta.ImportAppRequest.ImportOptions; + + /** + * Encodes the specified ImportOptions message. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.verify|verify} messages. + * @param message ImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ImportAppRequest.IImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportOptions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.verify|verify} messages. + * @param message ImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ImportAppRequest.IImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportAppRequest.ImportOptions; + + /** + * Decodes an ImportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportAppRequest.ImportOptions; + + /** + * Verifies an ImportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportAppRequest.ImportOptions; + + /** + * Creates a plain object from an ImportOptions message. Also converts values to other types if specified. + * @param message ImportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ImportAppRequest.ImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportOptions { + + /** ConflictResolutionStrategy enum. */ + enum ConflictResolutionStrategy { + CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED = 0, + REPLACE = 1, + OVERWRITE = 2 + } + } + } + + /** Properties of an ImportAppResponse. */ + interface IImportAppResponse { + + /** ImportAppResponse name */ + name?: (string|null); + + /** ImportAppResponse warnings */ + warnings?: (string[]|null); + } + + /** Represents an ImportAppResponse. */ + class ImportAppResponse implements IImportAppResponse { + + /** + * Constructs a new ImportAppResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IImportAppResponse); + + /** ImportAppResponse name. */ + public name: string; + + /** ImportAppResponse warnings. */ + public warnings: string[]; + + /** + * Creates a new ImportAppResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportAppResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IImportAppResponse): google.cloud.ces.v1beta.ImportAppResponse; + + /** + * Encodes the specified ImportAppResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppResponse.verify|verify} messages. + * @param message ImportAppResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IImportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppResponse.verify|verify} messages. + * @param message ImportAppResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IImportAppResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportAppResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportAppResponse; + + /** + * Decodes an ImportAppResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportAppResponse; + + /** + * Verifies an ImportAppResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportAppResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportAppResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportAppResponse; + + /** + * Creates a plain object from an ImportAppResponse message. Also converts values to other types if specified. + * @param message ImportAppResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ImportAppResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportAppResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportAppResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAgentsRequest. */ + interface IListAgentsRequest { + + /** ListAgentsRequest parent */ + parent?: (string|null); + + /** ListAgentsRequest pageSize */ + pageSize?: (number|null); + + /** ListAgentsRequest pageToken */ + pageToken?: (string|null); + + /** ListAgentsRequest filter */ + filter?: (string|null); + + /** ListAgentsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListAgentsRequest. */ + class ListAgentsRequest implements IListAgentsRequest { + + /** + * Constructs a new ListAgentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListAgentsRequest); + + /** ListAgentsRequest parent. */ + public parent: string; + + /** ListAgentsRequest pageSize. */ + public pageSize: number; + + /** ListAgentsRequest pageToken. */ + public pageToken: string; + + /** ListAgentsRequest filter. */ + public filter: string; + + /** ListAgentsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListAgentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAgentsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListAgentsRequest): google.cloud.ces.v1beta.ListAgentsRequest; + + /** + * Encodes the specified ListAgentsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsRequest.verify|verify} messages. + * @param message ListAgentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListAgentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAgentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsRequest.verify|verify} messages. + * @param message ListAgentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListAgentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListAgentsRequest; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListAgentsRequest; + + /** + * Verifies a ListAgentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAgentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAgentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListAgentsRequest; + + /** + * Creates a plain object from a ListAgentsRequest message. Also converts values to other types if specified. + * @param message ListAgentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListAgentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAgentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAgentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAgentsResponse. */ + interface IListAgentsResponse { + + /** ListAgentsResponse agents */ + agents?: (google.cloud.ces.v1beta.IAgent[]|null); + + /** ListAgentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAgentsResponse. */ + class ListAgentsResponse implements IListAgentsResponse { + + /** + * Constructs a new ListAgentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListAgentsResponse); + + /** ListAgentsResponse agents. */ + public agents: google.cloud.ces.v1beta.IAgent[]; + + /** ListAgentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAgentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAgentsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListAgentsResponse): google.cloud.ces.v1beta.ListAgentsResponse; + + /** + * Encodes the specified ListAgentsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsResponse.verify|verify} messages. + * @param message ListAgentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListAgentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAgentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsResponse.verify|verify} messages. + * @param message ListAgentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListAgentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListAgentsResponse; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListAgentsResponse; + + /** + * Verifies a ListAgentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAgentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAgentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListAgentsResponse; + + /** + * Creates a plain object from a ListAgentsResponse message. Also converts values to other types if specified. + * @param message ListAgentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListAgentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAgentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAgentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAgentRequest. */ + interface IGetAgentRequest { + + /** GetAgentRequest name */ + name?: (string|null); + } + + /** Represents a GetAgentRequest. */ + class GetAgentRequest implements IGetAgentRequest { + + /** + * Constructs a new GetAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetAgentRequest); + + /** GetAgentRequest name. */ + public name: string; + + /** + * Creates a new GetAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAgentRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetAgentRequest): google.cloud.ces.v1beta.GetAgentRequest; + + /** + * Encodes the specified GetAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetAgentRequest.verify|verify} messages. + * @param message GetAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetAgentRequest.verify|verify} messages. + * @param message GetAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetAgentRequest; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetAgentRequest; + + /** + * Verifies a GetAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetAgentRequest; + + /** + * Creates a plain object from a GetAgentRequest message. Also converts values to other types if specified. + * @param message GetAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAgentRequest. */ + interface ICreateAgentRequest { + + /** CreateAgentRequest parent */ + parent?: (string|null); + + /** CreateAgentRequest agentId */ + agentId?: (string|null); + + /** CreateAgentRequest agent */ + agent?: (google.cloud.ces.v1beta.IAgent|null); + } + + /** Represents a CreateAgentRequest. */ + class CreateAgentRequest implements ICreateAgentRequest { + + /** + * Constructs a new CreateAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateAgentRequest); + + /** CreateAgentRequest parent. */ + public parent: string; + + /** CreateAgentRequest agentId. */ + public agentId: string; + + /** CreateAgentRequest agent. */ + public agent?: (google.cloud.ces.v1beta.IAgent|null); + + /** + * Creates a new CreateAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAgentRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateAgentRequest): google.cloud.ces.v1beta.CreateAgentRequest; + + /** + * Encodes the specified CreateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateAgentRequest.verify|verify} messages. + * @param message CreateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateAgentRequest.verify|verify} messages. + * @param message CreateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateAgentRequest; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateAgentRequest; + + /** + * Verifies a CreateAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateAgentRequest; + + /** + * Creates a plain object from a CreateAgentRequest message. Also converts values to other types if specified. + * @param message CreateAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAgentRequest. */ + interface IUpdateAgentRequest { + + /** UpdateAgentRequest agent */ + agent?: (google.cloud.ces.v1beta.IAgent|null); + + /** UpdateAgentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAgentRequest. */ + class UpdateAgentRequest implements IUpdateAgentRequest { + + /** + * Constructs a new UpdateAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateAgentRequest); + + /** UpdateAgentRequest agent. */ + public agent?: (google.cloud.ces.v1beta.IAgent|null); + + /** UpdateAgentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAgentRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateAgentRequest): google.cloud.ces.v1beta.UpdateAgentRequest; + + /** + * Encodes the specified UpdateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAgentRequest.verify|verify} messages. + * @param message UpdateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAgentRequest.verify|verify} messages. + * @param message UpdateAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateAgentRequest; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateAgentRequest; + + /** + * Verifies an UpdateAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateAgentRequest; + + /** + * Creates a plain object from an UpdateAgentRequest message. Also converts values to other types if specified. + * @param message UpdateAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAgentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAgentRequest. */ + interface IDeleteAgentRequest { + + /** DeleteAgentRequest name */ + name?: (string|null); + + /** DeleteAgentRequest force */ + force?: (boolean|null); + + /** DeleteAgentRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteAgentRequest. */ + class DeleteAgentRequest implements IDeleteAgentRequest { + + /** + * Constructs a new DeleteAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteAgentRequest); + + /** DeleteAgentRequest name. */ + public name: string; + + /** DeleteAgentRequest force. */ + public force: boolean; + + /** DeleteAgentRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAgentRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteAgentRequest): google.cloud.ces.v1beta.DeleteAgentRequest; + + /** + * Encodes the specified DeleteAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAgentRequest.verify|verify} messages. + * @param message DeleteAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAgentRequest.verify|verify} messages. + * @param message DeleteAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteAgentRequest; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteAgentRequest; + + /** + * Verifies a DeleteAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteAgentRequest; + + /** + * Creates a plain object from a DeleteAgentRequest message. Also converts values to other types if specified. + * @param message DeleteAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAgentRequest + * @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 createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.ces.v1beta.IOperationMetadata): google.cloud.ces.v1beta.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.ces.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.ces.v1beta.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.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.ces.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.ces.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.ces.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.ces.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.ces.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 ListExamplesRequest. */ + interface IListExamplesRequest { + + /** ListExamplesRequest parent */ + parent?: (string|null); + + /** ListExamplesRequest pageSize */ + pageSize?: (number|null); + + /** ListExamplesRequest pageToken */ + pageToken?: (string|null); + + /** ListExamplesRequest filter */ + filter?: (string|null); + + /** ListExamplesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListExamplesRequest. */ + class ListExamplesRequest implements IListExamplesRequest { + + /** + * Constructs a new ListExamplesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListExamplesRequest); + + /** ListExamplesRequest parent. */ + public parent: string; + + /** ListExamplesRequest pageSize. */ + public pageSize: number; + + /** ListExamplesRequest pageToken. */ + public pageToken: string; + + /** ListExamplesRequest filter. */ + public filter: string; + + /** ListExamplesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListExamplesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExamplesRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListExamplesRequest): google.cloud.ces.v1beta.ListExamplesRequest; + + /** + * Encodes the specified ListExamplesRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesRequest.verify|verify} messages. + * @param message ListExamplesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesRequest.verify|verify} messages. + * @param message ListExamplesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListExamplesRequest; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListExamplesRequest; + + /** + * Verifies a ListExamplesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListExamplesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExamplesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListExamplesRequest; + + /** + * Creates a plain object from a ListExamplesRequest message. Also converts values to other types if specified. + * @param message ListExamplesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListExamplesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExamplesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExamplesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExamplesResponse. */ + interface IListExamplesResponse { + + /** ListExamplesResponse examples */ + examples?: (google.cloud.ces.v1beta.IExample[]|null); + + /** ListExamplesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListExamplesResponse. */ + class ListExamplesResponse implements IListExamplesResponse { + + /** + * Constructs a new ListExamplesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListExamplesResponse); + + /** ListExamplesResponse examples. */ + public examples: google.cloud.ces.v1beta.IExample[]; + + /** ListExamplesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListExamplesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExamplesResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListExamplesResponse): google.cloud.ces.v1beta.ListExamplesResponse; + + /** + * Encodes the specified ListExamplesResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesResponse.verify|verify} messages. + * @param message ListExamplesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListExamplesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExamplesResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesResponse.verify|verify} messages. + * @param message ListExamplesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListExamplesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListExamplesResponse; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListExamplesResponse; + + /** + * Verifies a ListExamplesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListExamplesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExamplesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListExamplesResponse; + + /** + * Creates a plain object from a ListExamplesResponse message. Also converts values to other types if specified. + * @param message ListExamplesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListExamplesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExamplesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExamplesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetExampleRequest. */ + interface IGetExampleRequest { + + /** GetExampleRequest name */ + name?: (string|null); + } + + /** Represents a GetExampleRequest. */ + class GetExampleRequest implements IGetExampleRequest { + + /** + * Constructs a new GetExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetExampleRequest); + + /** GetExampleRequest name. */ + public name: string; + + /** + * Creates a new GetExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetExampleRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetExampleRequest): google.cloud.ces.v1beta.GetExampleRequest; + + /** + * Encodes the specified GetExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetExampleRequest.verify|verify} messages. + * @param message GetExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetExampleRequest.verify|verify} messages. + * @param message GetExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetExampleRequest; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetExampleRequest; + + /** + * Verifies a GetExampleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetExampleRequest; + + /** + * Creates a plain object from a GetExampleRequest message. Also converts values to other types if specified. + * @param message GetExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateExampleRequest. */ + interface ICreateExampleRequest { + + /** CreateExampleRequest parent */ + parent?: (string|null); + + /** CreateExampleRequest exampleId */ + exampleId?: (string|null); + + /** CreateExampleRequest example */ + example?: (google.cloud.ces.v1beta.IExample|null); + } + + /** Represents a CreateExampleRequest. */ + class CreateExampleRequest implements ICreateExampleRequest { + + /** + * Constructs a new CreateExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateExampleRequest); + + /** CreateExampleRequest parent. */ + public parent: string; + + /** CreateExampleRequest exampleId. */ + public exampleId: string; + + /** CreateExampleRequest example. */ + public example?: (google.cloud.ces.v1beta.IExample|null); + + /** + * Creates a new CreateExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateExampleRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateExampleRequest): google.cloud.ces.v1beta.CreateExampleRequest; + + /** + * Encodes the specified CreateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateExampleRequest.verify|verify} messages. + * @param message CreateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateExampleRequest.verify|verify} messages. + * @param message CreateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateExampleRequest; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateExampleRequest; + + /** + * Verifies a CreateExampleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateExampleRequest; + + /** + * Creates a plain object from a CreateExampleRequest message. Also converts values to other types if specified. + * @param message CreateExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateExampleRequest. */ + interface IUpdateExampleRequest { + + /** UpdateExampleRequest example */ + example?: (google.cloud.ces.v1beta.IExample|null); + + /** UpdateExampleRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateExampleRequest. */ + class UpdateExampleRequest implements IUpdateExampleRequest { + + /** + * Constructs a new UpdateExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateExampleRequest); + + /** UpdateExampleRequest example. */ + public example?: (google.cloud.ces.v1beta.IExample|null); + + /** UpdateExampleRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateExampleRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateExampleRequest): google.cloud.ces.v1beta.UpdateExampleRequest; + + /** + * Encodes the specified UpdateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateExampleRequest.verify|verify} messages. + * @param message UpdateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateExampleRequest.verify|verify} messages. + * @param message UpdateExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateExampleRequest; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateExampleRequest; + + /** + * Verifies an UpdateExampleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateExampleRequest; + + /** + * Creates a plain object from an UpdateExampleRequest message. Also converts values to other types if specified. + * @param message UpdateExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteExampleRequest. */ + interface IDeleteExampleRequest { + + /** DeleteExampleRequest name */ + name?: (string|null); + + /** DeleteExampleRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteExampleRequest. */ + class DeleteExampleRequest implements IDeleteExampleRequest { + + /** + * Constructs a new DeleteExampleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteExampleRequest); + + /** DeleteExampleRequest name. */ + public name: string; + + /** DeleteExampleRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteExampleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteExampleRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteExampleRequest): google.cloud.ces.v1beta.DeleteExampleRequest; + + /** + * Encodes the specified DeleteExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteExampleRequest.verify|verify} messages. + * @param message DeleteExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteExampleRequest.verify|verify} messages. + * @param message DeleteExampleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteExampleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteExampleRequest; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteExampleRequest; + + /** + * Verifies a DeleteExampleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteExampleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteExampleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteExampleRequest; + + /** + * Creates a plain object from a DeleteExampleRequest message. Also converts values to other types if specified. + * @param message DeleteExampleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteExampleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteExampleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteExampleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListToolsRequest. */ + interface IListToolsRequest { + + /** ListToolsRequest parent */ + parent?: (string|null); + + /** ListToolsRequest pageSize */ + pageSize?: (number|null); + + /** ListToolsRequest pageToken */ + pageToken?: (string|null); + + /** ListToolsRequest filter */ + filter?: (string|null); + + /** ListToolsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListToolsRequest. */ + class ListToolsRequest implements IListToolsRequest { + + /** + * Constructs a new ListToolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListToolsRequest); + + /** ListToolsRequest parent. */ + public parent: string; + + /** ListToolsRequest pageSize. */ + public pageSize: number; + + /** ListToolsRequest pageToken. */ + public pageToken: string; + + /** ListToolsRequest filter. */ + public filter: string; + + /** ListToolsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListToolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListToolsRequest): google.cloud.ces.v1beta.ListToolsRequest; + + /** + * Encodes the specified ListToolsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsRequest.verify|verify} messages. + * @param message ListToolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsRequest.verify|verify} messages. + * @param message ListToolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListToolsRequest; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListToolsRequest; + + /** + * Verifies a ListToolsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListToolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListToolsRequest; + + /** + * Creates a plain object from a ListToolsRequest message. Also converts values to other types if specified. + * @param message ListToolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListToolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListToolsResponse. */ + interface IListToolsResponse { + + /** ListToolsResponse tools */ + tools?: (google.cloud.ces.v1beta.ITool[]|null); + + /** ListToolsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListToolsResponse. */ + class ListToolsResponse implements IListToolsResponse { + + /** + * Constructs a new ListToolsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListToolsResponse); + + /** ListToolsResponse tools. */ + public tools: google.cloud.ces.v1beta.ITool[]; + + /** ListToolsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListToolsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListToolsResponse): google.cloud.ces.v1beta.ListToolsResponse; + + /** + * Encodes the specified ListToolsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsResponse.verify|verify} messages. + * @param message ListToolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsResponse.verify|verify} messages. + * @param message ListToolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListToolsResponse; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListToolsResponse; + + /** + * Verifies a ListToolsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListToolsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListToolsResponse; + + /** + * Creates a plain object from a ListToolsResponse message. Also converts values to other types if specified. + * @param message ListToolsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListToolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetToolRequest. */ + interface IGetToolRequest { + + /** GetToolRequest name */ + name?: (string|null); + } + + /** Represents a GetToolRequest. */ + class GetToolRequest implements IGetToolRequest { + + /** + * Constructs a new GetToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetToolRequest); + + /** GetToolRequest name. */ + public name: string; + + /** + * Creates a new GetToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetToolRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetToolRequest): google.cloud.ces.v1beta.GetToolRequest; + + /** + * Encodes the specified GetToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetToolRequest.verify|verify} messages. + * @param message GetToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetToolRequest.verify|verify} messages. + * @param message GetToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetToolRequest; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetToolRequest; + + /** + * Verifies a GetToolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetToolRequest; + + /** + * Creates a plain object from a GetToolRequest message. Also converts values to other types if specified. + * @param message GetToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateToolRequest. */ + interface ICreateToolRequest { + + /** CreateToolRequest parent */ + parent?: (string|null); + + /** CreateToolRequest toolId */ + toolId?: (string|null); + + /** CreateToolRequest tool */ + tool?: (google.cloud.ces.v1beta.ITool|null); + } + + /** Represents a CreateToolRequest. */ + class CreateToolRequest implements ICreateToolRequest { + + /** + * Constructs a new CreateToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateToolRequest); + + /** CreateToolRequest parent. */ + public parent: string; + + /** CreateToolRequest toolId. */ + public toolId: string; + + /** CreateToolRequest tool. */ + public tool?: (google.cloud.ces.v1beta.ITool|null); + + /** + * Creates a new CreateToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateToolRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateToolRequest): google.cloud.ces.v1beta.CreateToolRequest; + + /** + * Encodes the specified CreateToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolRequest.verify|verify} messages. + * @param message CreateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolRequest.verify|verify} messages. + * @param message CreateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateToolRequest; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateToolRequest; + + /** + * Verifies a CreateToolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateToolRequest; + + /** + * Creates a plain object from a CreateToolRequest message. Also converts values to other types if specified. + * @param message CreateToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateToolRequest. */ + interface IUpdateToolRequest { + + /** UpdateToolRequest tool */ + tool?: (google.cloud.ces.v1beta.ITool|null); + + /** UpdateToolRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateToolRequest. */ + class UpdateToolRequest implements IUpdateToolRequest { + + /** + * Constructs a new UpdateToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateToolRequest); + + /** UpdateToolRequest tool. */ + public tool?: (google.cloud.ces.v1beta.ITool|null); + + /** UpdateToolRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateToolRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateToolRequest): google.cloud.ces.v1beta.UpdateToolRequest; + + /** + * Encodes the specified UpdateToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolRequest.verify|verify} messages. + * @param message UpdateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolRequest.verify|verify} messages. + * @param message UpdateToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateToolRequest; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateToolRequest; + + /** + * Verifies an UpdateToolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateToolRequest; + + /** + * Creates a plain object from an UpdateToolRequest message. Also converts values to other types if specified. + * @param message UpdateToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteToolRequest. */ + interface IDeleteToolRequest { + + /** DeleteToolRequest name */ + name?: (string|null); + + /** DeleteToolRequest force */ + force?: (boolean|null); + + /** DeleteToolRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteToolRequest. */ + class DeleteToolRequest implements IDeleteToolRequest { + + /** + * Constructs a new DeleteToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteToolRequest); + + /** DeleteToolRequest name. */ + public name: string; + + /** DeleteToolRequest force. */ + public force: boolean; + + /** DeleteToolRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteToolRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteToolRequest): google.cloud.ces.v1beta.DeleteToolRequest; + + /** + * Encodes the specified DeleteToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolRequest.verify|verify} messages. + * @param message DeleteToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolRequest.verify|verify} messages. + * @param message DeleteToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteToolRequest; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteToolRequest; + + /** + * Verifies a DeleteToolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteToolRequest; + + /** + * Creates a plain object from a DeleteToolRequest message. Also converts values to other types if specified. + * @param message DeleteToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConversationsRequest. */ + interface IListConversationsRequest { + + /** ListConversationsRequest parent */ + parent?: (string|null); + + /** ListConversationsRequest pageSize */ + pageSize?: (number|null); + + /** ListConversationsRequest pageToken */ + pageToken?: (string|null); + + /** ListConversationsRequest filter */ + filter?: (string|null); + + /** ListConversationsRequest source */ + source?: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source|null); + + /** ListConversationsRequest sources */ + sources?: (google.cloud.ces.v1beta.Conversation.Source[]|null); + } + + /** Represents a ListConversationsRequest. */ + class ListConversationsRequest implements IListConversationsRequest { + + /** + * Constructs a new ListConversationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListConversationsRequest); + + /** ListConversationsRequest parent. */ + public parent: string; + + /** ListConversationsRequest pageSize. */ + public pageSize: number; + + /** ListConversationsRequest pageToken. */ + public pageToken: string; + + /** ListConversationsRequest filter. */ + public filter: string; + + /** ListConversationsRequest source. */ + public source: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source); + + /** ListConversationsRequest sources. */ + public sources: google.cloud.ces.v1beta.Conversation.Source[]; + + /** + * Creates a new ListConversationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConversationsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListConversationsRequest): google.cloud.ces.v1beta.ListConversationsRequest; + + /** + * Encodes the specified ListConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsRequest.verify|verify} messages. + * @param message ListConversationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsRequest.verify|verify} messages. + * @param message ListConversationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListConversationsRequest; + + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListConversationsRequest; + + /** + * Verifies a ListConversationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListConversationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConversationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListConversationsRequest; + + /** + * Creates a plain object from a ListConversationsRequest message. Also converts values to other types if specified. + * @param message ListConversationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListConversationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConversationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConversationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConversationsResponse. */ + interface IListConversationsResponse { + + /** ListConversationsResponse conversations */ + conversations?: (google.cloud.ces.v1beta.IConversation[]|null); + + /** ListConversationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListConversationsResponse. */ + class ListConversationsResponse implements IListConversationsResponse { + + /** + * Constructs a new ListConversationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListConversationsResponse); + + /** ListConversationsResponse conversations. */ + public conversations: google.cloud.ces.v1beta.IConversation[]; + + /** ListConversationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListConversationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConversationsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListConversationsResponse): google.cloud.ces.v1beta.ListConversationsResponse; + + /** + * Encodes the specified ListConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsResponse.verify|verify} messages. + * @param message ListConversationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsResponse.verify|verify} messages. + * @param message ListConversationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListConversationsResponse; + + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListConversationsResponse; + + /** + * Verifies a ListConversationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConversationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListConversationsResponse; + + /** + * Creates a plain object from a ListConversationsResponse message. Also converts values to other types if specified. + * @param message ListConversationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListConversationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConversationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConversationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetConversationRequest. */ + interface IGetConversationRequest { + + /** GetConversationRequest name */ + name?: (string|null); + + /** GetConversationRequest source */ + source?: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source|null); + } + + /** Represents a GetConversationRequest. */ + class GetConversationRequest implements IGetConversationRequest { + + /** + * Constructs a new GetConversationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetConversationRequest); + + /** GetConversationRequest name. */ + public name: string; + + /** GetConversationRequest source. */ + public source: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source); + + /** + * Creates a new GetConversationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConversationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetConversationRequest): google.cloud.ces.v1beta.GetConversationRequest; + + /** + * Encodes the specified GetConversationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetConversationRequest.verify|verify} messages. + * @param message GetConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetConversationRequest.verify|verify} messages. + * @param message GetConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConversationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetConversationRequest; + + /** + * Decodes a GetConversationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetConversationRequest; + + /** + * Verifies a GetConversationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetConversationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConversationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetConversationRequest; + + /** + * Creates a plain object from a GetConversationRequest message. Also converts values to other types if specified. + * @param message GetConversationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetConversationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConversationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConversationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteConversationRequest. */ + interface IDeleteConversationRequest { + + /** DeleteConversationRequest name */ + name?: (string|null); + + /** DeleteConversationRequest source */ + source?: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source|null); + } + + /** Represents a DeleteConversationRequest. */ + class DeleteConversationRequest implements IDeleteConversationRequest { + + /** + * Constructs a new DeleteConversationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteConversationRequest); + + /** DeleteConversationRequest name. */ + public name: string; + + /** DeleteConversationRequest source. */ + public source: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source); + + /** + * Creates a new DeleteConversationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteConversationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteConversationRequest): google.cloud.ces.v1beta.DeleteConversationRequest; + + /** + * Encodes the specified DeleteConversationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteConversationRequest.verify|verify} messages. + * @param message DeleteConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteConversationRequest.verify|verify} messages. + * @param message DeleteConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteConversationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteConversationRequest; + + /** + * Decodes a DeleteConversationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteConversationRequest; + + /** + * Verifies a DeleteConversationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteConversationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteConversationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteConversationRequest; + + /** + * Creates a plain object from a DeleteConversationRequest message. Also converts values to other types if specified. + * @param message DeleteConversationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteConversationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteConversationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteConversationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteConversationsRequest. */ + interface IBatchDeleteConversationsRequest { + + /** BatchDeleteConversationsRequest parent */ + parent?: (string|null); + + /** BatchDeleteConversationsRequest conversations */ + conversations?: (string[]|null); + } + + /** Represents a BatchDeleteConversationsRequest. */ + class BatchDeleteConversationsRequest implements IBatchDeleteConversationsRequest { + + /** + * Constructs a new BatchDeleteConversationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IBatchDeleteConversationsRequest); + + /** BatchDeleteConversationsRequest parent. */ + public parent: string; + + /** BatchDeleteConversationsRequest conversations. */ + public conversations: string[]; + + /** + * Creates a new BatchDeleteConversationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteConversationsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IBatchDeleteConversationsRequest): google.cloud.ces.v1beta.BatchDeleteConversationsRequest; + + /** + * Encodes the specified BatchDeleteConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsRequest.verify|verify} messages. + * @param message BatchDeleteConversationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IBatchDeleteConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsRequest.verify|verify} messages. + * @param message BatchDeleteConversationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IBatchDeleteConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BatchDeleteConversationsRequest; + + /** + * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BatchDeleteConversationsRequest; + + /** + * Verifies a BatchDeleteConversationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDeleteConversationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteConversationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BatchDeleteConversationsRequest; + + /** + * Creates a plain object from a BatchDeleteConversationsRequest message. Also converts values to other types if specified. + * @param message BatchDeleteConversationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.BatchDeleteConversationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteConversationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteConversationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteConversationsResponse. */ + interface IBatchDeleteConversationsResponse { + + /** BatchDeleteConversationsResponse deletedConversations */ + deletedConversations?: (string[]|null); + + /** BatchDeleteConversationsResponse failedConversations */ + failedConversations?: (string[]|null); + + /** BatchDeleteConversationsResponse errorMessages */ + errorMessages?: (string[]|null); + } + + /** Represents a BatchDeleteConversationsResponse. */ + class BatchDeleteConversationsResponse implements IBatchDeleteConversationsResponse { + + /** + * Constructs a new BatchDeleteConversationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IBatchDeleteConversationsResponse); + + /** BatchDeleteConversationsResponse deletedConversations. */ + public deletedConversations: string[]; + + /** BatchDeleteConversationsResponse failedConversations. */ + public failedConversations: string[]; + + /** BatchDeleteConversationsResponse errorMessages. */ + public errorMessages: string[]; + + /** + * Creates a new BatchDeleteConversationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteConversationsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IBatchDeleteConversationsResponse): google.cloud.ces.v1beta.BatchDeleteConversationsResponse; + + /** + * Encodes the specified BatchDeleteConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsResponse.verify|verify} messages. + * @param message BatchDeleteConversationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IBatchDeleteConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsResponse.verify|verify} messages. + * @param message BatchDeleteConversationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IBatchDeleteConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BatchDeleteConversationsResponse; + + /** + * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BatchDeleteConversationsResponse; + + /** + * Verifies a BatchDeleteConversationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDeleteConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteConversationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BatchDeleteConversationsResponse; + + /** + * Creates a plain object from a BatchDeleteConversationsResponse message. Also converts values to other types if specified. + * @param message BatchDeleteConversationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.BatchDeleteConversationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteConversationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteConversationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGuardrailsRequest. */ + interface IListGuardrailsRequest { + + /** ListGuardrailsRequest parent */ + parent?: (string|null); + + /** ListGuardrailsRequest pageSize */ + pageSize?: (number|null); + + /** ListGuardrailsRequest pageToken */ + pageToken?: (string|null); + + /** ListGuardrailsRequest filter */ + filter?: (string|null); + + /** ListGuardrailsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListGuardrailsRequest. */ + class ListGuardrailsRequest implements IListGuardrailsRequest { + + /** + * Constructs a new ListGuardrailsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListGuardrailsRequest); + + /** ListGuardrailsRequest parent. */ + public parent: string; + + /** ListGuardrailsRequest pageSize. */ + public pageSize: number; + + /** ListGuardrailsRequest pageToken. */ + public pageToken: string; + + /** ListGuardrailsRequest filter. */ + public filter: string; + + /** ListGuardrailsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListGuardrailsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGuardrailsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListGuardrailsRequest): google.cloud.ces.v1beta.ListGuardrailsRequest; + + /** + * Encodes the specified ListGuardrailsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsRequest.verify|verify} messages. + * @param message ListGuardrailsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListGuardrailsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGuardrailsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsRequest.verify|verify} messages. + * @param message ListGuardrailsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListGuardrailsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGuardrailsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGuardrailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListGuardrailsRequest; + + /** + * Decodes a ListGuardrailsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGuardrailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListGuardrailsRequest; + + /** + * Verifies a ListGuardrailsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGuardrailsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGuardrailsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListGuardrailsRequest; + + /** + * Creates a plain object from a ListGuardrailsRequest message. Also converts values to other types if specified. + * @param message ListGuardrailsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListGuardrailsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGuardrailsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGuardrailsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGuardrailsResponse. */ + interface IListGuardrailsResponse { + + /** ListGuardrailsResponse guardrails */ + guardrails?: (google.cloud.ces.v1beta.IGuardrail[]|null); + + /** ListGuardrailsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListGuardrailsResponse. */ + class ListGuardrailsResponse implements IListGuardrailsResponse { + + /** + * Constructs a new ListGuardrailsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListGuardrailsResponse); + + /** ListGuardrailsResponse guardrails. */ + public guardrails: google.cloud.ces.v1beta.IGuardrail[]; + + /** ListGuardrailsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListGuardrailsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGuardrailsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListGuardrailsResponse): google.cloud.ces.v1beta.ListGuardrailsResponse; + + /** + * Encodes the specified ListGuardrailsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsResponse.verify|verify} messages. + * @param message ListGuardrailsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListGuardrailsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGuardrailsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsResponse.verify|verify} messages. + * @param message ListGuardrailsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListGuardrailsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGuardrailsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGuardrailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListGuardrailsResponse; + + /** + * Decodes a ListGuardrailsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGuardrailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListGuardrailsResponse; + + /** + * Verifies a ListGuardrailsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGuardrailsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGuardrailsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListGuardrailsResponse; + + /** + * Creates a plain object from a ListGuardrailsResponse message. Also converts values to other types if specified. + * @param message ListGuardrailsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListGuardrailsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGuardrailsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGuardrailsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGuardrailRequest. */ + interface IGetGuardrailRequest { + + /** GetGuardrailRequest name */ + name?: (string|null); + } + + /** Represents a GetGuardrailRequest. */ + class GetGuardrailRequest implements IGetGuardrailRequest { + + /** + * Constructs a new GetGuardrailRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetGuardrailRequest); + + /** GetGuardrailRequest name. */ + public name: string; + + /** + * Creates a new GetGuardrailRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGuardrailRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetGuardrailRequest): google.cloud.ces.v1beta.GetGuardrailRequest; + + /** + * Encodes the specified GetGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetGuardrailRequest.verify|verify} messages. + * @param message GetGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetGuardrailRequest.verify|verify} messages. + * @param message GetGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGuardrailRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetGuardrailRequest; + + /** + * Decodes a GetGuardrailRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetGuardrailRequest; + + /** + * Verifies a GetGuardrailRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGuardrailRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetGuardrailRequest; + + /** + * Creates a plain object from a GetGuardrailRequest message. Also converts values to other types if specified. + * @param message GetGuardrailRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGuardrailRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGuardrailRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateGuardrailRequest. */ + interface ICreateGuardrailRequest { + + /** CreateGuardrailRequest parent */ + parent?: (string|null); + + /** CreateGuardrailRequest guardrailId */ + guardrailId?: (string|null); + + /** CreateGuardrailRequest guardrail */ + guardrail?: (google.cloud.ces.v1beta.IGuardrail|null); + } + + /** Represents a CreateGuardrailRequest. */ + class CreateGuardrailRequest implements ICreateGuardrailRequest { + + /** + * Constructs a new CreateGuardrailRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateGuardrailRequest); + + /** CreateGuardrailRequest parent. */ + public parent: string; + + /** CreateGuardrailRequest guardrailId. */ + public guardrailId: string; + + /** CreateGuardrailRequest guardrail. */ + public guardrail?: (google.cloud.ces.v1beta.IGuardrail|null); + + /** + * Creates a new CreateGuardrailRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGuardrailRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateGuardrailRequest): google.cloud.ces.v1beta.CreateGuardrailRequest; + + /** + * Encodes the specified CreateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateGuardrailRequest.verify|verify} messages. + * @param message CreateGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateGuardrailRequest.verify|verify} messages. + * @param message CreateGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGuardrailRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateGuardrailRequest; + + /** + * Decodes a CreateGuardrailRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateGuardrailRequest; + + /** + * Verifies a CreateGuardrailRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGuardrailRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateGuardrailRequest; + + /** + * Creates a plain object from a CreateGuardrailRequest message. Also converts values to other types if specified. + * @param message CreateGuardrailRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGuardrailRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGuardrailRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateGuardrailRequest. */ + interface IUpdateGuardrailRequest { + + /** UpdateGuardrailRequest guardrail */ + guardrail?: (google.cloud.ces.v1beta.IGuardrail|null); + + /** UpdateGuardrailRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateGuardrailRequest. */ + class UpdateGuardrailRequest implements IUpdateGuardrailRequest { + + /** + * Constructs a new UpdateGuardrailRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateGuardrailRequest); + + /** UpdateGuardrailRequest guardrail. */ + public guardrail?: (google.cloud.ces.v1beta.IGuardrail|null); + + /** UpdateGuardrailRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateGuardrailRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateGuardrailRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateGuardrailRequest): google.cloud.ces.v1beta.UpdateGuardrailRequest; + + /** + * Encodes the specified UpdateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateGuardrailRequest.verify|verify} messages. + * @param message UpdateGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateGuardrailRequest.verify|verify} messages. + * @param message UpdateGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateGuardrailRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateGuardrailRequest; + + /** + * Decodes an UpdateGuardrailRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateGuardrailRequest; + + /** + * Verifies an UpdateGuardrailRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateGuardrailRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateGuardrailRequest; + + /** + * Creates a plain object from an UpdateGuardrailRequest message. Also converts values to other types if specified. + * @param message UpdateGuardrailRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateGuardrailRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateGuardrailRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteGuardrailRequest. */ + interface IDeleteGuardrailRequest { + + /** DeleteGuardrailRequest name */ + name?: (string|null); + + /** DeleteGuardrailRequest force */ + force?: (boolean|null); + + /** DeleteGuardrailRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteGuardrailRequest. */ + class DeleteGuardrailRequest implements IDeleteGuardrailRequest { + + /** + * Constructs a new DeleteGuardrailRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteGuardrailRequest); + + /** DeleteGuardrailRequest name. */ + public name: string; + + /** DeleteGuardrailRequest force. */ + public force: boolean; + + /** DeleteGuardrailRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteGuardrailRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGuardrailRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteGuardrailRequest): google.cloud.ces.v1beta.DeleteGuardrailRequest; + + /** + * Encodes the specified DeleteGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteGuardrailRequest.verify|verify} messages. + * @param message DeleteGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteGuardrailRequest.verify|verify} messages. + * @param message DeleteGuardrailRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteGuardrailRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGuardrailRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteGuardrailRequest; + + /** + * Decodes a DeleteGuardrailRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteGuardrailRequest; + + /** + * Verifies a DeleteGuardrailRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGuardrailRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteGuardrailRequest; + + /** + * Creates a plain object from a DeleteGuardrailRequest message. Also converts values to other types if specified. + * @param message DeleteGuardrailRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteGuardrailRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGuardrailRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGuardrailRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDeploymentsRequest. */ + interface IListDeploymentsRequest { + + /** ListDeploymentsRequest parent */ + parent?: (string|null); + + /** ListDeploymentsRequest pageSize */ + pageSize?: (number|null); + + /** ListDeploymentsRequest pageToken */ + pageToken?: (string|null); + + /** ListDeploymentsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListDeploymentsRequest. */ + class ListDeploymentsRequest implements IListDeploymentsRequest { + + /** + * Constructs a new ListDeploymentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListDeploymentsRequest); + + /** ListDeploymentsRequest parent. */ + public parent: string; + + /** ListDeploymentsRequest pageSize. */ + public pageSize: number; + + /** ListDeploymentsRequest pageToken. */ + public pageToken: string; + + /** ListDeploymentsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListDeploymentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeploymentsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListDeploymentsRequest): google.cloud.ces.v1beta.ListDeploymentsRequest; + + /** + * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsRequest.verify|verify} messages. + * @param message ListDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsRequest.verify|verify} messages. + * @param message ListDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListDeploymentsRequest; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListDeploymentsRequest; + + /** + * Verifies a ListDeploymentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeploymentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListDeploymentsRequest; + + /** + * Creates a plain object from a ListDeploymentsRequest message. Also converts values to other types if specified. + * @param message ListDeploymentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListDeploymentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeploymentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeploymentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDeploymentsResponse. */ + interface IListDeploymentsResponse { + + /** ListDeploymentsResponse deployments */ + deployments?: (google.cloud.ces.v1beta.IDeployment[]|null); + + /** ListDeploymentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDeploymentsResponse. */ + class ListDeploymentsResponse implements IListDeploymentsResponse { + + /** + * Constructs a new ListDeploymentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListDeploymentsResponse); + + /** ListDeploymentsResponse deployments. */ + public deployments: google.cloud.ces.v1beta.IDeployment[]; + + /** ListDeploymentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDeploymentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeploymentsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListDeploymentsResponse): google.cloud.ces.v1beta.ListDeploymentsResponse; + + /** + * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsResponse.verify|verify} messages. + * @param message ListDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsResponse.verify|verify} messages. + * @param message ListDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListDeploymentsResponse; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListDeploymentsResponse; + + /** + * Verifies a ListDeploymentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeploymentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListDeploymentsResponse; + + /** + * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. + * @param message ListDeploymentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListDeploymentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeploymentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeploymentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDeploymentRequest. */ + interface IGetDeploymentRequest { + + /** GetDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a GetDeploymentRequest. */ + class GetDeploymentRequest implements IGetDeploymentRequest { + + /** + * Constructs a new GetDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetDeploymentRequest); + + /** GetDeploymentRequest name. */ + public name: string; + + /** + * Creates a new GetDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDeploymentRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetDeploymentRequest): google.cloud.ces.v1beta.GetDeploymentRequest; + + /** + * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetDeploymentRequest.verify|verify} messages. + * @param message GetDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetDeploymentRequest.verify|verify} messages. + * @param message GetDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetDeploymentRequest; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetDeploymentRequest; + + /** + * Verifies a GetDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetDeploymentRequest; + + /** + * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. + * @param message GetDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDeploymentRequest. */ + interface ICreateDeploymentRequest { + + /** CreateDeploymentRequest parent */ + parent?: (string|null); + + /** CreateDeploymentRequest deploymentId */ + deploymentId?: (string|null); + + /** CreateDeploymentRequest deployment */ + deployment?: (google.cloud.ces.v1beta.IDeployment|null); + } + + /** Represents a CreateDeploymentRequest. */ + class CreateDeploymentRequest implements ICreateDeploymentRequest { + + /** + * Constructs a new CreateDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateDeploymentRequest); + + /** CreateDeploymentRequest parent. */ + public parent: string; + + /** CreateDeploymentRequest deploymentId. */ + public deploymentId: string; + + /** CreateDeploymentRequest deployment. */ + public deployment?: (google.cloud.ces.v1beta.IDeployment|null); + + /** + * Creates a new CreateDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDeploymentRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateDeploymentRequest): google.cloud.ces.v1beta.CreateDeploymentRequest; + + /** + * Encodes the specified CreateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateDeploymentRequest.verify|verify} messages. + * @param message CreateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateDeploymentRequest.verify|verify} messages. + * @param message CreateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateDeploymentRequest; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateDeploymentRequest; + + /** + * Verifies a CreateDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateDeploymentRequest; + + /** + * Creates a plain object from a CreateDeploymentRequest message. Also converts values to other types if specified. + * @param message CreateDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDeploymentRequest. */ + interface IUpdateDeploymentRequest { + + /** UpdateDeploymentRequest deployment */ + deployment?: (google.cloud.ces.v1beta.IDeployment|null); + + /** UpdateDeploymentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDeploymentRequest. */ + class UpdateDeploymentRequest implements IUpdateDeploymentRequest { + + /** + * Constructs a new UpdateDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateDeploymentRequest); + + /** UpdateDeploymentRequest deployment. */ + public deployment?: (google.cloud.ces.v1beta.IDeployment|null); + + /** UpdateDeploymentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDeploymentRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateDeploymentRequest): google.cloud.ces.v1beta.UpdateDeploymentRequest; + + /** + * Encodes the specified UpdateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateDeploymentRequest.verify|verify} messages. + * @param message UpdateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateDeploymentRequest.verify|verify} messages. + * @param message UpdateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateDeploymentRequest; + + /** + * Decodes an UpdateDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateDeploymentRequest; + + /** + * Verifies an UpdateDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateDeploymentRequest; + + /** + * Creates a plain object from an UpdateDeploymentRequest message. Also converts values to other types if specified. + * @param message UpdateDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDeploymentRequest. */ + interface IDeleteDeploymentRequest { + + /** DeleteDeploymentRequest name */ + name?: (string|null); + + /** DeleteDeploymentRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteDeploymentRequest. */ + class DeleteDeploymentRequest implements IDeleteDeploymentRequest { + + /** + * Constructs a new DeleteDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteDeploymentRequest); + + /** DeleteDeploymentRequest name. */ + public name: string; + + /** DeleteDeploymentRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDeploymentRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteDeploymentRequest): google.cloud.ces.v1beta.DeleteDeploymentRequest; + + /** + * Encodes the specified DeleteDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteDeploymentRequest.verify|verify} messages. + * @param message DeleteDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteDeploymentRequest.verify|verify} messages. + * @param message DeleteDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteDeploymentRequest; + + /** + * Decodes a DeleteDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteDeploymentRequest; + + /** + * Verifies a DeleteDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteDeploymentRequest; + + /** + * Creates a plain object from a DeleteDeploymentRequest message. Also converts values to other types if specified. + * @param message DeleteDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListToolsetsRequest. */ + interface IListToolsetsRequest { + + /** ListToolsetsRequest parent */ + parent?: (string|null); + + /** ListToolsetsRequest pageSize */ + pageSize?: (number|null); + + /** ListToolsetsRequest pageToken */ + pageToken?: (string|null); + + /** ListToolsetsRequest filter */ + filter?: (string|null); + + /** ListToolsetsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListToolsetsRequest. */ + class ListToolsetsRequest implements IListToolsetsRequest { + + /** + * Constructs a new ListToolsetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListToolsetsRequest); + + /** ListToolsetsRequest parent. */ + public parent: string; + + /** ListToolsetsRequest pageSize. */ + public pageSize: number; + + /** ListToolsetsRequest pageToken. */ + public pageToken: string; + + /** ListToolsetsRequest filter. */ + public filter: string; + + /** ListToolsetsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListToolsetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolsetsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListToolsetsRequest): google.cloud.ces.v1beta.ListToolsetsRequest; + + /** + * Encodes the specified ListToolsetsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsRequest.verify|verify} messages. + * @param message ListToolsetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListToolsetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolsetsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsRequest.verify|verify} messages. + * @param message ListToolsetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListToolsetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolsetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolsetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListToolsetsRequest; + + /** + * Decodes a ListToolsetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolsetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListToolsetsRequest; + + /** + * Verifies a ListToolsetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListToolsetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolsetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListToolsetsRequest; + + /** + * Creates a plain object from a ListToolsetsRequest message. Also converts values to other types if specified. + * @param message ListToolsetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListToolsetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolsetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolsetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListToolsetsResponse. */ + interface IListToolsetsResponse { + + /** ListToolsetsResponse toolsets */ + toolsets?: (google.cloud.ces.v1beta.IToolset[]|null); + + /** ListToolsetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListToolsetsResponse. */ + class ListToolsetsResponse implements IListToolsetsResponse { + + /** + * Constructs a new ListToolsetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListToolsetsResponse); + + /** ListToolsetsResponse toolsets. */ + public toolsets: google.cloud.ces.v1beta.IToolset[]; + + /** ListToolsetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListToolsetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListToolsetsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListToolsetsResponse): google.cloud.ces.v1beta.ListToolsetsResponse; + + /** + * Encodes the specified ListToolsetsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsResponse.verify|verify} messages. + * @param message ListToolsetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListToolsetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListToolsetsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsResponse.verify|verify} messages. + * @param message ListToolsetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListToolsetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListToolsetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListToolsetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListToolsetsResponse; + + /** + * Decodes a ListToolsetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListToolsetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListToolsetsResponse; + + /** + * Verifies a ListToolsetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListToolsetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListToolsetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListToolsetsResponse; + + /** + * Creates a plain object from a ListToolsetsResponse message. Also converts values to other types if specified. + * @param message ListToolsetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListToolsetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListToolsetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListToolsetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetToolsetRequest. */ + interface IGetToolsetRequest { + + /** GetToolsetRequest name */ + name?: (string|null); + } + + /** Represents a GetToolsetRequest. */ + class GetToolsetRequest implements IGetToolsetRequest { + + /** + * Constructs a new GetToolsetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetToolsetRequest); + + /** GetToolsetRequest name. */ + public name: string; + + /** + * Creates a new GetToolsetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetToolsetRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetToolsetRequest): google.cloud.ces.v1beta.GetToolsetRequest; + + /** + * Encodes the specified GetToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetToolsetRequest.verify|verify} messages. + * @param message GetToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetToolsetRequest.verify|verify} messages. + * @param message GetToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetToolsetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetToolsetRequest; + + /** + * Decodes a GetToolsetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetToolsetRequest; + + /** + * Verifies a GetToolsetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetToolsetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetToolsetRequest; + + /** + * Creates a plain object from a GetToolsetRequest message. Also converts values to other types if specified. + * @param message GetToolsetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetToolsetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetToolsetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateToolsetRequest. */ + interface ICreateToolsetRequest { + + /** CreateToolsetRequest parent */ + parent?: (string|null); + + /** CreateToolsetRequest toolsetId */ + toolsetId?: (string|null); + + /** CreateToolsetRequest toolset */ + toolset?: (google.cloud.ces.v1beta.IToolset|null); + } + + /** Represents a CreateToolsetRequest. */ + class CreateToolsetRequest implements ICreateToolsetRequest { + + /** + * Constructs a new CreateToolsetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateToolsetRequest); + + /** CreateToolsetRequest parent. */ + public parent: string; + + /** CreateToolsetRequest toolsetId. */ + public toolsetId: string; + + /** CreateToolsetRequest toolset. */ + public toolset?: (google.cloud.ces.v1beta.IToolset|null); + + /** + * Creates a new CreateToolsetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateToolsetRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateToolsetRequest): google.cloud.ces.v1beta.CreateToolsetRequest; + + /** + * Encodes the specified CreateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolsetRequest.verify|verify} messages. + * @param message CreateToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolsetRequest.verify|verify} messages. + * @param message CreateToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateToolsetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateToolsetRequest; + + /** + * Decodes a CreateToolsetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateToolsetRequest; + + /** + * Verifies a CreateToolsetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateToolsetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateToolsetRequest; + + /** + * Creates a plain object from a CreateToolsetRequest message. Also converts values to other types if specified. + * @param message CreateToolsetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateToolsetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateToolsetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateToolsetRequest. */ + interface IUpdateToolsetRequest { + + /** UpdateToolsetRequest toolset */ + toolset?: (google.cloud.ces.v1beta.IToolset|null); + + /** UpdateToolsetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateToolsetRequest. */ + class UpdateToolsetRequest implements IUpdateToolsetRequest { + + /** + * Constructs a new UpdateToolsetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateToolsetRequest); + + /** UpdateToolsetRequest toolset. */ + public toolset?: (google.cloud.ces.v1beta.IToolset|null); + + /** UpdateToolsetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateToolsetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateToolsetRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateToolsetRequest): google.cloud.ces.v1beta.UpdateToolsetRequest; + + /** + * Encodes the specified UpdateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolsetRequest.verify|verify} messages. + * @param message UpdateToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolsetRequest.verify|verify} messages. + * @param message UpdateToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateToolsetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateToolsetRequest; + + /** + * Decodes an UpdateToolsetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateToolsetRequest; + + /** + * Verifies an UpdateToolsetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateToolsetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateToolsetRequest; + + /** + * Creates a plain object from an UpdateToolsetRequest message. Also converts values to other types if specified. + * @param message UpdateToolsetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateToolsetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateToolsetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteToolsetRequest. */ + interface IDeleteToolsetRequest { + + /** DeleteToolsetRequest name */ + name?: (string|null); + + /** DeleteToolsetRequest force */ + force?: (boolean|null); + + /** DeleteToolsetRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteToolsetRequest. */ + class DeleteToolsetRequest implements IDeleteToolsetRequest { + + /** + * Constructs a new DeleteToolsetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteToolsetRequest); + + /** DeleteToolsetRequest name. */ + public name: string; + + /** DeleteToolsetRequest force. */ + public force: boolean; + + /** DeleteToolsetRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteToolsetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteToolsetRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteToolsetRequest): google.cloud.ces.v1beta.DeleteToolsetRequest; + + /** + * Encodes the specified DeleteToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolsetRequest.verify|verify} messages. + * @param message DeleteToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolsetRequest.verify|verify} messages. + * @param message DeleteToolsetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteToolsetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteToolsetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteToolsetRequest; + + /** + * Decodes a DeleteToolsetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteToolsetRequest; + + /** + * Verifies a DeleteToolsetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteToolsetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteToolsetRequest; + + /** + * Creates a plain object from a DeleteToolsetRequest message. Also converts values to other types if specified. + * @param message DeleteToolsetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteToolsetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteToolsetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteToolsetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAppVersionsRequest. */ + interface IListAppVersionsRequest { + + /** ListAppVersionsRequest parent */ + parent?: (string|null); + + /** ListAppVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListAppVersionsRequest pageToken */ + pageToken?: (string|null); + + /** ListAppVersionsRequest filter */ + filter?: (string|null); + + /** ListAppVersionsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListAppVersionsRequest. */ + class ListAppVersionsRequest implements IListAppVersionsRequest { + + /** + * Constructs a new ListAppVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListAppVersionsRequest); + + /** ListAppVersionsRequest parent. */ + public parent: string; + + /** ListAppVersionsRequest pageSize. */ + public pageSize: number; + + /** ListAppVersionsRequest pageToken. */ + public pageToken: string; + + /** ListAppVersionsRequest filter. */ + public filter: string; + + /** ListAppVersionsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListAppVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAppVersionsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListAppVersionsRequest): google.cloud.ces.v1beta.ListAppVersionsRequest; + + /** + * Encodes the specified ListAppVersionsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsRequest.verify|verify} messages. + * @param message ListAppVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListAppVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAppVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsRequest.verify|verify} messages. + * @param message ListAppVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListAppVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAppVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAppVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListAppVersionsRequest; + + /** + * Decodes a ListAppVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAppVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListAppVersionsRequest; + + /** + * Verifies a ListAppVersionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAppVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAppVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListAppVersionsRequest; + + /** + * Creates a plain object from a ListAppVersionsRequest message. Also converts values to other types if specified. + * @param message ListAppVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListAppVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAppVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAppVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAppVersionsResponse. */ + interface IListAppVersionsResponse { + + /** ListAppVersionsResponse appVersions */ + appVersions?: (google.cloud.ces.v1beta.IAppVersion[]|null); + + /** ListAppVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAppVersionsResponse. */ + class ListAppVersionsResponse implements IListAppVersionsResponse { + + /** + * Constructs a new ListAppVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListAppVersionsResponse); + + /** ListAppVersionsResponse appVersions. */ + public appVersions: google.cloud.ces.v1beta.IAppVersion[]; + + /** ListAppVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAppVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAppVersionsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListAppVersionsResponse): google.cloud.ces.v1beta.ListAppVersionsResponse; + + /** + * Encodes the specified ListAppVersionsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsResponse.verify|verify} messages. + * @param message ListAppVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListAppVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAppVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsResponse.verify|verify} messages. + * @param message ListAppVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListAppVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAppVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAppVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListAppVersionsResponse; + + /** + * Decodes a ListAppVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAppVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListAppVersionsResponse; + + /** + * Verifies a ListAppVersionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAppVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAppVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListAppVersionsResponse; + + /** + * Creates a plain object from a ListAppVersionsResponse message. Also converts values to other types if specified. + * @param message ListAppVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListAppVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAppVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAppVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAppVersionRequest. */ + interface IGetAppVersionRequest { + + /** GetAppVersionRequest name */ + name?: (string|null); + } + + /** Represents a GetAppVersionRequest. */ + class GetAppVersionRequest implements IGetAppVersionRequest { + + /** + * Constructs a new GetAppVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetAppVersionRequest); + + /** GetAppVersionRequest name. */ + public name: string; + + /** + * Creates a new GetAppVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAppVersionRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetAppVersionRequest): google.cloud.ces.v1beta.GetAppVersionRequest; + + /** + * Encodes the specified GetAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetAppVersionRequest.verify|verify} messages. + * @param message GetAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetAppVersionRequest.verify|verify} messages. + * @param message GetAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAppVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetAppVersionRequest; + + /** + * Decodes a GetAppVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetAppVersionRequest; + + /** + * Verifies a GetAppVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAppVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetAppVersionRequest; + + /** + * Creates a plain object from a GetAppVersionRequest message. Also converts values to other types if specified. + * @param message GetAppVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAppVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAppVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAppVersionRequest. */ + interface IDeleteAppVersionRequest { + + /** DeleteAppVersionRequest name */ + name?: (string|null); + + /** DeleteAppVersionRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteAppVersionRequest. */ + class DeleteAppVersionRequest implements IDeleteAppVersionRequest { + + /** + * Constructs a new DeleteAppVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteAppVersionRequest); + + /** DeleteAppVersionRequest name. */ + public name: string; + + /** DeleteAppVersionRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteAppVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAppVersionRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteAppVersionRequest): google.cloud.ces.v1beta.DeleteAppVersionRequest; + + /** + * Encodes the specified DeleteAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppVersionRequest.verify|verify} messages. + * @param message DeleteAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppVersionRequest.verify|verify} messages. + * @param message DeleteAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAppVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteAppVersionRequest; + + /** + * Decodes a DeleteAppVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteAppVersionRequest; + + /** + * Verifies a DeleteAppVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAppVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteAppVersionRequest; + + /** + * Creates a plain object from a DeleteAppVersionRequest message. Also converts values to other types if specified. + * @param message DeleteAppVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAppVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAppVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAppVersionRequest. */ + interface ICreateAppVersionRequest { + + /** CreateAppVersionRequest parent */ + parent?: (string|null); + + /** CreateAppVersionRequest appVersionId */ + appVersionId?: (string|null); + + /** CreateAppVersionRequest appVersion */ + appVersion?: (google.cloud.ces.v1beta.IAppVersion|null); + } + + /** Represents a CreateAppVersionRequest. */ + class CreateAppVersionRequest implements ICreateAppVersionRequest { + + /** + * Constructs a new CreateAppVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateAppVersionRequest); + + /** CreateAppVersionRequest parent. */ + public parent: string; + + /** CreateAppVersionRequest appVersionId. */ + public appVersionId: string; + + /** CreateAppVersionRequest appVersion. */ + public appVersion?: (google.cloud.ces.v1beta.IAppVersion|null); + + /** + * Creates a new CreateAppVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAppVersionRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateAppVersionRequest): google.cloud.ces.v1beta.CreateAppVersionRequest; + + /** + * Encodes the specified CreateAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppVersionRequest.verify|verify} messages. + * @param message CreateAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppVersionRequest.verify|verify} messages. + * @param message CreateAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAppVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateAppVersionRequest; + + /** + * Decodes a CreateAppVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateAppVersionRequest; + + /** + * Verifies a CreateAppVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAppVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateAppVersionRequest; + + /** + * Creates a plain object from a CreateAppVersionRequest message. Also converts values to other types if specified. + * @param message CreateAppVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAppVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAppVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreAppVersionRequest. */ + interface IRestoreAppVersionRequest { + + /** RestoreAppVersionRequest name */ + name?: (string|null); + } + + /** Represents a RestoreAppVersionRequest. */ + class RestoreAppVersionRequest implements IRestoreAppVersionRequest { + + /** + * Constructs a new RestoreAppVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRestoreAppVersionRequest); + + /** RestoreAppVersionRequest name. */ + public name: string; + + /** + * Creates a new RestoreAppVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreAppVersionRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRestoreAppVersionRequest): google.cloud.ces.v1beta.RestoreAppVersionRequest; + + /** + * Encodes the specified RestoreAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionRequest.verify|verify} messages. + * @param message RestoreAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRestoreAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionRequest.verify|verify} messages. + * @param message RestoreAppVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRestoreAppVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreAppVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RestoreAppVersionRequest; + + /** + * Decodes a RestoreAppVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RestoreAppVersionRequest; + + /** + * Verifies a RestoreAppVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreAppVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RestoreAppVersionRequest; + + /** + * Creates a plain object from a RestoreAppVersionRequest message. Also converts values to other types if specified. + * @param message RestoreAppVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RestoreAppVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreAppVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreAppVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreAppVersionResponse. */ + interface IRestoreAppVersionResponse { + } + + /** Represents a RestoreAppVersionResponse. */ + class RestoreAppVersionResponse implements IRestoreAppVersionResponse { + + /** + * Constructs a new RestoreAppVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRestoreAppVersionResponse); + + /** + * Creates a new RestoreAppVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreAppVersionResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRestoreAppVersionResponse): google.cloud.ces.v1beta.RestoreAppVersionResponse; + + /** + * Encodes the specified RestoreAppVersionResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionResponse.verify|verify} messages. + * @param message RestoreAppVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRestoreAppVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreAppVersionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionResponse.verify|verify} messages. + * @param message RestoreAppVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRestoreAppVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreAppVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreAppVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RestoreAppVersionResponse; + + /** + * Decodes a RestoreAppVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreAppVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RestoreAppVersionResponse; + + /** + * Verifies a RestoreAppVersionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreAppVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreAppVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RestoreAppVersionResponse; + + /** + * Creates a plain object from a RestoreAppVersionResponse message. Also converts values to other types if specified. + * @param message RestoreAppVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RestoreAppVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreAppVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreAppVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateAppResourceResponse. */ + interface IGenerateAppResourceResponse { + + /** GenerateAppResourceResponse agent */ + agent?: (google.cloud.ces.v1beta.IAgent|null); + + /** GenerateAppResourceResponse toolset */ + toolset?: (google.cloud.ces.v1beta.IToolset|null); + + /** GenerateAppResourceResponse appSnapshot */ + appSnapshot?: (google.cloud.ces.v1beta.IAppSnapshot|null); + + /** GenerateAppResourceResponse tools */ + tools?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools|null); + + /** GenerateAppResourceResponse evaluations */ + evaluations?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations|null); + + /** GenerateAppResourceResponse appResources */ + appResources?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources|null); + + /** GenerateAppResourceResponse generateResultInfo */ + generateResultInfo?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo|null); + } + + /** Represents a GenerateAppResourceResponse. */ + class GenerateAppResourceResponse implements IGenerateAppResourceResponse { + + /** + * Constructs a new GenerateAppResourceResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGenerateAppResourceResponse); + + /** GenerateAppResourceResponse agent. */ + public agent?: (google.cloud.ces.v1beta.IAgent|null); + + /** GenerateAppResourceResponse toolset. */ + public toolset?: (google.cloud.ces.v1beta.IToolset|null); + + /** GenerateAppResourceResponse appSnapshot. */ + public appSnapshot?: (google.cloud.ces.v1beta.IAppSnapshot|null); + + /** GenerateAppResourceResponse tools. */ + public tools?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools|null); + + /** GenerateAppResourceResponse evaluations. */ + public evaluations?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations|null); + + /** GenerateAppResourceResponse appResources. */ + public appResources?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources|null); + + /** GenerateAppResourceResponse generateResultInfo. */ + public generateResultInfo?: (google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo|null); + + /** GenerateAppResourceResponse generatedResource. */ + public generatedResource?: ("agent"|"toolset"|"appSnapshot"|"tools"|"evaluations"|"appResources"); + + /** + * Creates a new GenerateAppResourceResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateAppResourceResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGenerateAppResourceResponse): google.cloud.ces.v1beta.GenerateAppResourceResponse; + + /** + * Encodes the specified GenerateAppResourceResponse message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.verify|verify} messages. + * @param message GenerateAppResourceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGenerateAppResourceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateAppResourceResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.verify|verify} messages. + * @param message GenerateAppResourceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGenerateAppResourceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateAppResourceResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateAppResourceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateAppResourceResponse; + + /** + * Decodes a GenerateAppResourceResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateAppResourceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateAppResourceResponse; + + /** + * Verifies a GenerateAppResourceResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateAppResourceResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateAppResourceResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceResponse; + + /** + * Creates a plain object from a GenerateAppResourceResponse message. Also converts values to other types if specified. + * @param message GenerateAppResourceResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateAppResourceResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateAppResourceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GenerateAppResourceResponse { + + /** Properties of an Evaluations. */ + interface IEvaluations { + + /** Evaluations evaluations */ + evaluations?: (google.cloud.ces.v1beta.IEvaluation[]|null); + } + + /** Represents an Evaluations. */ + class Evaluations implements IEvaluations { + + /** + * Constructs a new Evaluations. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations); + + /** Evaluations evaluations. */ + public evaluations: google.cloud.ces.v1beta.IEvaluation[]; + + /** + * Creates a new Evaluations instance using the specified properties. + * @param [properties] Properties to set + * @returns Evaluations instance + */ + public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations): google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations; + + /** + * Encodes the specified Evaluations message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.verify|verify} messages. + * @param message Evaluations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Evaluations message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.verify|verify} messages. + * @param message Evaluations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Evaluations message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Evaluations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations; + + /** + * Decodes an Evaluations message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Evaluations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations; + + /** + * Verifies an Evaluations message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Evaluations message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Evaluations + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations; + + /** + * Creates a plain object from an Evaluations message. Also converts values to other types if specified. + * @param message Evaluations + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Evaluations to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Evaluations + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Tools. */ + interface ITools { + + /** Tools tools */ + tools?: (google.cloud.ces.v1beta.ITool[]|null); + } + + /** Represents a Tools. */ + class Tools implements ITools { + + /** + * Constructs a new Tools. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools); + + /** Tools tools. */ + public tools: google.cloud.ces.v1beta.ITool[]; + + /** + * Creates a new Tools instance using the specified properties. + * @param [properties] Properties to set + * @returns Tools instance + */ + public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools): google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools; + + /** + * Encodes the specified Tools message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.verify|verify} messages. + * @param message Tools message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tools message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.verify|verify} messages. + * @param message Tools message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tools message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tools + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools; + + /** + * Decodes a Tools message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tools + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools; + + /** + * Verifies a Tools message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Tools message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tools + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools; + + /** + * Creates a plain object from a Tools message. Also converts values to other types if specified. + * @param message Tools + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tools to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Tools + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AppResources. */ + interface IAppResources { + + /** AppResources appSnapshot */ + appSnapshot?: (google.cloud.ces.v1beta.IAppSnapshot|null); + + /** AppResources evaluations */ + evaluations?: (google.cloud.ces.v1beta.IEvaluation[]|null); + } + + /** Represents an AppResources. */ + class AppResources implements IAppResources { + + /** + * Constructs a new AppResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources); + + /** AppResources appSnapshot. */ + public appSnapshot?: (google.cloud.ces.v1beta.IAppSnapshot|null); + + /** AppResources evaluations. */ + public evaluations: google.cloud.ces.v1beta.IEvaluation[]; + + /** + * Creates a new AppResources instance using the specified properties. + * @param [properties] Properties to set + * @returns AppResources instance + */ + public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources): google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources; + + /** + * Encodes the specified AppResources message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.verify|verify} messages. + * @param message AppResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppResources message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.verify|verify} messages. + * @param message AppResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources; + + /** + * Decodes an AppResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources; + + /** + * Verifies an AppResources message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AppResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources; + + /** + * Creates a plain object from an AppResources message. Also converts values to other types if specified. + * @param message AppResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppResources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateResultInfo. */ + interface IGenerateResultInfo { + + /** GenerateResultInfo explanation */ + explanation?: (string|null); + } + + /** Represents a GenerateResultInfo. */ + class GenerateResultInfo implements IGenerateResultInfo { + + /** + * Constructs a new GenerateResultInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo); + + /** GenerateResultInfo explanation. */ + public explanation: string; + + /** + * Creates a new GenerateResultInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateResultInfo instance + */ + public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo): google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo; + + /** + * Encodes the specified GenerateResultInfo message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.verify|verify} messages. + * @param message GenerateResultInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateResultInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.verify|verify} messages. + * @param message GenerateResultInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateResultInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateResultInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo; + + /** + * Decodes a GenerateResultInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateResultInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo; + + /** + * Verifies a GenerateResultInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateResultInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateResultInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo; + + /** + * Creates a plain object from a GenerateResultInfo message. Also converts values to other types if specified. + * @param message GenerateResultInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateResultInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateResultInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListChangelogsRequest. */ + interface IListChangelogsRequest { + + /** ListChangelogsRequest parent */ + parent?: (string|null); + + /** ListChangelogsRequest pageSize */ + pageSize?: (number|null); + + /** ListChangelogsRequest pageToken */ + pageToken?: (string|null); + + /** ListChangelogsRequest filter */ + filter?: (string|null); + + /** ListChangelogsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListChangelogsRequest. */ + class ListChangelogsRequest implements IListChangelogsRequest { + + /** + * Constructs a new ListChangelogsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListChangelogsRequest); + + /** ListChangelogsRequest parent. */ + public parent: string; + + /** ListChangelogsRequest pageSize. */ + public pageSize: number; + + /** ListChangelogsRequest pageToken. */ + public pageToken: string; + + /** ListChangelogsRequest filter. */ + public filter: string; + + /** ListChangelogsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListChangelogsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChangelogsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListChangelogsRequest): google.cloud.ces.v1beta.ListChangelogsRequest; + + /** + * Encodes the specified ListChangelogsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsRequest.verify|verify} messages. + * @param message ListChangelogsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListChangelogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListChangelogsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsRequest.verify|verify} messages. + * @param message ListChangelogsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListChangelogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChangelogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListChangelogsRequest; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChangelogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListChangelogsRequest; + + /** + * Verifies a ListChangelogsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListChangelogsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChangelogsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListChangelogsRequest; + + /** + * Creates a plain object from a ListChangelogsRequest message. Also converts values to other types if specified. + * @param message ListChangelogsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListChangelogsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListChangelogsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChangelogsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListChangelogsResponse. */ + interface IListChangelogsResponse { + + /** ListChangelogsResponse changelogs */ + changelogs?: (google.cloud.ces.v1beta.IChangelog[]|null); + + /** ListChangelogsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListChangelogsResponse. */ + class ListChangelogsResponse implements IListChangelogsResponse { + + /** + * Constructs a new ListChangelogsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListChangelogsResponse); + + /** ListChangelogsResponse changelogs. */ + public changelogs: google.cloud.ces.v1beta.IChangelog[]; + + /** ListChangelogsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListChangelogsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChangelogsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListChangelogsResponse): google.cloud.ces.v1beta.ListChangelogsResponse; + + /** + * Encodes the specified ListChangelogsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsResponse.verify|verify} messages. + * @param message ListChangelogsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListChangelogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListChangelogsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsResponse.verify|verify} messages. + * @param message ListChangelogsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListChangelogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChangelogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListChangelogsResponse; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChangelogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListChangelogsResponse; + + /** + * Verifies a ListChangelogsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListChangelogsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChangelogsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListChangelogsResponse; + + /** + * Creates a plain object from a ListChangelogsResponse message. Also converts values to other types if specified. + * @param message ListChangelogsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListChangelogsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListChangelogsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChangelogsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetChangelogRequest. */ + interface IGetChangelogRequest { + + /** GetChangelogRequest name */ + name?: (string|null); + } + + /** Represents a GetChangelogRequest. */ + class GetChangelogRequest implements IGetChangelogRequest { + + /** + * Constructs a new GetChangelogRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetChangelogRequest); + + /** GetChangelogRequest name. */ + public name: string; + + /** + * Creates a new GetChangelogRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetChangelogRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetChangelogRequest): google.cloud.ces.v1beta.GetChangelogRequest; + + /** + * Encodes the specified GetChangelogRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetChangelogRequest.verify|verify} messages. + * @param message GetChangelogRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetChangelogRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetChangelogRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetChangelogRequest.verify|verify} messages. + * @param message GetChangelogRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetChangelogRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetChangelogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetChangelogRequest; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetChangelogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetChangelogRequest; + + /** + * Verifies a GetChangelogRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetChangelogRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetChangelogRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetChangelogRequest; + + /** + * Creates a plain object from a GetChangelogRequest message. Also converts values to other types if specified. + * @param message GetChangelogRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetChangelogRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetChangelogRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetChangelogRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an App. */ + interface IApp { + + /** App name */ + name?: (string|null); + + /** App displayName */ + displayName?: (string|null); + + /** App description */ + description?: (string|null); + + /** App pinned */ + pinned?: (boolean|null); + + /** App rootAgent */ + rootAgent?: (string|null); + + /** App languageSettings */ + languageSettings?: (google.cloud.ces.v1beta.ILanguageSettings|null); + + /** App timeZoneSettings */ + timeZoneSettings?: (google.cloud.ces.v1beta.ITimeZoneSettings|null); + + /** App audioProcessingConfig */ + audioProcessingConfig?: (google.cloud.ces.v1beta.IAudioProcessingConfig|null); + + /** App loggingSettings */ + loggingSettings?: (google.cloud.ces.v1beta.ILoggingSettings|null); + + /** App errorHandlingSettings */ + errorHandlingSettings?: (google.cloud.ces.v1beta.IErrorHandlingSettings|null); + + /** App modelSettings */ + modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** App toolExecutionMode */ + toolExecutionMode?: (google.cloud.ces.v1beta.App.ToolExecutionMode|keyof typeof google.cloud.ces.v1beta.App.ToolExecutionMode|null); + + /** App evaluationMetricsThresholds */ + evaluationMetricsThresholds?: (google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null); + + /** App variableDeclarations */ + variableDeclarations?: (google.cloud.ces.v1beta.App.IVariableDeclaration[]|null); + + /** App predefinedVariableDeclarations */ + predefinedVariableDeclarations?: (google.cloud.ces.v1beta.App.IVariableDeclaration[]|null); + + /** App globalInstruction */ + globalInstruction?: (string|null); + + /** App guardrails */ + guardrails?: (string[]|null); + + /** App dataStoreSettings */ + dataStoreSettings?: (google.cloud.ces.v1beta.IDataStoreSettings|null); + + /** App defaultChannelProfile */ + defaultChannelProfile?: (google.cloud.ces.v1beta.IChannelProfile|null); + + /** App metadata */ + metadata?: ({ [k: string]: string }|null); + + /** App createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** App updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** App etag */ + etag?: (string|null); + + /** App deploymentCount */ + deploymentCount?: (number|null); + + /** App clientCertificateSettings */ + clientCertificateSettings?: (google.cloud.ces.v1beta.IClientCertificateSettings|null); + + /** App locked */ + locked?: (boolean|null); + + /** App evaluationPersonas */ + evaluationPersonas?: (google.cloud.ces.v1beta.IEvaluationPersona[]|null); + + /** App evaluationSettings */ + evaluationSettings?: (google.cloud.ces.v1beta.IEvaluationSettings|null); + } + + /** Represents an App. */ + class App implements IApp { + + /** + * Constructs a new App. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IApp); + + /** App name. */ + public name: string; + + /** App displayName. */ + public displayName: string; + + /** App description. */ + public description: string; + + /** App pinned. */ + public pinned: boolean; + + /** App rootAgent. */ + public rootAgent: string; + + /** App languageSettings. */ + public languageSettings?: (google.cloud.ces.v1beta.ILanguageSettings|null); + + /** App timeZoneSettings. */ + public timeZoneSettings?: (google.cloud.ces.v1beta.ITimeZoneSettings|null); + + /** App audioProcessingConfig. */ + public audioProcessingConfig?: (google.cloud.ces.v1beta.IAudioProcessingConfig|null); + + /** App loggingSettings. */ + public loggingSettings?: (google.cloud.ces.v1beta.ILoggingSettings|null); + + /** App errorHandlingSettings. */ + public errorHandlingSettings?: (google.cloud.ces.v1beta.IErrorHandlingSettings|null); + + /** App modelSettings. */ + public modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** App toolExecutionMode. */ + public toolExecutionMode: (google.cloud.ces.v1beta.App.ToolExecutionMode|keyof typeof google.cloud.ces.v1beta.App.ToolExecutionMode); + + /** App evaluationMetricsThresholds. */ + public evaluationMetricsThresholds?: (google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null); + + /** App variableDeclarations. */ + public variableDeclarations: google.cloud.ces.v1beta.App.IVariableDeclaration[]; + + /** App predefinedVariableDeclarations. */ + public predefinedVariableDeclarations: google.cloud.ces.v1beta.App.IVariableDeclaration[]; + + /** App globalInstruction. */ + public globalInstruction: string; + + /** App guardrails. */ + public guardrails: string[]; + + /** App dataStoreSettings. */ + public dataStoreSettings?: (google.cloud.ces.v1beta.IDataStoreSettings|null); + + /** App defaultChannelProfile. */ + public defaultChannelProfile?: (google.cloud.ces.v1beta.IChannelProfile|null); + + /** App metadata. */ + public metadata: { [k: string]: string }; + + /** App createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** App updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** App etag. */ + public etag: string; + + /** App deploymentCount. */ + public deploymentCount: number; + + /** App clientCertificateSettings. */ + public clientCertificateSettings?: (google.cloud.ces.v1beta.IClientCertificateSettings|null); + + /** App locked. */ + public locked: boolean; + + /** App evaluationPersonas. */ + public evaluationPersonas: google.cloud.ces.v1beta.IEvaluationPersona[]; + + /** App evaluationSettings. */ + public evaluationSettings?: (google.cloud.ces.v1beta.IEvaluationSettings|null); + + /** + * Creates a new App instance using the specified properties. + * @param [properties] Properties to set + * @returns App instance + */ + public static create(properties?: google.cloud.ces.v1beta.IApp): google.cloud.ces.v1beta.App; + + /** + * Encodes the specified App message. Does not implicitly {@link google.cloud.ces.v1beta.App.verify|verify} messages. + * @param message App message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IApp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified App message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.App.verify|verify} messages. + * @param message App message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IApp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an App message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns App + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.App; + + /** + * Decodes an App message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns App + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.App; + + /** + * Verifies an App message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an App message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns App + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.App; + + /** + * Creates a plain object from an App message. Also converts values to other types if specified. + * @param message App + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.App, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this App to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for App + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace App { + + /** Properties of a VariableDeclaration. */ + interface IVariableDeclaration { + + /** VariableDeclaration name */ + name?: (string|null); + + /** VariableDeclaration description */ + description?: (string|null); + + /** VariableDeclaration schema */ + schema?: (google.cloud.ces.v1beta.ISchema|null); + } + + /** Represents a VariableDeclaration. */ + class VariableDeclaration implements IVariableDeclaration { + + /** + * Constructs a new VariableDeclaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.App.IVariableDeclaration); + + /** VariableDeclaration name. */ + public name: string; + + /** VariableDeclaration description. */ + public description: string; + + /** VariableDeclaration schema. */ + public schema?: (google.cloud.ces.v1beta.ISchema|null); + + /** + * Creates a new VariableDeclaration instance using the specified properties. + * @param [properties] Properties to set + * @returns VariableDeclaration instance + */ + public static create(properties?: google.cloud.ces.v1beta.App.IVariableDeclaration): google.cloud.ces.v1beta.App.VariableDeclaration; + + /** + * Encodes the specified VariableDeclaration message. Does not implicitly {@link google.cloud.ces.v1beta.App.VariableDeclaration.verify|verify} messages. + * @param message VariableDeclaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.App.IVariableDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VariableDeclaration message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.App.VariableDeclaration.verify|verify} messages. + * @param message VariableDeclaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.App.IVariableDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VariableDeclaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VariableDeclaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.App.VariableDeclaration; + + /** + * Decodes a VariableDeclaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VariableDeclaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.App.VariableDeclaration; + + /** + * Verifies a VariableDeclaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VariableDeclaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VariableDeclaration + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.App.VariableDeclaration; + + /** + * Creates a plain object from a VariableDeclaration message. Also converts values to other types if specified. + * @param message VariableDeclaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.App.VariableDeclaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VariableDeclaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VariableDeclaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ToolExecutionMode enum. */ + enum ToolExecutionMode { + TOOL_EXECUTION_MODE_UNSPECIFIED = 0, + PARALLEL = 1, + SEQUENTIAL = 2 + } + } + + /** Properties of a TimeZoneSettings. */ + interface ITimeZoneSettings { + + /** TimeZoneSettings timeZone */ + timeZone?: (string|null); + } + + /** Represents a TimeZoneSettings. */ + class TimeZoneSettings implements ITimeZoneSettings { + + /** + * Constructs a new TimeZoneSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ITimeZoneSettings); + + /** TimeZoneSettings timeZone. */ + public timeZone: string; + + /** + * Creates a new TimeZoneSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeZoneSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.ITimeZoneSettings): google.cloud.ces.v1beta.TimeZoneSettings; + + /** + * Encodes the specified TimeZoneSettings message. Does not implicitly {@link google.cloud.ces.v1beta.TimeZoneSettings.verify|verify} messages. + * @param message TimeZoneSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ITimeZoneSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeZoneSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TimeZoneSettings.verify|verify} messages. + * @param message TimeZoneSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ITimeZoneSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeZoneSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeZoneSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TimeZoneSettings; + + /** + * Decodes a TimeZoneSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeZoneSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TimeZoneSettings; + + /** + * Verifies a TimeZoneSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeZoneSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeZoneSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TimeZoneSettings; + + /** + * Creates a plain object from a TimeZoneSettings message. Also converts values to other types if specified. + * @param message TimeZoneSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TimeZoneSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeZoneSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeZoneSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LanguageSettings. */ + interface ILanguageSettings { + + /** LanguageSettings defaultLanguageCode */ + defaultLanguageCode?: (string|null); + + /** LanguageSettings supportedLanguageCodes */ + supportedLanguageCodes?: (string[]|null); + + /** LanguageSettings enableMultilingualSupport */ + enableMultilingualSupport?: (boolean|null); + + /** LanguageSettings fallbackAction */ + fallbackAction?: (string|null); + } + + /** Represents a LanguageSettings. */ + class LanguageSettings implements ILanguageSettings { + + /** + * Constructs a new LanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ILanguageSettings); + + /** LanguageSettings defaultLanguageCode. */ + public defaultLanguageCode: string; + + /** LanguageSettings supportedLanguageCodes. */ + public supportedLanguageCodes: string[]; + + /** LanguageSettings enableMultilingualSupport. */ + public enableMultilingualSupport: boolean; + + /** LanguageSettings fallbackAction. */ + public fallbackAction: string; + + /** + * Creates a new LanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns LanguageSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.ILanguageSettings): google.cloud.ces.v1beta.LanguageSettings; + + /** + * Encodes the specified LanguageSettings message. Does not implicitly {@link google.cloud.ces.v1beta.LanguageSettings.verify|verify} messages. + * @param message LanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ILanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LanguageSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LanguageSettings.verify|verify} messages. + * @param message LanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ILanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LanguageSettings; + + /** + * Decodes a LanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LanguageSettings; + + /** + * Verifies a LanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LanguageSettings; + + /** + * Creates a plain object from a LanguageSettings message. Also converts values to other types if specified. + * @param message LanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.LanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AudioProcessingConfig. */ + interface IAudioProcessingConfig { + + /** AudioProcessingConfig synthesizeSpeechConfigs */ + synthesizeSpeechConfigs?: ({ [k: string]: google.cloud.ces.v1beta.ISynthesizeSpeechConfig }|null); + + /** AudioProcessingConfig bargeInConfig */ + bargeInConfig?: (google.cloud.ces.v1beta.IBargeInConfig|null); + + /** AudioProcessingConfig inactivityTimeout */ + inactivityTimeout?: (google.protobuf.IDuration|null); + + /** AudioProcessingConfig ambientSoundConfig */ + ambientSoundConfig?: (google.cloud.ces.v1beta.IAmbientSoundConfig|null); + } + + /** Represents an AudioProcessingConfig. */ + class AudioProcessingConfig implements IAudioProcessingConfig { + + /** + * Constructs a new AudioProcessingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IAudioProcessingConfig); + + /** AudioProcessingConfig synthesizeSpeechConfigs. */ + public synthesizeSpeechConfigs: { [k: string]: google.cloud.ces.v1beta.ISynthesizeSpeechConfig }; + + /** AudioProcessingConfig bargeInConfig. */ + public bargeInConfig?: (google.cloud.ces.v1beta.IBargeInConfig|null); + + /** AudioProcessingConfig inactivityTimeout. */ + public inactivityTimeout?: (google.protobuf.IDuration|null); + + /** AudioProcessingConfig ambientSoundConfig. */ + public ambientSoundConfig?: (google.cloud.ces.v1beta.IAmbientSoundConfig|null); + + /** + * Creates a new AudioProcessingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AudioProcessingConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IAudioProcessingConfig): google.cloud.ces.v1beta.AudioProcessingConfig; + + /** + * Encodes the specified AudioProcessingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.AudioProcessingConfig.verify|verify} messages. + * @param message AudioProcessingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IAudioProcessingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AudioProcessingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AudioProcessingConfig.verify|verify} messages. + * @param message AudioProcessingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IAudioProcessingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AudioProcessingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AudioProcessingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AudioProcessingConfig; + + /** + * Decodes an AudioProcessingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AudioProcessingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AudioProcessingConfig; + + /** + * Verifies an AudioProcessingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AudioProcessingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AudioProcessingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AudioProcessingConfig; + + /** + * Creates a plain object from an AudioProcessingConfig message. Also converts values to other types if specified. + * @param message AudioProcessingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AudioProcessingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AudioProcessingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AudioProcessingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AmbientSoundConfig. */ + interface IAmbientSoundConfig { + + /** AmbientSoundConfig prebuiltAmbientNoise */ + prebuiltAmbientNoise?: (google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise|keyof typeof google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise|null); + + /** AmbientSoundConfig gcsUri */ + gcsUri?: (string|null); + + /** AmbientSoundConfig prebuiltAmbientSound */ + prebuiltAmbientSound?: (string|null); + + /** AmbientSoundConfig volumeGainDb */ + volumeGainDb?: (number|null); + } + + /** Represents an AmbientSoundConfig. */ + class AmbientSoundConfig implements IAmbientSoundConfig { + + /** + * Constructs a new AmbientSoundConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IAmbientSoundConfig); + + /** AmbientSoundConfig prebuiltAmbientNoise. */ + public prebuiltAmbientNoise?: (google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise|keyof typeof google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise|null); + + /** AmbientSoundConfig gcsUri. */ + public gcsUri?: (string|null); + + /** AmbientSoundConfig prebuiltAmbientSound. */ + public prebuiltAmbientSound?: (string|null); + + /** AmbientSoundConfig volumeGainDb. */ + public volumeGainDb: number; + + /** AmbientSoundConfig source. */ + public source?: ("prebuiltAmbientNoise"|"gcsUri"|"prebuiltAmbientSound"); + + /** + * Creates a new AmbientSoundConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AmbientSoundConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IAmbientSoundConfig): google.cloud.ces.v1beta.AmbientSoundConfig; + + /** + * Encodes the specified AmbientSoundConfig message. Does not implicitly {@link google.cloud.ces.v1beta.AmbientSoundConfig.verify|verify} messages. + * @param message AmbientSoundConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IAmbientSoundConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AmbientSoundConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AmbientSoundConfig.verify|verify} messages. + * @param message AmbientSoundConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IAmbientSoundConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AmbientSoundConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AmbientSoundConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AmbientSoundConfig; + + /** + * Decodes an AmbientSoundConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AmbientSoundConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AmbientSoundConfig; + + /** + * Verifies an AmbientSoundConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AmbientSoundConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AmbientSoundConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AmbientSoundConfig; + + /** + * Creates a plain object from an AmbientSoundConfig message. Also converts values to other types if specified. + * @param message AmbientSoundConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AmbientSoundConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AmbientSoundConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AmbientSoundConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AmbientSoundConfig { + + /** PrebuiltAmbientNoise enum. */ + enum PrebuiltAmbientNoise { + PREBUILT_AMBIENT_NOISE_UNSPECIFIED = 0, + RETAIL_STORE = 1, + CONVENTION_HALL = 2, + OUTDOOR = 3 + } + } + + /** Properties of a BargeInConfig. */ + interface IBargeInConfig { + + /** BargeInConfig disableBargeIn */ + disableBargeIn?: (boolean|null); + + /** BargeInConfig bargeInAwareness */ + bargeInAwareness?: (boolean|null); + } + + /** Represents a BargeInConfig. */ + class BargeInConfig implements IBargeInConfig { + + /** + * Constructs a new BargeInConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IBargeInConfig); + + /** BargeInConfig disableBargeIn. */ + public disableBargeIn: boolean; + + /** BargeInConfig bargeInAwareness. */ + public bargeInAwareness: boolean; + + /** + * Creates a new BargeInConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BargeInConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IBargeInConfig): google.cloud.ces.v1beta.BargeInConfig; + + /** + * Encodes the specified BargeInConfig message. Does not implicitly {@link google.cloud.ces.v1beta.BargeInConfig.verify|verify} messages. + * @param message BargeInConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IBargeInConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BargeInConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BargeInConfig.verify|verify} messages. + * @param message BargeInConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IBargeInConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BargeInConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BargeInConfig; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BargeInConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BargeInConfig; + + /** + * Verifies a BargeInConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BargeInConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BargeInConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BargeInConfig; + + /** + * Creates a plain object from a BargeInConfig message. Also converts values to other types if specified. + * @param message BargeInConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.BargeInConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BargeInConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BargeInConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SynthesizeSpeechConfig. */ + interface ISynthesizeSpeechConfig { + + /** SynthesizeSpeechConfig voice */ + voice?: (string|null); + + /** SynthesizeSpeechConfig speakingRate */ + speakingRate?: (number|null); + } + + /** Represents a SynthesizeSpeechConfig. */ + class SynthesizeSpeechConfig implements ISynthesizeSpeechConfig { + + /** + * Constructs a new SynthesizeSpeechConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ISynthesizeSpeechConfig); + + /** SynthesizeSpeechConfig voice. */ + public voice: string; + + /** SynthesizeSpeechConfig speakingRate. */ + public speakingRate: number; + + /** + * Creates a new SynthesizeSpeechConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SynthesizeSpeechConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.ISynthesizeSpeechConfig): google.cloud.ces.v1beta.SynthesizeSpeechConfig; + + /** + * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.ces.v1beta.SynthesizeSpeechConfig.verify|verify} messages. + * @param message SynthesizeSpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SynthesizeSpeechConfig.verify|verify} messages. + * @param message SynthesizeSpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SynthesizeSpeechConfig; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SynthesizeSpeechConfig; + + /** + * Verifies a SynthesizeSpeechConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SynthesizeSpeechConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SynthesizeSpeechConfig; + + /** + * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. + * @param message SynthesizeSpeechConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.SynthesizeSpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SynthesizeSpeechConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SynthesizeSpeechConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetricAnalysisSettings. */ + interface IMetricAnalysisSettings { + + /** MetricAnalysisSettings llmMetricsOptedOut */ + llmMetricsOptedOut?: (boolean|null); + } + + /** Represents a MetricAnalysisSettings. */ + class MetricAnalysisSettings implements IMetricAnalysisSettings { + + /** + * Constructs a new MetricAnalysisSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IMetricAnalysisSettings); + + /** MetricAnalysisSettings llmMetricsOptedOut. */ + public llmMetricsOptedOut: boolean; + + /** + * Creates a new MetricAnalysisSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricAnalysisSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.IMetricAnalysisSettings): google.cloud.ces.v1beta.MetricAnalysisSettings; + + /** + * Encodes the specified MetricAnalysisSettings message. Does not implicitly {@link google.cloud.ces.v1beta.MetricAnalysisSettings.verify|verify} messages. + * @param message MetricAnalysisSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IMetricAnalysisSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricAnalysisSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.MetricAnalysisSettings.verify|verify} messages. + * @param message MetricAnalysisSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IMetricAnalysisSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricAnalysisSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricAnalysisSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.MetricAnalysisSettings; + + /** + * Decodes a MetricAnalysisSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricAnalysisSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.MetricAnalysisSettings; + + /** + * Verifies a MetricAnalysisSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetricAnalysisSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricAnalysisSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.MetricAnalysisSettings; + + /** + * Creates a plain object from a MetricAnalysisSettings message. Also converts values to other types if specified. + * @param message MetricAnalysisSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.MetricAnalysisSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricAnalysisSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricAnalysisSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LoggingSettings. */ + interface ILoggingSettings { + + /** LoggingSettings redactionConfig */ + redactionConfig?: (google.cloud.ces.v1beta.IRedactionConfig|null); + + /** LoggingSettings audioRecordingConfig */ + audioRecordingConfig?: (google.cloud.ces.v1beta.IAudioRecordingConfig|null); + + /** LoggingSettings bigqueryExportSettings */ + bigqueryExportSettings?: (google.cloud.ces.v1beta.IBigQueryExportSettings|null); + + /** LoggingSettings cloudLoggingSettings */ + cloudLoggingSettings?: (google.cloud.ces.v1beta.ICloudLoggingSettings|null); + + /** LoggingSettings conversationLoggingSettings */ + conversationLoggingSettings?: (google.cloud.ces.v1beta.IConversationLoggingSettings|null); + + /** LoggingSettings evaluationAudioRecordingConfig */ + evaluationAudioRecordingConfig?: (google.cloud.ces.v1beta.IAudioRecordingConfig|null); + + /** LoggingSettings metricAnalysisSettings */ + metricAnalysisSettings?: (google.cloud.ces.v1beta.IMetricAnalysisSettings|null); + } + + /** Represents a LoggingSettings. */ + class LoggingSettings implements ILoggingSettings { + + /** + * Constructs a new LoggingSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ILoggingSettings); + + /** LoggingSettings redactionConfig. */ + public redactionConfig?: (google.cloud.ces.v1beta.IRedactionConfig|null); + + /** LoggingSettings audioRecordingConfig. */ + public audioRecordingConfig?: (google.cloud.ces.v1beta.IAudioRecordingConfig|null); + + /** LoggingSettings bigqueryExportSettings. */ + public bigqueryExportSettings?: (google.cloud.ces.v1beta.IBigQueryExportSettings|null); + + /** LoggingSettings cloudLoggingSettings. */ + public cloudLoggingSettings?: (google.cloud.ces.v1beta.ICloudLoggingSettings|null); + + /** LoggingSettings conversationLoggingSettings. */ + public conversationLoggingSettings?: (google.cloud.ces.v1beta.IConversationLoggingSettings|null); + + /** LoggingSettings evaluationAudioRecordingConfig. */ + public evaluationAudioRecordingConfig?: (google.cloud.ces.v1beta.IAudioRecordingConfig|null); + + /** LoggingSettings metricAnalysisSettings. */ + public metricAnalysisSettings?: (google.cloud.ces.v1beta.IMetricAnalysisSettings|null); + + /** + * Creates a new LoggingSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns LoggingSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.ILoggingSettings): google.cloud.ces.v1beta.LoggingSettings; + + /** + * Encodes the specified LoggingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.LoggingSettings.verify|verify} messages. + * @param message LoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ILoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LoggingSettings.verify|verify} messages. + * @param message LoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ILoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LoggingSettings; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LoggingSettings; + + /** + * Verifies a LoggingSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LoggingSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoggingSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LoggingSettings; + + /** + * Creates a plain object from a LoggingSettings message. Also converts values to other types if specified. + * @param message LoggingSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.LoggingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoggingSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoggingSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ErrorHandlingSettings. */ + interface IErrorHandlingSettings { + + /** ErrorHandlingSettings errorHandlingStrategy */ + errorHandlingStrategy?: (google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy|keyof typeof google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy|null); + } + + /** Represents an ErrorHandlingSettings. */ + class ErrorHandlingSettings implements IErrorHandlingSettings { + + /** + * Constructs a new ErrorHandlingSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IErrorHandlingSettings); + + /** ErrorHandlingSettings errorHandlingStrategy. */ + public errorHandlingStrategy: (google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy|keyof typeof google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy); + + /** + * Creates a new ErrorHandlingSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ErrorHandlingSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.IErrorHandlingSettings): google.cloud.ces.v1beta.ErrorHandlingSettings; + + /** + * Encodes the specified ErrorHandlingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ErrorHandlingSettings.verify|verify} messages. + * @param message ErrorHandlingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IErrorHandlingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ErrorHandlingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ErrorHandlingSettings.verify|verify} messages. + * @param message ErrorHandlingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IErrorHandlingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ErrorHandlingSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ErrorHandlingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ErrorHandlingSettings; + + /** + * Decodes an ErrorHandlingSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ErrorHandlingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ErrorHandlingSettings; + + /** + * Verifies an ErrorHandlingSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ErrorHandlingSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ErrorHandlingSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ErrorHandlingSettings; + + /** + * Creates a plain object from an ErrorHandlingSettings message. Also converts values to other types if specified. + * @param message ErrorHandlingSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ErrorHandlingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ErrorHandlingSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ErrorHandlingSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ErrorHandlingSettings { + + /** ErrorHandlingStrategy enum. */ + enum ErrorHandlingStrategy { + ERROR_HANDLING_STRATEGY_UNSPECIFIED = 0, + NONE = 1, + FALLBACK_RESPONSE = 2 + } + } + + /** Properties of an EvaluationMetricsThresholds. */ + interface IEvaluationMetricsThresholds { + + /** EvaluationMetricsThresholds goldenEvaluationMetricsThresholds */ + goldenEvaluationMetricsThresholds?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null); + + /** EvaluationMetricsThresholds hallucinationMetricBehavior */ + hallucinationMetricBehavior?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|null); + + /** EvaluationMetricsThresholds goldenHallucinationMetricBehavior */ + goldenHallucinationMetricBehavior?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|null); + + /** EvaluationMetricsThresholds scenarioHallucinationMetricBehavior */ + scenarioHallucinationMetricBehavior?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|null); + } + + /** Represents an EvaluationMetricsThresholds. */ + class EvaluationMetricsThresholds implements IEvaluationMetricsThresholds { + + /** + * Constructs a new EvaluationMetricsThresholds. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluationMetricsThresholds); + + /** EvaluationMetricsThresholds goldenEvaluationMetricsThresholds. */ + public goldenEvaluationMetricsThresholds?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null); + + /** EvaluationMetricsThresholds hallucinationMetricBehavior. */ + public hallucinationMetricBehavior: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior); + + /** EvaluationMetricsThresholds goldenHallucinationMetricBehavior. */ + public goldenHallucinationMetricBehavior: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior); + + /** EvaluationMetricsThresholds scenarioHallucinationMetricBehavior. */ + public scenarioHallucinationMetricBehavior: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior); + + /** + * Creates a new EvaluationMetricsThresholds instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationMetricsThresholds instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluationMetricsThresholds): google.cloud.ces.v1beta.EvaluationMetricsThresholds; + + /** + * Encodes the specified EvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.verify|verify} messages. + * @param message EvaluationMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.verify|verify} messages. + * @param message EvaluationMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationMetricsThresholds; + + /** + * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationMetricsThresholds; + + /** + * Verifies an EvaluationMetricsThresholds message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationMetricsThresholds + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationMetricsThresholds; + + /** + * Creates a plain object from an EvaluationMetricsThresholds message. Also converts values to other types if specified. + * @param message EvaluationMetricsThresholds + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationMetricsThresholds to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationMetricsThresholds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EvaluationMetricsThresholds { + + /** Properties of a GoldenEvaluationMetricsThresholds. */ + interface IGoldenEvaluationMetricsThresholds { + + /** GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds */ + turnLevelMetricsThresholds?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null); + + /** GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds */ + expectationLevelMetricsThresholds?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null); + + /** GoldenEvaluationMetricsThresholds toolMatchingSettings */ + toolMatchingSettings?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings|null); + } + + /** Represents a GoldenEvaluationMetricsThresholds. */ + class GoldenEvaluationMetricsThresholds implements IGoldenEvaluationMetricsThresholds { + + /** + * Constructs a new GoldenEvaluationMetricsThresholds. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds); + + /** GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds. */ + public turnLevelMetricsThresholds?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null); + + /** GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds. */ + public expectationLevelMetricsThresholds?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null); + + /** GoldenEvaluationMetricsThresholds toolMatchingSettings. */ + public toolMatchingSettings?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings|null); + + /** + * Creates a new GoldenEvaluationMetricsThresholds instance using the specified properties. + * @param [properties] Properties to set + * @returns GoldenEvaluationMetricsThresholds instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; + + /** + * Encodes the specified GoldenEvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. + * @param message GoldenEvaluationMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoldenEvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. + * @param message GoldenEvaluationMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoldenEvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; + + /** + * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoldenEvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; + + /** + * Verifies a GoldenEvaluationMetricsThresholds message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoldenEvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoldenEvaluationMetricsThresholds + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds; + + /** + * Creates a plain object from a GoldenEvaluationMetricsThresholds message. Also converts values to other types if specified. + * @param message GoldenEvaluationMetricsThresholds + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoldenEvaluationMetricsThresholds to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoldenEvaluationMetricsThresholds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GoldenEvaluationMetricsThresholds { + + /** Properties of a TurnLevelMetricsThresholds. */ + interface ITurnLevelMetricsThresholds { + + /** TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold */ + semanticSimilaritySuccessThreshold?: (number|null); + + /** TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold */ + overallToolInvocationCorrectnessThreshold?: (number|null); + + /** TurnLevelMetricsThresholds semanticSimilarityChannel */ + semanticSimilarityChannel?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|null); + } + + /** Represents a TurnLevelMetricsThresholds. */ + class TurnLevelMetricsThresholds implements ITurnLevelMetricsThresholds { + + /** + * Constructs a new TurnLevelMetricsThresholds. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds); + + /** TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold. */ + public semanticSimilaritySuccessThreshold?: (number|null); + + /** TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold. */ + public overallToolInvocationCorrectnessThreshold?: (number|null); + + /** TurnLevelMetricsThresholds semanticSimilarityChannel. */ + public semanticSimilarityChannel: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel); + + /** + * Creates a new TurnLevelMetricsThresholds instance using the specified properties. + * @param [properties] Properties to set + * @returns TurnLevelMetricsThresholds instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; + + /** + * Encodes the specified TurnLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. + * @param message TurnLevelMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TurnLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. + * @param message TurnLevelMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TurnLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; + + /** + * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TurnLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; + + /** + * Verifies a TurnLevelMetricsThresholds message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TurnLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TurnLevelMetricsThresholds + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds; + + /** + * Creates a plain object from a TurnLevelMetricsThresholds message. Also converts values to other types if specified. + * @param message TurnLevelMetricsThresholds + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TurnLevelMetricsThresholds to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TurnLevelMetricsThresholds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TurnLevelMetricsThresholds { + + /** SemanticSimilarityChannel enum. */ + enum SemanticSimilarityChannel { + SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED = 0, + TEXT = 1, + AUDIO = 2 + } + } + + /** Properties of an ExpectationLevelMetricsThresholds. */ + interface IExpectationLevelMetricsThresholds { + + /** ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold */ + toolInvocationParameterCorrectnessThreshold?: (number|null); + } + + /** Represents an ExpectationLevelMetricsThresholds. */ + class ExpectationLevelMetricsThresholds implements IExpectationLevelMetricsThresholds { + + /** + * Constructs a new ExpectationLevelMetricsThresholds. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds); + + /** ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold. */ + public toolInvocationParameterCorrectnessThreshold?: (number|null); + + /** + * Creates a new ExpectationLevelMetricsThresholds instance using the specified properties. + * @param [properties] Properties to set + * @returns ExpectationLevelMetricsThresholds instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; + + /** + * Encodes the specified ExpectationLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. + * @param message ExpectationLevelMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExpectationLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. + * @param message ExpectationLevelMetricsThresholds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExpectationLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; + + /** + * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExpectationLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; + + /** + * Verifies an ExpectationLevelMetricsThresholds message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExpectationLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExpectationLevelMetricsThresholds + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds; + + /** + * Creates a plain object from an ExpectationLevelMetricsThresholds message. Also converts values to other types if specified. + * @param message ExpectationLevelMetricsThresholds + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExpectationLevelMetricsThresholds to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExpectationLevelMetricsThresholds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ToolMatchingSettings. */ + interface IToolMatchingSettings { + + /** ToolMatchingSettings extraToolCallBehavior */ + extraToolCallBehavior?: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|null); + } + + /** Represents a ToolMatchingSettings. */ + class ToolMatchingSettings implements IToolMatchingSettings { + + /** + * Constructs a new ToolMatchingSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings); + + /** ToolMatchingSettings extraToolCallBehavior. */ + public extraToolCallBehavior: (google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|keyof typeof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior); + + /** + * Creates a new ToolMatchingSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolMatchingSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings): google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings; + + /** + * Encodes the specified ToolMatchingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. + * @param message ToolMatchingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolMatchingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. + * @param message ToolMatchingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolMatchingSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolMatchingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings; + + /** + * Decodes a ToolMatchingSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolMatchingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings; + + /** + * Verifies a ToolMatchingSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolMatchingSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolMatchingSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings; + + /** + * Creates a plain object from a ToolMatchingSettings message. Also converts values to other types if specified. + * @param message ToolMatchingSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolMatchingSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolMatchingSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ToolMatchingSettings { + + /** ExtraToolCallBehavior enum. */ + enum ExtraToolCallBehavior { + EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED = 0, + FAIL = 1, + ALLOW = 2 + } + } + + /** HallucinationMetricBehavior enum. */ + enum HallucinationMetricBehavior { + HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED = 0, + DISABLED = 1, + ENABLED = 2 + } + } + + /** Properties of an EvaluationSettings. */ + interface IEvaluationSettings { + + /** EvaluationSettings scenarioConversationInitiator */ + scenarioConversationInitiator?: (google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator|keyof typeof google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator|null); + + /** EvaluationSettings goldenRunMethod */ + goldenRunMethod?: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod|null); + + /** EvaluationSettings goldenEvaluationToolCallBehaviour */ + goldenEvaluationToolCallBehaviour?: (google.cloud.ces.v1beta.EvaluationToolCallBehaviour|keyof typeof google.cloud.ces.v1beta.EvaluationToolCallBehaviour|null); + + /** EvaluationSettings scenarioEvaluationToolCallBehaviour */ + scenarioEvaluationToolCallBehaviour?: (google.cloud.ces.v1beta.EvaluationToolCallBehaviour|keyof typeof google.cloud.ces.v1beta.EvaluationToolCallBehaviour|null); + } + + /** Represents an EvaluationSettings. */ + class EvaluationSettings implements IEvaluationSettings { + + /** + * Constructs a new EvaluationSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluationSettings); + + /** EvaluationSettings scenarioConversationInitiator. */ + public scenarioConversationInitiator: (google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator|keyof typeof google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator); + + /** EvaluationSettings goldenRunMethod. */ + public goldenRunMethod: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod); + + /** EvaluationSettings goldenEvaluationToolCallBehaviour. */ + public goldenEvaluationToolCallBehaviour: (google.cloud.ces.v1beta.EvaluationToolCallBehaviour|keyof typeof google.cloud.ces.v1beta.EvaluationToolCallBehaviour); + + /** EvaluationSettings scenarioEvaluationToolCallBehaviour. */ + public scenarioEvaluationToolCallBehaviour: (google.cloud.ces.v1beta.EvaluationToolCallBehaviour|keyof typeof google.cloud.ces.v1beta.EvaluationToolCallBehaviour); + + /** + * Creates a new EvaluationSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluationSettings): google.cloud.ces.v1beta.EvaluationSettings; + + /** + * Encodes the specified EvaluationSettings message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationSettings.verify|verify} messages. + * @param message EvaluationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationSettings.verify|verify} messages. + * @param message EvaluationSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationSettings; + + /** + * Decodes an EvaluationSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationSettings; + + /** + * Verifies an EvaluationSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationSettings; + + /** + * Creates a plain object from an EvaluationSettings message. Also converts values to other types if specified. + * @param message EvaluationSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EvaluationSettings { + + /** ScenarioConversationInitiator enum. */ + enum ScenarioConversationInitiator { + SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED = 0, + USER = 1, + AGENT = 2 + } + } + + /** Properties of a ClientCertificateSettings. */ + interface IClientCertificateSettings { + + /** ClientCertificateSettings tlsCertificate */ + tlsCertificate?: (string|null); + + /** ClientCertificateSettings privateKey */ + privateKey?: (string|null); + + /** ClientCertificateSettings passphrase */ + passphrase?: (string|null); + } + + /** Represents a ClientCertificateSettings. */ + class ClientCertificateSettings implements IClientCertificateSettings { + + /** + * Constructs a new ClientCertificateSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IClientCertificateSettings); + + /** ClientCertificateSettings tlsCertificate. */ + public tlsCertificate: string; + + /** ClientCertificateSettings privateKey. */ + public privateKey: string; + + /** ClientCertificateSettings passphrase. */ + public passphrase: string; + + /** + * Creates a new ClientCertificateSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientCertificateSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.IClientCertificateSettings): google.cloud.ces.v1beta.ClientCertificateSettings; + + /** + * Encodes the specified ClientCertificateSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ClientCertificateSettings.verify|verify} messages. + * @param message ClientCertificateSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IClientCertificateSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientCertificateSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ClientCertificateSettings.verify|verify} messages. + * @param message ClientCertificateSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IClientCertificateSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientCertificateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ClientCertificateSettings; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientCertificateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ClientCertificateSettings; + + /** + * Verifies a ClientCertificateSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientCertificateSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientCertificateSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ClientCertificateSettings; + + /** + * Creates a plain object from a ClientCertificateSettings message. Also converts values to other types if specified. + * @param message ClientCertificateSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ClientCertificateSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientCertificateSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientCertificateSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConversationLoggingSettings. */ + interface IConversationLoggingSettings { + + /** ConversationLoggingSettings disableConversationLogging */ + disableConversationLogging?: (boolean|null); + } + + /** Represents a ConversationLoggingSettings. */ + class ConversationLoggingSettings implements IConversationLoggingSettings { + + /** + * Constructs a new ConversationLoggingSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IConversationLoggingSettings); + + /** ConversationLoggingSettings disableConversationLogging. */ + public disableConversationLogging: boolean; + + /** + * Creates a new ConversationLoggingSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversationLoggingSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.IConversationLoggingSettings): google.cloud.ces.v1beta.ConversationLoggingSettings; + + /** + * Encodes the specified ConversationLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ConversationLoggingSettings.verify|verify} messages. + * @param message ConversationLoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IConversationLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConversationLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ConversationLoggingSettings.verify|verify} messages. + * @param message ConversationLoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IConversationLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConversationLoggingSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversationLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ConversationLoggingSettings; + + /** + * Decodes a ConversationLoggingSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversationLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ConversationLoggingSettings; + + /** + * Verifies a ConversationLoggingSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConversationLoggingSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversationLoggingSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ConversationLoggingSettings; + + /** + * Creates a plain object from a ConversationLoggingSettings message. Also converts values to other types if specified. + * @param message ConversationLoggingSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ConversationLoggingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConversationLoggingSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConversationLoggingSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudLoggingSettings. */ + interface ICloudLoggingSettings { + + /** CloudLoggingSettings enableCloudLogging */ + enableCloudLogging?: (boolean|null); + } + + /** Represents a CloudLoggingSettings. */ + class CloudLoggingSettings implements ICloudLoggingSettings { + + /** + * Constructs a new CloudLoggingSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICloudLoggingSettings); + + /** CloudLoggingSettings enableCloudLogging. */ + public enableCloudLogging: boolean; + + /** + * Creates a new CloudLoggingSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudLoggingSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICloudLoggingSettings): google.cloud.ces.v1beta.CloudLoggingSettings; + + /** + * Encodes the specified CloudLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.CloudLoggingSettings.verify|verify} messages. + * @param message CloudLoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICloudLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CloudLoggingSettings.verify|verify} messages. + * @param message CloudLoggingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICloudLoggingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudLoggingSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CloudLoggingSettings; + + /** + * Decodes a CloudLoggingSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CloudLoggingSettings; + + /** + * Verifies a CloudLoggingSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudLoggingSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudLoggingSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CloudLoggingSettings; + + /** + * Creates a plain object from a CloudLoggingSettings message. Also converts values to other types if specified. + * @param message CloudLoggingSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CloudLoggingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudLoggingSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudLoggingSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AudioRecordingConfig. */ + interface IAudioRecordingConfig { + + /** AudioRecordingConfig gcsBucket */ + gcsBucket?: (string|null); + + /** AudioRecordingConfig gcsPathPrefix */ + gcsPathPrefix?: (string|null); + } + + /** Represents an AudioRecordingConfig. */ + class AudioRecordingConfig implements IAudioRecordingConfig { + + /** + * Constructs a new AudioRecordingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IAudioRecordingConfig); + + /** AudioRecordingConfig gcsBucket. */ + public gcsBucket: string; + + /** AudioRecordingConfig gcsPathPrefix. */ + public gcsPathPrefix: string; + + /** + * Creates a new AudioRecordingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AudioRecordingConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IAudioRecordingConfig): google.cloud.ces.v1beta.AudioRecordingConfig; + + /** + * Encodes the specified AudioRecordingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.AudioRecordingConfig.verify|verify} messages. + * @param message AudioRecordingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IAudioRecordingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AudioRecordingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AudioRecordingConfig.verify|verify} messages. + * @param message AudioRecordingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IAudioRecordingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AudioRecordingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AudioRecordingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AudioRecordingConfig; + + /** + * Decodes an AudioRecordingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AudioRecordingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AudioRecordingConfig; + + /** + * Verifies an AudioRecordingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AudioRecordingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AudioRecordingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AudioRecordingConfig; + + /** + * Creates a plain object from an AudioRecordingConfig message. Also converts values to other types if specified. + * @param message AudioRecordingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AudioRecordingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AudioRecordingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AudioRecordingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RedactionConfig. */ + interface IRedactionConfig { + + /** RedactionConfig enableRedaction */ + enableRedaction?: (boolean|null); + + /** RedactionConfig inspectTemplate */ + inspectTemplate?: (string|null); + + /** RedactionConfig deidentifyTemplate */ + deidentifyTemplate?: (string|null); + } + + /** Represents a RedactionConfig. */ + class RedactionConfig implements IRedactionConfig { + + /** + * Constructs a new RedactionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRedactionConfig); + + /** RedactionConfig enableRedaction. */ + public enableRedaction: boolean; + + /** RedactionConfig inspectTemplate. */ + public inspectTemplate: string; + + /** RedactionConfig deidentifyTemplate. */ + public deidentifyTemplate: string; + + /** + * Creates a new RedactionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RedactionConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRedactionConfig): google.cloud.ces.v1beta.RedactionConfig; + + /** + * Encodes the specified RedactionConfig message. Does not implicitly {@link google.cloud.ces.v1beta.RedactionConfig.verify|verify} messages. + * @param message RedactionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRedactionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RedactionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RedactionConfig.verify|verify} messages. + * @param message RedactionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRedactionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RedactionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RedactionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RedactionConfig; + + /** + * Decodes a RedactionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RedactionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RedactionConfig; + + /** + * Verifies a RedactionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RedactionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RedactionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RedactionConfig; + + /** + * Creates a plain object from a RedactionConfig message. Also converts values to other types if specified. + * @param message RedactionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RedactionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RedactionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RedactionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataStoreSettings. */ + interface IDataStoreSettings { + + /** DataStoreSettings engines */ + engines?: (google.cloud.ces.v1beta.DataStoreSettings.IEngine[]|null); + } + + /** Represents a DataStoreSettings. */ + class DataStoreSettings implements IDataStoreSettings { + + /** + * Constructs a new DataStoreSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDataStoreSettings); + + /** DataStoreSettings engines. */ + public engines: google.cloud.ces.v1beta.DataStoreSettings.IEngine[]; + + /** + * Creates a new DataStoreSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStoreSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDataStoreSettings): google.cloud.ces.v1beta.DataStoreSettings; + + /** + * Encodes the specified DataStoreSettings message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.verify|verify} messages. + * @param message DataStoreSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDataStoreSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStoreSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.verify|verify} messages. + * @param message DataStoreSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDataStoreSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStoreSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStoreSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreSettings; + + /** + * Decodes a DataStoreSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStoreSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreSettings; + + /** + * Verifies a DataStoreSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataStoreSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStoreSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreSettings; + + /** + * Creates a plain object from a DataStoreSettings message. Also converts values to other types if specified. + * @param message DataStoreSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStoreSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStoreSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataStoreSettings { + + /** Properties of an Engine. */ + interface IEngine { + + /** Engine name */ + name?: (string|null); + + /** Engine type */ + type?: (google.cloud.ces.v1beta.DataStoreSettings.Engine.Type|keyof typeof google.cloud.ces.v1beta.DataStoreSettings.Engine.Type|null); + } + + /** Represents an Engine. */ + class Engine implements IEngine { + + /** + * Constructs a new Engine. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreSettings.IEngine); + + /** Engine name. */ + public name: string; + + /** Engine type. */ + public type: (google.cloud.ces.v1beta.DataStoreSettings.Engine.Type|keyof typeof google.cloud.ces.v1beta.DataStoreSettings.Engine.Type); + + /** + * Creates a new Engine instance using the specified properties. + * @param [properties] Properties to set + * @returns Engine instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreSettings.IEngine): google.cloud.ces.v1beta.DataStoreSettings.Engine; + + /** + * Encodes the specified Engine message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.Engine.verify|verify} messages. + * @param message Engine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreSettings.IEngine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Engine message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.Engine.verify|verify} messages. + * @param message Engine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreSettings.IEngine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Engine message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Engine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreSettings.Engine; + + /** + * Decodes an Engine message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Engine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreSettings.Engine; + + /** + * Verifies an Engine message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Engine message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Engine + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreSettings.Engine; + + /** + * Creates a plain object from an Engine message. Also converts values to other types if specified. + * @param message Engine + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreSettings.Engine, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Engine to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Engine + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Engine { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + ENGINE_TYPE_SEARCH = 1, + ENGINE_TYPE_CHAT = 2 + } + } + } + + /** Properties of an EvaluationPersona. */ + interface IEvaluationPersona { + + /** EvaluationPersona name */ + name?: (string|null); + + /** EvaluationPersona description */ + description?: (string|null); + + /** EvaluationPersona displayName */ + displayName?: (string|null); + + /** EvaluationPersona personality */ + personality?: (string|null); + + /** EvaluationPersona speechConfig */ + speechConfig?: (google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig|null); + } + + /** Represents an EvaluationPersona. */ + class EvaluationPersona implements IEvaluationPersona { + + /** + * Constructs a new EvaluationPersona. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluationPersona); + + /** EvaluationPersona name. */ + public name: string; + + /** EvaluationPersona description. */ + public description: string; + + /** EvaluationPersona displayName. */ + public displayName: string; + + /** EvaluationPersona personality. */ + public personality: string; + + /** EvaluationPersona speechConfig. */ + public speechConfig?: (google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig|null); + + /** + * Creates a new EvaluationPersona instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationPersona instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluationPersona): google.cloud.ces.v1beta.EvaluationPersona; + + /** + * Encodes the specified EvaluationPersona message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.verify|verify} messages. + * @param message EvaluationPersona message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluationPersona, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationPersona message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.verify|verify} messages. + * @param message EvaluationPersona message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationPersona, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationPersona message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationPersona + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationPersona; + + /** + * Decodes an EvaluationPersona message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationPersona + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationPersona; + + /** + * Verifies an EvaluationPersona message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationPersona message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationPersona + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationPersona; + + /** + * Creates a plain object from an EvaluationPersona message. Also converts values to other types if specified. + * @param message EvaluationPersona + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationPersona, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationPersona to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationPersona + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EvaluationPersona { + + /** Properties of a SpeechConfig. */ + interface ISpeechConfig { + + /** SpeechConfig speakingRate */ + speakingRate?: (number|null); + + /** SpeechConfig environment */ + environment?: (google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment|keyof typeof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment|null); + + /** SpeechConfig voiceId */ + voiceId?: (string|null); + } + + /** Represents a SpeechConfig. */ + class SpeechConfig implements ISpeechConfig { + + /** + * Constructs a new SpeechConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig); + + /** SpeechConfig speakingRate. */ + public speakingRate: number; + + /** SpeechConfig environment. */ + public environment: (google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment|keyof typeof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment); + + /** SpeechConfig voiceId. */ + public voiceId: string; + + /** + * Creates a new SpeechConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig): google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig; + + /** + * Encodes the specified SpeechConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.verify|verify} messages. + * @param message SpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.verify|verify} messages. + * @param message SpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig; + + /** + * Verifies a SpeechConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig; + + /** + * Creates a plain object from a SpeechConfig message. Also converts values to other types if specified. + * @param message SpeechConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SpeechConfig { + + /** BackgroundEnvironment enum. */ + enum BackgroundEnvironment { + BACKGROUND_ENVIRONMENT_UNSPECIFIED = 0, + CALL_CENTER = 3, + TRAFFIC = 4, + KIDS_NOISE = 5, + CAFE = 6 + } + } + } + + /** Properties of a BigQueryExportSettings. */ + interface IBigQueryExportSettings { + + /** BigQueryExportSettings enabled */ + enabled?: (boolean|null); + + /** BigQueryExportSettings project */ + project?: (string|null); + + /** BigQueryExportSettings dataset */ + dataset?: (string|null); + } + + /** Represents a BigQueryExportSettings. */ + class BigQueryExportSettings implements IBigQueryExportSettings { + + /** + * Constructs a new BigQueryExportSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IBigQueryExportSettings); + + /** BigQueryExportSettings enabled. */ + public enabled: boolean; + + /** BigQueryExportSettings project. */ + public project: string; + + /** BigQueryExportSettings dataset. */ + public dataset: string; + + /** + * Creates a new BigQueryExportSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryExportSettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.IBigQueryExportSettings): google.cloud.ces.v1beta.BigQueryExportSettings; + + /** + * Encodes the specified BigQueryExportSettings message. Does not implicitly {@link google.cloud.ces.v1beta.BigQueryExportSettings.verify|verify} messages. + * @param message BigQueryExportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IBigQueryExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryExportSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BigQueryExportSettings.verify|verify} messages. + * @param message BigQueryExportSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IBigQueryExportSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryExportSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BigQueryExportSettings; + + /** + * Decodes a BigQueryExportSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BigQueryExportSettings; + + /** + * Verifies a BigQueryExportSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQueryExportSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryExportSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BigQueryExportSettings; + + /** + * Creates a plain object from a BigQueryExportSettings message. Also converts values to other types if specified. + * @param message BigQueryExportSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.BigQueryExportSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryExportSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryExportSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** EvaluationToolCallBehaviour enum. */ + enum EvaluationToolCallBehaviour { + EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED = 0, + REAL = 1, + FAKE = 2 + } + + /** Properties of a CodeBlock. */ + interface ICodeBlock { + + /** CodeBlock pythonCode */ + pythonCode?: (string|null); + } + + /** Represents a CodeBlock. */ + class CodeBlock implements ICodeBlock { + + /** + * Constructs a new CodeBlock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICodeBlock); + + /** CodeBlock pythonCode. */ + public pythonCode: string; + + /** + * Creates a new CodeBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns CodeBlock instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICodeBlock): google.cloud.ces.v1beta.CodeBlock; + + /** + * Encodes the specified CodeBlock message. Does not implicitly {@link google.cloud.ces.v1beta.CodeBlock.verify|verify} messages. + * @param message CodeBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICodeBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CodeBlock message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CodeBlock.verify|verify} messages. + * @param message CodeBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICodeBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CodeBlock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CodeBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CodeBlock; + + /** + * Decodes a CodeBlock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CodeBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CodeBlock; + + /** + * Verifies a CodeBlock message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CodeBlock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CodeBlock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CodeBlock; + + /** + * Creates a plain object from a CodeBlock message. Also converts values to other types if specified. + * @param message CodeBlock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CodeBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CodeBlock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CodeBlock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolFakeConfig. */ + interface IToolFakeConfig { + + /** ToolFakeConfig codeBlock */ + codeBlock?: (google.cloud.ces.v1beta.ICodeBlock|null); + + /** ToolFakeConfig enableFakeMode */ + enableFakeMode?: (boolean|null); + } + + /** Represents a ToolFakeConfig. */ + class ToolFakeConfig implements IToolFakeConfig { + + /** + * Constructs a new ToolFakeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IToolFakeConfig); + + /** ToolFakeConfig codeBlock. */ + public codeBlock?: (google.cloud.ces.v1beta.ICodeBlock|null); + + /** ToolFakeConfig enableFakeMode. */ + public enableFakeMode: boolean; + + /** ToolFakeConfig toolResponse. */ + public toolResponse?: "codeBlock"; + + /** + * Creates a new ToolFakeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolFakeConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IToolFakeConfig): google.cloud.ces.v1beta.ToolFakeConfig; + + /** + * Encodes the specified ToolFakeConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ToolFakeConfig.verify|verify} messages. + * @param message ToolFakeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IToolFakeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolFakeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolFakeConfig.verify|verify} messages. + * @param message ToolFakeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IToolFakeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolFakeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolFakeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ToolFakeConfig; + + /** + * Decodes a ToolFakeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolFakeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ToolFakeConfig; + + /** + * Verifies a ToolFakeConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolFakeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolFakeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ToolFakeConfig; + + /** + * Creates a plain object from a ToolFakeConfig message. Also converts values to other types if specified. + * @param message ToolFakeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ToolFakeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolFakeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolFakeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** GoldenRunMethod enum. */ + enum GoldenRunMethod { + GOLDEN_RUN_METHOD_UNSPECIFIED = 0, + STABLE = 1, + NAIVE = 2 + } + + /** Properties of a Schema. */ + interface ISchema { + + /** Schema type */ + type?: (google.cloud.ces.v1beta.Schema.Type|keyof typeof google.cloud.ces.v1beta.Schema.Type|null); + + /** Schema properties */ + properties?: ({ [k: string]: google.cloud.ces.v1beta.ISchema }|null); + + /** Schema required */ + required?: (string[]|null); + + /** Schema description */ + description?: (string|null); + + /** Schema items */ + items?: (google.cloud.ces.v1beta.ISchema|null); + + /** Schema nullable */ + nullable?: (boolean|null); + + /** Schema uniqueItems */ + uniqueItems?: (boolean|null); + + /** Schema prefixItems */ + prefixItems?: (google.cloud.ces.v1beta.ISchema[]|null); + + /** Schema additionalProperties */ + additionalProperties?: (google.cloud.ces.v1beta.ISchema|null); + + /** Schema anyOf */ + anyOf?: (google.cloud.ces.v1beta.ISchema[]|null); + + /** Schema enum */ + "enum"?: (string[]|null); + + /** Schema default */ + "default"?: (google.protobuf.IValue|null); + + /** Schema ref */ + ref?: (string|null); + + /** Schema defs */ + defs?: ({ [k: string]: google.cloud.ces.v1beta.ISchema }|null); + + /** Schema title */ + title?: (string|null); + + /** Schema minItems */ + minItems?: (number|Long|string|null); + + /** Schema maxItems */ + maxItems?: (number|Long|string|null); + + /** Schema minimum */ + minimum?: (number|null); + + /** Schema maximum */ + maximum?: (number|null); + } + + /** Represents a Schema. */ + class Schema implements ISchema { + + /** + * Constructs a new Schema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ISchema); + + /** Schema type. */ + public type: (google.cloud.ces.v1beta.Schema.Type|keyof typeof google.cloud.ces.v1beta.Schema.Type); + + /** Schema properties. */ + public properties: { [k: string]: google.cloud.ces.v1beta.ISchema }; + + /** Schema required. */ + public required: string[]; + + /** Schema description. */ + public description: string; + + /** Schema items. */ + public items?: (google.cloud.ces.v1beta.ISchema|null); + + /** Schema nullable. */ + public nullable: boolean; + + /** Schema uniqueItems. */ + public uniqueItems: boolean; + + /** Schema prefixItems. */ + public prefixItems: google.cloud.ces.v1beta.ISchema[]; + + /** Schema additionalProperties. */ + public additionalProperties?: (google.cloud.ces.v1beta.ISchema|null); + + /** Schema anyOf. */ + public anyOf: google.cloud.ces.v1beta.ISchema[]; + + /** Schema enum. */ + public enum: string[]; + + /** Schema default. */ + public default?: (google.protobuf.IValue|null); + + /** Schema ref. */ + public ref: string; + + /** Schema defs. */ + public defs: { [k: string]: google.cloud.ces.v1beta.ISchema }; + + /** Schema title. */ + public title: string; + + /** Schema minItems. */ + public minItems: (number|Long|string); + + /** Schema maxItems. */ + public maxItems: (number|Long|string); + + /** Schema minimum. */ + public minimum?: (number|null); + + /** Schema maximum. */ + public maximum?: (number|null); + + /** + * Creates a new Schema instance using the specified properties. + * @param [properties] Properties to set + * @returns Schema instance + */ + public static create(properties?: google.cloud.ces.v1beta.ISchema): google.cloud.ces.v1beta.Schema; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.cloud.ces.v1beta.Schema.verify|verify} messages. + * @param message Schema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Schema.verify|verify} messages. + * @param message Schema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Schema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Schema; + + /** + * Decodes a Schema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Schema; + + /** + * Verifies a Schema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Schema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Schema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Schema; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @param message Schema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Schema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Schema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Schema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Schema { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + STRING = 1, + INTEGER = 2, + NUMBER = 3, + BOOLEAN = 4, + OBJECT = 5, + ARRAY = 6 + } + } + + /** Properties of an AppSnapshot. */ + interface IAppSnapshot { + + /** AppSnapshot app */ + app?: (google.cloud.ces.v1beta.IApp|null); + + /** AppSnapshot agents */ + agents?: (google.cloud.ces.v1beta.IAgent[]|null); + + /** AppSnapshot tools */ + tools?: (google.cloud.ces.v1beta.ITool[]|null); + + /** AppSnapshot examples */ + examples?: (google.cloud.ces.v1beta.IExample[]|null); + + /** AppSnapshot guardrails */ + guardrails?: (google.cloud.ces.v1beta.IGuardrail[]|null); + + /** AppSnapshot toolsets */ + toolsets?: (google.cloud.ces.v1beta.IToolset[]|null); + } + + /** Represents an AppSnapshot. */ + class AppSnapshot implements IAppSnapshot { + + /** + * Constructs a new AppSnapshot. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IAppSnapshot); + + /** AppSnapshot app. */ + public app?: (google.cloud.ces.v1beta.IApp|null); + + /** AppSnapshot agents. */ + public agents: google.cloud.ces.v1beta.IAgent[]; + + /** AppSnapshot tools. */ + public tools: google.cloud.ces.v1beta.ITool[]; + + /** AppSnapshot examples. */ + public examples: google.cloud.ces.v1beta.IExample[]; + + /** AppSnapshot guardrails. */ + public guardrails: google.cloud.ces.v1beta.IGuardrail[]; + + /** AppSnapshot toolsets. */ + public toolsets: google.cloud.ces.v1beta.IToolset[]; + + /** + * Creates a new AppSnapshot instance using the specified properties. + * @param [properties] Properties to set + * @returns AppSnapshot instance + */ + public static create(properties?: google.cloud.ces.v1beta.IAppSnapshot): google.cloud.ces.v1beta.AppSnapshot; + + /** + * Encodes the specified AppSnapshot message. Does not implicitly {@link google.cloud.ces.v1beta.AppSnapshot.verify|verify} messages. + * @param message AppSnapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IAppSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppSnapshot message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AppSnapshot.verify|verify} messages. + * @param message AppSnapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IAppSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppSnapshot message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AppSnapshot; + + /** + * Decodes an AppSnapshot message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AppSnapshot; + + /** + * Verifies an AppSnapshot message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AppSnapshot message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppSnapshot + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AppSnapshot; + + /** + * Creates a plain object from an AppSnapshot message. Also converts values to other types if specified. + * @param message AppSnapshot + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AppSnapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppSnapshot to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppSnapshot + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AppVersion. */ + interface IAppVersion { + + /** AppVersion name */ + name?: (string|null); + + /** AppVersion displayName */ + displayName?: (string|null); + + /** AppVersion description */ + description?: (string|null); + + /** AppVersion creator */ + creator?: (string|null); + + /** AppVersion createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** AppVersion snapshot */ + snapshot?: (google.cloud.ces.v1beta.IAppSnapshot|null); + + /** AppVersion etag */ + etag?: (string|null); + } + + /** Represents an AppVersion. */ + class AppVersion implements IAppVersion { + + /** + * Constructs a new AppVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IAppVersion); + + /** AppVersion name. */ + public name: string; + + /** AppVersion displayName. */ + public displayName: string; + + /** AppVersion description. */ + public description: string; + + /** AppVersion creator. */ + public creator: string; + + /** AppVersion createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** AppVersion snapshot. */ + public snapshot?: (google.cloud.ces.v1beta.IAppSnapshot|null); + + /** AppVersion etag. */ + public etag: string; + + /** + * Creates a new AppVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns AppVersion instance + */ + public static create(properties?: google.cloud.ces.v1beta.IAppVersion): google.cloud.ces.v1beta.AppVersion; + + /** + * Encodes the specified AppVersion message. Does not implicitly {@link google.cloud.ces.v1beta.AppVersion.verify|verify} messages. + * @param message AppVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppVersion message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AppVersion.verify|verify} messages. + * @param message AppVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AppVersion; + + /** + * Decodes an AppVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AppVersion; + + /** + * Verifies an AppVersion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AppVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AppVersion; + + /** + * Creates a plain object from an AppVersion message. Also converts values to other types if specified. + * @param message AppVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AppVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Example. */ + interface IExample { + + /** Example name */ + name?: (string|null); + + /** Example displayName */ + displayName?: (string|null); + + /** Example description */ + description?: (string|null); + + /** Example entryAgent */ + entryAgent?: (string|null); + + /** Example messages */ + messages?: (google.cloud.ces.v1beta.IMessage[]|null); + + /** Example createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Example updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Example invalid */ + invalid?: (boolean|null); + + /** Example etag */ + etag?: (string|null); + } + + /** Represents an Example. */ + class Example implements IExample { + + /** + * Constructs a new Example. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IExample); + + /** Example name. */ + public name: string; + + /** Example displayName. */ + public displayName: string; + + /** Example description. */ + public description: string; + + /** Example entryAgent. */ + public entryAgent: string; + + /** Example messages. */ + public messages: google.cloud.ces.v1beta.IMessage[]; + + /** Example createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Example updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Example invalid. */ + public invalid: boolean; + + /** Example etag. */ + public etag: string; + + /** + * Creates a new Example instance using the specified properties. + * @param [properties] Properties to set + * @returns Example instance + */ + public static create(properties?: google.cloud.ces.v1beta.IExample): google.cloud.ces.v1beta.Example; + + /** + * Encodes the specified Example message. Does not implicitly {@link google.cloud.ces.v1beta.Example.verify|verify} messages. + * @param message Example message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Example message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Example.verify|verify} messages. + * @param message Example message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Example message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Example; + + /** + * Decodes an Example message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Example; + + /** + * Verifies an Example message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Example message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Example + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Example; + + /** + * Creates a plain object from an Example message. Also converts values to other types if specified. + * @param message Example + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Example, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Example to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Example + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Message. */ + interface IMessage { + + /** Message role */ + role?: (string|null); + + /** Message chunks */ + chunks?: (google.cloud.ces.v1beta.IChunk[]|null); + + /** Message eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Message. */ + class Message implements IMessage { + + /** + * Constructs a new Message. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IMessage); + + /** Message role. */ + public role: string; + + /** Message chunks. */ + public chunks: google.cloud.ces.v1beta.IChunk[]; + + /** Message eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Message instance using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public static create(properties?: google.cloud.ces.v1beta.IMessage): google.cloud.ces.v1beta.Message; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.ces.v1beta.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Message message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Message; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Message; + + /** + * Verifies a Message message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Message + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Message; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @param message Message + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Message to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Message + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Chunk. */ + interface IChunk { + + /** Chunk text */ + text?: (string|null); + + /** Chunk transcript */ + transcript?: (string|null); + + /** Chunk blob */ + blob?: (google.cloud.ces.v1beta.IBlob|null); + + /** Chunk payload */ + payload?: (google.protobuf.IStruct|null); + + /** Chunk image */ + image?: (google.cloud.ces.v1beta.IImage|null); + + /** Chunk toolCall */ + toolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** Chunk toolResponse */ + toolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** Chunk agentTransfer */ + agentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); + + /** Chunk updatedVariables */ + updatedVariables?: (google.protobuf.IStruct|null); + + /** Chunk defaultVariables */ + defaultVariables?: (google.protobuf.IStruct|null); + } + + /** Represents a Chunk. */ + class Chunk implements IChunk { + + /** + * Constructs a new Chunk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IChunk); + + /** Chunk text. */ + public text?: (string|null); + + /** Chunk transcript. */ + public transcript?: (string|null); + + /** Chunk blob. */ + public blob?: (google.cloud.ces.v1beta.IBlob|null); + + /** Chunk payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** Chunk image. */ + public image?: (google.cloud.ces.v1beta.IImage|null); + + /** Chunk toolCall. */ + public toolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** Chunk toolResponse. */ + public toolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** Chunk agentTransfer. */ + public agentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); + + /** Chunk updatedVariables. */ + public updatedVariables?: (google.protobuf.IStruct|null); + + /** Chunk defaultVariables. */ + public defaultVariables?: (google.protobuf.IStruct|null); + + /** Chunk data. */ + public data?: ("text"|"transcript"|"blob"|"payload"|"image"|"toolCall"|"toolResponse"|"agentTransfer"|"updatedVariables"|"defaultVariables"); + + /** + * Creates a new Chunk instance using the specified properties. + * @param [properties] Properties to set + * @returns Chunk instance + */ + public static create(properties?: google.cloud.ces.v1beta.IChunk): google.cloud.ces.v1beta.Chunk; + + /** + * Encodes the specified Chunk message. Does not implicitly {@link google.cloud.ces.v1beta.Chunk.verify|verify} messages. + * @param message Chunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Chunk.verify|verify} messages. + * @param message Chunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Chunk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Chunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Chunk; + + /** + * Decodes a Chunk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Chunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Chunk; + + /** + * Verifies a Chunk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Chunk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Chunk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Chunk; + + /** + * Creates a plain object from a Chunk message. Also converts values to other types if specified. + * @param message Chunk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Chunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Chunk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Chunk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Blob. */ + interface IBlob { + + /** Blob mimeType */ + mimeType?: (string|null); + + /** Blob data */ + data?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Blob. */ + class Blob implements IBlob { + + /** + * Constructs a new Blob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IBlob); + + /** Blob mimeType. */ + public mimeType: string; + + /** Blob data. */ + public data: (Uint8Array|Buffer|string); + + /** + * Creates a new Blob instance using the specified properties. + * @param [properties] Properties to set + * @returns Blob instance + */ + public static create(properties?: google.cloud.ces.v1beta.IBlob): google.cloud.ces.v1beta.Blob; + + /** + * Encodes the specified Blob message. Does not implicitly {@link google.cloud.ces.v1beta.Blob.verify|verify} messages. + * @param message Blob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IBlob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Blob.verify|verify} messages. + * @param message Blob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IBlob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Blob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Blob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Blob; + + /** + * Decodes a Blob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Blob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Blob; + + /** + * Verifies a Blob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Blob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Blob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Blob; + + /** + * Creates a plain object from a Blob message. Also converts values to other types if specified. + * @param message Blob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Blob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Blob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Blob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image mimeType */ + mimeType?: (string|null); + + /** Image data */ + data?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IImage); + + /** Image mimeType. */ + public mimeType: string; + + /** Image data. */ + public data: (Uint8Array|Buffer|string); + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.ces.v1beta.IImage): google.cloud.ces.v1beta.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.ces.v1beta.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Image message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Image; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Image; + + /** + * Verifies an Image message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Image + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Image; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @param message Image + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Image + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolCall. */ + interface IToolCall { + + /** ToolCall tool */ + tool?: (string|null); + + /** ToolCall toolsetTool */ + toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ToolCall id */ + id?: (string|null); + + /** ToolCall displayName */ + displayName?: (string|null); + + /** ToolCall args */ + args?: (google.protobuf.IStruct|null); + } + + /** Represents a ToolCall. */ + class ToolCall implements IToolCall { + + /** + * Constructs a new ToolCall. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IToolCall); + + /** ToolCall tool. */ + public tool?: (string|null); + + /** ToolCall toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ToolCall id. */ + public id: string; + + /** ToolCall displayName. */ + public displayName: string; + + /** ToolCall args. */ + public args?: (google.protobuf.IStruct|null); + + /** ToolCall toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new ToolCall instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolCall instance + */ + public static create(properties?: google.cloud.ces.v1beta.IToolCall): google.cloud.ces.v1beta.ToolCall; + + /** + * Encodes the specified ToolCall message. Does not implicitly {@link google.cloud.ces.v1beta.ToolCall.verify|verify} messages. + * @param message ToolCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IToolCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolCall message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolCall.verify|verify} messages. + * @param message ToolCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IToolCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolCall message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ToolCall; + + /** + * Decodes a ToolCall message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ToolCall; + + /** + * Verifies a ToolCall message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolCall message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolCall + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ToolCall; + + /** + * Creates a plain object from a ToolCall message. Also converts values to other types if specified. + * @param message ToolCall + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ToolCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolCall to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolCall + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolResponse. */ + interface IToolResponse { + + /** ToolResponse tool */ + tool?: (string|null); + + /** ToolResponse toolsetTool */ + toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ToolResponse id */ + id?: (string|null); + + /** ToolResponse displayName */ + displayName?: (string|null); + + /** ToolResponse response */ + response?: (google.protobuf.IStruct|null); + } + + /** Represents a ToolResponse. */ + class ToolResponse implements IToolResponse { + + /** + * Constructs a new ToolResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IToolResponse); + + /** ToolResponse tool. */ + public tool?: (string|null); + + /** ToolResponse toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ToolResponse id. */ + public id: string; + + /** ToolResponse displayName. */ + public displayName: string; + + /** ToolResponse response. */ + public response?: (google.protobuf.IStruct|null); + + /** ToolResponse toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new ToolResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IToolResponse): google.cloud.ces.v1beta.ToolResponse; + + /** + * Encodes the specified ToolResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponse.verify|verify} messages. + * @param message ToolResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponse.verify|verify} messages. + * @param message ToolResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ToolResponse; + + /** + * Decodes a ToolResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ToolResponse; + + /** + * Verifies a ToolResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ToolResponse; + + /** + * Creates a plain object from a ToolResponse message. Also converts values to other types if specified. + * @param message ToolResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ToolResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AgentTransfer. */ + interface IAgentTransfer { + + /** AgentTransfer targetAgent */ + targetAgent?: (string|null); + + /** AgentTransfer displayName */ + displayName?: (string|null); + } + + /** Represents an AgentTransfer. */ + class AgentTransfer implements IAgentTransfer { + + /** + * Constructs a new AgentTransfer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IAgentTransfer); + + /** AgentTransfer targetAgent. */ + public targetAgent: string; + + /** AgentTransfer displayName. */ + public displayName: string; + + /** + * Creates a new AgentTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns AgentTransfer instance + */ + public static create(properties?: google.cloud.ces.v1beta.IAgentTransfer): google.cloud.ces.v1beta.AgentTransfer; + + /** + * Encodes the specified AgentTransfer message. Does not implicitly {@link google.cloud.ces.v1beta.AgentTransfer.verify|verify} messages. + * @param message AgentTransfer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IAgentTransfer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AgentTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AgentTransfer.verify|verify} messages. + * @param message AgentTransfer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IAgentTransfer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AgentTransfer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AgentTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AgentTransfer; + + /** + * Decodes an AgentTransfer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AgentTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AgentTransfer; + + /** + * Verifies an AgentTransfer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AgentTransfer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AgentTransfer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AgentTransfer; + + /** + * Creates a plain object from an AgentTransfer message. Also converts values to other types if specified. + * @param message AgentTransfer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AgentTransfer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AgentTransfer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AgentTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolsetTool. */ + interface IToolsetTool { + + /** ToolsetTool toolset */ + toolset?: (string|null); + + /** ToolsetTool toolId */ + toolId?: (string|null); + } + + /** Represents a ToolsetTool. */ + class ToolsetTool implements IToolsetTool { + + /** + * Constructs a new ToolsetTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IToolsetTool); + + /** ToolsetTool toolset. */ + public toolset: string; + + /** ToolsetTool toolId. */ + public toolId: string; + + /** + * Creates a new ToolsetTool instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolsetTool instance + */ + public static create(properties?: google.cloud.ces.v1beta.IToolsetTool): google.cloud.ces.v1beta.ToolsetTool; + + /** + * Encodes the specified ToolsetTool message. Does not implicitly {@link google.cloud.ces.v1beta.ToolsetTool.verify|verify} messages. + * @param message ToolsetTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IToolsetTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolsetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolsetTool.verify|verify} messages. + * @param message ToolsetTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IToolsetTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolsetTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolsetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ToolsetTool; + + /** + * Decodes a ToolsetTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolsetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ToolsetTool; + + /** + * Verifies a ToolsetTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolsetTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolsetTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ToolsetTool; + + /** + * Creates a plain object from a ToolsetTool message. Also converts values to other types if specified. + * @param message ToolsetTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ToolsetTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolsetTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolsetTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Guardrail. */ + interface IGuardrail { + + /** Guardrail contentFilter */ + contentFilter?: (google.cloud.ces.v1beta.Guardrail.IContentFilter|null); + + /** Guardrail llmPromptSecurity */ + llmPromptSecurity?: (google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity|null); + + /** Guardrail llmPolicy */ + llmPolicy?: (google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null); + + /** Guardrail modelSafety */ + modelSafety?: (google.cloud.ces.v1beta.Guardrail.IModelSafety|null); + + /** Guardrail codeCallback */ + codeCallback?: (google.cloud.ces.v1beta.Guardrail.ICodeCallback|null); + + /** Guardrail name */ + name?: (string|null); + + /** Guardrail displayName */ + displayName?: (string|null); + + /** Guardrail description */ + description?: (string|null); + + /** Guardrail enabled */ + enabled?: (boolean|null); + + /** Guardrail action */ + action?: (google.cloud.ces.v1beta.ITriggerAction|null); + + /** Guardrail createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Guardrail updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Guardrail etag */ + etag?: (string|null); + } + + /** Represents a Guardrail. */ + class Guardrail implements IGuardrail { + + /** + * Constructs a new Guardrail. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGuardrail); + + /** Guardrail contentFilter. */ + public contentFilter?: (google.cloud.ces.v1beta.Guardrail.IContentFilter|null); + + /** Guardrail llmPromptSecurity. */ + public llmPromptSecurity?: (google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity|null); + + /** Guardrail llmPolicy. */ + public llmPolicy?: (google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null); + + /** Guardrail modelSafety. */ + public modelSafety?: (google.cloud.ces.v1beta.Guardrail.IModelSafety|null); + + /** Guardrail codeCallback. */ + public codeCallback?: (google.cloud.ces.v1beta.Guardrail.ICodeCallback|null); + + /** Guardrail name. */ + public name: string; + + /** Guardrail displayName. */ + public displayName: string; + + /** Guardrail description. */ + public description: string; + + /** Guardrail enabled. */ + public enabled: boolean; + + /** Guardrail action. */ + public action?: (google.cloud.ces.v1beta.ITriggerAction|null); + + /** Guardrail createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Guardrail updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Guardrail etag. */ + public etag: string; + + /** Guardrail guardrailType. */ + public guardrailType?: ("contentFilter"|"llmPromptSecurity"|"llmPolicy"|"modelSafety"|"codeCallback"); + + /** + * Creates a new Guardrail instance using the specified properties. + * @param [properties] Properties to set + * @returns Guardrail instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGuardrail): google.cloud.ces.v1beta.Guardrail; + + /** + * Encodes the specified Guardrail message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.verify|verify} messages. + * @param message Guardrail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGuardrail, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Guardrail message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.verify|verify} messages. + * @param message Guardrail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGuardrail, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Guardrail message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Guardrail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail; + + /** + * Decodes a Guardrail message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Guardrail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail; + + /** + * Verifies a Guardrail message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Guardrail message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Guardrail + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail; + + /** + * Creates a plain object from a Guardrail message. Also converts values to other types if specified. + * @param message Guardrail + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Guardrail, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Guardrail to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Guardrail + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Guardrail { + + /** Properties of a ContentFilter. */ + interface IContentFilter { + + /** ContentFilter bannedContents */ + bannedContents?: (string[]|null); + + /** ContentFilter bannedContentsInUserInput */ + bannedContentsInUserInput?: (string[]|null); + + /** ContentFilter bannedContentsInAgentResponse */ + bannedContentsInAgentResponse?: (string[]|null); + + /** ContentFilter matchType */ + matchType?: (google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType|keyof typeof google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType|null); + + /** ContentFilter disregardDiacritics */ + disregardDiacritics?: (boolean|null); + } + + /** Represents a ContentFilter. */ + class ContentFilter implements IContentFilter { + + /** + * Constructs a new ContentFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Guardrail.IContentFilter); + + /** ContentFilter bannedContents. */ + public bannedContents: string[]; + + /** ContentFilter bannedContentsInUserInput. */ + public bannedContentsInUserInput: string[]; + + /** ContentFilter bannedContentsInAgentResponse. */ + public bannedContentsInAgentResponse: string[]; + + /** ContentFilter matchType. */ + public matchType: (google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType|keyof typeof google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType); + + /** ContentFilter disregardDiacritics. */ + public disregardDiacritics: boolean; + + /** + * Creates a new ContentFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns ContentFilter instance + */ + public static create(properties?: google.cloud.ces.v1beta.Guardrail.IContentFilter): google.cloud.ces.v1beta.Guardrail.ContentFilter; + + /** + * Encodes the specified ContentFilter message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ContentFilter.verify|verify} messages. + * @param message ContentFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Guardrail.IContentFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ContentFilter.verify|verify} messages. + * @param message ContentFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.IContentFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContentFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.ContentFilter; + + /** + * Decodes a ContentFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.ContentFilter; + + /** + * Verifies a ContentFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContentFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.ContentFilter; + + /** + * Creates a plain object from a ContentFilter message. Also converts values to other types if specified. + * @param message ContentFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Guardrail.ContentFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContentFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContentFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ContentFilter { + + /** MatchType enum. */ + enum MatchType { + MATCH_TYPE_UNSPECIFIED = 0, + SIMPLE_STRING_MATCH = 1, + WORD_BOUNDARY_STRING_MATCH = 2, + REGEXP_MATCH = 3 + } + } + + /** Properties of a LlmPromptSecurity. */ + interface ILlmPromptSecurity { + + /** LlmPromptSecurity defaultSettings */ + defaultSettings?: (google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null); + + /** LlmPromptSecurity customPolicy */ + customPolicy?: (google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null); + + /** LlmPromptSecurity failOpen */ + failOpen?: (boolean|null); + } + + /** Represents a LlmPromptSecurity. */ + class LlmPromptSecurity implements ILlmPromptSecurity { + + /** + * Constructs a new LlmPromptSecurity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity); + + /** LlmPromptSecurity defaultSettings. */ + public defaultSettings?: (google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null); + + /** LlmPromptSecurity customPolicy. */ + public customPolicy?: (google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null); + + /** LlmPromptSecurity failOpen. */ + public failOpen: boolean; + + /** LlmPromptSecurity securityConfig. */ + public securityConfig?: ("defaultSettings"|"customPolicy"); + + /** + * Creates a new LlmPromptSecurity instance using the specified properties. + * @param [properties] Properties to set + * @returns LlmPromptSecurity instance + */ + public static create(properties?: google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity; + + /** + * Encodes the specified LlmPromptSecurity message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.verify|verify} messages. + * @param message LlmPromptSecurity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LlmPromptSecurity message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.verify|verify} messages. + * @param message LlmPromptSecurity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LlmPromptSecurity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LlmPromptSecurity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity; + + /** + * Decodes a LlmPromptSecurity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LlmPromptSecurity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity; + + /** + * Verifies a LlmPromptSecurity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LlmPromptSecurity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LlmPromptSecurity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity; + + /** + * Creates a plain object from a LlmPromptSecurity message. Also converts values to other types if specified. + * @param message LlmPromptSecurity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LlmPromptSecurity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LlmPromptSecurity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LlmPromptSecurity { + + /** Properties of a DefaultSecuritySettings. */ + interface IDefaultSecuritySettings { + + /** DefaultSecuritySettings defaultPromptTemplate */ + defaultPromptTemplate?: (string|null); + } + + /** Represents a DefaultSecuritySettings. */ + class DefaultSecuritySettings implements IDefaultSecuritySettings { + + /** + * Constructs a new DefaultSecuritySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings); + + /** DefaultSecuritySettings defaultPromptTemplate. */ + public defaultPromptTemplate: string; + + /** + * Creates a new DefaultSecuritySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DefaultSecuritySettings instance + */ + public static create(properties?: google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; + + /** + * Encodes the specified DefaultSecuritySettings message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. + * @param message DefaultSecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DefaultSecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. + * @param message DefaultSecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DefaultSecuritySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DefaultSecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; + + /** + * Decodes a DefaultSecuritySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DefaultSecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; + + /** + * Verifies a DefaultSecuritySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DefaultSecuritySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DefaultSecuritySettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings; + + /** + * Creates a plain object from a DefaultSecuritySettings message. Also converts values to other types if specified. + * @param message DefaultSecuritySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DefaultSecuritySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DefaultSecuritySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a LlmPolicy. */ + interface ILlmPolicy { + + /** LlmPolicy maxConversationMessages */ + maxConversationMessages?: (number|null); + + /** LlmPolicy modelSettings */ + modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** LlmPolicy prompt */ + prompt?: (string|null); + + /** LlmPolicy policyScope */ + policyScope?: (google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope|keyof typeof google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope|null); + + /** LlmPolicy failOpen */ + failOpen?: (boolean|null); + + /** LlmPolicy allowShortUtterance */ + allowShortUtterance?: (boolean|null); + } + + /** Represents a LlmPolicy. */ + class LlmPolicy implements ILlmPolicy { + + /** + * Constructs a new LlmPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Guardrail.ILlmPolicy); + + /** LlmPolicy maxConversationMessages. */ + public maxConversationMessages: number; + + /** LlmPolicy modelSettings. */ + public modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** LlmPolicy prompt. */ + public prompt: string; + + /** LlmPolicy policyScope. */ + public policyScope: (google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope|keyof typeof google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope); + + /** LlmPolicy failOpen. */ + public failOpen: boolean; + + /** LlmPolicy allowShortUtterance. */ + public allowShortUtterance: boolean; + + /** + * Creates a new LlmPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns LlmPolicy instance + */ + public static create(properties?: google.cloud.ces.v1beta.Guardrail.ILlmPolicy): google.cloud.ces.v1beta.Guardrail.LlmPolicy; + + /** + * Encodes the specified LlmPolicy message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPolicy.verify|verify} messages. + * @param message LlmPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Guardrail.ILlmPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LlmPolicy message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPolicy.verify|verify} messages. + * @param message LlmPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.ILlmPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LlmPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LlmPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.LlmPolicy; + + /** + * Decodes a LlmPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LlmPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.LlmPolicy; + + /** + * Verifies a LlmPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LlmPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LlmPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.LlmPolicy; + + /** + * Creates a plain object from a LlmPolicy message. Also converts values to other types if specified. + * @param message LlmPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Guardrail.LlmPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LlmPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LlmPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LlmPolicy { + + /** PolicyScope enum. */ + enum PolicyScope { + POLICY_SCOPE_UNSPECIFIED = 0, + USER_QUERY = 1, + AGENT_RESPONSE = 2, + USER_QUERY_AND_AGENT_RESPONSE = 3 + } + } + + /** Properties of a ModelSafety. */ + interface IModelSafety { + + /** ModelSafety safetySettings */ + safetySettings?: (google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting[]|null); + } + + /** Represents a ModelSafety. */ + class ModelSafety implements IModelSafety { + + /** + * Constructs a new ModelSafety. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Guardrail.IModelSafety); + + /** ModelSafety safetySettings. */ + public safetySettings: google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting[]; + + /** + * Creates a new ModelSafety instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelSafety instance + */ + public static create(properties?: google.cloud.ces.v1beta.Guardrail.IModelSafety): google.cloud.ces.v1beta.Guardrail.ModelSafety; + + /** + * Encodes the specified ModelSafety message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.verify|verify} messages. + * @param message ModelSafety message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Guardrail.IModelSafety, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelSafety message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.verify|verify} messages. + * @param message ModelSafety message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.IModelSafety, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelSafety message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelSafety + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.ModelSafety; + + /** + * Decodes a ModelSafety message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelSafety + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.ModelSafety; + + /** + * Verifies a ModelSafety message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelSafety message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelSafety + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.ModelSafety; + + /** + * Creates a plain object from a ModelSafety message. Also converts values to other types if specified. + * @param message ModelSafety + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Guardrail.ModelSafety, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelSafety to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelSafety + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ModelSafety { + + /** Properties of a SafetySetting. */ + interface ISafetySetting { + + /** SafetySetting category */ + category?: (google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory|keyof typeof google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory|null); + + /** SafetySetting threshold */ + threshold?: (google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold|keyof typeof google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold|null); + } + + /** Represents a SafetySetting. */ + class SafetySetting implements ISafetySetting { + + /** + * Constructs a new SafetySetting. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting); + + /** SafetySetting category. */ + public category: (google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory|keyof typeof google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory); + + /** SafetySetting threshold. */ + public threshold: (google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold|keyof typeof google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold); + + /** + * Creates a new SafetySetting instance using the specified properties. + * @param [properties] Properties to set + * @returns SafetySetting instance + */ + public static create(properties?: google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting): google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting; + + /** + * Encodes the specified SafetySetting message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. + * @param message SafetySetting message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. + * @param message SafetySetting message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SafetySetting message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SafetySetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting; + + /** + * Decodes a SafetySetting message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SafetySetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting; + + /** + * Verifies a SafetySetting message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SafetySetting + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting; + + /** + * Creates a plain object from a SafetySetting message. Also converts values to other types if specified. + * @param message SafetySetting + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SafetySetting to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SafetySetting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** HarmCategory enum. */ + enum HarmCategory { + HARM_CATEGORY_UNSPECIFIED = 0, + HARM_CATEGORY_HATE_SPEECH = 1, + HARM_CATEGORY_DANGEROUS_CONTENT = 2, + HARM_CATEGORY_HARASSMENT = 3, + HARM_CATEGORY_SEXUALLY_EXPLICIT = 4 + } + + /** HarmBlockThreshold enum. */ + enum HarmBlockThreshold { + HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0, + BLOCK_LOW_AND_ABOVE = 1, + BLOCK_MEDIUM_AND_ABOVE = 2, + BLOCK_ONLY_HIGH = 3, + BLOCK_NONE = 4, + OFF = 5 + } + } + + /** Properties of a CodeCallback. */ + interface ICodeCallback { + + /** CodeCallback beforeAgentCallback */ + beforeAgentCallback?: (google.cloud.ces.v1beta.ICallback|null); + + /** CodeCallback afterAgentCallback */ + afterAgentCallback?: (google.cloud.ces.v1beta.ICallback|null); + + /** CodeCallback beforeModelCallback */ + beforeModelCallback?: (google.cloud.ces.v1beta.ICallback|null); + + /** CodeCallback afterModelCallback */ + afterModelCallback?: (google.cloud.ces.v1beta.ICallback|null); + } + + /** Represents a CodeCallback. */ + class CodeCallback implements ICodeCallback { + + /** + * Constructs a new CodeCallback. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Guardrail.ICodeCallback); + + /** CodeCallback beforeAgentCallback. */ + public beforeAgentCallback?: (google.cloud.ces.v1beta.ICallback|null); + + /** CodeCallback afterAgentCallback. */ + public afterAgentCallback?: (google.cloud.ces.v1beta.ICallback|null); + + /** CodeCallback beforeModelCallback. */ + public beforeModelCallback?: (google.cloud.ces.v1beta.ICallback|null); + + /** CodeCallback afterModelCallback. */ + public afterModelCallback?: (google.cloud.ces.v1beta.ICallback|null); + + /** + * Creates a new CodeCallback instance using the specified properties. + * @param [properties] Properties to set + * @returns CodeCallback instance + */ + public static create(properties?: google.cloud.ces.v1beta.Guardrail.ICodeCallback): google.cloud.ces.v1beta.Guardrail.CodeCallback; + + /** + * Encodes the specified CodeCallback message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.CodeCallback.verify|verify} messages. + * @param message CodeCallback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Guardrail.ICodeCallback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CodeCallback message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.CodeCallback.verify|verify} messages. + * @param message CodeCallback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Guardrail.ICodeCallback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CodeCallback message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CodeCallback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Guardrail.CodeCallback; + + /** + * Decodes a CodeCallback message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CodeCallback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Guardrail.CodeCallback; + + /** + * Verifies a CodeCallback message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CodeCallback message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CodeCallback + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Guardrail.CodeCallback; + + /** + * Creates a plain object from a CodeCallback message. Also converts values to other types if specified. + * @param message CodeCallback + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Guardrail.CodeCallback, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CodeCallback to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CodeCallback + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Tool. */ + interface ITool { + + /** Tool clientFunction */ + clientFunction?: (google.cloud.ces.v1beta.IClientFunction|null); + + /** Tool openApiTool */ + openApiTool?: (google.cloud.ces.v1beta.IOpenApiTool|null); + + /** Tool googleSearchTool */ + googleSearchTool?: (google.cloud.ces.v1beta.IGoogleSearchTool|null); + + /** Tool connectorTool */ + connectorTool?: (google.cloud.ces.v1beta.IConnectorTool|null); + + /** Tool dataStoreTool */ + dataStoreTool?: (google.cloud.ces.v1beta.IDataStoreTool|null); + + /** Tool pythonFunction */ + pythonFunction?: (google.cloud.ces.v1beta.IPythonFunction|null); + + /** Tool mcpTool */ + mcpTool?: (google.cloud.ces.v1beta.IMcpTool|null); + + /** Tool fileSearchTool */ + fileSearchTool?: (google.cloud.ces.v1beta.IFileSearchTool|null); + + /** Tool systemTool */ + systemTool?: (google.cloud.ces.v1beta.ISystemTool|null); + + /** Tool widgetTool */ + widgetTool?: (google.cloud.ces.v1beta.IWidgetTool|null); + + /** Tool name */ + name?: (string|null); + + /** Tool displayName */ + displayName?: (string|null); + + /** Tool executionType */ + executionType?: (google.cloud.ces.v1beta.ExecutionType|keyof typeof google.cloud.ces.v1beta.ExecutionType|null); + + /** Tool createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Tool updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Tool etag */ + etag?: (string|null); + + /** Tool generatedSummary */ + generatedSummary?: (string|null); + + /** Tool toolFakeConfig */ + toolFakeConfig?: (google.cloud.ces.v1beta.IToolFakeConfig|null); + } + + /** Represents a Tool. */ + class Tool implements ITool { + + /** + * Constructs a new Tool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ITool); + + /** Tool clientFunction. */ + public clientFunction?: (google.cloud.ces.v1beta.IClientFunction|null); + + /** Tool openApiTool. */ + public openApiTool?: (google.cloud.ces.v1beta.IOpenApiTool|null); + + /** Tool googleSearchTool. */ + public googleSearchTool?: (google.cloud.ces.v1beta.IGoogleSearchTool|null); + + /** Tool connectorTool. */ + public connectorTool?: (google.cloud.ces.v1beta.IConnectorTool|null); + + /** Tool dataStoreTool. */ + public dataStoreTool?: (google.cloud.ces.v1beta.IDataStoreTool|null); + + /** Tool pythonFunction. */ + public pythonFunction?: (google.cloud.ces.v1beta.IPythonFunction|null); + + /** Tool mcpTool. */ + public mcpTool?: (google.cloud.ces.v1beta.IMcpTool|null); + + /** Tool fileSearchTool. */ + public fileSearchTool?: (google.cloud.ces.v1beta.IFileSearchTool|null); + + /** Tool systemTool. */ + public systemTool?: (google.cloud.ces.v1beta.ISystemTool|null); + + /** Tool widgetTool. */ + public widgetTool?: (google.cloud.ces.v1beta.IWidgetTool|null); + + /** Tool name. */ + public name: string; + + /** Tool displayName. */ + public displayName: string; + + /** Tool executionType. */ + public executionType: (google.cloud.ces.v1beta.ExecutionType|keyof typeof google.cloud.ces.v1beta.ExecutionType); + + /** Tool createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Tool updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Tool etag. */ + public etag: string; + + /** Tool generatedSummary. */ + public generatedSummary: string; + + /** Tool toolFakeConfig. */ + public toolFakeConfig?: (google.cloud.ces.v1beta.IToolFakeConfig|null); + + /** Tool toolType. */ + public toolType?: ("clientFunction"|"openApiTool"|"googleSearchTool"|"connectorTool"|"dataStoreTool"|"pythonFunction"|"mcpTool"|"fileSearchTool"|"systemTool"|"widgetTool"); + + /** + * Creates a new Tool instance using the specified properties. + * @param [properties] Properties to set + * @returns Tool instance + */ + public static create(properties?: google.cloud.ces.v1beta.ITool): google.cloud.ces.v1beta.Tool; + + /** + * Encodes the specified Tool message. Does not implicitly {@link google.cloud.ces.v1beta.Tool.verify|verify} messages. + * @param message Tool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ITool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Tool.verify|verify} messages. + * @param message Tool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ITool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Tool; + + /** + * Decodes a Tool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Tool; + + /** + * Verifies a Tool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Tool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Tool; + + /** + * Creates a plain object from a Tool message. Also converts values to other types if specified. + * @param message Tool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Tool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Tool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientFunction. */ + interface IClientFunction { + + /** ClientFunction name */ + name?: (string|null); + + /** ClientFunction description */ + description?: (string|null); + + /** ClientFunction parameters */ + parameters?: (google.cloud.ces.v1beta.ISchema|null); + + /** ClientFunction response */ + response?: (google.cloud.ces.v1beta.ISchema|null); + } + + /** Represents a ClientFunction. */ + class ClientFunction implements IClientFunction { + + /** + * Constructs a new ClientFunction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IClientFunction); + + /** ClientFunction name. */ + public name: string; + + /** ClientFunction description. */ + public description: string; + + /** ClientFunction parameters. */ + public parameters?: (google.cloud.ces.v1beta.ISchema|null); + + /** ClientFunction response. */ + public response?: (google.cloud.ces.v1beta.ISchema|null); + + /** + * Creates a new ClientFunction instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientFunction instance + */ + public static create(properties?: google.cloud.ces.v1beta.IClientFunction): google.cloud.ces.v1beta.ClientFunction; + + /** + * Encodes the specified ClientFunction message. Does not implicitly {@link google.cloud.ces.v1beta.ClientFunction.verify|verify} messages. + * @param message ClientFunction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IClientFunction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ClientFunction.verify|verify} messages. + * @param message ClientFunction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IClientFunction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientFunction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ClientFunction; + + /** + * Decodes a ClientFunction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ClientFunction; + + /** + * Verifies a ClientFunction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientFunction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientFunction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ClientFunction; + + /** + * Creates a plain object from a ClientFunction message. Also converts values to other types if specified. + * @param message ClientFunction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ClientFunction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientFunction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientFunction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Action. */ + interface IAction { + + /** Action connectionActionId */ + connectionActionId?: (string|null); + + /** Action entityOperation */ + entityOperation?: (google.cloud.ces.v1beta.Action.IEntityOperation|null); + + /** Action inputFields */ + inputFields?: (string[]|null); + + /** Action outputFields */ + outputFields?: (string[]|null); + } + + /** Represents an Action. */ + class Action implements IAction { + + /** + * Constructs a new Action. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IAction); + + /** Action connectionActionId. */ + public connectionActionId?: (string|null); + + /** Action entityOperation. */ + public entityOperation?: (google.cloud.ces.v1beta.Action.IEntityOperation|null); + + /** Action inputFields. */ + public inputFields: string[]; + + /** Action outputFields. */ + public outputFields: string[]; + + /** Action actionSpec. */ + public actionSpec?: ("connectionActionId"|"entityOperation"); + + /** + * Creates a new Action instance using the specified properties. + * @param [properties] Properties to set + * @returns Action instance + */ + public static create(properties?: google.cloud.ces.v1beta.IAction): google.cloud.ces.v1beta.Action; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.cloud.ces.v1beta.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Action message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Action; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Action; + + /** + * Verifies an Action message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Action message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Action + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Action; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @param message Action + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Action, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Action to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Action + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Action { + + /** Properties of an EntityOperation. */ + interface IEntityOperation { + + /** EntityOperation entityId */ + entityId?: (string|null); + + /** EntityOperation operation */ + operation?: (google.cloud.ces.v1beta.Action.EntityOperation.OperationType|keyof typeof google.cloud.ces.v1beta.Action.EntityOperation.OperationType|null); + } + + /** Represents an EntityOperation. */ + class EntityOperation implements IEntityOperation { + + /** + * Constructs a new EntityOperation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Action.IEntityOperation); + + /** EntityOperation entityId. */ + public entityId: string; + + /** EntityOperation operation. */ + public operation: (google.cloud.ces.v1beta.Action.EntityOperation.OperationType|keyof typeof google.cloud.ces.v1beta.Action.EntityOperation.OperationType); + + /** + * Creates a new EntityOperation instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityOperation instance + */ + public static create(properties?: google.cloud.ces.v1beta.Action.IEntityOperation): google.cloud.ces.v1beta.Action.EntityOperation; + + /** + * Encodes the specified EntityOperation message. Does not implicitly {@link google.cloud.ces.v1beta.Action.EntityOperation.verify|verify} messages. + * @param message EntityOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Action.IEntityOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityOperation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Action.EntityOperation.verify|verify} messages. + * @param message EntityOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Action.IEntityOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityOperation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Action.EntityOperation; + + /** + * Decodes an EntityOperation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Action.EntityOperation; + + /** + * Verifies an EntityOperation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EntityOperation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityOperation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Action.EntityOperation; + + /** + * Creates a plain object from an EntityOperation message. Also converts values to other types if specified. + * @param message EntityOperation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Action.EntityOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityOperation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EntityOperation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EntityOperation { + + /** OperationType enum. */ + enum OperationType { + OPERATION_TYPE_UNSPECIFIED = 0, + LIST = 1, + GET = 2, + CREATE = 3, + UPDATE = 4, + DELETE = 5 + } + } + } + + /** Properties of a ConnectorTool. */ + interface IConnectorTool { + + /** ConnectorTool connection */ + connection?: (string|null); + + /** ConnectorTool action */ + action?: (google.cloud.ces.v1beta.IAction|null); + + /** ConnectorTool authConfig */ + authConfig?: (google.cloud.ces.v1beta.IEndUserAuthConfig|null); + + /** ConnectorTool name */ + name?: (string|null); + + /** ConnectorTool description */ + description?: (string|null); + } + + /** Represents a ConnectorTool. */ + class ConnectorTool implements IConnectorTool { + + /** + * Constructs a new ConnectorTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IConnectorTool); + + /** ConnectorTool connection. */ + public connection: string; + + /** ConnectorTool action. */ + public action?: (google.cloud.ces.v1beta.IAction|null); + + /** ConnectorTool authConfig. */ + public authConfig?: (google.cloud.ces.v1beta.IEndUserAuthConfig|null); + + /** ConnectorTool name. */ + public name: string; + + /** ConnectorTool description. */ + public description: string; + + /** + * Creates a new ConnectorTool instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectorTool instance + */ + public static create(properties?: google.cloud.ces.v1beta.IConnectorTool): google.cloud.ces.v1beta.ConnectorTool; + + /** + * Encodes the specified ConnectorTool message. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorTool.verify|verify} messages. + * @param message ConnectorTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IConnectorTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectorTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorTool.verify|verify} messages. + * @param message ConnectorTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IConnectorTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectorTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectorTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ConnectorTool; + + /** + * Decodes a ConnectorTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectorTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ConnectorTool; + + /** + * Verifies a ConnectorTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectorTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectorTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ConnectorTool; + + /** + * Creates a plain object from a ConnectorTool message. Also converts values to other types if specified. + * @param message ConnectorTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ConnectorTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectorTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectorTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApiKeyConfig. */ + interface IApiKeyConfig { + + /** ApiKeyConfig keyName */ + keyName?: (string|null); + + /** ApiKeyConfig apiKeySecretVersion */ + apiKeySecretVersion?: (string|null); + + /** ApiKeyConfig requestLocation */ + requestLocation?: (google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation|keyof typeof google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation|null); + } + + /** Represents an ApiKeyConfig. */ + class ApiKeyConfig implements IApiKeyConfig { + + /** + * Constructs a new ApiKeyConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IApiKeyConfig); + + /** ApiKeyConfig keyName. */ + public keyName: string; + + /** ApiKeyConfig apiKeySecretVersion. */ + public apiKeySecretVersion: string; + + /** ApiKeyConfig requestLocation. */ + public requestLocation: (google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation|keyof typeof google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation); + + /** + * Creates a new ApiKeyConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiKeyConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IApiKeyConfig): google.cloud.ces.v1beta.ApiKeyConfig; + + /** + * Encodes the specified ApiKeyConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ApiKeyConfig.verify|verify} messages. + * @param message ApiKeyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IApiKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiKeyConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ApiKeyConfig.verify|verify} messages. + * @param message ApiKeyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IApiKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ApiKeyConfig; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ApiKeyConfig; + + /** + * Verifies an ApiKeyConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApiKeyConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiKeyConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ApiKeyConfig; + + /** + * Creates a plain object from an ApiKeyConfig message. Also converts values to other types if specified. + * @param message ApiKeyConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ApiKeyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiKeyConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiKeyConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ApiKeyConfig { + + /** RequestLocation enum. */ + enum RequestLocation { + REQUEST_LOCATION_UNSPECIFIED = 0, + HEADER = 1, + QUERY_STRING = 2 + } + } + + /** Properties of a OAuthConfig. */ + interface IOAuthConfig { + + /** OAuthConfig oauthGrantType */ + oauthGrantType?: (google.cloud.ces.v1beta.OAuthConfig.OauthGrantType|keyof typeof google.cloud.ces.v1beta.OAuthConfig.OauthGrantType|null); + + /** OAuthConfig clientId */ + clientId?: (string|null); + + /** OAuthConfig clientSecretVersion */ + clientSecretVersion?: (string|null); + + /** OAuthConfig tokenEndpoint */ + tokenEndpoint?: (string|null); + + /** OAuthConfig scopes */ + scopes?: (string[]|null); + } + + /** Represents a OAuthConfig. */ + class OAuthConfig implements IOAuthConfig { + + /** + * Constructs a new OAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IOAuthConfig); + + /** OAuthConfig oauthGrantType. */ + public oauthGrantType: (google.cloud.ces.v1beta.OAuthConfig.OauthGrantType|keyof typeof google.cloud.ces.v1beta.OAuthConfig.OauthGrantType); + + /** OAuthConfig clientId. */ + public clientId: string; + + /** OAuthConfig clientSecretVersion. */ + public clientSecretVersion: string; + + /** OAuthConfig tokenEndpoint. */ + public tokenEndpoint: string; + + /** OAuthConfig scopes. */ + public scopes: string[]; + + /** + * Creates a new OAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OAuthConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IOAuthConfig): google.cloud.ces.v1beta.OAuthConfig; + + /** + * Encodes the specified OAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OAuthConfig.verify|verify} messages. + * @param message OAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IOAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OAuthConfig.verify|verify} messages. + * @param message OAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IOAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OAuthConfig; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OAuthConfig; + + /** + * Verifies a OAuthConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a OAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OAuthConfig; + + /** + * Creates a plain object from a OAuthConfig message. Also converts values to other types if specified. + * @param message OAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OAuthConfig { + + /** OauthGrantType enum. */ + enum OauthGrantType { + OAUTH_GRANT_TYPE_UNSPECIFIED = 0, + CLIENT_CREDENTIAL = 1 + } + } + + /** Properties of a ServiceAgentIdTokenAuthConfig. */ + interface IServiceAgentIdTokenAuthConfig { + } + + /** Represents a ServiceAgentIdTokenAuthConfig. */ + class ServiceAgentIdTokenAuthConfig implements IServiceAgentIdTokenAuthConfig { + + /** + * Constructs a new ServiceAgentIdTokenAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig); + + /** + * Creates a new ServiceAgentIdTokenAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAgentIdTokenAuthConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig): google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig; + + /** + * Encodes the specified ServiceAgentIdTokenAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.verify|verify} messages. + * @param message ServiceAgentIdTokenAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAgentIdTokenAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.verify|verify} messages. + * @param message ServiceAgentIdTokenAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAgentIdTokenAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig; + + /** + * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAgentIdTokenAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig; + + /** + * Verifies a ServiceAgentIdTokenAuthConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceAgentIdTokenAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAgentIdTokenAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig; + + /** + * Creates a plain object from a ServiceAgentIdTokenAuthConfig message. Also converts values to other types if specified. + * @param message ServiceAgentIdTokenAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAgentIdTokenAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAgentIdTokenAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceAccountAuthConfig. */ + interface IServiceAccountAuthConfig { + + /** ServiceAccountAuthConfig serviceAccount */ + serviceAccount?: (string|null); + + /** ServiceAccountAuthConfig scopes */ + scopes?: (string[]|null); + } + + /** Represents a ServiceAccountAuthConfig. */ + class ServiceAccountAuthConfig implements IServiceAccountAuthConfig { + + /** + * Constructs a new ServiceAccountAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IServiceAccountAuthConfig); + + /** ServiceAccountAuthConfig serviceAccount. */ + public serviceAccount: string; + + /** ServiceAccountAuthConfig scopes. */ + public scopes: string[]; + + /** + * Creates a new ServiceAccountAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAccountAuthConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IServiceAccountAuthConfig): google.cloud.ces.v1beta.ServiceAccountAuthConfig; + + /** + * Encodes the specified ServiceAccountAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAccountAuthConfig.verify|verify} messages. + * @param message ServiceAccountAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IServiceAccountAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAccountAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAccountAuthConfig.verify|verify} messages. + * @param message ServiceAccountAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IServiceAccountAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ServiceAccountAuthConfig; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ServiceAccountAuthConfig; + + /** + * Verifies a ServiceAccountAuthConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceAccountAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAccountAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ServiceAccountAuthConfig; + + /** + * Creates a plain object from a ServiceAccountAuthConfig message. Also converts values to other types if specified. + * @param message ServiceAccountAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ServiceAccountAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAccountAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAccountAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BearerTokenConfig. */ + interface IBearerTokenConfig { + + /** BearerTokenConfig token */ + token?: (string|null); + } + + /** Represents a BearerTokenConfig. */ + class BearerTokenConfig implements IBearerTokenConfig { + + /** + * Constructs a new BearerTokenConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IBearerTokenConfig); + + /** BearerTokenConfig token. */ + public token: string; + + /** + * Creates a new BearerTokenConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BearerTokenConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IBearerTokenConfig): google.cloud.ces.v1beta.BearerTokenConfig; + + /** + * Encodes the specified BearerTokenConfig message. Does not implicitly {@link google.cloud.ces.v1beta.BearerTokenConfig.verify|verify} messages. + * @param message BearerTokenConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IBearerTokenConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BearerTokenConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BearerTokenConfig.verify|verify} messages. + * @param message BearerTokenConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IBearerTokenConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BearerTokenConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BearerTokenConfig; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BearerTokenConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BearerTokenConfig; + + /** + * Verifies a BearerTokenConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BearerTokenConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BearerTokenConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BearerTokenConfig; + + /** + * Creates a plain object from a BearerTokenConfig message. Also converts values to other types if specified. + * @param message BearerTokenConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.BearerTokenConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BearerTokenConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BearerTokenConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EndUserAuthConfig. */ + interface IEndUserAuthConfig { + + /** EndUserAuthConfig oauth2AuthCodeConfig */ + oauth2AuthCodeConfig?: (google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig|null); + + /** EndUserAuthConfig oauth2JwtBearerConfig */ + oauth2JwtBearerConfig?: (google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig|null); + } + + /** Represents an EndUserAuthConfig. */ + class EndUserAuthConfig implements IEndUserAuthConfig { + + /** + * Constructs a new EndUserAuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEndUserAuthConfig); + + /** EndUserAuthConfig oauth2AuthCodeConfig. */ + public oauth2AuthCodeConfig?: (google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig|null); + + /** EndUserAuthConfig oauth2JwtBearerConfig. */ + public oauth2JwtBearerConfig?: (google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig|null); + + /** EndUserAuthConfig authConfig. */ + public authConfig?: ("oauth2AuthCodeConfig"|"oauth2JwtBearerConfig"); + + /** + * Creates a new EndUserAuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EndUserAuthConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEndUserAuthConfig): google.cloud.ces.v1beta.EndUserAuthConfig; + + /** + * Encodes the specified EndUserAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.verify|verify} messages. + * @param message EndUserAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEndUserAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndUserAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.verify|verify} messages. + * @param message EndUserAuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEndUserAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndUserAuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndUserAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EndUserAuthConfig; + + /** + * Decodes an EndUserAuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndUserAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EndUserAuthConfig; + + /** + * Verifies an EndUserAuthConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EndUserAuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndUserAuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EndUserAuthConfig; + + /** + * Creates a plain object from an EndUserAuthConfig message. Also converts values to other types if specified. + * @param message EndUserAuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EndUserAuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndUserAuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndUserAuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EndUserAuthConfig { + + /** Properties of an Oauth2AuthCodeConfig. */ + interface IOauth2AuthCodeConfig { + + /** Oauth2AuthCodeConfig oauthToken */ + oauthToken?: (string|null); + } + + /** Represents an Oauth2AuthCodeConfig. */ + class Oauth2AuthCodeConfig implements IOauth2AuthCodeConfig { + + /** + * Constructs a new Oauth2AuthCodeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig); + + /** Oauth2AuthCodeConfig oauthToken. */ + public oauthToken: string; + + /** + * Creates a new Oauth2AuthCodeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns Oauth2AuthCodeConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig; + + /** + * Encodes the specified Oauth2AuthCodeConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. + * @param message Oauth2AuthCodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Oauth2AuthCodeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. + * @param message Oauth2AuthCodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Oauth2AuthCodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig; + + /** + * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Oauth2AuthCodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig; + + /** + * Verifies an Oauth2AuthCodeConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Oauth2AuthCodeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Oauth2AuthCodeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig; + + /** + * Creates a plain object from an Oauth2AuthCodeConfig message. Also converts values to other types if specified. + * @param message Oauth2AuthCodeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Oauth2AuthCodeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Oauth2AuthCodeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Oauth2JwtBearerConfig. */ + interface IOauth2JwtBearerConfig { + + /** Oauth2JwtBearerConfig issuer */ + issuer?: (string|null); + + /** Oauth2JwtBearerConfig subject */ + subject?: (string|null); + + /** Oauth2JwtBearerConfig clientKey */ + clientKey?: (string|null); + } + + /** Represents an Oauth2JwtBearerConfig. */ + class Oauth2JwtBearerConfig implements IOauth2JwtBearerConfig { + + /** + * Constructs a new Oauth2JwtBearerConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig); + + /** Oauth2JwtBearerConfig issuer. */ + public issuer: string; + + /** Oauth2JwtBearerConfig subject. */ + public subject: string; + + /** Oauth2JwtBearerConfig clientKey. */ + public clientKey: string; + + /** + * Creates a new Oauth2JwtBearerConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns Oauth2JwtBearerConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig; + + /** + * Encodes the specified Oauth2JwtBearerConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. + * @param message Oauth2JwtBearerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Oauth2JwtBearerConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. + * @param message Oauth2JwtBearerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Oauth2JwtBearerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig; + + /** + * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Oauth2JwtBearerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig; + + /** + * Verifies an Oauth2JwtBearerConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Oauth2JwtBearerConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Oauth2JwtBearerConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig; + + /** + * Creates a plain object from an Oauth2JwtBearerConfig message. Also converts values to other types if specified. + * @param message Oauth2JwtBearerConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Oauth2JwtBearerConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Oauth2JwtBearerConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ApiAuthentication. */ + interface IApiAuthentication { + + /** ApiAuthentication apiKeyConfig */ + apiKeyConfig?: (google.cloud.ces.v1beta.IApiKeyConfig|null); + + /** ApiAuthentication oauthConfig */ + oauthConfig?: (google.cloud.ces.v1beta.IOAuthConfig|null); + + /** ApiAuthentication serviceAgentIdTokenAuthConfig */ + serviceAgentIdTokenAuthConfig?: (google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig|null); + + /** ApiAuthentication serviceAccountAuthConfig */ + serviceAccountAuthConfig?: (google.cloud.ces.v1beta.IServiceAccountAuthConfig|null); + + /** ApiAuthentication bearerTokenConfig */ + bearerTokenConfig?: (google.cloud.ces.v1beta.IBearerTokenConfig|null); + } + + /** Represents an ApiAuthentication. */ + class ApiAuthentication implements IApiAuthentication { + + /** + * Constructs a new ApiAuthentication. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IApiAuthentication); + + /** ApiAuthentication apiKeyConfig. */ + public apiKeyConfig?: (google.cloud.ces.v1beta.IApiKeyConfig|null); + + /** ApiAuthentication oauthConfig. */ + public oauthConfig?: (google.cloud.ces.v1beta.IOAuthConfig|null); + + /** ApiAuthentication serviceAgentIdTokenAuthConfig. */ + public serviceAgentIdTokenAuthConfig?: (google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig|null); + + /** ApiAuthentication serviceAccountAuthConfig. */ + public serviceAccountAuthConfig?: (google.cloud.ces.v1beta.IServiceAccountAuthConfig|null); + + /** ApiAuthentication bearerTokenConfig. */ + public bearerTokenConfig?: (google.cloud.ces.v1beta.IBearerTokenConfig|null); + + /** ApiAuthentication authConfig. */ + public authConfig?: ("apiKeyConfig"|"oauthConfig"|"serviceAgentIdTokenAuthConfig"|"serviceAccountAuthConfig"|"bearerTokenConfig"); + + /** + * Creates a new ApiAuthentication instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiAuthentication instance + */ + public static create(properties?: google.cloud.ces.v1beta.IApiAuthentication): google.cloud.ces.v1beta.ApiAuthentication; + + /** + * Encodes the specified ApiAuthentication message. Does not implicitly {@link google.cloud.ces.v1beta.ApiAuthentication.verify|verify} messages. + * @param message ApiAuthentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IApiAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiAuthentication message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ApiAuthentication.verify|verify} messages. + * @param message ApiAuthentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IApiAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiAuthentication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiAuthentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ApiAuthentication; + + /** + * Decodes an ApiAuthentication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiAuthentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ApiAuthentication; + + /** + * Verifies an ApiAuthentication message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApiAuthentication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiAuthentication + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ApiAuthentication; + + /** + * Creates a plain object from an ApiAuthentication message. Also converts values to other types if specified. + * @param message ApiAuthentication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ApiAuthentication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiAuthentication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiAuthentication + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataStoreTool. */ + interface IDataStoreTool { + + /** DataStoreTool dataStoreSource */ + dataStoreSource?: (google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource|null); + + /** DataStoreTool engineSource */ + engineSource?: (google.cloud.ces.v1beta.DataStoreTool.IEngineSource|null); + + /** DataStoreTool name */ + name?: (string|null); + + /** DataStoreTool description */ + description?: (string|null); + + /** DataStoreTool boostSpecs */ + boostSpecs?: (google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs[]|null); + + /** DataStoreTool modalityConfigs */ + modalityConfigs?: (google.cloud.ces.v1beta.DataStoreTool.IModalityConfig[]|null); + + /** DataStoreTool filterParameterBehavior */ + filterParameterBehavior?: (google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior|keyof typeof google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior|null); + } + + /** Represents a DataStoreTool. */ + class DataStoreTool implements IDataStoreTool { + + /** + * Constructs a new DataStoreTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDataStoreTool); + + /** DataStoreTool dataStoreSource. */ + public dataStoreSource?: (google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource|null); + + /** DataStoreTool engineSource. */ + public engineSource?: (google.cloud.ces.v1beta.DataStoreTool.IEngineSource|null); + + /** DataStoreTool name. */ + public name: string; + + /** DataStoreTool description. */ + public description: string; + + /** DataStoreTool boostSpecs. */ + public boostSpecs: google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs[]; + + /** DataStoreTool modalityConfigs. */ + public modalityConfigs: google.cloud.ces.v1beta.DataStoreTool.IModalityConfig[]; + + /** DataStoreTool filterParameterBehavior. */ + public filterParameterBehavior: (google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior|keyof typeof google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior); + + /** DataStoreTool searchSource. */ + public searchSource?: ("dataStoreSource"|"engineSource"); + + /** + * Creates a new DataStoreTool instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStoreTool instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDataStoreTool): google.cloud.ces.v1beta.DataStoreTool; + + /** + * Encodes the specified DataStoreTool message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.verify|verify} messages. + * @param message DataStoreTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDataStoreTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStoreTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.verify|verify} messages. + * @param message DataStoreTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDataStoreTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStoreTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStoreTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool; + + /** + * Verifies a DataStoreTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataStoreTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStoreTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool; + + /** + * Creates a plain object from a DataStoreTool message. Also converts values to other types if specified. + * @param message DataStoreTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStoreTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStoreTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataStoreTool { + + /** Properties of a RewriterConfig. */ + interface IRewriterConfig { + + /** RewriterConfig modelSettings */ + modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** RewriterConfig prompt */ + prompt?: (string|null); + + /** RewriterConfig disabled */ + disabled?: (boolean|null); + } + + /** Represents a RewriterConfig. */ + class RewriterConfig implements IRewriterConfig { + + /** + * Constructs a new RewriterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig); + + /** RewriterConfig modelSettings. */ + public modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** RewriterConfig prompt. */ + public prompt: string; + + /** RewriterConfig disabled. */ + public disabled: boolean; + + /** + * Creates a new RewriterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RewriterConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig): google.cloud.ces.v1beta.DataStoreTool.RewriterConfig; + + /** + * Encodes the specified RewriterConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.verify|verify} messages. + * @param message RewriterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RewriterConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.verify|verify} messages. + * @param message RewriterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RewriterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RewriterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.RewriterConfig; + + /** + * Decodes a RewriterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RewriterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.RewriterConfig; + + /** + * Verifies a RewriterConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RewriterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RewriterConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.RewriterConfig; + + /** + * Creates a plain object from a RewriterConfig message. Also converts values to other types if specified. + * @param message RewriterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.RewriterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RewriterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RewriterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SummarizationConfig. */ + interface ISummarizationConfig { + + /** SummarizationConfig modelSettings */ + modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** SummarizationConfig prompt */ + prompt?: (string|null); + + /** SummarizationConfig disabled */ + disabled?: (boolean|null); + } + + /** Represents a SummarizationConfig. */ + class SummarizationConfig implements ISummarizationConfig { + + /** + * Constructs a new SummarizationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig); + + /** SummarizationConfig modelSettings. */ + public modelSettings?: (google.cloud.ces.v1beta.IModelSettings|null); + + /** SummarizationConfig prompt. */ + public prompt: string; + + /** SummarizationConfig disabled. */ + public disabled: boolean; + + /** + * Creates a new SummarizationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SummarizationConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig): google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig; + + /** + * Encodes the specified SummarizationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.verify|verify} messages. + * @param message SummarizationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SummarizationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.verify|verify} messages. + * @param message SummarizationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SummarizationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SummarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig; + + /** + * Decodes a SummarizationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SummarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig; + + /** + * Verifies a SummarizationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SummarizationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SummarizationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig; + + /** + * Creates a plain object from a SummarizationConfig message. Also converts values to other types if specified. + * @param message SummarizationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SummarizationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SummarizationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroundingConfig. */ + interface IGroundingConfig { + + /** GroundingConfig groundingLevel */ + groundingLevel?: (number|null); + + /** GroundingConfig disabled */ + disabled?: (boolean|null); + } + + /** Represents a GroundingConfig. */ + class GroundingConfig implements IGroundingConfig { + + /** + * Constructs a new GroundingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig); + + /** GroundingConfig groundingLevel. */ + public groundingLevel: number; + + /** GroundingConfig disabled. */ + public disabled: boolean; + + /** + * Creates a new GroundingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GroundingConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig): google.cloud.ces.v1beta.DataStoreTool.GroundingConfig; + + /** + * Encodes the specified GroundingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.verify|verify} messages. + * @param message GroundingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroundingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.verify|verify} messages. + * @param message GroundingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroundingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroundingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.GroundingConfig; + + /** + * Decodes a GroundingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroundingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.GroundingConfig; + + /** + * Verifies a GroundingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroundingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroundingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.GroundingConfig; + + /** + * Creates a plain object from a GroundingConfig message. Also converts values to other types if specified. + * @param message GroundingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.GroundingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroundingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroundingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataStoreSource. */ + interface IDataStoreSource { + + /** DataStoreSource filter */ + filter?: (string|null); + + /** DataStoreSource dataStore */ + dataStore?: (google.cloud.ces.v1beta.IDataStore|null); + } + + /** Represents a DataStoreSource. */ + class DataStoreSource implements IDataStoreSource { + + /** + * Constructs a new DataStoreSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource); + + /** DataStoreSource filter. */ + public filter: string; + + /** DataStoreSource dataStore. */ + public dataStore?: (google.cloud.ces.v1beta.IDataStore|null); + + /** + * Creates a new DataStoreSource instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStoreSource instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource): google.cloud.ces.v1beta.DataStoreTool.DataStoreSource; + + /** + * Encodes the specified DataStoreSource message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.verify|verify} messages. + * @param message DataStoreSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStoreSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.verify|verify} messages. + * @param message DataStoreSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStoreSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStoreSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.DataStoreSource; + + /** + * Decodes a DataStoreSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStoreSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.DataStoreSource; + + /** + * Verifies a DataStoreSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataStoreSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStoreSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.DataStoreSource; + + /** + * Creates a plain object from a DataStoreSource message. Also converts values to other types if specified. + * @param message DataStoreSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.DataStoreSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStoreSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStoreSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EngineSource. */ + interface IEngineSource { + + /** EngineSource engine */ + engine?: (string|null); + + /** EngineSource dataStoreSources */ + dataStoreSources?: (google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource[]|null); + + /** EngineSource filter */ + filter?: (string|null); + } + + /** Represents an EngineSource. */ + class EngineSource implements IEngineSource { + + /** + * Constructs a new EngineSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IEngineSource); + + /** EngineSource engine. */ + public engine: string; + + /** EngineSource dataStoreSources. */ + public dataStoreSources: google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource[]; + + /** EngineSource filter. */ + public filter: string; + + /** + * Creates a new EngineSource instance using the specified properties. + * @param [properties] Properties to set + * @returns EngineSource instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IEngineSource): google.cloud.ces.v1beta.DataStoreTool.EngineSource; + + /** + * Encodes the specified EngineSource message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.EngineSource.verify|verify} messages. + * @param message EngineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IEngineSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EngineSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.EngineSource.verify|verify} messages. + * @param message EngineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IEngineSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EngineSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EngineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.EngineSource; + + /** + * Decodes an EngineSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EngineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.EngineSource; + + /** + * Verifies an EngineSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EngineSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EngineSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.EngineSource; + + /** + * Creates a plain object from an EngineSource message. Also converts values to other types if specified. + * @param message EngineSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.EngineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EngineSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EngineSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoostSpecs. */ + interface IBoostSpecs { + + /** BoostSpecs dataStores */ + dataStores?: (string[]|null); + + /** BoostSpecs spec */ + spec?: (google.cloud.ces.v1beta.DataStoreTool.IBoostSpec[]|null); + } + + /** Represents a BoostSpecs. */ + class BoostSpecs implements IBoostSpecs { + + /** + * Constructs a new BoostSpecs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs); + + /** BoostSpecs dataStores. */ + public dataStores: string[]; + + /** BoostSpecs spec. */ + public spec: google.cloud.ces.v1beta.DataStoreTool.IBoostSpec[]; + + /** + * Creates a new BoostSpecs instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostSpecs instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs): google.cloud.ces.v1beta.DataStoreTool.BoostSpecs; + + /** + * Encodes the specified BoostSpecs message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.verify|verify} messages. + * @param message BoostSpecs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostSpecs message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.verify|verify} messages. + * @param message BoostSpecs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.BoostSpecs; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.BoostSpecs; + + /** + * Verifies a BoostSpecs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoostSpecs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostSpecs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.BoostSpecs; + + /** + * Creates a plain object from a BoostSpecs message. Also converts values to other types if specified. + * @param message BoostSpecs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpecs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostSpecs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostSpecs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoostSpec. */ + interface IBoostSpec { + + /** BoostSpec conditionBoostSpecs */ + conditionBoostSpecs?: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec[]|null); + } + + /** Represents a BoostSpec. */ + class BoostSpec implements IBoostSpec { + + /** + * Constructs a new BoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IBoostSpec); + + /** BoostSpec conditionBoostSpecs. */ + public conditionBoostSpecs: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec[]; + + /** + * Creates a new BoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostSpec instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IBoostSpec): google.cloud.ces.v1beta.DataStoreTool.BoostSpec; + + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.BoostSpec; + + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.BoostSpec; + + /** + * Verifies a BoostSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.BoostSpec; + + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @param message BoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BoostSpec { + + /** Properties of a ConditionBoostSpec. */ + interface IConditionBoostSpec { + + /** ConditionBoostSpec condition */ + condition?: (string|null); + + /** ConditionBoostSpec boost */ + boost?: (number|null); + + /** ConditionBoostSpec boostControlSpec */ + boostControlSpec?: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null); + } + + /** Represents a ConditionBoostSpec. */ + class ConditionBoostSpec implements IConditionBoostSpec { + + /** + * Constructs a new ConditionBoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec); + + /** ConditionBoostSpec condition. */ + public condition: string; + + /** ConditionBoostSpec boost. */ + public boost: number; + + /** ConditionBoostSpec boostControlSpec. */ + public boostControlSpec?: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null); + + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionBoostSpec instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec; + + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec; + + /** + * Verifies a ConditionBoostSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionBoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec; + + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @param message ConditionBoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionBoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConditionBoostSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConditionBoostSpec { + + /** Properties of a BoostControlSpec. */ + interface IBoostControlSpec { + + /** BoostControlSpec fieldName */ + fieldName?: (string|null); + + /** BoostControlSpec attributeType */ + attributeType?: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|keyof typeof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|null); + + /** BoostControlSpec interpolationType */ + interpolationType?: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|keyof typeof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|null); + + /** BoostControlSpec controlPoints */ + controlPoints?: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint[]|null); + } + + /** Represents a BoostControlSpec. */ + class BoostControlSpec implements IBoostControlSpec { + + /** + * Constructs a new BoostControlSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec); + + /** BoostControlSpec fieldName. */ + public fieldName: string; + + /** BoostControlSpec attributeType. */ + public attributeType: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|keyof typeof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType); + + /** BoostControlSpec interpolationType. */ + public interpolationType: (google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|keyof typeof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType); + + /** BoostControlSpec controlPoints. */ + public controlPoints: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint[]; + + /** + * Creates a new BoostControlSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostControlSpec instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Encodes the specified BoostControlSpec message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @param message BoostControlSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostControlSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @param message BoostControlSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Verifies a BoostControlSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoostControlSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostControlSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Creates a plain object from a BoostControlSpec message. Also converts values to other types if specified. + * @param message BoostControlSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostControlSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostControlSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BoostControlSpec { + + /** Properties of a ControlPoint. */ + interface IControlPoint { + + /** ControlPoint attributeValue */ + attributeValue?: (string|null); + + /** ControlPoint boostAmount */ + boostAmount?: (number|null); + } + + /** Represents a ControlPoint. */ + class ControlPoint implements IControlPoint { + + /** + * Constructs a new ControlPoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint); + + /** ControlPoint attributeValue. */ + public attributeValue: string; + + /** ControlPoint boostAmount. */ + public boostAmount: number; + + /** + * Creates a new ControlPoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ControlPoint instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Encodes the specified ControlPoint message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @param message ControlPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ControlPoint message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @param message ControlPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ControlPoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Decodes a ControlPoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Verifies a ControlPoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ControlPoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ControlPoint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Creates a plain object from a ControlPoint message. Also converts values to other types if specified. + * @param message ControlPoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ControlPoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ControlPoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** AttributeType enum. */ + enum AttributeType { + ATTRIBUTE_TYPE_UNSPECIFIED = 0, + NUMERICAL = 1, + FRESHNESS = 2 + } + + /** InterpolationType enum. */ + enum InterpolationType { + INTERPOLATION_TYPE_UNSPECIFIED = 0, + LINEAR = 1 + } + } + } + } + + /** Properties of a ModalityConfig. */ + interface IModalityConfig { + + /** ModalityConfig modalityType */ + modalityType?: (google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType|keyof typeof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType|null); + + /** ModalityConfig rewriterConfig */ + rewriterConfig?: (google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig|null); + + /** ModalityConfig summarizationConfig */ + summarizationConfig?: (google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig|null); + + /** ModalityConfig groundingConfig */ + groundingConfig?: (google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig|null); + } + + /** Represents a ModalityConfig. */ + class ModalityConfig implements IModalityConfig { + + /** + * Constructs a new ModalityConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStoreTool.IModalityConfig); + + /** ModalityConfig modalityType. */ + public modalityType: (google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType|keyof typeof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType); + + /** ModalityConfig rewriterConfig. */ + public rewriterConfig?: (google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig|null); + + /** ModalityConfig summarizationConfig. */ + public summarizationConfig?: (google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig|null); + + /** ModalityConfig groundingConfig. */ + public groundingConfig?: (google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig|null); + + /** + * Creates a new ModalityConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ModalityConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStoreTool.IModalityConfig): google.cloud.ces.v1beta.DataStoreTool.ModalityConfig; + + /** + * Encodes the specified ModalityConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.verify|verify} messages. + * @param message ModalityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStoreTool.IModalityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModalityConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.verify|verify} messages. + * @param message ModalityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStoreTool.IModalityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModalityConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModalityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStoreTool.ModalityConfig; + + /** + * Decodes a ModalityConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModalityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStoreTool.ModalityConfig; + + /** + * Verifies a ModalityConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModalityConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModalityConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStoreTool.ModalityConfig; + + /** + * Creates a plain object from a ModalityConfig message. Also converts values to other types if specified. + * @param message ModalityConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStoreTool.ModalityConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModalityConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModalityConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ModalityConfig { + + /** ModalityType enum. */ + enum ModalityType { + MODALITY_TYPE_UNSPECIFIED = 0, + TEXT = 1, + AUDIO = 2 + } + } + + /** FilterParameterBehavior enum. */ + enum FilterParameterBehavior { + FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED = 0, + ALWAYS_INCLUDE = 2, + NEVER_INCLUDE = 3 + } + } + + /** Properties of a DataStore. */ + interface IDataStore { + + /** DataStore name */ + name?: (string|null); + + /** DataStore type */ + type?: (google.cloud.ces.v1beta.DataStore.DataStoreType|keyof typeof google.cloud.ces.v1beta.DataStore.DataStoreType|null); + + /** DataStore documentProcessingMode */ + documentProcessingMode?: (google.cloud.ces.v1beta.DataStore.DocumentProcessingMode|keyof typeof google.cloud.ces.v1beta.DataStore.DocumentProcessingMode|null); + + /** DataStore displayName */ + displayName?: (string|null); + + /** DataStore createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DataStore connectorConfig */ + connectorConfig?: (google.cloud.ces.v1beta.DataStore.IConnectorConfig|null); + } + + /** Represents a DataStore. */ + class DataStore implements IDataStore { + + /** + * Constructs a new DataStore. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDataStore); + + /** DataStore name. */ + public name: string; + + /** DataStore type. */ + public type: (google.cloud.ces.v1beta.DataStore.DataStoreType|keyof typeof google.cloud.ces.v1beta.DataStore.DataStoreType); + + /** DataStore documentProcessingMode. */ + public documentProcessingMode: (google.cloud.ces.v1beta.DataStore.DocumentProcessingMode|keyof typeof google.cloud.ces.v1beta.DataStore.DocumentProcessingMode); + + /** DataStore displayName. */ + public displayName: string; + + /** DataStore createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DataStore connectorConfig. */ + public connectorConfig?: (google.cloud.ces.v1beta.DataStore.IConnectorConfig|null); + + /** + * Creates a new DataStore instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStore instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDataStore): google.cloud.ces.v1beta.DataStore; + + /** + * Encodes the specified DataStore message. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.verify|verify} messages. + * @param message DataStore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDataStore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStore message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.verify|verify} messages. + * @param message DataStore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDataStore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStore message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStore; + + /** + * Decodes a DataStore message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStore; + + /** + * Verifies a DataStore message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataStore message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStore + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStore; + + /** + * Creates a plain object from a DataStore message. Also converts values to other types if specified. + * @param message DataStore + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStore, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStore to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStore + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataStore { + + /** Properties of a ConnectorConfig. */ + interface IConnectorConfig { + + /** ConnectorConfig collection */ + collection?: (string|null); + + /** ConnectorConfig collectionDisplayName */ + collectionDisplayName?: (string|null); + + /** ConnectorConfig dataSource */ + dataSource?: (string|null); + } + + /** Represents a ConnectorConfig. */ + class ConnectorConfig implements IConnectorConfig { + + /** + * Constructs a new ConnectorConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.DataStore.IConnectorConfig); + + /** ConnectorConfig collection. */ + public collection: string; + + /** ConnectorConfig collectionDisplayName. */ + public collectionDisplayName: string; + + /** ConnectorConfig dataSource. */ + public dataSource: string; + + /** + * Creates a new ConnectorConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectorConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.DataStore.IConnectorConfig): google.cloud.ces.v1beta.DataStore.ConnectorConfig; + + /** + * Encodes the specified ConnectorConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.ConnectorConfig.verify|verify} messages. + * @param message ConnectorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.DataStore.IConnectorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectorConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.ConnectorConfig.verify|verify} messages. + * @param message ConnectorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.DataStore.IConnectorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectorConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DataStore.ConnectorConfig; + + /** + * Decodes a ConnectorConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DataStore.ConnectorConfig; + + /** + * Verifies a ConnectorConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectorConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectorConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DataStore.ConnectorConfig; + + /** + * Creates a plain object from a ConnectorConfig message. Also converts values to other types if specified. + * @param message ConnectorConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DataStore.ConnectorConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectorConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectorConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DataStoreType enum. */ + enum DataStoreType { + DATA_STORE_TYPE_UNSPECIFIED = 0, + PUBLIC_WEB = 1, + UNSTRUCTURED = 2, + FAQ = 3, + CONNECTOR = 4 + } + + /** DocumentProcessingMode enum. */ + enum DocumentProcessingMode { + DOCUMENT_PROCESSING_MODE_UNSPECIFIED = 0, + DOCUMENTS = 1, + CHUNKS = 2 + } + } + + /** Properties of a FileSearchTool. */ + interface IFileSearchTool { + + /** FileSearchTool corpusType */ + corpusType?: (google.cloud.ces.v1beta.FileSearchTool.CorpusType|keyof typeof google.cloud.ces.v1beta.FileSearchTool.CorpusType|null); + + /** FileSearchTool name */ + name?: (string|null); + + /** FileSearchTool description */ + description?: (string|null); + + /** FileSearchTool fileCorpus */ + fileCorpus?: (string|null); + } + + /** Represents a FileSearchTool. */ + class FileSearchTool implements IFileSearchTool { + + /** + * Constructs a new FileSearchTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IFileSearchTool); + + /** FileSearchTool corpusType. */ + public corpusType: (google.cloud.ces.v1beta.FileSearchTool.CorpusType|keyof typeof google.cloud.ces.v1beta.FileSearchTool.CorpusType); + + /** FileSearchTool name. */ + public name: string; + + /** FileSearchTool description. */ + public description: string; + + /** FileSearchTool fileCorpus. */ + public fileCorpus: string; + + /** + * Creates a new FileSearchTool instance using the specified properties. + * @param [properties] Properties to set + * @returns FileSearchTool instance + */ + public static create(properties?: google.cloud.ces.v1beta.IFileSearchTool): google.cloud.ces.v1beta.FileSearchTool; + + /** + * Encodes the specified FileSearchTool message. Does not implicitly {@link google.cloud.ces.v1beta.FileSearchTool.verify|verify} messages. + * @param message FileSearchTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IFileSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.FileSearchTool.verify|verify} messages. + * @param message FileSearchTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IFileSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileSearchTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.FileSearchTool; + + /** + * Decodes a FileSearchTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.FileSearchTool; + + /** + * Verifies a FileSearchTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileSearchTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileSearchTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.FileSearchTool; + + /** + * Creates a plain object from a FileSearchTool message. Also converts values to other types if specified. + * @param message FileSearchTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.FileSearchTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileSearchTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileSearchTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileSearchTool { + + /** CorpusType enum. */ + enum CorpusType { + CORPUS_TYPE_UNSPECIFIED = 0, + USER_OWNED = 1, + FULLY_MANAGED = 2 + } + } + + /** Properties of a GoogleSearchTool. */ + interface IGoogleSearchTool { + + /** GoogleSearchTool name */ + name?: (string|null); + + /** GoogleSearchTool description */ + description?: (string|null); + + /** GoogleSearchTool contextUrls */ + contextUrls?: (string[]|null); + + /** GoogleSearchTool preferredDomains */ + preferredDomains?: (string[]|null); + + /** GoogleSearchTool excludeDomains */ + excludeDomains?: (string[]|null); + + /** GoogleSearchTool promptConfig */ + promptConfig?: (google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig|null); + } + + /** Represents a GoogleSearchTool. */ + class GoogleSearchTool implements IGoogleSearchTool { + + /** + * Constructs a new GoogleSearchTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGoogleSearchTool); + + /** GoogleSearchTool name. */ + public name: string; + + /** GoogleSearchTool description. */ + public description: string; + + /** GoogleSearchTool contextUrls. */ + public contextUrls: string[]; + + /** GoogleSearchTool preferredDomains. */ + public preferredDomains: string[]; + + /** GoogleSearchTool excludeDomains. */ + public excludeDomains: string[]; + + /** GoogleSearchTool promptConfig. */ + public promptConfig?: (google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig|null); + + /** + * Creates a new GoogleSearchTool instance using the specified properties. + * @param [properties] Properties to set + * @returns GoogleSearchTool instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGoogleSearchTool): google.cloud.ces.v1beta.GoogleSearchTool; + + /** + * Encodes the specified GoogleSearchTool message. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.verify|verify} messages. + * @param message GoogleSearchTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGoogleSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoogleSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.verify|verify} messages. + * @param message GoogleSearchTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGoogleSearchTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoogleSearchTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoogleSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GoogleSearchTool; + + /** + * Decodes a GoogleSearchTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoogleSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GoogleSearchTool; + + /** + * Verifies a GoogleSearchTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoogleSearchTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoogleSearchTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GoogleSearchTool; + + /** + * Creates a plain object from a GoogleSearchTool message. Also converts values to other types if specified. + * @param message GoogleSearchTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GoogleSearchTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoogleSearchTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoogleSearchTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GoogleSearchTool { + + /** Properties of a PromptConfig. */ + interface IPromptConfig { + + /** PromptConfig textPrompt */ + textPrompt?: (string|null); + + /** PromptConfig voicePrompt */ + voicePrompt?: (string|null); + } + + /** Represents a PromptConfig. */ + class PromptConfig implements IPromptConfig { + + /** + * Constructs a new PromptConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig); + + /** PromptConfig textPrompt. */ + public textPrompt: string; + + /** PromptConfig voicePrompt. */ + public voicePrompt: string; + + /** + * Creates a new PromptConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PromptConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig): google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig; + + /** + * Encodes the specified PromptConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.verify|verify} messages. + * @param message PromptConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PromptConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.verify|verify} messages. + * @param message PromptConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PromptConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PromptConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig; + + /** + * Decodes a PromptConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PromptConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig; + + /** + * Verifies a PromptConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PromptConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PromptConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig; + + /** + * Creates a plain object from a PromptConfig message. Also converts values to other types if specified. + * @param message PromptConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PromptConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PromptConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a McpTool. */ + interface IMcpTool { + + /** McpTool name */ + name?: (string|null); + + /** McpTool description */ + description?: (string|null); + + /** McpTool inputSchema */ + inputSchema?: (google.cloud.ces.v1beta.ISchema|null); + + /** McpTool outputSchema */ + outputSchema?: (google.cloud.ces.v1beta.ISchema|null); + + /** McpTool serverAddress */ + serverAddress?: (string|null); + + /** McpTool apiAuthentication */ + apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); + + /** McpTool tlsConfig */ + tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); + + /** McpTool serviceDirectoryConfig */ + serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); + } + + /** Represents a McpTool. */ + class McpTool implements IMcpTool { + + /** + * Constructs a new McpTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IMcpTool); + + /** McpTool name. */ + public name: string; + + /** McpTool description. */ + public description: string; + + /** McpTool inputSchema. */ + public inputSchema?: (google.cloud.ces.v1beta.ISchema|null); + + /** McpTool outputSchema. */ + public outputSchema?: (google.cloud.ces.v1beta.ISchema|null); + + /** McpTool serverAddress. */ + public serverAddress: string; + + /** McpTool apiAuthentication. */ + public apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); + + /** McpTool tlsConfig. */ + public tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); + + /** McpTool serviceDirectoryConfig. */ + public serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); + + /** + * Creates a new McpTool instance using the specified properties. + * @param [properties] Properties to set + * @returns McpTool instance + */ + public static create(properties?: google.cloud.ces.v1beta.IMcpTool): google.cloud.ces.v1beta.McpTool; + + /** + * Encodes the specified McpTool message. Does not implicitly {@link google.cloud.ces.v1beta.McpTool.verify|verify} messages. + * @param message McpTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IMcpTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified McpTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.McpTool.verify|verify} messages. + * @param message McpTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IMcpTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a McpTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns McpTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.McpTool; + + /** + * Decodes a McpTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns McpTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.McpTool; + + /** + * Verifies a McpTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a McpTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns McpTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.McpTool; + + /** + * Creates a plain object from a McpTool message. Also converts values to other types if specified. + * @param message McpTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.McpTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this McpTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for McpTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OpenApiTool. */ + interface IOpenApiTool { + + /** OpenApiTool openApiSchema */ + openApiSchema?: (string|null); + + /** OpenApiTool name */ + name?: (string|null); + + /** OpenApiTool description */ + description?: (string|null); + + /** OpenApiTool apiAuthentication */ + apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); + + /** OpenApiTool tlsConfig */ + tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); + + /** OpenApiTool serviceDirectoryConfig */ + serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); + + /** OpenApiTool ignoreUnknownFields */ + ignoreUnknownFields?: (boolean|null); + + /** OpenApiTool url */ + url?: (string|null); + } + + /** Represents an OpenApiTool. */ + class OpenApiTool implements IOpenApiTool { + + /** + * Constructs a new OpenApiTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IOpenApiTool); + + /** OpenApiTool openApiSchema. */ + public openApiSchema: string; + + /** OpenApiTool name. */ + public name: string; + + /** OpenApiTool description. */ + public description: string; + + /** OpenApiTool apiAuthentication. */ + public apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); + + /** OpenApiTool tlsConfig. */ + public tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); + + /** OpenApiTool serviceDirectoryConfig. */ + public serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); + + /** OpenApiTool ignoreUnknownFields. */ + public ignoreUnknownFields: boolean; + + /** OpenApiTool url. */ + public url: string; + + /** + * Creates a new OpenApiTool instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenApiTool instance + */ + public static create(properties?: google.cloud.ces.v1beta.IOpenApiTool): google.cloud.ces.v1beta.OpenApiTool; + + /** + * Encodes the specified OpenApiTool message. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiTool.verify|verify} messages. + * @param message OpenApiTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IOpenApiTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OpenApiTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiTool.verify|verify} messages. + * @param message OpenApiTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IOpenApiTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenApiTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OpenApiTool; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenApiTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OpenApiTool; + + /** + * Verifies an OpenApiTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OpenApiTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenApiTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OpenApiTool; + + /** + * Creates a plain object from an OpenApiTool message. Also converts values to other types if specified. + * @param message OpenApiTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OpenApiTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OpenApiTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OpenApiTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonFunction. */ + interface IPythonFunction { + + /** PythonFunction name */ + name?: (string|null); + + /** PythonFunction pythonCode */ + pythonCode?: (string|null); + + /** PythonFunction description */ + description?: (string|null); + } + + /** Represents a PythonFunction. */ + class PythonFunction implements IPythonFunction { + + /** + * Constructs a new PythonFunction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IPythonFunction); + + /** PythonFunction name. */ + public name: string; + + /** PythonFunction pythonCode. */ + public pythonCode: string; + + /** PythonFunction description. */ + public description: string; + + /** + * Creates a new PythonFunction instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonFunction instance + */ + public static create(properties?: google.cloud.ces.v1beta.IPythonFunction): google.cloud.ces.v1beta.PythonFunction; + + /** + * Encodes the specified PythonFunction message. Does not implicitly {@link google.cloud.ces.v1beta.PythonFunction.verify|verify} messages. + * @param message PythonFunction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IPythonFunction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.PythonFunction.verify|verify} messages. + * @param message PythonFunction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IPythonFunction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonFunction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.PythonFunction; + + /** + * Decodes a PythonFunction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.PythonFunction; + + /** + * Verifies a PythonFunction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonFunction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonFunction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.PythonFunction; + + /** + * Creates a plain object from a PythonFunction message. Also converts values to other types if specified. + * @param message PythonFunction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.PythonFunction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonFunction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonFunction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SystemTool. */ + interface ISystemTool { + + /** SystemTool name */ + name?: (string|null); + + /** SystemTool description */ + description?: (string|null); + } + + /** Represents a SystemTool. */ + class SystemTool implements ISystemTool { + + /** + * Constructs a new SystemTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ISystemTool); + + /** SystemTool name. */ + public name: string; + + /** SystemTool description. */ + public description: string; + + /** + * Creates a new SystemTool instance using the specified properties. + * @param [properties] Properties to set + * @returns SystemTool instance + */ + public static create(properties?: google.cloud.ces.v1beta.ISystemTool): google.cloud.ces.v1beta.SystemTool; + + /** + * Encodes the specified SystemTool message. Does not implicitly {@link google.cloud.ces.v1beta.SystemTool.verify|verify} messages. + * @param message SystemTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ISystemTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SystemTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SystemTool.verify|verify} messages. + * @param message SystemTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ISystemTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SystemTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SystemTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SystemTool; + + /** + * Decodes a SystemTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SystemTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SystemTool; + + /** + * Verifies a SystemTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SystemTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SystemTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SystemTool; + + /** + * Creates a plain object from a SystemTool message. Also converts values to other types if specified. + * @param message SystemTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.SystemTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SystemTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SystemTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WidgetTool. */ + interface IWidgetTool { + + /** WidgetTool parameters */ + parameters?: (google.cloud.ces.v1beta.ISchema|null); + + /** WidgetTool name */ + name?: (string|null); + + /** WidgetTool description */ + description?: (string|null); + + /** WidgetTool widgetType */ + widgetType?: (google.cloud.ces.v1beta.WidgetTool.WidgetType|keyof typeof google.cloud.ces.v1beta.WidgetTool.WidgetType|null); + } + + /** Represents a WidgetTool. */ + class WidgetTool implements IWidgetTool { + + /** + * Constructs a new WidgetTool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IWidgetTool); + + /** WidgetTool parameters. */ + public parameters?: (google.cloud.ces.v1beta.ISchema|null); + + /** WidgetTool name. */ + public name: string; + + /** WidgetTool description. */ + public description: string; + + /** WidgetTool widgetType. */ + public widgetType: (google.cloud.ces.v1beta.WidgetTool.WidgetType|keyof typeof google.cloud.ces.v1beta.WidgetTool.WidgetType); + + /** WidgetTool input. */ + public input?: "parameters"; + + /** + * Creates a new WidgetTool instance using the specified properties. + * @param [properties] Properties to set + * @returns WidgetTool instance + */ + public static create(properties?: google.cloud.ces.v1beta.IWidgetTool): google.cloud.ces.v1beta.WidgetTool; + + /** + * Encodes the specified WidgetTool message. Does not implicitly {@link google.cloud.ces.v1beta.WidgetTool.verify|verify} messages. + * @param message WidgetTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IWidgetTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WidgetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.WidgetTool.verify|verify} messages. + * @param message WidgetTool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IWidgetTool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WidgetTool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WidgetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.WidgetTool; + + /** + * Decodes a WidgetTool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WidgetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.WidgetTool; + + /** + * Verifies a WidgetTool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WidgetTool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WidgetTool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.WidgetTool; + + /** + * Creates a plain object from a WidgetTool message. Also converts values to other types if specified. + * @param message WidgetTool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.WidgetTool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WidgetTool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WidgetTool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WidgetTool { + + /** WidgetType enum. */ + enum WidgetType { + WIDGET_TYPE_UNSPECIFIED = 0, + CUSTOM = 1, + PRODUCT_CAROUSEL = 2, + PRODUCT_DETAILS = 3, + QUICK_ACTIONS = 4, + PRODUCT_COMPARISON = 5, + ADVANCED_PRODUCT_DETAILS = 6, + SHORT_FORM = 7, + OVERALL_SATISFACTION = 8, + ORDER_SUMMARY = 9, + APPOINTMENT_DETAILS = 10, + APPOINTMENT_SCHEDULER = 11, + CONTACT_FORM = 12 + } + } + + /** Properties of a Toolset. */ + interface IToolset { + + /** Toolset mcpToolset */ + mcpToolset?: (google.cloud.ces.v1beta.IMcpToolset|null); + + /** Toolset openApiToolset */ + openApiToolset?: (google.cloud.ces.v1beta.IOpenApiToolset|null); + + /** Toolset connectorToolset */ + connectorToolset?: (google.cloud.ces.v1beta.IConnectorToolset|null); + + /** Toolset name */ + name?: (string|null); + + /** Toolset displayName */ + displayName?: (string|null); + + /** Toolset description */ + description?: (string|null); + + /** Toolset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Toolset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Toolset etag */ + etag?: (string|null); + + /** Toolset executionType */ + executionType?: (google.cloud.ces.v1beta.ExecutionType|keyof typeof google.cloud.ces.v1beta.ExecutionType|null); + + /** Toolset toolFakeConfig */ + toolFakeConfig?: (google.cloud.ces.v1beta.IToolFakeConfig|null); + } + + /** Represents a Toolset. */ + class Toolset implements IToolset { + + /** + * Constructs a new Toolset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IToolset); + + /** Toolset mcpToolset. */ + public mcpToolset?: (google.cloud.ces.v1beta.IMcpToolset|null); + + /** Toolset openApiToolset. */ + public openApiToolset?: (google.cloud.ces.v1beta.IOpenApiToolset|null); + + /** Toolset connectorToolset. */ + public connectorToolset?: (google.cloud.ces.v1beta.IConnectorToolset|null); + + /** Toolset name. */ + public name: string; + + /** Toolset displayName. */ + public displayName: string; + + /** Toolset description. */ + public description: string; + + /** Toolset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Toolset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Toolset etag. */ + public etag: string; + + /** Toolset executionType. */ + public executionType: (google.cloud.ces.v1beta.ExecutionType|keyof typeof google.cloud.ces.v1beta.ExecutionType); + + /** Toolset toolFakeConfig. */ + public toolFakeConfig?: (google.cloud.ces.v1beta.IToolFakeConfig|null); + + /** Toolset toolsetType. */ + public toolsetType?: ("mcpToolset"|"openApiToolset"|"connectorToolset"); + + /** + * Creates a new Toolset instance using the specified properties. + * @param [properties] Properties to set + * @returns Toolset instance + */ + public static create(properties?: google.cloud.ces.v1beta.IToolset): google.cloud.ces.v1beta.Toolset; + + /** + * Encodes the specified Toolset message. Does not implicitly {@link google.cloud.ces.v1beta.Toolset.verify|verify} messages. + * @param message Toolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Toolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Toolset.verify|verify} messages. + * @param message Toolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Toolset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Toolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Toolset; + + /** + * Decodes a Toolset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Toolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Toolset; + + /** + * Verifies a Toolset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Toolset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Toolset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Toolset; + + /** + * Creates a plain object from a Toolset message. Also converts values to other types if specified. + * @param message Toolset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Toolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Toolset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Toolset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConnectorToolset. */ + interface IConnectorToolset { + + /** ConnectorToolset connection */ + connection?: (string|null); + + /** ConnectorToolset authConfig */ + authConfig?: (google.cloud.ces.v1beta.IEndUserAuthConfig|null); + + /** ConnectorToolset connectorActions */ + connectorActions?: (google.cloud.ces.v1beta.IAction[]|null); + } + + /** Represents a ConnectorToolset. */ + class ConnectorToolset implements IConnectorToolset { + + /** + * Constructs a new ConnectorToolset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IConnectorToolset); + + /** ConnectorToolset connection. */ + public connection: string; + + /** ConnectorToolset authConfig. */ + public authConfig?: (google.cloud.ces.v1beta.IEndUserAuthConfig|null); + + /** ConnectorToolset connectorActions. */ + public connectorActions: google.cloud.ces.v1beta.IAction[]; + + /** + * Creates a new ConnectorToolset instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectorToolset instance + */ + public static create(properties?: google.cloud.ces.v1beta.IConnectorToolset): google.cloud.ces.v1beta.ConnectorToolset; + + /** + * Encodes the specified ConnectorToolset message. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorToolset.verify|verify} messages. + * @param message ConnectorToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IConnectorToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectorToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorToolset.verify|verify} messages. + * @param message ConnectorToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IConnectorToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectorToolset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectorToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ConnectorToolset; + + /** + * Decodes a ConnectorToolset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectorToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ConnectorToolset; + + /** + * Verifies a ConnectorToolset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectorToolset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectorToolset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ConnectorToolset; + + /** + * Creates a plain object from a ConnectorToolset message. Also converts values to other types if specified. + * @param message ConnectorToolset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ConnectorToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectorToolset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectorToolset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a McpToolset. */ + interface IMcpToolset { + + /** McpToolset serverAddress */ + serverAddress?: (string|null); + + /** McpToolset apiAuthentication */ + apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); + + /** McpToolset serviceDirectoryConfig */ + serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); + + /** McpToolset tlsConfig */ + tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); + } + + /** Represents a McpToolset. */ + class McpToolset implements IMcpToolset { + + /** + * Constructs a new McpToolset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IMcpToolset); + + /** McpToolset serverAddress. */ + public serverAddress: string; + + /** McpToolset apiAuthentication. */ + public apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); + + /** McpToolset serviceDirectoryConfig. */ + public serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); + + /** McpToolset tlsConfig. */ + public tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); + + /** + * Creates a new McpToolset instance using the specified properties. + * @param [properties] Properties to set + * @returns McpToolset instance + */ + public static create(properties?: google.cloud.ces.v1beta.IMcpToolset): google.cloud.ces.v1beta.McpToolset; + + /** + * Encodes the specified McpToolset message. Does not implicitly {@link google.cloud.ces.v1beta.McpToolset.verify|verify} messages. + * @param message McpToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IMcpToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified McpToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.McpToolset.verify|verify} messages. + * @param message McpToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IMcpToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a McpToolset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns McpToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.McpToolset; + + /** + * Decodes a McpToolset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns McpToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.McpToolset; + + /** + * Verifies a McpToolset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a McpToolset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns McpToolset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.McpToolset; + + /** + * Creates a plain object from a McpToolset message. Also converts values to other types if specified. + * @param message McpToolset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.McpToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this McpToolset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for McpToolset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OpenApiToolset. */ + interface IOpenApiToolset { + + /** OpenApiToolset openApiSchema */ + openApiSchema?: (string|null); + + /** OpenApiToolset apiAuthentication */ + apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); + + /** OpenApiToolset tlsConfig */ + tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); + + /** OpenApiToolset serviceDirectoryConfig */ + serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); + + /** OpenApiToolset ignoreUnknownFields */ + ignoreUnknownFields?: (boolean|null); + + /** OpenApiToolset url */ + url?: (string|null); + } + + /** Represents an OpenApiToolset. */ + class OpenApiToolset implements IOpenApiToolset { + + /** + * Constructs a new OpenApiToolset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IOpenApiToolset); + + /** OpenApiToolset openApiSchema. */ + public openApiSchema: string; + + /** OpenApiToolset apiAuthentication. */ + public apiAuthentication?: (google.cloud.ces.v1beta.IApiAuthentication|null); + + /** OpenApiToolset tlsConfig. */ + public tlsConfig?: (google.cloud.ces.v1beta.ITlsConfig|null); + + /** OpenApiToolset serviceDirectoryConfig. */ + public serviceDirectoryConfig?: (google.cloud.ces.v1beta.IServiceDirectoryConfig|null); + + /** OpenApiToolset ignoreUnknownFields. */ + public ignoreUnknownFields: boolean; + + /** OpenApiToolset url. */ + public url: string; + + /** + * Creates a new OpenApiToolset instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenApiToolset instance + */ + public static create(properties?: google.cloud.ces.v1beta.IOpenApiToolset): google.cloud.ces.v1beta.OpenApiToolset; + + /** + * Encodes the specified OpenApiToolset message. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiToolset.verify|verify} messages. + * @param message OpenApiToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IOpenApiToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OpenApiToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiToolset.verify|verify} messages. + * @param message OpenApiToolset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IOpenApiToolset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OpenApiToolset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenApiToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OpenApiToolset; + + /** + * Decodes an OpenApiToolset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenApiToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OpenApiToolset; + + /** + * Verifies an OpenApiToolset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OpenApiToolset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenApiToolset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OpenApiToolset; + + /** + * Creates a plain object from an OpenApiToolset message. Also converts values to other types if specified. + * @param message OpenApiToolset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OpenApiToolset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OpenApiToolset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OpenApiToolset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Changelog. */ + interface IChangelog { + + /** Changelog name */ + name?: (string|null); + + /** Changelog author */ + author?: (string|null); + + /** Changelog displayName */ + displayName?: (string|null); + + /** Changelog description */ + description?: (string|null); + + /** Changelog resource */ + resource?: (string|null); + + /** Changelog resourceType */ + resourceType?: (string|null); + + /** Changelog action */ + action?: (string|null); + + /** Changelog originalResource */ + originalResource?: (google.protobuf.IStruct|null); + + /** Changelog newResource */ + newResource?: (google.protobuf.IStruct|null); + + /** Changelog dependentResources */ + dependentResources?: (google.protobuf.IStruct[]|null); + + /** Changelog createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Changelog sequenceNumber */ + sequenceNumber?: (number|Long|string|null); + } + + /** Represents a Changelog. */ + class Changelog implements IChangelog { + + /** + * Constructs a new Changelog. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IChangelog); + + /** Changelog name. */ + public name: string; + + /** Changelog author. */ + public author: string; + + /** Changelog displayName. */ + public displayName: string; + + /** Changelog description. */ + public description: string; + + /** Changelog resource. */ + public resource: string; + + /** Changelog resourceType. */ + public resourceType: string; + + /** Changelog action. */ + public action: string; + + /** Changelog originalResource. */ + public originalResource?: (google.protobuf.IStruct|null); + + /** Changelog newResource. */ + public newResource?: (google.protobuf.IStruct|null); + + /** Changelog dependentResources. */ + public dependentResources: google.protobuf.IStruct[]; + + /** Changelog createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Changelog sequenceNumber. */ + public sequenceNumber: (number|Long|string); + + /** + * Creates a new Changelog instance using the specified properties. + * @param [properties] Properties to set + * @returns Changelog instance + */ + public static create(properties?: google.cloud.ces.v1beta.IChangelog): google.cloud.ces.v1beta.Changelog; + + /** + * Encodes the specified Changelog message. Does not implicitly {@link google.cloud.ces.v1beta.Changelog.verify|verify} messages. + * @param message Changelog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IChangelog, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Changelog message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Changelog.verify|verify} messages. + * @param message Changelog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IChangelog, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Changelog message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Changelog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Changelog; + + /** + * Decodes a Changelog message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Changelog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Changelog; + + /** + * Verifies a Changelog message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Changelog message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Changelog + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Changelog; + + /** + * Creates a plain object from a Changelog message. Also converts values to other types if specified. + * @param message Changelog + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Changelog, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Changelog to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Changelog + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Conversation. */ + interface IConversation { + + /** Conversation name */ + name?: (string|null); + + /** Conversation startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Conversation endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Conversation turns */ + turns?: (google.cloud.ces.v1beta.Conversation.ITurn[]|null); + + /** Conversation turnCount */ + turnCount?: (number|null); + + /** Conversation channelType */ + channelType?: (google.cloud.ces.v1beta.Conversation.ChannelType|keyof typeof google.cloud.ces.v1beta.Conversation.ChannelType|null); + + /** Conversation source */ + source?: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source|null); + + /** Conversation inputTypes */ + inputTypes?: (google.cloud.ces.v1beta.Conversation.InputType[]|null); + + /** Conversation entryAgent */ + entryAgent?: (string|null); + + /** Conversation deployment */ + deployment?: (string|null); + + /** Conversation appVersion */ + appVersion?: (string|null); + + /** Conversation languageCode */ + languageCode?: (string|null); + + /** Conversation messages */ + messages?: (google.cloud.ces.v1beta.IMessage[]|null); + } + + /** Represents a Conversation. */ + class Conversation implements IConversation { + + /** + * Constructs a new Conversation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IConversation); + + /** Conversation name. */ + public name: string; + + /** Conversation startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Conversation endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Conversation turns. */ + public turns: google.cloud.ces.v1beta.Conversation.ITurn[]; + + /** Conversation turnCount. */ + public turnCount: number; + + /** Conversation channelType. */ + public channelType: (google.cloud.ces.v1beta.Conversation.ChannelType|keyof typeof google.cloud.ces.v1beta.Conversation.ChannelType); + + /** Conversation source. */ + public source: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source); + + /** Conversation inputTypes. */ + public inputTypes: google.cloud.ces.v1beta.Conversation.InputType[]; + + /** Conversation entryAgent. */ + public entryAgent: string; + + /** Conversation deployment. */ + public deployment: string; + + /** Conversation appVersion. */ + public appVersion: string; + + /** Conversation languageCode. */ + public languageCode: string; + + /** Conversation messages. */ + public messages: google.cloud.ces.v1beta.IMessage[]; + + /** + * Creates a new Conversation instance using the specified properties. + * @param [properties] Properties to set + * @returns Conversation instance + */ + public static create(properties?: google.cloud.ces.v1beta.IConversation): google.cloud.ces.v1beta.Conversation; + + /** + * Encodes the specified Conversation message. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.verify|verify} messages. + * @param message Conversation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Conversation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.verify|verify} messages. + * @param message Conversation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Conversation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Conversation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Conversation; + + /** + * Decodes a Conversation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Conversation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Conversation; + + /** + * Verifies a Conversation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Conversation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Conversation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Conversation; + + /** + * Creates a plain object from a Conversation message. Also converts values to other types if specified. + * @param message Conversation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Conversation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Conversation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Conversation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Conversation { + + /** Properties of a Turn. */ + interface ITurn { + + /** Turn messages */ + messages?: (google.cloud.ces.v1beta.IMessage[]|null); + + /** Turn rootSpan */ + rootSpan?: (google.cloud.ces.v1beta.ISpan|null); + } + + /** Represents a Turn. */ + class Turn implements ITurn { + + /** + * Constructs a new Turn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Conversation.ITurn); + + /** Turn messages. */ + public messages: google.cloud.ces.v1beta.IMessage[]; + + /** Turn rootSpan. */ + public rootSpan?: (google.cloud.ces.v1beta.ISpan|null); + + /** + * Creates a new Turn instance using the specified properties. + * @param [properties] Properties to set + * @returns Turn instance + */ + public static create(properties?: google.cloud.ces.v1beta.Conversation.ITurn): google.cloud.ces.v1beta.Conversation.Turn; + + /** + * Encodes the specified Turn message. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.Turn.verify|verify} messages. + * @param message Turn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Conversation.ITurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Turn message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.Turn.verify|verify} messages. + * @param message Turn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Conversation.ITurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Turn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Conversation.Turn; + + /** + * Decodes a Turn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Conversation.Turn; + + /** + * Verifies a Turn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Turn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Turn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Conversation.Turn; + + /** + * Creates a plain object from a Turn message. Also converts values to other types if specified. + * @param message Turn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Conversation.Turn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Turn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Turn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ChannelType enum. */ + enum ChannelType { + CHANNEL_TYPE_UNSPECIFIED = 0, + TEXT = 1, + AUDIO = 2, + MULTIMODAL = 3 + } + + /** Source enum. */ + enum Source { + SOURCE_UNSPECIFIED = 0, + LIVE = 1, + SIMULATOR = 2, + EVAL = 3 + } + + /** InputType enum. */ + enum InputType { + INPUT_TYPE_UNSPECIFIED = 0, + INPUT_TYPE_TEXT = 1, + INPUT_TYPE_AUDIO = 2, + INPUT_TYPE_IMAGE = 3, + INPUT_TYPE_BLOB = 4, + INPUT_TYPE_TOOL_RESPONSE = 5, + INPUT_TYPE_VARIABLES = 6 + } + } + + /** Properties of a Deployment. */ + interface IDeployment { + + /** Deployment name */ + name?: (string|null); + + /** Deployment displayName */ + displayName?: (string|null); + + /** Deployment appVersion */ + appVersion?: (string|null); + + /** Deployment channelProfile */ + channelProfile?: (google.cloud.ces.v1beta.IChannelProfile|null); + + /** Deployment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Deployment updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Deployment etag */ + etag?: (string|null); + } + + /** Represents a Deployment. */ + class Deployment implements IDeployment { + + /** + * Constructs a new Deployment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeployment); + + /** Deployment name. */ + public name: string; + + /** Deployment displayName. */ + public displayName: string; + + /** Deployment appVersion. */ + public appVersion: string; + + /** Deployment channelProfile. */ + public channelProfile?: (google.cloud.ces.v1beta.IChannelProfile|null); + + /** Deployment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Deployment updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Deployment etag. */ + public etag: string; + + /** + * Creates a new Deployment instance using the specified properties. + * @param [properties] Properties to set + * @returns Deployment instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeployment): google.cloud.ces.v1beta.Deployment; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.ces.v1beta.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Deployment; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Deployment; + + /** + * Verifies a Deployment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Deployment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Deployment; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @param message Deployment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Deployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Deployment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Deployment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AggregatedMetrics. */ + interface IAggregatedMetrics { + + /** AggregatedMetrics metricsByAppVersion */ + metricsByAppVersion?: (google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion[]|null); + } + + /** Represents an AggregatedMetrics. */ + class AggregatedMetrics implements IAggregatedMetrics { + + /** + * Constructs a new AggregatedMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IAggregatedMetrics); + + /** AggregatedMetrics metricsByAppVersion. */ + public metricsByAppVersion: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion[]; + + /** + * Creates a new AggregatedMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedMetrics instance + */ + public static create(properties?: google.cloud.ces.v1beta.IAggregatedMetrics): google.cloud.ces.v1beta.AggregatedMetrics; + + /** + * Encodes the specified AggregatedMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.verify|verify} messages. + * @param message AggregatedMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IAggregatedMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.verify|verify} messages. + * @param message AggregatedMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IAggregatedMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics; + + /** + * Decodes an AggregatedMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics; + + /** + * Verifies an AggregatedMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics; + + /** + * Creates a plain object from an AggregatedMetrics message. Also converts values to other types if specified. + * @param message AggregatedMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AggregatedMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AggregatedMetrics { + + /** Properties of a ToolMetrics. */ + interface IToolMetrics { + + /** ToolMetrics tool */ + tool?: (string|null); + + /** ToolMetrics passCount */ + passCount?: (number|null); + + /** ToolMetrics failCount */ + failCount?: (number|null); + } + + /** Represents a ToolMetrics. */ + class ToolMetrics implements IToolMetrics { + + /** + * Constructs a new ToolMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics); + + /** ToolMetrics tool. */ + public tool: string; + + /** ToolMetrics passCount. */ + public passCount: number; + + /** ToolMetrics failCount. */ + public failCount: number; + + /** + * Creates a new ToolMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolMetrics instance + */ + public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics): google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics; + + /** + * Encodes the specified ToolMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.verify|verify} messages. + * @param message ToolMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.verify|verify} messages. + * @param message ToolMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics; + + /** + * Decodes a ToolMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics; + + /** + * Verifies a ToolMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics; + + /** + * Creates a plain object from a ToolMetrics message. Also converts values to other types if specified. + * @param message ToolMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TurnLatencyMetrics. */ + interface ITurnLatencyMetrics { + + /** TurnLatencyMetrics averageLatency */ + averageLatency?: (google.protobuf.IDuration|null); + } + + /** Represents a TurnLatencyMetrics. */ + class TurnLatencyMetrics implements ITurnLatencyMetrics { + + /** + * Constructs a new TurnLatencyMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics); + + /** TurnLatencyMetrics averageLatency. */ + public averageLatency?: (google.protobuf.IDuration|null); + + /** + * Creates a new TurnLatencyMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns TurnLatencyMetrics instance + */ + public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics): google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics; + + /** + * Encodes the specified TurnLatencyMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.verify|verify} messages. + * @param message TurnLatencyMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TurnLatencyMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.verify|verify} messages. + * @param message TurnLatencyMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TurnLatencyMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TurnLatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics; + + /** + * Decodes a TurnLatencyMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TurnLatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics; + + /** + * Verifies a TurnLatencyMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TurnLatencyMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TurnLatencyMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics; + + /** + * Creates a plain object from a TurnLatencyMetrics message. Also converts values to other types if specified. + * @param message TurnLatencyMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TurnLatencyMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TurnLatencyMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolCallLatencyMetrics. */ + interface IToolCallLatencyMetrics { + + /** ToolCallLatencyMetrics tool */ + tool?: (string|null); + + /** ToolCallLatencyMetrics averageLatency */ + averageLatency?: (google.protobuf.IDuration|null); + } + + /** Represents a ToolCallLatencyMetrics. */ + class ToolCallLatencyMetrics implements IToolCallLatencyMetrics { + + /** + * Constructs a new ToolCallLatencyMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics); + + /** ToolCallLatencyMetrics tool. */ + public tool: string; + + /** ToolCallLatencyMetrics averageLatency. */ + public averageLatency?: (google.protobuf.IDuration|null); + + /** + * Creates a new ToolCallLatencyMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolCallLatencyMetrics instance + */ + public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics): google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics; + + /** + * Encodes the specified ToolCallLatencyMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.verify|verify} messages. + * @param message ToolCallLatencyMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolCallLatencyMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.verify|verify} messages. + * @param message ToolCallLatencyMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolCallLatencyMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolCallLatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics; + + /** + * Decodes a ToolCallLatencyMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolCallLatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics; + + /** + * Verifies a ToolCallLatencyMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolCallLatencyMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolCallLatencyMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics; + + /** + * Creates a plain object from a ToolCallLatencyMetrics message. Also converts values to other types if specified. + * @param message ToolCallLatencyMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolCallLatencyMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolCallLatencyMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticSimilarityMetrics. */ + interface ISemanticSimilarityMetrics { + + /** SemanticSimilarityMetrics score */ + score?: (number|null); + } + + /** Represents a SemanticSimilarityMetrics. */ + class SemanticSimilarityMetrics implements ISemanticSimilarityMetrics { + + /** + * Constructs a new SemanticSimilarityMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics); + + /** SemanticSimilarityMetrics score. */ + public score: number; + + /** + * Creates a new SemanticSimilarityMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticSimilarityMetrics instance + */ + public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics): google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics; + + /** + * Encodes the specified SemanticSimilarityMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.verify|verify} messages. + * @param message SemanticSimilarityMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SemanticSimilarityMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.verify|verify} messages. + * @param message SemanticSimilarityMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticSimilarityMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SemanticSimilarityMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics; + + /** + * Decodes a SemanticSimilarityMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SemanticSimilarityMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics; + + /** + * Verifies a SemanticSimilarityMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SemanticSimilarityMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SemanticSimilarityMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics; + + /** + * Creates a plain object from a SemanticSimilarityMetrics message. Also converts values to other types if specified. + * @param message SemanticSimilarityMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SemanticSimilarityMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SemanticSimilarityMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HallucinationMetrics. */ + interface IHallucinationMetrics { + + /** HallucinationMetrics score */ + score?: (number|null); + } + + /** Represents a HallucinationMetrics. */ + class HallucinationMetrics implements IHallucinationMetrics { + + /** + * Constructs a new HallucinationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics); + + /** HallucinationMetrics score. */ + public score: number; + + /** + * Creates a new HallucinationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns HallucinationMetrics instance + */ + public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics): google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics; + + /** + * Encodes the specified HallucinationMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.verify|verify} messages. + * @param message HallucinationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HallucinationMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.verify|verify} messages. + * @param message HallucinationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HallucinationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HallucinationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics; + + /** + * Decodes a HallucinationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HallucinationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics; + + /** + * Verifies a HallucinationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HallucinationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HallucinationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics; + + /** + * Creates a plain object from a HallucinationMetrics message. Also converts values to other types if specified. + * @param message HallucinationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HallucinationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HallucinationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetricsByAppVersion. */ + interface IMetricsByAppVersion { + + /** MetricsByAppVersion appVersionId */ + appVersionId?: (string|null); + + /** MetricsByAppVersion toolMetrics */ + toolMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics[]|null); + + /** MetricsByAppVersion semanticSimilarityMetrics */ + semanticSimilarityMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics[]|null); + + /** MetricsByAppVersion hallucinationMetrics */ + hallucinationMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics[]|null); + + /** MetricsByAppVersion toolCallLatencyMetrics */ + toolCallLatencyMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics[]|null); + + /** MetricsByAppVersion turnLatencyMetrics */ + turnLatencyMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics[]|null); + + /** MetricsByAppVersion passCount */ + passCount?: (number|null); + + /** MetricsByAppVersion failCount */ + failCount?: (number|null); + + /** MetricsByAppVersion metricsByTurn */ + metricsByTurn?: (google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn[]|null); + } + + /** Represents a MetricsByAppVersion. */ + class MetricsByAppVersion implements IMetricsByAppVersion { + + /** + * Constructs a new MetricsByAppVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion); + + /** MetricsByAppVersion appVersionId. */ + public appVersionId: string; + + /** MetricsByAppVersion toolMetrics. */ + public toolMetrics: google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics[]; + + /** MetricsByAppVersion semanticSimilarityMetrics. */ + public semanticSimilarityMetrics: google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics[]; + + /** MetricsByAppVersion hallucinationMetrics. */ + public hallucinationMetrics: google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics[]; + + /** MetricsByAppVersion toolCallLatencyMetrics. */ + public toolCallLatencyMetrics: google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics[]; + + /** MetricsByAppVersion turnLatencyMetrics. */ + public turnLatencyMetrics: google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics[]; + + /** MetricsByAppVersion passCount. */ + public passCount: number; + + /** MetricsByAppVersion failCount. */ + public failCount: number; + + /** MetricsByAppVersion metricsByTurn. */ + public metricsByTurn: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn[]; + + /** + * Creates a new MetricsByAppVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricsByAppVersion instance + */ + public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion; + + /** + * Encodes the specified MetricsByAppVersion message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.verify|verify} messages. + * @param message MetricsByAppVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricsByAppVersion message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.verify|verify} messages. + * @param message MetricsByAppVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricsByAppVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricsByAppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion; + + /** + * Decodes a MetricsByAppVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricsByAppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion; + + /** + * Verifies a MetricsByAppVersion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetricsByAppVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricsByAppVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion; + + /** + * Creates a plain object from a MetricsByAppVersion message. Also converts values to other types if specified. + * @param message MetricsByAppVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricsByAppVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricsByAppVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetricsByTurn. */ + interface IMetricsByTurn { + + /** MetricsByTurn turnIndex */ + turnIndex?: (number|null); + + /** MetricsByTurn toolMetrics */ + toolMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics[]|null); + + /** MetricsByTurn semanticSimilarityMetrics */ + semanticSimilarityMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics[]|null); + + /** MetricsByTurn hallucinationMetrics */ + hallucinationMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics[]|null); + + /** MetricsByTurn toolCallLatencyMetrics */ + toolCallLatencyMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics[]|null); + + /** MetricsByTurn turnLatencyMetrics */ + turnLatencyMetrics?: (google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics[]|null); + } + + /** Represents a MetricsByTurn. */ + class MetricsByTurn implements IMetricsByTurn { + + /** + * Constructs a new MetricsByTurn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn); + + /** MetricsByTurn turnIndex. */ + public turnIndex: number; + + /** MetricsByTurn toolMetrics. */ + public toolMetrics: google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics[]; + + /** MetricsByTurn semanticSimilarityMetrics. */ + public semanticSimilarityMetrics: google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics[]; + + /** MetricsByTurn hallucinationMetrics. */ + public hallucinationMetrics: google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics[]; + + /** MetricsByTurn toolCallLatencyMetrics. */ + public toolCallLatencyMetrics: google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics[]; + + /** MetricsByTurn turnLatencyMetrics. */ + public turnLatencyMetrics: google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics[]; + + /** + * Creates a new MetricsByTurn instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricsByTurn instance + */ + public static create(properties?: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn; + + /** + * Encodes the specified MetricsByTurn message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.verify|verify} messages. + * @param message MetricsByTurn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricsByTurn message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.verify|verify} messages. + * @param message MetricsByTurn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricsByTurn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricsByTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn; + + /** + * Decodes a MetricsByTurn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricsByTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn; + + /** + * Verifies a MetricsByTurn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetricsByTurn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricsByTurn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn; + + /** + * Creates a plain object from a MetricsByTurn message. Also converts values to other types if specified. + * @param message MetricsByTurn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricsByTurn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricsByTurn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an Evaluation. */ + interface IEvaluation { + + /** Evaluation golden */ + golden?: (google.cloud.ces.v1beta.Evaluation.IGolden|null); + + /** Evaluation scenario */ + scenario?: (google.cloud.ces.v1beta.Evaluation.IScenario|null); + + /** Evaluation name */ + name?: (string|null); + + /** Evaluation displayName */ + displayName?: (string|null); + + /** Evaluation description */ + description?: (string|null); + + /** Evaluation tags */ + tags?: (string[]|null); + + /** Evaluation evaluationDatasets */ + evaluationDatasets?: (string[]|null); + + /** Evaluation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Evaluation createdBy */ + createdBy?: (string|null); + + /** Evaluation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Evaluation lastUpdatedBy */ + lastUpdatedBy?: (string|null); + + /** Evaluation evaluationRuns */ + evaluationRuns?: (string[]|null); + + /** Evaluation etag */ + etag?: (string|null); + + /** Evaluation aggregatedMetrics */ + aggregatedMetrics?: (google.cloud.ces.v1beta.IAggregatedMetrics|null); + + /** Evaluation lastCompletedResult */ + lastCompletedResult?: (google.cloud.ces.v1beta.IEvaluationResult|null); + + /** Evaluation invalid */ + invalid?: (boolean|null); + + /** Evaluation lastTenResults */ + lastTenResults?: (google.cloud.ces.v1beta.IEvaluationResult[]|null); + } + + /** Represents an Evaluation. */ + class Evaluation implements IEvaluation { + + /** + * Constructs a new Evaluation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluation); + + /** Evaluation golden. */ + public golden?: (google.cloud.ces.v1beta.Evaluation.IGolden|null); + + /** Evaluation scenario. */ + public scenario?: (google.cloud.ces.v1beta.Evaluation.IScenario|null); + + /** Evaluation name. */ + public name: string; + + /** Evaluation displayName. */ + public displayName: string; + + /** Evaluation description. */ + public description: string; + + /** Evaluation tags. */ + public tags: string[]; + + /** Evaluation evaluationDatasets. */ + public evaluationDatasets: string[]; + + /** Evaluation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Evaluation createdBy. */ + public createdBy: string; + + /** Evaluation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Evaluation lastUpdatedBy. */ + public lastUpdatedBy: string; + + /** Evaluation evaluationRuns. */ + public evaluationRuns: string[]; + + /** Evaluation etag. */ + public etag: string; + + /** Evaluation aggregatedMetrics. */ + public aggregatedMetrics?: (google.cloud.ces.v1beta.IAggregatedMetrics|null); + + /** Evaluation lastCompletedResult. */ + public lastCompletedResult?: (google.cloud.ces.v1beta.IEvaluationResult|null); + + /** Evaluation invalid. */ + public invalid: boolean; + + /** Evaluation lastTenResults. */ + public lastTenResults: google.cloud.ces.v1beta.IEvaluationResult[]; + + /** Evaluation inputs. */ + public inputs?: ("golden"|"scenario"); + + /** + * Creates a new Evaluation instance using the specified properties. + * @param [properties] Properties to set + * @returns Evaluation instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluation): google.cloud.ces.v1beta.Evaluation; + + /** + * Encodes the specified Evaluation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.verify|verify} messages. + * @param message Evaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Evaluation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.verify|verify} messages. + * @param message Evaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Evaluation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Evaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation; + + /** + * Decodes an Evaluation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Evaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation; + + /** + * Verifies an Evaluation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Evaluation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Evaluation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation; + + /** + * Creates a plain object from an Evaluation message. Also converts values to other types if specified. + * @param message Evaluation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Evaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Evaluation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Evaluation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Evaluation { + + /** Properties of a GoldenExpectation. */ + interface IGoldenExpectation { + + /** GoldenExpectation toolCall */ + toolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** GoldenExpectation toolResponse */ + toolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** GoldenExpectation agentResponse */ + agentResponse?: (google.cloud.ces.v1beta.IMessage|null); + + /** GoldenExpectation agentTransfer */ + agentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); + + /** GoldenExpectation updatedVariables */ + updatedVariables?: (google.protobuf.IStruct|null); + + /** GoldenExpectation mockToolResponse */ + mockToolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** GoldenExpectation note */ + note?: (string|null); + } + + /** Represents a GoldenExpectation. */ + class GoldenExpectation implements IGoldenExpectation { + + /** + * Constructs a new GoldenExpectation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Evaluation.IGoldenExpectation); + + /** GoldenExpectation toolCall. */ + public toolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** GoldenExpectation toolResponse. */ + public toolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** GoldenExpectation agentResponse. */ + public agentResponse?: (google.cloud.ces.v1beta.IMessage|null); + + /** GoldenExpectation agentTransfer. */ + public agentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); + + /** GoldenExpectation updatedVariables. */ + public updatedVariables?: (google.protobuf.IStruct|null); + + /** GoldenExpectation mockToolResponse. */ + public mockToolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** GoldenExpectation note. */ + public note: string; + + /** GoldenExpectation condition. */ + public condition?: ("toolCall"|"toolResponse"|"agentResponse"|"agentTransfer"|"updatedVariables"|"mockToolResponse"); + + /** + * Creates a new GoldenExpectation instance using the specified properties. + * @param [properties] Properties to set + * @returns GoldenExpectation instance + */ + public static create(properties?: google.cloud.ces.v1beta.Evaluation.IGoldenExpectation): google.cloud.ces.v1beta.Evaluation.GoldenExpectation; + + /** + * Encodes the specified GoldenExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenExpectation.verify|verify} messages. + * @param message GoldenExpectation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Evaluation.IGoldenExpectation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoldenExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenExpectation.verify|verify} messages. + * @param message GoldenExpectation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.IGoldenExpectation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoldenExpectation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoldenExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.GoldenExpectation; + + /** + * Decodes a GoldenExpectation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoldenExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.GoldenExpectation; + + /** + * Verifies a GoldenExpectation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoldenExpectation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoldenExpectation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.GoldenExpectation; + + /** + * Creates a plain object from a GoldenExpectation message. Also converts values to other types if specified. + * @param message GoldenExpectation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Evaluation.GoldenExpectation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoldenExpectation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoldenExpectation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Step. */ + interface IStep { + + /** Step userInput */ + userInput?: (google.cloud.ces.v1beta.ISessionInput|null); + + /** Step agentTransfer */ + agentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); + + /** Step expectation */ + expectation?: (google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null); + } + + /** Represents a Step. */ + class Step implements IStep { + + /** + * Constructs a new Step. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Evaluation.IStep); + + /** Step userInput. */ + public userInput?: (google.cloud.ces.v1beta.ISessionInput|null); + + /** Step agentTransfer. */ + public agentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); + + /** Step expectation. */ + public expectation?: (google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null); + + /** Step step. */ + public step?: ("userInput"|"agentTransfer"|"expectation"); + + /** + * Creates a new Step instance using the specified properties. + * @param [properties] Properties to set + * @returns Step instance + */ + public static create(properties?: google.cloud.ces.v1beta.Evaluation.IStep): google.cloud.ces.v1beta.Evaluation.Step; + + /** + * Encodes the specified Step message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Step.verify|verify} messages. + * @param message Step message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Evaluation.IStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Step message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Step.verify|verify} messages. + * @param message Step message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.IStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Step message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Step + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.Step; + + /** + * Decodes a Step message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Step + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.Step; + + /** + * Verifies a Step message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Step message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Step + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.Step; + + /** + * Creates a plain object from a Step message. Also converts values to other types if specified. + * @param message Step + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Evaluation.Step, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Step to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Step + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoldenTurn. */ + interface IGoldenTurn { + + /** GoldenTurn steps */ + steps?: (google.cloud.ces.v1beta.Evaluation.IStep[]|null); + + /** GoldenTurn rootSpan */ + rootSpan?: (google.cloud.ces.v1beta.ISpan|null); + } + + /** Represents a GoldenTurn. */ + class GoldenTurn implements IGoldenTurn { + + /** + * Constructs a new GoldenTurn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Evaluation.IGoldenTurn); + + /** GoldenTurn steps. */ + public steps: google.cloud.ces.v1beta.Evaluation.IStep[]; + + /** GoldenTurn rootSpan. */ + public rootSpan?: (google.cloud.ces.v1beta.ISpan|null); + + /** + * Creates a new GoldenTurn instance using the specified properties. + * @param [properties] Properties to set + * @returns GoldenTurn instance + */ + public static create(properties?: google.cloud.ces.v1beta.Evaluation.IGoldenTurn): google.cloud.ces.v1beta.Evaluation.GoldenTurn; + + /** + * Encodes the specified GoldenTurn message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenTurn.verify|verify} messages. + * @param message GoldenTurn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Evaluation.IGoldenTurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoldenTurn message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenTurn.verify|verify} messages. + * @param message GoldenTurn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.IGoldenTurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoldenTurn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoldenTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.GoldenTurn; + + /** + * Decodes a GoldenTurn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoldenTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.GoldenTurn; + + /** + * Verifies a GoldenTurn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoldenTurn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoldenTurn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.GoldenTurn; + + /** + * Creates a plain object from a GoldenTurn message. Also converts values to other types if specified. + * @param message GoldenTurn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Evaluation.GoldenTurn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoldenTurn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoldenTurn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Golden. */ + interface IGolden { + + /** Golden turns */ + turns?: (google.cloud.ces.v1beta.Evaluation.IGoldenTurn[]|null); + + /** Golden evaluationExpectations */ + evaluationExpectations?: (string[]|null); + } + + /** Represents a Golden. */ + class Golden implements IGolden { + + /** + * Constructs a new Golden. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Evaluation.IGolden); + + /** Golden turns. */ + public turns: google.cloud.ces.v1beta.Evaluation.IGoldenTurn[]; + + /** Golden evaluationExpectations. */ + public evaluationExpectations: string[]; + + /** + * Creates a new Golden instance using the specified properties. + * @param [properties] Properties to set + * @returns Golden instance + */ + public static create(properties?: google.cloud.ces.v1beta.Evaluation.IGolden): google.cloud.ces.v1beta.Evaluation.Golden; + + /** + * Encodes the specified Golden message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Golden.verify|verify} messages. + * @param message Golden message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Evaluation.IGolden, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Golden message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Golden.verify|verify} messages. + * @param message Golden message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.IGolden, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Golden message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Golden + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.Golden; + + /** + * Decodes a Golden message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Golden + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.Golden; + + /** + * Verifies a Golden message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Golden message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Golden + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.Golden; + + /** + * Creates a plain object from a Golden message. Also converts values to other types if specified. + * @param message Golden + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Evaluation.Golden, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Golden to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Golden + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScenarioExpectation. */ + interface IScenarioExpectation { + + /** ScenarioExpectation toolExpectation */ + toolExpectation?: (google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation|null); + + /** ScenarioExpectation agentResponse */ + agentResponse?: (google.cloud.ces.v1beta.IMessage|null); + } + + /** Represents a ScenarioExpectation. */ + class ScenarioExpectation implements IScenarioExpectation { + + /** + * Constructs a new ScenarioExpectation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Evaluation.IScenarioExpectation); + + /** ScenarioExpectation toolExpectation. */ + public toolExpectation?: (google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation|null); + + /** ScenarioExpectation agentResponse. */ + public agentResponse?: (google.cloud.ces.v1beta.IMessage|null); + + /** ScenarioExpectation expectation. */ + public expectation?: ("toolExpectation"|"agentResponse"); + + /** + * Creates a new ScenarioExpectation instance using the specified properties. + * @param [properties] Properties to set + * @returns ScenarioExpectation instance + */ + public static create(properties?: google.cloud.ces.v1beta.Evaluation.IScenarioExpectation): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation; + + /** + * Encodes the specified ScenarioExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.verify|verify} messages. + * @param message ScenarioExpectation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Evaluation.IScenarioExpectation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScenarioExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.verify|verify} messages. + * @param message ScenarioExpectation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.IScenarioExpectation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScenarioExpectation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScenarioExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation; + + /** + * Decodes a ScenarioExpectation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScenarioExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation; + + /** + * Verifies a ScenarioExpectation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScenarioExpectation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScenarioExpectation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation; + + /** + * Creates a plain object from a ScenarioExpectation message. Also converts values to other types if specified. + * @param message ScenarioExpectation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Evaluation.ScenarioExpectation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScenarioExpectation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScenarioExpectation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScenarioExpectation { + + /** Properties of a ToolExpectation. */ + interface IToolExpectation { + + /** ToolExpectation expectedToolCall */ + expectedToolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** ToolExpectation mockToolResponse */ + mockToolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + } + + /** Represents a ToolExpectation. */ + class ToolExpectation implements IToolExpectation { + + /** + * Constructs a new ToolExpectation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation); + + /** ToolExpectation expectedToolCall. */ + public expectedToolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** ToolExpectation mockToolResponse. */ + public mockToolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** + * Creates a new ToolExpectation instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolExpectation instance + */ + public static create(properties?: google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation; + + /** + * Encodes the specified ToolExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.verify|verify} messages. + * @param message ToolExpectation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.verify|verify} messages. + * @param message ToolExpectation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolExpectation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation; + + /** + * Decodes a ToolExpectation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation; + + /** + * Verifies a ToolExpectation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolExpectation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolExpectation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation; + + /** + * Creates a plain object from a ToolExpectation message. Also converts values to other types if specified. + * @param message ToolExpectation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolExpectation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolExpectation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Scenario. */ + interface IScenario { + + /** Scenario task */ + task?: (string|null); + + /** Scenario userFacts */ + userFacts?: (google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact[]|null); + + /** Scenario maxTurns */ + maxTurns?: (number|null); + + /** Scenario rubrics */ + rubrics?: (string[]|null); + + /** Scenario scenarioExpectations */ + scenarioExpectations?: (google.cloud.ces.v1beta.Evaluation.IScenarioExpectation[]|null); + + /** Scenario variableOverrides */ + variableOverrides?: (google.protobuf.IStruct|null); + + /** Scenario taskCompletionBehavior */ + taskCompletionBehavior?: (google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior|keyof typeof google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior|null); + + /** Scenario userGoalBehavior */ + userGoalBehavior?: (google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior|keyof typeof google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior|null); + + /** Scenario evaluationExpectations */ + evaluationExpectations?: (string[]|null); + } + + /** Represents a Scenario. */ + class Scenario implements IScenario { + + /** + * Constructs a new Scenario. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Evaluation.IScenario); + + /** Scenario task. */ + public task: string; + + /** Scenario userFacts. */ + public userFacts: google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact[]; + + /** Scenario maxTurns. */ + public maxTurns: number; + + /** Scenario rubrics. */ + public rubrics: string[]; + + /** Scenario scenarioExpectations. */ + public scenarioExpectations: google.cloud.ces.v1beta.Evaluation.IScenarioExpectation[]; + + /** Scenario variableOverrides. */ + public variableOverrides?: (google.protobuf.IStruct|null); + + /** Scenario taskCompletionBehavior. */ + public taskCompletionBehavior: (google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior|keyof typeof google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior); + + /** Scenario userGoalBehavior. */ + public userGoalBehavior: (google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior|keyof typeof google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior); + + /** Scenario evaluationExpectations. */ + public evaluationExpectations: string[]; + + /** + * Creates a new Scenario instance using the specified properties. + * @param [properties] Properties to set + * @returns Scenario instance + */ + public static create(properties?: google.cloud.ces.v1beta.Evaluation.IScenario): google.cloud.ces.v1beta.Evaluation.Scenario; + + /** + * Encodes the specified Scenario message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.verify|verify} messages. + * @param message Scenario message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Evaluation.IScenario, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Scenario message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.verify|verify} messages. + * @param message Scenario message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.IScenario, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Scenario message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Scenario + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.Scenario; + + /** + * Decodes a Scenario message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Scenario + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.Scenario; + + /** + * Verifies a Scenario message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Scenario message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Scenario + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.Scenario; + + /** + * Creates a plain object from a Scenario message. Also converts values to other types if specified. + * @param message Scenario + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Evaluation.Scenario, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Scenario to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Scenario + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Scenario { + + /** Properties of a UserFact. */ + interface IUserFact { + + /** UserFact name */ + name?: (string|null); + + /** UserFact value */ + value?: (string|null); + } + + /** Represents a UserFact. */ + class UserFact implements IUserFact { + + /** + * Constructs a new UserFact. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact); + + /** UserFact name. */ + public name: string; + + /** UserFact value. */ + public value: string; + + /** + * Creates a new UserFact instance using the specified properties. + * @param [properties] Properties to set + * @returns UserFact instance + */ + public static create(properties?: google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact): google.cloud.ces.v1beta.Evaluation.Scenario.UserFact; + + /** + * Encodes the specified UserFact message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.verify|verify} messages. + * @param message UserFact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserFact message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.verify|verify} messages. + * @param message UserFact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserFact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserFact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Evaluation.Scenario.UserFact; + + /** + * Decodes a UserFact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserFact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Evaluation.Scenario.UserFact; + + /** + * Verifies a UserFact message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserFact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserFact + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Evaluation.Scenario.UserFact; + + /** + * Creates a plain object from a UserFact message. Also converts values to other types if specified. + * @param message UserFact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Evaluation.Scenario.UserFact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserFact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserFact + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** TaskCompletionBehavior enum. */ + enum TaskCompletionBehavior { + TASK_COMPLETION_BEHAVIOR_UNSPECIFIED = 0, + TASK_SATISFIED = 1, + TASK_REJECTED = 2 + } + + /** UserGoalBehavior enum. */ + enum UserGoalBehavior { + USER_GOAL_BEHAVIOR_UNSPECIFIED = 0, + USER_GOAL_SATISFIED = 1, + USER_GOAL_REJECTED = 2, + USER_GOAL_IGNORED = 3 + } + } + } + + /** Properties of an EvaluationDataset. */ + interface IEvaluationDataset { + + /** EvaluationDataset name */ + name?: (string|null); + + /** EvaluationDataset displayName */ + displayName?: (string|null); + + /** EvaluationDataset evaluations */ + evaluations?: (string[]|null); + + /** EvaluationDataset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationDataset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationDataset etag */ + etag?: (string|null); + + /** EvaluationDataset createdBy */ + createdBy?: (string|null); + + /** EvaluationDataset lastUpdatedBy */ + lastUpdatedBy?: (string|null); + + /** EvaluationDataset aggregatedMetrics */ + aggregatedMetrics?: (google.cloud.ces.v1beta.IAggregatedMetrics|null); + } + + /** Represents an EvaluationDataset. */ + class EvaluationDataset implements IEvaluationDataset { + + /** + * Constructs a new EvaluationDataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluationDataset); + + /** EvaluationDataset name. */ + public name: string; + + /** EvaluationDataset displayName. */ + public displayName: string; + + /** EvaluationDataset evaluations. */ + public evaluations: string[]; + + /** EvaluationDataset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationDataset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationDataset etag. */ + public etag: string; + + /** EvaluationDataset createdBy. */ + public createdBy: string; + + /** EvaluationDataset lastUpdatedBy. */ + public lastUpdatedBy: string; + + /** EvaluationDataset aggregatedMetrics. */ + public aggregatedMetrics?: (google.cloud.ces.v1beta.IAggregatedMetrics|null); + + /** + * Creates a new EvaluationDataset instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationDataset instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluationDataset): google.cloud.ces.v1beta.EvaluationDataset; + + /** + * Encodes the specified EvaluationDataset message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationDataset.verify|verify} messages. + * @param message EvaluationDataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluationDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationDataset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationDataset.verify|verify} messages. + * @param message EvaluationDataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationDataset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationDataset; + + /** + * Decodes an EvaluationDataset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationDataset; + + /** + * Verifies an EvaluationDataset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationDataset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationDataset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationDataset; + + /** + * Creates a plain object from an EvaluationDataset message. Also converts values to other types if specified. + * @param message EvaluationDataset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationDataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationDataset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationDataset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluationResult. */ + interface IEvaluationResult { + + /** EvaluationResult goldenResult */ + goldenResult?: (google.cloud.ces.v1beta.EvaluationResult.IGoldenResult|null); + + /** EvaluationResult scenarioResult */ + scenarioResult?: (google.cloud.ces.v1beta.EvaluationResult.IScenarioResult|null); + + /** EvaluationResult name */ + name?: (string|null); + + /** EvaluationResult displayName */ + displayName?: (string|null); + + /** EvaluationResult createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationResult evaluationStatus */ + evaluationStatus?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); + + /** EvaluationResult evaluationRun */ + evaluationRun?: (string|null); + + /** EvaluationResult persona */ + persona?: (google.cloud.ces.v1beta.IEvaluationPersona|null); + + /** EvaluationResult errorInfo */ + errorInfo?: (google.cloud.ces.v1beta.IEvaluationErrorInfo|null); + + /** EvaluationResult error */ + error?: (google.rpc.IStatus|null); + + /** EvaluationResult initiatedBy */ + initiatedBy?: (string|null); + + /** EvaluationResult appVersion */ + appVersion?: (string|null); + + /** EvaluationResult appVersionDisplayName */ + appVersionDisplayName?: (string|null); + + /** EvaluationResult changelog */ + changelog?: (string|null); + + /** EvaluationResult changelogCreateTime */ + changelogCreateTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationResult executionState */ + executionState?: (google.cloud.ces.v1beta.EvaluationResult.ExecutionState|keyof typeof google.cloud.ces.v1beta.EvaluationResult.ExecutionState|null); + + /** EvaluationResult evaluationMetricsThresholds */ + evaluationMetricsThresholds?: (google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null); + + /** EvaluationResult config */ + config?: (google.cloud.ces.v1beta.IEvaluationConfig|null); + + /** EvaluationResult goldenRunMethod */ + goldenRunMethod?: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod|null); + } + + /** Represents an EvaluationResult. */ + class EvaluationResult implements IEvaluationResult { + + /** + * Constructs a new EvaluationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluationResult); + + /** EvaluationResult goldenResult. */ + public goldenResult?: (google.cloud.ces.v1beta.EvaluationResult.IGoldenResult|null); + + /** EvaluationResult scenarioResult. */ + public scenarioResult?: (google.cloud.ces.v1beta.EvaluationResult.IScenarioResult|null); + + /** EvaluationResult name. */ + public name: string; + + /** EvaluationResult displayName. */ + public displayName: string; + + /** EvaluationResult createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationResult evaluationStatus. */ + public evaluationStatus: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); + + /** EvaluationResult evaluationRun. */ + public evaluationRun: string; + + /** EvaluationResult persona. */ + public persona?: (google.cloud.ces.v1beta.IEvaluationPersona|null); + + /** EvaluationResult errorInfo. */ + public errorInfo?: (google.cloud.ces.v1beta.IEvaluationErrorInfo|null); + + /** EvaluationResult error. */ + public error?: (google.rpc.IStatus|null); + + /** EvaluationResult initiatedBy. */ + public initiatedBy: string; + + /** EvaluationResult appVersion. */ + public appVersion: string; + + /** EvaluationResult appVersionDisplayName. */ + public appVersionDisplayName: string; + + /** EvaluationResult changelog. */ + public changelog: string; + + /** EvaluationResult changelogCreateTime. */ + public changelogCreateTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationResult executionState. */ + public executionState: (google.cloud.ces.v1beta.EvaluationResult.ExecutionState|keyof typeof google.cloud.ces.v1beta.EvaluationResult.ExecutionState); + + /** EvaluationResult evaluationMetricsThresholds. */ + public evaluationMetricsThresholds?: (google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null); + + /** EvaluationResult config. */ + public config?: (google.cloud.ces.v1beta.IEvaluationConfig|null); + + /** EvaluationResult goldenRunMethod. */ + public goldenRunMethod: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod); + + /** EvaluationResult result. */ + public result?: ("goldenResult"|"scenarioResult"); + + /** + * Creates a new EvaluationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluationResult): google.cloud.ces.v1beta.EvaluationResult; + + /** + * Encodes the specified EvaluationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.verify|verify} messages. + * @param message EvaluationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.verify|verify} messages. + * @param message EvaluationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult; + + /** + * Decodes an EvaluationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult; + + /** + * Verifies an EvaluationResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult; + + /** + * Creates a plain object from an EvaluationResult message. Also converts values to other types if specified. + * @param message EvaluationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EvaluationResult { + + /** Properties of a GoldenExpectationOutcome. */ + interface IGoldenExpectationOutcome { + + /** GoldenExpectationOutcome observedToolCall */ + observedToolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** GoldenExpectationOutcome observedToolResponse */ + observedToolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** GoldenExpectationOutcome observedAgentResponse */ + observedAgentResponse?: (google.cloud.ces.v1beta.IMessage|null); + + /** GoldenExpectationOutcome observedAgentTransfer */ + observedAgentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); + + /** GoldenExpectationOutcome expectation */ + expectation?: (google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null); + + /** GoldenExpectationOutcome outcome */ + outcome?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); + + /** GoldenExpectationOutcome semanticSimilarityResult */ + semanticSimilarityResult?: (google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null); + + /** GoldenExpectationOutcome toolInvocationResult */ + toolInvocationResult?: (google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult|null); + } + + /** Represents a GoldenExpectationOutcome. */ + class GoldenExpectationOutcome implements IGoldenExpectationOutcome { + + /** + * Constructs a new GoldenExpectationOutcome. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome); + + /** GoldenExpectationOutcome observedToolCall. */ + public observedToolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** GoldenExpectationOutcome observedToolResponse. */ + public observedToolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** GoldenExpectationOutcome observedAgentResponse. */ + public observedAgentResponse?: (google.cloud.ces.v1beta.IMessage|null); + + /** GoldenExpectationOutcome observedAgentTransfer. */ + public observedAgentTransfer?: (google.cloud.ces.v1beta.IAgentTransfer|null); + + /** GoldenExpectationOutcome expectation. */ + public expectation?: (google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null); + + /** GoldenExpectationOutcome outcome. */ + public outcome: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); + + /** GoldenExpectationOutcome semanticSimilarityResult. */ + public semanticSimilarityResult?: (google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null); + + /** GoldenExpectationOutcome toolInvocationResult. */ + public toolInvocationResult?: (google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult|null); + + /** GoldenExpectationOutcome result. */ + public result?: ("observedToolCall"|"observedToolResponse"|"observedAgentResponse"|"observedAgentTransfer"); + + /** + * Creates a new GoldenExpectationOutcome instance using the specified properties. + * @param [properties] Properties to set + * @returns GoldenExpectationOutcome instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome; + + /** + * Encodes the specified GoldenExpectationOutcome message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.verify|verify} messages. + * @param message GoldenExpectationOutcome message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoldenExpectationOutcome message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.verify|verify} messages. + * @param message GoldenExpectationOutcome message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoldenExpectationOutcome message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoldenExpectationOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome; + + /** + * Decodes a GoldenExpectationOutcome message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoldenExpectationOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome; + + /** + * Verifies a GoldenExpectationOutcome message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoldenExpectationOutcome message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoldenExpectationOutcome + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome; + + /** + * Creates a plain object from a GoldenExpectationOutcome message. Also converts values to other types if specified. + * @param message GoldenExpectationOutcome + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoldenExpectationOutcome to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoldenExpectationOutcome + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GoldenExpectationOutcome { + + /** Properties of a ToolInvocationResult. */ + interface IToolInvocationResult { + + /** ToolInvocationResult parameterCorrectnessScore */ + parameterCorrectnessScore?: (number|null); + + /** ToolInvocationResult outcome */ + outcome?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); + + /** ToolInvocationResult explanation */ + explanation?: (string|null); + } + + /** Represents a ToolInvocationResult. */ + class ToolInvocationResult implements IToolInvocationResult { + + /** + * Constructs a new ToolInvocationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult); + + /** ToolInvocationResult parameterCorrectnessScore. */ + public parameterCorrectnessScore?: (number|null); + + /** ToolInvocationResult outcome. */ + public outcome: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); + + /** ToolInvocationResult explanation. */ + public explanation: string; + + /** + * Creates a new ToolInvocationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolInvocationResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult; + + /** + * Encodes the specified ToolInvocationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.verify|verify} messages. + * @param message ToolInvocationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolInvocationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.verify|verify} messages. + * @param message ToolInvocationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolInvocationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolInvocationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult; + + /** + * Decodes a ToolInvocationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolInvocationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult; + + /** + * Verifies a ToolInvocationResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolInvocationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolInvocationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult; + + /** + * Creates a plain object from a ToolInvocationResult message. Also converts values to other types if specified. + * @param message ToolInvocationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolInvocationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolInvocationResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EvaluationExpectationResult. */ + interface IEvaluationExpectationResult { + + /** EvaluationExpectationResult evaluationExpectation */ + evaluationExpectation?: (string|null); + + /** EvaluationExpectationResult prompt */ + prompt?: (string|null); + + /** EvaluationExpectationResult outcome */ + outcome?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); + + /** EvaluationExpectationResult explanation */ + explanation?: (string|null); + } + + /** Represents an EvaluationExpectationResult. */ + class EvaluationExpectationResult implements IEvaluationExpectationResult { + + /** + * Constructs a new EvaluationExpectationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult); + + /** EvaluationExpectationResult evaluationExpectation. */ + public evaluationExpectation: string; + + /** EvaluationExpectationResult prompt. */ + public prompt: string; + + /** EvaluationExpectationResult outcome. */ + public outcome: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); + + /** EvaluationExpectationResult explanation. */ + public explanation: string; + + /** + * Creates a new EvaluationExpectationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationExpectationResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult): google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult; + + /** + * Encodes the specified EvaluationExpectationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.verify|verify} messages. + * @param message EvaluationExpectationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationExpectationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.verify|verify} messages. + * @param message EvaluationExpectationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationExpectationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationExpectationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult; + + /** + * Decodes an EvaluationExpectationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationExpectationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult; + + /** + * Verifies an EvaluationExpectationResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationExpectationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationExpectationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult; + + /** + * Creates a plain object from an EvaluationExpectationResult message. Also converts values to other types if specified. + * @param message EvaluationExpectationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationExpectationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationExpectationResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoldenResult. */ + interface IGoldenResult { + + /** GoldenResult turnReplayResults */ + turnReplayResults?: (google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult[]|null); + + /** GoldenResult evaluationExpectationResults */ + evaluationExpectationResults?: (google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult[]|null); + } + + /** Represents a GoldenResult. */ + class GoldenResult implements IGoldenResult { + + /** + * Constructs a new GoldenResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IGoldenResult); + + /** GoldenResult turnReplayResults. */ + public turnReplayResults: google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult[]; + + /** GoldenResult evaluationExpectationResults. */ + public evaluationExpectationResults: google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult[]; + + /** + * Creates a new GoldenResult instance using the specified properties. + * @param [properties] Properties to set + * @returns GoldenResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IGoldenResult): google.cloud.ces.v1beta.EvaluationResult.GoldenResult; + + /** + * Encodes the specified GoldenResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.verify|verify} messages. + * @param message GoldenResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IGoldenResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoldenResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.verify|verify} messages. + * @param message GoldenResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IGoldenResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoldenResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoldenResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.GoldenResult; + + /** + * Decodes a GoldenResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoldenResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.GoldenResult; + + /** + * Verifies a GoldenResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoldenResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoldenResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.GoldenResult; + + /** + * Creates a plain object from a GoldenResult message. Also converts values to other types if specified. + * @param message GoldenResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.GoldenResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoldenResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoldenResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GoldenResult { + + /** Properties of a TurnReplayResult. */ + interface ITurnReplayResult { + + /** TurnReplayResult conversation */ + conversation?: (string|null); + + /** TurnReplayResult expectationOutcome */ + expectationOutcome?: (google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome[]|null); + + /** TurnReplayResult hallucinationResult */ + hallucinationResult?: (google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult|null); + + /** TurnReplayResult toolInvocationScore */ + toolInvocationScore?: (number|null); + + /** TurnReplayResult toolOrderedInvocationScore */ + toolOrderedInvocationScore?: (number|null); + + /** TurnReplayResult turnLatency */ + turnLatency?: (google.protobuf.IDuration|null); + + /** TurnReplayResult toolCallLatencies */ + toolCallLatencies?: (google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency[]|null); + + /** TurnReplayResult semanticSimilarityResult */ + semanticSimilarityResult?: (google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null); + + /** TurnReplayResult overallToolInvocationResult */ + overallToolInvocationResult?: (google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult|null); + + /** TurnReplayResult errorInfo */ + errorInfo?: (google.cloud.ces.v1beta.IEvaluationErrorInfo|null); + + /** TurnReplayResult spanLatencies */ + spanLatencies?: (google.cloud.ces.v1beta.EvaluationResult.ISpanLatency[]|null); + } + + /** Represents a TurnReplayResult. */ + class TurnReplayResult implements ITurnReplayResult { + + /** + * Constructs a new TurnReplayResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult); + + /** TurnReplayResult conversation. */ + public conversation: string; + + /** TurnReplayResult expectationOutcome. */ + public expectationOutcome: google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome[]; + + /** TurnReplayResult hallucinationResult. */ + public hallucinationResult?: (google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult|null); + + /** TurnReplayResult toolInvocationScore. */ + public toolInvocationScore: number; + + /** TurnReplayResult toolOrderedInvocationScore. */ + public toolOrderedInvocationScore?: (number|null); + + /** TurnReplayResult turnLatency. */ + public turnLatency?: (google.protobuf.IDuration|null); + + /** TurnReplayResult toolCallLatencies. */ + public toolCallLatencies: google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency[]; + + /** TurnReplayResult semanticSimilarityResult. */ + public semanticSimilarityResult?: (google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null); + + /** TurnReplayResult overallToolInvocationResult. */ + public overallToolInvocationResult?: (google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult|null); + + /** TurnReplayResult errorInfo. */ + public errorInfo?: (google.cloud.ces.v1beta.IEvaluationErrorInfo|null); + + /** TurnReplayResult spanLatencies. */ + public spanLatencies: google.cloud.ces.v1beta.EvaluationResult.ISpanLatency[]; + + /** + * Creates a new TurnReplayResult instance using the specified properties. + * @param [properties] Properties to set + * @returns TurnReplayResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult): google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult; + + /** + * Encodes the specified TurnReplayResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.verify|verify} messages. + * @param message TurnReplayResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TurnReplayResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.verify|verify} messages. + * @param message TurnReplayResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TurnReplayResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TurnReplayResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult; + + /** + * Decodes a TurnReplayResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TurnReplayResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult; + + /** + * Verifies a TurnReplayResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TurnReplayResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TurnReplayResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult; + + /** + * Creates a plain object from a TurnReplayResult message. Also converts values to other types if specified. + * @param message TurnReplayResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TurnReplayResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TurnReplayResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ScenarioRubricOutcome. */ + interface IScenarioRubricOutcome { + + /** ScenarioRubricOutcome rubric */ + rubric?: (string|null); + + /** ScenarioRubricOutcome score */ + score?: (number|null); + + /** ScenarioRubricOutcome scoreExplanation */ + scoreExplanation?: (string|null); + } + + /** Represents a ScenarioRubricOutcome. */ + class ScenarioRubricOutcome implements IScenarioRubricOutcome { + + /** + * Constructs a new ScenarioRubricOutcome. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome); + + /** ScenarioRubricOutcome rubric. */ + public rubric: string; + + /** ScenarioRubricOutcome score. */ + public score?: (number|null); + + /** ScenarioRubricOutcome scoreExplanation. */ + public scoreExplanation: string; + + /** + * Creates a new ScenarioRubricOutcome instance using the specified properties. + * @param [properties] Properties to set + * @returns ScenarioRubricOutcome instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome): google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome; + + /** + * Encodes the specified ScenarioRubricOutcome message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.verify|verify} messages. + * @param message ScenarioRubricOutcome message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScenarioRubricOutcome message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.verify|verify} messages. + * @param message ScenarioRubricOutcome message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScenarioRubricOutcome message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScenarioRubricOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome; + + /** + * Decodes a ScenarioRubricOutcome message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScenarioRubricOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome; + + /** + * Verifies a ScenarioRubricOutcome message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScenarioRubricOutcome message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScenarioRubricOutcome + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome; + + /** + * Creates a plain object from a ScenarioRubricOutcome message. Also converts values to other types if specified. + * @param message ScenarioRubricOutcome + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScenarioRubricOutcome to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScenarioRubricOutcome + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScenarioExpectationOutcome. */ + interface IScenarioExpectationOutcome { + + /** ScenarioExpectationOutcome observedToolCall */ + observedToolCall?: (google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall|null); + + /** ScenarioExpectationOutcome observedAgentResponse */ + observedAgentResponse?: (google.cloud.ces.v1beta.IMessage|null); + + /** ScenarioExpectationOutcome expectation */ + expectation?: (google.cloud.ces.v1beta.Evaluation.IScenarioExpectation|null); + + /** ScenarioExpectationOutcome outcome */ + outcome?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); + } + + /** Represents a ScenarioExpectationOutcome. */ + class ScenarioExpectationOutcome implements IScenarioExpectationOutcome { + + /** + * Constructs a new ScenarioExpectationOutcome. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome); + + /** ScenarioExpectationOutcome observedToolCall. */ + public observedToolCall?: (google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall|null); + + /** ScenarioExpectationOutcome observedAgentResponse. */ + public observedAgentResponse?: (google.cloud.ces.v1beta.IMessage|null); + + /** ScenarioExpectationOutcome expectation. */ + public expectation?: (google.cloud.ces.v1beta.Evaluation.IScenarioExpectation|null); + + /** ScenarioExpectationOutcome outcome. */ + public outcome: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); + + /** ScenarioExpectationOutcome result. */ + public result?: ("observedToolCall"|"observedAgentResponse"); + + /** + * Creates a new ScenarioExpectationOutcome instance using the specified properties. + * @param [properties] Properties to set + * @returns ScenarioExpectationOutcome instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome; + + /** + * Encodes the specified ScenarioExpectationOutcome message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.verify|verify} messages. + * @param message ScenarioExpectationOutcome message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScenarioExpectationOutcome message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.verify|verify} messages. + * @param message ScenarioExpectationOutcome message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScenarioExpectationOutcome message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScenarioExpectationOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome; + + /** + * Decodes a ScenarioExpectationOutcome message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScenarioExpectationOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome; + + /** + * Verifies a ScenarioExpectationOutcome message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScenarioExpectationOutcome message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScenarioExpectationOutcome + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome; + + /** + * Creates a plain object from a ScenarioExpectationOutcome message. Also converts values to other types if specified. + * @param message ScenarioExpectationOutcome + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScenarioExpectationOutcome to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScenarioExpectationOutcome + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScenarioExpectationOutcome { + + /** Properties of an ObservedToolCall. */ + interface IObservedToolCall { + + /** ObservedToolCall toolCall */ + toolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** ObservedToolCall toolResponse */ + toolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + } + + /** Represents an ObservedToolCall. */ + class ObservedToolCall implements IObservedToolCall { + + /** + * Constructs a new ObservedToolCall. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall); + + /** ObservedToolCall toolCall. */ + public toolCall?: (google.cloud.ces.v1beta.IToolCall|null); + + /** ObservedToolCall toolResponse. */ + public toolResponse?: (google.cloud.ces.v1beta.IToolResponse|null); + + /** + * Creates a new ObservedToolCall instance using the specified properties. + * @param [properties] Properties to set + * @returns ObservedToolCall instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall; + + /** + * Encodes the specified ObservedToolCall message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.verify|verify} messages. + * @param message ObservedToolCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObservedToolCall message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.verify|verify} messages. + * @param message ObservedToolCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObservedToolCall message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObservedToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall; + + /** + * Decodes an ObservedToolCall message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObservedToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall; + + /** + * Verifies an ObservedToolCall message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ObservedToolCall message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObservedToolCall + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall; + + /** + * Creates a plain object from an ObservedToolCall message. Also converts values to other types if specified. + * @param message ObservedToolCall + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObservedToolCall to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObservedToolCall + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ScenarioResult. */ + interface IScenarioResult { + + /** ScenarioResult conversation */ + conversation?: (string|null); + + /** ScenarioResult task */ + task?: (string|null); + + /** ScenarioResult userFacts */ + userFacts?: (google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact[]|null); + + /** ScenarioResult expectationOutcomes */ + expectationOutcomes?: (google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome[]|null); + + /** ScenarioResult rubricOutcomes */ + rubricOutcomes?: (google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome[]|null); + + /** ScenarioResult hallucinationResult */ + hallucinationResult?: (google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult[]|null); + + /** ScenarioResult taskCompletionResult */ + taskCompletionResult?: (google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult|null); + + /** ScenarioResult toolCallLatencies */ + toolCallLatencies?: (google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency[]|null); + + /** ScenarioResult userGoalSatisfactionResult */ + userGoalSatisfactionResult?: (google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult|null); + + /** ScenarioResult allExpectationsSatisfied */ + allExpectationsSatisfied?: (boolean|null); + + /** ScenarioResult taskCompleted */ + taskCompleted?: (boolean|null); + + /** ScenarioResult spanLatencies */ + spanLatencies?: (google.cloud.ces.v1beta.EvaluationResult.ISpanLatency[]|null); + + /** ScenarioResult evaluationExpectationResults */ + evaluationExpectationResults?: (google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult[]|null); + } + + /** Represents a ScenarioResult. */ + class ScenarioResult implements IScenarioResult { + + /** + * Constructs a new ScenarioResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IScenarioResult); + + /** ScenarioResult conversation. */ + public conversation: string; + + /** ScenarioResult task. */ + public task: string; + + /** ScenarioResult userFacts. */ + public userFacts: google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact[]; + + /** ScenarioResult expectationOutcomes. */ + public expectationOutcomes: google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome[]; + + /** ScenarioResult rubricOutcomes. */ + public rubricOutcomes: google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome[]; + + /** ScenarioResult hallucinationResult. */ + public hallucinationResult: google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult[]; + + /** ScenarioResult taskCompletionResult. */ + public taskCompletionResult?: (google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult|null); + + /** ScenarioResult toolCallLatencies. */ + public toolCallLatencies: google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency[]; + + /** ScenarioResult userGoalSatisfactionResult. */ + public userGoalSatisfactionResult?: (google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult|null); + + /** ScenarioResult allExpectationsSatisfied. */ + public allExpectationsSatisfied?: (boolean|null); + + /** ScenarioResult taskCompleted. */ + public taskCompleted?: (boolean|null); + + /** ScenarioResult spanLatencies. */ + public spanLatencies: google.cloud.ces.v1beta.EvaluationResult.ISpanLatency[]; + + /** ScenarioResult evaluationExpectationResults. */ + public evaluationExpectationResults: google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult[]; + + /** + * Creates a new ScenarioResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ScenarioResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IScenarioResult): google.cloud.ces.v1beta.EvaluationResult.ScenarioResult; + + /** + * Encodes the specified ScenarioResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.verify|verify} messages. + * @param message ScenarioResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IScenarioResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScenarioResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.verify|verify} messages. + * @param message ScenarioResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IScenarioResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScenarioResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScenarioResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.ScenarioResult; + + /** + * Decodes a ScenarioResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScenarioResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.ScenarioResult; + + /** + * Verifies a ScenarioResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScenarioResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScenarioResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.ScenarioResult; + + /** + * Creates a plain object from a ScenarioResult message. Also converts values to other types if specified. + * @param message ScenarioResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.ScenarioResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScenarioResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScenarioResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpanLatency. */ + interface ISpanLatency { + + /** SpanLatency resource */ + resource?: (string|null); + + /** SpanLatency toolset */ + toolset?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** SpanLatency model */ + model?: (string|null); + + /** SpanLatency callback */ + callback?: (string|null); + + /** SpanLatency type */ + type?: (google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type|keyof typeof google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type|null); + + /** SpanLatency displayName */ + displayName?: (string|null); + + /** SpanLatency startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** SpanLatency endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** SpanLatency executionLatency */ + executionLatency?: (google.protobuf.IDuration|null); + } + + /** Represents a SpanLatency. */ + class SpanLatency implements ISpanLatency { + + /** + * Constructs a new SpanLatency. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.ISpanLatency); + + /** SpanLatency resource. */ + public resource?: (string|null); + + /** SpanLatency toolset. */ + public toolset?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** SpanLatency model. */ + public model?: (string|null); + + /** SpanLatency callback. */ + public callback?: (string|null); + + /** SpanLatency type. */ + public type: (google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type|keyof typeof google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type); + + /** SpanLatency displayName. */ + public displayName: string; + + /** SpanLatency startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** SpanLatency endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** SpanLatency executionLatency. */ + public executionLatency?: (google.protobuf.IDuration|null); + + /** SpanLatency identifier. */ + public identifier?: ("resource"|"toolset"|"model"|"callback"); + + /** + * Creates a new SpanLatency instance using the specified properties. + * @param [properties] Properties to set + * @returns SpanLatency instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.ISpanLatency): google.cloud.ces.v1beta.EvaluationResult.SpanLatency; + + /** + * Encodes the specified SpanLatency message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SpanLatency.verify|verify} messages. + * @param message SpanLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.ISpanLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpanLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SpanLatency.verify|verify} messages. + * @param message SpanLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.ISpanLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpanLatency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpanLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.SpanLatency; + + /** + * Decodes a SpanLatency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpanLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.SpanLatency; + + /** + * Verifies a SpanLatency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpanLatency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpanLatency + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.SpanLatency; + + /** + * Creates a plain object from a SpanLatency message. Also converts values to other types if specified. + * @param message SpanLatency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.SpanLatency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpanLatency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpanLatency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SpanLatency { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + TOOL = 1, + USER_CALLBACK = 2, + GUARDRAIL = 3, + LLM = 4 + } + } + + /** Properties of a ToolCallLatency. */ + interface IToolCallLatency { + + /** ToolCallLatency tool */ + tool?: (string|null); + + /** ToolCallLatency displayName */ + displayName?: (string|null); + + /** ToolCallLatency startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** ToolCallLatency endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** ToolCallLatency executionLatency */ + executionLatency?: (google.protobuf.IDuration|null); + } + + /** Represents a ToolCallLatency. */ + class ToolCallLatency implements IToolCallLatency { + + /** + * Constructs a new ToolCallLatency. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency); + + /** ToolCallLatency tool. */ + public tool: string; + + /** ToolCallLatency displayName. */ + public displayName: string; + + /** ToolCallLatency startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** ToolCallLatency endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** ToolCallLatency executionLatency. */ + public executionLatency?: (google.protobuf.IDuration|null); + + /** + * Creates a new ToolCallLatency instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolCallLatency instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency): google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency; + + /** + * Encodes the specified ToolCallLatency message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.verify|verify} messages. + * @param message ToolCallLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolCallLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.verify|verify} messages. + * @param message ToolCallLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolCallLatency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolCallLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency; + + /** + * Decodes a ToolCallLatency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolCallLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency; + + /** + * Verifies a ToolCallLatency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolCallLatency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolCallLatency + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency; + + /** + * Creates a plain object from a ToolCallLatency message. Also converts values to other types if specified. + * @param message ToolCallLatency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolCallLatency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolCallLatency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HallucinationResult. */ + interface IHallucinationResult { + + /** HallucinationResult score */ + score?: (number|null); + + /** HallucinationResult label */ + label?: (string|null); + + /** HallucinationResult explanation */ + explanation?: (string|null); + } + + /** Represents a HallucinationResult. */ + class HallucinationResult implements IHallucinationResult { + + /** + * Constructs a new HallucinationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult); + + /** HallucinationResult score. */ + public score?: (number|null); + + /** HallucinationResult label. */ + public label: string; + + /** HallucinationResult explanation. */ + public explanation: string; + + /** + * Creates a new HallucinationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns HallucinationResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult): google.cloud.ces.v1beta.EvaluationResult.HallucinationResult; + + /** + * Encodes the specified HallucinationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.verify|verify} messages. + * @param message HallucinationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HallucinationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.verify|verify} messages. + * @param message HallucinationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HallucinationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HallucinationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.HallucinationResult; + + /** + * Decodes a HallucinationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HallucinationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.HallucinationResult; + + /** + * Verifies a HallucinationResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HallucinationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HallucinationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.HallucinationResult; + + /** + * Creates a plain object from a HallucinationResult message. Also converts values to other types if specified. + * @param message HallucinationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.HallucinationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HallucinationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HallucinationResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserGoalSatisfactionResult. */ + interface IUserGoalSatisfactionResult { + + /** UserGoalSatisfactionResult score */ + score?: (number|null); + + /** UserGoalSatisfactionResult label */ + label?: (string|null); + + /** UserGoalSatisfactionResult explanation */ + explanation?: (string|null); + } + + /** Represents a UserGoalSatisfactionResult. */ + class UserGoalSatisfactionResult implements IUserGoalSatisfactionResult { + + /** + * Constructs a new UserGoalSatisfactionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult); + + /** UserGoalSatisfactionResult score. */ + public score?: (number|null); + + /** UserGoalSatisfactionResult label. */ + public label: string; + + /** UserGoalSatisfactionResult explanation. */ + public explanation: string; + + /** + * Creates a new UserGoalSatisfactionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns UserGoalSatisfactionResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult): google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult; + + /** + * Encodes the specified UserGoalSatisfactionResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.verify|verify} messages. + * @param message UserGoalSatisfactionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserGoalSatisfactionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.verify|verify} messages. + * @param message UserGoalSatisfactionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserGoalSatisfactionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserGoalSatisfactionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult; + + /** + * Decodes a UserGoalSatisfactionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserGoalSatisfactionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult; + + /** + * Verifies a UserGoalSatisfactionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserGoalSatisfactionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserGoalSatisfactionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult; + + /** + * Creates a plain object from a UserGoalSatisfactionResult message. Also converts values to other types if specified. + * @param message UserGoalSatisfactionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserGoalSatisfactionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserGoalSatisfactionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticSimilarityResult. */ + interface ISemanticSimilarityResult { + + /** SemanticSimilarityResult score */ + score?: (number|null); + + /** SemanticSimilarityResult label */ + label?: (string|null); + + /** SemanticSimilarityResult explanation */ + explanation?: (string|null); + + /** SemanticSimilarityResult outcome */ + outcome?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); + } + + /** Represents a SemanticSimilarityResult. */ + class SemanticSimilarityResult implements ISemanticSimilarityResult { + + /** + * Constructs a new SemanticSimilarityResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult); + + /** SemanticSimilarityResult score. */ + public score?: (number|null); + + /** SemanticSimilarityResult label. */ + public label: string; + + /** SemanticSimilarityResult explanation. */ + public explanation: string; + + /** SemanticSimilarityResult outcome. */ + public outcome: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); + + /** + * Creates a new SemanticSimilarityResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticSimilarityResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult): google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult; + + /** + * Encodes the specified SemanticSimilarityResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.verify|verify} messages. + * @param message SemanticSimilarityResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SemanticSimilarityResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.verify|verify} messages. + * @param message SemanticSimilarityResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticSimilarityResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SemanticSimilarityResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult; + + /** + * Decodes a SemanticSimilarityResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SemanticSimilarityResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult; + + /** + * Verifies a SemanticSimilarityResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SemanticSimilarityResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SemanticSimilarityResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult; + + /** + * Creates a plain object from a SemanticSimilarityResult message. Also converts values to other types if specified. + * @param message SemanticSimilarityResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SemanticSimilarityResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SemanticSimilarityResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OverallToolInvocationResult. */ + interface IOverallToolInvocationResult { + + /** OverallToolInvocationResult toolInvocationScore */ + toolInvocationScore?: (number|null); + + /** OverallToolInvocationResult outcome */ + outcome?: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome|null); + } + + /** Represents an OverallToolInvocationResult. */ + class OverallToolInvocationResult implements IOverallToolInvocationResult { + + /** + * Constructs a new OverallToolInvocationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult); + + /** OverallToolInvocationResult toolInvocationScore. */ + public toolInvocationScore?: (number|null); + + /** OverallToolInvocationResult outcome. */ + public outcome: (google.cloud.ces.v1beta.EvaluationResult.Outcome|keyof typeof google.cloud.ces.v1beta.EvaluationResult.Outcome); + + /** + * Creates a new OverallToolInvocationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns OverallToolInvocationResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult): google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult; + + /** + * Encodes the specified OverallToolInvocationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.verify|verify} messages. + * @param message OverallToolInvocationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OverallToolInvocationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.verify|verify} messages. + * @param message OverallToolInvocationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OverallToolInvocationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OverallToolInvocationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult; + + /** + * Decodes an OverallToolInvocationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OverallToolInvocationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult; + + /** + * Verifies an OverallToolInvocationResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OverallToolInvocationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OverallToolInvocationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult; + + /** + * Creates a plain object from an OverallToolInvocationResult message. Also converts values to other types if specified. + * @param message OverallToolInvocationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OverallToolInvocationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OverallToolInvocationResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TaskCompletionResult. */ + interface ITaskCompletionResult { + + /** TaskCompletionResult score */ + score?: (number|null); + + /** TaskCompletionResult label */ + label?: (string|null); + + /** TaskCompletionResult explanation */ + explanation?: (string|null); + } + + /** Represents a TaskCompletionResult. */ + class TaskCompletionResult implements ITaskCompletionResult { + + /** + * Constructs a new TaskCompletionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult); + + /** TaskCompletionResult score. */ + public score?: (number|null); + + /** TaskCompletionResult label. */ + public label: string; + + /** TaskCompletionResult explanation. */ + public explanation: string; + + /** + * Creates a new TaskCompletionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskCompletionResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult): google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult; + + /** + * Encodes the specified TaskCompletionResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.verify|verify} messages. + * @param message TaskCompletionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskCompletionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.verify|verify} messages. + * @param message TaskCompletionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskCompletionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskCompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult; + + /** + * Decodes a TaskCompletionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskCompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult; + + /** + * Verifies a TaskCompletionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskCompletionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskCompletionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult; + + /** + * Creates a plain object from a TaskCompletionResult message. Also converts values to other types if specified. + * @param message TaskCompletionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskCompletionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskCompletionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Outcome enum. */ + enum Outcome { + OUTCOME_UNSPECIFIED = 0, + PASS = 1, + FAIL = 2 + } + + /** ExecutionState enum. */ + enum ExecutionState { + EXECUTION_STATE_UNSPECIFIED = 0, + RUNNING = 1, + COMPLETED = 2, + ERROR = 3 + } + } + + /** Properties of an EvaluationRun. */ + interface IEvaluationRun { + + /** EvaluationRun name */ + name?: (string|null); + + /** EvaluationRun displayName */ + displayName?: (string|null); + + /** EvaluationRun evaluationResults */ + evaluationResults?: (string[]|null); + + /** EvaluationRun createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationRun initiatedBy */ + initiatedBy?: (string|null); + + /** EvaluationRun appVersion */ + appVersion?: (string|null); + + /** EvaluationRun appVersionDisplayName */ + appVersionDisplayName?: (string|null); + + /** EvaluationRun changelog */ + changelog?: (string|null); + + /** EvaluationRun changelogCreateTime */ + changelogCreateTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationRun evaluations */ + evaluations?: (string[]|null); + + /** EvaluationRun evaluationDataset */ + evaluationDataset?: (string|null); + + /** EvaluationRun evaluationType */ + evaluationType?: (google.cloud.ces.v1beta.EvaluationRun.EvaluationType|keyof typeof google.cloud.ces.v1beta.EvaluationRun.EvaluationType|null); + + /** EvaluationRun state */ + state?: (google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState|keyof typeof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState|null); + + /** EvaluationRun progress */ + progress?: (google.cloud.ces.v1beta.EvaluationRun.IProgress|null); + + /** EvaluationRun config */ + config?: (google.cloud.ces.v1beta.IEvaluationConfig|null); + + /** EvaluationRun error */ + error?: (google.rpc.IStatus|null); + + /** EvaluationRun errorInfo */ + errorInfo?: (google.cloud.ces.v1beta.IEvaluationErrorInfo|null); + + /** EvaluationRun evaluationRunSummaries */ + evaluationRunSummaries?: ({ [k: string]: google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary }|null); + + /** EvaluationRun latencyReport */ + latencyReport?: (google.cloud.ces.v1beta.ILatencyReport|null); + + /** EvaluationRun runCount */ + runCount?: (number|null); + + /** EvaluationRun personaRunConfigs */ + personaRunConfigs?: (google.cloud.ces.v1beta.IPersonaRunConfig[]|null); + + /** EvaluationRun optimizationConfig */ + optimizationConfig?: (google.cloud.ces.v1beta.IOptimizationConfig|null); + + /** EvaluationRun scheduledEvaluationRun */ + scheduledEvaluationRun?: (string|null); + + /** EvaluationRun goldenRunMethod */ + goldenRunMethod?: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod|null); + } + + /** Represents an EvaluationRun. */ + class EvaluationRun implements IEvaluationRun { + + /** + * Constructs a new EvaluationRun. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluationRun); + + /** EvaluationRun name. */ + public name: string; + + /** EvaluationRun displayName. */ + public displayName: string; + + /** EvaluationRun evaluationResults. */ + public evaluationResults: string[]; + + /** EvaluationRun createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationRun initiatedBy. */ + public initiatedBy: string; + + /** EvaluationRun appVersion. */ + public appVersion: string; + + /** EvaluationRun appVersionDisplayName. */ + public appVersionDisplayName: string; + + /** EvaluationRun changelog. */ + public changelog: string; + + /** EvaluationRun changelogCreateTime. */ + public changelogCreateTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationRun evaluations. */ + public evaluations: string[]; + + /** EvaluationRun evaluationDataset. */ + public evaluationDataset: string; + + /** EvaluationRun evaluationType. */ + public evaluationType: (google.cloud.ces.v1beta.EvaluationRun.EvaluationType|keyof typeof google.cloud.ces.v1beta.EvaluationRun.EvaluationType); + + /** EvaluationRun state. */ + public state: (google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState|keyof typeof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState); + + /** EvaluationRun progress. */ + public progress?: (google.cloud.ces.v1beta.EvaluationRun.IProgress|null); + + /** EvaluationRun config. */ + public config?: (google.cloud.ces.v1beta.IEvaluationConfig|null); + + /** EvaluationRun error. */ + public error?: (google.rpc.IStatus|null); + + /** EvaluationRun errorInfo. */ + public errorInfo?: (google.cloud.ces.v1beta.IEvaluationErrorInfo|null); + + /** EvaluationRun evaluationRunSummaries. */ + public evaluationRunSummaries: { [k: string]: google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary }; + + /** EvaluationRun latencyReport. */ + public latencyReport?: (google.cloud.ces.v1beta.ILatencyReport|null); + + /** EvaluationRun runCount. */ + public runCount: number; + + /** EvaluationRun personaRunConfigs. */ + public personaRunConfigs: google.cloud.ces.v1beta.IPersonaRunConfig[]; + + /** EvaluationRun optimizationConfig. */ + public optimizationConfig?: (google.cloud.ces.v1beta.IOptimizationConfig|null); + + /** EvaluationRun scheduledEvaluationRun. */ + public scheduledEvaluationRun: string; + + /** EvaluationRun goldenRunMethod. */ + public goldenRunMethod: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod); + + /** + * Creates a new EvaluationRun instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationRun instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluationRun): google.cloud.ces.v1beta.EvaluationRun; + + /** + * Encodes the specified EvaluationRun message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.verify|verify} messages. + * @param message EvaluationRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluationRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationRun message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.verify|verify} messages. + * @param message EvaluationRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationRun message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationRun; + + /** + * Decodes an EvaluationRun message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationRun; + + /** + * Verifies an EvaluationRun message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationRun message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationRun + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationRun; + + /** + * Creates a plain object from an EvaluationRun message. Also converts values to other types if specified. + * @param message EvaluationRun + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationRun to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationRun + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EvaluationRun { + + /** Properties of a Progress. */ + interface IProgress { + + /** Progress totalCount */ + totalCount?: (number|null); + + /** Progress failedCount */ + failedCount?: (number|null); + + /** Progress errorCount */ + errorCount?: (number|null); + + /** Progress completedCount */ + completedCount?: (number|null); + + /** Progress passedCount */ + passedCount?: (number|null); + } + + /** Represents a Progress. */ + class Progress implements IProgress { + + /** + * Constructs a new Progress. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationRun.IProgress); + + /** Progress totalCount. */ + public totalCount: number; + + /** Progress failedCount. */ + public failedCount: number; + + /** Progress errorCount. */ + public errorCount: number; + + /** Progress completedCount. */ + public completedCount: number; + + /** Progress passedCount. */ + public passedCount: number; + + /** + * Creates a new Progress instance using the specified properties. + * @param [properties] Properties to set + * @returns Progress instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationRun.IProgress): google.cloud.ces.v1beta.EvaluationRun.Progress; + + /** + * Encodes the specified Progress message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.Progress.verify|verify} messages. + * @param message Progress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationRun.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.Progress.verify|verify} messages. + * @param message Progress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationRun.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Progress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationRun.Progress; + + /** + * Decodes a Progress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationRun.Progress; + + /** + * Verifies a Progress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Progress + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationRun.Progress; + + /** + * Creates a plain object from a Progress message. Also converts values to other types if specified. + * @param message Progress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationRun.Progress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Progress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Progress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluationRunSummary. */ + interface IEvaluationRunSummary { + + /** EvaluationRunSummary passedCount */ + passedCount?: (number|null); + + /** EvaluationRunSummary failedCount */ + failedCount?: (number|null); + + /** EvaluationRunSummary errorCount */ + errorCount?: (number|null); + } + + /** Represents an EvaluationRunSummary. */ + class EvaluationRunSummary implements IEvaluationRunSummary { + + /** + * Constructs a new EvaluationRunSummary. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary); + + /** EvaluationRunSummary passedCount. */ + public passedCount: number; + + /** EvaluationRunSummary failedCount. */ + public failedCount: number; + + /** EvaluationRunSummary errorCount. */ + public errorCount: number; + + /** + * Creates a new EvaluationRunSummary instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationRunSummary instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary): google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary; + + /** + * Encodes the specified EvaluationRunSummary message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.verify|verify} messages. + * @param message EvaluationRunSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationRunSummary message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.verify|verify} messages. + * @param message EvaluationRunSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationRunSummary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationRunSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary; + + /** + * Decodes an EvaluationRunSummary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationRunSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary; + + /** + * Verifies an EvaluationRunSummary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationRunSummary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationRunSummary + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary; + + /** + * Creates a plain object from an EvaluationRunSummary message. Also converts values to other types if specified. + * @param message EvaluationRunSummary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationRunSummary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationRunSummary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** EvaluationType enum. */ + enum EvaluationType { + EVALUATION_TYPE_UNSPECIFIED = 0, + GOLDEN = 1, + SCENARIO = 2, + MIXED = 3 + } + + /** EvaluationRunState enum. */ + enum EvaluationRunState { + EVALUATION_RUN_STATE_UNSPECIFIED = 0, + RUNNING = 1, + COMPLETED = 2, + ERROR = 3 + } + } + + /** Properties of a LatencyReport. */ + interface ILatencyReport { + + /** LatencyReport toolLatencies */ + toolLatencies?: (google.cloud.ces.v1beta.LatencyReport.IToolLatency[]|null); + + /** LatencyReport callbackLatencies */ + callbackLatencies?: (google.cloud.ces.v1beta.LatencyReport.ICallbackLatency[]|null); + + /** LatencyReport guardrailLatencies */ + guardrailLatencies?: (google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency[]|null); + + /** LatencyReport llmCallLatencies */ + llmCallLatencies?: (google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency[]|null); + + /** LatencyReport sessionCount */ + sessionCount?: (number|null); + } + + /** Represents a LatencyReport. */ + class LatencyReport implements ILatencyReport { + + /** + * Constructs a new LatencyReport. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ILatencyReport); + + /** LatencyReport toolLatencies. */ + public toolLatencies: google.cloud.ces.v1beta.LatencyReport.IToolLatency[]; + + /** LatencyReport callbackLatencies. */ + public callbackLatencies: google.cloud.ces.v1beta.LatencyReport.ICallbackLatency[]; + + /** LatencyReport guardrailLatencies. */ + public guardrailLatencies: google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency[]; + + /** LatencyReport llmCallLatencies. */ + public llmCallLatencies: google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency[]; + + /** LatencyReport sessionCount. */ + public sessionCount: number; + + /** + * Creates a new LatencyReport instance using the specified properties. + * @param [properties] Properties to set + * @returns LatencyReport instance + */ + public static create(properties?: google.cloud.ces.v1beta.ILatencyReport): google.cloud.ces.v1beta.LatencyReport; + + /** + * Encodes the specified LatencyReport message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.verify|verify} messages. + * @param message LatencyReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ILatencyReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LatencyReport message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.verify|verify} messages. + * @param message LatencyReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ILatencyReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LatencyReport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatencyReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LatencyReport; + + /** + * Decodes a LatencyReport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatencyReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LatencyReport; + + /** + * Verifies a LatencyReport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LatencyReport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatencyReport + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LatencyReport; + + /** + * Creates a plain object from a LatencyReport message. Also converts values to other types if specified. + * @param message LatencyReport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.LatencyReport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LatencyReport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LatencyReport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LatencyReport { + + /** Properties of a LatencyMetrics. */ + interface ILatencyMetrics { + + /** LatencyMetrics p50Latency */ + p50Latency?: (google.protobuf.IDuration|null); + + /** LatencyMetrics p90Latency */ + p90Latency?: (google.protobuf.IDuration|null); + + /** LatencyMetrics p99Latency */ + p99Latency?: (google.protobuf.IDuration|null); + + /** LatencyMetrics callCount */ + callCount?: (number|null); + } + + /** Represents a LatencyMetrics. */ + class LatencyMetrics implements ILatencyMetrics { + + /** + * Constructs a new LatencyMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics); + + /** LatencyMetrics p50Latency. */ + public p50Latency?: (google.protobuf.IDuration|null); + + /** LatencyMetrics p90Latency. */ + public p90Latency?: (google.protobuf.IDuration|null); + + /** LatencyMetrics p99Latency. */ + public p99Latency?: (google.protobuf.IDuration|null); + + /** LatencyMetrics callCount. */ + public callCount: number; + + /** + * Creates a new LatencyMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns LatencyMetrics instance + */ + public static create(properties?: google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics): google.cloud.ces.v1beta.LatencyReport.LatencyMetrics; + + /** + * Encodes the specified LatencyMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify|verify} messages. + * @param message LatencyMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LatencyMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify|verify} messages. + * @param message LatencyMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LatencyMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LatencyReport.LatencyMetrics; + + /** + * Decodes a LatencyMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LatencyReport.LatencyMetrics; + + /** + * Verifies a LatencyMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LatencyMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatencyMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LatencyReport.LatencyMetrics; + + /** + * Creates a plain object from a LatencyMetrics message. Also converts values to other types if specified. + * @param message LatencyMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.LatencyReport.LatencyMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LatencyMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LatencyMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolLatency. */ + interface IToolLatency { + + /** ToolLatency tool */ + tool?: (string|null); + + /** ToolLatency toolsetTool */ + toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ToolLatency toolDisplayName */ + toolDisplayName?: (string|null); + + /** ToolLatency latencyMetrics */ + latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); + } + + /** Represents a ToolLatency. */ + class ToolLatency implements IToolLatency { + + /** + * Constructs a new ToolLatency. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.LatencyReport.IToolLatency); + + /** ToolLatency tool. */ + public tool?: (string|null); + + /** ToolLatency toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ToolLatency toolDisplayName. */ + public toolDisplayName: string; + + /** ToolLatency latencyMetrics. */ + public latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); + + /** ToolLatency toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new ToolLatency instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolLatency instance + */ + public static create(properties?: google.cloud.ces.v1beta.LatencyReport.IToolLatency): google.cloud.ces.v1beta.LatencyReport.ToolLatency; + + /** + * Encodes the specified ToolLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.ToolLatency.verify|verify} messages. + * @param message ToolLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.LatencyReport.IToolLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.ToolLatency.verify|verify} messages. + * @param message ToolLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.LatencyReport.IToolLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolLatency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LatencyReport.ToolLatency; + + /** + * Decodes a ToolLatency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LatencyReport.ToolLatency; + + /** + * Verifies a ToolLatency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolLatency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolLatency + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LatencyReport.ToolLatency; + + /** + * Creates a plain object from a ToolLatency message. Also converts values to other types if specified. + * @param message ToolLatency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.LatencyReport.ToolLatency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolLatency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolLatency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CallbackLatency. */ + interface ICallbackLatency { + + /** CallbackLatency stage */ + stage?: (string|null); + + /** CallbackLatency latencyMetrics */ + latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); + } + + /** Represents a CallbackLatency. */ + class CallbackLatency implements ICallbackLatency { + + /** + * Constructs a new CallbackLatency. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.LatencyReport.ICallbackLatency); + + /** CallbackLatency stage. */ + public stage: string; + + /** CallbackLatency latencyMetrics. */ + public latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); + + /** + * Creates a new CallbackLatency instance using the specified properties. + * @param [properties] Properties to set + * @returns CallbackLatency instance + */ + public static create(properties?: google.cloud.ces.v1beta.LatencyReport.ICallbackLatency): google.cloud.ces.v1beta.LatencyReport.CallbackLatency; + + /** + * Encodes the specified CallbackLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.CallbackLatency.verify|verify} messages. + * @param message CallbackLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.LatencyReport.ICallbackLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CallbackLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.CallbackLatency.verify|verify} messages. + * @param message CallbackLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.LatencyReport.ICallbackLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CallbackLatency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CallbackLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LatencyReport.CallbackLatency; + + /** + * Decodes a CallbackLatency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CallbackLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LatencyReport.CallbackLatency; + + /** + * Verifies a CallbackLatency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CallbackLatency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CallbackLatency + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LatencyReport.CallbackLatency; + + /** + * Creates a plain object from a CallbackLatency message. Also converts values to other types if specified. + * @param message CallbackLatency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.LatencyReport.CallbackLatency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CallbackLatency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CallbackLatency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GuardrailLatency. */ + interface IGuardrailLatency { + + /** GuardrailLatency guardrail */ + guardrail?: (string|null); + + /** GuardrailLatency guardrailDisplayName */ + guardrailDisplayName?: (string|null); + + /** GuardrailLatency latencyMetrics */ + latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); + } + + /** Represents a GuardrailLatency. */ + class GuardrailLatency implements IGuardrailLatency { + + /** + * Constructs a new GuardrailLatency. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency); + + /** GuardrailLatency guardrail. */ + public guardrail: string; + + /** GuardrailLatency guardrailDisplayName. */ + public guardrailDisplayName: string; + + /** GuardrailLatency latencyMetrics. */ + public latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); + + /** + * Creates a new GuardrailLatency instance using the specified properties. + * @param [properties] Properties to set + * @returns GuardrailLatency instance + */ + public static create(properties?: google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency): google.cloud.ces.v1beta.LatencyReport.GuardrailLatency; + + /** + * Encodes the specified GuardrailLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.verify|verify} messages. + * @param message GuardrailLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GuardrailLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.verify|verify} messages. + * @param message GuardrailLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GuardrailLatency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GuardrailLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LatencyReport.GuardrailLatency; + + /** + * Decodes a GuardrailLatency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GuardrailLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LatencyReport.GuardrailLatency; + + /** + * Verifies a GuardrailLatency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GuardrailLatency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GuardrailLatency + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LatencyReport.GuardrailLatency; + + /** + * Creates a plain object from a GuardrailLatency message. Also converts values to other types if specified. + * @param message GuardrailLatency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.LatencyReport.GuardrailLatency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GuardrailLatency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GuardrailLatency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LlmCallLatency. */ + interface ILlmCallLatency { + + /** LlmCallLatency model */ + model?: (string|null); + + /** LlmCallLatency latencyMetrics */ + latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); + } + + /** Represents a LlmCallLatency. */ + class LlmCallLatency implements ILlmCallLatency { + + /** + * Constructs a new LlmCallLatency. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency); + + /** LlmCallLatency model. */ + public model: string; + + /** LlmCallLatency latencyMetrics. */ + public latencyMetrics?: (google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null); + + /** + * Creates a new LlmCallLatency instance using the specified properties. + * @param [properties] Properties to set + * @returns LlmCallLatency instance + */ + public static create(properties?: google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency): google.cloud.ces.v1beta.LatencyReport.LlmCallLatency; + + /** + * Encodes the specified LlmCallLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.verify|verify} messages. + * @param message LlmCallLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LlmCallLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.verify|verify} messages. + * @param message LlmCallLatency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LlmCallLatency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LlmCallLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.LatencyReport.LlmCallLatency; + + /** + * Decodes a LlmCallLatency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LlmCallLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.LatencyReport.LlmCallLatency; + + /** + * Verifies a LlmCallLatency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LlmCallLatency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LlmCallLatency + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.LatencyReport.LlmCallLatency; + + /** + * Creates a plain object from a LlmCallLatency message. Also converts values to other types if specified. + * @param message LlmCallLatency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.LatencyReport.LlmCallLatency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LlmCallLatency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LlmCallLatency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EvaluationExpectation. */ + interface IEvaluationExpectation { + + /** EvaluationExpectation llmCriteria */ + llmCriteria?: (google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria|null); + + /** EvaluationExpectation name */ + name?: (string|null); + + /** EvaluationExpectation displayName */ + displayName?: (string|null); + + /** EvaluationExpectation tags */ + tags?: (string[]|null); + + /** EvaluationExpectation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationExpectation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationExpectation etag */ + etag?: (string|null); + } + + /** Represents an EvaluationExpectation. */ + class EvaluationExpectation implements IEvaluationExpectation { + + /** + * Constructs a new EvaluationExpectation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluationExpectation); + + /** EvaluationExpectation llmCriteria. */ + public llmCriteria?: (google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria|null); + + /** EvaluationExpectation name. */ + public name: string; + + /** EvaluationExpectation displayName. */ + public displayName: string; + + /** EvaluationExpectation tags. */ + public tags: string[]; + + /** EvaluationExpectation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationExpectation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** EvaluationExpectation etag. */ + public etag: string; + + /** EvaluationExpectation criteria. */ + public criteria?: "llmCriteria"; + + /** + * Creates a new EvaluationExpectation instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationExpectation instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluationExpectation): google.cloud.ces.v1beta.EvaluationExpectation; + + /** + * Encodes the specified EvaluationExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.verify|verify} messages. + * @param message EvaluationExpectation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluationExpectation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.verify|verify} messages. + * @param message EvaluationExpectation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationExpectation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationExpectation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationExpectation; + + /** + * Decodes an EvaluationExpectation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationExpectation; + + /** + * Verifies an EvaluationExpectation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationExpectation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationExpectation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationExpectation; + + /** + * Creates a plain object from an EvaluationExpectation message. Also converts values to other types if specified. + * @param message EvaluationExpectation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationExpectation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationExpectation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationExpectation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EvaluationExpectation { + + /** Properties of a LlmCriteria. */ + interface ILlmCriteria { + + /** LlmCriteria prompt */ + prompt?: (string|null); + } + + /** Represents a LlmCriteria. */ + class LlmCriteria implements ILlmCriteria { + + /** + * Constructs a new LlmCriteria. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria); + + /** LlmCriteria prompt. */ + public prompt: string; + + /** + * Creates a new LlmCriteria instance using the specified properties. + * @param [properties] Properties to set + * @returns LlmCriteria instance + */ + public static create(properties?: google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria): google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria; + + /** + * Encodes the specified LlmCriteria message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.verify|verify} messages. + * @param message LlmCriteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LlmCriteria message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.verify|verify} messages. + * @param message LlmCriteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LlmCriteria message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LlmCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria; + + /** + * Decodes a LlmCriteria message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LlmCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria; + + /** + * Verifies a LlmCriteria message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LlmCriteria message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LlmCriteria + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria; + + /** + * Creates a plain object from a LlmCriteria message. Also converts values to other types if specified. + * @param message LlmCriteria + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LlmCriteria to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LlmCriteria + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EvaluationConfig. */ + interface IEvaluationConfig { + + /** EvaluationConfig inputAudioConfig */ + inputAudioConfig?: (google.cloud.ces.v1beta.IInputAudioConfig|null); + + /** EvaluationConfig outputAudioConfig */ + outputAudioConfig?: (google.cloud.ces.v1beta.IOutputAudioConfig|null); + + /** EvaluationConfig evaluationChannel */ + evaluationChannel?: (google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel|keyof typeof google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel|null); + + /** EvaluationConfig toolCallBehaviour */ + toolCallBehaviour?: (google.cloud.ces.v1beta.EvaluationToolCallBehaviour|keyof typeof google.cloud.ces.v1beta.EvaluationToolCallBehaviour|null); + } + + /** Represents an EvaluationConfig. */ + class EvaluationConfig implements IEvaluationConfig { + + /** + * Constructs a new EvaluationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluationConfig); + + /** EvaluationConfig inputAudioConfig. */ + public inputAudioConfig?: (google.cloud.ces.v1beta.IInputAudioConfig|null); + + /** EvaluationConfig outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.ces.v1beta.IOutputAudioConfig|null); + + /** EvaluationConfig evaluationChannel. */ + public evaluationChannel: (google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel|keyof typeof google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel); + + /** EvaluationConfig toolCallBehaviour. */ + public toolCallBehaviour: (google.cloud.ces.v1beta.EvaluationToolCallBehaviour|keyof typeof google.cloud.ces.v1beta.EvaluationToolCallBehaviour); + + /** + * Creates a new EvaluationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluationConfig): google.cloud.ces.v1beta.EvaluationConfig; + + /** + * Encodes the specified EvaluationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationConfig.verify|verify} messages. + * @param message EvaluationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationConfig.verify|verify} messages. + * @param message EvaluationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationConfig; + + /** + * Decodes an EvaluationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationConfig; + + /** + * Verifies an EvaluationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationConfig; + + /** + * Creates a plain object from an EvaluationConfig message. Also converts values to other types if specified. + * @param message EvaluationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EvaluationConfig { + + /** EvaluationChannel enum. */ + enum EvaluationChannel { + EVALUATION_CHANNEL_UNSPECIFIED = 0, + TEXT = 1, + AUDIO = 2 + } + } + + /** Properties of an EvaluationErrorInfo. */ + interface IEvaluationErrorInfo { + + /** EvaluationErrorInfo errorType */ + errorType?: (google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType|keyof typeof google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType|null); + + /** EvaluationErrorInfo errorMessage */ + errorMessage?: (string|null); + + /** EvaluationErrorInfo sessionId */ + sessionId?: (string|null); + } + + /** Represents an EvaluationErrorInfo. */ + class EvaluationErrorInfo implements IEvaluationErrorInfo { + + /** + * Constructs a new EvaluationErrorInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvaluationErrorInfo); + + /** EvaluationErrorInfo errorType. */ + public errorType: (google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType|keyof typeof google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType); + + /** EvaluationErrorInfo errorMessage. */ + public errorMessage: string; + + /** EvaluationErrorInfo sessionId. */ + public sessionId: string; + + /** + * Creates a new EvaluationErrorInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationErrorInfo instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvaluationErrorInfo): google.cloud.ces.v1beta.EvaluationErrorInfo; + + /** + * Encodes the specified EvaluationErrorInfo message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationErrorInfo.verify|verify} messages. + * @param message EvaluationErrorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvaluationErrorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationErrorInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationErrorInfo.verify|verify} messages. + * @param message EvaluationErrorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvaluationErrorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationErrorInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationErrorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EvaluationErrorInfo; + + /** + * Decodes an EvaluationErrorInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationErrorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EvaluationErrorInfo; + + /** + * Verifies an EvaluationErrorInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationErrorInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationErrorInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EvaluationErrorInfo; + + /** + * Creates a plain object from an EvaluationErrorInfo message. Also converts values to other types if specified. + * @param message EvaluationErrorInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EvaluationErrorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationErrorInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationErrorInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EvaluationErrorInfo { + + /** ErrorType enum. */ + enum ErrorType { + ERROR_TYPE_UNSPECIFIED = 0, + RUNTIME_FAILURE = 1, + CONVERSATION_RETRIEVAL_FAILURE = 2, + METRIC_CALCULATION_FAILURE = 3, + EVALUATION_UPDATE_FAILURE = 4, + QUOTA_EXHAUSTED = 5, + USER_SIMULATION_FAILURE = 6 + } + } + + /** Properties of a RunEvaluationRequest. */ + interface IRunEvaluationRequest { + + /** RunEvaluationRequest app */ + app?: (string|null); + + /** RunEvaluationRequest evaluations */ + evaluations?: (string[]|null); + + /** RunEvaluationRequest evaluationDataset */ + evaluationDataset?: (string|null); + + /** RunEvaluationRequest displayName */ + displayName?: (string|null); + + /** RunEvaluationRequest appVersion */ + appVersion?: (string|null); + + /** RunEvaluationRequest config */ + config?: (google.cloud.ces.v1beta.IEvaluationConfig|null); + + /** RunEvaluationRequest runCount */ + runCount?: (number|null); + + /** RunEvaluationRequest personaRunConfigs */ + personaRunConfigs?: (google.cloud.ces.v1beta.IPersonaRunConfig[]|null); + + /** RunEvaluationRequest optimizationConfig */ + optimizationConfig?: (google.cloud.ces.v1beta.IOptimizationConfig|null); + + /** RunEvaluationRequest scheduledEvaluationRun */ + scheduledEvaluationRun?: (string|null); + + /** RunEvaluationRequest goldenRunMethod */ + goldenRunMethod?: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod|null); + + /** RunEvaluationRequest generateLatencyReport */ + generateLatencyReport?: (boolean|null); + } + + /** Represents a RunEvaluationRequest. */ + class RunEvaluationRequest implements IRunEvaluationRequest { + + /** + * Constructs a new RunEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRunEvaluationRequest); + + /** RunEvaluationRequest app. */ + public app: string; + + /** RunEvaluationRequest evaluations. */ + public evaluations: string[]; + + /** RunEvaluationRequest evaluationDataset. */ + public evaluationDataset: string; + + /** RunEvaluationRequest displayName. */ + public displayName: string; + + /** RunEvaluationRequest appVersion. */ + public appVersion: string; + + /** RunEvaluationRequest config. */ + public config?: (google.cloud.ces.v1beta.IEvaluationConfig|null); + + /** RunEvaluationRequest runCount. */ + public runCount?: (number|null); + + /** RunEvaluationRequest personaRunConfigs. */ + public personaRunConfigs: google.cloud.ces.v1beta.IPersonaRunConfig[]; + + /** RunEvaluationRequest optimizationConfig. */ + public optimizationConfig?: (google.cloud.ces.v1beta.IOptimizationConfig|null); + + /** RunEvaluationRequest scheduledEvaluationRun. */ + public scheduledEvaluationRun: string; + + /** RunEvaluationRequest goldenRunMethod. */ + public goldenRunMethod: (google.cloud.ces.v1beta.GoldenRunMethod|keyof typeof google.cloud.ces.v1beta.GoldenRunMethod); + + /** RunEvaluationRequest generateLatencyReport. */ + public generateLatencyReport: boolean; + + /** + * Creates a new RunEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunEvaluationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRunEvaluationRequest): google.cloud.ces.v1beta.RunEvaluationRequest; + + /** + * Encodes the specified RunEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationRequest.verify|verify} messages. + * @param message RunEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRunEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationRequest.verify|verify} messages. + * @param message RunEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRunEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RunEvaluationRequest; + + /** + * Decodes a RunEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RunEvaluationRequest; + + /** + * Verifies a RunEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RunEvaluationRequest; + + /** + * Creates a plain object from a RunEvaluationRequest message. Also converts values to other types if specified. + * @param message RunEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RunEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduledEvaluationRun. */ + interface IScheduledEvaluationRun { + + /** ScheduledEvaluationRun name */ + name?: (string|null); + + /** ScheduledEvaluationRun displayName */ + displayName?: (string|null); + + /** ScheduledEvaluationRun request */ + request?: (google.cloud.ces.v1beta.IRunEvaluationRequest|null); + + /** ScheduledEvaluationRun description */ + description?: (string|null); + + /** ScheduledEvaluationRun schedulingConfig */ + schedulingConfig?: (google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig|null); + + /** ScheduledEvaluationRun active */ + active?: (boolean|null); + + /** ScheduledEvaluationRun lastCompletedRun */ + lastCompletedRun?: (string|null); + + /** ScheduledEvaluationRun totalExecutions */ + totalExecutions?: (number|null); + + /** ScheduledEvaluationRun nextScheduledExecutionTime */ + nextScheduledExecutionTime?: (google.protobuf.ITimestamp|null); + + /** ScheduledEvaluationRun createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ScheduledEvaluationRun createdBy */ + createdBy?: (string|null); + + /** ScheduledEvaluationRun updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ScheduledEvaluationRun lastUpdatedBy */ + lastUpdatedBy?: (string|null); + + /** ScheduledEvaluationRun etag */ + etag?: (string|null); + } + + /** Represents a ScheduledEvaluationRun. */ + class ScheduledEvaluationRun implements IScheduledEvaluationRun { + + /** + * Constructs a new ScheduledEvaluationRun. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IScheduledEvaluationRun); + + /** ScheduledEvaluationRun name. */ + public name: string; + + /** ScheduledEvaluationRun displayName. */ + public displayName: string; + + /** ScheduledEvaluationRun request. */ + public request?: (google.cloud.ces.v1beta.IRunEvaluationRequest|null); + + /** ScheduledEvaluationRun description. */ + public description: string; + + /** ScheduledEvaluationRun schedulingConfig. */ + public schedulingConfig?: (google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig|null); + + /** ScheduledEvaluationRun active. */ + public active: boolean; + + /** ScheduledEvaluationRun lastCompletedRun. */ + public lastCompletedRun: string; + + /** ScheduledEvaluationRun totalExecutions. */ + public totalExecutions: number; + + /** ScheduledEvaluationRun nextScheduledExecutionTime. */ + public nextScheduledExecutionTime?: (google.protobuf.ITimestamp|null); + + /** ScheduledEvaluationRun createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ScheduledEvaluationRun createdBy. */ + public createdBy: string; + + /** ScheduledEvaluationRun updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ScheduledEvaluationRun lastUpdatedBy. */ + public lastUpdatedBy: string; + + /** ScheduledEvaluationRun etag. */ + public etag: string; + + /** + * Creates a new ScheduledEvaluationRun instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduledEvaluationRun instance + */ + public static create(properties?: google.cloud.ces.v1beta.IScheduledEvaluationRun): google.cloud.ces.v1beta.ScheduledEvaluationRun; + + /** + * Encodes the specified ScheduledEvaluationRun message. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.verify|verify} messages. + * @param message ScheduledEvaluationRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IScheduledEvaluationRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScheduledEvaluationRun message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.verify|verify} messages. + * @param message ScheduledEvaluationRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IScheduledEvaluationRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduledEvaluationRun message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScheduledEvaluationRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ScheduledEvaluationRun; + + /** + * Decodes a ScheduledEvaluationRun message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScheduledEvaluationRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ScheduledEvaluationRun; + + /** + * Verifies a ScheduledEvaluationRun message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScheduledEvaluationRun message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScheduledEvaluationRun + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ScheduledEvaluationRun; + + /** + * Creates a plain object from a ScheduledEvaluationRun message. Also converts values to other types if specified. + * @param message ScheduledEvaluationRun + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ScheduledEvaluationRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScheduledEvaluationRun to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScheduledEvaluationRun + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScheduledEvaluationRun { + + /** Properties of a SchedulingConfig. */ + interface ISchedulingConfig { + + /** SchedulingConfig frequency */ + frequency?: (google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency|keyof typeof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency|null); + + /** SchedulingConfig startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** SchedulingConfig daysOfWeek */ + daysOfWeek?: (number[]|null); + } + + /** Represents a SchedulingConfig. */ + class SchedulingConfig implements ISchedulingConfig { + + /** + * Constructs a new SchedulingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig); + + /** SchedulingConfig frequency. */ + public frequency: (google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency|keyof typeof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency); + + /** SchedulingConfig startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** SchedulingConfig daysOfWeek. */ + public daysOfWeek: number[]; + + /** + * Creates a new SchedulingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SchedulingConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig): google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig; + + /** + * Encodes the specified SchedulingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.verify|verify} messages. + * @param message SchedulingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchedulingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.verify|verify} messages. + * @param message SchedulingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchedulingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchedulingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig; + + /** + * Decodes a SchedulingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchedulingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig; + + /** + * Verifies a SchedulingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SchedulingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchedulingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig; + + /** + * Creates a plain object from a SchedulingConfig message. Also converts values to other types if specified. + * @param message SchedulingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchedulingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SchedulingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SchedulingConfig { + + /** Frequency enum. */ + enum Frequency { + FREQUENCY_UNSPECIFIED = 0, + NONE = 1, + DAILY = 2, + WEEKLY = 3, + BIWEEKLY = 4 + } + } + } + + /** Properties of a PersonaRunConfig. */ + interface IPersonaRunConfig { + + /** PersonaRunConfig persona */ + persona?: (string|null); + + /** PersonaRunConfig taskCount */ + taskCount?: (number|null); + } + + /** Represents a PersonaRunConfig. */ + class PersonaRunConfig implements IPersonaRunConfig { + + /** + * Constructs a new PersonaRunConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IPersonaRunConfig); + + /** PersonaRunConfig persona. */ + public persona: string; + + /** PersonaRunConfig taskCount. */ + public taskCount: number; + + /** + * Creates a new PersonaRunConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonaRunConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IPersonaRunConfig): google.cloud.ces.v1beta.PersonaRunConfig; + + /** + * Encodes the specified PersonaRunConfig message. Does not implicitly {@link google.cloud.ces.v1beta.PersonaRunConfig.verify|verify} messages. + * @param message PersonaRunConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IPersonaRunConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersonaRunConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.PersonaRunConfig.verify|verify} messages. + * @param message PersonaRunConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IPersonaRunConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersonaRunConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonaRunConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.PersonaRunConfig; + + /** + * Decodes a PersonaRunConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonaRunConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.PersonaRunConfig; + + /** + * Verifies a PersonaRunConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PersonaRunConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonaRunConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.PersonaRunConfig; + + /** + * Creates a plain object from a PersonaRunConfig message. Also converts values to other types if specified. + * @param message PersonaRunConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.PersonaRunConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersonaRunConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PersonaRunConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OptimizationConfig. */ + interface IOptimizationConfig { + + /** OptimizationConfig generateLossReport */ + generateLossReport?: (boolean|null); + + /** OptimizationConfig assistantSession */ + assistantSession?: (string|null); + + /** OptimizationConfig reportSummary */ + reportSummary?: (string|null); + + /** OptimizationConfig shouldSuggestFix */ + shouldSuggestFix?: (boolean|null); + + /** OptimizationConfig status */ + status?: (google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus|keyof typeof google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus|null); + + /** OptimizationConfig errorMessage */ + errorMessage?: (string|null); + + /** OptimizationConfig lossReport */ + lossReport?: (google.protobuf.IStruct|null); + } + + /** Represents an OptimizationConfig. */ + class OptimizationConfig implements IOptimizationConfig { + + /** + * Constructs a new OptimizationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IOptimizationConfig); + + /** OptimizationConfig generateLossReport. */ + public generateLossReport: boolean; + + /** OptimizationConfig assistantSession. */ + public assistantSession: string; + + /** OptimizationConfig reportSummary. */ + public reportSummary: string; + + /** OptimizationConfig shouldSuggestFix. */ + public shouldSuggestFix: boolean; + + /** OptimizationConfig status. */ + public status: (google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus|keyof typeof google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus); + + /** OptimizationConfig errorMessage. */ + public errorMessage: string; + + /** OptimizationConfig lossReport. */ + public lossReport?: (google.protobuf.IStruct|null); + + /** + * Creates a new OptimizationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OptimizationConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IOptimizationConfig): google.cloud.ces.v1beta.OptimizationConfig; + + /** + * Encodes the specified OptimizationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OptimizationConfig.verify|verify} messages. + * @param message OptimizationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IOptimizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OptimizationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OptimizationConfig.verify|verify} messages. + * @param message OptimizationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IOptimizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OptimizationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OptimizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OptimizationConfig; + + /** + * Decodes an OptimizationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OptimizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OptimizationConfig; + + /** + * Verifies an OptimizationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OptimizationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OptimizationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OptimizationConfig; + + /** + * Creates a plain object from an OptimizationConfig message. Also converts values to other types if specified. + * @param message OptimizationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OptimizationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OptimizationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OptimizationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OptimizationConfig { + + /** OptimizationStatus enum. */ + enum OptimizationStatus { + OPTIMIZATION_STATUS_UNSPECIFIED = 0, + RUNNING = 1, + COMPLETED = 2, + ERROR = 3 + } + } + + /** Represents a SessionService */ + class SessionService extends $protobuf.rpc.Service { + + /** + * Constructs a new SessionService 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 SessionService 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): SessionService; + + /** + * Calls RunSession. + * @param request RunSessionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RunSessionResponse + */ + public runSession(request: google.cloud.ces.v1beta.IRunSessionRequest, callback: google.cloud.ces.v1beta.SessionService.RunSessionCallback): void; + + /** + * Calls RunSession. + * @param request RunSessionRequest message or plain object + * @returns Promise + */ + public runSession(request: google.cloud.ces.v1beta.IRunSessionRequest): Promise; + + /** + * Calls BidiRunSession. + * @param request BidiSessionClientMessage message or plain object + * @param callback Node-style callback called with the error, if any, and BidiSessionServerMessage + */ + public bidiRunSession(request: google.cloud.ces.v1beta.IBidiSessionClientMessage, callback: google.cloud.ces.v1beta.SessionService.BidiRunSessionCallback): void; + + /** + * Calls BidiRunSession. + * @param request BidiSessionClientMessage message or plain object + * @returns Promise + */ + public bidiRunSession(request: google.cloud.ces.v1beta.IBidiSessionClientMessage): Promise; + } + + namespace SessionService { + + /** + * Callback as used by {@link google.cloud.ces.v1beta.SessionService|runSession}. + * @param error Error, if any + * @param [response] RunSessionResponse + */ + type RunSessionCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.RunSessionResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.SessionService|bidiRunSession}. + * @param error Error, if any + * @param [response] BidiSessionServerMessage + */ + type BidiRunSessionCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.BidiSessionServerMessage) => void; + } + + /** AudioEncoding enum. */ + enum AudioEncoding { + AUDIO_ENCODING_UNSPECIFIED = 0, + LINEAR16 = 1, + MULAW = 2, + ALAW = 3 + } + + /** Properties of an InputAudioConfig. */ + interface IInputAudioConfig { + + /** InputAudioConfig audioEncoding */ + audioEncoding?: (google.cloud.ces.v1beta.AudioEncoding|keyof typeof google.cloud.ces.v1beta.AudioEncoding|null); + + /** InputAudioConfig sampleRateHertz */ + sampleRateHertz?: (number|null); + + /** InputAudioConfig noiseSuppressionLevel */ + noiseSuppressionLevel?: (string|null); + } + + /** Represents an InputAudioConfig. */ + class InputAudioConfig implements IInputAudioConfig { + + /** + * Constructs a new InputAudioConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IInputAudioConfig); + + /** InputAudioConfig audioEncoding. */ + public audioEncoding: (google.cloud.ces.v1beta.AudioEncoding|keyof typeof google.cloud.ces.v1beta.AudioEncoding); + + /** InputAudioConfig sampleRateHertz. */ + public sampleRateHertz: number; + + /** InputAudioConfig noiseSuppressionLevel. */ + public noiseSuppressionLevel: string; + + /** + * Creates a new InputAudioConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputAudioConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IInputAudioConfig): google.cloud.ces.v1beta.InputAudioConfig; + + /** + * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1beta.InputAudioConfig.verify|verify} messages. + * @param message InputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.InputAudioConfig.verify|verify} messages. + * @param message InputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.InputAudioConfig; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.InputAudioConfig; + + /** + * Verifies an InputAudioConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputAudioConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.InputAudioConfig; + + /** + * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. + * @param message InputAudioConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.InputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputAudioConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputAudioConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutputAudioConfig. */ + interface IOutputAudioConfig { + + /** OutputAudioConfig audioEncoding */ + audioEncoding?: (google.cloud.ces.v1beta.AudioEncoding|keyof typeof google.cloud.ces.v1beta.AudioEncoding|null); + + /** OutputAudioConfig sampleRateHertz */ + sampleRateHertz?: (number|null); + } + + /** Represents an OutputAudioConfig. */ + class OutputAudioConfig implements IOutputAudioConfig { + + /** + * Constructs a new OutputAudioConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IOutputAudioConfig); + + /** OutputAudioConfig audioEncoding. */ + public audioEncoding: (google.cloud.ces.v1beta.AudioEncoding|keyof typeof google.cloud.ces.v1beta.AudioEncoding); + + /** OutputAudioConfig sampleRateHertz. */ + public sampleRateHertz: number; + + /** + * Creates a new OutputAudioConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputAudioConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IOutputAudioConfig): google.cloud.ces.v1beta.OutputAudioConfig; + + /** + * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OutputAudioConfig.verify|verify} messages. + * @param message OutputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OutputAudioConfig.verify|verify} messages. + * @param message OutputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OutputAudioConfig; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OutputAudioConfig; + + /** + * Verifies an OutputAudioConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputAudioConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OutputAudioConfig; + + /** + * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. + * @param message OutputAudioConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OutputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputAudioConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputAudioConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SessionConfig. */ + interface ISessionConfig { + + /** SessionConfig session */ + session?: (string|null); + + /** SessionConfig inputAudioConfig */ + inputAudioConfig?: (google.cloud.ces.v1beta.IInputAudioConfig|null); + + /** SessionConfig outputAudioConfig */ + outputAudioConfig?: (google.cloud.ces.v1beta.IOutputAudioConfig|null); + + /** SessionConfig historicalContexts */ + historicalContexts?: (google.cloud.ces.v1beta.IMessage[]|null); + + /** SessionConfig entryAgent */ + entryAgent?: (string|null); + + /** SessionConfig deployment */ + deployment?: (string|null); + + /** SessionConfig timeZone */ + timeZone?: (string|null); + + /** SessionConfig remoteDialogflowQueryParameters */ + remoteDialogflowQueryParameters?: (google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters|null); + } + + /** Represents a SessionConfig. */ + class SessionConfig implements ISessionConfig { + + /** + * Constructs a new SessionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ISessionConfig); + + /** SessionConfig session. */ + public session: string; + + /** SessionConfig inputAudioConfig. */ + public inputAudioConfig?: (google.cloud.ces.v1beta.IInputAudioConfig|null); + + /** SessionConfig outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.ces.v1beta.IOutputAudioConfig|null); + + /** SessionConfig historicalContexts. */ + public historicalContexts: google.cloud.ces.v1beta.IMessage[]; + + /** SessionConfig entryAgent. */ + public entryAgent: string; + + /** SessionConfig deployment. */ + public deployment: string; + + /** SessionConfig timeZone. */ + public timeZone: string; + + /** SessionConfig remoteDialogflowQueryParameters. */ + public remoteDialogflowQueryParameters?: (google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters|null); + + /** + * Creates a new SessionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.ISessionConfig): google.cloud.ces.v1beta.SessionConfig; + + /** + * Encodes the specified SessionConfig message. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.verify|verify} messages. + * @param message SessionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ISessionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.verify|verify} messages. + * @param message SessionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ISessionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SessionConfig; + + /** + * Decodes a SessionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SessionConfig; + + /** + * Verifies a SessionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SessionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SessionConfig; + + /** + * Creates a plain object from a SessionConfig message. Also converts values to other types if specified. + * @param message SessionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.SessionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SessionConfig { + + /** Properties of a RemoteDialogflowQueryParameters. */ + interface IRemoteDialogflowQueryParameters { + + /** RemoteDialogflowQueryParameters webhookHeaders */ + webhookHeaders?: ({ [k: string]: string }|null); + + /** RemoteDialogflowQueryParameters payload */ + payload?: (google.protobuf.IStruct|null); + + /** RemoteDialogflowQueryParameters endUserMetadata */ + endUserMetadata?: (google.protobuf.IStruct|null); + } + + /** Represents a RemoteDialogflowQueryParameters. */ + class RemoteDialogflowQueryParameters implements IRemoteDialogflowQueryParameters { + + /** + * Constructs a new RemoteDialogflowQueryParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters); + + /** RemoteDialogflowQueryParameters webhookHeaders. */ + public webhookHeaders: { [k: string]: string }; + + /** RemoteDialogflowQueryParameters payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** RemoteDialogflowQueryParameters endUserMetadata. */ + public endUserMetadata?: (google.protobuf.IStruct|null); + + /** + * Creates a new RemoteDialogflowQueryParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoteDialogflowQueryParameters instance + */ + public static create(properties?: google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters): google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters; + + /** + * Encodes the specified RemoteDialogflowQueryParameters message. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. + * @param message RemoteDialogflowQueryParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoteDialogflowQueryParameters message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. + * @param message RemoteDialogflowQueryParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoteDialogflowQueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters; + + /** + * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoteDialogflowQueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters; + + /** + * Verifies a RemoteDialogflowQueryParameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoteDialogflowQueryParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoteDialogflowQueryParameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters; + + /** + * Creates a plain object from a RemoteDialogflowQueryParameters message. Also converts values to other types if specified. + * @param message RemoteDialogflowQueryParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoteDialogflowQueryParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoteDialogflowQueryParameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ToolCalls. */ + interface IToolCalls { + + /** ToolCalls toolCalls */ + toolCalls?: (google.cloud.ces.v1beta.IToolCall[]|null); + } + + /** Represents a ToolCalls. */ + class ToolCalls implements IToolCalls { + + /** + * Constructs a new ToolCalls. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IToolCalls); + + /** ToolCalls toolCalls. */ + public toolCalls: google.cloud.ces.v1beta.IToolCall[]; + + /** + * Creates a new ToolCalls instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolCalls instance + */ + public static create(properties?: google.cloud.ces.v1beta.IToolCalls): google.cloud.ces.v1beta.ToolCalls; + + /** + * Encodes the specified ToolCalls message. Does not implicitly {@link google.cloud.ces.v1beta.ToolCalls.verify|verify} messages. + * @param message ToolCalls message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IToolCalls, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolCalls message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolCalls.verify|verify} messages. + * @param message ToolCalls message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IToolCalls, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolCalls message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolCalls + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ToolCalls; + + /** + * Decodes a ToolCalls message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolCalls + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ToolCalls; + + /** + * Verifies a ToolCalls message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolCalls message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolCalls + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ToolCalls; + + /** + * Creates a plain object from a ToolCalls message. Also converts values to other types if specified. + * @param message ToolCalls + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ToolCalls, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolCalls to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolCalls + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolResponses. */ + interface IToolResponses { + + /** ToolResponses toolResponses */ + toolResponses?: (google.cloud.ces.v1beta.IToolResponse[]|null); + } + + /** Represents a ToolResponses. */ + class ToolResponses implements IToolResponses { + + /** + * Constructs a new ToolResponses. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IToolResponses); + + /** ToolResponses toolResponses. */ + public toolResponses: google.cloud.ces.v1beta.IToolResponse[]; + + /** + * Creates a new ToolResponses instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolResponses instance + */ + public static create(properties?: google.cloud.ces.v1beta.IToolResponses): google.cloud.ces.v1beta.ToolResponses; + + /** + * Encodes the specified ToolResponses message. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponses.verify|verify} messages. + * @param message ToolResponses message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IToolResponses, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolResponses message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponses.verify|verify} messages. + * @param message ToolResponses message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IToolResponses, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolResponses message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ToolResponses; + + /** + * Decodes a ToolResponses message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ToolResponses; + + /** + * Verifies a ToolResponses message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolResponses message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolResponses + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ToolResponses; + + /** + * Creates a plain object from a ToolResponses message. Also converts values to other types if specified. + * @param message ToolResponses + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ToolResponses, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolResponses to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolResponses + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Citations. */ + interface ICitations { + + /** Citations citedChunks */ + citedChunks?: (google.cloud.ces.v1beta.Citations.ICitedChunk[]|null); + } + + /** Represents a Citations. */ + class Citations implements ICitations { + + /** + * Constructs a new Citations. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICitations); + + /** Citations citedChunks. */ + public citedChunks: google.cloud.ces.v1beta.Citations.ICitedChunk[]; + + /** + * Creates a new Citations instance using the specified properties. + * @param [properties] Properties to set + * @returns Citations instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICitations): google.cloud.ces.v1beta.Citations; + + /** + * Encodes the specified Citations message. Does not implicitly {@link google.cloud.ces.v1beta.Citations.verify|verify} messages. + * @param message Citations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICitations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Citations message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Citations.verify|verify} messages. + * @param message Citations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICitations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Citations message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Citations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Citations; + + /** + * Decodes a Citations message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Citations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Citations; + + /** + * Verifies a Citations message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Citations message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Citations + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Citations; + + /** + * Creates a plain object from a Citations message. Also converts values to other types if specified. + * @param message Citations + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Citations, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Citations to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Citations + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Citations { + + /** Properties of a CitedChunk. */ + interface ICitedChunk { + + /** CitedChunk uri */ + uri?: (string|null); + + /** CitedChunk title */ + title?: (string|null); + + /** CitedChunk text */ + text?: (string|null); + } + + /** Represents a CitedChunk. */ + class CitedChunk implements ICitedChunk { + + /** + * Constructs a new CitedChunk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.Citations.ICitedChunk); + + /** CitedChunk uri. */ + public uri: string; + + /** CitedChunk title. */ + public title: string; + + /** CitedChunk text. */ + public text: string; + + /** + * Creates a new CitedChunk instance using the specified properties. + * @param [properties] Properties to set + * @returns CitedChunk instance + */ + public static create(properties?: google.cloud.ces.v1beta.Citations.ICitedChunk): google.cloud.ces.v1beta.Citations.CitedChunk; + + /** + * Encodes the specified CitedChunk message. Does not implicitly {@link google.cloud.ces.v1beta.Citations.CitedChunk.verify|verify} messages. + * @param message CitedChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.Citations.ICitedChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CitedChunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Citations.CitedChunk.verify|verify} messages. + * @param message CitedChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.Citations.ICitedChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CitedChunk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CitedChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Citations.CitedChunk; + + /** + * Decodes a CitedChunk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CitedChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Citations.CitedChunk; + + /** + * Verifies a CitedChunk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CitedChunk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CitedChunk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Citations.CitedChunk; + + /** + * Creates a plain object from a CitedChunk message. Also converts values to other types if specified. + * @param message CitedChunk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Citations.CitedChunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CitedChunk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CitedChunk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an Event. */ + interface IEvent { + + /** Event event */ + event?: (string|null); + } + + /** Represents an Event. */ + class Event implements IEvent { + + /** + * Constructs a new Event. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEvent); + + /** Event event. */ + public event: string; + + /** + * Creates a new Event instance using the specified properties. + * @param [properties] Properties to set + * @returns Event instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEvent): google.cloud.ces.v1beta.Event; + + /** + * Encodes the specified Event message. Does not implicitly {@link google.cloud.ces.v1beta.Event.verify|verify} messages. + * @param message Event message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Event.verify|verify} messages. + * @param message Event message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Event message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Event; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Event; + + /** + * Verifies an Event message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Event message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Event + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Event; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @param message Event + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Event, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Event to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Event + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SessionInput. */ + interface ISessionInput { + + /** SessionInput text */ + text?: (string|null); + + /** SessionInput dtmf */ + dtmf?: (string|null); + + /** SessionInput audio */ + audio?: (Uint8Array|Buffer|string|null); + + /** SessionInput toolResponses */ + toolResponses?: (google.cloud.ces.v1beta.IToolResponses|null); + + /** SessionInput image */ + image?: (google.cloud.ces.v1beta.IImage|null); + + /** SessionInput blob */ + blob?: (google.cloud.ces.v1beta.IBlob|null); + + /** SessionInput variables */ + variables?: (google.protobuf.IStruct|null); + + /** SessionInput event */ + event?: (google.cloud.ces.v1beta.IEvent|null); + + /** SessionInput willContinue */ + willContinue?: (boolean|null); + } + + /** Represents a SessionInput. */ + class SessionInput implements ISessionInput { + + /** + * Constructs a new SessionInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ISessionInput); + + /** SessionInput text. */ + public text?: (string|null); + + /** SessionInput dtmf. */ + public dtmf?: (string|null); + + /** SessionInput audio. */ + public audio?: (Uint8Array|Buffer|string|null); + + /** SessionInput toolResponses. */ + public toolResponses?: (google.cloud.ces.v1beta.IToolResponses|null); + + /** SessionInput image. */ + public image?: (google.cloud.ces.v1beta.IImage|null); + + /** SessionInput blob. */ + public blob?: (google.cloud.ces.v1beta.IBlob|null); + + /** SessionInput variables. */ + public variables?: (google.protobuf.IStruct|null); + + /** SessionInput event. */ + public event?: (google.cloud.ces.v1beta.IEvent|null); + + /** SessionInput willContinue. */ + public willContinue: boolean; + + /** SessionInput inputType. */ + public inputType?: ("text"|"dtmf"|"audio"|"toolResponses"|"image"|"blob"|"variables"|"event"); + + /** + * Creates a new SessionInput instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionInput instance + */ + public static create(properties?: google.cloud.ces.v1beta.ISessionInput): google.cloud.ces.v1beta.SessionInput; + + /** + * Encodes the specified SessionInput message. Does not implicitly {@link google.cloud.ces.v1beta.SessionInput.verify|verify} messages. + * @param message SessionInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ISessionInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionInput message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionInput.verify|verify} messages. + * @param message SessionInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ISessionInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SessionInput; + + /** + * Decodes a SessionInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SessionInput; + + /** + * Verifies a SessionInput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SessionInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SessionInput; + + /** + * Creates a plain object from a SessionInput message. Also converts values to other types if specified. + * @param message SessionInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.SessionInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SessionOutput. */ + interface ISessionOutput { + + /** SessionOutput text */ + text?: (string|null); + + /** SessionOutput audio */ + audio?: (Uint8Array|Buffer|string|null); + + /** SessionOutput toolCalls */ + toolCalls?: (google.cloud.ces.v1beta.IToolCalls|null); + + /** SessionOutput citations */ + citations?: (google.cloud.ces.v1beta.ICitations|null); + + /** SessionOutput googleSearchSuggestions */ + googleSearchSuggestions?: (google.cloud.ces.v1beta.IGoogleSearchSuggestions|null); + + /** SessionOutput endSession */ + endSession?: (google.cloud.ces.v1beta.IEndSession|null); + + /** SessionOutput payload */ + payload?: (google.protobuf.IStruct|null); + + /** SessionOutput turnIndex */ + turnIndex?: (number|null); + + /** SessionOutput turnCompleted */ + turnCompleted?: (boolean|null); + + /** SessionOutput diagnosticInfo */ + diagnosticInfo?: (google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo|null); + } + + /** Represents a SessionOutput. */ + class SessionOutput implements ISessionOutput { + + /** + * Constructs a new SessionOutput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ISessionOutput); + + /** SessionOutput text. */ + public text?: (string|null); + + /** SessionOutput audio. */ + public audio?: (Uint8Array|Buffer|string|null); + + /** SessionOutput toolCalls. */ + public toolCalls?: (google.cloud.ces.v1beta.IToolCalls|null); + + /** SessionOutput citations. */ + public citations?: (google.cloud.ces.v1beta.ICitations|null); + + /** SessionOutput googleSearchSuggestions. */ + public googleSearchSuggestions?: (google.cloud.ces.v1beta.IGoogleSearchSuggestions|null); + + /** SessionOutput endSession. */ + public endSession?: (google.cloud.ces.v1beta.IEndSession|null); + + /** SessionOutput payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** SessionOutput turnIndex. */ + public turnIndex: number; + + /** SessionOutput turnCompleted. */ + public turnCompleted: boolean; + + /** SessionOutput diagnosticInfo. */ + public diagnosticInfo?: (google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo|null); + + /** SessionOutput outputType. */ + public outputType?: ("text"|"audio"|"toolCalls"|"citations"|"googleSearchSuggestions"|"endSession"|"payload"); + + /** + * Creates a new SessionOutput instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionOutput instance + */ + public static create(properties?: google.cloud.ces.v1beta.ISessionOutput): google.cloud.ces.v1beta.SessionOutput; + + /** + * Encodes the specified SessionOutput message. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.verify|verify} messages. + * @param message SessionOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ISessionOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionOutput message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.verify|verify} messages. + * @param message SessionOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ISessionOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionOutput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SessionOutput; + + /** + * Decodes a SessionOutput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SessionOutput; + + /** + * Verifies a SessionOutput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SessionOutput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionOutput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SessionOutput; + + /** + * Creates a plain object from a SessionOutput message. Also converts values to other types if specified. + * @param message SessionOutput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.SessionOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionOutput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionOutput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SessionOutput { + + /** Properties of a DiagnosticInfo. */ + interface IDiagnosticInfo { + + /** DiagnosticInfo messages */ + messages?: (google.cloud.ces.v1beta.IMessage[]|null); + + /** DiagnosticInfo rootSpan */ + rootSpan?: (google.cloud.ces.v1beta.ISpan|null); + } + + /** Represents a DiagnosticInfo. */ + class DiagnosticInfo implements IDiagnosticInfo { + + /** + * Constructs a new DiagnosticInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo); + + /** DiagnosticInfo messages. */ + public messages: google.cloud.ces.v1beta.IMessage[]; + + /** DiagnosticInfo rootSpan. */ + public rootSpan?: (google.cloud.ces.v1beta.ISpan|null); + + /** + * Creates a new DiagnosticInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DiagnosticInfo instance + */ + public static create(properties?: google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo): google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo; + + /** + * Encodes the specified DiagnosticInfo message. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.verify|verify} messages. + * @param message DiagnosticInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiagnosticInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.verify|verify} messages. + * @param message DiagnosticInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiagnosticInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiagnosticInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo; + + /** + * Decodes a DiagnosticInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiagnosticInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo; + + /** + * Verifies a DiagnosticInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiagnosticInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiagnosticInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo; + + /** + * Creates a plain object from a DiagnosticInfo message. Also converts values to other types if specified. + * @param message DiagnosticInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiagnosticInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DiagnosticInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RecognitionResult. */ + interface IRecognitionResult { + + /** RecognitionResult transcript */ + transcript?: (string|null); + } + + /** Represents a RecognitionResult. */ + class RecognitionResult implements IRecognitionResult { + + /** + * Constructs a new RecognitionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRecognitionResult); + + /** RecognitionResult transcript. */ + public transcript: string; + + /** + * Creates a new RecognitionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognitionResult instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRecognitionResult): google.cloud.ces.v1beta.RecognitionResult; + + /** + * Encodes the specified RecognitionResult message. Does not implicitly {@link google.cloud.ces.v1beta.RecognitionResult.verify|verify} messages. + * @param message RecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognitionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RecognitionResult.verify|verify} messages. + * @param message RecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognitionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RecognitionResult; + + /** + * Decodes a RecognitionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RecognitionResult; + + /** + * Verifies a RecognitionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognitionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognitionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RecognitionResult; + + /** + * Creates a plain object from a RecognitionResult message. Also converts values to other types if specified. + * @param message RecognitionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognitionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognitionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InterruptionSignal. */ + interface IInterruptionSignal { + + /** InterruptionSignal bargeIn */ + bargeIn?: (boolean|null); + } + + /** Represents an InterruptionSignal. */ + class InterruptionSignal implements IInterruptionSignal { + + /** + * Constructs a new InterruptionSignal. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IInterruptionSignal); + + /** InterruptionSignal bargeIn. */ + public bargeIn: boolean; + + /** + * Creates a new InterruptionSignal instance using the specified properties. + * @param [properties] Properties to set + * @returns InterruptionSignal instance + */ + public static create(properties?: google.cloud.ces.v1beta.IInterruptionSignal): google.cloud.ces.v1beta.InterruptionSignal; + + /** + * Encodes the specified InterruptionSignal message. Does not implicitly {@link google.cloud.ces.v1beta.InterruptionSignal.verify|verify} messages. + * @param message InterruptionSignal message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IInterruptionSignal, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterruptionSignal message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.InterruptionSignal.verify|verify} messages. + * @param message InterruptionSignal message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IInterruptionSignal, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterruptionSignal message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterruptionSignal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.InterruptionSignal; + + /** + * Decodes an InterruptionSignal message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterruptionSignal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.InterruptionSignal; + + /** + * Verifies an InterruptionSignal message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterruptionSignal message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterruptionSignal + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.InterruptionSignal; + + /** + * Creates a plain object from an InterruptionSignal message. Also converts values to other types if specified. + * @param message InterruptionSignal + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.InterruptionSignal, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterruptionSignal to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InterruptionSignal + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EndSession. */ + interface IEndSession { + + /** EndSession metadata */ + metadata?: (google.protobuf.IStruct|null); + } + + /** Represents an EndSession. */ + class EndSession implements IEndSession { + + /** + * Constructs a new EndSession. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IEndSession); + + /** EndSession metadata. */ + public metadata?: (google.protobuf.IStruct|null); + + /** + * Creates a new EndSession instance using the specified properties. + * @param [properties] Properties to set + * @returns EndSession instance + */ + public static create(properties?: google.cloud.ces.v1beta.IEndSession): google.cloud.ces.v1beta.EndSession; + + /** + * Encodes the specified EndSession message. Does not implicitly {@link google.cloud.ces.v1beta.EndSession.verify|verify} messages. + * @param message EndSession message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IEndSession, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndSession message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndSession.verify|verify} messages. + * @param message EndSession message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IEndSession, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndSession message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndSession + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.EndSession; + + /** + * Decodes an EndSession message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndSession + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.EndSession; + + /** + * Verifies an EndSession message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EndSession message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndSession + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.EndSession; + + /** + * Creates a plain object from an EndSession message. Also converts values to other types if specified. + * @param message EndSession + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.EndSession, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndSession to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndSession + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoAway. */ + interface IGoAway { + } + + /** Represents a GoAway. */ + class GoAway implements IGoAway { + + /** + * Constructs a new GoAway. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGoAway); + + /** + * Creates a new GoAway instance using the specified properties. + * @param [properties] Properties to set + * @returns GoAway instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGoAway): google.cloud.ces.v1beta.GoAway; + + /** + * Encodes the specified GoAway message. Does not implicitly {@link google.cloud.ces.v1beta.GoAway.verify|verify} messages. + * @param message GoAway message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGoAway, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoAway message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoAway.verify|verify} messages. + * @param message GoAway message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGoAway, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoAway message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoAway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GoAway; + + /** + * Decodes a GoAway message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoAway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GoAway; + + /** + * Verifies a GoAway message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoAway message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoAway + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GoAway; + + /** + * Creates a plain object from a GoAway message. Also converts values to other types if specified. + * @param message GoAway + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GoAway, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoAway to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoAway + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunSessionRequest. */ + interface IRunSessionRequest { + + /** RunSessionRequest config */ + config?: (google.cloud.ces.v1beta.ISessionConfig|null); + + /** RunSessionRequest inputs */ + inputs?: (google.cloud.ces.v1beta.ISessionInput[]|null); + } + + /** Represents a RunSessionRequest. */ + class RunSessionRequest implements IRunSessionRequest { + + /** + * Constructs a new RunSessionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRunSessionRequest); + + /** RunSessionRequest config. */ + public config?: (google.cloud.ces.v1beta.ISessionConfig|null); + + /** RunSessionRequest inputs. */ + public inputs: google.cloud.ces.v1beta.ISessionInput[]; + + /** + * Creates a new RunSessionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunSessionRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRunSessionRequest): google.cloud.ces.v1beta.RunSessionRequest; + + /** + * Encodes the specified RunSessionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionRequest.verify|verify} messages. + * @param message RunSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRunSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunSessionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionRequest.verify|verify} messages. + * @param message RunSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRunSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunSessionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RunSessionRequest; + + /** + * Decodes a RunSessionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RunSessionRequest; + + /** + * Verifies a RunSessionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunSessionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunSessionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RunSessionRequest; + + /** + * Creates a plain object from a RunSessionRequest message. Also converts values to other types if specified. + * @param message RunSessionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RunSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunSessionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunSessionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunSessionResponse. */ + interface IRunSessionResponse { + + /** RunSessionResponse outputs */ + outputs?: (google.cloud.ces.v1beta.ISessionOutput[]|null); + } + + /** Represents a RunSessionResponse. */ + class RunSessionResponse implements IRunSessionResponse { + + /** + * Constructs a new RunSessionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRunSessionResponse); + + /** RunSessionResponse outputs. */ + public outputs: google.cloud.ces.v1beta.ISessionOutput[]; + + /** + * Creates a new RunSessionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunSessionResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRunSessionResponse): google.cloud.ces.v1beta.RunSessionResponse; + + /** + * Encodes the specified RunSessionResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionResponse.verify|verify} messages. + * @param message RunSessionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRunSessionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunSessionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionResponse.verify|verify} messages. + * @param message RunSessionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRunSessionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunSessionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunSessionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RunSessionResponse; + + /** + * Decodes a RunSessionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunSessionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RunSessionResponse; + + /** + * Verifies a RunSessionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunSessionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunSessionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RunSessionResponse; + + /** + * Creates a plain object from a RunSessionResponse message. Also converts values to other types if specified. + * @param message RunSessionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RunSessionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunSessionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunSessionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiSessionClientMessage. */ + interface IBidiSessionClientMessage { + + /** BidiSessionClientMessage config */ + config?: (google.cloud.ces.v1beta.ISessionConfig|null); + + /** BidiSessionClientMessage realtimeInput */ + realtimeInput?: (google.cloud.ces.v1beta.ISessionInput|null); + } + + /** Represents a BidiSessionClientMessage. */ + class BidiSessionClientMessage implements IBidiSessionClientMessage { + + /** + * Constructs a new BidiSessionClientMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IBidiSessionClientMessage); + + /** BidiSessionClientMessage config. */ + public config?: (google.cloud.ces.v1beta.ISessionConfig|null); + + /** BidiSessionClientMessage realtimeInput. */ + public realtimeInput?: (google.cloud.ces.v1beta.ISessionInput|null); + + /** BidiSessionClientMessage messageType. */ + public messageType?: ("config"|"realtimeInput"); + + /** + * Creates a new BidiSessionClientMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiSessionClientMessage instance + */ + public static create(properties?: google.cloud.ces.v1beta.IBidiSessionClientMessage): google.cloud.ces.v1beta.BidiSessionClientMessage; + + /** + * Encodes the specified BidiSessionClientMessage message. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionClientMessage.verify|verify} messages. + * @param message BidiSessionClientMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IBidiSessionClientMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiSessionClientMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionClientMessage.verify|verify} messages. + * @param message BidiSessionClientMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IBidiSessionClientMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiSessionClientMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiSessionClientMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BidiSessionClientMessage; + + /** + * Decodes a BidiSessionClientMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiSessionClientMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BidiSessionClientMessage; + + /** + * Verifies a BidiSessionClientMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiSessionClientMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiSessionClientMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BidiSessionClientMessage; + + /** + * Creates a plain object from a BidiSessionClientMessage message. Also converts values to other types if specified. + * @param message BidiSessionClientMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.BidiSessionClientMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiSessionClientMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiSessionClientMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiSessionServerMessage. */ + interface IBidiSessionServerMessage { + + /** BidiSessionServerMessage sessionOutput */ + sessionOutput?: (google.cloud.ces.v1beta.ISessionOutput|null); + + /** BidiSessionServerMessage recognitionResult */ + recognitionResult?: (google.cloud.ces.v1beta.IRecognitionResult|null); + + /** BidiSessionServerMessage interruptionSignal */ + interruptionSignal?: (google.cloud.ces.v1beta.IInterruptionSignal|null); + + /** BidiSessionServerMessage endSession */ + endSession?: (google.cloud.ces.v1beta.IEndSession|null); + + /** BidiSessionServerMessage goAway */ + goAway?: (google.cloud.ces.v1beta.IGoAway|null); + } + + /** Represents a BidiSessionServerMessage. */ + class BidiSessionServerMessage implements IBidiSessionServerMessage { + + /** + * Constructs a new BidiSessionServerMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IBidiSessionServerMessage); + + /** BidiSessionServerMessage sessionOutput. */ + public sessionOutput?: (google.cloud.ces.v1beta.ISessionOutput|null); + + /** BidiSessionServerMessage recognitionResult. */ + public recognitionResult?: (google.cloud.ces.v1beta.IRecognitionResult|null); + + /** BidiSessionServerMessage interruptionSignal. */ + public interruptionSignal?: (google.cloud.ces.v1beta.IInterruptionSignal|null); + + /** BidiSessionServerMessage endSession. */ + public endSession?: (google.cloud.ces.v1beta.IEndSession|null); + + /** BidiSessionServerMessage goAway. */ + public goAway?: (google.cloud.ces.v1beta.IGoAway|null); + + /** BidiSessionServerMessage messageType. */ + public messageType?: ("sessionOutput"|"recognitionResult"|"interruptionSignal"|"endSession"|"goAway"); + + /** + * Creates a new BidiSessionServerMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiSessionServerMessage instance + */ + public static create(properties?: google.cloud.ces.v1beta.IBidiSessionServerMessage): google.cloud.ces.v1beta.BidiSessionServerMessage; + + /** + * Encodes the specified BidiSessionServerMessage message. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionServerMessage.verify|verify} messages. + * @param message BidiSessionServerMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IBidiSessionServerMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiSessionServerMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionServerMessage.verify|verify} messages. + * @param message BidiSessionServerMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IBidiSessionServerMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiSessionServerMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiSessionServerMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.BidiSessionServerMessage; + + /** + * Decodes a BidiSessionServerMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiSessionServerMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.BidiSessionServerMessage; + + /** + * Verifies a BidiSessionServerMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiSessionServerMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiSessionServerMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.BidiSessionServerMessage; + + /** + * Creates a plain object from a BidiSessionServerMessage message. Also converts values to other types if specified. + * @param message BidiSessionServerMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.BidiSessionServerMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiSessionServerMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiSessionServerMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoogleSearchSuggestions. */ + interface IGoogleSearchSuggestions { + + /** GoogleSearchSuggestions htmls */ + htmls?: (string[]|null); + + /** GoogleSearchSuggestions webSearchQueries */ + webSearchQueries?: (google.cloud.ces.v1beta.IWebSearchQuery[]|null); + } + + /** Represents a GoogleSearchSuggestions. */ + class GoogleSearchSuggestions implements IGoogleSearchSuggestions { + + /** + * Constructs a new GoogleSearchSuggestions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGoogleSearchSuggestions); + + /** GoogleSearchSuggestions htmls. */ + public htmls: string[]; + + /** GoogleSearchSuggestions webSearchQueries. */ + public webSearchQueries: google.cloud.ces.v1beta.IWebSearchQuery[]; + + /** + * Creates a new GoogleSearchSuggestions instance using the specified properties. + * @param [properties] Properties to set + * @returns GoogleSearchSuggestions instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGoogleSearchSuggestions): google.cloud.ces.v1beta.GoogleSearchSuggestions; + + /** + * Encodes the specified GoogleSearchSuggestions message. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchSuggestions.verify|verify} messages. + * @param message GoogleSearchSuggestions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGoogleSearchSuggestions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoogleSearchSuggestions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchSuggestions.verify|verify} messages. + * @param message GoogleSearchSuggestions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGoogleSearchSuggestions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoogleSearchSuggestions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoogleSearchSuggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GoogleSearchSuggestions; + + /** + * Decodes a GoogleSearchSuggestions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoogleSearchSuggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GoogleSearchSuggestions; + + /** + * Verifies a GoogleSearchSuggestions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoogleSearchSuggestions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoogleSearchSuggestions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GoogleSearchSuggestions; + + /** + * Creates a plain object from a GoogleSearchSuggestions message. Also converts values to other types if specified. + * @param message GoogleSearchSuggestions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GoogleSearchSuggestions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoogleSearchSuggestions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoogleSearchSuggestions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WebSearchQuery. */ + interface IWebSearchQuery { + + /** WebSearchQuery query */ + query?: (string|null); + + /** WebSearchQuery uri */ + uri?: (string|null); + } + + /** Represents a WebSearchQuery. */ + class WebSearchQuery implements IWebSearchQuery { + + /** + * Constructs a new WebSearchQuery. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IWebSearchQuery); + + /** WebSearchQuery query. */ + public query: string; + + /** WebSearchQuery uri. */ + public uri: string; + + /** + * Creates a new WebSearchQuery instance using the specified properties. + * @param [properties] Properties to set + * @returns WebSearchQuery instance + */ + public static create(properties?: google.cloud.ces.v1beta.IWebSearchQuery): google.cloud.ces.v1beta.WebSearchQuery; + + /** + * Encodes the specified WebSearchQuery message. Does not implicitly {@link google.cloud.ces.v1beta.WebSearchQuery.verify|verify} messages. + * @param message WebSearchQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IWebSearchQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebSearchQuery message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.WebSearchQuery.verify|verify} messages. + * @param message WebSearchQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IWebSearchQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebSearchQuery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebSearchQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.WebSearchQuery; + + /** + * Decodes a WebSearchQuery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebSearchQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.WebSearchQuery; + + /** + * Verifies a WebSearchQuery message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebSearchQuery message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebSearchQuery + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.WebSearchQuery; + + /** + * Creates a plain object from a WebSearchQuery message. Also converts values to other types if specified. + * @param message WebSearchQuery + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.WebSearchQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebSearchQuery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebSearchQuery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an EvaluationService */ + class EvaluationService extends $protobuf.rpc.Service { + + /** + * Constructs a new EvaluationService 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 EvaluationService 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): EvaluationService; + + /** + * Calls RunEvaluation. + * @param request RunEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runEvaluation(request: google.cloud.ces.v1beta.IRunEvaluationRequest, callback: google.cloud.ces.v1beta.EvaluationService.RunEvaluationCallback): void; + + /** + * Calls RunEvaluation. + * @param request RunEvaluationRequest message or plain object + * @returns Promise + */ + public runEvaluation(request: google.cloud.ces.v1beta.IRunEvaluationRequest): Promise; + + /** + * Calls UploadEvaluationAudio. + * @param request UploadEvaluationAudioRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UploadEvaluationAudioResponse + */ + public uploadEvaluationAudio(request: google.cloud.ces.v1beta.IUploadEvaluationAudioRequest, callback: google.cloud.ces.v1beta.EvaluationService.UploadEvaluationAudioCallback): void; + + /** + * Calls UploadEvaluationAudio. + * @param request UploadEvaluationAudioRequest message or plain object + * @returns Promise + */ + public uploadEvaluationAudio(request: google.cloud.ces.v1beta.IUploadEvaluationAudioRequest): Promise; + + /** + * Calls CreateEvaluation. + * @param request CreateEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Evaluation + */ + public createEvaluation(request: google.cloud.ces.v1beta.ICreateEvaluationRequest, callback: google.cloud.ces.v1beta.EvaluationService.CreateEvaluationCallback): void; + + /** + * Calls CreateEvaluation. + * @param request CreateEvaluationRequest message or plain object + * @returns Promise + */ + public createEvaluation(request: google.cloud.ces.v1beta.ICreateEvaluationRequest): Promise; + + /** + * Calls GenerateEvaluation. + * @param request GenerateEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public generateEvaluation(request: google.cloud.ces.v1beta.IGenerateEvaluationRequest, callback: google.cloud.ces.v1beta.EvaluationService.GenerateEvaluationCallback): void; + + /** + * Calls GenerateEvaluation. + * @param request GenerateEvaluationRequest message or plain object + * @returns Promise + */ + public generateEvaluation(request: google.cloud.ces.v1beta.IGenerateEvaluationRequest): Promise; + + /** + * Calls ImportEvaluations. + * @param request ImportEvaluationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importEvaluations(request: google.cloud.ces.v1beta.IImportEvaluationsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ImportEvaluationsCallback): void; + + /** + * Calls ImportEvaluations. + * @param request ImportEvaluationsRequest message or plain object + * @returns Promise + */ + public importEvaluations(request: google.cloud.ces.v1beta.IImportEvaluationsRequest): Promise; + + /** + * Calls CreateEvaluationDataset. + * @param request CreateEvaluationDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationDataset + */ + public createEvaluationDataset(request: google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest, callback: google.cloud.ces.v1beta.EvaluationService.CreateEvaluationDatasetCallback): void; + + /** + * Calls CreateEvaluationDataset. + * @param request CreateEvaluationDatasetRequest message or plain object + * @returns Promise + */ + public createEvaluationDataset(request: google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest): Promise; + + /** + * Calls UpdateEvaluation. + * @param request UpdateEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Evaluation + */ + public updateEvaluation(request: google.cloud.ces.v1beta.IUpdateEvaluationRequest, callback: google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationCallback): void; + + /** + * Calls UpdateEvaluation. + * @param request UpdateEvaluationRequest message or plain object + * @returns Promise + */ + public updateEvaluation(request: google.cloud.ces.v1beta.IUpdateEvaluationRequest): Promise; + + /** + * Calls UpdateEvaluationDataset. + * @param request UpdateEvaluationDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationDataset + */ + public updateEvaluationDataset(request: google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest, callback: google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationDatasetCallback): void; + + /** + * Calls UpdateEvaluationDataset. + * @param request UpdateEvaluationDatasetRequest message or plain object + * @returns Promise + */ + public updateEvaluationDataset(request: google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest): Promise; + + /** + * Calls DeleteEvaluation. + * @param request DeleteEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteEvaluation(request: google.cloud.ces.v1beta.IDeleteEvaluationRequest, callback: google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationCallback): void; + + /** + * Calls DeleteEvaluation. + * @param request DeleteEvaluationRequest message or plain object + * @returns Promise + */ + public deleteEvaluation(request: google.cloud.ces.v1beta.IDeleteEvaluationRequest): Promise; + + /** + * Calls DeleteEvaluationResult. + * @param request DeleteEvaluationResultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteEvaluationResult(request: google.cloud.ces.v1beta.IDeleteEvaluationResultRequest, callback: google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationResultCallback): void; + + /** + * Calls DeleteEvaluationResult. + * @param request DeleteEvaluationResultRequest message or plain object + * @returns Promise + */ + public deleteEvaluationResult(request: google.cloud.ces.v1beta.IDeleteEvaluationResultRequest): Promise; + + /** + * Calls DeleteEvaluationDataset. + * @param request DeleteEvaluationDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteEvaluationDataset(request: google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest, callback: google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationDatasetCallback): void; + + /** + * Calls DeleteEvaluationDataset. + * @param request DeleteEvaluationDatasetRequest message or plain object + * @returns Promise + */ + public deleteEvaluationDataset(request: google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest): Promise; + + /** + * Calls DeleteEvaluationRun. + * @param request DeleteEvaluationRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteEvaluationRun(request: google.cloud.ces.v1beta.IDeleteEvaluationRunRequest, callback: google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationRunCallback): void; + + /** + * Calls DeleteEvaluationRun. + * @param request DeleteEvaluationRunRequest message or plain object + * @returns Promise + */ + public deleteEvaluationRun(request: google.cloud.ces.v1beta.IDeleteEvaluationRunRequest): Promise; + + /** + * Calls GetEvaluation. + * @param request GetEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Evaluation + */ + public getEvaluation(request: google.cloud.ces.v1beta.IGetEvaluationRequest, callback: google.cloud.ces.v1beta.EvaluationService.GetEvaluationCallback): void; + + /** + * Calls GetEvaluation. + * @param request GetEvaluationRequest message or plain object + * @returns Promise + */ + public getEvaluation(request: google.cloud.ces.v1beta.IGetEvaluationRequest): Promise; + + /** + * Calls GetEvaluationResult. + * @param request GetEvaluationResultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationResult + */ + public getEvaluationResult(request: google.cloud.ces.v1beta.IGetEvaluationResultRequest, callback: google.cloud.ces.v1beta.EvaluationService.GetEvaluationResultCallback): void; + + /** + * Calls GetEvaluationResult. + * @param request GetEvaluationResultRequest message or plain object + * @returns Promise + */ + public getEvaluationResult(request: google.cloud.ces.v1beta.IGetEvaluationResultRequest): Promise; + + /** + * Calls GetEvaluationDataset. + * @param request GetEvaluationDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationDataset + */ + public getEvaluationDataset(request: google.cloud.ces.v1beta.IGetEvaluationDatasetRequest, callback: google.cloud.ces.v1beta.EvaluationService.GetEvaluationDatasetCallback): void; + + /** + * Calls GetEvaluationDataset. + * @param request GetEvaluationDatasetRequest message or plain object + * @returns Promise + */ + public getEvaluationDataset(request: google.cloud.ces.v1beta.IGetEvaluationDatasetRequest): Promise; + + /** + * Calls GetEvaluationRun. + * @param request GetEvaluationRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationRun + */ + public getEvaluationRun(request: google.cloud.ces.v1beta.IGetEvaluationRunRequest, callback: google.cloud.ces.v1beta.EvaluationService.GetEvaluationRunCallback): void; + + /** + * Calls GetEvaluationRun. + * @param request GetEvaluationRunRequest message or plain object + * @returns Promise + */ + public getEvaluationRun(request: google.cloud.ces.v1beta.IGetEvaluationRunRequest): Promise; + + /** + * Calls ListEvaluations. + * @param request ListEvaluationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEvaluationsResponse + */ + public listEvaluations(request: google.cloud.ces.v1beta.IListEvaluationsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ListEvaluationsCallback): void; + + /** + * Calls ListEvaluations. + * @param request ListEvaluationsRequest message or plain object + * @returns Promise + */ + public listEvaluations(request: google.cloud.ces.v1beta.IListEvaluationsRequest): Promise; + + /** + * Calls ListEvaluationResults. + * @param request ListEvaluationResultsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEvaluationResultsResponse + */ + public listEvaluationResults(request: google.cloud.ces.v1beta.IListEvaluationResultsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ListEvaluationResultsCallback): void; + + /** + * Calls ListEvaluationResults. + * @param request ListEvaluationResultsRequest message or plain object + * @returns Promise + */ + public listEvaluationResults(request: google.cloud.ces.v1beta.IListEvaluationResultsRequest): Promise; + + /** + * Calls ListEvaluationDatasets. + * @param request ListEvaluationDatasetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEvaluationDatasetsResponse + */ + public listEvaluationDatasets(request: google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ListEvaluationDatasetsCallback): void; + + /** + * Calls ListEvaluationDatasets. + * @param request ListEvaluationDatasetsRequest message or plain object + * @returns Promise + */ + public listEvaluationDatasets(request: google.cloud.ces.v1beta.IListEvaluationDatasetsRequest): Promise; + + /** + * Calls ListEvaluationRuns. + * @param request ListEvaluationRunsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEvaluationRunsResponse + */ + public listEvaluationRuns(request: google.cloud.ces.v1beta.IListEvaluationRunsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ListEvaluationRunsCallback): void; + + /** + * Calls ListEvaluationRuns. + * @param request ListEvaluationRunsRequest message or plain object + * @returns Promise + */ + public listEvaluationRuns(request: google.cloud.ces.v1beta.IListEvaluationRunsRequest): Promise; + + /** + * Calls ListEvaluationExpectations. + * @param request ListEvaluationExpectationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEvaluationExpectationsResponse + */ + public listEvaluationExpectations(request: google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ListEvaluationExpectationsCallback): void; + + /** + * Calls ListEvaluationExpectations. + * @param request ListEvaluationExpectationsRequest message or plain object + * @returns Promise + */ + public listEvaluationExpectations(request: google.cloud.ces.v1beta.IListEvaluationExpectationsRequest): Promise; + + /** + * Calls GetEvaluationExpectation. + * @param request GetEvaluationExpectationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationExpectation + */ + public getEvaluationExpectation(request: google.cloud.ces.v1beta.IGetEvaluationExpectationRequest, callback: google.cloud.ces.v1beta.EvaluationService.GetEvaluationExpectationCallback): void; + + /** + * Calls GetEvaluationExpectation. + * @param request GetEvaluationExpectationRequest message or plain object + * @returns Promise + */ + public getEvaluationExpectation(request: google.cloud.ces.v1beta.IGetEvaluationExpectationRequest): Promise; + + /** + * Calls CreateEvaluationExpectation. + * @param request CreateEvaluationExpectationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationExpectation + */ + public createEvaluationExpectation(request: google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest, callback: google.cloud.ces.v1beta.EvaluationService.CreateEvaluationExpectationCallback): void; + + /** + * Calls CreateEvaluationExpectation. + * @param request CreateEvaluationExpectationRequest message or plain object + * @returns Promise + */ + public createEvaluationExpectation(request: google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest): Promise; + + /** + * Calls UpdateEvaluationExpectation. + * @param request UpdateEvaluationExpectationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EvaluationExpectation + */ + public updateEvaluationExpectation(request: google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest, callback: google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationExpectationCallback): void; + + /** + * Calls UpdateEvaluationExpectation. + * @param request UpdateEvaluationExpectationRequest message or plain object + * @returns Promise + */ + public updateEvaluationExpectation(request: google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest): Promise; + + /** + * Calls DeleteEvaluationExpectation. + * @param request DeleteEvaluationExpectationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteEvaluationExpectation(request: google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest, callback: google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationExpectationCallback): void; + + /** + * Calls DeleteEvaluationExpectation. + * @param request DeleteEvaluationExpectationRequest message or plain object + * @returns Promise + */ + public deleteEvaluationExpectation(request: google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest): Promise; + + /** + * Calls CreateScheduledEvaluationRun. + * @param request CreateScheduledEvaluationRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScheduledEvaluationRun + */ + public createScheduledEvaluationRun(request: google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest, callback: google.cloud.ces.v1beta.EvaluationService.CreateScheduledEvaluationRunCallback): void; + + /** + * Calls CreateScheduledEvaluationRun. + * @param request CreateScheduledEvaluationRunRequest message or plain object + * @returns Promise + */ + public createScheduledEvaluationRun(request: google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest): Promise; + + /** + * Calls GetScheduledEvaluationRun. + * @param request GetScheduledEvaluationRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScheduledEvaluationRun + */ + public getScheduledEvaluationRun(request: google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest, callback: google.cloud.ces.v1beta.EvaluationService.GetScheduledEvaluationRunCallback): void; + + /** + * Calls GetScheduledEvaluationRun. + * @param request GetScheduledEvaluationRunRequest message or plain object + * @returns Promise + */ + public getScheduledEvaluationRun(request: google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest): Promise; + + /** + * Calls ListScheduledEvaluationRuns. + * @param request ListScheduledEvaluationRunsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListScheduledEvaluationRunsResponse + */ + public listScheduledEvaluationRuns(request: google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, callback: google.cloud.ces.v1beta.EvaluationService.ListScheduledEvaluationRunsCallback): void; + + /** + * Calls ListScheduledEvaluationRuns. + * @param request ListScheduledEvaluationRunsRequest message or plain object + * @returns Promise + */ + public listScheduledEvaluationRuns(request: google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest): Promise; + + /** + * Calls UpdateScheduledEvaluationRun. + * @param request UpdateScheduledEvaluationRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScheduledEvaluationRun + */ + public updateScheduledEvaluationRun(request: google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest, callback: google.cloud.ces.v1beta.EvaluationService.UpdateScheduledEvaluationRunCallback): void; + + /** + * Calls UpdateScheduledEvaluationRun. + * @param request UpdateScheduledEvaluationRunRequest message or plain object + * @returns Promise + */ + public updateScheduledEvaluationRun(request: google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest): Promise; + + /** + * Calls DeleteScheduledEvaluationRun. + * @param request DeleteScheduledEvaluationRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteScheduledEvaluationRun(request: google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest, callback: google.cloud.ces.v1beta.EvaluationService.DeleteScheduledEvaluationRunCallback): void; + + /** + * Calls DeleteScheduledEvaluationRun. + * @param request DeleteScheduledEvaluationRunRequest message or plain object + * @returns Promise + */ + public deleteScheduledEvaluationRun(request: google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest): Promise; + + /** + * Calls TestPersonaVoice. + * @param request TestPersonaVoiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPersonaVoiceResponse + */ + public testPersonaVoice(request: google.cloud.ces.v1beta.ITestPersonaVoiceRequest, callback: google.cloud.ces.v1beta.EvaluationService.TestPersonaVoiceCallback): void; + + /** + * Calls TestPersonaVoice. + * @param request TestPersonaVoiceRequest message or plain object + * @returns Promise + */ + public testPersonaVoice(request: google.cloud.ces.v1beta.ITestPersonaVoiceRequest): Promise; + } + + namespace EvaluationService { + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|runEvaluation}. + * @param error Error, if any + * @param [response] Operation + */ + type RunEvaluationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|uploadEvaluationAudio}. + * @param error Error, if any + * @param [response] UploadEvaluationAudioResponse + */ + type UploadEvaluationAudioCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.UploadEvaluationAudioResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createEvaluation}. + * @param error Error, if any + * @param [response] Evaluation + */ + type CreateEvaluationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Evaluation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|generateEvaluation}. + * @param error Error, if any + * @param [response] Operation + */ + type GenerateEvaluationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|importEvaluations}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportEvaluationsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createEvaluationDataset}. + * @param error Error, if any + * @param [response] EvaluationDataset + */ + type CreateEvaluationDatasetCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationDataset) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateEvaluation}. + * @param error Error, if any + * @param [response] Evaluation + */ + type UpdateEvaluationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Evaluation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateEvaluationDataset}. + * @param error Error, if any + * @param [response] EvaluationDataset + */ + type UpdateEvaluationDatasetCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationDataset) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteEvaluationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationResult}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteEvaluationResultCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationDataset}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteEvaluationDatasetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationRun}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteEvaluationRunCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluation}. + * @param error Error, if any + * @param [response] Evaluation + */ + type GetEvaluationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.Evaluation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationResult}. + * @param error Error, if any + * @param [response] EvaluationResult + */ + type GetEvaluationResultCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationResult) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationDataset}. + * @param error Error, if any + * @param [response] EvaluationDataset + */ + type GetEvaluationDatasetCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationDataset) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationRun}. + * @param error Error, if any + * @param [response] EvaluationRun + */ + type GetEvaluationRunCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationRun) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluations}. + * @param error Error, if any + * @param [response] ListEvaluationsResponse + */ + type ListEvaluationsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListEvaluationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationResults}. + * @param error Error, if any + * @param [response] ListEvaluationResultsResponse + */ + type ListEvaluationResultsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListEvaluationResultsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationDatasets}. + * @param error Error, if any + * @param [response] ListEvaluationDatasetsResponse + */ + type ListEvaluationDatasetsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListEvaluationDatasetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationRuns}. + * @param error Error, if any + * @param [response] ListEvaluationRunsResponse + */ + type ListEvaluationRunsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListEvaluationRunsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationExpectations}. + * @param error Error, if any + * @param [response] ListEvaluationExpectationsResponse + */ + type ListEvaluationExpectationsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListEvaluationExpectationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationExpectation}. + * @param error Error, if any + * @param [response] EvaluationExpectation + */ + type GetEvaluationExpectationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationExpectation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createEvaluationExpectation}. + * @param error Error, if any + * @param [response] EvaluationExpectation + */ + type CreateEvaluationExpectationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationExpectation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateEvaluationExpectation}. + * @param error Error, if any + * @param [response] EvaluationExpectation + */ + type UpdateEvaluationExpectationCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.EvaluationExpectation) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationExpectation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteEvaluationExpectationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createScheduledEvaluationRun}. + * @param error Error, if any + * @param [response] ScheduledEvaluationRun + */ + type CreateScheduledEvaluationRunCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ScheduledEvaluationRun) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getScheduledEvaluationRun}. + * @param error Error, if any + * @param [response] ScheduledEvaluationRun + */ + type GetScheduledEvaluationRunCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ScheduledEvaluationRun) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listScheduledEvaluationRuns}. + * @param error Error, if any + * @param [response] ListScheduledEvaluationRunsResponse + */ + type ListScheduledEvaluationRunsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateScheduledEvaluationRun}. + * @param error Error, if any + * @param [response] ScheduledEvaluationRun + */ + type UpdateScheduledEvaluationRunCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ScheduledEvaluationRun) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteScheduledEvaluationRun}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteScheduledEvaluationRunCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|testPersonaVoice}. + * @param error Error, if any + * @param [response] TestPersonaVoiceResponse + */ + type TestPersonaVoiceCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.TestPersonaVoiceResponse) => void; + } + + /** Properties of a RunEvaluationResponse. */ + interface IRunEvaluationResponse { + + /** RunEvaluationResponse evaluationRun */ + evaluationRun?: (string|null); + } + + /** Represents a RunEvaluationResponse. */ + class RunEvaluationResponse implements IRunEvaluationResponse { + + /** + * Constructs a new RunEvaluationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRunEvaluationResponse); + + /** RunEvaluationResponse evaluationRun. */ + public evaluationRun: string; + + /** + * Creates a new RunEvaluationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunEvaluationResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRunEvaluationResponse): google.cloud.ces.v1beta.RunEvaluationResponse; + + /** + * Encodes the specified RunEvaluationResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationResponse.verify|verify} messages. + * @param message RunEvaluationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRunEvaluationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunEvaluationResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationResponse.verify|verify} messages. + * @param message RunEvaluationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRunEvaluationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunEvaluationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunEvaluationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RunEvaluationResponse; + + /** + * Decodes a RunEvaluationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunEvaluationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RunEvaluationResponse; + + /** + * Verifies a RunEvaluationResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunEvaluationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunEvaluationResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RunEvaluationResponse; + + /** + * Creates a plain object from a RunEvaluationResponse message. Also converts values to other types if specified. + * @param message RunEvaluationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RunEvaluationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunEvaluationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunEvaluationResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunEvaluationOperationMetadata. */ + interface IRunEvaluationOperationMetadata { + + /** RunEvaluationOperationMetadata evaluations */ + evaluations?: (string[]|null); + + /** RunEvaluationOperationMetadata evaluationRun */ + evaluationRun?: (string|null); + + /** RunEvaluationOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** RunEvaluationOperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** RunEvaluationOperationMetadata verb */ + verb?: (string|null); + + /** RunEvaluationOperationMetadata cancelRequested */ + cancelRequested?: (boolean|null); + } + + /** Represents a RunEvaluationOperationMetadata. */ + class RunEvaluationOperationMetadata implements IRunEvaluationOperationMetadata { + + /** + * Constructs a new RunEvaluationOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRunEvaluationOperationMetadata); + + /** RunEvaluationOperationMetadata evaluations. */ + public evaluations: string[]; + + /** RunEvaluationOperationMetadata evaluationRun. */ + public evaluationRun: string; + + /** RunEvaluationOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** RunEvaluationOperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** RunEvaluationOperationMetadata verb. */ + public verb: string; + + /** RunEvaluationOperationMetadata cancelRequested. */ + public cancelRequested: boolean; + + /** + * Creates a new RunEvaluationOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RunEvaluationOperationMetadata instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRunEvaluationOperationMetadata): google.cloud.ces.v1beta.RunEvaluationOperationMetadata; + + /** + * Encodes the specified RunEvaluationOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationOperationMetadata.verify|verify} messages. + * @param message RunEvaluationOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRunEvaluationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunEvaluationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationOperationMetadata.verify|verify} messages. + * @param message RunEvaluationOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRunEvaluationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunEvaluationOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunEvaluationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RunEvaluationOperationMetadata; + + /** + * Decodes a RunEvaluationOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunEvaluationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RunEvaluationOperationMetadata; + + /** + * Verifies a RunEvaluationOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunEvaluationOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunEvaluationOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RunEvaluationOperationMetadata; + + /** + * Creates a plain object from a RunEvaluationOperationMetadata message. Also converts values to other types if specified. + * @param message RunEvaluationOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RunEvaluationOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunEvaluationOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunEvaluationOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateEvaluationOperationMetadata. */ + interface IGenerateEvaluationOperationMetadata { + } + + /** Represents a GenerateEvaluationOperationMetadata. */ + class GenerateEvaluationOperationMetadata implements IGenerateEvaluationOperationMetadata { + + /** + * Constructs a new GenerateEvaluationOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata); + + /** + * Creates a new GenerateEvaluationOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateEvaluationOperationMetadata instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata): google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata; + + /** + * Encodes the specified GenerateEvaluationOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata.verify|verify} messages. + * @param message GenerateEvaluationOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateEvaluationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata.verify|verify} messages. + * @param message GenerateEvaluationOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateEvaluationOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateEvaluationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata; + + /** + * Decodes a GenerateEvaluationOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateEvaluationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata; + + /** + * Verifies a GenerateEvaluationOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateEvaluationOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateEvaluationOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata; + + /** + * Creates a plain object from a GenerateEvaluationOperationMetadata message. Also converts values to other types if specified. + * @param message GenerateEvaluationOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateEvaluationOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateEvaluationOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEvaluationRunOperationMetadata. */ + interface IDeleteEvaluationRunOperationMetadata { + } + + /** Represents a DeleteEvaluationRunOperationMetadata. */ + class DeleteEvaluationRunOperationMetadata implements IDeleteEvaluationRunOperationMetadata { + + /** + * Constructs a new DeleteEvaluationRunOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata); + + /** + * Creates a new DeleteEvaluationRunOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEvaluationRunOperationMetadata instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata): google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata; + + /** + * Encodes the specified DeleteEvaluationRunOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata.verify|verify} messages. + * @param message DeleteEvaluationRunOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEvaluationRunOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata.verify|verify} messages. + * @param message DeleteEvaluationRunOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEvaluationRunOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEvaluationRunOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata; + + /** + * Decodes a DeleteEvaluationRunOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEvaluationRunOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata; + + /** + * Verifies a DeleteEvaluationRunOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEvaluationRunOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEvaluationRunOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata; + + /** + * Creates a plain object from a DeleteEvaluationRunOperationMetadata message. Also converts values to other types if specified. + * @param message DeleteEvaluationRunOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEvaluationRunOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEvaluationRunOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateEvaluationRequest. */ + interface ICreateEvaluationRequest { + + /** CreateEvaluationRequest parent */ + parent?: (string|null); + + /** CreateEvaluationRequest evaluationId */ + evaluationId?: (string|null); + + /** CreateEvaluationRequest evaluation */ + evaluation?: (google.cloud.ces.v1beta.IEvaluation|null); + } + + /** Represents a CreateEvaluationRequest. */ + class CreateEvaluationRequest implements ICreateEvaluationRequest { + + /** + * Constructs a new CreateEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateEvaluationRequest); + + /** CreateEvaluationRequest parent. */ + public parent: string; + + /** CreateEvaluationRequest evaluationId. */ + public evaluationId: string; + + /** CreateEvaluationRequest evaluation. */ + public evaluation?: (google.cloud.ces.v1beta.IEvaluation|null); + + /** + * Creates a new CreateEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEvaluationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateEvaluationRequest): google.cloud.ces.v1beta.CreateEvaluationRequest; + + /** + * Encodes the specified CreateEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationRequest.verify|verify} messages. + * @param message CreateEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationRequest.verify|verify} messages. + * @param message CreateEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateEvaluationRequest; + + /** + * Decodes a CreateEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateEvaluationRequest; + + /** + * Verifies a CreateEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateEvaluationRequest; + + /** + * Creates a plain object from a CreateEvaluationRequest message. Also converts values to other types if specified. + * @param message CreateEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateEvaluationRequest. */ + interface IGenerateEvaluationRequest { + + /** GenerateEvaluationRequest conversation */ + conversation?: (string|null); + + /** GenerateEvaluationRequest source */ + source?: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source|null); + } + + /** Represents a GenerateEvaluationRequest. */ + class GenerateEvaluationRequest implements IGenerateEvaluationRequest { + + /** + * Constructs a new GenerateEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGenerateEvaluationRequest); + + /** GenerateEvaluationRequest conversation. */ + public conversation: string; + + /** GenerateEvaluationRequest source. */ + public source: (google.cloud.ces.v1beta.Conversation.Source|keyof typeof google.cloud.ces.v1beta.Conversation.Source); + + /** + * Creates a new GenerateEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateEvaluationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGenerateEvaluationRequest): google.cloud.ces.v1beta.GenerateEvaluationRequest; + + /** + * Encodes the specified GenerateEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationRequest.verify|verify} messages. + * @param message GenerateEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGenerateEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationRequest.verify|verify} messages. + * @param message GenerateEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGenerateEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateEvaluationRequest; + + /** + * Decodes a GenerateEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateEvaluationRequest; + + /** + * Verifies a GenerateEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateEvaluationRequest; + + /** + * Creates a plain object from a GenerateEvaluationRequest message. Also converts values to other types if specified. + * @param message GenerateEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportEvaluationsRequest. */ + interface IImportEvaluationsRequest { + + /** ImportEvaluationsRequest conversationList */ + conversationList?: (google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList|null); + + /** ImportEvaluationsRequest gcsUri */ + gcsUri?: (string|null); + + /** ImportEvaluationsRequest csvContent */ + csvContent?: (Uint8Array|Buffer|string|null); + + /** ImportEvaluationsRequest parent */ + parent?: (string|null); + + /** ImportEvaluationsRequest importOptions */ + importOptions?: (google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions|null); + } + + /** Represents an ImportEvaluationsRequest. */ + class ImportEvaluationsRequest implements IImportEvaluationsRequest { + + /** + * Constructs a new ImportEvaluationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IImportEvaluationsRequest); + + /** ImportEvaluationsRequest conversationList. */ + public conversationList?: (google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList|null); + + /** ImportEvaluationsRequest gcsUri. */ + public gcsUri?: (string|null); + + /** ImportEvaluationsRequest csvContent. */ + public csvContent?: (Uint8Array|Buffer|string|null); + + /** ImportEvaluationsRequest parent. */ + public parent: string; + + /** ImportEvaluationsRequest importOptions. */ + public importOptions?: (google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions|null); + + /** ImportEvaluationsRequest source. */ + public source?: ("conversationList"|"gcsUri"|"csvContent"); + + /** + * Creates a new ImportEvaluationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportEvaluationsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IImportEvaluationsRequest): google.cloud.ces.v1beta.ImportEvaluationsRequest; + + /** + * Encodes the specified ImportEvaluationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.verify|verify} messages. + * @param message ImportEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IImportEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.verify|verify} messages. + * @param message ImportEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IImportEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportEvaluationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportEvaluationsRequest; + + /** + * Decodes an ImportEvaluationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportEvaluationsRequest; + + /** + * Verifies an ImportEvaluationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportEvaluationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportEvaluationsRequest; + + /** + * Creates a plain object from an ImportEvaluationsRequest message. Also converts values to other types if specified. + * @param message ImportEvaluationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ImportEvaluationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportEvaluationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportEvaluationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportEvaluationsRequest { + + /** Properties of a ConversationList. */ + interface IConversationList { + + /** ConversationList conversations */ + conversations?: (string[]|null); + } + + /** Represents a ConversationList. */ + class ConversationList implements IConversationList { + + /** + * Constructs a new ConversationList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList); + + /** ConversationList conversations. */ + public conversations: string[]; + + /** + * Creates a new ConversationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversationList instance + */ + public static create(properties?: google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList): google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList; + + /** + * Encodes the specified ConversationList message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.verify|verify} messages. + * @param message ConversationList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConversationList message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.verify|verify} messages. + * @param message ConversationList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConversationList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList; + + /** + * Decodes a ConversationList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList; + + /** + * Verifies a ConversationList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConversationList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversationList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList; + + /** + * Creates a plain object from a ConversationList message. Also converts values to other types if specified. + * @param message ConversationList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConversationList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConversationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportOptions. */ + interface IImportOptions { + + /** ImportOptions conflictResolutionStrategy */ + conflictResolutionStrategy?: (google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy|keyof typeof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy|null); + } + + /** Represents an ImportOptions. */ + class ImportOptions implements IImportOptions { + + /** + * Constructs a new ImportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions); + + /** ImportOptions conflictResolutionStrategy. */ + public conflictResolutionStrategy: (google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy|keyof typeof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy); + + /** + * Creates a new ImportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportOptions instance + */ + public static create(properties?: google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions): google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions; + + /** + * Encodes the specified ImportOptions message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.verify|verify} messages. + * @param message ImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportOptions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.verify|verify} messages. + * @param message ImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions; + + /** + * Decodes an ImportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions; + + /** + * Verifies an ImportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions; + + /** + * Creates a plain object from an ImportOptions message. Also converts values to other types if specified. + * @param message ImportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportOptions { + + /** ConflictResolutionStrategy enum. */ + enum ConflictResolutionStrategy { + CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED = 0, + OVERWRITE = 1, + SKIP = 2, + DUPLICATE = 3 + } + } + } + + /** Properties of an ImportEvaluationsResponse. */ + interface IImportEvaluationsResponse { + + /** ImportEvaluationsResponse evaluations */ + evaluations?: (google.cloud.ces.v1beta.IEvaluation[]|null); + + /** ImportEvaluationsResponse errorMessages */ + errorMessages?: (string[]|null); + + /** ImportEvaluationsResponse importFailureCount */ + importFailureCount?: (number|null); + } + + /** Represents an ImportEvaluationsResponse. */ + class ImportEvaluationsResponse implements IImportEvaluationsResponse { + + /** + * Constructs a new ImportEvaluationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IImportEvaluationsResponse); + + /** ImportEvaluationsResponse evaluations. */ + public evaluations: google.cloud.ces.v1beta.IEvaluation[]; + + /** ImportEvaluationsResponse errorMessages. */ + public errorMessages: string[]; + + /** ImportEvaluationsResponse importFailureCount. */ + public importFailureCount: number; + + /** + * Creates a new ImportEvaluationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportEvaluationsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IImportEvaluationsResponse): google.cloud.ces.v1beta.ImportEvaluationsResponse; + + /** + * Encodes the specified ImportEvaluationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsResponse.verify|verify} messages. + * @param message ImportEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IImportEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsResponse.verify|verify} messages. + * @param message ImportEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IImportEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportEvaluationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportEvaluationsResponse; + + /** + * Decodes an ImportEvaluationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportEvaluationsResponse; + + /** + * Verifies an ImportEvaluationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportEvaluationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportEvaluationsResponse; + + /** + * Creates a plain object from an ImportEvaluationsResponse message. Also converts values to other types if specified. + * @param message ImportEvaluationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ImportEvaluationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportEvaluationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportEvaluationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportEvaluationsOperationMetadata. */ + interface IImportEvaluationsOperationMetadata { + + /** ImportEvaluationsOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ImportEvaluationsOperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** ImportEvaluationsOperationMetadata statusMessage */ + statusMessage?: (string|null); + } + + /** Represents an ImportEvaluationsOperationMetadata. */ + class ImportEvaluationsOperationMetadata implements IImportEvaluationsOperationMetadata { + + /** + * Constructs a new ImportEvaluationsOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata); + + /** ImportEvaluationsOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ImportEvaluationsOperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** ImportEvaluationsOperationMetadata statusMessage. */ + public statusMessage: string; + + /** + * Creates a new ImportEvaluationsOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportEvaluationsOperationMetadata instance + */ + public static create(properties?: google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata): google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata; + + /** + * Encodes the specified ImportEvaluationsOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata.verify|verify} messages. + * @param message ImportEvaluationsOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportEvaluationsOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata.verify|verify} messages. + * @param message ImportEvaluationsOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportEvaluationsOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportEvaluationsOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata; + + /** + * Decodes an ImportEvaluationsOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportEvaluationsOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata; + + /** + * Verifies an ImportEvaluationsOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportEvaluationsOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportEvaluationsOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata; + + /** + * Creates a plain object from an ImportEvaluationsOperationMetadata message. Also converts values to other types if specified. + * @param message ImportEvaluationsOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportEvaluationsOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportEvaluationsOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateEvaluationDatasetRequest. */ + interface ICreateEvaluationDatasetRequest { + + /** CreateEvaluationDatasetRequest parent */ + parent?: (string|null); + + /** CreateEvaluationDatasetRequest evaluationDatasetId */ + evaluationDatasetId?: (string|null); + + /** CreateEvaluationDatasetRequest evaluationDataset */ + evaluationDataset?: (google.cloud.ces.v1beta.IEvaluationDataset|null); + } + + /** Represents a CreateEvaluationDatasetRequest. */ + class CreateEvaluationDatasetRequest implements ICreateEvaluationDatasetRequest { + + /** + * Constructs a new CreateEvaluationDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest); + + /** CreateEvaluationDatasetRequest parent. */ + public parent: string; + + /** CreateEvaluationDatasetRequest evaluationDatasetId. */ + public evaluationDatasetId: string; + + /** CreateEvaluationDatasetRequest evaluationDataset. */ + public evaluationDataset?: (google.cloud.ces.v1beta.IEvaluationDataset|null); + + /** + * Creates a new CreateEvaluationDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEvaluationDatasetRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest): google.cloud.ces.v1beta.CreateEvaluationDatasetRequest; + + /** + * Encodes the specified CreateEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationDatasetRequest.verify|verify} messages. + * @param message CreateEvaluationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationDatasetRequest.verify|verify} messages. + * @param message CreateEvaluationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEvaluationDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateEvaluationDatasetRequest; + + /** + * Decodes a CreateEvaluationDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateEvaluationDatasetRequest; + + /** + * Verifies a CreateEvaluationDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEvaluationDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateEvaluationDatasetRequest; + + /** + * Creates a plain object from a CreateEvaluationDatasetRequest message. Also converts values to other types if specified. + * @param message CreateEvaluationDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateEvaluationDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEvaluationDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEvaluationDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEvaluationRequest. */ + interface IUpdateEvaluationRequest { + + /** UpdateEvaluationRequest evaluation */ + evaluation?: (google.cloud.ces.v1beta.IEvaluation|null); + + /** UpdateEvaluationRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateEvaluationRequest. */ + class UpdateEvaluationRequest implements IUpdateEvaluationRequest { + + /** + * Constructs a new UpdateEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateEvaluationRequest); + + /** UpdateEvaluationRequest evaluation. */ + public evaluation?: (google.cloud.ces.v1beta.IEvaluation|null); + + /** UpdateEvaluationRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEvaluationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateEvaluationRequest): google.cloud.ces.v1beta.UpdateEvaluationRequest; + + /** + * Encodes the specified UpdateEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationRequest.verify|verify} messages. + * @param message UpdateEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationRequest.verify|verify} messages. + * @param message UpdateEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateEvaluationRequest; + + /** + * Decodes an UpdateEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateEvaluationRequest; + + /** + * Verifies an UpdateEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateEvaluationRequest; + + /** + * Creates a plain object from an UpdateEvaluationRequest message. Also converts values to other types if specified. + * @param message UpdateEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEvaluationDatasetRequest. */ + interface IUpdateEvaluationDatasetRequest { + + /** UpdateEvaluationDatasetRequest evaluationDataset */ + evaluationDataset?: (google.cloud.ces.v1beta.IEvaluationDataset|null); + + /** UpdateEvaluationDatasetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateEvaluationDatasetRequest. */ + class UpdateEvaluationDatasetRequest implements IUpdateEvaluationDatasetRequest { + + /** + * Constructs a new UpdateEvaluationDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest); + + /** UpdateEvaluationDatasetRequest evaluationDataset. */ + public evaluationDataset?: (google.cloud.ces.v1beta.IEvaluationDataset|null); + + /** UpdateEvaluationDatasetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateEvaluationDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEvaluationDatasetRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest): google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest; + + /** + * Encodes the specified UpdateEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest.verify|verify} messages. + * @param message UpdateEvaluationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest.verify|verify} messages. + * @param message UpdateEvaluationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEvaluationDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest; + + /** + * Decodes an UpdateEvaluationDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest; + + /** + * Verifies an UpdateEvaluationDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEvaluationDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest; + + /** + * Creates a plain object from an UpdateEvaluationDatasetRequest message. Also converts values to other types if specified. + * @param message UpdateEvaluationDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEvaluationDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEvaluationDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEvaluationRequest. */ + interface IDeleteEvaluationRequest { + + /** DeleteEvaluationRequest name */ + name?: (string|null); + + /** DeleteEvaluationRequest force */ + force?: (boolean|null); + + /** DeleteEvaluationRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteEvaluationRequest. */ + class DeleteEvaluationRequest implements IDeleteEvaluationRequest { + + /** + * Constructs a new DeleteEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteEvaluationRequest); + + /** DeleteEvaluationRequest name. */ + public name: string; + + /** DeleteEvaluationRequest force. */ + public force: boolean; + + /** DeleteEvaluationRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEvaluationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteEvaluationRequest): google.cloud.ces.v1beta.DeleteEvaluationRequest; + + /** + * Encodes the specified DeleteEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRequest.verify|verify} messages. + * @param message DeleteEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRequest.verify|verify} messages. + * @param message DeleteEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteEvaluationRequest; + + /** + * Decodes a DeleteEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteEvaluationRequest; + + /** + * Verifies a DeleteEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteEvaluationRequest; + + /** + * Creates a plain object from a DeleteEvaluationRequest message. Also converts values to other types if specified. + * @param message DeleteEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEvaluationResultRequest. */ + interface IDeleteEvaluationResultRequest { + + /** DeleteEvaluationResultRequest name */ + name?: (string|null); + } + + /** Represents a DeleteEvaluationResultRequest. */ + class DeleteEvaluationResultRequest implements IDeleteEvaluationResultRequest { + + /** + * Constructs a new DeleteEvaluationResultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteEvaluationResultRequest); + + /** DeleteEvaluationResultRequest name. */ + public name: string; + + /** + * Creates a new DeleteEvaluationResultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEvaluationResultRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteEvaluationResultRequest): google.cloud.ces.v1beta.DeleteEvaluationResultRequest; + + /** + * Encodes the specified DeleteEvaluationResultRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationResultRequest.verify|verify} messages. + * @param message DeleteEvaluationResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteEvaluationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEvaluationResultRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationResultRequest.verify|verify} messages. + * @param message DeleteEvaluationResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteEvaluationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEvaluationResultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEvaluationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteEvaluationResultRequest; + + /** + * Decodes a DeleteEvaluationResultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEvaluationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteEvaluationResultRequest; + + /** + * Verifies a DeleteEvaluationResultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEvaluationResultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEvaluationResultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteEvaluationResultRequest; + + /** + * Creates a plain object from a DeleteEvaluationResultRequest message. Also converts values to other types if specified. + * @param message DeleteEvaluationResultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteEvaluationResultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEvaluationResultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEvaluationResultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEvaluationDatasetRequest. */ + interface IDeleteEvaluationDatasetRequest { + + /** DeleteEvaluationDatasetRequest name */ + name?: (string|null); + + /** DeleteEvaluationDatasetRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteEvaluationDatasetRequest. */ + class DeleteEvaluationDatasetRequest implements IDeleteEvaluationDatasetRequest { + + /** + * Constructs a new DeleteEvaluationDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest); + + /** DeleteEvaluationDatasetRequest name. */ + public name: string; + + /** DeleteEvaluationDatasetRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteEvaluationDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEvaluationDatasetRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest): google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest; + + /** + * Encodes the specified DeleteEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest.verify|verify} messages. + * @param message DeleteEvaluationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest.verify|verify} messages. + * @param message DeleteEvaluationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEvaluationDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest; + + /** + * Decodes a DeleteEvaluationDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest; + + /** + * Verifies a DeleteEvaluationDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEvaluationDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest; + + /** + * Creates a plain object from a DeleteEvaluationDatasetRequest message. Also converts values to other types if specified. + * @param message DeleteEvaluationDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEvaluationDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEvaluationDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEvaluationRunRequest. */ + interface IDeleteEvaluationRunRequest { + + /** DeleteEvaluationRunRequest name */ + name?: (string|null); + } + + /** Represents a DeleteEvaluationRunRequest. */ + class DeleteEvaluationRunRequest implements IDeleteEvaluationRunRequest { + + /** + * Constructs a new DeleteEvaluationRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteEvaluationRunRequest); + + /** DeleteEvaluationRunRequest name. */ + public name: string; + + /** + * Creates a new DeleteEvaluationRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEvaluationRunRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteEvaluationRunRequest): google.cloud.ces.v1beta.DeleteEvaluationRunRequest; + + /** + * Encodes the specified DeleteEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunRequest.verify|verify} messages. + * @param message DeleteEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunRequest.verify|verify} messages. + * @param message DeleteEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEvaluationRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteEvaluationRunRequest; + + /** + * Decodes a DeleteEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteEvaluationRunRequest; + + /** + * Verifies a DeleteEvaluationRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEvaluationRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteEvaluationRunRequest; + + /** + * Creates a plain object from a DeleteEvaluationRunRequest message. Also converts values to other types if specified. + * @param message DeleteEvaluationRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteEvaluationRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEvaluationRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEvaluationRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEvaluationRequest. */ + interface IGetEvaluationRequest { + + /** GetEvaluationRequest name */ + name?: (string|null); + } + + /** Represents a GetEvaluationRequest. */ + class GetEvaluationRequest implements IGetEvaluationRequest { + + /** + * Constructs a new GetEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetEvaluationRequest); + + /** GetEvaluationRequest name. */ + public name: string; + + /** + * Creates a new GetEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEvaluationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetEvaluationRequest): google.cloud.ces.v1beta.GetEvaluationRequest; + + /** + * Encodes the specified GetEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRequest.verify|verify} messages. + * @param message GetEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRequest.verify|verify} messages. + * @param message GetEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetEvaluationRequest; + + /** + * Decodes a GetEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetEvaluationRequest; + + /** + * Verifies a GetEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetEvaluationRequest; + + /** + * Creates a plain object from a GetEvaluationRequest message. Also converts values to other types if specified. + * @param message GetEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEvaluationResultRequest. */ + interface IGetEvaluationResultRequest { + + /** GetEvaluationResultRequest name */ + name?: (string|null); + } + + /** Represents a GetEvaluationResultRequest. */ + class GetEvaluationResultRequest implements IGetEvaluationResultRequest { + + /** + * Constructs a new GetEvaluationResultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetEvaluationResultRequest); + + /** GetEvaluationResultRequest name. */ + public name: string; + + /** + * Creates a new GetEvaluationResultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEvaluationResultRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetEvaluationResultRequest): google.cloud.ces.v1beta.GetEvaluationResultRequest; + + /** + * Encodes the specified GetEvaluationResultRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationResultRequest.verify|verify} messages. + * @param message GetEvaluationResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetEvaluationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEvaluationResultRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationResultRequest.verify|verify} messages. + * @param message GetEvaluationResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetEvaluationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEvaluationResultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEvaluationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetEvaluationResultRequest; + + /** + * Decodes a GetEvaluationResultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEvaluationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetEvaluationResultRequest; + + /** + * Verifies a GetEvaluationResultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEvaluationResultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEvaluationResultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetEvaluationResultRequest; + + /** + * Creates a plain object from a GetEvaluationResultRequest message. Also converts values to other types if specified. + * @param message GetEvaluationResultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetEvaluationResultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEvaluationResultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEvaluationResultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEvaluationDatasetRequest. */ + interface IGetEvaluationDatasetRequest { + + /** GetEvaluationDatasetRequest name */ + name?: (string|null); + } + + /** Represents a GetEvaluationDatasetRequest. */ + class GetEvaluationDatasetRequest implements IGetEvaluationDatasetRequest { + + /** + * Constructs a new GetEvaluationDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetEvaluationDatasetRequest); + + /** GetEvaluationDatasetRequest name. */ + public name: string; + + /** + * Creates a new GetEvaluationDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEvaluationDatasetRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetEvaluationDatasetRequest): google.cloud.ces.v1beta.GetEvaluationDatasetRequest; + + /** + * Encodes the specified GetEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationDatasetRequest.verify|verify} messages. + * @param message GetEvaluationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationDatasetRequest.verify|verify} messages. + * @param message GetEvaluationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetEvaluationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEvaluationDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetEvaluationDatasetRequest; + + /** + * Decodes a GetEvaluationDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetEvaluationDatasetRequest; + + /** + * Verifies a GetEvaluationDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEvaluationDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetEvaluationDatasetRequest; + + /** + * Creates a plain object from a GetEvaluationDatasetRequest message. Also converts values to other types if specified. + * @param message GetEvaluationDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetEvaluationDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEvaluationDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEvaluationDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEvaluationRunRequest. */ + interface IGetEvaluationRunRequest { + + /** GetEvaluationRunRequest name */ + name?: (string|null); + } + + /** Represents a GetEvaluationRunRequest. */ + class GetEvaluationRunRequest implements IGetEvaluationRunRequest { + + /** + * Constructs a new GetEvaluationRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetEvaluationRunRequest); + + /** GetEvaluationRunRequest name. */ + public name: string; + + /** + * Creates a new GetEvaluationRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEvaluationRunRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetEvaluationRunRequest): google.cloud.ces.v1beta.GetEvaluationRunRequest; + + /** + * Encodes the specified GetEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRunRequest.verify|verify} messages. + * @param message GetEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRunRequest.verify|verify} messages. + * @param message GetEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEvaluationRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetEvaluationRunRequest; + + /** + * Decodes a GetEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetEvaluationRunRequest; + + /** + * Verifies a GetEvaluationRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEvaluationRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetEvaluationRunRequest; + + /** + * Creates a plain object from a GetEvaluationRunRequest message. Also converts values to other types if specified. + * @param message GetEvaluationRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetEvaluationRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEvaluationRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEvaluationRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationsRequest. */ + interface IListEvaluationsRequest { + + /** ListEvaluationsRequest parent */ + parent?: (string|null); + + /** ListEvaluationsRequest pageSize */ + pageSize?: (number|null); + + /** ListEvaluationsRequest pageToken */ + pageToken?: (string|null); + + /** ListEvaluationsRequest filter */ + filter?: (string|null); + + /** ListEvaluationsRequest evaluationFilter */ + evaluationFilter?: (string|null); + + /** ListEvaluationsRequest evaluationRunFilter */ + evaluationRunFilter?: (string|null); + + /** ListEvaluationsRequest orderBy */ + orderBy?: (string|null); + + /** ListEvaluationsRequest lastTenResults */ + lastTenResults?: (boolean|null); + } + + /** Represents a ListEvaluationsRequest. */ + class ListEvaluationsRequest implements IListEvaluationsRequest { + + /** + * Constructs a new ListEvaluationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationsRequest); + + /** ListEvaluationsRequest parent. */ + public parent: string; + + /** ListEvaluationsRequest pageSize. */ + public pageSize: number; + + /** ListEvaluationsRequest pageToken. */ + public pageToken: string; + + /** ListEvaluationsRequest filter. */ + public filter: string; + + /** ListEvaluationsRequest evaluationFilter. */ + public evaluationFilter: string; + + /** ListEvaluationsRequest evaluationRunFilter. */ + public evaluationRunFilter: string; + + /** ListEvaluationsRequest orderBy. */ + public orderBy: string; + + /** ListEvaluationsRequest lastTenResults. */ + public lastTenResults: boolean; + + /** + * Creates a new ListEvaluationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationsRequest): google.cloud.ces.v1beta.ListEvaluationsRequest; + + /** + * Encodes the specified ListEvaluationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsRequest.verify|verify} messages. + * @param message ListEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsRequest.verify|verify} messages. + * @param message ListEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationsRequest; + + /** + * Decodes a ListEvaluationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationsRequest; + + /** + * Verifies a ListEvaluationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationsRequest; + + /** + * Creates a plain object from a ListEvaluationsRequest message. Also converts values to other types if specified. + * @param message ListEvaluationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationResultsRequest. */ + interface IListEvaluationResultsRequest { + + /** ListEvaluationResultsRequest parent */ + parent?: (string|null); + + /** ListEvaluationResultsRequest pageSize */ + pageSize?: (number|null); + + /** ListEvaluationResultsRequest pageToken */ + pageToken?: (string|null); + + /** ListEvaluationResultsRequest filter */ + filter?: (string|null); + + /** ListEvaluationResultsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListEvaluationResultsRequest. */ + class ListEvaluationResultsRequest implements IListEvaluationResultsRequest { + + /** + * Constructs a new ListEvaluationResultsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationResultsRequest); + + /** ListEvaluationResultsRequest parent. */ + public parent: string; + + /** ListEvaluationResultsRequest pageSize. */ + public pageSize: number; + + /** ListEvaluationResultsRequest pageToken. */ + public pageToken: string; + + /** ListEvaluationResultsRequest filter. */ + public filter: string; + + /** ListEvaluationResultsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListEvaluationResultsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationResultsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationResultsRequest): google.cloud.ces.v1beta.ListEvaluationResultsRequest; + + /** + * Encodes the specified ListEvaluationResultsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsRequest.verify|verify} messages. + * @param message ListEvaluationResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationResultsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsRequest.verify|verify} messages. + * @param message ListEvaluationResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationResultsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationResultsRequest; + + /** + * Decodes a ListEvaluationResultsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationResultsRequest; + + /** + * Verifies a ListEvaluationResultsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationResultsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationResultsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationResultsRequest; + + /** + * Creates a plain object from a ListEvaluationResultsRequest message. Also converts values to other types if specified. + * @param message ListEvaluationResultsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationResultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationResultsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationResultsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationDatasetsRequest. */ + interface IListEvaluationDatasetsRequest { + + /** ListEvaluationDatasetsRequest parent */ + parent?: (string|null); + + /** ListEvaluationDatasetsRequest pageSize */ + pageSize?: (number|null); + + /** ListEvaluationDatasetsRequest pageToken */ + pageToken?: (string|null); + + /** ListEvaluationDatasetsRequest filter */ + filter?: (string|null); + + /** ListEvaluationDatasetsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListEvaluationDatasetsRequest. */ + class ListEvaluationDatasetsRequest implements IListEvaluationDatasetsRequest { + + /** + * Constructs a new ListEvaluationDatasetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationDatasetsRequest); + + /** ListEvaluationDatasetsRequest parent. */ + public parent: string; + + /** ListEvaluationDatasetsRequest pageSize. */ + public pageSize: number; + + /** ListEvaluationDatasetsRequest pageToken. */ + public pageToken: string; + + /** ListEvaluationDatasetsRequest filter. */ + public filter: string; + + /** ListEvaluationDatasetsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListEvaluationDatasetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationDatasetsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationDatasetsRequest): google.cloud.ces.v1beta.ListEvaluationDatasetsRequest; + + /** + * Encodes the specified ListEvaluationDatasetsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsRequest.verify|verify} messages. + * @param message ListEvaluationDatasetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsRequest.verify|verify} messages. + * @param message ListEvaluationDatasetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationDatasetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationDatasetsRequest; + + /** + * Decodes a ListEvaluationDatasetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationDatasetsRequest; + + /** + * Verifies a ListEvaluationDatasetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationDatasetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationDatasetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationDatasetsRequest; + + /** + * Creates a plain object from a ListEvaluationDatasetsRequest message. Also converts values to other types if specified. + * @param message ListEvaluationDatasetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationDatasetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationDatasetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationDatasetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationRunsRequest. */ + interface IListEvaluationRunsRequest { + + /** ListEvaluationRunsRequest parent */ + parent?: (string|null); + + /** ListEvaluationRunsRequest pageSize */ + pageSize?: (number|null); + + /** ListEvaluationRunsRequest pageToken */ + pageToken?: (string|null); + + /** ListEvaluationRunsRequest filter */ + filter?: (string|null); + + /** ListEvaluationRunsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListEvaluationRunsRequest. */ + class ListEvaluationRunsRequest implements IListEvaluationRunsRequest { + + /** + * Constructs a new ListEvaluationRunsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationRunsRequest); + + /** ListEvaluationRunsRequest parent. */ + public parent: string; + + /** ListEvaluationRunsRequest pageSize. */ + public pageSize: number; + + /** ListEvaluationRunsRequest pageToken. */ + public pageToken: string; + + /** ListEvaluationRunsRequest filter. */ + public filter: string; + + /** ListEvaluationRunsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListEvaluationRunsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationRunsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationRunsRequest): google.cloud.ces.v1beta.ListEvaluationRunsRequest; + + /** + * Encodes the specified ListEvaluationRunsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsRequest.verify|verify} messages. + * @param message ListEvaluationRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationRunsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsRequest.verify|verify} messages. + * @param message ListEvaluationRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationRunsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationRunsRequest; + + /** + * Decodes a ListEvaluationRunsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationRunsRequest; + + /** + * Verifies a ListEvaluationRunsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationRunsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationRunsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationRunsRequest; + + /** + * Creates a plain object from a ListEvaluationRunsRequest message. Also converts values to other types if specified. + * @param message ListEvaluationRunsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationRunsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationRunsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationsResponse. */ + interface IListEvaluationsResponse { + + /** ListEvaluationsResponse evaluations */ + evaluations?: (google.cloud.ces.v1beta.IEvaluation[]|null); + + /** ListEvaluationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEvaluationsResponse. */ + class ListEvaluationsResponse implements IListEvaluationsResponse { + + /** + * Constructs a new ListEvaluationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationsResponse); + + /** ListEvaluationsResponse evaluations. */ + public evaluations: google.cloud.ces.v1beta.IEvaluation[]; + + /** ListEvaluationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEvaluationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationsResponse): google.cloud.ces.v1beta.ListEvaluationsResponse; + + /** + * Encodes the specified ListEvaluationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsResponse.verify|verify} messages. + * @param message ListEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsResponse.verify|verify} messages. + * @param message ListEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationsResponse; + + /** + * Decodes a ListEvaluationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationsResponse; + + /** + * Verifies a ListEvaluationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationsResponse; + + /** + * Creates a plain object from a ListEvaluationsResponse message. Also converts values to other types if specified. + * @param message ListEvaluationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationResultsResponse. */ + interface IListEvaluationResultsResponse { + + /** ListEvaluationResultsResponse evaluationResults */ + evaluationResults?: (google.cloud.ces.v1beta.IEvaluationResult[]|null); + + /** ListEvaluationResultsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEvaluationResultsResponse. */ + class ListEvaluationResultsResponse implements IListEvaluationResultsResponse { + + /** + * Constructs a new ListEvaluationResultsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationResultsResponse); + + /** ListEvaluationResultsResponse evaluationResults. */ + public evaluationResults: google.cloud.ces.v1beta.IEvaluationResult[]; + + /** ListEvaluationResultsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEvaluationResultsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationResultsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationResultsResponse): google.cloud.ces.v1beta.ListEvaluationResultsResponse; + + /** + * Encodes the specified ListEvaluationResultsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsResponse.verify|verify} messages. + * @param message ListEvaluationResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationResultsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsResponse.verify|verify} messages. + * @param message ListEvaluationResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationResultsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationResultsResponse; + + /** + * Decodes a ListEvaluationResultsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationResultsResponse; + + /** + * Verifies a ListEvaluationResultsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationResultsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationResultsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationResultsResponse; + + /** + * Creates a plain object from a ListEvaluationResultsResponse message. Also converts values to other types if specified. + * @param message ListEvaluationResultsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationResultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationResultsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationResultsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationDatasetsResponse. */ + interface IListEvaluationDatasetsResponse { + + /** ListEvaluationDatasetsResponse evaluationDatasets */ + evaluationDatasets?: (google.cloud.ces.v1beta.IEvaluationDataset[]|null); + + /** ListEvaluationDatasetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEvaluationDatasetsResponse. */ + class ListEvaluationDatasetsResponse implements IListEvaluationDatasetsResponse { + + /** + * Constructs a new ListEvaluationDatasetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationDatasetsResponse); + + /** ListEvaluationDatasetsResponse evaluationDatasets. */ + public evaluationDatasets: google.cloud.ces.v1beta.IEvaluationDataset[]; + + /** ListEvaluationDatasetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEvaluationDatasetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationDatasetsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationDatasetsResponse): google.cloud.ces.v1beta.ListEvaluationDatasetsResponse; + + /** + * Encodes the specified ListEvaluationDatasetsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.verify|verify} messages. + * @param message ListEvaluationDatasetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.verify|verify} messages. + * @param message ListEvaluationDatasetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationDatasetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationDatasetsResponse; + + /** + * Decodes a ListEvaluationDatasetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationDatasetsResponse; + + /** + * Verifies a ListEvaluationDatasetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationDatasetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationDatasetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationDatasetsResponse; + + /** + * Creates a plain object from a ListEvaluationDatasetsResponse message. Also converts values to other types if specified. + * @param message ListEvaluationDatasetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationDatasetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationDatasetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationDatasetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationRunsResponse. */ + interface IListEvaluationRunsResponse { + + /** ListEvaluationRunsResponse evaluationRuns */ + evaluationRuns?: (google.cloud.ces.v1beta.IEvaluationRun[]|null); + + /** ListEvaluationRunsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEvaluationRunsResponse. */ + class ListEvaluationRunsResponse implements IListEvaluationRunsResponse { + + /** + * Constructs a new ListEvaluationRunsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationRunsResponse); + + /** ListEvaluationRunsResponse evaluationRuns. */ + public evaluationRuns: google.cloud.ces.v1beta.IEvaluationRun[]; + + /** ListEvaluationRunsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEvaluationRunsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationRunsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationRunsResponse): google.cloud.ces.v1beta.ListEvaluationRunsResponse; + + /** + * Encodes the specified ListEvaluationRunsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsResponse.verify|verify} messages. + * @param message ListEvaluationRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationRunsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsResponse.verify|verify} messages. + * @param message ListEvaluationRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationRunsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationRunsResponse; + + /** + * Decodes a ListEvaluationRunsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationRunsResponse; + + /** + * Verifies a ListEvaluationRunsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationRunsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationRunsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationRunsResponse; + + /** + * Creates a plain object from a ListEvaluationRunsResponse message. Also converts values to other types if specified. + * @param message ListEvaluationRunsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationRunsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationRunsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateScheduledEvaluationRunRequest. */ + interface ICreateScheduledEvaluationRunRequest { + + /** CreateScheduledEvaluationRunRequest parent */ + parent?: (string|null); + + /** CreateScheduledEvaluationRunRequest scheduledEvaluationRunId */ + scheduledEvaluationRunId?: (string|null); + + /** CreateScheduledEvaluationRunRequest scheduledEvaluationRun */ + scheduledEvaluationRun?: (google.cloud.ces.v1beta.IScheduledEvaluationRun|null); + } + + /** Represents a CreateScheduledEvaluationRunRequest. */ + class CreateScheduledEvaluationRunRequest implements ICreateScheduledEvaluationRunRequest { + + /** + * Constructs a new CreateScheduledEvaluationRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest); + + /** CreateScheduledEvaluationRunRequest parent. */ + public parent: string; + + /** CreateScheduledEvaluationRunRequest scheduledEvaluationRunId. */ + public scheduledEvaluationRunId: string; + + /** CreateScheduledEvaluationRunRequest scheduledEvaluationRun. */ + public scheduledEvaluationRun?: (google.cloud.ces.v1beta.IScheduledEvaluationRun|null); + + /** + * Creates a new CreateScheduledEvaluationRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateScheduledEvaluationRunRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest): google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest; + + /** + * Encodes the specified CreateScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest.verify|verify} messages. + * @param message CreateScheduledEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest.verify|verify} messages. + * @param message CreateScheduledEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateScheduledEvaluationRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest; + + /** + * Decodes a CreateScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest; + + /** + * Verifies a CreateScheduledEvaluationRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateScheduledEvaluationRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest; + + /** + * Creates a plain object from a CreateScheduledEvaluationRunRequest message. Also converts values to other types if specified. + * @param message CreateScheduledEvaluationRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateScheduledEvaluationRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateScheduledEvaluationRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetScheduledEvaluationRunRequest. */ + interface IGetScheduledEvaluationRunRequest { + + /** GetScheduledEvaluationRunRequest name */ + name?: (string|null); + } + + /** Represents a GetScheduledEvaluationRunRequest. */ + class GetScheduledEvaluationRunRequest implements IGetScheduledEvaluationRunRequest { + + /** + * Constructs a new GetScheduledEvaluationRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest); + + /** GetScheduledEvaluationRunRequest name. */ + public name: string; + + /** + * Creates a new GetScheduledEvaluationRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetScheduledEvaluationRunRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest): google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest; + + /** + * Encodes the specified GetScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest.verify|verify} messages. + * @param message GetScheduledEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest.verify|verify} messages. + * @param message GetScheduledEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetScheduledEvaluationRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest; + + /** + * Decodes a GetScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest; + + /** + * Verifies a GetScheduledEvaluationRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetScheduledEvaluationRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest; + + /** + * Creates a plain object from a GetScheduledEvaluationRunRequest message. Also converts values to other types if specified. + * @param message GetScheduledEvaluationRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetScheduledEvaluationRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetScheduledEvaluationRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListScheduledEvaluationRunsRequest. */ + interface IListScheduledEvaluationRunsRequest { + + /** ListScheduledEvaluationRunsRequest parent */ + parent?: (string|null); + + /** ListScheduledEvaluationRunsRequest pageSize */ + pageSize?: (number|null); + + /** ListScheduledEvaluationRunsRequest pageToken */ + pageToken?: (string|null); + + /** ListScheduledEvaluationRunsRequest filter */ + filter?: (string|null); + + /** ListScheduledEvaluationRunsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListScheduledEvaluationRunsRequest. */ + class ListScheduledEvaluationRunsRequest implements IListScheduledEvaluationRunsRequest { + + /** + * Constructs a new ListScheduledEvaluationRunsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest); + + /** ListScheduledEvaluationRunsRequest parent. */ + public parent: string; + + /** ListScheduledEvaluationRunsRequest pageSize. */ + public pageSize: number; + + /** ListScheduledEvaluationRunsRequest pageToken. */ + public pageToken: string; + + /** ListScheduledEvaluationRunsRequest filter. */ + public filter: string; + + /** ListScheduledEvaluationRunsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListScheduledEvaluationRunsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListScheduledEvaluationRunsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest): google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest; + + /** + * Encodes the specified ListScheduledEvaluationRunsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest.verify|verify} messages. + * @param message ListScheduledEvaluationRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListScheduledEvaluationRunsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest.verify|verify} messages. + * @param message ListScheduledEvaluationRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListScheduledEvaluationRunsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListScheduledEvaluationRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest; + + /** + * Decodes a ListScheduledEvaluationRunsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListScheduledEvaluationRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest; + + /** + * Verifies a ListScheduledEvaluationRunsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListScheduledEvaluationRunsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListScheduledEvaluationRunsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest; + + /** + * Creates a plain object from a ListScheduledEvaluationRunsRequest message. Also converts values to other types if specified. + * @param message ListScheduledEvaluationRunsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListScheduledEvaluationRunsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListScheduledEvaluationRunsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListScheduledEvaluationRunsResponse. */ + interface IListScheduledEvaluationRunsResponse { + + /** ListScheduledEvaluationRunsResponse scheduledEvaluationRuns */ + scheduledEvaluationRuns?: (google.cloud.ces.v1beta.IScheduledEvaluationRun[]|null); + + /** ListScheduledEvaluationRunsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListScheduledEvaluationRunsResponse. */ + class ListScheduledEvaluationRunsResponse implements IListScheduledEvaluationRunsResponse { + + /** + * Constructs a new ListScheduledEvaluationRunsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse); + + /** ListScheduledEvaluationRunsResponse scheduledEvaluationRuns. */ + public scheduledEvaluationRuns: google.cloud.ces.v1beta.IScheduledEvaluationRun[]; + + /** ListScheduledEvaluationRunsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListScheduledEvaluationRunsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListScheduledEvaluationRunsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse): google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse; + + /** + * Encodes the specified ListScheduledEvaluationRunsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.verify|verify} messages. + * @param message ListScheduledEvaluationRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListScheduledEvaluationRunsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.verify|verify} messages. + * @param message ListScheduledEvaluationRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListScheduledEvaluationRunsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListScheduledEvaluationRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse; + + /** + * Decodes a ListScheduledEvaluationRunsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListScheduledEvaluationRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse; + + /** + * Verifies a ListScheduledEvaluationRunsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListScheduledEvaluationRunsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListScheduledEvaluationRunsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse; + + /** + * Creates a plain object from a ListScheduledEvaluationRunsResponse message. Also converts values to other types if specified. + * @param message ListScheduledEvaluationRunsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListScheduledEvaluationRunsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListScheduledEvaluationRunsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateScheduledEvaluationRunRequest. */ + interface IUpdateScheduledEvaluationRunRequest { + + /** UpdateScheduledEvaluationRunRequest scheduledEvaluationRun */ + scheduledEvaluationRun?: (google.cloud.ces.v1beta.IScheduledEvaluationRun|null); + + /** UpdateScheduledEvaluationRunRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateScheduledEvaluationRunRequest. */ + class UpdateScheduledEvaluationRunRequest implements IUpdateScheduledEvaluationRunRequest { + + /** + * Constructs a new UpdateScheduledEvaluationRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest); + + /** UpdateScheduledEvaluationRunRequest scheduledEvaluationRun. */ + public scheduledEvaluationRun?: (google.cloud.ces.v1beta.IScheduledEvaluationRun|null); + + /** UpdateScheduledEvaluationRunRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateScheduledEvaluationRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateScheduledEvaluationRunRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest): google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest; + + /** + * Encodes the specified UpdateScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest.verify|verify} messages. + * @param message UpdateScheduledEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest.verify|verify} messages. + * @param message UpdateScheduledEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateScheduledEvaluationRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest; + + /** + * Decodes an UpdateScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest; + + /** + * Verifies an UpdateScheduledEvaluationRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateScheduledEvaluationRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest; + + /** + * Creates a plain object from an UpdateScheduledEvaluationRunRequest message. Also converts values to other types if specified. + * @param message UpdateScheduledEvaluationRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateScheduledEvaluationRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateScheduledEvaluationRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteScheduledEvaluationRunRequest. */ + interface IDeleteScheduledEvaluationRunRequest { + + /** DeleteScheduledEvaluationRunRequest name */ + name?: (string|null); + + /** DeleteScheduledEvaluationRunRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteScheduledEvaluationRunRequest. */ + class DeleteScheduledEvaluationRunRequest implements IDeleteScheduledEvaluationRunRequest { + + /** + * Constructs a new DeleteScheduledEvaluationRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest); + + /** DeleteScheduledEvaluationRunRequest name. */ + public name: string; + + /** DeleteScheduledEvaluationRunRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteScheduledEvaluationRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteScheduledEvaluationRunRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest): google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest; + + /** + * Encodes the specified DeleteScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest.verify|verify} messages. + * @param message DeleteScheduledEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest.verify|verify} messages. + * @param message DeleteScheduledEvaluationRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteScheduledEvaluationRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest; + + /** + * Decodes a DeleteScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest; + + /** + * Verifies a DeleteScheduledEvaluationRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteScheduledEvaluationRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest; + + /** + * Creates a plain object from a DeleteScheduledEvaluationRunRequest message. Also converts values to other types if specified. + * @param message DeleteScheduledEvaluationRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteScheduledEvaluationRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteScheduledEvaluationRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestPersonaVoiceRequest. */ + interface ITestPersonaVoiceRequest { + + /** TestPersonaVoiceRequest app */ + app?: (string|null); + + /** TestPersonaVoiceRequest personaId */ + personaId?: (string|null); + + /** TestPersonaVoiceRequest text */ + text?: (string|null); + } + + /** Represents a TestPersonaVoiceRequest. */ + class TestPersonaVoiceRequest implements ITestPersonaVoiceRequest { + + /** + * Constructs a new TestPersonaVoiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ITestPersonaVoiceRequest); + + /** TestPersonaVoiceRequest app. */ + public app: string; + + /** TestPersonaVoiceRequest personaId. */ + public personaId: string; + + /** TestPersonaVoiceRequest text. */ + public text: string; + + /** + * Creates a new TestPersonaVoiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestPersonaVoiceRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ITestPersonaVoiceRequest): google.cloud.ces.v1beta.TestPersonaVoiceRequest; + + /** + * Encodes the specified TestPersonaVoiceRequest message. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceRequest.verify|verify} messages. + * @param message TestPersonaVoiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ITestPersonaVoiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestPersonaVoiceRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceRequest.verify|verify} messages. + * @param message TestPersonaVoiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ITestPersonaVoiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestPersonaVoiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestPersonaVoiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TestPersonaVoiceRequest; + + /** + * Decodes a TestPersonaVoiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestPersonaVoiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TestPersonaVoiceRequest; + + /** + * Verifies a TestPersonaVoiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestPersonaVoiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestPersonaVoiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TestPersonaVoiceRequest; + + /** + * Creates a plain object from a TestPersonaVoiceRequest message. Also converts values to other types if specified. + * @param message TestPersonaVoiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TestPersonaVoiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestPersonaVoiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestPersonaVoiceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UploadEvaluationAudioRequest. */ + interface IUploadEvaluationAudioRequest { + + /** UploadEvaluationAudioRequest app */ + app?: (string|null); + + /** UploadEvaluationAudioRequest audioContent */ + audioContent?: (Uint8Array|Buffer|string|null); + } + + /** Represents an UploadEvaluationAudioRequest. */ + class UploadEvaluationAudioRequest implements IUploadEvaluationAudioRequest { + + /** + * Constructs a new UploadEvaluationAudioRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUploadEvaluationAudioRequest); + + /** UploadEvaluationAudioRequest app. */ + public app: string; + + /** UploadEvaluationAudioRequest audioContent. */ + public audioContent: (Uint8Array|Buffer|string); + + /** + * Creates a new UploadEvaluationAudioRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UploadEvaluationAudioRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUploadEvaluationAudioRequest): google.cloud.ces.v1beta.UploadEvaluationAudioRequest; + + /** + * Encodes the specified UploadEvaluationAudioRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioRequest.verify|verify} messages. + * @param message UploadEvaluationAudioRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUploadEvaluationAudioRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UploadEvaluationAudioRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioRequest.verify|verify} messages. + * @param message UploadEvaluationAudioRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUploadEvaluationAudioRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UploadEvaluationAudioRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UploadEvaluationAudioRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UploadEvaluationAudioRequest; + + /** + * Decodes an UploadEvaluationAudioRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UploadEvaluationAudioRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UploadEvaluationAudioRequest; + + /** + * Verifies an UploadEvaluationAudioRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UploadEvaluationAudioRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UploadEvaluationAudioRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UploadEvaluationAudioRequest; + + /** + * Creates a plain object from an UploadEvaluationAudioRequest message. Also converts values to other types if specified. + * @param message UploadEvaluationAudioRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UploadEvaluationAudioRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UploadEvaluationAudioRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UploadEvaluationAudioRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UploadEvaluationAudioResponse. */ + interface IUploadEvaluationAudioResponse { + + /** UploadEvaluationAudioResponse audioGcsUri */ + audioGcsUri?: (string|null); + + /** UploadEvaluationAudioResponse audioTranscript */ + audioTranscript?: (string|null); + + /** UploadEvaluationAudioResponse audioDuration */ + audioDuration?: (google.protobuf.IDuration|null); + } + + /** Represents an UploadEvaluationAudioResponse. */ + class UploadEvaluationAudioResponse implements IUploadEvaluationAudioResponse { + + /** + * Constructs a new UploadEvaluationAudioResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUploadEvaluationAudioResponse); + + /** UploadEvaluationAudioResponse audioGcsUri. */ + public audioGcsUri: string; + + /** UploadEvaluationAudioResponse audioTranscript. */ + public audioTranscript: string; + + /** UploadEvaluationAudioResponse audioDuration. */ + public audioDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new UploadEvaluationAudioResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UploadEvaluationAudioResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUploadEvaluationAudioResponse): google.cloud.ces.v1beta.UploadEvaluationAudioResponse; + + /** + * Encodes the specified UploadEvaluationAudioResponse message. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioResponse.verify|verify} messages. + * @param message UploadEvaluationAudioResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUploadEvaluationAudioResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UploadEvaluationAudioResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioResponse.verify|verify} messages. + * @param message UploadEvaluationAudioResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUploadEvaluationAudioResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UploadEvaluationAudioResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UploadEvaluationAudioResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UploadEvaluationAudioResponse; + + /** + * Decodes an UploadEvaluationAudioResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UploadEvaluationAudioResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UploadEvaluationAudioResponse; + + /** + * Verifies an UploadEvaluationAudioResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UploadEvaluationAudioResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UploadEvaluationAudioResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UploadEvaluationAudioResponse; + + /** + * Creates a plain object from an UploadEvaluationAudioResponse message. Also converts values to other types if specified. + * @param message UploadEvaluationAudioResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UploadEvaluationAudioResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UploadEvaluationAudioResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UploadEvaluationAudioResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestPersonaVoiceResponse. */ + interface ITestPersonaVoiceResponse { + + /** TestPersonaVoiceResponse audio */ + audio?: (Uint8Array|Buffer|string|null); + } + + /** Represents a TestPersonaVoiceResponse. */ + class TestPersonaVoiceResponse implements ITestPersonaVoiceResponse { + + /** + * Constructs a new TestPersonaVoiceResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ITestPersonaVoiceResponse); + + /** TestPersonaVoiceResponse audio. */ + public audio: (Uint8Array|Buffer|string); + + /** + * Creates a new TestPersonaVoiceResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TestPersonaVoiceResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.ITestPersonaVoiceResponse): google.cloud.ces.v1beta.TestPersonaVoiceResponse; + + /** + * Encodes the specified TestPersonaVoiceResponse message. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceResponse.verify|verify} messages. + * @param message TestPersonaVoiceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ITestPersonaVoiceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestPersonaVoiceResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceResponse.verify|verify} messages. + * @param message TestPersonaVoiceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ITestPersonaVoiceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestPersonaVoiceResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestPersonaVoiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.TestPersonaVoiceResponse; + + /** + * Decodes a TestPersonaVoiceResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestPersonaVoiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.TestPersonaVoiceResponse; + + /** + * Verifies a TestPersonaVoiceResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestPersonaVoiceResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestPersonaVoiceResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.TestPersonaVoiceResponse; + + /** + * Creates a plain object from a TestPersonaVoiceResponse message. Also converts values to other types if specified. + * @param message TestPersonaVoiceResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.TestPersonaVoiceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestPersonaVoiceResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestPersonaVoiceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateEvaluationExpectationRequest. */ + interface ICreateEvaluationExpectationRequest { + + /** CreateEvaluationExpectationRequest parent */ + parent?: (string|null); + + /** CreateEvaluationExpectationRequest evaluationExpectationId */ + evaluationExpectationId?: (string|null); + + /** CreateEvaluationExpectationRequest evaluationExpectation */ + evaluationExpectation?: (google.cloud.ces.v1beta.IEvaluationExpectation|null); + } + + /** Represents a CreateEvaluationExpectationRequest. */ + class CreateEvaluationExpectationRequest implements ICreateEvaluationExpectationRequest { + + /** + * Constructs a new CreateEvaluationExpectationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest); + + /** CreateEvaluationExpectationRequest parent. */ + public parent: string; + + /** CreateEvaluationExpectationRequest evaluationExpectationId. */ + public evaluationExpectationId: string; + + /** CreateEvaluationExpectationRequest evaluationExpectation. */ + public evaluationExpectation?: (google.cloud.ces.v1beta.IEvaluationExpectation|null); + + /** + * Creates a new CreateEvaluationExpectationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEvaluationExpectationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest): google.cloud.ces.v1beta.CreateEvaluationExpectationRequest; + + /** + * Encodes the specified CreateEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationExpectationRequest.verify|verify} messages. + * @param message CreateEvaluationExpectationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationExpectationRequest.verify|verify} messages. + * @param message CreateEvaluationExpectationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEvaluationExpectationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.CreateEvaluationExpectationRequest; + + /** + * Decodes a CreateEvaluationExpectationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.CreateEvaluationExpectationRequest; + + /** + * Verifies a CreateEvaluationExpectationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEvaluationExpectationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.CreateEvaluationExpectationRequest; + + /** + * Creates a plain object from a CreateEvaluationExpectationRequest message. Also converts values to other types if specified. + * @param message CreateEvaluationExpectationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.CreateEvaluationExpectationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEvaluationExpectationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEvaluationExpectationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEvaluationExpectationRequest. */ + interface IUpdateEvaluationExpectationRequest { + + /** UpdateEvaluationExpectationRequest evaluationExpectation */ + evaluationExpectation?: (google.cloud.ces.v1beta.IEvaluationExpectation|null); + + /** UpdateEvaluationExpectationRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateEvaluationExpectationRequest. */ + class UpdateEvaluationExpectationRequest implements IUpdateEvaluationExpectationRequest { + + /** + * Constructs a new UpdateEvaluationExpectationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest); + + /** UpdateEvaluationExpectationRequest evaluationExpectation. */ + public evaluationExpectation?: (google.cloud.ces.v1beta.IEvaluationExpectation|null); + + /** UpdateEvaluationExpectationRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateEvaluationExpectationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEvaluationExpectationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest): google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest; + + /** + * Encodes the specified UpdateEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest.verify|verify} messages. + * @param message UpdateEvaluationExpectationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest.verify|verify} messages. + * @param message UpdateEvaluationExpectationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEvaluationExpectationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest; + + /** + * Decodes an UpdateEvaluationExpectationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest; + + /** + * Verifies an UpdateEvaluationExpectationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEvaluationExpectationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest; + + /** + * Creates a plain object from an UpdateEvaluationExpectationRequest message. Also converts values to other types if specified. + * @param message UpdateEvaluationExpectationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEvaluationExpectationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEvaluationExpectationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEvaluationExpectationRequest. */ + interface IDeleteEvaluationExpectationRequest { + + /** DeleteEvaluationExpectationRequest name */ + name?: (string|null); + + /** DeleteEvaluationExpectationRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteEvaluationExpectationRequest. */ + class DeleteEvaluationExpectationRequest implements IDeleteEvaluationExpectationRequest { + + /** + * Constructs a new DeleteEvaluationExpectationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest); + + /** DeleteEvaluationExpectationRequest name. */ + public name: string; + + /** DeleteEvaluationExpectationRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteEvaluationExpectationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEvaluationExpectationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest): google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest; + + /** + * Encodes the specified DeleteEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest.verify|verify} messages. + * @param message DeleteEvaluationExpectationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest.verify|verify} messages. + * @param message DeleteEvaluationExpectationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEvaluationExpectationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest; + + /** + * Decodes a DeleteEvaluationExpectationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest; + + /** + * Verifies a DeleteEvaluationExpectationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEvaluationExpectationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest; + + /** + * Creates a plain object from a DeleteEvaluationExpectationRequest message. Also converts values to other types if specified. + * @param message DeleteEvaluationExpectationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEvaluationExpectationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEvaluationExpectationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEvaluationExpectationRequest. */ + interface IGetEvaluationExpectationRequest { + + /** GetEvaluationExpectationRequest name */ + name?: (string|null); + } + + /** Represents a GetEvaluationExpectationRequest. */ + class GetEvaluationExpectationRequest implements IGetEvaluationExpectationRequest { + + /** + * Constructs a new GetEvaluationExpectationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGetEvaluationExpectationRequest); + + /** GetEvaluationExpectationRequest name. */ + public name: string; + + /** + * Creates a new GetEvaluationExpectationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEvaluationExpectationRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGetEvaluationExpectationRequest): google.cloud.ces.v1beta.GetEvaluationExpectationRequest; + + /** + * Encodes the specified GetEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationExpectationRequest.verify|verify} messages. + * @param message GetEvaluationExpectationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGetEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationExpectationRequest.verify|verify} messages. + * @param message GetEvaluationExpectationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGetEvaluationExpectationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEvaluationExpectationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GetEvaluationExpectationRequest; + + /** + * Decodes a GetEvaluationExpectationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GetEvaluationExpectationRequest; + + /** + * Verifies a GetEvaluationExpectationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEvaluationExpectationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GetEvaluationExpectationRequest; + + /** + * Creates a plain object from a GetEvaluationExpectationRequest message. Also converts values to other types if specified. + * @param message GetEvaluationExpectationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GetEvaluationExpectationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEvaluationExpectationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEvaluationExpectationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationExpectationsRequest. */ + interface IListEvaluationExpectationsRequest { + + /** ListEvaluationExpectationsRequest parent */ + parent?: (string|null); + + /** ListEvaluationExpectationsRequest pageSize */ + pageSize?: (number|null); + + /** ListEvaluationExpectationsRequest pageToken */ + pageToken?: (string|null); + + /** ListEvaluationExpectationsRequest filter */ + filter?: (string|null); + + /** ListEvaluationExpectationsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListEvaluationExpectationsRequest. */ + class ListEvaluationExpectationsRequest implements IListEvaluationExpectationsRequest { + + /** + * Constructs a new ListEvaluationExpectationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationExpectationsRequest); + + /** ListEvaluationExpectationsRequest parent. */ + public parent: string; + + /** ListEvaluationExpectationsRequest pageSize. */ + public pageSize: number; + + /** ListEvaluationExpectationsRequest pageToken. */ + public pageToken: string; + + /** ListEvaluationExpectationsRequest filter. */ + public filter: string; + + /** ListEvaluationExpectationsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListEvaluationExpectationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationExpectationsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationExpectationsRequest): google.cloud.ces.v1beta.ListEvaluationExpectationsRequest; + + /** + * Encodes the specified ListEvaluationExpectationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsRequest.verify|verify} messages. + * @param message ListEvaluationExpectationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationExpectationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsRequest.verify|verify} messages. + * @param message ListEvaluationExpectationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationExpectationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationExpectationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationExpectationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationExpectationsRequest; + + /** + * Decodes a ListEvaluationExpectationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationExpectationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationExpectationsRequest; + + /** + * Verifies a ListEvaluationExpectationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationExpectationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationExpectationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationExpectationsRequest; + + /** + * Creates a plain object from a ListEvaluationExpectationsRequest message. Also converts values to other types if specified. + * @param message ListEvaluationExpectationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationExpectationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationExpectationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationExpectationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationExpectationsResponse. */ + interface IListEvaluationExpectationsResponse { + + /** ListEvaluationExpectationsResponse evaluationExpectations */ + evaluationExpectations?: (google.cloud.ces.v1beta.IEvaluationExpectation[]|null); + + /** ListEvaluationExpectationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEvaluationExpectationsResponse. */ + class ListEvaluationExpectationsResponse implements IListEvaluationExpectationsResponse { + + /** + * Constructs a new ListEvaluationExpectationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IListEvaluationExpectationsResponse); + + /** ListEvaluationExpectationsResponse evaluationExpectations. */ + public evaluationExpectations: google.cloud.ces.v1beta.IEvaluationExpectation[]; + + /** ListEvaluationExpectationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEvaluationExpectationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationExpectationsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IListEvaluationExpectationsResponse): google.cloud.ces.v1beta.ListEvaluationExpectationsResponse; + + /** + * Encodes the specified ListEvaluationExpectationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.verify|verify} messages. + * @param message ListEvaluationExpectationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IListEvaluationExpectationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationExpectationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.verify|verify} messages. + * @param message ListEvaluationExpectationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IListEvaluationExpectationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationExpectationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationExpectationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ListEvaluationExpectationsResponse; + + /** + * Decodes a ListEvaluationExpectationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationExpectationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ListEvaluationExpectationsResponse; + + /** + * Verifies a ListEvaluationExpectationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationExpectationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationExpectationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ListEvaluationExpectationsResponse; + + /** + * Creates a plain object from a ListEvaluationExpectationsResponse message. Also converts values to other types if specified. + * @param message ListEvaluationExpectationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ListEvaluationExpectationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationExpectationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationExpectationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Omnichannel. */ + interface IOmnichannel { + + /** Omnichannel name */ + name?: (string|null); + + /** Omnichannel displayName */ + displayName?: (string|null); + + /** Omnichannel description */ + description?: (string|null); + + /** Omnichannel createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Omnichannel updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Omnichannel etag */ + etag?: (string|null); + + /** Omnichannel integrationConfig */ + integrationConfig?: (google.cloud.ces.v1beta.IOmnichannelIntegrationConfig|null); + } + + /** Represents an Omnichannel. */ + class Omnichannel implements IOmnichannel { + + /** + * Constructs a new Omnichannel. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IOmnichannel); + + /** Omnichannel name. */ + public name: string; + + /** Omnichannel displayName. */ + public displayName: string; + + /** Omnichannel description. */ + public description: string; + + /** Omnichannel createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Omnichannel updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Omnichannel etag. */ + public etag: string; + + /** Omnichannel integrationConfig. */ + public integrationConfig?: (google.cloud.ces.v1beta.IOmnichannelIntegrationConfig|null); + + /** + * Creates a new Omnichannel instance using the specified properties. + * @param [properties] Properties to set + * @returns Omnichannel instance + */ + public static create(properties?: google.cloud.ces.v1beta.IOmnichannel): google.cloud.ces.v1beta.Omnichannel; + + /** + * Encodes the specified Omnichannel message. Does not implicitly {@link google.cloud.ces.v1beta.Omnichannel.verify|verify} messages. + * @param message Omnichannel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IOmnichannel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Omnichannel message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Omnichannel.verify|verify} messages. + * @param message Omnichannel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IOmnichannel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Omnichannel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Omnichannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.Omnichannel; + + /** + * Decodes an Omnichannel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Omnichannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.Omnichannel; + + /** + * Verifies an Omnichannel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Omnichannel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Omnichannel + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.Omnichannel; + + /** + * Creates a plain object from an Omnichannel message. Also converts values to other types if specified. + * @param message Omnichannel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.Omnichannel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Omnichannel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Omnichannel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OmnichannelIntegrationConfig. */ + interface IOmnichannelIntegrationConfig { + + /** OmnichannelIntegrationConfig channelConfigs */ + channelConfigs?: ({ [k: string]: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig }|null); + + /** OmnichannelIntegrationConfig subscriberConfigs */ + subscriberConfigs?: ({ [k: string]: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig }|null); + + /** OmnichannelIntegrationConfig routingConfigs */ + routingConfigs?: ({ [k: string]: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig }|null); + } + + /** Represents an OmnichannelIntegrationConfig. */ + class OmnichannelIntegrationConfig implements IOmnichannelIntegrationConfig { + + /** + * Constructs a new OmnichannelIntegrationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IOmnichannelIntegrationConfig); + + /** OmnichannelIntegrationConfig channelConfigs. */ + public channelConfigs: { [k: string]: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig }; + + /** OmnichannelIntegrationConfig subscriberConfigs. */ + public subscriberConfigs: { [k: string]: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig }; + + /** OmnichannelIntegrationConfig routingConfigs. */ + public routingConfigs: { [k: string]: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig }; + + /** + * Creates a new OmnichannelIntegrationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OmnichannelIntegrationConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.IOmnichannelIntegrationConfig): google.cloud.ces.v1beta.OmnichannelIntegrationConfig; + + /** + * Encodes the specified OmnichannelIntegrationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.verify|verify} messages. + * @param message OmnichannelIntegrationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IOmnichannelIntegrationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OmnichannelIntegrationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.verify|verify} messages. + * @param message OmnichannelIntegrationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IOmnichannelIntegrationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OmnichannelIntegrationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelIntegrationConfig; + + /** + * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OmnichannelIntegrationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelIntegrationConfig; + + /** + * Verifies an OmnichannelIntegrationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OmnichannelIntegrationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OmnichannelIntegrationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelIntegrationConfig; + + /** + * Creates a plain object from an OmnichannelIntegrationConfig message. Also converts values to other types if specified. + * @param message OmnichannelIntegrationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OmnichannelIntegrationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OmnichannelIntegrationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OmnichannelIntegrationConfig { + + /** Properties of a ChannelConfig. */ + interface IChannelConfig { + + /** ChannelConfig whatsappConfig */ + whatsappConfig?: (google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig|null); + } + + /** Represents a ChannelConfig. */ + class ChannelConfig implements IChannelConfig { + + /** + * Constructs a new ChannelConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig); + + /** ChannelConfig whatsappConfig. */ + public whatsappConfig?: (google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig|null); + + /** ChannelConfig channelConfig. */ + public channelConfig?: "whatsappConfig"; + + /** + * Creates a new ChannelConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ChannelConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig; + + /** + * Encodes the specified ChannelConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. + * @param message ChannelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChannelConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. + * @param message ChannelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChannelConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChannelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig; + + /** + * Decodes a ChannelConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChannelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig; + + /** + * Verifies a ChannelConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChannelConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChannelConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig; + + /** + * Creates a plain object from a ChannelConfig message. Also converts values to other types if specified. + * @param message ChannelConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChannelConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChannelConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WhatsappConfig. */ + interface IWhatsappConfig { + + /** WhatsappConfig phoneNumberId */ + phoneNumberId?: (string|null); + + /** WhatsappConfig phoneNumber */ + phoneNumber?: (string|null); + + /** WhatsappConfig whatsappBusinessAccountId */ + whatsappBusinessAccountId?: (string|null); + + /** WhatsappConfig webhookVerifyToken */ + webhookVerifyToken?: (string|null); + + /** WhatsappConfig whatsappBusinessToken */ + whatsappBusinessToken?: (string|null); + + /** WhatsappConfig metaBusinessPortfolioId */ + metaBusinessPortfolioId?: (string|null); + } + + /** Represents a WhatsappConfig. */ + class WhatsappConfig implements IWhatsappConfig { + + /** + * Constructs a new WhatsappConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig); + + /** WhatsappConfig phoneNumberId. */ + public phoneNumberId: string; + + /** WhatsappConfig phoneNumber. */ + public phoneNumber: string; + + /** WhatsappConfig whatsappBusinessAccountId. */ + public whatsappBusinessAccountId: string; + + /** WhatsappConfig webhookVerifyToken. */ + public webhookVerifyToken: string; + + /** WhatsappConfig whatsappBusinessToken. */ + public whatsappBusinessToken: string; + + /** WhatsappConfig metaBusinessPortfolioId. */ + public metaBusinessPortfolioId: string; + + /** + * Creates a new WhatsappConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns WhatsappConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig; + + /** + * Encodes the specified WhatsappConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. + * @param message WhatsappConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WhatsappConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. + * @param message WhatsappConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WhatsappConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WhatsappConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig; + + /** + * Decodes a WhatsappConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WhatsappConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig; + + /** + * Verifies a WhatsappConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WhatsappConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WhatsappConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig; + + /** + * Creates a plain object from a WhatsappConfig message. Also converts values to other types if specified. + * @param message WhatsappConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WhatsappConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WhatsappConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SubscriberConfig. */ + interface ISubscriberConfig { + + /** SubscriberConfig cesAppConfig */ + cesAppConfig?: (google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig|null); + } + + /** Represents a SubscriberConfig. */ + class SubscriberConfig implements ISubscriberConfig { + + /** + * Constructs a new SubscriberConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig); + + /** SubscriberConfig cesAppConfig. */ + public cesAppConfig?: (google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig|null); + + /** SubscriberConfig subscriberConfig. */ + public subscriberConfig?: "cesAppConfig"; + + /** + * Creates a new SubscriberConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SubscriberConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig; + + /** + * Encodes the specified SubscriberConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. + * @param message SubscriberConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubscriberConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. + * @param message SubscriberConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubscriberConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubscriberConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig; + + /** + * Decodes a SubscriberConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubscriberConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig; + + /** + * Verifies a SubscriberConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubscriberConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubscriberConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig; + + /** + * Creates a plain object from a SubscriberConfig message. Also converts values to other types if specified. + * @param message SubscriberConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubscriberConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubscriberConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CesAppConfig. */ + interface ICesAppConfig { + + /** CesAppConfig app */ + app?: (string|null); + } + + /** Represents a CesAppConfig. */ + class CesAppConfig implements ICesAppConfig { + + /** + * Constructs a new CesAppConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig); + + /** CesAppConfig app. */ + public app: string; + + /** + * Creates a new CesAppConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CesAppConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig; + + /** + * Encodes the specified CesAppConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. + * @param message CesAppConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CesAppConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. + * @param message CesAppConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CesAppConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CesAppConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig; + + /** + * Decodes a CesAppConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CesAppConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig; + + /** + * Verifies a CesAppConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CesAppConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CesAppConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig; + + /** + * Creates a plain object from a CesAppConfig message. Also converts values to other types if specified. + * @param message CesAppConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CesAppConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CesAppConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoutingConfig. */ + interface IRoutingConfig { + + /** RoutingConfig subscriberKey */ + subscriberKey?: (string|null); + } + + /** Represents a RoutingConfig. */ + class RoutingConfig implements IRoutingConfig { + + /** + * Constructs a new RoutingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig); + + /** RoutingConfig subscriberKey. */ + public subscriberKey: string; + + /** + * Creates a new RoutingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutingConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig; + + /** + * Encodes the specified RoutingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. + * @param message RoutingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. + * @param message RoutingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig; + + /** + * Decodes a RoutingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig; + + /** + * Verifies a RoutingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig; + + /** + * Creates a plain object from a RoutingConfig message. Also converts values to other types if specified. + * @param message RoutingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OmnichannelOperationMetadata. */ + interface IOmnichannelOperationMetadata { + + /** OmnichannelOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OmnichannelOperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OmnichannelOperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OmnichannelOperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + } + + /** Represents an OmnichannelOperationMetadata. */ + class OmnichannelOperationMetadata implements IOmnichannelOperationMetadata { + + /** + * Constructs a new OmnichannelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IOmnichannelOperationMetadata); + + /** OmnichannelOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OmnichannelOperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OmnichannelOperationMetadata statusMessage. */ + public statusMessage: string; + + /** OmnichannelOperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** + * Creates a new OmnichannelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OmnichannelOperationMetadata instance + */ + public static create(properties?: google.cloud.ces.v1beta.IOmnichannelOperationMetadata): google.cloud.ces.v1beta.OmnichannelOperationMetadata; + + /** + * Encodes the specified OmnichannelOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelOperationMetadata.verify|verify} messages. + * @param message OmnichannelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IOmnichannelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OmnichannelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelOperationMetadata.verify|verify} messages. + * @param message OmnichannelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IOmnichannelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OmnichannelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.OmnichannelOperationMetadata; + + /** + * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OmnichannelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.OmnichannelOperationMetadata; + + /** + * Verifies an OmnichannelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OmnichannelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OmnichannelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.OmnichannelOperationMetadata; + + /** + * Creates a plain object from an OmnichannelOperationMetadata message. Also converts values to other types if specified. + * @param message OmnichannelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.OmnichannelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OmnichannelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OmnichannelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a ToolService */ + class ToolService extends $protobuf.rpc.Service { + + /** + * Constructs a new ToolService 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 ToolService 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): ToolService; + + /** + * Calls ExecuteTool. + * @param request ExecuteToolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExecuteToolResponse + */ + public executeTool(request: google.cloud.ces.v1beta.IExecuteToolRequest, callback: google.cloud.ces.v1beta.ToolService.ExecuteToolCallback): void; + + /** + * Calls ExecuteTool. + * @param request ExecuteToolRequest message or plain object + * @returns Promise + */ + public executeTool(request: google.cloud.ces.v1beta.IExecuteToolRequest): Promise; + + /** + * Calls RetrieveToolSchema. + * @param request RetrieveToolSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RetrieveToolSchemaResponse + */ + public retrieveToolSchema(request: google.cloud.ces.v1beta.IRetrieveToolSchemaRequest, callback: google.cloud.ces.v1beta.ToolService.RetrieveToolSchemaCallback): void; + + /** + * Calls RetrieveToolSchema. + * @param request RetrieveToolSchemaRequest message or plain object + * @returns Promise + */ + public retrieveToolSchema(request: google.cloud.ces.v1beta.IRetrieveToolSchemaRequest): Promise; + + /** + * Calls RetrieveTools. + * @param request RetrieveToolsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RetrieveToolsResponse + */ + public retrieveTools(request: google.cloud.ces.v1beta.IRetrieveToolsRequest, callback: google.cloud.ces.v1beta.ToolService.RetrieveToolsCallback): void; + + /** + * Calls RetrieveTools. + * @param request RetrieveToolsRequest message or plain object + * @returns Promise + */ + public retrieveTools(request: google.cloud.ces.v1beta.IRetrieveToolsRequest): Promise; + } + + namespace ToolService { + + /** + * Callback as used by {@link google.cloud.ces.v1beta.ToolService|executeTool}. + * @param error Error, if any + * @param [response] ExecuteToolResponse + */ + type ExecuteToolCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.ExecuteToolResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.ToolService|retrieveToolSchema}. + * @param error Error, if any + * @param [response] RetrieveToolSchemaResponse + */ + type RetrieveToolSchemaCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.RetrieveToolSchemaResponse) => void; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.ToolService|retrieveTools}. + * @param error Error, if any + * @param [response] RetrieveToolsResponse + */ + type RetrieveToolsCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.RetrieveToolsResponse) => void; + } + + /** Properties of an ExecuteToolRequest. */ + interface IExecuteToolRequest { + + /** ExecuteToolRequest tool */ + tool?: (string|null); + + /** ExecuteToolRequest toolsetTool */ + toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ExecuteToolRequest parent */ + parent?: (string|null); + + /** ExecuteToolRequest args */ + args?: (google.protobuf.IStruct|null); + + /** ExecuteToolRequest variables */ + variables?: (google.protobuf.IStruct|null); + } + + /** Represents an ExecuteToolRequest. */ + class ExecuteToolRequest implements IExecuteToolRequest { + + /** + * Constructs a new ExecuteToolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IExecuteToolRequest); + + /** ExecuteToolRequest tool. */ + public tool?: (string|null); + + /** ExecuteToolRequest toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ExecuteToolRequest parent. */ + public parent: string; + + /** ExecuteToolRequest args. */ + public args?: (google.protobuf.IStruct|null); + + /** ExecuteToolRequest variables. */ + public variables?: (google.protobuf.IStruct|null); + + /** ExecuteToolRequest toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new ExecuteToolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteToolRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IExecuteToolRequest): google.cloud.ces.v1beta.ExecuteToolRequest; + + /** + * Encodes the specified ExecuteToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolRequest.verify|verify} messages. + * @param message ExecuteToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IExecuteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolRequest.verify|verify} messages. + * @param message ExecuteToolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IExecuteToolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteToolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ExecuteToolRequest; + + /** + * Decodes an ExecuteToolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ExecuteToolRequest; + + /** + * Verifies an ExecuteToolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteToolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteToolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ExecuteToolRequest; + + /** + * Creates a plain object from an ExecuteToolRequest message. Also converts values to other types if specified. + * @param message ExecuteToolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ExecuteToolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteToolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteToolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecuteToolResponse. */ + interface IExecuteToolResponse { + + /** ExecuteToolResponse tool */ + tool?: (string|null); + + /** ExecuteToolResponse toolsetTool */ + toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ExecuteToolResponse response */ + response?: (google.protobuf.IStruct|null); + + /** ExecuteToolResponse variables */ + variables?: (google.protobuf.IStruct|null); + } + + /** Represents an ExecuteToolResponse. */ + class ExecuteToolResponse implements IExecuteToolResponse { + + /** + * Constructs a new ExecuteToolResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IExecuteToolResponse); + + /** ExecuteToolResponse tool. */ + public tool?: (string|null); + + /** ExecuteToolResponse toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** ExecuteToolResponse response. */ + public response?: (google.protobuf.IStruct|null); + + /** ExecuteToolResponse variables. */ + public variables?: (google.protobuf.IStruct|null); + + /** ExecuteToolResponse toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new ExecuteToolResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteToolResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IExecuteToolResponse): google.cloud.ces.v1beta.ExecuteToolResponse; + + /** + * Encodes the specified ExecuteToolResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolResponse.verify|verify} messages. + * @param message ExecuteToolResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IExecuteToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolResponse.verify|verify} messages. + * @param message ExecuteToolResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IExecuteToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteToolResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.ExecuteToolResponse; + + /** + * Decodes an ExecuteToolResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.ExecuteToolResponse; + + /** + * Verifies an ExecuteToolResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteToolResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteToolResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.ExecuteToolResponse; + + /** + * Creates a plain object from an ExecuteToolResponse message. Also converts values to other types if specified. + * @param message ExecuteToolResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.ExecuteToolResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteToolResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteToolResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetrieveToolSchemaRequest. */ + interface IRetrieveToolSchemaRequest { + + /** RetrieveToolSchemaRequest tool */ + tool?: (string|null); + + /** RetrieveToolSchemaRequest toolsetTool */ + toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** RetrieveToolSchemaRequest parent */ + parent?: (string|null); + } + + /** Represents a RetrieveToolSchemaRequest. */ + class RetrieveToolSchemaRequest implements IRetrieveToolSchemaRequest { + + /** + * Constructs a new RetrieveToolSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRetrieveToolSchemaRequest); + + /** RetrieveToolSchemaRequest tool. */ + public tool?: (string|null); + + /** RetrieveToolSchemaRequest toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** RetrieveToolSchemaRequest parent. */ + public parent: string; + + /** RetrieveToolSchemaRequest toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new RetrieveToolSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrieveToolSchemaRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRetrieveToolSchemaRequest): google.cloud.ces.v1beta.RetrieveToolSchemaRequest; + + /** + * Encodes the specified RetrieveToolSchemaRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaRequest.verify|verify} messages. + * @param message RetrieveToolSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRetrieveToolSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrieveToolSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaRequest.verify|verify} messages. + * @param message RetrieveToolSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRetrieveToolSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrieveToolSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RetrieveToolSchemaRequest; + + /** + * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrieveToolSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RetrieveToolSchemaRequest; + + /** + * Verifies a RetrieveToolSchemaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrieveToolSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrieveToolSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RetrieveToolSchemaRequest; + + /** + * Creates a plain object from a RetrieveToolSchemaRequest message. Also converts values to other types if specified. + * @param message RetrieveToolSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RetrieveToolSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrieveToolSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrieveToolSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetrieveToolSchemaResponse. */ + interface IRetrieveToolSchemaResponse { + + /** RetrieveToolSchemaResponse tool */ + tool?: (string|null); + + /** RetrieveToolSchemaResponse toolsetTool */ + toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** RetrieveToolSchemaResponse inputSchema */ + inputSchema?: (google.cloud.ces.v1beta.ISchema|null); + + /** RetrieveToolSchemaResponse outputSchema */ + outputSchema?: (google.cloud.ces.v1beta.ISchema|null); + } + + /** Represents a RetrieveToolSchemaResponse. */ + class RetrieveToolSchemaResponse implements IRetrieveToolSchemaResponse { + + /** + * Constructs a new RetrieveToolSchemaResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRetrieveToolSchemaResponse); + + /** RetrieveToolSchemaResponse tool. */ + public tool?: (string|null); + + /** RetrieveToolSchemaResponse toolsetTool. */ + public toolsetTool?: (google.cloud.ces.v1beta.IToolsetTool|null); + + /** RetrieveToolSchemaResponse inputSchema. */ + public inputSchema?: (google.cloud.ces.v1beta.ISchema|null); + + /** RetrieveToolSchemaResponse outputSchema. */ + public outputSchema?: (google.cloud.ces.v1beta.ISchema|null); + + /** RetrieveToolSchemaResponse toolIdentifier. */ + public toolIdentifier?: ("tool"|"toolsetTool"); + + /** + * Creates a new RetrieveToolSchemaResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrieveToolSchemaResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRetrieveToolSchemaResponse): google.cloud.ces.v1beta.RetrieveToolSchemaResponse; + + /** + * Encodes the specified RetrieveToolSchemaResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaResponse.verify|verify} messages. + * @param message RetrieveToolSchemaResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRetrieveToolSchemaResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrieveToolSchemaResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaResponse.verify|verify} messages. + * @param message RetrieveToolSchemaResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRetrieveToolSchemaResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrieveToolSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RetrieveToolSchemaResponse; + + /** + * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrieveToolSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RetrieveToolSchemaResponse; + + /** + * Verifies a RetrieveToolSchemaResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrieveToolSchemaResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrieveToolSchemaResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RetrieveToolSchemaResponse; + + /** + * Creates a plain object from a RetrieveToolSchemaResponse message. Also converts values to other types if specified. + * @param message RetrieveToolSchemaResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RetrieveToolSchemaResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrieveToolSchemaResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrieveToolSchemaResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetrieveToolsRequest. */ + interface IRetrieveToolsRequest { + + /** RetrieveToolsRequest toolset */ + toolset?: (string|null); + + /** RetrieveToolsRequest toolIds */ + toolIds?: (string[]|null); + } + + /** Represents a RetrieveToolsRequest. */ + class RetrieveToolsRequest implements IRetrieveToolsRequest { + + /** + * Constructs a new RetrieveToolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRetrieveToolsRequest); + + /** RetrieveToolsRequest toolset. */ + public toolset: string; + + /** RetrieveToolsRequest toolIds. */ + public toolIds: string[]; + + /** + * Creates a new RetrieveToolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrieveToolsRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRetrieveToolsRequest): google.cloud.ces.v1beta.RetrieveToolsRequest; + + /** + * Encodes the specified RetrieveToolsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsRequest.verify|verify} messages. + * @param message RetrieveToolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRetrieveToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrieveToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsRequest.verify|verify} messages. + * @param message RetrieveToolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRetrieveToolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrieveToolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrieveToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RetrieveToolsRequest; + + /** + * Decodes a RetrieveToolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrieveToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RetrieveToolsRequest; + + /** + * Verifies a RetrieveToolsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrieveToolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrieveToolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RetrieveToolsRequest; + + /** + * Creates a plain object from a RetrieveToolsRequest message. Also converts values to other types if specified. + * @param message RetrieveToolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RetrieveToolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrieveToolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrieveToolsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetrieveToolsResponse. */ + interface IRetrieveToolsResponse { + + /** RetrieveToolsResponse tools */ + tools?: (google.cloud.ces.v1beta.ITool[]|null); + } + + /** Represents a RetrieveToolsResponse. */ + class RetrieveToolsResponse implements IRetrieveToolsResponse { + + /** + * Constructs a new RetrieveToolsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IRetrieveToolsResponse); + + /** RetrieveToolsResponse tools. */ + public tools: google.cloud.ces.v1beta.ITool[]; + + /** + * Creates a new RetrieveToolsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrieveToolsResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IRetrieveToolsResponse): google.cloud.ces.v1beta.RetrieveToolsResponse; + + /** + * Encodes the specified RetrieveToolsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsResponse.verify|verify} messages. + * @param message RetrieveToolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IRetrieveToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrieveToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsResponse.verify|verify} messages. + * @param message RetrieveToolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IRetrieveToolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrieveToolsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrieveToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.RetrieveToolsResponse; + + /** + * Decodes a RetrieveToolsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrieveToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.RetrieveToolsResponse; + + /** + * Verifies a RetrieveToolsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrieveToolsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrieveToolsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RetrieveToolsResponse; + + /** + * Creates a plain object from a RetrieveToolsResponse message. Also converts values to other types if specified. + * @param message RetrieveToolsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RetrieveToolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrieveToolsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrieveToolsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a WidgetService */ + class WidgetService extends $protobuf.rpc.Service { + + /** + * Constructs a new WidgetService 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 WidgetService 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): WidgetService; + + /** + * Calls GenerateChatToken. + * @param request GenerateChatTokenRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateChatTokenResponse + */ + public generateChatToken(request: google.cloud.ces.v1beta.IGenerateChatTokenRequest, callback: google.cloud.ces.v1beta.WidgetService.GenerateChatTokenCallback): void; + + /** + * Calls GenerateChatToken. + * @param request GenerateChatTokenRequest message or plain object + * @returns Promise + */ + public generateChatToken(request: google.cloud.ces.v1beta.IGenerateChatTokenRequest): Promise; + } + + namespace WidgetService { + + /** + * Callback as used by {@link google.cloud.ces.v1beta.WidgetService|generateChatToken}. + * @param error Error, if any + * @param [response] GenerateChatTokenResponse + */ + type GenerateChatTokenCallback = (error: (Error|null), response?: google.cloud.ces.v1beta.GenerateChatTokenResponse) => void; + } + + /** Properties of a GenerateChatTokenRequest. */ + interface IGenerateChatTokenRequest { + + /** GenerateChatTokenRequest name */ + name?: (string|null); + + /** GenerateChatTokenRequest deployment */ + deployment?: (string|null); + + /** GenerateChatTokenRequest recaptchaToken */ + recaptchaToken?: (string|null); + } + + /** Represents a GenerateChatTokenRequest. */ + class GenerateChatTokenRequest implements IGenerateChatTokenRequest { + + /** + * Constructs a new GenerateChatTokenRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGenerateChatTokenRequest); + + /** GenerateChatTokenRequest name. */ + public name: string; + + /** GenerateChatTokenRequest deployment. */ + public deployment: string; + + /** GenerateChatTokenRequest recaptchaToken. */ + public recaptchaToken: string; + + /** + * Creates a new GenerateChatTokenRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateChatTokenRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGenerateChatTokenRequest): google.cloud.ces.v1beta.GenerateChatTokenRequest; + + /** + * Encodes the specified GenerateChatTokenRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenRequest.verify|verify} messages. + * @param message GenerateChatTokenRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGenerateChatTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateChatTokenRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenRequest.verify|verify} messages. + * @param message GenerateChatTokenRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGenerateChatTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateChatTokenRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateChatTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateChatTokenRequest; + + /** + * Decodes a GenerateChatTokenRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateChatTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateChatTokenRequest; + + /** + * Verifies a GenerateChatTokenRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateChatTokenRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateChatTokenRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateChatTokenRequest; + + /** + * Creates a plain object from a GenerateChatTokenRequest message. Also converts values to other types if specified. + * @param message GenerateChatTokenRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateChatTokenRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateChatTokenRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateChatTokenRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateChatTokenResponse. */ + interface IGenerateChatTokenResponse { + + /** GenerateChatTokenResponse chatToken */ + chatToken?: (string|null); + + /** GenerateChatTokenResponse expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a GenerateChatTokenResponse. */ + class GenerateChatTokenResponse implements IGenerateChatTokenResponse { + + /** + * Constructs a new GenerateChatTokenResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGenerateChatTokenResponse); + + /** GenerateChatTokenResponse chatToken. */ + public chatToken: string; + + /** GenerateChatTokenResponse expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new GenerateChatTokenResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateChatTokenResponse instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGenerateChatTokenResponse): google.cloud.ces.v1beta.GenerateChatTokenResponse; + + /** + * Encodes the specified GenerateChatTokenResponse message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenResponse.verify|verify} messages. + * @param message GenerateChatTokenResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGenerateChatTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateChatTokenResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenResponse.verify|verify} messages. + * @param message GenerateChatTokenResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGenerateChatTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateChatTokenResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateChatTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.ces.v1beta.GenerateChatTokenResponse; + + /** + * Decodes a GenerateChatTokenResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateChatTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.ces.v1beta.GenerateChatTokenResponse; + + /** + * Verifies a GenerateChatTokenResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateChatTokenResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateChatTokenResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateChatTokenResponse; + + /** + * Creates a plain object from a GenerateChatTokenResponse message. Also converts values to other types if specified. + * @param message GenerateChatTokenResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateChatTokenResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateChatTokenResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateChatTokenResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } } } diff --git a/packages/google-cloud-ces/protos/protos.js b/packages/google-cloud-ces/protos/protos.js index 50a5fbd6ce8..76b1c3b6925 100644 --- a/packages/google-cloud-ces/protos/protos.js +++ b/packages/google-cloud-ces/protos/protos.js @@ -64376,6 +64376,98497 @@ return v1; })(); + ces.v1beta = (function() { + + /** + * Namespace v1beta. + * @memberof google.cloud.ces + * @namespace + */ + var v1beta = {}; + + v1beta.Agent = (function() { + + /** + * Properties of an Agent. + * @memberof google.cloud.ces.v1beta + * @interface IAgent + * @property {google.cloud.ces.v1beta.Agent.ILlmAgent|null} [llmAgent] Agent llmAgent + * @property {google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent|null} [remoteDialogflowAgent] Agent remoteDialogflowAgent + * @property {string|null} [name] Agent name + * @property {string|null} [displayName] Agent displayName + * @property {string|null} [description] Agent description + * @property {google.cloud.ces.v1beta.IModelSettings|null} [modelSettings] Agent modelSettings + * @property {string|null} [instruction] Agent instruction + * @property {Array.|null} [tools] Agent tools + * @property {Array.|null} [childAgents] Agent childAgents + * @property {Array.|null} [beforeAgentCallbacks] Agent beforeAgentCallbacks + * @property {Array.|null} [afterAgentCallbacks] Agent afterAgentCallbacks + * @property {Array.|null} [beforeModelCallbacks] Agent beforeModelCallbacks + * @property {Array.|null} [afterModelCallbacks] Agent afterModelCallbacks + * @property {Array.|null} [beforeToolCallbacks] Agent beforeToolCallbacks + * @property {Array.|null} [afterToolCallbacks] Agent afterToolCallbacks + * @property {google.protobuf.ITimestamp|null} [createTime] Agent createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Agent updateTime + * @property {Array.|null} [guardrails] Agent guardrails + * @property {string|null} [etag] Agent etag + * @property {Array.|null} [toolsets] Agent toolsets + * @property {string|null} [generatedSummary] Agent generatedSummary + * @property {Array.|null} [transferRules] Agent transferRules + */ + + /** + * Constructs a new Agent. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an Agent. + * @implements IAgent + * @constructor + * @param {google.cloud.ces.v1beta.IAgent=} [properties] Properties to set + */ + function Agent(properties) { + this.tools = []; + this.childAgents = []; + this.beforeAgentCallbacks = []; + this.afterAgentCallbacks = []; + this.beforeModelCallbacks = []; + this.afterModelCallbacks = []; + this.beforeToolCallbacks = []; + this.afterToolCallbacks = []; + this.guardrails = []; + this.toolsets = []; + this.transferRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Agent llmAgent. + * @member {google.cloud.ces.v1beta.Agent.ILlmAgent|null|undefined} llmAgent + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.llmAgent = null; + + /** + * Agent remoteDialogflowAgent. + * @member {google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent|null|undefined} remoteDialogflowAgent + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.remoteDialogflowAgent = null; + + /** + * Agent name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.name = ""; + + /** + * Agent displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.displayName = ""; + + /** + * Agent description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.description = ""; + + /** + * Agent modelSettings. + * @member {google.cloud.ces.v1beta.IModelSettings|null|undefined} modelSettings + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.modelSettings = null; + + /** + * Agent instruction. + * @member {string} instruction + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.instruction = ""; + + /** + * Agent tools. + * @member {Array.} tools + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.tools = $util.emptyArray; + + /** + * Agent childAgents. + * @member {Array.} childAgents + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.childAgents = $util.emptyArray; + + /** + * Agent beforeAgentCallbacks. + * @member {Array.} beforeAgentCallbacks + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.beforeAgentCallbacks = $util.emptyArray; + + /** + * Agent afterAgentCallbacks. + * @member {Array.} afterAgentCallbacks + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.afterAgentCallbacks = $util.emptyArray; + + /** + * Agent beforeModelCallbacks. + * @member {Array.} beforeModelCallbacks + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.beforeModelCallbacks = $util.emptyArray; + + /** + * Agent afterModelCallbacks. + * @member {Array.} afterModelCallbacks + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.afterModelCallbacks = $util.emptyArray; + + /** + * Agent beforeToolCallbacks. + * @member {Array.} beforeToolCallbacks + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.beforeToolCallbacks = $util.emptyArray; + + /** + * Agent afterToolCallbacks. + * @member {Array.} afterToolCallbacks + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.afterToolCallbacks = $util.emptyArray; + + /** + * Agent createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.createTime = null; + + /** + * Agent updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.updateTime = null; + + /** + * Agent guardrails. + * @member {Array.} guardrails + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.guardrails = $util.emptyArray; + + /** + * Agent etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.etag = ""; + + /** + * Agent toolsets. + * @member {Array.} toolsets + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.toolsets = $util.emptyArray; + + /** + * Agent generatedSummary. + * @member {string} generatedSummary + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.generatedSummary = ""; + + /** + * Agent transferRules. + * @member {Array.} transferRules + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Agent.prototype.transferRules = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Agent agentType. + * @member {"llmAgent"|"remoteDialogflowAgent"|undefined} agentType + * @memberof google.cloud.ces.v1beta.Agent + * @instance + */ + Object.defineProperty(Agent.prototype, "agentType", { + get: $util.oneOfGetter($oneOfFields = ["llmAgent", "remoteDialogflowAgent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Agent instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Agent + * @static + * @param {google.cloud.ces.v1beta.IAgent=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Agent} Agent instance + */ + Agent.create = function create(properties) { + return new Agent(properties); + }; + + /** + * Encodes the specified Agent message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Agent + * @static + * @param {google.cloud.ces.v1beta.IAgent} message Agent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Agent.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) + $root.google.cloud.ces.v1beta.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.instruction != null && Object.hasOwnProperty.call(message, "instruction")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.instruction); + if (message.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.tools[i]); + if (message.childAgents != null && message.childAgents.length) + for (var i = 0; i < message.childAgents.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.childAgents[i]); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.guardrails != null && message.guardrails.length) + for (var i = 0; i < message.guardrails.length; ++i) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.guardrails[i]); + if (message.beforeAgentCallbacks != null && message.beforeAgentCallbacks.length) + for (var i = 0; i < message.beforeAgentCallbacks.length; ++i) + $root.google.cloud.ces.v1beta.Callback.encode(message.beforeAgentCallbacks[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.afterAgentCallbacks != null && message.afterAgentCallbacks.length) + for (var i = 0; i < message.afterAgentCallbacks.length; ++i) + $root.google.cloud.ces.v1beta.Callback.encode(message.afterAgentCallbacks[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.beforeModelCallbacks != null && message.beforeModelCallbacks.length) + for (var i = 0; i < message.beforeModelCallbacks.length; ++i) + $root.google.cloud.ces.v1beta.Callback.encode(message.beforeModelCallbacks[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.afterModelCallbacks != null && message.afterModelCallbacks.length) + for (var i = 0; i < message.afterModelCallbacks.length; ++i) + $root.google.cloud.ces.v1beta.Callback.encode(message.afterModelCallbacks[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.beforeToolCallbacks != null && message.beforeToolCallbacks.length) + for (var i = 0; i < message.beforeToolCallbacks.length; ++i) + $root.google.cloud.ces.v1beta.Callback.encode(message.beforeToolCallbacks[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.afterToolCallbacks != null && message.afterToolCallbacks.length) + for (var i = 0; i < message.afterToolCallbacks.length; ++i) + $root.google.cloud.ces.v1beta.Callback.encode(message.afterToolCallbacks[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 24, wireType 2 =*/194).string(message.etag); + if (message.llmAgent != null && Object.hasOwnProperty.call(message, "llmAgent")) + $root.google.cloud.ces.v1beta.Agent.LlmAgent.encode(message.llmAgent, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.remoteDialogflowAgent != null && Object.hasOwnProperty.call(message, "remoteDialogflowAgent")) + $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.encode(message.remoteDialogflowAgent, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.toolsets != null && message.toolsets.length) + for (var i = 0; i < message.toolsets.length; ++i) + $root.google.cloud.ces.v1beta.Agent.AgentToolset.encode(message.toolsets[i], writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.generatedSummary != null && Object.hasOwnProperty.call(message, "generatedSummary")) + writer.uint32(/* id 29, wireType 2 =*/234).string(message.generatedSummary); + if (message.transferRules != null && message.transferRules.length) + for (var i = 0; i < message.transferRules.length; ++i) + $root.google.cloud.ces.v1beta.TransferRule.encode(message.transferRules[i], writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Agent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Agent + * @static + * @param {google.cloud.ces.v1beta.IAgent} message Agent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Agent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Agent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Agent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Agent} Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Agent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Agent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 26: { + message.llmAgent = $root.google.cloud.ces.v1beta.Agent.LlmAgent.decode(reader, reader.uint32()); + break; + } + case 27: { + message.remoteDialogflowAgent = $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.decode(reader, reader.uint32()); + break; + } + case 6: { + message.instruction = reader.string(); + break; + } + case 7: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push(reader.string()); + break; + } + case 8: { + if (!(message.childAgents && message.childAgents.length)) + message.childAgents = []; + message.childAgents.push(reader.string()); + break; + } + case 18: { + if (!(message.beforeAgentCallbacks && message.beforeAgentCallbacks.length)) + message.beforeAgentCallbacks = []; + message.beforeAgentCallbacks.push($root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32())); + break; + } + case 19: { + if (!(message.afterAgentCallbacks && message.afterAgentCallbacks.length)) + message.afterAgentCallbacks = []; + message.afterAgentCallbacks.push($root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32())); + break; + } + case 20: { + if (!(message.beforeModelCallbacks && message.beforeModelCallbacks.length)) + message.beforeModelCallbacks = []; + message.beforeModelCallbacks.push($root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32())); + break; + } + case 21: { + if (!(message.afterModelCallbacks && message.afterModelCallbacks.length)) + message.afterModelCallbacks = []; + message.afterModelCallbacks.push($root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32())); + break; + } + case 22: { + if (!(message.beforeToolCallbacks && message.beforeToolCallbacks.length)) + message.beforeToolCallbacks = []; + message.beforeToolCallbacks.push($root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32())); + break; + } + case 23: { + if (!(message.afterToolCallbacks && message.afterToolCallbacks.length)) + message.afterToolCallbacks = []; + message.afterToolCallbacks.push($root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32())); + break; + } + case 15: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 16: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 17: { + if (!(message.guardrails && message.guardrails.length)) + message.guardrails = []; + message.guardrails.push(reader.string()); + break; + } + case 24: { + message.etag = reader.string(); + break; + } + case 28: { + if (!(message.toolsets && message.toolsets.length)) + message.toolsets = []; + message.toolsets.push($root.google.cloud.ces.v1beta.Agent.AgentToolset.decode(reader, reader.uint32())); + break; + } + case 29: { + message.generatedSummary = reader.string(); + break; + } + case 30: { + if (!(message.transferRules && message.transferRules.length)) + message.transferRules = []; + message.transferRules.push($root.google.cloud.ces.v1beta.TransferRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Agent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Agent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Agent} Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Agent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Agent message. + * @function verify + * @memberof google.cloud.ces.v1beta.Agent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Agent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.llmAgent != null && message.hasOwnProperty("llmAgent")) { + properties.agentType = 1; + { + var error = $root.google.cloud.ces.v1beta.Agent.LlmAgent.verify(message.llmAgent); + if (error) + return "llmAgent." + error; + } + } + if (message.remoteDialogflowAgent != null && message.hasOwnProperty("remoteDialogflowAgent")) { + if (properties.agentType === 1) + return "agentType: multiple values"; + properties.agentType = 1; + { + var error = $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.verify(message.remoteDialogflowAgent); + if (error) + return "remoteDialogflowAgent." + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { + var error = $root.google.cloud.ces.v1beta.ModelSettings.verify(message.modelSettings); + if (error) + return "modelSettings." + error; + } + if (message.instruction != null && message.hasOwnProperty("instruction")) + if (!$util.isString(message.instruction)) + return "instruction: string expected"; + if (message.tools != null && message.hasOwnProperty("tools")) { + if (!Array.isArray(message.tools)) + return "tools: array expected"; + for (var i = 0; i < message.tools.length; ++i) + if (!$util.isString(message.tools[i])) + return "tools: string[] expected"; + } + if (message.childAgents != null && message.hasOwnProperty("childAgents")) { + if (!Array.isArray(message.childAgents)) + return "childAgents: array expected"; + for (var i = 0; i < message.childAgents.length; ++i) + if (!$util.isString(message.childAgents[i])) + return "childAgents: string[] expected"; + } + if (message.beforeAgentCallbacks != null && message.hasOwnProperty("beforeAgentCallbacks")) { + if (!Array.isArray(message.beforeAgentCallbacks)) + return "beforeAgentCallbacks: array expected"; + for (var i = 0; i < message.beforeAgentCallbacks.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.beforeAgentCallbacks[i]); + if (error) + return "beforeAgentCallbacks." + error; + } + } + if (message.afterAgentCallbacks != null && message.hasOwnProperty("afterAgentCallbacks")) { + if (!Array.isArray(message.afterAgentCallbacks)) + return "afterAgentCallbacks: array expected"; + for (var i = 0; i < message.afterAgentCallbacks.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.afterAgentCallbacks[i]); + if (error) + return "afterAgentCallbacks." + error; + } + } + if (message.beforeModelCallbacks != null && message.hasOwnProperty("beforeModelCallbacks")) { + if (!Array.isArray(message.beforeModelCallbacks)) + return "beforeModelCallbacks: array expected"; + for (var i = 0; i < message.beforeModelCallbacks.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.beforeModelCallbacks[i]); + if (error) + return "beforeModelCallbacks." + error; + } + } + if (message.afterModelCallbacks != null && message.hasOwnProperty("afterModelCallbacks")) { + if (!Array.isArray(message.afterModelCallbacks)) + return "afterModelCallbacks: array expected"; + for (var i = 0; i < message.afterModelCallbacks.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.afterModelCallbacks[i]); + if (error) + return "afterModelCallbacks." + error; + } + } + if (message.beforeToolCallbacks != null && message.hasOwnProperty("beforeToolCallbacks")) { + if (!Array.isArray(message.beforeToolCallbacks)) + return "beforeToolCallbacks: array expected"; + for (var i = 0; i < message.beforeToolCallbacks.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.beforeToolCallbacks[i]); + if (error) + return "beforeToolCallbacks." + error; + } + } + if (message.afterToolCallbacks != null && message.hasOwnProperty("afterToolCallbacks")) { + if (!Array.isArray(message.afterToolCallbacks)) + return "afterToolCallbacks: array expected"; + for (var i = 0; i < message.afterToolCallbacks.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.afterToolCallbacks[i]); + if (error) + return "afterToolCallbacks." + error; + } + } + 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.guardrails != null && message.hasOwnProperty("guardrails")) { + if (!Array.isArray(message.guardrails)) + return "guardrails: array expected"; + for (var i = 0; i < message.guardrails.length; ++i) + if (!$util.isString(message.guardrails[i])) + return "guardrails: string[] expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.toolsets != null && message.hasOwnProperty("toolsets")) { + if (!Array.isArray(message.toolsets)) + return "toolsets: array expected"; + for (var i = 0; i < message.toolsets.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Agent.AgentToolset.verify(message.toolsets[i]); + if (error) + return "toolsets." + error; + } + } + if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) + if (!$util.isString(message.generatedSummary)) + return "generatedSummary: string expected"; + if (message.transferRules != null && message.hasOwnProperty("transferRules")) { + if (!Array.isArray(message.transferRules)) + return "transferRules: array expected"; + for (var i = 0; i < message.transferRules.length; ++i) { + var error = $root.google.cloud.ces.v1beta.TransferRule.verify(message.transferRules[i]); + if (error) + return "transferRules." + error; + } + } + return null; + }; + + /** + * Creates an Agent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Agent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Agent} Agent + */ + Agent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Agent) + return object; + var message = new $root.google.cloud.ces.v1beta.Agent(); + if (object.llmAgent != null) { + if (typeof object.llmAgent !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.llmAgent: object expected"); + message.llmAgent = $root.google.cloud.ces.v1beta.Agent.LlmAgent.fromObject(object.llmAgent); + } + if (object.remoteDialogflowAgent != null) { + if (typeof object.remoteDialogflowAgent !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.remoteDialogflowAgent: object expected"); + message.remoteDialogflowAgent = $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.fromObject(object.remoteDialogflowAgent); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.modelSettings != null) { + if (typeof object.modelSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.modelSettings: object expected"); + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.fromObject(object.modelSettings); + } + if (object.instruction != null) + message.instruction = String(object.instruction); + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.cloud.ces.v1beta.Agent.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) + message.tools[i] = String(object.tools[i]); + } + if (object.childAgents) { + if (!Array.isArray(object.childAgents)) + throw TypeError(".google.cloud.ces.v1beta.Agent.childAgents: array expected"); + message.childAgents = []; + for (var i = 0; i < object.childAgents.length; ++i) + message.childAgents[i] = String(object.childAgents[i]); + } + if (object.beforeAgentCallbacks) { + if (!Array.isArray(object.beforeAgentCallbacks)) + throw TypeError(".google.cloud.ces.v1beta.Agent.beforeAgentCallbacks: array expected"); + message.beforeAgentCallbacks = []; + for (var i = 0; i < object.beforeAgentCallbacks.length; ++i) { + if (typeof object.beforeAgentCallbacks[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.beforeAgentCallbacks: object expected"); + message.beforeAgentCallbacks[i] = $root.google.cloud.ces.v1beta.Callback.fromObject(object.beforeAgentCallbacks[i]); + } + } + if (object.afterAgentCallbacks) { + if (!Array.isArray(object.afterAgentCallbacks)) + throw TypeError(".google.cloud.ces.v1beta.Agent.afterAgentCallbacks: array expected"); + message.afterAgentCallbacks = []; + for (var i = 0; i < object.afterAgentCallbacks.length; ++i) { + if (typeof object.afterAgentCallbacks[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.afterAgentCallbacks: object expected"); + message.afterAgentCallbacks[i] = $root.google.cloud.ces.v1beta.Callback.fromObject(object.afterAgentCallbacks[i]); + } + } + if (object.beforeModelCallbacks) { + if (!Array.isArray(object.beforeModelCallbacks)) + throw TypeError(".google.cloud.ces.v1beta.Agent.beforeModelCallbacks: array expected"); + message.beforeModelCallbacks = []; + for (var i = 0; i < object.beforeModelCallbacks.length; ++i) { + if (typeof object.beforeModelCallbacks[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.beforeModelCallbacks: object expected"); + message.beforeModelCallbacks[i] = $root.google.cloud.ces.v1beta.Callback.fromObject(object.beforeModelCallbacks[i]); + } + } + if (object.afterModelCallbacks) { + if (!Array.isArray(object.afterModelCallbacks)) + throw TypeError(".google.cloud.ces.v1beta.Agent.afterModelCallbacks: array expected"); + message.afterModelCallbacks = []; + for (var i = 0; i < object.afterModelCallbacks.length; ++i) { + if (typeof object.afterModelCallbacks[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.afterModelCallbacks: object expected"); + message.afterModelCallbacks[i] = $root.google.cloud.ces.v1beta.Callback.fromObject(object.afterModelCallbacks[i]); + } + } + if (object.beforeToolCallbacks) { + if (!Array.isArray(object.beforeToolCallbacks)) + throw TypeError(".google.cloud.ces.v1beta.Agent.beforeToolCallbacks: array expected"); + message.beforeToolCallbacks = []; + for (var i = 0; i < object.beforeToolCallbacks.length; ++i) { + if (typeof object.beforeToolCallbacks[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.beforeToolCallbacks: object expected"); + message.beforeToolCallbacks[i] = $root.google.cloud.ces.v1beta.Callback.fromObject(object.beforeToolCallbacks[i]); + } + } + if (object.afterToolCallbacks) { + if (!Array.isArray(object.afterToolCallbacks)) + throw TypeError(".google.cloud.ces.v1beta.Agent.afterToolCallbacks: array expected"); + message.afterToolCallbacks = []; + for (var i = 0; i < object.afterToolCallbacks.length; ++i) { + if (typeof object.afterToolCallbacks[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.afterToolCallbacks: object expected"); + message.afterToolCallbacks[i] = $root.google.cloud.ces.v1beta.Callback.fromObject(object.afterToolCallbacks[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.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.ces.v1beta.Agent.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.guardrails) { + if (!Array.isArray(object.guardrails)) + throw TypeError(".google.cloud.ces.v1beta.Agent.guardrails: array expected"); + message.guardrails = []; + for (var i = 0; i < object.guardrails.length; ++i) + message.guardrails[i] = String(object.guardrails[i]); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.toolsets) { + if (!Array.isArray(object.toolsets)) + throw TypeError(".google.cloud.ces.v1beta.Agent.toolsets: array expected"); + message.toolsets = []; + for (var i = 0; i < object.toolsets.length; ++i) { + if (typeof object.toolsets[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.toolsets: object expected"); + message.toolsets[i] = $root.google.cloud.ces.v1beta.Agent.AgentToolset.fromObject(object.toolsets[i]); + } + } + if (object.generatedSummary != null) + message.generatedSummary = String(object.generatedSummary); + if (object.transferRules) { + if (!Array.isArray(object.transferRules)) + throw TypeError(".google.cloud.ces.v1beta.Agent.transferRules: array expected"); + message.transferRules = []; + for (var i = 0; i < object.transferRules.length; ++i) { + if (typeof object.transferRules[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.transferRules: object expected"); + message.transferRules[i] = $root.google.cloud.ces.v1beta.TransferRule.fromObject(object.transferRules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Agent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Agent + * @static + * @param {google.cloud.ces.v1beta.Agent} message Agent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Agent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tools = []; + object.childAgents = []; + object.guardrails = []; + object.beforeAgentCallbacks = []; + object.afterAgentCallbacks = []; + object.beforeModelCallbacks = []; + object.afterModelCallbacks = []; + object.beforeToolCallbacks = []; + object.afterToolCallbacks = []; + object.toolsets = []; + object.transferRules = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.modelSettings = null; + object.instruction = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.generatedSummary = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) + object.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.toObject(message.modelSettings, options); + if (message.instruction != null && message.hasOwnProperty("instruction")) + object.instruction = message.instruction; + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = message.tools[j]; + } + if (message.childAgents && message.childAgents.length) { + object.childAgents = []; + for (var j = 0; j < message.childAgents.length; ++j) + object.childAgents[j] = message.childAgents[j]; + } + 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.guardrails && message.guardrails.length) { + object.guardrails = []; + for (var j = 0; j < message.guardrails.length; ++j) + object.guardrails[j] = message.guardrails[j]; + } + if (message.beforeAgentCallbacks && message.beforeAgentCallbacks.length) { + object.beforeAgentCallbacks = []; + for (var j = 0; j < message.beforeAgentCallbacks.length; ++j) + object.beforeAgentCallbacks[j] = $root.google.cloud.ces.v1beta.Callback.toObject(message.beforeAgentCallbacks[j], options); + } + if (message.afterAgentCallbacks && message.afterAgentCallbacks.length) { + object.afterAgentCallbacks = []; + for (var j = 0; j < message.afterAgentCallbacks.length; ++j) + object.afterAgentCallbacks[j] = $root.google.cloud.ces.v1beta.Callback.toObject(message.afterAgentCallbacks[j], options); + } + if (message.beforeModelCallbacks && message.beforeModelCallbacks.length) { + object.beforeModelCallbacks = []; + for (var j = 0; j < message.beforeModelCallbacks.length; ++j) + object.beforeModelCallbacks[j] = $root.google.cloud.ces.v1beta.Callback.toObject(message.beforeModelCallbacks[j], options); + } + if (message.afterModelCallbacks && message.afterModelCallbacks.length) { + object.afterModelCallbacks = []; + for (var j = 0; j < message.afterModelCallbacks.length; ++j) + object.afterModelCallbacks[j] = $root.google.cloud.ces.v1beta.Callback.toObject(message.afterModelCallbacks[j], options); + } + if (message.beforeToolCallbacks && message.beforeToolCallbacks.length) { + object.beforeToolCallbacks = []; + for (var j = 0; j < message.beforeToolCallbacks.length; ++j) + object.beforeToolCallbacks[j] = $root.google.cloud.ces.v1beta.Callback.toObject(message.beforeToolCallbacks[j], options); + } + if (message.afterToolCallbacks && message.afterToolCallbacks.length) { + object.afterToolCallbacks = []; + for (var j = 0; j < message.afterToolCallbacks.length; ++j) + object.afterToolCallbacks[j] = $root.google.cloud.ces.v1beta.Callback.toObject(message.afterToolCallbacks[j], options); + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.llmAgent != null && message.hasOwnProperty("llmAgent")) { + object.llmAgent = $root.google.cloud.ces.v1beta.Agent.LlmAgent.toObject(message.llmAgent, options); + if (options.oneofs) + object.agentType = "llmAgent"; + } + if (message.remoteDialogflowAgent != null && message.hasOwnProperty("remoteDialogflowAgent")) { + object.remoteDialogflowAgent = $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.toObject(message.remoteDialogflowAgent, options); + if (options.oneofs) + object.agentType = "remoteDialogflowAgent"; + } + if (message.toolsets && message.toolsets.length) { + object.toolsets = []; + for (var j = 0; j < message.toolsets.length; ++j) + object.toolsets[j] = $root.google.cloud.ces.v1beta.Agent.AgentToolset.toObject(message.toolsets[j], options); + } + if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) + object.generatedSummary = message.generatedSummary; + if (message.transferRules && message.transferRules.length) { + object.transferRules = []; + for (var j = 0; j < message.transferRules.length; ++j) + object.transferRules[j] = $root.google.cloud.ces.v1beta.TransferRule.toObject(message.transferRules[j], options); + } + return object; + }; + + /** + * Converts this Agent to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Agent + * @instance + * @returns {Object.} JSON object + */ + Agent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Agent + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Agent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Agent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Agent"; + }; + + Agent.LlmAgent = (function() { + + /** + * Properties of a LlmAgent. + * @memberof google.cloud.ces.v1beta.Agent + * @interface ILlmAgent + */ + + /** + * Constructs a new LlmAgent. + * @memberof google.cloud.ces.v1beta.Agent + * @classdesc Represents a LlmAgent. + * @implements ILlmAgent + * @constructor + * @param {google.cloud.ces.v1beta.Agent.ILlmAgent=} [properties] Properties to set + */ + function LlmAgent(properties) { + if (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 LlmAgent instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @static + * @param {google.cloud.ces.v1beta.Agent.ILlmAgent=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Agent.LlmAgent} LlmAgent instance + */ + LlmAgent.create = function create(properties) { + return new LlmAgent(properties); + }; + + /** + * Encodes the specified LlmAgent message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.LlmAgent.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @static + * @param {google.cloud.ces.v1beta.Agent.ILlmAgent} message LlmAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmAgent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified LlmAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.LlmAgent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @static + * @param {google.cloud.ces.v1beta.Agent.ILlmAgent} message LlmAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmAgent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LlmAgent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Agent.LlmAgent} LlmAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmAgent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Agent.LlmAgent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LlmAgent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Agent.LlmAgent} LlmAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmAgent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LlmAgent message. + * @function verify + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LlmAgent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a LlmAgent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Agent.LlmAgent} LlmAgent + */ + LlmAgent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Agent.LlmAgent) + return object; + return new $root.google.cloud.ces.v1beta.Agent.LlmAgent(); + }; + + /** + * Creates a plain object from a LlmAgent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @static + * @param {google.cloud.ces.v1beta.Agent.LlmAgent} message LlmAgent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LlmAgent.toObject = function toObject() { + return {}; + }; + + /** + * Converts this LlmAgent to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @instance + * @returns {Object.} JSON object + */ + LlmAgent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LlmAgent + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Agent.LlmAgent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LlmAgent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Agent.LlmAgent"; + }; + + return LlmAgent; + })(); + + Agent.RemoteDialogflowAgent = (function() { + + /** + * Properties of a RemoteDialogflowAgent. + * @memberof google.cloud.ces.v1beta.Agent + * @interface IRemoteDialogflowAgent + * @property {string|null} [agent] RemoteDialogflowAgent agent + * @property {string|null} [flowId] RemoteDialogflowAgent flowId + * @property {string|null} [environmentId] RemoteDialogflowAgent environmentId + * @property {Object.|null} [inputVariableMapping] RemoteDialogflowAgent inputVariableMapping + * @property {Object.|null} [outputVariableMapping] RemoteDialogflowAgent outputVariableMapping + * @property {boolean|null} [respectResponseInterruptionSettings] RemoteDialogflowAgent respectResponseInterruptionSettings + */ + + /** + * Constructs a new RemoteDialogflowAgent. + * @memberof google.cloud.ces.v1beta.Agent + * @classdesc Represents a RemoteDialogflowAgent. + * @implements IRemoteDialogflowAgent + * @constructor + * @param {google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent=} [properties] Properties to set + */ + function RemoteDialogflowAgent(properties) { + this.inputVariableMapping = {}; + this.outputVariableMapping = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoteDialogflowAgent agent. + * @member {string} agent + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @instance + */ + RemoteDialogflowAgent.prototype.agent = ""; + + /** + * RemoteDialogflowAgent flowId. + * @member {string} flowId + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @instance + */ + RemoteDialogflowAgent.prototype.flowId = ""; + + /** + * RemoteDialogflowAgent environmentId. + * @member {string} environmentId + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @instance + */ + RemoteDialogflowAgent.prototype.environmentId = ""; + + /** + * RemoteDialogflowAgent inputVariableMapping. + * @member {Object.} inputVariableMapping + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @instance + */ + RemoteDialogflowAgent.prototype.inputVariableMapping = $util.emptyObject; + + /** + * RemoteDialogflowAgent outputVariableMapping. + * @member {Object.} outputVariableMapping + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @instance + */ + RemoteDialogflowAgent.prototype.outputVariableMapping = $util.emptyObject; + + /** + * RemoteDialogflowAgent respectResponseInterruptionSettings. + * @member {boolean} respectResponseInterruptionSettings + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @instance + */ + RemoteDialogflowAgent.prototype.respectResponseInterruptionSettings = false; + + /** + * Creates a new RemoteDialogflowAgent instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @static + * @param {google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent instance + */ + RemoteDialogflowAgent.create = function create(properties) { + return new RemoteDialogflowAgent(properties); + }; + + /** + * Encodes the specified RemoteDialogflowAgent message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @static + * @param {google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent} message RemoteDialogflowAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoteDialogflowAgent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.agent); + if (message.flowId != null && Object.hasOwnProperty.call(message, "flowId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flowId); + if (message.environmentId != null && Object.hasOwnProperty.call(message, "environmentId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.environmentId); + if (message.inputVariableMapping != null && Object.hasOwnProperty.call(message, "inputVariableMapping")) + for (var keys = Object.keys(message.inputVariableMapping), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.inputVariableMapping[keys[i]]).ldelim(); + if (message.outputVariableMapping != null && Object.hasOwnProperty.call(message, "outputVariableMapping")) + for (var keys = Object.keys(message.outputVariableMapping), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.outputVariableMapping[keys[i]]).ldelim(); + if (message.respectResponseInterruptionSettings != null && Object.hasOwnProperty.call(message, "respectResponseInterruptionSettings")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.respectResponseInterruptionSettings); + return writer; + }; + + /** + * Encodes the specified RemoteDialogflowAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @static + * @param {google.cloud.ces.v1beta.Agent.IRemoteDialogflowAgent} message RemoteDialogflowAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoteDialogflowAgent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoteDialogflowAgent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoteDialogflowAgent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.agent = reader.string(); + break; + } + case 2: { + message.flowId = reader.string(); + break; + } + case 3: { + message.environmentId = reader.string(); + break; + } + case 4: { + if (message.inputVariableMapping === $util.emptyObject) + message.inputVariableMapping = {}; + 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.inputVariableMapping[key] = value; + break; + } + case 5: { + if (message.outputVariableMapping === $util.emptyObject) + message.outputVariableMapping = {}; + 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.outputVariableMapping[key] = value; + break; + } + case 6: { + message.respectResponseInterruptionSettings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoteDialogflowAgent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoteDialogflowAgent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoteDialogflowAgent message. + * @function verify + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoteDialogflowAgent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agent != null && message.hasOwnProperty("agent")) + if (!$util.isString(message.agent)) + return "agent: string expected"; + if (message.flowId != null && message.hasOwnProperty("flowId")) + if (!$util.isString(message.flowId)) + return "flowId: string expected"; + if (message.environmentId != null && message.hasOwnProperty("environmentId")) + if (!$util.isString(message.environmentId)) + return "environmentId: string expected"; + if (message.inputVariableMapping != null && message.hasOwnProperty("inputVariableMapping")) { + if (!$util.isObject(message.inputVariableMapping)) + return "inputVariableMapping: object expected"; + var key = Object.keys(message.inputVariableMapping); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.inputVariableMapping[key[i]])) + return "inputVariableMapping: string{k:string} expected"; + } + if (message.outputVariableMapping != null && message.hasOwnProperty("outputVariableMapping")) { + if (!$util.isObject(message.outputVariableMapping)) + return "outputVariableMapping: object expected"; + var key = Object.keys(message.outputVariableMapping); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.outputVariableMapping[key[i]])) + return "outputVariableMapping: string{k:string} expected"; + } + if (message.respectResponseInterruptionSettings != null && message.hasOwnProperty("respectResponseInterruptionSettings")) + if (typeof message.respectResponseInterruptionSettings !== "boolean") + return "respectResponseInterruptionSettings: boolean expected"; + return null; + }; + + /** + * Creates a RemoteDialogflowAgent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent} RemoteDialogflowAgent + */ + RemoteDialogflowAgent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent) + return object; + var message = new $root.google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent(); + if (object.agent != null) + message.agent = String(object.agent); + if (object.flowId != null) + message.flowId = String(object.flowId); + if (object.environmentId != null) + message.environmentId = String(object.environmentId); + if (object.inputVariableMapping) { + if (typeof object.inputVariableMapping !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.inputVariableMapping: object expected"); + message.inputVariableMapping = {}; + for (var keys = Object.keys(object.inputVariableMapping), i = 0; i < keys.length; ++i) + message.inputVariableMapping[keys[i]] = String(object.inputVariableMapping[keys[i]]); + } + if (object.outputVariableMapping) { + if (typeof object.outputVariableMapping !== "object") + throw TypeError(".google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent.outputVariableMapping: object expected"); + message.outputVariableMapping = {}; + for (var keys = Object.keys(object.outputVariableMapping), i = 0; i < keys.length; ++i) + message.outputVariableMapping[keys[i]] = String(object.outputVariableMapping[keys[i]]); + } + if (object.respectResponseInterruptionSettings != null) + message.respectResponseInterruptionSettings = Boolean(object.respectResponseInterruptionSettings); + return message; + }; + + /** + * Creates a plain object from a RemoteDialogflowAgent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @static + * @param {google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent} message RemoteDialogflowAgent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoteDialogflowAgent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.inputVariableMapping = {}; + object.outputVariableMapping = {}; + } + if (options.defaults) { + object.agent = ""; + object.flowId = ""; + object.environmentId = ""; + object.respectResponseInterruptionSettings = false; + } + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = message.agent; + if (message.flowId != null && message.hasOwnProperty("flowId")) + object.flowId = message.flowId; + if (message.environmentId != null && message.hasOwnProperty("environmentId")) + object.environmentId = message.environmentId; + var keys2; + if (message.inputVariableMapping && (keys2 = Object.keys(message.inputVariableMapping)).length) { + object.inputVariableMapping = {}; + for (var j = 0; j < keys2.length; ++j) + object.inputVariableMapping[keys2[j]] = message.inputVariableMapping[keys2[j]]; + } + if (message.outputVariableMapping && (keys2 = Object.keys(message.outputVariableMapping)).length) { + object.outputVariableMapping = {}; + for (var j = 0; j < keys2.length; ++j) + object.outputVariableMapping[keys2[j]] = message.outputVariableMapping[keys2[j]]; + } + if (message.respectResponseInterruptionSettings != null && message.hasOwnProperty("respectResponseInterruptionSettings")) + object.respectResponseInterruptionSettings = message.respectResponseInterruptionSettings; + return object; + }; + + /** + * Converts this RemoteDialogflowAgent to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @instance + * @returns {Object.} JSON object + */ + RemoteDialogflowAgent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemoteDialogflowAgent + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoteDialogflowAgent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Agent.RemoteDialogflowAgent"; + }; + + return RemoteDialogflowAgent; + })(); + + Agent.AgentToolset = (function() { + + /** + * Properties of an AgentToolset. + * @memberof google.cloud.ces.v1beta.Agent + * @interface IAgentToolset + * @property {string|null} [toolset] AgentToolset toolset + * @property {Array.|null} [toolIds] AgentToolset toolIds + */ + + /** + * Constructs a new AgentToolset. + * @memberof google.cloud.ces.v1beta.Agent + * @classdesc Represents an AgentToolset. + * @implements IAgentToolset + * @constructor + * @param {google.cloud.ces.v1beta.Agent.IAgentToolset=} [properties] Properties to set + */ + function AgentToolset(properties) { + this.toolIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AgentToolset toolset. + * @member {string} toolset + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @instance + */ + AgentToolset.prototype.toolset = ""; + + /** + * AgentToolset toolIds. + * @member {Array.} toolIds + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @instance + */ + AgentToolset.prototype.toolIds = $util.emptyArray; + + /** + * Creates a new AgentToolset instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @static + * @param {google.cloud.ces.v1beta.Agent.IAgentToolset=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Agent.AgentToolset} AgentToolset instance + */ + AgentToolset.create = function create(properties) { + return new AgentToolset(properties); + }; + + /** + * Encodes the specified AgentToolset message. Does not implicitly {@link google.cloud.ces.v1beta.Agent.AgentToolset.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @static + * @param {google.cloud.ces.v1beta.Agent.IAgentToolset} message AgentToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentToolset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.toolset); + if (message.toolIds != null && message.toolIds.length) + for (var i = 0; i < message.toolIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.toolIds[i]); + return writer; + }; + + /** + * Encodes the specified AgentToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Agent.AgentToolset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @static + * @param {google.cloud.ces.v1beta.Agent.IAgentToolset} message AgentToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentToolset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AgentToolset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Agent.AgentToolset} AgentToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentToolset.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Agent.AgentToolset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolset = reader.string(); + break; + } + case 4: { + if (!(message.toolIds && message.toolIds.length)) + message.toolIds = []; + message.toolIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AgentToolset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Agent.AgentToolset} AgentToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentToolset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AgentToolset message. + * @function verify + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AgentToolset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolset != null && message.hasOwnProperty("toolset")) + if (!$util.isString(message.toolset)) + return "toolset: string expected"; + if (message.toolIds != null && message.hasOwnProperty("toolIds")) { + if (!Array.isArray(message.toolIds)) + return "toolIds: array expected"; + for (var i = 0; i < message.toolIds.length; ++i) + if (!$util.isString(message.toolIds[i])) + return "toolIds: string[] expected"; + } + return null; + }; + + /** + * Creates an AgentToolset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Agent.AgentToolset} AgentToolset + */ + AgentToolset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Agent.AgentToolset) + return object; + var message = new $root.google.cloud.ces.v1beta.Agent.AgentToolset(); + if (object.toolset != null) + message.toolset = String(object.toolset); + if (object.toolIds) { + if (!Array.isArray(object.toolIds)) + throw TypeError(".google.cloud.ces.v1beta.Agent.AgentToolset.toolIds: array expected"); + message.toolIds = []; + for (var i = 0; i < object.toolIds.length; ++i) + message.toolIds[i] = String(object.toolIds[i]); + } + return message; + }; + + /** + * Creates a plain object from an AgentToolset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @static + * @param {google.cloud.ces.v1beta.Agent.AgentToolset} message AgentToolset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AgentToolset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.toolIds = []; + if (options.defaults) + object.toolset = ""; + if (message.toolset != null && message.hasOwnProperty("toolset")) + object.toolset = message.toolset; + if (message.toolIds && message.toolIds.length) { + object.toolIds = []; + for (var j = 0; j < message.toolIds.length; ++j) + object.toolIds[j] = message.toolIds[j]; + } + return object; + }; + + /** + * Converts this AgentToolset to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @instance + * @returns {Object.} JSON object + */ + AgentToolset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AgentToolset + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Agent.AgentToolset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AgentToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Agent.AgentToolset"; + }; + + return AgentToolset; + })(); + + return Agent; + })(); + + v1beta.ExpressionCondition = (function() { + + /** + * Properties of an ExpressionCondition. + * @memberof google.cloud.ces.v1beta + * @interface IExpressionCondition + * @property {string|null} [expression] ExpressionCondition expression + */ + + /** + * Constructs a new ExpressionCondition. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ExpressionCondition. + * @implements IExpressionCondition + * @constructor + * @param {google.cloud.ces.v1beta.IExpressionCondition=} [properties] Properties to set + */ + function ExpressionCondition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExpressionCondition expression. + * @member {string} expression + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @instance + */ + ExpressionCondition.prototype.expression = ""; + + /** + * Creates a new ExpressionCondition instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @static + * @param {google.cloud.ces.v1beta.IExpressionCondition=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ExpressionCondition} ExpressionCondition instance + */ + ExpressionCondition.create = function create(properties) { + return new ExpressionCondition(properties); + }; + + /** + * Encodes the specified ExpressionCondition message. Does not implicitly {@link google.cloud.ces.v1beta.ExpressionCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @static + * @param {google.cloud.ces.v1beta.IExpressionCondition} message ExpressionCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpressionCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + return writer; + }; + + /** + * Encodes the specified ExpressionCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExpressionCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @static + * @param {google.cloud.ces.v1beta.IExpressionCondition} message ExpressionCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpressionCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExpressionCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ExpressionCondition} ExpressionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpressionCondition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ExpressionCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExpressionCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ExpressionCondition} ExpressionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpressionCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExpressionCondition message. + * @function verify + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExpressionCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + return null; + }; + + /** + * Creates an ExpressionCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ExpressionCondition} ExpressionCondition + */ + ExpressionCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ExpressionCondition) + return object; + var message = new $root.google.cloud.ces.v1beta.ExpressionCondition(); + if (object.expression != null) + message.expression = String(object.expression); + return message; + }; + + /** + * Creates a plain object from an ExpressionCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @static + * @param {google.cloud.ces.v1beta.ExpressionCondition} message ExpressionCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExpressionCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.expression = ""; + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + return object; + }; + + /** + * Converts this ExpressionCondition to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @instance + * @returns {Object.} JSON object + */ + ExpressionCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExpressionCondition + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ExpressionCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExpressionCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ExpressionCondition"; + }; + + return ExpressionCondition; + })(); + + v1beta.PythonCodeCondition = (function() { + + /** + * Properties of a PythonCodeCondition. + * @memberof google.cloud.ces.v1beta + * @interface IPythonCodeCondition + * @property {string|null} [pythonCode] PythonCodeCondition pythonCode + */ + + /** + * Constructs a new PythonCodeCondition. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a PythonCodeCondition. + * @implements IPythonCodeCondition + * @constructor + * @param {google.cloud.ces.v1beta.IPythonCodeCondition=} [properties] Properties to set + */ + function PythonCodeCondition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonCodeCondition pythonCode. + * @member {string} pythonCode + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @instance + */ + PythonCodeCondition.prototype.pythonCode = ""; + + /** + * Creates a new PythonCodeCondition instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @static + * @param {google.cloud.ces.v1beta.IPythonCodeCondition=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.PythonCodeCondition} PythonCodeCondition instance + */ + PythonCodeCondition.create = function create(properties) { + return new PythonCodeCondition(properties); + }; + + /** + * Encodes the specified PythonCodeCondition message. Does not implicitly {@link google.cloud.ces.v1beta.PythonCodeCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @static + * @param {google.cloud.ces.v1beta.IPythonCodeCondition} message PythonCodeCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonCodeCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pythonCode); + return writer; + }; + + /** + * Encodes the specified PythonCodeCondition message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.PythonCodeCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @static + * @param {google.cloud.ces.v1beta.IPythonCodeCondition} message PythonCodeCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonCodeCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonCodeCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.PythonCodeCondition} PythonCodeCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonCodeCondition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.PythonCodeCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pythonCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonCodeCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.PythonCodeCondition} PythonCodeCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonCodeCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonCodeCondition message. + * @function verify + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonCodeCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) + if (!$util.isString(message.pythonCode)) + return "pythonCode: string expected"; + return null; + }; + + /** + * Creates a PythonCodeCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.PythonCodeCondition} PythonCodeCondition + */ + PythonCodeCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.PythonCodeCondition) + return object; + var message = new $root.google.cloud.ces.v1beta.PythonCodeCondition(); + if (object.pythonCode != null) + message.pythonCode = String(object.pythonCode); + return message; + }; + + /** + * Creates a plain object from a PythonCodeCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @static + * @param {google.cloud.ces.v1beta.PythonCodeCondition} message PythonCodeCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonCodeCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.pythonCode = ""; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) + object.pythonCode = message.pythonCode; + return object; + }; + + /** + * Converts this PythonCodeCondition to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @instance + * @returns {Object.} JSON object + */ + PythonCodeCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonCodeCondition + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.PythonCodeCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonCodeCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.PythonCodeCondition"; + }; + + return PythonCodeCondition; + })(); + + v1beta.TransferRule = (function() { + + /** + * Properties of a TransferRule. + * @memberof google.cloud.ces.v1beta + * @interface ITransferRule + * @property {google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer|null} [deterministicTransfer] TransferRule deterministicTransfer + * @property {google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer|null} [disablePlannerTransfer] TransferRule disablePlannerTransfer + * @property {string|null} [childAgent] TransferRule childAgent + * @property {google.cloud.ces.v1beta.TransferRule.Direction|null} [direction] TransferRule direction + */ + + /** + * Constructs a new TransferRule. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a TransferRule. + * @implements ITransferRule + * @constructor + * @param {google.cloud.ces.v1beta.ITransferRule=} [properties] Properties to set + */ + function TransferRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferRule deterministicTransfer. + * @member {google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer|null|undefined} deterministicTransfer + * @memberof google.cloud.ces.v1beta.TransferRule + * @instance + */ + TransferRule.prototype.deterministicTransfer = null; + + /** + * TransferRule disablePlannerTransfer. + * @member {google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer|null|undefined} disablePlannerTransfer + * @memberof google.cloud.ces.v1beta.TransferRule + * @instance + */ + TransferRule.prototype.disablePlannerTransfer = null; + + /** + * TransferRule childAgent. + * @member {string} childAgent + * @memberof google.cloud.ces.v1beta.TransferRule + * @instance + */ + TransferRule.prototype.childAgent = ""; + + /** + * TransferRule direction. + * @member {google.cloud.ces.v1beta.TransferRule.Direction} direction + * @memberof google.cloud.ces.v1beta.TransferRule + * @instance + */ + TransferRule.prototype.direction = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransferRule ruleType. + * @member {"deterministicTransfer"|"disablePlannerTransfer"|undefined} ruleType + * @memberof google.cloud.ces.v1beta.TransferRule + * @instance + */ + Object.defineProperty(TransferRule.prototype, "ruleType", { + get: $util.oneOfGetter($oneOfFields = ["deterministicTransfer", "disablePlannerTransfer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransferRule instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TransferRule + * @static + * @param {google.cloud.ces.v1beta.ITransferRule=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TransferRule} TransferRule instance + */ + TransferRule.create = function create(properties) { + return new TransferRule(properties); + }; + + /** + * Encodes the specified TransferRule message. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TransferRule + * @static + * @param {google.cloud.ces.v1beta.ITransferRule} message TransferRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.childAgent != null && Object.hasOwnProperty.call(message, "childAgent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.childAgent); + if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.direction); + if (message.deterministicTransfer != null && Object.hasOwnProperty.call(message, "deterministicTransfer")) + $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.encode(message.deterministicTransfer, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.disablePlannerTransfer != null && Object.hasOwnProperty.call(message, "disablePlannerTransfer")) + $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.encode(message.disablePlannerTransfer, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransferRule message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TransferRule + * @static + * @param {google.cloud.ces.v1beta.ITransferRule} message TransferRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TransferRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TransferRule} TransferRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TransferRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.deterministicTransfer = $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.decode(reader, reader.uint32()); + break; + } + case 4: { + message.disablePlannerTransfer = $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.decode(reader, reader.uint32()); + break; + } + case 1: { + message.childAgent = reader.string(); + break; + } + case 2: { + message.direction = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TransferRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TransferRule} TransferRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferRule message. + * @function verify + * @memberof google.cloud.ces.v1beta.TransferRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.deterministicTransfer != null && message.hasOwnProperty("deterministicTransfer")) { + properties.ruleType = 1; + { + var error = $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.verify(message.deterministicTransfer); + if (error) + return "deterministicTransfer." + error; + } + } + if (message.disablePlannerTransfer != null && message.hasOwnProperty("disablePlannerTransfer")) { + if (properties.ruleType === 1) + return "ruleType: multiple values"; + properties.ruleType = 1; + { + var error = $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.verify(message.disablePlannerTransfer); + if (error) + return "disablePlannerTransfer." + error; + } + } + if (message.childAgent != null && message.hasOwnProperty("childAgent")) + if (!$util.isString(message.childAgent)) + return "childAgent: string expected"; + if (message.direction != null && message.hasOwnProperty("direction")) + switch (message.direction) { + default: + return "direction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TransferRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TransferRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TransferRule} TransferRule + */ + TransferRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TransferRule) + return object; + var message = new $root.google.cloud.ces.v1beta.TransferRule(); + if (object.deterministicTransfer != null) { + if (typeof object.deterministicTransfer !== "object") + throw TypeError(".google.cloud.ces.v1beta.TransferRule.deterministicTransfer: object expected"); + message.deterministicTransfer = $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.fromObject(object.deterministicTransfer); + } + if (object.disablePlannerTransfer != null) { + if (typeof object.disablePlannerTransfer !== "object") + throw TypeError(".google.cloud.ces.v1beta.TransferRule.disablePlannerTransfer: object expected"); + message.disablePlannerTransfer = $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.fromObject(object.disablePlannerTransfer); + } + if (object.childAgent != null) + message.childAgent = String(object.childAgent); + switch (object.direction) { + default: + if (typeof object.direction === "number") { + message.direction = object.direction; + break; + } + break; + case "DIRECTION_UNSPECIFIED": + case 0: + message.direction = 0; + break; + case "PARENT_TO_CHILD": + case 1: + message.direction = 1; + break; + case "CHILD_TO_PARENT": + case 2: + message.direction = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TransferRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TransferRule + * @static + * @param {google.cloud.ces.v1beta.TransferRule} message TransferRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.childAgent = ""; + object.direction = options.enums === String ? "DIRECTION_UNSPECIFIED" : 0; + } + if (message.childAgent != null && message.hasOwnProperty("childAgent")) + object.childAgent = message.childAgent; + if (message.direction != null && message.hasOwnProperty("direction")) + object.direction = options.enums === String ? $root.google.cloud.ces.v1beta.TransferRule.Direction[message.direction] === undefined ? message.direction : $root.google.cloud.ces.v1beta.TransferRule.Direction[message.direction] : message.direction; + if (message.deterministicTransfer != null && message.hasOwnProperty("deterministicTransfer")) { + object.deterministicTransfer = $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.toObject(message.deterministicTransfer, options); + if (options.oneofs) + object.ruleType = "deterministicTransfer"; + } + if (message.disablePlannerTransfer != null && message.hasOwnProperty("disablePlannerTransfer")) { + object.disablePlannerTransfer = $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.toObject(message.disablePlannerTransfer, options); + if (options.oneofs) + object.ruleType = "disablePlannerTransfer"; + } + return object; + }; + + /** + * Converts this TransferRule to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TransferRule + * @instance + * @returns {Object.} JSON object + */ + TransferRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferRule + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TransferRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TransferRule"; + }; + + TransferRule.DeterministicTransfer = (function() { + + /** + * Properties of a DeterministicTransfer. + * @memberof google.cloud.ces.v1beta.TransferRule + * @interface IDeterministicTransfer + * @property {google.cloud.ces.v1beta.IExpressionCondition|null} [expressionCondition] DeterministicTransfer expressionCondition + * @property {google.cloud.ces.v1beta.IPythonCodeCondition|null} [pythonCodeCondition] DeterministicTransfer pythonCodeCondition + */ + + /** + * Constructs a new DeterministicTransfer. + * @memberof google.cloud.ces.v1beta.TransferRule + * @classdesc Represents a DeterministicTransfer. + * @implements IDeterministicTransfer + * @constructor + * @param {google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer=} [properties] Properties to set + */ + function DeterministicTransfer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeterministicTransfer expressionCondition. + * @member {google.cloud.ces.v1beta.IExpressionCondition|null|undefined} expressionCondition + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @instance + */ + DeterministicTransfer.prototype.expressionCondition = null; + + /** + * DeterministicTransfer pythonCodeCondition. + * @member {google.cloud.ces.v1beta.IPythonCodeCondition|null|undefined} pythonCodeCondition + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @instance + */ + DeterministicTransfer.prototype.pythonCodeCondition = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeterministicTransfer conditionType. + * @member {"expressionCondition"|"pythonCodeCondition"|undefined} conditionType + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @instance + */ + Object.defineProperty(DeterministicTransfer.prototype, "conditionType", { + get: $util.oneOfGetter($oneOfFields = ["expressionCondition", "pythonCodeCondition"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeterministicTransfer instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @static + * @param {google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TransferRule.DeterministicTransfer} DeterministicTransfer instance + */ + DeterministicTransfer.create = function create(properties) { + return new DeterministicTransfer(properties); + }; + + /** + * Encodes the specified DeterministicTransfer message. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @static + * @param {google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer} message DeterministicTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeterministicTransfer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expressionCondition != null && Object.hasOwnProperty.call(message, "expressionCondition")) + $root.google.cloud.ces.v1beta.ExpressionCondition.encode(message.expressionCondition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pythonCodeCondition != null && Object.hasOwnProperty.call(message, "pythonCodeCondition")) + $root.google.cloud.ces.v1beta.PythonCodeCondition.encode(message.pythonCodeCondition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeterministicTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @static + * @param {google.cloud.ces.v1beta.TransferRule.IDeterministicTransfer} message DeterministicTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeterministicTransfer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeterministicTransfer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TransferRule.DeterministicTransfer} DeterministicTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeterministicTransfer.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expressionCondition = $root.google.cloud.ces.v1beta.ExpressionCondition.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pythonCodeCondition = $root.google.cloud.ces.v1beta.PythonCodeCondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeterministicTransfer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TransferRule.DeterministicTransfer} DeterministicTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeterministicTransfer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeterministicTransfer message. + * @function verify + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeterministicTransfer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) { + properties.conditionType = 1; + { + var error = $root.google.cloud.ces.v1beta.ExpressionCondition.verify(message.expressionCondition); + if (error) + return "expressionCondition." + error; + } + } + if (message.pythonCodeCondition != null && message.hasOwnProperty("pythonCodeCondition")) { + if (properties.conditionType === 1) + return "conditionType: multiple values"; + properties.conditionType = 1; + { + var error = $root.google.cloud.ces.v1beta.PythonCodeCondition.verify(message.pythonCodeCondition); + if (error) + return "pythonCodeCondition." + error; + } + } + return null; + }; + + /** + * Creates a DeterministicTransfer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TransferRule.DeterministicTransfer} DeterministicTransfer + */ + DeterministicTransfer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer) + return object; + var message = new $root.google.cloud.ces.v1beta.TransferRule.DeterministicTransfer(); + if (object.expressionCondition != null) { + if (typeof object.expressionCondition !== "object") + throw TypeError(".google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.expressionCondition: object expected"); + message.expressionCondition = $root.google.cloud.ces.v1beta.ExpressionCondition.fromObject(object.expressionCondition); + } + if (object.pythonCodeCondition != null) { + if (typeof object.pythonCodeCondition !== "object") + throw TypeError(".google.cloud.ces.v1beta.TransferRule.DeterministicTransfer.pythonCodeCondition: object expected"); + message.pythonCodeCondition = $root.google.cloud.ces.v1beta.PythonCodeCondition.fromObject(object.pythonCodeCondition); + } + return message; + }; + + /** + * Creates a plain object from a DeterministicTransfer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @static + * @param {google.cloud.ces.v1beta.TransferRule.DeterministicTransfer} message DeterministicTransfer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeterministicTransfer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) { + object.expressionCondition = $root.google.cloud.ces.v1beta.ExpressionCondition.toObject(message.expressionCondition, options); + if (options.oneofs) + object.conditionType = "expressionCondition"; + } + if (message.pythonCodeCondition != null && message.hasOwnProperty("pythonCodeCondition")) { + object.pythonCodeCondition = $root.google.cloud.ces.v1beta.PythonCodeCondition.toObject(message.pythonCodeCondition, options); + if (options.oneofs) + object.conditionType = "pythonCodeCondition"; + } + return object; + }; + + /** + * Converts this DeterministicTransfer to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @instance + * @returns {Object.} JSON object + */ + DeterministicTransfer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeterministicTransfer + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TransferRule.DeterministicTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeterministicTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TransferRule.DeterministicTransfer"; + }; + + return DeterministicTransfer; + })(); + + TransferRule.DisablePlannerTransfer = (function() { + + /** + * Properties of a DisablePlannerTransfer. + * @memberof google.cloud.ces.v1beta.TransferRule + * @interface IDisablePlannerTransfer + * @property {google.cloud.ces.v1beta.IExpressionCondition|null} [expressionCondition] DisablePlannerTransfer expressionCondition + */ + + /** + * Constructs a new DisablePlannerTransfer. + * @memberof google.cloud.ces.v1beta.TransferRule + * @classdesc Represents a DisablePlannerTransfer. + * @implements IDisablePlannerTransfer + * @constructor + * @param {google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer=} [properties] Properties to set + */ + function DisablePlannerTransfer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisablePlannerTransfer expressionCondition. + * @member {google.cloud.ces.v1beta.IExpressionCondition|null|undefined} expressionCondition + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @instance + */ + DisablePlannerTransfer.prototype.expressionCondition = null; + + /** + * Creates a new DisablePlannerTransfer instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @static + * @param {google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer instance + */ + DisablePlannerTransfer.create = function create(properties) { + return new DisablePlannerTransfer(properties); + }; + + /** + * Encodes the specified DisablePlannerTransfer message. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @static + * @param {google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer} message DisablePlannerTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisablePlannerTransfer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expressionCondition != null && Object.hasOwnProperty.call(message, "expressionCondition")) + $root.google.cloud.ces.v1beta.ExpressionCondition.encode(message.expressionCondition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DisablePlannerTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @static + * @param {google.cloud.ces.v1beta.TransferRule.IDisablePlannerTransfer} message DisablePlannerTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisablePlannerTransfer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisablePlannerTransfer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisablePlannerTransfer.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expressionCondition = $root.google.cloud.ces.v1beta.ExpressionCondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisablePlannerTransfer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisablePlannerTransfer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisablePlannerTransfer message. + * @function verify + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisablePlannerTransfer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) { + var error = $root.google.cloud.ces.v1beta.ExpressionCondition.verify(message.expressionCondition); + if (error) + return "expressionCondition." + error; + } + return null; + }; + + /** + * Creates a DisablePlannerTransfer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer} DisablePlannerTransfer + */ + DisablePlannerTransfer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer) + return object; + var message = new $root.google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer(); + if (object.expressionCondition != null) { + if (typeof object.expressionCondition !== "object") + throw TypeError(".google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer.expressionCondition: object expected"); + message.expressionCondition = $root.google.cloud.ces.v1beta.ExpressionCondition.fromObject(object.expressionCondition); + } + return message; + }; + + /** + * Creates a plain object from a DisablePlannerTransfer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @static + * @param {google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer} message DisablePlannerTransfer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisablePlannerTransfer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.expressionCondition = null; + if (message.expressionCondition != null && message.hasOwnProperty("expressionCondition")) + object.expressionCondition = $root.google.cloud.ces.v1beta.ExpressionCondition.toObject(message.expressionCondition, options); + return object; + }; + + /** + * Converts this DisablePlannerTransfer to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @instance + * @returns {Object.} JSON object + */ + DisablePlannerTransfer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisablePlannerTransfer + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisablePlannerTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TransferRule.DisablePlannerTransfer"; + }; + + return DisablePlannerTransfer; + })(); + + /** + * Direction enum. + * @name google.cloud.ces.v1beta.TransferRule.Direction + * @enum {number} + * @property {number} DIRECTION_UNSPECIFIED=0 DIRECTION_UNSPECIFIED value + * @property {number} PARENT_TO_CHILD=1 PARENT_TO_CHILD value + * @property {number} CHILD_TO_PARENT=2 CHILD_TO_PARENT value + */ + TransferRule.Direction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "PARENT_TO_CHILD"] = 1; + values[valuesById[2] = "CHILD_TO_PARENT"] = 2; + return values; + })(); + + return TransferRule; + })(); + + /** + * ExecutionType enum. + * @name google.cloud.ces.v1beta.ExecutionType + * @enum {number} + * @property {number} EXECUTION_TYPE_UNSPECIFIED=0 EXECUTION_TYPE_UNSPECIFIED value + * @property {number} SYNCHRONOUS=1 SYNCHRONOUS value + * @property {number} ASYNCHRONOUS=2 ASYNCHRONOUS value + */ + v1beta.ExecutionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXECUTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SYNCHRONOUS"] = 1; + values[valuesById[2] = "ASYNCHRONOUS"] = 2; + return values; + })(); + + v1beta.Callback = (function() { + + /** + * Properties of a Callback. + * @memberof google.cloud.ces.v1beta + * @interface ICallback + * @property {string|null} [pythonCode] Callback pythonCode + * @property {string|null} [description] Callback description + * @property {boolean|null} [disabled] Callback disabled + * @property {boolean|null} [proactiveExecutionEnabled] Callback proactiveExecutionEnabled + */ + + /** + * Constructs a new Callback. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Callback. + * @implements ICallback + * @constructor + * @param {google.cloud.ces.v1beta.ICallback=} [properties] Properties to set + */ + function Callback(properties) { + if (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 pythonCode. + * @member {string|null|undefined} pythonCode + * @memberof google.cloud.ces.v1beta.Callback + * @instance + */ + Callback.prototype.pythonCode = null; + + /** + * Callback description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.Callback + * @instance + */ + Callback.prototype.description = ""; + + /** + * Callback disabled. + * @member {boolean} disabled + * @memberof google.cloud.ces.v1beta.Callback + * @instance + */ + Callback.prototype.disabled = false; + + /** + * Callback proactiveExecutionEnabled. + * @member {boolean} proactiveExecutionEnabled + * @memberof google.cloud.ces.v1beta.Callback + * @instance + */ + Callback.prototype.proactiveExecutionEnabled = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Callback callback. + * @member {"pythonCode"|undefined} callback + * @memberof google.cloud.ces.v1beta.Callback + * @instance + */ + Object.defineProperty(Callback.prototype, "callback", { + get: $util.oneOfGetter($oneOfFields = ["pythonCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Callback instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Callback + * @static + * @param {google.cloud.ces.v1beta.ICallback=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Callback} Callback instance + */ + Callback.create = function create(properties) { + return new Callback(properties); + }; + + /** + * Encodes the specified Callback message. Does not implicitly {@link google.cloud.ces.v1beta.Callback.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Callback + * @static + * @param {google.cloud.ces.v1beta.ICallback} message Callback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Callback.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pythonCode); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.disabled); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.proactiveExecutionEnabled != null && Object.hasOwnProperty.call(message, "proactiveExecutionEnabled")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.proactiveExecutionEnabled); + return writer; + }; + + /** + * Encodes the specified Callback message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Callback.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Callback + * @static + * @param {google.cloud.ces.v1beta.ICallback} message Callback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Callback.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Callback message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Callback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Callback} Callback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Callback.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Callback(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pythonCode = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 2: { + message.disabled = reader.bool(); + break; + } + case 4: { + message.proactiveExecutionEnabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Callback message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Callback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Callback} Callback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Callback.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Callback message. + * @function verify + * @memberof google.cloud.ces.v1beta.Callback + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Callback.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) { + properties.callback = 1; + if (!$util.isString(message.pythonCode)) + return "pythonCode: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + if (message.proactiveExecutionEnabled != null && message.hasOwnProperty("proactiveExecutionEnabled")) + if (typeof message.proactiveExecutionEnabled !== "boolean") + return "proactiveExecutionEnabled: boolean expected"; + return null; + }; + + /** + * Creates a Callback message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Callback + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Callback} Callback + */ + Callback.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Callback) + return object; + var message = new $root.google.cloud.ces.v1beta.Callback(); + if (object.pythonCode != null) + message.pythonCode = String(object.pythonCode); + if (object.description != null) + message.description = String(object.description); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + if (object.proactiveExecutionEnabled != null) + message.proactiveExecutionEnabled = Boolean(object.proactiveExecutionEnabled); + return message; + }; + + /** + * Creates a plain object from a Callback message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Callback + * @static + * @param {google.cloud.ces.v1beta.Callback} message Callback + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Callback.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disabled = false; + object.description = ""; + object.proactiveExecutionEnabled = false; + } + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) { + object.pythonCode = message.pythonCode; + if (options.oneofs) + object.callback = "pythonCode"; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.proactiveExecutionEnabled != null && message.hasOwnProperty("proactiveExecutionEnabled")) + object.proactiveExecutionEnabled = message.proactiveExecutionEnabled; + return object; + }; + + /** + * Converts this Callback to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Callback + * @instance + * @returns {Object.} JSON object + */ + Callback.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Callback + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Callback + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Callback.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Callback"; + }; + + return Callback; + })(); + + v1beta.ModelSettings = (function() { + + /** + * Properties of a ModelSettings. + * @memberof google.cloud.ces.v1beta + * @interface IModelSettings + * @property {string|null} [model] ModelSettings model + * @property {number|null} [temperature] ModelSettings temperature + */ + + /** + * Constructs a new ModelSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ModelSettings. + * @implements IModelSettings + * @constructor + * @param {google.cloud.ces.v1beta.IModelSettings=} [properties] Properties to set + */ + function ModelSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelSettings model. + * @member {string} model + * @memberof google.cloud.ces.v1beta.ModelSettings + * @instance + */ + ModelSettings.prototype.model = ""; + + /** + * ModelSettings temperature. + * @member {number|null|undefined} temperature + * @memberof google.cloud.ces.v1beta.ModelSettings + * @instance + */ + ModelSettings.prototype.temperature = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ModelSettings.prototype, "_temperature", { + get: $util.oneOfGetter($oneOfFields = ["temperature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModelSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ModelSettings + * @static + * @param {google.cloud.ces.v1beta.IModelSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ModelSettings} ModelSettings instance + */ + ModelSettings.create = function create(properties) { + return new ModelSettings(properties); + }; + + /** + * Encodes the specified ModelSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ModelSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ModelSettings + * @static + * @param {google.cloud.ces.v1beta.IModelSettings} message ModelSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.temperature); + return writer; + }; + + /** + * Encodes the specified ModelSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ModelSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ModelSettings + * @static + * @param {google.cloud.ces.v1beta.IModelSettings} message ModelSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ModelSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ModelSettings} ModelSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ModelSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.temperature = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ModelSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ModelSettings} ModelSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.ModelSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.temperature != null && message.hasOwnProperty("temperature")) { + properties._temperature = 1; + if (typeof message.temperature !== "number") + return "temperature: number expected"; + } + return null; + }; + + /** + * Creates a ModelSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ModelSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ModelSettings} ModelSettings + */ + ModelSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ModelSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.ModelSettings(); + if (object.model != null) + message.model = String(object.model); + if (object.temperature != null) + message.temperature = Number(object.temperature); + return message; + }; + + /** + * Creates a plain object from a ModelSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ModelSettings + * @static + * @param {google.cloud.ces.v1beta.ModelSettings} message ModelSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.temperature != null && message.hasOwnProperty("temperature")) { + object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; + if (options.oneofs) + object._temperature = "temperature"; + } + return object; + }; + + /** + * Converts this ModelSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ModelSettings + * @instance + * @returns {Object.} JSON object + */ + ModelSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ModelSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ModelSettings"; + }; + + return ModelSettings; + })(); + + v1beta.TriggerAction = (function() { + + /** + * Properties of a TriggerAction. + * @memberof google.cloud.ces.v1beta + * @interface ITriggerAction + * @property {google.cloud.ces.v1beta.TriggerAction.IRespondImmediately|null} [respondImmediately] TriggerAction respondImmediately + * @property {google.cloud.ces.v1beta.TriggerAction.ITransferAgent|null} [transferAgent] TriggerAction transferAgent + * @property {google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer|null} [generativeAnswer] TriggerAction generativeAnswer + */ + + /** + * Constructs a new TriggerAction. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a TriggerAction. + * @implements ITriggerAction + * @constructor + * @param {google.cloud.ces.v1beta.ITriggerAction=} [properties] Properties to set + */ + function TriggerAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TriggerAction respondImmediately. + * @member {google.cloud.ces.v1beta.TriggerAction.IRespondImmediately|null|undefined} respondImmediately + * @memberof google.cloud.ces.v1beta.TriggerAction + * @instance + */ + TriggerAction.prototype.respondImmediately = null; + + /** + * TriggerAction transferAgent. + * @member {google.cloud.ces.v1beta.TriggerAction.ITransferAgent|null|undefined} transferAgent + * @memberof google.cloud.ces.v1beta.TriggerAction + * @instance + */ + TriggerAction.prototype.transferAgent = null; + + /** + * TriggerAction generativeAnswer. + * @member {google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer|null|undefined} generativeAnswer + * @memberof google.cloud.ces.v1beta.TriggerAction + * @instance + */ + TriggerAction.prototype.generativeAnswer = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TriggerAction action. + * @member {"respondImmediately"|"transferAgent"|"generativeAnswer"|undefined} action + * @memberof google.cloud.ces.v1beta.TriggerAction + * @instance + */ + Object.defineProperty(TriggerAction.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["respondImmediately", "transferAgent", "generativeAnswer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TriggerAction instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TriggerAction + * @static + * @param {google.cloud.ces.v1beta.ITriggerAction=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TriggerAction} TriggerAction instance + */ + TriggerAction.create = function create(properties) { + return new TriggerAction(properties); + }; + + /** + * Encodes the specified TriggerAction message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TriggerAction + * @static + * @param {google.cloud.ces.v1beta.ITriggerAction} message TriggerAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TriggerAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.respondImmediately != null && Object.hasOwnProperty.call(message, "respondImmediately")) + $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately.encode(message.respondImmediately, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.transferAgent != null && Object.hasOwnProperty.call(message, "transferAgent")) + $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent.encode(message.transferAgent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.generativeAnswer != null && Object.hasOwnProperty.call(message, "generativeAnswer")) + $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.encode(message.generativeAnswer, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TriggerAction message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction + * @static + * @param {google.cloud.ces.v1beta.ITriggerAction} message TriggerAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TriggerAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TriggerAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TriggerAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TriggerAction} TriggerAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TriggerAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TriggerAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.respondImmediately = $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately.decode(reader, reader.uint32()); + break; + } + case 2: { + message.transferAgent = $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent.decode(reader, reader.uint32()); + break; + } + case 3: { + message.generativeAnswer = $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TriggerAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TriggerAction} TriggerAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TriggerAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TriggerAction message. + * @function verify + * @memberof google.cloud.ces.v1beta.TriggerAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TriggerAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.respondImmediately != null && message.hasOwnProperty("respondImmediately")) { + properties.action = 1; + { + var error = $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately.verify(message.respondImmediately); + if (error) + return "respondImmediately." + error; + } + } + if (message.transferAgent != null && message.hasOwnProperty("transferAgent")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent.verify(message.transferAgent); + if (error) + return "transferAgent." + error; + } + } + if (message.generativeAnswer != null && message.hasOwnProperty("generativeAnswer")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.verify(message.generativeAnswer); + if (error) + return "generativeAnswer." + error; + } + } + return null; + }; + + /** + * Creates a TriggerAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TriggerAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TriggerAction} TriggerAction + */ + TriggerAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TriggerAction) + return object; + var message = new $root.google.cloud.ces.v1beta.TriggerAction(); + if (object.respondImmediately != null) { + if (typeof object.respondImmediately !== "object") + throw TypeError(".google.cloud.ces.v1beta.TriggerAction.respondImmediately: object expected"); + message.respondImmediately = $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately.fromObject(object.respondImmediately); + } + if (object.transferAgent != null) { + if (typeof object.transferAgent !== "object") + throw TypeError(".google.cloud.ces.v1beta.TriggerAction.transferAgent: object expected"); + message.transferAgent = $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent.fromObject(object.transferAgent); + } + if (object.generativeAnswer != null) { + if (typeof object.generativeAnswer !== "object") + throw TypeError(".google.cloud.ces.v1beta.TriggerAction.generativeAnswer: object expected"); + message.generativeAnswer = $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.fromObject(object.generativeAnswer); + } + return message; + }; + + /** + * Creates a plain object from a TriggerAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TriggerAction + * @static + * @param {google.cloud.ces.v1beta.TriggerAction} message TriggerAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TriggerAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.respondImmediately != null && message.hasOwnProperty("respondImmediately")) { + object.respondImmediately = $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately.toObject(message.respondImmediately, options); + if (options.oneofs) + object.action = "respondImmediately"; + } + if (message.transferAgent != null && message.hasOwnProperty("transferAgent")) { + object.transferAgent = $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent.toObject(message.transferAgent, options); + if (options.oneofs) + object.action = "transferAgent"; + } + if (message.generativeAnswer != null && message.hasOwnProperty("generativeAnswer")) { + object.generativeAnswer = $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.toObject(message.generativeAnswer, options); + if (options.oneofs) + object.action = "generativeAnswer"; + } + return object; + }; + + /** + * Converts this TriggerAction to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TriggerAction + * @instance + * @returns {Object.} JSON object + */ + TriggerAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TriggerAction + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TriggerAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TriggerAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TriggerAction"; + }; + + TriggerAction.Response = (function() { + + /** + * Properties of a Response. + * @memberof google.cloud.ces.v1beta.TriggerAction + * @interface IResponse + * @property {string|null} [text] Response text + * @property {boolean|null} [disabled] Response disabled + */ + + /** + * Constructs a new Response. + * @memberof google.cloud.ces.v1beta.TriggerAction + * @classdesc Represents a Response. + * @implements IResponse + * @constructor + * @param {google.cloud.ces.v1beta.TriggerAction.IResponse=} [properties] Properties to set + */ + function Response(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Response text. + * @member {string} text + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @instance + */ + Response.prototype.text = ""; + + /** + * Response disabled. + * @member {boolean} disabled + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @instance + */ + Response.prototype.disabled = false; + + /** + * Creates a new Response instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.IResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TriggerAction.Response} Response instance + */ + Response.create = function create(properties) { + return new Response(properties); + }; + + /** + * Encodes the specified Response message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.Response.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.IResponse} message Response message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Response.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.disabled); + return writer; + }; + + /** + * Encodes the specified Response message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.Response.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.IResponse} message Response message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Response.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Response message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TriggerAction.Response} Response + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Response.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TriggerAction.Response(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.disabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Response message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TriggerAction.Response} Response + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Response.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Response message. + * @function verify + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Response.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + return null; + }; + + /** + * Creates a Response message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TriggerAction.Response} Response + */ + Response.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TriggerAction.Response) + return object; + var message = new $root.google.cloud.ces.v1beta.TriggerAction.Response(); + if (object.text != null) + message.text = String(object.text); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + return message; + }; + + /** + * Creates a plain object from a Response message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.Response} message Response + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Response.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.disabled = false; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + return object; + }; + + /** + * Converts this Response to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @instance + * @returns {Object.} JSON object + */ + Response.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Response + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TriggerAction.Response + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Response.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TriggerAction.Response"; + }; + + return Response; + })(); + + TriggerAction.RespondImmediately = (function() { + + /** + * Properties of a RespondImmediately. + * @memberof google.cloud.ces.v1beta.TriggerAction + * @interface IRespondImmediately + * @property {Array.|null} [responses] RespondImmediately responses + */ + + /** + * Constructs a new RespondImmediately. + * @memberof google.cloud.ces.v1beta.TriggerAction + * @classdesc Represents a RespondImmediately. + * @implements IRespondImmediately + * @constructor + * @param {google.cloud.ces.v1beta.TriggerAction.IRespondImmediately=} [properties] Properties to set + */ + function RespondImmediately(properties) { + this.responses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RespondImmediately responses. + * @member {Array.} responses + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @instance + */ + RespondImmediately.prototype.responses = $util.emptyArray; + + /** + * Creates a new RespondImmediately instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.IRespondImmediately=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TriggerAction.RespondImmediately} RespondImmediately instance + */ + RespondImmediately.create = function create(properties) { + return new RespondImmediately(properties); + }; + + /** + * Encodes the specified RespondImmediately message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.RespondImmediately.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.IRespondImmediately} message RespondImmediately message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RespondImmediately.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responses != null && message.responses.length) + for (var i = 0; i < message.responses.length; ++i) + $root.google.cloud.ces.v1beta.TriggerAction.Response.encode(message.responses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RespondImmediately message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.RespondImmediately.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.IRespondImmediately} message RespondImmediately message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RespondImmediately.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RespondImmediately message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TriggerAction.RespondImmediately} RespondImmediately + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RespondImmediately.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.responses && message.responses.length)) + message.responses = []; + message.responses.push($root.google.cloud.ces.v1beta.TriggerAction.Response.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RespondImmediately message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TriggerAction.RespondImmediately} RespondImmediately + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RespondImmediately.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RespondImmediately message. + * @function verify + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RespondImmediately.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responses != null && message.hasOwnProperty("responses")) { + if (!Array.isArray(message.responses)) + return "responses: array expected"; + for (var i = 0; i < message.responses.length; ++i) { + var error = $root.google.cloud.ces.v1beta.TriggerAction.Response.verify(message.responses[i]); + if (error) + return "responses." + error; + } + } + return null; + }; + + /** + * Creates a RespondImmediately message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TriggerAction.RespondImmediately} RespondImmediately + */ + RespondImmediately.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately) + return object; + var message = new $root.google.cloud.ces.v1beta.TriggerAction.RespondImmediately(); + if (object.responses) { + if (!Array.isArray(object.responses)) + throw TypeError(".google.cloud.ces.v1beta.TriggerAction.RespondImmediately.responses: array expected"); + message.responses = []; + for (var i = 0; i < object.responses.length; ++i) { + if (typeof object.responses[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.TriggerAction.RespondImmediately.responses: object expected"); + message.responses[i] = $root.google.cloud.ces.v1beta.TriggerAction.Response.fromObject(object.responses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RespondImmediately message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.RespondImmediately} message RespondImmediately + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RespondImmediately.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responses = []; + if (message.responses && message.responses.length) { + object.responses = []; + for (var j = 0; j < message.responses.length; ++j) + object.responses[j] = $root.google.cloud.ces.v1beta.TriggerAction.Response.toObject(message.responses[j], options); + } + return object; + }; + + /** + * Converts this RespondImmediately to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @instance + * @returns {Object.} JSON object + */ + RespondImmediately.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RespondImmediately + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TriggerAction.RespondImmediately + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RespondImmediately.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TriggerAction.RespondImmediately"; + }; + + return RespondImmediately; + })(); + + TriggerAction.GenerativeAnswer = (function() { + + /** + * Properties of a GenerativeAnswer. + * @memberof google.cloud.ces.v1beta.TriggerAction + * @interface IGenerativeAnswer + * @property {string|null} [prompt] GenerativeAnswer prompt + */ + + /** + * Constructs a new GenerativeAnswer. + * @memberof google.cloud.ces.v1beta.TriggerAction + * @classdesc Represents a GenerativeAnswer. + * @implements IGenerativeAnswer + * @constructor + * @param {google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer=} [properties] Properties to set + */ + function GenerativeAnswer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerativeAnswer prompt. + * @member {string} prompt + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @instance + */ + GenerativeAnswer.prototype.prompt = ""; + + /** + * Creates a new GenerativeAnswer instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer} GenerativeAnswer instance + */ + GenerativeAnswer.create = function create(properties) { + return new GenerativeAnswer(properties); + }; + + /** + * Encodes the specified GenerativeAnswer message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer} message GenerativeAnswer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerativeAnswer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.prompt); + return writer; + }; + + /** + * Encodes the specified GenerativeAnswer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.IGenerativeAnswer} message GenerativeAnswer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerativeAnswer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerativeAnswer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer} GenerativeAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerativeAnswer.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.prompt = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerativeAnswer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer} GenerativeAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerativeAnswer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerativeAnswer message. + * @function verify + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerativeAnswer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.prompt != null && message.hasOwnProperty("prompt")) + if (!$util.isString(message.prompt)) + return "prompt: string expected"; + return null; + }; + + /** + * Creates a GenerativeAnswer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer} GenerativeAnswer + */ + GenerativeAnswer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer) + return object; + var message = new $root.google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer(); + if (object.prompt != null) + message.prompt = String(object.prompt); + return message; + }; + + /** + * Creates a plain object from a GenerativeAnswer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer} message GenerativeAnswer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerativeAnswer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.prompt = ""; + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = message.prompt; + return object; + }; + + /** + * Converts this GenerativeAnswer to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @instance + * @returns {Object.} JSON object + */ + GenerativeAnswer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerativeAnswer + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerativeAnswer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TriggerAction.GenerativeAnswer"; + }; + + return GenerativeAnswer; + })(); + + TriggerAction.TransferAgent = (function() { + + /** + * Properties of a TransferAgent. + * @memberof google.cloud.ces.v1beta.TriggerAction + * @interface ITransferAgent + * @property {string|null} [agent] TransferAgent agent + */ + + /** + * Constructs a new TransferAgent. + * @memberof google.cloud.ces.v1beta.TriggerAction + * @classdesc Represents a TransferAgent. + * @implements ITransferAgent + * @constructor + * @param {google.cloud.ces.v1beta.TriggerAction.ITransferAgent=} [properties] Properties to set + */ + function TransferAgent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferAgent agent. + * @member {string} agent + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @instance + */ + TransferAgent.prototype.agent = ""; + + /** + * Creates a new TransferAgent instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.ITransferAgent=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TriggerAction.TransferAgent} TransferAgent instance + */ + TransferAgent.create = function create(properties) { + return new TransferAgent(properties); + }; + + /** + * Encodes the specified TransferAgent message. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.TransferAgent.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.ITransferAgent} message TransferAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferAgent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.agent); + return writer; + }; + + /** + * Encodes the specified TransferAgent message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TriggerAction.TransferAgent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.ITransferAgent} message TransferAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferAgent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferAgent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TriggerAction.TransferAgent} TransferAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferAgent.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.agent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferAgent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TriggerAction.TransferAgent} TransferAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferAgent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferAgent message. + * @function verify + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferAgent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agent != null && message.hasOwnProperty("agent")) + if (!$util.isString(message.agent)) + return "agent: string expected"; + return null; + }; + + /** + * Creates a TransferAgent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TriggerAction.TransferAgent} TransferAgent + */ + TransferAgent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent) + return object; + var message = new $root.google.cloud.ces.v1beta.TriggerAction.TransferAgent(); + if (object.agent != null) + message.agent = String(object.agent); + return message; + }; + + /** + * Creates a plain object from a TransferAgent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @static + * @param {google.cloud.ces.v1beta.TriggerAction.TransferAgent} message TransferAgent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferAgent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.agent = ""; + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = message.agent; + return object; + }; + + /** + * Converts this TransferAgent to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @instance + * @returns {Object.} JSON object + */ + TransferAgent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferAgent + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TriggerAction.TransferAgent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferAgent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TriggerAction.TransferAgent"; + }; + + return TransferAgent; + })(); + + return TriggerAction; + })(); + + v1beta.TlsConfig = (function() { + + /** + * Properties of a TlsConfig. + * @memberof google.cloud.ces.v1beta + * @interface ITlsConfig + * @property {Array.|null} [caCerts] TlsConfig caCerts + */ + + /** + * Constructs a new TlsConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a TlsConfig. + * @implements ITlsConfig + * @constructor + * @param {google.cloud.ces.v1beta.ITlsConfig=} [properties] Properties to set + */ + function TlsConfig(properties) { + this.caCerts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TlsConfig caCerts. + * @member {Array.} caCerts + * @memberof google.cloud.ces.v1beta.TlsConfig + * @instance + */ + TlsConfig.prototype.caCerts = $util.emptyArray; + + /** + * Creates a new TlsConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TlsConfig + * @static + * @param {google.cloud.ces.v1beta.ITlsConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TlsConfig} TlsConfig instance + */ + TlsConfig.create = function create(properties) { + return new TlsConfig(properties); + }; + + /** + * Encodes the specified TlsConfig message. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TlsConfig + * @static + * @param {google.cloud.ces.v1beta.ITlsConfig} message TlsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TlsConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caCerts != null && message.caCerts.length) + for (var i = 0; i < message.caCerts.length; ++i) + $root.google.cloud.ces.v1beta.TlsConfig.CaCert.encode(message.caCerts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TlsConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TlsConfig + * @static + * @param {google.cloud.ces.v1beta.ITlsConfig} message TlsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TlsConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TlsConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TlsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TlsConfig} TlsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TlsConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TlsConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.caCerts && message.caCerts.length)) + message.caCerts = []; + message.caCerts.push($root.google.cloud.ces.v1beta.TlsConfig.CaCert.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TlsConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TlsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TlsConfig} TlsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TlsConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TlsConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.TlsConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TlsConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.caCerts != null && message.hasOwnProperty("caCerts")) { + if (!Array.isArray(message.caCerts)) + return "caCerts: array expected"; + for (var i = 0; i < message.caCerts.length; ++i) { + var error = $root.google.cloud.ces.v1beta.TlsConfig.CaCert.verify(message.caCerts[i]); + if (error) + return "caCerts." + error; + } + } + return null; + }; + + /** + * Creates a TlsConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TlsConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TlsConfig} TlsConfig + */ + TlsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TlsConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.TlsConfig(); + if (object.caCerts) { + if (!Array.isArray(object.caCerts)) + throw TypeError(".google.cloud.ces.v1beta.TlsConfig.caCerts: array expected"); + message.caCerts = []; + for (var i = 0; i < object.caCerts.length; ++i) { + if (typeof object.caCerts[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.TlsConfig.caCerts: object expected"); + message.caCerts[i] = $root.google.cloud.ces.v1beta.TlsConfig.CaCert.fromObject(object.caCerts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TlsConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TlsConfig + * @static + * @param {google.cloud.ces.v1beta.TlsConfig} message TlsConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TlsConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.caCerts = []; + if (message.caCerts && message.caCerts.length) { + object.caCerts = []; + for (var j = 0; j < message.caCerts.length; ++j) + object.caCerts[j] = $root.google.cloud.ces.v1beta.TlsConfig.CaCert.toObject(message.caCerts[j], options); + } + return object; + }; + + /** + * Converts this TlsConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TlsConfig + * @instance + * @returns {Object.} JSON object + */ + TlsConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TlsConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TlsConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TlsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TlsConfig"; + }; + + TlsConfig.CaCert = (function() { + + /** + * Properties of a CaCert. + * @memberof google.cloud.ces.v1beta.TlsConfig + * @interface ICaCert + * @property {string|null} [displayName] CaCert displayName + * @property {Uint8Array|null} [cert] CaCert cert + */ + + /** + * Constructs a new CaCert. + * @memberof google.cloud.ces.v1beta.TlsConfig + * @classdesc Represents a CaCert. + * @implements ICaCert + * @constructor + * @param {google.cloud.ces.v1beta.TlsConfig.ICaCert=} [properties] Properties to set + */ + function CaCert(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CaCert displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @instance + */ + CaCert.prototype.displayName = ""; + + /** + * CaCert cert. + * @member {Uint8Array} cert + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @instance + */ + CaCert.prototype.cert = $util.newBuffer([]); + + /** + * Creates a new CaCert instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @static + * @param {google.cloud.ces.v1beta.TlsConfig.ICaCert=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TlsConfig.CaCert} CaCert instance + */ + CaCert.create = function create(properties) { + return new CaCert(properties); + }; + + /** + * Encodes the specified CaCert message. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.CaCert.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @static + * @param {google.cloud.ces.v1beta.TlsConfig.ICaCert} message CaCert message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaCert.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.cert != null && Object.hasOwnProperty.call(message, "cert")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.cert); + return writer; + }; + + /** + * Encodes the specified CaCert message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TlsConfig.CaCert.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @static + * @param {google.cloud.ces.v1beta.TlsConfig.ICaCert} message CaCert message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaCert.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CaCert message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TlsConfig.CaCert} CaCert + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaCert.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TlsConfig.CaCert(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.cert = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CaCert message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TlsConfig.CaCert} CaCert + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaCert.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CaCert message. + * @function verify + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CaCert.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.cert != null && message.hasOwnProperty("cert")) + if (!(message.cert && typeof message.cert.length === "number" || $util.isString(message.cert))) + return "cert: buffer expected"; + return null; + }; + + /** + * Creates a CaCert message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TlsConfig.CaCert} CaCert + */ + CaCert.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TlsConfig.CaCert) + return object; + var message = new $root.google.cloud.ces.v1beta.TlsConfig.CaCert(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.cert != null) + if (typeof object.cert === "string") + $util.base64.decode(object.cert, message.cert = $util.newBuffer($util.base64.length(object.cert)), 0); + else if (object.cert.length >= 0) + message.cert = object.cert; + return message; + }; + + /** + * Creates a plain object from a CaCert message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @static + * @param {google.cloud.ces.v1beta.TlsConfig.CaCert} message CaCert + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CaCert.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + if (options.bytes === String) + object.cert = ""; + else { + object.cert = []; + if (options.bytes !== Array) + object.cert = $util.newBuffer(object.cert); + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.cert != null && message.hasOwnProperty("cert")) + object.cert = options.bytes === String ? $util.base64.encode(message.cert, 0, message.cert.length) : options.bytes === Array ? Array.prototype.slice.call(message.cert) : message.cert; + return object; + }; + + /** + * Converts this CaCert to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @instance + * @returns {Object.} JSON object + */ + CaCert.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CaCert + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TlsConfig.CaCert + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CaCert.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TlsConfig.CaCert"; + }; + + return CaCert; + })(); + + return TlsConfig; + })(); + + v1beta.ServiceDirectoryConfig = (function() { + + /** + * Properties of a ServiceDirectoryConfig. + * @memberof google.cloud.ces.v1beta + * @interface IServiceDirectoryConfig + * @property {string|null} [service] ServiceDirectoryConfig service + */ + + /** + * Constructs a new ServiceDirectoryConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ServiceDirectoryConfig. + * @implements IServiceDirectoryConfig + * @constructor + * @param {google.cloud.ces.v1beta.IServiceDirectoryConfig=} [properties] Properties to set + */ + function ServiceDirectoryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDirectoryConfig service. + * @member {string} service + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @instance + */ + ServiceDirectoryConfig.prototype.service = ""; + + /** + * Creates a new ServiceDirectoryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @static + * @param {google.cloud.ces.v1beta.IServiceDirectoryConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ServiceDirectoryConfig} ServiceDirectoryConfig instance + */ + ServiceDirectoryConfig.create = function create(properties) { + return new ServiceDirectoryConfig(properties); + }; + + /** + * Encodes the specified ServiceDirectoryConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ServiceDirectoryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @static + * @param {google.cloud.ces.v1beta.IServiceDirectoryConfig} message ServiceDirectoryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDirectoryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + return writer; + }; + + /** + * Encodes the specified ServiceDirectoryConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ServiceDirectoryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @static + * @param {google.cloud.ces.v1beta.IServiceDirectoryConfig} message ServiceDirectoryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDirectoryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ServiceDirectoryConfig} ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDirectoryConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ServiceDirectoryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDirectoryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ServiceDirectoryConfig} ServiceDirectoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDirectoryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDirectoryConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDirectoryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + return null; + }; + + /** + * Creates a ServiceDirectoryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ServiceDirectoryConfig} ServiceDirectoryConfig + */ + ServiceDirectoryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ServiceDirectoryConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.ServiceDirectoryConfig(); + if (object.service != null) + message.service = String(object.service); + return message; + }; + + /** + * Creates a plain object from a ServiceDirectoryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @static + * @param {google.cloud.ces.v1beta.ServiceDirectoryConfig} message ServiceDirectoryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDirectoryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + return object; + }; + + /** + * Converts this ServiceDirectoryConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceDirectoryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDirectoryConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ServiceDirectoryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDirectoryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ServiceDirectoryConfig"; + }; + + return ServiceDirectoryConfig; + })(); + + v1beta.ChannelProfile = (function() { + + /** + * Properties of a ChannelProfile. + * @memberof google.cloud.ces.v1beta + * @interface IChannelProfile + * @property {string|null} [profileId] ChannelProfile profileId + * @property {google.cloud.ces.v1beta.ChannelProfile.ChannelType|null} [channelType] ChannelProfile channelType + * @property {google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty|null} [personaProperty] ChannelProfile personaProperty + * @property {boolean|null} [disableDtmf] ChannelProfile disableDtmf + * @property {boolean|null} [disableBargeInControl] ChannelProfile disableBargeInControl + * @property {google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig|null} [webWidgetConfig] ChannelProfile webWidgetConfig + * @property {string|null} [noiseSuppressionLevel] ChannelProfile noiseSuppressionLevel + */ + + /** + * Constructs a new ChannelProfile. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ChannelProfile. + * @implements IChannelProfile + * @constructor + * @param {google.cloud.ces.v1beta.IChannelProfile=} [properties] Properties to set + */ + function ChannelProfile(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChannelProfile profileId. + * @member {string} profileId + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @instance + */ + ChannelProfile.prototype.profileId = ""; + + /** + * ChannelProfile channelType. + * @member {google.cloud.ces.v1beta.ChannelProfile.ChannelType} channelType + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @instance + */ + ChannelProfile.prototype.channelType = 0; + + /** + * ChannelProfile personaProperty. + * @member {google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty|null|undefined} personaProperty + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @instance + */ + ChannelProfile.prototype.personaProperty = null; + + /** + * ChannelProfile disableDtmf. + * @member {boolean} disableDtmf + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @instance + */ + ChannelProfile.prototype.disableDtmf = false; + + /** + * ChannelProfile disableBargeInControl. + * @member {boolean} disableBargeInControl + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @instance + */ + ChannelProfile.prototype.disableBargeInControl = false; + + /** + * ChannelProfile webWidgetConfig. + * @member {google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig|null|undefined} webWidgetConfig + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @instance + */ + ChannelProfile.prototype.webWidgetConfig = null; + + /** + * ChannelProfile noiseSuppressionLevel. + * @member {string} noiseSuppressionLevel + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @instance + */ + ChannelProfile.prototype.noiseSuppressionLevel = ""; + + /** + * Creates a new ChannelProfile instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @static + * @param {google.cloud.ces.v1beta.IChannelProfile=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ChannelProfile} ChannelProfile instance + */ + ChannelProfile.create = function create(properties) { + return new ChannelProfile(properties); + }; + + /** + * Encodes the specified ChannelProfile message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @static + * @param {google.cloud.ces.v1beta.IChannelProfile} message ChannelProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.profileId != null && Object.hasOwnProperty.call(message, "profileId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.profileId); + if (message.personaProperty != null && Object.hasOwnProperty.call(message, "personaProperty")) + $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.encode(message.personaProperty, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.channelType != null && Object.hasOwnProperty.call(message, "channelType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.channelType); + if (message.disableDtmf != null && Object.hasOwnProperty.call(message, "disableDtmf")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.disableDtmf); + if (message.disableBargeInControl != null && Object.hasOwnProperty.call(message, "disableBargeInControl")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disableBargeInControl); + if (message.webWidgetConfig != null && Object.hasOwnProperty.call(message, "webWidgetConfig")) + $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.encode(message.webWidgetConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.noiseSuppressionLevel != null && Object.hasOwnProperty.call(message, "noiseSuppressionLevel")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.noiseSuppressionLevel); + return writer; + }; + + /** + * Encodes the specified ChannelProfile message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @static + * @param {google.cloud.ces.v1beta.IChannelProfile} message ChannelProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChannelProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ChannelProfile} ChannelProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelProfile.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ChannelProfile(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.profileId = reader.string(); + break; + } + case 3: { + message.channelType = reader.int32(); + break; + } + case 2: { + message.personaProperty = $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.decode(reader, reader.uint32()); + break; + } + case 4: { + message.disableDtmf = reader.bool(); + break; + } + case 5: { + message.disableBargeInControl = reader.bool(); + break; + } + case 7: { + message.webWidgetConfig = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.noiseSuppressionLevel = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChannelProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ChannelProfile} ChannelProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChannelProfile message. + * @function verify + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChannelProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.profileId != null && message.hasOwnProperty("profileId")) + if (!$util.isString(message.profileId)) + return "profileId: string expected"; + if (message.channelType != null && message.hasOwnProperty("channelType")) + switch (message.channelType) { + default: + return "channelType: enum value expected"; + case 0: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.personaProperty != null && message.hasOwnProperty("personaProperty")) { + var error = $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.verify(message.personaProperty); + if (error) + return "personaProperty." + error; + } + if (message.disableDtmf != null && message.hasOwnProperty("disableDtmf")) + if (typeof message.disableDtmf !== "boolean") + return "disableDtmf: boolean expected"; + if (message.disableBargeInControl != null && message.hasOwnProperty("disableBargeInControl")) + if (typeof message.disableBargeInControl !== "boolean") + return "disableBargeInControl: boolean expected"; + if (message.webWidgetConfig != null && message.hasOwnProperty("webWidgetConfig")) { + var error = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.verify(message.webWidgetConfig); + if (error) + return "webWidgetConfig." + error; + } + if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) + if (!$util.isString(message.noiseSuppressionLevel)) + return "noiseSuppressionLevel: string expected"; + return null; + }; + + /** + * Creates a ChannelProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ChannelProfile} ChannelProfile + */ + ChannelProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ChannelProfile) + return object; + var message = new $root.google.cloud.ces.v1beta.ChannelProfile(); + if (object.profileId != null) + message.profileId = String(object.profileId); + switch (object.channelType) { + default: + if (typeof object.channelType === "number") { + message.channelType = object.channelType; + break; + } + break; + case "UNKNOWN": + case 0: + message.channelType = 0; + break; + case "WEB_UI": + case 2: + message.channelType = 2; + break; + case "API": + case 3: + message.channelType = 3; + break; + case "TWILIO": + case 4: + message.channelType = 4; + break; + case "GOOGLE_TELEPHONY_PLATFORM": + case 5: + message.channelType = 5; + break; + case "CONTACT_CENTER_AS_A_SERVICE": + case 6: + message.channelType = 6; + break; + case "FIVE9": + case 7: + message.channelType = 7; + break; + case "CONTACT_CENTER_INTEGRATION": + case 8: + message.channelType = 8; + break; + } + if (object.personaProperty != null) { + if (typeof object.personaProperty !== "object") + throw TypeError(".google.cloud.ces.v1beta.ChannelProfile.personaProperty: object expected"); + message.personaProperty = $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.fromObject(object.personaProperty); + } + if (object.disableDtmf != null) + message.disableDtmf = Boolean(object.disableDtmf); + if (object.disableBargeInControl != null) + message.disableBargeInControl = Boolean(object.disableBargeInControl); + if (object.webWidgetConfig != null) { + if (typeof object.webWidgetConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.ChannelProfile.webWidgetConfig: object expected"); + message.webWidgetConfig = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.fromObject(object.webWidgetConfig); + } + if (object.noiseSuppressionLevel != null) + message.noiseSuppressionLevel = String(object.noiseSuppressionLevel); + return message; + }; + + /** + * Creates a plain object from a ChannelProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile} message ChannelProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChannelProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.profileId = ""; + object.personaProperty = null; + object.channelType = options.enums === String ? "UNKNOWN" : 0; + object.disableDtmf = false; + object.disableBargeInControl = false; + object.webWidgetConfig = null; + object.noiseSuppressionLevel = ""; + } + if (message.profileId != null && message.hasOwnProperty("profileId")) + object.profileId = message.profileId; + if (message.personaProperty != null && message.hasOwnProperty("personaProperty")) + object.personaProperty = $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.toObject(message.personaProperty, options); + if (message.channelType != null && message.hasOwnProperty("channelType")) + object.channelType = options.enums === String ? $root.google.cloud.ces.v1beta.ChannelProfile.ChannelType[message.channelType] === undefined ? message.channelType : $root.google.cloud.ces.v1beta.ChannelProfile.ChannelType[message.channelType] : message.channelType; + if (message.disableDtmf != null && message.hasOwnProperty("disableDtmf")) + object.disableDtmf = message.disableDtmf; + if (message.disableBargeInControl != null && message.hasOwnProperty("disableBargeInControl")) + object.disableBargeInControl = message.disableBargeInControl; + if (message.webWidgetConfig != null && message.hasOwnProperty("webWidgetConfig")) + object.webWidgetConfig = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.toObject(message.webWidgetConfig, options); + if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) + object.noiseSuppressionLevel = message.noiseSuppressionLevel; + return object; + }; + + /** + * Converts this ChannelProfile to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @instance + * @returns {Object.} JSON object + */ + ChannelProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChannelProfile + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChannelProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ChannelProfile"; + }; + + ChannelProfile.PersonaProperty = (function() { + + /** + * Properties of a PersonaProperty. + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @interface IPersonaProperty + * @property {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona|null} [persona] PersonaProperty persona + */ + + /** + * Constructs a new PersonaProperty. + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @classdesc Represents a PersonaProperty. + * @implements IPersonaProperty + * @constructor + * @param {google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty=} [properties] Properties to set + */ + function PersonaProperty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonaProperty persona. + * @member {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona} persona + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @instance + */ + PersonaProperty.prototype.persona = 0; + + /** + * Creates a new PersonaProperty instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty} PersonaProperty instance + */ + PersonaProperty.create = function create(properties) { + return new PersonaProperty(properties); + }; + + /** + * Encodes the specified PersonaProperty message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty} message PersonaProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonaProperty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.persona != null && Object.hasOwnProperty.call(message, "persona")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.persona); + return writer; + }; + + /** + * Encodes the specified PersonaProperty message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.IPersonaProperty} message PersonaProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonaProperty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonaProperty message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty} PersonaProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonaProperty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.persona = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PersonaProperty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty} PersonaProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonaProperty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonaProperty message. + * @function verify + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonaProperty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.persona != null && message.hasOwnProperty("persona")) + switch (message.persona) { + default: + return "persona: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a PersonaProperty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty} PersonaProperty + */ + PersonaProperty.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty) + return object; + var message = new $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty(); + switch (object.persona) { + default: + if (typeof object.persona === "number") { + message.persona = object.persona; + break; + } + break; + case "UNKNOWN": + case 0: + message.persona = 0; + break; + case "CONCISE": + case 1: + message.persona = 1; + break; + case "CHATTY": + case 2: + message.persona = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a PersonaProperty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.PersonaProperty} message PersonaProperty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonaProperty.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.persona = options.enums === String ? "UNKNOWN" : 0; + if (message.persona != null && message.hasOwnProperty("persona")) + object.persona = options.enums === String ? $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona[message.persona] === undefined ? message.persona : $root.google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona[message.persona] : message.persona; + return object; + }; + + /** + * Converts this PersonaProperty to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @instance + * @returns {Object.} JSON object + */ + PersonaProperty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PersonaProperty + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ChannelProfile.PersonaProperty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PersonaProperty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ChannelProfile.PersonaProperty"; + }; + + /** + * Persona enum. + * @name google.cloud.ces.v1beta.ChannelProfile.PersonaProperty.Persona + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} CONCISE=1 CONCISE value + * @property {number} CHATTY=2 CHATTY value + */ + PersonaProperty.Persona = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "CONCISE"] = 1; + values[valuesById[2] = "CHATTY"] = 2; + return values; + })(); + + return PersonaProperty; + })(); + + ChannelProfile.WebWidgetConfig = (function() { + + /** + * Properties of a WebWidgetConfig. + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @interface IWebWidgetConfig + * @property {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality|null} [modality] WebWidgetConfig modality + * @property {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme|null} [theme] WebWidgetConfig theme + * @property {string|null} [webWidgetTitle] WebWidgetConfig webWidgetTitle + * @property {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings|null} [securitySettings] WebWidgetConfig securitySettings + */ + + /** + * Constructs a new WebWidgetConfig. + * @memberof google.cloud.ces.v1beta.ChannelProfile + * @classdesc Represents a WebWidgetConfig. + * @implements IWebWidgetConfig + * @constructor + * @param {google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig=} [properties] Properties to set + */ + function WebWidgetConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebWidgetConfig modality. + * @member {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality} modality + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @instance + */ + WebWidgetConfig.prototype.modality = 0; + + /** + * WebWidgetConfig theme. + * @member {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme} theme + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @instance + */ + WebWidgetConfig.prototype.theme = 0; + + /** + * WebWidgetConfig webWidgetTitle. + * @member {string} webWidgetTitle + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @instance + */ + WebWidgetConfig.prototype.webWidgetTitle = ""; + + /** + * WebWidgetConfig securitySettings. + * @member {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings|null|undefined} securitySettings + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @instance + */ + WebWidgetConfig.prototype.securitySettings = null; + + /** + * Creates a new WebWidgetConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig} WebWidgetConfig instance + */ + WebWidgetConfig.create = function create(properties) { + return new WebWidgetConfig(properties); + }; + + /** + * Encodes the specified WebWidgetConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig} message WebWidgetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebWidgetConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modality != null && Object.hasOwnProperty.call(message, "modality")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modality); + if (message.theme != null && Object.hasOwnProperty.call(message, "theme")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.theme); + if (message.webWidgetTitle != null && Object.hasOwnProperty.call(message, "webWidgetTitle")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.webWidgetTitle); + if (message.securitySettings != null && Object.hasOwnProperty.call(message, "securitySettings")) + $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.encode(message.securitySettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebWidgetConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.IWebWidgetConfig} message WebWidgetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebWidgetConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebWidgetConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig} WebWidgetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebWidgetConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.modality = reader.int32(); + break; + } + case 2: { + message.theme = reader.int32(); + break; + } + case 3: { + message.webWidgetTitle = reader.string(); + break; + } + case 4: { + message.securitySettings = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebWidgetConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig} WebWidgetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebWidgetConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebWidgetConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebWidgetConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modality != null && message.hasOwnProperty("modality")) + switch (message.modality) { + default: + return "modality: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.theme != null && message.hasOwnProperty("theme")) + switch (message.theme) { + default: + return "theme: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.webWidgetTitle != null && message.hasOwnProperty("webWidgetTitle")) + if (!$util.isString(message.webWidgetTitle)) + return "webWidgetTitle: string expected"; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) { + var error = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.verify(message.securitySettings); + if (error) + return "securitySettings." + error; + } + return null; + }; + + /** + * Creates a WebWidgetConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig} WebWidgetConfig + */ + WebWidgetConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig(); + switch (object.modality) { + default: + if (typeof object.modality === "number") { + message.modality = object.modality; + break; + } + break; + case "MODALITY_UNSPECIFIED": + case 0: + message.modality = 0; + break; + case "CHAT_AND_VOICE": + case 1: + message.modality = 1; + break; + case "VOICE_ONLY": + case 2: + message.modality = 2; + break; + case "CHAT_ONLY": + case 3: + message.modality = 3; + break; + } + switch (object.theme) { + default: + if (typeof object.theme === "number") { + message.theme = object.theme; + break; + } + break; + case "THEME_UNSPECIFIED": + case 0: + message.theme = 0; + break; + case "LIGHT": + case 1: + message.theme = 1; + break; + case "DARK": + case 2: + message.theme = 2; + break; + } + if (object.webWidgetTitle != null) + message.webWidgetTitle = String(object.webWidgetTitle); + if (object.securitySettings != null) { + if (typeof object.securitySettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.securitySettings: object expected"); + message.securitySettings = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.fromObject(object.securitySettings); + } + return message; + }; + + /** + * Creates a plain object from a WebWidgetConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig} message WebWidgetConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebWidgetConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modality = options.enums === String ? "MODALITY_UNSPECIFIED" : 0; + object.theme = options.enums === String ? "THEME_UNSPECIFIED" : 0; + object.webWidgetTitle = ""; + object.securitySettings = null; + } + if (message.modality != null && message.hasOwnProperty("modality")) + object.modality = options.enums === String ? $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality[message.modality] === undefined ? message.modality : $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality[message.modality] : message.modality; + if (message.theme != null && message.hasOwnProperty("theme")) + object.theme = options.enums === String ? $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme[message.theme] === undefined ? message.theme : $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme[message.theme] : message.theme; + if (message.webWidgetTitle != null && message.hasOwnProperty("webWidgetTitle")) + object.webWidgetTitle = message.webWidgetTitle; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) + object.securitySettings = $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.toObject(message.securitySettings, options); + return object; + }; + + /** + * Converts this WebWidgetConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @instance + * @returns {Object.} JSON object + */ + WebWidgetConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebWidgetConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebWidgetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig"; + }; + + WebWidgetConfig.SecuritySettings = (function() { + + /** + * Properties of a SecuritySettings. + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @interface ISecuritySettings + * @property {boolean|null} [enablePublicAccess] SecuritySettings enablePublicAccess + * @property {boolean|null} [enableOriginCheck] SecuritySettings enableOriginCheck + * @property {Array.|null} [allowedOrigins] SecuritySettings allowedOrigins + * @property {boolean|null} [enableRecaptcha] SecuritySettings enableRecaptcha + */ + + /** + * Constructs a new SecuritySettings. + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig + * @classdesc Represents a SecuritySettings. + * @implements ISecuritySettings + * @constructor + * @param {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings=} [properties] Properties to set + */ + function SecuritySettings(properties) { + this.allowedOrigins = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecuritySettings enablePublicAccess. + * @member {boolean} enablePublicAccess + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @instance + */ + SecuritySettings.prototype.enablePublicAccess = false; + + /** + * SecuritySettings enableOriginCheck. + * @member {boolean} enableOriginCheck + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @instance + */ + SecuritySettings.prototype.enableOriginCheck = false; + + /** + * SecuritySettings allowedOrigins. + * @member {Array.} allowedOrigins + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @instance + */ + SecuritySettings.prototype.allowedOrigins = $util.emptyArray; + + /** + * SecuritySettings enableRecaptcha. + * @member {boolean} enableRecaptcha + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @instance + */ + SecuritySettings.prototype.enableRecaptcha = false; + + /** + * Creates a new SecuritySettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings instance + */ + SecuritySettings.create = function create(properties) { + return new SecuritySettings(properties); + }; + + /** + * Encodes the specified SecuritySettings message. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings} message SecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecuritySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enablePublicAccess != null && Object.hasOwnProperty.call(message, "enablePublicAccess")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePublicAccess); + if (message.allowedOrigins != null && message.allowedOrigins.length) + for (var i = 0; i < message.allowedOrigins.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedOrigins[i]); + if (message.enableRecaptcha != null && Object.hasOwnProperty.call(message, "enableRecaptcha")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableRecaptcha); + if (message.enableOriginCheck != null && Object.hasOwnProperty.call(message, "enableOriginCheck")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableOriginCheck); + return writer; + }; + + /** + * Encodes the specified SecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.ISecuritySettings} message SecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecuritySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecuritySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enablePublicAccess = reader.bool(); + break; + } + case 4: { + message.enableOriginCheck = reader.bool(); + break; + } + case 2: { + if (!(message.allowedOrigins && message.allowedOrigins.length)) + message.allowedOrigins = []; + message.allowedOrigins.push(reader.string()); + break; + } + case 3: { + message.enableRecaptcha = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecuritySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecuritySettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecuritySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enablePublicAccess != null && message.hasOwnProperty("enablePublicAccess")) + if (typeof message.enablePublicAccess !== "boolean") + return "enablePublicAccess: boolean expected"; + if (message.enableOriginCheck != null && message.hasOwnProperty("enableOriginCheck")) + if (typeof message.enableOriginCheck !== "boolean") + return "enableOriginCheck: boolean expected"; + if (message.allowedOrigins != null && message.hasOwnProperty("allowedOrigins")) { + if (!Array.isArray(message.allowedOrigins)) + return "allowedOrigins: array expected"; + for (var i = 0; i < message.allowedOrigins.length; ++i) + if (!$util.isString(message.allowedOrigins[i])) + return "allowedOrigins: string[] expected"; + } + if (message.enableRecaptcha != null && message.hasOwnProperty("enableRecaptcha")) + if (typeof message.enableRecaptcha !== "boolean") + return "enableRecaptcha: boolean expected"; + return null; + }; + + /** + * Creates a SecuritySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings} SecuritySettings + */ + SecuritySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings) + return object; + var message = new $root.google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings(); + if (object.enablePublicAccess != null) + message.enablePublicAccess = Boolean(object.enablePublicAccess); + if (object.enableOriginCheck != null) + message.enableOriginCheck = Boolean(object.enableOriginCheck); + if (object.allowedOrigins) { + if (!Array.isArray(object.allowedOrigins)) + throw TypeError(".google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings.allowedOrigins: array expected"); + message.allowedOrigins = []; + for (var i = 0; i < object.allowedOrigins.length; ++i) + message.allowedOrigins[i] = String(object.allowedOrigins[i]); + } + if (object.enableRecaptcha != null) + message.enableRecaptcha = Boolean(object.enableRecaptcha); + return message; + }; + + /** + * Creates a plain object from a SecuritySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings} message SecuritySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecuritySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedOrigins = []; + if (options.defaults) { + object.enablePublicAccess = false; + object.enableRecaptcha = false; + object.enableOriginCheck = false; + } + if (message.enablePublicAccess != null && message.hasOwnProperty("enablePublicAccess")) + object.enablePublicAccess = message.enablePublicAccess; + if (message.allowedOrigins && message.allowedOrigins.length) { + object.allowedOrigins = []; + for (var j = 0; j < message.allowedOrigins.length; ++j) + object.allowedOrigins[j] = message.allowedOrigins[j]; + } + if (message.enableRecaptcha != null && message.hasOwnProperty("enableRecaptcha")) + object.enableRecaptcha = message.enableRecaptcha; + if (message.enableOriginCheck != null && message.hasOwnProperty("enableOriginCheck")) + object.enableOriginCheck = message.enableOriginCheck; + return object; + }; + + /** + * Converts this SecuritySettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @instance + * @returns {Object.} JSON object + */ + SecuritySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecuritySettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecuritySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.SecuritySettings"; + }; + + return SecuritySettings; + })(); + + /** + * Modality enum. + * @name google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Modality + * @enum {number} + * @property {number} MODALITY_UNSPECIFIED=0 MODALITY_UNSPECIFIED value + * @property {number} CHAT_AND_VOICE=1 CHAT_AND_VOICE value + * @property {number} VOICE_ONLY=2 VOICE_ONLY value + * @property {number} CHAT_ONLY=3 CHAT_ONLY value + */ + WebWidgetConfig.Modality = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODALITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "CHAT_AND_VOICE"] = 1; + values[valuesById[2] = "VOICE_ONLY"] = 2; + values[valuesById[3] = "CHAT_ONLY"] = 3; + return values; + })(); + + /** + * Theme enum. + * @name google.cloud.ces.v1beta.ChannelProfile.WebWidgetConfig.Theme + * @enum {number} + * @property {number} THEME_UNSPECIFIED=0 THEME_UNSPECIFIED value + * @property {number} LIGHT=1 LIGHT value + * @property {number} DARK=2 DARK value + */ + WebWidgetConfig.Theme = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "THEME_UNSPECIFIED"] = 0; + values[valuesById[1] = "LIGHT"] = 1; + values[valuesById[2] = "DARK"] = 2; + return values; + })(); + + return WebWidgetConfig; + })(); + + /** + * ChannelType enum. + * @name google.cloud.ces.v1beta.ChannelProfile.ChannelType + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} WEB_UI=2 WEB_UI value + * @property {number} API=3 API value + * @property {number} TWILIO=4 TWILIO value + * @property {number} GOOGLE_TELEPHONY_PLATFORM=5 GOOGLE_TELEPHONY_PLATFORM value + * @property {number} CONTACT_CENTER_AS_A_SERVICE=6 CONTACT_CENTER_AS_A_SERVICE value + * @property {number} FIVE9=7 FIVE9 value + * @property {number} CONTACT_CENTER_INTEGRATION=8 CONTACT_CENTER_INTEGRATION value + */ + ChannelProfile.ChannelType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[2] = "WEB_UI"] = 2; + values[valuesById[3] = "API"] = 3; + values[valuesById[4] = "TWILIO"] = 4; + values[valuesById[5] = "GOOGLE_TELEPHONY_PLATFORM"] = 5; + values[valuesById[6] = "CONTACT_CENTER_AS_A_SERVICE"] = 6; + values[valuesById[7] = "FIVE9"] = 7; + values[valuesById[8] = "CONTACT_CENTER_INTEGRATION"] = 8; + return values; + })(); + + return ChannelProfile; + })(); + + v1beta.Span = (function() { + + /** + * Properties of a Span. + * @memberof google.cloud.ces.v1beta + * @interface ISpan + * @property {string|null} [name] Span name + * @property {google.protobuf.ITimestamp|null} [startTime] Span startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Span endTime + * @property {google.protobuf.IDuration|null} [duration] Span duration + * @property {google.protobuf.IStruct|null} [attributes] Span attributes + * @property {Array.|null} [childSpans] Span childSpans + */ + + /** + * Constructs a new Span. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Span. + * @implements ISpan + * @constructor + * @param {google.cloud.ces.v1beta.ISpan=} [properties] Properties to set + */ + function Span(properties) { + this.childSpans = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Span name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Span + * @instance + */ + Span.prototype.name = ""; + + /** + * Span startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.ces.v1beta.Span + * @instance + */ + Span.prototype.startTime = null; + + /** + * Span endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1beta.Span + * @instance + */ + Span.prototype.endTime = null; + + /** + * Span duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.ces.v1beta.Span + * @instance + */ + Span.prototype.duration = null; + + /** + * Span attributes. + * @member {google.protobuf.IStruct|null|undefined} attributes + * @memberof google.cloud.ces.v1beta.Span + * @instance + */ + Span.prototype.attributes = null; + + /** + * Span childSpans. + * @member {Array.} childSpans + * @memberof google.cloud.ces.v1beta.Span + * @instance + */ + Span.prototype.childSpans = $util.emptyArray; + + /** + * Creates a new Span instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Span + * @static + * @param {google.cloud.ces.v1beta.ISpan=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Span} Span instance + */ + Span.create = function create(properties) { + return new Span(properties); + }; + + /** + * Encodes the specified Span message. Does not implicitly {@link google.cloud.ces.v1beta.Span.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Span + * @static + * @param {google.cloud.ces.v1beta.ISpan} message Span message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Span.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + $root.google.protobuf.Struct.encode(message.attributes, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.childSpans != null && message.childSpans.length) + for (var i = 0; i < message.childSpans.length; ++i) + $root.google.cloud.ces.v1beta.Span.encode(message.childSpans[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Span message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Span.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Span + * @static + * @param {google.cloud.ces.v1beta.ISpan} message Span message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Span.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Span message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Span + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Span} Span + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Span.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Span(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.attributes = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.childSpans && message.childSpans.length)) + message.childSpans = []; + message.childSpans.push($root.google.cloud.ces.v1beta.Span.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Span message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Span + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Span} Span + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Span.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Span message. + * @function verify + * @memberof google.cloud.ces.v1beta.Span + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Span.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string 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.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + var error = $root.google.protobuf.Struct.verify(message.attributes); + if (error) + return "attributes." + error; + } + if (message.childSpans != null && message.hasOwnProperty("childSpans")) { + if (!Array.isArray(message.childSpans)) + return "childSpans: array expected"; + for (var i = 0; i < message.childSpans.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Span.verify(message.childSpans[i]); + if (error) + return "childSpans." + error; + } + } + return null; + }; + + /** + * Creates a Span message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Span + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Span} Span + */ + Span.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Span) + return object; + var message = new $root.google.cloud.ces.v1beta.Span(); + if (object.name != null) + message.name = String(object.name); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Span.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.ces.v1beta.Span.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.ces.v1beta.Span.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.attributes != null) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.ces.v1beta.Span.attributes: object expected"); + message.attributes = $root.google.protobuf.Struct.fromObject(object.attributes); + } + if (object.childSpans) { + if (!Array.isArray(object.childSpans)) + throw TypeError(".google.cloud.ces.v1beta.Span.childSpans: array expected"); + message.childSpans = []; + for (var i = 0; i < object.childSpans.length; ++i) { + if (typeof object.childSpans[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Span.childSpans: object expected"); + message.childSpans[i] = $root.google.cloud.ces.v1beta.Span.fromObject(object.childSpans[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Span message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Span + * @static + * @param {google.cloud.ces.v1beta.Span} message Span + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Span.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.childSpans = []; + if (options.defaults) { + object.name = ""; + object.startTime = null; + object.endTime = null; + object.attributes = null; + object.duration = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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.attributes != null && message.hasOwnProperty("attributes")) + object.attributes = $root.google.protobuf.Struct.toObject(message.attributes, options); + if (message.childSpans && message.childSpans.length) { + object.childSpans = []; + for (var j = 0; j < message.childSpans.length; ++j) + object.childSpans[j] = $root.google.cloud.ces.v1beta.Span.toObject(message.childSpans[j], options); + } + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this Span to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Span + * @instance + * @returns {Object.} JSON object + */ + Span.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Span + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Span + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Span.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Span"; + }; + + return Span; + })(); + + v1beta.AgentService = (function() { + + /** + * Constructs a new AgentService service. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an AgentService + * @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 AgentService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AgentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AgentService; + + /** + * Creates new AgentService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.ces.v1beta.AgentService + * @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 {AgentService} RPC service. Useful where requests and/or responses are streamed. + */ + AgentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listApps}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListAppsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListAppsResponse} [response] ListAppsResponse + */ + + /** + * Calls ListApps. + * @function listApps + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListAppsRequest} request ListAppsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListAppsCallback} callback Node-style callback called with the error, if any, and ListAppsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listApps = function listApps(request, callback) { + return this.rpcCall(listApps, $root.google.cloud.ces.v1beta.ListAppsRequest, $root.google.cloud.ces.v1beta.ListAppsResponse, request, callback); + }, "name", { value: "ListApps" }); + + /** + * Calls ListApps. + * @function listApps + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListAppsRequest} request ListAppsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getApp}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetAppCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.App} [response] App + */ + + /** + * Calls GetApp. + * @function getApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetAppRequest} request GetAppRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetAppCallback} callback Node-style callback called with the error, if any, and App + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getApp = function getApp(request, callback) { + return this.rpcCall(getApp, $root.google.cloud.ces.v1beta.GetAppRequest, $root.google.cloud.ces.v1beta.App, request, callback); + }, "name", { value: "GetApp" }); + + /** + * Calls GetApp. + * @function getApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetAppRequest} request GetAppRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createApp}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef CreateAppCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateApp. + * @function createApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateAppRequest} request CreateAppRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.CreateAppCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createApp = function createApp(request, callback) { + return this.rpcCall(createApp, $root.google.cloud.ces.v1beta.CreateAppRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateApp" }); + + /** + * Calls CreateApp. + * @function createApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateAppRequest} request CreateAppRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateApp}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef UpdateAppCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.App} [response] App + */ + + /** + * Calls UpdateApp. + * @function updateApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateAppRequest} request UpdateAppRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.UpdateAppCallback} callback Node-style callback called with the error, if any, and App + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateApp = function updateApp(request, callback) { + return this.rpcCall(updateApp, $root.google.cloud.ces.v1beta.UpdateAppRequest, $root.google.cloud.ces.v1beta.App, request, callback); + }, "name", { value: "UpdateApp" }); + + /** + * Calls UpdateApp. + * @function updateApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateAppRequest} request UpdateAppRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteApp}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef DeleteAppCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteApp. + * @function deleteApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteAppRequest} request DeleteAppRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.DeleteAppCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteApp = function deleteApp(request, callback) { + return this.rpcCall(deleteApp, $root.google.cloud.ces.v1beta.DeleteAppRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteApp" }); + + /** + * Calls DeleteApp. + * @function deleteApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteAppRequest} request DeleteAppRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|exportApp}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ExportAppCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportApp. + * @function exportApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IExportAppRequest} request ExportAppRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ExportAppCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.exportApp = function exportApp(request, callback) { + return this.rpcCall(exportApp, $root.google.cloud.ces.v1beta.ExportAppRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportApp" }); + + /** + * Calls ExportApp. + * @function exportApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IExportAppRequest} request ExportAppRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|importApp}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ImportAppCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportApp. + * @function importApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IImportAppRequest} request ImportAppRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ImportAppCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.importApp = function importApp(request, callback) { + return this.rpcCall(importApp, $root.google.cloud.ces.v1beta.ImportAppRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportApp" }); + + /** + * Calls ImportApp. + * @function importApp + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IImportAppRequest} request ImportAppRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listAgents}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListAgentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListAgentsResponse} [response] ListAgentsResponse + */ + + /** + * Calls ListAgents. + * @function listAgents + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListAgentsRequest} request ListAgentsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListAgentsCallback} callback Node-style callback called with the error, if any, and ListAgentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listAgents = function listAgents(request, callback) { + return this.rpcCall(listAgents, $root.google.cloud.ces.v1beta.ListAgentsRequest, $root.google.cloud.ces.v1beta.ListAgentsResponse, request, callback); + }, "name", { value: "ListAgents" }); + + /** + * Calls ListAgents. + * @function listAgents + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListAgentsRequest} request ListAgentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getAgent}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Agent} [response] Agent + */ + + /** + * Calls GetAgent. + * @function getAgent + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetAgentRequest} request GetAgentRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetAgentCallback} callback Node-style callback called with the error, if any, and Agent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getAgent = function getAgent(request, callback) { + return this.rpcCall(getAgent, $root.google.cloud.ces.v1beta.GetAgentRequest, $root.google.cloud.ces.v1beta.Agent, request, callback); + }, "name", { value: "GetAgent" }); + + /** + * Calls GetAgent. + * @function getAgent + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetAgentRequest} request GetAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createAgent}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef CreateAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Agent} [response] Agent + */ + + /** + * Calls CreateAgent. + * @function createAgent + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateAgentRequest} request CreateAgentRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.CreateAgentCallback} callback Node-style callback called with the error, if any, and Agent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createAgent = function createAgent(request, callback) { + return this.rpcCall(createAgent, $root.google.cloud.ces.v1beta.CreateAgentRequest, $root.google.cloud.ces.v1beta.Agent, request, callback); + }, "name", { value: "CreateAgent" }); + + /** + * Calls CreateAgent. + * @function createAgent + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateAgentRequest} request CreateAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateAgent}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef UpdateAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Agent} [response] Agent + */ + + /** + * Calls UpdateAgent. + * @function updateAgent + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateAgentRequest} request UpdateAgentRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.UpdateAgentCallback} callback Node-style callback called with the error, if any, and Agent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateAgent = function updateAgent(request, callback) { + return this.rpcCall(updateAgent, $root.google.cloud.ces.v1beta.UpdateAgentRequest, $root.google.cloud.ces.v1beta.Agent, request, callback); + }, "name", { value: "UpdateAgent" }); + + /** + * Calls UpdateAgent. + * @function updateAgent + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateAgentRequest} request UpdateAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteAgent}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef DeleteAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAgent. + * @function deleteAgent + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteAgentRequest} request DeleteAgentRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.DeleteAgentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteAgent = function deleteAgent(request, callback) { + return this.rpcCall(deleteAgent, $root.google.cloud.ces.v1beta.DeleteAgentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAgent" }); + + /** + * Calls DeleteAgent. + * @function deleteAgent + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteAgentRequest} request DeleteAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listExamples}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListExamplesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListExamplesResponse} [response] ListExamplesResponse + */ + + /** + * Calls ListExamples. + * @function listExamples + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListExamplesRequest} request ListExamplesRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListExamplesCallback} callback Node-style callback called with the error, if any, and ListExamplesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listExamples = function listExamples(request, callback) { + return this.rpcCall(listExamples, $root.google.cloud.ces.v1beta.ListExamplesRequest, $root.google.cloud.ces.v1beta.ListExamplesResponse, request, callback); + }, "name", { value: "ListExamples" }); + + /** + * Calls ListExamples. + * @function listExamples + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListExamplesRequest} request ListExamplesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getExample}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Example} [response] Example + */ + + /** + * Calls GetExample. + * @function getExample + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetExampleRequest} request GetExampleRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetExampleCallback} callback Node-style callback called with the error, if any, and Example + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getExample = function getExample(request, callback) { + return this.rpcCall(getExample, $root.google.cloud.ces.v1beta.GetExampleRequest, $root.google.cloud.ces.v1beta.Example, request, callback); + }, "name", { value: "GetExample" }); + + /** + * Calls GetExample. + * @function getExample + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetExampleRequest} request GetExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createExample}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef CreateExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Example} [response] Example + */ + + /** + * Calls CreateExample. + * @function createExample + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateExampleRequest} request CreateExampleRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.CreateExampleCallback} callback Node-style callback called with the error, if any, and Example + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createExample = function createExample(request, callback) { + return this.rpcCall(createExample, $root.google.cloud.ces.v1beta.CreateExampleRequest, $root.google.cloud.ces.v1beta.Example, request, callback); + }, "name", { value: "CreateExample" }); + + /** + * Calls CreateExample. + * @function createExample + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateExampleRequest} request CreateExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateExample}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef UpdateExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Example} [response] Example + */ + + /** + * Calls UpdateExample. + * @function updateExample + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateExampleRequest} request UpdateExampleRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.UpdateExampleCallback} callback Node-style callback called with the error, if any, and Example + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateExample = function updateExample(request, callback) { + return this.rpcCall(updateExample, $root.google.cloud.ces.v1beta.UpdateExampleRequest, $root.google.cloud.ces.v1beta.Example, request, callback); + }, "name", { value: "UpdateExample" }); + + /** + * Calls UpdateExample. + * @function updateExample + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateExampleRequest} request UpdateExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteExample}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef DeleteExampleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteExample. + * @function deleteExample + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteExampleRequest} request DeleteExampleRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.DeleteExampleCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteExample = function deleteExample(request, callback) { + return this.rpcCall(deleteExample, $root.google.cloud.ces.v1beta.DeleteExampleRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteExample" }); + + /** + * Calls DeleteExample. + * @function deleteExample + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteExampleRequest} request DeleteExampleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listTools}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListToolsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListToolsResponse} [response] ListToolsResponse + */ + + /** + * Calls ListTools. + * @function listTools + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListToolsRequest} request ListToolsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListToolsCallback} callback Node-style callback called with the error, if any, and ListToolsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listTools = function listTools(request, callback) { + return this.rpcCall(listTools, $root.google.cloud.ces.v1beta.ListToolsRequest, $root.google.cloud.ces.v1beta.ListToolsResponse, request, callback); + }, "name", { value: "ListTools" }); + + /** + * Calls ListTools. + * @function listTools + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListToolsRequest} request ListToolsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getTool}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Tool} [response] Tool + */ + + /** + * Calls GetTool. + * @function getTool + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetToolRequest} request GetToolRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetToolCallback} callback Node-style callback called with the error, if any, and Tool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getTool = function getTool(request, callback) { + return this.rpcCall(getTool, $root.google.cloud.ces.v1beta.GetToolRequest, $root.google.cloud.ces.v1beta.Tool, request, callback); + }, "name", { value: "GetTool" }); + + /** + * Calls GetTool. + * @function getTool + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetToolRequest} request GetToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listConversations}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListConversationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListConversationsResponse} [response] ListConversationsResponse + */ + + /** + * Calls ListConversations. + * @function listConversations + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListConversationsRequest} request ListConversationsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListConversationsCallback} callback Node-style callback called with the error, if any, and ListConversationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listConversations = function listConversations(request, callback) { + return this.rpcCall(listConversations, $root.google.cloud.ces.v1beta.ListConversationsRequest, $root.google.cloud.ces.v1beta.ListConversationsResponse, request, callback); + }, "name", { value: "ListConversations" }); + + /** + * Calls ListConversations. + * @function listConversations + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListConversationsRequest} request ListConversationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getConversation}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetConversationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Conversation} [response] Conversation + */ + + /** + * Calls GetConversation. + * @function getConversation + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetConversationRequest} request GetConversationRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetConversationCallback} callback Node-style callback called with the error, if any, and Conversation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getConversation = function getConversation(request, callback) { + return this.rpcCall(getConversation, $root.google.cloud.ces.v1beta.GetConversationRequest, $root.google.cloud.ces.v1beta.Conversation, request, callback); + }, "name", { value: "GetConversation" }); + + /** + * Calls GetConversation. + * @function getConversation + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetConversationRequest} request GetConversationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteConversation}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef DeleteConversationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteConversation. + * @function deleteConversation + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteConversationRequest} request DeleteConversationRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.DeleteConversationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteConversation = function deleteConversation(request, callback) { + return this.rpcCall(deleteConversation, $root.google.cloud.ces.v1beta.DeleteConversationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteConversation" }); + + /** + * Calls DeleteConversation. + * @function deleteConversation + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteConversationRequest} request DeleteConversationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|batchDeleteConversations}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef BatchDeleteConversationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchDeleteConversations. + * @function batchDeleteConversations + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsRequest} request BatchDeleteConversationsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.BatchDeleteConversationsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.batchDeleteConversations = function batchDeleteConversations(request, callback) { + return this.rpcCall(batchDeleteConversations, $root.google.cloud.ces.v1beta.BatchDeleteConversationsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchDeleteConversations" }); + + /** + * Calls BatchDeleteConversations. + * @function batchDeleteConversations + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsRequest} request BatchDeleteConversationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createTool}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef CreateToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Tool} [response] Tool + */ + + /** + * Calls CreateTool. + * @function createTool + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateToolRequest} request CreateToolRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.CreateToolCallback} callback Node-style callback called with the error, if any, and Tool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createTool = function createTool(request, callback) { + return this.rpcCall(createTool, $root.google.cloud.ces.v1beta.CreateToolRequest, $root.google.cloud.ces.v1beta.Tool, request, callback); + }, "name", { value: "CreateTool" }); + + /** + * Calls CreateTool. + * @function createTool + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateToolRequest} request CreateToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateTool}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef UpdateToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Tool} [response] Tool + */ + + /** + * Calls UpdateTool. + * @function updateTool + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateToolRequest} request UpdateToolRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.UpdateToolCallback} callback Node-style callback called with the error, if any, and Tool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateTool = function updateTool(request, callback) { + return this.rpcCall(updateTool, $root.google.cloud.ces.v1beta.UpdateToolRequest, $root.google.cloud.ces.v1beta.Tool, request, callback); + }, "name", { value: "UpdateTool" }); + + /** + * Calls UpdateTool. + * @function updateTool + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateToolRequest} request UpdateToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteTool}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef DeleteToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTool. + * @function deleteTool + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteToolRequest} request DeleteToolRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.DeleteToolCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteTool = function deleteTool(request, callback) { + return this.rpcCall(deleteTool, $root.google.cloud.ces.v1beta.DeleteToolRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTool" }); + + /** + * Calls DeleteTool. + * @function deleteTool + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteToolRequest} request DeleteToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listGuardrails}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListGuardrailsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListGuardrailsResponse} [response] ListGuardrailsResponse + */ + + /** + * Calls ListGuardrails. + * @function listGuardrails + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListGuardrailsRequest} request ListGuardrailsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListGuardrailsCallback} callback Node-style callback called with the error, if any, and ListGuardrailsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listGuardrails = function listGuardrails(request, callback) { + return this.rpcCall(listGuardrails, $root.google.cloud.ces.v1beta.ListGuardrailsRequest, $root.google.cloud.ces.v1beta.ListGuardrailsResponse, request, callback); + }, "name", { value: "ListGuardrails" }); + + /** + * Calls ListGuardrails. + * @function listGuardrails + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListGuardrailsRequest} request ListGuardrailsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getGuardrail}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetGuardrailCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Guardrail} [response] Guardrail + */ + + /** + * Calls GetGuardrail. + * @function getGuardrail + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetGuardrailRequest} request GetGuardrailRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetGuardrailCallback} callback Node-style callback called with the error, if any, and Guardrail + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getGuardrail = function getGuardrail(request, callback) { + return this.rpcCall(getGuardrail, $root.google.cloud.ces.v1beta.GetGuardrailRequest, $root.google.cloud.ces.v1beta.Guardrail, request, callback); + }, "name", { value: "GetGuardrail" }); + + /** + * Calls GetGuardrail. + * @function getGuardrail + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetGuardrailRequest} request GetGuardrailRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createGuardrail}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef CreateGuardrailCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Guardrail} [response] Guardrail + */ + + /** + * Calls CreateGuardrail. + * @function createGuardrail + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateGuardrailRequest} request CreateGuardrailRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.CreateGuardrailCallback} callback Node-style callback called with the error, if any, and Guardrail + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createGuardrail = function createGuardrail(request, callback) { + return this.rpcCall(createGuardrail, $root.google.cloud.ces.v1beta.CreateGuardrailRequest, $root.google.cloud.ces.v1beta.Guardrail, request, callback); + }, "name", { value: "CreateGuardrail" }); + + /** + * Calls CreateGuardrail. + * @function createGuardrail + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateGuardrailRequest} request CreateGuardrailRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateGuardrail}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef UpdateGuardrailCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Guardrail} [response] Guardrail + */ + + /** + * Calls UpdateGuardrail. + * @function updateGuardrail + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateGuardrailRequest} request UpdateGuardrailRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.UpdateGuardrailCallback} callback Node-style callback called with the error, if any, and Guardrail + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateGuardrail = function updateGuardrail(request, callback) { + return this.rpcCall(updateGuardrail, $root.google.cloud.ces.v1beta.UpdateGuardrailRequest, $root.google.cloud.ces.v1beta.Guardrail, request, callback); + }, "name", { value: "UpdateGuardrail" }); + + /** + * Calls UpdateGuardrail. + * @function updateGuardrail + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateGuardrailRequest} request UpdateGuardrailRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteGuardrail}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef DeleteGuardrailCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteGuardrail. + * @function deleteGuardrail + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteGuardrailRequest} request DeleteGuardrailRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.DeleteGuardrailCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteGuardrail = function deleteGuardrail(request, callback) { + return this.rpcCall(deleteGuardrail, $root.google.cloud.ces.v1beta.DeleteGuardrailRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteGuardrail" }); + + /** + * Calls DeleteGuardrail. + * @function deleteGuardrail + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteGuardrailRequest} request DeleteGuardrailRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listDeployments}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListDeploymentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListDeploymentsResponse} [response] ListDeploymentsResponse + */ + + /** + * Calls ListDeployments. + * @function listDeployments + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListDeploymentsCallback} callback Node-style callback called with the error, if any, and ListDeploymentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listDeployments = function listDeployments(request, callback) { + return this.rpcCall(listDeployments, $root.google.cloud.ces.v1beta.ListDeploymentsRequest, $root.google.cloud.ces.v1beta.ListDeploymentsResponse, request, callback); + }, "name", { value: "ListDeployments" }); + + /** + * Calls ListDeployments. + * @function listDeployments + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getDeployment}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Deployment} [response] Deployment + */ + + /** + * Calls GetDeployment. + * @function getDeployment + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetDeploymentRequest} request GetDeploymentRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getDeployment = function getDeployment(request, callback) { + return this.rpcCall(getDeployment, $root.google.cloud.ces.v1beta.GetDeploymentRequest, $root.google.cloud.ces.v1beta.Deployment, request, callback); + }, "name", { value: "GetDeployment" }); + + /** + * Calls GetDeployment. + * @function getDeployment + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetDeploymentRequest} request GetDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createDeployment}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef CreateDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Deployment} [response] Deployment + */ + + /** + * Calls CreateDeployment. + * @function createDeployment + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateDeploymentRequest} request CreateDeploymentRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.CreateDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createDeployment = function createDeployment(request, callback) { + return this.rpcCall(createDeployment, $root.google.cloud.ces.v1beta.CreateDeploymentRequest, $root.google.cloud.ces.v1beta.Deployment, request, callback); + }, "name", { value: "CreateDeployment" }); + + /** + * Calls CreateDeployment. + * @function createDeployment + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateDeploymentRequest} request CreateDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateDeployment}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef UpdateDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Deployment} [response] Deployment + */ + + /** + * Calls UpdateDeployment. + * @function updateDeployment + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateDeploymentRequest} request UpdateDeploymentRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.UpdateDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateDeployment = function updateDeployment(request, callback) { + return this.rpcCall(updateDeployment, $root.google.cloud.ces.v1beta.UpdateDeploymentRequest, $root.google.cloud.ces.v1beta.Deployment, request, callback); + }, "name", { value: "UpdateDeployment" }); + + /** + * Calls UpdateDeployment. + * @function updateDeployment + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateDeploymentRequest} request UpdateDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteDeployment}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef DeleteDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDeployment. + * @function deleteDeployment + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteDeploymentRequest} request DeleteDeploymentRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.DeleteDeploymentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteDeployment = function deleteDeployment(request, callback) { + return this.rpcCall(deleteDeployment, $root.google.cloud.ces.v1beta.DeleteDeploymentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDeployment" }); + + /** + * Calls DeleteDeployment. + * @function deleteDeployment + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteDeploymentRequest} request DeleteDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listToolsets}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListToolsetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListToolsetsResponse} [response] ListToolsetsResponse + */ + + /** + * Calls ListToolsets. + * @function listToolsets + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListToolsetsRequest} request ListToolsetsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListToolsetsCallback} callback Node-style callback called with the error, if any, and ListToolsetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listToolsets = function listToolsets(request, callback) { + return this.rpcCall(listToolsets, $root.google.cloud.ces.v1beta.ListToolsetsRequest, $root.google.cloud.ces.v1beta.ListToolsetsResponse, request, callback); + }, "name", { value: "ListToolsets" }); + + /** + * Calls ListToolsets. + * @function listToolsets + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListToolsetsRequest} request ListToolsetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getToolset}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetToolsetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Toolset} [response] Toolset + */ + + /** + * Calls GetToolset. + * @function getToolset + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetToolsetRequest} request GetToolsetRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetToolsetCallback} callback Node-style callback called with the error, if any, and Toolset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getToolset = function getToolset(request, callback) { + return this.rpcCall(getToolset, $root.google.cloud.ces.v1beta.GetToolsetRequest, $root.google.cloud.ces.v1beta.Toolset, request, callback); + }, "name", { value: "GetToolset" }); + + /** + * Calls GetToolset. + * @function getToolset + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetToolsetRequest} request GetToolsetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createToolset}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef CreateToolsetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Toolset} [response] Toolset + */ + + /** + * Calls CreateToolset. + * @function createToolset + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateToolsetRequest} request CreateToolsetRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.CreateToolsetCallback} callback Node-style callback called with the error, if any, and Toolset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createToolset = function createToolset(request, callback) { + return this.rpcCall(createToolset, $root.google.cloud.ces.v1beta.CreateToolsetRequest, $root.google.cloud.ces.v1beta.Toolset, request, callback); + }, "name", { value: "CreateToolset" }); + + /** + * Calls CreateToolset. + * @function createToolset + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateToolsetRequest} request CreateToolsetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|updateToolset}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef UpdateToolsetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Toolset} [response] Toolset + */ + + /** + * Calls UpdateToolset. + * @function updateToolset + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateToolsetRequest} request UpdateToolsetRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.UpdateToolsetCallback} callback Node-style callback called with the error, if any, and Toolset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.updateToolset = function updateToolset(request, callback) { + return this.rpcCall(updateToolset, $root.google.cloud.ces.v1beta.UpdateToolsetRequest, $root.google.cloud.ces.v1beta.Toolset, request, callback); + }, "name", { value: "UpdateToolset" }); + + /** + * Calls UpdateToolset. + * @function updateToolset + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateToolsetRequest} request UpdateToolsetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteToolset}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef DeleteToolsetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteToolset. + * @function deleteToolset + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteToolsetRequest} request DeleteToolsetRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.DeleteToolsetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteToolset = function deleteToolset(request, callback) { + return this.rpcCall(deleteToolset, $root.google.cloud.ces.v1beta.DeleteToolsetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteToolset" }); + + /** + * Calls DeleteToolset. + * @function deleteToolset + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteToolsetRequest} request DeleteToolsetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listAppVersions}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListAppVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListAppVersionsResponse} [response] ListAppVersionsResponse + */ + + /** + * Calls ListAppVersions. + * @function listAppVersions + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListAppVersionsRequest} request ListAppVersionsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListAppVersionsCallback} callback Node-style callback called with the error, if any, and ListAppVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listAppVersions = function listAppVersions(request, callback) { + return this.rpcCall(listAppVersions, $root.google.cloud.ces.v1beta.ListAppVersionsRequest, $root.google.cloud.ces.v1beta.ListAppVersionsResponse, request, callback); + }, "name", { value: "ListAppVersions" }); + + /** + * Calls ListAppVersions. + * @function listAppVersions + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListAppVersionsRequest} request ListAppVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getAppVersion}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetAppVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.AppVersion} [response] AppVersion + */ + + /** + * Calls GetAppVersion. + * @function getAppVersion + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetAppVersionRequest} request GetAppVersionRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetAppVersionCallback} callback Node-style callback called with the error, if any, and AppVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getAppVersion = function getAppVersion(request, callback) { + return this.rpcCall(getAppVersion, $root.google.cloud.ces.v1beta.GetAppVersionRequest, $root.google.cloud.ces.v1beta.AppVersion, request, callback); + }, "name", { value: "GetAppVersion" }); + + /** + * Calls GetAppVersion. + * @function getAppVersion + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetAppVersionRequest} request GetAppVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|createAppVersion}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef CreateAppVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.AppVersion} [response] AppVersion + */ + + /** + * Calls CreateAppVersion. + * @function createAppVersion + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateAppVersionRequest} request CreateAppVersionRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.CreateAppVersionCallback} callback Node-style callback called with the error, if any, and AppVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.createAppVersion = function createAppVersion(request, callback) { + return this.rpcCall(createAppVersion, $root.google.cloud.ces.v1beta.CreateAppVersionRequest, $root.google.cloud.ces.v1beta.AppVersion, request, callback); + }, "name", { value: "CreateAppVersion" }); + + /** + * Calls CreateAppVersion. + * @function createAppVersion + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.ICreateAppVersionRequest} request CreateAppVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|deleteAppVersion}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef DeleteAppVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAppVersion. + * @function deleteAppVersion + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteAppVersionRequest} request DeleteAppVersionRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.DeleteAppVersionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.deleteAppVersion = function deleteAppVersion(request, callback) { + return this.rpcCall(deleteAppVersion, $root.google.cloud.ces.v1beta.DeleteAppVersionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAppVersion" }); + + /** + * Calls DeleteAppVersion. + * @function deleteAppVersion + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteAppVersionRequest} request DeleteAppVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|restoreAppVersion}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef RestoreAppVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreAppVersion. + * @function restoreAppVersion + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IRestoreAppVersionRequest} request RestoreAppVersionRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.RestoreAppVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.restoreAppVersion = function restoreAppVersion(request, callback) { + return this.rpcCall(restoreAppVersion, $root.google.cloud.ces.v1beta.RestoreAppVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreAppVersion" }); + + /** + * Calls RestoreAppVersion. + * @function restoreAppVersion + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IRestoreAppVersionRequest} request RestoreAppVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listChangelogs}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef ListChangelogsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListChangelogsResponse} [response] ListChangelogsResponse + */ + + /** + * Calls ListChangelogs. + * @function listChangelogs + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListChangelogsRequest} request ListChangelogsRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.ListChangelogsCallback} callback Node-style callback called with the error, if any, and ListChangelogsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.listChangelogs = function listChangelogs(request, callback) { + return this.rpcCall(listChangelogs, $root.google.cloud.ces.v1beta.ListChangelogsRequest, $root.google.cloud.ces.v1beta.ListChangelogsResponse, request, callback); + }, "name", { value: "ListChangelogs" }); + + /** + * Calls ListChangelogs. + * @function listChangelogs + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IListChangelogsRequest} request ListChangelogsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|getChangelog}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GetChangelogCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Changelog} [response] Changelog + */ + + /** + * Calls GetChangelog. + * @function getChangelog + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetChangelogRequest} request GetChangelogRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GetChangelogCallback} callback Node-style callback called with the error, if any, and Changelog + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.getChangelog = function getChangelog(request, callback) { + return this.rpcCall(getChangelog, $root.google.cloud.ces.v1beta.GetChangelogRequest, $root.google.cloud.ces.v1beta.Changelog, request, callback); + }, "name", { value: "GetChangelog" }); + + /** + * Calls GetChangelog. + * @function getChangelog + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGetChangelogRequest} request GetChangelogRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AgentService; + })(); + + v1beta.ListAppsRequest = (function() { + + /** + * Properties of a ListAppsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListAppsRequest + * @property {string|null} [parent] ListAppsRequest parent + * @property {number|null} [pageSize] ListAppsRequest pageSize + * @property {string|null} [pageToken] ListAppsRequest pageToken + * @property {string|null} [filter] ListAppsRequest filter + * @property {string|null} [orderBy] ListAppsRequest orderBy + */ + + /** + * Constructs a new ListAppsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListAppsRequest. + * @implements IListAppsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListAppsRequest=} [properties] Properties to set + */ + function ListAppsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAppsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @instance + */ + ListAppsRequest.prototype.parent = ""; + + /** + * ListAppsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @instance + */ + ListAppsRequest.prototype.pageSize = 0; + + /** + * ListAppsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @instance + */ + ListAppsRequest.prototype.pageToken = ""; + + /** + * ListAppsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @instance + */ + ListAppsRequest.prototype.filter = ""; + + /** + * ListAppsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @instance + */ + ListAppsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListAppsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @static + * @param {google.cloud.ces.v1beta.IListAppsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListAppsRequest} ListAppsRequest instance + */ + ListAppsRequest.create = function create(properties) { + return new ListAppsRequest(properties); + }; + + /** + * Encodes the specified ListAppsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @static + * @param {google.cloud.ces.v1beta.IListAppsRequest} message ListAppsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppsRequest.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 ListAppsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @static + * @param {google.cloud.ces.v1beta.IListAppsRequest} message ListAppsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAppsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListAppsRequest} ListAppsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListAppsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAppsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListAppsRequest} ListAppsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAppsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAppsRequest.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 ListAppsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListAppsRequest} ListAppsRequest + */ + ListAppsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListAppsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListAppsRequest(); + 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 ListAppsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @static + * @param {google.cloud.ces.v1beta.ListAppsRequest} message ListAppsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAppsRequest.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 ListAppsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAppsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAppsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListAppsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAppsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListAppsRequest"; + }; + + return ListAppsRequest; + })(); + + v1beta.ListAppsResponse = (function() { + + /** + * Properties of a ListAppsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListAppsResponse + * @property {Array.|null} [apps] ListAppsResponse apps + * @property {string|null} [nextPageToken] ListAppsResponse nextPageToken + * @property {Array.|null} [unreachable] ListAppsResponse unreachable + */ + + /** + * Constructs a new ListAppsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListAppsResponse. + * @implements IListAppsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListAppsResponse=} [properties] Properties to set + */ + function ListAppsResponse(properties) { + this.apps = []; + 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]]; + } + + /** + * ListAppsResponse apps. + * @member {Array.} apps + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @instance + */ + ListAppsResponse.prototype.apps = $util.emptyArray; + + /** + * ListAppsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @instance + */ + ListAppsResponse.prototype.nextPageToken = ""; + + /** + * ListAppsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @instance + */ + ListAppsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListAppsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @static + * @param {google.cloud.ces.v1beta.IListAppsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListAppsResponse} ListAppsResponse instance + */ + ListAppsResponse.create = function create(properties) { + return new ListAppsResponse(properties); + }; + + /** + * Encodes the specified ListAppsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @static + * @param {google.cloud.ces.v1beta.IListAppsResponse} message ListAppsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apps != null && message.apps.length) + for (var i = 0; i < message.apps.length; ++i) + $root.google.cloud.ces.v1beta.App.encode(message.apps[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 ListAppsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @static + * @param {google.cloud.ces.v1beta.IListAppsResponse} message ListAppsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAppsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListAppsResponse} ListAppsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListAppsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.apps && message.apps.length)) + message.apps = []; + message.apps.push($root.google.cloud.ces.v1beta.App.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 ListAppsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListAppsResponse} ListAppsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAppsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAppsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apps != null && message.hasOwnProperty("apps")) { + if (!Array.isArray(message.apps)) + return "apps: array expected"; + for (var i = 0; i < message.apps.length; ++i) { + var error = $root.google.cloud.ces.v1beta.App.verify(message.apps[i]); + if (error) + return "apps." + 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 ListAppsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListAppsResponse} ListAppsResponse + */ + ListAppsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListAppsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListAppsResponse(); + if (object.apps) { + if (!Array.isArray(object.apps)) + throw TypeError(".google.cloud.ces.v1beta.ListAppsResponse.apps: array expected"); + message.apps = []; + for (var i = 0; i < object.apps.length; ++i) { + if (typeof object.apps[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListAppsResponse.apps: object expected"); + message.apps[i] = $root.google.cloud.ces.v1beta.App.fromObject(object.apps[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.ces.v1beta.ListAppsResponse.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 ListAppsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @static + * @param {google.cloud.ces.v1beta.ListAppsResponse} message ListAppsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAppsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.apps = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.apps && message.apps.length) { + object.apps = []; + for (var j = 0; j < message.apps.length; ++j) + object.apps[j] = $root.google.cloud.ces.v1beta.App.toObject(message.apps[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 ListAppsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAppsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAppsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListAppsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAppsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListAppsResponse"; + }; + + return ListAppsResponse; + })(); + + v1beta.GetAppRequest = (function() { + + /** + * Properties of a GetAppRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetAppRequest + * @property {string|null} [name] GetAppRequest name + */ + + /** + * Constructs a new GetAppRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetAppRequest. + * @implements IGetAppRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetAppRequest=} [properties] Properties to set + */ + function GetAppRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAppRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @instance + */ + GetAppRequest.prototype.name = ""; + + /** + * Creates a new GetAppRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @static + * @param {google.cloud.ces.v1beta.IGetAppRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetAppRequest} GetAppRequest instance + */ + GetAppRequest.create = function create(properties) { + return new GetAppRequest(properties); + }; + + /** + * Encodes the specified GetAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetAppRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @static + * @param {google.cloud.ces.v1beta.IGetAppRequest} message GetAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAppRequest.encode = function encode(message, writer) { + 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 GetAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetAppRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @static + * @param {google.cloud.ces.v1beta.IGetAppRequest} message GetAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAppRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAppRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetAppRequest} GetAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAppRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetAppRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAppRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetAppRequest} GetAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAppRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAppRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAppRequest.verify = function verify(message) { + if (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 GetAppRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetAppRequest} GetAppRequest + */ + GetAppRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetAppRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetAppRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAppRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @static + * @param {google.cloud.ces.v1beta.GetAppRequest} message GetAppRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAppRequest.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 GetAppRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @instance + * @returns {Object.} JSON object + */ + GetAppRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAppRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetAppRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetAppRequest"; + }; + + return GetAppRequest; + })(); + + v1beta.CreateAppRequest = (function() { + + /** + * Properties of a CreateAppRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateAppRequest + * @property {string|null} [parent] CreateAppRequest parent + * @property {string|null} [appId] CreateAppRequest appId + * @property {google.cloud.ces.v1beta.IApp|null} [app] CreateAppRequest app + */ + + /** + * Constructs a new CreateAppRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateAppRequest. + * @implements ICreateAppRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateAppRequest=} [properties] Properties to set + */ + function CreateAppRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAppRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @instance + */ + CreateAppRequest.prototype.parent = ""; + + /** + * CreateAppRequest appId. + * @member {string} appId + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @instance + */ + CreateAppRequest.prototype.appId = ""; + + /** + * CreateAppRequest app. + * @member {google.cloud.ces.v1beta.IApp|null|undefined} app + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @instance + */ + CreateAppRequest.prototype.app = null; + + /** + * Creates a new CreateAppRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateAppRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateAppRequest} CreateAppRequest instance + */ + CreateAppRequest.create = function create(properties) { + return new CreateAppRequest(properties); + }; + + /** + * Encodes the specified CreateAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateAppRequest} message CreateAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAppRequest.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.appId != null && Object.hasOwnProperty.call(message, "appId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appId); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + $root.google.cloud.ces.v1beta.App.encode(message.app, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateAppRequest} message CreateAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAppRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAppRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateAppRequest} CreateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAppRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateAppRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.appId = reader.string(); + break; + } + case 3: { + message.app = $root.google.cloud.ces.v1beta.App.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAppRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateAppRequest} CreateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAppRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAppRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAppRequest.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.appId != null && message.hasOwnProperty("appId")) + if (!$util.isString(message.appId)) + return "appId: string expected"; + if (message.app != null && message.hasOwnProperty("app")) { + var error = $root.google.cloud.ces.v1beta.App.verify(message.app); + if (error) + return "app." + error; + } + return null; + }; + + /** + * Creates a CreateAppRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateAppRequest} CreateAppRequest + */ + CreateAppRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateAppRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateAppRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.appId != null) + message.appId = String(object.appId); + if (object.app != null) { + if (typeof object.app !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateAppRequest.app: object expected"); + message.app = $root.google.cloud.ces.v1beta.App.fromObject(object.app); + } + return message; + }; + + /** + * Creates a plain object from a CreateAppRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @static + * @param {google.cloud.ces.v1beta.CreateAppRequest} message CreateAppRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAppRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.appId = ""; + object.app = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.appId != null && message.hasOwnProperty("appId")) + object.appId = message.appId; + if (message.app != null && message.hasOwnProperty("app")) + object.app = $root.google.cloud.ces.v1beta.App.toObject(message.app, options); + return object; + }; + + /** + * Converts this CreateAppRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAppRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAppRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateAppRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateAppRequest"; + }; + + return CreateAppRequest; + })(); + + v1beta.UpdateAppRequest = (function() { + + /** + * Properties of an UpdateAppRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateAppRequest + * @property {google.cloud.ces.v1beta.IApp|null} [app] UpdateAppRequest app + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAppRequest updateMask + */ + + /** + * Constructs a new UpdateAppRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateAppRequest. + * @implements IUpdateAppRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateAppRequest=} [properties] Properties to set + */ + function UpdateAppRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAppRequest app. + * @member {google.cloud.ces.v1beta.IApp|null|undefined} app + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @instance + */ + UpdateAppRequest.prototype.app = null; + + /** + * UpdateAppRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @instance + */ + UpdateAppRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAppRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateAppRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateAppRequest} UpdateAppRequest instance + */ + UpdateAppRequest.create = function create(properties) { + return new UpdateAppRequest(properties); + }; + + /** + * Encodes the specified UpdateAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAppRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateAppRequest} message UpdateAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAppRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + $root.google.cloud.ces.v1beta.App.encode(message.app, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAppRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateAppRequest} message UpdateAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAppRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAppRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateAppRequest} UpdateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAppRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateAppRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.app = $root.google.cloud.ces.v1beta.App.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAppRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateAppRequest} UpdateAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAppRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAppRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAppRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.app != null && message.hasOwnProperty("app")) { + var error = $root.google.cloud.ces.v1beta.App.verify(message.app); + if (error) + return "app." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateAppRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateAppRequest} UpdateAppRequest + */ + UpdateAppRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateAppRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateAppRequest(); + if (object.app != null) { + if (typeof object.app !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateAppRequest.app: object expected"); + message.app = $root.google.cloud.ces.v1beta.App.fromObject(object.app); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateAppRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAppRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateAppRequest} message UpdateAppRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAppRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.app = null; + object.updateMask = null; + } + if (message.app != null && message.hasOwnProperty("app")) + object.app = $root.google.cloud.ces.v1beta.App.toObject(message.app, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAppRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAppRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAppRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateAppRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateAppRequest"; + }; + + return UpdateAppRequest; + })(); + + v1beta.DeleteAppRequest = (function() { + + /** + * Properties of a DeleteAppRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteAppRequest + * @property {string|null} [name] DeleteAppRequest name + * @property {string|null} [etag] DeleteAppRequest etag + */ + + /** + * Constructs a new DeleteAppRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteAppRequest. + * @implements IDeleteAppRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteAppRequest=} [properties] Properties to set + */ + function DeleteAppRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAppRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @instance + */ + DeleteAppRequest.prototype.name = ""; + + /** + * DeleteAppRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @instance + */ + DeleteAppRequest.prototype.etag = ""; + + /** + * Creates a new DeleteAppRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteAppRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteAppRequest} DeleteAppRequest instance + */ + DeleteAppRequest.create = function create(properties) { + return new DeleteAppRequest(properties); + }; + + /** + * Encodes the specified DeleteAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteAppRequest} message DeleteAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAppRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteAppRequest} message DeleteAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAppRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAppRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteAppRequest} DeleteAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAppRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteAppRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAppRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteAppRequest} DeleteAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAppRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAppRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAppRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteAppRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteAppRequest} DeleteAppRequest + */ + DeleteAppRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteAppRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteAppRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteAppRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteAppRequest} message DeleteAppRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAppRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteAppRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAppRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAppRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteAppRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteAppRequest"; + }; + + return DeleteAppRequest; + })(); + + v1beta.ExportAppRequest = (function() { + + /** + * Properties of an ExportAppRequest. + * @memberof google.cloud.ces.v1beta + * @interface IExportAppRequest + * @property {string|null} [name] ExportAppRequest name + * @property {google.cloud.ces.v1beta.ExportAppRequest.ExportFormat|null} [exportFormat] ExportAppRequest exportFormat + * @property {string|null} [gcsUri] ExportAppRequest gcsUri + */ + + /** + * Constructs a new ExportAppRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ExportAppRequest. + * @implements IExportAppRequest + * @constructor + * @param {google.cloud.ces.v1beta.IExportAppRequest=} [properties] Properties to set + */ + function ExportAppRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportAppRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @instance + */ + ExportAppRequest.prototype.name = ""; + + /** + * ExportAppRequest exportFormat. + * @member {google.cloud.ces.v1beta.ExportAppRequest.ExportFormat} exportFormat + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @instance + */ + ExportAppRequest.prototype.exportFormat = 0; + + /** + * ExportAppRequest gcsUri. + * @member {string} gcsUri + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @instance + */ + ExportAppRequest.prototype.gcsUri = ""; + + /** + * Creates a new ExportAppRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @static + * @param {google.cloud.ces.v1beta.IExportAppRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ExportAppRequest} ExportAppRequest instance + */ + ExportAppRequest.create = function create(properties) { + return new ExportAppRequest(properties); + }; + + /** + * Encodes the specified ExportAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @static + * @param {google.cloud.ces.v1beta.IExportAppRequest} message ExportAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAppRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.exportFormat != null && Object.hasOwnProperty.call(message, "exportFormat")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.exportFormat); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsUri); + return writer; + }; + + /** + * Encodes the specified ExportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @static + * @param {google.cloud.ces.v1beta.IExportAppRequest} message ExportAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAppRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAppRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ExportAppRequest} ExportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAppRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ExportAppRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.exportFormat = reader.int32(); + break; + } + case 3: { + message.gcsUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAppRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ExportAppRequest} ExportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAppRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAppRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAppRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.exportFormat != null && message.hasOwnProperty("exportFormat")) + switch (message.exportFormat) { + default: + return "exportFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + return null; + }; + + /** + * Creates an ExportAppRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ExportAppRequest} ExportAppRequest + */ + ExportAppRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ExportAppRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ExportAppRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.exportFormat) { + default: + if (typeof object.exportFormat === "number") { + message.exportFormat = object.exportFormat; + break; + } + break; + case "EXPORT_FORMAT_UNSPECIFIED": + case 0: + message.exportFormat = 0; + break; + case "JSON": + case 1: + message.exportFormat = 1; + break; + case "YAML": + case 2: + message.exportFormat = 2; + break; + } + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + return message; + }; + + /** + * Creates a plain object from an ExportAppRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @static + * @param {google.cloud.ces.v1beta.ExportAppRequest} message ExportAppRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAppRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.exportFormat = options.enums === String ? "EXPORT_FORMAT_UNSPECIFIED" : 0; + object.gcsUri = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.exportFormat != null && message.hasOwnProperty("exportFormat")) + object.exportFormat = options.enums === String ? $root.google.cloud.ces.v1beta.ExportAppRequest.ExportFormat[message.exportFormat] === undefined ? message.exportFormat : $root.google.cloud.ces.v1beta.ExportAppRequest.ExportFormat[message.exportFormat] : message.exportFormat; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + object.gcsUri = message.gcsUri; + return object; + }; + + /** + * Converts this ExportAppRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @instance + * @returns {Object.} JSON object + */ + ExportAppRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportAppRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ExportAppRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ExportAppRequest"; + }; + + /** + * ExportFormat enum. + * @name google.cloud.ces.v1beta.ExportAppRequest.ExportFormat + * @enum {number} + * @property {number} EXPORT_FORMAT_UNSPECIFIED=0 EXPORT_FORMAT_UNSPECIFIED value + * @property {number} JSON=1 JSON value + * @property {number} YAML=2 YAML value + */ + ExportAppRequest.ExportFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXPORT_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "JSON"] = 1; + values[valuesById[2] = "YAML"] = 2; + return values; + })(); + + return ExportAppRequest; + })(); + + v1beta.ExportAppResponse = (function() { + + /** + * Properties of an ExportAppResponse. + * @memberof google.cloud.ces.v1beta + * @interface IExportAppResponse + * @property {Uint8Array|null} [appContent] ExportAppResponse appContent + * @property {string|null} [appUri] ExportAppResponse appUri + */ + + /** + * Constructs a new ExportAppResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ExportAppResponse. + * @implements IExportAppResponse + * @constructor + * @param {google.cloud.ces.v1beta.IExportAppResponse=} [properties] Properties to set + */ + function ExportAppResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportAppResponse appContent. + * @member {Uint8Array|null|undefined} appContent + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @instance + */ + ExportAppResponse.prototype.appContent = null; + + /** + * ExportAppResponse appUri. + * @member {string|null|undefined} appUri + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @instance + */ + ExportAppResponse.prototype.appUri = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportAppResponse app. + * @member {"appContent"|"appUri"|undefined} app + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @instance + */ + Object.defineProperty(ExportAppResponse.prototype, "app", { + get: $util.oneOfGetter($oneOfFields = ["appContent", "appUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportAppResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @static + * @param {google.cloud.ces.v1beta.IExportAppResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ExportAppResponse} ExportAppResponse instance + */ + ExportAppResponse.create = function create(properties) { + return new ExportAppResponse(properties); + }; + + /** + * Encodes the specified ExportAppResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @static + * @param {google.cloud.ces.v1beta.IExportAppResponse} message ExportAppResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAppResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appContent != null && Object.hasOwnProperty.call(message, "appContent")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.appContent); + if (message.appUri != null && Object.hasOwnProperty.call(message, "appUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appUri); + return writer; + }; + + /** + * Encodes the specified ExportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExportAppResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @static + * @param {google.cloud.ces.v1beta.IExportAppResponse} message ExportAppResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAppResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAppResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ExportAppResponse} ExportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAppResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ExportAppResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.appContent = reader.bytes(); + break; + } + case 2: { + message.appUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAppResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ExportAppResponse} ExportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAppResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAppResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAppResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.appContent != null && message.hasOwnProperty("appContent")) { + properties.app = 1; + if (!(message.appContent && typeof message.appContent.length === "number" || $util.isString(message.appContent))) + return "appContent: buffer expected"; + } + if (message.appUri != null && message.hasOwnProperty("appUri")) { + if (properties.app === 1) + return "app: multiple values"; + properties.app = 1; + if (!$util.isString(message.appUri)) + return "appUri: string expected"; + } + return null; + }; + + /** + * Creates an ExportAppResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ExportAppResponse} ExportAppResponse + */ + ExportAppResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ExportAppResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ExportAppResponse(); + if (object.appContent != null) + if (typeof object.appContent === "string") + $util.base64.decode(object.appContent, message.appContent = $util.newBuffer($util.base64.length(object.appContent)), 0); + else if (object.appContent.length >= 0) + message.appContent = object.appContent; + if (object.appUri != null) + message.appUri = String(object.appUri); + return message; + }; + + /** + * Creates a plain object from an ExportAppResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @static + * @param {google.cloud.ces.v1beta.ExportAppResponse} message ExportAppResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAppResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.appContent != null && message.hasOwnProperty("appContent")) { + object.appContent = options.bytes === String ? $util.base64.encode(message.appContent, 0, message.appContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.appContent) : message.appContent; + if (options.oneofs) + object.app = "appContent"; + } + if (message.appUri != null && message.hasOwnProperty("appUri")) { + object.appUri = message.appUri; + if (options.oneofs) + object.app = "appUri"; + } + return object; + }; + + /** + * Converts this ExportAppResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @instance + * @returns {Object.} JSON object + */ + ExportAppResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportAppResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ExportAppResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportAppResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ExportAppResponse"; + }; + + return ExportAppResponse; + })(); + + v1beta.ImportAppRequest = (function() { + + /** + * Properties of an ImportAppRequest. + * @memberof google.cloud.ces.v1beta + * @interface IImportAppRequest + * @property {string|null} [gcsUri] ImportAppRequest gcsUri + * @property {Uint8Array|null} [appContent] ImportAppRequest appContent + * @property {string|null} [parent] ImportAppRequest parent + * @property {string|null} [displayName] ImportAppRequest displayName + * @property {string|null} [appId] ImportAppRequest appId + * @property {google.cloud.ces.v1beta.ImportAppRequest.IImportOptions|null} [importOptions] ImportAppRequest importOptions + * @property {boolean|null} [ignoreAppLock] ImportAppRequest ignoreAppLock + */ + + /** + * Constructs a new ImportAppRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ImportAppRequest. + * @implements IImportAppRequest + * @constructor + * @param {google.cloud.ces.v1beta.IImportAppRequest=} [properties] Properties to set + */ + function ImportAppRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportAppRequest gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.gcsUri = null; + + /** + * ImportAppRequest appContent. + * @member {Uint8Array|null|undefined} appContent + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.appContent = null; + + /** + * ImportAppRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.parent = ""; + + /** + * ImportAppRequest displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.displayName = ""; + + /** + * ImportAppRequest appId. + * @member {string} appId + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.appId = ""; + + /** + * ImportAppRequest importOptions. + * @member {google.cloud.ces.v1beta.ImportAppRequest.IImportOptions|null|undefined} importOptions + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.importOptions = null; + + /** + * ImportAppRequest ignoreAppLock. + * @member {boolean} ignoreAppLock + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @instance + */ + ImportAppRequest.prototype.ignoreAppLock = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportAppRequest app. + * @member {"gcsUri"|"appContent"|undefined} app + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @instance + */ + Object.defineProperty(ImportAppRequest.prototype, "app", { + get: $util.oneOfGetter($oneOfFields = ["gcsUri", "appContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportAppRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @static + * @param {google.cloud.ces.v1beta.IImportAppRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ImportAppRequest} ImportAppRequest instance + */ + ImportAppRequest.create = function create(properties) { + return new ImportAppRequest(properties); + }; + + /** + * Encodes the specified ImportAppRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @static + * @param {google.cloud.ces.v1beta.IImportAppRequest} message ImportAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportAppRequest.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.appId != null && Object.hasOwnProperty.call(message, "appId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.appId); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.gcsUri); + if (message.appContent != null && Object.hasOwnProperty.call(message, "appContent")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.appContent); + if (message.importOptions != null && Object.hasOwnProperty.call(message, "importOptions")) + $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.encode(message.importOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.ignoreAppLock != null && Object.hasOwnProperty.call(message, "ignoreAppLock")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.ignoreAppLock); + return writer; + }; + + /** + * Encodes the specified ImportAppRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @static + * @param {google.cloud.ces.v1beta.IImportAppRequest} message ImportAppRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportAppRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportAppRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ImportAppRequest} ImportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportAppRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportAppRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.gcsUri = reader.string(); + break; + } + case 5: { + message.appContent = reader.bytes(); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.appId = reader.string(); + break; + } + case 6: { + message.importOptions = $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.decode(reader, reader.uint32()); + break; + } + case 7: { + message.ignoreAppLock = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportAppRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ImportAppRequest} ImportAppRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportAppRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportAppRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportAppRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + properties.app = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + if (message.appContent != null && message.hasOwnProperty("appContent")) { + if (properties.app === 1) + return "app: multiple values"; + properties.app = 1; + if (!(message.appContent && typeof message.appContent.length === "number" || $util.isString(message.appContent))) + return "appContent: buffer expected"; + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.appId != null && message.hasOwnProperty("appId")) + if (!$util.isString(message.appId)) + return "appId: string expected"; + if (message.importOptions != null && message.hasOwnProperty("importOptions")) { + var error = $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.verify(message.importOptions); + if (error) + return "importOptions." + error; + } + if (message.ignoreAppLock != null && message.hasOwnProperty("ignoreAppLock")) + if (typeof message.ignoreAppLock !== "boolean") + return "ignoreAppLock: boolean expected"; + return null; + }; + + /** + * Creates an ImportAppRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ImportAppRequest} ImportAppRequest + */ + ImportAppRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ImportAppRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ImportAppRequest(); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.appContent != null) + if (typeof object.appContent === "string") + $util.base64.decode(object.appContent, message.appContent = $util.newBuffer($util.base64.length(object.appContent)), 0); + else if (object.appContent.length >= 0) + message.appContent = object.appContent; + if (object.parent != null) + message.parent = String(object.parent); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.appId != null) + message.appId = String(object.appId); + if (object.importOptions != null) { + if (typeof object.importOptions !== "object") + throw TypeError(".google.cloud.ces.v1beta.ImportAppRequest.importOptions: object expected"); + message.importOptions = $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.fromObject(object.importOptions); + } + if (object.ignoreAppLock != null) + message.ignoreAppLock = Boolean(object.ignoreAppLock); + return message; + }; + + /** + * Creates a plain object from an ImportAppRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @static + * @param {google.cloud.ces.v1beta.ImportAppRequest} message ImportAppRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportAppRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.displayName = ""; + object.appId = ""; + object.importOptions = null; + object.ignoreAppLock = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.appId != null && message.hasOwnProperty("appId")) + object.appId = message.appId; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.app = "gcsUri"; + } + if (message.appContent != null && message.hasOwnProperty("appContent")) { + object.appContent = options.bytes === String ? $util.base64.encode(message.appContent, 0, message.appContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.appContent) : message.appContent; + if (options.oneofs) + object.app = "appContent"; + } + if (message.importOptions != null && message.hasOwnProperty("importOptions")) + object.importOptions = $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.toObject(message.importOptions, options); + if (message.ignoreAppLock != null && message.hasOwnProperty("ignoreAppLock")) + object.ignoreAppLock = message.ignoreAppLock; + return object; + }; + + /** + * Converts this ImportAppRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @instance + * @returns {Object.} JSON object + */ + ImportAppRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportAppRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportAppRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportAppRequest"; + }; + + ImportAppRequest.ImportOptions = (function() { + + /** + * Properties of an ImportOptions. + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @interface IImportOptions + * @property {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy|null} [conflictResolutionStrategy] ImportOptions conflictResolutionStrategy + */ + + /** + * Constructs a new ImportOptions. + * @memberof google.cloud.ces.v1beta.ImportAppRequest + * @classdesc Represents an ImportOptions. + * @implements IImportOptions + * @constructor + * @param {google.cloud.ces.v1beta.ImportAppRequest.IImportOptions=} [properties] Properties to set + */ + function ImportOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportOptions conflictResolutionStrategy. + * @member {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy} conflictResolutionStrategy + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @instance + */ + ImportOptions.prototype.conflictResolutionStrategy = 0; + + /** + * Creates a new ImportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1beta.ImportAppRequest.IImportOptions=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions} ImportOptions instance + */ + ImportOptions.create = function create(properties) { + return new ImportOptions(properties); + }; + + /** + * Encodes the specified ImportOptions message. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1beta.ImportAppRequest.IImportOptions} message ImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conflictResolutionStrategy != null && Object.hasOwnProperty.call(message, "conflictResolutionStrategy")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.conflictResolutionStrategy); + return writer; + }; + + /** + * Encodes the specified ImportOptions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1beta.ImportAppRequest.IImportOptions} message ImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions} ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.conflictResolutionStrategy = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions} ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportOptions message. + * @function verify + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conflictResolutionStrategy != null && message.hasOwnProperty("conflictResolutionStrategy")) + switch (message.conflictResolutionStrategy) { + default: + return "conflictResolutionStrategy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ImportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions} ImportOptions + */ + ImportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions) + return object; + var message = new $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions(); + switch (object.conflictResolutionStrategy) { + default: + if (typeof object.conflictResolutionStrategy === "number") { + message.conflictResolutionStrategy = object.conflictResolutionStrategy; + break; + } + break; + case "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED": + case 0: + message.conflictResolutionStrategy = 0; + break; + case "REPLACE": + case 1: + message.conflictResolutionStrategy = 1; + break; + case "OVERWRITE": + case 2: + message.conflictResolutionStrategy = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ImportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1beta.ImportAppRequest.ImportOptions} message ImportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.conflictResolutionStrategy = options.enums === String ? "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED" : 0; + if (message.conflictResolutionStrategy != null && message.hasOwnProperty("conflictResolutionStrategy")) + object.conflictResolutionStrategy = options.enums === String ? $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy[message.conflictResolutionStrategy] === undefined ? message.conflictResolutionStrategy : $root.google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy[message.conflictResolutionStrategy] : message.conflictResolutionStrategy; + return object; + }; + + /** + * Converts this ImportOptions to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @instance + * @returns {Object.} JSON object + */ + ImportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportOptions + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ImportAppRequest.ImportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportAppRequest.ImportOptions"; + }; + + /** + * ConflictResolutionStrategy enum. + * @name google.cloud.ces.v1beta.ImportAppRequest.ImportOptions.ConflictResolutionStrategy + * @enum {number} + * @property {number} CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED=0 CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED value + * @property {number} REPLACE=1 REPLACE value + * @property {number} OVERWRITE=2 OVERWRITE value + */ + ImportOptions.ConflictResolutionStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "REPLACE"] = 1; + values[valuesById[2] = "OVERWRITE"] = 2; + return values; + })(); + + return ImportOptions; + })(); + + return ImportAppRequest; + })(); + + v1beta.ImportAppResponse = (function() { + + /** + * Properties of an ImportAppResponse. + * @memberof google.cloud.ces.v1beta + * @interface IImportAppResponse + * @property {string|null} [name] ImportAppResponse name + * @property {Array.|null} [warnings] ImportAppResponse warnings + */ + + /** + * Constructs a new ImportAppResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ImportAppResponse. + * @implements IImportAppResponse + * @constructor + * @param {google.cloud.ces.v1beta.IImportAppResponse=} [properties] Properties to set + */ + function ImportAppResponse(properties) { + this.warnings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportAppResponse name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @instance + */ + ImportAppResponse.prototype.name = ""; + + /** + * ImportAppResponse warnings. + * @member {Array.} warnings + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @instance + */ + ImportAppResponse.prototype.warnings = $util.emptyArray; + + /** + * Creates a new ImportAppResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @static + * @param {google.cloud.ces.v1beta.IImportAppResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ImportAppResponse} ImportAppResponse instance + */ + ImportAppResponse.create = function create(properties) { + return new ImportAppResponse(properties); + }; + + /** + * Encodes the specified ImportAppResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @static + * @param {google.cloud.ces.v1beta.IImportAppResponse} message ImportAppResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportAppResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.warnings != null && message.warnings.length) + for (var i = 0; i < message.warnings.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.warnings[i]); + return writer; + }; + + /** + * Encodes the specified ImportAppResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportAppResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @static + * @param {google.cloud.ces.v1beta.IImportAppResponse} message ImportAppResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportAppResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportAppResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ImportAppResponse} ImportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportAppResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportAppResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportAppResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ImportAppResponse} ImportAppResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportAppResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportAppResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportAppResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.warnings != null && message.hasOwnProperty("warnings")) { + if (!Array.isArray(message.warnings)) + return "warnings: array expected"; + for (var i = 0; i < message.warnings.length; ++i) + if (!$util.isString(message.warnings[i])) + return "warnings: string[] expected"; + } + return null; + }; + + /** + * Creates an ImportAppResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ImportAppResponse} ImportAppResponse + */ + ImportAppResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ImportAppResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ImportAppResponse(); + if (object.name != null) + message.name = String(object.name); + if (object.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.cloud.ces.v1beta.ImportAppResponse.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) + message.warnings[i] = String(object.warnings[i]); + } + return message; + }; + + /** + * Creates a plain object from an ImportAppResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @static + * @param {google.cloud.ces.v1beta.ImportAppResponse} message ImportAppResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportAppResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.warnings = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = message.warnings[j]; + } + return object; + }; + + /** + * Converts this ImportAppResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @instance + * @returns {Object.} JSON object + */ + ImportAppResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportAppResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ImportAppResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportAppResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportAppResponse"; + }; + + return ImportAppResponse; + })(); + + v1beta.ListAgentsRequest = (function() { + + /** + * Properties of a ListAgentsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListAgentsRequest + * @property {string|null} [parent] ListAgentsRequest parent + * @property {number|null} [pageSize] ListAgentsRequest pageSize + * @property {string|null} [pageToken] ListAgentsRequest pageToken + * @property {string|null} [filter] ListAgentsRequest filter + * @property {string|null} [orderBy] ListAgentsRequest orderBy + */ + + /** + * Constructs a new ListAgentsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListAgentsRequest. + * @implements IListAgentsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListAgentsRequest=} [properties] Properties to set + */ + function ListAgentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAgentsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.parent = ""; + + /** + * ListAgentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.pageSize = 0; + + /** + * ListAgentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.pageToken = ""; + + /** + * ListAgentsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.filter = ""; + + /** + * ListAgentsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @instance + */ + ListAgentsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListAgentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @static + * @param {google.cloud.ces.v1beta.IListAgentsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListAgentsRequest} ListAgentsRequest instance + */ + ListAgentsRequest.create = function create(properties) { + return new ListAgentsRequest(properties); + }; + + /** + * Encodes the specified ListAgentsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @static + * @param {google.cloud.ces.v1beta.IListAgentsRequest} message ListAgentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsRequest.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 ListAgentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @static + * @param {google.cloud.ces.v1beta.IListAgentsRequest} message ListAgentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListAgentsRequest} ListAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListAgentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAgentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListAgentsRequest} ListAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAgentsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAgentsRequest.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 ListAgentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListAgentsRequest} ListAgentsRequest + */ + ListAgentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListAgentsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListAgentsRequest(); + 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 ListAgentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @static + * @param {google.cloud.ces.v1beta.ListAgentsRequest} message ListAgentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAgentsRequest.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 ListAgentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAgentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAgentsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListAgentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAgentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListAgentsRequest"; + }; + + return ListAgentsRequest; + })(); + + v1beta.ListAgentsResponse = (function() { + + /** + * Properties of a ListAgentsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListAgentsResponse + * @property {Array.|null} [agents] ListAgentsResponse agents + * @property {string|null} [nextPageToken] ListAgentsResponse nextPageToken + */ + + /** + * Constructs a new ListAgentsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListAgentsResponse. + * @implements IListAgentsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListAgentsResponse=} [properties] Properties to set + */ + function ListAgentsResponse(properties) { + this.agents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAgentsResponse agents. + * @member {Array.} agents + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @instance + */ + ListAgentsResponse.prototype.agents = $util.emptyArray; + + /** + * ListAgentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @instance + */ + ListAgentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAgentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @static + * @param {google.cloud.ces.v1beta.IListAgentsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListAgentsResponse} ListAgentsResponse instance + */ + ListAgentsResponse.create = function create(properties) { + return new ListAgentsResponse(properties); + }; + + /** + * Encodes the specified ListAgentsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @static + * @param {google.cloud.ces.v1beta.IListAgentsResponse} message ListAgentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agents != null && message.agents.length) + for (var i = 0; i < message.agents.length; ++i) + $root.google.cloud.ces.v1beta.Agent.encode(message.agents[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 ListAgentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAgentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @static + * @param {google.cloud.ces.v1beta.IListAgentsResponse} message ListAgentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListAgentsResponse} ListAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListAgentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.agents && message.agents.length)) + message.agents = []; + message.agents.push($root.google.cloud.ces.v1beta.Agent.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAgentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListAgentsResponse} ListAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAgentsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAgentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agents != null && message.hasOwnProperty("agents")) { + if (!Array.isArray(message.agents)) + return "agents: array expected"; + for (var i = 0; i < message.agents.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Agent.verify(message.agents[i]); + if (error) + return "agents." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAgentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListAgentsResponse} ListAgentsResponse + */ + ListAgentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListAgentsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListAgentsResponse(); + if (object.agents) { + if (!Array.isArray(object.agents)) + throw TypeError(".google.cloud.ces.v1beta.ListAgentsResponse.agents: array expected"); + message.agents = []; + for (var i = 0; i < object.agents.length; ++i) { + if (typeof object.agents[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListAgentsResponse.agents: object expected"); + message.agents[i] = $root.google.cloud.ces.v1beta.Agent.fromObject(object.agents[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAgentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @static + * @param {google.cloud.ces.v1beta.ListAgentsResponse} message ListAgentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAgentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.agents = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.agents && message.agents.length) { + object.agents = []; + for (var j = 0; j < message.agents.length; ++j) + object.agents[j] = $root.google.cloud.ces.v1beta.Agent.toObject(message.agents[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAgentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAgentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAgentsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListAgentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAgentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListAgentsResponse"; + }; + + return ListAgentsResponse; + })(); + + v1beta.GetAgentRequest = (function() { + + /** + * Properties of a GetAgentRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetAgentRequest + * @property {string|null} [name] GetAgentRequest name + */ + + /** + * Constructs a new GetAgentRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetAgentRequest. + * @implements IGetAgentRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetAgentRequest=} [properties] Properties to set + */ + function GetAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAgentRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @instance + */ + GetAgentRequest.prototype.name = ""; + + /** + * Creates a new GetAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @static + * @param {google.cloud.ces.v1beta.IGetAgentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetAgentRequest} GetAgentRequest instance + */ + GetAgentRequest.create = function create(properties) { + return new GetAgentRequest(properties); + }; + + /** + * Encodes the specified GetAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @static + * @param {google.cloud.ces.v1beta.IGetAgentRequest} message GetAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAgentRequest.encode = function encode(message, writer) { + 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 GetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @static + * @param {google.cloud.ces.v1beta.IGetAgentRequest} message GetAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetAgentRequest} GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAgentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetAgentRequest} GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAgentRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAgentRequest.verify = function verify(message) { + if (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 GetAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetAgentRequest} GetAgentRequest + */ + GetAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetAgentRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetAgentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @static + * @param {google.cloud.ces.v1beta.GetAgentRequest} message GetAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAgentRequest.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 GetAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @instance + * @returns {Object.} JSON object + */ + GetAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAgentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetAgentRequest"; + }; + + return GetAgentRequest; + })(); + + v1beta.CreateAgentRequest = (function() { + + /** + * Properties of a CreateAgentRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateAgentRequest + * @property {string|null} [parent] CreateAgentRequest parent + * @property {string|null} [agentId] CreateAgentRequest agentId + * @property {google.cloud.ces.v1beta.IAgent|null} [agent] CreateAgentRequest agent + */ + + /** + * Constructs a new CreateAgentRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateAgentRequest. + * @implements ICreateAgentRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateAgentRequest=} [properties] Properties to set + */ + function CreateAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAgentRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @instance + */ + CreateAgentRequest.prototype.parent = ""; + + /** + * CreateAgentRequest agentId. + * @member {string} agentId + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @instance + */ + CreateAgentRequest.prototype.agentId = ""; + + /** + * CreateAgentRequest agent. + * @member {google.cloud.ces.v1beta.IAgent|null|undefined} agent + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @instance + */ + CreateAgentRequest.prototype.agent = null; + + /** + * Creates a new CreateAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateAgentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateAgentRequest} CreateAgentRequest instance + */ + CreateAgentRequest.create = function create(properties) { + return new CreateAgentRequest(properties); + }; + + /** + * Encodes the specified CreateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateAgentRequest} message CreateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAgentRequest.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.agentId != null && Object.hasOwnProperty.call(message, "agentId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.agentId); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + $root.google.cloud.ces.v1beta.Agent.encode(message.agent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateAgentRequest} message CreateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateAgentRequest} CreateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAgentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.agentId = reader.string(); + break; + } + case 3: { + message.agent = $root.google.cloud.ces.v1beta.Agent.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateAgentRequest} CreateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAgentRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAgentRequest.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.agentId != null && message.hasOwnProperty("agentId")) + if (!$util.isString(message.agentId)) + return "agentId: string expected"; + if (message.agent != null && message.hasOwnProperty("agent")) { + var error = $root.google.cloud.ces.v1beta.Agent.verify(message.agent); + if (error) + return "agent." + error; + } + return null; + }; + + /** + * Creates a CreateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateAgentRequest} CreateAgentRequest + */ + CreateAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateAgentRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateAgentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.agentId != null) + message.agentId = String(object.agentId); + if (object.agent != null) { + if (typeof object.agent !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateAgentRequest.agent: object expected"); + message.agent = $root.google.cloud.ces.v1beta.Agent.fromObject(object.agent); + } + return message; + }; + + /** + * Creates a plain object from a CreateAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @static + * @param {google.cloud.ces.v1beta.CreateAgentRequest} message CreateAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.agentId = ""; + object.agent = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.agentId != null && message.hasOwnProperty("agentId")) + object.agentId = message.agentId; + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = $root.google.cloud.ces.v1beta.Agent.toObject(message.agent, options); + return object; + }; + + /** + * Converts this CreateAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAgentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateAgentRequest"; + }; + + return CreateAgentRequest; + })(); + + v1beta.UpdateAgentRequest = (function() { + + /** + * Properties of an UpdateAgentRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateAgentRequest + * @property {google.cloud.ces.v1beta.IAgent|null} [agent] UpdateAgentRequest agent + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAgentRequest updateMask + */ + + /** + * Constructs a new UpdateAgentRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateAgentRequest. + * @implements IUpdateAgentRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateAgentRequest=} [properties] Properties to set + */ + function UpdateAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAgentRequest agent. + * @member {google.cloud.ces.v1beta.IAgent|null|undefined} agent + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @instance + */ + UpdateAgentRequest.prototype.agent = null; + + /** + * UpdateAgentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @instance + */ + UpdateAgentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateAgentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateAgentRequest} UpdateAgentRequest instance + */ + UpdateAgentRequest.create = function create(properties) { + return new UpdateAgentRequest(properties); + }; + + /** + * Encodes the specified UpdateAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateAgentRequest} message UpdateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAgentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + $root.google.cloud.ces.v1beta.Agent.encode(message.agent, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateAgentRequest} message UpdateAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateAgentRequest} UpdateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAgentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.agent = $root.google.cloud.ces.v1beta.Agent.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateAgentRequest} UpdateAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAgentRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAgentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agent != null && message.hasOwnProperty("agent")) { + var error = $root.google.cloud.ces.v1beta.Agent.verify(message.agent); + if (error) + return "agent." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateAgentRequest} UpdateAgentRequest + */ + UpdateAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateAgentRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateAgentRequest(); + if (object.agent != null) { + if (typeof object.agent !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateAgentRequest.agent: object expected"); + message.agent = $root.google.cloud.ces.v1beta.Agent.fromObject(object.agent); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateAgentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateAgentRequest} message UpdateAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.agent = null; + object.updateMask = null; + } + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = $root.google.cloud.ces.v1beta.Agent.toObject(message.agent, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAgentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateAgentRequest"; + }; + + return UpdateAgentRequest; + })(); + + v1beta.DeleteAgentRequest = (function() { + + /** + * Properties of a DeleteAgentRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteAgentRequest + * @property {string|null} [name] DeleteAgentRequest name + * @property {boolean|null} [force] DeleteAgentRequest force + * @property {string|null} [etag] DeleteAgentRequest etag + */ + + /** + * Constructs a new DeleteAgentRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteAgentRequest. + * @implements IDeleteAgentRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteAgentRequest=} [properties] Properties to set + */ + function DeleteAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAgentRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @instance + */ + DeleteAgentRequest.prototype.name = ""; + + /** + * DeleteAgentRequest force. + * @member {boolean} force + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @instance + */ + DeleteAgentRequest.prototype.force = false; + + /** + * DeleteAgentRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @instance + */ + DeleteAgentRequest.prototype.etag = ""; + + /** + * Creates a new DeleteAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteAgentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteAgentRequest} DeleteAgentRequest instance + */ + DeleteAgentRequest.create = function create(properties) { + return new DeleteAgentRequest(properties); + }; + + /** + * Encodes the specified DeleteAgentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteAgentRequest} message DeleteAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAgentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteAgentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteAgentRequest} message DeleteAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteAgentRequest} DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAgentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteAgentRequest} DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAgentRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAgentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteAgentRequest} DeleteAgentRequest + */ + DeleteAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteAgentRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteAgentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteAgentRequest} message DeleteAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAgentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteAgentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAgentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteAgentRequest"; + }; + + return DeleteAgentRequest; + })(); + + v1beta.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.ces.v1beta + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.ces.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 createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.ces.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.ces.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OperationMetadata + * @static + * @param {google.cloud.ces.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.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.requestedCancellation); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OperationMetadata + * @static + * @param {google.cloud.ces.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.ces.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.ces.v1beta.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + 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.statusMessage = reader.string(); + break; + } + case 4: { + message.requestedCancellation = reader.bool(); + 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.ces.v1beta.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.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.ces.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"; + 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.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"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OperationMetadata) + return object; + var message = new $root.google.cloud.ces.v1beta.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.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.ces.v1beta.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OperationMetadata + * @static + * @param {google.cloud.ces.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.statusMessage = ""; + object.requestedCancellation = false; + } + 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.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.ces.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.ces.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.ces.v1beta.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1beta.ListExamplesRequest = (function() { + + /** + * Properties of a ListExamplesRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListExamplesRequest + * @property {string|null} [parent] ListExamplesRequest parent + * @property {number|null} [pageSize] ListExamplesRequest pageSize + * @property {string|null} [pageToken] ListExamplesRequest pageToken + * @property {string|null} [filter] ListExamplesRequest filter + * @property {string|null} [orderBy] ListExamplesRequest orderBy + */ + + /** + * Constructs a new ListExamplesRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListExamplesRequest. + * @implements IListExamplesRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListExamplesRequest=} [properties] Properties to set + */ + function ListExamplesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExamplesRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.parent = ""; + + /** + * ListExamplesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.pageSize = 0; + + /** + * ListExamplesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.pageToken = ""; + + /** + * ListExamplesRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.filter = ""; + + /** + * ListExamplesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @instance + */ + ListExamplesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListExamplesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @static + * @param {google.cloud.ces.v1beta.IListExamplesRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListExamplesRequest} ListExamplesRequest instance + */ + ListExamplesRequest.create = function create(properties) { + return new ListExamplesRequest(properties); + }; + + /** + * Encodes the specified ListExamplesRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @static + * @param {google.cloud.ces.v1beta.IListExamplesRequest} message ListExamplesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesRequest.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 ListExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @static + * @param {google.cloud.ces.v1beta.IListExamplesRequest} message ListExamplesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListExamplesRequest} ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListExamplesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListExamplesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListExamplesRequest} ListExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExamplesRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExamplesRequest.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 ListExamplesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListExamplesRequest} ListExamplesRequest + */ + ListExamplesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListExamplesRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListExamplesRequest(); + 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 ListExamplesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @static + * @param {google.cloud.ces.v1beta.ListExamplesRequest} message ListExamplesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExamplesRequest.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 ListExamplesRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @instance + * @returns {Object.} JSON object + */ + ListExamplesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExamplesRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListExamplesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExamplesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListExamplesRequest"; + }; + + return ListExamplesRequest; + })(); + + v1beta.ListExamplesResponse = (function() { + + /** + * Properties of a ListExamplesResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListExamplesResponse + * @property {Array.|null} [examples] ListExamplesResponse examples + * @property {string|null} [nextPageToken] ListExamplesResponse nextPageToken + */ + + /** + * Constructs a new ListExamplesResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListExamplesResponse. + * @implements IListExamplesResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListExamplesResponse=} [properties] Properties to set + */ + function ListExamplesResponse(properties) { + this.examples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExamplesResponse examples. + * @member {Array.} examples + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @instance + */ + ListExamplesResponse.prototype.examples = $util.emptyArray; + + /** + * ListExamplesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @instance + */ + ListExamplesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListExamplesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @static + * @param {google.cloud.ces.v1beta.IListExamplesResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListExamplesResponse} ListExamplesResponse instance + */ + ListExamplesResponse.create = function create(properties) { + return new ListExamplesResponse(properties); + }; + + /** + * Encodes the specified ListExamplesResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @static + * @param {google.cloud.ces.v1beta.IListExamplesResponse} message ListExamplesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.examples != null && message.examples.length) + for (var i = 0; i < message.examples.length; ++i) + $root.google.cloud.ces.v1beta.Example.encode(message.examples[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 ListExamplesResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListExamplesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @static + * @param {google.cloud.ces.v1beta.IListExamplesResponse} message ListExamplesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExamplesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListExamplesResponse} ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListExamplesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.examples && message.examples.length)) + message.examples = []; + message.examples.push($root.google.cloud.ces.v1beta.Example.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListExamplesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListExamplesResponse} ListExamplesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExamplesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExamplesResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExamplesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.examples != null && message.hasOwnProperty("examples")) { + if (!Array.isArray(message.examples)) + return "examples: array expected"; + for (var i = 0; i < message.examples.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Example.verify(message.examples[i]); + if (error) + return "examples." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListExamplesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListExamplesResponse} ListExamplesResponse + */ + ListExamplesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListExamplesResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListExamplesResponse(); + if (object.examples) { + if (!Array.isArray(object.examples)) + throw TypeError(".google.cloud.ces.v1beta.ListExamplesResponse.examples: array expected"); + message.examples = []; + for (var i = 0; i < object.examples.length; ++i) { + if (typeof object.examples[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListExamplesResponse.examples: object expected"); + message.examples[i] = $root.google.cloud.ces.v1beta.Example.fromObject(object.examples[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListExamplesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @static + * @param {google.cloud.ces.v1beta.ListExamplesResponse} message ListExamplesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExamplesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.examples = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.examples && message.examples.length) { + object.examples = []; + for (var j = 0; j < message.examples.length; ++j) + object.examples[j] = $root.google.cloud.ces.v1beta.Example.toObject(message.examples[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListExamplesResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @instance + * @returns {Object.} JSON object + */ + ListExamplesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExamplesResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListExamplesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExamplesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListExamplesResponse"; + }; + + return ListExamplesResponse; + })(); + + v1beta.GetExampleRequest = (function() { + + /** + * Properties of a GetExampleRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetExampleRequest + * @property {string|null} [name] GetExampleRequest name + */ + + /** + * Constructs a new GetExampleRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetExampleRequest. + * @implements IGetExampleRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetExampleRequest=} [properties] Properties to set + */ + function GetExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetExampleRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @instance + */ + GetExampleRequest.prototype.name = ""; + + /** + * Creates a new GetExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @static + * @param {google.cloud.ces.v1beta.IGetExampleRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetExampleRequest} GetExampleRequest instance + */ + GetExampleRequest.create = function create(properties) { + return new GetExampleRequest(properties); + }; + + /** + * Encodes the specified GetExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @static + * @param {google.cloud.ces.v1beta.IGetExampleRequest} message GetExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExampleRequest.encode = function encode(message, writer) { + 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 GetExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @static + * @param {google.cloud.ces.v1beta.IGetExampleRequest} message GetExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetExampleRequest} GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExampleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetExampleRequest} GetExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetExampleRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetExampleRequest.verify = function verify(message) { + if (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 GetExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetExampleRequest} GetExampleRequest + */ + GetExampleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetExampleRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetExampleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @static + * @param {google.cloud.ces.v1beta.GetExampleRequest} message GetExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetExampleRequest.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 GetExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @instance + * @returns {Object.} JSON object + */ + GetExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetExampleRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetExampleRequest"; + }; + + return GetExampleRequest; + })(); + + v1beta.CreateExampleRequest = (function() { + + /** + * Properties of a CreateExampleRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateExampleRequest + * @property {string|null} [parent] CreateExampleRequest parent + * @property {string|null} [exampleId] CreateExampleRequest exampleId + * @property {google.cloud.ces.v1beta.IExample|null} [example] CreateExampleRequest example + */ + + /** + * Constructs a new CreateExampleRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateExampleRequest. + * @implements ICreateExampleRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateExampleRequest=} [properties] Properties to set + */ + function CreateExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateExampleRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @instance + */ + CreateExampleRequest.prototype.parent = ""; + + /** + * CreateExampleRequest exampleId. + * @member {string} exampleId + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @instance + */ + CreateExampleRequest.prototype.exampleId = ""; + + /** + * CreateExampleRequest example. + * @member {google.cloud.ces.v1beta.IExample|null|undefined} example + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @instance + */ + CreateExampleRequest.prototype.example = null; + + /** + * Creates a new CreateExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateExampleRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateExampleRequest} CreateExampleRequest instance + */ + CreateExampleRequest.create = function create(properties) { + return new CreateExampleRequest(properties); + }; + + /** + * Encodes the specified CreateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateExampleRequest} message CreateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExampleRequest.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.exampleId != null && Object.hasOwnProperty.call(message, "exampleId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exampleId); + if (message.example != null && Object.hasOwnProperty.call(message, "example")) + $root.google.cloud.ces.v1beta.Example.encode(message.example, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateExampleRequest} message CreateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateExampleRequest} CreateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExampleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.exampleId = reader.string(); + break; + } + case 3: { + message.example = $root.google.cloud.ces.v1beta.Example.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateExampleRequest} CreateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateExampleRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateExampleRequest.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.exampleId != null && message.hasOwnProperty("exampleId")) + if (!$util.isString(message.exampleId)) + return "exampleId: string expected"; + if (message.example != null && message.hasOwnProperty("example")) { + var error = $root.google.cloud.ces.v1beta.Example.verify(message.example); + if (error) + return "example." + error; + } + return null; + }; + + /** + * Creates a CreateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateExampleRequest} CreateExampleRequest + */ + CreateExampleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateExampleRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateExampleRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.exampleId != null) + message.exampleId = String(object.exampleId); + if (object.example != null) { + if (typeof object.example !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateExampleRequest.example: object expected"); + message.example = $root.google.cloud.ces.v1beta.Example.fromObject(object.example); + } + return message; + }; + + /** + * Creates a plain object from a CreateExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @static + * @param {google.cloud.ces.v1beta.CreateExampleRequest} message CreateExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateExampleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.exampleId = ""; + object.example = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.exampleId != null && message.hasOwnProperty("exampleId")) + object.exampleId = message.exampleId; + if (message.example != null && message.hasOwnProperty("example")) + object.example = $root.google.cloud.ces.v1beta.Example.toObject(message.example, options); + return object; + }; + + /** + * Converts this CreateExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @instance + * @returns {Object.} JSON object + */ + CreateExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateExampleRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateExampleRequest"; + }; + + return CreateExampleRequest; + })(); + + v1beta.UpdateExampleRequest = (function() { + + /** + * Properties of an UpdateExampleRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateExampleRequest + * @property {google.cloud.ces.v1beta.IExample|null} [example] UpdateExampleRequest example + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateExampleRequest updateMask + */ + + /** + * Constructs a new UpdateExampleRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateExampleRequest. + * @implements IUpdateExampleRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateExampleRequest=} [properties] Properties to set + */ + function UpdateExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateExampleRequest example. + * @member {google.cloud.ces.v1beta.IExample|null|undefined} example + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @instance + */ + UpdateExampleRequest.prototype.example = null; + + /** + * UpdateExampleRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @instance + */ + UpdateExampleRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateExampleRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateExampleRequest} UpdateExampleRequest instance + */ + UpdateExampleRequest.create = function create(properties) { + return new UpdateExampleRequest(properties); + }; + + /** + * Encodes the specified UpdateExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateExampleRequest} message UpdateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExampleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.example != null && Object.hasOwnProperty.call(message, "example")) + $root.google.cloud.ces.v1beta.Example.encode(message.example, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateExampleRequest} message UpdateExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateExampleRequest} UpdateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExampleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.example = $root.google.cloud.ces.v1beta.Example.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateExampleRequest} UpdateExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateExampleRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateExampleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.example != null && message.hasOwnProperty("example")) { + var error = $root.google.cloud.ces.v1beta.Example.verify(message.example); + if (error) + return "example." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateExampleRequest} UpdateExampleRequest + */ + UpdateExampleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateExampleRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateExampleRequest(); + if (object.example != null) { + if (typeof object.example !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateExampleRequest.example: object expected"); + message.example = $root.google.cloud.ces.v1beta.Example.fromObject(object.example); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateExampleRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateExampleRequest} message UpdateExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateExampleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.example = null; + object.updateMask = null; + } + if (message.example != null && message.hasOwnProperty("example")) + object.example = $root.google.cloud.ces.v1beta.Example.toObject(message.example, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateExampleRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateExampleRequest"; + }; + + return UpdateExampleRequest; + })(); + + v1beta.DeleteExampleRequest = (function() { + + /** + * Properties of a DeleteExampleRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteExampleRequest + * @property {string|null} [name] DeleteExampleRequest name + * @property {string|null} [etag] DeleteExampleRequest etag + */ + + /** + * Constructs a new DeleteExampleRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteExampleRequest. + * @implements IDeleteExampleRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteExampleRequest=} [properties] Properties to set + */ + function DeleteExampleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteExampleRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @instance + */ + DeleteExampleRequest.prototype.name = ""; + + /** + * DeleteExampleRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @instance + */ + DeleteExampleRequest.prototype.etag = ""; + + /** + * Creates a new DeleteExampleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteExampleRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteExampleRequest} DeleteExampleRequest instance + */ + DeleteExampleRequest.create = function create(properties) { + return new DeleteExampleRequest(properties); + }; + + /** + * Encodes the specified DeleteExampleRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteExampleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteExampleRequest} message DeleteExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExampleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteExampleRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteExampleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteExampleRequest} message DeleteExampleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExampleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteExampleRequest} DeleteExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExampleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteExampleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteExampleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteExampleRequest} DeleteExampleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExampleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteExampleRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteExampleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteExampleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteExampleRequest} DeleteExampleRequest + */ + DeleteExampleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteExampleRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteExampleRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteExampleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteExampleRequest} message DeleteExampleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteExampleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteExampleRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteExampleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteExampleRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteExampleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteExampleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteExampleRequest"; + }; + + return DeleteExampleRequest; + })(); + + v1beta.ListToolsRequest = (function() { + + /** + * Properties of a ListToolsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListToolsRequest + * @property {string|null} [parent] ListToolsRequest parent + * @property {number|null} [pageSize] ListToolsRequest pageSize + * @property {string|null} [pageToken] ListToolsRequest pageToken + * @property {string|null} [filter] ListToolsRequest filter + * @property {string|null} [orderBy] ListToolsRequest orderBy + */ + + /** + * Constructs a new ListToolsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListToolsRequest. + * @implements IListToolsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListToolsRequest=} [properties] Properties to set + */ + function ListToolsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.parent = ""; + + /** + * ListToolsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.pageSize = 0; + + /** + * ListToolsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.pageToken = ""; + + /** + * ListToolsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.filter = ""; + + /** + * ListToolsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @instance + */ + ListToolsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListToolsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @static + * @param {google.cloud.ces.v1beta.IListToolsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListToolsRequest} ListToolsRequest instance + */ + ListToolsRequest.create = function create(properties) { + return new ListToolsRequest(properties); + }; + + /** + * Encodes the specified ListToolsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @static + * @param {google.cloud.ces.v1beta.IListToolsRequest} message ListToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsRequest.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 ListToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @static + * @param {google.cloud.ces.v1beta.IListToolsRequest} message ListToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListToolsRequest} ListToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListToolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListToolsRequest} ListToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolsRequest.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 ListToolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListToolsRequest} ListToolsRequest + */ + ListToolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListToolsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListToolsRequest(); + 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 ListToolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @static + * @param {google.cloud.ces.v1beta.ListToolsRequest} message ListToolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolsRequest.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 ListToolsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @instance + * @returns {Object.} JSON object + */ + ListToolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListToolsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListToolsRequest"; + }; + + return ListToolsRequest; + })(); + + v1beta.ListToolsResponse = (function() { + + /** + * Properties of a ListToolsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListToolsResponse + * @property {Array.|null} [tools] ListToolsResponse tools + * @property {string|null} [nextPageToken] ListToolsResponse nextPageToken + */ + + /** + * Constructs a new ListToolsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListToolsResponse. + * @implements IListToolsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListToolsResponse=} [properties] Properties to set + */ + function ListToolsResponse(properties) { + this.tools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolsResponse tools. + * @member {Array.} tools + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @instance + */ + ListToolsResponse.prototype.tools = $util.emptyArray; + + /** + * ListToolsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @instance + */ + ListToolsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListToolsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @static + * @param {google.cloud.ces.v1beta.IListToolsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListToolsResponse} ListToolsResponse instance + */ + ListToolsResponse.create = function create(properties) { + return new ListToolsResponse(properties); + }; + + /** + * Encodes the specified ListToolsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @static + * @param {google.cloud.ces.v1beta.IListToolsResponse} message ListToolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + $root.google.cloud.ces.v1beta.Tool.encode(message.tools[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 ListToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @static + * @param {google.cloud.ces.v1beta.IListToolsResponse} message ListToolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListToolsResponse} ListToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListToolsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push($root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListToolsResponse} ListToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tools != null && message.hasOwnProperty("tools")) { + if (!Array.isArray(message.tools)) + return "tools: array expected"; + for (var i = 0; i < message.tools.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tools[i]); + if (error) + return "tools." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListToolsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListToolsResponse} ListToolsResponse + */ + ListToolsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListToolsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListToolsResponse(); + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.cloud.ces.v1beta.ListToolsResponse.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) { + if (typeof object.tools[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListToolsResponse.tools: object expected"); + message.tools[i] = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tools[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListToolsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @static + * @param {google.cloud.ces.v1beta.ListToolsResponse} message ListToolsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tools = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = $root.google.cloud.ces.v1beta.Tool.toObject(message.tools[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListToolsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @instance + * @returns {Object.} JSON object + */ + ListToolsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListToolsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListToolsResponse"; + }; + + return ListToolsResponse; + })(); + + v1beta.GetToolRequest = (function() { + + /** + * Properties of a GetToolRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetToolRequest + * @property {string|null} [name] GetToolRequest name + */ + + /** + * Constructs a new GetToolRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetToolRequest. + * @implements IGetToolRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetToolRequest=} [properties] Properties to set + */ + function GetToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetToolRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @instance + */ + GetToolRequest.prototype.name = ""; + + /** + * Creates a new GetToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @static + * @param {google.cloud.ces.v1beta.IGetToolRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetToolRequest} GetToolRequest instance + */ + GetToolRequest.create = function create(properties) { + return new GetToolRequest(properties); + }; + + /** + * Encodes the specified GetToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @static + * @param {google.cloud.ces.v1beta.IGetToolRequest} message GetToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolRequest.encode = function encode(message, writer) { + 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 GetToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @static + * @param {google.cloud.ces.v1beta.IGetToolRequest} message GetToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetToolRequest} GetToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetToolRequest} GetToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetToolRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetToolRequest.verify = function verify(message) { + if (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 GetToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetToolRequest} GetToolRequest + */ + GetToolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetToolRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetToolRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @static + * @param {google.cloud.ces.v1beta.GetToolRequest} message GetToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetToolRequest.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 GetToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @instance + * @returns {Object.} JSON object + */ + GetToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetToolRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetToolRequest"; + }; + + return GetToolRequest; + })(); + + v1beta.CreateToolRequest = (function() { + + /** + * Properties of a CreateToolRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateToolRequest + * @property {string|null} [parent] CreateToolRequest parent + * @property {string|null} [toolId] CreateToolRequest toolId + * @property {google.cloud.ces.v1beta.ITool|null} [tool] CreateToolRequest tool + */ + + /** + * Constructs a new CreateToolRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateToolRequest. + * @implements ICreateToolRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateToolRequest=} [properties] Properties to set + */ + function CreateToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateToolRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @instance + */ + CreateToolRequest.prototype.parent = ""; + + /** + * CreateToolRequest toolId. + * @member {string} toolId + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @instance + */ + CreateToolRequest.prototype.toolId = ""; + + /** + * CreateToolRequest tool. + * @member {google.cloud.ces.v1beta.ITool|null|undefined} tool + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @instance + */ + CreateToolRequest.prototype.tool = null; + + /** + * Creates a new CreateToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateToolRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateToolRequest} CreateToolRequest instance + */ + CreateToolRequest.create = function create(properties) { + return new CreateToolRequest(properties); + }; + + /** + * Encodes the specified CreateToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateToolRequest} message CreateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolRequest.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.toolId != null && Object.hasOwnProperty.call(message, "toolId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.toolId); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + $root.google.cloud.ces.v1beta.Tool.encode(message.tool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateToolRequest} message CreateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateToolRequest} CreateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.toolId = reader.string(); + break; + } + case 3: { + message.tool = $root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateToolRequest} CreateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateToolRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateToolRequest.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.toolId != null && message.hasOwnProperty("toolId")) + if (!$util.isString(message.toolId)) + return "toolId: string expected"; + if (message.tool != null && message.hasOwnProperty("tool")) { + var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tool); + if (error) + return "tool." + error; + } + return null; + }; + + /** + * Creates a CreateToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateToolRequest} CreateToolRequest + */ + CreateToolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateToolRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateToolRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.toolId != null) + message.toolId = String(object.toolId); + if (object.tool != null) { + if (typeof object.tool !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateToolRequest.tool: object expected"); + message.tool = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tool); + } + return message; + }; + + /** + * Creates a plain object from a CreateToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @static + * @param {google.cloud.ces.v1beta.CreateToolRequest} message CreateToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateToolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.toolId = ""; + object.tool = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.toolId != null && message.hasOwnProperty("toolId")) + object.toolId = message.toolId; + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = $root.google.cloud.ces.v1beta.Tool.toObject(message.tool, options); + return object; + }; + + /** + * Converts this CreateToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @instance + * @returns {Object.} JSON object + */ + CreateToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateToolRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateToolRequest"; + }; + + return CreateToolRequest; + })(); + + v1beta.UpdateToolRequest = (function() { + + /** + * Properties of an UpdateToolRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateToolRequest + * @property {google.cloud.ces.v1beta.ITool|null} [tool] UpdateToolRequest tool + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateToolRequest updateMask + */ + + /** + * Constructs a new UpdateToolRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateToolRequest. + * @implements IUpdateToolRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateToolRequest=} [properties] Properties to set + */ + function UpdateToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateToolRequest tool. + * @member {google.cloud.ces.v1beta.ITool|null|undefined} tool + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @instance + */ + UpdateToolRequest.prototype.tool = null; + + /** + * UpdateToolRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @instance + */ + UpdateToolRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateToolRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateToolRequest} UpdateToolRequest instance + */ + UpdateToolRequest.create = function create(properties) { + return new UpdateToolRequest(properties); + }; + + /** + * Encodes the specified UpdateToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateToolRequest} message UpdateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateToolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + $root.google.cloud.ces.v1beta.Tool.encode(message.tool, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateToolRequest} message UpdateToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateToolRequest} UpdateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateToolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = $root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateToolRequest} UpdateToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateToolRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateToolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tool != null && message.hasOwnProperty("tool")) { + var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tool); + if (error) + return "tool." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateToolRequest} UpdateToolRequest + */ + UpdateToolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateToolRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateToolRequest(); + if (object.tool != null) { + if (typeof object.tool !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateToolRequest.tool: object expected"); + message.tool = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tool); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateToolRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateToolRequest} message UpdateToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateToolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = null; + object.updateMask = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = $root.google.cloud.ces.v1beta.Tool.toObject(message.tool, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateToolRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateToolRequest"; + }; + + return UpdateToolRequest; + })(); + + v1beta.DeleteToolRequest = (function() { + + /** + * Properties of a DeleteToolRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteToolRequest + * @property {string|null} [name] DeleteToolRequest name + * @property {boolean|null} [force] DeleteToolRequest force + * @property {string|null} [etag] DeleteToolRequest etag + */ + + /** + * Constructs a new DeleteToolRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteToolRequest. + * @implements IDeleteToolRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteToolRequest=} [properties] Properties to set + */ + function DeleteToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteToolRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @instance + */ + DeleteToolRequest.prototype.name = ""; + + /** + * DeleteToolRequest force. + * @member {boolean} force + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @instance + */ + DeleteToolRequest.prototype.force = false; + + /** + * DeleteToolRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @instance + */ + DeleteToolRequest.prototype.etag = ""; + + /** + * Creates a new DeleteToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteToolRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteToolRequest} DeleteToolRequest instance + */ + DeleteToolRequest.create = function create(properties) { + return new DeleteToolRequest(properties); + }; + + /** + * Encodes the specified DeleteToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteToolRequest} message DeleteToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteToolRequest} message DeleteToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteToolRequest} DeleteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteToolRequest} DeleteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteToolRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteToolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteToolRequest} DeleteToolRequest + */ + DeleteToolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteToolRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteToolRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteToolRequest} message DeleteToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteToolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteToolRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteToolRequest"; + }; + + return DeleteToolRequest; + })(); + + v1beta.ListConversationsRequest = (function() { + + /** + * Properties of a ListConversationsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListConversationsRequest + * @property {string|null} [parent] ListConversationsRequest parent + * @property {number|null} [pageSize] ListConversationsRequest pageSize + * @property {string|null} [pageToken] ListConversationsRequest pageToken + * @property {string|null} [filter] ListConversationsRequest filter + * @property {google.cloud.ces.v1beta.Conversation.Source|null} [source] ListConversationsRequest source + * @property {Array.|null} [sources] ListConversationsRequest sources + */ + + /** + * Constructs a new ListConversationsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListConversationsRequest. + * @implements IListConversationsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListConversationsRequest=} [properties] Properties to set + */ + function ListConversationsRequest(properties) { + this.sources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConversationsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.parent = ""; + + /** + * ListConversationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.pageSize = 0; + + /** + * ListConversationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.pageToken = ""; + + /** + * ListConversationsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.filter = ""; + + /** + * ListConversationsRequest source. + * @member {google.cloud.ces.v1beta.Conversation.Source} source + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.source = 0; + + /** + * ListConversationsRequest sources. + * @member {Array.} sources + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.sources = $util.emptyArray; + + /** + * Creates a new ListConversationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @static + * @param {google.cloud.ces.v1beta.IListConversationsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListConversationsRequest} ListConversationsRequest instance + */ + ListConversationsRequest.create = function create(properties) { + return new ListConversationsRequest(properties); + }; + + /** + * Encodes the specified ListConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @static + * @param {google.cloud.ces.v1beta.IListConversationsRequest} message ListConversationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsRequest.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.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.source); + if (message.sources != null && message.sources.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.sources.length; ++i) + writer.int32(message.sources[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ListConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @static + * @param {google.cloud.ces.v1beta.IListConversationsRequest} message ListConversationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListConversationsRequest} ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListConversationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.source = reader.int32(); + break; + } + case 6: { + if (!(message.sources && message.sources.length)) + message.sources = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.sources.push(reader.int32()); + } else + message.sources.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListConversationsRequest} ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConversationsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConversationsRequest.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.source != null && message.hasOwnProperty("source")) + switch (message.source) { + default: + return "source: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) + switch (message.sources[i]) { + default: + return "sources: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return null; + }; + + /** + * Creates a ListConversationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListConversationsRequest} ListConversationsRequest + */ + ListConversationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListConversationsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListConversationsRequest(); + 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); + switch (object.source) { + default: + if (typeof object.source === "number") { + message.source = object.source; + break; + } + break; + case "SOURCE_UNSPECIFIED": + case 0: + message.source = 0; + break; + case "LIVE": + case 1: + message.source = 1; + break; + case "SIMULATOR": + case 2: + message.source = 2; + break; + case "EVAL": + case 3: + message.source = 3; + break; + } + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.ces.v1beta.ListConversationsRequest.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) + switch (object.sources[i]) { + default: + if (typeof object.sources[i] === "number") { + message.sources[i] = object.sources[i]; + break; + } + case "SOURCE_UNSPECIFIED": + case 0: + message.sources[i] = 0; + break; + case "LIVE": + case 1: + message.sources[i] = 1; + break; + case "SIMULATOR": + case 2: + message.sources[i] = 2; + break; + case "EVAL": + case 3: + message.sources[i] = 3; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ListConversationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @static + * @param {google.cloud.ces.v1beta.ListConversationsRequest} message ListConversationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConversationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sources = []; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.source != null && message.hasOwnProperty("source")) + object.source = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1beta.Conversation.Source[message.source] : message.source; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.Source[message.sources[j]] === undefined ? message.sources[j] : $root.google.cloud.ces.v1beta.Conversation.Source[message.sources[j]] : message.sources[j]; + } + return object; + }; + + /** + * Converts this ListConversationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListConversationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConversationsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListConversationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConversationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListConversationsRequest"; + }; + + return ListConversationsRequest; + })(); + + v1beta.ListConversationsResponse = (function() { + + /** + * Properties of a ListConversationsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListConversationsResponse + * @property {Array.|null} [conversations] ListConversationsResponse conversations + * @property {string|null} [nextPageToken] ListConversationsResponse nextPageToken + */ + + /** + * Constructs a new ListConversationsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListConversationsResponse. + * @implements IListConversationsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListConversationsResponse=} [properties] Properties to set + */ + function ListConversationsResponse(properties) { + this.conversations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConversationsResponse conversations. + * @member {Array.} conversations + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @instance + */ + ListConversationsResponse.prototype.conversations = $util.emptyArray; + + /** + * ListConversationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @instance + */ + ListConversationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListConversationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @static + * @param {google.cloud.ces.v1beta.IListConversationsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListConversationsResponse} ListConversationsResponse instance + */ + ListConversationsResponse.create = function create(properties) { + return new ListConversationsResponse(properties); + }; + + /** + * Encodes the specified ListConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @static + * @param {google.cloud.ces.v1beta.IListConversationsResponse} message ListConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversations != null && message.conversations.length) + for (var i = 0; i < message.conversations.length; ++i) + $root.google.cloud.ces.v1beta.Conversation.encode(message.conversations[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 ListConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListConversationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @static + * @param {google.cloud.ces.v1beta.IListConversationsResponse} message ListConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListConversationsResponse} ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListConversationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.conversations && message.conversations.length)) + message.conversations = []; + message.conversations.push($root.google.cloud.ces.v1beta.Conversation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListConversationsResponse} ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConversationsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConversationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conversations != null && message.hasOwnProperty("conversations")) { + if (!Array.isArray(message.conversations)) + return "conversations: array expected"; + for (var i = 0; i < message.conversations.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Conversation.verify(message.conversations[i]); + if (error) + return "conversations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListConversationsResponse} ListConversationsResponse + */ + ListConversationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListConversationsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListConversationsResponse(); + if (object.conversations) { + if (!Array.isArray(object.conversations)) + throw TypeError(".google.cloud.ces.v1beta.ListConversationsResponse.conversations: array expected"); + message.conversations = []; + for (var i = 0; i < object.conversations.length; ++i) { + if (typeof object.conversations[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListConversationsResponse.conversations: object expected"); + message.conversations[i] = $root.google.cloud.ces.v1beta.Conversation.fromObject(object.conversations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListConversationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @static + * @param {google.cloud.ces.v1beta.ListConversationsResponse} message ListConversationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConversationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conversations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.conversations && message.conversations.length) { + object.conversations = []; + for (var j = 0; j < message.conversations.length; ++j) + object.conversations[j] = $root.google.cloud.ces.v1beta.Conversation.toObject(message.conversations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListConversationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListConversationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConversationsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListConversationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConversationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListConversationsResponse"; + }; + + return ListConversationsResponse; + })(); + + v1beta.GetConversationRequest = (function() { + + /** + * Properties of a GetConversationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetConversationRequest + * @property {string|null} [name] GetConversationRequest name + * @property {google.cloud.ces.v1beta.Conversation.Source|null} [source] GetConversationRequest source + */ + + /** + * Constructs a new GetConversationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetConversationRequest. + * @implements IGetConversationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetConversationRequest=} [properties] Properties to set + */ + function GetConversationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConversationRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @instance + */ + GetConversationRequest.prototype.name = ""; + + /** + * GetConversationRequest source. + * @member {google.cloud.ces.v1beta.Conversation.Source} source + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @instance + */ + GetConversationRequest.prototype.source = 0; + + /** + * Creates a new GetConversationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @static + * @param {google.cloud.ces.v1beta.IGetConversationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetConversationRequest} GetConversationRequest instance + */ + GetConversationRequest.create = function create(properties) { + return new GetConversationRequest(properties); + }; + + /** + * Encodes the specified GetConversationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetConversationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @static + * @param {google.cloud.ces.v1beta.IGetConversationRequest} message GetConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConversationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.source); + return writer; + }; + + /** + * Encodes the specified GetConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetConversationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @static + * @param {google.cloud.ces.v1beta.IGetConversationRequest} message GetConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConversationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConversationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetConversationRequest} GetConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConversationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetConversationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.source = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConversationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetConversationRequest} GetConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConversationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConversationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConversationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + switch (message.source) { + default: + return "source: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a GetConversationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetConversationRequest} GetConversationRequest + */ + GetConversationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetConversationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetConversationRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.source) { + default: + if (typeof object.source === "number") { + message.source = object.source; + break; + } + break; + case "SOURCE_UNSPECIFIED": + case 0: + message.source = 0; + break; + case "LIVE": + case 1: + message.source = 1; + break; + case "SIMULATOR": + case 2: + message.source = 2; + break; + case "EVAL": + case 3: + message.source = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetConversationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @static + * @param {google.cloud.ces.v1beta.GetConversationRequest} message GetConversationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConversationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.source != null && message.hasOwnProperty("source")) + object.source = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1beta.Conversation.Source[message.source] : message.source; + return object; + }; + + /** + * Converts this GetConversationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @instance + * @returns {Object.} JSON object + */ + GetConversationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConversationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetConversationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConversationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetConversationRequest"; + }; + + return GetConversationRequest; + })(); + + v1beta.DeleteConversationRequest = (function() { + + /** + * Properties of a DeleteConversationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteConversationRequest + * @property {string|null} [name] DeleteConversationRequest name + * @property {google.cloud.ces.v1beta.Conversation.Source|null} [source] DeleteConversationRequest source + */ + + /** + * Constructs a new DeleteConversationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteConversationRequest. + * @implements IDeleteConversationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteConversationRequest=} [properties] Properties to set + */ + function DeleteConversationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteConversationRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @instance + */ + DeleteConversationRequest.prototype.name = ""; + + /** + * DeleteConversationRequest source. + * @member {google.cloud.ces.v1beta.Conversation.Source} source + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @instance + */ + DeleteConversationRequest.prototype.source = 0; + + /** + * Creates a new DeleteConversationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteConversationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteConversationRequest} DeleteConversationRequest instance + */ + DeleteConversationRequest.create = function create(properties) { + return new DeleteConversationRequest(properties); + }; + + /** + * Encodes the specified DeleteConversationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteConversationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteConversationRequest} message DeleteConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteConversationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.source); + return writer; + }; + + /** + * Encodes the specified DeleteConversationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteConversationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteConversationRequest} message DeleteConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteConversationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteConversationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteConversationRequest} DeleteConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteConversationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteConversationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.source = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteConversationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteConversationRequest} DeleteConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteConversationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteConversationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteConversationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + switch (message.source) { + default: + return "source: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a DeleteConversationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteConversationRequest} DeleteConversationRequest + */ + DeleteConversationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteConversationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteConversationRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.source) { + default: + if (typeof object.source === "number") { + message.source = object.source; + break; + } + break; + case "SOURCE_UNSPECIFIED": + case 0: + message.source = 0; + break; + case "LIVE": + case 1: + message.source = 1; + break; + case "SIMULATOR": + case 2: + message.source = 2; + break; + case "EVAL": + case 3: + message.source = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a DeleteConversationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteConversationRequest} message DeleteConversationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteConversationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.source != null && message.hasOwnProperty("source")) + object.source = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1beta.Conversation.Source[message.source] : message.source; + return object; + }; + + /** + * Converts this DeleteConversationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteConversationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteConversationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteConversationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteConversationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteConversationRequest"; + }; + + return DeleteConversationRequest; + })(); + + v1beta.BatchDeleteConversationsRequest = (function() { + + /** + * Properties of a BatchDeleteConversationsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IBatchDeleteConversationsRequest + * @property {string|null} [parent] BatchDeleteConversationsRequest parent + * @property {Array.|null} [conversations] BatchDeleteConversationsRequest conversations + */ + + /** + * Constructs a new BatchDeleteConversationsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a BatchDeleteConversationsRequest. + * @implements IBatchDeleteConversationsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsRequest=} [properties] Properties to set + */ + function BatchDeleteConversationsRequest(properties) { + this.conversations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteConversationsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @instance + */ + BatchDeleteConversationsRequest.prototype.parent = ""; + + /** + * BatchDeleteConversationsRequest conversations. + * @member {Array.} conversations + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @instance + */ + BatchDeleteConversationsRequest.prototype.conversations = $util.emptyArray; + + /** + * Creates a new BatchDeleteConversationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @static + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest instance + */ + BatchDeleteConversationsRequest.create = function create(properties) { + return new BatchDeleteConversationsRequest(properties); + }; + + /** + * Encodes the specified BatchDeleteConversationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @static + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsRequest} message BatchDeleteConversationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteConversationsRequest.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.conversations != null && message.conversations.length) + for (var i = 0; i < message.conversations.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.conversations[i]); + return writer; + }; + + /** + * Encodes the specified BatchDeleteConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @static + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsRequest} message BatchDeleteConversationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteConversationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteConversationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BatchDeleteConversationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.conversations && message.conversations.length)) + message.conversations = []; + message.conversations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDeleteConversationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteConversationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteConversationsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteConversationsRequest.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.conversations != null && message.hasOwnProperty("conversations")) { + if (!Array.isArray(message.conversations)) + return "conversations: array expected"; + for (var i = 0; i < message.conversations.length; ++i) + if (!$util.isString(message.conversations[i])) + return "conversations: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchDeleteConversationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsRequest} BatchDeleteConversationsRequest + */ + BatchDeleteConversationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.BatchDeleteConversationsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.BatchDeleteConversationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.conversations) { + if (!Array.isArray(object.conversations)) + throw TypeError(".google.cloud.ces.v1beta.BatchDeleteConversationsRequest.conversations: array expected"); + message.conversations = []; + for (var i = 0; i < object.conversations.length; ++i) + message.conversations[i] = String(object.conversations[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchDeleteConversationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @static + * @param {google.cloud.ces.v1beta.BatchDeleteConversationsRequest} message BatchDeleteConversationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteConversationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conversations = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.conversations && message.conversations.length) { + object.conversations = []; + for (var j = 0; j < message.conversations.length; ++j) + object.conversations[j] = message.conversations[j]; + } + return object; + }; + + /** + * Converts this BatchDeleteConversationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteConversationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteConversationsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteConversationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.BatchDeleteConversationsRequest"; + }; + + return BatchDeleteConversationsRequest; + })(); + + v1beta.BatchDeleteConversationsResponse = (function() { + + /** + * Properties of a BatchDeleteConversationsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IBatchDeleteConversationsResponse + * @property {Array.|null} [deletedConversations] BatchDeleteConversationsResponse deletedConversations + * @property {Array.|null} [failedConversations] BatchDeleteConversationsResponse failedConversations + * @property {Array.|null} [errorMessages] BatchDeleteConversationsResponse errorMessages + */ + + /** + * Constructs a new BatchDeleteConversationsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a BatchDeleteConversationsResponse. + * @implements IBatchDeleteConversationsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsResponse=} [properties] Properties to set + */ + function BatchDeleteConversationsResponse(properties) { + this.deletedConversations = []; + this.failedConversations = []; + this.errorMessages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteConversationsResponse deletedConversations. + * @member {Array.} deletedConversations + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @instance + */ + BatchDeleteConversationsResponse.prototype.deletedConversations = $util.emptyArray; + + /** + * BatchDeleteConversationsResponse failedConversations. + * @member {Array.} failedConversations + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @instance + */ + BatchDeleteConversationsResponse.prototype.failedConversations = $util.emptyArray; + + /** + * BatchDeleteConversationsResponse errorMessages. + * @member {Array.} errorMessages + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @instance + */ + BatchDeleteConversationsResponse.prototype.errorMessages = $util.emptyArray; + + /** + * Creates a new BatchDeleteConversationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @static + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse instance + */ + BatchDeleteConversationsResponse.create = function create(properties) { + return new BatchDeleteConversationsResponse(properties); + }; + + /** + * Encodes the specified BatchDeleteConversationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @static + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsResponse} message BatchDeleteConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteConversationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deletedConversations != null && message.deletedConversations.length) + for (var i = 0; i < message.deletedConversations.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.deletedConversations[i]); + if (message.failedConversations != null && message.failedConversations.length) + for (var i = 0; i < message.failedConversations.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.failedConversations[i]); + if (message.errorMessages != null && message.errorMessages.length) + for (var i = 0; i < message.errorMessages.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorMessages[i]); + return writer; + }; + + /** + * Encodes the specified BatchDeleteConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BatchDeleteConversationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @static + * @param {google.cloud.ces.v1beta.IBatchDeleteConversationsResponse} message BatchDeleteConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteConversationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteConversationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BatchDeleteConversationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.deletedConversations && message.deletedConversations.length)) + message.deletedConversations = []; + message.deletedConversations.push(reader.string()); + break; + } + case 2: { + if (!(message.failedConversations && message.failedConversations.length)) + message.failedConversations = []; + message.failedConversations.push(reader.string()); + break; + } + case 3: { + if (!(message.errorMessages && message.errorMessages.length)) + message.errorMessages = []; + message.errorMessages.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDeleteConversationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteConversationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteConversationsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteConversationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deletedConversations != null && message.hasOwnProperty("deletedConversations")) { + if (!Array.isArray(message.deletedConversations)) + return "deletedConversations: array expected"; + for (var i = 0; i < message.deletedConversations.length; ++i) + if (!$util.isString(message.deletedConversations[i])) + return "deletedConversations: string[] expected"; + } + if (message.failedConversations != null && message.hasOwnProperty("failedConversations")) { + if (!Array.isArray(message.failedConversations)) + return "failedConversations: array expected"; + for (var i = 0; i < message.failedConversations.length; ++i) + if (!$util.isString(message.failedConversations[i])) + return "failedConversations: string[] expected"; + } + if (message.errorMessages != null && message.hasOwnProperty("errorMessages")) { + if (!Array.isArray(message.errorMessages)) + return "errorMessages: array expected"; + for (var i = 0; i < message.errorMessages.length; ++i) + if (!$util.isString(message.errorMessages[i])) + return "errorMessages: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchDeleteConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.BatchDeleteConversationsResponse} BatchDeleteConversationsResponse + */ + BatchDeleteConversationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.BatchDeleteConversationsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.BatchDeleteConversationsResponse(); + if (object.deletedConversations) { + if (!Array.isArray(object.deletedConversations)) + throw TypeError(".google.cloud.ces.v1beta.BatchDeleteConversationsResponse.deletedConversations: array expected"); + message.deletedConversations = []; + for (var i = 0; i < object.deletedConversations.length; ++i) + message.deletedConversations[i] = String(object.deletedConversations[i]); + } + if (object.failedConversations) { + if (!Array.isArray(object.failedConversations)) + throw TypeError(".google.cloud.ces.v1beta.BatchDeleteConversationsResponse.failedConversations: array expected"); + message.failedConversations = []; + for (var i = 0; i < object.failedConversations.length; ++i) + message.failedConversations[i] = String(object.failedConversations[i]); + } + if (object.errorMessages) { + if (!Array.isArray(object.errorMessages)) + throw TypeError(".google.cloud.ces.v1beta.BatchDeleteConversationsResponse.errorMessages: array expected"); + message.errorMessages = []; + for (var i = 0; i < object.errorMessages.length; ++i) + message.errorMessages[i] = String(object.errorMessages[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchDeleteConversationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @static + * @param {google.cloud.ces.v1beta.BatchDeleteConversationsResponse} message BatchDeleteConversationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteConversationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.deletedConversations = []; + object.failedConversations = []; + object.errorMessages = []; + } + if (message.deletedConversations && message.deletedConversations.length) { + object.deletedConversations = []; + for (var j = 0; j < message.deletedConversations.length; ++j) + object.deletedConversations[j] = message.deletedConversations[j]; + } + if (message.failedConversations && message.failedConversations.length) { + object.failedConversations = []; + for (var j = 0; j < message.failedConversations.length; ++j) + object.failedConversations[j] = message.failedConversations[j]; + } + if (message.errorMessages && message.errorMessages.length) { + object.errorMessages = []; + for (var j = 0; j < message.errorMessages.length; ++j) + object.errorMessages[j] = message.errorMessages[j]; + } + return object; + }; + + /** + * Converts this BatchDeleteConversationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteConversationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteConversationsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.BatchDeleteConversationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteConversationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.BatchDeleteConversationsResponse"; + }; + + return BatchDeleteConversationsResponse; + })(); + + v1beta.ListGuardrailsRequest = (function() { + + /** + * Properties of a ListGuardrailsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListGuardrailsRequest + * @property {string|null} [parent] ListGuardrailsRequest parent + * @property {number|null} [pageSize] ListGuardrailsRequest pageSize + * @property {string|null} [pageToken] ListGuardrailsRequest pageToken + * @property {string|null} [filter] ListGuardrailsRequest filter + * @property {string|null} [orderBy] ListGuardrailsRequest orderBy + */ + + /** + * Constructs a new ListGuardrailsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListGuardrailsRequest. + * @implements IListGuardrailsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListGuardrailsRequest=} [properties] Properties to set + */ + function ListGuardrailsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGuardrailsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @instance + */ + ListGuardrailsRequest.prototype.parent = ""; + + /** + * ListGuardrailsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @instance + */ + ListGuardrailsRequest.prototype.pageSize = 0; + + /** + * ListGuardrailsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @instance + */ + ListGuardrailsRequest.prototype.pageToken = ""; + + /** + * ListGuardrailsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @instance + */ + ListGuardrailsRequest.prototype.filter = ""; + + /** + * ListGuardrailsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @instance + */ + ListGuardrailsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListGuardrailsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @static + * @param {google.cloud.ces.v1beta.IListGuardrailsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListGuardrailsRequest} ListGuardrailsRequest instance + */ + ListGuardrailsRequest.create = function create(properties) { + return new ListGuardrailsRequest(properties); + }; + + /** + * Encodes the specified ListGuardrailsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @static + * @param {google.cloud.ces.v1beta.IListGuardrailsRequest} message ListGuardrailsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGuardrailsRequest.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 ListGuardrailsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @static + * @param {google.cloud.ces.v1beta.IListGuardrailsRequest} message ListGuardrailsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGuardrailsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGuardrailsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListGuardrailsRequest} ListGuardrailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGuardrailsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListGuardrailsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGuardrailsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListGuardrailsRequest} ListGuardrailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGuardrailsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGuardrailsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGuardrailsRequest.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 ListGuardrailsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListGuardrailsRequest} ListGuardrailsRequest + */ + ListGuardrailsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListGuardrailsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListGuardrailsRequest(); + 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 ListGuardrailsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @static + * @param {google.cloud.ces.v1beta.ListGuardrailsRequest} message ListGuardrailsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGuardrailsRequest.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 ListGuardrailsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @instance + * @returns {Object.} JSON object + */ + ListGuardrailsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGuardrailsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListGuardrailsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGuardrailsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListGuardrailsRequest"; + }; + + return ListGuardrailsRequest; + })(); + + v1beta.ListGuardrailsResponse = (function() { + + /** + * Properties of a ListGuardrailsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListGuardrailsResponse + * @property {Array.|null} [guardrails] ListGuardrailsResponse guardrails + * @property {string|null} [nextPageToken] ListGuardrailsResponse nextPageToken + */ + + /** + * Constructs a new ListGuardrailsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListGuardrailsResponse. + * @implements IListGuardrailsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListGuardrailsResponse=} [properties] Properties to set + */ + function ListGuardrailsResponse(properties) { + this.guardrails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGuardrailsResponse guardrails. + * @member {Array.} guardrails + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @instance + */ + ListGuardrailsResponse.prototype.guardrails = $util.emptyArray; + + /** + * ListGuardrailsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @instance + */ + ListGuardrailsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListGuardrailsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @static + * @param {google.cloud.ces.v1beta.IListGuardrailsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListGuardrailsResponse} ListGuardrailsResponse instance + */ + ListGuardrailsResponse.create = function create(properties) { + return new ListGuardrailsResponse(properties); + }; + + /** + * Encodes the specified ListGuardrailsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @static + * @param {google.cloud.ces.v1beta.IListGuardrailsResponse} message ListGuardrailsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGuardrailsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.guardrails != null && message.guardrails.length) + for (var i = 0; i < message.guardrails.length; ++i) + $root.google.cloud.ces.v1beta.Guardrail.encode(message.guardrails[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 ListGuardrailsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListGuardrailsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @static + * @param {google.cloud.ces.v1beta.IListGuardrailsResponse} message ListGuardrailsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGuardrailsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGuardrailsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListGuardrailsResponse} ListGuardrailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGuardrailsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListGuardrailsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.guardrails && message.guardrails.length)) + message.guardrails = []; + message.guardrails.push($root.google.cloud.ces.v1beta.Guardrail.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGuardrailsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListGuardrailsResponse} ListGuardrailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGuardrailsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGuardrailsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGuardrailsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.guardrails != null && message.hasOwnProperty("guardrails")) { + if (!Array.isArray(message.guardrails)) + return "guardrails: array expected"; + for (var i = 0; i < message.guardrails.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Guardrail.verify(message.guardrails[i]); + if (error) + return "guardrails." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListGuardrailsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListGuardrailsResponse} ListGuardrailsResponse + */ + ListGuardrailsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListGuardrailsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListGuardrailsResponse(); + if (object.guardrails) { + if (!Array.isArray(object.guardrails)) + throw TypeError(".google.cloud.ces.v1beta.ListGuardrailsResponse.guardrails: array expected"); + message.guardrails = []; + for (var i = 0; i < object.guardrails.length; ++i) { + if (typeof object.guardrails[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListGuardrailsResponse.guardrails: object expected"); + message.guardrails[i] = $root.google.cloud.ces.v1beta.Guardrail.fromObject(object.guardrails[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListGuardrailsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @static + * @param {google.cloud.ces.v1beta.ListGuardrailsResponse} message ListGuardrailsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGuardrailsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.guardrails = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.guardrails && message.guardrails.length) { + object.guardrails = []; + for (var j = 0; j < message.guardrails.length; ++j) + object.guardrails[j] = $root.google.cloud.ces.v1beta.Guardrail.toObject(message.guardrails[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListGuardrailsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @instance + * @returns {Object.} JSON object + */ + ListGuardrailsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGuardrailsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListGuardrailsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGuardrailsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListGuardrailsResponse"; + }; + + return ListGuardrailsResponse; + })(); + + v1beta.GetGuardrailRequest = (function() { + + /** + * Properties of a GetGuardrailRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetGuardrailRequest + * @property {string|null} [name] GetGuardrailRequest name + */ + + /** + * Constructs a new GetGuardrailRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetGuardrailRequest. + * @implements IGetGuardrailRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetGuardrailRequest=} [properties] Properties to set + */ + function GetGuardrailRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGuardrailRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @instance + */ + GetGuardrailRequest.prototype.name = ""; + + /** + * Creates a new GetGuardrailRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.IGetGuardrailRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetGuardrailRequest} GetGuardrailRequest instance + */ + GetGuardrailRequest.create = function create(properties) { + return new GetGuardrailRequest(properties); + }; + + /** + * Encodes the specified GetGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetGuardrailRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.IGetGuardrailRequest} message GetGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGuardrailRequest.encode = function encode(message, writer) { + 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 GetGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetGuardrailRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.IGetGuardrailRequest} message GetGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGuardrailRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetGuardrailRequest} GetGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGuardrailRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetGuardrailRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGuardrailRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetGuardrailRequest} GetGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGuardrailRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGuardrailRequest.verify = function verify(message) { + if (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 GetGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetGuardrailRequest} GetGuardrailRequest + */ + GetGuardrailRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetGuardrailRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetGuardrailRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGuardrailRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.GetGuardrailRequest} message GetGuardrailRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGuardrailRequest.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 GetGuardrailRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @instance + * @returns {Object.} JSON object + */ + GetGuardrailRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGuardrailRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetGuardrailRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetGuardrailRequest"; + }; + + return GetGuardrailRequest; + })(); + + v1beta.CreateGuardrailRequest = (function() { + + /** + * Properties of a CreateGuardrailRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateGuardrailRequest + * @property {string|null} [parent] CreateGuardrailRequest parent + * @property {string|null} [guardrailId] CreateGuardrailRequest guardrailId + * @property {google.cloud.ces.v1beta.IGuardrail|null} [guardrail] CreateGuardrailRequest guardrail + */ + + /** + * Constructs a new CreateGuardrailRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateGuardrailRequest. + * @implements ICreateGuardrailRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateGuardrailRequest=} [properties] Properties to set + */ + function CreateGuardrailRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGuardrailRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @instance + */ + CreateGuardrailRequest.prototype.parent = ""; + + /** + * CreateGuardrailRequest guardrailId. + * @member {string} guardrailId + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @instance + */ + CreateGuardrailRequest.prototype.guardrailId = ""; + + /** + * CreateGuardrailRequest guardrail. + * @member {google.cloud.ces.v1beta.IGuardrail|null|undefined} guardrail + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @instance + */ + CreateGuardrailRequest.prototype.guardrail = null; + + /** + * Creates a new CreateGuardrailRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateGuardrailRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateGuardrailRequest} CreateGuardrailRequest instance + */ + CreateGuardrailRequest.create = function create(properties) { + return new CreateGuardrailRequest(properties); + }; + + /** + * Encodes the specified CreateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateGuardrailRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateGuardrailRequest} message CreateGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGuardrailRequest.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.guardrailId != null && Object.hasOwnProperty.call(message, "guardrailId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.guardrailId); + if (message.guardrail != null && Object.hasOwnProperty.call(message, "guardrail")) + $root.google.cloud.ces.v1beta.Guardrail.encode(message.guardrail, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateGuardrailRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateGuardrailRequest} message CreateGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGuardrailRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateGuardrailRequest} CreateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGuardrailRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateGuardrailRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.guardrailId = reader.string(); + break; + } + case 3: { + message.guardrail = $root.google.cloud.ces.v1beta.Guardrail.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGuardrailRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateGuardrailRequest} CreateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGuardrailRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGuardrailRequest.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.guardrailId != null && message.hasOwnProperty("guardrailId")) + if (!$util.isString(message.guardrailId)) + return "guardrailId: string expected"; + if (message.guardrail != null && message.hasOwnProperty("guardrail")) { + var error = $root.google.cloud.ces.v1beta.Guardrail.verify(message.guardrail); + if (error) + return "guardrail." + error; + } + return null; + }; + + /** + * Creates a CreateGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateGuardrailRequest} CreateGuardrailRequest + */ + CreateGuardrailRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateGuardrailRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateGuardrailRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.guardrailId != null) + message.guardrailId = String(object.guardrailId); + if (object.guardrail != null) { + if (typeof object.guardrail !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateGuardrailRequest.guardrail: object expected"); + message.guardrail = $root.google.cloud.ces.v1beta.Guardrail.fromObject(object.guardrail); + } + return message; + }; + + /** + * Creates a plain object from a CreateGuardrailRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.CreateGuardrailRequest} message CreateGuardrailRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGuardrailRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.guardrailId = ""; + object.guardrail = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.guardrailId != null && message.hasOwnProperty("guardrailId")) + object.guardrailId = message.guardrailId; + if (message.guardrail != null && message.hasOwnProperty("guardrail")) + object.guardrail = $root.google.cloud.ces.v1beta.Guardrail.toObject(message.guardrail, options); + return object; + }; + + /** + * Converts this CreateGuardrailRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGuardrailRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateGuardrailRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateGuardrailRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateGuardrailRequest"; + }; + + return CreateGuardrailRequest; + })(); + + v1beta.UpdateGuardrailRequest = (function() { + + /** + * Properties of an UpdateGuardrailRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateGuardrailRequest + * @property {google.cloud.ces.v1beta.IGuardrail|null} [guardrail] UpdateGuardrailRequest guardrail + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGuardrailRequest updateMask + */ + + /** + * Constructs a new UpdateGuardrailRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateGuardrailRequest. + * @implements IUpdateGuardrailRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateGuardrailRequest=} [properties] Properties to set + */ + function UpdateGuardrailRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateGuardrailRequest guardrail. + * @member {google.cloud.ces.v1beta.IGuardrail|null|undefined} guardrail + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @instance + */ + UpdateGuardrailRequest.prototype.guardrail = null; + + /** + * UpdateGuardrailRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @instance + */ + UpdateGuardrailRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateGuardrailRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateGuardrailRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateGuardrailRequest} UpdateGuardrailRequest instance + */ + UpdateGuardrailRequest.create = function create(properties) { + return new UpdateGuardrailRequest(properties); + }; + + /** + * Encodes the specified UpdateGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateGuardrailRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateGuardrailRequest} message UpdateGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGuardrailRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.guardrail != null && Object.hasOwnProperty.call(message, "guardrail")) + $root.google.cloud.ces.v1beta.Guardrail.encode(message.guardrail, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateGuardrailRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateGuardrailRequest} message UpdateGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGuardrailRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateGuardrailRequest} UpdateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGuardrailRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateGuardrailRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.guardrail = $root.google.cloud.ces.v1beta.Guardrail.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateGuardrailRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateGuardrailRequest} UpdateGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGuardrailRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGuardrailRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.guardrail != null && message.hasOwnProperty("guardrail")) { + var error = $root.google.cloud.ces.v1beta.Guardrail.verify(message.guardrail); + if (error) + return "guardrail." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateGuardrailRequest} UpdateGuardrailRequest + */ + UpdateGuardrailRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateGuardrailRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateGuardrailRequest(); + if (object.guardrail != null) { + if (typeof object.guardrail !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateGuardrailRequest.guardrail: object expected"); + message.guardrail = $root.google.cloud.ces.v1beta.Guardrail.fromObject(object.guardrail); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateGuardrailRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateGuardrailRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateGuardrailRequest} message UpdateGuardrailRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGuardrailRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.guardrail = null; + object.updateMask = null; + } + if (message.guardrail != null && message.hasOwnProperty("guardrail")) + object.guardrail = $root.google.cloud.ces.v1beta.Guardrail.toObject(message.guardrail, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateGuardrailRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateGuardrailRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateGuardrailRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateGuardrailRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateGuardrailRequest"; + }; + + return UpdateGuardrailRequest; + })(); + + v1beta.DeleteGuardrailRequest = (function() { + + /** + * Properties of a DeleteGuardrailRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteGuardrailRequest + * @property {string|null} [name] DeleteGuardrailRequest name + * @property {boolean|null} [force] DeleteGuardrailRequest force + * @property {string|null} [etag] DeleteGuardrailRequest etag + */ + + /** + * Constructs a new DeleteGuardrailRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteGuardrailRequest. + * @implements IDeleteGuardrailRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteGuardrailRequest=} [properties] Properties to set + */ + function DeleteGuardrailRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGuardrailRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @instance + */ + DeleteGuardrailRequest.prototype.name = ""; + + /** + * DeleteGuardrailRequest force. + * @member {boolean} force + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @instance + */ + DeleteGuardrailRequest.prototype.force = false; + + /** + * DeleteGuardrailRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @instance + */ + DeleteGuardrailRequest.prototype.etag = ""; + + /** + * Creates a new DeleteGuardrailRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteGuardrailRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteGuardrailRequest} DeleteGuardrailRequest instance + */ + DeleteGuardrailRequest.create = function create(properties) { + return new DeleteGuardrailRequest(properties); + }; + + /** + * Encodes the specified DeleteGuardrailRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteGuardrailRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteGuardrailRequest} message DeleteGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGuardrailRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteGuardrailRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteGuardrailRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteGuardrailRequest} message DeleteGuardrailRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGuardrailRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGuardrailRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteGuardrailRequest} DeleteGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGuardrailRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteGuardrailRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGuardrailRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteGuardrailRequest} DeleteGuardrailRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGuardrailRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGuardrailRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGuardrailRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteGuardrailRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteGuardrailRequest} DeleteGuardrailRequest + */ + DeleteGuardrailRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteGuardrailRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteGuardrailRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteGuardrailRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteGuardrailRequest} message DeleteGuardrailRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGuardrailRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteGuardrailRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGuardrailRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteGuardrailRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteGuardrailRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGuardrailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteGuardrailRequest"; + }; + + return DeleteGuardrailRequest; + })(); + + v1beta.ListDeploymentsRequest = (function() { + + /** + * Properties of a ListDeploymentsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListDeploymentsRequest + * @property {string|null} [parent] ListDeploymentsRequest parent + * @property {number|null} [pageSize] ListDeploymentsRequest pageSize + * @property {string|null} [pageToken] ListDeploymentsRequest pageToken + * @property {string|null} [orderBy] ListDeploymentsRequest orderBy + */ + + /** + * Constructs a new ListDeploymentsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListDeploymentsRequest. + * @implements IListDeploymentsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListDeploymentsRequest=} [properties] Properties to set + */ + function ListDeploymentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDeploymentsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.parent = ""; + + /** + * ListDeploymentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.pageSize = 0; + + /** + * ListDeploymentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.pageToken = ""; + + /** + * ListDeploymentsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListDeploymentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @static + * @param {google.cloud.ces.v1beta.IListDeploymentsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListDeploymentsRequest} ListDeploymentsRequest instance + */ + ListDeploymentsRequest.create = function create(properties) { + return new ListDeploymentsRequest(properties); + }; + + /** + * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @static + * @param {google.cloud.ces.v1beta.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsRequest.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @static + * @param {google.cloud.ces.v1beta.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListDeploymentsRequest} ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListDeploymentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListDeploymentsRequest} ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeploymentsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeploymentsRequest.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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListDeploymentsRequest} ListDeploymentsRequest + */ + ListDeploymentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListDeploymentsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListDeploymentsRequest(); + 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.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListDeploymentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @static + * @param {google.cloud.ces.v1beta.ListDeploymentsRequest} message ListDeploymentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeploymentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + 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.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListDeploymentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDeploymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeploymentsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListDeploymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeploymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListDeploymentsRequest"; + }; + + return ListDeploymentsRequest; + })(); + + v1beta.ListDeploymentsResponse = (function() { + + /** + * Properties of a ListDeploymentsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListDeploymentsResponse + * @property {Array.|null} [deployments] ListDeploymentsResponse deployments + * @property {string|null} [nextPageToken] ListDeploymentsResponse nextPageToken + */ + + /** + * Constructs a new ListDeploymentsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListDeploymentsResponse. + * @implements IListDeploymentsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListDeploymentsResponse=} [properties] Properties to set + */ + function ListDeploymentsResponse(properties) { + this.deployments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDeploymentsResponse deployments. + * @member {Array.} deployments + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @instance + */ + ListDeploymentsResponse.prototype.deployments = $util.emptyArray; + + /** + * ListDeploymentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @instance + */ + ListDeploymentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDeploymentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @static + * @param {google.cloud.ces.v1beta.IListDeploymentsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListDeploymentsResponse} ListDeploymentsResponse instance + */ + ListDeploymentsResponse.create = function create(properties) { + return new ListDeploymentsResponse(properties); + }; + + /** + * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @static + * @param {google.cloud.ces.v1beta.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployments != null && message.deployments.length) + for (var i = 0; i < message.deployments.length; ++i) + $root.google.cloud.ces.v1beta.Deployment.encode(message.deployments[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 ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListDeploymentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @static + * @param {google.cloud.ces.v1beta.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListDeploymentsResponse} ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListDeploymentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.deployments && message.deployments.length)) + message.deployments = []; + message.deployments.push($root.google.cloud.ces.v1beta.Deployment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListDeploymentsResponse} ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeploymentsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeploymentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deployments != null && message.hasOwnProperty("deployments")) { + if (!Array.isArray(message.deployments)) + return "deployments: array expected"; + for (var i = 0; i < message.deployments.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Deployment.verify(message.deployments[i]); + if (error) + return "deployments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListDeploymentsResponse} ListDeploymentsResponse + */ + ListDeploymentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListDeploymentsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListDeploymentsResponse(); + if (object.deployments) { + if (!Array.isArray(object.deployments)) + throw TypeError(".google.cloud.ces.v1beta.ListDeploymentsResponse.deployments: array expected"); + message.deployments = []; + for (var i = 0; i < object.deployments.length; ++i) { + if (typeof object.deployments[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListDeploymentsResponse.deployments: object expected"); + message.deployments[i] = $root.google.cloud.ces.v1beta.Deployment.fromObject(object.deployments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @static + * @param {google.cloud.ces.v1beta.ListDeploymentsResponse} message ListDeploymentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeploymentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.deployments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.deployments && message.deployments.length) { + object.deployments = []; + for (var j = 0; j < message.deployments.length; ++j) + object.deployments[j] = $root.google.cloud.ces.v1beta.Deployment.toObject(message.deployments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDeploymentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDeploymentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeploymentsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListDeploymentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeploymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListDeploymentsResponse"; + }; + + return ListDeploymentsResponse; + })(); + + v1beta.GetDeploymentRequest = (function() { + + /** + * Properties of a GetDeploymentRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetDeploymentRequest + * @property {string|null} [name] GetDeploymentRequest name + */ + + /** + * Constructs a new GetDeploymentRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetDeploymentRequest. + * @implements IGetDeploymentRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetDeploymentRequest=} [properties] Properties to set + */ + function GetDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @instance + */ + GetDeploymentRequest.prototype.name = ""; + + /** + * Creates a new GetDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.IGetDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetDeploymentRequest} GetDeploymentRequest instance + */ + GetDeploymentRequest.create = function create(properties) { + return new GetDeploymentRequest(properties); + }; + + /** + * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeploymentRequest.encode = function encode(message, writer) { + 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 GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetDeploymentRequest} GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetDeploymentRequest} GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDeploymentRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDeploymentRequest.verify = function verify(message) { + if (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 GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetDeploymentRequest} GetDeploymentRequest + */ + GetDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetDeploymentRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.GetDeploymentRequest} message GetDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDeploymentRequest.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 GetDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + GetDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetDeploymentRequest"; + }; + + return GetDeploymentRequest; + })(); + + v1beta.CreateDeploymentRequest = (function() { + + /** + * Properties of a CreateDeploymentRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateDeploymentRequest + * @property {string|null} [parent] CreateDeploymentRequest parent + * @property {string|null} [deploymentId] CreateDeploymentRequest deploymentId + * @property {google.cloud.ces.v1beta.IDeployment|null} [deployment] CreateDeploymentRequest deployment + */ + + /** + * Constructs a new CreateDeploymentRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateDeploymentRequest. + * @implements ICreateDeploymentRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateDeploymentRequest=} [properties] Properties to set + */ + function CreateDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDeploymentRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @instance + */ + CreateDeploymentRequest.prototype.parent = ""; + + /** + * CreateDeploymentRequest deploymentId. + * @member {string} deploymentId + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @instance + */ + CreateDeploymentRequest.prototype.deploymentId = ""; + + /** + * CreateDeploymentRequest deployment. + * @member {google.cloud.ces.v1beta.IDeployment|null|undefined} deployment + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @instance + */ + CreateDeploymentRequest.prototype.deployment = null; + + /** + * Creates a new CreateDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateDeploymentRequest} CreateDeploymentRequest instance + */ + CreateDeploymentRequest.create = function create(properties) { + return new CreateDeploymentRequest(properties); + }; + + /** + * Encodes the specified CreateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateDeploymentRequest} message CreateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDeploymentRequest.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.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + $root.google.cloud.ces.v1beta.Deployment.encode(message.deployment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deploymentId != null && Object.hasOwnProperty.call(message, "deploymentId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deploymentId); + return writer; + }; + + /** + * Encodes the specified CreateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateDeploymentRequest} message CreateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateDeploymentRequest} CreateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.deploymentId = reader.string(); + break; + } + case 2: { + message.deployment = $root.google.cloud.ces.v1beta.Deployment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateDeploymentRequest} CreateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDeploymentRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDeploymentRequest.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.deploymentId != null && message.hasOwnProperty("deploymentId")) + if (!$util.isString(message.deploymentId)) + return "deploymentId: string expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) { + var error = $root.google.cloud.ces.v1beta.Deployment.verify(message.deployment); + if (error) + return "deployment." + error; + } + return null; + }; + + /** + * Creates a CreateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateDeploymentRequest} CreateDeploymentRequest + */ + CreateDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateDeploymentRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateDeploymentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.deploymentId != null) + message.deploymentId = String(object.deploymentId); + if (object.deployment != null) { + if (typeof object.deployment !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateDeploymentRequest.deployment: object expected"); + message.deployment = $root.google.cloud.ces.v1beta.Deployment.fromObject(object.deployment); + } + return message; + }; + + /** + * Creates a plain object from a CreateDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.CreateDeploymentRequest} message CreateDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.deployment = null; + object.deploymentId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = $root.google.cloud.ces.v1beta.Deployment.toObject(message.deployment, options); + if (message.deploymentId != null && message.hasOwnProperty("deploymentId")) + object.deploymentId = message.deploymentId; + return object; + }; + + /** + * Converts this CreateDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateDeploymentRequest"; + }; + + return CreateDeploymentRequest; + })(); + + v1beta.UpdateDeploymentRequest = (function() { + + /** + * Properties of an UpdateDeploymentRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateDeploymentRequest + * @property {google.cloud.ces.v1beta.IDeployment|null} [deployment] UpdateDeploymentRequest deployment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDeploymentRequest updateMask + */ + + /** + * Constructs a new UpdateDeploymentRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateDeploymentRequest. + * @implements IUpdateDeploymentRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateDeploymentRequest=} [properties] Properties to set + */ + function UpdateDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDeploymentRequest deployment. + * @member {google.cloud.ces.v1beta.IDeployment|null|undefined} deployment + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @instance + */ + UpdateDeploymentRequest.prototype.deployment = null; + + /** + * UpdateDeploymentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @instance + */ + UpdateDeploymentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateDeploymentRequest} UpdateDeploymentRequest instance + */ + UpdateDeploymentRequest.create = function create(properties) { + return new UpdateDeploymentRequest(properties); + }; + + /** + * Encodes the specified UpdateDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateDeploymentRequest} message UpdateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + $root.google.cloud.ces.v1beta.Deployment.encode(message.deployment, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateDeploymentRequest} message UpdateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateDeploymentRequest} UpdateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deployment = $root.google.cloud.ces.v1beta.Deployment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateDeploymentRequest} UpdateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDeploymentRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) { + var error = $root.google.cloud.ces.v1beta.Deployment.verify(message.deployment); + if (error) + return "deployment." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateDeploymentRequest} UpdateDeploymentRequest + */ + UpdateDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateDeploymentRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateDeploymentRequest(); + if (object.deployment != null) { + if (typeof object.deployment !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateDeploymentRequest.deployment: object expected"); + message.deployment = $root.google.cloud.ces.v1beta.Deployment.fromObject(object.deployment); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateDeploymentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateDeploymentRequest} message UpdateDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deployment = null; + object.updateMask = null; + } + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = $root.google.cloud.ces.v1beta.Deployment.toObject(message.deployment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateDeploymentRequest"; + }; + + return UpdateDeploymentRequest; + })(); + + v1beta.DeleteDeploymentRequest = (function() { + + /** + * Properties of a DeleteDeploymentRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteDeploymentRequest + * @property {string|null} [name] DeleteDeploymentRequest name + * @property {string|null} [etag] DeleteDeploymentRequest etag + */ + + /** + * Constructs a new DeleteDeploymentRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteDeploymentRequest. + * @implements IDeleteDeploymentRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteDeploymentRequest=} [properties] Properties to set + */ + function DeleteDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @instance + */ + DeleteDeploymentRequest.prototype.name = ""; + + /** + * DeleteDeploymentRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @instance + */ + DeleteDeploymentRequest.prototype.etag = ""; + + /** + * Creates a new DeleteDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteDeploymentRequest} DeleteDeploymentRequest instance + */ + DeleteDeploymentRequest.create = function create(properties) { + return new DeleteDeploymentRequest(properties); + }; + + /** + * Encodes the specified DeleteDeploymentRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteDeploymentRequest} message DeleteDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteDeploymentRequest} message DeleteDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteDeploymentRequest} DeleteDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteDeploymentRequest} DeleteDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDeploymentRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteDeploymentRequest} DeleteDeploymentRequest + */ + DeleteDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteDeploymentRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteDeploymentRequest} message DeleteDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteDeploymentRequest"; + }; + + return DeleteDeploymentRequest; + })(); + + v1beta.ListToolsetsRequest = (function() { + + /** + * Properties of a ListToolsetsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListToolsetsRequest + * @property {string|null} [parent] ListToolsetsRequest parent + * @property {number|null} [pageSize] ListToolsetsRequest pageSize + * @property {string|null} [pageToken] ListToolsetsRequest pageToken + * @property {string|null} [filter] ListToolsetsRequest filter + * @property {string|null} [orderBy] ListToolsetsRequest orderBy + */ + + /** + * Constructs a new ListToolsetsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListToolsetsRequest. + * @implements IListToolsetsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListToolsetsRequest=} [properties] Properties to set + */ + function ListToolsetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolsetsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @instance + */ + ListToolsetsRequest.prototype.parent = ""; + + /** + * ListToolsetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @instance + */ + ListToolsetsRequest.prototype.pageSize = 0; + + /** + * ListToolsetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @instance + */ + ListToolsetsRequest.prototype.pageToken = ""; + + /** + * ListToolsetsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @instance + */ + ListToolsetsRequest.prototype.filter = ""; + + /** + * ListToolsetsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @instance + */ + ListToolsetsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListToolsetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @static + * @param {google.cloud.ces.v1beta.IListToolsetsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListToolsetsRequest} ListToolsetsRequest instance + */ + ListToolsetsRequest.create = function create(properties) { + return new ListToolsetsRequest(properties); + }; + + /** + * Encodes the specified ListToolsetsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @static + * @param {google.cloud.ces.v1beta.IListToolsetsRequest} message ListToolsetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsetsRequest.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 ListToolsetsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @static + * @param {google.cloud.ces.v1beta.IListToolsetsRequest} message ListToolsetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolsetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListToolsetsRequest} ListToolsetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsetsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListToolsetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolsetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListToolsetsRequest} ListToolsetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolsetsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolsetsRequest.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 ListToolsetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListToolsetsRequest} ListToolsetsRequest + */ + ListToolsetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListToolsetsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListToolsetsRequest(); + 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 ListToolsetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @static + * @param {google.cloud.ces.v1beta.ListToolsetsRequest} message ListToolsetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolsetsRequest.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 ListToolsetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListToolsetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolsetsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListToolsetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolsetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListToolsetsRequest"; + }; + + return ListToolsetsRequest; + })(); + + v1beta.ListToolsetsResponse = (function() { + + /** + * Properties of a ListToolsetsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListToolsetsResponse + * @property {Array.|null} [toolsets] ListToolsetsResponse toolsets + * @property {string|null} [nextPageToken] ListToolsetsResponse nextPageToken + */ + + /** + * Constructs a new ListToolsetsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListToolsetsResponse. + * @implements IListToolsetsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListToolsetsResponse=} [properties] Properties to set + */ + function ListToolsetsResponse(properties) { + this.toolsets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListToolsetsResponse toolsets. + * @member {Array.} toolsets + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @instance + */ + ListToolsetsResponse.prototype.toolsets = $util.emptyArray; + + /** + * ListToolsetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @instance + */ + ListToolsetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListToolsetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @static + * @param {google.cloud.ces.v1beta.IListToolsetsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListToolsetsResponse} ListToolsetsResponse instance + */ + ListToolsetsResponse.create = function create(properties) { + return new ListToolsetsResponse(properties); + }; + + /** + * Encodes the specified ListToolsetsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @static + * @param {google.cloud.ces.v1beta.IListToolsetsResponse} message ListToolsetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolsets != null && message.toolsets.length) + for (var i = 0; i < message.toolsets.length; ++i) + $root.google.cloud.ces.v1beta.Toolset.encode(message.toolsets[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 ListToolsetsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListToolsetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @static + * @param {google.cloud.ces.v1beta.IListToolsetsResponse} message ListToolsetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListToolsetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListToolsetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListToolsetsResponse} ListToolsetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsetsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListToolsetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.toolsets && message.toolsets.length)) + message.toolsets = []; + message.toolsets.push($root.google.cloud.ces.v1beta.Toolset.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListToolsetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListToolsetsResponse} ListToolsetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListToolsetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListToolsetsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListToolsetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolsets != null && message.hasOwnProperty("toolsets")) { + if (!Array.isArray(message.toolsets)) + return "toolsets: array expected"; + for (var i = 0; i < message.toolsets.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Toolset.verify(message.toolsets[i]); + if (error) + return "toolsets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListToolsetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListToolsetsResponse} ListToolsetsResponse + */ + ListToolsetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListToolsetsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListToolsetsResponse(); + if (object.toolsets) { + if (!Array.isArray(object.toolsets)) + throw TypeError(".google.cloud.ces.v1beta.ListToolsetsResponse.toolsets: array expected"); + message.toolsets = []; + for (var i = 0; i < object.toolsets.length; ++i) { + if (typeof object.toolsets[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListToolsetsResponse.toolsets: object expected"); + message.toolsets[i] = $root.google.cloud.ces.v1beta.Toolset.fromObject(object.toolsets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListToolsetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @static + * @param {google.cloud.ces.v1beta.ListToolsetsResponse} message ListToolsetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListToolsetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.toolsets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.toolsets && message.toolsets.length) { + object.toolsets = []; + for (var j = 0; j < message.toolsets.length; ++j) + object.toolsets[j] = $root.google.cloud.ces.v1beta.Toolset.toObject(message.toolsets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListToolsetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListToolsetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListToolsetsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListToolsetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListToolsetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListToolsetsResponse"; + }; + + return ListToolsetsResponse; + })(); + + v1beta.GetToolsetRequest = (function() { + + /** + * Properties of a GetToolsetRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetToolsetRequest + * @property {string|null} [name] GetToolsetRequest name + */ + + /** + * Constructs a new GetToolsetRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetToolsetRequest. + * @implements IGetToolsetRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetToolsetRequest=} [properties] Properties to set + */ + function GetToolsetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetToolsetRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @instance + */ + GetToolsetRequest.prototype.name = ""; + + /** + * Creates a new GetToolsetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.IGetToolsetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetToolsetRequest} GetToolsetRequest instance + */ + GetToolsetRequest.create = function create(properties) { + return new GetToolsetRequest(properties); + }; + + /** + * Encodes the specified GetToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetToolsetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.IGetToolsetRequest} message GetToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolsetRequest.encode = function encode(message, writer) { + 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 GetToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetToolsetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.IGetToolsetRequest} message GetToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetToolsetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetToolsetRequest} GetToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolsetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetToolsetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetToolsetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetToolsetRequest} GetToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetToolsetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetToolsetRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetToolsetRequest.verify = function verify(message) { + if (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 GetToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetToolsetRequest} GetToolsetRequest + */ + GetToolsetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetToolsetRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetToolsetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetToolsetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.GetToolsetRequest} message GetToolsetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetToolsetRequest.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 GetToolsetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @instance + * @returns {Object.} JSON object + */ + GetToolsetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetToolsetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetToolsetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetToolsetRequest"; + }; + + return GetToolsetRequest; + })(); + + v1beta.CreateToolsetRequest = (function() { + + /** + * Properties of a CreateToolsetRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateToolsetRequest + * @property {string|null} [parent] CreateToolsetRequest parent + * @property {string|null} [toolsetId] CreateToolsetRequest toolsetId + * @property {google.cloud.ces.v1beta.IToolset|null} [toolset] CreateToolsetRequest toolset + */ + + /** + * Constructs a new CreateToolsetRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateToolsetRequest. + * @implements ICreateToolsetRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateToolsetRequest=} [properties] Properties to set + */ + function CreateToolsetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateToolsetRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @instance + */ + CreateToolsetRequest.prototype.parent = ""; + + /** + * CreateToolsetRequest toolsetId. + * @member {string} toolsetId + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @instance + */ + CreateToolsetRequest.prototype.toolsetId = ""; + + /** + * CreateToolsetRequest toolset. + * @member {google.cloud.ces.v1beta.IToolset|null|undefined} toolset + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @instance + */ + CreateToolsetRequest.prototype.toolset = null; + + /** + * Creates a new CreateToolsetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateToolsetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateToolsetRequest} CreateToolsetRequest instance + */ + CreateToolsetRequest.create = function create(properties) { + return new CreateToolsetRequest(properties); + }; + + /** + * Encodes the specified CreateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolsetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateToolsetRequest} message CreateToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolsetRequest.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.toolsetId != null && Object.hasOwnProperty.call(message, "toolsetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.toolsetId); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + $root.google.cloud.ces.v1beta.Toolset.encode(message.toolset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateToolsetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateToolsetRequest} message CreateToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateToolsetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateToolsetRequest} CreateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolsetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateToolsetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.toolsetId = reader.string(); + break; + } + case 3: { + message.toolset = $root.google.cloud.ces.v1beta.Toolset.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateToolsetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateToolsetRequest} CreateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateToolsetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateToolsetRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateToolsetRequest.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.toolsetId != null && message.hasOwnProperty("toolsetId")) + if (!$util.isString(message.toolsetId)) + return "toolsetId: string expected"; + if (message.toolset != null && message.hasOwnProperty("toolset")) { + var error = $root.google.cloud.ces.v1beta.Toolset.verify(message.toolset); + if (error) + return "toolset." + error; + } + return null; + }; + + /** + * Creates a CreateToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateToolsetRequest} CreateToolsetRequest + */ + CreateToolsetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateToolsetRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateToolsetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.toolsetId != null) + message.toolsetId = String(object.toolsetId); + if (object.toolset != null) { + if (typeof object.toolset !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateToolsetRequest.toolset: object expected"); + message.toolset = $root.google.cloud.ces.v1beta.Toolset.fromObject(object.toolset); + } + return message; + }; + + /** + * Creates a plain object from a CreateToolsetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.CreateToolsetRequest} message CreateToolsetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateToolsetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.toolsetId = ""; + object.toolset = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.toolsetId != null && message.hasOwnProperty("toolsetId")) + object.toolsetId = message.toolsetId; + if (message.toolset != null && message.hasOwnProperty("toolset")) + object.toolset = $root.google.cloud.ces.v1beta.Toolset.toObject(message.toolset, options); + return object; + }; + + /** + * Converts this CreateToolsetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateToolsetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateToolsetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateToolsetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateToolsetRequest"; + }; + + return CreateToolsetRequest; + })(); + + v1beta.UpdateToolsetRequest = (function() { + + /** + * Properties of an UpdateToolsetRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateToolsetRequest + * @property {google.cloud.ces.v1beta.IToolset|null} [toolset] UpdateToolsetRequest toolset + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateToolsetRequest updateMask + */ + + /** + * Constructs a new UpdateToolsetRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateToolsetRequest. + * @implements IUpdateToolsetRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateToolsetRequest=} [properties] Properties to set + */ + function UpdateToolsetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateToolsetRequest toolset. + * @member {google.cloud.ces.v1beta.IToolset|null|undefined} toolset + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @instance + */ + UpdateToolsetRequest.prototype.toolset = null; + + /** + * UpdateToolsetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @instance + */ + UpdateToolsetRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateToolsetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateToolsetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateToolsetRequest} UpdateToolsetRequest instance + */ + UpdateToolsetRequest.create = function create(properties) { + return new UpdateToolsetRequest(properties); + }; + + /** + * Encodes the specified UpdateToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolsetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateToolsetRequest} message UpdateToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateToolsetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + $root.google.cloud.ces.v1beta.Toolset.encode(message.toolset, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateToolsetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateToolsetRequest} message UpdateToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateToolsetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateToolsetRequest} UpdateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateToolsetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateToolsetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolset = $root.google.cloud.ces.v1beta.Toolset.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateToolsetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateToolsetRequest} UpdateToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateToolsetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateToolsetRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateToolsetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolset != null && message.hasOwnProperty("toolset")) { + var error = $root.google.cloud.ces.v1beta.Toolset.verify(message.toolset); + if (error) + return "toolset." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateToolsetRequest} UpdateToolsetRequest + */ + UpdateToolsetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateToolsetRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateToolsetRequest(); + if (object.toolset != null) { + if (typeof object.toolset !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateToolsetRequest.toolset: object expected"); + message.toolset = $root.google.cloud.ces.v1beta.Toolset.fromObject(object.toolset); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateToolsetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateToolsetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateToolsetRequest} message UpdateToolsetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateToolsetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.toolset = null; + object.updateMask = null; + } + if (message.toolset != null && message.hasOwnProperty("toolset")) + object.toolset = $root.google.cloud.ces.v1beta.Toolset.toObject(message.toolset, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateToolsetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateToolsetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateToolsetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateToolsetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateToolsetRequest"; + }; + + return UpdateToolsetRequest; + })(); + + v1beta.DeleteToolsetRequest = (function() { + + /** + * Properties of a DeleteToolsetRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteToolsetRequest + * @property {string|null} [name] DeleteToolsetRequest name + * @property {boolean|null} [force] DeleteToolsetRequest force + * @property {string|null} [etag] DeleteToolsetRequest etag + */ + + /** + * Constructs a new DeleteToolsetRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteToolsetRequest. + * @implements IDeleteToolsetRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteToolsetRequest=} [properties] Properties to set + */ + function DeleteToolsetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteToolsetRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @instance + */ + DeleteToolsetRequest.prototype.name = ""; + + /** + * DeleteToolsetRequest force. + * @member {boolean} force + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @instance + */ + DeleteToolsetRequest.prototype.force = false; + + /** + * DeleteToolsetRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @instance + */ + DeleteToolsetRequest.prototype.etag = ""; + + /** + * Creates a new DeleteToolsetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteToolsetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteToolsetRequest} DeleteToolsetRequest instance + */ + DeleteToolsetRequest.create = function create(properties) { + return new DeleteToolsetRequest(properties); + }; + + /** + * Encodes the specified DeleteToolsetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolsetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteToolsetRequest} message DeleteToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolsetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteToolsetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteToolsetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteToolsetRequest} message DeleteToolsetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteToolsetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteToolsetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteToolsetRequest} DeleteToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolsetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteToolsetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteToolsetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteToolsetRequest} DeleteToolsetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteToolsetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteToolsetRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteToolsetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteToolsetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteToolsetRequest} DeleteToolsetRequest + */ + DeleteToolsetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteToolsetRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteToolsetRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteToolsetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteToolsetRequest} message DeleteToolsetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteToolsetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteToolsetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteToolsetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteToolsetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteToolsetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteToolsetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteToolsetRequest"; + }; + + return DeleteToolsetRequest; + })(); + + v1beta.ListAppVersionsRequest = (function() { + + /** + * Properties of a ListAppVersionsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListAppVersionsRequest + * @property {string|null} [parent] ListAppVersionsRequest parent + * @property {number|null} [pageSize] ListAppVersionsRequest pageSize + * @property {string|null} [pageToken] ListAppVersionsRequest pageToken + * @property {string|null} [filter] ListAppVersionsRequest filter + * @property {string|null} [orderBy] ListAppVersionsRequest orderBy + */ + + /** + * Constructs a new ListAppVersionsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListAppVersionsRequest. + * @implements IListAppVersionsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListAppVersionsRequest=} [properties] Properties to set + */ + function ListAppVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAppVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @instance + */ + ListAppVersionsRequest.prototype.parent = ""; + + /** + * ListAppVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @instance + */ + ListAppVersionsRequest.prototype.pageSize = 0; + + /** + * ListAppVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @instance + */ + ListAppVersionsRequest.prototype.pageToken = ""; + + /** + * ListAppVersionsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @instance + */ + ListAppVersionsRequest.prototype.filter = ""; + + /** + * ListAppVersionsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @instance + */ + ListAppVersionsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListAppVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @static + * @param {google.cloud.ces.v1beta.IListAppVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListAppVersionsRequest} ListAppVersionsRequest instance + */ + ListAppVersionsRequest.create = function create(properties) { + return new ListAppVersionsRequest(properties); + }; + + /** + * Encodes the specified ListAppVersionsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @static + * @param {google.cloud.ces.v1beta.IListAppVersionsRequest} message ListAppVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppVersionsRequest.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 ListAppVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @static + * @param {google.cloud.ces.v1beta.IListAppVersionsRequest} message ListAppVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAppVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListAppVersionsRequest} ListAppVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppVersionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListAppVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAppVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListAppVersionsRequest} ListAppVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAppVersionsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAppVersionsRequest.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 ListAppVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListAppVersionsRequest} ListAppVersionsRequest + */ + ListAppVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListAppVersionsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListAppVersionsRequest(); + 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 ListAppVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @static + * @param {google.cloud.ces.v1beta.ListAppVersionsRequest} message ListAppVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAppVersionsRequest.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 ListAppVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAppVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAppVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListAppVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAppVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListAppVersionsRequest"; + }; + + return ListAppVersionsRequest; + })(); + + v1beta.ListAppVersionsResponse = (function() { + + /** + * Properties of a ListAppVersionsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListAppVersionsResponse + * @property {Array.|null} [appVersions] ListAppVersionsResponse appVersions + * @property {string|null} [nextPageToken] ListAppVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListAppVersionsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListAppVersionsResponse. + * @implements IListAppVersionsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListAppVersionsResponse=} [properties] Properties to set + */ + function ListAppVersionsResponse(properties) { + this.appVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAppVersionsResponse appVersions. + * @member {Array.} appVersions + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @instance + */ + ListAppVersionsResponse.prototype.appVersions = $util.emptyArray; + + /** + * ListAppVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @instance + */ + ListAppVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAppVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @static + * @param {google.cloud.ces.v1beta.IListAppVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListAppVersionsResponse} ListAppVersionsResponse instance + */ + ListAppVersionsResponse.create = function create(properties) { + return new ListAppVersionsResponse(properties); + }; + + /** + * Encodes the specified ListAppVersionsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @static + * @param {google.cloud.ces.v1beta.IListAppVersionsResponse} message ListAppVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appVersions != null && message.appVersions.length) + for (var i = 0; i < message.appVersions.length; ++i) + $root.google.cloud.ces.v1beta.AppVersion.encode(message.appVersions[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 ListAppVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListAppVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @static + * @param {google.cloud.ces.v1beta.IListAppVersionsResponse} message ListAppVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAppVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAppVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListAppVersionsResponse} ListAppVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppVersionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListAppVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.appVersions && message.appVersions.length)) + message.appVersions = []; + message.appVersions.push($root.google.cloud.ces.v1beta.AppVersion.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAppVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListAppVersionsResponse} ListAppVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAppVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAppVersionsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAppVersionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.appVersions != null && message.hasOwnProperty("appVersions")) { + if (!Array.isArray(message.appVersions)) + return "appVersions: array expected"; + for (var i = 0; i < message.appVersions.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AppVersion.verify(message.appVersions[i]); + if (error) + return "appVersions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAppVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListAppVersionsResponse} ListAppVersionsResponse + */ + ListAppVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListAppVersionsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListAppVersionsResponse(); + if (object.appVersions) { + if (!Array.isArray(object.appVersions)) + throw TypeError(".google.cloud.ces.v1beta.ListAppVersionsResponse.appVersions: array expected"); + message.appVersions = []; + for (var i = 0; i < object.appVersions.length; ++i) { + if (typeof object.appVersions[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListAppVersionsResponse.appVersions: object expected"); + message.appVersions[i] = $root.google.cloud.ces.v1beta.AppVersion.fromObject(object.appVersions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAppVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @static + * @param {google.cloud.ces.v1beta.ListAppVersionsResponse} message ListAppVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAppVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.appVersions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.appVersions && message.appVersions.length) { + object.appVersions = []; + for (var j = 0; j < message.appVersions.length; ++j) + object.appVersions[j] = $root.google.cloud.ces.v1beta.AppVersion.toObject(message.appVersions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAppVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAppVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAppVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListAppVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAppVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListAppVersionsResponse"; + }; + + return ListAppVersionsResponse; + })(); + + v1beta.GetAppVersionRequest = (function() { + + /** + * Properties of a GetAppVersionRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetAppVersionRequest + * @property {string|null} [name] GetAppVersionRequest name + */ + + /** + * Constructs a new GetAppVersionRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetAppVersionRequest. + * @implements IGetAppVersionRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetAppVersionRequest=} [properties] Properties to set + */ + function GetAppVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAppVersionRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @instance + */ + GetAppVersionRequest.prototype.name = ""; + + /** + * Creates a new GetAppVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.IGetAppVersionRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetAppVersionRequest} GetAppVersionRequest instance + */ + GetAppVersionRequest.create = function create(properties) { + return new GetAppVersionRequest(properties); + }; + + /** + * Encodes the specified GetAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetAppVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.IGetAppVersionRequest} message GetAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAppVersionRequest.encode = function encode(message, writer) { + 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 GetAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetAppVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.IGetAppVersionRequest} message GetAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAppVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetAppVersionRequest} GetAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAppVersionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetAppVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAppVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetAppVersionRequest} GetAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAppVersionRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAppVersionRequest.verify = function verify(message) { + if (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 GetAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetAppVersionRequest} GetAppVersionRequest + */ + GetAppVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetAppVersionRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetAppVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAppVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.GetAppVersionRequest} message GetAppVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAppVersionRequest.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 GetAppVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetAppVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAppVersionRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetAppVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetAppVersionRequest"; + }; + + return GetAppVersionRequest; + })(); + + v1beta.DeleteAppVersionRequest = (function() { + + /** + * Properties of a DeleteAppVersionRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteAppVersionRequest + * @property {string|null} [name] DeleteAppVersionRequest name + * @property {string|null} [etag] DeleteAppVersionRequest etag + */ + + /** + * Constructs a new DeleteAppVersionRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteAppVersionRequest. + * @implements IDeleteAppVersionRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteAppVersionRequest=} [properties] Properties to set + */ + function DeleteAppVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAppVersionRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @instance + */ + DeleteAppVersionRequest.prototype.name = ""; + + /** + * DeleteAppVersionRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @instance + */ + DeleteAppVersionRequest.prototype.etag = ""; + + /** + * Creates a new DeleteAppVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteAppVersionRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteAppVersionRequest} DeleteAppVersionRequest instance + */ + DeleteAppVersionRequest.create = function create(properties) { + return new DeleteAppVersionRequest(properties); + }; + + /** + * Encodes the specified DeleteAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteAppVersionRequest} message DeleteAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAppVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteAppVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteAppVersionRequest} message DeleteAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAppVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteAppVersionRequest} DeleteAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAppVersionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteAppVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAppVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteAppVersionRequest} DeleteAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAppVersionRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAppVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteAppVersionRequest} DeleteAppVersionRequest + */ + DeleteAppVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteAppVersionRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteAppVersionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteAppVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteAppVersionRequest} message DeleteAppVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAppVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteAppVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAppVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAppVersionRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteAppVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteAppVersionRequest"; + }; + + return DeleteAppVersionRequest; + })(); + + v1beta.CreateAppVersionRequest = (function() { + + /** + * Properties of a CreateAppVersionRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateAppVersionRequest + * @property {string|null} [parent] CreateAppVersionRequest parent + * @property {string|null} [appVersionId] CreateAppVersionRequest appVersionId + * @property {google.cloud.ces.v1beta.IAppVersion|null} [appVersion] CreateAppVersionRequest appVersion + */ + + /** + * Constructs a new CreateAppVersionRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateAppVersionRequest. + * @implements ICreateAppVersionRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateAppVersionRequest=} [properties] Properties to set + */ + function CreateAppVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAppVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @instance + */ + CreateAppVersionRequest.prototype.parent = ""; + + /** + * CreateAppVersionRequest appVersionId. + * @member {string} appVersionId + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @instance + */ + CreateAppVersionRequest.prototype.appVersionId = ""; + + /** + * CreateAppVersionRequest appVersion. + * @member {google.cloud.ces.v1beta.IAppVersion|null|undefined} appVersion + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @instance + */ + CreateAppVersionRequest.prototype.appVersion = null; + + /** + * Creates a new CreateAppVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateAppVersionRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateAppVersionRequest} CreateAppVersionRequest instance + */ + CreateAppVersionRequest.create = function create(properties) { + return new CreateAppVersionRequest(properties); + }; + + /** + * Encodes the specified CreateAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateAppVersionRequest} message CreateAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAppVersionRequest.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.appVersionId != null && Object.hasOwnProperty.call(message, "appVersionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appVersionId); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + $root.google.cloud.ces.v1beta.AppVersion.encode(message.appVersion, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateAppVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateAppVersionRequest} message CreateAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAppVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateAppVersionRequest} CreateAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAppVersionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateAppVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.appVersionId = reader.string(); + break; + } + case 3: { + message.appVersion = $root.google.cloud.ces.v1beta.AppVersion.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAppVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateAppVersionRequest} CreateAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAppVersionRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAppVersionRequest.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.appVersionId != null && message.hasOwnProperty("appVersionId")) + if (!$util.isString(message.appVersionId)) + return "appVersionId: string expected"; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) { + var error = $root.google.cloud.ces.v1beta.AppVersion.verify(message.appVersion); + if (error) + return "appVersion." + error; + } + return null; + }; + + /** + * Creates a CreateAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateAppVersionRequest} CreateAppVersionRequest + */ + CreateAppVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateAppVersionRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateAppVersionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.appVersionId != null) + message.appVersionId = String(object.appVersionId); + if (object.appVersion != null) { + if (typeof object.appVersion !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateAppVersionRequest.appVersion: object expected"); + message.appVersion = $root.google.cloud.ces.v1beta.AppVersion.fromObject(object.appVersion); + } + return message; + }; + + /** + * Creates a plain object from a CreateAppVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.CreateAppVersionRequest} message CreateAppVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAppVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.appVersionId = ""; + object.appVersion = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.appVersionId != null && message.hasOwnProperty("appVersionId")) + object.appVersionId = message.appVersionId; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + object.appVersion = $root.google.cloud.ces.v1beta.AppVersion.toObject(message.appVersion, options); + return object; + }; + + /** + * Converts this CreateAppVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAppVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAppVersionRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateAppVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateAppVersionRequest"; + }; + + return CreateAppVersionRequest; + })(); + + v1beta.RestoreAppVersionRequest = (function() { + + /** + * Properties of a RestoreAppVersionRequest. + * @memberof google.cloud.ces.v1beta + * @interface IRestoreAppVersionRequest + * @property {string|null} [name] RestoreAppVersionRequest name + */ + + /** + * Constructs a new RestoreAppVersionRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RestoreAppVersionRequest. + * @implements IRestoreAppVersionRequest + * @constructor + * @param {google.cloud.ces.v1beta.IRestoreAppVersionRequest=} [properties] Properties to set + */ + function RestoreAppVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreAppVersionRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @instance + */ + RestoreAppVersionRequest.prototype.name = ""; + + /** + * Creates a new RestoreAppVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.IRestoreAppVersionRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RestoreAppVersionRequest} RestoreAppVersionRequest instance + */ + RestoreAppVersionRequest.create = function create(properties) { + return new RestoreAppVersionRequest(properties); + }; + + /** + * Encodes the specified RestoreAppVersionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.IRestoreAppVersionRequest} message RestoreAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreAppVersionRequest.encode = function encode(message, writer) { + 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 RestoreAppVersionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.IRestoreAppVersionRequest} message RestoreAppVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreAppVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreAppVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RestoreAppVersionRequest} RestoreAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreAppVersionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RestoreAppVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreAppVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RestoreAppVersionRequest} RestoreAppVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreAppVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreAppVersionRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreAppVersionRequest.verify = function verify(message) { + if (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 RestoreAppVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RestoreAppVersionRequest} RestoreAppVersionRequest + */ + RestoreAppVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RestoreAppVersionRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.RestoreAppVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RestoreAppVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @static + * @param {google.cloud.ces.v1beta.RestoreAppVersionRequest} message RestoreAppVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreAppVersionRequest.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 RestoreAppVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreAppVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreAppVersionRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RestoreAppVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreAppVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RestoreAppVersionRequest"; + }; + + return RestoreAppVersionRequest; + })(); + + v1beta.RestoreAppVersionResponse = (function() { + + /** + * Properties of a RestoreAppVersionResponse. + * @memberof google.cloud.ces.v1beta + * @interface IRestoreAppVersionResponse + */ + + /** + * Constructs a new RestoreAppVersionResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RestoreAppVersionResponse. + * @implements IRestoreAppVersionResponse + * @constructor + * @param {google.cloud.ces.v1beta.IRestoreAppVersionResponse=} [properties] Properties to set + */ + function RestoreAppVersionResponse(properties) { + if (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 RestoreAppVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @static + * @param {google.cloud.ces.v1beta.IRestoreAppVersionResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RestoreAppVersionResponse} RestoreAppVersionResponse instance + */ + RestoreAppVersionResponse.create = function create(properties) { + return new RestoreAppVersionResponse(properties); + }; + + /** + * Encodes the specified RestoreAppVersionResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @static + * @param {google.cloud.ces.v1beta.IRestoreAppVersionResponse} message RestoreAppVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreAppVersionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RestoreAppVersionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RestoreAppVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @static + * @param {google.cloud.ces.v1beta.IRestoreAppVersionResponse} message RestoreAppVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreAppVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreAppVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RestoreAppVersionResponse} RestoreAppVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreAppVersionResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RestoreAppVersionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreAppVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RestoreAppVersionResponse} RestoreAppVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreAppVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreAppVersionResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreAppVersionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RestoreAppVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RestoreAppVersionResponse} RestoreAppVersionResponse + */ + RestoreAppVersionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RestoreAppVersionResponse) + return object; + return new $root.google.cloud.ces.v1beta.RestoreAppVersionResponse(); + }; + + /** + * Creates a plain object from a RestoreAppVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @static + * @param {google.cloud.ces.v1beta.RestoreAppVersionResponse} message RestoreAppVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreAppVersionResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RestoreAppVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @instance + * @returns {Object.} JSON object + */ + RestoreAppVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreAppVersionResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RestoreAppVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreAppVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RestoreAppVersionResponse"; + }; + + return RestoreAppVersionResponse; + })(); + + v1beta.GenerateAppResourceResponse = (function() { + + /** + * Properties of a GenerateAppResourceResponse. + * @memberof google.cloud.ces.v1beta + * @interface IGenerateAppResourceResponse + * @property {google.cloud.ces.v1beta.IAgent|null} [agent] GenerateAppResourceResponse agent + * @property {google.cloud.ces.v1beta.IToolset|null} [toolset] GenerateAppResourceResponse toolset + * @property {google.cloud.ces.v1beta.IAppSnapshot|null} [appSnapshot] GenerateAppResourceResponse appSnapshot + * @property {google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools|null} [tools] GenerateAppResourceResponse tools + * @property {google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations|null} [evaluations] GenerateAppResourceResponse evaluations + * @property {google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources|null} [appResources] GenerateAppResourceResponse appResources + * @property {google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo|null} [generateResultInfo] GenerateAppResourceResponse generateResultInfo + */ + + /** + * Constructs a new GenerateAppResourceResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GenerateAppResourceResponse. + * @implements IGenerateAppResourceResponse + * @constructor + * @param {google.cloud.ces.v1beta.IGenerateAppResourceResponse=} [properties] Properties to set + */ + function GenerateAppResourceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateAppResourceResponse agent. + * @member {google.cloud.ces.v1beta.IAgent|null|undefined} agent + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @instance + */ + GenerateAppResourceResponse.prototype.agent = null; + + /** + * GenerateAppResourceResponse toolset. + * @member {google.cloud.ces.v1beta.IToolset|null|undefined} toolset + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @instance + */ + GenerateAppResourceResponse.prototype.toolset = null; + + /** + * GenerateAppResourceResponse appSnapshot. + * @member {google.cloud.ces.v1beta.IAppSnapshot|null|undefined} appSnapshot + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @instance + */ + GenerateAppResourceResponse.prototype.appSnapshot = null; + + /** + * GenerateAppResourceResponse tools. + * @member {google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools|null|undefined} tools + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @instance + */ + GenerateAppResourceResponse.prototype.tools = null; + + /** + * GenerateAppResourceResponse evaluations. + * @member {google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations|null|undefined} evaluations + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @instance + */ + GenerateAppResourceResponse.prototype.evaluations = null; + + /** + * GenerateAppResourceResponse appResources. + * @member {google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources|null|undefined} appResources + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @instance + */ + GenerateAppResourceResponse.prototype.appResources = null; + + /** + * GenerateAppResourceResponse generateResultInfo. + * @member {google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo|null|undefined} generateResultInfo + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @instance + */ + GenerateAppResourceResponse.prototype.generateResultInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GenerateAppResourceResponse generatedResource. + * @member {"agent"|"toolset"|"appSnapshot"|"tools"|"evaluations"|"appResources"|undefined} generatedResource + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @instance + */ + Object.defineProperty(GenerateAppResourceResponse.prototype, "generatedResource", { + get: $util.oneOfGetter($oneOfFields = ["agent", "toolset", "appSnapshot", "tools", "evaluations", "appResources"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenerateAppResourceResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @static + * @param {google.cloud.ces.v1beta.IGenerateAppResourceResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse} GenerateAppResourceResponse instance + */ + GenerateAppResourceResponse.create = function create(properties) { + return new GenerateAppResourceResponse(properties); + }; + + /** + * Encodes the specified GenerateAppResourceResponse message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @static + * @param {google.cloud.ces.v1beta.IGenerateAppResourceResponse} message GenerateAppResourceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAppResourceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + $root.google.cloud.ces.v1beta.Agent.encode(message.agent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.generateResultInfo != null && Object.hasOwnProperty.call(message, "generateResultInfo")) + $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.encode(message.generateResultInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + $root.google.cloud.ces.v1beta.Toolset.encode(message.toolset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.appSnapshot != null && Object.hasOwnProperty.call(message, "appSnapshot")) + $root.google.cloud.ces.v1beta.AppSnapshot.encode(message.appSnapshot, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.tools != null && Object.hasOwnProperty.call(message, "tools")) + $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.encode(message.tools, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.evaluations != null && Object.hasOwnProperty.call(message, "evaluations")) + $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.encode(message.evaluations, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.appResources != null && Object.hasOwnProperty.call(message, "appResources")) + $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.encode(message.appResources, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateAppResourceResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @static + * @param {google.cloud.ces.v1beta.IGenerateAppResourceResponse} message GenerateAppResourceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAppResourceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateAppResourceResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse} GenerateAppResourceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAppResourceResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.agent = $root.google.cloud.ces.v1beta.Agent.decode(reader, reader.uint32()); + break; + } + case 3: { + message.toolset = $root.google.cloud.ces.v1beta.Toolset.decode(reader, reader.uint32()); + break; + } + case 4: { + message.appSnapshot = $root.google.cloud.ces.v1beta.AppSnapshot.decode(reader, reader.uint32()); + break; + } + case 5: { + message.tools = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.decode(reader, reader.uint32()); + break; + } + case 6: { + message.evaluations = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.decode(reader, reader.uint32()); + break; + } + case 7: { + message.appResources = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.decode(reader, reader.uint32()); + break; + } + case 2: { + message.generateResultInfo = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateAppResourceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse} GenerateAppResourceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAppResourceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateAppResourceResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateAppResourceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.agent != null && message.hasOwnProperty("agent")) { + properties.generatedResource = 1; + { + var error = $root.google.cloud.ces.v1beta.Agent.verify(message.agent); + if (error) + return "agent." + error; + } + } + if (message.toolset != null && message.hasOwnProperty("toolset")) { + if (properties.generatedResource === 1) + return "generatedResource: multiple values"; + properties.generatedResource = 1; + { + var error = $root.google.cloud.ces.v1beta.Toolset.verify(message.toolset); + if (error) + return "toolset." + error; + } + } + if (message.appSnapshot != null && message.hasOwnProperty("appSnapshot")) { + if (properties.generatedResource === 1) + return "generatedResource: multiple values"; + properties.generatedResource = 1; + { + var error = $root.google.cloud.ces.v1beta.AppSnapshot.verify(message.appSnapshot); + if (error) + return "appSnapshot." + error; + } + } + if (message.tools != null && message.hasOwnProperty("tools")) { + if (properties.generatedResource === 1) + return "generatedResource: multiple values"; + properties.generatedResource = 1; + { + var error = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.verify(message.tools); + if (error) + return "tools." + error; + } + } + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (properties.generatedResource === 1) + return "generatedResource: multiple values"; + properties.generatedResource = 1; + { + var error = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.verify(message.evaluations); + if (error) + return "evaluations." + error; + } + } + if (message.appResources != null && message.hasOwnProperty("appResources")) { + if (properties.generatedResource === 1) + return "generatedResource: multiple values"; + properties.generatedResource = 1; + { + var error = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.verify(message.appResources); + if (error) + return "appResources." + error; + } + } + if (message.generateResultInfo != null && message.hasOwnProperty("generateResultInfo")) { + var error = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.verify(message.generateResultInfo); + if (error) + return "generateResultInfo." + error; + } + return null; + }; + + /** + * Creates a GenerateAppResourceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse} GenerateAppResourceResponse + */ + GenerateAppResourceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse(); + if (object.agent != null) { + if (typeof object.agent !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.agent: object expected"); + message.agent = $root.google.cloud.ces.v1beta.Agent.fromObject(object.agent); + } + if (object.toolset != null) { + if (typeof object.toolset !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.toolset: object expected"); + message.toolset = $root.google.cloud.ces.v1beta.Toolset.fromObject(object.toolset); + } + if (object.appSnapshot != null) { + if (typeof object.appSnapshot !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.appSnapshot: object expected"); + message.appSnapshot = $root.google.cloud.ces.v1beta.AppSnapshot.fromObject(object.appSnapshot); + } + if (object.tools != null) { + if (typeof object.tools !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.tools: object expected"); + message.tools = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.fromObject(object.tools); + } + if (object.evaluations != null) { + if (typeof object.evaluations !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.evaluations: object expected"); + message.evaluations = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.fromObject(object.evaluations); + } + if (object.appResources != null) { + if (typeof object.appResources !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.appResources: object expected"); + message.appResources = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.fromObject(object.appResources); + } + if (object.generateResultInfo != null) { + if (typeof object.generateResultInfo !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.generateResultInfo: object expected"); + message.generateResultInfo = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.fromObject(object.generateResultInfo); + } + return message; + }; + + /** + * Creates a plain object from a GenerateAppResourceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse} message GenerateAppResourceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateAppResourceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.generateResultInfo = null; + if (message.agent != null && message.hasOwnProperty("agent")) { + object.agent = $root.google.cloud.ces.v1beta.Agent.toObject(message.agent, options); + if (options.oneofs) + object.generatedResource = "agent"; + } + if (message.generateResultInfo != null && message.hasOwnProperty("generateResultInfo")) + object.generateResultInfo = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.toObject(message.generateResultInfo, options); + if (message.toolset != null && message.hasOwnProperty("toolset")) { + object.toolset = $root.google.cloud.ces.v1beta.Toolset.toObject(message.toolset, options); + if (options.oneofs) + object.generatedResource = "toolset"; + } + if (message.appSnapshot != null && message.hasOwnProperty("appSnapshot")) { + object.appSnapshot = $root.google.cloud.ces.v1beta.AppSnapshot.toObject(message.appSnapshot, options); + if (options.oneofs) + object.generatedResource = "appSnapshot"; + } + if (message.tools != null && message.hasOwnProperty("tools")) { + object.tools = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.toObject(message.tools, options); + if (options.oneofs) + object.generatedResource = "tools"; + } + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + object.evaluations = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.toObject(message.evaluations, options); + if (options.oneofs) + object.generatedResource = "evaluations"; + } + if (message.appResources != null && message.hasOwnProperty("appResources")) { + object.appResources = $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.toObject(message.appResources, options); + if (options.oneofs) + object.generatedResource = "appResources"; + } + return object; + }; + + /** + * Converts this GenerateAppResourceResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateAppResourceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateAppResourceResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateAppResourceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceResponse"; + }; + + GenerateAppResourceResponse.Evaluations = (function() { + + /** + * Properties of an Evaluations. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @interface IEvaluations + * @property {Array.|null} [evaluations] Evaluations evaluations + */ + + /** + * Constructs a new Evaluations. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @classdesc Represents an Evaluations. + * @implements IEvaluations + * @constructor + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations=} [properties] Properties to set + */ + function Evaluations(properties) { + this.evaluations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Evaluations evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @instance + */ + Evaluations.prototype.evaluations = $util.emptyArray; + + /** + * Creates a new Evaluations instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations} Evaluations instance + */ + Evaluations.create = function create(properties) { + return new Evaluations(properties); + }; + + /** + * Encodes the specified Evaluations message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations} message Evaluations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evaluations.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + $root.google.cloud.ces.v1beta.Evaluation.encode(message.evaluations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Evaluations message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IEvaluations} message Evaluations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evaluations.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Evaluations message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations} Evaluations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evaluations.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push($root.google.cloud.ces.v1beta.Evaluation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Evaluations message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations} Evaluations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evaluations.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Evaluations message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Evaluations.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Evaluation.verify(message.evaluations[i]); + if (error) + return "evaluations." + error; + } + } + return null; + }; + + /** + * Creates an Evaluations message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations} Evaluations + */ + Evaluations.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations(); + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) { + if (typeof object.evaluations[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations.evaluations: object expected"); + message.evaluations[i] = $root.google.cloud.ces.v1beta.Evaluation.fromObject(object.evaluations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Evaluations message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations} message Evaluations + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Evaluations.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluations = []; + if (message.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = $root.google.cloud.ces.v1beta.Evaluation.toObject(message.evaluations[j], options); + } + return object; + }; + + /** + * Converts this Evaluations to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @instance + * @returns {Object.} JSON object + */ + Evaluations.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Evaluations + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Evaluations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceResponse.Evaluations"; + }; + + return Evaluations; + })(); + + GenerateAppResourceResponse.Tools = (function() { + + /** + * Properties of a Tools. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @interface ITools + * @property {Array.|null} [tools] Tools tools + */ + + /** + * Constructs a new Tools. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @classdesc Represents a Tools. + * @implements ITools + * @constructor + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools=} [properties] Properties to set + */ + function Tools(properties) { + this.tools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tools tools. + * @member {Array.} tools + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @instance + */ + Tools.prototype.tools = $util.emptyArray; + + /** + * Creates a new Tools instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools} Tools instance + */ + Tools.create = function create(properties) { + return new Tools(properties); + }; + + /** + * Encodes the specified Tools message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools} message Tools message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tools.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + $root.google.cloud.ces.v1beta.Tool.encode(message.tools[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Tools message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.ITools} message Tools message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tools.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tools message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools} Tools + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tools.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push($root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tools message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools} Tools + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tools.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tools message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tools.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tools != null && message.hasOwnProperty("tools")) { + if (!Array.isArray(message.tools)) + return "tools: array expected"; + for (var i = 0; i < message.tools.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tools[i]); + if (error) + return "tools." + error; + } + } + return null; + }; + + /** + * Creates a Tools message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools} Tools + */ + Tools.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools(); + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) { + if (typeof object.tools[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools.tools: object expected"); + message.tools[i] = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tools[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Tools message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools} message Tools + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tools.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tools = []; + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = $root.google.cloud.ces.v1beta.Tool.toObject(message.tools[j], options); + } + return object; + }; + + /** + * Converts this Tools to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @instance + * @returns {Object.} JSON object + */ + Tools.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Tools + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Tools.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceResponse.Tools"; + }; + + return Tools; + })(); + + GenerateAppResourceResponse.AppResources = (function() { + + /** + * Properties of an AppResources. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @interface IAppResources + * @property {google.cloud.ces.v1beta.IAppSnapshot|null} [appSnapshot] AppResources appSnapshot + * @property {Array.|null} [evaluations] AppResources evaluations + */ + + /** + * Constructs a new AppResources. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @classdesc Represents an AppResources. + * @implements IAppResources + * @constructor + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources=} [properties] Properties to set + */ + function AppResources(properties) { + this.evaluations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppResources appSnapshot. + * @member {google.cloud.ces.v1beta.IAppSnapshot|null|undefined} appSnapshot + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @instance + */ + AppResources.prototype.appSnapshot = null; + + /** + * AppResources evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @instance + */ + AppResources.prototype.evaluations = $util.emptyArray; + + /** + * Creates a new AppResources instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources} AppResources instance + */ + AppResources.create = function create(properties) { + return new AppResources(properties); + }; + + /** + * Encodes the specified AppResources message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources} message AppResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appSnapshot != null && Object.hasOwnProperty.call(message, "appSnapshot")) + $root.google.cloud.ces.v1beta.AppSnapshot.encode(message.appSnapshot, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + $root.google.cloud.ces.v1beta.Evaluation.encode(message.evaluations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AppResources message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IAppResources} message AppResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppResources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources} AppResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppResources.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.appSnapshot = $root.google.cloud.ces.v1beta.AppSnapshot.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push($root.google.cloud.ces.v1beta.Evaluation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AppResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources} AppResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppResources message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppResources.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.appSnapshot != null && message.hasOwnProperty("appSnapshot")) { + var error = $root.google.cloud.ces.v1beta.AppSnapshot.verify(message.appSnapshot); + if (error) + return "appSnapshot." + error; + } + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Evaluation.verify(message.evaluations[i]); + if (error) + return "evaluations." + error; + } + } + return null; + }; + + /** + * Creates an AppResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources} AppResources + */ + AppResources.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources(); + if (object.appSnapshot != null) { + if (typeof object.appSnapshot !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.appSnapshot: object expected"); + message.appSnapshot = $root.google.cloud.ces.v1beta.AppSnapshot.fromObject(object.appSnapshot); + } + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) { + if (typeof object.evaluations[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources.evaluations: object expected"); + message.evaluations[i] = $root.google.cloud.ces.v1beta.Evaluation.fromObject(object.evaluations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AppResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources} message AppResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppResources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluations = []; + if (options.defaults) + object.appSnapshot = null; + if (message.appSnapshot != null && message.hasOwnProperty("appSnapshot")) + object.appSnapshot = $root.google.cloud.ces.v1beta.AppSnapshot.toObject(message.appSnapshot, options); + if (message.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = $root.google.cloud.ces.v1beta.Evaluation.toObject(message.evaluations[j], options); + } + return object; + }; + + /** + * Converts this AppResources to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @instance + * @returns {Object.} JSON object + */ + AppResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AppResources + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceResponse.AppResources"; + }; + + return AppResources; + })(); + + GenerateAppResourceResponse.GenerateResultInfo = (function() { + + /** + * Properties of a GenerateResultInfo. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @interface IGenerateResultInfo + * @property {string|null} [explanation] GenerateResultInfo explanation + */ + + /** + * Constructs a new GenerateResultInfo. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse + * @classdesc Represents a GenerateResultInfo. + * @implements IGenerateResultInfo + * @constructor + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo=} [properties] Properties to set + */ + function GenerateResultInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateResultInfo explanation. + * @member {string} explanation + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @instance + */ + GenerateResultInfo.prototype.explanation = ""; + + /** + * Creates a new GenerateResultInfo instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo} GenerateResultInfo instance + */ + GenerateResultInfo.create = function create(properties) { + return new GenerateResultInfo(properties); + }; + + /** + * Encodes the specified GenerateResultInfo message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo} message GenerateResultInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateResultInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.explanation); + return writer; + }; + + /** + * Encodes the specified GenerateResultInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.IGenerateResultInfo} message GenerateResultInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateResultInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateResultInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo} GenerateResultInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateResultInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.explanation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateResultInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo} GenerateResultInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateResultInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateResultInfo message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateResultInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.explanation != null && message.hasOwnProperty("explanation")) + if (!$util.isString(message.explanation)) + return "explanation: string expected"; + return null; + }; + + /** + * Creates a GenerateResultInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo} GenerateResultInfo + */ + GenerateResultInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo(); + if (object.explanation != null) + message.explanation = String(object.explanation); + return message; + }; + + /** + * Creates a plain object from a GenerateResultInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo} message GenerateResultInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateResultInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.explanation = ""; + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = message.explanation; + return object; + }; + + /** + * Converts this GenerateResultInfo to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @instance + * @returns {Object.} JSON object + */ + GenerateResultInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateResultInfo + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateResultInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceResponse.GenerateResultInfo"; + }; + + return GenerateResultInfo; + })(); + + return GenerateAppResourceResponse; + })(); + + v1beta.ListChangelogsRequest = (function() { + + /** + * Properties of a ListChangelogsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListChangelogsRequest + * @property {string|null} [parent] ListChangelogsRequest parent + * @property {number|null} [pageSize] ListChangelogsRequest pageSize + * @property {string|null} [pageToken] ListChangelogsRequest pageToken + * @property {string|null} [filter] ListChangelogsRequest filter + * @property {string|null} [orderBy] ListChangelogsRequest orderBy + */ + + /** + * Constructs a new ListChangelogsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListChangelogsRequest. + * @implements IListChangelogsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListChangelogsRequest=} [properties] Properties to set + */ + function ListChangelogsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChangelogsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.parent = ""; + + /** + * ListChangelogsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.pageSize = 0; + + /** + * ListChangelogsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.pageToken = ""; + + /** + * ListChangelogsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.filter = ""; + + /** + * ListChangelogsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @instance + */ + ListChangelogsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListChangelogsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @static + * @param {google.cloud.ces.v1beta.IListChangelogsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListChangelogsRequest} ListChangelogsRequest instance + */ + ListChangelogsRequest.create = function create(properties) { + return new ListChangelogsRequest(properties); + }; + + /** + * Encodes the specified ListChangelogsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @static + * @param {google.cloud.ces.v1beta.IListChangelogsRequest} message ListChangelogsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsRequest.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 ListChangelogsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @static + * @param {google.cloud.ces.v1beta.IListChangelogsRequest} message ListChangelogsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListChangelogsRequest} ListChangelogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListChangelogsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListChangelogsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListChangelogsRequest} ListChangelogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChangelogsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChangelogsRequest.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 ListChangelogsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListChangelogsRequest} ListChangelogsRequest + */ + ListChangelogsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListChangelogsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListChangelogsRequest(); + 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 ListChangelogsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @static + * @param {google.cloud.ces.v1beta.ListChangelogsRequest} message ListChangelogsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChangelogsRequest.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 ListChangelogsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @instance + * @returns {Object.} JSON object + */ + ListChangelogsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChangelogsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListChangelogsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChangelogsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListChangelogsRequest"; + }; + + return ListChangelogsRequest; + })(); + + v1beta.ListChangelogsResponse = (function() { + + /** + * Properties of a ListChangelogsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListChangelogsResponse + * @property {Array.|null} [changelogs] ListChangelogsResponse changelogs + * @property {string|null} [nextPageToken] ListChangelogsResponse nextPageToken + */ + + /** + * Constructs a new ListChangelogsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListChangelogsResponse. + * @implements IListChangelogsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListChangelogsResponse=} [properties] Properties to set + */ + function ListChangelogsResponse(properties) { + this.changelogs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChangelogsResponse changelogs. + * @member {Array.} changelogs + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @instance + */ + ListChangelogsResponse.prototype.changelogs = $util.emptyArray; + + /** + * ListChangelogsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @instance + */ + ListChangelogsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListChangelogsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @static + * @param {google.cloud.ces.v1beta.IListChangelogsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListChangelogsResponse} ListChangelogsResponse instance + */ + ListChangelogsResponse.create = function create(properties) { + return new ListChangelogsResponse(properties); + }; + + /** + * Encodes the specified ListChangelogsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @static + * @param {google.cloud.ces.v1beta.IListChangelogsResponse} message ListChangelogsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.changelogs != null && message.changelogs.length) + for (var i = 0; i < message.changelogs.length; ++i) + $root.google.cloud.ces.v1beta.Changelog.encode(message.changelogs[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 ListChangelogsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListChangelogsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @static + * @param {google.cloud.ces.v1beta.IListChangelogsResponse} message ListChangelogsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChangelogsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListChangelogsResponse} ListChangelogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListChangelogsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.changelogs && message.changelogs.length)) + message.changelogs = []; + message.changelogs.push($root.google.cloud.ces.v1beta.Changelog.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListChangelogsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListChangelogsResponse} ListChangelogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChangelogsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChangelogsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChangelogsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.changelogs != null && message.hasOwnProperty("changelogs")) { + if (!Array.isArray(message.changelogs)) + return "changelogs: array expected"; + for (var i = 0; i < message.changelogs.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Changelog.verify(message.changelogs[i]); + if (error) + return "changelogs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListChangelogsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListChangelogsResponse} ListChangelogsResponse + */ + ListChangelogsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListChangelogsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListChangelogsResponse(); + if (object.changelogs) { + if (!Array.isArray(object.changelogs)) + throw TypeError(".google.cloud.ces.v1beta.ListChangelogsResponse.changelogs: array expected"); + message.changelogs = []; + for (var i = 0; i < object.changelogs.length; ++i) { + if (typeof object.changelogs[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListChangelogsResponse.changelogs: object expected"); + message.changelogs[i] = $root.google.cloud.ces.v1beta.Changelog.fromObject(object.changelogs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListChangelogsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @static + * @param {google.cloud.ces.v1beta.ListChangelogsResponse} message ListChangelogsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChangelogsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.changelogs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.changelogs && message.changelogs.length) { + object.changelogs = []; + for (var j = 0; j < message.changelogs.length; ++j) + object.changelogs[j] = $root.google.cloud.ces.v1beta.Changelog.toObject(message.changelogs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListChangelogsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @instance + * @returns {Object.} JSON object + */ + ListChangelogsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChangelogsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListChangelogsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChangelogsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListChangelogsResponse"; + }; + + return ListChangelogsResponse; + })(); + + v1beta.GetChangelogRequest = (function() { + + /** + * Properties of a GetChangelogRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetChangelogRequest + * @property {string|null} [name] GetChangelogRequest name + */ + + /** + * Constructs a new GetChangelogRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetChangelogRequest. + * @implements IGetChangelogRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetChangelogRequest=} [properties] Properties to set + */ + function GetChangelogRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetChangelogRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @instance + */ + GetChangelogRequest.prototype.name = ""; + + /** + * Creates a new GetChangelogRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @static + * @param {google.cloud.ces.v1beta.IGetChangelogRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetChangelogRequest} GetChangelogRequest instance + */ + GetChangelogRequest.create = function create(properties) { + return new GetChangelogRequest(properties); + }; + + /** + * Encodes the specified GetChangelogRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetChangelogRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @static + * @param {google.cloud.ces.v1beta.IGetChangelogRequest} message GetChangelogRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetChangelogRequest.encode = function encode(message, writer) { + 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 GetChangelogRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetChangelogRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @static + * @param {google.cloud.ces.v1beta.IGetChangelogRequest} message GetChangelogRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetChangelogRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetChangelogRequest} GetChangelogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetChangelogRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetChangelogRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetChangelogRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetChangelogRequest} GetChangelogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetChangelogRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetChangelogRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetChangelogRequest.verify = function verify(message) { + if (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 GetChangelogRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetChangelogRequest} GetChangelogRequest + */ + GetChangelogRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetChangelogRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetChangelogRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetChangelogRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @static + * @param {google.cloud.ces.v1beta.GetChangelogRequest} message GetChangelogRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetChangelogRequest.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 GetChangelogRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @instance + * @returns {Object.} JSON object + */ + GetChangelogRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetChangelogRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetChangelogRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetChangelogRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetChangelogRequest"; + }; + + return GetChangelogRequest; + })(); + + v1beta.App = (function() { + + /** + * Properties of an App. + * @memberof google.cloud.ces.v1beta + * @interface IApp + * @property {string|null} [name] App name + * @property {string|null} [displayName] App displayName + * @property {string|null} [description] App description + * @property {boolean|null} [pinned] App pinned + * @property {string|null} [rootAgent] App rootAgent + * @property {google.cloud.ces.v1beta.ILanguageSettings|null} [languageSettings] App languageSettings + * @property {google.cloud.ces.v1beta.ITimeZoneSettings|null} [timeZoneSettings] App timeZoneSettings + * @property {google.cloud.ces.v1beta.IAudioProcessingConfig|null} [audioProcessingConfig] App audioProcessingConfig + * @property {google.cloud.ces.v1beta.ILoggingSettings|null} [loggingSettings] App loggingSettings + * @property {google.cloud.ces.v1beta.IErrorHandlingSettings|null} [errorHandlingSettings] App errorHandlingSettings + * @property {google.cloud.ces.v1beta.IModelSettings|null} [modelSettings] App modelSettings + * @property {google.cloud.ces.v1beta.App.ToolExecutionMode|null} [toolExecutionMode] App toolExecutionMode + * @property {google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null} [evaluationMetricsThresholds] App evaluationMetricsThresholds + * @property {Array.|null} [variableDeclarations] App variableDeclarations + * @property {Array.|null} [predefinedVariableDeclarations] App predefinedVariableDeclarations + * @property {string|null} [globalInstruction] App globalInstruction + * @property {Array.|null} [guardrails] App guardrails + * @property {google.cloud.ces.v1beta.IDataStoreSettings|null} [dataStoreSettings] App dataStoreSettings + * @property {google.cloud.ces.v1beta.IChannelProfile|null} [defaultChannelProfile] App defaultChannelProfile + * @property {Object.|null} [metadata] App metadata + * @property {google.protobuf.ITimestamp|null} [createTime] App createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] App updateTime + * @property {string|null} [etag] App etag + * @property {number|null} [deploymentCount] App deploymentCount + * @property {google.cloud.ces.v1beta.IClientCertificateSettings|null} [clientCertificateSettings] App clientCertificateSettings + * @property {boolean|null} [locked] App locked + * @property {Array.|null} [evaluationPersonas] App evaluationPersonas + * @property {google.cloud.ces.v1beta.IEvaluationSettings|null} [evaluationSettings] App evaluationSettings + */ + + /** + * Constructs a new App. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an App. + * @implements IApp + * @constructor + * @param {google.cloud.ces.v1beta.IApp=} [properties] Properties to set + */ + function App(properties) { + this.variableDeclarations = []; + this.predefinedVariableDeclarations = []; + this.guardrails = []; + this.metadata = {}; + this.evaluationPersonas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * App name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.name = ""; + + /** + * App displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.displayName = ""; + + /** + * App description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.description = ""; + + /** + * App pinned. + * @member {boolean} pinned + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.pinned = false; + + /** + * App rootAgent. + * @member {string} rootAgent + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.rootAgent = ""; + + /** + * App languageSettings. + * @member {google.cloud.ces.v1beta.ILanguageSettings|null|undefined} languageSettings + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.languageSettings = null; + + /** + * App timeZoneSettings. + * @member {google.cloud.ces.v1beta.ITimeZoneSettings|null|undefined} timeZoneSettings + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.timeZoneSettings = null; + + /** + * App audioProcessingConfig. + * @member {google.cloud.ces.v1beta.IAudioProcessingConfig|null|undefined} audioProcessingConfig + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.audioProcessingConfig = null; + + /** + * App loggingSettings. + * @member {google.cloud.ces.v1beta.ILoggingSettings|null|undefined} loggingSettings + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.loggingSettings = null; + + /** + * App errorHandlingSettings. + * @member {google.cloud.ces.v1beta.IErrorHandlingSettings|null|undefined} errorHandlingSettings + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.errorHandlingSettings = null; + + /** + * App modelSettings. + * @member {google.cloud.ces.v1beta.IModelSettings|null|undefined} modelSettings + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.modelSettings = null; + + /** + * App toolExecutionMode. + * @member {google.cloud.ces.v1beta.App.ToolExecutionMode} toolExecutionMode + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.toolExecutionMode = 0; + + /** + * App evaluationMetricsThresholds. + * @member {google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null|undefined} evaluationMetricsThresholds + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.evaluationMetricsThresholds = null; + + /** + * App variableDeclarations. + * @member {Array.} variableDeclarations + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.variableDeclarations = $util.emptyArray; + + /** + * App predefinedVariableDeclarations. + * @member {Array.} predefinedVariableDeclarations + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.predefinedVariableDeclarations = $util.emptyArray; + + /** + * App globalInstruction. + * @member {string} globalInstruction + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.globalInstruction = ""; + + /** + * App guardrails. + * @member {Array.} guardrails + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.guardrails = $util.emptyArray; + + /** + * App dataStoreSettings. + * @member {google.cloud.ces.v1beta.IDataStoreSettings|null|undefined} dataStoreSettings + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.dataStoreSettings = null; + + /** + * App defaultChannelProfile. + * @member {google.cloud.ces.v1beta.IChannelProfile|null|undefined} defaultChannelProfile + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.defaultChannelProfile = null; + + /** + * App metadata. + * @member {Object.} metadata + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.metadata = $util.emptyObject; + + /** + * App createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.createTime = null; + + /** + * App updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.updateTime = null; + + /** + * App etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.etag = ""; + + /** + * App deploymentCount. + * @member {number} deploymentCount + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.deploymentCount = 0; + + /** + * App clientCertificateSettings. + * @member {google.cloud.ces.v1beta.IClientCertificateSettings|null|undefined} clientCertificateSettings + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.clientCertificateSettings = null; + + /** + * App locked. + * @member {boolean} locked + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.locked = false; + + /** + * App evaluationPersonas. + * @member {Array.} evaluationPersonas + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.evaluationPersonas = $util.emptyArray; + + /** + * App evaluationSettings. + * @member {google.cloud.ces.v1beta.IEvaluationSettings|null|undefined} evaluationSettings + * @memberof google.cloud.ces.v1beta.App + * @instance + */ + App.prototype.evaluationSettings = null; + + /** + * Creates a new App instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.App + * @static + * @param {google.cloud.ces.v1beta.IApp=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.App} App instance + */ + App.create = function create(properties) { + return new App(properties); + }; + + /** + * Encodes the specified App message. Does not implicitly {@link google.cloud.ces.v1beta.App.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.App + * @static + * @param {google.cloud.ces.v1beta.IApp} message App message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + App.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.rootAgent != null && Object.hasOwnProperty.call(message, "rootAgent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.rootAgent); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.audioProcessingConfig != null && Object.hasOwnProperty.call(message, "audioProcessingConfig")) + $root.google.cloud.ces.v1beta.AudioProcessingConfig.encode(message.audioProcessingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.loggingSettings != null && Object.hasOwnProperty.call(message, "loggingSettings")) + $root.google.cloud.ces.v1beta.LoggingSettings.encode(message.loggingSettings, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.guardrails != null && message.guardrails.length) + for (var i = 0; i < message.guardrails.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.guardrails[i]); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.etag); + if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) + $root.google.cloud.ces.v1beta.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.variableDeclarations != null && message.variableDeclarations.length) + for (var i = 0; i < message.variableDeclarations.length; ++i) + $root.google.cloud.ces.v1beta.App.VariableDeclaration.encode(message.variableDeclarations[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.dataStoreSettings != null && Object.hasOwnProperty.call(message, "dataStoreSettings")) + $root.google.cloud.ces.v1beta.DataStoreSettings.encode(message.dataStoreSettings, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.globalInstruction != null && Object.hasOwnProperty.call(message, "globalInstruction")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.globalInstruction); + if (message.languageSettings != null && Object.hasOwnProperty.call(message, "languageSettings")) + $root.google.cloud.ces.v1beta.LanguageSettings.encode(message.languageSettings, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.defaultChannelProfile != null && Object.hasOwnProperty.call(message, "defaultChannelProfile")) + $root.google.cloud.ces.v1beta.ChannelProfile.encode(message.defaultChannelProfile, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.deploymentCount != null && Object.hasOwnProperty.call(message, "deploymentCount")) + writer.uint32(/* id 23, wireType 0 =*/184).int32(message.deploymentCount); + if (message.evaluationMetricsThresholds != null && Object.hasOwnProperty.call(message, "evaluationMetricsThresholds")) + $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.encode(message.evaluationMetricsThresholds, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.clientCertificateSettings != null && Object.hasOwnProperty.call(message, "clientCertificateSettings")) + $root.google.cloud.ces.v1beta.ClientCertificateSettings.encode(message.clientCertificateSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.timeZoneSettings != null && Object.hasOwnProperty.call(message, "timeZoneSettings")) + $root.google.cloud.ces.v1beta.TimeZoneSettings.encode(message.timeZoneSettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.predefinedVariableDeclarations != null && message.predefinedVariableDeclarations.length) + for (var i = 0; i < message.predefinedVariableDeclarations.length; ++i) + $root.google.cloud.ces.v1beta.App.VariableDeclaration.encode(message.predefinedVariableDeclarations[i], writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) + writer.uint32(/* id 29, wireType 0 =*/232).bool(message.locked); + if (message.evaluationPersonas != null && message.evaluationPersonas.length) + for (var i = 0; i < message.evaluationPersonas.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationPersona.encode(message.evaluationPersonas[i], writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.pinned != null && Object.hasOwnProperty.call(message, "pinned")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.pinned); + if (message.toolExecutionMode != null && Object.hasOwnProperty.call(message, "toolExecutionMode")) + writer.uint32(/* id 32, wireType 0 =*/256).int32(message.toolExecutionMode); + if (message.evaluationSettings != null && Object.hasOwnProperty.call(message, "evaluationSettings")) + $root.google.cloud.ces.v1beta.EvaluationSettings.encode(message.evaluationSettings, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.errorHandlingSettings != null && Object.hasOwnProperty.call(message, "errorHandlingSettings")) + $root.google.cloud.ces.v1beta.ErrorHandlingSettings.encode(message.errorHandlingSettings, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified App message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.App.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.App + * @static + * @param {google.cloud.ces.v1beta.IApp} message App message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + App.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an App message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.App + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.App} App + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + App.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.App(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 31: { + message.pinned = reader.bool(); + break; + } + case 4: { + message.rootAgent = reader.string(); + break; + } + case 18: { + message.languageSettings = $root.google.cloud.ces.v1beta.LanguageSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.timeZoneSettings = $root.google.cloud.ces.v1beta.TimeZoneSettings.decode(reader, reader.uint32()); + break; + } + case 7: { + message.audioProcessingConfig = $root.google.cloud.ces.v1beta.AudioProcessingConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.loggingSettings = $root.google.cloud.ces.v1beta.LoggingSettings.decode(reader, reader.uint32()); + break; + } + case 34: { + message.errorHandlingSettings = $root.google.cloud.ces.v1beta.ErrorHandlingSettings.decode(reader, reader.uint32()); + break; + } + case 13: { + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.decode(reader, reader.uint32()); + break; + } + case 32: { + message.toolExecutionMode = reader.int32(); + break; + } + case 24: { + message.evaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.decode(reader, reader.uint32()); + break; + } + case 14: { + if (!(message.variableDeclarations && message.variableDeclarations.length)) + message.variableDeclarations = []; + message.variableDeclarations.push($root.google.cloud.ces.v1beta.App.VariableDeclaration.decode(reader, reader.uint32())); + break; + } + case 28: { + if (!(message.predefinedVariableDeclarations && message.predefinedVariableDeclarations.length)) + message.predefinedVariableDeclarations = []; + message.predefinedVariableDeclarations.push($root.google.cloud.ces.v1beta.App.VariableDeclaration.decode(reader, reader.uint32())); + break; + } + case 17: { + message.globalInstruction = reader.string(); + break; + } + case 10: { + if (!(message.guardrails && message.guardrails.length)) + message.guardrails = []; + message.guardrails.push(reader.string()); + break; + } + case 15: { + message.dataStoreSettings = $root.google.cloud.ces.v1beta.DataStoreSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.defaultChannelProfile = $root.google.cloud.ces.v1beta.ChannelProfile.decode(reader, reader.uint32()); + break; + } + case 11: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + 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.metadata[key] = value; + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.etag = reader.string(); + break; + } + case 23: { + message.deploymentCount = reader.int32(); + break; + } + case 25: { + message.clientCertificateSettings = $root.google.cloud.ces.v1beta.ClientCertificateSettings.decode(reader, reader.uint32()); + break; + } + case 29: { + message.locked = reader.bool(); + break; + } + case 30: { + if (!(message.evaluationPersonas && message.evaluationPersonas.length)) + message.evaluationPersonas = []; + message.evaluationPersonas.push($root.google.cloud.ces.v1beta.EvaluationPersona.decode(reader, reader.uint32())); + break; + } + case 33: { + message.evaluationSettings = $root.google.cloud.ces.v1beta.EvaluationSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an App message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.App + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.App} App + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + App.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an App message. + * @function verify + * @memberof google.cloud.ces.v1beta.App + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + App.verify = function verify(message) { + if (typeof message !== "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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.pinned != null && message.hasOwnProperty("pinned")) + if (typeof message.pinned !== "boolean") + return "pinned: boolean expected"; + if (message.rootAgent != null && message.hasOwnProperty("rootAgent")) + if (!$util.isString(message.rootAgent)) + return "rootAgent: string expected"; + if (message.languageSettings != null && message.hasOwnProperty("languageSettings")) { + var error = $root.google.cloud.ces.v1beta.LanguageSettings.verify(message.languageSettings); + if (error) + return "languageSettings." + error; + } + if (message.timeZoneSettings != null && message.hasOwnProperty("timeZoneSettings")) { + var error = $root.google.cloud.ces.v1beta.TimeZoneSettings.verify(message.timeZoneSettings); + if (error) + return "timeZoneSettings." + error; + } + if (message.audioProcessingConfig != null && message.hasOwnProperty("audioProcessingConfig")) { + var error = $root.google.cloud.ces.v1beta.AudioProcessingConfig.verify(message.audioProcessingConfig); + if (error) + return "audioProcessingConfig." + error; + } + if (message.loggingSettings != null && message.hasOwnProperty("loggingSettings")) { + var error = $root.google.cloud.ces.v1beta.LoggingSettings.verify(message.loggingSettings); + if (error) + return "loggingSettings." + error; + } + if (message.errorHandlingSettings != null && message.hasOwnProperty("errorHandlingSettings")) { + var error = $root.google.cloud.ces.v1beta.ErrorHandlingSettings.verify(message.errorHandlingSettings); + if (error) + return "errorHandlingSettings." + error; + } + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { + var error = $root.google.cloud.ces.v1beta.ModelSettings.verify(message.modelSettings); + if (error) + return "modelSettings." + error; + } + if (message.toolExecutionMode != null && message.hasOwnProperty("toolExecutionMode")) + switch (message.toolExecutionMode) { + default: + return "toolExecutionMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.evaluationMetricsThresholds != null && message.hasOwnProperty("evaluationMetricsThresholds")) { + var error = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.verify(message.evaluationMetricsThresholds); + if (error) + return "evaluationMetricsThresholds." + error; + } + if (message.variableDeclarations != null && message.hasOwnProperty("variableDeclarations")) { + if (!Array.isArray(message.variableDeclarations)) + return "variableDeclarations: array expected"; + for (var i = 0; i < message.variableDeclarations.length; ++i) { + var error = $root.google.cloud.ces.v1beta.App.VariableDeclaration.verify(message.variableDeclarations[i]); + if (error) + return "variableDeclarations." + error; + } + } + if (message.predefinedVariableDeclarations != null && message.hasOwnProperty("predefinedVariableDeclarations")) { + if (!Array.isArray(message.predefinedVariableDeclarations)) + return "predefinedVariableDeclarations: array expected"; + for (var i = 0; i < message.predefinedVariableDeclarations.length; ++i) { + var error = $root.google.cloud.ces.v1beta.App.VariableDeclaration.verify(message.predefinedVariableDeclarations[i]); + if (error) + return "predefinedVariableDeclarations." + error; + } + } + if (message.globalInstruction != null && message.hasOwnProperty("globalInstruction")) + if (!$util.isString(message.globalInstruction)) + return "globalInstruction: string expected"; + if (message.guardrails != null && message.hasOwnProperty("guardrails")) { + if (!Array.isArray(message.guardrails)) + return "guardrails: array expected"; + for (var i = 0; i < message.guardrails.length; ++i) + if (!$util.isString(message.guardrails[i])) + return "guardrails: string[] expected"; + } + if (message.dataStoreSettings != null && message.hasOwnProperty("dataStoreSettings")) { + var error = $root.google.cloud.ces.v1beta.DataStoreSettings.verify(message.dataStoreSettings); + if (error) + return "dataStoreSettings." + error; + } + if (message.defaultChannelProfile != null && message.hasOwnProperty("defaultChannelProfile")) { + var error = $root.google.cloud.ces.v1beta.ChannelProfile.verify(message.defaultChannelProfile); + if (error) + return "defaultChannelProfile." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k: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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.deploymentCount != null && message.hasOwnProperty("deploymentCount")) + if (!$util.isInteger(message.deploymentCount)) + return "deploymentCount: integer expected"; + if (message.clientCertificateSettings != null && message.hasOwnProperty("clientCertificateSettings")) { + var error = $root.google.cloud.ces.v1beta.ClientCertificateSettings.verify(message.clientCertificateSettings); + if (error) + return "clientCertificateSettings." + error; + } + if (message.locked != null && message.hasOwnProperty("locked")) + if (typeof message.locked !== "boolean") + return "locked: boolean expected"; + if (message.evaluationPersonas != null && message.hasOwnProperty("evaluationPersonas")) { + if (!Array.isArray(message.evaluationPersonas)) + return "evaluationPersonas: array expected"; + for (var i = 0; i < message.evaluationPersonas.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationPersona.verify(message.evaluationPersonas[i]); + if (error) + return "evaluationPersonas." + error; + } + } + if (message.evaluationSettings != null && message.hasOwnProperty("evaluationSettings")) { + var error = $root.google.cloud.ces.v1beta.EvaluationSettings.verify(message.evaluationSettings); + if (error) + return "evaluationSettings." + error; + } + return null; + }; + + /** + * Creates an App message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.App + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.App} App + */ + App.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.App) + return object; + var message = new $root.google.cloud.ces.v1beta.App(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.pinned != null) + message.pinned = Boolean(object.pinned); + if (object.rootAgent != null) + message.rootAgent = String(object.rootAgent); + if (object.languageSettings != null) { + if (typeof object.languageSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.languageSettings: object expected"); + message.languageSettings = $root.google.cloud.ces.v1beta.LanguageSettings.fromObject(object.languageSettings); + } + if (object.timeZoneSettings != null) { + if (typeof object.timeZoneSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.timeZoneSettings: object expected"); + message.timeZoneSettings = $root.google.cloud.ces.v1beta.TimeZoneSettings.fromObject(object.timeZoneSettings); + } + if (object.audioProcessingConfig != null) { + if (typeof object.audioProcessingConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.audioProcessingConfig: object expected"); + message.audioProcessingConfig = $root.google.cloud.ces.v1beta.AudioProcessingConfig.fromObject(object.audioProcessingConfig); + } + if (object.loggingSettings != null) { + if (typeof object.loggingSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.loggingSettings: object expected"); + message.loggingSettings = $root.google.cloud.ces.v1beta.LoggingSettings.fromObject(object.loggingSettings); + } + if (object.errorHandlingSettings != null) { + if (typeof object.errorHandlingSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.errorHandlingSettings: object expected"); + message.errorHandlingSettings = $root.google.cloud.ces.v1beta.ErrorHandlingSettings.fromObject(object.errorHandlingSettings); + } + if (object.modelSettings != null) { + if (typeof object.modelSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.modelSettings: object expected"); + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.fromObject(object.modelSettings); + } + switch (object.toolExecutionMode) { + default: + if (typeof object.toolExecutionMode === "number") { + message.toolExecutionMode = object.toolExecutionMode; + break; + } + break; + case "TOOL_EXECUTION_MODE_UNSPECIFIED": + case 0: + message.toolExecutionMode = 0; + break; + case "PARALLEL": + case 1: + message.toolExecutionMode = 1; + break; + case "SEQUENTIAL": + case 2: + message.toolExecutionMode = 2; + break; + } + if (object.evaluationMetricsThresholds != null) { + if (typeof object.evaluationMetricsThresholds !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.evaluationMetricsThresholds: object expected"); + message.evaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.fromObject(object.evaluationMetricsThresholds); + } + if (object.variableDeclarations) { + if (!Array.isArray(object.variableDeclarations)) + throw TypeError(".google.cloud.ces.v1beta.App.variableDeclarations: array expected"); + message.variableDeclarations = []; + for (var i = 0; i < object.variableDeclarations.length; ++i) { + if (typeof object.variableDeclarations[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.variableDeclarations: object expected"); + message.variableDeclarations[i] = $root.google.cloud.ces.v1beta.App.VariableDeclaration.fromObject(object.variableDeclarations[i]); + } + } + if (object.predefinedVariableDeclarations) { + if (!Array.isArray(object.predefinedVariableDeclarations)) + throw TypeError(".google.cloud.ces.v1beta.App.predefinedVariableDeclarations: array expected"); + message.predefinedVariableDeclarations = []; + for (var i = 0; i < object.predefinedVariableDeclarations.length; ++i) { + if (typeof object.predefinedVariableDeclarations[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.predefinedVariableDeclarations: object expected"); + message.predefinedVariableDeclarations[i] = $root.google.cloud.ces.v1beta.App.VariableDeclaration.fromObject(object.predefinedVariableDeclarations[i]); + } + } + if (object.globalInstruction != null) + message.globalInstruction = String(object.globalInstruction); + if (object.guardrails) { + if (!Array.isArray(object.guardrails)) + throw TypeError(".google.cloud.ces.v1beta.App.guardrails: array expected"); + message.guardrails = []; + for (var i = 0; i < object.guardrails.length; ++i) + message.guardrails[i] = String(object.guardrails[i]); + } + if (object.dataStoreSettings != null) { + if (typeof object.dataStoreSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.dataStoreSettings: object expected"); + message.dataStoreSettings = $root.google.cloud.ces.v1beta.DataStoreSettings.fromObject(object.dataStoreSettings); + } + if (object.defaultChannelProfile != null) { + if (typeof object.defaultChannelProfile !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.defaultChannelProfile: object expected"); + message.defaultChannelProfile = $root.google.cloud.ces.v1beta.ChannelProfile.fromObject(object.defaultChannelProfile); + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.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.ces.v1beta.App.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.deploymentCount != null) + message.deploymentCount = object.deploymentCount | 0; + if (object.clientCertificateSettings != null) { + if (typeof object.clientCertificateSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.clientCertificateSettings: object expected"); + message.clientCertificateSettings = $root.google.cloud.ces.v1beta.ClientCertificateSettings.fromObject(object.clientCertificateSettings); + } + if (object.locked != null) + message.locked = Boolean(object.locked); + if (object.evaluationPersonas) { + if (!Array.isArray(object.evaluationPersonas)) + throw TypeError(".google.cloud.ces.v1beta.App.evaluationPersonas: array expected"); + message.evaluationPersonas = []; + for (var i = 0; i < object.evaluationPersonas.length; ++i) { + if (typeof object.evaluationPersonas[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.evaluationPersonas: object expected"); + message.evaluationPersonas[i] = $root.google.cloud.ces.v1beta.EvaluationPersona.fromObject(object.evaluationPersonas[i]); + } + } + if (object.evaluationSettings != null) { + if (typeof object.evaluationSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.evaluationSettings: object expected"); + message.evaluationSettings = $root.google.cloud.ces.v1beta.EvaluationSettings.fromObject(object.evaluationSettings); + } + return message; + }; + + /** + * Creates a plain object from an App message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.App + * @static + * @param {google.cloud.ces.v1beta.App} message App + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + App.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.guardrails = []; + object.variableDeclarations = []; + object.predefinedVariableDeclarations = []; + object.evaluationPersonas = []; + } + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.rootAgent = ""; + object.createTime = null; + object.updateTime = null; + object.audioProcessingConfig = null; + object.loggingSettings = null; + object.etag = ""; + object.modelSettings = null; + object.dataStoreSettings = null; + object.globalInstruction = ""; + object.languageSettings = null; + object.defaultChannelProfile = null; + object.deploymentCount = 0; + object.evaluationMetricsThresholds = null; + object.clientCertificateSettings = null; + object.timeZoneSettings = null; + object.locked = false; + object.pinned = false; + object.toolExecutionMode = options.enums === String ? "TOOL_EXECUTION_MODE_UNSPECIFIED" : 0; + object.evaluationSettings = null; + object.errorHandlingSettings = 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.rootAgent != null && message.hasOwnProperty("rootAgent")) + object.rootAgent = message.rootAgent; + 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.audioProcessingConfig != null && message.hasOwnProperty("audioProcessingConfig")) + object.audioProcessingConfig = $root.google.cloud.ces.v1beta.AudioProcessingConfig.toObject(message.audioProcessingConfig, options); + if (message.loggingSettings != null && message.hasOwnProperty("loggingSettings")) + object.loggingSettings = $root.google.cloud.ces.v1beta.LoggingSettings.toObject(message.loggingSettings, options); + if (message.guardrails && message.guardrails.length) { + object.guardrails = []; + for (var j = 0; j < message.guardrails.length; ++j) + object.guardrails[j] = message.guardrails[j]; + } + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) + object.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.toObject(message.modelSettings, options); + if (message.variableDeclarations && message.variableDeclarations.length) { + object.variableDeclarations = []; + for (var j = 0; j < message.variableDeclarations.length; ++j) + object.variableDeclarations[j] = $root.google.cloud.ces.v1beta.App.VariableDeclaration.toObject(message.variableDeclarations[j], options); + } + if (message.dataStoreSettings != null && message.hasOwnProperty("dataStoreSettings")) + object.dataStoreSettings = $root.google.cloud.ces.v1beta.DataStoreSettings.toObject(message.dataStoreSettings, options); + if (message.globalInstruction != null && message.hasOwnProperty("globalInstruction")) + object.globalInstruction = message.globalInstruction; + if (message.languageSettings != null && message.hasOwnProperty("languageSettings")) + object.languageSettings = $root.google.cloud.ces.v1beta.LanguageSettings.toObject(message.languageSettings, options); + if (message.defaultChannelProfile != null && message.hasOwnProperty("defaultChannelProfile")) + object.defaultChannelProfile = $root.google.cloud.ces.v1beta.ChannelProfile.toObject(message.defaultChannelProfile, options); + if (message.deploymentCount != null && message.hasOwnProperty("deploymentCount")) + object.deploymentCount = message.deploymentCount; + if (message.evaluationMetricsThresholds != null && message.hasOwnProperty("evaluationMetricsThresholds")) + object.evaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.toObject(message.evaluationMetricsThresholds, options); + if (message.clientCertificateSettings != null && message.hasOwnProperty("clientCertificateSettings")) + object.clientCertificateSettings = $root.google.cloud.ces.v1beta.ClientCertificateSettings.toObject(message.clientCertificateSettings, options); + if (message.timeZoneSettings != null && message.hasOwnProperty("timeZoneSettings")) + object.timeZoneSettings = $root.google.cloud.ces.v1beta.TimeZoneSettings.toObject(message.timeZoneSettings, options); + if (message.predefinedVariableDeclarations && message.predefinedVariableDeclarations.length) { + object.predefinedVariableDeclarations = []; + for (var j = 0; j < message.predefinedVariableDeclarations.length; ++j) + object.predefinedVariableDeclarations[j] = $root.google.cloud.ces.v1beta.App.VariableDeclaration.toObject(message.predefinedVariableDeclarations[j], options); + } + if (message.locked != null && message.hasOwnProperty("locked")) + object.locked = message.locked; + if (message.evaluationPersonas && message.evaluationPersonas.length) { + object.evaluationPersonas = []; + for (var j = 0; j < message.evaluationPersonas.length; ++j) + object.evaluationPersonas[j] = $root.google.cloud.ces.v1beta.EvaluationPersona.toObject(message.evaluationPersonas[j], options); + } + if (message.pinned != null && message.hasOwnProperty("pinned")) + object.pinned = message.pinned; + if (message.toolExecutionMode != null && message.hasOwnProperty("toolExecutionMode")) + object.toolExecutionMode = options.enums === String ? $root.google.cloud.ces.v1beta.App.ToolExecutionMode[message.toolExecutionMode] === undefined ? message.toolExecutionMode : $root.google.cloud.ces.v1beta.App.ToolExecutionMode[message.toolExecutionMode] : message.toolExecutionMode; + if (message.evaluationSettings != null && message.hasOwnProperty("evaluationSettings")) + object.evaluationSettings = $root.google.cloud.ces.v1beta.EvaluationSettings.toObject(message.evaluationSettings, options); + if (message.errorHandlingSettings != null && message.hasOwnProperty("errorHandlingSettings")) + object.errorHandlingSettings = $root.google.cloud.ces.v1beta.ErrorHandlingSettings.toObject(message.errorHandlingSettings, options); + return object; + }; + + /** + * Converts this App to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.App + * @instance + * @returns {Object.} JSON object + */ + App.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for App + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.App + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + App.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.App"; + }; + + App.VariableDeclaration = (function() { + + /** + * Properties of a VariableDeclaration. + * @memberof google.cloud.ces.v1beta.App + * @interface IVariableDeclaration + * @property {string|null} [name] VariableDeclaration name + * @property {string|null} [description] VariableDeclaration description + * @property {google.cloud.ces.v1beta.ISchema|null} [schema] VariableDeclaration schema + */ + + /** + * Constructs a new VariableDeclaration. + * @memberof google.cloud.ces.v1beta.App + * @classdesc Represents a VariableDeclaration. + * @implements IVariableDeclaration + * @constructor + * @param {google.cloud.ces.v1beta.App.IVariableDeclaration=} [properties] Properties to set + */ + function VariableDeclaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VariableDeclaration name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @instance + */ + VariableDeclaration.prototype.name = ""; + + /** + * VariableDeclaration description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @instance + */ + VariableDeclaration.prototype.description = ""; + + /** + * VariableDeclaration schema. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} schema + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @instance + */ + VariableDeclaration.prototype.schema = null; + + /** + * Creates a new VariableDeclaration instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @static + * @param {google.cloud.ces.v1beta.App.IVariableDeclaration=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.App.VariableDeclaration} VariableDeclaration instance + */ + VariableDeclaration.create = function create(properties) { + return new VariableDeclaration(properties); + }; + + /** + * Encodes the specified VariableDeclaration message. Does not implicitly {@link google.cloud.ces.v1beta.App.VariableDeclaration.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @static + * @param {google.cloud.ces.v1beta.App.IVariableDeclaration} message VariableDeclaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VariableDeclaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.cloud.ces.v1beta.Schema.encode(message.schema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VariableDeclaration message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.App.VariableDeclaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @static + * @param {google.cloud.ces.v1beta.App.IVariableDeclaration} message VariableDeclaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VariableDeclaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VariableDeclaration message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.App.VariableDeclaration} VariableDeclaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VariableDeclaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.App.VariableDeclaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.schema = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VariableDeclaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.App.VariableDeclaration} VariableDeclaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VariableDeclaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VariableDeclaration message. + * @function verify + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VariableDeclaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.schema != null && message.hasOwnProperty("schema")) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.schema); + if (error) + return "schema." + error; + } + return null; + }; + + /** + * Creates a VariableDeclaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.App.VariableDeclaration} VariableDeclaration + */ + VariableDeclaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.App.VariableDeclaration) + return object; + var message = new $root.google.cloud.ces.v1beta.App.VariableDeclaration(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.cloud.ces.v1beta.App.VariableDeclaration.schema: object expected"); + message.schema = $root.google.cloud.ces.v1beta.Schema.fromObject(object.schema); + } + return message; + }; + + /** + * Creates a plain object from a VariableDeclaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @static + * @param {google.cloud.ces.v1beta.App.VariableDeclaration} message VariableDeclaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VariableDeclaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.schema = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = $root.google.cloud.ces.v1beta.Schema.toObject(message.schema, options); + return object; + }; + + /** + * Converts this VariableDeclaration to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @instance + * @returns {Object.} JSON object + */ + VariableDeclaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VariableDeclaration + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.App.VariableDeclaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VariableDeclaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.App.VariableDeclaration"; + }; + + return VariableDeclaration; + })(); + + /** + * ToolExecutionMode enum. + * @name google.cloud.ces.v1beta.App.ToolExecutionMode + * @enum {number} + * @property {number} TOOL_EXECUTION_MODE_UNSPECIFIED=0 TOOL_EXECUTION_MODE_UNSPECIFIED value + * @property {number} PARALLEL=1 PARALLEL value + * @property {number} SEQUENTIAL=2 SEQUENTIAL value + */ + App.ToolExecutionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TOOL_EXECUTION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PARALLEL"] = 1; + values[valuesById[2] = "SEQUENTIAL"] = 2; + return values; + })(); + + return App; + })(); + + v1beta.TimeZoneSettings = (function() { + + /** + * Properties of a TimeZoneSettings. + * @memberof google.cloud.ces.v1beta + * @interface ITimeZoneSettings + * @property {string|null} [timeZone] TimeZoneSettings timeZone + */ + + /** + * Constructs a new TimeZoneSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a TimeZoneSettings. + * @implements ITimeZoneSettings + * @constructor + * @param {google.cloud.ces.v1beta.ITimeZoneSettings=} [properties] Properties to set + */ + function TimeZoneSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeZoneSettings timeZone. + * @member {string} timeZone + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @instance + */ + TimeZoneSettings.prototype.timeZone = ""; + + /** + * Creates a new TimeZoneSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @static + * @param {google.cloud.ces.v1beta.ITimeZoneSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TimeZoneSettings} TimeZoneSettings instance + */ + TimeZoneSettings.create = function create(properties) { + return new TimeZoneSettings(properties); + }; + + /** + * Encodes the specified TimeZoneSettings message. Does not implicitly {@link google.cloud.ces.v1beta.TimeZoneSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @static + * @param {google.cloud.ces.v1beta.ITimeZoneSettings} message TimeZoneSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeZoneSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.timeZone); + return writer; + }; + + /** + * Encodes the specified TimeZoneSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TimeZoneSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @static + * @param {google.cloud.ces.v1beta.ITimeZoneSettings} message TimeZoneSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeZoneSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeZoneSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TimeZoneSettings} TimeZoneSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeZoneSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TimeZoneSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.timeZone = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeZoneSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TimeZoneSettings} TimeZoneSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeZoneSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeZoneSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeZoneSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + return null; + }; + + /** + * Creates a TimeZoneSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TimeZoneSettings} TimeZoneSettings + */ + TimeZoneSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TimeZoneSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.TimeZoneSettings(); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + return message; + }; + + /** + * Creates a plain object from a TimeZoneSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @static + * @param {google.cloud.ces.v1beta.TimeZoneSettings} message TimeZoneSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeZoneSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.timeZone = ""; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + return object; + }; + + /** + * Converts this TimeZoneSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @instance + * @returns {Object.} JSON object + */ + TimeZoneSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeZoneSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TimeZoneSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeZoneSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TimeZoneSettings"; + }; + + return TimeZoneSettings; + })(); + + v1beta.LanguageSettings = (function() { + + /** + * Properties of a LanguageSettings. + * @memberof google.cloud.ces.v1beta + * @interface ILanguageSettings + * @property {string|null} [defaultLanguageCode] LanguageSettings defaultLanguageCode + * @property {Array.|null} [supportedLanguageCodes] LanguageSettings supportedLanguageCodes + * @property {boolean|null} [enableMultilingualSupport] LanguageSettings enableMultilingualSupport + * @property {string|null} [fallbackAction] LanguageSettings fallbackAction + */ + + /** + * Constructs a new LanguageSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a LanguageSettings. + * @implements ILanguageSettings + * @constructor + * @param {google.cloud.ces.v1beta.ILanguageSettings=} [properties] Properties to set + */ + function LanguageSettings(properties) { + this.supportedLanguageCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LanguageSettings defaultLanguageCode. + * @member {string} defaultLanguageCode + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @instance + */ + LanguageSettings.prototype.defaultLanguageCode = ""; + + /** + * LanguageSettings supportedLanguageCodes. + * @member {Array.} supportedLanguageCodes + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @instance + */ + LanguageSettings.prototype.supportedLanguageCodes = $util.emptyArray; + + /** + * LanguageSettings enableMultilingualSupport. + * @member {boolean} enableMultilingualSupport + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @instance + */ + LanguageSettings.prototype.enableMultilingualSupport = false; + + /** + * LanguageSettings fallbackAction. + * @member {string} fallbackAction + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @instance + */ + LanguageSettings.prototype.fallbackAction = ""; + + /** + * Creates a new LanguageSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @static + * @param {google.cloud.ces.v1beta.ILanguageSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.LanguageSettings} LanguageSettings instance + */ + LanguageSettings.create = function create(properties) { + return new LanguageSettings(properties); + }; + + /** + * Encodes the specified LanguageSettings message. Does not implicitly {@link google.cloud.ces.v1beta.LanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @static + * @param {google.cloud.ces.v1beta.ILanguageSettings} message LanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaultLanguageCode != null && Object.hasOwnProperty.call(message, "defaultLanguageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.defaultLanguageCode); + if (message.supportedLanguageCodes != null && message.supportedLanguageCodes.length) + for (var i = 0; i < message.supportedLanguageCodes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.supportedLanguageCodes[i]); + if (message.enableMultilingualSupport != null && Object.hasOwnProperty.call(message, "enableMultilingualSupport")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableMultilingualSupport); + if (message.fallbackAction != null && Object.hasOwnProperty.call(message, "fallbackAction")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.fallbackAction); + return writer; + }; + + /** + * Encodes the specified LanguageSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @static + * @param {google.cloud.ces.v1beta.ILanguageSettings} message LanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.LanguageSettings} LanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.defaultLanguageCode = reader.string(); + break; + } + case 2: { + if (!(message.supportedLanguageCodes && message.supportedLanguageCodes.length)) + message.supportedLanguageCodes = []; + message.supportedLanguageCodes.push(reader.string()); + break; + } + case 3: { + message.enableMultilingualSupport = reader.bool(); + break; + } + case 4: { + message.fallbackAction = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.LanguageSettings} LanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LanguageSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaultLanguageCode != null && message.hasOwnProperty("defaultLanguageCode")) + if (!$util.isString(message.defaultLanguageCode)) + return "defaultLanguageCode: string expected"; + if (message.supportedLanguageCodes != null && message.hasOwnProperty("supportedLanguageCodes")) { + if (!Array.isArray(message.supportedLanguageCodes)) + return "supportedLanguageCodes: array expected"; + for (var i = 0; i < message.supportedLanguageCodes.length; ++i) + if (!$util.isString(message.supportedLanguageCodes[i])) + return "supportedLanguageCodes: string[] expected"; + } + if (message.enableMultilingualSupport != null && message.hasOwnProperty("enableMultilingualSupport")) + if (typeof message.enableMultilingualSupport !== "boolean") + return "enableMultilingualSupport: boolean expected"; + if (message.fallbackAction != null && message.hasOwnProperty("fallbackAction")) + if (!$util.isString(message.fallbackAction)) + return "fallbackAction: string expected"; + return null; + }; + + /** + * Creates a LanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.LanguageSettings} LanguageSettings + */ + LanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.LanguageSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.LanguageSettings(); + if (object.defaultLanguageCode != null) + message.defaultLanguageCode = String(object.defaultLanguageCode); + if (object.supportedLanguageCodes) { + if (!Array.isArray(object.supportedLanguageCodes)) + throw TypeError(".google.cloud.ces.v1beta.LanguageSettings.supportedLanguageCodes: array expected"); + message.supportedLanguageCodes = []; + for (var i = 0; i < object.supportedLanguageCodes.length; ++i) + message.supportedLanguageCodes[i] = String(object.supportedLanguageCodes[i]); + } + if (object.enableMultilingualSupport != null) + message.enableMultilingualSupport = Boolean(object.enableMultilingualSupport); + if (object.fallbackAction != null) + message.fallbackAction = String(object.fallbackAction); + return message; + }; + + /** + * Creates a plain object from a LanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @static + * @param {google.cloud.ces.v1beta.LanguageSettings} message LanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedLanguageCodes = []; + if (options.defaults) { + object.defaultLanguageCode = ""; + object.enableMultilingualSupport = false; + object.fallbackAction = ""; + } + if (message.defaultLanguageCode != null && message.hasOwnProperty("defaultLanguageCode")) + object.defaultLanguageCode = message.defaultLanguageCode; + if (message.supportedLanguageCodes && message.supportedLanguageCodes.length) { + object.supportedLanguageCodes = []; + for (var j = 0; j < message.supportedLanguageCodes.length; ++j) + object.supportedLanguageCodes[j] = message.supportedLanguageCodes[j]; + } + if (message.enableMultilingualSupport != null && message.hasOwnProperty("enableMultilingualSupport")) + object.enableMultilingualSupport = message.enableMultilingualSupport; + if (message.fallbackAction != null && message.hasOwnProperty("fallbackAction")) + object.fallbackAction = message.fallbackAction; + return object; + }; + + /** + * Converts this LanguageSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @instance + * @returns {Object.} JSON object + */ + LanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LanguageSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.LanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.LanguageSettings"; + }; + + return LanguageSettings; + })(); + + v1beta.AudioProcessingConfig = (function() { + + /** + * Properties of an AudioProcessingConfig. + * @memberof google.cloud.ces.v1beta + * @interface IAudioProcessingConfig + * @property {Object.|null} [synthesizeSpeechConfigs] AudioProcessingConfig synthesizeSpeechConfigs + * @property {google.cloud.ces.v1beta.IBargeInConfig|null} [bargeInConfig] AudioProcessingConfig bargeInConfig + * @property {google.protobuf.IDuration|null} [inactivityTimeout] AudioProcessingConfig inactivityTimeout + * @property {google.cloud.ces.v1beta.IAmbientSoundConfig|null} [ambientSoundConfig] AudioProcessingConfig ambientSoundConfig + */ + + /** + * Constructs a new AudioProcessingConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an AudioProcessingConfig. + * @implements IAudioProcessingConfig + * @constructor + * @param {google.cloud.ces.v1beta.IAudioProcessingConfig=} [properties] Properties to set + */ + function AudioProcessingConfig(properties) { + this.synthesizeSpeechConfigs = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AudioProcessingConfig synthesizeSpeechConfigs. + * @member {Object.} synthesizeSpeechConfigs + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @instance + */ + AudioProcessingConfig.prototype.synthesizeSpeechConfigs = $util.emptyObject; + + /** + * AudioProcessingConfig bargeInConfig. + * @member {google.cloud.ces.v1beta.IBargeInConfig|null|undefined} bargeInConfig + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @instance + */ + AudioProcessingConfig.prototype.bargeInConfig = null; + + /** + * AudioProcessingConfig inactivityTimeout. + * @member {google.protobuf.IDuration|null|undefined} inactivityTimeout + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @instance + */ + AudioProcessingConfig.prototype.inactivityTimeout = null; + + /** + * AudioProcessingConfig ambientSoundConfig. + * @member {google.cloud.ces.v1beta.IAmbientSoundConfig|null|undefined} ambientSoundConfig + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @instance + */ + AudioProcessingConfig.prototype.ambientSoundConfig = null; + + /** + * Creates a new AudioProcessingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @static + * @param {google.cloud.ces.v1beta.IAudioProcessingConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AudioProcessingConfig} AudioProcessingConfig instance + */ + AudioProcessingConfig.create = function create(properties) { + return new AudioProcessingConfig(properties); + }; + + /** + * Encodes the specified AudioProcessingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.AudioProcessingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @static + * @param {google.cloud.ces.v1beta.IAudioProcessingConfig} message AudioProcessingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioProcessingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.synthesizeSpeechConfigs != null && Object.hasOwnProperty.call(message, "synthesizeSpeechConfigs")) + for (var keys = Object.keys(message.synthesizeSpeechConfigs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig.encode(message.synthesizeSpeechConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.bargeInConfig != null && Object.hasOwnProperty.call(message, "bargeInConfig")) + $root.google.cloud.ces.v1beta.BargeInConfig.encode(message.bargeInConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.inactivityTimeout != null && Object.hasOwnProperty.call(message, "inactivityTimeout")) + $root.google.protobuf.Duration.encode(message.inactivityTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ambientSoundConfig != null && Object.hasOwnProperty.call(message, "ambientSoundConfig")) + $root.google.cloud.ces.v1beta.AmbientSoundConfig.encode(message.ambientSoundConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AudioProcessingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AudioProcessingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @static + * @param {google.cloud.ces.v1beta.IAudioProcessingConfig} message AudioProcessingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioProcessingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AudioProcessingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AudioProcessingConfig} AudioProcessingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioProcessingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AudioProcessingConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.synthesizeSpeechConfigs === $util.emptyObject) + message.synthesizeSpeechConfigs = {}; + 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.ces.v1beta.SynthesizeSpeechConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.synthesizeSpeechConfigs[key] = value; + break; + } + case 3: { + message.bargeInConfig = $root.google.cloud.ces.v1beta.BargeInConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.inactivityTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.ambientSoundConfig = $root.google.cloud.ces.v1beta.AmbientSoundConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AudioProcessingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AudioProcessingConfig} AudioProcessingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioProcessingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AudioProcessingConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AudioProcessingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.synthesizeSpeechConfigs != null && message.hasOwnProperty("synthesizeSpeechConfigs")) { + if (!$util.isObject(message.synthesizeSpeechConfigs)) + return "synthesizeSpeechConfigs: object expected"; + var key = Object.keys(message.synthesizeSpeechConfigs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig.verify(message.synthesizeSpeechConfigs[key[i]]); + if (error) + return "synthesizeSpeechConfigs." + error; + } + } + if (message.bargeInConfig != null && message.hasOwnProperty("bargeInConfig")) { + var error = $root.google.cloud.ces.v1beta.BargeInConfig.verify(message.bargeInConfig); + if (error) + return "bargeInConfig." + error; + } + if (message.inactivityTimeout != null && message.hasOwnProperty("inactivityTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.inactivityTimeout); + if (error) + return "inactivityTimeout." + error; + } + if (message.ambientSoundConfig != null && message.hasOwnProperty("ambientSoundConfig")) { + var error = $root.google.cloud.ces.v1beta.AmbientSoundConfig.verify(message.ambientSoundConfig); + if (error) + return "ambientSoundConfig." + error; + } + return null; + }; + + /** + * Creates an AudioProcessingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AudioProcessingConfig} AudioProcessingConfig + */ + AudioProcessingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AudioProcessingConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.AudioProcessingConfig(); + if (object.synthesizeSpeechConfigs) { + if (typeof object.synthesizeSpeechConfigs !== "object") + throw TypeError(".google.cloud.ces.v1beta.AudioProcessingConfig.synthesizeSpeechConfigs: object expected"); + message.synthesizeSpeechConfigs = {}; + for (var keys = Object.keys(object.synthesizeSpeechConfigs), i = 0; i < keys.length; ++i) { + if (typeof object.synthesizeSpeechConfigs[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AudioProcessingConfig.synthesizeSpeechConfigs: object expected"); + message.synthesizeSpeechConfigs[keys[i]] = $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig.fromObject(object.synthesizeSpeechConfigs[keys[i]]); + } + } + if (object.bargeInConfig != null) { + if (typeof object.bargeInConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.AudioProcessingConfig.bargeInConfig: object expected"); + message.bargeInConfig = $root.google.cloud.ces.v1beta.BargeInConfig.fromObject(object.bargeInConfig); + } + if (object.inactivityTimeout != null) { + if (typeof object.inactivityTimeout !== "object") + throw TypeError(".google.cloud.ces.v1beta.AudioProcessingConfig.inactivityTimeout: object expected"); + message.inactivityTimeout = $root.google.protobuf.Duration.fromObject(object.inactivityTimeout); + } + if (object.ambientSoundConfig != null) { + if (typeof object.ambientSoundConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.AudioProcessingConfig.ambientSoundConfig: object expected"); + message.ambientSoundConfig = $root.google.cloud.ces.v1beta.AmbientSoundConfig.fromObject(object.ambientSoundConfig); + } + return message; + }; + + /** + * Creates a plain object from an AudioProcessingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @static + * @param {google.cloud.ces.v1beta.AudioProcessingConfig} message AudioProcessingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AudioProcessingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.synthesizeSpeechConfigs = {}; + if (options.defaults) { + object.bargeInConfig = null; + object.inactivityTimeout = null; + object.ambientSoundConfig = null; + } + var keys2; + if (message.synthesizeSpeechConfigs && (keys2 = Object.keys(message.synthesizeSpeechConfigs)).length) { + object.synthesizeSpeechConfigs = {}; + for (var j = 0; j < keys2.length; ++j) + object.synthesizeSpeechConfigs[keys2[j]] = $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig.toObject(message.synthesizeSpeechConfigs[keys2[j]], options); + } + if (message.bargeInConfig != null && message.hasOwnProperty("bargeInConfig")) + object.bargeInConfig = $root.google.cloud.ces.v1beta.BargeInConfig.toObject(message.bargeInConfig, options); + if (message.inactivityTimeout != null && message.hasOwnProperty("inactivityTimeout")) + object.inactivityTimeout = $root.google.protobuf.Duration.toObject(message.inactivityTimeout, options); + if (message.ambientSoundConfig != null && message.hasOwnProperty("ambientSoundConfig")) + object.ambientSoundConfig = $root.google.cloud.ces.v1beta.AmbientSoundConfig.toObject(message.ambientSoundConfig, options); + return object; + }; + + /** + * Converts this AudioProcessingConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @instance + * @returns {Object.} JSON object + */ + AudioProcessingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AudioProcessingConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AudioProcessingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AudioProcessingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AudioProcessingConfig"; + }; + + return AudioProcessingConfig; + })(); + + v1beta.AmbientSoundConfig = (function() { + + /** + * Properties of an AmbientSoundConfig. + * @memberof google.cloud.ces.v1beta + * @interface IAmbientSoundConfig + * @property {google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise|null} [prebuiltAmbientNoise] AmbientSoundConfig prebuiltAmbientNoise + * @property {string|null} [gcsUri] AmbientSoundConfig gcsUri + * @property {string|null} [prebuiltAmbientSound] AmbientSoundConfig prebuiltAmbientSound + * @property {number|null} [volumeGainDb] AmbientSoundConfig volumeGainDb + */ + + /** + * Constructs a new AmbientSoundConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an AmbientSoundConfig. + * @implements IAmbientSoundConfig + * @constructor + * @param {google.cloud.ces.v1beta.IAmbientSoundConfig=} [properties] Properties to set + */ + function AmbientSoundConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AmbientSoundConfig prebuiltAmbientNoise. + * @member {google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise|null|undefined} prebuiltAmbientNoise + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @instance + */ + AmbientSoundConfig.prototype.prebuiltAmbientNoise = null; + + /** + * AmbientSoundConfig gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @instance + */ + AmbientSoundConfig.prototype.gcsUri = null; + + /** + * AmbientSoundConfig prebuiltAmbientSound. + * @member {string|null|undefined} prebuiltAmbientSound + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @instance + */ + AmbientSoundConfig.prototype.prebuiltAmbientSound = null; + + /** + * AmbientSoundConfig volumeGainDb. + * @member {number} volumeGainDb + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @instance + */ + AmbientSoundConfig.prototype.volumeGainDb = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AmbientSoundConfig source. + * @member {"prebuiltAmbientNoise"|"gcsUri"|"prebuiltAmbientSound"|undefined} source + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @instance + */ + Object.defineProperty(AmbientSoundConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["prebuiltAmbientNoise", "gcsUri", "prebuiltAmbientSound"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AmbientSoundConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @static + * @param {google.cloud.ces.v1beta.IAmbientSoundConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AmbientSoundConfig} AmbientSoundConfig instance + */ + AmbientSoundConfig.create = function create(properties) { + return new AmbientSoundConfig(properties); + }; + + /** + * Encodes the specified AmbientSoundConfig message. Does not implicitly {@link google.cloud.ces.v1beta.AmbientSoundConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @static + * @param {google.cloud.ces.v1beta.IAmbientSoundConfig} message AmbientSoundConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AmbientSoundConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prebuiltAmbientNoise != null && Object.hasOwnProperty.call(message, "prebuiltAmbientNoise")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.prebuiltAmbientNoise); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsUri); + if (message.volumeGainDb != null && Object.hasOwnProperty.call(message, "volumeGainDb")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.volumeGainDb); + if (message.prebuiltAmbientSound != null && Object.hasOwnProperty.call(message, "prebuiltAmbientSound")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.prebuiltAmbientSound); + return writer; + }; + + /** + * Encodes the specified AmbientSoundConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AmbientSoundConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @static + * @param {google.cloud.ces.v1beta.IAmbientSoundConfig} message AmbientSoundConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AmbientSoundConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AmbientSoundConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AmbientSoundConfig} AmbientSoundConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AmbientSoundConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AmbientSoundConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.prebuiltAmbientNoise = reader.int32(); + break; + } + case 2: { + message.gcsUri = reader.string(); + break; + } + case 4: { + message.prebuiltAmbientSound = reader.string(); + break; + } + case 3: { + message.volumeGainDb = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AmbientSoundConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AmbientSoundConfig} AmbientSoundConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AmbientSoundConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AmbientSoundConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AmbientSoundConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.prebuiltAmbientNoise != null && message.hasOwnProperty("prebuiltAmbientNoise")) { + properties.source = 1; + switch (message.prebuiltAmbientNoise) { + default: + return "prebuiltAmbientNoise: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + if (message.prebuiltAmbientSound != null && message.hasOwnProperty("prebuiltAmbientSound")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.prebuiltAmbientSound)) + return "prebuiltAmbientSound: string expected"; + } + if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) + if (typeof message.volumeGainDb !== "number") + return "volumeGainDb: number expected"; + return null; + }; + + /** + * Creates an AmbientSoundConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AmbientSoundConfig} AmbientSoundConfig + */ + AmbientSoundConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AmbientSoundConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.AmbientSoundConfig(); + switch (object.prebuiltAmbientNoise) { + default: + if (typeof object.prebuiltAmbientNoise === "number") { + message.prebuiltAmbientNoise = object.prebuiltAmbientNoise; + break; + } + break; + case "PREBUILT_AMBIENT_NOISE_UNSPECIFIED": + case 0: + message.prebuiltAmbientNoise = 0; + break; + case "RETAIL_STORE": + case 1: + message.prebuiltAmbientNoise = 1; + break; + case "CONVENTION_HALL": + case 2: + message.prebuiltAmbientNoise = 2; + break; + case "OUTDOOR": + case 3: + message.prebuiltAmbientNoise = 3; + break; + } + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.prebuiltAmbientSound != null) + message.prebuiltAmbientSound = String(object.prebuiltAmbientSound); + if (object.volumeGainDb != null) + message.volumeGainDb = Number(object.volumeGainDb); + return message; + }; + + /** + * Creates a plain object from an AmbientSoundConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @static + * @param {google.cloud.ces.v1beta.AmbientSoundConfig} message AmbientSoundConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AmbientSoundConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.volumeGainDb = 0; + if (message.prebuiltAmbientNoise != null && message.hasOwnProperty("prebuiltAmbientNoise")) { + object.prebuiltAmbientNoise = options.enums === String ? $root.google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise[message.prebuiltAmbientNoise] === undefined ? message.prebuiltAmbientNoise : $root.google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise[message.prebuiltAmbientNoise] : message.prebuiltAmbientNoise; + if (options.oneofs) + object.source = "prebuiltAmbientNoise"; + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.source = "gcsUri"; + } + if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) + object.volumeGainDb = options.json && !isFinite(message.volumeGainDb) ? String(message.volumeGainDb) : message.volumeGainDb; + if (message.prebuiltAmbientSound != null && message.hasOwnProperty("prebuiltAmbientSound")) { + object.prebuiltAmbientSound = message.prebuiltAmbientSound; + if (options.oneofs) + object.source = "prebuiltAmbientSound"; + } + return object; + }; + + /** + * Converts this AmbientSoundConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @instance + * @returns {Object.} JSON object + */ + AmbientSoundConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AmbientSoundConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AmbientSoundConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AmbientSoundConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AmbientSoundConfig"; + }; + + /** + * PrebuiltAmbientNoise enum. + * @name google.cloud.ces.v1beta.AmbientSoundConfig.PrebuiltAmbientNoise + * @enum {number} + * @property {number} PREBUILT_AMBIENT_NOISE_UNSPECIFIED=0 PREBUILT_AMBIENT_NOISE_UNSPECIFIED value + * @property {number} RETAIL_STORE=1 RETAIL_STORE value + * @property {number} CONVENTION_HALL=2 CONVENTION_HALL value + * @property {number} OUTDOOR=3 OUTDOOR value + */ + AmbientSoundConfig.PrebuiltAmbientNoise = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PREBUILT_AMBIENT_NOISE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RETAIL_STORE"] = 1; + values[valuesById[2] = "CONVENTION_HALL"] = 2; + values[valuesById[3] = "OUTDOOR"] = 3; + return values; + })(); + + return AmbientSoundConfig; + })(); + + v1beta.BargeInConfig = (function() { + + /** + * Properties of a BargeInConfig. + * @memberof google.cloud.ces.v1beta + * @interface IBargeInConfig + * @property {boolean|null} [disableBargeIn] BargeInConfig disableBargeIn + * @property {boolean|null} [bargeInAwareness] BargeInConfig bargeInAwareness + */ + + /** + * Constructs a new BargeInConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a BargeInConfig. + * @implements IBargeInConfig + * @constructor + * @param {google.cloud.ces.v1beta.IBargeInConfig=} [properties] Properties to set + */ + function BargeInConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BargeInConfig disableBargeIn. + * @member {boolean} disableBargeIn + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @instance + */ + BargeInConfig.prototype.disableBargeIn = false; + + /** + * BargeInConfig bargeInAwareness. + * @member {boolean} bargeInAwareness + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @instance + */ + BargeInConfig.prototype.bargeInAwareness = false; + + /** + * Creates a new BargeInConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @static + * @param {google.cloud.ces.v1beta.IBargeInConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.BargeInConfig} BargeInConfig instance + */ + BargeInConfig.create = function create(properties) { + return new BargeInConfig(properties); + }; + + /** + * Encodes the specified BargeInConfig message. Does not implicitly {@link google.cloud.ces.v1beta.BargeInConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @static + * @param {google.cloud.ces.v1beta.IBargeInConfig} message BargeInConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BargeInConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disableBargeIn != null && Object.hasOwnProperty.call(message, "disableBargeIn")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.disableBargeIn); + if (message.bargeInAwareness != null && Object.hasOwnProperty.call(message, "bargeInAwareness")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.bargeInAwareness); + return writer; + }; + + /** + * Encodes the specified BargeInConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BargeInConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @static + * @param {google.cloud.ces.v1beta.IBargeInConfig} message BargeInConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BargeInConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.BargeInConfig} BargeInConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BargeInConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BargeInConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.disableBargeIn = reader.bool(); + break; + } + case 2: { + message.bargeInAwareness = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BargeInConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.BargeInConfig} BargeInConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BargeInConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BargeInConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BargeInConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disableBargeIn != null && message.hasOwnProperty("disableBargeIn")) + if (typeof message.disableBargeIn !== "boolean") + return "disableBargeIn: boolean expected"; + if (message.bargeInAwareness != null && message.hasOwnProperty("bargeInAwareness")) + if (typeof message.bargeInAwareness !== "boolean") + return "bargeInAwareness: boolean expected"; + return null; + }; + + /** + * Creates a BargeInConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.BargeInConfig} BargeInConfig + */ + BargeInConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.BargeInConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.BargeInConfig(); + if (object.disableBargeIn != null) + message.disableBargeIn = Boolean(object.disableBargeIn); + if (object.bargeInAwareness != null) + message.bargeInAwareness = Boolean(object.bargeInAwareness); + return message; + }; + + /** + * Creates a plain object from a BargeInConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @static + * @param {google.cloud.ces.v1beta.BargeInConfig} message BargeInConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BargeInConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disableBargeIn = false; + object.bargeInAwareness = false; + } + if (message.disableBargeIn != null && message.hasOwnProperty("disableBargeIn")) + object.disableBargeIn = message.disableBargeIn; + if (message.bargeInAwareness != null && message.hasOwnProperty("bargeInAwareness")) + object.bargeInAwareness = message.bargeInAwareness; + return object; + }; + + /** + * Converts this BargeInConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @instance + * @returns {Object.} JSON object + */ + BargeInConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BargeInConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.BargeInConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BargeInConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.BargeInConfig"; + }; + + return BargeInConfig; + })(); + + v1beta.SynthesizeSpeechConfig = (function() { + + /** + * Properties of a SynthesizeSpeechConfig. + * @memberof google.cloud.ces.v1beta + * @interface ISynthesizeSpeechConfig + * @property {string|null} [voice] SynthesizeSpeechConfig voice + * @property {number|null} [speakingRate] SynthesizeSpeechConfig speakingRate + */ + + /** + * Constructs a new SynthesizeSpeechConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a SynthesizeSpeechConfig. + * @implements ISynthesizeSpeechConfig + * @constructor + * @param {google.cloud.ces.v1beta.ISynthesizeSpeechConfig=} [properties] Properties to set + */ + function SynthesizeSpeechConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SynthesizeSpeechConfig voice. + * @member {string} voice + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.voice = ""; + + /** + * SynthesizeSpeechConfig speakingRate. + * @member {number} speakingRate + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.speakingRate = 0; + + /** + * Creates a new SynthesizeSpeechConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @static + * @param {google.cloud.ces.v1beta.ISynthesizeSpeechConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.SynthesizeSpeechConfig} SynthesizeSpeechConfig instance + */ + SynthesizeSpeechConfig.create = function create(properties) { + return new SynthesizeSpeechConfig(properties); + }; + + /** + * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.ces.v1beta.SynthesizeSpeechConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @static + * @param {google.cloud.ces.v1beta.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SynthesizeSpeechConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voice != null && Object.hasOwnProperty.call(message, "voice")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.voice); + if (message.speakingRate != null && Object.hasOwnProperty.call(message, "speakingRate")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.speakingRate); + return writer; + }; + + /** + * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SynthesizeSpeechConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @static + * @param {google.cloud.ces.v1beta.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SynthesizeSpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SynthesizeSpeechConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.voice = reader.string(); + break; + } + case 2: { + message.speakingRate = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SynthesizeSpeechConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SynthesizeSpeechConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SynthesizeSpeechConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.voice != null && message.hasOwnProperty("voice")) + if (!$util.isString(message.voice)) + return "voice: string expected"; + if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) + if (typeof message.speakingRate !== "number") + return "speakingRate: number expected"; + return null; + }; + + /** + * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.SynthesizeSpeechConfig} SynthesizeSpeechConfig + */ + SynthesizeSpeechConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.SynthesizeSpeechConfig(); + if (object.voice != null) + message.voice = String(object.voice); + if (object.speakingRate != null) + message.speakingRate = Number(object.speakingRate); + return message; + }; + + /** + * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @static + * @param {google.cloud.ces.v1beta.SynthesizeSpeechConfig} message SynthesizeSpeechConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SynthesizeSpeechConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.voice = ""; + object.speakingRate = 0; + } + if (message.voice != null && message.hasOwnProperty("voice")) + object.voice = message.voice; + if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) + object.speakingRate = options.json && !isFinite(message.speakingRate) ? String(message.speakingRate) : message.speakingRate; + return object; + }; + + /** + * Converts this SynthesizeSpeechConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @instance + * @returns {Object.} JSON object + */ + SynthesizeSpeechConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SynthesizeSpeechConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.SynthesizeSpeechConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SynthesizeSpeechConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.SynthesizeSpeechConfig"; + }; + + return SynthesizeSpeechConfig; + })(); + + v1beta.MetricAnalysisSettings = (function() { + + /** + * Properties of a MetricAnalysisSettings. + * @memberof google.cloud.ces.v1beta + * @interface IMetricAnalysisSettings + * @property {boolean|null} [llmMetricsOptedOut] MetricAnalysisSettings llmMetricsOptedOut + */ + + /** + * Constructs a new MetricAnalysisSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a MetricAnalysisSettings. + * @implements IMetricAnalysisSettings + * @constructor + * @param {google.cloud.ces.v1beta.IMetricAnalysisSettings=} [properties] Properties to set + */ + function MetricAnalysisSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricAnalysisSettings llmMetricsOptedOut. + * @member {boolean} llmMetricsOptedOut + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @instance + */ + MetricAnalysisSettings.prototype.llmMetricsOptedOut = false; + + /** + * Creates a new MetricAnalysisSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @static + * @param {google.cloud.ces.v1beta.IMetricAnalysisSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.MetricAnalysisSettings} MetricAnalysisSettings instance + */ + MetricAnalysisSettings.create = function create(properties) { + return new MetricAnalysisSettings(properties); + }; + + /** + * Encodes the specified MetricAnalysisSettings message. Does not implicitly {@link google.cloud.ces.v1beta.MetricAnalysisSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @static + * @param {google.cloud.ces.v1beta.IMetricAnalysisSettings} message MetricAnalysisSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricAnalysisSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.llmMetricsOptedOut != null && Object.hasOwnProperty.call(message, "llmMetricsOptedOut")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.llmMetricsOptedOut); + return writer; + }; + + /** + * Encodes the specified MetricAnalysisSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.MetricAnalysisSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @static + * @param {google.cloud.ces.v1beta.IMetricAnalysisSettings} message MetricAnalysisSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricAnalysisSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricAnalysisSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.MetricAnalysisSettings} MetricAnalysisSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricAnalysisSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.MetricAnalysisSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.llmMetricsOptedOut = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricAnalysisSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.MetricAnalysisSettings} MetricAnalysisSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricAnalysisSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricAnalysisSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricAnalysisSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.llmMetricsOptedOut != null && message.hasOwnProperty("llmMetricsOptedOut")) + if (typeof message.llmMetricsOptedOut !== "boolean") + return "llmMetricsOptedOut: boolean expected"; + return null; + }; + + /** + * Creates a MetricAnalysisSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.MetricAnalysisSettings} MetricAnalysisSettings + */ + MetricAnalysisSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.MetricAnalysisSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.MetricAnalysisSettings(); + if (object.llmMetricsOptedOut != null) + message.llmMetricsOptedOut = Boolean(object.llmMetricsOptedOut); + return message; + }; + + /** + * Creates a plain object from a MetricAnalysisSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @static + * @param {google.cloud.ces.v1beta.MetricAnalysisSettings} message MetricAnalysisSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricAnalysisSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.llmMetricsOptedOut = false; + if (message.llmMetricsOptedOut != null && message.hasOwnProperty("llmMetricsOptedOut")) + object.llmMetricsOptedOut = message.llmMetricsOptedOut; + return object; + }; + + /** + * Converts this MetricAnalysisSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @instance + * @returns {Object.} JSON object + */ + MetricAnalysisSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricAnalysisSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.MetricAnalysisSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricAnalysisSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.MetricAnalysisSettings"; + }; + + return MetricAnalysisSettings; + })(); + + v1beta.LoggingSettings = (function() { + + /** + * Properties of a LoggingSettings. + * @memberof google.cloud.ces.v1beta + * @interface ILoggingSettings + * @property {google.cloud.ces.v1beta.IRedactionConfig|null} [redactionConfig] LoggingSettings redactionConfig + * @property {google.cloud.ces.v1beta.IAudioRecordingConfig|null} [audioRecordingConfig] LoggingSettings audioRecordingConfig + * @property {google.cloud.ces.v1beta.IBigQueryExportSettings|null} [bigqueryExportSettings] LoggingSettings bigqueryExportSettings + * @property {google.cloud.ces.v1beta.ICloudLoggingSettings|null} [cloudLoggingSettings] LoggingSettings cloudLoggingSettings + * @property {google.cloud.ces.v1beta.IConversationLoggingSettings|null} [conversationLoggingSettings] LoggingSettings conversationLoggingSettings + * @property {google.cloud.ces.v1beta.IAudioRecordingConfig|null} [evaluationAudioRecordingConfig] LoggingSettings evaluationAudioRecordingConfig + * @property {google.cloud.ces.v1beta.IMetricAnalysisSettings|null} [metricAnalysisSettings] LoggingSettings metricAnalysisSettings + */ + + /** + * Constructs a new LoggingSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a LoggingSettings. + * @implements ILoggingSettings + * @constructor + * @param {google.cloud.ces.v1beta.ILoggingSettings=} [properties] Properties to set + */ + function LoggingSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LoggingSettings redactionConfig. + * @member {google.cloud.ces.v1beta.IRedactionConfig|null|undefined} redactionConfig + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @instance + */ + LoggingSettings.prototype.redactionConfig = null; + + /** + * LoggingSettings audioRecordingConfig. + * @member {google.cloud.ces.v1beta.IAudioRecordingConfig|null|undefined} audioRecordingConfig + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @instance + */ + LoggingSettings.prototype.audioRecordingConfig = null; + + /** + * LoggingSettings bigqueryExportSettings. + * @member {google.cloud.ces.v1beta.IBigQueryExportSettings|null|undefined} bigqueryExportSettings + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @instance + */ + LoggingSettings.prototype.bigqueryExportSettings = null; + + /** + * LoggingSettings cloudLoggingSettings. + * @member {google.cloud.ces.v1beta.ICloudLoggingSettings|null|undefined} cloudLoggingSettings + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @instance + */ + LoggingSettings.prototype.cloudLoggingSettings = null; + + /** + * LoggingSettings conversationLoggingSettings. + * @member {google.cloud.ces.v1beta.IConversationLoggingSettings|null|undefined} conversationLoggingSettings + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @instance + */ + LoggingSettings.prototype.conversationLoggingSettings = null; + + /** + * LoggingSettings evaluationAudioRecordingConfig. + * @member {google.cloud.ces.v1beta.IAudioRecordingConfig|null|undefined} evaluationAudioRecordingConfig + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @instance + */ + LoggingSettings.prototype.evaluationAudioRecordingConfig = null; + + /** + * LoggingSettings metricAnalysisSettings. + * @member {google.cloud.ces.v1beta.IMetricAnalysisSettings|null|undefined} metricAnalysisSettings + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @instance + */ + LoggingSettings.prototype.metricAnalysisSettings = null; + + /** + * Creates a new LoggingSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @static + * @param {google.cloud.ces.v1beta.ILoggingSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.LoggingSettings} LoggingSettings instance + */ + LoggingSettings.create = function create(properties) { + return new LoggingSettings(properties); + }; + + /** + * Encodes the specified LoggingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.LoggingSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @static + * @param {google.cloud.ces.v1beta.ILoggingSettings} message LoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.redactionConfig != null && Object.hasOwnProperty.call(message, "redactionConfig")) + $root.google.cloud.ces.v1beta.RedactionConfig.encode(message.redactionConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audioRecordingConfig != null && Object.hasOwnProperty.call(message, "audioRecordingConfig")) + $root.google.cloud.ces.v1beta.AudioRecordingConfig.encode(message.audioRecordingConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bigqueryExportSettings != null && Object.hasOwnProperty.call(message, "bigqueryExportSettings")) + $root.google.cloud.ces.v1beta.BigQueryExportSettings.encode(message.bigqueryExportSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cloudLoggingSettings != null && Object.hasOwnProperty.call(message, "cloudLoggingSettings")) + $root.google.cloud.ces.v1beta.CloudLoggingSettings.encode(message.cloudLoggingSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.conversationLoggingSettings != null && Object.hasOwnProperty.call(message, "conversationLoggingSettings")) + $root.google.cloud.ces.v1beta.ConversationLoggingSettings.encode(message.conversationLoggingSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.evaluationAudioRecordingConfig != null && Object.hasOwnProperty.call(message, "evaluationAudioRecordingConfig")) + $root.google.cloud.ces.v1beta.AudioRecordingConfig.encode(message.evaluationAudioRecordingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.metricAnalysisSettings != null && Object.hasOwnProperty.call(message, "metricAnalysisSettings")) + $root.google.cloud.ces.v1beta.MetricAnalysisSettings.encode(message.metricAnalysisSettings, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LoggingSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @static + * @param {google.cloud.ces.v1beta.ILoggingSettings} message LoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.LoggingSettings} LoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LoggingSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.redactionConfig = $root.google.cloud.ces.v1beta.RedactionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.audioRecordingConfig = $root.google.cloud.ces.v1beta.AudioRecordingConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.bigqueryExportSettings = $root.google.cloud.ces.v1beta.BigQueryExportSettings.decode(reader, reader.uint32()); + break; + } + case 4: { + message.cloudLoggingSettings = $root.google.cloud.ces.v1beta.CloudLoggingSettings.decode(reader, reader.uint32()); + break; + } + case 5: { + message.conversationLoggingSettings = $root.google.cloud.ces.v1beta.ConversationLoggingSettings.decode(reader, reader.uint32()); + break; + } + case 6: { + message.evaluationAudioRecordingConfig = $root.google.cloud.ces.v1beta.AudioRecordingConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.metricAnalysisSettings = $root.google.cloud.ces.v1beta.MetricAnalysisSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LoggingSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.LoggingSettings} LoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoggingSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoggingSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.redactionConfig != null && message.hasOwnProperty("redactionConfig")) { + var error = $root.google.cloud.ces.v1beta.RedactionConfig.verify(message.redactionConfig); + if (error) + return "redactionConfig." + error; + } + if (message.audioRecordingConfig != null && message.hasOwnProperty("audioRecordingConfig")) { + var error = $root.google.cloud.ces.v1beta.AudioRecordingConfig.verify(message.audioRecordingConfig); + if (error) + return "audioRecordingConfig." + error; + } + if (message.bigqueryExportSettings != null && message.hasOwnProperty("bigqueryExportSettings")) { + var error = $root.google.cloud.ces.v1beta.BigQueryExportSettings.verify(message.bigqueryExportSettings); + if (error) + return "bigqueryExportSettings." + error; + } + if (message.cloudLoggingSettings != null && message.hasOwnProperty("cloudLoggingSettings")) { + var error = $root.google.cloud.ces.v1beta.CloudLoggingSettings.verify(message.cloudLoggingSettings); + if (error) + return "cloudLoggingSettings." + error; + } + if (message.conversationLoggingSettings != null && message.hasOwnProperty("conversationLoggingSettings")) { + var error = $root.google.cloud.ces.v1beta.ConversationLoggingSettings.verify(message.conversationLoggingSettings); + if (error) + return "conversationLoggingSettings." + error; + } + if (message.evaluationAudioRecordingConfig != null && message.hasOwnProperty("evaluationAudioRecordingConfig")) { + var error = $root.google.cloud.ces.v1beta.AudioRecordingConfig.verify(message.evaluationAudioRecordingConfig); + if (error) + return "evaluationAudioRecordingConfig." + error; + } + if (message.metricAnalysisSettings != null && message.hasOwnProperty("metricAnalysisSettings")) { + var error = $root.google.cloud.ces.v1beta.MetricAnalysisSettings.verify(message.metricAnalysisSettings); + if (error) + return "metricAnalysisSettings." + error; + } + return null; + }; + + /** + * Creates a LoggingSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.LoggingSettings} LoggingSettings + */ + LoggingSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.LoggingSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.LoggingSettings(); + if (object.redactionConfig != null) { + if (typeof object.redactionConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.redactionConfig: object expected"); + message.redactionConfig = $root.google.cloud.ces.v1beta.RedactionConfig.fromObject(object.redactionConfig); + } + if (object.audioRecordingConfig != null) { + if (typeof object.audioRecordingConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.audioRecordingConfig: object expected"); + message.audioRecordingConfig = $root.google.cloud.ces.v1beta.AudioRecordingConfig.fromObject(object.audioRecordingConfig); + } + if (object.bigqueryExportSettings != null) { + if (typeof object.bigqueryExportSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.bigqueryExportSettings: object expected"); + message.bigqueryExportSettings = $root.google.cloud.ces.v1beta.BigQueryExportSettings.fromObject(object.bigqueryExportSettings); + } + if (object.cloudLoggingSettings != null) { + if (typeof object.cloudLoggingSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.cloudLoggingSettings: object expected"); + message.cloudLoggingSettings = $root.google.cloud.ces.v1beta.CloudLoggingSettings.fromObject(object.cloudLoggingSettings); + } + if (object.conversationLoggingSettings != null) { + if (typeof object.conversationLoggingSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.conversationLoggingSettings: object expected"); + message.conversationLoggingSettings = $root.google.cloud.ces.v1beta.ConversationLoggingSettings.fromObject(object.conversationLoggingSettings); + } + if (object.evaluationAudioRecordingConfig != null) { + if (typeof object.evaluationAudioRecordingConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.evaluationAudioRecordingConfig: object expected"); + message.evaluationAudioRecordingConfig = $root.google.cloud.ces.v1beta.AudioRecordingConfig.fromObject(object.evaluationAudioRecordingConfig); + } + if (object.metricAnalysisSettings != null) { + if (typeof object.metricAnalysisSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.LoggingSettings.metricAnalysisSettings: object expected"); + message.metricAnalysisSettings = $root.google.cloud.ces.v1beta.MetricAnalysisSettings.fromObject(object.metricAnalysisSettings); + } + return message; + }; + + /** + * Creates a plain object from a LoggingSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @static + * @param {google.cloud.ces.v1beta.LoggingSettings} message LoggingSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoggingSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.redactionConfig = null; + object.audioRecordingConfig = null; + object.bigqueryExportSettings = null; + object.cloudLoggingSettings = null; + object.conversationLoggingSettings = null; + object.evaluationAudioRecordingConfig = null; + object.metricAnalysisSettings = null; + } + if (message.redactionConfig != null && message.hasOwnProperty("redactionConfig")) + object.redactionConfig = $root.google.cloud.ces.v1beta.RedactionConfig.toObject(message.redactionConfig, options); + if (message.audioRecordingConfig != null && message.hasOwnProperty("audioRecordingConfig")) + object.audioRecordingConfig = $root.google.cloud.ces.v1beta.AudioRecordingConfig.toObject(message.audioRecordingConfig, options); + if (message.bigqueryExportSettings != null && message.hasOwnProperty("bigqueryExportSettings")) + object.bigqueryExportSettings = $root.google.cloud.ces.v1beta.BigQueryExportSettings.toObject(message.bigqueryExportSettings, options); + if (message.cloudLoggingSettings != null && message.hasOwnProperty("cloudLoggingSettings")) + object.cloudLoggingSettings = $root.google.cloud.ces.v1beta.CloudLoggingSettings.toObject(message.cloudLoggingSettings, options); + if (message.conversationLoggingSettings != null && message.hasOwnProperty("conversationLoggingSettings")) + object.conversationLoggingSettings = $root.google.cloud.ces.v1beta.ConversationLoggingSettings.toObject(message.conversationLoggingSettings, options); + if (message.evaluationAudioRecordingConfig != null && message.hasOwnProperty("evaluationAudioRecordingConfig")) + object.evaluationAudioRecordingConfig = $root.google.cloud.ces.v1beta.AudioRecordingConfig.toObject(message.evaluationAudioRecordingConfig, options); + if (message.metricAnalysisSettings != null && message.hasOwnProperty("metricAnalysisSettings")) + object.metricAnalysisSettings = $root.google.cloud.ces.v1beta.MetricAnalysisSettings.toObject(message.metricAnalysisSettings, options); + return object; + }; + + /** + * Converts this LoggingSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @instance + * @returns {Object.} JSON object + */ + LoggingSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoggingSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.LoggingSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoggingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.LoggingSettings"; + }; + + return LoggingSettings; + })(); + + v1beta.ErrorHandlingSettings = (function() { + + /** + * Properties of an ErrorHandlingSettings. + * @memberof google.cloud.ces.v1beta + * @interface IErrorHandlingSettings + * @property {google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy|null} [errorHandlingStrategy] ErrorHandlingSettings errorHandlingStrategy + */ + + /** + * Constructs a new ErrorHandlingSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ErrorHandlingSettings. + * @implements IErrorHandlingSettings + * @constructor + * @param {google.cloud.ces.v1beta.IErrorHandlingSettings=} [properties] Properties to set + */ + function ErrorHandlingSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ErrorHandlingSettings errorHandlingStrategy. + * @member {google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy} errorHandlingStrategy + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @instance + */ + ErrorHandlingSettings.prototype.errorHandlingStrategy = 0; + + /** + * Creates a new ErrorHandlingSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @static + * @param {google.cloud.ces.v1beta.IErrorHandlingSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ErrorHandlingSettings} ErrorHandlingSettings instance + */ + ErrorHandlingSettings.create = function create(properties) { + return new ErrorHandlingSettings(properties); + }; + + /** + * Encodes the specified ErrorHandlingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ErrorHandlingSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @static + * @param {google.cloud.ces.v1beta.IErrorHandlingSettings} message ErrorHandlingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorHandlingSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorHandlingStrategy != null && Object.hasOwnProperty.call(message, "errorHandlingStrategy")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.errorHandlingStrategy); + return writer; + }; + + /** + * Encodes the specified ErrorHandlingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ErrorHandlingSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @static + * @param {google.cloud.ces.v1beta.IErrorHandlingSettings} message ErrorHandlingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorHandlingSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ErrorHandlingSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ErrorHandlingSettings} ErrorHandlingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorHandlingSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ErrorHandlingSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.errorHandlingStrategy = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ErrorHandlingSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ErrorHandlingSettings} ErrorHandlingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorHandlingSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ErrorHandlingSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ErrorHandlingSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorHandlingStrategy != null && message.hasOwnProperty("errorHandlingStrategy")) + switch (message.errorHandlingStrategy) { + default: + return "errorHandlingStrategy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ErrorHandlingSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ErrorHandlingSettings} ErrorHandlingSettings + */ + ErrorHandlingSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ErrorHandlingSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.ErrorHandlingSettings(); + switch (object.errorHandlingStrategy) { + default: + if (typeof object.errorHandlingStrategy === "number") { + message.errorHandlingStrategy = object.errorHandlingStrategy; + break; + } + break; + case "ERROR_HANDLING_STRATEGY_UNSPECIFIED": + case 0: + message.errorHandlingStrategy = 0; + break; + case "NONE": + case 1: + message.errorHandlingStrategy = 1; + break; + case "FALLBACK_RESPONSE": + case 2: + message.errorHandlingStrategy = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ErrorHandlingSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @static + * @param {google.cloud.ces.v1beta.ErrorHandlingSettings} message ErrorHandlingSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ErrorHandlingSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.errorHandlingStrategy = options.enums === String ? "ERROR_HANDLING_STRATEGY_UNSPECIFIED" : 0; + if (message.errorHandlingStrategy != null && message.hasOwnProperty("errorHandlingStrategy")) + object.errorHandlingStrategy = options.enums === String ? $root.google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy[message.errorHandlingStrategy] === undefined ? message.errorHandlingStrategy : $root.google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy[message.errorHandlingStrategy] : message.errorHandlingStrategy; + return object; + }; + + /** + * Converts this ErrorHandlingSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @instance + * @returns {Object.} JSON object + */ + ErrorHandlingSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ErrorHandlingSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ErrorHandlingSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ErrorHandlingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ErrorHandlingSettings"; + }; + + /** + * ErrorHandlingStrategy enum. + * @name google.cloud.ces.v1beta.ErrorHandlingSettings.ErrorHandlingStrategy + * @enum {number} + * @property {number} ERROR_HANDLING_STRATEGY_UNSPECIFIED=0 ERROR_HANDLING_STRATEGY_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} FALLBACK_RESPONSE=2 FALLBACK_RESPONSE value + */ + ErrorHandlingSettings.ErrorHandlingStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ERROR_HANDLING_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "FALLBACK_RESPONSE"] = 2; + return values; + })(); + + return ErrorHandlingSettings; + })(); + + v1beta.EvaluationMetricsThresholds = (function() { + + /** + * Properties of an EvaluationMetricsThresholds. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluationMetricsThresholds + * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null} [goldenEvaluationMetricsThresholds] EvaluationMetricsThresholds goldenEvaluationMetricsThresholds + * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|null} [hallucinationMetricBehavior] EvaluationMetricsThresholds hallucinationMetricBehavior + * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|null} [goldenHallucinationMetricBehavior] EvaluationMetricsThresholds goldenHallucinationMetricBehavior + * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior|null} [scenarioHallucinationMetricBehavior] EvaluationMetricsThresholds scenarioHallucinationMetricBehavior + */ + + /** + * Constructs a new EvaluationMetricsThresholds. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationMetricsThresholds. + * @implements IEvaluationMetricsThresholds + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluationMetricsThresholds=} [properties] Properties to set + */ + function EvaluationMetricsThresholds(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationMetricsThresholds goldenEvaluationMetricsThresholds. + * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds|null|undefined} goldenEvaluationMetricsThresholds + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @instance + */ + EvaluationMetricsThresholds.prototype.goldenEvaluationMetricsThresholds = null; + + /** + * EvaluationMetricsThresholds hallucinationMetricBehavior. + * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior} hallucinationMetricBehavior + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @instance + */ + EvaluationMetricsThresholds.prototype.hallucinationMetricBehavior = 0; + + /** + * EvaluationMetricsThresholds goldenHallucinationMetricBehavior. + * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior} goldenHallucinationMetricBehavior + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @instance + */ + EvaluationMetricsThresholds.prototype.goldenHallucinationMetricBehavior = 0; + + /** + * EvaluationMetricsThresholds scenarioHallucinationMetricBehavior. + * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior} scenarioHallucinationMetricBehavior + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @instance + */ + EvaluationMetricsThresholds.prototype.scenarioHallucinationMetricBehavior = 0; + + /** + * Creates a new EvaluationMetricsThresholds instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.IEvaluationMetricsThresholds=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds} EvaluationMetricsThresholds instance + */ + EvaluationMetricsThresholds.create = function create(properties) { + return new EvaluationMetricsThresholds(properties); + }; + + /** + * Encodes the specified EvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.IEvaluationMetricsThresholds} message EvaluationMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationMetricsThresholds.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.goldenEvaluationMetricsThresholds != null && Object.hasOwnProperty.call(message, "goldenEvaluationMetricsThresholds")) + $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.encode(message.goldenEvaluationMetricsThresholds, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.hallucinationMetricBehavior != null && Object.hasOwnProperty.call(message, "hallucinationMetricBehavior")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.hallucinationMetricBehavior); + if (message.scenarioHallucinationMetricBehavior != null && Object.hasOwnProperty.call(message, "scenarioHallucinationMetricBehavior")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.scenarioHallucinationMetricBehavior); + if (message.goldenHallucinationMetricBehavior != null && Object.hasOwnProperty.call(message, "goldenHallucinationMetricBehavior")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.goldenHallucinationMetricBehavior); + return writer; + }; + + /** + * Encodes the specified EvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.IEvaluationMetricsThresholds} message EvaluationMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds} EvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationMetricsThresholds.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.goldenEvaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.decode(reader, reader.uint32()); + break; + } + case 3: { + message.hallucinationMetricBehavior = reader.int32(); + break; + } + case 5: { + message.goldenHallucinationMetricBehavior = reader.int32(); + break; + } + case 4: { + message.scenarioHallucinationMetricBehavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationMetricsThresholds message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds} EvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationMetricsThresholds message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationMetricsThresholds.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.goldenEvaluationMetricsThresholds != null && message.hasOwnProperty("goldenEvaluationMetricsThresholds")) { + var error = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify(message.goldenEvaluationMetricsThresholds); + if (error) + return "goldenEvaluationMetricsThresholds." + error; + } + if (message.hallucinationMetricBehavior != null && message.hasOwnProperty("hallucinationMetricBehavior")) + switch (message.hallucinationMetricBehavior) { + default: + return "hallucinationMetricBehavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.goldenHallucinationMetricBehavior != null && message.hasOwnProperty("goldenHallucinationMetricBehavior")) + switch (message.goldenHallucinationMetricBehavior) { + default: + return "goldenHallucinationMetricBehavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.scenarioHallucinationMetricBehavior != null && message.hasOwnProperty("scenarioHallucinationMetricBehavior")) + switch (message.scenarioHallucinationMetricBehavior) { + default: + return "scenarioHallucinationMetricBehavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an EvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds} EvaluationMetricsThresholds + */ + EvaluationMetricsThresholds.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds(); + if (object.goldenEvaluationMetricsThresholds != null) { + if (typeof object.goldenEvaluationMetricsThresholds !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationMetricsThresholds.goldenEvaluationMetricsThresholds: object expected"); + message.goldenEvaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.fromObject(object.goldenEvaluationMetricsThresholds); + } + switch (object.hallucinationMetricBehavior) { + default: + if (typeof object.hallucinationMetricBehavior === "number") { + message.hallucinationMetricBehavior = object.hallucinationMetricBehavior; + break; + } + break; + case "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": + case 0: + message.hallucinationMetricBehavior = 0; + break; + case "DISABLED": + case 1: + message.hallucinationMetricBehavior = 1; + break; + case "ENABLED": + case 2: + message.hallucinationMetricBehavior = 2; + break; + } + switch (object.goldenHallucinationMetricBehavior) { + default: + if (typeof object.goldenHallucinationMetricBehavior === "number") { + message.goldenHallucinationMetricBehavior = object.goldenHallucinationMetricBehavior; + break; + } + break; + case "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": + case 0: + message.goldenHallucinationMetricBehavior = 0; + break; + case "DISABLED": + case 1: + message.goldenHallucinationMetricBehavior = 1; + break; + case "ENABLED": + case 2: + message.goldenHallucinationMetricBehavior = 2; + break; + } + switch (object.scenarioHallucinationMetricBehavior) { + default: + if (typeof object.scenarioHallucinationMetricBehavior === "number") { + message.scenarioHallucinationMetricBehavior = object.scenarioHallucinationMetricBehavior; + break; + } + break; + case "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": + case 0: + message.scenarioHallucinationMetricBehavior = 0; + break; + case "DISABLED": + case 1: + message.scenarioHallucinationMetricBehavior = 1; + break; + case "ENABLED": + case 2: + message.scenarioHallucinationMetricBehavior = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an EvaluationMetricsThresholds message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds} message EvaluationMetricsThresholds + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationMetricsThresholds.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.goldenEvaluationMetricsThresholds = null; + object.hallucinationMetricBehavior = options.enums === String ? "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" : 0; + object.scenarioHallucinationMetricBehavior = options.enums === String ? "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" : 0; + object.goldenHallucinationMetricBehavior = options.enums === String ? "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED" : 0; + } + if (message.goldenEvaluationMetricsThresholds != null && message.hasOwnProperty("goldenEvaluationMetricsThresholds")) + object.goldenEvaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.toObject(message.goldenEvaluationMetricsThresholds, options); + if (message.hallucinationMetricBehavior != null && message.hasOwnProperty("hallucinationMetricBehavior")) + object.hallucinationMetricBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.hallucinationMetricBehavior] === undefined ? message.hallucinationMetricBehavior : $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.hallucinationMetricBehavior] : message.hallucinationMetricBehavior; + if (message.scenarioHallucinationMetricBehavior != null && message.hasOwnProperty("scenarioHallucinationMetricBehavior")) + object.scenarioHallucinationMetricBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.scenarioHallucinationMetricBehavior] === undefined ? message.scenarioHallucinationMetricBehavior : $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.scenarioHallucinationMetricBehavior] : message.scenarioHallucinationMetricBehavior; + if (message.goldenHallucinationMetricBehavior != null && message.hasOwnProperty("goldenHallucinationMetricBehavior")) + object.goldenHallucinationMetricBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.goldenHallucinationMetricBehavior] === undefined ? message.goldenHallucinationMetricBehavior : $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior[message.goldenHallucinationMetricBehavior] : message.goldenHallucinationMetricBehavior; + return object; + }; + + /** + * Converts this EvaluationMetricsThresholds to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @instance + * @returns {Object.} JSON object + */ + EvaluationMetricsThresholds.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationMetricsThresholds + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationMetricsThresholds"; + }; + + EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds = (function() { + + /** + * Properties of a GoldenEvaluationMetricsThresholds. + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @interface IGoldenEvaluationMetricsThresholds + * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null} [turnLevelMetricsThresholds] GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds + * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null} [expectationLevelMetricsThresholds] GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds + * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings|null} [toolMatchingSettings] GoldenEvaluationMetricsThresholds toolMatchingSettings + */ + + /** + * Constructs a new GoldenEvaluationMetricsThresholds. + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @classdesc Represents a GoldenEvaluationMetricsThresholds. + * @implements IGoldenEvaluationMetricsThresholds + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds=} [properties] Properties to set + */ + function GoldenEvaluationMetricsThresholds(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoldenEvaluationMetricsThresholds turnLevelMetricsThresholds. + * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds|null|undefined} turnLevelMetricsThresholds + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @instance + */ + GoldenEvaluationMetricsThresholds.prototype.turnLevelMetricsThresholds = null; + + /** + * GoldenEvaluationMetricsThresholds expectationLevelMetricsThresholds. + * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds|null|undefined} expectationLevelMetricsThresholds + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @instance + */ + GoldenEvaluationMetricsThresholds.prototype.expectationLevelMetricsThresholds = null; + + /** + * GoldenEvaluationMetricsThresholds toolMatchingSettings. + * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings|null|undefined} toolMatchingSettings + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @instance + */ + GoldenEvaluationMetricsThresholds.prototype.toolMatchingSettings = null; + + /** + * Creates a new GoldenEvaluationMetricsThresholds instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds instance + */ + GoldenEvaluationMetricsThresholds.create = function create(properties) { + return new GoldenEvaluationMetricsThresholds(properties); + }; + + /** + * Encodes the specified GoldenEvaluationMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds} message GoldenEvaluationMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenEvaluationMetricsThresholds.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.turnLevelMetricsThresholds != null && Object.hasOwnProperty.call(message, "turnLevelMetricsThresholds")) + $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.encode(message.turnLevelMetricsThresholds, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.expectationLevelMetricsThresholds != null && Object.hasOwnProperty.call(message, "expectationLevelMetricsThresholds")) + $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.encode(message.expectationLevelMetricsThresholds, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolMatchingSettings != null && Object.hasOwnProperty.call(message, "toolMatchingSettings")) + $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.encode(message.toolMatchingSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoldenEvaluationMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IGoldenEvaluationMetricsThresholds} message GoldenEvaluationMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenEvaluationMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenEvaluationMetricsThresholds.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.turnLevelMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.decode(reader, reader.uint32()); + break; + } + case 2: { + message.expectationLevelMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.decode(reader, reader.uint32()); + break; + } + case 3: { + message.toolMatchingSettings = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoldenEvaluationMetricsThresholds message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenEvaluationMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoldenEvaluationMetricsThresholds message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoldenEvaluationMetricsThresholds.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.turnLevelMetricsThresholds != null && message.hasOwnProperty("turnLevelMetricsThresholds")) { + var error = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify(message.turnLevelMetricsThresholds); + if (error) + return "turnLevelMetricsThresholds." + error; + } + if (message.expectationLevelMetricsThresholds != null && message.hasOwnProperty("expectationLevelMetricsThresholds")) { + var error = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify(message.expectationLevelMetricsThresholds); + if (error) + return "expectationLevelMetricsThresholds." + error; + } + if (message.toolMatchingSettings != null && message.hasOwnProperty("toolMatchingSettings")) { + var error = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.verify(message.toolMatchingSettings); + if (error) + return "toolMatchingSettings." + error; + } + return null; + }; + + /** + * Creates a GoldenEvaluationMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} GoldenEvaluationMetricsThresholds + */ + GoldenEvaluationMetricsThresholds.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds(); + if (object.turnLevelMetricsThresholds != null) { + if (typeof object.turnLevelMetricsThresholds !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.turnLevelMetricsThresholds: object expected"); + message.turnLevelMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.fromObject(object.turnLevelMetricsThresholds); + } + if (object.expectationLevelMetricsThresholds != null) { + if (typeof object.expectationLevelMetricsThresholds !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.expectationLevelMetricsThresholds: object expected"); + message.expectationLevelMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.fromObject(object.expectationLevelMetricsThresholds); + } + if (object.toolMatchingSettings != null) { + if (typeof object.toolMatchingSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.toolMatchingSettings: object expected"); + message.toolMatchingSettings = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.fromObject(object.toolMatchingSettings); + } + return message; + }; + + /** + * Creates a plain object from a GoldenEvaluationMetricsThresholds message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds} message GoldenEvaluationMetricsThresholds + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoldenEvaluationMetricsThresholds.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.turnLevelMetricsThresholds = null; + object.expectationLevelMetricsThresholds = null; + object.toolMatchingSettings = null; + } + if (message.turnLevelMetricsThresholds != null && message.hasOwnProperty("turnLevelMetricsThresholds")) + object.turnLevelMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.toObject(message.turnLevelMetricsThresholds, options); + if (message.expectationLevelMetricsThresholds != null && message.hasOwnProperty("expectationLevelMetricsThresholds")) + object.expectationLevelMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.toObject(message.expectationLevelMetricsThresholds, options); + if (message.toolMatchingSettings != null && message.hasOwnProperty("toolMatchingSettings")) + object.toolMatchingSettings = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.toObject(message.toolMatchingSettings, options); + return object; + }; + + /** + * Converts this GoldenEvaluationMetricsThresholds to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @instance + * @returns {Object.} JSON object + */ + GoldenEvaluationMetricsThresholds.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoldenEvaluationMetricsThresholds + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoldenEvaluationMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds"; + }; + + GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds = (function() { + + /** + * Properties of a TurnLevelMetricsThresholds. + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @interface ITurnLevelMetricsThresholds + * @property {number|null} [semanticSimilaritySuccessThreshold] TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold + * @property {number|null} [overallToolInvocationCorrectnessThreshold] TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold + * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel|null} [semanticSimilarityChannel] TurnLevelMetricsThresholds semanticSimilarityChannel + */ + + /** + * Constructs a new TurnLevelMetricsThresholds. + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @classdesc Represents a TurnLevelMetricsThresholds. + * @implements ITurnLevelMetricsThresholds + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds=} [properties] Properties to set + */ + function TurnLevelMetricsThresholds(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TurnLevelMetricsThresholds semanticSimilaritySuccessThreshold. + * @member {number|null|undefined} semanticSimilaritySuccessThreshold + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @instance + */ + TurnLevelMetricsThresholds.prototype.semanticSimilaritySuccessThreshold = null; + + /** + * TurnLevelMetricsThresholds overallToolInvocationCorrectnessThreshold. + * @member {number|null|undefined} overallToolInvocationCorrectnessThreshold + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @instance + */ + TurnLevelMetricsThresholds.prototype.overallToolInvocationCorrectnessThreshold = null; + + /** + * TurnLevelMetricsThresholds semanticSimilarityChannel. + * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel} semanticSimilarityChannel + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @instance + */ + TurnLevelMetricsThresholds.prototype.semanticSimilarityChannel = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TurnLevelMetricsThresholds.prototype, "_semanticSimilaritySuccessThreshold", { + get: $util.oneOfGetter($oneOfFields = ["semanticSimilaritySuccessThreshold"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TurnLevelMetricsThresholds.prototype, "_overallToolInvocationCorrectnessThreshold", { + get: $util.oneOfGetter($oneOfFields = ["overallToolInvocationCorrectnessThreshold"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TurnLevelMetricsThresholds instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds instance + */ + TurnLevelMetricsThresholds.create = function create(properties) { + return new TurnLevelMetricsThresholds(properties); + }; + + /** + * Encodes the specified TurnLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds} message TurnLevelMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TurnLevelMetricsThresholds.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.semanticSimilaritySuccessThreshold != null && Object.hasOwnProperty.call(message, "semanticSimilaritySuccessThreshold")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.semanticSimilaritySuccessThreshold); + if (message.overallToolInvocationCorrectnessThreshold != null && Object.hasOwnProperty.call(message, "overallToolInvocationCorrectnessThreshold")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.overallToolInvocationCorrectnessThreshold); + if (message.semanticSimilarityChannel != null && Object.hasOwnProperty.call(message, "semanticSimilarityChannel")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.semanticSimilarityChannel); + return writer; + }; + + /** + * Encodes the specified TurnLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ITurnLevelMetricsThresholds} message TurnLevelMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TurnLevelMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TurnLevelMetricsThresholds.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.semanticSimilaritySuccessThreshold = reader.int32(); + break; + } + case 2: { + message.overallToolInvocationCorrectnessThreshold = reader.float(); + break; + } + case 3: { + message.semanticSimilarityChannel = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TurnLevelMetricsThresholds message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TurnLevelMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TurnLevelMetricsThresholds message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TurnLevelMetricsThresholds.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.semanticSimilaritySuccessThreshold != null && message.hasOwnProperty("semanticSimilaritySuccessThreshold")) { + properties._semanticSimilaritySuccessThreshold = 1; + if (!$util.isInteger(message.semanticSimilaritySuccessThreshold)) + return "semanticSimilaritySuccessThreshold: integer expected"; + } + if (message.overallToolInvocationCorrectnessThreshold != null && message.hasOwnProperty("overallToolInvocationCorrectnessThreshold")) { + properties._overallToolInvocationCorrectnessThreshold = 1; + if (typeof message.overallToolInvocationCorrectnessThreshold !== "number") + return "overallToolInvocationCorrectnessThreshold: number expected"; + } + if (message.semanticSimilarityChannel != null && message.hasOwnProperty("semanticSimilarityChannel")) + switch (message.semanticSimilarityChannel) { + default: + return "semanticSimilarityChannel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TurnLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} TurnLevelMetricsThresholds + */ + TurnLevelMetricsThresholds.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds(); + if (object.semanticSimilaritySuccessThreshold != null) + message.semanticSimilaritySuccessThreshold = object.semanticSimilaritySuccessThreshold | 0; + if (object.overallToolInvocationCorrectnessThreshold != null) + message.overallToolInvocationCorrectnessThreshold = Number(object.overallToolInvocationCorrectnessThreshold); + switch (object.semanticSimilarityChannel) { + default: + if (typeof object.semanticSimilarityChannel === "number") { + message.semanticSimilarityChannel = object.semanticSimilarityChannel; + break; + } + break; + case "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED": + case 0: + message.semanticSimilarityChannel = 0; + break; + case "TEXT": + case 1: + message.semanticSimilarityChannel = 1; + break; + case "AUDIO": + case 2: + message.semanticSimilarityChannel = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TurnLevelMetricsThresholds message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds} message TurnLevelMetricsThresholds + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TurnLevelMetricsThresholds.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.semanticSimilarityChannel = options.enums === String ? "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED" : 0; + if (message.semanticSimilaritySuccessThreshold != null && message.hasOwnProperty("semanticSimilaritySuccessThreshold")) { + object.semanticSimilaritySuccessThreshold = message.semanticSimilaritySuccessThreshold; + if (options.oneofs) + object._semanticSimilaritySuccessThreshold = "semanticSimilaritySuccessThreshold"; + } + if (message.overallToolInvocationCorrectnessThreshold != null && message.hasOwnProperty("overallToolInvocationCorrectnessThreshold")) { + object.overallToolInvocationCorrectnessThreshold = options.json && !isFinite(message.overallToolInvocationCorrectnessThreshold) ? String(message.overallToolInvocationCorrectnessThreshold) : message.overallToolInvocationCorrectnessThreshold; + if (options.oneofs) + object._overallToolInvocationCorrectnessThreshold = "overallToolInvocationCorrectnessThreshold"; + } + if (message.semanticSimilarityChannel != null && message.hasOwnProperty("semanticSimilarityChannel")) + object.semanticSimilarityChannel = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel[message.semanticSimilarityChannel] === undefined ? message.semanticSimilarityChannel : $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel[message.semanticSimilarityChannel] : message.semanticSimilarityChannel; + return object; + }; + + /** + * Converts this TurnLevelMetricsThresholds to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @instance + * @returns {Object.} JSON object + */ + TurnLevelMetricsThresholds.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TurnLevelMetricsThresholds + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TurnLevelMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds"; + }; + + /** + * SemanticSimilarityChannel enum. + * @name google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.TurnLevelMetricsThresholds.SemanticSimilarityChannel + * @enum {number} + * @property {number} SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED=0 SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED value + * @property {number} TEXT=1 TEXT value + * @property {number} AUDIO=2 AUDIO value + */ + TurnLevelMetricsThresholds.SemanticSimilarityChannel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "AUDIO"] = 2; + return values; + })(); + + return TurnLevelMetricsThresholds; + })(); + + GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds = (function() { + + /** + * Properties of an ExpectationLevelMetricsThresholds. + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @interface IExpectationLevelMetricsThresholds + * @property {number|null} [toolInvocationParameterCorrectnessThreshold] ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold + */ + + /** + * Constructs a new ExpectationLevelMetricsThresholds. + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds + * @classdesc Represents an ExpectationLevelMetricsThresholds. + * @implements IExpectationLevelMetricsThresholds + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds=} [properties] Properties to set + */ + function ExpectationLevelMetricsThresholds(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExpectationLevelMetricsThresholds toolInvocationParameterCorrectnessThreshold. + * @member {number|null|undefined} toolInvocationParameterCorrectnessThreshold + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @instance + */ + ExpectationLevelMetricsThresholds.prototype.toolInvocationParameterCorrectnessThreshold = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExpectationLevelMetricsThresholds.prototype, "_toolInvocationParameterCorrectnessThreshold", { + get: $util.oneOfGetter($oneOfFields = ["toolInvocationParameterCorrectnessThreshold"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExpectationLevelMetricsThresholds instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds instance + */ + ExpectationLevelMetricsThresholds.create = function create(properties) { + return new ExpectationLevelMetricsThresholds(properties); + }; + + /** + * Encodes the specified ExpectationLevelMetricsThresholds message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds} message ExpectationLevelMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpectationLevelMetricsThresholds.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolInvocationParameterCorrectnessThreshold != null && Object.hasOwnProperty.call(message, "toolInvocationParameterCorrectnessThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.toolInvocationParameterCorrectnessThreshold); + return writer; + }; + + /** + * Encodes the specified ExpectationLevelMetricsThresholds message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.IExpectationLevelMetricsThresholds} message ExpectationLevelMetricsThresholds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpectationLevelMetricsThresholds.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpectationLevelMetricsThresholds.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolInvocationParameterCorrectnessThreshold = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExpectationLevelMetricsThresholds message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpectationLevelMetricsThresholds.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExpectationLevelMetricsThresholds message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExpectationLevelMetricsThresholds.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.toolInvocationParameterCorrectnessThreshold != null && message.hasOwnProperty("toolInvocationParameterCorrectnessThreshold")) { + properties._toolInvocationParameterCorrectnessThreshold = 1; + if (typeof message.toolInvocationParameterCorrectnessThreshold !== "number") + return "toolInvocationParameterCorrectnessThreshold: number expected"; + } + return null; + }; + + /** + * Creates an ExpectationLevelMetricsThresholds message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} ExpectationLevelMetricsThresholds + */ + ExpectationLevelMetricsThresholds.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds(); + if (object.toolInvocationParameterCorrectnessThreshold != null) + message.toolInvocationParameterCorrectnessThreshold = Number(object.toolInvocationParameterCorrectnessThreshold); + return message; + }; + + /** + * Creates a plain object from an ExpectationLevelMetricsThresholds message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds} message ExpectationLevelMetricsThresholds + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExpectationLevelMetricsThresholds.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.toolInvocationParameterCorrectnessThreshold != null && message.hasOwnProperty("toolInvocationParameterCorrectnessThreshold")) { + object.toolInvocationParameterCorrectnessThreshold = options.json && !isFinite(message.toolInvocationParameterCorrectnessThreshold) ? String(message.toolInvocationParameterCorrectnessThreshold) : message.toolInvocationParameterCorrectnessThreshold; + if (options.oneofs) + object._toolInvocationParameterCorrectnessThreshold = "toolInvocationParameterCorrectnessThreshold"; + } + return object; + }; + + /** + * Converts this ExpectationLevelMetricsThresholds to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @instance + * @returns {Object.} JSON object + */ + ExpectationLevelMetricsThresholds.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExpectationLevelMetricsThresholds + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExpectationLevelMetricsThresholds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationMetricsThresholds.GoldenEvaluationMetricsThresholds.ExpectationLevelMetricsThresholds"; + }; + + return ExpectationLevelMetricsThresholds; + })(); + + return GoldenEvaluationMetricsThresholds; + })(); + + EvaluationMetricsThresholds.ToolMatchingSettings = (function() { + + /** + * Properties of a ToolMatchingSettings. + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @interface IToolMatchingSettings + * @property {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior|null} [extraToolCallBehavior] ToolMatchingSettings extraToolCallBehavior + */ + + /** + * Constructs a new ToolMatchingSettings. + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds + * @classdesc Represents a ToolMatchingSettings. + * @implements IToolMatchingSettings + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings=} [properties] Properties to set + */ + function ToolMatchingSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolMatchingSettings extraToolCallBehavior. + * @member {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior} extraToolCallBehavior + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @instance + */ + ToolMatchingSettings.prototype.extraToolCallBehavior = 0; + + /** + * Creates a new ToolMatchingSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings instance + */ + ToolMatchingSettings.create = function create(properties) { + return new ToolMatchingSettings(properties); + }; + + /** + * Encodes the specified ToolMatchingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings} message ToolMatchingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolMatchingSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.extraToolCallBehavior != null && Object.hasOwnProperty.call(message, "extraToolCallBehavior")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.extraToolCallBehavior); + return writer; + }; + + /** + * Encodes the specified ToolMatchingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.IToolMatchingSettings} message ToolMatchingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolMatchingSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolMatchingSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolMatchingSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.extraToolCallBehavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolMatchingSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolMatchingSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolMatchingSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolMatchingSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.extraToolCallBehavior != null && message.hasOwnProperty("extraToolCallBehavior")) + switch (message.extraToolCallBehavior) { + default: + return "extraToolCallBehavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ToolMatchingSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings} ToolMatchingSettings + */ + ToolMatchingSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings(); + switch (object.extraToolCallBehavior) { + default: + if (typeof object.extraToolCallBehavior === "number") { + message.extraToolCallBehavior = object.extraToolCallBehavior; + break; + } + break; + case "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED": + case 0: + message.extraToolCallBehavior = 0; + break; + case "FAIL": + case 1: + message.extraToolCallBehavior = 1; + break; + case "ALLOW": + case 2: + message.extraToolCallBehavior = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ToolMatchingSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings} message ToolMatchingSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolMatchingSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.extraToolCallBehavior = options.enums === String ? "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED" : 0; + if (message.extraToolCallBehavior != null && message.hasOwnProperty("extraToolCallBehavior")) + object.extraToolCallBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior[message.extraToolCallBehavior] === undefined ? message.extraToolCallBehavior : $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior[message.extraToolCallBehavior] : message.extraToolCallBehavior; + return object; + }; + + /** + * Converts this ToolMatchingSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @instance + * @returns {Object.} JSON object + */ + ToolMatchingSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolMatchingSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolMatchingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings"; + }; + + /** + * ExtraToolCallBehavior enum. + * @name google.cloud.ces.v1beta.EvaluationMetricsThresholds.ToolMatchingSettings.ExtraToolCallBehavior + * @enum {number} + * @property {number} EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED=0 EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED value + * @property {number} FAIL=1 FAIL value + * @property {number} ALLOW=2 ALLOW value + */ + ToolMatchingSettings.ExtraToolCallBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "FAIL"] = 1; + values[valuesById[2] = "ALLOW"] = 2; + return values; + })(); + + return ToolMatchingSettings; + })(); + + /** + * HallucinationMetricBehavior enum. + * @name google.cloud.ces.v1beta.EvaluationMetricsThresholds.HallucinationMetricBehavior + * @enum {number} + * @property {number} HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED=0 HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} ENABLED=2 ENABLED value + */ + EvaluationMetricsThresholds.HallucinationMetricBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[2] = "ENABLED"] = 2; + return values; + })(); + + return EvaluationMetricsThresholds; + })(); + + v1beta.EvaluationSettings = (function() { + + /** + * Properties of an EvaluationSettings. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluationSettings + * @property {google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator|null} [scenarioConversationInitiator] EvaluationSettings scenarioConversationInitiator + * @property {google.cloud.ces.v1beta.GoldenRunMethod|null} [goldenRunMethod] EvaluationSettings goldenRunMethod + * @property {google.cloud.ces.v1beta.EvaluationToolCallBehaviour|null} [goldenEvaluationToolCallBehaviour] EvaluationSettings goldenEvaluationToolCallBehaviour + * @property {google.cloud.ces.v1beta.EvaluationToolCallBehaviour|null} [scenarioEvaluationToolCallBehaviour] EvaluationSettings scenarioEvaluationToolCallBehaviour + */ + + /** + * Constructs a new EvaluationSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationSettings. + * @implements IEvaluationSettings + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluationSettings=} [properties] Properties to set + */ + function EvaluationSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationSettings scenarioConversationInitiator. + * @member {google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator} scenarioConversationInitiator + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @instance + */ + EvaluationSettings.prototype.scenarioConversationInitiator = 0; + + /** + * EvaluationSettings goldenRunMethod. + * @member {google.cloud.ces.v1beta.GoldenRunMethod} goldenRunMethod + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @instance + */ + EvaluationSettings.prototype.goldenRunMethod = 0; + + /** + * EvaluationSettings goldenEvaluationToolCallBehaviour. + * @member {google.cloud.ces.v1beta.EvaluationToolCallBehaviour} goldenEvaluationToolCallBehaviour + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @instance + */ + EvaluationSettings.prototype.goldenEvaluationToolCallBehaviour = 0; + + /** + * EvaluationSettings scenarioEvaluationToolCallBehaviour. + * @member {google.cloud.ces.v1beta.EvaluationToolCallBehaviour} scenarioEvaluationToolCallBehaviour + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @instance + */ + EvaluationSettings.prototype.scenarioEvaluationToolCallBehaviour = 0; + + /** + * Creates a new EvaluationSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @static + * @param {google.cloud.ces.v1beta.IEvaluationSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationSettings} EvaluationSettings instance + */ + EvaluationSettings.create = function create(properties) { + return new EvaluationSettings(properties); + }; + + /** + * Encodes the specified EvaluationSettings message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @static + * @param {google.cloud.ces.v1beta.IEvaluationSettings} message EvaluationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scenarioConversationInitiator != null && Object.hasOwnProperty.call(message, "scenarioConversationInitiator")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.scenarioConversationInitiator); + if (message.goldenEvaluationToolCallBehaviour != null && Object.hasOwnProperty.call(message, "goldenEvaluationToolCallBehaviour")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.goldenEvaluationToolCallBehaviour); + if (message.scenarioEvaluationToolCallBehaviour != null && Object.hasOwnProperty.call(message, "scenarioEvaluationToolCallBehaviour")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.scenarioEvaluationToolCallBehaviour); + if (message.goldenRunMethod != null && Object.hasOwnProperty.call(message, "goldenRunMethod")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.goldenRunMethod); + return writer; + }; + + /** + * Encodes the specified EvaluationSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @static + * @param {google.cloud.ces.v1beta.IEvaluationSettings} message EvaluationSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationSettings} EvaluationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.scenarioConversationInitiator = reader.int32(); + break; + } + case 4: { + message.goldenRunMethod = reader.int32(); + break; + } + case 2: { + message.goldenEvaluationToolCallBehaviour = reader.int32(); + break; + } + case 3: { + message.scenarioEvaluationToolCallBehaviour = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationSettings} EvaluationSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scenarioConversationInitiator != null && message.hasOwnProperty("scenarioConversationInitiator")) + switch (message.scenarioConversationInitiator) { + default: + return "scenarioConversationInitiator: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) + switch (message.goldenRunMethod) { + default: + return "goldenRunMethod: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.goldenEvaluationToolCallBehaviour != null && message.hasOwnProperty("goldenEvaluationToolCallBehaviour")) + switch (message.goldenEvaluationToolCallBehaviour) { + default: + return "goldenEvaluationToolCallBehaviour: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.scenarioEvaluationToolCallBehaviour != null && message.hasOwnProperty("scenarioEvaluationToolCallBehaviour")) + switch (message.scenarioEvaluationToolCallBehaviour) { + default: + return "scenarioEvaluationToolCallBehaviour: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an EvaluationSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationSettings} EvaluationSettings + */ + EvaluationSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationSettings(); + switch (object.scenarioConversationInitiator) { + default: + if (typeof object.scenarioConversationInitiator === "number") { + message.scenarioConversationInitiator = object.scenarioConversationInitiator; + break; + } + break; + case "SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED": + case 0: + message.scenarioConversationInitiator = 0; + break; + case "USER": + case 1: + message.scenarioConversationInitiator = 1; + break; + case "AGENT": + case 2: + message.scenarioConversationInitiator = 2; + break; + } + switch (object.goldenRunMethod) { + default: + if (typeof object.goldenRunMethod === "number") { + message.goldenRunMethod = object.goldenRunMethod; + break; + } + break; + case "GOLDEN_RUN_METHOD_UNSPECIFIED": + case 0: + message.goldenRunMethod = 0; + break; + case "STABLE": + case 1: + message.goldenRunMethod = 1; + break; + case "NAIVE": + case 2: + message.goldenRunMethod = 2; + break; + } + switch (object.goldenEvaluationToolCallBehaviour) { + default: + if (typeof object.goldenEvaluationToolCallBehaviour === "number") { + message.goldenEvaluationToolCallBehaviour = object.goldenEvaluationToolCallBehaviour; + break; + } + break; + case "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED": + case 0: + message.goldenEvaluationToolCallBehaviour = 0; + break; + case "REAL": + case 1: + message.goldenEvaluationToolCallBehaviour = 1; + break; + case "FAKE": + case 2: + message.goldenEvaluationToolCallBehaviour = 2; + break; + } + switch (object.scenarioEvaluationToolCallBehaviour) { + default: + if (typeof object.scenarioEvaluationToolCallBehaviour === "number") { + message.scenarioEvaluationToolCallBehaviour = object.scenarioEvaluationToolCallBehaviour; + break; + } + break; + case "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED": + case 0: + message.scenarioEvaluationToolCallBehaviour = 0; + break; + case "REAL": + case 1: + message.scenarioEvaluationToolCallBehaviour = 1; + break; + case "FAKE": + case 2: + message.scenarioEvaluationToolCallBehaviour = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an EvaluationSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @static + * @param {google.cloud.ces.v1beta.EvaluationSettings} message EvaluationSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scenarioConversationInitiator = options.enums === String ? "SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED" : 0; + object.goldenEvaluationToolCallBehaviour = options.enums === String ? "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED" : 0; + object.scenarioEvaluationToolCallBehaviour = options.enums === String ? "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED" : 0; + object.goldenRunMethod = options.enums === String ? "GOLDEN_RUN_METHOD_UNSPECIFIED" : 0; + } + if (message.scenarioConversationInitiator != null && message.hasOwnProperty("scenarioConversationInitiator")) + object.scenarioConversationInitiator = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator[message.scenarioConversationInitiator] === undefined ? message.scenarioConversationInitiator : $root.google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator[message.scenarioConversationInitiator] : message.scenarioConversationInitiator; + if (message.goldenEvaluationToolCallBehaviour != null && message.hasOwnProperty("goldenEvaluationToolCallBehaviour")) + object.goldenEvaluationToolCallBehaviour = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationToolCallBehaviour[message.goldenEvaluationToolCallBehaviour] === undefined ? message.goldenEvaluationToolCallBehaviour : $root.google.cloud.ces.v1beta.EvaluationToolCallBehaviour[message.goldenEvaluationToolCallBehaviour] : message.goldenEvaluationToolCallBehaviour; + if (message.scenarioEvaluationToolCallBehaviour != null && message.hasOwnProperty("scenarioEvaluationToolCallBehaviour")) + object.scenarioEvaluationToolCallBehaviour = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationToolCallBehaviour[message.scenarioEvaluationToolCallBehaviour] === undefined ? message.scenarioEvaluationToolCallBehaviour : $root.google.cloud.ces.v1beta.EvaluationToolCallBehaviour[message.scenarioEvaluationToolCallBehaviour] : message.scenarioEvaluationToolCallBehaviour; + if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) + object.goldenRunMethod = options.enums === String ? $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] === undefined ? message.goldenRunMethod : $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] : message.goldenRunMethod; + return object; + }; + + /** + * Converts this EvaluationSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @instance + * @returns {Object.} JSON object + */ + EvaluationSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationSettings"; + }; + + /** + * ScenarioConversationInitiator enum. + * @name google.cloud.ces.v1beta.EvaluationSettings.ScenarioConversationInitiator + * @enum {number} + * @property {number} SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED=0 SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED value + * @property {number} USER=1 USER value + * @property {number} AGENT=2 AGENT value + */ + EvaluationSettings.ScenarioConversationInitiator = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER"] = 1; + values[valuesById[2] = "AGENT"] = 2; + return values; + })(); + + return EvaluationSettings; + })(); + + v1beta.ClientCertificateSettings = (function() { + + /** + * Properties of a ClientCertificateSettings. + * @memberof google.cloud.ces.v1beta + * @interface IClientCertificateSettings + * @property {string|null} [tlsCertificate] ClientCertificateSettings tlsCertificate + * @property {string|null} [privateKey] ClientCertificateSettings privateKey + * @property {string|null} [passphrase] ClientCertificateSettings passphrase + */ + + /** + * Constructs a new ClientCertificateSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ClientCertificateSettings. + * @implements IClientCertificateSettings + * @constructor + * @param {google.cloud.ces.v1beta.IClientCertificateSettings=} [properties] Properties to set + */ + function ClientCertificateSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientCertificateSettings tlsCertificate. + * @member {string} tlsCertificate + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @instance + */ + ClientCertificateSettings.prototype.tlsCertificate = ""; + + /** + * ClientCertificateSettings privateKey. + * @member {string} privateKey + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @instance + */ + ClientCertificateSettings.prototype.privateKey = ""; + + /** + * ClientCertificateSettings passphrase. + * @member {string} passphrase + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @instance + */ + ClientCertificateSettings.prototype.passphrase = ""; + + /** + * Creates a new ClientCertificateSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @static + * @param {google.cloud.ces.v1beta.IClientCertificateSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ClientCertificateSettings} ClientCertificateSettings instance + */ + ClientCertificateSettings.create = function create(properties) { + return new ClientCertificateSettings(properties); + }; + + /** + * Encodes the specified ClientCertificateSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ClientCertificateSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @static + * @param {google.cloud.ces.v1beta.IClientCertificateSettings} message ClientCertificateSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientCertificateSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tlsCertificate != null && Object.hasOwnProperty.call(message, "tlsCertificate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tlsCertificate); + if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.privateKey); + if (message.passphrase != null && Object.hasOwnProperty.call(message, "passphrase")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.passphrase); + return writer; + }; + + /** + * Encodes the specified ClientCertificateSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ClientCertificateSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @static + * @param {google.cloud.ces.v1beta.IClientCertificateSettings} message ClientCertificateSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientCertificateSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ClientCertificateSettings} ClientCertificateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientCertificateSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ClientCertificateSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tlsCertificate = reader.string(); + break; + } + case 2: { + message.privateKey = reader.string(); + break; + } + case 3: { + message.passphrase = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientCertificateSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ClientCertificateSettings} ClientCertificateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientCertificateSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientCertificateSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientCertificateSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tlsCertificate != null && message.hasOwnProperty("tlsCertificate")) + if (!$util.isString(message.tlsCertificate)) + return "tlsCertificate: string expected"; + if (message.privateKey != null && message.hasOwnProperty("privateKey")) + if (!$util.isString(message.privateKey)) + return "privateKey: string expected"; + if (message.passphrase != null && message.hasOwnProperty("passphrase")) + if (!$util.isString(message.passphrase)) + return "passphrase: string expected"; + return null; + }; + + /** + * Creates a ClientCertificateSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ClientCertificateSettings} ClientCertificateSettings + */ + ClientCertificateSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ClientCertificateSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.ClientCertificateSettings(); + if (object.tlsCertificate != null) + message.tlsCertificate = String(object.tlsCertificate); + if (object.privateKey != null) + message.privateKey = String(object.privateKey); + if (object.passphrase != null) + message.passphrase = String(object.passphrase); + return message; + }; + + /** + * Creates a plain object from a ClientCertificateSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @static + * @param {google.cloud.ces.v1beta.ClientCertificateSettings} message ClientCertificateSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientCertificateSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tlsCertificate = ""; + object.privateKey = ""; + object.passphrase = ""; + } + if (message.tlsCertificate != null && message.hasOwnProperty("tlsCertificate")) + object.tlsCertificate = message.tlsCertificate; + if (message.privateKey != null && message.hasOwnProperty("privateKey")) + object.privateKey = message.privateKey; + if (message.passphrase != null && message.hasOwnProperty("passphrase")) + object.passphrase = message.passphrase; + return object; + }; + + /** + * Converts this ClientCertificateSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @instance + * @returns {Object.} JSON object + */ + ClientCertificateSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientCertificateSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ClientCertificateSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientCertificateSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ClientCertificateSettings"; + }; + + return ClientCertificateSettings; + })(); + + v1beta.ConversationLoggingSettings = (function() { + + /** + * Properties of a ConversationLoggingSettings. + * @memberof google.cloud.ces.v1beta + * @interface IConversationLoggingSettings + * @property {boolean|null} [disableConversationLogging] ConversationLoggingSettings disableConversationLogging + */ + + /** + * Constructs a new ConversationLoggingSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ConversationLoggingSettings. + * @implements IConversationLoggingSettings + * @constructor + * @param {google.cloud.ces.v1beta.IConversationLoggingSettings=} [properties] Properties to set + */ + function ConversationLoggingSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConversationLoggingSettings disableConversationLogging. + * @member {boolean} disableConversationLogging + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @instance + */ + ConversationLoggingSettings.prototype.disableConversationLogging = false; + + /** + * Creates a new ConversationLoggingSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @static + * @param {google.cloud.ces.v1beta.IConversationLoggingSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ConversationLoggingSettings} ConversationLoggingSettings instance + */ + ConversationLoggingSettings.create = function create(properties) { + return new ConversationLoggingSettings(properties); + }; + + /** + * Encodes the specified ConversationLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.ConversationLoggingSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @static + * @param {google.cloud.ces.v1beta.IConversationLoggingSettings} message ConversationLoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationLoggingSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disableConversationLogging != null && Object.hasOwnProperty.call(message, "disableConversationLogging")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.disableConversationLogging); + return writer; + }; + + /** + * Encodes the specified ConversationLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ConversationLoggingSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @static + * @param {google.cloud.ces.v1beta.IConversationLoggingSettings} message ConversationLoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationLoggingSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConversationLoggingSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ConversationLoggingSettings} ConversationLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationLoggingSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ConversationLoggingSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.disableConversationLogging = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConversationLoggingSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ConversationLoggingSettings} ConversationLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationLoggingSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConversationLoggingSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConversationLoggingSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disableConversationLogging != null && message.hasOwnProperty("disableConversationLogging")) + if (typeof message.disableConversationLogging !== "boolean") + return "disableConversationLogging: boolean expected"; + return null; + }; + + /** + * Creates a ConversationLoggingSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ConversationLoggingSettings} ConversationLoggingSettings + */ + ConversationLoggingSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ConversationLoggingSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.ConversationLoggingSettings(); + if (object.disableConversationLogging != null) + message.disableConversationLogging = Boolean(object.disableConversationLogging); + return message; + }; + + /** + * Creates a plain object from a ConversationLoggingSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @static + * @param {google.cloud.ces.v1beta.ConversationLoggingSettings} message ConversationLoggingSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConversationLoggingSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.disableConversationLogging = false; + if (message.disableConversationLogging != null && message.hasOwnProperty("disableConversationLogging")) + object.disableConversationLogging = message.disableConversationLogging; + return object; + }; + + /** + * Converts this ConversationLoggingSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @instance + * @returns {Object.} JSON object + */ + ConversationLoggingSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConversationLoggingSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ConversationLoggingSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConversationLoggingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ConversationLoggingSettings"; + }; + + return ConversationLoggingSettings; + })(); + + v1beta.CloudLoggingSettings = (function() { + + /** + * Properties of a CloudLoggingSettings. + * @memberof google.cloud.ces.v1beta + * @interface ICloudLoggingSettings + * @property {boolean|null} [enableCloudLogging] CloudLoggingSettings enableCloudLogging + */ + + /** + * Constructs a new CloudLoggingSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CloudLoggingSettings. + * @implements ICloudLoggingSettings + * @constructor + * @param {google.cloud.ces.v1beta.ICloudLoggingSettings=} [properties] Properties to set + */ + function CloudLoggingSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudLoggingSettings enableCloudLogging. + * @member {boolean} enableCloudLogging + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @instance + */ + CloudLoggingSettings.prototype.enableCloudLogging = false; + + /** + * Creates a new CloudLoggingSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @static + * @param {google.cloud.ces.v1beta.ICloudLoggingSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CloudLoggingSettings} CloudLoggingSettings instance + */ + CloudLoggingSettings.create = function create(properties) { + return new CloudLoggingSettings(properties); + }; + + /** + * Encodes the specified CloudLoggingSettings message. Does not implicitly {@link google.cloud.ces.v1beta.CloudLoggingSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @static + * @param {google.cloud.ces.v1beta.ICloudLoggingSettings} message CloudLoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudLoggingSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableCloudLogging != null && Object.hasOwnProperty.call(message, "enableCloudLogging")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableCloudLogging); + return writer; + }; + + /** + * Encodes the specified CloudLoggingSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CloudLoggingSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @static + * @param {google.cloud.ces.v1beta.ICloudLoggingSettings} message CloudLoggingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudLoggingSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudLoggingSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CloudLoggingSettings} CloudLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudLoggingSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CloudLoggingSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableCloudLogging = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudLoggingSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CloudLoggingSettings} CloudLoggingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudLoggingSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudLoggingSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudLoggingSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableCloudLogging != null && message.hasOwnProperty("enableCloudLogging")) + if (typeof message.enableCloudLogging !== "boolean") + return "enableCloudLogging: boolean expected"; + return null; + }; + + /** + * Creates a CloudLoggingSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CloudLoggingSettings} CloudLoggingSettings + */ + CloudLoggingSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CloudLoggingSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.CloudLoggingSettings(); + if (object.enableCloudLogging != null) + message.enableCloudLogging = Boolean(object.enableCloudLogging); + return message; + }; + + /** + * Creates a plain object from a CloudLoggingSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @static + * @param {google.cloud.ces.v1beta.CloudLoggingSettings} message CloudLoggingSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudLoggingSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableCloudLogging = false; + if (message.enableCloudLogging != null && message.hasOwnProperty("enableCloudLogging")) + object.enableCloudLogging = message.enableCloudLogging; + return object; + }; + + /** + * Converts this CloudLoggingSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @instance + * @returns {Object.} JSON object + */ + CloudLoggingSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudLoggingSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CloudLoggingSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudLoggingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CloudLoggingSettings"; + }; + + return CloudLoggingSettings; + })(); + + v1beta.AudioRecordingConfig = (function() { + + /** + * Properties of an AudioRecordingConfig. + * @memberof google.cloud.ces.v1beta + * @interface IAudioRecordingConfig + * @property {string|null} [gcsBucket] AudioRecordingConfig gcsBucket + * @property {string|null} [gcsPathPrefix] AudioRecordingConfig gcsPathPrefix + */ + + /** + * Constructs a new AudioRecordingConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an AudioRecordingConfig. + * @implements IAudioRecordingConfig + * @constructor + * @param {google.cloud.ces.v1beta.IAudioRecordingConfig=} [properties] Properties to set + */ + function AudioRecordingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AudioRecordingConfig gcsBucket. + * @member {string} gcsBucket + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @instance + */ + AudioRecordingConfig.prototype.gcsBucket = ""; + + /** + * AudioRecordingConfig gcsPathPrefix. + * @member {string} gcsPathPrefix + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @instance + */ + AudioRecordingConfig.prototype.gcsPathPrefix = ""; + + /** + * Creates a new AudioRecordingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @static + * @param {google.cloud.ces.v1beta.IAudioRecordingConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AudioRecordingConfig} AudioRecordingConfig instance + */ + AudioRecordingConfig.create = function create(properties) { + return new AudioRecordingConfig(properties); + }; + + /** + * Encodes the specified AudioRecordingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.AudioRecordingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @static + * @param {google.cloud.ces.v1beta.IAudioRecordingConfig} message AudioRecordingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioRecordingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsBucket != null && Object.hasOwnProperty.call(message, "gcsBucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsBucket); + if (message.gcsPathPrefix != null && Object.hasOwnProperty.call(message, "gcsPathPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsPathPrefix); + return writer; + }; + + /** + * Encodes the specified AudioRecordingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AudioRecordingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @static + * @param {google.cloud.ces.v1beta.IAudioRecordingConfig} message AudioRecordingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioRecordingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AudioRecordingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AudioRecordingConfig} AudioRecordingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioRecordingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AudioRecordingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsBucket = reader.string(); + break; + } + case 2: { + message.gcsPathPrefix = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AudioRecordingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AudioRecordingConfig} AudioRecordingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioRecordingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AudioRecordingConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AudioRecordingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + if (!$util.isString(message.gcsBucket)) + return "gcsBucket: string expected"; + if (message.gcsPathPrefix != null && message.hasOwnProperty("gcsPathPrefix")) + if (!$util.isString(message.gcsPathPrefix)) + return "gcsPathPrefix: string expected"; + return null; + }; + + /** + * Creates an AudioRecordingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AudioRecordingConfig} AudioRecordingConfig + */ + AudioRecordingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AudioRecordingConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.AudioRecordingConfig(); + if (object.gcsBucket != null) + message.gcsBucket = String(object.gcsBucket); + if (object.gcsPathPrefix != null) + message.gcsPathPrefix = String(object.gcsPathPrefix); + return message; + }; + + /** + * Creates a plain object from an AudioRecordingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @static + * @param {google.cloud.ces.v1beta.AudioRecordingConfig} message AudioRecordingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AudioRecordingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsBucket = ""; + object.gcsPathPrefix = ""; + } + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + object.gcsBucket = message.gcsBucket; + if (message.gcsPathPrefix != null && message.hasOwnProperty("gcsPathPrefix")) + object.gcsPathPrefix = message.gcsPathPrefix; + return object; + }; + + /** + * Converts this AudioRecordingConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @instance + * @returns {Object.} JSON object + */ + AudioRecordingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AudioRecordingConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AudioRecordingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AudioRecordingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AudioRecordingConfig"; + }; + + return AudioRecordingConfig; + })(); + + v1beta.RedactionConfig = (function() { + + /** + * Properties of a RedactionConfig. + * @memberof google.cloud.ces.v1beta + * @interface IRedactionConfig + * @property {boolean|null} [enableRedaction] RedactionConfig enableRedaction + * @property {string|null} [inspectTemplate] RedactionConfig inspectTemplate + * @property {string|null} [deidentifyTemplate] RedactionConfig deidentifyTemplate + */ + + /** + * Constructs a new RedactionConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RedactionConfig. + * @implements IRedactionConfig + * @constructor + * @param {google.cloud.ces.v1beta.IRedactionConfig=} [properties] Properties to set + */ + function RedactionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RedactionConfig enableRedaction. + * @member {boolean} enableRedaction + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @instance + */ + RedactionConfig.prototype.enableRedaction = false; + + /** + * RedactionConfig inspectTemplate. + * @member {string} inspectTemplate + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @instance + */ + RedactionConfig.prototype.inspectTemplate = ""; + + /** + * RedactionConfig deidentifyTemplate. + * @member {string} deidentifyTemplate + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @instance + */ + RedactionConfig.prototype.deidentifyTemplate = ""; + + /** + * Creates a new RedactionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @static + * @param {google.cloud.ces.v1beta.IRedactionConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RedactionConfig} RedactionConfig instance + */ + RedactionConfig.create = function create(properties) { + return new RedactionConfig(properties); + }; + + /** + * Encodes the specified RedactionConfig message. Does not implicitly {@link google.cloud.ces.v1beta.RedactionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @static + * @param {google.cloud.ces.v1beta.IRedactionConfig} message RedactionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedactionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableRedaction != null && Object.hasOwnProperty.call(message, "enableRedaction")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableRedaction); + if (message.inspectTemplate != null && Object.hasOwnProperty.call(message, "inspectTemplate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inspectTemplate); + if (message.deidentifyTemplate != null && Object.hasOwnProperty.call(message, "deidentifyTemplate")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deidentifyTemplate); + return writer; + }; + + /** + * Encodes the specified RedactionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RedactionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @static + * @param {google.cloud.ces.v1beta.IRedactionConfig} message RedactionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedactionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RedactionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RedactionConfig} RedactionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedactionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RedactionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableRedaction = reader.bool(); + break; + } + case 2: { + message.inspectTemplate = reader.string(); + break; + } + case 3: { + message.deidentifyTemplate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RedactionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RedactionConfig} RedactionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedactionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RedactionConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedactionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableRedaction != null && message.hasOwnProperty("enableRedaction")) + if (typeof message.enableRedaction !== "boolean") + return "enableRedaction: boolean expected"; + if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) + if (!$util.isString(message.inspectTemplate)) + return "inspectTemplate: string expected"; + if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) + if (!$util.isString(message.deidentifyTemplate)) + return "deidentifyTemplate: string expected"; + return null; + }; + + /** + * Creates a RedactionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RedactionConfig} RedactionConfig + */ + RedactionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RedactionConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.RedactionConfig(); + if (object.enableRedaction != null) + message.enableRedaction = Boolean(object.enableRedaction); + if (object.inspectTemplate != null) + message.inspectTemplate = String(object.inspectTemplate); + if (object.deidentifyTemplate != null) + message.deidentifyTemplate = String(object.deidentifyTemplate); + return message; + }; + + /** + * Creates a plain object from a RedactionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @static + * @param {google.cloud.ces.v1beta.RedactionConfig} message RedactionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedactionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableRedaction = false; + object.inspectTemplate = ""; + object.deidentifyTemplate = ""; + } + if (message.enableRedaction != null && message.hasOwnProperty("enableRedaction")) + object.enableRedaction = message.enableRedaction; + if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) + object.inspectTemplate = message.inspectTemplate; + if (message.deidentifyTemplate != null && message.hasOwnProperty("deidentifyTemplate")) + object.deidentifyTemplate = message.deidentifyTemplate; + return object; + }; + + /** + * Converts this RedactionConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @instance + * @returns {Object.} JSON object + */ + RedactionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RedactionConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RedactionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RedactionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RedactionConfig"; + }; + + return RedactionConfig; + })(); + + v1beta.DataStoreSettings = (function() { + + /** + * Properties of a DataStoreSettings. + * @memberof google.cloud.ces.v1beta + * @interface IDataStoreSettings + * @property {Array.|null} [engines] DataStoreSettings engines + */ + + /** + * Constructs a new DataStoreSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DataStoreSettings. + * @implements IDataStoreSettings + * @constructor + * @param {google.cloud.ces.v1beta.IDataStoreSettings=} [properties] Properties to set + */ + function DataStoreSettings(properties) { + this.engines = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStoreSettings engines. + * @member {Array.} engines + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @instance + */ + DataStoreSettings.prototype.engines = $util.emptyArray; + + /** + * Creates a new DataStoreSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @static + * @param {google.cloud.ces.v1beta.IDataStoreSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreSettings} DataStoreSettings instance + */ + DataStoreSettings.create = function create(properties) { + return new DataStoreSettings(properties); + }; + + /** + * Encodes the specified DataStoreSettings message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @static + * @param {google.cloud.ces.v1beta.IDataStoreSettings} message DataStoreSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.engines != null && message.engines.length) + for (var i = 0; i < message.engines.length; ++i) + $root.google.cloud.ces.v1beta.DataStoreSettings.Engine.encode(message.engines[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataStoreSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @static + * @param {google.cloud.ces.v1beta.IDataStoreSettings} message DataStoreSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStoreSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreSettings} DataStoreSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + if (!(message.engines && message.engines.length)) + message.engines = []; + message.engines.push($root.google.cloud.ces.v1beta.DataStoreSettings.Engine.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataStoreSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreSettings} DataStoreSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStoreSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStoreSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.engines != null && message.hasOwnProperty("engines")) { + if (!Array.isArray(message.engines)) + return "engines: array expected"; + for (var i = 0; i < message.engines.length; ++i) { + var error = $root.google.cloud.ces.v1beta.DataStoreSettings.Engine.verify(message.engines[i]); + if (error) + return "engines." + error; + } + } + return null; + }; + + /** + * Creates a DataStoreSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreSettings} DataStoreSettings + */ + DataStoreSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreSettings(); + if (object.engines) { + if (!Array.isArray(object.engines)) + throw TypeError(".google.cloud.ces.v1beta.DataStoreSettings.engines: array expected"); + message.engines = []; + for (var i = 0; i < object.engines.length; ++i) { + if (typeof object.engines[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreSettings.engines: object expected"); + message.engines[i] = $root.google.cloud.ces.v1beta.DataStoreSettings.Engine.fromObject(object.engines[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DataStoreSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @static + * @param {google.cloud.ces.v1beta.DataStoreSettings} message DataStoreSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStoreSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.engines = []; + if (message.engines && message.engines.length) { + object.engines = []; + for (var j = 0; j < message.engines.length; ++j) + object.engines[j] = $root.google.cloud.ces.v1beta.DataStoreSettings.Engine.toObject(message.engines[j], options); + } + return object; + }; + + /** + * Converts this DataStoreSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @instance + * @returns {Object.} JSON object + */ + DataStoreSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStoreSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStoreSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreSettings"; + }; + + DataStoreSettings.Engine = (function() { + + /** + * Properties of an Engine. + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @interface IEngine + * @property {string|null} [name] Engine name + * @property {google.cloud.ces.v1beta.DataStoreSettings.Engine.Type|null} [type] Engine type + */ + + /** + * Constructs a new Engine. + * @memberof google.cloud.ces.v1beta.DataStoreSettings + * @classdesc Represents an Engine. + * @implements IEngine + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreSettings.IEngine=} [properties] Properties to set + */ + function Engine(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Engine name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @instance + */ + Engine.prototype.name = ""; + + /** + * Engine type. + * @member {google.cloud.ces.v1beta.DataStoreSettings.Engine.Type} type + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @instance + */ + Engine.prototype.type = 0; + + /** + * Creates a new Engine instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @static + * @param {google.cloud.ces.v1beta.DataStoreSettings.IEngine=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreSettings.Engine} Engine instance + */ + Engine.create = function create(properties) { + return new Engine(properties); + }; + + /** + * Encodes the specified Engine message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.Engine.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @static + * @param {google.cloud.ces.v1beta.DataStoreSettings.IEngine} message Engine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Engine.encode = function encode(message, writer) { + if (!writer) + 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 0 =*/16).int32(message.type); + return writer; + }; + + /** + * Encodes the specified Engine message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreSettings.Engine.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @static + * @param {google.cloud.ces.v1beta.DataStoreSettings.IEngine} message Engine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Engine.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Engine message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreSettings.Engine} Engine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Engine.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreSettings.Engine(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Engine message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreSettings.Engine} Engine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Engine.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Engine message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Engine.verify = function verify(message) { + if (typeof message !== "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")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Engine message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreSettings.Engine} Engine + */ + Engine.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreSettings.Engine) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreSettings.Engine(); + if (object.name != null) + message.name = String(object.name); + 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 "ENGINE_TYPE_SEARCH": + case 1: + message.type = 1; + break; + case "ENGINE_TYPE_CHAT": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Engine message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @static + * @param {google.cloud.ces.v1beta.DataStoreSettings.Engine} message Engine + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Engine.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.ces.v1beta.DataStoreSettings.Engine.Type[message.type] === undefined ? message.type : $root.google.cloud.ces.v1beta.DataStoreSettings.Engine.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this Engine to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @instance + * @returns {Object.} JSON object + */ + Engine.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Engine + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreSettings.Engine + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Engine.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreSettings.Engine"; + }; + + /** + * Type enum. + * @name google.cloud.ces.v1beta.DataStoreSettings.Engine.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ENGINE_TYPE_SEARCH=1 ENGINE_TYPE_SEARCH value + * @property {number} ENGINE_TYPE_CHAT=2 ENGINE_TYPE_CHAT value + */ + Engine.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENGINE_TYPE_SEARCH"] = 1; + values[valuesById[2] = "ENGINE_TYPE_CHAT"] = 2; + return values; + })(); + + return Engine; + })(); + + return DataStoreSettings; + })(); + + v1beta.EvaluationPersona = (function() { + + /** + * Properties of an EvaluationPersona. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluationPersona + * @property {string|null} [name] EvaluationPersona name + * @property {string|null} [description] EvaluationPersona description + * @property {string|null} [displayName] EvaluationPersona displayName + * @property {string|null} [personality] EvaluationPersona personality + * @property {google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig|null} [speechConfig] EvaluationPersona speechConfig + */ + + /** + * Constructs a new EvaluationPersona. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationPersona. + * @implements IEvaluationPersona + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluationPersona=} [properties] Properties to set + */ + function EvaluationPersona(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationPersona name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @instance + */ + EvaluationPersona.prototype.name = ""; + + /** + * EvaluationPersona description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @instance + */ + EvaluationPersona.prototype.description = ""; + + /** + * EvaluationPersona displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @instance + */ + EvaluationPersona.prototype.displayName = ""; + + /** + * EvaluationPersona personality. + * @member {string} personality + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @instance + */ + EvaluationPersona.prototype.personality = ""; + + /** + * EvaluationPersona speechConfig. + * @member {google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig|null|undefined} speechConfig + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @instance + */ + EvaluationPersona.prototype.speechConfig = null; + + /** + * Creates a new EvaluationPersona instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @static + * @param {google.cloud.ces.v1beta.IEvaluationPersona=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationPersona} EvaluationPersona instance + */ + EvaluationPersona.create = function create(properties) { + return new EvaluationPersona(properties); + }; + + /** + * Encodes the specified EvaluationPersona message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @static + * @param {google.cloud.ces.v1beta.IEvaluationPersona} message EvaluationPersona message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationPersona.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.personality != null && Object.hasOwnProperty.call(message, "personality")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.personality); + if (message.speechConfig != null && Object.hasOwnProperty.call(message, "speechConfig")) + $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.encode(message.speechConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluationPersona message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @static + * @param {google.cloud.ces.v1beta.IEvaluationPersona} message EvaluationPersona message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationPersona.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationPersona message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationPersona} EvaluationPersona + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationPersona.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationPersona(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.personality = reader.string(); + break; + } + case 5: { + message.speechConfig = $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationPersona message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationPersona} EvaluationPersona + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationPersona.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationPersona message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationPersona.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.personality != null && message.hasOwnProperty("personality")) + if (!$util.isString(message.personality)) + return "personality: string expected"; + if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) { + var error = $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.verify(message.speechConfig); + if (error) + return "speechConfig." + error; + } + return null; + }; + + /** + * Creates an EvaluationPersona message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationPersona} EvaluationPersona + */ + EvaluationPersona.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationPersona) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationPersona(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.personality != null) + message.personality = String(object.personality); + if (object.speechConfig != null) { + if (typeof object.speechConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationPersona.speechConfig: object expected"); + message.speechConfig = $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.fromObject(object.speechConfig); + } + return message; + }; + + /** + * Creates a plain object from an EvaluationPersona message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @static + * @param {google.cloud.ces.v1beta.EvaluationPersona} message EvaluationPersona + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationPersona.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.displayName = ""; + object.personality = ""; + object.speechConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.personality != null && message.hasOwnProperty("personality")) + object.personality = message.personality; + if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) + object.speechConfig = $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.toObject(message.speechConfig, options); + return object; + }; + + /** + * Converts this EvaluationPersona to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @instance + * @returns {Object.} JSON object + */ + EvaluationPersona.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationPersona + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationPersona.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationPersona"; + }; + + EvaluationPersona.SpeechConfig = (function() { + + /** + * Properties of a SpeechConfig. + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @interface ISpeechConfig + * @property {number|null} [speakingRate] SpeechConfig speakingRate + * @property {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment|null} [environment] SpeechConfig environment + * @property {string|null} [voiceId] SpeechConfig voiceId + */ + + /** + * Constructs a new SpeechConfig. + * @memberof google.cloud.ces.v1beta.EvaluationPersona + * @classdesc Represents a SpeechConfig. + * @implements ISpeechConfig + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig=} [properties] Properties to set + */ + function SpeechConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechConfig speakingRate. + * @member {number} speakingRate + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @instance + */ + SpeechConfig.prototype.speakingRate = 0; + + /** + * SpeechConfig environment. + * @member {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment} environment + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @instance + */ + SpeechConfig.prototype.environment = 0; + + /** + * SpeechConfig voiceId. + * @member {string} voiceId + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @instance + */ + SpeechConfig.prototype.voiceId = ""; + + /** + * Creates a new SpeechConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @static + * @param {google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig} SpeechConfig instance + */ + SpeechConfig.create = function create(properties) { + return new SpeechConfig(properties); + }; + + /** + * Encodes the specified SpeechConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @static + * @param {google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig} message SpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speakingRate != null && Object.hasOwnProperty.call(message, "speakingRate")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.speakingRate); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.environment); + if (message.voiceId != null && Object.hasOwnProperty.call(message, "voiceId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.voiceId); + return writer; + }; + + /** + * Encodes the specified SpeechConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @static + * @param {google.cloud.ces.v1beta.EvaluationPersona.ISpeechConfig} message SpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig} SpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.speakingRate = reader.double(); + break; + } + case 2: { + message.environment = reader.int32(); + break; + } + case 3: { + message.voiceId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig} SpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) + if (typeof message.speakingRate !== "number") + return "speakingRate: number expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + switch (message.environment) { + default: + return "environment: enum value expected"; + case 0: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.voiceId != null && message.hasOwnProperty("voiceId")) + if (!$util.isString(message.voiceId)) + return "voiceId: string expected"; + return null; + }; + + /** + * Creates a SpeechConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig} SpeechConfig + */ + SpeechConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig(); + if (object.speakingRate != null) + message.speakingRate = Number(object.speakingRate); + switch (object.environment) { + default: + if (typeof object.environment === "number") { + message.environment = object.environment; + break; + } + break; + case "BACKGROUND_ENVIRONMENT_UNSPECIFIED": + case 0: + message.environment = 0; + break; + case "CALL_CENTER": + case 3: + message.environment = 3; + break; + case "TRAFFIC": + case 4: + message.environment = 4; + break; + case "KIDS_NOISE": + case 5: + message.environment = 5; + break; + case "CAFE": + case 6: + message.environment = 6; + break; + } + if (object.voiceId != null) + message.voiceId = String(object.voiceId); + return message; + }; + + /** + * Creates a plain object from a SpeechConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @static + * @param {google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig} message SpeechConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.speakingRate = 0; + object.environment = options.enums === String ? "BACKGROUND_ENVIRONMENT_UNSPECIFIED" : 0; + object.voiceId = ""; + } + if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) + object.speakingRate = options.json && !isFinite(message.speakingRate) ? String(message.speakingRate) : message.speakingRate; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment[message.environment] === undefined ? message.environment : $root.google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment[message.environment] : message.environment; + if (message.voiceId != null && message.hasOwnProperty("voiceId")) + object.voiceId = message.voiceId; + return object; + }; + + /** + * Converts this SpeechConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @instance + * @returns {Object.} JSON object + */ + SpeechConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig"; + }; + + /** + * BackgroundEnvironment enum. + * @name google.cloud.ces.v1beta.EvaluationPersona.SpeechConfig.BackgroundEnvironment + * @enum {number} + * @property {number} BACKGROUND_ENVIRONMENT_UNSPECIFIED=0 BACKGROUND_ENVIRONMENT_UNSPECIFIED value + * @property {number} CALL_CENTER=3 CALL_CENTER value + * @property {number} TRAFFIC=4 TRAFFIC value + * @property {number} KIDS_NOISE=5 KIDS_NOISE value + * @property {number} CAFE=6 CAFE value + */ + SpeechConfig.BackgroundEnvironment = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BACKGROUND_ENVIRONMENT_UNSPECIFIED"] = 0; + values[valuesById[3] = "CALL_CENTER"] = 3; + values[valuesById[4] = "TRAFFIC"] = 4; + values[valuesById[5] = "KIDS_NOISE"] = 5; + values[valuesById[6] = "CAFE"] = 6; + return values; + })(); + + return SpeechConfig; + })(); + + return EvaluationPersona; + })(); + + v1beta.BigQueryExportSettings = (function() { + + /** + * Properties of a BigQueryExportSettings. + * @memberof google.cloud.ces.v1beta + * @interface IBigQueryExportSettings + * @property {boolean|null} [enabled] BigQueryExportSettings enabled + * @property {string|null} [project] BigQueryExportSettings project + * @property {string|null} [dataset] BigQueryExportSettings dataset + */ + + /** + * Constructs a new BigQueryExportSettings. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a BigQueryExportSettings. + * @implements IBigQueryExportSettings + * @constructor + * @param {google.cloud.ces.v1beta.IBigQueryExportSettings=} [properties] Properties to set + */ + function BigQueryExportSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQueryExportSettings enabled. + * @member {boolean} enabled + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @instance + */ + BigQueryExportSettings.prototype.enabled = false; + + /** + * BigQueryExportSettings project. + * @member {string} project + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @instance + */ + BigQueryExportSettings.prototype.project = ""; + + /** + * BigQueryExportSettings dataset. + * @member {string} dataset + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @instance + */ + BigQueryExportSettings.prototype.dataset = ""; + + /** + * Creates a new BigQueryExportSettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @static + * @param {google.cloud.ces.v1beta.IBigQueryExportSettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.BigQueryExportSettings} BigQueryExportSettings instance + */ + BigQueryExportSettings.create = function create(properties) { + return new BigQueryExportSettings(properties); + }; + + /** + * Encodes the specified BigQueryExportSettings message. Does not implicitly {@link google.cloud.ces.v1beta.BigQueryExportSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @static + * @param {google.cloud.ces.v1beta.IBigQueryExportSettings} message BigQueryExportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryExportSettings.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.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dataset); + return writer; + }; + + /** + * Encodes the specified BigQueryExportSettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BigQueryExportSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @static + * @param {google.cloud.ces.v1beta.IBigQueryExportSettings} message BigQueryExportSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryExportSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryExportSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.BigQueryExportSettings} BigQueryExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryExportSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BigQueryExportSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + message.project = reader.string(); + break; + } + case 3: { + message.dataset = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryExportSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.BigQueryExportSettings} BigQueryExportSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryExportSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryExportSettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryExportSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + return null; + }; + + /** + * Creates a BigQueryExportSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.BigQueryExportSettings} BigQueryExportSettings + */ + BigQueryExportSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.BigQueryExportSettings) + return object; + var message = new $root.google.cloud.ces.v1beta.BigQueryExportSettings(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.project != null) + message.project = String(object.project); + if (object.dataset != null) + message.dataset = String(object.dataset); + return message; + }; + + /** + * Creates a plain object from a BigQueryExportSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @static + * @param {google.cloud.ces.v1beta.BigQueryExportSettings} message BigQueryExportSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryExportSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enabled = false; + object.project = ""; + object.dataset = ""; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + return object; + }; + + /** + * Converts this BigQueryExportSettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @instance + * @returns {Object.} JSON object + */ + BigQueryExportSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryExportSettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.BigQueryExportSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryExportSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.BigQueryExportSettings"; + }; + + return BigQueryExportSettings; + })(); + + /** + * EvaluationToolCallBehaviour enum. + * @name google.cloud.ces.v1beta.EvaluationToolCallBehaviour + * @enum {number} + * @property {number} EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED=0 EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED value + * @property {number} REAL=1 REAL value + * @property {number} FAKE=2 FAKE value + */ + v1beta.EvaluationToolCallBehaviour = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED"] = 0; + values[valuesById[1] = "REAL"] = 1; + values[valuesById[2] = "FAKE"] = 2; + return values; + })(); + + v1beta.CodeBlock = (function() { + + /** + * Properties of a CodeBlock. + * @memberof google.cloud.ces.v1beta + * @interface ICodeBlock + * @property {string|null} [pythonCode] CodeBlock pythonCode + */ + + /** + * Constructs a new CodeBlock. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CodeBlock. + * @implements ICodeBlock + * @constructor + * @param {google.cloud.ces.v1beta.ICodeBlock=} [properties] Properties to set + */ + function CodeBlock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CodeBlock pythonCode. + * @member {string} pythonCode + * @memberof google.cloud.ces.v1beta.CodeBlock + * @instance + */ + CodeBlock.prototype.pythonCode = ""; + + /** + * Creates a new CodeBlock instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CodeBlock + * @static + * @param {google.cloud.ces.v1beta.ICodeBlock=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CodeBlock} CodeBlock instance + */ + CodeBlock.create = function create(properties) { + return new CodeBlock(properties); + }; + + /** + * Encodes the specified CodeBlock message. Does not implicitly {@link google.cloud.ces.v1beta.CodeBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CodeBlock + * @static + * @param {google.cloud.ces.v1beta.ICodeBlock} message CodeBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pythonCode); + return writer; + }; + + /** + * Encodes the specified CodeBlock message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CodeBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CodeBlock + * @static + * @param {google.cloud.ces.v1beta.ICodeBlock} message CodeBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CodeBlock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CodeBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CodeBlock} CodeBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeBlock.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CodeBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pythonCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CodeBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CodeBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CodeBlock} CodeBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CodeBlock message. + * @function verify + * @memberof google.cloud.ces.v1beta.CodeBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CodeBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) + if (!$util.isString(message.pythonCode)) + return "pythonCode: string expected"; + return null; + }; + + /** + * Creates a CodeBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CodeBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CodeBlock} CodeBlock + */ + CodeBlock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CodeBlock) + return object; + var message = new $root.google.cloud.ces.v1beta.CodeBlock(); + if (object.pythonCode != null) + message.pythonCode = String(object.pythonCode); + return message; + }; + + /** + * Creates a plain object from a CodeBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CodeBlock + * @static + * @param {google.cloud.ces.v1beta.CodeBlock} message CodeBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CodeBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.pythonCode = ""; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) + object.pythonCode = message.pythonCode; + return object; + }; + + /** + * Converts this CodeBlock to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CodeBlock + * @instance + * @returns {Object.} JSON object + */ + CodeBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CodeBlock + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CodeBlock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CodeBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CodeBlock"; + }; + + return CodeBlock; + })(); + + v1beta.ToolFakeConfig = (function() { + + /** + * Properties of a ToolFakeConfig. + * @memberof google.cloud.ces.v1beta + * @interface IToolFakeConfig + * @property {google.cloud.ces.v1beta.ICodeBlock|null} [codeBlock] ToolFakeConfig codeBlock + * @property {boolean|null} [enableFakeMode] ToolFakeConfig enableFakeMode + */ + + /** + * Constructs a new ToolFakeConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ToolFakeConfig. + * @implements IToolFakeConfig + * @constructor + * @param {google.cloud.ces.v1beta.IToolFakeConfig=} [properties] Properties to set + */ + function ToolFakeConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolFakeConfig codeBlock. + * @member {google.cloud.ces.v1beta.ICodeBlock|null|undefined} codeBlock + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @instance + */ + ToolFakeConfig.prototype.codeBlock = null; + + /** + * ToolFakeConfig enableFakeMode. + * @member {boolean} enableFakeMode + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @instance + */ + ToolFakeConfig.prototype.enableFakeMode = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ToolFakeConfig toolResponse. + * @member {"codeBlock"|undefined} toolResponse + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @instance + */ + Object.defineProperty(ToolFakeConfig.prototype, "toolResponse", { + get: $util.oneOfGetter($oneOfFields = ["codeBlock"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ToolFakeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @static + * @param {google.cloud.ces.v1beta.IToolFakeConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ToolFakeConfig} ToolFakeConfig instance + */ + ToolFakeConfig.create = function create(properties) { + return new ToolFakeConfig(properties); + }; + + /** + * Encodes the specified ToolFakeConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ToolFakeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @static + * @param {google.cloud.ces.v1beta.IToolFakeConfig} message ToolFakeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolFakeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.codeBlock != null && Object.hasOwnProperty.call(message, "codeBlock")) + $root.google.cloud.ces.v1beta.CodeBlock.encode(message.codeBlock, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.enableFakeMode != null && Object.hasOwnProperty.call(message, "enableFakeMode")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableFakeMode); + return writer; + }; + + /** + * Encodes the specified ToolFakeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolFakeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @static + * @param {google.cloud.ces.v1beta.IToolFakeConfig} message ToolFakeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolFakeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolFakeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ToolFakeConfig} ToolFakeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolFakeConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ToolFakeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.codeBlock = $root.google.cloud.ces.v1beta.CodeBlock.decode(reader, reader.uint32()); + break; + } + case 2: { + message.enableFakeMode = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolFakeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ToolFakeConfig} ToolFakeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolFakeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolFakeConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolFakeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.codeBlock != null && message.hasOwnProperty("codeBlock")) { + properties.toolResponse = 1; + { + var error = $root.google.cloud.ces.v1beta.CodeBlock.verify(message.codeBlock); + if (error) + return "codeBlock." + error; + } + } + if (message.enableFakeMode != null && message.hasOwnProperty("enableFakeMode")) + if (typeof message.enableFakeMode !== "boolean") + return "enableFakeMode: boolean expected"; + return null; + }; + + /** + * Creates a ToolFakeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ToolFakeConfig} ToolFakeConfig + */ + ToolFakeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ToolFakeConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.ToolFakeConfig(); + if (object.codeBlock != null) { + if (typeof object.codeBlock !== "object") + throw TypeError(".google.cloud.ces.v1beta.ToolFakeConfig.codeBlock: object expected"); + message.codeBlock = $root.google.cloud.ces.v1beta.CodeBlock.fromObject(object.codeBlock); + } + if (object.enableFakeMode != null) + message.enableFakeMode = Boolean(object.enableFakeMode); + return message; + }; + + /** + * Creates a plain object from a ToolFakeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @static + * @param {google.cloud.ces.v1beta.ToolFakeConfig} message ToolFakeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolFakeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableFakeMode = false; + if (message.codeBlock != null && message.hasOwnProperty("codeBlock")) { + object.codeBlock = $root.google.cloud.ces.v1beta.CodeBlock.toObject(message.codeBlock, options); + if (options.oneofs) + object.toolResponse = "codeBlock"; + } + if (message.enableFakeMode != null && message.hasOwnProperty("enableFakeMode")) + object.enableFakeMode = message.enableFakeMode; + return object; + }; + + /** + * Converts this ToolFakeConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @instance + * @returns {Object.} JSON object + */ + ToolFakeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolFakeConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ToolFakeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolFakeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ToolFakeConfig"; + }; + + return ToolFakeConfig; + })(); + + /** + * GoldenRunMethod enum. + * @name google.cloud.ces.v1beta.GoldenRunMethod + * @enum {number} + * @property {number} GOLDEN_RUN_METHOD_UNSPECIFIED=0 GOLDEN_RUN_METHOD_UNSPECIFIED value + * @property {number} STABLE=1 STABLE value + * @property {number} NAIVE=2 NAIVE value + */ + v1beta.GoldenRunMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GOLDEN_RUN_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "STABLE"] = 1; + values[valuesById[2] = "NAIVE"] = 2; + return values; + })(); + + v1beta.Schema = (function() { + + /** + * Properties of a Schema. + * @memberof google.cloud.ces.v1beta + * @interface ISchema + * @property {google.cloud.ces.v1beta.Schema.Type|null} [type] Schema type + * @property {Object.|null} [properties] Schema properties + * @property {Array.|null} [required] Schema required + * @property {string|null} [description] Schema description + * @property {google.cloud.ces.v1beta.ISchema|null} [items] Schema items + * @property {boolean|null} [nullable] Schema nullable + * @property {boolean|null} [uniqueItems] Schema uniqueItems + * @property {Array.|null} [prefixItems] Schema prefixItems + * @property {google.cloud.ces.v1beta.ISchema|null} [additionalProperties] Schema additionalProperties + * @property {Array.|null} [anyOf] Schema anyOf + * @property {Array.|null} ["enum"] Schema enum + * @property {google.protobuf.IValue|null} ["default"] Schema default + * @property {string|null} [ref] Schema ref + * @property {Object.|null} [defs] Schema defs + * @property {string|null} [title] Schema title + * @property {number|Long|null} [minItems] Schema minItems + * @property {number|Long|null} [maxItems] Schema maxItems + * @property {number|null} [minimum] Schema minimum + * @property {number|null} [maximum] Schema maximum + */ + + /** + * Constructs a new Schema. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Schema. + * @implements ISchema + * @constructor + * @param {google.cloud.ces.v1beta.ISchema=} [properties] Properties to set + */ + function Schema(properties) { + this.properties = {}; + this.required = []; + this.prefixItems = []; + this.anyOf = []; + this["enum"] = []; + this.defs = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Schema type. + * @member {google.cloud.ces.v1beta.Schema.Type} type + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.type = 0; + + /** + * Schema properties. + * @member {Object.} properties + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.properties = $util.emptyObject; + + /** + * Schema required. + * @member {Array.} required + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.required = $util.emptyArray; + + /** + * Schema description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.description = ""; + + /** + * Schema items. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} items + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.items = null; + + /** + * Schema nullable. + * @member {boolean} nullable + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.nullable = false; + + /** + * Schema uniqueItems. + * @member {boolean} uniqueItems + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.uniqueItems = false; + + /** + * Schema prefixItems. + * @member {Array.} prefixItems + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.prefixItems = $util.emptyArray; + + /** + * Schema additionalProperties. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} additionalProperties + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.additionalProperties = null; + + /** + * Schema anyOf. + * @member {Array.} anyOf + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.anyOf = $util.emptyArray; + + /** + * Schema enum. + * @member {Array.} enum + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype["enum"] = $util.emptyArray; + + /** + * Schema default. + * @member {google.protobuf.IValue|null|undefined} default + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype["default"] = null; + + /** + * Schema ref. + * @member {string} ref + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.ref = ""; + + /** + * Schema defs. + * @member {Object.} defs + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.defs = $util.emptyObject; + + /** + * Schema title. + * @member {string} title + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.title = ""; + + /** + * Schema minItems. + * @member {number|Long} minItems + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.minItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Schema maxItems. + * @member {number|Long} maxItems + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.maxItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Schema minimum. + * @member {number|null|undefined} minimum + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.minimum = null; + + /** + * Schema maximum. + * @member {number|null|undefined} maximum + * @memberof google.cloud.ces.v1beta.Schema + * @instance + */ + Schema.prototype.maximum = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Schema.prototype, "_minimum", { + get: $util.oneOfGetter($oneOfFields = ["minimum"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Schema.prototype, "_maximum", { + get: $util.oneOfGetter($oneOfFields = ["maximum"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Schema instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Schema + * @static + * @param {google.cloud.ces.v1beta.ISchema=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Schema} Schema instance + */ + Schema.create = function create(properties) { + return new Schema(properties); + }; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.cloud.ces.v1beta.Schema.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Schema + * @static + * @param {google.cloud.ces.v1beta.ISchema} message Schema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), 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.ces.v1beta.Schema.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.required != null && message.required.length) + for (var i = 0; i < message.required.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.required[i]); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + $root.google.cloud.ces.v1beta.Schema.encode(message.items, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.nullable != null && Object.hasOwnProperty.call(message, "nullable")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.nullable); + if (message.uniqueItems != null && Object.hasOwnProperty.call(message, "uniqueItems")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.uniqueItems); + if (message.prefixItems != null && message.prefixItems.length) + for (var i = 0; i < message.prefixItems.length; ++i) + $root.google.cloud.ces.v1beta.Schema.encode(message.prefixItems[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalProperties != null && Object.hasOwnProperty.call(message, "additionalProperties")) + $root.google.cloud.ces.v1beta.Schema.encode(message.additionalProperties, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.anyOf != null && message.anyOf.length) + for (var i = 0; i < message.anyOf.length; ++i) + $root.google.cloud.ces.v1beta.Schema.encode(message.anyOf[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message["enum"] != null && message["enum"].length) + for (var i = 0; i < message["enum"].length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message["enum"][i]); + if (message["default"] != null && Object.hasOwnProperty.call(message, "default")) + $root.google.protobuf.Value.encode(message["default"], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.ref != null && Object.hasOwnProperty.call(message, "ref")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.ref); + if (message.defs != null && Object.hasOwnProperty.call(message, "defs")) + for (var keys = Object.keys(message.defs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.ces.v1beta.Schema.encode(message.defs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.title); + if (message.minItems != null && Object.hasOwnProperty.call(message, "minItems")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.minItems); + if (message.maxItems != null && Object.hasOwnProperty.call(message, "maxItems")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.maxItems); + if (message.minimum != null && Object.hasOwnProperty.call(message, "minimum")) + writer.uint32(/* id 18, wireType 1 =*/145).double(message.minimum); + if (message.maximum != null && Object.hasOwnProperty.call(message, "maximum")) + writer.uint32(/* id 19, wireType 1 =*/153).double(message.maximum); + return writer; + }; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Schema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Schema + * @static + * @param {google.cloud.ces.v1beta.ISchema} message Schema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Schema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Schema} Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schema.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Schema(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.properties[key] = value; + break; + } + case 3: { + if (!(message.required && message.required.length)) + message.required = []; + message.required.push(reader.string()); + break; + } + case 4: { + message.description = reader.string(); + break; + } + case 5: { + message.items = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + case 6: { + message.nullable = reader.bool(); + break; + } + case 7: { + message.uniqueItems = reader.bool(); + break; + } + case 8: { + if (!(message.prefixItems && message.prefixItems.length)) + message.prefixItems = []; + message.prefixItems.push($root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32())); + break; + } + case 9: { + message.additionalProperties = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.anyOf && message.anyOf.length)) + message.anyOf = []; + message.anyOf.push($root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32())); + break; + } + case 11: { + if (!(message["enum"] && message["enum"].length)) + message["enum"] = []; + message["enum"].push(reader.string()); + break; + } + case 12: { + message["default"] = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 13: { + message.ref = reader.string(); + break; + } + case 14: { + if (message.defs === $util.emptyObject) + message.defs = {}; + 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.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.defs[key] = value; + break; + } + case 15: { + message.title = reader.string(); + break; + } + case 16: { + message.minItems = reader.int64(); + break; + } + case 17: { + message.maxItems = reader.int64(); + break; + } + case 18: { + message.minimum = reader.double(); + break; + } + case 19: { + message.maximum = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Schema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Schema} Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Schema message. + * @function verify + * @memberof google.cloud.ces.v1beta.Schema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Schema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.properties[key[i]]); + if (error) + return "properties." + error; + } + } + if (message.required != null && message.hasOwnProperty("required")) { + if (!Array.isArray(message.required)) + return "required: array expected"; + for (var i = 0; i < message.required.length; ++i) + if (!$util.isString(message.required[i])) + return "required: string[] expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.items != null && message.hasOwnProperty("items")) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.items); + if (error) + return "items." + error; + } + if (message.nullable != null && message.hasOwnProperty("nullable")) + if (typeof message.nullable !== "boolean") + return "nullable: boolean expected"; + if (message.uniqueItems != null && message.hasOwnProperty("uniqueItems")) + if (typeof message.uniqueItems !== "boolean") + return "uniqueItems: boolean expected"; + if (message.prefixItems != null && message.hasOwnProperty("prefixItems")) { + if (!Array.isArray(message.prefixItems)) + return "prefixItems: array expected"; + for (var i = 0; i < message.prefixItems.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.prefixItems[i]); + if (error) + return "prefixItems." + error; + } + } + if (message.additionalProperties != null && message.hasOwnProperty("additionalProperties")) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.additionalProperties); + if (error) + return "additionalProperties." + error; + } + if (message.anyOf != null && message.hasOwnProperty("anyOf")) { + if (!Array.isArray(message.anyOf)) + return "anyOf: array expected"; + for (var i = 0; i < message.anyOf.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.anyOf[i]); + if (error) + return "anyOf." + error; + } + } + if (message["enum"] != null && message.hasOwnProperty("enum")) { + if (!Array.isArray(message["enum"])) + return "enum: array expected"; + for (var i = 0; i < message["enum"].length; ++i) + if (!$util.isString(message["enum"][i])) + return "enum: string[] expected"; + } + if (message["default"] != null && message.hasOwnProperty("default")) { + var error = $root.google.protobuf.Value.verify(message["default"]); + if (error) + return "default." + error; + } + if (message.ref != null && message.hasOwnProperty("ref")) + if (!$util.isString(message.ref)) + return "ref: string expected"; + if (message.defs != null && message.hasOwnProperty("defs")) { + if (!$util.isObject(message.defs)) + return "defs: object expected"; + var key = Object.keys(message.defs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.defs[key[i]]); + if (error) + return "defs." + error; + } + } + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.minItems != null && message.hasOwnProperty("minItems")) + if (!$util.isInteger(message.minItems) && !(message.minItems && $util.isInteger(message.minItems.low) && $util.isInteger(message.minItems.high))) + return "minItems: integer|Long expected"; + if (message.maxItems != null && message.hasOwnProperty("maxItems")) + if (!$util.isInteger(message.maxItems) && !(message.maxItems && $util.isInteger(message.maxItems.low) && $util.isInteger(message.maxItems.high))) + return "maxItems: integer|Long expected"; + if (message.minimum != null && message.hasOwnProperty("minimum")) { + properties._minimum = 1; + if (typeof message.minimum !== "number") + return "minimum: number expected"; + } + if (message.maximum != null && message.hasOwnProperty("maximum")) { + properties._maximum = 1; + if (typeof message.maximum !== "number") + return "maximum: number expected"; + } + return null; + }; + + /** + * Creates a Schema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Schema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Schema} Schema + */ + Schema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Schema) + return object; + var message = new $root.google.cloud.ces.v1beta.Schema(); + 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 "STRING": + case 1: + message.type = 1; + break; + case "INTEGER": + case 2: + message.type = 2; + break; + case "NUMBER": + case 3: + message.type = 3; + break; + case "BOOLEAN": + case 4: + message.type = 4; + break; + case "OBJECT": + case 5: + message.type = 5; + break; + case "ARRAY": + case 6: + message.type = 6; + break; + } + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.ces.v1beta.Schema.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Schema.properties: object expected"); + message.properties[keys[i]] = $root.google.cloud.ces.v1beta.Schema.fromObject(object.properties[keys[i]]); + } + } + if (object.required) { + if (!Array.isArray(object.required)) + throw TypeError(".google.cloud.ces.v1beta.Schema.required: array expected"); + message.required = []; + for (var i = 0; i < object.required.length; ++i) + message.required[i] = String(object.required[i]); + } + if (object.description != null) + message.description = String(object.description); + if (object.items != null) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.ces.v1beta.Schema.items: object expected"); + message.items = $root.google.cloud.ces.v1beta.Schema.fromObject(object.items); + } + if (object.nullable != null) + message.nullable = Boolean(object.nullable); + if (object.uniqueItems != null) + message.uniqueItems = Boolean(object.uniqueItems); + if (object.prefixItems) { + if (!Array.isArray(object.prefixItems)) + throw TypeError(".google.cloud.ces.v1beta.Schema.prefixItems: array expected"); + message.prefixItems = []; + for (var i = 0; i < object.prefixItems.length; ++i) { + if (typeof object.prefixItems[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Schema.prefixItems: object expected"); + message.prefixItems[i] = $root.google.cloud.ces.v1beta.Schema.fromObject(object.prefixItems[i]); + } + } + if (object.additionalProperties != null) { + if (typeof object.additionalProperties !== "object") + throw TypeError(".google.cloud.ces.v1beta.Schema.additionalProperties: object expected"); + message.additionalProperties = $root.google.cloud.ces.v1beta.Schema.fromObject(object.additionalProperties); + } + if (object.anyOf) { + if (!Array.isArray(object.anyOf)) + throw TypeError(".google.cloud.ces.v1beta.Schema.anyOf: array expected"); + message.anyOf = []; + for (var i = 0; i < object.anyOf.length; ++i) { + if (typeof object.anyOf[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Schema.anyOf: object expected"); + message.anyOf[i] = $root.google.cloud.ces.v1beta.Schema.fromObject(object.anyOf[i]); + } + } + if (object["enum"]) { + if (!Array.isArray(object["enum"])) + throw TypeError(".google.cloud.ces.v1beta.Schema.enum: array expected"); + message["enum"] = []; + for (var i = 0; i < object["enum"].length; ++i) + message["enum"][i] = String(object["enum"][i]); + } + if (object["default"] != null) { + if (typeof object["default"] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Schema.default: object expected"); + message["default"] = $root.google.protobuf.Value.fromObject(object["default"]); + } + if (object.ref != null) + message.ref = String(object.ref); + if (object.defs) { + if (typeof object.defs !== "object") + throw TypeError(".google.cloud.ces.v1beta.Schema.defs: object expected"); + message.defs = {}; + for (var keys = Object.keys(object.defs), i = 0; i < keys.length; ++i) { + if (typeof object.defs[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Schema.defs: object expected"); + message.defs[keys[i]] = $root.google.cloud.ces.v1beta.Schema.fromObject(object.defs[keys[i]]); + } + } + if (object.title != null) + message.title = String(object.title); + if (object.minItems != null) + if ($util.Long) + (message.minItems = $util.Long.fromValue(object.minItems)).unsigned = false; + else if (typeof object.minItems === "string") + message.minItems = parseInt(object.minItems, 10); + else if (typeof object.minItems === "number") + message.minItems = object.minItems; + else if (typeof object.minItems === "object") + message.minItems = new $util.LongBits(object.minItems.low >>> 0, object.minItems.high >>> 0).toNumber(); + if (object.maxItems != null) + if ($util.Long) + (message.maxItems = $util.Long.fromValue(object.maxItems)).unsigned = false; + else if (typeof object.maxItems === "string") + message.maxItems = parseInt(object.maxItems, 10); + else if (typeof object.maxItems === "number") + message.maxItems = object.maxItems; + else if (typeof object.maxItems === "object") + message.maxItems = new $util.LongBits(object.maxItems.low >>> 0, object.maxItems.high >>> 0).toNumber(); + if (object.minimum != null) + message.minimum = Number(object.minimum); + if (object.maximum != null) + message.maximum = Number(object.maximum); + return message; + }; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Schema + * @static + * @param {google.cloud.ces.v1beta.Schema} message Schema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Schema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.required = []; + object.prefixItems = []; + object.anyOf = []; + object["enum"] = []; + } + if (options.objects || options.defaults) { + object.properties = {}; + object.defs = {}; + } + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.description = ""; + object.items = null; + object.nullable = false; + object.uniqueItems = false; + object.additionalProperties = null; + object["default"] = null; + object.ref = ""; + object.title = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.minItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.minItems = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxItems = options.longs === String ? "0" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.ces.v1beta.Schema.Type[message.type] === undefined ? message.type : $root.google.cloud.ces.v1beta.Schema.Type[message.type] : message.type; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.cloud.ces.v1beta.Schema.toObject(message.properties[keys2[j]], options); + } + if (message.required && message.required.length) { + object.required = []; + for (var j = 0; j < message.required.length; ++j) + object.required[j] = message.required[j]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.items != null && message.hasOwnProperty("items")) + object.items = $root.google.cloud.ces.v1beta.Schema.toObject(message.items, options); + if (message.nullable != null && message.hasOwnProperty("nullable")) + object.nullable = message.nullable; + if (message.uniqueItems != null && message.hasOwnProperty("uniqueItems")) + object.uniqueItems = message.uniqueItems; + if (message.prefixItems && message.prefixItems.length) { + object.prefixItems = []; + for (var j = 0; j < message.prefixItems.length; ++j) + object.prefixItems[j] = $root.google.cloud.ces.v1beta.Schema.toObject(message.prefixItems[j], options); + } + if (message.additionalProperties != null && message.hasOwnProperty("additionalProperties")) + object.additionalProperties = $root.google.cloud.ces.v1beta.Schema.toObject(message.additionalProperties, options); + if (message.anyOf && message.anyOf.length) { + object.anyOf = []; + for (var j = 0; j < message.anyOf.length; ++j) + object.anyOf[j] = $root.google.cloud.ces.v1beta.Schema.toObject(message.anyOf[j], options); + } + if (message["enum"] && message["enum"].length) { + object["enum"] = []; + for (var j = 0; j < message["enum"].length; ++j) + object["enum"][j] = message["enum"][j]; + } + if (message["default"] != null && message.hasOwnProperty("default")) + object["default"] = $root.google.protobuf.Value.toObject(message["default"], options); + if (message.ref != null && message.hasOwnProperty("ref")) + object.ref = message.ref; + if (message.defs && (keys2 = Object.keys(message.defs)).length) { + object.defs = {}; + for (var j = 0; j < keys2.length; ++j) + object.defs[keys2[j]] = $root.google.cloud.ces.v1beta.Schema.toObject(message.defs[keys2[j]], options); + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.minItems != null && message.hasOwnProperty("minItems")) + if (typeof message.minItems === "number") + object.minItems = options.longs === String ? String(message.minItems) : message.minItems; + else + object.minItems = options.longs === String ? $util.Long.prototype.toString.call(message.minItems) : options.longs === Number ? new $util.LongBits(message.minItems.low >>> 0, message.minItems.high >>> 0).toNumber() : message.minItems; + if (message.maxItems != null && message.hasOwnProperty("maxItems")) + if (typeof message.maxItems === "number") + object.maxItems = options.longs === String ? String(message.maxItems) : message.maxItems; + else + object.maxItems = options.longs === String ? $util.Long.prototype.toString.call(message.maxItems) : options.longs === Number ? new $util.LongBits(message.maxItems.low >>> 0, message.maxItems.high >>> 0).toNumber() : message.maxItems; + if (message.minimum != null && message.hasOwnProperty("minimum")) { + object.minimum = options.json && !isFinite(message.minimum) ? String(message.minimum) : message.minimum; + if (options.oneofs) + object._minimum = "minimum"; + } + if (message.maximum != null && message.hasOwnProperty("maximum")) { + object.maximum = options.json && !isFinite(message.maximum) ? String(message.maximum) : message.maximum; + if (options.oneofs) + object._maximum = "maximum"; + } + return object; + }; + + /** + * Converts this Schema to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Schema + * @instance + * @returns {Object.} JSON object + */ + Schema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Schema + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Schema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Schema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Schema"; + }; + + /** + * Type enum. + * @name google.cloud.ces.v1beta.Schema.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} INTEGER=2 INTEGER value + * @property {number} NUMBER=3 NUMBER value + * @property {number} BOOLEAN=4 BOOLEAN value + * @property {number} OBJECT=5 OBJECT value + * @property {number} ARRAY=6 ARRAY value + */ + Schema.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "INTEGER"] = 2; + values[valuesById[3] = "NUMBER"] = 3; + values[valuesById[4] = "BOOLEAN"] = 4; + values[valuesById[5] = "OBJECT"] = 5; + values[valuesById[6] = "ARRAY"] = 6; + return values; + })(); + + return Schema; + })(); + + v1beta.AppSnapshot = (function() { + + /** + * Properties of an AppSnapshot. + * @memberof google.cloud.ces.v1beta + * @interface IAppSnapshot + * @property {google.cloud.ces.v1beta.IApp|null} [app] AppSnapshot app + * @property {Array.|null} [agents] AppSnapshot agents + * @property {Array.|null} [tools] AppSnapshot tools + * @property {Array.|null} [examples] AppSnapshot examples + * @property {Array.|null} [guardrails] AppSnapshot guardrails + * @property {Array.|null} [toolsets] AppSnapshot toolsets + */ + + /** + * Constructs a new AppSnapshot. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an AppSnapshot. + * @implements IAppSnapshot + * @constructor + * @param {google.cloud.ces.v1beta.IAppSnapshot=} [properties] Properties to set + */ + function AppSnapshot(properties) { + this.agents = []; + this.tools = []; + this.examples = []; + this.guardrails = []; + this.toolsets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppSnapshot app. + * @member {google.cloud.ces.v1beta.IApp|null|undefined} app + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @instance + */ + AppSnapshot.prototype.app = null; + + /** + * AppSnapshot agents. + * @member {Array.} agents + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @instance + */ + AppSnapshot.prototype.agents = $util.emptyArray; + + /** + * AppSnapshot tools. + * @member {Array.} tools + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @instance + */ + AppSnapshot.prototype.tools = $util.emptyArray; + + /** + * AppSnapshot examples. + * @member {Array.} examples + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @instance + */ + AppSnapshot.prototype.examples = $util.emptyArray; + + /** + * AppSnapshot guardrails. + * @member {Array.} guardrails + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @instance + */ + AppSnapshot.prototype.guardrails = $util.emptyArray; + + /** + * AppSnapshot toolsets. + * @member {Array.} toolsets + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @instance + */ + AppSnapshot.prototype.toolsets = $util.emptyArray; + + /** + * Creates a new AppSnapshot instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @static + * @param {google.cloud.ces.v1beta.IAppSnapshot=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AppSnapshot} AppSnapshot instance + */ + AppSnapshot.create = function create(properties) { + return new AppSnapshot(properties); + }; + + /** + * Encodes the specified AppSnapshot message. Does not implicitly {@link google.cloud.ces.v1beta.AppSnapshot.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @static + * @param {google.cloud.ces.v1beta.IAppSnapshot} message AppSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppSnapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + $root.google.cloud.ces.v1beta.App.encode(message.app, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.agents != null && message.agents.length) + for (var i = 0; i < message.agents.length; ++i) + $root.google.cloud.ces.v1beta.Agent.encode(message.agents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + $root.google.cloud.ces.v1beta.Tool.encode(message.tools[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.examples != null && message.examples.length) + for (var i = 0; i < message.examples.length; ++i) + $root.google.cloud.ces.v1beta.Example.encode(message.examples[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.guardrails != null && message.guardrails.length) + for (var i = 0; i < message.guardrails.length; ++i) + $root.google.cloud.ces.v1beta.Guardrail.encode(message.guardrails[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.toolsets != null && message.toolsets.length) + for (var i = 0; i < message.toolsets.length; ++i) + $root.google.cloud.ces.v1beta.Toolset.encode(message.toolsets[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AppSnapshot message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AppSnapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @static + * @param {google.cloud.ces.v1beta.IAppSnapshot} message AppSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppSnapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppSnapshot message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AppSnapshot} AppSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppSnapshot.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AppSnapshot(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.app = $root.google.cloud.ces.v1beta.App.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.agents && message.agents.length)) + message.agents = []; + message.agents.push($root.google.cloud.ces.v1beta.Agent.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push($root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.examples && message.examples.length)) + message.examples = []; + message.examples.push($root.google.cloud.ces.v1beta.Example.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.guardrails && message.guardrails.length)) + message.guardrails = []; + message.guardrails.push($root.google.cloud.ces.v1beta.Guardrail.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.toolsets && message.toolsets.length)) + message.toolsets = []; + message.toolsets.push($root.google.cloud.ces.v1beta.Toolset.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AppSnapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AppSnapshot} AppSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppSnapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppSnapshot message. + * @function verify + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppSnapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.app != null && message.hasOwnProperty("app")) { + var error = $root.google.cloud.ces.v1beta.App.verify(message.app); + if (error) + return "app." + error; + } + if (message.agents != null && message.hasOwnProperty("agents")) { + if (!Array.isArray(message.agents)) + return "agents: array expected"; + for (var i = 0; i < message.agents.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Agent.verify(message.agents[i]); + if (error) + return "agents." + error; + } + } + if (message.tools != null && message.hasOwnProperty("tools")) { + if (!Array.isArray(message.tools)) + return "tools: array expected"; + for (var i = 0; i < message.tools.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tools[i]); + if (error) + return "tools." + error; + } + } + if (message.examples != null && message.hasOwnProperty("examples")) { + if (!Array.isArray(message.examples)) + return "examples: array expected"; + for (var i = 0; i < message.examples.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Example.verify(message.examples[i]); + if (error) + return "examples." + error; + } + } + if (message.guardrails != null && message.hasOwnProperty("guardrails")) { + if (!Array.isArray(message.guardrails)) + return "guardrails: array expected"; + for (var i = 0; i < message.guardrails.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Guardrail.verify(message.guardrails[i]); + if (error) + return "guardrails." + error; + } + } + if (message.toolsets != null && message.hasOwnProperty("toolsets")) { + if (!Array.isArray(message.toolsets)) + return "toolsets: array expected"; + for (var i = 0; i < message.toolsets.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Toolset.verify(message.toolsets[i]); + if (error) + return "toolsets." + error; + } + } + return null; + }; + + /** + * Creates an AppSnapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AppSnapshot} AppSnapshot + */ + AppSnapshot.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AppSnapshot) + return object; + var message = new $root.google.cloud.ces.v1beta.AppSnapshot(); + if (object.app != null) { + if (typeof object.app !== "object") + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.app: object expected"); + message.app = $root.google.cloud.ces.v1beta.App.fromObject(object.app); + } + if (object.agents) { + if (!Array.isArray(object.agents)) + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.agents: array expected"); + message.agents = []; + for (var i = 0; i < object.agents.length; ++i) { + if (typeof object.agents[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.agents: object expected"); + message.agents[i] = $root.google.cloud.ces.v1beta.Agent.fromObject(object.agents[i]); + } + } + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) { + if (typeof object.tools[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.tools: object expected"); + message.tools[i] = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tools[i]); + } + } + if (object.examples) { + if (!Array.isArray(object.examples)) + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.examples: array expected"); + message.examples = []; + for (var i = 0; i < object.examples.length; ++i) { + if (typeof object.examples[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.examples: object expected"); + message.examples[i] = $root.google.cloud.ces.v1beta.Example.fromObject(object.examples[i]); + } + } + if (object.guardrails) { + if (!Array.isArray(object.guardrails)) + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.guardrails: array expected"); + message.guardrails = []; + for (var i = 0; i < object.guardrails.length; ++i) { + if (typeof object.guardrails[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.guardrails: object expected"); + message.guardrails[i] = $root.google.cloud.ces.v1beta.Guardrail.fromObject(object.guardrails[i]); + } + } + if (object.toolsets) { + if (!Array.isArray(object.toolsets)) + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.toolsets: array expected"); + message.toolsets = []; + for (var i = 0; i < object.toolsets.length; ++i) { + if (typeof object.toolsets[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AppSnapshot.toolsets: object expected"); + message.toolsets[i] = $root.google.cloud.ces.v1beta.Toolset.fromObject(object.toolsets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AppSnapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @static + * @param {google.cloud.ces.v1beta.AppSnapshot} message AppSnapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppSnapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.agents = []; + object.tools = []; + object.examples = []; + object.guardrails = []; + object.toolsets = []; + } + if (options.defaults) + object.app = null; + if (message.app != null && message.hasOwnProperty("app")) + object.app = $root.google.cloud.ces.v1beta.App.toObject(message.app, options); + if (message.agents && message.agents.length) { + object.agents = []; + for (var j = 0; j < message.agents.length; ++j) + object.agents[j] = $root.google.cloud.ces.v1beta.Agent.toObject(message.agents[j], options); + } + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = $root.google.cloud.ces.v1beta.Tool.toObject(message.tools[j], options); + } + if (message.examples && message.examples.length) { + object.examples = []; + for (var j = 0; j < message.examples.length; ++j) + object.examples[j] = $root.google.cloud.ces.v1beta.Example.toObject(message.examples[j], options); + } + if (message.guardrails && message.guardrails.length) { + object.guardrails = []; + for (var j = 0; j < message.guardrails.length; ++j) + object.guardrails[j] = $root.google.cloud.ces.v1beta.Guardrail.toObject(message.guardrails[j], options); + } + if (message.toolsets && message.toolsets.length) { + object.toolsets = []; + for (var j = 0; j < message.toolsets.length; ++j) + object.toolsets[j] = $root.google.cloud.ces.v1beta.Toolset.toObject(message.toolsets[j], options); + } + return object; + }; + + /** + * Converts this AppSnapshot to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @instance + * @returns {Object.} JSON object + */ + AppSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AppSnapshot + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AppSnapshot + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AppSnapshot"; + }; + + return AppSnapshot; + })(); + + v1beta.AppVersion = (function() { + + /** + * Properties of an AppVersion. + * @memberof google.cloud.ces.v1beta + * @interface IAppVersion + * @property {string|null} [name] AppVersion name + * @property {string|null} [displayName] AppVersion displayName + * @property {string|null} [description] AppVersion description + * @property {string|null} [creator] AppVersion creator + * @property {google.protobuf.ITimestamp|null} [createTime] AppVersion createTime + * @property {google.cloud.ces.v1beta.IAppSnapshot|null} [snapshot] AppVersion snapshot + * @property {string|null} [etag] AppVersion etag + */ + + /** + * Constructs a new AppVersion. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an AppVersion. + * @implements IAppVersion + * @constructor + * @param {google.cloud.ces.v1beta.IAppVersion=} [properties] Properties to set + */ + function AppVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppVersion name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.AppVersion + * @instance + */ + AppVersion.prototype.name = ""; + + /** + * AppVersion displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.AppVersion + * @instance + */ + AppVersion.prototype.displayName = ""; + + /** + * AppVersion description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.AppVersion + * @instance + */ + AppVersion.prototype.description = ""; + + /** + * AppVersion creator. + * @member {string} creator + * @memberof google.cloud.ces.v1beta.AppVersion + * @instance + */ + AppVersion.prototype.creator = ""; + + /** + * AppVersion createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.AppVersion + * @instance + */ + AppVersion.prototype.createTime = null; + + /** + * AppVersion snapshot. + * @member {google.cloud.ces.v1beta.IAppSnapshot|null|undefined} snapshot + * @memberof google.cloud.ces.v1beta.AppVersion + * @instance + */ + AppVersion.prototype.snapshot = null; + + /** + * AppVersion etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.AppVersion + * @instance + */ + AppVersion.prototype.etag = ""; + + /** + * Creates a new AppVersion instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AppVersion + * @static + * @param {google.cloud.ces.v1beta.IAppVersion=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AppVersion} AppVersion instance + */ + AppVersion.create = function create(properties) { + return new AppVersion(properties); + }; + + /** + * Encodes the specified AppVersion message. Does not implicitly {@link google.cloud.ces.v1beta.AppVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AppVersion + * @static + * @param {google.cloud.ces.v1beta.IAppVersion} message AppVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppVersion.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.creator); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + $root.google.cloud.ces.v1beta.AppSnapshot.encode(message.snapshot, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AppVersion message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AppVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AppVersion + * @static + * @param {google.cloud.ces.v1beta.IAppVersion} message AppVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AppVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AppVersion} AppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppVersion.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AppVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.creator = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.snapshot = $root.google.cloud.ces.v1beta.AppSnapshot.decode(reader, reader.uint32()); + break; + } + case 7: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AppVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AppVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AppVersion} AppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppVersion message. + * @function verify + * @memberof google.cloud.ces.v1beta.AppVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppVersion.verify = function verify(message) { + if (typeof message !== "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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: 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.snapshot != null && message.hasOwnProperty("snapshot")) { + var error = $root.google.cloud.ces.v1beta.AppSnapshot.verify(message.snapshot); + if (error) + return "snapshot." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an AppVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AppVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AppVersion} AppVersion + */ + AppVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AppVersion) + return object; + var message = new $root.google.cloud.ces.v1beta.AppVersion(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.creator != null) + message.creator = String(object.creator); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.AppVersion.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.snapshot != null) { + if (typeof object.snapshot !== "object") + throw TypeError(".google.cloud.ces.v1beta.AppVersion.snapshot: object expected"); + message.snapshot = $root.google.cloud.ces.v1beta.AppSnapshot.fromObject(object.snapshot); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an AppVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AppVersion + * @static + * @param {google.cloud.ces.v1beta.AppVersion} message AppVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.creator = ""; + object.createTime = null; + object.etag = ""; + object.snapshot = 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = $root.google.cloud.ces.v1beta.AppSnapshot.toObject(message.snapshot, options); + return object; + }; + + /** + * Converts this AppVersion to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AppVersion + * @instance + * @returns {Object.} JSON object + */ + AppVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AppVersion + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AppVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AppVersion"; + }; + + return AppVersion; + })(); + + v1beta.Example = (function() { + + /** + * Properties of an Example. + * @memberof google.cloud.ces.v1beta + * @interface IExample + * @property {string|null} [name] Example name + * @property {string|null} [displayName] Example displayName + * @property {string|null} [description] Example description + * @property {string|null} [entryAgent] Example entryAgent + * @property {Array.|null} [messages] Example messages + * @property {google.protobuf.ITimestamp|null} [createTime] Example createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Example updateTime + * @property {boolean|null} [invalid] Example invalid + * @property {string|null} [etag] Example etag + */ + + /** + * Constructs a new Example. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an Example. + * @implements IExample + * @constructor + * @param {google.cloud.ces.v1beta.IExample=} [properties] Properties to set + */ + function Example(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Example name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Example + * @instance + */ + Example.prototype.name = ""; + + /** + * Example displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.Example + * @instance + */ + Example.prototype.displayName = ""; + + /** + * Example description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.Example + * @instance + */ + Example.prototype.description = ""; + + /** + * Example entryAgent. + * @member {string} entryAgent + * @memberof google.cloud.ces.v1beta.Example + * @instance + */ + Example.prototype.entryAgent = ""; + + /** + * Example messages. + * @member {Array.} messages + * @memberof google.cloud.ces.v1beta.Example + * @instance + */ + Example.prototype.messages = $util.emptyArray; + + /** + * Example createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.Example + * @instance + */ + Example.prototype.createTime = null; + + /** + * Example updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.Example + * @instance + */ + Example.prototype.updateTime = null; + + /** + * Example invalid. + * @member {boolean} invalid + * @memberof google.cloud.ces.v1beta.Example + * @instance + */ + Example.prototype.invalid = false; + + /** + * Example etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.Example + * @instance + */ + Example.prototype.etag = ""; + + /** + * Creates a new Example instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Example + * @static + * @param {google.cloud.ces.v1beta.IExample=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Example} Example instance + */ + Example.create = function create(properties) { + return new Example(properties); + }; + + /** + * Encodes the specified Example message. Does not implicitly {@link google.cloud.ces.v1beta.Example.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Example + * @static + * @param {google.cloud.ces.v1beta.IExample} message Example message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Example.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.entryAgent != null && Object.hasOwnProperty.call(message, "entryAgent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.entryAgent); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.ces.v1beta.Message.encode(message.messages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.invalid != null && Object.hasOwnProperty.call(message, "invalid")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.invalid); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + return writer; + }; + + /** + * Encodes the specified Example message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Example.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Example + * @static + * @param {google.cloud.ces.v1beta.IExample} message Example message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Example.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Example message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Example + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Example} Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Example.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Example(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.entryAgent = reader.string(); + break; + } + case 5: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32())); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.invalid = reader.bool(); + break; + } + case 9: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Example message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Example + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Example} Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Example.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Example message. + * @function verify + * @memberof google.cloud.ces.v1beta.Example + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Example.verify = function verify(message) { + if (typeof message !== "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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) + if (!$util.isString(message.entryAgent)) + return "entryAgent: string expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + 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.invalid != null && message.hasOwnProperty("invalid")) + if (typeof message.invalid !== "boolean") + return "invalid: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an Example message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Example + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Example} Example + */ + Example.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Example) + return object; + var message = new $root.google.cloud.ces.v1beta.Example(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.entryAgent != null) + message.entryAgent = String(object.entryAgent); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.ces.v1beta.Example.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Example.messages: object expected"); + message.messages[i] = $root.google.cloud.ces.v1beta.Message.fromObject(object.messages[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Example.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.ces.v1beta.Example.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.invalid != null) + message.invalid = Boolean(object.invalid); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an Example message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Example + * @static + * @param {google.cloud.ces.v1beta.Example} message Example + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Example.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.entryAgent = ""; + object.createTime = null; + object.updateTime = null; + object.invalid = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) + object.entryAgent = message.entryAgent; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.ces.v1beta.Message.toObject(message.messages[j], options); + } + 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.invalid != null && message.hasOwnProperty("invalid")) + object.invalid = message.invalid; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this Example to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Example + * @instance + * @returns {Object.} JSON object + */ + Example.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Example + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Example + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Example.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Example"; + }; + + return Example; + })(); + + v1beta.Message = (function() { + + /** + * Properties of a Message. + * @memberof google.cloud.ces.v1beta + * @interface IMessage + * @property {string|null} [role] Message role + * @property {Array.|null} [chunks] Message chunks + * @property {google.protobuf.ITimestamp|null} [eventTime] Message eventTime + */ + + /** + * Constructs a new Message. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Message. + * @implements IMessage + * @constructor + * @param {google.cloud.ces.v1beta.IMessage=} [properties] Properties to set + */ + function Message(properties) { + this.chunks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Message role. + * @member {string} role + * @memberof google.cloud.ces.v1beta.Message + * @instance + */ + Message.prototype.role = ""; + + /** + * Message chunks. + * @member {Array.} chunks + * @memberof google.cloud.ces.v1beta.Message + * @instance + */ + Message.prototype.chunks = $util.emptyArray; + + /** + * Message eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.ces.v1beta.Message + * @instance + */ + Message.prototype.eventTime = null; + + /** + * Creates a new Message instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Message + * @static + * @param {google.cloud.ces.v1beta.IMessage=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Message} Message instance + */ + Message.create = function create(properties) { + return new Message(properties); + }; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.ces.v1beta.Message.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Message + * @static + * @param {google.cloud.ces.v1beta.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.chunks != null && message.chunks.length) + for (var i = 0; i < message.chunks.length; ++i) + $root.google.cloud.ces.v1beta.Chunk.encode(message.chunks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Message.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Message + * @static + * @param {google.cloud.ces.v1beta.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Message message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Message(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.chunks && message.chunks.length)) + message.chunks = []; + message.chunks.push($root.google.cloud.ces.v1beta.Chunk.decode(reader, reader.uint32())); + break; + } + case 4: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Message message. + * @function verify + * @memberof google.cloud.ces.v1beta.Message + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Message.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.chunks != null && message.hasOwnProperty("chunks")) { + if (!Array.isArray(message.chunks)) + return "chunks: array expected"; + for (var i = 0; i < message.chunks.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Chunk.verify(message.chunks[i]); + if (error) + return "chunks." + error; + } + } + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + return null; + }; + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Message + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Message} Message + */ + Message.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Message) + return object; + var message = new $root.google.cloud.ces.v1beta.Message(); + if (object.role != null) + message.role = String(object.role); + if (object.chunks) { + if (!Array.isArray(object.chunks)) + throw TypeError(".google.cloud.ces.v1beta.Message.chunks: array expected"); + message.chunks = []; + for (var i = 0; i < object.chunks.length; ++i) { + if (typeof object.chunks[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Message.chunks: object expected"); + message.chunks[i] = $root.google.cloud.ces.v1beta.Chunk.fromObject(object.chunks[i]); + } + } + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Message.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + return message; + }; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Message + * @static + * @param {google.cloud.ces.v1beta.Message} message Message + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Message.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.chunks = []; + if (options.defaults) { + object.role = ""; + object.eventTime = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.chunks && message.chunks.length) { + object.chunks = []; + for (var j = 0; j < message.chunks.length; ++j) + object.chunks[j] = $root.google.cloud.ces.v1beta.Chunk.toObject(message.chunks[j], options); + } + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + return object; + }; + + /** + * Converts this Message to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Message + * @instance + * @returns {Object.} JSON object + */ + Message.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Message + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Message + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Message"; + }; + + return Message; + })(); + + v1beta.Chunk = (function() { + + /** + * Properties of a Chunk. + * @memberof google.cloud.ces.v1beta + * @interface IChunk + * @property {string|null} [text] Chunk text + * @property {string|null} [transcript] Chunk transcript + * @property {google.cloud.ces.v1beta.IBlob|null} [blob] Chunk blob + * @property {google.protobuf.IStruct|null} [payload] Chunk payload + * @property {google.cloud.ces.v1beta.IImage|null} [image] Chunk image + * @property {google.cloud.ces.v1beta.IToolCall|null} [toolCall] Chunk toolCall + * @property {google.cloud.ces.v1beta.IToolResponse|null} [toolResponse] Chunk toolResponse + * @property {google.cloud.ces.v1beta.IAgentTransfer|null} [agentTransfer] Chunk agentTransfer + * @property {google.protobuf.IStruct|null} [updatedVariables] Chunk updatedVariables + * @property {google.protobuf.IStruct|null} [defaultVariables] Chunk defaultVariables + */ + + /** + * Constructs a new Chunk. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Chunk. + * @implements IChunk + * @constructor + * @param {google.cloud.ces.v1beta.IChunk=} [properties] Properties to set + */ + function Chunk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Chunk text. + * @member {string|null|undefined} text + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.text = null; + + /** + * Chunk transcript. + * @member {string|null|undefined} transcript + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.transcript = null; + + /** + * Chunk blob. + * @member {google.cloud.ces.v1beta.IBlob|null|undefined} blob + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.blob = null; + + /** + * Chunk payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.payload = null; + + /** + * Chunk image. + * @member {google.cloud.ces.v1beta.IImage|null|undefined} image + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.image = null; + + /** + * Chunk toolCall. + * @member {google.cloud.ces.v1beta.IToolCall|null|undefined} toolCall + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.toolCall = null; + + /** + * Chunk toolResponse. + * @member {google.cloud.ces.v1beta.IToolResponse|null|undefined} toolResponse + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.toolResponse = null; + + /** + * Chunk agentTransfer. + * @member {google.cloud.ces.v1beta.IAgentTransfer|null|undefined} agentTransfer + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.agentTransfer = null; + + /** + * Chunk updatedVariables. + * @member {google.protobuf.IStruct|null|undefined} updatedVariables + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.updatedVariables = null; + + /** + * Chunk defaultVariables. + * @member {google.protobuf.IStruct|null|undefined} defaultVariables + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Chunk.prototype.defaultVariables = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Chunk data. + * @member {"text"|"transcript"|"blob"|"payload"|"image"|"toolCall"|"toolResponse"|"agentTransfer"|"updatedVariables"|"defaultVariables"|undefined} data + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + */ + Object.defineProperty(Chunk.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["text", "transcript", "blob", "payload", "image", "toolCall", "toolResponse", "agentTransfer", "updatedVariables", "defaultVariables"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Chunk instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Chunk + * @static + * @param {google.cloud.ces.v1beta.IChunk=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Chunk} Chunk instance + */ + Chunk.create = function create(properties) { + return new Chunk(properties); + }; + + /** + * Encodes the specified Chunk message. Does not implicitly {@link google.cloud.ces.v1beta.Chunk.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Chunk + * @static + * @param {google.cloud.ces.v1beta.IChunk} message Chunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.toolCall != null && Object.hasOwnProperty.call(message, "toolCall")) + $root.google.cloud.ces.v1beta.ToolCall.encode(message.toolCall, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolResponse != null && Object.hasOwnProperty.call(message, "toolResponse")) + $root.google.cloud.ces.v1beta.ToolResponse.encode(message.toolResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.agentTransfer != null && Object.hasOwnProperty.call(message, "agentTransfer")) + $root.google.cloud.ces.v1beta.AgentTransfer.encode(message.agentTransfer, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.ces.v1beta.Image.encode(message.image, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.blob != null && Object.hasOwnProperty.call(message, "blob")) + $root.google.cloud.ces.v1beta.Blob.encode(message.blob, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.updatedVariables != null && Object.hasOwnProperty.call(message, "updatedVariables")) + $root.google.protobuf.Struct.encode(message.updatedVariables, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.transcript); + if (message.defaultVariables != null && Object.hasOwnProperty.call(message, "defaultVariables")) + $root.google.protobuf.Struct.encode(message.defaultVariables, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Chunk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Chunk + * @static + * @param {google.cloud.ces.v1beta.IChunk} message Chunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Chunk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Chunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Chunk} Chunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chunk.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Chunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 9: { + message.transcript = reader.string(); + break; + } + case 7: { + message.blob = $root.google.cloud.ces.v1beta.Blob.decode(reader, reader.uint32()); + break; + } + case 11: { + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 5: { + message.image = $root.google.cloud.ces.v1beta.Image.decode(reader, reader.uint32()); + break; + } + case 2: { + message.toolCall = $root.google.cloud.ces.v1beta.ToolCall.decode(reader, reader.uint32()); + break; + } + case 3: { + message.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32()); + break; + } + case 4: { + message.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.decode(reader, reader.uint32()); + break; + } + case 8: { + message.updatedVariables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 10: { + message.defaultVariables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Chunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Chunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Chunk} Chunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Chunk message. + * @function verify + * @memberof google.cloud.ces.v1beta.Chunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Chunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.data = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + } + if (message.blob != null && message.hasOwnProperty("blob")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.ces.v1beta.Blob.verify(message.blob); + if (error) + return "blob." + error; + } + } + if (message.payload != null && message.hasOwnProperty("payload")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.protobuf.Struct.verify(message.payload); + if (error) + return "payload." + error; + } + } + if (message.image != null && message.hasOwnProperty("image")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.ces.v1beta.Image.verify(message.image); + if (error) + return "image." + error; + } + } + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolCall.verify(message.toolCall); + if (error) + return "toolCall." + error; + } + } + if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.toolResponse); + if (error) + return "toolResponse." + error; + } + } + if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.ces.v1beta.AgentTransfer.verify(message.agentTransfer); + if (error) + return "agentTransfer." + error; + } + } + if (message.updatedVariables != null && message.hasOwnProperty("updatedVariables")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.protobuf.Struct.verify(message.updatedVariables); + if (error) + return "updatedVariables." + error; + } + } + if (message.defaultVariables != null && message.hasOwnProperty("defaultVariables")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.protobuf.Struct.verify(message.defaultVariables); + if (error) + return "defaultVariables." + error; + } + } + return null; + }; + + /** + * Creates a Chunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Chunk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Chunk} Chunk + */ + Chunk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Chunk) + return object; + var message = new $root.google.cloud.ces.v1beta.Chunk(); + if (object.text != null) + message.text = String(object.text); + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.blob != null) { + if (typeof object.blob !== "object") + throw TypeError(".google.cloud.ces.v1beta.Chunk.blob: object expected"); + message.blob = $root.google.cloud.ces.v1beta.Blob.fromObject(object.blob); + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.ces.v1beta.Chunk.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload); + } + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.ces.v1beta.Chunk.image: object expected"); + message.image = $root.google.cloud.ces.v1beta.Image.fromObject(object.image); + } + if (object.toolCall != null) { + if (typeof object.toolCall !== "object") + throw TypeError(".google.cloud.ces.v1beta.Chunk.toolCall: object expected"); + message.toolCall = $root.google.cloud.ces.v1beta.ToolCall.fromObject(object.toolCall); + } + if (object.toolResponse != null) { + if (typeof object.toolResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.Chunk.toolResponse: object expected"); + message.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.toolResponse); + } + if (object.agentTransfer != null) { + if (typeof object.agentTransfer !== "object") + throw TypeError(".google.cloud.ces.v1beta.Chunk.agentTransfer: object expected"); + message.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.fromObject(object.agentTransfer); + } + if (object.updatedVariables != null) { + if (typeof object.updatedVariables !== "object") + throw TypeError(".google.cloud.ces.v1beta.Chunk.updatedVariables: object expected"); + message.updatedVariables = $root.google.protobuf.Struct.fromObject(object.updatedVariables); + } + if (object.defaultVariables != null) { + if (typeof object.defaultVariables !== "object") + throw TypeError(".google.cloud.ces.v1beta.Chunk.defaultVariables: object expected"); + message.defaultVariables = $root.google.protobuf.Struct.fromObject(object.defaultVariables); + } + return message; + }; + + /** + * Creates a plain object from a Chunk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Chunk + * @static + * @param {google.cloud.ces.v1beta.Chunk} message Chunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Chunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.data = "text"; + } + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + object.toolCall = $root.google.cloud.ces.v1beta.ToolCall.toObject(message.toolCall, options); + if (options.oneofs) + object.data = "toolCall"; + } + if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { + object.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.toolResponse, options); + if (options.oneofs) + object.data = "toolResponse"; + } + if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { + object.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.toObject(message.agentTransfer, options); + if (options.oneofs) + object.data = "agentTransfer"; + } + if (message.image != null && message.hasOwnProperty("image")) { + object.image = $root.google.cloud.ces.v1beta.Image.toObject(message.image, options); + if (options.oneofs) + object.data = "image"; + } + if (message.blob != null && message.hasOwnProperty("blob")) { + object.blob = $root.google.cloud.ces.v1beta.Blob.toObject(message.blob, options); + if (options.oneofs) + object.data = "blob"; + } + if (message.updatedVariables != null && message.hasOwnProperty("updatedVariables")) { + object.updatedVariables = $root.google.protobuf.Struct.toObject(message.updatedVariables, options); + if (options.oneofs) + object.data = "updatedVariables"; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) { + object.transcript = message.transcript; + if (options.oneofs) + object.data = "transcript"; + } + if (message.defaultVariables != null && message.hasOwnProperty("defaultVariables")) { + object.defaultVariables = $root.google.protobuf.Struct.toObject(message.defaultVariables, options); + if (options.oneofs) + object.data = "defaultVariables"; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (options.oneofs) + object.data = "payload"; + } + return object; + }; + + /** + * Converts this Chunk to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Chunk + * @instance + * @returns {Object.} JSON object + */ + Chunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Chunk + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Chunk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Chunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Chunk"; + }; + + return Chunk; + })(); + + v1beta.Blob = (function() { + + /** + * Properties of a Blob. + * @memberof google.cloud.ces.v1beta + * @interface IBlob + * @property {string|null} [mimeType] Blob mimeType + * @property {Uint8Array|null} [data] Blob data + */ + + /** + * Constructs a new Blob. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Blob. + * @implements IBlob + * @constructor + * @param {google.cloud.ces.v1beta.IBlob=} [properties] Properties to set + */ + function Blob(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Blob mimeType. + * @member {string} mimeType + * @memberof google.cloud.ces.v1beta.Blob + * @instance + */ + Blob.prototype.mimeType = ""; + + /** + * Blob data. + * @member {Uint8Array} data + * @memberof google.cloud.ces.v1beta.Blob + * @instance + */ + Blob.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Blob instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Blob + * @static + * @param {google.cloud.ces.v1beta.IBlob=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Blob} Blob instance + */ + Blob.create = function create(properties) { + return new Blob(properties); + }; + + /** + * Encodes the specified Blob message. Does not implicitly {@link google.cloud.ces.v1beta.Blob.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Blob + * @static + * @param {google.cloud.ces.v1beta.IBlob} message Blob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Blob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Blob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Blob + * @static + * @param {google.cloud.ces.v1beta.IBlob} message Blob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Blob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Blob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Blob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Blob} Blob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Blob.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Blob(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mimeType = reader.string(); + break; + } + case 2: { + message.data = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Blob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Blob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Blob} Blob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Blob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Blob message. + * @function verify + * @memberof google.cloud.ces.v1beta.Blob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Blob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates a Blob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Blob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Blob} Blob + */ + Blob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Blob) + return object; + var message = new $root.google.cloud.ces.v1beta.Blob(); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from a Blob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Blob + * @static + * @param {google.cloud.ces.v1beta.Blob} message Blob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Blob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mimeType = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this Blob to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Blob + * @instance + * @returns {Object.} JSON object + */ + Blob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Blob + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Blob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Blob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Blob"; + }; + + return Blob; + })(); + + v1beta.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.cloud.ces.v1beta + * @interface IImage + * @property {string|null} [mimeType] Image mimeType + * @property {Uint8Array|null} [data] Image data + */ + + /** + * Constructs a new Image. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.ces.v1beta.IImage=} [properties] Properties to set + */ + function Image(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Image mimeType. + * @member {string} mimeType + * @memberof google.cloud.ces.v1beta.Image + * @instance + */ + Image.prototype.mimeType = ""; + + /** + * Image data. + * @member {Uint8Array} data + * @memberof google.cloud.ces.v1beta.Image + * @instance + */ + Image.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Image + * @static + * @param {google.cloud.ces.v1beta.IImage=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.ces.v1beta.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Image + * @static + * @param {google.cloud.ces.v1beta.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Image + * @static + * @param {google.cloud.ces.v1beta.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Image message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mimeType = reader.string(); + break; + } + case 2: { + message.data = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Image message. + * @function verify + * @memberof google.cloud.ces.v1beta.Image + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Image.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Image) + return object; + var message = new $root.google.cloud.ces.v1beta.Image(); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Image + * @static + * @param {google.cloud.ces.v1beta.Image} message Image + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Image.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mimeType = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Image + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Image + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Image.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Image"; + }; + + return Image; + })(); + + v1beta.ToolCall = (function() { + + /** + * Properties of a ToolCall. + * @memberof google.cloud.ces.v1beta + * @interface IToolCall + * @property {string|null} [tool] ToolCall tool + * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] ToolCall toolsetTool + * @property {string|null} [id] ToolCall id + * @property {string|null} [displayName] ToolCall displayName + * @property {google.protobuf.IStruct|null} [args] ToolCall args + */ + + /** + * Constructs a new ToolCall. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ToolCall. + * @implements IToolCall + * @constructor + * @param {google.cloud.ces.v1beta.IToolCall=} [properties] Properties to set + */ + function ToolCall(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolCall tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1beta.ToolCall + * @instance + */ + ToolCall.prototype.tool = null; + + /** + * ToolCall toolsetTool. + * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1beta.ToolCall + * @instance + */ + ToolCall.prototype.toolsetTool = null; + + /** + * ToolCall id. + * @member {string} id + * @memberof google.cloud.ces.v1beta.ToolCall + * @instance + */ + ToolCall.prototype.id = ""; + + /** + * ToolCall displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.ToolCall + * @instance + */ + ToolCall.prototype.displayName = ""; + + /** + * ToolCall args. + * @member {google.protobuf.IStruct|null|undefined} args + * @memberof google.cloud.ces.v1beta.ToolCall + * @instance + */ + ToolCall.prototype.args = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ToolCall toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1beta.ToolCall + * @instance + */ + Object.defineProperty(ToolCall.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ToolCall instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ToolCall + * @static + * @param {google.cloud.ces.v1beta.IToolCall=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ToolCall} ToolCall instance + */ + ToolCall.create = function create(properties) { + return new ToolCall(properties); + }; + + /** + * Encodes the specified ToolCall message. Does not implicitly {@link google.cloud.ces.v1beta.ToolCall.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ToolCall + * @static + * @param {google.cloud.ces.v1beta.IToolCall} message ToolCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCall.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tool); + if (message.args != null && Object.hasOwnProperty.call(message, "args")) + $root.google.protobuf.Struct.encode(message.args, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolCall message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolCall.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ToolCall + * @static + * @param {google.cloud.ces.v1beta.IToolCall} message ToolCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCall.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolCall message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ToolCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ToolCall} ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCall.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ToolCall(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.tool = reader.string(); + break; + } + case 5: { + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 1: { + message.id = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 3: { + message.args = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolCall message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ToolCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ToolCall} ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCall.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolCall message. + * @function verify + * @memberof google.cloud.ces.v1beta.ToolCall + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolCall.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.args != null && message.hasOwnProperty("args")) { + var error = $root.google.protobuf.Struct.verify(message.args); + if (error) + return "args." + error; + } + return null; + }; + + /** + * Creates a ToolCall message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ToolCall + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ToolCall} ToolCall + */ + ToolCall.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ToolCall) + return object; + var message = new $root.google.cloud.ces.v1beta.ToolCall(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.ToolCall.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.args != null) { + if (typeof object.args !== "object") + throw TypeError(".google.cloud.ces.v1beta.ToolCall.args: object expected"); + message.args = $root.google.protobuf.Struct.fromObject(object.args); + } + return message; + }; + + /** + * Creates a plain object from a ToolCall message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ToolCall + * @static + * @param {google.cloud.ces.v1beta.ToolCall} message ToolCall + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolCall.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.args = null; + object.displayName = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.args != null && message.hasOwnProperty("args")) + object.args = $root.google.protobuf.Struct.toObject(message.args, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + return object; + }; + + /** + * Converts this ToolCall to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ToolCall + * @instance + * @returns {Object.} JSON object + */ + ToolCall.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolCall + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ToolCall + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ToolCall"; + }; + + return ToolCall; + })(); + + v1beta.ToolResponse = (function() { + + /** + * Properties of a ToolResponse. + * @memberof google.cloud.ces.v1beta + * @interface IToolResponse + * @property {string|null} [tool] ToolResponse tool + * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] ToolResponse toolsetTool + * @property {string|null} [id] ToolResponse id + * @property {string|null} [displayName] ToolResponse displayName + * @property {google.protobuf.IStruct|null} [response] ToolResponse response + */ + + /** + * Constructs a new ToolResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ToolResponse. + * @implements IToolResponse + * @constructor + * @param {google.cloud.ces.v1beta.IToolResponse=} [properties] Properties to set + */ + function ToolResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolResponse tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1beta.ToolResponse + * @instance + */ + ToolResponse.prototype.tool = null; + + /** + * ToolResponse toolsetTool. + * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1beta.ToolResponse + * @instance + */ + ToolResponse.prototype.toolsetTool = null; + + /** + * ToolResponse id. + * @member {string} id + * @memberof google.cloud.ces.v1beta.ToolResponse + * @instance + */ + ToolResponse.prototype.id = ""; + + /** + * ToolResponse displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.ToolResponse + * @instance + */ + ToolResponse.prototype.displayName = ""; + + /** + * ToolResponse response. + * @member {google.protobuf.IStruct|null|undefined} response + * @memberof google.cloud.ces.v1beta.ToolResponse + * @instance + */ + ToolResponse.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ToolResponse toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1beta.ToolResponse + * @instance + */ + Object.defineProperty(ToolResponse.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ToolResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ToolResponse + * @static + * @param {google.cloud.ces.v1beta.IToolResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ToolResponse} ToolResponse instance + */ + ToolResponse.create = function create(properties) { + return new ToolResponse(properties); + }; + + /** + * Encodes the specified ToolResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ToolResponse + * @static + * @param {google.cloud.ces.v1beta.IToolResponse} message ToolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tool); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Struct.encode(message.response, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ToolResponse + * @static + * @param {google.cloud.ces.v1beta.IToolResponse} message ToolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ToolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ToolResponse} ToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ToolResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.tool = reader.string(); + break; + } + case 5: { + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 1: { + message.id = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 3: { + message.response = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ToolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ToolResponse} ToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ToolResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.response != null && message.hasOwnProperty("response")) { + var error = $root.google.protobuf.Struct.verify(message.response); + if (error) + return "response." + error; + } + return null; + }; + + /** + * Creates a ToolResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ToolResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ToolResponse} ToolResponse + */ + ToolResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ToolResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ToolResponse(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.ToolResponse.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.cloud.ces.v1beta.ToolResponse.response: object expected"); + message.response = $root.google.protobuf.Struct.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from a ToolResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ToolResponse + * @static + * @param {google.cloud.ces.v1beta.ToolResponse} message ToolResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.response = null; + object.displayName = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.response != null && message.hasOwnProperty("response")) + object.response = $root.google.protobuf.Struct.toObject(message.response, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + return object; + }; + + /** + * Converts this ToolResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ToolResponse + * @instance + * @returns {Object.} JSON object + */ + ToolResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ToolResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ToolResponse"; + }; + + return ToolResponse; + })(); + + v1beta.AgentTransfer = (function() { + + /** + * Properties of an AgentTransfer. + * @memberof google.cloud.ces.v1beta + * @interface IAgentTransfer + * @property {string|null} [targetAgent] AgentTransfer targetAgent + * @property {string|null} [displayName] AgentTransfer displayName + */ + + /** + * Constructs a new AgentTransfer. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an AgentTransfer. + * @implements IAgentTransfer + * @constructor + * @param {google.cloud.ces.v1beta.IAgentTransfer=} [properties] Properties to set + */ + function AgentTransfer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AgentTransfer targetAgent. + * @member {string} targetAgent + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @instance + */ + AgentTransfer.prototype.targetAgent = ""; + + /** + * AgentTransfer displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @instance + */ + AgentTransfer.prototype.displayName = ""; + + /** + * Creates a new AgentTransfer instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @static + * @param {google.cloud.ces.v1beta.IAgentTransfer=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AgentTransfer} AgentTransfer instance + */ + AgentTransfer.create = function create(properties) { + return new AgentTransfer(properties); + }; + + /** + * Encodes the specified AgentTransfer message. Does not implicitly {@link google.cloud.ces.v1beta.AgentTransfer.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @static + * @param {google.cloud.ces.v1beta.IAgentTransfer} message AgentTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentTransfer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetAgent != null && Object.hasOwnProperty.call(message, "targetAgent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetAgent); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified AgentTransfer message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AgentTransfer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @static + * @param {google.cloud.ces.v1beta.IAgentTransfer} message AgentTransfer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentTransfer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AgentTransfer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AgentTransfer} AgentTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentTransfer.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AgentTransfer(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.targetAgent = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AgentTransfer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AgentTransfer} AgentTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentTransfer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AgentTransfer message. + * @function verify + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AgentTransfer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetAgent != null && message.hasOwnProperty("targetAgent")) + if (!$util.isString(message.targetAgent)) + return "targetAgent: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates an AgentTransfer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AgentTransfer} AgentTransfer + */ + AgentTransfer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AgentTransfer) + return object; + var message = new $root.google.cloud.ces.v1beta.AgentTransfer(); + if (object.targetAgent != null) + message.targetAgent = String(object.targetAgent); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an AgentTransfer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @static + * @param {google.cloud.ces.v1beta.AgentTransfer} message AgentTransfer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AgentTransfer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetAgent = ""; + object.displayName = ""; + } + if (message.targetAgent != null && message.hasOwnProperty("targetAgent")) + object.targetAgent = message.targetAgent; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this AgentTransfer to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @instance + * @returns {Object.} JSON object + */ + AgentTransfer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AgentTransfer + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AgentTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AgentTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AgentTransfer"; + }; + + return AgentTransfer; + })(); + + v1beta.ToolsetTool = (function() { + + /** + * Properties of a ToolsetTool. + * @memberof google.cloud.ces.v1beta + * @interface IToolsetTool + * @property {string|null} [toolset] ToolsetTool toolset + * @property {string|null} [toolId] ToolsetTool toolId + */ + + /** + * Constructs a new ToolsetTool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ToolsetTool. + * @implements IToolsetTool + * @constructor + * @param {google.cloud.ces.v1beta.IToolsetTool=} [properties] Properties to set + */ + function ToolsetTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolsetTool toolset. + * @member {string} toolset + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @instance + */ + ToolsetTool.prototype.toolset = ""; + + /** + * ToolsetTool toolId. + * @member {string} toolId + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @instance + */ + ToolsetTool.prototype.toolId = ""; + + /** + * Creates a new ToolsetTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @static + * @param {google.cloud.ces.v1beta.IToolsetTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ToolsetTool} ToolsetTool instance + */ + ToolsetTool.create = function create(properties) { + return new ToolsetTool(properties); + }; + + /** + * Encodes the specified ToolsetTool message. Does not implicitly {@link google.cloud.ces.v1beta.ToolsetTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @static + * @param {google.cloud.ces.v1beta.IToolsetTool} message ToolsetTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolsetTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.toolset); + if (message.toolId != null && Object.hasOwnProperty.call(message, "toolId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.toolId); + return writer; + }; + + /** + * Encodes the specified ToolsetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolsetTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @static + * @param {google.cloud.ces.v1beta.IToolsetTool} message ToolsetTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolsetTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolsetTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ToolsetTool} ToolsetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolsetTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ToolsetTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolset = reader.string(); + break; + } + case 3: { + message.toolId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolsetTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ToolsetTool} ToolsetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolsetTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolsetTool message. + * @function verify + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolsetTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolset != null && message.hasOwnProperty("toolset")) + if (!$util.isString(message.toolset)) + return "toolset: string expected"; + if (message.toolId != null && message.hasOwnProperty("toolId")) + if (!$util.isString(message.toolId)) + return "toolId: string expected"; + return null; + }; + + /** + * Creates a ToolsetTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ToolsetTool} ToolsetTool + */ + ToolsetTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ToolsetTool) + return object; + var message = new $root.google.cloud.ces.v1beta.ToolsetTool(); + if (object.toolset != null) + message.toolset = String(object.toolset); + if (object.toolId != null) + message.toolId = String(object.toolId); + return message; + }; + + /** + * Creates a plain object from a ToolsetTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @static + * @param {google.cloud.ces.v1beta.ToolsetTool} message ToolsetTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolsetTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.toolset = ""; + object.toolId = ""; + } + if (message.toolset != null && message.hasOwnProperty("toolset")) + object.toolset = message.toolset; + if (message.toolId != null && message.hasOwnProperty("toolId")) + object.toolId = message.toolId; + return object; + }; + + /** + * Converts this ToolsetTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @instance + * @returns {Object.} JSON object + */ + ToolsetTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolsetTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ToolsetTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolsetTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ToolsetTool"; + }; + + return ToolsetTool; + })(); + + v1beta.Guardrail = (function() { + + /** + * Properties of a Guardrail. + * @memberof google.cloud.ces.v1beta + * @interface IGuardrail + * @property {google.cloud.ces.v1beta.Guardrail.IContentFilter|null} [contentFilter] Guardrail contentFilter + * @property {google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity|null} [llmPromptSecurity] Guardrail llmPromptSecurity + * @property {google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null} [llmPolicy] Guardrail llmPolicy + * @property {google.cloud.ces.v1beta.Guardrail.IModelSafety|null} [modelSafety] Guardrail modelSafety + * @property {google.cloud.ces.v1beta.Guardrail.ICodeCallback|null} [codeCallback] Guardrail codeCallback + * @property {string|null} [name] Guardrail name + * @property {string|null} [displayName] Guardrail displayName + * @property {string|null} [description] Guardrail description + * @property {boolean|null} [enabled] Guardrail enabled + * @property {google.cloud.ces.v1beta.ITriggerAction|null} [action] Guardrail action + * @property {google.protobuf.ITimestamp|null} [createTime] Guardrail createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Guardrail updateTime + * @property {string|null} [etag] Guardrail etag + */ + + /** + * Constructs a new Guardrail. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Guardrail. + * @implements IGuardrail + * @constructor + * @param {google.cloud.ces.v1beta.IGuardrail=} [properties] Properties to set + */ + function Guardrail(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Guardrail contentFilter. + * @member {google.cloud.ces.v1beta.Guardrail.IContentFilter|null|undefined} contentFilter + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.contentFilter = null; + + /** + * Guardrail llmPromptSecurity. + * @member {google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity|null|undefined} llmPromptSecurity + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.llmPromptSecurity = null; + + /** + * Guardrail llmPolicy. + * @member {google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null|undefined} llmPolicy + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.llmPolicy = null; + + /** + * Guardrail modelSafety. + * @member {google.cloud.ces.v1beta.Guardrail.IModelSafety|null|undefined} modelSafety + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.modelSafety = null; + + /** + * Guardrail codeCallback. + * @member {google.cloud.ces.v1beta.Guardrail.ICodeCallback|null|undefined} codeCallback + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.codeCallback = null; + + /** + * Guardrail name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.name = ""; + + /** + * Guardrail displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.displayName = ""; + + /** + * Guardrail description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.description = ""; + + /** + * Guardrail enabled. + * @member {boolean} enabled + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.enabled = false; + + /** + * Guardrail action. + * @member {google.cloud.ces.v1beta.ITriggerAction|null|undefined} action + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.action = null; + + /** + * Guardrail createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.createTime = null; + + /** + * Guardrail updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.updateTime = null; + + /** + * Guardrail etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Guardrail.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Guardrail guardrailType. + * @member {"contentFilter"|"llmPromptSecurity"|"llmPolicy"|"modelSafety"|"codeCallback"|undefined} guardrailType + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + */ + Object.defineProperty(Guardrail.prototype, "guardrailType", { + get: $util.oneOfGetter($oneOfFields = ["contentFilter", "llmPromptSecurity", "llmPolicy", "modelSafety", "codeCallback"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Guardrail instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Guardrail + * @static + * @param {google.cloud.ces.v1beta.IGuardrail=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Guardrail} Guardrail instance + */ + Guardrail.create = function create(properties) { + return new Guardrail(properties); + }; + + /** + * Encodes the specified Guardrail message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Guardrail + * @static + * @param {google.cloud.ces.v1beta.IGuardrail} message Guardrail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Guardrail.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enabled); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + $root.google.cloud.ces.v1beta.TriggerAction.encode(message.action, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.contentFilter != null && Object.hasOwnProperty.call(message, "contentFilter")) + $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.encode(message.contentFilter, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.llmPromptSecurity != null && Object.hasOwnProperty.call(message, "llmPromptSecurity")) + $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.encode(message.llmPromptSecurity, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.llmPolicy != null && Object.hasOwnProperty.call(message, "llmPolicy")) + $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.encode(message.llmPolicy, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + if (message.modelSafety != null && Object.hasOwnProperty.call(message, "modelSafety")) + $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.encode(message.modelSafety, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.codeCallback != null && Object.hasOwnProperty.call(message, "codeCallback")) + $root.google.cloud.ces.v1beta.Guardrail.CodeCallback.encode(message.codeCallback, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Guardrail message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail + * @static + * @param {google.cloud.ces.v1beta.IGuardrail} message Guardrail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Guardrail.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Guardrail message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Guardrail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Guardrail} Guardrail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Guardrail.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 8: { + message.contentFilter = $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.decode(reader, reader.uint32()); + break; + } + case 9: { + message.llmPromptSecurity = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.decode(reader, reader.uint32()); + break; + } + case 10: { + message.llmPolicy = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.decode(reader, reader.uint32()); + break; + } + case 13: { + message.modelSafety = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.decode(reader, reader.uint32()); + break; + } + case 14: { + message.codeCallback = $root.google.cloud.ces.v1beta.Guardrail.CodeCallback.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.enabled = reader.bool(); + break; + } + case 5: { + message.action = $root.google.cloud.ces.v1beta.TriggerAction.decode(reader, reader.uint32()); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Guardrail message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Guardrail} Guardrail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Guardrail.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Guardrail message. + * @function verify + * @memberof google.cloud.ces.v1beta.Guardrail + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Guardrail.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.contentFilter != null && message.hasOwnProperty("contentFilter")) { + properties.guardrailType = 1; + { + var error = $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.verify(message.contentFilter); + if (error) + return "contentFilter." + error; + } + } + if (message.llmPromptSecurity != null && message.hasOwnProperty("llmPromptSecurity")) { + if (properties.guardrailType === 1) + return "guardrailType: multiple values"; + properties.guardrailType = 1; + { + var error = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.verify(message.llmPromptSecurity); + if (error) + return "llmPromptSecurity." + error; + } + } + if (message.llmPolicy != null && message.hasOwnProperty("llmPolicy")) { + if (properties.guardrailType === 1) + return "guardrailType: multiple values"; + properties.guardrailType = 1; + { + var error = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.verify(message.llmPolicy); + if (error) + return "llmPolicy." + error; + } + } + if (message.modelSafety != null && message.hasOwnProperty("modelSafety")) { + if (properties.guardrailType === 1) + return "guardrailType: multiple values"; + properties.guardrailType = 1; + { + var error = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.verify(message.modelSafety); + if (error) + return "modelSafety." + error; + } + } + if (message.codeCallback != null && message.hasOwnProperty("codeCallback")) { + if (properties.guardrailType === 1) + return "guardrailType: multiple values"; + properties.guardrailType = 1; + { + var error = $root.google.cloud.ces.v1beta.Guardrail.CodeCallback.verify(message.codeCallback); + if (error) + return "codeCallback." + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.action != null && message.hasOwnProperty("action")) { + var error = $root.google.cloud.ces.v1beta.TriggerAction.verify(message.action); + if (error) + return "action." + error; + } + 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a Guardrail message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Guardrail + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Guardrail} Guardrail + */ + Guardrail.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Guardrail) + return object; + var message = new $root.google.cloud.ces.v1beta.Guardrail(); + if (object.contentFilter != null) { + if (typeof object.contentFilter !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.contentFilter: object expected"); + message.contentFilter = $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.fromObject(object.contentFilter); + } + if (object.llmPromptSecurity != null) { + if (typeof object.llmPromptSecurity !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.llmPromptSecurity: object expected"); + message.llmPromptSecurity = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.fromObject(object.llmPromptSecurity); + } + if (object.llmPolicy != null) { + if (typeof object.llmPolicy !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.llmPolicy: object expected"); + message.llmPolicy = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.fromObject(object.llmPolicy); + } + if (object.modelSafety != null) { + if (typeof object.modelSafety !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.modelSafety: object expected"); + message.modelSafety = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.fromObject(object.modelSafety); + } + if (object.codeCallback != null) { + if (typeof object.codeCallback !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.codeCallback: object expected"); + message.codeCallback = $root.google.cloud.ces.v1beta.Guardrail.CodeCallback.fromObject(object.codeCallback); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.action != null) { + if (typeof object.action !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.action: object expected"); + message.action = $root.google.cloud.ces.v1beta.TriggerAction.fromObject(object.action); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.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.ces.v1beta.Guardrail.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a Guardrail message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Guardrail + * @static + * @param {google.cloud.ces.v1beta.Guardrail} message Guardrail + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Guardrail.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.enabled = false; + object.action = null; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.action != null && message.hasOwnProperty("action")) + object.action = $root.google.cloud.ces.v1beta.TriggerAction.toObject(message.action, options); + 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.contentFilter != null && message.hasOwnProperty("contentFilter")) { + object.contentFilter = $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.toObject(message.contentFilter, options); + if (options.oneofs) + object.guardrailType = "contentFilter"; + } + if (message.llmPromptSecurity != null && message.hasOwnProperty("llmPromptSecurity")) { + object.llmPromptSecurity = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.toObject(message.llmPromptSecurity, options); + if (options.oneofs) + object.guardrailType = "llmPromptSecurity"; + } + if (message.llmPolicy != null && message.hasOwnProperty("llmPolicy")) { + object.llmPolicy = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.toObject(message.llmPolicy, options); + if (options.oneofs) + object.guardrailType = "llmPolicy"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.modelSafety != null && message.hasOwnProperty("modelSafety")) { + object.modelSafety = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.toObject(message.modelSafety, options); + if (options.oneofs) + object.guardrailType = "modelSafety"; + } + if (message.codeCallback != null && message.hasOwnProperty("codeCallback")) { + object.codeCallback = $root.google.cloud.ces.v1beta.Guardrail.CodeCallback.toObject(message.codeCallback, options); + if (options.oneofs) + object.guardrailType = "codeCallback"; + } + return object; + }; + + /** + * Converts this Guardrail to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Guardrail + * @instance + * @returns {Object.} JSON object + */ + Guardrail.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Guardrail + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Guardrail + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Guardrail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail"; + }; + + Guardrail.ContentFilter = (function() { + + /** + * Properties of a ContentFilter. + * @memberof google.cloud.ces.v1beta.Guardrail + * @interface IContentFilter + * @property {Array.|null} [bannedContents] ContentFilter bannedContents + * @property {Array.|null} [bannedContentsInUserInput] ContentFilter bannedContentsInUserInput + * @property {Array.|null} [bannedContentsInAgentResponse] ContentFilter bannedContentsInAgentResponse + * @property {google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType|null} [matchType] ContentFilter matchType + * @property {boolean|null} [disregardDiacritics] ContentFilter disregardDiacritics + */ + + /** + * Constructs a new ContentFilter. + * @memberof google.cloud.ces.v1beta.Guardrail + * @classdesc Represents a ContentFilter. + * @implements IContentFilter + * @constructor + * @param {google.cloud.ces.v1beta.Guardrail.IContentFilter=} [properties] Properties to set + */ + function ContentFilter(properties) { + this.bannedContents = []; + this.bannedContentsInUserInput = []; + this.bannedContentsInAgentResponse = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContentFilter bannedContents. + * @member {Array.} bannedContents + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @instance + */ + ContentFilter.prototype.bannedContents = $util.emptyArray; + + /** + * ContentFilter bannedContentsInUserInput. + * @member {Array.} bannedContentsInUserInput + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @instance + */ + ContentFilter.prototype.bannedContentsInUserInput = $util.emptyArray; + + /** + * ContentFilter bannedContentsInAgentResponse. + * @member {Array.} bannedContentsInAgentResponse + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @instance + */ + ContentFilter.prototype.bannedContentsInAgentResponse = $util.emptyArray; + + /** + * ContentFilter matchType. + * @member {google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType} matchType + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @instance + */ + ContentFilter.prototype.matchType = 0; + + /** + * ContentFilter disregardDiacritics. + * @member {boolean} disregardDiacritics + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @instance + */ + ContentFilter.prototype.disregardDiacritics = false; + + /** + * Creates a new ContentFilter instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @static + * @param {google.cloud.ces.v1beta.Guardrail.IContentFilter=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Guardrail.ContentFilter} ContentFilter instance + */ + ContentFilter.create = function create(properties) { + return new ContentFilter(properties); + }; + + /** + * Encodes the specified ContentFilter message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ContentFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @static + * @param {google.cloud.ces.v1beta.Guardrail.IContentFilter} message ContentFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bannedContents != null && message.bannedContents.length) + for (var i = 0; i < message.bannedContents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bannedContents[i]); + if (message.bannedContentsInUserInput != null && message.bannedContentsInUserInput.length) + for (var i = 0; i < message.bannedContentsInUserInput.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bannedContentsInUserInput[i]); + if (message.bannedContentsInAgentResponse != null && message.bannedContentsInAgentResponse.length) + for (var i = 0; i < message.bannedContentsInAgentResponse.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.bannedContentsInAgentResponse[i]); + if (message.matchType != null && Object.hasOwnProperty.call(message, "matchType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.matchType); + if (message.disregardDiacritics != null && Object.hasOwnProperty.call(message, "disregardDiacritics")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disregardDiacritics); + return writer; + }; + + /** + * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ContentFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @static + * @param {google.cloud.ces.v1beta.Guardrail.IContentFilter} message ContentFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContentFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Guardrail.ContentFilter} ContentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentFilter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.ContentFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.bannedContents && message.bannedContents.length)) + message.bannedContents = []; + message.bannedContents.push(reader.string()); + break; + } + case 2: { + if (!(message.bannedContentsInUserInput && message.bannedContentsInUserInput.length)) + message.bannedContentsInUserInput = []; + message.bannedContentsInUserInput.push(reader.string()); + break; + } + case 3: { + if (!(message.bannedContentsInAgentResponse && message.bannedContentsInAgentResponse.length)) + message.bannedContentsInAgentResponse = []; + message.bannedContentsInAgentResponse.push(reader.string()); + break; + } + case 4: { + message.matchType = reader.int32(); + break; + } + case 5: { + message.disregardDiacritics = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContentFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Guardrail.ContentFilter} ContentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContentFilter message. + * @function verify + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContentFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bannedContents != null && message.hasOwnProperty("bannedContents")) { + if (!Array.isArray(message.bannedContents)) + return "bannedContents: array expected"; + for (var i = 0; i < message.bannedContents.length; ++i) + if (!$util.isString(message.bannedContents[i])) + return "bannedContents: string[] expected"; + } + if (message.bannedContentsInUserInput != null && message.hasOwnProperty("bannedContentsInUserInput")) { + if (!Array.isArray(message.bannedContentsInUserInput)) + return "bannedContentsInUserInput: array expected"; + for (var i = 0; i < message.bannedContentsInUserInput.length; ++i) + if (!$util.isString(message.bannedContentsInUserInput[i])) + return "bannedContentsInUserInput: string[] expected"; + } + if (message.bannedContentsInAgentResponse != null && message.hasOwnProperty("bannedContentsInAgentResponse")) { + if (!Array.isArray(message.bannedContentsInAgentResponse)) + return "bannedContentsInAgentResponse: array expected"; + for (var i = 0; i < message.bannedContentsInAgentResponse.length; ++i) + if (!$util.isString(message.bannedContentsInAgentResponse[i])) + return "bannedContentsInAgentResponse: string[] expected"; + } + if (message.matchType != null && message.hasOwnProperty("matchType")) + switch (message.matchType) { + default: + return "matchType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.disregardDiacritics != null && message.hasOwnProperty("disregardDiacritics")) + if (typeof message.disregardDiacritics !== "boolean") + return "disregardDiacritics: boolean expected"; + return null; + }; + + /** + * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Guardrail.ContentFilter} ContentFilter + */ + ContentFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.ContentFilter) + return object; + var message = new $root.google.cloud.ces.v1beta.Guardrail.ContentFilter(); + if (object.bannedContents) { + if (!Array.isArray(object.bannedContents)) + throw TypeError(".google.cloud.ces.v1beta.Guardrail.ContentFilter.bannedContents: array expected"); + message.bannedContents = []; + for (var i = 0; i < object.bannedContents.length; ++i) + message.bannedContents[i] = String(object.bannedContents[i]); + } + if (object.bannedContentsInUserInput) { + if (!Array.isArray(object.bannedContentsInUserInput)) + throw TypeError(".google.cloud.ces.v1beta.Guardrail.ContentFilter.bannedContentsInUserInput: array expected"); + message.bannedContentsInUserInput = []; + for (var i = 0; i < object.bannedContentsInUserInput.length; ++i) + message.bannedContentsInUserInput[i] = String(object.bannedContentsInUserInput[i]); + } + if (object.bannedContentsInAgentResponse) { + if (!Array.isArray(object.bannedContentsInAgentResponse)) + throw TypeError(".google.cloud.ces.v1beta.Guardrail.ContentFilter.bannedContentsInAgentResponse: array expected"); + message.bannedContentsInAgentResponse = []; + for (var i = 0; i < object.bannedContentsInAgentResponse.length; ++i) + message.bannedContentsInAgentResponse[i] = String(object.bannedContentsInAgentResponse[i]); + } + switch (object.matchType) { + default: + if (typeof object.matchType === "number") { + message.matchType = object.matchType; + break; + } + break; + case "MATCH_TYPE_UNSPECIFIED": + case 0: + message.matchType = 0; + break; + case "SIMPLE_STRING_MATCH": + case 1: + message.matchType = 1; + break; + case "WORD_BOUNDARY_STRING_MATCH": + case 2: + message.matchType = 2; + break; + case "REGEXP_MATCH": + case 3: + message.matchType = 3; + break; + } + if (object.disregardDiacritics != null) + message.disregardDiacritics = Boolean(object.disregardDiacritics); + return message; + }; + + /** + * Creates a plain object from a ContentFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ContentFilter} message ContentFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContentFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bannedContents = []; + object.bannedContentsInUserInput = []; + object.bannedContentsInAgentResponse = []; + } + if (options.defaults) { + object.matchType = options.enums === String ? "MATCH_TYPE_UNSPECIFIED" : 0; + object.disregardDiacritics = false; + } + if (message.bannedContents && message.bannedContents.length) { + object.bannedContents = []; + for (var j = 0; j < message.bannedContents.length; ++j) + object.bannedContents[j] = message.bannedContents[j]; + } + if (message.bannedContentsInUserInput && message.bannedContentsInUserInput.length) { + object.bannedContentsInUserInput = []; + for (var j = 0; j < message.bannedContentsInUserInput.length; ++j) + object.bannedContentsInUserInput[j] = message.bannedContentsInUserInput[j]; + } + if (message.bannedContentsInAgentResponse && message.bannedContentsInAgentResponse.length) { + object.bannedContentsInAgentResponse = []; + for (var j = 0; j < message.bannedContentsInAgentResponse.length; ++j) + object.bannedContentsInAgentResponse[j] = message.bannedContentsInAgentResponse[j]; + } + if (message.matchType != null && message.hasOwnProperty("matchType")) + object.matchType = options.enums === String ? $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType[message.matchType] === undefined ? message.matchType : $root.google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType[message.matchType] : message.matchType; + if (message.disregardDiacritics != null && message.hasOwnProperty("disregardDiacritics")) + object.disregardDiacritics = message.disregardDiacritics; + return object; + }; + + /** + * Converts this ContentFilter to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @instance + * @returns {Object.} JSON object + */ + ContentFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContentFilter + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Guardrail.ContentFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContentFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.ContentFilter"; + }; + + /** + * MatchType enum. + * @name google.cloud.ces.v1beta.Guardrail.ContentFilter.MatchType + * @enum {number} + * @property {number} MATCH_TYPE_UNSPECIFIED=0 MATCH_TYPE_UNSPECIFIED value + * @property {number} SIMPLE_STRING_MATCH=1 SIMPLE_STRING_MATCH value + * @property {number} WORD_BOUNDARY_STRING_MATCH=2 WORD_BOUNDARY_STRING_MATCH value + * @property {number} REGEXP_MATCH=3 REGEXP_MATCH value + */ + ContentFilter.MatchType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MATCH_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SIMPLE_STRING_MATCH"] = 1; + values[valuesById[2] = "WORD_BOUNDARY_STRING_MATCH"] = 2; + values[valuesById[3] = "REGEXP_MATCH"] = 3; + return values; + })(); + + return ContentFilter; + })(); + + Guardrail.LlmPromptSecurity = (function() { + + /** + * Properties of a LlmPromptSecurity. + * @memberof google.cloud.ces.v1beta.Guardrail + * @interface ILlmPromptSecurity + * @property {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null} [defaultSettings] LlmPromptSecurity defaultSettings + * @property {google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null} [customPolicy] LlmPromptSecurity customPolicy + * @property {boolean|null} [failOpen] LlmPromptSecurity failOpen + */ + + /** + * Constructs a new LlmPromptSecurity. + * @memberof google.cloud.ces.v1beta.Guardrail + * @classdesc Represents a LlmPromptSecurity. + * @implements ILlmPromptSecurity + * @constructor + * @param {google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity=} [properties] Properties to set + */ + function LlmPromptSecurity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LlmPromptSecurity defaultSettings. + * @member {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings|null|undefined} defaultSettings + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @instance + */ + LlmPromptSecurity.prototype.defaultSettings = null; + + /** + * LlmPromptSecurity customPolicy. + * @member {google.cloud.ces.v1beta.Guardrail.ILlmPolicy|null|undefined} customPolicy + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @instance + */ + LlmPromptSecurity.prototype.customPolicy = null; + + /** + * LlmPromptSecurity failOpen. + * @member {boolean} failOpen + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @instance + */ + LlmPromptSecurity.prototype.failOpen = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LlmPromptSecurity securityConfig. + * @member {"defaultSettings"|"customPolicy"|undefined} securityConfig + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @instance + */ + Object.defineProperty(LlmPromptSecurity.prototype, "securityConfig", { + get: $util.oneOfGetter($oneOfFields = ["defaultSettings", "customPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LlmPromptSecurity instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity} LlmPromptSecurity instance + */ + LlmPromptSecurity.create = function create(properties) { + return new LlmPromptSecurity(properties); + }; + + /** + * Encodes the specified LlmPromptSecurity message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity} message LlmPromptSecurity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmPromptSecurity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaultSettings != null && Object.hasOwnProperty.call(message, "defaultSettings")) + $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.encode(message.defaultSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.customPolicy != null && Object.hasOwnProperty.call(message, "customPolicy")) + $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.encode(message.customPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.failOpen != null && Object.hasOwnProperty.call(message, "failOpen")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.failOpen); + return writer; + }; + + /** + * Encodes the specified LlmPromptSecurity message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ILlmPromptSecurity} message LlmPromptSecurity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmPromptSecurity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LlmPromptSecurity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity} LlmPromptSecurity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmPromptSecurity.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.defaultSettings = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.customPolicy = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.failOpen = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LlmPromptSecurity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity} LlmPromptSecurity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmPromptSecurity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LlmPromptSecurity message. + * @function verify + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LlmPromptSecurity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.defaultSettings != null && message.hasOwnProperty("defaultSettings")) { + properties.securityConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify(message.defaultSettings); + if (error) + return "defaultSettings." + error; + } + } + if (message.customPolicy != null && message.hasOwnProperty("customPolicy")) { + if (properties.securityConfig === 1) + return "securityConfig: multiple values"; + properties.securityConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.verify(message.customPolicy); + if (error) + return "customPolicy." + error; + } + } + if (message.failOpen != null && message.hasOwnProperty("failOpen")) + if (typeof message.failOpen !== "boolean") + return "failOpen: boolean expected"; + return null; + }; + + /** + * Creates a LlmPromptSecurity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity} LlmPromptSecurity + */ + LlmPromptSecurity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity) + return object; + var message = new $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity(); + if (object.defaultSettings != null) { + if (typeof object.defaultSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.defaultSettings: object expected"); + message.defaultSettings = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.fromObject(object.defaultSettings); + } + if (object.customPolicy != null) { + if (typeof object.customPolicy !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.customPolicy: object expected"); + message.customPolicy = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.fromObject(object.customPolicy); + } + if (object.failOpen != null) + message.failOpen = Boolean(object.failOpen); + return message; + }; + + /** + * Creates a plain object from a LlmPromptSecurity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @static + * @param {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity} message LlmPromptSecurity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LlmPromptSecurity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.failOpen = false; + if (message.defaultSettings != null && message.hasOwnProperty("defaultSettings")) { + object.defaultSettings = $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.toObject(message.defaultSettings, options); + if (options.oneofs) + object.securityConfig = "defaultSettings"; + } + if (message.customPolicy != null && message.hasOwnProperty("customPolicy")) { + object.customPolicy = $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.toObject(message.customPolicy, options); + if (options.oneofs) + object.securityConfig = "customPolicy"; + } + if (message.failOpen != null && message.hasOwnProperty("failOpen")) + object.failOpen = message.failOpen; + return object; + }; + + /** + * Converts this LlmPromptSecurity to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @instance + * @returns {Object.} JSON object + */ + LlmPromptSecurity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LlmPromptSecurity + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LlmPromptSecurity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity"; + }; + + LlmPromptSecurity.DefaultSecuritySettings = (function() { + + /** + * Properties of a DefaultSecuritySettings. + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @interface IDefaultSecuritySettings + * @property {string|null} [defaultPromptTemplate] DefaultSecuritySettings defaultPromptTemplate + */ + + /** + * Constructs a new DefaultSecuritySettings. + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity + * @classdesc Represents a DefaultSecuritySettings. + * @implements IDefaultSecuritySettings + * @constructor + * @param {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings=} [properties] Properties to set + */ + function DefaultSecuritySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DefaultSecuritySettings defaultPromptTemplate. + * @member {string} defaultPromptTemplate + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @instance + */ + DefaultSecuritySettings.prototype.defaultPromptTemplate = ""; + + /** + * Creates a new DefaultSecuritySettings instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings instance + */ + DefaultSecuritySettings.create = function create(properties) { + return new DefaultSecuritySettings(properties); + }; + + /** + * Encodes the specified DefaultSecuritySettings message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings} message DefaultSecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultSecuritySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaultPromptTemplate != null && Object.hasOwnProperty.call(message, "defaultPromptTemplate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.defaultPromptTemplate); + return writer; + }; + + /** + * Encodes the specified DefaultSecuritySettings message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.IDefaultSecuritySettings} message DefaultSecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultSecuritySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DefaultSecuritySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultSecuritySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.defaultPromptTemplate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DefaultSecuritySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultSecuritySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DefaultSecuritySettings message. + * @function verify + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DefaultSecuritySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaultPromptTemplate != null && message.hasOwnProperty("defaultPromptTemplate")) + if (!$util.isString(message.defaultPromptTemplate)) + return "defaultPromptTemplate: string expected"; + return null; + }; + + /** + * Creates a DefaultSecuritySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} DefaultSecuritySettings + */ + DefaultSecuritySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings) + return object; + var message = new $root.google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings(); + if (object.defaultPromptTemplate != null) + message.defaultPromptTemplate = String(object.defaultPromptTemplate); + return message; + }; + + /** + * Creates a plain object from a DefaultSecuritySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings} message DefaultSecuritySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DefaultSecuritySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.defaultPromptTemplate = ""; + if (message.defaultPromptTemplate != null && message.hasOwnProperty("defaultPromptTemplate")) + object.defaultPromptTemplate = message.defaultPromptTemplate; + return object; + }; + + /** + * Converts this DefaultSecuritySettings to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @instance + * @returns {Object.} JSON object + */ + DefaultSecuritySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DefaultSecuritySettings + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DefaultSecuritySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.LlmPromptSecurity.DefaultSecuritySettings"; + }; + + return DefaultSecuritySettings; + })(); + + return LlmPromptSecurity; + })(); + + Guardrail.LlmPolicy = (function() { + + /** + * Properties of a LlmPolicy. + * @memberof google.cloud.ces.v1beta.Guardrail + * @interface ILlmPolicy + * @property {number|null} [maxConversationMessages] LlmPolicy maxConversationMessages + * @property {google.cloud.ces.v1beta.IModelSettings|null} [modelSettings] LlmPolicy modelSettings + * @property {string|null} [prompt] LlmPolicy prompt + * @property {google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope|null} [policyScope] LlmPolicy policyScope + * @property {boolean|null} [failOpen] LlmPolicy failOpen + * @property {boolean|null} [allowShortUtterance] LlmPolicy allowShortUtterance + */ + + /** + * Constructs a new LlmPolicy. + * @memberof google.cloud.ces.v1beta.Guardrail + * @classdesc Represents a LlmPolicy. + * @implements ILlmPolicy + * @constructor + * @param {google.cloud.ces.v1beta.Guardrail.ILlmPolicy=} [properties] Properties to set + */ + function LlmPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LlmPolicy maxConversationMessages. + * @member {number} maxConversationMessages + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @instance + */ + LlmPolicy.prototype.maxConversationMessages = 0; + + /** + * LlmPolicy modelSettings. + * @member {google.cloud.ces.v1beta.IModelSettings|null|undefined} modelSettings + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @instance + */ + LlmPolicy.prototype.modelSettings = null; + + /** + * LlmPolicy prompt. + * @member {string} prompt + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @instance + */ + LlmPolicy.prototype.prompt = ""; + + /** + * LlmPolicy policyScope. + * @member {google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope} policyScope + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @instance + */ + LlmPolicy.prototype.policyScope = 0; + + /** + * LlmPolicy failOpen. + * @member {boolean} failOpen + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @instance + */ + LlmPolicy.prototype.failOpen = false; + + /** + * LlmPolicy allowShortUtterance. + * @member {boolean} allowShortUtterance + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @instance + */ + LlmPolicy.prototype.allowShortUtterance = false; + + /** + * Creates a new LlmPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ILlmPolicy=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPolicy} LlmPolicy instance + */ + LlmPolicy.create = function create(properties) { + return new LlmPolicy(properties); + }; + + /** + * Encodes the specified LlmPolicy message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ILlmPolicy} message LlmPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxConversationMessages != null && Object.hasOwnProperty.call(message, "maxConversationMessages")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxConversationMessages); + if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) + $root.google.cloud.ces.v1beta.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.prompt); + if (message.policyScope != null && Object.hasOwnProperty.call(message, "policyScope")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.policyScope); + if (message.failOpen != null && Object.hasOwnProperty.call(message, "failOpen")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.failOpen); + if (message.allowShortUtterance != null && Object.hasOwnProperty.call(message, "allowShortUtterance")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowShortUtterance); + return writer; + }; + + /** + * Encodes the specified LlmPolicy message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.LlmPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ILlmPolicy} message LlmPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LlmPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPolicy} LlmPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.maxConversationMessages = reader.int32(); + break; + } + case 2: { + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.decode(reader, reader.uint32()); + break; + } + case 3: { + message.prompt = reader.string(); + break; + } + case 4: { + message.policyScope = reader.int32(); + break; + } + case 5: { + message.failOpen = reader.bool(); + break; + } + case 6: { + message.allowShortUtterance = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LlmPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPolicy} LlmPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LlmPolicy message. + * @function verify + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LlmPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxConversationMessages != null && message.hasOwnProperty("maxConversationMessages")) + if (!$util.isInteger(message.maxConversationMessages)) + return "maxConversationMessages: integer expected"; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { + var error = $root.google.cloud.ces.v1beta.ModelSettings.verify(message.modelSettings); + if (error) + return "modelSettings." + error; + } + if (message.prompt != null && message.hasOwnProperty("prompt")) + if (!$util.isString(message.prompt)) + return "prompt: string expected"; + if (message.policyScope != null && message.hasOwnProperty("policyScope")) + switch (message.policyScope) { + default: + return "policyScope: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.failOpen != null && message.hasOwnProperty("failOpen")) + if (typeof message.failOpen !== "boolean") + return "failOpen: boolean expected"; + if (message.allowShortUtterance != null && message.hasOwnProperty("allowShortUtterance")) + if (typeof message.allowShortUtterance !== "boolean") + return "allowShortUtterance: boolean expected"; + return null; + }; + + /** + * Creates a LlmPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Guardrail.LlmPolicy} LlmPolicy + */ + LlmPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy) + return object; + var message = new $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy(); + if (object.maxConversationMessages != null) + message.maxConversationMessages = object.maxConversationMessages | 0; + if (object.modelSettings != null) { + if (typeof object.modelSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.LlmPolicy.modelSettings: object expected"); + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.fromObject(object.modelSettings); + } + if (object.prompt != null) + message.prompt = String(object.prompt); + switch (object.policyScope) { + default: + if (typeof object.policyScope === "number") { + message.policyScope = object.policyScope; + break; + } + break; + case "POLICY_SCOPE_UNSPECIFIED": + case 0: + message.policyScope = 0; + break; + case "USER_QUERY": + case 1: + message.policyScope = 1; + break; + case "AGENT_RESPONSE": + case 2: + message.policyScope = 2; + break; + case "USER_QUERY_AND_AGENT_RESPONSE": + case 3: + message.policyScope = 3; + break; + } + if (object.failOpen != null) + message.failOpen = Boolean(object.failOpen); + if (object.allowShortUtterance != null) + message.allowShortUtterance = Boolean(object.allowShortUtterance); + return message; + }; + + /** + * Creates a plain object from a LlmPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @static + * @param {google.cloud.ces.v1beta.Guardrail.LlmPolicy} message LlmPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LlmPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxConversationMessages = 0; + object.modelSettings = null; + object.prompt = ""; + object.policyScope = options.enums === String ? "POLICY_SCOPE_UNSPECIFIED" : 0; + object.failOpen = false; + object.allowShortUtterance = false; + } + if (message.maxConversationMessages != null && message.hasOwnProperty("maxConversationMessages")) + object.maxConversationMessages = message.maxConversationMessages; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) + object.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.toObject(message.modelSettings, options); + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = message.prompt; + if (message.policyScope != null && message.hasOwnProperty("policyScope")) + object.policyScope = options.enums === String ? $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope[message.policyScope] === undefined ? message.policyScope : $root.google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope[message.policyScope] : message.policyScope; + if (message.failOpen != null && message.hasOwnProperty("failOpen")) + object.failOpen = message.failOpen; + if (message.allowShortUtterance != null && message.hasOwnProperty("allowShortUtterance")) + object.allowShortUtterance = message.allowShortUtterance; + return object; + }; + + /** + * Converts this LlmPolicy to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @instance + * @returns {Object.} JSON object + */ + LlmPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LlmPolicy + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Guardrail.LlmPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LlmPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.LlmPolicy"; + }; + + /** + * PolicyScope enum. + * @name google.cloud.ces.v1beta.Guardrail.LlmPolicy.PolicyScope + * @enum {number} + * @property {number} POLICY_SCOPE_UNSPECIFIED=0 POLICY_SCOPE_UNSPECIFIED value + * @property {number} USER_QUERY=1 USER_QUERY value + * @property {number} AGENT_RESPONSE=2 AGENT_RESPONSE value + * @property {number} USER_QUERY_AND_AGENT_RESPONSE=3 USER_QUERY_AND_AGENT_RESPONSE value + */ + LlmPolicy.PolicyScope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "POLICY_SCOPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER_QUERY"] = 1; + values[valuesById[2] = "AGENT_RESPONSE"] = 2; + values[valuesById[3] = "USER_QUERY_AND_AGENT_RESPONSE"] = 3; + return values; + })(); + + return LlmPolicy; + })(); + + Guardrail.ModelSafety = (function() { + + /** + * Properties of a ModelSafety. + * @memberof google.cloud.ces.v1beta.Guardrail + * @interface IModelSafety + * @property {Array.|null} [safetySettings] ModelSafety safetySettings + */ + + /** + * Constructs a new ModelSafety. + * @memberof google.cloud.ces.v1beta.Guardrail + * @classdesc Represents a ModelSafety. + * @implements IModelSafety + * @constructor + * @param {google.cloud.ces.v1beta.Guardrail.IModelSafety=} [properties] Properties to set + */ + function ModelSafety(properties) { + this.safetySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelSafety safetySettings. + * @member {Array.} safetySettings + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @instance + */ + ModelSafety.prototype.safetySettings = $util.emptyArray; + + /** + * Creates a new ModelSafety instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @static + * @param {google.cloud.ces.v1beta.Guardrail.IModelSafety=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety} ModelSafety instance + */ + ModelSafety.create = function create(properties) { + return new ModelSafety(properties); + }; + + /** + * Encodes the specified ModelSafety message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @static + * @param {google.cloud.ces.v1beta.Guardrail.IModelSafety} message ModelSafety message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelSafety.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.safetySettings != null && message.safetySettings.length) + for (var i = 0; i < message.safetySettings.length; ++i) + $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModelSafety message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @static + * @param {google.cloud.ces.v1beta.Guardrail.IModelSafety} message ModelSafety message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelSafety.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelSafety message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety} ModelSafety + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelSafety.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.ModelSafety(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.safetySettings && message.safetySettings.length)) + message.safetySettings = []; + message.safetySettings.push($root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelSafety message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety} ModelSafety + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelSafety.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelSafety message. + * @function verify + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelSafety.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.safetySettings != null && message.hasOwnProperty("safetySettings")) { + if (!Array.isArray(message.safetySettings)) + return "safetySettings: array expected"; + for (var i = 0; i < message.safetySettings.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.verify(message.safetySettings[i]); + if (error) + return "safetySettings." + error; + } + } + return null; + }; + + /** + * Creates a ModelSafety message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety} ModelSafety + */ + ModelSafety.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.ModelSafety) + return object; + var message = new $root.google.cloud.ces.v1beta.Guardrail.ModelSafety(); + if (object.safetySettings) { + if (!Array.isArray(object.safetySettings)) + throw TypeError(".google.cloud.ces.v1beta.Guardrail.ModelSafety.safetySettings: array expected"); + message.safetySettings = []; + for (var i = 0; i < object.safetySettings.length; ++i) { + if (typeof object.safetySettings[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.ModelSafety.safetySettings: object expected"); + message.safetySettings[i] = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.fromObject(object.safetySettings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ModelSafety message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ModelSafety} message ModelSafety + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelSafety.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.safetySettings = []; + if (message.safetySettings && message.safetySettings.length) { + object.safetySettings = []; + for (var j = 0; j < message.safetySettings.length; ++j) + object.safetySettings[j] = $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.toObject(message.safetySettings[j], options); + } + return object; + }; + + /** + * Converts this ModelSafety to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @instance + * @returns {Object.} JSON object + */ + ModelSafety.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelSafety + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelSafety.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.ModelSafety"; + }; + + ModelSafety.SafetySetting = (function() { + + /** + * Properties of a SafetySetting. + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @interface ISafetySetting + * @property {google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory|null} [category] SafetySetting category + * @property {google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold|null} [threshold] SafetySetting threshold + */ + + /** + * Constructs a new SafetySetting. + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety + * @classdesc Represents a SafetySetting. + * @implements ISafetySetting + * @constructor + * @param {google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting=} [properties] Properties to set + */ + function SafetySetting(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SafetySetting category. + * @member {google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory} category + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @instance + */ + SafetySetting.prototype.category = 0; + + /** + * SafetySetting threshold. + * @member {google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold} threshold + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @instance + */ + SafetySetting.prototype.threshold = 0; + + /** + * Creates a new SafetySetting instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting} SafetySetting instance + */ + SafetySetting.create = function create(properties) { + return new SafetySetting(properties); + }; + + /** + * Encodes the specified SafetySetting message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting} message SafetySetting message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetySetting.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.category); + if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.threshold); + return writer; + }; + + /** + * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ModelSafety.ISafetySetting} message SafetySetting message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetySetting.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SafetySetting message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting} SafetySetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetySetting.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.category = reader.int32(); + break; + } + case 2: { + message.threshold = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SafetySetting message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting} SafetySetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetySetting.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SafetySetting message. + * @function verify + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SafetySetting.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.category != null && message.hasOwnProperty("category")) + switch (message.category) { + default: + return "category: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.threshold != null && message.hasOwnProperty("threshold")) + switch (message.threshold) { + default: + return "threshold: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting} SafetySetting + */ + SafetySetting.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting) + return object; + var message = new $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting(); + switch (object.category) { + default: + if (typeof object.category === "number") { + message.category = object.category; + break; + } + break; + case "HARM_CATEGORY_UNSPECIFIED": + case 0: + message.category = 0; + break; + case "HARM_CATEGORY_HATE_SPEECH": + case 1: + message.category = 1; + break; + case "HARM_CATEGORY_DANGEROUS_CONTENT": + case 2: + message.category = 2; + break; + case "HARM_CATEGORY_HARASSMENT": + case 3: + message.category = 3; + break; + case "HARM_CATEGORY_SEXUALLY_EXPLICIT": + case 4: + message.category = 4; + break; + } + switch (object.threshold) { + default: + if (typeof object.threshold === "number") { + message.threshold = object.threshold; + break; + } + break; + case "HARM_BLOCK_THRESHOLD_UNSPECIFIED": + case 0: + message.threshold = 0; + break; + case "BLOCK_LOW_AND_ABOVE": + case 1: + message.threshold = 1; + break; + case "BLOCK_MEDIUM_AND_ABOVE": + case 2: + message.threshold = 2; + break; + case "BLOCK_ONLY_HIGH": + case 3: + message.threshold = 3; + break; + case "BLOCK_NONE": + case 4: + message.threshold = 4; + break; + case "OFF": + case 5: + message.threshold = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a SafetySetting message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting} message SafetySetting + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SafetySetting.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0; + object.threshold = options.enums === String ? "HARM_BLOCK_THRESHOLD_UNSPECIFIED" : 0; + } + if (message.category != null && message.hasOwnProperty("category")) + object.category = options.enums === String ? $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory[message.category] === undefined ? message.category : $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory[message.category] : message.category; + if (message.threshold != null && message.hasOwnProperty("threshold")) + object.threshold = options.enums === String ? $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold[message.threshold] === undefined ? message.threshold : $root.google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold[message.threshold] : message.threshold; + return object; + }; + + /** + * Converts this SafetySetting to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @instance + * @returns {Object.} JSON object + */ + SafetySetting.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SafetySetting + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SafetySetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.ModelSafety.SafetySetting"; + }; + + return SafetySetting; + })(); + + /** + * HarmCategory enum. + * @name google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmCategory + * @enum {number} + * @property {number} HARM_CATEGORY_UNSPECIFIED=0 HARM_CATEGORY_UNSPECIFIED value + * @property {number} HARM_CATEGORY_HATE_SPEECH=1 HARM_CATEGORY_HATE_SPEECH value + * @property {number} HARM_CATEGORY_DANGEROUS_CONTENT=2 HARM_CATEGORY_DANGEROUS_CONTENT value + * @property {number} HARM_CATEGORY_HARASSMENT=3 HARM_CATEGORY_HARASSMENT value + * @property {number} HARM_CATEGORY_SEXUALLY_EXPLICIT=4 HARM_CATEGORY_SEXUALLY_EXPLICIT value + */ + ModelSafety.HarmCategory = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HARM_CATEGORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "HARM_CATEGORY_HATE_SPEECH"] = 1; + values[valuesById[2] = "HARM_CATEGORY_DANGEROUS_CONTENT"] = 2; + values[valuesById[3] = "HARM_CATEGORY_HARASSMENT"] = 3; + values[valuesById[4] = "HARM_CATEGORY_SEXUALLY_EXPLICIT"] = 4; + return values; + })(); + + /** + * HarmBlockThreshold enum. + * @name google.cloud.ces.v1beta.Guardrail.ModelSafety.HarmBlockThreshold + * @enum {number} + * @property {number} HARM_BLOCK_THRESHOLD_UNSPECIFIED=0 HARM_BLOCK_THRESHOLD_UNSPECIFIED value + * @property {number} BLOCK_LOW_AND_ABOVE=1 BLOCK_LOW_AND_ABOVE value + * @property {number} BLOCK_MEDIUM_AND_ABOVE=2 BLOCK_MEDIUM_AND_ABOVE value + * @property {number} BLOCK_ONLY_HIGH=3 BLOCK_ONLY_HIGH value + * @property {number} BLOCK_NONE=4 BLOCK_NONE value + * @property {number} OFF=5 OFF value + */ + ModelSafety.HarmBlockThreshold = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOCK_LOW_AND_ABOVE"] = 1; + values[valuesById[2] = "BLOCK_MEDIUM_AND_ABOVE"] = 2; + values[valuesById[3] = "BLOCK_ONLY_HIGH"] = 3; + values[valuesById[4] = "BLOCK_NONE"] = 4; + values[valuesById[5] = "OFF"] = 5; + return values; + })(); + + return ModelSafety; + })(); + + Guardrail.CodeCallback = (function() { + + /** + * Properties of a CodeCallback. + * @memberof google.cloud.ces.v1beta.Guardrail + * @interface ICodeCallback + * @property {google.cloud.ces.v1beta.ICallback|null} [beforeAgentCallback] CodeCallback beforeAgentCallback + * @property {google.cloud.ces.v1beta.ICallback|null} [afterAgentCallback] CodeCallback afterAgentCallback + * @property {google.cloud.ces.v1beta.ICallback|null} [beforeModelCallback] CodeCallback beforeModelCallback + * @property {google.cloud.ces.v1beta.ICallback|null} [afterModelCallback] CodeCallback afterModelCallback + */ + + /** + * Constructs a new CodeCallback. + * @memberof google.cloud.ces.v1beta.Guardrail + * @classdesc Represents a CodeCallback. + * @implements ICodeCallback + * @constructor + * @param {google.cloud.ces.v1beta.Guardrail.ICodeCallback=} [properties] Properties to set + */ + function CodeCallback(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CodeCallback beforeAgentCallback. + * @member {google.cloud.ces.v1beta.ICallback|null|undefined} beforeAgentCallback + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @instance + */ + CodeCallback.prototype.beforeAgentCallback = null; + + /** + * CodeCallback afterAgentCallback. + * @member {google.cloud.ces.v1beta.ICallback|null|undefined} afterAgentCallback + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @instance + */ + CodeCallback.prototype.afterAgentCallback = null; + + /** + * CodeCallback beforeModelCallback. + * @member {google.cloud.ces.v1beta.ICallback|null|undefined} beforeModelCallback + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @instance + */ + CodeCallback.prototype.beforeModelCallback = null; + + /** + * CodeCallback afterModelCallback. + * @member {google.cloud.ces.v1beta.ICallback|null|undefined} afterModelCallback + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @instance + */ + CodeCallback.prototype.afterModelCallback = null; + + /** + * Creates a new CodeCallback instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ICodeCallback=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Guardrail.CodeCallback} CodeCallback instance + */ + CodeCallback.create = function create(properties) { + return new CodeCallback(properties); + }; + + /** + * Encodes the specified CodeCallback message. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.CodeCallback.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ICodeCallback} message CodeCallback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeCallback.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.beforeAgentCallback != null && Object.hasOwnProperty.call(message, "beforeAgentCallback")) + $root.google.cloud.ces.v1beta.Callback.encode(message.beforeAgentCallback, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.afterAgentCallback != null && Object.hasOwnProperty.call(message, "afterAgentCallback")) + $root.google.cloud.ces.v1beta.Callback.encode(message.afterAgentCallback, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.beforeModelCallback != null && Object.hasOwnProperty.call(message, "beforeModelCallback")) + $root.google.cloud.ces.v1beta.Callback.encode(message.beforeModelCallback, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.afterModelCallback != null && Object.hasOwnProperty.call(message, "afterModelCallback")) + $root.google.cloud.ces.v1beta.Callback.encode(message.afterModelCallback, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CodeCallback message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Guardrail.CodeCallback.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @static + * @param {google.cloud.ces.v1beta.Guardrail.ICodeCallback} message CodeCallback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeCallback.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CodeCallback message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Guardrail.CodeCallback} CodeCallback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeCallback.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Guardrail.CodeCallback(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.beforeAgentCallback = $root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32()); + break; + } + case 2: { + message.afterAgentCallback = $root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32()); + break; + } + case 3: { + message.beforeModelCallback = $root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32()); + break; + } + case 4: { + message.afterModelCallback = $root.google.cloud.ces.v1beta.Callback.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CodeCallback message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Guardrail.CodeCallback} CodeCallback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeCallback.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CodeCallback message. + * @function verify + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CodeCallback.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.beforeAgentCallback != null && message.hasOwnProperty("beforeAgentCallback")) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.beforeAgentCallback); + if (error) + return "beforeAgentCallback." + error; + } + if (message.afterAgentCallback != null && message.hasOwnProperty("afterAgentCallback")) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.afterAgentCallback); + if (error) + return "afterAgentCallback." + error; + } + if (message.beforeModelCallback != null && message.hasOwnProperty("beforeModelCallback")) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.beforeModelCallback); + if (error) + return "beforeModelCallback." + error; + } + if (message.afterModelCallback != null && message.hasOwnProperty("afterModelCallback")) { + var error = $root.google.cloud.ces.v1beta.Callback.verify(message.afterModelCallback); + if (error) + return "afterModelCallback." + error; + } + return null; + }; + + /** + * Creates a CodeCallback message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Guardrail.CodeCallback} CodeCallback + */ + CodeCallback.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Guardrail.CodeCallback) + return object; + var message = new $root.google.cloud.ces.v1beta.Guardrail.CodeCallback(); + if (object.beforeAgentCallback != null) { + if (typeof object.beforeAgentCallback !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.CodeCallback.beforeAgentCallback: object expected"); + message.beforeAgentCallback = $root.google.cloud.ces.v1beta.Callback.fromObject(object.beforeAgentCallback); + } + if (object.afterAgentCallback != null) { + if (typeof object.afterAgentCallback !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.CodeCallback.afterAgentCallback: object expected"); + message.afterAgentCallback = $root.google.cloud.ces.v1beta.Callback.fromObject(object.afterAgentCallback); + } + if (object.beforeModelCallback != null) { + if (typeof object.beforeModelCallback !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.CodeCallback.beforeModelCallback: object expected"); + message.beforeModelCallback = $root.google.cloud.ces.v1beta.Callback.fromObject(object.beforeModelCallback); + } + if (object.afterModelCallback != null) { + if (typeof object.afterModelCallback !== "object") + throw TypeError(".google.cloud.ces.v1beta.Guardrail.CodeCallback.afterModelCallback: object expected"); + message.afterModelCallback = $root.google.cloud.ces.v1beta.Callback.fromObject(object.afterModelCallback); + } + return message; + }; + + /** + * Creates a plain object from a CodeCallback message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @static + * @param {google.cloud.ces.v1beta.Guardrail.CodeCallback} message CodeCallback + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CodeCallback.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.beforeAgentCallback = null; + object.afterAgentCallback = null; + object.beforeModelCallback = null; + object.afterModelCallback = null; + } + if (message.beforeAgentCallback != null && message.hasOwnProperty("beforeAgentCallback")) + object.beforeAgentCallback = $root.google.cloud.ces.v1beta.Callback.toObject(message.beforeAgentCallback, options); + if (message.afterAgentCallback != null && message.hasOwnProperty("afterAgentCallback")) + object.afterAgentCallback = $root.google.cloud.ces.v1beta.Callback.toObject(message.afterAgentCallback, options); + if (message.beforeModelCallback != null && message.hasOwnProperty("beforeModelCallback")) + object.beforeModelCallback = $root.google.cloud.ces.v1beta.Callback.toObject(message.beforeModelCallback, options); + if (message.afterModelCallback != null && message.hasOwnProperty("afterModelCallback")) + object.afterModelCallback = $root.google.cloud.ces.v1beta.Callback.toObject(message.afterModelCallback, options); + return object; + }; + + /** + * Converts this CodeCallback to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @instance + * @returns {Object.} JSON object + */ + CodeCallback.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CodeCallback + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Guardrail.CodeCallback + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CodeCallback.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Guardrail.CodeCallback"; + }; + + return CodeCallback; + })(); + + return Guardrail; + })(); + + v1beta.Tool = (function() { + + /** + * Properties of a Tool. + * @memberof google.cloud.ces.v1beta + * @interface ITool + * @property {google.cloud.ces.v1beta.IClientFunction|null} [clientFunction] Tool clientFunction + * @property {google.cloud.ces.v1beta.IOpenApiTool|null} [openApiTool] Tool openApiTool + * @property {google.cloud.ces.v1beta.IGoogleSearchTool|null} [googleSearchTool] Tool googleSearchTool + * @property {google.cloud.ces.v1beta.IConnectorTool|null} [connectorTool] Tool connectorTool + * @property {google.cloud.ces.v1beta.IDataStoreTool|null} [dataStoreTool] Tool dataStoreTool + * @property {google.cloud.ces.v1beta.IPythonFunction|null} [pythonFunction] Tool pythonFunction + * @property {google.cloud.ces.v1beta.IMcpTool|null} [mcpTool] Tool mcpTool + * @property {google.cloud.ces.v1beta.IFileSearchTool|null} [fileSearchTool] Tool fileSearchTool + * @property {google.cloud.ces.v1beta.ISystemTool|null} [systemTool] Tool systemTool + * @property {google.cloud.ces.v1beta.IWidgetTool|null} [widgetTool] Tool widgetTool + * @property {string|null} [name] Tool name + * @property {string|null} [displayName] Tool displayName + * @property {google.cloud.ces.v1beta.ExecutionType|null} [executionType] Tool executionType + * @property {google.protobuf.ITimestamp|null} [createTime] Tool createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Tool updateTime + * @property {string|null} [etag] Tool etag + * @property {string|null} [generatedSummary] Tool generatedSummary + * @property {google.cloud.ces.v1beta.IToolFakeConfig|null} [toolFakeConfig] Tool toolFakeConfig + */ + + /** + * Constructs a new Tool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Tool. + * @implements ITool + * @constructor + * @param {google.cloud.ces.v1beta.ITool=} [properties] Properties to set + */ + function Tool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tool clientFunction. + * @member {google.cloud.ces.v1beta.IClientFunction|null|undefined} clientFunction + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.clientFunction = null; + + /** + * Tool openApiTool. + * @member {google.cloud.ces.v1beta.IOpenApiTool|null|undefined} openApiTool + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.openApiTool = null; + + /** + * Tool googleSearchTool. + * @member {google.cloud.ces.v1beta.IGoogleSearchTool|null|undefined} googleSearchTool + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.googleSearchTool = null; + + /** + * Tool connectorTool. + * @member {google.cloud.ces.v1beta.IConnectorTool|null|undefined} connectorTool + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.connectorTool = null; + + /** + * Tool dataStoreTool. + * @member {google.cloud.ces.v1beta.IDataStoreTool|null|undefined} dataStoreTool + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.dataStoreTool = null; + + /** + * Tool pythonFunction. + * @member {google.cloud.ces.v1beta.IPythonFunction|null|undefined} pythonFunction + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.pythonFunction = null; + + /** + * Tool mcpTool. + * @member {google.cloud.ces.v1beta.IMcpTool|null|undefined} mcpTool + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.mcpTool = null; + + /** + * Tool fileSearchTool. + * @member {google.cloud.ces.v1beta.IFileSearchTool|null|undefined} fileSearchTool + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.fileSearchTool = null; + + /** + * Tool systemTool. + * @member {google.cloud.ces.v1beta.ISystemTool|null|undefined} systemTool + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.systemTool = null; + + /** + * Tool widgetTool. + * @member {google.cloud.ces.v1beta.IWidgetTool|null|undefined} widgetTool + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.widgetTool = null; + + /** + * Tool name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.name = ""; + + /** + * Tool displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.displayName = ""; + + /** + * Tool executionType. + * @member {google.cloud.ces.v1beta.ExecutionType} executionType + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.executionType = 0; + + /** + * Tool createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.createTime = null; + + /** + * Tool updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.updateTime = null; + + /** + * Tool etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.etag = ""; + + /** + * Tool generatedSummary. + * @member {string} generatedSummary + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.generatedSummary = ""; + + /** + * Tool toolFakeConfig. + * @member {google.cloud.ces.v1beta.IToolFakeConfig|null|undefined} toolFakeConfig + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Tool.prototype.toolFakeConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Tool toolType. + * @member {"clientFunction"|"openApiTool"|"googleSearchTool"|"connectorTool"|"dataStoreTool"|"pythonFunction"|"mcpTool"|"fileSearchTool"|"systemTool"|"widgetTool"|undefined} toolType + * @memberof google.cloud.ces.v1beta.Tool + * @instance + */ + Object.defineProperty(Tool.prototype, "toolType", { + get: $util.oneOfGetter($oneOfFields = ["clientFunction", "openApiTool", "googleSearchTool", "connectorTool", "dataStoreTool", "pythonFunction", "mcpTool", "fileSearchTool", "systemTool", "widgetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Tool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Tool + * @static + * @param {google.cloud.ces.v1beta.ITool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Tool} Tool instance + */ + Tool.create = function create(properties) { + return new Tool(properties); + }; + + /** + * Encodes the specified Tool message. Does not implicitly {@link google.cloud.ces.v1beta.Tool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Tool + * @static + * @param {google.cloud.ces.v1beta.ITool} message Tool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.clientFunction != null && Object.hasOwnProperty.call(message, "clientFunction")) + $root.google.cloud.ces.v1beta.ClientFunction.encode(message.clientFunction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.openApiTool != null && Object.hasOwnProperty.call(message, "openApiTool")) + $root.google.cloud.ces.v1beta.OpenApiTool.encode(message.openApiTool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.googleSearchTool != null && Object.hasOwnProperty.call(message, "googleSearchTool")) + $root.google.cloud.ces.v1beta.GoogleSearchTool.encode(message.googleSearchTool, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.connectorTool != null && Object.hasOwnProperty.call(message, "connectorTool")) + $root.google.cloud.ces.v1beta.ConnectorTool.encode(message.connectorTool, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.dataStoreTool != null && Object.hasOwnProperty.call(message, "dataStoreTool")) + $root.google.cloud.ces.v1beta.DataStoreTool.encode(message.dataStoreTool, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.pythonFunction != null && Object.hasOwnProperty.call(message, "pythonFunction")) + $root.google.cloud.ces.v1beta.PythonFunction.encode(message.pythonFunction, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.executionType != null && Object.hasOwnProperty.call(message, "executionType")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.executionType); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.displayName); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); + if (message.generatedSummary != null && Object.hasOwnProperty.call(message, "generatedSummary")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.generatedSummary); + if (message.mcpTool != null && Object.hasOwnProperty.call(message, "mcpTool")) + $root.google.cloud.ces.v1beta.McpTool.encode(message.mcpTool, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.fileSearchTool != null && Object.hasOwnProperty.call(message, "fileSearchTool")) + $root.google.cloud.ces.v1beta.FileSearchTool.encode(message.fileSearchTool, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.systemTool != null && Object.hasOwnProperty.call(message, "systemTool")) + $root.google.cloud.ces.v1beta.SystemTool.encode(message.systemTool, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.toolFakeConfig != null && Object.hasOwnProperty.call(message, "toolFakeConfig")) + $root.google.cloud.ces.v1beta.ToolFakeConfig.encode(message.toolFakeConfig, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.widgetTool != null && Object.hasOwnProperty.call(message, "widgetTool")) + $root.google.cloud.ces.v1beta.WidgetTool.encode(message.widgetTool, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Tool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Tool + * @static + * @param {google.cloud.ces.v1beta.ITool} message Tool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Tool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Tool} Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Tool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.clientFunction = $root.google.cloud.ces.v1beta.ClientFunction.decode(reader, reader.uint32()); + break; + } + case 3: { + message.openApiTool = $root.google.cloud.ces.v1beta.OpenApiTool.decode(reader, reader.uint32()); + break; + } + case 5: { + message.googleSearchTool = $root.google.cloud.ces.v1beta.GoogleSearchTool.decode(reader, reader.uint32()); + break; + } + case 8: { + message.connectorTool = $root.google.cloud.ces.v1beta.ConnectorTool.decode(reader, reader.uint32()); + break; + } + case 10: { + message.dataStoreTool = $root.google.cloud.ces.v1beta.DataStoreTool.decode(reader, reader.uint32()); + break; + } + case 11: { + message.pythonFunction = $root.google.cloud.ces.v1beta.PythonFunction.decode(reader, reader.uint32()); + break; + } + case 16: { + message.mcpTool = $root.google.cloud.ces.v1beta.McpTool.decode(reader, reader.uint32()); + break; + } + case 17: { + message.fileSearchTool = $root.google.cloud.ces.v1beta.FileSearchTool.decode(reader, reader.uint32()); + break; + } + case 18: { + message.systemTool = $root.google.cloud.ces.v1beta.SystemTool.decode(reader, reader.uint32()); + break; + } + case 24: { + message.widgetTool = $root.google.cloud.ces.v1beta.WidgetTool.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 13: { + message.displayName = reader.string(); + break; + } + case 12: { + message.executionType = reader.int32(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.etag = reader.string(); + break; + } + case 15: { + message.generatedSummary = reader.string(); + break; + } + case 20: { + message.toolFakeConfig = $root.google.cloud.ces.v1beta.ToolFakeConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Tool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Tool} Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tool message. + * @function verify + * @memberof google.cloud.ces.v1beta.Tool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.clientFunction != null && message.hasOwnProperty("clientFunction")) { + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.ClientFunction.verify(message.clientFunction); + if (error) + return "clientFunction." + error; + } + } + if (message.openApiTool != null && message.hasOwnProperty("openApiTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.OpenApiTool.verify(message.openApiTool); + if (error) + return "openApiTool." + error; + } + } + if (message.googleSearchTool != null && message.hasOwnProperty("googleSearchTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.GoogleSearchTool.verify(message.googleSearchTool); + if (error) + return "googleSearchTool." + error; + } + } + if (message.connectorTool != null && message.hasOwnProperty("connectorTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.ConnectorTool.verify(message.connectorTool); + if (error) + return "connectorTool." + error; + } + } + if (message.dataStoreTool != null && message.hasOwnProperty("dataStoreTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.verify(message.dataStoreTool); + if (error) + return "dataStoreTool." + error; + } + } + if (message.pythonFunction != null && message.hasOwnProperty("pythonFunction")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.PythonFunction.verify(message.pythonFunction); + if (error) + return "pythonFunction." + error; + } + } + if (message.mcpTool != null && message.hasOwnProperty("mcpTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.McpTool.verify(message.mcpTool); + if (error) + return "mcpTool." + error; + } + } + if (message.fileSearchTool != null && message.hasOwnProperty("fileSearchTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.FileSearchTool.verify(message.fileSearchTool); + if (error) + return "fileSearchTool." + error; + } + } + if (message.systemTool != null && message.hasOwnProperty("systemTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.SystemTool.verify(message.systemTool); + if (error) + return "systemTool." + error; + } + } + if (message.widgetTool != null && message.hasOwnProperty("widgetTool")) { + if (properties.toolType === 1) + return "toolType: multiple values"; + properties.toolType = 1; + { + var error = $root.google.cloud.ces.v1beta.WidgetTool.verify(message.widgetTool); + if (error) + return "widgetTool." + 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.executionType != null && message.hasOwnProperty("executionType")) + switch (message.executionType) { + default: + return "executionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) + if (!$util.isString(message.generatedSummary)) + return "generatedSummary: string expected"; + if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) { + var error = $root.google.cloud.ces.v1beta.ToolFakeConfig.verify(message.toolFakeConfig); + if (error) + return "toolFakeConfig." + error; + } + return null; + }; + + /** + * Creates a Tool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Tool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Tool} Tool + */ + Tool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Tool) + return object; + var message = new $root.google.cloud.ces.v1beta.Tool(); + if (object.clientFunction != null) { + if (typeof object.clientFunction !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.clientFunction: object expected"); + message.clientFunction = $root.google.cloud.ces.v1beta.ClientFunction.fromObject(object.clientFunction); + } + if (object.openApiTool != null) { + if (typeof object.openApiTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.openApiTool: object expected"); + message.openApiTool = $root.google.cloud.ces.v1beta.OpenApiTool.fromObject(object.openApiTool); + } + if (object.googleSearchTool != null) { + if (typeof object.googleSearchTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.googleSearchTool: object expected"); + message.googleSearchTool = $root.google.cloud.ces.v1beta.GoogleSearchTool.fromObject(object.googleSearchTool); + } + if (object.connectorTool != null) { + if (typeof object.connectorTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.connectorTool: object expected"); + message.connectorTool = $root.google.cloud.ces.v1beta.ConnectorTool.fromObject(object.connectorTool); + } + if (object.dataStoreTool != null) { + if (typeof object.dataStoreTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.dataStoreTool: object expected"); + message.dataStoreTool = $root.google.cloud.ces.v1beta.DataStoreTool.fromObject(object.dataStoreTool); + } + if (object.pythonFunction != null) { + if (typeof object.pythonFunction !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.pythonFunction: object expected"); + message.pythonFunction = $root.google.cloud.ces.v1beta.PythonFunction.fromObject(object.pythonFunction); + } + if (object.mcpTool != null) { + if (typeof object.mcpTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.mcpTool: object expected"); + message.mcpTool = $root.google.cloud.ces.v1beta.McpTool.fromObject(object.mcpTool); + } + if (object.fileSearchTool != null) { + if (typeof object.fileSearchTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.fileSearchTool: object expected"); + message.fileSearchTool = $root.google.cloud.ces.v1beta.FileSearchTool.fromObject(object.fileSearchTool); + } + if (object.systemTool != null) { + if (typeof object.systemTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.systemTool: object expected"); + message.systemTool = $root.google.cloud.ces.v1beta.SystemTool.fromObject(object.systemTool); + } + if (object.widgetTool != null) { + if (typeof object.widgetTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.widgetTool: object expected"); + message.widgetTool = $root.google.cloud.ces.v1beta.WidgetTool.fromObject(object.widgetTool); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.executionType) { + default: + if (typeof object.executionType === "number") { + message.executionType = object.executionType; + break; + } + break; + case "EXECUTION_TYPE_UNSPECIFIED": + case 0: + message.executionType = 0; + break; + case "SYNCHRONOUS": + case 1: + message.executionType = 1; + break; + case "ASYNCHRONOUS": + case 2: + message.executionType = 2; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.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.ces.v1beta.Tool.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.generatedSummary != null) + message.generatedSummary = String(object.generatedSummary); + if (object.toolFakeConfig != null) { + if (typeof object.toolFakeConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.Tool.toolFakeConfig: object expected"); + message.toolFakeConfig = $root.google.cloud.ces.v1beta.ToolFakeConfig.fromObject(object.toolFakeConfig); + } + return message; + }; + + /** + * Creates a plain object from a Tool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Tool + * @static + * @param {google.cloud.ces.v1beta.Tool} message Tool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.executionType = options.enums === String ? "EXECUTION_TYPE_UNSPECIFIED" : 0; + object.displayName = ""; + object.etag = ""; + object.generatedSummary = ""; + object.toolFakeConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.clientFunction != null && message.hasOwnProperty("clientFunction")) { + object.clientFunction = $root.google.cloud.ces.v1beta.ClientFunction.toObject(message.clientFunction, options); + if (options.oneofs) + object.toolType = "clientFunction"; + } + if (message.openApiTool != null && message.hasOwnProperty("openApiTool")) { + object.openApiTool = $root.google.cloud.ces.v1beta.OpenApiTool.toObject(message.openApiTool, options); + if (options.oneofs) + object.toolType = "openApiTool"; + } + if (message.googleSearchTool != null && message.hasOwnProperty("googleSearchTool")) { + object.googleSearchTool = $root.google.cloud.ces.v1beta.GoogleSearchTool.toObject(message.googleSearchTool, options); + if (options.oneofs) + object.toolType = "googleSearchTool"; + } + 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.connectorTool != null && message.hasOwnProperty("connectorTool")) { + object.connectorTool = $root.google.cloud.ces.v1beta.ConnectorTool.toObject(message.connectorTool, options); + if (options.oneofs) + object.toolType = "connectorTool"; + } + if (message.dataStoreTool != null && message.hasOwnProperty("dataStoreTool")) { + object.dataStoreTool = $root.google.cloud.ces.v1beta.DataStoreTool.toObject(message.dataStoreTool, options); + if (options.oneofs) + object.toolType = "dataStoreTool"; + } + if (message.pythonFunction != null && message.hasOwnProperty("pythonFunction")) { + object.pythonFunction = $root.google.cloud.ces.v1beta.PythonFunction.toObject(message.pythonFunction, options); + if (options.oneofs) + object.toolType = "pythonFunction"; + } + if (message.executionType != null && message.hasOwnProperty("executionType")) + object.executionType = options.enums === String ? $root.google.cloud.ces.v1beta.ExecutionType[message.executionType] === undefined ? message.executionType : $root.google.cloud.ces.v1beta.ExecutionType[message.executionType] : message.executionType; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.generatedSummary != null && message.hasOwnProperty("generatedSummary")) + object.generatedSummary = message.generatedSummary; + if (message.mcpTool != null && message.hasOwnProperty("mcpTool")) { + object.mcpTool = $root.google.cloud.ces.v1beta.McpTool.toObject(message.mcpTool, options); + if (options.oneofs) + object.toolType = "mcpTool"; + } + if (message.fileSearchTool != null && message.hasOwnProperty("fileSearchTool")) { + object.fileSearchTool = $root.google.cloud.ces.v1beta.FileSearchTool.toObject(message.fileSearchTool, options); + if (options.oneofs) + object.toolType = "fileSearchTool"; + } + if (message.systemTool != null && message.hasOwnProperty("systemTool")) { + object.systemTool = $root.google.cloud.ces.v1beta.SystemTool.toObject(message.systemTool, options); + if (options.oneofs) + object.toolType = "systemTool"; + } + if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) + object.toolFakeConfig = $root.google.cloud.ces.v1beta.ToolFakeConfig.toObject(message.toolFakeConfig, options); + if (message.widgetTool != null && message.hasOwnProperty("widgetTool")) { + object.widgetTool = $root.google.cloud.ces.v1beta.WidgetTool.toObject(message.widgetTool, options); + if (options.oneofs) + object.toolType = "widgetTool"; + } + return object; + }; + + /** + * Converts this Tool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Tool + * @instance + * @returns {Object.} JSON object + */ + Tool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Tool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Tool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Tool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Tool"; + }; + + return Tool; + })(); + + v1beta.ClientFunction = (function() { + + /** + * Properties of a ClientFunction. + * @memberof google.cloud.ces.v1beta + * @interface IClientFunction + * @property {string|null} [name] ClientFunction name + * @property {string|null} [description] ClientFunction description + * @property {google.cloud.ces.v1beta.ISchema|null} [parameters] ClientFunction parameters + * @property {google.cloud.ces.v1beta.ISchema|null} [response] ClientFunction response + */ + + /** + * Constructs a new ClientFunction. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ClientFunction. + * @implements IClientFunction + * @constructor + * @param {google.cloud.ces.v1beta.IClientFunction=} [properties] Properties to set + */ + function ClientFunction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientFunction name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.ClientFunction + * @instance + */ + ClientFunction.prototype.name = ""; + + /** + * ClientFunction description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.ClientFunction + * @instance + */ + ClientFunction.prototype.description = ""; + + /** + * ClientFunction parameters. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} parameters + * @memberof google.cloud.ces.v1beta.ClientFunction + * @instance + */ + ClientFunction.prototype.parameters = null; + + /** + * ClientFunction response. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} response + * @memberof google.cloud.ces.v1beta.ClientFunction + * @instance + */ + ClientFunction.prototype.response = null; + + /** + * Creates a new ClientFunction instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ClientFunction + * @static + * @param {google.cloud.ces.v1beta.IClientFunction=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ClientFunction} ClientFunction instance + */ + ClientFunction.create = function create(properties) { + return new ClientFunction(properties); + }; + + /** + * Encodes the specified ClientFunction message. Does not implicitly {@link google.cloud.ces.v1beta.ClientFunction.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ClientFunction + * @static + * @param {google.cloud.ces.v1beta.IClientFunction} message ClientFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientFunction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.ces.v1beta.Schema.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.cloud.ces.v1beta.Schema.encode(message.response, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ClientFunction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ClientFunction + * @static + * @param {google.cloud.ces.v1beta.IClientFunction} message ClientFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientFunction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientFunction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ClientFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ClientFunction} ClientFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientFunction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ClientFunction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.parameters = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + case 4: { + message.response = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientFunction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ClientFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ClientFunction} ClientFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientFunction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientFunction message. + * @function verify + * @memberof google.cloud.ces.v1beta.ClientFunction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientFunction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.parameters); + if (error) + return "parameters." + error; + } + if (message.response != null && message.hasOwnProperty("response")) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.response); + if (error) + return "response." + error; + } + return null; + }; + + /** + * Creates a ClientFunction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ClientFunction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ClientFunction} ClientFunction + */ + ClientFunction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ClientFunction) + return object; + var message = new $root.google.cloud.ces.v1beta.ClientFunction(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.ces.v1beta.ClientFunction.parameters: object expected"); + message.parameters = $root.google.cloud.ces.v1beta.Schema.fromObject(object.parameters); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.cloud.ces.v1beta.ClientFunction.response: object expected"); + message.response = $root.google.cloud.ces.v1beta.Schema.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from a ClientFunction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ClientFunction + * @static + * @param {google.cloud.ces.v1beta.ClientFunction} message ClientFunction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientFunction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.parameters = null; + object.response = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.ces.v1beta.Schema.toObject(message.parameters, options); + if (message.response != null && message.hasOwnProperty("response")) + object.response = $root.google.cloud.ces.v1beta.Schema.toObject(message.response, options); + return object; + }; + + /** + * Converts this ClientFunction to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ClientFunction + * @instance + * @returns {Object.} JSON object + */ + ClientFunction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientFunction + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ClientFunction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientFunction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ClientFunction"; + }; + + return ClientFunction; + })(); + + v1beta.Action = (function() { + + /** + * Properties of an Action. + * @memberof google.cloud.ces.v1beta + * @interface IAction + * @property {string|null} [connectionActionId] Action connectionActionId + * @property {google.cloud.ces.v1beta.Action.IEntityOperation|null} [entityOperation] Action entityOperation + * @property {Array.|null} [inputFields] Action inputFields + * @property {Array.|null} [outputFields] Action outputFields + */ + + /** + * Constructs a new Action. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an Action. + * @implements IAction + * @constructor + * @param {google.cloud.ces.v1beta.IAction=} [properties] Properties to set + */ + function Action(properties) { + this.inputFields = []; + this.outputFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Action connectionActionId. + * @member {string|null|undefined} connectionActionId + * @memberof google.cloud.ces.v1beta.Action + * @instance + */ + Action.prototype.connectionActionId = null; + + /** + * Action entityOperation. + * @member {google.cloud.ces.v1beta.Action.IEntityOperation|null|undefined} entityOperation + * @memberof google.cloud.ces.v1beta.Action + * @instance + */ + Action.prototype.entityOperation = null; + + /** + * Action inputFields. + * @member {Array.} inputFields + * @memberof google.cloud.ces.v1beta.Action + * @instance + */ + Action.prototype.inputFields = $util.emptyArray; + + /** + * Action outputFields. + * @member {Array.} outputFields + * @memberof google.cloud.ces.v1beta.Action + * @instance + */ + Action.prototype.outputFields = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Action actionSpec. + * @member {"connectionActionId"|"entityOperation"|undefined} actionSpec + * @memberof google.cloud.ces.v1beta.Action + * @instance + */ + Object.defineProperty(Action.prototype, "actionSpec", { + get: $util.oneOfGetter($oneOfFields = ["connectionActionId", "entityOperation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Action instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Action + * @static + * @param {google.cloud.ces.v1beta.IAction=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Action} Action instance + */ + Action.create = function create(properties) { + return new Action(properties); + }; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.cloud.ces.v1beta.Action.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Action + * @static + * @param {google.cloud.ces.v1beta.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputFields != null && message.inputFields.length) + for (var i = 0; i < message.inputFields.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputFields[i]); + if (message.outputFields != null && message.outputFields.length) + for (var i = 0; i < message.outputFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputFields[i]); + if (message.connectionActionId != null && Object.hasOwnProperty.call(message, "connectionActionId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.connectionActionId); + if (message.entityOperation != null && Object.hasOwnProperty.call(message, "entityOperation")) + $root.google.cloud.ces.v1beta.Action.EntityOperation.encode(message.entityOperation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Action.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Action + * @static + * @param {google.cloud.ces.v1beta.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Action message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Action(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.connectionActionId = reader.string(); + break; + } + case 5: { + message.entityOperation = $root.google.cloud.ces.v1beta.Action.EntityOperation.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.inputFields && message.inputFields.length)) + message.inputFields = []; + message.inputFields.push(reader.string()); + break; + } + case 3: { + if (!(message.outputFields && message.outputFields.length)) + message.outputFields = []; + message.outputFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Action message. + * @function verify + * @memberof google.cloud.ces.v1beta.Action + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Action.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.connectionActionId != null && message.hasOwnProperty("connectionActionId")) { + properties.actionSpec = 1; + if (!$util.isString(message.connectionActionId)) + return "connectionActionId: string expected"; + } + if (message.entityOperation != null && message.hasOwnProperty("entityOperation")) { + if (properties.actionSpec === 1) + return "actionSpec: multiple values"; + properties.actionSpec = 1; + { + var error = $root.google.cloud.ces.v1beta.Action.EntityOperation.verify(message.entityOperation); + if (error) + return "entityOperation." + error; + } + } + if (message.inputFields != null && message.hasOwnProperty("inputFields")) { + if (!Array.isArray(message.inputFields)) + return "inputFields: array expected"; + for (var i = 0; i < message.inputFields.length; ++i) + if (!$util.isString(message.inputFields[i])) + return "inputFields: string[] expected"; + } + if (message.outputFields != null && message.hasOwnProperty("outputFields")) { + if (!Array.isArray(message.outputFields)) + return "outputFields: array expected"; + for (var i = 0; i < message.outputFields.length; ++i) + if (!$util.isString(message.outputFields[i])) + return "outputFields: string[] expected"; + } + return null; + }; + + /** + * Creates an Action message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Action + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Action} Action + */ + Action.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Action) + return object; + var message = new $root.google.cloud.ces.v1beta.Action(); + if (object.connectionActionId != null) + message.connectionActionId = String(object.connectionActionId); + if (object.entityOperation != null) { + if (typeof object.entityOperation !== "object") + throw TypeError(".google.cloud.ces.v1beta.Action.entityOperation: object expected"); + message.entityOperation = $root.google.cloud.ces.v1beta.Action.EntityOperation.fromObject(object.entityOperation); + } + if (object.inputFields) { + if (!Array.isArray(object.inputFields)) + throw TypeError(".google.cloud.ces.v1beta.Action.inputFields: array expected"); + message.inputFields = []; + for (var i = 0; i < object.inputFields.length; ++i) + message.inputFields[i] = String(object.inputFields[i]); + } + if (object.outputFields) { + if (!Array.isArray(object.outputFields)) + throw TypeError(".google.cloud.ces.v1beta.Action.outputFields: array expected"); + message.outputFields = []; + for (var i = 0; i < object.outputFields.length; ++i) + message.outputFields[i] = String(object.outputFields[i]); + } + return message; + }; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Action + * @static + * @param {google.cloud.ces.v1beta.Action} message Action + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Action.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputFields = []; + object.outputFields = []; + } + if (message.inputFields && message.inputFields.length) { + object.inputFields = []; + for (var j = 0; j < message.inputFields.length; ++j) + object.inputFields[j] = message.inputFields[j]; + } + if (message.outputFields && message.outputFields.length) { + object.outputFields = []; + for (var j = 0; j < message.outputFields.length; ++j) + object.outputFields[j] = message.outputFields[j]; + } + if (message.connectionActionId != null && message.hasOwnProperty("connectionActionId")) { + object.connectionActionId = message.connectionActionId; + if (options.oneofs) + object.actionSpec = "connectionActionId"; + } + if (message.entityOperation != null && message.hasOwnProperty("entityOperation")) { + object.entityOperation = $root.google.cloud.ces.v1beta.Action.EntityOperation.toObject(message.entityOperation, options); + if (options.oneofs) + object.actionSpec = "entityOperation"; + } + return object; + }; + + /** + * Converts this Action to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Action + * @instance + * @returns {Object.} JSON object + */ + Action.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Action + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Action + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Action.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Action"; + }; + + Action.EntityOperation = (function() { + + /** + * Properties of an EntityOperation. + * @memberof google.cloud.ces.v1beta.Action + * @interface IEntityOperation + * @property {string|null} [entityId] EntityOperation entityId + * @property {google.cloud.ces.v1beta.Action.EntityOperation.OperationType|null} [operation] EntityOperation operation + */ + + /** + * Constructs a new EntityOperation. + * @memberof google.cloud.ces.v1beta.Action + * @classdesc Represents an EntityOperation. + * @implements IEntityOperation + * @constructor + * @param {google.cloud.ces.v1beta.Action.IEntityOperation=} [properties] Properties to set + */ + function EntityOperation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EntityOperation entityId. + * @member {string} entityId + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @instance + */ + EntityOperation.prototype.entityId = ""; + + /** + * EntityOperation operation. + * @member {google.cloud.ces.v1beta.Action.EntityOperation.OperationType} operation + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @instance + */ + EntityOperation.prototype.operation = 0; + + /** + * Creates a new EntityOperation instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @static + * @param {google.cloud.ces.v1beta.Action.IEntityOperation=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Action.EntityOperation} EntityOperation instance + */ + EntityOperation.create = function create(properties) { + return new EntityOperation(properties); + }; + + /** + * Encodes the specified EntityOperation message. Does not implicitly {@link google.cloud.ces.v1beta.Action.EntityOperation.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @static + * @param {google.cloud.ces.v1beta.Action.IEntityOperation} message EntityOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityOperation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityId); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.operation); + return writer; + }; + + /** + * Encodes the specified EntityOperation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Action.EntityOperation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @static + * @param {google.cloud.ces.v1beta.Action.IEntityOperation} message EntityOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityOperation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityOperation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Action.EntityOperation} EntityOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityOperation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Action.EntityOperation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.entityId = reader.string(); + break; + } + case 2: { + message.operation = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityOperation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Action.EntityOperation} EntityOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityOperation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityOperation message. + * @function verify + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityOperation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityId != null && message.hasOwnProperty("entityId")) + if (!$util.isString(message.entityId)) + return "entityId: string expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + switch (message.operation) { + default: + return "operation: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates an EntityOperation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Action.EntityOperation} EntityOperation + */ + EntityOperation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Action.EntityOperation) + return object; + var message = new $root.google.cloud.ces.v1beta.Action.EntityOperation(); + if (object.entityId != null) + message.entityId = String(object.entityId); + switch (object.operation) { + default: + if (typeof object.operation === "number") { + message.operation = object.operation; + break; + } + break; + case "OPERATION_TYPE_UNSPECIFIED": + case 0: + message.operation = 0; + break; + case "LIST": + case 1: + message.operation = 1; + break; + case "GET": + case 2: + message.operation = 2; + break; + case "CREATE": + case 3: + message.operation = 3; + break; + case "UPDATE": + case 4: + message.operation = 4; + break; + case "DELETE": + case 5: + message.operation = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from an EntityOperation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @static + * @param {google.cloud.ces.v1beta.Action.EntityOperation} message EntityOperation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityOperation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityId = ""; + object.operation = options.enums === String ? "OPERATION_TYPE_UNSPECIFIED" : 0; + } + if (message.entityId != null && message.hasOwnProperty("entityId")) + object.entityId = message.entityId; + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = options.enums === String ? $root.google.cloud.ces.v1beta.Action.EntityOperation.OperationType[message.operation] === undefined ? message.operation : $root.google.cloud.ces.v1beta.Action.EntityOperation.OperationType[message.operation] : message.operation; + return object; + }; + + /** + * Converts this EntityOperation to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @instance + * @returns {Object.} JSON object + */ + EntityOperation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntityOperation + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Action.EntityOperation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntityOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Action.EntityOperation"; + }; + + /** + * OperationType enum. + * @name google.cloud.ces.v1beta.Action.EntityOperation.OperationType + * @enum {number} + * @property {number} OPERATION_TYPE_UNSPECIFIED=0 OPERATION_TYPE_UNSPECIFIED value + * @property {number} LIST=1 LIST value + * @property {number} GET=2 GET value + * @property {number} CREATE=3 CREATE value + * @property {number} UPDATE=4 UPDATE value + * @property {number} DELETE=5 DELETE value + */ + EntityOperation.OperationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LIST"] = 1; + values[valuesById[2] = "GET"] = 2; + values[valuesById[3] = "CREATE"] = 3; + values[valuesById[4] = "UPDATE"] = 4; + values[valuesById[5] = "DELETE"] = 5; + return values; + })(); + + return EntityOperation; + })(); + + return Action; + })(); + + v1beta.ConnectorTool = (function() { + + /** + * Properties of a ConnectorTool. + * @memberof google.cloud.ces.v1beta + * @interface IConnectorTool + * @property {string|null} [connection] ConnectorTool connection + * @property {google.cloud.ces.v1beta.IAction|null} [action] ConnectorTool action + * @property {google.cloud.ces.v1beta.IEndUserAuthConfig|null} [authConfig] ConnectorTool authConfig + * @property {string|null} [name] ConnectorTool name + * @property {string|null} [description] ConnectorTool description + */ + + /** + * Constructs a new ConnectorTool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ConnectorTool. + * @implements IConnectorTool + * @constructor + * @param {google.cloud.ces.v1beta.IConnectorTool=} [properties] Properties to set + */ + function ConnectorTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectorTool connection. + * @member {string} connection + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @instance + */ + ConnectorTool.prototype.connection = ""; + + /** + * ConnectorTool action. + * @member {google.cloud.ces.v1beta.IAction|null|undefined} action + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @instance + */ + ConnectorTool.prototype.action = null; + + /** + * ConnectorTool authConfig. + * @member {google.cloud.ces.v1beta.IEndUserAuthConfig|null|undefined} authConfig + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @instance + */ + ConnectorTool.prototype.authConfig = null; + + /** + * ConnectorTool name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @instance + */ + ConnectorTool.prototype.name = ""; + + /** + * ConnectorTool description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @instance + */ + ConnectorTool.prototype.description = ""; + + /** + * Creates a new ConnectorTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @static + * @param {google.cloud.ces.v1beta.IConnectorTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ConnectorTool} ConnectorTool instance + */ + ConnectorTool.create = function create(properties) { + return new ConnectorTool(properties); + }; + + /** + * Encodes the specified ConnectorTool message. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @static + * @param {google.cloud.ces.v1beta.IConnectorTool} message ConnectorTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + $root.google.cloud.ces.v1beta.Action.encode(message.action, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.authConfig != null && Object.hasOwnProperty.call(message, "authConfig")) + $root.google.cloud.ces.v1beta.EndUserAuthConfig.encode(message.authConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + return writer; + }; + + /** + * Encodes the specified ConnectorTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @static + * @param {google.cloud.ces.v1beta.IConnectorTool} message ConnectorTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectorTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ConnectorTool} ConnectorTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ConnectorTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.connection = reader.string(); + break; + } + case 2: { + message.action = $root.google.cloud.ces.v1beta.Action.decode(reader, reader.uint32()); + break; + } + case 3: { + message.authConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.name = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectorTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ConnectorTool} ConnectorTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectorTool message. + * @function verify + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectorTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connection != null && message.hasOwnProperty("connection")) + if (!$util.isString(message.connection)) + return "connection: string expected"; + if (message.action != null && message.hasOwnProperty("action")) { + var error = $root.google.cloud.ces.v1beta.Action.verify(message.action); + if (error) + return "action." + error; + } + if (message.authConfig != null && message.hasOwnProperty("authConfig")) { + var error = $root.google.cloud.ces.v1beta.EndUserAuthConfig.verify(message.authConfig); + if (error) + return "authConfig." + error; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a ConnectorTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ConnectorTool} ConnectorTool + */ + ConnectorTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ConnectorTool) + return object; + var message = new $root.google.cloud.ces.v1beta.ConnectorTool(); + if (object.connection != null) + message.connection = String(object.connection); + if (object.action != null) { + if (typeof object.action !== "object") + throw TypeError(".google.cloud.ces.v1beta.ConnectorTool.action: object expected"); + message.action = $root.google.cloud.ces.v1beta.Action.fromObject(object.action); + } + if (object.authConfig != null) { + if (typeof object.authConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.ConnectorTool.authConfig: object expected"); + message.authConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.fromObject(object.authConfig); + } + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a ConnectorTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @static + * @param {google.cloud.ces.v1beta.ConnectorTool} message ConnectorTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectorTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.connection = ""; + object.action = null; + object.authConfig = null; + object.name = ""; + object.description = ""; + } + if (message.connection != null && message.hasOwnProperty("connection")) + object.connection = message.connection; + if (message.action != null && message.hasOwnProperty("action")) + object.action = $root.google.cloud.ces.v1beta.Action.toObject(message.action, options); + if (message.authConfig != null && message.hasOwnProperty("authConfig")) + object.authConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.toObject(message.authConfig, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this ConnectorTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @instance + * @returns {Object.} JSON object + */ + ConnectorTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectorTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ConnectorTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectorTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ConnectorTool"; + }; + + return ConnectorTool; + })(); + + v1beta.ApiKeyConfig = (function() { + + /** + * Properties of an ApiKeyConfig. + * @memberof google.cloud.ces.v1beta + * @interface IApiKeyConfig + * @property {string|null} [keyName] ApiKeyConfig keyName + * @property {string|null} [apiKeySecretVersion] ApiKeyConfig apiKeySecretVersion + * @property {google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation|null} [requestLocation] ApiKeyConfig requestLocation + */ + + /** + * Constructs a new ApiKeyConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ApiKeyConfig. + * @implements IApiKeyConfig + * @constructor + * @param {google.cloud.ces.v1beta.IApiKeyConfig=} [properties] Properties to set + */ + function ApiKeyConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiKeyConfig keyName. + * @member {string} keyName + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @instance + */ + ApiKeyConfig.prototype.keyName = ""; + + /** + * ApiKeyConfig apiKeySecretVersion. + * @member {string} apiKeySecretVersion + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @instance + */ + ApiKeyConfig.prototype.apiKeySecretVersion = ""; + + /** + * ApiKeyConfig requestLocation. + * @member {google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation} requestLocation + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @instance + */ + ApiKeyConfig.prototype.requestLocation = 0; + + /** + * Creates a new ApiKeyConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @static + * @param {google.cloud.ces.v1beta.IApiKeyConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ApiKeyConfig} ApiKeyConfig instance + */ + ApiKeyConfig.create = function create(properties) { + return new ApiKeyConfig(properties); + }; + + /** + * Encodes the specified ApiKeyConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ApiKeyConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @static + * @param {google.cloud.ces.v1beta.IApiKeyConfig} message ApiKeyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiKeyConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyName != null && Object.hasOwnProperty.call(message, "keyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyName); + if (message.apiKeySecretVersion != null && Object.hasOwnProperty.call(message, "apiKeySecretVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.apiKeySecretVersion); + if (message.requestLocation != null && Object.hasOwnProperty.call(message, "requestLocation")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.requestLocation); + return writer; + }; + + /** + * Encodes the specified ApiKeyConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ApiKeyConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @static + * @param {google.cloud.ces.v1beta.IApiKeyConfig} message ApiKeyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiKeyConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ApiKeyConfig} ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiKeyConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ApiKeyConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.keyName = reader.string(); + break; + } + case 2: { + message.apiKeySecretVersion = reader.string(); + break; + } + case 3: { + message.requestLocation = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ApiKeyConfig} ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiKeyConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiKeyConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiKeyConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyName != null && message.hasOwnProperty("keyName")) + if (!$util.isString(message.keyName)) + return "keyName: string expected"; + if (message.apiKeySecretVersion != null && message.hasOwnProperty("apiKeySecretVersion")) + if (!$util.isString(message.apiKeySecretVersion)) + return "apiKeySecretVersion: string expected"; + if (message.requestLocation != null && message.hasOwnProperty("requestLocation")) + switch (message.requestLocation) { + default: + return "requestLocation: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ApiKeyConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ApiKeyConfig} ApiKeyConfig + */ + ApiKeyConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ApiKeyConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.ApiKeyConfig(); + if (object.keyName != null) + message.keyName = String(object.keyName); + if (object.apiKeySecretVersion != null) + message.apiKeySecretVersion = String(object.apiKeySecretVersion); + switch (object.requestLocation) { + default: + if (typeof object.requestLocation === "number") { + message.requestLocation = object.requestLocation; + break; + } + break; + case "REQUEST_LOCATION_UNSPECIFIED": + case 0: + message.requestLocation = 0; + break; + case "HEADER": + case 1: + message.requestLocation = 1; + break; + case "QUERY_STRING": + case 2: + message.requestLocation = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ApiKeyConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @static + * @param {google.cloud.ces.v1beta.ApiKeyConfig} message ApiKeyConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiKeyConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.keyName = ""; + object.apiKeySecretVersion = ""; + object.requestLocation = options.enums === String ? "REQUEST_LOCATION_UNSPECIFIED" : 0; + } + if (message.keyName != null && message.hasOwnProperty("keyName")) + object.keyName = message.keyName; + if (message.apiKeySecretVersion != null && message.hasOwnProperty("apiKeySecretVersion")) + object.apiKeySecretVersion = message.apiKeySecretVersion; + if (message.requestLocation != null && message.hasOwnProperty("requestLocation")) + object.requestLocation = options.enums === String ? $root.google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation[message.requestLocation] === undefined ? message.requestLocation : $root.google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation[message.requestLocation] : message.requestLocation; + return object; + }; + + /** + * Converts this ApiKeyConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @instance + * @returns {Object.} JSON object + */ + ApiKeyConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiKeyConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ApiKeyConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiKeyConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ApiKeyConfig"; + }; + + /** + * RequestLocation enum. + * @name google.cloud.ces.v1beta.ApiKeyConfig.RequestLocation + * @enum {number} + * @property {number} REQUEST_LOCATION_UNSPECIFIED=0 REQUEST_LOCATION_UNSPECIFIED value + * @property {number} HEADER=1 HEADER value + * @property {number} QUERY_STRING=2 QUERY_STRING value + */ + ApiKeyConfig.RequestLocation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REQUEST_LOCATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "HEADER"] = 1; + values[valuesById[2] = "QUERY_STRING"] = 2; + return values; + })(); + + return ApiKeyConfig; + })(); + + v1beta.OAuthConfig = (function() { + + /** + * Properties of a OAuthConfig. + * @memberof google.cloud.ces.v1beta + * @interface IOAuthConfig + * @property {google.cloud.ces.v1beta.OAuthConfig.OauthGrantType|null} [oauthGrantType] OAuthConfig oauthGrantType + * @property {string|null} [clientId] OAuthConfig clientId + * @property {string|null} [clientSecretVersion] OAuthConfig clientSecretVersion + * @property {string|null} [tokenEndpoint] OAuthConfig tokenEndpoint + * @property {Array.|null} [scopes] OAuthConfig scopes + */ + + /** + * Constructs a new OAuthConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a OAuthConfig. + * @implements IOAuthConfig + * @constructor + * @param {google.cloud.ces.v1beta.IOAuthConfig=} [properties] Properties to set + */ + function OAuthConfig(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OAuthConfig oauthGrantType. + * @member {google.cloud.ces.v1beta.OAuthConfig.OauthGrantType} oauthGrantType + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @instance + */ + OAuthConfig.prototype.oauthGrantType = 0; + + /** + * OAuthConfig clientId. + * @member {string} clientId + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @instance + */ + OAuthConfig.prototype.clientId = ""; + + /** + * OAuthConfig clientSecretVersion. + * @member {string} clientSecretVersion + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @instance + */ + OAuthConfig.prototype.clientSecretVersion = ""; + + /** + * OAuthConfig tokenEndpoint. + * @member {string} tokenEndpoint + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @instance + */ + OAuthConfig.prototype.tokenEndpoint = ""; + + /** + * OAuthConfig scopes. + * @member {Array.} scopes + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @instance + */ + OAuthConfig.prototype.scopes = $util.emptyArray; + + /** + * Creates a new OAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IOAuthConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OAuthConfig} OAuthConfig instance + */ + OAuthConfig.create = function create(properties) { + return new OAuthConfig(properties); + }; + + /** + * Encodes the specified OAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IOAuthConfig} message OAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.oauthGrantType != null && Object.hasOwnProperty.call(message, "oauthGrantType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.oauthGrantType); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientId); + if (message.clientSecretVersion != null && Object.hasOwnProperty.call(message, "clientSecretVersion")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientSecretVersion); + if (message.tokenEndpoint != null && Object.hasOwnProperty.call(message, "tokenEndpoint")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tokenEndpoint); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified OAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IOAuthConfig} message OAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OAuthConfig} OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OAuthConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.oauthGrantType = reader.int32(); + break; + } + case 2: { + message.clientId = reader.string(); + break; + } + case 3: { + message.clientSecretVersion = reader.string(); + break; + } + case 4: { + message.tokenEndpoint = reader.string(); + break; + } + case 5: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a OAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OAuthConfig} OAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a OAuthConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OAuthConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.oauthGrantType != null && message.hasOwnProperty("oauthGrantType")) + switch (message.oauthGrantType) { + default: + return "oauthGrantType: enum value expected"; + case 0: + case 1: + break; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientSecretVersion != null && message.hasOwnProperty("clientSecretVersion")) + if (!$util.isString(message.clientSecretVersion)) + return "clientSecretVersion: string expected"; + if (message.tokenEndpoint != null && message.hasOwnProperty("tokenEndpoint")) + if (!$util.isString(message.tokenEndpoint)) + return "tokenEndpoint: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + return null; + }; + + /** + * Creates a OAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OAuthConfig} OAuthConfig + */ + OAuthConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OAuthConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.OAuthConfig(); + switch (object.oauthGrantType) { + default: + if (typeof object.oauthGrantType === "number") { + message.oauthGrantType = object.oauthGrantType; + break; + } + break; + case "OAUTH_GRANT_TYPE_UNSPECIFIED": + case 0: + message.oauthGrantType = 0; + break; + case "CLIENT_CREDENTIAL": + case 1: + message.oauthGrantType = 1; + break; + } + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientSecretVersion != null) + message.clientSecretVersion = String(object.clientSecretVersion); + if (object.tokenEndpoint != null) + message.tokenEndpoint = String(object.tokenEndpoint); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.ces.v1beta.OAuthConfig.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from a OAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @static + * @param {google.cloud.ces.v1beta.OAuthConfig} message OAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) { + object.oauthGrantType = options.enums === String ? "OAUTH_GRANT_TYPE_UNSPECIFIED" : 0; + object.clientId = ""; + object.clientSecretVersion = ""; + object.tokenEndpoint = ""; + } + if (message.oauthGrantType != null && message.hasOwnProperty("oauthGrantType")) + object.oauthGrantType = options.enums === String ? $root.google.cloud.ces.v1beta.OAuthConfig.OauthGrantType[message.oauthGrantType] === undefined ? message.oauthGrantType : $root.google.cloud.ces.v1beta.OAuthConfig.OauthGrantType[message.oauthGrantType] : message.oauthGrantType; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientSecretVersion != null && message.hasOwnProperty("clientSecretVersion")) + object.clientSecretVersion = message.clientSecretVersion; + if (message.tokenEndpoint != null && message.hasOwnProperty("tokenEndpoint")) + object.tokenEndpoint = message.tokenEndpoint; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this OAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @instance + * @returns {Object.} JSON object + */ + OAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OAuthConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OAuthConfig"; + }; + + /** + * OauthGrantType enum. + * @name google.cloud.ces.v1beta.OAuthConfig.OauthGrantType + * @enum {number} + * @property {number} OAUTH_GRANT_TYPE_UNSPECIFIED=0 OAUTH_GRANT_TYPE_UNSPECIFIED value + * @property {number} CLIENT_CREDENTIAL=1 CLIENT_CREDENTIAL value + */ + OAuthConfig.OauthGrantType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OAUTH_GRANT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLIENT_CREDENTIAL"] = 1; + return values; + })(); + + return OAuthConfig; + })(); + + v1beta.ServiceAgentIdTokenAuthConfig = (function() { + + /** + * Properties of a ServiceAgentIdTokenAuthConfig. + * @memberof google.cloud.ces.v1beta + * @interface IServiceAgentIdTokenAuthConfig + */ + + /** + * Constructs a new ServiceAgentIdTokenAuthConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ServiceAgentIdTokenAuthConfig. + * @implements IServiceAgentIdTokenAuthConfig + * @constructor + * @param {google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig=} [properties] Properties to set + */ + function ServiceAgentIdTokenAuthConfig(properties) { + if (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 ServiceAgentIdTokenAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig instance + */ + ServiceAgentIdTokenAuthConfig.create = function create(properties) { + return new ServiceAgentIdTokenAuthConfig(properties); + }; + + /** + * Encodes the specified ServiceAgentIdTokenAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig} message ServiceAgentIdTokenAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAgentIdTokenAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ServiceAgentIdTokenAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig} message ServiceAgentIdTokenAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAgentIdTokenAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAgentIdTokenAuthConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAgentIdTokenAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAgentIdTokenAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAgentIdTokenAuthConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAgentIdTokenAuthConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ServiceAgentIdTokenAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig} ServiceAgentIdTokenAuthConfig + */ + ServiceAgentIdTokenAuthConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig) + return object; + return new $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig(); + }; + + /** + * Creates a plain object from a ServiceAgentIdTokenAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @static + * @param {google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig} message ServiceAgentIdTokenAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAgentIdTokenAuthConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ServiceAgentIdTokenAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceAgentIdTokenAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAgentIdTokenAuthConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAgentIdTokenAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig"; + }; + + return ServiceAgentIdTokenAuthConfig; + })(); + + v1beta.ServiceAccountAuthConfig = (function() { + + /** + * Properties of a ServiceAccountAuthConfig. + * @memberof google.cloud.ces.v1beta + * @interface IServiceAccountAuthConfig + * @property {string|null} [serviceAccount] ServiceAccountAuthConfig serviceAccount + * @property {Array.|null} [scopes] ServiceAccountAuthConfig scopes + */ + + /** + * Constructs a new ServiceAccountAuthConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ServiceAccountAuthConfig. + * @implements IServiceAccountAuthConfig + * @constructor + * @param {google.cloud.ces.v1beta.IServiceAccountAuthConfig=} [properties] Properties to set + */ + function ServiceAccountAuthConfig(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceAccountAuthConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @instance + */ + ServiceAccountAuthConfig.prototype.serviceAccount = ""; + + /** + * ServiceAccountAuthConfig scopes. + * @member {Array.} scopes + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @instance + */ + ServiceAccountAuthConfig.prototype.scopes = $util.emptyArray; + + /** + * Creates a new ServiceAccountAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IServiceAccountAuthConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ServiceAccountAuthConfig} ServiceAccountAuthConfig instance + */ + ServiceAccountAuthConfig.create = function create(properties) { + return new ServiceAccountAuthConfig(properties); + }; + + /** + * Encodes the specified ServiceAccountAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAccountAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IServiceAccountAuthConfig} message ServiceAccountAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccount); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified ServiceAccountAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ServiceAccountAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IServiceAccountAuthConfig} message ServiceAccountAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccountAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ServiceAccountAuthConfig} ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountAuthConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.serviceAccount = reader.string(); + break; + } + case 2: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAccountAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ServiceAccountAuthConfig} ServiceAccountAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccountAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAccountAuthConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAccountAuthConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + return null; + }; + + /** + * Creates a ServiceAccountAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ServiceAccountAuthConfig} ServiceAccountAuthConfig + */ + ServiceAccountAuthConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig(); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.ces.v1beta.ServiceAccountAuthConfig.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from a ServiceAccountAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @static + * @param {google.cloud.ces.v1beta.ServiceAccountAuthConfig} message ServiceAccountAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAccountAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) + object.serviceAccount = ""; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this ServiceAccountAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @instance + * @returns {Object.} JSON object + */ + ServiceAccountAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAccountAuthConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ServiceAccountAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAccountAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ServiceAccountAuthConfig"; + }; + + return ServiceAccountAuthConfig; + })(); + + v1beta.BearerTokenConfig = (function() { + + /** + * Properties of a BearerTokenConfig. + * @memberof google.cloud.ces.v1beta + * @interface IBearerTokenConfig + * @property {string|null} [token] BearerTokenConfig token + */ + + /** + * Constructs a new BearerTokenConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a BearerTokenConfig. + * @implements IBearerTokenConfig + * @constructor + * @param {google.cloud.ces.v1beta.IBearerTokenConfig=} [properties] Properties to set + */ + function BearerTokenConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BearerTokenConfig token. + * @member {string} token + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @instance + */ + BearerTokenConfig.prototype.token = ""; + + /** + * Creates a new BearerTokenConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @static + * @param {google.cloud.ces.v1beta.IBearerTokenConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.BearerTokenConfig} BearerTokenConfig instance + */ + BearerTokenConfig.create = function create(properties) { + return new BearerTokenConfig(properties); + }; + + /** + * Encodes the specified BearerTokenConfig message. Does not implicitly {@link google.cloud.ces.v1beta.BearerTokenConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @static + * @param {google.cloud.ces.v1beta.IBearerTokenConfig} message BearerTokenConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BearerTokenConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); + return writer; + }; + + /** + * Encodes the specified BearerTokenConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BearerTokenConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @static + * @param {google.cloud.ces.v1beta.IBearerTokenConfig} message BearerTokenConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BearerTokenConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.BearerTokenConfig} BearerTokenConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BearerTokenConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BearerTokenConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.token = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BearerTokenConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.BearerTokenConfig} BearerTokenConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BearerTokenConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BearerTokenConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BearerTokenConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.token != null && message.hasOwnProperty("token")) + if (!$util.isString(message.token)) + return "token: string expected"; + return null; + }; + + /** + * Creates a BearerTokenConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.BearerTokenConfig} BearerTokenConfig + */ + BearerTokenConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.BearerTokenConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.BearerTokenConfig(); + if (object.token != null) + message.token = String(object.token); + return message; + }; + + /** + * Creates a plain object from a BearerTokenConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @static + * @param {google.cloud.ces.v1beta.BearerTokenConfig} message BearerTokenConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BearerTokenConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.token = ""; + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + return object; + }; + + /** + * Converts this BearerTokenConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @instance + * @returns {Object.} JSON object + */ + BearerTokenConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BearerTokenConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.BearerTokenConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BearerTokenConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.BearerTokenConfig"; + }; + + return BearerTokenConfig; + })(); + + v1beta.EndUserAuthConfig = (function() { + + /** + * Properties of an EndUserAuthConfig. + * @memberof google.cloud.ces.v1beta + * @interface IEndUserAuthConfig + * @property {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig|null} [oauth2AuthCodeConfig] EndUserAuthConfig oauth2AuthCodeConfig + * @property {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig|null} [oauth2JwtBearerConfig] EndUserAuthConfig oauth2JwtBearerConfig + */ + + /** + * Constructs a new EndUserAuthConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EndUserAuthConfig. + * @implements IEndUserAuthConfig + * @constructor + * @param {google.cloud.ces.v1beta.IEndUserAuthConfig=} [properties] Properties to set + */ + function EndUserAuthConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndUserAuthConfig oauth2AuthCodeConfig. + * @member {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig|null|undefined} oauth2AuthCodeConfig + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @instance + */ + EndUserAuthConfig.prototype.oauth2AuthCodeConfig = null; + + /** + * EndUserAuthConfig oauth2JwtBearerConfig. + * @member {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig|null|undefined} oauth2JwtBearerConfig + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @instance + */ + EndUserAuthConfig.prototype.oauth2JwtBearerConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EndUserAuthConfig authConfig. + * @member {"oauth2AuthCodeConfig"|"oauth2JwtBearerConfig"|undefined} authConfig + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @instance + */ + Object.defineProperty(EndUserAuthConfig.prototype, "authConfig", { + get: $util.oneOfGetter($oneOfFields = ["oauth2AuthCodeConfig", "oauth2JwtBearerConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EndUserAuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IEndUserAuthConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig} EndUserAuthConfig instance + */ + EndUserAuthConfig.create = function create(properties) { + return new EndUserAuthConfig(properties); + }; + + /** + * Encodes the specified EndUserAuthConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IEndUserAuthConfig} message EndUserAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndUserAuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.oauth2AuthCodeConfig != null && Object.hasOwnProperty.call(message, "oauth2AuthCodeConfig")) + $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.encode(message.oauth2AuthCodeConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.oauth2JwtBearerConfig != null && Object.hasOwnProperty.call(message, "oauth2JwtBearerConfig")) + $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.encode(message.oauth2JwtBearerConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EndUserAuthConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @static + * @param {google.cloud.ces.v1beta.IEndUserAuthConfig} message EndUserAuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndUserAuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndUserAuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig} EndUserAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndUserAuthConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EndUserAuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.oauth2AuthCodeConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.oauth2JwtBearerConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndUserAuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig} EndUserAuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndUserAuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndUserAuthConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndUserAuthConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.oauth2AuthCodeConfig != null && message.hasOwnProperty("oauth2AuthCodeConfig")) { + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.verify(message.oauth2AuthCodeConfig); + if (error) + return "oauth2AuthCodeConfig." + error; + } + } + if (message.oauth2JwtBearerConfig != null && message.hasOwnProperty("oauth2JwtBearerConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.verify(message.oauth2JwtBearerConfig); + if (error) + return "oauth2JwtBearerConfig." + error; + } + } + return null; + }; + + /** + * Creates an EndUserAuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig} EndUserAuthConfig + */ + EndUserAuthConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EndUserAuthConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.EndUserAuthConfig(); + if (object.oauth2AuthCodeConfig != null) { + if (typeof object.oauth2AuthCodeConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.EndUserAuthConfig.oauth2AuthCodeConfig: object expected"); + message.oauth2AuthCodeConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.fromObject(object.oauth2AuthCodeConfig); + } + if (object.oauth2JwtBearerConfig != null) { + if (typeof object.oauth2JwtBearerConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.EndUserAuthConfig.oauth2JwtBearerConfig: object expected"); + message.oauth2JwtBearerConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.fromObject(object.oauth2JwtBearerConfig); + } + return message; + }; + + /** + * Creates a plain object from an EndUserAuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @static + * @param {google.cloud.ces.v1beta.EndUserAuthConfig} message EndUserAuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndUserAuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.oauth2AuthCodeConfig != null && message.hasOwnProperty("oauth2AuthCodeConfig")) { + object.oauth2AuthCodeConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.toObject(message.oauth2AuthCodeConfig, options); + if (options.oneofs) + object.authConfig = "oauth2AuthCodeConfig"; + } + if (message.oauth2JwtBearerConfig != null && message.hasOwnProperty("oauth2JwtBearerConfig")) { + object.oauth2JwtBearerConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.toObject(message.oauth2JwtBearerConfig, options); + if (options.oneofs) + object.authConfig = "oauth2JwtBearerConfig"; + } + return object; + }; + + /** + * Converts this EndUserAuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @instance + * @returns {Object.} JSON object + */ + EndUserAuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndUserAuthConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndUserAuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EndUserAuthConfig"; + }; + + EndUserAuthConfig.Oauth2AuthCodeConfig = (function() { + + /** + * Properties of an Oauth2AuthCodeConfig. + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @interface IOauth2AuthCodeConfig + * @property {string|null} [oauthToken] Oauth2AuthCodeConfig oauthToken + */ + + /** + * Constructs a new Oauth2AuthCodeConfig. + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @classdesc Represents an Oauth2AuthCodeConfig. + * @implements IOauth2AuthCodeConfig + * @constructor + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig=} [properties] Properties to set + */ + function Oauth2AuthCodeConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Oauth2AuthCodeConfig oauthToken. + * @member {string} oauthToken + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @instance + */ + Oauth2AuthCodeConfig.prototype.oauthToken = ""; + + /** + * Creates a new Oauth2AuthCodeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig instance + */ + Oauth2AuthCodeConfig.create = function create(properties) { + return new Oauth2AuthCodeConfig(properties); + }; + + /** + * Encodes the specified Oauth2AuthCodeConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig} message Oauth2AuthCodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2AuthCodeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.oauthToken != null && Object.hasOwnProperty.call(message, "oauthToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.oauthToken); + return writer; + }; + + /** + * Encodes the specified Oauth2AuthCodeConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2AuthCodeConfig} message Oauth2AuthCodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2AuthCodeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2AuthCodeConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.oauthToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Oauth2AuthCodeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2AuthCodeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Oauth2AuthCodeConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Oauth2AuthCodeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.oauthToken != null && message.hasOwnProperty("oauthToken")) + if (!$util.isString(message.oauthToken)) + return "oauthToken: string expected"; + return null; + }; + + /** + * Creates an Oauth2AuthCodeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig} Oauth2AuthCodeConfig + */ + Oauth2AuthCodeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig(); + if (object.oauthToken != null) + message.oauthToken = String(object.oauthToken); + return message; + }; + + /** + * Creates a plain object from an Oauth2AuthCodeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig} message Oauth2AuthCodeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Oauth2AuthCodeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.oauthToken = ""; + if (message.oauthToken != null && message.hasOwnProperty("oauthToken")) + object.oauthToken = message.oauthToken; + return object; + }; + + /** + * Converts this Oauth2AuthCodeConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @instance + * @returns {Object.} JSON object + */ + Oauth2AuthCodeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Oauth2AuthCodeConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Oauth2AuthCodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2AuthCodeConfig"; + }; + + return Oauth2AuthCodeConfig; + })(); + + EndUserAuthConfig.Oauth2JwtBearerConfig = (function() { + + /** + * Properties of an Oauth2JwtBearerConfig. + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @interface IOauth2JwtBearerConfig + * @property {string|null} [issuer] Oauth2JwtBearerConfig issuer + * @property {string|null} [subject] Oauth2JwtBearerConfig subject + * @property {string|null} [clientKey] Oauth2JwtBearerConfig clientKey + */ + + /** + * Constructs a new Oauth2JwtBearerConfig. + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig + * @classdesc Represents an Oauth2JwtBearerConfig. + * @implements IOauth2JwtBearerConfig + * @constructor + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig=} [properties] Properties to set + */ + function Oauth2JwtBearerConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Oauth2JwtBearerConfig issuer. + * @member {string} issuer + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @instance + */ + Oauth2JwtBearerConfig.prototype.issuer = ""; + + /** + * Oauth2JwtBearerConfig subject. + * @member {string} subject + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @instance + */ + Oauth2JwtBearerConfig.prototype.subject = ""; + + /** + * Oauth2JwtBearerConfig clientKey. + * @member {string} clientKey + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @instance + */ + Oauth2JwtBearerConfig.prototype.clientKey = ""; + + /** + * Creates a new Oauth2JwtBearerConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig instance + */ + Oauth2JwtBearerConfig.create = function create(properties) { + return new Oauth2JwtBearerConfig(properties); + }; + + /** + * Encodes the specified Oauth2JwtBearerConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig} message Oauth2JwtBearerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2JwtBearerConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.issuer != null && Object.hasOwnProperty.call(message, "issuer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.issuer); + if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subject); + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientKey); + return writer; + }; + + /** + * Encodes the specified Oauth2JwtBearerConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.IOauth2JwtBearerConfig} message Oauth2JwtBearerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2JwtBearerConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2JwtBearerConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.issuer = reader.string(); + break; + } + case 2: { + message.subject = reader.string(); + break; + } + case 3: { + message.clientKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Oauth2JwtBearerConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2JwtBearerConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Oauth2JwtBearerConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Oauth2JwtBearerConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.issuer != null && message.hasOwnProperty("issuer")) + if (!$util.isString(message.issuer)) + return "issuer: string expected"; + if (message.subject != null && message.hasOwnProperty("subject")) + if (!$util.isString(message.subject)) + return "subject: string expected"; + if (message.clientKey != null && message.hasOwnProperty("clientKey")) + if (!$util.isString(message.clientKey)) + return "clientKey: string expected"; + return null; + }; + + /** + * Creates an Oauth2JwtBearerConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig} Oauth2JwtBearerConfig + */ + Oauth2JwtBearerConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig(); + if (object.issuer != null) + message.issuer = String(object.issuer); + if (object.subject != null) + message.subject = String(object.subject); + if (object.clientKey != null) + message.clientKey = String(object.clientKey); + return message; + }; + + /** + * Creates a plain object from an Oauth2JwtBearerConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig} message Oauth2JwtBearerConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Oauth2JwtBearerConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.issuer = ""; + object.subject = ""; + object.clientKey = ""; + } + if (message.issuer != null && message.hasOwnProperty("issuer")) + object.issuer = message.issuer; + if (message.subject != null && message.hasOwnProperty("subject")) + object.subject = message.subject; + if (message.clientKey != null && message.hasOwnProperty("clientKey")) + object.clientKey = message.clientKey; + return object; + }; + + /** + * Converts this Oauth2JwtBearerConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @instance + * @returns {Object.} JSON object + */ + Oauth2JwtBearerConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Oauth2JwtBearerConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Oauth2JwtBearerConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EndUserAuthConfig.Oauth2JwtBearerConfig"; + }; + + return Oauth2JwtBearerConfig; + })(); + + return EndUserAuthConfig; + })(); + + v1beta.ApiAuthentication = (function() { + + /** + * Properties of an ApiAuthentication. + * @memberof google.cloud.ces.v1beta + * @interface IApiAuthentication + * @property {google.cloud.ces.v1beta.IApiKeyConfig|null} [apiKeyConfig] ApiAuthentication apiKeyConfig + * @property {google.cloud.ces.v1beta.IOAuthConfig|null} [oauthConfig] ApiAuthentication oauthConfig + * @property {google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig|null} [serviceAgentIdTokenAuthConfig] ApiAuthentication serviceAgentIdTokenAuthConfig + * @property {google.cloud.ces.v1beta.IServiceAccountAuthConfig|null} [serviceAccountAuthConfig] ApiAuthentication serviceAccountAuthConfig + * @property {google.cloud.ces.v1beta.IBearerTokenConfig|null} [bearerTokenConfig] ApiAuthentication bearerTokenConfig + */ + + /** + * Constructs a new ApiAuthentication. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ApiAuthentication. + * @implements IApiAuthentication + * @constructor + * @param {google.cloud.ces.v1beta.IApiAuthentication=} [properties] Properties to set + */ + function ApiAuthentication(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiAuthentication apiKeyConfig. + * @member {google.cloud.ces.v1beta.IApiKeyConfig|null|undefined} apiKeyConfig + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @instance + */ + ApiAuthentication.prototype.apiKeyConfig = null; + + /** + * ApiAuthentication oauthConfig. + * @member {google.cloud.ces.v1beta.IOAuthConfig|null|undefined} oauthConfig + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @instance + */ + ApiAuthentication.prototype.oauthConfig = null; + + /** + * ApiAuthentication serviceAgentIdTokenAuthConfig. + * @member {google.cloud.ces.v1beta.IServiceAgentIdTokenAuthConfig|null|undefined} serviceAgentIdTokenAuthConfig + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @instance + */ + ApiAuthentication.prototype.serviceAgentIdTokenAuthConfig = null; + + /** + * ApiAuthentication serviceAccountAuthConfig. + * @member {google.cloud.ces.v1beta.IServiceAccountAuthConfig|null|undefined} serviceAccountAuthConfig + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @instance + */ + ApiAuthentication.prototype.serviceAccountAuthConfig = null; + + /** + * ApiAuthentication bearerTokenConfig. + * @member {google.cloud.ces.v1beta.IBearerTokenConfig|null|undefined} bearerTokenConfig + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @instance + */ + ApiAuthentication.prototype.bearerTokenConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ApiAuthentication authConfig. + * @member {"apiKeyConfig"|"oauthConfig"|"serviceAgentIdTokenAuthConfig"|"serviceAccountAuthConfig"|"bearerTokenConfig"|undefined} authConfig + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @instance + */ + Object.defineProperty(ApiAuthentication.prototype, "authConfig", { + get: $util.oneOfGetter($oneOfFields = ["apiKeyConfig", "oauthConfig", "serviceAgentIdTokenAuthConfig", "serviceAccountAuthConfig", "bearerTokenConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ApiAuthentication instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @static + * @param {google.cloud.ces.v1beta.IApiAuthentication=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ApiAuthentication} ApiAuthentication instance + */ + ApiAuthentication.create = function create(properties) { + return new ApiAuthentication(properties); + }; + + /** + * Encodes the specified ApiAuthentication message. Does not implicitly {@link google.cloud.ces.v1beta.ApiAuthentication.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @static + * @param {google.cloud.ces.v1beta.IApiAuthentication} message ApiAuthentication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiAuthentication.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiKeyConfig != null && Object.hasOwnProperty.call(message, "apiKeyConfig")) + $root.google.cloud.ces.v1beta.ApiKeyConfig.encode(message.apiKeyConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.oauthConfig != null && Object.hasOwnProperty.call(message, "oauthConfig")) + $root.google.cloud.ces.v1beta.OAuthConfig.encode(message.oauthConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.serviceAgentIdTokenAuthConfig != null && Object.hasOwnProperty.call(message, "serviceAgentIdTokenAuthConfig")) + $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.encode(message.serviceAgentIdTokenAuthConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.serviceAccountAuthConfig != null && Object.hasOwnProperty.call(message, "serviceAccountAuthConfig")) + $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig.encode(message.serviceAccountAuthConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.bearerTokenConfig != null && Object.hasOwnProperty.call(message, "bearerTokenConfig")) + $root.google.cloud.ces.v1beta.BearerTokenConfig.encode(message.bearerTokenConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApiAuthentication message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ApiAuthentication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @static + * @param {google.cloud.ces.v1beta.IApiAuthentication} message ApiAuthentication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiAuthentication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiAuthentication message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ApiAuthentication} ApiAuthentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiAuthentication.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ApiAuthentication(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.apiKeyConfig = $root.google.cloud.ces.v1beta.ApiKeyConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.oauthConfig = $root.google.cloud.ces.v1beta.OAuthConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.serviceAgentIdTokenAuthConfig = $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.serviceAccountAuthConfig = $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.bearerTokenConfig = $root.google.cloud.ces.v1beta.BearerTokenConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiAuthentication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ApiAuthentication} ApiAuthentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiAuthentication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiAuthentication message. + * @function verify + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiAuthentication.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) { + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.ApiKeyConfig.verify(message.apiKeyConfig); + if (error) + return "apiKeyConfig." + error; + } + } + if (message.oauthConfig != null && message.hasOwnProperty("oauthConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.OAuthConfig.verify(message.oauthConfig); + if (error) + return "oauthConfig." + error; + } + } + if (message.serviceAgentIdTokenAuthConfig != null && message.hasOwnProperty("serviceAgentIdTokenAuthConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.verify(message.serviceAgentIdTokenAuthConfig); + if (error) + return "serviceAgentIdTokenAuthConfig." + error; + } + } + if (message.serviceAccountAuthConfig != null && message.hasOwnProperty("serviceAccountAuthConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig.verify(message.serviceAccountAuthConfig); + if (error) + return "serviceAccountAuthConfig." + error; + } + } + if (message.bearerTokenConfig != null && message.hasOwnProperty("bearerTokenConfig")) { + if (properties.authConfig === 1) + return "authConfig: multiple values"; + properties.authConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.BearerTokenConfig.verify(message.bearerTokenConfig); + if (error) + return "bearerTokenConfig." + error; + } + } + return null; + }; + + /** + * Creates an ApiAuthentication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ApiAuthentication} ApiAuthentication + */ + ApiAuthentication.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ApiAuthentication) + return object; + var message = new $root.google.cloud.ces.v1beta.ApiAuthentication(); + if (object.apiKeyConfig != null) { + if (typeof object.apiKeyConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.ApiAuthentication.apiKeyConfig: object expected"); + message.apiKeyConfig = $root.google.cloud.ces.v1beta.ApiKeyConfig.fromObject(object.apiKeyConfig); + } + if (object.oauthConfig != null) { + if (typeof object.oauthConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.ApiAuthentication.oauthConfig: object expected"); + message.oauthConfig = $root.google.cloud.ces.v1beta.OAuthConfig.fromObject(object.oauthConfig); + } + if (object.serviceAgentIdTokenAuthConfig != null) { + if (typeof object.serviceAgentIdTokenAuthConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.ApiAuthentication.serviceAgentIdTokenAuthConfig: object expected"); + message.serviceAgentIdTokenAuthConfig = $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.fromObject(object.serviceAgentIdTokenAuthConfig); + } + if (object.serviceAccountAuthConfig != null) { + if (typeof object.serviceAccountAuthConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.ApiAuthentication.serviceAccountAuthConfig: object expected"); + message.serviceAccountAuthConfig = $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig.fromObject(object.serviceAccountAuthConfig); + } + if (object.bearerTokenConfig != null) { + if (typeof object.bearerTokenConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.ApiAuthentication.bearerTokenConfig: object expected"); + message.bearerTokenConfig = $root.google.cloud.ces.v1beta.BearerTokenConfig.fromObject(object.bearerTokenConfig); + } + return message; + }; + + /** + * Creates a plain object from an ApiAuthentication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @static + * @param {google.cloud.ces.v1beta.ApiAuthentication} message ApiAuthentication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiAuthentication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) { + object.apiKeyConfig = $root.google.cloud.ces.v1beta.ApiKeyConfig.toObject(message.apiKeyConfig, options); + if (options.oneofs) + object.authConfig = "apiKeyConfig"; + } + if (message.oauthConfig != null && message.hasOwnProperty("oauthConfig")) { + object.oauthConfig = $root.google.cloud.ces.v1beta.OAuthConfig.toObject(message.oauthConfig, options); + if (options.oneofs) + object.authConfig = "oauthConfig"; + } + if (message.serviceAgentIdTokenAuthConfig != null && message.hasOwnProperty("serviceAgentIdTokenAuthConfig")) { + object.serviceAgentIdTokenAuthConfig = $root.google.cloud.ces.v1beta.ServiceAgentIdTokenAuthConfig.toObject(message.serviceAgentIdTokenAuthConfig, options); + if (options.oneofs) + object.authConfig = "serviceAgentIdTokenAuthConfig"; + } + if (message.serviceAccountAuthConfig != null && message.hasOwnProperty("serviceAccountAuthConfig")) { + object.serviceAccountAuthConfig = $root.google.cloud.ces.v1beta.ServiceAccountAuthConfig.toObject(message.serviceAccountAuthConfig, options); + if (options.oneofs) + object.authConfig = "serviceAccountAuthConfig"; + } + if (message.bearerTokenConfig != null && message.hasOwnProperty("bearerTokenConfig")) { + object.bearerTokenConfig = $root.google.cloud.ces.v1beta.BearerTokenConfig.toObject(message.bearerTokenConfig, options); + if (options.oneofs) + object.authConfig = "bearerTokenConfig"; + } + return object; + }; + + /** + * Converts this ApiAuthentication to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @instance + * @returns {Object.} JSON object + */ + ApiAuthentication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiAuthentication + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ApiAuthentication + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiAuthentication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ApiAuthentication"; + }; + + return ApiAuthentication; + })(); + + v1beta.DataStoreTool = (function() { + + /** + * Properties of a DataStoreTool. + * @memberof google.cloud.ces.v1beta + * @interface IDataStoreTool + * @property {google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource|null} [dataStoreSource] DataStoreTool dataStoreSource + * @property {google.cloud.ces.v1beta.DataStoreTool.IEngineSource|null} [engineSource] DataStoreTool engineSource + * @property {string|null} [name] DataStoreTool name + * @property {string|null} [description] DataStoreTool description + * @property {Array.|null} [boostSpecs] DataStoreTool boostSpecs + * @property {Array.|null} [modalityConfigs] DataStoreTool modalityConfigs + * @property {google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior|null} [filterParameterBehavior] DataStoreTool filterParameterBehavior + */ + + /** + * Constructs a new DataStoreTool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DataStoreTool. + * @implements IDataStoreTool + * @constructor + * @param {google.cloud.ces.v1beta.IDataStoreTool=} [properties] Properties to set + */ + function DataStoreTool(properties) { + this.boostSpecs = []; + this.modalityConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStoreTool dataStoreSource. + * @member {google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource|null|undefined} dataStoreSource + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @instance + */ + DataStoreTool.prototype.dataStoreSource = null; + + /** + * DataStoreTool engineSource. + * @member {google.cloud.ces.v1beta.DataStoreTool.IEngineSource|null|undefined} engineSource + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @instance + */ + DataStoreTool.prototype.engineSource = null; + + /** + * DataStoreTool name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @instance + */ + DataStoreTool.prototype.name = ""; + + /** + * DataStoreTool description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @instance + */ + DataStoreTool.prototype.description = ""; + + /** + * DataStoreTool boostSpecs. + * @member {Array.} boostSpecs + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @instance + */ + DataStoreTool.prototype.boostSpecs = $util.emptyArray; + + /** + * DataStoreTool modalityConfigs. + * @member {Array.} modalityConfigs + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @instance + */ + DataStoreTool.prototype.modalityConfigs = $util.emptyArray; + + /** + * DataStoreTool filterParameterBehavior. + * @member {google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior} filterParameterBehavior + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @instance + */ + DataStoreTool.prototype.filterParameterBehavior = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DataStoreTool searchSource. + * @member {"dataStoreSource"|"engineSource"|undefined} searchSource + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @instance + */ + Object.defineProperty(DataStoreTool.prototype, "searchSource", { + get: $util.oneOfGetter($oneOfFields = ["dataStoreSource", "engineSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataStoreTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @static + * @param {google.cloud.ces.v1beta.IDataStoreTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool} DataStoreTool instance + */ + DataStoreTool.create = function create(properties) { + return new DataStoreTool(properties); + }; + + /** + * Encodes the specified DataStoreTool message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @static + * @param {google.cloud.ces.v1beta.IDataStoreTool} message DataStoreTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.dataStoreSource != null && Object.hasOwnProperty.call(message, "dataStoreSource")) + $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.encode(message.dataStoreSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.engineSource != null && Object.hasOwnProperty.call(message, "engineSource")) + $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource.encode(message.engineSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.boostSpecs != null && message.boostSpecs.length) + for (var i = 0; i < message.boostSpecs.length; ++i) + $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.encode(message.boostSpecs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.modalityConfigs != null && message.modalityConfigs.length) + for (var i = 0; i < message.modalityConfigs.length; ++i) + $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.encode(message.modalityConfigs[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.filterParameterBehavior != null && Object.hasOwnProperty.call(message, "filterParameterBehavior")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.filterParameterBehavior); + return writer; + }; + + /** + * Encodes the specified DataStoreTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @static + * @param {google.cloud.ces.v1beta.IDataStoreTool} message DataStoreTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool} DataStoreTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.dataStoreSource = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.engineSource = $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 8: { + if (!(message.boostSpecs && message.boostSpecs.length)) + message.boostSpecs = []; + message.boostSpecs.push($root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.modalityConfigs && message.modalityConfigs.length)) + message.modalityConfigs = []; + message.modalityConfigs.push($root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.decode(reader, reader.uint32())); + break; + } + case 10: { + message.filterParameterBehavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataStoreTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool} DataStoreTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStoreTool message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStoreTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataStoreSource != null && message.hasOwnProperty("dataStoreSource")) { + properties.searchSource = 1; + { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.verify(message.dataStoreSource); + if (error) + return "dataStoreSource." + error; + } + } + if (message.engineSource != null && message.hasOwnProperty("engineSource")) { + if (properties.searchSource === 1) + return "searchSource: multiple values"; + properties.searchSource = 1; + { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource.verify(message.engineSource); + if (error) + return "engineSource." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.boostSpecs != null && message.hasOwnProperty("boostSpecs")) { + if (!Array.isArray(message.boostSpecs)) + return "boostSpecs: array expected"; + for (var i = 0; i < message.boostSpecs.length; ++i) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.verify(message.boostSpecs[i]); + if (error) + return "boostSpecs." + error; + } + } + if (message.modalityConfigs != null && message.hasOwnProperty("modalityConfigs")) { + if (!Array.isArray(message.modalityConfigs)) + return "modalityConfigs: array expected"; + for (var i = 0; i < message.modalityConfigs.length; ++i) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.verify(message.modalityConfigs[i]); + if (error) + return "modalityConfigs." + error; + } + } + if (message.filterParameterBehavior != null && message.hasOwnProperty("filterParameterBehavior")) + switch (message.filterParameterBehavior) { + default: + return "filterParameterBehavior: enum value expected"; + case 0: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a DataStoreTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool} DataStoreTool + */ + DataStoreTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool(); + if (object.dataStoreSource != null) { + if (typeof object.dataStoreSource !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.dataStoreSource: object expected"); + message.dataStoreSource = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.fromObject(object.dataStoreSource); + } + if (object.engineSource != null) { + if (typeof object.engineSource !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.engineSource: object expected"); + message.engineSource = $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource.fromObject(object.engineSource); + } + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.boostSpecs) { + if (!Array.isArray(object.boostSpecs)) + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.boostSpecs: array expected"); + message.boostSpecs = []; + for (var i = 0; i < object.boostSpecs.length; ++i) { + if (typeof object.boostSpecs[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.boostSpecs: object expected"); + message.boostSpecs[i] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.fromObject(object.boostSpecs[i]); + } + } + if (object.modalityConfigs) { + if (!Array.isArray(object.modalityConfigs)) + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.modalityConfigs: array expected"); + message.modalityConfigs = []; + for (var i = 0; i < object.modalityConfigs.length; ++i) { + if (typeof object.modalityConfigs[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.modalityConfigs: object expected"); + message.modalityConfigs[i] = $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.fromObject(object.modalityConfigs[i]); + } + } + switch (object.filterParameterBehavior) { + default: + if (typeof object.filterParameterBehavior === "number") { + message.filterParameterBehavior = object.filterParameterBehavior; + break; + } + break; + case "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED": + case 0: + message.filterParameterBehavior = 0; + break; + case "ALWAYS_INCLUDE": + case 2: + message.filterParameterBehavior = 2; + break; + case "NEVER_INCLUDE": + case 3: + message.filterParameterBehavior = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a DataStoreTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool} message DataStoreTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStoreTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.boostSpecs = []; + object.modalityConfigs = []; + } + if (options.defaults) { + object.name = ""; + object.description = ""; + object.filterParameterBehavior = options.enums === String ? "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.dataStoreSource != null && message.hasOwnProperty("dataStoreSource")) { + object.dataStoreSource = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.toObject(message.dataStoreSource, options); + if (options.oneofs) + object.searchSource = "dataStoreSource"; + } + if (message.engineSource != null && message.hasOwnProperty("engineSource")) { + object.engineSource = $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource.toObject(message.engineSource, options); + if (options.oneofs) + object.searchSource = "engineSource"; + } + if (message.boostSpecs && message.boostSpecs.length) { + object.boostSpecs = []; + for (var j = 0; j < message.boostSpecs.length; ++j) + object.boostSpecs[j] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.toObject(message.boostSpecs[j], options); + } + if (message.modalityConfigs && message.modalityConfigs.length) { + object.modalityConfigs = []; + for (var j = 0; j < message.modalityConfigs.length; ++j) + object.modalityConfigs[j] = $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.toObject(message.modalityConfigs[j], options); + } + if (message.filterParameterBehavior != null && message.hasOwnProperty("filterParameterBehavior")) + object.filterParameterBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior[message.filterParameterBehavior] === undefined ? message.filterParameterBehavior : $root.google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior[message.filterParameterBehavior] : message.filterParameterBehavior; + return object; + }; + + /** + * Converts this DataStoreTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @instance + * @returns {Object.} JSON object + */ + DataStoreTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStoreTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStoreTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool"; + }; + + DataStoreTool.RewriterConfig = (function() { + + /** + * Properties of a RewriterConfig. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @interface IRewriterConfig + * @property {google.cloud.ces.v1beta.IModelSettings|null} [modelSettings] RewriterConfig modelSettings + * @property {string|null} [prompt] RewriterConfig prompt + * @property {boolean|null} [disabled] RewriterConfig disabled + */ + + /** + * Constructs a new RewriterConfig. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @classdesc Represents a RewriterConfig. + * @implements IRewriterConfig + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig=} [properties] Properties to set + */ + function RewriterConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RewriterConfig modelSettings. + * @member {google.cloud.ces.v1beta.IModelSettings|null|undefined} modelSettings + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @instance + */ + RewriterConfig.prototype.modelSettings = null; + + /** + * RewriterConfig prompt. + * @member {string} prompt + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @instance + */ + RewriterConfig.prototype.prompt = ""; + + /** + * RewriterConfig disabled. + * @member {boolean} disabled + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @instance + */ + RewriterConfig.prototype.disabled = false; + + /** + * Creates a new RewriterConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.RewriterConfig} RewriterConfig instance + */ + RewriterConfig.create = function create(properties) { + return new RewriterConfig(properties); + }; + + /** + * Encodes the specified RewriterConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig} message RewriterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RewriterConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) + $root.google.cloud.ces.v1beta.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.prompt); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.disabled); + return writer; + }; + + /** + * Encodes the specified RewriterConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig} message RewriterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RewriterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RewriterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.RewriterConfig} RewriterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RewriterConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.prompt = reader.string(); + break; + } + case 3: { + message.disabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RewriterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.RewriterConfig} RewriterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RewriterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RewriterConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RewriterConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { + var error = $root.google.cloud.ces.v1beta.ModelSettings.verify(message.modelSettings); + if (error) + return "modelSettings." + error; + } + if (message.prompt != null && message.hasOwnProperty("prompt")) + if (!$util.isString(message.prompt)) + return "prompt: string expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + return null; + }; + + /** + * Creates a RewriterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.RewriterConfig} RewriterConfig + */ + RewriterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig(); + if (object.modelSettings != null) { + if (typeof object.modelSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.modelSettings: object expected"); + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.fromObject(object.modelSettings); + } + if (object.prompt != null) + message.prompt = String(object.prompt); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + return message; + }; + + /** + * Creates a plain object from a RewriterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.RewriterConfig} message RewriterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RewriterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modelSettings = null; + object.prompt = ""; + object.disabled = false; + } + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) + object.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.toObject(message.modelSettings, options); + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = message.prompt; + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + return object; + }; + + /** + * Converts this RewriterConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @instance + * @returns {Object.} JSON object + */ + RewriterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RewriterConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.RewriterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RewriterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.RewriterConfig"; + }; + + return RewriterConfig; + })(); + + DataStoreTool.SummarizationConfig = (function() { + + /** + * Properties of a SummarizationConfig. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @interface ISummarizationConfig + * @property {google.cloud.ces.v1beta.IModelSettings|null} [modelSettings] SummarizationConfig modelSettings + * @property {string|null} [prompt] SummarizationConfig prompt + * @property {boolean|null} [disabled] SummarizationConfig disabled + */ + + /** + * Constructs a new SummarizationConfig. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @classdesc Represents a SummarizationConfig. + * @implements ISummarizationConfig + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig=} [properties] Properties to set + */ + function SummarizationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SummarizationConfig modelSettings. + * @member {google.cloud.ces.v1beta.IModelSettings|null|undefined} modelSettings + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @instance + */ + SummarizationConfig.prototype.modelSettings = null; + + /** + * SummarizationConfig prompt. + * @member {string} prompt + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @instance + */ + SummarizationConfig.prototype.prompt = ""; + + /** + * SummarizationConfig disabled. + * @member {boolean} disabled + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @instance + */ + SummarizationConfig.prototype.disabled = false; + + /** + * Creates a new SummarizationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig} SummarizationConfig instance + */ + SummarizationConfig.create = function create(properties) { + return new SummarizationConfig(properties); + }; + + /** + * Encodes the specified SummarizationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig} message SummarizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SummarizationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelSettings != null && Object.hasOwnProperty.call(message, "modelSettings")) + $root.google.cloud.ces.v1beta.ModelSettings.encode(message.modelSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.prompt); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.disabled); + return writer; + }; + + /** + * Encodes the specified SummarizationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig} message SummarizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SummarizationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SummarizationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig} SummarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SummarizationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.prompt = reader.string(); + break; + } + case 3: { + message.disabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SummarizationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig} SummarizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SummarizationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SummarizationConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SummarizationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) { + var error = $root.google.cloud.ces.v1beta.ModelSettings.verify(message.modelSettings); + if (error) + return "modelSettings." + error; + } + if (message.prompt != null && message.hasOwnProperty("prompt")) + if (!$util.isString(message.prompt)) + return "prompt: string expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + return null; + }; + + /** + * Creates a SummarizationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig} SummarizationConfig + */ + SummarizationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig(); + if (object.modelSettings != null) { + if (typeof object.modelSettings !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.modelSettings: object expected"); + message.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.fromObject(object.modelSettings); + } + if (object.prompt != null) + message.prompt = String(object.prompt); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + return message; + }; + + /** + * Creates a plain object from a SummarizationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig} message SummarizationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SummarizationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modelSettings = null; + object.prompt = ""; + object.disabled = false; + } + if (message.modelSettings != null && message.hasOwnProperty("modelSettings")) + object.modelSettings = $root.google.cloud.ces.v1beta.ModelSettings.toObject(message.modelSettings, options); + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = message.prompt; + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + return object; + }; + + /** + * Converts this SummarizationConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @instance + * @returns {Object.} JSON object + */ + SummarizationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SummarizationConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SummarizationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig"; + }; + + return SummarizationConfig; + })(); + + DataStoreTool.GroundingConfig = (function() { + + /** + * Properties of a GroundingConfig. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @interface IGroundingConfig + * @property {number|null} [groundingLevel] GroundingConfig groundingLevel + * @property {boolean|null} [disabled] GroundingConfig disabled + */ + + /** + * Constructs a new GroundingConfig. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @classdesc Represents a GroundingConfig. + * @implements IGroundingConfig + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig=} [properties] Properties to set + */ + function GroundingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroundingConfig groundingLevel. + * @member {number} groundingLevel + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @instance + */ + GroundingConfig.prototype.groundingLevel = 0; + + /** + * GroundingConfig disabled. + * @member {boolean} disabled + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @instance + */ + GroundingConfig.prototype.disabled = false; + + /** + * Creates a new GroundingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.GroundingConfig} GroundingConfig instance + */ + GroundingConfig.create = function create(properties) { + return new GroundingConfig(properties); + }; + + /** + * Encodes the specified GroundingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig} message GroundingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groundingLevel != null && Object.hasOwnProperty.call(message, "groundingLevel")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.groundingLevel); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.disabled); + return writer; + }; + + /** + * Encodes the specified GroundingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig} message GroundingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroundingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.GroundingConfig} GroundingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.groundingLevel = reader.float(); + break; + } + case 2: { + message.disabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroundingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.GroundingConfig} GroundingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroundingConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroundingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groundingLevel != null && message.hasOwnProperty("groundingLevel")) + if (typeof message.groundingLevel !== "number") + return "groundingLevel: number expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + return null; + }; + + /** + * Creates a GroundingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.GroundingConfig} GroundingConfig + */ + GroundingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig(); + if (object.groundingLevel != null) + message.groundingLevel = Number(object.groundingLevel); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + return message; + }; + + /** + * Creates a plain object from a GroundingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.GroundingConfig} message GroundingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroundingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.groundingLevel = 0; + object.disabled = false; + } + if (message.groundingLevel != null && message.hasOwnProperty("groundingLevel")) + object.groundingLevel = options.json && !isFinite(message.groundingLevel) ? String(message.groundingLevel) : message.groundingLevel; + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + return object; + }; + + /** + * Converts this GroundingConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @instance + * @returns {Object.} JSON object + */ + GroundingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroundingConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.GroundingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroundingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.GroundingConfig"; + }; + + return GroundingConfig; + })(); + + DataStoreTool.DataStoreSource = (function() { + + /** + * Properties of a DataStoreSource. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @interface IDataStoreSource + * @property {string|null} [filter] DataStoreSource filter + * @property {google.cloud.ces.v1beta.IDataStore|null} [dataStore] DataStoreSource dataStore + */ + + /** + * Constructs a new DataStoreSource. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @classdesc Represents a DataStoreSource. + * @implements IDataStoreSource + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource=} [properties] Properties to set + */ + function DataStoreSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStoreSource filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @instance + */ + DataStoreSource.prototype.filter = ""; + + /** + * DataStoreSource dataStore. + * @member {google.cloud.ces.v1beta.IDataStore|null|undefined} dataStore + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @instance + */ + DataStoreSource.prototype.dataStore = null; + + /** + * Creates a new DataStoreSource instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.DataStoreSource} DataStoreSource instance + */ + DataStoreSource.create = function create(properties) { + return new DataStoreSource(properties); + }; + + /** + * Encodes the specified DataStoreSource message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource} message DataStoreSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.dataStore != null && Object.hasOwnProperty.call(message, "dataStore")) + $root.google.cloud.ces.v1beta.DataStore.encode(message.dataStore, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataStoreSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IDataStoreSource} message DataStoreSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStoreSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStoreSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.DataStoreSource} DataStoreSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.filter = reader.string(); + break; + } + case 4: { + message.dataStore = $root.google.cloud.ces.v1beta.DataStore.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataStoreSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.DataStoreSource} DataStoreSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStoreSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStoreSource message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStoreSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.dataStore != null && message.hasOwnProperty("dataStore")) { + var error = $root.google.cloud.ces.v1beta.DataStore.verify(message.dataStore); + if (error) + return "dataStore." + error; + } + return null; + }; + + /** + * Creates a DataStoreSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.DataStoreSource} DataStoreSource + */ + DataStoreSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.dataStore != null) { + if (typeof object.dataStore !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.dataStore: object expected"); + message.dataStore = $root.google.cloud.ces.v1beta.DataStore.fromObject(object.dataStore); + } + return message; + }; + + /** + * Creates a plain object from a DataStoreSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.DataStoreSource} message DataStoreSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStoreSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.dataStore = null; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.dataStore != null && message.hasOwnProperty("dataStore")) + object.dataStore = $root.google.cloud.ces.v1beta.DataStore.toObject(message.dataStore, options); + return object; + }; + + /** + * Converts this DataStoreSource to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @instance + * @returns {Object.} JSON object + */ + DataStoreSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStoreSource + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.DataStoreSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStoreSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.DataStoreSource"; + }; + + return DataStoreSource; + })(); + + DataStoreTool.EngineSource = (function() { + + /** + * Properties of an EngineSource. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @interface IEngineSource + * @property {string|null} [engine] EngineSource engine + * @property {Array.|null} [dataStoreSources] EngineSource dataStoreSources + * @property {string|null} [filter] EngineSource filter + */ + + /** + * Constructs a new EngineSource. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @classdesc Represents an EngineSource. + * @implements IEngineSource + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.IEngineSource=} [properties] Properties to set + */ + function EngineSource(properties) { + this.dataStoreSources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EngineSource engine. + * @member {string} engine + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @instance + */ + EngineSource.prototype.engine = ""; + + /** + * EngineSource dataStoreSources. + * @member {Array.} dataStoreSources + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @instance + */ + EngineSource.prototype.dataStoreSources = $util.emptyArray; + + /** + * EngineSource filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @instance + */ + EngineSource.prototype.filter = ""; + + /** + * Creates a new EngineSource instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IEngineSource=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.EngineSource} EngineSource instance + */ + EngineSource.create = function create(properties) { + return new EngineSource(properties); + }; + + /** + * Encodes the specified EngineSource message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.EngineSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IEngineSource} message EngineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EngineSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.engine != null && Object.hasOwnProperty.call(message, "engine")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.engine); + if (message.dataStoreSources != null && message.dataStoreSources.length) + for (var i = 0; i < message.dataStoreSources.length; ++i) + $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.encode(message.dataStoreSources[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + return writer; + }; + + /** + * Encodes the specified EngineSource message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.EngineSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IEngineSource} message EngineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EngineSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EngineSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.EngineSource} EngineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EngineSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.engine = reader.string(); + break; + } + case 2: { + if (!(message.dataStoreSources && message.dataStoreSources.length)) + message.dataStoreSources = []; + message.dataStoreSources.push($root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.decode(reader, reader.uint32())); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EngineSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.EngineSource} EngineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EngineSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EngineSource message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EngineSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.engine != null && message.hasOwnProperty("engine")) + if (!$util.isString(message.engine)) + return "engine: string expected"; + if (message.dataStoreSources != null && message.hasOwnProperty("dataStoreSources")) { + if (!Array.isArray(message.dataStoreSources)) + return "dataStoreSources: array expected"; + for (var i = 0; i < message.dataStoreSources.length; ++i) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.verify(message.dataStoreSources[i]); + if (error) + return "dataStoreSources." + error; + } + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates an EngineSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.EngineSource} EngineSource + */ + EngineSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.EngineSource(); + if (object.engine != null) + message.engine = String(object.engine); + if (object.dataStoreSources) { + if (!Array.isArray(object.dataStoreSources)) + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.EngineSource.dataStoreSources: array expected"); + message.dataStoreSources = []; + for (var i = 0; i < object.dataStoreSources.length; ++i) { + if (typeof object.dataStoreSources[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.EngineSource.dataStoreSources: object expected"); + message.dataStoreSources[i] = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.fromObject(object.dataStoreSources[i]); + } + } + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from an EngineSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.EngineSource} message EngineSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EngineSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataStoreSources = []; + if (options.defaults) { + object.engine = ""; + object.filter = ""; + } + if (message.engine != null && message.hasOwnProperty("engine")) + object.engine = message.engine; + if (message.dataStoreSources && message.dataStoreSources.length) { + object.dataStoreSources = []; + for (var j = 0; j < message.dataStoreSources.length; ++j) + object.dataStoreSources[j] = $root.google.cloud.ces.v1beta.DataStoreTool.DataStoreSource.toObject(message.dataStoreSources[j], options); + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this EngineSource to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @instance + * @returns {Object.} JSON object + */ + EngineSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EngineSource + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.EngineSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EngineSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.EngineSource"; + }; + + return EngineSource; + })(); + + DataStoreTool.BoostSpecs = (function() { + + /** + * Properties of a BoostSpecs. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @interface IBoostSpecs + * @property {Array.|null} [dataStores] BoostSpecs dataStores + * @property {Array.|null} [spec] BoostSpecs spec + */ + + /** + * Constructs a new BoostSpecs. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @classdesc Represents a BoostSpecs. + * @implements IBoostSpecs + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs=} [properties] Properties to set + */ + function BoostSpecs(properties) { + this.dataStores = []; + this.spec = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostSpecs dataStores. + * @member {Array.} dataStores + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @instance + */ + BoostSpecs.prototype.dataStores = $util.emptyArray; + + /** + * BoostSpecs spec. + * @member {Array.} spec + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @instance + */ + BoostSpecs.prototype.spec = $util.emptyArray; + + /** + * Creates a new BoostSpecs instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpecs} BoostSpecs instance + */ + BoostSpecs.create = function create(properties) { + return new BoostSpecs(properties); + }; + + /** + * Encodes the specified BoostSpecs message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs} message BoostSpecs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpecs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataStores != null && message.dataStores.length) + for (var i = 0; i < message.dataStores.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataStores[i]); + if (message.spec != null && message.spec.length) + for (var i = 0; i < message.spec.length; ++i) + $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.encode(message.spec[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoostSpecs message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpecs} message BoostSpecs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpecs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpecs} BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpecs.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataStores && message.dataStores.length)) + message.dataStores = []; + message.dataStores.push(reader.string()); + break; + } + case 2: { + if (!(message.spec && message.spec.length)) + message.spec = []; + message.spec.push($root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpecs} BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpecs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostSpecs message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostSpecs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataStores != null && message.hasOwnProperty("dataStores")) { + if (!Array.isArray(message.dataStores)) + return "dataStores: array expected"; + for (var i = 0; i < message.dataStores.length; ++i) + if (!$util.isString(message.dataStores[i])) + return "dataStores: string[] expected"; + } + if (message.spec != null && message.hasOwnProperty("spec")) { + if (!Array.isArray(message.spec)) + return "spec: array expected"; + for (var i = 0; i < message.spec.length; ++i) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.verify(message.spec[i]); + if (error) + return "spec." + error; + } + } + return null; + }; + + /** + * Creates a BoostSpecs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpecs} BoostSpecs + */ + BoostSpecs.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpecs(); + if (object.dataStores) { + if (!Array.isArray(object.dataStores)) + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.dataStores: array expected"); + message.dataStores = []; + for (var i = 0; i < object.dataStores.length; ++i) + message.dataStores[i] = String(object.dataStores[i]); + } + if (object.spec) { + if (!Array.isArray(object.spec)) + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.spec: array expected"); + message.spec = []; + for (var i = 0; i < object.spec.length; ++i) { + if (typeof object.spec[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpecs.spec: object expected"); + message.spec[i] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.fromObject(object.spec[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoostSpecs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpecs} message BoostSpecs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostSpecs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dataStores = []; + object.spec = []; + } + if (message.dataStores && message.dataStores.length) { + object.dataStores = []; + for (var j = 0; j < message.dataStores.length; ++j) + object.dataStores[j] = message.dataStores[j]; + } + if (message.spec && message.spec.length) { + object.spec = []; + for (var j = 0; j < message.spec.length; ++j) + object.spec[j] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.toObject(message.spec[j], options); + } + return object; + }; + + /** + * Converts this BoostSpecs to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @instance + * @returns {Object.} JSON object + */ + BoostSpecs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostSpecs + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpecs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostSpecs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.BoostSpecs"; + }; + + return BoostSpecs; + })(); + + DataStoreTool.BoostSpec = (function() { + + /** + * Properties of a BoostSpec. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @interface IBoostSpec + * @property {Array.|null} [conditionBoostSpecs] BoostSpec conditionBoostSpecs + */ + + /** + * Constructs a new BoostSpec. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @classdesc Represents a BoostSpec. + * @implements IBoostSpec + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpec=} [properties] Properties to set + */ + function BoostSpec(properties) { + this.conditionBoostSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostSpec conditionBoostSpecs. + * @member {Array.} conditionBoostSpecs + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @instance + */ + BoostSpec.prototype.conditionBoostSpecs = $util.emptyArray; + + /** + * Creates a new BoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpec=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec} BoostSpec instance + */ + BoostSpec.create = function create(properties) { + return new BoostSpec(properties); + }; + + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpec} message BoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditionBoostSpecs != null && message.conditionBoostSpecs.length) + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) + $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.encode(message.conditionBoostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IBoostSpec} message BoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec} BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.conditionBoostSpecs && message.conditionBoostSpecs.length)) + message.conditionBoostSpecs = []; + message.conditionBoostSpecs.push($root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec} BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostSpec message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conditionBoostSpecs != null && message.hasOwnProperty("conditionBoostSpecs")) { + if (!Array.isArray(message.conditionBoostSpecs)) + return "conditionBoostSpecs: array expected"; + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.verify(message.conditionBoostSpecs[i]); + if (error) + return "conditionBoostSpecs." + error; + } + } + return null; + }; + + /** + * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec} BoostSpec + */ + BoostSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec(); + if (object.conditionBoostSpecs) { + if (!Array.isArray(object.conditionBoostSpecs)) + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpec.conditionBoostSpecs: array expected"); + message.conditionBoostSpecs = []; + for (var i = 0; i < object.conditionBoostSpecs.length; ++i) { + if (typeof object.conditionBoostSpecs[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpec.conditionBoostSpecs: object expected"); + message.conditionBoostSpecs[i] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.fromObject(object.conditionBoostSpecs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec} message BoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conditionBoostSpecs = []; + if (message.conditionBoostSpecs && message.conditionBoostSpecs.length) { + object.conditionBoostSpecs = []; + for (var j = 0; j < message.conditionBoostSpecs.length; ++j) + object.conditionBoostSpecs[j] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.toObject(message.conditionBoostSpecs[j], options); + } + return object; + }; + + /** + * Converts this BoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @instance + * @returns {Object.} JSON object + */ + BoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostSpec + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.BoostSpec"; + }; + + BoostSpec.ConditionBoostSpec = (function() { + + /** + * Properties of a ConditionBoostSpec. + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @interface IConditionBoostSpec + * @property {string|null} [condition] ConditionBoostSpec condition + * @property {number|null} [boost] ConditionBoostSpec boost + * @property {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null} [boostControlSpec] ConditionBoostSpec boostControlSpec + */ + + /** + * Constructs a new ConditionBoostSpec. + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec + * @classdesc Represents a ConditionBoostSpec. + * @implements IConditionBoostSpec + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + */ + function ConditionBoostSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConditionBoostSpec condition. + * @member {string} condition + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.condition = ""; + + /** + * ConditionBoostSpec boost. + * @member {number} boost + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.boost = 0; + + /** + * ConditionBoostSpec boostControlSpec. + * @member {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null|undefined} boostControlSpec + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.boostControlSpec = null; + + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec instance + */ + ConditionBoostSpec.create = function create(properties) { + return new ConditionBoostSpec(properties); + }; + + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); + if (message.boostControlSpec != null && Object.hasOwnProperty.call(message, "boostControlSpec")) + $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.encode(message.boostControlSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.condition = reader.string(); + break; + } + case 2: { + message.boost = reader.float(); + break; + } + case 4: { + message.boostControlSpec = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionBoostSpec message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionBoostSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + if (message.boostControlSpec != null && message.hasOwnProperty("boostControlSpec")) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify(message.boostControlSpec); + if (error) + return "boostControlSpec." + error; + } + return null; + }; + + /** + * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + */ + ConditionBoostSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec(); + if (object.condition != null) + message.condition = String(object.condition); + if (object.boost != null) + message.boost = Number(object.boost); + if (object.boostControlSpec != null) { + if (typeof object.boostControlSpec !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.boostControlSpec: object expected"); + message.boostControlSpec = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.fromObject(object.boostControlSpec); + } + return message; + }; + + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec} message ConditionBoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionBoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.condition = ""; + object.boost = 0; + object.boostControlSpec = null; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + if (message.boostControlSpec != null && message.hasOwnProperty("boostControlSpec")) + object.boostControlSpec = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.toObject(message.boostControlSpec, options); + return object; + }; + + /** + * Converts this ConditionBoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @instance + * @returns {Object.} JSON object + */ + ConditionBoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConditionBoostSpec + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConditionBoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec"; + }; + + ConditionBoostSpec.BoostControlSpec = (function() { + + /** + * Properties of a BoostControlSpec. + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @interface IBoostControlSpec + * @property {string|null} [fieldName] BoostControlSpec fieldName + * @property {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|null} [attributeType] BoostControlSpec attributeType + * @property {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|null} [interpolationType] BoostControlSpec interpolationType + * @property {Array.|null} [controlPoints] BoostControlSpec controlPoints + */ + + /** + * Constructs a new BoostControlSpec. + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec + * @classdesc Represents a BoostControlSpec. + * @implements IBoostControlSpec + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec=} [properties] Properties to set + */ + function BoostControlSpec(properties) { + this.controlPoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostControlSpec fieldName. + * @member {string} fieldName + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.fieldName = ""; + + /** + * BoostControlSpec attributeType. + * @member {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType} attributeType + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.attributeType = 0; + + /** + * BoostControlSpec interpolationType. + * @member {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType} interpolationType + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.interpolationType = 0; + + /** + * BoostControlSpec controlPoints. + * @member {Array.} controlPoints + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.controlPoints = $util.emptyArray; + + /** + * Creates a new BoostControlSpec instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec instance + */ + BoostControlSpec.create = function create(properties) { + return new BoostControlSpec(properties); + }; + + /** + * Encodes the specified BoostControlSpec message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec} message BoostControlSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostControlSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldName); + if (message.attributeType != null && Object.hasOwnProperty.call(message, "attributeType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.attributeType); + if (message.interpolationType != null && Object.hasOwnProperty.call(message, "interpolationType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.interpolationType); + if (message.controlPoints != null && message.controlPoints.length) + for (var i = 0; i < message.controlPoints.length; ++i) + $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.encode(message.controlPoints[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoostControlSpec message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.IBoostControlSpec} message BoostControlSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostControlSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostControlSpec.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldName = reader.string(); + break; + } + case 2: { + message.attributeType = reader.int32(); + break; + } + case 3: { + message.interpolationType = reader.int32(); + break; + } + case 4: { + if (!(message.controlPoints && message.controlPoints.length)) + message.controlPoints = []; + message.controlPoints.push($root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostControlSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostControlSpec message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostControlSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + if (message.attributeType != null && message.hasOwnProperty("attributeType")) + switch (message.attributeType) { + default: + return "attributeType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.interpolationType != null && message.hasOwnProperty("interpolationType")) + switch (message.interpolationType) { + default: + return "interpolationType: enum value expected"; + case 0: + case 1: + break; + } + if (message.controlPoints != null && message.hasOwnProperty("controlPoints")) { + if (!Array.isArray(message.controlPoints)) + return "controlPoints: array expected"; + for (var i = 0; i < message.controlPoints.length; ++i) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify(message.controlPoints[i]); + if (error) + return "controlPoints." + error; + } + } + return null; + }; + + /** + * Creates a BoostControlSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + */ + BoostControlSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec(); + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + switch (object.attributeType) { + default: + if (typeof object.attributeType === "number") { + message.attributeType = object.attributeType; + break; + } + break; + case "ATTRIBUTE_TYPE_UNSPECIFIED": + case 0: + message.attributeType = 0; + break; + case "NUMERICAL": + case 1: + message.attributeType = 1; + break; + case "FRESHNESS": + case 2: + message.attributeType = 2; + break; + } + switch (object.interpolationType) { + default: + if (typeof object.interpolationType === "number") { + message.interpolationType = object.interpolationType; + break; + } + break; + case "INTERPOLATION_TYPE_UNSPECIFIED": + case 0: + message.interpolationType = 0; + break; + case "LINEAR": + case 1: + message.interpolationType = 1; + break; + } + if (object.controlPoints) { + if (!Array.isArray(object.controlPoints)) + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.controlPoints: array expected"); + message.controlPoints = []; + for (var i = 0; i < object.controlPoints.length; ++i) { + if (typeof object.controlPoints[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.controlPoints: object expected"); + message.controlPoints[i] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.fromObject(object.controlPoints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoostControlSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec} message BoostControlSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostControlSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.controlPoints = []; + if (options.defaults) { + object.fieldName = ""; + object.attributeType = options.enums === String ? "ATTRIBUTE_TYPE_UNSPECIFIED" : 0; + object.interpolationType = options.enums === String ? "INTERPOLATION_TYPE_UNSPECIFIED" : 0; + } + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + object.fieldName = message.fieldName; + if (message.attributeType != null && message.hasOwnProperty("attributeType")) + object.attributeType = options.enums === String ? $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType[message.attributeType] === undefined ? message.attributeType : $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType[message.attributeType] : message.attributeType; + if (message.interpolationType != null && message.hasOwnProperty("interpolationType")) + object.interpolationType = options.enums === String ? $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType[message.interpolationType] === undefined ? message.interpolationType : $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType[message.interpolationType] : message.interpolationType; + if (message.controlPoints && message.controlPoints.length) { + object.controlPoints = []; + for (var j = 0; j < message.controlPoints.length; ++j) + object.controlPoints[j] = $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.toObject(message.controlPoints[j], options); + } + return object; + }; + + /** + * Converts this BoostControlSpec to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + * @returns {Object.} JSON object + */ + BoostControlSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostControlSpec + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostControlSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec"; + }; + + BoostControlSpec.ControlPoint = (function() { + + /** + * Properties of a ControlPoint. + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @interface IControlPoint + * @property {string|null} [attributeValue] ControlPoint attributeValue + * @property {number|null} [boostAmount] ControlPoint boostAmount + */ + + /** + * Constructs a new ControlPoint. + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @classdesc Represents a ControlPoint. + * @implements IControlPoint + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint=} [properties] Properties to set + */ + function ControlPoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ControlPoint attributeValue. + * @member {string} attributeValue + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @instance + */ + ControlPoint.prototype.attributeValue = ""; + + /** + * ControlPoint boostAmount. + * @member {number} boostAmount + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @instance + */ + ControlPoint.prototype.boostAmount = 0; + + /** + * Creates a new ControlPoint instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint instance + */ + ControlPoint.create = function create(properties) { + return new ControlPoint(properties); + }; + + /** + * Encodes the specified ControlPoint message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint} message ControlPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ControlPoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributeValue != null && Object.hasOwnProperty.call(message, "attributeValue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributeValue); + if (message.boostAmount != null && Object.hasOwnProperty.call(message, "boostAmount")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boostAmount); + return writer; + }; + + /** + * Encodes the specified ControlPoint message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint} message ControlPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ControlPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ControlPoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ControlPoint.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.attributeValue = reader.string(); + break; + } + case 2: { + message.boostAmount = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ControlPoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ControlPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ControlPoint message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ControlPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributeValue != null && message.hasOwnProperty("attributeValue")) + if (!$util.isString(message.attributeValue)) + return "attributeValue: string expected"; + if (message.boostAmount != null && message.hasOwnProperty("boostAmount")) + if (typeof message.boostAmount !== "number") + return "boostAmount: number expected"; + return null; + }; + + /** + * Creates a ControlPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + */ + ControlPoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint(); + if (object.attributeValue != null) + message.attributeValue = String(object.attributeValue); + if (object.boostAmount != null) + message.boostAmount = Number(object.boostAmount); + return message; + }; + + /** + * Creates a plain object from a ControlPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} message ControlPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ControlPoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attributeValue = ""; + object.boostAmount = 0; + } + if (message.attributeValue != null && message.hasOwnProperty("attributeValue")) + object.attributeValue = message.attributeValue; + if (message.boostAmount != null && message.hasOwnProperty("boostAmount")) + object.boostAmount = options.json && !isFinite(message.boostAmount) ? String(message.boostAmount) : message.boostAmount; + return object; + }; + + /** + * Converts this ControlPoint to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @instance + * @returns {Object.} JSON object + */ + ControlPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ControlPoint + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ControlPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint"; + }; + + return ControlPoint; + })(); + + /** + * AttributeType enum. + * @name google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType + * @enum {number} + * @property {number} ATTRIBUTE_TYPE_UNSPECIFIED=0 ATTRIBUTE_TYPE_UNSPECIFIED value + * @property {number} NUMERICAL=1 NUMERICAL value + * @property {number} FRESHNESS=2 FRESHNESS value + */ + BoostControlSpec.AttributeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ATTRIBUTE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NUMERICAL"] = 1; + values[valuesById[2] = "FRESHNESS"] = 2; + return values; + })(); + + /** + * InterpolationType enum. + * @name google.cloud.ces.v1beta.DataStoreTool.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType + * @enum {number} + * @property {number} INTERPOLATION_TYPE_UNSPECIFIED=0 INTERPOLATION_TYPE_UNSPECIFIED value + * @property {number} LINEAR=1 LINEAR value + */ + BoostControlSpec.InterpolationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTERPOLATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINEAR"] = 1; + return values; + })(); + + return BoostControlSpec; + })(); + + return ConditionBoostSpec; + })(); + + return BoostSpec; + })(); + + DataStoreTool.ModalityConfig = (function() { + + /** + * Properties of a ModalityConfig. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @interface IModalityConfig + * @property {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType|null} [modalityType] ModalityConfig modalityType + * @property {google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig|null} [rewriterConfig] ModalityConfig rewriterConfig + * @property {google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig|null} [summarizationConfig] ModalityConfig summarizationConfig + * @property {google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig|null} [groundingConfig] ModalityConfig groundingConfig + */ + + /** + * Constructs a new ModalityConfig. + * @memberof google.cloud.ces.v1beta.DataStoreTool + * @classdesc Represents a ModalityConfig. + * @implements IModalityConfig + * @constructor + * @param {google.cloud.ces.v1beta.DataStoreTool.IModalityConfig=} [properties] Properties to set + */ + function ModalityConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModalityConfig modalityType. + * @member {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType} modalityType + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @instance + */ + ModalityConfig.prototype.modalityType = 0; + + /** + * ModalityConfig rewriterConfig. + * @member {google.cloud.ces.v1beta.DataStoreTool.IRewriterConfig|null|undefined} rewriterConfig + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @instance + */ + ModalityConfig.prototype.rewriterConfig = null; + + /** + * ModalityConfig summarizationConfig. + * @member {google.cloud.ces.v1beta.DataStoreTool.ISummarizationConfig|null|undefined} summarizationConfig + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @instance + */ + ModalityConfig.prototype.summarizationConfig = null; + + /** + * ModalityConfig groundingConfig. + * @member {google.cloud.ces.v1beta.DataStoreTool.IGroundingConfig|null|undefined} groundingConfig + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @instance + */ + ModalityConfig.prototype.groundingConfig = null; + + /** + * Creates a new ModalityConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IModalityConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig} ModalityConfig instance + */ + ModalityConfig.create = function create(properties) { + return new ModalityConfig(properties); + }; + + /** + * Encodes the specified ModalityConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IModalityConfig} message ModalityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModalityConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modalityType != null && Object.hasOwnProperty.call(message, "modalityType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modalityType); + if (message.rewriterConfig != null && Object.hasOwnProperty.call(message, "rewriterConfig")) + $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.encode(message.rewriterConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.summarizationConfig != null && Object.hasOwnProperty.call(message, "summarizationConfig")) + $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.encode(message.summarizationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.groundingConfig != null && Object.hasOwnProperty.call(message, "groundingConfig")) + $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.encode(message.groundingConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModalityConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.IModalityConfig} message ModalityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModalityConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModalityConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig} ModalityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModalityConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.modalityType = reader.int32(); + break; + } + case 2: { + message.rewriterConfig = $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.summarizationConfig = $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.groundingConfig = $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModalityConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig} ModalityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModalityConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModalityConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModalityConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modalityType != null && message.hasOwnProperty("modalityType")) + switch (message.modalityType) { + default: + return "modalityType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.rewriterConfig != null && message.hasOwnProperty("rewriterConfig")) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.verify(message.rewriterConfig); + if (error) + return "rewriterConfig." + error; + } + if (message.summarizationConfig != null && message.hasOwnProperty("summarizationConfig")) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.verify(message.summarizationConfig); + if (error) + return "summarizationConfig." + error; + } + if (message.groundingConfig != null && message.hasOwnProperty("groundingConfig")) { + var error = $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.verify(message.groundingConfig); + if (error) + return "groundingConfig." + error; + } + return null; + }; + + /** + * Creates a ModalityConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig} ModalityConfig + */ + ModalityConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig(); + switch (object.modalityType) { + default: + if (typeof object.modalityType === "number") { + message.modalityType = object.modalityType; + break; + } + break; + case "MODALITY_TYPE_UNSPECIFIED": + case 0: + message.modalityType = 0; + break; + case "TEXT": + case 1: + message.modalityType = 1; + break; + case "AUDIO": + case 2: + message.modalityType = 2; + break; + } + if (object.rewriterConfig != null) { + if (typeof object.rewriterConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.rewriterConfig: object expected"); + message.rewriterConfig = $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.fromObject(object.rewriterConfig); + } + if (object.summarizationConfig != null) { + if (typeof object.summarizationConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.summarizationConfig: object expected"); + message.summarizationConfig = $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.fromObject(object.summarizationConfig); + } + if (object.groundingConfig != null) { + if (typeof object.groundingConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.groundingConfig: object expected"); + message.groundingConfig = $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.fromObject(object.groundingConfig); + } + return message; + }; + + /** + * Creates a plain object from a ModalityConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @static + * @param {google.cloud.ces.v1beta.DataStoreTool.ModalityConfig} message ModalityConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModalityConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modalityType = options.enums === String ? "MODALITY_TYPE_UNSPECIFIED" : 0; + object.rewriterConfig = null; + object.summarizationConfig = null; + object.groundingConfig = null; + } + if (message.modalityType != null && message.hasOwnProperty("modalityType")) + object.modalityType = options.enums === String ? $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType[message.modalityType] === undefined ? message.modalityType : $root.google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType[message.modalityType] : message.modalityType; + if (message.rewriterConfig != null && message.hasOwnProperty("rewriterConfig")) + object.rewriterConfig = $root.google.cloud.ces.v1beta.DataStoreTool.RewriterConfig.toObject(message.rewriterConfig, options); + if (message.summarizationConfig != null && message.hasOwnProperty("summarizationConfig")) + object.summarizationConfig = $root.google.cloud.ces.v1beta.DataStoreTool.SummarizationConfig.toObject(message.summarizationConfig, options); + if (message.groundingConfig != null && message.hasOwnProperty("groundingConfig")) + object.groundingConfig = $root.google.cloud.ces.v1beta.DataStoreTool.GroundingConfig.toObject(message.groundingConfig, options); + return object; + }; + + /** + * Converts this ModalityConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @instance + * @returns {Object.} JSON object + */ + ModalityConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModalityConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStoreTool.ModalityConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModalityConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStoreTool.ModalityConfig"; + }; + + /** + * ModalityType enum. + * @name google.cloud.ces.v1beta.DataStoreTool.ModalityConfig.ModalityType + * @enum {number} + * @property {number} MODALITY_TYPE_UNSPECIFIED=0 MODALITY_TYPE_UNSPECIFIED value + * @property {number} TEXT=1 TEXT value + * @property {number} AUDIO=2 AUDIO value + */ + ModalityConfig.ModalityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODALITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "AUDIO"] = 2; + return values; + })(); + + return ModalityConfig; + })(); + + /** + * FilterParameterBehavior enum. + * @name google.cloud.ces.v1beta.DataStoreTool.FilterParameterBehavior + * @enum {number} + * @property {number} FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED=0 FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED value + * @property {number} ALWAYS_INCLUDE=2 ALWAYS_INCLUDE value + * @property {number} NEVER_INCLUDE=3 NEVER_INCLUDE value + */ + DataStoreTool.FilterParameterBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[2] = "ALWAYS_INCLUDE"] = 2; + values[valuesById[3] = "NEVER_INCLUDE"] = 3; + return values; + })(); + + return DataStoreTool; + })(); + + v1beta.DataStore = (function() { + + /** + * Properties of a DataStore. + * @memberof google.cloud.ces.v1beta + * @interface IDataStore + * @property {string|null} [name] DataStore name + * @property {google.cloud.ces.v1beta.DataStore.DataStoreType|null} [type] DataStore type + * @property {google.cloud.ces.v1beta.DataStore.DocumentProcessingMode|null} [documentProcessingMode] DataStore documentProcessingMode + * @property {string|null} [displayName] DataStore displayName + * @property {google.protobuf.ITimestamp|null} [createTime] DataStore createTime + * @property {google.cloud.ces.v1beta.DataStore.IConnectorConfig|null} [connectorConfig] DataStore connectorConfig + */ + + /** + * Constructs a new DataStore. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DataStore. + * @implements IDataStore + * @constructor + * @param {google.cloud.ces.v1beta.IDataStore=} [properties] Properties to set + */ + function DataStore(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStore name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DataStore + * @instance + */ + DataStore.prototype.name = ""; + + /** + * DataStore type. + * @member {google.cloud.ces.v1beta.DataStore.DataStoreType} type + * @memberof google.cloud.ces.v1beta.DataStore + * @instance + */ + DataStore.prototype.type = 0; + + /** + * DataStore documentProcessingMode. + * @member {google.cloud.ces.v1beta.DataStore.DocumentProcessingMode} documentProcessingMode + * @memberof google.cloud.ces.v1beta.DataStore + * @instance + */ + DataStore.prototype.documentProcessingMode = 0; + + /** + * DataStore displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.DataStore + * @instance + */ + DataStore.prototype.displayName = ""; + + /** + * DataStore createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.DataStore + * @instance + */ + DataStore.prototype.createTime = null; + + /** + * DataStore connectorConfig. + * @member {google.cloud.ces.v1beta.DataStore.IConnectorConfig|null|undefined} connectorConfig + * @memberof google.cloud.ces.v1beta.DataStore + * @instance + */ + DataStore.prototype.connectorConfig = null; + + /** + * Creates a new DataStore instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStore + * @static + * @param {google.cloud.ces.v1beta.IDataStore=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStore} DataStore instance + */ + DataStore.create = function create(properties) { + return new DataStore(properties); + }; + + /** + * Encodes the specified DataStore message. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStore + * @static + * @param {google.cloud.ces.v1beta.IDataStore} message DataStore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStore.encode = function encode(message, writer) { + if (!writer) + 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 0 =*/16).int32(message.type); + if (message.documentProcessingMode != null && Object.hasOwnProperty.call(message, "documentProcessingMode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.documentProcessingMode); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.connectorConfig != null && Object.hasOwnProperty.call(message, "connectorConfig")) + $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig.encode(message.connectorConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataStore message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStore + * @static + * @param {google.cloud.ces.v1beta.IDataStore} message DataStore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStore.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStore message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStore} DataStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStore.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStore(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 4: { + message.documentProcessingMode = reader.int32(); + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.connectorConfig = $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataStore message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStore} DataStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStore.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStore message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStore + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStore.verify = function verify(message) { + if (typeof message !== "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")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.documentProcessingMode != null && message.hasOwnProperty("documentProcessingMode")) + switch (message.documentProcessingMode) { + default: + return "documentProcessingMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: 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.connectorConfig != null && message.hasOwnProperty("connectorConfig")) { + var error = $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig.verify(message.connectorConfig); + if (error) + return "connectorConfig." + error; + } + return null; + }; + + /** + * Creates a DataStore message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStore + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStore} DataStore + */ + DataStore.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStore) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStore(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "DATA_STORE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PUBLIC_WEB": + case 1: + message.type = 1; + break; + case "UNSTRUCTURED": + case 2: + message.type = 2; + break; + case "FAQ": + case 3: + message.type = 3; + break; + case "CONNECTOR": + case 4: + message.type = 4; + break; + } + switch (object.documentProcessingMode) { + default: + if (typeof object.documentProcessingMode === "number") { + message.documentProcessingMode = object.documentProcessingMode; + break; + } + break; + case "DOCUMENT_PROCESSING_MODE_UNSPECIFIED": + case 0: + message.documentProcessingMode = 0; + break; + case "DOCUMENTS": + case 1: + message.documentProcessingMode = 1; + break; + case "CHUNKS": + case 2: + message.documentProcessingMode = 2; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStore.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.connectorConfig != null) { + if (typeof object.connectorConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.DataStore.connectorConfig: object expected"); + message.connectorConfig = $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig.fromObject(object.connectorConfig); + } + return message; + }; + + /** + * Creates a plain object from a DataStore message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStore + * @static + * @param {google.cloud.ces.v1beta.DataStore} message DataStore + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStore.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "DATA_STORE_TYPE_UNSPECIFIED" : 0; + object.documentProcessingMode = options.enums === String ? "DOCUMENT_PROCESSING_MODE_UNSPECIFIED" : 0; + object.displayName = ""; + object.createTime = null; + object.connectorConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.ces.v1beta.DataStore.DataStoreType[message.type] === undefined ? message.type : $root.google.cloud.ces.v1beta.DataStore.DataStoreType[message.type] : message.type; + if (message.documentProcessingMode != null && message.hasOwnProperty("documentProcessingMode")) + object.documentProcessingMode = options.enums === String ? $root.google.cloud.ces.v1beta.DataStore.DocumentProcessingMode[message.documentProcessingMode] === undefined ? message.documentProcessingMode : $root.google.cloud.ces.v1beta.DataStore.DocumentProcessingMode[message.documentProcessingMode] : message.documentProcessingMode; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.connectorConfig != null && message.hasOwnProperty("connectorConfig")) + object.connectorConfig = $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig.toObject(message.connectorConfig, options); + return object; + }; + + /** + * Converts this DataStore to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStore + * @instance + * @returns {Object.} JSON object + */ + DataStore.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStore + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStore + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStore.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStore"; + }; + + DataStore.ConnectorConfig = (function() { + + /** + * Properties of a ConnectorConfig. + * @memberof google.cloud.ces.v1beta.DataStore + * @interface IConnectorConfig + * @property {string|null} [collection] ConnectorConfig collection + * @property {string|null} [collectionDisplayName] ConnectorConfig collectionDisplayName + * @property {string|null} [dataSource] ConnectorConfig dataSource + */ + + /** + * Constructs a new ConnectorConfig. + * @memberof google.cloud.ces.v1beta.DataStore + * @classdesc Represents a ConnectorConfig. + * @implements IConnectorConfig + * @constructor + * @param {google.cloud.ces.v1beta.DataStore.IConnectorConfig=} [properties] Properties to set + */ + function ConnectorConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectorConfig collection. + * @member {string} collection + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @instance + */ + ConnectorConfig.prototype.collection = ""; + + /** + * ConnectorConfig collectionDisplayName. + * @member {string} collectionDisplayName + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @instance + */ + ConnectorConfig.prototype.collectionDisplayName = ""; + + /** + * ConnectorConfig dataSource. + * @member {string} dataSource + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @instance + */ + ConnectorConfig.prototype.dataSource = ""; + + /** + * Creates a new ConnectorConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @static + * @param {google.cloud.ces.v1beta.DataStore.IConnectorConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DataStore.ConnectorConfig} ConnectorConfig instance + */ + ConnectorConfig.create = function create(properties) { + return new ConnectorConfig(properties); + }; + + /** + * Encodes the specified ConnectorConfig message. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.ConnectorConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @static + * @param {google.cloud.ces.v1beta.DataStore.IConnectorConfig} message ConnectorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.collection != null && Object.hasOwnProperty.call(message, "collection")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.collection); + if (message.collectionDisplayName != null && Object.hasOwnProperty.call(message, "collectionDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.collectionDisplayName); + if (message.dataSource != null && Object.hasOwnProperty.call(message, "dataSource")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dataSource); + return writer; + }; + + /** + * Encodes the specified ConnectorConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DataStore.ConnectorConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @static + * @param {google.cloud.ces.v1beta.DataStore.IConnectorConfig} message ConnectorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectorConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DataStore.ConnectorConfig} ConnectorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.collection = reader.string(); + break; + } + case 2: { + message.collectionDisplayName = reader.string(); + break; + } + case 3: { + message.dataSource = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectorConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DataStore.ConnectorConfig} ConnectorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectorConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectorConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.collection != null && message.hasOwnProperty("collection")) + if (!$util.isString(message.collection)) + return "collection: string expected"; + if (message.collectionDisplayName != null && message.hasOwnProperty("collectionDisplayName")) + if (!$util.isString(message.collectionDisplayName)) + return "collectionDisplayName: string expected"; + if (message.dataSource != null && message.hasOwnProperty("dataSource")) + if (!$util.isString(message.dataSource)) + return "dataSource: string expected"; + return null; + }; + + /** + * Creates a ConnectorConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DataStore.ConnectorConfig} ConnectorConfig + */ + ConnectorConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.DataStore.ConnectorConfig(); + if (object.collection != null) + message.collection = String(object.collection); + if (object.collectionDisplayName != null) + message.collectionDisplayName = String(object.collectionDisplayName); + if (object.dataSource != null) + message.dataSource = String(object.dataSource); + return message; + }; + + /** + * Creates a plain object from a ConnectorConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @static + * @param {google.cloud.ces.v1beta.DataStore.ConnectorConfig} message ConnectorConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectorConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.collection = ""; + object.collectionDisplayName = ""; + object.dataSource = ""; + } + if (message.collection != null && message.hasOwnProperty("collection")) + object.collection = message.collection; + if (message.collectionDisplayName != null && message.hasOwnProperty("collectionDisplayName")) + object.collectionDisplayName = message.collectionDisplayName; + if (message.dataSource != null && message.hasOwnProperty("dataSource")) + object.dataSource = message.dataSource; + return object; + }; + + /** + * Converts this ConnectorConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @instance + * @returns {Object.} JSON object + */ + ConnectorConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectorConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DataStore.ConnectorConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectorConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DataStore.ConnectorConfig"; + }; + + return ConnectorConfig; + })(); + + /** + * DataStoreType enum. + * @name google.cloud.ces.v1beta.DataStore.DataStoreType + * @enum {number} + * @property {number} DATA_STORE_TYPE_UNSPECIFIED=0 DATA_STORE_TYPE_UNSPECIFIED value + * @property {number} PUBLIC_WEB=1 PUBLIC_WEB value + * @property {number} UNSTRUCTURED=2 UNSTRUCTURED value + * @property {number} FAQ=3 FAQ value + * @property {number} CONNECTOR=4 CONNECTOR value + */ + DataStore.DataStoreType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_STORE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PUBLIC_WEB"] = 1; + values[valuesById[2] = "UNSTRUCTURED"] = 2; + values[valuesById[3] = "FAQ"] = 3; + values[valuesById[4] = "CONNECTOR"] = 4; + return values; + })(); + + /** + * DocumentProcessingMode enum. + * @name google.cloud.ces.v1beta.DataStore.DocumentProcessingMode + * @enum {number} + * @property {number} DOCUMENT_PROCESSING_MODE_UNSPECIFIED=0 DOCUMENT_PROCESSING_MODE_UNSPECIFIED value + * @property {number} DOCUMENTS=1 DOCUMENTS value + * @property {number} CHUNKS=2 CHUNKS value + */ + DataStore.DocumentProcessingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENT_PROCESSING_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DOCUMENTS"] = 1; + values[valuesById[2] = "CHUNKS"] = 2; + return values; + })(); + + return DataStore; + })(); + + v1beta.FileSearchTool = (function() { + + /** + * Properties of a FileSearchTool. + * @memberof google.cloud.ces.v1beta + * @interface IFileSearchTool + * @property {google.cloud.ces.v1beta.FileSearchTool.CorpusType|null} [corpusType] FileSearchTool corpusType + * @property {string|null} [name] FileSearchTool name + * @property {string|null} [description] FileSearchTool description + * @property {string|null} [fileCorpus] FileSearchTool fileCorpus + */ + + /** + * Constructs a new FileSearchTool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a FileSearchTool. + * @implements IFileSearchTool + * @constructor + * @param {google.cloud.ces.v1beta.IFileSearchTool=} [properties] Properties to set + */ + function FileSearchTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileSearchTool corpusType. + * @member {google.cloud.ces.v1beta.FileSearchTool.CorpusType} corpusType + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @instance + */ + FileSearchTool.prototype.corpusType = 0; + + /** + * FileSearchTool name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @instance + */ + FileSearchTool.prototype.name = ""; + + /** + * FileSearchTool description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @instance + */ + FileSearchTool.prototype.description = ""; + + /** + * FileSearchTool fileCorpus. + * @member {string} fileCorpus + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @instance + */ + FileSearchTool.prototype.fileCorpus = ""; + + /** + * Creates a new FileSearchTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @static + * @param {google.cloud.ces.v1beta.IFileSearchTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.FileSearchTool} FileSearchTool instance + */ + FileSearchTool.create = function create(properties) { + return new FileSearchTool(properties); + }; + + /** + * Encodes the specified FileSearchTool message. Does not implicitly {@link google.cloud.ces.v1beta.FileSearchTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @static + * @param {google.cloud.ces.v1beta.IFileSearchTool} message FileSearchTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileSearchTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.corpusType != null && Object.hasOwnProperty.call(message, "corpusType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.corpusType); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.fileCorpus != null && Object.hasOwnProperty.call(message, "fileCorpus")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.fileCorpus); + return writer; + }; + + /** + * Encodes the specified FileSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.FileSearchTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @static + * @param {google.cloud.ces.v1beta.IFileSearchTool} message FileSearchTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileSearchTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileSearchTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.FileSearchTool} FileSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileSearchTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.FileSearchTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.corpusType = reader.int32(); + break; + } + case 4: { + message.name = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.fileCorpus = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileSearchTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.FileSearchTool} FileSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileSearchTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileSearchTool message. + * @function verify + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileSearchTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.corpusType != null && message.hasOwnProperty("corpusType")) + switch (message.corpusType) { + default: + return "corpusType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.fileCorpus != null && message.hasOwnProperty("fileCorpus")) + if (!$util.isString(message.fileCorpus)) + return "fileCorpus: string expected"; + return null; + }; + + /** + * Creates a FileSearchTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.FileSearchTool} FileSearchTool + */ + FileSearchTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.FileSearchTool) + return object; + var message = new $root.google.cloud.ces.v1beta.FileSearchTool(); + switch (object.corpusType) { + default: + if (typeof object.corpusType === "number") { + message.corpusType = object.corpusType; + break; + } + break; + case "CORPUS_TYPE_UNSPECIFIED": + case 0: + message.corpusType = 0; + break; + case "USER_OWNED": + case 1: + message.corpusType = 1; + break; + case "FULLY_MANAGED": + case 2: + message.corpusType = 2; + break; + } + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.fileCorpus != null) + message.fileCorpus = String(object.fileCorpus); + return message; + }; + + /** + * Creates a plain object from a FileSearchTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @static + * @param {google.cloud.ces.v1beta.FileSearchTool} message FileSearchTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileSearchTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.corpusType = options.enums === String ? "CORPUS_TYPE_UNSPECIFIED" : 0; + object.name = ""; + object.description = ""; + object.fileCorpus = ""; + } + if (message.corpusType != null && message.hasOwnProperty("corpusType")) + object.corpusType = options.enums === String ? $root.google.cloud.ces.v1beta.FileSearchTool.CorpusType[message.corpusType] === undefined ? message.corpusType : $root.google.cloud.ces.v1beta.FileSearchTool.CorpusType[message.corpusType] : message.corpusType; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.fileCorpus != null && message.hasOwnProperty("fileCorpus")) + object.fileCorpus = message.fileCorpus; + return object; + }; + + /** + * Converts this FileSearchTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @instance + * @returns {Object.} JSON object + */ + FileSearchTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileSearchTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.FileSearchTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileSearchTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.FileSearchTool"; + }; + + /** + * CorpusType enum. + * @name google.cloud.ces.v1beta.FileSearchTool.CorpusType + * @enum {number} + * @property {number} CORPUS_TYPE_UNSPECIFIED=0 CORPUS_TYPE_UNSPECIFIED value + * @property {number} USER_OWNED=1 USER_OWNED value + * @property {number} FULLY_MANAGED=2 FULLY_MANAGED value + */ + FileSearchTool.CorpusType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CORPUS_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER_OWNED"] = 1; + values[valuesById[2] = "FULLY_MANAGED"] = 2; + return values; + })(); + + return FileSearchTool; + })(); + + v1beta.GoogleSearchTool = (function() { + + /** + * Properties of a GoogleSearchTool. + * @memberof google.cloud.ces.v1beta + * @interface IGoogleSearchTool + * @property {string|null} [name] GoogleSearchTool name + * @property {string|null} [description] GoogleSearchTool description + * @property {Array.|null} [contextUrls] GoogleSearchTool contextUrls + * @property {Array.|null} [preferredDomains] GoogleSearchTool preferredDomains + * @property {Array.|null} [excludeDomains] GoogleSearchTool excludeDomains + * @property {google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig|null} [promptConfig] GoogleSearchTool promptConfig + */ + + /** + * Constructs a new GoogleSearchTool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GoogleSearchTool. + * @implements IGoogleSearchTool + * @constructor + * @param {google.cloud.ces.v1beta.IGoogleSearchTool=} [properties] Properties to set + */ + function GoogleSearchTool(properties) { + this.contextUrls = []; + this.preferredDomains = []; + this.excludeDomains = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoogleSearchTool name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @instance + */ + GoogleSearchTool.prototype.name = ""; + + /** + * GoogleSearchTool description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @instance + */ + GoogleSearchTool.prototype.description = ""; + + /** + * GoogleSearchTool contextUrls. + * @member {Array.} contextUrls + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @instance + */ + GoogleSearchTool.prototype.contextUrls = $util.emptyArray; + + /** + * GoogleSearchTool preferredDomains. + * @member {Array.} preferredDomains + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @instance + */ + GoogleSearchTool.prototype.preferredDomains = $util.emptyArray; + + /** + * GoogleSearchTool excludeDomains. + * @member {Array.} excludeDomains + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @instance + */ + GoogleSearchTool.prototype.excludeDomains = $util.emptyArray; + + /** + * GoogleSearchTool promptConfig. + * @member {google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig|null|undefined} promptConfig + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @instance + */ + GoogleSearchTool.prototype.promptConfig = null; + + /** + * Creates a new GoogleSearchTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @static + * @param {google.cloud.ces.v1beta.IGoogleSearchTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GoogleSearchTool} GoogleSearchTool instance + */ + GoogleSearchTool.create = function create(properties) { + return new GoogleSearchTool(properties); + }; + + /** + * Encodes the specified GoogleSearchTool message. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @static + * @param {google.cloud.ces.v1beta.IGoogleSearchTool} message GoogleSearchTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearchTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.contextUrls != null && message.contextUrls.length) + for (var i = 0; i < message.contextUrls.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.contextUrls[i]); + if (message.excludeDomains != null && message.excludeDomains.length) + for (var i = 0; i < message.excludeDomains.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.excludeDomains[i]); + if (message.promptConfig != null && Object.hasOwnProperty.call(message, "promptConfig")) + $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.encode(message.promptConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.preferredDomains != null && message.preferredDomains.length) + for (var i = 0; i < message.preferredDomains.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.preferredDomains[i]); + return writer; + }; + + /** + * Encodes the specified GoogleSearchTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @static + * @param {google.cloud.ces.v1beta.IGoogleSearchTool} message GoogleSearchTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearchTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoogleSearchTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GoogleSearchTool} GoogleSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearchTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GoogleSearchTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + if (!(message.contextUrls && message.contextUrls.length)) + message.contextUrls = []; + message.contextUrls.push(reader.string()); + break; + } + case 6: { + if (!(message.preferredDomains && message.preferredDomains.length)) + message.preferredDomains = []; + message.preferredDomains.push(reader.string()); + break; + } + case 4: { + if (!(message.excludeDomains && message.excludeDomains.length)) + message.excludeDomains = []; + message.excludeDomains.push(reader.string()); + break; + } + case 5: { + message.promptConfig = $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoogleSearchTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GoogleSearchTool} GoogleSearchTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearchTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoogleSearchTool message. + * @function verify + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoogleSearchTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.contextUrls != null && message.hasOwnProperty("contextUrls")) { + if (!Array.isArray(message.contextUrls)) + return "contextUrls: array expected"; + for (var i = 0; i < message.contextUrls.length; ++i) + if (!$util.isString(message.contextUrls[i])) + return "contextUrls: string[] expected"; + } + if (message.preferredDomains != null && message.hasOwnProperty("preferredDomains")) { + if (!Array.isArray(message.preferredDomains)) + return "preferredDomains: array expected"; + for (var i = 0; i < message.preferredDomains.length; ++i) + if (!$util.isString(message.preferredDomains[i])) + return "preferredDomains: string[] expected"; + } + if (message.excludeDomains != null && message.hasOwnProperty("excludeDomains")) { + if (!Array.isArray(message.excludeDomains)) + return "excludeDomains: array expected"; + for (var i = 0; i < message.excludeDomains.length; ++i) + if (!$util.isString(message.excludeDomains[i])) + return "excludeDomains: string[] expected"; + } + if (message.promptConfig != null && message.hasOwnProperty("promptConfig")) { + var error = $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.verify(message.promptConfig); + if (error) + return "promptConfig." + error; + } + return null; + }; + + /** + * Creates a GoogleSearchTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GoogleSearchTool} GoogleSearchTool + */ + GoogleSearchTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GoogleSearchTool) + return object; + var message = new $root.google.cloud.ces.v1beta.GoogleSearchTool(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.contextUrls) { + if (!Array.isArray(object.contextUrls)) + throw TypeError(".google.cloud.ces.v1beta.GoogleSearchTool.contextUrls: array expected"); + message.contextUrls = []; + for (var i = 0; i < object.contextUrls.length; ++i) + message.contextUrls[i] = String(object.contextUrls[i]); + } + if (object.preferredDomains) { + if (!Array.isArray(object.preferredDomains)) + throw TypeError(".google.cloud.ces.v1beta.GoogleSearchTool.preferredDomains: array expected"); + message.preferredDomains = []; + for (var i = 0; i < object.preferredDomains.length; ++i) + message.preferredDomains[i] = String(object.preferredDomains[i]); + } + if (object.excludeDomains) { + if (!Array.isArray(object.excludeDomains)) + throw TypeError(".google.cloud.ces.v1beta.GoogleSearchTool.excludeDomains: array expected"); + message.excludeDomains = []; + for (var i = 0; i < object.excludeDomains.length; ++i) + message.excludeDomains[i] = String(object.excludeDomains[i]); + } + if (object.promptConfig != null) { + if (typeof object.promptConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.GoogleSearchTool.promptConfig: object expected"); + message.promptConfig = $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.fromObject(object.promptConfig); + } + return message; + }; + + /** + * Creates a plain object from a GoogleSearchTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @static + * @param {google.cloud.ces.v1beta.GoogleSearchTool} message GoogleSearchTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoogleSearchTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.contextUrls = []; + object.excludeDomains = []; + object.preferredDomains = []; + } + if (options.defaults) { + object.name = ""; + object.description = ""; + object.promptConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.contextUrls && message.contextUrls.length) { + object.contextUrls = []; + for (var j = 0; j < message.contextUrls.length; ++j) + object.contextUrls[j] = message.contextUrls[j]; + } + if (message.excludeDomains && message.excludeDomains.length) { + object.excludeDomains = []; + for (var j = 0; j < message.excludeDomains.length; ++j) + object.excludeDomains[j] = message.excludeDomains[j]; + } + if (message.promptConfig != null && message.hasOwnProperty("promptConfig")) + object.promptConfig = $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.toObject(message.promptConfig, options); + if (message.preferredDomains && message.preferredDomains.length) { + object.preferredDomains = []; + for (var j = 0; j < message.preferredDomains.length; ++j) + object.preferredDomains[j] = message.preferredDomains[j]; + } + return object; + }; + + /** + * Converts this GoogleSearchTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @instance + * @returns {Object.} JSON object + */ + GoogleSearchTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoogleSearchTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoogleSearchTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GoogleSearchTool"; + }; + + GoogleSearchTool.PromptConfig = (function() { + + /** + * Properties of a PromptConfig. + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @interface IPromptConfig + * @property {string|null} [textPrompt] PromptConfig textPrompt + * @property {string|null} [voicePrompt] PromptConfig voicePrompt + */ + + /** + * Constructs a new PromptConfig. + * @memberof google.cloud.ces.v1beta.GoogleSearchTool + * @classdesc Represents a PromptConfig. + * @implements IPromptConfig + * @constructor + * @param {google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig=} [properties] Properties to set + */ + function PromptConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PromptConfig textPrompt. + * @member {string} textPrompt + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @instance + */ + PromptConfig.prototype.textPrompt = ""; + + /** + * PromptConfig voicePrompt. + * @member {string} voicePrompt + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @instance + */ + PromptConfig.prototype.voicePrompt = ""; + + /** + * Creates a new PromptConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @static + * @param {google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig} PromptConfig instance + */ + PromptConfig.create = function create(properties) { + return new PromptConfig(properties); + }; + + /** + * Encodes the specified PromptConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @static + * @param {google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig} message PromptConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromptConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textPrompt != null && Object.hasOwnProperty.call(message, "textPrompt")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.textPrompt); + if (message.voicePrompt != null && Object.hasOwnProperty.call(message, "voicePrompt")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.voicePrompt); + return writer; + }; + + /** + * Encodes the specified PromptConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @static + * @param {google.cloud.ces.v1beta.GoogleSearchTool.IPromptConfig} message PromptConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromptConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PromptConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig} PromptConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromptConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.textPrompt = reader.string(); + break; + } + case 2: { + message.voicePrompt = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PromptConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig} PromptConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromptConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PromptConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PromptConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.textPrompt != null && message.hasOwnProperty("textPrompt")) + if (!$util.isString(message.textPrompt)) + return "textPrompt: string expected"; + if (message.voicePrompt != null && message.hasOwnProperty("voicePrompt")) + if (!$util.isString(message.voicePrompt)) + return "voicePrompt: string expected"; + return null; + }; + + /** + * Creates a PromptConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig} PromptConfig + */ + PromptConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig(); + if (object.textPrompt != null) + message.textPrompt = String(object.textPrompt); + if (object.voicePrompt != null) + message.voicePrompt = String(object.voicePrompt); + return message; + }; + + /** + * Creates a plain object from a PromptConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @static + * @param {google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig} message PromptConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PromptConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.textPrompt = ""; + object.voicePrompt = ""; + } + if (message.textPrompt != null && message.hasOwnProperty("textPrompt")) + object.textPrompt = message.textPrompt; + if (message.voicePrompt != null && message.hasOwnProperty("voicePrompt")) + object.voicePrompt = message.voicePrompt; + return object; + }; + + /** + * Converts this PromptConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @instance + * @returns {Object.} JSON object + */ + PromptConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PromptConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PromptConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GoogleSearchTool.PromptConfig"; + }; + + return PromptConfig; + })(); + + return GoogleSearchTool; + })(); + + v1beta.McpTool = (function() { + + /** + * Properties of a McpTool. + * @memberof google.cloud.ces.v1beta + * @interface IMcpTool + * @property {string|null} [name] McpTool name + * @property {string|null} [description] McpTool description + * @property {google.cloud.ces.v1beta.ISchema|null} [inputSchema] McpTool inputSchema + * @property {google.cloud.ces.v1beta.ISchema|null} [outputSchema] McpTool outputSchema + * @property {string|null} [serverAddress] McpTool serverAddress + * @property {google.cloud.ces.v1beta.IApiAuthentication|null} [apiAuthentication] McpTool apiAuthentication + * @property {google.cloud.ces.v1beta.ITlsConfig|null} [tlsConfig] McpTool tlsConfig + * @property {google.cloud.ces.v1beta.IServiceDirectoryConfig|null} [serviceDirectoryConfig] McpTool serviceDirectoryConfig + */ + + /** + * Constructs a new McpTool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a McpTool. + * @implements IMcpTool + * @constructor + * @param {google.cloud.ces.v1beta.IMcpTool=} [properties] Properties to set + */ + function McpTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * McpTool name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.McpTool + * @instance + */ + McpTool.prototype.name = ""; + + /** + * McpTool description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.McpTool + * @instance + */ + McpTool.prototype.description = ""; + + /** + * McpTool inputSchema. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} inputSchema + * @memberof google.cloud.ces.v1beta.McpTool + * @instance + */ + McpTool.prototype.inputSchema = null; + + /** + * McpTool outputSchema. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} outputSchema + * @memberof google.cloud.ces.v1beta.McpTool + * @instance + */ + McpTool.prototype.outputSchema = null; + + /** + * McpTool serverAddress. + * @member {string} serverAddress + * @memberof google.cloud.ces.v1beta.McpTool + * @instance + */ + McpTool.prototype.serverAddress = ""; + + /** + * McpTool apiAuthentication. + * @member {google.cloud.ces.v1beta.IApiAuthentication|null|undefined} apiAuthentication + * @memberof google.cloud.ces.v1beta.McpTool + * @instance + */ + McpTool.prototype.apiAuthentication = null; + + /** + * McpTool tlsConfig. + * @member {google.cloud.ces.v1beta.ITlsConfig|null|undefined} tlsConfig + * @memberof google.cloud.ces.v1beta.McpTool + * @instance + */ + McpTool.prototype.tlsConfig = null; + + /** + * McpTool serviceDirectoryConfig. + * @member {google.cloud.ces.v1beta.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig + * @memberof google.cloud.ces.v1beta.McpTool + * @instance + */ + McpTool.prototype.serviceDirectoryConfig = null; + + /** + * Creates a new McpTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.McpTool + * @static + * @param {google.cloud.ces.v1beta.IMcpTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.McpTool} McpTool instance + */ + McpTool.create = function create(properties) { + return new McpTool(properties); + }; + + /** + * Encodes the specified McpTool message. Does not implicitly {@link google.cloud.ces.v1beta.McpTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.McpTool + * @static + * @param {google.cloud.ces.v1beta.IMcpTool} message McpTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + McpTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.inputSchema != null && Object.hasOwnProperty.call(message, "inputSchema")) + $root.google.cloud.ces.v1beta.Schema.encode(message.inputSchema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputSchema != null && Object.hasOwnProperty.call(message, "outputSchema")) + $root.google.cloud.ces.v1beta.Schema.encode(message.outputSchema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.serverAddress != null && Object.hasOwnProperty.call(message, "serverAddress")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.serverAddress); + if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) + $root.google.cloud.ces.v1beta.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) + $root.google.cloud.ces.v1beta.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) + $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified McpTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.McpTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.McpTool + * @static + * @param {google.cloud.ces.v1beta.IMcpTool} message McpTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + McpTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a McpTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.McpTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.McpTool} McpTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + McpTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.McpTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.inputSchema = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputSchema = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + case 5: { + message.serverAddress = reader.string(); + break; + } + case 6: { + message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.decode(reader, reader.uint32()); + break; + } + case 7: { + message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a McpTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.McpTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.McpTool} McpTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + McpTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a McpTool message. + * @function verify + * @memberof google.cloud.ces.v1beta.McpTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + McpTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.inputSchema); + if (error) + return "inputSchema." + error; + } + if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.outputSchema); + if (error) + return "outputSchema." + error; + } + if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) + if (!$util.isString(message.serverAddress)) + return "serverAddress: string expected"; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { + var error = $root.google.cloud.ces.v1beta.ApiAuthentication.verify(message.apiAuthentication); + if (error) + return "apiAuthentication." + error; + } + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { + var error = $root.google.cloud.ces.v1beta.TlsConfig.verify(message.tlsConfig); + if (error) + return "tlsConfig." + error; + } + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { + var error = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); + if (error) + return "serviceDirectoryConfig." + error; + } + return null; + }; + + /** + * Creates a McpTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.McpTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.McpTool} McpTool + */ + McpTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.McpTool) + return object; + var message = new $root.google.cloud.ces.v1beta.McpTool(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.inputSchema != null) { + if (typeof object.inputSchema !== "object") + throw TypeError(".google.cloud.ces.v1beta.McpTool.inputSchema: object expected"); + message.inputSchema = $root.google.cloud.ces.v1beta.Schema.fromObject(object.inputSchema); + } + if (object.outputSchema != null) { + if (typeof object.outputSchema !== "object") + throw TypeError(".google.cloud.ces.v1beta.McpTool.outputSchema: object expected"); + message.outputSchema = $root.google.cloud.ces.v1beta.Schema.fromObject(object.outputSchema); + } + if (object.serverAddress != null) + message.serverAddress = String(object.serverAddress); + if (object.apiAuthentication != null) { + if (typeof object.apiAuthentication !== "object") + throw TypeError(".google.cloud.ces.v1beta.McpTool.apiAuthentication: object expected"); + message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.fromObject(object.apiAuthentication); + } + if (object.tlsConfig != null) { + if (typeof object.tlsConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.McpTool.tlsConfig: object expected"); + message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.fromObject(object.tlsConfig); + } + if (object.serviceDirectoryConfig != null) { + if (typeof object.serviceDirectoryConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.McpTool.serviceDirectoryConfig: object expected"); + message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); + } + return message; + }; + + /** + * Creates a plain object from a McpTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.McpTool + * @static + * @param {google.cloud.ces.v1beta.McpTool} message McpTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + McpTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.inputSchema = null; + object.outputSchema = null; + object.serverAddress = ""; + object.apiAuthentication = null; + object.tlsConfig = null; + object.serviceDirectoryConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) + object.inputSchema = $root.google.cloud.ces.v1beta.Schema.toObject(message.inputSchema, options); + if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) + object.outputSchema = $root.google.cloud.ces.v1beta.Schema.toObject(message.outputSchema, options); + if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) + object.serverAddress = message.serverAddress; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) + object.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.toObject(message.apiAuthentication, options); + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) + object.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.toObject(message.tlsConfig, options); + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) + object.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); + return object; + }; + + /** + * Converts this McpTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.McpTool + * @instance + * @returns {Object.} JSON object + */ + McpTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for McpTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.McpTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + McpTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.McpTool"; + }; + + return McpTool; + })(); + + v1beta.OpenApiTool = (function() { + + /** + * Properties of an OpenApiTool. + * @memberof google.cloud.ces.v1beta + * @interface IOpenApiTool + * @property {string|null} [openApiSchema] OpenApiTool openApiSchema + * @property {string|null} [name] OpenApiTool name + * @property {string|null} [description] OpenApiTool description + * @property {google.cloud.ces.v1beta.IApiAuthentication|null} [apiAuthentication] OpenApiTool apiAuthentication + * @property {google.cloud.ces.v1beta.ITlsConfig|null} [tlsConfig] OpenApiTool tlsConfig + * @property {google.cloud.ces.v1beta.IServiceDirectoryConfig|null} [serviceDirectoryConfig] OpenApiTool serviceDirectoryConfig + * @property {boolean|null} [ignoreUnknownFields] OpenApiTool ignoreUnknownFields + * @property {string|null} [url] OpenApiTool url + */ + + /** + * Constructs a new OpenApiTool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an OpenApiTool. + * @implements IOpenApiTool + * @constructor + * @param {google.cloud.ces.v1beta.IOpenApiTool=} [properties] Properties to set + */ + function OpenApiTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpenApiTool openApiSchema. + * @member {string} openApiSchema + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @instance + */ + OpenApiTool.prototype.openApiSchema = ""; + + /** + * OpenApiTool name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @instance + */ + OpenApiTool.prototype.name = ""; + + /** + * OpenApiTool description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @instance + */ + OpenApiTool.prototype.description = ""; + + /** + * OpenApiTool apiAuthentication. + * @member {google.cloud.ces.v1beta.IApiAuthentication|null|undefined} apiAuthentication + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @instance + */ + OpenApiTool.prototype.apiAuthentication = null; + + /** + * OpenApiTool tlsConfig. + * @member {google.cloud.ces.v1beta.ITlsConfig|null|undefined} tlsConfig + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @instance + */ + OpenApiTool.prototype.tlsConfig = null; + + /** + * OpenApiTool serviceDirectoryConfig. + * @member {google.cloud.ces.v1beta.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @instance + */ + OpenApiTool.prototype.serviceDirectoryConfig = null; + + /** + * OpenApiTool ignoreUnknownFields. + * @member {boolean} ignoreUnknownFields + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @instance + */ + OpenApiTool.prototype.ignoreUnknownFields = false; + + /** + * OpenApiTool url. + * @member {string} url + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @instance + */ + OpenApiTool.prototype.url = ""; + + /** + * Creates a new OpenApiTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @static + * @param {google.cloud.ces.v1beta.IOpenApiTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OpenApiTool} OpenApiTool instance + */ + OpenApiTool.create = function create(properties) { + return new OpenApiTool(properties); + }; + + /** + * Encodes the specified OpenApiTool message. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @static + * @param {google.cloud.ces.v1beta.IOpenApiTool} message OpenApiTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.openApiSchema != null && Object.hasOwnProperty.call(message, "openApiSchema")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.openApiSchema); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) + $root.google.cloud.ces.v1beta.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) + $root.google.cloud.ces.v1beta.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) + $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.ignoreUnknownFields != null && Object.hasOwnProperty.call(message, "ignoreUnknownFields")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.ignoreUnknownFields); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.url); + return writer; + }; + + /** + * Encodes the specified OpenApiTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @static + * @param {google.cloud.ces.v1beta.IOpenApiTool} message OpenApiTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OpenApiTool} OpenApiTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OpenApiTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.openApiSchema = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.decode(reader, reader.uint32()); + break; + } + case 5: { + message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.ignoreUnknownFields = reader.bool(); + break; + } + case 8: { + message.url = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OpenApiTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OpenApiTool} OpenApiTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpenApiTool message. + * @function verify + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenApiTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) + if (!$util.isString(message.openApiSchema)) + return "openApiSchema: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { + var error = $root.google.cloud.ces.v1beta.ApiAuthentication.verify(message.apiAuthentication); + if (error) + return "apiAuthentication." + error; + } + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { + var error = $root.google.cloud.ces.v1beta.TlsConfig.verify(message.tlsConfig); + if (error) + return "tlsConfig." + error; + } + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { + var error = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); + if (error) + return "serviceDirectoryConfig." + error; + } + if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) + if (typeof message.ignoreUnknownFields !== "boolean") + return "ignoreUnknownFields: boolean expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + return null; + }; + + /** + * Creates an OpenApiTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OpenApiTool} OpenApiTool + */ + OpenApiTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OpenApiTool) + return object; + var message = new $root.google.cloud.ces.v1beta.OpenApiTool(); + if (object.openApiSchema != null) + message.openApiSchema = String(object.openApiSchema); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.apiAuthentication != null) { + if (typeof object.apiAuthentication !== "object") + throw TypeError(".google.cloud.ces.v1beta.OpenApiTool.apiAuthentication: object expected"); + message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.fromObject(object.apiAuthentication); + } + if (object.tlsConfig != null) { + if (typeof object.tlsConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.OpenApiTool.tlsConfig: object expected"); + message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.fromObject(object.tlsConfig); + } + if (object.serviceDirectoryConfig != null) { + if (typeof object.serviceDirectoryConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.OpenApiTool.serviceDirectoryConfig: object expected"); + message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); + } + if (object.ignoreUnknownFields != null) + message.ignoreUnknownFields = Boolean(object.ignoreUnknownFields); + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from an OpenApiTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @static + * @param {google.cloud.ces.v1beta.OpenApiTool} message OpenApiTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenApiTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.openApiSchema = ""; + object.name = ""; + object.description = ""; + object.apiAuthentication = null; + object.tlsConfig = null; + object.serviceDirectoryConfig = null; + object.ignoreUnknownFields = false; + object.url = ""; + } + if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) + object.openApiSchema = message.openApiSchema; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) + object.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.toObject(message.apiAuthentication, options); + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) + object.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.toObject(message.tlsConfig, options); + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) + object.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); + if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) + object.ignoreUnknownFields = message.ignoreUnknownFields; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + return object; + }; + + /** + * Converts this OpenApiTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @instance + * @returns {Object.} JSON object + */ + OpenApiTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OpenApiTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OpenApiTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpenApiTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OpenApiTool"; + }; + + return OpenApiTool; + })(); + + v1beta.PythonFunction = (function() { + + /** + * Properties of a PythonFunction. + * @memberof google.cloud.ces.v1beta + * @interface IPythonFunction + * @property {string|null} [name] PythonFunction name + * @property {string|null} [pythonCode] PythonFunction pythonCode + * @property {string|null} [description] PythonFunction description + */ + + /** + * Constructs a new PythonFunction. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a PythonFunction. + * @implements IPythonFunction + * @constructor + * @param {google.cloud.ces.v1beta.IPythonFunction=} [properties] Properties to set + */ + function PythonFunction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonFunction name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.PythonFunction + * @instance + */ + PythonFunction.prototype.name = ""; + + /** + * PythonFunction pythonCode. + * @member {string} pythonCode + * @memberof google.cloud.ces.v1beta.PythonFunction + * @instance + */ + PythonFunction.prototype.pythonCode = ""; + + /** + * PythonFunction description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.PythonFunction + * @instance + */ + PythonFunction.prototype.description = ""; + + /** + * Creates a new PythonFunction instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.PythonFunction + * @static + * @param {google.cloud.ces.v1beta.IPythonFunction=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.PythonFunction} PythonFunction instance + */ + PythonFunction.create = function create(properties) { + return new PythonFunction(properties); + }; + + /** + * Encodes the specified PythonFunction message. Does not implicitly {@link google.cloud.ces.v1beta.PythonFunction.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.PythonFunction + * @static + * @param {google.cloud.ces.v1beta.IPythonFunction} message PythonFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonFunction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.pythonCode != null && Object.hasOwnProperty.call(message, "pythonCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pythonCode); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + return writer; + }; + + /** + * Encodes the specified PythonFunction message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.PythonFunction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.PythonFunction + * @static + * @param {google.cloud.ces.v1beta.IPythonFunction} message PythonFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonFunction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonFunction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.PythonFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.PythonFunction} PythonFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonFunction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.PythonFunction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.pythonCode = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonFunction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.PythonFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.PythonFunction} PythonFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonFunction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonFunction message. + * @function verify + * @memberof google.cloud.ces.v1beta.PythonFunction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonFunction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) + if (!$util.isString(message.pythonCode)) + return "pythonCode: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a PythonFunction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.PythonFunction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.PythonFunction} PythonFunction + */ + PythonFunction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.PythonFunction) + return object; + var message = new $root.google.cloud.ces.v1beta.PythonFunction(); + if (object.name != null) + message.name = String(object.name); + if (object.pythonCode != null) + message.pythonCode = String(object.pythonCode); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a PythonFunction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.PythonFunction + * @static + * @param {google.cloud.ces.v1beta.PythonFunction} message PythonFunction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonFunction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pythonCode = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.pythonCode != null && message.hasOwnProperty("pythonCode")) + object.pythonCode = message.pythonCode; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this PythonFunction to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.PythonFunction + * @instance + * @returns {Object.} JSON object + */ + PythonFunction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonFunction + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.PythonFunction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonFunction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.PythonFunction"; + }; + + return PythonFunction; + })(); + + v1beta.SystemTool = (function() { + + /** + * Properties of a SystemTool. + * @memberof google.cloud.ces.v1beta + * @interface ISystemTool + * @property {string|null} [name] SystemTool name + * @property {string|null} [description] SystemTool description + */ + + /** + * Constructs a new SystemTool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a SystemTool. + * @implements ISystemTool + * @constructor + * @param {google.cloud.ces.v1beta.ISystemTool=} [properties] Properties to set + */ + function SystemTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SystemTool name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.SystemTool + * @instance + */ + SystemTool.prototype.name = ""; + + /** + * SystemTool description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.SystemTool + * @instance + */ + SystemTool.prototype.description = ""; + + /** + * Creates a new SystemTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.SystemTool + * @static + * @param {google.cloud.ces.v1beta.ISystemTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.SystemTool} SystemTool instance + */ + SystemTool.create = function create(properties) { + return new SystemTool(properties); + }; + + /** + * Encodes the specified SystemTool message. Does not implicitly {@link google.cloud.ces.v1beta.SystemTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.SystemTool + * @static + * @param {google.cloud.ces.v1beta.ISystemTool} message SystemTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; + + /** + * Encodes the specified SystemTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SystemTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.SystemTool + * @static + * @param {google.cloud.ces.v1beta.ISystemTool} message SystemTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SystemTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.SystemTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.SystemTool} SystemTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SystemTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SystemTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.SystemTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.SystemTool} SystemTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SystemTool message. + * @function verify + * @memberof google.cloud.ces.v1beta.SystemTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SystemTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a SystemTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.SystemTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.SystemTool} SystemTool + */ + SystemTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.SystemTool) + return object; + var message = new $root.google.cloud.ces.v1beta.SystemTool(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a SystemTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.SystemTool + * @static + * @param {google.cloud.ces.v1beta.SystemTool} message SystemTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SystemTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this SystemTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.SystemTool + * @instance + * @returns {Object.} JSON object + */ + SystemTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SystemTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.SystemTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SystemTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.SystemTool"; + }; + + return SystemTool; + })(); + + v1beta.WidgetTool = (function() { + + /** + * Properties of a WidgetTool. + * @memberof google.cloud.ces.v1beta + * @interface IWidgetTool + * @property {google.cloud.ces.v1beta.ISchema|null} [parameters] WidgetTool parameters + * @property {string|null} [name] WidgetTool name + * @property {string|null} [description] WidgetTool description + * @property {google.cloud.ces.v1beta.WidgetTool.WidgetType|null} [widgetType] WidgetTool widgetType + */ + + /** + * Constructs a new WidgetTool. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a WidgetTool. + * @implements IWidgetTool + * @constructor + * @param {google.cloud.ces.v1beta.IWidgetTool=} [properties] Properties to set + */ + function WidgetTool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WidgetTool parameters. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} parameters + * @memberof google.cloud.ces.v1beta.WidgetTool + * @instance + */ + WidgetTool.prototype.parameters = null; + + /** + * WidgetTool name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.WidgetTool + * @instance + */ + WidgetTool.prototype.name = ""; + + /** + * WidgetTool description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.WidgetTool + * @instance + */ + WidgetTool.prototype.description = ""; + + /** + * WidgetTool widgetType. + * @member {google.cloud.ces.v1beta.WidgetTool.WidgetType} widgetType + * @memberof google.cloud.ces.v1beta.WidgetTool + * @instance + */ + WidgetTool.prototype.widgetType = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WidgetTool input. + * @member {"parameters"|undefined} input + * @memberof google.cloud.ces.v1beta.WidgetTool + * @instance + */ + Object.defineProperty(WidgetTool.prototype, "input", { + get: $util.oneOfGetter($oneOfFields = ["parameters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WidgetTool instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.WidgetTool + * @static + * @param {google.cloud.ces.v1beta.IWidgetTool=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.WidgetTool} WidgetTool instance + */ + WidgetTool.create = function create(properties) { + return new WidgetTool(properties); + }; + + /** + * Encodes the specified WidgetTool message. Does not implicitly {@link google.cloud.ces.v1beta.WidgetTool.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.WidgetTool + * @static + * @param {google.cloud.ces.v1beta.IWidgetTool} message WidgetTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WidgetTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.widgetType != null && Object.hasOwnProperty.call(message, "widgetType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.widgetType); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.ces.v1beta.Schema.encode(message.parameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WidgetTool message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.WidgetTool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.WidgetTool + * @static + * @param {google.cloud.ces.v1beta.IWidgetTool} message WidgetTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WidgetTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WidgetTool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.WidgetTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.WidgetTool} WidgetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WidgetTool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.WidgetTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.parameters = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.widgetType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WidgetTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.WidgetTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.WidgetTool} WidgetTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WidgetTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WidgetTool message. + * @function verify + * @memberof google.cloud.ces.v1beta.WidgetTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WidgetTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + properties.input = 1; + { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.parameters); + if (error) + return "parameters." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.widgetType != null && message.hasOwnProperty("widgetType")) + switch (message.widgetType) { + default: + return "widgetType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + break; + } + return null; + }; + + /** + * Creates a WidgetTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.WidgetTool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.WidgetTool} WidgetTool + */ + WidgetTool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.WidgetTool) + return object; + var message = new $root.google.cloud.ces.v1beta.WidgetTool(); + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.ces.v1beta.WidgetTool.parameters: object expected"); + message.parameters = $root.google.cloud.ces.v1beta.Schema.fromObject(object.parameters); + } + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + switch (object.widgetType) { + default: + if (typeof object.widgetType === "number") { + message.widgetType = object.widgetType; + break; + } + break; + case "WIDGET_TYPE_UNSPECIFIED": + case 0: + message.widgetType = 0; + break; + case "CUSTOM": + case 1: + message.widgetType = 1; + break; + case "PRODUCT_CAROUSEL": + case 2: + message.widgetType = 2; + break; + case "PRODUCT_DETAILS": + case 3: + message.widgetType = 3; + break; + case "QUICK_ACTIONS": + case 4: + message.widgetType = 4; + break; + case "PRODUCT_COMPARISON": + case 5: + message.widgetType = 5; + break; + case "ADVANCED_PRODUCT_DETAILS": + case 6: + message.widgetType = 6; + break; + case "SHORT_FORM": + case 7: + message.widgetType = 7; + break; + case "OVERALL_SATISFACTION": + case 8: + message.widgetType = 8; + break; + case "ORDER_SUMMARY": + case 9: + message.widgetType = 9; + break; + case "APPOINTMENT_DETAILS": + case 10: + message.widgetType = 10; + break; + case "APPOINTMENT_SCHEDULER": + case 11: + message.widgetType = 11; + break; + case "CONTACT_FORM": + case 12: + message.widgetType = 12; + break; + } + return message; + }; + + /** + * Creates a plain object from a WidgetTool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.WidgetTool + * @static + * @param {google.cloud.ces.v1beta.WidgetTool} message WidgetTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WidgetTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.widgetType = options.enums === String ? "WIDGET_TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.widgetType != null && message.hasOwnProperty("widgetType")) + object.widgetType = options.enums === String ? $root.google.cloud.ces.v1beta.WidgetTool.WidgetType[message.widgetType] === undefined ? message.widgetType : $root.google.cloud.ces.v1beta.WidgetTool.WidgetType[message.widgetType] : message.widgetType; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + object.parameters = $root.google.cloud.ces.v1beta.Schema.toObject(message.parameters, options); + if (options.oneofs) + object.input = "parameters"; + } + return object; + }; + + /** + * Converts this WidgetTool to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.WidgetTool + * @instance + * @returns {Object.} JSON object + */ + WidgetTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WidgetTool + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.WidgetTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WidgetTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.WidgetTool"; + }; + + /** + * WidgetType enum. + * @name google.cloud.ces.v1beta.WidgetTool.WidgetType + * @enum {number} + * @property {number} WIDGET_TYPE_UNSPECIFIED=0 WIDGET_TYPE_UNSPECIFIED value + * @property {number} CUSTOM=1 CUSTOM value + * @property {number} PRODUCT_CAROUSEL=2 PRODUCT_CAROUSEL value + * @property {number} PRODUCT_DETAILS=3 PRODUCT_DETAILS value + * @property {number} QUICK_ACTIONS=4 QUICK_ACTIONS value + * @property {number} PRODUCT_COMPARISON=5 PRODUCT_COMPARISON value + * @property {number} ADVANCED_PRODUCT_DETAILS=6 ADVANCED_PRODUCT_DETAILS value + * @property {number} SHORT_FORM=7 SHORT_FORM value + * @property {number} OVERALL_SATISFACTION=8 OVERALL_SATISFACTION value + * @property {number} ORDER_SUMMARY=9 ORDER_SUMMARY value + * @property {number} APPOINTMENT_DETAILS=10 APPOINTMENT_DETAILS value + * @property {number} APPOINTMENT_SCHEDULER=11 APPOINTMENT_SCHEDULER value + * @property {number} CONTACT_FORM=12 CONTACT_FORM value + */ + WidgetTool.WidgetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WIDGET_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CUSTOM"] = 1; + values[valuesById[2] = "PRODUCT_CAROUSEL"] = 2; + values[valuesById[3] = "PRODUCT_DETAILS"] = 3; + values[valuesById[4] = "QUICK_ACTIONS"] = 4; + values[valuesById[5] = "PRODUCT_COMPARISON"] = 5; + values[valuesById[6] = "ADVANCED_PRODUCT_DETAILS"] = 6; + values[valuesById[7] = "SHORT_FORM"] = 7; + values[valuesById[8] = "OVERALL_SATISFACTION"] = 8; + values[valuesById[9] = "ORDER_SUMMARY"] = 9; + values[valuesById[10] = "APPOINTMENT_DETAILS"] = 10; + values[valuesById[11] = "APPOINTMENT_SCHEDULER"] = 11; + values[valuesById[12] = "CONTACT_FORM"] = 12; + return values; + })(); + + return WidgetTool; + })(); + + v1beta.Toolset = (function() { + + /** + * Properties of a Toolset. + * @memberof google.cloud.ces.v1beta + * @interface IToolset + * @property {google.cloud.ces.v1beta.IMcpToolset|null} [mcpToolset] Toolset mcpToolset + * @property {google.cloud.ces.v1beta.IOpenApiToolset|null} [openApiToolset] Toolset openApiToolset + * @property {google.cloud.ces.v1beta.IConnectorToolset|null} [connectorToolset] Toolset connectorToolset + * @property {string|null} [name] Toolset name + * @property {string|null} [displayName] Toolset displayName + * @property {string|null} [description] Toolset description + * @property {google.protobuf.ITimestamp|null} [createTime] Toolset createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Toolset updateTime + * @property {string|null} [etag] Toolset etag + * @property {google.cloud.ces.v1beta.ExecutionType|null} [executionType] Toolset executionType + * @property {google.cloud.ces.v1beta.IToolFakeConfig|null} [toolFakeConfig] Toolset toolFakeConfig + */ + + /** + * Constructs a new Toolset. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Toolset. + * @implements IToolset + * @constructor + * @param {google.cloud.ces.v1beta.IToolset=} [properties] Properties to set + */ + function Toolset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Toolset mcpToolset. + * @member {google.cloud.ces.v1beta.IMcpToolset|null|undefined} mcpToolset + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.mcpToolset = null; + + /** + * Toolset openApiToolset. + * @member {google.cloud.ces.v1beta.IOpenApiToolset|null|undefined} openApiToolset + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.openApiToolset = null; + + /** + * Toolset connectorToolset. + * @member {google.cloud.ces.v1beta.IConnectorToolset|null|undefined} connectorToolset + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.connectorToolset = null; + + /** + * Toolset name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.name = ""; + + /** + * Toolset displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.displayName = ""; + + /** + * Toolset description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.description = ""; + + /** + * Toolset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.createTime = null; + + /** + * Toolset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.updateTime = null; + + /** + * Toolset etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.etag = ""; + + /** + * Toolset executionType. + * @member {google.cloud.ces.v1beta.ExecutionType} executionType + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.executionType = 0; + + /** + * Toolset toolFakeConfig. + * @member {google.cloud.ces.v1beta.IToolFakeConfig|null|undefined} toolFakeConfig + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Toolset.prototype.toolFakeConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Toolset toolsetType. + * @member {"mcpToolset"|"openApiToolset"|"connectorToolset"|undefined} toolsetType + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + */ + Object.defineProperty(Toolset.prototype, "toolsetType", { + get: $util.oneOfGetter($oneOfFields = ["mcpToolset", "openApiToolset", "connectorToolset"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Toolset instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Toolset + * @static + * @param {google.cloud.ces.v1beta.IToolset=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Toolset} Toolset instance + */ + Toolset.create = function create(properties) { + return new Toolset(properties); + }; + + /** + * Encodes the specified Toolset message. Does not implicitly {@link google.cloud.ces.v1beta.Toolset.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Toolset + * @static + * @param {google.cloud.ces.v1beta.IToolset} message Toolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Toolset.encode = function encode(message, writer) { + if (!writer) + 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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); + if (message.mcpToolset != null && Object.hasOwnProperty.call(message, "mcpToolset")) + $root.google.cloud.ces.v1beta.McpToolset.encode(message.mcpToolset, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.openApiToolset != null && Object.hasOwnProperty.call(message, "openApiToolset")) + $root.google.cloud.ces.v1beta.OpenApiToolset.encode(message.openApiToolset, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.connectorToolset != null && Object.hasOwnProperty.call(message, "connectorToolset")) + $root.google.cloud.ces.v1beta.ConnectorToolset.encode(message.connectorToolset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.executionType != null && Object.hasOwnProperty.call(message, "executionType")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.executionType); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.description); + if (message.toolFakeConfig != null && Object.hasOwnProperty.call(message, "toolFakeConfig")) + $root.google.cloud.ces.v1beta.ToolFakeConfig.encode(message.toolFakeConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Toolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Toolset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Toolset + * @static + * @param {google.cloud.ces.v1beta.IToolset} message Toolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Toolset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Toolset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Toolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Toolset} Toolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Toolset.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Toolset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 6: { + message.mcpToolset = $root.google.cloud.ces.v1beta.McpToolset.decode(reader, reader.uint32()); + break; + } + case 7: { + message.openApiToolset = $root.google.cloud.ces.v1beta.OpenApiToolset.decode(reader, reader.uint32()); + break; + } + case 8: { + message.connectorToolset = $root.google.cloud.ces.v1beta.ConnectorToolset.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 10: { + message.description = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.etag = reader.string(); + break; + } + case 9: { + message.executionType = reader.int32(); + break; + } + case 11: { + message.toolFakeConfig = $root.google.cloud.ces.v1beta.ToolFakeConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Toolset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Toolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Toolset} Toolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Toolset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Toolset message. + * @function verify + * @memberof google.cloud.ces.v1beta.Toolset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Toolset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.mcpToolset != null && message.hasOwnProperty("mcpToolset")) { + properties.toolsetType = 1; + { + var error = $root.google.cloud.ces.v1beta.McpToolset.verify(message.mcpToolset); + if (error) + return "mcpToolset." + error; + } + } + if (message.openApiToolset != null && message.hasOwnProperty("openApiToolset")) { + if (properties.toolsetType === 1) + return "toolsetType: multiple values"; + properties.toolsetType = 1; + { + var error = $root.google.cloud.ces.v1beta.OpenApiToolset.verify(message.openApiToolset); + if (error) + return "openApiToolset." + error; + } + } + if (message.connectorToolset != null && message.hasOwnProperty("connectorToolset")) { + if (properties.toolsetType === 1) + return "toolsetType: multiple values"; + properties.toolsetType = 1; + { + var error = $root.google.cloud.ces.v1beta.ConnectorToolset.verify(message.connectorToolset); + if (error) + return "connectorToolset." + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.executionType != null && message.hasOwnProperty("executionType")) + switch (message.executionType) { + default: + return "executionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) { + var error = $root.google.cloud.ces.v1beta.ToolFakeConfig.verify(message.toolFakeConfig); + if (error) + return "toolFakeConfig." + error; + } + return null; + }; + + /** + * Creates a Toolset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Toolset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Toolset} Toolset + */ + Toolset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Toolset) + return object; + var message = new $root.google.cloud.ces.v1beta.Toolset(); + if (object.mcpToolset != null) { + if (typeof object.mcpToolset !== "object") + throw TypeError(".google.cloud.ces.v1beta.Toolset.mcpToolset: object expected"); + message.mcpToolset = $root.google.cloud.ces.v1beta.McpToolset.fromObject(object.mcpToolset); + } + if (object.openApiToolset != null) { + if (typeof object.openApiToolset !== "object") + throw TypeError(".google.cloud.ces.v1beta.Toolset.openApiToolset: object expected"); + message.openApiToolset = $root.google.cloud.ces.v1beta.OpenApiToolset.fromObject(object.openApiToolset); + } + if (object.connectorToolset != null) { + if (typeof object.connectorToolset !== "object") + throw TypeError(".google.cloud.ces.v1beta.Toolset.connectorToolset: object expected"); + message.connectorToolset = $root.google.cloud.ces.v1beta.ConnectorToolset.fromObject(object.connectorToolset); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Toolset.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.ces.v1beta.Toolset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + switch (object.executionType) { + default: + if (typeof object.executionType === "number") { + message.executionType = object.executionType; + break; + } + break; + case "EXECUTION_TYPE_UNSPECIFIED": + case 0: + message.executionType = 0; + break; + case "SYNCHRONOUS": + case 1: + message.executionType = 1; + break; + case "ASYNCHRONOUS": + case 2: + message.executionType = 2; + break; + } + if (object.toolFakeConfig != null) { + if (typeof object.toolFakeConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.Toolset.toolFakeConfig: object expected"); + message.toolFakeConfig = $root.google.cloud.ces.v1beta.ToolFakeConfig.fromObject(object.toolFakeConfig); + } + return message; + }; + + /** + * Creates a plain object from a Toolset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Toolset + * @static + * @param {google.cloud.ces.v1beta.Toolset} message Toolset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Toolset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.executionType = options.enums === String ? "EXECUTION_TYPE_UNSPECIFIED" : 0; + object.description = ""; + object.toolFakeConfig = 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.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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.mcpToolset != null && message.hasOwnProperty("mcpToolset")) { + object.mcpToolset = $root.google.cloud.ces.v1beta.McpToolset.toObject(message.mcpToolset, options); + if (options.oneofs) + object.toolsetType = "mcpToolset"; + } + if (message.openApiToolset != null && message.hasOwnProperty("openApiToolset")) { + object.openApiToolset = $root.google.cloud.ces.v1beta.OpenApiToolset.toObject(message.openApiToolset, options); + if (options.oneofs) + object.toolsetType = "openApiToolset"; + } + if (message.connectorToolset != null && message.hasOwnProperty("connectorToolset")) { + object.connectorToolset = $root.google.cloud.ces.v1beta.ConnectorToolset.toObject(message.connectorToolset, options); + if (options.oneofs) + object.toolsetType = "connectorToolset"; + } + if (message.executionType != null && message.hasOwnProperty("executionType")) + object.executionType = options.enums === String ? $root.google.cloud.ces.v1beta.ExecutionType[message.executionType] === undefined ? message.executionType : $root.google.cloud.ces.v1beta.ExecutionType[message.executionType] : message.executionType; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.toolFakeConfig != null && message.hasOwnProperty("toolFakeConfig")) + object.toolFakeConfig = $root.google.cloud.ces.v1beta.ToolFakeConfig.toObject(message.toolFakeConfig, options); + return object; + }; + + /** + * Converts this Toolset to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Toolset + * @instance + * @returns {Object.} JSON object + */ + Toolset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Toolset + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Toolset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Toolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Toolset"; + }; + + return Toolset; + })(); + + v1beta.ConnectorToolset = (function() { + + /** + * Properties of a ConnectorToolset. + * @memberof google.cloud.ces.v1beta + * @interface IConnectorToolset + * @property {string|null} [connection] ConnectorToolset connection + * @property {google.cloud.ces.v1beta.IEndUserAuthConfig|null} [authConfig] ConnectorToolset authConfig + * @property {Array.|null} [connectorActions] ConnectorToolset connectorActions + */ + + /** + * Constructs a new ConnectorToolset. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ConnectorToolset. + * @implements IConnectorToolset + * @constructor + * @param {google.cloud.ces.v1beta.IConnectorToolset=} [properties] Properties to set + */ + function ConnectorToolset(properties) { + this.connectorActions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectorToolset connection. + * @member {string} connection + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @instance + */ + ConnectorToolset.prototype.connection = ""; + + /** + * ConnectorToolset authConfig. + * @member {google.cloud.ces.v1beta.IEndUserAuthConfig|null|undefined} authConfig + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @instance + */ + ConnectorToolset.prototype.authConfig = null; + + /** + * ConnectorToolset connectorActions. + * @member {Array.} connectorActions + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @instance + */ + ConnectorToolset.prototype.connectorActions = $util.emptyArray; + + /** + * Creates a new ConnectorToolset instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @static + * @param {google.cloud.ces.v1beta.IConnectorToolset=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ConnectorToolset} ConnectorToolset instance + */ + ConnectorToolset.create = function create(properties) { + return new ConnectorToolset(properties); + }; + + /** + * Encodes the specified ConnectorToolset message. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorToolset.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @static + * @param {google.cloud.ces.v1beta.IConnectorToolset} message ConnectorToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorToolset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection); + if (message.authConfig != null && Object.hasOwnProperty.call(message, "authConfig")) + $root.google.cloud.ces.v1beta.EndUserAuthConfig.encode(message.authConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.connectorActions != null && message.connectorActions.length) + for (var i = 0; i < message.connectorActions.length; ++i) + $root.google.cloud.ces.v1beta.Action.encode(message.connectorActions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConnectorToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ConnectorToolset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @static + * @param {google.cloud.ces.v1beta.IConnectorToolset} message ConnectorToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorToolset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectorToolset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ConnectorToolset} ConnectorToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorToolset.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ConnectorToolset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.connection = reader.string(); + break; + } + case 2: { + message.authConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.connectorActions && message.connectorActions.length)) + message.connectorActions = []; + message.connectorActions.push($root.google.cloud.ces.v1beta.Action.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectorToolset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ConnectorToolset} ConnectorToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorToolset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectorToolset message. + * @function verify + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectorToolset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connection != null && message.hasOwnProperty("connection")) + if (!$util.isString(message.connection)) + return "connection: string expected"; + if (message.authConfig != null && message.hasOwnProperty("authConfig")) { + var error = $root.google.cloud.ces.v1beta.EndUserAuthConfig.verify(message.authConfig); + if (error) + return "authConfig." + error; + } + if (message.connectorActions != null && message.hasOwnProperty("connectorActions")) { + if (!Array.isArray(message.connectorActions)) + return "connectorActions: array expected"; + for (var i = 0; i < message.connectorActions.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Action.verify(message.connectorActions[i]); + if (error) + return "connectorActions." + error; + } + } + return null; + }; + + /** + * Creates a ConnectorToolset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ConnectorToolset} ConnectorToolset + */ + ConnectorToolset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ConnectorToolset) + return object; + var message = new $root.google.cloud.ces.v1beta.ConnectorToolset(); + if (object.connection != null) + message.connection = String(object.connection); + if (object.authConfig != null) { + if (typeof object.authConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.ConnectorToolset.authConfig: object expected"); + message.authConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.fromObject(object.authConfig); + } + if (object.connectorActions) { + if (!Array.isArray(object.connectorActions)) + throw TypeError(".google.cloud.ces.v1beta.ConnectorToolset.connectorActions: array expected"); + message.connectorActions = []; + for (var i = 0; i < object.connectorActions.length; ++i) { + if (typeof object.connectorActions[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ConnectorToolset.connectorActions: object expected"); + message.connectorActions[i] = $root.google.cloud.ces.v1beta.Action.fromObject(object.connectorActions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ConnectorToolset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @static + * @param {google.cloud.ces.v1beta.ConnectorToolset} message ConnectorToolset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectorToolset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.connectorActions = []; + if (options.defaults) { + object.connection = ""; + object.authConfig = null; + } + if (message.connection != null && message.hasOwnProperty("connection")) + object.connection = message.connection; + if (message.authConfig != null && message.hasOwnProperty("authConfig")) + object.authConfig = $root.google.cloud.ces.v1beta.EndUserAuthConfig.toObject(message.authConfig, options); + if (message.connectorActions && message.connectorActions.length) { + object.connectorActions = []; + for (var j = 0; j < message.connectorActions.length; ++j) + object.connectorActions[j] = $root.google.cloud.ces.v1beta.Action.toObject(message.connectorActions[j], options); + } + return object; + }; + + /** + * Converts this ConnectorToolset to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @instance + * @returns {Object.} JSON object + */ + ConnectorToolset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectorToolset + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ConnectorToolset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectorToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ConnectorToolset"; + }; + + return ConnectorToolset; + })(); + + v1beta.McpToolset = (function() { + + /** + * Properties of a McpToolset. + * @memberof google.cloud.ces.v1beta + * @interface IMcpToolset + * @property {string|null} [serverAddress] McpToolset serverAddress + * @property {google.cloud.ces.v1beta.IApiAuthentication|null} [apiAuthentication] McpToolset apiAuthentication + * @property {google.cloud.ces.v1beta.IServiceDirectoryConfig|null} [serviceDirectoryConfig] McpToolset serviceDirectoryConfig + * @property {google.cloud.ces.v1beta.ITlsConfig|null} [tlsConfig] McpToolset tlsConfig + */ + + /** + * Constructs a new McpToolset. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a McpToolset. + * @implements IMcpToolset + * @constructor + * @param {google.cloud.ces.v1beta.IMcpToolset=} [properties] Properties to set + */ + function McpToolset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * McpToolset serverAddress. + * @member {string} serverAddress + * @memberof google.cloud.ces.v1beta.McpToolset + * @instance + */ + McpToolset.prototype.serverAddress = ""; + + /** + * McpToolset apiAuthentication. + * @member {google.cloud.ces.v1beta.IApiAuthentication|null|undefined} apiAuthentication + * @memberof google.cloud.ces.v1beta.McpToolset + * @instance + */ + McpToolset.prototype.apiAuthentication = null; + + /** + * McpToolset serviceDirectoryConfig. + * @member {google.cloud.ces.v1beta.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig + * @memberof google.cloud.ces.v1beta.McpToolset + * @instance + */ + McpToolset.prototype.serviceDirectoryConfig = null; + + /** + * McpToolset tlsConfig. + * @member {google.cloud.ces.v1beta.ITlsConfig|null|undefined} tlsConfig + * @memberof google.cloud.ces.v1beta.McpToolset + * @instance + */ + McpToolset.prototype.tlsConfig = null; + + /** + * Creates a new McpToolset instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.McpToolset + * @static + * @param {google.cloud.ces.v1beta.IMcpToolset=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.McpToolset} McpToolset instance + */ + McpToolset.create = function create(properties) { + return new McpToolset(properties); + }; + + /** + * Encodes the specified McpToolset message. Does not implicitly {@link google.cloud.ces.v1beta.McpToolset.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.McpToolset + * @static + * @param {google.cloud.ces.v1beta.IMcpToolset} message McpToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + McpToolset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serverAddress != null && Object.hasOwnProperty.call(message, "serverAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serverAddress); + if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) + $root.google.cloud.ces.v1beta.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) + $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) + $root.google.cloud.ces.v1beta.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified McpToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.McpToolset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.McpToolset + * @static + * @param {google.cloud.ces.v1beta.IMcpToolset} message McpToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + McpToolset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a McpToolset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.McpToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.McpToolset} McpToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + McpToolset.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.McpToolset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.serverAddress = reader.string(); + break; + } + case 2: { + message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.decode(reader, reader.uint32()); + break; + } + case 3: { + message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a McpToolset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.McpToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.McpToolset} McpToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + McpToolset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a McpToolset message. + * @function verify + * @memberof google.cloud.ces.v1beta.McpToolset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + McpToolset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) + if (!$util.isString(message.serverAddress)) + return "serverAddress: string expected"; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { + var error = $root.google.cloud.ces.v1beta.ApiAuthentication.verify(message.apiAuthentication); + if (error) + return "apiAuthentication." + error; + } + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { + var error = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); + if (error) + return "serviceDirectoryConfig." + error; + } + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { + var error = $root.google.cloud.ces.v1beta.TlsConfig.verify(message.tlsConfig); + if (error) + return "tlsConfig." + error; + } + return null; + }; + + /** + * Creates a McpToolset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.McpToolset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.McpToolset} McpToolset + */ + McpToolset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.McpToolset) + return object; + var message = new $root.google.cloud.ces.v1beta.McpToolset(); + if (object.serverAddress != null) + message.serverAddress = String(object.serverAddress); + if (object.apiAuthentication != null) { + if (typeof object.apiAuthentication !== "object") + throw TypeError(".google.cloud.ces.v1beta.McpToolset.apiAuthentication: object expected"); + message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.fromObject(object.apiAuthentication); + } + if (object.serviceDirectoryConfig != null) { + if (typeof object.serviceDirectoryConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.McpToolset.serviceDirectoryConfig: object expected"); + message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); + } + if (object.tlsConfig != null) { + if (typeof object.tlsConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.McpToolset.tlsConfig: object expected"); + message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.fromObject(object.tlsConfig); + } + return message; + }; + + /** + * Creates a plain object from a McpToolset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.McpToolset + * @static + * @param {google.cloud.ces.v1beta.McpToolset} message McpToolset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + McpToolset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serverAddress = ""; + object.apiAuthentication = null; + object.serviceDirectoryConfig = null; + object.tlsConfig = null; + } + if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) + object.serverAddress = message.serverAddress; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) + object.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.toObject(message.apiAuthentication, options); + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) + object.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) + object.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.toObject(message.tlsConfig, options); + return object; + }; + + /** + * Converts this McpToolset to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.McpToolset + * @instance + * @returns {Object.} JSON object + */ + McpToolset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for McpToolset + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.McpToolset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + McpToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.McpToolset"; + }; + + return McpToolset; + })(); + + v1beta.OpenApiToolset = (function() { + + /** + * Properties of an OpenApiToolset. + * @memberof google.cloud.ces.v1beta + * @interface IOpenApiToolset + * @property {string|null} [openApiSchema] OpenApiToolset openApiSchema + * @property {google.cloud.ces.v1beta.IApiAuthentication|null} [apiAuthentication] OpenApiToolset apiAuthentication + * @property {google.cloud.ces.v1beta.ITlsConfig|null} [tlsConfig] OpenApiToolset tlsConfig + * @property {google.cloud.ces.v1beta.IServiceDirectoryConfig|null} [serviceDirectoryConfig] OpenApiToolset serviceDirectoryConfig + * @property {boolean|null} [ignoreUnknownFields] OpenApiToolset ignoreUnknownFields + * @property {string|null} [url] OpenApiToolset url + */ + + /** + * Constructs a new OpenApiToolset. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an OpenApiToolset. + * @implements IOpenApiToolset + * @constructor + * @param {google.cloud.ces.v1beta.IOpenApiToolset=} [properties] Properties to set + */ + function OpenApiToolset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpenApiToolset openApiSchema. + * @member {string} openApiSchema + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @instance + */ + OpenApiToolset.prototype.openApiSchema = ""; + + /** + * OpenApiToolset apiAuthentication. + * @member {google.cloud.ces.v1beta.IApiAuthentication|null|undefined} apiAuthentication + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @instance + */ + OpenApiToolset.prototype.apiAuthentication = null; + + /** + * OpenApiToolset tlsConfig. + * @member {google.cloud.ces.v1beta.ITlsConfig|null|undefined} tlsConfig + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @instance + */ + OpenApiToolset.prototype.tlsConfig = null; + + /** + * OpenApiToolset serviceDirectoryConfig. + * @member {google.cloud.ces.v1beta.IServiceDirectoryConfig|null|undefined} serviceDirectoryConfig + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @instance + */ + OpenApiToolset.prototype.serviceDirectoryConfig = null; + + /** + * OpenApiToolset ignoreUnknownFields. + * @member {boolean} ignoreUnknownFields + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @instance + */ + OpenApiToolset.prototype.ignoreUnknownFields = false; + + /** + * OpenApiToolset url. + * @member {string} url + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @instance + */ + OpenApiToolset.prototype.url = ""; + + /** + * Creates a new OpenApiToolset instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @static + * @param {google.cloud.ces.v1beta.IOpenApiToolset=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OpenApiToolset} OpenApiToolset instance + */ + OpenApiToolset.create = function create(properties) { + return new OpenApiToolset(properties); + }; + + /** + * Encodes the specified OpenApiToolset message. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiToolset.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @static + * @param {google.cloud.ces.v1beta.IOpenApiToolset} message OpenApiToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiToolset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.openApiSchema != null && Object.hasOwnProperty.call(message, "openApiSchema")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.openApiSchema); + if (message.apiAuthentication != null && Object.hasOwnProperty.call(message, "apiAuthentication")) + $root.google.cloud.ces.v1beta.ApiAuthentication.encode(message.apiAuthentication, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tlsConfig != null && Object.hasOwnProperty.call(message, "tlsConfig")) + $root.google.cloud.ces.v1beta.TlsConfig.encode(message.tlsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.serviceDirectoryConfig != null && Object.hasOwnProperty.call(message, "serviceDirectoryConfig")) + $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.encode(message.serviceDirectoryConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ignoreUnknownFields != null && Object.hasOwnProperty.call(message, "ignoreUnknownFields")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.ignoreUnknownFields); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.url); + return writer; + }; + + /** + * Encodes the specified OpenApiToolset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OpenApiToolset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @static + * @param {google.cloud.ces.v1beta.IOpenApiToolset} message OpenApiToolset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiToolset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenApiToolset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OpenApiToolset} OpenApiToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiToolset.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OpenApiToolset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.openApiSchema = reader.string(); + break; + } + case 2: { + message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.decode(reader, reader.uint32()); + break; + } + case 3: { + message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.ignoreUnknownFields = reader.bool(); + break; + } + case 6: { + message.url = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OpenApiToolset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OpenApiToolset} OpenApiToolset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiToolset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpenApiToolset message. + * @function verify + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenApiToolset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) + if (!$util.isString(message.openApiSchema)) + return "openApiSchema: string expected"; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) { + var error = $root.google.cloud.ces.v1beta.ApiAuthentication.verify(message.apiAuthentication); + if (error) + return "apiAuthentication." + error; + } + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) { + var error = $root.google.cloud.ces.v1beta.TlsConfig.verify(message.tlsConfig); + if (error) + return "tlsConfig." + error; + } + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) { + var error = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.verify(message.serviceDirectoryConfig); + if (error) + return "serviceDirectoryConfig." + error; + } + if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) + if (typeof message.ignoreUnknownFields !== "boolean") + return "ignoreUnknownFields: boolean expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + return null; + }; + + /** + * Creates an OpenApiToolset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OpenApiToolset} OpenApiToolset + */ + OpenApiToolset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OpenApiToolset) + return object; + var message = new $root.google.cloud.ces.v1beta.OpenApiToolset(); + if (object.openApiSchema != null) + message.openApiSchema = String(object.openApiSchema); + if (object.apiAuthentication != null) { + if (typeof object.apiAuthentication !== "object") + throw TypeError(".google.cloud.ces.v1beta.OpenApiToolset.apiAuthentication: object expected"); + message.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.fromObject(object.apiAuthentication); + } + if (object.tlsConfig != null) { + if (typeof object.tlsConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.OpenApiToolset.tlsConfig: object expected"); + message.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.fromObject(object.tlsConfig); + } + if (object.serviceDirectoryConfig != null) { + if (typeof object.serviceDirectoryConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.OpenApiToolset.serviceDirectoryConfig: object expected"); + message.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.fromObject(object.serviceDirectoryConfig); + } + if (object.ignoreUnknownFields != null) + message.ignoreUnknownFields = Boolean(object.ignoreUnknownFields); + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from an OpenApiToolset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @static + * @param {google.cloud.ces.v1beta.OpenApiToolset} message OpenApiToolset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenApiToolset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.openApiSchema = ""; + object.apiAuthentication = null; + object.tlsConfig = null; + object.serviceDirectoryConfig = null; + object.ignoreUnknownFields = false; + object.url = ""; + } + if (message.openApiSchema != null && message.hasOwnProperty("openApiSchema")) + object.openApiSchema = message.openApiSchema; + if (message.apiAuthentication != null && message.hasOwnProperty("apiAuthentication")) + object.apiAuthentication = $root.google.cloud.ces.v1beta.ApiAuthentication.toObject(message.apiAuthentication, options); + if (message.tlsConfig != null && message.hasOwnProperty("tlsConfig")) + object.tlsConfig = $root.google.cloud.ces.v1beta.TlsConfig.toObject(message.tlsConfig, options); + if (message.serviceDirectoryConfig != null && message.hasOwnProperty("serviceDirectoryConfig")) + object.serviceDirectoryConfig = $root.google.cloud.ces.v1beta.ServiceDirectoryConfig.toObject(message.serviceDirectoryConfig, options); + if (message.ignoreUnknownFields != null && message.hasOwnProperty("ignoreUnknownFields")) + object.ignoreUnknownFields = message.ignoreUnknownFields; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + return object; + }; + + /** + * Converts this OpenApiToolset to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @instance + * @returns {Object.} JSON object + */ + OpenApiToolset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OpenApiToolset + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OpenApiToolset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpenApiToolset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OpenApiToolset"; + }; + + return OpenApiToolset; + })(); + + v1beta.Changelog = (function() { + + /** + * Properties of a Changelog. + * @memberof google.cloud.ces.v1beta + * @interface IChangelog + * @property {string|null} [name] Changelog name + * @property {string|null} [author] Changelog author + * @property {string|null} [displayName] Changelog displayName + * @property {string|null} [description] Changelog description + * @property {string|null} [resource] Changelog resource + * @property {string|null} [resourceType] Changelog resourceType + * @property {string|null} [action] Changelog action + * @property {google.protobuf.IStruct|null} [originalResource] Changelog originalResource + * @property {google.protobuf.IStruct|null} [newResource] Changelog newResource + * @property {Array.|null} [dependentResources] Changelog dependentResources + * @property {google.protobuf.ITimestamp|null} [createTime] Changelog createTime + * @property {number|Long|null} [sequenceNumber] Changelog sequenceNumber + */ + + /** + * Constructs a new Changelog. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Changelog. + * @implements IChangelog + * @constructor + * @param {google.cloud.ces.v1beta.IChangelog=} [properties] Properties to set + */ + function Changelog(properties) { + this.dependentResources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Changelog name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.name = ""; + + /** + * Changelog author. + * @member {string} author + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.author = ""; + + /** + * Changelog displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.displayName = ""; + + /** + * Changelog description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.description = ""; + + /** + * Changelog resource. + * @member {string} resource + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.resource = ""; + + /** + * Changelog resourceType. + * @member {string} resourceType + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.resourceType = ""; + + /** + * Changelog action. + * @member {string} action + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.action = ""; + + /** + * Changelog originalResource. + * @member {google.protobuf.IStruct|null|undefined} originalResource + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.originalResource = null; + + /** + * Changelog newResource. + * @member {google.protobuf.IStruct|null|undefined} newResource + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.newResource = null; + + /** + * Changelog dependentResources. + * @member {Array.} dependentResources + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.dependentResources = $util.emptyArray; + + /** + * Changelog createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.createTime = null; + + /** + * Changelog sequenceNumber. + * @member {number|Long} sequenceNumber + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + */ + Changelog.prototype.sequenceNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Changelog instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Changelog + * @static + * @param {google.cloud.ces.v1beta.IChangelog=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Changelog} Changelog instance + */ + Changelog.create = function create(properties) { + return new Changelog(properties); + }; + + /** + * Encodes the specified Changelog message. Does not implicitly {@link google.cloud.ces.v1beta.Changelog.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Changelog + * @static + * @param {google.cloud.ces.v1beta.IChangelog} message Changelog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Changelog.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.author != null && Object.hasOwnProperty.call(message, "author")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.author); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resource); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.resourceType); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.action); + if (message.originalResource != null && Object.hasOwnProperty.call(message, "originalResource")) + $root.google.protobuf.Struct.encode(message.originalResource, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.newResource != null && Object.hasOwnProperty.call(message, "newResource")) + $root.google.protobuf.Struct.encode(message.newResource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.dependentResources != null && message.dependentResources.length) + for (var i = 0; i < message.dependentResources.length; ++i) + $root.google.protobuf.Struct.encode(message.dependentResources[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.description); + if (message.sequenceNumber != null && Object.hasOwnProperty.call(message, "sequenceNumber")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.sequenceNumber); + return writer; + }; + + /** + * Encodes the specified Changelog message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Changelog.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Changelog + * @static + * @param {google.cloud.ces.v1beta.IChangelog} message Changelog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Changelog.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Changelog message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Changelog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Changelog} Changelog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Changelog.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Changelog(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.author = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 11: { + message.description = reader.string(); + break; + } + case 4: { + message.resource = reader.string(); + break; + } + case 5: { + message.resourceType = reader.string(); + break; + } + case 6: { + message.action = reader.string(); + break; + } + case 7: { + message.originalResource = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 8: { + message.newResource = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.dependentResources && message.dependentResources.length)) + message.dependentResources = []; + message.dependentResources.push($root.google.protobuf.Struct.decode(reader, reader.uint32())); + break; + } + case 10: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.sequenceNumber = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Changelog message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Changelog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Changelog} Changelog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Changelog.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Changelog message. + * @function verify + * @memberof google.cloud.ces.v1beta.Changelog + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Changelog.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.author != null && message.hasOwnProperty("author")) + if (!$util.isString(message.author)) + return "author: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.originalResource != null && message.hasOwnProperty("originalResource")) { + var error = $root.google.protobuf.Struct.verify(message.originalResource); + if (error) + return "originalResource." + error; + } + if (message.newResource != null && message.hasOwnProperty("newResource")) { + var error = $root.google.protobuf.Struct.verify(message.newResource); + if (error) + return "newResource." + error; + } + if (message.dependentResources != null && message.hasOwnProperty("dependentResources")) { + if (!Array.isArray(message.dependentResources)) + return "dependentResources: array expected"; + for (var i = 0; i < message.dependentResources.length; ++i) { + var error = $root.google.protobuf.Struct.verify(message.dependentResources[i]); + if (error) + return "dependentResources." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) + if (!$util.isInteger(message.sequenceNumber) && !(message.sequenceNumber && $util.isInteger(message.sequenceNumber.low) && $util.isInteger(message.sequenceNumber.high))) + return "sequenceNumber: integer|Long expected"; + return null; + }; + + /** + * Creates a Changelog message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Changelog + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Changelog} Changelog + */ + Changelog.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Changelog) + return object; + var message = new $root.google.cloud.ces.v1beta.Changelog(); + if (object.name != null) + message.name = String(object.name); + if (object.author != null) + message.author = String(object.author); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.resource != null) + message.resource = String(object.resource); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.action != null) + message.action = String(object.action); + if (object.originalResource != null) { + if (typeof object.originalResource !== "object") + throw TypeError(".google.cloud.ces.v1beta.Changelog.originalResource: object expected"); + message.originalResource = $root.google.protobuf.Struct.fromObject(object.originalResource); + } + if (object.newResource != null) { + if (typeof object.newResource !== "object") + throw TypeError(".google.cloud.ces.v1beta.Changelog.newResource: object expected"); + message.newResource = $root.google.protobuf.Struct.fromObject(object.newResource); + } + if (object.dependentResources) { + if (!Array.isArray(object.dependentResources)) + throw TypeError(".google.cloud.ces.v1beta.Changelog.dependentResources: array expected"); + message.dependentResources = []; + for (var i = 0; i < object.dependentResources.length; ++i) { + if (typeof object.dependentResources[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Changelog.dependentResources: object expected"); + message.dependentResources[i] = $root.google.protobuf.Struct.fromObject(object.dependentResources[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Changelog.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.sequenceNumber != null) + if ($util.Long) + (message.sequenceNumber = $util.Long.fromValue(object.sequenceNumber)).unsigned = false; + else if (typeof object.sequenceNumber === "string") + message.sequenceNumber = parseInt(object.sequenceNumber, 10); + else if (typeof object.sequenceNumber === "number") + message.sequenceNumber = object.sequenceNumber; + else if (typeof object.sequenceNumber === "object") + message.sequenceNumber = new $util.LongBits(object.sequenceNumber.low >>> 0, object.sequenceNumber.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Changelog message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Changelog + * @static + * @param {google.cloud.ces.v1beta.Changelog} message Changelog + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Changelog.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dependentResources = []; + if (options.defaults) { + object.name = ""; + object.author = ""; + object.displayName = ""; + object.resource = ""; + object.resourceType = ""; + object.action = ""; + object.originalResource = null; + object.newResource = null; + object.createTime = null; + object.description = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sequenceNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sequenceNumber = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.author != null && message.hasOwnProperty("author")) + object.author = message.author; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.originalResource != null && message.hasOwnProperty("originalResource")) + object.originalResource = $root.google.protobuf.Struct.toObject(message.originalResource, options); + if (message.newResource != null && message.hasOwnProperty("newResource")) + object.newResource = $root.google.protobuf.Struct.toObject(message.newResource, options); + if (message.dependentResources && message.dependentResources.length) { + object.dependentResources = []; + for (var j = 0; j < message.dependentResources.length; ++j) + object.dependentResources[j] = $root.google.protobuf.Struct.toObject(message.dependentResources[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) + if (typeof message.sequenceNumber === "number") + object.sequenceNumber = options.longs === String ? String(message.sequenceNumber) : message.sequenceNumber; + else + object.sequenceNumber = options.longs === String ? $util.Long.prototype.toString.call(message.sequenceNumber) : options.longs === Number ? new $util.LongBits(message.sequenceNumber.low >>> 0, message.sequenceNumber.high >>> 0).toNumber() : message.sequenceNumber; + return object; + }; + + /** + * Converts this Changelog to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Changelog + * @instance + * @returns {Object.} JSON object + */ + Changelog.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Changelog + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Changelog + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Changelog.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Changelog"; + }; + + return Changelog; + })(); + + v1beta.Conversation = (function() { + + /** + * Properties of a Conversation. + * @memberof google.cloud.ces.v1beta + * @interface IConversation + * @property {string|null} [name] Conversation name + * @property {google.protobuf.ITimestamp|null} [startTime] Conversation startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Conversation endTime + * @property {Array.|null} [turns] Conversation turns + * @property {number|null} [turnCount] Conversation turnCount + * @property {google.cloud.ces.v1beta.Conversation.ChannelType|null} [channelType] Conversation channelType + * @property {google.cloud.ces.v1beta.Conversation.Source|null} [source] Conversation source + * @property {Array.|null} [inputTypes] Conversation inputTypes + * @property {string|null} [entryAgent] Conversation entryAgent + * @property {string|null} [deployment] Conversation deployment + * @property {string|null} [appVersion] Conversation appVersion + * @property {string|null} [languageCode] Conversation languageCode + * @property {Array.|null} [messages] Conversation messages + */ + + /** + * Constructs a new Conversation. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Conversation. + * @implements IConversation + * @constructor + * @param {google.cloud.ces.v1beta.IConversation=} [properties] Properties to set + */ + function Conversation(properties) { + this.turns = []; + this.inputTypes = []; + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Conversation name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.name = ""; + + /** + * Conversation startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.startTime = null; + + /** + * Conversation endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.endTime = null; + + /** + * Conversation turns. + * @member {Array.} turns + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.turns = $util.emptyArray; + + /** + * Conversation turnCount. + * @member {number} turnCount + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.turnCount = 0; + + /** + * Conversation channelType. + * @member {google.cloud.ces.v1beta.Conversation.ChannelType} channelType + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.channelType = 0; + + /** + * Conversation source. + * @member {google.cloud.ces.v1beta.Conversation.Source} source + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.source = 0; + + /** + * Conversation inputTypes. + * @member {Array.} inputTypes + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.inputTypes = $util.emptyArray; + + /** + * Conversation entryAgent. + * @member {string} entryAgent + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.entryAgent = ""; + + /** + * Conversation deployment. + * @member {string} deployment + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.deployment = ""; + + /** + * Conversation appVersion. + * @member {string} appVersion + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.appVersion = ""; + + /** + * Conversation languageCode. + * @member {string} languageCode + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.languageCode = ""; + + /** + * Conversation messages. + * @member {Array.} messages + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + */ + Conversation.prototype.messages = $util.emptyArray; + + /** + * Creates a new Conversation instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Conversation + * @static + * @param {google.cloud.ces.v1beta.IConversation=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Conversation} Conversation instance + */ + Conversation.create = function create(properties) { + return new Conversation(properties); + }; + + /** + * Encodes the specified Conversation message. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Conversation + * @static + * @param {google.cloud.ces.v1beta.IConversation} message Conversation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Conversation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.ces.v1beta.Message.encode(message.messages[i], 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 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.turns != null && message.turns.length) + for (var i = 0; i < message.turns.length; ++i) + $root.google.cloud.ces.v1beta.Conversation.Turn.encode(message.turns[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.turnCount != null && Object.hasOwnProperty.call(message, "turnCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.turnCount); + if (message.channelType != null && Object.hasOwnProperty.call(message, "channelType")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.channelType); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.source); + if (message.inputTypes != null && message.inputTypes.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.inputTypes.length; ++i) + writer.int32(message.inputTypes[i]); + writer.ldelim(); + } + if (message.entryAgent != null && Object.hasOwnProperty.call(message, "entryAgent")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.entryAgent); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.deployment); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.appVersion); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified Conversation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Conversation + * @static + * @param {google.cloud.ces.v1beta.IConversation} message Conversation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Conversation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Conversation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Conversation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Conversation} Conversation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Conversation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Conversation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.turns && message.turns.length)) + message.turns = []; + message.turns.push($root.google.cloud.ces.v1beta.Conversation.Turn.decode(reader, reader.uint32())); + break; + } + case 7: { + message.turnCount = reader.int32(); + break; + } + case 8: { + message.channelType = reader.int32(); + break; + } + case 9: { + message.source = reader.int32(); + break; + } + case 10: { + if (!(message.inputTypes && message.inputTypes.length)) + message.inputTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.inputTypes.push(reader.int32()); + } else + message.inputTypes.push(reader.int32()); + break; + } + case 11: { + message.entryAgent = reader.string(); + break; + } + case 12: { + message.deployment = reader.string(); + break; + } + case 13: { + message.appVersion = reader.string(); + break; + } + case 14: { + message.languageCode = reader.string(); + break; + } + case 2: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Conversation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Conversation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Conversation} Conversation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Conversation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Conversation message. + * @function verify + * @memberof google.cloud.ces.v1beta.Conversation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Conversation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string 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.turns != null && message.hasOwnProperty("turns")) { + if (!Array.isArray(message.turns)) + return "turns: array expected"; + for (var i = 0; i < message.turns.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Conversation.Turn.verify(message.turns[i]); + if (error) + return "turns." + error; + } + } + if (message.turnCount != null && message.hasOwnProperty("turnCount")) + if (!$util.isInteger(message.turnCount)) + return "turnCount: integer expected"; + if (message.channelType != null && message.hasOwnProperty("channelType")) + switch (message.channelType) { + default: + return "channelType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.source != null && message.hasOwnProperty("source")) + switch (message.source) { + default: + return "source: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.inputTypes != null && message.hasOwnProperty("inputTypes")) { + if (!Array.isArray(message.inputTypes)) + return "inputTypes: array expected"; + for (var i = 0; i < message.inputTypes.length; ++i) + switch (message.inputTypes[i]) { + default: + return "inputTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + } + if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) + if (!$util.isString(message.entryAgent)) + return "entryAgent: string expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) + if (!$util.isString(message.deployment)) + return "deployment: string expected"; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (!$util.isString(message.appVersion)) + return "appVersion: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + return null; + }; + + /** + * Creates a Conversation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Conversation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Conversation} Conversation + */ + Conversation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Conversation) + return object; + var message = new $root.google.cloud.ces.v1beta.Conversation(); + if (object.name != null) + message.name = String(object.name); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Conversation.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.ces.v1beta.Conversation.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.turns) { + if (!Array.isArray(object.turns)) + throw TypeError(".google.cloud.ces.v1beta.Conversation.turns: array expected"); + message.turns = []; + for (var i = 0; i < object.turns.length; ++i) { + if (typeof object.turns[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Conversation.turns: object expected"); + message.turns[i] = $root.google.cloud.ces.v1beta.Conversation.Turn.fromObject(object.turns[i]); + } + } + if (object.turnCount != null) + message.turnCount = object.turnCount | 0; + switch (object.channelType) { + default: + if (typeof object.channelType === "number") { + message.channelType = object.channelType; + break; + } + break; + case "CHANNEL_TYPE_UNSPECIFIED": + case 0: + message.channelType = 0; + break; + case "TEXT": + case 1: + message.channelType = 1; + break; + case "AUDIO": + case 2: + message.channelType = 2; + break; + case "MULTIMODAL": + case 3: + message.channelType = 3; + break; + } + switch (object.source) { + default: + if (typeof object.source === "number") { + message.source = object.source; + break; + } + break; + case "SOURCE_UNSPECIFIED": + case 0: + message.source = 0; + break; + case "LIVE": + case 1: + message.source = 1; + break; + case "SIMULATOR": + case 2: + message.source = 2; + break; + case "EVAL": + case 3: + message.source = 3; + break; + } + if (object.inputTypes) { + if (!Array.isArray(object.inputTypes)) + throw TypeError(".google.cloud.ces.v1beta.Conversation.inputTypes: array expected"); + message.inputTypes = []; + for (var i = 0; i < object.inputTypes.length; ++i) + switch (object.inputTypes[i]) { + default: + if (typeof object.inputTypes[i] === "number") { + message.inputTypes[i] = object.inputTypes[i]; + break; + } + case "INPUT_TYPE_UNSPECIFIED": + case 0: + message.inputTypes[i] = 0; + break; + case "INPUT_TYPE_TEXT": + case 1: + message.inputTypes[i] = 1; + break; + case "INPUT_TYPE_AUDIO": + case 2: + message.inputTypes[i] = 2; + break; + case "INPUT_TYPE_IMAGE": + case 3: + message.inputTypes[i] = 3; + break; + case "INPUT_TYPE_BLOB": + case 4: + message.inputTypes[i] = 4; + break; + case "INPUT_TYPE_TOOL_RESPONSE": + case 5: + message.inputTypes[i] = 5; + break; + case "INPUT_TYPE_VARIABLES": + case 6: + message.inputTypes[i] = 6; + break; + } + } + if (object.entryAgent != null) + message.entryAgent = String(object.entryAgent); + if (object.deployment != null) + message.deployment = String(object.deployment); + if (object.appVersion != null) + message.appVersion = String(object.appVersion); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.ces.v1beta.Conversation.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Conversation.messages: object expected"); + message.messages[i] = $root.google.cloud.ces.v1beta.Message.fromObject(object.messages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Conversation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Conversation + * @static + * @param {google.cloud.ces.v1beta.Conversation} message Conversation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Conversation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.messages = []; + object.turns = []; + object.inputTypes = []; + } + if (options.defaults) { + object.name = ""; + object.startTime = null; + object.endTime = null; + object.turnCount = 0; + object.channelType = options.enums === String ? "CHANNEL_TYPE_UNSPECIFIED" : 0; + object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; + object.entryAgent = ""; + object.deployment = ""; + object.appVersion = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.ces.v1beta.Message.toObject(message.messages[j], options); + } + 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.turns && message.turns.length) { + object.turns = []; + for (var j = 0; j < message.turns.length; ++j) + object.turns[j] = $root.google.cloud.ces.v1beta.Conversation.Turn.toObject(message.turns[j], options); + } + if (message.turnCount != null && message.hasOwnProperty("turnCount")) + object.turnCount = message.turnCount; + if (message.channelType != null && message.hasOwnProperty("channelType")) + object.channelType = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.ChannelType[message.channelType] === undefined ? message.channelType : $root.google.cloud.ces.v1beta.Conversation.ChannelType[message.channelType] : message.channelType; + if (message.source != null && message.hasOwnProperty("source")) + object.source = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1beta.Conversation.Source[message.source] : message.source; + if (message.inputTypes && message.inputTypes.length) { + object.inputTypes = []; + for (var j = 0; j < message.inputTypes.length; ++j) + object.inputTypes[j] = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.InputType[message.inputTypes[j]] === undefined ? message.inputTypes[j] : $root.google.cloud.ces.v1beta.Conversation.InputType[message.inputTypes[j]] : message.inputTypes[j]; + } + if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) + object.entryAgent = message.entryAgent; + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = message.deployment; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + object.appVersion = message.appVersion; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this Conversation to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Conversation + * @instance + * @returns {Object.} JSON object + */ + Conversation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Conversation + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Conversation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Conversation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Conversation"; + }; + + Conversation.Turn = (function() { + + /** + * Properties of a Turn. + * @memberof google.cloud.ces.v1beta.Conversation + * @interface ITurn + * @property {Array.|null} [messages] Turn messages + * @property {google.cloud.ces.v1beta.ISpan|null} [rootSpan] Turn rootSpan + */ + + /** + * Constructs a new Turn. + * @memberof google.cloud.ces.v1beta.Conversation + * @classdesc Represents a Turn. + * @implements ITurn + * @constructor + * @param {google.cloud.ces.v1beta.Conversation.ITurn=} [properties] Properties to set + */ + function Turn(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Turn messages. + * @member {Array.} messages + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @instance + */ + Turn.prototype.messages = $util.emptyArray; + + /** + * Turn rootSpan. + * @member {google.cloud.ces.v1beta.ISpan|null|undefined} rootSpan + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @instance + */ + Turn.prototype.rootSpan = null; + + /** + * Creates a new Turn instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @static + * @param {google.cloud.ces.v1beta.Conversation.ITurn=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Conversation.Turn} Turn instance + */ + Turn.create = function create(properties) { + return new Turn(properties); + }; + + /** + * Encodes the specified Turn message. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.Turn.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @static + * @param {google.cloud.ces.v1beta.Conversation.ITurn} message Turn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Turn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.ces.v1beta.Message.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rootSpan != null && Object.hasOwnProperty.call(message, "rootSpan")) + $root.google.cloud.ces.v1beta.Span.encode(message.rootSpan, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Turn message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Conversation.Turn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @static + * @param {google.cloud.ces.v1beta.Conversation.ITurn} message Turn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Turn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Turn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Conversation.Turn} Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Turn.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Conversation.Turn(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32())); + break; + } + case 2: { + message.rootSpan = $root.google.cloud.ces.v1beta.Span.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Turn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Conversation.Turn} Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Turn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Turn message. + * @function verify + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Turn.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) { + var error = $root.google.cloud.ces.v1beta.Span.verify(message.rootSpan); + if (error) + return "rootSpan." + error; + } + return null; + }; + + /** + * Creates a Turn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Conversation.Turn} Turn + */ + Turn.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Conversation.Turn) + return object; + var message = new $root.google.cloud.ces.v1beta.Conversation.Turn(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.ces.v1beta.Conversation.Turn.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Conversation.Turn.messages: object expected"); + message.messages[i] = $root.google.cloud.ces.v1beta.Message.fromObject(object.messages[i]); + } + } + if (object.rootSpan != null) { + if (typeof object.rootSpan !== "object") + throw TypeError(".google.cloud.ces.v1beta.Conversation.Turn.rootSpan: object expected"); + message.rootSpan = $root.google.cloud.ces.v1beta.Span.fromObject(object.rootSpan); + } + return message; + }; + + /** + * Creates a plain object from a Turn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @static + * @param {google.cloud.ces.v1beta.Conversation.Turn} message Turn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Turn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) + object.rootSpan = null; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.ces.v1beta.Message.toObject(message.messages[j], options); + } + if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) + object.rootSpan = $root.google.cloud.ces.v1beta.Span.toObject(message.rootSpan, options); + return object; + }; + + /** + * Converts this Turn to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @instance + * @returns {Object.} JSON object + */ + Turn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Turn + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Conversation.Turn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Turn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Conversation.Turn"; + }; + + return Turn; + })(); + + /** + * ChannelType enum. + * @name google.cloud.ces.v1beta.Conversation.ChannelType + * @enum {number} + * @property {number} CHANNEL_TYPE_UNSPECIFIED=0 CHANNEL_TYPE_UNSPECIFIED value + * @property {number} TEXT=1 TEXT value + * @property {number} AUDIO=2 AUDIO value + * @property {number} MULTIMODAL=3 MULTIMODAL value + */ + Conversation.ChannelType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CHANNEL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "AUDIO"] = 2; + values[valuesById[3] = "MULTIMODAL"] = 3; + return values; + })(); + + /** + * Source enum. + * @name google.cloud.ces.v1beta.Conversation.Source + * @enum {number} + * @property {number} SOURCE_UNSPECIFIED=0 SOURCE_UNSPECIFIED value + * @property {number} LIVE=1 LIVE value + * @property {number} SIMULATOR=2 SIMULATOR value + * @property {number} EVAL=3 EVAL value + */ + Conversation.Source = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SOURCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LIVE"] = 1; + values[valuesById[2] = "SIMULATOR"] = 2; + values[valuesById[3] = "EVAL"] = 3; + return values; + })(); + + /** + * InputType enum. + * @name google.cloud.ces.v1beta.Conversation.InputType + * @enum {number} + * @property {number} INPUT_TYPE_UNSPECIFIED=0 INPUT_TYPE_UNSPECIFIED value + * @property {number} INPUT_TYPE_TEXT=1 INPUT_TYPE_TEXT value + * @property {number} INPUT_TYPE_AUDIO=2 INPUT_TYPE_AUDIO value + * @property {number} INPUT_TYPE_IMAGE=3 INPUT_TYPE_IMAGE value + * @property {number} INPUT_TYPE_BLOB=4 INPUT_TYPE_BLOB value + * @property {number} INPUT_TYPE_TOOL_RESPONSE=5 INPUT_TYPE_TOOL_RESPONSE value + * @property {number} INPUT_TYPE_VARIABLES=6 INPUT_TYPE_VARIABLES value + */ + Conversation.InputType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INPUT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INPUT_TYPE_TEXT"] = 1; + values[valuesById[2] = "INPUT_TYPE_AUDIO"] = 2; + values[valuesById[3] = "INPUT_TYPE_IMAGE"] = 3; + values[valuesById[4] = "INPUT_TYPE_BLOB"] = 4; + values[valuesById[5] = "INPUT_TYPE_TOOL_RESPONSE"] = 5; + values[valuesById[6] = "INPUT_TYPE_VARIABLES"] = 6; + return values; + })(); + + return Conversation; + })(); + + v1beta.Deployment = (function() { + + /** + * Properties of a Deployment. + * @memberof google.cloud.ces.v1beta + * @interface IDeployment + * @property {string|null} [name] Deployment name + * @property {string|null} [displayName] Deployment displayName + * @property {string|null} [appVersion] Deployment appVersion + * @property {google.cloud.ces.v1beta.IChannelProfile|null} [channelProfile] Deployment channelProfile + * @property {google.protobuf.ITimestamp|null} [createTime] Deployment createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Deployment updateTime + * @property {string|null} [etag] Deployment etag + */ + + /** + * Constructs a new Deployment. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Deployment. + * @implements IDeployment + * @constructor + * @param {google.cloud.ces.v1beta.IDeployment=} [properties] Properties to set + */ + function Deployment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Deployment name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Deployment + * @instance + */ + Deployment.prototype.name = ""; + + /** + * Deployment displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.Deployment + * @instance + */ + Deployment.prototype.displayName = ""; + + /** + * Deployment appVersion. + * @member {string} appVersion + * @memberof google.cloud.ces.v1beta.Deployment + * @instance + */ + Deployment.prototype.appVersion = ""; + + /** + * Deployment channelProfile. + * @member {google.cloud.ces.v1beta.IChannelProfile|null|undefined} channelProfile + * @memberof google.cloud.ces.v1beta.Deployment + * @instance + */ + Deployment.prototype.channelProfile = null; + + /** + * Deployment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.Deployment + * @instance + */ + Deployment.prototype.createTime = null; + + /** + * Deployment updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.Deployment + * @instance + */ + Deployment.prototype.updateTime = null; + + /** + * Deployment etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.Deployment + * @instance + */ + Deployment.prototype.etag = ""; + + /** + * Creates a new Deployment instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Deployment + * @static + * @param {google.cloud.ces.v1beta.IDeployment=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Deployment} Deployment instance + */ + Deployment.create = function create(properties) { + return new Deployment(properties); + }; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.ces.v1beta.Deployment.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Deployment + * @static + * @param {google.cloud.ces.v1beta.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.appVersion); + if (message.channelProfile != null && Object.hasOwnProperty.call(message, "channelProfile")) + $root.google.cloud.ces.v1beta.ChannelProfile.encode(message.channelProfile, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + 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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Deployment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Deployment + * @static + * @param {google.cloud.ces.v1beta.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Deployment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 8: { + message.displayName = reader.string(); + break; + } + case 2: { + message.appVersion = reader.string(); + break; + } + case 3: { + message.channelProfile = $root.google.cloud.ces.v1beta.ChannelProfile.decode(reader, reader.uint32()); + 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 7: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Deployment message. + * @function verify + * @memberof google.cloud.ces.v1beta.Deployment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Deployment.verify = function verify(message) { + if (typeof message !== "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.appVersion != null && message.hasOwnProperty("appVersion")) + if (!$util.isString(message.appVersion)) + return "appVersion: string expected"; + if (message.channelProfile != null && message.hasOwnProperty("channelProfile")) { + var error = $root.google.cloud.ces.v1beta.ChannelProfile.verify(message.channelProfile); + if (error) + return "channelProfile." + error; + } + 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Deployment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Deployment} Deployment + */ + Deployment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Deployment) + return object; + var message = new $root.google.cloud.ces.v1beta.Deployment(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.appVersion != null) + message.appVersion = String(object.appVersion); + if (object.channelProfile != null) { + if (typeof object.channelProfile !== "object") + throw TypeError(".google.cloud.ces.v1beta.Deployment.channelProfile: object expected"); + message.channelProfile = $root.google.cloud.ces.v1beta.ChannelProfile.fromObject(object.channelProfile); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Deployment.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.ces.v1beta.Deployment.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Deployment + * @static + * @param {google.cloud.ces.v1beta.Deployment} message Deployment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Deployment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.appVersion = ""; + object.channelProfile = null; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + object.appVersion = message.appVersion; + if (message.channelProfile != null && message.hasOwnProperty("channelProfile")) + object.channelProfile = $root.google.cloud.ces.v1beta.ChannelProfile.toObject(message.channelProfile, options); + 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this Deployment to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Deployment + * @instance + * @returns {Object.} JSON object + */ + Deployment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Deployment + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Deployment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Deployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Deployment"; + }; + + return Deployment; + })(); + + v1beta.AggregatedMetrics = (function() { + + /** + * Properties of an AggregatedMetrics. + * @memberof google.cloud.ces.v1beta + * @interface IAggregatedMetrics + * @property {Array.|null} [metricsByAppVersion] AggregatedMetrics metricsByAppVersion + */ + + /** + * Constructs a new AggregatedMetrics. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an AggregatedMetrics. + * @implements IAggregatedMetrics + * @constructor + * @param {google.cloud.ces.v1beta.IAggregatedMetrics=} [properties] Properties to set + */ + function AggregatedMetrics(properties) { + this.metricsByAppVersion = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedMetrics metricsByAppVersion. + * @member {Array.} metricsByAppVersion + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @instance + */ + AggregatedMetrics.prototype.metricsByAppVersion = $util.emptyArray; + + /** + * Creates a new AggregatedMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @static + * @param {google.cloud.ces.v1beta.IAggregatedMetrics=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AggregatedMetrics} AggregatedMetrics instance + */ + AggregatedMetrics.create = function create(properties) { + return new AggregatedMetrics(properties); + }; + + /** + * Encodes the specified AggregatedMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @static + * @param {google.cloud.ces.v1beta.IAggregatedMetrics} message AggregatedMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metricsByAppVersion != null && message.metricsByAppVersion.length) + for (var i = 0; i < message.metricsByAppVersion.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.encode(message.metricsByAppVersion[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AggregatedMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @static + * @param {google.cloud.ces.v1beta.IAggregatedMetrics} message AggregatedMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AggregatedMetrics} AggregatedMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedMetrics.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + if (!(message.metricsByAppVersion && message.metricsByAppVersion.length)) + message.metricsByAppVersion = []; + message.metricsByAppVersion.push($root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AggregatedMetrics} AggregatedMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedMetrics message. + * @function verify + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metricsByAppVersion != null && message.hasOwnProperty("metricsByAppVersion")) { + if (!Array.isArray(message.metricsByAppVersion)) + return "metricsByAppVersion: array expected"; + for (var i = 0; i < message.metricsByAppVersion.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.verify(message.metricsByAppVersion[i]); + if (error) + return "metricsByAppVersion." + error; + } + } + return null; + }; + + /** + * Creates an AggregatedMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AggregatedMetrics} AggregatedMetrics + */ + AggregatedMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics) + return object; + var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics(); + if (object.metricsByAppVersion) { + if (!Array.isArray(object.metricsByAppVersion)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.metricsByAppVersion: array expected"); + message.metricsByAppVersion = []; + for (var i = 0; i < object.metricsByAppVersion.length; ++i) { + if (typeof object.metricsByAppVersion[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.metricsByAppVersion: object expected"); + message.metricsByAppVersion[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.fromObject(object.metricsByAppVersion[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AggregatedMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics} message AggregatedMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metricsByAppVersion = []; + if (message.metricsByAppVersion && message.metricsByAppVersion.length) { + object.metricsByAppVersion = []; + for (var j = 0; j < message.metricsByAppVersion.length; ++j) + object.metricsByAppVersion[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.toObject(message.metricsByAppVersion[j], options); + } + return object; + }; + + /** + * Converts this AggregatedMetrics to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @instance + * @returns {Object.} JSON object + */ + AggregatedMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AggregatedMetrics + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AggregatedMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics"; + }; + + AggregatedMetrics.ToolMetrics = (function() { + + /** + * Properties of a ToolMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @interface IToolMetrics + * @property {string|null} [tool] ToolMetrics tool + * @property {number|null} [passCount] ToolMetrics passCount + * @property {number|null} [failCount] ToolMetrics failCount + */ + + /** + * Constructs a new ToolMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @classdesc Represents a ToolMetrics. + * @implements IToolMetrics + * @constructor + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics=} [properties] Properties to set + */ + function ToolMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolMetrics tool. + * @member {string} tool + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @instance + */ + ToolMetrics.prototype.tool = ""; + + /** + * ToolMetrics passCount. + * @member {number} passCount + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @instance + */ + ToolMetrics.prototype.passCount = 0; + + /** + * ToolMetrics failCount. + * @member {number} failCount + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @instance + */ + ToolMetrics.prototype.failCount = 0; + + /** + * Creates a new ToolMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics} ToolMetrics instance + */ + ToolMetrics.create = function create(properties) { + return new ToolMetrics(properties); + }; + + /** + * Encodes the specified ToolMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics} message ToolMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.passCount != null && Object.hasOwnProperty.call(message, "passCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.passCount); + if (message.failCount != null && Object.hasOwnProperty.call(message, "failCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.failCount); + return writer; + }; + + /** + * Encodes the specified ToolMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolMetrics} message ToolMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics} ToolMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolMetrics.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.passCount = reader.int32(); + break; + } + case 3: { + message.failCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics} ToolMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolMetrics message. + * @function verify + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tool != null && message.hasOwnProperty("tool")) + if (!$util.isString(message.tool)) + return "tool: string expected"; + if (message.passCount != null && message.hasOwnProperty("passCount")) + if (!$util.isInteger(message.passCount)) + return "passCount: integer expected"; + if (message.failCount != null && message.hasOwnProperty("failCount")) + if (!$util.isInteger(message.failCount)) + return "failCount: integer expected"; + return null; + }; + + /** + * Creates a ToolMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics} ToolMetrics + */ + ToolMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics) + return object; + var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.passCount != null) + message.passCount = object.passCount | 0; + if (object.failCount != null) + message.failCount = object.failCount | 0; + return message; + }; + + /** + * Creates a plain object from a ToolMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics} message ToolMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = ""; + object.passCount = 0; + object.failCount = 0; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = message.tool; + if (message.passCount != null && message.hasOwnProperty("passCount")) + object.passCount = message.passCount; + if (message.failCount != null && message.hasOwnProperty("failCount")) + object.failCount = message.failCount; + return object; + }; + + /** + * Converts this ToolMetrics to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @instance + * @returns {Object.} JSON object + */ + ToolMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolMetrics + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics"; + }; + + return ToolMetrics; + })(); + + AggregatedMetrics.TurnLatencyMetrics = (function() { + + /** + * Properties of a TurnLatencyMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @interface ITurnLatencyMetrics + * @property {google.protobuf.IDuration|null} [averageLatency] TurnLatencyMetrics averageLatency + */ + + /** + * Constructs a new TurnLatencyMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @classdesc Represents a TurnLatencyMetrics. + * @implements ITurnLatencyMetrics + * @constructor + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics=} [properties] Properties to set + */ + function TurnLatencyMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TurnLatencyMetrics averageLatency. + * @member {google.protobuf.IDuration|null|undefined} averageLatency + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @instance + */ + TurnLatencyMetrics.prototype.averageLatency = null; + + /** + * Creates a new TurnLatencyMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics} TurnLatencyMetrics instance + */ + TurnLatencyMetrics.create = function create(properties) { + return new TurnLatencyMetrics(properties); + }; + + /** + * Encodes the specified TurnLatencyMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics} message TurnLatencyMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TurnLatencyMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.averageLatency != null && Object.hasOwnProperty.call(message, "averageLatency")) + $root.google.protobuf.Duration.encode(message.averageLatency, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TurnLatencyMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ITurnLatencyMetrics} message TurnLatencyMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TurnLatencyMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TurnLatencyMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics} TurnLatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TurnLatencyMetrics.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.averageLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TurnLatencyMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics} TurnLatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TurnLatencyMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TurnLatencyMetrics message. + * @function verify + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TurnLatencyMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.averageLatency != null && message.hasOwnProperty("averageLatency")) { + var error = $root.google.protobuf.Duration.verify(message.averageLatency); + if (error) + return "averageLatency." + error; + } + return null; + }; + + /** + * Creates a TurnLatencyMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics} TurnLatencyMetrics + */ + TurnLatencyMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics) + return object; + var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics(); + if (object.averageLatency != null) { + if (typeof object.averageLatency !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.averageLatency: object expected"); + message.averageLatency = $root.google.protobuf.Duration.fromObject(object.averageLatency); + } + return message; + }; + + /** + * Creates a plain object from a TurnLatencyMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics} message TurnLatencyMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TurnLatencyMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.averageLatency = null; + if (message.averageLatency != null && message.hasOwnProperty("averageLatency")) + object.averageLatency = $root.google.protobuf.Duration.toObject(message.averageLatency, options); + return object; + }; + + /** + * Converts this TurnLatencyMetrics to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @instance + * @returns {Object.} JSON object + */ + TurnLatencyMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TurnLatencyMetrics + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TurnLatencyMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics"; + }; + + return TurnLatencyMetrics; + })(); + + AggregatedMetrics.ToolCallLatencyMetrics = (function() { + + /** + * Properties of a ToolCallLatencyMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @interface IToolCallLatencyMetrics + * @property {string|null} [tool] ToolCallLatencyMetrics tool + * @property {google.protobuf.IDuration|null} [averageLatency] ToolCallLatencyMetrics averageLatency + */ + + /** + * Constructs a new ToolCallLatencyMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @classdesc Represents a ToolCallLatencyMetrics. + * @implements IToolCallLatencyMetrics + * @constructor + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics=} [properties] Properties to set + */ + function ToolCallLatencyMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolCallLatencyMetrics tool. + * @member {string} tool + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @instance + */ + ToolCallLatencyMetrics.prototype.tool = ""; + + /** + * ToolCallLatencyMetrics averageLatency. + * @member {google.protobuf.IDuration|null|undefined} averageLatency + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @instance + */ + ToolCallLatencyMetrics.prototype.averageLatency = null; + + /** + * Creates a new ToolCallLatencyMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics} ToolCallLatencyMetrics instance + */ + ToolCallLatencyMetrics.create = function create(properties) { + return new ToolCallLatencyMetrics(properties); + }; + + /** + * Encodes the specified ToolCallLatencyMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics} message ToolCallLatencyMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCallLatencyMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.averageLatency != null && Object.hasOwnProperty.call(message, "averageLatency")) + $root.google.protobuf.Duration.encode(message.averageLatency, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolCallLatencyMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IToolCallLatencyMetrics} message ToolCallLatencyMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCallLatencyMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolCallLatencyMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics} ToolCallLatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCallLatencyMetrics.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.averageLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolCallLatencyMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics} ToolCallLatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCallLatencyMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolCallLatencyMetrics message. + * @function verify + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolCallLatencyMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tool != null && message.hasOwnProperty("tool")) + if (!$util.isString(message.tool)) + return "tool: string expected"; + if (message.averageLatency != null && message.hasOwnProperty("averageLatency")) { + var error = $root.google.protobuf.Duration.verify(message.averageLatency); + if (error) + return "averageLatency." + error; + } + return null; + }; + + /** + * Creates a ToolCallLatencyMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics} ToolCallLatencyMetrics + */ + ToolCallLatencyMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics) + return object; + var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.averageLatency != null) { + if (typeof object.averageLatency !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.averageLatency: object expected"); + message.averageLatency = $root.google.protobuf.Duration.fromObject(object.averageLatency); + } + return message; + }; + + /** + * Creates a plain object from a ToolCallLatencyMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics} message ToolCallLatencyMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolCallLatencyMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = ""; + object.averageLatency = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = message.tool; + if (message.averageLatency != null && message.hasOwnProperty("averageLatency")) + object.averageLatency = $root.google.protobuf.Duration.toObject(message.averageLatency, options); + return object; + }; + + /** + * Converts this ToolCallLatencyMetrics to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @instance + * @returns {Object.} JSON object + */ + ToolCallLatencyMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolCallLatencyMetrics + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolCallLatencyMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics"; + }; + + return ToolCallLatencyMetrics; + })(); + + AggregatedMetrics.SemanticSimilarityMetrics = (function() { + + /** + * Properties of a SemanticSimilarityMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @interface ISemanticSimilarityMetrics + * @property {number|null} [score] SemanticSimilarityMetrics score + */ + + /** + * Constructs a new SemanticSimilarityMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @classdesc Represents a SemanticSimilarityMetrics. + * @implements ISemanticSimilarityMetrics + * @constructor + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics=} [properties] Properties to set + */ + function SemanticSimilarityMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SemanticSimilarityMetrics score. + * @member {number} score + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @instance + */ + SemanticSimilarityMetrics.prototype.score = 0; + + /** + * Creates a new SemanticSimilarityMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics} SemanticSimilarityMetrics instance + */ + SemanticSimilarityMetrics.create = function create(properties) { + return new SemanticSimilarityMetrics(properties); + }; + + /** + * Encodes the specified SemanticSimilarityMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics} message SemanticSimilarityMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticSimilarityMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + return writer; + }; + + /** + * Encodes the specified SemanticSimilarityMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.ISemanticSimilarityMetrics} message SemanticSimilarityMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticSimilarityMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SemanticSimilarityMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics} SemanticSimilarityMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticSimilarityMetrics.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SemanticSimilarityMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics} SemanticSimilarityMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticSimilarityMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SemanticSimilarityMetrics message. + * @function verify + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SemanticSimilarityMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a SemanticSimilarityMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics} SemanticSimilarityMetrics + */ + SemanticSimilarityMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics) + return object; + var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics(); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a SemanticSimilarityMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics} message SemanticSimilarityMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SemanticSimilarityMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.score = 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this SemanticSimilarityMetrics to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @instance + * @returns {Object.} JSON object + */ + SemanticSimilarityMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SemanticSimilarityMetrics + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticSimilarityMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics"; + }; + + return SemanticSimilarityMetrics; + })(); + + AggregatedMetrics.HallucinationMetrics = (function() { + + /** + * Properties of a HallucinationMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @interface IHallucinationMetrics + * @property {number|null} [score] HallucinationMetrics score + */ + + /** + * Constructs a new HallucinationMetrics. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @classdesc Represents a HallucinationMetrics. + * @implements IHallucinationMetrics + * @constructor + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics=} [properties] Properties to set + */ + function HallucinationMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HallucinationMetrics score. + * @member {number} score + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @instance + */ + HallucinationMetrics.prototype.score = 0; + + /** + * Creates a new HallucinationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics} HallucinationMetrics instance + */ + HallucinationMetrics.create = function create(properties) { + return new HallucinationMetrics(properties); + }; + + /** + * Encodes the specified HallucinationMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics} message HallucinationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HallucinationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + return writer; + }; + + /** + * Encodes the specified HallucinationMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IHallucinationMetrics} message HallucinationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HallucinationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HallucinationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics} HallucinationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HallucinationMetrics.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HallucinationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics} HallucinationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HallucinationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HallucinationMetrics message. + * @function verify + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HallucinationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a HallucinationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics} HallucinationMetrics + */ + HallucinationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics) + return object; + var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics(); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a HallucinationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics} message HallucinationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HallucinationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.score = 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this HallucinationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @instance + * @returns {Object.} JSON object + */ + HallucinationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HallucinationMetrics + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HallucinationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics"; + }; + + return HallucinationMetrics; + })(); + + AggregatedMetrics.MetricsByAppVersion = (function() { + + /** + * Properties of a MetricsByAppVersion. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @interface IMetricsByAppVersion + * @property {string|null} [appVersionId] MetricsByAppVersion appVersionId + * @property {Array.|null} [toolMetrics] MetricsByAppVersion toolMetrics + * @property {Array.|null} [semanticSimilarityMetrics] MetricsByAppVersion semanticSimilarityMetrics + * @property {Array.|null} [hallucinationMetrics] MetricsByAppVersion hallucinationMetrics + * @property {Array.|null} [toolCallLatencyMetrics] MetricsByAppVersion toolCallLatencyMetrics + * @property {Array.|null} [turnLatencyMetrics] MetricsByAppVersion turnLatencyMetrics + * @property {number|null} [passCount] MetricsByAppVersion passCount + * @property {number|null} [failCount] MetricsByAppVersion failCount + * @property {Array.|null} [metricsByTurn] MetricsByAppVersion metricsByTurn + */ + + /** + * Constructs a new MetricsByAppVersion. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @classdesc Represents a MetricsByAppVersion. + * @implements IMetricsByAppVersion + * @constructor + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion=} [properties] Properties to set + */ + function MetricsByAppVersion(properties) { + this.toolMetrics = []; + this.semanticSimilarityMetrics = []; + this.hallucinationMetrics = []; + this.toolCallLatencyMetrics = []; + this.turnLatencyMetrics = []; + this.metricsByTurn = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricsByAppVersion appVersionId. + * @member {string} appVersionId + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + */ + MetricsByAppVersion.prototype.appVersionId = ""; + + /** + * MetricsByAppVersion toolMetrics. + * @member {Array.} toolMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + */ + MetricsByAppVersion.prototype.toolMetrics = $util.emptyArray; + + /** + * MetricsByAppVersion semanticSimilarityMetrics. + * @member {Array.} semanticSimilarityMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + */ + MetricsByAppVersion.prototype.semanticSimilarityMetrics = $util.emptyArray; + + /** + * MetricsByAppVersion hallucinationMetrics. + * @member {Array.} hallucinationMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + */ + MetricsByAppVersion.prototype.hallucinationMetrics = $util.emptyArray; + + /** + * MetricsByAppVersion toolCallLatencyMetrics. + * @member {Array.} toolCallLatencyMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + */ + MetricsByAppVersion.prototype.toolCallLatencyMetrics = $util.emptyArray; + + /** + * MetricsByAppVersion turnLatencyMetrics. + * @member {Array.} turnLatencyMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + */ + MetricsByAppVersion.prototype.turnLatencyMetrics = $util.emptyArray; + + /** + * MetricsByAppVersion passCount. + * @member {number} passCount + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + */ + MetricsByAppVersion.prototype.passCount = 0; + + /** + * MetricsByAppVersion failCount. + * @member {number} failCount + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + */ + MetricsByAppVersion.prototype.failCount = 0; + + /** + * MetricsByAppVersion metricsByTurn. + * @member {Array.} metricsByTurn + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + */ + MetricsByAppVersion.prototype.metricsByTurn = $util.emptyArray; + + /** + * Creates a new MetricsByAppVersion instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion} MetricsByAppVersion instance + */ + MetricsByAppVersion.create = function create(properties) { + return new MetricsByAppVersion(properties); + }; + + /** + * Encodes the specified MetricsByAppVersion message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion} message MetricsByAppVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricsByAppVersion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appVersionId != null && Object.hasOwnProperty.call(message, "appVersionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.appVersionId); + if (message.toolMetrics != null && message.toolMetrics.length) + for (var i = 0; i < message.toolMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.encode(message.toolMetrics[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.semanticSimilarityMetrics != null && message.semanticSimilarityMetrics.length) + for (var i = 0; i < message.semanticSimilarityMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.encode(message.semanticSimilarityMetrics[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.metricsByTurn != null && message.metricsByTurn.length) + for (var i = 0; i < message.metricsByTurn.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.encode(message.metricsByTurn[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.hallucinationMetrics != null && message.hallucinationMetrics.length) + for (var i = 0; i < message.hallucinationMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.encode(message.hallucinationMetrics[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.toolCallLatencyMetrics != null && message.toolCallLatencyMetrics.length) + for (var i = 0; i < message.toolCallLatencyMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.encode(message.toolCallLatencyMetrics[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.turnLatencyMetrics != null && message.turnLatencyMetrics.length) + for (var i = 0; i < message.turnLatencyMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.encode(message.turnLatencyMetrics[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.passCount != null && Object.hasOwnProperty.call(message, "passCount")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.passCount); + if (message.failCount != null && Object.hasOwnProperty.call(message, "failCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.failCount); + return writer; + }; + + /** + * Encodes the specified MetricsByAppVersion message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByAppVersion} message MetricsByAppVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricsByAppVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricsByAppVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion} MetricsByAppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricsByAppVersion.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.appVersionId = reader.string(); + break; + } + case 2: { + if (!(message.toolMetrics && message.toolMetrics.length)) + message.toolMetrics = []; + message.toolMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.semanticSimilarityMetrics && message.semanticSimilarityMetrics.length)) + message.semanticSimilarityMetrics = []; + message.semanticSimilarityMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.hallucinationMetrics && message.hallucinationMetrics.length)) + message.hallucinationMetrics = []; + message.hallucinationMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.toolCallLatencyMetrics && message.toolCallLatencyMetrics.length)) + message.toolCallLatencyMetrics = []; + message.toolCallLatencyMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.turnLatencyMetrics && message.turnLatencyMetrics.length)) + message.turnLatencyMetrics = []; + message.turnLatencyMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.decode(reader, reader.uint32())); + break; + } + case 8: { + message.passCount = reader.int32(); + break; + } + case 9: { + message.failCount = reader.int32(); + break; + } + case 4: { + if (!(message.metricsByTurn && message.metricsByTurn.length)) + message.metricsByTurn = []; + message.metricsByTurn.push($root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricsByAppVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion} MetricsByAppVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricsByAppVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricsByAppVersion message. + * @function verify + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricsByAppVersion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.appVersionId != null && message.hasOwnProperty("appVersionId")) + if (!$util.isString(message.appVersionId)) + return "appVersionId: string expected"; + if (message.toolMetrics != null && message.hasOwnProperty("toolMetrics")) { + if (!Array.isArray(message.toolMetrics)) + return "toolMetrics: array expected"; + for (var i = 0; i < message.toolMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.verify(message.toolMetrics[i]); + if (error) + return "toolMetrics." + error; + } + } + if (message.semanticSimilarityMetrics != null && message.hasOwnProperty("semanticSimilarityMetrics")) { + if (!Array.isArray(message.semanticSimilarityMetrics)) + return "semanticSimilarityMetrics: array expected"; + for (var i = 0; i < message.semanticSimilarityMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.verify(message.semanticSimilarityMetrics[i]); + if (error) + return "semanticSimilarityMetrics." + error; + } + } + if (message.hallucinationMetrics != null && message.hasOwnProperty("hallucinationMetrics")) { + if (!Array.isArray(message.hallucinationMetrics)) + return "hallucinationMetrics: array expected"; + for (var i = 0; i < message.hallucinationMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.verify(message.hallucinationMetrics[i]); + if (error) + return "hallucinationMetrics." + error; + } + } + if (message.toolCallLatencyMetrics != null && message.hasOwnProperty("toolCallLatencyMetrics")) { + if (!Array.isArray(message.toolCallLatencyMetrics)) + return "toolCallLatencyMetrics: array expected"; + for (var i = 0; i < message.toolCallLatencyMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.verify(message.toolCallLatencyMetrics[i]); + if (error) + return "toolCallLatencyMetrics." + error; + } + } + if (message.turnLatencyMetrics != null && message.hasOwnProperty("turnLatencyMetrics")) { + if (!Array.isArray(message.turnLatencyMetrics)) + return "turnLatencyMetrics: array expected"; + for (var i = 0; i < message.turnLatencyMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.verify(message.turnLatencyMetrics[i]); + if (error) + return "turnLatencyMetrics." + error; + } + } + if (message.passCount != null && message.hasOwnProperty("passCount")) + if (!$util.isInteger(message.passCount)) + return "passCount: integer expected"; + if (message.failCount != null && message.hasOwnProperty("failCount")) + if (!$util.isInteger(message.failCount)) + return "failCount: integer expected"; + if (message.metricsByTurn != null && message.hasOwnProperty("metricsByTurn")) { + if (!Array.isArray(message.metricsByTurn)) + return "metricsByTurn: array expected"; + for (var i = 0; i < message.metricsByTurn.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.verify(message.metricsByTurn[i]); + if (error) + return "metricsByTurn." + error; + } + } + return null; + }; + + /** + * Creates a MetricsByAppVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion} MetricsByAppVersion + */ + MetricsByAppVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion) + return object; + var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion(); + if (object.appVersionId != null) + message.appVersionId = String(object.appVersionId); + if (object.toolMetrics) { + if (!Array.isArray(object.toolMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.toolMetrics: array expected"); + message.toolMetrics = []; + for (var i = 0; i < object.toolMetrics.length; ++i) { + if (typeof object.toolMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.toolMetrics: object expected"); + message.toolMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.fromObject(object.toolMetrics[i]); + } + } + if (object.semanticSimilarityMetrics) { + if (!Array.isArray(object.semanticSimilarityMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.semanticSimilarityMetrics: array expected"); + message.semanticSimilarityMetrics = []; + for (var i = 0; i < object.semanticSimilarityMetrics.length; ++i) { + if (typeof object.semanticSimilarityMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.semanticSimilarityMetrics: object expected"); + message.semanticSimilarityMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.fromObject(object.semanticSimilarityMetrics[i]); + } + } + if (object.hallucinationMetrics) { + if (!Array.isArray(object.hallucinationMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.hallucinationMetrics: array expected"); + message.hallucinationMetrics = []; + for (var i = 0; i < object.hallucinationMetrics.length; ++i) { + if (typeof object.hallucinationMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.hallucinationMetrics: object expected"); + message.hallucinationMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.fromObject(object.hallucinationMetrics[i]); + } + } + if (object.toolCallLatencyMetrics) { + if (!Array.isArray(object.toolCallLatencyMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.toolCallLatencyMetrics: array expected"); + message.toolCallLatencyMetrics = []; + for (var i = 0; i < object.toolCallLatencyMetrics.length; ++i) { + if (typeof object.toolCallLatencyMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.toolCallLatencyMetrics: object expected"); + message.toolCallLatencyMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.fromObject(object.toolCallLatencyMetrics[i]); + } + } + if (object.turnLatencyMetrics) { + if (!Array.isArray(object.turnLatencyMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.turnLatencyMetrics: array expected"); + message.turnLatencyMetrics = []; + for (var i = 0; i < object.turnLatencyMetrics.length; ++i) { + if (typeof object.turnLatencyMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.turnLatencyMetrics: object expected"); + message.turnLatencyMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.fromObject(object.turnLatencyMetrics[i]); + } + } + if (object.passCount != null) + message.passCount = object.passCount | 0; + if (object.failCount != null) + message.failCount = object.failCount | 0; + if (object.metricsByTurn) { + if (!Array.isArray(object.metricsByTurn)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.metricsByTurn: array expected"); + message.metricsByTurn = []; + for (var i = 0; i < object.metricsByTurn.length; ++i) { + if (typeof object.metricsByTurn[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion.metricsByTurn: object expected"); + message.metricsByTurn[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.fromObject(object.metricsByTurn[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MetricsByAppVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion} message MetricsByAppVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricsByAppVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.toolMetrics = []; + object.semanticSimilarityMetrics = []; + object.metricsByTurn = []; + object.hallucinationMetrics = []; + object.toolCallLatencyMetrics = []; + object.turnLatencyMetrics = []; + } + if (options.defaults) { + object.appVersionId = ""; + object.passCount = 0; + object.failCount = 0; + } + if (message.appVersionId != null && message.hasOwnProperty("appVersionId")) + object.appVersionId = message.appVersionId; + if (message.toolMetrics && message.toolMetrics.length) { + object.toolMetrics = []; + for (var j = 0; j < message.toolMetrics.length; ++j) + object.toolMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.toObject(message.toolMetrics[j], options); + } + if (message.semanticSimilarityMetrics && message.semanticSimilarityMetrics.length) { + object.semanticSimilarityMetrics = []; + for (var j = 0; j < message.semanticSimilarityMetrics.length; ++j) + object.semanticSimilarityMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.toObject(message.semanticSimilarityMetrics[j], options); + } + if (message.metricsByTurn && message.metricsByTurn.length) { + object.metricsByTurn = []; + for (var j = 0; j < message.metricsByTurn.length; ++j) + object.metricsByTurn[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.toObject(message.metricsByTurn[j], options); + } + if (message.hallucinationMetrics && message.hallucinationMetrics.length) { + object.hallucinationMetrics = []; + for (var j = 0; j < message.hallucinationMetrics.length; ++j) + object.hallucinationMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.toObject(message.hallucinationMetrics[j], options); + } + if (message.toolCallLatencyMetrics && message.toolCallLatencyMetrics.length) { + object.toolCallLatencyMetrics = []; + for (var j = 0; j < message.toolCallLatencyMetrics.length; ++j) + object.toolCallLatencyMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.toObject(message.toolCallLatencyMetrics[j], options); + } + if (message.turnLatencyMetrics && message.turnLatencyMetrics.length) { + object.turnLatencyMetrics = []; + for (var j = 0; j < message.turnLatencyMetrics.length; ++j) + object.turnLatencyMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.toObject(message.turnLatencyMetrics[j], options); + } + if (message.passCount != null && message.hasOwnProperty("passCount")) + object.passCount = message.passCount; + if (message.failCount != null && message.hasOwnProperty("failCount")) + object.failCount = message.failCount; + return object; + }; + + /** + * Converts this MetricsByAppVersion to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @instance + * @returns {Object.} JSON object + */ + MetricsByAppVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricsByAppVersion + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricsByAppVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.MetricsByAppVersion"; + }; + + return MetricsByAppVersion; + })(); + + AggregatedMetrics.MetricsByTurn = (function() { + + /** + * Properties of a MetricsByTurn. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @interface IMetricsByTurn + * @property {number|null} [turnIndex] MetricsByTurn turnIndex + * @property {Array.|null} [toolMetrics] MetricsByTurn toolMetrics + * @property {Array.|null} [semanticSimilarityMetrics] MetricsByTurn semanticSimilarityMetrics + * @property {Array.|null} [hallucinationMetrics] MetricsByTurn hallucinationMetrics + * @property {Array.|null} [toolCallLatencyMetrics] MetricsByTurn toolCallLatencyMetrics + * @property {Array.|null} [turnLatencyMetrics] MetricsByTurn turnLatencyMetrics + */ + + /** + * Constructs a new MetricsByTurn. + * @memberof google.cloud.ces.v1beta.AggregatedMetrics + * @classdesc Represents a MetricsByTurn. + * @implements IMetricsByTurn + * @constructor + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn=} [properties] Properties to set + */ + function MetricsByTurn(properties) { + this.toolMetrics = []; + this.semanticSimilarityMetrics = []; + this.hallucinationMetrics = []; + this.toolCallLatencyMetrics = []; + this.turnLatencyMetrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricsByTurn turnIndex. + * @member {number} turnIndex + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @instance + */ + MetricsByTurn.prototype.turnIndex = 0; + + /** + * MetricsByTurn toolMetrics. + * @member {Array.} toolMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @instance + */ + MetricsByTurn.prototype.toolMetrics = $util.emptyArray; + + /** + * MetricsByTurn semanticSimilarityMetrics. + * @member {Array.} semanticSimilarityMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @instance + */ + MetricsByTurn.prototype.semanticSimilarityMetrics = $util.emptyArray; + + /** + * MetricsByTurn hallucinationMetrics. + * @member {Array.} hallucinationMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @instance + */ + MetricsByTurn.prototype.hallucinationMetrics = $util.emptyArray; + + /** + * MetricsByTurn toolCallLatencyMetrics. + * @member {Array.} toolCallLatencyMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @instance + */ + MetricsByTurn.prototype.toolCallLatencyMetrics = $util.emptyArray; + + /** + * MetricsByTurn turnLatencyMetrics. + * @member {Array.} turnLatencyMetrics + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @instance + */ + MetricsByTurn.prototype.turnLatencyMetrics = $util.emptyArray; + + /** + * Creates a new MetricsByTurn instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn} MetricsByTurn instance + */ + MetricsByTurn.create = function create(properties) { + return new MetricsByTurn(properties); + }; + + /** + * Encodes the specified MetricsByTurn message. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn} message MetricsByTurn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricsByTurn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.turnIndex != null && Object.hasOwnProperty.call(message, "turnIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.turnIndex); + if (message.toolMetrics != null && message.toolMetrics.length) + for (var i = 0; i < message.toolMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.encode(message.toolMetrics[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.semanticSimilarityMetrics != null && message.semanticSimilarityMetrics.length) + for (var i = 0; i < message.semanticSimilarityMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.encode(message.semanticSimilarityMetrics[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.hallucinationMetrics != null && message.hallucinationMetrics.length) + for (var i = 0; i < message.hallucinationMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.encode(message.hallucinationMetrics[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.toolCallLatencyMetrics != null && message.toolCallLatencyMetrics.length) + for (var i = 0; i < message.toolCallLatencyMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.encode(message.toolCallLatencyMetrics[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.turnLatencyMetrics != null && message.turnLatencyMetrics.length) + for (var i = 0; i < message.turnLatencyMetrics.length; ++i) + $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.encode(message.turnLatencyMetrics[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MetricsByTurn message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.IMetricsByTurn} message MetricsByTurn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricsByTurn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricsByTurn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn} MetricsByTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricsByTurn.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.turnIndex = reader.int32(); + break; + } + case 2: { + if (!(message.toolMetrics && message.toolMetrics.length)) + message.toolMetrics = []; + message.toolMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.semanticSimilarityMetrics && message.semanticSimilarityMetrics.length)) + message.semanticSimilarityMetrics = []; + message.semanticSimilarityMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.hallucinationMetrics && message.hallucinationMetrics.length)) + message.hallucinationMetrics = []; + message.hallucinationMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.toolCallLatencyMetrics && message.toolCallLatencyMetrics.length)) + message.toolCallLatencyMetrics = []; + message.toolCallLatencyMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.turnLatencyMetrics && message.turnLatencyMetrics.length)) + message.turnLatencyMetrics = []; + message.turnLatencyMetrics.push($root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricsByTurn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn} MetricsByTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricsByTurn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricsByTurn message. + * @function verify + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricsByTurn.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.turnIndex != null && message.hasOwnProperty("turnIndex")) + if (!$util.isInteger(message.turnIndex)) + return "turnIndex: integer expected"; + if (message.toolMetrics != null && message.hasOwnProperty("toolMetrics")) { + if (!Array.isArray(message.toolMetrics)) + return "toolMetrics: array expected"; + for (var i = 0; i < message.toolMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.verify(message.toolMetrics[i]); + if (error) + return "toolMetrics." + error; + } + } + if (message.semanticSimilarityMetrics != null && message.hasOwnProperty("semanticSimilarityMetrics")) { + if (!Array.isArray(message.semanticSimilarityMetrics)) + return "semanticSimilarityMetrics: array expected"; + for (var i = 0; i < message.semanticSimilarityMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.verify(message.semanticSimilarityMetrics[i]); + if (error) + return "semanticSimilarityMetrics." + error; + } + } + if (message.hallucinationMetrics != null && message.hasOwnProperty("hallucinationMetrics")) { + if (!Array.isArray(message.hallucinationMetrics)) + return "hallucinationMetrics: array expected"; + for (var i = 0; i < message.hallucinationMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.verify(message.hallucinationMetrics[i]); + if (error) + return "hallucinationMetrics." + error; + } + } + if (message.toolCallLatencyMetrics != null && message.hasOwnProperty("toolCallLatencyMetrics")) { + if (!Array.isArray(message.toolCallLatencyMetrics)) + return "toolCallLatencyMetrics: array expected"; + for (var i = 0; i < message.toolCallLatencyMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.verify(message.toolCallLatencyMetrics[i]); + if (error) + return "toolCallLatencyMetrics." + error; + } + } + if (message.turnLatencyMetrics != null && message.hasOwnProperty("turnLatencyMetrics")) { + if (!Array.isArray(message.turnLatencyMetrics)) + return "turnLatencyMetrics: array expected"; + for (var i = 0; i < message.turnLatencyMetrics.length; ++i) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.verify(message.turnLatencyMetrics[i]); + if (error) + return "turnLatencyMetrics." + error; + } + } + return null; + }; + + /** + * Creates a MetricsByTurn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn} MetricsByTurn + */ + MetricsByTurn.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn) + return object; + var message = new $root.google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn(); + if (object.turnIndex != null) + message.turnIndex = object.turnIndex | 0; + if (object.toolMetrics) { + if (!Array.isArray(object.toolMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.toolMetrics: array expected"); + message.toolMetrics = []; + for (var i = 0; i < object.toolMetrics.length; ++i) { + if (typeof object.toolMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.toolMetrics: object expected"); + message.toolMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.fromObject(object.toolMetrics[i]); + } + } + if (object.semanticSimilarityMetrics) { + if (!Array.isArray(object.semanticSimilarityMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.semanticSimilarityMetrics: array expected"); + message.semanticSimilarityMetrics = []; + for (var i = 0; i < object.semanticSimilarityMetrics.length; ++i) { + if (typeof object.semanticSimilarityMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.semanticSimilarityMetrics: object expected"); + message.semanticSimilarityMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.fromObject(object.semanticSimilarityMetrics[i]); + } + } + if (object.hallucinationMetrics) { + if (!Array.isArray(object.hallucinationMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.hallucinationMetrics: array expected"); + message.hallucinationMetrics = []; + for (var i = 0; i < object.hallucinationMetrics.length; ++i) { + if (typeof object.hallucinationMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.hallucinationMetrics: object expected"); + message.hallucinationMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.fromObject(object.hallucinationMetrics[i]); + } + } + if (object.toolCallLatencyMetrics) { + if (!Array.isArray(object.toolCallLatencyMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.toolCallLatencyMetrics: array expected"); + message.toolCallLatencyMetrics = []; + for (var i = 0; i < object.toolCallLatencyMetrics.length; ++i) { + if (typeof object.toolCallLatencyMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.toolCallLatencyMetrics: object expected"); + message.toolCallLatencyMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.fromObject(object.toolCallLatencyMetrics[i]); + } + } + if (object.turnLatencyMetrics) { + if (!Array.isArray(object.turnLatencyMetrics)) + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.turnLatencyMetrics: array expected"); + message.turnLatencyMetrics = []; + for (var i = 0; i < object.turnLatencyMetrics.length; ++i) { + if (typeof object.turnLatencyMetrics[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn.turnLatencyMetrics: object expected"); + message.turnLatencyMetrics[i] = $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.fromObject(object.turnLatencyMetrics[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MetricsByTurn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @static + * @param {google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn} message MetricsByTurn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricsByTurn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.toolMetrics = []; + object.semanticSimilarityMetrics = []; + object.hallucinationMetrics = []; + object.toolCallLatencyMetrics = []; + object.turnLatencyMetrics = []; + } + if (options.defaults) + object.turnIndex = 0; + if (message.turnIndex != null && message.hasOwnProperty("turnIndex")) + object.turnIndex = message.turnIndex; + if (message.toolMetrics && message.toolMetrics.length) { + object.toolMetrics = []; + for (var j = 0; j < message.toolMetrics.length; ++j) + object.toolMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolMetrics.toObject(message.toolMetrics[j], options); + } + if (message.semanticSimilarityMetrics && message.semanticSimilarityMetrics.length) { + object.semanticSimilarityMetrics = []; + for (var j = 0; j < message.semanticSimilarityMetrics.length; ++j) + object.semanticSimilarityMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.SemanticSimilarityMetrics.toObject(message.semanticSimilarityMetrics[j], options); + } + if (message.hallucinationMetrics && message.hallucinationMetrics.length) { + object.hallucinationMetrics = []; + for (var j = 0; j < message.hallucinationMetrics.length; ++j) + object.hallucinationMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.HallucinationMetrics.toObject(message.hallucinationMetrics[j], options); + } + if (message.toolCallLatencyMetrics && message.toolCallLatencyMetrics.length) { + object.toolCallLatencyMetrics = []; + for (var j = 0; j < message.toolCallLatencyMetrics.length; ++j) + object.toolCallLatencyMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.ToolCallLatencyMetrics.toObject(message.toolCallLatencyMetrics[j], options); + } + if (message.turnLatencyMetrics && message.turnLatencyMetrics.length) { + object.turnLatencyMetrics = []; + for (var j = 0; j < message.turnLatencyMetrics.length; ++j) + object.turnLatencyMetrics[j] = $root.google.cloud.ces.v1beta.AggregatedMetrics.TurnLatencyMetrics.toObject(message.turnLatencyMetrics[j], options); + } + return object; + }; + + /** + * Converts this MetricsByTurn to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @instance + * @returns {Object.} JSON object + */ + MetricsByTurn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricsByTurn + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricsByTurn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.AggregatedMetrics.MetricsByTurn"; + }; + + return MetricsByTurn; + })(); + + return AggregatedMetrics; + })(); + + v1beta.Evaluation = (function() { + + /** + * Properties of an Evaluation. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluation + * @property {google.cloud.ces.v1beta.Evaluation.IGolden|null} [golden] Evaluation golden + * @property {google.cloud.ces.v1beta.Evaluation.IScenario|null} [scenario] Evaluation scenario + * @property {string|null} [name] Evaluation name + * @property {string|null} [displayName] Evaluation displayName + * @property {string|null} [description] Evaluation description + * @property {Array.|null} [tags] Evaluation tags + * @property {Array.|null} [evaluationDatasets] Evaluation evaluationDatasets + * @property {google.protobuf.ITimestamp|null} [createTime] Evaluation createTime + * @property {string|null} [createdBy] Evaluation createdBy + * @property {google.protobuf.ITimestamp|null} [updateTime] Evaluation updateTime + * @property {string|null} [lastUpdatedBy] Evaluation lastUpdatedBy + * @property {Array.|null} [evaluationRuns] Evaluation evaluationRuns + * @property {string|null} [etag] Evaluation etag + * @property {google.cloud.ces.v1beta.IAggregatedMetrics|null} [aggregatedMetrics] Evaluation aggregatedMetrics + * @property {google.cloud.ces.v1beta.IEvaluationResult|null} [lastCompletedResult] Evaluation lastCompletedResult + * @property {boolean|null} [invalid] Evaluation invalid + * @property {Array.|null} [lastTenResults] Evaluation lastTenResults + */ + + /** + * Constructs a new Evaluation. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an Evaluation. + * @implements IEvaluation + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluation=} [properties] Properties to set + */ + function Evaluation(properties) { + this.tags = []; + this.evaluationDatasets = []; + this.evaluationRuns = []; + this.lastTenResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Evaluation golden. + * @member {google.cloud.ces.v1beta.Evaluation.IGolden|null|undefined} golden + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.golden = null; + + /** + * Evaluation scenario. + * @member {google.cloud.ces.v1beta.Evaluation.IScenario|null|undefined} scenario + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.scenario = null; + + /** + * Evaluation name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.name = ""; + + /** + * Evaluation displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.displayName = ""; + + /** + * Evaluation description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.description = ""; + + /** + * Evaluation tags. + * @member {Array.} tags + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.tags = $util.emptyArray; + + /** + * Evaluation evaluationDatasets. + * @member {Array.} evaluationDatasets + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.evaluationDatasets = $util.emptyArray; + + /** + * Evaluation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.createTime = null; + + /** + * Evaluation createdBy. + * @member {string} createdBy + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.createdBy = ""; + + /** + * Evaluation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.updateTime = null; + + /** + * Evaluation lastUpdatedBy. + * @member {string} lastUpdatedBy + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.lastUpdatedBy = ""; + + /** + * Evaluation evaluationRuns. + * @member {Array.} evaluationRuns + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.evaluationRuns = $util.emptyArray; + + /** + * Evaluation etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.etag = ""; + + /** + * Evaluation aggregatedMetrics. + * @member {google.cloud.ces.v1beta.IAggregatedMetrics|null|undefined} aggregatedMetrics + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.aggregatedMetrics = null; + + /** + * Evaluation lastCompletedResult. + * @member {google.cloud.ces.v1beta.IEvaluationResult|null|undefined} lastCompletedResult + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.lastCompletedResult = null; + + /** + * Evaluation invalid. + * @member {boolean} invalid + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.invalid = false; + + /** + * Evaluation lastTenResults. + * @member {Array.} lastTenResults + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Evaluation.prototype.lastTenResults = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Evaluation inputs. + * @member {"golden"|"scenario"|undefined} inputs + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + */ + Object.defineProperty(Evaluation.prototype, "inputs", { + get: $util.oneOfGetter($oneOfFields = ["golden", "scenario"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Evaluation instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Evaluation + * @static + * @param {google.cloud.ces.v1beta.IEvaluation=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Evaluation} Evaluation instance + */ + Evaluation.create = function create(properties) { + return new Evaluation(properties); + }; + + /** + * Encodes the specified Evaluation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Evaluation + * @static + * @param {google.cloud.ces.v1beta.IEvaluation} message Evaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evaluation.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tags[i]); + if (message.evaluationDatasets != null && message.evaluationDatasets.length) + for (var i = 0; i < message.evaluationDatasets.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.evaluationDatasets[i]); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.etag); + if (message.golden != null && Object.hasOwnProperty.call(message, "golden")) + $root.google.cloud.ces.v1beta.Evaluation.Golden.encode(message.golden, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.scenario != null && Object.hasOwnProperty.call(message, "scenario")) + $root.google.cloud.ces.v1beta.Evaluation.Scenario.encode(message.scenario, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.createdBy != null && Object.hasOwnProperty.call(message, "createdBy")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.createdBy); + if (message.lastUpdatedBy != null && Object.hasOwnProperty.call(message, "lastUpdatedBy")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.lastUpdatedBy); + if (message.evaluationRuns != null && message.evaluationRuns.length) + for (var i = 0; i < message.evaluationRuns.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.evaluationRuns[i]); + if (message.aggregatedMetrics != null && Object.hasOwnProperty.call(message, "aggregatedMetrics")) + $root.google.cloud.ces.v1beta.AggregatedMetrics.encode(message.aggregatedMetrics, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.lastCompletedResult != null && Object.hasOwnProperty.call(message, "lastCompletedResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.encode(message.lastCompletedResult, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.invalid != null && Object.hasOwnProperty.call(message, "invalid")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.invalid); + if (message.lastTenResults != null && message.lastTenResults.length) + for (var i = 0; i < message.lastTenResults.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.encode(message.lastTenResults[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Evaluation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation + * @static + * @param {google.cloud.ces.v1beta.IEvaluation} message Evaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evaluation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Evaluation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Evaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Evaluation} Evaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evaluation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 11: { + message.golden = $root.google.cloud.ces.v1beta.Evaluation.Golden.decode(reader, reader.uint32()); + break; + } + case 12: { + message.scenario = $root.google.cloud.ces.v1beta.Evaluation.Scenario.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + case 5: { + if (!(message.evaluationDatasets && message.evaluationDatasets.length)) + message.evaluationDatasets = []; + message.evaluationDatasets.push(reader.string()); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.createdBy = reader.string(); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.lastUpdatedBy = reader.string(); + break; + } + case 15: { + if (!(message.evaluationRuns && message.evaluationRuns.length)) + message.evaluationRuns = []; + message.evaluationRuns.push(reader.string()); + break; + } + case 10: { + message.etag = reader.string(); + break; + } + case 16: { + message.aggregatedMetrics = $root.google.cloud.ces.v1beta.AggregatedMetrics.decode(reader, reader.uint32()); + break; + } + case 17: { + message.lastCompletedResult = $root.google.cloud.ces.v1beta.EvaluationResult.decode(reader, reader.uint32()); + break; + } + case 18: { + message.invalid = reader.bool(); + break; + } + case 19: { + if (!(message.lastTenResults && message.lastTenResults.length)) + message.lastTenResults = []; + message.lastTenResults.push($root.google.cloud.ces.v1beta.EvaluationResult.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Evaluation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Evaluation} Evaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evaluation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Evaluation message. + * @function verify + * @memberof google.cloud.ces.v1beta.Evaluation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Evaluation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.golden != null && message.hasOwnProperty("golden")) { + properties.inputs = 1; + { + var error = $root.google.cloud.ces.v1beta.Evaluation.Golden.verify(message.golden); + if (error) + return "golden." + error; + } + } + if (message.scenario != null && message.hasOwnProperty("scenario")) { + if (properties.inputs === 1) + return "inputs: multiple values"; + properties.inputs = 1; + { + var error = $root.google.cloud.ces.v1beta.Evaluation.Scenario.verify(message.scenario); + if (error) + return "scenario." + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + if (message.evaluationDatasets != null && message.hasOwnProperty("evaluationDatasets")) { + if (!Array.isArray(message.evaluationDatasets)) + return "evaluationDatasets: array expected"; + for (var i = 0; i < message.evaluationDatasets.length; ++i) + if (!$util.isString(message.evaluationDatasets[i])) + return "evaluationDatasets: 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.createdBy != null && message.hasOwnProperty("createdBy")) + if (!$util.isString(message.createdBy)) + return "createdBy: string expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.lastUpdatedBy != null && message.hasOwnProperty("lastUpdatedBy")) + if (!$util.isString(message.lastUpdatedBy)) + return "lastUpdatedBy: string expected"; + if (message.evaluationRuns != null && message.hasOwnProperty("evaluationRuns")) { + if (!Array.isArray(message.evaluationRuns)) + return "evaluationRuns: array expected"; + for (var i = 0; i < message.evaluationRuns.length; ++i) + if (!$util.isString(message.evaluationRuns[i])) + return "evaluationRuns: string[] expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.aggregatedMetrics != null && message.hasOwnProperty("aggregatedMetrics")) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.verify(message.aggregatedMetrics); + if (error) + return "aggregatedMetrics." + error; + } + if (message.lastCompletedResult != null && message.hasOwnProperty("lastCompletedResult")) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.verify(message.lastCompletedResult); + if (error) + return "lastCompletedResult." + error; + } + if (message.invalid != null && message.hasOwnProperty("invalid")) + if (typeof message.invalid !== "boolean") + return "invalid: boolean expected"; + if (message.lastTenResults != null && message.hasOwnProperty("lastTenResults")) { + if (!Array.isArray(message.lastTenResults)) + return "lastTenResults: array expected"; + for (var i = 0; i < message.lastTenResults.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.verify(message.lastTenResults[i]); + if (error) + return "lastTenResults." + error; + } + } + return null; + }; + + /** + * Creates an Evaluation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Evaluation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Evaluation} Evaluation + */ + Evaluation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Evaluation) + return object; + var message = new $root.google.cloud.ces.v1beta.Evaluation(); + if (object.golden != null) { + if (typeof object.golden !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.golden: object expected"); + message.golden = $root.google.cloud.ces.v1beta.Evaluation.Golden.fromObject(object.golden); + } + if (object.scenario != null) { + if (typeof object.scenario !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.scenario: object expected"); + message.scenario = $root.google.cloud.ces.v1beta.Evaluation.Scenario.fromObject(object.scenario); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.evaluationDatasets) { + if (!Array.isArray(object.evaluationDatasets)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.evaluationDatasets: array expected"); + message.evaluationDatasets = []; + for (var i = 0; i < object.evaluationDatasets.length; ++i) + message.evaluationDatasets[i] = String(object.evaluationDatasets[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.createdBy != null) + message.createdBy = String(object.createdBy); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.lastUpdatedBy != null) + message.lastUpdatedBy = String(object.lastUpdatedBy); + if (object.evaluationRuns) { + if (!Array.isArray(object.evaluationRuns)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.evaluationRuns: array expected"); + message.evaluationRuns = []; + for (var i = 0; i < object.evaluationRuns.length; ++i) + message.evaluationRuns[i] = String(object.evaluationRuns[i]); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.aggregatedMetrics != null) { + if (typeof object.aggregatedMetrics !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.aggregatedMetrics: object expected"); + message.aggregatedMetrics = $root.google.cloud.ces.v1beta.AggregatedMetrics.fromObject(object.aggregatedMetrics); + } + if (object.lastCompletedResult != null) { + if (typeof object.lastCompletedResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.lastCompletedResult: object expected"); + message.lastCompletedResult = $root.google.cloud.ces.v1beta.EvaluationResult.fromObject(object.lastCompletedResult); + } + if (object.invalid != null) + message.invalid = Boolean(object.invalid); + if (object.lastTenResults) { + if (!Array.isArray(object.lastTenResults)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.lastTenResults: array expected"); + message.lastTenResults = []; + for (var i = 0; i < object.lastTenResults.length; ++i) { + if (typeof object.lastTenResults[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.lastTenResults: object expected"); + message.lastTenResults[i] = $root.google.cloud.ces.v1beta.EvaluationResult.fromObject(object.lastTenResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Evaluation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Evaluation + * @static + * @param {google.cloud.ces.v1beta.Evaluation} message Evaluation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Evaluation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tags = []; + object.evaluationDatasets = []; + object.evaluationRuns = []; + object.lastTenResults = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.createdBy = ""; + object.lastUpdatedBy = ""; + object.aggregatedMetrics = null; + object.lastCompletedResult = null; + object.invalid = 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.evaluationDatasets && message.evaluationDatasets.length) { + object.evaluationDatasets = []; + for (var j = 0; j < message.evaluationDatasets.length; ++j) + object.evaluationDatasets[j] = message.evaluationDatasets[j]; + } + 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.golden != null && message.hasOwnProperty("golden")) { + object.golden = $root.google.cloud.ces.v1beta.Evaluation.Golden.toObject(message.golden, options); + if (options.oneofs) + object.inputs = "golden"; + } + if (message.scenario != null && message.hasOwnProperty("scenario")) { + object.scenario = $root.google.cloud.ces.v1beta.Evaluation.Scenario.toObject(message.scenario, options); + if (options.oneofs) + object.inputs = "scenario"; + } + if (message.createdBy != null && message.hasOwnProperty("createdBy")) + object.createdBy = message.createdBy; + if (message.lastUpdatedBy != null && message.hasOwnProperty("lastUpdatedBy")) + object.lastUpdatedBy = message.lastUpdatedBy; + if (message.evaluationRuns && message.evaluationRuns.length) { + object.evaluationRuns = []; + for (var j = 0; j < message.evaluationRuns.length; ++j) + object.evaluationRuns[j] = message.evaluationRuns[j]; + } + if (message.aggregatedMetrics != null && message.hasOwnProperty("aggregatedMetrics")) + object.aggregatedMetrics = $root.google.cloud.ces.v1beta.AggregatedMetrics.toObject(message.aggregatedMetrics, options); + if (message.lastCompletedResult != null && message.hasOwnProperty("lastCompletedResult")) + object.lastCompletedResult = $root.google.cloud.ces.v1beta.EvaluationResult.toObject(message.lastCompletedResult, options); + if (message.invalid != null && message.hasOwnProperty("invalid")) + object.invalid = message.invalid; + if (message.lastTenResults && message.lastTenResults.length) { + object.lastTenResults = []; + for (var j = 0; j < message.lastTenResults.length; ++j) + object.lastTenResults[j] = $root.google.cloud.ces.v1beta.EvaluationResult.toObject(message.lastTenResults[j], options); + } + return object; + }; + + /** + * Converts this Evaluation to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Evaluation + * @instance + * @returns {Object.} JSON object + */ + Evaluation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Evaluation + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Evaluation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Evaluation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation"; + }; + + Evaluation.GoldenExpectation = (function() { + + /** + * Properties of a GoldenExpectation. + * @memberof google.cloud.ces.v1beta.Evaluation + * @interface IGoldenExpectation + * @property {google.cloud.ces.v1beta.IToolCall|null} [toolCall] GoldenExpectation toolCall + * @property {google.cloud.ces.v1beta.IToolResponse|null} [toolResponse] GoldenExpectation toolResponse + * @property {google.cloud.ces.v1beta.IMessage|null} [agentResponse] GoldenExpectation agentResponse + * @property {google.cloud.ces.v1beta.IAgentTransfer|null} [agentTransfer] GoldenExpectation agentTransfer + * @property {google.protobuf.IStruct|null} [updatedVariables] GoldenExpectation updatedVariables + * @property {google.cloud.ces.v1beta.IToolResponse|null} [mockToolResponse] GoldenExpectation mockToolResponse + * @property {string|null} [note] GoldenExpectation note + */ + + /** + * Constructs a new GoldenExpectation. + * @memberof google.cloud.ces.v1beta.Evaluation + * @classdesc Represents a GoldenExpectation. + * @implements IGoldenExpectation + * @constructor + * @param {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation=} [properties] Properties to set + */ + function GoldenExpectation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoldenExpectation toolCall. + * @member {google.cloud.ces.v1beta.IToolCall|null|undefined} toolCall + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @instance + */ + GoldenExpectation.prototype.toolCall = null; + + /** + * GoldenExpectation toolResponse. + * @member {google.cloud.ces.v1beta.IToolResponse|null|undefined} toolResponse + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @instance + */ + GoldenExpectation.prototype.toolResponse = null; + + /** + * GoldenExpectation agentResponse. + * @member {google.cloud.ces.v1beta.IMessage|null|undefined} agentResponse + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @instance + */ + GoldenExpectation.prototype.agentResponse = null; + + /** + * GoldenExpectation agentTransfer. + * @member {google.cloud.ces.v1beta.IAgentTransfer|null|undefined} agentTransfer + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @instance + */ + GoldenExpectation.prototype.agentTransfer = null; + + /** + * GoldenExpectation updatedVariables. + * @member {google.protobuf.IStruct|null|undefined} updatedVariables + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @instance + */ + GoldenExpectation.prototype.updatedVariables = null; + + /** + * GoldenExpectation mockToolResponse. + * @member {google.cloud.ces.v1beta.IToolResponse|null|undefined} mockToolResponse + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @instance + */ + GoldenExpectation.prototype.mockToolResponse = null; + + /** + * GoldenExpectation note. + * @member {string} note + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @instance + */ + GoldenExpectation.prototype.note = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GoldenExpectation condition. + * @member {"toolCall"|"toolResponse"|"agentResponse"|"agentTransfer"|"updatedVariables"|"mockToolResponse"|undefined} condition + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @instance + */ + Object.defineProperty(GoldenExpectation.prototype, "condition", { + get: $util.oneOfGetter($oneOfFields = ["toolCall", "toolResponse", "agentResponse", "agentTransfer", "updatedVariables", "mockToolResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GoldenExpectation instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Evaluation.GoldenExpectation} GoldenExpectation instance + */ + GoldenExpectation.create = function create(properties) { + return new GoldenExpectation(properties); + }; + + /** + * Encodes the specified GoldenExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenExpectation.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation} message GoldenExpectation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenExpectation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.note != null && Object.hasOwnProperty.call(message, "note")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.note); + if (message.toolCall != null && Object.hasOwnProperty.call(message, "toolCall")) + $root.google.cloud.ces.v1beta.ToolCall.encode(message.toolCall, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolResponse != null && Object.hasOwnProperty.call(message, "toolResponse")) + $root.google.cloud.ces.v1beta.ToolResponse.encode(message.toolResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.agentResponse != null && Object.hasOwnProperty.call(message, "agentResponse")) + $root.google.cloud.ces.v1beta.Message.encode(message.agentResponse, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.agentTransfer != null && Object.hasOwnProperty.call(message, "agentTransfer")) + $root.google.cloud.ces.v1beta.AgentTransfer.encode(message.agentTransfer, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updatedVariables != null && Object.hasOwnProperty.call(message, "updatedVariables")) + $root.google.protobuf.Struct.encode(message.updatedVariables, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.mockToolResponse != null && Object.hasOwnProperty.call(message, "mockToolResponse")) + $root.google.cloud.ces.v1beta.ToolResponse.encode(message.mockToolResponse, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoldenExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenExpectation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation} message GoldenExpectation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenExpectation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoldenExpectation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Evaluation.GoldenExpectation} GoldenExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenExpectation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.toolCall = $root.google.cloud.ces.v1beta.ToolCall.decode(reader, reader.uint32()); + break; + } + case 3: { + message.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32()); + break; + } + case 4: { + message.agentResponse = $root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32()); + break; + } + case 5: { + message.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updatedVariables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 7: { + message.mockToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32()); + break; + } + case 1: { + message.note = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoldenExpectation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Evaluation.GoldenExpectation} GoldenExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenExpectation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoldenExpectation message. + * @function verify + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoldenExpectation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + properties.condition = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolCall.verify(message.toolCall); + if (error) + return "toolCall." + error; + } + } + if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { + if (properties.condition === 1) + return "condition: multiple values"; + properties.condition = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.toolResponse); + if (error) + return "toolResponse." + error; + } + } + if (message.agentResponse != null && message.hasOwnProperty("agentResponse")) { + if (properties.condition === 1) + return "condition: multiple values"; + properties.condition = 1; + { + var error = $root.google.cloud.ces.v1beta.Message.verify(message.agentResponse); + if (error) + return "agentResponse." + error; + } + } + if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { + if (properties.condition === 1) + return "condition: multiple values"; + properties.condition = 1; + { + var error = $root.google.cloud.ces.v1beta.AgentTransfer.verify(message.agentTransfer); + if (error) + return "agentTransfer." + error; + } + } + if (message.updatedVariables != null && message.hasOwnProperty("updatedVariables")) { + if (properties.condition === 1) + return "condition: multiple values"; + properties.condition = 1; + { + var error = $root.google.protobuf.Struct.verify(message.updatedVariables); + if (error) + return "updatedVariables." + error; + } + } + if (message.mockToolResponse != null && message.hasOwnProperty("mockToolResponse")) { + if (properties.condition === 1) + return "condition: multiple values"; + properties.condition = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.mockToolResponse); + if (error) + return "mockToolResponse." + error; + } + } + if (message.note != null && message.hasOwnProperty("note")) + if (!$util.isString(message.note)) + return "note: string expected"; + return null; + }; + + /** + * Creates a GoldenExpectation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Evaluation.GoldenExpectation} GoldenExpectation + */ + GoldenExpectation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation) + return object; + var message = new $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation(); + if (object.toolCall != null) { + if (typeof object.toolCall !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenExpectation.toolCall: object expected"); + message.toolCall = $root.google.cloud.ces.v1beta.ToolCall.fromObject(object.toolCall); + } + if (object.toolResponse != null) { + if (typeof object.toolResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenExpectation.toolResponse: object expected"); + message.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.toolResponse); + } + if (object.agentResponse != null) { + if (typeof object.agentResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenExpectation.agentResponse: object expected"); + message.agentResponse = $root.google.cloud.ces.v1beta.Message.fromObject(object.agentResponse); + } + if (object.agentTransfer != null) { + if (typeof object.agentTransfer !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenExpectation.agentTransfer: object expected"); + message.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.fromObject(object.agentTransfer); + } + if (object.updatedVariables != null) { + if (typeof object.updatedVariables !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenExpectation.updatedVariables: object expected"); + message.updatedVariables = $root.google.protobuf.Struct.fromObject(object.updatedVariables); + } + if (object.mockToolResponse != null) { + if (typeof object.mockToolResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenExpectation.mockToolResponse: object expected"); + message.mockToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.mockToolResponse); + } + if (object.note != null) + message.note = String(object.note); + return message; + }; + + /** + * Creates a plain object from a GoldenExpectation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.GoldenExpectation} message GoldenExpectation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoldenExpectation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.note = ""; + if (message.note != null && message.hasOwnProperty("note")) + object.note = message.note; + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + object.toolCall = $root.google.cloud.ces.v1beta.ToolCall.toObject(message.toolCall, options); + if (options.oneofs) + object.condition = "toolCall"; + } + if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { + object.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.toolResponse, options); + if (options.oneofs) + object.condition = "toolResponse"; + } + if (message.agentResponse != null && message.hasOwnProperty("agentResponse")) { + object.agentResponse = $root.google.cloud.ces.v1beta.Message.toObject(message.agentResponse, options); + if (options.oneofs) + object.condition = "agentResponse"; + } + if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { + object.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.toObject(message.agentTransfer, options); + if (options.oneofs) + object.condition = "agentTransfer"; + } + if (message.updatedVariables != null && message.hasOwnProperty("updatedVariables")) { + object.updatedVariables = $root.google.protobuf.Struct.toObject(message.updatedVariables, options); + if (options.oneofs) + object.condition = "updatedVariables"; + } + if (message.mockToolResponse != null && message.hasOwnProperty("mockToolResponse")) { + object.mockToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.mockToolResponse, options); + if (options.oneofs) + object.condition = "mockToolResponse"; + } + return object; + }; + + /** + * Converts this GoldenExpectation to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @instance + * @returns {Object.} JSON object + */ + GoldenExpectation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoldenExpectation + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenExpectation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoldenExpectation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.GoldenExpectation"; + }; + + return GoldenExpectation; + })(); + + Evaluation.Step = (function() { + + /** + * Properties of a Step. + * @memberof google.cloud.ces.v1beta.Evaluation + * @interface IStep + * @property {google.cloud.ces.v1beta.ISessionInput|null} [userInput] Step userInput + * @property {google.cloud.ces.v1beta.IAgentTransfer|null} [agentTransfer] Step agentTransfer + * @property {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null} [expectation] Step expectation + */ + + /** + * Constructs a new Step. + * @memberof google.cloud.ces.v1beta.Evaluation + * @classdesc Represents a Step. + * @implements IStep + * @constructor + * @param {google.cloud.ces.v1beta.Evaluation.IStep=} [properties] Properties to set + */ + function Step(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Step userInput. + * @member {google.cloud.ces.v1beta.ISessionInput|null|undefined} userInput + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @instance + */ + Step.prototype.userInput = null; + + /** + * Step agentTransfer. + * @member {google.cloud.ces.v1beta.IAgentTransfer|null|undefined} agentTransfer + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @instance + */ + Step.prototype.agentTransfer = null; + + /** + * Step expectation. + * @member {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null|undefined} expectation + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @instance + */ + Step.prototype.expectation = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Step step. + * @member {"userInput"|"agentTransfer"|"expectation"|undefined} step + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @instance + */ + Object.defineProperty(Step.prototype, "step", { + get: $util.oneOfGetter($oneOfFields = ["userInput", "agentTransfer", "expectation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Step instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IStep=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Evaluation.Step} Step instance + */ + Step.create = function create(properties) { + return new Step(properties); + }; + + /** + * Encodes the specified Step message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Step.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IStep} message Step message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Step.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userInput != null && Object.hasOwnProperty.call(message, "userInput")) + $root.google.cloud.ces.v1beta.SessionInput.encode(message.userInput, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.agentTransfer != null && Object.hasOwnProperty.call(message, "agentTransfer")) + $root.google.cloud.ces.v1beta.AgentTransfer.encode(message.agentTransfer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.expectation != null && Object.hasOwnProperty.call(message, "expectation")) + $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.encode(message.expectation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Step message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Step.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IStep} message Step message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Step.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Step message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Evaluation.Step} Step + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Step.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.Step(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.userInput = $root.google.cloud.ces.v1beta.SessionInput.decode(reader, reader.uint32()); + break; + } + case 2: { + message.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.decode(reader, reader.uint32()); + break; + } + case 3: { + message.expectation = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Step message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Evaluation.Step} Step + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Step.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Step message. + * @function verify + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Step.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.userInput != null && message.hasOwnProperty("userInput")) { + properties.step = 1; + { + var error = $root.google.cloud.ces.v1beta.SessionInput.verify(message.userInput); + if (error) + return "userInput." + error; + } + } + if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { + if (properties.step === 1) + return "step: multiple values"; + properties.step = 1; + { + var error = $root.google.cloud.ces.v1beta.AgentTransfer.verify(message.agentTransfer); + if (error) + return "agentTransfer." + error; + } + } + if (message.expectation != null && message.hasOwnProperty("expectation")) { + if (properties.step === 1) + return "step: multiple values"; + properties.step = 1; + { + var error = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.verify(message.expectation); + if (error) + return "expectation." + error; + } + } + return null; + }; + + /** + * Creates a Step message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Evaluation.Step} Step + */ + Step.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.Step) + return object; + var message = new $root.google.cloud.ces.v1beta.Evaluation.Step(); + if (object.userInput != null) { + if (typeof object.userInput !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Step.userInput: object expected"); + message.userInput = $root.google.cloud.ces.v1beta.SessionInput.fromObject(object.userInput); + } + if (object.agentTransfer != null) { + if (typeof object.agentTransfer !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Step.agentTransfer: object expected"); + message.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.fromObject(object.agentTransfer); + } + if (object.expectation != null) { + if (typeof object.expectation !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Step.expectation: object expected"); + message.expectation = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.fromObject(object.expectation); + } + return message; + }; + + /** + * Creates a plain object from a Step message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @static + * @param {google.cloud.ces.v1beta.Evaluation.Step} message Step + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Step.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.userInput != null && message.hasOwnProperty("userInput")) { + object.userInput = $root.google.cloud.ces.v1beta.SessionInput.toObject(message.userInput, options); + if (options.oneofs) + object.step = "userInput"; + } + if (message.agentTransfer != null && message.hasOwnProperty("agentTransfer")) { + object.agentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.toObject(message.agentTransfer, options); + if (options.oneofs) + object.step = "agentTransfer"; + } + if (message.expectation != null && message.hasOwnProperty("expectation")) { + object.expectation = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.toObject(message.expectation, options); + if (options.oneofs) + object.step = "expectation"; + } + return object; + }; + + /** + * Converts this Step to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @instance + * @returns {Object.} JSON object + */ + Step.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Step + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Evaluation.Step + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Step.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.Step"; + }; + + return Step; + })(); + + Evaluation.GoldenTurn = (function() { + + /** + * Properties of a GoldenTurn. + * @memberof google.cloud.ces.v1beta.Evaluation + * @interface IGoldenTurn + * @property {Array.|null} [steps] GoldenTurn steps + * @property {google.cloud.ces.v1beta.ISpan|null} [rootSpan] GoldenTurn rootSpan + */ + + /** + * Constructs a new GoldenTurn. + * @memberof google.cloud.ces.v1beta.Evaluation + * @classdesc Represents a GoldenTurn. + * @implements IGoldenTurn + * @constructor + * @param {google.cloud.ces.v1beta.Evaluation.IGoldenTurn=} [properties] Properties to set + */ + function GoldenTurn(properties) { + this.steps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoldenTurn steps. + * @member {Array.} steps + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @instance + */ + GoldenTurn.prototype.steps = $util.emptyArray; + + /** + * GoldenTurn rootSpan. + * @member {google.cloud.ces.v1beta.ISpan|null|undefined} rootSpan + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @instance + */ + GoldenTurn.prototype.rootSpan = null; + + /** + * Creates a new GoldenTurn instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IGoldenTurn=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Evaluation.GoldenTurn} GoldenTurn instance + */ + GoldenTurn.create = function create(properties) { + return new GoldenTurn(properties); + }; + + /** + * Encodes the specified GoldenTurn message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenTurn.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IGoldenTurn} message GoldenTurn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenTurn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.steps != null && message.steps.length) + for (var i = 0; i < message.steps.length; ++i) + $root.google.cloud.ces.v1beta.Evaluation.Step.encode(message.steps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rootSpan != null && Object.hasOwnProperty.call(message, "rootSpan")) + $root.google.cloud.ces.v1beta.Span.encode(message.rootSpan, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoldenTurn message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.GoldenTurn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IGoldenTurn} message GoldenTurn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenTurn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoldenTurn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Evaluation.GoldenTurn} GoldenTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenTurn.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.steps && message.steps.length)) + message.steps = []; + message.steps.push($root.google.cloud.ces.v1beta.Evaluation.Step.decode(reader, reader.uint32())); + break; + } + case 2: { + message.rootSpan = $root.google.cloud.ces.v1beta.Span.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoldenTurn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Evaluation.GoldenTurn} GoldenTurn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenTurn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoldenTurn message. + * @function verify + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoldenTurn.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.steps != null && message.hasOwnProperty("steps")) { + if (!Array.isArray(message.steps)) + return "steps: array expected"; + for (var i = 0; i < message.steps.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Evaluation.Step.verify(message.steps[i]); + if (error) + return "steps." + error; + } + } + if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) { + var error = $root.google.cloud.ces.v1beta.Span.verify(message.rootSpan); + if (error) + return "rootSpan." + error; + } + return null; + }; + + /** + * Creates a GoldenTurn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Evaluation.GoldenTurn} GoldenTurn + */ + GoldenTurn.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn) + return object; + var message = new $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn(); + if (object.steps) { + if (!Array.isArray(object.steps)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenTurn.steps: array expected"); + message.steps = []; + for (var i = 0; i < object.steps.length; ++i) { + if (typeof object.steps[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenTurn.steps: object expected"); + message.steps[i] = $root.google.cloud.ces.v1beta.Evaluation.Step.fromObject(object.steps[i]); + } + } + if (object.rootSpan != null) { + if (typeof object.rootSpan !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.GoldenTurn.rootSpan: object expected"); + message.rootSpan = $root.google.cloud.ces.v1beta.Span.fromObject(object.rootSpan); + } + return message; + }; + + /** + * Creates a plain object from a GoldenTurn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @static + * @param {google.cloud.ces.v1beta.Evaluation.GoldenTurn} message GoldenTurn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoldenTurn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.steps = []; + if (options.defaults) + object.rootSpan = null; + if (message.steps && message.steps.length) { + object.steps = []; + for (var j = 0; j < message.steps.length; ++j) + object.steps[j] = $root.google.cloud.ces.v1beta.Evaluation.Step.toObject(message.steps[j], options); + } + if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) + object.rootSpan = $root.google.cloud.ces.v1beta.Span.toObject(message.rootSpan, options); + return object; + }; + + /** + * Converts this GoldenTurn to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @instance + * @returns {Object.} JSON object + */ + GoldenTurn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoldenTurn + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Evaluation.GoldenTurn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoldenTurn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.GoldenTurn"; + }; + + return GoldenTurn; + })(); + + Evaluation.Golden = (function() { + + /** + * Properties of a Golden. + * @memberof google.cloud.ces.v1beta.Evaluation + * @interface IGolden + * @property {Array.|null} [turns] Golden turns + * @property {Array.|null} [evaluationExpectations] Golden evaluationExpectations + */ + + /** + * Constructs a new Golden. + * @memberof google.cloud.ces.v1beta.Evaluation + * @classdesc Represents a Golden. + * @implements IGolden + * @constructor + * @param {google.cloud.ces.v1beta.Evaluation.IGolden=} [properties] Properties to set + */ + function Golden(properties) { + this.turns = []; + this.evaluationExpectations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Golden turns. + * @member {Array.} turns + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @instance + */ + Golden.prototype.turns = $util.emptyArray; + + /** + * Golden evaluationExpectations. + * @member {Array.} evaluationExpectations + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @instance + */ + Golden.prototype.evaluationExpectations = $util.emptyArray; + + /** + * Creates a new Golden instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IGolden=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Evaluation.Golden} Golden instance + */ + Golden.create = function create(properties) { + return new Golden(properties); + }; + + /** + * Encodes the specified Golden message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Golden.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IGolden} message Golden message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Golden.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.turns != null && message.turns.length) + for (var i = 0; i < message.turns.length; ++i) + $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn.encode(message.turns[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.evaluationExpectations != null && message.evaluationExpectations.length) + for (var i = 0; i < message.evaluationExpectations.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.evaluationExpectations[i]); + return writer; + }; + + /** + * Encodes the specified Golden message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Golden.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IGolden} message Golden message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Golden.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Golden message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Evaluation.Golden} Golden + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Golden.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.Golden(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.turns && message.turns.length)) + message.turns = []; + message.turns.push($root.google.cloud.ces.v1beta.Evaluation.GoldenTurn.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.evaluationExpectations && message.evaluationExpectations.length)) + message.evaluationExpectations = []; + message.evaluationExpectations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Golden message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Evaluation.Golden} Golden + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Golden.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Golden message. + * @function verify + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Golden.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.turns != null && message.hasOwnProperty("turns")) { + if (!Array.isArray(message.turns)) + return "turns: array expected"; + for (var i = 0; i < message.turns.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn.verify(message.turns[i]); + if (error) + return "turns." + error; + } + } + if (message.evaluationExpectations != null && message.hasOwnProperty("evaluationExpectations")) { + if (!Array.isArray(message.evaluationExpectations)) + return "evaluationExpectations: array expected"; + for (var i = 0; i < message.evaluationExpectations.length; ++i) + if (!$util.isString(message.evaluationExpectations[i])) + return "evaluationExpectations: string[] expected"; + } + return null; + }; + + /** + * Creates a Golden message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Evaluation.Golden} Golden + */ + Golden.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.Golden) + return object; + var message = new $root.google.cloud.ces.v1beta.Evaluation.Golden(); + if (object.turns) { + if (!Array.isArray(object.turns)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Golden.turns: array expected"); + message.turns = []; + for (var i = 0; i < object.turns.length; ++i) { + if (typeof object.turns[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Golden.turns: object expected"); + message.turns[i] = $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn.fromObject(object.turns[i]); + } + } + if (object.evaluationExpectations) { + if (!Array.isArray(object.evaluationExpectations)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Golden.evaluationExpectations: array expected"); + message.evaluationExpectations = []; + for (var i = 0; i < object.evaluationExpectations.length; ++i) + message.evaluationExpectations[i] = String(object.evaluationExpectations[i]); + } + return message; + }; + + /** + * Creates a plain object from a Golden message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @static + * @param {google.cloud.ces.v1beta.Evaluation.Golden} message Golden + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Golden.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.turns = []; + object.evaluationExpectations = []; + } + if (message.turns && message.turns.length) { + object.turns = []; + for (var j = 0; j < message.turns.length; ++j) + object.turns[j] = $root.google.cloud.ces.v1beta.Evaluation.GoldenTurn.toObject(message.turns[j], options); + } + if (message.evaluationExpectations && message.evaluationExpectations.length) { + object.evaluationExpectations = []; + for (var j = 0; j < message.evaluationExpectations.length; ++j) + object.evaluationExpectations[j] = message.evaluationExpectations[j]; + } + return object; + }; + + /** + * Converts this Golden to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @instance + * @returns {Object.} JSON object + */ + Golden.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Golden + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Evaluation.Golden + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Golden.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.Golden"; + }; + + return Golden; + })(); + + Evaluation.ScenarioExpectation = (function() { + + /** + * Properties of a ScenarioExpectation. + * @memberof google.cloud.ces.v1beta.Evaluation + * @interface IScenarioExpectation + * @property {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation|null} [toolExpectation] ScenarioExpectation toolExpectation + * @property {google.cloud.ces.v1beta.IMessage|null} [agentResponse] ScenarioExpectation agentResponse + */ + + /** + * Constructs a new ScenarioExpectation. + * @memberof google.cloud.ces.v1beta.Evaluation + * @classdesc Represents a ScenarioExpectation. + * @implements IScenarioExpectation + * @constructor + * @param {google.cloud.ces.v1beta.Evaluation.IScenarioExpectation=} [properties] Properties to set + */ + function ScenarioExpectation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScenarioExpectation toolExpectation. + * @member {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation|null|undefined} toolExpectation + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @instance + */ + ScenarioExpectation.prototype.toolExpectation = null; + + /** + * ScenarioExpectation agentResponse. + * @member {google.cloud.ces.v1beta.IMessage|null|undefined} agentResponse + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @instance + */ + ScenarioExpectation.prototype.agentResponse = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ScenarioExpectation expectation. + * @member {"toolExpectation"|"agentResponse"|undefined} expectation + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @instance + */ + Object.defineProperty(ScenarioExpectation.prototype, "expectation", { + get: $util.oneOfGetter($oneOfFields = ["toolExpectation", "agentResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ScenarioExpectation instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IScenarioExpectation=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation} ScenarioExpectation instance + */ + ScenarioExpectation.create = function create(properties) { + return new ScenarioExpectation(properties); + }; + + /** + * Encodes the specified ScenarioExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IScenarioExpectation} message ScenarioExpectation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScenarioExpectation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolExpectation != null && Object.hasOwnProperty.call(message, "toolExpectation")) + $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.encode(message.toolExpectation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.agentResponse != null && Object.hasOwnProperty.call(message, "agentResponse")) + $root.google.cloud.ces.v1beta.Message.encode(message.agentResponse, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ScenarioExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IScenarioExpectation} message ScenarioExpectation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScenarioExpectation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScenarioExpectation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation} ScenarioExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScenarioExpectation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolExpectation = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.decode(reader, reader.uint32()); + break; + } + case 2: { + message.agentResponse = $root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScenarioExpectation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation} ScenarioExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScenarioExpectation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScenarioExpectation message. + * @function verify + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScenarioExpectation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.toolExpectation != null && message.hasOwnProperty("toolExpectation")) { + properties.expectation = 1; + { + var error = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.verify(message.toolExpectation); + if (error) + return "toolExpectation." + error; + } + } + if (message.agentResponse != null && message.hasOwnProperty("agentResponse")) { + if (properties.expectation === 1) + return "expectation: multiple values"; + properties.expectation = 1; + { + var error = $root.google.cloud.ces.v1beta.Message.verify(message.agentResponse); + if (error) + return "agentResponse." + error; + } + } + return null; + }; + + /** + * Creates a ScenarioExpectation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation} ScenarioExpectation + */ + ScenarioExpectation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation) + return object; + var message = new $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation(); + if (object.toolExpectation != null) { + if (typeof object.toolExpectation !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.toolExpectation: object expected"); + message.toolExpectation = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.fromObject(object.toolExpectation); + } + if (object.agentResponse != null) { + if (typeof object.agentResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.agentResponse: object expected"); + message.agentResponse = $root.google.cloud.ces.v1beta.Message.fromObject(object.agentResponse); + } + return message; + }; + + /** + * Creates a plain object from a ScenarioExpectation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation} message ScenarioExpectation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScenarioExpectation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.toolExpectation != null && message.hasOwnProperty("toolExpectation")) { + object.toolExpectation = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.toObject(message.toolExpectation, options); + if (options.oneofs) + object.expectation = "toolExpectation"; + } + if (message.agentResponse != null && message.hasOwnProperty("agentResponse")) { + object.agentResponse = $root.google.cloud.ces.v1beta.Message.toObject(message.agentResponse, options); + if (options.oneofs) + object.expectation = "agentResponse"; + } + return object; + }; + + /** + * Converts this ScenarioExpectation to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @instance + * @returns {Object.} JSON object + */ + ScenarioExpectation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScenarioExpectation + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScenarioExpectation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.ScenarioExpectation"; + }; + + ScenarioExpectation.ToolExpectation = (function() { + + /** + * Properties of a ToolExpectation. + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @interface IToolExpectation + * @property {google.cloud.ces.v1beta.IToolCall|null} [expectedToolCall] ToolExpectation expectedToolCall + * @property {google.cloud.ces.v1beta.IToolResponse|null} [mockToolResponse] ToolExpectation mockToolResponse + */ + + /** + * Constructs a new ToolExpectation. + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation + * @classdesc Represents a ToolExpectation. + * @implements IToolExpectation + * @constructor + * @param {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation=} [properties] Properties to set + */ + function ToolExpectation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolExpectation expectedToolCall. + * @member {google.cloud.ces.v1beta.IToolCall|null|undefined} expectedToolCall + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @instance + */ + ToolExpectation.prototype.expectedToolCall = null; + + /** + * ToolExpectation mockToolResponse. + * @member {google.cloud.ces.v1beta.IToolResponse|null|undefined} mockToolResponse + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @instance + */ + ToolExpectation.prototype.mockToolResponse = null; + + /** + * Creates a new ToolExpectation instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation} ToolExpectation instance + */ + ToolExpectation.create = function create(properties) { + return new ToolExpectation(properties); + }; + + /** + * Encodes the specified ToolExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation} message ToolExpectation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolExpectation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expectedToolCall != null && Object.hasOwnProperty.call(message, "expectedToolCall")) + $root.google.cloud.ces.v1beta.ToolCall.encode(message.expectedToolCall, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mockToolResponse != null && Object.hasOwnProperty.call(message, "mockToolResponse")) + $root.google.cloud.ces.v1beta.ToolResponse.encode(message.mockToolResponse, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.IToolExpectation} message ToolExpectation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolExpectation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolExpectation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation} ToolExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolExpectation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expectedToolCall = $root.google.cloud.ces.v1beta.ToolCall.decode(reader, reader.uint32()); + break; + } + case 2: { + message.mockToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolExpectation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation} ToolExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolExpectation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolExpectation message. + * @function verify + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolExpectation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expectedToolCall != null && message.hasOwnProperty("expectedToolCall")) { + var error = $root.google.cloud.ces.v1beta.ToolCall.verify(message.expectedToolCall); + if (error) + return "expectedToolCall." + error; + } + if (message.mockToolResponse != null && message.hasOwnProperty("mockToolResponse")) { + var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.mockToolResponse); + if (error) + return "mockToolResponse." + error; + } + return null; + }; + + /** + * Creates a ToolExpectation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation} ToolExpectation + */ + ToolExpectation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation) + return object; + var message = new $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation(); + if (object.expectedToolCall != null) { + if (typeof object.expectedToolCall !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.expectedToolCall: object expected"); + message.expectedToolCall = $root.google.cloud.ces.v1beta.ToolCall.fromObject(object.expectedToolCall); + } + if (object.mockToolResponse != null) { + if (typeof object.mockToolResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation.mockToolResponse: object expected"); + message.mockToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.mockToolResponse); + } + return message; + }; + + /** + * Creates a plain object from a ToolExpectation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @static + * @param {google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation} message ToolExpectation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolExpectation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expectedToolCall = null; + object.mockToolResponse = null; + } + if (message.expectedToolCall != null && message.hasOwnProperty("expectedToolCall")) + object.expectedToolCall = $root.google.cloud.ces.v1beta.ToolCall.toObject(message.expectedToolCall, options); + if (message.mockToolResponse != null && message.hasOwnProperty("mockToolResponse")) + object.mockToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.mockToolResponse, options); + return object; + }; + + /** + * Converts this ToolExpectation to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @instance + * @returns {Object.} JSON object + */ + ToolExpectation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolExpectation + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolExpectation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.ToolExpectation"; + }; + + return ToolExpectation; + })(); + + return ScenarioExpectation; + })(); + + Evaluation.Scenario = (function() { + + /** + * Properties of a Scenario. + * @memberof google.cloud.ces.v1beta.Evaluation + * @interface IScenario + * @property {string|null} [task] Scenario task + * @property {Array.|null} [userFacts] Scenario userFacts + * @property {number|null} [maxTurns] Scenario maxTurns + * @property {Array.|null} [rubrics] Scenario rubrics + * @property {Array.|null} [scenarioExpectations] Scenario scenarioExpectations + * @property {google.protobuf.IStruct|null} [variableOverrides] Scenario variableOverrides + * @property {google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior|null} [taskCompletionBehavior] Scenario taskCompletionBehavior + * @property {google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior|null} [userGoalBehavior] Scenario userGoalBehavior + * @property {Array.|null} [evaluationExpectations] Scenario evaluationExpectations + */ + + /** + * Constructs a new Scenario. + * @memberof google.cloud.ces.v1beta.Evaluation + * @classdesc Represents a Scenario. + * @implements IScenario + * @constructor + * @param {google.cloud.ces.v1beta.Evaluation.IScenario=} [properties] Properties to set + */ + function Scenario(properties) { + this.userFacts = []; + this.rubrics = []; + this.scenarioExpectations = []; + this.evaluationExpectations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Scenario task. + * @member {string} task + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + */ + Scenario.prototype.task = ""; + + /** + * Scenario userFacts. + * @member {Array.} userFacts + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + */ + Scenario.prototype.userFacts = $util.emptyArray; + + /** + * Scenario maxTurns. + * @member {number} maxTurns + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + */ + Scenario.prototype.maxTurns = 0; + + /** + * Scenario rubrics. + * @member {Array.} rubrics + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + */ + Scenario.prototype.rubrics = $util.emptyArray; + + /** + * Scenario scenarioExpectations. + * @member {Array.} scenarioExpectations + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + */ + Scenario.prototype.scenarioExpectations = $util.emptyArray; + + /** + * Scenario variableOverrides. + * @member {google.protobuf.IStruct|null|undefined} variableOverrides + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + */ + Scenario.prototype.variableOverrides = null; + + /** + * Scenario taskCompletionBehavior. + * @member {google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior} taskCompletionBehavior + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + */ + Scenario.prototype.taskCompletionBehavior = 0; + + /** + * Scenario userGoalBehavior. + * @member {google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior} userGoalBehavior + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + */ + Scenario.prototype.userGoalBehavior = 0; + + /** + * Scenario evaluationExpectations. + * @member {Array.} evaluationExpectations + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + */ + Scenario.prototype.evaluationExpectations = $util.emptyArray; + + /** + * Creates a new Scenario instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IScenario=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Evaluation.Scenario} Scenario instance + */ + Scenario.create = function create(properties) { + return new Scenario(properties); + }; + + /** + * Encodes the specified Scenario message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IScenario} message Scenario message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Scenario.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.task != null && Object.hasOwnProperty.call(message, "task")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.task); + if (message.rubrics != null && message.rubrics.length) + for (var i = 0; i < message.rubrics.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rubrics[i]); + if (message.scenarioExpectations != null && message.scenarioExpectations.length) + for (var i = 0; i < message.scenarioExpectations.length; ++i) + $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.encode(message.scenarioExpectations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.userFacts != null && message.userFacts.length) + for (var i = 0; i < message.userFacts.length; ++i) + $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.encode(message.userFacts[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.maxTurns != null && Object.hasOwnProperty.call(message, "maxTurns")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxTurns); + if (message.variableOverrides != null && Object.hasOwnProperty.call(message, "variableOverrides")) + $root.google.protobuf.Struct.encode(message.variableOverrides, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.taskCompletionBehavior != null && Object.hasOwnProperty.call(message, "taskCompletionBehavior")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.taskCompletionBehavior); + if (message.userGoalBehavior != null && Object.hasOwnProperty.call(message, "userGoalBehavior")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.userGoalBehavior); + if (message.evaluationExpectations != null && message.evaluationExpectations.length) + for (var i = 0; i < message.evaluationExpectations.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.evaluationExpectations[i]); + return writer; + }; + + /** + * Encodes the specified Scenario message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @static + * @param {google.cloud.ces.v1beta.Evaluation.IScenario} message Scenario message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Scenario.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Scenario message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Evaluation.Scenario} Scenario + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Scenario.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.Scenario(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.task = reader.string(); + break; + } + case 4: { + if (!(message.userFacts && message.userFacts.length)) + message.userFacts = []; + message.userFacts.push($root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.decode(reader, reader.uint32())); + break; + } + case 5: { + message.maxTurns = reader.int32(); + break; + } + case 2: { + if (!(message.rubrics && message.rubrics.length)) + message.rubrics = []; + message.rubrics.push(reader.string()); + break; + } + case 3: { + if (!(message.scenarioExpectations && message.scenarioExpectations.length)) + message.scenarioExpectations = []; + message.scenarioExpectations.push($root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.decode(reader, reader.uint32())); + break; + } + case 6: { + message.variableOverrides = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 7: { + message.taskCompletionBehavior = reader.int32(); + break; + } + case 8: { + message.userGoalBehavior = reader.int32(); + break; + } + case 10: { + if (!(message.evaluationExpectations && message.evaluationExpectations.length)) + message.evaluationExpectations = []; + message.evaluationExpectations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Scenario message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Evaluation.Scenario} Scenario + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Scenario.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Scenario message. + * @function verify + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Scenario.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.task != null && message.hasOwnProperty("task")) + if (!$util.isString(message.task)) + return "task: string expected"; + if (message.userFacts != null && message.hasOwnProperty("userFacts")) { + if (!Array.isArray(message.userFacts)) + return "userFacts: array expected"; + for (var i = 0; i < message.userFacts.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.verify(message.userFacts[i]); + if (error) + return "userFacts." + error; + } + } + if (message.maxTurns != null && message.hasOwnProperty("maxTurns")) + if (!$util.isInteger(message.maxTurns)) + return "maxTurns: integer expected"; + if (message.rubrics != null && message.hasOwnProperty("rubrics")) { + if (!Array.isArray(message.rubrics)) + return "rubrics: array expected"; + for (var i = 0; i < message.rubrics.length; ++i) + if (!$util.isString(message.rubrics[i])) + return "rubrics: string[] expected"; + } + if (message.scenarioExpectations != null && message.hasOwnProperty("scenarioExpectations")) { + if (!Array.isArray(message.scenarioExpectations)) + return "scenarioExpectations: array expected"; + for (var i = 0; i < message.scenarioExpectations.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.verify(message.scenarioExpectations[i]); + if (error) + return "scenarioExpectations." + error; + } + } + if (message.variableOverrides != null && message.hasOwnProperty("variableOverrides")) { + var error = $root.google.protobuf.Struct.verify(message.variableOverrides); + if (error) + return "variableOverrides." + error; + } + if (message.taskCompletionBehavior != null && message.hasOwnProperty("taskCompletionBehavior")) + switch (message.taskCompletionBehavior) { + default: + return "taskCompletionBehavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.userGoalBehavior != null && message.hasOwnProperty("userGoalBehavior")) + switch (message.userGoalBehavior) { + default: + return "userGoalBehavior: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.evaluationExpectations != null && message.hasOwnProperty("evaluationExpectations")) { + if (!Array.isArray(message.evaluationExpectations)) + return "evaluationExpectations: array expected"; + for (var i = 0; i < message.evaluationExpectations.length; ++i) + if (!$util.isString(message.evaluationExpectations[i])) + return "evaluationExpectations: string[] expected"; + } + return null; + }; + + /** + * Creates a Scenario message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Evaluation.Scenario} Scenario + */ + Scenario.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.Scenario) + return object; + var message = new $root.google.cloud.ces.v1beta.Evaluation.Scenario(); + if (object.task != null) + message.task = String(object.task); + if (object.userFacts) { + if (!Array.isArray(object.userFacts)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.userFacts: array expected"); + message.userFacts = []; + for (var i = 0; i < object.userFacts.length; ++i) { + if (typeof object.userFacts[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.userFacts: object expected"); + message.userFacts[i] = $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.fromObject(object.userFacts[i]); + } + } + if (object.maxTurns != null) + message.maxTurns = object.maxTurns | 0; + if (object.rubrics) { + if (!Array.isArray(object.rubrics)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.rubrics: array expected"); + message.rubrics = []; + for (var i = 0; i < object.rubrics.length; ++i) + message.rubrics[i] = String(object.rubrics[i]); + } + if (object.scenarioExpectations) { + if (!Array.isArray(object.scenarioExpectations)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.scenarioExpectations: array expected"); + message.scenarioExpectations = []; + for (var i = 0; i < object.scenarioExpectations.length; ++i) { + if (typeof object.scenarioExpectations[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.scenarioExpectations: object expected"); + message.scenarioExpectations[i] = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.fromObject(object.scenarioExpectations[i]); + } + } + if (object.variableOverrides != null) { + if (typeof object.variableOverrides !== "object") + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.variableOverrides: object expected"); + message.variableOverrides = $root.google.protobuf.Struct.fromObject(object.variableOverrides); + } + switch (object.taskCompletionBehavior) { + default: + if (typeof object.taskCompletionBehavior === "number") { + message.taskCompletionBehavior = object.taskCompletionBehavior; + break; + } + break; + case "TASK_COMPLETION_BEHAVIOR_UNSPECIFIED": + case 0: + message.taskCompletionBehavior = 0; + break; + case "TASK_SATISFIED": + case 1: + message.taskCompletionBehavior = 1; + break; + case "TASK_REJECTED": + case 2: + message.taskCompletionBehavior = 2; + break; + } + switch (object.userGoalBehavior) { + default: + if (typeof object.userGoalBehavior === "number") { + message.userGoalBehavior = object.userGoalBehavior; + break; + } + break; + case "USER_GOAL_BEHAVIOR_UNSPECIFIED": + case 0: + message.userGoalBehavior = 0; + break; + case "USER_GOAL_SATISFIED": + case 1: + message.userGoalBehavior = 1; + break; + case "USER_GOAL_REJECTED": + case 2: + message.userGoalBehavior = 2; + break; + case "USER_GOAL_IGNORED": + case 3: + message.userGoalBehavior = 3; + break; + } + if (object.evaluationExpectations) { + if (!Array.isArray(object.evaluationExpectations)) + throw TypeError(".google.cloud.ces.v1beta.Evaluation.Scenario.evaluationExpectations: array expected"); + message.evaluationExpectations = []; + for (var i = 0; i < object.evaluationExpectations.length; ++i) + message.evaluationExpectations[i] = String(object.evaluationExpectations[i]); + } + return message; + }; + + /** + * Creates a plain object from a Scenario message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @static + * @param {google.cloud.ces.v1beta.Evaluation.Scenario} message Scenario + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Scenario.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.rubrics = []; + object.scenarioExpectations = []; + object.userFacts = []; + object.evaluationExpectations = []; + } + if (options.defaults) { + object.task = ""; + object.maxTurns = 0; + object.variableOverrides = null; + object.taskCompletionBehavior = options.enums === String ? "TASK_COMPLETION_BEHAVIOR_UNSPECIFIED" : 0; + object.userGoalBehavior = options.enums === String ? "USER_GOAL_BEHAVIOR_UNSPECIFIED" : 0; + } + if (message.task != null && message.hasOwnProperty("task")) + object.task = message.task; + if (message.rubrics && message.rubrics.length) { + object.rubrics = []; + for (var j = 0; j < message.rubrics.length; ++j) + object.rubrics[j] = message.rubrics[j]; + } + if (message.scenarioExpectations && message.scenarioExpectations.length) { + object.scenarioExpectations = []; + for (var j = 0; j < message.scenarioExpectations.length; ++j) + object.scenarioExpectations[j] = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.toObject(message.scenarioExpectations[j], options); + } + if (message.userFacts && message.userFacts.length) { + object.userFacts = []; + for (var j = 0; j < message.userFacts.length; ++j) + object.userFacts[j] = $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.toObject(message.userFacts[j], options); + } + if (message.maxTurns != null && message.hasOwnProperty("maxTurns")) + object.maxTurns = message.maxTurns; + if (message.variableOverrides != null && message.hasOwnProperty("variableOverrides")) + object.variableOverrides = $root.google.protobuf.Struct.toObject(message.variableOverrides, options); + if (message.taskCompletionBehavior != null && message.hasOwnProperty("taskCompletionBehavior")) + object.taskCompletionBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior[message.taskCompletionBehavior] === undefined ? message.taskCompletionBehavior : $root.google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior[message.taskCompletionBehavior] : message.taskCompletionBehavior; + if (message.userGoalBehavior != null && message.hasOwnProperty("userGoalBehavior")) + object.userGoalBehavior = options.enums === String ? $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior[message.userGoalBehavior] === undefined ? message.userGoalBehavior : $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior[message.userGoalBehavior] : message.userGoalBehavior; + if (message.evaluationExpectations && message.evaluationExpectations.length) { + object.evaluationExpectations = []; + for (var j = 0; j < message.evaluationExpectations.length; ++j) + object.evaluationExpectations[j] = message.evaluationExpectations[j]; + } + return object; + }; + + /** + * Converts this Scenario to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @instance + * @returns {Object.} JSON object + */ + Scenario.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Scenario + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Scenario.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.Scenario"; + }; + + Scenario.UserFact = (function() { + + /** + * Properties of a UserFact. + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @interface IUserFact + * @property {string|null} [name] UserFact name + * @property {string|null} [value] UserFact value + */ + + /** + * Constructs a new UserFact. + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario + * @classdesc Represents a UserFact. + * @implements IUserFact + * @constructor + * @param {google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact=} [properties] Properties to set + */ + function UserFact(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserFact name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @instance + */ + UserFact.prototype.name = ""; + + /** + * UserFact value. + * @member {string} value + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @instance + */ + UserFact.prototype.value = ""; + + /** + * Creates a new UserFact instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @static + * @param {google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Evaluation.Scenario.UserFact} UserFact instance + */ + UserFact.create = function create(properties) { + return new UserFact(properties); + }; + + /** + * Encodes the specified UserFact message. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @static + * @param {google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact} message UserFact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserFact.encode = function encode(message, writer) { + if (!writer) + 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 && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified UserFact message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @static + * @param {google.cloud.ces.v1beta.Evaluation.Scenario.IUserFact} message UserFact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserFact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserFact message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Evaluation.Scenario.UserFact} UserFact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserFact.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserFact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Evaluation.Scenario.UserFact} UserFact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserFact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserFact message. + * @function verify + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserFact.verify = function verify(message) { + if (typeof message !== "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 (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a UserFact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Evaluation.Scenario.UserFact} UserFact + */ + UserFact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact) + return object; + var message = new $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a UserFact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @static + * @param {google.cloud.ces.v1beta.Evaluation.Scenario.UserFact} message UserFact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserFact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UserFact to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @instance + * @returns {Object.} JSON object + */ + UserFact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserFact + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Evaluation.Scenario.UserFact + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserFact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Evaluation.Scenario.UserFact"; + }; + + return UserFact; + })(); + + /** + * TaskCompletionBehavior enum. + * @name google.cloud.ces.v1beta.Evaluation.Scenario.TaskCompletionBehavior + * @enum {number} + * @property {number} TASK_COMPLETION_BEHAVIOR_UNSPECIFIED=0 TASK_COMPLETION_BEHAVIOR_UNSPECIFIED value + * @property {number} TASK_SATISFIED=1 TASK_SATISFIED value + * @property {number} TASK_REJECTED=2 TASK_REJECTED value + */ + Scenario.TaskCompletionBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TASK_COMPLETION_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "TASK_SATISFIED"] = 1; + values[valuesById[2] = "TASK_REJECTED"] = 2; + return values; + })(); + + /** + * UserGoalBehavior enum. + * @name google.cloud.ces.v1beta.Evaluation.Scenario.UserGoalBehavior + * @enum {number} + * @property {number} USER_GOAL_BEHAVIOR_UNSPECIFIED=0 USER_GOAL_BEHAVIOR_UNSPECIFIED value + * @property {number} USER_GOAL_SATISFIED=1 USER_GOAL_SATISFIED value + * @property {number} USER_GOAL_REJECTED=2 USER_GOAL_REJECTED value + * @property {number} USER_GOAL_IGNORED=3 USER_GOAL_IGNORED value + */ + Scenario.UserGoalBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_GOAL_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER_GOAL_SATISFIED"] = 1; + values[valuesById[2] = "USER_GOAL_REJECTED"] = 2; + values[valuesById[3] = "USER_GOAL_IGNORED"] = 3; + return values; + })(); + + return Scenario; + })(); + + return Evaluation; + })(); + + v1beta.EvaluationDataset = (function() { + + /** + * Properties of an EvaluationDataset. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluationDataset + * @property {string|null} [name] EvaluationDataset name + * @property {string|null} [displayName] EvaluationDataset displayName + * @property {Array.|null} [evaluations] EvaluationDataset evaluations + * @property {google.protobuf.ITimestamp|null} [createTime] EvaluationDataset createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] EvaluationDataset updateTime + * @property {string|null} [etag] EvaluationDataset etag + * @property {string|null} [createdBy] EvaluationDataset createdBy + * @property {string|null} [lastUpdatedBy] EvaluationDataset lastUpdatedBy + * @property {google.cloud.ces.v1beta.IAggregatedMetrics|null} [aggregatedMetrics] EvaluationDataset aggregatedMetrics + */ + + /** + * Constructs a new EvaluationDataset. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationDataset. + * @implements IEvaluationDataset + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluationDataset=} [properties] Properties to set + */ + function EvaluationDataset(properties) { + this.evaluations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationDataset name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.name = ""; + + /** + * EvaluationDataset displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.displayName = ""; + + /** + * EvaluationDataset evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.evaluations = $util.emptyArray; + + /** + * EvaluationDataset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.createTime = null; + + /** + * EvaluationDataset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.updateTime = null; + + /** + * EvaluationDataset etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.etag = ""; + + /** + * EvaluationDataset createdBy. + * @member {string} createdBy + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.createdBy = ""; + + /** + * EvaluationDataset lastUpdatedBy. + * @member {string} lastUpdatedBy + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.lastUpdatedBy = ""; + + /** + * EvaluationDataset aggregatedMetrics. + * @member {google.cloud.ces.v1beta.IAggregatedMetrics|null|undefined} aggregatedMetrics + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.aggregatedMetrics = null; + + /** + * Creates a new EvaluationDataset instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @static + * @param {google.cloud.ces.v1beta.IEvaluationDataset=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationDataset} EvaluationDataset instance + */ + EvaluationDataset.create = function create(properties) { + return new EvaluationDataset(properties); + }; + + /** + * Encodes the specified EvaluationDataset message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationDataset.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @static + * @param {google.cloud.ces.v1beta.IEvaluationDataset} message EvaluationDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationDataset.encode = function encode(message, writer) { + if (!writer) + 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.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.evaluations[i]); + 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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + if (message.createdBy != null && Object.hasOwnProperty.call(message, "createdBy")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.createdBy); + if (message.lastUpdatedBy != null && Object.hasOwnProperty.call(message, "lastUpdatedBy")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.lastUpdatedBy); + if (message.aggregatedMetrics != null && Object.hasOwnProperty.call(message, "aggregatedMetrics")) + $root.google.cloud.ces.v1beta.AggregatedMetrics.encode(message.aggregatedMetrics, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluationDataset message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationDataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @static + * @param {google.cloud.ces.v1beta.IEvaluationDataset} message EvaluationDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationDataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationDataset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationDataset} EvaluationDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationDataset.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationDataset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push(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.etag = reader.string(); + break; + } + case 7: { + message.createdBy = reader.string(); + break; + } + case 8: { + message.lastUpdatedBy = reader.string(); + break; + } + case 9: { + message.aggregatedMetrics = $root.google.cloud.ces.v1beta.AggregatedMetrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationDataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationDataset} EvaluationDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationDataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationDataset message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationDataset.verify = function verify(message) { + if (typeof message !== "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.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) + if (!$util.isString(message.evaluations[i])) + return "evaluations: 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.createdBy != null && message.hasOwnProperty("createdBy")) + if (!$util.isString(message.createdBy)) + return "createdBy: string expected"; + if (message.lastUpdatedBy != null && message.hasOwnProperty("lastUpdatedBy")) + if (!$util.isString(message.lastUpdatedBy)) + return "lastUpdatedBy: string expected"; + if (message.aggregatedMetrics != null && message.hasOwnProperty("aggregatedMetrics")) { + var error = $root.google.cloud.ces.v1beta.AggregatedMetrics.verify(message.aggregatedMetrics); + if (error) + return "aggregatedMetrics." + error; + } + return null; + }; + + /** + * Creates an EvaluationDataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationDataset} EvaluationDataset + */ + EvaluationDataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationDataset) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationDataset(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationDataset.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) + message.evaluations[i] = String(object.evaluations[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationDataset.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.ces.v1beta.EvaluationDataset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.createdBy != null) + message.createdBy = String(object.createdBy); + if (object.lastUpdatedBy != null) + message.lastUpdatedBy = String(object.lastUpdatedBy); + if (object.aggregatedMetrics != null) { + if (typeof object.aggregatedMetrics !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationDataset.aggregatedMetrics: object expected"); + message.aggregatedMetrics = $root.google.cloud.ces.v1beta.AggregatedMetrics.fromObject(object.aggregatedMetrics); + } + return message; + }; + + /** + * Creates a plain object from an EvaluationDataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @static + * @param {google.cloud.ces.v1beta.EvaluationDataset} message EvaluationDataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationDataset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluations = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.createdBy = ""; + object.lastUpdatedBy = ""; + object.aggregatedMetrics = 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.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = message.evaluations[j]; + } + 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.createdBy != null && message.hasOwnProperty("createdBy")) + object.createdBy = message.createdBy; + if (message.lastUpdatedBy != null && message.hasOwnProperty("lastUpdatedBy")) + object.lastUpdatedBy = message.lastUpdatedBy; + if (message.aggregatedMetrics != null && message.hasOwnProperty("aggregatedMetrics")) + object.aggregatedMetrics = $root.google.cloud.ces.v1beta.AggregatedMetrics.toObject(message.aggregatedMetrics, options); + return object; + }; + + /** + * Converts this EvaluationDataset to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @instance + * @returns {Object.} JSON object + */ + EvaluationDataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationDataset + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationDataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationDataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationDataset"; + }; + + return EvaluationDataset; + })(); + + v1beta.EvaluationResult = (function() { + + /** + * Properties of an EvaluationResult. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluationResult + * @property {google.cloud.ces.v1beta.EvaluationResult.IGoldenResult|null} [goldenResult] EvaluationResult goldenResult + * @property {google.cloud.ces.v1beta.EvaluationResult.IScenarioResult|null} [scenarioResult] EvaluationResult scenarioResult + * @property {string|null} [name] EvaluationResult name + * @property {string|null} [displayName] EvaluationResult displayName + * @property {google.protobuf.ITimestamp|null} [createTime] EvaluationResult createTime + * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [evaluationStatus] EvaluationResult evaluationStatus + * @property {string|null} [evaluationRun] EvaluationResult evaluationRun + * @property {google.cloud.ces.v1beta.IEvaluationPersona|null} [persona] EvaluationResult persona + * @property {google.cloud.ces.v1beta.IEvaluationErrorInfo|null} [errorInfo] EvaluationResult errorInfo + * @property {google.rpc.IStatus|null} [error] EvaluationResult error + * @property {string|null} [initiatedBy] EvaluationResult initiatedBy + * @property {string|null} [appVersion] EvaluationResult appVersion + * @property {string|null} [appVersionDisplayName] EvaluationResult appVersionDisplayName + * @property {string|null} [changelog] EvaluationResult changelog + * @property {google.protobuf.ITimestamp|null} [changelogCreateTime] EvaluationResult changelogCreateTime + * @property {google.cloud.ces.v1beta.EvaluationResult.ExecutionState|null} [executionState] EvaluationResult executionState + * @property {google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null} [evaluationMetricsThresholds] EvaluationResult evaluationMetricsThresholds + * @property {google.cloud.ces.v1beta.IEvaluationConfig|null} [config] EvaluationResult config + * @property {google.cloud.ces.v1beta.GoldenRunMethod|null} [goldenRunMethod] EvaluationResult goldenRunMethod + */ + + /** + * Constructs a new EvaluationResult. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationResult. + * @implements IEvaluationResult + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluationResult=} [properties] Properties to set + */ + function EvaluationResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationResult goldenResult. + * @member {google.cloud.ces.v1beta.EvaluationResult.IGoldenResult|null|undefined} goldenResult + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.goldenResult = null; + + /** + * EvaluationResult scenarioResult. + * @member {google.cloud.ces.v1beta.EvaluationResult.IScenarioResult|null|undefined} scenarioResult + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.scenarioResult = null; + + /** + * EvaluationResult name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.name = ""; + + /** + * EvaluationResult displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.displayName = ""; + + /** + * EvaluationResult createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.createTime = null; + + /** + * EvaluationResult evaluationStatus. + * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} evaluationStatus + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.evaluationStatus = 0; + + /** + * EvaluationResult evaluationRun. + * @member {string} evaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.evaluationRun = ""; + + /** + * EvaluationResult persona. + * @member {google.cloud.ces.v1beta.IEvaluationPersona|null|undefined} persona + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.persona = null; + + /** + * EvaluationResult errorInfo. + * @member {google.cloud.ces.v1beta.IEvaluationErrorInfo|null|undefined} errorInfo + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.errorInfo = null; + + /** + * EvaluationResult error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.error = null; + + /** + * EvaluationResult initiatedBy. + * @member {string} initiatedBy + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.initiatedBy = ""; + + /** + * EvaluationResult appVersion. + * @member {string} appVersion + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.appVersion = ""; + + /** + * EvaluationResult appVersionDisplayName. + * @member {string} appVersionDisplayName + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.appVersionDisplayName = ""; + + /** + * EvaluationResult changelog. + * @member {string} changelog + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.changelog = ""; + + /** + * EvaluationResult changelogCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} changelogCreateTime + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.changelogCreateTime = null; + + /** + * EvaluationResult executionState. + * @member {google.cloud.ces.v1beta.EvaluationResult.ExecutionState} executionState + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.executionState = 0; + + /** + * EvaluationResult evaluationMetricsThresholds. + * @member {google.cloud.ces.v1beta.IEvaluationMetricsThresholds|null|undefined} evaluationMetricsThresholds + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.evaluationMetricsThresholds = null; + + /** + * EvaluationResult config. + * @member {google.cloud.ces.v1beta.IEvaluationConfig|null|undefined} config + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.config = null; + + /** + * EvaluationResult goldenRunMethod. + * @member {google.cloud.ces.v1beta.GoldenRunMethod} goldenRunMethod + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + EvaluationResult.prototype.goldenRunMethod = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EvaluationResult result. + * @member {"goldenResult"|"scenarioResult"|undefined} result + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + */ + Object.defineProperty(EvaluationResult.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["goldenResult", "scenarioResult"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EvaluationResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @static + * @param {google.cloud.ces.v1beta.IEvaluationResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult} EvaluationResult instance + */ + EvaluationResult.create = function create(properties) { + return new EvaluationResult(properties); + }; + + /** + * Encodes the specified EvaluationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @static + * @param {google.cloud.ces.v1beta.IEvaluationResult} message EvaluationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationResult.encode = function encode(message, writer) { + if (!writer) + 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.evaluationStatus != null && Object.hasOwnProperty.call(message, "evaluationStatus")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.evaluationStatus); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.evaluationRun != null && Object.hasOwnProperty.call(message, "evaluationRun")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.evaluationRun); + if (message.goldenResult != null && Object.hasOwnProperty.call(message, "goldenResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.encode(message.goldenResult, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.scenarioResult != null && Object.hasOwnProperty.call(message, "scenarioResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.encode(message.scenarioResult, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.initiatedBy != null && Object.hasOwnProperty.call(message, "initiatedBy")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.initiatedBy); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.appVersion); + if (message.executionState != null && Object.hasOwnProperty.call(message, "executionState")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.executionState); + if (message.evaluationMetricsThresholds != null && Object.hasOwnProperty.call(message, "evaluationMetricsThresholds")) + $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.encode(message.evaluationMetricsThresholds, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.appVersionDisplayName != null && Object.hasOwnProperty.call(message, "appVersionDisplayName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.appVersionDisplayName); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.errorInfo != null && Object.hasOwnProperty.call(message, "errorInfo")) + $root.google.cloud.ces.v1beta.EvaluationErrorInfo.encode(message.errorInfo, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.persona != null && Object.hasOwnProperty.call(message, "persona")) + $root.google.cloud.ces.v1beta.EvaluationPersona.encode(message.persona, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.ces.v1beta.EvaluationConfig.encode(message.config, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.goldenRunMethod != null && Object.hasOwnProperty.call(message, "goldenRunMethod")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.goldenRunMethod); + if (message.changelog != null && Object.hasOwnProperty.call(message, "changelog")) + writer.uint32(/* id 21, wireType 2 =*/170).string(message.changelog); + if (message.changelogCreateTime != null && Object.hasOwnProperty.call(message, "changelogCreateTime")) + $root.google.protobuf.Timestamp.encode(message.changelogCreateTime, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @static + * @param {google.cloud.ces.v1beta.IEvaluationResult} message EvaluationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult} EvaluationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 7: { + message.goldenResult = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.decode(reader, reader.uint32()); + break; + } + case 8: { + message.scenarioResult = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.evaluationStatus = reader.int32(); + break; + } + case 6: { + message.evaluationRun = reader.string(); + break; + } + case 17: { + message.persona = $root.google.cloud.ces.v1beta.EvaluationPersona.decode(reader, reader.uint32()); + break; + } + case 15: { + message.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.decode(reader, reader.uint32()); + break; + } + case 14: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 9: { + message.initiatedBy = reader.string(); + break; + } + case 10: { + message.appVersion = reader.string(); + break; + } + case 13: { + message.appVersionDisplayName = reader.string(); + break; + } + case 21: { + message.changelog = reader.string(); + break; + } + case 22: { + message.changelogCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.executionState = reader.int32(); + break; + } + case 12: { + message.evaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.decode(reader, reader.uint32()); + break; + } + case 18: { + message.config = $root.google.cloud.ces.v1beta.EvaluationConfig.decode(reader, reader.uint32()); + break; + } + case 19: { + message.goldenRunMethod = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult} EvaluationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.goldenResult != null && message.hasOwnProperty("goldenResult")) { + properties.result = 1; + { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.verify(message.goldenResult); + if (error) + return "goldenResult." + error; + } + } + if (message.scenarioResult != null && message.hasOwnProperty("scenarioResult")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.verify(message.scenarioResult); + if (error) + return "scenarioResult." + 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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.evaluationStatus != null && message.hasOwnProperty("evaluationStatus")) + switch (message.evaluationStatus) { + default: + return "evaluationStatus: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) + if (!$util.isString(message.evaluationRun)) + return "evaluationRun: string expected"; + if (message.persona != null && message.hasOwnProperty("persona")) { + var error = $root.google.cloud.ces.v1beta.EvaluationPersona.verify(message.persona); + if (error) + return "persona." + error; + } + if (message.errorInfo != null && message.hasOwnProperty("errorInfo")) { + var error = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.verify(message.errorInfo); + if (error) + return "errorInfo." + error; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.initiatedBy != null && message.hasOwnProperty("initiatedBy")) + if (!$util.isString(message.initiatedBy)) + return "initiatedBy: string expected"; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (!$util.isString(message.appVersion)) + return "appVersion: string expected"; + if (message.appVersionDisplayName != null && message.hasOwnProperty("appVersionDisplayName")) + if (!$util.isString(message.appVersionDisplayName)) + return "appVersionDisplayName: string expected"; + if (message.changelog != null && message.hasOwnProperty("changelog")) + if (!$util.isString(message.changelog)) + return "changelog: string expected"; + if (message.changelogCreateTime != null && message.hasOwnProperty("changelogCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.changelogCreateTime); + if (error) + return "changelogCreateTime." + error; + } + if (message.executionState != null && message.hasOwnProperty("executionState")) + switch (message.executionState) { + default: + return "executionState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.evaluationMetricsThresholds != null && message.hasOwnProperty("evaluationMetricsThresholds")) { + var error = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.verify(message.evaluationMetricsThresholds); + if (error) + return "evaluationMetricsThresholds." + error; + } + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.ces.v1beta.EvaluationConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) + switch (message.goldenRunMethod) { + default: + return "goldenRunMethod: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an EvaluationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult} EvaluationResult + */ + EvaluationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult(); + if (object.goldenResult != null) { + if (typeof object.goldenResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.goldenResult: object expected"); + message.goldenResult = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.fromObject(object.goldenResult); + } + if (object.scenarioResult != null) { + if (typeof object.scenarioResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.scenarioResult: object expected"); + message.scenarioResult = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.fromObject(object.scenarioResult); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + switch (object.evaluationStatus) { + default: + if (typeof object.evaluationStatus === "number") { + message.evaluationStatus = object.evaluationStatus; + break; + } + break; + case "OUTCOME_UNSPECIFIED": + case 0: + message.evaluationStatus = 0; + break; + case "PASS": + case 1: + message.evaluationStatus = 1; + break; + case "FAIL": + case 2: + message.evaluationStatus = 2; + break; + } + if (object.evaluationRun != null) + message.evaluationRun = String(object.evaluationRun); + if (object.persona != null) { + if (typeof object.persona !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.persona: object expected"); + message.persona = $root.google.cloud.ces.v1beta.EvaluationPersona.fromObject(object.persona); + } + if (object.errorInfo != null) { + if (typeof object.errorInfo !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.errorInfo: object expected"); + message.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.fromObject(object.errorInfo); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.initiatedBy != null) + message.initiatedBy = String(object.initiatedBy); + if (object.appVersion != null) + message.appVersion = String(object.appVersion); + if (object.appVersionDisplayName != null) + message.appVersionDisplayName = String(object.appVersionDisplayName); + if (object.changelog != null) + message.changelog = String(object.changelog); + if (object.changelogCreateTime != null) { + if (typeof object.changelogCreateTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.changelogCreateTime: object expected"); + message.changelogCreateTime = $root.google.protobuf.Timestamp.fromObject(object.changelogCreateTime); + } + switch (object.executionState) { + default: + if (typeof object.executionState === "number") { + message.executionState = object.executionState; + break; + } + break; + case "EXECUTION_STATE_UNSPECIFIED": + case 0: + message.executionState = 0; + break; + case "RUNNING": + case 1: + message.executionState = 1; + break; + case "COMPLETED": + case 2: + message.executionState = 2; + break; + case "ERROR": + case 3: + message.executionState = 3; + break; + } + if (object.evaluationMetricsThresholds != null) { + if (typeof object.evaluationMetricsThresholds !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.evaluationMetricsThresholds: object expected"); + message.evaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.fromObject(object.evaluationMetricsThresholds); + } + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.config: object expected"); + message.config = $root.google.cloud.ces.v1beta.EvaluationConfig.fromObject(object.config); + } + switch (object.goldenRunMethod) { + default: + if (typeof object.goldenRunMethod === "number") { + message.goldenRunMethod = object.goldenRunMethod; + break; + } + break; + case "GOLDEN_RUN_METHOD_UNSPECIFIED": + case 0: + message.goldenRunMethod = 0; + break; + case "STABLE": + case 1: + message.goldenRunMethod = 1; + break; + case "NAIVE": + case 2: + message.goldenRunMethod = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an EvaluationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult} message EvaluationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.evaluationStatus = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; + object.createTime = null; + object.evaluationRun = ""; + object.initiatedBy = ""; + object.appVersion = ""; + object.executionState = options.enums === String ? "EXECUTION_STATE_UNSPECIFIED" : 0; + object.evaluationMetricsThresholds = null; + object.appVersionDisplayName = ""; + object.error = null; + object.errorInfo = null; + object.persona = null; + object.config = null; + object.goldenRunMethod = options.enums === String ? "GOLDEN_RUN_METHOD_UNSPECIFIED" : 0; + object.changelog = ""; + object.changelogCreateTime = 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.evaluationStatus != null && message.hasOwnProperty("evaluationStatus")) + object.evaluationStatus = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.evaluationStatus] === undefined ? message.evaluationStatus : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.evaluationStatus] : message.evaluationStatus; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) + object.evaluationRun = message.evaluationRun; + if (message.goldenResult != null && message.hasOwnProperty("goldenResult")) { + object.goldenResult = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.toObject(message.goldenResult, options); + if (options.oneofs) + object.result = "goldenResult"; + } + if (message.scenarioResult != null && message.hasOwnProperty("scenarioResult")) { + object.scenarioResult = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.toObject(message.scenarioResult, options); + if (options.oneofs) + object.result = "scenarioResult"; + } + if (message.initiatedBy != null && message.hasOwnProperty("initiatedBy")) + object.initiatedBy = message.initiatedBy; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + object.appVersion = message.appVersion; + if (message.executionState != null && message.hasOwnProperty("executionState")) + object.executionState = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.ExecutionState[message.executionState] === undefined ? message.executionState : $root.google.cloud.ces.v1beta.EvaluationResult.ExecutionState[message.executionState] : message.executionState; + if (message.evaluationMetricsThresholds != null && message.hasOwnProperty("evaluationMetricsThresholds")) + object.evaluationMetricsThresholds = $root.google.cloud.ces.v1beta.EvaluationMetricsThresholds.toObject(message.evaluationMetricsThresholds, options); + if (message.appVersionDisplayName != null && message.hasOwnProperty("appVersionDisplayName")) + object.appVersionDisplayName = message.appVersionDisplayName; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.errorInfo != null && message.hasOwnProperty("errorInfo")) + object.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.toObject(message.errorInfo, options); + if (message.persona != null && message.hasOwnProperty("persona")) + object.persona = $root.google.cloud.ces.v1beta.EvaluationPersona.toObject(message.persona, options); + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.ces.v1beta.EvaluationConfig.toObject(message.config, options); + if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) + object.goldenRunMethod = options.enums === String ? $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] === undefined ? message.goldenRunMethod : $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] : message.goldenRunMethod; + if (message.changelog != null && message.hasOwnProperty("changelog")) + object.changelog = message.changelog; + if (message.changelogCreateTime != null && message.hasOwnProperty("changelogCreateTime")) + object.changelogCreateTime = $root.google.protobuf.Timestamp.toObject(message.changelogCreateTime, options); + return object; + }; + + /** + * Converts this EvaluationResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @instance + * @returns {Object.} JSON object + */ + EvaluationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult"; + }; + + EvaluationResult.GoldenExpectationOutcome = (function() { + + /** + * Properties of a GoldenExpectationOutcome. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IGoldenExpectationOutcome + * @property {google.cloud.ces.v1beta.IToolCall|null} [observedToolCall] GoldenExpectationOutcome observedToolCall + * @property {google.cloud.ces.v1beta.IToolResponse|null} [observedToolResponse] GoldenExpectationOutcome observedToolResponse + * @property {google.cloud.ces.v1beta.IMessage|null} [observedAgentResponse] GoldenExpectationOutcome observedAgentResponse + * @property {google.cloud.ces.v1beta.IAgentTransfer|null} [observedAgentTransfer] GoldenExpectationOutcome observedAgentTransfer + * @property {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null} [expectation] GoldenExpectationOutcome expectation + * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [outcome] GoldenExpectationOutcome outcome + * @property {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null} [semanticSimilarityResult] GoldenExpectationOutcome semanticSimilarityResult + * @property {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult|null} [toolInvocationResult] GoldenExpectationOutcome toolInvocationResult + */ + + /** + * Constructs a new GoldenExpectationOutcome. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a GoldenExpectationOutcome. + * @implements IGoldenExpectationOutcome + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome=} [properties] Properties to set + */ + function GoldenExpectationOutcome(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoldenExpectationOutcome observedToolCall. + * @member {google.cloud.ces.v1beta.IToolCall|null|undefined} observedToolCall + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + */ + GoldenExpectationOutcome.prototype.observedToolCall = null; + + /** + * GoldenExpectationOutcome observedToolResponse. + * @member {google.cloud.ces.v1beta.IToolResponse|null|undefined} observedToolResponse + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + */ + GoldenExpectationOutcome.prototype.observedToolResponse = null; + + /** + * GoldenExpectationOutcome observedAgentResponse. + * @member {google.cloud.ces.v1beta.IMessage|null|undefined} observedAgentResponse + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + */ + GoldenExpectationOutcome.prototype.observedAgentResponse = null; + + /** + * GoldenExpectationOutcome observedAgentTransfer. + * @member {google.cloud.ces.v1beta.IAgentTransfer|null|undefined} observedAgentTransfer + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + */ + GoldenExpectationOutcome.prototype.observedAgentTransfer = null; + + /** + * GoldenExpectationOutcome expectation. + * @member {google.cloud.ces.v1beta.Evaluation.IGoldenExpectation|null|undefined} expectation + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + */ + GoldenExpectationOutcome.prototype.expectation = null; + + /** + * GoldenExpectationOutcome outcome. + * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} outcome + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + */ + GoldenExpectationOutcome.prototype.outcome = 0; + + /** + * GoldenExpectationOutcome semanticSimilarityResult. + * @member {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null|undefined} semanticSimilarityResult + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + */ + GoldenExpectationOutcome.prototype.semanticSimilarityResult = null; + + /** + * GoldenExpectationOutcome toolInvocationResult. + * @member {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult|null|undefined} toolInvocationResult + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + */ + GoldenExpectationOutcome.prototype.toolInvocationResult = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GoldenExpectationOutcome result. + * @member {"observedToolCall"|"observedToolResponse"|"observedAgentResponse"|"observedAgentTransfer"|undefined} result + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + */ + Object.defineProperty(GoldenExpectationOutcome.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["observedToolCall", "observedToolResponse", "observedAgentResponse", "observedAgentTransfer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GoldenExpectationOutcome instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome} GoldenExpectationOutcome instance + */ + GoldenExpectationOutcome.create = function create(properties) { + return new GoldenExpectationOutcome(properties); + }; + + /** + * Encodes the specified GoldenExpectationOutcome message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome} message GoldenExpectationOutcome message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenExpectationOutcome.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expectation != null && Object.hasOwnProperty.call(message, "expectation")) + $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.encode(message.expectation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.observedToolCall != null && Object.hasOwnProperty.call(message, "observedToolCall")) + $root.google.cloud.ces.v1beta.ToolCall.encode(message.observedToolCall, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.observedToolResponse != null && Object.hasOwnProperty.call(message, "observedToolResponse")) + $root.google.cloud.ces.v1beta.ToolResponse.encode(message.observedToolResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.observedAgentResponse != null && Object.hasOwnProperty.call(message, "observedAgentResponse")) + $root.google.cloud.ces.v1beta.Message.encode(message.observedAgentResponse, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.observedAgentTransfer != null && Object.hasOwnProperty.call(message, "observedAgentTransfer")) + $root.google.cloud.ces.v1beta.AgentTransfer.encode(message.observedAgentTransfer, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.outcome); + if (message.semanticSimilarityResult != null && Object.hasOwnProperty.call(message, "semanticSimilarityResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.encode(message.semanticSimilarityResult, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.toolInvocationResult != null && Object.hasOwnProperty.call(message, "toolInvocationResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.encode(message.toolInvocationResult, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoldenExpectationOutcome message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenExpectationOutcome} message GoldenExpectationOutcome message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenExpectationOutcome.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoldenExpectationOutcome message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome} GoldenExpectationOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenExpectationOutcome.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.observedToolCall = $root.google.cloud.ces.v1beta.ToolCall.decode(reader, reader.uint32()); + break; + } + case 3: { + message.observedToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32()); + break; + } + case 4: { + message.observedAgentResponse = $root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32()); + break; + } + case 5: { + message.observedAgentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.decode(reader, reader.uint32()); + break; + } + case 1: { + message.expectation = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.decode(reader, reader.uint32()); + break; + } + case 6: { + message.outcome = reader.int32(); + break; + } + case 7: { + message.semanticSimilarityResult = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.decode(reader, reader.uint32()); + break; + } + case 8: { + message.toolInvocationResult = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoldenExpectationOutcome message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome} GoldenExpectationOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenExpectationOutcome.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoldenExpectationOutcome message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoldenExpectationOutcome.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.observedToolCall != null && message.hasOwnProperty("observedToolCall")) { + properties.result = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolCall.verify(message.observedToolCall); + if (error) + return "observedToolCall." + error; + } + } + if (message.observedToolResponse != null && message.hasOwnProperty("observedToolResponse")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.observedToolResponse); + if (error) + return "observedToolResponse." + error; + } + } + if (message.observedAgentResponse != null && message.hasOwnProperty("observedAgentResponse")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.cloud.ces.v1beta.Message.verify(message.observedAgentResponse); + if (error) + return "observedAgentResponse." + error; + } + } + if (message.observedAgentTransfer != null && message.hasOwnProperty("observedAgentTransfer")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.cloud.ces.v1beta.AgentTransfer.verify(message.observedAgentTransfer); + if (error) + return "observedAgentTransfer." + error; + } + } + if (message.expectation != null && message.hasOwnProperty("expectation")) { + var error = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.verify(message.expectation); + if (error) + return "expectation." + error; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + switch (message.outcome) { + default: + return "outcome: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.semanticSimilarityResult != null && message.hasOwnProperty("semanticSimilarityResult")) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.verify(message.semanticSimilarityResult); + if (error) + return "semanticSimilarityResult." + error; + } + if (message.toolInvocationResult != null && message.hasOwnProperty("toolInvocationResult")) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.verify(message.toolInvocationResult); + if (error) + return "toolInvocationResult." + error; + } + return null; + }; + + /** + * Creates a GoldenExpectationOutcome message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome} GoldenExpectationOutcome + */ + GoldenExpectationOutcome.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome(); + if (object.observedToolCall != null) { + if (typeof object.observedToolCall !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.observedToolCall: object expected"); + message.observedToolCall = $root.google.cloud.ces.v1beta.ToolCall.fromObject(object.observedToolCall); + } + if (object.observedToolResponse != null) { + if (typeof object.observedToolResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.observedToolResponse: object expected"); + message.observedToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.observedToolResponse); + } + if (object.observedAgentResponse != null) { + if (typeof object.observedAgentResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.observedAgentResponse: object expected"); + message.observedAgentResponse = $root.google.cloud.ces.v1beta.Message.fromObject(object.observedAgentResponse); + } + if (object.observedAgentTransfer != null) { + if (typeof object.observedAgentTransfer !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.observedAgentTransfer: object expected"); + message.observedAgentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.fromObject(object.observedAgentTransfer); + } + if (object.expectation != null) { + if (typeof object.expectation !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.expectation: object expected"); + message.expectation = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.fromObject(object.expectation); + } + switch (object.outcome) { + default: + if (typeof object.outcome === "number") { + message.outcome = object.outcome; + break; + } + break; + case "OUTCOME_UNSPECIFIED": + case 0: + message.outcome = 0; + break; + case "PASS": + case 1: + message.outcome = 1; + break; + case "FAIL": + case 2: + message.outcome = 2; + break; + } + if (object.semanticSimilarityResult != null) { + if (typeof object.semanticSimilarityResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.semanticSimilarityResult: object expected"); + message.semanticSimilarityResult = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.fromObject(object.semanticSimilarityResult); + } + if (object.toolInvocationResult != null) { + if (typeof object.toolInvocationResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.toolInvocationResult: object expected"); + message.toolInvocationResult = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.fromObject(object.toolInvocationResult); + } + return message; + }; + + /** + * Creates a plain object from a GoldenExpectationOutcome message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome} message GoldenExpectationOutcome + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoldenExpectationOutcome.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expectation = null; + object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; + object.semanticSimilarityResult = null; + object.toolInvocationResult = null; + } + if (message.expectation != null && message.hasOwnProperty("expectation")) + object.expectation = $root.google.cloud.ces.v1beta.Evaluation.GoldenExpectation.toObject(message.expectation, options); + if (message.observedToolCall != null && message.hasOwnProperty("observedToolCall")) { + object.observedToolCall = $root.google.cloud.ces.v1beta.ToolCall.toObject(message.observedToolCall, options); + if (options.oneofs) + object.result = "observedToolCall"; + } + if (message.observedToolResponse != null && message.hasOwnProperty("observedToolResponse")) { + object.observedToolResponse = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.observedToolResponse, options); + if (options.oneofs) + object.result = "observedToolResponse"; + } + if (message.observedAgentResponse != null && message.hasOwnProperty("observedAgentResponse")) { + object.observedAgentResponse = $root.google.cloud.ces.v1beta.Message.toObject(message.observedAgentResponse, options); + if (options.oneofs) + object.result = "observedAgentResponse"; + } + if (message.observedAgentTransfer != null && message.hasOwnProperty("observedAgentTransfer")) { + object.observedAgentTransfer = $root.google.cloud.ces.v1beta.AgentTransfer.toObject(message.observedAgentTransfer, options); + if (options.oneofs) + object.result = "observedAgentTransfer"; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + object.outcome = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] : message.outcome; + if (message.semanticSimilarityResult != null && message.hasOwnProperty("semanticSimilarityResult")) + object.semanticSimilarityResult = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.toObject(message.semanticSimilarityResult, options); + if (message.toolInvocationResult != null && message.hasOwnProperty("toolInvocationResult")) + object.toolInvocationResult = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.toObject(message.toolInvocationResult, options); + return object; + }; + + /** + * Converts this GoldenExpectationOutcome to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @instance + * @returns {Object.} JSON object + */ + GoldenExpectationOutcome.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoldenExpectationOutcome + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoldenExpectationOutcome.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome"; + }; + + GoldenExpectationOutcome.ToolInvocationResult = (function() { + + /** + * Properties of a ToolInvocationResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @interface IToolInvocationResult + * @property {number|null} [parameterCorrectnessScore] ToolInvocationResult parameterCorrectnessScore + * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [outcome] ToolInvocationResult outcome + * @property {string|null} [explanation] ToolInvocationResult explanation + */ + + /** + * Constructs a new ToolInvocationResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome + * @classdesc Represents a ToolInvocationResult. + * @implements IToolInvocationResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult=} [properties] Properties to set + */ + function ToolInvocationResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolInvocationResult parameterCorrectnessScore. + * @member {number|null|undefined} parameterCorrectnessScore + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @instance + */ + ToolInvocationResult.prototype.parameterCorrectnessScore = null; + + /** + * ToolInvocationResult outcome. + * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} outcome + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @instance + */ + ToolInvocationResult.prototype.outcome = 0; + + /** + * ToolInvocationResult explanation. + * @member {string} explanation + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @instance + */ + ToolInvocationResult.prototype.explanation = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ToolInvocationResult.prototype, "_parameterCorrectnessScore", { + get: $util.oneOfGetter($oneOfFields = ["parameterCorrectnessScore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ToolInvocationResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult} ToolInvocationResult instance + */ + ToolInvocationResult.create = function create(properties) { + return new ToolInvocationResult(properties); + }; + + /** + * Encodes the specified ToolInvocationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult} message ToolInvocationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolInvocationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parameterCorrectnessScore != null && Object.hasOwnProperty.call(message, "parameterCorrectnessScore")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.parameterCorrectnessScore); + if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.outcome); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.explanation); + return writer; + }; + + /** + * Encodes the specified ToolInvocationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.IToolInvocationResult} message ToolInvocationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolInvocationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolInvocationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult} ToolInvocationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolInvocationResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parameterCorrectnessScore = reader.float(); + break; + } + case 2: { + message.outcome = reader.int32(); + break; + } + case 3: { + message.explanation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolInvocationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult} ToolInvocationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolInvocationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolInvocationResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolInvocationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parameterCorrectnessScore != null && message.hasOwnProperty("parameterCorrectnessScore")) { + properties._parameterCorrectnessScore = 1; + if (typeof message.parameterCorrectnessScore !== "number") + return "parameterCorrectnessScore: number expected"; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + switch (message.outcome) { + default: + return "outcome: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.explanation != null && message.hasOwnProperty("explanation")) + if (!$util.isString(message.explanation)) + return "explanation: string expected"; + return null; + }; + + /** + * Creates a ToolInvocationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult} ToolInvocationResult + */ + ToolInvocationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult(); + if (object.parameterCorrectnessScore != null) + message.parameterCorrectnessScore = Number(object.parameterCorrectnessScore); + switch (object.outcome) { + default: + if (typeof object.outcome === "number") { + message.outcome = object.outcome; + break; + } + break; + case "OUTCOME_UNSPECIFIED": + case 0: + message.outcome = 0; + break; + case "PASS": + case 1: + message.outcome = 1; + break; + case "FAIL": + case 2: + message.outcome = 2; + break; + } + if (object.explanation != null) + message.explanation = String(object.explanation); + return message; + }; + + /** + * Creates a plain object from a ToolInvocationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult} message ToolInvocationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolInvocationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; + object.explanation = ""; + } + if (message.parameterCorrectnessScore != null && message.hasOwnProperty("parameterCorrectnessScore")) { + object.parameterCorrectnessScore = options.json && !isFinite(message.parameterCorrectnessScore) ? String(message.parameterCorrectnessScore) : message.parameterCorrectnessScore; + if (options.oneofs) + object._parameterCorrectnessScore = "parameterCorrectnessScore"; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + object.outcome = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] : message.outcome; + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = message.explanation; + return object; + }; + + /** + * Converts this ToolInvocationResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @instance + * @returns {Object.} JSON object + */ + ToolInvocationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolInvocationResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolInvocationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.ToolInvocationResult"; + }; + + return ToolInvocationResult; + })(); + + return GoldenExpectationOutcome; + })(); + + EvaluationResult.EvaluationExpectationResult = (function() { + + /** + * Properties of an EvaluationExpectationResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IEvaluationExpectationResult + * @property {string|null} [evaluationExpectation] EvaluationExpectationResult evaluationExpectation + * @property {string|null} [prompt] EvaluationExpectationResult prompt + * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [outcome] EvaluationExpectationResult outcome + * @property {string|null} [explanation] EvaluationExpectationResult explanation + */ + + /** + * Constructs a new EvaluationExpectationResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents an EvaluationExpectationResult. + * @implements IEvaluationExpectationResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult=} [properties] Properties to set + */ + function EvaluationExpectationResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationExpectationResult evaluationExpectation. + * @member {string} evaluationExpectation + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @instance + */ + EvaluationExpectationResult.prototype.evaluationExpectation = ""; + + /** + * EvaluationExpectationResult prompt. + * @member {string} prompt + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @instance + */ + EvaluationExpectationResult.prototype.prompt = ""; + + /** + * EvaluationExpectationResult outcome. + * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} outcome + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @instance + */ + EvaluationExpectationResult.prototype.outcome = 0; + + /** + * EvaluationExpectationResult explanation. + * @member {string} explanation + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @instance + */ + EvaluationExpectationResult.prototype.explanation = ""; + + /** + * Creates a new EvaluationExpectationResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult} EvaluationExpectationResult instance + */ + EvaluationExpectationResult.create = function create(properties) { + return new EvaluationExpectationResult(properties); + }; + + /** + * Encodes the specified EvaluationExpectationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult} message EvaluationExpectationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationExpectationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationExpectation != null && Object.hasOwnProperty.call(message, "evaluationExpectation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.evaluationExpectation); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.prompt); + if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.outcome); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.explanation); + return writer; + }; + + /** + * Encodes the specified EvaluationExpectationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IEvaluationExpectationResult} message EvaluationExpectationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationExpectationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationExpectationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult} EvaluationExpectationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationExpectationResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.evaluationExpectation = reader.string(); + break; + } + case 2: { + message.prompt = reader.string(); + break; + } + case 3: { + message.outcome = reader.int32(); + break; + } + case 4: { + message.explanation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationExpectationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult} EvaluationExpectationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationExpectationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationExpectationResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationExpectationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationExpectation != null && message.hasOwnProperty("evaluationExpectation")) + if (!$util.isString(message.evaluationExpectation)) + return "evaluationExpectation: string expected"; + if (message.prompt != null && message.hasOwnProperty("prompt")) + if (!$util.isString(message.prompt)) + return "prompt: string expected"; + if (message.outcome != null && message.hasOwnProperty("outcome")) + switch (message.outcome) { + default: + return "outcome: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.explanation != null && message.hasOwnProperty("explanation")) + if (!$util.isString(message.explanation)) + return "explanation: string expected"; + return null; + }; + + /** + * Creates an EvaluationExpectationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult} EvaluationExpectationResult + */ + EvaluationExpectationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult(); + if (object.evaluationExpectation != null) + message.evaluationExpectation = String(object.evaluationExpectation); + if (object.prompt != null) + message.prompt = String(object.prompt); + switch (object.outcome) { + default: + if (typeof object.outcome === "number") { + message.outcome = object.outcome; + break; + } + break; + case "OUTCOME_UNSPECIFIED": + case 0: + message.outcome = 0; + break; + case "PASS": + case 1: + message.outcome = 1; + break; + case "FAIL": + case 2: + message.outcome = 2; + break; + } + if (object.explanation != null) + message.explanation = String(object.explanation); + return message; + }; + + /** + * Creates a plain object from an EvaluationExpectationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult} message EvaluationExpectationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationExpectationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.evaluationExpectation = ""; + object.prompt = ""; + object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; + object.explanation = ""; + } + if (message.evaluationExpectation != null && message.hasOwnProperty("evaluationExpectation")) + object.evaluationExpectation = message.evaluationExpectation; + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = message.prompt; + if (message.outcome != null && message.hasOwnProperty("outcome")) + object.outcome = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] : message.outcome; + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = message.explanation; + return object; + }; + + /** + * Converts this EvaluationExpectationResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @instance + * @returns {Object.} JSON object + */ + EvaluationExpectationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationExpectationResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationExpectationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult"; + }; + + return EvaluationExpectationResult; + })(); + + EvaluationResult.GoldenResult = (function() { + + /** + * Properties of a GoldenResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IGoldenResult + * @property {Array.|null} [turnReplayResults] GoldenResult turnReplayResults + * @property {Array.|null} [evaluationExpectationResults] GoldenResult evaluationExpectationResults + */ + + /** + * Constructs a new GoldenResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a GoldenResult. + * @implements IGoldenResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenResult=} [properties] Properties to set + */ + function GoldenResult(properties) { + this.turnReplayResults = []; + this.evaluationExpectationResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoldenResult turnReplayResults. + * @member {Array.} turnReplayResults + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @instance + */ + GoldenResult.prototype.turnReplayResults = $util.emptyArray; + + /** + * GoldenResult evaluationExpectationResults. + * @member {Array.} evaluationExpectationResults + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @instance + */ + GoldenResult.prototype.evaluationExpectationResults = $util.emptyArray; + + /** + * Creates a new GoldenResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult} GoldenResult instance + */ + GoldenResult.create = function create(properties) { + return new GoldenResult(properties); + }; + + /** + * Encodes the specified GoldenResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenResult} message GoldenResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.turnReplayResults != null && message.turnReplayResults.length) + for (var i = 0; i < message.turnReplayResults.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.encode(message.turnReplayResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.evaluationExpectationResults != null && message.evaluationExpectationResults.length) + for (var i = 0; i < message.evaluationExpectationResults.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.encode(message.evaluationExpectationResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoldenResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IGoldenResult} message GoldenResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoldenResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoldenResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult} GoldenResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.turnReplayResults && message.turnReplayResults.length)) + message.turnReplayResults = []; + message.turnReplayResults.push($root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.evaluationExpectationResults && message.evaluationExpectationResults.length)) + message.evaluationExpectationResults = []; + message.evaluationExpectationResults.push($root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoldenResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult} GoldenResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoldenResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoldenResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoldenResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.turnReplayResults != null && message.hasOwnProperty("turnReplayResults")) { + if (!Array.isArray(message.turnReplayResults)) + return "turnReplayResults: array expected"; + for (var i = 0; i < message.turnReplayResults.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.verify(message.turnReplayResults[i]); + if (error) + return "turnReplayResults." + error; + } + } + if (message.evaluationExpectationResults != null && message.hasOwnProperty("evaluationExpectationResults")) { + if (!Array.isArray(message.evaluationExpectationResults)) + return "evaluationExpectationResults: array expected"; + for (var i = 0; i < message.evaluationExpectationResults.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.verify(message.evaluationExpectationResults[i]); + if (error) + return "evaluationExpectationResults." + error; + } + } + return null; + }; + + /** + * Creates a GoldenResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult} GoldenResult + */ + GoldenResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult(); + if (object.turnReplayResults) { + if (!Array.isArray(object.turnReplayResults)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.turnReplayResults: array expected"); + message.turnReplayResults = []; + for (var i = 0; i < object.turnReplayResults.length; ++i) { + if (typeof object.turnReplayResults[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.turnReplayResults: object expected"); + message.turnReplayResults[i] = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.fromObject(object.turnReplayResults[i]); + } + } + if (object.evaluationExpectationResults) { + if (!Array.isArray(object.evaluationExpectationResults)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.evaluationExpectationResults: array expected"); + message.evaluationExpectationResults = []; + for (var i = 0; i < object.evaluationExpectationResults.length; ++i) { + if (typeof object.evaluationExpectationResults[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.evaluationExpectationResults: object expected"); + message.evaluationExpectationResults[i] = $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.fromObject(object.evaluationExpectationResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GoldenResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenResult} message GoldenResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoldenResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.turnReplayResults = []; + object.evaluationExpectationResults = []; + } + if (message.turnReplayResults && message.turnReplayResults.length) { + object.turnReplayResults = []; + for (var j = 0; j < message.turnReplayResults.length; ++j) + object.turnReplayResults[j] = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.toObject(message.turnReplayResults[j], options); + } + if (message.evaluationExpectationResults && message.evaluationExpectationResults.length) { + object.evaluationExpectationResults = []; + for (var j = 0; j < message.evaluationExpectationResults.length; ++j) + object.evaluationExpectationResults[j] = $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.toObject(message.evaluationExpectationResults[j], options); + } + return object; + }; + + /** + * Converts this GoldenResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @instance + * @returns {Object.} JSON object + */ + GoldenResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoldenResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoldenResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.GoldenResult"; + }; + + GoldenResult.TurnReplayResult = (function() { + + /** + * Properties of a TurnReplayResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @interface ITurnReplayResult + * @property {string|null} [conversation] TurnReplayResult conversation + * @property {Array.|null} [expectationOutcome] TurnReplayResult expectationOutcome + * @property {google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult|null} [hallucinationResult] TurnReplayResult hallucinationResult + * @property {number|null} [toolInvocationScore] TurnReplayResult toolInvocationScore + * @property {number|null} [toolOrderedInvocationScore] TurnReplayResult toolOrderedInvocationScore + * @property {google.protobuf.IDuration|null} [turnLatency] TurnReplayResult turnLatency + * @property {Array.|null} [toolCallLatencies] TurnReplayResult toolCallLatencies + * @property {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null} [semanticSimilarityResult] TurnReplayResult semanticSimilarityResult + * @property {google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult|null} [overallToolInvocationResult] TurnReplayResult overallToolInvocationResult + * @property {google.cloud.ces.v1beta.IEvaluationErrorInfo|null} [errorInfo] TurnReplayResult errorInfo + * @property {Array.|null} [spanLatencies] TurnReplayResult spanLatencies + */ + + /** + * Constructs a new TurnReplayResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult + * @classdesc Represents a TurnReplayResult. + * @implements ITurnReplayResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult=} [properties] Properties to set + */ + function TurnReplayResult(properties) { + this.expectationOutcome = []; + this.toolCallLatencies = []; + this.spanLatencies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TurnReplayResult conversation. + * @member {string} conversation + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.conversation = ""; + + /** + * TurnReplayResult expectationOutcome. + * @member {Array.} expectationOutcome + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.expectationOutcome = $util.emptyArray; + + /** + * TurnReplayResult hallucinationResult. + * @member {google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult|null|undefined} hallucinationResult + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.hallucinationResult = null; + + /** + * TurnReplayResult toolInvocationScore. + * @member {number} toolInvocationScore + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.toolInvocationScore = 0; + + /** + * TurnReplayResult toolOrderedInvocationScore. + * @member {number|null|undefined} toolOrderedInvocationScore + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.toolOrderedInvocationScore = null; + + /** + * TurnReplayResult turnLatency. + * @member {google.protobuf.IDuration|null|undefined} turnLatency + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.turnLatency = null; + + /** + * TurnReplayResult toolCallLatencies. + * @member {Array.} toolCallLatencies + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.toolCallLatencies = $util.emptyArray; + + /** + * TurnReplayResult semanticSimilarityResult. + * @member {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult|null|undefined} semanticSimilarityResult + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.semanticSimilarityResult = null; + + /** + * TurnReplayResult overallToolInvocationResult. + * @member {google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult|null|undefined} overallToolInvocationResult + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.overallToolInvocationResult = null; + + /** + * TurnReplayResult errorInfo. + * @member {google.cloud.ces.v1beta.IEvaluationErrorInfo|null|undefined} errorInfo + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.errorInfo = null; + + /** + * TurnReplayResult spanLatencies. + * @member {Array.} spanLatencies + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + */ + TurnReplayResult.prototype.spanLatencies = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TurnReplayResult.prototype, "_toolOrderedInvocationScore", { + get: $util.oneOfGetter($oneOfFields = ["toolOrderedInvocationScore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TurnReplayResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult} TurnReplayResult instance + */ + TurnReplayResult.create = function create(properties) { + return new TurnReplayResult(properties); + }; + + /** + * Encodes the specified TurnReplayResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult} message TurnReplayResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TurnReplayResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversation); + if (message.expectationOutcome != null && message.expectationOutcome.length) + for (var i = 0; i < message.expectationOutcome.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.encode(message.expectationOutcome[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.hallucinationResult != null && Object.hasOwnProperty.call(message, "hallucinationResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.encode(message.hallucinationResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.toolInvocationScore != null && Object.hasOwnProperty.call(message, "toolInvocationScore")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.toolInvocationScore); + if (message.toolOrderedInvocationScore != null && Object.hasOwnProperty.call(message, "toolOrderedInvocationScore")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.toolOrderedInvocationScore); + if (message.turnLatency != null && Object.hasOwnProperty.call(message, "turnLatency")) + $root.google.protobuf.Duration.encode(message.turnLatency, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.toolCallLatencies != null && message.toolCallLatencies.length) + for (var i = 0; i < message.toolCallLatencies.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.encode(message.toolCallLatencies[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.semanticSimilarityResult != null && Object.hasOwnProperty.call(message, "semanticSimilarityResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.encode(message.semanticSimilarityResult, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.overallToolInvocationResult != null && Object.hasOwnProperty.call(message, "overallToolInvocationResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.encode(message.overallToolInvocationResult, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.errorInfo != null && Object.hasOwnProperty.call(message, "errorInfo")) + $root.google.cloud.ces.v1beta.EvaluationErrorInfo.encode(message.errorInfo, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.spanLatencies != null && message.spanLatencies.length) + for (var i = 0; i < message.spanLatencies.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.encode(message.spanLatencies[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TurnReplayResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.ITurnReplayResult} message TurnReplayResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TurnReplayResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TurnReplayResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult} TurnReplayResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TurnReplayResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.conversation = reader.string(); + break; + } + case 2: { + if (!(message.expectationOutcome && message.expectationOutcome.length)) + message.expectationOutcome = []; + message.expectationOutcome.push($root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.decode(reader, reader.uint32())); + break; + } + case 3: { + message.hallucinationResult = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.decode(reader, reader.uint32()); + break; + } + case 4: { + message.toolInvocationScore = reader.float(); + break; + } + case 5: { + message.toolOrderedInvocationScore = reader.float(); + break; + } + case 6: { + message.turnLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.toolCallLatencies && message.toolCallLatencies.length)) + message.toolCallLatencies = []; + message.toolCallLatencies.push($root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.decode(reader, reader.uint32())); + break; + } + case 8: { + message.semanticSimilarityResult = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.decode(reader, reader.uint32()); + break; + } + case 9: { + message.overallToolInvocationResult = $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.decode(reader, reader.uint32()); + break; + } + case 10: { + message.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.spanLatencies && message.spanLatencies.length)) + message.spanLatencies = []; + message.spanLatencies.push($root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TurnReplayResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult} TurnReplayResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TurnReplayResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TurnReplayResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TurnReplayResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.conversation != null && message.hasOwnProperty("conversation")) + if (!$util.isString(message.conversation)) + return "conversation: string expected"; + if (message.expectationOutcome != null && message.hasOwnProperty("expectationOutcome")) { + if (!Array.isArray(message.expectationOutcome)) + return "expectationOutcome: array expected"; + for (var i = 0; i < message.expectationOutcome.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.verify(message.expectationOutcome[i]); + if (error) + return "expectationOutcome." + error; + } + } + if (message.hallucinationResult != null && message.hasOwnProperty("hallucinationResult")) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.verify(message.hallucinationResult); + if (error) + return "hallucinationResult." + error; + } + if (message.toolInvocationScore != null && message.hasOwnProperty("toolInvocationScore")) + if (typeof message.toolInvocationScore !== "number") + return "toolInvocationScore: number expected"; + if (message.toolOrderedInvocationScore != null && message.hasOwnProperty("toolOrderedInvocationScore")) { + properties._toolOrderedInvocationScore = 1; + if (typeof message.toolOrderedInvocationScore !== "number") + return "toolOrderedInvocationScore: number expected"; + } + if (message.turnLatency != null && message.hasOwnProperty("turnLatency")) { + var error = $root.google.protobuf.Duration.verify(message.turnLatency); + if (error) + return "turnLatency." + error; + } + if (message.toolCallLatencies != null && message.hasOwnProperty("toolCallLatencies")) { + if (!Array.isArray(message.toolCallLatencies)) + return "toolCallLatencies: array expected"; + for (var i = 0; i < message.toolCallLatencies.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.verify(message.toolCallLatencies[i]); + if (error) + return "toolCallLatencies." + error; + } + } + if (message.semanticSimilarityResult != null && message.hasOwnProperty("semanticSimilarityResult")) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.verify(message.semanticSimilarityResult); + if (error) + return "semanticSimilarityResult." + error; + } + if (message.overallToolInvocationResult != null && message.hasOwnProperty("overallToolInvocationResult")) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.verify(message.overallToolInvocationResult); + if (error) + return "overallToolInvocationResult." + error; + } + if (message.errorInfo != null && message.hasOwnProperty("errorInfo")) { + var error = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.verify(message.errorInfo); + if (error) + return "errorInfo." + error; + } + if (message.spanLatencies != null && message.hasOwnProperty("spanLatencies")) { + if (!Array.isArray(message.spanLatencies)) + return "spanLatencies: array expected"; + for (var i = 0; i < message.spanLatencies.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.verify(message.spanLatencies[i]); + if (error) + return "spanLatencies." + error; + } + } + return null; + }; + + /** + * Creates a TurnReplayResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult} TurnReplayResult + */ + TurnReplayResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult(); + if (object.conversation != null) + message.conversation = String(object.conversation); + if (object.expectationOutcome) { + if (!Array.isArray(object.expectationOutcome)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.expectationOutcome: array expected"); + message.expectationOutcome = []; + for (var i = 0; i < object.expectationOutcome.length; ++i) { + if (typeof object.expectationOutcome[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.expectationOutcome: object expected"); + message.expectationOutcome[i] = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.fromObject(object.expectationOutcome[i]); + } + } + if (object.hallucinationResult != null) { + if (typeof object.hallucinationResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.hallucinationResult: object expected"); + message.hallucinationResult = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.fromObject(object.hallucinationResult); + } + if (object.toolInvocationScore != null) + message.toolInvocationScore = Number(object.toolInvocationScore); + if (object.toolOrderedInvocationScore != null) + message.toolOrderedInvocationScore = Number(object.toolOrderedInvocationScore); + if (object.turnLatency != null) { + if (typeof object.turnLatency !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.turnLatency: object expected"); + message.turnLatency = $root.google.protobuf.Duration.fromObject(object.turnLatency); + } + if (object.toolCallLatencies) { + if (!Array.isArray(object.toolCallLatencies)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.toolCallLatencies: array expected"); + message.toolCallLatencies = []; + for (var i = 0; i < object.toolCallLatencies.length; ++i) { + if (typeof object.toolCallLatencies[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.toolCallLatencies: object expected"); + message.toolCallLatencies[i] = $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.fromObject(object.toolCallLatencies[i]); + } + } + if (object.semanticSimilarityResult != null) { + if (typeof object.semanticSimilarityResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.semanticSimilarityResult: object expected"); + message.semanticSimilarityResult = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.fromObject(object.semanticSimilarityResult); + } + if (object.overallToolInvocationResult != null) { + if (typeof object.overallToolInvocationResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.overallToolInvocationResult: object expected"); + message.overallToolInvocationResult = $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.fromObject(object.overallToolInvocationResult); + } + if (object.errorInfo != null) { + if (typeof object.errorInfo !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.errorInfo: object expected"); + message.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.fromObject(object.errorInfo); + } + if (object.spanLatencies) { + if (!Array.isArray(object.spanLatencies)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.spanLatencies: array expected"); + message.spanLatencies = []; + for (var i = 0; i < object.spanLatencies.length; ++i) { + if (typeof object.spanLatencies[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult.spanLatencies: object expected"); + message.spanLatencies[i] = $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.fromObject(object.spanLatencies[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TurnReplayResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult} message TurnReplayResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TurnReplayResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.expectationOutcome = []; + object.toolCallLatencies = []; + object.spanLatencies = []; + } + if (options.defaults) { + object.conversation = ""; + object.hallucinationResult = null; + object.toolInvocationScore = 0; + object.turnLatency = null; + object.semanticSimilarityResult = null; + object.overallToolInvocationResult = null; + object.errorInfo = null; + } + if (message.conversation != null && message.hasOwnProperty("conversation")) + object.conversation = message.conversation; + if (message.expectationOutcome && message.expectationOutcome.length) { + object.expectationOutcome = []; + for (var j = 0; j < message.expectationOutcome.length; ++j) + object.expectationOutcome[j] = $root.google.cloud.ces.v1beta.EvaluationResult.GoldenExpectationOutcome.toObject(message.expectationOutcome[j], options); + } + if (message.hallucinationResult != null && message.hasOwnProperty("hallucinationResult")) + object.hallucinationResult = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.toObject(message.hallucinationResult, options); + if (message.toolInvocationScore != null && message.hasOwnProperty("toolInvocationScore")) + object.toolInvocationScore = options.json && !isFinite(message.toolInvocationScore) ? String(message.toolInvocationScore) : message.toolInvocationScore; + if (message.toolOrderedInvocationScore != null && message.hasOwnProperty("toolOrderedInvocationScore")) { + object.toolOrderedInvocationScore = options.json && !isFinite(message.toolOrderedInvocationScore) ? String(message.toolOrderedInvocationScore) : message.toolOrderedInvocationScore; + if (options.oneofs) + object._toolOrderedInvocationScore = "toolOrderedInvocationScore"; + } + if (message.turnLatency != null && message.hasOwnProperty("turnLatency")) + object.turnLatency = $root.google.protobuf.Duration.toObject(message.turnLatency, options); + if (message.toolCallLatencies && message.toolCallLatencies.length) { + object.toolCallLatencies = []; + for (var j = 0; j < message.toolCallLatencies.length; ++j) + object.toolCallLatencies[j] = $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.toObject(message.toolCallLatencies[j], options); + } + if (message.semanticSimilarityResult != null && message.hasOwnProperty("semanticSimilarityResult")) + object.semanticSimilarityResult = $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.toObject(message.semanticSimilarityResult, options); + if (message.overallToolInvocationResult != null && message.hasOwnProperty("overallToolInvocationResult")) + object.overallToolInvocationResult = $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.toObject(message.overallToolInvocationResult, options); + if (message.errorInfo != null && message.hasOwnProperty("errorInfo")) + object.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.toObject(message.errorInfo, options); + if (message.spanLatencies && message.spanLatencies.length) { + object.spanLatencies = []; + for (var j = 0; j < message.spanLatencies.length; ++j) + object.spanLatencies[j] = $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.toObject(message.spanLatencies[j], options); + } + return object; + }; + + /** + * Converts this TurnReplayResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @instance + * @returns {Object.} JSON object + */ + TurnReplayResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TurnReplayResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TurnReplayResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.GoldenResult.TurnReplayResult"; + }; + + return TurnReplayResult; + })(); + + return GoldenResult; + })(); + + EvaluationResult.ScenarioRubricOutcome = (function() { + + /** + * Properties of a ScenarioRubricOutcome. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IScenarioRubricOutcome + * @property {string|null} [rubric] ScenarioRubricOutcome rubric + * @property {number|null} [score] ScenarioRubricOutcome score + * @property {string|null} [scoreExplanation] ScenarioRubricOutcome scoreExplanation + */ + + /** + * Constructs a new ScenarioRubricOutcome. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a ScenarioRubricOutcome. + * @implements IScenarioRubricOutcome + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome=} [properties] Properties to set + */ + function ScenarioRubricOutcome(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScenarioRubricOutcome rubric. + * @member {string} rubric + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @instance + */ + ScenarioRubricOutcome.prototype.rubric = ""; + + /** + * ScenarioRubricOutcome score. + * @member {number|null|undefined} score + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @instance + */ + ScenarioRubricOutcome.prototype.score = null; + + /** + * ScenarioRubricOutcome scoreExplanation. + * @member {string} scoreExplanation + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @instance + */ + ScenarioRubricOutcome.prototype.scoreExplanation = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ScenarioRubricOutcome.prototype, "_score", { + get: $util.oneOfGetter($oneOfFields = ["score"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ScenarioRubricOutcome instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome} ScenarioRubricOutcome instance + */ + ScenarioRubricOutcome.create = function create(properties) { + return new ScenarioRubricOutcome(properties); + }; + + /** + * Encodes the specified ScenarioRubricOutcome message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome} message ScenarioRubricOutcome message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScenarioRubricOutcome.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rubric != null && Object.hasOwnProperty.call(message, "rubric")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.rubric); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + if (message.scoreExplanation != null && Object.hasOwnProperty.call(message, "scoreExplanation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.scoreExplanation); + return writer; + }; + + /** + * Encodes the specified ScenarioRubricOutcome message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioRubricOutcome} message ScenarioRubricOutcome message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScenarioRubricOutcome.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScenarioRubricOutcome message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome} ScenarioRubricOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScenarioRubricOutcome.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rubric = reader.string(); + break; + } + case 2: { + message.score = reader.float(); + break; + } + case 3: { + message.scoreExplanation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScenarioRubricOutcome message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome} ScenarioRubricOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScenarioRubricOutcome.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScenarioRubricOutcome message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScenarioRubricOutcome.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.rubric != null && message.hasOwnProperty("rubric")) + if (!$util.isString(message.rubric)) + return "rubric: string expected"; + if (message.score != null && message.hasOwnProperty("score")) { + properties._score = 1; + if (typeof message.score !== "number") + return "score: number expected"; + } + if (message.scoreExplanation != null && message.hasOwnProperty("scoreExplanation")) + if (!$util.isString(message.scoreExplanation)) + return "scoreExplanation: string expected"; + return null; + }; + + /** + * Creates a ScenarioRubricOutcome message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome} ScenarioRubricOutcome + */ + ScenarioRubricOutcome.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome(); + if (object.rubric != null) + message.rubric = String(object.rubric); + if (object.score != null) + message.score = Number(object.score); + if (object.scoreExplanation != null) + message.scoreExplanation = String(object.scoreExplanation); + return message; + }; + + /** + * Creates a plain object from a ScenarioRubricOutcome message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome} message ScenarioRubricOutcome + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScenarioRubricOutcome.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rubric = ""; + object.scoreExplanation = ""; + } + if (message.rubric != null && message.hasOwnProperty("rubric")) + object.rubric = message.rubric; + if (message.score != null && message.hasOwnProperty("score")) { + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (options.oneofs) + object._score = "score"; + } + if (message.scoreExplanation != null && message.hasOwnProperty("scoreExplanation")) + object.scoreExplanation = message.scoreExplanation; + return object; + }; + + /** + * Converts this ScenarioRubricOutcome to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @instance + * @returns {Object.} JSON object + */ + ScenarioRubricOutcome.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScenarioRubricOutcome + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScenarioRubricOutcome.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome"; + }; + + return ScenarioRubricOutcome; + })(); + + EvaluationResult.ScenarioExpectationOutcome = (function() { + + /** + * Properties of a ScenarioExpectationOutcome. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IScenarioExpectationOutcome + * @property {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall|null} [observedToolCall] ScenarioExpectationOutcome observedToolCall + * @property {google.cloud.ces.v1beta.IMessage|null} [observedAgentResponse] ScenarioExpectationOutcome observedAgentResponse + * @property {google.cloud.ces.v1beta.Evaluation.IScenarioExpectation|null} [expectation] ScenarioExpectationOutcome expectation + * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [outcome] ScenarioExpectationOutcome outcome + */ + + /** + * Constructs a new ScenarioExpectationOutcome. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a ScenarioExpectationOutcome. + * @implements IScenarioExpectationOutcome + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome=} [properties] Properties to set + */ + function ScenarioExpectationOutcome(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScenarioExpectationOutcome observedToolCall. + * @member {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall|null|undefined} observedToolCall + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @instance + */ + ScenarioExpectationOutcome.prototype.observedToolCall = null; + + /** + * ScenarioExpectationOutcome observedAgentResponse. + * @member {google.cloud.ces.v1beta.IMessage|null|undefined} observedAgentResponse + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @instance + */ + ScenarioExpectationOutcome.prototype.observedAgentResponse = null; + + /** + * ScenarioExpectationOutcome expectation. + * @member {google.cloud.ces.v1beta.Evaluation.IScenarioExpectation|null|undefined} expectation + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @instance + */ + ScenarioExpectationOutcome.prototype.expectation = null; + + /** + * ScenarioExpectationOutcome outcome. + * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} outcome + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @instance + */ + ScenarioExpectationOutcome.prototype.outcome = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ScenarioExpectationOutcome result. + * @member {"observedToolCall"|"observedAgentResponse"|undefined} result + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @instance + */ + Object.defineProperty(ScenarioExpectationOutcome.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["observedToolCall", "observedAgentResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ScenarioExpectationOutcome instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome} ScenarioExpectationOutcome instance + */ + ScenarioExpectationOutcome.create = function create(properties) { + return new ScenarioExpectationOutcome(properties); + }; + + /** + * Encodes the specified ScenarioExpectationOutcome message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome} message ScenarioExpectationOutcome message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScenarioExpectationOutcome.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expectation != null && Object.hasOwnProperty.call(message, "expectation")) + $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.encode(message.expectation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.observedToolCall != null && Object.hasOwnProperty.call(message, "observedToolCall")) + $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.encode(message.observedToolCall, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.observedAgentResponse != null && Object.hasOwnProperty.call(message, "observedAgentResponse")) + $root.google.cloud.ces.v1beta.Message.encode(message.observedAgentResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.outcome); + return writer; + }; + + /** + * Encodes the specified ScenarioExpectationOutcome message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioExpectationOutcome} message ScenarioExpectationOutcome message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScenarioExpectationOutcome.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScenarioExpectationOutcome message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome} ScenarioExpectationOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScenarioExpectationOutcome.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.observedToolCall = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.decode(reader, reader.uint32()); + break; + } + case 3: { + message.observedAgentResponse = $root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32()); + break; + } + case 1: { + message.expectation = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outcome = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScenarioExpectationOutcome message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome} ScenarioExpectationOutcome + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScenarioExpectationOutcome.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScenarioExpectationOutcome message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScenarioExpectationOutcome.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.observedToolCall != null && message.hasOwnProperty("observedToolCall")) { + properties.result = 1; + { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.verify(message.observedToolCall); + if (error) + return "observedToolCall." + error; + } + } + if (message.observedAgentResponse != null && message.hasOwnProperty("observedAgentResponse")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.cloud.ces.v1beta.Message.verify(message.observedAgentResponse); + if (error) + return "observedAgentResponse." + error; + } + } + if (message.expectation != null && message.hasOwnProperty("expectation")) { + var error = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.verify(message.expectation); + if (error) + return "expectation." + error; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + switch (message.outcome) { + default: + return "outcome: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ScenarioExpectationOutcome message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome} ScenarioExpectationOutcome + */ + ScenarioExpectationOutcome.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome(); + if (object.observedToolCall != null) { + if (typeof object.observedToolCall !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.observedToolCall: object expected"); + message.observedToolCall = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.fromObject(object.observedToolCall); + } + if (object.observedAgentResponse != null) { + if (typeof object.observedAgentResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.observedAgentResponse: object expected"); + message.observedAgentResponse = $root.google.cloud.ces.v1beta.Message.fromObject(object.observedAgentResponse); + } + if (object.expectation != null) { + if (typeof object.expectation !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.expectation: object expected"); + message.expectation = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.fromObject(object.expectation); + } + switch (object.outcome) { + default: + if (typeof object.outcome === "number") { + message.outcome = object.outcome; + break; + } + break; + case "OUTCOME_UNSPECIFIED": + case 0: + message.outcome = 0; + break; + case "PASS": + case 1: + message.outcome = 1; + break; + case "FAIL": + case 2: + message.outcome = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ScenarioExpectationOutcome message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome} message ScenarioExpectationOutcome + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScenarioExpectationOutcome.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expectation = null; + object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; + } + if (message.expectation != null && message.hasOwnProperty("expectation")) + object.expectation = $root.google.cloud.ces.v1beta.Evaluation.ScenarioExpectation.toObject(message.expectation, options); + if (message.observedToolCall != null && message.hasOwnProperty("observedToolCall")) { + object.observedToolCall = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.toObject(message.observedToolCall, options); + if (options.oneofs) + object.result = "observedToolCall"; + } + if (message.observedAgentResponse != null && message.hasOwnProperty("observedAgentResponse")) { + object.observedAgentResponse = $root.google.cloud.ces.v1beta.Message.toObject(message.observedAgentResponse, options); + if (options.oneofs) + object.result = "observedAgentResponse"; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + object.outcome = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] : message.outcome; + return object; + }; + + /** + * Converts this ScenarioExpectationOutcome to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @instance + * @returns {Object.} JSON object + */ + ScenarioExpectationOutcome.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScenarioExpectationOutcome + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScenarioExpectationOutcome.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome"; + }; + + ScenarioExpectationOutcome.ObservedToolCall = (function() { + + /** + * Properties of an ObservedToolCall. + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @interface IObservedToolCall + * @property {google.cloud.ces.v1beta.IToolCall|null} [toolCall] ObservedToolCall toolCall + * @property {google.cloud.ces.v1beta.IToolResponse|null} [toolResponse] ObservedToolCall toolResponse + */ + + /** + * Constructs a new ObservedToolCall. + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome + * @classdesc Represents an ObservedToolCall. + * @implements IObservedToolCall + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall=} [properties] Properties to set + */ + function ObservedToolCall(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObservedToolCall toolCall. + * @member {google.cloud.ces.v1beta.IToolCall|null|undefined} toolCall + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @instance + */ + ObservedToolCall.prototype.toolCall = null; + + /** + * ObservedToolCall toolResponse. + * @member {google.cloud.ces.v1beta.IToolResponse|null|undefined} toolResponse + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @instance + */ + ObservedToolCall.prototype.toolResponse = null; + + /** + * Creates a new ObservedToolCall instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall} ObservedToolCall instance + */ + ObservedToolCall.create = function create(properties) { + return new ObservedToolCall(properties); + }; + + /** + * Encodes the specified ObservedToolCall message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall} message ObservedToolCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObservedToolCall.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolCall != null && Object.hasOwnProperty.call(message, "toolCall")) + $root.google.cloud.ces.v1beta.ToolCall.encode(message.toolCall, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.toolResponse != null && Object.hasOwnProperty.call(message, "toolResponse")) + $root.google.cloud.ces.v1beta.ToolResponse.encode(message.toolResponse, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ObservedToolCall message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.IObservedToolCall} message ObservedToolCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObservedToolCall.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObservedToolCall message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall} ObservedToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObservedToolCall.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolCall = $root.google.cloud.ces.v1beta.ToolCall.decode(reader, reader.uint32()); + break; + } + case 2: { + message.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObservedToolCall message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall} ObservedToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObservedToolCall.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObservedToolCall message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObservedToolCall.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + var error = $root.google.cloud.ces.v1beta.ToolCall.verify(message.toolCall); + if (error) + return "toolCall." + error; + } + if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { + var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.toolResponse); + if (error) + return "toolResponse." + error; + } + return null; + }; + + /** + * Creates an ObservedToolCall message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall} ObservedToolCall + */ + ObservedToolCall.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall(); + if (object.toolCall != null) { + if (typeof object.toolCall !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.toolCall: object expected"); + message.toolCall = $root.google.cloud.ces.v1beta.ToolCall.fromObject(object.toolCall); + } + if (object.toolResponse != null) { + if (typeof object.toolResponse !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall.toolResponse: object expected"); + message.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.toolResponse); + } + return message; + }; + + /** + * Creates a plain object from an ObservedToolCall message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall} message ObservedToolCall + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObservedToolCall.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.toolCall = null; + object.toolResponse = null; + } + if (message.toolCall != null && message.hasOwnProperty("toolCall")) + object.toolCall = $root.google.cloud.ces.v1beta.ToolCall.toObject(message.toolCall, options); + if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) + object.toolResponse = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.toolResponse, options); + return object; + }; + + /** + * Converts this ObservedToolCall to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @instance + * @returns {Object.} JSON object + */ + ObservedToolCall.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObservedToolCall + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObservedToolCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.ObservedToolCall"; + }; + + return ObservedToolCall; + })(); + + return ScenarioExpectationOutcome; + })(); + + EvaluationResult.ScenarioResult = (function() { + + /** + * Properties of a ScenarioResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IScenarioResult + * @property {string|null} [conversation] ScenarioResult conversation + * @property {string|null} [task] ScenarioResult task + * @property {Array.|null} [userFacts] ScenarioResult userFacts + * @property {Array.|null} [expectationOutcomes] ScenarioResult expectationOutcomes + * @property {Array.|null} [rubricOutcomes] ScenarioResult rubricOutcomes + * @property {Array.|null} [hallucinationResult] ScenarioResult hallucinationResult + * @property {google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult|null} [taskCompletionResult] ScenarioResult taskCompletionResult + * @property {Array.|null} [toolCallLatencies] ScenarioResult toolCallLatencies + * @property {google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult|null} [userGoalSatisfactionResult] ScenarioResult userGoalSatisfactionResult + * @property {boolean|null} [allExpectationsSatisfied] ScenarioResult allExpectationsSatisfied + * @property {boolean|null} [taskCompleted] ScenarioResult taskCompleted + * @property {Array.|null} [spanLatencies] ScenarioResult spanLatencies + * @property {Array.|null} [evaluationExpectationResults] ScenarioResult evaluationExpectationResults + */ + + /** + * Constructs a new ScenarioResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a ScenarioResult. + * @implements IScenarioResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioResult=} [properties] Properties to set + */ + function ScenarioResult(properties) { + this.userFacts = []; + this.expectationOutcomes = []; + this.rubricOutcomes = []; + this.hallucinationResult = []; + this.toolCallLatencies = []; + this.spanLatencies = []; + this.evaluationExpectationResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScenarioResult conversation. + * @member {string} conversation + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.conversation = ""; + + /** + * ScenarioResult task. + * @member {string} task + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.task = ""; + + /** + * ScenarioResult userFacts. + * @member {Array.} userFacts + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.userFacts = $util.emptyArray; + + /** + * ScenarioResult expectationOutcomes. + * @member {Array.} expectationOutcomes + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.expectationOutcomes = $util.emptyArray; + + /** + * ScenarioResult rubricOutcomes. + * @member {Array.} rubricOutcomes + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.rubricOutcomes = $util.emptyArray; + + /** + * ScenarioResult hallucinationResult. + * @member {Array.} hallucinationResult + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.hallucinationResult = $util.emptyArray; + + /** + * ScenarioResult taskCompletionResult. + * @member {google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult|null|undefined} taskCompletionResult + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.taskCompletionResult = null; + + /** + * ScenarioResult toolCallLatencies. + * @member {Array.} toolCallLatencies + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.toolCallLatencies = $util.emptyArray; + + /** + * ScenarioResult userGoalSatisfactionResult. + * @member {google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult|null|undefined} userGoalSatisfactionResult + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.userGoalSatisfactionResult = null; + + /** + * ScenarioResult allExpectationsSatisfied. + * @member {boolean|null|undefined} allExpectationsSatisfied + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.allExpectationsSatisfied = null; + + /** + * ScenarioResult taskCompleted. + * @member {boolean|null|undefined} taskCompleted + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.taskCompleted = null; + + /** + * ScenarioResult spanLatencies. + * @member {Array.} spanLatencies + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.spanLatencies = $util.emptyArray; + + /** + * ScenarioResult evaluationExpectationResults. + * @member {Array.} evaluationExpectationResults + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + */ + ScenarioResult.prototype.evaluationExpectationResults = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ScenarioResult.prototype, "_allExpectationsSatisfied", { + get: $util.oneOfGetter($oneOfFields = ["allExpectationsSatisfied"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ScenarioResult.prototype, "_taskCompleted", { + get: $util.oneOfGetter($oneOfFields = ["taskCompleted"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ScenarioResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioResult} ScenarioResult instance + */ + ScenarioResult.create = function create(properties) { + return new ScenarioResult(properties); + }; + + /** + * Encodes the specified ScenarioResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioResult} message ScenarioResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScenarioResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversation); + if (message.expectationOutcomes != null && message.expectationOutcomes.length) + for (var i = 0; i < message.expectationOutcomes.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.encode(message.expectationOutcomes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.rubricOutcomes != null && message.rubricOutcomes.length) + for (var i = 0; i < message.rubricOutcomes.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.encode(message.rubricOutcomes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.hallucinationResult != null && message.hallucinationResult.length) + for (var i = 0; i < message.hallucinationResult.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.encode(message.hallucinationResult[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.taskCompletionResult != null && Object.hasOwnProperty.call(message, "taskCompletionResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.encode(message.taskCompletionResult, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.toolCallLatencies != null && message.toolCallLatencies.length) + for (var i = 0; i < message.toolCallLatencies.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.encode(message.toolCallLatencies[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.userGoalSatisfactionResult != null && Object.hasOwnProperty.call(message, "userGoalSatisfactionResult")) + $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.encode(message.userGoalSatisfactionResult, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.allExpectationsSatisfied != null && Object.hasOwnProperty.call(message, "allExpectationsSatisfied")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.allExpectationsSatisfied); + if (message.taskCompleted != null && Object.hasOwnProperty.call(message, "taskCompleted")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.taskCompleted); + if (message.task != null && Object.hasOwnProperty.call(message, "task")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.task); + if (message.userFacts != null && message.userFacts.length) + for (var i = 0; i < message.userFacts.length; ++i) + $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.encode(message.userFacts[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.spanLatencies != null && message.spanLatencies.length) + for (var i = 0; i < message.spanLatencies.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.encode(message.spanLatencies[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.evaluationExpectationResults != null && message.evaluationExpectationResults.length) + for (var i = 0; i < message.evaluationExpectationResults.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.encode(message.evaluationExpectationResults[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ScenarioResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IScenarioResult} message ScenarioResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScenarioResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScenarioResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioResult} ScenarioResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScenarioResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.conversation = reader.string(); + break; + } + case 10: { + message.task = reader.string(); + break; + } + case 11: { + if (!(message.userFacts && message.userFacts.length)) + message.userFacts = []; + message.userFacts.push($root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.expectationOutcomes && message.expectationOutcomes.length)) + message.expectationOutcomes = []; + message.expectationOutcomes.push($root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.rubricOutcomes && message.rubricOutcomes.length)) + message.rubricOutcomes = []; + message.rubricOutcomes.push($root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.hallucinationResult && message.hallucinationResult.length)) + message.hallucinationResult = []; + message.hallucinationResult.push($root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.decode(reader, reader.uint32())); + break; + } + case 5: { + message.taskCompletionResult = $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.toolCallLatencies && message.toolCallLatencies.length)) + message.toolCallLatencies = []; + message.toolCallLatencies.push($root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.decode(reader, reader.uint32())); + break; + } + case 7: { + message.userGoalSatisfactionResult = $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.decode(reader, reader.uint32()); + break; + } + case 8: { + message.allExpectationsSatisfied = reader.bool(); + break; + } + case 9: { + message.taskCompleted = reader.bool(); + break; + } + case 12: { + if (!(message.spanLatencies && message.spanLatencies.length)) + message.spanLatencies = []; + message.spanLatencies.push($root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.decode(reader, reader.uint32())); + break; + } + case 13: { + if (!(message.evaluationExpectationResults && message.evaluationExpectationResults.length)) + message.evaluationExpectationResults = []; + message.evaluationExpectationResults.push($root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScenarioResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioResult} ScenarioResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScenarioResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScenarioResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScenarioResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.conversation != null && message.hasOwnProperty("conversation")) + if (!$util.isString(message.conversation)) + return "conversation: string expected"; + if (message.task != null && message.hasOwnProperty("task")) + if (!$util.isString(message.task)) + return "task: string expected"; + if (message.userFacts != null && message.hasOwnProperty("userFacts")) { + if (!Array.isArray(message.userFacts)) + return "userFacts: array expected"; + for (var i = 0; i < message.userFacts.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.verify(message.userFacts[i]); + if (error) + return "userFacts." + error; + } + } + if (message.expectationOutcomes != null && message.hasOwnProperty("expectationOutcomes")) { + if (!Array.isArray(message.expectationOutcomes)) + return "expectationOutcomes: array expected"; + for (var i = 0; i < message.expectationOutcomes.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.verify(message.expectationOutcomes[i]); + if (error) + return "expectationOutcomes." + error; + } + } + if (message.rubricOutcomes != null && message.hasOwnProperty("rubricOutcomes")) { + if (!Array.isArray(message.rubricOutcomes)) + return "rubricOutcomes: array expected"; + for (var i = 0; i < message.rubricOutcomes.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.verify(message.rubricOutcomes[i]); + if (error) + return "rubricOutcomes." + error; + } + } + if (message.hallucinationResult != null && message.hasOwnProperty("hallucinationResult")) { + if (!Array.isArray(message.hallucinationResult)) + return "hallucinationResult: array expected"; + for (var i = 0; i < message.hallucinationResult.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.verify(message.hallucinationResult[i]); + if (error) + return "hallucinationResult." + error; + } + } + if (message.taskCompletionResult != null && message.hasOwnProperty("taskCompletionResult")) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.verify(message.taskCompletionResult); + if (error) + return "taskCompletionResult." + error; + } + if (message.toolCallLatencies != null && message.hasOwnProperty("toolCallLatencies")) { + if (!Array.isArray(message.toolCallLatencies)) + return "toolCallLatencies: array expected"; + for (var i = 0; i < message.toolCallLatencies.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.verify(message.toolCallLatencies[i]); + if (error) + return "toolCallLatencies." + error; + } + } + if (message.userGoalSatisfactionResult != null && message.hasOwnProperty("userGoalSatisfactionResult")) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.verify(message.userGoalSatisfactionResult); + if (error) + return "userGoalSatisfactionResult." + error; + } + if (message.allExpectationsSatisfied != null && message.hasOwnProperty("allExpectationsSatisfied")) { + properties._allExpectationsSatisfied = 1; + if (typeof message.allExpectationsSatisfied !== "boolean") + return "allExpectationsSatisfied: boolean expected"; + } + if (message.taskCompleted != null && message.hasOwnProperty("taskCompleted")) { + properties._taskCompleted = 1; + if (typeof message.taskCompleted !== "boolean") + return "taskCompleted: boolean expected"; + } + if (message.spanLatencies != null && message.hasOwnProperty("spanLatencies")) { + if (!Array.isArray(message.spanLatencies)) + return "spanLatencies: array expected"; + for (var i = 0; i < message.spanLatencies.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.verify(message.spanLatencies[i]); + if (error) + return "spanLatencies." + error; + } + } + if (message.evaluationExpectationResults != null && message.hasOwnProperty("evaluationExpectationResults")) { + if (!Array.isArray(message.evaluationExpectationResults)) + return "evaluationExpectationResults: array expected"; + for (var i = 0; i < message.evaluationExpectationResults.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.verify(message.evaluationExpectationResults[i]); + if (error) + return "evaluationExpectationResults." + error; + } + } + return null; + }; + + /** + * Creates a ScenarioResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.ScenarioResult} ScenarioResult + */ + ScenarioResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioResult(); + if (object.conversation != null) + message.conversation = String(object.conversation); + if (object.task != null) + message.task = String(object.task); + if (object.userFacts) { + if (!Array.isArray(object.userFacts)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.userFacts: array expected"); + message.userFacts = []; + for (var i = 0; i < object.userFacts.length; ++i) { + if (typeof object.userFacts[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.userFacts: object expected"); + message.userFacts[i] = $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.fromObject(object.userFacts[i]); + } + } + if (object.expectationOutcomes) { + if (!Array.isArray(object.expectationOutcomes)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.expectationOutcomes: array expected"); + message.expectationOutcomes = []; + for (var i = 0; i < object.expectationOutcomes.length; ++i) { + if (typeof object.expectationOutcomes[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.expectationOutcomes: object expected"); + message.expectationOutcomes[i] = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.fromObject(object.expectationOutcomes[i]); + } + } + if (object.rubricOutcomes) { + if (!Array.isArray(object.rubricOutcomes)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.rubricOutcomes: array expected"); + message.rubricOutcomes = []; + for (var i = 0; i < object.rubricOutcomes.length; ++i) { + if (typeof object.rubricOutcomes[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.rubricOutcomes: object expected"); + message.rubricOutcomes[i] = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.fromObject(object.rubricOutcomes[i]); + } + } + if (object.hallucinationResult) { + if (!Array.isArray(object.hallucinationResult)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.hallucinationResult: array expected"); + message.hallucinationResult = []; + for (var i = 0; i < object.hallucinationResult.length; ++i) { + if (typeof object.hallucinationResult[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.hallucinationResult: object expected"); + message.hallucinationResult[i] = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.fromObject(object.hallucinationResult[i]); + } + } + if (object.taskCompletionResult != null) { + if (typeof object.taskCompletionResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.taskCompletionResult: object expected"); + message.taskCompletionResult = $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.fromObject(object.taskCompletionResult); + } + if (object.toolCallLatencies) { + if (!Array.isArray(object.toolCallLatencies)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.toolCallLatencies: array expected"); + message.toolCallLatencies = []; + for (var i = 0; i < object.toolCallLatencies.length; ++i) { + if (typeof object.toolCallLatencies[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.toolCallLatencies: object expected"); + message.toolCallLatencies[i] = $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.fromObject(object.toolCallLatencies[i]); + } + } + if (object.userGoalSatisfactionResult != null) { + if (typeof object.userGoalSatisfactionResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.userGoalSatisfactionResult: object expected"); + message.userGoalSatisfactionResult = $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.fromObject(object.userGoalSatisfactionResult); + } + if (object.allExpectationsSatisfied != null) + message.allExpectationsSatisfied = Boolean(object.allExpectationsSatisfied); + if (object.taskCompleted != null) + message.taskCompleted = Boolean(object.taskCompleted); + if (object.spanLatencies) { + if (!Array.isArray(object.spanLatencies)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.spanLatencies: array expected"); + message.spanLatencies = []; + for (var i = 0; i < object.spanLatencies.length; ++i) { + if (typeof object.spanLatencies[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.spanLatencies: object expected"); + message.spanLatencies[i] = $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.fromObject(object.spanLatencies[i]); + } + } + if (object.evaluationExpectationResults) { + if (!Array.isArray(object.evaluationExpectationResults)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.evaluationExpectationResults: array expected"); + message.evaluationExpectationResults = []; + for (var i = 0; i < object.evaluationExpectationResults.length; ++i) { + if (typeof object.evaluationExpectationResults[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ScenarioResult.evaluationExpectationResults: object expected"); + message.evaluationExpectationResults[i] = $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.fromObject(object.evaluationExpectationResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ScenarioResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ScenarioResult} message ScenarioResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScenarioResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.expectationOutcomes = []; + object.rubricOutcomes = []; + object.hallucinationResult = []; + object.toolCallLatencies = []; + object.userFacts = []; + object.spanLatencies = []; + object.evaluationExpectationResults = []; + } + if (options.defaults) { + object.conversation = ""; + object.taskCompletionResult = null; + object.userGoalSatisfactionResult = null; + object.task = ""; + } + if (message.conversation != null && message.hasOwnProperty("conversation")) + object.conversation = message.conversation; + if (message.expectationOutcomes && message.expectationOutcomes.length) { + object.expectationOutcomes = []; + for (var j = 0; j < message.expectationOutcomes.length; ++j) + object.expectationOutcomes[j] = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioExpectationOutcome.toObject(message.expectationOutcomes[j], options); + } + if (message.rubricOutcomes && message.rubricOutcomes.length) { + object.rubricOutcomes = []; + for (var j = 0; j < message.rubricOutcomes.length; ++j) + object.rubricOutcomes[j] = $root.google.cloud.ces.v1beta.EvaluationResult.ScenarioRubricOutcome.toObject(message.rubricOutcomes[j], options); + } + if (message.hallucinationResult && message.hallucinationResult.length) { + object.hallucinationResult = []; + for (var j = 0; j < message.hallucinationResult.length; ++j) + object.hallucinationResult[j] = $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.toObject(message.hallucinationResult[j], options); + } + if (message.taskCompletionResult != null && message.hasOwnProperty("taskCompletionResult")) + object.taskCompletionResult = $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.toObject(message.taskCompletionResult, options); + if (message.toolCallLatencies && message.toolCallLatencies.length) { + object.toolCallLatencies = []; + for (var j = 0; j < message.toolCallLatencies.length; ++j) + object.toolCallLatencies[j] = $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.toObject(message.toolCallLatencies[j], options); + } + if (message.userGoalSatisfactionResult != null && message.hasOwnProperty("userGoalSatisfactionResult")) + object.userGoalSatisfactionResult = $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.toObject(message.userGoalSatisfactionResult, options); + if (message.allExpectationsSatisfied != null && message.hasOwnProperty("allExpectationsSatisfied")) { + object.allExpectationsSatisfied = message.allExpectationsSatisfied; + if (options.oneofs) + object._allExpectationsSatisfied = "allExpectationsSatisfied"; + } + if (message.taskCompleted != null && message.hasOwnProperty("taskCompleted")) { + object.taskCompleted = message.taskCompleted; + if (options.oneofs) + object._taskCompleted = "taskCompleted"; + } + if (message.task != null && message.hasOwnProperty("task")) + object.task = message.task; + if (message.userFacts && message.userFacts.length) { + object.userFacts = []; + for (var j = 0; j < message.userFacts.length; ++j) + object.userFacts[j] = $root.google.cloud.ces.v1beta.Evaluation.Scenario.UserFact.toObject(message.userFacts[j], options); + } + if (message.spanLatencies && message.spanLatencies.length) { + object.spanLatencies = []; + for (var j = 0; j < message.spanLatencies.length; ++j) + object.spanLatencies[j] = $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.toObject(message.spanLatencies[j], options); + } + if (message.evaluationExpectationResults && message.evaluationExpectationResults.length) { + object.evaluationExpectationResults = []; + for (var j = 0; j < message.evaluationExpectationResults.length; ++j) + object.evaluationExpectationResults[j] = $root.google.cloud.ces.v1beta.EvaluationResult.EvaluationExpectationResult.toObject(message.evaluationExpectationResults[j], options); + } + return object; + }; + + /** + * Converts this ScenarioResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @instance + * @returns {Object.} JSON object + */ + ScenarioResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScenarioResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.ScenarioResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScenarioResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.ScenarioResult"; + }; + + return ScenarioResult; + })(); + + EvaluationResult.SpanLatency = (function() { + + /** + * Properties of a SpanLatency. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface ISpanLatency + * @property {string|null} [resource] SpanLatency resource + * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolset] SpanLatency toolset + * @property {string|null} [model] SpanLatency model + * @property {string|null} [callback] SpanLatency callback + * @property {google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type|null} [type] SpanLatency type + * @property {string|null} [displayName] SpanLatency displayName + * @property {google.protobuf.ITimestamp|null} [startTime] SpanLatency startTime + * @property {google.protobuf.ITimestamp|null} [endTime] SpanLatency endTime + * @property {google.protobuf.IDuration|null} [executionLatency] SpanLatency executionLatency + */ + + /** + * Constructs a new SpanLatency. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a SpanLatency. + * @implements ISpanLatency + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.ISpanLatency=} [properties] Properties to set + */ + function SpanLatency(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpanLatency resource. + * @member {string|null|undefined} resource + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + SpanLatency.prototype.resource = null; + + /** + * SpanLatency toolset. + * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolset + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + SpanLatency.prototype.toolset = null; + + /** + * SpanLatency model. + * @member {string|null|undefined} model + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + SpanLatency.prototype.model = null; + + /** + * SpanLatency callback. + * @member {string|null|undefined} callback + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + SpanLatency.prototype.callback = null; + + /** + * SpanLatency type. + * @member {google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type} type + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + SpanLatency.prototype.type = 0; + + /** + * SpanLatency displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + SpanLatency.prototype.displayName = ""; + + /** + * SpanLatency startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + SpanLatency.prototype.startTime = null; + + /** + * SpanLatency endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + SpanLatency.prototype.endTime = null; + + /** + * SpanLatency executionLatency. + * @member {google.protobuf.IDuration|null|undefined} executionLatency + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + SpanLatency.prototype.executionLatency = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SpanLatency identifier. + * @member {"resource"|"toolset"|"model"|"callback"|undefined} identifier + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + */ + Object.defineProperty(SpanLatency.prototype, "identifier", { + get: $util.oneOfGetter($oneOfFields = ["resource", "toolset", "model", "callback"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SpanLatency instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ISpanLatency=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.SpanLatency} SpanLatency instance + */ + SpanLatency.create = function create(properties) { + return new SpanLatency(properties); + }; + + /** + * Encodes the specified SpanLatency message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SpanLatency.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ISpanLatency} message SpanLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpanLatency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resource); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.model); + if (message.callback != null && Object.hasOwnProperty.call(message, "callback")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.callback); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.executionLatency != null && Object.hasOwnProperty.call(message, "executionLatency")) + $root.google.protobuf.Duration.encode(message.executionLatency, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified SpanLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SpanLatency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ISpanLatency} message SpanLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpanLatency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpanLatency message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.SpanLatency} SpanLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpanLatency.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.resource = reader.string(); + break; + } + case 3: { + message.toolset = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 4: { + message.model = reader.string(); + break; + } + case 5: { + message.callback = reader.string(); + break; + } + case 1: { + message.type = reader.int32(); + break; + } + case 9: { + message.displayName = reader.string(); + break; + } + case 6: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.executionLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpanLatency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.SpanLatency} SpanLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpanLatency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpanLatency message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpanLatency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.resource != null && message.hasOwnProperty("resource")) { + properties.identifier = 1; + if (!$util.isString(message.resource)) + return "resource: string expected"; + } + if (message.toolset != null && message.hasOwnProperty("toolset")) { + if (properties.identifier === 1) + return "identifier: multiple values"; + properties.identifier = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolset); + if (error) + return "toolset." + error; + } + } + if (message.model != null && message.hasOwnProperty("model")) { + if (properties.identifier === 1) + return "identifier: multiple values"; + properties.identifier = 1; + if (!$util.isString(message.model)) + return "model: string expected"; + } + if (message.callback != null && message.hasOwnProperty("callback")) { + if (properties.identifier === 1) + return "identifier: multiple values"; + properties.identifier = 1; + if (!$util.isString(message.callback)) + return "callback: 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: + case 4: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string 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.executionLatency != null && message.hasOwnProperty("executionLatency")) { + var error = $root.google.protobuf.Duration.verify(message.executionLatency); + if (error) + return "executionLatency." + error; + } + return null; + }; + + /** + * Creates a SpanLatency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.SpanLatency} SpanLatency + */ + SpanLatency.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.toolset != null) { + if (typeof object.toolset !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.SpanLatency.toolset: object expected"); + message.toolset = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolset); + } + if (object.model != null) + message.model = String(object.model); + if (object.callback != null) + message.callback = String(object.callback); + 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 "TOOL": + case 1: + message.type = 1; + break; + case "USER_CALLBACK": + case 2: + message.type = 2; + break; + case "GUARDRAIL": + case 3: + message.type = 3; + break; + case "LLM": + case 4: + message.type = 4; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.SpanLatency.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.ces.v1beta.EvaluationResult.SpanLatency.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.executionLatency != null) { + if (typeof object.executionLatency !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.SpanLatency.executionLatency: object expected"); + message.executionLatency = $root.google.protobuf.Duration.fromObject(object.executionLatency); + } + return message; + }; + + /** + * Creates a plain object from a SpanLatency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.SpanLatency} message SpanLatency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpanLatency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.startTime = null; + object.endTime = null; + object.executionLatency = null; + object.displayName = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type[message.type] === undefined ? message.type : $root.google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type[message.type] : message.type; + if (message.resource != null && message.hasOwnProperty("resource")) { + object.resource = message.resource; + if (options.oneofs) + object.identifier = "resource"; + } + if (message.toolset != null && message.hasOwnProperty("toolset")) { + object.toolset = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolset, options); + if (options.oneofs) + object.identifier = "toolset"; + } + if (message.model != null && message.hasOwnProperty("model")) { + object.model = message.model; + if (options.oneofs) + object.identifier = "model"; + } + if (message.callback != null && message.hasOwnProperty("callback")) { + object.callback = message.callback; + if (options.oneofs) + object.identifier = "callback"; + } + 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.executionLatency != null && message.hasOwnProperty("executionLatency")) + object.executionLatency = $root.google.protobuf.Duration.toObject(message.executionLatency, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this SpanLatency to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @instance + * @returns {Object.} JSON object + */ + SpanLatency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpanLatency + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.SpanLatency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpanLatency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.SpanLatency"; + }; + + /** + * Type enum. + * @name google.cloud.ces.v1beta.EvaluationResult.SpanLatency.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} TOOL=1 TOOL value + * @property {number} USER_CALLBACK=2 USER_CALLBACK value + * @property {number} GUARDRAIL=3 GUARDRAIL value + * @property {number} LLM=4 LLM value + */ + SpanLatency.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TOOL"] = 1; + values[valuesById[2] = "USER_CALLBACK"] = 2; + values[valuesById[3] = "GUARDRAIL"] = 3; + values[valuesById[4] = "LLM"] = 4; + return values; + })(); + + return SpanLatency; + })(); + + EvaluationResult.ToolCallLatency = (function() { + + /** + * Properties of a ToolCallLatency. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IToolCallLatency + * @property {string|null} [tool] ToolCallLatency tool + * @property {string|null} [displayName] ToolCallLatency displayName + * @property {google.protobuf.ITimestamp|null} [startTime] ToolCallLatency startTime + * @property {google.protobuf.ITimestamp|null} [endTime] ToolCallLatency endTime + * @property {google.protobuf.IDuration|null} [executionLatency] ToolCallLatency executionLatency + */ + + /** + * Constructs a new ToolCallLatency. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a ToolCallLatency. + * @implements IToolCallLatency + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency=} [properties] Properties to set + */ + function ToolCallLatency(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolCallLatency tool. + * @member {string} tool + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @instance + */ + ToolCallLatency.prototype.tool = ""; + + /** + * ToolCallLatency displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @instance + */ + ToolCallLatency.prototype.displayName = ""; + + /** + * ToolCallLatency startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @instance + */ + ToolCallLatency.prototype.startTime = null; + + /** + * ToolCallLatency endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @instance + */ + ToolCallLatency.prototype.endTime = null; + + /** + * ToolCallLatency executionLatency. + * @member {google.protobuf.IDuration|null|undefined} executionLatency + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @instance + */ + ToolCallLatency.prototype.executionLatency = null; + + /** + * Creates a new ToolCallLatency instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency} ToolCallLatency instance + */ + ToolCallLatency.create = function create(properties) { + return new ToolCallLatency(properties); + }; + + /** + * Encodes the specified ToolCallLatency message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency} message ToolCallLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCallLatency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.executionLatency != null && Object.hasOwnProperty.call(message, "executionLatency")) + $root.google.protobuf.Duration.encode(message.executionLatency, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolCallLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IToolCallLatency} message ToolCallLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCallLatency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolCallLatency message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency} ToolCallLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCallLatency.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.executionLatency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolCallLatency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency} ToolCallLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCallLatency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolCallLatency message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolCallLatency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tool != null && message.hasOwnProperty("tool")) + if (!$util.isString(message.tool)) + return "tool: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string 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.executionLatency != null && message.hasOwnProperty("executionLatency")) { + var error = $root.google.protobuf.Duration.verify(message.executionLatency); + if (error) + return "executionLatency." + error; + } + return null; + }; + + /** + * Creates a ToolCallLatency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency} ToolCallLatency + */ + ToolCallLatency.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.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.ces.v1beta.EvaluationResult.ToolCallLatency.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.executionLatency != null) { + if (typeof object.executionLatency !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency.executionLatency: object expected"); + message.executionLatency = $root.google.protobuf.Duration.fromObject(object.executionLatency); + } + return message; + }; + + /** + * Creates a plain object from a ToolCallLatency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency} message ToolCallLatency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolCallLatency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = ""; + object.displayName = ""; + object.startTime = null; + object.endTime = null; + object.executionLatency = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = message.tool; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + 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.executionLatency != null && message.hasOwnProperty("executionLatency")) + object.executionLatency = $root.google.protobuf.Duration.toObject(message.executionLatency, options); + return object; + }; + + /** + * Converts this ToolCallLatency to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @instance + * @returns {Object.} JSON object + */ + ToolCallLatency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolCallLatency + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolCallLatency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.ToolCallLatency"; + }; + + return ToolCallLatency; + })(); + + EvaluationResult.HallucinationResult = (function() { + + /** + * Properties of a HallucinationResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IHallucinationResult + * @property {number|null} [score] HallucinationResult score + * @property {string|null} [label] HallucinationResult label + * @property {string|null} [explanation] HallucinationResult explanation + */ + + /** + * Constructs a new HallucinationResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a HallucinationResult. + * @implements IHallucinationResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult=} [properties] Properties to set + */ + function HallucinationResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HallucinationResult score. + * @member {number|null|undefined} score + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @instance + */ + HallucinationResult.prototype.score = null; + + /** + * HallucinationResult label. + * @member {string} label + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @instance + */ + HallucinationResult.prototype.label = ""; + + /** + * HallucinationResult explanation. + * @member {string} explanation + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @instance + */ + HallucinationResult.prototype.explanation = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HallucinationResult.prototype, "_score", { + get: $util.oneOfGetter($oneOfFields = ["score"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HallucinationResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.HallucinationResult} HallucinationResult instance + */ + HallucinationResult.create = function create(properties) { + return new HallucinationResult(properties); + }; + + /** + * Encodes the specified HallucinationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult} message HallucinationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HallucinationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.score); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.explanation); + return writer; + }; + + /** + * Encodes the specified HallucinationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.HallucinationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IHallucinationResult} message HallucinationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HallucinationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HallucinationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.HallucinationResult} HallucinationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HallucinationResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.int32(); + break; + } + case 2: { + message.label = reader.string(); + break; + } + case 3: { + message.explanation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HallucinationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.HallucinationResult} HallucinationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HallucinationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HallucinationResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HallucinationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.score != null && message.hasOwnProperty("score")) { + properties._score = 1; + if (!$util.isInteger(message.score)) + return "score: integer expected"; + } + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.explanation != null && message.hasOwnProperty("explanation")) + if (!$util.isString(message.explanation)) + return "explanation: string expected"; + return null; + }; + + /** + * Creates a HallucinationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.HallucinationResult} HallucinationResult + */ + HallucinationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.HallucinationResult(); + if (object.score != null) + message.score = object.score | 0; + if (object.label != null) + message.label = String(object.label); + if (object.explanation != null) + message.explanation = String(object.explanation); + return message; + }; + + /** + * Creates a plain object from a HallucinationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.HallucinationResult} message HallucinationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HallucinationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.label = ""; + object.explanation = ""; + } + if (message.score != null && message.hasOwnProperty("score")) { + object.score = message.score; + if (options.oneofs) + object._score = "score"; + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = message.explanation; + return object; + }; + + /** + * Converts this HallucinationResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @instance + * @returns {Object.} JSON object + */ + HallucinationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HallucinationResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.HallucinationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HallucinationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.HallucinationResult"; + }; + + return HallucinationResult; + })(); + + EvaluationResult.UserGoalSatisfactionResult = (function() { + + /** + * Properties of a UserGoalSatisfactionResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IUserGoalSatisfactionResult + * @property {number|null} [score] UserGoalSatisfactionResult score + * @property {string|null} [label] UserGoalSatisfactionResult label + * @property {string|null} [explanation] UserGoalSatisfactionResult explanation + */ + + /** + * Constructs a new UserGoalSatisfactionResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a UserGoalSatisfactionResult. + * @implements IUserGoalSatisfactionResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult=} [properties] Properties to set + */ + function UserGoalSatisfactionResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserGoalSatisfactionResult score. + * @member {number|null|undefined} score + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @instance + */ + UserGoalSatisfactionResult.prototype.score = null; + + /** + * UserGoalSatisfactionResult label. + * @member {string} label + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @instance + */ + UserGoalSatisfactionResult.prototype.label = ""; + + /** + * UserGoalSatisfactionResult explanation. + * @member {string} explanation + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @instance + */ + UserGoalSatisfactionResult.prototype.explanation = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UserGoalSatisfactionResult.prototype, "_score", { + get: $util.oneOfGetter($oneOfFields = ["score"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UserGoalSatisfactionResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult} UserGoalSatisfactionResult instance + */ + UserGoalSatisfactionResult.create = function create(properties) { + return new UserGoalSatisfactionResult(properties); + }; + + /** + * Encodes the specified UserGoalSatisfactionResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult} message UserGoalSatisfactionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserGoalSatisfactionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.score); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.explanation); + return writer; + }; + + /** + * Encodes the specified UserGoalSatisfactionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IUserGoalSatisfactionResult} message UserGoalSatisfactionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserGoalSatisfactionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserGoalSatisfactionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult} UserGoalSatisfactionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserGoalSatisfactionResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.int32(); + break; + } + case 2: { + message.label = reader.string(); + break; + } + case 3: { + message.explanation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserGoalSatisfactionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult} UserGoalSatisfactionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserGoalSatisfactionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserGoalSatisfactionResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserGoalSatisfactionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.score != null && message.hasOwnProperty("score")) { + properties._score = 1; + if (!$util.isInteger(message.score)) + return "score: integer expected"; + } + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.explanation != null && message.hasOwnProperty("explanation")) + if (!$util.isString(message.explanation)) + return "explanation: string expected"; + return null; + }; + + /** + * Creates a UserGoalSatisfactionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult} UserGoalSatisfactionResult + */ + UserGoalSatisfactionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult(); + if (object.score != null) + message.score = object.score | 0; + if (object.label != null) + message.label = String(object.label); + if (object.explanation != null) + message.explanation = String(object.explanation); + return message; + }; + + /** + * Creates a plain object from a UserGoalSatisfactionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult} message UserGoalSatisfactionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserGoalSatisfactionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.label = ""; + object.explanation = ""; + } + if (message.score != null && message.hasOwnProperty("score")) { + object.score = message.score; + if (options.oneofs) + object._score = "score"; + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = message.explanation; + return object; + }; + + /** + * Converts this UserGoalSatisfactionResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @instance + * @returns {Object.} JSON object + */ + UserGoalSatisfactionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserGoalSatisfactionResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserGoalSatisfactionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.UserGoalSatisfactionResult"; + }; + + return UserGoalSatisfactionResult; + })(); + + EvaluationResult.SemanticSimilarityResult = (function() { + + /** + * Properties of a SemanticSimilarityResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface ISemanticSimilarityResult + * @property {number|null} [score] SemanticSimilarityResult score + * @property {string|null} [label] SemanticSimilarityResult label + * @property {string|null} [explanation] SemanticSimilarityResult explanation + * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [outcome] SemanticSimilarityResult outcome + */ + + /** + * Constructs a new SemanticSimilarityResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a SemanticSimilarityResult. + * @implements ISemanticSimilarityResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult=} [properties] Properties to set + */ + function SemanticSimilarityResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SemanticSimilarityResult score. + * @member {number|null|undefined} score + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @instance + */ + SemanticSimilarityResult.prototype.score = null; + + /** + * SemanticSimilarityResult label. + * @member {string} label + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @instance + */ + SemanticSimilarityResult.prototype.label = ""; + + /** + * SemanticSimilarityResult explanation. + * @member {string} explanation + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @instance + */ + SemanticSimilarityResult.prototype.explanation = ""; + + /** + * SemanticSimilarityResult outcome. + * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} outcome + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @instance + */ + SemanticSimilarityResult.prototype.outcome = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SemanticSimilarityResult.prototype, "_score", { + get: $util.oneOfGetter($oneOfFields = ["score"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SemanticSimilarityResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult} SemanticSimilarityResult instance + */ + SemanticSimilarityResult.create = function create(properties) { + return new SemanticSimilarityResult(properties); + }; + + /** + * Encodes the specified SemanticSimilarityResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult} message SemanticSimilarityResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticSimilarityResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.score); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.explanation); + if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.outcome); + return writer; + }; + + /** + * Encodes the specified SemanticSimilarityResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ISemanticSimilarityResult} message SemanticSimilarityResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticSimilarityResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SemanticSimilarityResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult} SemanticSimilarityResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticSimilarityResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.int32(); + break; + } + case 2: { + message.label = reader.string(); + break; + } + case 3: { + message.explanation = reader.string(); + break; + } + case 4: { + message.outcome = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SemanticSimilarityResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult} SemanticSimilarityResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticSimilarityResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SemanticSimilarityResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SemanticSimilarityResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.score != null && message.hasOwnProperty("score")) { + properties._score = 1; + if (!$util.isInteger(message.score)) + return "score: integer expected"; + } + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.explanation != null && message.hasOwnProperty("explanation")) + if (!$util.isString(message.explanation)) + return "explanation: string expected"; + if (message.outcome != null && message.hasOwnProperty("outcome")) + switch (message.outcome) { + default: + return "outcome: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a SemanticSimilarityResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult} SemanticSimilarityResult + */ + SemanticSimilarityResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult(); + if (object.score != null) + message.score = object.score | 0; + if (object.label != null) + message.label = String(object.label); + if (object.explanation != null) + message.explanation = String(object.explanation); + switch (object.outcome) { + default: + if (typeof object.outcome === "number") { + message.outcome = object.outcome; + break; + } + break; + case "OUTCOME_UNSPECIFIED": + case 0: + message.outcome = 0; + break; + case "PASS": + case 1: + message.outcome = 1; + break; + case "FAIL": + case 2: + message.outcome = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a SemanticSimilarityResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult} message SemanticSimilarityResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SemanticSimilarityResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.label = ""; + object.explanation = ""; + object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; + } + if (message.score != null && message.hasOwnProperty("score")) { + object.score = message.score; + if (options.oneofs) + object._score = "score"; + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = message.explanation; + if (message.outcome != null && message.hasOwnProperty("outcome")) + object.outcome = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] : message.outcome; + return object; + }; + + /** + * Converts this SemanticSimilarityResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @instance + * @returns {Object.} JSON object + */ + SemanticSimilarityResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SemanticSimilarityResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticSimilarityResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.SemanticSimilarityResult"; + }; + + return SemanticSimilarityResult; + })(); + + EvaluationResult.OverallToolInvocationResult = (function() { + + /** + * Properties of an OverallToolInvocationResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface IOverallToolInvocationResult + * @property {number|null} [toolInvocationScore] OverallToolInvocationResult toolInvocationScore + * @property {google.cloud.ces.v1beta.EvaluationResult.Outcome|null} [outcome] OverallToolInvocationResult outcome + */ + + /** + * Constructs a new OverallToolInvocationResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents an OverallToolInvocationResult. + * @implements IOverallToolInvocationResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult=} [properties] Properties to set + */ + function OverallToolInvocationResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OverallToolInvocationResult toolInvocationScore. + * @member {number|null|undefined} toolInvocationScore + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @instance + */ + OverallToolInvocationResult.prototype.toolInvocationScore = null; + + /** + * OverallToolInvocationResult outcome. + * @member {google.cloud.ces.v1beta.EvaluationResult.Outcome} outcome + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @instance + */ + OverallToolInvocationResult.prototype.outcome = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OverallToolInvocationResult.prototype, "_toolInvocationScore", { + get: $util.oneOfGetter($oneOfFields = ["toolInvocationScore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OverallToolInvocationResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult} OverallToolInvocationResult instance + */ + OverallToolInvocationResult.create = function create(properties) { + return new OverallToolInvocationResult(properties); + }; + + /** + * Encodes the specified OverallToolInvocationResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult} message OverallToolInvocationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OverallToolInvocationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolInvocationScore != null && Object.hasOwnProperty.call(message, "toolInvocationScore")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.toolInvocationScore); + if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.outcome); + return writer; + }; + + /** + * Encodes the specified OverallToolInvocationResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.IOverallToolInvocationResult} message OverallToolInvocationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OverallToolInvocationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OverallToolInvocationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult} OverallToolInvocationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OverallToolInvocationResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolInvocationScore = reader.float(); + break; + } + case 2: { + message.outcome = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OverallToolInvocationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult} OverallToolInvocationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OverallToolInvocationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OverallToolInvocationResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OverallToolInvocationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.toolInvocationScore != null && message.hasOwnProperty("toolInvocationScore")) { + properties._toolInvocationScore = 1; + if (typeof message.toolInvocationScore !== "number") + return "toolInvocationScore: number expected"; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + switch (message.outcome) { + default: + return "outcome: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an OverallToolInvocationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult} OverallToolInvocationResult + */ + OverallToolInvocationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult(); + if (object.toolInvocationScore != null) + message.toolInvocationScore = Number(object.toolInvocationScore); + switch (object.outcome) { + default: + if (typeof object.outcome === "number") { + message.outcome = object.outcome; + break; + } + break; + case "OUTCOME_UNSPECIFIED": + case 0: + message.outcome = 0; + break; + case "PASS": + case 1: + message.outcome = 1; + break; + case "FAIL": + case 2: + message.outcome = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an OverallToolInvocationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult} message OverallToolInvocationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OverallToolInvocationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; + if (message.toolInvocationScore != null && message.hasOwnProperty("toolInvocationScore")) { + object.toolInvocationScore = options.json && !isFinite(message.toolInvocationScore) ? String(message.toolInvocationScore) : message.toolInvocationScore; + if (options.oneofs) + object._toolInvocationScore = "toolInvocationScore"; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + object.outcome = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.ces.v1beta.EvaluationResult.Outcome[message.outcome] : message.outcome; + return object; + }; + + /** + * Converts this OverallToolInvocationResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @instance + * @returns {Object.} JSON object + */ + OverallToolInvocationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OverallToolInvocationResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OverallToolInvocationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.OverallToolInvocationResult"; + }; + + return OverallToolInvocationResult; + })(); + + EvaluationResult.TaskCompletionResult = (function() { + + /** + * Properties of a TaskCompletionResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @interface ITaskCompletionResult + * @property {number|null} [score] TaskCompletionResult score + * @property {string|null} [label] TaskCompletionResult label + * @property {string|null} [explanation] TaskCompletionResult explanation + */ + + /** + * Constructs a new TaskCompletionResult. + * @memberof google.cloud.ces.v1beta.EvaluationResult + * @classdesc Represents a TaskCompletionResult. + * @implements ITaskCompletionResult + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult=} [properties] Properties to set + */ + function TaskCompletionResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskCompletionResult score. + * @member {number|null|undefined} score + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @instance + */ + TaskCompletionResult.prototype.score = null; + + /** + * TaskCompletionResult label. + * @member {string} label + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @instance + */ + TaskCompletionResult.prototype.label = ""; + + /** + * TaskCompletionResult explanation. + * @member {string} explanation + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @instance + */ + TaskCompletionResult.prototype.explanation = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TaskCompletionResult.prototype, "_score", { + get: $util.oneOfGetter($oneOfFields = ["score"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TaskCompletionResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult} TaskCompletionResult instance + */ + TaskCompletionResult.create = function create(properties) { + return new TaskCompletionResult(properties); + }; + + /** + * Encodes the specified TaskCompletionResult message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult} message TaskCompletionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskCompletionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.score); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.explanation); + return writer; + }; + + /** + * Encodes the specified TaskCompletionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.ITaskCompletionResult} message TaskCompletionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskCompletionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskCompletionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult} TaskCompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskCompletionResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.score = reader.int32(); + break; + } + case 2: { + message.label = reader.string(); + break; + } + case 3: { + message.explanation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskCompletionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult} TaskCompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskCompletionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskCompletionResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskCompletionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.score != null && message.hasOwnProperty("score")) { + properties._score = 1; + if (!$util.isInteger(message.score)) + return "score: integer expected"; + } + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.explanation != null && message.hasOwnProperty("explanation")) + if (!$util.isString(message.explanation)) + return "explanation: string expected"; + return null; + }; + + /** + * Creates a TaskCompletionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult} TaskCompletionResult + */ + TaskCompletionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult(); + if (object.score != null) + message.score = object.score | 0; + if (object.label != null) + message.label = String(object.label); + if (object.explanation != null) + message.explanation = String(object.explanation); + return message; + }; + + /** + * Creates a plain object from a TaskCompletionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @static + * @param {google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult} message TaskCompletionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskCompletionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.label = ""; + object.explanation = ""; + } + if (message.score != null && message.hasOwnProperty("score")) { + object.score = message.score; + if (options.oneofs) + object._score = "score"; + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = message.explanation; + return object; + }; + + /** + * Converts this TaskCompletionResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @instance + * @returns {Object.} JSON object + */ + TaskCompletionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskCompletionResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskCompletionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationResult.TaskCompletionResult"; + }; + + return TaskCompletionResult; + })(); + + /** + * Outcome enum. + * @name google.cloud.ces.v1beta.EvaluationResult.Outcome + * @enum {number} + * @property {number} OUTCOME_UNSPECIFIED=0 OUTCOME_UNSPECIFIED value + * @property {number} PASS=1 PASS value + * @property {number} FAIL=2 FAIL value + */ + EvaluationResult.Outcome = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OUTCOME_UNSPECIFIED"] = 0; + values[valuesById[1] = "PASS"] = 1; + values[valuesById[2] = "FAIL"] = 2; + return values; + })(); + + /** + * ExecutionState enum. + * @name google.cloud.ces.v1beta.EvaluationResult.ExecutionState + * @enum {number} + * @property {number} EXECUTION_STATE_UNSPECIFIED=0 EXECUTION_STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} COMPLETED=2 COMPLETED value + * @property {number} ERROR=3 ERROR value + */ + EvaluationResult.ExecutionState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXECUTION_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "COMPLETED"] = 2; + values[valuesById[3] = "ERROR"] = 3; + return values; + })(); + + return EvaluationResult; + })(); + + v1beta.EvaluationRun = (function() { + + /** + * Properties of an EvaluationRun. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluationRun + * @property {string|null} [name] EvaluationRun name + * @property {string|null} [displayName] EvaluationRun displayName + * @property {Array.|null} [evaluationResults] EvaluationRun evaluationResults + * @property {google.protobuf.ITimestamp|null} [createTime] EvaluationRun createTime + * @property {string|null} [initiatedBy] EvaluationRun initiatedBy + * @property {string|null} [appVersion] EvaluationRun appVersion + * @property {string|null} [appVersionDisplayName] EvaluationRun appVersionDisplayName + * @property {string|null} [changelog] EvaluationRun changelog + * @property {google.protobuf.ITimestamp|null} [changelogCreateTime] EvaluationRun changelogCreateTime + * @property {Array.|null} [evaluations] EvaluationRun evaluations + * @property {string|null} [evaluationDataset] EvaluationRun evaluationDataset + * @property {google.cloud.ces.v1beta.EvaluationRun.EvaluationType|null} [evaluationType] EvaluationRun evaluationType + * @property {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState|null} [state] EvaluationRun state + * @property {google.cloud.ces.v1beta.EvaluationRun.IProgress|null} [progress] EvaluationRun progress + * @property {google.cloud.ces.v1beta.IEvaluationConfig|null} [config] EvaluationRun config + * @property {google.rpc.IStatus|null} [error] EvaluationRun error + * @property {google.cloud.ces.v1beta.IEvaluationErrorInfo|null} [errorInfo] EvaluationRun errorInfo + * @property {Object.|null} [evaluationRunSummaries] EvaluationRun evaluationRunSummaries + * @property {google.cloud.ces.v1beta.ILatencyReport|null} [latencyReport] EvaluationRun latencyReport + * @property {number|null} [runCount] EvaluationRun runCount + * @property {Array.|null} [personaRunConfigs] EvaluationRun personaRunConfigs + * @property {google.cloud.ces.v1beta.IOptimizationConfig|null} [optimizationConfig] EvaluationRun optimizationConfig + * @property {string|null} [scheduledEvaluationRun] EvaluationRun scheduledEvaluationRun + * @property {google.cloud.ces.v1beta.GoldenRunMethod|null} [goldenRunMethod] EvaluationRun goldenRunMethod + */ + + /** + * Constructs a new EvaluationRun. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationRun. + * @implements IEvaluationRun + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluationRun=} [properties] Properties to set + */ + function EvaluationRun(properties) { + this.evaluationResults = []; + this.evaluations = []; + this.evaluationRunSummaries = {}; + this.personaRunConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationRun name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.name = ""; + + /** + * EvaluationRun displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.displayName = ""; + + /** + * EvaluationRun evaluationResults. + * @member {Array.} evaluationResults + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.evaluationResults = $util.emptyArray; + + /** + * EvaluationRun createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.createTime = null; + + /** + * EvaluationRun initiatedBy. + * @member {string} initiatedBy + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.initiatedBy = ""; + + /** + * EvaluationRun appVersion. + * @member {string} appVersion + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.appVersion = ""; + + /** + * EvaluationRun appVersionDisplayName. + * @member {string} appVersionDisplayName + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.appVersionDisplayName = ""; + + /** + * EvaluationRun changelog. + * @member {string} changelog + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.changelog = ""; + + /** + * EvaluationRun changelogCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} changelogCreateTime + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.changelogCreateTime = null; + + /** + * EvaluationRun evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.evaluations = $util.emptyArray; + + /** + * EvaluationRun evaluationDataset. + * @member {string} evaluationDataset + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.evaluationDataset = ""; + + /** + * EvaluationRun evaluationType. + * @member {google.cloud.ces.v1beta.EvaluationRun.EvaluationType} evaluationType + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.evaluationType = 0; + + /** + * EvaluationRun state. + * @member {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState} state + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.state = 0; + + /** + * EvaluationRun progress. + * @member {google.cloud.ces.v1beta.EvaluationRun.IProgress|null|undefined} progress + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.progress = null; + + /** + * EvaluationRun config. + * @member {google.cloud.ces.v1beta.IEvaluationConfig|null|undefined} config + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.config = null; + + /** + * EvaluationRun error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.error = null; + + /** + * EvaluationRun errorInfo. + * @member {google.cloud.ces.v1beta.IEvaluationErrorInfo|null|undefined} errorInfo + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.errorInfo = null; + + /** + * EvaluationRun evaluationRunSummaries. + * @member {Object.} evaluationRunSummaries + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.evaluationRunSummaries = $util.emptyObject; + + /** + * EvaluationRun latencyReport. + * @member {google.cloud.ces.v1beta.ILatencyReport|null|undefined} latencyReport + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.latencyReport = null; + + /** + * EvaluationRun runCount. + * @member {number} runCount + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.runCount = 0; + + /** + * EvaluationRun personaRunConfigs. + * @member {Array.} personaRunConfigs + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.personaRunConfigs = $util.emptyArray; + + /** + * EvaluationRun optimizationConfig. + * @member {google.cloud.ces.v1beta.IOptimizationConfig|null|undefined} optimizationConfig + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.optimizationConfig = null; + + /** + * EvaluationRun scheduledEvaluationRun. + * @member {string} scheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.scheduledEvaluationRun = ""; + + /** + * EvaluationRun goldenRunMethod. + * @member {google.cloud.ces.v1beta.GoldenRunMethod} goldenRunMethod + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + */ + EvaluationRun.prototype.goldenRunMethod = 0; + + /** + * Creates a new EvaluationRun instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @static + * @param {google.cloud.ces.v1beta.IEvaluationRun=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationRun} EvaluationRun instance + */ + EvaluationRun.create = function create(properties) { + return new EvaluationRun(properties); + }; + + /** + * Encodes the specified EvaluationRun message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @static + * @param {google.cloud.ces.v1beta.IEvaluationRun} message EvaluationRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationRun.encode = function encode(message, writer) { + if (!writer) + 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.evaluationResults != null && message.evaluationResults.length) + for (var i = 0; i < message.evaluationResults.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.evaluationResults[i]); + 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.initiatedBy != null && Object.hasOwnProperty.call(message, "initiatedBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.initiatedBy); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.appVersion); + if (message.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.evaluations[i]); + if (message.evaluationDataset != null && Object.hasOwnProperty.call(message, "evaluationDataset")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.evaluationDataset); + if (message.evaluationType != null && Object.hasOwnProperty.call(message, "evaluationType")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.evaluationType); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.cloud.ces.v1beta.EvaluationRun.Progress.encode(message.progress, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.ces.v1beta.EvaluationConfig.encode(message.config, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.appVersionDisplayName != null && Object.hasOwnProperty.call(message, "appVersionDisplayName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.appVersionDisplayName); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.evaluationRunSummaries != null && Object.hasOwnProperty.call(message, "evaluationRunSummaries")) + for (var keys = Object.keys(message.evaluationRunSummaries), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 15, wireType 2 =*/122).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.encode(message.evaluationRunSummaries[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.runCount != null && Object.hasOwnProperty.call(message, "runCount")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.runCount); + if (message.errorInfo != null && Object.hasOwnProperty.call(message, "errorInfo")) + $root.google.cloud.ces.v1beta.EvaluationErrorInfo.encode(message.errorInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.personaRunConfigs != null && message.personaRunConfigs.length) + for (var i = 0; i < message.personaRunConfigs.length; ++i) + $root.google.cloud.ces.v1beta.PersonaRunConfig.encode(message.personaRunConfigs[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.optimizationConfig != null && Object.hasOwnProperty.call(message, "optimizationConfig")) + $root.google.cloud.ces.v1beta.OptimizationConfig.encode(message.optimizationConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.scheduledEvaluationRun != null && Object.hasOwnProperty.call(message, "scheduledEvaluationRun")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.scheduledEvaluationRun); + if (message.goldenRunMethod != null && Object.hasOwnProperty.call(message, "goldenRunMethod")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.goldenRunMethod); + if (message.changelog != null && Object.hasOwnProperty.call(message, "changelog")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.changelog); + if (message.changelogCreateTime != null && Object.hasOwnProperty.call(message, "changelogCreateTime")) + $root.google.protobuf.Timestamp.encode(message.changelogCreateTime, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.latencyReport != null && Object.hasOwnProperty.call(message, "latencyReport")) + $root.google.cloud.ces.v1beta.LatencyReport.encode(message.latencyReport, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluationRun message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @static + * @param {google.cloud.ces.v1beta.IEvaluationRun} message EvaluationRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationRun.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationRun message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationRun} EvaluationRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationRun.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationRun(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + if (!(message.evaluationResults && message.evaluationResults.length)) + message.evaluationResults = []; + message.evaluationResults.push(reader.string()); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.initiatedBy = reader.string(); + break; + } + case 6: { + message.appVersion = reader.string(); + break; + } + case 13: { + message.appVersionDisplayName = reader.string(); + break; + } + case 22: { + message.changelog = reader.string(); + break; + } + case 23: { + message.changelogCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push(reader.string()); + break; + } + case 8: { + message.evaluationDataset = reader.string(); + break; + } + case 9: { + message.evaluationType = reader.int32(); + break; + } + case 10: { + message.state = reader.int32(); + break; + } + case 11: { + message.progress = $root.google.cloud.ces.v1beta.EvaluationRun.Progress.decode(reader, reader.uint32()); + break; + } + case 12: { + message.config = $root.google.cloud.ces.v1beta.EvaluationConfig.decode(reader, reader.uint32()); + break; + } + case 14: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 17: { + message.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.decode(reader, reader.uint32()); + break; + } + case 15: { + if (message.evaluationRunSummaries === $util.emptyObject) + message.evaluationRunSummaries = {}; + 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.ces.v1beta.EvaluationRun.EvaluationRunSummary.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.evaluationRunSummaries[key] = value; + break; + } + case 25: { + message.latencyReport = $root.google.cloud.ces.v1beta.LatencyReport.decode(reader, reader.uint32()); + break; + } + case 16: { + message.runCount = reader.int32(); + break; + } + case 18: { + if (!(message.personaRunConfigs && message.personaRunConfigs.length)) + message.personaRunConfigs = []; + message.personaRunConfigs.push($root.google.cloud.ces.v1beta.PersonaRunConfig.decode(reader, reader.uint32())); + break; + } + case 19: { + message.optimizationConfig = $root.google.cloud.ces.v1beta.OptimizationConfig.decode(reader, reader.uint32()); + break; + } + case 20: { + message.scheduledEvaluationRun = reader.string(); + break; + } + case 21: { + message.goldenRunMethod = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationRun message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationRun} EvaluationRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationRun.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationRun message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationRun.verify = function verify(message) { + if (typeof message !== "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.evaluationResults != null && message.hasOwnProperty("evaluationResults")) { + if (!Array.isArray(message.evaluationResults)) + return "evaluationResults: array expected"; + for (var i = 0; i < message.evaluationResults.length; ++i) + if (!$util.isString(message.evaluationResults[i])) + return "evaluationResults: 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.initiatedBy != null && message.hasOwnProperty("initiatedBy")) + if (!$util.isString(message.initiatedBy)) + return "initiatedBy: string expected"; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (!$util.isString(message.appVersion)) + return "appVersion: string expected"; + if (message.appVersionDisplayName != null && message.hasOwnProperty("appVersionDisplayName")) + if (!$util.isString(message.appVersionDisplayName)) + return "appVersionDisplayName: string expected"; + if (message.changelog != null && message.hasOwnProperty("changelog")) + if (!$util.isString(message.changelog)) + return "changelog: string expected"; + if (message.changelogCreateTime != null && message.hasOwnProperty("changelogCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.changelogCreateTime); + if (error) + return "changelogCreateTime." + error; + } + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) + if (!$util.isString(message.evaluations[i])) + return "evaluations: string[] expected"; + } + if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) + if (!$util.isString(message.evaluationDataset)) + return "evaluationDataset: string expected"; + if (message.evaluationType != null && message.hasOwnProperty("evaluationType")) + switch (message.evaluationType) { + default: + return "evaluationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.cloud.ces.v1beta.EvaluationRun.Progress.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.ces.v1beta.EvaluationConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.errorInfo != null && message.hasOwnProperty("errorInfo")) { + var error = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.verify(message.errorInfo); + if (error) + return "errorInfo." + error; + } + if (message.evaluationRunSummaries != null && message.hasOwnProperty("evaluationRunSummaries")) { + if (!$util.isObject(message.evaluationRunSummaries)) + return "evaluationRunSummaries: object expected"; + var key = Object.keys(message.evaluationRunSummaries); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.verify(message.evaluationRunSummaries[key[i]]); + if (error) + return "evaluationRunSummaries." + error; + } + } + if (message.latencyReport != null && message.hasOwnProperty("latencyReport")) { + var error = $root.google.cloud.ces.v1beta.LatencyReport.verify(message.latencyReport); + if (error) + return "latencyReport." + error; + } + if (message.runCount != null && message.hasOwnProperty("runCount")) + if (!$util.isInteger(message.runCount)) + return "runCount: integer expected"; + if (message.personaRunConfigs != null && message.hasOwnProperty("personaRunConfigs")) { + if (!Array.isArray(message.personaRunConfigs)) + return "personaRunConfigs: array expected"; + for (var i = 0; i < message.personaRunConfigs.length; ++i) { + var error = $root.google.cloud.ces.v1beta.PersonaRunConfig.verify(message.personaRunConfigs[i]); + if (error) + return "personaRunConfigs." + error; + } + } + if (message.optimizationConfig != null && message.hasOwnProperty("optimizationConfig")) { + var error = $root.google.cloud.ces.v1beta.OptimizationConfig.verify(message.optimizationConfig); + if (error) + return "optimizationConfig." + error; + } + if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) + if (!$util.isString(message.scheduledEvaluationRun)) + return "scheduledEvaluationRun: string expected"; + if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) + switch (message.goldenRunMethod) { + default: + return "goldenRunMethod: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an EvaluationRun message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationRun} EvaluationRun + */ + EvaluationRun.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationRun) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationRun(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.evaluationResults) { + if (!Array.isArray(object.evaluationResults)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.evaluationResults: array expected"); + message.evaluationResults = []; + for (var i = 0; i < object.evaluationResults.length; ++i) + message.evaluationResults[i] = String(object.evaluationResults[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.initiatedBy != null) + message.initiatedBy = String(object.initiatedBy); + if (object.appVersion != null) + message.appVersion = String(object.appVersion); + if (object.appVersionDisplayName != null) + message.appVersionDisplayName = String(object.appVersionDisplayName); + if (object.changelog != null) + message.changelog = String(object.changelog); + if (object.changelogCreateTime != null) { + if (typeof object.changelogCreateTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.changelogCreateTime: object expected"); + message.changelogCreateTime = $root.google.protobuf.Timestamp.fromObject(object.changelogCreateTime); + } + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) + message.evaluations[i] = String(object.evaluations[i]); + } + if (object.evaluationDataset != null) + message.evaluationDataset = String(object.evaluationDataset); + switch (object.evaluationType) { + default: + if (typeof object.evaluationType === "number") { + message.evaluationType = object.evaluationType; + break; + } + break; + case "EVALUATION_TYPE_UNSPECIFIED": + case 0: + message.evaluationType = 0; + break; + case "GOLDEN": + case 1: + message.evaluationType = 1; + break; + case "SCENARIO": + case 2: + message.evaluationType = 2; + break; + case "MIXED": + case 3: + message.evaluationType = 3; + break; + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "EVALUATION_RUN_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "COMPLETED": + case 2: + message.state = 2; + break; + case "ERROR": + case 3: + message.state = 3; + break; + } + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.progress: object expected"); + message.progress = $root.google.cloud.ces.v1beta.EvaluationRun.Progress.fromObject(object.progress); + } + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.config: object expected"); + message.config = $root.google.cloud.ces.v1beta.EvaluationConfig.fromObject(object.config); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.errorInfo != null) { + if (typeof object.errorInfo !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.errorInfo: object expected"); + message.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.fromObject(object.errorInfo); + } + if (object.evaluationRunSummaries) { + if (typeof object.evaluationRunSummaries !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.evaluationRunSummaries: object expected"); + message.evaluationRunSummaries = {}; + for (var keys = Object.keys(object.evaluationRunSummaries), i = 0; i < keys.length; ++i) { + if (typeof object.evaluationRunSummaries[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.evaluationRunSummaries: object expected"); + message.evaluationRunSummaries[keys[i]] = $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.fromObject(object.evaluationRunSummaries[keys[i]]); + } + } + if (object.latencyReport != null) { + if (typeof object.latencyReport !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.latencyReport: object expected"); + message.latencyReport = $root.google.cloud.ces.v1beta.LatencyReport.fromObject(object.latencyReport); + } + if (object.runCount != null) + message.runCount = object.runCount | 0; + if (object.personaRunConfigs) { + if (!Array.isArray(object.personaRunConfigs)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.personaRunConfigs: array expected"); + message.personaRunConfigs = []; + for (var i = 0; i < object.personaRunConfigs.length; ++i) { + if (typeof object.personaRunConfigs[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.personaRunConfigs: object expected"); + message.personaRunConfigs[i] = $root.google.cloud.ces.v1beta.PersonaRunConfig.fromObject(object.personaRunConfigs[i]); + } + } + if (object.optimizationConfig != null) { + if (typeof object.optimizationConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationRun.optimizationConfig: object expected"); + message.optimizationConfig = $root.google.cloud.ces.v1beta.OptimizationConfig.fromObject(object.optimizationConfig); + } + if (object.scheduledEvaluationRun != null) + message.scheduledEvaluationRun = String(object.scheduledEvaluationRun); + switch (object.goldenRunMethod) { + default: + if (typeof object.goldenRunMethod === "number") { + message.goldenRunMethod = object.goldenRunMethod; + break; + } + break; + case "GOLDEN_RUN_METHOD_UNSPECIFIED": + case 0: + message.goldenRunMethod = 0; + break; + case "STABLE": + case 1: + message.goldenRunMethod = 1; + break; + case "NAIVE": + case 2: + message.goldenRunMethod = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an EvaluationRun message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @static + * @param {google.cloud.ces.v1beta.EvaluationRun} message EvaluationRun + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationRun.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.evaluationResults = []; + object.evaluations = []; + object.personaRunConfigs = []; + } + if (options.objects || options.defaults) + object.evaluationRunSummaries = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.createTime = null; + object.initiatedBy = ""; + object.appVersion = ""; + object.evaluationDataset = ""; + object.evaluationType = options.enums === String ? "EVALUATION_TYPE_UNSPECIFIED" : 0; + object.state = options.enums === String ? "EVALUATION_RUN_STATE_UNSPECIFIED" : 0; + object.progress = null; + object.config = null; + object.appVersionDisplayName = ""; + object.error = null; + object.runCount = 0; + object.errorInfo = null; + object.optimizationConfig = null; + object.scheduledEvaluationRun = ""; + object.goldenRunMethod = options.enums === String ? "GOLDEN_RUN_METHOD_UNSPECIFIED" : 0; + object.changelog = ""; + object.changelogCreateTime = null; + object.latencyReport = 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.evaluationResults && message.evaluationResults.length) { + object.evaluationResults = []; + for (var j = 0; j < message.evaluationResults.length; ++j) + object.evaluationResults[j] = message.evaluationResults[j]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.initiatedBy != null && message.hasOwnProperty("initiatedBy")) + object.initiatedBy = message.initiatedBy; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + object.appVersion = message.appVersion; + if (message.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = message.evaluations[j]; + } + if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) + object.evaluationDataset = message.evaluationDataset; + if (message.evaluationType != null && message.hasOwnProperty("evaluationType")) + object.evaluationType = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationType[message.evaluationType] === undefined ? message.evaluationType : $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationType[message.evaluationType] : message.evaluationType; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState[message.state] === undefined ? message.state : $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState[message.state] : message.state; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.cloud.ces.v1beta.EvaluationRun.Progress.toObject(message.progress, options); + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.ces.v1beta.EvaluationConfig.toObject(message.config, options); + if (message.appVersionDisplayName != null && message.hasOwnProperty("appVersionDisplayName")) + object.appVersionDisplayName = message.appVersionDisplayName; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + var keys2; + if (message.evaluationRunSummaries && (keys2 = Object.keys(message.evaluationRunSummaries)).length) { + object.evaluationRunSummaries = {}; + for (var j = 0; j < keys2.length; ++j) + object.evaluationRunSummaries[keys2[j]] = $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.toObject(message.evaluationRunSummaries[keys2[j]], options); + } + if (message.runCount != null && message.hasOwnProperty("runCount")) + object.runCount = message.runCount; + if (message.errorInfo != null && message.hasOwnProperty("errorInfo")) + object.errorInfo = $root.google.cloud.ces.v1beta.EvaluationErrorInfo.toObject(message.errorInfo, options); + if (message.personaRunConfigs && message.personaRunConfigs.length) { + object.personaRunConfigs = []; + for (var j = 0; j < message.personaRunConfigs.length; ++j) + object.personaRunConfigs[j] = $root.google.cloud.ces.v1beta.PersonaRunConfig.toObject(message.personaRunConfigs[j], options); + } + if (message.optimizationConfig != null && message.hasOwnProperty("optimizationConfig")) + object.optimizationConfig = $root.google.cloud.ces.v1beta.OptimizationConfig.toObject(message.optimizationConfig, options); + if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) + object.scheduledEvaluationRun = message.scheduledEvaluationRun; + if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) + object.goldenRunMethod = options.enums === String ? $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] === undefined ? message.goldenRunMethod : $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] : message.goldenRunMethod; + if (message.changelog != null && message.hasOwnProperty("changelog")) + object.changelog = message.changelog; + if (message.changelogCreateTime != null && message.hasOwnProperty("changelogCreateTime")) + object.changelogCreateTime = $root.google.protobuf.Timestamp.toObject(message.changelogCreateTime, options); + if (message.latencyReport != null && message.hasOwnProperty("latencyReport")) + object.latencyReport = $root.google.cloud.ces.v1beta.LatencyReport.toObject(message.latencyReport, options); + return object; + }; + + /** + * Converts this EvaluationRun to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @instance + * @returns {Object.} JSON object + */ + EvaluationRun.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationRun + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationRun"; + }; + + EvaluationRun.Progress = (function() { + + /** + * Properties of a Progress. + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @interface IProgress + * @property {number|null} [totalCount] Progress totalCount + * @property {number|null} [failedCount] Progress failedCount + * @property {number|null} [errorCount] Progress errorCount + * @property {number|null} [completedCount] Progress completedCount + * @property {number|null} [passedCount] Progress passedCount + */ + + /** + * Constructs a new Progress. + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @classdesc Represents a Progress. + * @implements IProgress + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationRun.IProgress=} [properties] Properties to set + */ + function Progress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Progress totalCount. + * @member {number} totalCount + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @instance + */ + Progress.prototype.totalCount = 0; + + /** + * Progress failedCount. + * @member {number} failedCount + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @instance + */ + Progress.prototype.failedCount = 0; + + /** + * Progress errorCount. + * @member {number} errorCount + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @instance + */ + Progress.prototype.errorCount = 0; + + /** + * Progress completedCount. + * @member {number} completedCount + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @instance + */ + Progress.prototype.completedCount = 0; + + /** + * Progress passedCount. + * @member {number} passedCount + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @instance + */ + Progress.prototype.passedCount = 0; + + /** + * Creates a new Progress instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @static + * @param {google.cloud.ces.v1beta.EvaluationRun.IProgress=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationRun.Progress} Progress instance + */ + Progress.create = function create(properties) { + return new Progress(properties); + }; + + /** + * Encodes the specified Progress message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.Progress.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @static + * @param {google.cloud.ces.v1beta.EvaluationRun.IProgress} message Progress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Progress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalCount != null && Object.hasOwnProperty.call(message, "totalCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalCount); + if (message.failedCount != null && Object.hasOwnProperty.call(message, "failedCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.failedCount); + if (message.errorCount != null && Object.hasOwnProperty.call(message, "errorCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.errorCount); + if (message.completedCount != null && Object.hasOwnProperty.call(message, "completedCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.completedCount); + if (message.passedCount != null && Object.hasOwnProperty.call(message, "passedCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.passedCount); + return writer; + }; + + /** + * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.Progress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @static + * @param {google.cloud.ces.v1beta.EvaluationRun.IProgress} message Progress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Progress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Progress message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationRun.Progress} Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Progress.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationRun.Progress(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.totalCount = reader.int32(); + break; + } + case 2: { + message.failedCount = reader.int32(); + break; + } + case 3: { + message.errorCount = reader.int32(); + break; + } + case 4: { + message.completedCount = reader.int32(); + break; + } + case 5: { + message.passedCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Progress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationRun.Progress} Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Progress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Progress message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Progress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.totalCount != null && message.hasOwnProperty("totalCount")) + if (!$util.isInteger(message.totalCount)) + return "totalCount: integer expected"; + if (message.failedCount != null && message.hasOwnProperty("failedCount")) + if (!$util.isInteger(message.failedCount)) + return "failedCount: integer expected"; + if (message.errorCount != null && message.hasOwnProperty("errorCount")) + if (!$util.isInteger(message.errorCount)) + return "errorCount: integer expected"; + if (message.completedCount != null && message.hasOwnProperty("completedCount")) + if (!$util.isInteger(message.completedCount)) + return "completedCount: integer expected"; + if (message.passedCount != null && message.hasOwnProperty("passedCount")) + if (!$util.isInteger(message.passedCount)) + return "passedCount: integer expected"; + return null; + }; + + /** + * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationRun.Progress} Progress + */ + Progress.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationRun.Progress) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationRun.Progress(); + if (object.totalCount != null) + message.totalCount = object.totalCount | 0; + if (object.failedCount != null) + message.failedCount = object.failedCount | 0; + if (object.errorCount != null) + message.errorCount = object.errorCount | 0; + if (object.completedCount != null) + message.completedCount = object.completedCount | 0; + if (object.passedCount != null) + message.passedCount = object.passedCount | 0; + return message; + }; + + /** + * Creates a plain object from a Progress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @static + * @param {google.cloud.ces.v1beta.EvaluationRun.Progress} message Progress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Progress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.totalCount = 0; + object.failedCount = 0; + object.errorCount = 0; + object.completedCount = 0; + object.passedCount = 0; + } + if (message.totalCount != null && message.hasOwnProperty("totalCount")) + object.totalCount = message.totalCount; + if (message.failedCount != null && message.hasOwnProperty("failedCount")) + object.failedCount = message.failedCount; + if (message.errorCount != null && message.hasOwnProperty("errorCount")) + object.errorCount = message.errorCount; + if (message.completedCount != null && message.hasOwnProperty("completedCount")) + object.completedCount = message.completedCount; + if (message.passedCount != null && message.hasOwnProperty("passedCount")) + object.passedCount = message.passedCount; + return object; + }; + + /** + * Converts this Progress to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @instance + * @returns {Object.} JSON object + */ + Progress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Progress + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationRun.Progress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Progress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationRun.Progress"; + }; + + return Progress; + })(); + + EvaluationRun.EvaluationRunSummary = (function() { + + /** + * Properties of an EvaluationRunSummary. + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @interface IEvaluationRunSummary + * @property {number|null} [passedCount] EvaluationRunSummary passedCount + * @property {number|null} [failedCount] EvaluationRunSummary failedCount + * @property {number|null} [errorCount] EvaluationRunSummary errorCount + */ + + /** + * Constructs a new EvaluationRunSummary. + * @memberof google.cloud.ces.v1beta.EvaluationRun + * @classdesc Represents an EvaluationRunSummary. + * @implements IEvaluationRunSummary + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary=} [properties] Properties to set + */ + function EvaluationRunSummary(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationRunSummary passedCount. + * @member {number} passedCount + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @instance + */ + EvaluationRunSummary.prototype.passedCount = 0; + + /** + * EvaluationRunSummary failedCount. + * @member {number} failedCount + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @instance + */ + EvaluationRunSummary.prototype.failedCount = 0; + + /** + * EvaluationRunSummary errorCount. + * @member {number} errorCount + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @instance + */ + EvaluationRunSummary.prototype.errorCount = 0; + + /** + * Creates a new EvaluationRunSummary instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @static + * @param {google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary} EvaluationRunSummary instance + */ + EvaluationRunSummary.create = function create(properties) { + return new EvaluationRunSummary(properties); + }; + + /** + * Encodes the specified EvaluationRunSummary message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @static + * @param {google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary} message EvaluationRunSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationRunSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.passedCount != null && Object.hasOwnProperty.call(message, "passedCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.passedCount); + if (message.failedCount != null && Object.hasOwnProperty.call(message, "failedCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.failedCount); + if (message.errorCount != null && Object.hasOwnProperty.call(message, "errorCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.errorCount); + return writer; + }; + + /** + * Encodes the specified EvaluationRunSummary message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @static + * @param {google.cloud.ces.v1beta.EvaluationRun.IEvaluationRunSummary} message EvaluationRunSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationRunSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationRunSummary message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary} EvaluationRunSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationRunSummary.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.passedCount = reader.int32(); + break; + } + case 2: { + message.failedCount = reader.int32(); + break; + } + case 3: { + message.errorCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationRunSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary} EvaluationRunSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationRunSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationRunSummary message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationRunSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.passedCount != null && message.hasOwnProperty("passedCount")) + if (!$util.isInteger(message.passedCount)) + return "passedCount: integer expected"; + if (message.failedCount != null && message.hasOwnProperty("failedCount")) + if (!$util.isInteger(message.failedCount)) + return "failedCount: integer expected"; + if (message.errorCount != null && message.hasOwnProperty("errorCount")) + if (!$util.isInteger(message.errorCount)) + return "errorCount: integer expected"; + return null; + }; + + /** + * Creates an EvaluationRunSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary} EvaluationRunSummary + */ + EvaluationRunSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary(); + if (object.passedCount != null) + message.passedCount = object.passedCount | 0; + if (object.failedCount != null) + message.failedCount = object.failedCount | 0; + if (object.errorCount != null) + message.errorCount = object.errorCount | 0; + return message; + }; + + /** + * Creates a plain object from an EvaluationRunSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @static + * @param {google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary} message EvaluationRunSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationRunSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.passedCount = 0; + object.failedCount = 0; + object.errorCount = 0; + } + if (message.passedCount != null && message.hasOwnProperty("passedCount")) + object.passedCount = message.passedCount; + if (message.failedCount != null && message.hasOwnProperty("failedCount")) + object.failedCount = message.failedCount; + if (message.errorCount != null && message.hasOwnProperty("errorCount")) + object.errorCount = message.errorCount; + return object; + }; + + /** + * Converts this EvaluationRunSummary to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @instance + * @returns {Object.} JSON object + */ + EvaluationRunSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationRunSummary + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationRunSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationRun.EvaluationRunSummary"; + }; + + return EvaluationRunSummary; + })(); + + /** + * EvaluationType enum. + * @name google.cloud.ces.v1beta.EvaluationRun.EvaluationType + * @enum {number} + * @property {number} EVALUATION_TYPE_UNSPECIFIED=0 EVALUATION_TYPE_UNSPECIFIED value + * @property {number} GOLDEN=1 GOLDEN value + * @property {number} SCENARIO=2 SCENARIO value + * @property {number} MIXED=3 MIXED value + */ + EvaluationRun.EvaluationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVALUATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOLDEN"] = 1; + values[valuesById[2] = "SCENARIO"] = 2; + values[valuesById[3] = "MIXED"] = 3; + return values; + })(); + + /** + * EvaluationRunState enum. + * @name google.cloud.ces.v1beta.EvaluationRun.EvaluationRunState + * @enum {number} + * @property {number} EVALUATION_RUN_STATE_UNSPECIFIED=0 EVALUATION_RUN_STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} COMPLETED=2 COMPLETED value + * @property {number} ERROR=3 ERROR value + */ + EvaluationRun.EvaluationRunState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVALUATION_RUN_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "COMPLETED"] = 2; + values[valuesById[3] = "ERROR"] = 3; + return values; + })(); + + return EvaluationRun; + })(); + + v1beta.LatencyReport = (function() { + + /** + * Properties of a LatencyReport. + * @memberof google.cloud.ces.v1beta + * @interface ILatencyReport + * @property {Array.|null} [toolLatencies] LatencyReport toolLatencies + * @property {Array.|null} [callbackLatencies] LatencyReport callbackLatencies + * @property {Array.|null} [guardrailLatencies] LatencyReport guardrailLatencies + * @property {Array.|null} [llmCallLatencies] LatencyReport llmCallLatencies + * @property {number|null} [sessionCount] LatencyReport sessionCount + */ + + /** + * Constructs a new LatencyReport. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a LatencyReport. + * @implements ILatencyReport + * @constructor + * @param {google.cloud.ces.v1beta.ILatencyReport=} [properties] Properties to set + */ + function LatencyReport(properties) { + this.toolLatencies = []; + this.callbackLatencies = []; + this.guardrailLatencies = []; + this.llmCallLatencies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LatencyReport toolLatencies. + * @member {Array.} toolLatencies + * @memberof google.cloud.ces.v1beta.LatencyReport + * @instance + */ + LatencyReport.prototype.toolLatencies = $util.emptyArray; + + /** + * LatencyReport callbackLatencies. + * @member {Array.} callbackLatencies + * @memberof google.cloud.ces.v1beta.LatencyReport + * @instance + */ + LatencyReport.prototype.callbackLatencies = $util.emptyArray; + + /** + * LatencyReport guardrailLatencies. + * @member {Array.} guardrailLatencies + * @memberof google.cloud.ces.v1beta.LatencyReport + * @instance + */ + LatencyReport.prototype.guardrailLatencies = $util.emptyArray; + + /** + * LatencyReport llmCallLatencies. + * @member {Array.} llmCallLatencies + * @memberof google.cloud.ces.v1beta.LatencyReport + * @instance + */ + LatencyReport.prototype.llmCallLatencies = $util.emptyArray; + + /** + * LatencyReport sessionCount. + * @member {number} sessionCount + * @memberof google.cloud.ces.v1beta.LatencyReport + * @instance + */ + LatencyReport.prototype.sessionCount = 0; + + /** + * Creates a new LatencyReport instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.LatencyReport + * @static + * @param {google.cloud.ces.v1beta.ILatencyReport=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.LatencyReport} LatencyReport instance + */ + LatencyReport.create = function create(properties) { + return new LatencyReport(properties); + }; + + /** + * Encodes the specified LatencyReport message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.LatencyReport + * @static + * @param {google.cloud.ces.v1beta.ILatencyReport} message LatencyReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatencyReport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolLatencies != null && message.toolLatencies.length) + for (var i = 0; i < message.toolLatencies.length; ++i) + $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency.encode(message.toolLatencies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.callbackLatencies != null && message.callbackLatencies.length) + for (var i = 0; i < message.callbackLatencies.length; ++i) + $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency.encode(message.callbackLatencies[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.guardrailLatencies != null && message.guardrailLatencies.length) + for (var i = 0; i < message.guardrailLatencies.length; ++i) + $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.encode(message.guardrailLatencies[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.llmCallLatencies != null && message.llmCallLatencies.length) + for (var i = 0; i < message.llmCallLatencies.length; ++i) + $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.encode(message.llmCallLatencies[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.sessionCount != null && Object.hasOwnProperty.call(message, "sessionCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.sessionCount); + return writer; + }; + + /** + * Encodes the specified LatencyReport message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport + * @static + * @param {google.cloud.ces.v1beta.ILatencyReport} message LatencyReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatencyReport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatencyReport message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.LatencyReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.LatencyReport} LatencyReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatencyReport.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LatencyReport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.toolLatencies && message.toolLatencies.length)) + message.toolLatencies = []; + message.toolLatencies.push($root.google.cloud.ces.v1beta.LatencyReport.ToolLatency.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.callbackLatencies && message.callbackLatencies.length)) + message.callbackLatencies = []; + message.callbackLatencies.push($root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.guardrailLatencies && message.guardrailLatencies.length)) + message.guardrailLatencies = []; + message.guardrailLatencies.push($root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.llmCallLatencies && message.llmCallLatencies.length)) + message.llmCallLatencies = []; + message.llmCallLatencies.push($root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.decode(reader, reader.uint32())); + break; + } + case 5: { + message.sessionCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LatencyReport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.LatencyReport} LatencyReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatencyReport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LatencyReport message. + * @function verify + * @memberof google.cloud.ces.v1beta.LatencyReport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LatencyReport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolLatencies != null && message.hasOwnProperty("toolLatencies")) { + if (!Array.isArray(message.toolLatencies)) + return "toolLatencies: array expected"; + for (var i = 0; i < message.toolLatencies.length; ++i) { + var error = $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency.verify(message.toolLatencies[i]); + if (error) + return "toolLatencies." + error; + } + } + if (message.callbackLatencies != null && message.hasOwnProperty("callbackLatencies")) { + if (!Array.isArray(message.callbackLatencies)) + return "callbackLatencies: array expected"; + for (var i = 0; i < message.callbackLatencies.length; ++i) { + var error = $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency.verify(message.callbackLatencies[i]); + if (error) + return "callbackLatencies." + error; + } + } + if (message.guardrailLatencies != null && message.hasOwnProperty("guardrailLatencies")) { + if (!Array.isArray(message.guardrailLatencies)) + return "guardrailLatencies: array expected"; + for (var i = 0; i < message.guardrailLatencies.length; ++i) { + var error = $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.verify(message.guardrailLatencies[i]); + if (error) + return "guardrailLatencies." + error; + } + } + if (message.llmCallLatencies != null && message.hasOwnProperty("llmCallLatencies")) { + if (!Array.isArray(message.llmCallLatencies)) + return "llmCallLatencies: array expected"; + for (var i = 0; i < message.llmCallLatencies.length; ++i) { + var error = $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.verify(message.llmCallLatencies[i]); + if (error) + return "llmCallLatencies." + error; + } + } + if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) + if (!$util.isInteger(message.sessionCount)) + return "sessionCount: integer expected"; + return null; + }; + + /** + * Creates a LatencyReport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.LatencyReport + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.LatencyReport} LatencyReport + */ + LatencyReport.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.LatencyReport) + return object; + var message = new $root.google.cloud.ces.v1beta.LatencyReport(); + if (object.toolLatencies) { + if (!Array.isArray(object.toolLatencies)) + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.toolLatencies: array expected"); + message.toolLatencies = []; + for (var i = 0; i < object.toolLatencies.length; ++i) { + if (typeof object.toolLatencies[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.toolLatencies: object expected"); + message.toolLatencies[i] = $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency.fromObject(object.toolLatencies[i]); + } + } + if (object.callbackLatencies) { + if (!Array.isArray(object.callbackLatencies)) + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.callbackLatencies: array expected"); + message.callbackLatencies = []; + for (var i = 0; i < object.callbackLatencies.length; ++i) { + if (typeof object.callbackLatencies[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.callbackLatencies: object expected"); + message.callbackLatencies[i] = $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency.fromObject(object.callbackLatencies[i]); + } + } + if (object.guardrailLatencies) { + if (!Array.isArray(object.guardrailLatencies)) + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.guardrailLatencies: array expected"); + message.guardrailLatencies = []; + for (var i = 0; i < object.guardrailLatencies.length; ++i) { + if (typeof object.guardrailLatencies[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.guardrailLatencies: object expected"); + message.guardrailLatencies[i] = $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.fromObject(object.guardrailLatencies[i]); + } + } + if (object.llmCallLatencies) { + if (!Array.isArray(object.llmCallLatencies)) + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.llmCallLatencies: array expected"); + message.llmCallLatencies = []; + for (var i = 0; i < object.llmCallLatencies.length; ++i) { + if (typeof object.llmCallLatencies[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.llmCallLatencies: object expected"); + message.llmCallLatencies[i] = $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.fromObject(object.llmCallLatencies[i]); + } + } + if (object.sessionCount != null) + message.sessionCount = object.sessionCount | 0; + return message; + }; + + /** + * Creates a plain object from a LatencyReport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.LatencyReport + * @static + * @param {google.cloud.ces.v1beta.LatencyReport} message LatencyReport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LatencyReport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.toolLatencies = []; + object.callbackLatencies = []; + object.guardrailLatencies = []; + object.llmCallLatencies = []; + } + if (options.defaults) + object.sessionCount = 0; + if (message.toolLatencies && message.toolLatencies.length) { + object.toolLatencies = []; + for (var j = 0; j < message.toolLatencies.length; ++j) + object.toolLatencies[j] = $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency.toObject(message.toolLatencies[j], options); + } + if (message.callbackLatencies && message.callbackLatencies.length) { + object.callbackLatencies = []; + for (var j = 0; j < message.callbackLatencies.length; ++j) + object.callbackLatencies[j] = $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency.toObject(message.callbackLatencies[j], options); + } + if (message.guardrailLatencies && message.guardrailLatencies.length) { + object.guardrailLatencies = []; + for (var j = 0; j < message.guardrailLatencies.length; ++j) + object.guardrailLatencies[j] = $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.toObject(message.guardrailLatencies[j], options); + } + if (message.llmCallLatencies && message.llmCallLatencies.length) { + object.llmCallLatencies = []; + for (var j = 0; j < message.llmCallLatencies.length; ++j) + object.llmCallLatencies[j] = $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.toObject(message.llmCallLatencies[j], options); + } + if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) + object.sessionCount = message.sessionCount; + return object; + }; + + /** + * Converts this LatencyReport to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.LatencyReport + * @instance + * @returns {Object.} JSON object + */ + LatencyReport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LatencyReport + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.LatencyReport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LatencyReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.LatencyReport"; + }; + + LatencyReport.LatencyMetrics = (function() { + + /** + * Properties of a LatencyMetrics. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @interface ILatencyMetrics + * @property {google.protobuf.IDuration|null} [p50Latency] LatencyMetrics p50Latency + * @property {google.protobuf.IDuration|null} [p90Latency] LatencyMetrics p90Latency + * @property {google.protobuf.IDuration|null} [p99Latency] LatencyMetrics p99Latency + * @property {number|null} [callCount] LatencyMetrics callCount + */ + + /** + * Constructs a new LatencyMetrics. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @classdesc Represents a LatencyMetrics. + * @implements ILatencyMetrics + * @constructor + * @param {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics=} [properties] Properties to set + */ + function LatencyMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LatencyMetrics p50Latency. + * @member {google.protobuf.IDuration|null|undefined} p50Latency + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @instance + */ + LatencyMetrics.prototype.p50Latency = null; + + /** + * LatencyMetrics p90Latency. + * @member {google.protobuf.IDuration|null|undefined} p90Latency + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @instance + */ + LatencyMetrics.prototype.p90Latency = null; + + /** + * LatencyMetrics p99Latency. + * @member {google.protobuf.IDuration|null|undefined} p99Latency + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @instance + */ + LatencyMetrics.prototype.p99Latency = null; + + /** + * LatencyMetrics callCount. + * @member {number} callCount + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @instance + */ + LatencyMetrics.prototype.callCount = 0; + + /** + * Creates a new LatencyMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.LatencyReport.LatencyMetrics} LatencyMetrics instance + */ + LatencyMetrics.create = function create(properties) { + return new LatencyMetrics(properties); + }; + + /** + * Encodes the specified LatencyMetrics message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics} message LatencyMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatencyMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.p50Latency != null && Object.hasOwnProperty.call(message, "p50Latency")) + $root.google.protobuf.Duration.encode(message.p50Latency, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.p90Latency != null && Object.hasOwnProperty.call(message, "p90Latency")) + $root.google.protobuf.Duration.encode(message.p90Latency, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.p99Latency != null && Object.hasOwnProperty.call(message, "p99Latency")) + $root.google.protobuf.Duration.encode(message.p99Latency, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.callCount != null && Object.hasOwnProperty.call(message, "callCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.callCount); + return writer; + }; + + /** + * Encodes the specified LatencyMetrics message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics} message LatencyMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatencyMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatencyMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.LatencyReport.LatencyMetrics} LatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatencyMetrics.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.p50Latency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.p90Latency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.p99Latency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.callCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LatencyMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.LatencyReport.LatencyMetrics} LatencyMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatencyMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LatencyMetrics message. + * @function verify + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LatencyMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.p50Latency != null && message.hasOwnProperty("p50Latency")) { + var error = $root.google.protobuf.Duration.verify(message.p50Latency); + if (error) + return "p50Latency." + error; + } + if (message.p90Latency != null && message.hasOwnProperty("p90Latency")) { + var error = $root.google.protobuf.Duration.verify(message.p90Latency); + if (error) + return "p90Latency." + error; + } + if (message.p99Latency != null && message.hasOwnProperty("p99Latency")) { + var error = $root.google.protobuf.Duration.verify(message.p99Latency); + if (error) + return "p99Latency." + error; + } + if (message.callCount != null && message.hasOwnProperty("callCount")) + if (!$util.isInteger(message.callCount)) + return "callCount: integer expected"; + return null; + }; + + /** + * Creates a LatencyMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.LatencyReport.LatencyMetrics} LatencyMetrics + */ + LatencyMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics) + return object; + var message = new $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics(); + if (object.p50Latency != null) { + if (typeof object.p50Latency !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.p50Latency: object expected"); + message.p50Latency = $root.google.protobuf.Duration.fromObject(object.p50Latency); + } + if (object.p90Latency != null) { + if (typeof object.p90Latency !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.p90Latency: object expected"); + message.p90Latency = $root.google.protobuf.Duration.fromObject(object.p90Latency); + } + if (object.p99Latency != null) { + if (typeof object.p99Latency !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.p99Latency: object expected"); + message.p99Latency = $root.google.protobuf.Duration.fromObject(object.p99Latency); + } + if (object.callCount != null) + message.callCount = object.callCount | 0; + return message; + }; + + /** + * Creates a plain object from a LatencyMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.LatencyMetrics} message LatencyMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LatencyMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.p50Latency = null; + object.p90Latency = null; + object.p99Latency = null; + object.callCount = 0; + } + if (message.p50Latency != null && message.hasOwnProperty("p50Latency")) + object.p50Latency = $root.google.protobuf.Duration.toObject(message.p50Latency, options); + if (message.p90Latency != null && message.hasOwnProperty("p90Latency")) + object.p90Latency = $root.google.protobuf.Duration.toObject(message.p90Latency, options); + if (message.p99Latency != null && message.hasOwnProperty("p99Latency")) + object.p99Latency = $root.google.protobuf.Duration.toObject(message.p99Latency, options); + if (message.callCount != null && message.hasOwnProperty("callCount")) + object.callCount = message.callCount; + return object; + }; + + /** + * Converts this LatencyMetrics to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @instance + * @returns {Object.} JSON object + */ + LatencyMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LatencyMetrics + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.LatencyReport.LatencyMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LatencyMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.LatencyReport.LatencyMetrics"; + }; + + return LatencyMetrics; + })(); + + LatencyReport.ToolLatency = (function() { + + /** + * Properties of a ToolLatency. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @interface IToolLatency + * @property {string|null} [tool] ToolLatency tool + * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] ToolLatency toolsetTool + * @property {string|null} [toolDisplayName] ToolLatency toolDisplayName + * @property {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null} [latencyMetrics] ToolLatency latencyMetrics + */ + + /** + * Constructs a new ToolLatency. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @classdesc Represents a ToolLatency. + * @implements IToolLatency + * @constructor + * @param {google.cloud.ces.v1beta.LatencyReport.IToolLatency=} [properties] Properties to set + */ + function ToolLatency(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolLatency tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @instance + */ + ToolLatency.prototype.tool = null; + + /** + * ToolLatency toolsetTool. + * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @instance + */ + ToolLatency.prototype.toolsetTool = null; + + /** + * ToolLatency toolDisplayName. + * @member {string} toolDisplayName + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @instance + */ + ToolLatency.prototype.toolDisplayName = ""; + + /** + * ToolLatency latencyMetrics. + * @member {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null|undefined} latencyMetrics + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @instance + */ + ToolLatency.prototype.latencyMetrics = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ToolLatency toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @instance + */ + Object.defineProperty(ToolLatency.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ToolLatency instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.IToolLatency=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.LatencyReport.ToolLatency} ToolLatency instance + */ + ToolLatency.create = function create(properties) { + return new ToolLatency(properties); + }; + + /** + * Encodes the specified ToolLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.ToolLatency.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.IToolLatency} message ToolLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolLatency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolDisplayName != null && Object.hasOwnProperty.call(message, "toolDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.toolDisplayName); + if (message.latencyMetrics != null && Object.hasOwnProperty.call(message, "latencyMetrics")) + $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.encode(message.latencyMetrics, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.ToolLatency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.IToolLatency} message ToolLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolLatency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolLatency message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.LatencyReport.ToolLatency} ToolLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolLatency.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 3: { + message.toolDisplayName = reader.string(); + break; + } + case 4: { + message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolLatency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.LatencyReport.ToolLatency} ToolLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolLatency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolLatency message. + * @function verify + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolLatency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.toolDisplayName != null && message.hasOwnProperty("toolDisplayName")) + if (!$util.isString(message.toolDisplayName)) + return "toolDisplayName: string expected"; + if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) { + var error = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify(message.latencyMetrics); + if (error) + return "latencyMetrics." + error; + } + return null; + }; + + /** + * Creates a ToolLatency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.LatencyReport.ToolLatency} ToolLatency + */ + ToolLatency.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency) + return object; + var message = new $root.google.cloud.ces.v1beta.LatencyReport.ToolLatency(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.ToolLatency.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.toolDisplayName != null) + message.toolDisplayName = String(object.toolDisplayName); + if (object.latencyMetrics != null) { + if (typeof object.latencyMetrics !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.ToolLatency.latencyMetrics: object expected"); + message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.fromObject(object.latencyMetrics); + } + return message; + }; + + /** + * Creates a plain object from a ToolLatency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ToolLatency} message ToolLatency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolLatency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.toolDisplayName = ""; + object.latencyMetrics = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + if (message.toolDisplayName != null && message.hasOwnProperty("toolDisplayName")) + object.toolDisplayName = message.toolDisplayName; + if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) + object.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.toObject(message.latencyMetrics, options); + return object; + }; + + /** + * Converts this ToolLatency to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @instance + * @returns {Object.} JSON object + */ + ToolLatency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolLatency + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.LatencyReport.ToolLatency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolLatency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.LatencyReport.ToolLatency"; + }; + + return ToolLatency; + })(); + + LatencyReport.CallbackLatency = (function() { + + /** + * Properties of a CallbackLatency. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @interface ICallbackLatency + * @property {string|null} [stage] CallbackLatency stage + * @property {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null} [latencyMetrics] CallbackLatency latencyMetrics + */ + + /** + * Constructs a new CallbackLatency. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @classdesc Represents a CallbackLatency. + * @implements ICallbackLatency + * @constructor + * @param {google.cloud.ces.v1beta.LatencyReport.ICallbackLatency=} [properties] Properties to set + */ + function CallbackLatency(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CallbackLatency stage. + * @member {string} stage + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @instance + */ + CallbackLatency.prototype.stage = ""; + + /** + * CallbackLatency latencyMetrics. + * @member {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null|undefined} latencyMetrics + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @instance + */ + CallbackLatency.prototype.latencyMetrics = null; + + /** + * Creates a new CallbackLatency instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ICallbackLatency=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.LatencyReport.CallbackLatency} CallbackLatency instance + */ + CallbackLatency.create = function create(properties) { + return new CallbackLatency(properties); + }; + + /** + * Encodes the specified CallbackLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.CallbackLatency.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ICallbackLatency} message CallbackLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CallbackLatency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stage != null && Object.hasOwnProperty.call(message, "stage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stage); + if (message.latencyMetrics != null && Object.hasOwnProperty.call(message, "latencyMetrics")) + $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.encode(message.latencyMetrics, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CallbackLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.CallbackLatency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ICallbackLatency} message CallbackLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CallbackLatency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CallbackLatency message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.LatencyReport.CallbackLatency} CallbackLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CallbackLatency.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stage = reader.string(); + break; + } + case 2: { + message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CallbackLatency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.LatencyReport.CallbackLatency} CallbackLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CallbackLatency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CallbackLatency message. + * @function verify + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CallbackLatency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stage != null && message.hasOwnProperty("stage")) + if (!$util.isString(message.stage)) + return "stage: string expected"; + if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) { + var error = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify(message.latencyMetrics); + if (error) + return "latencyMetrics." + error; + } + return null; + }; + + /** + * Creates a CallbackLatency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.LatencyReport.CallbackLatency} CallbackLatency + */ + CallbackLatency.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency) + return object; + var message = new $root.google.cloud.ces.v1beta.LatencyReport.CallbackLatency(); + if (object.stage != null) + message.stage = String(object.stage); + if (object.latencyMetrics != null) { + if (typeof object.latencyMetrics !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.CallbackLatency.latencyMetrics: object expected"); + message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.fromObject(object.latencyMetrics); + } + return message; + }; + + /** + * Creates a plain object from a CallbackLatency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.CallbackLatency} message CallbackLatency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CallbackLatency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.stage = ""; + object.latencyMetrics = null; + } + if (message.stage != null && message.hasOwnProperty("stage")) + object.stage = message.stage; + if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) + object.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.toObject(message.latencyMetrics, options); + return object; + }; + + /** + * Converts this CallbackLatency to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @instance + * @returns {Object.} JSON object + */ + CallbackLatency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CallbackLatency + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.LatencyReport.CallbackLatency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CallbackLatency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.LatencyReport.CallbackLatency"; + }; + + return CallbackLatency; + })(); + + LatencyReport.GuardrailLatency = (function() { + + /** + * Properties of a GuardrailLatency. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @interface IGuardrailLatency + * @property {string|null} [guardrail] GuardrailLatency guardrail + * @property {string|null} [guardrailDisplayName] GuardrailLatency guardrailDisplayName + * @property {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null} [latencyMetrics] GuardrailLatency latencyMetrics + */ + + /** + * Constructs a new GuardrailLatency. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @classdesc Represents a GuardrailLatency. + * @implements IGuardrailLatency + * @constructor + * @param {google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency=} [properties] Properties to set + */ + function GuardrailLatency(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GuardrailLatency guardrail. + * @member {string} guardrail + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @instance + */ + GuardrailLatency.prototype.guardrail = ""; + + /** + * GuardrailLatency guardrailDisplayName. + * @member {string} guardrailDisplayName + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @instance + */ + GuardrailLatency.prototype.guardrailDisplayName = ""; + + /** + * GuardrailLatency latencyMetrics. + * @member {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null|undefined} latencyMetrics + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @instance + */ + GuardrailLatency.prototype.latencyMetrics = null; + + /** + * Creates a new GuardrailLatency instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.LatencyReport.GuardrailLatency} GuardrailLatency instance + */ + GuardrailLatency.create = function create(properties) { + return new GuardrailLatency(properties); + }; + + /** + * Encodes the specified GuardrailLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency} message GuardrailLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuardrailLatency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.guardrail != null && Object.hasOwnProperty.call(message, "guardrail")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.guardrail); + if (message.guardrailDisplayName != null && Object.hasOwnProperty.call(message, "guardrailDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.guardrailDisplayName); + if (message.latencyMetrics != null && Object.hasOwnProperty.call(message, "latencyMetrics")) + $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.encode(message.latencyMetrics, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GuardrailLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.IGuardrailLatency} message GuardrailLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuardrailLatency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GuardrailLatency message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.LatencyReport.GuardrailLatency} GuardrailLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuardrailLatency.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.guardrail = reader.string(); + break; + } + case 2: { + message.guardrailDisplayName = reader.string(); + break; + } + case 3: { + message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GuardrailLatency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.LatencyReport.GuardrailLatency} GuardrailLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuardrailLatency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GuardrailLatency message. + * @function verify + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GuardrailLatency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.guardrail != null && message.hasOwnProperty("guardrail")) + if (!$util.isString(message.guardrail)) + return "guardrail: string expected"; + if (message.guardrailDisplayName != null && message.hasOwnProperty("guardrailDisplayName")) + if (!$util.isString(message.guardrailDisplayName)) + return "guardrailDisplayName: string expected"; + if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) { + var error = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify(message.latencyMetrics); + if (error) + return "latencyMetrics." + error; + } + return null; + }; + + /** + * Creates a GuardrailLatency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.LatencyReport.GuardrailLatency} GuardrailLatency + */ + GuardrailLatency.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency) + return object; + var message = new $root.google.cloud.ces.v1beta.LatencyReport.GuardrailLatency(); + if (object.guardrail != null) + message.guardrail = String(object.guardrail); + if (object.guardrailDisplayName != null) + message.guardrailDisplayName = String(object.guardrailDisplayName); + if (object.latencyMetrics != null) { + if (typeof object.latencyMetrics !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.GuardrailLatency.latencyMetrics: object expected"); + message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.fromObject(object.latencyMetrics); + } + return message; + }; + + /** + * Creates a plain object from a GuardrailLatency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.GuardrailLatency} message GuardrailLatency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GuardrailLatency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.guardrail = ""; + object.guardrailDisplayName = ""; + object.latencyMetrics = null; + } + if (message.guardrail != null && message.hasOwnProperty("guardrail")) + object.guardrail = message.guardrail; + if (message.guardrailDisplayName != null && message.hasOwnProperty("guardrailDisplayName")) + object.guardrailDisplayName = message.guardrailDisplayName; + if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) + object.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.toObject(message.latencyMetrics, options); + return object; + }; + + /** + * Converts this GuardrailLatency to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @instance + * @returns {Object.} JSON object + */ + GuardrailLatency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GuardrailLatency + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.LatencyReport.GuardrailLatency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GuardrailLatency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.LatencyReport.GuardrailLatency"; + }; + + return GuardrailLatency; + })(); + + LatencyReport.LlmCallLatency = (function() { + + /** + * Properties of a LlmCallLatency. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @interface ILlmCallLatency + * @property {string|null} [model] LlmCallLatency model + * @property {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null} [latencyMetrics] LlmCallLatency latencyMetrics + */ + + /** + * Constructs a new LlmCallLatency. + * @memberof google.cloud.ces.v1beta.LatencyReport + * @classdesc Represents a LlmCallLatency. + * @implements ILlmCallLatency + * @constructor + * @param {google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency=} [properties] Properties to set + */ + function LlmCallLatency(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LlmCallLatency model. + * @member {string} model + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @instance + */ + LlmCallLatency.prototype.model = ""; + + /** + * LlmCallLatency latencyMetrics. + * @member {google.cloud.ces.v1beta.LatencyReport.ILatencyMetrics|null|undefined} latencyMetrics + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @instance + */ + LlmCallLatency.prototype.latencyMetrics = null; + + /** + * Creates a new LlmCallLatency instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.LatencyReport.LlmCallLatency} LlmCallLatency instance + */ + LlmCallLatency.create = function create(properties) { + return new LlmCallLatency(properties); + }; + + /** + * Encodes the specified LlmCallLatency message. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency} message LlmCallLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmCallLatency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.latencyMetrics != null && Object.hasOwnProperty.call(message, "latencyMetrics")) + $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.encode(message.latencyMetrics, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LlmCallLatency message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.ILlmCallLatency} message LlmCallLatency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmCallLatency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LlmCallLatency message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.LatencyReport.LlmCallLatency} LlmCallLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmCallLatency.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LlmCallLatency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.LatencyReport.LlmCallLatency} LlmCallLatency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmCallLatency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LlmCallLatency message. + * @function verify + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LlmCallLatency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) { + var error = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.verify(message.latencyMetrics); + if (error) + return "latencyMetrics." + error; + } + return null; + }; + + /** + * Creates a LlmCallLatency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.LatencyReport.LlmCallLatency} LlmCallLatency + */ + LlmCallLatency.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency) + return object; + var message = new $root.google.cloud.ces.v1beta.LatencyReport.LlmCallLatency(); + if (object.model != null) + message.model = String(object.model); + if (object.latencyMetrics != null) { + if (typeof object.latencyMetrics !== "object") + throw TypeError(".google.cloud.ces.v1beta.LatencyReport.LlmCallLatency.latencyMetrics: object expected"); + message.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.fromObject(object.latencyMetrics); + } + return message; + }; + + /** + * Creates a plain object from a LlmCallLatency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @static + * @param {google.cloud.ces.v1beta.LatencyReport.LlmCallLatency} message LlmCallLatency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LlmCallLatency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.latencyMetrics = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.latencyMetrics != null && message.hasOwnProperty("latencyMetrics")) + object.latencyMetrics = $root.google.cloud.ces.v1beta.LatencyReport.LatencyMetrics.toObject(message.latencyMetrics, options); + return object; + }; + + /** + * Converts this LlmCallLatency to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @instance + * @returns {Object.} JSON object + */ + LlmCallLatency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LlmCallLatency + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.LatencyReport.LlmCallLatency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LlmCallLatency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.LatencyReport.LlmCallLatency"; + }; + + return LlmCallLatency; + })(); + + return LatencyReport; + })(); + + v1beta.EvaluationExpectation = (function() { + + /** + * Properties of an EvaluationExpectation. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluationExpectation + * @property {google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria|null} [llmCriteria] EvaluationExpectation llmCriteria + * @property {string|null} [name] EvaluationExpectation name + * @property {string|null} [displayName] EvaluationExpectation displayName + * @property {Array.|null} [tags] EvaluationExpectation tags + * @property {google.protobuf.ITimestamp|null} [createTime] EvaluationExpectation createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] EvaluationExpectation updateTime + * @property {string|null} [etag] EvaluationExpectation etag + */ + + /** + * Constructs a new EvaluationExpectation. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationExpectation. + * @implements IEvaluationExpectation + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluationExpectation=} [properties] Properties to set + */ + function EvaluationExpectation(properties) { + 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]]; + } + + /** + * EvaluationExpectation llmCriteria. + * @member {google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria|null|undefined} llmCriteria + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @instance + */ + EvaluationExpectation.prototype.llmCriteria = null; + + /** + * EvaluationExpectation name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @instance + */ + EvaluationExpectation.prototype.name = ""; + + /** + * EvaluationExpectation displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @instance + */ + EvaluationExpectation.prototype.displayName = ""; + + /** + * EvaluationExpectation tags. + * @member {Array.} tags + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @instance + */ + EvaluationExpectation.prototype.tags = $util.emptyArray; + + /** + * EvaluationExpectation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @instance + */ + EvaluationExpectation.prototype.createTime = null; + + /** + * EvaluationExpectation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @instance + */ + EvaluationExpectation.prototype.updateTime = null; + + /** + * EvaluationExpectation etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @instance + */ + EvaluationExpectation.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EvaluationExpectation criteria. + * @member {"llmCriteria"|undefined} criteria + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @instance + */ + Object.defineProperty(EvaluationExpectation.prototype, "criteria", { + get: $util.oneOfGetter($oneOfFields = ["llmCriteria"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EvaluationExpectation instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @static + * @param {google.cloud.ces.v1beta.IEvaluationExpectation=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationExpectation} EvaluationExpectation instance + */ + EvaluationExpectation.create = function create(properties) { + return new EvaluationExpectation(properties); + }; + + /** + * Encodes the specified EvaluationExpectation message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @static + * @param {google.cloud.ces.v1beta.IEvaluationExpectation} message EvaluationExpectation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationExpectation.encode = function encode(message, writer) { + if (!writer) + 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.llmCriteria != null && Object.hasOwnProperty.call(message, "llmCriteria")) + $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.encode(message.llmCriteria, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + 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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.tags[i]); + return writer; + }; + + /** + * Encodes the specified EvaluationExpectation message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @static + * @param {google.cloud.ces.v1beta.IEvaluationExpectation} message EvaluationExpectation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationExpectation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationExpectation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationExpectation} EvaluationExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationExpectation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationExpectation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.llmCriteria = $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 8: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(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.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationExpectation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationExpectation} EvaluationExpectation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationExpectation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationExpectation message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationExpectation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.llmCriteria != null && message.hasOwnProperty("llmCriteria")) { + properties.criteria = 1; + { + var error = $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.verify(message.llmCriteria); + if (error) + return "llmCriteria." + 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.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an EvaluationExpectation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationExpectation} EvaluationExpectation + */ + EvaluationExpectation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationExpectation) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationExpectation(); + if (object.llmCriteria != null) { + if (typeof object.llmCriteria !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationExpectation.llmCriteria: object expected"); + message.llmCriteria = $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.fromObject(object.llmCriteria); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.ces.v1beta.EvaluationExpectation.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationExpectation.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.ces.v1beta.EvaluationExpectation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an EvaluationExpectation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @static + * @param {google.cloud.ces.v1beta.EvaluationExpectation} message EvaluationExpectation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationExpectation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tags = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.llmCriteria != null && message.hasOwnProperty("llmCriteria")) { + object.llmCriteria = $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.toObject(message.llmCriteria, options); + if (options.oneofs) + object.criteria = "llmCriteria"; + } + 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + return object; + }; + + /** + * Converts this EvaluationExpectation to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @instance + * @returns {Object.} JSON object + */ + EvaluationExpectation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationExpectation + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationExpectation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationExpectation"; + }; + + EvaluationExpectation.LlmCriteria = (function() { + + /** + * Properties of a LlmCriteria. + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @interface ILlmCriteria + * @property {string|null} [prompt] LlmCriteria prompt + */ + + /** + * Constructs a new LlmCriteria. + * @memberof google.cloud.ces.v1beta.EvaluationExpectation + * @classdesc Represents a LlmCriteria. + * @implements ILlmCriteria + * @constructor + * @param {google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria=} [properties] Properties to set + */ + function LlmCriteria(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LlmCriteria prompt. + * @member {string} prompt + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @instance + */ + LlmCriteria.prototype.prompt = ""; + + /** + * Creates a new LlmCriteria instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @static + * @param {google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria} LlmCriteria instance + */ + LlmCriteria.create = function create(properties) { + return new LlmCriteria(properties); + }; + + /** + * Encodes the specified LlmCriteria message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @static + * @param {google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria} message LlmCriteria message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmCriteria.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.prompt); + return writer; + }; + + /** + * Encodes the specified LlmCriteria message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @static + * @param {google.cloud.ces.v1beta.EvaluationExpectation.ILlmCriteria} message LlmCriteria message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmCriteria.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LlmCriteria message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria} LlmCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmCriteria.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.prompt = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LlmCriteria message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria} LlmCriteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmCriteria.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LlmCriteria message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LlmCriteria.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.prompt != null && message.hasOwnProperty("prompt")) + if (!$util.isString(message.prompt)) + return "prompt: string expected"; + return null; + }; + + /** + * Creates a LlmCriteria message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria} LlmCriteria + */ + LlmCriteria.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria(); + if (object.prompt != null) + message.prompt = String(object.prompt); + return message; + }; + + /** + * Creates a plain object from a LlmCriteria message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @static + * @param {google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria} message LlmCriteria + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LlmCriteria.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.prompt = ""; + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = message.prompt; + return object; + }; + + /** + * Converts this LlmCriteria to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @instance + * @returns {Object.} JSON object + */ + LlmCriteria.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LlmCriteria + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LlmCriteria.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationExpectation.LlmCriteria"; + }; + + return LlmCriteria; + })(); + + return EvaluationExpectation; + })(); + + v1beta.EvaluationConfig = (function() { + + /** + * Properties of an EvaluationConfig. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluationConfig + * @property {google.cloud.ces.v1beta.IInputAudioConfig|null} [inputAudioConfig] EvaluationConfig inputAudioConfig + * @property {google.cloud.ces.v1beta.IOutputAudioConfig|null} [outputAudioConfig] EvaluationConfig outputAudioConfig + * @property {google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel|null} [evaluationChannel] EvaluationConfig evaluationChannel + * @property {google.cloud.ces.v1beta.EvaluationToolCallBehaviour|null} [toolCallBehaviour] EvaluationConfig toolCallBehaviour + */ + + /** + * Constructs a new EvaluationConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationConfig. + * @implements IEvaluationConfig + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluationConfig=} [properties] Properties to set + */ + function EvaluationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationConfig inputAudioConfig. + * @member {google.cloud.ces.v1beta.IInputAudioConfig|null|undefined} inputAudioConfig + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @instance + */ + EvaluationConfig.prototype.inputAudioConfig = null; + + /** + * EvaluationConfig outputAudioConfig. + * @member {google.cloud.ces.v1beta.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @instance + */ + EvaluationConfig.prototype.outputAudioConfig = null; + + /** + * EvaluationConfig evaluationChannel. + * @member {google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel} evaluationChannel + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @instance + */ + EvaluationConfig.prototype.evaluationChannel = 0; + + /** + * EvaluationConfig toolCallBehaviour. + * @member {google.cloud.ces.v1beta.EvaluationToolCallBehaviour} toolCallBehaviour + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @instance + */ + EvaluationConfig.prototype.toolCallBehaviour = 0; + + /** + * Creates a new EvaluationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @static + * @param {google.cloud.ces.v1beta.IEvaluationConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationConfig} EvaluationConfig instance + */ + EvaluationConfig.create = function create(properties) { + return new EvaluationConfig(properties); + }; + + /** + * Encodes the specified EvaluationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @static + * @param {google.cloud.ces.v1beta.IEvaluationConfig} message EvaluationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputAudioConfig != null && Object.hasOwnProperty.call(message, "inputAudioConfig")) + $root.google.cloud.ces.v1beta.InputAudioConfig.encode(message.inputAudioConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.ces.v1beta.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.evaluationChannel != null && Object.hasOwnProperty.call(message, "evaluationChannel")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.evaluationChannel); + if (message.toolCallBehaviour != null && Object.hasOwnProperty.call(message, "toolCallBehaviour")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.toolCallBehaviour); + return writer; + }; + + /** + * Encodes the specified EvaluationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @static + * @param {google.cloud.ces.v1beta.IEvaluationConfig} message EvaluationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationConfig} EvaluationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputAudioConfig = $root.google.cloud.ces.v1beta.InputAudioConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.outputAudioConfig = $root.google.cloud.ces.v1beta.OutputAudioConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.evaluationChannel = reader.int32(); + break; + } + case 4: { + message.toolCallBehaviour = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationConfig} EvaluationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputAudioConfig != null && message.hasOwnProperty("inputAudioConfig")) { + var error = $root.google.cloud.ces.v1beta.InputAudioConfig.verify(message.inputAudioConfig); + if (error) + return "inputAudioConfig." + error; + } + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.ces.v1beta.OutputAudioConfig.verify(message.outputAudioConfig); + if (error) + return "outputAudioConfig." + error; + } + if (message.evaluationChannel != null && message.hasOwnProperty("evaluationChannel")) + switch (message.evaluationChannel) { + default: + return "evaluationChannel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.toolCallBehaviour != null && message.hasOwnProperty("toolCallBehaviour")) + switch (message.toolCallBehaviour) { + default: + return "toolCallBehaviour: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an EvaluationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationConfig} EvaluationConfig + */ + EvaluationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationConfig(); + if (object.inputAudioConfig != null) { + if (typeof object.inputAudioConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationConfig.inputAudioConfig: object expected"); + message.inputAudioConfig = $root.google.cloud.ces.v1beta.InputAudioConfig.fromObject(object.inputAudioConfig); + } + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.EvaluationConfig.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.ces.v1beta.OutputAudioConfig.fromObject(object.outputAudioConfig); + } + switch (object.evaluationChannel) { + default: + if (typeof object.evaluationChannel === "number") { + message.evaluationChannel = object.evaluationChannel; + break; + } + break; + case "EVALUATION_CHANNEL_UNSPECIFIED": + case 0: + message.evaluationChannel = 0; + break; + case "TEXT": + case 1: + message.evaluationChannel = 1; + break; + case "AUDIO": + case 2: + message.evaluationChannel = 2; + break; + } + switch (object.toolCallBehaviour) { + default: + if (typeof object.toolCallBehaviour === "number") { + message.toolCallBehaviour = object.toolCallBehaviour; + break; + } + break; + case "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED": + case 0: + message.toolCallBehaviour = 0; + break; + case "REAL": + case 1: + message.toolCallBehaviour = 1; + break; + case "FAKE": + case 2: + message.toolCallBehaviour = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an EvaluationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @static + * @param {google.cloud.ces.v1beta.EvaluationConfig} message EvaluationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputAudioConfig = null; + object.outputAudioConfig = null; + object.evaluationChannel = options.enums === String ? "EVALUATION_CHANNEL_UNSPECIFIED" : 0; + object.toolCallBehaviour = options.enums === String ? "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED" : 0; + } + if (message.inputAudioConfig != null && message.hasOwnProperty("inputAudioConfig")) + object.inputAudioConfig = $root.google.cloud.ces.v1beta.InputAudioConfig.toObject(message.inputAudioConfig, options); + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.ces.v1beta.OutputAudioConfig.toObject(message.outputAudioConfig, options); + if (message.evaluationChannel != null && message.hasOwnProperty("evaluationChannel")) + object.evaluationChannel = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel[message.evaluationChannel] === undefined ? message.evaluationChannel : $root.google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel[message.evaluationChannel] : message.evaluationChannel; + if (message.toolCallBehaviour != null && message.hasOwnProperty("toolCallBehaviour")) + object.toolCallBehaviour = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationToolCallBehaviour[message.toolCallBehaviour] === undefined ? message.toolCallBehaviour : $root.google.cloud.ces.v1beta.EvaluationToolCallBehaviour[message.toolCallBehaviour] : message.toolCallBehaviour; + return object; + }; + + /** + * Converts this EvaluationConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @instance + * @returns {Object.} JSON object + */ + EvaluationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationConfig"; + }; + + /** + * EvaluationChannel enum. + * @name google.cloud.ces.v1beta.EvaluationConfig.EvaluationChannel + * @enum {number} + * @property {number} EVALUATION_CHANNEL_UNSPECIFIED=0 EVALUATION_CHANNEL_UNSPECIFIED value + * @property {number} TEXT=1 TEXT value + * @property {number} AUDIO=2 AUDIO value + */ + EvaluationConfig.EvaluationChannel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVALUATION_CHANNEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "AUDIO"] = 2; + return values; + })(); + + return EvaluationConfig; + })(); + + v1beta.EvaluationErrorInfo = (function() { + + /** + * Properties of an EvaluationErrorInfo. + * @memberof google.cloud.ces.v1beta + * @interface IEvaluationErrorInfo + * @property {google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType|null} [errorType] EvaluationErrorInfo errorType + * @property {string|null} [errorMessage] EvaluationErrorInfo errorMessage + * @property {string|null} [sessionId] EvaluationErrorInfo sessionId + */ + + /** + * Constructs a new EvaluationErrorInfo. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationErrorInfo. + * @implements IEvaluationErrorInfo + * @constructor + * @param {google.cloud.ces.v1beta.IEvaluationErrorInfo=} [properties] Properties to set + */ + function EvaluationErrorInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationErrorInfo errorType. + * @member {google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType} errorType + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @instance + */ + EvaluationErrorInfo.prototype.errorType = 0; + + /** + * EvaluationErrorInfo errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @instance + */ + EvaluationErrorInfo.prototype.errorMessage = ""; + + /** + * EvaluationErrorInfo sessionId. + * @member {string} sessionId + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @instance + */ + EvaluationErrorInfo.prototype.sessionId = ""; + + /** + * Creates a new EvaluationErrorInfo instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @static + * @param {google.cloud.ces.v1beta.IEvaluationErrorInfo=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EvaluationErrorInfo} EvaluationErrorInfo instance + */ + EvaluationErrorInfo.create = function create(properties) { + return new EvaluationErrorInfo(properties); + }; + + /** + * Encodes the specified EvaluationErrorInfo message. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationErrorInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @static + * @param {google.cloud.ces.v1beta.IEvaluationErrorInfo} message EvaluationErrorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationErrorInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorType != null && Object.hasOwnProperty.call(message, "errorType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.errorType); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessage); + if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sessionId); + return writer; + }; + + /** + * Encodes the specified EvaluationErrorInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EvaluationErrorInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @static + * @param {google.cloud.ces.v1beta.IEvaluationErrorInfo} message EvaluationErrorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationErrorInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationErrorInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EvaluationErrorInfo} EvaluationErrorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationErrorInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EvaluationErrorInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.errorType = reader.int32(); + break; + } + case 2: { + message.errorMessage = reader.string(); + break; + } + case 3: { + message.sessionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationErrorInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EvaluationErrorInfo} EvaluationErrorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationErrorInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationErrorInfo message. + * @function verify + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationErrorInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorType != null && message.hasOwnProperty("errorType")) + switch (message.errorType) { + default: + return "errorType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + if (!$util.isString(message.sessionId)) + return "sessionId: string expected"; + return null; + }; + + /** + * Creates an EvaluationErrorInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EvaluationErrorInfo} EvaluationErrorInfo + */ + EvaluationErrorInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EvaluationErrorInfo) + return object; + var message = new $root.google.cloud.ces.v1beta.EvaluationErrorInfo(); + switch (object.errorType) { + default: + if (typeof object.errorType === "number") { + message.errorType = object.errorType; + break; + } + break; + case "ERROR_TYPE_UNSPECIFIED": + case 0: + message.errorType = 0; + break; + case "RUNTIME_FAILURE": + case 1: + message.errorType = 1; + break; + case "CONVERSATION_RETRIEVAL_FAILURE": + case 2: + message.errorType = 2; + break; + case "METRIC_CALCULATION_FAILURE": + case 3: + message.errorType = 3; + break; + case "EVALUATION_UPDATE_FAILURE": + case 4: + message.errorType = 4; + break; + case "QUOTA_EXHAUSTED": + case 5: + message.errorType = 5; + break; + case "USER_SIMULATION_FAILURE": + case 6: + message.errorType = 6; + break; + } + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + if (object.sessionId != null) + message.sessionId = String(object.sessionId); + return message; + }; + + /** + * Creates a plain object from an EvaluationErrorInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @static + * @param {google.cloud.ces.v1beta.EvaluationErrorInfo} message EvaluationErrorInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationErrorInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.errorType = options.enums === String ? "ERROR_TYPE_UNSPECIFIED" : 0; + object.errorMessage = ""; + object.sessionId = ""; + } + if (message.errorType != null && message.hasOwnProperty("errorType")) + object.errorType = options.enums === String ? $root.google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType[message.errorType] === undefined ? message.errorType : $root.google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType[message.errorType] : message.errorType; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + object.sessionId = message.sessionId; + return object; + }; + + /** + * Converts this EvaluationErrorInfo to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @instance + * @returns {Object.} JSON object + */ + EvaluationErrorInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationErrorInfo + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EvaluationErrorInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationErrorInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EvaluationErrorInfo"; + }; + + /** + * ErrorType enum. + * @name google.cloud.ces.v1beta.EvaluationErrorInfo.ErrorType + * @enum {number} + * @property {number} ERROR_TYPE_UNSPECIFIED=0 ERROR_TYPE_UNSPECIFIED value + * @property {number} RUNTIME_FAILURE=1 RUNTIME_FAILURE value + * @property {number} CONVERSATION_RETRIEVAL_FAILURE=2 CONVERSATION_RETRIEVAL_FAILURE value + * @property {number} METRIC_CALCULATION_FAILURE=3 METRIC_CALCULATION_FAILURE value + * @property {number} EVALUATION_UPDATE_FAILURE=4 EVALUATION_UPDATE_FAILURE value + * @property {number} QUOTA_EXHAUSTED=5 QUOTA_EXHAUSTED value + * @property {number} USER_SIMULATION_FAILURE=6 USER_SIMULATION_FAILURE value + */ + EvaluationErrorInfo.ErrorType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ERROR_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNTIME_FAILURE"] = 1; + values[valuesById[2] = "CONVERSATION_RETRIEVAL_FAILURE"] = 2; + values[valuesById[3] = "METRIC_CALCULATION_FAILURE"] = 3; + values[valuesById[4] = "EVALUATION_UPDATE_FAILURE"] = 4; + values[valuesById[5] = "QUOTA_EXHAUSTED"] = 5; + values[valuesById[6] = "USER_SIMULATION_FAILURE"] = 6; + return values; + })(); + + return EvaluationErrorInfo; + })(); + + v1beta.RunEvaluationRequest = (function() { + + /** + * Properties of a RunEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IRunEvaluationRequest + * @property {string|null} [app] RunEvaluationRequest app + * @property {Array.|null} [evaluations] RunEvaluationRequest evaluations + * @property {string|null} [evaluationDataset] RunEvaluationRequest evaluationDataset + * @property {string|null} [displayName] RunEvaluationRequest displayName + * @property {string|null} [appVersion] RunEvaluationRequest appVersion + * @property {google.cloud.ces.v1beta.IEvaluationConfig|null} [config] RunEvaluationRequest config + * @property {number|null} [runCount] RunEvaluationRequest runCount + * @property {Array.|null} [personaRunConfigs] RunEvaluationRequest personaRunConfigs + * @property {google.cloud.ces.v1beta.IOptimizationConfig|null} [optimizationConfig] RunEvaluationRequest optimizationConfig + * @property {string|null} [scheduledEvaluationRun] RunEvaluationRequest scheduledEvaluationRun + * @property {google.cloud.ces.v1beta.GoldenRunMethod|null} [goldenRunMethod] RunEvaluationRequest goldenRunMethod + * @property {boolean|null} [generateLatencyReport] RunEvaluationRequest generateLatencyReport + */ + + /** + * Constructs a new RunEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RunEvaluationRequest. + * @implements IRunEvaluationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IRunEvaluationRequest=} [properties] Properties to set + */ + function RunEvaluationRequest(properties) { + this.evaluations = []; + this.personaRunConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunEvaluationRequest app. + * @member {string} app + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.app = ""; + + /** + * RunEvaluationRequest evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.evaluations = $util.emptyArray; + + /** + * RunEvaluationRequest evaluationDataset. + * @member {string} evaluationDataset + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.evaluationDataset = ""; + + /** + * RunEvaluationRequest displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.displayName = ""; + + /** + * RunEvaluationRequest appVersion. + * @member {string} appVersion + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.appVersion = ""; + + /** + * RunEvaluationRequest config. + * @member {google.cloud.ces.v1beta.IEvaluationConfig|null|undefined} config + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.config = null; + + /** + * RunEvaluationRequest runCount. + * @member {number|null|undefined} runCount + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.runCount = null; + + /** + * RunEvaluationRequest personaRunConfigs. + * @member {Array.} personaRunConfigs + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.personaRunConfigs = $util.emptyArray; + + /** + * RunEvaluationRequest optimizationConfig. + * @member {google.cloud.ces.v1beta.IOptimizationConfig|null|undefined} optimizationConfig + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.optimizationConfig = null; + + /** + * RunEvaluationRequest scheduledEvaluationRun. + * @member {string} scheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.scheduledEvaluationRun = ""; + + /** + * RunEvaluationRequest goldenRunMethod. + * @member {google.cloud.ces.v1beta.GoldenRunMethod} goldenRunMethod + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.goldenRunMethod = 0; + + /** + * RunEvaluationRequest generateLatencyReport. + * @member {boolean} generateLatencyReport + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + */ + RunEvaluationRequest.prototype.generateLatencyReport = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RunEvaluationRequest.prototype, "_runCount", { + get: $util.oneOfGetter($oneOfFields = ["runCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RunEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IRunEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RunEvaluationRequest} RunEvaluationRequest instance + */ + RunEvaluationRequest.create = function create(properties) { + return new RunEvaluationRequest(properties); + }; + + /** + * Encodes the specified RunEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IRunEvaluationRequest} message RunEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunEvaluationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.app); + if (message.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluations[i]); + if (message.evaluationDataset != null && Object.hasOwnProperty.call(message, "evaluationDataset")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.evaluationDataset); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.appVersion); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.ces.v1beta.EvaluationConfig.encode(message.config, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.runCount != null && Object.hasOwnProperty.call(message, "runCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.runCount); + if (message.personaRunConfigs != null && message.personaRunConfigs.length) + for (var i = 0; i < message.personaRunConfigs.length; ++i) + $root.google.cloud.ces.v1beta.PersonaRunConfig.encode(message.personaRunConfigs[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.optimizationConfig != null && Object.hasOwnProperty.call(message, "optimizationConfig")) + $root.google.cloud.ces.v1beta.OptimizationConfig.encode(message.optimizationConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.scheduledEvaluationRun != null && Object.hasOwnProperty.call(message, "scheduledEvaluationRun")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.scheduledEvaluationRun); + if (message.goldenRunMethod != null && Object.hasOwnProperty.call(message, "goldenRunMethod")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.goldenRunMethod); + if (message.generateLatencyReport != null && Object.hasOwnProperty.call(message, "generateLatencyReport")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.generateLatencyReport); + return writer; + }; + + /** + * Encodes the specified RunEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IRunEvaluationRequest} message RunEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RunEvaluationRequest} RunEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunEvaluationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RunEvaluationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.app = reader.string(); + break; + } + case 2: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push(reader.string()); + break; + } + case 3: { + message.evaluationDataset = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 6: { + message.appVersion = reader.string(); + break; + } + case 8: { + message.config = $root.google.cloud.ces.v1beta.EvaluationConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.runCount = reader.int32(); + break; + } + case 10: { + if (!(message.personaRunConfigs && message.personaRunConfigs.length)) + message.personaRunConfigs = []; + message.personaRunConfigs.push($root.google.cloud.ces.v1beta.PersonaRunConfig.decode(reader, reader.uint32())); + break; + } + case 11: { + message.optimizationConfig = $root.google.cloud.ces.v1beta.OptimizationConfig.decode(reader, reader.uint32()); + break; + } + case 12: { + message.scheduledEvaluationRun = reader.string(); + break; + } + case 13: { + message.goldenRunMethod = reader.int32(); + break; + } + case 14: { + message.generateLatencyReport = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RunEvaluationRequest} RunEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunEvaluationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunEvaluationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.app != null && message.hasOwnProperty("app")) + if (!$util.isString(message.app)) + return "app: string expected"; + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) + if (!$util.isString(message.evaluations[i])) + return "evaluations: string[] expected"; + } + if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) + if (!$util.isString(message.evaluationDataset)) + return "evaluationDataset: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + if (!$util.isString(message.appVersion)) + return "appVersion: string expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.ces.v1beta.EvaluationConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.runCount != null && message.hasOwnProperty("runCount")) { + properties._runCount = 1; + if (!$util.isInteger(message.runCount)) + return "runCount: integer expected"; + } + if (message.personaRunConfigs != null && message.hasOwnProperty("personaRunConfigs")) { + if (!Array.isArray(message.personaRunConfigs)) + return "personaRunConfigs: array expected"; + for (var i = 0; i < message.personaRunConfigs.length; ++i) { + var error = $root.google.cloud.ces.v1beta.PersonaRunConfig.verify(message.personaRunConfigs[i]); + if (error) + return "personaRunConfigs." + error; + } + } + if (message.optimizationConfig != null && message.hasOwnProperty("optimizationConfig")) { + var error = $root.google.cloud.ces.v1beta.OptimizationConfig.verify(message.optimizationConfig); + if (error) + return "optimizationConfig." + error; + } + if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) + if (!$util.isString(message.scheduledEvaluationRun)) + return "scheduledEvaluationRun: string expected"; + if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) + switch (message.goldenRunMethod) { + default: + return "goldenRunMethod: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.generateLatencyReport != null && message.hasOwnProperty("generateLatencyReport")) + if (typeof message.generateLatencyReport !== "boolean") + return "generateLatencyReport: boolean expected"; + return null; + }; + + /** + * Creates a RunEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RunEvaluationRequest} RunEvaluationRequest + */ + RunEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RunEvaluationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.RunEvaluationRequest(); + if (object.app != null) + message.app = String(object.app); + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.ces.v1beta.RunEvaluationRequest.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) + message.evaluations[i] = String(object.evaluations[i]); + } + if (object.evaluationDataset != null) + message.evaluationDataset = String(object.evaluationDataset); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.appVersion != null) + message.appVersion = String(object.appVersion); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.ces.v1beta.RunEvaluationRequest.config: object expected"); + message.config = $root.google.cloud.ces.v1beta.EvaluationConfig.fromObject(object.config); + } + if (object.runCount != null) + message.runCount = object.runCount | 0; + if (object.personaRunConfigs) { + if (!Array.isArray(object.personaRunConfigs)) + throw TypeError(".google.cloud.ces.v1beta.RunEvaluationRequest.personaRunConfigs: array expected"); + message.personaRunConfigs = []; + for (var i = 0; i < object.personaRunConfigs.length; ++i) { + if (typeof object.personaRunConfigs[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.RunEvaluationRequest.personaRunConfigs: object expected"); + message.personaRunConfigs[i] = $root.google.cloud.ces.v1beta.PersonaRunConfig.fromObject(object.personaRunConfigs[i]); + } + } + if (object.optimizationConfig != null) { + if (typeof object.optimizationConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.RunEvaluationRequest.optimizationConfig: object expected"); + message.optimizationConfig = $root.google.cloud.ces.v1beta.OptimizationConfig.fromObject(object.optimizationConfig); + } + if (object.scheduledEvaluationRun != null) + message.scheduledEvaluationRun = String(object.scheduledEvaluationRun); + switch (object.goldenRunMethod) { + default: + if (typeof object.goldenRunMethod === "number") { + message.goldenRunMethod = object.goldenRunMethod; + break; + } + break; + case "GOLDEN_RUN_METHOD_UNSPECIFIED": + case 0: + message.goldenRunMethod = 0; + break; + case "STABLE": + case 1: + message.goldenRunMethod = 1; + break; + case "NAIVE": + case 2: + message.goldenRunMethod = 2; + break; + } + if (object.generateLatencyReport != null) + message.generateLatencyReport = Boolean(object.generateLatencyReport); + return message; + }; + + /** + * Creates a plain object from a RunEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.RunEvaluationRequest} message RunEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunEvaluationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.evaluations = []; + object.personaRunConfigs = []; + } + if (options.defaults) { + object.app = ""; + object.evaluationDataset = ""; + object.displayName = ""; + object.appVersion = ""; + object.config = null; + object.optimizationConfig = null; + object.scheduledEvaluationRun = ""; + object.goldenRunMethod = options.enums === String ? "GOLDEN_RUN_METHOD_UNSPECIFIED" : 0; + object.generateLatencyReport = false; + } + if (message.app != null && message.hasOwnProperty("app")) + object.app = message.app; + if (message.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = message.evaluations[j]; + } + if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) + object.evaluationDataset = message.evaluationDataset; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + object.appVersion = message.appVersion; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.ces.v1beta.EvaluationConfig.toObject(message.config, options); + if (message.runCount != null && message.hasOwnProperty("runCount")) { + object.runCount = message.runCount; + if (options.oneofs) + object._runCount = "runCount"; + } + if (message.personaRunConfigs && message.personaRunConfigs.length) { + object.personaRunConfigs = []; + for (var j = 0; j < message.personaRunConfigs.length; ++j) + object.personaRunConfigs[j] = $root.google.cloud.ces.v1beta.PersonaRunConfig.toObject(message.personaRunConfigs[j], options); + } + if (message.optimizationConfig != null && message.hasOwnProperty("optimizationConfig")) + object.optimizationConfig = $root.google.cloud.ces.v1beta.OptimizationConfig.toObject(message.optimizationConfig, options); + if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) + object.scheduledEvaluationRun = message.scheduledEvaluationRun; + if (message.goldenRunMethod != null && message.hasOwnProperty("goldenRunMethod")) + object.goldenRunMethod = options.enums === String ? $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] === undefined ? message.goldenRunMethod : $root.google.cloud.ces.v1beta.GoldenRunMethod[message.goldenRunMethod] : message.goldenRunMethod; + if (message.generateLatencyReport != null && message.hasOwnProperty("generateLatencyReport")) + object.generateLatencyReport = message.generateLatencyReport; + return object; + }; + + /** + * Converts this RunEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + RunEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RunEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RunEvaluationRequest"; + }; + + return RunEvaluationRequest; + })(); + + v1beta.ScheduledEvaluationRun = (function() { + + /** + * Properties of a ScheduledEvaluationRun. + * @memberof google.cloud.ces.v1beta + * @interface IScheduledEvaluationRun + * @property {string|null} [name] ScheduledEvaluationRun name + * @property {string|null} [displayName] ScheduledEvaluationRun displayName + * @property {google.cloud.ces.v1beta.IRunEvaluationRequest|null} [request] ScheduledEvaluationRun request + * @property {string|null} [description] ScheduledEvaluationRun description + * @property {google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig|null} [schedulingConfig] ScheduledEvaluationRun schedulingConfig + * @property {boolean|null} [active] ScheduledEvaluationRun active + * @property {string|null} [lastCompletedRun] ScheduledEvaluationRun lastCompletedRun + * @property {number|null} [totalExecutions] ScheduledEvaluationRun totalExecutions + * @property {google.protobuf.ITimestamp|null} [nextScheduledExecutionTime] ScheduledEvaluationRun nextScheduledExecutionTime + * @property {google.protobuf.ITimestamp|null} [createTime] ScheduledEvaluationRun createTime + * @property {string|null} [createdBy] ScheduledEvaluationRun createdBy + * @property {google.protobuf.ITimestamp|null} [updateTime] ScheduledEvaluationRun updateTime + * @property {string|null} [lastUpdatedBy] ScheduledEvaluationRun lastUpdatedBy + * @property {string|null} [etag] ScheduledEvaluationRun etag + */ + + /** + * Constructs a new ScheduledEvaluationRun. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ScheduledEvaluationRun. + * @implements IScheduledEvaluationRun + * @constructor + * @param {google.cloud.ces.v1beta.IScheduledEvaluationRun=} [properties] Properties to set + */ + function ScheduledEvaluationRun(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScheduledEvaluationRun name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.name = ""; + + /** + * ScheduledEvaluationRun displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.displayName = ""; + + /** + * ScheduledEvaluationRun request. + * @member {google.cloud.ces.v1beta.IRunEvaluationRequest|null|undefined} request + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.request = null; + + /** + * ScheduledEvaluationRun description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.description = ""; + + /** + * ScheduledEvaluationRun schedulingConfig. + * @member {google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig|null|undefined} schedulingConfig + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.schedulingConfig = null; + + /** + * ScheduledEvaluationRun active. + * @member {boolean} active + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.active = false; + + /** + * ScheduledEvaluationRun lastCompletedRun. + * @member {string} lastCompletedRun + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.lastCompletedRun = ""; + + /** + * ScheduledEvaluationRun totalExecutions. + * @member {number} totalExecutions + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.totalExecutions = 0; + + /** + * ScheduledEvaluationRun nextScheduledExecutionTime. + * @member {google.protobuf.ITimestamp|null|undefined} nextScheduledExecutionTime + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.nextScheduledExecutionTime = null; + + /** + * ScheduledEvaluationRun createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.createTime = null; + + /** + * ScheduledEvaluationRun createdBy. + * @member {string} createdBy + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.createdBy = ""; + + /** + * ScheduledEvaluationRun updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.updateTime = null; + + /** + * ScheduledEvaluationRun lastUpdatedBy. + * @member {string} lastUpdatedBy + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.lastUpdatedBy = ""; + + /** + * ScheduledEvaluationRun etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + */ + ScheduledEvaluationRun.prototype.etag = ""; + + /** + * Creates a new ScheduledEvaluationRun instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @static + * @param {google.cloud.ces.v1beta.IScheduledEvaluationRun=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun} ScheduledEvaluationRun instance + */ + ScheduledEvaluationRun.create = function create(properties) { + return new ScheduledEvaluationRun(properties); + }; + + /** + * Encodes the specified ScheduledEvaluationRun message. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @static + * @param {google.cloud.ces.v1beta.IScheduledEvaluationRun} message ScheduledEvaluationRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduledEvaluationRun.encode = function encode(message, writer) { + if (!writer) + 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.request != null && Object.hasOwnProperty.call(message, "request")) + $root.google.cloud.ces.v1beta.RunEvaluationRequest.encode(message.request, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.schedulingConfig != null && Object.hasOwnProperty.call(message, "schedulingConfig")) + $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.encode(message.schedulingConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.active != null && Object.hasOwnProperty.call(message, "active")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.active); + if (message.lastCompletedRun != null && Object.hasOwnProperty.call(message, "lastCompletedRun")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.lastCompletedRun); + if (message.totalExecutions != null && Object.hasOwnProperty.call(message, "totalExecutions")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.totalExecutions); + if (message.nextScheduledExecutionTime != null && Object.hasOwnProperty.call(message, "nextScheduledExecutionTime")) + $root.google.protobuf.Timestamp.encode(message.nextScheduledExecutionTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.createdBy != null && Object.hasOwnProperty.call(message, "createdBy")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.createdBy); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.lastUpdatedBy != null && Object.hasOwnProperty.call(message, "lastUpdatedBy")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.lastUpdatedBy); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); + return writer; + }; + + /** + * Encodes the specified ScheduledEvaluationRun message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @static + * @param {google.cloud.ces.v1beta.IScheduledEvaluationRun} message ScheduledEvaluationRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduledEvaluationRun.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScheduledEvaluationRun message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun} ScheduledEvaluationRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduledEvaluationRun.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ScheduledEvaluationRun(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.request = $root.google.cloud.ces.v1beta.RunEvaluationRequest.decode(reader, reader.uint32()); + break; + } + case 4: { + message.description = reader.string(); + break; + } + case 5: { + message.schedulingConfig = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.active = reader.bool(); + break; + } + case 7: { + message.lastCompletedRun = reader.string(); + break; + } + case 8: { + message.totalExecutions = reader.int32(); + break; + } + case 9: { + message.nextScheduledExecutionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.createdBy = reader.string(); + break; + } + case 12: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.lastUpdatedBy = reader.string(); + break; + } + case 14: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScheduledEvaluationRun message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun} ScheduledEvaluationRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduledEvaluationRun.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScheduledEvaluationRun message. + * @function verify + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScheduledEvaluationRun.verify = function verify(message) { + if (typeof message !== "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.request != null && message.hasOwnProperty("request")) { + var error = $root.google.cloud.ces.v1beta.RunEvaluationRequest.verify(message.request); + if (error) + return "request." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.schedulingConfig != null && message.hasOwnProperty("schedulingConfig")) { + var error = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.verify(message.schedulingConfig); + if (error) + return "schedulingConfig." + error; + } + if (message.active != null && message.hasOwnProperty("active")) + if (typeof message.active !== "boolean") + return "active: boolean expected"; + if (message.lastCompletedRun != null && message.hasOwnProperty("lastCompletedRun")) + if (!$util.isString(message.lastCompletedRun)) + return "lastCompletedRun: string expected"; + if (message.totalExecutions != null && message.hasOwnProperty("totalExecutions")) + if (!$util.isInteger(message.totalExecutions)) + return "totalExecutions: integer expected"; + if (message.nextScheduledExecutionTime != null && message.hasOwnProperty("nextScheduledExecutionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.nextScheduledExecutionTime); + if (error) + return "nextScheduledExecutionTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.createdBy != null && message.hasOwnProperty("createdBy")) + if (!$util.isString(message.createdBy)) + return "createdBy: string expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.lastUpdatedBy != null && message.hasOwnProperty("lastUpdatedBy")) + if (!$util.isString(message.lastUpdatedBy)) + return "lastUpdatedBy: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a ScheduledEvaluationRun message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun} ScheduledEvaluationRun + */ + ScheduledEvaluationRun.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ScheduledEvaluationRun) + return object; + var message = new $root.google.cloud.ces.v1beta.ScheduledEvaluationRun(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.request: object expected"); + message.request = $root.google.cloud.ces.v1beta.RunEvaluationRequest.fromObject(object.request); + } + if (object.description != null) + message.description = String(object.description); + if (object.schedulingConfig != null) { + if (typeof object.schedulingConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.schedulingConfig: object expected"); + message.schedulingConfig = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.fromObject(object.schedulingConfig); + } + if (object.active != null) + message.active = Boolean(object.active); + if (object.lastCompletedRun != null) + message.lastCompletedRun = String(object.lastCompletedRun); + if (object.totalExecutions != null) + message.totalExecutions = object.totalExecutions | 0; + if (object.nextScheduledExecutionTime != null) { + if (typeof object.nextScheduledExecutionTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.nextScheduledExecutionTime: object expected"); + message.nextScheduledExecutionTime = $root.google.protobuf.Timestamp.fromObject(object.nextScheduledExecutionTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.createdBy != null) + message.createdBy = String(object.createdBy); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.lastUpdatedBy != null) + message.lastUpdatedBy = String(object.lastUpdatedBy); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a ScheduledEvaluationRun message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @static + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun} message ScheduledEvaluationRun + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScheduledEvaluationRun.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.request = null; + object.description = ""; + object.schedulingConfig = null; + object.active = false; + object.lastCompletedRun = ""; + object.totalExecutions = 0; + object.nextScheduledExecutionTime = null; + object.createTime = null; + object.createdBy = ""; + object.updateTime = null; + object.lastUpdatedBy = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.google.cloud.ces.v1beta.RunEvaluationRequest.toObject(message.request, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.schedulingConfig != null && message.hasOwnProperty("schedulingConfig")) + object.schedulingConfig = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.toObject(message.schedulingConfig, options); + if (message.active != null && message.hasOwnProperty("active")) + object.active = message.active; + if (message.lastCompletedRun != null && message.hasOwnProperty("lastCompletedRun")) + object.lastCompletedRun = message.lastCompletedRun; + if (message.totalExecutions != null && message.hasOwnProperty("totalExecutions")) + object.totalExecutions = message.totalExecutions; + if (message.nextScheduledExecutionTime != null && message.hasOwnProperty("nextScheduledExecutionTime")) + object.nextScheduledExecutionTime = $root.google.protobuf.Timestamp.toObject(message.nextScheduledExecutionTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.createdBy != null && message.hasOwnProperty("createdBy")) + object.createdBy = message.createdBy; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.lastUpdatedBy != null && message.hasOwnProperty("lastUpdatedBy")) + object.lastUpdatedBy = message.lastUpdatedBy; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this ScheduledEvaluationRun to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @instance + * @returns {Object.} JSON object + */ + ScheduledEvaluationRun.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScheduledEvaluationRun + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduledEvaluationRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ScheduledEvaluationRun"; + }; + + ScheduledEvaluationRun.SchedulingConfig = (function() { + + /** + * Properties of a SchedulingConfig. + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @interface ISchedulingConfig + * @property {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency|null} [frequency] SchedulingConfig frequency + * @property {google.protobuf.ITimestamp|null} [startTime] SchedulingConfig startTime + * @property {Array.|null} [daysOfWeek] SchedulingConfig daysOfWeek + */ + + /** + * Constructs a new SchedulingConfig. + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun + * @classdesc Represents a SchedulingConfig. + * @implements ISchedulingConfig + * @constructor + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig=} [properties] Properties to set + */ + function SchedulingConfig(properties) { + 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]]; + } + + /** + * SchedulingConfig frequency. + * @member {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency} frequency + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @instance + */ + SchedulingConfig.prototype.frequency = 0; + + /** + * SchedulingConfig startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @instance + */ + SchedulingConfig.prototype.startTime = null; + + /** + * SchedulingConfig daysOfWeek. + * @member {Array.} daysOfWeek + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @instance + */ + SchedulingConfig.prototype.daysOfWeek = $util.emptyArray; + + /** + * Creates a new SchedulingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @static + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig} SchedulingConfig instance + */ + SchedulingConfig.create = function create(properties) { + return new SchedulingConfig(properties); + }; + + /** + * Encodes the specified SchedulingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @static + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig} message SchedulingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frequency != null && Object.hasOwnProperty.call(message, "frequency")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.frequency); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.daysOfWeek != null && message.daysOfWeek.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.daysOfWeek.length; ++i) + writer.int32(message.daysOfWeek[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SchedulingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @static + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun.ISchedulingConfig} message SchedulingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchedulingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig} SchedulingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.frequency = reader.int32(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + 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 SchedulingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig} SchedulingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchedulingConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchedulingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frequency != null && message.hasOwnProperty("frequency")) + switch (message.frequency) { + default: + return "frequency: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + 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) + if (!$util.isInteger(message.daysOfWeek[i])) + return "daysOfWeek: integer[] expected"; + } + return null; + }; + + /** + * Creates a SchedulingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig} SchedulingConfig + */ + SchedulingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig(); + switch (object.frequency) { + default: + if (typeof object.frequency === "number") { + message.frequency = object.frequency; + break; + } + break; + case "FREQUENCY_UNSPECIFIED": + case 0: + message.frequency = 0; + break; + case "NONE": + case 1: + message.frequency = 1; + break; + case "DAILY": + case 2: + message.frequency = 2; + break; + case "WEEKLY": + case 3: + message.frequency = 3; + break; + case "BIWEEKLY": + case 4: + message.frequency = 4; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.daysOfWeek) { + if (!Array.isArray(object.daysOfWeek)) + throw TypeError(".google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.daysOfWeek: array expected"); + message.daysOfWeek = []; + for (var i = 0; i < object.daysOfWeek.length; ++i) + message.daysOfWeek[i] = object.daysOfWeek[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from a SchedulingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @static + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig} message SchedulingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchedulingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.daysOfWeek = []; + if (options.defaults) { + object.frequency = options.enums === String ? "FREQUENCY_UNSPECIFIED" : 0; + object.startTime = null; + } + if (message.frequency != null && message.hasOwnProperty("frequency")) + object.frequency = options.enums === String ? $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency[message.frequency] === undefined ? message.frequency : $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency[message.frequency] : message.frequency; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.daysOfWeek && message.daysOfWeek.length) { + object.daysOfWeek = []; + for (var j = 0; j < message.daysOfWeek.length; ++j) + object.daysOfWeek[j] = message.daysOfWeek[j]; + } + return object; + }; + + /** + * Converts this SchedulingConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @instance + * @returns {Object.} JSON object + */ + SchedulingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchedulingConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchedulingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig"; + }; + + /** + * Frequency enum. + * @name google.cloud.ces.v1beta.ScheduledEvaluationRun.SchedulingConfig.Frequency + * @enum {number} + * @property {number} FREQUENCY_UNSPECIFIED=0 FREQUENCY_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} DAILY=2 DAILY value + * @property {number} WEEKLY=3 WEEKLY value + * @property {number} BIWEEKLY=4 BIWEEKLY value + */ + SchedulingConfig.Frequency = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FREQUENCY_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "DAILY"] = 2; + values[valuesById[3] = "WEEKLY"] = 3; + values[valuesById[4] = "BIWEEKLY"] = 4; + return values; + })(); + + return SchedulingConfig; + })(); + + return ScheduledEvaluationRun; + })(); + + v1beta.PersonaRunConfig = (function() { + + /** + * Properties of a PersonaRunConfig. + * @memberof google.cloud.ces.v1beta + * @interface IPersonaRunConfig + * @property {string|null} [persona] PersonaRunConfig persona + * @property {number|null} [taskCount] PersonaRunConfig taskCount + */ + + /** + * Constructs a new PersonaRunConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a PersonaRunConfig. + * @implements IPersonaRunConfig + * @constructor + * @param {google.cloud.ces.v1beta.IPersonaRunConfig=} [properties] Properties to set + */ + function PersonaRunConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonaRunConfig persona. + * @member {string} persona + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @instance + */ + PersonaRunConfig.prototype.persona = ""; + + /** + * PersonaRunConfig taskCount. + * @member {number} taskCount + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @instance + */ + PersonaRunConfig.prototype.taskCount = 0; + + /** + * Creates a new PersonaRunConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @static + * @param {google.cloud.ces.v1beta.IPersonaRunConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.PersonaRunConfig} PersonaRunConfig instance + */ + PersonaRunConfig.create = function create(properties) { + return new PersonaRunConfig(properties); + }; + + /** + * Encodes the specified PersonaRunConfig message. Does not implicitly {@link google.cloud.ces.v1beta.PersonaRunConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @static + * @param {google.cloud.ces.v1beta.IPersonaRunConfig} message PersonaRunConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonaRunConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.persona != null && Object.hasOwnProperty.call(message, "persona")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.persona); + if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.taskCount); + return writer; + }; + + /** + * Encodes the specified PersonaRunConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.PersonaRunConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @static + * @param {google.cloud.ces.v1beta.IPersonaRunConfig} message PersonaRunConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonaRunConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonaRunConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.PersonaRunConfig} PersonaRunConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonaRunConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.PersonaRunConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.persona = reader.string(); + break; + } + case 2: { + message.taskCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PersonaRunConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.PersonaRunConfig} PersonaRunConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonaRunConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonaRunConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonaRunConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.persona != null && message.hasOwnProperty("persona")) + if (!$util.isString(message.persona)) + return "persona: string expected"; + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + if (!$util.isInteger(message.taskCount)) + return "taskCount: integer expected"; + return null; + }; + + /** + * Creates a PersonaRunConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.PersonaRunConfig} PersonaRunConfig + */ + PersonaRunConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.PersonaRunConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.PersonaRunConfig(); + if (object.persona != null) + message.persona = String(object.persona); + if (object.taskCount != null) + message.taskCount = object.taskCount | 0; + return message; + }; + + /** + * Creates a plain object from a PersonaRunConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @static + * @param {google.cloud.ces.v1beta.PersonaRunConfig} message PersonaRunConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonaRunConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.persona = ""; + object.taskCount = 0; + } + if (message.persona != null && message.hasOwnProperty("persona")) + object.persona = message.persona; + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + object.taskCount = message.taskCount; + return object; + }; + + /** + * Converts this PersonaRunConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @instance + * @returns {Object.} JSON object + */ + PersonaRunConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PersonaRunConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.PersonaRunConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PersonaRunConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.PersonaRunConfig"; + }; + + return PersonaRunConfig; + })(); + + v1beta.OptimizationConfig = (function() { + + /** + * Properties of an OptimizationConfig. + * @memberof google.cloud.ces.v1beta + * @interface IOptimizationConfig + * @property {boolean|null} [generateLossReport] OptimizationConfig generateLossReport + * @property {string|null} [assistantSession] OptimizationConfig assistantSession + * @property {string|null} [reportSummary] OptimizationConfig reportSummary + * @property {boolean|null} [shouldSuggestFix] OptimizationConfig shouldSuggestFix + * @property {google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus|null} [status] OptimizationConfig status + * @property {string|null} [errorMessage] OptimizationConfig errorMessage + * @property {google.protobuf.IStruct|null} [lossReport] OptimizationConfig lossReport + */ + + /** + * Constructs a new OptimizationConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an OptimizationConfig. + * @implements IOptimizationConfig + * @constructor + * @param {google.cloud.ces.v1beta.IOptimizationConfig=} [properties] Properties to set + */ + function OptimizationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OptimizationConfig generateLossReport. + * @member {boolean} generateLossReport + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @instance + */ + OptimizationConfig.prototype.generateLossReport = false; + + /** + * OptimizationConfig assistantSession. + * @member {string} assistantSession + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @instance + */ + OptimizationConfig.prototype.assistantSession = ""; + + /** + * OptimizationConfig reportSummary. + * @member {string} reportSummary + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @instance + */ + OptimizationConfig.prototype.reportSummary = ""; + + /** + * OptimizationConfig shouldSuggestFix. + * @member {boolean} shouldSuggestFix + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @instance + */ + OptimizationConfig.prototype.shouldSuggestFix = false; + + /** + * OptimizationConfig status. + * @member {google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus} status + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @instance + */ + OptimizationConfig.prototype.status = 0; + + /** + * OptimizationConfig errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @instance + */ + OptimizationConfig.prototype.errorMessage = ""; + + /** + * OptimizationConfig lossReport. + * @member {google.protobuf.IStruct|null|undefined} lossReport + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @instance + */ + OptimizationConfig.prototype.lossReport = null; + + /** + * Creates a new OptimizationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @static + * @param {google.cloud.ces.v1beta.IOptimizationConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OptimizationConfig} OptimizationConfig instance + */ + OptimizationConfig.create = function create(properties) { + return new OptimizationConfig(properties); + }; + + /** + * Encodes the specified OptimizationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OptimizationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @static + * @param {google.cloud.ces.v1beta.IOptimizationConfig} message OptimizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.generateLossReport != null && Object.hasOwnProperty.call(message, "generateLossReport")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.generateLossReport); + if (message.assistantSession != null && Object.hasOwnProperty.call(message, "assistantSession")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assistantSession); + if (message.reportSummary != null && Object.hasOwnProperty.call(message, "reportSummary")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.reportSummary); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); + if (message.shouldSuggestFix != null && Object.hasOwnProperty.call(message, "shouldSuggestFix")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.shouldSuggestFix); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.errorMessage); + if (message.lossReport != null && Object.hasOwnProperty.call(message, "lossReport")) + $root.google.protobuf.Struct.encode(message.lossReport, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OptimizationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OptimizationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @static + * @param {google.cloud.ces.v1beta.IOptimizationConfig} message OptimizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OptimizationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OptimizationConfig} OptimizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OptimizationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.generateLossReport = reader.bool(); + break; + } + case 2: { + message.assistantSession = reader.string(); + break; + } + case 3: { + message.reportSummary = reader.string(); + break; + } + case 5: { + message.shouldSuggestFix = reader.bool(); + break; + } + case 4: { + message.status = reader.int32(); + break; + } + case 6: { + message.errorMessage = reader.string(); + break; + } + case 7: { + message.lossReport = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OptimizationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OptimizationConfig} OptimizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OptimizationConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OptimizationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.generateLossReport != null && message.hasOwnProperty("generateLossReport")) + if (typeof message.generateLossReport !== "boolean") + return "generateLossReport: boolean expected"; + if (message.assistantSession != null && message.hasOwnProperty("assistantSession")) + if (!$util.isString(message.assistantSession)) + return "assistantSession: string expected"; + if (message.reportSummary != null && message.hasOwnProperty("reportSummary")) + if (!$util.isString(message.reportSummary)) + return "reportSummary: string expected"; + if (message.shouldSuggestFix != null && message.hasOwnProperty("shouldSuggestFix")) + if (typeof message.shouldSuggestFix !== "boolean") + return "shouldSuggestFix: boolean expected"; + 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; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + if (message.lossReport != null && message.hasOwnProperty("lossReport")) { + var error = $root.google.protobuf.Struct.verify(message.lossReport); + if (error) + return "lossReport." + error; + } + return null; + }; + + /** + * Creates an OptimizationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OptimizationConfig} OptimizationConfig + */ + OptimizationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OptimizationConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.OptimizationConfig(); + if (object.generateLossReport != null) + message.generateLossReport = Boolean(object.generateLossReport); + if (object.assistantSession != null) + message.assistantSession = String(object.assistantSession); + if (object.reportSummary != null) + message.reportSummary = String(object.reportSummary); + if (object.shouldSuggestFix != null) + message.shouldSuggestFix = Boolean(object.shouldSuggestFix); + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "OPTIMIZATION_STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "RUNNING": + case 1: + message.status = 1; + break; + case "COMPLETED": + case 2: + message.status = 2; + break; + case "ERROR": + case 3: + message.status = 3; + break; + } + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + if (object.lossReport != null) { + if (typeof object.lossReport !== "object") + throw TypeError(".google.cloud.ces.v1beta.OptimizationConfig.lossReport: object expected"); + message.lossReport = $root.google.protobuf.Struct.fromObject(object.lossReport); + } + return message; + }; + + /** + * Creates a plain object from an OptimizationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @static + * @param {google.cloud.ces.v1beta.OptimizationConfig} message OptimizationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OptimizationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.generateLossReport = false; + object.assistantSession = ""; + object.reportSummary = ""; + object.status = options.enums === String ? "OPTIMIZATION_STATUS_UNSPECIFIED" : 0; + object.shouldSuggestFix = false; + object.errorMessage = ""; + object.lossReport = null; + } + if (message.generateLossReport != null && message.hasOwnProperty("generateLossReport")) + object.generateLossReport = message.generateLossReport; + if (message.assistantSession != null && message.hasOwnProperty("assistantSession")) + object.assistantSession = message.assistantSession; + if (message.reportSummary != null && message.hasOwnProperty("reportSummary")) + object.reportSummary = message.reportSummary; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus[message.status] === undefined ? message.status : $root.google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus[message.status] : message.status; + if (message.shouldSuggestFix != null && message.hasOwnProperty("shouldSuggestFix")) + object.shouldSuggestFix = message.shouldSuggestFix; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + if (message.lossReport != null && message.hasOwnProperty("lossReport")) + object.lossReport = $root.google.protobuf.Struct.toObject(message.lossReport, options); + return object; + }; + + /** + * Converts this OptimizationConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @instance + * @returns {Object.} JSON object + */ + OptimizationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OptimizationConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OptimizationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OptimizationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OptimizationConfig"; + }; + + /** + * OptimizationStatus enum. + * @name google.cloud.ces.v1beta.OptimizationConfig.OptimizationStatus + * @enum {number} + * @property {number} OPTIMIZATION_STATUS_UNSPECIFIED=0 OPTIMIZATION_STATUS_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} COMPLETED=2 COMPLETED value + * @property {number} ERROR=3 ERROR value + */ + OptimizationConfig.OptimizationStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPTIMIZATION_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "COMPLETED"] = 2; + values[valuesById[3] = "ERROR"] = 3; + return values; + })(); + + return OptimizationConfig; + })(); + + v1beta.SessionService = (function() { + + /** + * Constructs a new SessionService service. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a SessionService + * @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 SessionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SessionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SessionService; + + /** + * Creates new SessionService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.ces.v1beta.SessionService + * @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 {SessionService} RPC service. Useful where requests and/or responses are streamed. + */ + SessionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.SessionService|runSession}. + * @memberof google.cloud.ces.v1beta.SessionService + * @typedef RunSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.RunSessionResponse} [response] RunSessionResponse + */ + + /** + * Calls RunSession. + * @function runSession + * @memberof google.cloud.ces.v1beta.SessionService + * @instance + * @param {google.cloud.ces.v1beta.IRunSessionRequest} request RunSessionRequest message or plain object + * @param {google.cloud.ces.v1beta.SessionService.RunSessionCallback} callback Node-style callback called with the error, if any, and RunSessionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionService.prototype.runSession = function runSession(request, callback) { + return this.rpcCall(runSession, $root.google.cloud.ces.v1beta.RunSessionRequest, $root.google.cloud.ces.v1beta.RunSessionResponse, request, callback); + }, "name", { value: "RunSession" }); + + /** + * Calls RunSession. + * @function runSession + * @memberof google.cloud.ces.v1beta.SessionService + * @instance + * @param {google.cloud.ces.v1beta.IRunSessionRequest} request RunSessionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.SessionService|bidiRunSession}. + * @memberof google.cloud.ces.v1beta.SessionService + * @typedef BidiRunSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.BidiSessionServerMessage} [response] BidiSessionServerMessage + */ + + /** + * Calls BidiRunSession. + * @function bidiRunSession + * @memberof google.cloud.ces.v1beta.SessionService + * @instance + * @param {google.cloud.ces.v1beta.IBidiSessionClientMessage} request BidiSessionClientMessage message or plain object + * @param {google.cloud.ces.v1beta.SessionService.BidiRunSessionCallback} callback Node-style callback called with the error, if any, and BidiSessionServerMessage + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionService.prototype.bidiRunSession = function bidiRunSession(request, callback) { + return this.rpcCall(bidiRunSession, $root.google.cloud.ces.v1beta.BidiSessionClientMessage, $root.google.cloud.ces.v1beta.BidiSessionServerMessage, request, callback); + }, "name", { value: "BidiRunSession" }); + + /** + * Calls BidiRunSession. + * @function bidiRunSession + * @memberof google.cloud.ces.v1beta.SessionService + * @instance + * @param {google.cloud.ces.v1beta.IBidiSessionClientMessage} request BidiSessionClientMessage message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SessionService; + })(); + + /** + * AudioEncoding enum. + * @name google.cloud.ces.v1beta.AudioEncoding + * @enum {number} + * @property {number} AUDIO_ENCODING_UNSPECIFIED=0 AUDIO_ENCODING_UNSPECIFIED value + * @property {number} LINEAR16=1 LINEAR16 value + * @property {number} MULAW=2 MULAW value + * @property {number} ALAW=3 ALAW value + */ + v1beta.AudioEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUDIO_ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINEAR16"] = 1; + values[valuesById[2] = "MULAW"] = 2; + values[valuesById[3] = "ALAW"] = 3; + return values; + })(); + + v1beta.InputAudioConfig = (function() { + + /** + * Properties of an InputAudioConfig. + * @memberof google.cloud.ces.v1beta + * @interface IInputAudioConfig + * @property {google.cloud.ces.v1beta.AudioEncoding|null} [audioEncoding] InputAudioConfig audioEncoding + * @property {number|null} [sampleRateHertz] InputAudioConfig sampleRateHertz + * @property {string|null} [noiseSuppressionLevel] InputAudioConfig noiseSuppressionLevel + */ + + /** + * Constructs a new InputAudioConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an InputAudioConfig. + * @implements IInputAudioConfig + * @constructor + * @param {google.cloud.ces.v1beta.IInputAudioConfig=} [properties] Properties to set + */ + function InputAudioConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputAudioConfig audioEncoding. + * @member {google.cloud.ces.v1beta.AudioEncoding} audioEncoding + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.audioEncoding = 0; + + /** + * InputAudioConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.sampleRateHertz = 0; + + /** + * InputAudioConfig noiseSuppressionLevel. + * @member {string} noiseSuppressionLevel + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.noiseSuppressionLevel = ""; + + /** + * Creates a new InputAudioConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @static + * @param {google.cloud.ces.v1beta.IInputAudioConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.InputAudioConfig} InputAudioConfig instance + */ + InputAudioConfig.create = function create(properties) { + return new InputAudioConfig(properties); + }; + + /** + * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1beta.InputAudioConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @static + * @param {google.cloud.ces.v1beta.IInputAudioConfig} message InputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputAudioConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); + if (message.noiseSuppressionLevel != null && Object.hasOwnProperty.call(message, "noiseSuppressionLevel")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.noiseSuppressionLevel); + return writer; + }; + + /** + * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.InputAudioConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @static + * @param {google.cloud.ces.v1beta.IInputAudioConfig} message InputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.InputAudioConfig} InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputAudioConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.InputAudioConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audioEncoding = reader.int32(); + break; + } + case 2: { + message.sampleRateHertz = reader.int32(); + break; + } + case 6: { + message.noiseSuppressionLevel = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.InputAudioConfig} InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputAudioConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputAudioConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputAudioConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + switch (message.audioEncoding) { + default: + return "audioEncoding: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) + if (!$util.isString(message.noiseSuppressionLevel)) + return "noiseSuppressionLevel: string expected"; + return null; + }; + + /** + * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.InputAudioConfig} InputAudioConfig + */ + InputAudioConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.InputAudioConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.InputAudioConfig(); + switch (object.audioEncoding) { + default: + if (typeof object.audioEncoding === "number") { + message.audioEncoding = object.audioEncoding; + break; + } + break; + case "AUDIO_ENCODING_UNSPECIFIED": + case 0: + message.audioEncoding = 0; + break; + case "LINEAR16": + case 1: + message.audioEncoding = 1; + break; + case "MULAW": + case 2: + message.audioEncoding = 2; + break; + case "ALAW": + case 3: + message.audioEncoding = 3; + break; + } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + if (object.noiseSuppressionLevel != null) + message.noiseSuppressionLevel = String(object.noiseSuppressionLevel); + return message; + }; + + /** + * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @static + * @param {google.cloud.ces.v1beta.InputAudioConfig} message InputAudioConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputAudioConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.audioEncoding = options.enums === String ? "AUDIO_ENCODING_UNSPECIFIED" : 0; + object.sampleRateHertz = 0; + object.noiseSuppressionLevel = ""; + } + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + object.audioEncoding = options.enums === String ? $root.google.cloud.ces.v1beta.AudioEncoding[message.audioEncoding] === undefined ? message.audioEncoding : $root.google.cloud.ces.v1beta.AudioEncoding[message.audioEncoding] : message.audioEncoding; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + if (message.noiseSuppressionLevel != null && message.hasOwnProperty("noiseSuppressionLevel")) + object.noiseSuppressionLevel = message.noiseSuppressionLevel; + return object; + }; + + /** + * Converts this InputAudioConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @instance + * @returns {Object.} JSON object + */ + InputAudioConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputAudioConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.InputAudioConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputAudioConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.InputAudioConfig"; + }; + + return InputAudioConfig; + })(); + + v1beta.OutputAudioConfig = (function() { + + /** + * Properties of an OutputAudioConfig. + * @memberof google.cloud.ces.v1beta + * @interface IOutputAudioConfig + * @property {google.cloud.ces.v1beta.AudioEncoding|null} [audioEncoding] OutputAudioConfig audioEncoding + * @property {number|null} [sampleRateHertz] OutputAudioConfig sampleRateHertz + */ + + /** + * Constructs a new OutputAudioConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an OutputAudioConfig. + * @implements IOutputAudioConfig + * @constructor + * @param {google.cloud.ces.v1beta.IOutputAudioConfig=} [properties] Properties to set + */ + function OutputAudioConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputAudioConfig audioEncoding. + * @member {google.cloud.ces.v1beta.AudioEncoding} audioEncoding + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @instance + */ + OutputAudioConfig.prototype.audioEncoding = 0; + + /** + * OutputAudioConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @instance + */ + OutputAudioConfig.prototype.sampleRateHertz = 0; + + /** + * Creates a new OutputAudioConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @static + * @param {google.cloud.ces.v1beta.IOutputAudioConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OutputAudioConfig} OutputAudioConfig instance + */ + OutputAudioConfig.create = function create(properties) { + return new OutputAudioConfig(properties); + }; + + /** + * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OutputAudioConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @static + * @param {google.cloud.ces.v1beta.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudioConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); + return writer; + }; + + /** + * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OutputAudioConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @static + * @param {google.cloud.ces.v1beta.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OutputAudioConfig} OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudioConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OutputAudioConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audioEncoding = reader.int32(); + break; + } + case 2: { + message.sampleRateHertz = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OutputAudioConfig} OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudioConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputAudioConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputAudioConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + switch (message.audioEncoding) { + default: + return "audioEncoding: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + return null; + }; + + /** + * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OutputAudioConfig} OutputAudioConfig + */ + OutputAudioConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OutputAudioConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.OutputAudioConfig(); + switch (object.audioEncoding) { + default: + if (typeof object.audioEncoding === "number") { + message.audioEncoding = object.audioEncoding; + break; + } + break; + case "AUDIO_ENCODING_UNSPECIFIED": + case 0: + message.audioEncoding = 0; + break; + case "LINEAR16": + case 1: + message.audioEncoding = 1; + break; + case "MULAW": + case 2: + message.audioEncoding = 2; + break; + case "ALAW": + case 3: + message.audioEncoding = 3; + break; + } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + return message; + }; + + /** + * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @static + * @param {google.cloud.ces.v1beta.OutputAudioConfig} message OutputAudioConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputAudioConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.audioEncoding = options.enums === String ? "AUDIO_ENCODING_UNSPECIFIED" : 0; + object.sampleRateHertz = 0; + } + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + object.audioEncoding = options.enums === String ? $root.google.cloud.ces.v1beta.AudioEncoding[message.audioEncoding] === undefined ? message.audioEncoding : $root.google.cloud.ces.v1beta.AudioEncoding[message.audioEncoding] : message.audioEncoding; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + return object; + }; + + /** + * Converts this OutputAudioConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @instance + * @returns {Object.} JSON object + */ + OutputAudioConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputAudioConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OutputAudioConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputAudioConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OutputAudioConfig"; + }; + + return OutputAudioConfig; + })(); + + v1beta.SessionConfig = (function() { + + /** + * Properties of a SessionConfig. + * @memberof google.cloud.ces.v1beta + * @interface ISessionConfig + * @property {string|null} [session] SessionConfig session + * @property {google.cloud.ces.v1beta.IInputAudioConfig|null} [inputAudioConfig] SessionConfig inputAudioConfig + * @property {google.cloud.ces.v1beta.IOutputAudioConfig|null} [outputAudioConfig] SessionConfig outputAudioConfig + * @property {Array.|null} [historicalContexts] SessionConfig historicalContexts + * @property {string|null} [entryAgent] SessionConfig entryAgent + * @property {string|null} [deployment] SessionConfig deployment + * @property {string|null} [timeZone] SessionConfig timeZone + * @property {google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters|null} [remoteDialogflowQueryParameters] SessionConfig remoteDialogflowQueryParameters + */ + + /** + * Constructs a new SessionConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a SessionConfig. + * @implements ISessionConfig + * @constructor + * @param {google.cloud.ces.v1beta.ISessionConfig=} [properties] Properties to set + */ + function SessionConfig(properties) { + this.historicalContexts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionConfig session. + * @member {string} session + * @memberof google.cloud.ces.v1beta.SessionConfig + * @instance + */ + SessionConfig.prototype.session = ""; + + /** + * SessionConfig inputAudioConfig. + * @member {google.cloud.ces.v1beta.IInputAudioConfig|null|undefined} inputAudioConfig + * @memberof google.cloud.ces.v1beta.SessionConfig + * @instance + */ + SessionConfig.prototype.inputAudioConfig = null; + + /** + * SessionConfig outputAudioConfig. + * @member {google.cloud.ces.v1beta.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.ces.v1beta.SessionConfig + * @instance + */ + SessionConfig.prototype.outputAudioConfig = null; + + /** + * SessionConfig historicalContexts. + * @member {Array.} historicalContexts + * @memberof google.cloud.ces.v1beta.SessionConfig + * @instance + */ + SessionConfig.prototype.historicalContexts = $util.emptyArray; + + /** + * SessionConfig entryAgent. + * @member {string} entryAgent + * @memberof google.cloud.ces.v1beta.SessionConfig + * @instance + */ + SessionConfig.prototype.entryAgent = ""; + + /** + * SessionConfig deployment. + * @member {string} deployment + * @memberof google.cloud.ces.v1beta.SessionConfig + * @instance + */ + SessionConfig.prototype.deployment = ""; + + /** + * SessionConfig timeZone. + * @member {string} timeZone + * @memberof google.cloud.ces.v1beta.SessionConfig + * @instance + */ + SessionConfig.prototype.timeZone = ""; + + /** + * SessionConfig remoteDialogflowQueryParameters. + * @member {google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters|null|undefined} remoteDialogflowQueryParameters + * @memberof google.cloud.ces.v1beta.SessionConfig + * @instance + */ + SessionConfig.prototype.remoteDialogflowQueryParameters = null; + + /** + * Creates a new SessionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.SessionConfig + * @static + * @param {google.cloud.ces.v1beta.ISessionConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.SessionConfig} SessionConfig instance + */ + SessionConfig.create = function create(properties) { + return new SessionConfig(properties); + }; + + /** + * Encodes the specified SessionConfig message. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.SessionConfig + * @static + * @param {google.cloud.ces.v1beta.ISessionConfig} message SessionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.inputAudioConfig != null && Object.hasOwnProperty.call(message, "inputAudioConfig")) + $root.google.cloud.ces.v1beta.InputAudioConfig.encode(message.inputAudioConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.ces.v1beta.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.historicalContexts != null && message.historicalContexts.length) + for (var i = 0; i < message.historicalContexts.length; ++i) + $root.google.cloud.ces.v1beta.Message.encode(message.historicalContexts[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.deployment); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.timeZone); + if (message.entryAgent != null && Object.hasOwnProperty.call(message, "entryAgent")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.entryAgent); + if (message.remoteDialogflowQueryParameters != null && Object.hasOwnProperty.call(message, "remoteDialogflowQueryParameters")) + $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.encode(message.remoteDialogflowQueryParameters, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SessionConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.SessionConfig + * @static + * @param {google.cloud.ces.v1beta.ISessionConfig} message SessionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.SessionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.SessionConfig} SessionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SessionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.inputAudioConfig = $root.google.cloud.ces.v1beta.InputAudioConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.outputAudioConfig = $root.google.cloud.ces.v1beta.OutputAudioConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.historicalContexts && message.historicalContexts.length)) + message.historicalContexts = []; + message.historicalContexts.push($root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32())); + break; + } + case 12: { + message.entryAgent = reader.string(); + break; + } + case 8: { + message.deployment = reader.string(); + break; + } + case 11: { + message.timeZone = reader.string(); + break; + } + case 15: { + message.remoteDialogflowQueryParameters = $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.SessionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.SessionConfig} SessionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.SessionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.inputAudioConfig != null && message.hasOwnProperty("inputAudioConfig")) { + var error = $root.google.cloud.ces.v1beta.InputAudioConfig.verify(message.inputAudioConfig); + if (error) + return "inputAudioConfig." + error; + } + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.ces.v1beta.OutputAudioConfig.verify(message.outputAudioConfig); + if (error) + return "outputAudioConfig." + error; + } + if (message.historicalContexts != null && message.hasOwnProperty("historicalContexts")) { + if (!Array.isArray(message.historicalContexts)) + return "historicalContexts: array expected"; + for (var i = 0; i < message.historicalContexts.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Message.verify(message.historicalContexts[i]); + if (error) + return "historicalContexts." + error; + } + } + if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) + if (!$util.isString(message.entryAgent)) + return "entryAgent: string expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) + if (!$util.isString(message.deployment)) + return "deployment: string expected"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.remoteDialogflowQueryParameters != null && message.hasOwnProperty("remoteDialogflowQueryParameters")) { + var error = $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.verify(message.remoteDialogflowQueryParameters); + if (error) + return "remoteDialogflowQueryParameters." + error; + } + return null; + }; + + /** + * Creates a SessionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.SessionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.SessionConfig} SessionConfig + */ + SessionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.SessionConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.SessionConfig(); + if (object.session != null) + message.session = String(object.session); + if (object.inputAudioConfig != null) { + if (typeof object.inputAudioConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionConfig.inputAudioConfig: object expected"); + message.inputAudioConfig = $root.google.cloud.ces.v1beta.InputAudioConfig.fromObject(object.inputAudioConfig); + } + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionConfig.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.ces.v1beta.OutputAudioConfig.fromObject(object.outputAudioConfig); + } + if (object.historicalContexts) { + if (!Array.isArray(object.historicalContexts)) + throw TypeError(".google.cloud.ces.v1beta.SessionConfig.historicalContexts: array expected"); + message.historicalContexts = []; + for (var i = 0; i < object.historicalContexts.length; ++i) { + if (typeof object.historicalContexts[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionConfig.historicalContexts: object expected"); + message.historicalContexts[i] = $root.google.cloud.ces.v1beta.Message.fromObject(object.historicalContexts[i]); + } + } + if (object.entryAgent != null) + message.entryAgent = String(object.entryAgent); + if (object.deployment != null) + message.deployment = String(object.deployment); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.remoteDialogflowQueryParameters != null) { + if (typeof object.remoteDialogflowQueryParameters !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionConfig.remoteDialogflowQueryParameters: object expected"); + message.remoteDialogflowQueryParameters = $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.fromObject(object.remoteDialogflowQueryParameters); + } + return message; + }; + + /** + * Creates a plain object from a SessionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.SessionConfig + * @static + * @param {google.cloud.ces.v1beta.SessionConfig} message SessionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.historicalContexts = []; + if (options.defaults) { + object.session = ""; + object.inputAudioConfig = null; + object.outputAudioConfig = null; + object.deployment = ""; + object.timeZone = ""; + object.entryAgent = ""; + object.remoteDialogflowQueryParameters = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.inputAudioConfig != null && message.hasOwnProperty("inputAudioConfig")) + object.inputAudioConfig = $root.google.cloud.ces.v1beta.InputAudioConfig.toObject(message.inputAudioConfig, options); + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.ces.v1beta.OutputAudioConfig.toObject(message.outputAudioConfig, options); + if (message.historicalContexts && message.historicalContexts.length) { + object.historicalContexts = []; + for (var j = 0; j < message.historicalContexts.length; ++j) + object.historicalContexts[j] = $root.google.cloud.ces.v1beta.Message.toObject(message.historicalContexts[j], options); + } + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = message.deployment; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.entryAgent != null && message.hasOwnProperty("entryAgent")) + object.entryAgent = message.entryAgent; + if (message.remoteDialogflowQueryParameters != null && message.hasOwnProperty("remoteDialogflowQueryParameters")) + object.remoteDialogflowQueryParameters = $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.toObject(message.remoteDialogflowQueryParameters, options); + return object; + }; + + /** + * Converts this SessionConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.SessionConfig + * @instance + * @returns {Object.} JSON object + */ + SessionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.SessionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.SessionConfig"; + }; + + SessionConfig.RemoteDialogflowQueryParameters = (function() { + + /** + * Properties of a RemoteDialogflowQueryParameters. + * @memberof google.cloud.ces.v1beta.SessionConfig + * @interface IRemoteDialogflowQueryParameters + * @property {Object.|null} [webhookHeaders] RemoteDialogflowQueryParameters webhookHeaders + * @property {google.protobuf.IStruct|null} [payload] RemoteDialogflowQueryParameters payload + * @property {google.protobuf.IStruct|null} [endUserMetadata] RemoteDialogflowQueryParameters endUserMetadata + */ + + /** + * Constructs a new RemoteDialogflowQueryParameters. + * @memberof google.cloud.ces.v1beta.SessionConfig + * @classdesc Represents a RemoteDialogflowQueryParameters. + * @implements IRemoteDialogflowQueryParameters + * @constructor + * @param {google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters=} [properties] Properties to set + */ + function RemoteDialogflowQueryParameters(properties) { + this.webhookHeaders = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoteDialogflowQueryParameters webhookHeaders. + * @member {Object.} webhookHeaders + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @instance + */ + RemoteDialogflowQueryParameters.prototype.webhookHeaders = $util.emptyObject; + + /** + * RemoteDialogflowQueryParameters payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @instance + */ + RemoteDialogflowQueryParameters.prototype.payload = null; + + /** + * RemoteDialogflowQueryParameters endUserMetadata. + * @member {google.protobuf.IStruct|null|undefined} endUserMetadata + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @instance + */ + RemoteDialogflowQueryParameters.prototype.endUserMetadata = null; + + /** + * Creates a new RemoteDialogflowQueryParameters instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters instance + */ + RemoteDialogflowQueryParameters.create = function create(properties) { + return new RemoteDialogflowQueryParameters(properties); + }; + + /** + * Encodes the specified RemoteDialogflowQueryParameters message. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters} message RemoteDialogflowQueryParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoteDialogflowQueryParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.webhookHeaders != null && Object.hasOwnProperty.call(message, "webhookHeaders")) + for (var keys = Object.keys(message.webhookHeaders), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.webhookHeaders[keys[i]]).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endUserMetadata != null && Object.hasOwnProperty.call(message, "endUserMetadata")) + $root.google.protobuf.Struct.encode(message.endUserMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RemoteDialogflowQueryParameters message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {google.cloud.ces.v1beta.SessionConfig.IRemoteDialogflowQueryParameters} message RemoteDialogflowQueryParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoteDialogflowQueryParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoteDialogflowQueryParameters.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.webhookHeaders === $util.emptyObject) + message.webhookHeaders = {}; + 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.webhookHeaders[key] = value; + break; + } + case 2: { + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endUserMetadata = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoteDialogflowQueryParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoteDialogflowQueryParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoteDialogflowQueryParameters message. + * @function verify + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoteDialogflowQueryParameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.webhookHeaders != null && message.hasOwnProperty("webhookHeaders")) { + if (!$util.isObject(message.webhookHeaders)) + return "webhookHeaders: object expected"; + var key = Object.keys(message.webhookHeaders); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.webhookHeaders[key[i]])) + return "webhookHeaders: string{k:string} expected"; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.protobuf.Struct.verify(message.payload); + if (error) + return "payload." + error; + } + if (message.endUserMetadata != null && message.hasOwnProperty("endUserMetadata")) { + var error = $root.google.protobuf.Struct.verify(message.endUserMetadata); + if (error) + return "endUserMetadata." + error; + } + return null; + }; + + /** + * Creates a RemoteDialogflowQueryParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters} RemoteDialogflowQueryParameters + */ + RemoteDialogflowQueryParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters) + return object; + var message = new $root.google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters(); + if (object.webhookHeaders) { + if (typeof object.webhookHeaders !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.webhookHeaders: object expected"); + message.webhookHeaders = {}; + for (var keys = Object.keys(object.webhookHeaders), i = 0; i < keys.length; ++i) + message.webhookHeaders[keys[i]] = String(object.webhookHeaders[keys[i]]); + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload); + } + if (object.endUserMetadata != null) { + if (typeof object.endUserMetadata !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters.endUserMetadata: object expected"); + message.endUserMetadata = $root.google.protobuf.Struct.fromObject(object.endUserMetadata); + } + return message; + }; + + /** + * Creates a plain object from a RemoteDialogflowQueryParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters} message RemoteDialogflowQueryParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoteDialogflowQueryParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.webhookHeaders = {}; + if (options.defaults) { + object.payload = null; + object.endUserMetadata = null; + } + var keys2; + if (message.webhookHeaders && (keys2 = Object.keys(message.webhookHeaders)).length) { + object.webhookHeaders = {}; + for (var j = 0; j < keys2.length; ++j) + object.webhookHeaders[keys2[j]] = message.webhookHeaders[keys2[j]]; + } + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (message.endUserMetadata != null && message.hasOwnProperty("endUserMetadata")) + object.endUserMetadata = $root.google.protobuf.Struct.toObject(message.endUserMetadata, options); + return object; + }; + + /** + * Converts this RemoteDialogflowQueryParameters to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @instance + * @returns {Object.} JSON object + */ + RemoteDialogflowQueryParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemoteDialogflowQueryParameters + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoteDialogflowQueryParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.SessionConfig.RemoteDialogflowQueryParameters"; + }; + + return RemoteDialogflowQueryParameters; + })(); + + return SessionConfig; + })(); + + v1beta.ToolCalls = (function() { + + /** + * Properties of a ToolCalls. + * @memberof google.cloud.ces.v1beta + * @interface IToolCalls + * @property {Array.|null} [toolCalls] ToolCalls toolCalls + */ + + /** + * Constructs a new ToolCalls. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ToolCalls. + * @implements IToolCalls + * @constructor + * @param {google.cloud.ces.v1beta.IToolCalls=} [properties] Properties to set + */ + function ToolCalls(properties) { + this.toolCalls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolCalls toolCalls. + * @member {Array.} toolCalls + * @memberof google.cloud.ces.v1beta.ToolCalls + * @instance + */ + ToolCalls.prototype.toolCalls = $util.emptyArray; + + /** + * Creates a new ToolCalls instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ToolCalls + * @static + * @param {google.cloud.ces.v1beta.IToolCalls=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ToolCalls} ToolCalls instance + */ + ToolCalls.create = function create(properties) { + return new ToolCalls(properties); + }; + + /** + * Encodes the specified ToolCalls message. Does not implicitly {@link google.cloud.ces.v1beta.ToolCalls.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ToolCalls + * @static + * @param {google.cloud.ces.v1beta.IToolCalls} message ToolCalls message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCalls.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolCalls != null && message.toolCalls.length) + for (var i = 0; i < message.toolCalls.length; ++i) + $root.google.cloud.ces.v1beta.ToolCall.encode(message.toolCalls[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolCalls message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolCalls.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ToolCalls + * @static + * @param {google.cloud.ces.v1beta.IToolCalls} message ToolCalls message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCalls.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolCalls message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ToolCalls + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ToolCalls} ToolCalls + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCalls.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ToolCalls(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.toolCalls && message.toolCalls.length)) + message.toolCalls = []; + message.toolCalls.push($root.google.cloud.ces.v1beta.ToolCall.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolCalls message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ToolCalls + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ToolCalls} ToolCalls + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCalls.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolCalls message. + * @function verify + * @memberof google.cloud.ces.v1beta.ToolCalls + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolCalls.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolCalls != null && message.hasOwnProperty("toolCalls")) { + if (!Array.isArray(message.toolCalls)) + return "toolCalls: array expected"; + for (var i = 0; i < message.toolCalls.length; ++i) { + var error = $root.google.cloud.ces.v1beta.ToolCall.verify(message.toolCalls[i]); + if (error) + return "toolCalls." + error; + } + } + return null; + }; + + /** + * Creates a ToolCalls message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ToolCalls + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ToolCalls} ToolCalls + */ + ToolCalls.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ToolCalls) + return object; + var message = new $root.google.cloud.ces.v1beta.ToolCalls(); + if (object.toolCalls) { + if (!Array.isArray(object.toolCalls)) + throw TypeError(".google.cloud.ces.v1beta.ToolCalls.toolCalls: array expected"); + message.toolCalls = []; + for (var i = 0; i < object.toolCalls.length; ++i) { + if (typeof object.toolCalls[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ToolCalls.toolCalls: object expected"); + message.toolCalls[i] = $root.google.cloud.ces.v1beta.ToolCall.fromObject(object.toolCalls[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ToolCalls message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ToolCalls + * @static + * @param {google.cloud.ces.v1beta.ToolCalls} message ToolCalls + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolCalls.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.toolCalls = []; + if (message.toolCalls && message.toolCalls.length) { + object.toolCalls = []; + for (var j = 0; j < message.toolCalls.length; ++j) + object.toolCalls[j] = $root.google.cloud.ces.v1beta.ToolCall.toObject(message.toolCalls[j], options); + } + return object; + }; + + /** + * Converts this ToolCalls to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ToolCalls + * @instance + * @returns {Object.} JSON object + */ + ToolCalls.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolCalls + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ToolCalls + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolCalls.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ToolCalls"; + }; + + return ToolCalls; + })(); + + v1beta.ToolResponses = (function() { + + /** + * Properties of a ToolResponses. + * @memberof google.cloud.ces.v1beta + * @interface IToolResponses + * @property {Array.|null} [toolResponses] ToolResponses toolResponses + */ + + /** + * Constructs a new ToolResponses. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ToolResponses. + * @implements IToolResponses + * @constructor + * @param {google.cloud.ces.v1beta.IToolResponses=} [properties] Properties to set + */ + function ToolResponses(properties) { + this.toolResponses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolResponses toolResponses. + * @member {Array.} toolResponses + * @memberof google.cloud.ces.v1beta.ToolResponses + * @instance + */ + ToolResponses.prototype.toolResponses = $util.emptyArray; + + /** + * Creates a new ToolResponses instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ToolResponses + * @static + * @param {google.cloud.ces.v1beta.IToolResponses=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ToolResponses} ToolResponses instance + */ + ToolResponses.create = function create(properties) { + return new ToolResponses(properties); + }; + + /** + * Encodes the specified ToolResponses message. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponses.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ToolResponses + * @static + * @param {google.cloud.ces.v1beta.IToolResponses} message ToolResponses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolResponses.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolResponses != null && message.toolResponses.length) + for (var i = 0; i < message.toolResponses.length; ++i) + $root.google.cloud.ces.v1beta.ToolResponse.encode(message.toolResponses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolResponses message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ToolResponses.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ToolResponses + * @static + * @param {google.cloud.ces.v1beta.IToolResponses} message ToolResponses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolResponses.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolResponses message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ToolResponses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ToolResponses} ToolResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolResponses.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ToolResponses(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.toolResponses && message.toolResponses.length)) + message.toolResponses = []; + message.toolResponses.push($root.google.cloud.ces.v1beta.ToolResponse.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolResponses message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ToolResponses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ToolResponses} ToolResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolResponses.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolResponses message. + * @function verify + * @memberof google.cloud.ces.v1beta.ToolResponses + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolResponses.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolResponses != null && message.hasOwnProperty("toolResponses")) { + if (!Array.isArray(message.toolResponses)) + return "toolResponses: array expected"; + for (var i = 0; i < message.toolResponses.length; ++i) { + var error = $root.google.cloud.ces.v1beta.ToolResponse.verify(message.toolResponses[i]); + if (error) + return "toolResponses." + error; + } + } + return null; + }; + + /** + * Creates a ToolResponses message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ToolResponses + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ToolResponses} ToolResponses + */ + ToolResponses.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ToolResponses) + return object; + var message = new $root.google.cloud.ces.v1beta.ToolResponses(); + if (object.toolResponses) { + if (!Array.isArray(object.toolResponses)) + throw TypeError(".google.cloud.ces.v1beta.ToolResponses.toolResponses: array expected"); + message.toolResponses = []; + for (var i = 0; i < object.toolResponses.length; ++i) { + if (typeof object.toolResponses[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ToolResponses.toolResponses: object expected"); + message.toolResponses[i] = $root.google.cloud.ces.v1beta.ToolResponse.fromObject(object.toolResponses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ToolResponses message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ToolResponses + * @static + * @param {google.cloud.ces.v1beta.ToolResponses} message ToolResponses + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolResponses.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.toolResponses = []; + if (message.toolResponses && message.toolResponses.length) { + object.toolResponses = []; + for (var j = 0; j < message.toolResponses.length; ++j) + object.toolResponses[j] = $root.google.cloud.ces.v1beta.ToolResponse.toObject(message.toolResponses[j], options); + } + return object; + }; + + /** + * Converts this ToolResponses to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ToolResponses + * @instance + * @returns {Object.} JSON object + */ + ToolResponses.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolResponses + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ToolResponses + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolResponses.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ToolResponses"; + }; + + return ToolResponses; + })(); + + v1beta.Citations = (function() { + + /** + * Properties of a Citations. + * @memberof google.cloud.ces.v1beta + * @interface ICitations + * @property {Array.|null} [citedChunks] Citations citedChunks + */ + + /** + * Constructs a new Citations. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a Citations. + * @implements ICitations + * @constructor + * @param {google.cloud.ces.v1beta.ICitations=} [properties] Properties to set + */ + function Citations(properties) { + this.citedChunks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Citations citedChunks. + * @member {Array.} citedChunks + * @memberof google.cloud.ces.v1beta.Citations + * @instance + */ + Citations.prototype.citedChunks = $util.emptyArray; + + /** + * Creates a new Citations instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Citations + * @static + * @param {google.cloud.ces.v1beta.ICitations=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Citations} Citations instance + */ + Citations.create = function create(properties) { + return new Citations(properties); + }; + + /** + * Encodes the specified Citations message. Does not implicitly {@link google.cloud.ces.v1beta.Citations.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Citations + * @static + * @param {google.cloud.ces.v1beta.ICitations} message Citations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Citations.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.citedChunks != null && message.citedChunks.length) + for (var i = 0; i < message.citedChunks.length; ++i) + $root.google.cloud.ces.v1beta.Citations.CitedChunk.encode(message.citedChunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Citations message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Citations.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Citations + * @static + * @param {google.cloud.ces.v1beta.ICitations} message Citations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Citations.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Citations message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Citations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Citations} Citations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Citations.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Citations(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.citedChunks && message.citedChunks.length)) + message.citedChunks = []; + message.citedChunks.push($root.google.cloud.ces.v1beta.Citations.CitedChunk.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Citations message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Citations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Citations} Citations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Citations.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Citations message. + * @function verify + * @memberof google.cloud.ces.v1beta.Citations + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Citations.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.citedChunks != null && message.hasOwnProperty("citedChunks")) { + if (!Array.isArray(message.citedChunks)) + return "citedChunks: array expected"; + for (var i = 0; i < message.citedChunks.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Citations.CitedChunk.verify(message.citedChunks[i]); + if (error) + return "citedChunks." + error; + } + } + return null; + }; + + /** + * Creates a Citations message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Citations + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Citations} Citations + */ + Citations.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Citations) + return object; + var message = new $root.google.cloud.ces.v1beta.Citations(); + if (object.citedChunks) { + if (!Array.isArray(object.citedChunks)) + throw TypeError(".google.cloud.ces.v1beta.Citations.citedChunks: array expected"); + message.citedChunks = []; + for (var i = 0; i < object.citedChunks.length; ++i) { + if (typeof object.citedChunks[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.Citations.citedChunks: object expected"); + message.citedChunks[i] = $root.google.cloud.ces.v1beta.Citations.CitedChunk.fromObject(object.citedChunks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Citations message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Citations + * @static + * @param {google.cloud.ces.v1beta.Citations} message Citations + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Citations.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.citedChunks = []; + if (message.citedChunks && message.citedChunks.length) { + object.citedChunks = []; + for (var j = 0; j < message.citedChunks.length; ++j) + object.citedChunks[j] = $root.google.cloud.ces.v1beta.Citations.CitedChunk.toObject(message.citedChunks[j], options); + } + return object; + }; + + /** + * Converts this Citations to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Citations + * @instance + * @returns {Object.} JSON object + */ + Citations.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Citations + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Citations + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Citations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Citations"; + }; + + Citations.CitedChunk = (function() { + + /** + * Properties of a CitedChunk. + * @memberof google.cloud.ces.v1beta.Citations + * @interface ICitedChunk + * @property {string|null} [uri] CitedChunk uri + * @property {string|null} [title] CitedChunk title + * @property {string|null} [text] CitedChunk text + */ + + /** + * Constructs a new CitedChunk. + * @memberof google.cloud.ces.v1beta.Citations + * @classdesc Represents a CitedChunk. + * @implements ICitedChunk + * @constructor + * @param {google.cloud.ces.v1beta.Citations.ICitedChunk=} [properties] Properties to set + */ + function CitedChunk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CitedChunk uri. + * @member {string} uri + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @instance + */ + CitedChunk.prototype.uri = ""; + + /** + * CitedChunk title. + * @member {string} title + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @instance + */ + CitedChunk.prototype.title = ""; + + /** + * CitedChunk text. + * @member {string} text + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @instance + */ + CitedChunk.prototype.text = ""; + + /** + * Creates a new CitedChunk instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @static + * @param {google.cloud.ces.v1beta.Citations.ICitedChunk=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Citations.CitedChunk} CitedChunk instance + */ + CitedChunk.create = function create(properties) { + return new CitedChunk(properties); + }; + + /** + * Encodes the specified CitedChunk message. Does not implicitly {@link google.cloud.ces.v1beta.Citations.CitedChunk.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @static + * @param {google.cloud.ces.v1beta.Citations.ICitedChunk} message CitedChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CitedChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.text); + return writer; + }; + + /** + * Encodes the specified CitedChunk message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Citations.CitedChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @static + * @param {google.cloud.ces.v1beta.Citations.ICitedChunk} message CitedChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CitedChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CitedChunk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Citations.CitedChunk} CitedChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CitedChunk.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Citations.CitedChunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CitedChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Citations.CitedChunk} CitedChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CitedChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CitedChunk message. + * @function verify + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CitedChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a CitedChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Citations.CitedChunk} CitedChunk + */ + CitedChunk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Citations.CitedChunk) + return object; + var message = new $root.google.cloud.ces.v1beta.Citations.CitedChunk(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.title != null) + message.title = String(object.title); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a CitedChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @static + * @param {google.cloud.ces.v1beta.Citations.CitedChunk} message CitedChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CitedChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.uri = ""; + object.title = ""; + object.text = ""; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this CitedChunk to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @instance + * @returns {Object.} JSON object + */ + CitedChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CitedChunk + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Citations.CitedChunk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CitedChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Citations.CitedChunk"; + }; + + return CitedChunk; + })(); + + return Citations; + })(); + + v1beta.Event = (function() { + + /** + * Properties of an Event. + * @memberof google.cloud.ces.v1beta + * @interface IEvent + * @property {string|null} [event] Event event + */ + + /** + * Constructs a new Event. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an Event. + * @implements IEvent + * @constructor + * @param {google.cloud.ces.v1beta.IEvent=} [properties] Properties to set + */ + function Event(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Event event. + * @member {string} event + * @memberof google.cloud.ces.v1beta.Event + * @instance + */ + Event.prototype.event = ""; + + /** + * Creates a new Event instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Event + * @static + * @param {google.cloud.ces.v1beta.IEvent=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Event} Event instance + */ + Event.create = function create(properties) { + return new Event(properties); + }; + + /** + * Encodes the specified Event message. Does not implicitly {@link google.cloud.ces.v1beta.Event.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Event + * @static + * @param {google.cloud.ces.v1beta.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.event); + return writer; + }; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Event.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Event + * @static + * @param {google.cloud.ces.v1beta.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Event message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Event(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.event = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Event message. + * @function verify + * @memberof google.cloud.ces.v1beta.Event + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Event.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.event != null && message.hasOwnProperty("event")) + if (!$util.isString(message.event)) + return "event: string expected"; + return null; + }; + + /** + * Creates an Event message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Event + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Event} Event + */ + Event.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Event) + return object; + var message = new $root.google.cloud.ces.v1beta.Event(); + if (object.event != null) + message.event = String(object.event); + return message; + }; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Event + * @static + * @param {google.cloud.ces.v1beta.Event} message Event + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Event.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.event = ""; + if (message.event != null && message.hasOwnProperty("event")) + object.event = message.event; + return object; + }; + + /** + * Converts this Event to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Event + * @instance + * @returns {Object.} JSON object + */ + Event.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Event + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Event + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Event.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Event"; + }; + + return Event; + })(); + + v1beta.SessionInput = (function() { + + /** + * Properties of a SessionInput. + * @memberof google.cloud.ces.v1beta + * @interface ISessionInput + * @property {string|null} [text] SessionInput text + * @property {string|null} [dtmf] SessionInput dtmf + * @property {Uint8Array|null} [audio] SessionInput audio + * @property {google.cloud.ces.v1beta.IToolResponses|null} [toolResponses] SessionInput toolResponses + * @property {google.cloud.ces.v1beta.IImage|null} [image] SessionInput image + * @property {google.cloud.ces.v1beta.IBlob|null} [blob] SessionInput blob + * @property {google.protobuf.IStruct|null} [variables] SessionInput variables + * @property {google.cloud.ces.v1beta.IEvent|null} [event] SessionInput event + * @property {boolean|null} [willContinue] SessionInput willContinue + */ + + /** + * Constructs a new SessionInput. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a SessionInput. + * @implements ISessionInput + * @constructor + * @param {google.cloud.ces.v1beta.ISessionInput=} [properties] Properties to set + */ + function SessionInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionInput text. + * @member {string|null|undefined} text + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + SessionInput.prototype.text = null; + + /** + * SessionInput dtmf. + * @member {string|null|undefined} dtmf + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + SessionInput.prototype.dtmf = null; + + /** + * SessionInput audio. + * @member {Uint8Array|null|undefined} audio + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + SessionInput.prototype.audio = null; + + /** + * SessionInput toolResponses. + * @member {google.cloud.ces.v1beta.IToolResponses|null|undefined} toolResponses + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + SessionInput.prototype.toolResponses = null; + + /** + * SessionInput image. + * @member {google.cloud.ces.v1beta.IImage|null|undefined} image + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + SessionInput.prototype.image = null; + + /** + * SessionInput blob. + * @member {google.cloud.ces.v1beta.IBlob|null|undefined} blob + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + SessionInput.prototype.blob = null; + + /** + * SessionInput variables. + * @member {google.protobuf.IStruct|null|undefined} variables + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + SessionInput.prototype.variables = null; + + /** + * SessionInput event. + * @member {google.cloud.ces.v1beta.IEvent|null|undefined} event + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + SessionInput.prototype.event = null; + + /** + * SessionInput willContinue. + * @member {boolean} willContinue + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + SessionInput.prototype.willContinue = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SessionInput inputType. + * @member {"text"|"dtmf"|"audio"|"toolResponses"|"image"|"blob"|"variables"|"event"|undefined} inputType + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + */ + Object.defineProperty(SessionInput.prototype, "inputType", { + get: $util.oneOfGetter($oneOfFields = ["text", "dtmf", "audio", "toolResponses", "image", "blob", "variables", "event"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SessionInput instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.SessionInput + * @static + * @param {google.cloud.ces.v1beta.ISessionInput=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.SessionInput} SessionInput instance + */ + SessionInput.create = function create(properties) { + return new SessionInput(properties); + }; + + /** + * Encodes the specified SessionInput message. Does not implicitly {@link google.cloud.ces.v1beta.SessionInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.SessionInput + * @static + * @param {google.cloud.ces.v1beta.ISessionInput} message SessionInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audio); + if (message.toolResponses != null && Object.hasOwnProperty.call(message, "toolResponses")) + $root.google.cloud.ces.v1beta.ToolResponses.encode(message.toolResponses, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.ces.v1beta.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) + $root.google.protobuf.Struct.encode(message.variables, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.dtmf != null && Object.hasOwnProperty.call(message, "dtmf")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.dtmf); + if (message.blob != null && Object.hasOwnProperty.call(message, "blob")) + $root.google.cloud.ces.v1beta.Blob.encode(message.blob, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.willContinue != null && Object.hasOwnProperty.call(message, "willContinue")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.willContinue); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + $root.google.cloud.ces.v1beta.Event.encode(message.event, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SessionInput message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.SessionInput + * @static + * @param {google.cloud.ces.v1beta.ISessionInput} message SessionInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.SessionInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.SessionInput} SessionInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionInput.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SessionInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 6: { + message.dtmf = reader.string(); + break; + } + case 2: { + message.audio = reader.bytes(); + break; + } + case 3: { + message.toolResponses = $root.google.cloud.ces.v1beta.ToolResponses.decode(reader, reader.uint32()); + break; + } + case 4: { + message.image = $root.google.cloud.ces.v1beta.Image.decode(reader, reader.uint32()); + break; + } + case 7: { + message.blob = $root.google.cloud.ces.v1beta.Blob.decode(reader, reader.uint32()); + break; + } + case 5: { + message.variables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 9: { + message.event = $root.google.cloud.ces.v1beta.Event.decode(reader, reader.uint32()); + break; + } + case 8: { + message.willContinue = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.SessionInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.SessionInput} SessionInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionInput message. + * @function verify + * @memberof google.cloud.ces.v1beta.SessionInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionInput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.inputType = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.dtmf != null && message.hasOwnProperty("dtmf")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + if (!$util.isString(message.dtmf)) + return "dtmf: string expected"; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; + } + if (message.toolResponses != null && message.hasOwnProperty("toolResponses")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolResponses.verify(message.toolResponses); + if (error) + return "toolResponses." + error; + } + } + if (message.image != null && message.hasOwnProperty("image")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + { + var error = $root.google.cloud.ces.v1beta.Image.verify(message.image); + if (error) + return "image." + error; + } + } + if (message.blob != null && message.hasOwnProperty("blob")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + { + var error = $root.google.cloud.ces.v1beta.Blob.verify(message.blob); + if (error) + return "blob." + error; + } + } + if (message.variables != null && message.hasOwnProperty("variables")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + { + var error = $root.google.protobuf.Struct.verify(message.variables); + if (error) + return "variables." + error; + } + } + if (message.event != null && message.hasOwnProperty("event")) { + if (properties.inputType === 1) + return "inputType: multiple values"; + properties.inputType = 1; + { + var error = $root.google.cloud.ces.v1beta.Event.verify(message.event); + if (error) + return "event." + error; + } + } + if (message.willContinue != null && message.hasOwnProperty("willContinue")) + if (typeof message.willContinue !== "boolean") + return "willContinue: boolean expected"; + return null; + }; + + /** + * Creates a SessionInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.SessionInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.SessionInput} SessionInput + */ + SessionInput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.SessionInput) + return object; + var message = new $root.google.cloud.ces.v1beta.SessionInput(); + if (object.text != null) + message.text = String(object.text); + if (object.dtmf != null) + message.dtmf = String(object.dtmf); + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length >= 0) + message.audio = object.audio; + if (object.toolResponses != null) { + if (typeof object.toolResponses !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionInput.toolResponses: object expected"); + message.toolResponses = $root.google.cloud.ces.v1beta.ToolResponses.fromObject(object.toolResponses); + } + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionInput.image: object expected"); + message.image = $root.google.cloud.ces.v1beta.Image.fromObject(object.image); + } + if (object.blob != null) { + if (typeof object.blob !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionInput.blob: object expected"); + message.blob = $root.google.cloud.ces.v1beta.Blob.fromObject(object.blob); + } + if (object.variables != null) { + if (typeof object.variables !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionInput.variables: object expected"); + message.variables = $root.google.protobuf.Struct.fromObject(object.variables); + } + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionInput.event: object expected"); + message.event = $root.google.cloud.ces.v1beta.Event.fromObject(object.event); + } + if (object.willContinue != null) + message.willContinue = Boolean(object.willContinue); + return message; + }; + + /** + * Creates a plain object from a SessionInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.SessionInput + * @static + * @param {google.cloud.ces.v1beta.SessionInput} message SessionInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.willContinue = false; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.inputType = "text"; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; + if (options.oneofs) + object.inputType = "audio"; + } + if (message.toolResponses != null && message.hasOwnProperty("toolResponses")) { + object.toolResponses = $root.google.cloud.ces.v1beta.ToolResponses.toObject(message.toolResponses, options); + if (options.oneofs) + object.inputType = "toolResponses"; + } + if (message.image != null && message.hasOwnProperty("image")) { + object.image = $root.google.cloud.ces.v1beta.Image.toObject(message.image, options); + if (options.oneofs) + object.inputType = "image"; + } + if (message.variables != null && message.hasOwnProperty("variables")) { + object.variables = $root.google.protobuf.Struct.toObject(message.variables, options); + if (options.oneofs) + object.inputType = "variables"; + } + if (message.dtmf != null && message.hasOwnProperty("dtmf")) { + object.dtmf = message.dtmf; + if (options.oneofs) + object.inputType = "dtmf"; + } + if (message.blob != null && message.hasOwnProperty("blob")) { + object.blob = $root.google.cloud.ces.v1beta.Blob.toObject(message.blob, options); + if (options.oneofs) + object.inputType = "blob"; + } + if (message.willContinue != null && message.hasOwnProperty("willContinue")) + object.willContinue = message.willContinue; + if (message.event != null && message.hasOwnProperty("event")) { + object.event = $root.google.cloud.ces.v1beta.Event.toObject(message.event, options); + if (options.oneofs) + object.inputType = "event"; + } + return object; + }; + + /** + * Converts this SessionInput to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.SessionInput + * @instance + * @returns {Object.} JSON object + */ + SessionInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionInput + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.SessionInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.SessionInput"; + }; + + return SessionInput; + })(); + + v1beta.SessionOutput = (function() { + + /** + * Properties of a SessionOutput. + * @memberof google.cloud.ces.v1beta + * @interface ISessionOutput + * @property {string|null} [text] SessionOutput text + * @property {Uint8Array|null} [audio] SessionOutput audio + * @property {google.cloud.ces.v1beta.IToolCalls|null} [toolCalls] SessionOutput toolCalls + * @property {google.cloud.ces.v1beta.ICitations|null} [citations] SessionOutput citations + * @property {google.cloud.ces.v1beta.IGoogleSearchSuggestions|null} [googleSearchSuggestions] SessionOutput googleSearchSuggestions + * @property {google.cloud.ces.v1beta.IEndSession|null} [endSession] SessionOutput endSession + * @property {google.protobuf.IStruct|null} [payload] SessionOutput payload + * @property {number|null} [turnIndex] SessionOutput turnIndex + * @property {boolean|null} [turnCompleted] SessionOutput turnCompleted + * @property {google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo|null} [diagnosticInfo] SessionOutput diagnosticInfo + */ + + /** + * Constructs a new SessionOutput. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a SessionOutput. + * @implements ISessionOutput + * @constructor + * @param {google.cloud.ces.v1beta.ISessionOutput=} [properties] Properties to set + */ + function SessionOutput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionOutput text. + * @member {string|null|undefined} text + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.text = null; + + /** + * SessionOutput audio. + * @member {Uint8Array|null|undefined} audio + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.audio = null; + + /** + * SessionOutput toolCalls. + * @member {google.cloud.ces.v1beta.IToolCalls|null|undefined} toolCalls + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.toolCalls = null; + + /** + * SessionOutput citations. + * @member {google.cloud.ces.v1beta.ICitations|null|undefined} citations + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.citations = null; + + /** + * SessionOutput googleSearchSuggestions. + * @member {google.cloud.ces.v1beta.IGoogleSearchSuggestions|null|undefined} googleSearchSuggestions + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.googleSearchSuggestions = null; + + /** + * SessionOutput endSession. + * @member {google.cloud.ces.v1beta.IEndSession|null|undefined} endSession + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.endSession = null; + + /** + * SessionOutput payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.payload = null; + + /** + * SessionOutput turnIndex. + * @member {number} turnIndex + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.turnIndex = 0; + + /** + * SessionOutput turnCompleted. + * @member {boolean} turnCompleted + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.turnCompleted = false; + + /** + * SessionOutput diagnosticInfo. + * @member {google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo|null|undefined} diagnosticInfo + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + SessionOutput.prototype.diagnosticInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SessionOutput outputType. + * @member {"text"|"audio"|"toolCalls"|"citations"|"googleSearchSuggestions"|"endSession"|"payload"|undefined} outputType + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + */ + Object.defineProperty(SessionOutput.prototype, "outputType", { + get: $util.oneOfGetter($oneOfFields = ["text", "audio", "toolCalls", "citations", "googleSearchSuggestions", "endSession", "payload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SessionOutput instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.SessionOutput + * @static + * @param {google.cloud.ces.v1beta.ISessionOutput=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.SessionOutput} SessionOutput instance + */ + SessionOutput.create = function create(properties) { + return new SessionOutput(properties); + }; + + /** + * Encodes the specified SessionOutput message. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.SessionOutput + * @static + * @param {google.cloud.ces.v1beta.ISessionOutput} message SessionOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionOutput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audio); + if (message.toolCalls != null && Object.hasOwnProperty.call(message, "toolCalls")) + $root.google.cloud.ces.v1beta.ToolCalls.encode(message.toolCalls, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.turnCompleted != null && Object.hasOwnProperty.call(message, "turnCompleted")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.turnCompleted); + if (message.turnIndex != null && Object.hasOwnProperty.call(message, "turnIndex")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.turnIndex); + if (message.diagnosticInfo != null && Object.hasOwnProperty.call(message, "diagnosticInfo")) + $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.encode(message.diagnosticInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.citations != null && Object.hasOwnProperty.call(message, "citations")) + $root.google.cloud.ces.v1beta.Citations.encode(message.citations, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.endSession != null && Object.hasOwnProperty.call(message, "endSession")) + $root.google.cloud.ces.v1beta.EndSession.encode(message.endSession, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.googleSearchSuggestions != null && Object.hasOwnProperty.call(message, "googleSearchSuggestions")) + $root.google.cloud.ces.v1beta.GoogleSearchSuggestions.encode(message.googleSearchSuggestions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SessionOutput message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.SessionOutput + * @static + * @param {google.cloud.ces.v1beta.ISessionOutput} message SessionOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionOutput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionOutput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.SessionOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.SessionOutput} SessionOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionOutput.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SessionOutput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.audio = reader.bytes(); + break; + } + case 3: { + message.toolCalls = $root.google.cloud.ces.v1beta.ToolCalls.decode(reader, reader.uint32()); + break; + } + case 8: { + message.citations = $root.google.cloud.ces.v1beta.Citations.decode(reader, reader.uint32()); + break; + } + case 10: { + message.googleSearchSuggestions = $root.google.cloud.ces.v1beta.GoogleSearchSuggestions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.endSession = $root.google.cloud.ces.v1beta.EndSession.decode(reader, reader.uint32()); + break; + } + case 11: { + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.turnIndex = reader.int32(); + break; + } + case 4: { + message.turnCompleted = reader.bool(); + break; + } + case 7: { + message.diagnosticInfo = $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionOutput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.SessionOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.SessionOutput} SessionOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionOutput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionOutput message. + * @function verify + * @memberof google.cloud.ces.v1beta.SessionOutput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionOutput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.outputType = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + if (properties.outputType === 1) + return "outputType: multiple values"; + properties.outputType = 1; + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; + } + if (message.toolCalls != null && message.hasOwnProperty("toolCalls")) { + if (properties.outputType === 1) + return "outputType: multiple values"; + properties.outputType = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolCalls.verify(message.toolCalls); + if (error) + return "toolCalls." + error; + } + } + if (message.citations != null && message.hasOwnProperty("citations")) { + if (properties.outputType === 1) + return "outputType: multiple values"; + properties.outputType = 1; + { + var error = $root.google.cloud.ces.v1beta.Citations.verify(message.citations); + if (error) + return "citations." + error; + } + } + if (message.googleSearchSuggestions != null && message.hasOwnProperty("googleSearchSuggestions")) { + if (properties.outputType === 1) + return "outputType: multiple values"; + properties.outputType = 1; + { + var error = $root.google.cloud.ces.v1beta.GoogleSearchSuggestions.verify(message.googleSearchSuggestions); + if (error) + return "googleSearchSuggestions." + error; + } + } + if (message.endSession != null && message.hasOwnProperty("endSession")) { + if (properties.outputType === 1) + return "outputType: multiple values"; + properties.outputType = 1; + { + var error = $root.google.cloud.ces.v1beta.EndSession.verify(message.endSession); + if (error) + return "endSession." + error; + } + } + if (message.payload != null && message.hasOwnProperty("payload")) { + if (properties.outputType === 1) + return "outputType: multiple values"; + properties.outputType = 1; + { + var error = $root.google.protobuf.Struct.verify(message.payload); + if (error) + return "payload." + error; + } + } + if (message.turnIndex != null && message.hasOwnProperty("turnIndex")) + if (!$util.isInteger(message.turnIndex)) + return "turnIndex: integer expected"; + if (message.turnCompleted != null && message.hasOwnProperty("turnCompleted")) + if (typeof message.turnCompleted !== "boolean") + return "turnCompleted: boolean expected"; + if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) { + var error = $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.verify(message.diagnosticInfo); + if (error) + return "diagnosticInfo." + error; + } + return null; + }; + + /** + * Creates a SessionOutput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.SessionOutput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.SessionOutput} SessionOutput + */ + SessionOutput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.SessionOutput) + return object; + var message = new $root.google.cloud.ces.v1beta.SessionOutput(); + if (object.text != null) + message.text = String(object.text); + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length >= 0) + message.audio = object.audio; + if (object.toolCalls != null) { + if (typeof object.toolCalls !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionOutput.toolCalls: object expected"); + message.toolCalls = $root.google.cloud.ces.v1beta.ToolCalls.fromObject(object.toolCalls); + } + if (object.citations != null) { + if (typeof object.citations !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionOutput.citations: object expected"); + message.citations = $root.google.cloud.ces.v1beta.Citations.fromObject(object.citations); + } + if (object.googleSearchSuggestions != null) { + if (typeof object.googleSearchSuggestions !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionOutput.googleSearchSuggestions: object expected"); + message.googleSearchSuggestions = $root.google.cloud.ces.v1beta.GoogleSearchSuggestions.fromObject(object.googleSearchSuggestions); + } + if (object.endSession != null) { + if (typeof object.endSession !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionOutput.endSession: object expected"); + message.endSession = $root.google.cloud.ces.v1beta.EndSession.fromObject(object.endSession); + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionOutput.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload); + } + if (object.turnIndex != null) + message.turnIndex = object.turnIndex | 0; + if (object.turnCompleted != null) + message.turnCompleted = Boolean(object.turnCompleted); + if (object.diagnosticInfo != null) { + if (typeof object.diagnosticInfo !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionOutput.diagnosticInfo: object expected"); + message.diagnosticInfo = $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.fromObject(object.diagnosticInfo); + } + return message; + }; + + /** + * Creates a plain object from a SessionOutput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.SessionOutput + * @static + * @param {google.cloud.ces.v1beta.SessionOutput} message SessionOutput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionOutput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.turnCompleted = false; + object.turnIndex = 0; + object.diagnosticInfo = null; + } + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.outputType = "text"; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; + if (options.oneofs) + object.outputType = "audio"; + } + if (message.toolCalls != null && message.hasOwnProperty("toolCalls")) { + object.toolCalls = $root.google.cloud.ces.v1beta.ToolCalls.toObject(message.toolCalls, options); + if (options.oneofs) + object.outputType = "toolCalls"; + } + if (message.turnCompleted != null && message.hasOwnProperty("turnCompleted")) + object.turnCompleted = message.turnCompleted; + if (message.turnIndex != null && message.hasOwnProperty("turnIndex")) + object.turnIndex = message.turnIndex; + if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) + object.diagnosticInfo = $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.toObject(message.diagnosticInfo, options); + if (message.citations != null && message.hasOwnProperty("citations")) { + object.citations = $root.google.cloud.ces.v1beta.Citations.toObject(message.citations, options); + if (options.oneofs) + object.outputType = "citations"; + } + if (message.endSession != null && message.hasOwnProperty("endSession")) { + object.endSession = $root.google.cloud.ces.v1beta.EndSession.toObject(message.endSession, options); + if (options.oneofs) + object.outputType = "endSession"; + } + if (message.googleSearchSuggestions != null && message.hasOwnProperty("googleSearchSuggestions")) { + object.googleSearchSuggestions = $root.google.cloud.ces.v1beta.GoogleSearchSuggestions.toObject(message.googleSearchSuggestions, options); + if (options.oneofs) + object.outputType = "googleSearchSuggestions"; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (options.oneofs) + object.outputType = "payload"; + } + return object; + }; + + /** + * Converts this SessionOutput to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.SessionOutput + * @instance + * @returns {Object.} JSON object + */ + SessionOutput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionOutput + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.SessionOutput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.SessionOutput"; + }; + + SessionOutput.DiagnosticInfo = (function() { + + /** + * Properties of a DiagnosticInfo. + * @memberof google.cloud.ces.v1beta.SessionOutput + * @interface IDiagnosticInfo + * @property {Array.|null} [messages] DiagnosticInfo messages + * @property {google.cloud.ces.v1beta.ISpan|null} [rootSpan] DiagnosticInfo rootSpan + */ + + /** + * Constructs a new DiagnosticInfo. + * @memberof google.cloud.ces.v1beta.SessionOutput + * @classdesc Represents a DiagnosticInfo. + * @implements IDiagnosticInfo + * @constructor + * @param {google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo=} [properties] Properties to set + */ + function DiagnosticInfo(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiagnosticInfo messages. + * @member {Array.} messages + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @instance + */ + DiagnosticInfo.prototype.messages = $util.emptyArray; + + /** + * DiagnosticInfo rootSpan. + * @member {google.cloud.ces.v1beta.ISpan|null|undefined} rootSpan + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @instance + */ + DiagnosticInfo.prototype.rootSpan = null; + + /** + * Creates a new DiagnosticInfo instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @static + * @param {google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo} DiagnosticInfo instance + */ + DiagnosticInfo.create = function create(properties) { + return new DiagnosticInfo(properties); + }; + + /** + * Encodes the specified DiagnosticInfo message. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @static + * @param {google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo} message DiagnosticInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiagnosticInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.ces.v1beta.Message.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rootSpan != null && Object.hasOwnProperty.call(message, "rootSpan")) + $root.google.cloud.ces.v1beta.Span.encode(message.rootSpan, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DiagnosticInfo message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @static + * @param {google.cloud.ces.v1beta.SessionOutput.IDiagnosticInfo} message DiagnosticInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiagnosticInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiagnosticInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo} DiagnosticInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiagnosticInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.ces.v1beta.Message.decode(reader, reader.uint32())); + break; + } + case 3: { + message.rootSpan = $root.google.cloud.ces.v1beta.Span.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiagnosticInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo} DiagnosticInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiagnosticInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiagnosticInfo message. + * @function verify + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiagnosticInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) { + var error = $root.google.cloud.ces.v1beta.Span.verify(message.rootSpan); + if (error) + return "rootSpan." + error; + } + return null; + }; + + /** + * Creates a DiagnosticInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo} DiagnosticInfo + */ + DiagnosticInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo) + return object; + var message = new $root.google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.messages: object expected"); + message.messages[i] = $root.google.cloud.ces.v1beta.Message.fromObject(object.messages[i]); + } + } + if (object.rootSpan != null) { + if (typeof object.rootSpan !== "object") + throw TypeError(".google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo.rootSpan: object expected"); + message.rootSpan = $root.google.cloud.ces.v1beta.Span.fromObject(object.rootSpan); + } + return message; + }; + + /** + * Creates a plain object from a DiagnosticInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @static + * @param {google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo} message DiagnosticInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiagnosticInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) + object.rootSpan = null; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.ces.v1beta.Message.toObject(message.messages[j], options); + } + if (message.rootSpan != null && message.hasOwnProperty("rootSpan")) + object.rootSpan = $root.google.cloud.ces.v1beta.Span.toObject(message.rootSpan, options); + return object; + }; + + /** + * Converts this DiagnosticInfo to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @instance + * @returns {Object.} JSON object + */ + DiagnosticInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DiagnosticInfo + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DiagnosticInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.SessionOutput.DiagnosticInfo"; + }; + + return DiagnosticInfo; + })(); + + return SessionOutput; + })(); + + v1beta.RecognitionResult = (function() { + + /** + * Properties of a RecognitionResult. + * @memberof google.cloud.ces.v1beta + * @interface IRecognitionResult + * @property {string|null} [transcript] RecognitionResult transcript + */ + + /** + * Constructs a new RecognitionResult. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RecognitionResult. + * @implements IRecognitionResult + * @constructor + * @param {google.cloud.ces.v1beta.IRecognitionResult=} [properties] Properties to set + */ + function RecognitionResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognitionResult transcript. + * @member {string} transcript + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @instance + */ + RecognitionResult.prototype.transcript = ""; + + /** + * Creates a new RecognitionResult instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @static + * @param {google.cloud.ces.v1beta.IRecognitionResult=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RecognitionResult} RecognitionResult instance + */ + RecognitionResult.create = function create(properties) { + return new RecognitionResult(properties); + }; + + /** + * Encodes the specified RecognitionResult message. Does not implicitly {@link google.cloud.ces.v1beta.RecognitionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @static + * @param {google.cloud.ces.v1beta.IRecognitionResult} message RecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.transcript); + return writer; + }; + + /** + * Encodes the specified RecognitionResult message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RecognitionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @static + * @param {google.cloud.ces.v1beta.IRecognitionResult} message RecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognitionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RecognitionResult} RecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RecognitionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.transcript = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognitionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RecognitionResult} RecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognitionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognitionResult message. + * @function verify + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognitionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transcript != null && message.hasOwnProperty("transcript")) + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + return null; + }; + + /** + * Creates a RecognitionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RecognitionResult} RecognitionResult + */ + RecognitionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RecognitionResult) + return object; + var message = new $root.google.cloud.ces.v1beta.RecognitionResult(); + if (object.transcript != null) + message.transcript = String(object.transcript); + return message; + }; + + /** + * Creates a plain object from a RecognitionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @static + * @param {google.cloud.ces.v1beta.RecognitionResult} message RecognitionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognitionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.transcript = ""; + if (message.transcript != null && message.hasOwnProperty("transcript")) + object.transcript = message.transcript; + return object; + }; + + /** + * Converts this RecognitionResult to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @instance + * @returns {Object.} JSON object + */ + RecognitionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognitionResult + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RecognitionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognitionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RecognitionResult"; + }; + + return RecognitionResult; + })(); + + v1beta.InterruptionSignal = (function() { + + /** + * Properties of an InterruptionSignal. + * @memberof google.cloud.ces.v1beta + * @interface IInterruptionSignal + * @property {boolean|null} [bargeIn] InterruptionSignal bargeIn + */ + + /** + * Constructs a new InterruptionSignal. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an InterruptionSignal. + * @implements IInterruptionSignal + * @constructor + * @param {google.cloud.ces.v1beta.IInterruptionSignal=} [properties] Properties to set + */ + function InterruptionSignal(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterruptionSignal bargeIn. + * @member {boolean} bargeIn + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @instance + */ + InterruptionSignal.prototype.bargeIn = false; + + /** + * Creates a new InterruptionSignal instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @static + * @param {google.cloud.ces.v1beta.IInterruptionSignal=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.InterruptionSignal} InterruptionSignal instance + */ + InterruptionSignal.create = function create(properties) { + return new InterruptionSignal(properties); + }; + + /** + * Encodes the specified InterruptionSignal message. Does not implicitly {@link google.cloud.ces.v1beta.InterruptionSignal.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @static + * @param {google.cloud.ces.v1beta.IInterruptionSignal} message InterruptionSignal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterruptionSignal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bargeIn != null && Object.hasOwnProperty.call(message, "bargeIn")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.bargeIn); + return writer; + }; + + /** + * Encodes the specified InterruptionSignal message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.InterruptionSignal.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @static + * @param {google.cloud.ces.v1beta.IInterruptionSignal} message InterruptionSignal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterruptionSignal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterruptionSignal message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.InterruptionSignal} InterruptionSignal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterruptionSignal.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.InterruptionSignal(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bargeIn = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterruptionSignal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.InterruptionSignal} InterruptionSignal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterruptionSignal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterruptionSignal message. + * @function verify + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterruptionSignal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bargeIn != null && message.hasOwnProperty("bargeIn")) + if (typeof message.bargeIn !== "boolean") + return "bargeIn: boolean expected"; + return null; + }; + + /** + * Creates an InterruptionSignal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.InterruptionSignal} InterruptionSignal + */ + InterruptionSignal.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.InterruptionSignal) + return object; + var message = new $root.google.cloud.ces.v1beta.InterruptionSignal(); + if (object.bargeIn != null) + message.bargeIn = Boolean(object.bargeIn); + return message; + }; + + /** + * Creates a plain object from an InterruptionSignal message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @static + * @param {google.cloud.ces.v1beta.InterruptionSignal} message InterruptionSignal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterruptionSignal.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.bargeIn = false; + if (message.bargeIn != null && message.hasOwnProperty("bargeIn")) + object.bargeIn = message.bargeIn; + return object; + }; + + /** + * Converts this InterruptionSignal to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @instance + * @returns {Object.} JSON object + */ + InterruptionSignal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InterruptionSignal + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.InterruptionSignal + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InterruptionSignal.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.InterruptionSignal"; + }; + + return InterruptionSignal; + })(); + + v1beta.EndSession = (function() { + + /** + * Properties of an EndSession. + * @memberof google.cloud.ces.v1beta + * @interface IEndSession + * @property {google.protobuf.IStruct|null} [metadata] EndSession metadata + */ + + /** + * Constructs a new EndSession. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EndSession. + * @implements IEndSession + * @constructor + * @param {google.cloud.ces.v1beta.IEndSession=} [properties] Properties to set + */ + function EndSession(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndSession metadata. + * @member {google.protobuf.IStruct|null|undefined} metadata + * @memberof google.cloud.ces.v1beta.EndSession + * @instance + */ + EndSession.prototype.metadata = null; + + /** + * Creates a new EndSession instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.EndSession + * @static + * @param {google.cloud.ces.v1beta.IEndSession=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.EndSession} EndSession instance + */ + EndSession.create = function create(properties) { + return new EndSession(properties); + }; + + /** + * Encodes the specified EndSession message. Does not implicitly {@link google.cloud.ces.v1beta.EndSession.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.EndSession + * @static + * @param {google.cloud.ces.v1beta.IEndSession} message EndSession message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndSession.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EndSession message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.EndSession.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.EndSession + * @static + * @param {google.cloud.ces.v1beta.IEndSession} message EndSession message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndSession.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndSession message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.EndSession + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.EndSession} EndSession + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndSession.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.EndSession(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndSession message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.EndSession + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.EndSession} EndSession + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndSession.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndSession message. + * @function verify + * @memberof google.cloud.ces.v1beta.EndSession + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndSession.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Struct.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates an EndSession message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.EndSession + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.EndSession} EndSession + */ + EndSession.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.EndSession) + return object; + var message = new $root.google.cloud.ces.v1beta.EndSession(); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.ces.v1beta.EndSession.metadata: object expected"); + message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from an EndSession message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.EndSession + * @static + * @param {google.cloud.ces.v1beta.EndSession} message EndSession + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndSession.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this EndSession to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.EndSession + * @instance + * @returns {Object.} JSON object + */ + EndSession.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndSession + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.EndSession + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndSession.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.EndSession"; + }; + + return EndSession; + })(); + + v1beta.GoAway = (function() { + + /** + * Properties of a GoAway. + * @memberof google.cloud.ces.v1beta + * @interface IGoAway + */ + + /** + * Constructs a new GoAway. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GoAway. + * @implements IGoAway + * @constructor + * @param {google.cloud.ces.v1beta.IGoAway=} [properties] Properties to set + */ + function GoAway(properties) { + if (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 GoAway instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GoAway + * @static + * @param {google.cloud.ces.v1beta.IGoAway=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GoAway} GoAway instance + */ + GoAway.create = function create(properties) { + return new GoAway(properties); + }; + + /** + * Encodes the specified GoAway message. Does not implicitly {@link google.cloud.ces.v1beta.GoAway.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GoAway + * @static + * @param {google.cloud.ces.v1beta.IGoAway} message GoAway message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoAway.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GoAway message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoAway.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GoAway + * @static + * @param {google.cloud.ces.v1beta.IGoAway} message GoAway message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoAway.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoAway message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GoAway + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GoAway} GoAway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoAway.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GoAway(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoAway message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GoAway + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GoAway} GoAway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoAway.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoAway message. + * @function verify + * @memberof google.cloud.ces.v1beta.GoAway + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoAway.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GoAway message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GoAway + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GoAway} GoAway + */ + GoAway.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GoAway) + return object; + return new $root.google.cloud.ces.v1beta.GoAway(); + }; + + /** + * Creates a plain object from a GoAway message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GoAway + * @static + * @param {google.cloud.ces.v1beta.GoAway} message GoAway + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoAway.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GoAway to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GoAway + * @instance + * @returns {Object.} JSON object + */ + GoAway.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoAway + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GoAway + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoAway.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GoAway"; + }; + + return GoAway; + })(); + + v1beta.RunSessionRequest = (function() { + + /** + * Properties of a RunSessionRequest. + * @memberof google.cloud.ces.v1beta + * @interface IRunSessionRequest + * @property {google.cloud.ces.v1beta.ISessionConfig|null} [config] RunSessionRequest config + * @property {Array.|null} [inputs] RunSessionRequest inputs + */ + + /** + * Constructs a new RunSessionRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RunSessionRequest. + * @implements IRunSessionRequest + * @constructor + * @param {google.cloud.ces.v1beta.IRunSessionRequest=} [properties] Properties to set + */ + function RunSessionRequest(properties) { + this.inputs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunSessionRequest config. + * @member {google.cloud.ces.v1beta.ISessionConfig|null|undefined} config + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @instance + */ + RunSessionRequest.prototype.config = null; + + /** + * RunSessionRequest inputs. + * @member {Array.} inputs + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @instance + */ + RunSessionRequest.prototype.inputs = $util.emptyArray; + + /** + * Creates a new RunSessionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @static + * @param {google.cloud.ces.v1beta.IRunSessionRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RunSessionRequest} RunSessionRequest instance + */ + RunSessionRequest.create = function create(properties) { + return new RunSessionRequest(properties); + }; + + /** + * Encodes the specified RunSessionRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @static + * @param {google.cloud.ces.v1beta.IRunSessionRequest} message RunSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunSessionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.ces.v1beta.SessionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.inputs != null && message.inputs.length) + for (var i = 0; i < message.inputs.length; ++i) + $root.google.cloud.ces.v1beta.SessionInput.encode(message.inputs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunSessionRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @static + * @param {google.cloud.ces.v1beta.IRunSessionRequest} message RunSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunSessionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RunSessionRequest} RunSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunSessionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RunSessionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.ces.v1beta.SessionConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.inputs && message.inputs.length)) + message.inputs = []; + message.inputs.push($root.google.cloud.ces.v1beta.SessionInput.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunSessionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RunSessionRequest} RunSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunSessionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunSessionRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunSessionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.ces.v1beta.SessionConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.inputs != null && message.hasOwnProperty("inputs")) { + if (!Array.isArray(message.inputs)) + return "inputs: array expected"; + for (var i = 0; i < message.inputs.length; ++i) { + var error = $root.google.cloud.ces.v1beta.SessionInput.verify(message.inputs[i]); + if (error) + return "inputs." + error; + } + } + return null; + }; + + /** + * Creates a RunSessionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RunSessionRequest} RunSessionRequest + */ + RunSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RunSessionRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.RunSessionRequest(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.ces.v1beta.RunSessionRequest.config: object expected"); + message.config = $root.google.cloud.ces.v1beta.SessionConfig.fromObject(object.config); + } + if (object.inputs) { + if (!Array.isArray(object.inputs)) + throw TypeError(".google.cloud.ces.v1beta.RunSessionRequest.inputs: array expected"); + message.inputs = []; + for (var i = 0; i < object.inputs.length; ++i) { + if (typeof object.inputs[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.RunSessionRequest.inputs: object expected"); + message.inputs[i] = $root.google.cloud.ces.v1beta.SessionInput.fromObject(object.inputs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RunSessionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @static + * @param {google.cloud.ces.v1beta.RunSessionRequest} message RunSessionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunSessionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inputs = []; + if (options.defaults) + object.config = null; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.ces.v1beta.SessionConfig.toObject(message.config, options); + if (message.inputs && message.inputs.length) { + object.inputs = []; + for (var j = 0; j < message.inputs.length; ++j) + object.inputs[j] = $root.google.cloud.ces.v1beta.SessionInput.toObject(message.inputs[j], options); + } + return object; + }; + + /** + * Converts this RunSessionRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @instance + * @returns {Object.} JSON object + */ + RunSessionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunSessionRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RunSessionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RunSessionRequest"; + }; + + return RunSessionRequest; + })(); + + v1beta.RunSessionResponse = (function() { + + /** + * Properties of a RunSessionResponse. + * @memberof google.cloud.ces.v1beta + * @interface IRunSessionResponse + * @property {Array.|null} [outputs] RunSessionResponse outputs + */ + + /** + * Constructs a new RunSessionResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RunSessionResponse. + * @implements IRunSessionResponse + * @constructor + * @param {google.cloud.ces.v1beta.IRunSessionResponse=} [properties] Properties to set + */ + function RunSessionResponse(properties) { + this.outputs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunSessionResponse outputs. + * @member {Array.} outputs + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @instance + */ + RunSessionResponse.prototype.outputs = $util.emptyArray; + + /** + * Creates a new RunSessionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @static + * @param {google.cloud.ces.v1beta.IRunSessionResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RunSessionResponse} RunSessionResponse instance + */ + RunSessionResponse.create = function create(properties) { + return new RunSessionResponse(properties); + }; + + /** + * Encodes the specified RunSessionResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @static + * @param {google.cloud.ces.v1beta.IRunSessionResponse} message RunSessionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunSessionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputs != null && message.outputs.length) + for (var i = 0; i < message.outputs.length; ++i) + $root.google.cloud.ces.v1beta.SessionOutput.encode(message.outputs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunSessionResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunSessionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @static + * @param {google.cloud.ces.v1beta.IRunSessionResponse} message RunSessionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunSessionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunSessionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RunSessionResponse} RunSessionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunSessionResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RunSessionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.outputs && message.outputs.length)) + message.outputs = []; + message.outputs.push($root.google.cloud.ces.v1beta.SessionOutput.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunSessionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RunSessionResponse} RunSessionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunSessionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunSessionResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunSessionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputs != null && message.hasOwnProperty("outputs")) { + if (!Array.isArray(message.outputs)) + return "outputs: array expected"; + for (var i = 0; i < message.outputs.length; ++i) { + var error = $root.google.cloud.ces.v1beta.SessionOutput.verify(message.outputs[i]); + if (error) + return "outputs." + error; + } + } + return null; + }; + + /** + * Creates a RunSessionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RunSessionResponse} RunSessionResponse + */ + RunSessionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RunSessionResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.RunSessionResponse(); + if (object.outputs) { + if (!Array.isArray(object.outputs)) + throw TypeError(".google.cloud.ces.v1beta.RunSessionResponse.outputs: array expected"); + message.outputs = []; + for (var i = 0; i < object.outputs.length; ++i) { + if (typeof object.outputs[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.RunSessionResponse.outputs: object expected"); + message.outputs[i] = $root.google.cloud.ces.v1beta.SessionOutput.fromObject(object.outputs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RunSessionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @static + * @param {google.cloud.ces.v1beta.RunSessionResponse} message RunSessionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunSessionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.outputs = []; + if (message.outputs && message.outputs.length) { + object.outputs = []; + for (var j = 0; j < message.outputs.length; ++j) + object.outputs[j] = $root.google.cloud.ces.v1beta.SessionOutput.toObject(message.outputs[j], options); + } + return object; + }; + + /** + * Converts this RunSessionResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @instance + * @returns {Object.} JSON object + */ + RunSessionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunSessionResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RunSessionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunSessionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RunSessionResponse"; + }; + + return RunSessionResponse; + })(); + + v1beta.BidiSessionClientMessage = (function() { + + /** + * Properties of a BidiSessionClientMessage. + * @memberof google.cloud.ces.v1beta + * @interface IBidiSessionClientMessage + * @property {google.cloud.ces.v1beta.ISessionConfig|null} [config] BidiSessionClientMessage config + * @property {google.cloud.ces.v1beta.ISessionInput|null} [realtimeInput] BidiSessionClientMessage realtimeInput + */ + + /** + * Constructs a new BidiSessionClientMessage. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a BidiSessionClientMessage. + * @implements IBidiSessionClientMessage + * @constructor + * @param {google.cloud.ces.v1beta.IBidiSessionClientMessage=} [properties] Properties to set + */ + function BidiSessionClientMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiSessionClientMessage config. + * @member {google.cloud.ces.v1beta.ISessionConfig|null|undefined} config + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @instance + */ + BidiSessionClientMessage.prototype.config = null; + + /** + * BidiSessionClientMessage realtimeInput. + * @member {google.cloud.ces.v1beta.ISessionInput|null|undefined} realtimeInput + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @instance + */ + BidiSessionClientMessage.prototype.realtimeInput = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BidiSessionClientMessage messageType. + * @member {"config"|"realtimeInput"|undefined} messageType + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @instance + */ + Object.defineProperty(BidiSessionClientMessage.prototype, "messageType", { + get: $util.oneOfGetter($oneOfFields = ["config", "realtimeInput"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BidiSessionClientMessage instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @static + * @param {google.cloud.ces.v1beta.IBidiSessionClientMessage=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.BidiSessionClientMessage} BidiSessionClientMessage instance + */ + BidiSessionClientMessage.create = function create(properties) { + return new BidiSessionClientMessage(properties); + }; + + /** + * Encodes the specified BidiSessionClientMessage message. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionClientMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @static + * @param {google.cloud.ces.v1beta.IBidiSessionClientMessage} message BidiSessionClientMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiSessionClientMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.ces.v1beta.SessionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.realtimeInput != null && Object.hasOwnProperty.call(message, "realtimeInput")) + $root.google.cloud.ces.v1beta.SessionInput.encode(message.realtimeInput, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BidiSessionClientMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionClientMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @static + * @param {google.cloud.ces.v1beta.IBidiSessionClientMessage} message BidiSessionClientMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiSessionClientMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiSessionClientMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.BidiSessionClientMessage} BidiSessionClientMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiSessionClientMessage.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BidiSessionClientMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.ces.v1beta.SessionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.realtimeInput = $root.google.cloud.ces.v1beta.SessionInput.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiSessionClientMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.BidiSessionClientMessage} BidiSessionClientMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiSessionClientMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiSessionClientMessage message. + * @function verify + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiSessionClientMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.config != null && message.hasOwnProperty("config")) { + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1beta.SessionConfig.verify(message.config); + if (error) + return "config." + error; + } + } + if (message.realtimeInput != null && message.hasOwnProperty("realtimeInput")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1beta.SessionInput.verify(message.realtimeInput); + if (error) + return "realtimeInput." + error; + } + } + return null; + }; + + /** + * Creates a BidiSessionClientMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.BidiSessionClientMessage} BidiSessionClientMessage + */ + BidiSessionClientMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.BidiSessionClientMessage) + return object; + var message = new $root.google.cloud.ces.v1beta.BidiSessionClientMessage(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.ces.v1beta.BidiSessionClientMessage.config: object expected"); + message.config = $root.google.cloud.ces.v1beta.SessionConfig.fromObject(object.config); + } + if (object.realtimeInput != null) { + if (typeof object.realtimeInput !== "object") + throw TypeError(".google.cloud.ces.v1beta.BidiSessionClientMessage.realtimeInput: object expected"); + message.realtimeInput = $root.google.cloud.ces.v1beta.SessionInput.fromObject(object.realtimeInput); + } + return message; + }; + + /** + * Creates a plain object from a BidiSessionClientMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @static + * @param {google.cloud.ces.v1beta.BidiSessionClientMessage} message BidiSessionClientMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiSessionClientMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.config != null && message.hasOwnProperty("config")) { + object.config = $root.google.cloud.ces.v1beta.SessionConfig.toObject(message.config, options); + if (options.oneofs) + object.messageType = "config"; + } + if (message.realtimeInput != null && message.hasOwnProperty("realtimeInput")) { + object.realtimeInput = $root.google.cloud.ces.v1beta.SessionInput.toObject(message.realtimeInput, options); + if (options.oneofs) + object.messageType = "realtimeInput"; + } + return object; + }; + + /** + * Converts this BidiSessionClientMessage to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @instance + * @returns {Object.} JSON object + */ + BidiSessionClientMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiSessionClientMessage + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.BidiSessionClientMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiSessionClientMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.BidiSessionClientMessage"; + }; + + return BidiSessionClientMessage; + })(); + + v1beta.BidiSessionServerMessage = (function() { + + /** + * Properties of a BidiSessionServerMessage. + * @memberof google.cloud.ces.v1beta + * @interface IBidiSessionServerMessage + * @property {google.cloud.ces.v1beta.ISessionOutput|null} [sessionOutput] BidiSessionServerMessage sessionOutput + * @property {google.cloud.ces.v1beta.IRecognitionResult|null} [recognitionResult] BidiSessionServerMessage recognitionResult + * @property {google.cloud.ces.v1beta.IInterruptionSignal|null} [interruptionSignal] BidiSessionServerMessage interruptionSignal + * @property {google.cloud.ces.v1beta.IEndSession|null} [endSession] BidiSessionServerMessage endSession + * @property {google.cloud.ces.v1beta.IGoAway|null} [goAway] BidiSessionServerMessage goAway + */ + + /** + * Constructs a new BidiSessionServerMessage. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a BidiSessionServerMessage. + * @implements IBidiSessionServerMessage + * @constructor + * @param {google.cloud.ces.v1beta.IBidiSessionServerMessage=} [properties] Properties to set + */ + function BidiSessionServerMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiSessionServerMessage sessionOutput. + * @member {google.cloud.ces.v1beta.ISessionOutput|null|undefined} sessionOutput + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @instance + */ + BidiSessionServerMessage.prototype.sessionOutput = null; + + /** + * BidiSessionServerMessage recognitionResult. + * @member {google.cloud.ces.v1beta.IRecognitionResult|null|undefined} recognitionResult + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @instance + */ + BidiSessionServerMessage.prototype.recognitionResult = null; + + /** + * BidiSessionServerMessage interruptionSignal. + * @member {google.cloud.ces.v1beta.IInterruptionSignal|null|undefined} interruptionSignal + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @instance + */ + BidiSessionServerMessage.prototype.interruptionSignal = null; + + /** + * BidiSessionServerMessage endSession. + * @member {google.cloud.ces.v1beta.IEndSession|null|undefined} endSession + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @instance + */ + BidiSessionServerMessage.prototype.endSession = null; + + /** + * BidiSessionServerMessage goAway. + * @member {google.cloud.ces.v1beta.IGoAway|null|undefined} goAway + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @instance + */ + BidiSessionServerMessage.prototype.goAway = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BidiSessionServerMessage messageType. + * @member {"sessionOutput"|"recognitionResult"|"interruptionSignal"|"endSession"|"goAway"|undefined} messageType + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @instance + */ + Object.defineProperty(BidiSessionServerMessage.prototype, "messageType", { + get: $util.oneOfGetter($oneOfFields = ["sessionOutput", "recognitionResult", "interruptionSignal", "endSession", "goAway"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BidiSessionServerMessage instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @static + * @param {google.cloud.ces.v1beta.IBidiSessionServerMessage=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.BidiSessionServerMessage} BidiSessionServerMessage instance + */ + BidiSessionServerMessage.create = function create(properties) { + return new BidiSessionServerMessage(properties); + }; + + /** + * Encodes the specified BidiSessionServerMessage message. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionServerMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @static + * @param {google.cloud.ces.v1beta.IBidiSessionServerMessage} message BidiSessionServerMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiSessionServerMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessionOutput != null && Object.hasOwnProperty.call(message, "sessionOutput")) + $root.google.cloud.ces.v1beta.SessionOutput.encode(message.sessionOutput, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.recognitionResult != null && Object.hasOwnProperty.call(message, "recognitionResult")) + $root.google.cloud.ces.v1beta.RecognitionResult.encode(message.recognitionResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.interruptionSignal != null && Object.hasOwnProperty.call(message, "interruptionSignal")) + $root.google.cloud.ces.v1beta.InterruptionSignal.encode(message.interruptionSignal, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endSession != null && Object.hasOwnProperty.call(message, "endSession")) + $root.google.cloud.ces.v1beta.EndSession.encode(message.endSession, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.goAway != null && Object.hasOwnProperty.call(message, "goAway")) + $root.google.cloud.ces.v1beta.GoAway.encode(message.goAway, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BidiSessionServerMessage message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.BidiSessionServerMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @static + * @param {google.cloud.ces.v1beta.IBidiSessionServerMessage} message BidiSessionServerMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiSessionServerMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiSessionServerMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.BidiSessionServerMessage} BidiSessionServerMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiSessionServerMessage.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.BidiSessionServerMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sessionOutput = $root.google.cloud.ces.v1beta.SessionOutput.decode(reader, reader.uint32()); + break; + } + case 2: { + message.recognitionResult = $root.google.cloud.ces.v1beta.RecognitionResult.decode(reader, reader.uint32()); + break; + } + case 3: { + message.interruptionSignal = $root.google.cloud.ces.v1beta.InterruptionSignal.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endSession = $root.google.cloud.ces.v1beta.EndSession.decode(reader, reader.uint32()); + break; + } + case 6: { + message.goAway = $root.google.cloud.ces.v1beta.GoAway.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiSessionServerMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.BidiSessionServerMessage} BidiSessionServerMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiSessionServerMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiSessionServerMessage message. + * @function verify + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiSessionServerMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sessionOutput != null && message.hasOwnProperty("sessionOutput")) { + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1beta.SessionOutput.verify(message.sessionOutput); + if (error) + return "sessionOutput." + error; + } + } + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1beta.RecognitionResult.verify(message.recognitionResult); + if (error) + return "recognitionResult." + error; + } + } + if (message.interruptionSignal != null && message.hasOwnProperty("interruptionSignal")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1beta.InterruptionSignal.verify(message.interruptionSignal); + if (error) + return "interruptionSignal." + error; + } + } + if (message.endSession != null && message.hasOwnProperty("endSession")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1beta.EndSession.verify(message.endSession); + if (error) + return "endSession." + error; + } + } + if (message.goAway != null && message.hasOwnProperty("goAway")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.cloud.ces.v1beta.GoAway.verify(message.goAway); + if (error) + return "goAway." + error; + } + } + return null; + }; + + /** + * Creates a BidiSessionServerMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.BidiSessionServerMessage} BidiSessionServerMessage + */ + BidiSessionServerMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.BidiSessionServerMessage) + return object; + var message = new $root.google.cloud.ces.v1beta.BidiSessionServerMessage(); + if (object.sessionOutput != null) { + if (typeof object.sessionOutput !== "object") + throw TypeError(".google.cloud.ces.v1beta.BidiSessionServerMessage.sessionOutput: object expected"); + message.sessionOutput = $root.google.cloud.ces.v1beta.SessionOutput.fromObject(object.sessionOutput); + } + if (object.recognitionResult != null) { + if (typeof object.recognitionResult !== "object") + throw TypeError(".google.cloud.ces.v1beta.BidiSessionServerMessage.recognitionResult: object expected"); + message.recognitionResult = $root.google.cloud.ces.v1beta.RecognitionResult.fromObject(object.recognitionResult); + } + if (object.interruptionSignal != null) { + if (typeof object.interruptionSignal !== "object") + throw TypeError(".google.cloud.ces.v1beta.BidiSessionServerMessage.interruptionSignal: object expected"); + message.interruptionSignal = $root.google.cloud.ces.v1beta.InterruptionSignal.fromObject(object.interruptionSignal); + } + if (object.endSession != null) { + if (typeof object.endSession !== "object") + throw TypeError(".google.cloud.ces.v1beta.BidiSessionServerMessage.endSession: object expected"); + message.endSession = $root.google.cloud.ces.v1beta.EndSession.fromObject(object.endSession); + } + if (object.goAway != null) { + if (typeof object.goAway !== "object") + throw TypeError(".google.cloud.ces.v1beta.BidiSessionServerMessage.goAway: object expected"); + message.goAway = $root.google.cloud.ces.v1beta.GoAway.fromObject(object.goAway); + } + return message; + }; + + /** + * Creates a plain object from a BidiSessionServerMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @static + * @param {google.cloud.ces.v1beta.BidiSessionServerMessage} message BidiSessionServerMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiSessionServerMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.sessionOutput != null && message.hasOwnProperty("sessionOutput")) { + object.sessionOutput = $root.google.cloud.ces.v1beta.SessionOutput.toObject(message.sessionOutput, options); + if (options.oneofs) + object.messageType = "sessionOutput"; + } + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { + object.recognitionResult = $root.google.cloud.ces.v1beta.RecognitionResult.toObject(message.recognitionResult, options); + if (options.oneofs) + object.messageType = "recognitionResult"; + } + if (message.interruptionSignal != null && message.hasOwnProperty("interruptionSignal")) { + object.interruptionSignal = $root.google.cloud.ces.v1beta.InterruptionSignal.toObject(message.interruptionSignal, options); + if (options.oneofs) + object.messageType = "interruptionSignal"; + } + if (message.endSession != null && message.hasOwnProperty("endSession")) { + object.endSession = $root.google.cloud.ces.v1beta.EndSession.toObject(message.endSession, options); + if (options.oneofs) + object.messageType = "endSession"; + } + if (message.goAway != null && message.hasOwnProperty("goAway")) { + object.goAway = $root.google.cloud.ces.v1beta.GoAway.toObject(message.goAway, options); + if (options.oneofs) + object.messageType = "goAway"; + } + return object; + }; + + /** + * Converts this BidiSessionServerMessage to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @instance + * @returns {Object.} JSON object + */ + BidiSessionServerMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiSessionServerMessage + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.BidiSessionServerMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiSessionServerMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.BidiSessionServerMessage"; + }; + + return BidiSessionServerMessage; + })(); + + v1beta.GoogleSearchSuggestions = (function() { + + /** + * Properties of a GoogleSearchSuggestions. + * @memberof google.cloud.ces.v1beta + * @interface IGoogleSearchSuggestions + * @property {Array.|null} [htmls] GoogleSearchSuggestions htmls + * @property {Array.|null} [webSearchQueries] GoogleSearchSuggestions webSearchQueries + */ + + /** + * Constructs a new GoogleSearchSuggestions. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GoogleSearchSuggestions. + * @implements IGoogleSearchSuggestions + * @constructor + * @param {google.cloud.ces.v1beta.IGoogleSearchSuggestions=} [properties] Properties to set + */ + function GoogleSearchSuggestions(properties) { + this.htmls = []; + this.webSearchQueries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoogleSearchSuggestions htmls. + * @member {Array.} htmls + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @instance + */ + GoogleSearchSuggestions.prototype.htmls = $util.emptyArray; + + /** + * GoogleSearchSuggestions webSearchQueries. + * @member {Array.} webSearchQueries + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @instance + */ + GoogleSearchSuggestions.prototype.webSearchQueries = $util.emptyArray; + + /** + * Creates a new GoogleSearchSuggestions instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @static + * @param {google.cloud.ces.v1beta.IGoogleSearchSuggestions=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GoogleSearchSuggestions} GoogleSearchSuggestions instance + */ + GoogleSearchSuggestions.create = function create(properties) { + return new GoogleSearchSuggestions(properties); + }; + + /** + * Encodes the specified GoogleSearchSuggestions message. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchSuggestions.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @static + * @param {google.cloud.ces.v1beta.IGoogleSearchSuggestions} message GoogleSearchSuggestions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearchSuggestions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.htmls != null && message.htmls.length) + for (var i = 0; i < message.htmls.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.htmls[i]); + if (message.webSearchQueries != null && message.webSearchQueries.length) + for (var i = 0; i < message.webSearchQueries.length; ++i) + $root.google.cloud.ces.v1beta.WebSearchQuery.encode(message.webSearchQueries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoogleSearchSuggestions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GoogleSearchSuggestions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @static + * @param {google.cloud.ces.v1beta.IGoogleSearchSuggestions} message GoogleSearchSuggestions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearchSuggestions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoogleSearchSuggestions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GoogleSearchSuggestions} GoogleSearchSuggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearchSuggestions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GoogleSearchSuggestions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.htmls && message.htmls.length)) + message.htmls = []; + message.htmls.push(reader.string()); + break; + } + case 2: { + if (!(message.webSearchQueries && message.webSearchQueries.length)) + message.webSearchQueries = []; + message.webSearchQueries.push($root.google.cloud.ces.v1beta.WebSearchQuery.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoogleSearchSuggestions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GoogleSearchSuggestions} GoogleSearchSuggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearchSuggestions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoogleSearchSuggestions message. + * @function verify + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoogleSearchSuggestions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.htmls != null && message.hasOwnProperty("htmls")) { + if (!Array.isArray(message.htmls)) + return "htmls: array expected"; + for (var i = 0; i < message.htmls.length; ++i) + if (!$util.isString(message.htmls[i])) + return "htmls: string[] expected"; + } + if (message.webSearchQueries != null && message.hasOwnProperty("webSearchQueries")) { + if (!Array.isArray(message.webSearchQueries)) + return "webSearchQueries: array expected"; + for (var i = 0; i < message.webSearchQueries.length; ++i) { + var error = $root.google.cloud.ces.v1beta.WebSearchQuery.verify(message.webSearchQueries[i]); + if (error) + return "webSearchQueries." + error; + } + } + return null; + }; + + /** + * Creates a GoogleSearchSuggestions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GoogleSearchSuggestions} GoogleSearchSuggestions + */ + GoogleSearchSuggestions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GoogleSearchSuggestions) + return object; + var message = new $root.google.cloud.ces.v1beta.GoogleSearchSuggestions(); + if (object.htmls) { + if (!Array.isArray(object.htmls)) + throw TypeError(".google.cloud.ces.v1beta.GoogleSearchSuggestions.htmls: array expected"); + message.htmls = []; + for (var i = 0; i < object.htmls.length; ++i) + message.htmls[i] = String(object.htmls[i]); + } + if (object.webSearchQueries) { + if (!Array.isArray(object.webSearchQueries)) + throw TypeError(".google.cloud.ces.v1beta.GoogleSearchSuggestions.webSearchQueries: array expected"); + message.webSearchQueries = []; + for (var i = 0; i < object.webSearchQueries.length; ++i) { + if (typeof object.webSearchQueries[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.GoogleSearchSuggestions.webSearchQueries: object expected"); + message.webSearchQueries[i] = $root.google.cloud.ces.v1beta.WebSearchQuery.fromObject(object.webSearchQueries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GoogleSearchSuggestions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @static + * @param {google.cloud.ces.v1beta.GoogleSearchSuggestions} message GoogleSearchSuggestions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoogleSearchSuggestions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.htmls = []; + object.webSearchQueries = []; + } + if (message.htmls && message.htmls.length) { + object.htmls = []; + for (var j = 0; j < message.htmls.length; ++j) + object.htmls[j] = message.htmls[j]; + } + if (message.webSearchQueries && message.webSearchQueries.length) { + object.webSearchQueries = []; + for (var j = 0; j < message.webSearchQueries.length; ++j) + object.webSearchQueries[j] = $root.google.cloud.ces.v1beta.WebSearchQuery.toObject(message.webSearchQueries[j], options); + } + return object; + }; + + /** + * Converts this GoogleSearchSuggestions to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @instance + * @returns {Object.} JSON object + */ + GoogleSearchSuggestions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoogleSearchSuggestions + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GoogleSearchSuggestions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoogleSearchSuggestions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GoogleSearchSuggestions"; + }; + + return GoogleSearchSuggestions; + })(); + + v1beta.WebSearchQuery = (function() { + + /** + * Properties of a WebSearchQuery. + * @memberof google.cloud.ces.v1beta + * @interface IWebSearchQuery + * @property {string|null} [query] WebSearchQuery query + * @property {string|null} [uri] WebSearchQuery uri + */ + + /** + * Constructs a new WebSearchQuery. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a WebSearchQuery. + * @implements IWebSearchQuery + * @constructor + * @param {google.cloud.ces.v1beta.IWebSearchQuery=} [properties] Properties to set + */ + function WebSearchQuery(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebSearchQuery query. + * @member {string} query + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @instance + */ + WebSearchQuery.prototype.query = ""; + + /** + * WebSearchQuery uri. + * @member {string} uri + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @instance + */ + WebSearchQuery.prototype.uri = ""; + + /** + * Creates a new WebSearchQuery instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @static + * @param {google.cloud.ces.v1beta.IWebSearchQuery=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.WebSearchQuery} WebSearchQuery instance + */ + WebSearchQuery.create = function create(properties) { + return new WebSearchQuery(properties); + }; + + /** + * Encodes the specified WebSearchQuery message. Does not implicitly {@link google.cloud.ces.v1beta.WebSearchQuery.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @static + * @param {google.cloud.ces.v1beta.IWebSearchQuery} message WebSearchQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebSearchQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + return writer; + }; + + /** + * Encodes the specified WebSearchQuery message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.WebSearchQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @static + * @param {google.cloud.ces.v1beta.IWebSearchQuery} message WebSearchQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebSearchQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebSearchQuery message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.WebSearchQuery} WebSearchQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebSearchQuery.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.WebSearchQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.query = reader.string(); + break; + } + case 2: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebSearchQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.WebSearchQuery} WebSearchQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebSearchQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebSearchQuery message. + * @function verify + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebSearchQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a WebSearchQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.WebSearchQuery} WebSearchQuery + */ + WebSearchQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.WebSearchQuery) + return object; + var message = new $root.google.cloud.ces.v1beta.WebSearchQuery(); + if (object.query != null) + message.query = String(object.query); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a WebSearchQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @static + * @param {google.cloud.ces.v1beta.WebSearchQuery} message WebSearchQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebSearchQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.query = ""; + object.uri = ""; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this WebSearchQuery to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @instance + * @returns {Object.} JSON object + */ + WebSearchQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebSearchQuery + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.WebSearchQuery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebSearchQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.WebSearchQuery"; + }; + + return WebSearchQuery; + })(); + + v1beta.EvaluationService = (function() { + + /** + * Constructs a new EvaluationService service. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an EvaluationService + * @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 EvaluationService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (EvaluationService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EvaluationService; + + /** + * Creates new EvaluationService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.ces.v1beta.EvaluationService + * @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 {EvaluationService} RPC service. Useful where requests and/or responses are streamed. + */ + EvaluationService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|runEvaluation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef RunEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunEvaluation. + * @function runEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IRunEvaluationRequest} request RunEvaluationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.RunEvaluationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.runEvaluation = function runEvaluation(request, callback) { + return this.rpcCall(runEvaluation, $root.google.cloud.ces.v1beta.RunEvaluationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunEvaluation" }); + + /** + * Calls RunEvaluation. + * @function runEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IRunEvaluationRequest} request RunEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|uploadEvaluationAudio}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef UploadEvaluationAudioCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.UploadEvaluationAudioResponse} [response] UploadEvaluationAudioResponse + */ + + /** + * Calls UploadEvaluationAudio. + * @function uploadEvaluationAudio + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioRequest} request UploadEvaluationAudioRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.UploadEvaluationAudioCallback} callback Node-style callback called with the error, if any, and UploadEvaluationAudioResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.uploadEvaluationAudio = function uploadEvaluationAudio(request, callback) { + return this.rpcCall(uploadEvaluationAudio, $root.google.cloud.ces.v1beta.UploadEvaluationAudioRequest, $root.google.cloud.ces.v1beta.UploadEvaluationAudioResponse, request, callback); + }, "name", { value: "UploadEvaluationAudio" }); + + /** + * Calls UploadEvaluationAudio. + * @function uploadEvaluationAudio + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioRequest} request UploadEvaluationAudioRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createEvaluation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef CreateEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Evaluation} [response] Evaluation + */ + + /** + * Calls CreateEvaluation. + * @function createEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ICreateEvaluationRequest} request CreateEvaluationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.CreateEvaluationCallback} callback Node-style callback called with the error, if any, and Evaluation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.createEvaluation = function createEvaluation(request, callback) { + return this.rpcCall(createEvaluation, $root.google.cloud.ces.v1beta.CreateEvaluationRequest, $root.google.cloud.ces.v1beta.Evaluation, request, callback); + }, "name", { value: "CreateEvaluation" }); + + /** + * Calls CreateEvaluation. + * @function createEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ICreateEvaluationRequest} request CreateEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|generateEvaluation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef GenerateEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GenerateEvaluation. + * @function generateEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGenerateEvaluationRequest} request GenerateEvaluationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.GenerateEvaluationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.generateEvaluation = function generateEvaluation(request, callback) { + return this.rpcCall(generateEvaluation, $root.google.cloud.ces.v1beta.GenerateEvaluationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GenerateEvaluation" }); + + /** + * Calls GenerateEvaluation. + * @function generateEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGenerateEvaluationRequest} request GenerateEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|importEvaluations}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef ImportEvaluationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportEvaluations. + * @function importEvaluations + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IImportEvaluationsRequest} request ImportEvaluationsRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.ImportEvaluationsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.importEvaluations = function importEvaluations(request, callback) { + return this.rpcCall(importEvaluations, $root.google.cloud.ces.v1beta.ImportEvaluationsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportEvaluations" }); + + /** + * Calls ImportEvaluations. + * @function importEvaluations + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IImportEvaluationsRequest} request ImportEvaluationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createEvaluationDataset}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef CreateEvaluationDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.EvaluationDataset} [response] EvaluationDataset + */ + + /** + * Calls CreateEvaluationDataset. + * @function createEvaluationDataset + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest} request CreateEvaluationDatasetRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.CreateEvaluationDatasetCallback} callback Node-style callback called with the error, if any, and EvaluationDataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.createEvaluationDataset = function createEvaluationDataset(request, callback) { + return this.rpcCall(createEvaluationDataset, $root.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest, $root.google.cloud.ces.v1beta.EvaluationDataset, request, callback); + }, "name", { value: "CreateEvaluationDataset" }); + + /** + * Calls CreateEvaluationDataset. + * @function createEvaluationDataset + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest} request CreateEvaluationDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateEvaluation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef UpdateEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Evaluation} [response] Evaluation + */ + + /** + * Calls UpdateEvaluation. + * @function updateEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateEvaluationRequest} request UpdateEvaluationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationCallback} callback Node-style callback called with the error, if any, and Evaluation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.updateEvaluation = function updateEvaluation(request, callback) { + return this.rpcCall(updateEvaluation, $root.google.cloud.ces.v1beta.UpdateEvaluationRequest, $root.google.cloud.ces.v1beta.Evaluation, request, callback); + }, "name", { value: "UpdateEvaluation" }); + + /** + * Calls UpdateEvaluation. + * @function updateEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateEvaluationRequest} request UpdateEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateEvaluationDataset}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef UpdateEvaluationDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.EvaluationDataset} [response] EvaluationDataset + */ + + /** + * Calls UpdateEvaluationDataset. + * @function updateEvaluationDataset + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest} request UpdateEvaluationDatasetRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationDatasetCallback} callback Node-style callback called with the error, if any, and EvaluationDataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.updateEvaluationDataset = function updateEvaluationDataset(request, callback) { + return this.rpcCall(updateEvaluationDataset, $root.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest, $root.google.cloud.ces.v1beta.EvaluationDataset, request, callback); + }, "name", { value: "UpdateEvaluationDataset" }); + + /** + * Calls UpdateEvaluationDataset. + * @function updateEvaluationDataset + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest} request UpdateEvaluationDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef DeleteEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteEvaluation. + * @function deleteEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRequest} request DeleteEvaluationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.deleteEvaluation = function deleteEvaluation(request, callback) { + return this.rpcCall(deleteEvaluation, $root.google.cloud.ces.v1beta.DeleteEvaluationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEvaluation" }); + + /** + * Calls DeleteEvaluation. + * @function deleteEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRequest} request DeleteEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationResult}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef DeleteEvaluationResultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteEvaluationResult. + * @function deleteEvaluationResult + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationResultRequest} request DeleteEvaluationResultRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationResultCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.deleteEvaluationResult = function deleteEvaluationResult(request, callback) { + return this.rpcCall(deleteEvaluationResult, $root.google.cloud.ces.v1beta.DeleteEvaluationResultRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEvaluationResult" }); + + /** + * Calls DeleteEvaluationResult. + * @function deleteEvaluationResult + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationResultRequest} request DeleteEvaluationResultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationDataset}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef DeleteEvaluationDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteEvaluationDataset. + * @function deleteEvaluationDataset + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest} request DeleteEvaluationDatasetRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationDatasetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.deleteEvaluationDataset = function deleteEvaluationDataset(request, callback) { + return this.rpcCall(deleteEvaluationDataset, $root.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEvaluationDataset" }); + + /** + * Calls DeleteEvaluationDataset. + * @function deleteEvaluationDataset + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest} request DeleteEvaluationDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationRun}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef DeleteEvaluationRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteEvaluationRun. + * @function deleteEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunRequest} request DeleteEvaluationRunRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationRunCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.deleteEvaluationRun = function deleteEvaluationRun(request, callback) { + return this.rpcCall(deleteEvaluationRun, $root.google.cloud.ces.v1beta.DeleteEvaluationRunRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteEvaluationRun" }); + + /** + * Calls DeleteEvaluationRun. + * @function deleteEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunRequest} request DeleteEvaluationRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef GetEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.Evaluation} [response] Evaluation + */ + + /** + * Calls GetEvaluation. + * @function getEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationRequest} request GetEvaluationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.GetEvaluationCallback} callback Node-style callback called with the error, if any, and Evaluation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.getEvaluation = function getEvaluation(request, callback) { + return this.rpcCall(getEvaluation, $root.google.cloud.ces.v1beta.GetEvaluationRequest, $root.google.cloud.ces.v1beta.Evaluation, request, callback); + }, "name", { value: "GetEvaluation" }); + + /** + * Calls GetEvaluation. + * @function getEvaluation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationRequest} request GetEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationResult}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef GetEvaluationResultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.EvaluationResult} [response] EvaluationResult + */ + + /** + * Calls GetEvaluationResult. + * @function getEvaluationResult + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationResultRequest} request GetEvaluationResultRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.GetEvaluationResultCallback} callback Node-style callback called with the error, if any, and EvaluationResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.getEvaluationResult = function getEvaluationResult(request, callback) { + return this.rpcCall(getEvaluationResult, $root.google.cloud.ces.v1beta.GetEvaluationResultRequest, $root.google.cloud.ces.v1beta.EvaluationResult, request, callback); + }, "name", { value: "GetEvaluationResult" }); + + /** + * Calls GetEvaluationResult. + * @function getEvaluationResult + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationResultRequest} request GetEvaluationResultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationDataset}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef GetEvaluationDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.EvaluationDataset} [response] EvaluationDataset + */ + + /** + * Calls GetEvaluationDataset. + * @function getEvaluationDataset + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationDatasetRequest} request GetEvaluationDatasetRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.GetEvaluationDatasetCallback} callback Node-style callback called with the error, if any, and EvaluationDataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.getEvaluationDataset = function getEvaluationDataset(request, callback) { + return this.rpcCall(getEvaluationDataset, $root.google.cloud.ces.v1beta.GetEvaluationDatasetRequest, $root.google.cloud.ces.v1beta.EvaluationDataset, request, callback); + }, "name", { value: "GetEvaluationDataset" }); + + /** + * Calls GetEvaluationDataset. + * @function getEvaluationDataset + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationDatasetRequest} request GetEvaluationDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationRun}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef GetEvaluationRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.EvaluationRun} [response] EvaluationRun + */ + + /** + * Calls GetEvaluationRun. + * @function getEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationRunRequest} request GetEvaluationRunRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.GetEvaluationRunCallback} callback Node-style callback called with the error, if any, and EvaluationRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.getEvaluationRun = function getEvaluationRun(request, callback) { + return this.rpcCall(getEvaluationRun, $root.google.cloud.ces.v1beta.GetEvaluationRunRequest, $root.google.cloud.ces.v1beta.EvaluationRun, request, callback); + }, "name", { value: "GetEvaluationRun" }); + + /** + * Calls GetEvaluationRun. + * @function getEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationRunRequest} request GetEvaluationRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluations}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef ListEvaluationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListEvaluationsResponse} [response] ListEvaluationsResponse + */ + + /** + * Calls ListEvaluations. + * @function listEvaluations + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationsRequest} request ListEvaluationsRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.ListEvaluationsCallback} callback Node-style callback called with the error, if any, and ListEvaluationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.listEvaluations = function listEvaluations(request, callback) { + return this.rpcCall(listEvaluations, $root.google.cloud.ces.v1beta.ListEvaluationsRequest, $root.google.cloud.ces.v1beta.ListEvaluationsResponse, request, callback); + }, "name", { value: "ListEvaluations" }); + + /** + * Calls ListEvaluations. + * @function listEvaluations + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationsRequest} request ListEvaluationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationResults}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef ListEvaluationResultsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListEvaluationResultsResponse} [response] ListEvaluationResultsResponse + */ + + /** + * Calls ListEvaluationResults. + * @function listEvaluationResults + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationResultsRequest} request ListEvaluationResultsRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.ListEvaluationResultsCallback} callback Node-style callback called with the error, if any, and ListEvaluationResultsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.listEvaluationResults = function listEvaluationResults(request, callback) { + return this.rpcCall(listEvaluationResults, $root.google.cloud.ces.v1beta.ListEvaluationResultsRequest, $root.google.cloud.ces.v1beta.ListEvaluationResultsResponse, request, callback); + }, "name", { value: "ListEvaluationResults" }); + + /** + * Calls ListEvaluationResults. + * @function listEvaluationResults + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationResultsRequest} request ListEvaluationResultsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationDatasets}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef ListEvaluationDatasetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListEvaluationDatasetsResponse} [response] ListEvaluationDatasetsResponse + */ + + /** + * Calls ListEvaluationDatasets. + * @function listEvaluationDatasets + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsRequest} request ListEvaluationDatasetsRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.ListEvaluationDatasetsCallback} callback Node-style callback called with the error, if any, and ListEvaluationDatasetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.listEvaluationDatasets = function listEvaluationDatasets(request, callback) { + return this.rpcCall(listEvaluationDatasets, $root.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest, $root.google.cloud.ces.v1beta.ListEvaluationDatasetsResponse, request, callback); + }, "name", { value: "ListEvaluationDatasets" }); + + /** + * Calls ListEvaluationDatasets. + * @function listEvaluationDatasets + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsRequest} request ListEvaluationDatasetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationRuns}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef ListEvaluationRunsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListEvaluationRunsResponse} [response] ListEvaluationRunsResponse + */ + + /** + * Calls ListEvaluationRuns. + * @function listEvaluationRuns + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationRunsRequest} request ListEvaluationRunsRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.ListEvaluationRunsCallback} callback Node-style callback called with the error, if any, and ListEvaluationRunsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.listEvaluationRuns = function listEvaluationRuns(request, callback) { + return this.rpcCall(listEvaluationRuns, $root.google.cloud.ces.v1beta.ListEvaluationRunsRequest, $root.google.cloud.ces.v1beta.ListEvaluationRunsResponse, request, callback); + }, "name", { value: "ListEvaluationRuns" }); + + /** + * Calls ListEvaluationRuns. + * @function listEvaluationRuns + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationRunsRequest} request ListEvaluationRunsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listEvaluationExpectations}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef ListEvaluationExpectationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListEvaluationExpectationsResponse} [response] ListEvaluationExpectationsResponse + */ + + /** + * Calls ListEvaluationExpectations. + * @function listEvaluationExpectations + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsRequest} request ListEvaluationExpectationsRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.ListEvaluationExpectationsCallback} callback Node-style callback called with the error, if any, and ListEvaluationExpectationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.listEvaluationExpectations = function listEvaluationExpectations(request, callback) { + return this.rpcCall(listEvaluationExpectations, $root.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest, $root.google.cloud.ces.v1beta.ListEvaluationExpectationsResponse, request, callback); + }, "name", { value: "ListEvaluationExpectations" }); + + /** + * Calls ListEvaluationExpectations. + * @function listEvaluationExpectations + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsRequest} request ListEvaluationExpectationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getEvaluationExpectation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef GetEvaluationExpectationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.EvaluationExpectation} [response] EvaluationExpectation + */ + + /** + * Calls GetEvaluationExpectation. + * @function getEvaluationExpectation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationExpectationRequest} request GetEvaluationExpectationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.GetEvaluationExpectationCallback} callback Node-style callback called with the error, if any, and EvaluationExpectation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.getEvaluationExpectation = function getEvaluationExpectation(request, callback) { + return this.rpcCall(getEvaluationExpectation, $root.google.cloud.ces.v1beta.GetEvaluationExpectationRequest, $root.google.cloud.ces.v1beta.EvaluationExpectation, request, callback); + }, "name", { value: "GetEvaluationExpectation" }); + + /** + * Calls GetEvaluationExpectation. + * @function getEvaluationExpectation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetEvaluationExpectationRequest} request GetEvaluationExpectationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createEvaluationExpectation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef CreateEvaluationExpectationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.EvaluationExpectation} [response] EvaluationExpectation + */ + + /** + * Calls CreateEvaluationExpectation. + * @function createEvaluationExpectation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest} request CreateEvaluationExpectationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.CreateEvaluationExpectationCallback} callback Node-style callback called with the error, if any, and EvaluationExpectation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.createEvaluationExpectation = function createEvaluationExpectation(request, callback) { + return this.rpcCall(createEvaluationExpectation, $root.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest, $root.google.cloud.ces.v1beta.EvaluationExpectation, request, callback); + }, "name", { value: "CreateEvaluationExpectation" }); + + /** + * Calls CreateEvaluationExpectation. + * @function createEvaluationExpectation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest} request CreateEvaluationExpectationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateEvaluationExpectation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef UpdateEvaluationExpectationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.EvaluationExpectation} [response] EvaluationExpectation + */ + + /** + * Calls UpdateEvaluationExpectation. + * @function updateEvaluationExpectation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest} request UpdateEvaluationExpectationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.UpdateEvaluationExpectationCallback} callback Node-style callback called with the error, if any, and EvaluationExpectation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.updateEvaluationExpectation = function updateEvaluationExpectation(request, callback) { + return this.rpcCall(updateEvaluationExpectation, $root.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest, $root.google.cloud.ces.v1beta.EvaluationExpectation, request, callback); + }, "name", { value: "UpdateEvaluationExpectation" }); + + /** + * Calls UpdateEvaluationExpectation. + * @function updateEvaluationExpectation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest} request UpdateEvaluationExpectationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteEvaluationExpectation}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef DeleteEvaluationExpectationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteEvaluationExpectation. + * @function deleteEvaluationExpectation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest} request DeleteEvaluationExpectationRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.DeleteEvaluationExpectationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.deleteEvaluationExpectation = function deleteEvaluationExpectation(request, callback) { + return this.rpcCall(deleteEvaluationExpectation, $root.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEvaluationExpectation" }); + + /** + * Calls DeleteEvaluationExpectation. + * @function deleteEvaluationExpectation + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest} request DeleteEvaluationExpectationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|createScheduledEvaluationRun}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef CreateScheduledEvaluationRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun} [response] ScheduledEvaluationRun + */ + + /** + * Calls CreateScheduledEvaluationRun. + * @function createScheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest} request CreateScheduledEvaluationRunRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.CreateScheduledEvaluationRunCallback} callback Node-style callback called with the error, if any, and ScheduledEvaluationRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.createScheduledEvaluationRun = function createScheduledEvaluationRun(request, callback) { + return this.rpcCall(createScheduledEvaluationRun, $root.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest, $root.google.cloud.ces.v1beta.ScheduledEvaluationRun, request, callback); + }, "name", { value: "CreateScheduledEvaluationRun" }); + + /** + * Calls CreateScheduledEvaluationRun. + * @function createScheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest} request CreateScheduledEvaluationRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|getScheduledEvaluationRun}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef GetScheduledEvaluationRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun} [response] ScheduledEvaluationRun + */ + + /** + * Calls GetScheduledEvaluationRun. + * @function getScheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest} request GetScheduledEvaluationRunRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.GetScheduledEvaluationRunCallback} callback Node-style callback called with the error, if any, and ScheduledEvaluationRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.getScheduledEvaluationRun = function getScheduledEvaluationRun(request, callback) { + return this.rpcCall(getScheduledEvaluationRun, $root.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest, $root.google.cloud.ces.v1beta.ScheduledEvaluationRun, request, callback); + }, "name", { value: "GetScheduledEvaluationRun" }); + + /** + * Calls GetScheduledEvaluationRun. + * @function getScheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest} request GetScheduledEvaluationRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|listScheduledEvaluationRuns}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef ListScheduledEvaluationRunsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse} [response] ListScheduledEvaluationRunsResponse + */ + + /** + * Calls ListScheduledEvaluationRuns. + * @function listScheduledEvaluationRuns + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest} request ListScheduledEvaluationRunsRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.ListScheduledEvaluationRunsCallback} callback Node-style callback called with the error, if any, and ListScheduledEvaluationRunsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.listScheduledEvaluationRuns = function listScheduledEvaluationRuns(request, callback) { + return this.rpcCall(listScheduledEvaluationRuns, $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest, $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse, request, callback); + }, "name", { value: "ListScheduledEvaluationRuns" }); + + /** + * Calls ListScheduledEvaluationRuns. + * @function listScheduledEvaluationRuns + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest} request ListScheduledEvaluationRunsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|updateScheduledEvaluationRun}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef UpdateScheduledEvaluationRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ScheduledEvaluationRun} [response] ScheduledEvaluationRun + */ + + /** + * Calls UpdateScheduledEvaluationRun. + * @function updateScheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest} request UpdateScheduledEvaluationRunRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.UpdateScheduledEvaluationRunCallback} callback Node-style callback called with the error, if any, and ScheduledEvaluationRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.updateScheduledEvaluationRun = function updateScheduledEvaluationRun(request, callback) { + return this.rpcCall(updateScheduledEvaluationRun, $root.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest, $root.google.cloud.ces.v1beta.ScheduledEvaluationRun, request, callback); + }, "name", { value: "UpdateScheduledEvaluationRun" }); + + /** + * Calls UpdateScheduledEvaluationRun. + * @function updateScheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest} request UpdateScheduledEvaluationRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|deleteScheduledEvaluationRun}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef DeleteScheduledEvaluationRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteScheduledEvaluationRun. + * @function deleteScheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest} request DeleteScheduledEvaluationRunRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.DeleteScheduledEvaluationRunCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.deleteScheduledEvaluationRun = function deleteScheduledEvaluationRun(request, callback) { + return this.rpcCall(deleteScheduledEvaluationRun, $root.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteScheduledEvaluationRun" }); + + /** + * Calls DeleteScheduledEvaluationRun. + * @function deleteScheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest} request DeleteScheduledEvaluationRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.EvaluationService|testPersonaVoice}. + * @memberof google.cloud.ces.v1beta.EvaluationService + * @typedef TestPersonaVoiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.TestPersonaVoiceResponse} [response] TestPersonaVoiceResponse + */ + + /** + * Calls TestPersonaVoice. + * @function testPersonaVoice + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceRequest} request TestPersonaVoiceRequest message or plain object + * @param {google.cloud.ces.v1beta.EvaluationService.TestPersonaVoiceCallback} callback Node-style callback called with the error, if any, and TestPersonaVoiceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.testPersonaVoice = function testPersonaVoice(request, callback) { + return this.rpcCall(testPersonaVoice, $root.google.cloud.ces.v1beta.TestPersonaVoiceRequest, $root.google.cloud.ces.v1beta.TestPersonaVoiceResponse, request, callback); + }, "name", { value: "TestPersonaVoice" }); + + /** + * Calls TestPersonaVoice. + * @function testPersonaVoice + * @memberof google.cloud.ces.v1beta.EvaluationService + * @instance + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceRequest} request TestPersonaVoiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return EvaluationService; + })(); + + v1beta.RunEvaluationResponse = (function() { + + /** + * Properties of a RunEvaluationResponse. + * @memberof google.cloud.ces.v1beta + * @interface IRunEvaluationResponse + * @property {string|null} [evaluationRun] RunEvaluationResponse evaluationRun + */ + + /** + * Constructs a new RunEvaluationResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RunEvaluationResponse. + * @implements IRunEvaluationResponse + * @constructor + * @param {google.cloud.ces.v1beta.IRunEvaluationResponse=} [properties] Properties to set + */ + function RunEvaluationResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunEvaluationResponse evaluationRun. + * @member {string} evaluationRun + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @instance + */ + RunEvaluationResponse.prototype.evaluationRun = ""; + + /** + * Creates a new RunEvaluationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @static + * @param {google.cloud.ces.v1beta.IRunEvaluationResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RunEvaluationResponse} RunEvaluationResponse instance + */ + RunEvaluationResponse.create = function create(properties) { + return new RunEvaluationResponse(properties); + }; + + /** + * Encodes the specified RunEvaluationResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @static + * @param {google.cloud.ces.v1beta.IRunEvaluationResponse} message RunEvaluationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunEvaluationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationRun != null && Object.hasOwnProperty.call(message, "evaluationRun")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.evaluationRun); + return writer; + }; + + /** + * Encodes the specified RunEvaluationResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @static + * @param {google.cloud.ces.v1beta.IRunEvaluationResponse} message RunEvaluationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunEvaluationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunEvaluationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RunEvaluationResponse} RunEvaluationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunEvaluationResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RunEvaluationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.evaluationRun = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunEvaluationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RunEvaluationResponse} RunEvaluationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunEvaluationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunEvaluationResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunEvaluationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) + if (!$util.isString(message.evaluationRun)) + return "evaluationRun: string expected"; + return null; + }; + + /** + * Creates a RunEvaluationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RunEvaluationResponse} RunEvaluationResponse + */ + RunEvaluationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RunEvaluationResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.RunEvaluationResponse(); + if (object.evaluationRun != null) + message.evaluationRun = String(object.evaluationRun); + return message; + }; + + /** + * Creates a plain object from a RunEvaluationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @static + * @param {google.cloud.ces.v1beta.RunEvaluationResponse} message RunEvaluationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunEvaluationResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.evaluationRun = ""; + if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) + object.evaluationRun = message.evaluationRun; + return object; + }; + + /** + * Converts this RunEvaluationResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @instance + * @returns {Object.} JSON object + */ + RunEvaluationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunEvaluationResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RunEvaluationResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunEvaluationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RunEvaluationResponse"; + }; + + return RunEvaluationResponse; + })(); + + v1beta.RunEvaluationOperationMetadata = (function() { + + /** + * Properties of a RunEvaluationOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @interface IRunEvaluationOperationMetadata + * @property {Array.|null} [evaluations] RunEvaluationOperationMetadata evaluations + * @property {string|null} [evaluationRun] RunEvaluationOperationMetadata evaluationRun + * @property {google.protobuf.ITimestamp|null} [createTime] RunEvaluationOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] RunEvaluationOperationMetadata endTime + * @property {string|null} [verb] RunEvaluationOperationMetadata verb + * @property {boolean|null} [cancelRequested] RunEvaluationOperationMetadata cancelRequested + */ + + /** + * Constructs a new RunEvaluationOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RunEvaluationOperationMetadata. + * @implements IRunEvaluationOperationMetadata + * @constructor + * @param {google.cloud.ces.v1beta.IRunEvaluationOperationMetadata=} [properties] Properties to set + */ + function RunEvaluationOperationMetadata(properties) { + this.evaluations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunEvaluationOperationMetadata evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @instance + */ + RunEvaluationOperationMetadata.prototype.evaluations = $util.emptyArray; + + /** + * RunEvaluationOperationMetadata evaluationRun. + * @member {string} evaluationRun + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @instance + */ + RunEvaluationOperationMetadata.prototype.evaluationRun = ""; + + /** + * RunEvaluationOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @instance + */ + RunEvaluationOperationMetadata.prototype.createTime = null; + + /** + * RunEvaluationOperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @instance + */ + RunEvaluationOperationMetadata.prototype.endTime = null; + + /** + * RunEvaluationOperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @instance + */ + RunEvaluationOperationMetadata.prototype.verb = ""; + + /** + * RunEvaluationOperationMetadata cancelRequested. + * @member {boolean} cancelRequested + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @instance + */ + RunEvaluationOperationMetadata.prototype.cancelRequested = false; + + /** + * Creates a new RunEvaluationOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IRunEvaluationOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RunEvaluationOperationMetadata} RunEvaluationOperationMetadata instance + */ + RunEvaluationOperationMetadata.create = function create(properties) { + return new RunEvaluationOperationMetadata(properties); + }; + + /** + * Encodes the specified RunEvaluationOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IRunEvaluationOperationMetadata} message RunEvaluationOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunEvaluationOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.evaluations[i]); + if (message.evaluationRun != null && Object.hasOwnProperty.call(message, "evaluationRun")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluationRun); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.verb); + if (message.cancelRequested != null && Object.hasOwnProperty.call(message, "cancelRequested")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.cancelRequested); + return writer; + }; + + /** + * Encodes the specified RunEvaluationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RunEvaluationOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IRunEvaluationOperationMetadata} message RunEvaluationOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunEvaluationOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunEvaluationOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RunEvaluationOperationMetadata} RunEvaluationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunEvaluationOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RunEvaluationOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push(reader.string()); + break; + } + case 2: { + message.evaluationRun = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.verb = reader.string(); + break; + } + case 6: { + message.cancelRequested = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunEvaluationOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RunEvaluationOperationMetadata} RunEvaluationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunEvaluationOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunEvaluationOperationMetadata message. + * @function verify + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunEvaluationOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) + if (!$util.isString(message.evaluations[i])) + return "evaluations: string[] expected"; + } + if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) + if (!$util.isString(message.evaluationRun)) + return "evaluationRun: 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.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.cancelRequested != null && message.hasOwnProperty("cancelRequested")) + if (typeof message.cancelRequested !== "boolean") + return "cancelRequested: boolean expected"; + return null; + }; + + /** + * Creates a RunEvaluationOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RunEvaluationOperationMetadata} RunEvaluationOperationMetadata + */ + RunEvaluationOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RunEvaluationOperationMetadata) + return object; + var message = new $root.google.cloud.ces.v1beta.RunEvaluationOperationMetadata(); + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.ces.v1beta.RunEvaluationOperationMetadata.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) + message.evaluations[i] = String(object.evaluations[i]); + } + if (object.evaluationRun != null) + message.evaluationRun = String(object.evaluationRun); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.RunEvaluationOperationMetadata.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.ces.v1beta.RunEvaluationOperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.verb != null) + message.verb = String(object.verb); + if (object.cancelRequested != null) + message.cancelRequested = Boolean(object.cancelRequested); + return message; + }; + + /** + * Creates a plain object from a RunEvaluationOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.RunEvaluationOperationMetadata} message RunEvaluationOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunEvaluationOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluations = []; + if (options.defaults) { + object.evaluationRun = ""; + object.createTime = null; + object.endTime = null; + object.verb = ""; + object.cancelRequested = false; + } + if (message.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = message.evaluations[j]; + } + if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) + object.evaluationRun = message.evaluationRun; + 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.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.cancelRequested != null && message.hasOwnProperty("cancelRequested")) + object.cancelRequested = message.cancelRequested; + return object; + }; + + /** + * Converts this RunEvaluationOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + RunEvaluationOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunEvaluationOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RunEvaluationOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunEvaluationOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RunEvaluationOperationMetadata"; + }; + + return RunEvaluationOperationMetadata; + })(); + + v1beta.GenerateEvaluationOperationMetadata = (function() { + + /** + * Properties of a GenerateEvaluationOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @interface IGenerateEvaluationOperationMetadata + */ + + /** + * Constructs a new GenerateEvaluationOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GenerateEvaluationOperationMetadata. + * @implements IGenerateEvaluationOperationMetadata + * @constructor + * @param {google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata=} [properties] Properties to set + */ + function GenerateEvaluationOperationMetadata(properties) { + if (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 GenerateEvaluationOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata} GenerateEvaluationOperationMetadata instance + */ + GenerateEvaluationOperationMetadata.create = function create(properties) { + return new GenerateEvaluationOperationMetadata(properties); + }; + + /** + * Encodes the specified GenerateEvaluationOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata} message GenerateEvaluationOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateEvaluationOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GenerateEvaluationOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IGenerateEvaluationOperationMetadata} message GenerateEvaluationOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateEvaluationOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateEvaluationOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata} GenerateEvaluationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateEvaluationOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateEvaluationOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata} GenerateEvaluationOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateEvaluationOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateEvaluationOperationMetadata message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateEvaluationOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GenerateEvaluationOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata} GenerateEvaluationOperationMetadata + */ + GenerateEvaluationOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata) + return object; + return new $root.google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata(); + }; + + /** + * Creates a plain object from a GenerateEvaluationOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata} message GenerateEvaluationOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateEvaluationOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GenerateEvaluationOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + GenerateEvaluationOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateEvaluationOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateEvaluationOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateEvaluationOperationMetadata"; + }; + + return GenerateEvaluationOperationMetadata; + })(); + + v1beta.DeleteEvaluationRunOperationMetadata = (function() { + + /** + * Properties of a DeleteEvaluationRunOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteEvaluationRunOperationMetadata + */ + + /** + * Constructs a new DeleteEvaluationRunOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteEvaluationRunOperationMetadata. + * @implements IDeleteEvaluationRunOperationMetadata + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata=} [properties] Properties to set + */ + function DeleteEvaluationRunOperationMetadata(properties) { + if (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 DeleteEvaluationRunOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata} DeleteEvaluationRunOperationMetadata instance + */ + DeleteEvaluationRunOperationMetadata.create = function create(properties) { + return new DeleteEvaluationRunOperationMetadata(properties); + }; + + /** + * Encodes the specified DeleteEvaluationRunOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata} message DeleteEvaluationRunOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationRunOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteEvaluationRunOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunOperationMetadata} message DeleteEvaluationRunOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationRunOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEvaluationRunOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata} DeleteEvaluationRunOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationRunOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEvaluationRunOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata} DeleteEvaluationRunOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationRunOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEvaluationRunOperationMetadata message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEvaluationRunOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteEvaluationRunOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata} DeleteEvaluationRunOperationMetadata + */ + DeleteEvaluationRunOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata) + return object; + return new $root.google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata(); + }; + + /** + * Creates a plain object from a DeleteEvaluationRunOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata} message DeleteEvaluationRunOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEvaluationRunOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteEvaluationRunOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteEvaluationRunOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEvaluationRunOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEvaluationRunOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteEvaluationRunOperationMetadata"; + }; + + return DeleteEvaluationRunOperationMetadata; + })(); + + v1beta.CreateEvaluationRequest = (function() { + + /** + * Properties of a CreateEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateEvaluationRequest + * @property {string|null} [parent] CreateEvaluationRequest parent + * @property {string|null} [evaluationId] CreateEvaluationRequest evaluationId + * @property {google.cloud.ces.v1beta.IEvaluation|null} [evaluation] CreateEvaluationRequest evaluation + */ + + /** + * Constructs a new CreateEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateEvaluationRequest. + * @implements ICreateEvaluationRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateEvaluationRequest=} [properties] Properties to set + */ + function CreateEvaluationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEvaluationRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @instance + */ + CreateEvaluationRequest.prototype.parent = ""; + + /** + * CreateEvaluationRequest evaluationId. + * @member {string} evaluationId + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @instance + */ + CreateEvaluationRequest.prototype.evaluationId = ""; + + /** + * CreateEvaluationRequest evaluation. + * @member {google.cloud.ces.v1beta.IEvaluation|null|undefined} evaluation + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @instance + */ + CreateEvaluationRequest.prototype.evaluation = null; + + /** + * Creates a new CreateEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateEvaluationRequest} CreateEvaluationRequest instance + */ + CreateEvaluationRequest.create = function create(properties) { + return new CreateEvaluationRequest(properties); + }; + + /** + * Encodes the specified CreateEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateEvaluationRequest} message CreateEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEvaluationRequest.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.evaluationId != null && Object.hasOwnProperty.call(message, "evaluationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluationId); + if (message.evaluation != null && Object.hasOwnProperty.call(message, "evaluation")) + $root.google.cloud.ces.v1beta.Evaluation.encode(message.evaluation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateEvaluationRequest} message CreateEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateEvaluationRequest} CreateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEvaluationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateEvaluationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.evaluationId = reader.string(); + break; + } + case 3: { + message.evaluation = $root.google.cloud.ces.v1beta.Evaluation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateEvaluationRequest} CreateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEvaluationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEvaluationRequest.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.evaluationId != null && message.hasOwnProperty("evaluationId")) + if (!$util.isString(message.evaluationId)) + return "evaluationId: string expected"; + if (message.evaluation != null && message.hasOwnProperty("evaluation")) { + var error = $root.google.cloud.ces.v1beta.Evaluation.verify(message.evaluation); + if (error) + return "evaluation." + error; + } + return null; + }; + + /** + * Creates a CreateEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateEvaluationRequest} CreateEvaluationRequest + */ + CreateEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateEvaluationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateEvaluationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.evaluationId != null) + message.evaluationId = String(object.evaluationId); + if (object.evaluation != null) { + if (typeof object.evaluation !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateEvaluationRequest.evaluation: object expected"); + message.evaluation = $root.google.cloud.ces.v1beta.Evaluation.fromObject(object.evaluation); + } + return message; + }; + + /** + * Creates a plain object from a CreateEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.CreateEvaluationRequest} message CreateEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEvaluationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.evaluationId = ""; + object.evaluation = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.evaluationId != null && message.hasOwnProperty("evaluationId")) + object.evaluationId = message.evaluationId; + if (message.evaluation != null && message.hasOwnProperty("evaluation")) + object.evaluation = $root.google.cloud.ces.v1beta.Evaluation.toObject(message.evaluation, options); + return object; + }; + + /** + * Converts this CreateEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateEvaluationRequest"; + }; + + return CreateEvaluationRequest; + })(); + + v1beta.GenerateEvaluationRequest = (function() { + + /** + * Properties of a GenerateEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGenerateEvaluationRequest + * @property {string|null} [conversation] GenerateEvaluationRequest conversation + * @property {google.cloud.ces.v1beta.Conversation.Source|null} [source] GenerateEvaluationRequest source + */ + + /** + * Constructs a new GenerateEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GenerateEvaluationRequest. + * @implements IGenerateEvaluationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGenerateEvaluationRequest=} [properties] Properties to set + */ + function GenerateEvaluationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateEvaluationRequest conversation. + * @member {string} conversation + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @instance + */ + GenerateEvaluationRequest.prototype.conversation = ""; + + /** + * GenerateEvaluationRequest source. + * @member {google.cloud.ces.v1beta.Conversation.Source} source + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @instance + */ + GenerateEvaluationRequest.prototype.source = 0; + + /** + * Creates a new GenerateEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IGenerateEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateEvaluationRequest} GenerateEvaluationRequest instance + */ + GenerateEvaluationRequest.create = function create(properties) { + return new GenerateEvaluationRequest(properties); + }; + + /** + * Encodes the specified GenerateEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IGenerateEvaluationRequest} message GenerateEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateEvaluationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversation); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.source); + return writer; + }; + + /** + * Encodes the specified GenerateEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IGenerateEvaluationRequest} message GenerateEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateEvaluationRequest} GenerateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateEvaluationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateEvaluationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.conversation = reader.string(); + break; + } + case 2: { + message.source = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateEvaluationRequest} GenerateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateEvaluationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateEvaluationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conversation != null && message.hasOwnProperty("conversation")) + if (!$util.isString(message.conversation)) + return "conversation: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + switch (message.source) { + default: + return "source: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a GenerateEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateEvaluationRequest} GenerateEvaluationRequest + */ + GenerateEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateEvaluationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateEvaluationRequest(); + if (object.conversation != null) + message.conversation = String(object.conversation); + switch (object.source) { + default: + if (typeof object.source === "number") { + message.source = object.source; + break; + } + break; + case "SOURCE_UNSPECIFIED": + case 0: + message.source = 0; + break; + case "LIVE": + case 1: + message.source = 1; + break; + case "SIMULATOR": + case 2: + message.source = 2; + break; + case "EVAL": + case 3: + message.source = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a GenerateEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.GenerateEvaluationRequest} message GenerateEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateEvaluationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.conversation = ""; + object.source = options.enums === String ? "SOURCE_UNSPECIFIED" : 0; + } + if (message.conversation != null && message.hasOwnProperty("conversation")) + object.conversation = message.conversation; + if (message.source != null && message.hasOwnProperty("source")) + object.source = options.enums === String ? $root.google.cloud.ces.v1beta.Conversation.Source[message.source] === undefined ? message.source : $root.google.cloud.ces.v1beta.Conversation.Source[message.source] : message.source; + return object; + }; + + /** + * Converts this GenerateEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateEvaluationRequest"; + }; + + return GenerateEvaluationRequest; + })(); + + v1beta.ImportEvaluationsRequest = (function() { + + /** + * Properties of an ImportEvaluationsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IImportEvaluationsRequest + * @property {google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList|null} [conversationList] ImportEvaluationsRequest conversationList + * @property {string|null} [gcsUri] ImportEvaluationsRequest gcsUri + * @property {Uint8Array|null} [csvContent] ImportEvaluationsRequest csvContent + * @property {string|null} [parent] ImportEvaluationsRequest parent + * @property {google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions|null} [importOptions] ImportEvaluationsRequest importOptions + */ + + /** + * Constructs a new ImportEvaluationsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ImportEvaluationsRequest. + * @implements IImportEvaluationsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IImportEvaluationsRequest=} [properties] Properties to set + */ + function ImportEvaluationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportEvaluationsRequest conversationList. + * @member {google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList|null|undefined} conversationList + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @instance + */ + ImportEvaluationsRequest.prototype.conversationList = null; + + /** + * ImportEvaluationsRequest gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @instance + */ + ImportEvaluationsRequest.prototype.gcsUri = null; + + /** + * ImportEvaluationsRequest csvContent. + * @member {Uint8Array|null|undefined} csvContent + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @instance + */ + ImportEvaluationsRequest.prototype.csvContent = null; + + /** + * ImportEvaluationsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @instance + */ + ImportEvaluationsRequest.prototype.parent = ""; + + /** + * ImportEvaluationsRequest importOptions. + * @member {google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions|null|undefined} importOptions + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @instance + */ + ImportEvaluationsRequest.prototype.importOptions = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportEvaluationsRequest source. + * @member {"conversationList"|"gcsUri"|"csvContent"|undefined} source + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @instance + */ + Object.defineProperty(ImportEvaluationsRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["conversationList", "gcsUri", "csvContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportEvaluationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @static + * @param {google.cloud.ces.v1beta.IImportEvaluationsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest} ImportEvaluationsRequest instance + */ + ImportEvaluationsRequest.create = function create(properties) { + return new ImportEvaluationsRequest(properties); + }; + + /** + * Encodes the specified ImportEvaluationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @static + * @param {google.cloud.ces.v1beta.IImportEvaluationsRequest} message ImportEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEvaluationsRequest.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.conversationList != null && Object.hasOwnProperty.call(message, "conversationList")) + $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.encode(message.conversationList, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsUri); + if (message.csvContent != null && Object.hasOwnProperty.call(message, "csvContent")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.csvContent); + if (message.importOptions != null && Object.hasOwnProperty.call(message, "importOptions")) + $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.encode(message.importOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @static + * @param {google.cloud.ces.v1beta.IImportEvaluationsRequest} message ImportEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEvaluationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportEvaluationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest} ImportEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEvaluationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportEvaluationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.conversationList = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.decode(reader, reader.uint32()); + break; + } + case 3: { + message.gcsUri = reader.string(); + break; + } + case 4: { + message.csvContent = reader.bytes(); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 5: { + message.importOptions = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportEvaluationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest} ImportEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEvaluationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportEvaluationsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportEvaluationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.conversationList != null && message.hasOwnProperty("conversationList")) { + properties.source = 1; + { + var error = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.verify(message.conversationList); + if (error) + return "conversationList." + error; + } + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + if (message.csvContent != null && message.hasOwnProperty("csvContent")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!(message.csvContent && typeof message.csvContent.length === "number" || $util.isString(message.csvContent))) + return "csvContent: buffer expected"; + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.importOptions != null && message.hasOwnProperty("importOptions")) { + var error = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.verify(message.importOptions); + if (error) + return "importOptions." + error; + } + return null; + }; + + /** + * Creates an ImportEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest} ImportEvaluationsRequest + */ + ImportEvaluationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ImportEvaluationsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ImportEvaluationsRequest(); + if (object.conversationList != null) { + if (typeof object.conversationList !== "object") + throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsRequest.conversationList: object expected"); + message.conversationList = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.fromObject(object.conversationList); + } + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.csvContent != null) + if (typeof object.csvContent === "string") + $util.base64.decode(object.csvContent, message.csvContent = $util.newBuffer($util.base64.length(object.csvContent)), 0); + else if (object.csvContent.length >= 0) + message.csvContent = object.csvContent; + if (object.parent != null) + message.parent = String(object.parent); + if (object.importOptions != null) { + if (typeof object.importOptions !== "object") + throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsRequest.importOptions: object expected"); + message.importOptions = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.fromObject(object.importOptions); + } + return message; + }; + + /** + * Creates a plain object from an ImportEvaluationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest} message ImportEvaluationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportEvaluationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.importOptions = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.conversationList != null && message.hasOwnProperty("conversationList")) { + object.conversationList = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.toObject(message.conversationList, options); + if (options.oneofs) + object.source = "conversationList"; + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.source = "gcsUri"; + } + if (message.csvContent != null && message.hasOwnProperty("csvContent")) { + object.csvContent = options.bytes === String ? $util.base64.encode(message.csvContent, 0, message.csvContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.csvContent) : message.csvContent; + if (options.oneofs) + object.source = "csvContent"; + } + if (message.importOptions != null && message.hasOwnProperty("importOptions")) + object.importOptions = $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.toObject(message.importOptions, options); + return object; + }; + + /** + * Converts this ImportEvaluationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @instance + * @returns {Object.} JSON object + */ + ImportEvaluationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportEvaluationsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportEvaluationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportEvaluationsRequest"; + }; + + ImportEvaluationsRequest.ConversationList = (function() { + + /** + * Properties of a ConversationList. + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @interface IConversationList + * @property {Array.|null} [conversations] ConversationList conversations + */ + + /** + * Constructs a new ConversationList. + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @classdesc Represents a ConversationList. + * @implements IConversationList + * @constructor + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList=} [properties] Properties to set + */ + function ConversationList(properties) { + this.conversations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConversationList conversations. + * @member {Array.} conversations + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @instance + */ + ConversationList.prototype.conversations = $util.emptyArray; + + /** + * Creates a new ConversationList instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList} ConversationList instance + */ + ConversationList.create = function create(properties) { + return new ConversationList(properties); + }; + + /** + * Encodes the specified ConversationList message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList} message ConversationList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversations != null && message.conversations.length) + for (var i = 0; i < message.conversations.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversations[i]); + return writer; + }; + + /** + * Encodes the specified ConversationList message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IConversationList} message ConversationList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConversationList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList} ConversationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationList.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.conversations && message.conversations.length)) + message.conversations = []; + message.conversations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConversationList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList} ConversationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConversationList message. + * @function verify + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConversationList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conversations != null && message.hasOwnProperty("conversations")) { + if (!Array.isArray(message.conversations)) + return "conversations: array expected"; + for (var i = 0; i < message.conversations.length; ++i) + if (!$util.isString(message.conversations[i])) + return "conversations: string[] expected"; + } + return null; + }; + + /** + * Creates a ConversationList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList} ConversationList + */ + ConversationList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList) + return object; + var message = new $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList(); + if (object.conversations) { + if (!Array.isArray(object.conversations)) + throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList.conversations: array expected"); + message.conversations = []; + for (var i = 0; i < object.conversations.length; ++i) + message.conversations[i] = String(object.conversations[i]); + } + return message; + }; + + /** + * Creates a plain object from a ConversationList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList} message ConversationList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConversationList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conversations = []; + if (message.conversations && message.conversations.length) { + object.conversations = []; + for (var j = 0; j < message.conversations.length; ++j) + object.conversations[j] = message.conversations[j]; + } + return object; + }; + + /** + * Converts this ConversationList to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @instance + * @returns {Object.} JSON object + */ + ConversationList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConversationList + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConversationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportEvaluationsRequest.ConversationList"; + }; + + return ConversationList; + })(); + + ImportEvaluationsRequest.ImportOptions = (function() { + + /** + * Properties of an ImportOptions. + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @interface IImportOptions + * @property {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy|null} [conflictResolutionStrategy] ImportOptions conflictResolutionStrategy + */ + + /** + * Constructs a new ImportOptions. + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest + * @classdesc Represents an ImportOptions. + * @implements IImportOptions + * @constructor + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions=} [properties] Properties to set + */ + function ImportOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportOptions conflictResolutionStrategy. + * @member {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy} conflictResolutionStrategy + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @instance + */ + ImportOptions.prototype.conflictResolutionStrategy = 0; + + /** + * Creates a new ImportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions} ImportOptions instance + */ + ImportOptions.create = function create(properties) { + return new ImportOptions(properties); + }; + + /** + * Encodes the specified ImportOptions message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions} message ImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conflictResolutionStrategy != null && Object.hasOwnProperty.call(message, "conflictResolutionStrategy")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.conflictResolutionStrategy); + return writer; + }; + + /** + * Encodes the specified ImportOptions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.IImportOptions} message ImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions} ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.conflictResolutionStrategy = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions} ImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportOptions message. + * @function verify + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conflictResolutionStrategy != null && message.hasOwnProperty("conflictResolutionStrategy")) + switch (message.conflictResolutionStrategy) { + default: + return "conflictResolutionStrategy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an ImportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions} ImportOptions + */ + ImportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions) + return object; + var message = new $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions(); + switch (object.conflictResolutionStrategy) { + default: + if (typeof object.conflictResolutionStrategy === "number") { + message.conflictResolutionStrategy = object.conflictResolutionStrategy; + break; + } + break; + case "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED": + case 0: + message.conflictResolutionStrategy = 0; + break; + case "OVERWRITE": + case 1: + message.conflictResolutionStrategy = 1; + break; + case "SKIP": + case 2: + message.conflictResolutionStrategy = 2; + break; + case "DUPLICATE": + case 3: + message.conflictResolutionStrategy = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an ImportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions} message ImportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.conflictResolutionStrategy = options.enums === String ? "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED" : 0; + if (message.conflictResolutionStrategy != null && message.hasOwnProperty("conflictResolutionStrategy")) + object.conflictResolutionStrategy = options.enums === String ? $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy[message.conflictResolutionStrategy] === undefined ? message.conflictResolutionStrategy : $root.google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy[message.conflictResolutionStrategy] : message.conflictResolutionStrategy; + return object; + }; + + /** + * Converts this ImportOptions to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @instance + * @returns {Object.} JSON object + */ + ImportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportOptions + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions"; + }; + + /** + * ConflictResolutionStrategy enum. + * @name google.cloud.ces.v1beta.ImportEvaluationsRequest.ImportOptions.ConflictResolutionStrategy + * @enum {number} + * @property {number} CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED=0 CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED value + * @property {number} OVERWRITE=1 OVERWRITE value + * @property {number} SKIP=2 SKIP value + * @property {number} DUPLICATE=3 DUPLICATE value + */ + ImportOptions.ConflictResolutionStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "OVERWRITE"] = 1; + values[valuesById[2] = "SKIP"] = 2; + values[valuesById[3] = "DUPLICATE"] = 3; + return values; + })(); + + return ImportOptions; + })(); + + return ImportEvaluationsRequest; + })(); + + v1beta.ImportEvaluationsResponse = (function() { + + /** + * Properties of an ImportEvaluationsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IImportEvaluationsResponse + * @property {Array.|null} [evaluations] ImportEvaluationsResponse evaluations + * @property {Array.|null} [errorMessages] ImportEvaluationsResponse errorMessages + * @property {number|null} [importFailureCount] ImportEvaluationsResponse importFailureCount + */ + + /** + * Constructs a new ImportEvaluationsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ImportEvaluationsResponse. + * @implements IImportEvaluationsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IImportEvaluationsResponse=} [properties] Properties to set + */ + function ImportEvaluationsResponse(properties) { + this.evaluations = []; + this.errorMessages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportEvaluationsResponse evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @instance + */ + ImportEvaluationsResponse.prototype.evaluations = $util.emptyArray; + + /** + * ImportEvaluationsResponse errorMessages. + * @member {Array.} errorMessages + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @instance + */ + ImportEvaluationsResponse.prototype.errorMessages = $util.emptyArray; + + /** + * ImportEvaluationsResponse importFailureCount. + * @member {number} importFailureCount + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @instance + */ + ImportEvaluationsResponse.prototype.importFailureCount = 0; + + /** + * Creates a new ImportEvaluationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @static + * @param {google.cloud.ces.v1beta.IImportEvaluationsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ImportEvaluationsResponse} ImportEvaluationsResponse instance + */ + ImportEvaluationsResponse.create = function create(properties) { + return new ImportEvaluationsResponse(properties); + }; + + /** + * Encodes the specified ImportEvaluationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @static + * @param {google.cloud.ces.v1beta.IImportEvaluationsResponse} message ImportEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEvaluationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + $root.google.cloud.ces.v1beta.Evaluation.encode(message.evaluations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.errorMessages != null && message.errorMessages.length) + for (var i = 0; i < message.errorMessages.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessages[i]); + if (message.importFailureCount != null && Object.hasOwnProperty.call(message, "importFailureCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.importFailureCount); + return writer; + }; + + /** + * Encodes the specified ImportEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @static + * @param {google.cloud.ces.v1beta.IImportEvaluationsResponse} message ImportEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEvaluationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportEvaluationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ImportEvaluationsResponse} ImportEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEvaluationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportEvaluationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push($root.google.cloud.ces.v1beta.Evaluation.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.errorMessages && message.errorMessages.length)) + message.errorMessages = []; + message.errorMessages.push(reader.string()); + break; + } + case 3: { + message.importFailureCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportEvaluationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ImportEvaluationsResponse} ImportEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEvaluationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportEvaluationsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportEvaluationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Evaluation.verify(message.evaluations[i]); + if (error) + return "evaluations." + error; + } + } + if (message.errorMessages != null && message.hasOwnProperty("errorMessages")) { + if (!Array.isArray(message.errorMessages)) + return "errorMessages: array expected"; + for (var i = 0; i < message.errorMessages.length; ++i) + if (!$util.isString(message.errorMessages[i])) + return "errorMessages: string[] expected"; + } + if (message.importFailureCount != null && message.hasOwnProperty("importFailureCount")) + if (!$util.isInteger(message.importFailureCount)) + return "importFailureCount: integer expected"; + return null; + }; + + /** + * Creates an ImportEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ImportEvaluationsResponse} ImportEvaluationsResponse + */ + ImportEvaluationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ImportEvaluationsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ImportEvaluationsResponse(); + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsResponse.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) { + if (typeof object.evaluations[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsResponse.evaluations: object expected"); + message.evaluations[i] = $root.google.cloud.ces.v1beta.Evaluation.fromObject(object.evaluations[i]); + } + } + if (object.errorMessages) { + if (!Array.isArray(object.errorMessages)) + throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsResponse.errorMessages: array expected"); + message.errorMessages = []; + for (var i = 0; i < object.errorMessages.length; ++i) + message.errorMessages[i] = String(object.errorMessages[i]); + } + if (object.importFailureCount != null) + message.importFailureCount = object.importFailureCount | 0; + return message; + }; + + /** + * Creates a plain object from an ImportEvaluationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsResponse} message ImportEvaluationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportEvaluationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.evaluations = []; + object.errorMessages = []; + } + if (options.defaults) + object.importFailureCount = 0; + if (message.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = $root.google.cloud.ces.v1beta.Evaluation.toObject(message.evaluations[j], options); + } + if (message.errorMessages && message.errorMessages.length) { + object.errorMessages = []; + for (var j = 0; j < message.errorMessages.length; ++j) + object.errorMessages[j] = message.errorMessages[j]; + } + if (message.importFailureCount != null && message.hasOwnProperty("importFailureCount")) + object.importFailureCount = message.importFailureCount; + return object; + }; + + /** + * Converts this ImportEvaluationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @instance + * @returns {Object.} JSON object + */ + ImportEvaluationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportEvaluationsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ImportEvaluationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportEvaluationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportEvaluationsResponse"; + }; + + return ImportEvaluationsResponse; + })(); + + v1beta.ImportEvaluationsOperationMetadata = (function() { + + /** + * Properties of an ImportEvaluationsOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @interface IImportEvaluationsOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] ImportEvaluationsOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] ImportEvaluationsOperationMetadata endTime + * @property {string|null} [statusMessage] ImportEvaluationsOperationMetadata statusMessage + */ + + /** + * Constructs a new ImportEvaluationsOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ImportEvaluationsOperationMetadata. + * @implements IImportEvaluationsOperationMetadata + * @constructor + * @param {google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata=} [properties] Properties to set + */ + function ImportEvaluationsOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportEvaluationsOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @instance + */ + ImportEvaluationsOperationMetadata.prototype.createTime = null; + + /** + * ImportEvaluationsOperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @instance + */ + ImportEvaluationsOperationMetadata.prototype.endTime = null; + + /** + * ImportEvaluationsOperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @instance + */ + ImportEvaluationsOperationMetadata.prototype.statusMessage = ""; + + /** + * Creates a new ImportEvaluationsOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata} ImportEvaluationsOperationMetadata instance + */ + ImportEvaluationsOperationMetadata.create = function create(properties) { + return new ImportEvaluationsOperationMetadata(properties); + }; + + /** + * Encodes the specified ImportEvaluationsOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata} message ImportEvaluationsOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEvaluationsOperationMetadata.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.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.statusMessage); + return writer; + }; + + /** + * Encodes the specified ImportEvaluationsOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IImportEvaluationsOperationMetadata} message ImportEvaluationsOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEvaluationsOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportEvaluationsOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata} ImportEvaluationsOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEvaluationsOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + 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.statusMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportEvaluationsOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata} ImportEvaluationsOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEvaluationsOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportEvaluationsOperationMetadata message. + * @function verify + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportEvaluationsOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + return null; + }; + + /** + * Creates an ImportEvaluationsOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata} ImportEvaluationsOperationMetadata + */ + ImportEvaluationsOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata) + return object; + var message = new $root.google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata.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.ces.v1beta.ImportEvaluationsOperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + return message; + }; + + /** + * Creates a plain object from an ImportEvaluationsOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata} message ImportEvaluationsOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportEvaluationsOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.statusMessage = ""; + } + 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.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + return object; + }; + + /** + * Converts this ImportEvaluationsOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportEvaluationsOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportEvaluationsOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportEvaluationsOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ImportEvaluationsOperationMetadata"; + }; + + return ImportEvaluationsOperationMetadata; + })(); + + v1beta.CreateEvaluationDatasetRequest = (function() { + + /** + * Properties of a CreateEvaluationDatasetRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateEvaluationDatasetRequest + * @property {string|null} [parent] CreateEvaluationDatasetRequest parent + * @property {string|null} [evaluationDatasetId] CreateEvaluationDatasetRequest evaluationDatasetId + * @property {google.cloud.ces.v1beta.IEvaluationDataset|null} [evaluationDataset] CreateEvaluationDatasetRequest evaluationDataset + */ + + /** + * Constructs a new CreateEvaluationDatasetRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateEvaluationDatasetRequest. + * @implements ICreateEvaluationDatasetRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest=} [properties] Properties to set + */ + function CreateEvaluationDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEvaluationDatasetRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @instance + */ + CreateEvaluationDatasetRequest.prototype.parent = ""; + + /** + * CreateEvaluationDatasetRequest evaluationDatasetId. + * @member {string} evaluationDatasetId + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @instance + */ + CreateEvaluationDatasetRequest.prototype.evaluationDatasetId = ""; + + /** + * CreateEvaluationDatasetRequest evaluationDataset. + * @member {google.cloud.ces.v1beta.IEvaluationDataset|null|undefined} evaluationDataset + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @instance + */ + CreateEvaluationDatasetRequest.prototype.evaluationDataset = null; + + /** + * Creates a new CreateEvaluationDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateEvaluationDatasetRequest} CreateEvaluationDatasetRequest instance + */ + CreateEvaluationDatasetRequest.create = function create(properties) { + return new CreateEvaluationDatasetRequest(properties); + }; + + /** + * Encodes the specified CreateEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest} message CreateEvaluationDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEvaluationDatasetRequest.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.evaluationDatasetId != null && Object.hasOwnProperty.call(message, "evaluationDatasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluationDatasetId); + if (message.evaluationDataset != null && Object.hasOwnProperty.call(message, "evaluationDataset")) + $root.google.cloud.ces.v1beta.EvaluationDataset.encode(message.evaluationDataset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateEvaluationDatasetRequest} message CreateEvaluationDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEvaluationDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEvaluationDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateEvaluationDatasetRequest} CreateEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEvaluationDatasetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.evaluationDatasetId = reader.string(); + break; + } + case 3: { + message.evaluationDataset = $root.google.cloud.ces.v1beta.EvaluationDataset.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEvaluationDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateEvaluationDatasetRequest} CreateEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEvaluationDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEvaluationDatasetRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEvaluationDatasetRequest.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.evaluationDatasetId != null && message.hasOwnProperty("evaluationDatasetId")) + if (!$util.isString(message.evaluationDatasetId)) + return "evaluationDatasetId: string expected"; + if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) { + var error = $root.google.cloud.ces.v1beta.EvaluationDataset.verify(message.evaluationDataset); + if (error) + return "evaluationDataset." + error; + } + return null; + }; + + /** + * Creates a CreateEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateEvaluationDatasetRequest} CreateEvaluationDatasetRequest + */ + CreateEvaluationDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateEvaluationDatasetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.evaluationDatasetId != null) + message.evaluationDatasetId = String(object.evaluationDatasetId); + if (object.evaluationDataset != null) { + if (typeof object.evaluationDataset !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateEvaluationDatasetRequest.evaluationDataset: object expected"); + message.evaluationDataset = $root.google.cloud.ces.v1beta.EvaluationDataset.fromObject(object.evaluationDataset); + } + return message; + }; + + /** + * Creates a plain object from a CreateEvaluationDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.CreateEvaluationDatasetRequest} message CreateEvaluationDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEvaluationDatasetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.evaluationDatasetId = ""; + object.evaluationDataset = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.evaluationDatasetId != null && message.hasOwnProperty("evaluationDatasetId")) + object.evaluationDatasetId = message.evaluationDatasetId; + if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) + object.evaluationDataset = $root.google.cloud.ces.v1beta.EvaluationDataset.toObject(message.evaluationDataset, options); + return object; + }; + + /** + * Converts this CreateEvaluationDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEvaluationDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEvaluationDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateEvaluationDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEvaluationDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateEvaluationDatasetRequest"; + }; + + return CreateEvaluationDatasetRequest; + })(); + + v1beta.UpdateEvaluationRequest = (function() { + + /** + * Properties of an UpdateEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateEvaluationRequest + * @property {google.cloud.ces.v1beta.IEvaluation|null} [evaluation] UpdateEvaluationRequest evaluation + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEvaluationRequest updateMask + */ + + /** + * Constructs a new UpdateEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateEvaluationRequest. + * @implements IUpdateEvaluationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateEvaluationRequest=} [properties] Properties to set + */ + function UpdateEvaluationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateEvaluationRequest evaluation. + * @member {google.cloud.ces.v1beta.IEvaluation|null|undefined} evaluation + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @instance + */ + UpdateEvaluationRequest.prototype.evaluation = null; + + /** + * UpdateEvaluationRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @instance + */ + UpdateEvaluationRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateEvaluationRequest} UpdateEvaluationRequest instance + */ + UpdateEvaluationRequest.create = function create(properties) { + return new UpdateEvaluationRequest(properties); + }; + + /** + * Encodes the specified UpdateEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateEvaluationRequest} message UpdateEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEvaluationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluation != null && Object.hasOwnProperty.call(message, "evaluation")) + $root.google.cloud.ces.v1beta.Evaluation.encode(message.evaluation, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateEvaluationRequest} message UpdateEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateEvaluationRequest} UpdateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEvaluationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateEvaluationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.evaluation = $root.google.cloud.ces.v1beta.Evaluation.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateEvaluationRequest} UpdateEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEvaluationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEvaluationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluation != null && message.hasOwnProperty("evaluation")) { + var error = $root.google.cloud.ces.v1beta.Evaluation.verify(message.evaluation); + if (error) + return "evaluation." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateEvaluationRequest} UpdateEvaluationRequest + */ + UpdateEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateEvaluationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateEvaluationRequest(); + if (object.evaluation != null) { + if (typeof object.evaluation !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateEvaluationRequest.evaluation: object expected"); + message.evaluation = $root.google.cloud.ces.v1beta.Evaluation.fromObject(object.evaluation); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateEvaluationRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateEvaluationRequest} message UpdateEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEvaluationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.evaluation = null; + object.updateMask = null; + } + if (message.evaluation != null && message.hasOwnProperty("evaluation")) + object.evaluation = $root.google.cloud.ces.v1beta.Evaluation.toObject(message.evaluation, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateEvaluationRequest"; + }; + + return UpdateEvaluationRequest; + })(); + + v1beta.UpdateEvaluationDatasetRequest = (function() { + + /** + * Properties of an UpdateEvaluationDatasetRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateEvaluationDatasetRequest + * @property {google.cloud.ces.v1beta.IEvaluationDataset|null} [evaluationDataset] UpdateEvaluationDatasetRequest evaluationDataset + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEvaluationDatasetRequest updateMask + */ + + /** + * Constructs a new UpdateEvaluationDatasetRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateEvaluationDatasetRequest. + * @implements IUpdateEvaluationDatasetRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest=} [properties] Properties to set + */ + function UpdateEvaluationDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateEvaluationDatasetRequest evaluationDataset. + * @member {google.cloud.ces.v1beta.IEvaluationDataset|null|undefined} evaluationDataset + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @instance + */ + UpdateEvaluationDatasetRequest.prototype.evaluationDataset = null; + + /** + * UpdateEvaluationDatasetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @instance + */ + UpdateEvaluationDatasetRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateEvaluationDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest} UpdateEvaluationDatasetRequest instance + */ + UpdateEvaluationDatasetRequest.create = function create(properties) { + return new UpdateEvaluationDatasetRequest(properties); + }; + + /** + * Encodes the specified UpdateEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest} message UpdateEvaluationDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEvaluationDatasetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationDataset != null && Object.hasOwnProperty.call(message, "evaluationDataset")) + $root.google.cloud.ces.v1beta.EvaluationDataset.encode(message.evaluationDataset, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateEvaluationDatasetRequest} message UpdateEvaluationDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEvaluationDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEvaluationDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest} UpdateEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEvaluationDatasetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.evaluationDataset = $root.google.cloud.ces.v1beta.EvaluationDataset.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateEvaluationDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest} UpdateEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEvaluationDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEvaluationDatasetRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEvaluationDatasetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) { + var error = $root.google.cloud.ces.v1beta.EvaluationDataset.verify(message.evaluationDataset); + if (error) + return "evaluationDataset." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest} UpdateEvaluationDatasetRequest + */ + UpdateEvaluationDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest(); + if (object.evaluationDataset != null) { + if (typeof object.evaluationDataset !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest.evaluationDataset: object expected"); + message.evaluationDataset = $root.google.cloud.ces.v1beta.EvaluationDataset.fromObject(object.evaluationDataset); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateEvaluationDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest} message UpdateEvaluationDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEvaluationDatasetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.evaluationDataset = null; + object.updateMask = null; + } + if (message.evaluationDataset != null && message.hasOwnProperty("evaluationDataset")) + object.evaluationDataset = $root.google.cloud.ces.v1beta.EvaluationDataset.toObject(message.evaluationDataset, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateEvaluationDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEvaluationDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEvaluationDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEvaluationDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateEvaluationDatasetRequest"; + }; + + return UpdateEvaluationDatasetRequest; + })(); + + v1beta.DeleteEvaluationRequest = (function() { + + /** + * Properties of a DeleteEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteEvaluationRequest + * @property {string|null} [name] DeleteEvaluationRequest name + * @property {boolean|null} [force] DeleteEvaluationRequest force + * @property {string|null} [etag] DeleteEvaluationRequest etag + */ + + /** + * Constructs a new DeleteEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteEvaluationRequest. + * @implements IDeleteEvaluationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRequest=} [properties] Properties to set + */ + function DeleteEvaluationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEvaluationRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @instance + */ + DeleteEvaluationRequest.prototype.name = ""; + + /** + * DeleteEvaluationRequest force. + * @member {boolean} force + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @instance + */ + DeleteEvaluationRequest.prototype.force = false; + + /** + * DeleteEvaluationRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @instance + */ + DeleteEvaluationRequest.prototype.etag = ""; + + /** + * Creates a new DeleteEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRequest} DeleteEvaluationRequest instance + */ + DeleteEvaluationRequest.create = function create(properties) { + return new DeleteEvaluationRequest(properties); + }; + + /** + * Encodes the specified DeleteEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRequest} message DeleteEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRequest} message DeleteEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRequest} DeleteEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteEvaluationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRequest} DeleteEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEvaluationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEvaluationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRequest} DeleteEvaluationRequest + */ + DeleteEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteEvaluationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteEvaluationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteEvaluationRequest} message DeleteEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEvaluationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteEvaluationRequest"; + }; + + return DeleteEvaluationRequest; + })(); + + v1beta.DeleteEvaluationResultRequest = (function() { + + /** + * Properties of a DeleteEvaluationResultRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteEvaluationResultRequest + * @property {string|null} [name] DeleteEvaluationResultRequest name + */ + + /** + * Constructs a new DeleteEvaluationResultRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteEvaluationResultRequest. + * @implements IDeleteEvaluationResultRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteEvaluationResultRequest=} [properties] Properties to set + */ + function DeleteEvaluationResultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEvaluationResultRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @instance + */ + DeleteEvaluationResultRequest.prototype.name = ""; + + /** + * Creates a new DeleteEvaluationResultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationResultRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteEvaluationResultRequest} DeleteEvaluationResultRequest instance + */ + DeleteEvaluationResultRequest.create = function create(properties) { + return new DeleteEvaluationResultRequest(properties); + }; + + /** + * Encodes the specified DeleteEvaluationResultRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationResultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationResultRequest} message DeleteEvaluationResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationResultRequest.encode = function encode(message, writer) { + 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 DeleteEvaluationResultRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationResultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationResultRequest} message DeleteEvaluationResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationResultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEvaluationResultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteEvaluationResultRequest} DeleteEvaluationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationResultRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteEvaluationResultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEvaluationResultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteEvaluationResultRequest} DeleteEvaluationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationResultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEvaluationResultRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEvaluationResultRequest.verify = function verify(message) { + if (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 DeleteEvaluationResultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteEvaluationResultRequest} DeleteEvaluationResultRequest + */ + DeleteEvaluationResultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteEvaluationResultRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteEvaluationResultRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteEvaluationResultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteEvaluationResultRequest} message DeleteEvaluationResultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEvaluationResultRequest.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 DeleteEvaluationResultRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEvaluationResultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEvaluationResultRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteEvaluationResultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEvaluationResultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteEvaluationResultRequest"; + }; + + return DeleteEvaluationResultRequest; + })(); + + v1beta.DeleteEvaluationDatasetRequest = (function() { + + /** + * Properties of a DeleteEvaluationDatasetRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteEvaluationDatasetRequest + * @property {string|null} [name] DeleteEvaluationDatasetRequest name + * @property {string|null} [etag] DeleteEvaluationDatasetRequest etag + */ + + /** + * Constructs a new DeleteEvaluationDatasetRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteEvaluationDatasetRequest. + * @implements IDeleteEvaluationDatasetRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest=} [properties] Properties to set + */ + function DeleteEvaluationDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEvaluationDatasetRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @instance + */ + DeleteEvaluationDatasetRequest.prototype.name = ""; + + /** + * DeleteEvaluationDatasetRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @instance + */ + DeleteEvaluationDatasetRequest.prototype.etag = ""; + + /** + * Creates a new DeleteEvaluationDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest} DeleteEvaluationDatasetRequest instance + */ + DeleteEvaluationDatasetRequest.create = function create(properties) { + return new DeleteEvaluationDatasetRequest(properties); + }; + + /** + * Encodes the specified DeleteEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest} message DeleteEvaluationDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationDatasetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationDatasetRequest} message DeleteEvaluationDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEvaluationDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest} DeleteEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationDatasetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEvaluationDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest} DeleteEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEvaluationDatasetRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEvaluationDatasetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest} DeleteEvaluationDatasetRequest + */ + DeleteEvaluationDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteEvaluationDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest} message DeleteEvaluationDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEvaluationDatasetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteEvaluationDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEvaluationDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEvaluationDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEvaluationDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteEvaluationDatasetRequest"; + }; + + return DeleteEvaluationDatasetRequest; + })(); + + v1beta.DeleteEvaluationRunRequest = (function() { + + /** + * Properties of a DeleteEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteEvaluationRunRequest + * @property {string|null} [name] DeleteEvaluationRunRequest name + */ + + /** + * Constructs a new DeleteEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteEvaluationRunRequest. + * @implements IDeleteEvaluationRunRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunRequest=} [properties] Properties to set + */ + function DeleteEvaluationRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEvaluationRunRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @instance + */ + DeleteEvaluationRunRequest.prototype.name = ""; + + /** + * Creates a new DeleteEvaluationRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunRequest} DeleteEvaluationRunRequest instance + */ + DeleteEvaluationRunRequest.create = function create(properties) { + return new DeleteEvaluationRunRequest(properties); + }; + + /** + * Encodes the specified DeleteEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunRequest} message DeleteEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationRunRequest.encode = function encode(message, writer) { + 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 DeleteEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationRunRequest} message DeleteEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEvaluationRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunRequest} DeleteEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationRunRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteEvaluationRunRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunRequest} DeleteEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEvaluationRunRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEvaluationRunRequest.verify = function verify(message) { + if (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 DeleteEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteEvaluationRunRequest} DeleteEvaluationRunRequest + */ + DeleteEvaluationRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteEvaluationRunRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteEvaluationRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteEvaluationRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteEvaluationRunRequest} message DeleteEvaluationRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEvaluationRunRequest.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 DeleteEvaluationRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEvaluationRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEvaluationRunRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteEvaluationRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEvaluationRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteEvaluationRunRequest"; + }; + + return DeleteEvaluationRunRequest; + })(); + + v1beta.GetEvaluationRequest = (function() { + + /** + * Properties of a GetEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetEvaluationRequest + * @property {string|null} [name] GetEvaluationRequest name + */ + + /** + * Constructs a new GetEvaluationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetEvaluationRequest. + * @implements IGetEvaluationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetEvaluationRequest=} [properties] Properties to set + */ + function GetEvaluationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvaluationRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @instance + */ + GetEvaluationRequest.prototype.name = ""; + + /** + * Creates a new GetEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetEvaluationRequest} GetEvaluationRequest instance + */ + GetEvaluationRequest.create = function create(properties) { + return new GetEvaluationRequest(properties); + }; + + /** + * Encodes the specified GetEvaluationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationRequest} message GetEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationRequest.encode = function encode(message, writer) { + 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 GetEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationRequest} message GetEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetEvaluationRequest} GetEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetEvaluationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetEvaluationRequest} GetEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvaluationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvaluationRequest.verify = function verify(message) { + if (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 GetEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetEvaluationRequest} GetEvaluationRequest + */ + GetEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetEvaluationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetEvaluationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @static + * @param {google.cloud.ces.v1beta.GetEvaluationRequest} message GetEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvaluationRequest.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 GetEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetEvaluationRequest"; + }; + + return GetEvaluationRequest; + })(); + + v1beta.GetEvaluationResultRequest = (function() { + + /** + * Properties of a GetEvaluationResultRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetEvaluationResultRequest + * @property {string|null} [name] GetEvaluationResultRequest name + */ + + /** + * Constructs a new GetEvaluationResultRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetEvaluationResultRequest. + * @implements IGetEvaluationResultRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetEvaluationResultRequest=} [properties] Properties to set + */ + function GetEvaluationResultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvaluationResultRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @instance + */ + GetEvaluationResultRequest.prototype.name = ""; + + /** + * Creates a new GetEvaluationResultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationResultRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetEvaluationResultRequest} GetEvaluationResultRequest instance + */ + GetEvaluationResultRequest.create = function create(properties) { + return new GetEvaluationResultRequest(properties); + }; + + /** + * Encodes the specified GetEvaluationResultRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationResultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationResultRequest} message GetEvaluationResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationResultRequest.encode = function encode(message, writer) { + 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 GetEvaluationResultRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationResultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationResultRequest} message GetEvaluationResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationResultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvaluationResultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetEvaluationResultRequest} GetEvaluationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationResultRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetEvaluationResultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvaluationResultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetEvaluationResultRequest} GetEvaluationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationResultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvaluationResultRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvaluationResultRequest.verify = function verify(message) { + if (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 GetEvaluationResultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetEvaluationResultRequest} GetEvaluationResultRequest + */ + GetEvaluationResultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetEvaluationResultRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetEvaluationResultRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEvaluationResultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @static + * @param {google.cloud.ces.v1beta.GetEvaluationResultRequest} message GetEvaluationResultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvaluationResultRequest.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 GetEvaluationResultRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvaluationResultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEvaluationResultRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetEvaluationResultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEvaluationResultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetEvaluationResultRequest"; + }; + + return GetEvaluationResultRequest; + })(); + + v1beta.GetEvaluationDatasetRequest = (function() { + + /** + * Properties of a GetEvaluationDatasetRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetEvaluationDatasetRequest + * @property {string|null} [name] GetEvaluationDatasetRequest name + */ + + /** + * Constructs a new GetEvaluationDatasetRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetEvaluationDatasetRequest. + * @implements IGetEvaluationDatasetRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetEvaluationDatasetRequest=} [properties] Properties to set + */ + function GetEvaluationDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvaluationDatasetRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @instance + */ + GetEvaluationDatasetRequest.prototype.name = ""; + + /** + * Creates a new GetEvaluationDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetEvaluationDatasetRequest} GetEvaluationDatasetRequest instance + */ + GetEvaluationDatasetRequest.create = function create(properties) { + return new GetEvaluationDatasetRequest(properties); + }; + + /** + * Encodes the specified GetEvaluationDatasetRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationDatasetRequest} message GetEvaluationDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationDatasetRequest.encode = function encode(message, writer) { + 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 GetEvaluationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationDatasetRequest} message GetEvaluationDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvaluationDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetEvaluationDatasetRequest} GetEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationDatasetRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetEvaluationDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvaluationDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetEvaluationDatasetRequest} GetEvaluationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvaluationDatasetRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvaluationDatasetRequest.verify = function verify(message) { + if (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 GetEvaluationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetEvaluationDatasetRequest} GetEvaluationDatasetRequest + */ + GetEvaluationDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetEvaluationDatasetRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetEvaluationDatasetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEvaluationDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @static + * @param {google.cloud.ces.v1beta.GetEvaluationDatasetRequest} message GetEvaluationDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvaluationDatasetRequest.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 GetEvaluationDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvaluationDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEvaluationDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetEvaluationDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEvaluationDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetEvaluationDatasetRequest"; + }; + + return GetEvaluationDatasetRequest; + })(); + + v1beta.GetEvaluationRunRequest = (function() { + + /** + * Properties of a GetEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetEvaluationRunRequest + * @property {string|null} [name] GetEvaluationRunRequest name + */ + + /** + * Constructs a new GetEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetEvaluationRunRequest. + * @implements IGetEvaluationRunRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetEvaluationRunRequest=} [properties] Properties to set + */ + function GetEvaluationRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvaluationRunRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @instance + */ + GetEvaluationRunRequest.prototype.name = ""; + + /** + * Creates a new GetEvaluationRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationRunRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetEvaluationRunRequest} GetEvaluationRunRequest instance + */ + GetEvaluationRunRequest.create = function create(properties) { + return new GetEvaluationRunRequest(properties); + }; + + /** + * Encodes the specified GetEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationRunRequest} message GetEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationRunRequest.encode = function encode(message, writer) { + 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 GetEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationRunRequest} message GetEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvaluationRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetEvaluationRunRequest} GetEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationRunRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetEvaluationRunRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetEvaluationRunRequest} GetEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvaluationRunRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvaluationRunRequest.verify = function verify(message) { + if (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 GetEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetEvaluationRunRequest} GetEvaluationRunRequest + */ + GetEvaluationRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetEvaluationRunRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetEvaluationRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEvaluationRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.GetEvaluationRunRequest} message GetEvaluationRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvaluationRunRequest.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 GetEvaluationRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvaluationRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEvaluationRunRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetEvaluationRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEvaluationRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetEvaluationRunRequest"; + }; + + return GetEvaluationRunRequest; + })(); + + v1beta.ListEvaluationsRequest = (function() { + + /** + * Properties of a ListEvaluationsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationsRequest + * @property {string|null} [parent] ListEvaluationsRequest parent + * @property {number|null} [pageSize] ListEvaluationsRequest pageSize + * @property {string|null} [pageToken] ListEvaluationsRequest pageToken + * @property {string|null} [filter] ListEvaluationsRequest filter + * @property {string|null} [evaluationFilter] ListEvaluationsRequest evaluationFilter + * @property {string|null} [evaluationRunFilter] ListEvaluationsRequest evaluationRunFilter + * @property {string|null} [orderBy] ListEvaluationsRequest orderBy + * @property {boolean|null} [lastTenResults] ListEvaluationsRequest lastTenResults + */ + + /** + * Constructs a new ListEvaluationsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationsRequest. + * @implements IListEvaluationsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationsRequest=} [properties] Properties to set + */ + function ListEvaluationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.parent = ""; + + /** + * ListEvaluationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.pageSize = 0; + + /** + * ListEvaluationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.pageToken = ""; + + /** + * ListEvaluationsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.filter = ""; + + /** + * ListEvaluationsRequest evaluationFilter. + * @member {string} evaluationFilter + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.evaluationFilter = ""; + + /** + * ListEvaluationsRequest evaluationRunFilter. + * @member {string} evaluationRunFilter + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.evaluationRunFilter = ""; + + /** + * ListEvaluationsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.orderBy = ""; + + /** + * ListEvaluationsRequest lastTenResults. + * @member {boolean} lastTenResults + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.lastTenResults = false; + + /** + * Creates a new ListEvaluationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationsRequest} ListEvaluationsRequest instance + */ + ListEvaluationsRequest.create = function create(properties) { + return new ListEvaluationsRequest(properties); + }; + + /** + * Encodes the specified ListEvaluationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationsRequest} message ListEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationsRequest.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.lastTenResults != null && Object.hasOwnProperty.call(message, "lastTenResults")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.lastTenResults); + if (message.evaluationFilter != null && Object.hasOwnProperty.call(message, "evaluationFilter")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.evaluationFilter); + if (message.evaluationRunFilter != null && Object.hasOwnProperty.call(message, "evaluationRunFilter")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.evaluationRunFilter); + return writer; + }; + + /** + * Encodes the specified ListEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationsRequest} message ListEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationsRequest} ListEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 7: { + message.evaluationFilter = reader.string(); + break; + } + case 8: { + message.evaluationRunFilter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 6: { + message.lastTenResults = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationsRequest} ListEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationsRequest.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.evaluationFilter != null && message.hasOwnProperty("evaluationFilter")) + if (!$util.isString(message.evaluationFilter)) + return "evaluationFilter: string expected"; + if (message.evaluationRunFilter != null && message.hasOwnProperty("evaluationRunFilter")) + if (!$util.isString(message.evaluationRunFilter)) + return "evaluationRunFilter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.lastTenResults != null && message.hasOwnProperty("lastTenResults")) + if (typeof message.lastTenResults !== "boolean") + return "lastTenResults: boolean expected"; + return null; + }; + + /** + * Creates a ListEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationsRequest} ListEvaluationsRequest + */ + ListEvaluationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationsRequest(); + 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.evaluationFilter != null) + message.evaluationFilter = String(object.evaluationFilter); + if (object.evaluationRunFilter != null) + message.evaluationRunFilter = String(object.evaluationRunFilter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.lastTenResults != null) + message.lastTenResults = Boolean(object.lastTenResults); + return message; + }; + + /** + * Creates a plain object from a ListEvaluationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationsRequest} message ListEvaluationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationsRequest.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.lastTenResults = false; + object.evaluationFilter = ""; + object.evaluationRunFilter = ""; + } + 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.lastTenResults != null && message.hasOwnProperty("lastTenResults")) + object.lastTenResults = message.lastTenResults; + if (message.evaluationFilter != null && message.hasOwnProperty("evaluationFilter")) + object.evaluationFilter = message.evaluationFilter; + if (message.evaluationRunFilter != null && message.hasOwnProperty("evaluationRunFilter")) + object.evaluationRunFilter = message.evaluationRunFilter; + return object; + }; + + /** + * Converts this ListEvaluationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationsRequest"; + }; + + return ListEvaluationsRequest; + })(); + + v1beta.ListEvaluationResultsRequest = (function() { + + /** + * Properties of a ListEvaluationResultsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationResultsRequest + * @property {string|null} [parent] ListEvaluationResultsRequest parent + * @property {number|null} [pageSize] ListEvaluationResultsRequest pageSize + * @property {string|null} [pageToken] ListEvaluationResultsRequest pageToken + * @property {string|null} [filter] ListEvaluationResultsRequest filter + * @property {string|null} [orderBy] ListEvaluationResultsRequest orderBy + */ + + /** + * Constructs a new ListEvaluationResultsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationResultsRequest. + * @implements IListEvaluationResultsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationResultsRequest=} [properties] Properties to set + */ + function ListEvaluationResultsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationResultsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @instance + */ + ListEvaluationResultsRequest.prototype.parent = ""; + + /** + * ListEvaluationResultsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @instance + */ + ListEvaluationResultsRequest.prototype.pageSize = 0; + + /** + * ListEvaluationResultsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @instance + */ + ListEvaluationResultsRequest.prototype.pageToken = ""; + + /** + * ListEvaluationResultsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @instance + */ + ListEvaluationResultsRequest.prototype.filter = ""; + + /** + * ListEvaluationResultsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @instance + */ + ListEvaluationResultsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListEvaluationResultsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationResultsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationResultsRequest} ListEvaluationResultsRequest instance + */ + ListEvaluationResultsRequest.create = function create(properties) { + return new ListEvaluationResultsRequest(properties); + }; + + /** + * Encodes the specified ListEvaluationResultsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationResultsRequest} message ListEvaluationResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationResultsRequest.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 ListEvaluationResultsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationResultsRequest} message ListEvaluationResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationResultsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationResultsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationResultsRequest} ListEvaluationResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationResultsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationResultsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationResultsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationResultsRequest} ListEvaluationResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationResultsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationResultsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationResultsRequest.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 ListEvaluationResultsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationResultsRequest} ListEvaluationResultsRequest + */ + ListEvaluationResultsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationResultsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationResultsRequest(); + 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 ListEvaluationResultsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationResultsRequest} message ListEvaluationResultsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationResultsRequest.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 ListEvaluationResultsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationResultsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationResultsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationResultsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationResultsRequest"; + }; + + return ListEvaluationResultsRequest; + })(); + + v1beta.ListEvaluationDatasetsRequest = (function() { + + /** + * Properties of a ListEvaluationDatasetsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationDatasetsRequest + * @property {string|null} [parent] ListEvaluationDatasetsRequest parent + * @property {number|null} [pageSize] ListEvaluationDatasetsRequest pageSize + * @property {string|null} [pageToken] ListEvaluationDatasetsRequest pageToken + * @property {string|null} [filter] ListEvaluationDatasetsRequest filter + * @property {string|null} [orderBy] ListEvaluationDatasetsRequest orderBy + */ + + /** + * Constructs a new ListEvaluationDatasetsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationDatasetsRequest. + * @implements IListEvaluationDatasetsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsRequest=} [properties] Properties to set + */ + function ListEvaluationDatasetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationDatasetsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @instance + */ + ListEvaluationDatasetsRequest.prototype.parent = ""; + + /** + * ListEvaluationDatasetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @instance + */ + ListEvaluationDatasetsRequest.prototype.pageSize = 0; + + /** + * ListEvaluationDatasetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @instance + */ + ListEvaluationDatasetsRequest.prototype.pageToken = ""; + + /** + * ListEvaluationDatasetsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @instance + */ + ListEvaluationDatasetsRequest.prototype.filter = ""; + + /** + * ListEvaluationDatasetsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @instance + */ + ListEvaluationDatasetsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListEvaluationDatasetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsRequest} ListEvaluationDatasetsRequest instance + */ + ListEvaluationDatasetsRequest.create = function create(properties) { + return new ListEvaluationDatasetsRequest(properties); + }; + + /** + * Encodes the specified ListEvaluationDatasetsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsRequest} message ListEvaluationDatasetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationDatasetsRequest.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 ListEvaluationDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsRequest} message ListEvaluationDatasetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationDatasetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationDatasetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsRequest} ListEvaluationDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationDatasetsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationDatasetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsRequest} ListEvaluationDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationDatasetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationDatasetsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationDatasetsRequest.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 ListEvaluationDatasetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsRequest} ListEvaluationDatasetsRequest + */ + ListEvaluationDatasetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationDatasetsRequest(); + 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 ListEvaluationDatasetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationDatasetsRequest} message ListEvaluationDatasetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationDatasetsRequest.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 ListEvaluationDatasetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationDatasetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationDatasetsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationDatasetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationDatasetsRequest"; + }; + + return ListEvaluationDatasetsRequest; + })(); + + v1beta.ListEvaluationRunsRequest = (function() { + + /** + * Properties of a ListEvaluationRunsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationRunsRequest + * @property {string|null} [parent] ListEvaluationRunsRequest parent + * @property {number|null} [pageSize] ListEvaluationRunsRequest pageSize + * @property {string|null} [pageToken] ListEvaluationRunsRequest pageToken + * @property {string|null} [filter] ListEvaluationRunsRequest filter + * @property {string|null} [orderBy] ListEvaluationRunsRequest orderBy + */ + + /** + * Constructs a new ListEvaluationRunsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationRunsRequest. + * @implements IListEvaluationRunsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationRunsRequest=} [properties] Properties to set + */ + function ListEvaluationRunsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationRunsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @instance + */ + ListEvaluationRunsRequest.prototype.parent = ""; + + /** + * ListEvaluationRunsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @instance + */ + ListEvaluationRunsRequest.prototype.pageSize = 0; + + /** + * ListEvaluationRunsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @instance + */ + ListEvaluationRunsRequest.prototype.pageToken = ""; + + /** + * ListEvaluationRunsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @instance + */ + ListEvaluationRunsRequest.prototype.filter = ""; + + /** + * ListEvaluationRunsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @instance + */ + ListEvaluationRunsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListEvaluationRunsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationRunsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationRunsRequest} ListEvaluationRunsRequest instance + */ + ListEvaluationRunsRequest.create = function create(properties) { + return new ListEvaluationRunsRequest(properties); + }; + + /** + * Encodes the specified ListEvaluationRunsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationRunsRequest} message ListEvaluationRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationRunsRequest.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 ListEvaluationRunsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationRunsRequest} message ListEvaluationRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationRunsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationRunsRequest} ListEvaluationRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationRunsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationRunsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationRunsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationRunsRequest} ListEvaluationRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationRunsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationRunsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationRunsRequest.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 ListEvaluationRunsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationRunsRequest} ListEvaluationRunsRequest + */ + ListEvaluationRunsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationRunsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationRunsRequest(); + 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 ListEvaluationRunsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationRunsRequest} message ListEvaluationRunsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationRunsRequest.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 ListEvaluationRunsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationRunsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationRunsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationRunsRequest"; + }; + + return ListEvaluationRunsRequest; + })(); + + v1beta.ListEvaluationsResponse = (function() { + + /** + * Properties of a ListEvaluationsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationsResponse + * @property {Array.|null} [evaluations] ListEvaluationsResponse evaluations + * @property {string|null} [nextPageToken] ListEvaluationsResponse nextPageToken + */ + + /** + * Constructs a new ListEvaluationsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationsResponse. + * @implements IListEvaluationsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationsResponse=} [properties] Properties to set + */ + function ListEvaluationsResponse(properties) { + this.evaluations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationsResponse evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @instance + */ + ListEvaluationsResponse.prototype.evaluations = $util.emptyArray; + + /** + * ListEvaluationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @instance + */ + ListEvaluationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEvaluationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationsResponse} ListEvaluationsResponse instance + */ + ListEvaluationsResponse.create = function create(properties) { + return new ListEvaluationsResponse(properties); + }; + + /** + * Encodes the specified ListEvaluationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationsResponse} message ListEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + $root.google.cloud.ces.v1beta.Evaluation.encode(message.evaluations[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 ListEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationsResponse} message ListEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationsResponse} ListEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push($root.google.cloud.ces.v1beta.Evaluation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationsResponse} ListEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Evaluation.verify(message.evaluations[i]); + if (error) + return "evaluations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationsResponse} ListEvaluationsResponse + */ + ListEvaluationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationsResponse(); + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationsResponse.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) { + if (typeof object.evaluations[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationsResponse.evaluations: object expected"); + message.evaluations[i] = $root.google.cloud.ces.v1beta.Evaluation.fromObject(object.evaluations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEvaluationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationsResponse} message ListEvaluationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = $root.google.cloud.ces.v1beta.Evaluation.toObject(message.evaluations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEvaluationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationsResponse"; + }; + + return ListEvaluationsResponse; + })(); + + v1beta.ListEvaluationResultsResponse = (function() { + + /** + * Properties of a ListEvaluationResultsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationResultsResponse + * @property {Array.|null} [evaluationResults] ListEvaluationResultsResponse evaluationResults + * @property {string|null} [nextPageToken] ListEvaluationResultsResponse nextPageToken + */ + + /** + * Constructs a new ListEvaluationResultsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationResultsResponse. + * @implements IListEvaluationResultsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationResultsResponse=} [properties] Properties to set + */ + function ListEvaluationResultsResponse(properties) { + this.evaluationResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationResultsResponse evaluationResults. + * @member {Array.} evaluationResults + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @instance + */ + ListEvaluationResultsResponse.prototype.evaluationResults = $util.emptyArray; + + /** + * ListEvaluationResultsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @instance + */ + ListEvaluationResultsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEvaluationResultsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationResultsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationResultsResponse} ListEvaluationResultsResponse instance + */ + ListEvaluationResultsResponse.create = function create(properties) { + return new ListEvaluationResultsResponse(properties); + }; + + /** + * Encodes the specified ListEvaluationResultsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationResultsResponse} message ListEvaluationResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationResultsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationResults != null && message.evaluationResults.length) + for (var i = 0; i < message.evaluationResults.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationResult.encode(message.evaluationResults[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 ListEvaluationResultsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationResultsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationResultsResponse} message ListEvaluationResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationResultsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationResultsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationResultsResponse} ListEvaluationResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationResultsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationResultsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.evaluationResults && message.evaluationResults.length)) + message.evaluationResults = []; + message.evaluationResults.push($root.google.cloud.ces.v1beta.EvaluationResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationResultsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationResultsResponse} ListEvaluationResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationResultsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationResultsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationResultsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationResults != null && message.hasOwnProperty("evaluationResults")) { + if (!Array.isArray(message.evaluationResults)) + return "evaluationResults: array expected"; + for (var i = 0; i < message.evaluationResults.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationResult.verify(message.evaluationResults[i]); + if (error) + return "evaluationResults." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEvaluationResultsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationResultsResponse} ListEvaluationResultsResponse + */ + ListEvaluationResultsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationResultsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationResultsResponse(); + if (object.evaluationResults) { + if (!Array.isArray(object.evaluationResults)) + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationResultsResponse.evaluationResults: array expected"); + message.evaluationResults = []; + for (var i = 0; i < object.evaluationResults.length; ++i) { + if (typeof object.evaluationResults[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationResultsResponse.evaluationResults: object expected"); + message.evaluationResults[i] = $root.google.cloud.ces.v1beta.EvaluationResult.fromObject(object.evaluationResults[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEvaluationResultsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationResultsResponse} message ListEvaluationResultsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationResultsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluationResults = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.evaluationResults && message.evaluationResults.length) { + object.evaluationResults = []; + for (var j = 0; j < message.evaluationResults.length; ++j) + object.evaluationResults[j] = $root.google.cloud.ces.v1beta.EvaluationResult.toObject(message.evaluationResults[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEvaluationResultsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationResultsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationResultsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationResultsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationResultsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationResultsResponse"; + }; + + return ListEvaluationResultsResponse; + })(); + + v1beta.ListEvaluationDatasetsResponse = (function() { + + /** + * Properties of a ListEvaluationDatasetsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationDatasetsResponse + * @property {Array.|null} [evaluationDatasets] ListEvaluationDatasetsResponse evaluationDatasets + * @property {string|null} [nextPageToken] ListEvaluationDatasetsResponse nextPageToken + */ + + /** + * Constructs a new ListEvaluationDatasetsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationDatasetsResponse. + * @implements IListEvaluationDatasetsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsResponse=} [properties] Properties to set + */ + function ListEvaluationDatasetsResponse(properties) { + this.evaluationDatasets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationDatasetsResponse evaluationDatasets. + * @member {Array.} evaluationDatasets + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @instance + */ + ListEvaluationDatasetsResponse.prototype.evaluationDatasets = $util.emptyArray; + + /** + * ListEvaluationDatasetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @instance + */ + ListEvaluationDatasetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEvaluationDatasetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsResponse} ListEvaluationDatasetsResponse instance + */ + ListEvaluationDatasetsResponse.create = function create(properties) { + return new ListEvaluationDatasetsResponse(properties); + }; + + /** + * Encodes the specified ListEvaluationDatasetsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsResponse} message ListEvaluationDatasetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationDatasetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationDatasets != null && message.evaluationDatasets.length) + for (var i = 0; i < message.evaluationDatasets.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationDataset.encode(message.evaluationDatasets[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 ListEvaluationDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationDatasetsResponse} message ListEvaluationDatasetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationDatasetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationDatasetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsResponse} ListEvaluationDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationDatasetsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationDatasetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.evaluationDatasets && message.evaluationDatasets.length)) + message.evaluationDatasets = []; + message.evaluationDatasets.push($root.google.cloud.ces.v1beta.EvaluationDataset.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationDatasetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsResponse} ListEvaluationDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationDatasetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationDatasetsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationDatasetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationDatasets != null && message.hasOwnProperty("evaluationDatasets")) { + if (!Array.isArray(message.evaluationDatasets)) + return "evaluationDatasets: array expected"; + for (var i = 0; i < message.evaluationDatasets.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationDataset.verify(message.evaluationDatasets[i]); + if (error) + return "evaluationDatasets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEvaluationDatasetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationDatasetsResponse} ListEvaluationDatasetsResponse + */ + ListEvaluationDatasetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationDatasetsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationDatasetsResponse(); + if (object.evaluationDatasets) { + if (!Array.isArray(object.evaluationDatasets)) + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.evaluationDatasets: array expected"); + message.evaluationDatasets = []; + for (var i = 0; i < object.evaluationDatasets.length; ++i) { + if (typeof object.evaluationDatasets[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationDatasetsResponse.evaluationDatasets: object expected"); + message.evaluationDatasets[i] = $root.google.cloud.ces.v1beta.EvaluationDataset.fromObject(object.evaluationDatasets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEvaluationDatasetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationDatasetsResponse} message ListEvaluationDatasetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationDatasetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluationDatasets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.evaluationDatasets && message.evaluationDatasets.length) { + object.evaluationDatasets = []; + for (var j = 0; j < message.evaluationDatasets.length; ++j) + object.evaluationDatasets[j] = $root.google.cloud.ces.v1beta.EvaluationDataset.toObject(message.evaluationDatasets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEvaluationDatasetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationDatasetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationDatasetsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationDatasetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationDatasetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationDatasetsResponse"; + }; + + return ListEvaluationDatasetsResponse; + })(); + + v1beta.ListEvaluationRunsResponse = (function() { + + /** + * Properties of a ListEvaluationRunsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationRunsResponse + * @property {Array.|null} [evaluationRuns] ListEvaluationRunsResponse evaluationRuns + * @property {string|null} [nextPageToken] ListEvaluationRunsResponse nextPageToken + */ + + /** + * Constructs a new ListEvaluationRunsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationRunsResponse. + * @implements IListEvaluationRunsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationRunsResponse=} [properties] Properties to set + */ + function ListEvaluationRunsResponse(properties) { + this.evaluationRuns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationRunsResponse evaluationRuns. + * @member {Array.} evaluationRuns + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @instance + */ + ListEvaluationRunsResponse.prototype.evaluationRuns = $util.emptyArray; + + /** + * ListEvaluationRunsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @instance + */ + ListEvaluationRunsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEvaluationRunsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationRunsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationRunsResponse} ListEvaluationRunsResponse instance + */ + ListEvaluationRunsResponse.create = function create(properties) { + return new ListEvaluationRunsResponse(properties); + }; + + /** + * Encodes the specified ListEvaluationRunsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationRunsResponse} message ListEvaluationRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationRunsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationRuns != null && message.evaluationRuns.length) + for (var i = 0; i < message.evaluationRuns.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationRun.encode(message.evaluationRuns[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 ListEvaluationRunsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationRunsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationRunsResponse} message ListEvaluationRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationRunsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationRunsResponse} ListEvaluationRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationRunsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationRunsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.evaluationRuns && message.evaluationRuns.length)) + message.evaluationRuns = []; + message.evaluationRuns.push($root.google.cloud.ces.v1beta.EvaluationRun.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationRunsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationRunsResponse} ListEvaluationRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationRunsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationRunsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationRunsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationRuns != null && message.hasOwnProperty("evaluationRuns")) { + if (!Array.isArray(message.evaluationRuns)) + return "evaluationRuns: array expected"; + for (var i = 0; i < message.evaluationRuns.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationRun.verify(message.evaluationRuns[i]); + if (error) + return "evaluationRuns." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEvaluationRunsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationRunsResponse} ListEvaluationRunsResponse + */ + ListEvaluationRunsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationRunsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationRunsResponse(); + if (object.evaluationRuns) { + if (!Array.isArray(object.evaluationRuns)) + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationRunsResponse.evaluationRuns: array expected"); + message.evaluationRuns = []; + for (var i = 0; i < object.evaluationRuns.length; ++i) { + if (typeof object.evaluationRuns[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationRunsResponse.evaluationRuns: object expected"); + message.evaluationRuns[i] = $root.google.cloud.ces.v1beta.EvaluationRun.fromObject(object.evaluationRuns[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEvaluationRunsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationRunsResponse} message ListEvaluationRunsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationRunsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluationRuns = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.evaluationRuns && message.evaluationRuns.length) { + object.evaluationRuns = []; + for (var j = 0; j < message.evaluationRuns.length; ++j) + object.evaluationRuns[j] = $root.google.cloud.ces.v1beta.EvaluationRun.toObject(message.evaluationRuns[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEvaluationRunsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationRunsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationRunsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationRunsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationRunsResponse"; + }; + + return ListEvaluationRunsResponse; + })(); + + v1beta.CreateScheduledEvaluationRunRequest = (function() { + + /** + * Properties of a CreateScheduledEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateScheduledEvaluationRunRequest + * @property {string|null} [parent] CreateScheduledEvaluationRunRequest parent + * @property {string|null} [scheduledEvaluationRunId] CreateScheduledEvaluationRunRequest scheduledEvaluationRunId + * @property {google.cloud.ces.v1beta.IScheduledEvaluationRun|null} [scheduledEvaluationRun] CreateScheduledEvaluationRunRequest scheduledEvaluationRun + */ + + /** + * Constructs a new CreateScheduledEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateScheduledEvaluationRunRequest. + * @implements ICreateScheduledEvaluationRunRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest=} [properties] Properties to set + */ + function CreateScheduledEvaluationRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateScheduledEvaluationRunRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @instance + */ + CreateScheduledEvaluationRunRequest.prototype.parent = ""; + + /** + * CreateScheduledEvaluationRunRequest scheduledEvaluationRunId. + * @member {string} scheduledEvaluationRunId + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @instance + */ + CreateScheduledEvaluationRunRequest.prototype.scheduledEvaluationRunId = ""; + + /** + * CreateScheduledEvaluationRunRequest scheduledEvaluationRun. + * @member {google.cloud.ces.v1beta.IScheduledEvaluationRun|null|undefined} scheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @instance + */ + CreateScheduledEvaluationRunRequest.prototype.scheduledEvaluationRun = null; + + /** + * Creates a new CreateScheduledEvaluationRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest} CreateScheduledEvaluationRunRequest instance + */ + CreateScheduledEvaluationRunRequest.create = function create(properties) { + return new CreateScheduledEvaluationRunRequest(properties); + }; + + /** + * Encodes the specified CreateScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest} message CreateScheduledEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateScheduledEvaluationRunRequest.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.scheduledEvaluationRunId != null && Object.hasOwnProperty.call(message, "scheduledEvaluationRunId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.scheduledEvaluationRunId); + if (message.scheduledEvaluationRun != null && Object.hasOwnProperty.call(message, "scheduledEvaluationRun")) + $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.encode(message.scheduledEvaluationRun, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateScheduledEvaluationRunRequest} message CreateScheduledEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateScheduledEvaluationRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateScheduledEvaluationRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest} CreateScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateScheduledEvaluationRunRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.scheduledEvaluationRunId = reader.string(); + break; + } + case 3: { + message.scheduledEvaluationRun = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest} CreateScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateScheduledEvaluationRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateScheduledEvaluationRunRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateScheduledEvaluationRunRequest.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.scheduledEvaluationRunId != null && message.hasOwnProperty("scheduledEvaluationRunId")) + if (!$util.isString(message.scheduledEvaluationRunId)) + return "scheduledEvaluationRunId: string expected"; + if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) { + var error = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.verify(message.scheduledEvaluationRun); + if (error) + return "scheduledEvaluationRun." + error; + } + return null; + }; + + /** + * Creates a CreateScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest} CreateScheduledEvaluationRunRequest + */ + CreateScheduledEvaluationRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.scheduledEvaluationRunId != null) + message.scheduledEvaluationRunId = String(object.scheduledEvaluationRunId); + if (object.scheduledEvaluationRun != null) { + if (typeof object.scheduledEvaluationRun !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest.scheduledEvaluationRun: object expected"); + message.scheduledEvaluationRun = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.fromObject(object.scheduledEvaluationRun); + } + return message; + }; + + /** + * Creates a plain object from a CreateScheduledEvaluationRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest} message CreateScheduledEvaluationRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateScheduledEvaluationRunRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.scheduledEvaluationRunId = ""; + object.scheduledEvaluationRun = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.scheduledEvaluationRunId != null && message.hasOwnProperty("scheduledEvaluationRunId")) + object.scheduledEvaluationRunId = message.scheduledEvaluationRunId; + if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) + object.scheduledEvaluationRun = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.toObject(message.scheduledEvaluationRun, options); + return object; + }; + + /** + * Converts this CreateScheduledEvaluationRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @instance + * @returns {Object.} JSON object + */ + CreateScheduledEvaluationRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateScheduledEvaluationRunRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateScheduledEvaluationRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateScheduledEvaluationRunRequest"; + }; + + return CreateScheduledEvaluationRunRequest; + })(); + + v1beta.GetScheduledEvaluationRunRequest = (function() { + + /** + * Properties of a GetScheduledEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetScheduledEvaluationRunRequest + * @property {string|null} [name] GetScheduledEvaluationRunRequest name + */ + + /** + * Constructs a new GetScheduledEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetScheduledEvaluationRunRequest. + * @implements IGetScheduledEvaluationRunRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest=} [properties] Properties to set + */ + function GetScheduledEvaluationRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetScheduledEvaluationRunRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @instance + */ + GetScheduledEvaluationRunRequest.prototype.name = ""; + + /** + * Creates a new GetScheduledEvaluationRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest} GetScheduledEvaluationRunRequest instance + */ + GetScheduledEvaluationRunRequest.create = function create(properties) { + return new GetScheduledEvaluationRunRequest(properties); + }; + + /** + * Encodes the specified GetScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest} message GetScheduledEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScheduledEvaluationRunRequest.encode = function encode(message, writer) { + 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 GetScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IGetScheduledEvaluationRunRequest} message GetScheduledEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScheduledEvaluationRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetScheduledEvaluationRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest} GetScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScheduledEvaluationRunRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest} GetScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScheduledEvaluationRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetScheduledEvaluationRunRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetScheduledEvaluationRunRequest.verify = function verify(message) { + if (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 GetScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest} GetScheduledEvaluationRunRequest + */ + GetScheduledEvaluationRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetScheduledEvaluationRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest} message GetScheduledEvaluationRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetScheduledEvaluationRunRequest.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 GetScheduledEvaluationRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @instance + * @returns {Object.} JSON object + */ + GetScheduledEvaluationRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetScheduledEvaluationRunRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetScheduledEvaluationRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetScheduledEvaluationRunRequest"; + }; + + return GetScheduledEvaluationRunRequest; + })(); + + v1beta.ListScheduledEvaluationRunsRequest = (function() { + + /** + * Properties of a ListScheduledEvaluationRunsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListScheduledEvaluationRunsRequest + * @property {string|null} [parent] ListScheduledEvaluationRunsRequest parent + * @property {number|null} [pageSize] ListScheduledEvaluationRunsRequest pageSize + * @property {string|null} [pageToken] ListScheduledEvaluationRunsRequest pageToken + * @property {string|null} [filter] ListScheduledEvaluationRunsRequest filter + * @property {string|null} [orderBy] ListScheduledEvaluationRunsRequest orderBy + */ + + /** + * Constructs a new ListScheduledEvaluationRunsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListScheduledEvaluationRunsRequest. + * @implements IListScheduledEvaluationRunsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest=} [properties] Properties to set + */ + function ListScheduledEvaluationRunsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListScheduledEvaluationRunsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @instance + */ + ListScheduledEvaluationRunsRequest.prototype.parent = ""; + + /** + * ListScheduledEvaluationRunsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @instance + */ + ListScheduledEvaluationRunsRequest.prototype.pageSize = 0; + + /** + * ListScheduledEvaluationRunsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @instance + */ + ListScheduledEvaluationRunsRequest.prototype.pageToken = ""; + + /** + * ListScheduledEvaluationRunsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @instance + */ + ListScheduledEvaluationRunsRequest.prototype.filter = ""; + + /** + * ListScheduledEvaluationRunsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @instance + */ + ListScheduledEvaluationRunsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListScheduledEvaluationRunsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @static + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest} ListScheduledEvaluationRunsRequest instance + */ + ListScheduledEvaluationRunsRequest.create = function create(properties) { + return new ListScheduledEvaluationRunsRequest(properties); + }; + + /** + * Encodes the specified ListScheduledEvaluationRunsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @static + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest} message ListScheduledEvaluationRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScheduledEvaluationRunsRequest.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 ListScheduledEvaluationRunsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @static + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsRequest} message ListScheduledEvaluationRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScheduledEvaluationRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListScheduledEvaluationRunsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest} ListScheduledEvaluationRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScheduledEvaluationRunsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListScheduledEvaluationRunsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest} ListScheduledEvaluationRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScheduledEvaluationRunsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListScheduledEvaluationRunsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListScheduledEvaluationRunsRequest.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 ListScheduledEvaluationRunsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest} ListScheduledEvaluationRunsRequest + */ + ListScheduledEvaluationRunsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest(); + 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 ListScheduledEvaluationRunsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @static + * @param {google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest} message ListScheduledEvaluationRunsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListScheduledEvaluationRunsRequest.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 ListScheduledEvaluationRunsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @instance + * @returns {Object.} JSON object + */ + ListScheduledEvaluationRunsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListScheduledEvaluationRunsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListScheduledEvaluationRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListScheduledEvaluationRunsRequest"; + }; + + return ListScheduledEvaluationRunsRequest; + })(); + + v1beta.ListScheduledEvaluationRunsResponse = (function() { + + /** + * Properties of a ListScheduledEvaluationRunsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListScheduledEvaluationRunsResponse + * @property {Array.|null} [scheduledEvaluationRuns] ListScheduledEvaluationRunsResponse scheduledEvaluationRuns + * @property {string|null} [nextPageToken] ListScheduledEvaluationRunsResponse nextPageToken + */ + + /** + * Constructs a new ListScheduledEvaluationRunsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListScheduledEvaluationRunsResponse. + * @implements IListScheduledEvaluationRunsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse=} [properties] Properties to set + */ + function ListScheduledEvaluationRunsResponse(properties) { + this.scheduledEvaluationRuns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListScheduledEvaluationRunsResponse scheduledEvaluationRuns. + * @member {Array.} scheduledEvaluationRuns + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @instance + */ + ListScheduledEvaluationRunsResponse.prototype.scheduledEvaluationRuns = $util.emptyArray; + + /** + * ListScheduledEvaluationRunsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @instance + */ + ListScheduledEvaluationRunsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListScheduledEvaluationRunsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @static + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse} ListScheduledEvaluationRunsResponse instance + */ + ListScheduledEvaluationRunsResponse.create = function create(properties) { + return new ListScheduledEvaluationRunsResponse(properties); + }; + + /** + * Encodes the specified ListScheduledEvaluationRunsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @static + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse} message ListScheduledEvaluationRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScheduledEvaluationRunsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scheduledEvaluationRuns != null && message.scheduledEvaluationRuns.length) + for (var i = 0; i < message.scheduledEvaluationRuns.length; ++i) + $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.encode(message.scheduledEvaluationRuns[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 ListScheduledEvaluationRunsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @static + * @param {google.cloud.ces.v1beta.IListScheduledEvaluationRunsResponse} message ListScheduledEvaluationRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScheduledEvaluationRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListScheduledEvaluationRunsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse} ListScheduledEvaluationRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScheduledEvaluationRunsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.scheduledEvaluationRuns && message.scheduledEvaluationRuns.length)) + message.scheduledEvaluationRuns = []; + message.scheduledEvaluationRuns.push($root.google.cloud.ces.v1beta.ScheduledEvaluationRun.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListScheduledEvaluationRunsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse} ListScheduledEvaluationRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScheduledEvaluationRunsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListScheduledEvaluationRunsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListScheduledEvaluationRunsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scheduledEvaluationRuns != null && message.hasOwnProperty("scheduledEvaluationRuns")) { + if (!Array.isArray(message.scheduledEvaluationRuns)) + return "scheduledEvaluationRuns: array expected"; + for (var i = 0; i < message.scheduledEvaluationRuns.length; ++i) { + var error = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.verify(message.scheduledEvaluationRuns[i]); + if (error) + return "scheduledEvaluationRuns." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListScheduledEvaluationRunsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse} ListScheduledEvaluationRunsResponse + */ + ListScheduledEvaluationRunsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse(); + if (object.scheduledEvaluationRuns) { + if (!Array.isArray(object.scheduledEvaluationRuns)) + throw TypeError(".google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.scheduledEvaluationRuns: array expected"); + message.scheduledEvaluationRuns = []; + for (var i = 0; i < object.scheduledEvaluationRuns.length; ++i) { + if (typeof object.scheduledEvaluationRuns[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse.scheduledEvaluationRuns: object expected"); + message.scheduledEvaluationRuns[i] = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.fromObject(object.scheduledEvaluationRuns[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListScheduledEvaluationRunsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @static + * @param {google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse} message ListScheduledEvaluationRunsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListScheduledEvaluationRunsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scheduledEvaluationRuns = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.scheduledEvaluationRuns && message.scheduledEvaluationRuns.length) { + object.scheduledEvaluationRuns = []; + for (var j = 0; j < message.scheduledEvaluationRuns.length; ++j) + object.scheduledEvaluationRuns[j] = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.toObject(message.scheduledEvaluationRuns[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListScheduledEvaluationRunsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @instance + * @returns {Object.} JSON object + */ + ListScheduledEvaluationRunsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListScheduledEvaluationRunsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListScheduledEvaluationRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListScheduledEvaluationRunsResponse"; + }; + + return ListScheduledEvaluationRunsResponse; + })(); + + v1beta.UpdateScheduledEvaluationRunRequest = (function() { + + /** + * Properties of an UpdateScheduledEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateScheduledEvaluationRunRequest + * @property {google.cloud.ces.v1beta.IScheduledEvaluationRun|null} [scheduledEvaluationRun] UpdateScheduledEvaluationRunRequest scheduledEvaluationRun + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateScheduledEvaluationRunRequest updateMask + */ + + /** + * Constructs a new UpdateScheduledEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateScheduledEvaluationRunRequest. + * @implements IUpdateScheduledEvaluationRunRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest=} [properties] Properties to set + */ + function UpdateScheduledEvaluationRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateScheduledEvaluationRunRequest scheduledEvaluationRun. + * @member {google.cloud.ces.v1beta.IScheduledEvaluationRun|null|undefined} scheduledEvaluationRun + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @instance + */ + UpdateScheduledEvaluationRunRequest.prototype.scheduledEvaluationRun = null; + + /** + * UpdateScheduledEvaluationRunRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @instance + */ + UpdateScheduledEvaluationRunRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateScheduledEvaluationRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest} UpdateScheduledEvaluationRunRequest instance + */ + UpdateScheduledEvaluationRunRequest.create = function create(properties) { + return new UpdateScheduledEvaluationRunRequest(properties); + }; + + /** + * Encodes the specified UpdateScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest} message UpdateScheduledEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateScheduledEvaluationRunRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scheduledEvaluationRun != null && Object.hasOwnProperty.call(message, "scheduledEvaluationRun")) + $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.encode(message.scheduledEvaluationRun, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateScheduledEvaluationRunRequest} message UpdateScheduledEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateScheduledEvaluationRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateScheduledEvaluationRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest} UpdateScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateScheduledEvaluationRunRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.scheduledEvaluationRun = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest} UpdateScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateScheduledEvaluationRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateScheduledEvaluationRunRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateScheduledEvaluationRunRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) { + var error = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.verify(message.scheduledEvaluationRun); + if (error) + return "scheduledEvaluationRun." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest} UpdateScheduledEvaluationRunRequest + */ + UpdateScheduledEvaluationRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest(); + if (object.scheduledEvaluationRun != null) { + if (typeof object.scheduledEvaluationRun !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest.scheduledEvaluationRun: object expected"); + message.scheduledEvaluationRun = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.fromObject(object.scheduledEvaluationRun); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateScheduledEvaluationRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest} message UpdateScheduledEvaluationRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateScheduledEvaluationRunRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scheduledEvaluationRun = null; + object.updateMask = null; + } + if (message.scheduledEvaluationRun != null && message.hasOwnProperty("scheduledEvaluationRun")) + object.scheduledEvaluationRun = $root.google.cloud.ces.v1beta.ScheduledEvaluationRun.toObject(message.scheduledEvaluationRun, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateScheduledEvaluationRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateScheduledEvaluationRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateScheduledEvaluationRunRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateScheduledEvaluationRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateScheduledEvaluationRunRequest"; + }; + + return UpdateScheduledEvaluationRunRequest; + })(); + + v1beta.DeleteScheduledEvaluationRunRequest = (function() { + + /** + * Properties of a DeleteScheduledEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteScheduledEvaluationRunRequest + * @property {string|null} [name] DeleteScheduledEvaluationRunRequest name + * @property {string|null} [etag] DeleteScheduledEvaluationRunRequest etag + */ + + /** + * Constructs a new DeleteScheduledEvaluationRunRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteScheduledEvaluationRunRequest. + * @implements IDeleteScheduledEvaluationRunRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest=} [properties] Properties to set + */ + function DeleteScheduledEvaluationRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteScheduledEvaluationRunRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @instance + */ + DeleteScheduledEvaluationRunRequest.prototype.name = ""; + + /** + * DeleteScheduledEvaluationRunRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @instance + */ + DeleteScheduledEvaluationRunRequest.prototype.etag = ""; + + /** + * Creates a new DeleteScheduledEvaluationRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest} DeleteScheduledEvaluationRunRequest instance + */ + DeleteScheduledEvaluationRunRequest.create = function create(properties) { + return new DeleteScheduledEvaluationRunRequest(properties); + }; + + /** + * Encodes the specified DeleteScheduledEvaluationRunRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest} message DeleteScheduledEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteScheduledEvaluationRunRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteScheduledEvaluationRunRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteScheduledEvaluationRunRequest} message DeleteScheduledEvaluationRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteScheduledEvaluationRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteScheduledEvaluationRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest} DeleteScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteScheduledEvaluationRunRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteScheduledEvaluationRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest} DeleteScheduledEvaluationRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteScheduledEvaluationRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteScheduledEvaluationRunRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteScheduledEvaluationRunRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteScheduledEvaluationRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest} DeleteScheduledEvaluationRunRequest + */ + DeleteScheduledEvaluationRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteScheduledEvaluationRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest} message DeleteScheduledEvaluationRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteScheduledEvaluationRunRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteScheduledEvaluationRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteScheduledEvaluationRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteScheduledEvaluationRunRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteScheduledEvaluationRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteScheduledEvaluationRunRequest"; + }; + + return DeleteScheduledEvaluationRunRequest; + })(); + + v1beta.TestPersonaVoiceRequest = (function() { + + /** + * Properties of a TestPersonaVoiceRequest. + * @memberof google.cloud.ces.v1beta + * @interface ITestPersonaVoiceRequest + * @property {string|null} [app] TestPersonaVoiceRequest app + * @property {string|null} [personaId] TestPersonaVoiceRequest personaId + * @property {string|null} [text] TestPersonaVoiceRequest text + */ + + /** + * Constructs a new TestPersonaVoiceRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a TestPersonaVoiceRequest. + * @implements ITestPersonaVoiceRequest + * @constructor + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceRequest=} [properties] Properties to set + */ + function TestPersonaVoiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestPersonaVoiceRequest app. + * @member {string} app + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @instance + */ + TestPersonaVoiceRequest.prototype.app = ""; + + /** + * TestPersonaVoiceRequest personaId. + * @member {string} personaId + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @instance + */ + TestPersonaVoiceRequest.prototype.personaId = ""; + + /** + * TestPersonaVoiceRequest text. + * @member {string} text + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @instance + */ + TestPersonaVoiceRequest.prototype.text = ""; + + /** + * Creates a new TestPersonaVoiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @static + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TestPersonaVoiceRequest} TestPersonaVoiceRequest instance + */ + TestPersonaVoiceRequest.create = function create(properties) { + return new TestPersonaVoiceRequest(properties); + }; + + /** + * Encodes the specified TestPersonaVoiceRequest message. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @static + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceRequest} message TestPersonaVoiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestPersonaVoiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.app); + if (message.personaId != null && Object.hasOwnProperty.call(message, "personaId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.personaId); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.text); + return writer; + }; + + /** + * Encodes the specified TestPersonaVoiceRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @static + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceRequest} message TestPersonaVoiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestPersonaVoiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestPersonaVoiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TestPersonaVoiceRequest} TestPersonaVoiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestPersonaVoiceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TestPersonaVoiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.app = reader.string(); + break; + } + case 2: { + message.personaId = reader.string(); + break; + } + case 3: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestPersonaVoiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TestPersonaVoiceRequest} TestPersonaVoiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestPersonaVoiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestPersonaVoiceRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestPersonaVoiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.app != null && message.hasOwnProperty("app")) + if (!$util.isString(message.app)) + return "app: string expected"; + if (message.personaId != null && message.hasOwnProperty("personaId")) + if (!$util.isString(message.personaId)) + return "personaId: string expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a TestPersonaVoiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TestPersonaVoiceRequest} TestPersonaVoiceRequest + */ + TestPersonaVoiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TestPersonaVoiceRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.TestPersonaVoiceRequest(); + if (object.app != null) + message.app = String(object.app); + if (object.personaId != null) + message.personaId = String(object.personaId); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a TestPersonaVoiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @static + * @param {google.cloud.ces.v1beta.TestPersonaVoiceRequest} message TestPersonaVoiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestPersonaVoiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.app = ""; + object.personaId = ""; + object.text = ""; + } + if (message.app != null && message.hasOwnProperty("app")) + object.app = message.app; + if (message.personaId != null && message.hasOwnProperty("personaId")) + object.personaId = message.personaId; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this TestPersonaVoiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @instance + * @returns {Object.} JSON object + */ + TestPersonaVoiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestPersonaVoiceRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestPersonaVoiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TestPersonaVoiceRequest"; + }; + + return TestPersonaVoiceRequest; + })(); + + v1beta.UploadEvaluationAudioRequest = (function() { + + /** + * Properties of an UploadEvaluationAudioRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUploadEvaluationAudioRequest + * @property {string|null} [app] UploadEvaluationAudioRequest app + * @property {Uint8Array|null} [audioContent] UploadEvaluationAudioRequest audioContent + */ + + /** + * Constructs a new UploadEvaluationAudioRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UploadEvaluationAudioRequest. + * @implements IUploadEvaluationAudioRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioRequest=} [properties] Properties to set + */ + function UploadEvaluationAudioRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UploadEvaluationAudioRequest app. + * @member {string} app + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @instance + */ + UploadEvaluationAudioRequest.prototype.app = ""; + + /** + * UploadEvaluationAudioRequest audioContent. + * @member {Uint8Array} audioContent + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @instance + */ + UploadEvaluationAudioRequest.prototype.audioContent = $util.newBuffer([]); + + /** + * Creates a new UploadEvaluationAudioRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @static + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioRequest} UploadEvaluationAudioRequest instance + */ + UploadEvaluationAudioRequest.create = function create(properties) { + return new UploadEvaluationAudioRequest(properties); + }; + + /** + * Encodes the specified UploadEvaluationAudioRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @static + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioRequest} message UploadEvaluationAudioRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UploadEvaluationAudioRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.app); + if (message.audioContent != null && Object.hasOwnProperty.call(message, "audioContent")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audioContent); + return writer; + }; + + /** + * Encodes the specified UploadEvaluationAudioRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @static + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioRequest} message UploadEvaluationAudioRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UploadEvaluationAudioRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UploadEvaluationAudioRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioRequest} UploadEvaluationAudioRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UploadEvaluationAudioRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UploadEvaluationAudioRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.app = reader.string(); + break; + } + case 2: { + message.audioContent = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UploadEvaluationAudioRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioRequest} UploadEvaluationAudioRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UploadEvaluationAudioRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UploadEvaluationAudioRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UploadEvaluationAudioRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.app != null && message.hasOwnProperty("app")) + if (!$util.isString(message.app)) + return "app: string expected"; + if (message.audioContent != null && message.hasOwnProperty("audioContent")) + if (!(message.audioContent && typeof message.audioContent.length === "number" || $util.isString(message.audioContent))) + return "audioContent: buffer expected"; + return null; + }; + + /** + * Creates an UploadEvaluationAudioRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioRequest} UploadEvaluationAudioRequest + */ + UploadEvaluationAudioRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UploadEvaluationAudioRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UploadEvaluationAudioRequest(); + if (object.app != null) + message.app = String(object.app); + if (object.audioContent != null) + if (typeof object.audioContent === "string") + $util.base64.decode(object.audioContent, message.audioContent = $util.newBuffer($util.base64.length(object.audioContent)), 0); + else if (object.audioContent.length >= 0) + message.audioContent = object.audioContent; + return message; + }; + + /** + * Creates a plain object from an UploadEvaluationAudioRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @static + * @param {google.cloud.ces.v1beta.UploadEvaluationAudioRequest} message UploadEvaluationAudioRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UploadEvaluationAudioRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.app = ""; + if (options.bytes === String) + object.audioContent = ""; + else { + object.audioContent = []; + if (options.bytes !== Array) + object.audioContent = $util.newBuffer(object.audioContent); + } + } + if (message.app != null && message.hasOwnProperty("app")) + object.app = message.app; + if (message.audioContent != null && message.hasOwnProperty("audioContent")) + object.audioContent = options.bytes === String ? $util.base64.encode(message.audioContent, 0, message.audioContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.audioContent) : message.audioContent; + return object; + }; + + /** + * Converts this UploadEvaluationAudioRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @instance + * @returns {Object.} JSON object + */ + UploadEvaluationAudioRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UploadEvaluationAudioRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UploadEvaluationAudioRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UploadEvaluationAudioRequest"; + }; + + return UploadEvaluationAudioRequest; + })(); + + v1beta.UploadEvaluationAudioResponse = (function() { + + /** + * Properties of an UploadEvaluationAudioResponse. + * @memberof google.cloud.ces.v1beta + * @interface IUploadEvaluationAudioResponse + * @property {string|null} [audioGcsUri] UploadEvaluationAudioResponse audioGcsUri + * @property {string|null} [audioTranscript] UploadEvaluationAudioResponse audioTranscript + * @property {google.protobuf.IDuration|null} [audioDuration] UploadEvaluationAudioResponse audioDuration + */ + + /** + * Constructs a new UploadEvaluationAudioResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UploadEvaluationAudioResponse. + * @implements IUploadEvaluationAudioResponse + * @constructor + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioResponse=} [properties] Properties to set + */ + function UploadEvaluationAudioResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UploadEvaluationAudioResponse audioGcsUri. + * @member {string} audioGcsUri + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @instance + */ + UploadEvaluationAudioResponse.prototype.audioGcsUri = ""; + + /** + * UploadEvaluationAudioResponse audioTranscript. + * @member {string} audioTranscript + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @instance + */ + UploadEvaluationAudioResponse.prototype.audioTranscript = ""; + + /** + * UploadEvaluationAudioResponse audioDuration. + * @member {google.protobuf.IDuration|null|undefined} audioDuration + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @instance + */ + UploadEvaluationAudioResponse.prototype.audioDuration = null; + + /** + * Creates a new UploadEvaluationAudioResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @static + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioResponse} UploadEvaluationAudioResponse instance + */ + UploadEvaluationAudioResponse.create = function create(properties) { + return new UploadEvaluationAudioResponse(properties); + }; + + /** + * Encodes the specified UploadEvaluationAudioResponse message. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @static + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioResponse} message UploadEvaluationAudioResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UploadEvaluationAudioResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioGcsUri != null && Object.hasOwnProperty.call(message, "audioGcsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.audioGcsUri); + if (message.audioTranscript != null && Object.hasOwnProperty.call(message, "audioTranscript")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.audioTranscript); + if (message.audioDuration != null && Object.hasOwnProperty.call(message, "audioDuration")) + $root.google.protobuf.Duration.encode(message.audioDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UploadEvaluationAudioResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UploadEvaluationAudioResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @static + * @param {google.cloud.ces.v1beta.IUploadEvaluationAudioResponse} message UploadEvaluationAudioResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UploadEvaluationAudioResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UploadEvaluationAudioResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioResponse} UploadEvaluationAudioResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UploadEvaluationAudioResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UploadEvaluationAudioResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audioGcsUri = reader.string(); + break; + } + case 2: { + message.audioTranscript = reader.string(); + break; + } + case 3: { + message.audioDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UploadEvaluationAudioResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioResponse} UploadEvaluationAudioResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UploadEvaluationAudioResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UploadEvaluationAudioResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UploadEvaluationAudioResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.audioGcsUri != null && message.hasOwnProperty("audioGcsUri")) + if (!$util.isString(message.audioGcsUri)) + return "audioGcsUri: string expected"; + if (message.audioTranscript != null && message.hasOwnProperty("audioTranscript")) + if (!$util.isString(message.audioTranscript)) + return "audioTranscript: string expected"; + if (message.audioDuration != null && message.hasOwnProperty("audioDuration")) { + var error = $root.google.protobuf.Duration.verify(message.audioDuration); + if (error) + return "audioDuration." + error; + } + return null; + }; + + /** + * Creates an UploadEvaluationAudioResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UploadEvaluationAudioResponse} UploadEvaluationAudioResponse + */ + UploadEvaluationAudioResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UploadEvaluationAudioResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.UploadEvaluationAudioResponse(); + if (object.audioGcsUri != null) + message.audioGcsUri = String(object.audioGcsUri); + if (object.audioTranscript != null) + message.audioTranscript = String(object.audioTranscript); + if (object.audioDuration != null) { + if (typeof object.audioDuration !== "object") + throw TypeError(".google.cloud.ces.v1beta.UploadEvaluationAudioResponse.audioDuration: object expected"); + message.audioDuration = $root.google.protobuf.Duration.fromObject(object.audioDuration); + } + return message; + }; + + /** + * Creates a plain object from an UploadEvaluationAudioResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @static + * @param {google.cloud.ces.v1beta.UploadEvaluationAudioResponse} message UploadEvaluationAudioResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UploadEvaluationAudioResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.audioGcsUri = ""; + object.audioTranscript = ""; + object.audioDuration = null; + } + if (message.audioGcsUri != null && message.hasOwnProperty("audioGcsUri")) + object.audioGcsUri = message.audioGcsUri; + if (message.audioTranscript != null && message.hasOwnProperty("audioTranscript")) + object.audioTranscript = message.audioTranscript; + if (message.audioDuration != null && message.hasOwnProperty("audioDuration")) + object.audioDuration = $root.google.protobuf.Duration.toObject(message.audioDuration, options); + return object; + }; + + /** + * Converts this UploadEvaluationAudioResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @instance + * @returns {Object.} JSON object + */ + UploadEvaluationAudioResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UploadEvaluationAudioResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UploadEvaluationAudioResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UploadEvaluationAudioResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UploadEvaluationAudioResponse"; + }; + + return UploadEvaluationAudioResponse; + })(); + + v1beta.TestPersonaVoiceResponse = (function() { + + /** + * Properties of a TestPersonaVoiceResponse. + * @memberof google.cloud.ces.v1beta + * @interface ITestPersonaVoiceResponse + * @property {Uint8Array|null} [audio] TestPersonaVoiceResponse audio + */ + + /** + * Constructs a new TestPersonaVoiceResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a TestPersonaVoiceResponse. + * @implements ITestPersonaVoiceResponse + * @constructor + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceResponse=} [properties] Properties to set + */ + function TestPersonaVoiceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestPersonaVoiceResponse audio. + * @member {Uint8Array} audio + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @instance + */ + TestPersonaVoiceResponse.prototype.audio = $util.newBuffer([]); + + /** + * Creates a new TestPersonaVoiceResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @static + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.TestPersonaVoiceResponse} TestPersonaVoiceResponse instance + */ + TestPersonaVoiceResponse.create = function create(properties) { + return new TestPersonaVoiceResponse(properties); + }; + + /** + * Encodes the specified TestPersonaVoiceResponse message. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @static + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceResponse} message TestPersonaVoiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestPersonaVoiceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.audio); + return writer; + }; + + /** + * Encodes the specified TestPersonaVoiceResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.TestPersonaVoiceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @static + * @param {google.cloud.ces.v1beta.ITestPersonaVoiceResponse} message TestPersonaVoiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestPersonaVoiceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestPersonaVoiceResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.TestPersonaVoiceResponse} TestPersonaVoiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestPersonaVoiceResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.TestPersonaVoiceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.audio = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestPersonaVoiceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.TestPersonaVoiceResponse} TestPersonaVoiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestPersonaVoiceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestPersonaVoiceResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestPersonaVoiceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.audio != null && message.hasOwnProperty("audio")) + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; + return null; + }; + + /** + * Creates a TestPersonaVoiceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.TestPersonaVoiceResponse} TestPersonaVoiceResponse + */ + TestPersonaVoiceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.TestPersonaVoiceResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.TestPersonaVoiceResponse(); + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length >= 0) + message.audio = object.audio; + return message; + }; + + /** + * Creates a plain object from a TestPersonaVoiceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @static + * @param {google.cloud.ces.v1beta.TestPersonaVoiceResponse} message TestPersonaVoiceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestPersonaVoiceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.audio = ""; + else { + object.audio = []; + if (options.bytes !== Array) + object.audio = $util.newBuffer(object.audio); + } + if (message.audio != null && message.hasOwnProperty("audio")) + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; + return object; + }; + + /** + * Converts this TestPersonaVoiceResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @instance + * @returns {Object.} JSON object + */ + TestPersonaVoiceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestPersonaVoiceResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.TestPersonaVoiceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestPersonaVoiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.TestPersonaVoiceResponse"; + }; + + return TestPersonaVoiceResponse; + })(); + + v1beta.CreateEvaluationExpectationRequest = (function() { + + /** + * Properties of a CreateEvaluationExpectationRequest. + * @memberof google.cloud.ces.v1beta + * @interface ICreateEvaluationExpectationRequest + * @property {string|null} [parent] CreateEvaluationExpectationRequest parent + * @property {string|null} [evaluationExpectationId] CreateEvaluationExpectationRequest evaluationExpectationId + * @property {google.cloud.ces.v1beta.IEvaluationExpectation|null} [evaluationExpectation] CreateEvaluationExpectationRequest evaluationExpectation + */ + + /** + * Constructs a new CreateEvaluationExpectationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a CreateEvaluationExpectationRequest. + * @implements ICreateEvaluationExpectationRequest + * @constructor + * @param {google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest=} [properties] Properties to set + */ + function CreateEvaluationExpectationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEvaluationExpectationRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @instance + */ + CreateEvaluationExpectationRequest.prototype.parent = ""; + + /** + * CreateEvaluationExpectationRequest evaluationExpectationId. + * @member {string} evaluationExpectationId + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @instance + */ + CreateEvaluationExpectationRequest.prototype.evaluationExpectationId = ""; + + /** + * CreateEvaluationExpectationRequest evaluationExpectation. + * @member {google.cloud.ces.v1beta.IEvaluationExpectation|null|undefined} evaluationExpectation + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @instance + */ + CreateEvaluationExpectationRequest.prototype.evaluationExpectation = null; + + /** + * Creates a new CreateEvaluationExpectationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.CreateEvaluationExpectationRequest} CreateEvaluationExpectationRequest instance + */ + CreateEvaluationExpectationRequest.create = function create(properties) { + return new CreateEvaluationExpectationRequest(properties); + }; + + /** + * Encodes the specified CreateEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationExpectationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest} message CreateEvaluationExpectationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEvaluationExpectationRequest.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.evaluationExpectationId != null && Object.hasOwnProperty.call(message, "evaluationExpectationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluationExpectationId); + if (message.evaluationExpectation != null && Object.hasOwnProperty.call(message, "evaluationExpectation")) + $root.google.cloud.ces.v1beta.EvaluationExpectation.encode(message.evaluationExpectation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.CreateEvaluationExpectationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.ICreateEvaluationExpectationRequest} message CreateEvaluationExpectationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEvaluationExpectationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEvaluationExpectationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.CreateEvaluationExpectationRequest} CreateEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEvaluationExpectationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.evaluationExpectationId = reader.string(); + break; + } + case 3: { + message.evaluationExpectation = $root.google.cloud.ces.v1beta.EvaluationExpectation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEvaluationExpectationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.CreateEvaluationExpectationRequest} CreateEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEvaluationExpectationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEvaluationExpectationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEvaluationExpectationRequest.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.evaluationExpectationId != null && message.hasOwnProperty("evaluationExpectationId")) + if (!$util.isString(message.evaluationExpectationId)) + return "evaluationExpectationId: string expected"; + if (message.evaluationExpectation != null && message.hasOwnProperty("evaluationExpectation")) { + var error = $root.google.cloud.ces.v1beta.EvaluationExpectation.verify(message.evaluationExpectation); + if (error) + return "evaluationExpectation." + error; + } + return null; + }; + + /** + * Creates a CreateEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.CreateEvaluationExpectationRequest} CreateEvaluationExpectationRequest + */ + CreateEvaluationExpectationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.CreateEvaluationExpectationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.evaluationExpectationId != null) + message.evaluationExpectationId = String(object.evaluationExpectationId); + if (object.evaluationExpectation != null) { + if (typeof object.evaluationExpectation !== "object") + throw TypeError(".google.cloud.ces.v1beta.CreateEvaluationExpectationRequest.evaluationExpectation: object expected"); + message.evaluationExpectation = $root.google.cloud.ces.v1beta.EvaluationExpectation.fromObject(object.evaluationExpectation); + } + return message; + }; + + /** + * Creates a plain object from a CreateEvaluationExpectationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.CreateEvaluationExpectationRequest} message CreateEvaluationExpectationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEvaluationExpectationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.evaluationExpectationId = ""; + object.evaluationExpectation = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.evaluationExpectationId != null && message.hasOwnProperty("evaluationExpectationId")) + object.evaluationExpectationId = message.evaluationExpectationId; + if (message.evaluationExpectation != null && message.hasOwnProperty("evaluationExpectation")) + object.evaluationExpectation = $root.google.cloud.ces.v1beta.EvaluationExpectation.toObject(message.evaluationExpectation, options); + return object; + }; + + /** + * Converts this CreateEvaluationExpectationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEvaluationExpectationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEvaluationExpectationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.CreateEvaluationExpectationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEvaluationExpectationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.CreateEvaluationExpectationRequest"; + }; + + return CreateEvaluationExpectationRequest; + })(); + + v1beta.UpdateEvaluationExpectationRequest = (function() { + + /** + * Properties of an UpdateEvaluationExpectationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IUpdateEvaluationExpectationRequest + * @property {google.cloud.ces.v1beta.IEvaluationExpectation|null} [evaluationExpectation] UpdateEvaluationExpectationRequest evaluationExpectation + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEvaluationExpectationRequest updateMask + */ + + /** + * Constructs a new UpdateEvaluationExpectationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an UpdateEvaluationExpectationRequest. + * @implements IUpdateEvaluationExpectationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest=} [properties] Properties to set + */ + function UpdateEvaluationExpectationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateEvaluationExpectationRequest evaluationExpectation. + * @member {google.cloud.ces.v1beta.IEvaluationExpectation|null|undefined} evaluationExpectation + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @instance + */ + UpdateEvaluationExpectationRequest.prototype.evaluationExpectation = null; + + /** + * UpdateEvaluationExpectationRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @instance + */ + UpdateEvaluationExpectationRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateEvaluationExpectationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest} UpdateEvaluationExpectationRequest instance + */ + UpdateEvaluationExpectationRequest.create = function create(properties) { + return new UpdateEvaluationExpectationRequest(properties); + }; + + /** + * Encodes the specified UpdateEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest} message UpdateEvaluationExpectationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEvaluationExpectationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationExpectation != null && Object.hasOwnProperty.call(message, "evaluationExpectation")) + $root.google.cloud.ces.v1beta.EvaluationExpectation.encode(message.evaluationExpectation, 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 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.IUpdateEvaluationExpectationRequest} message UpdateEvaluationExpectationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEvaluationExpectationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEvaluationExpectationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest} UpdateEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEvaluationExpectationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.evaluationExpectation = $root.google.cloud.ces.v1beta.EvaluationExpectation.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateEvaluationExpectationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest} UpdateEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEvaluationExpectationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEvaluationExpectationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEvaluationExpectationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationExpectation != null && message.hasOwnProperty("evaluationExpectation")) { + var error = $root.google.cloud.ces.v1beta.EvaluationExpectation.verify(message.evaluationExpectation); + if (error) + return "evaluationExpectation." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest} UpdateEvaluationExpectationRequest + */ + UpdateEvaluationExpectationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest(); + if (object.evaluationExpectation != null) { + if (typeof object.evaluationExpectation !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest.evaluationExpectation: object expected"); + message.evaluationExpectation = $root.google.cloud.ces.v1beta.EvaluationExpectation.fromObject(object.evaluationExpectation); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateEvaluationExpectationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest} message UpdateEvaluationExpectationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEvaluationExpectationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.evaluationExpectation = null; + object.updateMask = null; + } + if (message.evaluationExpectation != null && message.hasOwnProperty("evaluationExpectation")) + object.evaluationExpectation = $root.google.cloud.ces.v1beta.EvaluationExpectation.toObject(message.evaluationExpectation, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateEvaluationExpectationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEvaluationExpectationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEvaluationExpectationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEvaluationExpectationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.UpdateEvaluationExpectationRequest"; + }; + + return UpdateEvaluationExpectationRequest; + })(); + + v1beta.DeleteEvaluationExpectationRequest = (function() { + + /** + * Properties of a DeleteEvaluationExpectationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IDeleteEvaluationExpectationRequest + * @property {string|null} [name] DeleteEvaluationExpectationRequest name + * @property {string|null} [etag] DeleteEvaluationExpectationRequest etag + */ + + /** + * Constructs a new DeleteEvaluationExpectationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a DeleteEvaluationExpectationRequest. + * @implements IDeleteEvaluationExpectationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest=} [properties] Properties to set + */ + function DeleteEvaluationExpectationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEvaluationExpectationRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @instance + */ + DeleteEvaluationExpectationRequest.prototype.name = ""; + + /** + * DeleteEvaluationExpectationRequest etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @instance + */ + DeleteEvaluationExpectationRequest.prototype.etag = ""; + + /** + * Creates a new DeleteEvaluationExpectationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest} DeleteEvaluationExpectationRequest instance + */ + DeleteEvaluationExpectationRequest.create = function create(properties) { + return new DeleteEvaluationExpectationRequest(properties); + }; + + /** + * Encodes the specified DeleteEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest} message DeleteEvaluationExpectationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationExpectationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.IDeleteEvaluationExpectationRequest} message DeleteEvaluationExpectationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEvaluationExpectationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEvaluationExpectationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest} DeleteEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationExpectationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEvaluationExpectationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest} DeleteEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEvaluationExpectationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEvaluationExpectationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEvaluationExpectationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest} DeleteEvaluationExpectationRequest + */ + DeleteEvaluationExpectationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteEvaluationExpectationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest} message DeleteEvaluationExpectationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEvaluationExpectationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteEvaluationExpectationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEvaluationExpectationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEvaluationExpectationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEvaluationExpectationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.DeleteEvaluationExpectationRequest"; + }; + + return DeleteEvaluationExpectationRequest; + })(); + + v1beta.GetEvaluationExpectationRequest = (function() { + + /** + * Properties of a GetEvaluationExpectationRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGetEvaluationExpectationRequest + * @property {string|null} [name] GetEvaluationExpectationRequest name + */ + + /** + * Constructs a new GetEvaluationExpectationRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GetEvaluationExpectationRequest. + * @implements IGetEvaluationExpectationRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGetEvaluationExpectationRequest=} [properties] Properties to set + */ + function GetEvaluationExpectationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvaluationExpectationRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @instance + */ + GetEvaluationExpectationRequest.prototype.name = ""; + + /** + * Creates a new GetEvaluationExpectationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationExpectationRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GetEvaluationExpectationRequest} GetEvaluationExpectationRequest instance + */ + GetEvaluationExpectationRequest.create = function create(properties) { + return new GetEvaluationExpectationRequest(properties); + }; + + /** + * Encodes the specified GetEvaluationExpectationRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationExpectationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationExpectationRequest} message GetEvaluationExpectationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationExpectationRequest.encode = function encode(message, writer) { + 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 GetEvaluationExpectationRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GetEvaluationExpectationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.IGetEvaluationExpectationRequest} message GetEvaluationExpectationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationExpectationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvaluationExpectationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GetEvaluationExpectationRequest} GetEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationExpectationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GetEvaluationExpectationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvaluationExpectationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GetEvaluationExpectationRequest} GetEvaluationExpectationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationExpectationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvaluationExpectationRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvaluationExpectationRequest.verify = function verify(message) { + if (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 GetEvaluationExpectationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GetEvaluationExpectationRequest} GetEvaluationExpectationRequest + */ + GetEvaluationExpectationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GetEvaluationExpectationRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GetEvaluationExpectationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEvaluationExpectationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @static + * @param {google.cloud.ces.v1beta.GetEvaluationExpectationRequest} message GetEvaluationExpectationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvaluationExpectationRequest.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 GetEvaluationExpectationRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvaluationExpectationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEvaluationExpectationRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GetEvaluationExpectationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEvaluationExpectationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GetEvaluationExpectationRequest"; + }; + + return GetEvaluationExpectationRequest; + })(); + + v1beta.ListEvaluationExpectationsRequest = (function() { + + /** + * Properties of a ListEvaluationExpectationsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationExpectationsRequest + * @property {string|null} [parent] ListEvaluationExpectationsRequest parent + * @property {number|null} [pageSize] ListEvaluationExpectationsRequest pageSize + * @property {string|null} [pageToken] ListEvaluationExpectationsRequest pageToken + * @property {string|null} [filter] ListEvaluationExpectationsRequest filter + * @property {string|null} [orderBy] ListEvaluationExpectationsRequest orderBy + */ + + /** + * Constructs a new ListEvaluationExpectationsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationExpectationsRequest. + * @implements IListEvaluationExpectationsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsRequest=} [properties] Properties to set + */ + function ListEvaluationExpectationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationExpectationsRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @instance + */ + ListEvaluationExpectationsRequest.prototype.parent = ""; + + /** + * ListEvaluationExpectationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @instance + */ + ListEvaluationExpectationsRequest.prototype.pageSize = 0; + + /** + * ListEvaluationExpectationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @instance + */ + ListEvaluationExpectationsRequest.prototype.pageToken = ""; + + /** + * ListEvaluationExpectationsRequest filter. + * @member {string} filter + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @instance + */ + ListEvaluationExpectationsRequest.prototype.filter = ""; + + /** + * ListEvaluationExpectationsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @instance + */ + ListEvaluationExpectationsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListEvaluationExpectationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsRequest} ListEvaluationExpectationsRequest instance + */ + ListEvaluationExpectationsRequest.create = function create(properties) { + return new ListEvaluationExpectationsRequest(properties); + }; + + /** + * Encodes the specified ListEvaluationExpectationsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsRequest} message ListEvaluationExpectationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationExpectationsRequest.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 ListEvaluationExpectationsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsRequest} message ListEvaluationExpectationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationExpectationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationExpectationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsRequest} ListEvaluationExpectationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationExpectationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationExpectationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsRequest} ListEvaluationExpectationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationExpectationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationExpectationsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationExpectationsRequest.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 ListEvaluationExpectationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsRequest} ListEvaluationExpectationsRequest + */ + ListEvaluationExpectationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationExpectationsRequest(); + 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 ListEvaluationExpectationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationExpectationsRequest} message ListEvaluationExpectationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationExpectationsRequest.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 ListEvaluationExpectationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationExpectationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationExpectationsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationExpectationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationExpectationsRequest"; + }; + + return ListEvaluationExpectationsRequest; + })(); + + v1beta.ListEvaluationExpectationsResponse = (function() { + + /** + * Properties of a ListEvaluationExpectationsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IListEvaluationExpectationsResponse + * @property {Array.|null} [evaluationExpectations] ListEvaluationExpectationsResponse evaluationExpectations + * @property {string|null} [nextPageToken] ListEvaluationExpectationsResponse nextPageToken + */ + + /** + * Constructs a new ListEvaluationExpectationsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ListEvaluationExpectationsResponse. + * @implements IListEvaluationExpectationsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsResponse=} [properties] Properties to set + */ + function ListEvaluationExpectationsResponse(properties) { + this.evaluationExpectations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationExpectationsResponse evaluationExpectations. + * @member {Array.} evaluationExpectations + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @instance + */ + ListEvaluationExpectationsResponse.prototype.evaluationExpectations = $util.emptyArray; + + /** + * ListEvaluationExpectationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @instance + */ + ListEvaluationExpectationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEvaluationExpectationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsResponse} ListEvaluationExpectationsResponse instance + */ + ListEvaluationExpectationsResponse.create = function create(properties) { + return new ListEvaluationExpectationsResponse(properties); + }; + + /** + * Encodes the specified ListEvaluationExpectationsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsResponse} message ListEvaluationExpectationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationExpectationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationExpectations != null && message.evaluationExpectations.length) + for (var i = 0; i < message.evaluationExpectations.length; ++i) + $root.google.cloud.ces.v1beta.EvaluationExpectation.encode(message.evaluationExpectations[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 ListEvaluationExpectationsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @static + * @param {google.cloud.ces.v1beta.IListEvaluationExpectationsResponse} message ListEvaluationExpectationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationExpectationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationExpectationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsResponse} ListEvaluationExpectationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationExpectationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ListEvaluationExpectationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.evaluationExpectations && message.evaluationExpectations.length)) + message.evaluationExpectations = []; + message.evaluationExpectations.push($root.google.cloud.ces.v1beta.EvaluationExpectation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationExpectationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsResponse} ListEvaluationExpectationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationExpectationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationExpectationsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationExpectationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationExpectations != null && message.hasOwnProperty("evaluationExpectations")) { + if (!Array.isArray(message.evaluationExpectations)) + return "evaluationExpectations: array expected"; + for (var i = 0; i < message.evaluationExpectations.length; ++i) { + var error = $root.google.cloud.ces.v1beta.EvaluationExpectation.verify(message.evaluationExpectations[i]); + if (error) + return "evaluationExpectations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEvaluationExpectationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ListEvaluationExpectationsResponse} ListEvaluationExpectationsResponse + */ + ListEvaluationExpectationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ListEvaluationExpectationsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ListEvaluationExpectationsResponse(); + if (object.evaluationExpectations) { + if (!Array.isArray(object.evaluationExpectations)) + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.evaluationExpectations: array expected"); + message.evaluationExpectations = []; + for (var i = 0; i < object.evaluationExpectations.length; ++i) { + if (typeof object.evaluationExpectations[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.ListEvaluationExpectationsResponse.evaluationExpectations: object expected"); + message.evaluationExpectations[i] = $root.google.cloud.ces.v1beta.EvaluationExpectation.fromObject(object.evaluationExpectations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEvaluationExpectationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @static + * @param {google.cloud.ces.v1beta.ListEvaluationExpectationsResponse} message ListEvaluationExpectationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationExpectationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluationExpectations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.evaluationExpectations && message.evaluationExpectations.length) { + object.evaluationExpectations = []; + for (var j = 0; j < message.evaluationExpectations.length; ++j) + object.evaluationExpectations[j] = $root.google.cloud.ces.v1beta.EvaluationExpectation.toObject(message.evaluationExpectations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEvaluationExpectationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationExpectationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationExpectationsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ListEvaluationExpectationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationExpectationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ListEvaluationExpectationsResponse"; + }; + + return ListEvaluationExpectationsResponse; + })(); + + v1beta.Omnichannel = (function() { + + /** + * Properties of an Omnichannel. + * @memberof google.cloud.ces.v1beta + * @interface IOmnichannel + * @property {string|null} [name] Omnichannel name + * @property {string|null} [displayName] Omnichannel displayName + * @property {string|null} [description] Omnichannel description + * @property {google.protobuf.ITimestamp|null} [createTime] Omnichannel createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Omnichannel updateTime + * @property {string|null} [etag] Omnichannel etag + * @property {google.cloud.ces.v1beta.IOmnichannelIntegrationConfig|null} [integrationConfig] Omnichannel integrationConfig + */ + + /** + * Constructs a new Omnichannel. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an Omnichannel. + * @implements IOmnichannel + * @constructor + * @param {google.cloud.ces.v1beta.IOmnichannel=} [properties] Properties to set + */ + function Omnichannel(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Omnichannel name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.Omnichannel + * @instance + */ + Omnichannel.prototype.name = ""; + + /** + * Omnichannel displayName. + * @member {string} displayName + * @memberof google.cloud.ces.v1beta.Omnichannel + * @instance + */ + Omnichannel.prototype.displayName = ""; + + /** + * Omnichannel description. + * @member {string} description + * @memberof google.cloud.ces.v1beta.Omnichannel + * @instance + */ + Omnichannel.prototype.description = ""; + + /** + * Omnichannel createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.Omnichannel + * @instance + */ + Omnichannel.prototype.createTime = null; + + /** + * Omnichannel updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.ces.v1beta.Omnichannel + * @instance + */ + Omnichannel.prototype.updateTime = null; + + /** + * Omnichannel etag. + * @member {string} etag + * @memberof google.cloud.ces.v1beta.Omnichannel + * @instance + */ + Omnichannel.prototype.etag = ""; + + /** + * Omnichannel integrationConfig. + * @member {google.cloud.ces.v1beta.IOmnichannelIntegrationConfig|null|undefined} integrationConfig + * @memberof google.cloud.ces.v1beta.Omnichannel + * @instance + */ + Omnichannel.prototype.integrationConfig = null; + + /** + * Creates a new Omnichannel instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.Omnichannel + * @static + * @param {google.cloud.ces.v1beta.IOmnichannel=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.Omnichannel} Omnichannel instance + */ + Omnichannel.create = function create(properties) { + return new Omnichannel(properties); + }; + + /** + * Encodes the specified Omnichannel message. Does not implicitly {@link google.cloud.ces.v1beta.Omnichannel.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.Omnichannel + * @static + * @param {google.cloud.ces.v1beta.IOmnichannel} message Omnichannel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Omnichannel.encode = function encode(message, writer) { + if (!writer) + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + 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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + if (message.integrationConfig != null && Object.hasOwnProperty.call(message, "integrationConfig")) + $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.encode(message.integrationConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Omnichannel message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.Omnichannel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.Omnichannel + * @static + * @param {google.cloud.ces.v1beta.IOmnichannel} message Omnichannel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Omnichannel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Omnichannel message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.Omnichannel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.Omnichannel} Omnichannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Omnichannel.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.Omnichannel(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = 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.etag = reader.string(); + break; + } + case 7: { + message.integrationConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Omnichannel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.Omnichannel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.Omnichannel} Omnichannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Omnichannel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Omnichannel message. + * @function verify + * @memberof google.cloud.ces.v1beta.Omnichannel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Omnichannel.verify = function verify(message) { + if (typeof message !== "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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.integrationConfig != null && message.hasOwnProperty("integrationConfig")) { + var error = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.verify(message.integrationConfig); + if (error) + return "integrationConfig." + error; + } + return null; + }; + + /** + * Creates an Omnichannel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.Omnichannel + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.Omnichannel} Omnichannel + */ + Omnichannel.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.Omnichannel) + return object; + var message = new $root.google.cloud.ces.v1beta.Omnichannel(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.Omnichannel.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.ces.v1beta.Omnichannel.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.integrationConfig != null) { + if (typeof object.integrationConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.Omnichannel.integrationConfig: object expected"); + message.integrationConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.fromObject(object.integrationConfig); + } + return message; + }; + + /** + * Creates a plain object from an Omnichannel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.Omnichannel + * @static + * @param {google.cloud.ces.v1beta.Omnichannel} message Omnichannel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Omnichannel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.integrationConfig = 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.integrationConfig != null && message.hasOwnProperty("integrationConfig")) + object.integrationConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.toObject(message.integrationConfig, options); + return object; + }; + + /** + * Converts this Omnichannel to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.Omnichannel + * @instance + * @returns {Object.} JSON object + */ + Omnichannel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Omnichannel + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.Omnichannel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Omnichannel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.Omnichannel"; + }; + + return Omnichannel; + })(); + + v1beta.OmnichannelIntegrationConfig = (function() { + + /** + * Properties of an OmnichannelIntegrationConfig. + * @memberof google.cloud.ces.v1beta + * @interface IOmnichannelIntegrationConfig + * @property {Object.|null} [channelConfigs] OmnichannelIntegrationConfig channelConfigs + * @property {Object.|null} [subscriberConfigs] OmnichannelIntegrationConfig subscriberConfigs + * @property {Object.|null} [routingConfigs] OmnichannelIntegrationConfig routingConfigs + */ + + /** + * Constructs a new OmnichannelIntegrationConfig. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an OmnichannelIntegrationConfig. + * @implements IOmnichannelIntegrationConfig + * @constructor + * @param {google.cloud.ces.v1beta.IOmnichannelIntegrationConfig=} [properties] Properties to set + */ + function OmnichannelIntegrationConfig(properties) { + this.channelConfigs = {}; + this.subscriberConfigs = {}; + this.routingConfigs = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OmnichannelIntegrationConfig channelConfigs. + * @member {Object.} channelConfigs + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @instance + */ + OmnichannelIntegrationConfig.prototype.channelConfigs = $util.emptyObject; + + /** + * OmnichannelIntegrationConfig subscriberConfigs. + * @member {Object.} subscriberConfigs + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @instance + */ + OmnichannelIntegrationConfig.prototype.subscriberConfigs = $util.emptyObject; + + /** + * OmnichannelIntegrationConfig routingConfigs. + * @member {Object.} routingConfigs + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @instance + */ + OmnichannelIntegrationConfig.prototype.routingConfigs = $util.emptyObject; + + /** + * Creates a new OmnichannelIntegrationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @static + * @param {google.cloud.ces.v1beta.IOmnichannelIntegrationConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig instance + */ + OmnichannelIntegrationConfig.create = function create(properties) { + return new OmnichannelIntegrationConfig(properties); + }; + + /** + * Encodes the specified OmnichannelIntegrationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @static + * @param {google.cloud.ces.v1beta.IOmnichannelIntegrationConfig} message OmnichannelIntegrationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OmnichannelIntegrationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channelConfigs != null && Object.hasOwnProperty.call(message, "channelConfigs")) + for (var keys = Object.keys(message.channelConfigs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.encode(message.channelConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.subscriberConfigs != null && Object.hasOwnProperty.call(message, "subscriberConfigs")) + for (var keys = Object.keys(message.subscriberConfigs), 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.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.encode(message.subscriberConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.routingConfigs != null && Object.hasOwnProperty.call(message, "routingConfigs")) + for (var keys = Object.keys(message.routingConfigs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.encode(message.routingConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified OmnichannelIntegrationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @static + * @param {google.cloud.ces.v1beta.IOmnichannelIntegrationConfig} message OmnichannelIntegrationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OmnichannelIntegrationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OmnichannelIntegrationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.channelConfigs === $util.emptyObject) + message.channelConfigs = {}; + 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.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.channelConfigs[key] = value; + break; + } + case 2: { + if (message.subscriberConfigs === $util.emptyObject) + message.subscriberConfigs = {}; + 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.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.subscriberConfigs[key] = value; + break; + } + case 3: { + if (message.routingConfigs === $util.emptyObject) + message.routingConfigs = {}; + 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.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.routingConfigs[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OmnichannelIntegrationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OmnichannelIntegrationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OmnichannelIntegrationConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OmnichannelIntegrationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channelConfigs != null && message.hasOwnProperty("channelConfigs")) { + if (!$util.isObject(message.channelConfigs)) + return "channelConfigs: object expected"; + var key = Object.keys(message.channelConfigs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.verify(message.channelConfigs[key[i]]); + if (error) + return "channelConfigs." + error; + } + } + if (message.subscriberConfigs != null && message.hasOwnProperty("subscriberConfigs")) { + if (!$util.isObject(message.subscriberConfigs)) + return "subscriberConfigs: object expected"; + var key = Object.keys(message.subscriberConfigs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.verify(message.subscriberConfigs[key[i]]); + if (error) + return "subscriberConfigs." + error; + } + } + if (message.routingConfigs != null && message.hasOwnProperty("routingConfigs")) { + if (!$util.isObject(message.routingConfigs)) + return "routingConfigs: object expected"; + var key = Object.keys(message.routingConfigs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.verify(message.routingConfigs[key[i]]); + if (error) + return "routingConfigs." + error; + } + } + return null; + }; + + /** + * Creates an OmnichannelIntegrationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig} OmnichannelIntegrationConfig + */ + OmnichannelIntegrationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig(); + if (object.channelConfigs) { + if (typeof object.channelConfigs !== "object") + throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.channelConfigs: object expected"); + message.channelConfigs = {}; + for (var keys = Object.keys(object.channelConfigs), i = 0; i < keys.length; ++i) { + if (typeof object.channelConfigs[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.channelConfigs: object expected"); + message.channelConfigs[keys[i]] = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.fromObject(object.channelConfigs[keys[i]]); + } + } + if (object.subscriberConfigs) { + if (typeof object.subscriberConfigs !== "object") + throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.subscriberConfigs: object expected"); + message.subscriberConfigs = {}; + for (var keys = Object.keys(object.subscriberConfigs), i = 0; i < keys.length; ++i) { + if (typeof object.subscriberConfigs[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.subscriberConfigs: object expected"); + message.subscriberConfigs[keys[i]] = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.fromObject(object.subscriberConfigs[keys[i]]); + } + } + if (object.routingConfigs) { + if (typeof object.routingConfigs !== "object") + throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.routingConfigs: object expected"); + message.routingConfigs = {}; + for (var keys = Object.keys(object.routingConfigs), i = 0; i < keys.length; ++i) { + if (typeof object.routingConfigs[keys[i]] !== "object") + throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.routingConfigs: object expected"); + message.routingConfigs[keys[i]] = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.fromObject(object.routingConfigs[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an OmnichannelIntegrationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig} message OmnichannelIntegrationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OmnichannelIntegrationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.channelConfigs = {}; + object.subscriberConfigs = {}; + object.routingConfigs = {}; + } + var keys2; + if (message.channelConfigs && (keys2 = Object.keys(message.channelConfigs)).length) { + object.channelConfigs = {}; + for (var j = 0; j < keys2.length; ++j) + object.channelConfigs[keys2[j]] = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.toObject(message.channelConfigs[keys2[j]], options); + } + if (message.subscriberConfigs && (keys2 = Object.keys(message.subscriberConfigs)).length) { + object.subscriberConfigs = {}; + for (var j = 0; j < keys2.length; ++j) + object.subscriberConfigs[keys2[j]] = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.toObject(message.subscriberConfigs[keys2[j]], options); + } + if (message.routingConfigs && (keys2 = Object.keys(message.routingConfigs)).length) { + object.routingConfigs = {}; + for (var j = 0; j < keys2.length; ++j) + object.routingConfigs[keys2[j]] = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.toObject(message.routingConfigs[keys2[j]], options); + } + return object; + }; + + /** + * Converts this OmnichannelIntegrationConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @instance + * @returns {Object.} JSON object + */ + OmnichannelIntegrationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OmnichannelIntegrationConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OmnichannelIntegrationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelIntegrationConfig"; + }; + + OmnichannelIntegrationConfig.ChannelConfig = (function() { + + /** + * Properties of a ChannelConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @interface IChannelConfig + * @property {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig|null} [whatsappConfig] ChannelConfig whatsappConfig + */ + + /** + * Constructs a new ChannelConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @classdesc Represents a ChannelConfig. + * @implements IChannelConfig + * @constructor + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig=} [properties] Properties to set + */ + function ChannelConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChannelConfig whatsappConfig. + * @member {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig|null|undefined} whatsappConfig + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @instance + */ + ChannelConfig.prototype.whatsappConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ChannelConfig channelConfig. + * @member {"whatsappConfig"|undefined} channelConfig + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @instance + */ + Object.defineProperty(ChannelConfig.prototype, "channelConfig", { + get: $util.oneOfGetter($oneOfFields = ["whatsappConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ChannelConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig instance + */ + ChannelConfig.create = function create(properties) { + return new ChannelConfig(properties); + }; + + /** + * Encodes the specified ChannelConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig} message ChannelConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.whatsappConfig != null && Object.hasOwnProperty.call(message, "whatsappConfig")) + $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.encode(message.whatsappConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ChannelConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IChannelConfig} message ChannelConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChannelConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.whatsappConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChannelConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChannelConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChannelConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.whatsappConfig != null && message.hasOwnProperty("whatsappConfig")) { + properties.channelConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.verify(message.whatsappConfig); + if (error) + return "whatsappConfig." + error; + } + } + return null; + }; + + /** + * Creates a ChannelConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig} ChannelConfig + */ + ChannelConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig(); + if (object.whatsappConfig != null) { + if (typeof object.whatsappConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig.whatsappConfig: object expected"); + message.whatsappConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.fromObject(object.whatsappConfig); + } + return message; + }; + + /** + * Creates a plain object from a ChannelConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig} message ChannelConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChannelConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.whatsappConfig != null && message.hasOwnProperty("whatsappConfig")) { + object.whatsappConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.toObject(message.whatsappConfig, options); + if (options.oneofs) + object.channelConfig = "whatsappConfig"; + } + return object; + }; + + /** + * Converts this ChannelConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @instance + * @returns {Object.} JSON object + */ + ChannelConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChannelConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChannelConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ChannelConfig"; + }; + + return ChannelConfig; + })(); + + OmnichannelIntegrationConfig.WhatsappConfig = (function() { + + /** + * Properties of a WhatsappConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @interface IWhatsappConfig + * @property {string|null} [phoneNumberId] WhatsappConfig phoneNumberId + * @property {string|null} [phoneNumber] WhatsappConfig phoneNumber + * @property {string|null} [whatsappBusinessAccountId] WhatsappConfig whatsappBusinessAccountId + * @property {string|null} [webhookVerifyToken] WhatsappConfig webhookVerifyToken + * @property {string|null} [whatsappBusinessToken] WhatsappConfig whatsappBusinessToken + * @property {string|null} [metaBusinessPortfolioId] WhatsappConfig metaBusinessPortfolioId + */ + + /** + * Constructs a new WhatsappConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @classdesc Represents a WhatsappConfig. + * @implements IWhatsappConfig + * @constructor + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig=} [properties] Properties to set + */ + function WhatsappConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WhatsappConfig phoneNumberId. + * @member {string} phoneNumberId + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + */ + WhatsappConfig.prototype.phoneNumberId = ""; + + /** + * WhatsappConfig phoneNumber. + * @member {string} phoneNumber + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + */ + WhatsappConfig.prototype.phoneNumber = ""; + + /** + * WhatsappConfig whatsappBusinessAccountId. + * @member {string} whatsappBusinessAccountId + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + */ + WhatsappConfig.prototype.whatsappBusinessAccountId = ""; + + /** + * WhatsappConfig webhookVerifyToken. + * @member {string} webhookVerifyToken + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + */ + WhatsappConfig.prototype.webhookVerifyToken = ""; + + /** + * WhatsappConfig whatsappBusinessToken. + * @member {string} whatsappBusinessToken + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + */ + WhatsappConfig.prototype.whatsappBusinessToken = ""; + + /** + * WhatsappConfig metaBusinessPortfolioId. + * @member {string} metaBusinessPortfolioId + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + */ + WhatsappConfig.prototype.metaBusinessPortfolioId = ""; + + /** + * Creates a new WhatsappConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig instance + */ + WhatsappConfig.create = function create(properties) { + return new WhatsappConfig(properties); + }; + + /** + * Encodes the specified WhatsappConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig} message WhatsappConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WhatsappConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phoneNumberId != null && Object.hasOwnProperty.call(message, "phoneNumberId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.phoneNumberId); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.phoneNumber); + if (message.whatsappBusinessAccountId != null && Object.hasOwnProperty.call(message, "whatsappBusinessAccountId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.whatsappBusinessAccountId); + if (message.webhookVerifyToken != null && Object.hasOwnProperty.call(message, "webhookVerifyToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.webhookVerifyToken); + if (message.whatsappBusinessToken != null && Object.hasOwnProperty.call(message, "whatsappBusinessToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.whatsappBusinessToken); + if (message.metaBusinessPortfolioId != null && Object.hasOwnProperty.call(message, "metaBusinessPortfolioId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.metaBusinessPortfolioId); + return writer; + }; + + /** + * Encodes the specified WhatsappConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IWhatsappConfig} message WhatsappConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WhatsappConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WhatsappConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WhatsappConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.phoneNumberId = reader.string(); + break; + } + case 2: { + message.phoneNumber = reader.string(); + break; + } + case 3: { + message.whatsappBusinessAccountId = reader.string(); + break; + } + case 4: { + message.webhookVerifyToken = reader.string(); + break; + } + case 5: { + message.whatsappBusinessToken = reader.string(); + break; + } + case 6: { + message.metaBusinessPortfolioId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WhatsappConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WhatsappConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WhatsappConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WhatsappConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phoneNumberId != null && message.hasOwnProperty("phoneNumberId")) + if (!$util.isString(message.phoneNumberId)) + return "phoneNumberId: string expected"; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + if (!$util.isString(message.phoneNumber)) + return "phoneNumber: string expected"; + if (message.whatsappBusinessAccountId != null && message.hasOwnProperty("whatsappBusinessAccountId")) + if (!$util.isString(message.whatsappBusinessAccountId)) + return "whatsappBusinessAccountId: string expected"; + if (message.webhookVerifyToken != null && message.hasOwnProperty("webhookVerifyToken")) + if (!$util.isString(message.webhookVerifyToken)) + return "webhookVerifyToken: string expected"; + if (message.whatsappBusinessToken != null && message.hasOwnProperty("whatsappBusinessToken")) + if (!$util.isString(message.whatsappBusinessToken)) + return "whatsappBusinessToken: string expected"; + if (message.metaBusinessPortfolioId != null && message.hasOwnProperty("metaBusinessPortfolioId")) + if (!$util.isString(message.metaBusinessPortfolioId)) + return "metaBusinessPortfolioId: string expected"; + return null; + }; + + /** + * Creates a WhatsappConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig} WhatsappConfig + */ + WhatsappConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig(); + if (object.phoneNumberId != null) + message.phoneNumberId = String(object.phoneNumberId); + if (object.phoneNumber != null) + message.phoneNumber = String(object.phoneNumber); + if (object.whatsappBusinessAccountId != null) + message.whatsappBusinessAccountId = String(object.whatsappBusinessAccountId); + if (object.webhookVerifyToken != null) + message.webhookVerifyToken = String(object.webhookVerifyToken); + if (object.whatsappBusinessToken != null) + message.whatsappBusinessToken = String(object.whatsappBusinessToken); + if (object.metaBusinessPortfolioId != null) + message.metaBusinessPortfolioId = String(object.metaBusinessPortfolioId); + return message; + }; + + /** + * Creates a plain object from a WhatsappConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig} message WhatsappConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WhatsappConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.phoneNumberId = ""; + object.phoneNumber = ""; + object.whatsappBusinessAccountId = ""; + object.webhookVerifyToken = ""; + object.whatsappBusinessToken = ""; + object.metaBusinessPortfolioId = ""; + } + if (message.phoneNumberId != null && message.hasOwnProperty("phoneNumberId")) + object.phoneNumberId = message.phoneNumberId; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + object.phoneNumber = message.phoneNumber; + if (message.whatsappBusinessAccountId != null && message.hasOwnProperty("whatsappBusinessAccountId")) + object.whatsappBusinessAccountId = message.whatsappBusinessAccountId; + if (message.webhookVerifyToken != null && message.hasOwnProperty("webhookVerifyToken")) + object.webhookVerifyToken = message.webhookVerifyToken; + if (message.whatsappBusinessToken != null && message.hasOwnProperty("whatsappBusinessToken")) + object.whatsappBusinessToken = message.whatsappBusinessToken; + if (message.metaBusinessPortfolioId != null && message.hasOwnProperty("metaBusinessPortfolioId")) + object.metaBusinessPortfolioId = message.metaBusinessPortfolioId; + return object; + }; + + /** + * Converts this WhatsappConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @instance + * @returns {Object.} JSON object + */ + WhatsappConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WhatsappConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WhatsappConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelIntegrationConfig.WhatsappConfig"; + }; + + return WhatsappConfig; + })(); + + OmnichannelIntegrationConfig.SubscriberConfig = (function() { + + /** + * Properties of a SubscriberConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @interface ISubscriberConfig + * @property {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig|null} [cesAppConfig] SubscriberConfig cesAppConfig + */ + + /** + * Constructs a new SubscriberConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @classdesc Represents a SubscriberConfig. + * @implements ISubscriberConfig + * @constructor + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig=} [properties] Properties to set + */ + function SubscriberConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubscriberConfig cesAppConfig. + * @member {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig|null|undefined} cesAppConfig + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @instance + */ + SubscriberConfig.prototype.cesAppConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubscriberConfig subscriberConfig. + * @member {"cesAppConfig"|undefined} subscriberConfig + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @instance + */ + Object.defineProperty(SubscriberConfig.prototype, "subscriberConfig", { + get: $util.oneOfGetter($oneOfFields = ["cesAppConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubscriberConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig instance + */ + SubscriberConfig.create = function create(properties) { + return new SubscriberConfig(properties); + }; + + /** + * Encodes the specified SubscriberConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig} message SubscriberConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscriberConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cesAppConfig != null && Object.hasOwnProperty.call(message, "cesAppConfig")) + $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.encode(message.cesAppConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubscriberConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ISubscriberConfig} message SubscriberConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscriberConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscriberConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscriberConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cesAppConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubscriberConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscriberConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscriberConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscriberConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cesAppConfig != null && message.hasOwnProperty("cesAppConfig")) { + properties.subscriberConfig = 1; + { + var error = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.verify(message.cesAppConfig); + if (error) + return "cesAppConfig." + error; + } + } + return null; + }; + + /** + * Creates a SubscriberConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig} SubscriberConfig + */ + SubscriberConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig(); + if (object.cesAppConfig != null) { + if (typeof object.cesAppConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig.cesAppConfig: object expected"); + message.cesAppConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.fromObject(object.cesAppConfig); + } + return message; + }; + + /** + * Creates a plain object from a SubscriberConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig} message SubscriberConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscriberConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.cesAppConfig != null && message.hasOwnProperty("cesAppConfig")) { + object.cesAppConfig = $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.toObject(message.cesAppConfig, options); + if (options.oneofs) + object.subscriberConfig = "cesAppConfig"; + } + return object; + }; + + /** + * Converts this SubscriberConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @instance + * @returns {Object.} JSON object + */ + SubscriberConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubscriberConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubscriberConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelIntegrationConfig.SubscriberConfig"; + }; + + return SubscriberConfig; + })(); + + OmnichannelIntegrationConfig.CesAppConfig = (function() { + + /** + * Properties of a CesAppConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @interface ICesAppConfig + * @property {string|null} [app] CesAppConfig app + */ + + /** + * Constructs a new CesAppConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @classdesc Represents a CesAppConfig. + * @implements ICesAppConfig + * @constructor + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig=} [properties] Properties to set + */ + function CesAppConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CesAppConfig app. + * @member {string} app + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @instance + */ + CesAppConfig.prototype.app = ""; + + /** + * Creates a new CesAppConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig instance + */ + CesAppConfig.create = function create(properties) { + return new CesAppConfig(properties); + }; + + /** + * Encodes the specified CesAppConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig} message CesAppConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CesAppConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.app != null && Object.hasOwnProperty.call(message, "app")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.app); + return writer; + }; + + /** + * Encodes the specified CesAppConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.ICesAppConfig} message CesAppConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CesAppConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CesAppConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CesAppConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.app = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CesAppConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CesAppConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CesAppConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CesAppConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.app != null && message.hasOwnProperty("app")) + if (!$util.isString(message.app)) + return "app: string expected"; + return null; + }; + + /** + * Creates a CesAppConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig} CesAppConfig + */ + CesAppConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig(); + if (object.app != null) + message.app = String(object.app); + return message; + }; + + /** + * Creates a plain object from a CesAppConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig} message CesAppConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CesAppConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.app = ""; + if (message.app != null && message.hasOwnProperty("app")) + object.app = message.app; + return object; + }; + + /** + * Converts this CesAppConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @instance + * @returns {Object.} JSON object + */ + CesAppConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CesAppConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CesAppConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelIntegrationConfig.CesAppConfig"; + }; + + return CesAppConfig; + })(); + + OmnichannelIntegrationConfig.RoutingConfig = (function() { + + /** + * Properties of a RoutingConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @interface IRoutingConfig + * @property {string|null} [subscriberKey] RoutingConfig subscriberKey + */ + + /** + * Constructs a new RoutingConfig. + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig + * @classdesc Represents a RoutingConfig. + * @implements IRoutingConfig + * @constructor + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig=} [properties] Properties to set + */ + function RoutingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutingConfig subscriberKey. + * @member {string} subscriberKey + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @instance + */ + RoutingConfig.prototype.subscriberKey = ""; + + /** + * Creates a new RoutingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig instance + */ + RoutingConfig.create = function create(properties) { + return new RoutingConfig(properties); + }; + + /** + * Encodes the specified RoutingConfig message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig} message RoutingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscriberKey != null && Object.hasOwnProperty.call(message, "subscriberKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscriberKey); + return writer; + }; + + /** + * Encodes the specified RoutingConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.IRoutingConfig} message RoutingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.subscriberKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutingConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscriberKey != null && message.hasOwnProperty("subscriberKey")) + if (!$util.isString(message.subscriberKey)) + return "subscriberKey: string expected"; + return null; + }; + + /** + * Creates a RoutingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig} RoutingConfig + */ + RoutingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig(); + if (object.subscriberKey != null) + message.subscriberKey = String(object.subscriberKey); + return message; + }; + + /** + * Creates a plain object from a RoutingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig} message RoutingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.subscriberKey = ""; + if (message.subscriberKey != null && message.hasOwnProperty("subscriberKey")) + object.subscriberKey = message.subscriberKey; + return object; + }; + + /** + * Converts this RoutingConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @instance + * @returns {Object.} JSON object + */ + RoutingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutingConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelIntegrationConfig.RoutingConfig"; + }; + + return RoutingConfig; + })(); + + return OmnichannelIntegrationConfig; + })(); + + v1beta.OmnichannelOperationMetadata = (function() { + + /** + * Properties of an OmnichannelOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @interface IOmnichannelOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OmnichannelOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OmnichannelOperationMetadata endTime + * @property {string|null} [statusMessage] OmnichannelOperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OmnichannelOperationMetadata requestedCancellation + */ + + /** + * Constructs a new OmnichannelOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an OmnichannelOperationMetadata. + * @implements IOmnichannelOperationMetadata + * @constructor + * @param {google.cloud.ces.v1beta.IOmnichannelOperationMetadata=} [properties] Properties to set + */ + function OmnichannelOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OmnichannelOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @instance + */ + OmnichannelOperationMetadata.prototype.createTime = null; + + /** + * OmnichannelOperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @instance + */ + OmnichannelOperationMetadata.prototype.endTime = null; + + /** + * OmnichannelOperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @instance + */ + OmnichannelOperationMetadata.prototype.statusMessage = ""; + + /** + * OmnichannelOperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @instance + */ + OmnichannelOperationMetadata.prototype.requestedCancellation = false; + + /** + * Creates a new OmnichannelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IOmnichannelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.OmnichannelOperationMetadata} OmnichannelOperationMetadata instance + */ + OmnichannelOperationMetadata.create = function create(properties) { + return new OmnichannelOperationMetadata(properties); + }; + + /** + * Encodes the specified OmnichannelOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IOmnichannelOperationMetadata} message OmnichannelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OmnichannelOperationMetadata.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.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.requestedCancellation); + return writer; + }; + + /** + * Encodes the specified OmnichannelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.OmnichannelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IOmnichannelOperationMetadata} message OmnichannelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OmnichannelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.OmnichannelOperationMetadata} OmnichannelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OmnichannelOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.OmnichannelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + 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.statusMessage = reader.string(); + break; + } + case 4: { + message.requestedCancellation = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OmnichannelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.OmnichannelOperationMetadata} OmnichannelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OmnichannelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OmnichannelOperationMetadata message. + * @function verify + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OmnichannelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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.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"; + return null; + }; + + /** + * Creates an OmnichannelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.OmnichannelOperationMetadata} OmnichannelOperationMetadata + */ + OmnichannelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.OmnichannelOperationMetadata) + return object; + var message = new $root.google.cloud.ces.v1beta.OmnichannelOperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.OmnichannelOperationMetadata.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.ces.v1beta.OmnichannelOperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + return message; + }; + + /** + * Creates a plain object from an OmnichannelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.OmnichannelOperationMetadata} message OmnichannelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OmnichannelOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.statusMessage = ""; + object.requestedCancellation = false; + } + 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.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + return object; + }; + + /** + * Converts this OmnichannelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OmnichannelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OmnichannelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.OmnichannelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OmnichannelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.OmnichannelOperationMetadata"; + }; + + return OmnichannelOperationMetadata; + })(); + + v1beta.ToolService = (function() { + + /** + * Constructs a new ToolService service. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a ToolService + * @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 ToolService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ToolService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ToolService; + + /** + * Creates new ToolService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.ces.v1beta.ToolService + * @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 {ToolService} RPC service. Useful where requests and/or responses are streamed. + */ + ToolService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.ToolService|executeTool}. + * @memberof google.cloud.ces.v1beta.ToolService + * @typedef ExecuteToolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.ExecuteToolResponse} [response] ExecuteToolResponse + */ + + /** + * Calls ExecuteTool. + * @function executeTool + * @memberof google.cloud.ces.v1beta.ToolService + * @instance + * @param {google.cloud.ces.v1beta.IExecuteToolRequest} request ExecuteToolRequest message or plain object + * @param {google.cloud.ces.v1beta.ToolService.ExecuteToolCallback} callback Node-style callback called with the error, if any, and ExecuteToolResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ToolService.prototype.executeTool = function executeTool(request, callback) { + return this.rpcCall(executeTool, $root.google.cloud.ces.v1beta.ExecuteToolRequest, $root.google.cloud.ces.v1beta.ExecuteToolResponse, request, callback); + }, "name", { value: "ExecuteTool" }); + + /** + * Calls ExecuteTool. + * @function executeTool + * @memberof google.cloud.ces.v1beta.ToolService + * @instance + * @param {google.cloud.ces.v1beta.IExecuteToolRequest} request ExecuteToolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.ToolService|retrieveToolSchema}. + * @memberof google.cloud.ces.v1beta.ToolService + * @typedef RetrieveToolSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.RetrieveToolSchemaResponse} [response] RetrieveToolSchemaResponse + */ + + /** + * Calls RetrieveToolSchema. + * @function retrieveToolSchema + * @memberof google.cloud.ces.v1beta.ToolService + * @instance + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaRequest} request RetrieveToolSchemaRequest message or plain object + * @param {google.cloud.ces.v1beta.ToolService.RetrieveToolSchemaCallback} callback Node-style callback called with the error, if any, and RetrieveToolSchemaResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ToolService.prototype.retrieveToolSchema = function retrieveToolSchema(request, callback) { + return this.rpcCall(retrieveToolSchema, $root.google.cloud.ces.v1beta.RetrieveToolSchemaRequest, $root.google.cloud.ces.v1beta.RetrieveToolSchemaResponse, request, callback); + }, "name", { value: "RetrieveToolSchema" }); + + /** + * Calls RetrieveToolSchema. + * @function retrieveToolSchema + * @memberof google.cloud.ces.v1beta.ToolService + * @instance + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaRequest} request RetrieveToolSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.ces.v1beta.ToolService|retrieveTools}. + * @memberof google.cloud.ces.v1beta.ToolService + * @typedef RetrieveToolsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.RetrieveToolsResponse} [response] RetrieveToolsResponse + */ + + /** + * Calls RetrieveTools. + * @function retrieveTools + * @memberof google.cloud.ces.v1beta.ToolService + * @instance + * @param {google.cloud.ces.v1beta.IRetrieveToolsRequest} request RetrieveToolsRequest message or plain object + * @param {google.cloud.ces.v1beta.ToolService.RetrieveToolsCallback} callback Node-style callback called with the error, if any, and RetrieveToolsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ToolService.prototype.retrieveTools = function retrieveTools(request, callback) { + return this.rpcCall(retrieveTools, $root.google.cloud.ces.v1beta.RetrieveToolsRequest, $root.google.cloud.ces.v1beta.RetrieveToolsResponse, request, callback); + }, "name", { value: "RetrieveTools" }); + + /** + * Calls RetrieveTools. + * @function retrieveTools + * @memberof google.cloud.ces.v1beta.ToolService + * @instance + * @param {google.cloud.ces.v1beta.IRetrieveToolsRequest} request RetrieveToolsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ToolService; + })(); + + v1beta.ExecuteToolRequest = (function() { + + /** + * Properties of an ExecuteToolRequest. + * @memberof google.cloud.ces.v1beta + * @interface IExecuteToolRequest + * @property {string|null} [tool] ExecuteToolRequest tool + * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] ExecuteToolRequest toolsetTool + * @property {string|null} [parent] ExecuteToolRequest parent + * @property {google.protobuf.IStruct|null} [args] ExecuteToolRequest args + * @property {google.protobuf.IStruct|null} [variables] ExecuteToolRequest variables + */ + + /** + * Constructs a new ExecuteToolRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ExecuteToolRequest. + * @implements IExecuteToolRequest + * @constructor + * @param {google.cloud.ces.v1beta.IExecuteToolRequest=} [properties] Properties to set + */ + function ExecuteToolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteToolRequest tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @instance + */ + ExecuteToolRequest.prototype.tool = null; + + /** + * ExecuteToolRequest toolsetTool. + * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @instance + */ + ExecuteToolRequest.prototype.toolsetTool = null; + + /** + * ExecuteToolRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @instance + */ + ExecuteToolRequest.prototype.parent = ""; + + /** + * ExecuteToolRequest args. + * @member {google.protobuf.IStruct|null|undefined} args + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @instance + */ + ExecuteToolRequest.prototype.args = null; + + /** + * ExecuteToolRequest variables. + * @member {google.protobuf.IStruct|null|undefined} variables + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @instance + */ + ExecuteToolRequest.prototype.variables = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExecuteToolRequest toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @instance + */ + Object.defineProperty(ExecuteToolRequest.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecuteToolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @static + * @param {google.cloud.ces.v1beta.IExecuteToolRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ExecuteToolRequest} ExecuteToolRequest instance + */ + ExecuteToolRequest.create = function create(properties) { + return new ExecuteToolRequest(properties); + }; + + /** + * Encodes the specified ExecuteToolRequest message. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @static + * @param {google.cloud.ces.v1beta.IExecuteToolRequest} message ExecuteToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteToolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.args != null && Object.hasOwnProperty.call(message, "args")) + $root.google.protobuf.Struct.encode(message.args, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) + $root.google.protobuf.Struct.encode(message.variables, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteToolRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @static + * @param {google.cloud.ces.v1beta.IExecuteToolRequest} message ExecuteToolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteToolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteToolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ExecuteToolRequest} ExecuteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteToolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ExecuteToolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 3: { + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 4: { + message.parent = reader.string(); + break; + } + case 2: { + message.args = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 5: { + message.variables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteToolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ExecuteToolRequest} ExecuteToolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteToolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteToolRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteToolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.args != null && message.hasOwnProperty("args")) { + var error = $root.google.protobuf.Struct.verify(message.args); + if (error) + return "args." + error; + } + if (message.variables != null && message.hasOwnProperty("variables")) { + var error = $root.google.protobuf.Struct.verify(message.variables); + if (error) + return "variables." + error; + } + return null; + }; + + /** + * Creates an ExecuteToolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ExecuteToolRequest} ExecuteToolRequest + */ + ExecuteToolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ExecuteToolRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.ExecuteToolRequest(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.ExecuteToolRequest.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.args != null) { + if (typeof object.args !== "object") + throw TypeError(".google.cloud.ces.v1beta.ExecuteToolRequest.args: object expected"); + message.args = $root.google.protobuf.Struct.fromObject(object.args); + } + if (object.variables != null) { + if (typeof object.variables !== "object") + throw TypeError(".google.cloud.ces.v1beta.ExecuteToolRequest.variables: object expected"); + message.variables = $root.google.protobuf.Struct.fromObject(object.variables); + } + return message; + }; + + /** + * Creates a plain object from an ExecuteToolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @static + * @param {google.cloud.ces.v1beta.ExecuteToolRequest} message ExecuteToolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteToolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.args = null; + object.parent = ""; + object.variables = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.args != null && message.hasOwnProperty("args")) + object.args = $root.google.protobuf.Struct.toObject(message.args, options); + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.variables != null && message.hasOwnProperty("variables")) + object.variables = $root.google.protobuf.Struct.toObject(message.variables, options); + return object; + }; + + /** + * Converts this ExecuteToolRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @instance + * @returns {Object.} JSON object + */ + ExecuteToolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteToolRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ExecuteToolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteToolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ExecuteToolRequest"; + }; + + return ExecuteToolRequest; + })(); + + v1beta.ExecuteToolResponse = (function() { + + /** + * Properties of an ExecuteToolResponse. + * @memberof google.cloud.ces.v1beta + * @interface IExecuteToolResponse + * @property {string|null} [tool] ExecuteToolResponse tool + * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] ExecuteToolResponse toolsetTool + * @property {google.protobuf.IStruct|null} [response] ExecuteToolResponse response + * @property {google.protobuf.IStruct|null} [variables] ExecuteToolResponse variables + */ + + /** + * Constructs a new ExecuteToolResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents an ExecuteToolResponse. + * @implements IExecuteToolResponse + * @constructor + * @param {google.cloud.ces.v1beta.IExecuteToolResponse=} [properties] Properties to set + */ + function ExecuteToolResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteToolResponse tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @instance + */ + ExecuteToolResponse.prototype.tool = null; + + /** + * ExecuteToolResponse toolsetTool. + * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @instance + */ + ExecuteToolResponse.prototype.toolsetTool = null; + + /** + * ExecuteToolResponse response. + * @member {google.protobuf.IStruct|null|undefined} response + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @instance + */ + ExecuteToolResponse.prototype.response = null; + + /** + * ExecuteToolResponse variables. + * @member {google.protobuf.IStruct|null|undefined} variables + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @instance + */ + ExecuteToolResponse.prototype.variables = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExecuteToolResponse toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @instance + */ + Object.defineProperty(ExecuteToolResponse.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecuteToolResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @static + * @param {google.cloud.ces.v1beta.IExecuteToolResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.ExecuteToolResponse} ExecuteToolResponse instance + */ + ExecuteToolResponse.create = function create(properties) { + return new ExecuteToolResponse(properties); + }; + + /** + * Encodes the specified ExecuteToolResponse message. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @static + * @param {google.cloud.ces.v1beta.IExecuteToolResponse} message ExecuteToolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteToolResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Struct.encode(message.response, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) + $root.google.protobuf.Struct.encode(message.variables, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteToolResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.ExecuteToolResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @static + * @param {google.cloud.ces.v1beta.IExecuteToolResponse} message ExecuteToolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteToolResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteToolResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.ExecuteToolResponse} ExecuteToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteToolResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.ExecuteToolResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 3: { + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 2: { + message.response = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 4: { + message.variables = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteToolResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.ExecuteToolResponse} ExecuteToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteToolResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteToolResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteToolResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + var error = $root.google.protobuf.Struct.verify(message.response); + if (error) + return "response." + error; + } + if (message.variables != null && message.hasOwnProperty("variables")) { + var error = $root.google.protobuf.Struct.verify(message.variables); + if (error) + return "variables." + error; + } + return null; + }; + + /** + * Creates an ExecuteToolResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.ExecuteToolResponse} ExecuteToolResponse + */ + ExecuteToolResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.ExecuteToolResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.ExecuteToolResponse(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.ExecuteToolResponse.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.cloud.ces.v1beta.ExecuteToolResponse.response: object expected"); + message.response = $root.google.protobuf.Struct.fromObject(object.response); + } + if (object.variables != null) { + if (typeof object.variables !== "object") + throw TypeError(".google.cloud.ces.v1beta.ExecuteToolResponse.variables: object expected"); + message.variables = $root.google.protobuf.Struct.fromObject(object.variables); + } + return message; + }; + + /** + * Creates a plain object from an ExecuteToolResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @static + * @param {google.cloud.ces.v1beta.ExecuteToolResponse} message ExecuteToolResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteToolResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.response = null; + object.variables = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.response != null && message.hasOwnProperty("response")) + object.response = $root.google.protobuf.Struct.toObject(message.response, options); + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + if (message.variables != null && message.hasOwnProperty("variables")) + object.variables = $root.google.protobuf.Struct.toObject(message.variables, options); + return object; + }; + + /** + * Converts this ExecuteToolResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @instance + * @returns {Object.} JSON object + */ + ExecuteToolResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteToolResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.ExecuteToolResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteToolResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.ExecuteToolResponse"; + }; + + return ExecuteToolResponse; + })(); + + v1beta.RetrieveToolSchemaRequest = (function() { + + /** + * Properties of a RetrieveToolSchemaRequest. + * @memberof google.cloud.ces.v1beta + * @interface IRetrieveToolSchemaRequest + * @property {string|null} [tool] RetrieveToolSchemaRequest tool + * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] RetrieveToolSchemaRequest toolsetTool + * @property {string|null} [parent] RetrieveToolSchemaRequest parent + */ + + /** + * Constructs a new RetrieveToolSchemaRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RetrieveToolSchemaRequest. + * @implements IRetrieveToolSchemaRequest + * @constructor + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaRequest=} [properties] Properties to set + */ + function RetrieveToolSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrieveToolSchemaRequest tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @instance + */ + RetrieveToolSchemaRequest.prototype.tool = null; + + /** + * RetrieveToolSchemaRequest toolsetTool. + * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @instance + */ + RetrieveToolSchemaRequest.prototype.toolsetTool = null; + + /** + * RetrieveToolSchemaRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @instance + */ + RetrieveToolSchemaRequest.prototype.parent = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RetrieveToolSchemaRequest toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @instance + */ + Object.defineProperty(RetrieveToolSchemaRequest.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RetrieveToolSchemaRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest instance + */ + RetrieveToolSchemaRequest.create = function create(properties) { + return new RetrieveToolSchemaRequest(properties); + }; + + /** + * Encodes the specified RetrieveToolSchemaRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaRequest} message RetrieveToolSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolSchemaRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); + return writer; + }; + + /** + * Encodes the specified RetrieveToolSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaRequest} message RetrieveToolSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolSchemaRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RetrieveToolSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 3: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrieveToolSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrieveToolSchemaRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrieveToolSchemaRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a RetrieveToolSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaRequest} RetrieveToolSchemaRequest + */ + RetrieveToolSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RetrieveToolSchemaRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.RetrieveToolSchemaRequest(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.RetrieveToolSchemaRequest.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a RetrieveToolSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @static + * @param {google.cloud.ces.v1beta.RetrieveToolSchemaRequest} message RetrieveToolSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrieveToolSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this RetrieveToolSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + RetrieveToolSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrieveToolSchemaRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrieveToolSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RetrieveToolSchemaRequest"; + }; + + return RetrieveToolSchemaRequest; + })(); + + v1beta.RetrieveToolSchemaResponse = (function() { + + /** + * Properties of a RetrieveToolSchemaResponse. + * @memberof google.cloud.ces.v1beta + * @interface IRetrieveToolSchemaResponse + * @property {string|null} [tool] RetrieveToolSchemaResponse tool + * @property {google.cloud.ces.v1beta.IToolsetTool|null} [toolsetTool] RetrieveToolSchemaResponse toolsetTool + * @property {google.cloud.ces.v1beta.ISchema|null} [inputSchema] RetrieveToolSchemaResponse inputSchema + * @property {google.cloud.ces.v1beta.ISchema|null} [outputSchema] RetrieveToolSchemaResponse outputSchema + */ + + /** + * Constructs a new RetrieveToolSchemaResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RetrieveToolSchemaResponse. + * @implements IRetrieveToolSchemaResponse + * @constructor + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaResponse=} [properties] Properties to set + */ + function RetrieveToolSchemaResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrieveToolSchemaResponse tool. + * @member {string|null|undefined} tool + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @instance + */ + RetrieveToolSchemaResponse.prototype.tool = null; + + /** + * RetrieveToolSchemaResponse toolsetTool. + * @member {google.cloud.ces.v1beta.IToolsetTool|null|undefined} toolsetTool + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @instance + */ + RetrieveToolSchemaResponse.prototype.toolsetTool = null; + + /** + * RetrieveToolSchemaResponse inputSchema. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} inputSchema + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @instance + */ + RetrieveToolSchemaResponse.prototype.inputSchema = null; + + /** + * RetrieveToolSchemaResponse outputSchema. + * @member {google.cloud.ces.v1beta.ISchema|null|undefined} outputSchema + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @instance + */ + RetrieveToolSchemaResponse.prototype.outputSchema = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RetrieveToolSchemaResponse toolIdentifier. + * @member {"tool"|"toolsetTool"|undefined} toolIdentifier + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @instance + */ + Object.defineProperty(RetrieveToolSchemaResponse.prototype, "toolIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["tool", "toolsetTool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RetrieveToolSchemaResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse instance + */ + RetrieveToolSchemaResponse.create = function create(properties) { + return new RetrieveToolSchemaResponse(properties); + }; + + /** + * Encodes the specified RetrieveToolSchemaResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaResponse} message RetrieveToolSchemaResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolSchemaResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.toolsetTool != null && Object.hasOwnProperty.call(message, "toolsetTool")) + $root.google.cloud.ces.v1beta.ToolsetTool.encode(message.toolsetTool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inputSchema != null && Object.hasOwnProperty.call(message, "inputSchema")) + $root.google.cloud.ces.v1beta.Schema.encode(message.inputSchema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputSchema != null && Object.hasOwnProperty.call(message, "outputSchema")) + $root.google.cloud.ces.v1beta.Schema.encode(message.outputSchema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RetrieveToolSchemaResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolSchemaResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolSchemaResponse} message RetrieveToolSchemaResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolSchemaResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolSchemaResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RetrieveToolSchemaResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.decode(reader, reader.uint32()); + break; + } + case 3: { + message.inputSchema = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputSchema = $root.google.cloud.ces.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrieveToolSchemaResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolSchemaResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrieveToolSchemaResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrieveToolSchemaResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) { + properties.toolIdentifier = 1; + if (!$util.isString(message.tool)) + return "tool: string expected"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + if (properties.toolIdentifier === 1) + return "toolIdentifier: multiple values"; + properties.toolIdentifier = 1; + { + var error = $root.google.cloud.ces.v1beta.ToolsetTool.verify(message.toolsetTool); + if (error) + return "toolsetTool." + error; + } + } + if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.inputSchema); + if (error) + return "inputSchema." + error; + } + if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) { + var error = $root.google.cloud.ces.v1beta.Schema.verify(message.outputSchema); + if (error) + return "outputSchema." + error; + } + return null; + }; + + /** + * Creates a RetrieveToolSchemaResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RetrieveToolSchemaResponse} RetrieveToolSchemaResponse + */ + RetrieveToolSchemaResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RetrieveToolSchemaResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.RetrieveToolSchemaResponse(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.toolsetTool != null) { + if (typeof object.toolsetTool !== "object") + throw TypeError(".google.cloud.ces.v1beta.RetrieveToolSchemaResponse.toolsetTool: object expected"); + message.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.fromObject(object.toolsetTool); + } + if (object.inputSchema != null) { + if (typeof object.inputSchema !== "object") + throw TypeError(".google.cloud.ces.v1beta.RetrieveToolSchemaResponse.inputSchema: object expected"); + message.inputSchema = $root.google.cloud.ces.v1beta.Schema.fromObject(object.inputSchema); + } + if (object.outputSchema != null) { + if (typeof object.outputSchema !== "object") + throw TypeError(".google.cloud.ces.v1beta.RetrieveToolSchemaResponse.outputSchema: object expected"); + message.outputSchema = $root.google.cloud.ces.v1beta.Schema.fromObject(object.outputSchema); + } + return message; + }; + + /** + * Creates a plain object from a RetrieveToolSchemaResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @static + * @param {google.cloud.ces.v1beta.RetrieveToolSchemaResponse} message RetrieveToolSchemaResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrieveToolSchemaResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputSchema = null; + object.outputSchema = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = message.tool; + if (options.oneofs) + object.toolIdentifier = "tool"; + } + if (message.toolsetTool != null && message.hasOwnProperty("toolsetTool")) { + object.toolsetTool = $root.google.cloud.ces.v1beta.ToolsetTool.toObject(message.toolsetTool, options); + if (options.oneofs) + object.toolIdentifier = "toolsetTool"; + } + if (message.inputSchema != null && message.hasOwnProperty("inputSchema")) + object.inputSchema = $root.google.cloud.ces.v1beta.Schema.toObject(message.inputSchema, options); + if (message.outputSchema != null && message.hasOwnProperty("outputSchema")) + object.outputSchema = $root.google.cloud.ces.v1beta.Schema.toObject(message.outputSchema, options); + return object; + }; + + /** + * Converts this RetrieveToolSchemaResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @instance + * @returns {Object.} JSON object + */ + RetrieveToolSchemaResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrieveToolSchemaResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RetrieveToolSchemaResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrieveToolSchemaResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RetrieveToolSchemaResponse"; + }; + + return RetrieveToolSchemaResponse; + })(); + + v1beta.RetrieveToolsRequest = (function() { + + /** + * Properties of a RetrieveToolsRequest. + * @memberof google.cloud.ces.v1beta + * @interface IRetrieveToolsRequest + * @property {string|null} [toolset] RetrieveToolsRequest toolset + * @property {Array.|null} [toolIds] RetrieveToolsRequest toolIds + */ + + /** + * Constructs a new RetrieveToolsRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RetrieveToolsRequest. + * @implements IRetrieveToolsRequest + * @constructor + * @param {google.cloud.ces.v1beta.IRetrieveToolsRequest=} [properties] Properties to set + */ + function RetrieveToolsRequest(properties) { + this.toolIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrieveToolsRequest toolset. + * @member {string} toolset + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @instance + */ + RetrieveToolsRequest.prototype.toolset = ""; + + /** + * RetrieveToolsRequest toolIds. + * @member {Array.} toolIds + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @instance + */ + RetrieveToolsRequest.prototype.toolIds = $util.emptyArray; + + /** + * Creates a new RetrieveToolsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolsRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RetrieveToolsRequest} RetrieveToolsRequest instance + */ + RetrieveToolsRequest.create = function create(properties) { + return new RetrieveToolsRequest(properties); + }; + + /** + * Encodes the specified RetrieveToolsRequest message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolsRequest} message RetrieveToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.toolset); + if (message.toolIds != null && message.toolIds.length) + for (var i = 0; i < message.toolIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.toolIds[i]); + return writer; + }; + + /** + * Encodes the specified RetrieveToolsRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolsRequest} message RetrieveToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrieveToolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RetrieveToolsRequest} RetrieveToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RetrieveToolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.toolset = reader.string(); + break; + } + case 3: { + if (!(message.toolIds && message.toolIds.length)) + message.toolIds = []; + message.toolIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrieveToolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RetrieveToolsRequest} RetrieveToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrieveToolsRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrieveToolsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.toolset != null && message.hasOwnProperty("toolset")) + if (!$util.isString(message.toolset)) + return "toolset: string expected"; + if (message.toolIds != null && message.hasOwnProperty("toolIds")) { + if (!Array.isArray(message.toolIds)) + return "toolIds: array expected"; + for (var i = 0; i < message.toolIds.length; ++i) + if (!$util.isString(message.toolIds[i])) + return "toolIds: string[] expected"; + } + return null; + }; + + /** + * Creates a RetrieveToolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RetrieveToolsRequest} RetrieveToolsRequest + */ + RetrieveToolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RetrieveToolsRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.RetrieveToolsRequest(); + if (object.toolset != null) + message.toolset = String(object.toolset); + if (object.toolIds) { + if (!Array.isArray(object.toolIds)) + throw TypeError(".google.cloud.ces.v1beta.RetrieveToolsRequest.toolIds: array expected"); + message.toolIds = []; + for (var i = 0; i < object.toolIds.length; ++i) + message.toolIds[i] = String(object.toolIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a RetrieveToolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @static + * @param {google.cloud.ces.v1beta.RetrieveToolsRequest} message RetrieveToolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrieveToolsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.toolIds = []; + if (options.defaults) + object.toolset = ""; + if (message.toolset != null && message.hasOwnProperty("toolset")) + object.toolset = message.toolset; + if (message.toolIds && message.toolIds.length) { + object.toolIds = []; + for (var j = 0; j < message.toolIds.length; ++j) + object.toolIds[j] = message.toolIds[j]; + } + return object; + }; + + /** + * Converts this RetrieveToolsRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @instance + * @returns {Object.} JSON object + */ + RetrieveToolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrieveToolsRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RetrieveToolsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrieveToolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RetrieveToolsRequest"; + }; + + return RetrieveToolsRequest; + })(); + + v1beta.RetrieveToolsResponse = (function() { + + /** + * Properties of a RetrieveToolsResponse. + * @memberof google.cloud.ces.v1beta + * @interface IRetrieveToolsResponse + * @property {Array.|null} [tools] RetrieveToolsResponse tools + */ + + /** + * Constructs a new RetrieveToolsResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a RetrieveToolsResponse. + * @implements IRetrieveToolsResponse + * @constructor + * @param {google.cloud.ces.v1beta.IRetrieveToolsResponse=} [properties] Properties to set + */ + function RetrieveToolsResponse(properties) { + this.tools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrieveToolsResponse tools. + * @member {Array.} tools + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @instance + */ + RetrieveToolsResponse.prototype.tools = $util.emptyArray; + + /** + * Creates a new RetrieveToolsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolsResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.RetrieveToolsResponse} RetrieveToolsResponse instance + */ + RetrieveToolsResponse.create = function create(properties) { + return new RetrieveToolsResponse(properties); + }; + + /** + * Encodes the specified RetrieveToolsResponse message. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolsResponse} message RetrieveToolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + $root.google.cloud.ces.v1beta.Tool.encode(message.tools[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RetrieveToolsResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.RetrieveToolsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @static + * @param {google.cloud.ces.v1beta.IRetrieveToolsResponse} message RetrieveToolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveToolsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrieveToolsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.RetrieveToolsResponse} RetrieveToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.RetrieveToolsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push($root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrieveToolsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.RetrieveToolsResponse} RetrieveToolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveToolsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrieveToolsResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrieveToolsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tools != null && message.hasOwnProperty("tools")) { + if (!Array.isArray(message.tools)) + return "tools: array expected"; + for (var i = 0; i < message.tools.length; ++i) { + var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tools[i]); + if (error) + return "tools." + error; + } + } + return null; + }; + + /** + * Creates a RetrieveToolsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.RetrieveToolsResponse} RetrieveToolsResponse + */ + RetrieveToolsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.RetrieveToolsResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.RetrieveToolsResponse(); + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.cloud.ces.v1beta.RetrieveToolsResponse.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) { + if (typeof object.tools[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.RetrieveToolsResponse.tools: object expected"); + message.tools[i] = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tools[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RetrieveToolsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @static + * @param {google.cloud.ces.v1beta.RetrieveToolsResponse} message RetrieveToolsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrieveToolsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tools = []; + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = $root.google.cloud.ces.v1beta.Tool.toObject(message.tools[j], options); + } + return object; + }; + + /** + * Converts this RetrieveToolsResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @instance + * @returns {Object.} JSON object + */ + RetrieveToolsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrieveToolsResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.RetrieveToolsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrieveToolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.RetrieveToolsResponse"; + }; + + return RetrieveToolsResponse; + })(); + + v1beta.WidgetService = (function() { + + /** + * Constructs a new WidgetService service. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a WidgetService + * @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 WidgetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (WidgetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WidgetService; + + /** + * Creates new WidgetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.ces.v1beta.WidgetService + * @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 {WidgetService} RPC service. Useful where requests and/or responses are streamed. + */ + WidgetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.ces.v1beta.WidgetService|generateChatToken}. + * @memberof google.cloud.ces.v1beta.WidgetService + * @typedef GenerateChatTokenCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.ces.v1beta.GenerateChatTokenResponse} [response] GenerateChatTokenResponse + */ + + /** + * Calls GenerateChatToken. + * @function generateChatToken + * @memberof google.cloud.ces.v1beta.WidgetService + * @instance + * @param {google.cloud.ces.v1beta.IGenerateChatTokenRequest} request GenerateChatTokenRequest message or plain object + * @param {google.cloud.ces.v1beta.WidgetService.GenerateChatTokenCallback} callback Node-style callback called with the error, if any, and GenerateChatTokenResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WidgetService.prototype.generateChatToken = function generateChatToken(request, callback) { + return this.rpcCall(generateChatToken, $root.google.cloud.ces.v1beta.GenerateChatTokenRequest, $root.google.cloud.ces.v1beta.GenerateChatTokenResponse, request, callback); + }, "name", { value: "GenerateChatToken" }); + + /** + * Calls GenerateChatToken. + * @function generateChatToken + * @memberof google.cloud.ces.v1beta.WidgetService + * @instance + * @param {google.cloud.ces.v1beta.IGenerateChatTokenRequest} request GenerateChatTokenRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return WidgetService; + })(); + + v1beta.GenerateChatTokenRequest = (function() { + + /** + * Properties of a GenerateChatTokenRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGenerateChatTokenRequest + * @property {string|null} [name] GenerateChatTokenRequest name + * @property {string|null} [deployment] GenerateChatTokenRequest deployment + * @property {string|null} [recaptchaToken] GenerateChatTokenRequest recaptchaToken + */ + + /** + * Constructs a new GenerateChatTokenRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GenerateChatTokenRequest. + * @implements IGenerateChatTokenRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGenerateChatTokenRequest=} [properties] Properties to set + */ + function GenerateChatTokenRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateChatTokenRequest name. + * @member {string} name + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @instance + */ + GenerateChatTokenRequest.prototype.name = ""; + + /** + * GenerateChatTokenRequest deployment. + * @member {string} deployment + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @instance + */ + GenerateChatTokenRequest.prototype.deployment = ""; + + /** + * GenerateChatTokenRequest recaptchaToken. + * @member {string} recaptchaToken + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @instance + */ + GenerateChatTokenRequest.prototype.recaptchaToken = ""; + + /** + * Creates a new GenerateChatTokenRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @static + * @param {google.cloud.ces.v1beta.IGenerateChatTokenRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateChatTokenRequest} GenerateChatTokenRequest instance + */ + GenerateChatTokenRequest.create = function create(properties) { + return new GenerateChatTokenRequest(properties); + }; + + /** + * Encodes the specified GenerateChatTokenRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @static + * @param {google.cloud.ces.v1beta.IGenerateChatTokenRequest} message GenerateChatTokenRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateChatTokenRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deployment); + if (message.recaptchaToken != null && Object.hasOwnProperty.call(message, "recaptchaToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.recaptchaToken); + return writer; + }; + + /** + * Encodes the specified GenerateChatTokenRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @static + * @param {google.cloud.ces.v1beta.IGenerateChatTokenRequest} message GenerateChatTokenRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateChatTokenRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateChatTokenRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateChatTokenRequest} GenerateChatTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateChatTokenRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateChatTokenRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.deployment = reader.string(); + break; + } + case 3: { + message.recaptchaToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateChatTokenRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateChatTokenRequest} GenerateChatTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateChatTokenRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateChatTokenRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateChatTokenRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) + if (!$util.isString(message.deployment)) + return "deployment: string expected"; + if (message.recaptchaToken != null && message.hasOwnProperty("recaptchaToken")) + if (!$util.isString(message.recaptchaToken)) + return "recaptchaToken: string expected"; + return null; + }; + + /** + * Creates a GenerateChatTokenRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateChatTokenRequest} GenerateChatTokenRequest + */ + GenerateChatTokenRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateChatTokenRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateChatTokenRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.deployment != null) + message.deployment = String(object.deployment); + if (object.recaptchaToken != null) + message.recaptchaToken = String(object.recaptchaToken); + return message; + }; + + /** + * Creates a plain object from a GenerateChatTokenRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @static + * @param {google.cloud.ces.v1beta.GenerateChatTokenRequest} message GenerateChatTokenRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateChatTokenRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.deployment = ""; + object.recaptchaToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = message.deployment; + if (message.recaptchaToken != null && message.hasOwnProperty("recaptchaToken")) + object.recaptchaToken = message.recaptchaToken; + return object; + }; + + /** + * Converts this GenerateChatTokenRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateChatTokenRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateChatTokenRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateChatTokenRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateChatTokenRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateChatTokenRequest"; + }; + + return GenerateChatTokenRequest; + })(); + + v1beta.GenerateChatTokenResponse = (function() { + + /** + * Properties of a GenerateChatTokenResponse. + * @memberof google.cloud.ces.v1beta + * @interface IGenerateChatTokenResponse + * @property {string|null} [chatToken] GenerateChatTokenResponse chatToken + * @property {google.protobuf.ITimestamp|null} [expireTime] GenerateChatTokenResponse expireTime + */ + + /** + * Constructs a new GenerateChatTokenResponse. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GenerateChatTokenResponse. + * @implements IGenerateChatTokenResponse + * @constructor + * @param {google.cloud.ces.v1beta.IGenerateChatTokenResponse=} [properties] Properties to set + */ + function GenerateChatTokenResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateChatTokenResponse chatToken. + * @member {string} chatToken + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @instance + */ + GenerateChatTokenResponse.prototype.chatToken = ""; + + /** + * GenerateChatTokenResponse expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @instance + */ + GenerateChatTokenResponse.prototype.expireTime = null; + + /** + * Creates a new GenerateChatTokenResponse instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @static + * @param {google.cloud.ces.v1beta.IGenerateChatTokenResponse=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateChatTokenResponse} GenerateChatTokenResponse instance + */ + GenerateChatTokenResponse.create = function create(properties) { + return new GenerateChatTokenResponse(properties); + }; + + /** + * Encodes the specified GenerateChatTokenResponse message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @static + * @param {google.cloud.ces.v1beta.IGenerateChatTokenResponse} message GenerateChatTokenResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateChatTokenResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chatToken != null && Object.hasOwnProperty.call(message, "chatToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.chatToken); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateChatTokenResponse message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateChatTokenResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @static + * @param {google.cloud.ces.v1beta.IGenerateChatTokenResponse} message GenerateChatTokenResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateChatTokenResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateChatTokenResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateChatTokenResponse} GenerateChatTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateChatTokenResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateChatTokenResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.chatToken = reader.string(); + break; + } + case 2: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateChatTokenResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateChatTokenResponse} GenerateChatTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateChatTokenResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateChatTokenResponse message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateChatTokenResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chatToken != null && message.hasOwnProperty("chatToken")) + if (!$util.isString(message.chatToken)) + return "chatToken: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + return null; + }; + + /** + * Creates a GenerateChatTokenResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateChatTokenResponse} GenerateChatTokenResponse + */ + GenerateChatTokenResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateChatTokenResponse) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateChatTokenResponse(); + if (object.chatToken != null) + message.chatToken = String(object.chatToken); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateChatTokenResponse.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + return message; + }; + + /** + * Creates a plain object from a GenerateChatTokenResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @static + * @param {google.cloud.ces.v1beta.GenerateChatTokenResponse} message GenerateChatTokenResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateChatTokenResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chatToken = ""; + object.expireTime = null; + } + if (message.chatToken != null && message.hasOwnProperty("chatToken")) + object.chatToken = message.chatToken; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + return object; + }; + + /** + * Converts this GenerateChatTokenResponse to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateChatTokenResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateChatTokenResponse + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateChatTokenResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateChatTokenResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateChatTokenResponse"; + }; + + return GenerateChatTokenResponse; + })(); + + return v1beta; + })(); + return ces; })(); diff --git a/packages/google-cloud-ces/protos/protos.json b/packages/google-cloud-ces/protos/protos.json index 3239b1d1aa5..201e3b6d4d3 100644 --- a/packages/google-cloud-ces/protos/protos.json +++ b/packages/google-cloud-ces/protos/protos.json @@ -7831,6 +7831,12311 @@ } } } + }, + "v1beta": { + "options": { + "go_package": "cloud.google.com/go/ces/apiv1beta/cespb;cespb", + "java_multiple_files": true, + "java_outer_classname": "WidgetServiceProto", + "java_package": "com.google.cloud.ces.v1beta", + "(google.api.resource_definition).type": "ces.googleapis.com/Session", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/apps/{app}/sessions/{session}" + }, + "nested": { + "Agent": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Agent", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/agents/{agent}", + "(google.api.resource).plural": "agents", + "(google.api.resource).singular": "agent" + }, + "oneofs": { + "agentType": { + "oneof": [ + "llmAgent", + "remoteDialogflowAgent" + ] + } + }, + "fields": { + "llmAgent": { + "type": "LlmAgent", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "remoteDialogflowAgent": { + "type": "RemoteDialogflowAgent", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modelSettings": { + "type": "ModelSettings", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instruction": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tools": { + "rule": "repeated", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "childAgents": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "beforeAgentCallbacks": { + "rule": "repeated", + "type": "Callback", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "afterAgentCallbacks": { + "rule": "repeated", + "type": "Callback", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "beforeModelCallbacks": { + "rule": "repeated", + "type": "Callback", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "afterModelCallbacks": { + "rule": "repeated", + "type": "Callback", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "beforeToolCallbacks": { + "rule": "repeated", + "type": "Callback", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "afterToolCallbacks": { + "rule": "repeated", + "type": "Callback", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "guardrails": { + "rule": "repeated", + "type": "string", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" + } + }, + "etag": { + "type": "string", + "id": 24 + }, + "toolsets": { + "rule": "repeated", + "type": "AgentToolset", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "generatedSummary": { + "type": "string", + "id": 29, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "transferRules": { + "rule": "repeated", + "type": "TransferRule", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "LlmAgent": { + "fields": {} + }, + "RemoteDialogflowAgent": { + "fields": { + "agent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/DialogflowAgent" + } + }, + "flowId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "environmentId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inputVariableMapping": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputVariableMapping": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "respectResponseInterruptionSettings": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AgentToolset": { + "fields": { + "toolset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" + } + }, + "toolIds": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ExpressionCondition": { + "fields": { + "expression": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PythonCodeCondition": { + "fields": { + "pythonCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TransferRule": { + "oneofs": { + "ruleType": { + "oneof": [ + "deterministicTransfer", + "disablePlannerTransfer" + ] + } + }, + "fields": { + "deterministicTransfer": { + "type": "DeterministicTransfer", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disablePlannerTransfer": { + "type": "DisablePlannerTransfer", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "childAgent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "direction": { + "type": "Direction", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "DeterministicTransfer": { + "oneofs": { + "conditionType": { + "oneof": [ + "expressionCondition", + "pythonCodeCondition" + ] + } + }, + "fields": { + "expressionCondition": { + "type": "ExpressionCondition", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pythonCodeCondition": { + "type": "PythonCodeCondition", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DisablePlannerTransfer": { + "fields": { + "expressionCondition": { + "type": "ExpressionCondition", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Direction": { + "values": { + "DIRECTION_UNSPECIFIED": 0, + "PARENT_TO_CHILD": 1, + "CHILD_TO_PARENT": 2 + } + } + } + }, + "ExecutionType": { + "values": { + "EXECUTION_TYPE_UNSPECIFIED": 0, + "SYNCHRONOUS": 1, + "ASYNCHRONOUS": 2 + } + }, + "Callback": { + "oneofs": { + "callback": { + "oneof": [ + "pythonCode" + ] + } + }, + "fields": { + "pythonCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disabled": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "proactiveExecutionEnabled": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ModelSettings": { + "oneofs": { + "_temperature": { + "oneof": [ + "temperature" + ] + } + }, + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "temperature": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "TriggerAction": { + "oneofs": { + "action": { + "oneof": [ + "respondImmediately", + "transferAgent", + "generativeAnswer" + ] + } + }, + "fields": { + "respondImmediately": { + "type": "RespondImmediately", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "transferAgent": { + "type": "TransferAgent", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "generativeAnswer": { + "type": "GenerativeAnswer", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Response": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "disabled": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RespondImmediately": { + "fields": { + "responses": { + "rule": "repeated", + "type": "Response", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GenerativeAnswer": { + "fields": { + "prompt": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TransferAgent": { + "fields": { + "agent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + } + } + } + } + }, + "TlsConfig": { + "fields": { + "caCerts": { + "rule": "repeated", + "type": "CaCert", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "CaCert": { + "fields": { + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cert": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ServiceDirectoryConfig": { + "fields": { + "service": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "servicedirectory.googleapis.com/Service" + } + } + } + }, + "ChannelProfile": { + "fields": { + "profileId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "channelType": { + "type": "ChannelType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "personaProperty": { + "type": "PersonaProperty", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disableDtmf": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disableBargeInControl": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "webWidgetConfig": { + "type": "WebWidgetConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "noiseSuppressionLevel": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PersonaProperty": { + "fields": { + "persona": { + "type": "Persona", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Persona": { + "values": { + "UNKNOWN": 0, + "CONCISE": 1, + "CHATTY": 2 + } + } + } + }, + "WebWidgetConfig": { + "fields": { + "modality": { + "type": "Modality", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "theme": { + "type": "Theme", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "webWidgetTitle": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "securitySettings": { + "type": "SecuritySettings", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SecuritySettings": { + "fields": { + "enablePublicAccess": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableOriginCheck": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowedOrigins": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableRecaptcha": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Modality": { + "values": { + "MODALITY_UNSPECIFIED": 0, + "CHAT_AND_VOICE": 1, + "VOICE_ONLY": 2, + "CHAT_ONLY": 3 + } + }, + "Theme": { + "values": { + "THEME_UNSPECIFIED": 0, + "LIGHT": 1, + "DARK": 2 + } + } + } + }, + "ChannelType": { + "values": { + "UNKNOWN": 0, + "WEB_UI": 2, + "API": 3, + "TWILIO": 4, + "GOOGLE_TELEPHONY_PLATFORM": 5, + "CONTACT_CENTER_AS_A_SERVICE": 6, + "FIVE9": 7, + "CONTACT_CENTER_INTEGRATION": 8 + } + } + } + }, + "Span": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "attributes": { + "type": "google.protobuf.Struct", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "childSpans": { + "rule": "repeated", + "type": "Span", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "AgentService": { + "options": { + "(google.api.default_host)": "ces.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListApps": { + "requestType": "ListAppsRequest", + "responseType": "ListAppsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*}/apps", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*}/apps" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetApp": { + "requestType": "GetAppRequest", + "responseType": "App", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateApp": { + "requestType": "CreateAppRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/apps", + "(google.api.http).body": "app", + "(google.api.method_signature)": "parent,app", + "(google.longrunning.operation_info).response_type": "App", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*}/apps", + "body": "app" + } + }, + { + "(google.api.method_signature)": "parent,app,app_id" + }, + { + "(google.api.method_signature)": "parent,app" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "App", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateApp": { + "requestType": "UpdateAppRequest", + "responseType": "App", + "options": { + "(google.api.http).patch": "/v1beta/{app.name=projects/*/locations/*/apps/*}", + "(google.api.http).body": "app", + "(google.api.method_signature)": "app,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{app.name=projects/*/locations/*/apps/*}", + "body": "app" + } + }, + { + "(google.api.method_signature)": "app,update_mask" + } + ] + }, + "DeleteApp": { + "requestType": "DeleteAppRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*}", + "(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/*/apps/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExportApp": { + "requestType": "ExportAppRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/apps/*}:exportApp", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "ExportAppResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{name=projects/*/locations/*/apps/*}:exportApp", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportAppResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ImportApp": { + "requestType": "ImportAppRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/apps:importApp", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,display_name,app_id", + "(google.longrunning.operation_info).response_type": "ImportAppResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*}/apps:importApp", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,display_name,app_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportAppResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListAgents": { + "requestType": "ListAgentsRequest", + "responseType": "ListAgentsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/agents", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/agents" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetAgent": { + "requestType": "GetAgentRequest", + "responseType": "Agent", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/agents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/agents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateAgent": { + "requestType": "CreateAgentRequest", + "responseType": "Agent", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/agents", + "(google.api.http).body": "agent", + "(google.api.method_signature)": "parent,agent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/agents", + "body": "agent" + } + }, + { + "(google.api.method_signature)": "parent,agent,agent_id" + }, + { + "(google.api.method_signature)": "parent,agent" + } + ] + }, + "UpdateAgent": { + "requestType": "UpdateAgentRequest", + "responseType": "Agent", + "options": { + "(google.api.http).patch": "/v1beta/{agent.name=projects/*/locations/*/apps/*/agents/*}", + "(google.api.http).body": "agent", + "(google.api.method_signature)": "agent,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{agent.name=projects/*/locations/*/apps/*/agents/*}", + "body": "agent" + } + }, + { + "(google.api.method_signature)": "agent,update_mask" + } + ] + }, + "DeleteAgent": { + "requestType": "DeleteAgentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/agents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/agents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListExamples": { + "requestType": "ListExamplesRequest", + "responseType": "ListExamplesResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/examples", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/examples" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetExample": { + "requestType": "GetExampleRequest", + "responseType": "Example", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/examples/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/examples/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateExample": { + "requestType": "CreateExampleRequest", + "responseType": "Example", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/examples", + "(google.api.http).body": "example", + "(google.api.method_signature)": "parent,example" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/examples", + "body": "example" + } + }, + { + "(google.api.method_signature)": "parent,example,example_id" + }, + { + "(google.api.method_signature)": "parent,example" + } + ] + }, + "UpdateExample": { + "requestType": "UpdateExampleRequest", + "responseType": "Example", + "options": { + "(google.api.http).patch": "/v1beta/{example.name=projects/*/locations/*/apps/*/examples/*}", + "(google.api.http).body": "example", + "(google.api.method_signature)": "example,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{example.name=projects/*/locations/*/apps/*/examples/*}", + "body": "example" + } + }, + { + "(google.api.method_signature)": "example,update_mask" + } + ] + }, + "DeleteExample": { + "requestType": "DeleteExampleRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/examples/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/examples/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTools": { + "requestType": "ListToolsRequest", + "responseType": "ListToolsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/tools", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/tools" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTool": { + "requestType": "GetToolRequest", + "responseType": "Tool", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/tools/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/tools/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListConversations": { + "requestType": "ListConversationsRequest", + "responseType": "ListConversationsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/conversations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/conversations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConversation": { + "requestType": "GetConversationRequest", + "responseType": "Conversation", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/conversations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/conversations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteConversation": { + "requestType": "DeleteConversationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/conversations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/conversations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "BatchDeleteConversations": { + "requestType": "BatchDeleteConversationsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/conversations:batchDelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "BatchDeleteConversationsResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/conversations:batchDelete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchDeleteConversationsResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateTool": { + "requestType": "CreateToolRequest", + "responseType": "Tool", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/tools", + "(google.api.http).body": "tool", + "(google.api.method_signature)": "parent,tool" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/tools", + "body": "tool" + } + }, + { + "(google.api.method_signature)": "parent,tool,tool_id" + }, + { + "(google.api.method_signature)": "parent,tool" + } + ] + }, + "UpdateTool": { + "requestType": "UpdateToolRequest", + "responseType": "Tool", + "options": { + "(google.api.http).patch": "/v1beta/{tool.name=projects/*/locations/*/apps/*/tools/*}", + "(google.api.http).body": "tool", + "(google.api.method_signature)": "tool,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{tool.name=projects/*/locations/*/apps/*/tools/*}", + "body": "tool" + } + }, + { + "(google.api.method_signature)": "tool,update_mask" + } + ] + }, + "DeleteTool": { + "requestType": "DeleteToolRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/tools/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/tools/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListGuardrails": { + "requestType": "ListGuardrailsRequest", + "responseType": "ListGuardrailsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/guardrails", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/guardrails" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetGuardrail": { + "requestType": "GetGuardrailRequest", + "responseType": "Guardrail", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/guardrails/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/guardrails/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateGuardrail": { + "requestType": "CreateGuardrailRequest", + "responseType": "Guardrail", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/guardrails", + "(google.api.http).body": "guardrail", + "(google.api.method_signature)": "parent,guardrail" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/guardrails", + "body": "guardrail" + } + }, + { + "(google.api.method_signature)": "parent,guardrail,guardrail_id" + }, + { + "(google.api.method_signature)": "parent,guardrail" + } + ] + }, + "UpdateGuardrail": { + "requestType": "UpdateGuardrailRequest", + "responseType": "Guardrail", + "options": { + "(google.api.http).patch": "/v1beta/{guardrail.name=projects/*/locations/*/apps/*/guardrails/*}", + "(google.api.http).body": "guardrail", + "(google.api.method_signature)": "guardrail,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{guardrail.name=projects/*/locations/*/apps/*/guardrails/*}", + "body": "guardrail" + } + }, + { + "(google.api.method_signature)": "guardrail,update_mask" + } + ] + }, + "DeleteGuardrail": { + "requestType": "DeleteGuardrailRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/guardrails/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/guardrails/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDeployments": { + "requestType": "ListDeploymentsRequest", + "responseType": "ListDeploymentsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/deployments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/deployments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDeployment": { + "requestType": "GetDeploymentRequest", + "responseType": "Deployment", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/deployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/deployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateDeployment": { + "requestType": "CreateDeploymentRequest", + "responseType": "Deployment", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/deployments", + "(google.api.http).body": "deployment", + "(google.api.method_signature)": "parent,deployment" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/deployments", + "body": "deployment" + } + }, + { + "(google.api.method_signature)": "parent,deployment,deployment_id" + }, + { + "(google.api.method_signature)": "parent,deployment" + } + ] + }, + "UpdateDeployment": { + "requestType": "UpdateDeploymentRequest", + "responseType": "Deployment", + "options": { + "(google.api.http).patch": "/v1beta/{deployment.name=projects/*/locations/*/apps/*/deployments/*}", + "(google.api.http).body": "deployment", + "(google.api.method_signature)": "deployment,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{deployment.name=projects/*/locations/*/apps/*/deployments/*}", + "body": "deployment" + } + }, + { + "(google.api.method_signature)": "deployment,update_mask" + } + ] + }, + "DeleteDeployment": { + "requestType": "DeleteDeploymentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/deployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/deployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListToolsets": { + "requestType": "ListToolsetsRequest", + "responseType": "ListToolsetsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/toolsets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/toolsets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetToolset": { + "requestType": "GetToolsetRequest", + "responseType": "Toolset", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/toolsets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/toolsets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateToolset": { + "requestType": "CreateToolsetRequest", + "responseType": "Toolset", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/toolsets", + "(google.api.http).body": "toolset", + "(google.api.method_signature)": "parent,toolset" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/toolsets", + "body": "toolset" + } + }, + { + "(google.api.method_signature)": "parent,toolset,toolset_id" + }, + { + "(google.api.method_signature)": "parent,toolset" + } + ] + }, + "UpdateToolset": { + "requestType": "UpdateToolsetRequest", + "responseType": "Toolset", + "options": { + "(google.api.http).patch": "/v1beta/{toolset.name=projects/*/locations/*/apps/*/toolsets/*}", + "(google.api.http).body": "toolset", + "(google.api.method_signature)": "toolset,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{toolset.name=projects/*/locations/*/apps/*/toolsets/*}", + "body": "toolset" + } + }, + { + "(google.api.method_signature)": "toolset,update_mask" + } + ] + }, + "DeleteToolset": { + "requestType": "DeleteToolsetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/toolsets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/toolsets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListAppVersions": { + "requestType": "ListAppVersionsRequest", + "responseType": "ListAppVersionsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/versions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/versions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetAppVersion": { + "requestType": "GetAppVersionRequest", + "responseType": "AppVersion", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateAppVersion": { + "requestType": "CreateAppVersionRequest", + "responseType": "AppVersion", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/versions", + "(google.api.http).body": "app_version", + "(google.api.method_signature)": "parent,app_version" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/versions", + "body": "app_version" + } + }, + { + "(google.api.method_signature)": "parent,app_version,app_version_id" + }, + { + "(google.api.method_signature)": "parent,app_version" + } + ] + }, + "DeleteAppVersion": { + "requestType": "DeleteAppVersionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "RestoreAppVersion": { + "requestType": "RestoreAppVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}:restore", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "RestoreAppVersionResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{name=projects/*/locations/*/apps/*/versions/*}:restore", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RestoreAppVersionResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListChangelogs": { + "requestType": "ListChangelogsRequest", + "responseType": "ListChangelogsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/changelogs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/changelogs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetChangelog": { + "requestType": "GetChangelogRequest", + "responseType": "Changelog", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/changelogs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/changelogs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "ListAppsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/App" + } + }, + "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" + } + } + } + }, + "ListAppsResponse": { + "fields": { + "apps": { + "rule": "repeated", + "type": "App", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "UNORDERED_LIST" + } + } + } + }, + "GetAppRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + } + } + }, + "CreateAppRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/App" + } + }, + "appId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "app": { + "type": "App", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateAppRequest": { + "fields": { + "app": { + "type": "App", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteAppRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExportAppRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "exportFormat": { + "type": "ExportFormat", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gcsUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ExportFormat": { + "values": { + "EXPORT_FORMAT_UNSPECIFIED": 0, + "JSON": 1, + "YAML": 2 + } + } + } + }, + "ExportAppResponse": { + "oneofs": { + "app": { + "oneof": [ + "appContent", + "appUri" + ] + } + }, + "fields": { + "appContent": { + "type": "bytes", + "id": 1 + }, + "appUri": { + "type": "string", + "id": 2 + } + } + }, + "ImportAppRequest": { + "oneofs": { + "app": { + "oneof": [ + "gcsUri", + "appContent" + ] + } + }, + "fields": { + "gcsUri": { + "type": "string", + "id": 4 + }, + "appContent": { + "type": "bytes", + "id": 5 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/App" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "appId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "importOptions": { + "type": "ImportOptions", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreAppLock": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ImportOptions": { + "fields": { + "conflictResolutionStrategy": { + "type": "ConflictResolutionStrategy", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ConflictResolutionStrategy": { + "values": { + "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED": 0, + "REPLACE": 1, + "OVERWRITE": 2 + } + } + } + } + } + }, + "ImportAppResponse": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "warnings": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "ListAgentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Agent" + } + }, + "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" + } + } + } + }, + "ListAgentsResponse": { + "fields": { + "agents": { + "rule": "repeated", + "type": "Agent", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetAgentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + } + } + }, + "CreateAgentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Agent" + } + }, + "agentId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agent": { + "type": "Agent", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateAgentRequest": { + "fields": { + "agent": { + "type": "Agent", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteAgentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OperationMetadata": { + "fields": { + "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" + } + }, + "statusMessage": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ListExamplesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Example" + } + }, + "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" + } + } + } + }, + "ListExamplesResponse": { + "fields": { + "examples": { + "rule": "repeated", + "type": "Example", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetExampleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Example" + } + } + } + }, + "CreateExampleRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Example" + } + }, + "exampleId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "example": { + "type": "Example", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateExampleRequest": { + "fields": { + "example": { + "type": "Example", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteExampleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Example" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListToolsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Tool" + } + }, + "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" + } + } + } + }, + "ListToolsResponse": { + "fields": { + "tools": { + "rule": "repeated", + "type": "Tool", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetToolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + } + } + }, + "CreateToolRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Tool" + } + }, + "toolId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tool": { + "type": "Tool", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateToolRequest": { + "fields": { + "tool": { + "type": "Tool", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteToolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListConversationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Conversation" + } + }, + "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" + } + }, + "source": { + "type": "Conversation.Source", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sources": { + "rule": "repeated", + "type": "Conversation.Source", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListConversationsResponse": { + "fields": { + "conversations": { + "rule": "repeated", + "type": "Conversation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetConversationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" + } + }, + "source": { + "type": "Conversation.Source", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteConversationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" + } + }, + "source": { + "type": "Conversation.Source", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchDeleteConversationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Conversation" + } + }, + "conversations": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" + } + } + } + }, + "BatchDeleteConversationsResponse": { + "fields": { + "deletedConversations": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "failedConversations": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "errorMessages": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListGuardrailsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Guardrail" + } + }, + "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" + } + } + } + }, + "ListGuardrailsResponse": { + "fields": { + "guardrails": { + "rule": "repeated", + "type": "Guardrail", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetGuardrailRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" + } + } + } + }, + "CreateGuardrailRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Guardrail" + } + }, + "guardrailId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "guardrail": { + "type": "Guardrail", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateGuardrailRequest": { + "fields": { + "guardrail": { + "type": "Guardrail", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteGuardrailRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDeploymentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Deployment" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDeploymentsResponse": { + "fields": { + "deployments": { + "rule": "repeated", + "type": "Deployment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" + } + } + } + }, + "CreateDeploymentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Deployment" + } + }, + "deploymentId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deployment": { + "type": "Deployment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateDeploymentRequest": { + "fields": { + "deployment": { + "type": "Deployment", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListToolsetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Toolset" + } + }, + "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" + } + } + } + }, + "ListToolsetsResponse": { + "fields": { + "toolsets": { + "rule": "repeated", + "type": "Toolset", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetToolsetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" + } + } + } + }, + "CreateToolsetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Toolset" + } + }, + "toolsetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolset": { + "type": "Toolset", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateToolsetRequest": { + "fields": { + "toolset": { + "type": "Toolset", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteToolsetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListAppVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/AppVersion" + } + }, + "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" + } + } + } + }, + "ListAppVersionsResponse": { + "fields": { + "appVersions": { + "rule": "repeated", + "type": "AppVersion", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetAppVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + } + } + }, + "DeleteAppVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateAppVersionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/AppVersion" + } + }, + "appVersionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "appVersion": { + "type": "AppVersion", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RestoreAppVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + } + } + }, + "RestoreAppVersionResponse": { + "fields": {} + }, + "GenerateAppResourceResponse": { + "oneofs": { + "generatedResource": { + "oneof": [ + "agent", + "toolset", + "appSnapshot", + "tools", + "evaluations", + "appResources" + ] + } + }, + "fields": { + "agent": { + "type": "Agent", + "id": 1 + }, + "toolset": { + "type": "Toolset", + "id": 3 + }, + "appSnapshot": { + "type": "AppSnapshot", + "id": 4 + }, + "tools": { + "type": "Tools", + "id": 5 + }, + "evaluations": { + "type": "Evaluations", + "id": 6 + }, + "appResources": { + "type": "AppResources", + "id": 7 + }, + "generateResultInfo": { + "type": "GenerateResultInfo", + "id": 2 + } + }, + "nested": { + "Evaluations": { + "fields": { + "evaluations": { + "rule": "repeated", + "type": "Evaluation", + "id": 1 + } + } + }, + "Tools": { + "fields": { + "tools": { + "rule": "repeated", + "type": "Tool", + "id": 1 + } + } + }, + "AppResources": { + "fields": { + "appSnapshot": { + "type": "AppSnapshot", + "id": 1 + }, + "evaluations": { + "rule": "repeated", + "type": "Evaluation", + "id": 2 + } + } + }, + "GenerateResultInfo": { + "fields": { + "explanation": { + "type": "string", + "id": 1 + } + } + } + } + }, + "ListChangelogsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Changelog" + } + }, + "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" + } + } + } + }, + "ListChangelogsResponse": { + "fields": { + "changelogs": { + "rule": "repeated", + "type": "Changelog", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetChangelogRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Changelog" + } + } + } + }, + "App": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/App", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}", + "(google.api.resource).plural": "apps", + "(google.api.resource).singular": "app" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pinned": { + "type": "bool", + "id": 31, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rootAgent": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "languageSettings": { + "type": "LanguageSettings", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeZoneSettings": { + "type": "TimeZoneSettings", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "audioProcessingConfig": { + "type": "AudioProcessingConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "loggingSettings": { + "type": "LoggingSettings", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "errorHandlingSettings": { + "type": "ErrorHandlingSettings", + "id": 34, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modelSettings": { + "type": "ModelSettings", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolExecutionMode": { + "type": "ToolExecutionMode", + "id": 32, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationMetricsThresholds": { + "type": "EvaluationMetricsThresholds", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "variableDeclarations": { + "rule": "repeated", + "type": "VariableDeclaration", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "predefinedVariableDeclarations": { + "rule": "repeated", + "type": "VariableDeclaration", + "id": 28, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "globalInstruction": { + "type": "string", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "guardrails": { + "rule": "repeated", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" + } + }, + "dataStoreSettings": { + "type": "DataStoreSettings", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultChannelProfile": { + "type": "ChannelProfile", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deploymentCount": { + "type": "int32", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clientCertificateSettings": { + "type": "ClientCertificateSettings", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "locked": { + "type": "bool", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationPersonas": { + "rule": "repeated", + "type": "EvaluationPersona", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationSettings": { + "type": "EvaluationSettings", + "id": 33, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "VariableDeclaration": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "schema": { + "type": "Schema", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ToolExecutionMode": { + "values": { + "TOOL_EXECUTION_MODE_UNSPECIFIED": 0, + "PARALLEL": 1, + "SEQUENTIAL": 2 + } + } + } + }, + "TimeZoneSettings": { + "fields": { + "timeZone": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "LanguageSettings": { + "fields": { + "defaultLanguageCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "supportedLanguageCodes": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableMultilingualSupport": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fallbackAction": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AudioProcessingConfig": { + "fields": { + "synthesizeSpeechConfigs": { + "keyType": "string", + "type": "SynthesizeSpeechConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bargeInConfig": { + "type": "BargeInConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inactivityTimeout": { + "type": "google.protobuf.Duration", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ambientSoundConfig": { + "type": "AmbientSoundConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AmbientSoundConfig": { + "oneofs": { + "source": { + "oneof": [ + "prebuiltAmbientNoise", + "gcsUri", + "prebuiltAmbientSound" + ] + } + }, + "fields": { + "prebuiltAmbientNoise": { + "type": "PrebuiltAmbientNoise", + "id": 1, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gcsUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prebuiltAmbientSound": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "volumeGainDb": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PrebuiltAmbientNoise": { + "values": { + "PREBUILT_AMBIENT_NOISE_UNSPECIFIED": 0, + "RETAIL_STORE": 1, + "CONVENTION_HALL": 2, + "OUTDOOR": 3 + } + } + } + }, + "BargeInConfig": { + "fields": { + "disableBargeIn": { + "type": "bool", + "id": 1, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bargeInAwareness": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SynthesizeSpeechConfig": { + "fields": { + "voice": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "speakingRate": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "MetricAnalysisSettings": { + "fields": { + "llmMetricsOptedOut": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "LoggingSettings": { + "fields": { + "redactionConfig": { + "type": "RedactionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "audioRecordingConfig": { + "type": "AudioRecordingConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bigqueryExportSettings": { + "type": "BigQueryExportSettings", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cloudLoggingSettings": { + "type": "CloudLoggingSettings", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "conversationLoggingSettings": { + "type": "ConversationLoggingSettings", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationAudioRecordingConfig": { + "type": "AudioRecordingConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "metricAnalysisSettings": { + "type": "MetricAnalysisSettings", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ErrorHandlingSettings": { + "fields": { + "errorHandlingStrategy": { + "type": "ErrorHandlingStrategy", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ErrorHandlingStrategy": { + "values": { + "ERROR_HANDLING_STRATEGY_UNSPECIFIED": 0, + "NONE": 1, + "FALLBACK_RESPONSE": 2 + } + } + } + }, + "EvaluationMetricsThresholds": { + "fields": { + "goldenEvaluationMetricsThresholds": { + "type": "GoldenEvaluationMetricsThresholds", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "hallucinationMetricBehavior": { + "type": "HallucinationMetricBehavior", + "id": 3, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "goldenHallucinationMetricBehavior": { + "type": "HallucinationMetricBehavior", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scenarioHallucinationMetricBehavior": { + "type": "HallucinationMetricBehavior", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "GoldenEvaluationMetricsThresholds": { + "fields": { + "turnLevelMetricsThresholds": { + "type": "TurnLevelMetricsThresholds", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expectationLevelMetricsThresholds": { + "type": "ExpectationLevelMetricsThresholds", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolMatchingSettings": { + "type": "ToolMatchingSettings", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "TurnLevelMetricsThresholds": { + "oneofs": { + "_semanticSimilaritySuccessThreshold": { + "oneof": [ + "semanticSimilaritySuccessThreshold" + ] + }, + "_overallToolInvocationCorrectnessThreshold": { + "oneof": [ + "overallToolInvocationCorrectnessThreshold" + ] + } + }, + "fields": { + "semanticSimilaritySuccessThreshold": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "overallToolInvocationCorrectnessThreshold": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "semanticSimilarityChannel": { + "type": "SemanticSimilarityChannel", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SemanticSimilarityChannel": { + "values": { + "SEMANTIC_SIMILARITY_CHANNEL_UNSPECIFIED": 0, + "TEXT": 1, + "AUDIO": 2 + } + } + } + }, + "ExpectationLevelMetricsThresholds": { + "oneofs": { + "_toolInvocationParameterCorrectnessThreshold": { + "oneof": [ + "toolInvocationParameterCorrectnessThreshold" + ] + } + }, + "fields": { + "toolInvocationParameterCorrectnessThreshold": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + } + } + }, + "ToolMatchingSettings": { + "fields": { + "extraToolCallBehavior": { + "type": "ExtraToolCallBehavior", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ExtraToolCallBehavior": { + "values": { + "EXTRA_TOOL_CALL_BEHAVIOR_UNSPECIFIED": 0, + "FAIL": 1, + "ALLOW": 2 + } + } + } + }, + "HallucinationMetricBehavior": { + "values": { + "HALLUCINATION_METRIC_BEHAVIOR_UNSPECIFIED": 0, + "DISABLED": 1, + "ENABLED": 2 + } + } + } + }, + "EvaluationSettings": { + "fields": { + "scenarioConversationInitiator": { + "type": "ScenarioConversationInitiator", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "goldenRunMethod": { + "type": "GoldenRunMethod", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "goldenEvaluationToolCallBehaviour": { + "type": "EvaluationToolCallBehaviour", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scenarioEvaluationToolCallBehaviour": { + "type": "EvaluationToolCallBehaviour", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ScenarioConversationInitiator": { + "values": { + "SCENARIO_CONVERSATION_INITIATOR_UNSPECIFIED": 0, + "USER": 1, + "AGENT": 2 + } + } + } + }, + "ClientCertificateSettings": { + "fields": { + "tlsCertificate": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "privateKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "passphrase": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ConversationLoggingSettings": { + "fields": { + "disableConversationLogging": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CloudLoggingSettings": { + "fields": { + "enableCloudLogging": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AudioRecordingConfig": { + "fields": { + "gcsBucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gcsPathPrefix": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RedactionConfig": { + "fields": { + "enableRedaction": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inspectTemplate": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dlp.googleapis.com/InspectTemplate" + } + }, + "deidentifyTemplate": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dlp.googleapis.com/DeidentifyTemplate" + } + } + } + }, + "DataStoreSettings": { + "fields": { + "engines": { + "rule": "repeated", + "type": "Engine", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Engine": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/Engine" + } + }, + "type": { + "type": "Type", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "ENGINE_TYPE_SEARCH": 1, + "ENGINE_TYPE_CHAT": 2 + } + } + } + } + } + }, + "EvaluationPersona": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "personality": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "speechConfig": { + "type": "SpeechConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SpeechConfig": { + "fields": { + "speakingRate": { + "type": "double", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "environment": { + "type": "BackgroundEnvironment", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "voiceId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "BackgroundEnvironment": { + "values": { + "BACKGROUND_ENVIRONMENT_UNSPECIFIED": 0, + "CALL_CENTER": 3, + "TRAFFIC": 4, + "KIDS_NOISE": 5, + "CAFE": 6 + } + } + } + } + } + }, + "BigQueryExportSettings": { + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "project": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataset": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EvaluationToolCallBehaviour": { + "values": { + "EVALUATION_TOOL_CALL_BEHAVIOUR_UNSPECIFIED": 0, + "REAL": 1, + "FAKE": 2 + } + }, + "CodeBlock": { + "fields": { + "pythonCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ToolFakeConfig": { + "oneofs": { + "toolResponse": { + "oneof": [ + "codeBlock" + ] + } + }, + "fields": { + "codeBlock": { + "type": "CodeBlock", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableFakeMode": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GoldenRunMethod": { + "values": { + "GOLDEN_RUN_METHOD_UNSPECIFIED": 0, + "STABLE": 1, + "NAIVE": 2 + } + }, + "Schema": { + "oneofs": { + "_minimum": { + "oneof": [ + "minimum" + ] + }, + "_maximum": { + "oneof": [ + "maximum" + ] + } + }, + "fields": { + "type": { + "type": "Type", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "properties": { + "keyType": "string", + "type": "Schema", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "required": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "items": { + "type": "Schema", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nullable": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "uniqueItems": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prefixItems": { + "rule": "repeated", + "type": "Schema", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "additionalProperties": { + "type": "Schema", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "anyOf": { + "rule": "repeated", + "type": "Schema", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enum": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "default": { + "type": "google.protobuf.Value", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ref": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defs": { + "keyType": "string", + "type": "Schema", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "title": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "minItems": { + "type": "int64", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxItems": { + "type": "int64", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "minimum": { + "type": "double", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "maximum": { + "type": "double", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "STRING": 1, + "INTEGER": 2, + "NUMBER": 3, + "BOOLEAN": 4, + "OBJECT": 5, + "ARRAY": 6 + } + } + } + }, + "AppSnapshot": { + "fields": { + "app": { + "type": "App", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agents": { + "rule": "repeated", + "type": "Agent", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tools": { + "rule": "repeated", + "type": "Tool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "examples": { + "rule": "repeated", + "type": "Example", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "guardrails": { + "rule": "repeated", + "type": "Guardrail", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolsets": { + "rule": "repeated", + "type": "Toolset", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AppVersion": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/AppVersion", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/versions/{version}", + "(google.api.resource).plural": "appVersions", + "(google.api.resource).singular": "appVersion" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "creator": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "snapshot": { + "type": "AppSnapshot", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Example": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Example", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/examples/{example}", + "(google.api.resource).plural": "examples", + "(google.api.resource).singular": "example" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "entryAgent": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "messages": { + "rule": "repeated", + "type": "Message", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "invalid": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 9 + } + } + }, + "Message": { + "fields": { + "role": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "chunks": { + "rule": "repeated", + "type": "Chunk", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Chunk": { + "oneofs": { + "data": { + "oneof": [ + "text", + "transcript", + "blob", + "payload", + "image", + "toolCall", + "toolResponse", + "agentTransfer", + "updatedVariables", + "defaultVariables" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "transcript": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "blob": { + "type": "Blob", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "image": { + "type": "Image", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolCall": { + "type": "ToolCall", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolResponse": { + "type": "ToolResponse", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agentTransfer": { + "type": "AgentTransfer", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updatedVariables": { + "type": "google.protobuf.Struct", + "id": 8 + }, + "defaultVariables": { + "type": "google.protobuf.Struct", + "id": 10 + } + } + }, + "Blob": { + "fields": { + "mimeType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "data": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Image": { + "fields": { + "mimeType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "data": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ToolCall": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "args": { + "type": "google.protobuf.Struct", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ToolResponse": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "response": { + "type": "google.protobuf.Struct", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AgentTransfer": { + "fields": { + "targetAgent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ToolsetTool": { + "fields": { + "toolset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" + } + }, + "toolId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Guardrail": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Guardrail", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}", + "(google.api.resource).plural": "guardrails", + "(google.api.resource).singular": "guardrail" + }, + "oneofs": { + "guardrailType": { + "oneof": [ + "contentFilter", + "llmPromptSecurity", + "llmPolicy", + "modelSafety", + "codeCallback" + ] + } + }, + "fields": { + "contentFilter": { + "type": "ContentFilter", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "llmPromptSecurity": { + "type": "LlmPromptSecurity", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "llmPolicy": { + "type": "LlmPolicy", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modelSafety": { + "type": "ModelSafety", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "codeCallback": { + "type": "CodeCallback", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enabled": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "action": { + "type": "TriggerAction", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 11 + } + }, + "nested": { + "ContentFilter": { + "fields": { + "bannedContents": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bannedContentsInUserInput": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bannedContentsInAgentResponse": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "matchType": { + "type": "MatchType", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "disregardDiacritics": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "MatchType": { + "values": { + "MATCH_TYPE_UNSPECIFIED": 0, + "SIMPLE_STRING_MATCH": 1, + "WORD_BOUNDARY_STRING_MATCH": 2, + "REGEXP_MATCH": 3 + } + } + } + }, + "LlmPromptSecurity": { + "oneofs": { + "securityConfig": { + "oneof": [ + "defaultSettings", + "customPolicy" + ] + } + }, + "fields": { + "defaultSettings": { + "type": "DefaultSecuritySettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "customPolicy": { + "type": "LlmPolicy", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "failOpen": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "DefaultSecuritySettings": { + "fields": { + "defaultPromptTemplate": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "LlmPolicy": { + "fields": { + "maxConversationMessages": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modelSettings": { + "type": "ModelSettings", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prompt": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "policyScope": { + "type": "PolicyScope", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "failOpen": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowShortUtterance": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PolicyScope": { + "values": { + "POLICY_SCOPE_UNSPECIFIED": 0, + "USER_QUERY": 1, + "AGENT_RESPONSE": 2, + "USER_QUERY_AND_AGENT_RESPONSE": 3 + } + } + } + }, + "ModelSafety": { + "fields": { + "safetySettings": { + "rule": "repeated", + "type": "SafetySetting", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "SafetySetting": { + "fields": { + "category": { + "type": "HarmCategory", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "threshold": { + "type": "HarmBlockThreshold", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "HarmCategory": { + "values": { + "HARM_CATEGORY_UNSPECIFIED": 0, + "HARM_CATEGORY_HATE_SPEECH": 1, + "HARM_CATEGORY_DANGEROUS_CONTENT": 2, + "HARM_CATEGORY_HARASSMENT": 3, + "HARM_CATEGORY_SEXUALLY_EXPLICIT": 4 + } + }, + "HarmBlockThreshold": { + "values": { + "HARM_BLOCK_THRESHOLD_UNSPECIFIED": 0, + "BLOCK_LOW_AND_ABOVE": 1, + "BLOCK_MEDIUM_AND_ABOVE": 2, + "BLOCK_ONLY_HIGH": 3, + "BLOCK_NONE": 4, + "OFF": 5 + } + } + } + }, + "CodeCallback": { + "fields": { + "beforeAgentCallback": { + "type": "Callback", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "afterAgentCallback": { + "type": "Callback", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "beforeModelCallback": { + "type": "Callback", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "afterModelCallback": { + "type": "Callback", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "Tool": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Tool", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/tools/{tool}", + "(google.api.resource).plural": "tools", + "(google.api.resource).singular": "tool" + }, + "oneofs": { + "toolType": { + "oneof": [ + "clientFunction", + "openApiTool", + "googleSearchTool", + "connectorTool", + "dataStoreTool", + "pythonFunction", + "mcpTool", + "fileSearchTool", + "systemTool", + "widgetTool" + ] + } + }, + "fields": { + "clientFunction": { + "type": "ClientFunction", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "openApiTool": { + "type": "OpenApiTool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "googleSearchTool": { + "type": "GoogleSearchTool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "connectorTool": { + "type": "ConnectorTool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataStoreTool": { + "type": "DataStoreTool", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pythonFunction": { + "type": "PythonFunction", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mcpTool": { + "type": "McpTool", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileSearchTool": { + "type": "FileSearchTool", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "systemTool": { + "type": "SystemTool", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "widgetTool": { + "type": "WidgetTool", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "executionType": { + "type": "ExecutionType", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 14 + }, + "generatedSummary": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolFakeConfig": { + "type": "ToolFakeConfig", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ClientFunction": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parameters": { + "type": "Schema", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "response": { + "type": "Schema", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Action": { + "oneofs": { + "actionSpec": { + "oneof": [ + "connectionActionId", + "entityOperation" + ] + } + }, + "fields": { + "connectionActionId": { + "type": "string", + "id": 4 + }, + "entityOperation": { + "type": "EntityOperation", + "id": 5 + }, + "inputFields": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputFields": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "EntityOperation": { + "fields": { + "entityId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "operation": { + "type": "OperationType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "OperationType": { + "values": { + "OPERATION_TYPE_UNSPECIFIED": 0, + "LIST": 1, + "GET": 2, + "CREATE": 3, + "UPDATE": 4, + "DELETE": 5 + } + } + } + } + } + }, + "ConnectorTool": { + "fields": { + "connection": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "action": { + "type": "Action", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authConfig": { + "type": "EndUserAuthConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ApiKeyConfig": { + "fields": { + "keyName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiKeySecretVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "requestLocation": { + "type": "RequestLocation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "RequestLocation": { + "values": { + "REQUEST_LOCATION_UNSPECIFIED": 0, + "HEADER": 1, + "QUERY_STRING": 2 + } + } + } + }, + "OAuthConfig": { + "fields": { + "oauthGrantType": { + "type": "OauthGrantType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientSecretVersion": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "tokenEndpoint": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "OauthGrantType": { + "values": { + "OAUTH_GRANT_TYPE_UNSPECIFIED": 0, + "CLIENT_CREDENTIAL": 1 + } + } + } + }, + "ServiceAgentIdTokenAuthConfig": { + "fields": {} + }, + "ServiceAccountAuthConfig": { + "fields": { + "serviceAccount": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BearerTokenConfig": { + "fields": { + "token": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "EndUserAuthConfig": { + "oneofs": { + "authConfig": { + "oneof": [ + "oauth2AuthCodeConfig", + "oauth2JwtBearerConfig" + ] + } + }, + "fields": { + "oauth2AuthCodeConfig": { + "type": "Oauth2AuthCodeConfig", + "id": 2 + }, + "oauth2JwtBearerConfig": { + "type": "Oauth2JwtBearerConfig", + "id": 3 + } + }, + "nested": { + "Oauth2AuthCodeConfig": { + "fields": { + "oauthToken": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Oauth2JwtBearerConfig": { + "fields": { + "issuer": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "subject": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientKey": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ApiAuthentication": { + "oneofs": { + "authConfig": { + "oneof": [ + "apiKeyConfig", + "oauthConfig", + "serviceAgentIdTokenAuthConfig", + "serviceAccountAuthConfig", + "bearerTokenConfig" + ] + } + }, + "fields": { + "apiKeyConfig": { + "type": "ApiKeyConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "oauthConfig": { + "type": "OAuthConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAgentIdTokenAuthConfig": { + "type": "ServiceAgentIdTokenAuthConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccountAuthConfig": { + "type": "ServiceAccountAuthConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bearerTokenConfig": { + "type": "BearerTokenConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DataStoreTool": { + "oneofs": { + "searchSource": { + "oneof": [ + "dataStoreSource", + "engineSource" + ] + } + }, + "fields": { + "dataStoreSource": { + "type": "DataStoreSource", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "engineSource": { + "type": "EngineSource", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "boostSpecs": { + "rule": "repeated", + "type": "BoostSpecs", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modalityConfigs": { + "rule": "repeated", + "type": "ModalityConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filterParameterBehavior": { + "type": "FilterParameterBehavior", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RewriterConfig": { + "fields": { + "modelSettings": { + "type": "ModelSettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "prompt": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disabled": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SummarizationConfig": { + "fields": { + "modelSettings": { + "type": "ModelSettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prompt": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disabled": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GroundingConfig": { + "fields": { + "groundingLevel": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disabled": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DataStoreSource": { + "fields": { + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataStore": { + "type": "DataStore", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EngineSource": { + "fields": { + "engine": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dataStoreSources": { + "rule": "repeated", + "type": "DataStoreSource", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BoostSpecs": { + "fields": { + "dataStores": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "spec": { + "rule": "repeated", + "type": "BoostSpec", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BoostSpec": { + "fields": { + "conditionBoostSpecs": { + "rule": "repeated", + "type": "ConditionBoostSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "ConditionBoostSpec": { + "fields": { + "condition": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "boost": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "boostControlSpec": { + "type": "BoostControlSpec", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "BoostControlSpec": { + "fields": { + "fieldName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributeType": { + "type": "AttributeType", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "interpolationType": { + "type": "InterpolationType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "controlPoints": { + "rule": "repeated", + "type": "ControlPoint", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ControlPoint": { + "fields": { + "attributeValue": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "boostAmount": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AttributeType": { + "values": { + "ATTRIBUTE_TYPE_UNSPECIFIED": 0, + "NUMERICAL": 1, + "FRESHNESS": 2 + } + }, + "InterpolationType": { + "values": { + "INTERPOLATION_TYPE_UNSPECIFIED": 0, + "LINEAR": 1 + } + } + } + } + } + } + } + }, + "ModalityConfig": { + "fields": { + "modalityType": { + "type": "ModalityType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rewriterConfig": { + "type": "RewriterConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "summarizationConfig": { + "type": "SummarizationConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "groundingConfig": { + "type": "GroundingConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ModalityType": { + "values": { + "MODALITY_TYPE_UNSPECIFIED": 0, + "TEXT": 1, + "AUDIO": 2 + } + } + } + }, + "FilterParameterBehavior": { + "values": { + "FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED": 0, + "ALWAYS_INCLUDE": 2, + "NEVER_INCLUDE": 3 + } + } + } + }, + "DataStore": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "type": { + "type": "DataStoreType", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "documentProcessingMode": { + "type": "DocumentProcessingMode", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "connectorConfig": { + "type": "ConnectorConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ConnectorConfig": { + "fields": { + "collection": { + "type": "string", + "id": 1 + }, + "collectionDisplayName": { + "type": "string", + "id": 2 + }, + "dataSource": { + "type": "string", + "id": 3 + } + } + }, + "DataStoreType": { + "values": { + "DATA_STORE_TYPE_UNSPECIFIED": 0, + "PUBLIC_WEB": 1, + "UNSTRUCTURED": 2, + "FAQ": 3, + "CONNECTOR": 4 + } + }, + "DocumentProcessingMode": { + "values": { + "DOCUMENT_PROCESSING_MODE_UNSPECIFIED": 0, + "DOCUMENTS": 1, + "CHUNKS": 2 + } + } + } + }, + "FileSearchTool": { + "fields": { + "corpusType": { + "type": "CorpusType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileCorpus": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CorpusType": { + "values": { + "CORPUS_TYPE_UNSPECIFIED": 0, + "USER_OWNED": 1, + "FULLY_MANAGED": 2 + } + } + } + }, + "GoogleSearchTool": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "contextUrls": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "preferredDomains": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "excludeDomains": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "promptConfig": { + "type": "PromptConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PromptConfig": { + "fields": { + "textPrompt": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "voicePrompt": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "McpTool": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inputSchema": { + "type": "Schema", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputSchema": { + "type": "Schema", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serverAddress": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiAuthentication": { + "type": "ApiAuthentication", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsConfig": { + "type": "TlsConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceDirectoryConfig": { + "type": "ServiceDirectoryConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OpenApiTool": { + "fields": { + "openApiSchema": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "name": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "apiAuthentication": { + "type": "ApiAuthentication", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsConfig": { + "type": "TlsConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceDirectoryConfig": { + "type": "ServiceDirectoryConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreUnknownFields": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "url": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PythonFunction": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pythonCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SystemTool": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "WidgetTool": { + "oneofs": { + "input": { + "oneof": [ + "parameters" + ] + } + }, + "fields": { + "parameters": { + "type": "Schema", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "widgetType": { + "type": "WidgetType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "WidgetType": { + "values": { + "WIDGET_TYPE_UNSPECIFIED": 0, + "CUSTOM": 1, + "PRODUCT_CAROUSEL": 2, + "PRODUCT_DETAILS": 3, + "QUICK_ACTIONS": 4, + "PRODUCT_COMPARISON": 5, + "ADVANCED_PRODUCT_DETAILS": 6, + "SHORT_FORM": 7, + "OVERALL_SATISFACTION": 8, + "ORDER_SUMMARY": 9, + "APPOINTMENT_DETAILS": 10, + "APPOINTMENT_SCHEDULER": 11, + "CONTACT_FORM": 12 + } + } + } + }, + "Toolset": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Toolset", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}", + "(google.api.resource).plural": "toolsets", + "(google.api.resource).singular": "toolset" + }, + "oneofs": { + "toolsetType": { + "oneof": [ + "mcpToolset", + "openApiToolset", + "connectorToolset" + ] + } + }, + "fields": { + "mcpToolset": { + "type": "McpToolset", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "openApiToolset": { + "type": "OpenApiToolset", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "connectorToolset": { + "type": "ConnectorToolset", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 5 + }, + "executionType": { + "type": "ExecutionType", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolFakeConfig": { + "type": "ToolFakeConfig", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ConnectorToolset": { + "fields": { + "connection": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authConfig": { + "type": "EndUserAuthConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "connectorActions": { + "rule": "repeated", + "type": "Action", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "McpToolset": { + "fields": { + "serverAddress": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiAuthentication": { + "type": "ApiAuthentication", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceDirectoryConfig": { + "type": "ServiceDirectoryConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsConfig": { + "type": "TlsConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OpenApiToolset": { + "fields": { + "openApiSchema": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiAuthentication": { + "type": "ApiAuthentication", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsConfig": { + "type": "TlsConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceDirectoryConfig": { + "type": "ServiceDirectoryConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreUnknownFields": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "url": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Changelog": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Changelog", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/changelogs/{changelog}", + "(google.api.resource).plural": "changelogs", + "(google.api.resource).singular": "changelog" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "author": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resource": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourceType": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "action": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "originalResource": { + "type": "google.protobuf.Struct", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "newResource": { + "type": "google.protobuf.Struct", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dependentResources": { + "rule": "repeated", + "type": "google.protobuf.Struct", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sequenceNumber": { + "type": "int64", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Conversation": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Conversation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}", + "(google.api.resource).plural": "conversations", + "(google.api.resource).singular": "conversation" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "turns": { + "rule": "repeated", + "type": "Turn", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "turnCount": { + "type": "int32", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "channelType": { + "type": "ChannelType", + "id": 8, + "options": { + "deprecated": true + } + }, + "source": { + "type": "Source", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "inputTypes": { + "rule": "repeated", + "type": "InputType", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "entryAgent": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "deployment": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" + } + }, + "appVersion": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + }, + "languageCode": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "messages": { + "rule": "repeated", + "type": "Message", + "id": 2, + "options": { + "deprecated": true + } + } + }, + "nested": { + "Turn": { + "fields": { + "messages": { + "rule": "repeated", + "type": "Message", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rootSpan": { + "type": "Span", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ChannelType": { + "values": { + "CHANNEL_TYPE_UNSPECIFIED": 0, + "TEXT": 1, + "AUDIO": 2, + "MULTIMODAL": 3 + } + }, + "Source": { + "values": { + "SOURCE_UNSPECIFIED": 0, + "LIVE": 1, + "SIMULATOR": 2, + "EVAL": 3 + } + }, + "InputType": { + "values": { + "INPUT_TYPE_UNSPECIFIED": 0, + "INPUT_TYPE_TEXT": 1, + "INPUT_TYPE_AUDIO": 2, + "INPUT_TYPE_IMAGE": 3, + "INPUT_TYPE_BLOB": 4, + "INPUT_TYPE_TOOL_RESPONSE": 5, + "INPUT_TYPE_VARIABLES": 6 + } + } + } + }, + "Deployment": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Deployment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}", + "(google.api.resource).plural": "deployments", + "(google.api.resource).singular": "deployment" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "appVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + }, + "channelProfile": { + "type": "ChannelProfile", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "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" + } + }, + "etag": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "AggregatedMetrics": { + "fields": { + "metricsByAppVersion": { + "rule": "repeated", + "type": "MetricsByAppVersion", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ToolMetrics": { + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "passCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failCount": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "TurnLatencyMetrics": { + "fields": { + "averageLatency": { + "type": "google.protobuf.Duration", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ToolCallLatencyMetrics": { + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "averageLatency": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SemanticSimilarityMetrics": { + "fields": { + "score": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "HallucinationMetrics": { + "fields": { + "score": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "MetricsByAppVersion": { + "fields": { + "appVersionId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolMetrics": { + "rule": "repeated", + "type": "ToolMetrics", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "semanticSimilarityMetrics": { + "rule": "repeated", + "type": "SemanticSimilarityMetrics", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "hallucinationMetrics": { + "rule": "repeated", + "type": "HallucinationMetrics", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolCallLatencyMetrics": { + "rule": "repeated", + "type": "ToolCallLatencyMetrics", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "turnLatencyMetrics": { + "rule": "repeated", + "type": "TurnLatencyMetrics", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "passCount": { + "type": "int32", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failCount": { + "type": "int32", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "metricsByTurn": { + "rule": "repeated", + "type": "MetricsByTurn", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "MetricsByTurn": { + "fields": { + "turnIndex": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolMetrics": { + "rule": "repeated", + "type": "ToolMetrics", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "semanticSimilarityMetrics": { + "rule": "repeated", + "type": "SemanticSimilarityMetrics", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "hallucinationMetrics": { + "rule": "repeated", + "type": "HallucinationMetrics", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolCallLatencyMetrics": { + "rule": "repeated", + "type": "ToolCallLatencyMetrics", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "turnLatencyMetrics": { + "rule": "repeated", + "type": "TurnLatencyMetrics", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "Evaluation": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Evaluation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}", + "(google.api.resource).plural": "evaluations", + "(google.api.resource).singular": "evaluation" + }, + "oneofs": { + "inputs": { + "oneof": [ + "golden", + "scenario" + ] + } + }, + "fields": { + "golden": { + "type": "Golden", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scenario": { + "type": "Scenario", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationDatasets": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationDataset" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createdBy": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastUpdatedBy": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "evaluationRuns": { + "rule": "repeated", + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" + } + }, + "etag": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "aggregatedMetrics": { + "type": "AggregatedMetrics", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastCompletedResult": { + "type": "EvaluationResult", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "invalid": { + "type": "bool", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastTenResults": { + "rule": "repeated", + "type": "EvaluationResult", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "GoldenExpectation": { + "oneofs": { + "condition": { + "oneof": [ + "toolCall", + "toolResponse", + "agentResponse", + "agentTransfer", + "updatedVariables", + "mockToolResponse" + ] + } + }, + "fields": { + "toolCall": { + "type": "ToolCall", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolResponse": { + "type": "ToolResponse", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agentResponse": { + "type": "Message", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agentTransfer": { + "type": "AgentTransfer", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updatedVariables": { + "type": "google.protobuf.Struct", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mockToolResponse": { + "type": "ToolResponse", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "note": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Step": { + "oneofs": { + "step": { + "oneof": [ + "userInput", + "agentTransfer", + "expectation" + ] + } + }, + "fields": { + "userInput": { + "type": "SessionInput", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agentTransfer": { + "type": "AgentTransfer", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expectation": { + "type": "GoldenExpectation", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GoldenTurn": { + "fields": { + "steps": { + "rule": "repeated", + "type": "Step", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rootSpan": { + "type": "Span", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Golden": { + "fields": { + "turns": { + "rule": "repeated", + "type": "GoldenTurn", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "evaluationExpectations": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationExpectation" + } + } + } + }, + "ScenarioExpectation": { + "oneofs": { + "expectation": { + "oneof": [ + "toolExpectation", + "agentResponse" + ] + } + }, + "fields": { + "toolExpectation": { + "type": "ToolExpectation", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agentResponse": { + "type": "Message", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ToolExpectation": { + "fields": { + "expectedToolCall": { + "type": "ToolCall", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mockToolResponse": { + "type": "ToolResponse", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "Scenario": { + "fields": { + "task": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "userFacts": { + "rule": "repeated", + "type": "UserFact", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxTurns": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rubrics": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scenarioExpectations": { + "rule": "repeated", + "type": "ScenarioExpectation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "variableOverrides": { + "type": "google.protobuf.Struct", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "taskCompletionBehavior": { + "type": "TaskCompletionBehavior", + "id": 7, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "userGoalBehavior": { + "type": "UserGoalBehavior", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationExpectations": { + "rule": "repeated", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationExpectation" + } + } + }, + "nested": { + "UserFact": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "value": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TaskCompletionBehavior": { + "values": { + "TASK_COMPLETION_BEHAVIOR_UNSPECIFIED": 0, + "TASK_SATISFIED": 1, + "TASK_REJECTED": 2 + } + }, + "UserGoalBehavior": { + "values": { + "USER_GOAL_BEHAVIOR_UNSPECIFIED": 0, + "USER_GOAL_SATISFIED": 1, + "USER_GOAL_REJECTED": 2, + "USER_GOAL_IGNORED": 3 + } + } + } + } + } + }, + "EvaluationDataset": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/EvaluationDataset", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/evaluationDatasets/{evaluation_dataset}", + "(google.api.resource).plural": "evaluationDatasets", + "(google.api.resource).singular": "evaluationDataset" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "evaluations": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Evaluation" + } + }, + "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" + } + }, + "etag": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createdBy": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastUpdatedBy": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "aggregatedMetrics": { + "type": "AggregatedMetrics", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "EvaluationResult": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/EvaluationResult", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/evaluations/{evaluation}/results/{evaluation_result}", + "(google.api.resource).plural": "evaluationResults", + "(google.api.resource).singular": "evaluationResult" + }, + "oneofs": { + "result": { + "oneof": [ + "goldenResult", + "scenarioResult" + ] + } + }, + "fields": { + "goldenResult": { + "type": "GoldenResult", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "scenarioResult": { + "type": "ScenarioResult", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "evaluationStatus": { + "type": "Outcome", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "evaluationRun": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" + } + }, + "persona": { + "type": "EvaluationPersona", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorInfo": { + "type": "EvaluationErrorInfo", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "error": { + "type": "google.rpc.Status", + "id": 14, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "initiatedBy": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "appVersion": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + }, + "appVersionDisplayName": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "changelog": { + "type": "string", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Changelog" + } + }, + "changelogCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "executionState": { + "type": "ExecutionState", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "evaluationMetricsThresholds": { + "type": "EvaluationMetricsThresholds", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "config": { + "type": "EvaluationConfig", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "goldenRunMethod": { + "type": "GoldenRunMethod", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "GoldenExpectationOutcome": { + "oneofs": { + "result": { + "oneof": [ + "observedToolCall", + "observedToolResponse", + "observedAgentResponse", + "observedAgentTransfer" + ] + } + }, + "fields": { + "observedToolCall": { + "type": "ToolCall", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "observedToolResponse": { + "type": "ToolResponse", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "observedAgentResponse": { + "type": "Message", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "observedAgentTransfer": { + "type": "AgentTransfer", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expectation": { + "type": "Evaluation.GoldenExpectation", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "outcome": { + "type": "Outcome", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "semanticSimilarityResult": { + "type": "SemanticSimilarityResult", + "id": 7, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolInvocationResult": { + "type": "ToolInvocationResult", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ToolInvocationResult": { + "oneofs": { + "_parameterCorrectnessScore": { + "oneof": [ + "parameterCorrectnessScore" + ] + } + }, + "fields": { + "parameterCorrectnessScore": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "outcome": { + "type": "Outcome", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "explanation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "EvaluationExpectationResult": { + "fields": { + "evaluationExpectation": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationExpectation" + } + }, + "prompt": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "outcome": { + "type": "Outcome", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "explanation": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GoldenResult": { + "fields": { + "turnReplayResults": { + "rule": "repeated", + "type": "TurnReplayResult", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "evaluationExpectationResults": { + "rule": "repeated", + "type": "EvaluationExpectationResult", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "TurnReplayResult": { + "oneofs": { + "_toolOrderedInvocationScore": { + "oneof": [ + "toolOrderedInvocationScore" + ] + } + }, + "fields": { + "conversation": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" + } + }, + "expectationOutcome": { + "rule": "repeated", + "type": "GoldenExpectationOutcome", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "hallucinationResult": { + "type": "HallucinationResult", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolInvocationScore": { + "type": "float", + "id": 4, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolOrderedInvocationScore": { + "type": "float", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "turnLatency": { + "type": "google.protobuf.Duration", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolCallLatencies": { + "rule": "repeated", + "type": "ToolCallLatency", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "semanticSimilarityResult": { + "type": "SemanticSimilarityResult", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "overallToolInvocationResult": { + "type": "OverallToolInvocationResult", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorInfo": { + "type": "EvaluationErrorInfo", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "spanLatencies": { + "rule": "repeated", + "type": "SpanLatency", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "ScenarioRubricOutcome": { + "oneofs": { + "_score": { + "oneof": [ + "score" + ] + } + }, + "fields": { + "rubric": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "score": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "scoreExplanation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ScenarioExpectationOutcome": { + "oneofs": { + "result": { + "oneof": [ + "observedToolCall", + "observedAgentResponse" + ] + } + }, + "fields": { + "observedToolCall": { + "type": "ObservedToolCall", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "observedAgentResponse": { + "type": "Message", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expectation": { + "type": "Evaluation.ScenarioExpectation", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "outcome": { + "type": "Outcome", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ObservedToolCall": { + "fields": { + "toolCall": { + "type": "ToolCall", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolResponse": { + "type": "ToolResponse", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "ScenarioResult": { + "oneofs": { + "_allExpectationsSatisfied": { + "oneof": [ + "allExpectationsSatisfied" + ] + }, + "_taskCompleted": { + "oneof": [ + "taskCompleted" + ] + } + }, + "fields": { + "conversation": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" + } + }, + "task": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "userFacts": { + "rule": "repeated", + "type": "Evaluation.Scenario.UserFact", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expectationOutcomes": { + "rule": "repeated", + "type": "ScenarioExpectationOutcome", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "rubricOutcomes": { + "rule": "repeated", + "type": "ScenarioRubricOutcome", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "hallucinationResult": { + "rule": "repeated", + "type": "HallucinationResult", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "taskCompletionResult": { + "type": "TaskCompletionResult", + "id": 5, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolCallLatencies": { + "rule": "repeated", + "type": "ToolCallLatency", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "userGoalSatisfactionResult": { + "type": "UserGoalSatisfactionResult", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "allExpectationsSatisfied": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "taskCompleted": { + "type": "bool", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "spanLatencies": { + "rule": "repeated", + "type": "SpanLatency", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "evaluationExpectationResults": { + "rule": "repeated", + "type": "EvaluationExpectationResult", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SpanLatency": { + "oneofs": { + "identifier": { + "oneof": [ + "resource", + "toolset", + "model", + "callback" + ] + } + }, + "fields": { + "resource": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolset": { + "type": "ToolsetTool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "model": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "callback": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "Type", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "executionLatency": { + "type": "google.protobuf.Duration", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "TOOL": 1, + "USER_CALLBACK": 2, + "GUARDRAIL": 3, + "LLM": 4 + } + } + } + }, + "ToolCallLatency": { + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "executionLatency": { + "type": "google.protobuf.Duration", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "HallucinationResult": { + "oneofs": { + "_score": { + "oneof": [ + "score" + ] + } + }, + "fields": { + "score": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "label": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "explanation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "UserGoalSatisfactionResult": { + "oneofs": { + "_score": { + "oneof": [ + "score" + ] + } + }, + "fields": { + "score": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "label": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "explanation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SemanticSimilarityResult": { + "oneofs": { + "_score": { + "oneof": [ + "score" + ] + } + }, + "fields": { + "score": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "label": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "explanation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "outcome": { + "type": "Outcome", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "OverallToolInvocationResult": { + "oneofs": { + "_toolInvocationScore": { + "oneof": [ + "toolInvocationScore" + ] + } + }, + "fields": { + "toolInvocationScore": { + "type": "float", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "outcome": { + "type": "Outcome", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "TaskCompletionResult": { + "oneofs": { + "_score": { + "oneof": [ + "score" + ] + } + }, + "fields": { + "score": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "label": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "explanation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Outcome": { + "values": { + "OUTCOME_UNSPECIFIED": 0, + "PASS": 1, + "FAIL": 2 + } + }, + "ExecutionState": { + "values": { + "EXECUTION_STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "COMPLETED": 2, + "ERROR": 3 + } + } + } + }, + "EvaluationRun": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/EvaluationRun", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/evaluationRuns/{evaluation_run}", + "(google.api.resource).plural": "evaluationRuns", + "(google.api.resource).singular": "evaluationRun" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationResults": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationResult" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "initiatedBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "appVersion": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + }, + "appVersionDisplayName": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "changelog": { + "type": "string", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Changelog" + } + }, + "changelogCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "evaluations": { + "rule": "repeated", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Evaluation" + } + }, + "evaluationDataset": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationDataset" + } + }, + "evaluationType": { + "type": "EvaluationType", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "EvaluationRunState", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "progress": { + "type": "Progress", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "config": { + "type": "EvaluationConfig", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "error": { + "type": "google.rpc.Status", + "id": 14, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorInfo": { + "type": "EvaluationErrorInfo", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "evaluationRunSummaries": { + "keyType": "string", + "type": "EvaluationRunSummary", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latencyReport": { + "type": "LatencyReport", + "id": 25, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "runCount": { + "type": "int32", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "personaRunConfigs": { + "rule": "repeated", + "type": "PersonaRunConfig", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "optimizationConfig": { + "type": "OptimizationConfig", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scheduledEvaluationRun": { + "type": "string", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/ScheduledEvaluationRun" + } + }, + "goldenRunMethod": { + "type": "GoldenRunMethod", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Progress": { + "fields": { + "totalCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failedCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorCount": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "completedCount": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "passedCount": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "EvaluationRunSummary": { + "fields": { + "passedCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failedCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorCount": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "EvaluationType": { + "values": { + "EVALUATION_TYPE_UNSPECIFIED": 0, + "GOLDEN": 1, + "SCENARIO": 2, + "MIXED": 3 + } + }, + "EvaluationRunState": { + "values": { + "EVALUATION_RUN_STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "COMPLETED": 2, + "ERROR": 3 + } + } + } + }, + "LatencyReport": { + "fields": { + "toolLatencies": { + "rule": "repeated", + "type": "ToolLatency", + "id": 1, + "options": { + "(google.api.field_behavior)": "UNORDERED_LIST" + } + }, + "callbackLatencies": { + "rule": "repeated", + "type": "CallbackLatency", + "id": 2, + "options": { + "(google.api.field_behavior)": "UNORDERED_LIST" + } + }, + "guardrailLatencies": { + "rule": "repeated", + "type": "GuardrailLatency", + "id": 3, + "options": { + "(google.api.field_behavior)": "UNORDERED_LIST" + } + }, + "llmCallLatencies": { + "rule": "repeated", + "type": "LlmCallLatency", + "id": 4, + "options": { + "(google.api.field_behavior)": "UNORDERED_LIST" + } + }, + "sessionCount": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "LatencyMetrics": { + "fields": { + "p50Latency": { + "type": "google.protobuf.Duration", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "p90Latency": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "p99Latency": { + "type": "google.protobuf.Duration", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "callCount": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ToolLatency": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolDisplayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latencyMetrics": { + "type": "LatencyMetrics", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CallbackLatency": { + "fields": { + "stage": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latencyMetrics": { + "type": "LatencyMetrics", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GuardrailLatency": { + "fields": { + "guardrail": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Guardrail" + } + }, + "guardrailDisplayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latencyMetrics": { + "type": "LatencyMetrics", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "LlmCallLatency": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latencyMetrics": { + "type": "LatencyMetrics", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "EvaluationExpectation": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/EvaluationExpectation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/evaluationExpectations/{evaluation_expectation}", + "(google.api.resource).plural": "evaluationExpectations", + "(google.api.resource).singular": "evaluationExpectation" + }, + "oneofs": { + "criteria": { + "oneof": [ + "llmCriteria" + ] + } + }, + "fields": { + "llmCriteria": { + "type": "LlmCriteria", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "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" + } + }, + "etag": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "LlmCriteria": { + "fields": { + "prompt": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "EvaluationConfig": { + "fields": { + "inputAudioConfig": { + "type": "InputAudioConfig", + "id": 1, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationChannel": { + "type": "EvaluationChannel", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolCallBehaviour": { + "type": "EvaluationToolCallBehaviour", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "EvaluationChannel": { + "values": { + "EVALUATION_CHANNEL_UNSPECIFIED": 0, + "TEXT": 1, + "AUDIO": 2 + } + } + } + }, + "EvaluationErrorInfo": { + "fields": { + "errorType": { + "type": "ErrorType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorMessage": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sessionId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ErrorType": { + "values": { + "ERROR_TYPE_UNSPECIFIED": 0, + "RUNTIME_FAILURE": 1, + "CONVERSATION_RETRIEVAL_FAILURE": 2, + "METRIC_CALCULATION_FAILURE": 3, + "EVALUATION_UPDATE_FAILURE": 4, + "QUOTA_EXHAUSTED": 5, + "USER_SIMULATION_FAILURE": 6 + } + } + } + }, + "RunEvaluationRequest": { + "oneofs": { + "_runCount": { + "oneof": [ + "runCount" + ] + } + }, + "fields": { + "app": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "evaluations": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Evaluation" + } + }, + "evaluationDataset": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationDataset" + } + }, + "displayName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "appVersion": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/AppVersion" + } + }, + "config": { + "type": "EvaluationConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "runCount": { + "type": "int32", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "personaRunConfigs": { + "rule": "repeated", + "type": "PersonaRunConfig", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "optimizationConfig": { + "type": "OptimizationConfig", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scheduledEvaluationRun": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/ScheduledEvaluationRun" + } + }, + "goldenRunMethod": { + "type": "GoldenRunMethod", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "generateLatencyReport": { + "type": "bool", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ScheduledEvaluationRun": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/ScheduledEvaluationRun", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apps/{app}/scheduledEvaluationRuns/{scheduled_evaluation_run}", + "(google.api.resource).plural": "scheduledEvaluationRuns", + "(google.api.resource).singular": "scheduledEvaluationRun" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "request": { + "type": "RunEvaluationRequest", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schedulingConfig": { + "type": "SchedulingConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "active": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lastCompletedRun": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" + } + }, + "totalExecutions": { + "type": "int32", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextScheduledExecutionTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createdBy": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastUpdatedBy": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "SchedulingConfig": { + "fields": { + "frequency": { + "type": "Frequency", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "daysOfWeek": { + "rule": "repeated", + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Frequency": { + "values": { + "FREQUENCY_UNSPECIFIED": 0, + "NONE": 1, + "DAILY": 2, + "WEEKLY": 3, + "BIWEEKLY": 4 + } + } + } + } + } + }, + "PersonaRunConfig": { + "fields": { + "persona": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "taskCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OptimizationConfig": { + "fields": { + "generateLossReport": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "assistantSession": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reportSummary": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "shouldSuggestFix": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "status": { + "type": "OptimizationStatus", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorMessage": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lossReport": { + "type": "google.protobuf.Struct", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "OptimizationStatus": { + "values": { + "OPTIMIZATION_STATUS_UNSPECIFIED": 0, + "RUNNING": 1, + "COMPLETED": 2, + "ERROR": 3 + } + } + } + }, + "SessionService": { + "options": { + "(google.api.default_host)": "ces.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "RunSession": { + "requestType": "RunSessionRequest", + "responseType": "RunSessionResponse", + "options": { + "(google.api.http).post": "/v1beta/{config.session=projects/*/locations/*/apps/*/sessions/*}:runSession", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{config.session=projects/*/locations/*/apps/*/sessions/*}:runSession", + "body": "*" + } + } + ] + }, + "BidiRunSession": { + "requestType": "BidiSessionClientMessage", + "requestStream": true, + "responseType": "BidiSessionServerMessage", + "responseStream": true + } + } + }, + "AudioEncoding": { + "values": { + "AUDIO_ENCODING_UNSPECIFIED": 0, + "LINEAR16": 1, + "MULAW": 2, + "ALAW": 3 + } + }, + "InputAudioConfig": { + "fields": { + "audioEncoding": { + "type": "AudioEncoding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sampleRateHertz": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "noiseSuppressionLevel": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OutputAudioConfig": { + "fields": { + "audioEncoding": { + "type": "AudioEncoding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sampleRateHertz": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SessionConfig": { + "fields": { + "session": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Session" + } + }, + "inputAudioConfig": { + "type": "InputAudioConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "historicalContexts": { + "rule": "repeated", + "type": "Message", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "entryAgent": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "deployment": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeZone": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "remoteDialogflowQueryParameters": { + "type": "RemoteDialogflowQueryParameters", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RemoteDialogflowQueryParameters": { + "fields": { + "webhookHeaders": { + "keyType": "string", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endUserMetadata": { + "type": "google.protobuf.Struct", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ToolCalls": { + "fields": { + "toolCalls": { + "rule": "repeated", + "type": "ToolCall", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ToolResponses": { + "fields": { + "toolResponses": { + "rule": "repeated", + "type": "ToolResponse", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Citations": { + "fields": { + "citedChunks": { + "rule": "repeated", + "type": "CitedChunk", + "id": 1 + } + }, + "nested": { + "CitedChunk": { + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "text": { + "type": "string", + "id": 3 + } + } + } + } + }, + "Event": { + "fields": { + "event": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SessionInput": { + "oneofs": { + "inputType": { + "oneof": [ + "text", + "dtmf", + "audio", + "toolResponses", + "image", + "blob", + "variables", + "event" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dtmf": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "audio": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolResponses": { + "type": "ToolResponses", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "image": { + "type": "Image", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "blob": { + "type": "Blob", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "variables": { + "type": "google.protobuf.Struct", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "event": { + "type": "Event", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "willContinue": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SessionOutput": { + "oneofs": { + "outputType": { + "oneof": [ + "text", + "audio", + "toolCalls", + "citations", + "googleSearchSuggestions", + "endSession", + "payload" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "audio": { + "type": "bytes", + "id": 2 + }, + "toolCalls": { + "type": "ToolCalls", + "id": 3 + }, + "citations": { + "type": "Citations", + "id": 8 + }, + "googleSearchSuggestions": { + "type": "GoogleSearchSuggestions", + "id": 10 + }, + "endSession": { + "type": "EndSession", + "id": 9 + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 11 + }, + "turnIndex": { + "type": "int32", + "id": 6 + }, + "turnCompleted": { + "type": "bool", + "id": 4 + }, + "diagnosticInfo": { + "type": "DiagnosticInfo", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "DiagnosticInfo": { + "fields": { + "messages": { + "rule": "repeated", + "type": "Message", + "id": 1 + }, + "rootSpan": { + "type": "Span", + "id": 3 + } + } + } + } + }, + "RecognitionResult": { + "fields": { + "transcript": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InterruptionSignal": { + "fields": { + "bargeIn": { + "type": "bool", + "id": 1 + } + } + }, + "EndSession": { + "fields": { + "metadata": { + "type": "google.protobuf.Struct", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GoAway": { + "fields": {} + }, + "RunSessionRequest": { + "fields": { + "config": { + "type": "SessionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inputs": { + "rule": "repeated", + "type": "SessionInput", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RunSessionResponse": { + "fields": { + "outputs": { + "rule": "repeated", + "type": "SessionOutput", + "id": 1 + } + } + }, + "BidiSessionClientMessage": { + "oneofs": { + "messageType": { + "oneof": [ + "config", + "realtimeInput" + ] + } + }, + "fields": { + "config": { + "type": "SessionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "realtimeInput": { + "type": "SessionInput", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BidiSessionServerMessage": { + "oneofs": { + "messageType": { + "oneof": [ + "sessionOutput", + "recognitionResult", + "interruptionSignal", + "endSession", + "goAway" + ] + } + }, + "fields": { + "sessionOutput": { + "type": "SessionOutput", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "recognitionResult": { + "type": "RecognitionResult", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "interruptionSignal": { + "type": "InterruptionSignal", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endSession": { + "type": "EndSession", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "goAway": { + "type": "GoAway", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GoogleSearchSuggestions": { + "fields": { + "htmls": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "webSearchQueries": { + "rule": "repeated", + "type": "WebSearchQuery", + "id": 2 + } + } + }, + "WebSearchQuery": { + "fields": { + "query": { + "type": "string", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + } + } + }, + "EvaluationService": { + "options": { + "(google.api.default_host)": "ces.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "RunEvaluation": { + "requestType": "RunEvaluationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{app=projects/*/locations/*/apps/*}:runEvaluation", + "(google.api.http).body": "*", + "(google.api.method_signature)": "app", + "(google.longrunning.operation_info).response_type": "RunEvaluationResponse", + "(google.longrunning.operation_info).metadata_type": "RunEvaluationOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{app=projects/*/locations/*/apps/*}:runEvaluation", + "body": "*" + } + }, + { + "(google.api.method_signature)": "app" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RunEvaluationResponse", + "metadata_type": "RunEvaluationOperationMetadata" + } + } + ] + }, + "UploadEvaluationAudio": { + "requestType": "UploadEvaluationAudioRequest", + "responseType": "UploadEvaluationAudioResponse", + "options": { + "(google.api.http).post": "/v1beta/{app=projects/*/locations/*/apps/*}:uploadEvaluationAudio", + "(google.api.http).body": "*", + "(google.api.method_signature)": "app,audio_content" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{app=projects/*/locations/*/apps/*}:uploadEvaluationAudio", + "body": "*" + } + }, + { + "(google.api.method_signature)": "app,audio_content" + } + ] + }, + "CreateEvaluation": { + "requestType": "CreateEvaluationRequest", + "responseType": "Evaluation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluations", + "(google.api.http).body": "evaluation", + "(google.api.method_signature)": "parent,evaluation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluations", + "body": "evaluation" + } + }, + { + "(google.api.method_signature)": "parent,evaluation,evaluation_id" + }, + { + "(google.api.method_signature)": "parent,evaluation" + } + ] + }, + "GenerateEvaluation": { + "requestType": "GenerateEvaluationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{conversation=projects/*/locations/*/apps/*/conversations/*}:generateEvaluation", + "(google.api.http).body": "*", + "(google.api.method_signature)": "conversation", + "(google.longrunning.operation_info).response_type": "Evaluation", + "(google.longrunning.operation_info).metadata_type": "GenerateEvaluationOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{conversation=projects/*/locations/*/apps/*/conversations/*}:generateEvaluation", + "body": "*" + } + }, + { + "(google.api.method_signature)": "conversation" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Evaluation", + "metadata_type": "GenerateEvaluationOperationMetadata" + } + } + ] + }, + "ImportEvaluations": { + "requestType": "ImportEvaluationsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}:importEvaluations", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "ImportEvaluationsResponse", + "(google.longrunning.operation_info).metadata_type": "ImportEvaluationsOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}:importEvaluations", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportEvaluationsResponse", + "metadata_type": "ImportEvaluationsOperationMetadata" + } + } + ] + }, + "CreateEvaluationDataset": { + "requestType": "CreateEvaluationDatasetRequest", + "responseType": "EvaluationDataset", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationDatasets", + "(google.api.http).body": "evaluation_dataset", + "(google.api.method_signature)": "parent,evaluation_dataset" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationDatasets", + "body": "evaluation_dataset" + } + }, + { + "(google.api.method_signature)": "parent,evaluation_dataset,evaluation_dataset_id" + }, + { + "(google.api.method_signature)": "parent,evaluation_dataset" + } + ] + }, + "UpdateEvaluation": { + "requestType": "UpdateEvaluationRequest", + "responseType": "Evaluation", + "options": { + "(google.api.http).patch": "/v1beta/{evaluation.name=projects/*/locations/*/apps/*/evaluations/*}", + "(google.api.http).body": "evaluation", + "(google.api.method_signature)": "evaluation,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{evaluation.name=projects/*/locations/*/apps/*/evaluations/*}", + "body": "evaluation" + } + }, + { + "(google.api.method_signature)": "evaluation,update_mask" + } + ] + }, + "UpdateEvaluationDataset": { + "requestType": "UpdateEvaluationDatasetRequest", + "responseType": "EvaluationDataset", + "options": { + "(google.api.http).patch": "/v1beta/{evaluation_dataset.name=projects/*/locations/*/apps/*/evaluationDatasets/*}", + "(google.api.http).body": "evaluation_dataset", + "(google.api.method_signature)": "evaluation_dataset,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{evaluation_dataset.name=projects/*/locations/*/apps/*/evaluationDatasets/*}", + "body": "evaluation_dataset" + } + }, + { + "(google.api.method_signature)": "evaluation_dataset,update_mask" + } + ] + }, + "DeleteEvaluation": { + "requestType": "DeleteEvaluationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteEvaluationResult": { + "requestType": "DeleteEvaluationResultRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*/results/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*/results/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteEvaluationDataset": { + "requestType": "DeleteEvaluationDatasetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationDatasets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationDatasets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteEvaluationRun": { + "requestType": "DeleteEvaluationRunRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationRuns/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "DeleteEvaluationRunOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationRuns/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "DeleteEvaluationRunOperationMetadata" + } + } + ] + }, + "GetEvaluation": { + "requestType": "GetEvaluationRequest", + "responseType": "Evaluation", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetEvaluationResult": { + "requestType": "GetEvaluationResultRequest", + "responseType": "EvaluationResult", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*/results/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluations/*/results/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetEvaluationDataset": { + "requestType": "GetEvaluationDatasetRequest", + "responseType": "EvaluationDataset", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationDatasets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationDatasets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetEvaluationRun": { + "requestType": "GetEvaluationRunRequest", + "responseType": "EvaluationRun", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationRuns/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationRuns/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListEvaluations": { + "requestType": "ListEvaluationsRequest", + "responseType": "ListEvaluationsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListEvaluationResults": { + "requestType": "ListEvaluationResultsRequest", + "responseType": "ListEvaluationResultsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*/evaluations/*}/results", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*/evaluations/*}/results" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListEvaluationDatasets": { + "requestType": "ListEvaluationDatasetsRequest", + "responseType": "ListEvaluationDatasetsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationDatasets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationDatasets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListEvaluationRuns": { + "requestType": "ListEvaluationRunsRequest", + "responseType": "ListEvaluationRunsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationRuns", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationRuns" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListEvaluationExpectations": { + "requestType": "ListEvaluationExpectationsRequest", + "responseType": "ListEvaluationExpectationsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationExpectations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationExpectations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetEvaluationExpectation": { + "requestType": "GetEvaluationExpectationRequest", + "responseType": "EvaluationExpectation", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationExpectations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationExpectations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateEvaluationExpectation": { + "requestType": "CreateEvaluationExpectationRequest", + "responseType": "EvaluationExpectation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationExpectations", + "(google.api.http).body": "evaluation_expectation", + "(google.api.method_signature)": "parent,evaluation_expectation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/evaluationExpectations", + "body": "evaluation_expectation" + } + }, + { + "(google.api.method_signature)": "parent,evaluation_expectation,evaluation_expectation_id" + }, + { + "(google.api.method_signature)": "parent,evaluation_expectation" + } + ] + }, + "UpdateEvaluationExpectation": { + "requestType": "UpdateEvaluationExpectationRequest", + "responseType": "EvaluationExpectation", + "options": { + "(google.api.http).patch": "/v1beta/{evaluation_expectation.name=projects/*/locations/*/apps/*/evaluationExpectations/*}", + "(google.api.http).body": "evaluation_expectation", + "(google.api.method_signature)": "evaluation_expectation,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{evaluation_expectation.name=projects/*/locations/*/apps/*/evaluationExpectations/*}", + "body": "evaluation_expectation" + } + }, + { + "(google.api.method_signature)": "evaluation_expectation,update_mask" + } + ] + }, + "DeleteEvaluationExpectation": { + "requestType": "DeleteEvaluationExpectationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationExpectations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/evaluationExpectations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateScheduledEvaluationRun": { + "requestType": "CreateScheduledEvaluationRunRequest", + "responseType": "ScheduledEvaluationRun", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}/scheduledEvaluationRuns", + "(google.api.http).body": "scheduled_evaluation_run", + "(google.api.method_signature)": "parent,scheduled_evaluation_run" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}/scheduledEvaluationRuns", + "body": "scheduled_evaluation_run" + } + }, + { + "(google.api.method_signature)": "parent,scheduled_evaluation_run,scheduled_evaluation_run_id" + }, + { + "(google.api.method_signature)": "parent,scheduled_evaluation_run" + } + ] + }, + "GetScheduledEvaluationRun": { + "requestType": "GetScheduledEvaluationRunRequest", + "responseType": "ScheduledEvaluationRun", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListScheduledEvaluationRuns": { + "requestType": "ListScheduledEvaluationRunsRequest", + "responseType": "ListScheduledEvaluationRunsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/apps/*}/scheduledEvaluationRuns", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/apps/*}/scheduledEvaluationRuns" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateScheduledEvaluationRun": { + "requestType": "UpdateScheduledEvaluationRunRequest", + "responseType": "ScheduledEvaluationRun", + "options": { + "(google.api.http).patch": "/v1beta/{scheduled_evaluation_run.name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}", + "(google.api.http).body": "scheduled_evaluation_run", + "(google.api.method_signature)": "scheduled_evaluation_run,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{scheduled_evaluation_run.name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}", + "body": "scheduled_evaluation_run" + } + }, + { + "(google.api.method_signature)": "scheduled_evaluation_run,update_mask" + } + ] + }, + "DeleteScheduledEvaluationRun": { + "requestType": "DeleteScheduledEvaluationRunRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/apps/*/scheduledEvaluationRuns/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "TestPersonaVoice": { + "requestType": "TestPersonaVoiceRequest", + "responseType": "TestPersonaVoiceResponse", + "options": { + "(google.api.http).post": "/v1beta/{app=projects/*/locations/*/apps/*}:testPersonaVoice", + "(google.api.http).body": "*", + "(google.api.method_signature)": "app" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{app=projects/*/locations/*/apps/*}:testPersonaVoice", + "body": "*" + } + }, + { + "(google.api.method_signature)": "app" + } + ] + } + } + }, + "RunEvaluationResponse": { + "fields": { + "evaluationRun": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" + } + } + } + }, + "RunEvaluationOperationMetadata": { + "fields": { + "evaluations": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/Evaluation" + } + }, + "evaluationRun": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cancelRequested": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GenerateEvaluationOperationMetadata": { + "fields": {} + }, + "DeleteEvaluationRunOperationMetadata": { + "fields": {} + }, + "CreateEvaluationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "evaluationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluation": { + "type": "Evaluation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GenerateEvaluationRequest": { + "fields": { + "conversation": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Conversation" + } + }, + "source": { + "type": "Conversation.Source", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ImportEvaluationsRequest": { + "oneofs": { + "source": { + "oneof": [ + "conversationList", + "gcsUri", + "csvContent" + ] + } + }, + "fields": { + "conversationList": { + "type": "ConversationList", + "id": 2 + }, + "gcsUri": { + "type": "string", + "id": 3 + }, + "csvContent": { + "type": "bytes", + "id": 4 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "importOptions": { + "type": "ImportOptions", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ConversationList": { + "fields": { + "conversations": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ImportOptions": { + "fields": { + "conflictResolutionStrategy": { + "type": "ConflictResolutionStrategy", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ConflictResolutionStrategy": { + "values": { + "CONFLICT_RESOLUTION_STRATEGY_UNSPECIFIED": 0, + "OVERWRITE": 1, + "SKIP": 2, + "DUPLICATE": 3 + } + } + } + } + } + }, + "ImportEvaluationsResponse": { + "fields": { + "evaluations": { + "rule": "repeated", + "type": "Evaluation", + "id": 1 + }, + "errorMessages": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "importFailureCount": { + "type": "int32", + "id": 3 + } + } + }, + "ImportEvaluationsOperationMetadata": { + "fields": { + "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" + } + }, + "statusMessage": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CreateEvaluationDatasetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "evaluationDatasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationDataset": { + "type": "EvaluationDataset", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateEvaluationRequest": { + "fields": { + "evaluation": { + "type": "Evaluation", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateEvaluationDatasetRequest": { + "fields": { + "evaluationDataset": { + "type": "EvaluationDataset", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteEvaluationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Evaluation" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteEvaluationResultRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationResult" + } + } + } + }, + "DeleteEvaluationDatasetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationDataset" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteEvaluationRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" + } + } + } + }, + "GetEvaluationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Evaluation" + } + } + } + }, + "GetEvaluationResultRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationResult" + } + } + } + }, + "GetEvaluationDatasetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationDataset" + } + } + } + }, + "GetEvaluationRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" + } + } + } + }, + "ListEvaluationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/Evaluation" + } + }, + "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": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationFilter": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationRunFilter": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lastTenResults": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListEvaluationResultsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/EvaluationResult" + } + }, + "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" + } + } + } + }, + "ListEvaluationDatasetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/EvaluationDataset" + } + }, + "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" + } + } + } + }, + "ListEvaluationRunsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/EvaluationRun" + } + }, + "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" + } + } + } + }, + "ListEvaluationsResponse": { + "fields": { + "evaluations": { + "rule": "repeated", + "type": "Evaluation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListEvaluationResultsResponse": { + "fields": { + "evaluationResults": { + "rule": "repeated", + "type": "EvaluationResult", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListEvaluationDatasetsResponse": { + "fields": { + "evaluationDatasets": { + "rule": "repeated", + "type": "EvaluationDataset", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListEvaluationRunsResponse": { + "fields": { + "evaluationRuns": { + "rule": "repeated", + "type": "EvaluationRun", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateScheduledEvaluationRunRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "scheduledEvaluationRunId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scheduledEvaluationRun": { + "type": "ScheduledEvaluationRun", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetScheduledEvaluationRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/ScheduledEvaluationRun" + } + } + } + }, + "ListScheduledEvaluationRunsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/ScheduledEvaluationRun" + } + }, + "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" + } + } + } + }, + "ListScheduledEvaluationRunsResponse": { + "fields": { + "scheduledEvaluationRuns": { + "rule": "repeated", + "type": "ScheduledEvaluationRun", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateScheduledEvaluationRunRequest": { + "fields": { + "scheduledEvaluationRun": { + "type": "ScheduledEvaluationRun", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteScheduledEvaluationRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/ScheduledEvaluationRun" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TestPersonaVoiceRequest": { + "fields": { + "app": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "personaId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "text": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UploadEvaluationAudioRequest": { + "fields": { + "app": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "audioContent": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UploadEvaluationAudioResponse": { + "fields": { + "audioGcsUri": { + "type": "string", + "id": 1 + }, + "audioTranscript": { + "type": "string", + "id": 2 + }, + "audioDuration": { + "type": "google.protobuf.Duration", + "id": 3 + } + } + }, + "TestPersonaVoiceResponse": { + "fields": { + "audio": { + "type": "bytes", + "id": 1 + } + } + }, + "CreateEvaluationExpectationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "evaluationExpectationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationExpectation": { + "type": "EvaluationExpectation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateEvaluationExpectationRequest": { + "fields": { + "evaluationExpectation": { + "type": "EvaluationExpectation", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteEvaluationExpectationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationExpectation" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetEvaluationExpectationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationExpectation" + } + } + } + }, + "ListEvaluationExpectationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "ces.googleapis.com/EvaluationExpectation" + } + }, + "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" + } + } + } + }, + "ListEvaluationExpectationsResponse": { + "fields": { + "evaluationExpectations": { + "rule": "repeated", + "type": "EvaluationExpectation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "Omnichannel": { + "options": { + "(google.api.resource).type": "ces.googleapis.com/Omnichannel", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/omnichannels/{omnichannel}", + "(google.api.resource).plural": "omnichannels", + "(google.api.resource).singular": "omnichannel" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "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" + } + }, + "etag": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "integrationConfig": { + "type": "OmnichannelIntegrationConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OmnichannelIntegrationConfig": { + "fields": { + "channelConfigs": { + "keyType": "string", + "type": "ChannelConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subscriberConfigs": { + "keyType": "string", + "type": "SubscriberConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "routingConfigs": { + "keyType": "string", + "type": "RoutingConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ChannelConfig": { + "oneofs": { + "channelConfig": { + "oneof": [ + "whatsappConfig" + ] + } + }, + "fields": { + "whatsappConfig": { + "type": "WhatsappConfig", + "id": 1 + } + } + }, + "WhatsappConfig": { + "fields": { + "phoneNumberId": { + "type": "string", + "id": 1 + }, + "phoneNumber": { + "type": "string", + "id": 2 + }, + "whatsappBusinessAccountId": { + "type": "string", + "id": 3 + }, + "webhookVerifyToken": { + "type": "string", + "id": 4 + }, + "whatsappBusinessToken": { + "type": "string", + "id": 5 + }, + "metaBusinessPortfolioId": { + "type": "string", + "id": 6 + } + } + }, + "SubscriberConfig": { + "oneofs": { + "subscriberConfig": { + "oneof": [ + "cesAppConfig" + ] + } + }, + "fields": { + "cesAppConfig": { + "type": "CesAppConfig", + "id": 1 + } + } + }, + "CesAppConfig": { + "fields": { + "app": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + } + } + }, + "RoutingConfig": { + "fields": { + "subscriberKey": { + "type": "string", + "id": 1 + } + } + } + } + }, + "OmnichannelOperationMetadata": { + "fields": { + "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" + } + }, + "statusMessage": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ToolService": { + "options": { + "(google.api.default_host)": "ces.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ExecuteTool": { + "requestType": "ExecuteToolRequest", + "responseType": "ExecuteToolResponse", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}:executeTool", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}:executeTool", + "body": "*" + } + } + ] + }, + "RetrieveToolSchema": { + "requestType": "RetrieveToolSchemaRequest", + "responseType": "RetrieveToolSchemaResponse", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}:retrieveToolSchema", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}:retrieveToolSchema", + "body": "*" + } + } + ] + }, + "RetrieveTools": { + "requestType": "RetrieveToolsRequest", + "responseType": "RetrieveToolsResponse", + "options": { + "(google.api.http).post": "/v1beta/{toolset=projects/*/locations/*/apps/*/toolsets/*}:retrieveTools", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{toolset=projects/*/locations/*/apps/*/toolsets/*}:retrieveTools", + "body": "*" + } + } + ] + } + } + }, + "ExecuteToolRequest": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parent": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "args": { + "type": "google.protobuf.Struct", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "variables": { + "type": "google.protobuf.Struct", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExecuteToolResponse": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 3 + }, + "response": { + "type": "google.protobuf.Struct", + "id": 2 + }, + "variables": { + "type": "google.protobuf.Struct", + "id": 4 + } + } + }, + "RetrieveToolSchemaRequest": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parent": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + } + } + }, + "RetrieveToolSchemaResponse": { + "oneofs": { + "toolIdentifier": { + "oneof": [ + "tool", + "toolsetTool" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "ces.googleapis.com/Tool" + } + }, + "toolsetTool": { + "type": "ToolsetTool", + "id": 2 + }, + "inputSchema": { + "type": "Schema", + "id": 3 + }, + "outputSchema": { + "type": "Schema", + "id": 4 + } + } + }, + "RetrieveToolsRequest": { + "fields": { + "toolset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Toolset" + } + }, + "toolIds": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RetrieveToolsResponse": { + "fields": { + "tools": { + "rule": "repeated", + "type": "Tool", + "id": 1 + } + } + }, + "WidgetService": { + "options": { + "(google.api.default_host)": "ces.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/ces,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GenerateChatToken": { + "requestType": "GenerateChatTokenRequest", + "responseType": "GenerateChatTokenResponse", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/apps/*/sessions/*}:generateChatToken", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{name=projects/*/locations/*/apps/*/sessions/*}:generateChatToken", + "body": "*" + } + } + ] + } + } + }, + "GenerateChatTokenRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Session" + } + }, + "deployment": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/Deployment" + } + }, + "recaptchaToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GenerateChatTokenResponse": { + "fields": { + "chatToken": { + "type": "string", + "id": 1 + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + } + } } } } diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.batch_delete_conversations.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.batch_delete_conversations.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.batch_delete_conversations.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.batch_delete_conversations.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_agent.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_agent.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_agent.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_agent.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_app.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_app.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_app.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_app.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_app_version.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_app_version.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_app_version.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_app_version.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_deployment.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_deployment.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_deployment.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_deployment.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_example.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_example.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_example.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_example.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_guardrail.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_guardrail.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_guardrail.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_guardrail.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_tool.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_tool.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_tool.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_tool.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_toolset.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_toolset.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.create_toolset.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.create_toolset.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_agent.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_agent.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_agent.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_agent.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app_version.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app_version.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app_version.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_app_version.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_conversation.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_conversation.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_conversation.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_conversation.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_deployment.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_deployment.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_deployment.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_deployment.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_example.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_example.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_example.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_example.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_guardrail.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_guardrail.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_guardrail.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_guardrail.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_tool.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_tool.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_tool.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_tool.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_toolset.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_toolset.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.delete_toolset.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_toolset.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.export_app.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.export_app.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.export_app.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.export_app.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_agent.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_agent.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_agent.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_agent.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_app.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_app.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_app.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_app.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_app_version.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_app_version.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_app_version.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_app_version.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_changelog.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_changelog.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_changelog.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_changelog.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_conversation.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_conversation.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_conversation.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_conversation.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_deployment.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_deployment.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_deployment.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_deployment.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_example.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_example.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_example.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_example.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_guardrail.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_guardrail.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_guardrail.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_guardrail.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_tool.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_tool.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_tool.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_tool.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_toolset.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_toolset.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.get_toolset.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_toolset.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.import_app.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.import_app.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.import_app.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.import_app.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_agents.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_agents.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_agents.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_agents.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_app_versions.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_app_versions.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_app_versions.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_app_versions.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_apps.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_apps.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_apps.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_apps.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_changelogs.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_changelogs.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_changelogs.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_changelogs.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_conversations.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_conversations.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_conversations.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_conversations.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_deployments.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_deployments.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_deployments.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_deployments.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_examples.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_examples.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_examples.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_examples.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_guardrails.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_guardrails.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_guardrails.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_guardrails.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_tools.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_tools.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_tools.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_tools.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_toolsets.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_toolsets.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.list_toolsets.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.list_toolsets.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.restore_app_version.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.restore_app_version.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.restore_app_version.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.restore_app_version.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_agent.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_agent.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_agent.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_agent.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_app.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_app.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_app.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_app.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_deployment.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_deployment.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_deployment.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_deployment.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_example.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_example.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_example.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_example.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_guardrail.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_guardrail.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_guardrail.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_guardrail.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_tool.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_tool.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_tool.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_tool.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_toolset.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_toolset.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/agent_service.update_toolset.js rename to packages/google-cloud-ces/samples/generated/v1beta/agent_service.update_toolset.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_dataset.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_dataset.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_dataset.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_dataset.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_expectation.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_expectation.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_expectation.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_evaluation_expectation.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_scheduled_evaluation_run.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_scheduled_evaluation_run.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_scheduled_evaluation_run.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.create_scheduled_evaluation_run.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_dataset.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_dataset.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_dataset.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_dataset.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_expectation.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_expectation.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_expectation.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_expectation.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_result.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_result.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_result.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_result.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_run.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_run.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_run.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_evaluation_run.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_scheduled_evaluation_run.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_scheduled_evaluation_run.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_scheduled_evaluation_run.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.delete_scheduled_evaluation_run.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.generate_evaluation.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.generate_evaluation.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.generate_evaluation.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.generate_evaluation.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_dataset.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_dataset.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_dataset.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_dataset.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_expectation.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_expectation.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_expectation.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_expectation.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_result.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_result.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_result.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_result.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_run.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_run.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_run.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_evaluation_run.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_scheduled_evaluation_run.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_scheduled_evaluation_run.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_scheduled_evaluation_run.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.get_scheduled_evaluation_run.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.import_evaluations.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.import_evaluations.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.import_evaluations.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.import_evaluations.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_datasets.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_datasets.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_datasets.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_datasets.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_expectations.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_expectations.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_expectations.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_expectations.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_results.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_results.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_results.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_results.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_runs.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_runs.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_runs.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluation_runs.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluations.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluations.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluations.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_evaluations.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_scheduled_evaluation_runs.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_scheduled_evaluation_runs.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_scheduled_evaluation_runs.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.list_scheduled_evaluation_runs.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.run_evaluation.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.run_evaluation.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.run_evaluation.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.run_evaluation.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.test_persona_voice.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.test_persona_voice.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.test_persona_voice.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.test_persona_voice.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_dataset.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_dataset.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_dataset.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_dataset.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_expectation.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_expectation.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_expectation.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_evaluation_expectation.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_scheduled_evaluation_run.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_scheduled_evaluation_run.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_scheduled_evaluation_run.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.update_scheduled_evaluation_run.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.upload_evaluation_audio.js b/packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.upload_evaluation_audio.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/evaluation_service.upload_evaluation_audio.js rename to packages/google-cloud-ces/samples/generated/v1beta/evaluation_service.upload_evaluation_audio.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/session_service.bidi_run_session.js b/packages/google-cloud-ces/samples/generated/v1beta/session_service.bidi_run_session.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/session_service.bidi_run_session.js rename to packages/google-cloud-ces/samples/generated/v1beta/session_service.bidi_run_session.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/session_service.run_session.js b/packages/google-cloud-ces/samples/generated/v1beta/session_service.run_session.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/session_service.run_session.js rename to packages/google-cloud-ces/samples/generated/v1beta/session_service.run_session.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/snippet_metadata_google.cloud.ces.v1beta.json b/packages/google-cloud-ces/samples/generated/v1beta/snippet_metadata_google.cloud.ces.v1beta.json similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/snippet_metadata_google.cloud.ces.v1beta.json rename to packages/google-cloud-ces/samples/generated/v1beta/snippet_metadata_google.cloud.ces.v1beta.json diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/tool_service.execute_tool.js b/packages/google-cloud-ces/samples/generated/v1beta/tool_service.execute_tool.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/tool_service.execute_tool.js rename to packages/google-cloud-ces/samples/generated/v1beta/tool_service.execute_tool.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tool_schema.js b/packages/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tool_schema.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tool_schema.js rename to packages/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tool_schema.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tools.js b/packages/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tools.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tools.js rename to packages/google-cloud-ces/samples/generated/v1beta/tool_service.retrieve_tools.js diff --git a/owl-bot-staging/google-cloud-ces/samples/generated/v1beta/widget_service.generate_chat_token.js b/packages/google-cloud-ces/samples/generated/v1beta/widget_service.generate_chat_token.js similarity index 100% rename from owl-bot-staging/google-cloud-ces/samples/generated/v1beta/widget_service.generate_chat_token.js rename to packages/google-cloud-ces/samples/generated/v1beta/widget_service.generate_chat_token.js diff --git a/packages/google-cloud-ces/src/index.ts b/packages/google-cloud-ces/src/index.ts index c916b73a609..d7aa3bc90a3 100644 --- a/packages/google-cloud-ces/src/index.ts +++ b/packages/google-cloud-ces/src/index.ts @@ -17,6 +17,7 @@ // ** All changes to this file may be overwritten. ** import * as v1 from './v1'; +import * as v1beta from './v1beta'; const AgentServiceClient = v1.AgentServiceClient; type AgentServiceClient = v1.AgentServiceClient; @@ -27,7 +28,7 @@ type ToolServiceClient = v1.ToolServiceClient; const WidgetServiceClient = v1.WidgetServiceClient; type WidgetServiceClient = v1.WidgetServiceClient; -export {v1, AgentServiceClient, SessionServiceClient, ToolServiceClient, WidgetServiceClient}; -export default {v1, AgentServiceClient, SessionServiceClient, ToolServiceClient, WidgetServiceClient}; +export {v1, v1beta, AgentServiceClient, SessionServiceClient, ToolServiceClient, WidgetServiceClient}; +export default {v1, v1beta, AgentServiceClient, SessionServiceClient, ToolServiceClient, WidgetServiceClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/agent_service_client.ts b/packages/google-cloud-ces/src/v1beta/agent_service_client.ts similarity index 100% rename from owl-bot-staging/google-cloud-ces/src/v1beta/agent_service_client.ts rename to packages/google-cloud-ces/src/v1beta/agent_service_client.ts diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/agent_service_client_config.json b/packages/google-cloud-ces/src/v1beta/agent_service_client_config.json similarity index 100% rename from owl-bot-staging/google-cloud-ces/src/v1beta/agent_service_client_config.json rename to packages/google-cloud-ces/src/v1beta/agent_service_client_config.json diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/agent_service_proto_list.json b/packages/google-cloud-ces/src/v1beta/agent_service_proto_list.json similarity index 100% rename from owl-bot-staging/google-cloud-ces/src/v1beta/agent_service_proto_list.json rename to packages/google-cloud-ces/src/v1beta/agent_service_proto_list.json diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/evaluation_service_client.ts b/packages/google-cloud-ces/src/v1beta/evaluation_service_client.ts similarity index 100% rename from owl-bot-staging/google-cloud-ces/src/v1beta/evaluation_service_client.ts rename to packages/google-cloud-ces/src/v1beta/evaluation_service_client.ts diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/evaluation_service_client_config.json b/packages/google-cloud-ces/src/v1beta/evaluation_service_client_config.json similarity index 100% rename from owl-bot-staging/google-cloud-ces/src/v1beta/evaluation_service_client_config.json rename to packages/google-cloud-ces/src/v1beta/evaluation_service_client_config.json diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/evaluation_service_proto_list.json b/packages/google-cloud-ces/src/v1beta/evaluation_service_proto_list.json similarity index 100% rename from owl-bot-staging/google-cloud-ces/src/v1beta/evaluation_service_proto_list.json rename to packages/google-cloud-ces/src/v1beta/evaluation_service_proto_list.json diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/gapic_metadata.json b/packages/google-cloud-ces/src/v1beta/gapic_metadata.json similarity index 100% rename from owl-bot-staging/google-cloud-ces/src/v1beta/gapic_metadata.json rename to packages/google-cloud-ces/src/v1beta/gapic_metadata.json diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/index.ts b/packages/google-cloud-ces/src/v1beta/index.ts similarity index 100% rename from owl-bot-staging/google-cloud-ces/src/v1beta/index.ts rename to packages/google-cloud-ces/src/v1beta/index.ts diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/session_service_client.ts b/packages/google-cloud-ces/src/v1beta/session_service_client.ts similarity index 100% rename from owl-bot-staging/google-cloud-ces/src/v1beta/session_service_client.ts rename to packages/google-cloud-ces/src/v1beta/session_service_client.ts diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/session_service_client_config.json b/packages/google-cloud-ces/src/v1beta/session_service_client_config.json similarity index 100% rename from owl-bot-staging/google-cloud-ces/src/v1beta/session_service_client_config.json rename to packages/google-cloud-ces/src/v1beta/session_service_client_config.json diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/session_service_proto_list.json b/packages/google-cloud-ces/src/v1beta/session_service_proto_list.json similarity index 100% rename from owl-bot-staging/google-cloud-ces/src/v1beta/session_service_proto_list.json rename to packages/google-cloud-ces/src/v1beta/session_service_proto_list.json diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/tool_service_client.ts b/packages/google-cloud-ces/src/v1beta/tool_service_client.ts similarity index 100% rename from owl-bot-staging/google-cloud-ces/src/v1beta/tool_service_client.ts rename to packages/google-cloud-ces/src/v1beta/tool_service_client.ts diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/tool_service_client_config.json b/packages/google-cloud-ces/src/v1beta/tool_service_client_config.json similarity index 100% rename from owl-bot-staging/google-cloud-ces/src/v1beta/tool_service_client_config.json rename to packages/google-cloud-ces/src/v1beta/tool_service_client_config.json diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/tool_service_proto_list.json b/packages/google-cloud-ces/src/v1beta/tool_service_proto_list.json similarity index 100% rename from owl-bot-staging/google-cloud-ces/src/v1beta/tool_service_proto_list.json rename to packages/google-cloud-ces/src/v1beta/tool_service_proto_list.json diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/widget_service_client.ts b/packages/google-cloud-ces/src/v1beta/widget_service_client.ts similarity index 100% rename from owl-bot-staging/google-cloud-ces/src/v1beta/widget_service_client.ts rename to packages/google-cloud-ces/src/v1beta/widget_service_client.ts diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/widget_service_client_config.json b/packages/google-cloud-ces/src/v1beta/widget_service_client_config.json similarity index 100% rename from owl-bot-staging/google-cloud-ces/src/v1beta/widget_service_client_config.json rename to packages/google-cloud-ces/src/v1beta/widget_service_client_config.json diff --git a/owl-bot-staging/google-cloud-ces/src/v1beta/widget_service_proto_list.json b/packages/google-cloud-ces/src/v1beta/widget_service_proto_list.json similarity index 100% rename from owl-bot-staging/google-cloud-ces/src/v1beta/widget_service_proto_list.json rename to packages/google-cloud-ces/src/v1beta/widget_service_proto_list.json diff --git a/owl-bot-staging/google-cloud-ces/test/gapic_agent_service_v1beta.ts b/packages/google-cloud-ces/test/gapic_agent_service_v1beta.ts similarity index 100% rename from owl-bot-staging/google-cloud-ces/test/gapic_agent_service_v1beta.ts rename to packages/google-cloud-ces/test/gapic_agent_service_v1beta.ts diff --git a/owl-bot-staging/google-cloud-ces/test/gapic_evaluation_service_v1beta.ts b/packages/google-cloud-ces/test/gapic_evaluation_service_v1beta.ts similarity index 100% rename from owl-bot-staging/google-cloud-ces/test/gapic_evaluation_service_v1beta.ts rename to packages/google-cloud-ces/test/gapic_evaluation_service_v1beta.ts diff --git a/owl-bot-staging/google-cloud-ces/test/gapic_session_service_v1beta.ts b/packages/google-cloud-ces/test/gapic_session_service_v1beta.ts similarity index 100% rename from owl-bot-staging/google-cloud-ces/test/gapic_session_service_v1beta.ts rename to packages/google-cloud-ces/test/gapic_session_service_v1beta.ts diff --git a/owl-bot-staging/google-cloud-ces/test/gapic_tool_service_v1beta.ts b/packages/google-cloud-ces/test/gapic_tool_service_v1beta.ts similarity index 100% rename from owl-bot-staging/google-cloud-ces/test/gapic_tool_service_v1beta.ts rename to packages/google-cloud-ces/test/gapic_tool_service_v1beta.ts diff --git a/owl-bot-staging/google-cloud-ces/test/gapic_widget_service_v1beta.ts b/packages/google-cloud-ces/test/gapic_widget_service_v1beta.ts similarity index 100% rename from owl-bot-staging/google-cloud-ces/test/gapic_widget_service_v1beta.ts rename to packages/google-cloud-ces/test/gapic_widget_service_v1beta.ts